export const __rspack_esm_id="39031";export const __rspack_esm_ids=["39031"];export const __webpack_modules__={96273(a,t,o){o.d(t,{Bt:()=>c,Qf:()=>n,Su:()=>p,Wu:()=>i,bK:()=>l,dd:()=>u,f3:()=>e,h1:()=>s,wZ:()=>r});var i=function(a){return a.BIND="bind",a.CIFS="cifs",a.NFS="nfs",a}({}),s=function(a){return a.BACKUP="backup",a.MEDIA="media",a.SHARE="share",a}({}),e=function(a){return a.ACTIVE="active",a.FAILED="failed",a.UNKNOWN="unknown",a}({});const l=async a=>a.callWS({type:"supervisor/api",endpoint:"/mounts",method:"get",timeout:null}),n=async(a,t)=>a.callWS({type:"supervisor/api",endpoint:"/mounts",method:"post",timeout:null,data:t}),c=async(a,t)=>a.callWS({type:"supervisor/api",endpoint:`/mounts/${t.name}`,method:"put",timeout:null,data:t}),r=async(a,t)=>a.callWS({type:"supervisor/api",endpoint:`/mounts/${t}`,method:"delete",timeout:null}),u=async(a,t)=>a.callWS({type:"supervisor/api",endpoint:`/mounts/${t.name}/reload`,method:"post",timeout:null}),p=async(a,t)=>a.callWS({type:"supervisor/api",endpoint:"/mounts/options",method:"post",timeout:null,data:t})},74186(a,t,o){o.a(a,async function(a,i){try{o.r(t);var s=o(62826),e=o(96196),l=o(44457),n=o(1087),c=(o(38962),o(18350)),r=o(72554),u=(o(52763),o(47351)),p=o(96273),d=o(14503),h=a([c]);c=(h.then?(await h)():h)[0];const _=[{name:"default_backup_mount",required:!0,selector:{backup_location:{}}}];class m extends e.WF{async showDialog(a){this._dialogParams=a}closeDialog(){this._data=void 0,this._error=void 0,this._waiting=void 0,this._dialogParams=void 0,(0,n.r)(this,"dialog-closed",{dialog:this.localName})}render(){return this._dialogParams?e.qy` <ha-dialog open scrimClickAction escapeKeyAction .heading="${(0,r.l)(this.hass,this.hass.localize("ui.panel.config.backup.dialogs.local_backup_location.title"))}" @closed="${this.closeDialog}"> ${this._error?e.qy`<ha-alert alert-type="error">${this._error}</ha-alert>`:e.s6} <p> ${this.hass.localize("ui.panel.config.backup.dialogs.local_backup_location.description")} </p> <ha-form .hass="${this.hass}" .data="${this._data}" .schema="${_}" .computeLabel="${this._computeLabelCallback}" @value-changed="${this._valueChanged}" dialogInitialFocus></ha-form> <ha-alert alert-type="info"> ${this.hass.localize("ui.panel.config.backup.dialogs.local_backup_location.note")} </ha-alert> <ha-button slot="secondaryAction" appearance="plain" @click="${this.closeDialog}" dialogInitialFocus> ${this.hass.localize("ui.common.cancel")} </ha-button> <ha-button .disabled="${this._waiting||!this._data}" slot="primaryAction" @click="${this._changeMount}"> ${this.hass.localize("ui.common.save")} </ha-button> </ha-dialog> `:e.s6}_valueChanged(a){const t=a.detail.value.default_backup_mount;this._data={default_backup_mount:"/backup"===t?null:t}}async _changeMount(){if(this._data){this._error=void 0,this._waiting=!0;try{await(0,p.Su)(this.hass,this._data)}catch(a){return this._error=(0,u.VR)(a),void(this._waiting=!1)}this.closeDialog()}}static get styles(){return[d.RF,d.nA,e.AH`ha-dialog{--mdc-dialog-max-width:500px}ha-form{display:block;margin-bottom:16px}`]}constructor(...a){super(...a),this._computeLabelCallback=a=>this.hass.localize(`ui.panel.config.backup.dialogs.local_backup_location.options.${a.name}.name`)||a.name}}(0,s.Cg)([(0,l.MZ)({attribute:!1})],m.prototype,"hass",void 0),(0,s.Cg)([(0,l.wk)()],m.prototype,"_dialogParams",void 0),(0,s.Cg)([(0,l.wk)()],m.prototype,"_data",void 0),(0,s.Cg)([(0,l.wk)()],m.prototype,"_waiting",void 0),(0,s.Cg)([(0,l.wk)()],m.prototype,"_error",void 0),m=(0,s.Cg)([(0,l.EM)("dialog-local-backup-location")],m),i()}catch(a){i(a)}})}};
//# sourceMappingURL=39031.9fe9dbdb76792921.js.map