export const __rspack_esm_id=30769;export const __rspack_esm_ids=[30769];export const __webpack_modules__={42984(a,t,i){i.a(a,async function(a,o){try{i.r(t);var s=i(15697),e=i(57527),h=i(79224),l=i(90789),r=i(148),c=i(98747),n=(i(90507),i(73651)),d=i(55682),p=i(62672),_=i(19157),m=i(76730),u=a([c,n,d]);[c,n,d]=u.then?(await u)():u;class g extends((0,_.U)()(e.WF)){showDialog(a){this._params=a,this._data={...a.item},this._initDirtyTracking({type:"shallow"},this._data),this._open=!0}willUpdate(a){(a.has("_data")||a.has("hass"))&&this.hass&&this._navInfo.update(this.hass,this._data?.path)}closeDialog(){return this._open=!1,!0}_dialogClosed(){this._params=void 0,this._data=void 0,(0,r.r)(this,"dialog-closed",{dialog:this.localName})}render(){if(!this._params||!this._data)return e.s6;const a=this._navInfo.info,t=a.label||"",i=a.icon||"mdi:link";return e.qy` <ha-dialog .open=${this._open} .headerTitle=${this.hass.localize("ui.panel.home.editor.edit_shortcut")} width="small" .preventScrimClose=${this.isDirtyState} @closed=${this._dialogClosed}> <ha-form .hass=${this.hass} .data=${this._data} .schema=${this._schema(t,i)} .computeLabel=${this._computeLabel} @value-changed=${this._valueChanged}></ha-form> <ha-dialog-footer slot="footer"> <ha-button appearance="plain" slot="secondaryAction" @click=${this.closeDialog}> ${this.hass.localize("ui.common.cancel")} </ha-button> <ha-button slot="primaryAction" @click=${this._save} .disabled=${!this.isDirtyState}> ${this.hass.localize("ui.common.save")} </ha-button> </ha-dialog-footer> </ha-dialog> `}_valueChanged(a){a.stopPropagation(),this._data=a.detail.value,this._updateDirtyState(this._data)}_save(){if(!this._params||!this._data?.path)return;const{path:a,label:t,icon:i,color:o}=this._data;this._params.saveCallback({type:"custom",path:a,label:t||void 0,icon:i||void 0,color:o||void 0}),this._markDirtyStateClean(),this.closeDialog()}constructor(...a){super(...a),this._open=!1,this._navInfo=new p.q(this),this._schema=(0,l.A)((a,t)=>[{name:"path",required:!0,selector:{navigation:{}}},{name:"label",selector:{text:{placeholder:a}}},{name:"icon",selector:{icon:{placeholder:t}}},{name:"color",selector:{ui_color:{default_color:"primary"}}}]),this._computeLabel=a=>this.hass.localize(`ui.panel.home.editor.shortcut.${a.name}`)||this.hass.localize(`ui.panel.lovelace.editor.card.generic.${a.name}`)}}g.styles=[m.nA,e.AH`ha-dialog{--dialog-content-padding:var(--ha-space-6)}ha-form{display:block}`],(0,s.Cg)([(0,h.MZ)({attribute:!1})],g.prototype,"hass",void 0),(0,s.Cg)([(0,h.wk)()],g.prototype,"_params",void 0),(0,s.Cg)([(0,h.wk)()],g.prototype,"_data",void 0),(0,s.Cg)([(0,h.wk)()],g.prototype,"_open",void 0),g=(0,s.Cg)([(0,h.EM)("dialog-edit-shortcut")],g),i.d(t,{DialogEditShortcut:()=>g}),o()}catch(a){o(a)}})}};
//# sourceMappingURL=30769.b65364a86b1dee70.js.map