export const __rspack_esm_id="59873";export const __rspack_esm_ids=["59873"];export const __webpack_modules__={68348(t,e,s){s.d(e,{u:()=>i});s(18111),s(13579);const i=t=>{if(t.some(t=>"tagName"in t&&("HA-MENU"===t.tagName||"HA-CODE-EDITOR"===t.tagName)))return!1;const e=t[0];if("TEXTAREA"===e.tagName)return!1;if("HA-SELECT"===e.parentElement?.tagName)return!1;if("INPUT"!==e.tagName)return!0;switch(e.type){case"button":case"checkbox":case"hidden":case"radio":case"range":return!0;default:return!1}}},84446(t,e,s){s.d(e,{p:()=>o,z:()=>a});s(17642),s(58004),s(33853),s(45876),s(32475),s(15024),s(31698);var i=s(71727);const a=t=>t.include_domains.length+t.include_entities.length+t.exclude_domains.length+t.exclude_entities.length===0,o=(t,e,s,a)=>{const o=new Set(t),n=new Set(e),l=new Set(s),r=new Set(a),d=o.size>0||n.size>0,c=l.size>0||r.size>0;return d||c?d&&!c?t=>n.has(t)||o.has((0,i.m)(t)):!d&&c?t=>!r.has(t)&&!l.has((0,i.m)(t)):o.size?t=>o.has((0,i.m)(t))?!r.has(t):n.has(t):l.size?t=>l.has((0,i.m)(t))?n.has(t):!r.has(t):t=>n.has(t):()=>!0}},27661(t,e,s){var i=s(62826),a=s(51978),o=s(94743),n=s(44457),l=s(96196),r=s(63091);class d extends a.n{firstUpdated(t){super.firstUpdated(t),this.style.setProperty("--mdc-theme-secondary","var(--primary-color)")}}d.styles=[o.R,l.AH`:host{--mdc-typography-button-text-transform:none;--mdc-typography-button-font-size:var(--ha-font-size-l);--mdc-typography-button-font-family:var(--ha-font-family-body);--mdc-typography-button-font-weight:var(--ha-font-weight-medium)}:host .mdc-fab--extended{border-radius:var(--ha-button-border-radius,var(--ha-border-radius-pill))}:host .mdc-fab.mdc-fab--extended .ripple{border-radius:var(--ha-button-border-radius,var(--ha-border-radius-pill))}:host .mdc-fab--extended .mdc-fab__icon{margin-inline-start:-8px;margin-inline-end:12px;direction:var(--direction)}:disabled{--mdc-theme-secondary:var(--disabled-text-color);pointer-events:none}`,"rtl"===r.G.document.dir?l.AH`:host .mdc-fab--extended .mdc-fab__icon{direction:rtl}`:l.AH``],d=(0,i.Cg)([(0,n.EM)("ha-fab")],d)},34127(t,e,s){s.a(t,async function(t,e){try{var i=s(62826),a=s(52630),o=s(96196),n=s(44457),l=t([a]);a=(l.then?(await l)():l)[0];class r extends a.A{static get styles(){return[a.A.styles,o.AH`:host{--wa-tooltip-background-color:var(--secondary-background-color);--wa-tooltip-content-color:var(--primary-text-color);--wa-tooltip-font-family:var(
            --ha-tooltip-font-family,
            var(--ha-font-family-body)
          );--wa-tooltip-font-size:var(
            --ha-tooltip-font-size,
            var(--ha-font-size-s)
          );--wa-tooltip-font-weight:var(
            --ha-tooltip-font-weight,
            var(--ha-font-weight-normal)
          );--wa-tooltip-line-height:var(
            --ha-tooltip-line-height,
            var(--ha-line-height-condensed)
          );--wa-tooltip-padding:8px;--wa-tooltip-border-radius:var(
            --ha-tooltip-border-radius,
            var(--ha-border-radius-sm)
          );--wa-tooltip-arrow-size:var(--ha-tooltip-arrow-size, 8px);--wa-z-index-tooltip:var(--ha-tooltip-z-index, 1000)}`]}constructor(...t){super(...t),this.showDelay=150,this.hideDelay=150}}(0,i.Cg)([(0,n.MZ)({attribute:"show-delay",type:Number})],r.prototype,"showDelay",void 0),(0,i.Cg)([(0,n.MZ)({attribute:"hide-delay",type:Number})],r.prototype,"hideDelay",void 0),r=(0,i.Cg)([(0,n.EM)("ha-tooltip")],r),e()}catch(t){e(t)}})},53211(t,e,s){s.d(e,{Gk:()=>a,Gq:()=>i});const i=t=>t.callWS({type:"cloud/alexa/entities"}),a=(t,e)=>t.callWS({type:"cloud/alexa/entities/get",entity_id:e})},56982(t,e,s){s.d(e,{ig:()=>i,kz:()=>a});const i=t=>t.callWS({type:"cloud/google_assistant/entities"}),a=(t,e)=>t.callWS({type:"cloud/google_assistant/entities/get",entity_id:e})},23296(t,e,s){s.a(t,async function(t,i){try{s.r(e);var a=s(62826),o=s(96196),n=s(44457),l=s(91926),r=s(65829),d=(s(90248),s(2054),s(14503)),c=t([r]);r=(c.then?(await c)():c)[0];class h extends o.WF{render(){return o.qy` ${this.noToolbar?"":o.qy`<div class="toolbar"> ${this.rootnav||history.state?.root?o.qy` <ha-menu-button .hass="${this.hass}" .narrow="${this.narrow}"></ha-menu-button> `:o.qy` <ha-icon-button-arrow-prev .hass="${this.hass}" @click="${this._handleBack}"></ha-icon-button-arrow-prev> `} </div>`} <div class="content"> <ha-spinner></ha-spinner> ${this.message?o.qy`<div id="loading-text">${this.message}</div>`:o.s6} </div> `}_handleBack(){(0,l.O)()}static get styles(){return[d.RF,o.AH`:host{display:block;height:100%;background-color:var(--primary-background-color)}.toolbar{display:flex;align-items:center;font-size:var(--ha-font-size-xl);height:var(--header-height);padding:8px 12px;pointer-events:none;background-color:var(--app-header-background-color);font-weight:var(--ha-font-weight-normal);color:var(--app-header-text-color,#fff);border-bottom:var(--app-header-border-bottom,none);box-sizing:border-box}@media (max-width:599px){.toolbar{padding:4px}}ha-icon-button-arrow-prev,ha-menu-button{pointer-events:auto}.content{height:calc(100% - var(--header-height));display:flex;flex-direction:column;align-items:center;justify-content:center}#loading-text{max-width:350px;margin-top:16px}`]}constructor(...t){super(...t),this.noToolbar=!1,this.rootnav=!1,this.narrow=!1}}(0,a.Cg)([(0,n.MZ)({attribute:!1})],h.prototype,"hass",void 0),(0,a.Cg)([(0,n.MZ)({type:Boolean,attribute:"no-toolbar"})],h.prototype,"noToolbar",void 0),(0,a.Cg)([(0,n.MZ)({type:Boolean})],h.prototype,"rootnav",void 0),(0,a.Cg)([(0,n.MZ)({type:Boolean})],h.prototype,"narrow",void 0),(0,a.Cg)([(0,n.MZ)()],h.prototype,"message",void 0),h=(0,a.Cg)([(0,n.EM)("hass-loading-screen")],h),i()}catch(t){i(t)}})},75197(t,e,s){s.a(t,async function(t,e){try{var i=s(62826),a=s(96196),o=s(44457),n=s(6415),l=s(14782),r=s(44144),d=(s(67094),s(34127)),c=t([d]);d=(c.then?(await c)():c)[0];const h="M13,13H11V7H13M13,17H11V15H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z";class p extends a.WF{render(){return this.assistant&&l.aK[this.assistant]?a.qy` <div class="container" id="container"> <img class="logo" style="${(0,n.W)({filter:this.manual?"grayscale(100%)":void 0})}" alt="${l.aK[this.assistant].name}" src="${(0,r.MR)({domain:l.aK[this.assistant].domain,type:"icon",darkOptimized:this.hass.themes?.darkMode})}" crossorigin="anonymous" referrerpolicy="no-referrer" slot="prefix"> ${this.unsupported?a.qy` <ha-svg-icon .path="${h}" class="unsupported"></ha-svg-icon> `:a.s6} </div> <ha-tooltip for="container" placement="left" .disabled="${!this.unsupported&&!this.manual}"> ${this.unsupported?this.hass.localize("ui.panel.config.voice_assistants.expose.not_supported"):""} ${this.unsupported&&this.manual?a.qy`<br>`:a.s6} ${this.manual?this.hass.localize("ui.panel.config.voice_assistants.expose.manually_configured"):a.s6} </ha-tooltip> `:a.s6}constructor(...t){super(...t),this.unsupported=!1,this.manual=!1}}p.styles=a.AH`.container{position:relative}.logo{position:relative;height:24px;margin-right:16px;margin-inline-end:16px;margin-inline-start:initial}.unsupported{color:var(--error-color);position:absolute;--mdc-icon-size:16px;right:10px;top:-7px;inset-inline-end:10px;inset-inline-start:initial}`,(0,i.Cg)([(0,o.MZ)({attribute:!1})],p.prototype,"hass",void 0),(0,i.Cg)([(0,o.MZ)({type:Boolean})],p.prototype,"unsupported",void 0),(0,i.Cg)([(0,o.MZ)({type:Boolean})],p.prototype,"manual",void 0),(0,i.Cg)([(0,o.MZ)()],p.prototype,"assistant",void 0),p=(0,i.Cg)([(0,o.EM)("voice-assistants-expose-assistant-icon")],p),e()}catch(t){e(t)}})},43601(t,e,s){s.a(t,async function(t,i){try{s.r(e),s.d(e,{VoiceAssistantsExpose:()=>Z});s(44114),s(18111),s(22489),s(7588),s(61701),s(13579),s(14603),s(47566),s(98721);var a=s(62826),o=s(16527),n=s(96196),l=s(44457),r=s(32288),d=s(22786),c=s(93905),h=s(1087),p=s(71727),u=s(28978),g=s(84446),_=s(91926),m=s(18350),b=(s(27661),s(34127)),v=s(53211),x=s(38911),y=s(59241),f=s(14782),w=s(56982),C=s(95350),$=s(65063),E=s(23296),k=(s(72553),s(14503)),S=s(75197),z=s(72440),A=s(60702),H=s(99436),M=t([m,b,E,S]);[m,b,E,S]=M.then?(await M)():M;const L="M4 20H18V22H4C2.9 22 2 21.11 2 20V6H4V20M20.22 2H7.78C6.8 2 6 2.8 6 3.78V16.22C6 17.2 6.8 18 7.78 18H20.22C21.2 18 22 17.2 22 16.22V3.78C22 2.8 21.2 2 20.22 2M19 13.6L17.6 15L14 11.4L10.4 15L9 13.6L12.6 10L9 6.4L10.4 5L14 8.6L17.6 5L19 6.4L15.4 10L19 13.6Z",P="M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,2C6.47,2 2,6.47 2,12C2,17.53 6.47,22 12,22C17.53,22 22,17.53 22,12C22,6.47 17.53,2 12,2M14.59,8L12,10.59L9.41,8L8,9.41L10.59,12L8,14.59L9.41,16L12,13.41L14.59,16L16,14.59L13.41,12L16,9.41L14.59,8Z",V="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z",O="M19,11H15V15H13V11H9V9H13V5H15V9H19M20,2H8A2,2 0 0,0 6,4V16A2,2 0 0,0 8,18H20A2,2 0 0,0 22,16V4A2,2 0 0,0 20,2M4,6H2V20A2,2 0 0,0 4,22H18V20H4V6Z";class Z extends n.WF{connectedCallback(){super.connectedCallback(),window.addEventListener("location-changed",this._locationChanged),window.addEventListener("popstate",this._popState)}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("location-changed",this._locationChanged),window.removeEventListener("popstate",this._popState)}async _fetchEntities(){this._extEntities=await(0,y.G3)(this.hass,Object.keys(this._entities)),this._fetchSupportedEntities()}async _fetchSupportedEntities(){let t,e;this.cloudStatus?.logged_in&&this.cloudStatus.prefs.alexa_enabled&&(t=(0,v.Gq)(this.hass)),this.cloudStatus?.logged_in&&this.cloudStatus.prefs.google_enabled&&(e=(0,w.ig)(this.hass));const[s,i]=await Promise.all([t,e]);this._supportedEntities={"cloud.alexa":s?.map(t=>t.entity_id),"cloud.google_assistant":i?.map(t=>t.entity_id),conversation:void 0}}willUpdate(t){t.has("_entities")?this._fetchEntities():t.has("hass")&&"RUNNING"===this.hass.config.state&&t.get("hass")?.config.state!==this.hass.config.state&&this._fetchSupportedEntities()}render(){if(!this.hass||!this.exposedEntities||!this._extEntities)return n.qy`<hass-loading-screen></hass-loading-screen>`;const t=this._filteredEntities(this.hass.localize,this._extEntities,this.exposedEntities,this.hass.devices,this.hass.areas,this.cloudStatus,this._searchParms);return n.qy` <hass-tabs-subpage-data-table .hass="${this.hass}" .narrow="${this.narrow}" .backPath="${this._searchParms.has("historyBack")?void 0:"/config"}" .route="${this.route}" .tabs="${z.voiceAssistantTabs}" .columns="${this._columns(this.narrow,this._availableAssistants(this.cloudStatus),this._supportedEntities,this.hass.language,this.hass.localize)}" .data="${t}" .searchLabel="${this.hass.localize("ui.panel.config.entities.picker.search",{number:t.length})}" .filter="${this._filter}" selectable .selected="${this._selectedEntities.length}" clickable .initialSorting="${this._activeSorting}" .initialGroupColumn="${this._activeGrouping}" .initialCollapsedGroups="${this._activeCollapsed}" .columnOrder="${this._activeColumnOrder}" .hiddenColumns="${this._activeHiddenColumns}" @columns-changed="${this._handleColumnsChanged}" @sorting-changed="${this._handleSortingChanged}" @selection-changed="${this._handleSelectionChanged}" @grouping-changed="${this._handleGroupingChanged}" @collapsed-changed="${this._handleCollapseChanged}" @clear-filter="${this._clearFilter}" @search-changed="${this._handleSearchChange}" @row-click="${this._openEditEntry}" id="entity_id" has-fab> ${this._selectedEntities.length?n.qy` <div class="header-btns" slot="selection-bar"> ${this.narrow?n.qy` <ha-icon-button id="expose-button" @click="${this._exposeSelected}" .path="${O}" .label="${this.hass.localize("ui.panel.config.voice_assistants.expose.expose")}"></ha-icon-button> <ha-tooltip for="expose-button" placement="left"> ${this.hass.localize("ui.panel.config.voice_assistants.expose.expose")} </ha-tooltip> <ha-tooltip for="unexpose-button" placement="left"> ${this.hass.localize("ui.panel.config.voice_assistants.expose.unexpose")} </ha-tooltip> <ha-icon-button id="unexpose-button" @click="${this._unexposeSelected}" .path="${L}" .label="${this.hass.localize("ui.panel.config.voice_assistants.expose.unexpose")}"></ha-icon-button> `:n.qy` <ha-button appearance="plain" size="small" @click="${this._exposeSelected}">${this.hass.localize("ui.panel.config.voice_assistants.expose.expose")}</ha-button> <ha-button appearance="plain" size="small" @click="${this._unexposeSelected}">${this.hass.localize("ui.panel.config.voice_assistants.expose.unexpose")}</ha-button> `} </div> `:""} <ha-fab slot="fab" .label="${this.hass.localize("ui.panel.config.voice_assistants.expose.add")}" extended @click="${this._addEntry}"> <ha-svg-icon slot="icon" .path="${V}"></ha-svg-icon> </ha-fab> </hass-tabs-subpage-data-table> `}_addEntry(){const t=this._searchParms.has("assistants")?this._searchParms.get("assistants").split(","):this._availableAssistants(this.cloudStatus);(0,A.$)(this,{filterAssistants:t,exposedEntities:this.exposedEntities,exposeEntities:e=>{(0,f.ij)(this.hass,t,e,!0).then(()=>(0,h.r)(this,"exposed-entities-changed"))}})}_handleSearchChange(t){this._filter=t.detail.value}_handleSelectionChanged(t){this._selectedEntities=t.detail.value}_unexposeSelected(){const t=this._searchParms.has("assistants")?this._searchParms.get("assistants").split(","):this._availableAssistants(this.cloudStatus);(0,$.dk)(this,{title:this.hass.localize("ui.panel.config.voice_assistants.expose.unexpose_confirm_title"),text:this.hass.localize("ui.panel.config.voice_assistants.expose.unexpose_confirm_text",{assistants:t.map(t=>f.aK[t].name).join(", "),entities:this._selectedEntities.length}),confirmText:this.hass.localize("ui.panel.config.voice_assistants.expose.unexpose"),dismissText:this.hass.localize("ui.common.cancel"),confirm:()=>{(0,f.ij)(this.hass,t,this._selectedEntities,!1).then(()=>(0,h.r)(this,"exposed-entities-changed")),this._clearSelection()}})}_exposeSelected(){const t=this._searchParms.has("assistants")?this._searchParms.get("assistants").split(","):this._availableAssistants(this.cloudStatus);(0,$.dk)(this,{title:this.hass.localize("ui.panel.config.voice_assistants.expose.expose_confirm_title"),text:this.hass.localize("ui.panel.config.voice_assistants.expose.expose_confirm_text",{assistants:t.map(t=>f.aK[t].name).join(", "),entities:this._selectedEntities.length}),confirmText:this.hass.localize("ui.panel.config.voice_assistants.expose.expose"),dismissText:this.hass.localize("ui.common.cancel"),confirm:()=>{(0,f.ij)(this.hass,t,this._selectedEntities,!0).then(()=>(0,h.r)(this,"exposed-entities-changed")),this._clearSelection()}})}_clearSelection(){this._dataTable.clearSelection()}_openEditEntry(t){const e=t.detail.id;(0,H.X)(this,{entityId:e,exposed:this.exposedEntities[e],extEntityReg:this._extEntities?.[e],exposedEntitiesChanged:()=>{(0,h.r)(this,"exposed-entities-changed")}})}_clearFilter(){(0,_.o)(window.location.pathname,{replace:!0})}_handleSortingChanged(t){this._activeSorting=t.detail}_handleGroupingChanged(t){this._activeGrouping=t.detail.value}_handleCollapseChanged(t){this._activeCollapsed=t.detail.value}_handleColumnsChanged(t){this._activeColumnOrder=t.detail.columnOrder,this._activeHiddenColumns=t.detail.hiddenColumns}static get styles(){return[k.RF,n.AH`hass-loading-screen{--app-header-background-color:var(--sidebar-background-color);--app-header-text-color:var(--sidebar-text-color)}.table-header{display:flex;justify-content:space-between;align-items:center;height:56px;background-color:var(--mdc-text-field-fill-color,#f5f5f5);border-bottom:1px solid var(--mdc-text-field-idle-line-color,rgba(0,0,0,.42));box-sizing:border-box}.header-toolbar{display:flex;justify-content:space-between;align-items:center;color:var(--secondary-text-color);position:relative;top:-4px}.selected-txt{font-weight:var(--ha-font-weight-bold);padding-left:16px;padding-inline-start:16px;direction:var(--direction)}.table-header .selected-txt{margin-top:20px}.header-toolbar .selected-txt{font-size:var(--ha-font-size-l)}.header-toolbar .header-btns{margin-right:-12px;margin-inline-end:-12px;direction:var(--direction)}.header-btns{display:flex}.header-btns>ha-button,.header-btns>ha-icon-button{margin:8px}ha-button-menu{margin-left:8px;margin-inline-start:8px;margin-inline-end:initial}.clear{color:var(--primary-color);padding-left:8px;padding-inline-start:8px;text-transform:uppercase;direction:var(--direction)}`]}constructor(...t){super(...t),this.isWide=!1,this.narrow=!1,this._filter="",this._searchParms=new URLSearchParams(window.location.search),this._selectedEntities=[],this._columns=(0,d.A)((t,e,s,i,a)=>({icon:{title:"",label:a("ui.panel.config.voice_assistants.expose.headers.icon"),type:"icon",moveable:!1,hidden:t,template:t=>n.qy` <ha-state-icon title="${(0,r.J)(t.entity?.state)}" .stateObj="${t.entity}" .hass="${this.hass}"></ha-state-icon> `},name:{main:!0,title:a("ui.panel.config.voice_assistants.expose.headers.name"),sortable:!0,filterable:!0,direction:"asc",flex:2,template:t?void 0:t=>n.qy` ${t.name}<br> <div class="secondary">${t.entity_id}</div> `},entity_id:{title:a("ui.panel.config.voice_assistants.expose.headers.entity_id"),hidden:!t,filterable:!0},domain:{title:a("ui.panel.config.voice_assistants.expose.headers.domain"),sortable:!1,hidden:!0,filterable:!0,groupable:!0},area:{title:a("ui.panel.config.voice_assistants.expose.headers.area"),sortable:!0,groupable:!0,filterable:!0,template:t=>t.area||"—"},assistants:{title:a("ui.panel.config.voice_assistants.expose.headers.assistants"),showNarrow:!0,sortable:!0,filterable:!0,minWidth:"160px",maxWidth:"160px",type:"flex",template:t=>n.qy`${e.map(e=>{const i=!s?.[e]||s[e].includes(t.entity_id),a=t.manAssistants?.includes(e);return t.assistants.includes(e)?n.qy` <voice-assistants-expose-assistant-icon .assistant="${e}" .hass="${this.hass}" .manual="${a}" .unsupported="${!i}"> </voice-assistants-expose-assistant-icon> `:n.qy`<div style="width:40px"></div>`})}`},aliases:{title:a("ui.panel.config.voice_assistants.expose.headers.aliases"),sortable:!0,filterable:!0,template:t=>0===t.aliases.length?"-":1===t.aliases.length?t.aliases[0]:this.hass.localize("ui.panel.config.voice_assistants.expose.aliases",{count:t.aliases.length})},remove:{title:"",label:a("ui.panel.config.voice_assistants.expose.headers.remove"),type:"icon-button",hidden:t,template:()=>n.qy`<ha-icon-button @click="${this._removeEntity}" .path="${P}"></ha-icon-button>`}})),this._getEntityFilterFuncs=(0,d.A)((t,e)=>({google:(0,g.p)(t.include_domains,t.include_entities,t.exclude_domains,t.exclude_entities),amazon:(0,g.p)(e.include_domains,e.include_entities,e.exclude_domains,e.exclude_entities)})),this._availableAssistants=(0,d.A)(t=>{const e=!0===t?.logged_in&&!0===t.prefs.google_enabled,s=!0===t?.logged_in&&!0===t.prefs.alexa_enabled,i=[...Object.keys(f.aK)];return e||i.splice(i.indexOf("cloud.google_assistant"),1),s||i.splice(i.indexOf("cloud.alexa"),1),i}),this._filteredEntities=(0,d.A)((t,e,s,i,a,o,n)=>{const l=!0===o?.logged_in&&!0===o.prefs.google_enabled,r=!0===o?.logged_in&&!0===o.prefs.alexa_enabled,d=[...this._availableAssistants(o)],c=r&&!(0,g.z)(this.cloudStatus.alexa_entities),h=l&&!(0,g.z)(this.cloudStatus.google_entities);h&&d.splice(d.indexOf("cloud.google_assistant"),1),c&&d.splice(d.indexOf("cloud.alexa"),1);const _={};let m,b=Object.values(this.hass.states);b=b.filter(t=>d.some(e=>s?.[t.entity_id]?.[e])),n.forEach((t,e)=>{"assistants"===e&&(m=t.split(","),b=b.filter(t=>m.some(e=>!("cloud.alexa"===e&&c)&&!("cloud.google_assistant"===e&&h)&&s?.[t.entity_id]?.[e])))});for(const o of b){const n=e[o.entity_id],l=n?.area_id??(n?.device_id?i[n.device_id]?.area_id:void 0),r=l?a[l]:void 0;_[o.entity_id]={entity_id:o.entity_id,entity:o,name:(0,u.u)(o)||this.hass.localize("ui.panel.config.entities.picker.unnamed_entity"),domain:(0,C.p$)(t,(0,p.m)(o.entity_id)),area:r?r.name:void 0,assistants:Object.keys(s?.[o.entity_id]).filter(t=>d.includes(t)&&s?.[o.entity_id]?.[t]),aliases:n?.aliases||[]}}if(c||h){const t=this._getEntityFilterFuncs(this.cloudStatus.google_entities,this.cloudStatus.alexa_entities);Object.keys(this.hass.states).forEach(o=>{const n=[];if(c&&t.amazon(o)&&n.push("cloud.alexa"),h&&t.google(o)&&n.push("cloud.google_assistant"),n.length)if(o in _)_[o].assistants.push(...n),_[o].manAssistants=n;else if(!m||m.some(t=>n.includes(t))){const t=this.hass.states[o],l=e[o],r=l?.area_id??(l?.device_id?i[l.device_id]?.area_id:void 0),c=r?a[r]:void 0;_[o]={entity_id:t.entity_id,entity:t,name:(0,u.u)(t),area:c?c.name:void 0,assistants:[...s?Object.keys(s?.[t.entity_id]).filter(e=>d.includes(e)&&s?.[t.entity_id]?.[e]):[],...n],manAssistants:n,aliases:l?.aliases||[]}}})}return Object.values(_)}),this._locationChanged=()=>{window.location.search.substring(1)!==this._searchParms.toString()&&(this._searchParms=new URLSearchParams(window.location.search))},this._popState=()=>{window.location.search.substring(1)!==this._searchParms.toString()&&(this._searchParms=new URLSearchParams(window.location.search))},this._removeEntity=t=>{t.stopPropagation();const e=t.currentTarget.closest(".mdc-data-table__row").rowId,s=this._searchParms.has("assistants")?this._searchParms.get("assistants").split(","):this._availableAssistants(this.cloudStatus);(0,f.ij)(this.hass,s,[e],!1).then(()=>(0,h.r)(this,"exposed-entities-changed"))}}}(0,a.Cg)([(0,l.MZ)({attribute:!1})],Z.prototype,"hass",void 0),(0,a.Cg)([(0,l.MZ)({attribute:!1})],Z.prototype,"cloudStatus",void 0),(0,a.Cg)([(0,l.MZ)({attribute:"is-wide",type:Boolean})],Z.prototype,"isWide",void 0),(0,a.Cg)([(0,l.MZ)({type:Boolean})],Z.prototype,"narrow",void 0),(0,a.Cg)([(0,l.MZ)({attribute:!1})],Z.prototype,"route",void 0),(0,a.Cg)([(0,l.MZ)({attribute:!1})],Z.prototype,"exposedEntities",void 0),(0,a.Cg)([(0,l.wk)(),(0,o.Fg)({context:x.X1,subscribe:!0})],Z.prototype,"_entities",void 0),(0,a.Cg)([(0,l.wk)()],Z.prototype,"_extEntities",void 0),(0,a.Cg)([(0,l.wk)(),(0,c.I)({storage:"sessionStorage",key:"voice-expose-table-search",state:!0,subscribe:!1})],Z.prototype,"_filter",void 0),(0,a.Cg)([(0,l.wk)()],Z.prototype,"_searchParms",void 0),(0,a.Cg)([(0,l.wk)()],Z.prototype,"_selectedEntities",void 0),(0,a.Cg)([(0,l.wk)()],Z.prototype,"_supportedEntities",void 0),(0,a.Cg)([(0,c.I)({key:"voice-expose-table-sort",state:!1,subscribe:!1})],Z.prototype,"_activeSorting",void 0),(0,a.Cg)([(0,c.I)({key:"voice-expose-table-grouping",state:!1,subscribe:!1})],Z.prototype,"_activeGrouping",void 0),(0,a.Cg)([(0,c.I)({key:"voice-expose-table-collapsed",state:!1,subscribe:!1})],Z.prototype,"_activeCollapsed",void 0),(0,a.Cg)([(0,c.I)({key:"voice-expose-table-column-order",state:!1,subscribe:!1})],Z.prototype,"_activeColumnOrder",void 0),(0,a.Cg)([(0,c.I)({key:"voice-expose-table-hidden-columns",state:!1,subscribe:!1})],Z.prototype,"_activeHiddenColumns",void 0),(0,a.Cg)([(0,l.P)("hass-tabs-subpage-data-table",!0)],Z.prototype,"_dataTable",void 0),Z=(0,a.Cg)([(0,l.EM)("ha-config-voice-assistants-expose")],Z),i()}catch(t){i(t)}})},60702(t,e,s){s.d(e,{$:()=>o});var i=s(1087);const a=()=>Promise.all([s.e("26767"),s.e("22564"),s.e("21694"),s.e("8851"),s.e("9194")]).then(s.bind(s,17338)),o=(t,e)=>{(0,i.r)(t,"show-dialog",{dialogTag:"dialog-expose-entity",dialogImport:a,dialogParams:e})}},99436(t,e,s){s.d(e,{X:()=>o});var i=s(1087);const a=()=>Promise.all([s.e("80355"),s.e("60001")]).then(s.bind(s,50008)),o=(t,e)=>{(0,i.r)(t,"show-dialog",{dialogTag:"dialog-voice-settings",dialogImport:a,dialogParams:e})}},44144(t,e,s){s.d(e,{MR:()=>i,QR:()=>a,a_:()=>o,bg:()=>n});const i=t=>`https://brands.home-assistant.io/${t.brand?"brands/":""}${t.useFallback?"_/":""}${t.domain}/${t.darkOptimized?"dark_":""}${t.type}.png`,a=t=>`https://brands.home-assistant.io/hardware/${t.category}/${t.darkOptimized?"dark_":""}${t.manufacturer}${t.model?`_${t.model}`:""}.png`,o=t=>t.split("/")[4],n=t=>t.startsWith("https://brands.home-assistant.io/")}};
//# sourceMappingURL=59873.0ee1e586189721cd.js.map