iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
4 lines • 56.1 kB
JavaScript
"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["49750"],{43537:function(e,t,i){i.d(t,{Z:()=>n});const a=e=>e<10?`0${e}`:e;function n(e){const t=Math.floor(e/3600),i=Math.floor(e%3600/60),n=Math.floor(e%3600%60);return t>0?`${t}:${a(i)}:${a(n)}`:i>0?`${i}:${a(n)}`:n>0?""+n:null}},27015:function(e,t,i){i.d(t,{K:()=>c,R:()=>d});i(9359),i(1331),i(52924);var a=i(73850),n=i(22431),s=i(96530),l=i(72344),o=i(63318),r=i(75101);const d=(e,t,i,n,o,r)=>{var d,c;if(!(null===(d=e.states[t])||void 0===d||!d.attributes.restored))return!0;const h=(0,a.M)(t),u=n.find((e=>e.entity_id===t));if((0,s.X)(h))return!!((0,l.p)(e,h)&&u&&r.some((e=>e.id===u.unique_id)));const p=null==u?void 0:u.config_entry_id;if(!p)return!1;const f=o.find((e=>e.entry_id===p));return"helper"===(null===(c=i.find((e=>e.domain===(null==f?void 0:f.domain))))||void 0===c?void 0:c.integration_type)},c=(e,t,i,d,c,h)=>{var u;const p=(0,a.M)(t),f=d.find((e=>e.entity_id===t));if((0,s.X)(p)){if((0,l.p)(e,p)&&f&&h.some((e=>e.id===f.unique_id)))return void n.E[p].delete(e,f.unique_id);const i=e.states[t];if(null==i||!i.attributes.restored)return;return void(0,o.z3)(e,t)}const m=null==f?void 0:f.config_entry_id,b=m?c.find((e=>e.entry_id===m)):void 0;!b||"helper"!==(null===(u=i.find((e=>e.domain===b.domain)))||void 0===u?void 0:u.integration_type)?(0,o.z3)(e,t):(0,r.iJ)(e,m)}},99426:function(e,t,i){i.r(t);var a=i(61701),n=(i(71695),i(47021),i(57243)),s=i(50778),l=i(35359),o=i(36522);i(23334),i(37583);let r,d,c,h,u=e=>e;const p={info:"M11,9H13V7H11M12,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,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M11,17H13V11H11V17Z",warning:"M12,2L1,21H23M12,6L19.53,19H4.47M11,10V14H13V10M11,16V18H13V16",error:"M11,15H13V17H11V15M11,7H13V13H11V7M12,2C6.47,2 2,6.5 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4A8,8 0 0,1 20,12A8,8 0 0,1 12,20Z",success:"M20,12A8,8 0 0,1 12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4C12.76,4 13.5,4.11 14.2,4.31L15.77,2.74C14.61,2.26 13.34,2 12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12M7.91,10.08L6.5,11.5L11,16L21,6L19.59,4.58L11,13.17L7.91,10.08Z"};(0,a.Z)([(0,s.Mo)("ha-alert")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,s.Cb)()],key:"title",value(){return""}},{kind:"field",decorators:[(0,s.Cb)({attribute:"alert-type"})],key:"alertType",value(){return"info"}},{kind:"field",decorators:[(0,s.Cb)({type:Boolean})],key:"dismissable",value(){return!1}},{kind:"field",decorators:[(0,s.Cb)({type:Boolean})],key:"narrow",value(){return!1}},{kind:"method",key:"render",value:function(){return(0,n.dy)(r||(r=u` <div class="issue-type ${0}" role="alert"> <div class="icon ${0}"> <slot name="icon"> <ha-svg-icon .path="${0}"></ha-svg-icon> </slot> </div> <div class="${0}"> <div class="main-content"> ${0} <slot></slot> </div> <div class="action"> <slot name="action"> ${0} </slot> </div> </div> </div> `),(0,l.$)({[this.alertType]:!0}),this.title?"":"no-title",p[this.alertType],(0,l.$)({content:!0,narrow:this.narrow}),this.title?(0,n.dy)(d||(d=u`<div class="title">${0}</div>`),this.title):n.Ld,this.dismissable?(0,n.dy)(c||(c=u`<ha-icon-button @click="${0}" label="Dismiss alert" .path="${0}"></ha-icon-button>`),this._dismissClicked,"M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z"):n.Ld)}},{kind:"method",key:"_dismissClicked",value:function(){(0,o.B)(this,"alert-dismissed-clicked")}},{kind:"field",static:!0,key:"styles",value(){return(0,n.iv)(h||(h=u`.issue-type{position:relative;padding:8px;display:flex}.issue-type::after{position:absolute;top:0;right:0;bottom:0;left:0;opacity:.12;pointer-events:none;content:"";border-radius:4px}.icon{z-index:1}.icon.no-title{align-self:center}.content{display:flex;justify-content:space-between;align-items:center;width:100%;text-align:var(--float-start)}.content.narrow{flex-direction:column;align-items:flex-end}.action{z-index:1;width:min-content;--mdc-theme-primary:var(--primary-text-color)}.main-content{overflow-wrap:anywhere;word-break:break-word;margin-left:8px;margin-right:0;margin-inline-start:8px;margin-inline-end:0}.title{margin-top:2px;font-weight:700}.action ha-icon-button,.action mwc-button{--mdc-theme-primary:var(--primary-text-color);--mdc-icon-button-size:36px}.issue-type.info>.icon{color:var(--info-color)}.issue-type.info::after{background-color:var(--info-color)}.issue-type.warning>.icon{color:var(--warning-color)}.issue-type.warning::after{background-color:var(--warning-color)}.issue-type.error>.icon{color:var(--error-color)}.issue-type.error::after{background-color:var(--error-color)}.issue-type.success>.icon{color:var(--success-color)}.issue-type.success::after{background-color:var(--success-color)}:host ::slotted(ul){margin:0;padding-inline-start:20px}`))}}]}}),n.oi)},48103:function(e,t,i){var a=i(61701),n=i(72621),s=(i(71695),i(40251),i(47021),i(57243)),l=i(93958),o=i(97536),r=i(46289),d=i(50778),c=i(36522);let h,u=e=>e;(0,a.Z)([(0,d.Mo)("ha-check-list-item")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"method",key:"onChange",value:async function(e){(0,n.Z)(i,"onChange",this,3)([e]),(0,c.B)(this,e.type)}},{kind:"field",static:!0,key:"styles",value(){return[r.W,o.W,(0,s.iv)(h||(h=u`:host{--mdc-theme-secondary:var(--primary-color)}:host([graphic=avatar]) .mdc-deprecated-list-item__graphic,:host([graphic=control]) .mdc-deprecated-list-item__graphic,:host([graphic=large]) .mdc-deprecated-list-item__graphic,:host([graphic=medium]) .mdc-deprecated-list-item__graphic{margin-inline-end:var(--mdc-list-item-graphic-margin,16px);margin-inline-start:0px;direction:var(--direction)}.mdc-deprecated-list-item__meta{flex-shrink:0;direction:var(--direction);margin-inline-start:auto;margin-inline-end:0}.mdc-deprecated-list-item__graphic{margin-top:var(--check-list-item-graphic-margin-top)}:host([graphic=icon]) .mdc-deprecated-list-item__graphic{margin-inline-start:0;margin-inline-end:var(--mdc-list-item-graphic-margin,32px)}`))]}}]}}),l.F)},41307:function(e,t,i){var a=i(61701),n=i(72621),s=(i(71695),i(40251),i(47021),i(57243)),l=i(50778),o=i(35359),r=i(36522),d=i(76320);i(37583);let c,h,u,p,f=e=>e;(0,a.Z)([(0,l.Mo)("ha-expansion-panel")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,l.Cb)({type:Boolean,reflect:!0})],key:"expanded",value(){return!1}},{kind:"field",decorators:[(0,l.Cb)({type:Boolean,reflect:!0})],key:"outlined",value(){return!1}},{kind:"field",decorators:[(0,l.Cb)({attribute:"left-chevron",type:Boolean,reflect:!0})],key:"leftChevron",value(){return!1}},{kind:"field",decorators:[(0,l.Cb)({attribute:"no-collapse",type:Boolean,reflect:!0})],key:"noCollapse",value(){return!1}},{kind:"field",decorators:[(0,l.Cb)()],key:"header",value:void 0},{kind:"field",decorators:[(0,l.Cb)()],key:"secondary",value:void 0},{kind:"field",decorators:[(0,l.SB)()],key:"_showContent",value(){return this.expanded}},{kind:"field",decorators:[(0,l.IO)(".container")],key:"_container",value:void 0},{kind:"method",key:"render",value:function(){const e=this.noCollapse?s.Ld:(0,s.dy)(c||(c=f` <ha-svg-icon .path="${0}" class="summary-icon ${0}"></ha-svg-icon> `),"M7.41,8.58L12,13.17L16.59,8.58L18,10L12,16L6,10L7.41,8.58Z",(0,o.$)({expanded:this.expanded}));return(0,s.dy)(h||(h=f` <div class="top ${0}"> <div id="summary" class="${0}" @click="${0}" @keydown="${0}" @focus="${0}" @blur="${0}" role="button" tabindex="${0}" aria-expanded="${0}" aria-controls="sect1"> ${0} <slot name="leading-icon"></slot> <slot name="header"> <div class="header"> ${0} <slot class="secondary" name="secondary">${0}</slot> </div> </slot> ${0} <slot name="icons"></slot> </div> </div> <div class="container ${0}" @transitionend="${0}" role="region" aria-labelledby="summary" aria-hidden="${0}" tabindex="-1"> ${0} </div> `),(0,o.$)({expanded:this.expanded}),(0,o.$)({noCollapse:this.noCollapse}),this._toggleContainer,this._toggleContainer,this._focusChanged,this._focusChanged,this.noCollapse?-1:0,this.expanded,this.leftChevron?e:s.Ld,this.header,this.secondary,this.leftChevron?s.Ld:e,(0,o.$)({expanded:this.expanded}),this._handleTransitionEnd,!this.expanded,this._showContent?(0,s.dy)(u||(u=f`<slot></slot>`)):"")}},{kind:"method",key:"willUpdate",value:function(e){(0,n.Z)(i,"willUpdate",this,3)([e]),e.has("expanded")&&(this._showContent=this.expanded,setTimeout((()=>{this._container.style.overflow=this.expanded?"initial":"hidden"}),300))}},{kind:"method",key:"_handleTransitionEnd",value:function(){this._container.style.removeProperty("height"),this._container.style.overflow=this.expanded?"initial":"hidden",this._showContent=this.expanded}},{kind:"method",key:"_toggleContainer",value:async function(e){if(e.defaultPrevented)return;if("keydown"===e.type&&"Enter"!==e.key&&" "!==e.key)return;if(e.preventDefault(),this.noCollapse)return;const t=!this.expanded;(0,r.B)(this,"expanded-will-change",{expanded:t}),this._container.style.overflow="hidden",t&&(this._showContent=!0,await(0,d.y)());const i=this._container.scrollHeight;this._container.style.height=`${i}px`,t||setTimeout((()=>{this._container.style.height="0px"}),0),this.expanded=t,(0,r.B)(this,"expanded-changed",{expanded:this.expanded})}},{kind:"method",key:"_focusChanged",value:function(e){this.noCollapse||this.shadowRoot.querySelector(".top").classList.toggle("focused","focus"===e.type)}},{kind:"field",static:!0,key:"styles",value(){return(0,s.iv)(p||(p=f`:host{display:block}.top{display:flex;align-items:center;border-radius:var(--ha-card-border-radius,12px)}.top.expanded{border-bottom-left-radius:0px;border-bottom-right-radius:0px}.top.focused{background:var(--input-fill-color)}:host([outlined]){box-shadow:none;border-width:1px;border-style:solid;border-color:var(--outline-color);border-radius:var(--ha-card-border-radius,12px)}.summary-icon{transition:transform 150ms cubic-bezier(.4, 0, .2, 1);direction:var(--direction);margin-left:8px;margin-inline-start:8px;margin-inline-end:initial}::slotted([slot=leading-icon]),:host([left-chevron]) .summary-icon{margin-left:0;margin-right:8px;margin-inline-start:0;margin-inline-end:8px}#summary{flex:1;display:flex;padding:var(--expansion-panel-summary-padding,0 8px);min-height:48px;align-items:center;cursor:pointer;overflow:hidden;font-weight:500;outline:0}#summary.noCollapse{cursor:default}.summary-icon.expanded{transform:rotate(180deg)}.header,::slotted([slot=header]){flex:1}.container{padding:var(--expansion-panel-content-padding,0 8px);overflow:hidden;transition:height .3s cubic-bezier(.4, 0, .2, 1);height:0px}.container.expanded{height:auto}.secondary{display:block;color:var(--secondary-text-color);font-size:12px}`))}}]}}),s.oi)},72807:function(e,t,i){i.a(e,(async function(e,t){try{var a=i(61701),n=(i(19083),i(71695),i(61893),i(9359),i(56475),i(31526),i(70104),i(92519),i(42179),i(89256),i(24931),i(88463),i(57449),i(19814),i(61006),i(47021),i(2060),i(57243)),s=i(50778),l=i(91583),o=i(27486),r=i(36522),d=i(1416),c=i(57816),h=i(28008),u=i(33067),p=(i(41307),i(48103),i(4398),i(73850)),f=e([u]);u=(f.then?(await f)():f)[0];let m,b,g,_,v,y=e=>e;const k="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";(0,a.Z)([(0,s.Mo)("ha-filter-domains")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"value",value:void 0},{kind:"field",decorators:[(0,s.Cb)({type:Boolean})],key:"narrow",value(){return!1}},{kind:"field",decorators:[(0,s.Cb)({type:Boolean,reflect:!0})],key:"expanded",value(){return!1}},{kind:"field",decorators:[(0,s.SB)()],key:"_shouldRender",value(){return!1}},{kind:"field",decorators:[(0,s.SB)()],key:"_filter",value:void 0},{kind:"method",key:"render",value:function(){var e,t;return(0,n.dy)(m||(m=y` <ha-expansion-panel left-chevron .expanded="${0}" @expanded-will-change="${0}" @expanded-changed="${0}"> <div slot="header" class="header"> ${0} ${0} </div> ${0} </ha-expansion-panel> `),this.expanded,this._expandedWillChange,this._expandedChanged,this.hass.localize("ui.panel.config.entities.picker.headers.domain"),null!==(e=this.value)&&void 0!==e&&e.length?(0,n.dy)(b||(b=y`<div class="badge">${0}</div> <ha-icon-button .path="${0}" @click="${0}"></ha-icon-button>`),null===(t=this.value)||void 0===t?void 0:t.length,k,this._clearFilter):n.Ld,this._shouldRender?(0,n.dy)(g||(g=y`<search-input-outlined .hass="${0}" .filter="${0}" @value-changed="${0}"> </search-input-outlined> <mwc-list class="ha-scrollbar" @click="${0}" multi> ${0} </mwc-list> `),this.hass,this._filter,this._handleSearchChange,this._handleItemClick,(0,l.r)(this._domains(this.hass.states,this._filter),(e=>e),(e=>(0,n.dy)(_||(_=y`<ha-check-list-item .value="${0}" .selected="${0}" graphic="icon"> <ha-domain-icon slot="graphic" .hass="${0}" .domain="${0}" brand-fallback></ha-domain-icon> ${0} </ha-check-list-item>`),e,(this.value||[]).includes(e),this.hass,e,(0,c.Lh)(this.hass.localize,e))))):n.Ld)}},{kind:"field",key:"_domains",value(){return(0,o.Z)(((e,t)=>{const i=new Set;return Object.keys(e).forEach((e=>{i.add((0,p.M)(e))})),Array.from(i.values()).map((e=>({domain:e,name:(0,c.Lh)(this.hass.localize,e)}))).filter((e=>!t||e.domain.toLowerCase().includes(t)||e.name.toLowerCase().includes(t))).sort(((e,t)=>(0,d.$K)(e.name,t.name,this.hass.locale.language))).map((e=>e.domain))}))}},{kind:"method",key:"updated",value:function(e){e.has("expanded")&&this.expanded&&setTimeout((()=>{this.expanded&&(this.renderRoot.querySelector("mwc-list").style.height=this.clientHeight-49-32+"px")}),300)}},{kind:"method",key:"_expandedWillChange",value:function(e){this._shouldRender=e.detail.expanded}},{kind:"method",key:"_expandedChanged",value:function(e){this.expanded=e.detail.expanded}},{kind:"method",key:"_handleItemClick",value:function(e){var t;const i=e.target.closest("ha-check-list-item"),a=null==i?void 0:i.value;if(a){var n;if(null!==(t=this.value)&&void 0!==t&&t.includes(a))this.value=null===(n=this.value)||void 0===n?void 0:n.filter((e=>e!==a));else this.value=[...this.value||[],a];i.selected=this.value.includes(a),(0,r.B)(this,"data-table-filter-changed",{value:this.value,items:void 0})}}},{kind:"method",key:"_clearFilter",value:function(e){e.preventDefault(),this.value=void 0,(0,r.B)(this,"data-table-filter-changed",{value:void 0,items:void 0})}},{kind:"method",key:"_handleSearchChange",value:function(e){this._filter=e.detail.value.toLowerCase()}},{kind:"get",static:!0,key:"styles",value:function(){return[h.$c,(0,n.iv)(v||(v=y`:host{border-bottom:1px solid var(--divider-color)}:host([expanded]){flex:1;height:0}ha-expansion-panel{--ha-card-border-radius:0;--expansion-panel-content-padding:0}.header{display:flex;align-items:center}.header ha-icon-button{margin-inline-start:initial;margin-inline-end:8px}.badge{display:inline-block;margin-left:8px;margin-inline-start:8px;margin-inline-end:initial;min-width:16px;box-sizing:border-box;border-radius:50%;font-weight:400;font-size:11px;background-color:var(--primary-color);line-height:16px;text-align:center;padding:0px 2px;color:var(--text-primary-color)}search-input-outlined{display:block;padding:0 8px}`))]}}]}}),n.oi);t()}catch(m){t(m)}}))},18216:function(e,t,i){i.d(t,{G1:()=>n,Rm:()=>s,W2:()=>a,YL:()=>l});i(19423);const a=e=>e.callWS({type:"counter/list"}),n=(e,t)=>e.callWS(Object.assign({type:"counter/create"},t)),s=(e,t,i)=>e.callWS(Object.assign({type:"counter/update",counter_id:t},i)),l=(e,t)=>e.callWS({type:"counter/delete",counter_id:t})},62992:function(e,t,i){i.d(t,{m:()=>s});i(71695),i(40251),i(47021);const a=async(e,t,i,n,s,...l)=>{const o=s,r=o[e],d=r=>n&&n(s,r.result)!==r.cacheKey?(o[e]=void 0,a(e,t,i,n,s,...l)):r.result;if(r)return r instanceof Promise?r.then(d):d(r);const c=i(s,...l);return o[e]=c,c.then((i=>{o[e]={result:i,cacheKey:null==n?void 0:n(s,i)},setTimeout((()=>{o[e]=void 0}),t)}),(()=>{o[e]=void 0})),c},n=e=>e.callWS({type:"entity/source"}),s=e=>a("_entitySources",3e4,n,(e=>Object.keys(e.states).length),e)},22431:function(e,t,i){i.d(t,{E:()=>u});var a=i(18216),n=i(9343),s=i(6819),l=i(25542),o=i(57800),r=i(67759),d=i(52261),c=i(76154),h=i(84428);const u={input_boolean:{fetch:n.Aj,update:n.Xr,delete:n.wO},input_button:{fetch:s.fY,update:s.Wq,delete:s.Wx},input_text:{fetch:d.YL,update:d.jt,delete:d.KB},input_number:{fetch:o.K4,update:o.hb,delete:o.fH},input_datetime:{fetch:l.s2,update:l.FF,delete:l.Gi},input_select:{fetch:r.LN,update:r.ON,delete:r.H3},counter:{fetch:a.W2,update:a.Rm,delete:a.YL},timer:{fetch:h.aT,update:h.mZ,delete:h.WH},schedule:{fetch:c.fn,update:c.Fv,delete:c.wn}}},9343:function(e,t,i){i.d(t,{Aj:()=>a,Xr:()=>s,Z0:()=>n,wO:()=>l});i(19423);const a=e=>e.callWS({type:"input_boolean/list"}),n=(e,t)=>e.callWS(Object.assign({type:"input_boolean/create"},t)),s=(e,t,i)=>e.callWS(Object.assign({type:"input_boolean/update",input_boolean_id:t},i)),l=(e,t)=>e.callWS({type:"input_boolean/delete",input_boolean_id:t})},6819:function(e,t,i){i.d(t,{Sv:()=>n,Wq:()=>s,Wx:()=>l,fY:()=>a});i(19423);const a=e=>e.callWS({type:"input_button/list"}),n=(e,t)=>e.callWS(Object.assign({type:"input_button/create"},t)),s=(e,t,i)=>e.callWS(Object.assign({type:"input_button/update",input_button_id:t},i)),l=(e,t)=>e.callWS({type:"input_button/delete",input_button_id:t})},25542:function(e,t,i){i.d(t,{FF:()=>o,Gi:()=>r,Qp:()=>n,g2:()=>a,s2:()=>s,vY:()=>l});i(19423);const a=e=>`${e.attributes.year||"1970"}-${String(e.attributes.month||"01").padStart(2,"0")}-${String(e.attributes.day||"01").padStart(2,"0")}T${String(e.attributes.hour||"00").padStart(2,"0")}:${String(e.attributes.minute||"00").padStart(2,"0")}:${String(e.attributes.second||"00").padStart(2,"0")}`,n=(e,t,i=void 0,a=void 0)=>{const n={entity_id:t,time:i,date:a};e.callService("input_datetime","set_datetime",n)},s=e=>e.callWS({type:"input_datetime/list"}),l=(e,t)=>e.callWS(Object.assign({type:"input_datetime/create"},t)),o=(e,t,i)=>e.callWS(Object.assign({type:"input_datetime/update",input_datetime_id:t},i)),r=(e,t)=>e.callWS({type:"input_datetime/delete",input_datetime_id:t})},57800:function(e,t,i){i.d(t,{K4:()=>a,Mt:()=>n,fH:()=>l,hb:()=>s});i(19423);const a=e=>e.callWS({type:"input_number/list"}),n=(e,t)=>e.callWS(Object.assign({type:"input_number/create"},t)),s=(e,t,i)=>e.callWS(Object.assign({type:"input_number/update",input_number_id:t},i)),l=(e,t)=>e.callWS({type:"input_number/delete",input_number_id:t})},67759:function(e,t,i){i.d(t,{Ek:()=>s,H3:()=>o,LN:()=>n,ON:()=>l,cv:()=>a});i(19423);const a=(e,t,i)=>e.callService("input_select","select_option",{option:i,entity_id:t}),n=e=>e.callWS({type:"input_select/list"}),s=(e,t)=>e.callWS(Object.assign({type:"input_select/create"},t)),l=(e,t,i)=>e.callWS(Object.assign({type:"input_select/update",input_select_id:t},i)),o=(e,t)=>e.callWS({type:"input_select/delete",input_select_id:t})},52261:function(e,t,i){i.d(t,{$t:()=>s,KB:()=>o,YL:()=>n,jt:()=>l,sO:()=>a});i(19423);const a=(e,t,i)=>e.callService(t.split(".",1)[0],"set_value",{value:i,entity_id:t}),n=e=>e.callWS({type:"input_text/list"}),s=(e,t)=>e.callWS(Object.assign({type:"input_text/create"},t)),l=(e,t,i)=>e.callWS(Object.assign({type:"input_text/update",input_text_id:t},i)),o=(e,t)=>e.callWS({type:"input_text/delete",input_text_id:t})},76154:function(e,t,i){i.d(t,{AS:()=>s,Fv:()=>l,KY:()=>a,fn:()=>n,wn:()=>o});i(19423);const a=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],n=e=>e.callWS({type:"schedule/list"}),s=(e,t)=>e.callWS(Object.assign({type:"schedule/create"},t)),l=(e,t,i)=>e.callWS(Object.assign({type:"schedule/update",schedule_id:t},i)),o=(e,t)=>e.callWS({type:"schedule/delete",schedule_id:t})},84428:function(e,t,i){i.d(t,{rv:()=>d,mK:()=>r,aT:()=>n,mZ:()=>l,eF:()=>s,WH:()=>o});i(19423),i(9359),i(70104);var a=i(43537);const n=e=>e.callWS({type:"timer/list"}),s=(e,t)=>e.callWS(Object.assign({type:"timer/create"},t)),l=(e,t,i)=>e.callWS(Object.assign({type:"timer/update",timer_id:t},i)),o=(e,t)=>e.callWS({type:"timer/delete",timer_id:t}),r=e=>{if(!e.attributes.remaining)return;let t=function(e){const t=e.split(":").map(Number);return 3600*t[0]+60*t[1]+t[2]}(e.attributes.remaining);if("active"===e.state){const i=(new Date).getTime(),a=new Date(e.attributes.finishes_at).getTime();t=Math.max((a-i)/1e3,0)}return t},d=(e,t,i)=>{if(!t)return null;if("idle"===t.state||0===i)return e.formatEntityState(t);let n=(0,a.Z)(i||0)||"0";return"paused"===t.state&&(n=`${n} (${e.formatEntityState(t)})`),n}},12939:function(e,t,i){i.d(t,{A:()=>n});var a=i(36522);const n=(e,t)=>(0,a.B)(e,"hass-more-info",t)},75375:function(e,t,i){i.a(e,(async function(e,a){try{i.r(t);var n=i(61701),s=(i(71695),i(47021),i(57243)),l=i(50778),o=i(17170),r=(i(54202),i(43344),i(28008)),d=e([o]);o=(d.then?(await d)():d)[0];let c,h,u,p,f,m,b=e=>e;(0,n.Z)([(0,l.Mo)("hass-loading-screen")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,l.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,l.Cb)({type:Boolean,attribute:"no-toolbar"})],key:"noToolbar",value(){return!1}},{kind:"field",decorators:[(0,l.Cb)({type:Boolean})],key:"rootnav",value(){return!1}},{kind:"field",decorators:[(0,l.Cb)({type:Boolean})],key:"narrow",value(){return!1}},{kind:"field",decorators:[(0,l.Cb)()],key:"message",value:void 0},{kind:"method",key:"render",value:function(){var e;return(0,s.dy)(c||(c=b` ${0} <div class="content"> <ha-spinner></ha-spinner> ${0} </div> `),this.noToolbar?"":(0,s.dy)(h||(h=b`<div class="toolbar"> ${0} </div>`),this.rootnav||null!==(e=history.state)&&void 0!==e&&e.root?(0,s.dy)(u||(u=b` <ha-menu-button .hass="${0}" .narrow="${0}"></ha-menu-button> `),this.hass,this.narrow):(0,s.dy)(p||(p=b` <ha-icon-button-arrow-prev .hass="${0}" @click="${0}"></ha-icon-button-arrow-prev> `),this.hass,this._handleBack)),this.message?(0,s.dy)(f||(f=b`<div id="loading-text">${0}</div>`),this.message):s.Ld)}},{kind:"method",key:"_handleBack",value:function(){history.back()}},{kind:"get",static:!0,key:"styles",value:function(){return[r.Qx,(0,s.iv)(m||(m=b`:host{display:block;height:100%;background-color:var(--primary-background-color)}.toolbar{display:flex;align-items:center;font-size:20px;height:var(--header-height);padding:8px 12px;pointer-events:none;background-color:var(--app-header-background-color);font-weight:400;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}`))]}}]}}),s.oi);a()}catch(c){a(c)}}))},89783:function(e,t,i){i.a(e,(async function(e,a){try{i.r(t),i.d(t,{HaConfigEntities:()=>xe});var n=i(61701),s=i(72621),l=(i(19083),i(71695),i(92745),i(9359),i(68107),i(56475),i(1331),i(31526),i(70104),i(52924),i(19423),i(40251),i(18917),i(19134),i(11740),i(92519),i(42179),i(89256),i(24931),i(88463),i(57449),i(19814),i(61006),i(47706),i(47021),i(71513),i(75656),i(50100),i(18084),i(60738)),o=i(57243),r=i(50778),d=i(20552),c=i(69634),h=i(27486),u=i(75011),p=i(64214),f=i(68958),m=i(73850),b=i(27015),g=i(96530),_=i(22431),v=i(47194),y=i(46355),k=i(35076),x=(i(10504),i(99426),i(34273),i(48103),i(51868),i(76268),i(72807)),$=(i(43082),i(87315)),C=(i(86735),i(9425),i(65981),i(23334),i(7843),i(4573),i(37583),i(56032)),w=i(75101),S=i(30635),L=i(96194),A=i(63318),M=i(57816),z=i(62992),E=i(63860),H=i(76131),W=i(12939),j=i(75375),O=i(38419),B=i(6736),F=i(28008),Z=i(82967),V=(i(44536),i(84361)),T=i(26345),D=e([x,$,C,j,O,p]);[x,$,C,j,O,p]=D.then?(await D)():D;let P,N,I,R,U,K,G,q,Y,X,Q,J,ee,te,ie,ae,ne,se,le,oe,re=e=>e;const de="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",ce="M12 2C17.5 2 22 6.5 22 12S17.5 22 12 22 2 17.5 2 12 6.5 2 12 2M12 4C10.1 4 8.4 4.6 7.1 5.7L18.3 16.9C19.3 15.5 20 13.8 20 12C20 7.6 16.4 4 12 4M16.9 18.3L5.7 7.1C4.6 8.4 4 10.1 4 12C4 16.4 7.6 20 12 20C13.9 20 15.6 19.4 16.9 18.3Z",he="M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z",ue="M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z",pe="M12,16A2,2 0 0,1 14,18A2,2 0 0,1 12,20A2,2 0 0,1 10,18A2,2 0 0,1 12,16M12,10A2,2 0 0,1 14,12A2,2 0 0,1 12,14A2,2 0 0,1 10,12A2,2 0 0,1 12,10M12,4A2,2 0 0,1 14,6A2,2 0 0,1 12,8A2,2 0 0,1 10,6A2,2 0 0,1 12,4Z",fe="M12,9A3,3 0 0,0 9,12A3,3 0 0,0 12,15A3,3 0 0,0 15,12A3,3 0 0,0 12,9M12,17A5,5 0 0,1 7,12A5,5 0 0,1 12,7A5,5 0 0,1 17,12A5,5 0 0,1 12,17M12,4.5C7,4.5 2.73,7.61 1,12C2.73,16.39 7,19.5 12,19.5C17,19.5 21.27,16.39 23,12C21.27,7.61 17,4.5 12,4.5Z",me="M11.83,9L15,12.16C15,12.11 15,12.05 15,12A3,3 0 0,0 12,9C11.94,9 11.89,9 11.83,9M7.53,9.8L9.08,11.35C9.03,11.56 9,11.77 9,12A3,3 0 0,0 12,15C12.22,15 12.44,14.97 12.65,14.92L14.2,16.47C13.53,16.8 12.79,17 12,17A5,5 0 0,1 7,12C7,11.21 7.2,10.47 7.53,9.8M2,4.27L4.28,6.55L4.73,7C3.08,8.3 1.78,10 1,12C2.73,16.39 7,19.5 12,19.5C13.55,19.5 15.03,19.2 16.38,18.66L16.81,19.08L19.73,22L21,20.73L3.27,3M12,7A5,5 0 0,1 17,12C17,12.64 16.87,13.26 16.64,13.82L19.57,16.75C21.07,15.5 22.27,13.86 23,12C21.27,7.61 17,4.5 12,4.5C10.6,4.5 9.26,4.75 8,5.2L10.17,7.35C10.74,7.13 11.35,7 12,7Z",be="M7,10L12,15L17,10H7Z",ge="M18.66,2C18.4,2 18.16,2.09 17.97,2.28L16.13,4.13L19.88,7.88L21.72,6.03C22.11,5.64 22.11,5 21.72,4.63L19.38,2.28C19.18,2.09 18.91,2 18.66,2M3.28,4L2,5.28L8.5,11.75L4,16.25V20H7.75L12.25,15.5L18.72,22L20,20.72L13.5,14.25L9.75,10.5L3.28,4M15.06,5.19L11.03,9.22L14.78,12.97L18.81,8.94L15.06,5.19Z",_e="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z",ve="M13 3C8 3 4 7 4 12H1L4.9 15.9L5 16L9 12H6C6 8.1 9.1 5 13 5S20 8.1 20 12 16.9 19 13 19C11.1 19 9.3 18.2 8.1 16.9L6.7 18.3C8.3 20 10.5 21 13 21C18 21 22 17 22 12S18 3 13 3M12 15H14V17H12V15M12 7H14V13H12V7",ye="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",ke="M17 6H7c-3.31 0-6 2.69-6 6s2.69 6 6 6h10c3.31 0 6-2.69 6-6s-2.69-6-6-6zm0 10H7c-2.21 0-4-1.79-4-4s1.79-4 4-4h10c2.21 0 4 1.79 4 4s-1.79 4-4 4zM7 9c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z";let xe=(0,n.Z)([(0,r.Mo)("ha-config-entities")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,r.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,r.Cb)({attribute:"is-wide",type:Boolean})],key:"isWide",value(){return!1}},{kind:"field",decorators:[(0,r.Cb)({type:Boolean})],key:"narrow",value(){return!1}},{kind:"field",decorators:[(0,r.Cb)({attribute:!1})],key:"route",value:void 0},{kind:"field",decorators:[(0,r.SB)()],key:"_stateEntities",value(){return[]}},{kind:"field",decorators:[(0,r.SB)()],key:"_entries",value:void 0},{kind:"field",decorators:[(0,r.SB)()],key:"_subEntries",value:void 0},{kind:"field",decorators:[(0,r.SB)()],key:"_manifests",value:void 0},{kind:"field",decorators:[(0,r.SB)(),(0,l.F_)({context:S.we,subscribe:!0})],key:"_entities",value:void 0},{kind:"field",decorators:[(0,f.t)({storage:"sessionStorage",key:"entities-table-search",state:!0,subscribe:!1})],key:"_filter",value(){var e;return(null===(e=history.state)||void 0===e?void 0:e.filter)||""}},{kind:"field",decorators:[(0,r.SB)()],key:"_searchParms",value(){return new URLSearchParams(window.location.search)}},{kind:"field",decorators:[(0,f.t)({storage:"sessionStorage",key:"entities-table-filters",state:!0,subscribe:!1})],key:"_filters",value(){return{}}},{kind:"field",decorators:[(0,r.SB)()],key:"_filteredItems",value(){return{}}},{kind:"field",decorators:[(0,r.SB)()],key:"_selected",value(){return[]}},{kind:"field",decorators:[(0,r.SB)()],key:"_expandedFilter",value:void 0},{kind:"field",decorators:[(0,r.SB)()],key:"_labels",value:void 0},{kind:"field",decorators:[(0,r.SB)()],key:"_entitySources",value:void 0},{kind:"field",decorators:[(0,f.t)({key:"entities-table-sort",state:!1,subscribe:!1})],key:"_activeSorting",value:void 0},{kind:"field",decorators:[(0,f.t)({key:"entities-table-grouping",state:!1,subscribe:!1})],key:"_activeGrouping",value:void 0},{kind:"field",decorators:[(0,f.t)({key:"entities-table-collapsed",state:!1,subscribe:!1})],key:"_activeCollapsed",value:void 0},{kind:"field",decorators:[(0,f.t)({key:"entities-table-column-order",state:!1,subscribe:!1})],key:"_activeColumnOrder",value:void 0},{kind:"field",decorators:[(0,f.t)({key:"entities-table-hidden-columns",state:!1,subscribe:!1})],key:"_activeHiddenColumns",value:void 0},{kind:"field",decorators:[(0,r.IO)("hass-tabs-subpage-data-table",!0)],key:"_dataTable",value:void 0},{kind:"method",key:"connectedCallback",value:function(){(0,s.Z)(i,"connectedCallback",this,3)([]),window.addEventListener("location-changed",this._locationChanged),window.addEventListener("popstate",this._popState)}},{kind:"method",key:"disconnectedCallback",value:function(){(0,s.Z)(i,"disconnectedCallback",this,3)([]),window.removeEventListener("location-changed",this._locationChanged),window.removeEventListener("popstate",this._popState)}},{kind:"field",key:"_locationChanged",value(){return()=>{window.location.search.substring(1)!==this._searchParms.toString()&&(this._searchParms=new URLSearchParams(window.location.search),this._setFiltersFromUrl())}}},{kind:"field",key:"_popState",value(){return()=>{window.location.search.substring(1)!==this._searchParms.toString()&&(this._searchParms=new URLSearchParams(window.location.search),this._setFiltersFromUrl())}}},{kind:"field",key:"_states",value(){return(0,h.Z)((e=>[{value:"available",label:e("ui.panel.config.entities.picker.status.available")},{value:"unavailable",label:e("ui.panel.config.entities.picker.status.unavailable")},{value:"enabled",label:e("ui.panel.config.entities.picker.status.enabled")},{value:"disabled",label:e("ui.panel.config.entities.picker.status.disabled")},{value:"visible",label:e("ui.panel.config.entities.picker.status.visible")},{value:"hidden",label:e("ui.panel.config.entities.picker.status.hidden")},{value:"readonly",label:e("ui.panel.config.entities.picker.status.unmanageable")},{value:"restored",label:e("ui.panel.config.entities.picker.status.not_provided")}]))}},{kind:"field",key:"_columns",value(){return(0,h.Z)((e=>({icon:{title:"",label:e("ui.panel.config.entities.picker.headers.state_icon"),type:"icon",showNarrow:!0,moveable:!1,template:e=>e.icon?(0,o.dy)(P||(P=re`<ha-icon .icon="${0}"></ha-icon>`),e.icon):e.entity?(0,o.dy)(N||(N=re` <ha-state-icon title="${0}" slot="item-icon" .hass="${0}" .stateObj="${0}"></ha-state-icon> `),(0,d.o)(e.entity?this.hass.formatEntityState(e.entity):void 0),this.hass,e.entity):(0,o.dy)(I||(I=re`<ha-domain-icon .domain="${0}"></ha-domain-icon>`),(0,m.M)(e.entity_id))},name:{main:!0,title:e("ui.panel.config.entities.picker.headers.name"),sortable:!0,filterable:!0,direction:"asc",flex:2,extraTemplate:e=>e.label_entries.length?(0,o.dy)(R||(R=re` <ha-data-table-labels .labels="${0}"></ha-data-table-labels> `),e.label_entries):o.Ld},entity_id:{title:e("ui.panel.config.entities.picker.headers.entity_id"),sortable:!0,filterable:!0},localized_platform:{title:e("ui.panel.config.entities.picker.headers.integration"),sortable:!0,groupable:!0,filterable:!0},domain:{title:e("ui.panel.config.entities.picker.headers.domain"),sortable:!1,hidden:!0,filterable:!0,groupable:!0},area:{title:e("ui.panel.config.entities.picker.headers.area"),sortable:!0,filterable:!0,groupable:!0},disabled_by:{title:e("ui.panel.config.entities.picker.headers.disabled_by"),hidden:!0,filterable:!0,template:e=>null===e.disabled_by?"":this.hass.localize(`config_entry.disabled_by.${e.disabled_by}`)},status:{title:e("ui.panel.config.entities.picker.headers.status"),type:"icon",showNarrow:!0,sortable:!0,filterable:!0,minWidth:"80px",maxWidth:"80px",template:e=>e.unavailable||e.disabled_by||e.hidden_by||e.readonly?(0,o.dy)(U||(U=re` <div tabindex="0" style="display:inline-block;position:relative"> <ha-tooltip placement="left" .content="${0}"> <ha-svg-icon style="${0}" .path="${0}"></ha-svg-icon> </ha-tooltip> </div> `),e.restored?this.hass.localize("ui.panel.config.entities.picker.status.not_provided"):e.unavailable?this.hass.localize("ui.panel.config.entities.picker.status.unavailable"):e.disabled_by?this.hass.localize("ui.panel.config.entities.picker.status.disabled"):e.hidden_by?this.hass.localize("ui.panel.config.entities.picker.status.hidden"):this.hass.localize("ui.panel.config.entities.picker.status.unmanageable"),(0,c.V)({color:e.unavailable?"var(--error-color)":""}),e.restored?ve:e.unavailable?de:e.disabled_by?ce:e.hidden_by?me:ge):"—"},created_at:{title:e("ui.panel.config.generic.headers.created_at"),defaultHidden:!0,sortable:!0,minWidth:"128px",template:e=>e.created_at?(0,p.Fu)(new Date(1e3*e.created_at),this.hass.locale,this.hass.config):"—"},modified_at:{title:e("ui.panel.config.generic.headers.modified_at"),defaultHidden:!0,sortable:!0,minWidth:"128px",template:e=>e.modified_at?(0,p.Fu)(new Date(1e3*e.modified_at),this.hass.locale,this.hass.config):"—"},available:{title:e("ui.panel.config.entities.picker.headers.availability"),sortable:!0,groupable:!0,hidden:!0},visible:{title:e("ui.panel.config.entities.picker.headers.visibility"),sortable:!0,groupable:!0,hidden:!0},enabled:{title:e("ui.panel.config.entities.picker.headers.enabled"),sortable:!0,groupable:!0,hidden:!0},labels:{title:"",hidden:!0,filterable:!0,template:e=>e.label_entries.map((e=>e.name)).join(" ")}})))}},{kind:"field",key:"_filteredEntitiesAndDomains",value(){return(0,h.Z)(((e,t,i,a,n,s,l,o,r)=>{const d=[],c=s["ha-filter-states"],h=!(null!=c&&c.length)||c.includes("enabled"),u=!(null!=c&&c.length)||c.includes("disabled"),p=!(null!=c&&c.length)||c.includes("visible"),f=!(null!=c&&c.length)||c.includes("hidden"),b=!(null!=c&&c.length)||c.includes("available"),g=!(null!=c&&c.length)||c.includes("unavailable"),_=!(null!=c&&c.length)||c.includes("restored"),v=!(null!=c&&c.length)||c.includes("readonly");let y,k=t.concat(n);const x=new Set;Object.entries(s).forEach((([e,t])=>{if("config_entry"===e&&Array.isArray(t)&&t.length){if(k=k.filter((e=>e.config_entry_id&&t.includes(e.config_entry_id))),!o)return void this._loadConfigEntries();const e=o.filter((e=>e.entry_id&&t.includes(e.entry_id)));e.forEach((e=>{x.add(e.domain)})),1===e.length&&(y=e[0])}else if("sub_entry"===e&&Array.isArray(t)&&t.length){if(!Array.isArray(this._filters.config_entry)||1!==this._filters.config_entry.length)return;k=k.filter((e=>e.config_subentry_id&&t.includes(e.config_subentry_id))),this._subEntries||this._loadSubEntries(this._filters.config_entry[0])}else if("ha-filter-integrations"===e&&Array.isArray(t)&&t.length){if(!o)return void this._loadConfigEntries();const e=o.filter((e=>t.includes(e.domain))).map((e=>e.entry_id)),i=new Set,a=this._entitySources||{},n={};for(const[t,s]of Object.entries(a))s.domain in n||(n[s.domain]=[]),n[s.domain].push(t);for(const s of t)s in n&&n[s].forEach((e=>i.add(e)));k=k.filter((a=>i.has(a.entity_id)||t.includes(a.platform)||a.config_entry_id&&e.includes(a.config_entry_id))),t.forEach((e=>x.add(e)))}else"ha-filter-domains"===e&&Array.isArray(t)&&t.length?k=k.filter((e=>t.includes((0,m.M)(e.entity_id)))):"ha-filter-labels"===e&&Array.isArray(t)&&t.length&&(k=k.filter((e=>e.labels.some((e=>t.includes(e))))))})),Object.values(l).forEach((e=>{e&&(k=k.filter((t=>e.has(t.entity_id))))}));for(const w of k){var $,C;const t=this.hass.states[w.entity_id],n=(null==t?void 0:t.state)===L.nZ,s=!0===(null==t?void 0:t.attributes.restored),l=null!==($=w.area_id)&&void 0!==$?$:null===(C=i[w.device_id])||void 0===C?void 0:C.area_id,o=l?a[l]:void 0,c=!!w.hidden_by,y=!!w.disabled_by,k=w.readonly,x=(null==t?void 0:t.state)&&t.state!==L.nZ;if(!(b&&x||g&&n||_&&s||p&&!c||f&&c||u&&y||h&&!y||v&&k))continue;const S=(r&&(null==w?void 0:w.labels)||[]).map((e=>r.find((t=>t.label_id===e))));d.push(Object.assign(Object.assign({},w),{},{entity:t,name:(0,A.vA)(this.hass,w),unavailable:n,restored:s,localized_platform:(0,M.Lh)(e,w.platform),area:o?o.name:"—",domain:(0,M.Lh)(e,(0,m.M)(w.entity_id)),status:e(s?"ui.panel.config.entities.picker.status.not_provided":n?"ui.panel.config.entities.picker.status.unavailable":y?"ui.panel.config.entities.picker.status.disabled":c?"ui.panel.config.entities.picker.status.hidden":k?"ui.panel.config.entities.picker.status.unmanageable":"ui.panel.config.entities.picker.status.available"),label_entries:S,available:e(n?"ui.panel.config.entities.picker.status.unavailable":"ui.panel.config.entities.picker.status.available"),enabled:e(y?"ui.panel.config.entities.picker.status.disabled":"ui.panel.config.entities.picker.status.enabled"),visible:e(c?"ui.panel.config.entities.picker.status.hidden":"ui.panel.config.entities.picker.status.visible")}))}return{filteredEntities:d,filteredConfigEntry:y,filteredDomains:x}}))}},{kind:"method",key:"hassSubscribe",value:function(){return[(0,E.f4)(this.hass.connection,(e=>{this._labels=e}))]}},{kind:"method",key:"render",value:function(){var e,t,i;if(!this.hass||void 0===this._entities)return(0,o.dy)(K||(K=re` <hass-loading-screen></hass-loading-screen> `));const{filteredEntities:a,filteredDomains:n}=this._filteredEntitiesAndDomains(this.hass.localize,this._entities,this.hass.devices,this.hass.areas,this._stateEntities,this._filters,this._filteredItems,this._entries,this._labels),s=1===n.size&&y.S.includes([...n][0]),l=(0,o.dy)(G||(G=re` ${0} <ha-md-divider role="separator" tabindex="-1"></ha-md-divider> <ha-md-menu-item .clickAction="${0}"> <div slot="headline"> ${0} </div></ha-md-menu-item>`),null===(e=this._labels)||void 0===e?void 0:e.map((e=>{const t=e.color?(0,u.I)(e.color):void 0,i=this._selected.every((t=>{var i;return null===(i=this.hass.entities[t])||void 0===i?void 0:i.labels.includes(e.label_id)})),a=!i&&this._selected.some((t=>{var i;return null===(i=this.hass.entities[t])||void 0===i?void 0:i.labels.includes(e.label_id)}));return(0,o.dy)(q||(q=re`<ha-md-menu-item .value="${0}" .action="${0}" @click="${0}" keep-open> <ha-checkbox slot="start" .checked="${0}" .indeterminate="${0}" reducedTouchTarget></ha-checkbox> <ha-label style="${0}"> ${0} ${0} </ha-label> </ha-md-menu-item>`),e.label_id,i?"remove":"add",this._handleBulkLabel,i,a,t?`--color: ${t}`:"",e.icon?(0,o.dy)(Y||(Y=re`<ha-icon slot="icon" .icon="${0}"></ha-icon>`),e.icon):o.Ld,e.name)})),this._bulkCreateLabel,this.hass.localize("ui.panel.config.labels.add_label"));return(0,o.dy)(X||(X=re` <hass-tabs-subpage-data-table .hass="${0}" .narrow="${0}" .backPath="${0}" .route="${0}" .tabs="${0}" .columns="${0}" .data="${0}" .searchLabel="${0}" has-filters .filters="${0}" selectable .selected="${0}" .initialGroupColumn="${0}" .initialCollapsedGroups="${0}" .initialSorting="${0}" .columnOrder="${0}" .hiddenColumns="${0}" @columns-changed="${0}" @sorting-changed="${0}" @grouping-changed="${0}" @collapsed-changed="${0}" @selection-changed="${0}" clickable @clear-filter="${0}" .filter="${0}" @search-changed="${0}" @row-click="${0}" id="entity_id" .hasFab="${0}" class="${0}"> <ha-integration-overflow-menu .hass="${0}" slot="toolbar-icon"></ha-integration-overflow-menu> ${0} <ha-md-button-menu has-overflow slot="selection-bar"> ${0} <ha-svg-icon slot="trailing-icon" .path="${0}"></ha-svg-icon> ${0} <ha-md-menu-item .clickAction="${0}"> <ha-svg-icon slot="start" .path="${0}"></ha-svg-icon> <div slot="headline"> ${0} </div> </ha-md-menu-item> <ha-md-menu-item .clickAction="${0}"> <ha-svg-icon slot="start" .path="${0}"></ha-svg-icon> <div slot="headline"> ${0} </div> </ha-md-menu-item> <ha-md-divider role="separator" tabindex="-1"></ha-md-divider> <ha-md-menu-item .clickAction="${0}"> <ha-svg-icon slot="start" .path="${0}"></ha-svg-icon> <div slot="headline"> ${0} </div> </ha-md-menu-item> <ha-md-menu-item .clickAction="${0}"> <ha-svg-icon slot="start" .path="${0}"></ha-svg-icon> <div slot="headline"> ${0} </div> </ha-md-menu-item> <ha-md-divider role="separator" tabindex="-1"></ha-md-divider> <ha-md-menu-item .clickAction="${0}" class="warning"> <ha-svg-icon slot="start" .path="${0}"></ha-svg-icon> <div slot="headline"> ${0} </div> </ha-md-menu-item> </ha-md-button-menu> ${0} <ha-filter-floor-areas .hass="${0}" type="entity" .value="${0}" @data-table-filter-changed="${0}" slot="filter-pane" .expanded="${0}" .narrow="${0}" @expanded-changed="${0}"></ha-filter-floor-areas> <ha-filter-devices .hass="${0}" .type="${0}" .value="${0}" @data-table-filter-changed="${0}" slot="filter-pane" .expanded="${0}" .narrow="${0}" @expanded-changed="${0}"></ha-filter-devices> <ha-filter-domains .hass="${0}" .value="${0}" @data-table-filter-changed="${0}" slot="filter-pane" .expanded="${0}" .narrow="${0}" @expanded-changed="${0}"></ha-filter-domains> <ha-filter-integrations .hass="${0}" .value="${0}" @data-table-filter-changed="${0}" slot="filter-pane" .expanded="${0}" .narrow="${0}" @expanded-changed="${0}"></ha-filter-integrations> <ha-filter-states .hass="${0}" .label="${0}" .value="${0}" .states="${0}" @data-table-filter-changed="${0}" slot="filter-pane" .expanded="${0}" .narrow="${0}" @expanded-changed="${0}"></ha-filter-states> <ha-filter-labels .hass="${0}" .value="${0}" @data-table-filter-changed="${0}" slot="filter-pane" .expanded="${0}" .narrow="${0}" @expanded-changed="${0}"></ha-filter-labels> ${0} </hass-tabs-subpage-data-table> `),this.hass,this.narrow,this._searchParms.has("historyBack")?void 0:"/config",this.route,Z.configSections.devices,this._columns(this.hass.localize),a,this.hass.localize("ui.panel.config.entities.picker.search",{number:a.length}),Object.values(this._filters).filter((e=>Array.isArray(e)?e.length:e&&Object.values(e).some((e=>Array.isArray(e)?e.length:e)))).length,this._selected.length,this._activeGrouping,this._activeCollapsed,this._activeSorting,this._activeColumnOrder,this._activeHiddenColumns,this._handleColumnsChanged,this._handleSortingChanged,this._handleGroupingChanged,this._handleCollapseChanged,this._handleSelectionChanged,this._clearFilter,this._filter,this._handleSearchChange,this._openEditEntry,s,this.narrow?"narrow":"",this.hass,this.narrow?o.Ld:(0,o.dy)(Q||(Q=re`<ha-md-button-menu slot="selection-bar"> <ha-assist-chip slot="trigger" .label="${0}"> <ha-svg-icon slot="trailing-icon" .path="${0}"></ha-svg-icon> </ha-assist-chip> ${0} </ha-md-button-menu>`),this.hass.localize("ui.panel.config.automation.picker.bulk_actions.add_label"),be,l),this.narrow?(0,o.dy)(J||(J=re`<ha-assist-chip .label="${0}" slot="trigger"> <ha-svg-icon slot="trailing-icon" .path="${0}"></ha-svg-icon> </ha-assist-chip>`),this.hass.localize("ui.panel.config.automation.picker.bulk_action"),be):(0,o.dy)(ee||(ee=re`<ha-icon-button .path="${0}" .label="${0}" slot="trigger"></ha-icon-button>`),pe,this.hass.localize("ui.panel.config.automation.picker.bulk_action")),be,this.narrow?(0,o.dy)(te||(te=re`<ha-sub-menu> <ha-md-menu-item slot="item"> <div slot="headline"> ${0} </div> <ha-svg-icon slot="end" .path="${0}"></ha-svg-icon> </ha-md-menu-item> <ha-menu slot="menu">${0}</ha-menu> </ha-sub-menu> <ha-md-divider role="separator" tabindex="-1"></ha-md-divider>`),this.hass.localize("ui.panel.config.automation.picker.bulk_actions.add_label"),he,l):o.Ld,this._enableSelected,ye,this.hass.localize("ui.panel.config.entities.picker.enable_selected.button"),this._disableSelected,ke,this.hass.localize("ui.panel.config.entities.picker.disable_selected.button"),this._unhideSelected,fe,this.hass.localize("ui.panel.config.entities.picker.unhide_selected.button"),this._hideSelected,me,this.hass.localize("ui.panel.config.entities.picker.hide_selected.button"),this._removeSelected,ue,this.hass.localize("ui.panel.config.entities.picker.delete_selected.button"),Array.isArray(this._filters.config_entry)&&this._filters.config_entry.length?(0,o.dy)(ie||(ie=re`<ha-alert slot="filter-pane"> ${0} ${0}${0} </ha-alert>`),this.hass.localize("ui.panel.config.entities.picker.filtering_by_config_entry"),(null===(t=this._entries)||void 0===t||null===(t=t.find((e=>e.entry_id===this._filters.config_entry[0])))||void 0===t?void 0:t.title)||this._filters.config_entry[0],1===this._filters.config_entry.length&&Array.isArray(this._filters.sub_entry)&&this._filters.sub_entry.length?(0,o.dy)(ae||(ae=re` (${0})`),(null===(i=this._subEntries)||void 0===i||null===(i=i.find((e=>e.subentry_id===this._filters.sub_entry[0])))||void 0===i?void 0:i.title)||this._filters.sub_entry[0]):o.Ld):o.Ld,this.hass,this._filters["ha-filter-floor-areas"],this._filterChanged,"ha-filter-floor-areas"===this._expandedFilter,this.narrow,this._filterExpanded,this.hass,"entity",this._filters["ha-filter-devices"],this._filterChanged,"ha-filter-devices"===this._expandedFilter,this.narrow,this._filterExpanded,this.hass,this._filters["ha-filter-domains"],this._filterChanged,"ha-filter-domains"===this._expandedFilter,this.narrow,this._filterExpanded,this.hass,this._filters["ha-filter-integrations"],this._filterChanged,"ha-filter-integrations"===this._expandedFilter,this.narrow,this._filterExpanded,this.hass,this.hass.localize("ui.panel.config.entities.picker.headers.status"),this._filters["ha-filter-states"],this._states(this.hass.localize),this._filterChanged,"ha-filter-states"===this._expandedFilter,this.narrow,this._filterExpanded,this.hass,this._filters["ha-filter-labels"],this._filterChanged,"ha-filter-labels"===this._expandedFilter,this.narrow,this._filterExpanded,s?(0,o.dy)(ne||(ne=re`<ha-fab .label="${0}" extended @click="${0}" slot="fab"> <ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon> </ha-fab>`),this.hass.localize("ui.panel.config.devices.add_device"),this._addDevice,_e):o.Ld)}},{kind:"method",key:"_filterExpanded",value:function(e){e.detail.expanded?this._expandedFilter=e.target.localName:this._expandedFilter===e.target.localName&&(this._expandedFilter=void 0)}},{kind:"method",key:"_filterChanged",value:function(e){const t=e.target.localName;this._filters=Object.assign(Object.assign({},this._filters),{},{[t]:e.detail.value}),this._filteredItems=Object.assign(Object.assign({},this._filteredItems),{},{[t]:e.detail.items})}},{kind:"method",key:"firstUpdated",value:function(){(0,z.m)(this.hass).then((e=>{this._entitySources=e})),this._setFiltersFromUrl(),Object.keys(this._filters).length||(this._filters={"ha-filter-states":["enabled"]})}},{kind:"method",key:"_setFiltersFromUrl",value:function(){var e;const t=this._searchParms.get("domain"),i=this._searchParms.get("config_entry"),a=this._searchParms.get("sub_entry"),n=this._searchParms.has("label");(t||i||n)&&(this._filter=(null===(e=history.state)||void 0===e?void 0:e.filter)||"",this._filters={"ha-filter-states":[],"ha-filter-integrations":t?[t]:[],config_entry:i?[i]:[],sub_entry:a?[a]:[]},this._filterLabel())}},{kind:"method",key:"_filterLabel",value:function(){const e=this._searchParms.get("label");e&&(this._filters=Object.assign(Object.assign({},this._filters),{},{"ha-filter-labels":[e]}))}},{kind:"method",key:"_clearFilter",value:function(){this._filters={},this._filteredItems={}}},{kind:"method",key:"willUpdate",value:function(e){(0,s.Z)(i,"willUpdate",this,3)([e]);const t=e.get("hass");let a=!1;if(this.hass&&this._entities&&(e.has("hass")&&(!t||t.states!==this.hass.states)||e.has("_entities")||e.has("_entitySources"))){const i=[],s=new Set(this._entities.map((e=>e.entity_id)));for(const l of Object.keys(this.hass.states)){var n;s.has(l)||(!e.has("_entitySources")&&(!e.has("hass")||t&&t.states[l])||(a=!0),i.push({name:(0,v.C)(this.hass.states[l]),entity_id:l,platform:(null===(n=this._entitySources)||void 0===n||null===(n=n[l])||void 0===n?void 0:n.domain)||(0,m.M)(l),disabled_by:null,hidden_by:null,area_id:null,config_entry_id:null,config_subentry_id:null,device_id:null,icon:null,readonly:!0,selectable:!1,entity_category:null,has_entity_name:!1,options:null,labels:[],categories:{},created_at:0,modified_at:0}))}a&&(this._stateEntities=i)}}},{kind:"method",key:"_handleSearchChange",value:function(e){this._filter=e.detail.value,history.replaceState({filter:this._filter},"")}},{kind:"method",key:"_handleSelectionChanged",value:function(e){this._selected=e.detail.value}},{kind:"field",key:"_enableSelected",value(){return async()=>{(0,H.showConfirmationDialog)(this,{title:this.hass.localize("ui.panel.config.entities.picker.enable_selected.confirm_title",{number:this._selected.length}),text:this.hass.localize("ui.panel.config.entities.picker.enable_selected.confirm_text"),confirmText:this.hass.localize("ui.common.enable"),dismissText:this.hass.localize("ui.common.cancel"),confirm:async()=>{let e=!1,t=0;const i=await Promise.allSettled(this._selected.map((async i=>{const a=await(0,A.Nv)(this.hass,i,{disabled_by:null});a.require_restart&&(e=!0),a.reload_delay&&(t=Math.max(t,a.reload_delay))})));if((0,k.M)(i)){const e=(0,k.a)(i);(0,H.showAlertDialog)(this,{title:this.hass.localize("ui.panel.config.common.multiselect.failed",{number:e.length}),text:(0,o.dy)(se||(se=re`<pre>
${0}</pre>`),e.map((e=>e.reason.message||e.reason.code||e.reason)).join("\r\n"))})}this._clearSelection(),e?(0,H.showAlertDialog)(this,{text:this.hass.localize("ui.dialogs.entity_registry.editor.enabled_restart_confirm")}):t&&(0,H.showAlertDialog)(this,{text:this.hass.localize("ui.dialogs.entity_registry.editor.enabled_delay_confirm",{delay:t})})}})}}},{kind:"field",key:"_disableSelected",value(){return()=>{(0,H.showConfirmationDialog)(this,{title:this.hass.localize("ui.panel.config.entities.picker.disable_selected.confirm_title",{number:this._selected.length}),text:this.hass.localize("ui.panel.config.entities.picker.disable_selected.confirm_text"),confirmText:this.hass.localize("ui.common.disable"),dismissText:this.hass.localize("ui.common.cancel"),confirm:()=>{this._selected.forEach((e=>(0,A.Nv)(this.hass,e,{disabled_by:"user"}))),this._clearSelection()}})}}},{kind:"field",key:"_hideSelected",value(){return()=>{(0,H.showConfirmationDialog)(this,{title:this.hass.localize("ui.panel.config.entities.picker.hide_selected.confirm_title",{number:this._selected.length}),text:this.hass.localize("ui.panel.config.entities.picker.hide_selected.confirm"),confirmText:this.hass.localize("ui.common.hide"),dismissText:this.hass.localize("ui.common.cancel"),confirm:()=>{this._selected.forEach((e=>(0,A.Nv)(this.hass,e,{hidden_by:"user"}))),this._clearSelection()}})}}},{kind:"field",key:"_unhideSelected",value(){return()=>{this._selected.forEach((e=>(0,A.Nv)(this.hass,e,{hidden_by:null}))),this._clearSelection()}}},{kind:"method",key:"_handleBulkLabel",value:async function(e){const t=e.currentTarget.value,i=e.currentTarget.action;await this._bulkLabel(t,i)}},{kind:"method",key:"_bulkLabel",value:async function(e,t){const i=[];this._selected.forEach((a=>{const n=this.hass.entities[a]||this._entities.find((e=>e.entity_id===a));n&&i.push((0,A.Nv)(this.hass,a,{labels:"add"===t?n.labels.concat(e):n.labels.filter((t=>t!==e))}))}));const a=await Promise.allSettled(i);if((0,k.M)(a)){const e=(0,k.a)(a);(0,H.showAlertDialog)(this,{title:this.hass.localize("ui.panel.config.common.multiselect.failed",{number:e.length}),text:(0,o.dy)(le||(le=re`<pre>
${0}</pre>`),e.map((e=>e.reason.message||e.reason.code||e.reason)).join("\r\n"))})}}},{kind:"field",key:"_bulkCreateLabel",value(){return()=>{(0,T.T)(this,{createEntry:async e=>{const t=await(0,E.jo)(this.hass,e);return this._bulkLabel(t.label_id,"add"),t}})}}},{kind:"field",key:"_removeSelected",value(){return async()=>{if(!this._entities||!this.hass)return;const e=this._manifests?void 0:(0,M.F3)(this.hass),t=[...new Set(this._selected.map((e=>(0,m.M)(e))))].filter((e=>(0,g.X)(e))),i=this._entries?void 0:this._loadConfigEntries(),a=t.map((e=>_.E[e].fetch(this.hass))),n=await Promise.all(a);let s=[];n.forEach((e=>{s=s.concat(e)})),e&&(this._manifests=await e),i&&await i;const l=this._selected.filter((e=>(0,b.R)(this.hass,e,this._manifests,this._entities,this._entries,s)));(0,H.showConfirmationDialog)(this,{title:this.hass.localize("ui.panel.config.entities.picker.delete_selected.confirm_title"),text:l.length===this._selected.length?this.hass.localize("ui.panel.config.entities.picker.delete_selected.confirm_text"):this.hass.localize("ui.panel.config.entities.picker.delete_selected.confirm_partly_text",{deletable:l.length,selected:this._selected.length}),confirmText:this.hass.localize("ui.common.delete"),dismissText:this.hass.localize("ui.common.cancel"),destructive:!0,confirm:()=>{l.forEach((e=>(0,b.K)(this.hass,e,this._manifests,this._entities,this._entries,s))),this._clearSelection()}})}}},{kind:"method",key:"_clearSelection",value:function(){this._dataTable.clearSelection()}},{kind:"method",key:"_openEditEntry",value:function(e){const t=e.detail.id;(0,W.A)(this,{entityId:t})}},{kind:"method",key:"_loadConfigEntries",value:async function(){this._entries=await(0,w.pB)(this.hass)}},{kind:"method",key:"_loadSubEntries",value:async function(e){this._subEntries=await(0,w.$H)(this.hass,e)}},{kind:"method",key:"_addDevice",value:function(){const{filteredConfigEntry:e,filteredDomains:t}=this._filteredEntitiesAndDomains(this.hass.localize,this._entities,this.hass.devices,this.hass.areas,this._stateEntities,this._filters,this._filteredItems,this._entries,this._labels);1===t.size&&y.S.includes([...t][0])?(0,y.D)(this,this.hass,[...t][0],{config_entry:null==e?void 0:e.entry_id}):(0,V.E)(this,{domain:this._searchParms.get("domain")||void 0})}},{kind:"method",key:"_handleSortingChanged",value:function(e){this._activeSorting=e.detail}},{kind:"method",key:"_handleGroupingChanged",value:function(e){this._activeGrouping=e.detail.value}},{kind:"method",key:"_handleCollapseChanged",value:function(e){this._activeCollapsed=e.detail.value}},{kind:"method",key:"_handleColumnsChanged",value:function(e){this._activeColumnOrder=e.detail.columnOrder,this._activeHiddenColumns=e.detail.hiddenColumns}},{kind:"get",static:!0,key:"styles",value:function(){return[F.Qx,(0,o.iv)(oe||(oe=re`hass-tabs-subpage-data-table{--data-table-row-height:60px}hass-tabs-subpage-data-table.narrow{--data-table-row-height:72px}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:700;padding-left:16px;padding-inline-start:16px;padding-inline-end:initial;direction:var(--direction)}.table-header .selected-txt{margin-top:20px}.header-toolbar .selected-txt{font-size:16px}.header-toolbar .header-btns{margin-right:-12px;margin-inline-end:-12px;margin-inline-start:initial;direction:var(--direction)}.header-btns{display:flex}.header-btns>ha-icon-button,.header-btns>mwc-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;padding-inline-end:initial;text-transform:uppercase;direction:var(--direction)}ha-assist-chip{--ha-assist-chip-container-shape:10px}ha-md-button-menu ha-assist-chip{--md-assist-chip-trailing-space:8px}ha-label{--ha-label-background-color:var(--color, var(--grey-color));--ha-label-background-opacity:0.5}`))]}}]}}),(0,B.f)(o.oi));a()}catch(P){a(P)}}))}}]);
//# sourceMappingURL=49750.fd1ac0e075d3086c.js.map