UNPKG

iobroker.lovelace

Version:

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

10 lines 54.2 kB
export const __webpack_ids__=["7698"];export const __webpack_modules__={19631:function(e,t,i){i.d(t,{Bt:()=>o,T8:()=>r});var a=i(88977),s=i(20382);const n=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],o=e=>e.first_weekday===s.FS.language?"weekInfo"in Intl.Locale.prototype?new Intl.Locale(e.language).weekInfo.firstDay%7:(0,a.L)(e.language)%7:n.includes(e.first_weekday)?n.indexOf(e.first_weekday):1,r=e=>{const t=o(e);return n[t]}},94947:function(e,t,i){i.a(e,(async function(e,a){try{i.d(t,{G:()=>d});var s=i(16485),n=i(27486),o=i(27046),r=e([s,o]);[s,o]=r.then?(await r)():r;const l=(0,n.Z)((e=>new Intl.RelativeTimeFormat(e.language,{numeric:"auto"}))),d=(e,t,i,a=!0)=>{const s=(0,o.W)(e,i,t);return a?l(t).format(s.value,s.unit):Intl.NumberFormat(t.language,{style:"unit",unit:s.unit,unitDisplay:"long"}).format(Math.abs(s.value))};a()}catch(e){a(e)}}))},27046:function(e,t,i){i.a(e,(async function(e,a){try{i.d(t,{W:()=>h});var s=i(13809),n=i(29558),o=i(94763),r=i(19631);const l=1e3,d=60,c=60*d;function h(e,t=Date.now(),i,a={}){const h={...u,...a||{}},p=(+e-+t)/l;if(Math.abs(p)<h.second)return{value:Math.round(p),unit:"second"};const f=p/d;if(Math.abs(f)<h.minute)return{value:Math.round(f),unit:"minute"};const m=p/c;if(Math.abs(m)<h.hour)return{value:Math.round(m),unit:"hour"};const v=new Date(e),k=new Date(t);v.setHours(0,0,0,0),k.setHours(0,0,0,0);const g=(0,s.j)(v,k);if(0===g)return{value:Math.round(m),unit:"hour"};if(Math.abs(g)<h.day)return{value:g,unit:"day"};const y=(0,r.Bt)(i),_=(0,n.z)(v,{weekStartsOn:y}),x=(0,n.z)(k,{weekStartsOn:y}),b=(0,o.p)(_,x);if(0===b)return{value:g,unit:"day"};if(Math.abs(b)<h.week)return{value:b,unit:"week"};const w=v.getFullYear()-k.getFullYear(),C=12*w+v.getMonth()-k.getMonth();return 0===C?{value:b,unit:"week"}:Math.abs(C)<h.month||0===w?{value:C,unit:"month"}:{value:Math.round(w),unit:"year"}}const u={second:45,minute:45,hour:22,day:5,week:4,month:11};a()}catch(p){a(p)}}))},99426:function(e,t,i){i.r(t);var a=i(44249),s=i(57243),n=i(15093),o=i(35359),r=i(36522);i(23334),i(37583);const l={info:"M11,9H13V7H11M12,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,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M11,17H13V11H11V17Z",warning:"M12,2L1,21H23M12,6L19.53,19H4.47M11,10V14H13V10M11,16V18H13V16",error:"M11,15H13V17H11V15M11,7H13V13H11V7M12,2C6.47,2 2,6.5 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4A8,8 0 0,1 20,12A8,8 0 0,1 12,20Z",success:"M20,12A8,8 0 0,1 12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4C12.76,4 13.5,4.11 14.2,4.31L15.77,2.74C14.61,2.26 13.34,2 12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12M7.91,10.08L6.5,11.5L11,16L21,6L19.59,4.58L11,13.17L7.91,10.08Z"};(0,a.Z)([(0,n.Mo)("ha-alert")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,n.Cb)()],key:"title",value:()=>""},{kind:"field",decorators:[(0,n.Cb)({attribute:"alert-type"})],key:"alertType",value:()=>"info"},{kind:"field",decorators:[(0,n.Cb)({type:Boolean})],key:"dismissable",value:()=>!1},{kind:"field",decorators:[(0,n.Cb)({type:Boolean})],key:"narrow",value:()=>!1},{kind:"method",key:"render",value:function(){return s.dy` <div class="issue-type ${(0,o.$)({[this.alertType]:!0})}" role="alert"> <div class="icon ${this.title?"":"no-title"}"> <slot name="icon"> <ha-svg-icon .path="${l[this.alertType]}"></ha-svg-icon> </slot> </div> <div class="${(0,o.$)({content:!0,narrow:this.narrow})}"> <div class="main-content"> ${this.title?s.dy`<div class="title">${this.title}</div>`:s.Ld} <slot></slot> </div> <div class="action"> <slot name="action"> ${this.dismissable?s.dy`<ha-icon-button @click="${this._dismissClicked}" label="Dismiss alert" .path="${"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"}"></ha-icon-button>`:s.Ld} </slot> </div> </div> </div> `}},{kind:"method",key:"_dismissClicked",value:function(){(0,r.B)(this,"alert-dismissed-clicked")}},{kind:"field",static:!0,key:"styles",value:()=>s.iv`.issue-type{position:relative;padding:8px;display:flex}.issue-type::after{position:absolute;top:0;right:0;bottom:0;left:0;opacity:.12;pointer-events:none;content:"";border-radius:4px}.icon{z-index:1}.icon.no-title{align-self:center}.content{display:flex;justify-content:space-between;align-items:center;width:100%;text-align:var(--float-start)}.content.narrow{flex-direction:column;align-items:flex-end}.action{z-index:1;width:min-content;--mdc-theme-primary:var(--primary-text-color)}.main-content{overflow-wrap:anywhere;word-break:break-word;margin-left:8px;margin-right:0;margin-inline-start:8px;margin-inline-end:0}.title{margin-top:2px;font-weight:700}.action ha-icon-button,.action mwc-button{--mdc-theme-primary:var(--primary-text-color);--mdc-icon-button-size:36px}.issue-type.info>.icon{color:var(--info-color)}.issue-type.info::after{background-color:var(--info-color)}.issue-type.warning>.icon{color:var(--warning-color)}.issue-type.warning::after{background-color:var(--warning-color)}.issue-type.error>.icon{color:var(--error-color)}.issue-type.error::after{background-color:var(--error-color)}.issue-type.success>.icon{color:var(--success-color)}.issue-type.success::after{background-color:var(--success-color)}:host ::slotted(ul){margin:0;padding-inline-start:20px}`}]}}),s.oi)},34273:function(e,t,i){var a=i(44249),s=i(72621),n=(i(9359),i(31526),i(22997),i(57243)),o=i(15093),r=i(5111),l=i(76525);(0,a.Z)([(0,o.Mo)("ha-button-menu")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",key:l.gA,value:void 0},{kind:"field",decorators:[(0,o.Cb)()],key:"corner",value:()=>"BOTTOM_START"},{kind:"field",decorators:[(0,o.Cb)({attribute:"menu-corner"})],key:"menuCorner",value:()=>"START"},{kind:"field",decorators:[(0,o.Cb)({type:Number})],key:"x",value:()=>null},{kind:"field",decorators:[(0,o.Cb)({type:Number})],key:"y",value:()=>null},{kind:"field",decorators:[(0,o.Cb)({type:Boolean})],key:"multi",value:()=>!1},{kind:"field",decorators:[(0,o.Cb)({type:Boolean})],key:"activatable",value:()=>!1},{kind:"field",decorators:[(0,o.Cb)({type:Boolean})],key:"disabled",value:()=>!1},{kind:"field",decorators:[(0,o.Cb)({type:Boolean})],key:"fixed",value:()=>!1},{kind:"field",decorators:[(0,o.Cb)({type:Boolean,attribute:"no-anchor"})],key:"noAnchor",value:()=>!1},{kind:"field",decorators:[(0,o.IO)("mwc-menu",!0)],key:"_menu",value:void 0},{kind:"get",key:"items",value:function(){return this._menu?.items}},{kind:"get",key:"selected",value:function(){return this._menu?.selected}},{kind:"method",key:"focus",value:function(){this._menu?.open?this._menu.focusItemAtIndex(0):this._triggerButton?.focus()}},{kind:"method",key:"render",value:function(){return n.dy` <div @click="${this._handleClick}"> <slot name="trigger" @slotchange="${this._setTriggerAria}"></slot> </div> <mwc-menu .corner="${this.corner}" .menuCorner="${this.menuCorner}" .fixed="${this.fixed}" .multi="${this.multi}" .activatable="${this.activatable}" .y="${this.y}" .x="${this.x}"> <slot></slot> </mwc-menu> `}},{kind:"method",key:"firstUpdated",value:function(e){(0,s.Z)(i,"firstUpdated",this,3)([e]),"rtl"===r.E.document.dir&&this.updateComplete.then((()=>{this.querySelectorAll("mwc-list-item").forEach((e=>{const t=document.createElement("style");t.innerHTML="span.material-icons:first-of-type { margin-left: var(--mdc-list-item-graphic-margin, 32px) !important; margin-right: 0px !important;}",e.shadowRoot.appendChild(t)}))}))}},{kind:"method",key:"_handleClick",value:function(){this.disabled||(this._menu.anchor=this.noAnchor?null:this,this._menu.show())}},{kind:"get",key:"_triggerButton",value:function(){return this.querySelector('ha-icon-button[slot="trigger"], mwc-button[slot="trigger"]')}},{kind:"method",key:"_setTriggerAria",value:function(){this._triggerButton&&(this._triggerButton.ariaHasPopup="menu")}},{kind:"field",static:!0,key:"styles",value:()=>n.iv`:host{display:inline-block;position:relative}::slotted([disabled]){color:var(--disabled-text-color)}`}]}}),n.oi)},54977:function(e,t,i){var a=i(44249),s=i(57243),n=i(15093);(0,a.Z)([(0,n.Mo)("ha-card")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,n.Cb)()],key:"header",value:void 0},{kind:"field",decorators:[(0,n.Cb)({type:Boolean,reflect:!0})],key:"raised",value:()=>!1},{kind:"field",static:!0,key:"styles",value:()=>s.iv`:host{background:var(--ha-card-background,var(--card-background-color,#fff));-webkit-backdrop-filter:var(--ha-card-backdrop-filter,none);backdrop-filter:var(--ha-card-backdrop-filter,none);box-shadow:var(--ha-card-box-shadow,none);box-sizing:border-box;border-radius:var(--ha-card-border-radius,12px);border-width:var(--ha-card-border-width,1px);border-style:solid;border-color:var(--ha-card-border-color,var(--divider-color,#e0e0e0));color:var(--primary-text-color);display:block;transition:all .3s ease-out;position:relative}:host([raised]){border:none;box-shadow:var(--ha-card-box-shadow,0px 2px 1px -1px rgba(0,0,0,.2),0px 1px 1px 0px rgba(0,0,0,.14),0px 1px 3px 0px rgba(0,0,0,.12))}.card-header,:host ::slotted(.card-header){color:var(--ha-card-header-color,var(--primary-text-color));font-family:var(--ha-card-header-font-family, inherit);font-size:var(--ha-card-header-font-size, 24px);letter-spacing:-.012em;line-height:48px;padding:12px 16px 16px;display:block;margin-block-start:0px;margin-block-end:0px;font-weight:400}:host ::slotted(.card-content:not(:first-child)),slot:not(:first-child)::slotted(.card-content){padding-top:0px;margin-top:-8px}:host ::slotted(.card-content){padding:16px}:host ::slotted(.card-actions){border-top:1px solid var(--divider-color,#e8e8e8);padding:5px 16px}`},{kind:"method",key:"render",value:function(){return s.dy` ${this.header?s.dy`<h1 class="card-header">${this.header}</h1>`:s.Ld} <slot></slot> `}}]}}),s.oi)},2914:function(e,t,i){var a=i(44249),s=i(57243),n=i(15093);(0,a.Z)([(0,n.Mo)("ha-label")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,n.Cb)({type:Boolean,reflect:!0})],key:"dense",value:()=>!1},{kind:"method",key:"render",value:function(){return s.dy` <span class="content"> <slot name="icon"></slot> <slot></slot> </span> `}},{kind:"get",static:!0,key:"styles",value:function(){return[s.iv`:host{--ha-label-text-color:var(--primary-text-color);--ha-label-icon-color:var(--primary-text-color);--ha-label-background-color:rgba( var(--rgb-primary-text-color), 0.15 );--ha-label-background-opacity:1;border:1px solid var(--outline-color);position:relative;box-sizing:border-box;display:inline-flex;flex-direction:row;align-items:center;font-size:12px;font-weight:500;line-height:16px;letter-spacing:.1px;vertical-align:middle;height:32px;padding:0 16px;border-radius:18px;color:var(--ha-label-text-color);--mdc-icon-size:12px;text-wrap:nowrap}.content>*{position:relative;display:inline-flex;flex-direction:row;align-items:center}:host:before{position:absolute;content:"";inset:0;border-radius:inherit;background-color:var(--ha-label-background-color);opacity:var(--ha-label-background-opacity)}::slotted([slot=icon]){margin-right:8px;margin-left:-8px;margin-inline-start:-8px;margin-inline-end:8px;display:flex}span{display:inline-flex}:host([dense]){height:20px;padding:0 12px;border-radius:10px}:host([dense]) ::slotted([slot=icon]){margin-right:4px;margin-left:-4px;margin-inline-start:-4px;margin-inline-end:4px}`]}}]}}),s.oi)},7285:function(e,t,i){i.d(t,{M:()=>d});var a=i(44249),s=i(72621),n=i(65703),o=i(46289),r=i(57243),l=i(15093);let d=(0,a.Z)([(0,l.Mo)("ha-list-item")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"method",key:"renderRipple",value:function(){return this.noninteractive?"":(0,s.Z)(i,"renderRipple",this,3)([])}},{kind:"get",static:!0,key:"styles",value:function(){return[o.W,r.iv`: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.iv`span.material-icons:first-of-type,span.material-icons:last-of-type{direction:rtl!important;--direction:rtl}`:r.iv``]}}]}}),n.K)},34326:function(e,t,i){var a=i(44249),s=i(57243),n=i(15093);i(23334),i(83166);(0,a.Z)([(0,n.Mo)("ha-password-field")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,n.Cb)({type:Boolean})],key:"invalid",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:"error-message"})],key:"errorMessage",value:void 0},{kind:"field",decorators:[(0,n.Cb)({type:Boolean})],key:"icon",value:()=>!1},{kind:"field",decorators:[(0,n.Cb)({type:Boolean})],key:"iconTrailing",value:()=>!1},{kind:"field",decorators:[(0,n.Cb)()],key:"autocomplete",value:void 0},{kind:"field",decorators:[(0,n.Cb)()],key:"autocorrect",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:"input-spellcheck"})],key:"inputSpellcheck",value:void 0},{kind:"field",decorators:[(0,n.Cb)({type:String})],key:"value",value:()=>""},{kind:"field",decorators:[(0,n.Cb)({type:String})],key:"placeholder",value:()=>""},{kind:"field",decorators:[(0,n.Cb)({type:String})],key:"label",value:()=>""},{kind:"field",decorators:[(0,n.Cb)({type:Boolean,reflect:!0})],key:"disabled",value:()=>!1},{kind:"field",decorators:[(0,n.Cb)({type:Boolean})],key:"required",value:()=>!1},{kind:"field",decorators:[(0,n.Cb)({type:Number})],key:"minLength",value:()=>-1},{kind:"field",decorators:[(0,n.Cb)({type:Number})],key:"maxLength",value:()=>-1},{kind:"field",decorators:[(0,n.Cb)({type:Boolean,reflect:!0})],key:"outlined",value:()=>!1},{kind:"field",decorators:[(0,n.Cb)({type:String})],key:"helper",value:()=>""},{kind:"field",decorators:[(0,n.Cb)({type:Boolean})],key:"validateOnInitialRender",value:()=>!1},{kind:"field",decorators:[(0,n.Cb)({type:String})],key:"validationMessage",value:()=>""},{kind:"field",decorators:[(0,n.Cb)({type:Boolean})],key:"autoValidate",value:()=>!1},{kind:"field",decorators:[(0,n.Cb)({type:String})],key:"pattern",value:()=>""},{kind:"field",decorators:[(0,n.Cb)({type:Number})],key:"size",value:()=>null},{kind:"field",decorators:[(0,n.Cb)({type:Boolean})],key:"helperPersistent",value:()=>!1},{kind:"field",decorators:[(0,n.Cb)({type:Boolean})],key:"charCounter",value:()=>!1},{kind:"field",decorators:[(0,n.Cb)({type:Boolean})],key:"endAligned",value:()=>!1},{kind:"field",decorators:[(0,n.Cb)({type:String})],key:"prefix",value:()=>""},{kind:"field",decorators:[(0,n.Cb)({type:String})],key:"suffix",value:()=>""},{kind:"field",decorators:[(0,n.Cb)({type:String})],key:"name",value:()=>""},{kind:"field",decorators:[(0,n.Cb)({type:String,attribute:"input-mode"})],key:"inputMode",value:void 0},{kind:"field",decorators:[(0,n.Cb)({type:Boolean})],key:"readOnly",value:()=>!1},{kind:"field",decorators:[(0,n.Cb)({attribute:!1,type:String})],key:"autocapitalize",value:()=>""},{kind:"field",decorators:[(0,n.SB)()],key:"_unmaskedPassword",value:()=>!1},{kind:"field",decorators:[(0,n.IO)("ha-textfield")],key:"_textField",value:void 0},{kind:"method",key:"render",value:function(){return s.dy`<ha-textfield .invalid="${this.invalid}" .errorMessage="${this.errorMessage}" .icon="${this.icon}" .iconTrailing="${this.iconTrailing}" .autocomplete="${this.autocomplete}" .autocorrect="${this.autocorrect}" .inputSpellcheck="${this.inputSpellcheck}" .value="${this.value}" .placeholder="${this.placeholder}" .label="${this.label}" .disabled="${this.disabled}" .required="${this.required}" .minLength="${this.minLength}" .maxLength="${this.maxLength}" .outlined="${this.outlined}" .helper="${this.helper}" .validateOnInitialRender="${this.validateOnInitialRender}" .validationMessage="${this.validationMessage}" .autoValidate="${this.autoValidate}" .pattern="${this.pattern}" .size="${this.size}" .helperPersistent="${this.helperPersistent}" .charCounter="${this.charCounter}" .endAligned="${this.endAligned}" .prefix="${this.prefix}" .name="${this.name}" .inputMode="${this.inputMode}" .readOnly="${this.readOnly}" .autocapitalize="${this.autocapitalize}" .type="${this._unmaskedPassword?"text":"password"}" .suffix="${s.dy`<div style="width:24px"></div>`}" @input="${this._handleInputEvent}" @change="${this._handleChangeEvent}"></ha-textfield> <ha-icon-button .label="${this.hass?.localize(this._unmaskedPassword?"ui.components.selectors.text.hide_password":"ui.components.selectors.text.show_password")||(this._unmaskedPassword?"Hide password":"Show password")}" @click="${this._toggleUnmaskedPassword}" .path="${this._unmaskedPassword?"M11.83,9L15,12.16C15,12.11 15,12.05 15,12A3,3 0 0,0 12,9C11.94,9 11.89,9 11.83,9M7.53,9.8L9.08,11.35C9.03,11.56 9,11.77 9,12A3,3 0 0,0 12,15C12.22,15 12.44,14.97 12.65,14.92L14.2,16.47C13.53,16.8 12.79,17 12,17A5,5 0 0,1 7,12C7,11.21 7.2,10.47 7.53,9.8M2,4.27L4.28,6.55L4.73,7C3.08,8.3 1.78,10 1,12C2.73,16.39 7,19.5 12,19.5C13.55,19.5 15.03,19.2 16.38,18.66L16.81,19.08L19.73,22L21,20.73L3.27,3M12,7A5,5 0 0,1 17,12C17,12.64 16.87,13.26 16.64,13.82L19.57,16.75C21.07,15.5 22.27,13.86 23,12C21.27,7.61 17,4.5 12,4.5C10.6,4.5 9.26,4.75 8,5.2L10.17,7.35C10.74,7.13 11.35,7 12,7Z":"M12,9A3,3 0 0,0 9,12A3,3 0 0,0 12,15A3,3 0 0,0 15,12A3,3 0 0,0 12,9M12,17A5,5 0 0,1 7,12A5,5 0 0,1 12,7A5,5 0 0,1 17,12A5,5 0 0,1 12,17M12,4.5C7,4.5 2.73,7.61 1,12C2.73,16.39 7,19.5 12,19.5C17,19.5 21.27,16.39 23,12C21.27,7.61 17,4.5 12,4.5Z"}"></ha-icon-button>`}},{kind:"method",key:"focus",value:function(){this._textField.focus()}},{kind:"method",key:"checkValidity",value:function(){return this._textField.checkValidity()}},{kind:"method",key:"reportValidity",value:function(){return this._textField.reportValidity()}},{kind:"method",key:"setCustomValidity",value:function(e){return this._textField.setCustomValidity(e)}},{kind:"method",key:"layout",value:function(){return this._textField.layout()}},{kind:"method",key:"_toggleUnmaskedPassword",value:function(){this._unmaskedPassword=!this._unmaskedPassword}},{kind:"method",decorators:[(0,n.hO)({passive:!0})],key:"_handleInputEvent",value:function(e){this.value=e.target.value}},{kind:"method",decorators:[(0,n.hO)({passive:!0})],key:"_handleChangeEvent",value:function(e){this.value=e.target.value,this._reDispatchEvent(e)}},{kind:"method",key:"_reDispatchEvent",value:function(e){const t=new Event(e.type,e);this.dispatchEvent(t)}},{kind:"field",static:!0,key:"styles",value:()=>s.iv`:host{display:block;position:relative}ha-textfield{width:100%}ha-icon-button{position:absolute;top:8px;right:8px;inset-inline-start:initial;inset-inline-end:8px;--mdc-icon-button-size:40px;--mdc-icon-size:20px;color:var(--secondary-text-color);direction:var(--direction)}`}]}}),s.oi)},30509:function(e,t,i){var a=i(44249),s=i(57243),n=i(15093);(0,a.Z)([(0,n.Mo)("ha-settings-row")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,n.Cb)({type:Boolean,reflect:!0})],key:"narrow",value:()=>!1},{kind:"field",decorators:[(0,n.Cb)({type:Boolean,reflect:!0})],key:"slim",value:()=>!1},{kind:"field",decorators:[(0,n.Cb)({type:Boolean,attribute:"three-line"})],key:"threeLine",value:()=>!1},{kind:"field",decorators:[(0,n.Cb)({type:Boolean,attribute:"wrap-heading",reflect:!0})],key:"wrapHeading",value:()=>!1},{kind:"method",key:"render",value:function(){return s.dy` <div class="prefix-wrap"> <slot name="prefix"></slot> <div class="body" ?two-line="${!this.threeLine}" ?three-line="${this.threeLine}"> <slot name="heading"></slot> <div class="secondary"><slot name="description"></slot></div> </div> </div> <div class="content"><slot></slot></div> `}},{kind:"field",static:!0,key:"styles",value:()=>s.iv`:host{display:flex;padding:0 16px;align-content:normal;align-self:auto;align-items:center}.body{padding-top:8px;padding-bottom:8px;padding-left:0;padding-inline-start:0;padding-right:16px;padding-inline-end:16px;overflow:hidden;display:var(--layout-vertical_-_display,flex);flex-direction:var(--layout-vertical_-_flex-direction,column);justify-content:var(--layout-center-justified_-_justify-content,center);flex:var(--layout-flex_-_flex,1);flex-basis:var(--layout-flex_-_flex-basis,0.000000001px)}.body[three-line]{min-height:var(--paper-item-body-three-line-min-height,88px)}:host(:not([wrap-heading])) body>*{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.body>.secondary{display:block;padding-top:4px;font-family:var( --mdc-typography-body2-font-family, var(--mdc-typography-font-family, Roboto, sans-serif) );-webkit-font-smoothing:antialiased;font-size:var(--mdc-typography-body2-font-size, .875rem);font-weight:var(--mdc-typography-body2-font-weight,400);line-height:normal;color:var(--secondary-text-color)}.body[two-line]{min-height:calc(var(--paper-item-body-two-line-min-height,72px) - 16px);flex:1}.content{display:contents}:host(:not([narrow])) .content{display:var(--settings-row-content-display,flex);justify-content:flex-end;flex:1;padding:16px 0}.content ::slotted(*){width:var(--settings-row-content-width)}:host([narrow]){align-items:normal;flex-direction:column;border-top:1px solid var(--divider-color);padding-bottom:8px}::slotted(ha-switch){padding:16px 0}.secondary{white-space:normal}.prefix-wrap{display:var(--settings-row-prefix-display)}:host([narrow]) .prefix-wrap{display:flex;align-items:center}:host([slim]),:host([slim]) .content,:host([slim]) ::slotted(ha-switch){padding:0}:host([slim]) .body{min-height:0}`}]}}),s.oi)},17170:function(e,t,i){i.a(e,(async function(e,a){try{i.r(t),i.d(t,{HaSpinner:()=>h});var s=i(44249),n=i(72621),o=i(97677),r=i(43580),l=i(57243),d=i(15093),c=e([o]);o=(c.then?(await c)():c)[0];let h=(0,s.Z)([(0,d.Mo)("ha-spinner")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,d.Cb)()],key:"size",value:void 0},{kind:"method",key:"updated",value:function(e){if((0,n.Z)(i,"updated",this,3)([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")}}},{kind:"field",static:!0,key:"styles",value:()=>[r.Z,l.iv`: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)}`]}]}}),o.Z);a()}catch(e){a(e)}}))},83166:function(e,t,i){var a=i(44249),s=i(72621),n=i(1105),o=i(33990),r=i(57243),l=i(15093),d=i(5111);(0,a.Z)([(0,l.Mo)("ha-textfield")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,l.Cb)({type:Boolean})],key:"invalid",value:void 0},{kind:"field",decorators:[(0,l.Cb)({attribute:"error-message"})],key:"errorMessage",value:void 0},{kind:"field",decorators:[(0,l.Cb)({type:Boolean})],key:"icon",value:()=>!1},{kind:"field",decorators:[(0,l.Cb)({type:Boolean})],key:"iconTrailing",value:()=>!1},{kind:"field",decorators:[(0,l.Cb)()],key:"autocomplete",value:void 0},{kind:"field",decorators:[(0,l.Cb)()],key:"autocorrect",value:void 0},{kind:"field",decorators:[(0,l.Cb)({attribute:"input-spellcheck"})],key:"inputSpellcheck",value:void 0},{kind:"field",decorators:[(0,l.IO)("input")],key:"formElement",value:void 0},{kind:"method",key:"updated",value:function(e){(0,s.Z)(i,"updated",this,3)([e]),(e.has("invalid")||e.has("errorMessage"))&&(this.setCustomValidity(this.invalid?this.errorMessage||this.validationMessage||"Invalid":""),(this.invalid||this.validateOnInitialRender||e.has("invalid")&&void 0!==e.get("invalid"))&&this.reportValidity()),e.has("autocomplete")&&(this.autocomplete?this.formElement.setAttribute("autocomplete",this.autocomplete):this.formElement.removeAttribute("autocomplete")),e.has("autocorrect")&&(this.autocorrect?this.formElement.setAttribute("autocorrect",this.autocorrect):this.formElement.removeAttribute("autocorrect")),e.has("inputSpellcheck")&&(this.inputSpellcheck?this.formElement.setAttribute("spellcheck",this.inputSpellcheck):this.formElement.removeAttribute("spellcheck"))}},{kind:"method",key:"renderIcon",value:function(e,t=!1){const i=t?"trailing":"leading";return r.dy` <span class="mdc-text-field__icon mdc-text-field__icon--${i}" tabindex="${t?1:-1}"> <slot name="${i}Icon"></slot> </span> `}},{kind:"field",static:!0,key:"styles",value:()=>[o.W,r.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)}input[type=color]{height:20px}::-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}input[type=color]::-webkit-color-swatch-wrapper{padding: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"===d.E.document.dir?r.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}`:r.iv``]}]}}),n.P)},43546:function(e,t,i){i.d(t,{Cp:()=>o,TZ:()=>r,W2:()=>n,YY:()=>d,iI:()=>s,j2:()=>l,oT:()=>a});i(9359),i(70104);const a=e=>e.map((e=>{if("string"!==e.type)return e;switch(e.name){case"username":return{...e,autocomplete:"username",autofocus:!0};case"password":return{...e,autocomplete:"current-password"};case"code":return{...e,autocomplete:"one-time-code",autofocus:!0};default:return e}})),s=(e,t)=>e.callWS({type:"auth/sign_path",path:t}),n=async(e,t,i,a)=>e.callWS({type:"config/auth_provider/homeassistant/create",user_id:t,username:i,password:a}),o=(e,t,i)=>e.callWS({type:"config/auth_provider/homeassistant/change_password",current_password:t,new_password:i}),r=(e,t,i)=>e.callWS({type:"config/auth_provider/homeassistant/admin_change_password",user_id:t,password:i}),l=(e,t,i)=>e.callWS({type:"config/auth_provider/homeassistant/admin_change_username",user_id:t,username:i}),d=(e,t,i)=>e.callWS({type:"auth/delete_all_refresh_tokens",token_type:t,delete_current_token:i})},23651:function(e,t,i){i.a(e,(async function(e,t){try{var a=i(44249),s=i(72621),n=(i(31622),i(57243)),o=i(15093),r=(i(54977),i(17170)),l=(i(83166),i(34326),i(28008)),d=(i(99426),i(76131)),c=i(43546),h=e([r]);r=(h.then?(await h)():h)[0];(0,a.Z)([(0,o.Mo)("ha-change-password-card")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,o.SB)()],key:"_loading",value:()=>!1},{kind:"field",decorators:[(0,o.SB)()],key:"_statusMsg",value:void 0},{kind:"field",decorators:[(0,o.SB)()],key:"_errorMsg",value:void 0},{kind:"field",decorators:[(0,o.SB)()],key:"_currentPassword",value:()=>""},{kind:"field",decorators:[(0,o.SB)()],key:"_password",value:()=>""},{kind:"field",decorators:[(0,o.SB)()],key:"_passwordConfirm",value:()=>""},{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"refreshTokens",value:void 0},{kind:"method",key:"render",value:function(){return n.dy` <ha-card .header="${this.hass.localize("ui.panel.profile.change_password.header")}"> <div class="card-content"> ${this._errorMsg?n.dy`<ha-alert alert-type="error">${this._errorMsg}</ha-alert>`:""} ${this._statusMsg?n.dy`<ha-alert alert-type="success">${this._statusMsg}</ha-alert>`:""} <ha-password-field id="currentPassword" name="currentPassword" .label="${this.hass.localize("ui.panel.profile.change_password.current_password")}" autocomplete="current-password" .value="${this._currentPassword}" @input="${this._currentPasswordChanged}" @change="${this._currentPasswordChanged}" required></ha-password-field> ${this._currentPassword?n.dy`<ha-password-field .label="${this.hass.localize("ui.panel.profile.change_password.new_password")}" name="password" autocomplete="new-password" .value="${this._password}" @input="${this._newPasswordChanged}" @change="${this._newPasswordChanged}" required autoValidate></ha-password-field> <ha-password-field .label="${this.hass.localize("ui.panel.profile.change_password.confirm_new_password")}" name="passwordConfirm" autocomplete="new-password" .value="${this._passwordConfirm}" @input="${this._newPasswordConfirmChanged}" @change="${this._newPasswordConfirmChanged}" required autoValidate></ha-password-field>`:""} </div> <div class="card-actions"> ${this._loading?n.dy`<div> <ha-spinner></ha-spinner> </div>`:n.dy`<mwc-button @click="${this._changePassword}" .disabled="${!this._passwordConfirm}">${this.hass.localize("ui.panel.profile.change_password.submit")}</mwc-button>`} </div> </ha-card> `}},{kind:"method",key:"_currentPasswordChanged",value:function(e){this._currentPassword=e.target.value}},{kind:"method",key:"_newPasswordChanged",value:function(e){this._password=e.target.value}},{kind:"method",key:"_newPasswordConfirmChanged",value:function(e){this._passwordConfirm=e.target.value}},{kind:"method",key:"firstUpdated",value:function(e){(0,s.Z)(i,"firstUpdated",this,3)([e]),this.addEventListener("keypress",(e=>{this._statusMsg=void 0,"Enter"===e.key&&this._changePassword()}))}},{kind:"method",key:"_changePassword",value:async function(){if(this._statusMsg=void 0,this._currentPassword&&this._password&&this._passwordConfirm)if(this._password===this._passwordConfirm)if(this._currentPassword!==this._password){this._loading=!0,this._errorMsg=void 0;try{await(0,c.Cp)(this.hass,this._currentPassword,this._password)}catch(e){return void(this._errorMsg=e.message)}finally{this._loading=!1}if(this._statusMsg=this.hass.localize("ui.panel.profile.change_password.success"),this.refreshTokens&&await(0,d.showConfirmationDialog)(this,{title:this.hass.localize("ui.panel.profile.change_password.logout_all_sessions"),text:this.hass.localize("ui.panel.profile.change_password.logout_all_sessions_text"),dismissText:this.hass.localize("ui.common.no"),confirmText:this.hass.localize("ui.common.yes"),destructive:!0}))try{await(0,c.YY)(this.hass)}catch(e){await(0,d.showAlertDialog)(this,{title:this.hass.localize("ui.panel.profile.change_password.delete_failed"),text:e.message})}this._currentPassword="",this._password="",this._passwordConfirm=""}else this._errorMsg=this.hass.localize("ui.panel.profile.change_password.error_new_is_old");else this._errorMsg=this.hass.localize("ui.panel.profile.change_password.error_new_mismatch")}},{kind:"get",static:!0,key:"styles",value:function(){return[l.Qx,n.iv`ha-textfield{margin-top:8px;display:block}#currentPassword{margin-top:0}`]}}]}}),n.oi);t()}catch(e){t(e)}}))},88502:function(e,t,i){i.a(e,(async function(e,t){try{var a=i(44249),s=(i(9359),i(56475),i(70104),i(31622),i(57243)),n=i(15093),o=i(27486),r=i(94947),l=i(36522),d=(i(54977),i(30509),i(23334),i(76131)),c=i(28008),h=i(21034),u=e([r]);r=(u.then?(await u)():u)[0];const p="M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z";(0,a.Z)([(0,n.Mo)("ha-long-lived-access-tokens-card")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"refreshTokens",value:void 0},{kind:"field",key:"_accessTokens",value:()=>(0,o.Z)((e=>e?.filter((e=>"long_lived_access_token"===e.type)).reverse()))},{kind:"method",key:"render",value:function(){const e=this._accessTokens(this.refreshTokens);return s.dy` <ha-card .header="${this.hass.localize("ui.panel.profile.long_lived_access_tokens.header")}"> <div class="card-content"> ${this.hass.localize("ui.panel.profile.long_lived_access_tokens.description")} <a href="https://developers.home-assistant.io/docs/auth_api/#making-authenticated-requests" target="_blank" rel="noreferrer"> ${this.hass.localize("ui.panel.profile.long_lived_access_tokens.learn_auth_requests")} </a> ${e?.length?e.map((e=>s.dy`<ha-settings-row two-line> <span slot="heading">${e.client_name}</span> <div slot="description"> ${this.hass.localize("ui.panel.profile.long_lived_access_tokens.created",{date:(0,r.G)(new Date(e.created_at),this.hass.locale)})} </div> <ha-icon-button .token="${e}" .disabled="${e.is_current}" .label="${this.hass.localize("ui.common.delete")}" .path="${p}" @click="${this._deleteToken}"></ha-icon-button> </ha-settings-row>`)):s.dy`<p> ${this.hass.localize("ui.panel.profile.long_lived_access_tokens.empty_state")} </p>`} </div> <div class="card-actions"> <mwc-button @click="${this._createToken}"> ${this.hass.localize("ui.panel.profile.long_lived_access_tokens.create")} </mwc-button> </div> </ha-card> `}},{kind:"method",key:"_createToken",value:async function(){const e=await(0,d.showPromptDialog)(this,{text:this.hass.localize("ui.panel.profile.long_lived_access_tokens.prompt_name"),inputLabel:this.hass.localize("ui.panel.profile.long_lived_access_tokens.name")});if(e)try{const t=await this.hass.callWS({type:"auth/long_lived_access_token",lifespan:3650,client_name:e});(0,h.b)(this,{token:t,name:e}),(0,l.B)(this,"hass-refresh-tokens")}catch(e){(0,d.showAlertDialog)(this,{title:this.hass.localize("ui.panel.profile.long_lived_access_tokens.create_failed"),text:e.message})}}},{kind:"method",key:"_deleteToken",value:async function(e){const t=e.currentTarget.token;if(await(0,d.showConfirmationDialog)(this,{title:this.hass.localize("ui.panel.profile.long_lived_access_tokens.confirm_delete_title"),text:this.hass.localize("ui.panel.profile.long_lived_access_tokens.confirm_delete_text",{name:t.client_name}),confirmText:this.hass.localize("ui.common.delete"),destructive:!0}))try{await this.hass.callWS({type:"auth/delete_refresh_token",refresh_token_id:t.id}),(0,l.B)(this,"hass-refresh-tokens")}catch(e){await(0,d.showAlertDialog)(this,{title:this.hass.localize("ui.panel.profile.long_lived_access_tokens.delete_failed"),text:e.message})}}},{kind:"get",static:!0,key:"styles",value:function(){return[c.Qx,s.iv`ha-settings-row{padding:0}a{color:var(--primary-color)}mwc-button{--mdc-theme-primary:var(--primary-color)}ha-icon-button{color:var(--primary-text-color)}`]}}]}}),s.oi);t()}catch(e){t(e)}}))},67389:function(e,t,i){var a=i(44249),s=(i(9359),i(70104),i(31622),i(57243)),n=i(15093),o=i(36522),r=(i(54977),i(76131));const l=()=>Promise.all([i.e("97983"),i.e("83895"),i.e("2981"),i.e("7037"),i.e("63055"),i.e("24531")]).then(i.bind(i,33518));(0,a.Z)([(0,n.Mo)("ha-mfa-modules-card")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"mfaModules",value:void 0},{kind:"method",key:"render",value:function(){return s.dy` <ha-card .header="${this.hass.localize("ui.panel.profile.mfa.header")}"> ${this.mfaModules.map((e=>s.dy`<ha-settings-row two-line> <span slot="heading">${e.name}</span> <span slot="description">${e.id}</span> ${e.enabled?s.dy`<mwc-button .module="${e}" @click="${this._disable}">${this.hass.localize("ui.panel.profile.mfa.disable")}</mwc-button>`:s.dy`<mwc-button .module="${e}" @click="${this._enable}">${this.hass.localize("ui.panel.profile.mfa.enable")}</mwc-button>`} </ha-settings-row>`))} </ha-card> `}},{kind:"field",static:!0,key:"styles",value:()=>s.iv`mwc-button{margin-right:-.57em;margin-inline-end:-.57em;margin-inline-start:initial}ha-list-item{--mdc-list-item-meta-size:auto}`},{kind:"method",key:"_enable",value:function(e){var t,i;t=this,i={mfaModuleId:e.currentTarget.module.id,dialogClosedCallback:()=>this._refreshCurrentUser()},(0,o.B)(t,"show-dialog",{dialogTag:"ha-mfa-module-setup-flow",dialogImport:l,dialogParams:i})}},{kind:"method",key:"_disable",value:async function(e){const t=e.currentTarget.module;if(!await(0,r.showConfirmationDialog)(this,{text:this.hass.localize("ui.panel.profile.mfa.confirm_disable",{name:t.name})}))return;const i=t.id;this.hass.callWS({type:"auth/depose_mfa",mfa_module_id:i}).then((()=>{this._refreshCurrentUser()}))}},{kind:"method",key:"_refreshCurrentUser",value:function(){(0,o.B)(this,"hass-refresh-current-user")}}]}}),s.oi)},6393:function(e,t,i){i.a(e,(async function(e,a){try{i.r(t);var s=i(44249),n=i(72621),o=(i(9359),i(52924),i(57243)),r=i(15093),l=(i(97546),i(52230)),d=i(28008),c=i(23651),h=i(88502),u=(i(67389),i(45587)),p=e([c,h,u]);[c,h,u]=p.then?(await p)():p;(0,s.Z)([(0,r.Mo)("ha-profile-section-security")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,r.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,r.Cb)({type:Boolean})],key:"narrow",value:()=>!1},{kind:"field",decorators:[(0,r.SB)()],key:"_refreshTokens",value:void 0},{kind:"field",decorators:[(0,r.Cb)({attribute:!1})],key:"route",value:void 0},{kind:"method",key:"connectedCallback",value:function(){(0,n.Z)(i,"connectedCallback",this,3)([]),this._refreshRefreshTokens()}},{kind:"method",key:"firstUpdated",value:function(){this._refreshTokens||this._refreshRefreshTokens()}},{kind:"method",key:"render",value:function(){return o.dy` <hass-tabs-subpage main-page .hass="${this.hass}" .narrow="${this.narrow}" .tabs="${l.profileSections}" .route="${this.route}"> <div slot="title">${this.hass.localize("panel.profile")}</div> <div class="content"> ${this.hass.user.credentials.some((e=>"homeassistant"===e.auth_provider_type))?o.dy` <ha-change-password-card .refreshTokens="${this._refreshTokens}" @hass-refresh-tokens="${this._refreshRefreshTokens}" .hass="${this.hass}"></ha-change-password-card> `:""} <ha-mfa-modules-card .hass="${this.hass}" .mfaModules="${this.hass.user.mfa_modules}"></ha-mfa-modules-card> <ha-refresh-tokens-card .hass="${this.hass}" .refreshTokens="${this._refreshTokens}" @hass-refresh-tokens="${this._refreshRefreshTokens}"></ha-refresh-tokens-card> <ha-long-lived-access-tokens-card .hass="${this.hass}" .refreshTokens="${this._refreshTokens}" @hass-refresh-tokens="${this._refreshRefreshTokens}"></ha-long-lived-access-tokens-card> </div> </hass-tabs-subpage> `}},{kind:"method",key:"_refreshRefreshTokens",value:async function(){this.hass&&(this._refreshTokens=await this.hass.callWS({type:"auth/refresh_tokens"}))}},{kind:"get",static:!0,key:"styles",value:function(){return[d.Qx,o.iv`:host{-ms-user-select:initial;-webkit-user-select:initial;-moz-user-select:initial}.content{display:block;max-width:600px;margin:0 auto;padding-bottom:env(safe-area-inset-bottom)}.content>*{display:block;margin:24px 0}.promo-advanced{text-align:center;color:var(--secondary-text-color)}`]}}]}}),o.oi);a()}catch(e){a(e)}}))},45587:function(e,t,i){i.a(e,(async function(e,t){try{var a=i(44249),s=(i(9359),i(56475),i(70104),i(57243)),n=i(15093),o=i(27486),r=i(94947),l=i(36522),d=(i(34273),i(54977),i(23334),i(2914),i(30509),i(7285),i(43546)),c=i(76131),h=i(28008),u=e([r]);r=(u.then?(await u)():u)[0];const p="M16.61 15.15C16.15 15.15 15.77 14.78 15.77 14.32S16.15 13.5 16.61 13.5H16.61C17.07 13.5 17.45 13.86 17.45 14.32C17.45 14.78 17.07 15.15 16.61 15.15M7.41 15.15C6.95 15.15 6.57 14.78 6.57 14.32C6.57 13.86 6.95 13.5 7.41 13.5H7.41C7.87 13.5 8.24 13.86 8.24 14.32C8.24 14.78 7.87 15.15 7.41 15.15M16.91 10.14L18.58 7.26C18.67 7.09 18.61 6.88 18.45 6.79C18.28 6.69 18.07 6.75 18 6.92L16.29 9.83C14.95 9.22 13.5 8.9 12 8.91C10.47 8.91 9 9.24 7.73 9.82L6.04 6.91C5.95 6.74 5.74 6.68 5.57 6.78C5.4 6.87 5.35 7.08 5.44 7.25L7.1 10.13C4.25 11.69 2.29 14.58 2 18H22C21.72 14.59 19.77 11.7 16.91 10.14H16.91Z",f="M18.71,19.5C17.88,20.74 17,21.95 15.66,21.97C14.32,22 13.89,21.18 12.37,21.18C10.84,21.18 10.37,21.95 9.1,22C7.79,22.05 6.8,20.68 5.96,19.47C4.25,17 2.94,12.45 4.7,9.39C5.57,7.87 7.13,6.91 8.82,6.88C10.1,6.86 11.32,7.75 12.11,7.75C12.89,7.75 14.37,6.68 15.92,6.84C16.57,6.87 18.39,7.1 19.56,8.82C19.47,8.88 17.39,10.1 17.41,12.63C17.44,15.65 20.06,16.66 20.09,16.67C20.06,16.74 19.67,18.11 18.71,19.5M13,3.5C13.73,2.67 14.94,2.04 15.94,2C16.07,3.17 15.6,4.35 14.9,5.19C14.21,6.04 13.07,6.7 11.95,6.61C11.8,5.46 12.36,4.26 13,3.5Z",m="M23.5 17L18.5 22L15 18.5L16.5 17L18.5 19L22 15.5L23.5 17M13.1 19.9C12.7 20 12.4 20 12 20C7.6 20 4 16.4 4 12S7.6 4 12 4 20 7.6 20 12C20 12.4 20 12.7 19.9 13.1C20.6 13.2 21.2 13.4 21.8 13.7C21.9 13.1 22 12.6 22 12C22 6.5 17.5 2 12 2S2 6.5 2 12C2 17.5 6.5 22 12 22C12.6 22 13.2 21.9 13.7 21.8C13.4 21.3 13.2 20.6 13.1 19.9M15.6 14.1L12.5 12.3V7H11V13L14.5 15.1C14.8 14.7 15.2 14.4 15.6 14.1Z",v="M14.47 15.08L11 13V7H12.5V12.25L15.58 14.08C15.17 14.36 14.79 14.7 14.47 15.08M13.08 19.92C12.72 19.97 12.37 20 12 20C7.58 20 4 16.42 4 12S7.58 4 12 4 20 7.58 20 12C20 12.37 19.97 12.72 19.92 13.08C20.61 13.18 21.25 13.4 21.84 13.72C21.94 13.16 22 12.59 22 12C22 6.5 17.5 2 12 2S2 6.5 2 12C2 17.5 6.47 22 12 22C12.59 22 13.16 21.94 13.72 21.84C13.4 21.25 13.18 20.61 13.08 19.92M21.12 15.46L19 17.59L16.88 15.47L15.47 16.88L17.59 19L15.47 21.12L16.88 22.54L19 20.41L21.12 22.54L22.54 21.12L20.41 19L22.54 16.88L21.12 15.46Z",k="M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z",g="M12,16A2,2 0 0,1 14,18A2,2 0 0,1 12,20A2,2 0 0,1 10,18A2,2 0 0,1 12,16M12,10A2,2 0 0,1 14,12A2,2 0 0,1 12,14A2,2 0 0,1 10,12A2,2 0 0,1 12,10M12,4A2,2 0 0,1 14,6A2,2 0 0,1 12,8A2,2 0 0,1 10,6A2,2 0 0,1 12,4Z",y="M16.36,14C16.44,13.34 16.5,12.68 16.5,12C16.5,11.32 16.44,10.66 16.36,10H19.74C19.9,10.64 20,11.31 20,12C20,12.69 19.9,13.36 19.74,14M14.59,19.56C15.19,18.45 15.65,17.25 15.97,16H18.92C17.96,17.65 16.43,18.93 14.59,19.56M14.34,14H9.66C9.56,13.34 9.5,12.68 9.5,12C9.5,11.32 9.56,10.65 9.66,10H14.34C14.43,10.65 14.5,11.32 14.5,12C14.5,12.68 14.43,13.34 14.34,14M12,19.96C11.17,18.76 10.5,17.43 10.09,16H13.91C13.5,17.43 12.83,18.76 12,19.96M8,8H5.08C6.03,6.34 7.57,5.06 9.4,4.44C8.8,5.55 8.35,6.75 8,8M5.08,16H8C8.35,17.25 8.8,18.45 9.4,19.56C7.57,18.93 6.03,17.65 5.08,16M4.26,14C4.1,13.36 4,12.69 4,12C4,11.31 4.1,10.64 4.26,10H7.64C7.56,10.66 7.5,11.32 7.5,12C7.5,12.68 7.56,13.34 7.64,14M12,4.03C12.83,5.23 13.5,6.57 13.91,8H10.09C10.5,6.57 11.17,5.23 12,4.03M18.92,8H15.97C15.65,6.75 15.19,5.55 14.59,4.44C16.43,5.07 17.96,6.34 18.92,8M12,2C6.47,2 2,6.5 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z",_="https://home-assistant.io/iOS",x="https://home-assistant.io/android",b=(e,t)=>{const i=e.last_used_at?new Date(e.last_used_at):0,a=t.last_used_at?new Date(t.last_used_at):0;return i<a?1:i>a?-1:0};(0,a.Z)([(0,n.Mo)("ha-refresh-tokens-card")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"refreshTokens",value:void 0},{kind:"field",key:"_refreshTokens",value:()=>(0,o.Z)((e=>e.filter((e=>"normal"===e.type)).sort(b)))},{kind:"field",key:"_formatTokenName",value(){return e=>e.client_id===_?this.hass.localize("ui.panel.profile.refresh_tokens.ios_app"):e.client_id===x?this.hass.localize("ui.panel.profile.refresh_tokens.android_app"):e.client_name||e.client_id}},{kind:"method",key:"render",value:function(){const e=this.refreshTokens?this._refreshTokens(this.refreshTokens):[];return s.dy` <ha-card .header="${this.hass.localize("ui.panel.profile.refresh_tokens.header")}"> <div class="card-content"> ${this.hass.localize("ui.panel.profile.refresh_tokens.description")} ${e.length?e.map((e=>s.dy` <ha-settings-row three-line> <ha-svg-icon slot="prefix" .path="${e.client_id===_?f:e.client_id===x?p:y}"></ha-svg-icon> <span slot="heading" class="primary"> ${this._formatTokenName(e)} </span> <div slot="description"> ${this.hass.localize("ui.panel.profile.refresh_tokens.created_at",{date:(0,r.G)(new Date(e.created_at),this.hass.locale)})} </div> <div slot="description"> ${e.is_current?s.dy` <span class="current-session"> <span class="dot"></span> ${this.hass.localize("ui.panel.profile.refresh_tokens.current_session")} </span> `:e.last_used_at?this.hass.localize("ui.panel.profile.refresh_tokens.last_used",{date:(0,r.G)(new Date(e.last_used_at),this.hass.locale),location:e.last_used_ip}):this.hass.localize("ui.panel.profile.refresh_tokens.not_used")} </div> <div slot="description"> ${e.expire_at?this.hass.localize("ui.panel.profile.refresh_tokens.expires_in",{date:(0,r.G)(new Date(e.expire_at),this.hass.locale)}):this.hass.localize("ui.panel.profile.refresh_tokens.never_expires")} </div> <div> <ha-button-menu corner="BOTTOM_END" menu-corner="END" @action="${this._handleAction}" .token="${e}"> <ha-icon-button slot="trigger" .label="${this.hass.localize("ui.common.menu")}" .path="${g}"></ha-icon-button> <ha-list-item graphic="icon"> <ha-svg-icon slot="graphic" .path="${e.expire_at?v:m}"></ha-svg-icon> ${e.expire_at?this.hass.localize("ui.panel.profile.refresh_tokens.disable_token_expiration"):this.hass.localize("ui.panel.profile.refresh_tokens.enable_token_expiration")} </ha-list-item> <ha-list-item graphic="icon" class="warning" .disabled="${e.is_current}"> <ha-svg-icon class="warning" slot="graphic" .path="${k}"></ha-svg-icon> ${this.hass.localize("ui.common.delete")} </ha-list-item> </ha-button-menu> </div> </ha-settings-row> `)):s.Ld} </div> <div class="card-actions"> <mwc-button class="warning" @click="${this._deleteAllTokens}"> ${this.hass.localize("ui.panel.profile.refresh_tokens.delete_all_tokens")} </mwc-button> </div> </ha-card> `}},{kind:"method",key:"_handleAction",value:async function(e){const t=e.currentTarget.token;switch(e.detail.index){case 0:this._toggleTokenExpiration(t);break;case 1:this._deleteToken(t)}}},{kind:"method",key:"_toggleTokenExpiration",value:async function(e){const t=!e.expire_at;if(t||await(0,c.showConfirmationDialog)(this,{title: