export const __rspack_esm_id="18591";export const __rspack_esm_ids=["18591"];export const __webpack_modules__={86242(e,t,n){n.a(e,async function(e,s){try{n.r(t),n.d(t,{EnergyViewStrategy:()=>p});n(44114),n(18111),n(20116),n(13579);var i=n(62826),o=n(96196),r=n(97735),c=n(38114),l=n(4203),y=n(7936),a=n(20246),g=e([l,c]);[l,c]=g.then?(await g)():g;class p extends o.mN{static async generate(e,t){const n=e.collection_key||l.DEFAULT_ENERGY_COLLECTION_KEY,s={type:"sections",sections:[],sidebar:{sections:[{cards:[]}],visibility:[a.r]},footer:{card:{type:"energy-date-selection",collection_key:n,opening_direction:"right",vertical_opening_direction:"up"}}},i=(0,c.tb)(t,{key:n});i.prefs||await i.refresh();const o=i.prefs;if(!o||0===o.device_consumption.length&&0===o.energy_sources.length)return s;const r=o.energy_sources.find(e=>!("grid"!==e.type||!e.stat_energy_from&&!e.stat_energy_to)),g=o.energy_sources.some(e=>"grid"===e.type&&!!e.stat_energy_to),p=o.energy_sources.some(e=>"solar"===e.type),_=o.energy_sources.some(e=>"battery"===e.type),u=[],d=[],h=s.sidebar.sections[0];if(r||_||p){const e={title:t.localize("ui.panel.energy.cards.energy_distribution_title"),type:"energy-distribution",collection_key:n};h.cards.push(e),s.sections.push({type:"grid",column_span:1,cards:[e],visibility:[a.B]})}if(g){const e={type:"energy-grid-neutrality-gauge",collection_key:n};d.push(e)}if(p){if(g){const e={type:"energy-solar-consumed-gauge",collection_key:n};d.push(e)}if(r){const e={type:"energy-self-sufficiency-gauge",collection_key:n};d.push(e)}}if(r){const e={type:"energy-carbon-consumed-gauge",collection_key:n};d.push(e)}if(d.length&&(h.cards.push({type:"grid",columns:1===d.length?1:2,cards:d}),s.sections.push({type:"grid",column_span:1,visibility:[a.B],cards:1===d.length?[d[0]]:d.map(e=>({...e,grid_options:{columns:6}}))})),u.push({type:"energy-compare",collection_key:n,grid_options:{columns:36}}),(r||_)&&u.push({title:t.localize("ui.panel.energy.cards.energy_usage_graph_title"),type:"energy-usage-graph",collection_key:n,grid_options:{columns:36}}),p&&u.push({title:t.localize("ui.panel.energy.cards.energy_solar_graph_title"),type:"energy-solar-graph",collection_key:n,grid_options:{columns:36}}),(r||p||_)&&u.push({title:t.localize("ui.panel.energy.cards.energy_sources_table_title"),type:"energy-sources-table",collection_key:n,types:["grid","solar","battery"],grid_options:{columns:36}}),o.device_consumption.length){const e=(0,y.V)(o.device_consumption,t,e=>e.stat_consumption);u.push({title:t.localize("ui.panel.energy.cards.energy_devices_detail_graph_title"),type:"energy-devices-detail-graph",collection_key:n,grid_options:{columns:36}}),u.push({title:t.localize("ui.panel.energy.cards.energy_devices_graph_title"),type:"energy-devices-graph",collection_key:n,grid_options:{columns:36}}),u.push({title:t.localize("ui.panel.energy.cards.energy_sankey_title"),type:"energy-sankey",collection_key:n,group_by_floor:e,group_by_area:e,grid_options:{columns:36}})}return s.sections.push({type:"grid",column_span:3,cards:u}),s}}p=(0,i.Cg)([(0,r.EM)("energy-view-strategy")],p),s()}catch(e){s(e)}})},20246(e,t,n){n.d(t,{B:()=>i,r:()=>s});const s={condition:"screen",media_query:"(min-width: 871px)"},i={condition:"not",conditions:[s]}}};
//# sourceMappingURL=18591.41d488bd8677a92d.js.map