"use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[1842],{26153:function(e,n,t){t.a(e,async function(e,i){try{t.r(n);var r=t(36854),c=t(97058),s=t(98117),o=t(57567),l=t(25979),a=t(12463),y=t(16472),g=(t(62062),t(44114),t(18111),t(61701),t(26099),t(3362),t(15697)),u=t(57527),p=t(51209),d=t(94465),_=t(39715),h=t(83989),f=t(37774),m=e([d]);d=(m.then?(await m)():m)[0];var k=function(e){function n(){return(0,o.A)(this,n),(0,y.A)(this,n,arguments)}return(0,a.A)(n,e),(0,l.A)(n,null,[{key:"generate",value:(t=(0,s.A)((0,r.A)().m(function e(n,t){var i,s,o,l,a,y,g,u,p,m,k;return(0,r.A)().w(function(e){for(;;)switch(e.n){case 0:if(i=n.collection_key||d.e6,s=n.hidden_cards,o={type:"sections",sections:[],sidebar:{sections:[{cards:[]}],visibility:[f.r]},footer:{card:{type:"energy-date-selection",collection_key:i,opening_direction:"right",vertical_opening_direction:"up"}}},(l=(0,d.tb)(t,{key:i})).prefs){e.n=1;break}return e.n=1,l.refresh();case 1:if((a=l.prefs)&&(0!==a.device_consumption.length||0!==a.energy_sources.length)){e.n=2;break}return e.a(2,o);case 2:return y=[],g=[],u=o.sidebar.sections[0],(0,_.BL)("electricity","energy-distribution",a,s)&&(p={title:t.localize("ui.panel.energy.cards.energy_distribution_title"),type:"energy-distribution",collection_key:i},u.cards.push(p),o.sections.push({type:"grid",column_span:1,cards:[p],visibility:[f.B]})),(0,_.BL)("electricity","energy-grid-balance",a,s)&&(m={type:"energy-grid-balance",collection_key:i},u.cards.push(m),o.sections.push({type:"grid",column_span:1,visibility:[f.B],cards:[m]})),(0,_.BL)("electricity","energy-grid-neutrality-gauge",a,s)&&g.push({type:"energy-grid-neutrality-gauge",collection_key:i}),(0,_.BL)("electricity","energy-solar-consumed-gauge",a,s)&&g.push({type:"energy-solar-consumed-gauge",collection_key:i}),(0,_.BL)("electricity","energy-self-sufficiency-gauge",a,s)&&g.push({type:"energy-self-sufficiency-gauge",collection_key:i}),(0,_.BL)("electricity","energy-carbon-consumed-gauge",a,s)&&g.push({type:"energy-carbon-consumed-gauge",collection_key:i}),g.length&&(u.cards.push({type:"grid",columns:1===g.length?1:2,cards:g}),o.sections.push({type:"grid",column_span:1,visibility:[f.B],cards:1===g.length?[g[0]]:g.map(function(e){return(0,c.A)((0,c.A)({},e),{},{grid_options:{columns:6}})})})),y.push({type:"energy-compare",collection_key:i,grid_options:{columns:36}}),(0,_.BL)("electricity","energy-usage-graph",a,s)&&y.push({title:t.localize("ui.panel.energy.cards.energy_usage_graph_title"),type:"energy-usage-graph",collection_key:i,grid_options:{columns:36}}),(0,_.BL)("electricity","energy-solar-graph",a,s)&&y.push({title:t.localize("ui.panel.energy.cards.energy_solar_graph_title"),type:"energy-solar-graph",collection_key:i,grid_options:{columns:36}}),(0,_.BL)("electricity","energy-sources-table",a,s)&&y.push({title:t.localize("ui.panel.energy.cards.energy_sources_table_title"),type:"energy-sources-table",collection_key:i,types:["grid","solar","battery"],grid_options:{columns:36}}),(0,_.BL)("electricity","energy-devices-detail-graph",a,s)&&y.push({title:t.localize("ui.panel.energy.cards.energy_devices_detail_graph_title"),type:"energy-devices-detail-graph",collection_key:i,grid_options:{columns:36}}),(0,_.BL)("electricity","energy-devices-graph",a,s)&&y.push({title:t.localize("ui.panel.energy.cards.energy_devices_graph_title"),type:"energy-devices-graph",collection_key:i,grid_options:{columns:36}}),(0,_.BL)("electricity","energy-sankey",a,s)&&(k=(0,h.V)(a.device_consumption,t,function(e){return e.stat_consumption}),y.push({title:t.localize("ui.panel.energy.cards.energy_sankey_title"),type:"energy-sankey",collection_key:i,group_by_floor:k,group_by_area:k,grid_options:{columns:36}})),o.sections.push({type:"grid",column_span:3,cards:y}),e.a(2,o)}},e)})),function(e,n){return t.apply(this,arguments)})}]);var t}(u.mN);k.registryDependencies=[],k=(0,g.Cg)([(0,p.EM)("energy-view-strategy")],k),t.d(n,{EnergyViewStrategy:function(){return k}}),i()}catch(b){i(b)}})},37774:function(e,n,t){var i={condition:"view_columns",min:2},r={condition:"view_columns",max:1};t.d(n,{B:function(){return r},r:function(){return i}})}}]);
//# sourceMappingURL=1842.8a68b493c39ff7ee.js.map