1/*! For license information please see 97621.b6d7007e2227b050.js.LICENSE.txt */ 2export const __rspack_esm_id=97621;export const __rspack_esm_ids=[97621];export const __webpack_modules__={94586(e,t,a){a(18111),a(61701),a(45367),a(92731);a.d(t,{},{Vu:e=>e.floors.map(e=>e.id),Xz:e=>{const t=[];for(const a of e.floors)t.push(...a.areas);return t.push(...e.areas),t},cs:(e,t)=>{const a=new Map,i=[];for(const e of t)e.floor_id?(a.has(e.floor_id)||a.set(e.floor_id,[]),a.get(e.floor_id).push(e.area_id)):i.push(e.area_id);return{floors:e.map(e=>({id:e.floor_id,areas:a.get(e.floor_id)||[]})),areas:i}}})},12515(e,t,a){var i=a(28861),s=a(11467),o=a(82476);a(7407),a(47551);const n=e=>{switch(e.level){case 0:return"M11,10H13V16H11V10M22,12H19V20H5V12H2L12,3L22,12M15,10A2,2 0 0,0 13,8H11A2,2 0 0,0 9,10V16A2,2 0 0,0 11,18H13A2,2 0 0,0 15,16V10Z";case 1:return"M12,3L2,12H5V20H19V12H22L12,3M10,8H14V18H12V10H10V8Z";case 2:return"M12,3L2,12H5V20H19V12H22L12,3M9,8H13A2,2 0 0,1 15,10V12A2,2 0 0,1 13,14H11V16H15V18H9V14A2,2 0 0,1 11,12H13V10H9V8Z";case 3:return"M12,3L22,12H19V20H5V12H2L12,3M15,11.5V10C15,8.89 14.1,8 13,8H9V10H13V12H11V14H13V16H9V18H13A2,2 0 0,0 15,16V14.5A1.5,1.5 0 0,0 13.5,13A1.5,1.5 0 0,0 15,11.5Z";case-1:return"M12,3L2,12H5V20H19V12H22L12,3M11,15H7V13H11V15M15,18H13V10H11V8H15V18Z"}return"M10,20V14H14V20H19V12H22L12,3L2,12H5V20H10Z"};class r extends s.WF{render(){if(!this.floor)return s.s6;if(this.floor.icon)return s.qy`<ha-icon .icon=${this.floor.icon}></ha-icon>`;const e=n(this.floor);return s.qy`<ha-svg-icon .path=${e}></ha-svg-icon>`}}(0,i.Cg)([(0,o.MZ)({attribute:!1})],r.prototype,"floor",void 0),(0,i.Cg)([(0,o.MZ)()],r.prototype,"icon",void 0),r=(0,i.Cg)([(0,o.EM)("ha-floor-icon")],r),a.d(t,{},{Dc:e=>{switch(e.level){case 0:return"mdi:home-floor-0";case 1:return"mdi:home-floor-1";case 2:return"mdi:home-floor-2";case 3:return"mdi:home-floor-3";case-1:return"mdi:home-floor-negative-1"}return"mdi:home"},Si:n})},27783(e,t,a){var i=a(28861),s=a(11467),o=a(82476);class n extends s.WF{render(){return s.qy`<slot></slot>`}}n.styles=s.AH`:host{background-color:var(--ha-color-fill-neutral-quiet-resting);padding:var(--ha-space-2) var(--ha-space-3);font-weight:var(--ha-font-weight-bold);color:var(--secondary-text-color);min-height:var(--ha-space-6);box-sizing:border-box;align-items:center;display:flex}`,n=(0,i.Cg)([(0,o.EM)("ha-section-title")],n)},86892(e,t,a){var i=a(28861),s=a(15379),o=a(11467),n=a(82476);class r extends s.A{static get styles(){return[s.A.styles,o.AH`:host{font-size:var(--ha-font-size-m);--wa-color-brand-on-quiet:var(--ha-tab-active-text-color,var(--primary-color));--wa-color-neutral-on-quiet:var(--wa-color-brand-on-quiet);opacity:.8;color:inherit;--wa-space-l:16px}:host([active]:not([disabled])){opacity:1}@media (hover:hover){:host(:hover:not([disabled]):not([active])) .tab{color:var(--wa-color-brand-on-quiet)}}`]}}r=(0,i.Cg)([(0,n.EM)("ha-tab-group-tab")],r)},94185(e,t,a){a.a(e,async function(e,t){try{var i=a(28861),s=a(46993),o=a(11467),n=a(82476),r=a(96891),c=e([s]);s=(c.then?(await c)():c)[0];class l extends s.A{connectedCallback(){super.connectedCallback(),this.addEventListener("keydown",this._handleKeyDown,!0)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("keydown",this._handleKeyDown,!0)}handleClick(e){this._dragScrollController.scrolled||super.handleClick(e)}static get styles(){return[s.A.styles,o.AH`:host{--track-width:2px;
2--track-color:var(--ha-tab-track-color,var(--divider-color));--indicator-color:var(--ha-tab-indicator-color,var(--primary-color));--wa-color-neutral-on-quiet:var(--indicator-color)}.tab-group-top ::slotted(ha-tab-group-tab[active]){border-block-end:solid var(--track-width) var(--indicator-color);margin-block-end:calc(-1 * var(--track-width))}.tab-group-start ::slotted(ha-tab-group-tab[active]){border-inline-end:solid var(--track-width) var(--indicator-color);margin-inline-end:calc(-1 * var(--track-width))}.tab-group-end ::slotted(ha-tab-group-tab[active]){border-inline-start:solid var(--track-width) var(--indicator-color);margin-inline-start:calc(-1 * var(--track-width))}.scroll-button::part(base):hover{background-color:#0000}`]}constructor(...e){super(...e),this._dragScrollController=new r.q(this,{selector:".nav"}),this.tabTag="ha-tab-group-tab",this.tabOnly=!0,this._handleKeyDown=e=>{(e.altKey||e.metaKey)&&e.stopPropagation()}}}(0,i.Cg)([(0,n.MZ)({attribute:"tab-tag"})],l.prototype,"tabTag",void 0),(0,i.Cg)([(0,n.MZ)({attribute:"tab-only",type:Boolean})],l.prototype,"tabOnly",void 0),l=(0,i.Cg)([(0,n.EM)("ha-tab-group")],l),t()}catch(e){t(e)}})},65863(e,t,a){a(74423),a(18111),a(22489),a(61701),a(45367),a(92731),a(17642),a(15024),a(31698);var i=a(32378),s=a(98274),o=a(2650),n=a(24783),r=a(8399),c=a(53821),l=a(83015);const d=(e,t,a,s)=>{if(!e)return 3;if(t.entities.has(e))return 0;const o=a[e]?.device_id;if(o&&t.devices.has(o))return 1;const n=(0,i.EX)(e,a,s);return n&&t.areas.has(n)?2:3};a.d(t,{},{KD:(e,t,a,i)=>e.map(e=>({...e,relatedRank:d(e.stateObj?.entity_id,t,a,i)})),tA:[{name:"search_labels.entityName",weight:10},{name:"search_labels.friendlyName",weight:8},{name:"search_labels.deviceName",weight:7},{name:"search_labels.areaName",weight:6},{name:"search_labels.domainName",weight:6},{name:"search_labels.entityId",weight:3}],uK:(e,t)=>[...e].sort((e,a)=>{const i=(e.relatedRank??3)-(a.relatedRank??3);return 0!==i||void 0===t?i:(0,r.SH)(e.sorting_label??"",a.sorting_label??"",t)}),wz:(e,t)=>{const{includeDomains:a,excludeDomains:i,entityFilter:r,includeDeviceClasses:d,includeUnitOfMeasurement:h,includeEntities:p,excludeEntities:u,value:m,idPrefix:v=""}=t??{};let g,y=Object.keys(e.states);if(p){const e=new Set(p);y=y.filter(t=>e.has(t))}if(u){const e=new Set(u);y=y.filter(t=>!e.has(t))}if(a){const e=new Set(a);y=y.filter(t=>e.has((0,s.m)(t)))}if(i){const e=new Set(i);y=y.filter(t=>!e.has((0,s.m)(t)))}const f=(0,c.qC)(e.language,e.translationMetadata.translations),_=new Map;return g=y.map(t=>{const a=e.states[t],i=(0,n.u)(a),[r,c,d]=(0,o.Cf)(a,[{type:"entity"},{type:"device"},{type:"area"}],e.entities,e.devices,e.areas,e.floors),h=(0,s.m)(t);let p=_.get(h);void 0===p&&(p=(0,l.p$)(e.localize,h),_.set(h,p));const u=r||c||t,m=[d,r?c:void 0].filter(Boolean).join(f?" â ":" ⸠");return{id:`${v}${t}`,primary:u,secondary:m,domain_name:p,sorting_label:[u,m].filter(Boolean).join("_"),search_labels:{entityName:r||null,deviceName:c||null,areaName:d||null,domainName:p||null,friendlyName:i||null,entityId:t},stateObj:a}}),d&&(g=g.filter(e=>e.id===m||e.stateObj?.attributes.device_class&&d.includes(e.stateObj.attributes.device_class))),h&&(g=g.filter(e=>e.id===m||e.stateObj?.attributes.unit_of_measurement&&h.includes(e.stateObj.attributes.unit_of_measurement))),r&&(g=g.filter(e=>e.id===m||e.stateObj&&r(e.stateObj))),g}})},44831(e,t,a){a(74423),a(18111),a(22489),a(61701),a(45367),a(92731);var i=a(79843),s=a(94586),o=a(70381),n=a(74424),r=a(98274),c=a(38071),l=a(24783),d=a(8399),h=a(65863),p=a(83015),u=a(61394),m=a(15352);const v="__other_areas__",g="~",y=e=>`f|${e}`,f=e=>`u|${e}`,_=(e,t)=>`${e}${g}a|${t}`,b=(e,t)=>`${e}${g}d|${t}`,$=(e,t)=>`${e}${g}dom|${t}`;function x(e){const{states:t,entities:a,devices:i,areas:h,floors:u,language:v,localize:g}=e,y=new Map,f=new Map,_=new Map,b=new Map,$=new Map,x=new Map,C=[];for(const e of Object.keys(t)){const s=t[e];if(!s)continue;const d=a[e];if(d?.hidden)continue;const u=d?.device_id?i[d.device_id]:void 0,v=d?.area_id??u?.area_id,H=v?h[v]:void 0,w=(0,r.m)(e),k=(0,c.aH)(s,a,i),L=(0,l.u)(s),A=u?(0,n.xn)(u):void 0,V=H?(0,o.A)(H):void 0,M=(0,p.p$)(g,w);if(C.push({id:e,name:k||L||e,area:V??"",device:A??"",domain:M,search_labels:{entityName:k||null,friendlyName:L||null,deviceName:A||null,areaName:V||null,domainName:M||null,entityId:e}}),!v||!h[v]){if(u){const t="service"===u.entry_type?b:_,a=t.get(u.id)??[];a.push(e),t.set(u.id,a)}else if((0,m.z)(w)){const t=$.get(w)??[];t.push(e),$.set(w,t)}else{const t=x.get(w)??[];t.push(e),x.set(w,t)}continue}if(u&&!d?.area_id){const t=f.get(v)??new Map,a=t.get(u.id)??[];a.push(e),t.set(u.id,a),f.set(v,t)}else{const t=y.get(v)??[];t.push(e),y.set(v,t)}}const H=(e,a)=>{const i=(0,l.u)(t[e])||e,s=(0,l.u)(t[a])||a;return(0,d.xL)(i,s,v)},w=e=>[...e.entries()].map(([e,t])=>{const a=i[e];return{id:e,name:(a?(0,n.xn)(a):void 0)??e,entityIds:t.sort(H)}}).sort((e,t)=>
2(0,d.xL)(e.name,t.name,v)),k=e=>{const t=h[e];if(!t)return;const a=(y.get(e)??[]).sort(H),i=f.get(e),s=i?w(i):[];return a.length||s.length?{id:t.area_id,name:(0,o.A)(t)??t.area_id,icon:t.icon??void 0,directEntityIds:a,devices:s}:void 0},L=Object.values(h),A=Object.values(u),V=(0,s.cs)(A,L),M=V.floors.map(({id:e,areas:t})=>{const a=u[e],i=t.map(e=>k(e)).filter(e=>!!e);if(i.length)return{id:a.floor_id,name:a.name,icon:a.icon,level:a.level,areas:i}}).filter(e=>!!e),q=V.areas.map(e=>k(e)).filter(e=>!!e),E=e=>[...e.entries()].map(([e,t])=>({domain:e,name:(0,p.p$)(g,e),entityIds:t.sort(H)})).sort((e,t)=>(0,d.xL)(e.name,t.name,v)),I=[],z=E(x);z.length&&I.push({id:"entities",iconPath:"M11,13.5V21.5H3V13.5H11M12,2L17.5,11H6.5L12,2M17.5,13C20,13 22,15 22,17.5C22,20 20,22 17.5,22C15,22 13,20 13,17.5C13,15 15,13 17.5,13Z",label:g("ui.panel.lovelace.editor.cardpicker.entities"),domains:z});const N=E($);N.length&&I.push({id:"helpers",iconPath:"M17,7H7A5,5 0 0,0 2,12A5,5 0 0,0 7,17H17A5,5 0 0,0 22,12A5,5 0 0,0 17,7M17,15A3,3 0 0,1 14,12A3,3 0 0,1 17,9A3,3 0 0,1 20,12A3,3 0 0,1 17,15Z",label:g("ui.panel.lovelace.editor.cardpicker.helpers"),domains:N});const O=w(_);O.length&&I.push({id:"devices",iconPath:"M20.5,11H19V7C19,5.89 18.1,5 17,5H13V3.5A2.5,2.5 0 0,0 10.5,1A2.5,2.5 0 0,0 8,3.5V5H4A2,2 0 0,0 2,7V10.8H3.5C5,10.8 6.2,12 6.2,13.5C6.2,15 5,16.2 3.5,16.2H2V20A2,2 0 0,0 4,22H7.8V20.5C7.8,19 9,17.8 10.5,17.8C12,17.8 13.2,19 13.2,20.5V22H17A2,2 0 0,0 19,20V16H20.5A2.5,2.5 0 0,0 23,13.5A2.5,2.5 0 0,0 20.5,11Z",label:g("ui.panel.lovelace.editor.cardpicker.devices"),devices:O});const Z=w(b);return Z.length&&I.push({id:"services",iconPath:"M21.8,13H20V21H13V17.67L15.79,14.88L16.5,15C17.66,15 18.6,14.06 18.6,12.9C18.6,11.74 17.66,10.8 16.5,10.8A2.1,2.1 0 0,0 14.4,12.9L14.5,13.61L13,15.13V9.65C13.66,9.29 14.1,8.6 14.1,7.8A2.1,2.1 0 0,0 12,5.7A2.1,2.1 0 0,0 9.9,7.8C9.9,8.6 10.34,9.29 11,9.65V15.13L9.5,13.61L9.6,12.9A2.1,2.1 0 0,0 7.5,10.8A2.1,2.1 0 0,0 5.4,12.9A2.1,2.1 0 0,0 7.5,15L8.21,14.88L11,17.67V21H4V13H2.25C1.83,13 1.42,13 1.42,12.79C1.43,12.57 1.85,12.15 2.28,11.72L11,3C11.33,2.67 11.67,2.33 12,2.33C12.33,2.33 12.67,2.67 13,3L17,7V6H19V9L21.78,11.78C22.18,12.18 22.59,12.59 22.6,12.8C22.6,13 22.2,13 21.8,13M7.5,12A0.9,0.9 0 0,1 8.4,12.9A0.9,0.9 0 0,1 7.5,13.8A0.9,0.9 0 0,1 6.6,12.9A0.9,0.9 0 0,1 7.5,12M16.5,12C17,12 17.4,12.4 17.4,12.9C17.4,13.4 17,13.8 16.5,13.8A0.9,0.9 0 0,1 15.6,12.9A0.9,0.9 0 0,1 16.5,12M12,6.9C12.5,6.9 12.9,7.3 12.9,7.8C12.9,8.3 12.5,8.7 12,8.7C11.5,8.7 11.1,8.3 11.1,7.8C11.1,7.3 11.5,6.9 12,6.9Z",label:g("ui.panel.lovelace.editor.cardpicker.services"),devices:Z}),{floors:M,otherAreas:q,unassignedSections:I,searchableEntities:C}}function C(e,t){for(const a of e.floors){const e=y(a.id);for(const i of a.areas){const a=_(e,i.id);if(i.directEntityIds.includes(t))return[e,a];for(const s of i.devices)if(s.entityIds.includes(t))return[e,a,b(a,s.id)]}}const a=y(v);for(const i of e.otherAreas){const e=_(a,i.id);if(i.directEntityIds.includes(t))return[a,e];for(const s of i.devices)if(s.entityIds.includes(t))return[a,e,b(e,s.id)]}for(const a of e.unassignedSections){const e=f(a.id);if(a.devices)for(const i of a.devices)if(i.entityIds.includes(t))return[e,b(e,i.id)];if(a.domains)for(const i of a.domains)if(i.entityIds.includes(t))return[e,$(e,i.domain)]}return[]}function H(e,t,a,i=100){return a?(0,u.x)(e,a,e=>e.id,t).slice(0,i):[]}a.d(t,{eT:()=>H,mm:()=>x,wH:()=>C},{BG:f,BK:e=>i.A.createIndex(h.tA,e),OC:v,TQ:_,U7:e=>`${e}${g}`,cY:b,ig:y,mI:$})},52797(e,t,a){a.a(e,async function(e,t){try{a(18111),a(61701);var i=a(28861),s=a(63018),o=a(11467),n=a(82476),r=a(93584),c=a(47749),l=a(34619),d=a(62228),h=a(38071),p=a(24783),u=a(53821),m=a(99118),v=a(66970),g=a(79374),y=(a(7557),a(65205)),f=(a(12515),a(7407),a(27783),a(47551),a(63543)),_=a(78813),b=a(7578),$=a(95921),x=a(44831),C=e([g,y,f]);[g,y,f]=C.then?(await C)():C;const H="M7.41,8.58L12,13.17L16.59,8.58L18,10L12,16L6,10L7.41,8.58Z",w="M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z",k="M15.41,16.58L10.83,12L15.41,7.41L14,6L8,12L14,18L15.41,16.58Z",L="M9.5,3A6.5,6.5 0 0,1 16,9.5C16,11.11 15.41,12.59 14.44,13.73L14.71,14H15.5L20.5,19L19,20.5L14,15.5V14.71L13.73,14.44C12.59,15.41 11.11,16 9.5,16A6.5,6.5 0 0,1 3,9.5A6.5,6.5 0 0,1 9.5,3M9.5,5C7,5 5,7 5,9.5C5,12 7,14 9.5,14C12,14 14,12 14,9.5C14,7 12,5 9.5,5Z",A="M20 2H4C2.9 2 2 2.9 2 4V20C2 21.11 2.9 22 4 22H20C21.11 22 22 21.11 22 20V4C22 2.9 21.11 2 20 2M4 6L6 4H10.9L4 10.9V6M4 13.7L13.7 4H18.6L4 18.6V13.7M20 18L18 20H13.1L20 13.1V18M20 10.3L10.3 20H5.4L20 5.4V10.3Z";class V extends o.WF{async focus(){await this.updateComplete,await(this._searchInput?.updateComplete),this._searchInput?.focus()}connectedCallback(){super.connectedCallback(),this._loadDomainTranslations()}async _loadDomainTranslations(){this.hass&&(this._domainLocalize=await this.hass.loadBackendTranslation("title"))}disconnectedCallback(){super.disconnectedCallback(),this._setFilter.cancel()}_deviceDomain(e){const t=this.hass?.devices[e];if(t?.primary_config_entry)return this._configEntryLookup?.[t.primary_config_entry]?.domain}willUpdate(e){super.willUpdate(e),this.hasUpdated||(0,$.i)(),!this._tree&&this.hass&&this._domainLocalize&&(this._tree=(0,x.mm)({states:this.hass.states,entities:this.hass.entities,devices:this.hass.devices,areas:this.hass.areas,floors:this.hass.floors,language:this.hass.locale?.language,localize:this._domainLocalize}),this._fuseIndex=(0,x.BK)(this._tree.searchableEntities),1===this._tree.floors.length&&(this._expanded={[(0,x.ig)(this._tree.floors[0].id)]:!0}))}render(){return this.hass?o.qy` <ha-input-search appearance="outlined" .value=${this._filter} .placeholder=${this.hass.localize("ui.panel.lovelace.editor.cardpicker.search_entities")} @input=${this._handleFilterChange}></ha-input-search> ${this._tree?this._filter?this._renderSearchResults():o.qy`<div class="tree ha-scrollbar"> ${this._renderTree(this._tree)} </div>`:o.s6} `:o.s6}_isExpanded(e){return this._expanded[e]??!1}_renderTree(e){const t=0===e.floors.length&&e.otherAreas.length>0;return o.qy` ${e.floors.length||e.otherAreas.length?o.qy` <ha-section-title> ${this.hass.localize("ui.panel.lovelace.editor.cardpicker.home")} </ha-section-title> ${(0,r.u)(e.floors,e=>e.id,e=>this._renderFloor(e,!1))} ${e.otherAreas.length?t?(0,r.u)(e.otherAreas,e=>e.id,e=>this._renderArea(e,(0,x.ig)(x.OC))):this._renderFloor({id:x.OC,name:this.hass.localize("ui.panel.lovelace.editor.cardpicker.other_areas"),icon:null,level:null,areas:e.otherAreas},!0):o.s6} `:o.s6} ${e.unassignedSections.length?o.qy` <ha-section-title> ${this.hass.localize("ui.panel.lovelace.editor.cardpicker.unassigned")} </ha-section-title> ${(0,r.u)(e.unassignedSections,e=>e.id,e=>this._renderUnassignedSection(e))} `:o.s6} `}
2_renderSearchResults(){const e=this._searchMemo(this._tree.searchableEntities,this._fuseIndex,this._filter);return e.length?o.qy` <lit-virtualizer scroller class="search-results ha-scrollbar" .items=${e} .keyFunction=${this._searchKeyFunction} .renderItem=${this._getSearchRowRenderer(this.selectedEntityId)}></lit-virtualizer> `:o.qy` <div class="empty"> <ha-svg-icon .path=${L}></ha-svg-icon> <h2> ${this.hass.localize("ui.panel.lovelace.editor.cardpicker.no_search_results_title")} </h2> <p> ${this.hass.localize("ui.panel.lovelace.editor.cardpicker.no_search_results_description")} </p> </div> `}_renderChevron(e){return o.qy`<ha-svg-icon class="chevron" .path=${e?H:"rtl"===v.G.document.dir?k:w}></ha-svg-icon>`}_renderFloor(e,t){const a=(0,x.ig)(e.id),i=this._isExpanded(a);return o.qy` <ha-combo-box-item type="button" class="branch depth-root floor-item" aria-expanded=${i} data-node-key=${a} @click=${this._toggleNode}> <div slot="start" class="leading"> ${this._renderChevron(i)} ${t?o.qy`<ha-svg-icon .path=${A}></ha-svg-icon>`:o.qy`<ha-floor-icon .floor=${{icon:e.icon,level:e.level}}></ha-floor-icon>`} </div> <span slot="headline">${e.name}</span> </ha-combo-box-item> ${i?(0,r.u)(e.areas,e=>e.id,e=>this._renderArea(e,a)):o.s6} `}_renderArea(e,t){const a=(0,x.TQ)(t,e.id),i=this._isExpanded(a);return o.qy` <ha-combo-box-item type="button" class="branch depth-area area-item" aria-expanded=${i} data-node-key=${a} @click=${this._toggleNode}> <div slot="start" class="leading"> ${this._renderChevron(i)} ${e.icon?o.qy`<ha-icon .icon=${e.icon}></ha-icon>`:o.qy`<ha-svg-icon .path=${A}></ha-svg-icon>`} </div> <span slot="headline">${e.name}</span> </ha-combo-box-item> ${i?o.qy` ${(0,r.u)(e.devices,e=>e.id,e=>this._renderDevice(e,a))} ${(0,r.u)(e.directEntityIds,e=>e,e=>this._renderEntity(e,"depth-entity-area"))} `:o.s6} `}_renderDevice(e,t){const a=(0,x.cY)(t,e.id),i=this._isExpanded(a),s=this._deviceDomain(e.id);return o.qy` <ha-combo-box-item type="button" class="branch depth-device device-item" aria-expanded=${i} data-node-key=${a} @click=${this._toggleNode}> <div slot="start" class="leading"> ${this._renderChevron(i)} ${s?o.qy`<ha-domain-icon .hass=${this.hass} .domain=${s} brand-fallback></ha-domain-icon>`:o.qy`<ha-svg-icon .path=${A}></ha-svg-icon>`} </div> <span slot="headline">${e.name}</span> </ha-combo-box-item> ${i?(0,r.u)(e.entityIds,e=>e,e=>this._renderEntity(e,"depth-entity-device")):o.s6} `}_renderUnassignedSection(e){const t=(0,x.BG)(e.id),a=this._isExpanded(t);return o.qy` <ha-combo-box-item type="button" class="branch depth-root floor-item" aria-expanded=${a} data-node-key=${t} @click=${this._toggleNode}> <div slot="start" class="leading"> ${this._renderChevron(a)} <ha-svg-icon .path=${e.iconPath}></ha-svg-icon> </div> <span slot="headline">${e.label}</span> </ha-combo-box-item> ${a?o.qy` ${e.devices?(0,r.u)(e.devices,e=>e.id,e=>this._renderDevice(e,t)):o.s6} ${e.domains?(0,r.u)(e.domains,e=>e.domain,e=>{const a=(0,x.mI)(t,e.domain),i=this._isExpanded(a);return o.qy` <ha-combo-box-item type="button" class="branch depth-area area-item" aria-expanded=${i} data-node-key=${a} @click=${this._toggleNode}> <div slot="start" class="leading"> ${this._renderChevron(i)} <ha-domain-icon .hass=${this.hass} .domain=${e.domain} brand-fallback></ha-domain-icon> </div> <span slot="headline">${e.name}</span> </ha-combo-box-item> ${i?(0,r.u)(e.entityIds,e=>e,e=>this._renderEntity(e,"depth-entity-area")):o.s6} `}):o.s6} `:o.s6} `}_renderEntity(e,t){const a=this.hass.states[e],i=this.selectedEntityId===e,s=(a?(0,h.aH)(a,this.hass.entities,this.hass.devices):void 0)||(a?(0,p.u)(a):void 0)||e;return o.qy` <ha-combo-box-item type="button" class="leaf ${t} entity-item ${i?"selected":""}" aria-current=${i?"true":"false"} data-entity-id=${e} @click=${this._pickEntity}> <div slot="start" class="leading"> <span class="chevron-spacer"></span> ${a?o.qy`<state-badge .stateObj=${a}></state-badge>`:o.s6} </div> <span slot="headline">${s}</span> </ha-combo-box-item> `}_toggleNode(e){const t=e.currentTarget.dataset.nodeKey;if(t)if(this._expanded[t]){const e={...this._expanded};delete e[t];const a=(0,x.U7)(t);for(const t of Object.keys(e))t.startsWith(a)&&delete e[t];this._expanded=e}else this._expanded={...this._expanded,[t]:!0}}_expandToEntity(e){if(!this._tree)return;const t=(0,x.wH)(this._tree,e);if(!t.length)return;const a={...this._expanded};let i=!1;for(const e of t)a[e]||(a[e]=!0,i=!0);i&&(this._expanded=a)}_handleFilterChange(e){this._setFilter(e.target.value??"")}static get styles(){return[b.dp,o.AH`:host{flex-direction:column;min-height:0;display:flex}ha-input-search{padding:var(--ha-space-3);
2border-bottom:var(--ha-border-width-sm) solid var(--divider-color)}.tree{min-height:0;padding-bottom:var(--ha-space-3);flex:1;overflow:auto}lit-virtualizer.search-results{min-height:0;padding-bottom:var(--ha-space-3);flex:1}ha-combo-box-item{--md-list-item-one-line-container-height:40px;--md-list-item-two-line-container-height:48px;--md-list-item-leading-space:var(--ha-space-3);--md-list-item-trailing-space:var(--ha-space-3);--md-list-item-leading-element-leading-space:0;width:100%}ha-combo-box-item.depth-area{--md-list-item-leading-space:var(--ha-space-8)}ha-combo-box-item.depth-device,ha-combo-box-item.depth-entity-area{--md-list-item-leading-space:var(--ha-space-12)}ha-combo-box-item.depth-entity-device{--md-list-item-leading-space:var(--ha-space-16)}.leading{align-items:center;gap:var(--ha-space-2);display:flex}.leading ha-svg-icon,.leading ha-icon,.leading ha-floor-icon,.leading ha-domain-icon{color:var(--secondary-text-color)}.leading state-badge{--state-icon-color:var(--secondary-text-color);width:24px;height:24px}.chevron{color:var(--secondary-text-color);flex:0 0 24px}.chevron-spacer{flex:0 0 24px;width:24px}.floor-item{--md-list-item-label-text-weight:var(--ha-font-weight-medium)}.entity-item.selected{background-color:var(--ha-color-fill-primary-quiet-resting,rgba(var(--rgb-primary-color,33, 150, 243), .12));--md-list-item-label-text-color:var(--primary-color);--md-list-item-label-text-weight:var(--ha-font-weight-medium)}.entity-item.selected .leading state-badge{--state-icon-color:var(--primary-color)}.empty{justify-content:center;align-items:center;gap:var(--ha-space-2);padding:var(--ha-space-8) var(--ha-space-4);text-align:center;flex-direction:column;display:flex}.empty ha-svg-icon{--mdc-icon-size:32px;color:var(--ha-color-text-secondary)}.empty h2{font-size:var(--ha-font-size-l);font-weight:var(--ha-font-weight-medium);color:var(--primary-text-color);margin:0}.empty p{color:var(--ha-color-text-secondary);font-size:var(--ha-font-size-s);margin:0}`]}constructor(...e){super(...e),this._filter="",this._expanded={},this._searchMemo=(0,c.A)(x.eT),this._searchKeyFunction=e=>e.id,this._getSearchRowRenderer=(0,c.A)(e=>(e,t)=>this._renderSearchRow(e,t)),this._renderSearchRow=(e,t)=>{const a=this.hass.states[e.id],i=this.selectedEntityId===e.id,s=(0,u.qC)(this.hass.language,this.hass.translationMetadata.translations)?" â ":" ⸠",n=[e.area,e.device].filter(Boolean).join(s);return o.qy` <ha-combo-box-item type="button" compact=compact .borderTop=${0!==t} class="entity-item ${i?"selected":""}" aria-current=${i?"true":"false"} data-entity-id=${e.id} @click=${this._pickEntity}> ${a?o.qy`<state-badge slot="start" .stateObj=${a}></state-badge>`:o.s6} <span slot="headline">${e.name}</span> ${n?o.qy`<span slot="supporting-text">${n}</span>`:o.s6} ${e.domain?o.qy`<div slot="trailing-supporting-text" class="domain"> ${e.domain} </div>`:o.s6} </ha-combo-box-item> `},this._pickEntity=e=>{const t=e.currentTarget.dataset.entityId;t&&(this._expandToEntity(t),(0,d.r)(this,"entity-picked",{entityId:t}))},this._setFilter=(0,m.s)(e=>{this._filter=e},150)}}(0,i.Cg)([(0,n.MZ)({attribute:!1})],V.prototype,"hass",void 0),(0,i.Cg)([(0,n.MZ)({attribute:!1})],V.prototype,"selectedEntityId",void 0),(0,i.Cg)([(0,n.wk)()],V.prototype,"_filter",void 0),(0,i.Cg)([(0,n.wk)()],V.prototype,"_expanded",void 0),(0,i.Cg)([(0,n.wk)(),(0,s.Fg)({context:_.g5,subscribe:!0}),(0,l.p)({transformer:e=>e?Object.fromEntries(e.map(e=>[e.entry_id,e])):void 0})],V.prototype,"_configEntryLookup",void 0),(0,i.Cg)([(0,n.wk)()],V.prototype,"_domainLocalize",void 0),(0,i.Cg)([(0,n.wk)()],V.prototype,"_tree",void 0),(0,i.Cg)([(0,n.wk)()],V.prototype,"_fuseIndex",void 0),(0,i.Cg)([(0,n.P)("ha-input-search")],V.prototype,"_searchInput",void 0),V=(0,i.Cg)([(0,n.EM)("hui-suggestion-entity-tree")],V),t()}catch(e){t(e)}})},77444(e,t,a){a.d(t,{P:()=>r});a(88454),a(29452);var i=a(99010),s=a(16014),o=a(82466);const n=e=>(0,o.ps)(e)?e._$litType$.h:e.strings,r=(0,s.u$)(class extends s.WL{render(e){return[e]}update(e,[t]){const a=(0,o.qb)(this.it)?n(this.it):null,s=(0,o.qb)(t)?n(t):null;if(null!==a&&(null===s||a!==s)){const t=(0,o.cN)(e).pop();let s=this.et.get(a);if(void 0===s){const e=document.createDocumentFragment();s=(0,i.XX)(i.s6,e),s.setConnected(!1),this.et.set(a,s)}(0,o.mY)(s,[t]),(0,o.Dx)(s,void 0,t)}if(null!==s){if(null===a||a!==s){const t=this.et.get(s);if(void 0!==t){const a=(0,o.cN)(t).pop();(0,o.Jz)(e),(0,o.Dx)(e,void 0,a),(0,o.mY)(e,[a])}}this.it=t}else this.it=void 0;return this.render(t)}constructor(e){super(e),this.et=new WeakMap}})}}; 3//# sourceMappingURL=97621.b6d7007e2227b050.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.