iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
25 lines • 31 kB
JavaScript
/*! For license information please see 52418.950ab37b71d1f643.js.LICENSE.txt */
"use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[52418],{90248:function(t,e,a){a.a(t,async function(t,o){try{a.r(e),a.d(e,{HaIconButtonArrowPrev:function(){return g}});a(62953);var i=a(40445),s=a(5124),n=a(67576),r=a(63091),d=a(26300),h=t([d]);d=(h.then?(await h)():h)[0];let l,c=t=>t;const p="M20,11V13H8L13.5,18.5L12.08,19.92L4.16,12L12.08,4.08L13.5,5.5L8,11H20Z",u="M4,11V13H16L10.5,18.5L11.92,19.92L19.84,12L11.92,4.08L10.5,5.5L16,11H4Z";class g extends s.WF{render(){var t;return(0,s.qy)(l||(l=c` <ha-icon-button .disabled="${0}" .label="${0}" .path="${0}" .href="${0}" .target="${0}" .rel="${0}" .download="${0}"></ha-icon-button> `),this.disabled,this.label||(null===(t=this.hass)||void 0===t?void 0:t.localize("ui.common.back"))||"Back",this._icon,this.href,this.target,this.rel,this.download)}constructor(...t){super(...t),this.disabled=!1,this._icon="rtl"===r.G.document.dir?u:p}}(0,i.Cg)([(0,n.MZ)({attribute:!1})],g.prototype,"hass",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean})],g.prototype,"disabled",void 0),(0,i.Cg)([(0,n.MZ)()],g.prototype,"label",void 0),(0,i.Cg)([(0,n.MZ)()],g.prototype,"href",void 0),(0,i.Cg)([(0,n.MZ)()],g.prototype,"target",void 0),(0,i.Cg)([(0,n.MZ)()],g.prototype,"rel",void 0),(0,i.Cg)([(0,n.MZ)()],g.prototype,"download",void 0),(0,i.Cg)([(0,n.wk)()],g.prototype,"_icon",void 0),g=(0,i.Cg)([(0,n.EM)("ha-icon-button-arrow-prev")],g),o()}catch(l){o(l)}})},26300:function(t,e,a){a.a(t,async function(t,o){try{a.r(e),a.d(e,{HaIconButton:function(){return v}});a(62953);var i=a(40445),s=a(5124),n=a(67576),r=a(63672),d=a(18350),h=(a(67094),t([d]));d=(h.then?(await h)():h)[0];let l,c,p,u,g=t=>t;class v extends s.WF{render(){return(0,s.qy)(l||(l=g` <ha-button appearance="plain" variant="neutral" aria-label="${0}" title="${0}" aria-haspopup="${0}" .disabled="${0}" .iconTag="${0}" .href="${0}" .target="${0}" .rel="${0}" .download="${0}"> ${0} </ha-button> `),(0,r.J)(this.label),(0,r.J)(this.hideTitle?void 0:this.label),(0,r.J)(this.ariaHasPopup),this.disabled,this.path?"ha-svg-icon":"span",this.href,this.target,this.rel,this.download,this.path?(0,s.qy)(c||(c=g`<ha-svg-icon aria-hidden="true" .path="${0}"></ha-svg-icon>`),this.path):(0,s.qy)(p||(p=g`<span><slot></slot></span>`)))}constructor(...t){super(...t),this.disabled=!1,this.hideTitle=!1,this.selected=!1}}v.shadowRootOptions={mode:"open",delegatesFocus:!0},v.styles=(0,s.AH)(u||(u=g`:host{display:inline-block;outline:0;--ha-button-height:var(--ha-icon-button-size, 48px)}ha-button{position:relative;isolation:isolate;--wa-form-control-padding-inline:var(
--ha-icon-button-padding-inline,
--ha-space-2
);--wa-color-on-normal:currentColor;--wa-color-fill-quiet:transparent;--ha-button-label-overflow:visible}ha-button::after{content:"";position:absolute;inset:0;z-index:-1;border-radius:50%;background-color:currentColor;opacity:0;pointer-events:none}ha-button::part(base){width:var(--wa-form-control-height);aspect-ratio:1;outline-offset:-4px}ha-button::part(label){display:flex}:host([selected]) ha-button::after{opacity:.1} (hover:hover){:host(:hover:not([disabled])) ha-button::after{opacity:.1}}`)),(0,i.Cg)([(0,n.MZ)({type:Boolean,reflect:!0})],v.prototype,"disabled",void 0),(0,i.Cg)([(0,n.MZ)({type:String})],v.prototype,"path",void 0),(0,i.Cg)([(0,n.MZ)({type:String})],v.prototype,"label",void 0),(0,i.Cg)([(0,n.MZ)({type:String,attribute:"aria-haspopup"})],v.prototype,"ariaHasPopup",void 0),(0,i.Cg)([(0,n.MZ)({attribute:"hide-title",type:Boolean})],v.prototype,"hideTitle",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean,reflect:!0})],v.prototype,"selected",void 0),(0,i.Cg)([(0,n.MZ)()],v.prototype,"href",void 0),(0,i.Cg)([(0,n.MZ)()],v.prototype,"target",void 0),(0,i.Cg)([(0,n.MZ)()],v.prototype,"rel",void 0),(0,i.Cg)([(0,n.MZ)()],v.prototype,"download",void 0),v=(0,i.Cg)([(0,n.EM)("ha-icon-button")],v),o()}catch(l){o(l)}})},2054:function(t,e,a){a.a(t,async function(t,e){try{a(16280),a(62953);var o=a(40445),i=a(5124),s=a(67576),n=a(1087),r=a(44249),d=a(26300),h=t([d]);d=(h.then?(await h)():h)[0];let l,c,p,u=t=>t;const g="M3,6H21V8H3V6M3,11H21V13H3V11M3,16H21V18H3V16Z";class v extends i.WF{connectedCallback(){super.connectedCallback(),this._attachNotifOnConnect&&(this._attachNotifOnConnect=!1,this._subscribeNotifications())}disconnectedCallback(){super.disconnectedCallback(),this._unsubNotifications&&(this._attachNotifOnConnect=!0,this._unsubNotifications(),this._unsubNotifications=void 0)}render(){if(!this._show)return i.s6;const t=this._hasNotifications&&(this.narrow||"always_hidden"===this.hass.dockedSidebar);return(0,i.qy)(l||(l=u` <ha-icon-button .label="${0}" .path="${0}" ="${0}"></ha-icon-button> ${0} `),this.hass.localize("ui.sidebar.sidebar_toggle"),g,this._toggleMenu,t?(0,i.qy)(c||(c=u`<div class="dot"></div>`)):"")}willUpdate(t){if(super.willUpdate(t),!t.has("narrow")&&!t.has("hass"))return;const e=t.has("hass")?t.get("hass"):this.hass,a=t.has("narrow")?t.get("narrow"):this.narrow,o=!1===(null==e?void 0:e.kioskMode)&&(a||"always_hidden"===(null==e?void 0:e.dockedSidebar)),i=!1===this.hass.kioskMode&&(this.narrow||"always_hidden"===this.hass.dockedSidebar);this.hasUpdated&&o===i||(this._show=i||this._alwaysVisible,i?this._subscribeNotifications():this._unsubNotifications&&(this._unsubNotifications(),this._unsubNotifications=void 0))}_subscribeNotifications(){if(this._unsubNotifications)throw new Error("Already subscribed");this._unsubNotifications=(0,r.V)(this.hass.connection,t=>{this._hasNotifications=t.length>0})}_toggleMenu(){(0,n.r)(this,"hass-toggle-menu")}constructor(...t){super(...t),this.narrow=!1,this._hasNotifications=!1,this._show=!1,this._alwaysVisible=!1,this._attachNotifOnConnect=!1}}v.styles=(0,i.AH)(p||(p=u`:host{position:relative}.dot{pointer-events:none;position:absolute;background-color:var(--accent-color);width:12px;height:12px;top:9px;right:7px;inset-inline-end:7px;inset-inline-start:initial;border-radius:var(--ha-border-radius-circle);border:2px solid var(--app-header-background-color)}`)),(0,o.Cg)([(0,s.MZ)({type:Boolean})],v.prototype,"narrow",void 0),(0,o.Cg)([(0,s.MZ)({attribute:!1})],v.prototype,"hass",void 0),(0,o.Cg)([(0,s.wk)()],v.prototype,"_hasNotifications",void 0),(0,o.Cg)([(0,s.wk)()],v.prototype,"_show",void 0),v=(0,o.Cg)([(0,s.EM)("ha-menu-button")],v),e()}catch(l){e(l)}})},67094:function(t,e,a){a.r(e),a.d(e,{HaSvgIcon:function(){return c}});var o=a(40445),i=a(5124),s=a(67576);let n,r,d,h,l=t=>t;class c extends i.WF{render(){return(0,i.JW)(n||(n=l` <svg viewBox="${0}" preserveAspectRatio="xMidYMid meet" focusable="false" role="img" aria-hidden="true"> <g> ${0} ${0} </g> </svg>`),this.viewBox||"0 0 24 24",this.path?(0,i.JW)(r||(r=l`<path class="primary-path" d="${0}"></path>`),this.path):i.s6,this.secondaryPath?(0,i.JW)(d||(d=l`<path class="secondary-path" d="${0}"></path>`),this.secondaryPath):i.s6)}}c.styles=(0,i.AH)(h||(h=l`:host{display:var(--ha-icon-display,inline-flex);align-items:center;justify-content:center;position:relative;vertical-align:middle;fill:var(--icon-primary-color,currentcolor);width:var(--mdc-icon-size,24px);height:var(--mdc-icon-size,24px)}svg{width:100%;height:100%;pointer-events:none;display:block}path.primary-path{opacity:var(--icon-primary-opactity, 1)}path.secondary-path{fill:var(--icon-secondary-color,currentcolor);opacity:var(--icon-secondary-opactity, .5)}`)),(0,o.Cg)([(0,s.MZ)()],c.prototype,"path",void 0),(0,o.Cg)([(0,s.MZ)({attribute:!1})],c.prototype,"secondaryPath",void 0),(0,o.Cg)([(0,s.MZ)({attribute:!1})],c.prototype,"viewBox",void 0),c=(0,o.Cg)([(0,s.EM)("ha-svg-icon")],c)},22130:function(t,e,a){a.r(e),a.d(e,{fetchAddonInfo:function(){return _},fetchHassioAddonChangelog:function(){return d},fetchHassioAddonDocumentation:function(){return l},fetchHassioAddonInfo:function(){return r},fetchHassioAddonLogs:function(){return h},fetchHassioAddonsInfo:function(){return n},installHassioAddon:function(){return f},rebuildLocalAddon:function(){return w},reloadHassioAddons:function(){return s},restartHassioAddon:function(){return y},setHassioAddonOption:function(){return c},setHassioAddonSecurity:function(){return v},startHassioAddon:function(){return u},stopHassioAddon:function(){return g},uninstallHassioAddon:function(){return b},updateHassioAddon:function(){return m},validateHassioAddonOption:function(){return p}});a(16280),a(18111),a(20116),a(3362);var o=a(35541),i=a(47351);const s=async t=>{await t.callWS({type:"supervisor/api",endpoint:"/addons/reload",method:"post"})},n=async t=>t.callWS({type:"supervisor/api",endpoint:"/addons",method:"get"}),r=async(t,e)=>t({type:"supervisor/api",endpoint:`/addons/${e}/info`,method:"get"}),d=async(t,e)=>t.callApi("GET",`hassio/addons/${e}/changelog`),h=async(t,e)=>t.callApi("GET",`hassio/addons/${e}/logs`),l=async(t,e)=>t.callApi("GET",`hassio/addons/${e}/documentation`),c=async(t,e,a)=>{const o=await t({type:"supervisor/api",endpoint:`/addons/${e}/options`,method:"post",data:a});if("error"===o.result)throw Error((0,i.VR)(o));return o},p=async(t,e,a)=>t({type:"supervisor/api",endpoint:`/addons/${e}/options/validate`,method:"post",data:a}),u=async(t,e)=>t({type:"supervisor/api",endpoint:`/addons/${e}/start`,method:"post",timeout:null}),g=async(t,e)=>t({type:"supervisor/api",endpoint:`/addons/${e}/stop`,method:"post",timeout:null}),v=async(t,e,a)=>{await t({type:"supervisor/api",endpoint:`/addons/${e}/security`,method:"post",data:a})},f=async(t,e)=>{await t({type:"supervisor/api",endpoint:`/addons/${e}/install`,method:"post",timeout:null})},m=async(t,e,a)=>{await t.callWS({type:"hassio/update/addon",addon:e,backup:a})},y=async(t,e)=>{await t({type:"supervisor/api",endpoint:`/addons/${e}/restart`,method:"post",timeout:null})},b=async(t,e,a)=>{await t({type:"supervisor/api",endpoint:`/addons/${e}/uninstall`,method:"post",timeout:null,data:{remove_config:a}})},_=(t,e,a)=>{var i;return(0,o.X)(t,null!==(i=e.addon)&&void 0!==i&&i.addons.find(t=>t.slug===a)?`/addons/${a}/info`:`/store/addons/${a}`)},w=async(t,e)=>t({type:"supervisor/api",endpoint:`/addons/${e}/rebuild`,method:"post",timeout:null})},47351:function(t,e,a){a.d(e,{PS:function(){return o},Tv:function(){return n},VR:function(){return i},lE:function(){return r}});a(74423),a(3362),a(17642),a(58004),a(33853),a(45876),a(32475),a(15024),a(31698),a(62953);const o=t=>t.data,i=t=>"object"==typeof t?"object"==typeof t.body?t.body.message||"Unknown error, see supervisor logs":t.body||t.message||"Unknown error, see supervisor logs":t,s=new Set([502,503,504]),n=t=>!!(t&&t.status_code&&s.has(t.status_code))||!(!t||!t.message||!t.message.includes("ERR_CONNECTION_CLOSED")&&!t.message.includes("ERR_CONNECTION_RESET")),r=async(t,e)=>t({type:"supervisor/api",endpoint:`/${e}/stats`,method:"get"})},38395:function(t,e,a){a.d(e,{gh:function(){return d},kU:function(){return h},q:function(){return r}});a(3362);var o=a(90889),i=a(62384),s=a(61557);function n(t){return document.cookie=`ingress_session=${t};path=/api/hassio_ingress/;SameSite=Strict${"https:"===location.protocol?";Secure":""}`,t}const r=async t=>{if((0,i.v)(t.config.version,2021,2,4)){return n((await t.callWS({type:"supervisor/api",endpoint:"/ingress/session",method:"post"})).session)}return n((await t.callApi("POST","hassio/ingress/session")).data.session)},d=t=>(0,o.X)(t,"_ingressPanelInfo",async t=>(await(0,s.uw)(t,{endpoint:"/ingress/panels"})).panels),h=async(t,e)=>{(0,i.v)(t.config.version,2021,2,4)?await t.callWS({type:"supervisor/api",endpoint:"/ingress/validate_session",method:"post",data:{session:e}}):await t.callApi("POST","hassio/ingress/validate_session",{session:e})}},44249:function(t,e,a){a.d(e,{V:function(){return o}});a(62953);const o=(t,e)=>{const a=new i,o=t.subscribeMessage(t=>e(a.processMessage(t)),{type:"persistent_notification/subscribe"});return()=>{o.then(t=>null==t?void 0:t())}};class i{processMessage(t){if("removed"===t.type)for(const e of Object.keys(t.notifications))delete this.notifications[e];else this.notifications=Object.assign(Object.assign({},this.notifications),t.notifications);return Object.values(this.notifications)}constructor(){this.notifications={}}}},35541:function(t,e,a){a.d(e,{X:function(){return s}});a(3362);var o=a(62384),i=a(47351);const s=async(t,e,a)=>{var s;return(0,o.v)(t.config.version,2021,2,4)?t.callWS({type:"supervisor/api",endpoint:e,method:(null==a?void 0:a.method)||"get",timeout:null!==(s=null==a?void 0:a.timeout)&&void 0!==s?s:null,data:null==a?void 0:a.data}):(0,i.PS)(await t.callApi((a.method||"get").toUpperCase(),`hassio${e}`,null==a?void 0:a.data))}},61557:function(t,e,a){a.d(e,{uw:function(){return i}});a(3362);const o={type:"supervisor/api",method:"GET"},i=(t,e)=>t.sendMessagePromise(Object.assign(Object.assign({},o),e))},23296:function(t,e,a){a.a(t,async function(t,o){try{a.r(e);a(62953);var i=a(40445),s=a(5124),n=a(67576),r=a(91926),d=a(65829),h=a(90248),l=a(2054),c=a(14503),p=t([d,h,l]);[d,h,l]=p.then?(await p)():p;let u,g,v,f,m,y,b=t=>t;class _ extends s.WF{render(){var t;return(0,s.qy)(u||(u=b` ${0} <div class="content"> <ha-spinner></ha-spinner> ${0} </div> `),this.noToolbar?"":(0,s.qy)(g||(g=b`<div class="toolbar"> ${0} </div>`),this.rootnav||null!==(t=history.state)&&void 0!==t&&t.root?(0,s.qy)(v||(v=b` <ha-menu-button .hass="${0}" .narrow="${0}"></ha-menu-button> `),this.hass,this.narrow):(0,s.qy)(f||(f=b` <ha-icon-button-arrow-prev .hass="${0}" ="${0}"></ha-icon-button-arrow-prev> `),this.hass,this._handleBack)),this.message?(0,s.qy)(m||(m=b`<div id="loading-text">${0}</div>`),this.message):s.s6)}_handleBack(){(0,r.OE)()}static get styles(){return[c.RF,(0,s.AH)(y||(y=b`:host{display:block;height:100%;background-color:var(--primary-background-color)}.toolbar{display:flex;align-items:center;font-size:var(--ha-font-size-xl);height:var(--header-height);padding:8px 12px;pointer-events:none;background-color:var(--app-header-background-color);font-weight:var(--ha-font-weight-normal);color:var(--app-header-text-color,#fff);border-bottom:var(--app-header-border-bottom,none);box-sizing:border-box} (max-width:599px){.toolbar{padding:4px}}ha-icon-button-arrow-prev,ha-menu-button{pointer-events:auto}.content{height:calc(100% - var(--header-height));display:flex;flex-direction:column;align-items:center;justify-content:center}#loading-text{max-width:350px;margin-top:16px}`))]}constructor(...t){super(...t),this.noToolbar=!1,this.rootnav=!1,this.narrow=!1}}(0,i.Cg)([(0,n.MZ)({attribute:!1})],_.prototype,"hass",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean,attribute:"no-toolbar"})],_.prototype,"noToolbar",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean})],_.prototype,"rootnav",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean})],_.prototype,"narrow",void 0),(0,i.Cg)([(0,n.MZ)()],_.prototype,"message",void 0),_=(0,i.Cg)([(0,n.EM)("hass-loading-screen")],_),o()}catch(u){o(u)}})},81625:function(t,e,a){a.a(t,async function(t,o){try{a.r(e);var i=a(86518),s=(a(74423),a(3362),a(62953),a(40445)),n=a(5124),r=a(67576),d=a(6412),h=a(59455),l=a(22786),c=a(1087),p=a(91926),u=a(1974),g=a(12587),v=a(26300),f=a(22130),m=a(47351),y=a(38395),b=a(65063),_=a(23296),w=t([v,_]);[v,_]=w.then?(await w)():w;const x=["type"];let k,$,A,M,C=t=>t;const H="M3,6H21V8H3V6M3,11H21V13H3V11M3,16H21V18H3V16Z",z=2e4,S=5e3;class T extends n.WF{updated(t){super.updated(t),this._iframeSubscribeUpdates&&(t.has("narrow")||t.has("route"))&&this._sendPropertiesToIframe();const e=t.get("hass");e&&e.kioskMode!==this.hass.kioskMode&&(this._kioskMode=this.hass.kioskMode)}connectedCallback(){super.connectedCallback(),window.addEventListener("message",this._handleIframeMessage)}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("message",this._handleIframeMessage),this._sessionKeepAlive&&(clearInterval(this._sessionKeepAlive),this._sessionKeepAlive=void 0),this._fetchDataTimeout&&(clearTimeout(this._fetchDataTimeout),this._fetchDataTimeout=void 0),this._enabledKioskMode&&(0,c.r)(window,"hass-kiosk-mode",{enable:!1})}render(){return this._addon?(0,n.qy)($||($=C` ${0} <iframe class="${0}" title="${0}" src="${0}" ="${0}" ${0}> </iframe> `),this._kioskMode||!this.narrow&&"always_hidden"!==this.hass.dockedSidebar?n.s6:(0,n.qy)(A||(A=C` <div class="header"> <ha-icon-button .label="${0}" .path="${0}" ="${0}"></ha-icon-button> <div class="main-title">${0}</div> </div> `),this.hass.localize("ui.sidebar.sidebar_toggle"),H,this._toggleMenu,this._addon.name),(0,d.H)({loaded:this._iframeLoaded,"kiosk-mode":this._kioskMode}),this._addon.name,this._addon.ingress_url,this._checkLoaded,(0,h.K)(this._iframeRef)):(0,n.qy)(k||(k=C`<hass-loading-screen .message="${0}"></hass-loading-screen>`),this._loadingMessage)}willUpdate(t){if(super.willUpdate(t),!t.has("route")&&!t.has("panel"))return;const e=this._getAddonSlug(),a=t.has("route")?t.get("route"):this.route,o=t.has("panel")?t.get("panel"):this.panel,i=this._getAddonSlugFromRoutePanel(a,o);e&&e!==i&&(this._loadingMessage=void 0,this._iframeLoaded=!1,this._enabledKioskMode&&((0,c.r)(window,"hass-kiosk-mode",{enable:!1}),this._enabledKioskMode=!1),this._iframeSubscribeUpdates=!1,this._autoRetryUntil=void 0,this._fetchData(e))}_getAddonSlug(){return this._getAddonSlugFromRoutePanel(this.route,this.panel)}_getAddonSlugFromRoutePanel(t,e){var a;if(null!=e&&null!==(a=e.config)&&void 0!==a&&a.addon)return e.config.addon;if(null!=t&&t.path){const e=t.path.indexOf("/",1),a=-1===e?t.path.substring(1):t.path.substring(1,e);if(a)return a}}async _showErrorAndNavigateHome(t,e){await this.updateComplete,await(0,b.showAlertDialog)(this,{title:t,text:e}),await(0,g.E)(),(0,p.oo)("/",{replace:!0})}async _fetchData(t){const e=(0,y.q)(this.hass);let a,o;try{a=await(0,f.fetchHassioAddonInfo)(this.hass.callWS,t)}catch(i){return void(await this._showErrorAndNavigateHome(t,(0,m.VR)(i)))}if(a.version)if(a.ingress_url){if(!a.state||!["startup","started"].includes(a.state)){await this.updateComplete;if(!(await(0,b.dk)(this,{text:this.hass.localize("ui.panel.app.error_app_not_running"),title:a.name,confirmText:this.hass.localize("ui.panel.app.start_app"),dismissText:this.hass.localize("ui.common.no")})))return await(0,g.E)(),void(0,p.oo)("/",{replace:!0});try{return this._loadingMessage=this.hass.localize("ui.panel.app.app_starting"),this._autoRetryUntil=Date.now()+z,await(0,f.startHassioAddon)(this.hass.callWS,t),void this._fetchData(t)}catch(s){return void(await this._showErrorAndNavigateHome(a.name,this.hass.localize("ui.panel.app.error_starting_app")))}}if("startup"===a.state)return this._loadingMessage=this.hass.localize("ui.panel.app.app_starting"),void(this._fetchDataTimeout=window.setTimeout(()=>{this._fetchData(t)},500));if("started"===a.state){this._loadingMessage=void 0,this._fetchDataTimeout&&(clearTimeout(this._fetchDataTimeout),this._fetchDataTimeout=void 0);try{o=await e}catch(s){return this._sessionKeepAlive&&clearInterval(this._sessionKeepAlive),void(await this._showErrorAndNavigateHome(a.name,this.hass.localize("ui.panel.app.error_creating_session")))}this._getAddonSlug()===t&&(this._sessionKeepAlive&&clearInterval(this._sessionKeepAlive),this._sessionKeepAlive=window.setInterval(async()=>{try{await(0,y.kU)(this.hass,o)}catch(s){o=await(0,y.q)(this.hass)}},6e4),this._addon=a)}}else await this._showErrorAndNavigateHome(a.name,this.hass.localize("ui.panel.app.error_app_no_ingress"));else await this._showErrorAndNavigateHome(a.name,this.hass.localize("ui.panel.app.error_app_not_installed"))}async _checkLoaded(t){var e;const a=t.target;this._iframeLoaded=!0,this._addon&&"502: Bad Gateway"===(null===(e=a.contentDocument)||void 0===e?void 0:e.body.textContent)&&(this._autoRetryUntil&&Date.now()<this._autoRetryUntil?this._reloadIframe():(this._autoRetryUntil=void 0,await this.updateComplete,(0,b.dk)(this,{text:this.hass.localize("ui.panel.app.error_app_not_ready"),title:this._addon.name,confirmText:this.hass.localize("ui.panel.app.retry"),dismissText:this.hass.localize("ui.common.no"),confirm:()=>{this._autoRetryUntil=Date.now()+S,this._reloadIframe()}})))}async _reloadIframe(){const t=this._addon.slug;this._iframeLoaded=!1,this._addon=void 0,await Promise.all([this.updateComplete,new Promise(t=>{setTimeout(t,1e3)})]),this._getAddonSlug()===t&&this._fetchData(t)}_toggleMenu(){(0,c.r)(this,"hass-toggle-menu")}_sendPropertiesToIframe(){var t;null!==(t=this._iframeRef.value)&&void 0!==t&&t.contentWindow&&this._iframeRef.value.contentWindow.postMessage({type:"home-assistant/properties",narrow:this.narrow,route:this._computeRouteTail(this.route)},"*")}constructor(...t){super(...t),this.narrow=!1,this._kioskMode=!1,this._iframeLoaded=!1,this._enabledKioskMode=!1,this._iframeRef=(0,h._)(),this._iframeSubscribeUpdates=!1,this._handleIframeMessage=t=>{var e;if(t.source!==(null===(e=this._iframeRef.value)||void 0===e?void 0:e.contentWindow))return;const a=t.data,{type:o}=a,s=(0,i.A)(a,x);switch(o){case"home-assistant/navigate":(0,p.oo)(s.path,s.options);break;case"home-assistant/toggle-menu":this._toggleMenu();break;case"home-assistant/subscribe-properties":this._iframeSubscribeUpdates=!0,this._sendPropertiesToIframe(),s.kioskMode&&!this.hass.kioskMode&&(this._enabledKioskMode=!0,(0,c.r)(window,"hass-kiosk-mode",{enable:!0}));break;case"home-assistant/unsubscribe-properties":this._iframeSubscribeUpdates=!1,this._enabledKioskMode&&((0,c.r)(window,"hass-kiosk-mode",{enable:!1}),this._enabledKioskMode=!1)}},this._computeRouteTail=(0,l.A)(u.l)}}T.styles=(0,n.AH)(M||(M=C`:host{display:block;height:100%}iframe{display:block;width:100%;height:100%;border:0;background-color:var(--primary-background-color);opacity:0;transition:opacity var(--ha-animation-duration-normal) ease}iframe.loaded{opacity:1}.header+iframe{height:calc(100% - 40px)}:host([narrow]) iframe{padding-top:var(--safe-area-inset-top);height:calc(100% - var(--safe-area-inset-top,0px))}:host([narrow]) .header+iframe{padding-top:0;height:calc(100% - 40px - var(--safe-area-inset-top,0px))}.header{display:flex;align-items:center;font-size:var(--ha-font-size-l);height:40px;padding:0 16px;pointer-events:none;background-color:var(--app-header-background-color);font-weight:var(--ha-font-weight-normal);color:var(--app-header-text-color,#fff);border-bottom:var(--app-header-border-bottom,none);box-sizing:border-box;--mdc-icon-size:20px}:host([narrow]) .header{height:calc(40px + var(--safe-area-inset-top,0px));padding-top:var(--safe-area-inset-top,0)}.main-title{margin-inline-start:var(--ha-space-6);line-height:var(--ha-line-height-condensed);flex-grow:1}.narrow .main-title{margin-inline-start:var(--ha-space-2)}ha-icon-button{pointer-events:auto}`)),(0,s.Cg)([(0,r.MZ)({attribute:!1})],T.prototype,"hass",void 0),(0,s.Cg)([(0,r.MZ)({attribute:!1})],T.prototype,"route",void 0),(0,s.Cg)([(0,r.MZ)({attribute:!1})],T.prototype,"panel",void 0),(0,s.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],T.prototype,"narrow",void 0),(0,s.Cg)([(0,r.wk)()],T.prototype,"_addon",void 0),(0,s.Cg)([(0,r.wk)()],T.prototype,"_loadingMessage",void 0),(0,s.Cg)([(0,r.wk)()],T.prototype,"_kioskMode",void 0),(0,s.Cg)([(0,r.wk)()],T.prototype,"_iframeLoaded",void 0),T=(0,s.Cg)([(0,r.EM)("ha-panel-app")],T),o()}catch(x){o(x)}})},14503:function(t,e,a){a.d(e,{RF:function(){return p},dp:function(){return v},kO:function(){return g},nA:function(){return u},og:function(){return c}});var o=a(5124);let i,s,n,r,d,h,l=t=>t;const c=(0,o.AH)(i||(i=l`button.link{background:0 0;color:inherit;border:none;padding:0;font:inherit;text-align:left;text-decoration:underline;cursor:pointer;outline:0}`)),p=(0,o.AH)(s||(s=l`:host{font-family:var(--ha-font-family-body);-webkit-font-smoothing:var(--ha-font-smoothing);-moz-osx-font-smoothing:var(--ha-moz-osx-font-smoothing);font-size:var(--ha-font-size-m);font-weight:var(--ha-font-weight-normal);line-height:var(--ha-line-height-normal)}app-header div[sticky]{height:48px}app-toolbar [main-title]{margin-left:20px;margin-inline-start:20px;margin-inline-end:initial}.header{transition:box-shadow .2s linear,width var(--ha-animation-duration-normal) ease,padding-left var(--ha-animation-duration-normal) ease,padding-right var(--ha-animation-duration-normal) ease} (prefers-reduced-motion:reduce){.header{transition:box-shadow .2s linear}}h1{font-family:var(--ha-font-family-heading);-webkit-font-smoothing:var(--ha-font-smoothing);-moz-osx-font-smoothing:var(--ha-moz-osx-font-smoothing);font-size:var(--ha-font-size-2xl);font-weight:var(--ha-font-weight-normal);line-height:var(--ha-line-height-condensed)}h2{font-family:var(--ha-font-family-body);-webkit-font-smoothing:var(--ha-font-smoothing);-moz-osx-font-smoothing:var(--ha-moz-osx-font-smoothing);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:var(--ha-font-size-xl);font-weight:var(--ha-font-weight-medium);line-height:var(--ha-line-height-normal)}h3{font-family:var(--ha-font-family-body);-webkit-font-smoothing:var(--ha-font-smoothing);-moz-osx-font-smoothing:var(--ha-moz-osx-font-smoothing);font-size:var(--ha-font-size-l);font-weight:var(--ha-font-weight-normal);line-height:var(--ha-line-height-normal)}a{color:var(--primary-color)}.secondary{color:var(--secondary-text-color)}.error{color:var(--error-color)}.warning{color:var(--error-color)}${0} .card-actions a{text-decoration:none}.card-actions .warning{--mdc-theme-primary:var(--error-color)}.layout.horizontal,.layout.vertical{display:flex}.layout.inline{display:inline-flex}.layout.horizontal{flex-direction:row}.layout.vertical{flex-direction:column}.layout.wrap{flex-wrap:wrap}.layout.no-wrap{flex-wrap:nowrap}.layout.center,.layout.center-center{align-items:center}.layout.bottom{align-items:flex-end}.layout.center-center,.layout.center-justified{justify-content:center}.flex{flex:1;flex-basis:0.000000001px}.flex-auto{flex:1 1 auto}.flex-none{flex:none}.layout.justified{justify-content:space-between}`),c),u=(0,o.AH)(n||(n=l`ha-adaptive-dialog,ha-dialog{--mdc-dialog-min-width:400px;--mdc-dialog-max-width:600px;--mdc-dialog-max-width:min(600px, 95vw);--justify-action-buttons:space-between;--dialog-container-padding:var(--safe-area-inset-top, 0) var(--safe-area-inset-right, 0) var(--safe-area-inset-bottom, 0) var(--safe-area-inset-left, 0);--dialog-surface-padding:0px}ha-adaptive-dialog .form,ha-dialog .form{color:var(--primary-text-color)}a{color:var(--primary-color)} all and (max-width:450px),all and (max-height:500px){ha-adaptive-dialog,ha-dialog{--mdc-dialog-min-width:100vw;--mdc-dialog-max-width:100vw;--mdc-dialog-min-height:100vh;--mdc-dialog-min-height:100svh;--mdc-dialog-max-height:100vh;--mdc-dialog-max-height:100svh;--dialog-container-padding:0px;--dialog-surface-padding:var(--safe-area-inset-top, 0) var(--safe-area-inset-right, 0) var(--safe-area-inset-bottom, 0) var(--safe-area-inset-left, 0);--vertical-align-dialog:flex-end}ha-dialog{--ha-dialog-border-radius:var(--ha-border-radius-square)}}.error{color:var(--error-color)}`)),g=(0,o.AH)(r||(r=l`ha-adaptive-dialog,ha-dialog{--vertical-align-dialog:flex-start;--dialog-surface-margin-top:var(--ha-space-10);--mdc-dialog-max-height:calc(
100vh - var(--dialog-surface-margin-top) - var(--ha-space-2) - var(
--safe-area-inset-y,
0px
)
);--mdc-dialog-max-height:calc(
100svh - var(--dialog-surface-margin-top) - var(--ha-space-2) - var(
--safe-area-inset-y,
0px
)
);--ha-dialog-max-height:calc(
100vh - var(--dialog-surface-margin-top) - var(--ha-space-2) - var(
--safe-area-inset-y,
0px
)
);--ha-dialog-max-height:calc(
100svh - var(--dialog-surface-margin-top) - var(--ha-space-2) - var(
--safe-area-inset-y,
0px
)
)} all and (max-width:450px),all and (max-height:500px){ha-adaptive-dialog,ha-dialog{--dialog-surface-margin-top:0px;--mdc-dialog-min-height:100vh;--mdc-dialog-min-height:100svh;--mdc-dialog-max-height:100vh;--mdc-dialog-max-height:100svh;--ha-dialog-max-height:100vh;--ha-dialog-max-height:100svh}}`)),v=(0,o.AH)(d||(d=l`.ha-scrollbar::-webkit-scrollbar{width:.4rem;height:.4rem}.ha-scrollbar::-webkit-scrollbar-thumb{border-radius:var(--ha-border-radius-sm);background:var(--scrollbar-thumb-color)}.ha-scrollbar{overflow-y:auto;scrollbar-color:var(--scrollbar-thumb-color) transparent;scrollbar-width:thin}`));(0,o.AH)(h||(h=l`body{background-color:var(--primary-background-color);color:var(--primary-text-color);height:calc(100vh - 32px);width:100vw}`))},37540:function(t,e,a){a.d(e,{Kq:function(){return c}});a(17642),a(58004),a(33853),a(45876),a(32475),a(15024),a(31698),a(62953);var o=a(63937),i=a(42017);const s=(t,e)=>{const a=t._$AN;if(void 0===a)return!1;for(const i of a){var o;null!==(o=i._$AO)&&void 0!==o&&o.call(i,e,!1),s(i,e)}return!0},n=t=>{let e,a;do{var o;if(void 0===(e=t._$AM))break;a=e._$AN,a.delete(t),t=e}while(0===(null===(o=a)||void 0===o?void 0:o.size))},r=t=>{for(let e;e=t._$AM;t=e){let a=e._$AN;if(void 0===a)e._$AN=a=new Set;else if(a.has(t))break;a.add(t),l(e)}};function d(t){void 0!==this._$AN?(n(this),this._$AM=t,r(this)):this._$AM=t}function h(t,e=!1,a=0){const o=this._$AH,i=this._$AN;if(void 0!==i&&0!==i.size)if(e)if(Array.isArray(o))for(let r=a;r<o.length;r++)s(o[r],!1),n(o[r]);else null!=o&&(s(o,!1),n(o));else s(this,t)}const l=t=>{var e,a;t.type==i.OA.CHILD&&(null!==(e=t._$AP)&&void 0!==e||(t._$AP=h),null!==(a=t._$AQ)&&void 0!==a||(t._$AQ=d))};class c extends i.WL{_$AT(t,e,a){super._$AT(t,e,a),r(this),this.isConnected=t._$AU}_$AO(t,e=!0){var a,o;t!==this.isConnected&&(this.isConnected=t,t?null===(a=this.reconnected)||void 0===a||a.call(this):null===(o=this.disconnected)||void 0===o||o.call(this)),e&&(s(this,t),n(this))}setValue(t){if((0,o.Rt)(this._$Ct))this._$Ct._$AI(t,this);else{const e=[...this._$Ct._$AH];e[this._$Ci]=t,this._$Ct._$AI(e,this,0)}}disconnected(){}reconnected(){}constructor(){super(...arguments),this._$AN=void 0}}},59455:function(t,e,a){a.d(e,{_:function(){return n},K:function(){return h}});a(55081),a(88454),a(29452),a(62953);var o=a(5055),i=a(37540),s=a(42017);const n=()=>new r;class r{}const d=new WeakMap,h=(0,s.u$)(class extends i.Kq{render(t){return o.s6}update(t,[e]){var a;const i=e!==this.G;return i&&this.rt(void 0),(i||this.lt!==this.ct)&&(this.G=e,this.ht=null===(a=t.options)||void 0===a?void 0:a.host,this.rt(this.ct=t.element)),o.s6}rt(t){if(void 0!==this.G)if(this.isConnected||(t=void 0),"function"==typeof this.G){var e;const a=null!==(e=this.ht)&&void 0!==e?e:globalThis;let o=d.get(a);void 0===o&&(o=new WeakMap,d.set(a,o)),void 0!==o.get(this.G)&&this.G.call(this.ht,void 0),o.set(this.G,t),void 0!==t&&this.G.call(this.ht,t)}else this.G.value=t}get lt(){var t,e,a;return"function"==typeof this.G?null===(t=d.get(null!==(e=this.ht)&&void 0!==e?e:globalThis))||void 0===t?void 0:t.get(this.G):null===(a=this.G)||void 0===a?void 0:a.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}})}}]);