iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
67 lines • 75.6 kB
JavaScript
export const __rspack_esm_id=99100;export const __rspack_esm_ids=[99100];export const __webpack_modules__={95747(e,t,a){a.a(e,async function(e,o){try{a.d(t,{CL:()=>b,GH:()=>w,ZS:()=>m,aQ:()=>u,r6:()=>d,yg:()=>y});var i=a(74487),r=a(22786),s=a(72487),n=a(30162),h=a(8480),l=a(69543),c=e([i,h,s,n]);[i,h,s,n]=c.then?(await c)():c;const d=(e,t,a)=>p(t,a.time_zone).format(e),p=(0,r.A)((e,t)=>new Intl.DateTimeFormat(e.language,{year:"numeric",month:"long",day:"numeric",hour:(0,l.J)(e)?"numeric":"2-digit",minute:"2-digit",hourCycle:(0,l.J)(e)?"h12":"h23",timeZone:(0,h.wj)(e.time_zone,t)})),u=((0,r.A)(()=>new Intl.DateTimeFormat(void 0,{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"})),(e,t,a)=>g(t,a.time_zone).format(e)),g=(0,r.A)((e,t)=>new Intl.DateTimeFormat(e.language,{year:"numeric",month:"short",day:"numeric",hour:(0,l.J)(e)?"numeric":"2-digit",minute:"2-digit",hourCycle:(0,l.J)(e)?"h12":"h23",timeZone:(0,h.wj)(e.time_zone,t)})),m=(e,t,a)=>v(t,a.time_zone).format(e),v=(0,r.A)((e,t)=>new Intl.DateTimeFormat(e.language,{month:"short",day:"numeric",hour:(0,l.J)(e)?"numeric":"2-digit",minute:"2-digit",hourCycle:(0,l.J)(e)?"h12":"h23",timeZone:(0,h.wj)(e.time_zone,t)})),b=(e,t,a)=>(new Date).getFullYear()===e.getFullYear()?m(e,t,a):u(e,t,a),y=(e,t,a)=>f(t,a.time_zone).format(e),f=(0,r.A)((e,t)=>new Intl.DateTimeFormat(e.language,{year:"numeric",month:"long",day:"numeric",hour:(0,l.J)(e)?"numeric":"2-digit",minute:"2-digit",second:"2-digit",hourCycle:(0,l.J)(e)?"h12":"h23",timeZone:(0,h.wj)(e.time_zone,t)})),w=(e,t,a)=>`${(0,s.zB)(e,t,a)}, ${(0,n.fU)(e,t,a)}`;o()}catch(e){o(e)}})},8480(e,t,a){a.a(e,async function(e,o){try{a.d(t,{wj:()=>d});var i=a(74487),r=a(29079),s=a(46927),n=e([i]);i=(n.then?(await n)():n)[0];const h=Intl.DateTimeFormat?.().resolvedOptions?.().timeZone,l=h&&("UTC"===h||"Etc/UTC"===h||h in r)?h:void 0,c=l??"UTC",d=(e,t)=>e===s.Wj.local&&l?c:t;o()}catch(e){o(e)}})},69543(e,t,a){a.d(t,{J:()=>r});a(74423);var o=a(22786),i=a(46927);const r=(0,o.A)(e=>{if(e.time_format===i.Hg.language||e.time_format===i.Hg.system){const t=e.time_format===i.Hg.language?e.language:void 0;return new Date("January 1, 2023 22:00:00").toLocaleString(t).includes("10")}return e.time_format===i.Hg.am_pm})},93421(e,t,a){a.d(t,{IW:()=>c,dH:()=>l,fI:()=>h});a(44114);var o=a(35211),i=a(22792),r=a(32172);const s=(e,t)=>{let a=e;for(const e of t){if(null==a)return;a=a[e]}return a},n=(e,t,a)=>{const i=(0,r.p)({transformer:function(e){return a.call(this,e)},watch:t?[t]:[]}),s=(0,o.Fg)({context:e,subscribe:!0});return(e,t)=>{i(e,t),s(e,t)}},h=e=>n(i.iN,e.entityIdPath[0],function(t){const a=s(this,e.entityIdPath);return"string"==typeof a?t?.[a]:void 0}),l=e=>n(i.X1,e.entityIdPath[0],function(t){const a=s(this,e.entityIdPath);return"string"==typeof a?t?.[a]:void 0}),c=()=>n(i.D5,void 0,({localize:e})=>e)},32172(e,t,a){a.d(t,{p:()=>o});a(18111),a(7588),a(45367),a(92731),a(17642),a(58004),a(33853),a(45876),a(32475),a(15024),a(31698);function o(e){return(t,a)=>{if("object"==typeof a)throw new Error("This decorator does not support this compilation type.");const o=String(a),i=t;if(i._transformers){if(!i.hasOwnProperty("_transformers")){const e=i._transformers;i._transformers=new Map,e.forEach((e,t)=>i._transformers.set(t,e))}}else{i._transformers=new Map,i._watching=new Map;const e=i.willUpdate;i.willUpdate=function(t){e.call(this,t);const a=new Set;t.forEach((e,t)=>{const o=this._watching.get(t);void 0!==o&&o.forEach(e=>a.add(e))}),a.forEach(e=>{this[e]=this[`__original_${String(e)}`]})}}i._transformers.set(a,e.transformer),e.watch&&e.watch.forEach(e=>{let t=i._watching.get(e);t||(t=new Set,i._watching.set(e,t)),t.add(a)});const r=Object.getOwnPropertyDescriptor(t,a);let s;if(void 0===r)s={get(){return this[`__transform_${o}`]},set(e){const t=this[`__transform_${o}`],a=this._transformers.get(o);this[`__transform_${o}`]=a?a.call(this,e):e,this[`__original_${o}`]=e,this.requestUpdate(o,t)},configurable:!0,enumerable:!0};else{const e=r.set;s={...r,set(t){const a=this[`__transform_${o}`],i=this._transformers.get(o);this[`__transform_${o}`]=i?i.call(this,t):t,this[`__original_${o}`]=t,this.requestUpdate(o,a),e?.call(this,t)}}}Object.defineProperty(t,a,s)}}},86198(e,t,a){a.a(e,async function(e,o){try{a.d(t,{T:()=>n});var i=a(74487),r=a(22786),s=e([i]);i=(s.then?(await s)():s)[0];const n=(e,t)=>{try{return h(t)?.of(e)??e}catch{return e}},h=(0,r.A)(e=>new Intl.DisplayNames(e.language,{type:"language",fallback:"code"}));o()}catch(e){o(e)}})},20058(e,t,a){a.a(e,async function(e,o){try{a.d(t,{QL:()=>d,ZQ:()=>p,ZV:()=>c,ty:()=>h,x:()=>n});var i=a(74487),r=(a(74423),a(18111),a(61701),a(46927)),s=e([i]);i=(s.then?(await s)():s)[0];const n=e=>h(e.attributes),h=(e,t)=>!!e.unit_of_measurement||!!e.state_class||(t||[]).includes(e.device_class||""),l=e=>{switch(e.number_format){case r.jG.comma_decimal:return["en-US","en"];case r.jG.decimal_comma:return["de","es","it"];case r.jG.space_comma:return["fr","sv","cs"];case r.jG.quote_decimal:return["de-CH"];case r.jG.system:return;default:return e.language}},c=(e,t,a)=>d(e,t,a).map(e=>e.value).join(""),d=(e,t,a)=>{const o=t?l(t):void 0;return t?.number_format===r.jG.none||Number.isNaN(Number(e))?Number.isNaN(Number(e))||""===e||t?.number_format!==r.jG.none?[{type:"literal",value:e}]:new Intl.NumberFormat("en-US",u(e,{...a,useGrouping:!1})).formatToParts(Number(e)):new Intl.NumberFormat(o,u(e,a)).formatToParts(Number(e))},p=(e,t)=>{const a=t?.display_precision;return null!=a?{maximumFractionDigits:a,minimumFractionDigits:a}:Number.isInteger(Number(e?.attributes?.step))&&Number.isInteger(Number(e?.state))?{maximumFractionDigits:0}:void 0},u=(e,t)=>{const a={maximumFractionDigits:2,...t};if("string"!=typeof e)return a;if(!t||void 0===t.minimumFractionDigits&&void 0===t.maximumFractionDigits){const t=e.indexOf(".")>-1?e.split(".")[1].length:0;a.minimumFractionDigits=t,a.maximumFractionDigits=t}return a};o()}catch(e){o(e)}})},31290(e,t,a){a.d(t,{n:()=>o});const o=e=>e.replace(/^_*(.)|_+(.)/g,(e,t,a)=>t?t.toUpperCase():" "+a.toUpperCase())},38962(e,t,a){a.a(e,async function(e,o){try{a.r(t);var i=a(62826),r=a(5124),s=a(22441),n=a(6412),h=a(93421),l=a(1087),c=a(26300),d=(a(67094),e([c]));c=(d.then?(await d)():d)[0];const p="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",u={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 g extends r.WF{render(){return r.qy` <div class="issue-type ${(0,n.H)({[this.alertType]:!0})}" role="alert"> <div class="icon ${this.title?"":"no-title"}"> <slot name="icon"> <ha-svg-icon .path="${u[this.alertType]}"></ha-svg-icon> </slot> </div> <div class="${(0,n.H)({content:!0,narrow:this.narrow})}"> <div class="main-content"> ${this.title?r.qy`<div class="title">${this.title}</div>`:r.s6} <slot></slot> </div> <div class="action"> <slot name="action"> ${this.dismissable?r.qy`<ha-icon-button @click="${this._dismissClicked}" .label="${this._localize?.("ui.common.dismiss_alert")}" .path="${p}"></ha-icon-button>`:r.s6} </slot> </div> </div> </div> `}_dismissClicked(){(0,l.r)(this,"alert-dismissed-clicked")}constructor(...e){super(...e),this.title="",this.alertType="info",this.dismissable=!1,this.narrow=!1}}g.styles=r.AH`.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,s.MZ)()],g.prototype,"title",void 0),(0,i.Cg)([(0,s.MZ)({attribute:"alert-type"})],g.prototype,"alertType",void 0),(0,i.Cg)([(0,s.MZ)({type:Boolean})],g.prototype,"dismissable",void 0),(0,i.Cg)([(0,s.wk)(),(0,h.IW)()],g.prototype,"_localize",void 0),(0,i.Cg)([(0,s.MZ)({type:Boolean})],g.prototype,"narrow",void 0),g=(0,i.Cg)([(0,s.EM)("ha-alert")],g),o()}catch(e){o(e)}})},76776(e,t,a){var o=a(62826),i=a(5124),r=a(22441);class s extends i.WF{render(){return i.qy` ${this.header?i.qy`<h1 class="card-header">${this.header}</h1>`:i.s6} <slot></slot> `}constructor(...e){super(...e),this.raised=!1}}s.styles=i.AH`: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,r.MZ)()],s.prototype,"header",void 0),(0,o.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],s.prototype,"raised",void 0),s=(0,o.Cg)([(0,r.EM)("ha-card")],s)},9503(e,t,a){var o=a(62826),i=a(97577),r=a(5124),s=a(22441);class n extends i.A{get value(){return this._value??null}set value(e){this._value=e}static get styles(){return[i.A.styles,r.AH`:host{--wa-form-control-toggle-size:var(--ha-checkbox-size, 20px);--wa-form-control-border-color:var(
--ha-checkbox-border-color,
var(--ha-color-border-neutral-normal)
);--wa-form-control-background-color:var(
--ha-checkbox-background-color,
var(--wa-form-control-background-color)
);--checked-icon-color:var(
--ha-checkbox-checked-icon-color,
var(--wa-color-brand-on-loud)
);--wa-form-control-activated-color:var(
--ha-checkbox-checked-background-color,
var(--ha-color-fill-primary-loud-resting)
);-webkit-tap-highlight-color:transparent;--checked-icon-scale:var(--ha-checkbox-checked-icon-scale, 0.9);--wa-form-control-required-content:var(
--ha-checkbox-required-marker,
var(--ha-input-required-marker, "*")
);--wa-form-control-required-content-offset:var(
--ha-checkbox-required-marker-offset,
0.1rem
)}[part~=base]{align-items:center;gap:var(--ha-space-2)}[part~=control]{border-radius:var(--ha-checkbox-border-radius,var(--ha-border-radius-sm));border-width:var(--ha-checkbox-border-width,var(--ha-border-width-md));margin-inline-end:0}[part~=label]{line-height:1}#hint{font-size:var(--ha-font-size-xs);color:var(--ha-color-text-secondary)}label:has(input:not(:disabled)):hover{--wa-form-control-border-color:var(
--ha-checkbox-border-color-hover,
var(--ha-checkbox-border-color, var(--ha-color-border-neutral-loud))
)}label:has(input:not(:disabled)):hover [part~=control]{background-color:var(--ha-checkbox-background-color-hover,var(--ha-color-form-background-hover))}label:has(input:checked:not(:disabled)):hover [part~=control],label:has(input:indeterminate:not(:disabled)):hover [part~=control]{background-color:var(--ha-checkbox-checked-background-color-hover,var(--ha-color-fill-primary-loud-hover));border-color:var(--ha-checkbox-checked-background-color-hover,var(--ha-color-fill-primary-loud-hover))}`]}}n=(0,o.Cg)([(0,s.EM)("ha-checkbox")],n)},26300(e,t,a){a.a(e,async function(e,o){try{a.r(t),a.d(t,{HaIconButton:()=>c});var i=a(62826),r=a(5124),s=a(22441),n=a(63672),h=a(18350),l=(a(67094),e([h]));h=(l.then?(await l)():l)[0];class c extends r.WF{render(){return r.qy` <ha-button appearance="plain" variant="neutral" aria-label="${(0,n.J)(this.label)}" title="${(0,n.J)(this.hideTitle?void 0:this.label)}" aria-haspopup="${(0,n.J)(this.ariaHasPopup)}" .disabled="${this.disabled}" .iconTag="${this.path?"ha-svg-icon":"span"}" .href="${this.href}" .target="${this.target}" .rel="${this.rel}" .download="${this.download}"> ${this.path?r.qy`<ha-svg-icon aria-hidden="true" .path="${this.path}"></ha-svg-icon>`:r.qy`<span><slot></slot></span>`} </ha-button> `}constructor(...e){super(...e),this.disabled=!1,this.hideTitle=!1,this.selected=!1}}c.shadowRootOptions={mode:"open",delegatesFocus:!0},c.styles=r.AH`: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,s.MZ)({type:Boolean,reflect:!0})],c.prototype,"disabled",void 0),(0,i.Cg)([(0,s.MZ)({type:String})],c.prototype,"path",void 0),(0,i.Cg)([(0,s.MZ)({type:String})],c.prototype,"label",void 0),(0,i.Cg)([(0,s.MZ)({type:String,attribute:"aria-haspopup"})],c.prototype,"ariaHasPopup",void 0),(0,i.Cg)([(0,s.MZ)({attribute:"hide-title",type:Boolean})],c.prototype,"hideTitle",void 0),(0,i.Cg)([(0,s.MZ)({type:Boolean,reflect:!0})],c.prototype,"selected",void 0),(0,i.Cg)([(0,s.MZ)()],c.prototype,"href",void 0),(0,i.Cg)([(0,s.MZ)()],c.prototype,"target",void 0),(0,i.Cg)([(0,s.MZ)()],c.prototype,"rel",void 0),(0,i.Cg)([(0,s.MZ)()],c.prototype,"download",void 0),c=(0,i.Cg)([(0,s.EM)("ha-icon-button")],c),o()}catch(e){o(e)}})},14927(e,t,a){a.a(e,async function(e,o){try{a.d(t,{getLanguageOptions:()=>y});var i=a(74487),r=(a(18111),a(20116),a(61701),a(62826)),s=a(5124),n=a(22441),h=a(22786),l=a(1087),c=a(86198),d=a(52220),p=a(28684),u=a(18350),g=a(38508),m=e([i,u,g,c]);[i,u,g,c]=m.then?(await m)():m;const v="M7,10L12,15L17,10H7Z",b=[{name:"primary",weight:10},{name:"secondary",weight:8},{name:"search_labels.english",weight:5}],y=(e,t,a,o)=>{let i=[];const r={language:"en"};if(t){const t=p.P.translations;i=e.map(e=>{let a=t[e]?.nativeName;if(!a)try{a=new Intl.DisplayNames(e,{type:"language",fallback:"code"}).of(e)}catch(t){a=e}const i=(0,c.T)(e,o||{language:navigator.language}),s=(0,c.T)(e,r);return{id:e,primary:a,secondary:i!==a?i:void 0,search_labels:{english:s!==a?s:null}}})}else o&&(i=e.map(e=>{const t=(0,c.T)(e,o),a=(0,c.T)(e,r);return{id:e,primary:t,search_labels:{english:a!==t?a:null}}}));return!a&&o&&i.sort((e,t)=>(0,d.SH)(e.primary,t.primary,o.language)),i};class f extends s.WF{firstUpdated(e){super.firstUpdated(e),this._computeDefaultLanguageOptions()}_computeDefaultLanguageOptions(){this._defaultLanguages=Object.keys(p.P.translations)}render(){const e=this.label??(this.hass?.localize("ui.components.language-picker.language")||"Language"),t=this.value??(this.required&&!this.disabled?this._getItems()[0].id:this.value);return s.qy` <ha-generic-picker .hass="${this.hass}" .autofocus="${this.autofocus}" .notFoundLabel="${this._notFoundLabel}" .emptyLabel="${this.hass?.localize("ui.components.language-picker.no_languages")||"No languages available"}" .label="${e}" .value="${t}" .valueRenderer="${this._valueRenderer}" .disabled="${this.disabled}" .helper="${this.helper}" .getItems="${this._getItems}" .searchKeys="${b}" @value-changed="${this._changed}" hide-clear-icon> ${this.buttonStyle?s.qy`<ha-button slot="field" .disabled="${this.disabled}" @click="${this._openPicker}" appearance="plain" variant="neutral"> ${this._getLanguageName(t)} <ha-svg-icon slot="end" .path="${v}"></ha-svg-icon> </ha-button>`:s.s6} </ha-generic-picker> `}_openPicker(e){e.stopPropagation(),this.genericPicker.open()}_changed(e){e.stopPropagation(),this.value=e.detail.value,(0,l.r)(this,"value-changed",{value:this.value})}constructor(...e){super(...e),this.disabled=!1,this.required=!1,this.nativeName=!1,this.buttonStyle=!1,this.noSort=!1,this._defaultLanguages=[],this._getLanguagesOptions=(0,h.A)(y),this._getItems=()=>this._getLanguagesOptions(this.languages??this._defaultLanguages,this.nativeName,this.noSort,this.hass?.locale),this._getLanguageName=e=>this._getItems().find(t=>t.id===e)?.primary,this._valueRenderer=e=>s.qy`<span slot="headline">${this._getLanguageName(e)??e}</span> `,this._notFoundLabel=e=>{const t=s.qy`<b>‘${e}’</b>`;return this.hass?this.hass.localize("ui.components.language-picker.no_match",{term:t}):s.qy`No languages found for ${t}`}}}f.styles=s.AH`ha-generic-picker{width:100%;display:block}`,(0,r.Cg)([(0,n.MZ)()],f.prototype,"value",void 0),(0,r.Cg)([(0,n.MZ)()],f.prototype,"label",void 0),(0,r.Cg)([(0,n.MZ)({type:Array})],f.prototype,"languages",void 0),(0,r.Cg)([(0,n.MZ)({attribute:!1})],f.prototype,"hass",void 0),(0,r.Cg)([(0,n.MZ)({type:Boolean,reflect:!0})],f.prototype,"disabled",void 0),(0,r.Cg)([(0,n.MZ)({type:Boolean})],f.prototype,"required",void 0),(0,r.Cg)([(0,n.MZ)()],f.prototype,"helper",void 0),(0,r.Cg)([(0,n.MZ)({attribute:"native-name",type:Boolean})],f.prototype,"nativeName",void 0),(0,r.Cg)([(0,n.MZ)({type:Boolean,attribute:"button-style"})],f.prototype,"buttonStyle",void 0),(0,r.Cg)([(0,n.MZ)({attribute:"no-sort",type:Boolean})],f.prototype,"noSort",void 0),(0,r.Cg)([(0,n.wk)()],f.prototype,"_defaultLanguages",void 0),(0,r.Cg)([(0,n.P)("ha-generic-picker",!0)],f.prototype,"genericPicker",void 0),f=(0,r.Cg)([(0,n.EM)("ha-language-picker")],f),o()}catch(e){o(e)}})},2054(e,t,a){a.a(e,async function(e,t){try{var o=a(62826),i=a(5124),r=a(22441),s=a(1087),n=a(44249),h=a(26300),l=e([h]);h=(l.then?(await l)():l)[0];const c="M3,6H21V8H3V6M3,11H21V13H3V11M3,16H21V18H3V16Z";class d 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 e=this._hasNotifications&&(this.narrow||"always_hidden"===this.hass.dockedSidebar);return i.qy` <ha-icon-button .label="${this.hass.localize("ui.sidebar.sidebar_toggle")}" .path="${c}" @click="${this._toggleMenu}"></ha-icon-button> ${e?i.qy`<div class="dot"></div>`:""} `}willUpdate(e){if(super.willUpdate(e),!e.has("narrow")&&!e.has("hass"))return;const t=e.has("hass")?e.get("hass"):this.hass,a=e.has("narrow")?e.get("narrow"):this.narrow,o=!1===t?.kioskMode&&(a||"always_hidden"===t?.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,e=>{this._hasNotifications=e.length>0})}_toggleMenu(){(0,s.r)(this,"hass-toggle-menu")}constructor(...e){super(...e),this.narrow=!1,this._hasNotifications=!1,this._show=!1,this._alwaysVisible=!1,this._attachNotifOnConnect=!1}}d.styles=i.AH`: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,r.MZ)({type:Boolean})],d.prototype,"narrow",void 0),(0,o.Cg)([(0,r.MZ)({attribute:!1})],d.prototype,"hass",void 0),(0,o.Cg)([(0,r.wk)()],d.prototype,"_hasNotifications",void 0),(0,o.Cg)([(0,r.wk)()],d.prototype,"_show",void 0),d=(0,o.Cg)([(0,r.EM)("ha-menu-button")],d),t()}catch(e){t(e)}})},33680(e,t,a){a.a(e,async function(e,o){try{a.d(t,{x:()=>p});var i=a(62826),r=a(5124),s=a(22441),n=a(97932),h=a(65063),l=a(1087),c=a(59646),d=e([c]);c=(d.then?(await d)():d)[0];const p="serviceWorker"in navigator&&"PushManager"in window&&("https:"===document.location.protocol||"localhost"===document.location.hostname||"127.0.0.1"===document.location.hostname);class u extends r.WF{render(){return r.qy` <ha-switch .disabled="${this.disabled||this._loading}" .checked="${this._pushChecked}" @change="${this._handlePushChange}"></ha-switch> `}async connectedCallback(){if(super.connectedCallback(),p)try{const e=await navigator.serviceWorker.ready;if(!e.pushManager)return;e.pushManager.getSubscription().then(e=>{this._loading=!1,this._pushChecked=!!e})}catch(e){}}_handlePushChange(e){if(!p)return;e.target.checked?this._subscribePushNotifications():this._unsubscribePushNotifications()}async _subscribePushNotifications(){const e=await navigator.serviceWorker.ready;let t;try{let a;a=navigator.userAgent.toLowerCase().indexOf("firefox")>-1?"firefox":"chrome";const o=await(0,h.an)(this,{title:this.hass.localize("ui.panel.profile.push_notifications.add_device_prompt.title"),inputLabel:this.hass.localize("ui.panel.profile.push_notifications.add_device_prompt.input_label")});if(null==o)return void(this._pushChecked=!1);let i;try{i=await(0,n.p)(this.hass)}catch(e){i=null}t=i?await e.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:i}):await e.pushManager.subscribe({userVisibleOnly:!0}),await this.hass.callApi("POST","notify.html5",{subscription:t,browser:a,name:o})}catch(e){const a=e.message||"Notification registration failed.";t&&await t.unsubscribe(),console.error(e),(0,l.r)(this,"hass-notification",{message:a}),this._pushChecked=!1}}async _unsubscribePushNotifications(){const e=await navigator.serviceWorker.ready;try{const t=await e.pushManager.getSubscription();if(!t)return;await this.hass.callApi("DELETE","notify.html5",{subscription:t}),await t.unsubscribe()}catch(e){const t=e.message||"Failed unsubscribing for push notifications.";console.error("Error in unsub push",e),(0,l.r)(this,"hass-notification",{message:t}),this._pushChecked=!0}}constructor(...e){super(...e),this._pushChecked="Notification"in window&&"granted"===Notification.permission,this._loading=!0}}(0,i.Cg)([(0,s.MZ)({attribute:!1})],u.prototype,"hass",void 0),(0,i.Cg)([(0,s.MZ)({type:Boolean})],u.prototype,"disabled",void 0),(0,i.Cg)([(0,s.wk)()],u.prototype,"_pushChecked",void 0),(0,i.Cg)([(0,s.wk)()],u.prototype,"_loading",void 0),u=(0,i.Cg)([(0,s.EM)("ha-push-notifications-toggle")],u),o()}catch(e){o(e)}})},8034(e,t,a){var o=a(62826),i=a(92070),r=a(5124),s=a(22441);class n extends r.WF{render(){const e=this._hasSlotController.test("description");return r.qy` <div class="prefix-wrap"> <slot name="prefix"></slot> <div class="body" part="heading" ?two-line="${!this.threeLine&&e}" ?three-line="${this.threeLine}"> <slot name="heading"></slot> ${e?r.qy`<span class="secondary"><slot name="description"></slot></span>`:r.s6} </div> </div> <div class="content"> <slot></slot> </div> `}constructor(...e){super(...e),this.narrow=!1,this.slim=!1,this.threeLine=!1,this.wrapHeading=!1,this.empty=!1,this._hasSlotController=new i.X(this,"description")}}n.styles=r.AH`: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,s.MZ)({type:Boolean,reflect:!0})],n.prototype,"narrow",void 0),(0,o.Cg)([(0,s.MZ)({type:Boolean,reflect:!0})],n.prototype,"slim",void 0),(0,o.Cg)([(0,s.MZ)({type:Boolean,attribute:"three-line"})],n.prototype,"threeLine",void 0),(0,o.Cg)([(0,s.MZ)({type:Boolean,attribute:"wrap-heading",reflect:!0})],n.prototype,"wrapHeading",void 0),(0,o.Cg)([(0,s.MZ)({type:Boolean,reflect:!0})],n.prototype,"empty",void 0),n=(0,o.Cg)([(0,s.EM)("ha-settings-row")],n)},67094(e,t,a){a.r(t),a.d(t,{HaSvgIcon:()=>s});var o=a(62826),i=a(5124),r=a(22441);class s extends i.WF{render(){return i.JW` <svg viewBox="${this.viewBox||"0 0 24 24"}" preserveAspectRatio="xMidYMid meet" focusable="false" role="img" aria-hidden="true"> <g> ${this.path?i.JW`<path class="primary-path" d="${this.path}"></path>`:i.s6} ${this.secondaryPath?i.JW`<path class="secondary-path" d="${this.secondaryPath}"></path>`:i.s6} </g> </svg>`}}s.styles=i.AH`: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,r.MZ)()],s.prototype,"path",void 0),(0,o.Cg)([(0,r.MZ)({attribute:!1})],s.prototype,"secondaryPath",void 0),(0,o.Cg)([(0,r.MZ)({attribute:!1})],s.prototype,"viewBox",void 0),s=(0,o.Cg)([(0,r.EM)("ha-svg-icon")],s)},59646(e,t,a){a.a(e,async function(e,t){try{var o=a(62826),i=a(29344),r=a(5124),s=a(22441),n=a(88360),h=e([i]);i=(h.then?(await h)():h)[0];class l extends i.A{updated(e){super.updated(e),e.has("haptic")&&(this.haptic?this.addEventListener("change",this._forwardHaptic):this.removeEventListener("change",this._forwardHaptic))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",this._forwardHaptic)}static get styles(){return[i.A.styles,r.AH`:host{--wa-form-control-toggle-size:var(--ha-switch-size, 24px);--wa-form-control-required-content:var(
--ha-switch-required-marker,
var(--ha-input-required-marker, "*")
);--wa-form-control-required-content-offset:var(
--ha-switch-required-marker-offset,
0.1rem
);--thumb-size:var(--ha-switch-thumb-size, 18px);--width:var(--ha-switch-width, 48px)}label{position:relative;height:max(var(--thumb-size),var(--wa-form-control-toggle-size))}label::before{content:"";position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:100%;height:100%;min-width:var(--ha-switch-min-touch-size,40px);min-height:var(--ha-switch-min-touch-size,40px)}label.disabled::before{pointer-events:none}.switch{background-color:var(--ha-switch-background-color,var(--ha-color-fill-disabled-quiet-resting));border-color:var(--ha-switch-border-color,var(--ha-color-border-neutral-normal))}label:not(.disabled) .input:focus-visible~.switch,label:not(.disabled):hover .switch{background-color:var(--ha-switch-background-color-hover,var(--ha-switch-background-color,var(--ha-color-fill-disabled-quiet-hover)))}.checked .switch{background-color:var(--ha-switch-checked-background-color,var(--ha-color-fill-primary-normal-resting));border-color:var(--ha-switch-checked-border-color,var(--ha-color-border-primary-loud))}label:not(.disabled).checked .input:focus-visible~.switch,label:not(.disabled).checked:hover .switch{background-color:var(--ha-switch-checked-background-color-hover,var(--ha-switch-checked-background-color,var(--ha-color-fill-primary-normal-hover)));border-color:var(--ha-switch-checked-border-color-hover,var(--ha-switch-checked-border-color,var(--ha-color-border-primary-loud)))}.switch .thumb{background-color:var(--ha-switch-thumb-background-color,var(--ha-color-on-neutral-normal));border-color:var(--ha-switch-thumb-border-color,var(--ha-color-on-neutral-normal));border-style:var(--wa-form-control-border-style);border-width:var(--wa-form-control-border-width);box-shadow:var(--ha-switch-thumb-box-shadow,var(--ha-box-shadow-s))}label:not(.disabled) .input:focus-visible~.switch .thumb,label:not(.disabled):hover .switch .thumb{background-color:var(--ha-switch-thumb-background-color-hover,var(--ha-switch-thumb-background-color,var(--ha-color-on-neutral-normal)));border-color:var(--ha-switch-thumb-border-color-hover,var(--ha-switch-thumb-border-color,var(--ha-color-on-neutral-normal)))}.checked .switch .thumb{background-color:var(--ha-switch-checked-thumb-background-color,var(--ha-color-on-primary-normal));border-color:var(--ha-switch-checked-thumb-border-color,var(--ha-color-on-primary-normal))}label:not(.disabled).checked .input:focus-visible~.switch .thumb,label:not(.disabled).checked:hover .switch .thumb{background-color:var(--ha-switch-checked-thumb-background-color-hover,var(--ha-switch-checked-thumb-background-color,var(--ha-color-on-primary-normal)));border-color:var(--ha-switch-checked-thumb-border-color-hover,var(--ha-switch-checked-thumb-border-color,var(--ha-color-on-primary-normal)))}label.disabled{opacity:var(--ha-switch-disabled-opacity, .3);cursor:not-allowed}label:not(.disabled) .input:focus-visible~.switch .thumb{outline:0;outline-offset:none}label:not(.disabled) .input:focus-visible~.switch{outline:var(--wa-focus-ring);outline-offset:var(--wa-focus-ring-offset)}:host(:empty) slot.label{display:none}`]}constructor(...e){super(...e),this.haptic=!1,this._forwardHaptic=()=>{(0,n.j)(this,"light")}}}(0,o.Cg)([(0,s.MZ)({type:Boolean})],l.prototype,"haptic",void 0),l=(0,o.Cg)([(0,s.EM)("ha-switch")],l),t()}catch(e){t(e)}})},37532(e,t,a){a.a(e,async function(e,t){try{a(44114),a(18111),a(20116);var o=a(62826),i=a(5124),r=a(22441),s=a(22786),n=a(1087),h=a(52220),l=a(38508),c=e([l]);l=(c.then?(await c)():c)[0];const d="default",p=[{name:"primary",weight:1}];class u extends i.WF{render(){return i.qy` <ha-generic-picker .label="${this.label??this.hass?.localize("ui.components.theme-picker.theme")??"Theme"}" .placeholder="${this.noThemeLabel??this.hass?.localize("ui.components.theme-picker.no_theme")}" .helper="${this.helper}" .value="${this.value}" .valueRenderer="${this._valueRenderer}" .getItems="${this._getItems}" .searchKeys="${p}" .disabled="${this.disabled}" .required="${this.required}" @value-changed="${this._changed}"></ha-generic-picker> `}_changed(e){e.stopPropagation(),this.value=e.detail.value,(0,n.r)(this,"value-changed",{value:this.value})}constructor(...e){super(...e),this.includeDefault=!1,this.disabled=!1,this.required=!1,this._getThemeOptions=(0,s.A)((e,t,a)=>{const o=[];a&&o.push({id:d,primary:"ioBroker"});const i=Object.keys(e).sort((e,a)=>(0,h.SH)(e,a,t));for(const e of i)o.push({id:e,primary:e});return o}),this._getItems=()=>this._getThemeOptions(this.hass?.themes.themes||{},this.hass?.locale.language||"en",this.includeDefault),this._valueRenderer=e=>i.qy`<span slot="headline">${this._getItems().find(t=>t.id===e)?.primary??e}</span>`}}u.styles=i.AH`ha-generic-picker{width:100%;display:block}`,(0,o.Cg)([(0,r.MZ)()],u.prototype,"value",void 0),(0,o.Cg)([(0,r.MZ)()],u.prototype,"label",void 0),(0,o.Cg)([(0,r.MZ)()],u.prototype,"helper",void 0),(0,o.Cg)([(0,r.MZ)({attribute:"include-default",type:Boolean})],u.prototype,"includeDefault",void 0),(0,o.Cg)([(0,r.MZ)({attribute:!1})],u.prototype,"hass",void 0),(0,o.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],u.prototype,"disabled",void 0),(0,o.Cg)([(0,r.MZ)({type:Boolean})],u.prototype,"required",void 0),(0,o.Cg)([(0,r.MZ)({attribute:"no-theme-label"})],u.prototype,"noThemeLabel",void 0),u=(0,o.Cg)([(0,r.EM)("ha-theme-picker")],u),t()}catch(e){t(e)}})},83892(e,t,a){a.d(t,{x:()=>n});a(18111),a(13579);var o=a(62826),i=a(92070),r=a(5124),s=a(22441);class n extends r.WF{_onSlotChange(e){return t=>{const a=t.target.assignedNodes({flatten:!0}).some(e=>e.nodeType===Node.ELEMENT_NODE||e.nodeType===Node.TEXT_NODE&&""!==e.textContent?.trim());"start"===e?this._hasStart=a:this._hasEnd=a}}render(){return this._renderBase(this._renderInner())}_renderBase(e){return r.qy`<div part="base" class="base" id="item">${e}</div>`}_renderInner(){const e=this._slotController.test("content");return r.qy` <div part="start" class="start" ?hidden="${!this._hasStart}"> <slot name="start" @slotchange="${this._onSlotChange("start")}"></slot> </div> <div part="content" class="content"> ${e?r.qy`<slot name="content"></slot>`:this._renderDefaultContent()} </div> <div part="end" class="end" ?hidden="${!this._hasEnd}"> <slot name="end" @slotchange="${this._onSlotChange("end")}"></slot> </div> `}_renderDefaultContent(){const e=this._slotController.test("headline"),t=this._slotController.test("supporting-text"),a=e||void 0!==this.headline,o=t||void 0!==this.supportingText;return r.qy` ${a?r.qy`<div part="headline" class="headline"> <slot name="headline">${this.headline??r.s6}</slot> </div>`:r.s6} ${o?r.qy`<div part="supporting-text" class="supporting"> <slot name="supporting-text">${this.supportingText??r.s6}</slot> </div>`:r.s6} `}constructor(...e){super(...e),this.disabled=!1,this._slotController=new i.X(this,"headline","supporting-text","content"),this._hasStart=!1,this._hasEnd=!1}}n.styles=r.AH`: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,s.MZ)({type:String})],n.prototype,"headline",void 0),(0,o.Cg)([(0,s.MZ)({type:String,attribute:"supporting-text"})],n.prototype,"supportingText",void 0),(0,o.Cg)([(0,s.MZ)({type:Boolean,reflect:!0})],n.prototype,"disabled",void 0),(0,o.Cg)([(0,s.wk)()],n.prototype,"_hasStart",void 0),(0,o.Cg)([(0,s.wk)()],n.prototype,"_hasEnd",void 0),n=(0,o.Cg)([(0,s.EM)("ha-row-item")],n)},64013(e,t,a){var o=a(62826),i=a(97086),r=a(5124),s=a(22441);class n extends i.A{static get styles(){return[i.A.styles,r.AH`:host{--wa-form-control-required-content:var(
--ha-radio-group-required-marker,
var(--ha-input-required-marker, "*")
);--wa-form-control-required-content-offset:var(
--ha-radio-group-required-marker-offset,
0.1rem
)}`]}constructor(){super(),this.radioTag="ha-radio-option"}}n=(0,o.Cg)([(0,s.EM)("ha-radio-group")],n)},92677(e,t,a){var o=a(62826),i=a(17010),r=a(5124),s=a(22441);class n extends i.A{static get styles(){return[i.A.styles,r.AH`:host{--wa-form-control-activated-color:var(
--ha-radio-option-active-color,
var(--ha-color-fill-primary-loud-resting)
);--wa-form-control-height:var(--ha-radio-option-height, 40px);--wa-form-control-toggle-size:var(
--ha-radio-option-toggle-size,
20px
);--wa-form-control-border-width:var(
--ha-radio-option-border-width,
var(--ha-border-width-md)
);--wa-form-control-border-color:var(
--ha-radio-option-border-color,
var(--ha-color-border-neutral-normal)
);--wa-form-control-background-color:var(
--ha-radio-option-background-color,
var(--wa-form-control-background-color)
);--checked-icon-color:var(
--ha-radio-option-checked-icon-color,
var(--wa-form-control-activated-color)
);--checked-icon-scale:var(--ha-radio-option-checked-icon-scale, 0.7)}:host([appearance=default]) .control{margin:var(--ha-radio-option-control-margin,var(--ha-space-3) var(--ha-space-2) var(--ha-space-3) var(--ha-space-3))}:host(:not([aria-checked=true],[aria-disabled=true]):hover) .control{border-color:var(--ha-radio-option-border-color-hover,var(--ha-radio-option-border-color,var(--ha-color-border-neutral-loud)));background-color:var(--ha-radio-option-background-color-hover,var(--ha-color-fill-neutral-quiet-hover))}:host([aria-checked=true]) .control{background-color:var(--ha-radio-option-checked-background-color,var(--ha-color-fill-primary-normal-resting));color:var(--checked-icon-color);border-color:var(--checked-icon-color)}[part~=label]{display:inline-flex;align-items:center;cursor:pointer}:host([disabled]) [part~=label]{cursor:not-allowed}`]}}n=(0,o.Cg)([(0,s.EM)("ha-radio-option")],n)},28918(e,t,a){a.d(t,{H:()=>i,o:()=>o});function o(e){return"boolean"==typeof e?e?{}:void 0:e}function i(e){return"strategy"in e}},91984(e,t,a){a.d(t,{R6:()=>i,TQ:()=>r,cg:()=>s});var o=a(31290);function i(e){return"strategy"in e}const r=(e,t)=>e.title??(e.path?(0,o.n)(e.path):String(t)),s=e=>e.icon??"mdi:view-compact"},97932(e,t,a){a.d(t,{p:()=>o});a(16573),a(78100),a(77936),a(37467),a(44732),a(79577),a(16632),a(34226),a(9486),a(20456),a(64979);const o=async e=>{const t=await e.callWS({type:"notify/html5/appkey"});return t?function(e){const t=(e+"=".repeat((4-e.length%4)%4)).replace(/-/g,"+").replace(/_/g,"/"),a=window.atob(t),o=new Uint8Array(a.length);for(let e=0;e<a.length;++e)o[e]=a.charCodeAt(e);return o}(t):null}},44249(e,t,a){a.d(t,{V:()=>o});const o=(e,t)=>{const a=new i,o=e.subscribeMessage(e=>t(a.processMessage(e)),{type:"persistent_notification/subscribe"});return()=>{o.then(e=>e?.())}};class i{processMessage(e){if("removed"===e.type)for(const t of Object.keys(e.notifications))delete this.notifications[t];else this.notifications={...this.notifications,...e.notifications};return Object.values(this.notifications)}constructor(){this.notifications={}}}},68302(e,t,a){a.d(t,{w:()=>r});var o=a(1087);const i=()=>Promise.all([a.e(34995),a.e(64657),a.e(87192),a.e(33337),a.e(11345)]).then(a.bind(a,93576)),r=e=>{(0,o.r)(e,"show-dialog",{dialogTag:"dialog-edit-sidebar",dialogImport:i,dialogParams:{}})}},68370(e,t,a){a.r(t),a.d(t,{lovelaceResourcesTabs:()=>h,lovelaceTabs:()=>n});var o=a(62826),i=a(22441),r=a(324);const s="M13,3V9H21V3M13,21H21V11H13M3,21H11V15H3M3,13H11V3H3V13Z",n=[{path:"/config/lovelace/dashboards",translationKey:"ui.panel.config.lovelace.dashboards.caption",iconPath:s}],h=[{path:"/config/lovelace/resources",translationKey:"ui.panel.config.lovelace.resources.caption",iconPath:s}];class l extends r.a{updatePageEl(e){e.hass=this.hass,e.narrow=this.narrow,e.isWide=this.isWide,e.route=this.routeTail}constructor(...e){super(...e),this.narrow=!1,this.isWide=!1,this.routerOptions={defaultPage:"dashboards",routes:{dashboards:{tag:"ha-config-lovelace-dashboards",load:()=>Promise.all([a.e(4801),a.e(39763),a.e(32450),a.e(46095),a.e(7305),a.e(34995),a.e(83113),a.e(66716),a.e(19112),a.e(30002),a.e(89747),a.e(52487),a.e(94426)]).then(a.bind(a,49406)),cache:!0},resources:{tag:"ha-config-lovelace-resources",load:()=>Promise.all([a.e(4801),a.e(39763),a.e(32450),a.e(46095),a.e(7305),a.e(34995),a.e(83113),a.e(57908),a.e(19112),a.e(30002),a.e(92045)]).then(a.bind(a,89192))}}}}}(0,o.Cg)([(0,i.MZ)({attribute:!1})],l.prototype,"hass",void 0),(0,o.Cg)([(0,i.MZ)({type:Boolean})],l.prototype,"narrow",void 0),(0,o.Cg)([(0,i.MZ)({attribute:"is-wide",type:Boolean})],l.prototype,"isWide",void 0),l=(0,o.Cg)([(0,i.EM)("ha-config-lovelace")],l)},15656(e,t,a){a.d(t,{Nu:()=>l,TG:()=>m,Xd:()=>p,d4:()=>g,uN:()=>d,xC:()=>u});a(18111),a(61701);var o=a(28918),i=a(35952),r=a(91984),s=a(53338);const n="custom:",h={dashboard:{"original-states":()=>a.e(60134).then(a.bind(a,43845)),map:()=>a.e(74994).then(a.bind(a,56009)),iframe:()=>a.e(1732).then(a.bind(a,38287)),areas:()=>Promise.all([a.e(99788),a.e(59704),a.e(25322),a.e(12009),a.e(20282),a.e(20992)]).then(a.bind(a,80821)),home:()=>Promise.all([a.e(99788),a.e(59704),a.e(25322),a.e(12009),a.e(20282),a.e(3650),a.e(97416)]).then(a.bind(a,67293)),energy:()=>Promise.all([a.e(67218),a.e(92610),a.e(26857),a.e(77183),a.e(19343)]).then(a.bind(a,94429))},view:{"original-states":()=>Promise.all([a.e(67218),a.e(92610),a.e(45688),a.e(77183),a.e(94530)]).then(a.bind(a,16330)),"energy-overview":()=>Promise.all([a.e(67218),a.e(92610),a.e(26857),a.e(77183),a.e(51016)]).then(a.bind(a,3260)),energy:()=>Promise.all([a.e(67218),a.e(92610),a.e(26857),a.e(77183),a.e(20984)]).then(a.bind(a,86242)),water:()=>Promise.all([a.e(67218),a.e(92610),a.e(26857),a.e(77183),a.e(8969)]).then(a.bind(a,88615)),gas:()=>Promise.all([a.e(67218),a.e(92610),a.e(26857),a.e(77183),a.e(17423)]).then(a.bind(a,21733)),power:()=>Promise.all([a.e(67218),a.e(92610),a.e(26857),a.e(77183),a.e(17879)]).then(a.bind(a,60093)),map:()=>a.e(6875).then(a.bind(a,14966)),iframe:()=>a.e(73441).then(a.bind(a,51480)),area:()=>Promise.all([a.e(99788),a.e(59704),a.e(25322),a.e(12009),a.e(20282),a.e(35818)]).then(a.bind(a,44979)),"areas-overview":()=>Promise.all([a.e(99788),a.e(59704),a.e(25322),a.e(12009),a.e(20282),a.e(94101)]).then(a.bind(a,69140)),"home-overview":()=>Promise.all([a.e(67218),a.e(92610),a.e(99788),a.e(28991),a.e(77183),a.e(59704),a.e(25322),a.e(12009),a.e(20282),a.e(3650),a.e(6078)]).then(a.bind(a,8892)),"home-media-players":()=>Promise.all([a.e(99788),a.e(59704),a.e(25322),a.e(12009),a.e(20282),a.e(3650),a.e(44685)]).then(a.bind(a,24876)),"home-area":()=>Promise.all([a.e(99788),a.e(59704),a.e(25322),a.e(12009),a.e(20282),a.e(3650),a.e(54547)]).then(a.bind(a,47302)),"home-other-devices":()=>a.e(27800).then(a.bind(a,78859)),light:()=>Promise.all([a.e(99788),a.e(59704),a.e(25322),a.e(12009),a.e(20282),a.e(2437)]).then(a.bind(a,71776)),security:()=>Promise.all([a.e(99788),a.e(59704),a.e(25322),a.e(12009),a.e(20282),a.e(85143)]).then(a.bind(a,31758)),climate:()=>Promise.all([a.e(99788),a.e(59704),a.e(25322),a.e(12009),a.e(20282),a.e(19051)]).then(a.bind(a,73026)),maintenance:()=>a.e(82691).then(a.bind(a,78030))},section:{"common-controls":()=>a.e(8717).then(a.bind(a,44124))}},l=async(e,t)=>{if(t in h[e]){await h[e][t]();const a=`${t}-${e}-strategy`;return customElements.get(a)}if(!t.startsWith(n))throw new Error("Unknown strategy");const a=`ll-strategy-${t.slice(7)}`,o=`ll-strategy-${e}-${t.slice(7)}`;if(!0===await Promise.race([customElements.whenDefined(a),customElements.whenDefined(o),new Promise(e=>{setTimeout(()=>e(!0),5e3)})]))throw new Error(`Timeout waiting for strategy element ${o} to be registered`);return customElements.get(o)??customElements.get(a)},c=async(e,t,a,o)=>{const i=a.type;if(!i)return t("No strategy type found");try{const t=await l(e,i);if((0,s.Xo)(t)){if("dashboard"===e&&"generateDashboard"in t)return await t.generateDashboard({config:{strategy:a,views:[]},hass:o});if("view"===e&&"generateView"in t)return await t.generateView({config:{views:[]},view:{strategy:a},hass:o})}const r=(0,s._V)(a);return await t.generate(r,o)}catch(e){return"timeout"!==e.message&&console.error(e),t(e)}},d=async(e,t)=>{const{strategy:a,...o}=e;return{...o,...await c("dashboard",e=>({views:[{title:"Error",cards:[{type:"markdown",content:`Error loading the dashboard strategy:\n> ${e}`}]}]}),a,t)}},p=async(e,t)=>{const{strategy:a,...o}=e;return{...o,...await c("view",e=>({cards:[{type:"markdown",content:`Error loading the view strategy:\n> ${e}`}]}),a,t)}},u=async(e,t)=>{const{strategy:a,...o}=e;return{...o,...await c("section",e=>({cards:[{type:"markdown",content:`Error loading the section strategy:\n> ${e}`}]}),a,t)}},g=async(e,t)=>{const a=(0,i.Wu)(e)?await d(e,t):{...e};return a.views=await Promise.all(a.views.map(async e=>{const a=(0,r.R6)(e)?await p(e,t):{...e};return a.sections&&(a.sections=await Promise.all(a.sections.map(async e=>(0,o.H)(e)?await u(e,t):{...e}))),a})),a};async function m(e,t){const a=await l("dashboard",t),o=await async function(e,t){const a=t.getCreateSuggestions;if("function"==typeof a)return a.call(t,e)}(e,a);return{strategyClass:a,fieldSuggestions:o}}},53338(e,t,a){a.d(t,{B2:()=>i,Xo:()=>o,_V:()=>r});const o=e=>!("generate"in e),i=e=>2===Object.keys(e).length&&"options"in e&&"object"==typeof e.options,r=e=>{if(!i(e))return e;const t={...e,...e.options};return delete t.options,t}},89483(e,t,a){a.a(e,async function(e,t){try{var o=a(62826),i=a(5124),r=a(22441),s=a(1087),n=a(59646),h=(a(83892),e([n]));n=(h.then?(await h)():h)[0];class l extends i.WF{render(){return i.qy` <ha-row-item> <span slot="headline">${this.hass.localize("ui.panel.profile.enable_shortcuts.header")}</span> <span slot="supporting-text">${this.hass.localize("ui.panel.profile.enable_shortcuts.description")}</span> <ha-switch slot="end" .checked="${this.hass.enableShortcuts}" @change="${this._checkedChanged}"></ha-switch> </ha-row-item> `}async _checkedChanged(e){const t=e.target.checked;t!==this.hass.enableShortcuts&&(0,s.r)(this,"hass-enable-shortcuts",t)}}(0,o.Cg)([(0,r.MZ)({attribute:!1})],l.prototype,"hass",void 0),l=(0,o.Cg)([(0,r.EM)("ha-enable-shortcuts-row")],l),t()}catch(e){t(e)}})},50366(e,t,a){a.a(e,async function(e,t){try{var o=a(62826),i=a(5124),r=a(22441),s=a(38962),n=(a(76776),a(59646)),h=(a(83892),a(48250)),l=e([s,n]);[s,n]=l.then?(await l)():l;class c extends i.WF{render(){return i.qy`${this._error?i.qy`<ha-alert alert-type="error">${this._error}</ha-alert>`:i.s6} <ha-row-item> <span slot="headline">${this.hass.localize("ui.panel.profile.entity_id_picker.title")}</span> <span slot="supporting-text">${this.hass.localize("ui.panel.profile.entity_id_picker.description")}</span> <ha-switch slot="end" haptic .checked="${!!this.coreUserData&&!!this.coreUserData.showEntityIdPicker}" .disabled="${void 0===this.coreUserData}" @change="${this._toggled}"></ha-switch> </ha-row-item>`}async _toggled(e){try{(0,h.Bp)(this.hass.connection,"core",{...this.coreUserData,showEntityIdPicker:e.currentTarget.checked})}catch(e){this._error=e.message||e}}}c.styles=i.AH`a{color:var(--primary-color)}ha-alert{margin:0 16px;display:block}`,(0,o.Cg)([(0,r.MZ)({attribute:!1})],c.prototype,"hass",void 0),(0,o.Cg)([(0,r.MZ)({attribute:!1})],c.prototype,"coreUserData",void 0),(0,o.Cg)([(0,r.wk)()],c.prototype,"_error",void 0),c=(0,o.Cg)([(0,r.EM)("ha-entity-id-picker-row")],c),t()}catch(e){t(e)}})},35839(e,t,a){a.a(e,async function(e,t){try{var o=a(62826),i=a(5124),r=a(22441),s=a(1087),n=a(59646),h=(a(83892),e([n]));n=(h.then?(await h)():h)[0];class l extends i.WF{render(){return i.qy` <ha-row-item> <span slot="headline">${this.hass.localize("ui.panel.profile.force_narrow.header")}</span> <span slot="supporting-text">${this.hass.localize("ui.panel.profile.force_narrow.description")}</span> <ha-switch slot="end" .checked="${"always_hidden"===this.hass.dockedSidebar}" @change="${this._checkedChanged}"></ha-switch> </ha-row-item> `}async _checkedChanged(e){const t=e.target.checked;t!==("always_hidden"===this.hass.dockedSidebar)&&(0,s.r)(this,"hass-dock-sidebar",{dock:t?"always_hidden":"auto"})}}(0,o.Cg)([(0,r.MZ)({attribute:!1})],l.prototype,"hass",void 0),l=(0,o.Cg)([(0,r.EM)("ha-force-narrow-row")],l),t()}catch(e){t(e)}})},1354(e,t,a){a.a(e,async function(e,t){try{a(18111),a(20116),a(61701);var o=a(62826),i=(a(68825),a(5124)),r=a(22441),s=a(22786),n=(a(70947),a(47680),a(606)),h=(a(8034),a(65829)),l=(a(67094),a(48250)),c=a(71730),d=a(99774),p=a(49406),u=e([n,h,p]);[n,h,p]=u.then?(await u)():u;const g="___use_system___";class m extends i.WF{firstUpdated(e){super.firstUpdated(e),this._getDashboards()}render(){const e=this.hass.userData?.default_panel||g;return i.qy` <ha-settings-row .narrow="${this.narrow}"> <span slot="heading"> ${this.hass.localize("ui.panel.profile.dashboard.header")} </span> <span slot="description"> ${this.hass.localize("ui.panel.profile.dashboard.description")} </span> ${this._dashboards?i.qy` <ha-select .label="${this.hass.localize("ui.panel.profile.dashboard.dropdown_label")}" .value="${this._valueLabel(e)}" @selected="${this._dashboardChanged}"> <ha-dropdown-item .value="${g}" .selected="${e===g}"> ${this.hass.localize("ui.panel.profile.dashboard.system")} </ha-dropdown-item> <wa-divider></wa-divider> ${p.PANEL_DASHBOARDS.map(t=>{const a=this.hass.panels[t];return a?i.qy` <ha-dropdown-item value="${a.url_path}" .selected="${e===a.url_path}"> <ha-icon slot="icon" .icon="${(0,d.Q)(a)}"></ha-icon> ${(0,d.hL)(this.hass,a)} </ha-dropdown-item> `:i.s6})} ${this._dashboards.length?i.qy` <wa-divider></wa-divider> ${this._dashboards.map(t=>!this.hass.user.is_admin&&t.require_admin?"":i.qy` <ha-dropdown-item .value="${t.url_path}" .selected="${e===t.url_path}"> <ha-icon slot="icon" .icon="${t.icon||"mdi:view-dashboard"}"></ha-icon> ${t.title} </ha-dropdown-item> `)} `:i.s6} </ha-select> `:i.qy`<div class="loading"> <ha-spinner size="small"></ha-spinner> </div>`} </ha-settings-row> `}async _getDashboards(){this._dashboards=await(0,c.SJ)(this.hass)}_dashboardChanged(e){const t=e.detail.value;if(!t)return;const a=t===g?void 0:t;a!==this.hass.userData?.default_panel&&(0,l.Bp)(this.hass.connection,"core",{...this.hass.userData,default_panel:a})}static get styles(){return[i.AH`.loading{display:flex;justify-content:center;align-items:center;height:56px;width:200px}ha-select{display:block;width:100%}`]}constructor(...e){super(...e),this.narrow=!1,this._valueLabel=(0,s.A)(e=>{if(e===g)return this.hass.localize("ui.panel.profile.dashboard.system");if("lovelace"===e)return this.hass.localize("ui.panel.profile.dashboard.lovelace");const t=this.hass.panels[e];if(t)return(0,d.hL)(this.hass,t);const a=this._dashboards?.find(t=>t.url_path===e);return a?a.title:e})}}(0,o.Cg)([(0,r.MZ)({attribute:!1})],m.prototype,"hass",void 0),(0,o.Cg)([(0,r.MZ)({type:Boolean})],m.prototype,"narrow",void 0),(0,o.Cg)([(0,r.wk)()],m.prototype,"_dashboards",void 0),m=(0,o.Cg)([(0,r.EM)("ha-pick-dashboard-row")],m),t()}catch(e){t(e)}})},35342(e,t,a){a.a(e,async function(e,t){try{a(18111),a(61701);var o=a(62826),i=a(5124),r=a(22441),s=a(72487),n=a(1087),h=(a(76776),a(606)),l=(a(8034),a(46927)),c=e([h,s]);[h,s]=c.then?(await c)():c;class d extends i.WF{render(){const e=new Date;return i.qy` <ha-settings-row .narrow="${this.narrow}"> <span slot="heading"> ${this.hass.localize("ui.panel.profile.date_format.header")} </span> <span slot="description"> ${this.hass.localize("ui.panel.profile.date_format.description")} </span> <ha-select .label="${this.hass.localize("ui.panel.profile.date_format.dropdown_label")}" .disabled="${void 0===this.hass.locale}" .value="${this.hass.locale.date_format}" @selected="${this._handleFormatSelection}" .options="${Object.values(l.ow).map(t=>({value:t.toString(),label:this.hass.localize(`ui.panel.profile.date_format.formats.${t}`),secondary:(0,s.zB)(e,{...this.hass.locale,date_format:t},this.hass.config)}))}"> </ha-select> </ha-settings-row> `}async _handleFormatSelection(e){(0,n.r)(this,"hass-date-format-select",e.detail.value)}constructor(...e){super(...e),this.narrow=!1}}d.styles=i.AH`ha-select{display:block;width:100%}`,(0,o.Cg)([(0,r.MZ)({attribute:!1})],d.prototype,"hass",void 0),(0,o.Cg)([(0,r.MZ)({type:Boolean})],d.prototype,"narrow",void 0),d=(0,o.Cg)([(0,r.EM)("ha-pick-date-format-row")],d),t()}catch(e){t(e)}})},94655(e,t,a){a.a(e,async function(e,t){try{var o=a(62826),i=a(5124),r=a(22441),s=a(380),n=a(1087),h=a(606),l=(a(8034),a(46927)),c=e([h]);h=(c.then?(await c)():c)[0];class d extends i.WF{render(){return i.qy` <ha-settings-row .narrow="${this.narrow}"> <span slot="heading"> ${this.hass.localize("ui.panel.profile.first_weekday.header")} </span> <span slot="description"> ${this.hass.localize("ui.panel.profile.first_weekday.description")} </span> <ha-select .label="${this.hass.localize("ui.panel.profile.first_weekday.dropdown_label")}" .disabled="${void 0===this.hass.locale}" .value="${this.hass.locale.first_weekday}" @selected="${this._handleFormatSelection}" .options="${[l.zt.language,l.zt.monday,l.zt.saturday,l.zt.sunday].map(e=>({value:e.toString(),label:this.hass.localize(`ui.panel.profile.first_weekday.values.${e}`),secondary:e===l.zt.language?this.hass.localize(`ui.panel.profile.first_weekday.values.${(0,s.D)(this.hass.locale)}`):void 0}))}"></ha-select> </ha-settings-row> `}async _handleFormatSelection(e){(0,n.r)(this,"hass-first-weekday-select",e.detail.value)}constructor(...e){super(...e),this.narrow=!1}}d.styles=i.AH`ha-select{display:block;width:100%}`,(0,o.Cg)([(0,r.MZ)({attribute:!1})],d.prototype,"hass",void 0),(0,o.Cg)([(0,r.MZ)({type:Boolean})],d.prototype,"narrow",void 0),d=(0,o.Cg)([(0,r.EM)("ha-pick-first-weekday-row")],d),t()}catch(e){t(e)}})},16831(e,t,a){a.a(e,async function(e,t){try{var o=a(62826),i=a(5124),r=a(22441),s=a(1087),n=a(14927),h=(a(8034),e([n]));n=(h.then?(await h)():h)[0];class l extends i.WF{render(){return i.qy` <ha-settings-row .narrow="${this.narrow}"> <span slot="heading">${this.hass.localize("ui.panel.profile.language.header")}</span> <span slot="description"> <a href="https://developers.home-assistant.io/docs/translations/" target="_blank" rel="noreferrer">${this.hass.localize("ui.panel.profile.language.link_promo")}</a> </span> <ha-language-picker .hass="${this.hass}" native-name .label="${this.hass.localize("ui.panel.profile.language.dropdown_label")}" .value="${this.hass.locale.language}" @value-changed="${this._languageSelectionChanged}" naturalMenuWidth> </ha-language-picker> </ha-settings-row> `}_languageSelectionChanged(e){e.detail.value!==this.hass.language&&(0,s.r)(this,"hass-language-select",e.detail.value)}constructor(...e){super(...e),this.narrow=!1}}l.styles=i.AH`a{color:var(--primary-color)}ha-language-picker{width:100%}`,(0,o.Cg)([(0,r.MZ)({attribute:!1})],l.prototype,"hass",void 0),(0,o.Cg)([(0,r.MZ)({type:Boolean})],l.prototype,"narrow",void 0),l=(0,o.Cg)([(0,r.EM)("ha-pick-language-row")],l),t()}catch(e){t(e)}})},99229(e,t,a){a.a(e,async function(e,t){try{a(18111),a(61701);var o=a(62826),i=a(5124),r=a(22441),s=a(1087),n=a(20058),h=(a(76776),a(606)),l=(a(8034),a(46927)),c=e([h,n]);[h,n]=c.then?(await c)():c;class d extends i.WF{render(){return i.qy` <ha-settings-row .narrow="${this.narrow}"> <span slot="heading"> ${this.hass.localize("ui.panel.profile.number_format.header")} </span> <span slot="description"> ${this.hass.localize("ui.panel.profile.number_format.description")} </span> <ha-select .label="${this.hass.localize("ui.panel.profile.number_format.dropdown_label")}" .disabled="${void 0===this.hass.locale}" .value="${this.hass.locale.number_format}" @selected="${this._handleFormatSelection}" .options="${Object.values(l.jG).map(e=>{const t=this.hass.localize(`ui.panel.profile.number_format.formats.${e}`);return{value:e,label:t,secondary:"89"!==t.slice(t.length-2)?(0,n.ZV)(1234567.89,{...this.hass.locale,number_format:e}):void 0}})}"> </ha-select> </ha-settings-row> `}async _handleFormatSelection(e){(0,s.r)(this,"hass-number-format-select",e.detail.value)}constructor(...e){super(...e),this.narrow=!1}}d.styles=i.AH`ha-select{display:block;width:100%}`,(0,o.Cg)([(0,r.MZ)({attribute:!1})],d.prototype,"hass",void 0),(0,o.Cg)([(0,r.MZ)({type:Boolean})],d.prototype,"narrow",void 0),d=(0,o.Cg)([(0,r.EM)("ha-pick-number-format-row")],d),t()}catch(e){t(e)}})},11775(e,t,a){a.a(e,async function(e,t){try{var o=a(62826),i=a(5124),r=a(22441),s=a(42002),n=a(1087),h=a(18350),l=(a(8034),a(37532)),c=a(91485),d=(a(64013),a(92677),a(33009)),p=a(54706),u=a(25806),g=a(36918),m=a(48183),v=e([h,l,c]);[h,l,c]=v.then?(await v)():v;const b="default";class y extends((0,p.E)(i.WF)){hassSubscribe(){return[(0,d.s)(this.hass,({value:e})=>{this._userTheme=e}).catch(()=>(this._userTheme=void 0,()=>{}))]}render(){const e=this.hass.themes.themes&&Object.keys(this.hass.themes.themes).length,t=""===this.hass.selectedTheme?.theme,a=this.hass.selectedTheme?.theme?this.hass.selectedTheme?.theme:this.hass.themes.darkMode&&this.hass.themes.default_dark_theme||this.hass.themes.default_theme,o=this.hass.selectedTheme,r=this._getLocalTheme(),s=void 0!==this._userTheme&&null===this._userTheme&&null!==r;return i.qy` <ha-settings-row .narrow="${this.narrow}"> <span slot="heading">${this.hass.localize("ui.panel.profile.themes.header")}</span> <span slot="description"> ${e?"":this.hass.localize("ui.panel.profile.themes.error_no_theme")} <a href="${(0,g.o)(this.hass,"/integrations/frontend/#defining-themes")}" target="_blank" rel="noreferrer"> ${this.hass.localize("ui.panel.profile.themes.link_promo")} </a> </span> <ha-theme-picker .hass="${this.hass}" .label="${this.hass.localize("ui.panel.profile.themes.dropdown_label")}" .noThemeLabel="${this.hass.localize("ui.panel.profile.themes.use_default")}" .value="${this.hass.selectedTheme?.theme||void 0}" .disabled="${!e}" include-default @value-changed="${this._handleThemeSelection}"></ha-theme-picker> </ha-settings-row> ${a===b||t&&this.hass.themes.default_dark_theme&&this.hass.themes.default_theme||this._supportsModeSelection(a)?i.qy`<div class="inputs"> <ha-radio-group @change="${this._handleDarkMode}" name="dark_mode" .ariaLabel="${this.hass.localize("ui.panel.profile.themes.theme_mode")}" .value="${void 0===o?.dark?"auto":o.dark?"dark":"light"}" orientation="horizontal"> <ha-radio-option value="auto"> ${this.hass.localize("ui.panel.profile.themes.dark_mode.auto")} </ha-radio-option> <ha-radio-option value="light"> ${this.hass.localize("ui.panel.profile.themes.dark_mode.light")} </ha-radio-option> <ha-radio-option value="dark"> ${this.hass.localize("ui.panel.profile.themes.dark_mode.dark")} </ha-radio-option> </ha-radio-group> ${a===b?i.qy`<div class="color-pickers"> <ha-input .value="${o?.primaryColor||u.BN}" type="color" .label="${this.hass.localize("ui.panel.profile.themes.primary_color")}" .name="${"primaryColor"}" @change="${this._handleColorChange}"></ha-input> <ha-input .value="${o?.accentColor||u.z2}" type="color" .label="${this.hass.localize("ui.panel.profile.themes.accent_color")}" .name="${"accentColor"}" @change="${this._handleColorChange}"></ha-input> ${o?.primaryColor||o?.accentColor?i.qy` <ha-button appearance="plain" size="small" @click="${this._resetColors}"> ${this.hass.localize("ui.panel.profile.themes.reset")} </ha-button>`:""} </div>`:""} </div>`:""} ${s?i.qy` <ha-settings-row .narrow="${this.narrow}"> <span slot="heading"> ${this.hass.localize("ui.panel.profile.themes.migrate_header")} </span> <span slot="description"> ${this.hass.localize("ui.panel.profile.themes.migrate_description")} </span> <ha-button appearance="plain" size="small" .disabled="${this._migrating}" @click="${this._migrateThemePreferences}"> ${this.hass.localize("ui.panel.profile.themes.migrate_button")} </ha-button> </ha-settings-row> `:""} `}_handleColorChange(e){const t=e.target;"primaryColor"===t.name&&(t.value=(0,s.C)(t.value)),(0,n.r)(this,"settheme",{[t.name]:t.value})}_resetColors(){(0,n.r)(this,"settheme",{primaryColor:void 0,accentColor:void 0})}_supportsModeSelection(e){const t=this.hass.themes.themes[e];return!!t&&!!(t.modes&&"light"in t.modes&&"dark"in t.modes)}_handleDarkMode(e){let t;switch(e.currentTarget.value){case"light":t=!1;break;case"dark":t=!0}(0,n.r)(this,"settheme",{dark:t})}_handleThemeSelection(e){e.stopPropagation();const t=e.detail.value;void 0!==t?t!==this.hass.selectedTheme?.theme&&(0,n.r)(this,"settheme",{theme:t,primaryColor:void 0,accentColor:void 0}):this.hass.selectedTheme?.theme&&(0,n.r)(this,"settheme",{theme:"",primaryColor:void 0,accentColor:void 0})}_getLocalTheme(){return this.hass.selectedTheme??null}async _migrateThemePreferences(){const e=this._getLocalTheme();if(e){this._migrating=!0;try{await(0,d.j)(this.hass,e),(0,m.N_)(),(0,n.r)(this,"hass-notification",{message:this.hass.localize("ui.panel.profile.themes.migrate_success")})}catch(e){(0,n.r)(this,"hass-notification",{message:this.hass.localize("ui.panel.profile.themes.migrate_failed")})}finally{this._migrating=!1}}}constructor(...e){super(...e),this.narrow=!1,this._migrating=!1}}y.styles=i.AH`a{color:var(--primary-color)}.inputs{display:flex;flex-wrap:wrap;justify-content:space-between;margin:0 12px}ha-radio-group{display:flex;justify-content:center;margin-inline-end:var(--ha-space-3)}.color-pickers{display:flex;justify-content:flex-end;align-items:center;flex-grow:1}ha-input{min-width:75px;flex-grow:1;margin:0 4px}ha-theme-picker{display:block;width:100%}`,(0,o.Cg)([(0,r.MZ)({attribute:!1})],y.prototype,"hass",void 0),(0,o.Cg)([(0,r.MZ)({type:Boolean})],y.prototype,"narrow",void 0),(0,o.Cg)([(0,r.wk)()],y.prototype,"_userTheme",void 0),(0,o.Cg)([(0,r.wk)()],y.prototype,"_migrating",void 0),y=(0,o.Cg)([(0,r.EM)("ha-pick-theme-row")],y),t()}catch(e){t(e)}})},3001(e,t,a){a.a(e,async function(e,t){try{a(18111),a(61701);var o=a(62826),i=a(5124),r=a(22441),s=a(30162),n=a(1087),h=(a(76776),a(606)),l=(a(8034),a(46927)),c=e([h,s]);[h,s]=c.then?(await c)():c;class d extends i.WF{render(){const e=new Date;return i.qy` <ha-settings-row .narrow="${this.narrow}"> <span slot="heading"> ${this.hass.localize("ui.panel.profile.time_format.header")} </span> <span slot="description"> ${this.hass.localize("ui.panel.profile.time_format.description")} </span> <ha-select .label="${this.hass.localize("ui.panel.profile.time_format.dropdown_label")}" .disabled="${void 0===this.hass.locale}" .value="${this.hass.locale.time_format}" @selected="${this._handleFormatSelection}" .options="${Object.values(l.Hg).map(t=>({value:t.toString(),label:this.hass.localize(`ui.panel.profile.time_format.formats.${t}`),secondary:(0,s.fU)(e,{...this.hass.locale,time_format:t},this.hass.config)}))}"> </ha-select> </ha-settings-row> `}async _handleFormatSelection(e){(0,n.r)(this,"hass-time-format-select",e.detail.value)}constructor(...e){super(...e),this.narrow=!1}}d.styles=i.AH`ha-select{display:block;width:100%}`,(0,o.Cg)([(0,r.MZ)({attribute:!1})],d.prototype,"hass",void 0),(0,o.Cg)([(0,r.MZ)({type:Boolean})],d.prototype,"narrow",void 0),d=(0,o.Cg)([(0,r.EM)("ha-pick-time-format-row")],d),t()}catch(e){t(e)}})},81115(e,t,a){a.a(e,async function(e,t){try{a(18111),a(61701);var o=a(62826),i=a(5124),r=a(22441),s=a(95747),n=a(8480),h=a(1087),l=(a(76776),a(606)),c=(a(8034),a(46927)),d=e([l,n,s]);[l,n,s]=d.then?(await d)():d;class p extends i.WF{render(){const e=new Date;return i.qy` <ha-settings-row .narrow="${this.narrow}"> <span slot="heading"> ${this.hass.localize("ui.panel.profile.time_zone.header")} </span> <span slot="description"> ${this.hass.localize("ui.panel.profile.time_zone.description")} </span> <ha-select .label="${this.hass.localize("ui.panel.profile.time_zone.dropdown_label")}" .disabled="${void 0===this.hass.locale}" .value="${this.hass.locale.time_zone}" @selected="${this._handleFormatSelection}" .options="${Object.values(c.Wj).map(t=>({value:t.toString(),label:this.hass.localize(`ui.panel.profile.time_zone.options.${t}`,{timezone:(0,n.wj)(t,this.hass.config.time_zone).replace("_"," ")}),secondary:(0,s.GH)(e,{...this.hass.locale,time_zone:t},this.hass.config)}))}"> </ha-select> </ha-settings-row> `}async _handleFormatSelection(e){(0,h.r)(this,"hass-time-zone-select",e.detail.value)}constructor(...e){super(...e),this.narrow=!1}}p.styles=i.AH`ha-select{display:block;width:100%}`,(0,o.Cg)([(0,r.MZ)({attribute:!1})],p.prototype,"hass",void 0),(0,o.Cg)([(0,r.MZ)({type:Boolean})],p.prototype,"narrow",void 0),p=(0,o.Cg)([(0,r.EM)("ha-pick-time-zone-row")],p),t()}catch(e){t(e)}})},39517(e,t,a){a.a(e,async function(e,o){try{a.r(t);var i=a(62826),r=a(5124),s=a(22441),n=a(36312),h=a(1087),l=a(12587),c=a(18350),d=(a(76776),a(83892),a(16869)),p=a(48250),u=a(65063),g=a(68302),m=a(40511),v=a(14503),b=a(84187),y=a(89483),f=a(50366),w=a(35839),_=a(62337),k=a(1354),$=a(35342),C=a(94655),x=a(16831),z=a(99229),M=a(11775),Z=a(3001),q=a(81115),H=a(16195),T=a(12623),E=a(55256),S=e([c,m,y,f,w,k,$,C,x,z,M,Z,q,H,T,E]);[c,m,y,f,w,k,$,C,x,z,M,Z,q,H,T,E]=S.then?(await S)():S;class A extends r.WF{_getCoreData(){this._unsubCoreData=(0,p.oT)(this.hass.connection,"core",({value:e})=>{this._coreUserData=e})}connectedCallback(){super.connectedCallback(),this.hass&&this._getCoreData(),this._scrollToHash()}firstUpdated(){this._unsubCoreData||this._getCoreData()}disconnectedCallback(){super.disconnectedCallback(),this._unsubCoreData&&(this._unsubCoreData.then(e=>e()),this._unsubCoreData=void 0)}async _scrollToHash(){await(0,l.E)();const e=window.location.hash.substring(1);if(e){const t=this.shadowRoot.getElementById(e);t?.scrollIntoView(),this._clearHash()}}_clearHash(){history.replaceState(null,"",window.location.pathname)}render(){return r.qy` <hass-tabs-subpage main-page .hass="${this.hass}" .narrow="${this.narrow}" .tabs="${_.profileSections}" .route="${this.route}"> <div slot="title">${this.hass.localize("panel.profile")}</div> <div class="content"> <ha-card .header="${this.hass.user.name}"> <div class="card-content"> ${this.hass.localize("ui.panel.profile.current_user",{fullName:this.hass.user.name})} ${this.hass.user.is_owner?this.hass.localize("ui.panel.profile.is_owner"):""} </div> <div class="card-actions"> <ha-button variant="danger" appearance="plain" @click="${this._handleLogOut}"> ${this.hass.localize("ui.panel.profile.logout")} </ha-button> </div> </ha-card> <ha-card .header="${this.hass.localize("ui.panel.profile.user_preferences_header")}"> <div class="card-content"> ${this.hass.localize("ui.panel.profile.user_preferences_detail")} </div> <ha-pick-language-row .narrow="${this.narrow}" .hass="${this.hass}"></ha-pick-language-row> <ha-pick-theme-row .narrow="${this.narrow}" .hass="${this.hass}"></ha-pick-theme-row> <ha-pick-dashboard-row .narrow="${this.narrow}" .hass="${this.hass}"></ha-pick-dashboard-row> <ha-row-item> <span slot="headline">${this.hass.localize("ui.panel.profile.customize_sidebar.header")}</span> <span slot="supporting-text">${this.hass.localize("ui.panel.profile.customize_sidebar.description")}</span> <ha-button slot="end" appearance="plain" size="small" @click="${this._customizeSidebar}"> ${this.hass.localize("ui.panel.profile.customize_sidebar.button")} </ha-button> </ha-row-item> ${this.hass.user.is_admin?r.qy` <ha-entity-id-picker-row .hass="${this.hass}" .coreUserData="${this._coreUserData}"></ha-entity-id-picker-row> `:r.s6} </ha-card> <ha-card .header="${this.hass.localize("ui.panel.profile.localization_header")}"> <div class="card-content"> ${this.hass.localize("ui.panel.profile.localization_detail")} </div> <ha-pick-time-zone-row .narrow="${this.narrow}" .hass="${this.hass}"></ha-pick-time-zone-row> <ha-pick-number-format-row .narrow="${this.narrow}" .hass="${this.hass}"></ha-pick-number-format-row> <ha-pick-time-format-row .narrow="${this.narrow}" .hass="${this.hass}"></ha-pick-time-format-row> <ha-pick-date-format-row .narrow="${this.narrow}" .hass="${this.hass}"></ha-pick-date-format-row> <ha-pick-first-weekday-row .narrow="${this.narrow}" .hass="${this.hass}"></ha-pick-first-weekday-row> </ha-card> <ha-card .header="${this.hass.localize(d.g?"ui.panel.profile.mobile_app_settings":"ui.panel.profile.browser_settings")}"> <div class="card-content"> ${this.hass.localize("ui.panel.profile.client_settings_detail")} </div> ${"auto"===this.hass.dockedSidebar&&this.narrow?r.s6:r.qy` <ha-force-narrow-row .hass="${this.hass}"></ha-force-narrow-row> `} ${"vibrate"in navigator?r.qy` <ha-set-vibrate-row .hass="${this.hass}"></ha-set-vibrate-row> `:r.s6} ${!d.g&&(0,n.x)(this.hass.config,"html5.notify")?r.qy` <ha-push-notifications-row .hass="${this.hass}"></ha-push-notifications-row> `:r.s6} <ha-set-suspend-row .hass="${this.hass}"></ha-set-suspend-row> ${b.M?r.s6:r.qy` <ha-enable-shortcuts-row id="shortcuts" .hass="${this.hass}"></ha-enable-shortcuts-row> `} </ha-card> </div> </hass-tabs-subpage> `}_customizeSidebar(){(0,g.w)(this)}_handleLogOut(){(0,u.dk)(this,{title:this.hass.localize("ui.panel.profile.logout_title"),text:this.hass.localize("ui.panel.profile.logout_text"),confirmText:this.hass.localize("ui.panel.profile.logout"),confirm:()=>(0,h.r)(this,"hass-logout"),destructive:!0})}static get styles(){return[v.RF,r.AH`: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}`]}constructor(...e){super(...e),this.narrow=!1}}(0,i.Cg)([(0,s.MZ)({attribute:!1})],A.prototype,"hass",void 0),(0,i.Cg)([(0,s.MZ)({type:Boolean})],A.prototype,"narrow",void 0),(0,i.Cg)([(0,s.wk)()],A.prototype,"_coreUserData",void 0),(0,i.Cg)([(0,s.MZ)({attribute:!1})],A.prototype,"route",void 0),A=(0,i.Cg)([(0,s.EM)("ha-profile-section-general")],A),o()}catch(e){o(e)}})},16195(e,t,a){a.a(e,async function(e,t){try{var o=a(62826),i=a(5124),r=a(22441),s=a(36312),n=a(33680),h=(a(83892),a(36918)),l=e([n]);n=(l.then?(await l)():l)[0];class c extends i.WF{render(){const e=(0,s.x)(this.hass.config,"html5.notify");let t;t=n.x?e?"description":"error_load_platform":"error_use_https";const a=!e||!n.x;return i.qy` <ha-row-item> <span slot="headline">${this.hass.localize("ui.panel.profile.push_notifications.header")}</span> <span slot="supporting-text">${this.hass.localize(`ui.panel.profile.push_notifications.${t}`)} <a href="${(0,h.o)(this.hass,"/integrations/html5")}" target="_blank" rel="noreferrer">${this.hass.localize("ui.panel.profile.push_notifications.link_promo")}</a></span> <ha-push-notifications-toggle slot="end" .hass="${this.hass}" .disabled="${a}"></ha-push-notifications-toggle> </ha-row-item> `}}c.styles=i.AH`a{color:var(--primary-color)}`,(0,o.Cg)([(0,r.MZ)({attribute:!1})],c.prototype,"hass",void 0),c=(0,o.Cg)([(0,r.EM)("ha-push-notifications-row")],c),t()}catch(e){t(e)}})},12623(e,t,a){a.a(e,async function(e,t){try{var o=a(62826),i=a(5124),r=a(22441),s=a(1087),n=a(59646),h=(a(83892),e([n]));n=(h.then?(await h)():h)[0];class l extends i.WF{render(){return i.qy` <ha-row-item> <span slot="headline">${this.hass.localize("ui.panel.profile.suspend.header")}</span> <span slot="supporting-text">${this.hass.localize("ui.panel.profile.suspend.description")}</span> <ha-switch slot="end" .checked="${this.hass.suspendWhenHidden}" @change="${this._checkedChanged}"></ha-switch> </ha-row-item> `}async _checkedChanged(e){const t=e.target.checked;t!==this.hass.suspendWhenHidden&&(0,s.r)(this,"hass-suspend-when-hidden",{suspend:t})}}(0,o.Cg)([(0,r.MZ)({attribute:!1})],l.prototype,"hass",void 0),l=(0,o.Cg)([(0,r.EM)("ha-set-suspend-row")],l),t()}catch(e){t(e)}})},55256(e,t,a){a.a(e,async function(e,t){try{var o=a(62826),i=a(5124),r=a(22441),s=a(1087),n=a(59646),h=(a(83892),a(88360)),l=e([n]);n=(l.then?(await l)():l)[0];class c extends i.WF{render(){return i.qy` <ha-row-item> <span slot="headline">${this.hass.localize("ui.panel.profile.vibrate.header")}</span> <span slot="supporting-text">${this.hass.localize("ui.panel.profile.vibrate.description")}</span> <ha-switch slot="end" .checked="${this.hass.vibrate}" @change="${this._checkedChanged}"></ha-switch> </ha-row-item> `}async _checkedChanged(e){const t=e.target.checked;t!==this.hass.vibrate&&((0,s.r)(this,"hass-vibrate",{vibrate:t}),(0,h.j)(this,"light"))}}(0,o.Cg)([(0,r.MZ)({attribute:!1})],c.prototype,"hass",void 0),c=(0,o.Cg)([(0,r.EM)("ha-set-vibrate-row")],c),t()}catch(e){t(e)}})},36918(e,t,a){a.d(t,{o:()=>o});const o=(e,t)=>`https://www.iobroker.net/#${e.language&&e.language.split("-")[0]||"en"}/adapters/adapterref/iobroker.lovelace/README.md#`},84187(e,t,a){a.d(t,{M:()=>o});const o=/(?:iphone|android|ipad)/i.test(navigator.userAgent)}};