iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
11 lines • 27.4 kB
JavaScript
/*! For license information please see 98672.f4e3e3ead88a948c.js.LICENSE.txt */
"use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[98672],{48078:function(t,e,a){a(72712),a(18111),a(18237),a(62953);var i=a(40445),n=a(5124),r=a(67576),o=a(6412);let s,c,l=t=>t;class d extends n.WF{render(){return(0,n.qy)(s||(s=l` <div class="container ${0}" style="${0}" ="${0}"> <slot -resize="${0}"></slot> </div> `),(0,o.H)({faded:!this._contentShown}),this._contentShown?"":`max-height: ${this.fadedHeight}px`,this._showContent,this._setShowContent)}get _slottedHeight(){var t;return(null===(t=this.shadowRoot.querySelector(".container"))||void 0===t?void 0:t.firstElementChild).assignedElements().reduce((t,e)=>t+e.offsetHeight,0)||0}_setShowContent(){const t=this._slottedHeight;this._contentShown=0!==t&&t<=this.fadedHeight+50}firstUpdated(t){super.firstUpdated(t),this._setShowContent()}_showContent(){this._contentShown=!0}constructor(...t){super(...t),this.fadedHeight=102,this._contentShown=!1}}d.styles=(0,n.AH)(c||(c=l`.container{display:block;height:auto;cursor:default}.faded{cursor:pointer;-webkit-mask-image:linear-gradient(to bottom,black 25%,transparent 100%);mask-image:linear-gradient(to bottom,black 25%,transparent 100%);overflow-y:hidden}`)),(0,i.Cg)([(0,r.MZ)({type:Number,attribute:"faded-height"})],d.prototype,"fadedHeight",void 0),(0,i.Cg)([(0,r.wk)()],d.prototype,"_contentShown",void 0),d=(0,i.Cg)([(0,r.EM)("ha-faded")],d)},83892:function(t,e,a){a.d(e,{x:function(){return _}});a(18111),a(13579),a(27495),a(42762),a(62953);var i=a(40445),n=a(92070),r=a(5124),o=a(67576);let s,c,l,d,u,h,p,f=t=>t;class _ extends r.WF{_onSlotChange(t){return e=>{const a=e.target.assignedNodes({flatten:!0}).some(t=>{var e;return t.nodeType===Node.ELEMENT_NODE||t.nodeType===Node.TEXT_NODE&&""!==(null===(e=t.textContent)||void 0===e?void 0:e.trim())});"start"===t?this._hasStart=a:this._hasEnd=a}}render(){return this._renderBase(this._renderInner())}_renderBase(t){return(0,r.qy)(s||(s=f`<div part="base" class="base" id="item">${0}</div>`),t)}_renderInner(){const t=this._slotController.test("content");return(0,r.qy)(c||(c=f` <div part="start" class="start" ?hidden="${0}"> <slot name="start" ="${0}"></slot> </div> <div part="content" class="content"> ${0} </div> <div part="end" class="end" ?hidden="${0}"> <slot name="end" ="${0}"></slot> </div> `),!this._hasStart,this._onSlotChange("start"),t?(0,r.qy)(l||(l=f`<slot name="content"></slot>`)):this._renderDefaultContent(),!this._hasEnd,this._onSlotChange("end"))}_renderDefaultContent(){var t,e;const a=this._slotController.test("headline"),i=this._slotController.test("supporting-text"),n=a||void 0!==this.headline,o=i||void 0!==this.supportingText;return(0,r.qy)(d||(d=f` ${0} ${0} `),n?(0,r.qy)(u||(u=f`<div part="headline" class="headline"> <slot name="headline">${0}</slot> </div>`),null!==(t=this.headline)&&void 0!==t?t:r.s6):r.s6,o?(0,r.qy)(h||(h=f`<div part="supporting-text" class="supporting"> <slot name="supporting-text">${0}</slot> </div>`),null!==(e=this.supportingText)&&void 0!==e?e:r.s6):r.s6)}constructor(...t){super(...t),this.disabled=!1,this._slotController=new n.X(this,"headline","supporting-text","content"),this._hasStart=!1,this._hasEnd=!1}}_.styles=(0,r.AH)(p||(p=f`:host{display:block;color:var(--primary-text-color);font-size:var(--ha-font-size-m);line-height:var(--ha-line-height-normal)}:host([disabled]){color:var(--disabled-text-color);pointer-events:none}.base{position:relative;display:flex;flex-direction:row;align-items:center;gap:var(--ha-row-item-gap,var(--ha-space-4));padding-block:var(--ha-row-item-padding-block,var(--ha-space-3));padding-inline:var(--ha-row-item-padding-inline,var(--ha-space-4));min-height:var(--ha-row-item-min-height,48px);box-sizing:border-box}.content{flex:1 1 auto;min-width:0;display:flex;flex-direction:column;justify-content:center}.end,.start{display:flex;align-items:center;flex:0 0 auto}.end[hidden],.start[hidden]{display:none}.headline{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.supporting{color:var(--secondary-text-color);font-size:var(--ha-font-size-s);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}`)),(0,i.Cg)([(0,o.MZ)({type:String})],_.prototype,"headline",void 0),(0,i.Cg)([(0,o.MZ)({type:String,attribute:"supporting-text"})],_.prototype,"supportingText",void 0),(0,i.Cg)([(0,o.MZ)({type:Boolean,reflect:!0})],_.prototype,"disabled",void 0),(0,i.Cg)([(0,o.wk)()],_.prototype,"_hasStart",void 0),(0,i.Cg)([(0,o.wk)()],_.prototype,"_hasEnd",void 0),_=(0,i.Cg)([(0,o.EM)("ha-row-item")],_)},94355:function(t,e,a){a.a(t,async function(t,e){try{a(62953);var i=a(40445),n=a(88590),r=a(5124),o=a(67576),s=t([n]);n=(s.then?(await s)():s)[0];let c,l=t=>t;class d extends n.A{static get styles(){return[n.A.styles,(0,r.AH)(c||(c=l`:host{--indicator-color:var(
--ha-progress-bar-indicator-color,
var(--ha-color-on-primary-normal)
);--track-color:var(
--ha-progress-bar-track-color,
var(--ha-color-fill-neutral-normal-hover)
);--track-height:var(--ha-progress-bar-track-height, 12px);--wa-transition-slow:var(--ha-animation-duration-slow);position:relative}.progress-bar{border-radius:var(--ha-progress-bar-border-radius,var(--ha-border-radius-pill))}.indicator{background:var(--ha-progress-bar-indicator-background,var(--indicator-color))}:host([indeterminate]) .indicator{animation:wa-progress-indeterminate var(--ha-progress-bar-animation-duration,2.5s) infinite cubic-bezier(.37,0,.63,1)} slide-highlight{0%{transform:translateX(-200%)}100%{transform:translateX(200%)}}:host([loading]:not([indeterminate])) .progress-bar::after{content:"";position:absolute;inset:0;background:linear-gradient(90deg,transparent 0%,oklch(from var(--indicator-color) 85% c h) 50%,transparent 100%);opacity:.5;animation:slide-highlight var(--ha-progress-bar-animation-duration,2.5s) infinite cubic-bezier(.37,0,.63,1);width:50%}:host::after{--width:var(
--ha-progress-bar-indicator-highlight-width,
calc(var(--track-height) * 2)
);width:var(--width);height:var(--ha-progress-bar-indicator-highlight-height,calc(var(--track-height) * 2));content:"";position:absolute;inset-inline-start:clamp(var(--width)/ 2,var(--percentage,0%),calc(100% - var(--width)/ 2));top:50%;transform:translate(-50%,-50%);background-image:var(--ha-progress-bar-indicator-highlight-image);background-size:contain;background-repeat:no-repeat;background-position:center;pointer-events:none;transition:inset-inline-start var(--wa-transition-slow, 200ms) var(--wa-transition-easing, ease)}:host([indeterminate])::after{display:none}`))]}constructor(...t){super(...t),this.loading=!1}}(0,i.Cg)([(0,o.MZ)({type:Boolean,reflect:!0})],d.prototype,"loading",void 0),d=(0,i.Cg)([(0,o.EM)("ha-progress-bar")],d),e()}catch(c){e(c)}})},31420:function(t,e,a){a.a(t,async function(t,i){try{a.d(e,{Bi:function(){return L},Dt:function(){return G},EB:function(){return A},IW:function(){return S},P_:function(){return O},SG:function(){return j},Sx:function(){return F},T2:function(){return b},Xm:function(){return m},Ye:function(){return v},Zm:function(){return T},cq:function(){return P},dH:function(){return z},en:function(){return V},gF:function(){return k},gb:function(){return y},gv:function(){return q},jU:function(){return N},kI:function(){return E},mF:function(){return B},mu:function(){return C},oJ:function(){return U},pI:function(){return x},pL:function(){return K},q5:function(){return I},q7:function(){return H},qk:function(){return g},sp:function(){return W},uM:function(){return J},v3:function(){return M},xN:function(){return X},yL:function(){return w},yj:function(){return D},zZ:function(){return $}});a(74423),a(26910),a(54743),a(11745),a(16573),a(78100),a(77936),a(18111),a(22489),a(20116),a(7588),a(61701),a(3362),a(27495),a(25440),a(21489),a(48140),a(75044),a(21903),a(91134),a(28845),a(373),a(37467),a(44732),a(79577),a(16632),a(34226),a(9486),a(20456),a(62953),a(48408),a(14603),a(47566),a(98721);var n=a(22711),r=a(97732),o=a(6226),s=a(22786),c=a(80785),l=a(95747),d=a(30162);if(66649!=a.j)var u=a(36918);var h=a(30039),p=a(39889),f=a(95350),_=t([n,l,d]);[n,l,d]=_.then?(await _)():_;var g=66649!=a.j?function(t){return t.NEVER="never",t.DAILY="daily",t.CUSTOM_DAYS="custom_days",t}({}):null;const b=66649!=a.j?["mon","tue","wed","thu","fri","sat","sun"]:null,v=t=>t.sort((t,e)=>b.indexOf(t)-b.indexOf(e)),m=t=>t.callWS({type:"backup/config/info"}),y=(t,e)=>t.callWS(Object.assign({type:"backup/config/update"},e)),k=(t,e)=>{var a,i;return y(t,{create_backup:{agent_ids:e.create_backup.agent_ids,include_folders:null!==(a=e.create_backup.include_folders)&&void 0!==a?a:[],include_database:e.create_backup.include_database,include_addons:null!==(i=e.create_backup.include_addons)&&void 0!==i?i:[],include_all_addons:e.create_backup.include_all_addons,password:e.create_backup.password},retention:e.retention,schedule:e.schedule})},w=(t,e,a)=>`/api/backup/download/${t}?agent_id=${e}${a?`&password=${a}`:""}`,x=t=>t.callWS({type:"backup/info"}),$=(t,e)=>t.callWS({type:"backup/details",backup_id:e}),O=t=>t.callWS({type:"backup/agents/info"}),C=(t,e)=>t.callWS({type:"backup/delete",backup_id:e}),j=(t,e)=>t.callWS(Object.assign({type:"backup/generate"},e)),S=t=>t.callWS({type:"backup/generate_with_automatic_settings"}),z=(t,e)=>t.callWS(Object.assign({type:"backup/restore"},e)),E=async(t,e,a)=>{const i=new FormData;i.append("file",e);const n=new URLSearchParams;return a.forEach(t=>{n.append("agent_id",t)}),(0,p.QE)(t.fetchWithAuth(`/api/backup/upload?${n.toString()}`,{method:"POST",body:i}))},A=t=>{const e=t.find(L);if(e)return e;const a=t.find(N);return a||t[0]},T=(t,e,a,i)=>t.callWS({type:"backup/can_decrypt_on_download",backup_id:e,agent_id:a,password:i}),q="backup.local",B="hassio.local",U="cloud.cloud",L=t=>[q,B].includes(t),N=t=>{const[e,a]=t.split(".");return"hassio"===e&&"local"!==a},H=(t,e,a)=>{if(L(e))return t("ui.panel.config.backup.agents.local_agent");const i=a.find(t=>t.agent_id===e),n=e.split(".")[0],r=i?i.name:e.split(".")[1];if(N(e))return r;const o=(0,f.p$)(t,n);return a.filter(t=>t.agent_id.split(".")[0]===n).length>1?`${o}: ${r}`:o},M=t=>Math.max(...Object.values(t.agents).map(t=>t.size)),R=["automatic","app_update","manual"],I=(0,n.z)(t=>t?R:R.filter(t=>"app_update"!==t)),W=(t,e)=>{var a,i;return t.with_automatic_settings?"automatic":!e||null==(null===(a=t.extra_metadata)||void 0===a?void 0:a["supervisor.addon_update"])&&null==(null===(i=t.extra_metadata)||void 0===i?void 0:i["supervisor.app_update"])?"manual":"app_update"},D=(t,e)=>{const a=L(t),i=L(e),n=N(t),r=N(e),o=(t,e)=>t?1:e?2:3,s=o(a,n),c=o(i,r);return s!==c?s-c:t.localeCompare(e)},P=()=>{const t="ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",e="xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx";let a="";const i=new Uint8Array(34);return crypto.getRandomValues(i),i.forEach((i,n)=>{a+="-"===e[n]?"-":t[i%36]}),a},Z=(t,e)=>"data:text/plain;charset=utf-8,"+encodeURIComponent(`${t.localize("ui.panel.config.backup.emergency_kit_file.title")}\n\n${t.localize("ui.panel.config.backup.emergency_kit_file.description")}\n\n${t.localize("ui.panel.config.backup.emergency_kit_file.date")} ${(0,l.r6)(new Date,t.locale,t.config)}\n\n${t.localize("ui.panel.config.backup.emergency_kit_file.instance")}\n${t.config.location_name}\n\n${t.localize("ui.panel.config.backup.emergency_kit_file.url")}\n${t.auth.data.hassUrl}\n\n${t.localize("ui.panel.config.backup.emergency_kit_file.encryption_key")}\n${e}\n\n${t.localize("ui.panel.config.backup.emergency_kit_file.more_info",{link:(0,u.o)(t,"/more-info/backup-emergency-kit")})}`),Y=(t,e)=>`home_assistant_backup_emergency_kit_${e?`${e}_`:""}${(0,l.GH)(new Date,t.locale,t.config).replace(",","").replace(" ","_")}.txt`,F=(t,e,a)=>(0,h.R)(Z(t,e),Y(t,a)),J=(0,r.g)((0,o.a)(new Date,4),45),K=(0,r.g)((0,o.a)(new Date,5),45),V=(0,s.A)((t,e,a)=>{if((0,c.A)(a))return(0,d.fU)(a,t,e);if("string"==typeof a&&a){const i=a.split(":"),n=(0,r.g)((0,o.a)(new Date,parseInt(i[0])),parseInt(i[1]));return(0,d.fU)(n,t,e)}return`${(0,d.fU)(J,t,e)} - ${(0,d.fU)(K,t,e)}`}),X="application/x-tar",G=66649!=a.j?{file:void 0}:null;i()}catch(b){i(b)}})},6810:function(t,e,a){a.d(e,{c:function(){return r}});a(3362),a(62953);const i=async(t,e,a,n,r,...o)=>{const s=r,c=s[t],l=c=>n&&n(r,c.result)!==c.cacheKey?(s[t]=void 0,i(t,e,a,n,r,...o)):c.result;if(c)return c instanceof Promise?c.then(l):l(c);const d=a(r,...o);return s[t]=d,d.then(a=>{s[t]={result:a,cacheKey:null==n?void 0:n(r,a)},setTimeout(()=>{s[t]=void 0},e)},()=>{s[t]=void 0}),d},n=t=>t.callWS({type:"entity/source"}),r=t=>i("_entitySources",3e4,n,t=>Object.keys(t.states).length,t)},16869:function(t,e,a){a.d(e,{B:function(){return r},g:function(){return n}});var i;a(74423),a(27495);const n=window.externalAppV2||window.externalApp||(null===(i=window.webkit)||void 0===i||null===(i=i.messageHandlers)||void 0===i?void 0:i.getExternalAuth)||location.search.includes("external_auth=1"),r=window.externalApp||window.externalAppV2},26581:function(t,e,a){a.d(e,{r:function(){return n},y:function(){return i}});a(3362);const i=async t=>t.callWS({type:"hassio/update/config/info"}),n=async(t,e)=>t.callWS(Object.assign({type:"hassio/update/config/update"},e))},1843:function(t,e,a){a.a(t,async function(t,i){try{a.r(e);a(89463),a(74423),a(3362),a(62953);var n=a(40445),r=a(5124),o=a(67576),s=a(36312),c=(a(46190),a(98975)),l=a(82286),d=a(89300),u=a(38962),h=a(18350),p=(a(48078),a(3587),a(65829)),f=a(59646),_=(a(83892),a(94355)),g=a(31420),b=a(22675),v=a(6810),m=a(26581),y=a(24247),k=a(65063),w=t([d,u,h,p,f,_,g,c,y]);[d,u,h,p,f,_,g,c,y]=w.then?(await w)():w;let x,$,O,C,j,S,z,E,A,T,q,B,U,L,N,H=t=>t;class M extends r.WF{async _fetchBackupConfig(){try{const{config:t}=await(0,g.Xm)(this.hass);this._backupConfig=t}catch(t){console.error(t)}}async _fetchUpdateBackupConfig(t){try{const e=await(0,m.y)(this.hass);if(this._isHaOrOsUpdate(t))return void(this._createBackup=e.core_backup_before_update);"addon"===t&&(this._createBackup=e.add_on_backup_before_update)}catch(e){console.error(e)}}async _fetchEntitySources(){this._entitySources=await(0,v.c)(this.hass)}_isHaOrOsUpdate(t){return["home_assistant","home_assistant_os"].includes(t)}_computeCreateBackupTexts(){if(!this.stateObj||!(0,l.$)(this.stateObj,y.TY.BACKUP))return;const t=this._entitySources?(0,y.mj)(this.stateObj,this._entitySources):"generic";if(this._isHaOrOsUpdate(t)){var e,a;if(!(!!this._backupConfig&&!!this._backupConfig.automatic_backups_configured&&!!this._backupConfig.create_backup.password&&this._backupConfig.create_backup.agent_ids.length>0))return{title:this.hass.localize("ui.dialogs.more_info_control.update.create_backup.manual"),description:this.hass.localize("ui.dialogs.more_info_control.update.create_backup.manual_description")};const t=null!==(e=this._backupConfig)&&void 0!==e&&e.last_completed_automatic_backup?new Date(null===(a=this._backupConfig)||void 0===a?void 0:a.last_completed_automatic_backup):null,i=new Date;return{title:this.hass.localize("ui.dialogs.more_info_control.update.create_backup.automatic"),description:t?this.hass.localize("ui.dialogs.more_info_control.update.create_backup.automatic_description_last",{relative_time:(0,c.K)(t,this.hass.locale,i,!0)}):this.hass.localize("ui.dialogs.more_info_control.update.create_backup.automatic_description_none")}}if("addon"===t){const t=this.stateObj.attributes.installed_version;return{title:this.hass.localize("ui.dialogs.more_info_control.update.create_backup.app"),description:t?this.hass.localize("ui.dialogs.more_info_control.update.create_backup.app_description",{version:t}):void 0}}return{title:this.hass.localize("ui.dialogs.more_info_control.update.create_backup.generic")}}render(){var t,e;if(!this.hass||!this.stateObj||this.stateObj.state===b.Hh||this.stateObj.state===b.HV)return r.s6;const a=this._computeCreateBackupTexts();return(0,r.qy)(x||(x=H` <div class="content"> <div class="summary"> ${0} <h3>${0}</h3> ${0} <div class="row"> <div class="key"> ${0} </div> <div class="value"> ${0} </div> </div> <div class="row"> <div class="key"> ${0} </div> <div class="value"> ${0} </div> </div> ${0} </div> ${0} </div> <div class="footer"> ${0} <div class="actions"> ${0} ${0} </div> </div> `),this.stateObj.attributes.in_progress?(0,l.$)(this.stateObj,y.TY.PROGRESS)&&null!==this.stateObj.attributes.update_percentage?(0,r.qy)($||($=H`<ha-progress-bar loading .value="${0}"></ha-progress-bar>`),this.stateObj.attributes.update_percentage):(0,r.qy)(O||(O=H`<ha-progress-bar indeterminate></ha-progress-bar>`)):r.s6,this.stateObj.attributes.title,this._error?(0,r.qy)(C||(C=H`<ha-alert alert-type="error">${0}</ha-alert>`),this._error):r.s6,this.hass.formatEntityAttributeName(this.stateObj,"installed_version"),null!==(t=this.stateObj.attributes.installed_version)&&void 0!==t?t:this.hass.localize("state.default.unavailable"),this.hass.formatEntityAttributeName(this.stateObj,"latest_version"),null!==(e=this.stateObj.attributes.latest_version)&&void 0!==e?e:this.hass.localize("state.default.unavailable"),this.stateObj.attributes.release_url?(0,r.qy)(j||(j=H`<div class="row"> <div class="key"> <a href="${0}" target="_blank" rel="noreferrer"> ${0} </a> </div> </div>`),this.stateObj.attributes.release_url,this.hass.localize("ui.dialogs.more_info_control.update.release_announcement")):r.s6,(0,l.$)(this.stateObj,y.TY.RELEASE_NOTES)&&!this._error?void 0===this._releaseNotes?(0,r.qy)(S||(S=H` <hr> ${0} `),this._markdownLoading?this._renderLoader():r.s6):this._releaseNotes?(0,r.qy)(z||(z=H` <hr> <ha-markdown -resize="${0}" .content="${0}" class="${0}"></ha-markdown> ${0} `),this._markdownLoaded,this._releaseNotes,this._markdownLoading?"hidden":"",this._markdownLoading?this._renderLoader():r.s6):r.s6:this.stateObj.attributes.release_summary?(0,r.qy)(E||(E=H` <hr> <ha-markdown -resize="${0}" .content="${0}" class="${0}"></ha-markdown> ${0} `),this._markdownLoaded,this.stateObj.attributes.release_summary,this._markdownLoading?"hidden":"",this._markdownLoading?this._renderLoader():r.s6):r.s6,a?(0,r.qy)(A||(A=H` <ha-row-item> <span slot="headline">${0}</span> ${0} <ha-switch slot="end" .checked="${0}" ="${0}" .disabled="${0}"></ha-switch> </ha-row-item> `),a.title,a.description?(0,r.qy)(T||(T=H` <span slot="supporting-text"> ${0} </span> `),a.description):r.s6,this._createBackup,this._createBackupChanged,(0,y.Jy)(this.stateObj)):r.s6,"off"===this.stateObj.state&&this.stateObj.attributes.skipped_version?(0,r.qy)(q||(q=H` <ha-button appearance="plain" ="${0}"> ${0} </ha-button> `),this._handleClearSkipped,this.hass.localize("ui.dialogs.more_info_control.update.clear_skipped")):(0,r.qy)(B||(B=H` <ha-button appearance="plain" ="${0}" .disabled="${0}"> ${0} </ha-button> `),this._handleSkip,(0,y.IC)(this.stateObj)||"off"===this.stateObj.state||(0,y.Jy)(this.stateObj),this.hass.localize("ui.dialogs.more_info_control.update.skip")),(0,l.$)(this.stateObj,y.TY.INSTALL)?(0,r.qy)(U||(U=H` <ha-button ="${0}" .loading="${0}" .disabled="${0}"> ${0} </ha-button> `),this._handleInstall,(0,y.Jy)(this.stateObj),(0,y.od)(this.stateObj),this.hass.localize("ui.dialogs.more_info_control.update.update")):r.s6)}_renderLoader(){return(0,r.qy)(L||(L=H` <div class="flex center loader"> <ha-spinner></ha-spinner> </div> `))}firstUpdated(){(0,l.$)(this.stateObj,y.TY.RELEASE_NOTES)&&this._fetchReleaseNotes(),(0,l.$)(this.stateObj,y.TY.BACKUP)&&this._fetchEntitySources().then(()=>{const t=(0,y.mj)(this.stateObj,this._entitySources);(0,s.x)(this.hass.config,"hassio")&&["addon","home_assistant","home_assistant_os"].includes(t)&&this._fetchUpdateBackupConfig(t),this._isHaOrOsUpdate(t)&&this._fetchBackupConfig()})}async _markdownLoaded(){this._markdownLoading&&(this._markdownLoading=!1)}async _fetchReleaseNotes(){try{this._releaseNotes=await(0,y.ev)(this.hass,this.stateObj.entity_id)}catch(t){this._error=t.message}}get _shouldCreateBackup(){return!!(0,l.$)(this.stateObj,y.TY.BACKUP)&&this._createBackup}_handleInstall(){const t={entity_id:this.stateObj.entity_id};this._shouldCreateBackup&&(t.backup=!0),(0,l.$)(this.stateObj,y.TY.SPECIFIC_VERSION)&&this.stateObj.attributes.latest_version&&(t.version=this.stateObj.attributes.latest_version),this.hass.callService("update","install",t)}_createBackupChanged(t){this._createBackup=t.target.checked}_handleSkip(){this.stateObj.attributes.auto_update?(0,k.showAlertDialog)(this,{title:this.hass.localize("ui.dialogs.more_info_control.update.auto_update_enabled_title"),text:this.hass.localize("ui.dialogs.more_info_control.update.auto_update_enabled_text")}):this.hass.callService("update","skip",{entity_id:this.stateObj.entity_id})}_handleClearSkipped(){this.hass.callService("update","clear_skipped",{entity_id:this.stateObj.entity_id})}constructor(...t){super(...t),this._markdownLoading=!0,this._createBackup=!1}}M.styles=(0,r.AH)(N||(N=H`:host{display:flex;flex-direction:column;flex:1;justify-content:space-between}hr{border-color:var(--divider-color);border-bottom:none;margin:var(--ha-space-4) 0}ha-expansion-panel{margin:var(--ha-space-4) 0}.summary{margin-bottom:var(--ha-space-4)}.row{margin:0;display:flex;flex-direction:row;justify-content:space-between}.footer{border-top:1px solid var(--divider-color);background:var(--ha-dialog-surface-background,var(--mdc-theme-surface,#fff));position:sticky;bottom:0;margin:0 calc(var(--ha-space-6) * -1) 0 calc(var(--ha-space-6) * -1);margin-bottom:calc(-1 * max(var(--safe-area-inset-bottom),var(--ha-space-6)));box-sizing:border-box;display:flex;flex-direction:column;align-items:center;overflow:hidden;z-index:10}ha-row-item{width:100%;--ha-row-item-padding-inline:var(--ha-space-6)}.actions{width:100%;display:flex;flex-direction:row;flex-wrap:wrap;justify-content:flex-end;box-sizing:border-box;padding:var(--ha-space-4);z-index:1;gap:var(--ha-space-2)}a{color:var(--primary-color)}.flex.center{display:flex;justify-content:center;align-items:center}ha-markdown{direction:ltr;padding-bottom:var(--ha-space-4);box-sizing:border-box}ha-markdown.hidden{display:none}.loader{height:80px;box-sizing:border-box;padding-bottom:var(--ha-space-4)}`)),(0,n.Cg)([(0,o.MZ)({attribute:!1})],M.prototype,"hass",void 0),(0,n.Cg)([(0,o.MZ)({attribute:!1})],M.prototype,"stateObj",void 0),(0,n.Cg)([(0,o.wk)()],M.prototype,"_releaseNotes",void 0),(0,n.Cg)([(0,o.wk)()],M.prototype,"_error",void 0),(0,n.Cg)([(0,o.wk)()],M.prototype,"_markdownLoading",void 0),(0,n.Cg)([(0,o.wk)()],M.prototype,"_backupConfig",void 0),(0,n.Cg)([(0,o.wk)()],M.prototype,"_createBackup",void 0),(0,n.Cg)([(0,o.wk)()],M.prototype,"_entitySources",void 0),M=(0,n.Cg)([(0,o.EM)("more-info-update")],M),i()}catch(x){i(x)}})},26528:function(t,e,a){a.d(e,{v:function(){return i}});a(3362);const i=async(t,e,a={})=>(t.expired&&await t.refreshAccessToken(),a.credentials="same-origin",a.headers||(a.headers={}),a.headers||(a.headers={}),a.headers.authorization=`Bearer ${t.accessToken}`,fetch(e,a))},30039:function(t,e,a){a.d(e,{R:function(){return n}});a(62953),a(3296),a(27208),a(48408),a(14603),a(47566),a(98721);var i=a(16869);const n=(t,e="")=>{const a=document.createElement("a");a.target="_blank",a.href=t,a.download=e,a.style.display="none",document.body.appendChild(a),a.dispatchEvent(new MouseEvent("click")),document.body.removeChild(a),t.startsWith("blob:")&&(i.B?setTimeout(()=>URL.revokeObjectURL(t),1e4):URL.revokeObjectURL(t))}},39889:function(t,e,a){a.d(e,{Ay:function(){return r},QE:function(){return n},qB:function(){return o}});a(74423),a(33110),a(3362);var i=a(26528);const n=async t=>{let e,a;try{e=await t}catch(n){throw{error:"Request error",status_code:void 0,body:void 0}}const i=e.headers.get("content-type");if(i&&i.includes("application/json"))try{a=await e.json()}catch(r){throw{error:"Unable to parse JSON response",status_code:r.status,body:null}}else a=await e.text();if(!e.ok)throw{error:`Response error: ${e.status}`,status_code:e.status,body:a};return a};async function r(t,e,a,r,o){const s=`${t.data.hassUrl}/api/${a}`,c={method:e,headers:o||{}};return r&&(c.headers["Content-Type"]="application/json;charset=UTF-8",c.body=JSON.stringify(r)),n((0,i.v)(t,s,c))}async function o(t,e,a,n,r,o){const s=`${t.data.hassUrl}/api/${a}`,c={method:e,headers:r||{},signal:o};return n&&(c.headers["Content-Type"]="application/json;charset=UTF-8",c.body=JSON.stringify(n)),(0,i.v)(t,s,c)}},88590:function(t,e,a){a.a(t,async function(t,i){try{a.d(e,{A:function(){return v}});a(62953);var n=a(5124),r=a(67576),o=a(63672),s=a(95010),c=a(717),l=a(17060),d=a(4168),u=t([l]);l=(u.then?(await u)():u)[0];let _,g,b=t=>t;var h=Object.defineProperty,p=Object.getOwnPropertyDescriptor,f=(t,e,a,i)=>{for(var n,r=i>1?void 0:i?p(e,a):e,o=t.length-1;o>=0;o--)(n=t[o])&&(r=(i?n(e,a,r):n(r))||r);return i&&r&&h(e,a,r),r};let v=class extends c.A{updated(t){t.has("value")&&requestAnimationFrame(()=>{this.style.setProperty("--percentage",`${(0,s.q)(this.value,0,100)}%`)})}render(){return(0,n.qy)(_||(_=b` <div part="base" class="progress-bar" role="progressbar" title="${0}" aria-label="${0}" aria-valuemin="0" aria-valuemax="100" aria-valuenow="${0}"> <div part="indicator" class="indicator"> ${0} </div> </div> `),(0,o.J)(this.title),this.label.length>0?this.label:this.localize.term("progress"),this.indeterminate?"0":this.value,this.indeterminate?"":(0,n.qy)(g||(g=b` <slot part="label" class="label"></slot> `)))}constructor(){super(...arguments),this.localize=new l.c(this),this.value=0,this.indeterminate=!1,this.label=""}};v.css=d.A,f([(0,r.MZ)({type:Number,reflect:!0})],v.prototype,"value",2),f([(0,r.MZ)({type:Boolean,reflect:!0})],v.prototype,"indeterminate",2),f([(0,r.MZ)()],v.prototype,"label",2),v=f([(0,r.EM)("wa-progress-bar")],v),i()}catch(_){i(_)}})},4168:function(t,e,a){a.d(e,{A:function(){return n}});let i;var n=(0,a(5124).AH)(i||(i=(t=>t)`:host{--track-height:1rem;--track-color:var(--wa-color-neutral-fill-normal);--indicator-color:var(--wa-color-brand-fill-loud);display:flex}.progress-bar{flex:1 1 auto;display:flex;position:relative;overflow:hidden;height:var(--track-height);border-radius:var(--wa-border-radius-pill);background-color:var(--track-color);color:var(--wa-color-brand-on-loud);font-size:var(--wa-font-size-s)}.indicator{width:var(--percentage);display:flex;align-items:center;justify-content:center;background-color:var(--indicator-color);text-align:center;white-space:nowrap;overflow:hidden;line-height:1;font-weight:var(--wa-font-weight-semibold);transition:all var(--wa-transition-slow, 200ms) var(--wa-transition-easing, ease);user-select:none;-webkit-user-select:none}:host([indeterminate]) .indicator{position:absolute;inset-block:0;inline-size:50%;animation:wa-progress-indeterminate 2.5s infinite cubic-bezier(.37,0,.63,1)} (forced-colors:active){.progress-bar{outline:solid 1px SelectedItem;background-color:var(--wa-color-surface-default)}.indicator{outline:solid 1px SelectedItem;background-color:SelectedItem}} wa-progress-indeterminate{0%{inset-inline-start:-50%}100%,75%{inset-inline-start:100%}}`))},6226:function(t,e,a){a.d(e,{a:function(){return n}});var i=a(83504);function n(t,e,a){const n=(0,i.a)(t,null==a?void 0:a.in);return n.setHours(e),n}},97732:function(t,e,a){a.d(e,{g:function(){return n}});var i=a(83504);function n(t,e,a){const n=(0,i.a)(t,null==a?void 0:a.in);return n.setMinutes(e),n}}}]);