"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["88899"],{2670:function(e,t,a){a.a(e,async function(e,i){try{a.r(t),a.d(t,{HuiEnergyDevicesCardEditor:function(){return v}});a(62953);var s=a(40445),o=a(96196),c=a(77845),n=a(63533),r=a(22786),l=a(1087),d=a(52763),h=a(84698),u=e([d]);d=(u.then?(await u)():u)[0];let p,m=e=>e;const _=(0,n.kp)(h.H,(0,n.Ik)({type:(0,n.KC)([(0,n.eu)("energy-devices-graph"),(0,n.eu)("energy-devices-detail-graph")]),title:(0,n.lq)((0,n.Yj)()),collection_key:(0,n.lq)((0,n.Yj)()),max_devices:(0,n.lq)((0,n.ai)()),modes:(0,n.lq)((0,n.YO)((0,n.KC)([(0,n.eu)("bar"),(0,n.eu)("pie")]))),hide_compound_stats:(0,n.lq)((0,n.zM)())})),g=["bar","pie"];class v extends o.WF{setConfig(e){(0,n.vA)(e,_),this._config=e}render(){if(!this.hass||!this._config)return o.s6;const e=this._schema(this.hass.localize,this._config.type),t=Object.assign({},this._config);return(0,o.qy)(p||(p=m` <ha-form .hass="${0}" .data="${0}" .schema="${0}" .computeLabel="${0}" .computeHelper="${0}" @value-changed="${0}"></ha-form>`),this.hass,t,e,this._computeLabelCallback,this._computeHelperCallback,this._valueChanged)}_valueChanged(e){(0,l.r)(this,"config-changed",{config:e.detail.value})}constructor(...e){super(...e),this._schema=(0,r.A)((e,t)=>[{name:"title",selector:{text:{}}},{name:"",type:"grid",schema:[..."energy-devices-graph"===t?[{name:"modes",required:!1,selector:{select:{multiple:!0,mode:"list",options:g.map(t=>({value:t,label:e(`ui.panel.lovelace.editor.card.energy-devices-graph.mode_options.${t}`)}))}}},{name:"hide_compound_stats",required:!1,selector:{boolean:{}}}]:[],{name:"max_devices",required:!1,selector:{number:{min:1,mode:"box"}}},{type:"string",name:"collection_key",required:!1}]}]),this._computeHelperCallback=e=>{if("collection_key"===e.name)return this.hass.localize("ui.panel.lovelace.editor.card.generic.collection_key_description")},this._computeLabelCallback=e=>{switch(e.name){case"modes":case"max_devices":case"hide_compound_stats":return this.hass.localize(`ui.panel.lovelace.editor.card.energy-devices-graph.${e.name}`);default:return this.hass.localize(`ui.panel.lovelace.editor.card.generic.${e.name}`)}}}}(0,s.Cg)([(0,c.MZ)({attribute:!1})],v.prototype,"hass",void 0),(0,s.Cg)([(0,c.wk)()],v.prototype,"_config",void 0),v=(0,s.Cg)([(0,c.EM)("hui-energy-devices-card-editor")],v),i()}catch(p){i(p)}})},84698:function(e,t,a){a.d(t,{H:function(){return s}});var i=a(63533);const s=(0,i.Ik)({type:(0,i.Yj)(),view_layout:(0,i.bz)(),layout_options:(0,i.bz)(),grid_options:(0,i.bz)(),visibility:(0,i.bz)(),disabled:(0,i.lq)((0,i.zM)())})}}]);
//# sourceMappingURL=88899.9fdf6cb0009d2880.js.map