UNPKG

iobroker.lovelace

Version:

With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI

17 lines 37.7 kB
/*! For license information please see 11009.c4f472813501449c.js.LICENSE.txt */ "use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[11009],{69093:function(t,e,o){o.d(e,{t:function(){return i}});var a=o(71727);const i=t=>(0,a.m)(t.entity_id)},82286:function(t,e,o){o.d(e,{$:function(){return a}});const a=(t,e)=>i(t.attributes,e),i=(t,e)=>0!==(t.supported_features&e)},64481:function(t,e,o){o.d(e,{D:function(){return i},J:function(){return s}});o(16280),o(3362),o(55815),o(64979),o(79739);let a=!1;try{a="true"===window.localStorage.getItem("disableViewTransition")}catch(n){}const i=t=>{a=t},r=t=>{if(!(t=>(t instanceof DOMException||t instanceof Error)&&"AbortError"===t.name)(t))throw t},s=t=>{if(!document.startViewTransition||a)return t(!1),Promise.resolve();let e=!1;try{const o=document.startViewTransition(()=>{e=!0,t(!0)});return o.ready.catch(r),o.finished.catch(r)}catch(o){return console.warn("View transition failed, falling back to direct execution.",o),e?Promise.reject(o):(t(!1),Promise.resolve())}}},89300:function(t,e,o){o.a(t,async function(t,e){try{o(62953);var a=o(40445),i=o(5124),r=o(67576),s=o(6412),n=o(18350),l=o(65829),d=(o(67094),t([n,l]));[n,l]=d.then?(await d)():d;let h,c,u,p,g,v,f=t=>t;const m="M2.2,16.06L3.88,12L2.2,7.94L6.26,6.26L7.94,2.2L12,3.88L16.06,2.2L17.74,6.26L21.8,7.94L20.12,12L21.8,16.06L17.74,17.74L16.06,21.8L12,20.12L7.94,21.8L6.26,17.74L2.2,16.06M13,17V15H11V17H13M13,13V7H11V13H13Z",b="M9,20.42L2.79,14.21L5.62,11.38L9,14.77L18.88,4.88L21.71,7.71L9,20.42Z";class w extends i.WF{render(){const t=this.progress||this._result?"accent":this.appearance;return(0,i.qy)(h||(h=f` <ha-button .appearance="${0}" .disabled="${0}" .loading="${0}" .variant="${0}" class="${0}"> ${0} <slot>${0}</slot> </ha-button> ${0} `),t,this.disabled,this.progress,"success"===this._result?"success":"error"===this._result?"danger":this.variant,(0,s.H)({result:!!this._result,success:"success"===this._result,error:"error"===this._result}),this.iconPath?(0,i.qy)(c||(c=f`<ha-svg-icon .path="${0}" slot="start"></ha-svg-icon>`),this.iconPath):i.s6,this.label,this._result?(0,i.qy)(u||(u=f` <div class="progress"> ${0} </div> `),"success"===this._result?(0,i.qy)(p||(p=f`<ha-svg-icon .path="${0}"></ha-svg-icon>`),b):"error"===this._result?(0,i.qy)(g||(g=f`<ha-svg-icon .path="${0}"></ha-svg-icon>`),m):i.s6):i.s6)}actionSuccess(){this._setResult("success")}actionError(){this._setResult("error")}_setResult(t){this._result=t,setTimeout(()=>{this._result=void 0},2e3)}constructor(...t){super(...t),this.disabled=!1,this.progress=!1,this.appearance="accent",this.variant="brand"}}w.styles=(0,i.AH)(v||(v=f`:host{outline:0;display:inline-block;position:relative}:host([progress]){pointer-events:none}.progress{bottom:0;display:flex;justify-content:center;align-items:center;position:absolute;top:0;width:100%}ha-button{width:100%}ha-button.result::part(caret),ha-button.result::part(end),ha-button.result::part(label),ha-button.result::part(spinner),ha-button.result::part(start){visibility:hidden}:host([appearance=brand]) ha-svg-icon{color:var(--white-color)}`)),(0,a.Cg)([(0,r.MZ)()],w.prototype,"label",void 0),(0,a.Cg)([(0,r.MZ)({type:Boolean})],w.prototype,"disabled",void 0),(0,a.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],w.prototype,"progress",void 0),(0,a.Cg)([(0,r.MZ)()],w.prototype,"appearance",void 0),(0,a.Cg)([(0,r.MZ)({attribute:!1})],w.prototype,"iconPath",void 0),(0,a.Cg)([(0,r.MZ)()],w.prototype,"variant",void 0),(0,a.Cg)([(0,r.wk)()],w.prototype,"_result",void 0),w=(0,a.Cg)([(0,r.EM)("ha-progress-button")],w),e()}catch(h){e(h)}})},93444:function(t,e,o){var a=o(40445),i=o(5124),r=o(67576);let s,n,l=t=>t;class d extends i.WF{render(){return(0,i.qy)(s||(s=l` <footer> <slot name="secondaryAction"></slot> <slot name="primaryAction"></slot> </footer> `))}static get styles(){return[(0,i.AH)(n||(n=l`footer{display:flex;gap:var(--ha-space-3);justify-content:flex-end;align-items:center;width:100%}`))]}}d=(0,a.Cg)([(0,r.EM)("ha-dialog-footer")],d)},76538:function(t,e,o){o(62953);var a=o(40445),i=o(5124),r=o(67576);let s,n,l,d,h,c,u=t=>t;class p extends i.WF{render(){const t=(0,i.qy)(s||(s=u`<div class="header-title"> <slot name="title"></slot> </div>`)),e=(0,i.qy)(n||(n=u`<div class="header-subtitle"> <slot name="subtitle"></slot> </div>`));return(0,i.qy)(l||(l=u` <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,i.qy)(d||(d=u`${0}${0}`),e,t):(0,i.qy)(h||(h=u`${0}${0}`),t,e))}static get styles(){return[(0,i.AH)(c||(c=u`: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))}@media 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(...t){super(...t),this.subtitlePosition="below",this.showBorder=!1}}(0,a.Cg)([(0,r.MZ)({type:String,attribute:"subtitle-position"})],p.prototype,"subtitlePosition",void 0),(0,a.Cg)([(0,r.MZ)({type:Boolean,reflect:!0,attribute:"show-border"})],p.prototype,"showBorder",void 0),p=(0,a.Cg)([(0,r.EM)("ha-dialog-header")],p)},72554:function(t,e,o){o.a(t,async function(t,e){try{o(3362),o(62953),o(49255);var a=o(40445),i=o(93900),r=o(35211),s=o(5124),n=o(67576),l=o(63672),d=o(1087),h=o(64481),c=o(22792),u=o(59992),p=o(14503),g=o(22348),v=(o(76538),o(26300)),f=t([i,v,u]);[i,v,u]=f.then?(await f)():f;let m,b,w,y,_,x,k,C=t=>t;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,u.V)(s.WF)){connectedCallback(){super.connectedCallback(),this.addEventListener("dialog-set-fullscreen",this._handleFullscreenChanged)}get scrollableElement(){return this.bodyContainer}updated(t){super.updated(t),t.has("open")&&(this._open=this.open)}render(){var t,e,o;return(0,s.qy)(m||(m=C` <wa-dialog .open="${0}" .lightDismiss="${0}" without-header aria-labelledby="${0}" aria-describedby="${0}" @keydown="${0}" @wa-hide="${0}" @wa-show="${0}" @wa-after-show="${0}" @wa-after-hide="${0}"> ${0} <div class="content-wrapper"> <div class="body ha-scrollbar" @scroll="${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)(b||(b=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!==(t=null===(e=this._i18n)||void 0===e||null===(o=e.localize)||void 0===o?void 0:o.call(e,"ui.common.close"))&&void 0!==t?t:"Close",$,void 0!==this.headerTitle?(0,s.qy)(w||(w=C`<span slot="title" class="title" id="ha-dialog-title"> ${0} </span>`),this.headerTitle):(0,s.qy)(y||(y=C`<slot name="headerTitle" slot="title"></slot>`)),void 0!==this.headerSubtitle?(0,s.qy)(_||(_=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(t){this._open?(0,h.J)(()=>{this._setFullscreen(t.detail)}):this._setFullscreen(t.detail)}_setFullscreen(t){this.toggleAttribute("fullscreen",t)}_handleBodyScroll(t){this._bodyScrolled=t.target.scrollTop>0}_handleKeyDown(t){"Escape"===t.key&&(this._escapePressed=!0,this.preventScrimClose&&t.preventDefault(),t.stopPropagation(),t.currentTarget.open=!1)}_handleHide(t){var e;const o=(null===(e=t.detail)||void 0===e?void 0:e.source)===t.target.dialog;this.preventScrimClose&&this._escapePressed&&o&&t.preventDefault(),this._escapePressed=!1}static get styles(){return[...super.styles,p.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))}@media (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)}@media 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(...t){super(...t),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 t=>{t.eventPhase===Event.AT_TARGET&&(this._open=!0,(0,d.r)(this,"opened"),await this.updateComplete,requestAnimationFrame(()=>{var t,e;if(null!==(t=this._hassConfig)&&void 0!==t&&t.auth.external&&(0,g.V)(this._hassConfig.auth.external)){const t=this.querySelector("[autofocus]");return void(null!==t&&(t.id||(t.id="ha-dialog-autofocus"),this._hassConfig.auth.external.fireMessage({type:"focus_element",payload:{element_id:t.id}})))}null===(e=this.querySelector("[autofocus]"))||void 0===e||e.focus()}))},this._handleAfterShow=t=>{t.eventPhase===Event.AT_TARGET&&(0,d.r)(this,"after-show")},this._handleAfterHide=t=>{t.eventPhase===Event.AT_TARGET&&(this._open=!1,this._setFullscreen(!1),(0,d.r)(this,"closed"))}}}(0,a.Cg)([(0,n.MZ)({attribute:"aria-labelledby"})],S.prototype,"ariaLabelledBy",void 0),(0,a.Cg)([(0,n.MZ)({attribute:"aria-describedby"})],S.prototype,"ariaDescribedBy",void 0),(0,a.Cg)([(0,n.MZ)({type:Boolean,reflect:!0})],S.prototype,"open",void 0),(0,a.Cg)([(0,n.MZ)({reflect:!0})],S.prototype,"type",void 0),(0,a.Cg)([(0,n.MZ)({type:String,reflect:!0,attribute:"width"})],S.prototype,"width",void 0),(0,a.Cg)([(0,n.MZ)({type:Boolean,reflect:!0,attribute:"prevent-scrim-close"})],S.prototype,"preventScrimClose",void 0),(0,a.Cg)([(0,n.MZ)({attribute:"header-title"})],S.prototype,"headerTitle",void 0),(0,a.Cg)([(0,n.MZ)({attribute:"header-subtitle"})],S.prototype,"headerSubtitle",void 0),(0,a.Cg)([(0,n.MZ)({type:String,attribute:"header-subtitle-position"})],S.prototype,"headerSubtitlePosition",void 0),(0,a.Cg)([(0,n.MZ)({type:Boolean,reflect:!0,attribute:"flexcontent"})],S.prototype,"flexContent",void 0),(0,a.Cg)([(0,n.MZ)({type:Boolean,attribute:"without-header"})],S.prototype,"withoutHeader",void 0),(0,a.Cg)([(0,n.wk)()],S.prototype,"_open",void 0),(0,a.Cg)([(0,n.P)(".body")],S.prototype,"bodyContainer",void 0),(0,a.Cg)([(0,n.wk)(),(0,r.Fg)({context:c.D5,subscribe:!0})],S.prototype,"_i18n",void 0),(0,a.Cg)([(0,n.wk)(),(0,r.Fg)({context:c.WF,subscribe:!0})],S.prototype,"_hassConfig",void 0),(0,a.Cg)([(0,n.wk)()],S.prototype,"_bodyScrolled",void 0),(0,a.Cg)([(0,n.Ls)({passive:!0})],S.prototype,"_handleBodyScroll",null),S=(0,a.Cg)([(0,n.EM)("ha-dialog")],S),e()}catch(m){e(m)}})},59992:function(t,e,o){o.a(t,async function(t,a){try{o.d(e,{V:function(){return g}});o(62953);var i=o(40445),r=o(88696),s=o(5124),n=o(6412),l=o(67576),d=t([r]);r=(d.then?(await d)():d)[0];let h,c,u=t=>t;const p=t=>void 0===t?[]:Array.isArray(t)?t:[t],g=t=>{class e extends t{get scrollableElement(){return e.DEFAULT_SCROLLABLE_ELEMENT}firstUpdated(t){var e;null===(e=super.firstUpdated)||void 0===e||e.call(this,t),this.scrollableElement&&this._updateScrollableState(this.scrollableElement),this._attachScrollableElement()}updated(t){var e;null===(e=super.updated)||void 0===e||e.call(this,t),this._attachScrollableElement()}disconnectedCallback(){this._detachScrollableElement(),this._contentScrolled=!1,this._contentScrollable=!1,super.disconnectedCallback()}renderScrollableFades(t=!1){return(0,s.qy)(h||(h=u` <div class="${0}"></div> <div class="${0}"></div> `),(0,n.H)({"fade-top":!0,rounded:t,visible:this._contentScrolled}),(0,n.H)({"fade-bottom":!0,rounded:t,visible:this._contentScrollable}))}static get styles(){var t;const e=Object.getPrototypeOf(this);return[...p(null!==(t=null==e?void 0:e.styles)&&void 0!==t?t:[]),(0,s.AH)(c||(c=u`.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 t=this.scrollableElement;t!==this._scrollTarget&&(this._detachScrollableElement(),t&&(this._scrollTarget=t,t.addEventListener("scroll",this._onScroll,{passive:!0}),this._resize.observe(t),this._updateScrollableState(t)))}_detachScrollableElement(){var t,e;this._scrollTarget&&(this._scrollTarget.removeEventListener("scroll",this._onScroll),null===(t=(e=this._resize).unobserve)||void 0===t||t.call(e,this._scrollTarget),this._scrollTarget=void 0)}_updateScrollableState(t){const e=parseFloat(getComputedStyle(t).getPropertyValue("--safe-area-inset-bottom"))||0,{scrollHeight:o=0,clientHeight:a=0,scrollTop:i=0}=t;this._contentScrollable=o-a>i+e+this.scrollFadeSafeAreaPadding}constructor(...t){super(...t),this._contentScrolled=!1,this._contentScrollable=!1,this._onScroll=t=>{var e;const o=t.currentTarget;this._contentScrolled=(null!==(e=o.scrollTop)&&void 0!==e?e:0)>this.scrollFadeThreshold,this._updateScrollableState(o)},this._resize=new r.P(this,{target:null,callback:t=>{var e;const o=null===(e=t[0])||void 0===e?void 0:e.target;o&&this._updateScrollableState(o)}}),this.scrollFadeSafeAreaPadding=4,this.scrollFadeThreshold=4}}return e.DEFAULT_SCROLLABLE_ELEMENT=null,(0,i.Cg)([(0,l.wk)()],e.prototype,"_contentScrolled",void 0),(0,i.Cg)([(0,l.wk)()],e.prototype,"_contentScrollable",void 0),e};a()}catch(h){a(h)}})},24367:function(t,e,o){o.d(e,{L:function(){return i},z:function(){return r}});var a=o(23832);const i=["input_boolean","input_button","input_text","input_number","input_datetime","input_select","counter","timer","schedule"],r=(0,a.g)(i)},67642:function(t,e,o){o.a(t,async function(t,a){try{o.r(e);o(74423),o(3362),o(27495),o(62953);var i=o(40445),r=o(5124),s=o(67576),n=o(22786),l=o(1087),d=o(15638),h=o(89300),c=(o(93444),o(52763)),u=o(26300),p=o(72554),g=o(47351),v=o(96273),f=o(14503),m=o(36918),b=t([h,c,u,p]);[h,c,u,p]=b.then?(await b)():b;let w,y,_,x,k=t=>t;const C="M11,18H13V16H11V18M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M12,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,6A4,4 0 0,0 8,10H10A2,2 0 0,1 12,8A2,2 0 0,1 14,10C14,12 11,11.75 11,15H13C13,12.75 16,12.5 16,10A4,4 0 0,0 12,6Z",$=(0,n.A)((t,e,o,a)=>[{name:"name",required:!0,disabled:e,selector:{text:{}}},{name:"usage",required:!0,type:"select",options:[[v.h1.BACKUP,t("ui.panel.config.storage.network_mounts.mount_usage.backup")],[v.h1.MEDIA,t("ui.panel.config.storage.network_mounts.mount_usage.media")],[v.h1.SHARE,t("ui.panel.config.storage.network_mounts.mount_usage.share")]]},{name:"server",required:!0,selector:{text:{}}},{name:"type",required:!0,type:"select",options:[[v.Wu.CIFS,t("ui.panel.config.storage.network_mounts.mount_type.cifs")],[v.Wu.NFS,t("ui.panel.config.storage.network_mounts.mount_type.nfs")]]},..."nfs"===o?[{name:"path",required:!0,selector:{text:{}}}]:"cifs"===o?[...a?[{name:"version",required:!0,selector:{select:{options:[{label:t("ui.panel.config.storage.network_mounts.cifs_versions.auto"),value:"auto"},{label:t("ui.panel.config.storage.network_mounts.cifs_versions.legacy",{version:"2.0"}),value:"2.0"},{label:t("ui.panel.config.storage.network_mounts.cifs_versions.legacy",{version:"1.0"}),value:"1.0"}],mode:"dropdown"}}}]:[],{name:"share",required:!0,selector:{text:{}}},{name:"username",required:!1,selector:{text:{}}},{name:"password",required:!1,selector:{text:{type:"password"}}}]:[]]);class S extends r.WF{async showDialog(t){var e;this._data=t.mount,this._existing=void 0!==t.mount,this._reloadMounts=t.reloadMounts,this._open=!0,"cifs"===(null===(e=t.mount)||void 0===e?void 0:e.type)&&t.mount.version&&"auto"!==t.mount.version&&(this._showCIFSVersion=!0)}closeDialog(){this._open=!1}_dialogClosed(){this._data=void 0,this._waiting=void 0,this._error=void 0,this._validationError=void 0,this._validationWarning=void 0,this._existing=void 0,this._showCIFSVersion=void 0,this._reloadMounts=void 0,(0,l.r)(this,"dialog-closed",{dialog:this.localName})}render(){var t;return void 0===this._existing?r.s6:(0,r.qy)(w||(w=k` <ha-dialog .open="${0}" header-title="${0}" prevent-scrim-close @closed="${0}"> <a slot="headerActionItems" class="header_button" href="${0}" title="${0}" target="_blank" rel="noreferrer" dir="${0}"> <ha-icon-button .path="${0}"></ha-icon-button> </a> ${0} <ha-form autofocus .data="${0}" .schema="${0}" .error="${0}" .warning="${0}" .computeLabel="${0}" .computeHelper="${0}" .computeError="${0}" .computeWarning="${0}" @value-changed="${0}"></ha-form> <ha-dialog-footer slot="footer"> ${0} <ha-button slot="secondaryAction" appearance="plain" @click="${0}"> ${0} </ha-button> <ha-progress-button slot="primaryAction" .progress="${0}" @click="${0}"> ${0} </ha-progress-button> </ha-dialog-footer> </ha-dialog> `),this._open,this._existing?this.hass.localize("ui.panel.config.storage.network_mounts.update_title"):this.hass.localize("ui.panel.config.storage.network_mounts.add_title"),this._dialogClosed,(0,m.o)(this.hass,"/common-tasks/os#network-storage"),this.hass.localize("ui.panel.config.storage.network_mounts.documentation"),(0,d.Vc)(this.hass),C,this._error?(0,r.qy)(y||(y=k`<ha-alert alert-type="error">${0}</ha-alert>`),this._error):r.s6,this._data,$(this.hass.localize,this._existing,null===(t=this._data)||void 0===t?void 0:t.type,this._showCIFSVersion),this._validationError,this._validationWarning,this._computeLabelCallback,this._computeHelperCallback,this._computeErrorCallback,this._computeWarningCallback,this._valueChanged,this._existing?(0,r.qy)(_||(_=k`<ha-button @click="${0}" variant="danger" slot="secondaryAction" appearance="plain"> ${0} </ha-button>`),this._deleteMount,this.hass.localize("ui.common.delete")):r.s6,this.closeDialog,this.hass.localize("ui.common.cancel"),!!this._waiting,this._connectMount,this._existing?this.hass.localize("ui.panel.config.storage.network_mounts.update"):this.hass.localize("ui.panel.config.storage.network_mounts.connect"))}_valueChanged(t){var e,o,a;this._validationError={},this._validationWarning={},this._data=t.detail.value,null!==(e=this._data)&&void 0!==e&&e.name&&!/^\w+$/.test(this._data.name)&&(this._validationError.name="invalid_name"),"cifs"!==(null===(o=this._data)||void 0===o?void 0:o.type)||this._data.version||(this._data.version="auto"),"cifs"===(null===(a=this._data)||void 0===a?void 0:a.type)&&this._data.version&&["1.0","2.0"].includes(this._data.version)&&(this._validationWarning.version="not_recomeded_cifs_version")}async _connectMount(t){const e=t.target;this._error=void 0,this._waiting=!0;const o=Object.assign({},this._data);"cifs"===o.type&&"auto"===o.version&&(o.version=void 0);try{this._existing?await(0,v.Bt)(this.hass,o):await(0,v.Qf)(this.hass,o)}catch(a){return this._error=(0,g.VR)(a),this._waiting=!1,e.actionError(),void("cifs"!==this._data.type||this._showCIFSVersion||(this._showCIFSVersion=!0))}this._reloadMounts&&this._reloadMounts(),this.closeDialog()}async _deleteMount(){this._error=void 0,this._waiting=!0;try{await(0,v.wZ)(this.hass,this._data.name)}catch(t){return this._error=(0,g.VR)(t),void(this._waiting=!1)}this._reloadMounts&&this._reloadMounts(),this.closeDialog()}static get styles(){return[f.RF,f.nA,(0,r.AH)(x||(x=k`ha-icon-button{color:var(--primary-text-color)}`))]}constructor(...t){super(...t),this._open=!1,this._computeLabelCallback=t=>this.hass.localize(`ui.panel.config.storage.network_mounts.options.${t.name}.title`),this._computeHelperCallback=t=>this.hass.localize(`ui.panel.config.storage.network_mounts.options.${t.name}.description`),this._computeErrorCallback=t=>this.hass.localize(`ui.panel.config.storage.network_mounts.errors.${t}`)||t,this._computeWarningCallback=t=>this.hass.localize(`ui.panel.config.storage.network_mounts.warnings.${t}`)||t}}(0,i.Cg)([(0,s.MZ)({attribute:!1})],S.prototype,"hass",void 0),(0,i.Cg)([(0,s.wk)()],S.prototype,"_data",void 0),(0,i.Cg)([(0,s.wk)()],S.prototype,"_waiting",void 0),(0,i.Cg)([(0,s.wk)()],S.prototype,"_error",void 0),(0,i.Cg)([(0,s.wk)()],S.prototype,"_validationError",void 0),(0,i.Cg)([(0,s.wk)()],S.prototype,"_validationWarning",void 0),(0,i.Cg)([(0,s.wk)()],S.prototype,"_existing",void 0),(0,i.Cg)([(0,s.wk)()],S.prototype,"_showCIFSVersion",void 0),(0,i.Cg)([(0,s.wk)()],S.prototype,"_reloadMounts",void 0),(0,i.Cg)([(0,s.wk)()],S.prototype,"_open",void 0),S=(0,i.Cg)([(0,s.EM)("dialog-mount-view")],S),a()}catch(w){a(w)}})},22348:function(t,e,o){o.d(e,{V:function(){return i}});var a=o(37177);const i=t=>!!t&&a.n},37177:function(t,e,o){o.d(e,{n:function(){return a}});o(27495);const a=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)},48646:function(t,e,o){var a=o(69565),i=o(28551),r=o(1767),s=o(50851);t.exports=function(t,e){e&&"string"==typeof t||i(t);var o=s(t);return r(i(void 0!==o?a(o,t):t))}},78350:function(t,e,o){var a=o(46518),i=o(70259),r=o(79306),s=o(48981),n=o(26198),l=o(1469);a({target:"Array",proto:!0},{flatMap:function(t){var e,o=s(this),a=n(o);return r(t),e=l(o,0),i(e,o,o,a,0,1,t,arguments.length>1?arguments[1]:void 0),e}})},30237:function(t,e,o){o(6469)("flatMap")},30531:function(t,e,o){var a=o(46518),i=o(69565),r=o(79306),s=o(28551),n=o(1767),l=o(48646),d=o(19462),h=o(9539),c=o(96395),u=o(30684),p=o(84549);var g=!c&&!u("flatMap",function(){}),v=!c&&!g&&p("flatMap",TypeError),f=c||g||v||function(){try{var t=Iterator.prototype.flatMap.call(new Map([[4,5]]).entries(),function(t){return t});t.next(),t.return()}catch(e){return!0}}(),m=d(function(){for(var t,e,o=this.iterator,a=this.mapper;;){if(e=this.inner)try{if(!(t=s(i(e.next,e.iterator))).done)return t.value;this.inner=null}catch(r){h(o,"throw",r)}if(t=s(i(this.next,o)),this.done=!!t.done)return;try{this.inner=l(a(t.value,this.counter++),!1)}catch(r){h(o,"throw",r)}}});a({target:"Iterator",proto:!0,real:!0,forced:f},{flatMap:function(t){s(this);try{r(t)}catch(e){h(this,"throw",e)}return v?i(v,this,t):new m(n(this),{mapper:t,inner:null})}})},93900:function(t,e,o){o.a(t,async function(t,e){try{o(3362),o(27495),o(62953);var a=o(5124),i=o(67576),r=o(6412),s=o(63672),n=o(17051),l=o(42462),d=o(28438),h=o(98779),c=o(27259),u=o(25877),p=o(31247),g=o(4444),v=o(92070),f=o(9395),m=o(717),b=o(17060),w=o(88496),y=o(91470),_=t([w,b]);[w,b]=_.then?(await _)():_;let $,S,L,E=t=>t;var x=Object.defineProperty,k=Object.getOwnPropertyDescriptor,C=(t,e,o,a)=>{for(var i,r=a>1?void 0:a?k(e,o):e,s=t.length-1;s>=0;s--)(i=t[s])&&(r=(a?i(e,o,r):i(r))||r);return a&&r&&x(e,o,r),r};let M=class extends m.A{firstUpdated(){this.open&&(this.addOpenListeners(),this.dialog.showModal(),(0,g.JG)(this))}disconnectedCallback(){super.disconnectedCallback(),(0,g.I7)(this),this.removeOpenListeners()}async requestClose(t){const e=new d.L({source:t});if(this.dispatchEvent(e),e.defaultPrevented)return this.open=!0,void(0,c.Ud)(this.dialog,"pulse");this.removeOpenListeners(),await(0,c.Ud)(this.dialog,"hide"),this.open=!1,this.dialog.close(),(0,g.I7)(this);const o=this.originalTrigger;"function"==typeof(null==o?void 0:o.focus)&&setTimeout(()=>o.focus()),this.dispatchEvent(new n.Z)}addOpenListeners(){document.addEventListener("keydown",this.handleDocumentKeyDown),(0,u.AZ)(this)}removeOpenListeners(){document.removeEventListener("keydown",this.handleDocumentKeyDown),(0,u.Fw)(this)}handleDialogCancel(t){t.preventDefault(),!this.dialog.classList.contains("hide")&&t.target===this.dialog&&(0,u.a0)(this)&&this.requestClose(this.dialog)}handleDialogClick(t){const e=t.target.closest('[data-dialog="close"]');e&&(t.stopPropagation(),this.requestClose(e))}async handleDialogPointerDown(t){t.target===this.dialog&&(this.lightDismiss?this.requestClose(this.dialog):await(0,c.Ud)(this.dialog,"pulse"))}handleOpenChange(){this.open&&!this.dialog.open?this.show():!this.open&&this.dialog.open&&(this.open=!0,this.requestClose(this.dialog))}async show(){const t=new h.k;this.dispatchEvent(t),t.defaultPrevented?this.open=!1:(this.addOpenListeners(),this.originalTrigger=document.activeElement,this.open=!0,this.dialog.showModal(),(0,g.JG)(this),requestAnimationFrame(()=>{const t=this.querySelector("[autofocus]");t&&"function"==typeof t.focus?t.focus():this.dialog.focus()}),await(0,c.Ud)(this.dialog,"show"),this.dispatchEvent(new l.q))}render(){var t;const e=!this.withoutHeader,o=this.hasUpdated?this.hasSlotController.test("footer"):this.withFooter;return(0,a.qy)($||($=E` <dialog aria-labelledby="${0}" aria-describedby="${0}" part="dialog" class="${0}" @cancel="${0}" @click="${0}" @pointerdown="${0}"> ${0} <div part="body" class="body"><slot></slot></div> ${0} </dialog> `),null!==(t=this.ariaLabelledby)&&void 0!==t?t:"title",(0,s.J)(this.ariaDescribedby),(0,r.H)({dialog:!0,open:this.open}),this.handleDialogCancel,this.handleDialogClick,this.handleDialogPointerDown,e?(0,a.qy)(S||(S=E` <header part="header" class="header"> <h2 part="title" class="title" id="title"> <slot name="label"> ${0} </slot> </h2> <div part="header-actions" class="header-actions"> <slot name="header-actions"></slot> <wa-button part="close-button" exportparts="base:close-button__base" class="close" appearance="plain" @click="${0}"> <wa-icon name="xmark" label="${0}" library="system" variant="solid"></wa-icon> </wa-button> </div> </header> `),this.label.length>0?this.label:String.fromCharCode(8203),t=>this.requestClose(t.target),this.localize.term("close")):"",o?(0,a.qy)(L||(L=E` <footer part="footer" class="footer"> <slot name="footer"></slot> </footer> `)):"")}constructor(){super(...arguments),this.localize=new b.c(this),this.hasSlotController=new v.X(this,"footer","header-actions","label"),this.open=!1,this.label="",this.withoutHeader=!1,this.lightDismiss=!1,this.withFooter=!1,this.handleDocumentKeyDown=t=>{"Escape"===t.key&&this.open&&(0,u.a0)(this)&&(t.preventDefault(),t.stopPropagation(),this.requestClose(this.dialog))}}};M.css=y.A,C([(0,i.P)(".dialog")],M.prototype,"dialog",2),C([(0,i.MZ)({type:Boolean,reflect:!0})],M.prototype,"open",2),C([(0,i.MZ)({reflect:!0})],M.prototype,"label",2),C([(0,i.MZ)({attribute:"without-header",type:Boolean,reflect:!0})],M.prototype,"withoutHeader",2),C([(0,i.MZ)({attribute:"light-dismiss",type:Boolean})],M.prototype,"lightDismiss",2),C([(0,i.MZ)({attribute:"aria-labelledby"})],M.prototype,"ariaLabelledby",2),C([(0,i.MZ)({attribute:"aria-describedby"})],M.prototype,"ariaDescribedby",2),C([(0,i.MZ)({attribute:"with-footer",type:Boolean})],M.prototype,"withFooter",2),C([(0,f.w)("open",{waitUntilFirstUpdate:!0})],M.prototype,"handleOpenChange",1),M=C([(0,i.EM)("wa-dialog")],M),a.S$||(document.addEventListener("click",t=>{const e=t.target.closest("[data-dialog]");if(e instanceof Element){const[t,o]=(0,p.v)(e.getAttribute("data-dialog")||"");if("open"===t&&null!=o&&o.length){const t=e.getRootNode().getElementById(o);"wa-dialog"===(null==t?void 0:t.localName)?t.open=!0:console.warn(`A dialog with an ID of "${o}" could not be found in this document.`)}}}),document.addEventListener("pointerdown",()=>{})),e()}catch($){e($)}})},91470:function(t,e,o){o.d(e,{A:function(){return i}});let a;var i=(0,o(5124).AH)(a||(a=(t=>t)`:host{--width:31rem;--spacing:var(--wa-space-l);--backdrop-filter:none;--show-duration:200ms;--hide-duration:200ms;display:none}:host([open]){display:block}.dialog{display:flex;flex-direction:column;top:0;right:0;bottom:0;left:0;width:var(--width);max-width:calc(100% - var(--wa-space-2xl));max-height:calc(100% - var(--wa-space-2xl));color:inherit;background-color:var(--wa-color-surface-raised);border-radius:var(--wa-panel-border-radius);border:none;box-shadow:var(--wa-shadow-l);padding:0;margin:auto}.dialog.show{animation:show-dialog var(--show-duration) ease}.dialog.show::backdrop{animation:show-backdrop var(--show-duration,200ms) ease}.dialog.hide{animation:show-dialog var(--hide-duration) ease reverse}.dialog.hide::backdrop{animation:show-backdrop var(--hide-duration,200ms) ease reverse}.dialog.pulse{animation:pulse 250ms ease}.dialog:focus{outline:0}@media screen and (max-width:420px){.dialog{max-height:80vh}}.open{display:flex;opacity:1}.header{flex:0 0 auto;display:flex;flex-wrap:nowrap;padding-inline-start:var(--spacing);padding-block-end:0;padding-inline-end:calc(var(--spacing) - var(--wa-form-control-padding-block));padding-block-start:calc(var(--spacing) - var(--wa-form-control-padding-block))}.title{align-self:center;flex:1 1 auto;font-family:inherit;font-size:var(--wa-font-size-l);font-weight:var(--wa-font-weight-heading);line-height:var(--wa-line-height-condensed);margin:0}.header-actions{align-self:start;display:flex;flex-shrink:0;flex-wrap:wrap;justify-content:end;gap:var(--wa-space-2xs);padding-inline-start:var(--spacing)}.header-actions ::slotted(wa-button),.header-actions wa-button{flex:0 0 auto;display:flex;align-items:center}.body{flex:1 1 auto;display:block;padding:var(--spacing);overflow:auto;-webkit-overflow-scrolling:touch}.body:focus{outline:0}.body:focus-visible{outline:var(--wa-focus-ring);outline-offset:var(--wa-focus-ring-offset)}.footer{flex:0 0 auto;display:flex;flex-wrap:wrap;gap:var(--wa-space-xs);justify-content:end;padding:var(--spacing);padding-block-start:0}.footer ::slotted(wa-button:not(:first-of-type)){margin-inline-start:var(--wa-spacing-xs)}.dialog::backdrop{background-color:var(--wa-color-overlay-modal,rgb(0 0 0 / .25));-webkit-backdrop-filter:var(--backdrop-filter);backdrop-filter:var(--backdrop-filter)}@keyframes pulse{0%{scale:1}50%{scale:1.02}100%{scale:1}}@keyframes show-dialog{from{opacity:0;scale:0.8}to{opacity:1;scale:1}}@keyframes show-backdrop{from{opacity:0}to{opacity:1}}@media (forced-colors:active){.dialog{border:solid 1px #fff}}`))},31247:function(t,e,o){o.d(e,{v:function(){return a}});o(18111),o(22489),o(61701),o(42762);function a(t){return t.split(" ").map(t=>t.trim()).filter(t=>""!==t)}},4444:function(t,e,o){o.d(e,{JG:function(){return i},Rt:function(){return s},I7:function(){return r}});o(27495),o(17642),o(58004),o(33853),o(45876),o(32475),o(15024),o(31698),o(25440),o(62953);const a=new Set;function i(t){if(a.add(t),!document.documentElement.classList.contains("wa-scroll-lock")){const t=function(){const t=document.documentElement.clientWidth;return Math.abs(window.innerWidth-t)}()+function(){const t=Number(getComputedStyle(document.body).paddingRight.replace(/px/,""));return isNaN(t)||!t?0:t}();let e=getComputedStyle(document.documentElement).scrollbarGutter;e&&"auto"!==e||(e="stable"),t<2&&(e=""),document.documentElement.style.setProperty("--wa-scroll-lock-gutter",e),document.documentElement.classList.add("wa-scroll-lock"),document.documentElement.style.setProperty("--wa-scroll-lock-size",`${t}px`)}}function r(t){a.delete(t),0===a.size&&(document.documentElement.classList.remove("wa-scroll-lock"),document.documentElement.style.removeProperty("--wa-scroll-lock-size"))}function s(t,e,o="vertical",a="smooth"){const i=function(t,e){return{top:Math.round(t.getBoundingClientRect().top-e.getBoundingClientRect().top),left:Math.round(t.getBoundingClientRect().left-e.getBoundingClientRect().left)}}(t,e),r=i.top+e.scrollTop,s=i.left+e.scrollLeft,n=e.scrollLeft,l=e.scrollLeft+e.offsetWidth,d=e.scrollTop,h=e.scrollTop+e.offsetHeight;"horizontal"!==o&&"both"!==o||(s<n?e.scrollTo({left:s,behavior:a}):s+t.clientWidth>l&&e.scrollTo({left:s-e.offsetWidth+t.clientWidth,behavior:a})),"vertical"!==o&&"both"!==o||(r<d?e.scrollTo({top:r,behavior:a}):r+t.clientHeight>h&&e.scrollTo({top:r-e.offsetHeight+t.clientHeight,behavior:a}))}},54495:function(t,e,o){o.d(e,{OA:function(){return a.OA},WL:function(){return a.WL},u$:function(){return a.u$}});var a=o(42017)}}]);