iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
28 lines • 58.9 kB
JavaScript
"use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[40449],{16629:function(e,t,n){n.d(t,{E7:function(){return h},Mn:function(){return r},P9:function(){return l},lf:function(){return d}});n(18111),n(61701),n(62953);var i=n(63004);const r=e=>{const t=e/100;return[Math.round(o(t)),Math.round(a(t)),Math.round(s(t))]},o=e=>{if(e<=66)return 255;const t=329.698727446*(e-60)**-.1332047592;return(0,i.q)(t,0,255)},a=e=>{let t;return t=e<=66?99.4708025861*Math.log(e)-161.1195681661:288.1221695283*(e-60)**-.0755148492,(0,i.q)(t,0,255)},s=e=>{if(e>=66)return 255;if(e<=19)return 0;const t=138.5177312231*Math.log(e-10)-305.0447927307;return(0,i.q)(t,0,255)},c=(e,t)=>{const n=Math.max(...e),i=Math.max(...t);let r;return r=0===i?0:n/i,t.map(e=>Math.round(e*r))},l=e=>0===e?1e6:Math.floor(1e6/e),u=e=>0===e?1e6:Math.floor(1e6/e),d=(e,t,n)=>{const[i,o,a,s,d]=e,h=u(null!=t?t:2700),m=u(null!=n?n:6500),p=h-m;let g;try{g=d/(s+d)}catch(C){g=.5}const f=m+g*p,b=f?l(f):0,[v,y,_]=r(b),w=Math.max(s,d)/255;return c([i,o,a,s,d],[i+v*w,o+y*w,a+_*w])},h=e=>{const[t,n,i,r]=e;return c([t,n,i,r],[t+r,n+r,i+r])}},93421:function(e,t,n){n.d(t,{IW:function(){return u},dH:function(){return l},fI:function(){return c}});n(44114),n(62953);var i=n(35211),r=n(22792),o=n(32172);const a=(e,t)=>{let n=e;for(const i of t){if(null==n)return;n=n[i]}return n},s=(e,t,n)=>{const r=(0,o.p)({transformer:function(e){return n.call(this,e)},watch:t?[t]:[]}),a=(0,i.Fg)({context:e,subscribe:!0});return(e,t)=>{r(e,t),a(e,t)}},c=e=>s(r.iN,e.entityIdPath[0],function(t){const n=a(this,e.entityIdPath);return"string"==typeof n?null==t?void 0:t[n]:void 0}),l=e=>s(r.X1,e.entityIdPath[0],function(t){const n=a(this,e.entityIdPath);return"string"==typeof n?null==t?void 0:t[n]:void 0}),u=()=>s(r.D5,void 0,({localize:e})=>e)},4423:function(e,t,n){n.d(t,{B:function(){return c},r:function(){return s}});n(44114),n(18111),n(13579),n(17642),n(58004),n(33853),n(45876),n(32475),n(15024),n(31698),n(62953);var i=n(44537),r=n(71727),o=n(28455);const a=e=>{if(void 0!==e)return null===e?new Set([null]):new Set((0,i.e)(e))},s=(e,t)=>{const n=t.domain?new Set((0,i.e)(t.domain)):void 0,s=t.hidden_domains?new Set((0,i.e)(t.hidden_domains)):void 0,c=t.device_class?new Set((0,i.e)(t.device_class)):void 0,l=a(t.floor),u=a(t.area),d=a(t.device),h=t.entity_category?new Set((0,i.e)(t.entity_category)):void 0,m=t.label?new Set((0,i.e)(t.label)):void 0,p=t.hidden_platform?new Set((0,i.e)(t.hidden_platform)):void 0;return t=>{const i=e.states[t];if(!i)return!1;if(n||s){const e=(0,r.m)(t);if(n&&!n.has(e))return!1;if(s&&s.has(e))return!1}if(c){const e=i.attributes.device_class||"none";if(!c.has(e))return!1}const{area:a,floor:g,device:f,entity:b}=(0,o.ln)(i,e.entities,e.devices,e.areas,e.floors);if(b&&b.hidden)return!1;if(l){var v;const e=null!==(v=null==g?void 0:g.floor_id)&&void 0!==v?v:null;if(!l.has(e))return!1}if(u){var y;const e=null!==(y=null==a?void 0:a.area_id)&&void 0!==y?y:null;if(!u.has(e))return!1}if(d){var _;const e=null!==(_=null==f?void 0:f.id)&&void 0!==_?_:null;if(!d.has(e))return!1}if(m){if(!b)return!1;if(!b.labels.some(e=>m.has(e)))return!1}if(h){const e=(null==b?void 0:b.entity_category)||"none";if(!h.has(e))return!1}if(p){if(!b)return!1;if(b.platform&&p.has(b.platform))return!1}return!0}},c=(e,t)=>{const n=new Set,i=[];for(const r of t)for(const t of e)r(t)&&!n.has(t)&&(n.add(t),i.push(t));return i}},31290:function(e,t,n){n.d(t,{n:function(){return i}});n(27495),n(25440);const i=e=>e.replace(/^_*(.)|_+(.)/g,(e,t,n)=>t?t.toUpperCase():" "+n.toUpperCase())},17399:function(e,t,n){n.d(t,{W:function(){return i}});n(42762);const i=e=>{const t=e.trim();let n,i;return t.endsWith("ms")?(n=parseFloat(t.slice(0,-2)),i=1):t.endsWith("s")?(n=parseFloat(t.slice(0,-1)),i=1e3):(n=parseFloat(t),i=1),!isFinite(n)||n<0?0:n*i}},58139:function(e,t,n){n.d(t,{d:function(){return i},t:function(){return r}});n(3362);const i=async(e,t)=>new Promise(n=>{const i=t(e,e=>{i(),n(e)})}),r=async e=>new Promise(t=>{const n=e.subscribe(e=>{n(),t(e)})})},60353:function(e,t,n){n.d(t,{u:function(){return i}});class i{start(e){const t=Date.now();this._startY=e,this._startTime=t,this._lastY=e,this._lastTime=t,this._delta=0}move(e){const t=Date.now();return this._delta=this._startY-e,this._lastY=e,this._lastTime=t,this._delta}end(){const e=this.getVelocity(),t=Math.abs(e)>this._velocityThreshold;return{velocity:e,delta:this._delta,isSwipe:t,isDownwardSwipe:e>0}}getDelta(){return this._delta}getVelocity(){if(Date.now()-this._lastTime>=this._movementTimeThreshold)return 0;const e=this._lastTime-this._startTime;return e>0?(this._lastY-this._startY)/e:0}reset(){this._startY=0,this._delta=0,this._startTime=0,this._lastY=0,this._lastTime=0}constructor(e={}){var t,n;this._startY=0,this._delta=0,this._startTime=0,this._lastY=0,this._lastTime=0,this._velocityThreshold=null!==(t=e.velocitySwipeThreshold)&&void 0!==t?t:.5,this._movementTimeThreshold=null!==(n=e.movementTimeThreshold)&&void 0!==n?n:100}}},38962:function(e,t,n){n.a(e,async function(e,i){try{n.r(t);n(62953);var r=n(40445),o=n(5124),a=n(67576),s=n(6412),c=n(93421),l=n(1087),u=n(26300),d=(n(67094),e([u]));u=(d.then?(await d)():d)[0];let h,m,p,g,f=e=>e;const b="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",v={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"};class y extends o.WF{render(){var e;return(0,o.qy)(h||(h=f` <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,s.H)({[this.alertType]:!0}),this.title?"":"no-title",v[this.alertType],(0,s.H)({content:!0,narrow:this.narrow}),this.title?(0,o.qy)(m||(m=f`<div class="title">${0}</div>`),this.title):o.s6,this.dismissable?(0,o.qy)(p||(p=f`<ha-icon-button @click="${0}" .label="${0}" .path="${0}"></ha-icon-button>`),this._dismissClicked,null===(e=this._localize)||void 0===e?void 0:e.call(this,"ui.common.dismiss_alert"),b):o.s6)}_dismissClicked(){(0,l.r)(this,"alert-dismissed-clicked")}constructor(...e){super(...e),this.title="",this.alertType="info",this.dismissable=!1,this.narrow=!1}}y.styles=(0,o.AH)(g||(g=f`.issue-type{position:relative;padding:8px;display:flex}.icon{height:var(--ha-alert-icon-size,24px);width:var(--ha-alert-icon-size,24px)}.issue-type::after{position:absolute;top:0;right:0;bottom:0;left:0;opacity:.12;pointer-events:none;content:"";border-radius:var(--ha-border-radius-sm)}.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;line-height:normal;margin-left:8px;margin-right:0;margin-inline-start:8px;margin-inline-end:8px}.title{margin-top:2px;font-weight:var(--ha-font-weight-bold)}.action ha-icon-button{--mdc-theme-primary:var(--primary-text-color);--ha-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}`)),(0,r.Cg)([(0,a.MZ)()],y.prototype,"title",void 0),(0,r.Cg)([(0,a.MZ)({attribute:"alert-type"})],y.prototype,"alertType",void 0),(0,r.Cg)([(0,a.MZ)({type:Boolean})],y.prototype,"dismissable",void 0),(0,r.Cg)([(0,a.wk)(),(0,c.IW)()],y.prototype,"_localize",void 0),(0,r.Cg)([(0,a.MZ)({type:Boolean})],y.prototype,"narrow",void 0),y=(0,r.Cg)([(0,a.EM)("ha-alert")],y),i()}catch(h){i(h)}})},9503:function(e,t,n){var i=n(40445),r=n(97577),o=n(5124),a=n(67576);let s,c=e=>e;class l extends r.A{get value(){var e;return null!==(e=this._value)&&void 0!==e?e:null}set value(e){this._value=e}static get styles(){return[r.A.styles,(0,o.AH)(s||(s=c`:host{--wa-form-control-toggle-size:var(--ha-checkbox-size, 20px);--wa-form-control-border-color:var(
--ha-checkbox-border-color,
var(--ha-color-border-neutral-normal)
);--wa-form-control-background-color:var(
--ha-checkbox-background-color,
var(--wa-form-control-background-color)
);--checked-icon-color:var(
--ha-checkbox-checked-icon-color,
var(--wa-color-brand-on-loud)
);--wa-form-control-activated-color:var(
--ha-checkbox-checked-background-color,
var(--ha-color-fill-primary-loud-resting)
);-webkit-tap-highlight-color:transparent;--checked-icon-scale:var(--ha-checkbox-checked-icon-scale, 0.9);--wa-form-control-required-content:var(
--ha-checkbox-required-marker,
var(--ha-input-required-marker, "*")
);--wa-form-control-required-content-offset:var(
--ha-checkbox-required-marker-offset,
0.1rem
)}[part~=base]{align-items:center;gap:var(--ha-space-2)}[part~=control]{border-radius:var(--ha-checkbox-border-radius,var(--ha-border-radius-sm));border-width:var(--ha-checkbox-border-width,var(--ha-border-width-md));margin-inline-end:0}[part~=label]{line-height:1}#hint{font-size:var(--ha-font-size-xs);color:var(--ha-color-text-secondary)}label:has(input:not(:disabled)):hover{--wa-form-control-border-color:var(
--ha-checkbox-border-color-hover,
var(--ha-checkbox-border-color, var(--ha-color-border-neutral-loud))
)}label:has(input:not(:disabled)):hover [part~=control]{background-color:var(--ha-checkbox-background-color-hover,var(--ha-color-form-background-hover))}label:has(input:checked:not(:disabled)):hover [part~=control],label:has(input:indeterminate:not(:disabled)):hover [part~=control]{background-color:var(--ha-checkbox-checked-background-color-hover,var(--ha-color-fill-primary-loud-hover));border-color:var(--ha-checkbox-checked-background-color-hover,var(--ha-color-fill-primary-loud-hover))}`))]}}l=(0,i.Cg)([(0,a.EM)("ha-checkbox")],l)},43661:function(e,t,n){n.r(t),n.d(t,{HaIconNext:function(){return s}});n(62953);var i=n(40445),r=n(67576),o=n(63091),a=n(67094);class s extends a.HaSvgIcon{constructor(...e){super(...e),this.path="rtl"===o.G.document.dir?"M15.41,16.58L10.83,12L15.41,7.41L14,6L8,12L14,18L15.41,16.58Z":"M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z"}}(0,i.Cg)([(0,r.MZ)()],s.prototype,"path",void 0),s=(0,i.Cg)([(0,r.EM)("ha-icon-next")],s)},59646:function(e,t,n){n.a(e,async function(e,t){try{n(62953);var i=n(40445),r=n(29344),o=n(5124),a=n(67576),s=n(88360),c=e([r]);r=(c.then?(await c)():c)[0];let l,u=e=>e;class d extends r.A{updated(e){super.updated(e),e.has("haptic")&&(this.haptic?this.addEventListener("change",this._forwardHaptic):this.removeEventListener("change",this._forwardHaptic))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",this._forwardHaptic)}static get styles(){return[r.A.styles,(0,o.AH)(l||(l=u`:host{--wa-form-control-toggle-size:var(--ha-switch-size, 24px);--wa-form-control-required-content:var(
--ha-switch-required-marker,
var(--ha-input-required-marker, "*")
);--wa-form-control-required-content-offset:var(
--ha-switch-required-marker-offset,
0.1rem
);--thumb-size:var(--ha-switch-thumb-size, 18px);--width:var(--ha-switch-width, 48px)}label{position:relative;height:max(var(--thumb-size),var(--wa-form-control-toggle-size))}label::before{content:"";position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:100%;height:100%;min-width:var(--ha-switch-min-touch-size,40px);min-height:var(--ha-switch-min-touch-size,40px)}label.disabled::before{pointer-events:none}.switch{background-color:var(--ha-switch-background-color,var(--ha-color-fill-disabled-quiet-resting));border-color:var(--ha-switch-border-color,var(--ha-color-border-neutral-normal))}label:not(.disabled) .input:focus-visible~.switch,label:not(.disabled):hover .switch{background-color:var(--ha-switch-background-color-hover,var(--ha-switch-background-color,var(--ha-color-fill-disabled-quiet-hover)))}.checked .switch{background-color:var(--ha-switch-checked-background-color,var(--ha-color-fill-primary-normal-resting));border-color:var(--ha-switch-checked-border-color,var(--ha-color-border-primary-loud))}label:not(.disabled).checked .input:focus-visible~.switch,label:not(.disabled).checked:hover .switch{background-color:var(--ha-switch-checked-background-color-hover,var(--ha-switch-checked-background-color,var(--ha-color-fill-primary-normal-hover)));border-color:var(--ha-switch-checked-border-color-hover,var(--ha-switch-checked-border-color,var(--ha-color-border-primary-loud)))}.switch .thumb{background-color:var(--ha-switch-thumb-background-color,var(--ha-color-on-neutral-normal));border-color:var(--ha-switch-thumb-border-color,var(--ha-color-on-neutral-normal));border-style:var(--wa-form-control-border-style);border-width:var(--wa-form-control-border-width);box-shadow:var(--ha-switch-thumb-box-shadow,var(--ha-box-shadow-s))}label:not(.disabled) .input:focus-visible~.switch .thumb,label:not(.disabled):hover .switch .thumb{background-color:var(--ha-switch-thumb-background-color-hover,var(--ha-switch-thumb-background-color,var(--ha-color-on-neutral-normal)));border-color:var(--ha-switch-thumb-border-color-hover,var(--ha-switch-thumb-border-color,var(--ha-color-on-neutral-normal)))}.checked .switch .thumb{background-color:var(--ha-switch-checked-thumb-background-color,var(--ha-color-on-primary-normal));border-color:var(--ha-switch-checked-thumb-border-color,var(--ha-color-on-primary-normal))}label:not(.disabled).checked .input:focus-visible~.switch .thumb,label:not(.disabled).checked:hover .switch .thumb{background-color:var(--ha-switch-checked-thumb-background-color-hover,var(--ha-switch-checked-thumb-background-color,var(--ha-color-on-primary-normal)));border-color:var(--ha-switch-checked-thumb-border-color-hover,var(--ha-switch-checked-thumb-border-color,var(--ha-color-on-primary-normal)))}label.disabled{opacity:var(--ha-switch-disabled-opacity, .3);cursor:not-allowed}label:not(.disabled) .input:focus-visible~.switch .thumb{outline:0;outline-offset:none}label:not(.disabled) .input:focus-visible~.switch{outline:var(--wa-focus-ring);outline-offset:var(--wa-focus-ring-offset)}:host(:empty) slot.label{display:none}`))]}constructor(...e){super(...e),this.haptic=!1,this._forwardHaptic=()=>{(0,s.j)(this,"light")}}}(0,i.Cg)([(0,a.MZ)({type:Boolean})],d.prototype,"haptic",void 0),d=(0,i.Cg)([(0,a.EM)("ha-switch")],d),t()}catch(l){t(l)}})},82e3:function(e,t,n){n.d(t,{D5:function(){return i},Fy:function(){return a},Gk:function(){return l},Hg:function(){return r},Y_:function(){return u},ds:function(){return c},e0:function(){return o},ec:function(){return s}});n(74423),n(18111),n(61701),n(33110),n(3362);const i=14881==n.j?`${location.protocol}//${location.host}`:null,r=e=>e.map(e=>{if("string"!==e.type)return e;switch(e.name){case"username":return Object.assign(Object.assign({},e),{},{autocomplete:"username",autofocus:!0});case"password":return Object.assign(Object.assign({},e),{},{autocomplete:"current-password"});case"code":return Object.assign(Object.assign({},e),{},{autocomplete:"one-time-code",autofocus:!0});default:return e}}),o=(e,t)=>e.callWS({type:"auth/sign_path",path:t}),a=async(e,t,n,i)=>e.callWS({type:"config/auth_provider/homeassistant/create",user_id:t,username:n,password:i}),s=(e,t,n)=>e.callWS({type:"config/auth_provider/homeassistant/change_password",current_password:t,new_password:n}),c=(e,t,n)=>e.callWS({type:"config/auth_provider/homeassistant/admin_change_password",user_id:t,password:n}),l=(e,t,n)=>e.callWS({type:"config/auth_provider/homeassistant/admin_change_username",user_id:t,username:n}),u=(e,t,n)=>e.callWS({type:"auth/delete_all_refresh_tokens",token_type:t,delete_current_token:n})},10897:function(e,t,n){n.d(t,{C4:function(){return l},CK:function(){return c},FX:function(){return g},UC:function(){return m},_Z:function(){return y},bT:function(){return _},j4:function(){return b},sd:function(){return o},su:function(){return s},vc:function(){return v},w8:function(){return h},wv:function(){return d},y3:function(){return p},zS:function(){return a}});n(3362);var i=n(3931),r=n(82e3);const o=[1,2,3,4,6,8],a="web_rtc",s=(e,t,n)=>`${e}&width=${t}&height=${n}`,c=e=>e.attributes.access_token?`/api/camera_proxy_stream/${e.entity_id}?token=${e.attributes.access_token}`:void 0,l=async(e,t,n,r)=>{const o=await(0,i.U)("_cameraTmbUrl",9e3,u,e,t);return s(o,n,r)},u=async(e,t)=>{const n=await(0,r.e0)(e,`/api/camera_proxy/${t}`);return e.hassUrl(n.path)},d=async(e,t,n)=>{const i={type:"camera/stream",entity_id:t};n&&(i.format=n);const r=await e.callWS(i);return r.url=e.hassUrl(r.url),r},h=(e,t,n,i)=>e.connection.subscribeMessage(i,{type:"camera/webrtc/offer",entity_id:t,offer:n}),m=(e,t,n,i)=>e.callWS({type:"camera/webrtc/candidate",entity_id:t,session_id:n,candidate:i}),p=(e,t)=>e.callWS({type:"camera/get_prefs",entity_id:t}),g=(e,t,n)=>e.callWS(Object.assign({type:"camera/update_prefs",entity_id:t},n)),f="media-source://camera/",b=e=>e.startsWith(f),v=e=>e.substring(22),y=async(e,t)=>e.callWS({type:"camera/capabilities",entity_id:t}),_=async(e,t)=>e.callWS({type:"camera/webrtc/get_client_config",entity_id:t})},38395:function(e,t,n){n.d(t,{gh:function(){return c},kU:function(){return l},q:function(){return s}});n(3362);var i=n(90889),r=n(62384),o=n(61557);function a(e){return document.cookie=`ingress_session=${e};path=/api/hassio_ingress/;SameSite=Strict${"https:"===location.protocol?";Secure":""}`,e}const s=async e=>{if((0,r.v)(e.config.version,2021,2,4)){return a((await e.callWS({type:"supervisor/api",endpoint:"/ingress/session",method:"post"})).session)}return a((await e.callApi("POST","hassio/ingress/session")).data.session)},c=e=>(0,i.X)(e,"_ingressPanelInfo",async e=>(await(0,o.uw)(e,{endpoint:"/ingress/panels"})).panels),l=async(e,t)=>{(0,r.v)(e.config.version,2021,2,4)?await e.callWS({type:"supervisor/api",endpoint:"/ingress/validate_session",method:"post",data:{session:t}}):await e.callApi("POST","hassio/ingress/validate_session",{session:t})}},99129:function(e,t,n){n.d(t,{EG:function(){return o},ML:function(){return a}});var i=n(90889),r=n(35952);const o=(e,t,n)=>e.subscribeEvents(e=>{e.data.url_path===t&&n()},"lovelace_updated"),a=(e,t=null)=>(0,i.X)(e,`_lovelace_${null!=t?t:""}`,e=>(0,r.Dz)(e,t,!1),(n,i)=>o(e,t,()=>(0,r.Dz)(e,t,!1).then(e=>i.setState(e,!0))))},28918:function(e,t,n){n.d(t,{H:function(){return r},o:function(){return i}});function i(e){return"boolean"==typeof e?e?{}:void 0:e}function r(e){return"strategy"in e}},91984:function(e,t,n){n.d(t,{R6:function(){return r},TQ:function(){return o},cg:function(){return a}});var i=n(31290);function r(e){return"strategy"in e}const o=(e,t)=>{var n;return null!==(n=e.title)&&void 0!==n?n:e.path?(0,i.n)(e.path):String(t)},a=e=>{var t;return null!==(t=e.icon)&&void 0!==t?t:"mdi:view-compact"}},45291:function(e,t,n){n.d(t,{IP:function(){return i},Iu:function(){return d},J_:function(){return o},O9:function(){return s},b$:function(){return l},bH:function(){return a},c8:function(){return u},wi:function(){return c}});n(18111),n(20116),n(62953);const i="custom:",r=window;"customCards"in r||(r.customCards=[]),"customCardFeatures"in r||(r.customCardFeatures=[]),"customBadges"in r||(r.customBadges=[]),"customTileFeatures"in r||(r.customTileFeatures=[]);const o=r.customCards,a=()=>[...r.customCardFeatures,...r.customTileFeatures],s=r.customBadges,c=e=>o.find(t=>t.type===e),l=e=>s.find(t=>t.type===e),u=e=>e.startsWith(i),d=e=>e.slice(i.length)},53072:function(e,t,n){n.d(t,{$6:function(){return b},EC:function(){return g},ET:function(){return f},H1:function(){return p},HN:function(){return w},Im:function(){return H},QI:function(){return C},Un:function(){return y},Xm:function(){return _},ce:function(){return A},fh:function(){return M},ie:function(){return L},mm:function(){return v},vj:function(){return m}});n(44114);var i=n(47129),r=n(82286),o=n(22675),a=n(52069);const s="M11,14C12,14 13.05,14.16 14.2,14.44C13.39,15.31 13,16.33 13,17.5C13,18.39 13.25,19.23 13.78,20H3V18C3,16.81 3.91,15.85 5.74,15.12C7.57,14.38 9.33,14 11,14M11,12C9.92,12 9,11.61 8.18,10.83C7.38,10.05 7,9.11 7,8C7,6.92 7.38,6 8.18,5.18C9,4.38 9.92,4 11,4C12.11,4 13.05,4.38 13.83,5.18C14.61,6 15,6.92 15,8C15,9.11 14.61,10.05 13.83,10.83C13.05,11.61 12.11,12 11,12M18.5,10H20L22,10V12H20V17.5A2.5,2.5 0 0,1 17.5,20A2.5,2.5 0 0,1 15,17.5A2.5,2.5 0 0,1 17.5,15C17.86,15 18.19,15.07 18.5,15.21V10Z",c="M14,19H18V5H14M6,19H10V5H6V19Z",l="M8,5.14V19.14L19,12.14L8,5.14Z",u="M13,3H11V13H13V3M17.83,5.17L16.41,6.59C18.05,7.91 19,9.9 19,12A7,7 0 0,1 12,19C8.14,19 5,15.88 5,12C5,9.91 5.95,7.91 7.58,6.58L6.17,5.17C2.38,8.39 1.92,14.07 5.14,17.86C8.36,21.64 14.04,22.1 17.83,18.88C19.85,17.17 21,14.65 21,12C21,9.37 19.84,6.87 17.83,5.17Z",d="M18,18H6V6H18V18Z",h="M8.16,3L6.75,4.41L9.34,7H4C2.89,7 2,7.89 2,9V19C2,20.11 2.89,21 4,21H20C21.11,21 22,20.11 22,19V9C22,7.89 21.11,7 20,7H14.66L17.25,4.41L15.84,3L12,6.84L8.16,3M4,9H17V19H4V9M19.5,9A1,1 0 0,1 20.5,10A1,1 0 0,1 19.5,11A1,1 0 0,1 18.5,10A1,1 0 0,1 19.5,9M19.5,12A1,1 0 0,1 20.5,13A1,1 0 0,1 19.5,14A1,1 0 0,1 18.5,13A1,1 0 0,1 19.5,12Z";var m=function(e){return e[e.PAUSE=1]="PAUSE",e[e.SEEK=2]="SEEK",e[e.VOLUME_SET=4]="VOLUME_SET",e[e.VOLUME_MUTE=8]="VOLUME_MUTE",e[e.PREVIOUS_TRACK=16]="PREVIOUS_TRACK",e[e.NEXT_TRACK=32]="NEXT_TRACK",e[e.TURN_ON=128]="TURN_ON",e[e.TURN_OFF=256]="TURN_OFF",e[e.PLAY_MEDIA=512]="PLAY_MEDIA",e[e.VOLUME_STEP=1024]="VOLUME_STEP",e[e.SELECT_SOURCE=2048]="SELECT_SOURCE",e[e.STOP=4096]="STOP",e[e.CLEAR_PLAYLIST=8192]="CLEAR_PLAYLIST",e[e.PLAY=16384]="PLAY",e[e.SHUFFLE_SET=32768]="SHUFFLE_SET",e[e.SELECT_SOUND_MODE=65536]="SELECT_SOUND_MODE",e[e.BROWSE_MEDIA=131072]="BROWSE_MEDIA",e[e.REPEAT_SET=262144]="REPEAT_SET",e[e.GROUPING=524288]="GROUPING",e}({});const p="browser",g={album:{icon:"M12,11A1,1 0 0,0 11,12A1,1 0 0,0 12,13A1,1 0 0,0 13,12A1,1 0 0,0 12,11M12,16.5C9.5,16.5 7.5,14.5 7.5,12C7.5,9.5 9.5,7.5 12,7.5C14.5,7.5 16.5,9.5 16.5,12C16.5,14.5 14.5,16.5 12,16.5M12,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",layout:"grid"},app:{icon:"M21 2H3C1.9 2 1 2.9 1 4V20C1 21.1 1.9 22 3 22H21C22.1 22 23 21.1 23 20V4C23 2.9 22.1 2 21 2M21 7H3V4H21V7Z",layout:"grid",show_list_images:!0},artist:{icon:s,layout:"grid",show_list_images:!0},channel:{icon:h,thumbnail_ratio:"portrait",layout:"grid",show_list_images:!0},composer:{icon:"M11,4A4,4 0 0,1 15,8A4,4 0 0,1 11,12A4,4 0 0,1 7,8A4,4 0 0,1 11,4M11,6A2,2 0 0,0 9,8A2,2 0 0,0 11,10A2,2 0 0,0 13,8A2,2 0 0,0 11,6M11,13C12.1,13 13.66,13.23 15.11,13.69C14.5,14.07 14,14.6 13.61,15.23C12.79,15.03 11.89,14.9 11,14.9C8.03,14.9 4.9,16.36 4.9,17V18.1H13.04C13.13,18.8 13.38,19.44 13.76,20H3V17C3,14.34 8.33,13 11,13M18.5,10H20L22,10V12H20V17.5A2.5,2.5 0 0,1 17.5,20A2.5,2.5 0 0,1 15,17.5A2.5,2.5 0 0,1 17.5,15C17.86,15 18.19,15.07 18.5,15.21V10Z",layout:"grid",show_list_images:!0},contributing_artist:{icon:s,layout:"grid",show_list_images:!0},directory:{icon:"M10,4H4C2.89,4 2,4.89 2,6V18A2,2 0 0,0 4,20H20A2,2 0 0,0 22,18V8C22,6.89 21.1,6 20,6H12L10,4Z",layout:"grid",show_list_images:!0},episode:{icon:h,layout:"grid",thumbnail_ratio:"portrait",show_list_images:!0},game:{icon:"M7,6H17A6,6 0 0,1 23,12A6,6 0 0,1 17,18C15.22,18 13.63,17.23 12.53,16H11.47C10.37,17.23 8.78,18 7,18A6,6 0 0,1 1,12A6,6 0 0,1 7,6M6,9V11H4V13H6V15H8V13H10V11H8V9H6M15.5,12A1.5,1.5 0 0,0 14,13.5A1.5,1.5 0 0,0 15.5,15A1.5,1.5 0 0,0 17,13.5A1.5,1.5 0 0,0 15.5,12M18.5,9A1.5,1.5 0 0,0 17,10.5A1.5,1.5 0 0,0 18.5,12A1.5,1.5 0 0,0 20,10.5A1.5,1.5 0 0,0 18.5,9Z",layout:"grid",thumbnail_ratio:"portrait"},genre:{icon:"M8.11,19.45C5.94,18.65 4.22,16.78 3.71,14.35L2.05,6.54C1.81,5.46 2.5,4.4 3.58,4.17L13.35,2.1L13.38,2.09C14.45,1.88 15.5,2.57 15.72,3.63L16.07,5.3L20.42,6.23H20.45C21.5,6.47 22.18,7.53 21.96,8.59L20.3,16.41C19.5,20.18 15.78,22.6 12,21.79C10.42,21.46 9.08,20.61 8.11,19.45V19.45M20,8.18L10.23,6.1L8.57,13.92V13.95C8,16.63 9.73,19.27 12.42,19.84C15.11,20.41 17.77,18.69 18.34,16L20,8.18M16,16.5C15.37,17.57 14.11,18.16 12.83,17.89C11.56,17.62 10.65,16.57 10.5,15.34L16,16.5M8.47,5.17L4,6.13L5.66,13.94L5.67,13.97C5.82,14.68 6.12,15.32 6.53,15.87C6.43,15.1 6.45,14.3 6.62,13.5L7.05,11.5C6.6,11.42 6.21,11.17 6,10.81C6.06,10.2 6.56,9.66 7.25,9.5C7.33,9.5 7.4,9.5 7.5,9.5L8.28,5.69C8.32,5.5 8.38,5.33 8.47,5.17M15.03,12.23C15.35,11.7 16.03,11.42 16.72,11.57C17.41,11.71 17.91,12.24 18,12.86C17.67,13.38 17,13.66 16.3,13.5C15.61,13.37 15.11,12.84 15.03,12.23M10.15,11.19C10.47,10.66 11.14,10.38 11.83,10.53C12.5,10.67 13.03,11.21 13.11,11.82C12.78,12.34 12.11,12.63 11.42,12.5C10.73,12.33 10.23,11.8 10.15,11.19M11.97,4.43L13.93,4.85L13.77,4.05L11.97,4.43Z",layout:"grid",show_list_images:!0},image:{icon:"M8.5,13.5L11,16.5L14.5,12L19,18H5M21,19V5C21,3.89 20.1,3 19,3H5A2,2 0 0,0 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19Z",layout:"grid",show_list_images:!0},movie:{icon:"M18,4L20,8H17L15,4H13L15,8H12L10,4H8L10,8H7L5,4H4A2,2 0 0,0 2,6V18A2,2 0 0,0 4,20H20A2,2 0 0,0 22,18V4H18Z",thumbnail_ratio:"portrait",layout:"grid",show_list_images:!0},music:{icon:"M21,3V15.5A3.5,3.5 0 0,1 17.5,19A3.5,3.5 0 0,1 14,15.5A3.5,3.5 0 0,1 17.5,12C18.04,12 18.55,12.12 19,12.34V6.47L9,8.6V17.5A3.5,3.5 0 0,1 5.5,21A3.5,3.5 0 0,1 2,17.5A3.5,3.5 0 0,1 5.5,14C6.04,14 6.55,14.12 7,14.34V6L21,3Z",show_list_images:!0},playlist:{icon:"M15,6H3V8H15V6M15,10H3V12H15V10M3,16H11V14H3V16M17,6V14.18C16.69,14.07 16.35,14 16,14A3,3 0 0,0 13,17A3,3 0 0,0 16,20A3,3 0 0,0 19,17V8H22V6H17Z",layout:"grid",show_list_images:!0},podcast:{icon:"M17,18.25V21.5H7V18.25C7,16.87 9.24,15.75 12,15.75C14.76,15.75 17,16.87 17,18.25M12,5.5A6.5,6.5 0 0,1 18.5,12C18.5,13.25 18.15,14.42 17.54,15.41L16,14.04C16.32,13.43 16.5,12.73 16.5,12C16.5,9.5 14.5,7.5 12,7.5C9.5,7.5 7.5,9.5 7.5,12C7.5,12.73 7.68,13.43 8,14.04L6.46,15.41C5.85,14.42 5.5,13.25 5.5,12A6.5,6.5 0 0,1 12,5.5M12,1.5A10.5,10.5 0 0,1 22.5,12C22.5,14.28 21.77,16.39 20.54,18.11L19.04,16.76C19.96,15.4 20.5,13.76 20.5,12A8.5,8.5 0 0,0 12,3.5A8.5,8.5 0 0,0 3.5,12C3.5,13.76 4.04,15.4 4.96,16.76L3.46,18.11C2.23,16.39 1.5,14.28 1.5,12A10.5,10.5 0 0,1 12,1.5M12,9.5A2.5,2.5 0 0,1 14.5,12A2.5,2.5 0 0,1 12,14.5A2.5,2.5 0 0,1 9.5,12A2.5,2.5 0 0,1 12,9.5Z",layout:"grid"},season:{icon:h,layout:"grid",thumbnail_ratio:"portrait",show_list_images:!0},track:{icon:"M14,2H6A2,2 0 0,0 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2M13,13H11V18A2,2 0 0,1 9,20A2,2 0 0,1 7,18A2,2 0 0,1 9,16C9.4,16 9.7,16.1 10,16.3V11H13V13M13,9V3.5L18.5,9H13Z"},tv_show:{icon:h,layout:"grid",thumbnail_ratio:"portrait"},url:{icon:"M16.36,14C16.44,13.34 16.5,12.68 16.5,12C16.5,11.32 16.44,10.66 16.36,10H19.74C19.9,10.64 20,11.31 20,12C20,12.69 19.9,13.36 19.74,14M14.59,19.56C15.19,18.45 15.65,17.25 15.97,16H18.92C17.96,17.65 16.43,18.93 14.59,19.56M14.34,14H9.66C9.56,13.34 9.5,12.68 9.5,12C9.5,11.32 9.56,10.65 9.66,10H14.34C14.43,10.65 14.5,11.32 14.5,12C14.5,12.68 14.43,13.34 14.34,14M12,19.96C11.17,18.76 10.5,17.43 10.09,16H13.91C13.5,17.43 12.83,18.76 12,19.96M8,8H5.08C6.03,6.34 7.57,5.06 9.4,4.44C8.8,5.55 8.35,6.75 8,8M5.08,16H8C8.35,17.25 8.8,18.45 9.4,19.56C7.57,18.93 6.03,17.65 5.08,16M4.26,14C4.1,13.36 4,12.69 4,12C4,11.31 4.1,10.64 4.26,10H7.64C7.56,10.66 7.5,11.32 7.5,12C7.5,12.68 7.56,13.34 7.64,14M12,4.03C12.83,5.23 13.5,6.57 13.91,8H10.09C10.5,6.57 11.17,5.23 12,4.03M18.92,8H15.97C15.65,6.75 15.19,5.55 14.59,4.44C16.43,5.07 17.96,6.34 18.92,8M12,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,2Z"},video:{icon:"M17,10.5V7A1,1 0 0,0 16,6H4A1,1 0 0,0 3,7V17A1,1 0 0,0 4,18H16A1,1 0 0,0 17,17V13.5L21,17.5V6.5L17,10.5Z",layout:"grid",show_list_images:!0}},f=(e,t,n,i)=>e.callWS({type:"media_player/browse_media",entity_id:t,media_content_id:n,media_content_type:i}),b=e=>{let t=e.attributes.media_position;return"playing"!==e.state?t:(t+=(Date.now()-new Date(e.attributes.media_position_updated_at).getTime())/1e3,t<0?0:t)},v=e=>{let t;switch(e.attributes.media_content_type){case"music":case"image":t=e.attributes.media_artist;break;case"playlist":t=e.attributes.media_playlist||e.attributes.media_artist;break;case"tvshow":t=e.attributes.media_series_title,e.attributes.media_season&&(t+=" S"+e.attributes.media_season,e.attributes.media_episode&&(t+="E"+e.attributes.media_episode));break;case"channel":t=e.attributes.media_channel;break;default:t=e.attributes.app_name||""}return t},y=(e,t=!1)=>{if(!e)return;const n=e.state;if(n===o.Hh)return;const a=!0===e.attributes.assumed_state;if(!(0,i.a)(e)&&!a)return(0,r.$)(e,128)?[{icon:u,action:"turn_on"}]:void 0;const s=[];a&&(0,r.$)(e,128)&&s.push({icon:"M11,3H13V21H11V3Z",action:"turn_on"}),(0,r.$)(e,256)&&s.push({icon:a?"M12,3A9,9 0 0,0 3,12A9,9 0 0,0 12,21A9,9 0 0,0 21,12A9,9 0 0,0 12,3M12,19A7,7 0 0,1 5,12A7,7 0 0,1 12,5A7,7 0 0,1 19,12A7,7 0 0,1 12,19Z":u,action:"turn_off"});const h=e.attributes;return("playing"===n||"paused"===n||a)&&(0,r.$)(e,32768)&&t&&s.push({icon:!0===h.shuffle?"M14.83,13.41L13.42,14.82L16.55,17.95L14.5,20H20V14.5L17.96,16.54L14.83,13.41M14.5,4L16.54,6.04L4,18.59L5.41,20L17.96,7.46L20,9.5V4M10.59,9.17L5.41,4L4,5.41L9.17,10.58L10.59,9.17Z":"M16,4.5V7H5V9H16V11.5L19.5,8M16,12.5V15H5V17H16V19.5L19.5,16",action:"shuffle_set"}),("playing"===n||"paused"===n||a)&&(0,r.$)(e,16)&&s.push({icon:"M6,18V6H8V18H6M9.5,12L18,6V18L9.5,12Z",action:"media_previous_track"}),!a&&("playing"===n&&((0,r.$)(e,1)||(0,r.$)(e,4096))||("paused"===n||"idle"===n)&&(0,r.$)(e,16384)||"on"===n&&((0,r.$)(e,16384)||(0,r.$)(e,1)))&&s.push({icon:"on"===n?"M3,5V19L11,12M13,19H16V5H13M18,5V19H21V5":"playing"!==n?l:(0,r.$)(e,1)?c:d,action:"playing"!==n?"media_play":(0,r.$)(e,1)?"media_pause":"media_stop"}),a&&(0,r.$)(e,16384)&&s.push({icon:l,action:"media_play"}),a&&(0,r.$)(e,1)&&s.push({icon:c,action:"media_pause"}),a&&(0,r.$)(e,4096)&&s.push({icon:d,action:"media_stop"}),("playing"===n||"paused"===n||a)&&(0,r.$)(e,32)&&s.push({icon:"M16,18H18V6H16M6,18L14.5,12L6,6V18Z",action:"media_next_track"}),("playing"===n||"paused"===n||a)&&(0,r.$)(e,262144)&&t&&s.push({icon:"all"===h.repeat?"M17,17H7V14L3,18L7,22V19H19V13H17M7,7H17V10L21,6L17,2V5H5V11H7V7Z":"one"===h.repeat?"M13,15V9H12L10,10V11H11.5V15M17,17H7V14L3,18L7,22V19H19V13H17M7,7H17V10L21,6L17,2V5H5V11H7V7Z":"M2,5.27L3.28,4L20,20.72L18.73,22L15.73,19H7V22L3,18L7,14V17H13.73L7,10.27V11H5V8.27L2,5.27M17,13H19V17.18L17,15.18V13M17,5V2L21,6L17,10V7H8.82L6.82,5H17Z",action:"repeat_set"}),s.length>0?s:void 0},_=e=>{if(void 0===e||e===1/0)return"";const t=Math.max(0,Math.floor(e)),n=Math.floor(t/3600),i=Math.floor(t%3600/60),r=t%60,o=e=>e.toString().padStart(2,"0");return n>0?`${o(n)}:${o(i)}:${o(r)}`:`${o(i)}:${o(r)}`},w=e=>{if(!e)return;const t=e.indexOf("?authSig=");let n=t>0?e.slice(0,t):e;return n.startsWith("http")&&(n=decodeURIComponent(n.split("/").pop())),n},C=(e,t,n)=>e.callService("media_player","volume_set",{entity_id:t,volume_level:n}),A=(e,t,n)=>e.callService("media_player",n,"shuffle_set"===n?{entity_id:t.entity_id,shuffle:!t.attributes.shuffle}:"repeat_set"===n?{entity_id:t.entity_id,repeat:"all"===t.attributes.repeat?"one":"off"===t.attributes.repeat?"all":"off"}:{entity_id:t.entity_id}),L=(e,t,n,i,r={})=>(!r.enqueue&&void 0===r.announce&&(0,a.ni)(n)&&(r.announce=!0),e.callService("media_player","play_media",Object.assign({entity_id:t,media_content_id:n,media_content_type:i},r))),H=(e,t,n)=>e.callService("media_player","join",{group_members:n},{entity_id:t}),M=(e,t)=>e.callService("media_player","unjoin",{},{entity_id:t})},61557:function(e,t,n){n.d(t,{uw:function(){return r}});n(3362);const i={type:"supervisor/api",method:"GET"},r=(e,t)=>e.sendMessagePromise(Object.assign(Object.assign({},i),t))},28669:function(e,t,n){n.d(t,{TK:function(){return s},_2:function(){return l},eR:function(){return r},hG:function(){return c},hU:function(){return o},kg:function(){return a},wj:function(){return i},xg:function(){return u}});n(44114),n(18111),n(61701),n(3362),n(42762);const i="system-admin",r="system-users",o=async e=>e.callWS({type:"config/auth/list"}),a=async(e,t,n,i)=>e.callWS({type:"config/auth/create",name:t,group_ids:n,local_only:i}),s=async(e,t,n)=>e.callWS(Object.assign(Object.assign({},n),{},{type:"config/auth/update",user_id:t})),c=async(e,t)=>e.callWS({type:"config/auth/delete",user_id:t}),l=e=>e?e.trim().split(" ").slice(0,3).map(e=>e.substring(0,1)).join(""):"?",u=(e,t,n)=>{const i=[],r=t=>e.localize(`ui.panel.config.users.${t}`);return t.is_owner&&i.push(["M12 2C6.47 2 2 6.5 2 12C2 17.5 6.5 22 12 22S22 17.5 22 12 17.5 2 12 2M12 20C7.58 20 4 16.42 4 12C4 7.58 7.58 4 12 4S20 7.58 20 12C20 16.42 16.42 20 12 20M8 14L7 8L10 10L12 7L14 10L17 8L16 14H8M8.56 16C8.22 16 8 15.78 8 15.44V15H16V15.44C16 15.78 15.78 16 15.44 16H8.56Z",r("is_owner")]),n&&t.system_generated&&i.push(["M11,7H15V9H11V11H13A2,2 0 0,1 15,13V15A2,2 0 0,1 13,17H9V15H13V13H11A2,2 0 0,1 9,11V9A2,2 0 0,1 11,7M12,2A10,10 0 0,1 22,12A10,10 0 0,1 12,22A10,10 0 0,1 2,12A10,10 0 0,1 12,2M12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20A8,8 0 0,0 20,12A8,8 0 0,0 12,4Z",r("is_system")]),t.local_only&&i.push(["M12 20C7.6 20 4 16.4 4 12S7.6 4 12 4 20 7.6 20 12 16.4 20 12 20M12 2C6.5 2 2 6.5 2 12S6.5 22 12 22 22 17.5 22 12 17.5 2 12 2M11 14H13V17H16V12H18L12 7L6 12H8V17H11V14",r("is_local")]),t.is_active||i.push(["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",r("is_not_active")]),i}},48927:function(e,t,n){n.d(t,{H:function(){return r}});n(3362),n(62953);var i=n(1087);const r=(e,t)=>new Promise(r=>{const o=t.cancel,a=t.submit;(0,i.r)(e,"show-dialog",{dialogTag:"dialog-enter-code",dialogImport:()=>n.e(29130).then(n.bind(n,24561)),dialogParams:Object.assign(Object.assign({},t),{},{cancel:()=>{r(null),o&&o()},submit:e=>{r(e),a&&a(e)}})})})},20939:function(e,t,n){n.d(t,{L:function(){return r}});n(16280),n(18111),n(61701);var i=n(78649);const r=(e,t=!0)=>{if(!e||!Array.isArray(e))throw new Error("Entities need to be an array");return e.map((e,n)=>{if("object"==typeof e&&!Array.isArray(e)&&e.type)return e;let r;if("string"==typeof e)r={entity:e};else{if("object"!=typeof e||Array.isArray(e))throw new Error(`Invalid entity ID at position ${n}`);if(!("entity"in e))throw new Error(`Object at position ${n} is missing entity field`);r=e}if(t&&!(0,i.n)(r.entity))throw new Error(`Invalid entity ID at position ${n}: ${r.entity}`);return r})}},8349:function(e,t,n){n.a(e,async function(e,i){try{n.d(t,{MJ:function(){return _},dY:function(){return C},te:function(){return w}});n(3362),n(17642),n(58004),n(33853),n(45876),n(32475),n(15024),n(31698),n(62953);var r=n(85240),o=n(97735),a=n(40205),s=n(45309),c=n(5253),l=n(63577),u=n(17747),d=n(203),h=n(68102),m=n(81643),p=n(89969),g=n(75201),f=n(34128),b=e([r,o,a,s,c,l,u,d,h,m,p,g]);[r,o,a,s,c,l,u,d,h,m,p,g]=b.then?(await b)():b;const v=new Set(["entity","entities","button","entity-button","glance","grid","section","light","sensor","thermostat","weather-forecast","tile","heading"]),y={"alarm-panel":()=>n.e(73842).then(n.bind(n,84329)),area:()=>n.e(50235).then(n.bind(n,17366)),calendar:()=>Promise.all([n.e(79996),n.e(10147),n.e(82752),n.e(83312),n.e(5012)]).then(n.bind(n,68159)),conditional:()=>n.e(77388).then(n.bind(n,51527)),"empty-state":()=>n.e(48285).then(n.bind(n,90476)),"energy-compare":()=>Promise.all([n.e(92610),n.e(77183),n.e(73618)]).then(n.bind(n,62284)),"energy-carbon-consumed-gauge":()=>Promise.all([n.e(92610),n.e(77183),n.e(77735)]).then(n.bind(n,57545)),"energy-date-selection":()=>Promise.all([n.e(92610),n.e(80827),n.e(78928),n.e(77183),n.e(7256),n.e(79352)]).then(n.bind(n,56342)),"energy-devices-graph":()=>Promise.all([n.e(92610),n.e(37552),n.e(1872),n.e(5520),n.e(77183),n.e(19260),n.e(24404)]).then(n.bind(n,78231)),"energy-devices-detail-graph":()=>Promise.all([n.e(92610),n.e(77183),n.e(19260),n.e(24301),n.e(39565)]).then(n.bind(n,93590)),"energy-distribution":()=>Promise.all([n.e(92610),n.e(77183),n.e(46239)]).then(n.bind(n,30961)),"energy-gas-graph":()=>Promise.all([n.e(92610),n.e(77183),n.e(19260),n.e(24301),n.e(43881)]).then(n.bind(n,99389)),"energy-water-graph":()=>Promise.all([n.e(92610),n.e(77183),n.e(19260),n.e(24301),n.e(6171)]).then(n.bind(n,62743)),"energy-grid-neutrality-gauge":()=>Promise.all([n.e(92610),n.e(77183),n.e(32527)]).then(n.bind(n,80449)),"energy-grid-balance":()=>Promise.all([n.e(92610),n.e(77183),n.e(75246)]).then(n.bind(n,76331)),"energy-solar-consumed-gauge":()=>Promise.all([n.e(92610),n.e(77183),n.e(22629)]).then(n.bind(n,89979)),"energy-self-sufficiency-gauge":()=>Promise.all([n.e(92610),n.e(77183),n.e(35546)]).then(n.bind(n,48196)),"energy-solar-graph":()=>Promise.all([n.e(92610),n.e(77183),n.e(19260),n.e(24301),n.e(76285)]).then(n.bind(n,32185)),"energy-sources-table":()=>Promise.all([n.e(92610),n.e(77183),n.e(97870)]).then(n.bind(n,24408)),"energy-usage-graph":()=>Promise.all([n.e(92610),n.e(77183),n.e(19260),n.e(24301),n.e(93507)]).then(n.bind(n,14207)),"energy-sankey":()=>Promise.all([n.e(92610),n.e(37552),n.e(77072),n.e(53771),n.e(72701),n.e(88156),n.e(77183),n.e(19260),n.e(48347),n.e(58597)]).then(n.bind(n,31396)),"water-sankey":()=>Promise.all([n.e(92610),n.e(37552),n.e(77072),n.e(53771),n.e(72701),n.e(88156),n.e(77183),n.e(19260),n.e(48347),n.e(85069)]).then(n.bind(n,41436)),"water-flow-sankey":()=>Promise.all([n.e(92610),n.e(37552),n.e(77072),n.e(53771),n.e(72701),n.e(88156),n.e(77183),n.e(19260),n.e(48347),n.e(37248)]).then(n.bind(n,34499)),"power-sources-graph":()=>Promise.all([n.e(92610),n.e(37552),n.e(77072),n.e(53771),n.e(1872),n.e(9970),n.e(24060),n.e(77183),n.e(19260),n.e(24301),n.e(66471)]).then(n.bind(n,40235)),"power-sankey":()=>Promise.all([n.e(92610),n.e(37552),n.e(77072),n.e(53771),n.e(72701),n.e(88156),n.e(77183),n.e(19260),n.e(48347),n.e(67518)]).then(n.bind(n,59277)),"entity-filter":()=>n.e(99104).then(n.bind(n,6275)),error:()=>Promise.resolve().then(n.bind(n,4397)),"home-summary":()=>Promise.all([n.e(92610),n.e(77183),n.e(3650),n.e(18673)]).then(n.bind(n,51687)),shortcut:()=>n.e(73044).then(n.bind(n,30175)),"discovered-devices":()=>n.e(64522).then(n.bind(n,38865)),repairs:()=>n.e(31854).then(n.bind(n,84029)),updates:()=>n.e(8550).then(n.bind(n,71154)),gauge:()=>n.e(21727).then(n.bind(n,91874)),"history-graph":()=>Promise.all([n.e(37552),n.e(77072),n.e(53771),n.e(1872),n.e(9970),n.e(24060),n.e(19260),n.e(46866),n.e(83779)]).then(n.bind(n,41544)),"horizontal-stack":()=>n.e(175).then(n.bind(n,63218)),distribution:()=>n.e(19472).then(n.bind(n,62707)),humidifier:()=>n.e(38861).then(n.bind(n,86145)),iframe:()=>n.e(44722).then(n.bind(n,56393)),logbook:()=>Promise.all([n.e(82333),n.e(23954)]).then(n.bind(n,42526)),map:()=>Promise.all([n.e(66139),n.e(70622),n.e(12122),n.e(21742)]).then(n.bind(n,22845)),markdown:()=>n.e(44619).then(n.bind(n,67334)),clock:()=>n.e(11546).then(n.bind(n,56833)),"media-control":()=>Promise.all([n.e(87941),n.e(37136)]).then(n.bind(n,92723)),"picture-elements":()=>Promise.all([n.e(99143),n.e(66990),n.e(37848)]).then(n.bind(n,63933)),"picture-entity":()=>Promise.all([n.e(99143),n.e(48412)]).then(n.bind(n,86063)),"picture-glance":()=>Promise.all([n.e(99143),n.e(37855)]).then(n.bind(n,78602)),picture:()=>n.e(85030).then(n.bind(n,30789)),"plant-status":()=>n.e(97524).then(n.bind(n,89759)),"recovery-mode":()=>Promise.all([n.e(86269),n.e(56601)]).then(n.bind(n,93132)),"toggle-group":()=>n.e(87764).then(n.bind(n,5023)),"todo-list":()=>Promise.all([n.e(52894),n.e(31355)]).then(n.bind(n,62134)),"shopping-list":()=>Promise.all([n.e(52894),n.e(31355),n.e(89235)]).then(n.bind(n,36606)),starting:()=>n.e(31946).then(n.bind(n,88785)),"statistics-graph":()=>Promise.all([n.e(92610),n.e(77183),n.e(24301),n.e(42568)]).then(n.bind(n,3515)),statistic:()=>Promise.all([n.e(92610),n.e(77183),n.e(69315)]).then(n.bind(n,89029)),"vertical-stack":()=>n.e(55989).then(n.bind(n,33204))},_=e=>(0,f.Vd)("card",e,v,y,void 0,void 0),w=e=>(0,f.Ue)("card",e,v,y,void 0,void 0),C=e=>(0,f.gh)(e,"card",v,y);i()}catch(v){i(v)}})},34128:function(e,t,n){n.d(t,{G9:function(){return a},Ni:function(){return o},Ue:function(){return u},Vd:function(){return d},gh:function(){return h}});n(16280),n(74423),n(3362),n(62953);var i=n(1087),r=n(45291);const o=e=>{const t=document.createElement("hui-error-card");return customElements.get("hui-error-card")?t.setConfig(e):(Promise.resolve().then(n.bind(n,4397)),customElements.whenDefined("hui-error-card").then(()=>{customElements.upgrade(t),t.setConfig(e)})),t},a=(e,t)=>({type:"error",error:e,origConfig:t}),s=(e,t)=>{const n=document.createElement(e);return n.setConfig(t),n},c=(e,t,i)=>"badge"===e?(e=>{const t=document.createElement("hui-error-badge");return customElements.get("hui-error-badge")?t.setConfig(e):(Promise.all([n.e(92769),n.e(3283),n.e(72130),n.e(85010),n.e(67218),n.e(98470),n.e(99788),n.e(66283),n.e(82134),n.e(45981),n.e(26092),n.e(39005),n.e(34310),n.e(59704),n.e(25322),n.e(55392),n.e(89747),n.e(71572),n.e(36332),n.e(77563),n.e(15862),n.e(99143),n.e(41344),n.e(12009),n.e(66990),n.e(3025),n.e(38108),n.e(57693),n.e(38260)]).then(n.bind(n,50655)),customElements.whenDefined("hui-error-badge").then(()=>{customElements.upgrade(t),t.setConfig(e)})),t})(a(t,i)):"heading-badge"===e?(e=>{const t=document.createElement("hui-error-heading-badge");return customElements.get("hui-error-heading-badge")?t.setConfig(e):(Promise.all([n.e(92769),n.e(3283),n.e(72130),n.e(85010),n.e(67218),n.e(98470),n.e(99788),n.e(66283),n.e(82134),n.e(45981),n.e(26092),n.e(39005),n.e(34310),n.e(59704),n.e(25322),n.e(55392),n.e(89747),n.e(71572),n.e(36332),n.e(77563),n.e(15862),n.e(99143),n.e(41344),n.e(12009),n.e(66990),n.e(3025),n.e(38108),n.e(57693),n.e(21614)]).then(n.bind(n,13469)),customElements.whenDefined("hui-error-heading-badge").then(()=>{customElements.upgrade(t),t.setConfig(e)})),t})(((e,t)=>({type:"error",error:e,origConfig:t}))(t,i)):o({type:"error",message:t}),l=e=>(0,r.c8)(e)?(0,r.Iu)(e):void 0,u=(e,t,n,i,r,o)=>{try{return d(e,t,n,i,r,o)}catch(a){return console.error(e,t.type,a),c(e,a.message,t)}},d=(e,t,n,r,o,a)=>{if(!t||"object"!=typeof t)throw new Error("Config is not an object");if(!(t.type||a||o&&"entity"in t))throw new Error("No card type configured");const u=t.type?l(t.type):void 0;if(u)return((e,t,n)=>{if(customElements.get(t))return s(t,n);const r=c(e,`Custom element doesn't exist: ${t}.`,n);if(!t.includes("-"))return r;r.style.display="None";const o=window.setTimeout(()=>{r.style.display=""},2e3);return customElements.whenDefined(t).then(()=>{clearTimeout(o),(0,i.r)(r,"ll-rebuild")}),r})(e,u,t);let d;if(o&&!t.type&&t.entity){d=`${o[t.entity.split(".",1)[0]]||o._domain_not_found}-entity`}else d=t.type||a;if(void 0===d)throw new Error("No type specified");const h=`hui-${d}-${e}`;if(r&&d in r)return r[d](),((e,t)=>{if(customElements.get(e))return s(e,t);const n=document.createElement(e);return customElements.whenDefined(e).then(()=>{try{customElements.upgrade(n),(0,i.r)(n,"ll-upgrade"),n.setConfig(t)}catch(e){(0,i.r)(n,"ll-rebuild")}}),n})(h,t);if(n&&n.has(d))return s(h,t);throw new Error(`Unknown type encountered: ${d}`)},h=async(e,t,n,i)=>{const r=l(e);if(r){const e=customElements.get(r);if(e)return e;if(!r.includes("-"))throw new Error(`Custom element not found: ${r}`);return new Promise((e,t)=>{setTimeout(()=>t(new Error(`Custom element not found: ${r}`)),2e3),customElements.whenDefined(r).then(()=>e(customElements.get(r)))})}const o=`hui-${e}-${t}`,a=customElements.get(o);if(n&&n.has(e))return a;if(i&&e in i)return a||i[e]().then(()=>customElements.get(o));throw new Error(`Unknown type: ${e}`)}},83938:function(e,t,n){n.d(t,{l:function(){return a},x:function(){return o}});n(3362),n(62953);var i=n(34128);const r={picture:()=>n.e(17813).then(n.bind(n,97588)),buttons:()=>n.e(16700).then(n.bind(n,72791)),graph:()=>n.e(33427).then(n.bind(n,67806))},o=e=>(0,i.Ue)("header-footer",e,void 0,r,void 0,void 0),a=e=>(0,i.gh)(e,"header-footer",void 0,r)},94225:function(e,t,n){n.a(e,async function(e,i){try{n.d(t,{T:function(){return y},t:function(){return _}});n(3362),n(17642),n(58004),n(33853),n(45876),n(32475),n(15024),n(31698),n(62953);var r=n(99799),o=n(29003),a=n(92055),s=n(19396),c=n(74323),l=n(51199),u=n(43721),d=n(65509),h=n(21659),m=n(82525),p=n(34128),g=e([r,o,a,s,c,l,u,d,h,m]);[r,o,a,s,c,l,u,d,h,m]=g.then?(await g)():g;const f=new Set(["media-player-entity","scene-entity","script-entity","sensor-entity","simple-entity","toggle-entity","button","call-service"]),b={"button-entity":()=>n.e(26846).then(n.bind(n,21869)),"climate-entity":()=>n.e(56995).then(n.bind(n,2798)),"cover-entity":()=>n.e(41243).then(n.bind(n,79734)),"date-entity":()=>n.e(17418).then(n.bind(n,75473)),"datetime-entity":()=>Promise.all([n.e(99194),n.e(24617),n.e(55328)]).then(n.bind(n,69690)),"event-entity":()=>Promise.resolve().then(n.bind(n,99799)),"group-entity":()=>n.e(68827).then(n.bind(n,53110)),"input-button-entity":()=>n.e(19825).then(n.bind(n,46472)),"humidifier-entity":()=>n.e(378).then(n.bind(n,53537)),"input-datetime-entity":()=>n.e(71748).then(n.bind(n,1391)),"input-number-entity":()=>n.e(17600).then(n.bind(n,58723)),"input-select-entity":()=>n.e(44325).then(n.bind(n,54596)),"input-text-entity":()=>n.e(8086).then(n.bind(n,51765)),"lock-entity":()=>n.e(28245).then(n.bind(n,49748)),"number-entity":()=>n.e(71523).then(n.bind(n,57198)),"select-entity":()=>n.e(9374).then(n.bind(n,78157)),"text-entity":()=>n.e(67973).then(n.bind(n,58212)),"time-entity":()=>Promise.all([n.e(21209),n.e(7004)]).then(n.bind(n,87550)),"timer-entity":()=>n.e(94097).then(n.bind(n,6344)),"update-entity":()=>n.e(80275).then(n.bind(n,38238)),"valve-entity":()=>n.e(96654).then(n.bind(n,46493)),conditional:()=>Promise.all([n.e(67218),n.e(77563),n.e(78490)]).then(n.bind(n,80725)),"weather-entity":()=>Promise.all([n.e(12009),n.e(77547)]).then(n.bind(n,80395)),divider:()=>n.e(45249).then(n.bind(n,38584)),section:()=>n.e(51255).then(n.bind(n,39082)),weblink:()=>n.e(69148).then(n.bind(n,65751)),cast:()=>n.e(10405).then(n.bind(n,96612)),buttons:()=>n.e(50777).then(n.bind(n,65728)),attribute:()=>Promise.resolve().then(n.bind(n,65509)),text:()=>n.e(95421).then(n.bind(n,3980))},v={_domain_not_found:"simple",alert:"toggle",automation:"toggle",button:"button",climate:"climate",cover:"cover",date:"date",datetime:"datetime",event:"event",fan:"toggle",group:"group",humidifier:"humidifier",input_boolean:"toggle",input_button:"input-button",input_datetime:"input-datetime",input_number:"input-number",input_select:"input-select",input_text:"input-text",light:"toggle",lock:"lock",media_player:"media-player",number:"number",remote:"toggle",scene:"scene",script:"script",select:"select",sensor:"sensor",siren:"toggle",switch:"toggle",text:"text",time:"time",timer:"timer",update:"update",vacuum:"toggle",valve:"valve",water_heater:"climate",weather:"weather"},y=e=>(0,p.Ue)("row",e,f,b,v,void 0),_=e=>(0,p.gh)(e,"row",f,b);i()}catch(f){i(f)}})},78305:function(e,t,n){n.a(e,async function(e,i){try{n.r(t),n.d(t,{HuiDialogSuggestCard:function(){return x}});n(18111),n(61701),n(3362),n(62953);var r=n(40445),o=n(34370),a=n.n(o),s=n(5124),c=n(67576),l=n(1087),u=n(18350),d=n(10763),h=(n(93444),n(72554)),m=n(65829),p=n(91984),g=n(14503),f=n(92255),b=n(46856),v=n(26004),y=n(36751),_=n(82360),w=n(75196),C=n(21146),A=e([u,d,h,m,b,v]);[u,d,h,m,b,v]=A.then?(await A)():A;let L,H,M,V,k,E,P,S,$=e=>e;class x extends s.WF{showDialog(e){this._params=e,this._cardConfig=e.cardConfig,this._sectionConfig=e.sectionConfig,this._open=!0,Object.isFrozen(this._cardConfig)||(this._cardConfig=a()(this._cardConfig)),Object.isFrozen(this._sectionConfig)||(this._sectionConfig=a()(this._sectionConfig)),this._yamlEditor&&this._yamlEditor.setValue(this._cardConfig)}closeDialog(){this._open=!1}_dialogClosed(){this._open=!1,this._params=void 0,this._cardConfig=void 0,(0,l.r)(this,"dialog-closed",{dialog:this.localName})}get _viewSupportsSection(){var e,t;if(null===(e=this._params)||void 0===e||!e.lovelaceConfig||null===(t=this._params)||void 0===t||!t.path)return!1;const{viewIndex:n}=(0,w.$P)(this._params.path),i=this._params.lovelaceConfig.views[n];return!(0,p.R6)(i)&&"sections"===(0,y.E)(i)}_renderPreview(){return this._sectionConfig&&this._viewSupportsSection?(0,s.qy)(L||(L=$` <div class="element-preview"> <hui-section .hass="${0}" .config="${0}" preview></hui-section> </div> `),this.hass,this._sectionConfig):this._cardConfig?(0,s.qy)(H||(H=$` <div class="element-preview"> ${0} </div> `),this._cardConfig.map(e=>(0,s.qy)(M||(M=$` <hui-card .hass="${0}" .config="${0}" preview></hui-card> `),this.hass,e))):s.s6}render(){return this._params?(0,s.qy)(V||(V=$` <ha-dialog .open="${0}" header-title="${0}" @closed="${0}"> <div> ${0} ${0} </div> <ha-dialog-footer slot="footer"> <ha-button slot="secondaryAction" @click="${0}" appearance="plain" autofocus> ${0} </ha-button> ${0} </ha-dialog-footer> </ha-dialog> `),this._open,this.hass.localize("ui.panel.lovelace.editor.suggest_card.header"),this._dialogClosed,this._renderPreview(),this._params.yaml&&this._cardConfig?(0,s.qy)(k||(k=$` <div class="editor"> <ha-yaml-editor .defaultValue="${0}" in-dialog></ha-yaml-editor> </div> `),this._cardConfig):s.s6,this.closeDialog,this._params.yaml?this.hass.localize("ui.common.close"):this.hass.localize("ui.common.cancel"),this._params.yaml?s.s6:(0,s.qy)(E||(E=$` ${0} <ha-button slot="primaryAction" .disabled="${0}" @click="${0}" .loading="${0}"> ${0} </ha-button> `),this._sectionConfig&&this._viewSupportsSection?s.s6:(0,s.qy)(P||(P=$` <ha-button appearance="plain" slot="secondaryAction" @click="${0}"> ${0} </ha-button> `),this._pickCard,this.hass.localize("ui.panel.lovelace.editor.suggest_card.create_own")),this._saving,this._save,this._saving,this.hass.localize("ui.panel.lovelace.editor.suggest_card.add"))):s.s6}static get styles(){return[g.nA,(0,s.AH)(S||(S=$`ha-dialog{--dialog-z-index:6}.hidden{display:none}.element-preview{position:relative}hui-card,hui-section{padding-top:8px;margin:4px auto;max-width:390px;display:block;width:100%}.editor{padding-top:16px}`))]}_pickCard(){var e,t,n;null!==(e=this._params)&&void 0!==e&&e.lovelaceConfig&&null!==(t=this._params)&&void 0!==t&&t.path&&null!==(n=this._params)&&void 0!==n&&n.saveConfig&&((0,C.u)(this,{lovelaceConfig:this._params.lovelaceConfig,saveConfig:this._params.saveConfig,path:this._params.path,entities:this._params.entities}),this.closeDialog())}_computeNewConfig(e,t){if(!this._viewSupportsSection)return(0,_.DU)(e,t,this._cardConfig);const{viewIndex:n,sectionIndex:i}=(0,w.$P)(t);if(void 0===i){var r;const t=null!==(r=this._sectionConfig)&&void 0!==r?r:{type:"grid",cards:this._cardConfig};return(0,_.Bn)(e,n,t)}const o=this._sectionConfig?this._sectionConfig.cards||[]:this._cardConfig;return(0,_.DU)(e,[n,i],o)}async _save(){var e,t,n;if(!(null!==(e=this._params)&&void 0!==e&&e.lovelaceConfig&&null!==(t=this._params)&&void 0!==t&&t.path&&null!==(n=this._params)&&void 0!==n&&n.saveConfig&&this._cardConfig))return;this._saving=!0;const i=this._computeNewConfig(this._params.lovelaceConfig,this._params.path);await this._params.saveConfig(i),this._saving=!1,(0,f.f)(this,this.hass),this.closeDialog()}constructor(...e){super(...e),this._open=!1,this._saving=!1}}(0,r.Cg)([(0,c.MZ)({attribute:!1})],x.prototype,"hass",void 0),(0,r.Cg)([(0,c.wk)()],x.prototype,"_params",void 0),(0,r.Cg)([(0,c.wk)()],x.prototype,"_open",void 0),(0,r.Cg)([(0,c.wk)()],x.prototype,"_cardConfig",void 0),(0,r.Cg)([(0,c.wk)()],x.prototype,"_sectionConfig",void 0),(0,r.Cg)([(0,c.wk)()],x.prototype,"_saving",void 0),(0,r.Cg)([(0,c.P)("ha-yaml-editor")],x.prototype,"_yamlEditor",void 0),x=(0,r.Cg)([(0,c.EM)("hui-dialog-suggest-card")],x),i()}catch(L){i(L)}})},15656:function(e,t,n){n.d(t,{Nu:function(){return m},TG:function(){return y},Xd:function(){return f},d4:function(){return v},uN:function(){return g},xC:function(){return b}});var i=n(86518);n(16280),n(18111),n(61701),n(3362),n(62953);if(59509==n.j)var r=n(28918);if(59509==n.j)var o=n(35952);var a=n(91984),s=n(53338);const c=59509==n.j?["strategy"]:null,l=59509==n.j?["strategy"]:null,u=["strategy"],d="custom:",h={dashboard:{"original-states":()=>n.e(60134).then(n.bind(n,43845)),map:()=>n.e(74994).then(n.bind(n,56009)),iframe:()=>n.e(1732).then(n.bind(n,38287)),areas:()=>Promise.all([n.e(99788),n.e(59704),n.e(25322),n.e(12009),n.e(20282),n.e(9209)]).then(n.bind(n,80821)),home:()=>Promise.all([n.e(99788),n.e(59704),n.e(25322),n.e(12009),n.e(20282),n.e(3650),n.e(86201)]).then(n.bind(n,67293)),energy:()=>Promise.all([n.e(67218),n.e(92610),n.e(7483),n.e(77183),n.e(19343)]).then(n.bind(n,94429))},view:{"original-states":()=>Promise.all([n.e(67218),n.e(92610),n.e(662),n.e(77183),n.e(94530)]).then(n.bind(n,16330)),"energy-overview":()=>Promise.all([n.e(67218),n.e(92610),n.e(7483),n.e(77183),n.e(51016)]).then(n.bind(n,3260)),energy:()=>Promise.all([n.e(67218),n.e(92610),n.e(7483),n.e(77183),n.e(20984)]).then(n.bind(n,86242)),water:()=>Promise.all([n.e(67218),n.e(92610),n.e(7483),n.e(77183),n.e(8969)]).then(n.bind(n,88615)),gas:()=>Promise.all([n.e(67218),n.e(92610),n.e(7483),n.e(77183),n.e(17423)]).then(n.bind(n,21733)),power:()=>Promise.all([n.e(67218),n.e(92610),n.e(7483),n.e(77183),n.e(17879)]).then(n.bind(n,60093)),map:()=>n.e(6875).then(n.bind(n,14966)),iframe:()=>n.e(73441).then(n.bind(n,51480)),area:()=>Promise.all([n.e(99788),n.e(59704),n.e(25322),n.e(12009),n.e(20282),n.e(74271)]).then(n.bind(n,44979)),"areas-overview":()=>Promise.all([n.e(99788),n.e(59704),n.e(25322),n.e(12009),n.e(20282),n.e(88964)]).then(n.bind(n,69140)),"home-overview":()=>Promise.all([n.e(67218),n.e(92610),n.e(99788),n.e(45193),n.e(77183),n.e(59704),n.e(25322),n.e(12009),n.e(20282),n.e(3650),n.e(58709)]).then(n.bind(n,8892)),"home-media-players":()=>Promise.all([n.e(99788),n.e(59704),n.e(25322),n.e(12009),n.e(20282),n.e(3650),n.e(59022)]).then(n.bind(n,24876)),"home-area":()=>Promise.all([n.e(99788),n.e(59704),n.e(25322),n.e(12009),n.e(20282),n.e(3650),n.e(50362)]).then(n.bind(n,47302)),"home-other-devices":()=>n.e(27800).then(n.bind(n,78859)),light:()=>Promise.all([n.e(99788),n.e(59704),n.e(25322),n.e(12009),n.e(20282),n.e(71780)]).then(n.bind(n,71776)),security:()=>Promise.all([n.e(99788),n.e(59704),n.e(25322),n.e(12009),n.e(20282),n.e(34442)]).then(n.bind(n,31758)),climate:()=>Promise.all([n.e(99788),n.e(59704),n.e(25322),n.e(12009),n.e(20282),n.e(98874)]).then(n.bind(n,73026)),maintenance:()=>n.e(82691).then(n.bind(n,78030))},section:{"common-controls":()=>n.e(8717).then(n.bind(n,44124))}},m=async(e,t)=>{var n;if(t in h[e]){await h[e][t]();const n=`${t}-${e}-strategy`;return customElements.get(n)}if(!t.startsWith(d))throw new Error("Unknown strategy");const i=`ll-strategy-${t.slice(7)}`,r=`ll-strategy-${e}-${t.slice(7)}`;if(!0===await Promise.race([customElements.whenDefined(i),customElements.whenDefined(r),new Promise(e=>{setTimeout(()=>e(!0),5e3)})]))throw new Error(`Timeout waiting for strategy element ${r} to be registered`);return null!==(n=customElements.get(r))&&void 0!==n?n:customElements.get(i)},p=async(e,t,n,i)=>{const r=n.type;if(!r)return t("No strategy type found");try{const t=await m(e,r);if((0,s.Xo)(t)){if("dashboard"===e&&"generateDashboard"in t)return await t.generateDashboard({config:{strategy:n,views:[]},hass:i});if("view"===e&&"generateView"in t)return await t.generateView({config:{views:[]},view:{strategy:n},hass:i})}const o=(0,s._V)(n);return await t.generate(o,i)}catch(o){return"timeout"!==o.message&&console.error(o),t(o)}},g=async(e,t)=>{const{strategy:n}=e,r=(0,i.A)(e,c),o=await p("dashboard",e=>({views:[{title:"Error",cards:[{type:"markdown",content:`Error loading the dashboard strategy:\n> ${e}`}]}]}),n,t);return Object.assign(Object.assign({},r),o)},f=async(e,t)=>{const{strategy:n}=e,r=(0,i.A)(e,l),o=await p("view",e=>({cards:[{type:"markdown",content:`Error loading the view strategy:\n> ${e}`}]}),n,t);return Object.assign(Object.assign({},r),o)},b=async(e,t)=>{const{strategy:n}=e,r=(0,i.A)(e,u),o=await p("section",e=>({cards:[{type:"markdown",content:`Error loading the section strategy:\n> ${e}`}]}),n,t);return Object.assign(Object.assign({},r),o)},v=async(e,t)=>{const n=(0,o.Wu)(e)?await g(e,t):Object.assign({},e);return n.views=await Promise.all(n.views.map(async e=>{const n=(0,a.R6)(e)?await f(e,t):Object.assign({},e);return n.sections&&(n.sections=await Promise.all(n.sections.map(async e=>(0,r.H)(e)?await b(e,t):Object.assign({},e)))),n})),n};async function y(e,t){const n=await m("dashboard",t),i=await async function(e,t){const n=t.getCreateSuggestions;if("function"==typeof n)return n.call(t,e)}(e,n);return{strategyClass:n,fieldSuggestions:i}}},53338:function(e,t,n){n.d(t,{B2:function(){return r},Xo:function(){return i},_V:function(){return o}});const i=e=>!("generate"in e),r=e=>2===Object.keys(e).length&&"options"in e&&"object"==typeof e.options,o=e=>{if(!r(e))return e;const t=Object.assign(Object.assign({},e),e.options);return delete t.options,t}},49365:function(e,t,n){n.d(t,{NT:function(){return i},_H:function(){return o},oH:function(){return r}});const i="masonry",r="sidebar",o="sections"},36751:function(e,t,n){n.d(t,{E:function(){return r}});var i=n(49365);const r=e=>null!=e&&e.type?e.type:null!=e&&e.panel?"panel":null!=e&&e.sections?i._H:null!=e&&e.cards?i.NT:i._H},36918:function(e,t,n){n.d(t,{o:function(){return i}});const i=(e,t)=>`https://www.iobroker.net/#${e.language&&e.language.split("-")[0]||"en"}/adapters/adapterref/iobroker.lovelace/README.md#`},92255:function(e,t,n){n.d(t,{f:function(){return r}});var i=n(81619);const r=(e,t)=>(0,i.P)(e,{message:t.localize("ui.common.successfully_saved")})}}]);