UNPKG

iobroker.lovelace

Version:

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

20 lines 45.2 kB
/*! For license information please see 47677.26795e1a697b33ba.js.LICENSE.txt */ export const __rspack_esm_id=47677;export const __rspack_esm_ids=[47677];export const __webpack_modules__={12451(e,t,a){a.d(t,{O:()=>n,i:()=>o.is});var i=a(5124),o=a(12130);class n extends i.WF{click(){if(this.mdcRoot)return this.mdcRoot.focus(),void this.mdcRoot.click();super.click()}createFoundation(){void 0!==this.mdcFoundation&&this.mdcFoundation.destroy(),this.mdcFoundationClass&&(this.mdcFoundation=new this.mdcFoundationClass(this.createAdapter()),this.mdcFoundation.init())}firstUpdated(){this.createFoundation()}}},12130(e,t,a){a.d(t,{SE:()=>d,U9:()=>l,hP:()=>i,is:()=>o});a(44114);const i=e=>e.nodeType===Node.ELEMENT_NODE;function o(e){return{addClass:t=>{e.classList.add(t)},removeClass:t=>{e.classList.remove(t)},hasClass:t=>e.classList.contains(t)}}let n=!1;const r=()=>{},s={get passive(){return n=!0,!1}};document.addEventListener("x",r,s),document.removeEventListener("x",r);const l=(e=window.document)=>{let t=e.activeElement;const a=[];if(!t)return a;for(;t&&(a.push(t),t.shadowRoot);)t=t.shadowRoot.activeElement;return a},d=e=>{const t=l();if(!t.length)return!1;const a=t[t.length-1],i=new Event("check-if-focused",{bubbles:!0,composed:!0});let o=[];const n=e=>{o=e.composedPath()};return document.body.addEventListener("check-if-focused",n),a.dispatchEvent(i),document.body.removeEventListener("check-if-focused",n),-1!==o.indexOf(e)}},90409(e,t,a){a.d(t,{A:()=>i});a(18111),a(61701);function i(e){const t=e.split(":").map(Number);return 3600*t[0]+60*t[1]+t[2]}},27167(e,t,a){a.d(t,{A:()=>o});const i=e=>e<10?`0${e}`:e;function o(e){const t=Math.floor(e/3600),a=Math.floor(e%3600/60),o=Math.floor(e%3600%60);return t>0?`${t}:${i(a)}:${i(o)}`:a>0?`${a}:${i(o)}`:o>0?""+o:null}},69558(e,t,a){a.d(t,{_:()=>n});a(18111),a(7588);var i=a(5124),o=a(42017);const n=(0,o.u$)(class extends o.WL{update(e,[t,a]){return this._element&&this._element.localName===t?(a&&Object.entries(a).forEach(([e,t])=>{this._element[e]=t}),i.c0):this.render(t,a)}render(e,t){return this._element=document.createElement(e),t&&Object.entries(t).forEach(([e,t])=>{this._element[e]=t}),this._element}constructor(e){if(super(e),e.type!==o.OA.CHILD)throw new Error("dynamicElementDirective can only be used in content bindings")}})},64481(e,t,a){a.d(t,{D:()=>o,J:()=>r});a(64979);let i=!1;try{i="true"===window.localStorage.getItem("disableViewTransition")}catch{}const o=e=>{i=e},n=e=>{if(!(e=>(e instanceof DOMException||e instanceof Error)&&"AbortError"===e.name)(e))throw e},r=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(n),a.finished.catch(n)}catch(a){return console.warn("View transition failed, falling back to direct execution.",a),t?Promise.reject(a):(e(!1),Promise.resolve())}}},8129(e,t,a){a.d(t,{l:()=>i});const i=e=>new Promise(t=>{setTimeout(t,e)})},93444(e,t,a){var i=a(62826),o=a(5124),n=a(22441);class r extends o.WF{render(){return o.qy` <footer> <slot name="secondaryAction"></slot> <slot name="primaryAction"></slot> </footer> `}static get styles(){return[o.AH`footer{display:flex;gap:var(--ha-space-3);justify-content:flex-end;align-items:center;width:100%}`]}}r=(0,i.Cg)([(0,n.EM)("ha-dialog-footer")],r)},76538(e,t,a){var i=a(62826),o=a(5124),n=a(22441);class r extends o.WF{render(){const e=o.qy`<div class="header-title"> <slot name="title"></slot> </div>`,t=o.qy`<div class="header-subtitle"> <slot name="subtitle"></slot> </div>`;return o.qy` <header class="header"> <div class="header-bar"> <section class="header-navigation-icon"> <slot name="navigationIcon"></slot> </section> <section class="header-content"> ${"above"===this.subtitlePosition?o.qy`${t}${e}`:o.qy`${e}${t}`} </section> <section class="header-action-items"> <slot name="actionItems"></slot> </section> </div> <slot></slot> </header> `}static get styles(){return[o.AH`: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,i.Cg)([(0,n.MZ)({type:String,attribute:"subtitle-position"})],r.prototype,"subtitlePosition",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean,reflect:!0,attribute:"show-border"})],r.prototype,"showBorder",void 0),r=(0,i.Cg)([(0,n.EM)("ha-dialog-header")],r)},72554(e,t,a){a.a(e,async function(e,t){try{var i=a(62826),o=a(93900),n=a(35211),r=a(5124),s=a(22441),l=a(63672),d=a(1087),c=a(64481),h=a(22792),p=a(59992),g=a(14503),u=a(22348),m=(a(76538),a(26300)),f=e([o,m]);[o,m]=f.then?(await f)():f;const v="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 w extends((0,p.V)(r.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(){return r.qy` <wa-dialog .open="${this._open}" .lightDismiss="${!this.preventScrimClose}" without-header aria-labelledby="${(0,l.J)(this.ariaLabelledBy||(void 0!==this.headerTitle?"ha-dialog-title":void 0))}" aria-describedby="${(0,l.J)(this.ariaDescribedBy)}" @keydown="${this._handleKeyDown}" @wa-hide="${this._handleHide}" @wa-show="${this._handleShow}" @wa-after-show="${this._handleAfterShow}" @wa-after-hide="${this._handleAfterHide}"> ${this.withoutHeader?r.s6:r.qy`<slot name="header"> <ha-dialog-header .subtitlePosition="${this.headerSubtitlePosition}" .showBorder="${this._bodyScrolled}"> <slot name="headerNavigationIcon" slot="navigationIcon"> <ha-icon-button data-dialog="close" .label="${this._i18n?.localize?.("ui.common.close")??"Close"}" .path="${v}"></ha-icon-button> </slot> ${void 0!==this.headerTitle?r.qy`<span slot="title" class="title" id="ha-dialog-title"> ${this.headerTitle} </span>`:r.qy`<slot name="headerTitle" slot="title"></slot>`} ${void 0!==this.headerSubtitle?r.qy`<span slot="subtitle">${this.headerSubtitle}</span>`:r.qy`<slot name="headerSubtitle" slot="subtitle"></slot>`} <slot name="headerActionItems" slot="actionItems"></slot> </ha-dialog-header> </slot>`} <div class="content-wrapper"> <div class="body ha-scrollbar" @scroll="${this._handleBodyScroll}"> <slot></slot> </div> ${this.renderScrollableFades()} </div> <slot name="footer" slot="footer"></slot> </wa-dialog> `}disconnectedCallback(){this.removeEventListener("dialog-set-fullscreen",this._handleFullscreenChanged),this._setFullscreen(!1),super.disconnectedCallback(),this._open=!1}_handleFullscreenChanged(e){this._open?(0,c.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){const t=e.detail?.source===e.target.dialog;this.preventScrimClose&&this._escapePressed&&t&&e.preventDefault(),this._escapePressed=!1}static get styles(){return[...super.styles,g.dp,r.AH`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(()=>{if(this._hassConfig?.auth.external&&(0,u.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}})))}this.querySelector("[autofocus]")?.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,s.MZ)({attribute:"aria-labelledby"})],w.prototype,"ariaLabelledBy",void 0),(0,i.Cg)([(0,s.MZ)({attribute:"aria-describedby"})],w.prototype,"ariaDescribedBy",void 0),(0,i.Cg)([(0,s.MZ)({type:Boolean,reflect:!0})],w.prototype,"open",void 0),(0,i.Cg)([(0,s.MZ)({reflect:!0})],w.prototype,"type",void 0),(0,i.Cg)([(0,s.MZ)({type:String,reflect:!0,attribute:"width"})],w.prototype,"width",void 0),(0,i.Cg)([(0,s.MZ)({type:Boolean,reflect:!0,attribute:"prevent-scrim-close"})],w.prototype,"preventScrimClose",void 0),(0,i.Cg)([(0,s.MZ)({attribute:"header-title"})],w.prototype,"headerTitle",void 0),(0,i.Cg)([(0,s.MZ)({attribute:"header-subtitle"})],w.prototype,"headerSubtitle",void 0),(0,i.Cg)([(0,s.MZ)({type:String,attribute:"header-subtitle-position"})],w.prototype,"headerSubtitlePosition",void 0),(0,i.Cg)([(0,s.MZ)({type:Boolean,reflect:!0,attribute:"flexcontent"})],w.prototype,"flexContent",void 0),(0,i.Cg)([(0,s.MZ)({type:Boolean,attribute:"without-header"})],w.prototype,"withoutHeader",void 0),(0,i.Cg)([(0,s.wk)()],w.prototype,"_open",void 0),(0,i.Cg)([(0,s.P)(".body")],w.prototype,"bodyContainer",void 0),(0,i.Cg)([(0,s.wk)(),(0,n.Fg)({context:h.D5,subscribe:!0})],w.prototype,"_i18n",void 0),(0,i.Cg)([(0,s.wk)(),(0,n.Fg)({context:h.WF,subscribe:!0})],w.prototype,"_hassConfig",void 0),(0,i.Cg)([(0,s.wk)()],w.prototype,"_bodyScrolled",void 0),(0,i.Cg)([(0,s.Ls)({passive:!0})],w.prototype,"_handleBodyScroll",null),w=(0,i.Cg)([(0,s.EM)("ha-dialog")],w),t()}catch(e){t(e)}})},28732(e,t,a){var i=a(62826),o=a(27686),n=a(7731),r=a(5124),s=a(22441);class l extends o.J{renderRipple(){return this.noninteractive?"":super.renderRipple()}static get styles(){return[n.R,r.AH`:host{padding-left:var(--mdc-list-side-padding-left,var(--mdc-list-side-padding,20px));padding-inline-start:var(--mdc-list-side-padding-left,var(--mdc-list-side-padding,20px));padding-right:var(--mdc-list-side-padding-right,var(--mdc-list-side-padding,20px));padding-inline-end:var(--mdc-list-side-padding-right,var(--mdc-list-side-padding,20px))}:host([graphic=avatar]:not([twoLine])),:host([graphic=icon]:not([twoLine])){height:48px}span.material-icons:first-of-type{margin-inline-start:0px!important;margin-inline-end:var(--mdc-list-item-graphic-margin,16px)!important;direction:var(--direction)!important}span.material-icons:last-of-type{margin-inline-start:auto!important;margin-inline-end:0px!important;direction:var(--direction)!important}.mdc-deprecated-list-item__meta{display:var(--mdc-list-item-meta-display);align-items:center;flex-shrink:0}:host([graphic=icon]:not([twoline])) .mdc-deprecated-list-item__graphic{margin-inline-end:var(--mdc-list-item-graphic-margin,20px)!important}:host([multiline-secondary]){height:auto}:host([multiline-secondary]) .mdc-deprecated-list-item__text{padding:8px 0}:host([multiline-secondary]) .mdc-deprecated-list-item__secondary-text{text-overflow:initial;white-space:normal;overflow:auto;display:inline-block;margin-top:10px}:host([multiline-secondary]) .mdc-deprecated-list-item__primary-text{margin-top:10px}:host([multiline-secondary]) .mdc-deprecated-list-item__secondary-text::before{display:none}:host([multiline-secondary]) .mdc-deprecated-list-item__primary-text::before{display:none}:host([disabled]){color:var(--disabled-text-color)}:host([noninteractive]){pointer-events:unset}`,"rtl"===document.dir?r.AH`span.material-icons:first-of-type,span.material-icons:last-of-type{direction:rtl!important;--direction:rtl}`:r.AH``]}}l=(0,i.Cg)([(0,s.EM)("ha-list-item")],l)},8630(e,t,a){var i=a(62826),o=a(68618),n=a(11081),r=a(22441);class s extends o.iY{}s.styles=n.R,s=(0,i.Cg)([(0,r.EM)("ha-list")],s)},65829(e,t,a){a.a(e,async function(e,i){try{a.r(t),a.d(t,{HaSpinner:()=>d});var o=a(62826),n=a(55262),r=a(5124),s=a(22441),l=e([n]);n=(l.then?(await l)():l)[0];class d extends n.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[n.A.styles,r.AH`: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,s.MZ)()],d.prototype,"size",void 0),d=(0,o.Cg)([(0,s.EM)("ha-spinner")],d),i()}catch(e){i(e)}})},26571(e,t,a){a.d(t,{Al:()=>n,KY:()=>o,PN:()=>l,dG:()=>c,jm:()=>d,m7:()=>m,sR:()=>h,t1:()=>s,t2:()=>g,x:()=>u,yu:()=>p});var i=a(95350);const o=["bluetooth","dhcp","discovery","esphome","hardware","hassio","homekit","integration_discovery","mqtt","ssdp","unignore","usb","zeroconf"],n=66649!=a.j?["reauth"]:null,r={"HA-Frontend-Base":`${location.protocol}//${location.host}`},s=(e,t,a)=>e.callApi("POST","config/config_entries/flow",{handler:t,entry_id:a},r),l=(e,t)=>e.callApi("GET",`config/config_entries/flow/${t}`,void 0,r),d=(e,t,a)=>e.callApi("POST",`config/config_entries/flow/${t}`,a,r),c=(e,t,a)=>e.callWS({type:"config_entries/ignore_flow",flow_id:t,title:a}),h=(e,t)=>e.callApi("DELETE",`config/config_entries/flow/${t}`),p=(e,t)=>e.callApi("GET","config/config_entries/flow_handlers"+(t?`?type=${t}`:"")),g=e=>e.sendMessagePromise({type:"config_entries/flow/progress"}),u=(e,t)=>e.connection.subscribeMessage(e=>t(e),{type:"config_entries/flow/subscribe"}),m=(e,t)=>t.context.title_placeholders&&0!==Object.keys(t.context.title_placeholders).length?e(`component.${t.handler}.config.flow_title`,t.context.title_placeholders)||("name"in t.context.title_placeholders?t.context.title_placeholders.name:(0,i.p$)(e,t.handler)):(0,i.p$)(e,t.handler)},21016(e,t,a){a.d(t,{Pu:()=>o,SB:()=>r,mk:()=>n,r1:()=>i});const i=e=>e.callWS({type:"counter/list"}),o=(e,t)=>e.callWS({type:"counter/create",...t}),n=(e,t,a)=>e.callWS({type:"counter/update",counter_id:t,...a}),r=(e,t)=>e.callWS({type:"counter/delete",counter_id:t})},2279(e,t,a){a.d(t,{e1:()=>r,iE:()=>n,nr:()=>o,tT:()=>i});const i=e=>e.callWS({type:"input_boolean/list"}),o=(e,t)=>e.callWS({type:"input_boolean/create",...t}),n=(e,t,a)=>e.callWS({type:"input_boolean/update",input_boolean_id:t,...a}),r=(e,t)=>e.callWS({type:"input_boolean/delete",input_boolean_id:t})},42575(e,t,a){a.d(t,{C1:()=>r,L6:()=>o,mC:()=>n,vF:()=>i});const i=e=>e.callWS({type:"input_button/list"}),o=(e,t)=>e.callWS({type:"input_button/create",...t}),n=(e,t,a)=>e.callWS({type:"input_button/update",input_button_id:t,...a}),r=(e,t)=>e.callWS({type:"input_button/delete",input_button_id:t})},77738(e,t,a){a.d(t,{Bj:()=>l,TB:()=>o,a2:()=>n,fJ:()=>s,ke:()=>r,rv:()=>i});const i=e=>`${e.attributes.year||"1970"}-${String(e.attributes.month||"01").padStart(2,"0")}-${String(e.attributes.day||"01").padStart(2,"0")}T${String(e.attributes.hour||"00").padStart(2,"0")}:${String(e.attributes.minute||"00").padStart(2,"0")}:${String(e.attributes.second||"00").padStart(2,"0")}`,o=(e,t,a=void 0,i=void 0)=>{const o={entity_id:t,time:a,date:i};e.callService("input_datetime","set_datetime",o)},n=e=>e.callWS({type:"input_datetime/list"}),r=(e,t)=>e.callWS({type:"input_datetime/create",...t}),s=(e,t,a)=>e.callWS({type:"input_datetime/update",input_datetime_id:t,...a}),l=(e,t)=>e.callWS({type:"input_datetime/delete",input_datetime_id:t})},6922(e,t,a){a.d(t,{$I:()=>r,Tv:()=>n,gO:()=>o,kF:()=>i});const i=e=>e.callWS({type:"input_number/list"}),o=(e,t)=>e.callWS({type:"input_number/create",...t}),n=(e,t,a)=>e.callWS({type:"input_number/update",input_number_id:t,...a}),r=(e,t)=>e.callWS({type:"input_number/delete",input_number_id:t})},33687(e,t,a){a.d(t,{BT:()=>n,EJ:()=>r,HV:()=>o,MZ:()=>i,O3:()=>s});const i=(e,t,a)=>e.callService("input_select","select_option",{option:a,entity_id:t}),o=e=>e.callWS({type:"input_select/list"}),n=(e,t)=>e.callWS({type:"input_select/create",...t}),r=(e,t,a)=>e.callWS({type:"input_select/update",input_select_id:t,...a}),s=(e,t)=>e.callWS({type:"input_select/delete",input_select_id:t})},12284(e,t,a){a.d(t,{BJ:()=>r,KY:()=>i,MG:()=>o,d_:()=>s,m4:()=>n});const i=(e,t,a)=>e.callService(t.split(".",1)[0],"set_value",{value:a,entity_id:t}),o=e=>e.callWS({type:"input_text/list"}),n=(e,t)=>e.callWS({type:"input_text/create",...t}),r=(e,t,a)=>e.callWS({type:"input_text/update",input_text_id:t,...a}),s=(e,t)=>e.callWS({type:"input_text/delete",input_text_id:t})},2247(e,t,a){a.d(t,{Fs:()=>r,VD:()=>s,YA:()=>o,mx:()=>i,sF:()=>n});const i=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],o=e=>e.callWS({type:"schedule/list"}),n=(e,t)=>e.callWS({type:"schedule/create",...t}),r=(e,t,a)=>e.callWS({type:"schedule/update",schedule_id:t,...a}),s=(e,t)=>e.callWS({type:"schedule/delete",schedule_id:t})},49141(e,t,a){a.d(t,{CR:()=>r,PF:()=>c,kL:()=>n,ls:()=>d,pZ:()=>l,r9:()=>s});var i=a(90409),o=a(27167);const n=e=>e.callWS({type:"timer/list"}),r=(e,t)=>e.callWS({type:"timer/create",...t}),s=(e,t,a)=>e.callWS({type:"timer/update",timer_id:t,...a}),l=(e,t)=>e.callWS({type:"timer/delete",timer_id:t}),d=e=>{if(!e.attributes.remaining)return;let t=(0,i.A)(e.attributes.remaining);if("active"===e.state){const a=(new Date).getTime(),i=new Date(e.attributes.finishes_at).getTime();t=Math.max((i-a)/1e3,0)}return t},c=(e,t,a)=>{if(!t)return null;if("idle"===t.state||0===a)return e.formatEntityState(t);let i=(0,o.A)(a||0)||"0";return"paused"===t.state&&(i=`${i} (${e.formatEntityState(t)})`),i}},77763(e,t,a){a.d(t,{W:()=>s});var i=a(5124),o=a(26571),n=a(95350),r=a(29094);const s=(e,t)=>(0,r.g)(e,t,{flowType:"config_flow",showDevices:!0,createFlow:async(e,a)=>{const[i]=await Promise.all([(0,o.t1)(e,a,t.entryId),e.loadFragmentTranslation("config"),e.loadBackendTranslation("config",a),e.loadBackendTranslation("selector",a),e.loadBackendTranslation("title",a)]);return i},fetchFlow:async(e,t)=>{const[a]=await Promise.all([(0,o.PN)(e,t),e.loadFragmentTranslation("config")]);return await Promise.all([e.loadBackendTranslation("config",a.handler),e.loadBackendTranslation("selector",a.handler),e.loadBackendTranslation("title",a.handler)]),a},handleFlowStep:o.jm,deleteFlow:o.sR,renderAbortDescription(e,t){const a=e.localize(`component.${t.translation_domain||t.handler}.config.abort.${t.reason}`,t.description_placeholders);return a?i.qy` <ha-markdown allow-svg breaks .content="${a}"></ha-markdown> `:t.reason},renderShowFormStepHeader:(e,t)=>e.localize(`component.${t.translation_domain||t.handler}.config.step.${t.step_id}.title`,t.description_placeholders)||e.localize(`component.${t.handler}.title`),renderShowFormStepDescription(e,t){const a=e.localize(`component.${t.translation_domain||t.handler}.config.step.${t.step_id}.description`,t.description_placeholders);return a?i.qy` <ha-markdown .allowDataUrl="${"zwave_js"===t.handler}" allow-svg breaks .content="${a}"></ha-markdown> `:""},renderShowFormStepFieldLabel(e,t,a,i){if("expandable"===a.type)return e.localize(`component.${t.handler}.config.step.${t.step_id}.sections.${a.name}.name`,t.description_placeholders)||a.name;const o=i?.path?.[0]?`sections.${i.path[0]}.`:"";return e.localize(`component.${t.handler}.config.step.${t.step_id}.${o}data.${a.name}`,t.description_placeholders)||a.name},renderShowFormStepFieldHelper(e,t,a,o){if("expandable"===a.type)return e.localize(`component.${t.translation_domain||t.handler}.config.step.${t.step_id}.sections.${a.name}.description`,t.description_placeholders);const n=o?.path?.[0]?`sections.${o.path[0]}.`:"",r=e.localize(`component.${t.translation_domain||t.handler}.config.step.${t.step_id}.${n}data_description.${a.name}`,t.description_placeholders);return r?i.qy`<ha-markdown breaks .content="${r}"></ha-markdown>`:""},renderShowFormStepFieldError:(e,t,a)=>e.localize(`component.${t.translation_domain||t.translation_domain||t.handler}.config.error.${a}`,t.description_placeholders)||a,renderShowFormStepFieldLocalizeValue:(e,t,a)=>e.localize(`component.${t.handler}.selector.${a}`),renderShowFormStepSubmitButton:(e,t)=>e.localize(`component.${t.handler}.config.step.${t.step_id}.submit`)||e.localize("ui.panel.config.integrations.config_flow."+(!1===t.last_step?"next":"submit")),renderExternalStepHeader:(e,t)=>e.localize(`component.${t.handler}.config.step.${t.step_id}.title`)||e.localize("ui.panel.config.integrations.config_flow.external_step.open_site"),renderExternalStepDescription(e,t){const a=e.localize(`component.${t.translation_domain||t.handler}.config.${t.step_id}.description`,t.description_placeholders);return i.qy` <p> ${e.localize("ui.panel.config.integrations.config_flow.external_step.description")} </p> ${a?i.qy` <ha-markdown allow-svg breaks .content="${a}"></ha-markdown> `:""} `},renderCreateEntryDescription(e,t){const a=e.localize(`component.${t.translation_domain||t.handler}.config.create_entry.${t.description||"default"}`,t.description_placeholders);return i.qy` ${a?i.qy` <ha-markdown allow-svg breaks .content="${a}"></ha-markdown> `:i.s6} `},renderShowFormProgressHeader:(e,t)=>e.localize(`component.${t.handler}.config.step.${t.step_id}.title`)||e.localize(`component.${t.handler}.title`),renderShowFormProgressDescription(e,t){const a=e.localize(`component.${t.translation_domain||t.handler}.config.progress.${t.progress_action}`,t.description_placeholders);return a?i.qy` <ha-markdown allow-svg breaks .content="${a}"></ha-markdown> `:""},renderMenuHeader:(e,t)=>e.localize(`component.${t.handler}.config.step.${t.step_id}.title`)||e.localize(`component.${t.handler}.title`),renderMenuDescription(e,t){const a=e.localize(`component.${t.translation_domain||t.handler}.config.step.${t.step_id}.description`,t.description_placeholders);return a?i.qy` <ha-markdown allow-svg breaks .content="${a}"></ha-markdown> `:""},renderMenuOption:(e,t,a)=>e.localize(`component.${t.translation_domain||t.handler}.config.step.${t.step_id}.menu_options.${a}`,t.description_placeholders),renderMenuOptionDescription:(e,t,a)=>e.localize(`component.${t.translation_domain||t.handler}.config.step.${t.step_id}.menu_option_descriptions.${a}`,t.description_placeholders),renderLoadingDescription(e,t,a,i){if("loading_flow"!==t&&"loading_step"!==t)return"";const o=i?.handler||a;return e.localize(`ui.panel.config.integrations.config_flow.loading.${t}`,{integration:o?(0,n.p$)(e.localize,o):e.localize("ui.panel.config.integrations.config_flow.loading.fallback_title")})}})},29094(e,t,a){a.d(t,{g:()=>n});var i=a(1087);const o=()=>Promise.all([a.e(4801),a.e(39763),a.e(32450),a.e(46095),a.e(7305),a.e(92769),a.e(3283),a.e(80131),a.e(58416),a.e(54066),a.e(84038),a.e(69205),a.e(26092),a.e(48531),a.e(92411),a.e(44642)]).then(a.bind(a,78314)),n=(e,t,a)=>{(0,i.r)(e,"show-dialog",{dialogTag:"dialog-data-entry-flow",dialogImport:o,dialogParams:{...t,flowConfig:a,dialogParentElement:e}})}},79029(e,t,a){a.a(e,async function(e,i){try{a.r(t),a.d(t,{DialogHelperDetail:()=>q});a(74423),a(44114),a(18111),a(61701),a(13579);var o=a(62826),n=a(5124),r=a(22441),s=a(22786),l=a(36312),d=a(69558),c=a(1087),h=a(57237),p=a(52220),g=a(18350),u=a(72554),m=(a(93444),a(8630),a(28732),a(65829)),f=(a(67094),a(34127)),v=a(36866),w=a(26571),y=a(21016),_=a(2279),b=a(42575),x=a(77738),$=a(6922),k=a(33687),C=a(12284),S=a(95350),z=a(2247),F=a(49141),E=a(77763),L=a(65063),P=a(14503),A=a(44144),D=a(24367),M=e([g,u,m,f,v]);[g,u,m,f,v]=M.then?(await M)():M;const T="M12,2L1,21H23M12,6L19.53,19H4.47M11,10V14H13V10M11,16V18H13V16",W={input_boolean:{create:_.nr,import:()=>a.e(59263).then(a.bind(a,89269)),alias:["switch","toggle"]},input_button:{create:b.L6,import:()=>a.e(116).then(a.bind(a,37018))},input_text:{create:C.m4,import:()=>Promise.all([a.e(81034),a.e(49469)]).then(a.bind(a,8431))},input_number:{create:$.gO,import:()=>Promise.all([a.e(34995),a.e(81034),a.e(81382),a.e(4440)]).then(a.bind(a,76901))},input_datetime:{create:x.ke,import:()=>Promise.all([a.e(81034),a.e(45771)]).then(a.bind(a,837))},input_select:{create:k.BT,import:()=>a.e(79151).then(a.bind(a,22514)),alias:["select","dropdown"]},counter:{create:y.Pu,import:()=>a.e(58224).then(a.bind(a,46963))},timer:{create:F.CR,import:()=>Promise.all([a.e(34995),a.e(16508),a.e(73476)]).then(a.bind(a,14872)),alias:["countdown"]},schedule:{create:z.sF,import:()=>Promise.all([a.e(79996),a.e(10147),a.e(17362),a.e(47852)]).then(a.bind(a,84226))}};class q extends n.WF{async showDialog(e){this._params=e,this._domain=e.domain,this._item=void 0,this._domain&&this._domain in W&&await W[this._domain].import(),this._open=!0,await this.updateComplete,this.hass.loadFragmentTranslation("config");const t=await(0,w.yu)(this.hass,["helper"]);await this.hass.loadBackendTranslation("title",t,!0),this._helperFlows=t,await this.updateComplete,await this._focusSearchInput()}closeDialog(){this._open=!1}_dialogClosed(){if(this._open=!1,this._error=void 0,this._domain=void 0,this._params=void 0,this._filter=void 0,(0,c.r)(this,"dialog-closed",{dialog:this.localName}),this._pendingConfigFlow){const e=this._pendingConfigFlow;this._pendingConfigFlow=void 0,(0,E.W)(this,{startFlowHandler:e.startFlowHandler,manifest:e.manifest,dialogClosedCallback:e.dialogClosedCallback})}}render(){if(!this._params)return n.s6;let e,t=n.s6;if(this._domain)e=n.qy` <div class="form" @value-changed="${this._valueChanged}"> ${this._error?n.qy`<div class="error">${this._error}</div>`:""} ${(0,d._)(`ha-${this._domain}-form`,{hass:this.hass,item:this._item,new:!0,autofocus:!0})} </div> `,t=n.qy` <ha-dialog-footer slot="footer"> ${this._params?.domain?n.s6:n.qy`<ha-button slot="secondaryAction" appearance="plain" @click="${this._goBack}" .disabled="${this._submitting}"> ${this.hass.localize("ui.common.back")} </ha-button>`} <ha-button slot="primaryAction" @click="${this._createItem}" .disabled="${this._submitting}"> ${this.hass.localize("ui.panel.config.helpers.dialog.create")} </ha-button> </ha-dialog-footer> `;else if(this._loading||void 0===this._helperFlows)e=n.qy`<ha-spinner></ha-spinner>`;else{const t=this._filterHelpers(W,this._helperFlows,this._filter);e=n.qy` <ha-input-search appearance="outlined" autofocus .value="${this._filter}" @input="${this._filterChanged}" .placeholder="${this.hass.localize("ui.panel.config.integrations.search_helper")}"></ha-input-search> <ha-list class="ha-scrollbar" innerRole="listbox" itemRoles="option" innerAriaLabel="${this.hass.localize("ui.panel.config.helpers.dialog.create_helper")}" rootTabbable> ${t.map(([e,t])=>{const a=!(e in W)||(0,l.x)(this.hass.config,e);return n.qy` <ha-list-item hasmeta .domain="${e}" @request-selected="${this._domainPicked}" graphic="icon"> <img slot="graphic" loading="lazy" alt="" src="${(0,A.MR)({domain:e,type:"icon",darkOptimized:this.hass.themes?.darkMode},this.hass.auth.data.hassUrl)}" crossorigin="anonymous" referrerpolicy="no-referrer"> <span class="item-text"> ${t} </span> ${a?n.qy`<ha-icon-next slot="meta"></ha-icon-next>`:n.qy`<ha-svg-icon slot="meta" .id="icon-${e}" path="${T}" @click="${h.d}"></ha-svg-icon> <ha-tooltip .for="icon-${e}"> ${this.hass.localize("ui.dialogs.helper_settings.platform_not_loaded",{platform:e})} </ha-tooltip>`} </ha-list-item> `})} </ha-list> `}return n.qy` <ha-dialog .open="${this._open}" header-title="${this._domain?this.hass.localize("ui.panel.config.helpers.dialog.create_platform",{platform:(0,D.z)(this._domain)&&this.hass.localize(`ui.panel.config.helpers.types.${this._domain}`)||this._domain}):this.hass.localize("ui.panel.config.helpers.dialog.create_helper")}" @closed="${this._dialogClosed}"> ${e} ${t} </ha-dialog> `}async _filterChanged(e){const t=e.target;this._filter=t.value}_valueChanged(e){this._item=e.detail.value}async _createItem(){if(this._domain&&this._item){this._submitting=!0,this._error="";try{const e=await W[this._domain].create(this.hass,this._item);this._params?.dialogClosedCallback&&e.id&&this._params.dialogClosedCallback({flowFinished:!0,entityId:`${this._domain}.${e.id}`}),this.closeDialog()}catch(e){this._error=e.message||"Unknown error"}finally{this._submitting=!1}}}async _domainPicked(e){const t=e.target.closest("ha-list-item").domain;if(!(t in W)||(0,l.x)(this.hass.config,t))if(t in W){this._loading=!0;try{await W[t].import(),this._domain=t}finally{this._loading=!1}}else this._pendingConfigFlow={startFlowHandler:t,manifest:await(0,S.QC)(this.hass,t),dialogClosedCallback:this._params?.dialogClosedCallback},this.closeDialog();else(0,L.showAlertDialog)(this,{text:this.hass.localize("ui.dialogs.helper_settings.platform_not_loaded",{platform:t})})}async _goBack(){this._domain=void 0,this._item=void 0,this._error=void 0,await this.updateComplete,await this._focusSearchInput()}async _focusSearchInput(){const e=this._searchInput;e&&(await e.updateComplete,e.focus())}static get styles(){return[P.dp,P.nA,n.AH`ha-dialog{--dialog-content-padding:0}ha-icon-next{width:var(--ha-space-6)}ha-tooltip{pointer-events:auto}.form{padding:var(--ha-space-6)}ha-input-search{margin:0 var(--ha-space-4) var(--ha-space-3)}ha-list{height:calc(60vh - 184px)}@media all and (max-width:450px),all and (max-height:500px){ha-list{height:calc(100vh - 184px - var(--safe-area-inset-top,0px) - var(--safe-area-inset-bottom,0px))}}`]}constructor(...e){super(...e),this._open=!1,this._submitting=!1,this._loading=!1,this._filterHelpers=(0,s.A)((e,t,a)=>{const i=[];for(const t of Object.keys(e))i.push([t,this.hass.localize(`ui.panel.config.helpers.types.${t}`)||t]);if(t)for(const e of t)i.push([e,(0,S.p$)(this.hass.localize,e)]);return i.filter(([t,i])=>{if(a){const o=a.toLowerCase();return i.toLowerCase().includes(o)||t.toLowerCase().includes(o)||(e[t]?.alias||[]).some(e=>e.toLowerCase().includes(o))}return!0}).sort((e,t)=>(0,p.xL)(e[1],t[1],this.hass.locale.language))})}}(0,o.Cg)([(0,r.MZ)({attribute:!1})],q.prototype,"hass",void 0),(0,o.Cg)([(0,r.wk)()],q.prototype,"_item",void 0),(0,o.Cg)([(0,r.wk)()],q.prototype,"_open",void 0),(0,o.Cg)([(0,r.wk)()],q.prototype,"_domain",void 0),(0,o.Cg)([(0,r.wk)()],q.prototype,"_error",void 0),(0,o.Cg)([(0,r.wk)()],q.prototype,"_submitting",void 0),(0,o.Cg)([(0,r.wk)()],q.prototype,"_helperFlows",void 0),(0,o.Cg)([(0,r.wk)()],q.prototype,"_loading",void 0),(0,o.Cg)([(0,r.wk)()],q.prototype,"_filter",void 0),(0,o.Cg)([(0,r.P)("ha-input-search")],q.prototype,"_searchInput",void 0),q=(0,o.Cg)([(0,r.EM)("dialog-helper-detail")],q),i()}catch(e){i(e)}})},44144(e,t,a){a.d(t,{Cv:()=>l,MR:()=>p,QR:()=>g,_c:()=>h,a_:()=>m,bg:()=>f,yM:()=>u});a(18111),a(22489),a(14603),a(47566),a(98721);if(66649!=a.j)var i=a(8129);let o,n;const r=66649!=a.j?18e5:null,s=66649!=a.j?[0,500,1e3,2e3,5e3,1e4,15e3]:null,l=async e=>{const t=o;for(const a of s){a&&await(0,i.l)(a);try{return await d(e),c(e),o!==t}catch{}}return!1},d=async e=>{const t=await e.callWS({type:"brands/access_token"});o=t.token},c=e=>{h(),n=setInterval(()=>{d(e).catch(()=>{})},r)},h=()=>{n&&(clearInterval(n),n=void 0)},p=(e,t)=>{if(!o)return"";t=t??location.origin;const a=`/api/brands/integration/${e.domain}/${e.darkOptimized?"dark_":""}${e.type}.png`,i=new URL(a,t);return i.searchParams.set("token",o),i.toString()},g=(e,t)=>{if(!o)return"";t=t??location.origin;const a=`/api/brands/hardware/${e.category}/${e.darkOptimized?"dark_":""}${e.manufacturer}${e.model?`_${e.model}`:""}.png`,i=new URL(a,t);return i.searchParams.set("token",o),i.toString()},u=(e,t)=>{let a;t=t??location.origin;try{a=new URL(e,t)}catch{return e}return a.pathname.startsWith("/api/brands/")?o?(a.searchParams.set("token",o),a.toString()):"":e},m=e=>{const t=new URL(e,location.origin);if(t.pathname.startsWith("/api/brands/"))return t.pathname.split("/")[4];const a=t.pathname.split("/").filter(e=>e.length>0),i=a.indexOf("_");return-1!==i&&i+1<a.length?a[i+1]:a[1]??""},f=e=>{try{return new URL(e,location.origin).pathname.startsWith("/api/brands/")||e.startsWith("https://brands.home-assistant.io/")}catch{return!1}}},77957(e,t,a){var i=a(76080),o=a(79504),n=a(47055),r=a(48981),s=a(56969),l=a(26198),d=a(2360),c=a(35370),h=Array,p=o([].push);e.exports=function(e,t,a,o){for(var g,u,m,f=r(e),v=n(f),w=i(t,a),y=d(null),_=l(v),b=0;_>b;b++)m=v[b],(u=s(w(m,b,f)))in y?p(y[u],m):y[u]=[m];if(o&&(g=o(f))!==h)for(u in y)y[u]=c(g,y[u]);return y}},46058(e,t,a){var i=a(46518),o=a(77957),n=a(6469);i({target:"Array",proto:!0},{group:function(e){return o(this,e,arguments.length>1?arguments[1]:void 0)}}),n("group")},93900(e,t,a){a.a(e,async function(e,t){try{var i=a(5124),o=a(22441),n=a(6412),r=a(63672),s=a(17051),l=a(42462),d=a(28438),c=a(98779),h=a(27259),p=a(25877),g=a(31247),u=a(4444),m=a(92070),f=a(9395),v=a(717),w=a(17060),y=a(88496),_=a(91470),b=e([y,w]);[y,w]=b.then?(await b)():b;var x=Object.defineProperty,$=Object.getOwnPropertyDescriptor,k=(e,t,a,i)=>{for(var o,n=i>1?void 0:i?$(t,a):t,r=e.length-1;r>=0;r--)(o=e[r])&&(n=(i?o(t,a,n):o(n))||n);return i&&n&&x(t,a,n),n};let C=class extends v.A{firstUpdated(){this.open&&(this.addOpenListeners(),this.dialog.showModal(),(0,u.JG)(this))}disconnectedCallback(){super.disconnectedCallback(),(0,u.I7)(this),this.removeOpenListeners()}async requestClose(e){const t=new d.L({source:e});if(this.dispatchEvent(t),t.defaultPrevented)return this.open=!0,void(0,h.Ud)(this.dialog,"pulse");this.removeOpenListeners(),await(0,h.Ud)(this.dialog,"hide"),this.open=!1,this.dialog.close(),(0,u.I7)(this);const a=this.originalTrigger;"function"==typeof a?.focus&&setTimeout(()=>a.focus()),this.dispatchEvent(new s.Z)}addOpenListeners(){document.addEventListener("keydown",this.handleDocumentKeyDown),(0,p.AZ)(this)}removeOpenListeners(){document.removeEventListener("keydown",this.handleDocumentKeyDown),(0,p.Fw)(this)}handleDialogCancel(e){e.preventDefault(),!this.dialog.classList.contains("hide")&&e.target===this.dialog&&(0,p.a0)(this)&&this.requestClose(this.dialog)}handleDialogClick(e){const t=e.target.closest('[data-dialog="close"]');t&&(e.stopPropagation(),this.requestClose(t))}async handleDialogPointerDown(e){e.target===this.dialog&&(this.lightDismiss?this.requestClose(this.dialog):await(0,h.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 e=new c.k;this.dispatchEvent(e),e.defaultPrevented?this.open=!1:(this.addOpenListeners(),this.originalTrigger=document.activeElement,this.open=!0,this.dialog.showModal(),(0,u.JG)(this),requestAnimationFrame(()=>{const e=this.querySelector("[autofocus]");e&&"function"==typeof e.focus?e.focus():this.dialog.focus()}),await(0,h.Ud)(this.dialog,"show"),this.dispatchEvent(new l.q))}render(){const e=!this.withoutHeader,t=this.hasUpdated?this.hasSlotController.test("footer"):this.withFooter;return i.qy` <dialog aria-labelledby="${this.ariaLabelledby??"title"}" aria-describedby="${(0,r.J)(this.ariaDescribedby)}" part="dialog" class="${(0,n.H)({dialog:!0,open:this.open})}" @cancel="${this.handleDialogCancel}" @click="${this.handleDialogClick}" @pointerdown="${this.handleDialogPointerDown}"> ${e?i.qy` <header part="header" class="header"> <h2 part="title" class="title" id="title"> <slot name="label"> ${this.label.length>0?this.label:String.fromCharCode(8203)} </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="${e=>this.requestClose(e.target)}"> <wa-icon name="xmark" label="${this.localize.term("close")}" library="system" variant="solid"></wa-icon> </wa-button> </div> </header> `:""} <div part="body" class="body"><slot></slot></div> ${t?i.qy` <footer part="footer" class="footer"> <slot name="footer"></slot> </footer> `:""} </dialog> `}constructor(){super(...arguments),this.localize=new w.c(this),this.hasSlotController=new m.X(this,"footer","header-actions","label"),this.open=!1,this.label="",this.withoutHeader=!1,this.lightDismiss=!1,this.withFooter=!1,this.handleDocumentKeyDown=e=>{"Escape"===e.key&&this.open&&(0,p.a0)(this)&&(e.preventDefault(),e.stopPropagation(),this.requestClose(this.dialog))}}};C.css=_.A,k([(0,o.P)(".dialog")],C.prototype,"dialog",2),k([(0,o.MZ)({type:Boolean,reflect:!0})],C.prototype,"open",2),k([(0,o.MZ)({reflect:!0})],C.prototype,"label",2),k([(0,o.MZ)({attribute:"without-header",type:Boolean,reflect:!0})],C.prototype,"withoutHeader",2),k([(0,o.MZ)({attribute:"light-dismiss",type:Boolean})],C.prototype,"lightDismiss",2),k([(0,o.MZ)({attribute:"aria-labelledby"})],C.prototype,"ariaLabelledby",2),k([(0,o.MZ)({attribute:"aria-describedby"})],C.prototype,"ariaDescribedby",2),k([(0,o.MZ)({attribute:"with-footer",type:Boolean})],C.prototype,"withFooter",2),k([(0,f.w)("open",{waitUntilFirstUpdate:!0})],C.prototype,"handleOpenChange",1),C=k([(0,o.EM)("wa-dialog")],C),i.S$||(document.addEventListener("click",e=>{const t=e.target.closest("[data-dialog]");if(t instanceof Element){const[e,a]=(0,g.v)(t.getAttribute("data-dialog")||"");if("open"===e&&a?.length){const e=t.getRootNode().getElementById(a);"wa-dialog"===e?.localName?e.open=!0:console.warn(`A dialog with an ID of "${a}" could not be found in this document.`)}}}),document.addEventListener("pointerdown",()=>{})),t()}catch(e){t(e)}})},91470(e,t,a){a.d(t,{A:()=>i});var i=a(5124).AH`: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}}`}};