UNPKG

iobroker.lovelace

Version:

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

16 lines 26.3 kB
"use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[45654],{64481:function(e,t,a){a.d(t,{D:function(){return i},J:function(){return s}});a(16280),a(3362),a(55815),a(64979),a(79739);let o=!1;try{o="true"===window.localStorage.getItem("disableViewTransition")}catch(l){}const i=e=>{o=e},r=e=>{if(!(e=>(e instanceof DOMException||e instanceof Error)&&"AbortError"===e.name)(e))throw e},s=e=>{if(!document.startViewTransition||o)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())}}},93444:function(e,t,a){var o=a(40445),i=a(5124),r=a(67576);let s,l,n=e=>e;class d extends i.WF{render(){return(0,i.qy)(s||(s=n` <footer> <slot name="secondaryAction"></slot> <slot name="primaryAction"></slot> </footer> `))}static get styles(){return[(0,i.AH)(l||(l=n`footer{display:flex;gap:var(--ha-space-3);justify-content:flex-end;align-items:center;width:100%}`))]}}d=(0,o.Cg)([(0,r.EM)("ha-dialog-footer")],d)},76538:function(e,t,a){a(62953);var o=a(40445),i=a(5124),r=a(67576);let s,l,n,d,h,c,p=e=>e;class u extends i.WF{render(){const e=(0,i.qy)(s||(s=p`<div class="header-title"> <slot name="title"></slot> </div>`)),t=(0,i.qy)(l||(l=p`<div class="header-subtitle"> <slot name="subtitle"></slot> </div>`));return(0,i.qy)(n||(n=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,i.qy)(d||(d=p`${0}${0}`),t,e):(0,i.qy)(h||(h=p`${0}${0}`),e,t))}static get styles(){return[(0,i.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))}@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(...e){super(...e),this.subtitlePosition="below",this.showBorder=!1}}(0,o.Cg)([(0,r.MZ)({type:String,attribute:"subtitle-position"})],u.prototype,"subtitlePosition",void 0),(0,o.Cg)([(0,r.MZ)({type:Boolean,reflect:!0,attribute:"show-border"})],u.prototype,"showBorder",void 0),u=(0,o.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 o=a(40445),i=a(93900),r=a(35211),s=a(5124),l=a(67576),n=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)),m=e([i,v,p]);[i,v,p]=m.then?(await m)():m;let b,f,y,_,w,x,C,S=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 k 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)(b||(b=S` <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,n.J)(this.ariaLabelledBy||(void 0!==this.headerTitle?"ha-dialog-title":void 0)),(0,n.J)(this.ariaDescribedBy),this._handleKeyDown,this._handleHide,this._handleShow,this._handleAfterShow,this._handleAfterHide,this.withoutHeader?s.s6:(0,s.qy)(f||(f=S`<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)(y||(y=S`<span slot="title" class="title" id="ha-dialog-title"> ${0} </span>`),this.headerTitle):(0,s.qy)(_||(_=S`<slot name="headerTitle" slot="title"></slot>`)),void 0!==this.headerSubtitle?(0,s.qy)(w||(w=S`<span slot="subtitle">${0}</span>`),this.headerSubtitle):(0,s.qy)(x||(x=S`<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)(C||(C=S`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(...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,o.Cg)([(0,l.MZ)({attribute:"aria-labelledby"})],k.prototype,"ariaLabelledBy",void 0),(0,o.Cg)([(0,l.MZ)({attribute:"aria-describedby"})],k.prototype,"ariaDescribedBy",void 0),(0,o.Cg)([(0,l.MZ)({type:Boolean,reflect:!0})],k.prototype,"open",void 0),(0,o.Cg)([(0,l.MZ)({reflect:!0})],k.prototype,"type",void 0),(0,o.Cg)([(0,l.MZ)({type:String,reflect:!0,attribute:"width"})],k.prototype,"width",void 0),(0,o.Cg)([(0,l.MZ)({type:Boolean,reflect:!0,attribute:"prevent-scrim-close"})],k.prototype,"preventScrimClose",void 0),(0,o.Cg)([(0,l.MZ)({attribute:"header-title"})],k.prototype,"headerTitle",void 0),(0,o.Cg)([(0,l.MZ)({attribute:"header-subtitle"})],k.prototype,"headerSubtitle",void 0),(0,o.Cg)([(0,l.MZ)({type:String,attribute:"header-subtitle-position"})],k.prototype,"headerSubtitlePosition",void 0),(0,o.Cg)([(0,l.MZ)({type:Boolean,reflect:!0,attribute:"flexcontent"})],k.prototype,"flexContent",void 0),(0,o.Cg)([(0,l.MZ)({type:Boolean,attribute:"without-header"})],k.prototype,"withoutHeader",void 0),(0,o.Cg)([(0,l.wk)()],k.prototype,"_open",void 0),(0,o.Cg)([(0,l.P)(".body")],k.prototype,"bodyContainer",void 0),(0,o.Cg)([(0,l.wk)(),(0,r.Fg)({context:c.D5,subscribe:!0})],k.prototype,"_i18n",void 0),(0,o.Cg)([(0,l.wk)(),(0,r.Fg)({context:c.WF,subscribe:!0})],k.prototype,"_hassConfig",void 0),(0,o.Cg)([(0,l.wk)()],k.prototype,"_bodyScrolled",void 0),(0,o.Cg)([(0,l.Ls)({passive:!0})],k.prototype,"_handleBodyScroll",null),k=(0,o.Cg)([(0,l.EM)("ha-dialog")],k),t()}catch(b){t(b)}})},52763:function(e,t,a){a.a(e,async function(e,o){try{a.d(t,{U:function(){return $}});a(74423),a(18111),a(7588),a(61701),a(3362),a(62953);var i=a(40445),r=a(5124),s=a(67576),l=a(69558),n=a(1087),d=a(38962),h=(a(11399),e([d]));d=(h.then?(await h)():h)[0];let c,p,u,g,v,m,b,f,y,_=e=>e;const w={boolean:()=>a.e(81347).then(a.bind(a,46990)),constant:()=>a.e(65733).then(a.bind(a,90820)),float:()=>Promise.all([a.e(72850),a.e(39763),a.e(32450),a.e(51868),a.e(62574),a.e(16113)]).then(a.bind(a,20676)),grid:()=>a.e(60761).then(a.bind(a,70208)),expandable:()=>a.e(45001).then(a.bind(a,40003)),integer:()=>Promise.all([a.e(72850),a.e(39763),a.e(32450),a.e(21543),a.e(86712),a.e(62574),a.e(12145)]).then(a.bind(a,20036)),multi_select:()=>Promise.all([a.e(72850),a.e(39763),a.e(46095),a.e(34995),a.e(80131),a.e(58303),a.e(71739),a.e(78219)]).then(a.bind(a,36182)),positive_time_period_dict:()=>Promise.all([a.e(72850),a.e(39763),a.e(32450),a.e(46095),a.e(34995),a.e(67943),a.e(62574),a.e(16508),a.e(21486)]).then(a.bind(a,89422)),select:()=>Promise.all([a.e(72850),a.e(39763),a.e(32450),a.e(46095),a.e(7305),a.e(92769),a.e(34995),a.e(3283),a.e(81034),a.e(99463),a.e(62574),a.e(26092),a.e(39005),a.e(35873),a.e(63577)]).then(a.bind(a,63804)),string:()=>Promise.all([a.e(72850),a.e(39763),a.e(32450),a.e(84725),a.e(62574),a.e(6762)]).then(a.bind(a,54753)),optional_actions:()=>Promise.all([a.e(72850),a.e(39763),a.e(34995),a.e(67395)]).then(a.bind(a,8456))},x=(e,t)=>e?!t.name||t.flatten?e:e[t.name]:void 0,C=(e,t)=>e&&t.name?e[t.name]:null,S=(e,t)=>e&&t.name?e[t.name]:null;class $ extends r.WF{getFormProperties(){return{}}reportValidity(){const e=this._root;if(!e)return!0;const t=[...e.children].filter(e=>"ha-alert"!==e.localName);let a,o=!0;var i,r;(this.schema.forEach((e,i)=>{var r;const s=t[i];if(!s)return;let l=!0;if("reportValidity"in s&&"function"==typeof s.reportValidity)l=s.reportValidity();else if(e.required&&(!("type"in e)||!["boolean","constant"].includes(null!==(r=e.type)&&void 0!==r?r:""))&&(!("selector"in e)||!("boolean"in e.selector)&&!("constant"in e.selector))){const t=x(this.data,e);l=null!=t&&""!==t}l||(o=!1,a||(a=s))}),a)&&(null===(i=(r=a).focus)||void 0===i||i.call(r));return o}willUpdate(e){e.has("schema")&&this.schema&&this.schema.forEach(e=>{var t;"selector"in e||null===(t=w[e.type])||void 0===t||t.call(w)})}render(){return(0,r.qy)(c||(c=_` <div class="root" part="root"> ${0} ${0} </div> `),this.error&&this.error.base?(0,r.qy)(p||(p=_` <ha-alert alert-type="error"> ${0} </ha-alert> `),this._computeError(this.error.base,this.schema)):"",this.schema.map(e=>{var t;const a=C(this.error,e),o=S(this.warning,e);return(0,r.qy)(u||(u=_` ${0} ${0} `),a?(0,r.qy)(g||(g=_` <ha-alert own-margin alert-type="error"> ${0} </ha-alert> `),this._computeError(a,e)):o?(0,r.qy)(v||(v=_` <ha-alert own-margin alert-type="warning"> ${0} </ha-alert> `),this._computeWarning(o,e)):"","selector"in e?(0,r.qy)(m||(m=_`<ha-selector .schema="${0}" .hass="${0}" .narrow="${0}" .name="${0}" .selector="${0}" .value="${0}" .label="${0}" .disabled="${0}" .placeholder="${0}" .helper="${0}" .localizeValue="${0}" .required="${0}" .context="${0}"></ha-selector>`),e,this.hass,this.narrow,e.name,e.selector,x(this.data,e),this._computeLabel(e,this.data),e.disabled||this.disabled||!1,e.required?void 0:e.default,this._computeHelper(e),this.localizeValue,e.required||!1,this._generateContext(e)):(0,l._)(this.fieldElementName(e.type),Object.assign({schema:e,data:x(this.data,e),label:this._computeLabel(e,this.data),helper:this._computeHelper(e),disabled:this.disabled||e.disabled||!1,hass:this.hass,localize:null===(t=this.hass)||void 0===t?void 0:t.localize,computeLabel:this.computeLabel,computeHelper:this.computeHelper,localizeValue:this.localizeValue,context:this._generateContext(e)},this.getFormProperties())))}))}fieldElementName(e){return`ha-form-${e}`}_generateContext(e){if(!e.context&&!this.context)return;const t=Object.assign({},this.context);if(e.context)for(const[a,o]of Object.entries(e.context))t[a]=this.data[o];return t}createRenderRoot(){const e=super.createRenderRoot();return this.addValueChangedListener(e),e}addValueChangedListener(e){e.addEventListener("value-changed",e=>{e.stopPropagation();const t=e.target.schema;if(e.target===this)return;const a=!t.name||"flatten"in t&&t.flatten?e.detail.value:{[t.name]:e.detail.value};this.data=Object.assign(Object.assign({},this.data),a),(0,n.r)(this,"value-changed",{value:this.data})})}_computeLabel(e,t){return this.computeLabel?this.computeLabel(e,t):e?e.name:""}_computeHelper(e){return this.computeHelper?this.computeHelper(e):""}_computeError(e,t){return Array.isArray(e)?(0,r.qy)(b||(b=_`<ul> ${0} </ul>`),e.map(e=>(0,r.qy)(f||(f=_`<li> ${0} </li>`),this.computeError?this.computeError(e,t):e))):this.computeError?this.computeError(e,t):e}_computeWarning(e,t){return this.computeWarning?this.computeWarning(e,t):e}constructor(...e){super(...e),this.narrow=!1,this.disabled=!1}}$.shadowRootOptions={mode:"open",delegatesFocus:!0},$.styles=(0,r.AH)(y||(y=_`.root>*{display:block}.root>:not([own-margin]):not(:last-child){margin-bottom:24px}ha-alert[own-margin]{margin-bottom:4px}`)),(0,i.Cg)([(0,s.MZ)({attribute:!1})],$.prototype,"hass",void 0),(0,i.Cg)([(0,s.MZ)({type:Boolean})],$.prototype,"narrow",void 0),(0,i.Cg)([(0,s.MZ)({attribute:!1})],$.prototype,"data",void 0),(0,i.Cg)([(0,s.MZ)({attribute:!1})],$.prototype,"schema",void 0),(0,i.Cg)([(0,s.MZ)({attribute:!1})],$.prototype,"error",void 0),(0,i.Cg)([(0,s.MZ)({attribute:!1})],$.prototype,"warning",void 0),(0,i.Cg)([(0,s.MZ)({type:Boolean})],$.prototype,"disabled",void 0),(0,i.Cg)([(0,s.MZ)({attribute:!1})],$.prototype,"computeError",void 0),(0,i.Cg)([(0,s.MZ)({attribute:!1})],$.prototype,"computeWarning",void 0),(0,i.Cg)([(0,s.MZ)({attribute:!1})],$.prototype,"computeLabel",void 0),(0,i.Cg)([(0,s.MZ)({attribute:!1})],$.prototype,"computeHelper",void 0),(0,i.Cg)([(0,s.MZ)({attribute:!1})],$.prototype,"localizeValue",void 0),(0,i.Cg)([(0,s.MZ)({attribute:!1})],$.prototype,"context",void 0),(0,i.Cg)([(0,s.P)(".root")],$.prototype,"_root",void 0),$=(0,i.Cg)([(0,s.EM)("ha-form")],$),o()}catch(c){o(c)}})},87285:function(e,t,a){a.a(e,async function(e,o){try{a.r(t),a.d(t,{DialogForm:function(){return b}});a(18111),a(20116),a(3362),a(62953);var i=a(40445),r=a(5124),s=a(67576),l=a(34271),n=a(1087),d=a(18350),h=a(52763),c=(a(93444),a(72554)),p=a(14503),u=e([d,h,c]);[d,h,c]=u.then?(await u)():u;let g,v,m=e=>e;class b extends r.WF{async showDialog(e){this._params=e,this._data=e.data||{},this._open=!0}closeDialog(){return this._open=!1,!0}_popStack(){if(!this._stack.length)return;const e=this._stack[this._stack.length-1];return this._stack=this._stack.slice(0,-1),this._params=e.params,this._data=e.data,e.nestedField}_dialogClosed(){var e,t;this._closeState||(null===(e=this._params)||void 0===e||null===(t=e.cancel)||void 0===t||t.call(e));this._closeState=void 0,this._stack=[],this._params=void 0,this._data={},this._open=!1,(0,n.r)(this,"dialog-closed",{dialog:this.localName})}_submit(){var e,t,a;this._closeState="submitted";const o=null===(e=this._params)||void 0===e?void 0:e.submit,i=this._data,r=this._popStack();if(null==o||o(i),!r)return void this.closeDialog();const s=null===(t=this._params)||void 0===t?void 0:t.schema.find(e=>"selector"in e&&e.name===r),n=s&&"selector"in s&&"object"in s.selector&&!0===(null===(a=s.selector.object)||void 0===a?void 0:a.multiple),d=this._data[r],h=n?[...Array.isArray(d)?d:[],i]:i;this._data=(0,l.A)(Object.assign(Object.assign({},this._data),{},{[r]:h}))}_cancel(){var e;this._closeState="canceled";const t=null===(e=this._params)||void 0===e?void 0:e.cancel,a=this._popStack();null==t||t(),a||this.closeDialog()}_valueChanged(e){this._data=e.detail.value}render(){return this._params&&this.hass?(0,r.qy)(g||(g=m` <ha-dialog .open="${0}" header-title="${0}" prevent-scrim-close @closed="${0}"> <ha-form autofocus .hass="${0}" .computeLabel="${0}" .computeHelper="${0}" .data="${0}" .schema="${0}" @value-changed="${0}" @show-dialog="${0}"> </ha-form> <ha-dialog-footer slot="footer"> <ha-button slot="secondaryAction" appearance="plain" @click="${0}"> ${0} </ha-button> <ha-button slot="primaryAction" @click="${0}"> ${0} </ha-button> </ha-dialog-footer> </ha-dialog> `),this._open,this._params.title,this._dialogClosed,this.hass,this._params.computeLabel,this._params.computeHelper,this._data,this._params.schema,this._valueChanged,this._handleNestedShowDialog,this._cancel,this._params.cancelText||this.hass.localize("ui.common.cancel"),this._submit,this._params.submitText||this.hass.localize("ui.common.save")):r.s6}constructor(...e){super(...e),this._data={},this._open=!1,this._stack=[],this._handleNestedShowDialog=e=>{if("dialog-form"!==e.detail.dialogTag)return;e.stopPropagation();const t=e.composedPath()[0];this._stack=[...this._stack,{params:this._params,data:this._data,nestedField:null==t?void 0:t.name}];const a=e.detail.dialogParams;this._params=a,this._data=(null==a?void 0:a.data)||{}}}}b.styles=[p.nA,(0,r.AH)(v||(v=m``))],(0,i.Cg)([(0,s.MZ)({attribute:!1})],b.prototype,"hass",void 0),(0,i.Cg)([(0,s.wk)()],b.prototype,"_params",void 0),(0,i.Cg)([(0,s.wk)()],b.prototype,"_data",void 0),(0,i.Cg)([(0,s.wk)()],b.prototype,"_open",void 0),(0,i.Cg)([(0,s.wk)()],b.prototype,"_closeState",void 0),(0,i.Cg)([(0,s.wk)()],b.prototype,"_stack",void 0),b=(0,i.Cg)([(0,s.EM)("dialog-form")],b),o()}catch(g){o(g)}})},59992:function(e,t,a){a.a(e,async function(e,o){try{a.d(t,{V:function(){return g}});a(62953);var i=a(40445),r=a(88696),s=a(5124),l=a(6412),n=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,l.H)({"fade-top":!0,rounded:e,visible:this._contentScrolled}),(0,l.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:o=0,scrollTop:i=0}=e;this._contentScrollable=a-o>i+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,i.Cg)([(0,n.wk)()],t.prototype,"_contentScrolled",void 0),(0,i.Cg)([(0,n.wk)()],t.prototype,"_contentScrollable",void 0),t};o()}catch(h){o(h)}})},22348:function(e,t,a){a.d(t,{V:function(){return i}});var o=a(37177);const i=e=>!!e&&o.n},37177:function(e,t,a){a.d(t,{n:function(){return o}});a(27495);const o=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}}]);