UNPKG

iobroker.lovelace

Version:

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

66 lines 75 kB
"use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[70744],{63708:function(t,e,a){a.d(e,{fW:function(){return s}});a(18111),a(13579);var o=a(44537),i=a(36312);const s=(t,e)=>(l(e)||r(t,e))&&n(t,e),r=(t,e)=>!e.component||(0,o.e)(e.component).some(e=>(0,i.x)(t.config,e)),n=(t,e)=>!e.not_component||!(0,o.e)(e.not_component).some(e=>(0,i.x)(t.config,e)),l=t=>t.core},98975:function(t,e,a){a.a(t,async function(t,o){try{a.d(e,{K:function(){return h}});var i=a(74487),s=a(22786),r=a(63927),n=t([i,r]);[i,r]=n.then?(await n)():n;const l=(0,s.A)(t=>new Intl.RelativeTimeFormat(t.language,{numeric:"auto"})),h=(t,e,a,o=!0)=>{const i=(0,r.x)(t,a,e);return o?l(e).format(i.value,i.unit):Intl.NumberFormat(e.language,{style:"unit",unit:i.unit,unitDisplay:"long"}).format(Math.abs(i.value))};o()}catch(l){o(l)}})},93421:function(t,e,a){a.d(e,{IW:function(){return c},dH:function(){return h},fI:function(){return l}});a(44114),a(62953);var o=a(35211),i=a(22792),s=a(32172);const r=(t,e)=>{let a=t;for(const o of e){if(null==a)return;a=a[o]}return a},n=(t,e,a)=>{const i=(0,s.p)({transformer:function(t){return a.call(this,t)},watch:e?[e]:[]}),r=(0,o.Fg)({context:t,subscribe:!0});return(t,e)=>{i(t,e),r(t,e)}},l=t=>n(i.iN,t.entityIdPath[0],function(e){const a=r(this,t.entityIdPath);return"string"==typeof a?null==e?void 0:e[a]:void 0}),h=t=>n(i.X1,t.entityIdPath[0],function(e){const a=r(this,t.entityIdPath);return"string"==typeof a?null==e?void 0:e[a]:void 0}),c=()=>n(i.D5,void 0,({localize:t})=>t)},26218:function(t,e,a){a.d(e,{a:function(){return i}});a(16280);const o=(0,a(77796).n)(t=>{history.replaceState({scrollPosition:t},"")},300);function i(t){return(e,a)=>{if("object"==typeof a)throw new Error("This decorator does not support this compilation type.");const i=e.connectedCallback;e.connectedCallback=function(){i.call(this);const e=this[a];e&&this.updateComplete.then(()=>{const a=this.renderRoot.querySelector(t);a&&setTimeout(()=>{a.scrollTop=e},0)})};const s=Object.getOwnPropertyDescriptor(e,a);let r;if(void 0===s)r={get(){var t;return this[`__${String(a)}`]||(null===(t=history.state)||void 0===t?void 0:t.scrollPosition)},set(t){o(t),this[`__${String(a)}`]=t},configurable:!0,enumerable:!0};else{const t=s.set;r=Object.assign(Object.assign({},s),{},{set(e){o(e),this[`__${String(a)}`]=e,null==t||t.call(this,e)}})}Object.defineProperty(e,a,r)}}},32172:function(t,e,a){a.d(e,{p:function(){return o}});a(16280),a(18111),a(7588),a(45367),a(92731),a(17642),a(58004),a(33853),a(45876),a(32475),a(15024),a(31698),a(62953);function o(t){return(e,a)=>{if("object"==typeof a)throw new Error("This decorator does not support this compilation type.");const o=String(a),i=e;if(i._transformers){if(!i.hasOwnProperty("_transformers")){const t=i._transformers;i._transformers=new Map,t.forEach((t,e)=>i._transformers.set(e,t))}}else{i._transformers=new Map,i._watching=new Map;const t=i.willUpdate;i.willUpdate=function(e){t.call(this,e);const a=new Set;e.forEach((t,e)=>{const o=this._watching.get(e);void 0!==o&&o.forEach(t=>a.add(t))}),a.forEach(t=>{this[t]=this[`__original_${String(t)}`]})}}i._transformers.set(a,t.transformer),t.watch&&t.watch.forEach(t=>{let e=i._watching.get(t);e||(e=new Set,i._watching.set(t,e)),e.add(a)});const s=Object.getOwnPropertyDescriptor(e,a);let r;if(void 0===s)r={get(){return this[`__transform_${o}`]},set(t){const e=this[`__transform_${o}`],a=this._transformers.get(o);this[`__transform_${o}`]=a?a.call(this,t):t,this[`__original_${o}`]=t,this.requestUpdate(o,e)},configurable:!0,enumerable:!0};else{const t=s.set;r=Object.assign(Object.assign({},s),{},{set(e){const a=this[`__transform_${o}`],i=this._transformers.get(o);this[`__transform_${o}`]=i?i.call(this,e):e,this[`__original_${o}`]=e,this.requestUpdate(o,a),null==t||t.call(this,e)}})}Object.defineProperty(e,a,r)}}},63927:function(t,e,a){a.a(t,async function(t,o){try{a.d(e,{x:function(){return u}});var i=a(6946),s=a(52640),r=a(38684),n=a(380),l=t([n]);n=(l.then?(await l)():l)[0];const c=1e3,d=60,p=60*d;function u(t,e=Date.now(),a,o={}){const l=Object.assign(Object.assign({},f),o||{}),h=(+t-+e)/c;if(Math.abs(h)<l.second)return{value:Math.round(h),unit:"second"};const u=h/d;if(Math.abs(u)<l.minute)return{value:Math.round(u),unit:"minute"};const g=h/p;if(Math.abs(g)<l.hour)return{value:Math.round(g),unit:"hour"};const v=new Date(t),m=new Date(e);v.setHours(0,0,0,0),m.setHours(0,0,0,0);const b=(0,i.c)(v,m);if(0===b)return{value:Math.round(g),unit:"hour"};if(Math.abs(b)<l.day)return{value:b,unit:"day"};const y=(0,n.P)(a),w=(0,s.k)(v,{weekStartsOn:y}),_=(0,s.k)(m,{weekStartsOn:y}),x=(0,r.I)(w,_);if(0===x)return{value:b,unit:"day"};if(Math.abs(x)<l.week)return{value:x,unit:"week"};const k=v.getFullYear()-m.getFullYear(),C=12*k+v.getMonth()-m.getMonth();return 0===C?{value:x,unit:"week"}:Math.abs(C)<l.month||0===k?{value:C,unit:"month"}:{value:Math.round(k),unit:"year"}}const f={second:59,minute:59,hour:22,day:5,week:4,month:11};o()}catch(h){o(h)}})},77796:function(t,e,a){a.d(e,{n:function(){return o}});a(62953);const o=(t,e,a=!0,o=!0)=>{let i,s=0;const r=(...r)=>{const n=()=>{s=!1===a?0:Date.now(),i=void 0,t(...r)},l=Date.now();s||!1!==a||(s=l);const h=e-(l-s);h<=0||h>e?(i&&(clearTimeout(i),i=void 0),s=l,t(...r)):i||!1===o||(i=window.setTimeout(n,h))};return r.cancel=()=>{clearTimeout(i),i=void 0,s=0},r}},38962:function(t,e,a){a.a(t,async function(t,o){try{a.r(e);a(62953);var i=a(40445),s=a(5124),r=a(67576),n=a(6412),l=a(93421),h=a(1087),c=a(26300),d=(a(67094),t([c]));c=(d.then?(await d)():d)[0];let p,u,f,g,v=t=>t;const m="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",b={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"};class y extends s.WF{render(){var t;return(0,s.qy)(p||(p=v` <div class="issue-type ${0}" role="alert"> <div class="icon ${0}"> <slot name="icon"> <ha-svg-icon .path="${0}"></ha-svg-icon> </slot> </div> <div class="${0}"> <div class="main-content"> ${0} <slot></slot> </div> <div class="action"> <slot name="action"> ${0} </slot> </div> </div> </div> `),(0,n.H)({[this.alertType]:!0}),this.title?"":"no-title",b[this.alertType],(0,n.H)({content:!0,narrow:this.narrow}),this.title?(0,s.qy)(u||(u=v`<div class="title">${0}</div>`),this.title):s.s6,this.dismissable?(0,s.qy)(f||(f=v`<ha-icon-button @click="${0}" .label="${0}" .path="${0}"></ha-icon-button>`),this._dismissClicked,null===(t=this._localize)||void 0===t?void 0:t.call(this,"ui.common.dismiss_alert"),m):s.s6)}_dismissClicked(){(0,h.r)(this,"alert-dismissed-clicked")}constructor(...t){super(...t),this.title="",this.alertType="info",this.dismissable=!1,this.narrow=!1}}y.styles=(0,s.AH)(g||(g=v`.issue-type{position:relative;padding:8px;display:flex}.icon{height:var(--ha-alert-icon-size,24px);width:var(--ha-alert-icon-size,24px)}.issue-type::after{position:absolute;top:0;right:0;bottom:0;left:0;opacity:.12;pointer-events:none;content:"";border-radius:var(--ha-border-radius-sm)}.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;line-height:normal;margin-left:8px;margin-right:0;margin-inline-start:8px;margin-inline-end:8px}.title{margin-top:2px;font-weight:var(--ha-font-weight-bold)}.action ha-icon-button{--mdc-theme-primary:var(--primary-text-color);--ha-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}`)),(0,i.Cg)([(0,r.MZ)()],y.prototype,"title",void 0),(0,i.Cg)([(0,r.MZ)({attribute:"alert-type"})],y.prototype,"alertType",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean})],y.prototype,"dismissable",void 0),(0,i.Cg)([(0,r.wk)(),(0,l.IW)()],y.prototype,"_localize",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean})],y.prototype,"narrow",void 0),y=(0,i.Cg)([(0,r.EM)("ha-alert")],y),o()}catch(p){o(p)}})},76776:function(t,e,a){a(62953);var o=a(40445),i=a(5124),s=a(67576);let r,n,l,h=t=>t;class c extends i.WF{render(){return(0,i.qy)(r||(r=h` ${0} <slot></slot> `),this.header?(0,i.qy)(n||(n=h`<h1 class="card-header">${0}</h1>`),this.header):i.s6)}constructor(...t){super(...t),this.raised=!1}}c.styles=(0,i.AH)(l||(l=h`: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,var(--ha-border-radius-lg));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, var(--ha-font-size-2xl));letter-spacing:-.012em;line-height:var(--ha-line-height-expanded);padding:var(--ha-space-3) var(--ha-space-4) var(--ha-space-4);display:block;margin-block-start:0;margin-block-end:0;font-weight:var(--ha-font-weight-normal)}
    :host
      ::slotted(
        .card-content:not(:nth-child(1 of .card-content, .card-header))
      ),
    slot:not(:first-child)::slotted(.card-content) {
      padding-top: 0;
      margin-top: calc(var(--ha-space-2) * -1);
    }
    :host ::slotted(.card-content){padding:var(--ha-space-4)}:host ::slotted(.card-actions){border-top:1px solid var(--divider-color,#e8e8e8);padding:var(--ha-space-2)}`)),(0,o.Cg)([(0,s.MZ)()],c.prototype,"header",void 0),(0,o.Cg)([(0,s.MZ)({type:Boolean,reflect:!0})],c.prototype,"raised",void 0),c=(0,o.Cg)([(0,s.EM)("ha-card")],c)},70947:function(t,e,a){a(62953);var o=a(40445),i=a(50759),s=(a(38625),a(5124)),r=a(67576);a(67094);let n,l,h=t=>t;class c extends i.A{renderCheckboxIcon(){return(0,s.qy)(n||(n=h` <ha-svg-icon id="check" part="checkmark" .path="${0}"></ha-svg-icon> `),this.checked?"M10,17L5,12L6.41,10.58L10,14.17L17.59,6.58L19,8M19,3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3Z":"M19,3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3M19,5V19H5V5H19Z")}static get styles(){return[i.A.styles,(0,s.AH)(l||(l=h`:host{min-height:var(--ha-space-10)}#check{visibility:visible;flex-shrink:0}#icon ::slotted(*){color:var(--ha-color-on-neutral-normal)}:host([variant=danger]) #icon ::slotted(*){color:var(--ha-color-on-danger-quiet)}:host([selected]){font-weight:var(--ha-font-weight-medium);color:var(--primary-color);background-color:var(--ha-color-fill-primary-quiet-resting);--icon-primary-color:var(--primary-color)}:host([selected]:hover){background-color:var(--ha-color-fill-primary-quiet-hover)}`))]}constructor(...t){super(...t),this.selected=!1}}(0,o.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],c.prototype,"selected",void 0),c=(0,o.Cg)([(0,r.EM)("ha-dropdown-item")],c)},29823:function(t,e,a){a.a(t,async function(t,e){try{a(3362),a(62953);var o=a(40445),i=a(52254),s=a(5124),r=a(67576),n=t([i]);i=(n.then?(await n)():n)[0];let l,h=t=>t;class c extends i.A{get anchorElement(){var t;return null===(t=this.popup)||void 0===t?void 0:t.anchor}set anchorElement(t){this.popup&&(this.popup.anchor&&"ha-icon-button"===this.popup.anchor.localName&&(this.popup.anchor.selected=!1),this.popup.anchor=t)}getTrigger(){return this.anchorElement?this.anchorElement:super.getTrigger()}async showMenu(){await super.showMenu();const t=this.getTrigger();t&&"ha-icon-button"===t.localName&&(t.selected=!0)}async hideMenu(){const t=this.getTrigger();t&&"ha-icon-button"===t.localName&&(t.selected=!1),await super.hideMenu()}static get styles(){return[i.A.styles,(0,s.AH)(l||(l=h`:host{font-size:var(--ha-dropdown-font-size, var(--ha-font-size-m));--wa-color-surface-raised:var(
            --card-background-color,
            var(--ha-dialog-surface-background, var(--mdc-theme-surface, #fff)),
          )}#menu{padding:var(--ha-space-1)}wa-popup::part(popup){z-index:200}`))]}constructor(...t){super(...t),this.dropdownTag="ha-dropdown",this.dropdownItemTag="ha-dropdown-item"}}(0,o.Cg)([(0,r.MZ)({attribute:!1})],c.prototype,"dropdownTag",void 0),(0,o.Cg)([(0,r.MZ)({attribute:!1})],c.prototype,"dropdownItemTag",void 0),c=(0,o.Cg)([(0,r.EM)("ha-dropdown")],c),e()}catch(l){e(l)}})},90248:function(t,e,a){a.a(t,async function(t,o){try{a.r(e),a.d(e,{HaIconButtonArrowPrev:function(){return f}});a(62953);var i=a(40445),s=a(5124),r=a(67576),n=a(63091),l=a(26300),h=t([l]);l=(h.then?(await h)():h)[0];let c,d=t=>t;const p="M20,11V13H8L13.5,18.5L12.08,19.92L4.16,12L12.08,4.08L13.5,5.5L8,11H20Z",u="M4,11V13H16L10.5,18.5L11.92,19.92L19.84,12L11.92,4.08L10.5,5.5L16,11H4Z";class f extends s.WF{render(){var t;return(0,s.qy)(c||(c=d` <ha-icon-button .disabled="${0}" .label="${0}" .path="${0}" .href="${0}" .target="${0}" .rel="${0}" .download="${0}"></ha-icon-button> `),this.disabled,this.label||(null===(t=this.hass)||void 0===t?void 0:t.localize("ui.common.back"))||"Back",this._icon,this.href,this.target,this.rel,this.download)}constructor(...t){super(...t),this.disabled=!1,this._icon="rtl"===n.G.document.dir?u:p}}(0,i.Cg)([(0,r.MZ)({attribute:!1})],f.prototype,"hass",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean})],f.prototype,"disabled",void 0),(0,i.Cg)([(0,r.MZ)()],f.prototype,"label",void 0),(0,i.Cg)([(0,r.MZ)()],f.prototype,"href",void 0),(0,i.Cg)([(0,r.MZ)()],f.prototype,"target",void 0),(0,i.Cg)([(0,r.MZ)()],f.prototype,"rel",void 0),(0,i.Cg)([(0,r.MZ)()],f.prototype,"download",void 0),(0,i.Cg)([(0,r.wk)()],f.prototype,"_icon",void 0),f=(0,i.Cg)([(0,r.EM)("ha-icon-button-arrow-prev")],f),o()}catch(c){o(c)}})},26300:function(t,e,a){a.a(t,async function(t,o){try{a.r(e),a.d(e,{HaIconButton:function(){return g}});a(62953);var i=a(40445),s=a(5124),r=a(67576),n=a(63672),l=a(18350),h=(a(67094),t([l]));l=(h.then?(await h)():h)[0];let c,d,p,u,f=t=>t;class g extends s.WF{render(){return(0,s.qy)(c||(c=f` <ha-button appearance="plain" variant="neutral" aria-label="${0}" title="${0}" aria-haspopup="${0}" .disabled="${0}" .iconTag="${0}" .href="${0}" .target="${0}" .rel="${0}" .download="${0}"> ${0} </ha-button> `),(0,n.J)(this.label),(0,n.J)(this.hideTitle?void 0:this.label),(0,n.J)(this.ariaHasPopup),this.disabled,this.path?"ha-svg-icon":"span",this.href,this.target,this.rel,this.download,this.path?(0,s.qy)(d||(d=f`<ha-svg-icon aria-hidden="true" .path="${0}"></ha-svg-icon>`),this.path):(0,s.qy)(p||(p=f`<span><slot></slot></span>`)))}constructor(...t){super(...t),this.disabled=!1,this.hideTitle=!1,this.selected=!1}}g.shadowRootOptions={mode:"open",delegatesFocus:!0},g.styles=(0,s.AH)(u||(u=f`:host{display:inline-block;outline:0;--ha-button-height:var(--ha-icon-button-size, 48px)}ha-button{position:relative;isolation:isolate;--wa-form-control-padding-inline:var(
        --ha-icon-button-padding-inline,
        --ha-space-2
      );--wa-color-on-normal:currentColor;--wa-color-fill-quiet:transparent;--ha-button-label-overflow:visible}ha-button::after{content:"";position:absolute;inset:0;z-index:-1;border-radius:50%;background-color:currentColor;opacity:0;pointer-events:none}ha-button::part(base){width:var(--wa-form-control-height);aspect-ratio:1;outline-offset:-4px}ha-button::part(label){display:flex}:host([selected]) ha-button::after{opacity:.1}@media (hover:hover){:host(:hover:not([disabled])) ha-button::after{opacity:.1}}`)),(0,i.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],g.prototype,"disabled",void 0),(0,i.Cg)([(0,r.MZ)({type:String})],g.prototype,"path",void 0),(0,i.Cg)([(0,r.MZ)({type:String})],g.prototype,"label",void 0),(0,i.Cg)([(0,r.MZ)({type:String,attribute:"aria-haspopup"})],g.prototype,"ariaHasPopup",void 0),(0,i.Cg)([(0,r.MZ)({attribute:"hide-title",type:Boolean})],g.prototype,"hideTitle",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],g.prototype,"selected",void 0),(0,i.Cg)([(0,r.MZ)()],g.prototype,"href",void 0),(0,i.Cg)([(0,r.MZ)()],g.prototype,"target",void 0),(0,i.Cg)([(0,r.MZ)()],g.prototype,"rel",void 0),(0,i.Cg)([(0,r.MZ)()],g.prototype,"download",void 0),g=(0,i.Cg)([(0,r.EM)("ha-icon-button")],g),o()}catch(c){o(c)}})},2054:function(t,e,a){a.a(t,async function(t,e){try{a(16280),a(62953);var o=a(40445),i=a(5124),s=a(67576),r=a(1087),n=a(44249),l=a(26300),h=t([l]);l=(h.then?(await h)():h)[0];let c,d,p,u=t=>t;const f="M3,6H21V8H3V6M3,11H21V13H3V11M3,16H21V18H3V16Z";class g extends i.WF{connectedCallback(){super.connectedCallback(),this._attachNotifOnConnect&&(this._attachNotifOnConnect=!1,this._subscribeNotifications())}disconnectedCallback(){super.disconnectedCallback(),this._unsubNotifications&&(this._attachNotifOnConnect=!0,this._unsubNotifications(),this._unsubNotifications=void 0)}render(){if(!this._show)return i.s6;const t=this._hasNotifications&&(this.narrow||"always_hidden"===this.hass.dockedSidebar);return(0,i.qy)(c||(c=u` <ha-icon-button .label="${0}" .path="${0}" @click="${0}"></ha-icon-button> ${0} `),this.hass.localize("ui.sidebar.sidebar_toggle"),f,this._toggleMenu,t?(0,i.qy)(d||(d=u`<div class="dot"></div>`)):"")}willUpdate(t){if(super.willUpdate(t),!t.has("narrow")&&!t.has("hass"))return;const e=t.has("hass")?t.get("hass"):this.hass,a=t.has("narrow")?t.get("narrow"):this.narrow,o=!1===(null==e?void 0:e.kioskMode)&&(a||"always_hidden"===(null==e?void 0:e.dockedSidebar)),i=!1===this.hass.kioskMode&&(this.narrow||"always_hidden"===this.hass.dockedSidebar);this.hasUpdated&&o===i||(this._show=i||this._alwaysVisible,i?this._subscribeNotifications():this._unsubNotifications&&(this._unsubNotifications(),this._unsubNotifications=void 0))}_subscribeNotifications(){if(this._unsubNotifications)throw new Error("Already subscribed");this._unsubNotifications=(0,n.V)(this.hass.connection,t=>{this._hasNotifications=t.length>0})}_toggleMenu(){(0,r.r)(this,"hass-toggle-menu")}constructor(...t){super(...t),this.narrow=!1,this._hasNotifications=!1,this._show=!1,this._alwaysVisible=!1,this._attachNotifOnConnect=!1}}g.styles=(0,i.AH)(p||(p=u`:host{position:relative}.dot{pointer-events:none;position:absolute;background-color:var(--accent-color);width:12px;height:12px;top:9px;right:7px;inset-inline-end:7px;inset-inline-start:initial;border-radius:var(--ha-border-radius-circle);border:2px solid var(--app-header-background-color)}`)),(0,o.Cg)([(0,s.MZ)({type:Boolean})],g.prototype,"narrow",void 0),(0,o.Cg)([(0,s.MZ)({attribute:!1})],g.prototype,"hass",void 0),(0,o.Cg)([(0,s.wk)()],g.prototype,"_hasNotifications",void 0),(0,o.Cg)([(0,s.wk)()],g.prototype,"_show",void 0),g=(0,o.Cg)([(0,s.EM)("ha-menu-button")],g),e()}catch(c){e(c)}})},54276:function(t,e,a){a(62953);var o=a(40445),i=a(76482),s=a(91382),r=a(96245),n=a(5124),l=a(67576);let h;class c extends s.n{attach(t){super.attach(t),this.attachableTouchController.attach(t)}disconnectedCallback(){super.disconnectedCallback(),this.hovered=!1,this.pressed=!1}detach(){super.detach(),this.attachableTouchController.detach()}_onTouchControlChange(t,e){null==t||t.removeEventListener("touchend",this._handleTouchEnd),null==e||e.addEventListener("touchend",this._handleTouchEnd)}constructor(...t){super(...t),this.attachableTouchController=new i.i(this,this._onTouchControlChange.bind(this)),this._handleTouchEnd=()=>{this.disabled||super.endPressAnimation()}}}c.styles=[r.R,(0,n.AH)(h||(h=(t=>t)`:host{--md-ripple-hover-opacity:var(--ha-ripple-hover-opacity, 0.08);--md-ripple-pressed-opacity:var(--ha-ripple-pressed-opacity, 0.12);--md-ripple-hover-color:var(
          --ha-ripple-hover-color,
          var(--ha-ripple-color, var(--secondary-text-color))
        );--md-ripple-pressed-color:var(
          --ha-ripple-pressed-color,
          var(--ha-ripple-color, var(--secondary-text-color))
        )}`))],c=(0,o.Cg)([(0,l.EM)("ha-ripple")],c)},8034:function(t,e,a){a(27495),a(62953);var o=a(40445),i=a(92070),s=a(5124),r=a(67576);let n,l,h,c=t=>t;class d extends s.WF{render(){const t=this._hasSlotController.test("description");return(0,s.qy)(n||(n=c` <div class="prefix-wrap"> <slot name="prefix"></slot> <div class="body" part="heading" ?two-line="${0}" ?three-line="${0}"> <slot name="heading"></slot> ${0} </div> </div> <div class="content"> <slot></slot> </div> `),!this.threeLine&&t,this.threeLine,t?(0,s.qy)(l||(l=c`<span class="secondary"><slot name="description"></slot></span>`)):s.s6)}constructor(...t){super(...t),this.narrow=!1,this.slim=!1,this.threeLine=!1,this.wrapHeading=!1,this.empty=!1,this._hasSlotController=new i.X(this,"description")}}d.styles=(0,s.AH)(h||(h=c`:host{display:flex;padding:0 var(--ha-space-4);align-content:normal;align-self:auto;align-items:center}.body{padding-top:var(--settings-row-body-padding-top,var(--ha-space-2));padding-bottom:var(--settings-row-body-padding-bottom,var(--ha-space-2));padding-left:0;padding-inline-start:0;padding-right:var(--ha-space-4);padding-inline-end:var(--ha-space-4);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:88px}:host(:not([wrap-heading])) body>*{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.body>.secondary{display:block;padding-top:var(--ha-space-1);font-family:var(
        --mdc-typography-body2-font-family,
        var(--mdc-typography-font-family, var(--ha-font-family-body))
      );font-size:var(--mdc-typography-body2-font-size, var(--ha-font-size-s));-webkit-font-smoothing:var(--ha-font-smoothing);-moz-osx-font-smoothing:var(--ha-moz-osx-font-smoothing);font-weight:var(--mdc-typography-body2-font-weight,var(--ha-font-weight-normal));line-height:normal;color:var(--secondary-text-color)}.body[two-line]{min-height:calc(72px - 16px);flex:1}.content{display:contents}:host(:not([narrow])) .content{display:var(--settings-row-content-display,flex);justify-content:flex-end;flex:1;min-width:0;padding:var(--settings-row-content-padding-block,var(--ha-space-4)) 0}:host([empty]) .content{display:none}.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:var(--ha-space-2)}::slotted(ha-switch){padding:var(--settings-row-switch-padding-block,var(--ha-space-4)) 0}.secondary{white-space:normal}.prefix-wrap{flex:var(--settings-row-prefix-flex,1);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}`)),(0,o.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],d.prototype,"narrow",void 0),(0,o.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],d.prototype,"slim",void 0),(0,o.Cg)([(0,r.MZ)({type:Boolean,attribute:"three-line"})],d.prototype,"threeLine",void 0),(0,o.Cg)([(0,r.MZ)({type:Boolean,attribute:"wrap-heading",reflect:!0})],d.prototype,"wrapHeading",void 0),(0,o.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],d.prototype,"empty",void 0),d=(0,o.Cg)([(0,r.EM)("ha-settings-row")],d)},67094:function(t,e,a){a.r(e),a.d(e,{HaSvgIcon:function(){return d}});var o=a(40445),i=a(5124),s=a(67576);let r,n,l,h,c=t=>t;class d extends i.WF{render(){return(0,i.JW)(r||(r=c` <svg viewBox="${0}" preserveAspectRatio="xMidYMid meet" focusable="false" role="img" aria-hidden="true"> <g> ${0} ${0} </g> </svg>`),this.viewBox||"0 0 24 24",this.path?(0,i.JW)(n||(n=c`<path class="primary-path" d="${0}"></path>`),this.path):i.s6,this.secondaryPath?(0,i.JW)(l||(l=c`<path class="secondary-path" d="${0}"></path>`),this.secondaryPath):i.s6)}}d.styles=(0,i.AH)(h||(h=c`:host{display:var(--ha-icon-display,inline-flex);align-items:center;justify-content:center;position:relative;vertical-align:middle;fill:var(--icon-primary-color,currentcolor);width:var(--mdc-icon-size,24px);height:var(--mdc-icon-size,24px)}svg{width:100%;height:100%;pointer-events:none;display:block}path.primary-path{opacity:var(--icon-primary-opactity, 1)}path.secondary-path{fill:var(--icon-secondary-color,currentcolor);opacity:var(--icon-secondary-opactity, .5)}`)),(0,o.Cg)([(0,s.MZ)()],d.prototype,"path",void 0),(0,o.Cg)([(0,s.MZ)({attribute:!1})],d.prototype,"secondaryPath",void 0),(0,o.Cg)([(0,s.MZ)({attribute:!1})],d.prototype,"viewBox",void 0),d=(0,o.Cg)([(0,s.EM)("ha-svg-icon")],d)},43831:function(t,e,a){a(62953);var o=a(40445),i=a(5124),s=a(67576),r=a(63672);a(54276);let n,l,h=t=>t;class c extends i.WF{render(){return(0,i.qy)(n||(n=h` <div tabindex="0" role="tab" aria-selected="${0}" aria-label="${0}" @keydown="${0}"> <slot name="icon"></slot> <span class="name">${0}</span> <ha-ripple></ha-ripple> </div> `),this.active,(0,r.J)(this.name),this._handleKeyDown,this.name)}_handleKeyDown(t){"Enter"===t.key&&t.target.click()}constructor(...t){super(...t),this.active=!1,this.narrow=!1}}c.styles=(0,i.AH)(l||(l=h`div{padding:0 32px;display:flex;flex-direction:column;text-align:center;box-sizing:border-box;align-items:center;justify-content:center;width:100%;height:var(--header-height);cursor:pointer;position:relative;outline:0}:host(:not([narrow])) div{flex-direction:row;gap:var(--ha-space-2)}.name{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}:host([active]){color:var(--primary-color)}:host(:not([narrow])[active]) div{border-bottom:2px solid var(--primary-color)}:host([narrow]){min-width:0;display:flex;justify-content:center;overflow:hidden}:host([narrow]) div{padding:0 4px}::slotted([slot=icon]){margin-bottom:var(--ha-space-1)}:host(:not([narrow])) ::slotted([slot=icon]){margin-bottom:0}div:focus-visible:before{position:absolute;display:block;content:"";inset:0;background-color:var(--secondary-text-color);opacity:.08}`)),(0,o.Cg)([(0,s.MZ)({type:Boolean,reflect:!0})],c.prototype,"active",void 0),(0,o.Cg)([(0,s.MZ)({type:Boolean,reflect:!0})],c.prototype,"narrow",void 0),(0,o.Cg)([(0,s.MZ)()],c.prototype,"name",void 0),c=(0,o.Cg)([(0,s.EM)("ha-tab")],c)},34127:function(t,e,a){a.a(t,async function(t,e){try{a(62953);var o=a(40445),i=a(52630),s=a(5124),r=a(67576),n=t([i]);i=(n.then?(await n)():n)[0];let l,h=t=>t;class c extends i.A{static get styles(){return[i.A.styles,(0,s.AH)(l||(l=h`:host{--wa-tooltip-background-color:var(
            --ha-tooltip-background-color,
            var(--ha-color-surface-default)
          );--wa-tooltip-content-color:var(
            --ha-tooltip-text-color,
            var(--primary-text-color)
          );--wa-tooltip-font-family:var(
            --ha-tooltip-font-family,
            var(--ha-font-family-body)
          );--wa-tooltip-font-size:var(
            --ha-tooltip-font-size,
            var(--ha-font-size-m)
          );--wa-tooltip-font-weight:var(
            --ha-tooltip-font-weight,
            var(--ha-font-weight-medium)
          );--wa-tooltip-line-height:var(
            --ha-tooltip-line-height,
            var(--ha-line-height-condensed)
          );--wa-tooltip-padding:var(--ha-tooltip-padding, var(--ha-space-2));--wa-tooltip-border-radius:var(
            --ha-tooltip-border-radius,
            var(--ha-border-radius-md)
          );--wa-tooltip-arrow-size:var(--ha-tooltip-arrow-size, 0px);--wa-tooltip-border-width:0px;--wa-z-index-tooltip:1000}.tooltip::part(popup){animation-duration:var(--ha-tooltip-animation-duration, 0)}.body{box-shadow:var(--ha-tooltip-box-shadow,var(--ha-box-shadow-m))}`))]}constructor(...t){super(...t),this.showDelay=350,this.hideDelay=150}}(0,o.Cg)([(0,r.MZ)({attribute:"show-delay",type:Number})],c.prototype,"showDelay",void 0),(0,o.Cg)([(0,r.MZ)({attribute:"hide-delay",type:Number})],c.prototype,"hideDelay",void 0),c=(0,o.Cg)([(0,r.EM)("ha-tooltip")],c),e()}catch(l){e(l)}})},28170:function(t,e,a){a.d(e,{o:function(){return h}});a(62953);var o=a(40445),i=a(5124),s=a(67576),r=a(1087),n=a(83892);let l;class h extends n.x{connectedCallback(){super.connectedCallback(),this.hasAttribute("role")||this.setAttribute("role",this.defaultRole),(0,r.r)(this,"ha-list-item-register",{item:this})}disconnectedCallback(){super.disconnectedCallback(),(0,r.r)(this,"ha-list-item-unregister",{item:this})}activate(){this.click()}constructor(...t){super(...t),this.interactive=!1,this.defaultRole="listitem"}}h.styles=[n.x.styles,(0,i.AH)(l||(l=(t=>t)`:host{--ha-list-item-focus-radius:var(--ha-border-radius-sm);--ha-list-item-focus-width:2px;--ha-list-item-focus-width-start:var(--ha-space-2);--ha-list-item-focus-offset:-2px;--ha-list-item-focus-background:var(--ha-color-fill-neutral-quiet-hover)}:host(:focus){outline:0}.base{border-radius:var(--ha-list-item-focus-radius);outline:var(--ha-list-item-focus-width) solid transparent;outline-offset:var(--ha-list-item-focus-offset);transition:outline-color var(--ha-animation-duration-fast) ease-out,background-color var(--ha-animation-duration-fast) ease-out}@keyframes ha-list-item-focus-in{from{outline-width:var(--ha-list-item-focus-width-start);outline-offset:calc(-1 * var(--ha-list-item-focus-width-start))}to{outline-width:var(--ha-list-item-focus-width);outline-offset:var(--ha-list-item-focus-offset)}}:host(:focus-visible) .base{outline-color:var(--ha-color-focus);background-color:var(--ha-list-item-focus-background);animation:ha-list-item-focus-in var(--ha-animation-duration-normal) ease-in}`))],(0,o.Cg)([(0,s.MZ)({type:Boolean,reflect:!0})],h.prototype,"interactive",void 0),h=(0,o.Cg)([(0,s.EM)("ha-list-item-base")],h)},83892:function(t,e,a){a.d(e,{x:function(){return g}});a(18111),a(13579),a(27495),a(42762),a(62953);var o=a(40445),i=a(92070),s=a(5124),r=a(67576);let n,l,h,c,d,p,u,f=t=>t;class g extends s.WF{_onSlotChange(t){return e=>{const a=e.target.assignedNodes({flatten:!0}).some(t=>{var e;return t.nodeType===Node.ELEMENT_NODE||t.nodeType===Node.TEXT_NODE&&""!==(null===(e=t.textContent)||void 0===e?void 0:e.trim())});"start"===t?this._hasStart=a:this._hasEnd=a}}render(){return this._renderBase(this._renderInner())}_renderBase(t){return(0,s.qy)(n||(n=f`<div part="base" class="base" id="item">${0}</div>`),t)}_renderInner(){const t=this._slotController.test("content");return(0,s.qy)(l||(l=f` <div part="start" class="start" ?hidden="${0}"> <slot name="start" @slotchange="${0}"></slot> </div> <div part="content" class="content"> ${0} </div> <div part="end" class="end" ?hidden="${0}"> <slot name="end" @slotchange="${0}"></slot> </div> `),!this._hasStart,this._onSlotChange("start"),t?(0,s.qy)(h||(h=f`<slot name="content"></slot>`)):this._renderDefaultContent(),!this._hasEnd,this._onSlotChange("end"))}_renderDefaultContent(){var t,e;const a=this._slotController.test("headline"),o=this._slotController.test("supporting-text"),i=a||void 0!==this.headline,r=o||void 0!==this.supportingText;return(0,s.qy)(c||(c=f` ${0} ${0} `),i?(0,s.qy)(d||(d=f`<div part="headline" class="headline"> <slot name="headline">${0}</slot> </div>`),null!==(t=this.headline)&&void 0!==t?t:s.s6):s.s6,r?(0,s.qy)(p||(p=f`<div part="supporting-text" class="supporting"> <slot name="supporting-text">${0}</slot> </div>`),null!==(e=this.supportingText)&&void 0!==e?e:s.s6):s.s6)}constructor(...t){super(...t),this.disabled=!1,this._slotController=new i.X(this,"headline","supporting-text","content"),this._hasStart=!1,this._hasEnd=!1}}g.styles=(0,s.AH)(u||(u=f`:host{display:block;color:var(--primary-text-color);font-size:var(--ha-font-size-m);line-height:var(--ha-line-height-normal)}:host([disabled]){color:var(--disabled-text-color);pointer-events:none}.base{position:relative;display:flex;flex-direction:row;align-items:center;gap:var(--ha-row-item-gap,var(--ha-space-4));padding-block:var(--ha-row-item-padding-block,var(--ha-space-3));padding-inline:var(--ha-row-item-padding-inline,var(--ha-space-4));min-height:var(--ha-row-item-min-height,48px);box-sizing:border-box}.content{flex:1 1 auto;min-width:0;display:flex;flex-direction:column;justify-content:center}.end,.start{display:flex;align-items:center;flex:0 0 auto}.end[hidden],.start[hidden]{display:none}.headline{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.supporting{color:var(--secondary-text-color);font-size:var(--ha-font-size-s);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}`)),(0,o.Cg)([(0,r.MZ)({type:String})],g.prototype,"headline",void 0),(0,o.Cg)([(0,r.MZ)({type:String,attribute:"supporting-text"})],g.prototype,"supportingText",void 0),(0,o.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],g.prototype,"disabled",void 0),(0,o.Cg)([(0,r.wk)()],g.prototype,"_hasStart",void 0),(0,o.Cg)([(0,r.wk)()],g.prototype,"_hasEnd",void 0),g=(0,o.Cg)([(0,r.EM)("ha-row-item")],g)},50723:function(t,e,a){a.d(e,{N:function(){return u}});a(74423),a(26910),a(18111),a(22489),a(7588),a(62953);var o=a(40445),i=a(5124),s=a(67576),r=a(91335);a(44114),a(94490);const n=t=>{const e=[];let a=t;for(;a;){e.push(a);const t=a.parentNode;if(t instanceof ShadowRoot)a=t.host;else if(t)a=t;else{const t=a.getRootNode();a=t instanceof ShadowRoot?t.host:null}}return e.reverse()},l=(t,e)=>{if(t===e)return 0;const a=n(t),o=n(e);let i=0;for(;i<a.length&&i<o.length&&a[i]===o[i];)i++;return 0===i?0:i===a.length?-1:i===o.length?1:a[i].compareDocumentPosition(o[i])&Node.DOCUMENT_POSITION_FOLLOWING?-1:1};var h=a(1087);let c,d,p=t=>t;class u extends i.WF{connectedCallback(){super.connectedCallback(),this.hasAttribute("ha-list")||this.setAttribute("ha-list",""),!this.hasAttribute("role")&&this.hostRole&&this.setAttribute("role",this.hostRole),this._unbindKeys=(0,r.Tc)(this,{ArrowDown:this._onForward,ArrowUp:this._onBack,Home:this._onHome,End:this._onEnd,Enter:this._onActivate,Space:this._onActivate}),this.addEventListener("focusin",this._onFocusIn),this.addEventListener("ha-list-item-register",this._onItemRegister),this.addEventListener("ha-list-item-unregister",this._onItemUnregister)}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this._unbindKeys)||void 0===t||t.call(this),this._unbindKeys=void 0,this.removeEventListener("focusin",this._onFocusIn),this.removeEventListener("ha-list-item-register",this._onItemRegister),this.removeEventListener("ha-list-item-unregister",this._onItemUnregister)}focus(t){this.items.length?this.focusItemAtIndex(this._activeItemIndex>=0?this._activeItemIndex:0):super.focus(t)}focusItemAtIndex(t){t<0||this.setActiveItemIndex(t,!0)}getActiveItemIndex(){return this._activeItemIndex}setActiveItemIndex(t,e=!1){this._hasFocusableItem?(this._activeItemIndex=Math.max(0,Math.min(this.items.length-1,t)),this._isFocusable(this._activeItemIndex)||(this._activeItemIndex=this._firstFocusableIndex),this._applyActive(e)):this._activeItemIndex=-1}updateListItems(){this._recomputeFocusableIndexes(),(this._activeItemIndex>=this.items.length||!this._hasFocusableItem||this._activeItemIndex<0)&&(this._activeItemIndex=this._firstFocusableIndex),this._applyActive(!1)}_recomputeFocusableIndexes(){let t=-1,e=-1;for(let a=0;a<this.items.length;a++)this._isFocusable(a)&&(-1===t&&(t=a),e=a);this._firstFocusableIndex=t,this._lastFocusableIndex=e,this._hasFocusableItem=-1!==t}render(){return(0,i.qy)(c||(c=p`<div part="base" class="base"> <slot></slot> </div>`))}_isFocusable(t){const e=this.items[t];return!!e&&e.interactive&&!e.disabled}_applyActive(t){var e;(this.items.forEach((t,e)=>{t.interactive&&!t.disabled?t.tabIndex=e===this._activeItemIndex?0:-1:t.removeAttribute("tabindex")}),t&&this._activeItemIndex>=0)&&(null===(e=this.items[this._activeItemIndex])||void 0===e||e.focus())}_moveFocus(t,e){!this._hasFocusableItem||e<0||e===this._activeItemIndex||(t.preventDefault(),this._activeItemIndex=e,this._applyActive(!0))}_stepIndex(t,e){const a=this.items.length;if(!a||!this._hasFocusableItem)return t;let o=t;for(let i=0;i<a;i++){if(o+=e,o<0||o>=a){if(!this.wrapFocus)return t;o=(o+a)%a}if(this._isFocusable(o))return o}return t}constructor(...t){super(...t),this.wrapFocus=!1,this.ariaLabel=null,this.items=[],this.hostRole="list",this._activeItemIndex=-1,this._firstFocusableIndex=-1,this._lastFocusableIndex=-1,this._hasFocusableItem=!1,this._onItemRegister=t=>{t.stopPropagation();const e=t.detail.item;if(this.items.includes(e))return;const a=[...this.items,e];a.sort(l),this.items=a,this.updateListItems()},this._onItemUnregister=t=>{t.stopPropagation();const e=t.detail.item;this.items.includes(e)&&(this.items=this.items.filter(t=>t!==e),this.updateListItems())},this._onFocusIn=t=>{const e=t.composedPath();for(let a=0;a<this.items.length;a++)if(e.includes(this.items[a]))return void(a!==this._activeItemIndex&&(this._activeItemIndex=a,this._applyActive(!1)))},this._onForward=t=>{this._moveFocus(t,this._stepIndex(this._activeItemIndex,1))},this._onBack=t=>{this._moveFocus(t,this._stepIndex(this._activeItemIndex,-1))},this._onHome=t=>{this._moveFocus(t,this._firstFocusableIndex)},this._onEnd=t=>{this._moveFocus(t,this._lastFocusableIndex)},this._onActivate=t=>{if(!this._isFocusable(this._activeItemIndex))return;t.preventDefault();const e=this.items[this._activeItemIndex];e.activate(),(0,h.r)(this,"ha-list-activated",{index:this._activeItemIndex,item:e})}}}u.styles=(0,i.AH)(d||(d=p`:host{display:block}.base{display:flex;flex-direction:column;gap:var(--ha-list-gap,0);padding:var(--ha-list-padding,0);margin:0;list-style:none}`)),(0,o.Cg)([(0,s.MZ)({type:Boolean,attribute:"wrap-focus"})],u.prototype,"wrapFocus",void 0),(0,o.Cg)([(0,s.MZ)({type:String,attribute:"aria-label",reflect:!0})],u.prototype,"ariaLabel",void 0),u=(0,o.Cg)([(0,s.EM)("ha-list-base")],u)},82e3:function(t,e,a){a.d(e,{Fy:function(){return s},Gk:function(){return l},Hg:function(){return o},Y_:function(){return h},ds:function(){return n},e0:function(){return i},ec:function(){return r}});a(74423),a(18111),a(61701),a(33110),a(3362);const o=t=>t.map(t=>{if("string"!==t.type)return t;switch(t.name){case"username":return Object.assign(Object.assign({},t),{},{autocomplete:"username",autofocus:!0});case"password":return Object.assign(Object.assign({},t),{},{autocomplete:"current-password"});case"code":return Object.assign(Object.assign({},t),{},{autocomplete:"one-time-code",autofocus:!0});default:return t}}),i=(t,e)=>t.callWS({type:"auth/sign_path",path:e}),s=async(t,e,a,o)=>t.callWS({type:"config/auth_provider/homeassistant/create",user_id:e,username:a,password:o}),r=(t,e,a)=>t.callWS({type:"config/auth_provider/homeassistant/change_password",current_password:e,new_password:a}),n=(t,e,a)=>t.callWS({type:"config/auth_provider/homeassistant/admin_change_password",user_id:e,password:a}),l=(t,e,a)=>t.callWS({type:"config/auth_provider/homeassistant/admin_change_username",user_id:e,username:a}),h=(t,e,a)=>t.callWS({type:"auth/delete_all_refresh_tokens",token_type:e,delete_current_token:a})},44249:function(t,e,a){a.d(e,{V:function(){return o}});a(62953);const o=(t,e)=>{const a=new i,o=t.subscribeMessage(t=>e(a.processMessage(t)),{type:"persistent_notification/subscribe"});return()=>{o.then(t=>null==t?void 0:t())}};class i{processMessage(t){if("removed"===t.type)for(const e of Object.keys(t.notifications))delete this.notifications[e];else this.notifications=Object.assign(Object.assign({},this.notifications),t.notifications);return Object.values(this.notifications)}constructor(){this.notifications={}}}},40511:function(t,e,a){a.a(t,async function(t,e){try{a(18111),a(22489),a(20116),a(61701),a(3362),a(62953),a(3296),a(27208),a(48408),a(14603),a(47566),a(98721);var o=a(40445),i=a(5124),s=a(67576),r=a(6412),n=a(22786),l=a(63708),h=a(26218),c=a(76830),d=a(91926),p=a(90248),u=a(2054),f=(a(67094),a(43831),a(14503)),g=t([p,u]);[p,u]=g.then?(await g)():g;let v,m,b,y,w,_,x,k,C,M,$,z,T=t=>t;const A=t=>t.endsWith("/")&&t.length>1?t.slice(0,-1):t;class I extends i.WF{willUpdate(t){if(t.has("route")){const t=`${this.route.prefix}${this.route.path}`;this._activeTab=this.tabs.find(e=>this._isActiveTabPath(e.path,t))}super.willUpdate(t)}render(){var t;const e=this._getTabs(this.tabs,this._activeTab,this.hass.config.components,this.hass.language,this.hass.userData,this.narrow,this.localizeFunc||this.hass.localize);return(0,i.qy)(v||(v=T` <div class="toolbar ${0}"> <slot name="toolbar"> <div class="toolbar-content"> ${0} ${0} ${0} <div id="toolbar-icon"> <slot name="toolbar-icon"></slot> </div> </div> </slot> ${0} </div> <div class="container"> ${0} <div class="content ha-scrollbar" @scroll="${0}"> <slot></slot> ${0} </div> </div> <div id="fab"> <slot name="fab"></slot> </div> `),(0,r.H)({narrow:this.narrow}),this.mainPage||!this.backPath&&null!==(t=history.state)&&void 0!==t&&t.root?(0,i.qy)(m||(m=T` <ha-menu-button .hass="${0}" .narrow="${0}"></ha-menu-button> `),this.hass,this.narrow):this.backPath?(0,i.qy)(b||(b=T` <ha-icon-button-arrow-prev .href="${0}" .hass="${0}"></ha-icon-button-arrow-prev> `),this.backPath,this.hass):(0,i.qy)(y||(y=T` <ha-icon-button-arrow-prev .hass="${0}" @click="${0}"></ha-icon-button-arrow-prev> `),this.hass,this._backTapped),this.narrow||!this.showTabs?(0,i.qy)(w||(w=T`<div class="main-title"> <slot name="header">${0}</slot> </div>`),this.showTabs?"":e[0]):"",this.showTabs&&!this.narrow?(0,i.qy)(_||(_=T`<div id="tabbar">${0}</div>`),e):"",this.showTabs&&this.narrow?(0,i.qy)(x||(x=T`<div id="tabbar" class="bottom-bar">${0}</div>`),e):"",this.pane?(0,i.qy)(k||(k=T`<div class="pane"> <div class="shadow-container"></div> <div class="ha-scrollbar"> <slot name="pane"></slot> </div> </div>`)):i.s6,this._saveScrollPos,this.hasFab?(0,i.qy)(C||(C=T`<div class="fab-bottom-space"></div>`)):i.s6)}_saveScrollPos(t){this._savedScrollPos=t.target.scrollTop}focusContentScroller(){this._content&&(this._content.style.outline="none",this._content.focus({preventScroll:!0}))}_backTapped(){this.backCallback?this.backCallback():(0,d.OE)()}_isActiveTabPath(t,e){try{const a=new URL(t,window.location.origin),o=new URL(e,window.location.origin),i=A(a.pathname),s=A(o.pathname);return!(s!==i&&!s.startsWith(`${i}/`))}catch(a){return e===t||e.startsWith(`${t}/`)}}async _tabClicked(t){const e=(0,c.d)(t);e&&await(0,d.oo)(e,{replace:!0})}static get styles(){return[f.dp,(0,i.AH)(M||(M=T`:host{display:block;height:100%;background-color:var(--primary-background-color)}:host([narrow]){width:100%;position:fixed}.container{display:flex;height:calc(100% - var(--header-height,0px) - var(--safe-area-inset-top,0px))}ha-menu-button{margin-right:24px;margin-inline-end:24px;margin-inline-start:initial}.toolbar{font-size:var(--ha-font-size-xl);height:calc(var(--header-height,0px) + var(--safe-area-inset-top,0px));padding-top:var(--safe-area-inset-top);padding-right:var(--safe-area-inset-right);background-color:var(--sidebar-background-color);font-weight:var(--ha-font-weight-normal);border-bottom:1px solid var(--divider-color);box-sizing:border-box}:host([narrow]) .toolbar{padding-left:var(--safe-area-inset-left)}.toolbar-content{padding:8px 12px;display:flex;align-items:center;height:100%;box-sizing:border-box}:host([narrow]) .toolbar-content{padding:4px}.toolbar a{color:var(--sidebar-text-color);text-decoration:none}.bottom-bar a{width:25%}#tabbar{display:flex;font-size:var(--ha-font-size-m);overflow:hidden}#tabbar>a{overflow:hidden;max-width:45%}#tabbar.bottom-bar{position:absolute;bottom:0;left:0;padding:0 16px;box-sizing:border-box;background-color:var(--sidebar-background-color);border-top:1px solid var(--divider-color);justify-content:space-around;z-index:2;font-size:var(--ha-font-size-s);width:100%;padding-bottom:var(--safe-area-inset-bottom)}#tabbar:not(.bottom-bar){flex:1;justify-content:center}:host(:not([narrow])) #toolbar-icon{min-width:40px}::slotted([slot=toolbar-icon]),ha-icon-button-arrow-prev,ha-menu-button{display:flex;flex-shrink:0;pointer-events:auto;color:var(--sidebar-icon-color)}.main-title{min-width:0;flex:1;max-height:var(--header-height);line-height:var(--ha-line-height-normal);color:var(--sidebar-text-color);margin-inline-start:var(--main-title-margin,var(--ha-space-6))}.narrow .main-title{margin-inline-start:var(--main-title-margin,var(--ha-space-2))}.content{position:relative;width:100%;margin-right:var(--safe-area-inset-right);margin-inline-end:var(--safe-area-inset-right);overflow:auto;-webkit-overflow-scrolling:touch}:host([narrow]) .content{margin-left:var(--safe-area-inset-left);margin-inline-start:var(--safe-area-inset-left)}:host([narrow][show-tabs]) .content{margin-bottom:calc(var(--header-height,0px) + var(--safe-area-inset-bottom,0px))}.content .fab-bottom-space{height:calc(64px + var(--safe-area-inset-bottom,0px))}:host([narrow][show-tabs]) .content .fab-bottom-space{height:calc(80px + var(--safe-area-inset-bottom,0px))}#fab{position:fixed;right:calc(16px + var(--safe-area-inset-right,0px));inset-inline-end:calc(16px + var(--safe-area-inset-right));inset-inline-start:initial;bottom:calc(16px + var(--safe-area-inset-bottom,0px));z-index:1;display:flex;flex-wrap:wrap;justify-content:flex-end;gap:var(--ha-space-2);--ha-button-box-shadow:var(--ha-box-shadow-l)}:host([narrow][show-tabs]) #fab{bottom:calc(84px + var(--safe-area-inset-bottom,0px))}#fab[is-wide]{bottom:24px;right:24px;inset-inline-end:24px;inset-inline-start:initial}.pane{border-right:1px solid var(--divider-color);border-inline-end:1px solid var(--divider-color);border-inline-start:initial;box-sizing:border-box;display:flex;flex:0 0 var(--sidepane-width,250px);width:var(--sidepane-width,250px);flex-direction:column;position:relative}.pane .ha-scrollbar{flex:1}`))]}constructor(...t){super(...t),this.mainPage=!1,this.narrow=!1,this.isWide=!1,this.pane=!1,this.hasFab=!1,this.showTabs=!1,this._getTabs=(0,n.A)((t,e,a,o,s,r,n)=>{const h=t.filter(t=>(0,l.fW)(this.hass,t));if(h.length<2){if(this.showTabs=!1,1===h.length){const t=h[0];return[t.translationKey?n(t.translationKey):t.name]}return[""]}return this.showTabs=!0,h.map(t=>(0,i.qy)($||($=T` <a href="${0}" @click="${0}"> <ha-tab .active="${0}" .narrow="${0}" .name="${0}"> ${0} </ha-tab> </a> `),t.path,this._tabClicked,t.path===(null==e?void 0:e.path),this.narrow,t.translationKey?n(t.translationKey):t.name,t.iconPath?(0,i.qy)(z||(z=T`<ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon>`),t.iconPath):""))})}}(0,o.Cg)([(0,s.MZ)({attribute:!1})],I.prototype,"hass",void 0),(0,o.Cg)([(0,s.MZ)({attribute:!1})],I.prototype,"localizeFunc",void 0),(0,o.Cg)([(0,s.MZ)({type:String,attribute:"back-path"})],I.prototype,"backPath",void 0),(0,o.Cg)([(0,s.MZ)({attribute:!1})],I.prototype,"backCallback",void 0),(0,o.Cg)([(0,s.MZ)({type:Boolean,attribute:"main-page"})],I.prototype,"mainPage",void 0),(0,o.Cg)([(0,s.MZ)({attribute:!1})],I.prototype,"route",void 0),(0,o.Cg)([(0,s.MZ)({attribute:!1})],I.prototype,"tabs",void 0),(0,o.Cg)([(0,s.MZ)({type:Boolean,reflect:!0})],I.prototype,"narrow",void 0),(0,o.Cg)([(0,s.MZ)({type:Boolean,reflect:!0,attribute:"is-wide"})],I.prototype,"isWide",void 0),(0,o.Cg)([(0,s.MZ)({type:Boolean})],I.prototype,"pane",void 0),(0,o.Cg)([(0,s.MZ)({type:Boolean,attribute:"has-fab"})],I.prototype,"hasFab",void 0),(0,o.Cg)([(0,s.MZ)({type:Boolean,attribute:"show-tabs",reflect:!0})],I.prototype,"showTabs",void 0),(0,o.Cg)([(0,s.wk)()],I.prototype,"_activeTab",void 0),(0,o.Cg)([(0,s.P)(".content")],I.prototype,"_content",void 0),(0,o.Cg)([(0,h.a)(".content")],I.prototype,"_savedScrollPos",void 0),(0,o.Cg)([(0,s.Ls)({passive:!0})],I.prototype,"_saveScrollPos",null),I=(0,o.Cg)([(0,s.EM)("hass-tabs-subpage")],I),e()}catch(v){e(v)}})},62452:function(t,e,a){a.a(t,async function(t,e){try{a(3362),a(62953);var o=a(40445),i=a(5124),s=a(67576),r=a(38962),n=a(18350),l=(a(76776),a(65829)),h=a(91485),c=a(82e3),d=a(65063),p=a(14503),u=t([r,n,l,h]);[r,n,l,h]=u.then?(await u)():u;let f,g,v,m,b,y=t=>t;class w extends i.WF{render(){return(0,i.qy)(f||(f=y` <ha-card .header="${0}"> <div class="card-content"> ${0} ${0} <ha-input id="currentPassword" type="password" password-toggle name="currentPassword" .label="${0}" autocomplete="current-password" .value="${0}" @input="${0}" @change="${0}" required></ha-input> ${0} </div> <div class="card-actions"> <ha-button .loading="${0}" @click="${0}" .disabled="${0}">${0}</ha-button> </div> </ha-card> `),this.hass.localize("ui.panel.profile.change_password.header"),this._errorMsg?(0,i.qy)(g||(g=y`<ha-alert alert-type="error">${0}</ha-alert>`),this._errorMsg):"",this._statusMsg?(0,i.qy)(v||(v=y`<ha-alert alert-type="success">${0}</ha-alert>`),this._statusMsg):"",this.hass.localize("ui.panel.profile.change_password.current_password"),this._currentPassword,this._currentPasswordChanged,this._currentPasswordChanged,this._currentPassword?(0,i.qy)(m||(m=y`<ha-input type="password" password-toggle .label="${0}" name="password" autocomplete="new-password" .value="${0}" @input="${0}" @change="${0}" required autoValidate></ha-input> <ha-input type="password" password-toggle .label="${0}" name="passwordConfirm" autocomplete="new-password" .value="${0}" @input="${0}" @change="${0}" required autoValidate></ha-input>`),this.hass.localize("ui.panel.profile.change_password.new_password"),this._password,this._newPasswordChanged,this._newPasswordChanged,this.hass.localize("ui.panel.profile.change_password.confirm_new_password"),this._passwordConfirm,this._newPasswordConfirmChanged,this._newPasswordConfirmChanged):"",this._loading,this._changePassword,!this._passwordConfirm,this.hass.localize("ui.panel.profile.change_password.submit"))}_currentPasswordChanged(t){this._currentPassword=t.target.value}_newPasswordChanged(t){this._password=t.target.value}_newPasswordConfirmChanged(t){this._passwordConfirm=t.target.value}firstUpdated(t){super.firstUpdated(t),this.addEventListener("keypress",t=>{this._statusMsg=void 0,"Enter"===t.key&&this._changePassword()})}async _changePassword(){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.ec)(this.hass,this._currentPassword,this._password)}catch(t){return void(this._errorMsg=t.message)}finally{this._loading=!1}if(this._statusMsg=this.hass.localize("ui.panel.profile.change_password.success"),this.refreshTokens&&await(0,d.dk)(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.Y_)(this.hass)}catch(t){await(0,d.showAlertDialog)(this,{title:this.hass.localize("ui.panel.profile.change_password.delete_failed"),text:t.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")}static get styles(){return[p.RF,(0,i.AH)(b||(b=y`#currentPassword{margin-top:0}.card-actions{display:flex;justify-content:flex-end}`))]}constructor(...t){super(...t),this._loading=!1,this._currentPassword="",this._password="",this._passwordConfirm=""}}(0,o.Cg)([(0,s.MZ)({attribute:!1})],w.prototype,"hass",void 0),(0,o.Cg)([(0,s.wk)()],w.prototype,"_loading",void 0),(0,o.Cg)([(0,s.wk)()],w.prototype,"_statusMsg",void 0),(0,o.Cg)([(0,s.wk)()],w.prototype,"_errorMsg",void 0),(0,o.Cg)([(0,s.wk)()],w.prototype,"_currentPassword",void 0),(0,o.Cg)([(0,s.wk)()],w.prototype,"_password",void 0),(0,o.Cg)([(0,s.wk)()],w.prototype,"_passwordConfirm",void 0),(0,o.Cg)([(0,s.MZ)({attribute:!1})],w.prototype,"refreshTokens",void 0),w=(0,o.Cg)([(0,s.EM)("ha-change-password-card")],w),e()}catch(f){e(f)}})},60463:function(t,e,a){a.a(t,async function(t,e){try{a(94490),a(18111),a(22489),a(61701),a(3362),a(62953);var o=a(40445),i=a(5124),s=a(67576),r=a(22786),n=a(98975),l=a(1087),h=a(18350),c=(a(76776),a(26300)),d=(a(8034),a(65063)),p=a(14503),u=a(90204),f=t([h,c,n]);[h,c,n]=f.then?(await f)():f;let g,v,m,b,y=t=>t;const w="M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z";class _ extends i.WF{render(){const t=this._accessTokens(this.refreshTokens);return(0,i.qy)(g||(g=y` <ha-card .header="${0}"> <div class="card-content"> ${0} <a href="https://developers.home-assistant.io/docs/auth_api/#making-authenticated-requests" target="_blank" rel="noreferrer"> ${0} </a> ${0} </div> <div class="card-actions"> <ha-button @click="${0}"> ${0} </ha-button> </div> </ha-card> `),this.hass.localize("ui.panel.profile.long_lived_access_tokens.header"),this.hass.localize("ui.panel.profile.long_lived_access_tokens.description"),this.hass.localize("ui.panel.profile.long_lived_access_tokens.learn_auth_requests"),t.length?t.map(t=>(0,i.qy)(m||(m=y`<ha-settings-row two-line> <span slot="heading">${0}</span> <div slot="description"> ${0} </div> <ha-icon-button .token="${0}" .disabled="${0}" .label="${0}" .path="${0}" @click="${0}"></ha-icon-button> </ha-settings-row>`),t.client_name,this.hass.localize("ui.panel.profile.long_lived_access_tokens.created",{date:(0,n.K)(new Date(t.created_at),this.hass.locale)}),t,t.is_current,this.hass.localize("ui.common.delete"),w,this._deleteToken)):(0,i.qy)(v||(v=y`<p> ${0} </p>`),this.hass.localize("ui.panel.profile.long_lived_access_tokens.empty_state")),this._createToken,this.hass.localize("ui.panel.profile.long_lived_access_tokens.create"))}_createToken(){const t=this._accessTokens(this.refreshTokens);(0,u.t)(this,{createdCallback:()=>(0,l.r)(this,"hass-refresh-tokens"),existingNames:t.map(t=>t.client_name).filter(t=>Boolean(t))})}async _deleteToken(t){const e=t.currentTarget.token;if(await(0,d.dk)(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:e.client_name}),confirmText:this.hass.localize("ui.common.delete"),destructive:!0}))try{await this.hass.callWS({type:"auth/delete_refresh_token",refresh_token_id:e.id}),(0,l.r)(this,"hass-refresh-tokens")}catch(a){await(0,d.showAlertDialog)(this,{title:this.hass.localize("ui.panel.profile.long_lived_access_tokens.delete_failed"),text:a.message})}}static get styles(){return[p.RF,(0,i.AH)(b||(b=y`ha-settings-row{padding:0}a{color:var(--primary-color)}ha-icon-button{color:var(--primary-text-color)}.card-actions{display:flex;justify-content:flex-end}`))]}constructor(...t){super(...t),this._accessTokens=(0,r.A)(t=>(null!=t?t:[]).filter(t=>"long_lived_access_token"===t.type).reverse())}}(0,o.Cg)([(0,s.MZ)({attribute:!1})],_.prototype,"hass",void 0),(0,o.Cg)([(0,s.MZ)({attribute:!1})],_.prototype,"refreshTokens",void 0),_=(0,o.Cg)([(0,s.EM)("ha-long-lived-access-tokens-card")],_),e()}catch(g){e(g)}})},52592:function(t,e,a){a.a(t,async function(t,e){try{a(18111),a(61701),a(3362);var o=a(40445),i=a(5124),s=a(67576),r=a(1087),n=(a(76776),a(18350)),l=a(65063),h=a(21372),c=t([n]);n=(c.then?(await c)():c)[0];let d,p,u,f=t=>t;class g extends i.WF{render(){return(0,i.qy)(d||(d=f` <ha-card .header="${0}"> ${0} </ha-card> `),this.hass.localize("ui.panel.profile.mfa.header"),this.mfaModules.map(t=>(0,i.qy)(p||(p=f`<ha-settings-row two-line> <span slot="heading">${0}</span> <span slot="description">${0}</span> <ha-button size="small" appearance="plain" .module="${0}" @click="${0}">${0}</ha-button> </ha-settings-row>`),t.name,t.id,t,t.enabled?this._disable:this._enable,this.hass.localize("ui.panel.profile.mfa."+(t.enabled?"disable":"enable")))))}_enable(t){(0,h.d)(this,{mfaModuleId:t.currentTarget.module.id,dialogClosedCallback:()=>this._refreshCurrentUser()})}async _disable(t){const e=t.currentTarget.module;if(!(await(0,l.dk)(this,{text:this.hass.localize("ui.panel.profile.mfa.confirm_disable",{name:e.name})})))return;const a=e.id;this.hass.callWS({type:"auth/depose_mfa",mfa_module_id:a}).then(()=>{this._refreshCurrentUser()})}_refreshCurrentUser(){(0,r.r)(this,"hass-refresh-current-user")}}g.styles=(0,i.AH)(u||(u=f`ha-button{margin-right:-.57em;margin-inline-end:-.57em;margin-inline-start:initial}`)),(0,o.Cg)([(0,s.MZ)({attribute:!1})],g.prototype,"hass",void 0),(0,o.Cg)([(0,s.MZ)({attribute:!1})],g.prototype,"mfaModules",void 0),g=(0,o.Cg)([(0,s.EM)("ha-mfa-modules-card")],g),e()}catch(d){e(d)}})},77867:function(t,e,a){a.a(t,async function(t,o){try{a.r(e);a(18111),a(13579),a(3362),a(62953);var i=a(40445),s=a(5124),r=a(67576),n=a(40511),l=a(62337),h=a(14503),c=a(62452),d=a(60463),p=a(52592),u=a(20938),f=t([n,c,d,p,u]);[n,c,d,p,u]=f.then?(await f)():f;let g,v,m,b=t=>t;class y extends s.WF{connectedCallback(){super.connectedCallback(),this._refreshRefreshTokens()}firstUpdated(){this._refreshTokens||this._refreshRefreshTokens()}render(){return(0,s.qy)(g||(g=b` <hass-tabs-subpage main-page .hass="${0}" .narrow="${0}" .tabs="${0}" .route="${0}"> <div slot="title">${0}</div> <div class="content"> ${0} <ha-mfa-modules-card .hass="${0}" .mfaModules="${0}"></ha-mfa-modules-card> <ha-refresh-tokens-card .hass="${0}" .refreshTokens="${0}" @hass-refresh-tokens="${0}"></ha-refresh-tokens-card> <ha-long-lived-access-tokens-card .hass="${0}" .refreshTokens="${0}" @hass-refresh-tokens="${0}"></ha-long-lived-access-tokens-card> </div> </hass-tabs-subpage> `),this.hass,this.narrow,l.profileSections,this.route,this.hass.localize("panel.profile"),this.hass.user.credentials.some(t=>"homeassistant"===t.auth_provider_type)?(0,s.qy)(v||(v=b` <ha-change-password-card .refreshTokens="${0}" @hass-refresh-tokens="${0}" .hass="${0}"></ha-change-password-card> `),this._refreshTokens,this._refreshRefreshTokens,this.hass):"",this.hass,this.hass.user.mfa_modules,this.hass,this._refreshTokens,this._refreshRefreshTokens,this.hass,this._refreshTokens,this._refreshRefreshTokens)}async _refreshRefreshTokens(){this.hass&&(this._refreshTokens=await this.hass.callWS({type:"auth/refresh_tokens"}))}static get styles(){return[h.RF,(0,s.AH)(m||(m=b`:host{-ms-user-select:initial;-webkit-user-select:initial;-moz-user-select:initial}.content{display:block;max-width:600px;margin:0 auto;padding-bottom:var(--safe-area-inset-bottom)}.content>*{display:block;margin:24px 0}.promo-advanced{text-align:center;color:var(--secondary-text-color)}`))]}constructor(...t){super(...t),this.narrow=!1}}(0,i.Cg)([(0,r.MZ)({attribute:!1})],y.prototype,"hass",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean})],y.prototype,"narrow",void 0),(0,i.Cg)([(0,r.wk)()],y.prototype,"_refreshTokens",void 0),(0,i.Cg)([(0,r.MZ)({attribute:!1})],y.prototype,"route",void 0),y=(0,i.Cg)([(0,r.EM)("ha-profile-section-security")],y),o()}catch(g){o(g)}})},20938:function(t,e,a){a.a(t,async function(t,e){try{a(26910),a(18111),a(22489),a(61701),a(3362),a(62953);var o=a(40445),i=a(5124),s=a(67576),r=a(22786),n=a(98975),l=a(1087),h=a(18350),c=(a(76776),a(29823)),d=(a(70947),a(26300)),p=(a(28170),a(50723),a(82e3)),u=a(65063),f=a(14503),g=t([h,c,d,n]);[h,c,d,n]=g.then?(await g)():g;let v,m,b,y,w=t=>t;const _="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",x="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",k="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",C="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",M="M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z",$="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",z="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",T="https://home-assistant.io/iOS",A="https://home-assistant.io/android",I=(t,e)=>{const a=t.last_used_at?new Date(t.last_used_at):0,o=e.last_used_at?new Date(e.last_used_at):0;return a<o?1:a>o?-1:0};class H extends i.WF{render(){const t=this.refreshTokens?this._refreshTokens(this.refreshTokens):[];return(0,i.qy)(v||(v=w` <ha-card .header="${0}"> <div class="card-content"> ${0} <ha-list-base> ${0} </ha-list-base> </div> <div class="card-actions"> <ha-button variant="danger" appearance="filled" size="small" @click="${0}"> ${0} </ha-button> </div> </ha-card> `),this.hass.localize("ui.panel.profile.refresh_tokens.header"),this.hass.localize("ui.panel.profile.refresh_tokens.description"),t.length?t.map(t=>(0,i.qy)(m||(m=w` <ha-list-item-base> <ha-svg-icon slot="start" .path="${0}"></ha-svg-icon> <span slot="headline" class="primary"> ${0} </span> <div slot="supporting-text"> ${0} </div> <div slot="supporting-text"> ${0} </div> <div slot="supporting-text"> ${0} </div> <ha-dropdown slot="end" @wa-select="${0}"> <ha-icon-button slot="trigger" .label="${0}" .path="${0}"></ha-icon-button> <ha-dropdown-item .token="${0}" .action="${0}"> <ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon> ${0} </ha-dropdown-item> <ha-dropdown-item .token="${0}" .action="${0}" variant="danger" .disabled="${0}"> <ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon> ${0} </ha-dropdown-item> </ha-dropdown> </ha-list-item-base> `),t.client_id===T?x:t.client_id===A?_:z,this._formatTokenName(t),this.hass.localize("ui.panel.profile.refresh_tokens.created_at",{date:(0,n.K)(new Date(t.created_at),this.hass.locale)}),t.is_current?(0,i.qy)(b||(b=w` <span class="current-session"> <span class="dot"></span> ${0} </span> `),this.hass.localize("ui.panel.profile.refresh_tokens.current_session")):t.last_used_at?this.hass.localize("ui.panel.profile.refresh_tokens.last_used",{date:(0,n.K)(new Date(t.last_used_at),this.hass.locale),location:t.last_used_ip}):this.hass.localize("ui.panel.profile.refresh_tokens.not_used"),t.expire_at?this.hass.localize("ui.panel.profile.refresh_tokens.expires_in",{date:(0,n.K)(new Date(t.expire_at),this.hass.locale)}):this.hass.localize("ui.panel.profile.refresh_tokens.never_expires"),this._handleDropdownSelect,this.hass.localize("ui.common.menu"),$,t,"toggle_expiration",t.expire_at?C:k,t.expire_at?this.hass.localize("ui.panel.profile.refresh_tokens.disable_token_expiration"):this.hass.localize("ui.panel.profile.refresh_tokens.enable_token_expiration"),t,"delete_token",t.is_current,M,this.hass.localize("ui.common.delete"))):i.s6,this._deleteAllTokens,this.hass.localize("ui.panel.profile.refresh_tokens.delete_all_tokens"))}_handleDropdownSelect(t){"toggle_expiration"===t.detail.item.action?this._toggleTokenExpiration(t.detail.item.token):"delete_token"===t.detail.item.action&&this._deleteToken(t.detail.item.token)}async _toggleTokenExpiration(t){const e=!t.expire_at;if(e||await(0,u.dk)(this,{title:this.hass.localize("ui.panel.profile.refresh_tokens.confirm_disable_token_expiration_title"),text:this.hass.localize("ui.panel.profile.refresh_tokens.confirm_disable_token_expiration_text",{name:this._formatTokenName(t)}),confirmText:this.hass.localize("ui.common.disable"),destructive:!0}))try{await this.hass.callWS({type:"auth/refresh_token_set_expiry",refresh_token_id:t.id,enable_expiry:e}),(0,l.r)(this,"hass-refresh-tokens")}catch(a){const t="object"==typeof a&&null!==a&&"message"in a?a.message:String(a);await(0,u.showAlertDialog)(this,{title:this.hass.localize(`ui.panel.profile.refresh_tokens.${e?"enable":"disable"}_expiration_failed`),text:t})}}async _deleteToken(t){if(await(0,u.dk)(this,{title:this.hass.localize("ui.panel.profile.refresh_tokens.confirm_delete_title"),text:this.hass.localize("ui.panel.profile.refresh_tokens.confirm_delete_text",{name:this._formatTokenName(t)}),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.r)(this,"hass-refresh-tokens")}catch(e){await(0,u.showAlertDialog)(this,{title:this.hass.localize("ui.panel.profile.refresh_tokens.delete_failed"),text:e.message})}}async _deleteAllTokens(){if(await(0,u.dk)(this,{title:this.hass.localize("ui.panel.profile.refresh_tokens.confirm_delete_all_title"),text:this.hass.localize("ui.panel.profile.refresh_tokens.confirm_delete_all"),confirmText:this.hass.localize("ui.common.delete_all"),destructive:!0}))try{await(0,p.Y_)(this.hass,"normal",!1),(0,l.r)(this,"hass-refresh-tokens")}catch(t){await(0,u.showAlertDialog)(this,{title:this.hass.localize("ui.panel.profile.refresh_tokens.delete_failed"),text:t.message})}}static get styles(){return[f.RF,(0,i.AH)(y||(y=w`ha-list-item-base{--ha-row-item-padding-inline:0}ha-icon-button{color:var(--primary-text-color)}ha-list-item-base .dot{display:inline-block;width:8px;height:8px;background-color:var(--success-color);border-radius:var(--ha-border-radius-circle);margin-right:6px}`))]}constructor(...t){super(...t),this._refreshTokens=(0,r.A)(t=>t.filter(t=>"normal"===t.type).sort(I)),this._formatTokenName=t=>t.client_id===T?this.hass.localize("ui.panel.profile.refresh_tokens.ios_app"):t.client_id===A?this.hass.localize("ui.panel.profile.refresh_tokens.android_app"):t.client_name||t.client_id}}(0,o.Cg)([(0,s.MZ)({attribute:!1})],H.prototype,"hass",void 0),(0,o.Cg)([(0,s.MZ)({attribute:!1})],H.prototype,"refreshTokens",void 0),H=(0,o.Cg)([(0,s.EM)("ha-refresh-tokens-card")],H),e()}catch(v){e(v)}})},21372:function(t,e,a){a.d(e,{d:function(){return s}});a(3362),a(62953);var o=a(1087);const i=()=>Promise.all([a.e(98470),a.e(54025),a.e(53480),a.e(54418)]).then(a.bind(a,15056)),s=(t,e)=>{(0,o.r)(t,"show-dialog",{dialogTag:"ha-mfa-module-setup-flow",dialogImport:i,dialogParams:e})}},90204:function(t,e,a){a.d(e,{t:function(){return i}});a(3362),a(62953);var o=a(1087);const i=(t,e)=>{(0,o.r)(t,"show-dialog",{dialogTag:"ha-long-lived-access-token-dialog",dialogImport:()=>a.e(99171).then(a.bind(a,72206)),dialogParams:e})}},69235:function(t,e,a){a.a(t,async function(t,e){try{a(3362),a(62953);"function"!=typeof window.ResizeObserver&&(window.ResizeObserver=(await a.e(71055).then(a.bind(a,52370))).default),e()}catch(o){e(o)}},1)},14503:function(t,e,a){a.d(e,{RF:function(){return p},dp:function(){return g},kO:function(){return f},nA:function(){return u},og:function(){return d}});var o=a(5124);let i,s,r,n,l,h,c=t=>t;const d=(0,o.AH)(i||(i=c`button.link{background:0 0;color:inherit;border:none;padding:0;font:inherit;text-align:left;text-decoration:underline;cursor:pointer;outline:0}`)),p=(0,o.AH)(s||(s=c`:host{font-family:var(--ha-font-family-body);-webkit-font-smoothing:var(--ha-font-smoothing);-moz-osx-font-smoothing:var(--ha-moz-osx-font-smoothing);font-size:var(--ha-font-size-m);font-weight:var(--ha-font-weight-normal);line-height:var(--ha-line-height-normal)}app-header div[sticky]{height:48px}app-toolbar [main-title]{margin-left:20px;margin-inline-start:20px;margin-inline-end:initial}.header{transition:box-shadow .2s linear,width var(--ha-animation-duration-normal) ease,padding-left var(--ha-animation-duration-normal) ease,padding-right var(--ha-animation-duration-normal) ease}@media (prefers-reduced-motion:reduce){.header{transition:box-shadow .2s linear}}h1{font-family:var(--ha-font-family-heading);-webkit-font-smoothing:var(--ha-font-smoothing);-moz-osx-font-smoothing:var(--ha-moz-osx-font-smoothing);font-size:var(--ha-font-size-2xl);font-weight:var(--ha-font-weight-normal);line-height:var(--ha-line-height-condensed)}h2{font-family:var(--ha-font-family-body);-webkit-font-smoothing:var(--ha-font-smoothing);-moz-osx-font-smoothing:var(--ha-moz-osx-font-smoothing);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:var(--ha-font-size-xl);font-weight:var(--ha-font-weight-medium);line-height:var(--ha-line-height-normal)}h3{font-family:var(--ha-font-family-body);-webkit-font-smoothing:var(--ha-font-smoothing);-moz-osx-font-smoothing:var(--ha-moz-osx-font-smoothing);font-size:var(--ha-font-size-l);font-weight:var(--ha-font-weight-normal);line-height:var(--ha-line-height-normal)}a{color:var(--primary-color)}.secondary{color:var(--secondary-text-color)}.error{color:var(--error-color)}.warning{color:var(--error-color)}${0} .card-actions a{text-decoration:none}.card-actions .warning{--mdc-theme-primary:var(--error-color)}.layout.horizontal,.layout.vertical{display:flex}.layout.inline{display:inline-flex}.layout.horizontal{flex-direction:row}.layout.vertical{flex-direction:column}.layout.wrap{flex-wrap:wrap}.layout.no-wrap{flex-wrap:nowrap}.layout.center,.layout.center-center{align-items:center}.layout.bottom{align-items:flex-end}.layout.center-center,.layout.center-justified{justify-content:center}.flex{flex:1;flex-basis:0.000000001px}.flex-auto{flex:1 1 auto}.flex-none{flex:none}.layout.justified{justify-content:space-between}`),d),u=(0,o.AH)(r||(r=c`ha-adaptive-dialog,ha-dialog{--mdc-dialog-min-width:400px;--mdc-dialog-max-width:600px;--mdc-dialog-max-width:min(600px, 95vw);--justify-action-buttons:space-between;--dialog-container-padding:var(--safe-area-inset-top, 0) var(--safe-area-inset-right, 0) var(--safe-area-inset-bottom, 0) var(--safe-area-inset-left, 0);--dialog-surface-padding:0px}ha-adaptive-dialog .form,ha-dialog .form{color:var(--primary-text-color)}a{color:var(--primary-color)}@media all and (max-width:450px),all and (max-height:500px){ha-adaptive-dialog,ha-dialog{--mdc-dialog-min-width:100vw;--mdc-dialog-max-width:100vw;--mdc-dialog-min-height:100vh;--mdc-dialog-min-height:100svh;--mdc-dialog-max-height:100vh;--mdc-dialog-max-height:100svh;--dialog-container-padding:0px;--dialog-surface-padding:var(--safe-area-inset-top, 0) var(--safe-area-inset-right, 0) var(--safe-area-inset-bottom, 0) var(--safe-area-inset-left, 0);--vertical-align-dialog:flex-end}ha-dialog{--ha-dialog-border-radius:var(--ha-border-radius-square)}}.error{color:var(--error-color)}`)),f=(0,o.AH)(n||(n=c`ha-adaptive-dialog,ha-dialog{--vertical-align-dialog:flex-start;--dialog-surface-margin-top:var(--ha-space-10);--mdc-dialog-max-height:calc(
      100vh - var(--dialog-surface-margin-top) - var(--ha-space-2) - var(
          --safe-area-inset-y,
          0px
        )
    );--mdc-dialog-max-height:calc(
      100svh - var(--dialog-surface-margin-top) - var(--ha-space-2) - var(
          --safe-area-inset-y,
          0px
        )
    );--ha-dialog-max-height:calc(
      100vh - var(--dialog-surface-margin-top) - var(--ha-space-2) - var(
          --safe-area-inset-y,
          0px
        )
    );--ha-dialog-max-height:calc(
      100svh - var(--dialog-surface-margin-top) - var(--ha-space-2) - var(
          --safe-area-inset-y,
          0px
        )
    )}@media all and (max-width:450px),all and (max-height:500px){ha-adaptive-dialog,ha-dialog{--dialog-surface-margin-top:0px;--mdc-dialog-min-height:100vh;--mdc-dialog-min-height:100svh;--mdc-dialog-max-height:100vh;--mdc-dialog-max-height:100svh;--ha-dialog-max-height:100vh;--ha-dialog-max-height:100svh}}`)),g=(0,o.AH)(l||(l=c`.ha-scrollbar::-webkit-scrollbar{width:.4rem;height:.4rem}.ha-scrollbar::-webkit-scrollbar-thumb{border-radius:var(--ha-border-radius-sm);background:var(--scrollbar-thumb-color)}.ha-scrollbar{overflow-y:auto;scrollbar-color:var(--scrollbar-thumb-color) transparent;scrollbar-width:thin}`));(0,o.AH)(h||(h=c`body{background-color:var(--primary-background-color);color:var(--primary-text-color);height:calc(100vh - 32px);width:100vw}`))}}]);