iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
28 lines • 54.6 kB
JavaScript
export const __rspack_esm_id=1945;export const __rspack_esm_ids=[1945];export const __webpack_modules__={16629(e,t,i){i.d(t,{E7:()=>u,Mn:()=>o,P9:()=>l,lf:()=>h});i(18111),i(61701);var r=i(63004);const o=e=>{const t=e/100;return[Math.round(a(t)),Math.round(n(t)),Math.round(s(t))]},a=e=>{if(e<=66)return 255;const t=329.698727446*(e-60)**-.1332047592;return(0,r.q)(t,0,255)},n=e=>{let t;return t=e<=66?99.4708025861*Math.log(e)-161.1195681661:288.1221695283*(e-60)**-.0755148492,(0,r.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,r.q)(t,0,255)},c=(e,t)=>{const i=Math.max(...e),r=Math.max(...t);let o;return o=0===r?0:i/r,t.map(e=>Math.round(e*o))},l=e=>0===e?1e6:Math.floor(1e6/e),d=e=>0===e?1e6:Math.floor(1e6/e),h=(e,t,i)=>{const[r,a,n,s,h]=e,u=d(t??2700),m=d(i??6500),p=u-m;let g;try{g=h/(s+h)}catch(e){g=.5}const b=m+g*p,y=b?l(b):0,[_,v,f]=o(y),w=Math.max(s,h)/255;return c([r,a,n,s,h],[r+_*w,a+v*w,n+f*w])},u=e=>{const[t,i,r,o]=e;return c([t,i,r,o],[t+o,i+o,r+o])}},93421(e,t,i){i.d(t,{IW:()=>d,dH:()=>l,fI:()=>c});i(44114);var r=i(35211),o=i(22792),a=i(32172);const n=(e,t)=>{let i=e;for(const e of t){if(null==i)return;i=i[e]}return i},s=(e,t,i)=>{const o=(0,a.p)({transformer:function(e){return i.call(this,e)},watch:t?[t]:[]}),n=(0,r.Fg)({context:e,subscribe:!0});return(e,t)=>{o(e,t),n(e,t)}},c=e=>s(o.iN,e.entityIdPath[0],function(t){const i=n(this,e.entityIdPath);return"string"==typeof i?t?.[i]:void 0}),l=e=>s(o.X1,e.entityIdPath[0],function(t){const i=n(this,e.entityIdPath);return"string"==typeof i?t?.[i]:void 0}),d=()=>s(o.D5,void 0,({localize:e})=>e)},4423(e,t,i){i.d(t,{B:()=>c,r:()=>s});i(44114),i(18111),i(13579),i(17642),i(58004),i(33853),i(45876),i(32475),i(15024),i(31698);var r=i(44537),o=i(71727),a=i(28455);const n=e=>{if(void 0!==e)return null===e?new Set([null]):new Set((0,r.e)(e))},s=(e,t)=>{const i=t.domain?new Set((0,r.e)(t.domain)):void 0,s=t.hidden_domains?new Set((0,r.e)(t.hidden_domains)):void 0,c=t.device_class?new Set((0,r.e)(t.device_class)):void 0,l=n(t.floor),d=n(t.area),h=n(t.device),u=t.entity_category?new Set((0,r.e)(t.entity_category)):void 0,m=t.label?new Set((0,r.e)(t.label)):void 0,p=t.hidden_platform?new Set((0,r.e)(t.hidden_platform)):void 0;return t=>{const r=e.states[t];if(!r)return!1;if(i||s){const e=(0,o.m)(t);if(i&&!i.has(e))return!1;if(s&&s.has(e))return!1}if(c){const e=r.attributes.device_class||"none";if(!c.has(e))return!1}const{area:n,floor:g,device:b,entity:y}=(0,a.ln)(r,e.entities,e.devices,e.areas,e.floors);if(y&&y.hidden)return!1;if(l){const e=g?.floor_id??null;if(!l.has(e))return!1}if(d){const e=n?.area_id??null;if(!d.has(e))return!1}if(h){const e=b?.id??null;if(!h.has(e))return!1}if(m){if(!y)return!1;if(!y.labels.some(e=>m.has(e)))return!1}if(u){const e=y?.entity_category||"none";if(!u.has(e))return!1}if(p){if(!y)return!1;if(y.platform&&p.has(y.platform))return!1}return!0}},c=(e,t)=>{const i=new Set,r=[];for(const o of t)for(const t of e)o(t)&&!i.has(t)&&(i.add(t),r.push(t));return r}},31290(e,t,i){i.d(t,{n:()=>r});const r=e=>e.replace(/^_*(.)|_+(.)/g,(e,t,i)=>t?t.toUpperCase():" "+i.toUpperCase())},17399(e,t,i){i.d(t,{W:()=>r});const r=e=>{const t=e.trim();let i,r;return t.endsWith("ms")?(i=parseFloat(t.slice(0,-2)),r=1):t.endsWith("s")?(i=parseFloat(t.slice(0,-1)),r=1e3):(i=parseFloat(t),r=1),!isFinite(i)||i<0?0:i*r}},58139(e,t,i){i.d(t,{d:()=>r,t:()=>o});const r=async(e,t)=>new Promise(i=>{const r=t(e,e=>{r(),i(e)})}),o=async e=>new Promise(t=>{const i=e.subscribe(e=>{i(),t(e)})})},60353(e,t,i){i.d(t,{u:()=>r});class r{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={}){this._startY=0,this._delta=0,this._startTime=0,this._lastY=0,this._lastTime=0,this._velocityThreshold=e.velocitySwipeThreshold??.5,this._movementTimeThreshold=e.movementTimeThreshold??100}}},38962(e,t,i){i.a(e,async function(e,r){try{i.r(t);var o=i(62826),a=i(5124),n=i(22441),s=i(6412),c=i(93421),l=i(1087),d=i(26300),h=(i(67094),e([d]));d=(h.then?(await h)():h)[0];const u="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",m={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 p extends a.WF{render(){return a.qy` <div class="issue-type ${(0,s.H)({[this.alertType]:!0})}" role="alert"> <div class="icon ${this.title?"":"no-title"}"> <slot name="icon"> <ha-svg-icon .path="${m[this.alertType]}"></ha-svg-icon> </slot> </div> <div class="${(0,s.H)({content:!0,narrow:this.narrow})}"> <div class="main-content"> ${this.title?a.qy`<div class="title">${this.title}</div>`:a.s6} <slot></slot> </div> <div class="action"> <slot name="action"> ${this.dismissable?a.qy`<ha-icon-button @click="${this._dismissClicked}" .label="${this._localize?.("ui.common.dismiss_alert")}" .path="${u}"></ha-icon-button>`:a.s6} </slot> </div> </div> </div> `}_dismissClicked(){(0,l.r)(this,"alert-dismissed-clicked")}constructor(...e){super(...e),this.title="",this.alertType="info",this.dismissable=!1,this.narrow=!1}}p.styles=a.AH`.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,o.Cg)([(0,n.MZ)()],p.prototype,"title",void 0),(0,o.Cg)([(0,n.MZ)({attribute:"alert-type"})],p.prototype,"alertType",void 0),(0,o.Cg)([(0,n.MZ)({type:Boolean})],p.prototype,"dismissable",void 0),(0,o.Cg)([(0,n.wk)(),(0,c.IW)()],p.prototype,"_localize",void 0),(0,o.Cg)([(0,n.MZ)({type:Boolean})],p.prototype,"narrow",void 0),p=(0,o.Cg)([(0,n.EM)("ha-alert")],p),r()}catch(e){r(e)}})},9503(e,t,i){var r=i(62826),o=i(97577),a=i(5124),n=i(22441);class s extends o.A{get value(){return this._value??null}set value(e){this._value=e}static get styles(){return[o.A.styles,a.AH`: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))}`]}}s=(0,r.Cg)([(0,n.EM)("ha-checkbox")],s)},43661(e,t,i){i.r(t),i.d(t,{HaIconNext:()=>s});var r=i(62826),o=i(22441),a=i(63091),n=i(67094);class s extends n.HaSvgIcon{constructor(...e){super(...e),this.path="rtl"===a.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,r.Cg)([(0,o.MZ)()],s.prototype,"path",void 0),s=(0,r.Cg)([(0,o.EM)("ha-icon-next")],s)},59646(e,t,i){i.a(e,async function(e,t){try{var r=i(62826),o=i(29344),a=i(5124),n=i(22441),s=i(88360),c=e([o]);o=(c.then?(await c)():c)[0];class l extends o.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[o.A.styles,a.AH`: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,r.Cg)([(0,n.MZ)({type:Boolean})],l.prototype,"haptic",void 0),l=(0,r.Cg)([(0,n.EM)("ha-switch")],l),t()}catch(e){t(e)}})},82e3(e,t,i){i.d(t,{D5:()=>r,Fy:()=>n,Gk:()=>l,Hg:()=>o,Y_:()=>d,ds:()=>c,e0:()=>a,ec:()=>s});i(74423),i(18111),i(61701),i(33110);const r=14881==i.j?`${location.protocol}//${location.host}`:null,o=e=>e.map(e=>{if("string"!==e.type)return e;switch(e.name){case"username":return{...e,autocomplete:"username",autofocus:!0};case"password":return{...e,autocomplete:"current-password"};case"code":return{...e,autocomplete:"one-time-code",autofocus:!0};default:return e}}),a=(e,t)=>e.callWS({type:"auth/sign_path",path:t}),n=async(e,t,i,r)=>e.callWS({type:"config/auth_provider/homeassistant/create",user_id:t,username:i,password:r}),s=(e,t,i)=>e.callWS({type:"config/auth_provider/homeassistant/change_password",current_password:t,new_password:i}),c=(e,t,i)=>e.callWS({type:"config/auth_provider/homeassistant/admin_change_password",user_id:t,password:i}),l=(e,t,i)=>e.callWS({type:"config/auth_provider/homeassistant/admin_change_username",user_id:t,username:i}),d=(e,t,i)=>e.callWS({type:"auth/delete_all_refresh_tokens",token_type:t,delete_current_token:i})},10897(e,t,i){i.d(t,{C4:()=>l,CK:()=>c,FX:()=>g,UC:()=>m,_Z:()=>v,bT:()=>f,j4:()=>y,sd:()=>a,su:()=>s,vc:()=>_,w8:()=>u,wv:()=>h,y3:()=>p,zS:()=>n});var r=i(3931),o=i(82e3);const a=[1,2,3,4,6,8],n="web_rtc",s=(e,t,i)=>`${e}&width=${t}&height=${i}`,c=e=>e.attributes.access_token?`/api/camera_proxy_stream/${e.entity_id}?token=${e.attributes.access_token}`:void 0,l=async(e,t,i,o)=>{const a=await(0,r.U)("_cameraTmbUrl",9e3,d,e,t);return s(a,i,o)},d=async(e,t)=>{const i=await(0,o.e0)(e,`/api/camera_proxy/${t}`);return e.hassUrl(i.path)},h=async(e,t,i)=>{const r={type:"camera/stream",entity_id:t};i&&(r.format=i);const o=await e.callWS(r);return o.url=e.hassUrl(o.url),o},u=(e,t,i,r)=>e.connection.subscribeMessage(r,{type:"camera/webrtc/offer",entity_id:t,offer:i}),m=(e,t,i,r)=>e.callWS({type:"camera/webrtc/candidate",entity_id:t,session_id:i,candidate:r}),p=(e,t)=>e.callWS({type:"camera/get_prefs",entity_id:t}),g=(e,t,i)=>e.callWS({type:"camera/update_prefs",entity_id:t,...i}),b="media-source://camera/",y=e=>e.startsWith(b),_=e=>e.substring(22),v=async(e,t)=>e.callWS({type:"camera/capabilities",entity_id:t}),f=async(e,t)=>e.callWS({type:"camera/webrtc/get_client_config",entity_id:t})},38395(e,t,i){i.d(t,{gh:()=>c,kU:()=>l,q:()=>s});var r=i(35518),o=i(62384),a=i(61557);function n(e){return document.cookie=`ingress_session=${e};path=/api/hassio_ingress/;SameSite=Strict${"https:"===location.protocol?";Secure":""}`,e}const s=async e=>{if((0,o.v)(e.config.version,2021,2,4)){return n((await e.callWS({type:"supervisor/api",endpoint:"/ingress/session",method:"post"})).session)}return n((await e.callApi("POST","hassio/ingress/session")).data.session)},c=e=>(0,r.X)(e,"_ingressPanelInfo",async e=>(await(0,a.uw)(e,{endpoint:"/ingress/panels"})).panels),l=async(e,t)=>{(0,o.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(e,t,i){i.d(t,{EG:()=>a,ML:()=>n});var r=i(35518),o=i(35952);const a=(e,t,i)=>e.subscribeEvents(e=>{e.data.url_path===t&&i()},"lovelace_updated"),n=(e,t=null)=>(0,r.X)(e,`_lovelace_${t??""}`,e=>(0,o.Dz)(e,t,!1),(i,r)=>a(e,t,()=>(0,o.Dz)(e,t,!1).then(e=>r.setState(e,!0))))},28918(e,t,i){i.d(t,{H:()=>o,o:()=>r});function r(e){return"boolean"==typeof e?e?{}:void 0:e}function o(e){return"strategy"in e}},91984(e,t,i){i.d(t,{R6:()=>o,TQ:()=>a,cg:()=>n});var r=i(31290);function o(e){return"strategy"in e}const a=(e,t)=>e.title??(e.path?(0,r.n)(e.path):String(t)),n=e=>e.icon??"mdi:view-compact"},45291(e,t,i){i.d(t,{IP:()=>r,Iu:()=>h,J_:()=>a,O9:()=>s,b$:()=>l,bH:()=>n,c8:()=>d,wi:()=>c});i(18111),i(20116);const r="custom:",o=window;"customCards"in o||(o.customCards=[]),"customCardFeatures"in o||(o.customCardFeatures=[]),"customBadges"in o||(o.customBadges=[]),"customTileFeatures"in o||(o.customTileFeatures=[]);const a=o.customCards,n=()=>[...o.customCardFeatures,...o.customTileFeatures],s=o.customBadges,c=e=>a.find(t=>t.type===e),l=e=>s.find(t=>t.type===e),d=e=>e.startsWith(r),h=e=>e.slice(r.length)},53072(e,t,i){i.d(t,{$6:()=>y,EC:()=>g,ET:()=>b,H1:()=>p,HN:()=>w,Im:()=>H,QI:()=>C,Un:()=>v,Xm:()=>f,ce:()=>L,fh:()=>M,ie:()=>A,mm:()=>_,vj:()=>m});i(44114);var r=i(47129),o=i(82286),a=i(22675),n=i(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",d="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",h="M18,18H6V6H18V18Z",u="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:u,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:u,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:u,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:u,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}},b=(e,t,i,r)=>e.callWS({type:"media_player/browse_media",entity_id:t,media_content_id:i,media_content_type:r}),y=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)},_=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},v=(e,t=!1)=>{if(!e)return;const i=e.state;if(i===a.Hh)return;const n=!0===e.attributes.assumed_state;if(!(0,r.a)(e)&&!n)return(0,o.$)(e,128)?[{icon:d,action:"turn_on"}]:void 0;const s=[];n&&(0,o.$)(e,128)&&s.push({icon:"M11,3H13V21H11V3Z",action:"turn_on"}),(0,o.$)(e,256)&&s.push({icon:n?"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":d,action:"turn_off"});const u=e.attributes;return("playing"===i||"paused"===i||n)&&(0,o.$)(e,32768)&&t&&s.push({icon:!0===u.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"===i||"paused"===i||n)&&(0,o.$)(e,16)&&s.push({icon:"M6,18V6H8V18H6M9.5,12L18,6V18L9.5,12Z",action:"media_previous_track"}),!n&&("playing"===i&&((0,o.$)(e,1)||(0,o.$)(e,4096))||("paused"===i||"idle"===i)&&(0,o.$)(e,16384)||"on"===i&&((0,o.$)(e,16384)||(0,o.$)(e,1)))&&s.push({icon:"on"===i?"M3,5V19L11,12M13,19H16V5H13M18,5V19H21V5":"playing"!==i?l:(0,o.$)(e,1)?c:h,action:"playing"!==i?"media_play":(0,o.$)(e,1)?"media_pause":"media_stop"}),n&&(0,o.$)(e,16384)&&s.push({icon:l,action:"media_play"}),n&&(0,o.$)(e,1)&&s.push({icon:c,action:"media_pause"}),n&&(0,o.$)(e,4096)&&s.push({icon:h,action:"media_stop"}),("playing"===i||"paused"===i||n)&&(0,o.$)(e,32)&&s.push({icon:"M16,18H18V6H16M6,18L14.5,12L6,6V18Z",action:"media_next_track"}),("playing"===i||"paused"===i||n)&&(0,o.$)(e,262144)&&t&&s.push({icon:"all"===u.repeat?"M17,17H7V14L3,18L7,22V19H19V13H17M7,7H17V10L21,6L17,2V5H5V11H7V7Z":"one"===u.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},f=e=>{if(void 0===e||e===1/0)return"";const t=Math.max(0,Math.floor(e)),i=Math.floor(t/3600),r=Math.floor(t%3600/60),o=t%60,a=e=>e.toString().padStart(2,"0");return i>0?`${a(i)}:${a(r)}:${a(o)}`:`${a(r)}:${a(o)}`},w=e=>{if(!e)return;const t=e.indexOf("?authSig=");let i=t>0?e.slice(0,t):e;return i.startsWith("http")&&(i=decodeURIComponent(i.split("/").pop())),i},C=(e,t,i)=>e.callService("media_player","volume_set",{entity_id:t,volume_level:i}),L=(e,t,i)=>e.callService("media_player",i,"shuffle_set"===i?{entity_id:t.entity_id,shuffle:!t.attributes.shuffle}:"repeat_set"===i?{entity_id:t.entity_id,repeat:"all"===t.attributes.repeat?"one":"off"===t.attributes.repeat?"all":"off"}:{entity_id:t.entity_id}),A=(e,t,i,r,o={})=>(!o.enqueue&&void 0===o.announce&&(0,n.ni)(i)&&(o.announce=!0),e.callService("media_player","play_media",{entity_id:t,media_content_id:i,media_content_type:r,...o})),H=(e,t,i)=>e.callService("media_player","join",{group_members:i},{entity_id:t}),M=(e,t)=>e.callService("media_player","unjoin",{},{entity_id:t})},28669(e,t,i){i.d(t,{TK:()=>s,_2:()=>l,eR:()=>o,hG:()=>c,hU:()=>a,kg:()=>n,wj:()=>r,xg:()=>d});i(44114),i(18111),i(61701);const r="system-admin",o="system-users",a=async e=>e.callWS({type:"config/auth/list"}),n=async(e,t,i,r)=>e.callWS({type:"config/auth/create",name:t,group_ids:i,local_only:r}),s=async(e,t,i)=>e.callWS({...i,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(""):"?",d=(e,t,i)=>{const r=[],o=t=>e.localize(`ui.panel.config.users.${t}`);return t.is_owner&&r.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",o("is_owner")]),i&&t.system_generated&&r.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",o("is_system")]),t.local_only&&r.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",o("is_local")]),t.is_active||r.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",o("is_not_active")]),r}},20939(e,t,i){i.d(t,{L:()=>o});i(18111),i(61701);var r=i(78649);const o=(e,t=!0)=>{if(!e||!Array.isArray(e))throw new Error("Entities need to be an array");return e.map((e,i)=>{if("object"==typeof e&&!Array.isArray(e)&&e.type)return e;let o;if("string"==typeof e)o={entity:e};else{if("object"!=typeof e||Array.isArray(e))throw new Error(`Invalid entity ID at position ${i}`);if(!("entity"in e))throw new Error(`Object at position ${i} is missing entity field`);o=e}if(t&&!(0,r.n)(o.entity))throw new Error(`Invalid entity ID at position ${i}: ${o.entity}`);return o})}},8349(e,t,i){i.a(e,async function(e,r){try{i.d(t,{MJ:()=>f,dY:()=>C,te:()=>w});i(17642),i(58004),i(33853),i(45876),i(32475),i(15024),i(31698);var o=i(85240),a=i(97735),n=i(40205),s=i(45309),c=i(5253),l=i(63577),d=i(17747),h=i(203),u=i(68102),m=i(81643),p=i(89969),g=i(75201),b=i(34128),y=e([o,a,n,s,c,l,d,h,u,m,p,g]);[o,a,n,s,c,l,d,h,u,m,p,g]=y.then?(await y)():y;const _=new Set(["entity","entities","button","entity-button","glance","grid","section","light","sensor","thermostat","weather-forecast","tile","heading"]),v={"alarm-panel":()=>i.e(73842).then(i.bind(i,84329)),area:()=>i.e(50235).then(i.bind(i,17366)),calendar:()=>Promise.all([i.e(79996),i.e(10147),i.e(82752),i.e(83312),i.e(5012)]).then(i.bind(i,68159)),conditional:()=>i.e(77388).then(i.bind(i,51527)),"empty-state":()=>i.e(48285).then(i.bind(i,90476)),"energy-compare":()=>Promise.all([i.e(92610),i.e(77183),i.e(73618)]).then(i.bind(i,62284)),"energy-carbon-consumed-gauge":()=>Promise.all([i.e(92610),i.e(77183),i.e(77735)]).then(i.bind(i,57545)),"energy-date-selection":()=>Promise.all([i.e(92610),i.e(80827),i.e(16704),i.e(77183),i.e(7256),i.e(71483)]).then(i.bind(i,56342)),"energy-devices-graph":()=>Promise.all([i.e(92610),i.e(37552),i.e(1872),i.e(5520),i.e(77183),i.e(19260),i.e(24404)]).then(i.bind(i,78231)),"energy-devices-detail-graph":()=>Promise.all([i.e(92610),i.e(77183),i.e(19260),i.e(24301),i.e(39565)]).then(i.bind(i,71209)),"energy-distribution":()=>Promise.all([i.e(92610),i.e(77183),i.e(46239)]).then(i.bind(i,30961)),"energy-gas-graph":()=>Promise.all([i.e(92610),i.e(77183),i.e(19260),i.e(24301),i.e(43881)]).then(i.bind(i,99389)),"energy-water-graph":()=>Promise.all([i.e(92610),i.e(77183),i.e(19260),i.e(24301),i.e(6171)]).then(i.bind(i,62743)),"energy-grid-neutrality-gauge":()=>Promise.all([i.e(92610),i.e(77183),i.e(32527)]).then(i.bind(i,80449)),"energy-grid-balance":()=>Promise.all([i.e(92610),i.e(77183),i.e(75246)]).then(i.bind(i,76331)),"energy-solar-consumed-gauge":()=>Promise.all([i.e(92610),i.e(77183),i.e(22629)]).then(i.bind(i,89979)),"energy-self-sufficiency-gauge":()=>Promise.all([i.e(92610),i.e(77183),i.e(35546)]).then(i.bind(i,48196)),"energy-solar-graph":()=>Promise.all([i.e(92610),i.e(77183),i.e(19260),i.e(24301),i.e(76285)]).then(i.bind(i,32185)),"energy-sources-table":()=>Promise.all([i.e(92610),i.e(77183),i.e(97870)]).then(i.bind(i,24408)),"energy-usage-graph":()=>Promise.all([i.e(92610),i.e(77183),i.e(19260),i.e(24301),i.e(93507)]).then(i.bind(i,14207)),"energy-sankey":()=>Promise.all([i.e(92610),i.e(37552),i.e(77072),i.e(53771),i.e(72701),i.e(88156),i.e(77183),i.e(19260),i.e(48347),i.e(58597)]).then(i.bind(i,31396)),"water-sankey":()=>Promise.all([i.e(92610),i.e(37552),i.e(77072),i.e(53771),i.e(72701),i.e(88156),i.e(77183),i.e(19260),i.e(48347),i.e(85069)]).then(i.bind(i,41436)),"water-flow-sankey":()=>Promise.all([i.e(92610),i.e(37552),i.e(77072),i.e(53771),i.e(72701),i.e(88156),i.e(77183),i.e(19260),i.e(48347),i.e(37248)]).then(i.bind(i,34499)),"power-sources-graph":()=>Promise.all([i.e(92610),i.e(37552),i.e(77072),i.e(53771),i.e(1872),i.e(9970),i.e(24060),i.e(77183),i.e(19260),i.e(24301),i.e(66471)]).then(i.bind(i,40235)),"power-sankey":()=>Promise.all([i.e(92610),i.e(37552),i.e(77072),i.e(53771),i.e(72701),i.e(88156),i.e(77183),i.e(19260),i.e(48347),i.e(67518)]).then(i.bind(i,59277)),"entity-filter":()=>i.e(99104).then(i.bind(i,6275)),error:()=>Promise.resolve().then(i.bind(i,4397)),"home-summary":()=>Promise.all([i.e(92610),i.e(77183),i.e(3650),i.e(18673)]).then(i.bind(i,51687)),shortcut:()=>i.e(73044).then(i.bind(i,30175)),"discovered-devices":()=>i.e(64522).then(i.bind(i,38865)),repairs:()=>i.e(31854).then(i.bind(i,84029)),updates:()=>i.e(8550).then(i.bind(i,71154)),gauge:()=>i.e(21727).then(i.bind(i,91874)),"history-graph":()=>Promise.all([i.e(37552),i.e(77072),i.e(53771),i.e(1872),i.e(9970),i.e(24060),i.e(19260),i.e(46866),i.e(83779)]).then(i.bind(i,41544)),"horizontal-stack":()=>i.e(175).then(i.bind(i,63218)),distribution:()=>i.e(19472).then(i.bind(i,62707)),humidifier:()=>i.e(38861).then(i.bind(i,86145)),iframe:()=>i.e(44722).then(i.bind(i,56393)),logbook:()=>Promise.all([i.e(82333),i.e(23954)]).then(i.bind(i,42526)),map:()=>Promise.all([i.e(87451),i.e(12122),i.e(21742)]).then(i.bind(i,22845)),markdown:()=>i.e(44619).then(i.bind(i,67334)),clock:()=>i.e(11546).then(i.bind(i,56833)),"media-control":()=>Promise.all([i.e(87941),i.e(37136)]).then(i.bind(i,92723)),"picture-elements":()=>Promise.all([i.e(99143),i.e(66990),i.e(37848)]).then(i.bind(i,63933)),"picture-entity":()=>Promise.all([i.e(99143),i.e(48412)]).then(i.bind(i,86063)),"picture-glance":()=>Promise.all([i.e(99143),i.e(37855)]).then(i.bind(i,78602)),picture:()=>i.e(85030).then(i.bind(i,30789)),"plant-status":()=>i.e(97524).then(i.bind(i,89759)),"recovery-mode":()=>Promise.all([i.e(86269),i.e(20295)]).then(i.bind(i,93132)),"toggle-group":()=>i.e(87764).then(i.bind(i,5023)),"todo-list":()=>i.e(31355).then(i.bind(i,62134)),"shopping-list":()=>Promise.all([i.e(31355),i.e(89235)]).then(i.bind(i,36606)),starting:()=>i.e(31946).then(i.bind(i,88785)),"statistics-graph":()=>Promise.all([i.e(92610),i.e(77183),i.e(24301),i.e(42568)]).then(i.bind(i,3515)),statistic:()=>Promise.all([i.e(92610),i.e(77183),i.e(69315)]).then(i.bind(i,89029)),"vertical-stack":()=>i.e(55989).then(i.bind(i,33204))},f=e=>(0,b.Vd)("card",e,_,v,void 0,void 0),w=e=>(0,b.Ue)("card",e,_,v,void 0,void 0),C=e=>(0,b.gh)(e,"card",_,v);r()}catch(e){r(e)}})},34128(e,t,i){i.d(t,{G9:()=>n,Ni:()=>a,Ue:()=>d,Vd:()=>h,gh:()=>u});i(74423);var r=i(1087),o=i(45291);const a=e=>{const t=document.createElement("hui-error-card");return customElements.get("hui-error-card")?t.setConfig(e):(Promise.resolve().then(i.bind(i,4397)),customElements.whenDefined("hui-error-card").then(()=>{customElements.upgrade(t),t.setConfig(e)})),t},n=(e,t)=>({type:"error",error:e,origConfig:t}),s=(e,t)=>{const i=document.createElement(e);return i.setConfig(t),i},c=(e,t,r)=>"badge"===e?(e=>{const t=document.createElement("hui-error-badge");return customElements.get("hui-error-badge")?t.setConfig(e):(Promise.all([i.e(92769),i.e(3283),i.e(72130),i.e(85010),i.e(67218),i.e(58416),i.e(99788),i.e(22398),i.e(82134),i.e(26092),i.e(34310),i.e(59704),i.e(25322),i.e(90790),i.e(89747),i.e(59532),i.e(36332),i.e(77563),i.e(15862),i.e(99143),i.e(41344),i.e(12009),i.e(66990),i.e(3025),i.e(38108),i.e(66006),i.e(38260)]).then(i.bind(i,50655)),customElements.whenDefined("hui-error-badge").then(()=>{customElements.upgrade(t),t.setConfig(e)})),t})(n(t,r)):"heading-badge"===e?(e=>{const t=document.createElement("hui-error-heading-badge");return customElements.get("hui-error-heading-badge")?t.setConfig(e):(Promise.all([i.e(92769),i.e(3283),i.e(72130),i.e(85010),i.e(67218),i.e(58416),i.e(99788),i.e(22398),i.e(82134),i.e(26092),i.e(34310),i.e(59704),i.e(25322),i.e(90790),i.e(89747),i.e(59532),i.e(36332),i.e(77563),i.e(15862),i.e(99143),i.e(41344),i.e(12009),i.e(66990),i.e(3025),i.e(38108),i.e(66006),i.e(21614)]).then(i.bind(i,13469)),customElements.whenDefined("hui-error-heading-badge").then(()=>{customElements.upgrade(t),t.setConfig(e)})),t})(((e,t)=>({type:"error",error:e,origConfig:t}))(t,r)):a({type:"error",message:t}),l=e=>(0,o.c8)(e)?(0,o.Iu)(e):void 0,d=(e,t,i,r,o,a)=>{try{return h(e,t,i,r,o,a)}catch(i){return console.error(e,t.type,i),c(e,i.message,t)}},h=(e,t,i,o,a,n)=>{if(!t||"object"!=typeof t)throw new Error("Config is not an object");if(!(t.type||n||a&&"entity"in t))throw new Error("No card type configured");const d=t.type?l(t.type):void 0;if(d)return((e,t,i)=>{if(customElements.get(t))return s(t,i);const o=c(e,`Custom element doesn't exist: ${t}.`,i);if(!t.includes("-"))return o;o.style.display="None";const a=window.setTimeout(()=>{o.style.display=""},2e3);return customElements.whenDefined(t).then(()=>{clearTimeout(a),(0,r.r)(o,"ll-rebuild")}),o})(e,d,t);let h;if(a&&!t.type&&t.entity){h=`${a[t.entity.split(".",1)[0]]||a._domain_not_found}-entity`}else h=t.type||n;if(void 0===h)throw new Error("No type specified");const u=`hui-${h}-${e}`;if(o&&h in o)return o[h](),((e,t)=>{if(customElements.get(e))return s(e,t);const i=document.createElement(e);return customElements.whenDefined(e).then(()=>{try{customElements.upgrade(i),(0,r.r)(i,"ll-upgrade"),i.setConfig(t)}catch(e){(0,r.r)(i,"ll-rebuild")}}),i})(u,t);if(i&&i.has(h))return s(u,t);throw new Error(`Unknown type encountered: ${h}`)},u=async(e,t,i,r)=>{const o=l(e);if(o){const e=customElements.get(o);if(e)return e;if(!o.includes("-"))throw new Error(`Custom element not found: ${o}`);return new Promise((e,t)=>{setTimeout(()=>t(new Error(`Custom element not found: ${o}`)),2e3),customElements.whenDefined(o).then(()=>e(customElements.get(o)))})}const a=`hui-${e}-${t}`,n=customElements.get(a);if(i&&i.has(e))return n;if(r&&e in r)return n||r[e]().then(()=>customElements.get(a));throw new Error(`Unknown type: ${e}`)}},83938(e,t,i){i.d(t,{l:()=>n,x:()=>a});var r=i(34128);const o={picture:()=>i.e(17813).then(i.bind(i,97588)),buttons:()=>i.e(16700).then(i.bind(i,72791)),graph:()=>i.e(33427).then(i.bind(i,67806))},a=e=>(0,r.Ue)("header-footer",e,void 0,o,void 0,void 0),n=e=>(0,r.gh)(e,"header-footer",void 0,o)},94225(e,t,i){i.a(e,async function(e,r){try{i.d(t,{T:()=>v,t:()=>f});i(17642),i(58004),i(33853),i(45876),i(32475),i(15024),i(31698);var o=i(99799),a=i(29003),n=i(92055),s=i(19396),c=i(74323),l=i(51199),d=i(43721),h=i(65509),u=i(21659),m=i(82525),p=i(34128),g=e([o,a,n,s,c,l,d,h,u,m]);[o,a,n,s,c,l,d,h,u,m]=g.then?(await g)():g;const b=new Set(["media-player-entity","scene-entity","script-entity","sensor-entity","simple-entity","toggle-entity","button","call-service"]),y={"button-entity":()=>i.e(26846).then(i.bind(i,21869)),"climate-entity":()=>i.e(56995).then(i.bind(i,2798)),"cover-entity":()=>i.e(41243).then(i.bind(i,79734)),"date-entity":()=>i.e(17418).then(i.bind(i,75473)),"datetime-entity":()=>Promise.all([i.e(99194),i.e(81767)]).then(i.bind(i,69690)),"event-entity":()=>Promise.resolve().then(i.bind(i,99799)),"group-entity":()=>i.e(68827).then(i.bind(i,53110)),"input-button-entity":()=>i.e(19825).then(i.bind(i,46472)),"humidifier-entity":()=>i.e(378).then(i.bind(i,53537)),"input-datetime-entity":()=>i.e(71748).then(i.bind(i,1391)),"input-number-entity":()=>i.e(17600).then(i.bind(i,58723)),"input-select-entity":()=>i.e(44325).then(i.bind(i,54596)),"input-text-entity":()=>i.e(8086).then(i.bind(i,51765)),"lock-entity":()=>i.e(28245).then(i.bind(i,49748)),"number-entity":()=>i.e(71523).then(i.bind(i,57198)),"select-entity":()=>i.e(9374).then(i.bind(i,78157)),"text-entity":()=>i.e(67973).then(i.bind(i,58212)),"time-entity":()=>i.e(61331).then(i.bind(i,87550)),"timer-entity":()=>i.e(94097).then(i.bind(i,6344)),"update-entity":()=>i.e(80275).then(i.bind(i,38238)),"valve-entity":()=>i.e(96654).then(i.bind(i,46493)),conditional:()=>Promise.all([i.e(67218),i.e(77563),i.e(78490)]).then(i.bind(i,80725)),"weather-entity":()=>Promise.all([i.e(12009),i.e(77547)]).then(i.bind(i,80395)),divider:()=>i.e(45249).then(i.bind(i,38584)),section:()=>i.e(51255).then(i.bind(i,39082)),weblink:()=>i.e(69148).then(i.bind(i,65751)),cast:()=>i.e(10405).then(i.bind(i,96612)),buttons:()=>i.e(50777).then(i.bind(i,65728)),attribute:()=>Promise.resolve().then(i.bind(i,65509)),text:()=>i.e(95421).then(i.bind(i,3980))},_={_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"},v=e=>(0,p.Ue)("row",e,b,y,_,void 0),f=e=>(0,p.gh)(e,"row",b,y);r()}catch(e){r(e)}})},78305(e,t,i){i.a(e,async function(e,r){try{i.r(t),i.d(t,{HuiDialogSuggestCard:()=>A});i(18111),i(61701);var o=i(62826),a=i(34370),n=i.n(a),s=i(5124),c=i(22441),l=i(1087),d=i(18350),h=i(10763),u=(i(93444),i(72554)),m=i(65829),p=i(91984),g=i(14503),b=i(92255),y=i(46856),_=i(26004),v=i(36751),f=i(82360),w=i(75196),C=i(21146),L=e([d,h,u,m,y,_]);[d,h,u,m,y,_]=L.then?(await L)():L;class A 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=n()(this._cardConfig)),Object.isFrozen(this._sectionConfig)||(this._sectionConfig=n()(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(){if(!this._params?.lovelaceConfig||!this._params?.path)return!1;const{viewIndex:e}=(0,w.$P)(this._params.path),t=this._params.lovelaceConfig.views[e];return!(0,p.R6)(t)&&"sections"===(0,v.E)(t)}_renderPreview(){return this._sectionConfig&&this._viewSupportsSection?s.qy` <div class="element-preview"> <hui-section .hass="${this.hass}" .config="${this._sectionConfig}" preview></hui-section> </div> `:this._cardConfig?s.qy` <div class="element-preview"> ${this._cardConfig.map(e=>s.qy` <hui-card .hass="${this.hass}" .config="${e}" preview></hui-card> `)} </div> `:s.s6}render(){return this._params?s.qy` <ha-dialog .open="${this._open}" header-title="${this.hass.localize("ui.panel.lovelace.editor.suggest_card.header")}" @closed="${this._dialogClosed}"> <div> ${this._renderPreview()} ${this._params.yaml&&this._cardConfig?s.qy` <div class="editor"> <ha-yaml-editor .defaultValue="${this._cardConfig}" in-dialog></ha-yaml-editor> </div> `:s.s6} </div> <ha-dialog-footer slot="footer"> <ha-button slot="secondaryAction" @click="${this.closeDialog}" appearance="plain" autofocus> ${this._params.yaml?this.hass.localize("ui.common.close"):this.hass.localize("ui.common.cancel")} </ha-button> ${this._params.yaml?s.s6:s.qy` ${this._sectionConfig&&this._viewSupportsSection?s.s6:s.qy` <ha-button appearance="plain" slot="secondaryAction" @click="${this._pickCard}"> ${this.hass.localize("ui.panel.lovelace.editor.suggest_card.create_own")} </ha-button> `} <ha-button slot="primaryAction" .disabled="${this._saving}" @click="${this._save}" .loading="${this._saving}"> ${this.hass.localize("ui.panel.lovelace.editor.suggest_card.add")} </ha-button> `} </ha-dialog-footer> </ha-dialog> `:s.s6}static get styles(){return[g.nA,s.AH`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(){this._params?.lovelaceConfig&&this._params?.path&&this._params?.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,f.DU)(e,t,this._cardConfig);const{viewIndex:i,sectionIndex:r}=(0,w.$P)(t);if(void 0===r){const t=this._sectionConfig??{type:"grid",cards:this._cardConfig};return(0,f.Bn)(e,i,t)}const o=this._sectionConfig?this._sectionConfig.cards||[]:this._cardConfig;return(0,f.DU)(e,[i,r],o)}async _save(){if(!(this._params?.lovelaceConfig&&this._params?.path&&this._params?.saveConfig&&this._cardConfig))return;this._saving=!0;const e=this._computeNewConfig(this._params.lovelaceConfig,this._params.path);await this._params.saveConfig(e),this._saving=!1,(0,b.f)(this,this.hass),this.closeDialog()}constructor(...e){super(...e),this._open=!1,this._saving=!1}}(0,o.Cg)([(0,c.MZ)({attribute:!1})],A.prototype,"hass",void 0),(0,o.Cg)([(0,c.wk)()],A.prototype,"_params",void 0),(0,o.Cg)([(0,c.wk)()],A.prototype,"_open",void 0),(0,o.Cg)([(0,c.wk)()],A.prototype,"_cardConfig",void 0),(0,o.Cg)([(0,c.wk)()],A.prototype,"_sectionConfig",void 0),(0,o.Cg)([(0,c.wk)()],A.prototype,"_saving",void 0),(0,o.Cg)([(0,c.P)("ha-yaml-editor")],A.prototype,"_yamlEditor",void 0),A=(0,o.Cg)([(0,c.EM)("hui-dialog-suggest-card")],A),r()}catch(e){r(e)}})},15656(e,t,i){i.d(t,{Nu:()=>l,TG:()=>g,Xd:()=>u,d4:()=>p,uN:()=>h,xC:()=>m});i(18111),i(61701);if(59509==i.j)var r=i(28918);if(59509==i.j)var o=i(35952);if(59509==i.j)var a=i(91984);var n=i(53338);const s="custom:",c={dashboard:{"original-states":()=>i.e(60134).then(i.bind(i,43845)),map:()=>i.e(74994).then(i.bind(i,56009)),iframe:()=>i.e(1732).then(i.bind(i,38287)),areas:()=>Promise.all([i.e(99788),i.e(59704),i.e(25322),i.e(12009),i.e(20282),i.e(20992)]).then(i.bind(i,80821)),home:()=>Promise.all([i.e(99788),i.e(59704),i.e(25322),i.e(12009),i.e(20282),i.e(3650),i.e(97416)]).then(i.bind(i,67293)),energy:()=>Promise.all([i.e(67218),i.e(92610),i.e(26857),i.e(77183),i.e(19343)]).then(i.bind(i,94429))},view:{"original-states":()=>Promise.all([i.e(67218),i.e(92610),i.e(45688),i.e(77183),i.e(94530)]).then(i.bind(i,16330)),"energy-overview":()=>Promise.all([i.e(67218),i.e(92610),i.e(26857),i.e(77183),i.e(51016)]).then(i.bind(i,3260)),energy:()=>Promise.all([i.e(67218),i.e(92610),i.e(26857),i.e(77183),i.e(20984)]).then(i.bind(i,86242)),water:()=>Promise.all([i.e(67218),i.e(92610),i.e(26857),i.e(77183),i.e(8969)]).then(i.bind(i,88615)),gas:()=>Promise.all([i.e(67218),i.e(92610),i.e(26857),i.e(77183),i.e(17423)]).then(i.bind(i,21733)),power:()=>Promise.all([i.e(67218),i.e(92610),i.e(26857),i.e(77183),i.e(17879)]).then(i.bind(i,60093)),map:()=>i.e(6875).then(i.bind(i,14966)),iframe:()=>i.e(73441).then(i.bind(i,51480)),area:()=>Promise.all([i.e(99788),i.e(59704),i.e(25322),i.e(12009),i.e(20282),i.e(35818)]).then(i.bind(i,44979)),"areas-overview":()=>Promise.all([i.e(99788),i.e(59704),i.e(25322),i.e(12009),i.e(20282),i.e(94101)]).then(i.bind(i,69140)),"home-overview":()=>Promise.all([i.e(67218),i.e(92610),i.e(99788),i.e(28991),i.e(77183),i.e(59704),i.e(25322),i.e(12009),i.e(20282),i.e(3650),i.e(6078)]).then(i.bind(i,8892)),"home-media-players":()=>Promise.all([i.e(99788),i.e(59704),i.e(25322),i.e(12009),i.e(20282),i.e(3650),i.e(44685)]).then(i.bind(i,24876)),"home-area":()=>Promise.all([i.e(99788),i.e(59704),i.e(25322),i.e(12009),i.e(20282),i.e(3650),i.e(54547)]).then(i.bind(i,47302)),"home-other-devices":()=>i.e(27800).then(i.bind(i,78859)),light:()=>Promise.all([i.e(99788),i.e(59704),i.e(25322),i.e(12009),i.e(20282),i.e(2437)]).then(i.bind(i,71776)),security:()=>Promise.all([i.e(99788),i.e(59704),i.e(25322),i.e(12009),i.e(20282),i.e(85143)]).then(i.bind(i,31758)),climate:()=>Promise.all([i.e(99788),i.e(59704),i.e(25322),i.e(12009),i.e(20282),i.e(19051)]).then(i.bind(i,73026)),maintenance:()=>i.e(82691).then(i.bind(i,78030))},section:{"common-controls":()=>i.e(8717).then(i.bind(i,44124))}},l=async(e,t)=>{if(t in c[e]){await c[e][t]();const i=`${t}-${e}-strategy`;return customElements.get(i)}if(!t.startsWith(s))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 customElements.get(r)??customElements.get(i)},d=async(e,t,i,r)=>{const o=i.type;if(!o)return t("No strategy type found");try{const t=await l(e,o);if((0,n.Xo)(t)){if("dashboard"===e&&"generateDashboard"in t)return await t.generateDashboard({config:{strategy:i,views:[]},hass:r});if("view"===e&&"generateView"in t)return await t.generateView({config:{views:[]},view:{strategy:i},hass:r})}const a=(0,n._V)(i);return await t.generate(a,r)}catch(e){return"timeout"!==e.message&&console.error(e),t(e)}},h=async(e,t)=>{const{strategy:i,...r}=e;return{...r,...await d("dashboard",e=>({views:[{title:"Error",cards:[{type:"markdown",content:`Error loading the dashboard strategy:\n> ${e}`}]}]}),i,t)}},u=async(e,t)=>{const{strategy:i,...r}=e;return{...r,...await d("view",e=>({cards:[{type:"markdown",content:`Error loading the view strategy:\n> ${e}`}]}),i,t)}},m=async(e,t)=>{const{strategy:i,...r}=e;return{...r,...await d("section",e=>({cards:[{type:"markdown",content:`Error loading the section strategy:\n> ${e}`}]}),i,t)}},p=async(e,t)=>{const i=(0,o.Wu)(e)?await h(e,t):{...e};return i.views=await Promise.all(i.views.map(async e=>{const i=(0,a.R6)(e)?await u(e,t):{...e};return i.sections&&(i.sections=await Promise.all(i.sections.map(async e=>(0,r.H)(e)?await m(e,t):{...e}))),i})),i};async function g(e,t){const i=await l("dashboard",t),r=await async function(e,t){const i=t.getCreateSuggestions;if("function"==typeof i)return i.call(t,e)}(e,i);return{strategyClass:i,fieldSuggestions:r}}},53338(e,t,i){i.d(t,{B2:()=>o,Xo:()=>r,_V:()=>a});const r=e=>!("generate"in e),o=e=>2===Object.keys(e).length&&"options"in e&&"object"==typeof e.options,a=e=>{if(!o(e))return e;const t={...e,...e.options};return delete t.options,t}},49365(e,t,i){i.d(t,{NT:()=>r,_H:()=>a,oH:()=>o});const r="masonry",o="sidebar",a="sections"},36751(e,t,i){i.d(t,{E:()=>o});var r=i(49365);const o=e=>e?.type?e.type:e?.panel?"panel":e?.sections?r._H:e?.cards?r.NT:r._H},36918(e,t,i){i.d(t,{o:()=>r});const r=(e,t)=>`https://www.iobroker.net/#${e.language&&e.language.split("-")[0]||"en"}/adapters/adapterref/iobroker.lovelace/README.md#`},92255(e,t,i){i.d(t,{f:()=>o});var r=i(81619);const o=(e,t)=>(0,r.P)(e,{message:t.localize("ui.common.successfully_saved")})}};