export const __rspack_esm_id="4206";export const __rspack_esm_ids=["4206"];export const __webpack_modules__={60093(e,t,o){o.a(e,async function(e,s){try{o.r(t),o.d(t,{PowerViewStrategy:()=>l});o(44114),o(18111),o(13579);var r=o(62826),a=o(96196),_=o(97735),c=o(38114),n=o(4203),i=o(7936),p=e([n,c]);[n,c]=p.then?(await p)():p;class l extends a.mN{static async generate(e,t){const o=e.collection_key||n.DEFAULT_ENERGY_COLLECTION_KEY,s=(0,c.tb)(t,{key:o});await s.refresh();const r=s.prefs,a=r?.energy_sources.some(e=>!("solar"!==e.type||!e.stat_rate)||(!("battery"!==e.type||!e.stat_rate)||"grid"===e.type&&(!!e.stat_rate||!!e.power_config))),_=r?.device_consumption.some(e=>e.stat_rate),p=r?.device_consumption_water.some(e=>e.stat_rate),l=r?.energy_sources.some(e=>"water"===e.type&&e.stat_rate),y=r?.energy_sources.some(e=>"gas"===e.type&&e.stat_rate),u={type:"grid",cards:[]},g=[],d={type:"sections",sections:[u]};if(!(r&&(a||_||p||l||y)))return d;if(a&&(g.push({type:"power-total",collection_key:o}),u.cards.push({title:t.localize("ui.panel.energy.cards.power_sources_graph_title"),type:"power-sources-graph",collection_key:o,grid_options:{columns:36}})),y&&g.push({type:"gas-total",collection_key:o}),l&&g.push({type:"water-total",collection_key:o}),_){const e=(0,i.V)(r.device_consumption,t,e=>e.stat_rate);u.cards.push({title:t.localize("ui.panel.energy.cards.power_sankey_title"),type:"power-sankey",collection_key:o,group_by_floor:e,group_by_area:e,grid_options:{columns:36}})}if(p){const e=(0,i.V)(r.device_consumption_water,t,e=>e.stat_rate);u.cards.push({title:t.localize("ui.panel.energy.cards.water_flow_sankey_title"),type:"water-flow-sankey",collection_key:o,group_by_floor:e,group_by_area:e,grid_options:{columns:36}})}return g.length&&(d.badges=g),d}}l=(0,r.Cg)([(0,_.EM)("power-view-strategy")],l),s()}catch(e){s(e)}})}};
//# sourceMappingURL=4206.5e6eb1aff8df74f4.js.map