UNPKG

iobroker.lovelace

Version:

With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI

4 lines 32 kB
export const __rspack_esm_id=13132;export const __rspack_esm_ids=[13132];export const __webpack_modules__={19459(e,t,i){i.d(t,{b:()=>a});i(45367),i(92731),i(69479),i(17642),i(58004),i(33853),i(45876),i(32475),i(15024),i(31698);const a=(e,t,i)=>{if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){if(e.constructor!==t.constructor)return!1;let r,s;if(Array.isArray(e)){if(s=e.length,s!==t.length)return!1;for(r=s;0!==r--;)if(!a(e[r],t[r],i))return!1;return!0}if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(r of e.entries())if(!t.has(r[0]))return!1;for(r of e.entries())if(!a(r[1],t.get(r[0]),i))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(r of e.entries())if(!t.has(r[0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(s=e.length,s!==t.length)return!1;for(r=s;0!==r--;)if(e[r]!==t[r])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();const o=Object.keys(e);if(s=o.length,s!==Object.keys(t).length)return!1;for(r=s;0!==r--;)if(!Object.prototype.hasOwnProperty.call(t,o[r]))return!1;for(r=s;0!==r--;){const s=o[r];if(!a(e[s],t[s],i))return!1}if(i?.compareSymbols){const r=Object.getOwnPropertySymbols(e),s=Object.getOwnPropertySymbols(t);if(r.length!==s.length)return!1;for(const s of r){if(!Object.prototype.hasOwnProperty.call(t,s))return!1;if(!a(e[s],t[s],i))return!1}}return!0}return e!=e&&t!=t}},87710(e,t,i){i.d(t,{$:()=>a,N:()=>r});i(18111),i(22489),i(13579);const a=e=>e.some(e=>"rejected"===e.status),r=e=>e.filter(e=>"rejected"===e.status)},86171(e,t,i){i.a(e,async function(e,t){try{i(18111),i(61701);var a=i(62826),r=i(5124),s=i(22441),o=i(75751),n=i(88696),l=i(1087),d=i(57237),h=i(52220),c=(i(5745),i(29823)),p=(i(70947),i(47680),i(23430)),u=e([c,p]);[c,p]=u.then?(await u)():u;class g extends r.WF{willUpdate(e){e.has("labels")&&(this._sortedLabels=[...this.labels].sort((e,t)=>(0,h.xL)(e.name,t.name)))}render(){const e=this._sortedLabels,t=e.slice(0,this._visibleCount),i=e.length-this._visibleCount;return r.qy` <div class="viewport"> <ha-chip-set> ${(0,o.u)(t,e=>e.label_id,e=>this._renderLabel(e,!0))} ${i>0?r.qy` <ha-dropdown role="button" tabindex="0" @click="${d.d}" @wa-select="${this._handleDropdownSelect}"> <ha-label slot="trigger" class="plus" dense> +${i} </ha-label> ${(0,o.u)(e.slice(this._visibleCount),e=>e.label_id,e=>r.qy` <ha-dropdown-item .value="${e.label_id}" .item="${e}"> ${this._renderLabel(e,!1)} </ha-dropdown-item> `)} </ha-dropdown> `:r.s6} </ha-chip-set> </div> <div class="measure" aria-hidden="true"> <ha-chip-set> ${(0,o.u)(e,e=>e.label_id,e=>r.qy` <div class="measure-chip" data-chip> ${this._renderLabel(e,!1)} </div> `)} <div class="measure-chip" data-plus> <ha-label class="plus" dense>+99</ha-label> </div> </ha-chip-set> </div> `}async firstUpdated(){await this.updateComplete,this._viewport&&this._resizeController.observe(this._viewport),await this._measureWidths(),this._recomputeVisibleCount(this._viewport?.clientWidth??0)}async updated(e){e.has("labels")&&(await this.updateComplete,await this._measureWidths(),this._recomputeVisibleCount(this._viewport?.clientWidth??0))}async _measureWidths(){await this.updateComplete;const e=this._measure;if(!e)return;const t=e.querySelector("ha-chip-set");if(t){const e=getComputedStyle(t),i=e.columnGap||e.gap;this._gap=i?parseFloat(i):0}const i=Array.from(e.querySelectorAll("[data-chip]")),a=e.querySelector("[data-plus]");this._chipWidths=i.map(e=>e.offsetWidth),this._plusWidth=a?.offsetWidth??0}_recomputeVisibleCount(e){if(!e||!this.labels?.length)return void(this._visibleCount=0);const t=this._sortedLabels.length;let i=0,a=0;for(let r=0;r<t;r++){const s=this._chipWidths[r]??0,o=0===a?s:i+this._gap+s;if(!(o+(t-(r+1)>0?this._gap+this._plusWidth:0)<=e))break;i=o,a++}this._visibleCount=a}_renderLabel(e,t){return r.qy` <ha-label dense role="button" tabindex="0" .color="${e.color}" .item="${e}" @click="${t?this._labelClicked:void 0}" @keydown="${t?this._labelClicked:void 0}" .description="${e.description}"> ${e?.icon?r.qy`<ha-icon slot="icon" .icon="${e.icon}"></ha-icon>`:r.s6} ${e.name} </ha-label> `}_labelClicked(e){if(e.stopPropagation(),"keydown"===e.type&&"Enter"!==e.key&&" "!==e.key)return;const t=e.currentTarget.item;(0,l.r)(this,"label-clicked",{label:t})}_handleDropdownSelect(e){const t=e.detail?.item?.item;t&&(0,l.r)(this,"label-clicked",{label:t})}constructor(...e){super(...e),this._visibleCount=0,this._sortedLabels=[],this._chipWidths=[],this._plusWidth=0,this._gap=8,this._resizeController=new n.P(this,{target:null,skipInitial:!0,callback:e=>{const t=e[0],i=t?.contentRect.width??0;return this._recomputeVisibleCount(i),i}})}}g.styles=r.AH`:host{display:block;flex-grow:1;min-width:0;margin-top:4px;height:22px;position:relative}.viewport{min-width:0;width:100%;overflow:hidden}ha-chip-set{display:flex;flex-wrap:nowrap;align-items:center;overflow:hidden;min-width:0}.measure{position:absolute;inset:0 auto auto 0;visibility:hidden;pointer-events:none;white-space:nowrap}.measure ha-chip-set{width:max-content;overflow:visible}.measure-chip{display:inline-flex}.plus{--ha-label-background-color:transparent;border:1px solid var(--divider-color)}`,(0,a.Cg)([(0,s.MZ)({attribute:!1})],g.prototype,"labels",void 0),(0,a.Cg)([(0,s.wk)()],g.prototype,"_visibleCount",void 0),(0,a.Cg)([(0,s.P)(".viewport")],g.prototype,"_viewport",void 0),(0,a.Cg)([(0,s.P)(".measure")],g.prototype,"_measure",void 0),g=(0,a.Cg)([(0,s.EM)("ha-data-table-labels")],g),t()}catch(e){t(e)}})},70947(e,t,i){var a=i(62826),r=i(50759),s=(i(38625),i(5124)),o=i(22441);i(67094);class n extends r.A{renderCheckboxIcon(){return s.qy` <ha-svg-icon id="check" part="checkmark" .path="${this.checked?"M10,17L5,12L6.41,10.58L10,14.17L17.59,6.58L19,8M19,3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3Z":"M19,3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3M19,5V19H5V5H19Z"}"></ha-svg-icon> `}static get styles(){return[r.A.styles,s.AH`:host{min-height:var(--ha-space-10)}#check{visibility:visible;flex-shrink:0}#icon ::slotted(*){color:var(--ha-color-on-neutral-normal)}:host([variant=danger]) #icon ::slotted(*){color:var(--ha-color-on-danger-quiet)}:host([selected]){font-weight:var(--ha-font-weight-medium);color:var(--primary-color);background-color:var(--ha-color-fill-primary-quiet-resting);--icon-primary-color:var(--primary-color)}:host([selected]:hover){background-color:var(--ha-color-fill-primary-quiet-hover)}`]}constructor(...e){super(...e),this.selected=!1}}(0,a.Cg)([(0,o.MZ)({type:Boolean,reflect:!0})],n.prototype,"selected",void 0),n=(0,a.Cg)([(0,o.EM)("ha-dropdown-item")],n)},29823(e,t,i){i.a(e,async function(e,t){try{var a=i(62826),r=i(52254),s=i(5124),o=i(22441),n=e([r]);r=(n.then?(await n)():n)[0];class l extends r.A{get anchorElement(){return this.popup?.anchor}set anchorElement(e){this.popup&&(this.popup.anchor&&"ha-icon-button"===this.popup.anchor.localName&&(this.popup.anchor.selected=!1),this.popup.anchor=e)}getTrigger(){return this.anchorElement?this.anchorElement:super.getTrigger()}async showMenu(){await super.showMenu();const e=this.getTrigger();e&&"ha-icon-button"===e.localName&&(e.selected=!0)}async hideMenu(){const e=this.getTrigger();e&&"ha-icon-button"===e.localName&&(e.selected=!1),await super.hideMenu()}static get styles(){return[r.A.styles,s.AH`:host{font-size:var(--ha-dropdown-font-size, var(--ha-font-size-m));--wa-color-surface-raised:var( --card-background-color, var(--ha-dialog-surface-background, var(--mdc-theme-surface, #fff)), )}#menu{padding:var(--ha-space-1)}wa-popup::part(popup){z-index:200}`]}constructor(...e){super(...e),this.dropdownTag="ha-dropdown",this.dropdownItemTag="ha-dropdown-item"}}(0,a.Cg)([(0,o.MZ)({attribute:!1})],l.prototype,"dropdownTag",void 0),(0,a.Cg)([(0,o.MZ)({attribute:!1})],l.prototype,"dropdownItemTag",void 0),l=(0,a.Cg)([(0,o.EM)("ha-dropdown")],l),t()}catch(e){t(e)}})},52190(e,t,i){i.a(e,async function(e,t){try{i(74423),i(44114),i(18111),i(22489),i(7588),i(17642),i(58004),i(33853),i(45876),i(32475),i(15024),i(31698);var a=i(62826),r=i(5124),s=i(22441),o=i(22786),n=i(1087),l=i(37981),d=i(52220),h=i(19459),c=i(71606),p=i(14503),u=i(85614),g=(i(30716),i(11382),i(8630),i(36866)),v=e([g]);g=(v.then?(await v)():v)[0];const f="M21 8H3V6H21V8M13.81 16H10V18H13.09C13.21 17.28 13.46 16.61 13.81 16M18 11H6V13H18V11M21.12 15.46L19 17.59L16.88 15.46L15.47 16.88L17.59 19L15.47 21.12L16.88 22.54L19 20.41L21.12 22.54L22.54 21.12L20.41 19L22.54 16.88L21.12 15.46Z";class m extends r.WF{willUpdate(e){super.willUpdate(e),this.hasUpdated||(0,u.i)(),e.has("value")&&!(0,h.b)(this.value,e.get("value"))&&this._findRelated()}render(){return r.qy` <ha-expansion-panel left-chevron .expanded="${this.expanded}" @expanded-will-change="${this._expandedWillChange}" @expanded-changed="${this._expandedChanged}"> <div slot="header" class="header"> ${this.hass.localize("ui.panel.config.devices.caption")} ${this.value?.length?r.qy`<div class="badge">${this.value?.length}</div> <ha-icon-button .path="${f}" @click="${this._clearFilter}"></ha-icon-button>`:r.s6} </div> ${this._shouldRender?r.qy`<ha-input-search appearance="outlined" .value="${this._filter}" @input="${this._handleSearchChange}"> </ha-input-search> <ha-list class="ha-scrollbar" multi> <lit-virtualizer .items="${this._devices(this.hass.devices,this._filter||"",this.value)}" .keyFunction="${this._keyFunction}" .renderItem="${this._renderItem}" @click="${this._handleItemClick}" @keydown="${this._handleItemKeydown}"> </lit-virtualizer> </ha-list>`:r.s6} </ha-expansion-panel> `}_handleItemKeydown(e){"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),this._handleItemClick(e))}_handleItemClick(e){const t=e.target.closest("ha-check-list-item"),i=t?.value;i&&(this.value?.includes(i)?this.value=this.value?.filter(e=>e!==i):this.value=[...this.value||[],i],t.selected=this.value?.includes(i))}updated(e){e.has("expanded")&&this.expanded&&setTimeout(()=>{this.expanded&&(this._list.style.height=this.clientHeight-49-4-32+"px")},300)}_expandedWillChange(e){this._shouldRender=e.detail.expanded}_expandedChanged(e){this.expanded=e.detail.expanded}_handleSearchChange(e){const t=e.target;this._filter=(t.value??"").toLowerCase()}async _findRelated(){const e=[];if(!this.value?.length)return this.value=[],void(0,n.r)(this,"data-table-filter-changed",{value:[],items:void 0});const t=[];for(const i of this.value)t.push(i),this.type&&e.push((0,c.f)(this.hass,"device",i));const i=await Promise.all(e),a=new Set;for(const e of i)e[this.type]&&e[this.type].forEach(e=>a.add(e));(0,n.r)(this,"data-table-filter-changed",{value:t,items:this.type?a:void 0})}_clearFilter(e){e.preventDefault(),this.value=void 0,(0,n.r)(this,"data-table-filter-changed",{value:void 0,items:void 0})}static get styles(){return[p.dp,r.AH`:host{border-bottom:1px solid var(--divider-color)}:host([expanded]){flex:1;height:0}ha-expansion-panel{--ha-card-border-radius:var(--ha-border-radius-square);--expansion-panel-content-padding:0}.header{display:flex;align-items:center}.header ha-icon-button{margin-inline-start:auto;margin-inline-end:8px}.badge{display:inline-block;margin-left:8px;margin-inline-start:8px;margin-inline-end:0;min-width:16px;box-sizing:border-box;border-radius:var(--ha-border-radius-circle);font-size:var(--ha-font-size-xs);font-weight:var(--ha-font-weight-normal);background-color:var(--primary-color);line-height:var(--ha-line-height-normal);text-align:center;padding:0px 2px;color:var(--text-primary-color)}ha-check-list-item{width:100%}ha-input-search{display:block;padding:var(--ha-space-1) var(--ha-space-2) 0}`]}constructor(...e){super(...e),this.expanded=!1,this.narrow=!1,this._shouldRender=!1,this._keyFunction=e=>e?.id,this._renderItem=e=>e?r.qy`<ha-check-list-item tabindex="0" .value="${e.id}" .selected="${this.value?.includes(e.id)??!1}"> ${(0,l.T)(e,this.hass.localize,this.hass.states)} </ha-check-list-item>`:r.s6,this._devices=(0,o.A)((e,t,i)=>Object.values(e).filter(e=>!t||(0,l.T)(e,this.hass.localize,this.hass.states).toLowerCase().includes(t)).sort((e,t)=>(0,d.xL)((0,l.T)(e,this.hass.localize,this.hass.states),(0,l.T)(t,this.hass.localize,this.hass.states),this.hass.locale.language)))}}(0,a.Cg)([(0,s.MZ)({attribute:!1})],m.prototype,"hass",void 0),(0,a.Cg)([(0,s.MZ)({attribute:!1})],m.prototype,"value",void 0),(0,a.Cg)([(0,s.MZ)()],m.prototype,"type",void 0),(0,a.Cg)([(0,s.MZ)({type:Boolean,reflect:!0})],m.prototype,"expanded",void 0),(0,a.Cg)([(0,s.MZ)({type:Boolean})],m.prototype,"narrow",void 0),(0,a.Cg)([(0,s.wk)()],m.prototype,"_shouldRender",void 0),(0,a.Cg)([(0,s.wk)()],m.prototype,"_filter",void 0),(0,a.Cg)([(0,s.P)("ha-list")],m.prototype,"_list",void 0),m=(0,a.Cg)([(0,s.EM)("ha-filter-devices")],m),t()}catch(e){t(e)}})},72644(e,t,i){i.a(e,async function(e,t){try{i(74423),i(44114),i(18111),i(22489),i(7588),i(61701),i(17642),i(58004),i(33853),i(45876),i(32475),i(15024),i(31698);var a=i(62826),r=i(5124),s=i(22441),o=i(6412),n=i(75751),l=i(22786),d=i(1087),h=i(15638),c=i(19459),p=i(32250),u=i(71606),g=i(14503),v=(i(11382),i(18198),i(47680),i(26300)),f=(i(67094),i(73150),i(86698),i(83492),e([v]));v=(f.then?(await f)():f)[0];const m="M21 8H3V6H21V8M13.81 16H10V18H13.09C13.21 17.28 13.46 16.61 13.81 16M18 11H6V13H18V11M21.12 15.46L19 17.59L16.88 15.46L15.47 16.88L17.59 19L15.47 21.12L16.88 22.54L19 20.41L21.12 22.54L22.54 21.12L20.41 19L22.54 16.88L21.12 15.46Z",b="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 y extends r.WF{willUpdate(e){super.willUpdate(e),e.has("value")&&!(0,c.b)(this.value,e.get("value"))&&this._findRelated()}render(){const e=this._areas(this.hass.areas,this.hass.floors);return r.qy` <ha-expansion-panel left-chevron .expanded="${this.expanded}" @expanded-will-change="${this._expandedWillChange}" @expanded-changed="${this._expandedChanged}"> <div slot="header" class="header"> ${this.hass.localize("ui.panel.config.areas.caption")} ${this.value?.areas?.length||this.value?.floors?.length?r.qy`<div class="badge"> ${(this.value?.areas?.length||0)+(this.value?.floors?.length||0)} </div> <ha-icon-button .path="${m}" @click="${this._clearFilter}"></ha-icon-button>`:r.s6} </div> ${this._shouldRender?r.qy` <ha-list-selectable class="ha-scrollbar" multi @ha-list-selected="${this._handleListChanged}" aria-label="${this.hass.localize("ui.panel.config.areas.caption")}"> ${(0,n.u)(e?.floors||[],e=>e.floor_id,e=>r.qy` <ha-list-item-option appearance="checkbox" selection-position="end" .value="${e.floor_id}" .type="${"floors"}" .selected="${this.value?.floors?.includes(e.floor_id)||!1}"> <ha-floor-icon slot="start" .floor="${e}"></ha-floor-icon> <span slot="headline">${e.name} </span> </ha-list-item-option> ${(0,n.u)(e.areas,(t,i)=>`${t.area_id}${i===e.areas.length-1?"___last":""}`,(t,i)=>this._renderArea(t,i===e.areas.length-1))} `)} ${(0,n.u)(e?.unassisgnedAreas,e=>e.area_id,e=>this._renderArea(e))} </ha-list-selectable> `:r.s6} </ha-expansion-panel> `}_renderArea(e,t=!1){const i=!!e.floor_id;return r.qy` <ha-list-item-option appearance="checkbox" selection-position="end" .value="${e.area_id}" .selected="${this.value?.areas?.includes(e.area_id)||!1}" .type="${"areas"}" class="${(0,o.H)({rtl:(0,h.qC)(this.hass.language,this.hass.translationMetadata.translations),floor:i})}"> ${i?r.qy`<ha-tree-indicator slot="start" .end="${t}"></ha-tree-indicator>`:r.s6} ${e.icon?r.qy`<ha-icon slot="start" .icon="${e.icon}"></ha-icon>`:r.qy`<ha-svg-icon slot="start" .path="${b}"></ha-svg-icon>`} <span slot="headline">${e.name}</span> </ha-list-item-option> `}_handleListChanged(e){if(e.detail.diff?.added.size||e.detail.diff?.removed.size)if(e.detail.diff?.added.size){const t=e.detail.diff.added.values().next().value;if(void 0===t)return;const i=e.currentTarget.items[t];this.value||(this.value={}),this.value={...this.value,[i.type]:[...this.value[i.type]||[],i.value]}}else{const t=e.detail.diff?.removed.values().next().value;if(void 0===t)return;const i=e.currentTarget.items[t];this.value={...this.value,[i.type]:this.value[i.type].filter(e=>e!==i.value)}}}updated(e){e.has("expanded")&&this.expanded&&setTimeout(()=>{this.expanded&&(this._list.style.height=this.clientHeight-49+"px")},300)}_expandedWillChange(e){this._shouldRender=e.detail.expanded}_expandedChanged(e){this.expanded=e.detail.expanded}async _findRelated(){const e=[];if(!this.value||!this.value.areas?.length&&!this.value.floors?.length)return this.value={},void(0,d.r)(this,"data-table-filter-changed",{value:{},items:void 0});if(this.value.areas)for(const t of this.value.areas)this.type&&e.push((0,u.f)(this.hass,"area",t));if(this.value.floors)for(const t of this.value.floors)this.type&&e.push((0,u.f)(this.hass,"floor",t));const t=await Promise.all(e),i=new Set;for(const e of t)e[this.type]&&e[this.type].forEach(e=>i.add(e));(0,d.r)(this,"data-table-filter-changed",{value:this.value,items:this.type?i:void 0})}_clearFilter(e){e.preventDefault(),this.value=void 0,(0,d.r)(this,"data-table-filter-changed",{value:void 0,items:void 0})}static get styles(){return[g.dp,r.AH`:host{border-bottom:1px solid var(--divider-color)}:host([expanded]){flex:1;height:0}ha-expansion-panel{--ha-card-border-radius:var(--ha-border-radius-square);--expansion-panel-content-padding:0}.header{display:flex;align-items:center}.header ha-icon-button{margin-inline-start:auto;margin-inline-end:8px}.badge{display:inline-block;margin-left:8px;margin-inline-start:8px;margin-inline-end:0;min-width:16px;box-sizing:border-box;border-radius:var(--ha-border-radius-circle);font-size:var(--ha-font-size-xs);font-weight:var(--ha-font-weight-normal);background-color:var(--primary-color);line-height:var(--ha-line-height-normal);text-align:center;padding:0px 2px;color:var(--text-primary-color)}.floor::part(base){padding-inline-start:48px;padding-inline-end:16px}ha-tree-indicator{width:56px;position:absolute;top:0px;left:0px}.rtl ha-tree-indicator{right:0px;left:initial;transform:scaleX(-1)}.subdir{margin-inline-end:8px;opacity:.6}`]}constructor(...e){super(...e),this.narrow=!1,this.expanded=!1,this._shouldRender=!1,this._areas=(0,l.A)((e,t)=>{const i=Object.values(e),a=Object.values(t),r=(0,p._o)(i),s=i.filter(e=>!e.floor_id||!r[e.floor_id]);return{floors:a?.map(e=>({...e,areas:r[e.floor_id]||[]})),unassisgnedAreas:s}})}}(0,a.Cg)([(0,s.MZ)({attribute:!1})],y.prototype,"hass",void 0),(0,a.Cg)([(0,s.MZ)({attribute:!1})],y.prototype,"value",void 0),(0,a.Cg)([(0,s.MZ)()],y.prototype,"type",void 0),(0,a.Cg)([(0,s.MZ)({type:Boolean})],y.prototype,"narrow",void 0),(0,a.Cg)([(0,s.MZ)({type:Boolean,reflect:!0})],y.prototype,"expanded",void 0),(0,a.Cg)([(0,s.wk)()],y.prototype,"_shouldRender",void 0),(0,a.Cg)([(0,s.P)("ha-list-selectable")],y.prototype,"_list",void 0),y=(0,a.Cg)([(0,s.EM)("ha-filter-floor-areas")],y),t()}catch(e){t(e)}})},138(e,t,i){i.a(e,async function(e,t){try{i(74423),i(44114),i(18111),i(22489),i(61701),i(17642),i(58004),i(33853),i(45876),i(32475),i(15024),i(31698);var a=i(62826),r=i(35211),s=i(5124),o=i(22441),n=i(75751),l=i(22786),d=i(1087),h=i(91926),c=i(52220),p=i(22792),u=i(14503),g=(i(30716),i(11382),i(47680),i(26300)),v=i(23430),f=(i(8630),i(28732),i(36866)),m=e([g,v,f]);[g,v,f]=m.then?(await m)():m;const b="M12,15.5A3.5,3.5 0 0,1 8.5,12A3.5,3.5 0 0,1 12,8.5A3.5,3.5 0 0,1 15.5,12A3.5,3.5 0 0,1 12,15.5M19.43,12.97C19.47,12.65 19.5,12.33 19.5,12C19.5,11.67 19.47,11.34 19.43,11L21.54,9.37C21.73,9.22 21.78,8.95 21.66,8.73L19.66,5.27C19.54,5.05 19.27,4.96 19.05,5.05L16.56,6.05C16.04,5.66 15.5,5.32 14.87,5.07L14.5,2.42C14.46,2.18 14.25,2 14,2H10C9.75,2 9.54,2.18 9.5,2.42L9.13,5.07C8.5,5.32 7.96,5.66 7.44,6.05L4.95,5.05C4.73,4.96 4.46,5.05 4.34,5.27L2.34,8.73C2.21,8.95 2.27,9.22 2.46,9.37L4.57,11C4.53,11.34 4.5,11.67 4.5,12C4.5,12.33 4.53,12.65 4.57,12.97L2.46,14.63C2.27,14.78 2.21,15.05 2.34,15.27L4.34,18.73C4.46,18.95 4.73,19.03 4.95,18.95L7.44,17.94C7.96,18.34 8.5,18.68 9.13,18.93L9.5,21.58C9.54,21.82 9.75,22 10,22H14C14.25,22 14.46,21.82 14.5,21.58L14.87,18.93C15.5,18.67 16.04,18.34 16.56,17.94L19.05,18.95C19.27,19.03 19.54,18.95 19.66,18.73L21.66,15.27C21.78,15.05 21.73,14.78 21.54,14.63L19.43,12.97Z",y="M21 8H3V6H21V8M13.81 16H10V18H13.09C13.21 17.28 13.46 16.61 13.81 16M18 11H6V13H18V11M21.12 15.46L19 17.59L16.88 15.46L15.47 16.88L17.59 19L15.47 21.12L16.88 22.54L19 20.41L21.12 22.54L22.54 21.12L20.41 19L22.54 16.88L21.12 15.46Z";class x extends s.WF{render(){return s.qy` <ha-expansion-panel left-chevron .expanded="${this.expanded}" @expanded-will-change="${this._expandedWillChange}" @expanded-changed="${this._expandedChanged}"> <div slot="header" class="header"> ${this.hass.localize("ui.panel.config.labels.caption")} ${this.value?.length?s.qy`<div class="badge">${this.value?.length}</div> <ha-icon-button .path="${y}" @click="${this._clearFilter}"></ha-icon-button>`:s.s6} </div> ${this._shouldRender?s.qy`<ha-input-search appearance="outlined" .value="${this._filter}" @input="${this._handleSearchChange}"> </ha-input-search> <ha-list @selected="${this._labelSelected}" class="ha-scrollbar" multi> ${(0,n.u)(this._filteredLabels(this._labels||[],this._filter,this.value),e=>e.label_id,e=>s.qy`<ha-check-list-item .value="${e.label_id}" .selected="${(this.value||[]).includes(e.label_id)}" hasMeta> <ha-label .color="${e.color}" .description="${e.description}"> ${e.icon?s.qy`<ha-icon slot="icon" .icon="${e.icon}"></ha-icon>`:s.s6} ${e.name} </ha-label> </ha-check-list-item>`)} </ha-list> `:s.s6} </ha-expansion-panel> ${this.expanded?s.qy`<ha-list-item graphic="icon" @click="${this._manageLabels}" class="add"> <ha-svg-icon slot="graphic" .path="${b}"></ha-svg-icon> ${this.hass.localize("ui.panel.config.labels.manage_labels")} </ha-list-item>`:s.s6} `}updated(e){e.has("expanded")&&this.expanded&&setTimeout(()=>{this.expanded&&(this._list.style.height=this.clientHeight-133+"px")},300)}_manageLabels(){(0,h.oo)("/config/labels")}_expandedWillChange(e){this._shouldRender=e.detail.expanded}_expandedChanged(e){this.expanded=e.detail.expanded}_handleSearchChange(e){const t=e.target.value??"";this._filter=t.toLowerCase()}async _labelSelected(e){const t=this._filteredLabels(this._labels||[],this._filter,this.value),i=new Set(t.map(e=>e.label_id)),a=(this.value||[]).filter(e=>!i.has(e)),r=[];for(const i of e.detail.index){const e=t[i]?.label_id;e&&r.push(e)}const s=[...a,...r];this.value=s.length?s:[],(0,d.r)(this,"data-table-filter-changed",{value:s.length?s:void 0,items:void 0})}_clearFilter(e){e.preventDefault(),this.value=void 0,(0,d.r)(this,"data-table-filter-changed",{value:void 0,items:void 0})}static get styles(){return[u.dp,s.AH`:host{position:relative;border-bottom:1px solid var(--divider-color)}:host([expanded]){flex:1;height:0}ha-expansion-panel{--ha-card-border-radius:var(--ha-border-radius-square);--expansion-panel-content-padding:0}.header{display:flex;align-items:center}.header ha-icon-button{margin-inline-start:auto;margin-inline-end:8px}.badge{display:inline-block;margin-left:8px;margin-inline-start:8px;margin-inline-end:0;min-width:16px;box-sizing:border-box;border-radius:var(--ha-border-radius-circle);font-size:var(--ha-font-size-xs);font-weight:var(--ha-font-weight-normal);background-color:var(--primary-color);line-height:var(--ha-line-height-normal);text-align:center;padding:0px 2px;color:var(--text-primary-color)}.warning{color:var(--error-color)}.add{position:absolute;bottom:0;right:0;left:0}ha-input-search{display:block;padding:var(--ha-space-1) var(--ha-space-2) 0}`]}constructor(...e){super(...e),this.narrow=!1,this.expanded=!1,this._shouldRender=!1,this._filteredLabels=(0,l.A)((e,t,i)=>e.filter(e=>!t||e.name.toLowerCase().includes(t)||e.label_id.toLowerCase().includes(t)).sort((e,t)=>(0,c.xL)(e.name||e.label_id,t.name||t.label_id,this.hass.locale.language)))}}(0,a.Cg)([(0,o.MZ)({attribute:!1})],x.prototype,"hass",void 0),(0,a.Cg)([(0,o.MZ)({attribute:!1})],x.prototype,"value",void 0),(0,a.Cg)([(0,o.MZ)({type:Boolean})],x.prototype,"narrow",void 0),(0,a.Cg)([(0,o.MZ)({type:Boolean,reflect:!0})],x.prototype,"expanded",void 0),(0,a.Cg)([(0,r.Fg)({context:p.HD,subscribe:!0}),(0,o.wk)()],x.prototype,"_labels",void 0),(0,a.Cg)([(0,o.wk)()],x.prototype,"_shouldRender",void 0),(0,a.Cg)([(0,o.wk)()],x.prototype,"_filter",void 0),(0,a.Cg)([(0,o.P)("ha-list")],x.prototype,"_list",void 0),x=(0,a.Cg)([(0,o.EM)("ha-filter-labels")],x),t()}catch(e){t(e)}})},18198(e,t,i){i.d(t,{Dc:()=>n,Si:()=>o});var a=i(62826),r=i(5124),s=i(22441);i(47680),i(67094);const o=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"},n=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"};class l extends r.WF{render(){if(!this.floor)return r.s6;if(this.floor.icon)return r.qy`<ha-icon .icon="${this.floor.icon}"></ha-icon>`;const e=o(this.floor);return r.qy`<ha-svg-icon .path="${e}"></ha-svg-icon>`}}(0,a.Cg)([(0,s.MZ)({attribute:!1})],l.prototype,"floor",void 0),(0,a.Cg)([(0,s.MZ)()],l.prototype,"icon",void 0),l=(0,a.Cg)([(0,s.EM)("ha-floor-icon")],l)},23430(e,t,i){i.a(e,async function(e,a){try{i.d(t,{l:()=>p});var r=i(62826),s=i(5124),o=i(22441),n=i(78870),l=i(79622),d=i(86836),h=i(34127),c=e([h]);h=(c.then?(await c)():c)[0];const p=e=>{const t=e?(0,n.MP)(e):void 0;return t?`--ha-label-background-color: ${t};\n --primary-text-color: ${(0,l.gJ)(e)};`:"--ha-label-background-color: rgba(var(--rgb-primary-text-color), 0.15);"};class u extends s.WF{willUpdate(e){super.willUpdate(e),e.has("color")&&(this.style.cssText=p(this.color))}render(){return s.qy` <ha-tooltip .for="${this._elementId}" .disabled="${!this.description?.trim()}"> ${this.description} </ha-tooltip> <div class="container" .id="${this._elementId}"> <span class="content"> <slot name="icon"></slot> <slot></slot> </span> </div> `}static get styles(){return[s.AH`:host{--ha-label-text-color:var(--primary-text-color);--ha-label-icon-color:var(--primary-text-color);--ha-label-background-opacity:1;border:1px solid var(--outline-color);position:relative;box-sizing:border-box;display:inline-flex;flex-direction:row;align-items:center;font-size:var(--ha-font-size-s);font-weight:var(--ha-font-weight-medium);line-height:var(--ha-line-height-condensed);letter-spacing:.1px;height:32px;border-radius:var(--ha-border-radius-xl);color:var(--ha-label-text-color);--mdc-icon-size:12px;text-wrap:nowrap}.content>*{position:relative;display:inline-flex;flex-direction:row;align-items:center}:host:before{position:absolute;content:"";inset:0;border-radius:inherit;background-color:var(--ha-label-background-color);opacity:var(--ha-label-background-opacity)}::slotted([slot=icon]){margin-right:8px;margin-left:-8px;margin-inline-start:-8px;margin-inline-end:8px;display:flex}.container{display:flex;align-items:center;position:relative;height:100%;padding:0 16px}span{display:inline-flex}:host([dense]){height:20px;border-radius:var(--ha-border-radius-md)}:host([dense]) .container{padding:0 12px}:host([dense]) ::slotted([slot=icon]){margin-right:4px;margin-left:-4px;margin-inline-start:-4px;margin-inline-end:4px}`]}constructor(...e){super(...e),this.dense=!1,this._elementId="label-"+(0,d.L)()}}(0,r.Cg)([(0,o.MZ)({type:Boolean,reflect:!0})],u.prototype,"dense",void 0),(0,r.Cg)([(0,o.MZ)()],u.prototype,"color",void 0),(0,r.Cg)([(0,o.MZ)({attribute:"description"})],u.prototype,"description",void 0),u=(0,r.Cg)([(0,o.EM)("ha-label")],u),a()}catch(e){a(e)}})},28732(e,t,i){var a=i(62826),r=i(27686),s=i(7731),o=i(5124),n=i(22441);class l extends r.J{renderRipple(){return this.noninteractive?"":super.renderRipple()}static get styles(){return[s.R,o.AH`:host{padding-left:var(--mdc-list-side-padding-left,var(--mdc-list-side-padding,20px));padding-inline-start:var(--mdc-list-side-padding-left,var(--mdc-list-side-padding,20px));padding-right:var(--mdc-list-side-padding-right,var(--mdc-list-side-padding,20px));padding-inline-end:var(--mdc-list-side-padding-right,var(--mdc-list-side-padding,20px))}:host([graphic=avatar]:not([twoLine])),:host([graphic=icon]:not([twoLine])){height:48px}span.material-icons:first-of-type{margin-inline-start:0px!important;margin-inline-end:var(--mdc-list-item-graphic-margin,16px)!important;direction:var(--direction)!important}span.material-icons:last-of-type{margin-inline-start:auto!important;margin-inline-end:0px!important;direction:var(--direction)!important}.mdc-deprecated-list-item__meta{display:var(--mdc-list-item-meta-display);align-items:center;flex-shrink:0}:host([graphic=icon]:not([twoline])) .mdc-deprecated-list-item__graphic{margin-inline-end:var(--mdc-list-item-graphic-margin,20px)!important}:host([multiline-secondary]){height:auto}:host([multiline-secondary]) .mdc-deprecated-list-item__text{padding:8px 0}:host([multiline-secondary]) .mdc-deprecated-list-item__secondary-text{text-overflow:initial;white-space:normal;overflow:auto;display:inline-block;margin-top:10px}:host([multiline-secondary]) .mdc-deprecated-list-item__primary-text{margin-top:10px}:host([multiline-secondary]) .mdc-deprecated-list-item__secondary-text::before{display:none}:host([multiline-secondary]) .mdc-deprecated-list-item__primary-text::before{display:none}:host([disabled]){color:var(--disabled-text-color)}:host([noninteractive]){pointer-events:unset}`,"rtl"===document.dir?o.AH`span.material-icons:first-of-type,span.material-icons:last-of-type{direction:rtl!important;--direction:rtl}`:o.AH``]}}l=(0,a.Cg)([(0,n.EM)("ha-list-item")],l)},73150(e,t,i){var a=i(62826),r=i(5124),s=i(22441);class o extends r.WF{render(){return r.qy` <svg width="100%" height="100%" viewBox="0 0 48 48"> <line x1="24" y1="0" x2="24" y2="${this.end?"24":"48"}"></line> <line x1="24" y1="24" x2="36" y2="24"></line> </svg> `}constructor(...e){super(...e),this.end=!1}}o.styles=r.AH`:host{display:block;width:48px;height:48px}line{stroke:var(--divider-color);stroke-width:2;stroke-dasharray:2}`,(0,a.Cg)([(0,s.MZ)({type:Boolean,reflect:!0})],o.prototype,"end",void 0),o=(0,a.Cg)([(0,s.EM)("ha-tree-indicator")],o)},32250(e,t,i){i.d(t,{KD:()=>a,NL:()=>r,Rj:()=>o,_o:()=>n,ls:()=>s});i(44114);const a=(e,t)=>e.callWS({type:"config/floor_registry/create",...t}),r=(e,t,i)=>e.callWS({type:"config/floor_registry/update",floor_id:t,...i}),s=(e,t)=>e.callWS({type:"config/floor_registry/delete",floor_id:t}),o=(e,t)=>e.callWS({type:"config/floor_registry/reorder",floor_ids:t}),n=e=>{const t={};for(const i of e)i.floor_id&&(i.floor_id in t||(t[i.floor_id]=[]),t[i.floor_id].push(i));return t}},71606(e,t,i){i.d(t,{f:()=>r,o:()=>a});i(17642),i(58004),i(33853),i(45876),i(32475),i(15024),i(31698);const a=new Set(["automation","script","scene","group"]),r=(e,t,i)=>e.callWS({type:"search/related",item_type:t,item_id:i})},69569(e,t,i){i.d(t,{f:()=>s});var a=i(1087);const r=()=>Promise.all([i.e(92769),i.e(3283),i.e(37941),i.e(26092),i.e(18965)]).then(i.bind(i,427)),s=(e,t)=>{(0,a.r)(e,"show-dialog",{dialogTag:"dialog-label-detail",dialogImport:r,dialogParams:t})}}};