landingpage/rootfs/usr/share/www/frontend_latest/238.38ded68ed3eb236e.js

2 lines
13 KiB
JavaScript

export const ids=["238"];export const modules={7393:function(i,e,t){var a=t("4249"),n=t("7243"),o=t("4569"),d=t("5359"),l=t("552"),r=t("6522"),s=t("2621"),c=t("3744"),h=t("8854");let p;c.A.addInitializer((async i=>{await i.updateComplete;const e=i;e.dialog.prepend(e.scrim),e.scrim.style.inset=0,e.scrim.style.zIndex=0;const{getOpenAnimation:t,getCloseAnimation:a}=e;e.getOpenAnimation=()=>{const i=t.call(void 0);return i.container=[...i.container??[],...i.dialog??[]],i.dialog=[],i},e.getCloseAnimation=()=>{const i=a.call(void 0);return i.container=[...i.container??[],...i.dialog??[]],i.dialog=[],i}}));(0,a.Z)([(0,o.Mo)("ha-md-dialog")],(function(i,e){class a extends e{constructor(){super(),i(this),this.addEventListener("cancel",this._handleCancel),"function"!=typeof HTMLDialogElement&&(this.addEventListener("open",this._handleOpen),p||(p=t.e("854").then(t.bind(t,5893)))),void 0===this.animate&&(this.quick=!0),void 0===this.animate&&(this.quick=!0)}}return{F:a,d:[{kind:"field",decorators:[(0,o.Cb)({attribute:"disable-cancel-action",type:Boolean})],key:"disableCancelAction",value:()=>!1},{kind:"field",key:"_polyfillDialogRegistered",value:()=>!1},{kind:"method",key:"_handleOpen",value:async function(i){if(i.preventDefault(),this._polyfillDialogRegistered)return;this._polyfillDialogRegistered=!0,this._loadPolyfillStylesheet("/static/polyfills/dialog-polyfill.css");const e=this.shadowRoot?.querySelector("dialog");(await p).default.registerDialog(e),this.removeEventListener("open",this._handleOpen),this.show()}},{kind:"method",key:"_loadPolyfillStylesheet",value:async function(i){const e=document.createElement("link");return e.rel="stylesheet",e.href=i,new Promise(((t,a)=>{e.onload=()=>t(),e.onerror=()=>a(new Error(`Stylesheet failed to load: ${i}`)),this.shadowRoot?.appendChild(e)}))}},{kind:"method",key:"_handleCancel",value:function(i){if(this.disableCancelAction){i.preventDefault();const e=this.shadowRoot?.querySelector("dialog .container");void 0!==this.animate&&e?.animate([{transform:"rotate(-1deg)","animation-timing-function":"ease-in"},{transform:"rotate(1.5deg)","animation-timing-function":"ease-out"},{transform:"rotate(0deg)","animation-timing-function":"ease-in"}],{duration:200,iterations:2})}}},{kind:"field",static:!0,key:"styles",value(){return[...(0,s.Z)(a,"styles",this),n.iv`:host{--md-dialog-container-color:var(--card-background-color);--md-dialog-headline-color:var(--primary-text-color);--md-dialog-supporting-text-color:var(--primary-text-color);--md-sys-color-scrim:#000000;--md-dialog-headline-weight:400;--md-dialog-headline-size:1.574rem;--md-dialog-supporting-text-size:1rem;--md-dialog-supporting-text-line-height:1.5rem}:host([type=alert]){min-width:320px}@media all and (max-width:450px),all and (max-height:500px){:host(:not([type=alert])){min-width:calc(100vw - env(safe-area-inset-right) - env(safe-area-inset-left));max-width:calc(100vw - env(safe-area-inset-right) - env(safe-area-inset-left));min-height:100%;max-height:100%;--md-dialog-container-shape:0}}::slotted(ha-dialog-header[slot=headline]){display:contents}.scroller{overflow:var(--dialog-content-overflow,auto)}slot[name=content]::slotted(*){padding:var(--dialog-content-padding,24px)}.scrim{z-index:10}`]}}]}}),c.A);h.I,h.G;(0,a.Z)([(0,o.Mo)("ha-dialog-header")],(function(i,e){return{F:class extends e{constructor(...e){super(...e),i(this)}},d:[{kind:"method",key:"render",value:function(){return n.dy` <header class="header"> <div class="header-bar"> <section class="header-navigation-icon"> <slot name="navigationIcon"></slot> </section> <section class="header-content"> <div class="header-title"> <slot name="title"></slot> </div> <div class="header-subtitle"> <slot name="subtitle"></slot> </div> </section> <section class="header-action-items"> <slot name="actionItems"></slot> </section> </div> <slot></slot> </header> `}},{kind:"get",static:!0,key:"styles",value:function(){return[n.iv`: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:flex-start;padding:4px;box-sizing:border-box}.header-content{flex:1;padding:10px 4px;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.header-title{font-size:22px;line-height:28px;font-weight:400}.header-subtitle{font-size:14px;line-height:20px;color:var(--secondary-text-color)}@media all and (min-width:450px) and (min-height:500px){.header-bar{padding:12px}}.header-navigation-icon{flex:none;min-width:8px;height:100%;display:flex;flex-direction:row}.header-action-items{flex:none;min-width:8px;height:100%;display:flex;flex-direction:row}`]}}]}}),n.oi);t("7583"),t("3035");var m=t("7750"),f=t("3990"),u=t("4463");(0,a.Z)([(0,o.Mo)("ha-textfield")],(function(i,e){class t extends e{constructor(...e){super(...e),i(this)}}return{F:t,d:[{kind:"field",decorators:[(0,o.Cb)({type:Boolean})],key:"invalid",value:void 0},{kind:"field",decorators:[(0,o.Cb)({attribute:"error-message"})],key:"errorMessage",value:void 0},{kind:"field",decorators:[(0,o.Cb)({type:Boolean})],key:"icon",value:()=>!1},{kind:"field",decorators:[(0,o.Cb)({type:Boolean})],key:"iconTrailing",value:()=>!1},{kind:"field",decorators:[(0,o.Cb)()],key:"autocomplete",value:void 0},{kind:"field",decorators:[(0,o.Cb)()],key:"autocorrect",value:void 0},{kind:"field",decorators:[(0,o.Cb)({attribute:"input-spellcheck"})],key:"inputSpellcheck",value:void 0},{kind:"field",decorators:[(0,o.IO)("input")],key:"formElement",value:void 0},{kind:"method",key:"updated",value:function(i){(0,s.Z)(t,"updated",this,3)([i]),(i.has("invalid")||i.has("errorMessage"))&&(this.setCustomValidity(this.invalid?this.errorMessage||this.validationMessage||"Invalid":""),(this.invalid||this.validateOnInitialRender||i.has("invalid")&&void 0!==i.get("invalid"))&&this.reportValidity()),i.has("autocomplete")&&(this.autocomplete?this.formElement.setAttribute("autocomplete",this.autocomplete):this.formElement.removeAttribute("autocomplete")),i.has("autocorrect")&&(this.autocorrect?this.formElement.setAttribute("autocorrect",this.autocorrect):this.formElement.removeAttribute("autocorrect")),i.has("inputSpellcheck")&&(this.inputSpellcheck?this.formElement.setAttribute("spellcheck",this.inputSpellcheck):this.formElement.removeAttribute("spellcheck"))}},{kind:"method",key:"renderIcon",value:function(i,e=!1){const t=e?"trailing":"leading";return n.dy` <span class="mdc-text-field__icon mdc-text-field__icon--${t}" tabindex="${e?1:-1}"> <slot name="${t}Icon"></slot> </span> `}},{kind:"field",static:!0,key:"styles",value:()=>[f.W,n.iv`.mdc-text-field__input{width:var(--ha-textfield-input-width,100%)}.mdc-text-field:not(.mdc-text-field--with-leading-icon){padding:var(--text-field-padding,0px 16px)}.mdc-text-field__affix--suffix{padding-left:var(--text-field-suffix-padding-left,12px);padding-right:var(--text-field-suffix-padding-right,0px);padding-inline-start:var(--text-field-suffix-padding-left,12px);padding-inline-end:var(--text-field-suffix-padding-right,0px);direction:ltr}.mdc-text-field--with-leading-icon{padding-inline-start:var(--text-field-suffix-padding-left,0px);padding-inline-end:var(--text-field-suffix-padding-right,16px);direction:var(--direction)}.mdc-text-field--with-leading-icon.mdc-text-field--with-trailing-icon{padding-left:var(--text-field-suffix-padding-left,0px);padding-right:var(--text-field-suffix-padding-right,0px);padding-inline-start:var(--text-field-suffix-padding-left,0px);padding-inline-end:var(--text-field-suffix-padding-right,0px)}.mdc-text-field:not(.mdc-text-field--disabled) .mdc-text-field__affix--suffix{color:var(--secondary-text-color)}.mdc-text-field:not(.mdc-text-field--disabled) .mdc-text-field__icon{color:var(--secondary-text-color)}.mdc-text-field__icon--leading{margin-inline-start:16px;margin-inline-end:8px;direction:var(--direction)}.mdc-text-field__icon--trailing{padding:var(--textfield-icon-trailing-padding,12px)}.mdc-floating-label:not(.mdc-floating-label--float-above){text-overflow:ellipsis;width:inherit;padding-right:30px;padding-inline-end:30px;padding-inline-start:initial;box-sizing:border-box;direction:var(--direction)}input{text-align:var(--text-field-text-align,start)}::-ms-reveal{display:none}:host([no-spinner]) input::-webkit-inner-spin-button,:host([no-spinner]) input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}:host([no-spinner]) input[type=number]{-moz-appearance:textfield}.mdc-text-field__ripple{overflow:hidden}.mdc-text-field{overflow:var(--text-field-overflow)}.mdc-floating-label{inset-inline-start:16px!important;inset-inline-end:initial!important;transform-origin:var(--float-start);direction:var(--direction);text-align:var(--float-start)}.mdc-text-field--with-leading-icon.mdc-text-field--filled .mdc-floating-label{max-width:calc(100% - 48px - var(--text-field-suffix-padding-left,0px));inset-inline-start:calc(48px + var(--text-field-suffix-padding-left,0px))!important;inset-inline-end:initial!important;direction:var(--direction)}.mdc-text-field__input[type=number]{direction:var(--direction)}.mdc-text-field__affix--prefix{padding-right:var(--text-field-prefix-padding-right,2px);padding-inline-end:var(--text-field-prefix-padding-right,2px);padding-inline-start:initial}.mdc-text-field:not(.mdc-text-field--disabled) .mdc-text-field__affix--prefix{color:var(--mdc-text-field-label-ink-color)}#helper-text ha-markdown{display:inline-block}`,"rtl"===u.E.document.dir?n.iv`.mdc-floating-label,.mdc-text-field--with-leading-icon,.mdc-text-field--with-leading-icon.mdc-text-field--filled .mdc-floating-label,.mdc-text-field__icon--leading,.mdc-text-field__input[type=number]{direction:rtl;--direction:rtl}`:n.iv``]}]}}),m.P);(0,a.Z)([(0,o.Mo)("dialog-box")],(function(i,e){return{F:class extends e{constructor(...e){super(...e),i(this)}},d:[{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,o.SB)()],key:"_params",value:void 0},{kind:"field",decorators:[(0,o.SB)()],key:"_closeState",value:void 0},{kind:"field",decorators:[(0,o.IO)("ha-textfield")],key:"_textField",value:void 0},{kind:"field",decorators:[(0,o.IO)("ha-md-dialog")],key:"_dialog",value:void 0},{kind:"method",key:"showDialog",value:async function(i){this._params=i}},{kind:"method",key:"closeDialog",value:function(){return!this._params?.confirmation&&!this._params?.prompt&&(!this._params||(this._dismiss(),!0))}},{kind:"method",key:"render",value:function(){if(!this._params)return n.Ld;const i=this._params.confirmation||this._params.prompt,e=this._params.title||this._params.confirmation&&this.hass.localize("ui.dialogs.generic.default_confirmation_title");return n.dy` <ha-md-dialog open .disableCancelAction="${i||!1}" @closed="${this._dialogClosed}" type="alert" aria-labelledby="dialog-box-title" aria-describedby="dialog-box-description"> <div slot="headline"> <span .title="${e}" id="dialog-box-title"> ${this._params.warning?n.dy`<ha-svg-icon .path="${"M12,2L1,21H23M12,6L19.53,19H4.47M11,10V14H13V10M11,16V18H13V16"}" style="color:var(--warning-color)"></ha-svg-icon> `:n.Ld} ${e} </span> </div> <div slot="content" id="dialog-box-description"> ${this._params.text?n.dy` <p>${this._params.text}</p> `:""} ${this._params.prompt?n.dy` <ha-textfield dialogInitialFocus value="${(0,l.o)(this._params.defaultValue)}" .placeholder="${this._params.placeholder}" .label="${this._params.inputLabel?this._params.inputLabel:""}" .type="${this._params.inputType?this._params.inputType:"text"}" .min="${this._params.inputMin}" .max="${this._params.inputMax}"></ha-textfield> `:""} </div> <div slot="actions"> ${i&&n.dy` <ha-button @click="${this._dismiss}" ?dialogInitialFocus="${!this._params.prompt&&this._params.destructive}"> ${this._params.dismissText?this._params.dismissText:this.hass.localize("ui.dialogs.generic.cancel")} </ha-button> `} <ha-button @click="${this._confirm}" ?dialogInitialFocus="${!this._params.prompt&&!this._params.destructive}" class="${(0,d.$)({destructive:this._params.destructive||!1})}"> ${this._params.confirmText?this._params.confirmText:this.hass.localize("ui.dialogs.generic.ok")} </ha-button> </div> </ha-md-dialog> `}},{kind:"method",key:"_cancel",value:function(){this._params?.cancel&&this._params.cancel()}},{kind:"method",key:"_dismiss",value:function(){this._closeState="canceled",this._closeDialog(),this._cancel()}},{kind:"method",key:"_confirm",value:function(){this._closeState="confirmed",this._closeDialog(),this._params.confirm&&this._params.confirm(this._textField?.value)}},{kind:"method",key:"_closeDialog",value:function(){(0,r.B)(this,"dialog-closed",{dialog:this.localName}),this._dialog?.close()}},{kind:"method",key:"_dialogClosed",value:function(){this._closeState||((0,r.B)(this,"dialog-closed",{dialog:this.localName}),this._cancel()),this._closeState=void 0,this._params=void 0}},{kind:"get",static:!0,key:"styles",value:function(){return n.iv`:host([inert]){pointer-events:initial!important;cursor:initial!important}a{color:var(--primary-color)}p{margin:0;color:var(--primary-text-color)}.no-bottom-padding{padding-bottom:0}.secondary{color:var(--secondary-text-color)}.destructive{--mdc-theme-primary:var(--error-color)}ha-textfield{width:100%}`}}]}}),n.oi)}};
//# sourceMappingURL=238.38ded68ed3eb236e.js.map