export const __webpack_id__="806";export const __webpack_ids__=["806"];export const __webpack_modules__={40101:function(i,e,s){s.a(i,async function(i,a){try{s.r(e);s(65315),s(37089);var t=s(69868),o=s(84922),l=s(11991),d=s(65940),c=s(44017),r=(s(68940),s(17372)),h=(s(77510),s(53312),s(96635)),n=s(63625),v=s(72274),g=s(15241),m=s(50809),_=i([r,h]);[r,h]=_.then?(await _)():_;const p=(0,d.A)(i=>{const e=1e3*i.host.disk_used/60/30,s=4*i.host.startup_time/60;return 10*Math.ceil((e+s)/10)});class u extends o.WF{showDialog(i){this.dialogParams=i,(0,v.xY)(this.hass).then(i=>{this.devices=i.devices})}closeDialog(){this.dialogParams=void 0,this.selectedDevice=void 0,this.devices=void 0,this.moving=!1,(0,c.r)(this,"dialog-closed",{dialog:this.localName})}render(){return this.dialogParams?o.qy` <ha-dialog open scrimClickAction escapeKeyAction .heading="${this.moving?this.dialogParams.supervisor.localize("dialog.datadisk_move.moving"):this.dialogParams.supervisor.localize("dialog.datadisk_move.title")}" @closed="${this.closeDialog}" ?hideActions="${this.moving}"> ${this.moving?o.qy`<ha-spinner aria-label="Moving" size="large"></ha-spinner> <p class="progress-text"> ${this.dialogParams.supervisor.localize("dialog.datadisk_move.moving_desc")} </p>`:o.qy` ${this.devices?.length?o.qy` ${this.dialogParams.supervisor.localize("dialog.datadisk_move.description",{current_path:this.dialogParams.supervisor.os.data_disk,time:p(this.dialogParams.supervisor)})} <br><br> <ha-select .label="${this.dialogParams.supervisor.localize("dialog.datadisk_move.select_device")}" @selected="${this._selectDevice}" dialogInitialFocus> ${this.devices.map(i=>o.qy`<ha-list-item .value="${i}">${i}</ha-list-item>`)} </ha-select> `:void 0===this.devices?this.dialogParams.supervisor.localize("dialog.datadisk_move.loading_devices"):this.dialogParams.supervisor.localize("dialog.datadisk_move.no_devices")} <ha-button appearance="plain" slot="primaryAction" @click="${this.closeDialog}" dialogInitialFocus> ${this.dialogParams.supervisor.localize("dialog.datadisk_move.cancel")} </ha-button> <ha-button .disabled="${!this.selectedDevice}" slot="primaryAction" @click="${this._moveDatadisk}"> ${this.dialogParams.supervisor.localize("dialog.datadisk_move.move")} </ha-button>`} </ha-dialog> `:o.s6}_selectDevice(i){this.selectedDevice=i.target.value}async _moveDatadisk(){this.moving=!0;try{await(0,v.v9)(this.hass,this.selectedDevice)}catch(i){this.hass.connection.connected&&!(0,n.Tv)(i)&&((0,g.K$)(this,{title:this.dialogParams.supervisor.localize("system.host.failed_to_move"),text:(0,n.VR)(i)}),this.closeDialog())}}static get styles(){return[m.RF,m.nA,o.AH`ha-select{width:100%}ha-spinner{display:block;margin:32px;text-align:center}.progress-text{text-align:center}`]}constructor(...i){super(...i),this.moving=!1}}(0,t.__decorate)([(0,l.MZ)({attribute:!1})],u.prototype,"hass",void 0),(0,t.__decorate)([(0,l.wk)()],u.prototype,"dialogParams",void 0),(0,t.__decorate)([(0,l.wk)()],u.prototype,"selectedDevice",void 0),(0,t.__decorate)([(0,l.wk)()],u.prototype,"devices",void 0),(0,t.__decorate)([(0,l.wk)()],u.prototype,"moving",void 0),u=(0,t.__decorate)([(0,l.EM)("dialog-hassio-datadisk")],u),a()}catch(i){a(i)}})}};
//# sourceMappingURL=806.0754a0979997e8ca.js.map