UNPKG

iobroker.lovelace

Version:

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

5 lines 23.4 kB
export const __webpack_ids__=["46790"];export const __webpack_modules__={17803:function(t,e,i){i.d(e,{I:()=>o,_:()=>a});const o=(t,e,i,o)=>{const[a,s,n]=t.split(".",3);return Number(a)>e||Number(a)===e&&(void 0===o?Number(s)>=i:Number(s)>i)||void 0!==o&&Number(a)===e&&Number(s)===i&&Number(n)>=o},a=t=>t.includes("dev")},41307:function(t,e,i){var o=i(44249),a=i(72621),s=i(57243),n=i(15093),r=i(35359),d=i(36522),l=i(76320);i(37583);(0,o.Z)([(0,n.Mo)("ha-expansion-panel")],(function(t,e){class i extends e{constructor(...e){super(...e),t(this)}}return{F:i,d:[{kind:"field",decorators:[(0,n.Cb)({type:Boolean,reflect:!0})],key:"expanded",value:()=>!1},{kind:"field",decorators:[(0,n.Cb)({type:Boolean,reflect:!0})],key:"outlined",value:()=>!1},{kind:"field",decorators:[(0,n.Cb)({attribute:"left-chevron",type:Boolean,reflect:!0})],key:"leftChevron",value:()=>!1},{kind:"field",decorators:[(0,n.Cb)({attribute:"no-collapse",type:Boolean,reflect:!0})],key:"noCollapse",value:()=>!1},{kind:"field",decorators:[(0,n.Cb)()],key:"header",value:void 0},{kind:"field",decorators:[(0,n.Cb)()],key:"secondary",value:void 0},{kind:"field",decorators:[(0,n.SB)()],key:"_showContent",value(){return this.expanded}},{kind:"field",decorators:[(0,n.IO)(".container")],key:"_container",value:void 0},{kind:"method",key:"render",value:function(){const t=this.noCollapse?s.Ld:s.dy` <ha-svg-icon .path="${"M7.41,8.58L12,13.17L16.59,8.58L18,10L12,16L6,10L7.41,8.58Z"}" class="summary-icon ${(0,r.$)({expanded:this.expanded})}"></ha-svg-icon> `;return s.dy` <div class="top ${(0,r.$)({expanded:this.expanded})}"> <div id="summary" class="${(0,r.$)({noCollapse:this.noCollapse})}" @click="${this._toggleContainer}" @keydown="${this._toggleContainer}" @focus="${this._focusChanged}" @blur="${this._focusChanged}" role="button" tabindex="${this.noCollapse?-1:0}" aria-expanded="${this.expanded}" aria-controls="sect1"> ${this.leftChevron?t:s.Ld} <slot name="leading-icon"></slot> <slot name="header"> <div class="header"> ${this.header} <slot class="secondary" name="secondary">${this.secondary}</slot> </div> </slot> ${this.leftChevron?s.Ld:t} <slot name="icons"></slot> </div> </div> <div class="container ${(0,r.$)({expanded:this.expanded})}" @transitionend="${this._handleTransitionEnd}" role="region" aria-labelledby="summary" aria-hidden="${!this.expanded}" tabindex="-1"> ${this._showContent?s.dy`<slot></slot>`:""} </div> `}},{kind:"method",key:"willUpdate",value:function(t){(0,a.Z)(i,"willUpdate",this,3)([t]),t.has("expanded")&&(this._showContent=this.expanded,setTimeout((()=>{this._container.style.overflow=this.expanded?"initial":"hidden"}),300))}},{kind:"method",key:"_handleTransitionEnd",value:function(){this._container.style.removeProperty("height"),this._container.style.overflow=this.expanded?"initial":"hidden",this._showContent=this.expanded}},{kind:"method",key:"_toggleContainer",value:async function(t){if(t.defaultPrevented)return;if("keydown"===t.type&&"Enter"!==t.key&&" "!==t.key)return;if(t.preventDefault(),this.noCollapse)return;const e=!this.expanded;(0,d.B)(this,"expanded-will-change",{expanded:e}),this._container.style.overflow="hidden",e&&(this._showContent=!0,await(0,l.y)());const i=this._container.scrollHeight;this._container.style.height=`${i}px`,e||setTimeout((()=>{this._container.style.height="0px"}),0),this.expanded=e,(0,d.B)(this,"expanded-changed",{expanded:this.expanded})}},{kind:"method",key:"_focusChanged",value:function(t){this.noCollapse||this.shadowRoot.querySelector(".top").classList.toggle("focused","focus"===t.type)}},{kind:"field",static:!0,key:"styles",value:()=>s.iv`:host{display:block}.top{display:flex;align-items:center;border-radius:var(--ha-card-border-radius,12px)}.top.expanded{border-bottom-left-radius:0px;border-bottom-right-radius:0px}.top.focused{background:var(--input-fill-color)}:host([outlined]){box-shadow:none;border-width:1px;border-style:solid;border-color:var(--outline-color);border-radius:var(--ha-card-border-radius,12px)}.summary-icon{transition:transform 150ms cubic-bezier(.4, 0, .2, 1);direction:var(--direction);margin-left:8px;margin-inline-start:8px;margin-inline-end:initial}::slotted([slot=leading-icon]),:host([left-chevron]) .summary-icon{margin-left:0;margin-right:8px;margin-inline-start:0;margin-inline-end:8px}#summary{flex:1;display:flex;padding:var(--expansion-panel-summary-padding,0 8px);min-height:48px;align-items:center;cursor:pointer;overflow:hidden;font-weight:500;outline:0}#summary.noCollapse{cursor:default}.summary-icon.expanded{transform:rotate(180deg)}.header,::slotted([slot=header]){flex:1}.container{padding:var(--expansion-panel-content-padding,0 8px);overflow:hidden;transition:height .3s cubic-bezier(.4, 0, .2, 1);height:0px}.container.expanded{height:auto}.secondary{display:block;color:var(--secondary-text-color);font-size:12px}`}]}}),s.oi)},13928:function(t,e,i){i.r(e),i.d(e,{HaIconNext:()=>r});var o=i(44249),a=i(15093),s=i(5111),n=i(37583);let r=(0,o.Z)([(0,a.Mo)("ha-icon-next")],(function(t,e){return{F:class extends e{constructor(...e){super(...e),t(this)}},d:[{kind:"field",decorators:[(0,a.Cb)()],key:"path",value:()=>"rtl"===s.E.document.dir?"M15.41,16.58L10.83,12L15.41,7.41L14,6L8,12L14,18L15.41,16.58Z":"M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z"}]}}),n.HaSvgIcon)},51784:function(t,e,i){i.d(e,{dJ:()=>u,zB:()=>p});var o=i(44249),a=i(72621),s=i(67840),n=i(88854),r=i(57243),d=i(15093);let l;s.A.addInitializer((async t=>{await t.updateComplete;const e=t;e.dialog.prepend(e.scrim),e.scrim.style.inset=0,e.scrim.style.zIndex=0;const{getOpenAnimation:i,getCloseAnimation:o}=e;e.getOpenAnimation=()=>{const t=i.call(void 0);return t.container=[...t.container??[],...t.dialog??[]],t.dialog=[],t},e.getCloseAnimation=()=>{const t=o.call(void 0);return t.container=[...t.container??[],...t.dialog??[]],t.dialog=[],t}}));(0,o.Z)([(0,d.Mo)("ha-md-dialog")],(function(t,e){class o extends e{constructor(){super(),t(this),this.addEventListener("cancel",this._handleCancel),"function"!=typeof HTMLDialogElement&&(this.addEventListener("open",this._handleOpen),l||(l=i.e("73854").then(i.bind(i,85893)))),void 0===this.animate&&(this.quick=!0),void 0===this.animate&&(this.quick=!0)}}return{F:o,d:[{kind:"field",decorators:[(0,d.Cb)({attribute:"disable-cancel-action",type:Boolean})],key:"disableCancelAction",value:()=>!1},{kind:"field",key:"_polyfillDialogRegistered",value:()=>!1},{kind:"method",key:"_handleOpen",value:async function(t){if(t.preventDefault(),this._polyfillDialogRegistered)return;this._polyfillDialogRegistered=!0,this._loadPolyfillStylesheet("/static/polyfills/dialog-polyfill.css");const e=this.shadowRoot?.querySelector("dialog");(await l).default.registerDialog(e),this.removeEventListener("open",this._handleOpen),this.show()}},{kind:"method",key:"_loadPolyfillStylesheet",value:async function(t){const e=document.createElement("link");return e.rel="stylesheet",e.href=t,new Promise(((i,o)=>{e.onload=()=>i(),e.onerror=()=>o(new Error(`Stylesheet failed to load: ${t}`)),this.shadowRoot?.appendChild(e)}))}},{kind:"method",key:"_handleCancel",value:function(t){if(this.disableCancelAction){t.preventDefault();const e=this.shadowRoot?.querySelector("dialog .container");void 0!==this.animate&&e?.animate([{transform:"rotate(-1deg)","animation-timing-function":"ease-in"},{transform:"rotate(1.5deg)","animation-timing-function":"ease-out"},{transform:"rotate(0deg)","animation-timing-function":"ease-in"}],{duration:200,iterations:2})}}},{kind:"field",static:!0,key:"styles",value(){return[...(0,a.Z)(o,"styles",this),r.iv`:host{--md-dialog-container-color:var(--card-background-color);--md-dialog-headline-color:var(--primary-text-color);--md-dialog-supporting-text-color:var(--primary-text-color);--md-sys-color-scrim:#000000;--md-dialog-headline-weight:400;--md-dialog-headline-size:1.574rem;--md-dialog-supporting-text-size:1rem;--md-dialog-supporting-text-line-height:1.5rem}:host([type=alert]){min-width:320px}@media all and (max-width:450px),all and (max-height:500px){:host(:not([type=alert])){min-width:calc(100vw - env(safe-area-inset-right) - env(safe-area-inset-left));max-width:calc(100vw - env(safe-area-inset-right) - env(safe-area-inset-left));min-height:100%;max-height:100%;--md-dialog-container-shape:0}}::slotted(ha-dialog-header[slot=headline]){display:contents}.scroller{overflow:var(--dialog-content-overflow,auto)}slot[name=content]::slotted(*){padding:var(--dialog-content-padding,24px)}.scrim{z-index:10}`]}}]}}),s.A);const c={...n.I,dialog:[[[{transform:"translateY(50px)"},{transform:"translateY(0)"}],{duration:500,easing:"cubic-bezier(.3,0,0,1)"}]],container:[[[{opacity:0},{opacity:1}],{duration:50,easing:"linear",pseudoElement:"::before"}]]},h={...n.G,dialog:[[[{transform:"translateY(0)"},{transform:"translateY(50px)"}],{duration:150,easing:"cubic-bezier(.3,0,0,1)"}]],container:[[[{opacity:"1"},{opacity:"0"}],{delay:100,duration:50,easing:"linear",pseudoElement:"::before"}]]},u=()=>window.matchMedia("all and (max-width: 450px), all and (max-height: 500px)").matches?c:n.I,p=()=>window.matchMedia("all and (max-width: 450px), all and (max-height: 500px)").matches?h:n.G},74633:function(t,e,i){var o=i(44249),a=i(72621),s=i(78755),n=i(57243),r=i(15093);(0,o.Z)([(0,r.Mo)("ha-md-list-item")],(function(t,e){class i extends e{constructor(...e){super(...e),t(this)}}return{F:i,d:[{kind:"field",static:!0,key:"styles",value(){return[...(0,a.Z)(i,"styles",this),n.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(t,e,i){var o=i(44249),a=i(72621),s=i(623),n=i(57243),r=i(15093);(0,o.Z)([(0,r.Mo)("ha-md-list")],(function(t,e){class i extends e{constructor(...e){super(...e),t(this)}}return{F:i,d:[{kind:"field",static:!0,key:"styles",value(){return[...(0,a.Z)(i,"styles",this),n.iv`:host{--md-sys-color-surface:var(--card-background-color)}`]}}]}}),s.j)},17170:function(t,e,i){i.a(t,(async function(t,o){try{i.r(e),i.d(e,{HaSpinner:()=>h});var a=i(44249),s=i(72621),n=i(97677),r=i(43580),d=i(57243),l=i(15093),c=t([n]);n=(c.then?(await c)():c)[0];let h=(0,a.Z)([(0,l.Mo)("ha-spinner")],(function(t,e){class i extends e{constructor(...e){super(...e),t(this)}}return{F:i,d:[{kind:"field",decorators:[(0,l.Cb)()],key:"size",value:void 0},{kind:"method",key:"updated",value:function(t){if((0,s.Z)(i,"updated",this,3)([t]),t.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:()=>[r.Z,d.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)}`]}]}}),n.Z);o()}catch(t){o(t)}}))},56785:function(t,e,i){i.d(e,{js:()=>s,rY:()=>a,yd:()=>d,yz:()=>r});i(92519),i(42179),i(89256),i(24931),i(88463),i(57449),i(19814);var o=i(17803);const a=t=>t.data,s=t=>"object"==typeof t?"object"==typeof t.body?t.body.message||"Unknown error, see supervisor logs":t.body||t.message||"Unknown error, see supervisor logs":t,n=new Set([502,503,504]),r=t=>!!(t&&t.status_code&&n.has(t.status_code))||!(!t||!t.message||!t.message.includes("ERR_CONNECTION_CLOSED")&&!t.message.includes("ERR_CONNECTION_RESET")),d=async(t,e)=>(0,o.I)(t.config.version,2021,2,4)?t.callWS({type:"supervisor/api",endpoint:`/${e}/stats`,method:"get"}):a(await t.callApi("GET",`hassio/${e}/stats`))},67044:function(t,e,i){i.d(e,{AP:()=>n,MY:()=>r,Or:()=>d,Sj:()=>s,Sx:()=>c,oJ:()=>l,ou:()=>h});var o=i(17803),a=i(56785);const s=async t=>{if((0,o.I)(t.config.version,2021,2,4))return t.callWS({type:"supervisor/api",endpoint:"/host/info",method:"get"});const e=await t.callApi("GET","hassio/host/info");return(0,a.rY)(e)},n=async t=>(0,o.I)(t.config.version,2021,2,4)?t.callWS({type:"supervisor/api",endpoint:"/os/info",method:"get"}):(0,a.rY)(await t.callApi("GET","hassio/os/info")),r=async t=>(0,o.I)(t.config.version,2021,2,4)?t.callWS({type:"supervisor/api",endpoint:"/host/reboot",method:"post",timeout:null}):t.callApi("POST","hassio/host/reboot"),d=async t=>(0,o.I)(t.config.version,2021,2,4)?t.callWS({type:"supervisor/api",endpoint:"/host/shutdown",method:"post",timeout:null}):t.callApi("POST","hassio/host/shutdown"),l=async(t,e)=>(0,o.I)(t.config.version,2021,2,4)?t.callWS({type:"supervisor/api",endpoint:"/host/options",method:"post",data:e}):t.callApi("POST","hassio/host/options",e),c=async(t,e)=>(0,o.I)(t.config.version,2021,2,4)?t.callWS({type:"supervisor/api",endpoint:"/os/datadisk/move",method:"post",timeout:null,data:{device:e}}):t.callApi("POST","hassio/os/datadisk/move"),h=async t=>(0,o.I)(t.config.version,2021,2,4)?t.callWS({type:"supervisor/api",endpoint:"/os/datadisk/list",method:"get",timeout:null}):(0,a.rY)(await t.callApi("GET","/os/datadisk/list"))},47364:function(t,e,i){i.a(t,(async function(t,o){try{i.r(e);var a=i(44249),s=i(57243),n=i(15093),r=i(72344),d=i(36522),l=i(17170),c=(i(51784),i(19993),i(41307),i(74633),i(23334),i(13928),i(56785)),h=i(67044),u=i(28008),p=i(72473),g=i(76131),m=t([l]);l=(m.then?(await m)():m)[0];const f="M7.5,5.6L5,7L6.4,4.5L5,2L7.5,3.4L10,2L8.6,4.5L10,7L7.5,5.6M19.5,15.4L22,14L20.6,16.5L22,19L19.5,17.6L17,19L18.4,16.5L17,14L19.5,15.4M22,2L20.6,4.5L22,7L19.5,5.6L17,7L18.4,4.5L17,2L19.5,3.4L22,2M13.34,12.78L15.78,10.34L13.66,8.22L11.22,10.66L13.34,12.78M14.37,7.29L16.71,9.63C17.1,10 17.1,10.65 16.71,11.04L5.04,22.71C4.65,23.1 4,23.1 3.63,22.71L1.29,20.37C0.9,20 0.9,19.35 1.29,18.96L12.96,7.29C13.35,6.9 14,6.9 14.37,7.29Z",v="M19.79,15.41C20.74,13.24 20.74,10.75 19.79,8.59L17.05,9.83C17.65,11.21 17.65,12.78 17.06,14.17L19.79,15.41M15.42,4.21C13.25,3.26 10.76,3.26 8.59,4.21L9.83,6.94C11.22,6.35 12.79,6.35 14.18,6.95L15.42,4.21M4.21,8.58C3.26,10.76 3.26,13.24 4.21,15.42L6.95,14.17C6.35,12.79 6.35,11.21 6.95,9.82L4.21,8.58M8.59,19.79C10.76,20.74 13.25,20.74 15.42,19.78L14.18,17.05C12.8,17.65 11.22,17.65 9.84,17.06L8.59,19.79M12,2A10,10 0 0,1 22,12A10,10 0 0,1 12,22A10,10 0 0,1 2,12A10,10 0 0,1 12,2M12,8A4,4 0 0,0 8,12A4,4 0 0,0 12,16A4,4 0 0,0 16,12A4,4 0 0,0 12,8Z",y="M16.56,5.44L15.11,6.89C16.84,7.94 18,9.83 18,12A6,6 0 0,1 12,18A6,6 0 0,1 6,12C6,9.83 7.16,7.94 8.88,6.88L7.44,5.44C5.36,6.88 4,9.28 4,12A8,8 0 0,0 12,20A8,8 0 0,0 20,12C20,9.28 18.64,6.88 16.56,5.44M13,3H11V13H13",x="M12,3A9,9 0 0,0 3,12A9,9 0 0,0 12,21A9,9 0 0,0 21,12A9,9 0 0,0 12,3M12,19A7,7 0 0,1 5,12A7,7 0 0,1 12,5A7,7 0 0,1 19,12A7,7 0 0,1 12,19M13,17H11V7H13V17Z",k="M17.65,6.35C16.2,4.9 14.21,4 12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20C15.73,20 18.84,17.45 19.73,14H17.65C16.83,16.33 14.61,18 12,18A6,6 0 0,1 6,12A6,6 0 0,1 12,6C13.66,6 15.14,6.69 16.22,7.78L13,11H20V4L17.65,6.35Z",b="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";(0,a.Z)([(0,n.Mo)("dialog-restart")],(function(t,e){return{F:class extends e{constructor(...e){super(...e),t(this)}},d:[{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,n.SB)()],key:"_open",value:()=>!1},{kind:"field",decorators:[(0,n.SB)()],key:"_loadingHostInfo",value:()=>!1},{kind:"field",decorators:[(0,n.SB)()],key:"_hostInfo",value:void 0},{kind:"field",decorators:[(0,n.IO)("ha-md-dialog")],key:"_dialog",value:void 0},{kind:"method",key:"showDialog",value:async function(){const t=(0,r.p)(this.hass,"hassio");if(this._open=!0,t&&!this._hostInfo){this._loadingHostInfo=!0;try{this._hostInfo=await(0,h.Sj)(this.hass)}catch(t){}finally{this._loadingHostInfo=!1}}}},{kind:"method",key:"_dialogClosed",value:function(){this._open=!1,this._loadingHostInfo=!1,(0,d.B)(this,"dialog-closed",{dialog:this.localName})}},{kind:"method",key:"closeDialog",value:function(){this._dialog?.close()}},{kind:"method",key:"render",value:function(){if(!this._open)return s.Ld;const t=this.hass.userData?.showAdvanced,e=!!this._hostInfo,i=this.hass.localize("ui.dialogs.restart.heading");return s.dy` <ha-md-dialog open @closed="${this._dialogClosed}"> <ha-dialog-header slot="headline"> <ha-icon-button slot="navigationIcon" .label="${this.hass.localize("ui.common.close")??"Close"}" .path="${b}" @click="${this.closeDialog}"></ha-icon-button> <span slot="title" .title="${i}"> ${i} </span> </ha-dialog-header> <div slot="content" class="content"> ${this._loadingHostInfo?s.dy` <div class="loader"> <ha-spinner></ha-spinner> </div> `:s.dy` <ha-md-list dialogInitialFocus> ${t?s.dy` <ha-md-list-item type="button" @click="${this._reload}"> <div slot="headline"> ${this.hass.localize("ui.dialogs.restart.reload.title")} </div> <div slot="supporting-text"> ${this.hass.localize("ui.dialogs.restart.reload.description")} </div> <div slot="start" class="icon-background reload"> <ha-svg-icon .path="${f}"></ha-svg-icon> </div> <ha-icon-next slot="end"></ha-icon-next> </ha-md-list-item> `:s.Ld} <ha-md-list-item type="button" @click="${this._showRestartDialog}"> <div slot="start" class="icon-background restart"> <ha-svg-icon .path="${k}"></ha-svg-icon> </div> <div slot="headline"> ${this.hass.localize("ui.dialogs.restart.restart.title")} </div> <div slot="supporting-text"> ${this.hass.localize("ui.dialogs.restart.restart.description")} </div> <ha-icon-next slot="end"></ha-icon-next> </ha-md-list-item> </ha-md-list> <ha-expansion-panel .header="${this.hass.localize("ui.dialogs.restart.advanced_options")}"> <ha-md-list> ${e?s.dy` <ha-md-list-item type="button" @click="${this._hostReboot}"> <div slot="start" class="icon-background reboot"> <ha-svg-icon .path="${x}"></ha-svg-icon> </div> <div slot="headline"> ${this.hass.localize("ui.dialogs.restart.reboot.title")} </div> <div slot="supporting-text"> ${this.hass.localize("ui.dialogs.restart.reboot.description")} </div> <ha-icon-next slot="end"></ha-icon-next> </ha-md-list-item> <ha-md-list-item type="button" @click="${this._hostShutdown}"> <div slot="start" class="icon-background shutdown"> <ha-svg-icon .path="${y}"></ha-svg-icon> </div> <div slot="headline"> ${this.hass.localize("ui.dialogs.restart.shutdown.title")} </div> <div slot="supporting-text"> ${this.hass.localize("ui.dialogs.restart.shutdown.description")} </div> <ha-icon-next slot="end"></ha-icon-next> </ha-md-list-item> `:s.Ld} <ha-md-list-item type="button" @click="${this._showRestartSafeModeDialog}"> <div slot="start" class="icon-background restart-safe-mode"> <ha-svg-icon .path="${v}"></ha-svg-icon> </div> <div slot="headline"> ${this.hass.localize("ui.dialogs.restart.restart-safe-mode.title")} </div> <div slot="supporting-text"> ${this.hass.localize("ui.dialogs.restart.restart-safe-mode.description")} </div> <ha-icon-next slot="end"></ha-icon-next> </ha-md-list-item> </ha-md-list> </ha-expansion-panel> `} </div> </ha-md-dialog> `}},{kind:"method",key:"_reload",value:async function(){this.closeDialog(),(0,p.C)(this,{message:this.hass.localize("ui.dialogs.restart.reload.reloading"),duration:1e3});try{await this.hass.callService("homeassistant","reload_all")}catch(t){(0,g.showAlertDialog)(this,{title:this.hass.localize("ui.dialogs.restart.reload.failed"),text:t.message})}}},{kind:"method",key:"_showRestartDialog",value:async function(){if(await(0,g.showConfirmationDialog)(this,{title:this.hass.localize("ui.dialogs.restart.restart.confirm_title"),text:this.hass.localize("ui.dialogs.restart.restart.confirm_description"),confirmText:this.hass.localize("ui.dialogs.restart.restart.confirm_action"),destructive:!0})){this.closeDialog();try{await this.hass.callService("homeassistant","restart")}catch(t){(0,g.showAlertDialog)(this,{title:this.hass.localize("ui.dialogs.restart.restart.failed"),text:t.message})}}}},{kind:"method",key:"_showRestartSafeModeDialog",value:async function(){if(await(0,g.showConfirmationDialog)(this,{title:this.hass.localize("ui.dialogs.restart.restart-safe-mode.confirm_title"),text:this.hass.localize("ui.dialogs.restart.restart-safe-mode.confirm_description"),confirmText:this.hass.localize("ui.dialogs.restart.restart-safe-mode.confirm_action"),destructive:!0})){this.closeDialog();try{await this.hass.callService("homeassistant","restart",{safe_mode:!0})}catch(t){(0,g.showAlertDialog)(this,{title:this.hass.localize("ui.dialogs.restart.restart-safe-mode.failed"),text:t.message})}}}},{kind:"method",key:"_hostReboot",value:async function(){if(await(0,g.showConfirmationDialog)(this,{title:this.hass.localize("ui.dialogs.restart.reboot.confirm_title"),text:this.hass.localize("ui.dialogs.restart.reboot.confirm_description"),confirmText:this.hass.localize("ui.dialogs.restart.reboot.confirm_action"),destructive:!0})){this.closeDialog(),(0,p.C)(this,{message:this.hass.localize("ui.dialogs.restart.reboot.rebooting"),duration:-1});try{await(0,h.MY)(this.hass)}catch(t){this.hass.connection.connected&&!(0,c.yz)(t)&&(0,g.showAlertDialog)(this,{title:this.hass.localize("ui.dialogs.restart.reboot.failed"),text:(0,c.js)(t)})}}}},{kind:"method",key:"_hostShutdown",value:async function(){if(await(0,g.showConfirmationDialog)(this,{title:this.hass.localize("ui.dialogs.restart.shutdown.confirm_title"),text:this.hass.localize("ui.dialogs.restart.shutdown.confirm_description"),confirmText:this.hass.localize("ui.dialogs.restart.shutdown.confirm_action"),destructive:!0})){this.closeDialog(),(0,p.C)(this,{message:this.hass.localize("ui.dialogs.restart.shutdown.shutting_down"),duration:-1});try{await(0,h.Or)(this.hass)}catch(t){this.hass.connection.connected&&!(0,c.yz)(t)&&(0,g.showAlertDialog)(this,{title:this.hass.localize("ui.dialogs.restart.shutdown.failed"),text:(0,c.js)(t)})}}}},{kind:"get",static:!0,key:"styles",value:function(){return[u.Qx,u.yu,s.iv`ha-md-dialog{--dialog-content-padding:0}@media all and (min-width:550px){ha-md-dialog{min-width:500px;max-width:500px}}ha-expansion-panel{border-top:1px solid var(--divider-color);margin-bottom:10px;box-shadow:none;--expansion-panel-content-padding:0;--expansion-panel-summary-padding:0 var(--mdc-list-side-padding, 20px);--ha-card-border-radius:0}.icon-background{border-radius:50%;color:#fff;display:flex;width:40px;height:40px;display:flex;align-items:center;justify-content:center}.reload{background-color:#5f8a49}.restart{background-color:#ffd500;color:#650}.reboot{background-color:#ba1b1b;color:#fff}.shutdown{background-color:#0b1d29;color:#fff}.restart-safe-mode{background-color:#e48629;color:#fff}.divider{height:1px;background-color:var(--divider-color)}.section{font-weight:500;font-size:14px;line-height:20px;margin:8px 0 4px 0;padding-left:var(--mdc-list-side-padding,20px);padding-right:var(--mdc-list-side-padding,20px);padding-inline-start:var(--mdc-list-side-padding,20px);padding-inline-end:var(--mdc-list-side-padding,20px)}.loader{display:flex;align-items:center;justify-content:center;padding:24px}`]}}]}}),s.oi);o()}catch(t){o(t)}}))}}; //# sourceMappingURL=46790.1f70b4c47644bd94.js.map