iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
28 lines • 30.7 kB
JavaScript
"use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[73559],{64481:function(e,t,a){a.d(t,{D:function(){return o},J:function(){return s}});a(16280),a(3362),a(55815),a(64979),a(79739);let i=!1;try{i="true"===window.localStorage.getItem("disableViewTransition")}catch(n){}const o=e=>{i=e},r=e=>{if(!(e=>(e instanceof DOMException||e instanceof Error)&&"AbortError"===e.name)(e))throw e},s=e=>{if(!document.startViewTransition||i)return e(!1),Promise.resolve();let t=!1;try{const a=document.startViewTransition(()=>{t=!0,e(!0)});return a.ready.catch(r),a.finished.catch(r)}catch(a){return console.warn("View transition failed, falling back to direct execution.",a),t?Promise.reject(a):(e(!1),Promise.resolve())}}},3109:function(e,t,a){var i=a(40445),o=a(86137),r=a(67576);class s extends o.A{constructor(){super(),this.play=!0,this.iterations=1,this.fill="both",this.name="fadeIn"}}(0,i.Cg)([(0,r.MZ)({type:Boolean})],s.prototype,"play",void 0),s=(0,i.Cg)([(0,r.EM)("ha-fade-in")],s)},93444:function(e,t,a){var i=a(40445),o=a(5124),r=a(67576);let s,n,l=e=>e;class d extends o.WF{render(){return(0,o.qy)(s||(s=l` <footer> <slot name="secondaryAction"></slot> <slot name="primaryAction"></slot> </footer> `))}static get styles(){return[(0,o.AH)(n||(n=l`footer{display:flex;gap:var(--ha-space-3);justify-content:flex-end;align-items:center;width:100%}`))]}}d=(0,i.Cg)([(0,r.EM)("ha-dialog-footer")],d)},76538:function(e,t,a){a(62953);var i=a(40445),o=a(5124),r=a(67576);let s,n,l,d,h,c,p=e=>e;class u extends o.WF{render(){const e=(0,o.qy)(s||(s=p`<div class="header-title"> <slot name="title"></slot> </div>`)),t=(0,o.qy)(n||(n=p`<div class="header-subtitle"> <slot name="subtitle"></slot> </div>`));return(0,o.qy)(l||(l=p` <header class="header"> <div class="header-bar"> <section class="header-navigation-icon"> <slot name="navigationIcon"></slot> </section> <section class="header-content"> ${0} </section> <section class="header-action-items"> <slot name="actionItems"></slot> </section> </div> <slot></slot> </header> `),"above"===this.subtitlePosition?(0,o.qy)(d||(d=p`${0}${0}`),t,e):(0,o.qy)(h||(h=p`${0}${0}`),e,t))}static get styles(){return[(0,o.AH)(c||(c=p`:host{display:block}:host([show-border]){border-bottom:1px solid var(--mdc-dialog-scroll-divider-color,rgba(0,0,0,.12))}.header-bar{display:flex;flex-direction:row;align-items:center;padding:0 var(--ha-space-1);box-sizing:border-box}.header-content{flex:1;padding:10px var(--ha-space-1);display:flex;flex-direction:column;justify-content:center;min-height:var(--ha-space-12);min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.header-title{height:var(--ha-dialog-header-title-height,calc(var(--ha-font-size-xl) + var(--ha-space-1)));font-size:var(--ha-font-size-xl);line-height:var(--ha-line-height-condensed);font-weight:var(--ha-font-weight-medium);color:var(--ha-dialog-header-title-color,var(--primary-text-color))}.header-subtitle{font-size:var(--ha-font-size-m);line-height:var(--ha-line-height-normal);color:var(--ha-dialog-header-subtitle-color,var(--secondary-text-color))} all and (min-width:450px) and (min-height:500px){.header-bar{padding:0 var(--ha-space-2)}}.header-navigation-icon{flex:none;min-width:var(--ha-space-2);height:100%;display:flex;flex-direction:row}.header-action-items{flex:none;min-width:var(--ha-space-2);height:100%;display:flex;flex-direction:row}`))]}constructor(...e){super(...e),this.subtitlePosition="below",this.showBorder=!1}}(0,i.Cg)([(0,r.MZ)({type:String,attribute:"subtitle-position"})],u.prototype,"subtitlePosition",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean,reflect:!0,attribute:"show-border"})],u.prototype,"showBorder",void 0),u=(0,i.Cg)([(0,r.EM)("ha-dialog-header")],u)},72554:function(e,t,a){a.a(e,async function(e,t){try{a(3362),a(62953),a(49255);var i=a(40445),o=a(93900),r=a(35211),s=a(5124),n=a(67576),l=a(63672),d=a(1087),h=a(64481),c=a(22792),p=a(59992),u=a(14503),g=a(22348),v=(a(76538),a(26300)),b=e([o,v,p]);[o,v,p]=b.then?(await b)():b;let f,_,m,w,y,x,k,C=e=>e;const $="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";class S extends((0,p.V)(s.WF)){connectedCallback(){super.connectedCallback(),this.addEventListener("dialog-set-fullscreen",this._handleFullscreenChanged)}get scrollableElement(){return this.bodyContainer}updated(e){super.updated(e),e.has("open")&&(this._open=this.open)}render(){var e,t,a;return(0,s.qy)(f||(f=C` <wa-dialog .open="${0}" .lightDismiss="${0}" without-header aria-labelledby="${0}" aria-describedby="${0}" ="${0}" -hide="${0}" -show="${0}" -after-show="${0}" -after-hide="${0}"> ${0} <div class="content-wrapper"> <div class="body ha-scrollbar" ="${0}"> <slot></slot> </div> ${0} </div> <slot name="footer" slot="footer"></slot> </wa-dialog> `),this._open,!this.preventScrimClose,(0,l.J)(this.ariaLabelledBy||(void 0!==this.headerTitle?"ha-dialog-title":void 0)),(0,l.J)(this.ariaDescribedBy),this._handleKeyDown,this._handleHide,this._handleShow,this._handleAfterShow,this._handleAfterHide,this.withoutHeader?s.s6:(0,s.qy)(_||(_=C`<slot name="header"> <ha-dialog-header .subtitlePosition="${0}" .showBorder="${0}"> <slot name="headerNavigationIcon" slot="navigationIcon"> <ha-icon-button data-dialog="close" .label="${0}" .path="${0}"></ha-icon-button> </slot> ${0} ${0} <slot name="headerActionItems" slot="actionItems"></slot> </ha-dialog-header> </slot>`),this.headerSubtitlePosition,this._bodyScrolled,null!==(e=null===(t=this._i18n)||void 0===t||null===(a=t.localize)||void 0===a?void 0:a.call(t,"ui.common.close"))&&void 0!==e?e:"Close",$,void 0!==this.headerTitle?(0,s.qy)(m||(m=C`<span slot="title" class="title" id="ha-dialog-title"> ${0} </span>`),this.headerTitle):(0,s.qy)(w||(w=C`<slot name="headerTitle" slot="title"></slot>`)),void 0!==this.headerSubtitle?(0,s.qy)(y||(y=C`<span slot="subtitle">${0}</span>`),this.headerSubtitle):(0,s.qy)(x||(x=C`<slot name="headerSubtitle" slot="subtitle"></slot>`))),this._handleBodyScroll,this.renderScrollableFades())}disconnectedCallback(){this.removeEventListener("dialog-set-fullscreen",this._handleFullscreenChanged),this._setFullscreen(!1),super.disconnectedCallback(),this._open=!1}_handleFullscreenChanged(e){this._open?(0,h.J)(()=>{this._setFullscreen(e.detail)}):this._setFullscreen(e.detail)}_setFullscreen(e){this.toggleAttribute("fullscreen",e)}_handleBodyScroll(e){this._bodyScrolled=e.target.scrollTop>0}_handleKeyDown(e){"Escape"===e.key&&(this._escapePressed=!0,this.preventScrimClose&&e.preventDefault(),e.stopPropagation(),e.currentTarget.open=!1)}_handleHide(e){var t;const a=(null===(t=e.detail)||void 0===t?void 0:t.source)===e.target.dialog;this.preventScrimClose&&this._escapePressed&&a&&e.preventDefault(),this._escapePressed=!1}static get styles(){return[...super.styles,u.dp,(0,s.AH)(k||(k=C`wa-dialog{--full-width:var(
--ha-dialog-width-full,
min(95vw, var(--safe-width))
);--width:min(var(--ha-dialog-width-md, 580px), var(--full-width));--spacing:var(--dialog-content-padding, var(--ha-space-6));--show-duration:var(--ha-dialog-show-duration, 200ms);--hide-duration:var(--ha-dialog-hide-duration, 200ms);--wa-color-surface-raised:var(
--ha-dialog-surface-background,
var(--card-background-color, var(--ha-color-surface-default))
);--wa-panel-border-radius:var(
--ha-dialog-border-radius,
var(--ha-border-radius-3xl)
);max-width:var(--ha-dialog-max-width,var(--safe-width))} (prefers-reduced-motion:reduce){wa-dialog{--show-duration:0ms;--hide-duration:0ms}}:host([width=small]) wa-dialog{--width:min(var(--ha-dialog-width-sm, 320px), var(--full-width))}:host([width=large]) wa-dialog{--width:min(var(--ha-dialog-width-lg, 1024px), var(--full-width))}:host([fullscreen]) wa-dialog,:host([width=full]) wa-dialog{--width:var(--full-width)}:host([fullscreen]) wa-dialog::part(dialog){min-height:var(--safe-height);max-height:var(--safe-height);margin-top:0;transform:none}:host([fullscreen]) .content-wrapper{overflow:hidden}:host([fullscreen]) .body{overflow:hidden;padding:0}wa-dialog::part(dialog){-webkit-backdrop-filter:var(--ha-dialog-surface-backdrop-filter,none);backdrop-filter:var(--ha-dialog-surface-backdrop-filter,none);box-shadow:var(--dialog-box-shadow,var(--wa-shadow-l));color:var(--primary-text-color);min-width:var(--width,var(--full-width));max-width:var(--width,var(--full-width));max-height:var(--ha-dialog-max-height,calc(var(--safe-height) - var(--ha-space-20)));min-height:var(--ha-dialog-min-height);margin-top:var(--dialog-surface-margin-top,auto);transform:translate(calc(var(--safe-area-offset-left,0px) - var(--safe-area-offset-right,0px)),calc(var(--safe-area-offset-top,0px) - var(--safe-area-offset-bottom,0px)));display:flex;flex-direction:column;overflow:hidden}wa-dialog::part(dialog)::backdrop{-webkit-backdrop-filter:var(--ha-dialog-scrim-backdrop-filter,var(--dialog-backdrop-filter,none));backdrop-filter:var(--ha-dialog-scrim-backdrop-filter,var(--dialog-backdrop-filter,none));background-color:var(--mdc-dialog-scrim-color,none)} all and (max-width:450px),all and (max-height:500px){:host([type=standard]){--ha-dialog-border-radius:0}:host([type=standard]) wa-dialog{--full-width:var(--ha-dialog-width-full, 100vw);--width:var(--full-width)}:host([type=standard]) wa-dialog::part(dialog){min-height:var(--ha-dialog-min-height,100vh);min-height:var(--ha-dialog-min-height,100dvh);max-height:var(--ha-dialog-max-height,100vh);max-height:var(--ha-dialog-max-height,100dvh);margin-top:0;margin-bottom:0;padding-top:var(--safe-area-inset-top);padding-bottom:var(--safe-area-inset-bottom);padding-left:var(--safe-area-inset-left);padding-right:var(--safe-area-inset-right);transform:none}}.header-title-container{display:flex;align-items:center}.header-title{margin:0;margin-bottom:0;color:var(--ha-dialog-header-title-color,var(--primary-text-color));font-size:var(
--ha-dialog-header-title-font-size,
var(--ha-font-size-2xl)
);line-height:var(
--ha-dialog-header-title-line-height,
var(--ha-line-height-condensed)
);font-weight:var(--ha-dialog-header-title-font-weight,var(--ha-font-weight-normal));overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-right:var(--ha-space-3)}wa-dialog::part(body){padding:0;display:flex;flex-direction:column;max-width:100%;overflow:hidden}.content-wrapper{position:relative;flex:1;display:flex;flex-direction:column;min-height:0}.body{position:var(--dialog-content-position,relative);padding:var(--dialog-content-padding,0 var(--ha-space-6) var(--ha-space-6) var(--ha-space-6));overflow:auto;flex-grow:1}:host([flexcontent]) .body{max-width:100%;flex:1;display:flex;flex-direction:column}wa-dialog::part(footer){padding:0}::slotted([slot=footer]){display:flex;padding:var(--ha-space-3) var(--ha-space-4) var(--ha-space-4) var(--ha-space-4);gap:var(--ha-space-3);justify-content:flex-end;align-items:center;width:100%}`))]}constructor(...e){super(...e),this.open=!1,this.type="standard",this.width="medium",this.preventScrimClose=!1,this.headerSubtitlePosition="below",this.flexContent=!1,this.withoutHeader=!1,this._open=!1,this._bodyScrolled=!1,this._escapePressed=!1,this._handleShow=async e=>{e.eventPhase===Event.AT_TARGET&&(this._open=!0,(0,d.r)(this,"opened"),await this.updateComplete,requestAnimationFrame(()=>{var e,t;if(null!==(e=this._hassConfig)&&void 0!==e&&e.auth.external&&(0,g.V)(this._hassConfig.auth.external)){const e=this.querySelector("[autofocus]");return void(null!==e&&(e.id||(e.id="ha-dialog-autofocus"),this._hassConfig.auth.external.fireMessage({type:"focus_element",payload:{element_id:e.id}})))}null===(t=this.querySelector("[autofocus]"))||void 0===t||t.focus()}))},this._handleAfterShow=e=>{e.eventPhase===Event.AT_TARGET&&(0,d.r)(this,"after-show")},this._handleAfterHide=e=>{e.eventPhase===Event.AT_TARGET&&(this._open=!1,this._setFullscreen(!1),(0,d.r)(this,"closed"))}}}(0,i.Cg)([(0,n.MZ)({attribute:"aria-labelledby"})],S.prototype,"ariaLabelledBy",void 0),(0,i.Cg)([(0,n.MZ)({attribute:"aria-describedby"})],S.prototype,"ariaDescribedBy",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean,reflect:!0})],S.prototype,"open",void 0),(0,i.Cg)([(0,n.MZ)({reflect:!0})],S.prototype,"type",void 0),(0,i.Cg)([(0,n.MZ)({type:String,reflect:!0,attribute:"width"})],S.prototype,"width",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean,reflect:!0,attribute:"prevent-scrim-close"})],S.prototype,"preventScrimClose",void 0),(0,i.Cg)([(0,n.MZ)({attribute:"header-title"})],S.prototype,"headerTitle",void 0),(0,i.Cg)([(0,n.MZ)({attribute:"header-subtitle"})],S.prototype,"headerSubtitle",void 0),(0,i.Cg)([(0,n.MZ)({type:String,attribute:"header-subtitle-position"})],S.prototype,"headerSubtitlePosition",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean,reflect:!0,attribute:"flexcontent"})],S.prototype,"flexContent",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean,attribute:"without-header"})],S.prototype,"withoutHeader",void 0),(0,i.Cg)([(0,n.wk)()],S.prototype,"_open",void 0),(0,i.Cg)([(0,n.P)(".body")],S.prototype,"bodyContainer",void 0),(0,i.Cg)([(0,n.wk)(),(0,r.Fg)({context:c.D5,subscribe:!0})],S.prototype,"_i18n",void 0),(0,i.Cg)([(0,n.wk)(),(0,r.Fg)({context:c.WF,subscribe:!0})],S.prototype,"_hassConfig",void 0),(0,i.Cg)([(0,n.wk)()],S.prototype,"_bodyScrolled",void 0),(0,i.Cg)([(0,n.Ls)({passive:!0})],S.prototype,"_handleBodyScroll",null),S=(0,i.Cg)([(0,n.EM)("ha-dialog")],S),t()}catch(f){t(f)}})},65829:function(e,t,a){a.a(e,async function(e,i){try{a.r(t),a.d(t,{HaSpinner:function(){return c}});var o=a(40445),r=a(55262),s=a(5124),n=a(67576),l=e([r]);r=(l.then?(await l)():l)[0];let d,h=e=>e;class c extends r.A{updated(e){if(super.updated(e),e.has("size"))switch(this.size){case"tiny":this.style.setProperty("--ha-spinner-size","16px");break;case"small":this.style.setProperty("--ha-spinner-size","28px");break;case"medium":this.style.setProperty("--ha-spinner-size","48px");break;case"large":this.style.setProperty("--ha-spinner-size","68px");break;case void 0:this.style.removeProperty("--ha-progress-ring-size")}}static get styles(){return[r.A.styles,(0,s.AH)(d||(d=h`:host{--indicator-color:var(
--ha-spinner-indicator-color,
var(--primary-color)
);--track-color:var(--ha-spinner-divider-color, var(--divider-color));--track-width:4px;--speed:3.5s;font-size:var(--ha-spinner-size, 48px)}`))]}}(0,o.Cg)([(0,n.MZ)()],c.prototype,"size",void 0),c=(0,o.Cg)([(0,n.EM)("ha-spinner")],c),i()}catch(d){i(d)}})},94355:function(e,t,a){a.a(e,async function(e,t){try{a(62953);var i=a(40445),o=a(88590),r=a(5124),s=a(67576),n=e([o]);o=(n.then?(await n)():n)[0];let l,d=e=>e;class h extends o.A{static get styles(){return[o.A.styles,(0,r.AH)(l||(l=d`:host{--indicator-color:var(
--ha-progress-bar-indicator-color,
var(--ha-color-on-primary-normal)
);--track-color:var(
--ha-progress-bar-track-color,
var(--ha-color-fill-neutral-normal-hover)
);--track-height:var(--ha-progress-bar-track-height, 12px);--wa-transition-slow:var(--ha-animation-duration-slow);position:relative}.progress-bar{border-radius:var(--ha-progress-bar-border-radius,var(--ha-border-radius-pill))}.indicator{background:var(--ha-progress-bar-indicator-background,var(--indicator-color))}:host([indeterminate]) .indicator{animation:wa-progress-indeterminate var(--ha-progress-bar-animation-duration,2.5s) infinite cubic-bezier(.37,0,.63,1)} slide-highlight{0%{transform:translateX(-200%)}100%{transform:translateX(200%)}}:host([loading]:not([indeterminate])) .progress-bar::after{content:"";position:absolute;inset:0;background:linear-gradient(90deg,transparent 0%,oklch(from var(--indicator-color) 85% c h) 50%,transparent 100%);opacity:.5;animation:slide-highlight var(--ha-progress-bar-animation-duration,2.5s) infinite cubic-bezier(.37,0,.63,1);width:50%}:host::after{--width:var(
--ha-progress-bar-indicator-highlight-width,
calc(var(--track-height) * 2)
);width:var(--width);height:var(--ha-progress-bar-indicator-highlight-height,calc(var(--track-height) * 2));content:"";position:absolute;inset-inline-start:clamp(var(--width)/ 2,var(--percentage,0%),calc(100% - var(--width)/ 2));top:50%;transform:translate(-50%,-50%);background-image:var(--ha-progress-bar-indicator-highlight-image);background-size:contain;background-repeat:no-repeat;background-position:center;pointer-events:none;transition:inset-inline-start var(--wa-transition-slow, 200ms) var(--wa-transition-easing, ease)}:host([indeterminate])::after{display:none}`))]}constructor(...e){super(...e),this.loading=!1}}(0,i.Cg)([(0,s.MZ)({type:Boolean,reflect:!0})],h.prototype,"loading",void 0),h=(0,i.Cg)([(0,s.EM)("ha-progress-bar")],h),t()}catch(l){t(l)}})},89441:function(e,t,a){a.d(t,{O:function(){return o}});a(3362),a(62953);var i=a(1087);const o=e=>class extends e{closeDialog(e){var t;if(this._closePromise)return this._closePromise;const a=null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector("ha-adaptive-popover, ha-adaptive-dialog, ha-dialog, ha-bottom-sheet");return a&&(this._closePromise=new Promise(e=>{this._closeResolve=e}),a.open=!1),this._closePromise||!0}connectedCallback(){super.connectedCallback(),this.addEventListener("closed",this._removeDialog,{once:!0})}disconnectedCallback(){this._dialogClosedFired||(0,i.r)(this,"dialog-closed",{dialog:this.localName}),this.removeEventListener("closed",this._removeDialog),super.disconnectedCallback()}constructor(...e){super(...e),this.dialogNext=!0,this._dialogClosedFired=!1,this._removeDialog=e=>{var t;e.stopPropagation(),null===(t=this._closeResolve)||void 0===t||t.call(this,!0),this._closePromise=void 0,this._closeResolve=void 0,this._dialogClosedFired=!0,(0,i.r)(this,"dialog-closed",{dialog:this.localName}),this.remove()}}}},59992:function(e,t,a){a.a(e,async function(e,i){try{a.d(t,{V:function(){return g}});a(62953);var o=a(40445),r=a(88696),s=a(5124),n=a(6412),l=a(67576),d=e([r]);r=(d.then?(await d)():d)[0];let h,c,p=e=>e;const u=e=>void 0===e?[]:Array.isArray(e)?e:[e],g=e=>{class t extends e{get scrollableElement(){return t.DEFAULT_SCROLLABLE_ELEMENT}firstUpdated(e){var t;null===(t=super.firstUpdated)||void 0===t||t.call(this,e),this.scrollableElement&&this._updateScrollableState(this.scrollableElement),this._attachScrollableElement()}updated(e){var t;null===(t=super.updated)||void 0===t||t.call(this,e),this._attachScrollableElement()}disconnectedCallback(){this._detachScrollableElement(),this._contentScrolled=!1,this._contentScrollable=!1,super.disconnectedCallback()}renderScrollableFades(e=!1){return(0,s.qy)(h||(h=p` <div class="${0}"></div> <div class="${0}"></div> `),(0,n.H)({"fade-top":!0,rounded:e,visible:this._contentScrolled}),(0,n.H)({"fade-bottom":!0,rounded:e,visible:this._contentScrollable}))}static get styles(){var e;const t=Object.getPrototypeOf(this);return[...u(null!==(e=null==t?void 0:t.styles)&&void 0!==e?e:[]),(0,s.AH)(c||(c=p`.fade-bottom,.fade-top{position:absolute;left:0;right:0;height:var(--ha-space-2);pointer-events:none;transition:opacity 180ms ease-in-out;border-radius:var(--ha-border-radius-square);opacity:0;background:linear-gradient(to bottom,var(--ha-color-shadow-scrollable-fade),transparent)}.fade-top{top:0}.fade-bottom{bottom:0;transform:rotate(180deg)}.fade-bottom.visible,.fade-top.visible{opacity:1}.fade-bottom.rounded,.fade-top.rounded{border-radius:var(--ha-card-border-radius,var(--ha-border-radius-lg));border-bottom-left-radius:var(--ha-border-radius-square);border-bottom-right-radius:var(--ha-border-radius-square)}.fade-top.rounded{border-top-left-radius:var(--ha-border-radius-square);border-top-right-radius:var(--ha-border-radius-square)}.fade-bottom.rounded{border-bottom-left-radius:var(--ha-border-radius-square);border-bottom-right-radius:var(--ha-border-radius-square)}`))]}_attachScrollableElement(){const e=this.scrollableElement;e!==this._scrollTarget&&(this._detachScrollableElement(),e&&(this._scrollTarget=e,e.addEventListener("scroll",this._onScroll,{passive:!0}),this._resize.observe(e),this._updateScrollableState(e)))}_detachScrollableElement(){var e,t;this._scrollTarget&&(this._scrollTarget.removeEventListener("scroll",this._onScroll),null===(e=(t=this._resize).unobserve)||void 0===e||e.call(t,this._scrollTarget),this._scrollTarget=void 0)}_updateScrollableState(e){const t=parseFloat(getComputedStyle(e).getPropertyValue("--safe-area-inset-bottom"))||0,{scrollHeight:a=0,clientHeight:i=0,scrollTop:o=0}=e;this._contentScrollable=a-i>o+t+this.scrollFadeSafeAreaPadding}constructor(...e){super(...e),this._contentScrolled=!1,this._contentScrollable=!1,this._onScroll=e=>{var t;const a=e.currentTarget;this._contentScrolled=(null!==(t=a.scrollTop)&&void 0!==t?t:0)>this.scrollFadeThreshold,this._updateScrollableState(a)},this._resize=new r.P(this,{target:null,callback:e=>{var t;const a=null===(t=e[0])||void 0===t?void 0:t.target;a&&this._updateScrollableState(a)}}),this.scrollFadeSafeAreaPadding=4,this.scrollFadeThreshold=4}}return t.DEFAULT_SCROLLABLE_ELEMENT=null,(0,o.Cg)([(0,l.wk)()],t.prototype,"_contentScrolled",void 0),(0,o.Cg)([(0,l.wk)()],t.prototype,"_contentScrollable",void 0),t};i()}catch(h){i(h)}})},86045:function(e,t,a){a.d(t,{o:function(){return i}});const i=(0,a(35211).q6)("zwaveJsRebuildNetworkRoutesProgress")},20530:function(e,t,a){a.a(e,async function(e,i){try{a.r(t);a(44114),a(3362),a(62953);var o=a(40445),r=a(35211),s=a(5124),n=a(67576),l=a(22786),d=a(18350),h=a(72554),c=(a(93444),a(3109),a(65829)),p=a(94355),u=a(22792),g=a(72001),v=a(89441),b=a(86045),f=a(28540),_=e([d,h,c,p]);[d,h,c,p]=_.then?(await _)():_;let m,w,y,x,k,C,$,S,z,L,A,P,E,T,M=e=>e;const q="M13 14H11V9H13M13 18H11V16H13M1 21H23L12 2L1 21Z",F="M12 2C6.5 2 2 6.5 2 12S6.5 22 12 22 22 17.5 22 12 17.5 2 12 2M10 17L5 12L6.41 10.59L10 14.17L17.59 6.58L19 8L10 17Z",H="M12,2C17.53,2 22,6.47 22,12C22,17.53 17.53,22 12,22C6.47,22 2,17.53 2,12C2,6.47 6.47,2 12,2M15.59,7L12,10.59L8.41,7L7,8.41L10.59,12L7,15.59L8.41,17L12,13.41L15.59,17L17,15.59L13.41,12L17,8.41L15.59,7Z",D="M16,18H18V6H16M6,18L14.5,12L6,6V18Z",V="M19,8C19.56,8 20,8.43 20,9A1,1 0 0,1 19,10C18.43,10 18,9.55 18,9C18,8.43 18.43,8 19,8M2,2V11C2,13.96 4.19,16.5 7.14,16.91C7.76,19.92 10.42,22 13.5,22A6.5,6.5 0 0,0 20,15.5V11.81C21.16,11.39 22,10.29 22,9A3,3 0 0,0 19,6A3,3 0 0,0 16,9C16,10.29 16.84,11.4 18,11.81V15.41C18,17.91 16,19.91 13.5,19.91C11.5,19.91 9.82,18.7 9.22,16.9C12,16.3 14,13.8 14,11V2H10V5H12V11A4,4 0 0,1 8,15A4,4 0 0,1 4,11V5H6V2H2Z",j="M12,18A6,6 0 0,1 6,12C6,11 6.25,10.03 6.7,9.2L5.24,7.74C4.46,8.97 4,10.43 4,12A8,8 0 0,0 12,20V23L16,19L12,15M12,4V1L8,5L12,9V6A6,6 0 0,1 18,12C18,13 17.75,13.97 17.3,14.8L18.76,16.26C19.54,15.03 20,13.57 20,12A8,8 0 0,0 12,4Z";class Z extends((0,v.O)(s.WF)){connectedCallback(){var e;super.connectedCallback(),null!==(e=this.params)&&void 0!==e&&e.entry_id&&this._fetchData()}render(){return this.params&&this.params.entry_id?(0,s.qy)(m||(m=M` <ha-dialog open header-title="${0}"> ${0} <ha-dialog-footer slot="footer"> ${0} </ha-dialog-footer> </ha-dialog> `),this._i18n.localize("ui.panel.config.zwave_js.rebuild_network_routes.title"),this._status?"ready"===this._status?(0,s.qy)(y||(y=M` <div class="flex-container"> <ha-svg-icon .path="${0}" class="status-icon introduction"></ha-svg-icon> <div class="status"> <p> ${0} </p> </div> </div> <p> <em> ${0} </em> </p> `),V,this._i18n.localize("ui.panel.config.zwave_js.rebuild_network_routes.introduction"),this._i18n.localize("ui.panel.config.zwave_js.rebuild_network_routes.traffic_warning")):"started"===this._status?(0,s.qy)(x||(x=M` <div class="status"> <p> <b> ${0} </b> </p> <p> ${0} </p> </div> <ha-progress-bar loading .indeterminate="${0}" .value="${0}"> </ha-progress-bar> ${0} `),this._i18n.localize("ui.panel.config.zwave_js.rebuild_network_routes.in_progress"),this._i18n.localize("ui.panel.config.zwave_js.rebuild_network_routes.run_in_background"),!this._progress,this._progress?this._progressPercent(this._progress):void 0,this._progress?(0,s.qy)(k||(k=M` <div class="progress-detail"> <ha-button .progressType="${0}" ="${0}" appearance="outlined" variant="warning" size="small" .title="${0}"> ${0} <ha-svg-icon .path="${0}" slot="end"></ha-svg-icon> </ha-button> <ha-button .progressType="${0}" ="${0}" appearance="outlined" variant="success" size="small" .title="${0}"> ${0} <ha-svg-icon .path="${0}" slot="end"></ha-svg-icon> </ha-button> ${0} ${0} </div>`),"pending",this._showProgressDetail,this._i18n.localize("ui.panel.config.zwave_js.rebuild_network_routes.progress.in_progress",{count:this._progress.pending.length}),this._progress.pending.length,j,"done",this._showProgressDetail,this._i18n.localize("ui.panel.config.zwave_js.rebuild_network_routes.progress.completed",{count:this._progress.done.length}),this._progress.done.length,F,this._progress.failed.length?(0,s.qy)(C||(C=M`<ha-button .progressType="${0}" ="${0}" appearance="outlined" variant="danger" size="small" .title="${0}"> ${0} <ha-svg-icon .path="${0}" slot="end"></ha-svg-icon> </ha-button>`),"failed",this._showProgressDetail,this._i18n.localize("ui.panel.config.zwave_js.rebuild_network_routes.progress.failed",{count:this._progress.failed.length}),this._progress.failed.length,q):s.s6,this._progress.skipped.length?(0,s.qy)($||($=M`<ha-button .progressType="${0}" ="${0}" appearance="outlined" variant="neutral" size="small" .title="${0}"> ${0} <ha-svg-icon .path="${0}" slot="end"></ha-svg-icon> </ha-button>`),"skipped",this._showProgressDetail,this._i18n.localize("ui.panel.config.zwave_js.rebuild_network_routes.progress.skipped",{count:this._progress.skipped.length}),this._progress.skipped.length,D):s.s6):s.s6):"failed"===this._status?(0,s.qy)(S||(S=M` <div class="flex-container"> <ha-svg-icon .path="${0}" class="status-icon failed"></ha-svg-icon> <div class="status"> <p> ${0} </p> </div> </div> `),H,this._i18n.localize("ui.panel.config.zwave_js.rebuild_network_routes.rebuilding_routes_failed")):"finished"===this._status?(0,s.qy)(z||(z=M` <div class="flex-container"> <ha-svg-icon .path="${0}" class="status-icon success"></ha-svg-icon> <div class="status"> <p> ${0} </p> </div> </div> `),F,this._i18n.localize("ui.panel.config.zwave_js.rebuild_network_routes.rebuilding_routes_complete")):"cancelled"===this._status?(0,s.qy)(L||(L=M` <div class="flex-container"> <ha-svg-icon .path="${0}" class="status-icon failed"></ha-svg-icon> <div class="status"> <p> ${0} </p> </div> </div> `),H,this._i18n.localize("ui.panel.config.zwave_js.rebuild_network_routes.rebuilding_routes_cancelled")):s.s6:(0,s.qy)(w||(w=M` <ha-fade-in .delay="${0}"><ha-spinner size="large"></ha-spinner></ha-fade-in> `),500),"ready"===this._status?(0,s.qy)(A||(A=M` <ha-button slot="primaryAction" ="${0}"> ${0} </ha-button> `),this._startRebuildingRoutes,this._i18n.localize("ui.panel.config.zwave_js.rebuild_network_routes.start_rebuilding_routes")):"started"===this._status?(0,s.qy)(P||(P=M` <ha-button slot="secondaryAction" appearance="plain" ="${0}" variant="danger"> ${0} </ha-button> <ha-button slot="primaryAction" ="${0}"> ${0} </ha-button> `),this._stopRebuildingRoutes,this._i18n.localize("ui.panel.config.zwave_js.rebuild_network_routes.stop_rebuilding_routes"),this.closeDialog,this._i18n.localize("ui.common.close")):(0,s.qy)(E||(E=M` <ha-button slot="primaryAction" ="${0}"> ${0} </ha-button> `),this.closeDialog,this._i18n.localize("ui.common.close"))):s.s6}async _fetchData(){(await(0,g.Is)(this._connection.connection,{entry_id:this.params.entry_id})).controller.is_rebuilding_routes?(this._status="started",this._startSubscribingToProgress()):this._status="ready"}_startRebuildingRoutes(){(0,g.Lx)(this._connection.connection,this.params.entry_id),this._status="started",this._startSubscribingToProgress()}async _startSubscribingToProgress(){this._subscribed=(0,g.S0)(this._connection.connection,this.params.entry_id,this._handleMessage)}_stopRebuildingRoutes(){(0,g.Tx)(this._connection.connection,this.params.entry_id),this._unsubscribe(),this._status="cancelled"}_showProgressDetail(e){const t=e.target;(0,f.S)(this,{type:t.progressType,configEntryId:this.params.entry_id})}_unsubscribe(){this._subscribed&&(this._subscribed.then(e=>e()),this._subscribed=void 0)}disconnectedCallback(){super.disconnectedCallback(),this._unsubscribe()}static get styles(){return[(0,s.AH)(T||(T=M`.success{color:var(--success-color)}.failed{color:var(--error-color)}.flex-container{display:flex;align-items:center}ha-svg-icon.status-icon{width:68px;height:48px}ha-svg-icon.introduction{color:var(--primary-color)}.flex-container ha-svg-icon{margin-right:20px;margin-inline-end:20px;margin-inline-start:initial}ha-progress-bar{margin-top:var(--ha-space-8)}.progress-detail{margin-top:var(--ha-space-4);display:flex;justify-content:flex-end;flex-wrap:wrap;gap:var(--ha-space-3)}.progress-detail ha-button{--ha-font-weight-medium:var(--ha-font-weight-normal)}.progress-detail ha-button::part(label){white-space:nowrap}`))]}constructor(...e){super(...e),this._handleMessage=e=>{if("rebuild routes progress"===e.event){const t={pending:[],skipped:[],done:[],failed:[]};for(const[a,i]of Object.entries(e.rebuild_routes_status))t[i].push(Number(a));this._progress=t}"rebuild routes done"===e.event&&(this._unsubscribe(),this._status="finished")},this._progressPercent=(0,l.A)(e=>{const t=e.done.length+e.skipped.length+e.failed.length,a=t+e.pending.length;return a>0?t/a*100:0})}}(0,o.Cg)([(0,n.wk)(),(0,r.Fg)({context:u.D5,subscribe:!0})],Z.prototype,"_i18n",void 0),(0,o.Cg)([(0,n.wk)(),(0,r.Fg)({context:u.Wq,subscribe:!0})],Z.prototype,"_connection",void 0),(0,o.Cg)([(0,r.Gt)({context:b.o}),(0,n.wk)()],Z.prototype,"_progress",void 0),(0,o.Cg)([(0,n.wk)()],Z.prototype,"_status",void 0),Z=(0,o.Cg)([(0,n.EM)("dialog-zwave_js-rebuild-network-routes")],Z),i()}catch(m){i(m)}})},28540:function(e,t,a){a.d(t,{S:function(){return r}});a(3362),a(62953);var i=a(1087);const o=()=>Promise.all([a.e(8851),a.e(82125)]).then(a.bind(a,76698)),r=(e,t)=>{(0,i.r)(e,"show-dialog",{parentElement:e,dialogTag:"dialog-zwave_js-rebuild-network-routes-detail",dialogImport:o,dialogParams:t})}},69235:function(e,t,a){a.a(e,async function(e,t){try{a(3362),a(62953);"function"!=typeof window.ResizeObserver&&(window.ResizeObserver=(await a.e(71055).then(a.bind(a,52370))).default),t()}catch(i){t(i)}},1)},22348:function(e,t,a){a.d(t,{V:function(){return o}});var i=a(37177);const o=e=>!!e&&i.n},37177:function(e,t,a){a.d(t,{n:function(){return i}});a(27495);const i=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}}]);