iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
22 lines • 35.6 kB
JavaScript
export const __rspack_esm_id=7901;export const __rspack_esm_ids=[7901];export const __webpack_modules__={80785(e,t,a){function o(e){return!!e&&(e instanceof Date&&!isNaN(e.valueOf()))}a.d(t,{A:()=>o})},380(e,t,a){a.d(t,{D:()=>l,P:()=>n});a(74423);var o=a(67932),i=a(46927),r=a(96029);const n=e=>e.first_weekday===i.zt.language?"weekInfo"in Intl.Locale.prototype?new Intl.Locale(e.language).weekInfo.firstDay%7:(0,o.S)(e.language)%7:r.Z.includes(e.first_weekday)?r.Z.indexOf(e.first_weekday):1,l=e=>{const t=n(e);return r.Z[t]}},72487(e,t,a){a.a(e,async function(e,o){try{a.d(t,{CA:()=>S,Mi:()=>A,Pm:()=>x,Wq:()=>b,Yq:()=>d,bl:()=>M,c2:()=>w,fr:()=>v,gu:()=>z,kz:()=>h,m9:()=>L,sl:()=>g,ur:()=>E,zB:()=>p});a(18111),a(20116);var i=a(74487),r=a(22786),n=a(46927),l=a(8480),s=e([i,l]);[i,l]=s.then?(await s)():s;(0,r.A)((e,t)=>new Intl.DateTimeFormat(e.language,{weekday:"long",month:"long",day:"numeric",timeZone:(0,l.wj)(e.time_zone,t)}));const d=(e,t,a)=>c(t,a.time_zone).format(e),c=(0,r.A)((e,t)=>new Intl.DateTimeFormat(e.language,{year:"numeric",month:"long",day:"numeric",timeZone:(0,l.wj)(e.time_zone,t)})),h=(e,t,a)=>u(t,a.time_zone).format(e),u=(0,r.A)((e,t)=>new Intl.DateTimeFormat(e.language,{year:"numeric",month:"short",day:"numeric",timeZone:(0,l.wj)(e.time_zone,t)})),p=(e,t,a)=>{const o=m(t,a.time_zone);if(t.date_format===n.ow.language||t.date_format===n.ow.system)return o.format(e);const i=o.formatToParts(e),r=i.find(e=>"literal"===e.type)?.value,l=i.find(e=>"day"===e.type)?.value,s=i.find(e=>"month"===e.type)?.value,d=i.find(e=>"year"===e.type)?.value,c=i[i.length-1];let h="literal"===c?.type?c?.value:"";"bg"===t.language&&t.date_format===n.ow.YMD&&(h="");return{[n.ow.DMY]:`${l}${r}${s}${r}${d}${h}`,[n.ow.MDY]:`${s}${r}${l}${r}${d}${h}`,[n.ow.YMD]:`${d}${r}${s}${r}${l}${h}`}[t.date_format]},m=(0,r.A)((e,t)=>{const a=e.date_format===n.ow.system?void 0:e.language;return e.date_format===n.ow.language||(e.date_format,n.ow.system),new Intl.DateTimeFormat(a,{year:"numeric",month:"numeric",day:"numeric",timeZone:(0,l.wj)(e.time_zone,t)})}),g=(e,t,a)=>f(t,a.time_zone).format(e),f=(0,r.A)((e,t)=>new Intl.DateTimeFormat(e.language,{day:"numeric",month:"short",timeZone:(0,l.wj)(e.time_zone,t)})),v=(e,t,a)=>_(t,a.time_zone).format(e),_=(0,r.A)((e,t)=>new Intl.DateTimeFormat(e.language,{month:"long",year:"numeric",timeZone:(0,l.wj)(e.time_zone,t)})),b=(e,t,a)=>y(t,a.time_zone).format(e),y=(0,r.A)((e,t)=>new Intl.DateTimeFormat(e.language,{month:"long",timeZone:(0,l.wj)(e.time_zone,t)})),w=(e,t,a)=>k(t,a.time_zone).format(e),k=(0,r.A)((e,t)=>new Intl.DateTimeFormat(e.language,{month:"short",timeZone:(0,l.wj)(e.time_zone,t)})),x=(e,t,a)=>C(t,a.time_zone).format(e),C=(0,r.A)((e,t)=>new Intl.DateTimeFormat(e.language,{year:"numeric",timeZone:(0,l.wj)(e.time_zone,t)})),S=(e,t,a)=>$(t,a.time_zone).format(e),$=(0,r.A)((e,t)=>new Intl.DateTimeFormat(e.language,{weekday:"long",timeZone:(0,l.wj)(e.time_zone,t)})),z=(e,t,a)=>T(t,a.time_zone).format(e),T=(0,r.A)((e,t)=>new Intl.DateTimeFormat(e.language,{weekday:"short",timeZone:(0,l.wj)(e.time_zone,t)})),A=(e,t,a)=>D(t,a.time_zone).format(e),D=(0,r.A)((e,t)=>new Intl.DateTimeFormat(e.language,{weekday:"short",month:"short",day:"numeric",timeZone:(0,l.wj)(e.time_zone,t)})),E=(e,t,a)=>F(t,a.time_zone).format(e),F=(0,r.A)((e,t)=>new Intl.DateTimeFormat(e.language,{weekday:"short",month:"short",day:"numeric",year:"numeric",timeZone:(0,l.wj)(e.time_zone,t)})),M=(e,t,a)=>{const o=(0,l.wj)(t.time_zone,a.time_zone);return new Intl.DateTimeFormat("en-CA",{year:"numeric",month:"2-digit",day:"2-digit",timeZone:o}).format(e)},L=(e,t,a,o)=>`${M(e,a,o)}/${M(t,a,o)}`;o()}catch(e){o(e)}})},95747(e,t,a){a.a(e,async function(e,o){try{a.d(t,{CL:()=>b,GH:()=>k,Rl:()=>p,ZS:()=>v,aQ:()=>g,r6:()=>h,yg:()=>y});var i=a(74487),r=a(22786),n=a(72487),l=a(30162),s=a(8480),d=a(69543),c=e([i,s,n,l]);[i,s,n,l]=c.then?(await c)():c;const h=(e,t,a)=>u(t,a.time_zone).format(e),u=(0,r.A)((e,t)=>new Intl.DateTimeFormat(e.language,{year:"numeric",month:"long",day:"numeric",hour:(0,d.J)(e)?"numeric":"2-digit",minute:"2-digit",hourCycle:(0,d.J)(e)?"h12":"h23",timeZone:(0,s.wj)(e.time_zone,t)})),p=e=>m().format(e),m=(0,r.A)(()=>new Intl.DateTimeFormat(void 0,{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"})),g=(e,t,a)=>f(t,a.time_zone).format(e),f=(0,r.A)((e,t)=>new Intl.DateTimeFormat(e.language,{year:"numeric",month:"short",day:"numeric",hour:(0,d.J)(e)?"numeric":"2-digit",minute:"2-digit",hourCycle:(0,d.J)(e)?"h12":"h23",timeZone:(0,s.wj)(e.time_zone,t)})),v=(e,t,a)=>_(t,a.time_zone).format(e),_=(0,r.A)((e,t)=>new Intl.DateTimeFormat(e.language,{month:"short",day:"numeric",hour:(0,d.J)(e)?"numeric":"2-digit",minute:"2-digit",hourCycle:(0,d.J)(e)?"h12":"h23",timeZone:(0,s.wj)(e.time_zone,t)})),b=(e,t,a)=>(new Date).getFullYear()===e.getFullYear()?v(e,t,a):g(e,t,a),y=(e,t,a)=>w(t,a.time_zone).format(e),w=(0,r.A)((e,t)=>new Intl.DateTimeFormat(e.language,{year:"numeric",month:"long",day:"numeric",hour:(0,d.J)(e)?"numeric":"2-digit",minute:"2-digit",second:"2-digit",hourCycle:(0,d.J)(e)?"h12":"h23",timeZone:(0,s.wj)(e.time_zone,t)})),k=(e,t,a)=>`${(0,n.zB)(e,t,a)}, ${(0,l.fU)(e,t,a)}`;o()}catch(e){o(e)}})},30162(e,t,a){a.a(e,async function(e,o){try{a.d(t,{LW:()=>g,Xs:()=>p,fU:()=>d,ie:()=>h});var i=a(74487),r=a(22786),n=a(8480),l=a(69543),s=e([i,n]);[i,n]=s.then?(await s)():s;const d=(e,t,a)=>c(t,a.time_zone).format(e),c=(0,r.A)((e,t)=>new Intl.DateTimeFormat(e.language,{hour:"numeric",minute:"2-digit",hourCycle:(0,l.J)(e)?"h12":"h23",timeZone:(0,n.wj)(e.time_zone,t)})),h=(e,t,a)=>u(t,a.time_zone).format(e),u=(0,r.A)((e,t)=>new Intl.DateTimeFormat(e.language,{hour:(0,l.J)(e)?"numeric":"2-digit",minute:"2-digit",second:"2-digit",hourCycle:(0,l.J)(e)?"h12":"h23",timeZone:(0,n.wj)(e.time_zone,t)})),p=(e,t,a)=>m(t,a.time_zone).format(e),m=(0,r.A)((e,t)=>new Intl.DateTimeFormat(e.language,{weekday:"long",hour:(0,l.J)(e)?"numeric":"2-digit",minute:"2-digit",hourCycle:(0,l.J)(e)?"h12":"h23",timeZone:(0,n.wj)(e.time_zone,t)})),g=(e,t,a)=>f(t,a.time_zone).format(e),f=(0,r.A)((e,t)=>new Intl.DateTimeFormat("en-GB",{hour:"numeric",minute:"2-digit",hour12:!1,timeZone:(0,n.wj)(e.time_zone,t)}));o()}catch(e){o(e)}})},98975(e,t,a){a.a(e,async function(e,o){try{a.d(t,{K:()=>d});var i=a(74487),r=a(22786),n=a(63927),l=e([i,n]);[i,n]=l.then?(await l)():l;const s=(0,r.A)(e=>new Intl.RelativeTimeFormat(e.language,{numeric:"auto"})),d=(e,t,a,o=!0)=>{const i=(0,n.x)(e,a,t);return o?s(t).format(i.value,i.unit):Intl.NumberFormat(t.language,{style:"unit",unit:i.unit,unitDisplay:"long"}).format(Math.abs(i.value))};o()}catch(e){o(e)}})},8480(e,t,a){a.a(e,async function(e,o){try{a.d(t,{fL:()=>c,n2:()=>h,wj:()=>u});var i=a(74487),r=a(29079),n=a(46927),l=e([i]);i=(l.then?(await l)():l)[0];const s=Intl.DateTimeFormat?.().resolvedOptions?.().timeZone,d=s&&("UTC"===s||"Etc/UTC"===s||s in r)?s:void 0,c=14881==a.j?void 0!==d:null,h=d??"UTC",u=(e,t)=>e===n.Wj.local&&d?h: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})},96029(e,t,a){a.d(t,{Tq:()=>n,Z:()=>i,ZV:()=>o,sj:()=>r});const o=["sun","mon","tue","wed","thu","fri","sat"],i=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],r={0:"sun",1:"mon",2:"tue",3:"wed",4:"thu",5:"fri",6:"sat"},n={sun:"sunday",mon:"monday",tue:"tuesday",wed:"wednesday",thu:"thursday",fri:"friday",sat:"saturday"}},63927(e,t,a){a.a(e,async function(e,o){try{a.d(t,{x:()=>h});var i=a(6946),r=a(52640),n=a(38684),l=a(380);const s=1e3,d=60,c=60*d;function h(e,t=Date.now(),a,o={}){const h={...u,...o||{}},p=(+e-+t)/s;if(Math.abs(p)<h.second)return{value:Math.round(p),unit:"second"};const m=p/d;if(Math.abs(m)<h.minute)return{value:Math.round(m),unit:"minute"};const g=p/c;if(Math.abs(g)<h.hour)return{value:Math.round(g),unit:"hour"};const f=new Date(e),v=new Date(t);f.setHours(0,0,0,0),v.setHours(0,0,0,0);const _=(0,i.c)(f,v);if(0===_)return{value:Math.round(g),unit:"hour"};if(Math.abs(_)<h.day)return{value:_,unit:"day"};const b=(0,l.P)(a),y=(0,r.k)(f,{weekStartsOn:b}),w=(0,r.k)(v,{weekStartsOn:b}),k=(0,n.I)(y,w);if(0===k)return{value:_,unit:"day"};if(Math.abs(k)<h.week)return{value:k,unit:"week"};const x=f.getFullYear()-v.getFullYear(),C=12*x+f.getMonth()-v.getMonth();return 0===C?{value:k,unit:"week"}:Math.abs(C)<h.month||0===x?{value:C,unit:"month"}:{value:Math.round(x),unit:"year"}}const u={second:59,minute:59,hour:22,day:5,week:4,month:11};o()}catch(p){o(p)}})},64481(e,t,a){a.d(t,{D:()=>i,J:()=>n});a(64979);let o=!1;try{o="true"===window.localStorage.getItem("disableViewTransition")}catch{}const i=e=>{o=e},r=e=>{if(!(e=>(e instanceof DOMException||e instanceof Error)&&"AbortError"===e.name)(e))throw e},n=e=>{if(!document.startViewTransition||o)return e(!1),Promise.resolve();let t=!1;try{const a=document.startViewTransition(()=>{t=!0,e(!0)});return a.ready.catch(r),a.finished.catch(r)}catch(a){return console.warn("View transition failed, falling back to direct execution.",a),t?Promise.reject(a):(e(!1),Promise.resolve())}}},93444(e,t,a){var o=a(62826),i=a(5124),r=a(22441);class n extends i.WF{render(){return i.qy` <footer> <slot name="secondaryAction"></slot> <slot name="primaryAction"></slot> </footer> `}static get styles(){return[i.AH`footer{display:flex;gap:var(--ha-space-3);justify-content:flex-end;align-items:center;width:100%}`]}}n=(0,o.Cg)([(0,r.EM)("ha-dialog-footer")],n)},76538(e,t,a){var o=a(62826),i=a(5124),r=a(22441);class n extends i.WF{render(){const e=i.qy`<div class="header-title"> <slot name="title"></slot> </div>`,t=i.qy`<div class="header-subtitle"> <slot name="subtitle"></slot> </div>`;return i.qy` <header class="header"> <div class="header-bar"> <section class="header-navigation-icon"> <slot name="navigationIcon"></slot> </section> <section class="header-content"> ${"above"===this.subtitlePosition?i.qy`${t}${e}`:i.qy`${e}${t}`} </section> <section class="header-action-items"> <slot name="actionItems"></slot> </section> </div> <slot></slot> </header> `}static get styles(){return[i.AH`:host{display:block}:host([show-border]){border-bottom:1px solid var(--mdc-dialog-scroll-divider-color,rgba(0,0,0,.12))}.header-bar{display:flex;flex-direction:row;align-items:center;padding:0 var(--ha-space-1);box-sizing:border-box}.header-content{flex:1;padding:10px var(--ha-space-1);display:flex;flex-direction:column;justify-content:center;min-height:var(--ha-space-12);min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.header-title{height:var(--ha-dialog-header-title-height,calc(var(--ha-font-size-xl) + var(--ha-space-1)));font-size:var(--ha-font-size-xl);line-height:var(--ha-line-height-condensed);font-weight:var(--ha-font-weight-medium);color:var(--ha-dialog-header-title-color,var(--primary-text-color))}.header-subtitle{font-size:var(--ha-font-size-m);line-height:var(--ha-line-height-normal);color:var(--ha-dialog-header-subtitle-color,var(--secondary-text-color))}@media all and (min-width:450px) and (min-height:500px){.header-bar{padding:0 var(--ha-space-2)}}.header-navigation-icon{flex:none;min-width:var(--ha-space-2);height:100%;display:flex;flex-direction:row}.header-action-items{flex:none;min-width:var(--ha-space-2);height:100%;display:flex;flex-direction:row}`]}constructor(...e){super(...e),this.subtitlePosition="below",this.showBorder=!1}}(0,o.Cg)([(0,r.MZ)({type:String,attribute:"subtitle-position"})],n.prototype,"subtitlePosition",void 0),(0,o.Cg)([(0,r.MZ)({type:Boolean,reflect:!0,attribute:"show-border"})],n.prototype,"showBorder",void 0),n=(0,o.Cg)([(0,r.EM)("ha-dialog-header")],n)},72554(e,t,a){a.a(e,async function(e,t){try{var o=a(62826),i=a(93900),r=a(35211),n=a(5124),l=a(22441),s=a(63672),d=a(1087),c=a(64481),h=a(22792),u=a(59992),p=a(14503),m=a(22348),g=(a(76538),a(26300)),f=e([i,g]);[i,g]=f.then?(await f)():f;const v="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";class _ extends((0,u.V)(n.WF)){connectedCallback(){super.connectedCallback(),this.addEventListener("dialog-set-fullscreen",this._handleFullscreenChanged)}get scrollableElement(){return this.bodyContainer}updated(e){super.updated(e),e.has("open")&&(this._open=this.open)}render(){return n.qy` <wa-dialog .open="${this._open}" .lightDismiss="${!this.preventScrimClose}" without-header aria-labelledby="${(0,s.J)(this.ariaLabelledBy||(void 0!==this.headerTitle?"ha-dialog-title":void 0))}" aria-describedby="${(0,s.J)(this.ariaDescribedBy)}" @keydown="${this._handleKeyDown}" @wa-hide="${this._handleHide}" @wa-show="${this._handleShow}" @wa-after-show="${this._handleAfterShow}" @wa-after-hide="${this._handleAfterHide}"> ${this.withoutHeader?n.s6:n.qy`<slot name="header"> <ha-dialog-header .subtitlePosition="${this.headerSubtitlePosition}" .showBorder="${this._bodyScrolled}"> <slot name="headerNavigationIcon" slot="navigationIcon"> <ha-icon-button data-dialog="close" .label="${this._i18n?.localize?.("ui.common.close")??"Close"}" .path="${v}"></ha-icon-button> </slot> ${void 0!==this.headerTitle?n.qy`<span slot="title" class="title" id="ha-dialog-title"> ${this.headerTitle} </span>`:n.qy`<slot name="headerTitle" slot="title"></slot>`} ${void 0!==this.headerSubtitle?n.qy`<span slot="subtitle">${this.headerSubtitle}</span>`:n.qy`<slot name="headerSubtitle" slot="subtitle"></slot>`} <slot name="headerActionItems" slot="actionItems"></slot> </ha-dialog-header> </slot>`} <div class="content-wrapper"> <div class="body ha-scrollbar" @scroll="${this._handleBodyScroll}"> <slot></slot> </div> ${this.renderScrollableFades()} </div> <slot name="footer" slot="footer"></slot> </wa-dialog> `}disconnectedCallback(){this.removeEventListener("dialog-set-fullscreen",this._handleFullscreenChanged),this._setFullscreen(!1),super.disconnectedCallback(),this._open=!1}_handleFullscreenChanged(e){this._open?(0,c.J)(()=>{this._setFullscreen(e.detail)}):this._setFullscreen(e.detail)}_setFullscreen(e){this.toggleAttribute("fullscreen",e)}_handleBodyScroll(e){this._bodyScrolled=e.target.scrollTop>0}_handleKeyDown(e){"Escape"===e.key&&(this._escapePressed=!0,this.preventScrimClose&&e.preventDefault(),e.stopPropagation(),e.currentTarget.open=!1)}_handleHide(e){const t=e.detail?.source===e.target.dialog;this.preventScrimClose&&this._escapePressed&&t&&e.preventDefault(),this._escapePressed=!1}static get styles(){return[...super.styles,p.dp,n.AH`wa-dialog{--full-width:var(
--ha-dialog-width-full,
min(95vw, var(--safe-width))
);--width:min(var(--ha-dialog-width-md, 580px), var(--full-width));--spacing:var(--dialog-content-padding, var(--ha-space-6));--show-duration:var(--ha-dialog-show-duration, 200ms);--hide-duration:var(--ha-dialog-hide-duration, 200ms);--wa-color-surface-raised:var(
--ha-dialog-surface-background,
var(--card-background-color, var(--ha-color-surface-default))
);--wa-panel-border-radius:var(
--ha-dialog-border-radius,
var(--ha-border-radius-3xl)
);max-width:var(--ha-dialog-max-width,var(--safe-width))}@media (prefers-reduced-motion:reduce){wa-dialog{--show-duration:0ms;--hide-duration:0ms}}:host([width=small]) wa-dialog{--width:min(var(--ha-dialog-width-sm, 320px), var(--full-width))}:host([width=large]) wa-dialog{--width:min(var(--ha-dialog-width-lg, 1024px), var(--full-width))}:host([fullscreen]) wa-dialog,:host([width=full]) wa-dialog{--width:var(--full-width)}:host([fullscreen]) wa-dialog::part(dialog){min-height:var(--safe-height);max-height:var(--safe-height);margin-top:0;transform:none}:host([fullscreen]) .content-wrapper{overflow:hidden}:host([fullscreen]) .body{overflow:hidden;padding:0}wa-dialog::part(dialog){-webkit-backdrop-filter:var(--ha-dialog-surface-backdrop-filter,none);backdrop-filter:var(--ha-dialog-surface-backdrop-filter,none);box-shadow:var(--dialog-box-shadow,var(--wa-shadow-l));color:var(--primary-text-color);min-width:var(--width,var(--full-width));max-width:var(--width,var(--full-width));max-height:var(--ha-dialog-max-height,calc(var(--safe-height) - var(--ha-space-20)));min-height:var(--ha-dialog-min-height);margin-top:var(--dialog-surface-margin-top,auto);transform:translate(calc(var(--safe-area-offset-left,0px) - var(--safe-area-offset-right,0px)),calc(var(--safe-area-offset-top,0px) - var(--safe-area-offset-bottom,0px)));display:flex;flex-direction:column;overflow:hidden}wa-dialog::part(dialog)::backdrop{-webkit-backdrop-filter:var(--ha-dialog-scrim-backdrop-filter,var(--dialog-backdrop-filter,none));backdrop-filter:var(--ha-dialog-scrim-backdrop-filter,var(--dialog-backdrop-filter,none));background-color:var(--mdc-dialog-scrim-color,none)}@media all and (max-width:450px),all and (max-height:500px){:host([type=standard]){--ha-dialog-border-radius:0}:host([type=standard]) wa-dialog{--full-width:var(--ha-dialog-width-full, 100vw);--width:var(--full-width)}:host([type=standard]) wa-dialog::part(dialog){min-height:var(--ha-dialog-min-height,100vh);min-height:var(--ha-dialog-min-height,100dvh);max-height:var(--ha-dialog-max-height,100vh);max-height:var(--ha-dialog-max-height,100dvh);margin-top:0;margin-bottom:0;padding-top:var(--safe-area-inset-top);padding-bottom:var(--safe-area-inset-bottom);padding-left:var(--safe-area-inset-left);padding-right:var(--safe-area-inset-right);transform:none}}.header-title-container{display:flex;align-items:center}.header-title{margin:0;margin-bottom:0;color:var(--ha-dialog-header-title-color,var(--primary-text-color));font-size:var(
--ha-dialog-header-title-font-size,
var(--ha-font-size-2xl)
);line-height:var(
--ha-dialog-header-title-line-height,
var(--ha-line-height-condensed)
);font-weight:var(--ha-dialog-header-title-font-weight,var(--ha-font-weight-normal));overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-right:var(--ha-space-3)}wa-dialog::part(body){padding:0;display:flex;flex-direction:column;max-width:100%;overflow:hidden}.content-wrapper{position:relative;flex:1;display:flex;flex-direction:column;min-height:0}.body{position:var(--dialog-content-position,relative);padding:var(--dialog-content-padding,0 var(--ha-space-6) var(--ha-space-6) var(--ha-space-6));overflow:auto;flex-grow:1}:host([flexcontent]) .body{max-width:100%;flex:1;display:flex;flex-direction:column}wa-dialog::part(footer){padding:0}::slotted([slot=footer]){display:flex;padding:var(--ha-space-3) var(--ha-space-4) var(--ha-space-4) var(--ha-space-4);gap:var(--ha-space-3);justify-content:flex-end;align-items:center;width:100%}`]}constructor(...e){super(...e),this.open=!1,this.type="standard",this.width="medium",this.preventScrimClose=!1,this.headerSubtitlePosition="below",this.flexContent=!1,this.withoutHeader=!1,this._open=!1,this._bodyScrolled=!1,this._escapePressed=!1,this._handleShow=async e=>{e.eventPhase===Event.AT_TARGET&&(this._open=!0,(0,d.r)(this,"opened"),await this.updateComplete,requestAnimationFrame(()=>{if(this._hassConfig?.auth.external&&(0,m.V)(this._hassConfig.auth.external)){const e=this.querySelector("[autofocus]");return void(null!==e&&(e.id||(e.id="ha-dialog-autofocus"),this._hassConfig.auth.external.fireMessage({type:"focus_element",payload:{element_id:e.id}})))}this.querySelector("[autofocus]")?.focus()}))},this._handleAfterShow=e=>{e.eventPhase===Event.AT_TARGET&&(0,d.r)(this,"after-show")},this._handleAfterHide=e=>{e.eventPhase===Event.AT_TARGET&&(this._open=!1,this._setFullscreen(!1),(0,d.r)(this,"closed"))}}}(0,o.Cg)([(0,l.MZ)({attribute:"aria-labelledby"})],_.prototype,"ariaLabelledBy",void 0),(0,o.Cg)([(0,l.MZ)({attribute:"aria-describedby"})],_.prototype,"ariaDescribedBy",void 0),(0,o.Cg)([(0,l.MZ)({type:Boolean,reflect:!0})],_.prototype,"open",void 0),(0,o.Cg)([(0,l.MZ)({reflect:!0})],_.prototype,"type",void 0),(0,o.Cg)([(0,l.MZ)({type:String,reflect:!0,attribute:"width"})],_.prototype,"width",void 0),(0,o.Cg)([(0,l.MZ)({type:Boolean,reflect:!0,attribute:"prevent-scrim-close"})],_.prototype,"preventScrimClose",void 0),(0,o.Cg)([(0,l.MZ)({attribute:"header-title"})],_.prototype,"headerTitle",void 0),(0,o.Cg)([(0,l.MZ)({attribute:"header-subtitle"})],_.prototype,"headerSubtitle",void 0),(0,o.Cg)([(0,l.MZ)({type:String,attribute:"header-subtitle-position"})],_.prototype,"headerSubtitlePosition",void 0),(0,o.Cg)([(0,l.MZ)({type:Boolean,reflect:!0,attribute:"flexcontent"})],_.prototype,"flexContent",void 0),(0,o.Cg)([(0,l.MZ)({type:Boolean,attribute:"without-header"})],_.prototype,"withoutHeader",void 0),(0,o.Cg)([(0,l.wk)()],_.prototype,"_open",void 0),(0,o.Cg)([(0,l.P)(".body")],_.prototype,"bodyContainer",void 0),(0,o.Cg)([(0,l.wk)(),(0,r.Fg)({context:h.D5,subscribe:!0})],_.prototype,"_i18n",void 0),(0,o.Cg)([(0,l.wk)(),(0,r.Fg)({context:h.WF,subscribe:!0})],_.prototype,"_hassConfig",void 0),(0,o.Cg)([(0,l.wk)()],_.prototype,"_bodyScrolled",void 0),(0,o.Cg)([(0,l.Ls)({passive:!0})],_.prototype,"_handleBodyScroll",null),_=(0,o.Cg)([(0,l.EM)("ha-dialog")],_),t()}catch(e){t(e)}})},2846(e,t,a){a.d(t,{G:()=>d,J:()=>s});var o=a(62826),i=a(58168),r=a(82553),n=a(5124),l=a(22441);a(54276);const s=[r.R,n.AH`: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);gap:var(--ha-md-list-item-gap,16px)}`];class d extends i.n{renderRipple(){return"text"===this.type?n.s6:n.qy`<ha-ripple part="ripple" for="item" ?disabled="${this.disabled&&"link"!==this.type}"></ha-ripple>`}}d.styles=s,d=(0,o.Cg)([(0,l.EM)("ha-md-list-item")],d)},17308(e,t,a){var o=a(62826),i=a(49838),r=a(11245),n=a(5124),l=a(22441);class s extends i.B{}s.styles=[r.R,n.AH`:host{--md-sys-color-surface:var(--card-background-color)}`],s=(0,o.Cg)([(0,l.EM)("ha-md-list")],s)},54276(e,t,a){var o=a(62826),i=a(76482),r=a(91382),n=a(96245),l=a(5124),s=a(22441);class d extends r.n{attach(e){super.attach(e),this.attachableTouchController.attach(e)}disconnectedCallback(){super.disconnectedCallback(),this.hovered=!1,this.pressed=!1}detach(){super.detach(),this.attachableTouchController.detach()}_onTouchControlChange(e,t){e?.removeEventListener("touchend",this._handleTouchEnd),t?.addEventListener("touchend",this._handleTouchEnd)}constructor(...e){super(...e),this.attachableTouchController=new i.i(this,this._onTouchControlChange.bind(this)),this._handleTouchEnd=()=>{this.disabled||super.endPressAnimation()}}}d.styles=[n.R,l.AH`:host{--md-ripple-hover-opacity:var(--ha-ripple-hover-opacity, 0.08);--md-ripple-pressed-opacity:var(--ha-ripple-pressed-opacity, 0.12);--md-ripple-hover-color:var(
--ha-ripple-hover-color,
var(--ha-ripple-color, var(--secondary-text-color))
);--md-ripple-pressed-color:var(
--ha-ripple-pressed-color,
var(--ha-ripple-color, var(--secondary-text-color))
)}`],d=(0,o.Cg)([(0,s.EM)("ha-ripple")],d)},31420(e,t,a){a.a(e,async function(e,o){try{a.d(t,{Bi:()=>I,Dt:()=>X,EB:()=>E,IW:()=>T,P_:()=>S,SG:()=>z,Sx:()=>V,T2:()=>v,Xm:()=>b,Ye:()=>_,Zm:()=>F,cq:()=>J,dH:()=>A,en:()=>G,gF:()=>w,gb:()=>y,gv:()=>M,jU:()=>B,kI:()=>D,mF:()=>L,mu:()=>$,oJ:()=>Z,pI:()=>x,pL:()=>N,q5:()=>H,q7:()=>j,qk:()=>f,sp:()=>U,uM:()=>Y,v3:()=>q,xN:()=>K,yL:()=>k,yj:()=>W,zZ:()=>C});a(74423),a(16573),a(78100),a(77936),a(18111),a(22489),a(20116),a(7588),a(61701),a(37467),a(44732),a(79577),a(16632),a(34226),a(9486),a(20456),a(14603),a(47566),a(98721);var i=a(22711),r=a(97732),n=a(6226),l=a(22786),s=a(80785),d=a(95747),c=a(30162),h=a(36918),u=a(30039),p=a(39889),m=a(95350),g=e([i,d,c]);[i,d,c]=g.then?(await g)():g;var f=function(e){return e.NEVER="never",e.DAILY="daily",e.CUSTOM_DAYS="custom_days",e}({});const v=["mon","tue","wed","thu","fri","sat","sun"],_=e=>e.sort((e,t)=>v.indexOf(e)-v.indexOf(t)),b=e=>e.callWS({type:"backup/config/info"}),y=(e,t)=>e.callWS({type:"backup/config/update",...t}),w=(e,t)=>y(e,{create_backup:{agent_ids:t.create_backup.agent_ids,include_folders:t.create_backup.include_folders??[],include_database:t.create_backup.include_database,include_addons:t.create_backup.include_addons??[],include_all_addons:t.create_backup.include_all_addons,password:t.create_backup.password},retention:t.retention,schedule:t.schedule}),k=(e,t,a)=>`/api/backup/download/${e}?agent_id=${t}${a?`&password=${a}`:""}`,x=e=>e.callWS({type:"backup/info"}),C=(e,t)=>e.callWS({type:"backup/details",backup_id:t}),S=e=>e.callWS({type:"backup/agents/info"}),$=(e,t)=>e.callWS({type:"backup/delete",backup_id:t}),z=(e,t)=>e.callWS({type:"backup/generate",...t}),T=e=>e.callWS({type:"backup/generate_with_automatic_settings"}),A=(e,t)=>e.callWS({type:"backup/restore",...t}),D=async(e,t,a)=>{const o=new FormData;o.append("file",t);const i=new URLSearchParams;return a.forEach(e=>{i.append("agent_id",e)}),(0,p.QE)(e.fetchWithAuth(`/api/backup/upload?${i.toString()}`,{method:"POST",body:o}))},E=e=>{const t=e.find(I);if(t)return t;const a=e.find(B);return a||e[0]},F=(e,t,a,o)=>e.callWS({type:"backup/can_decrypt_on_download",backup_id:t,agent_id:a,password:o}),M="backup.local",L="hassio.local",Z="cloud.cloud",I=e=>[M,L].includes(e),B=e=>{const[t,a]=e.split(".");return"hassio"===t&&"local"!==a},j=(e,t,a)=>{if(I(t))return e("ui.panel.config.backup.agents.local_agent");const o=a.find(e=>e.agent_id===t),i=t.split(".")[0],r=o?o.name:t.split(".")[1];if(B(t))return r;const n=(0,m.p$)(e,i);return a.filter(e=>e.agent_id.split(".")[0]===i).length>1?`${n}: ${r}`:n},q=e=>Math.max(...Object.values(e.agents).map(e=>e.size)),P=["automatic","app_update","manual"],H=(0,i.z)(e=>e?P:P.filter(e=>"app_update"!==e)),U=(e,t)=>e.with_automatic_settings?"automatic":!t||null==e.extra_metadata?.["supervisor.addon_update"]&&null==e.extra_metadata?.["supervisor.app_update"]?"manual":"app_update",W=(e,t)=>{const a=I(e),o=I(t),i=B(e),r=B(t),n=(e,t)=>e?1:t?2:3,l=n(a,i),s=n(o,r);return l!==s?l-s:e.localeCompare(t)},J=()=>{const e="ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",t="xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx";let a="";const o=new Uint8Array(34);return crypto.getRandomValues(o),o.forEach((o,i)=>{a+="-"===t[i]?"-":e[o%36]}),a},R=(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,d.r6)(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:(0,h.o)(e,"/more-info/backup-emergency-kit")})}`),O=(e,t)=>`home_assistant_backup_emergency_kit_${t?`${t}_`:""}${(0,d.GH)(new Date,e.locale,e.config).replace(",","").replace(" ","_")}.txt`,V=(e,t,a)=>(0,u.R)(R(e,t),O(e,a)),Y=(0,r.g)((0,n.a)(new Date,4),45),N=(0,r.g)((0,n.a)(new Date,5),45),G=(0,l.A)((e,t,a)=>{if((0,s.A)(a))return(0,c.fU)(a,e,t);if("string"==typeof a&&a){const o=a.split(":"),i=(0,r.g)((0,n.a)(new Date,parseInt(o[0])),parseInt(o[1]));return(0,c.fU)(i,e,t)}return`${(0,c.fU)(Y,e,t)} - ${(0,c.fU)(N,e,t)}`}),K="application/x-tar",X={file:void 0};o()}catch(e){o(e)}})},16869(e,t,a){a.d(t,{B:()=>i,g:()=>o});a(74423);const o=window.externalAppV2||window.externalApp||window.webkit?.messageHandlers?.getExternalAuth||location.search.includes("external_auth=1"),i=window.externalApp||window.externalAppV2},26581(e,t,a){a.d(t,{r:()=>i,y:()=>o});const o=async e=>e.callWS({type:"hassio/update/config/info"}),i=async(e,t)=>e.callWS({type:"hassio/update/config/update",...t})},59992(e,t,a){a.d(t,{V:()=>s});var o=a(62826),i=a(88696),r=a(5124),n=a(6412),l=a(22441);const s=e=>{class t extends e{get scrollableElement(){return t.DEFAULT_SCROLLABLE_ELEMENT}firstUpdated(e){super.firstUpdated?.(e),this.scrollableElement&&this._updateScrollableState(this.scrollableElement),this._attachScrollableElement()}updated(e){super.updated?.(e),this._attachScrollableElement()}disconnectedCallback(){this._detachScrollableElement(),this._contentScrolled=!1,this._contentScrollable=!1,super.disconnectedCallback()}renderScrollableFades(e=!1){return r.qy` <div class="${(0,n.H)({"fade-top":!0,rounded:e,visible:this._contentScrolled})}"></div> <div class="${(0,n.H)({"fade-bottom":!0,rounded:e,visible:this._contentScrollable})}"></div> `}static get styles(){const e=Object.getPrototypeOf(this);var t;return[...void 0===(t=e?.styles??[])?[]:Array.isArray(t)?t:[t],r.AH`.fade-bottom,.fade-top{position:absolute;left:0;right:0;height:var(--ha-space-2);pointer-events:none;transition:opacity 180ms ease-in-out;border-radius:var(--ha-border-radius-square);opacity:0;background:linear-gradient(to bottom,var(--ha-color-shadow-scrollable-fade),transparent)}.fade-top{top:0}.fade-bottom{bottom:0;transform:rotate(180deg)}.fade-bottom.visible,.fade-top.visible{opacity:1}.fade-bottom.rounded,.fade-top.rounded{border-radius:var(--ha-card-border-radius,var(--ha-border-radius-lg));border-bottom-left-radius:var(--ha-border-radius-square);border-bottom-right-radius:var(--ha-border-radius-square)}.fade-top.rounded{border-top-left-radius:var(--ha-border-radius-square);border-top-right-radius:var(--ha-border-radius-square)}.fade-bottom.rounded{border-bottom-left-radius:var(--ha-border-radius-square);border-bottom-right-radius:var(--ha-border-radius-square)}`]}_attachScrollableElement(){const e=this.scrollableElement;e!==this._scrollTarget&&(this._detachScrollableElement(),e&&(this._scrollTarget=e,e.addEventListener("scroll",this._onScroll,{passive:!0}),this._resize.observe(e),this._updateScrollableState(e)))}_detachScrollableElement(){this._scrollTarget&&(this._scrollTarget.removeEventListener("scroll",this._onScroll),this._resize.unobserve?.(this._scrollTarget),this._scrollTarget=void 0)}_updateScrollableState(e){const t=parseFloat(getComputedStyle(e).getPropertyValue("--safe-area-inset-bottom"))||0,{scrollHeight:a=0,clientHeight:o=0,scrollTop:i=0}=e;this._contentScrollable=a-o>i+t+this.scrollFadeSafeAreaPadding}constructor(...e){super(...e),this._contentScrolled=!1,this._contentScrollable=!1,this._onScroll=e=>{const t=e.currentTarget;this._contentScrolled=(t.scrollTop??0)>this.scrollFadeThreshold,this._updateScrollableState(t)},this._resize=new i.P(this,{target:null,callback:e=>{const t=e[0]?.target;t&&this._updateScrollableState(t)}}),this.scrollFadeSafeAreaPadding=4,this.scrollFadeThreshold=4}}return t.DEFAULT_SCROLLABLE_ELEMENT=null,(0,o.Cg)([(0,l.wk)()],t.prototype,"_contentScrolled",void 0),(0,o.Cg)([(0,l.wk)()],t.prototype,"_contentScrollable",void 0),t}},56588(e,t,a){a.a(e,async function(e,o){try{a.r(t),a.d(t,{DialogLabsPreviewFeatureEnable:()=>f});var i=a(62826),r=a(5124),n=a(22441),l=a(36312),s=a(98975),d=a(1087),c=a(18350),h=(a(93444),a(72554)),u=(a(17308),a(2846),a(59646)),p=a(31420),m=a(26581),g=e([c,h,u,p,s]);[c,h,u,p,s]=g.then?(await g)():g;class f extends r.WF{async showDialog(e){this._params=e,this._createBackup=!1,this._open=!0,this._fetchBackupConfig(),(0,l.x)(this.hass.config,"hassio")&&this._fetchUpdateBackupConfig()}closeDialog(){return this._open=!1,!0}_dialogClosed(){this._params=void 0,this._backupConfig=void 0,this._createBackup=!1,(0,d.r)(this,"dialog-closed",{dialog:this.localName})}async _fetchBackupConfig(){try{const{config:e}=await(0,p.Xm)(this.hass);this._backupConfig=e}catch(e){console.error(e)}}async _fetchUpdateBackupConfig(){try{const e=await(0,m.y)(this.hass);this._createBackup=e.core_backup_before_update}catch(e){console.error(e)}}_computeCreateBackupTexts(){if(!this._backupConfig||!this._backupConfig.automatic_backups_configured||!this._backupConfig.create_backup.password||0===this._backupConfig.create_backup.agent_ids.length)return{title:this.hass.localize("ui.panel.config.labs.create_backup.manual"),description:this.hass.localize("ui.panel.config.labs.create_backup.manual_description")};const e=this._backupConfig.last_completed_automatic_backup?new Date(this._backupConfig.last_completed_automatic_backup):null,t=new Date;return{title:this.hass.localize("ui.panel.config.labs.create_backup.automatic"),description:e?this.hass.localize("ui.panel.config.labs.create_backup.automatic_description_last",{relative_time:(0,s.K)(e,this.hass.locale,t,!0)}):this.hass.localize("ui.panel.config.labs.create_backup.automatic_description_none")}}_createBackupChanged(e){this._createBackup=e.target.checked}_handleCancel(){this.closeDialog()}_handleConfirm(){this._params&&this._params.onConfirm(this._createBackup),this.closeDialog()}render(){if(!this._params)return r.s6;const e=this._computeCreateBackupTexts();return r.qy` <ha-dialog .open="${this._open}" header-title="${this.hass.localize("ui.panel.config.labs.enable_title")}" @closed="${this._dialogClosed}"> <p> ${this.hass.localize(`component.${this._params.preview_feature.domain}.preview_features.${this._params.preview_feature.preview_feature}.enable_confirmation`)||this.hass.localize("ui.panel.config.labs.enable_confirmation")} </p> ${e?r.qy` <ha-md-list> <ha-md-list-item> <span slot="headline">${e.title}</span> ${e.description?r.qy` <span slot="supporting-text"> ${e.description} </span> `:r.s6} <ha-switch slot="end" .checked="${this._createBackup}" @change="${this._createBackupChanged}"></ha-switch> </ha-md-list-item> </ha-md-list> `:r.s6} <ha-dialog-footer slot="footer"> <ha-button slot="secondaryAction" appearance="plain" @click="${this._handleCancel}"> ${this.hass.localize("ui.common.cancel")} </ha-button> <ha-button slot="primaryAction" appearance="filled" variant="brand" @click="${this._handleConfirm}"> ${this.hass.localize("ui.panel.config.labs.enable")} </ha-button> </ha-dialog-footer> </ha-dialog> `}constructor(...e){super(...e),this._createBackup=!1,this._open=!1}}f.styles=r.AH`ha-dialog{--dialog-content-padding:0}p{margin:0 var(--ha-space-6) var(--ha-space-6);color:var(--secondary-text-color)}ha-md-list{background:0 0;--md-list-item-leading-space:var(--ha-space-6);--md-list-item-trailing-space:var(--ha-space-6);margin:0;padding:0;border-top:var(--ha-border-width-sm) solid var(--divider-color)}`,(0,i.Cg)([(0,n.MZ)({attribute:!1})],f.prototype,"hass",void 0),(0,i.Cg)([(0,n.wk)()],f.prototype,"_params",void 0),(0,i.Cg)([(0,n.wk)()],f.prototype,"_backupConfig",void 0),(0,i.Cg)([(0,n.wk)()],f.prototype,"_createBackup",void 0),(0,i.Cg)([(0,n.wk)()],f.prototype,"_open",void 0),f=(0,i.Cg)([(0,n.EM)("dialog-labs-preview-feature-enable")],f),o()}catch(e){o(e)}})},30039(e,t,a){a.d(t,{R:()=>i});a(14603),a(47566),a(98721);var o=a(16869);const i=(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),e.startsWith("blob:")&&(o.B?setTimeout(()=>URL.revokeObjectURL(e),1e4):URL.revokeObjectURL(e))}},22348(e,t,a){a.d(t,{V:()=>i});var o=a(37177);const i=e=>!!e&&o.n},37177(e,t,a){a.d(t,{n:()=>o});const o=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}};