import{bB as i,bC as a,bD as e,bE as t,bF as o,bG as l,bH as d,bI as s,bJ as n,bK as r,bL as c,bM as u,bN as m,bO as h,bP as v,bQ as p,O as _,_ as b,j as g,e as y,t as k,y as f,k as x,ba as $,bR as w,d as z,n as j}from"./main-85e087f9.js";import{s as U}from"./c.04ecc0ad.js";import{b as I,e as C}from"./c.07e395f8.js";import"./c.fea0de05.js";const M="browser",q={album:{icon:i,layout:"grid"},app:{icon:a,layout:"grid"},artist:{icon:e,layout:"grid",show_list_images:!0},channel:{icon:t,thumbnail_ratio:"portrait",layout:"grid"},composer:{icon:o,layout:"grid",show_list_images:!0},contributing_artist:{icon:e,layout:"grid",show_list_images:!0},directory:{icon:l,layout:"grid",show_list_images:!0},episode:{icon:t,layout:"grid",thumbnail_ratio:"portrait"},game:{icon:d,layout:"grid",thumbnail_ratio:"portrait"},genre:{icon:s,layout:"grid",show_list_images:!0},image:{icon:n,layout:"grid"},movie:{icon:r,thumbnail_ratio:"portrait",layout:"grid"},music:{icon:c},playlist:{icon:u,layout:"grid",show_list_images:!0},podcast:{icon:m,layout:"grid"},season:{icon:t,layout:"grid",thumbnail_ratio:"portrait"},track:{icon:h},tv_show:{icon:t,layout:"grid",thumbnail_ratio:"portrait"},url:{icon:v},video:{icon:p,layout:"grid"}},B=(i,a,e,t)=>i.callWS({type:"media_player/browse_media",entity_id:a,media_content_id:e,media_content_type:t}),L=[{name:"media_content_id",required:!1,selector:{text:{}}},{name:"media_content_type",required:!1,selector:{text:{}}}];let O=b([j("ha-selector-media")],(function(i,a){return{F:class extends a{constructor(...a){super(...a),i(this)}},d:[{kind:"field",decorators:[y({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[y({attribute:!1})],key:"selector",value:void 0},{kind:"field",decorators:[y({attribute:!1})],key:"value",value:void 0},{kind:"field",decorators:[y()],key:"label",value:void 0},{kind:"field",decorators:[y()],key:"helper",value:void 0},{kind:"field",decorators:[y({type:Boolean,reflect:!0})],key:"disabled",value:()=>!1},{kind:"field",decorators:[y({type:Boolean,reflect:!0})],key:"required",value:()=>!0},{kind:"field",decorators:[k()],key:"_thumbnailUrl",value:void 0},{kind:"method",key:"willUpdate",value:function(i){if(i.has("value")){var a,e,t,o;const n=null===(a=this.value)||void 0===a||null===(e=a.metadata)||void 0===e?void 0:e.thumbnail;if(n===(null===(t=i.get("value"))||void 0===t||null===(o=t.metadata)||void 0===o?void 0:o.thumbnail))return;if(n&&n.startsWith("/"))this._thumbnailUrl=void 0,(d=this.hass,s=n,d.callWS({type:"auth/sign_path",path:s})).then((i=>{this._thumbnailUrl=i.path}));else if(n&&n.startsWith("https://brands.home-assistant.io")){var l;this._thumbnailUrl=I({domain:C(n),type:"icon",useFallback:!0,darkOptimized:null===(l=this.hass.themes)||void 0===l?void 0:l.darkMode})}else this._thumbnailUrl=n}var d,s}},{kind:"method",key:"render",value:function(){var i,a,e,t,o,l,d,s,n,r,c,u,m;const h=null!==(i=this.value)&&void 0!==i&&i.entity_id?this.hass.states[this.value.entity_id]:void 0,v=!(null!==(a=this.value)&&void 0!==a&&a.entity_id)||h&&U(h,131072);return f`
${v?f`