export const __rspack_esm_id="86236";export const __rspack_esm_ids=["86236"];export const __webpack_modules__={97431(e,s,t){t.a(e,async function(e,i){try{t.r(s),t.d(s,{EnergySetupWizard:()=>v});var n=t(62826),a=t(96196),r=t(97735),h=t(1087),p=t(38114),c=t(65063),o=t(14503),g=t(23206),_=t(76135),l=t(28166),d=t(54081),y=t(38726),u=t(70604),f=t(18350),$=e([g,_,l,d,y,u,f,p]);[g,_,l,d,y,u,f,p]=$.then?(await $)():$;class v extends a.WF{getCardSize(){return 10}setConfig(e){e.preferences&&(this._preferences=e.preferences)}firstUpdated(){this.hass.loadFragmentTranslation("config"),this._fetchconfig()}render(){return a.qy` <p> ${this.hass.localize("ui.panel.energy.setup.step",{step:this._step+1,steps:6})} </p> ${0===this._step?a.qy`<ha-energy-grid-settings .hass="${this.hass}" .preferences="${this._preferences}" @value-changed="${this._prefsChanged}"></ha-energy-grid-settings>`:1===this._step?a.qy`<ha-energy-solar-settings .hass="${this.hass}" .preferences="${this._preferences}" .info="${this._info}" @value-changed="${this._prefsChanged}"></ha-energy-solar-settings>`:2===this._step?a.qy`<ha-energy-battery-settings .hass="${this.hass}" .preferences="${this._preferences}" @value-changed="${this._prefsChanged}"></ha-energy-battery-settings>`:3===this._step?a.qy`<ha-energy-gas-settings .hass="${this.hass}" .preferences="${this._preferences}" @value-changed="${this._prefsChanged}"></ha-energy-gas-settings>`:4===this._step?a.qy`<ha-energy-water-settings .hass="${this.hass}" .preferences="${this._preferences}" @value-changed="${this._prefsChanged}"></ha-energy-water-settings>`:a.qy`<ha-energy-device-settings .hass="${this.hass}" .preferences="${this._preferences}" @value-changed="${this._prefsChanged}"></ha-energy-device-settings>`} <div class="buttons"> ${this._step>0?a.qy`<ha-button appearance="plain" @click="${this._back}">${this.hass.localize("ui.panel.energy.setup.back")}</ha-button>`:a.qy`<div></div>`} ${this._step<4?a.qy`<ha-button @click="${this._next}">${this.hass.localize("ui.panel.energy.setup.next")}</ha-button>`:a.qy`<ha-button @click="${this._setupDone}"> ${this.hass.localize("ui.panel.energy.setup.done")} </ha-button>`} </div> `}async _fetchconfig(){this._info=await(0,p.BV)(this.hass)}_prefsChanged(e){this._preferences=e.detail.value}_back(){0!==this._step&&this._step--}_next(){5!==this._step&&this._step++}async _setupDone(){if(this._preferences)if(0!==this._preferences.device_consumption.length||0!==this._preferences.energy_sources.length){try{this._preferences=await(0,p.WN)(this.hass,this._preferences)}catch(e){(0,c.showAlertDialog)(this,{title:`Failed to save config: ${e.message}`})}(0,h.r)(this,"reload-energy-panel")}else(0,c.showAlertDialog)(this,{title:this.hass.localize("ui.panel.energy.setup.no_statistics_selected_title"),text:this.hass.localize("ui.panel.energy.setup.no_statistics_selected_description")})}static get styles(){return[o.RF,a.AH`:host{display:block;padding:16px;max-width:700px;margin:0 auto}ha-button{margin-top:8px}.buttons{display:flex;justify-content:space-between}`]}constructor(...e){super(...e),this._step=0,this._preferences={energy_sources:[],device_consumption:[],device_consumption_water:[]}}}(0,n.Cg)([(0,r.MZ)({attribute:!1})],v.prototype,"hass",void 0),(0,n.Cg)([(0,r.MZ)({attribute:!1})],v.prototype,"lovelace",void 0),(0,n.Cg)([(0,r.wk)()],v.prototype,"_info",void 0),(0,n.Cg)([(0,r.wk)()],v.prototype,"_step",void 0),(0,n.Cg)([(0,r.wk)()],v.prototype,"_preferences",void 0),v=(0,n.Cg)([(0,r.EM)("energy-setup-wizard-card")],v),i()}catch(e){i(e)}})}};
//# sourceMappingURL=86236.9659fc6dc0d27a64.js.map