UNPKG

iobroker.lovelace

Version:

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

5 lines 83.5 kB
export const __webpack_ids__=["65120"];export const __webpack_modules__={19631:function(e,t,a){a.d(t,{Bt:()=>o,T8:()=>c});var i=a(88977),n=a(20382);const s=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],o=e=>e.first_weekday===n.FS.language?"weekInfo"in Intl.Locale.prototype?new Intl.Locale(e.language).weekInfo.firstDay%7:(0,i.L)(e.language)%7:s.includes(e.first_weekday)?s.indexOf(e.first_weekday):1,c=e=>{const t=o(e);return s[t]}},94947:function(e,t,a){a.a(e,(async function(e,i){try{a.d(t,{G:()=>l});var n=a(16485),s=a(27486),o=a(27046),c=e([n,o]);[n,o]=c.then?(await c)():c;const r=(0,s.Z)((e=>new Intl.RelativeTimeFormat(e.language,{numeric:"auto"}))),l=(e,t,a,i=!0)=>{const n=(0,o.W)(e,a,t);return i?r(t).format(n.value,n.unit):Intl.NumberFormat(t.language,{style:"unit",unit:n.unit,unitDisplay:"long"}).format(Math.abs(n.value))};i()}catch(e){i(e)}}))},97547:function(e,t,a){a.a(e,(async function(e,i){try{a.d(t,{c:()=>g,computeStateDisplay:()=>f});var n=a(96194),s=a(20382),o=a(54363),c=a(46467),r=a(64214),l=a(33570),d=a(50602),h=a(87974),u=a(73850),p=e([o,d,c,l,r]);[o,d,c,l,r]=p.then?(await p)():p;const f=(e,t,a,i,n,s,o)=>{const c=s?.[t.entity_id];return g(e,a,i,n,c,t.entity_id,t.attributes,void 0!==o?o:t.state)},g=(e,t,a,i,p,f,g,m)=>{if(m===n.lz||m===n.nZ)return e(`state.default.${m}`);const k=(0,u.M)(f),v="counter"===k||"number"===k||"input_number"===k;if((0,d.sJ)(g,"sensor"===k?a:[])||v){if("duration"===g.device_class&&g.unit_of_measurement&&o.a_.includes(g.unit_of_measurement))try{return(0,o.LU)(t,m,g.unit_of_measurement,p?.display_precision)}catch(e){}if("monetary"===g.device_class)try{return(0,d.uf)(m,t,{style:"currency",currency:g.unit_of_measurement,minimumFractionDigits:2,...(0,d.l4)({state:m,attributes:g},p)})}catch(e){}const a=(0,d.uf)(m,t,(0,d.l4)({state:m,attributes:g},p)),i=p?.translation_key&&e(`component.${p.platform}.entity.${k}.${p.translation_key}.unit_of_measurement`)||g.unit_of_measurement;return i?`${a}${(0,h.L)(i,t)}${i}`:a}if(["date","input_datetime","time"].includes(k))try{const e=m.split(" ");if(2===e.length)return(0,r.o0)(new Date(e.join("T")),{...t,time_zone:s.c_.local},i);if(1===e.length){if(m.includes("-"))return(0,c.p6)(new Date(`${m}T00:00`),{...t,time_zone:s.c_.local},i);if(m.includes(":")){const e=new Date;return(0,l.mr)(new Date(`${e.toISOString().split("T")[0]}T${m}`),{...t,time_zone:s.c_.local},i)}}return m}catch(e){return m}if(["button","conversation","event","image","input_button","notify","scene","stt","tag","tts","wake_word","datetime"].includes(k)||"sensor"===k&&"timestamp"===g.device_class)try{return(0,r.o0)(new Date(m),t,i)}catch(e){return m}return p?.translation_key&&e(`component.${p.platform}.entity.${k}.${p.translation_key}.state.${m}`)||g.device_class&&e(`component.${k}.entity_component.${g.device_class}.state.${m}`)||e(`component.${k}.entity_component._.state.${m}`)||m};i()}catch(e){i(e)}}))},87707:function(e,t,a){a.d(t,{Q:()=>i});const i=e=>!(!e.detail.selected||"property"!==e.detail.source)&&(e.currentTarget.selected=!1,!0)},87733:function(e,t,a){a.d(t,{f:()=>i});const i=e=>e.charAt(0).toUpperCase()+e.slice(1)},27046:function(e,t,a){a.a(e,(async function(e,i){try{a.d(t,{W:()=>h});var n=a(13809),s=a(29558),o=a(94763),c=a(19631);const r=1e3,l=60,d=60*l;function h(e,t=Date.now(),a,i={}){const h={...u,...i||{}},p=(+e-+t)/r;if(Math.abs(p)<h.second)return{value:Math.round(p),unit:"second"};const f=p/l;if(Math.abs(f)<h.minute)return{value:Math.round(f),unit:"minute"};const g=p/d;if(Math.abs(g)<h.hour)return{value:Math.round(g),unit:"hour"};const m=new Date(e),k=new Date(t);m.setHours(0,0,0,0),k.setHours(0,0,0,0);const v=(0,n.j)(m,k);if(0===v)return{value:Math.round(g),unit:"hour"};if(Math.abs(v)<h.day)return{value:v,unit:"day"};const b=(0,c.Bt)(a),y=(0,s.z)(m,{weekStartsOn:b}),_=(0,s.z)(k,{weekStartsOn:b}),w=(0,o.p)(y,_);if(0===w)return{value:v,unit:"day"};if(Math.abs(w)<h.week)return{value:w,unit:"week"};const x=m.getFullYear()-k.getFullYear(),$=12*x+m.getMonth()-k.getMonth();return 0===$?{value:w,unit:"week"}:Math.abs($)<h.month||0===x?{value:$,unit:"month"}:{value:Math.round(x),unit:"year"}}const u={second:45,minute:45,hour:22,day:5,week:4,month:11};i()}catch(p){i(p)}}))},34273:function(e,t,a){var i=a(44249),n=a(72621),s=(a(9359),a(31526),a(22997),a(57243)),o=a(15093),c=a(5111),r=a(76525);(0,i.Z)([(0,o.Mo)("ha-button-menu")],(function(e,t){class a extends t{constructor(...t){super(...t),e(this)}}return{F:a,d:[{kind:"field",key:r.gA,value:void 0},{kind:"field",decorators:[(0,o.Cb)()],key:"corner",value:()=>"BOTTOM_START"},{kind:"field",decorators:[(0,o.Cb)({attribute:"menu-corner"})],key:"menuCorner",value:()=>"START"},{kind:"field",decorators:[(0,o.Cb)({type:Number})],key:"x",value:()=>null},{kind:"field",decorators:[(0,o.Cb)({type:Number})],key:"y",value:()=>null},{kind:"field",decorators:[(0,o.Cb)({type:Boolean})],key:"multi",value:()=>!1},{kind:"field",decorators:[(0,o.Cb)({type:Boolean})],key:"activatable",value:()=>!1},{kind:"field",decorators:[(0,o.Cb)({type:Boolean})],key:"disabled",value:()=>!1},{kind:"field",decorators:[(0,o.Cb)({type:Boolean})],key:"fixed",value:()=>!1},{kind:"field",decorators:[(0,o.Cb)({type:Boolean,attribute:"no-anchor"})],key:"noAnchor",value:()=>!1},{kind:"field",decorators:[(0,o.IO)("mwc-menu",!0)],key:"_menu",value:void 0},{kind:"get",key:"items",value:function(){return this._menu?.items}},{kind:"get",key:"selected",value:function(){return this._menu?.selected}},{kind:"method",key:"focus",value:function(){this._menu?.open?this._menu.focusItemAtIndex(0):this._triggerButton?.focus()}},{kind:"method",key:"render",value:function(){return s.dy` <div @click="${this._handleClick}"> <slot name="trigger" @slotchange="${this._setTriggerAria}"></slot> </div> <mwc-menu .corner="${this.corner}" .menuCorner="${this.menuCorner}" .fixed="${this.fixed}" .multi="${this.multi}" .activatable="${this.activatable}" .y="${this.y}" .x="${this.x}"> <slot></slot> </mwc-menu> `}},{kind:"method",key:"firstUpdated",value:function(e){(0,n.Z)(a,"firstUpdated",this,3)([e]),"rtl"===c.E.document.dir&&this.updateComplete.then((()=>{this.querySelectorAll("mwc-list-item").forEach((e=>{const t=document.createElement("style");t.innerHTML="span.material-icons:first-of-type { margin-left: var(--mdc-list-item-graphic-margin, 32px) !important; margin-right: 0px !important;}",e.shadowRoot.appendChild(t)}))}))}},{kind:"method",key:"_handleClick",value:function(){this.disabled||(this._menu.anchor=this.noAnchor?null:this,this._menu.show())}},{kind:"get",key:"_triggerButton",value:function(){return this.querySelector('ha-icon-button[slot="trigger"], mwc-button[slot="trigger"]')}},{kind:"method",key:"_setTriggerAria",value:function(){this._triggerButton&&(this._triggerButton.ariaHasPopup="menu")}},{kind:"field",static:!0,key:"styles",value:()=>s.iv`:host{display:inline-block;position:relative}::slotted([disabled]){color:var(--disabled-text-color)}`}]}}),s.oi)},54977:function(e,t,a){var i=a(44249),n=a(57243),s=a(15093);(0,i.Z)([(0,s.Mo)("ha-card")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,s.Cb)()],key:"header",value:void 0},{kind:"field",decorators:[(0,s.Cb)({type:Boolean,reflect:!0})],key:"raised",value:()=>!1},{kind:"field",static:!0,key:"styles",value:()=>n.iv`:host{background:var(--ha-card-background,var(--card-background-color,#fff));-webkit-backdrop-filter:var(--ha-card-backdrop-filter,none);backdrop-filter:var(--ha-card-backdrop-filter,none);box-shadow:var(--ha-card-box-shadow,none);box-sizing:border-box;border-radius:var(--ha-card-border-radius,12px);border-width:var(--ha-card-border-width,1px);border-style:solid;border-color:var(--ha-card-border-color,var(--divider-color,#e0e0e0));color:var(--primary-text-color);display:block;transition:all .3s ease-out;position:relative}:host([raised]){border:none;box-shadow:var(--ha-card-box-shadow,0px 2px 1px -1px rgba(0,0,0,.2),0px 1px 1px 0px rgba(0,0,0,.14),0px 1px 3px 0px rgba(0,0,0,.12))}.card-header,:host ::slotted(.card-header){color:var(--ha-card-header-color,var(--primary-text-color));font-family:var(--ha-card-header-font-family, inherit);font-size:var(--ha-card-header-font-size, 24px);letter-spacing:-.012em;line-height:48px;padding:12px 16px 16px;display:block;margin-block-start:0px;margin-block-end:0px;font-weight:400}:host ::slotted(.card-content:not(:first-child)),slot:not(:first-child)::slotted(.card-content){padding-top:0px;margin-top:-8px}:host ::slotted(.card-content){padding:16px}:host ::slotted(.card-actions){border-top:1px solid var(--divider-color,#e8e8e8);padding:5px 16px}`},{kind:"method",key:"render",value:function(){return n.dy` ${this.header?n.dy`<h1 class="card-header">${this.header}</h1>`:n.Ld} <slot></slot> `}}]}}),n.oi)},20130:function(e,t,a){var i=a(44249),n=a(72621),s=a(39785),o=a(52876),c=a(15093),r=a(57243),l=a(5111);(0,i.Z)([(0,c.Mo)("ha-fab")],(function(e,t){class a extends t{constructor(...t){super(...t),e(this)}}return{F:a,d:[{kind:"method",key:"firstUpdated",value:function(e){(0,n.Z)(a,"firstUpdated",this,3)([e]),this.style.setProperty("--mdc-theme-secondary","var(--primary-color)")}},{kind:"field",static:!0,key:"styles",value:()=>[o.W,r.iv`:host .mdc-fab--extended .mdc-fab__icon{margin-inline-start:-8px;margin-inline-end:12px;direction:var(--direction)}:disabled{--mdc-theme-secondary:var(--disabled-text-color);pointer-events:none}`,"rtl"===l.E.document.dir?r.iv`:host .mdc-fab--extended .mdc-fab__icon{direction:rtl}`:r.iv``]}]}}),s._)},9425:function(e,t,a){var i=a(44249),n=(a(92745),a(9359),a(1331),a(70104),a(2060),a(57243)),s=a(15093),o=a(36522),c=a(28008);a(48103),a(41307),a(65981),a(23334);(0,i.Z)([(0,s.Mo)("ha-filter-states")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,s.Cb)()],key:"label",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"value",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"states",value:void 0},{kind:"field",decorators:[(0,s.Cb)({type:Boolean})],key:"narrow",value:()=>!1},{kind:"field",decorators:[(0,s.Cb)({type:Boolean,reflect:!0})],key:"expanded",value:()=>!1},{kind:"field",decorators:[(0,s.SB)()],key:"_shouldRender",value:()=>!1},{kind:"field",decorators:[(0,s.IO)("mwc-list")],key:"_list",value:void 0},{kind:"method",key:"render",value:function(){if(!this.states)return n.Ld;const e=this.states.find((e=>e.icon));return n.dy` <ha-expansion-panel left-chevron .expanded="${this.expanded}" @expanded-will-change="${this._expandedWillChange}" @expanded-changed="${this._expandedChanged}"> <div slot="header" class="header"> ${this.label} ${this.value?.length?n.dy`<div class="badge">${this.value?.length}</div> <ha-icon-button .path="${"M21 8H3V6H21V8M13.81 16H10V18H13.09C13.21 17.28 13.46 16.61 13.81 16M18 11H6V13H18V11M21.12 15.46L19 17.59L16.88 15.46L15.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"}" @click="${this._clearFilter}"></ha-icon-button>`:n.Ld} </div> ${this._shouldRender?n.dy` <mwc-list @selected="${this._statesSelected}" multi class="ha-scrollbar"> ${this.states.map((t=>n.dy`<ha-check-list-item .value="${t.value}" .selected="${this.value?.includes(t.value)??!1}" .graphic="${e?"icon":null}"> ${t.icon?n.dy`<ha-icon slot="graphic" .icon="${t.icon}"></ha-icon>`:n.Ld} ${t.label} </ha-check-list-item>`))} </mwc-list> `:n.Ld} </ha-expansion-panel> `}},{kind:"method",key:"willUpdate",value:function(e){e.has("expanded")&&this.expanded&&(this._shouldRender=!0)}},{kind:"method",key:"updated",value:function(e){(e.has("expanded")||e.has("states"))&&this.expanded&&setTimeout((async()=>{if(!this.expanded)return;const e=this._list;e&&(e.style.height=this.clientHeight-49+"px")}),300)}},{kind:"method",key:"_expandedWillChange",value:function(e){this._shouldRender=e.detail.expanded}},{kind:"method",key:"_expandedChanged",value:function(e){this.expanded=e.detail.expanded}},{kind:"method",key:"_statesSelected",value:async function(e){if(!e.detail.index.size)return(0,o.B)(this,"data-table-filter-changed",{value:[],items:void 0}),void(this.value=[]);const t=[];for(const a of e.detail.index){const e=this.states[a].value;t.push(e)}this.value=t,(0,o.B)(this,"data-table-filter-changed",{value:t,items:void 0})}},{kind:"method",key:"_clearFilter",value:function(e){e.preventDefault(),this.value=void 0,(0,o.B)(this,"data-table-filter-changed",{value:void 0,items:void 0})}},{kind:"get",static:!0,key:"styles",value:function(){return[c.$c,n.iv`:host{border-bottom:1px solid var(--divider-color)}:host([expanded]){flex:1;height:0}ha-expansion-panel{--ha-card-border-radius:0;--expansion-panel-content-padding:0}.header{display:flex;align-items:center}.header ha-icon-button{margin-inline-start:auto;margin-inline-end:8px}.badge{display:inline-block;margin-left:8px;margin-inline-start:8px;margin-inline-end:0;min-width:16px;box-sizing:border-box;border-radius:50%;font-weight:400;font-size:11px;background-color:var(--primary-color);line-height:16px;text-align:center;padding:0px 2px;color:var(--text-primary-color)}`]}}]}}),n.oi)},59959:function(e,t,a){a.a(e,(async function(e,i){try{a.r(t),a.d(t,{HaIconOverflowMenu:()=>u});var n=a(44249),s=(a(9359),a(70104),a(57243)),o=a(15093),c=a(35359),r=a(28008),l=(a(34273),a(23334),a(7285),a(37583),a(56032)),d=e([l]);l=(d.then?(await d)():d)[0];const h="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";let u=(0,n.Z)([(0,o.Mo)("ha-icon-overflow-menu")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,o.Cb)({type:Array})],key:"items",value:()=>[]},{kind:"field",decorators:[(0,o.Cb)({type:Boolean})],key:"narrow",value:()=>!1},{kind:"method",key:"render",value:function(){return s.dy` ${this.narrow?s.dy` <ha-button-menu @click="${this._handleIconOverflowMenuOpened}" @closed="${this._handleIconOverflowMenuClosed}" class="ha-icon-overflow-menu-overflow" absolute> <ha-icon-button .label="${this.hass.localize("ui.common.overflow_menu")}" .path="${h}" slot="trigger"></ha-icon-button> ${this.items.map((e=>e.divider?s.dy`<li divider role="separator"></li>`:s.dy`<ha-list-item graphic="icon" ?disabled="${e.disabled}" @click="${e.action}" class="${(0,c.$)({warning:Boolean(e.warning)})}"> <div slot="graphic"> <ha-svg-icon class="${(0,c.$)({warning:Boolean(e.warning)})}" .path="${e.path}"></ha-svg-icon> </div> ${e.label} </ha-list-item> `))} </ha-button-menu>`:s.dy` ${this.items.map((e=>e.narrowOnly?s.Ld:e.divider?s.dy`<div role="separator"></div>`:s.dy`<ha-tooltip .disabled="${!e.tooltip}" .content="${e.tooltip??""}"> <ha-icon-button @click="${e.action}" .label="${e.label}" .path="${e.path}" ?disabled="${e.disabled}"></ha-icon-button> </ha-tooltip>`))} `} `}},{kind:"method",key:"_handleIconOverflowMenuOpened",value:function(e){e.stopPropagation();const t=this.closest(".mdc-data-table__row");t&&(t.style.zIndex="1")}},{kind:"method",key:"_handleIconOverflowMenuClosed",value:function(){const e=this.closest(".mdc-data-table__row");e&&(e.style.zIndex="")}},{kind:"get",static:!0,key:"styles",value:function(){return[r.Qx,s.iv`:host{display:flex;justify-content:flex-end}li[role=separator]{border-bottom-color:var(--divider-color)}div[role=separator]{border-right:1px solid var(--divider-color);width:1px}ha-list-item[disabled] ha-svg-icon{color:var(--disabled-text-color)}`]}}]}}),s.oi);i()}catch(e){i(e)}}))},7285:function(e,t,a){a.d(t,{M:()=>l});var i=a(44249),n=a(72621),s=a(65703),o=a(46289),c=a(57243),r=a(15093);let l=(0,i.Z)([(0,r.Mo)("ha-list-item")],(function(e,t){class a extends t{constructor(...t){super(...t),e(this)}}return{F:a,d:[{kind:"method",key:"renderRipple",value:function(){return this.noninteractive?"":(0,n.Z)(a,"renderRipple",this,3)([])}},{kind:"get",static:!0,key:"styles",value:function(){return[o.W,c.iv`:host{padding-left:var(--mdc-list-side-padding-left,var(--mdc-list-side-padding,20px));padding-inline-start:var(--mdc-list-side-padding-left,var(--mdc-list-side-padding,20px));padding-right:var(--mdc-list-side-padding-right,var(--mdc-list-side-padding,20px));padding-inline-end:var(--mdc-list-side-padding-right,var(--mdc-list-side-padding,20px))}:host([graphic=avatar]:not([twoLine])),:host([graphic=icon]:not([twoLine])){height:48px}span.material-icons:first-of-type{margin-inline-start:0px!important;margin-inline-end:var(--mdc-list-item-graphic-margin,16px)!important;direction:var(--direction)!important}span.material-icons:last-of-type{margin-inline-start:auto!important;margin-inline-end:0px!important;direction:var(--direction)!important}.mdc-deprecated-list-item__meta{display:var(--mdc-list-item-meta-display);align-items:center;flex-shrink:0}:host([graphic=icon]:not([twoline])) .mdc-deprecated-list-item__graphic{margin-inline-end:var(--mdc-list-item-graphic-margin,20px)!important}:host([multiline-secondary]){height:auto}:host([multiline-secondary]) .mdc-deprecated-list-item__text{padding:8px 0}:host([multiline-secondary]) .mdc-deprecated-list-item__secondary-text{text-overflow:initial;white-space:normal;overflow:auto;display:inline-block;margin-top:10px}:host([multiline-secondary]) .mdc-deprecated-list-item__primary-text{margin-top:10px}:host([multiline-secondary]) .mdc-deprecated-list-item__secondary-text::before{display:none}:host([multiline-secondary]) .mdc-deprecated-list-item__primary-text::before{display:none}:host([disabled]){color:var(--disabled-text-color)}:host([noninteractive]){pointer-events:unset}`,"rtl"===document.dir?c.iv`span.material-icons:first-of-type,span.material-icons:last-of-type{direction:rtl!important;--direction:rtl}`:c.iv``]}}]}}),s.K)},74633:function(e,t,a){var i=a(44249),n=a(72621),s=a(78755),o=a(57243),c=a(15093);(0,i.Z)([(0,c.Mo)("ha-md-list-item")],(function(e,t){class a extends t{constructor(...t){super(...t),e(this)}}return{F:a,d:[{kind:"field",static:!0,key:"styles",value(){return[...(0,n.Z)(a,"styles",this),o.iv`:host{--ha-icon-display:block;--md-sys-color-primary:var(--primary-text-color);--md-sys-color-secondary:var(--secondary-text-color);--md-sys-color-surface:var(--card-background-color);--md-sys-color-on-surface:var(--primary-text-color);--md-sys-color-on-surface-variant:var(--secondary-text-color)}md-item{overflow:var(--md-item-overflow,hidden);align-items:var(--md-item-align-items,center)}`]}}]}}),s.g)},19993:function(e,t,a){var i=a(44249),n=a(72621),s=a(623),o=a(57243),c=a(15093);(0,i.Z)([(0,c.Mo)("ha-md-list")],(function(e,t){class a extends t{constructor(...t){super(...t),e(this)}}return{F:a,d:[{kind:"field",static:!0,key:"styles",value(){return[...(0,n.Z)(a,"styles",this),o.iv`:host{--md-sys-color-surface:var(--card-background-color)}`]}}]}}),s.j)},17170:function(e,t,a){a.a(e,(async function(e,i){try{a.r(t),a.d(t,{HaSpinner:()=>h});var n=a(44249),s=a(72621),o=a(97677),c=a(43580),r=a(57243),l=a(15093),d=e([o]);o=(d.then?(await d)():d)[0];let h=(0,n.Z)([(0,l.Mo)("ha-spinner")],(function(e,t){class a extends t{constructor(...t){super(...t),e(this)}}return{F:a,d:[{kind:"field",decorators:[(0,l.Cb)()],key:"size",value:void 0},{kind:"method",key:"updated",value:function(e){if((0,s.Z)(a,"updated",this,3)([e]),e.has("size"))switch(this.size){case"tiny":this.style.setProperty("--ha-spinner-size","16px");break;case"small":this.style.setProperty("--ha-spinner-size","28px");break;case"medium":this.style.setProperty("--ha-spinner-size","48px");break;case"large":this.style.setProperty("--ha-spinner-size","68px");break;case void 0:this.style.removeProperty("--ha-progress-ring-size")}}},{kind:"field",static:!0,key:"styles",value:()=>[c.Z,r.iv`:host{--indicator-color:var(
          --ha-spinner-indicator-color,
          var(--primary-color)
        );--track-color:var(--ha-spinner-divider-color, var(--divider-color));--track-width:4px;--speed:3.5s;font-size:var(--ha-spinner-size, 48px)}`]}]}}),o.Z);i()}catch(e){i(e)}}))},56032:function(e,t,a){a.a(e,(async function(e,t){try{var i=a(44249),n=a(80519),s=a(1261),o=a(57243),c=a(15093),r=a(85605),l=e([n]);n=(l.then?(await l)():l)[0],(0,r.jx)("tooltip.show",{keyframes:[{opacity:0},{opacity:1}],options:{duration:150,easing:"ease"}}),(0,r.jx)("tooltip.hide",{keyframes:[{opacity:1},{opacity:0}],options:{duration:400,easing:"ease"}});(0,i.Z)([(0,c.Mo)("ha-tooltip")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",static:!0,key:"styles",value:()=>[s.Z,o.iv`:host{--sl-tooltip-background-color:var(--secondary-background-color);--sl-tooltip-color:var(--primary-text-color);--sl-tooltip-font-family:Roboto,sans-serif;--sl-tooltip-font-size:12px;--sl-tooltip-font-weight:normal;--sl-tooltip-line-height:1;--sl-tooltip-padding:8px;--sl-tooltip-border-radius:var(--ha-tooltip-border-radius, 4px);--sl-tooltip-arrow-size:var(--ha-tooltip-arrow-size, 8px);--sl-z-index-tooltip:var(--ha-tooltip-z-index, 1000)}`]}]}}),n.Z);t()}catch(e){t(e)}}))},26779:function(e,t,a){a.a(e,(async function(e,i){try{a.d(t,{$u:()=>S,AG:()=>m,BR:()=>P,Ef:()=>E,En:()=>O,I0:()=>y,KE:()=>Y,Kn:()=>L,LG:()=>v,OT:()=>H,Sw:()=>D,Ty:()=>U,U0:()=>Q,UR:()=>B,Ug:()=>$,V1:()=>Z,VY:()=>N,Vn:()=>I,Y6:()=>W,Ye:()=>w,ZE:()=>_,Zk:()=>C,_r:()=>b,aq:()=>A,cF:()=>G,fi:()=>M,mu:()=>F,n:()=>q,p_:()=>V,pi:()=>z,rI:()=>k,wy:()=>g,xc:()=>x});a(26200),a(25754),a(22246),a(9359),a(56475),a(1331),a(31526),a(70104),a(71375),a(15524),a(20267),a(21917),a(56193),a(25020),a(86913),a(75656),a(50100),a(18084);var n=a(66952),s=a(55116),o=a(5423),c=a(27486),r=a(64214),l=a(33570),d=a(58014),h=a(57816),u=a(92091),p=a(11257),f=e([n,r,l]);[n,r,l]=f.then?(await f)():f;let g=function(e){return e.NEVER="never",e.DAILY="daily",e.CUSTOM_DAYS="custom_days",e}({});const m=["mon","tue","wed","thu","fri","sat","sun"],k=e=>e.sort(((e,t)=>m.indexOf(e)-m.indexOf(t))),v=e=>e.callWS({type:"backup/config/info"}),b=(e,t)=>e.callWS({type:"backup/config/update",...t}),y=(e,t,a)=>`/api/backup/download/${e}?agent_id=${t}${a?`&password=${a}`:""}`,_=e=>e.callWS({type:"backup/info"}),w=(e,t)=>e.callWS({type:"backup/details",backup_id:t}),x=e=>e.callWS({type:"backup/agents/info"}),$=(e,t)=>e.callWS({type:"backup/delete",backup_id:t}),C=(e,t)=>e.callWS({type:"backup/generate",...t}),A=e=>e.callWS({type:"backup/generate_with_automatic_settings"}),z=(e,t)=>e.callWS({type:"backup/restore",...t}),V=async(e,t,a)=>{const i=new FormData;i.append("file",t);const n=new URLSearchParams;return a.forEach((e=>{n.append("agent_id",e)})),(0,p.h9)(e.fetchWithAuth(`/api/backup/upload?${n.toString()}`,{method:"POST",body:i}))},H=e=>{const t=e.find(Z);if(t)return t;const a=e.find(P);return a||e[0]},M=(e,t,a,i)=>e.callWS({type:"backup/can_decrypt_on_download",backup_id:t,agent_id:a,password:i}),B="backup.local",L="hassio.local",S="cloud.cloud",Z=e=>[B,L].includes(e),P=e=>{const[t,a]=e.split(".");return"hassio"===t&&"local"!==a},D=(e,t,a)=>{if(Z(t))return e("ui.panel.config.backup.agents.local_agent");const i=a.find((e=>e.agent_id===t)),n=t.split(".")[0],s=i?i.name:t.split(".")[1];if(P(t))return s;const o=(0,h.Lh)(e,n);return a.filter((e=>e.agent_id.split(".")[0]===n)).length>1?`${o}: ${s}`:o},O=e=>Math.max(...Object.values(e.agents).map((e=>e.size))),T=["automatic","manual","addon_update"],F=(0,n.z)((e=>e?T:T.filter((e=>"addon_update"!==e)))),I=(e,t)=>e.with_automatic_settings?"automatic":t&&null!=e.extra_metadata?.["supervisor.addon_update"]?"addon_update":"manual",E=(e,t)=>{const a=Z(e),i=Z(t),n=P(e),s=P(t),o=(e,t)=>e?1:t?2:3,c=o(a,n),r=o(i,s);return c!==r?c-r:e.localeCompare(t)},U=()=>{const e="ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",t="xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx";let a="";const i=new Uint8Array(34);return crypto.getRandomValues(i),i.forEach(((i,n)=>{a+="-"===t[n]?"-":e[i%36]})),a},j=(e,t)=>"data:text/plain;charset=utf-8,"+encodeURIComponent(`${e.localize("ui.panel.config.backup.emergency_kit_file.title")}\n\n${e.localize("ui.panel.config.backup.emergency_kit_file.description")}\n\n${e.localize("ui.panel.config.backup.emergency_kit_file.date")} ${(0,r.o0)(new Date,e.locale,e.config)}\n\n${e.localize("ui.panel.config.backup.emergency_kit_file.instance")}\n${e.config.location_name}\n\n${e.localize("ui.panel.config.backup.emergency_kit_file.url")}\n${e.auth.data.hassUrl}\n\n${e.localize("ui.panel.config.backup.emergency_kit_file.encryption_key")}\n${t}\n\n${e.localize("ui.panel.config.backup.emergency_kit_file.more_info",{link:"https://www.home-assistant.io/more-info/backup-emergency-kit"})}`),R=(e,t)=>`home_assistant_backup_emergency_kit_${t?`${t}_`:""}${(0,r.NR)(new Date,e.locale,e.config).replace(",","").replace(" ","_")}.txt`,N=(e,t,a)=>(0,d.N)(j(e,t),R(e,a)),G=(0,s.H)((0,o.B)(new Date,4),45),W=(0,s.H)((0,o.B)(new Date,5),45),Y=(0,c.Z)(((e,t,a)=>{if((0,u.Z)(a))return(0,l.mr)(a,e,t);if("string"==typeof a&&a){const i=a.split(":"),n=(0,s.H)((0,o.B)(new Date,parseInt(i[0])),parseInt(i[1]));return(0,l.mr)(n,e,t)}return`${(0,l.mr)(G,e,t)} - ${(0,l.mr)(W,e,t)}`})),Q="application/x-tar",q={file:void 0};i()}catch(e){i(e)}}))},36029:function(e,t,a){a.d(t,{X:()=>n,q:()=>i});const i=(e,t)=>e.connection.subscribeMessage(t,{type:"backup/subscribe_events"}),n={manager_state:"idle"}},56785:function(e,t,a){a.d(t,{js:()=>s,rY:()=>n,yd:()=>r,yz:()=>c});a(92519),a(42179),a(89256),a(24931),a(88463),a(57449),a(19814);var i=a(17803);const n=e=>e.data,s=e=>"object"==typeof e?"object"==typeof e.body?e.body.message||"Unknown error, see supervisor logs":e.body||e.message||"Unknown error, see supervisor logs":e,o=new Set([502,503,504]),c=e=>!!(e&&e.status_code&&o.has(e.status_code))||!(!e||!e.message||!e.message.includes("ERR_CONNECTION_CLOSED")&&!e.message.includes("ERR_CONNECTION_RESET")),r=async(e,t)=>(0,i.I)(e.config.version,2021,2,4)?e.callWS({type:"supervisor/api",endpoint:`/${t}/stats`,method:"get"}):n(await e.callApi("GET",`hassio/${t}/stats`))},88991:function(e,t,a){a.a(e,(async function(e,i){try{a.d(t,{S:()=>r,ST:()=>d,n3:()=>l});var n=a(59847),s=a(81530),o=e([s]);s=(o.then?(await o)():o)[0];const c={alarm_control_panel:()=>a.e("62410").then(a.bind(a,80875)),automation:()=>a.e("98368").then(a.bind(a,13592)),camera:()=>a.e("11569").then(a.bind(a,17712)),climate:()=>Promise.all([a.e("41258"),a.e("21728")]).then(a.bind(a,5192)),configurator:()=>Promise.all([a.e("46379"),a.e("2981"),a.e("16649")]).then(a.bind(a,10080)),conversation:()=>Promise.all([a.e("46379"),a.e("51229"),a.e("59176")]).then(a.bind(a,93726)),counter:()=>a.e("25510").then(a.bind(a,32441)),cover:()=>a.e("78402").then(a.bind(a,72869)),date:()=>Promise.all([a.e("46379"),a.e("41258"),a.e("3561"),a.e("64836")]).then(a.bind(a,6560)),datetime:()=>Promise.all([a.e("46379"),a.e("41258"),a.e("3134"),a.e("3561"),a.e("74040")]).then(a.bind(a,11348)),fan:()=>a.e("88973").then(a.bind(a,54764)),group:()=>Promise.all([a.e("46379"),a.e("41258"),a.e("99287"),a.e("1916"),a.e("81407")]).then(a.bind(a,96771)),humidifier:()=>a.e("66881").then(a.bind(a,9198)),image:()=>a.e("89870").then(a.bind(a,37093)),input_boolean:()=>a.e("64783").then(a.bind(a,85742)),input_datetime:()=>Promise.all([a.e("46379"),a.e("41258"),a.e("3561"),a.e("73561")]).then(a.bind(a,68377)),lawn_mower:()=>a.e("49").then(a.bind(a,31650)),light:()=>a.e("55815").then(a.bind(a,59031)),lock:()=>a.e("51539").then(a.bind(a,1563)),media_player:()=>Promise.all([a.e("41258"),a.e("8656")]).then(a.bind(a,99091)),person:()=>Promise.all([a.e("35637"),a.e("49554"),a.e("73565")]).then(a.bind(a,86554)),remote:()=>Promise.all([a.e("41258"),a.e("2600")]).then(a.bind(a,92081)),script:()=>Promise.all([a.e("46379"),a.e("24199"),a.e("27506"),a.e("99287"),a.e("2981"),a.e("78823"),a.e("13395")]).then(a.bind(a,74358)),siren:()=>a.e("34404").then(a.bind(a,86534)),sun:()=>a.e("8373").then(a.bind(a,55421)),switch:()=>a.e("50728").then(a.bind(a,56985)),time:()=>Promise.all([a.e("46379"),a.e("41258"),a.e("3561"),a.e("52137")]).then(a.bind(a,16347)),timer:()=>a.e("14597").then(a.bind(a,42971)),update:()=>Promise.all([a.e("5080"),a.e("2981"),a.e("49016"),a.e("79195"),a.e("9524")]).then(a.bind(a,51077)),vacuum:()=>Promise.all([a.e("41258"),a.e("29453")]).then(a.bind(a,61372)),valve:()=>a.e("60455").then(a.bind(a,20973)),water_heater:()=>a.e("80518").then(a.bind(a,60054)),weather:()=>Promise.all([a.e("99287"),a.e("15722"),a.e("85078")]).then(a.bind(a,95818))},r=e=>{const t=(0,n.N)(e);return l(t)},l=e=>s.l.includes(e)?e:s.tm.includes(e)?"hidden":"default",d=e=>{e in c&&c[e]()};i()}catch(e){i(e)}}))},87979:function(e,t,a){var i=a(44249),n=a(57243),s=a(15093),o=a(31146),c=(a(54202),a(43344),a(28008));(0,i.Z)([(0,s.Mo)("hass-subpage")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,s.Cb)()],key:"header",value:void 0},{kind:"field",decorators:[(0,s.Cb)({type:Boolean,attribute:"main-page"})],key:"mainPage",value:()=>!1},{kind:"field",decorators:[(0,s.Cb)({type:String,attribute:"back-path"})],key:"backPath",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"backCallback",value:void 0},{kind:"field",decorators:[(0,s.Cb)({type:Boolean,reflect:!0})],key:"narrow",value:()=>!1},{kind:"field",decorators:[(0,s.Cb)({type:Boolean})],key:"supervisor",value:()=>!1},{kind:"field",decorators:[(0,o.i)(".content")],key:"_savedScrollPos",value:void 0},{kind:"method",key:"render",value:function(){return n.dy` <div class="toolbar"> ${this.mainPage||history.state?.root?n.dy` <ha-menu-button .hassio="${this.supervisor}" .hass="${this.hass}" .narrow="${this.narrow}"></ha-menu-button> `:this.backPath?n.dy` <a href="${this.backPath}"> <ha-icon-button-arrow-prev .hass="${this.hass}"></ha-icon-button-arrow-prev> </a> `:n.dy` <ha-icon-button-arrow-prev .hass="${this.hass}" @click="${this._backTapped}"></ha-icon-button-arrow-prev> `} <div class="main-title"><slot name="header">${this.header}</slot></div> <slot name="toolbar-icon"></slot> </div> <div class="content ha-scrollbar" @scroll="${this._saveScrollPos}"> <slot></slot> </div> <div id="fab"> <slot name="fab"></slot> </div> `}},{kind:"method",decorators:[(0,s.hO)({passive:!0})],key:"_saveScrollPos",value:function(e){this._savedScrollPos=e.target.scrollTop}},{kind:"method",key:"_backTapped",value:function(){this.backCallback?this.backCallback():history.back()}},{kind:"get",static:!0,key:"styles",value:function(){return[c.$c,n.iv`:host{display:block;height:100%;background-color:var(--primary-background-color);overflow:hidden;position:relative}:host([narrow]){width:100%;position:fixed}.toolbar{display:flex;align-items:center;font-size:20px;height:var(--header-height);padding:8px 12px;background-color:var(--app-header-background-color);font-weight:400;color:var(--app-header-text-color,#fff);border-bottom:var(--app-header-border-bottom,none);box-sizing:border-box}@media (max-width:599px){.toolbar{padding:4px}}.toolbar a{color:var(--sidebar-text-color);text-decoration:none}::slotted([slot=toolbar-icon]),ha-icon-button-arrow-prev,ha-menu-button{pointer-events:auto;color:var(--sidebar-icon-color)}.main-title{margin:var(--margin-title);line-height:20px;min-width:0;flex-grow:1;overflow-wrap:break-word;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis;padding-bottom:1px}.content{position:relative;width:100%;height:calc(100% - 1px - var(--header-height));overflow-y:auto;overflow:auto;-webkit-overflow-scrolling:touch}#fab{position:absolute;right:calc(16px + env(safe-area-inset-right));inset-inline-end:calc(16px + env(safe-area-inset-right));inset-inline-start:initial;bottom:calc(16px + env(safe-area-inset-bottom));z-index:1;display:flex;flex-wrap:wrap;justify-content:flex-end;gap:8px}:host([narrow]) #fab.tabs{bottom:calc(84px + env(safe-area-inset-bottom))}#fab[is-wide]{bottom:24px;right:24px;inset-inline-end:24px;inset-inline-start:initial}`]}}]}}),n.oi)},32889:function(e,t,a){a.a(e,(async function(e,t){try{var i=a(44249),n=a(57243),s=a(15093),o=(a(59826),a(54977),a(17170)),c=(a(65981),e([o]));o=(c.then?(await c)():c)[0];const r={success:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z",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",warning:"M12,2L1,21H23M12,6L19.53,19H4.47M11,10V14H13V10M11,16V18H13V16",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",loading:"M12,18A6,6 0 0,1 6,12C6,11 6.25,10.03 6.7,9.2L5.24,7.74C4.46,8.97 4,10.43 4,12A8,8 0 0,0 12,20V23L16,19L12,15M12,4V1L8,5L12,9V6A6,6 0 0,1 18,12C18,13 17.75,13.97 17.3,14.8L18.76,16.26C19.54,15.03 20,13.57 20,12A8,8 0 0,0 12,4Z"};(0,i.Z)([(0,s.Mo)("ha-backup-summary-card")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,s.Cb)()],key:"heading",value:void 0},{kind:"field",decorators:[(0,s.Cb)()],key:"description",value:void 0},{kind:"field",decorators:[(0,s.Cb)({type:Boolean,attribute:"has-action"})],key:"hasAction",value:()=>!1},{kind:"field",decorators:[(0,s.Cb)()],key:"status",value:()=>"info"},{kind:"method",key:"render",value:function(){return n.dy` <ha-card outlined> <div class="summary"> ${"loading"===this.status?n.dy`<ha-spinner></ha-spinner>`:n.dy` <div class="icon ${this.status}"> <ha-svg-icon .path="${r[this.status]}"></ha-svg-icon> </div> `} <div class="content"> <p class="heading">${this.heading}</p> <p class="description">${this.description}</p> </div> ${this.hasAction?n.dy` <div class="action"> <slot name="action"></slot> </div> `:n.Ld} </div> <div class="content"> <slot></slot> </div> </ha-card> `}},{kind:"field",static:!0,key:"styles",value:()=>n.iv`ha-card{min-height:74px}.summary{display:flex;flex-direction:row;column-gap:16px;row-gap:8px;align-items:center;padding:16px;padding-bottom:8px;width:100%;box-sizing:border-box}.icon{position:relative;border-radius:20px;width:40px;height:40px;display:flex;align-items:center;justify-content:center;overflow:hidden;--icon-color:var(--primary-color)}.icon.success{--icon-color:var(--success-color)}.icon.warning{--icon-color:var(--warning-color)}.icon.error{--icon-color:var(--error-color)}.icon::before{display:block;content:"";position:absolute;inset:0;background-color:var(--icon-color,var(--primary-color));opacity:.2}.icon ha-svg-icon{color:var(--icon-color,var(--primary-color));width:24px;height:24px}ha-spinner{--ha-spinner-size:40px}.content{display:flex;flex-direction:column;flex:1;min-width:0}.heading{font-size:22px;font-style:normal;font-weight:400;line-height:28px;color:var(--primary-text-color);margin:0;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.description{font-size:14px;font-style:normal;font-weight:400;line-height:20px;letter-spacing:.25px;color:var(--secondary-text-color);margin:0;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}@media all and (max-width:550px){.action{width:100%;display:flex;justify-content:flex-end}}`}]}}),n.oi);t()}catch(e){t(e)}}))},81742:function(e,t,a){a.a(e,(async function(e,t){try{var i=a(44249),n=(a(9359),a(56475),a(70104),a(48136),a(57243)),s=a(15093),o=a(27486),c=a(72344),r=(a(59826),a(54977),a(13928),a(19993),a(74633),a(26779)),l=a(28008),d=a(90698),h=e([r]);r=(h.then?(await h)():h)[0];const u={automatic:"M18,11V12.5C21.19,12.5 23.09,16.05 21.33,18.71L20.24,17.62C21.06,15.96 19.85,14 18,14V15.5L15.75,13.25L18,11M18,22V20.5C14.81,20.5 12.91,16.95 14.67,14.29L15.76,15.38C14.94,17.04 16.15,19 18,19V17.5L20.25,19.75L18,22M19,3H18V1H16V3H8V1H6V3H5A2,2 0 0,0 3,5V19A2,2 0 0,0 5,21H14C13.36,20.45 12.86,19.77 12.5,19H5V8H19V10.59C19.71,10.7 20.39,10.94 21,11.31V5A2,2 0 0,0 19,3Z",manual:"M10,9A1,1 0 0,1 11,8A1,1 0 0,1 12,9V13.47L13.21,13.6L18.15,15.79C18.68,16.03 19,16.56 19,17.14V21.5C18.97,22.32 18.32,22.97 17.5,23H11C10.62,23 10.26,22.85 10,22.57L5.1,18.37L5.84,17.6C6.03,17.39 6.3,17.28 6.58,17.28H6.8L10,19V9M11,5A4,4 0 0,1 15,9C15,10.5 14.2,11.77 13,12.46V11.24C13.61,10.69 14,9.89 14,9A3,3 0 0,0 11,6A3,3 0 0,0 8,9C8,9.89 8.39,10.69 9,11.24V12.46C7.8,11.77 7,10.5 7,9A4,4 0 0,1 11,5Z",addon_update:"M20.5,11H19V7C19,5.89 18.1,5 17,5H13V3.5A2.5,2.5 0 0,0 10.5,1A2.5,2.5 0 0,0 8,3.5V5H4A2,2 0 0,0 2,7V10.8H3.5C5,10.8 6.2,12 6.2,13.5C6.2,15 5,16.2 3.5,16.2H2V20A2,2 0 0,0 4,22H7.8V20.5C7.8,19 9,17.8 10.5,17.8C12,17.8 13.2,19 13.2,20.5V22H17A2,2 0 0,0 19,20V16H20.5A2.5,2.5 0 0,0 23,13.5A2.5,2.5 0 0,0 20.5,11Z"},p=e=>e.reduce(((e,t)=>(e.count++,e.size+=(0,r.En)(t),e)),{count:0,size:0});(0,i.Z)([(0,s.Mo)("ha-backup-overview-backups")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"backups",value:()=>[]},{kind:"field",key:"_stats",value:()=>(0,o.Z)(((e,t)=>(0,r.mu)(t).map((a=>{const i=e.filter((e=>(0,r.Vn)(e,t)===a));return[a,p(i)]}))))},{kind:"method",key:"render",value:function(){const e=(0,c.p)(this.hass,"hassio"),t=this._stats(this.backups,e);return n.dy` <ha-card class="my-backups"> <div class="card-header"> ${this.hass.localize("ui.panel.config.backup.overview.backups.title")} </div> <div class="card-content"> <ha-md-list> ${t.map((([e,{count:t,size:a}])=>n.dy` <ha-md-list-item type="link" href="/config/backup/backups?type=${e}"> <ha-svg-icon slot="start" .path="${u[e]}"></ha-svg-icon> <div slot="headline"> ${this.hass.localize(`ui.panel.config.backup.overview.backups.${e}`,{count:t})} </div> <div slot="supporting-text"> ${this.hass.localize("ui.panel.config.backup.overview.backups.total_size",{size:(0,d.d)(a)})} </div> <ha-icon-next slot="end"></ha-icon-next> </ha-md-list-item> `))} </ha-md-list> </div> <div class="card-actions"> <a href="/config/backup/backups?type=all"> <ha-button> ${this.hass.localize("ui.panel.config.backup.overview.backups.show_all")} </ha-button> </a> </div> </ha-card> `}},{kind:"get",static:!0,key:"styles",value:function(){return[l.Qx,n.iv`.content{padding:28px 20px 0;max-width:690px;margin:0 auto;gap:24px;display:flex;flex-direction:column;margin-bottom:calc(72px + env(safe-area-inset-bottom))}.card-actions{display:flex;justify-content:flex-end}.card-header{padding-bottom:8px}.card-content{padding-left:0;padding-right:0;padding-bottom:0}`]}}]}}),n.oi);t()}catch(e){t(e)}}))},6848:function(e,t,a){var i=a(44249),n=a(57243),s=a(15093),o=a(36522),c=(a(59826),a(54977),a(37583),a(28008));(0,i.Z)([(0,s.Mo)("ha-backup-overview-onboarding")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"method",key:"_setup",value:async function(){(0,o.B)(this,"button-click")}},{kind:"method",key:"render",value:function(){return n.dy` <ha-card> <div class="card-header"> <div class="icon"> <ha-svg-icon .path="${"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"}"></ha-svg-icon> </div> ${this.hass.localize("ui.panel.config.backup.overview.onboarding.title")} </div> <div class="card-content"> <p> ${this.hass.localize("ui.panel.config.backup.overview.onboarding.description")} </p> </div> <div class="card-actions"> <ha-button @click="${this._setup}">${this.hass.localize("ui.panel.config.backup.overview.onboarding.setup")}</ha-button> </div> </ha-card> `}},{kind:"get",static:!0,key:"styles",value:function(){return[c.Qx,n.iv`.card-header{display:flex;flex-direction:row;align-items:center;gap:16px}.icon{position:relative;border-radius:20px;width:40px;height:40px;display:flex;align-items:center;justify-content:center;overflow:hidden}.icon::before{display:block;content:"";position:absolute;inset:0;background-color:var(--primary-color);opacity:.2}.icon ha-svg-icon{color:var(--primary-color);width:24px;height:24px}p{margin:0}.card-actions{display:flex;justify-content:flex-end;border-top:none}`]}}]}}),n.oi)},84370:function(e,t,a){a.a(e,(async function(e,t){try{var i=a(44249),n=a(57243),s=a(15093),o=a(32889),c=e([o]);o=(c.then?(await c)():c)[0];(0,i.Z)([(0,s.Mo)("ha-backup-overview-progress")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"manager",value:void 0},{kind:"get",key:"_heading",value:function(){const e=this.manager.manager_state;return"idle"===e?"":this.hass.localize(`ui.panel.config.backup.overview.progress.heading.${e}`)}},{kind:"get",key:"_description",value:function(){switch(this.manager.manager_state){case"create_backup":return this.manager.stage?this.hass.localize(`ui.panel.config.backup.overview.progress.description.create_backup.${this.manager.stage}`):"";case"restore_backup":return this.manager.stage?this.hass.localize(`ui.panel.config.backup.overview.progress.description.restore_backup.${this.manager.stage}`):"";case"receive_backup":return this.manager.stage?this.hass.localize(`ui.panel.config.backup.overview.progress.description.receive_backup.${this.manager.stage}`):"";default:return""}}},{kind:"method",key:"render",value:function(){return n.dy` <ha-backup-summary-card .hass="${this.hass}" .heading="${this._heading}" .description="${this._description}" status="loading"> </ha-backup-summary-card> `}}]}}),n.oi);t()}catch(e){t(e)}}))},24714:function(e,t,a){a.a(e,(async function(e,t){try{var i=a(44249),n=a(72621),s=(a(9359),a(56475),a(70104),a(52924),a(57243)),o=a(15093),c=a(83523),r=(a(59826),a(54977),a(13928),a(19993),a(74633),a(37583),a(26779)),l=a(28008),d=a(72344),h=a(17705),u=e([r]);r=(u.then?(await u)():u)[0];const p="M19,19H5V8H19M16,1V3H8V1H6V3H5C3.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,3H18V1M17,12H12V17H17V12Z",f="M12,3C7.58,3 4,4.79 4,7C4,9.21 7.58,11 12,11C16.42,11 20,9.21 20,7C20,4.79 16.42,3 12,3M4,9V12C4,14.21 7.58,16 12,16C16.42,16 20,14.21 20,12V9C20,11.21 16.42,13 12,13C7.58,13 4,11.21 4,9M4,14V17C4,19.21 7.58,21 12,21C16.42,21 20,19.21 20,17V14C20,16.21 16.42,18 12,18C7.58,18 4,16.21 4,14Z",g="M20.5,11H19V7C19,5.89 18.1,5 17,5H13V3.5A2.5,2.5 0 0,0 10.5,1A2.5,2.5 0 0,0 8,3.5V5H4A2,2 0 0,0 2,7V10.8H3.5C5,10.8 6.2,12 6.2,13.5C6.2,15 5,16.2 3.5,16.2H2V20A2,2 0 0,0 4,22H7.8V20.5C7.8,19 9,17.8 10.5,17.8C12,17.8 13.2,19 13.2,20.5V22H17A2,2 0 0,0 19,20V16H20.5A2.5,2.5 0 0,0 23,13.5A2.5,2.5 0 0,0 20.5,11Z",m="M9,16V10H5L12,3L19,10H15V16H9M5,20V18H19V20H5Z";(0,i.Z)([(0,o.Mo)("ha-backup-overview-settings")],(function(e,t){class a extends t{constructor(...t){super(...t),e(this)}}return{F:a,d:[{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"config",value:void 0},{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"agents",value:void 0},{kind:"field",decorators:[(0,o.SB)()],key:"_showDbOption",value:()=>!0},{kind:"method",key:"firstUpdated",value:function(e){(0,n.Z)(a,"firstUpdated",this,3)([e]),this._checkDbOption()}},{kind:"method",key:"_configure",value:function(){(0,c.c)("/config/backup/settings")}},{kind:"method",key:"_checkDbOption",value:async function(){if((0,d.p)(this.hass,"recorder")){const e=await(0,h._m)(this.hass.connection);this._showDbOption=e.db_in_default_location}else this._showDbOption=!1}},{kind:"method",key:"_scheduleDescription",value:function(e){const{copies:t,days:a}=e.retention,{recurrence:i}=e.schedule;if(i===r.wy.NEVER)return this.hass.localize("ui.panel.config.backup.overview.settings.schedule_never");const n=this.config.schedule.time&&(0,r.KE)(this.hass.locale,this.hass.config,this.config.schedule.time);let s=this.hass.localize("ui.panel.config.backup.overview.settings.schedule_never");const o=this.config.schedule.days;this.config.schedule.recurrence===r.wy.DAILY||this.config.schedule.recurrence===r.wy.CUSTOM_DAYS&&7===o.length?s=this.hass.localize(`ui.panel.config.backup.overview.settings.schedule_${this.config.schedule.time?"":"optimized_"}daily`,{time:n}):this.config.schedule.recurrence===r.wy.CUSTOM_DAYS&&0!==o.length&&(s=2===o.length&&o.includes("sat")&&o.includes("sun")?this.hass.localize(`ui.panel.config.backup.overview.settings.schedule_${this.config.schedule.time?"":"optimized_"}weekend`,{time:n}):5!==o.length||o.includes("sat")||o.includes("sun")?this.hass.localize(`ui.panel.config.backup.overview.settings.schedule_${this.config.schedule.time?"":"optimized_"}days`,{count:o.length,days:o.map((e=>this.hass.localize(`ui.panel.config.backup.overview.settings.${o.length>2?"short_weekdays":"weekdays"}.${e}`))).join(", "),time:n}):this.hass.localize(`ui.panel.config.backup.overview.settings.schedule_${this.config.schedule.time?"":"optimized_"}weekdays`,{time:n}));let c=this.hass.localize("ui.panel.config.backup.overview.settings.schedule_copies_all");return t?c=this.hass.localize("ui.panel.config.backup.overview.settings.schedule_copies_backups",{count:t}):a&&(c=this.hass.localize("ui.panel.config.backup.overview.settings.schedule_copies_days",{count:a})),s+" "+c}},{kind:"method",key:"_addonsDescription",value:function(e){if(e.create_backup.include_all_addons)return this.hass.localize("ui.panel.config.backup.overview.settings.addons_all");const t=e.create_backup.include_addons?.length;return t?this.hass.localize("ui.panel.config.backup.overview.settings.addons_many",{count:t}):this.hass.localize("ui.panel.config.backup.overview.settings.addons_none")}},{kind:"method",key:"_locationsDescription",value:function(e){const t=e.create_backup.agent_ids.some((e=>(0,r.V1)(e))),a=e.create_backup.agent_ids.filter((e=>!(0,r.V1)(e)));if(a.length){if(1===a.length){const e=(0,r.Sw)(this.hass.localize,a[0],this.agents);return this.hass.localize("ui.panel.config.backup.overview.settings.locations_one",{name:e})}return this.hass.localize("ui.panel.config.backup.overview.settings.locations_many",{count:a.length})}return t?this.hass.localize("ui.panel.config.backup.overview.settings.locations_local_only"):this.hass.localize("ui.panel.config.backup.overview.settings.locations_none")}},{kind:"method",key:"render",value:function(){const e=this.hass.config.components.includes("hassio");return s.dy` <ha-card class="my-backups"> <div class="card-header"> ${this.hass.localize("ui.panel.config.backup.overview.settings.title")} </div> <div class="card-content"> <ha-md-list> <ha-md-list-item type="link" href="/config/backup/settings#schedule"> <ha-svg-icon slot="start" .path="${p}"></ha-svg-icon> <div slot="headline"> ${this._scheduleDescription(this.config)} </div> <div slot="supporting-text"> ${this.hass.localize("ui.panel.config.backup.overview.settings.schedule")} </div> <ha-icon-next slot="end"></ha-icon-next> </ha-md-list-item> <ha-md-list-item type="link" href="/config/backup/settings#data"> <ha-svg-icon slot="start" .path="${f}"></ha-svg-icon> <div slot="headline"> ${this._showDbOption&&this.config.create_backup.include_database?this.hass.localize("ui.panel.config.backup.overview.settings.data_settings_history"):this.hass.localize("ui.panel.config.backup.overview.settings.data_settings_only")} </div> <div slot="supporting-text"> ${this.hass.localize("ui.panel.config.backup.overview.settings.data")} </div> <ha-icon-next slot="end"></ha-icon-next> </ha-md-list-item> ${e?s.dy` <ha-md-list-item type="link" href="/config/backup/settings#data"> <ha-svg-icon slot="start" .path="${g}"></ha-svg-icon> <div slot="headline"> ${this._addonsDescription(this.config)} </div> <div slot="supporting-text"> ${this.hass.localize("ui.panel.config.backup.overview.settings.addons")} </div> <ha-icon-next slot="end"></ha-icon-next> </ha-md-list-item> `:s.Ld} <ha-md-list-item type="link" href="/config/backup/settings#locations"> <ha-svg-icon slot="start" .path="${m}"></ha-svg-icon> <div slot="headline"> ${this._locationsDescription(this.config)} </div> <div slot="supporting-text"> ${this.hass.localize("ui.panel.config.backup.overview.settings.locations")} </div> <ha-icon-next slot="end"></ha-icon-next> </ha-md-list-item> </ha-md-list> </div> <div class="card-actions"> <ha-button @click="${this._configure}"> ${this.hass.localize("ui.panel.config.backup.overview.settings.configure")} </ha-button> </div> </ha-card> `}},{kind:"get",static:!0,key:"styles",value:function(){return[l.Qx,s.iv`.content{padding:28px 20px 0;max-width:690px;margin:0 auto;gap:24px;display:flex;flex-direction:column;margin-bottom:24px;margin-bottom:72px}.card-actions{display:flex;justify-content:flex-end}.card-header{padding-bottom:8px}.card-content{padding-left:0;padding-right:0;padding-bottom:0}`]}}]}}),s.oi);t()}catch(e){t(e)}}))},85418:function(e,t,a){a.a(e,(async function(e,t){try{var i=a(44249),n=(a(9359),a(56475),a(1331),a(27818)),s=a(16444),o=a(13809),c=a(38836),r=a(57243),l=a(15093),d=a(27486),h=a(94947),u=(a(59826),a(54977),a(19993),a(74633),a(37583),a(23334),a(26779)),p=a(28008),f=a(32889),g=a(46467),m=a(12660),k=e([f,h,u,m,g]);[f,h,u,m,g]=k.then?(await k)():k;const v="M12,3A9,9 0 0,0 3,12H0L4,16L8,12H5A7,7 0 0,1 12,5A7,7 0 0,1 19,12A7,7 0 0,1 12,19C10.5,19 9.09,18.5 7.94,17.7L6.5,19.14C8.04,20.3 9.94,21 12,21A9,9 0 0,0 21,12A9,9 0 0,0 12,3M14,12A2,2 0 0,0 12,10A2,2 0 0,0 10,12A2,2 0 0,0 12,14A2,2 0 0,0 14,12Z",b="M19,19H5V8H19M16,1V3H8V1H6V3H5C3.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,3H18V1M17,12H12V17H17V12Z",y="M13,9H11V7H13M13,17H11V11H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z",_=3;(0,i.Z)([(0,l.Mo)("ha-backup-overview-summary")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,l.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,l.Cb)({attribute:!1})],key:"backups",value:()=>[]},{kind:"field",decorators:[(0,l.Cb)({attribute:!1})],key:"config",value:void 0},{kind:"field",decorators:[(0,l.Cb)({type:Boolean})],key:"fetching",value:()=>!1},{kind:"field",key:"_sortedBackups",value:()=>(0,d.Z)((e=>e.filter((e=>e.with_automatic_settings)).sort(((e,t)=>new Date(t.date).getTime()-new Date(e.date).getTime()))))},{kind:"field",key:"_lastBackup",value(){return(0,d.Z)((e=>this._sortedBackups(e)[0]))}},{kind:"field",key:"_lastUploadedBackup",value(){return(0,d.Z)((e=>this._sortedBackups(e).find((e=>0===e.failed_agent_ids?.length))))}},{kind:"method",key:"render",value:function(){const e=new Date;if(this.fetching)return r.dy` <ha-backup-summary-card .heading="${this.hass.localize("ui.panel.config.backup.overview.summary.loading")}" status="loading"> <ha-md-list> <ha-md-list-item> <ha-svg-icon slot="start" .path="${v}"></ha-svg-icon> <span slot="headline" class="skeleton"></span> </ha-md-list-item> <ha-md-list-item> <ha-svg-icon slot="start" .path="${b}"></ha-svg-icon> <span slot="headline" class="skeleton"></span> </ha-md-list-item> </ha-md-list> </ha-backup-summary-card> `;const t=this._lastBackup(this.backups),a=this.config.last_attempted_automatic_backup?new Date(this.config.last_attempted_automatic_backup):new Date(0),i=this.config.last_completed_automatic_backup?new Date(this.config.last_completed_automatic_backup):new Date(0),l=this.config.next_automatic_backup?new Date(this.config.next_automatic_backup):void 0,d=(0,u.KE)(this.hass.locale,this.hass.config,l||this.config.schedule.time),p=this.config.next_automatic_backup_additional,f=this.config.schedule.recurrence===u.wy.NEVER||this.config.schedule.recurrence===u.wy.CUSTOM_DAYS&&0===this.config.schedule.days.length?this.hass.localize("ui.panel.config.backup.overview.summary.no_automatic_backup"):l?this.hass.localize("ui.panel.config.backup.overview.summary.next_automatic_backup",{day:(0,n.P)(l)?this.hass.localize("ui.panel.config.backup.overview.summary.tomorrow"):(0,s.z)(l)?this.hass.localize("ui.panel.config.backup.overview.summary.today"):(0,g.D_)(l,this.hass.locale,this.hass.config),time:d}):"";if(a>i){const t=this._lastUploadedBackup(this.backups);return r.dy` <ha-backup-summary-card .heading="${this.hass.localize("ui.panel.config.backup.overview.summary.last_backup_failed_heading")}" status="error"> <ha-md-list> <ha-md-list-item> <ha-svg-icon slot="start" .path="${v}"></ha-svg-icon> <span slot="headline"> ${this.hass.localize("ui.panel.config.backup.overview.summary.last_backup_failed_description",{relative_time:(0,h.G)(a,this.hass.locale,e,!0)})} </span> </ha-md-list-item> ${t||f?r.dy` <ha-md-list-item> <ha-svg-icon slot="start" .path="${b}"></ha-svg-icon> <span slot="headline"> ${t?this.hass.localize("ui.panel.config.backup.overview.summary.last_successful_backup_description",{relative_time:(0,h.G)(new Date(t.date),this.hass.locale,e,!0),count:Object.keys(t.agents).length}):f} </span> </ha-md-list-item> `:r.Ld} </ha-md-list> </ha-backup-summary-card> `}if(!t)return r.dy` <ha-backup-summary-card .heading="${this.hass.localize("ui.panel.config.backup.overview.summary.no_backup_heading")}" status="warning"> <ha-md-list> <ha-md-list-item> <ha-svg-icon slot="start" .path="${v}"></ha-svg-icon> <span slot="headline"> ${this.hass.localize("ui.panel.config.backup.overview.summary.no_backup_description")} </span> </ha-md-list-item> ${this._renderNextBackupDescription(f,i,p)} </ha-md-list> </ha-backup-summary-card> `;const m=new Date(t.date);if(t.failed_agent_ids?.length){const t=this._lastUploadedBackup(this.backups);return r.dy` <ha-backup-summary-card .heading="${this.hass.localize("ui.panel.config.backup.overview.summary.last_backup_failed_heading")}" status="error"> <ha-md-list> <ha-md-list-item> <ha-svg-icon slot="start" .path="${v}"></ha-svg-icon> <span slot="headline"> ${this.hass.localize("ui.panel.config.backup.overview.summary.last_backup_failed_locations_description",{relative_time:(0,h.G)(a,this.hass.locale,e,!0)})} </span> </ha-md-list-item> ${t||f?r.dy` <ha-md-list-item> <ha-svg-icon slot="start" .path="${b}"></ha-svg-icon> <span slot="headline"> ${t?this.hass.localize("ui.panel.config.backup.overview.summary.last_successful_backup_description",{relative_time:(0,h.G)(new Date(t.date),this.hass.locale,e,!0),count:Object.keys(t.agents).length}):f} </span> </ha-md-list-item>`:r.Ld} </ha-md-list> </ha-backup-summary-card> `}const k=this.hass.localize("ui.panel.config.backup.overview.summary.last_successful_backup_description",{relative_time:(0,h.G)(new Date(t.date),this.hass.locale,e,!0),count:Object.keys(t.agents).length}),y=(0,o.j)((0,c.T)(e,-_),m),w=y>=1&&this.config.schedule.recurrence===u.wy.DAILY||y>=7;return r.dy` <ha-backup-summary-card .heading="${this.hass.localize("ui.panel.config.backup.overview.summary."+(w?"backup_too_old_heading":"backup_success_heading"),{count:y})}" .status="${w?"warning":"success"}"> <ha-md-list> <ha-md-list-item> <ha-svg-icon slot="start" .path="${v}"></ha-svg-icon> <span slot="headline">${k}</span> </ha-md-list-item> ${this._renderNextBackupDescription(f,i,p)} </ha-md-list> </ha-backup-summary-card> `}},{kind:"method",key:"_renderNextBackupDescription",value:function(e,t,a=!1){const i=a?()=>{(0,m.showAlertDialog)(this,{text:this.hass.localize("ui.panel.config.backup.overview.summary.additional_backup_description",{date:(0,g.p6)(t,this.hass.locale,this.hass.config)})})}:void 0;return e?r.dy`<ha-md-list-item> <ha-svg-icon slot="start" .path="${b}"></ha-svg-icon> <span slot="headline">${e}</span> ${a?r.dy` <ha-icon-button slot="end" @click="${i}" .path="${y}"></ha-icon-button>`:r.Ld} </ha-md-list-item>`:r.Ld}},{kind:"get",static:!0,key:"styles",value:function(){return[p.Qx,r.iv`.card-header{display:flex;flex-direction:row;align-items:center;gap:16px}p{margin:0}ha-svg-icon{flex:none}.card-actions{display:flex;justify-content:flex-end;border-top:none}ha-md-list{background:0 0}ha-md-list-item{--md-list-item-top-space:8px;--md-list-item-bottom-space:8px;--md-list-item-one-line-container-height:40x}span.skeleton{position:relative;display:block;width:160px;animation-fill-mode:forwards;animation-iteration-count:infinite;animation-name:loading;animation-timing-function:linear;animation-duration:1.2s;border-radius:4px;height:16px;margin:2px 0;background:linear-gradient(to right,var(--card-background-color) 8%,var(--secondary-background-color) 18%,var(--card-background-color) 33%) 0% 0%/936px 104px}@keyframes loading{0%{background-position:-468px 0}100%{background-position:468px 0}}`]}}]}}),r.oi);t()}catch(e){t(e)}}))},23989:function(e,t,a){a.d(t,{w:()=>s});var i=a(36522);const n=()=>Promise.all([a.e("41258"),a.e("7442"),a.e("86628"),a.e("3561"),a.e("87126"),a.e("21677"),a.e("89793")]).then(a.bind(a,35956)),s=(e,t)=>new Promise((a=>{const s=t?.cancel,o=t?.submit;(0,i.B)(e,"show-dialog",{dialogTag:"ha-dialog-backup-onboarding",dialogImport:n,dialogParams:{...t,cancel:()=>{a(!1),s&&s()},submit:e=>{a(e),o&&o(e)}}})}))},73129:function(e,t,a){a.d(t,{N:()=>s});var i=a(36522);const n=()=>Promise.all([a.e("7442"),a.e("9113")]).then(a.bind(a,75639)),s=(e,t)=>{(0,i.B)(e,"show-dialog",{dialogTag:"ha-dialog-download-decrypted-backup",dialogImport:n,dialogParams:t})}},76482:function(e,t,a){a.d(t,{y:()=>s});var i=a(36522);const n=()=>Promise.all([a.e("7442"),a.e("86628"),a.e("87126"),a.e("9166")]).then(a.bind(a,60663)),s=(e,t)=>new Promise((a=>{const s=t.cancel,o=t.submit;(0,i.B)(e,"show-dialog",{dialogTag:"ha-dialog-generate-backup",dialogImport:n,dialogParams:{...t,cancel:()=>{a(null),s&&s()},submit:e=>{a(e),o&&o(e)}}})}))},82438:function(e,t,a){a.d(t,{g:()=>s});var i=a(36522);const n=()=>Promise.all([a.e("7442"),a.e("45333")]).then(a.bind(a,38315)),s=(e,t)=>new Promise((a=>{const s=t.cancel,o=t.submit;(0,i.B)(e,"show-dialog",{dialogTag:"ha-dialog-new-backup",dialogImport:n,dialogParams:{...t,cancel:()=>{a(null),s&&s()},submit:e=>{a(e),o&&o(e)}}})}))},98015:function(e,t,a){a.d(t,{o:()=>s});var i=a(36522);const n=()=>Promise.all([a.e("7442"),a.e("41872")]).then(a.bind(a,59461)),s=(e,t)=>new Promise((a=>{const s=t.cancel,o=t.submit;(0,i.B)(e,"show-dialog",{dialogTag:"ha-dialog-upload-backup",dialogImport:n,dialogParams:{...t,cancel:()=>{a(null),s&&s()},submit:()=>{a(void 0),o&&o()}}})}))},91203:function(e,t,a){a.a(e,(async function(e,t){try{var i=a(44249),n=a(72621),s=(a(9359),a(56475),a(70104),a(52924),a(75656),a(50100),a(18084),a(57243)),o=a(15093),c=a(27486),r=a(72344),l=a(94947),d=a(68958),h=a(36522),u=a(73850),p=a(87707),f=a(83523),g=(a(59826),a(34273),a(17170)),m=(a(20130),a(9425),a(65981),a(13928),a(59959)),k=(a(7285),a(37583),a(26779)),v=a(56785),b=a(76131),y=(a(38419),a(6736)),_=a(28008),w=a(88238),x=a(90698),$=a(76482),C=a(82438),A=a(98015),z=a(9807),V=e([g,m,l,z,k]);[g,m,l,z,k]=V.then?(await V)():V;const H="M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z",M="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",B="M5,20H19V18H5M19,9H15V3H9V9H5L12,16L19,9Z",L="M6,2H18A2,2 0 0,1 20,4V20A2,2 0 0,1 18,22H6A2,2 0 0,1 4,20V4A2,2 0 0,1 6,2M12,4A6,6 0 0,0 6,10C6,13.31 8.69,16 12.1,16L11.22,13.77C10.95,13.29 11.11,12.68 11.59,12.4L12.45,11.9C12.93,11.63 13.54,11.79 13.82,12.27L15.74,14.69C17.12,13.59 18,11.9 18,10A6,6 0 0,0 12,4M12,9A1,1 0 0,1 13,10A1,1 0 0,1 12,11A1,1 0 0,1 11,10A1,1 0 0,1 12,9M7,18A1,1 0 0,0 6,19A1,1 0 0,0 7,20A1,1 0 0,0 8,19A1,1 0 0,0 7,18M12.09,13.27L14.58,19.58L17.17,18.08L12.95,12.77L12.09,13.27Z",S="M4,5C2.89,5 2,5.89 2,7V17C2,18.11 2.89,19 4,19H20C21.11,19 22,18.11 22,17V7C22,5.89 21.11,5 20,5H4M4.5,7A1,1 0 0,1 5.5,8A1,1 0 0,1 4.5,9A1,1 0 0,1 3.5,8A1,1 0 0,1 4.5,7M7,7H20V17H7V7M8,8V16H11V8H8M12,8V16H15V8H12M16,8V16H19V8H16M9,9H10V10H9V9M13,9H14V10H13V9M17,9H18V10H17V9Z",Z="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z",P="M9,16V10H5L12,3L19,10H15V16H9M5,20V18H19V20H5Z";(0,i.Z)([(0,o.Mo)("ha-config-backup-backups")],(function(e,t){class a extends t{constructor(...t){super(...t),e(this)}}return{F:a,d:[{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"cloudStatus",value:void 0},{kind:"field",decorators:[(0,o.Cb)({type:Boolean})],key:"narrow",value:()=>!1},{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"route",value:void 0},{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"manager",value:void 0},{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"backups",value:()=>[]},{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"config",value:void 0},{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"agents",value:()=>[]},{kind:"field",decorators:[(0,o.SB)()],key:"_selected",value:()=>[]},{kind:"field",decorators:[(0,d.t)({storage:"sessionStorage",key:"backups-table-filters",state:!0,subscribe:!1})],key:"_filters",value:()=>({})},{kind:"field",decorators:[(0,d.t)({key:"backups-table-grouping",state:!1,subscribe:!1})],key:"_activeGrouping",value:()=>"formatted_type"},{kind:"field",decorators:[(0,d.t)({key:"backups-table-collapsed",state:!1,subscribe:!1})],key:"_activeCollapsed",value:()=>[]},{kind:"field",decorators:[(0,o.IO)("hass-tabs-subpage-data-table",!0)],key:"_dataTable",value:void 0},{kind:"method",key:"connectedCallback",value:function(){(0,n.Z)(a,"connectedCallback",this,3)([]),window.addEventListener("location-changed",this._locationChanged),window.addEventListener("popstate",this._popState),this._setFiltersFromUrl()}},{kind:"method",key:"disconnectedCallback",value:function(){(0,n.Z)(a,"disconnectedCallback",this,3)([]),window.removeEventListener("location-changed",this._locationChanged),window.removeEventListener("popstate",this._popState)}},{kind:"field",key:"_locationChanged",value(){return()=>{this._setFiltersFromUrl()}}},{kind:"field",key:"_popState",value(){return()=>{this._setFiltersFromUrl()}}},{kind:"field",key:"_columns",value(){return(0,c.Z)(((e,t)=>({name:{title:e("ui.panel.config.backup.name"),main:!0,sortable:!0,filterable:!0,flex:3},size:{title:e("ui.panel.config.backup.size"),filterable:!0,sortable:!0,template:e=>(0,x.d)(e.size)},date:{title:e("ui.panel.config.backup.created"),direction:"desc",filterable:!0,sortable:!0,template:e=>(0,l.G)(new Date(e.date),this.hass.locale)},formatted_type:{title:e("ui.panel.config.backup.backup_type"),filterable:!0,sortable:!0,groupable:!0},locations:{title:e("ui.panel.config.backup.locations"),showNarrow:!0,minWidth:24*t+4*(t-1)+32+"px",template:e=>{const a=e.agent_ids,i=a.length>t?[...a].splice(0,t-1):a,n=Math.max(a.length-i.length,0);return s.dy` <div style="display:flex;gap:4px"> ${i.map((e=>{const t=(0,k.Sw)(this.hass.localize,e,this.agents);if((0,k.V1)(e))return s.dy` <ha-svg-icon .path="${L}" title="${t}" style="flex-shrink:0"></ha-svg-icon> `;if((0,k.BR)(e))return s.dy` <ha-svg-icon .path="${S}" title="${t}" style="flex-shrink:0"></ha-svg-icon> `;const a=(0,u.M)(e);return s.dy` <img title="${t}" .src="${(0,w.X1)({domain:a,type:"icon",useFallback:!0,darkOptimized:this.hass.themes?.darkMode})}" height="24" crossorigin="anonymous" referrerpolicy="no-referrer" alt="${t}" slot="graphic" style="flex-shrink:0"> `}))} ${n?s.dy` <span style="display:flex;align-items:center;font-size:14px"> +${n} </span> `:s.Ld} </div> `}},actions:{title:"",label:e("ui.panel.config.generic.headers.actions"),showNarrow:!0,moveable:!1,hideable:!1,type:"overflow-menu",template:e=>s.dy` <ha-icon-overflow-menu .hass="${this.hass}" narrow .items="${[{label:this.hass.localize("ui.common.download"),path:B,action:()=>this._downloadBackup(e)},{label:this.hass.localize("ui.common.delete"),path:H,action:()=>this._deleteBackup(e),warning:!0}]}"> </ha-icon-overflow-menu> `}})))}},{kind:"field",key:"_groupOrder",value:()=>(0,c.Z)(((e,t,a)=>"formatted_type"===e?(0,k.mu)(a).map((e=>t(`ui.panel.config.backup.type.${e}`))):void 0))},{kind:"method",key:"_handleGroupingChanged",value:function(e){this._activeGrouping=e.detail.value}},{kind:"method",key:"_handleCollapseChanged",value:function(e){this._activeCollapsed=e.detail.value}},{kind:"method",key:"_handleSelectionChanged",value:function(e){this._selected=e.detail.value}},{kind:"field",key:"_data",value:()=>(0,c.Z)(((e,t,a,i)=>{const n=t["ha-filter-states"];let s=e;return n?.length&&(s=s.filter((e=>{const t=(0,k.Vn)(e,i);return n.includes(t)}))),s.map((e=>{const t=(0,k.Vn)(e,i),n=Object.keys(e.agents);return{...e,size:(0,k.En)(e),agent_ids:n.sort(k.Ef),formatted_type:a(`ui.panel.config.backup.type.${t}`)}}))}))},{kind:"field",key:"_maxAgents",value:()=>(0,c.Z)((e=>Math.max(...e.map((e=>e.agent_ids.length)))))},{kind:"method",key:"render",value:function(){const e="state"in this.manager&&"in_progress"===this.manager.state,t=(0,r.p)(this.hass,"hassio"),a=this._data(this.backups,this._filters,this.hass.localize,t),i=Math.min(this._maxAgents(a),this.narrow?3:5);return s.dy` <hass-tabs-subpage-data-table has-fab .tabs="${[{name:this.hass.localize("ui.panel.config.backup.backups.header"),path:"/config/backup/list"}]}" .hass="${this.hass}" .narrow="${this.narrow}" back-path="/config/backup/overview" clickable id="backup_id" has-filters .filters="${Object.values(this._filters).filter((e=>Array.isArray(e)?e.length:e&&Object.values(e).some((e=>Array.isArray(e)?e.length:e)))).length}" selectable .selected="${this._selected.length}" .initialGroupColumn="${this._activeGrouping}" .initialCollapsedGroups="${this._activeCollapsed}" .groupOrder="${this._groupOrder(this._activeGrouping,this.hass.localize,t)}" @grouping-changed="${this._handleGroupingChanged}" @collapsed-changed="${this._handleCollapseChanged}" @selection-changed="${this._handleSelectionChanged}" .route="${this.route}" @row-click="${this._showBackupDetails}" .columns="${this._columns(this.hass.localize,i)}" .data="${a}" .noDataText="${this.hass.localize("ui.panel.config.backup.no_backups")}" .searchLabel="${this.hass.localize("ui.panel.config.backup.picker.search")}"> <div slot="toolbar-icon"> <ha-button-menu> <ha-icon-button slot="trigger" .label="${this.hass.localize("ui.common.menu")}" .path="${M}"></ha-icon-button> <ha-list-item graphic="icon" @request-selected="${this._uploadBackup}"> <ha-svg-icon slot="graphic" .path="${P}"></ha-svg-icon> ${this.hass.localize("ui.panel.config.backup.backups.menu.upload_backup")} </ha-list-item> </ha-button-menu> </div> <div slot="selection-bar"> ${this.narrow?s.dy` <ha-icon-button .label="${this.hass.localize("ui.panel.config.backup.backups.delete_selected")}" .path="${H}" class="warning" @click="${this._deleteSelected}"></ha-icon-button> `:s.dy` <ha-button @click="${this._deleteSelected}" class="warning"> ${this.hass.localize("ui.panel.config.backup.backups.delete_selected")} </ha-button> `} </div> <ha-filter-states .hass="${this.hass}" .label="${this.hass.localize("ui.panel.config.backup.backup_type")}" .value="${this._filters["ha-filter-states"]}" .states="${this._states(this.hass.localize,t)}" @data-table-filter-changed="${this._filterChanged}" slot="filter-pane" expanded .narrow="${this.narrow}"></ha-filter-states> ${this._needsOnboarding?s.Ld:s.dy` <ha-fab slot="fab" ?disabled="${e}" .label="${this.hass.localize("ui.panel.config.backup.backups.new_backup")}" extended @click="${this._newBackup}"> ${e?s.dy`<div slot="icon" class="loading"> <ha-spinner .size="${"small"}"></ha-spinner> </div>`:s.dy`<ha-svg-icon slot="icon" .path="${Z}"></ha-svg-icon>`} </ha-fab> `} </hass-tabs-subpage-data-table> `}},{kind:"field",key:"_states",value:()=>(0,c.Z)(((e,t)=>(0,k.mu)(t).map((t=>({value:t,label:e(`ui.panel.config.backup.type.${t}`)})))))},{kind:"method",key:"_filterChanged",value:function(e){const t=e.target.localName;this._filters={...this._filters,[t]:e.detail.value}}},{kind:"method",key:"_setFiltersFromUrl",value:function(){const e=new URLSearchParams(window.location.search).get("type");e&&(this._filters={"ha-filter-states":"all"===e?[]:[e]})}},{kind:"get",key:"_needsOnboarding",value:function(){return!this.config?.automatic_backups_configured}},{kind:"method",key:"_uploadBackup",value:async function(e){(0,p.Q)(e)&&await(0,A.o)(this,{})}},{kind:"method",key:"_newBackup",value:async function(){const e=this.config,t=await(0,C.g)(this,{config:e});if(t){if("manual"===t){const e=await(0,$.y)(this,{cloudStatus:this.cloudStatus});if(!e)return;return await(0,k.Zk)(this.hass,e),void(0,h.B)(this,"ha-refresh-backup-info")}"automatic"===t&&(await(0,k.aq)(this.hass),(0,h.B)(this,"ha-refresh-backup-info"))}}},{kind:"method",key:"_showBackupDetails",value:function(e){const t=e.detail.id;(0,f.c)(`/config/backup/details/${t}`)}},{kind:"method",key:"_downloadBackup",value:async function(e){(0,z.w)(this.hass,this,e,this.config)}},{kind:"method",key:"_deleteBackup",value:async function(e){if(await(0,b.showConfirmationDialog)(this,{title:this.hass.localize("ui.panel.config.backup.dialogs.delete.title"),text:this.hass.localize("ui.panel.config.backup.dialogs.delete.text"),confirmText:this.hass.localize("ui.common.delete"),destructive:!0})){try{await(0,k.Ug)(this.hass,e.backup_id),this._selected.includes(e.backup_id)&&(this._selected=this._selected.filter((t=>t!==e.backup_id)))}catch(e){return void(0,b.showAlertDialog)(this,{title:this.hass.localize("ui.panel.config.backup.dialogs.delete.failed"),text:(0,v.js)(e)})}(0,h.B)(this,"ha-refresh-backup-info")}}},{kind:"method",key:"_deleteSelected",value:async function(){if(await(0,b.showConfirmationDialog)(this,{title:this.hass.localize("ui.panel.config.backup.dialogs.delete_selected.title"),text:this.hass.localize("ui.panel.config.backup.dialogs.delete_selected.text"),confirmText:this.hass.localize("ui.common.delete"),destructive:!0})){try{await Promise.all(this._selected.map((e=>(0,k.Ug)(this.hass,e))))}catch(e){return void(0,b.showAlertDialog)(this,{title:this.hass.localize("ui.panel.config.backup.dialogs.delete_selected.failed"),text:(0,v.js)(e)})}(0,h.B)(this,"ha-refresh-backup-info"),this._dataTable.clearSelection()}}},{kind:"get",static:!0,key:"styles",value:function(){return[_.Qx,s.iv`.loading{display:flex}ha-spinner{--ha-spinner-indicator-color:var(--mdc-theme-on-secondary)}`]}}]}}),(0,y.f)(s.oi));t()}catch(e){t(e)}}))},89717:function(e,t,a){a.a(e,(async function(e,t){try{var i=a(44249),n=(a(9359),a(70104),a(57243)),s=a(15093),o=a(36522),c=a(87707),r=(a(59826),a(34273),a(54977),a(20130),a(17170)),l=(a(65981),a(13928),a(59959)),d=(a(7285),a(37583),a(26779)),h=(a(87979),a(38419),a(28008)),u=a(81742),p=(a(6848),a(84370)),f=a(24714),g=a(85418),m=a(23989),k=a(76482),v=a(82438),b=a(98015),y=e([r,l,u,p,f,g,d]);[r,l,u,p,f,g,d]=y.then?(await y)():y;const _="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",w="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z",x="M9,16V10H5L12,3L19,10H15V16H9M5,20V18H19V20H5Z";(0,i.Z)([(0,s.Mo)("ha-config-backup-overview")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"cloudStatus",value:void 0},{kind:"field",decorators:[(0,s.Cb)({type:Boolean})],key:"narrow",value:()=>!1},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"route",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"manager",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"info",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"backups",value:()=>[]},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"fetching",value:()=>!1},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"config",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"agents",value:()=>[]},{kind:"method",key:"_uploadBackup",value:async function(e){(0,c.Q)(e)&&await(0,b.o)(this,{})}},{kind:"method",key:"_handleOnboardingButtonClick",value:function(e){e.stopPropagation(),this._setupAutomaticBackup(!0)}},{kind:"method",key:"_setupAutomaticBackup",value:async function(e=!1){await(0,m.w)(this,{config:this.config,cloudStatus:this.cloudStatus,skipWelcome:e})&&((0,o.B)(this,"ha-refresh-backup-config"),await(0,d.aq)(this.hass),(0,o.B)(this,"ha-refresh-backup-info"))}},{kind:"method",key:"_newBackup",value:async function(){if(this._needsOnboarding)return void this._setupAutomaticBackup();if(!this.config)return;const e=this.config,t=await(0,v.g)(this,{config:e});if(t){if("manual"===t){const e=await(0,k.y)(this,{cloudStatus:this.cloudStatus});if(!e)return;return await(0,d.Zk)(this.hass,e),void(0,o.B)(this,"ha-refresh-backup-info")}"automatic"===t&&(await(0,d.aq)(this.hass),(0,o.B)(this,"ha-refresh-backup-info"))}}},{kind:"get",key:"_needsOnboarding",value:function(){return this.config&&!this.config.automatic_backups_configured}},{kind:"method",key:"render",value:function(){const e="state"in this.manager&&"in_progress"===this.manager.state;return n.dy` <hass-subpage back-path="/config/system" .hass="${this.hass}" .narrow="${this.narrow}" .header="${this.hass.localize("ui.panel.config.backup.overview.header")}"> <ha-button-menu slot="toolbar-icon"> <ha-icon-button slot="trigger" .label="${this.hass.localize("ui.common.menu")}" .path="${_}"></ha-icon-button> <ha-list-item graphic="icon" @request-selected="${this._uploadBackup}"> <ha-svg-icon slot="graphic" .path="${x}"></ha-svg-icon> ${this.hass.localize("ui.panel.config.backup.overview.menu.upload_backup")} </ha-list-item> </ha-button-menu> <div class="content"> ${this.info&&Object.keys(this.info.agent_errors).length?n.dy`${Object.entries(this.info.agent_errors).map((([e,t])=>n.dy`<ha-alert alert-type="error" .title="${this.hass.localize("ui.panel.config.backup.overview.agent_error",{name:(0,d.Sw)(this.hass.localize,e,this.agents)})}"> ${t} </ha-alert>`))}`:n.Ld} ${e?n.dy` <ha-backup-overview-progress .hass="${this.hass}" .manager="${this.manager}"> </ha-backup-overview-progress> `:this._needsOnboarding?n.dy` <ha-backup-overview-onboarding .hass="${this.hass}" @button-click="${this._handleOnboardingButtonClick}"> </ha-backup-overview-onboarding> `:this.config?n.dy` <ha-backup-overview-summary .hass="${this.hass}" .backups="${this.backups}" .config="${this.config}" .fetching="${this.fetching}"> </ha-backup-overview-summary> `:n.Ld} <ha-backup-overview-backups .hass="${this.hass}" .backups="${this.backups}"></ha-backup-overview-backups> ${!this._needsOnboarding&&this.config?n.dy` <ha-backup-overview-settings .hass="${this.hass}" .config="${this.config}" .agents="${this.agents}"></ha-backup-overview-settings> `:n.Ld} </div> <ha-fab slot="fab" ?disabled="${e}" .label="${this.hass.localize("ui.panel.config.backup.overview.new_backup")}" extended @click="${this._newBackup}"> ${e?n.dy`<div slot="icon" class="loading"> <ha-spinner .size="${"small"}"></ha-spinner> </div>`:n.dy`<ha-svg-icon slot="icon" .path="${w}"></ha-svg-icon>`} </ha-fab> </hass-subpage> `}},{kind:"get",static:!0,key:"styles",value:function(){return[h.Qx,n.iv`.content{padding:28px 20px 0;max-width:690px;margin:0 auto;gap:24px;display:flex;flex-direction:column;margin-bottom:calc(env(safe-area-inset-bottom) + 72px)}.card-actions{display:flex;justify-content:flex-end}.card-content{padding-left:0;padding-right:0}.loading{display:flex}ha-spinner{--ha-spinner-indicator-color:var(--mdc-theme-on-secondary)}`]}}]}}),n.oi);t()}catch(e){t(e)}}))},13835:function(e,t,a){a.a(e,(async function(e,i){try{a.r(t);var n=a(44249),s=a(72621),o=a(15093),c=a(26779),r=a(36029),l=a(24312),d=(a(38419),a(6736)),h=a(72473),u=a(91203),p=a(89717),f=e([u,p,c]);[u,p,c]=f.then?(await f)():f;(0,n.Z)([(0,o.Mo)("ha-config-backup")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"cloudStatus",value:void 0},{kind:"field",decorators:[(0,o.Cb)({type:Boolean})],key:"narrow",value:()=>!1},{kind:"field",decorators:[(0,o.SB)()],key:"_manager",value:()=>r.X},{kind:"field",decorators:[(0,o.SB)()],key:"_info",value:void 0},{kind:"field",decorators:[(0,o.SB)()],key:"_agents",value:()=>[]},{kind:"field",decorators:[(0,o.SB)()],key:"_fetching",value:()=>!1},{kind:"field",decorators:[(0,o.SB)()],key:"_config",value:void 0},{kind:"method",key:"firstUpdated",value:function(e){(0,s.Z)(i,"firstUpdated",this,3)([e]),this._fetchAll(),this.addEventListener("ha-refresh-backup-info",(()=>{this._fetchBackupInfo()})),this.addEventListener("ha-refresh-backup-config",(()=>{this._fetchBackupConfig()})),this.addEventListener("ha-refresh-backup-agents",(()=>{this._fetchBackupAgents()}))}},{kind:"method",key:"_fetchAll",value:function(){this._fetching=!0,Promise.all([this._fetchBackupInfo(),this._fetchBackupConfig(),this._fetchBackupAgents()]).finally((()=>{this._fetching=!1}))}},{kind:"method",key:"connectedCallback",value:function(){(0,s.Z)(i,"connectedCallback",this,3)([]),this.hasUpdated&&(this._fetchBackupInfo(),this._fetchBackupConfig(),this._fetchBackupAgents())}},{kind:"method",key:"_fetchBackupInfo",value:async function(){this._info=await(0,c.ZE)(this.hass)}},{kind:"method",key:"_fetchBackupConfig",value:async function(){const{config:e}=await(0,c.LG)(this.hass);this._config=e}},{kind:"method",key:"_fetchBackupAgents",value:async function(){const{agents:e}=await(0,c.xc)(this.hass);this._agents=e.sort(((e,t)=>(0,c.Ef)(e.agent_id,t.agent_id)))}},{kind:"field",key:"routerOptions",value:()=>({defaultPage:"overview",routes:{overview:{tag:"ha-config-backup-overview",cache:!0},backups:{tag:"ha-config-backup-backups",cache:!0},details:{tag:"ha-config-backup-details",load:()=>Promise.all([a.e("72087"),a.e("67800"),a.e("8889")]).then(a.bind(a,13526))},settings:{tag:"ha-config-backup-settings",load:()=>Promise.all([a.e("41258"),a.e("86628"),a.e("3561"),a.e("87126"),a.e("21677"),a.e("62807")]).then(a.bind(a,13310)),cache:!0},location:{tag:"ha-config-backup-location",load:()=>Promise.all([a.e("72087"),a.e("67800"),a.e("65430")]).then(a.bind(a,48189))}}})},{kind:"method",key:"updatePageEl",value:function(e,t){if(e.hass=this.hass,e.route=this.routeTail,e.narrow=this.narrow,e.cloudStatus=this.cloudStatus,e.manager=this._manager,e.info=this._info,e.backups=this._info?.backups||[],e.config=this._config,e.agents=this._agents,e.fetching=this._fetching,!t||t.has("route"))switch(this._currentPage){case"details":e.backupId=this.routeTail.path.substr(1);break;case"location":e.agentId=this.routeTail.path.substr(1)}}},{kind:"method",key:"hassSubscribe",value:function(){return[(0,r.q)(this.hass,(e=>{const t=this._manager.manager_state;if(this._manager=e,"idle"===e.manager_state&&e.manager_state!==t&&this._fetchAll(),"state"in e&&"failed"===e.state){let e="";switch(this._manager.manager_state){case"create_backup":e="Failed to create backup";break;case"restore_backup":e="Failed to restore backup";break;case"receive_backup":e="Failed to upload backup"}e&&(0,h.C)(this,{message:e})}}))]}}]}}),(0,d.f)(l.n));i()}catch(e){i(e)}}))},9807:function(e,t,a){a.a(e,(async function(e,i){try{a.d(t,{W:()=>d,w:()=>h});var n=a(43546),s=a(26779),o=a(58014),c=a(12660),r=a(73129),l=e([s,c]);[s,c]=l.then?(await l)():l;const d=async(e,t,a,i)=>{const c=await(0,n.iI)(e,(0,s.I0)(t,a,i));(0,o.N)(c.path)},h=async(e,t,a,i,n)=>{const o=Object.keys(a.agents),l=n??(0,s.OT)(o),h=a.agents[l]?.protected;if(!h)return void d(e,a.backup_id,l);const u=i?.create_backup?.password;if(u)try{await(0,s.fi)(e,a.backup_id,l,u),d(e,a.backup_id,l,u)}catch(i){if("password_incorrect"===i?.code)return void(0,r.N)(t,{backup:a,agentId:l});if("decrypt_not_supported"===i?.code)return void(0,c.showAlertDialog)(t,{title:e.localize("ui.panel.config.backup.dialogs.download.decryption_unsupported_title"),text:e.localize("ui.panel.config.backup.dialogs.download.decryption_unsupported"),confirm(){d(e,a.backup_id,l)}});(0,c.showAlertDialog)(t,{title:e.localize("ui.panel.config.backup.dialogs.download.error_check_title",{error:i.message}),text:e.localize("ui.panel.config.backup.dialogs.download.error_check_description",{error:i.message})})}else(0,r.N)(t,{backup:a,agentId:l})};i()}catch(e){i(e)}}))},52032:function(e,t,a){a.a(e,(async function(e,i){try{a.d(t,{w:()=>u});a(92519),a(42179),a(89256),a(24931),a(88463),a(57449),a(19814);var n=a(35729),s=(a(83442),a(92263)),o=a(15367),c=a(56332),r=a(13888),l=(a(9427),a(40249)),d=e([n,s,o,c,r]);[n,s,o,c,r]=d.then?(await d)():d;const h=new Set(["conditional","icon","image","service-button","state-badge","state-icon","state-label"]),u=e=>("action-button"===e.type&&(e={...e,type:"service-button"}),(0,l.Tw)("element",e,h));i()}catch(e){i(e)}}))},16485:function(e,t,a){a.a(e,(async function(e,t){try{a(92745);var i=a(61449),n=a(40574),s=a(30532),o=a(41674),c=a(49722),r=a(76632),l=a(7884),d=a(35185),h=a(60933),u=a(44180),p=a(49447);const e=async()=>{const e=(0,u.sS)(),t=[];(0,s.shouldPolyfill)()&&await Promise.all([a.e("80210"),a.e("74055")]).then(a.bind(a,98133)),(0,c.shouldPolyfill)()&&await Promise.all([a.e("83895"),a.e("75297"),a.e("80210"),a.e("60251")]).then(a.bind(a,59095)),(0,i.shouldPolyfill)(e)&&t.push(Promise.all([a.e("83895"),a.e("75297"),a.e("68250")]).then(a.bind(a,80561)).then((()=>(0,p.H)()))),(0,h.shouldPolyfill)()&&t.push(Promise.all([a.e("83895"),a.e("75297"),a.e("65578")]).then(a.bind(a,97995))),(0,n.shouldPolyfill)(e)&&t.push(Promise.all([a.e("83895"),a.e("75297"),a.e("59826")]).then(a.bind(a,31514))),(0,o.shouldPolyfill)(e)&&t.push(Promise.all([a.e("83895"),a.e("75297"),a.e("23649")]).then(a.bind(a,93840))),(0,r.shouldPolyfill)(e)&&t.push(Promise.all([a.e("83895"),a.e("75297"),a.e("42831")]).then(a.bind(a,29559))),(0,l.shouldPolyfill)(e)&&t.push(Promise.all([a.e("83895"),a.e("75297"),a.e("57377")]).then(a.bind(a,39030)).then((()=>a.e("61236").then(a.t.bind(a,4121,23))))),(0,d.shouldPolyfill)(e)&&t.push(Promise.all([a.e("83895"),a.e("75297"),a.e("13870")]).then(a.bind(a,74546))),0!==t.length&&await Promise.all(t).then((()=>(0,p.n)(e)))};await e(),t()}catch(e){t(e)}}),1)},88238:function(e,t,a){a.d(t,{RU:()=>n,X1:()=>i,u4:()=>s,zC:()=>o});const i=e=>`https://brands.home-assistant.io/${e.brand?"brands/":""}${e.useFallback?"_/":""}${e.domain}/${e.darkOptimized?"dark_":""}${e.type}.png`,n=e=>`https://brands.home-assistant.io/hardware/${e.category}/${e.darkOptimized?"dark_":""}${e.manufacturer}${e.model?`_${e.model}`:""}.png`,s=e=>e.split("/")[4],o=e=>e.startsWith("https://brands.home-assistant.io/")},90698:function(e,t,a){a.d(t,{d:()=>i});const i=(e=0,t=2)=>{if(0===e)return"0 Bytes";t=t<0?0:t;const a=Math.floor(Math.log(e)/Math.log(1024));return`${parseFloat((e/1024**a).toFixed(t))} ${["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"][a]}`}},58014:function(e,t,a){a.d(t,{N:()=>n,G:()=>s});var i=a(18117);const n=(e,t="")=>{const a=document.createElement("a");a.target="_blank",a.href=e,a.download=t,a.style.display="none",document.body.appendChild(a),a.dispatchEvent(new MouseEvent("click")),document.body.removeChild(a)},s=e=>!(e=>!!e.auth.external&&i.G)(e)||!!e.auth.external?.config.downloadFileSupported},18117:function(e,t,a){a.d(t,{G:()=>i});const i=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}};
//# sourceMappingURL=65120.3d6cadcd7a12249a.js.map