From dc71cb47fa32c4310f24762932fbea421bd036f2 Mon Sep 17 00:00:00 2001 From: Claus Hagen Date: Sun, 2 Feb 2025 14:42:31 +0100 Subject: [PATCH 1/7] fix powergraph --- .../colors/source/src/components/powerGraph/PgUsageGraph.vue | 2 +- .../colors/web/assets/{index-CIr-OUyK.js => index-dtFnGfh0.js} | 2 +- packages/modules/web_themes/colors/web/index.html | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) rename packages/modules/web_themes/colors/web/assets/{index-CIr-OUyK.js => index-dtFnGfh0.js} (99%) diff --git a/packages/modules/web_themes/colors/source/src/components/powerGraph/PgUsageGraph.vue b/packages/modules/web_themes/colors/source/src/components/powerGraph/PgUsageGraph.vue index 1a8162a7e1..7c16ad8c83 100755 --- a/packages/modules/web_themes/colors/source/src/components/powerGraph/PgUsageGraph.vue +++ b/packages/modules/web_themes/colors/source/src/components/powerGraph/PgUsageGraph.vue @@ -39,7 +39,7 @@ const props = defineProps<{ //state const keys = computed(() => { - if (globalConfig.showInverters) { + if (!globalConfig.showInverters) { return [ ['house', 'charging', 'devices', 'batIn'], ['charging', 'devices', 'batIn', 'house'], diff --git a/packages/modules/web_themes/colors/web/assets/index-CIr-OUyK.js b/packages/modules/web_themes/colors/web/assets/index-dtFnGfh0.js similarity index 99% rename from packages/modules/web_themes/colors/web/assets/index-CIr-OUyK.js rename to packages/modules/web_themes/colors/web/assets/index-dtFnGfh0.js index d7ae970e54..cb7e9905f2 100644 --- a/packages/modules/web_themes/colors/web/assets/index-CIr-OUyK.js +++ b/packages/modules/web_themes/colors/web/assets/index-dtFnGfh0.js @@ -1,4 +1,4 @@ -var Ua=Object.defineProperty;var Fa=(a,e,t)=>e in a?Ua(a,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[e]=t;var b=(a,e,t)=>Fa(a,typeof e!="symbol"?e+"":e,t);import{r as le,m as Na,c as m,a as ee,i as Ha,e as Ve,u as Ft,t as et,b as xt,s as ce,d as L,p as wa,f as ka,w as Ra,o as l,g as f,h as S,j as n,n as q,k as $,l as w,q as pe,v as _,x as H,y as i,z as v,F,A as te,B as xa,C as He,D as ft,E as nt,G as rt,H as dt,I as ht,J as st,K as Ja,L as Ne,M as K,N as Ya,O as Le,P as vt,Q as qa,R as Qa,S as Sa,T as Za,U as Ma,V as Xa,W as Ka,X as en,Y as tn,Z as an,_ as nn,$ as rn,a0 as on,a1 as sn,a2 as ln}from"./vendor-CmSLe-Fc.js";(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const h of o.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&r(h)}).observe(document,{childList:!0,subtree:!0});function t(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(s){if(s.ep)return;s.ep=!0;const o=t(s);fetch(s.href,o)}})();var ve=(a=>(a.instant_charging="instant_charging",a.pv_charging="pv_charging",a.scheduled_charging="scheduled_charging",a.standby="standby",a.stop="stop",a))(ve||{});class $a{constructor(e){b(this,"id");b(this,"name","Wechselrichter");b(this,"color","var(--color-pv)");b(this,"power",0);b(this,"energy",0);b(this,"energy_month",0);b(this,"energy_year",0);b(this,"energy_total",0);this.id=e}}const cn=[["EV","ev_mode"],["Speicher","bat_mode"],["MinSoc","min_soc_bat_mode"]];class un{constructor(e){b(this,"id");b(this,"name","Gerät");b(this,"power",0);b(this,"status","off");b(this,"energy",0);b(this,"runningTime",0);b(this,"configured",!1);b(this,"_showInGraph",!0);b(this,"color","white");b(this,"canSwitch",!1);b(this,"countAsHouse",!1);b(this,"energyPv",0);b(this,"energyBat",0);b(this,"pvPercentage",0);b(this,"tempConfigured",0);b(this,"temp",[300,300,300]);b(this,"on",!1);b(this,"isAutomatic",!0);b(this,"icon","");this.id=e}get showInGraph(){return this._showInGraph}set showInGraph(e){this._showInGraph=e,T.items["sh"+this.id].showInGraph=e,ne()}setShowInGraph(e){this._showInGraph=e}}const ae=le(new Map);function Yt(a){ae.has(a)?console.info("Duplicate sh device message: "+a):(ae.set(a,new un(a)),ae.get(a).color="var(--color-sh"+ae.size+")")}const dn=0,Pa={host:location.hostname,port:location.protocol=="https:"?443:80,endpoint:"/ws",protocol:location.protocol=="https:"?"wss":"ws",connectTimeout:4e3,reconnectPeriod:4e3,clean:!1,clientId:Math.random().toString(36).replace(/[^a-z]+/g,"").substring(0,6)},St={topic:"",qos:dn};let Ce;const{host:hn,port:pn,endpoint:gn,...Ia}=Pa,sa=`${Ia.protocol}://${hn}:${pn}${gn}`;try{console.debug("connectURL",sa),Ce=Na.connect(sa,Ia),Ce.on("connect",()=>{console.info("MQTT connection successful")}),Ce.on("disconnect",()=>{console.info("MQTT disconnected")}),Ce.on("error",a=>{console.error("MQTT connection failed: ",a)})}catch(a){console.error("MQTT connect error: ",a)}function mn(a){Ce?Ce.on("message",a):console.error("MqttRegister: MQTT client not available")}function Xe(a){St.topic=a;const{topic:e,qos:t}=St;Ce.subscribe(e,{qos:t},r=>{if(r){console.error("MQTT Subscription error: "+r);return}})}function ot(a){St.topic=a;const{topic:e}=St;Ce.unsubscribe(e,t=>{if(t){console.error("MQTT Unsubscribe from "+a+" failed: "+t);return}})}async function Nt(a,e){let r=Ce.connected,s=0;for(;!r&&s<20;)console.warn("MQTT publish: Not connected. Waiting 0.1 seconds"),await fn(100),r=Ce.connected,s+=1;if(s<20)try{Ce.publish(a,e,{qos:0},o=>{o&&console.warn("MQTT publish error: ",o),console.info("MQTT publish: Message sent: ["+a+"]("+e+")")})}catch(o){console.warn("MQTT publish: caught error: "+o)}else console.error("MQTT publish: Lost connection to MQTT server. Please reload the page")}function qt(){return Pa.clientId}function fn(a){return new Promise(e=>setTimeout(e,a))}class vn{constructor(e){b(this,"id");b(this,"name","Ladepunkt");b(this,"icon","Ladepunkt");b(this,"type","");b(this,"ev",0);b(this,"template",0);b(this,"connectedPhases",0);b(this,"phase_1",0);b(this,"autoPhaseSwitchHw",!1);b(this,"controlPilotInterruptionHw",!1);b(this,"isEnabled",!0);b(this,"isPluggedIn",!1);b(this,"isCharging",!1);b(this,"_isLocked",!1);b(this,"_connectedVehicle",0);b(this,"chargeTemplate",0);b(this,"evTemplate",0);b(this,"_chargeMode",ve.pv_charging);b(this,"_hasPriority",!1);b(this,"currentPlan","");b(this,"averageConsumption",0);b(this,"vehicleName","");b(this,"rangeCharged",0);b(this,"rangeUnit","");b(this,"counter",0);b(this,"dailyYield",0);b(this,"energyPv",0);b(this,"energyBat",0);b(this,"pvPercentage",0);b(this,"faultState",0);b(this,"faultStr","");b(this,"phasesInUse",0);b(this,"power",0);b(this,"chargedSincePlugged",0);b(this,"stateStr","");b(this,"current",0);b(this,"currents",[0,0,0]);b(this,"phasesToUse",0);b(this,"isSocConfigured",!0);b(this,"isSocManual",!1);b(this,"waitingForSoc",!1);b(this,"color","white");b(this,"_timedCharging",!1);b(this,"_instantChargeLimitMode","");b(this,"_instantTargetCurrent",0);b(this,"_instantTargetSoc",0);b(this,"_instantMaxEnergy",0);b(this,"_pvFeedInLimit",!1);b(this,"_pvMinCurrent",0);b(this,"_pvMaxSoc",0);b(this,"_pvMinSoc",0);b(this,"_pvMinSocCurrent",0);b(this,"_etActive",!1);b(this,"_etMaxPrice",20);this.id=e}get isLocked(){return this._isLocked}set isLocked(e){this._isLocked=e,oe("cpLock",e,this.id)}updateIsLocked(e){this._isLocked=e}get connectedVehicle(){return this._connectedVehicle}set connectedVehicle(e){this._connectedVehicle=e,oe("cpVehicle",e,this.id)}updateConnectedVehicle(e){this._connectedVehicle=e}get soc(){return Y[this.connectedVehicle]?Y[this.connectedVehicle].soc:0}set soc(e){Y[this.connectedVehicle]&&(Y[this.connectedVehicle].soc=e)}get chargeMode(){return this._chargeMode}set chargeMode(e){this._chargeMode=e,oe("chargeMode",e,this.id)}updateChargeMode(e){this._chargeMode=e}get hasPriority(){return this._hasPriority}set hasPriority(e){this._hasPriority=e,oe("cpPriority",e,this.id)}updateCpPriority(e){this._hasPriority=e}get timedCharging(){return _e[this.chargeTemplate]?_e[this.chargeTemplate].time_charging.active:!1}set timedCharging(e){_e[this.chargeTemplate].time_charging.active=e,oe("cpTimedCharging",e,this.chargeTemplate)}get instantTargetCurrent(){return this._instantTargetCurrent}set instantTargetCurrent(e){this._instantTargetCurrent=e,oe("cpInstantTargetCurrent",e,this.id)}updateInstantTargetCurrent(e){this._instantTargetCurrent=e}get instantChargeLimitMode(){return this._instantChargeLimitMode}set instantChargeLimitMode(e){this._instantChargeLimitMode=e,oe("cpInstantChargeLimitMode",e,this.id)}updateInstantChargeLimitMode(e){this._instantChargeLimitMode=e}get instantTargetSoc(){return this._instantTargetSoc}set instantTargetSoc(e){this._instantTargetSoc=e,oe("cpInstantTargetSoc",e,this.id)}updateInstantTargetSoc(e){this._instantTargetSoc=e}get instantMaxEnergy(){return this._instantMaxEnergy}set instantMaxEnergy(e){this._instantMaxEnergy=e,oe("cpInstantMaxEnergy",e,this.id)}updateInstantMaxEnergy(e){this._instantMaxEnergy=e}get pvFeedInLimit(){return this._pvFeedInLimit}set pvFeedInLimit(e){this._pvFeedInLimit=e,oe("cpPvFeedInLimit",e,this.id)}updatePvFeedInLimit(e){this._pvFeedInLimit=e}get pvMinCurrent(){return this._pvMinCurrent}set pvMinCurrent(e){this._pvMinCurrent=e,oe("cpPvMinCurrent",e,this.id)}updatePvMinCurrent(e){this._pvMinCurrent=e}get pvMaxSoc(){return this._pvMaxSoc}set pvMaxSoc(e){this._pvMaxSoc=e,oe("cpPvMaxSoc",e,this.id)}updatePvMaxSoc(e){this._pvMaxSoc=e}get pvMinSoc(){return this._pvMinSoc}set pvMinSoc(e){this._pvMinSoc=e,oe("cpPvMinSoc",e,this.id)}updatePvMinSoc(e){this._pvMinSoc=e}get pvMinSocCurrent(){return this._pvMinSocCurrent}set pvMinSocCurrent(e){this._pvMinSocCurrent=e,oe("cpPvMinSocCurrent",e,this.id)}updatePvMinSocCurrent(e){this._pvMinSocCurrent=e}get realCurrent(){switch(this.phasesInUse){case 0:return 0;case 1:return this.currents[0];case 2:return(this.currents[0]+this.currents[1])/2;case 3:return(this.currents[0]+this.currents[1]+this.currents[2])/3;default:return 0}}get etActive(){return Y[this.connectedVehicle]?Y[this.connectedVehicle].etActive:!1}set etActive(e){Y[this.connectedVehicle]&&(Y[this.connectedVehicle].etActive=e)}get etMaxPrice(){return Y[this.connectedVehicle].etMaxPrice??0}set etMaxPrice(e){oe("cpEtMaxPrice",Math.round(e*10)/1e6,this.id)}toPowerItem(){return{name:this.name,power:this.power,energy:this.dailyYield,energyPv:this.energyPv,energyBat:this.energyBat,pvPercentage:this.pvPercentage,color:this.color,icon:this.icon,showInGraph:!0}}}class yn{constructor(e){b(this,"id");b(this,"name","__invalid");b(this,"tags",[]);b(this,"config",{});b(this,"soc",0);b(this,"range",0);b(this,"_chargeTemplateId",0);b(this,"_evTemplateId",0);this.id=e}get chargeTemplateId(){return this._chargeTemplateId}set chargeTemplateId(e){this._chargeTemplateId=e,oe("vhChargeTemplateId",e,this.id)}updateChargeTemplateId(e){this._chargeTemplateId=e}get evTemplateId(){return this._evTemplateId}set evTemplateId(e){this._evTemplateId=e,oe("vhEvTemplateId",e,this.id)}updateEvTemplateId(e){this._evTemplateId=e}get etActive(){return _e[this.chargeTemplateId]?_e[this.chargeTemplateId].et.active:!1}set etActive(e){_e[this.chargeTemplateId]&&oe("priceCharging",e,this.chargeTemplateId)}get etMaxPrice(){if(_e[this.chargeTemplateId]&&_e[this.chargeTemplateId].et.active)return _e[this.chargeTemplateId].et.max_price*1e5}get chargepoint(){for(const e of Object.values(O))if(e.connectedVehicle==this.id)return e}get visible(){return this.name!="__invalid"&&(this.id!=0||g.showStandardVehicle)}}const O=le({}),Y=le({}),_e=le({}),pt=le({}),gt=le({}),Ht=le({});function bn(a){if(!(a in O)){O[a]=new vn(a);const e="var(--color-cp"+(Object.values(O).length-1)+")";O[a].color=e;const t="cp"+a;ie[t]?ie["cp"+a].color=e:ie[t]={name:"Ladepunkt",color:e,icon:"Ladepunkt"}}}function _n(){Object.keys(O).forEach(a=>{delete O[parseInt(a)]})}const me=m(()=>{const a=[],e=Object.values(O),t=Object.values(Y).filter(o=>o.visible);let r=-1;switch(e.length){case 0:r=t[0]?t[0].id:-1;break;default:r=e[0].connectedVehicle}let s=-1;switch(e.length){case 0:case 1:s=t[0]?t[0].id:-1;break;default:s=e[1].connectedVehicle}return r==s&&(s=t[1]?t[1].id:-1),r!=-1&&a.push(r),s!=-1&&a.push(s),a}),wn={cpLock:"openWB/set/chargepoint/%/set/manual_lock",chargeMode:"openWB/set/vehicle/template/charge_template/%/chargemode/selected",cpPriority:"openWB/set/vehicle/template/charge_template/%/prio",cpTimedCharging:"openWB/set/vehicle/template/charge_template/%/time_charging/active",pvBatteryPriority:"openWB/set/general/chargemode_config/pv_charging/bat_mode",cpVehicle:"openWB/set/chargepoint/%/config/ev",cpInstantChargeLimitMode:"openWB/set/vehicle/template/charge_template/%/chargemode/instant_charging/limit/selected",cpInstantTargetCurrent:"openWB/set/vehicle/template/charge_template/%/chargemode/instant_charging/current",cpInstantTargetSoc:"openWB/set/vehicle/template/charge_template/%/chargemode/instant_charging/limit/soc",cpInstantMaxEnergy:"openWB/set/vehicle/template/charge_template/%/chargemode/instant_charging/limit/amount",cpPvFeedInLimit:"openWB/set/vehicle/template/charge_template/%/chargemode/pv_charging/feed_in_limit",cpPvMinCurrent:"openWB/set/vehicle/template/charge_template/%/chargemode/pv_charging/min_current",cpPvMaxSoc:"openWB/set/vehicle/template/charge_template/%/chargemode/pv_charging/max_soc",cpPvMinSoc:"openWB/set/vehicle/template/charge_template/%/chargemode/pv_charging/min_soc",cpPvMinSocCurrent:"openWB/set/vehicle/template/charge_template/%/chargemode/pv_charging/min_soc_current",cpEtMaxPrice:"openWB/set/vehicle/template/charge_template/%/et/max_price",vhChargeTemplateId:"openWB/set/vehicle/%/charge_template",vhEvTemplateId:"openWB/set/vehicle/%/ev_template",shSetManual:"openWB/set/LegacySmartHome/config/set/Devices/%/mode",shSwitchOn:"openWB/set/LegacySmartHome/config/set/Devices/%/device_manual_control",socUpdate:"openWB/set/vehicle/%/get/force_soc_update",setSoc:"openWB/set/vehicle/%/soc_module/calculated_soc_state/manual_soc",priceCharging:"openWB/set/vehicle/template/charge_template/%/et/active"};function oe(a,e,t=0){if(isNaN(t)){console.warn("Invalid index");return}let r=wn[a];if(!r){console.warn("No topic for update type "+a);return}switch(a){case"chargeMode":case"cpPriority":case"cpScheduledCharging":case"cpInstantTargetCurrent":case"cpInstantChargeLimitMode":case"cpInstantTargetSoc":case"cpInstantMaxEnergy":case"cpPvFeedInLimit":case"cpPvMinCurrent":case"cpPvMaxSoc":case"cpPvMinSoc":case"cpEtMaxPrice":case"cpPvMinSocCurrent":r=r.replace("%",O[t].chargeTemplate.toString());break;default:r=r.replace("%",String(t))}switch(typeof e){case"number":Nt(r,JSON.stringify(+e));break;default:Nt(r,JSON.stringify(e))}}function Qt(a){Nt("openWB/set/command/"+qt()+"/todo",JSON.stringify(a))}const be=500,Se=500,j={top:15,right:20,bottom:10,left:25},Zt=["charging","house","batIn","devices"];class kn{constructor(){b(this,"data",[]);b(this,"_graphMode","");b(this,"waitForData",!0)}get graphMode(){return this._graphMode}set graphMode(e){this._graphMode=e}}const y=le(new kn),Ca=ee(Ha),Ye=m(()=>[0,be-j.left-2*j.right].map(a=>Ca.value.applyX(a)));let mt=!0,it=!0;function ia(){mt=!1}function la(){mt=!0}function ca(){it=!1}function ua(){it=!0}function xn(a){it=a}function yt(a){y.data=a,y.waitForData=!1}const ge=le({refreshTopicPrefix:"openWB/graph/alllivevaluesJson",updateTopic:"openWB/graph/lastlivevaluesJson",configTopic:"openWB/graph/config/#",initialized:!1,initCounter:0,graphRefreshCounter:0,rawDataPacks:[],duration:0,activate(a){this.unsubscribeUpdates(),this.subscribeRefresh(),a&&(y.data=[]),y.waitForData=!0,Xe(this.configTopic),this.initialized=!1,this.initCounter=0,this.graphRefreshCounter=0,this.rawDataPacks=[],In(),lt.value=!0},deactivate(){this.unsubscribeRefresh(),this.unsubscribeUpdates(),ot(this.configTopic)},subscribeRefresh(){for(let a=1;a<17;a++)Xe(this.refreshTopicPrefix+a)},unsubscribeRefresh(){for(let a=1;a<17;a++)ot(this.refreshTopicPrefix+a)},subscribeUpdates(){Xe(this.updateTopic)},unsubscribeUpdates(){ot(this.updateTopic)}}),ue=le({topic:"openWB/log/daily/#",date:new Date,activate(a){if(y.graphMode=="day"||y.graphMode=="today"){y.graphMode=="today"&&(this.date=new Date);const e=this.date.getFullYear().toString()+(this.date.getMonth()+1).toString().padStart(2,"0")+this.date.getDate().toString().padStart(2,"0");this.topic="openWB/log/daily/"+e,Xe(this.topic),a&&(y.data=[]),y.waitForData=!0,Qt({command:"getDailyLog",data:{day:e}})}},deactivate(){ot(this.topic)},back(){this.date=new Date(this.date.setTime(this.date.getTime()-864e5))},forward(){this.date=new Date(this.date.setTime(this.date.getTime()+864e5))},setDate(a){this.date=a},getDate(){return this.date}}),Ee=le({topic:"openWB/log/monthly/#",month:new Date().getMonth()+1,year:new Date().getFullYear(),activate(a){const e=this.year.toString()+this.month.toString().padStart(2,"0");y.data=[],Xe(this.topic),a&&(y.data=[]),y.waitForData=!0,Qt({command:"getMonthlyLog",data:{month:e}})},deactivate(){ot(this.topic)},back(){this.month-=1,this.month<1&&(this.month=12,this.year-=1),this.activate()},forward(){const a=new Date;a.getFullYear()==this.year?this.month-112&&(this.month=1,this.year+=1)),this.activate()},getDate(){return new Date(this.year,this.month)}}),Re=le({topic:"openWB/log/yearly/#",month:new Date().getMonth()+1,year:new Date().getFullYear(),activate(a){const e=this.year.toString();Xe(this.topic),a&&(y.data=[]),y.waitForData=!0,Qt({command:"getYearlyLog",data:{year:e}})},deactivate(){ot(this.topic)},back(){this.year-=1,this.activate()},forward(){this.year0&&(T.items[a].energyPv+=1e3/12*(e[a]*(e.pv-e.evuOut))/(e.pv-e.evuOut+e.evuIn+e.batOut),T.items[a].energyBat+=1e3/12*(e[a]*e.batOut)/(e.pv-e.evuOut+e.evuIn+e.batOut))}function $n(a,e){e[a]>0&&(T.items[a].energyPv+=1e3*(e[a]*(e.pv-e.evuOut))/(e.pv-e.evuOut+e.evuIn+e.batOut),T.items[a].energyBat+=1e3*(e[a]*e.batOut)/(e.pv-e.evuOut+e.evuIn+e.batOut))}const Pn=["evuIn","pv","batOut","evuOut"],qe=ee(!1);function Xt(a,e){Object.entries(a).length>0?(qe.value=!1,Object.entries(a.counter).forEach(([t,r])=>{(e.length==0||e.includes(t))&&(T.items.evuIn.energy+=r.energy_imported,T.items.evuOut.energy+=r.energy_exported)}),T.items.pv.energy=a.pv.all.energy_exported,a.bat.all&&(T.items.batIn.energy=a.bat.all.energy_imported,T.items.batOut.energy=a.bat.all.energy_exported),Object.entries(a.cp).forEach(([t,r])=>{t=="all"?(T.setEnergy("charging",r.energy_imported),r.energy_imported_pv!=null&&(T.setEnergyPv("charging",r.energy_imported_pv),T.setEnergyBat("charging",r.energy_imported_bat))):T.setEnergy(t,r.energy_imported)}),T.setEnergy("devices",0),Object.entries(a.sh).forEach(([t,r])=>{T.setEnergy(t,r.energy_imported);const s=t.substring(2);ae.get(+s).countAsHouse||(T.items.devices.energy+=r.energy_imported)}),a.hc&&a.hc.all?(T.setEnergy("house",a.hc.all.energy_imported),a.hc.all.energy_imported_pv!=null&&(T.setEnergyPv("house",a.hc.all.energy_imported_pv),T.setEnergyBat("house",a.hc.all.energy_imported_bat))):T.calculateHouseEnergy(),T.keys().forEach(t=>{Pn.includes(t)||(T.setPvPercentage(t,Math.round((T.items[t].energyPv+T.items[t].energyBat)/T.items[t].energy*100)),Zt.includes(t)&&(U[t].energy=T.items[t].energy,U[t].energyPv=T.items[t].energyPv,U[t].energyBat=T.items[t].energyBat,U[t].pvPercentage=T.items[t].pvPercentage))}),y.graphMode=="today"&&(Object.values(O).forEach(t=>{const r=T.items["cp"+t.id];r&&(t.energyPv=r.energyPv,t.energyBat=r.energyBat,t.pvPercentage=r.pvPercentage)}),ae.forEach(t=>{const r=T.items["sh"+t.id];r&&(t.energy=r.energy,t.energyPv=r.energyPv,t.energyBat=r.energyBat,t.pvPercentage=r.pvPercentage)}))):qe.value=!0,lt.value=!0}const Be=m(()=>{const a=Ve(y.data,e=>new Date(e.date));return a[0]&&a[1]?Ft().domain(a).range([0,be-j.left-2*j.right]):et().range([0,0])});function In(){T.keys().forEach(a=>{Zt.includes(a)&&(U[a].energy=T.items[a].energy,U[a].energyPv=0,U[a].energyBat=0,U[a].pvPercentage=0)}),Object.values(O).forEach(a=>{a.energyPv=0,a.energyBat=0,a.pvPercentage=0}),ae.forEach(a=>{a.energyPv=0,a.energyBat=0,a.pvPercentage=0})}const Je=m(()=>{const a=Ve(y.data,e=>e.date);return a[1]?xt().domain(Array.from({length:a[1]},(e,t)=>t+1)).paddingInner(.4).range([0,be-j.left-2]):xt().range([0,0])});function It(){switch(y.graphMode){case"live":y.graphMode="today",g.showRightButton=!0,fe();break;case"today":y.graphMode="day",ue.deactivate(),ue.back(),ue.activate(),fe();break;case"day":ue.back(),fe();break;case"month":Ee.back();break;case"year":Re.back();break}}function Kt(){const a=new Date;switch(y.graphMode){case"live":break;case"today":y.graphMode="live",g.showRightButton=!1,fe();break;case"day":ue.forward(),ue.date.getDate()==a.getDate()&&ue.date.getMonth()==a.getMonth()&&ue.date.getFullYear()==a.getFullYear()&&(y.graphMode="today"),fe();break;case"month":Ee.forward();break;case"year":Re.forward();break}}function ea(){switch(y.graphMode){case"live":It();break;case"day":case"today":y.graphMode="month",fe();break;case"month":y.graphMode="year",fe();break}}function ta(){switch(y.graphMode){case"year":y.graphMode="month",fe();break;case"month":y.graphMode="today",fe();break;case"today":case"day":y.graphMode="live",fe();break}}function da(a){if(y.graphMode=="day"||y.graphMode=="today"){ue.setDate(a);const e=new Date;ue.date.getDate()==e.getDate()&&ue.date.getMonth()==e.getMonth()&&ue.date.getFullYear()==e.getFullYear()?y.graphMode="today":y.graphMode="day",fe()}}const Fe=ee(new Map);class Cn{constructor(){b(this,"_showRelativeArcs",!1);b(this,"showTodayGraph",!0);b(this,"_graphPreference","today");b(this,"_usageStackOrder",0);b(this,"_displayMode","dark");b(this,"_showGrid",!1);b(this,"_smartHomeColors","normal");b(this,"_decimalPlaces",1);b(this,"_showQuickAccess",!0);b(this,"_simpleCpList",!1);b(this,"_shortCpList","no");b(this,"_showAnimations",!0);b(this,"_preferWideBoxes",!1);b(this,"_maxPower",4e3);b(this,"_fluidDisplay",!1);b(this,"_showClock","no");b(this,"_showButtonBar",!0);b(this,"_showCounters",!1);b(this,"_showVehicles",!1);b(this,"_showStandardVehicle",!0);b(this,"_showPrices",!1);b(this,"_showInverters",!1);b(this,"_alternativeEnergy",!1);b(this,"_sslPrefs",!1);b(this,"_debug",!1);b(this,"_lowerPriceBound",0);b(this,"_upperPriceBound",0);b(this,"isEtEnabled",!1);b(this,"etPrice",20.5);b(this,"showRightButton",!0);b(this,"showLeftButton",!0);b(this,"animationDuration",300);b(this,"animationDelay",100);b(this,"zoomGraph",!1);b(this,"zoomedWidget",1)}get showRelativeArcs(){return this._showRelativeArcs}set showRelativeArcs(e){this._showRelativeArcs=e,ne()}setShowRelativeArcs(e){this._showRelativeArcs=e}get graphPreference(){return this._graphPreference}set graphPreference(e){this._graphPreference=e,ne()}setGraphPreference(e){this._graphPreference=e}get usageStackOrder(){return this._usageStackOrder}set usageStackOrder(e){this._usageStackOrder=e,ne()}setUsageStackOrder(e){this._usageStackOrder=e}get displayMode(){return this._displayMode}set displayMode(e){this._displayMode=e,On(e)}setDisplayMode(e){this._displayMode=e}get showGrid(){return this._showGrid}set showGrid(e){this._showGrid=e,ne()}setShowGrid(e){this._showGrid=e}get decimalPlaces(){return this._decimalPlaces}set decimalPlaces(e){this._decimalPlaces=e,ne()}setDecimalPlaces(e){this._decimalPlaces=e}get smartHomeColors(){return this._smartHomeColors}set smartHomeColors(e){this._smartHomeColors=e,ha(e),ne()}setSmartHomeColors(e){this._smartHomeColors=e,ha(e)}get showQuickAccess(){return this._showQuickAccess}set showQuickAccess(e){this._showQuickAccess=e,ne()}setShowQuickAccess(e){this._showQuickAccess=e}get simpleCpList(){return this._simpleCpList}set simpleCpList(e){this._simpleCpList=e,ne()}setSimpleCpList(e){this._simpleCpList=e}get shortCpList(){return this._shortCpList}set shortCpList(e){this._shortCpList=e,ne()}setShortCpList(e){this._shortCpList=e}get showAnimations(){return this._showAnimations}set showAnimations(e){this._showAnimations=e,ne()}setShowAnimations(e){this._showAnimations=e}get preferWideBoxes(){return this._preferWideBoxes}set preferWideBoxes(e){this._preferWideBoxes=e,ne()}setPreferWideBoxes(e){this._preferWideBoxes=e}get maxPower(){return this._maxPower}set maxPower(e){this._maxPower=e,ne()}setMaxPower(e){this._maxPower=e}get fluidDisplay(){return this._fluidDisplay}set fluidDisplay(e){this._fluidDisplay=e,ne()}setFluidDisplay(e){this._fluidDisplay=e}get showClock(){return this._showClock}set showClock(e){this._showClock=e,ne()}setShowClock(e){this._showClock=e}get sslPrefs(){return this._sslPrefs}set sslPrefs(e){this._sslPrefs=e,ne()}setSslPrefs(e){this.sslPrefs=e}get debug(){return this._debug}set debug(e){this._debug=e,ne()}setDebug(e){this._debug=e}get showButtonBar(){return this._showButtonBar}set showButtonBar(e){this._showButtonBar=e,ne()}setShowButtonBar(e){this._showButtonBar=e}get showCounters(){return this._showCounters}set showCounters(e){this._showCounters=e,ne()}setShowCounters(e){this._showCounters=e}get showVehicles(){return this._showVehicles}set showVehicles(e){this._showVehicles=e,ne()}setShowVehicles(e){this._showVehicles=e}get showStandardVehicle(){return this._showStandardVehicle}set showStandardVehicle(e){this._showStandardVehicle=e,ne()}setShowStandardVehicle(e){this._showStandardVehicle=e}get showPrices(){return this._showPrices}set showPrices(e){this._showPrices=e,ne()}setShowPrices(e){this._showPrices=e}get showInverters(){return this._showInverters}set showInverters(e){this._showInverters=e,la(),ua(),ne()}setShowInverters(e){this._showInverters=e}get alternativeEnergy(){return this._alternativeEnergy}set alternativeEnergy(e){this._alternativeEnergy=e,la(),ua(),ne()}setAlternativeEnergy(e){this._alternativeEnergy=e}get lowerPriceBound(){return this._lowerPriceBound}set lowerPriceBound(e){this._lowerPriceBound=e,ne()}setLowerPriceBound(e){this._lowerPriceBound=e}get upperPriceBound(){return this._upperPriceBound}set upperPriceBound(e){this._upperPriceBound=e,ne()}setUpperPriceBound(e){this._upperPriceBound=e}}const g=le(new Cn);function Ba(){En();const a=ce("html");a.classed("theme-dark",g.displayMode=="dark"),a.classed("theme-light",g.displayMode=="light"),a.classed("theme-blue",g.displayMode=="blue"),a.classed("shcolors-standard",g.smartHomeColors=="standard"),a.classed("shcolors-advanced",g.smartHomeColors=="advanced"),a.classed("shcolors-normal",g.smartHomeColors=="normal")}const Bn=992,Mt=le({x:document.documentElement.clientWidth,y:document.documentElement.clientHeight});function Vn(){Mt.x=document.documentElement.clientWidth,Mt.y=document.documentElement.clientHeight,Ba()}const De=m(()=>Mt.x>=Bn),ye={instant_charging:{mode:ve.instant_charging,name:"Sofort",color:"var(--color-charging)",icon:"fa-bolt"},pv_charging:{mode:ve.pv_charging,name:"PV",color:"var(--color-pv",icon:"fa-solar-panel"},scheduled_charging:{mode:ve.scheduled_charging,name:"Zielladen",color:"var(--color-battery)",icon:"fa-bullseye"},standby:{mode:ve.standby,name:"Standby",color:"var(--color-axis",icon:"fa-pause"},stop:{mode:ve.stop,name:"Stop",color:"var(--color-fg)",icon:"fa-power-off"}};class Ln{constructor(){b(this,"batterySoc",0);b(this,"isBatteryConfigured",!0);b(this,"chargeMode","0");b(this,"_pvBatteryPriority","ev_mode");b(this,"displayLiveGraph",!0);b(this,"isEtEnabled",!0);b(this,"etMaxPrice",0);b(this,"etCurrentPrice",0);b(this,"cpDailyExported",0);b(this,"evuId",0);b(this,"etProvider","")}get pvBatteryPriority(){return this._pvBatteryPriority}set pvBatteryPriority(e){this._pvBatteryPriority=e,oe("pvBatteryPriority",e)}updatePvBatteryPriority(e){this._pvBatteryPriority=e}}function ne(){Tn()}function On(a){const e=ce("html");e.classed("theme-dark",a=="dark"),e.classed("theme-light",a=="light"),e.classed("theme-blue",a=="blue"),ne()}function An(){g.maxPower=Q.evuIn.power+Q.pv.power+Q.batOut.power,ne()}function ha(a){const e=ce("html");e.classed("shcolors-normal",a=="normal"),e.classed("shcolors-standard",a=="standard"),e.classed("shcolors-advanced",a=="advanced")}const Te={chargemode:"Der Lademodus für das Fahrzeug an diesem Ladepunkt",vehicle:"Das Fahrzeug, das an diesem Ladepounkt geladen wird",locked:"Für das Laden sperren",priority:"Fahrzeuge mit Priorität werden bevorzugt mit mehr Leistung geladen, falls verfügbar",timeplan:"Das Laden nach Zeitplan für dieses Fahrzeug aktivieren",minsoc:"Immer mindestens bis zum eingestellten Ladestand laden. Wenn notwendig mit Netzstrom.",minpv:"Durchgehend mit mindestens dem eingestellten Strom laden. Wenn notwendig mit Netzstrom.",pricebased:"Laden bei dynamischem Stromtarif, wenn eingestellter Maximalpreis unterboten wird.",pvpriority:"Ladepriorität bei PV-Produktion. Bevorzung von Fahzeugen, Speicher, oder Fahrzeugen bis zum eingestellten Mindest-Ladestand. Die Einstellung ist für alle Ladepunkte gleich."};function Tn(){const a={};a.hideSH=[...ae.values()].filter(e=>!e.showInGraph).map(e=>e.id),a.showLG=g.graphPreference=="live",a.displayM=g.displayMode,a.stackO=g.usageStackOrder,a.showGr=g.showGrid,a.decimalP=g.decimalPlaces,a.smartHomeC=g.smartHomeColors,a.relPM=g.showRelativeArcs,a.maxPow=g.maxPower,a.showQA=g.showQuickAccess,a.simpleCP=g.simpleCpList,a.shortCP=g.shortCpList,a.animation=g.showAnimations,a.wideB=g.preferWideBoxes,a.fluidD=g.fluidDisplay,a.clock=g.showClock,a.showButtonBar=g.showButtonBar,a.showCounters=g.showCounters,a.showVehicles=g.showVehicles,a.showStandardV=g.showStandardVehicle,a.showPrices=g.showPrices,a.showInv=g.showInverters,a.altEngy=g.alternativeEnergy,a.lowerP=g.lowerPriceBound,a.upperP=g.upperPriceBound,a.sslPrefs=g.sslPrefs,a.debug=g.debug,document.cookie="openWBColorTheme="+JSON.stringify(a)+";max-age=16000000;"+(g.sslPrefs?"SameSite=None;Secure":"SameSite=Strict")}function En(){const e=document.cookie.split(";").filter(t=>t.split("=")[0]==="openWBColorTheme");if(e.length>0){const t=JSON.parse(e[0].split("=")[1]);t.decimalP!==void 0&&g.setDecimalPlaces(+t.decimalP),t.smartHomeC!==void 0&&g.setSmartHomeColors(t.smartHomeC),t.hideSH!==void 0&&t.hideSH.forEach(r=>{ae.get(r)==null&&Yt(r),ae.get(r).setShowInGraph(!1)}),t.showLG!==void 0&&g.setGraphPreference(t.showLG?"live":"today"),t.maxPow!==void 0&&g.setMaxPower(+t.maxPow),t.relPM!==void 0&&g.setShowRelativeArcs(t.relPM),t.displayM!==void 0&&g.setDisplayMode(t.displayM),t.stackO!==void 0&&g.setUsageStackOrder(t.stackO),t.showGr!==void 0&&g.setShowGrid(t.showGr),t.showQA!==void 0&&g.setShowQuickAccess(t.showQA),t.simpleCP!==void 0&&g.setSimpleCpList(t.simpleCP),t.shortCP!==void 0&&g.setShortCpList(t.shortCP),t.animation!=null&&g.setShowAnimations(t.animation),t.wideB!=null&&g.setPreferWideBoxes(t.wideB),t.fluidD!=null&&g.setFluidDisplay(t.fluidD),t.clock!=null&&g.setShowClock(t.clock),t.showButtonBar!==void 0&&g.setShowButtonBar(t.showButtonBar),t.showCounters!==void 0&&g.setShowCounters(t.showCounters),t.showVehicles!==void 0&&g.setShowVehicles(t.showVehicles),t.showStandardV!==void 0&&g.setShowStandardVehicle(t.showStandardV),t.showPrices!==void 0&&g.setShowPrices(t.showPrices),t.showInv!==void 0&&g.setShowInverters(t.showInv),t.altEngy!==void 0&&g.setAlternativeEnergy(t.altEngy),t.lowerP!==void 0&&g.setLowerPriceBound(t.lowerP),t.upperP!==void 0&&g.setUpperPriceBound(t.upperP),t.sslPrefs!==void 0&&g.setSslPrefs(t.sslPrefs),t.debug!==void 0&&g.setDebug(t.debug)}}const ie=le({evuIn:{name:"Netz",color:"var(--color-evu)",icon:""},pv:{name:"PV",color:"var(--color-pv",icon:""},batOut:{name:"Bat >",color:"var(--color-battery)",icon:""},evuOut:{name:"Export",color:"var(--color-export)",icon:""},charging:{name:"Laden",color:"var(--color-charging)",icon:""},devices:{name:"Geräte",color:"var(--color-devices)",icon:""},batIn:{name:"> Bat",color:"var(--color-battery)",icon:""},house:{name:"Haus",color:"var(--color-house)",icon:""},cp1:{name:"Ladepunkt",color:"var(--color-cp1)",icon:"Ladepunkt"},cp2:{name:"Ladepunkt",color:"var(--color-cp2)",icon:"Ladepunkt"},cp3:{name:"Ladepunkt",color:"var(--color-cp3)",icon:"Ladepunkt"},cp4:{name:"Ladepunkt",color:"var(--color-cp4)",icon:"Ladepunkt"},cp5:{name:"Ladepunkt",color:"var(--color-cp5)",icon:"Ladepunkt"},cp6:{name:"Ladepunkt",color:"var(--color-cp6)",icon:"Ladepunkt"},cp7:{name:"Ladepunkt",color:"var(--color-cp7)",icon:"Ladepunkt"},cp8:{name:"Ladepunkt",color:"var(--color-cp8)",icon:"Ladepunkt"},sh1:{name:"Gerät",color:"var(--color-sh1)",icon:"Gerät"},sh2:{name:"Gerät",color:"var(--color-sh2)",icon:"Gerät"},sh3:{name:"Gerät",color:"var(--color-sh3)",icon:"Gerät"},sh4:{name:"Gerät",color:"var(--color-sh4)",icon:"Gerät"},sh5:{name:"Gerät",color:"var(--color-sh5)",icon:"Gerät"},sh6:{name:"Gerät",color:"var(--color-sh6)",icon:"Gerät"},sh7:{name:"Gerät",color:"var(--color-sh7)",icon:"Gerät"},sh8:{name:"Gerät",color:"var(--color-sh8)",icon:"Gerät"},sh9:{name:"Gerät",color:"var(--color-sh9)",icon:"Gerät"},pv1:{name:"PV",color:"var(--color-pv1)",icon:"Wechselrichter"},pv2:{name:"PV",color:"var(--color-pv2)",icon:"Wechselrichter"},pv3:{name:"PV",color:"var(--color-pv3)",icon:"Wechselrichter"},pv4:{name:"PV",color:"var(--color-pv4)",icon:"Wechselrichter"},pv5:{name:"PV",color:"var(--color-pv5)",icon:"Wechselrichter"},pv6:{name:"PV",color:"var(--color-pv6)",icon:"Wechselrichter"},pv7:{name:"PV",color:"var(--color-pv7)",icon:"Wechselrichter"},pv8:{name:"PV",color:"var(--color-pv8)",icon:"Wechselrichter"},pv9:{name:"PV",color:"var(--color-pv9)",icon:"Wechselrichter"},bat1:{name:"Speicher",color:"var(--color-battery)",icon:"Speicher"},bat2:{name:"Speicher",color:"var(--color-battery)",icon:"Speicher"},bat3:{name:"Speicher",color:"var(--color-battery)",icon:"Speicher"},bat4:{name:"Speicher",color:"var(--color-battery)",icon:"Speicher"},bat5:{name:"Speicher",color:"var(--color-battery)",icon:"Speicher"},bat6:{name:"Speicher",color:"var(--color-battery)",icon:"Speicher"},bat7:{name:"Speicher",color:"var(--color-battery)",icon:"Speicher"},bat8:{name:"Speicher",color:"var(--color-battery)",icon:"Speicher"},bat9:{name:"Speicher",color:"var(--color-battery)",icon:"Speicher"}});class Va{constructor(){b(this,"_items",{});this.addItem("evuIn"),this.addItem("pv"),this.addItem("batOut"),this.addItem("evuOut"),this.addItem("charging"),this.addItem("devices"),this.addItem("batIn"),this.addItem("house")}get items(){return this._items}keys(){return Object.keys(this._items)}values(){return Object.values(this._items)}addItem(e,t){this._items[e]=t?ze(e,t):ze(e)}setEnergy(e,t){this.keys().includes(e)||this.addItem(e),this._items[e].energy=t}setEnergyPv(e,t){this.keys().includes(e)||this.addItem(e),this._items[e].energyPv=t}setEnergyBat(e,t){this.keys().includes(e)||this.addItem(e),this._items[e].energyBat=t}setPvPercentage(e,t){this.keys().includes(e)||this.addItem(e),this._items[e].pvPercentage=t<=100?t:100}calculateHouseEnergy(){this._items.house.energy=this._items.evuIn.energy+this._items.pv.energy+this._items.batOut.energy-this._items.evuOut.energy-this._items.batIn.energy-this._items.charging.energy-this._items.devices.energy}}let T=le(new Va);function aa(){T=new Va}const Q=le({evuIn:ze("evuIn"),pv:ze("pv"),batOut:ze("batOut")}),U=le({evuOut:ze("evuOut"),charging:ze("charging"),devices:ze("devices"),batIn:ze("batIn"),house:ze("house")}),de=le(new Ln);ee("");const lt=ee(!1);function ze(a,e){return{name:ie[a]?ie[a].name:"item",power:0,energy:0,energyPv:0,energyBat:0,pvPercentage:0,color:e||(ie[a]?ie[a].color:"var(--color-charging)"),icon:ie[a]?ie[a].icon:"",showInGraph:!0}}const Rt=ee(new Date),we=ee(new Map),zn=a=>{we.value.set(a,new $a(a)),we.value.get(a).color=ie["pv"+we.value.size].color},Wn=["origin"],Dn=L({__name:"PMSourceArc",props:{radius:{},cornerRadius:{},circleGapSize:{},emptyPower:{}},setup(a){const e=a,t=m(()=>{let r={name:"",power:e.emptyPower,energy:0,energyPv:0,energyBat:0,pvPercentage:0,color:"var(--color-bg)",icon:"",showInGraph:!0},s=Q;s["zz-empty"]=r;const o=Object.values(Q).length-1,h=wa().value(p=>p.power).startAngle(-Math.PI/2+e.circleGapSize).endAngle(Math.PI/2-e.circleGapSize).sort(null),d=ka().innerRadius(e.radius/6*5).outerRadius(e.radius).cornerRadius(e.cornerRadius).padAngle(0),u=ce("g#pmSourceArc");return u.selectAll("*").remove(),u.selectAll("sources").data(h(Object.values(s))).enter().append("path").attr("d",d).attr("fill",p=>p.data.color).attr("stroke",(p,c)=>c==o?p.data.power>0?"var(--color-scale)":"null":p.data.color),"pmSourceArc.vue"});return Ra(()=>{let r=Q.pv.power+Q.evuIn.power+Q.batOut.power;r>g.maxPower&&(g.maxPower=r)}),(r,s)=>(l(),f("g",{id:"pmSourceArc",origin:t.value},null,8,Wn))}}),Gn=["origin"],jn=L({__name:"PMUsageArc",props:{radius:{},cornerRadius:{},circleGapSize:{},emptyPower:{}},setup(a){const e=a,t=m(()=>{let r={name:"",power:e.emptyPower,energy:0,energyPv:0,energyBat:0,pvPercentage:0,color:"var(--color-bg)",icon:"",showInGraph:!0};const s=[U.evuOut,U.charging].concat([...ae.values()].filter(p=>p.configured&&!p.countAsHouse).sort((p,c)=>c.power-p.power)).concat([U.batIn,U.house]).concat(r),o=s.length-1,h=wa().value(p=>p.power).startAngle(Math.PI*1.5-e.circleGapSize).endAngle(Math.PI/2+e.circleGapSize).sort(null),d=ka().innerRadius(e.radius/6*5).outerRadius(e.radius).cornerRadius(e.cornerRadius),u=ce("g#pmUsageArc");return u.selectAll("*").remove(),u.selectAll("consumers").data(h(s)).enter().append("path").attr("d",d).attr("fill",p=>p.data.color).attr("stroke",(p,c)=>c==o?p.data.power>0?"var(--color-scale)":"null":p.data.color),"pmUsageArc.vue"});return(r,s)=>(l(),f("g",{id:"pmUsageArc",origin:t.value},null,8,Gn))}});function $e(a,e=1){let t;if(a>=1e3&&e<4){switch(e){case 0:t=Math.round(a/1e3);break;case 1:t=Math.round(a/100)/10;break;case 2:t=Math.round(a/10)/100;break;case 3:t=Math.round(a)/1e3;break;default:t=Math.round(a/100)/10;break}return(t==null?void 0:t.toLocaleString(void 0,{minimumFractionDigits:e}))+" kW"}else return Math.round(a).toLocaleString()+" W"}function ct(a,e=1,t=!1){let r;if(a>1e6&&(t=!0,a=a/1e3),a>=1e3&&e<4){switch(e){case 0:r=Math.round(a/1e3);break;case 1:r=Math.round(a/100)/10;break;case 2:r=Math.round(a/10)/100;break;case 3:r=Math.round(a)/1e3;break;default:r=Math.round(a/100)/10;break}return r.toLocaleString(void 0,{minimumFractionDigits:e})+(t?" MWh":" kWh")}else return Math.round(a).toLocaleString()+(t?" kWh":" Wh")}function Un(a){const e=Math.floor(a/3600),t=(a%3600/60).toFixed(0);return e>0?e+"h "+t+" min":t+" min"}function La(a){return a.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}function Fn(a,e){return["Jan","Feb","März","April","Mai","Juni","Juli","Aug","Sep","Okt","Nov","Dez"][a]+" "+e}function Nn(a){return a!=999?(Math.round(a*10)/10).toLocaleString(void 0,{minimumFractionDigits:1})+"°":"-"}const bt=L({__name:"FormatWatt",props:{watt:{}},setup(a){const e=a,t=m(()=>$e(e.watt,g.decimalPlaces));return(r,s)=>S(t.value)}}),Hn={key:0,id:"pmLabel"},Rn=["x","y","fill","text-anchor"],Jn=22,Ae=L({__name:"PMLabel",props:{x:{},y:{},data:{},props:{},anchor:{},labeltext:{},labelicon:{},labelcolor:{}},setup(a){const e=a,t=m(()=>e.labeltext?e.labeltext:e.props?e.props.icon+" ":e.labelicon?e.labelicon+" ":""),r=m(()=>e.labelcolor?e.labelcolor:e.props?e.props.color:""),s=m(()=>!e.data||e.data.power>0),o=m(()=>e.labeltext?"":"fas");return(h,d)=>s.value?(l(),f("g",Hn,[n("text",{x:h.x,y:h.y,fill:r.value,"text-anchor":h.anchor,"font-size":Jn,class:"pmLabel"},[n("tspan",{class:q(o.value)},S(t.value),3),n("tspan",null,[h.data!==void 0?(l(),$(bt,{key:0,watt:h.data.power},null,8,["watt"])):w("",!0)])],8,Rn)])):w("",!0)}}),Yn={class:"wb-widget p-0 m-0 shadow"},qn={class:"d-flex justify-content-between"},Qn={class:"m-4 me-0 mb-0"},Zn={class:"p-4 pb-0 ps-0 m-0",style:{"text-align":"right"}},Xn={class:"px-4 pt-4 pb-2 wb-subwidget"},Kn={class:"row"},er={class:"col m-0 p-0"},tr={class:"container-fluid m-0 p-0"},ar={key:0},nr={class:"px-4 py-2 wb-subwidget"},rr={class:"row"},or={class:"col"},sr={class:"container-fluid m-0 p-0"},_t=L({__name:"WBWidget",props:{variableWidth:{type:Boolean},fullWidth:{type:Boolean}},setup(a){const e=a,t=m(()=>e.fullWidth?"col-12":e.variableWidth&&g.preferWideBoxes?"col-lg-6":"col-lg-4");return(r,s)=>(l(),f("div",{class:q(["p-2 m-0 d-flex",t.value])},[n("div",Yn,[n("div",qn,[n("h3",Qn,[pe(r.$slots,"title",{},()=>[s[0]||(s[0]=n("div",{class:"p-0"},"(title goes here)",-1))]),pe(r.$slots,"subtitle")]),n("div",Zn,[pe(r.$slots,"buttons")])]),n("div",Xn,[n("div",Kn,[n("div",er,[n("div",tr,[pe(r.$slots,"default")])])])]),r.$slots.footer!=null?(l(),f("div",ar,[s[1]||(s[1]=n("hr",null,null,-1)),n("div",nr,[n("div",rr,[n("div",or,[n("div",sr,[pe(r.$slots,"footer")])])])])])):w("",!0)])],2))}});class ir{constructor(){b(this,"active",!1);b(this,"etPriceList",new Map);b(this,"etProvider","");b(this,"etMaxPrice",0)}get etCurrentPriceString(){const[e]=re.etPriceList.values();return(Math.round(e*10)/10).toFixed(1)+" ct"}}const re=le(new ir),lr={id:"powermeter",class:"p-0 m-0"},cr=["viewBox"],ur=["transform"],dr=["x"],Ze=500,Ue=20,pa=1,hr=L({__name:"PowerMeter",setup(a){const e=Ze,t=Math.PI/40,r=[[4],[4,6],[1,4,6],[0,2,4,6],[0,2,3,5,6]],s=[{x:-85,y:e/2*1/5},{x:0,y:e/2*1/5},{x:85,y:e/2*1/5},{x:-85,y:e/2*2/5},{x:0,y:e/2*2/5},{x:85,y:e/2*2/5},{x:0,y:e/2*3/5}],o=m(()=>Ze/2-Ue),h=m(()=>{let B="",A=Object.values(Q).filter(V=>V.power>0);return A.length==1&&A[0].name=="PV"?B="Aktueller Verbrauch: ":B="Bezug/Verbrauch: ",B+$e(U.house.power+U.charging.power+U.devices.power+U.batIn.power,g.decimalPlaces)}),d=m(()=>{let B=Q.pv.power+Q.evuIn.power+Q.batOut.power;return g.maxPower>B?$e(g.maxPower,g.decimalPlaces):$e(B,g.decimalPlaces)}),u=m(()=>Object.values(O)),p=m(()=>{let B=0;return g.showRelativeArcs&&(B=g.maxPower-(Q.pv.power+Q.evuIn.power+Q.batOut.power)),B<0?0:B}),c=m(()=>[U.evuOut,U.charging,U.devices,U.batIn,U.house].filter(B=>B.power>0)),k=m(()=>r[c.value.length-1]);function P(B){return s[k.value[B]]}function z(B){return B.length>12?B.slice(0,11)+".":B}const D=m(()=>{const[B]=re.etPriceList.values();return Math.round(B*10)/10});return(B,A)=>(l(),$(_t,{"full-width":!0},{title:_(()=>A[0]||(A[0]=[H(" Aktuelle Leistung ")])),default:_(()=>[n("figure",lr,[(l(),f("svg",{viewBox:"0 0 "+Ze+" "+i(e)},[n("g",{transform:"translate("+Ze/2+","+i(e)/2+")"},[v(Dn,{radius:o.value,"corner-radius":pa,"circle-gap-size":t,"empty-power":p.value},null,8,["radius","empty-power"]),v(jn,{"sh-device":i(ae),radius:o.value,"corner-radius":pa,"circle-gap-size":t,"empty-power":p.value},null,8,["sh-device","radius","empty-power"]),v(Ae,{x:0,y:-i(e)/10*2,data:i(Q).pv,props:i(ie).pv,anchor:"middle",config:i(g)},null,8,["y","data","props","config"]),v(Ae,{x:0,y:-i(e)/10*3,data:i(Q).evuIn,props:i(ie).evuIn,anchor:"middle",config:i(g)},null,8,["y","data","props","config"]),v(Ae,{x:0,y:-i(e)/10,data:i(Q).batOut,props:i(ie).batOut,anchor:"middle",config:i(g)},null,8,["y","data","props","config"]),i(re).active?(l(),$(Ae,{key:0,x:0,y:-i(e)/10,data:i(Q).batOut,props:i(ie).batOut,anchor:"middle",config:i(g)},null,8,["y","data","props","config"])):w("",!0),(l(!0),f(F,null,te(c.value,(V,J)=>(l(),$(Ae,{key:J,x:P(J).x,y:P(J).y,data:V,labelicon:V.icon,labelcolor:V.color,anchor:"middle",config:i(g)},null,8,["x","y","data","labelicon","labelcolor","config"]))),128)),i(me)[0]!=null&&i(Y)[i(me)[0]]!=null?(l(),$(Ae,{key:1,x:-500/2-Ue/4+10,y:-i(e)/2+Ue+5,labeltext:z(i(Y)[i(me)[0]].name)+": "+Math.round(i(Y)[i(me)[0]].soc)+"%",labelcolor:u.value[0]?u.value[0].color:"var(--color-charging)",anchor:"start",config:i(g)},null,8,["x","y","labeltext","labelcolor","config"])):w("",!0),i(me)[1]!=null&&i(Y)[i(me)[1]]!=null?(l(),$(Ae,{key:2,x:Ze/2+Ue/4-10,y:-i(e)/2+Ue+5,labeltext:z(i(Y)[i(me)[1]].name)+": "+Math.round(i(Y)[i(me)[1]].soc)+"%",labelcolor:u.value[1]?u.value[1].color:"var(--color-charging)",anchor:"end",config:i(g)},null,8,["x","y","labeltext","labelcolor","config"])):w("",!0),i(de).batterySoc>0?(l(),$(Ae,{key:3,x:-500/2-Ue/4+10,y:i(e)/2-Ue+15,labeltext:"Speicher: "+i(de).batterySoc+"%",labelcolor:i(U).batIn.color,anchor:"start",config:i(g)},null,8,["x","y","labeltext","labelcolor","config"])):w("",!0),i(re).active?(l(),$(Ae,{key:4,x:Ze/2+Ue/4-10,y:i(e)/2-Ue+15,value:D.value,labeltext:i(re).etCurrentPriceString,labelcolor:"var(--color-charging)",anchor:"end",config:i(g)},null,8,["x","y","value","labeltext","config"])):w("",!0),v(Ae,{x:0,y:0,labeltext:h.value,labelcolor:"var(--color-fg)",anchor:"middle",config:i(g)},null,8,["labeltext","config"]),i(g).showRelativeArcs?(l(),f("text",{key:5,x:Ze/2-44,y:"2","text-anchor":"middle",fill:"var(--color-axis)","font-size":"12"}," Peak: "+S(d.value),9,dr)):w("",!0)],8,ur)],8,cr))])]),_:1}))}}),pr=["origin","origin2","transform"],gr=L({__name:"PgSourceGraph",props:{width:{},height:{},margin:{}},setup(a){const e=a,t={house:"var(--color-house)",batIn:"var(--color-battery)",inverter:"var(--color-pv)",batOut:"var(--color-battery)",selfUsage:"var(--color-pv)",pv:"var(--color-pv)",evuOut:"var(--color-export)",evuIn:"var(--color-evu)"};var r,s;const o=g.showAnimations?g.animationDuration:0,h=g.showAnimations?g.animationDelay:0,d=m(()=>{const M=ce("g#pgSourceGraph");if(y.data.length>0){y.graphMode=="month"||y.graphMode=="year"?J(M,Je.value):V(M,Be.value),M.selectAll(".axis").remove();const E=M.append("g").attr("class","axis");E.call(D.value),E.selectAll(".tick").attr("font-size",12),E.selectAll(".tick line").attr("stroke",A.value).attr("stroke-width",B.value),E.select(".domain").attr("stroke","var(--color-bg)")}return"pgSourceGraph.vue"}),u=m(()=>xa().value((M,E)=>M[E]??0).keys(k.value)),p=m(()=>u.value(y.data)),c=m(()=>He().range([e.height-10,0]).domain(y.graphMode=="year"?[0,Math.ceil(P.value[1]*10)/10]:[0,Math.ceil(P.value[1])])),k=m(()=>{let M=[];const E=["batOut","evuIn"];if(g.showInverters){const I=/pv\d+/;y.data.length>0&&(M=Object.keys(y.data[0]).reduce((x,G)=>(G.match(I)&&x.push(G),x),[]))}switch(y.graphMode){case"live":return g.showInverters?["pv","batOut","evuIn"]:["selfUsage","evuOut","batOut","evuIn"];case"today":case"day":return M.forEach((I,x)=>{t[I]="var(--color-pv"+(x+1)+")"}),g.showInverters?[...M,...E]:["selfUsage","evuOut","batOut","evuIn"];default:return["evuIn","batOut","selfUsage","evuOut"]}}),P=m(()=>{let M=Ve(y.data,E=>Math.max(E.pv+E.evuIn+E.batOut,E.selfUsage+E.evuOut));return M[0]!=null&&M[1]!=null?(y.graphMode=="year"&&(M[0]=M[0]/1e3,M[1]=M[1]/1e3),M):[0,0]}),z=m(()=>y.graphMode=="month"||y.graphMode=="year"?-e.width-e.margin.right-22:-e.width),D=m(()=>ft(c.value).tickSizeInner(z.value).ticks(4).tickFormat(M=>(M==0?"":Math.round(M*10)/10).toLocaleString(void 0))),B=m(()=>g.showGrid?"0.5":"1"),A=m(()=>g.showGrid?"var(--color-grid)":"var(--color-bg)");function V(M,E){const I=nt().x((G,xe)=>E(y.data[xe].date)).y(c.value(0)).curve(rt),x=nt().x((G,xe)=>E(y.data[xe].date)).y0(G=>c.value(y.graphMode=="year"?G[0]/1e3:G[0])).y1(G=>c.value(y.graphMode=="year"?G[1]/1e3:G[1])).curve(rt);mt?(M.selectAll("*").remove(),r=M.append("svg").attr("x",0).attr("width",e.width).selectAll(".sourceareas").data(p.value).enter().append("path").attr("fill",(xe,W)=>t[k.value[W]]).attr("d",xe=>I(xe)),r.transition().duration(o).delay(h).ease(dt).attr("d",xe=>x(xe)),ia()):r.data(p.value).transition().duration(0).ease(dt).attr("d",G=>x(G))}function J(M,E){y.data.length>0&&(mt?(M.selectAll("*").remove(),s=M.selectAll(".sourcebar").data(p.value).enter().append("g").attr("fill",(I,x)=>t[k.value[x]]).selectAll("rect").data(I=>I).enter().append("rect").attr("x",(I,x)=>E(y.data[x].date)??0).attr("y",()=>c.value(0)).attr("height",0).attr("width",E.bandwidth()),s.transition().duration(o).delay(h).ease(dt).attr("height",I=>y.graphMode=="year"?c.value(I[0]/1e3)-c.value(I[1]/1e3):c.value(I[0])-c.value(I[1])).attr("y",I=>y.graphMode=="year"?c.value(I[1]/1e3):c.value(I[1])),ia()):(M.selectAll("*").remove(),s=M.selectAll(".sourcebar").data(p.value).enter().append("g").attr("fill",(I,x)=>t[k.value[x]]).selectAll("rect").data(I=>I).enter().append("rect").attr("x",(I,x)=>E(y.data[x].date)??0).attr("y",I=>y.graphMode=="year"?c.value(I[1]/1e3):c.value(I[1])).attr("width",E.bandwidth()).attr("height",I=>y.graphMode=="year"?c.value(I[0]/1e3)-c.value(I[1]/1e3):c.value(I[0])-c.value(I[1]))))}const C=m(()=>{const M=ce("g#pgSourceGraph");if(y.graphMode!="month"&&y.graphMode!="year"&&y.data.length>0){Be.value.range(Ye.value);const E=nt().x((I,x)=>Be.value(y.data[x].date)).y0(I=>c.value(I[0])).y1(I=>c.value(I[1])).curve(rt);M.selectAll("path").attr("d",I=>I?E(I):""),M.selectAll("g#sourceToolTips").select("rect").attr("x",I=>Be.value(I.date)).attr("width",e.width/y.data.length)}return"zoomed"});return(M,E)=>(l(),f("g",{id:"pgSourceGraph",origin:d.value,origin2:C.value,transform:"translate("+M.margin.left+","+M.margin.top+")"},null,8,pr))}}),mr=["origin","origin2","transform"],fr=L({__name:"PgUsageGraph",props:{width:{},height:{},margin:{},stackOrder:{}},setup(a){const e=a,t=m(()=>g.showInverters?[["house","charging","devices","batIn"],["charging","devices","batIn","house"],["devices","batIn","charging","house"],["batIn","charging","house","devices"]]:[["house","charging","devices","batIn","evuOut"],["charging","devices","batIn","house","evuOut"],["devices","batIn","charging","house","evuOut"],["batIn","charging","house","devices","evuOut"]]),r={house:"var(--color-house)",charging:"var(--color-charging)",batIn:"var(--color-battery)",batOut:"var(--color-battery)",selfUsage:"var(--color-pv)",evuOut:"var(--color-export)",evuIn:"var(--color-evu)",cp0:"var(--color-cp0)",cp1:"var(--color-cp1)",cp2:"var(--color-cp2)",cp3:"var(--color-cp3)",sh1:"var(--color-sh1)",sh2:"var(--color-sh2)",sh3:"var(--color-sh3)",sh4:"var(--color-sh4)",devices:"var(--color-devices)"};var s,o;const h=g.showAnimations?g.animationDuration:0,d=g.showAnimations?g.animationDelay:0,u=m(()=>{const C=ce("g#pgUsageGraph");y.graphMode=="month"||y.graphMode=="year"?V(C):A(C),C.selectAll(".axis").remove();const M=C.append("g").attr("class","axis");return M.call(B.value),M.selectAll(".tick").attr("font-size",12).attr("color","var(--color-axis)"),g.showGrid?M.selectAll(".tick line").attr("stroke","var(--color-grid)").attr("stroke-width","0.5"):M.selectAll(".tick line").attr("stroke","var(--color-bg)"),M.select(".domain").attr("stroke","var(--color-bg)"),"pgUsageGraph.vue"}),p=m(()=>xa().value((C,M)=>C[M]??0).keys(P.value)),c=m(()=>p.value(y.data)),k=m(()=>He().range([e.height+10,2*e.height]).domain(y.graphMode=="year"?[0,Math.ceil(z.value[1]*10)/10]:[0,Math.ceil(z.value[1])])),P=m(()=>{if(y.graphMode!="today"&&y.graphMode!="day"&&y.graphMode!="live")return t.value[e.stackOrder];{const C=t.value[e.stackOrder].slice(),M=C.indexOf("charging");C.splice(M,1);const E=/cp\d+/;let I=[];return y.data.length>0&&(I=Object.keys(y.data[0]).reduce((x,G)=>(G.match(E)&&x.push(G),x),[])),I.forEach((x,G)=>{var xe;C.splice(M+G,0,x),r[x]=((xe=O[+x.slice(2)])==null?void 0:xe.color)??"black"}),g.showInverters&&C.push("evuOut"),C}}),z=m(()=>{let C=Ve(y.data,M=>M.house+M.charging+M.batIn+M.devices+M.evuOut);return C[0]!=null&&C[1]!=null?(y.graphMode=="year"&&(C[0]=C[0]/1e3,C[1]=C[1]/1e3),C):[0,0]}),D=m(()=>y.graphMode=="month"||y.graphMode=="year"?-e.width-e.margin.right-22:-e.width),B=m(()=>ft(k.value).tickSizeInner(D.value).ticks(4).tickFormat(C=>(C==0?"":Math.round(C*10)/10).toLocaleString(void 0)));function A(C){const M=nt().x((I,x)=>Be.value(y.data[x].date)).y(k.value(0)).curve(rt),E=nt().x((I,x)=>Be.value(y.data[x].date)).y0(I=>k.value(I[0])).y1(I=>k.value(I[1])).curve(rt);g.showAnimations?it?(C.selectAll("*").remove(),s=C.append("svg").attr("x",0).attr("width",e.width).selectAll(".usageareas").data(c.value).enter().append("path").attr("d",x=>M(x)).attr("fill",(x,G)=>r[P.value[G]]),s.transition().duration(300).delay(100).ease(dt).attr("d",x=>E(x)),ca()):(C.selectAll("*").remove(),C.append("svg").attr("x",0).attr("width",e.width).selectAll(".usageareas").data(c.value).enter().append("path").attr("d",x=>E(x)).attr("fill",(x,G)=>r[P.value[G]])):(C.selectAll("*").remove(),C.append("svg").attr("x",0).attr("width",e.width).selectAll(".usageareas").data(c.value).enter().append("path").attr("d",x=>E(x)).attr("fill",(x,G)=>r[P.value[G]]))}function V(C){it?(C.selectAll("*").remove(),o=C.selectAll(".usagebar").data(c.value).enter().append("g").attr("fill",(M,E)=>r[t.value[e.stackOrder][E]]).selectAll("rect").data(M=>M).enter().append("rect").attr("x",(M,E)=>Je.value(y.data[E].date)??0).attr("y",()=>k.value(0)).attr("height",0).attr("width",Je.value.bandwidth()),o.transition().duration(h).delay(d).ease(dt).attr("y",M=>y.graphMode=="year"?k.value(M[0]/1e3):k.value(M[0])).attr("height",M=>y.graphMode=="year"?k.value(M[1]/1e3)-k.value(M[0]/1e3):k.value(M[1])-k.value(M[0])),ca()):(C.selectAll("*").remove(),o=C.selectAll(".usagebar").data(c.value).enter().append("g").attr("fill",(M,E)=>r[t.value[e.stackOrder][E]]).selectAll("rect").data(M=>M).enter().append("rect").attr("x",(M,E)=>Je.value(y.data[E].date)??0).attr("y",M=>y.graphMode=="year"?k.value(M[0]/1e3):k.value(M[0])).attr("height",M=>y.graphMode=="year"?k.value(M[1]/1e3)-k.value(M[0]/1e3):k.value(M[1])-k.value(M[0])).attr("width",Je.value.bandwidth()))}const J=m(()=>{const C=ce("g#pgUsageGraph");if(y.graphMode!="month"&&y.graphMode!="year"){Be.value.range(Ye.value);const M=nt().x((E,I)=>Be.value(y.data[I].date)).y0(E=>k.value(E[0])).y1(E=>k.value(E[1])).curve(rt);C.selectAll("path").attr("d",E=>E?M(E):"")}return"zoomed"});return(C,M)=>(l(),f("g",{id:"pgUsageGraph",origin:u.value,origin2:J.value,transform:"translate("+C.margin.left+","+C.margin.top+")"},null,8,mr))}}),vr=["width"],yr=["transform"],br=["x","width"],_r=["transform"],wr=["origin","origin2","transform"],kr=["origin","transform"],xr={key:0},Sr=["width","height"],Mr={key:1},$r=["y","width","height"],Bt=12,Pr=L({__name:"PgXAxis",props:{width:{},height:{},margin:{}},setup(a){const e=a,t=m(()=>ht(Be.value).ticks(6).tickSizeInner(h.value).tickFormat(st("%H:%M"))),r=m(()=>Ja(Be.value).ticks(6).tickSizeInner(h.value+3).tickFormat(st(""))),s=m(()=>ht(Je.value).ticks(4).tickSizeInner(h.value).tickFormat(c=>c.toString())),o=m(()=>ht(Je.value).ticks(4).tickSizeInner(h.value).tickFormat(()=>"")),h=m(()=>y.graphMode!=="month"&&y.graphMode!=="year"?g.showGrid?-(e.height/2-7):-10:0),d=m(()=>{let c=ce("g#PGXAxis"),k=ce("g#PgUnit");return c.selectAll("*").remove(),k.selectAll("*").remove(),y.graphMode=="month"||y.graphMode=="year"?c.call(s.value):c.call(t.value),c.selectAll(".tick > text").attr("fill",(P,z)=>z>=0||y.graphMode=="month"||y.graphMode=="year"?"var(--color-axis)":"var(--color-bg)").attr("font-size",Bt),g.showGrid?c.selectAll(".tick line").attr("stroke","var(--color-grid)").attr("stroke-width","0.5"):c.selectAll(".tick line").attr("stroke","var(--color-bg)"),c.select(".domain").attr("stroke","var(--color-bg)"),k.append("text").attr("x",0).attr("y",12).attr("fill","var(--color-axis)").attr("font-size",Bt).text(y.graphMode=="year"?"MW":"kW").attr("text-anchor","start"),"PGXAxis.vue"}),u=m(()=>{let c=ce("g#PGXAxis2");return c.selectAll("*").remove(),y.graphMode=="month"||y.graphMode=="year"?c.call(o.value):c.call(r.value),c.selectAll(".tick > text").attr("fill",(k,P)=>P>=0||y.graphMode=="month"||y.graphMode=="year"?"var(--color-axis)":"var(--color-bg)").attr("font-size",Bt),g.showGrid?(c.selectAll(".tick line").attr("stroke","var(--color-grid)").attr("stroke-width","0.5"),c.select(".domain").attr("stroke","var(--color-bg)")):c.selectAll(".tick line").attr("stroke","var(--color-bg)"),c.select(".domain").attr("stroke","var(--color-bg)"),"PGXAxis2.vue"}),p=m(()=>{if(y.graphMode!="month"&&y.graphMode!="year"){const c=ce("g#PGXAxis"),k=ce("g#PGXAxis2");y.graphMode=="month"||y.graphMode=="year"?(Je.value.range(Ye.value),c.call(s.value),k.call(o.value)):(Be.value.range(Ye.value),c.call(t.value),k.call(r.value))}return"zoomed"});return(c,k)=>(l(),f(F,null,[(l(),f("svg",{x:"0",width:e.width},[n("g",{id:"PgUnit",transform:"translate(0,"+(c.height/2+9)+")"},null,8,yr)],8,vr)),(l(),f("svg",{x:e.margin.left,width:e.width},[n("g",{transform:"translate("+c.margin.left+","+c.margin.top+")"},[n("g",{id:"PGXAxis",class:"axis",origin:d.value,origin2:p.value,transform:"translate(0,"+(c.height/2-6)+")"},null,8,wr),n("g",{id:"PGXAxis2",class:"axis",origin:u.value,transform:"translate(0,"+(c.height/2+10)+")"},null,8,kr),i(g).showGrid?(l(),f("g",xr,[n("rect",{x:"0",y:"0",width:c.width,height:c.height/2-10,fill:"none",stroke:"var(--color-grid)","stroke-width":"0.5"},null,8,Sr)])):w("",!0),i(g).showGrid?(l(),f("g",Mr,[n("rect",{x:"0",y:c.height/2+10,width:c.width,height:c.height/2-10,fill:"none",stroke:"var(--color-grid)","stroke-width":"0.5"},null,8,$r)])):w("",!0)],8,_r)],8,br))],64))}}),Ir=["width"],Cr=["id",".origin","d"],Br=["id","d","stroke"],Vr=["x","y","text-anchor"],Vt=L({__name:"PgSoc",props:{width:{},height:{},margin:{},order:{}},setup(a){const e=a,t=m(()=>{let P=Ve(y.data,z=>z.date);return P[0]&&P[1]?et().domain(P).range([0,e.width]):et().range([0,0])}),r=m(()=>He().range([e.height-10,0]).domain([0,100])),s=m(()=>{let z=Ne().x(D=>t.value(D.date)).y(D=>r.value(e.order==2?D.batSoc:e.order==0?D["soc"+me.value[0]]:D["soc"+me.value[1]])??r.value(0))(y.data);return z||""}),o=m(()=>e.order),h=m(()=>{switch(e.order){case 2:return"Speicher";case 1:return Y[me.value[1]]!=null?Y[me.value[1]].name:"???";default:return Y[me.value[0]]!=null?Y[me.value[0]].name:"???"}}),d=m(()=>{switch(e.order){case 0:return"var(--color-cp1)";case 1:return"var(--color-cp2)";case 2:return"var(--color-battery)";default:return"red"}}),u=m(()=>{switch(e.order){case 0:return 3;case 1:return e.width-3;case 2:return e.width/2;default:return 0}}),p=m(()=>{if(y.data.length>0){let P;switch(e.order){case 0:return P=y.data.length-1,r.value(y.data[P]["soc"+me.value[0]]+2);case 1:return P=0,r.value(y.data[P]["soc"+me.value[1]]+2);case 2:return P=Math.round(y.data.length/2),r.value(y.data[P].batSoc+2);default:return 0}}else return 0}),c=m(()=>{switch(e.order){case 0:return"start";case 1:return"end";case 2:return"middle";default:return"middle"}}),k=m(()=>{if(y.graphMode!="month"&&y.graphMode!="year"){const P=ce("path#soc-"+o.value),z=ce("path#socdashes-"+o.value);t.value.range(Ye.value);const D=Ne().x(B=>t.value(B.date)).y(B=>r.value(e.order==2?B.batSoc:e.order==1?B["soc"+me.value[0]]:B["soc"+me.value[1]])??r.value(0));P.attr("d",D(y.data)),z.attr("d",D(y.data))}return"zoomed"});return(P,z)=>(l(),f("svg",{x:"0",width:e.width},[n("path",{id:"soc-"+o.value,".origin":k.value,class:"soc-baseline",d:s.value,stroke:"var(--color-bg)","stroke-width":"1",fill:"none"},null,40,Cr),n("path",{id:"socdashes-"+o.value,class:"soc-dashes",d:s.value,stroke:d.value,"stroke-width":"1",style:{strokeDasharray:"3,3"},fill:"none"},null,8,Br),n("text",{class:"cpname",x:u.value,y:p.value,style:K({fill:d.value,fontSize:10}),"text-anchor":c.value},S(h.value),13,Vr)],8,Ir))}}),Lr=["transform"],Or=L({__name:"PgSocAxis",props:{width:{},height:{},margin:{}},setup(a){const e=a,t=m(()=>He().range([e.height-10,0]).domain([0,100])),r=m(()=>Ya(t.value).ticks(5).tickFormat(o=>o.toString()+"%"));function s(){let o=ce("g#PGSocAxis");o.call(r.value),o.selectAll(".tick").attr("font-size",12),o.selectAll(".tick line").attr("stroke","var(--color-bg)"),o.select(".domain").attr("stroke","var(--color-bg)")}return Le(()=>{s()}),(o,h)=>(l(),f("g",{id:"PGSocAxis",class:"axis",transform:"translate("+(o.width-20)+",0)"},null,8,Lr))}}),Ar={class:"d-flex align-self-top justify-content-center align-items-center"},Tr={class:"input-group input-group-xs"},Er={key:0,class:"btn dropdown-toggle",type:"button","data-bs-toggle":"dropdown"},zr={class:"dropdown-menu"},Wr={class:"table optiontable"},Dr=["onClick"],Gr={key:1,class:"btn dropdown-toggle",type:"button","data-bs-toggle":"dropdown"},jr={class:"dropdown-menu"},Ur={class:"table optiontable"},Fr=["onClick"],Nr={key:2,class:"btn dropdown-toggle",type:"button","data-bs-toggle":"dropdown"},Hr={class:"dropdown-menu"},Rr={class:"table optiontable"},Jr=["onClick"],Yr=L({__name:"DateInput",props:{modelValue:{type:Date,required:!0},mode:{type:String,default:"day"}},emits:["update:modelValue"],setup(a,{emit:e}){const t=a,r=new Date().getFullYear();let s=Array.from({length:10},(z,D)=>r-D);const o=ee(!0),h=e,d=[[0,1,2,3],[4,5,6,7],[8,9,10,11]],u=ee(t.modelValue.getDate()),p=ee(t.modelValue.getMonth()),c=ee(t.modelValue.getFullYear()),k=m(()=>{const D=new Date(c.value,p.value,1).getDay();let B=0;switch(p.value){case 1:case 3:case 5:case 7:case 8:case 10:case 12:B=31;break;case 4:case 6:case 9:case 11:B=30;break;case 2:Math.trunc(c.value/4)*4==c.value?B=29:B=28}let A=[],V=[0,0,0,0,0,0,0],J=D;for(let C=0;C(l(),f("span",Ar,[n("div",Tr,[t.mode=="day"||t.mode=="today"?(l(),f("button",Er,S(u.value),1)):w("",!0),n("div",zr,[n("table",Wr,[(l(!0),f(F,null,te(k.value,(B,A)=>(l(),f("tr",{key:A,class:""},[(l(!0),f(F,null,te(B,(V,J)=>(l(),f("td",{key:J},[V!=0?(l(),f("span",{key:0,type:"button",class:"btn optionbutton",onClick:C=>u.value=V},S(V),9,Dr)):w("",!0)]))),128))]))),128))])]),t.mode!="year"&&t.mode!="live"?(l(),f("button",Gr,S(p.value+1),1)):w("",!0),n("div",jr,[n("table",Ur,[(l(),f(F,null,te(d,(B,A)=>n("tr",{key:A,class:""},[(l(!0),f(F,null,te(B,(V,J)=>(l(),f("td",{key:J,class:"p-0 m-0"},[n("span",{type:"button",class:"btn btn-sm optionbutton",onClick:C=>p.value=V},S(V+1),9,Fr)]))),128))])),64))])]),t.mode!="live"?(l(),f("button",Nr,S(c.value),1)):w("",!0),n("div",Hr,[n("table",Rr,[(l(!0),f(F,null,te(i(s),(B,A)=>(l(),f("tr",{key:A,class:""},[n("td",null,[n("span",{type:"button",class:"btn optionbutton",onClick:V=>c.value=B},S(B),9,Jr)])]))),128))])]),t.mode!="live"?(l(),f("button",{key:3,class:"button-outline-secondary",type:"button",onClick:P},D[0]||(D[0]=[n("span",{class:"fa-solid fa-circle-check"},null,-1)]))):w("",!0)])]))}}),R=(a,e)=>{const t=a.__vccOpts||a;for(const[r,s]of e)t[r]=s;return t},qr=R(Yr,[["__scopeId","data-v-98690e5d"]]),Qr={class:"btn-group m-0",role:"group","aria-label":"radiobar"},Zr=["id","value"],Xr=L({__name:"RadioBarInput",props:{options:{},modelValue:{}},emits:["update:modelValue"],setup(a,{emit:e}){const t=a,r=e,s=m({get(){return t.modelValue},set(d){r("update:modelValue",d)}});function o(d){let u=t.options[d].color?t.options[d].color:"var(--color-fg)";return t.options[d].active?{color:"var(--color-bg)",background:u}:{color:u}}function h(d){let u=d.target;for(;u&&!u.value&&u.parentElement;)u=u.parentElement;u.value&&(s.value=u.value)}return(d,u)=>(l(),f("div",null,[n("div",Qr,[(l(!0),f(F,null,te(d.options,(p,c)=>(l(),f("button",{id:"radio-"+p.value,key:c,class:q(["btn btn-outline-secondary btn-sm radiobutton mx-0 mb-0 px-2",p.value==s.value?"active":""]),value:p.value,style:K(o(c)),onClick:h},[n("span",{style:K(o(c))},[p.icon?(l(),f("i",{key:0,class:q(["fa-solid",p.icon])},null,2)):w("",!0),H(" "+S(p.text),1)],4)],14,Zr))),128))])]))}}),Oa=R(Xr,[["__scopeId","data-v-82ab6829"]]),Kr=L({__name:"PgSelector",props:{widgetid:{},showLeftButton:{type:Boolean},showRightButton:{type:Boolean},ignoreLive:{type:Boolean}},emits:["shiftLeft","shiftRight","shiftUp","shiftDown"],setup(a){const e=a,t=ee(0),r=m(()=>{if(y.waitForData)return"Lädt";switch(y.graphMode){case"live":return e.ignoreLive?"heute":`${ge.duration} min`;case"today":return"heute";case"day":return ue.date.getDate()+"."+(ue.date.getMonth()+1)+".";case"month":return Fn(Ee.month-1,Ee.year);case"year":return Re.year.toString();default:return"???"}}),s=["live","today","day","month","year"],o=["Live","Heute","Tag","Monat","Jahr"],h=m({get(){return y.graphMode},set(J){switch(J){case"day":k();break;case"today":P();break;case"live":c();break;case"month":z();break;case"year":D()}}}),d=m(()=>{switch(y.graphMode){case"live":case"today":return ue.getDate();case"month":return Ee.getDate();default:return ue.getDate()}});function u(J){da(J)}function p(){t.value+=1,t.value>2&&(t.value=0)}function c(){y.graphMode!="live"&&(y.graphMode="live",fe())}function k(){y.graphMode!="day"&&y.graphMode!="today"&&(y.graphMode="day",fe())}function P(){y.graphMode!="today"&&(y.graphMode="today",da(new Date),fe())}function z(){y.graphMode!="month"&&(y.graphMode="month",fe())}function D(){y.graphMode!="year"&&(y.graphMode="year",fe())}const B=m(()=>t.value>0?{border:"1px solid var(--color-frame)"}:""),A=m(()=>t.value==1?"justify-content-between":"justify-content-end"),V=m(()=>t.value==1?"justify-content-between":"justify-content-center");return(J,C)=>(l(),f("div",{class:"d-flex flex-column justify-content-center pgselector rounded",style:K(B.value)},[t.value==2?(l(),$(Oa,{key:0,id:"pgm2",modelValue:h.value,"onUpdate:modelValue":C[0]||(C[0]=M=>h.value=M),class:"m-2",options:s.map((M,E)=>({text:o[E],value:M,color:"var(--color-menu)",active:M==i(y).graphMode}))},null,8,["modelValue","options"])):w("",!0),t.value==1?(l(),f("span",{key:1,type:"button",class:q(["arrowButton d-flex align-self-center mb-3 mt-3",{disabled:!e.showLeftButton}]),onClick:C[1]||(C[1]=M=>J.$emit("shiftUp"))},C[6]||(C[6]=[n("i",{class:"fa-solid fa-xl fa-chevron-circle-up"},null,-1)]),2)):w("",!0),n("div",{class:q(["d-flex align-items-center",V.value])},[t.value==1?(l(),f("span",{key:0,type:"button",class:q(["p-1",{disabled:!e.showLeftButton}]),onClick:C[2]||(C[2]=M=>J.$emit("shiftLeft"))},C[7]||(C[7]=[n("span",{class:"fa-solid fa-xl fa-chevron-circle-left arrowButton"},null,-1)]),2)):w("",!0),t.value<2?(l(),f("span",{key:1,type:"button",class:"btn-outline-secondary p-2 px-3 badge rounded-pill datebadge",onClick:p},S(r.value),1)):w("",!0),t.value==2?(l(),$(qr,{key:2,"model-value":d.value,mode:i(y).graphMode,"onUpdate:modelValue":u},null,8,["model-value","mode"])):w("",!0),t.value==1?(l(),f("span",{key:3,id:"graphRightButton",type:"button",class:q(["arrowButton fa-solid fa-xl fa-chevron-circle-right p-1",{disabled:!e.showRightButton}]),onClick:C[3]||(C[3]=M=>J.$emit("shiftRight"))},null,2)):w("",!0)],2),n("div",{class:q(["d-flex align-items-center",A.value])},[t.value==1?(l(),f("span",{key:0,type:"button",class:"p-1",onClick:p},C[8]||(C[8]=[n("span",{class:"fa-solid fa-xl fa-gear"},null,-1)]))):w("",!0),t.value==1?(l(),f("span",{key:1,id:"graphLeftButton",type:"button",class:q(["arrowButton fa-solid fa-xl fa-chevron-circle-down p-1",{disabled:!e.showLeftButton}]),onClick:C[4]||(C[4]=M=>J.$emit("shiftDown"))},null,2)):w("",!0),t.value>0?(l(),f("span",{key:2,type:"button",class:"p-1",onClick:C[5]||(C[5]=M=>t.value=0)},C[9]||(C[9]=[n("span",{class:"fa-solid fa-xl fa-circle-check"},null,-1)]))):w("",!0)],2)],4))}}),na=R(Kr,[["__scopeId","data-v-d75ec1a4"]]),eo=["x","fill"],to=["x"],Ie=L({__name:"PgToolTipLine",props:{cat:{},name:{},indent:{},power:{},width:{}},setup(a){const e=a;return(t,r)=>(l(),f(F,null,[t.power>0?(l(),f("tspan",{key:0,x:t.indent,dy:"1.3em",class:q(t.name?"":"fas"),fill:i(ie)[t.cat].color},S(t.name?t.name:i(ie)[t.cat].icon)+"   ",11,eo)):w("",!0),n("tspan",{"text-anchor":"end",x:t.width-t.indent},[e.power>0?(l(),$(bt,{key:0,watt:t.power*1e3},null,8,["watt"])):w("",!0)],8,to)],64))}}),ao=["transform"],no=["width","height"],ro={"text-anchor":"start",x:"5",y:"20","font-size":"16",fill:"var(--color-fg)"},oo=["x"],so=L({__name:"PgToolTipItem",props:{entry:{},boxwidth:{},xScale:{type:[Function,Object]}},setup(a){const e=a,t=m(()=>Object.values(e.entry).filter(u=>u>0).length),r=m(()=>t.value*16),s=m(()=>Object.entries(e.entry).filter(([u,p])=>u.startsWith("pv")&&u.length>2&&p>0).map(([u,p])=>({power:p,name:Fe.value.get(u)?d(Fe.value.get(u)):"Wechselr.",id:u}))),o=m(()=>Object.entries(e.entry).filter(([u,p])=>u.startsWith("cp")&&u.length>2&&p>0).map(([u,p])=>({power:p,name:Fe.value.get(u)?d(Fe.value.get(u)):"Ladep.",id:u}))),h=m(()=>Object.entries(e.entry).filter(([u,p])=>u.startsWith("sh")&&u.length>2&&p>0).map(([u,p])=>({power:p,name:Fe.value.get(u)?d(Fe.value.get(u)):"Gerät",id:u})));function d(u){return u.length>6?u.slice(0,6)+"...":u}return(u,p)=>(l(),f("g",{class:"ttmessage",transform:"translate("+u.xScale(u.entry.date)+",0)"},[n("rect",{rx:"5",width:u.boxwidth,height:r.value,fill:"var(--color-bg)",opacity:"80%",stroke:"var(--color-menu)"},null,8,no),n("text",ro,[n("tspan",{"text-anchor":"middle",x:u.boxwidth/2,dy:"0em"},S(i(st)("%H:%M")(new Date(u.entry.date))),9,oo),p[0]||(p[0]=n("line",{y:"120",x1:"5",x2:"100",stroke:"var(--color-fg)","stroke-width":"1"},null,-1)),v(Ie,{cat:"evuIn",indent:5,power:u.entry.evuIn,width:u.boxwidth},null,8,["power","width"]),v(Ie,{cat:"batOut",indent:5,power:u.entry.batOut,width:u.boxwidth},null,8,["power","width"]),v(Ie,{cat:"pv",indent:5,power:u.entry.pv,width:u.boxwidth},null,8,["power","width"]),(l(!0),f(F,null,te(s.value,c=>(l(),$(Ie,{key:c.id,cat:"pv",name:c.name,power:c.power,indent:10,width:u.boxwidth},null,8,["name","power","width"]))),128)),v(Ie,{cat:"house",indent:5,power:u.entry.house,width:u.boxwidth},null,8,["power","width"]),v(Ie,{cat:"charging",indent:5,power:u.entry.charging,width:u.boxwidth},null,8,["power","width"]),(l(!0),f(F,null,te(o.value,c=>(l(),$(Ie,{key:c.id,cat:"charging",name:c.name,power:c.power,indent:10,width:u.boxwidth},null,8,["name","power","width"]))),128)),v(Ie,{cat:"devices",indent:5,power:u.entry.devices,width:u.boxwidth},null,8,["power","width"]),(l(!0),f(F,null,te(h.value,c=>(l(),$(Ie,{key:c.id,cat:"devices",name:c.name,power:c.power,indent:10,width:u.boxwidth},null,8,["name","power","width"]))),128)),v(Ie,{cat:"batIn",indent:5,power:u.entry.batIn,width:u.boxwidth},null,8,["power","width"]),v(Ie,{cat:"evuOut",indent:5,power:u.entry.evuOut,width:u.boxwidth},null,8,["power","width"])])],8,ao))}}),io=["origin","transform"],lo=["x","height","width"],ga=140,co=L({__name:"PgToolTips",props:{width:{},height:{},margin:{},data:{}},setup(a){const e=a,t=m(()=>{const o=Ve(e.data,h=>new Date(h.date));return o[0]&&o[1]?Ft().domain(o).range([0,e.width-e.margin.right]):et().range([0,0])}),r=m(()=>{const o=Ve(e.data,h=>new Date(h.date));return o[0]&&o[1]?Ft().domain(o).range([0,e.width-e.margin.right-ga]):et().range([0,0])}),s=m(()=>((y.graphMode=="day"||y.graphMode=="today")&&(t.value.range(Ye.value),ce("g#pgToolTips").selectAll("g.ttarea").select("rect").attr("x",(o,h)=>e.data.length>h?t.value(e.data[h].date):0).attr("width",e.data.length>0?(Ye.value[1]-Ye.value[0])/e.data.length:0)),"PgToolTips.vue:autozoom"));return(o,h)=>(l(),f("g",{id:"pgToolTips",origin:s.value,transform:"translate("+o.margin.left+","+o.margin.top+")"},[(l(!0),f(F,null,te(o.data,d=>(l(),f("g",{key:d.date,class:"ttarea"},[n("rect",{x:t.value(d.date),y:"0",height:o.height,class:"ttrect",width:i(y).data.length>0?o.width/i(y).data.length:0,opacity:"1%",fill:"var(--color-charging)"},null,8,lo),v(so,{entry:d,boxwidth:ga,"x-scale":r.value},null,8,["entry","x-scale"])]))),128))],8,io))}}),uo={class:"d-flex justify-content-end"},ho={id:"powergraphFigure",class:"p-0 m-0"},po=["viewBox"],go=["transform"],mo=["x","y"],fo=2,vo="Leistung / Ladestand ",yo=L({__name:"PowerGraph",setup(a){function e(){let h=g.usageStackOrder+1;h>fo&&(h=0),g.usageStackOrder=h,xn(!0)}function t(h){const d=[[0,j.top],[be,Se-j.top]];h.call(Qa().scaleExtent([1,8]).translateExtent([[0,0],[be,Se]]).extent(d).filter(s).on("zoom",r))}function r(h){Ca.value=h.transform}function s(h){return h.preventDefault(),(!h.ctrlKey||h.type==="wheel")&&!h.button}function o(){g.zoomedWidget=1,g.zoomGraph=!g.zoomGraph}return Le(()=>{const h=ce("svg#powergraph");t(h)}),(h,d)=>(l(),$(_t,{"full-width":!0},{title:_(()=>[H(S(vo))]),buttons:_(()=>[n("div",uo,[v(na,{widgetid:"graphsettings","show-left-button":!0,"show-right-button":!0,"ignore-live":!1,onShiftLeft:i(It),onShiftRight:i(Kt),onShiftUp:i(ea),onShiftDown:i(ta)},null,8,["onShiftLeft","onShiftRight","onShiftUp","onShiftDown"]),i(De)?(l(),f("span",{key:0,type:"button",class:"ms-1 p-0 pt-1",onClick:o},d[0]||(d[0]=[n("span",{class:"fa-solid fa-lg ps-1 fa-magnifying-glass"},null,-1)]))):w("",!0)])]),default:_(()=>[vt(n("figure",ho,[(l(),f("svg",{id:"powergraph",class:"powergraphSvg",viewBox:"0 0 "+i(be)+" "+i(Se)},[v(gr,{width:i(be)-i(j).left-2*i(j).right,height:(i(Se)-i(j).top-i(j).bottom)/2,margin:i(j)},null,8,["width","height","margin"]),v(fr,{width:i(be)-i(j).left-2*i(j).right,height:(i(Se)-i(j).top-i(j).bottom)/2,margin:i(j),"stack-order":i(g).usageStackOrder},null,8,["width","height","margin","stack-order"]),v(Pr,{width:i(be)-i(j).left-2*i(j).right,height:i(Se)-i(j).top-i(j).bottom,margin:i(j)},null,8,["width","height","margin"]),n("g",{transform:"translate("+i(j).left+","+i(j).top+")"},[(i(y).graphMode=="day"||i(y).graphMode=="today"||i(y).graphMode=="live")&&Object.values(i(Y)).filter(u=>u.visible).length>0?(l(),$(Vt,{key:0,width:i(be)-i(j).left-2*i(j).right,height:(i(Se)-i(j).top-i(j).bottom)/2,margin:i(j),order:0},null,8,["width","height","margin"])):w("",!0),(i(y).graphMode=="day"||i(y).graphMode=="today"||i(y).graphMode=="live")&&Object.values(i(Y)).filter(u=>u.visible).length>1?(l(),$(Vt,{key:1,width:i(be)-i(j).left-2*i(j).right,height:(i(Se)-i(j).top-i(j).bottom)/2,margin:i(j),order:1},null,8,["width","height","margin"])):w("",!0),(i(y).graphMode=="day"||i(y).graphMode=="today"||i(y).graphMode=="live")&&i(de).isBatteryConfigured?(l(),$(Vt,{key:2,width:i(be)-i(j).left-2*i(j).right,height:(i(Se)-i(j).top-i(j).bottom)/2,margin:i(j),order:2},null,8,["width","height","margin"])):w("",!0),i(y).graphMode=="day"||i(y).graphMode=="today"||i(y).graphMode=="live"?(l(),$(Or,{key:3,width:i(be)-i(j).left-i(j).right,height:(i(Se)-i(j).top-i(j).bottom)/2,margin:i(j)},null,8,["width","height","margin"])):w("",!0)],8,go),i(y).graphMode=="day"||i(y).graphMode=="today"?(l(),$(co,{key:0,width:i(be)-i(j).left-i(j).right,height:i(Se)-i(j).top-i(j).bottom,margin:i(j),data:i(y).data},null,8,["width","height","margin","data"])):w("",!0),n("g",{id:"button",type:"button",onClick:e},[n("text",{x:i(be)-10,y:i(Se)-10,color:"var(--color-menu)","text-anchor":"end"},d[1]||(d[1]=[n("tspan",{fill:"var(--color-menu)",class:"fas fa-lg"},S(""),-1)]),8,mo)])],8,po))],512),[[qa,i(y).data.length>0]])]),_:1}))}}),bo=R(yo,[["__scopeId","data-v-7cbcf9ef"]]),_o=["id"],wo=["x","width","height","fill"],ko=["x","width","height"],xo=["x","y","width","height"],So=L({__name:"EmBar",props:{item:{},xScale:{},yScale:{},margin:{},height:{},barcount:{},autarchy:{},autText:{}},setup(a){const e=a,t=m(()=>e.height-e.yScale(e.item.energy)-e.margin.top-e.margin.bottom),r=m(()=>{let o=0;return e.item.energyPv>0&&(o=e.height-e.yScale(e.item.energyPv)-e.margin.top-e.margin.bottom),o>t.value&&(o=t.value),o}),s=m(()=>{let o=0;return e.item.energyBat>0&&(o=e.height-e.yScale(e.item.energyBat)-e.margin.top-e.margin.bottom),o>t.value&&(o=t.value),o});return(o,h)=>(l(),f("g",{id:"bar-"+e.item.name,transform:"scale(1,-1) translate (0,-445)"},[n("rect",{class:"bar",x:e.xScale(o.item.name),y:"0",width:e.xScale.bandwidth(),height:t.value,fill:o.item.color},null,8,wo),n("rect",{class:"bar",x:e.xScale(o.item.name)+e.xScale.bandwidth()/6,y:"0",width:e.xScale.bandwidth()*2/3,height:r.value,fill:"var(--color-pv)","fill-opacity":"66%"},null,8,ko),n("rect",{class:"bar",x:e.xScale(o.item.name)+e.xScale.bandwidth()/6,y:r.value,width:e.xScale.bandwidth()*2/3,height:s.value,fill:"var(--color-battery)","fill-opacity":"66%"},null,8,xo)],8,_o))}}),Mo={id:"emBargraph"},$o=L({__name:"EMBarGraph",props:{plotdata:{},xScale:{},yScale:{},margin:{},height:{}},setup(a){const e=a;function t(s){if(s.name=="PV"){const o=y.graphMode=="live"||y.graphMode=="day"?Q:T.items,d=(y.graphMode=="live"||y.graphMode=="day"?U:T.items).evuOut.energy,u=o.pv.energy;return Math.round((u-d)/u*100)}else if(s.name=="Netz"){const o=y.graphMode=="live"||y.graphMode=="day"?Q:T.items,h=y.graphMode=="live"||y.graphMode=="day"?U:T.items,d=h.evuOut.energy,u=o.evuIn.energy,p=o.pv.energy,c=o.batOut.energy,k=h.batIn.energy;return Math.round((p+c-d-k)/(p+c+u-d-k)*100)}else return s.pvPercentage}function r(s){return s.name=="PV"?"Eigen":"Aut"}return(s,o)=>(l(),f("g",Mo,[(l(!0),f(F,null,te(e.plotdata,(h,d)=>(l(),f("g",{key:d},[v(So,{item:h,"x-scale":e.xScale,"y-scale":e.yScale,margin:e.margin,height:e.height,barcount:e.plotdata.length,"aut-text":r(h),autarchy:t(h)},null,8,["item","x-scale","y-scale","margin","height","barcount","aut-text","autarchy"])]))),128)),o[0]||(o[0]=n("animateTransform",{"attribute-name":"transform",type:"scale",from:"1 0",to:"1 1",begin:"0s",dur:"2s"},null,-1))]))}}),Po=["origin"],Io=L({__name:"EMYAxis",props:{yScale:{type:[Function,Object]},width:{},fontsize:{}},setup(a){const e=a,t=m(()=>ft(e.yScale).tickFormat(o=>s(o)).ticks(6).tickSizeInner(-e.width)),r=m(()=>{const o=ce("g#emYAxis");return o.attr("class","axis").call(t.value),o.append("text").attr("y",6).attr("dy","0.71em").attr("text-anchor","end").text("energy"),o.selectAll(".tick").attr("font-size",e.fontsize),g.showGrid?o.selectAll(".tick line").attr("stroke","var(--color-grid)").attr("stroke-width","0.5"):o.selectAll(".tick line").attr("stroke","var(--color-bg)"),o.select(".domain").attr("stroke","var(--color-bg)"),"emYAxis.vue"});function s(o){return o>0?y.graphMode=="year"?(o/1e6).toString():(o/1e3).toString():""}return(o,h)=>(l(),f("g",{id:"emYAxis",class:"axis",origin:r.value},null,8,Po))}}),Co=["id"],Bo=["x","y","font-size"],Vo=["x","y","font-size","fill"],Lo=["x","y","font-size","fill"],Oo=L({__name:"EmLabel",props:{item:{},xScale:{},yScale:{},margin:{},height:{},barcount:{},autarchy:{},autText:{}},setup(a){const e=a,t=m(()=>e.autarchy?e.yScale(e.item.energy)-25:e.yScale(e.item.energy)-10),r=m(()=>{let u=16,p=e.barcount;return p<=5?u=16:p==6?u=14:p>6&&p<=8?u=13:p==9?u=11:p==10?u=10:u=9,u}),s=m(()=>{let u=12,p=e.barcount;return p<=5?u=12:p==6?u=11:p>6&&p<=8||p==9?u=8:p==10?u=7:u=6,u});function o(u,p){return p.length>s.value?p.substring(0,s.value)+".":p}function h(){return e.autarchy?e.autText+": "+e.autarchy.toLocaleString(void 0)+" %":""}function d(){return"var(--color-pv)"}return(u,p)=>(l(),f("g",{id:"barlabel-"+e.item.name},[n("text",{x:e.xScale(u.item.name)+e.xScale.bandwidth()/2,y:t.value,"font-size":r.value,"text-anchor":"middle",fill:"var(--color-menu)"},S(i(ct)(u.item.energy,i(g).decimalPlaces,!1)),9,Bo),n("text",{x:e.xScale(u.item.name)+e.xScale.bandwidth()/2,y:e.yScale(u.item.energy)-10,"font-size":r.value-2,"text-anchor":"middle",fill:d()},S(h()),9,Vo),n("text",{x:e.xScale(u.item.name)+e.xScale.bandwidth()/2,y:e.height-e.margin.bottom-5,"font-size":r.value,"text-anchor":"middle",fill:u.item.color,class:q(u.item.icon.length<=2?"fas":"")},S(o(u.item.name,u.item.icon)),11,Lo)],8,Co))}}),Ao={id:"emBarLabels"},To=L({__name:"EMLabels",props:{plotdata:{},xScale:{},yScale:{},height:{},margin:{}},setup(a){const e=a;function t(s){if(s.name=="PV"){const o=y.graphMode=="live"||y.graphMode=="today"?Q:T.items,d=(y.graphMode=="live"||y.graphMode=="today"?U:T.items).evuOut.energy,u=o.pv.energy;return Math.round((u-d)/u*100)}else if(s.name=="Netz"){const o=y.graphMode=="live"||y.graphMode=="today"?Q:T.items,h=y.graphMode=="live"||y.graphMode=="today"?U:T.items,d=h.evuOut.energy,u=o.evuIn.energy,p=o.pv.energy,c=o.batOut.energy,k=h.batIn.energy;return p+c-d-k>0?Math.round((p+c-d-k)/(p+c+u-d-k)*100):0}else return s.pvPercentage}function r(s){return s.name=="PV"?"Eigen":"Aut"}return(s,o)=>(l(),f("g",Ao,[(l(!0),f(F,null,te(e.plotdata,(h,d)=>(l(),f("g",{key:d},[v(Oo,{item:h,"x-scale":e.xScale,"y-scale":e.yScale,margin:e.margin,height:e.height,barcount:e.plotdata.length,"aut-text":r(h),autarchy:t(h)},null,8,["item","x-scale","y-scale","margin","height","barcount","aut-text","autarchy"])]))),128))]))}}),Eo={class:"d-flex justify-content-end"},zo={id:"energymeter",class:"p-0 m-0"},Wo={viewBox:"0 0 500 500"},Do=["transform"],Go=["x"],jo={key:0},ma=500,Lt=500,fa=12,Uo="Energie",Fo=L({__name:"EnergyMeter",setup(a){const e={top:25,bottom:30,left:25,right:0},t=m(()=>{let u=Object.values(Q),p=o.value;const c=T.items;let k=[];switch(g.debug&&h(),lt.value==!0&&(lt.value=!1),y.graphMode){default:case"live":case"today":k=u.concat(p);break;case"day":case"month":case"year":Object.values(c).length==0?qe.value=!0:(qe.value=!1,k=[c.evuIn,c.pv,c.evuOut,c.batOut,c.charging],Object.values(O).length>1&&Object.keys(O).forEach(P=>{c["cp"+P]&&k.push(c["cp"+P])}),k.push(c.devices),ae.forEach((P,z)=>{P.showInGraph&&c["sh"+z]&&k.push(c["sh"+z])}),k=k.concat([c.batIn,c.house]))}return k.filter(P=>P.energy&&P.energy>0)}),r=m(()=>xt().range([0,ma-e.left-e.right]).domain(t.value.map(u=>u.name)).padding(.4)),s=m(()=>He().range([Lt-e.bottom-e.top,15]).domain([0,Sa(t.value,u=>u.energy)])),o=m(()=>{const u=Object.values(O).length,p=[...ae.values()].filter(k=>k.configured).length;let c=U;return[...[c.evuOut,c.charging].concat(u>1?Object.values(O).map(k=>k.toPowerItem()):[]),...[c.devices].concat(p>1?[...ae.values()].filter(k=>k.configured&&k.showInGraph):[]).concat([U.batIn,U.house])]});function h(){console.debug(["source summary:",Q]),console.debug(["usage details:",o.value]),console.debug(["historic summary:",T])}function d(){g.zoomedWidget=2,g.zoomGraph=!g.zoomGraph}return(u,p)=>(l(),$(_t,{"full-width":!0},{title:_(()=>[H(S(Uo))]),buttons:_(()=>[n("div",Eo,[v(na,{widgetid:"graphsettings","show-left-button":!0,"show-right-button":!0,"ignore-live":!0,onShiftLeft:i(It),onShiftRight:i(Kt),onShiftUp:i(ea),onShiftDown:i(ta)},null,8,["onShiftLeft","onShiftRight","onShiftUp","onShiftDown"]),i(De)?(l(),f("span",{key:0,type:"button",class:"ms-1 p-0 pt-1",onClick:d},p[0]||(p[0]=[n("span",{class:"fa-solid fa-lg ps-1 fa-magnifying-glass"},null,-1)]))):w("",!0)])]),default:_(()=>[n("figure",zo,[(l(),f("svg",Wo,[n("g",{transform:"translate("+e.left+","+e.top+")"},[v($o,{plotdata:t.value,"x-scale":r.value,"y-scale":s.value,height:Lt,margin:e},null,8,["plotdata","x-scale","y-scale"]),v(Io,{"y-scale":s.value,width:ma,fontsize:fa,config:i(g)},null,8,["y-scale","config"]),n("text",{x:-e.left,y:"-15",fill:"var(--color-axis)","font-size":fa},S(i(y).graphMode=="year"?"MWh":"kWh"),9,Go),v(To,{plotdata:t.value,"x-scale":r.value,"y-scale":s.value,height:Lt,margin:e,config:i(g)},null,8,["plotdata","x-scale","y-scale","config"])],8,Do)]))]),i(qe)?(l(),f("p",jo,"No data")):w("",!0)]),_:1}))}}),No=R(Fo,[["__scopeId","data-v-32c82102"]]),Ho=["id"],Ro=["y","width","fill"],Jo=["y","width"],Yo=["y","x","width"],qo=L({__name:"EnergyBar",props:{id:{},item:{},yScale:{},xScale:{},itemHeight:{}},setup(a){const e=a,t=m(()=>e.xScale(e.item.energy)),r=m(()=>{let o=0;return e.item.energyPv>0&&(o=e.xScale(e.item.energyPv)),o>t.value&&(o=t.value),o}),s=m(()=>{let o=0;return e.item.energyBat>0&&(o=e.xScale(e.item.energyBat)),o>t.value&&(o=t.value),o});return(o,h)=>(l(),f("g",{id:`bar-${e.item.name}`},[n("rect",{class:"bar",y:e.yScale(e.id)+e.itemHeight/2-4,x:"0",rx:"6",ry:"6",height:"12",width:t.value,fill:o.item.color},null,8,Ro),n("rect",{class:"bar",y:e.yScale(e.id)+e.itemHeight/2+10,x:"0",rx:"3",ry:"3",height:"7",width:r.value,fill:"var(--color-pv)","fill-opacity":"100%"},null,8,Jo),n("rect",{class:"bar",y:e.yScale(e.id)+e.itemHeight/2+10,x:r.value,rx:"3",ry:"3",height:"7",width:s.value,fill:"var(--color-battery)","fill-opacity":"100%"},null,8,Yo)],8,Ho))}}),Qo={id:"emBargraph"},Zo=L({__name:"BarGraph",props:{plotdata:{},yscale:{},xscale:{},itemHeight:{}},setup(a){const e=a;return(t,r)=>(l(),f("g",Qo,[(l(!0),f(F,null,te(e.plotdata,(s,o)=>(l(),f("g",{key:o},[v(qo,{id:o.toString(),item:s,"x-scale":e.xscale,"y-scale":e.yscale,"item-height":t.itemHeight},null,8,["id","item","x-scale","y-scale","item-height"])]))),128))]))}}),Xo=["id"],Ko=["y","x","fill"],es=["y","x"],ts=["y","x","font-size"],Ot=24,as=L({__name:"EnergyLabel",props:{id:{},item:{},yscale:{},margin:{},width:{},itemHeight:{},autarchy:{},autText:{}},setup(a){const e=a,t=m(()=>e.yscale(e.id)+e.itemHeight/3);function r(){return e.autarchy?e.autText+": "+e.autarchy.toLocaleString(void 0)+" %":""}function s(o){return o.length>14?o.slice(0,13)+"...":o}return(o,h)=>(l(),f("g",{id:"barlabel-"+e.id},[n("text",{y:t.value,x:e.margin.left,"font-size":Ot,"text-anchor":"start",fill:o.item.color,class:q(o.item.icon.length<=2?"fas":"")},S(s(e.item.icon)),11,Ko),n("text",{y:t.value,x:e.width/2+e.margin.left,"font-size":Ot,"text-anchor":"middle",fill:"var(--color-menu)"},S(i(ct)(o.item.energy,i(g).decimalPlaces,!1)),9,es),n("text",{y:t.value,x:e.width-e.margin.right,"font-size":Ot-2,"text-anchor":"end",fill:"var(--color-pv)"},S(r()),9,ts)],8,Xo))}}),ns={id:"emBarLabels"},rs=L({__name:"EnergyLabels",props:{plotdata:{},yscale:{},width:{},itemHeight:{},margin:{}},setup(a){const e=a;function t(s){if(s.name=="PV"){const o=y.graphMode=="live"||y.graphMode=="today"?Q:T.items,d=(y.graphMode=="live"||y.graphMode=="today"?U:T.items).evuOut.energy,u=o.pv.energy;return Math.round((u-d)/u*100)}else if(s.name=="Netz"){const o=y.graphMode=="live"||y.graphMode=="today"?Q:T.items,h=y.graphMode=="live"||y.graphMode=="today"?U:T.items,d=h.evuOut.energy,u=o.evuIn.energy,p=o.pv.energy,c=o.batOut.energy,k=h.batIn.energy;return p+c-d-k>0?Math.round((p+c-d-k)/(p+c+u-d-k)*100):0}else return s.pvPercentage}function r(s){return s.name=="PV"?"Eigen":"Aut"}return(s,o)=>(l(),f("g",ns,[(l(!0),f(F,null,te(e.plotdata,(h,d)=>(l(),f("g",{key:d},[v(as,{id:d.toString(),item:h,yscale:e.yscale,margin:e.margin,width:e.width,"item-height":s.itemHeight,"aut-text":r(h),autarchy:t(h)},null,8,["id","item","yscale","margin","width","item-height","aut-text","autarchy"])]))),128))]))}});class os{constructor(e){b(this,"id");b(this,"name","Speicher");b(this,"color","var(--color-battery)");b(this,"dailyYieldExport",0);b(this,"dailyYieldImport",0);b(this,"monthlyYieldExport",0);b(this,"monthlyYieldImport",0);b(this,"yearlyYieldExport",0);b(this,"yearlyYieldImport",0);b(this,"exported",0);b(this,"faultState",0);b(this,"faultStr","");b(this,"imported",0);b(this,"power",0);b(this,"soc",0);this.id=e}}class ss{constructor(){b(this,"dailyExport",0);b(this,"dailyImport",0);b(this,"exported",0);b(this,"imported",0);b(this,"power",0);b(this,"soc",0)}}le(new ss);const he=ee(new Map),Aa=a=>{he.value.set(a,new os(a)),he.value.get(a).color=ie["bat"+he.value.size].color};function is(){he.value=new Map}const ls={class:"d-flex justify-content-end"},cs={id:"energymeter",class:"p-0 m-0"},us=["viewBox"],ds=["transform"],hs=["x"],ps={key:0},va=500,At=60,gs=12,ms="Energie",fs=L({__name:"EnergyMeter2",setup(a){const e={top:0,bottom:30,left:0,right:0},t=m(()=>r.value.length*At+e.top+e.bottom),r=m(()=>{let c=Object.values(Q),k=h.value;const P=T.items;let z=[];switch(g.debug&&u(),lt.value==!0&&(lt.value=!1),y.graphMode){default:case"live":case"today":z=d(c).concat(k);break;case"day":case"month":case"year":Object.values(P).length==0?qe.value=!0:(qe.value=!1,z=[P.evuIn,P.pv,P.evuOut,P.batOut,P.charging],Object.values(O).length>1&&Object.keys(O).forEach(D=>{P["cp"+D]&&z.push(P["cp"+D])}),z.push(P.devices),ae.forEach((D,B)=>{D.showInGraph&&P["sh"+B]&&z.push(P["sh"+B])}),z=z.concat([P.batIn,P.house]))}return z.filter(D=>D.energy&&D.energy>0)}),s=m(()=>He().range([0,va-e.left-e.right]).domain([0,Sa(r.value,c=>c.energy)])),o=m(()=>xt().range([e.top,t.value-e.bottom]).domain(r.value.map((c,k)=>k.toString())).padding(.1)),h=m(()=>{const c=Object.values(O).length,k=[...ae.values()].filter(z=>z.configured).length;let P=U;return[...[P.evuOut,P.charging].concat(c>1?Object.values(O).map(z=>z.toPowerItem()):[]),...[P.devices].concat(k>1?[...ae.values()].filter(z=>z.configured&&z.showInGraph):[]).concat([U.batIn,U.house])]});function d(c){let k=0;return we.value.size>1&&we.value.forEach(P=>{c.splice(2+k++,0,{name:P.name,power:P.power,energy:P.energy,energyPv:0,energyBat:0,pvPercentage:0,color:P.color,icon:P.name,showInGraph:!0})}),he.value.size>1&&he.value.forEach(P=>{c.splice(3+k++,0,{name:P.name,power:P.power,energy:P.dailyYieldExport,energyPv:0,energyBat:0,pvPercentage:0,color:P.color,icon:P.name,showInGraph:!0})}),c}function u(){console.debug(["source summary:",Q]),console.debug(["usage details:",h.value]),console.debug(["historic summary:",T])}function p(){g.zoomedWidget=2,g.zoomGraph=!g.zoomGraph}return(c,k)=>(l(),$(_t,{"full-width":!0},{title:_(()=>[H(S(ms))]),buttons:_(()=>[n("div",ls,[v(na,{widgetid:"graphsettings","show-left-button":!0,"show-right-button":!0,"ignore-live":!0,onShiftLeft:i(It),onShiftRight:i(Kt),onShiftUp:i(ea),onShiftDown:i(ta)},null,8,["onShiftLeft","onShiftRight","onShiftUp","onShiftDown"]),i(De)?(l(),f("span",{key:0,type:"button",class:"ms-1 p-0 pt-1",onClick:p},k[0]||(k[0]=[n("span",{class:"fa-solid fa-lg ps-1 fa-magnifying-glass"},null,-1)]))):w("",!0)])]),default:_(()=>[n("figure",cs,[(l(),f("svg",{viewBox:"0 0 500 "+t.value},[n("g",{transform:"translate("+e.left+","+e.top+")"},[v(Zo,{plotdata:r.value,xscale:s.value,yscale:o.value,"item-height":At},null,8,["plotdata","xscale","yscale"]),n("text",{x:-e.left,y:"-15",fill:"var(--color-axis)","font-size":gs},S(i(y).graphMode=="year"?"MWh":"kWh"),9,hs),v(rs,{plotdata:r.value,yscale:o.value,width:va,"item-height":At,margin:e},null,8,["plotdata","yscale"])],8,ds)],8,us))]),i(qe)?(l(),f("p",ps,"No data")):w("",!0)]),_:1}))}}),vs=R(fs,[["__scopeId","data-v-63a4748e"]]),ys={class:"d-flex flex-column align-items-center justify-content-start infoitem"},bs=L({__name:"InfoItem",props:{heading:{},small:{type:Boolean}},setup(a){const e=a,t=m(()=>e.small?{"font-size":"var(--font-small)"}:{"font-size":"var(--font-small)"}),r=m(()=>e.small?{"font-size":"var(--font-small)"}:{"font-size":"var(--font-normal)"}),s=m(()=>e.small?"mt-0":"mt-1");return(o,h)=>(l(),f("span",ys,[n("span",{class:q(["d-flex heading",s.value]),style:K(t.value)},S(e.heading),7),n("span",{class:"d-flex my-0 me-0 align-items-center content",style:K(r.value)},[pe(o.$slots,"default",{},void 0,!0)],4)]))}}),X=R(bs,[["__scopeId","data-v-f6af00e8"]]),_s={class:"d-flex justify-content-between align-items-center titlerow"},ws={class:"buttonrea d-flex float-right justify-content-end align-items-center"},ks={class:"contentrow grid-col-12"},xs=L({__name:"WbSubwidget",props:{titlecolor:{},fullwidth:{type:Boolean},small:{type:Boolean}},setup(a){const e=a,t=m(()=>{let s={"font-weight":"bold",color:"var(--color-fg)","font-size":"var(--font-normal)"};return e.titlecolor&&(s.color=e.titlecolor),e.small&&(s["font-size"]="var(--font-verysmall)"),s}),r=m(()=>e.fullwidth?"grid-col-12":"grid-col-4");return(s,o)=>(l(),f("div",{class:q(["wb-subwidget px-3 pt-2 my-0",r.value])},[n("div",_s,[n("div",{class:"d-flex widgetname p-0 m-0",style:K(t.value)},[pe(s.$slots,"title",{},void 0,!0)],4),n("div",ws,[pe(s.$slots,"buttons",{},void 0,!0)])]),n("div",ks,[pe(s.$slots,"default",{},void 0,!0)])],2))}}),tt=R(xs,[["__scopeId","data-v-e989060d"]]),Ss={class:"grid-col-12 mt-2 mb-0 px-0 py-0 configitem"},Ms={class:"titlecolumn m-0 p-0 d-flex align-items-center"},$s={class:"ms-1 mb-2 p-0 pt-2 d-flex justify-content-stretch align-items-center"},Ps={class:"justify-content-stretch d-flex"},Is=L({__name:"ConfigItem",props:{title:{},infotext:{},icon:{},fullwidth:{type:Boolean}},setup(a){const e=a,t=ee(!1);function r(){t.value=!t.value}const s=m(()=>{let o={color:"var(--color-charging)"};return t.value&&(o.color="var(--color-battery)"),o});return(o,h)=>(l(),$(tt,{fullwidth:!!o.fullwidth},{default:_(()=>[n("div",Ss,[n("div",Ms,[n("span",{class:"d-flex align-items-baseline m-0 p-0",onClick:r},[e.icon?(l(),f("i",{key:0,class:q(["fa-solid fa-sm m-0 p-0 me-2 item-icon",e.icon])},null,2)):w("",!0),H(" "+S(o.title),1)]),n("span",null,[e.infotext?(l(),f("i",{key:0,class:"fa-solid fa-sm fa-circle-question ms-4 me-2",style:K(s.value),onClick:r},null,4)):w("",!0)])]),t.value?(l(),f("p",{key:0,class:"infotext shadow m-0 ps-2 mb-1 p-1",onClick:r},[h[0]||(h[0]=n("i",{class:"me-1 fa-solid fa-sm fa-circle-info"},null,-1)),H(" "+S(o.infotext),1)])):w("",!0),n("div",$s,[n("span",Ps,[pe(o.$slots,"default",{},void 0,!0)])])])]),_:3},8,["fullwidth"]))}}),N=R(Is,[["__scopeId","data-v-b935eb33"]]),Cs={class:"d-flex flex-column"},Bs={class:"d-flex flex-fill justify-content-between align-items-center"},Vs={class:"d-flex flex-fill flex-column justify-content-center m-0 p-0"},Ls={key:0,id:"rangeIndicator",class:"rangeIndicator"},Os={viewBox:"0 0 100 2"},As=["width"],Ts=["x","width"],Es=["x","width"],zs=["id","min","max","step"],Ws={class:"d-flex justify-content-between align-items-center"},Ds={class:"minlabel ps-4"},Gs={class:"valuelabel"},js={class:"maxlabel pe-4"},Us=L({__name:"RangeInput",props:{id:{},min:{},max:{},step:{},unit:{},decimals:{},showSubrange:{type:Boolean},subrangeMin:{},subrangeMax:{},modelValue:{}},emits:["update:modelValue"],setup(a,{emit:e}){const t=a,r=t.decimals??0,s=e,o=m({get(){return Math.round(t.modelValue*Math.pow(10,r))/Math.pow(10,r)},set(k){s("update:modelValue",k)}});function h(){o.value>t.min&&(o.value=Math.round((o.value-t.step)*Math.pow(10,r))/Math.pow(10,r))}function d(){o.valueHe().domain([t.min,t.max]).range([0,100])),p=m(()=>u.value(t.subrangeMin?t.subrangeMin:0)),c=m(()=>t.subrangeMin&&t.subrangeMax?u.value(t.subrangeMax)-u.value(t.subrangeMin):0);return(k,P)=>(l(),f("span",Cs,[n("span",Bs,[n("span",{type:"button",class:"minusButton",onClick:h},P[1]||(P[1]=[n("i",{class:"fa fa-xl fa-minus-square me-2"},null,-1)])),n("div",Vs,[t.showSubrange?(l(),f("figure",Ls,[(l(),f("svg",Os,[n("g",null,[n("rect",{class:"below",x:0,y:"0",width:p.value,height:"2",rx:"1",ry:"1",fill:"var(--color-evu)"},null,8,As),n("rect",{class:"bar",x:p.value,y:"0",width:c.value,height:"2",rx:"1",ry:"1",fill:"var(--color-charging)"},null,8,Ts),n("rect",{class:"above",x:p.value+c.value,y:"0",width:p.value,height:"2",rx:"1",ry:"1",fill:"var(--color-pv)"},null,8,Es)])]))])):w("",!0),vt(n("input",{id:k.id,"onUpdate:modelValue":P[0]||(P[0]=z=>o.value=z),type:"range",class:"form-range flex-fill",min:k.min,max:k.max,step:k.step},null,8,zs),[[Za,o.value,void 0,{number:!0}]])]),n("span",{type:"button",class:"plusButton",onClick:d},P[2]||(P[2]=[n("i",{class:"fa fa-xl fa-plus-square ms-2"},null,-1)]))]),n("span",Ws,[n("span",Ds,S(k.min),1),n("span",Gs,S(o.value)+" "+S(k.unit),1),n("span",js,S(k.max),1)])]))}}),Me=R(Us,[["__scopeId","data-v-267ede95"]]),Fs=["id","value"],Ns=L({__name:"RadioInput",props:{options:{},modelValue:{}},emits:["update:modelValue"],setup(a,{emit:e}){const t=a,r=e,s=m({get(){return t.modelValue},set(d){r("update:modelValue",d)}});function o(d){return t.options[d][2]?{color:t.options[d][2]}:{color:"var(--color-fg)"}}function h(d){let u=d.target;for(;u&&!u.value&&u.parentElement;)u=u.parentElement;u.value&&(s.value=u.value)}return(d,u)=>(l(),f("div",null,[(l(!0),f(F,null,te(d.options,(p,c)=>(l(),f("button",{id:"radio-"+p[1],key:c,class:q(["btn btn-outline-secondary radiobutton me-2 mb-0 px-2",p[1]==s.value?"active":""]),value:p[1],style:K(o(c)),onClick:h},[n("span",{style:K(o(c))},[p[3]?(l(),f("i",{key:0,class:q(["fa-solid",p[3]])},null,2)):w("",!0),H(" "+S(p[0]),1)],4)],14,Fs))),128))]))}}),We=R(Ns,[["__scopeId","data-v-df222cbe"]]),Hs={class:"mt-2"},Rs={key:0},Js=L({__name:"CPConfigInstant",props:{chargepoint:{}},setup(a){const t=ee(a.chargepoint),r=[{name:"keine",id:"none"},{name:"EV-SoC",id:"soc"},{name:"Energiemenge",id:"amount"}],s=m({get(){return t.value.instantMaxEnergy/1e3},set(o){t.value.instantMaxEnergy=o*1e3}});return(o,h)=>(l(),f("div",Hs,[h[4]||(h[4]=n("p",{class:"heading ms-1"},"Sofortladen:",-1)),v(N,{title:"Stromstärke",icon:"fa-bolt",fullwidth:!0},{default:_(()=>[v(Me,{id:"targetCurrent",modelValue:t.value.instantTargetCurrent,"onUpdate:modelValue":h[0]||(h[0]=d=>t.value.instantTargetCurrent=d),min:6,max:32,step:1,unit:"A"},null,8,["modelValue"])]),_:1}),t.value.instantChargeLimitMode!="none"?(l(),f("hr",Rs)):w("",!0),v(N,{title:"Begrenzung",icon:"fa-hand",fullwidth:!0},{default:_(()=>[v(We,{modelValue:t.value.instantChargeLimitMode,"onUpdate:modelValue":h[1]||(h[1]=d=>t.value.instantChargeLimitMode=d),options:r.map(d=>[d.name,d.id])},null,8,["modelValue","options"])]),_:1}),t.value.instantChargeLimitMode=="soc"?(l(),$(N,{key:1,title:"Maximaler SoC",icon:"fa-sliders",fullwidth:!0},{default:_(()=>[v(Me,{id:"maxSoc",modelValue:t.value.instantTargetSoc,"onUpdate:modelValue":h[2]||(h[2]=d=>t.value.instantTargetSoc=d),min:0,max:100,step:1,unit:"%"},null,8,["modelValue"])]),_:1})):w("",!0),t.value.instantChargeLimitMode=="amount"?(l(),$(N,{key:2,title:"Zu ladende Energie",icon:"fa-sliders",fullwidth:!0},{default:_(()=>[v(Me,{id:"maxEnergy",modelValue:s.value,"onUpdate:modelValue":h[3]||(h[3]=d=>s.value=d),min:0,max:100,step:1,unit:"kWh"},null,8,["modelValue"])]),_:1})):w("",!0)]))}}),Ys=R(Js,[["__scopeId","data-v-0303d179"]]),qs={class:"form-check form-switch"},se=L({__name:"SwitchInput",props:{modelValue:{type:Boolean},onColor:{},offColor:{}},emits:["update:modelValue"],setup(a,{emit:e}){const t=a,r=e,s=m({get(){return t.modelValue},set(h){r("update:modelValue",h)}}),o=m(()=>s.value?{"background-color":"green"}:{"background-color":"white"});return(h,d)=>(l(),f("div",qs,[vt(n("input",{"onUpdate:modelValue":d[0]||(d[0]=u=>s.value=u),class:"form-check-input",type:"checkbox",role:"switch",style:K(o.value)},null,4),[[Ma,s.value]])]))}}),Qs={class:"pt-2"},Zs={key:3},Xs=L({__name:"CPConfigPv",props:{chargepoint:{}},setup(a){const t=ee(a.chargepoint),r=m({get(){return t.value.pvMinCurrent>5},set(h){h?t.value.pvMinCurrent=6:t.value.pvMinCurrent=0}}),s=m({get(){return t.value.pvMinSoc>0},set(h){h?t.value.pvMinSoc=50:t.value.pvMinSoc=0}}),o=m({get(){return t.value.pvMaxSoc<=100},set(h){h?t.value.pvMaxSoc=100:t.value.pvMaxSoc=101}});return(h,d)=>(l(),f("div",Qs,[d[8]||(d[8]=n("p",{class:"heading ms-1"},"PV-Laden:",-1)),v(N,{title:"Ladestand begrenzen",icon:"fa-battery-three-quarters",fullwidth:!0},{default:_(()=>[v(se,{id:"limitSoc",modelValue:o.value,"onUpdate:modelValue":d[0]||(d[0]=u=>o.value=u)},null,8,["modelValue"])]),_:1}),o.value?(l(),$(N,{key:0,title:"...auf maximal...",icon:"fa-battery-three-quarters",fullwidth:!0},{default:_(()=>[v(Me,{id:"maxSoc",modelValue:t.value.pvMaxSoc,"onUpdate:modelValue":d[1]||(d[1]=u=>t.value.pvMaxSoc=u),min:0,max:100,step:1,unit:"%"},null,8,["modelValue"])]),_:1})):w("",!0),v(N,{title:"Einspeisegrenze beachten",icon:"fa-hand",fullwidth:!0},{default:_(()=>[v(se,{modelValue:t.value.pvFeedInLimit,"onUpdate:modelValue":d[2]||(d[2]=u=>t.value.pvFeedInLimit=u)},null,8,["modelValue"])]),_:1}),v(N,{title:"Mindest-Ladestand",icon:"fa-battery-half",infotext:i(Te).minsoc,fullwidth:!0},{default:_(()=>[v(se,{modelValue:s.value,"onUpdate:modelValue":d[3]||(d[3]=u=>s.value=u)},null,8,["modelValue"])]),_:1},8,["infotext"]),s.value?(l(),$(N,{key:1,title:"...bis SoC",fullwidth:!0},{info:_(()=>[H(S(i(Te).minsoc),1)]),default:_(()=>[v(Me,{id:"minSoc",modelValue:t.value.pvMinSoc,"onUpdate:modelValue":d[4]||(d[4]=u=>t.value.pvMinSoc=u),min:0,max:100,step:1,unit:"%"},null,8,["modelValue"])]),_:1})):w("",!0),s.value?(l(),$(N,{key:2,title:"...mit Ladestrom",fullwidth:!0},{default:_(()=>[v(Me,{id:"minSocCurrent",modelValue:t.value.pvMinSocCurrent,"onUpdate:modelValue":d[5]||(d[5]=u=>t.value.pvMinSocCurrent=u),min:6,max:32,step:1,unit:"A"},null,8,["modelValue"])]),_:1})):w("",!0),r.value||s.value?(l(),f("hr",Zs)):w("",!0),v(N,{title:"Minimaler Ladestrom",icon:"fa-bolt",infotext:i(Te).minpv,fullwidth:!0},{default:_(()=>[v(se,{modelValue:r.value,"onUpdate:modelValue":d[6]||(d[6]=u=>r.value=u)},null,8,["modelValue"])]),_:1},8,["infotext"]),r.value?(l(),$(N,{key:4,title:"...bei Ladestrom (minimal)",fullwidth:!0},{default:_(()=>[v(Me,{id:"minCurrent",modelValue:t.value.pvMinCurrent,"onUpdate:modelValue":d[7]||(d[7]=u=>t.value.pvMinCurrent=u),min:6,max:32,step:1,unit:"A"},null,8,["modelValue"])]),_:1})):w("",!0)]))}}),Ks=R(Xs,[["__scopeId","data-v-faa69015"]]),ei={class:"table table-borderless"},ti={class:"tablecell"},ai={class:"tablecell"},ni={class:"tablecell"},ri={class:"tablecell"},oi={class:"tablecell left"},si=["href"],ii=L({__name:"CPConfigScheduled",props:{chargeTemplateId:{}},setup(a){const e={daily:"Täglich",once:"Einmal",weekly:"Wöchentlich"},t=a,r=m(()=>{let d=[];return pt[t.chargeTemplateId]&&(d=Object.values(pt[t.chargeTemplateId])),d});function s(d){return r.value[d].time}function o(d){return{color:r.value[d].active?"var(--color-switchGreen)":"var(--color-switchRed)"}}function h(d){return{"font-weight":r.value[d].active?"bold":"regular"}}return(d,u)=>(l(),f(F,null,[u[1]||(u[1]=n("p",{class:"heading ms-1 pt-2"},"Zielladen:",-1)),n("table",ei,[u[0]||(u[0]=n("thead",null,[n("tr",null,[n("th",{class:"tableheader"},"Ziel"),n("th",{class:"tableheader"},"Limit"),n("th",{class:"tableheader"},"Zeit"),n("th",{class:"tableheader"},"Wiederholung"),n("th",{class:"tableheader"})])],-1)),n("tbody",null,[(l(!0),f(F,null,te(r.value,(p,c)=>(l(),f("tr",{key:c,style:K(h(c))},[n("td",ti,S(p.limit.soc_scheduled)+"%",1),n("td",ai,S(p.limit.soc_limit)+"%",1),n("td",ni,S(s(c)),1),n("td",ri,S(e[p.frequency.selected]),1),n("td",oi,[n("a",{href:"../../settings/#/VehicleConfiguration/charge_template/"+t.chargeTemplateId},[n("span",{class:q([p.active?"fa-toggle-on":"fa-toggle-off","fa"]),style:K(o(c)),type:"button"},null,6)],8,si)])],4))),128))])])],64))}}),li=R(ii,[["__scopeId","data-v-e8f5ad9d"]]),ci={class:"table table-borderless"},ui={class:"tablecell"},di={class:"tablecell"},hi={class:"tablecell"},pi={class:"tablecell"},gi={class:"tablecell left"},mi=["href"],fi=L({__name:"CPConfigTimed",props:{chargeTemplateId:{}},setup(a){const e={daily:"Täglich",once:"Einmal",weekly:"Wöchentlich"},t=a,r=m(()=>gt[t.chargeTemplateId]?Object.values(gt[t.chargeTemplateId])??[]:[]);function s(h){return{color:r.value[h].active?"var(--color-switchGreen)":"var(--color-switchRed)"}}function o(h){return{"font-weight":r.value[h].active?"bold":"regular"}}return(h,d)=>(l(),f(F,null,[d[1]||(d[1]=n("p",{class:"heading ms-1 pt-2"},"Zeitpläne:",-1)),n("table",ci,[d[0]||(d[0]=n("thead",null,[n("tr",null,[n("th",{class:"tableheader"},"Von"),n("th",{class:"tableheader"},"Bis"),n("th",{class:"tableheader"},"Ladestrom"),n("th",{class:"tableheader"},"Wiederholung"),n("th",{class:"tableheader right"})])],-1)),n("tbody",null,[(l(!0),f(F,null,te(r.value,(u,p)=>(l(),f("tr",{key:p,style:K(o(p))},[n("td",ui,S(u.time[0]),1),n("td",di,S(u.time[1]),1),n("td",hi,S(u.current)+" A",1),n("td",pi,S(e[u.frequency.selected]),1),n("td",gi,[n("a",{href:"../../settings/#/VehicleConfiguration/charge_template/"+t.chargeTemplateId},[n("span",{class:q([u.active?"fa-toggle-on":"fa-toggle-off","fa"]),style:K(s(p)),type:"button"},null,6)],8,mi)])],4))),128))])])],64))}}),vi=R(fi,[["__scopeId","data-v-192e287b"]]),yi={class:"settingsheader mt-2 ms-1"},bi=L({__name:"CPConfigVehicle",props:{vehicleId:{}},setup(a){const e=a;return(t,r)=>(l(),f(F,null,[n("p",yi," Profile für "+S(i(Y)[e.vehicleId].name)+": ",1),v(N,{title:"Ladeprofil",icon:"fa-sliders",fullwidth:!0},{default:_(()=>[v(We,{modelValue:i(Y)[e.vehicleId].chargeTemplateId,"onUpdate:modelValue":r[0]||(r[0]=s=>i(Y)[e.vehicleId].chargeTemplateId=s),modelModifiers:{number:!0},options:Object.keys(i(_e)).map(s=>[i(_e)[+s].name,s])},null,8,["modelValue","options"])]),_:1}),v(N,{title:"Fahrzeug-Vorlage",icon:"fa-sliders",fullwidth:!0},{default:_(()=>[v(We,{modelValue:i(Y)[e.vehicleId].evTemplateId,"onUpdate:modelValue":r[1]||(r[1]=s=>i(Y)[e.vehicleId].evTemplateId=s),modelModifiers:{number:!0},options:Object.keys(i(Ht)).map(s=>[i(Ht)[+s].name,s])},null,8,["modelValue","options"])]),_:1})],64))}}),_i=R(bi,[["__scopeId","data-v-fcb57a44"]]),wi={class:"settingsheader mt-2 ms-1"},ki=L({__name:"CPChargeConfig",props:{chargepoint:{}},emits:["closeConfig"],setup(a){const t=a.chargepoint;return(r,s)=>(l(),f(F,null,[n("p",wi," Ladeeinstellungen für "+S(i(t).vehicleName)+": ",1),v(N,{title:"Lademodus",icon:"fa-charging-station",infotext:i(Te).chargemode,fullwidth:!0},{default:_(()=>[v(We,{modelValue:i(t).chargeMode,"onUpdate:modelValue":s[0]||(s[0]=o=>i(t).chargeMode=o),options:Object.keys(i(ye)).map(o=>[i(ye)[o].name,o,i(ye)[o].color,i(ye)[o].icon])},null,8,["modelValue","options"])]),_:1},8,["infotext"]),v(N,{title:"Fahrzeug wechseln",icon:"fa-car",infotext:i(Te).vehicle,fullwidth:!0},{default:_(()=>[v(We,{modelValue:i(t).connectedVehicle,"onUpdate:modelValue":s[1]||(s[1]=o=>i(t).connectedVehicle=o),modelModifiers:{number:!0},options:Object.values(i(Y)).filter(o=>o.visible).map(o=>[o.name,o.id])},null,8,["modelValue","options"])]),_:1},8,["infotext"]),v(N,{title:"Sperren",icon:"fa-lock",infotext:i(Te).locked,fullwidth:!0},{default:_(()=>[v(se,{modelValue:i(t).isLocked,"onUpdate:modelValue":s[2]||(s[2]=o=>i(t).isLocked=o)},null,8,["modelValue"])]),_:1},8,["infotext"]),v(N,{title:"Priorität",icon:"fa-star",infotext:i(Te).priority,fullwidth:!0},{default:_(()=>[v(se,{modelValue:i(t).hasPriority,"onUpdate:modelValue":s[3]||(s[3]=o=>i(t).hasPriority=o)},null,8,["modelValue"])]),_:1},8,["infotext"]),v(N,{title:"Zeitplan",icon:"fa-clock",infotext:i(Te).timeplan,fullwidth:!0},{default:_(()=>[v(se,{modelValue:i(t).timedCharging,"onUpdate:modelValue":s[4]||(s[4]=o=>i(t).timedCharging=o)},null,8,["modelValue"])]),_:1},8,["infotext"]),i(de).isBatteryConfigured?(l(),$(N,{key:0,title:"PV-Priorität",icon:"fa-car-battery",infotext:i(Te).pvpriority,fullwidth:!0},{default:_(()=>[v(We,{modelValue:i(de).pvBatteryPriority,"onUpdate:modelValue":s[5]||(s[5]=o=>i(de).pvBatteryPriority=o),options:i(cn)},null,8,["modelValue","options"])]),_:1},8,["infotext"])):w("",!0),i(re).active?(l(),$(N,{key:1,title:"Strompreisbasiert laden",icon:"fa-money-bill",infotext:i(Te).pricebased,fullwidth:!0},{default:_(()=>[v(se,{modelValue:i(t).etActive,"onUpdate:modelValue":s[6]||(s[6]=o=>i(t).etActive=o)},null,8,["modelValue"])]),_:1},8,["infotext"])):w("",!0)],64))}}),xi=R(ki,[["__scopeId","data-v-e348a34c"]]),Si={class:"providername ms-1"},Mi={class:"container"},$i={id:"pricechart",class:"p-0 m-0"},Pi={viewBox:"0 0 400 300"},Ii=["id","origin","transform"],Ci={key:0,class:"p-3"},Bi={key:1,class:"d-flex justify-content-end"},Vi=["disabled"],at=400,ya=250,ba=12,Li=L({__name:"PriceChart",props:{chargepoint:{},globalview:{type:Boolean}},setup(a){const e=a;let t=e.chargepoint?ee(e.chargepoint.etMaxPrice):ee(0);const r=ee(!1),s=ee(e.chargepoint),o=m({get(){return t.value},set(W){t.value=W,r.value=!0}});function h(){s.value&&(O[s.value.id].etMaxPrice=o.value),r.value=!1}const d=ee(!1),u={top:0,bottom:15,left:20,right:5},p=m(()=>{let W=[];return re.etPriceList.size>0&&re.etPriceList.forEach((Z,Oe)=>{W.push([Oe,Z])}),W}),c=m(()=>p.value.length>1?(at-u.left-u.right)/p.value.length-1:0),k=m(()=>r.value?{background:"var(--color-charging)"}:{background:"var(--color-menu)"}),P=m(()=>{let W=Ve(p.value,Z=>Z[0]);return W[1]&&(W[1]=new Date(W[1]),W[1].setTime(W[1].getTime()+36e5)),et().range([u.left,at-u.right]).domain(W)}),z=m(()=>{let W=[0,0];return p.value.length>0?(W=Ve(p.value,Z=>Z[1]),W[0]=Math.floor(W[0]-1),W[1]=Math.floor(W[1]+1)):W=[0,0],W}),D=m(()=>He().range([ya-u.bottom,0]).domain(z.value)),B=m(()=>{const W=Ne(),Z=[[u.left,D.value(o.value)],[at-u.right,D.value(o.value)]];return W(Z)}),A=m(()=>{const W=Ne(),Z=[[u.left,D.value(g.lowerPriceBound)],[at-u.right,D.value(g.lowerPriceBound)]];return W(Z)}),V=m(()=>{const W=Ne(),Z=[[u.left,D.value(g.upperPriceBound)],[at-u.right,D.value(g.upperPriceBound)]];return W(Z)}),J=m(()=>{const W=Ne(),Z=[[u.left,D.value(0)],[at-u.right,D.value(0)]];return W(Z)}),C=m(()=>ht(P.value).ticks(6).tickSize(5).tickFormat(st("%H:%M"))),M=m(()=>ft(D.value).ticks(z.value[1]-z.value[0]).tickSizeInner(-375).tickFormat(W=>W.toString())),E=m(()=>{d.value==!0;const W=ce("g#"+I.value);W.selectAll("*").remove(),W.selectAll("bar").data(p.value).enter().append("g").append("rect").attr("class","bar").attr("x",Qe=>P.value(Qe[0])).attr("y",Qe=>D.value(Qe[1])).attr("width",c.value).attr("height",Qe=>D.value(z.value[0])-D.value(Qe[1])).attr("fill",Qe=>Qe[1]<=o.value?"var(--color-charging)":"var(--color-axis)");const Oe=W.append("g").attr("class","axis").call(C.value);Oe.attr("transform","translate(0,"+(ya-u.bottom)+")"),Oe.selectAll(".tick").attr("font-size",ba).attr("color","var(--color-bg)"),Oe.selectAll(".tick line").attr("stroke","var(--color-fg)").attr("stroke-width","0.5"),Oe.select(".domain").attr("stroke","var(--color-bg");const wt=W.append("g").attr("class","axis").call(M.value);return wt.attr("transform","translate("+u.left+",0)"),wt.selectAll(".tick").attr("font-size",ba).attr("color","var(--color-bg)"),wt.selectAll(".tick line").attr("stroke","var(--color-bg)").attr("stroke-width","0.5"),wt.select(".domain").attr("stroke","var(--color-bg)"),z.value[0]<0&&W.append("path").attr("d",J.value).attr("stroke","var(--color-fg)"),W.append("path").attr("d",A.value).attr("stroke","green"),W.append("path").attr("d",V.value).attr("stroke","red"),W.append("path").attr("d",B.value).attr("stroke","yellow"),"PriceChart.vue"}),I=m(()=>e.chargepoint?"priceChartCanvas"+e.chargepoint.id:"priceChartCanvasGlobal"),x=m(()=>{let W=[];return re.etPriceList.forEach(Z=>{W.push(Z)}),W.sort((Z,Oe)=>Z-Oe)});function G(){let W=x.value[0];for(let Z of x.value){if(Z>=o.value)break;W=Z}o.value=W}function xe(){let W=x.value[0];for(let Z of x.value)if(Z>o.value){W=Z;break}else W=Z;o.value=W}return Le(()=>{d.value=!d.value}),(W,Z)=>(l(),f(F,null,[Z[3]||(Z[3]=n("p",{class:"settingsheader mt-2 ms-1"},"Preisbasiertes Laden:",-1)),n("p",Si,"Anbieter: "+S(i(re).etProvider),1),Z[4]||(Z[4]=n("hr",null,null,-1)),n("div",Mi,[n("figure",$i,[(l(),f("svg",Pi,[n("g",{id:I.value,origin:E.value,transform:"translate("+u.top+","+u.right+")"},null,8,Ii)]))])]),W.chargepoint!=null?(l(),f("div",Ci,[W.chargepoint.etActive?(l(),$(Me,{key:0,id:"pricechart_local",modelValue:o.value,"onUpdate:modelValue":Z[0]||(Z[0]=Oe=>o.value=Oe),min:Math.floor(x.value[0]-1),max:Math.ceil(x.value[x.value.length-1]+1),step:.1,decimals:1,"show-subrange":!0,"subrange-min":x.value[0],"subrange-max":x.value[x.value.length-1],unit:"ct"},null,8,["modelValue","min","max","subrange-min","subrange-max"])):w("",!0)])):w("",!0),n("div",{class:"d-flex justify-content-between px-3 pb-2 pt-0 mt-0"},[n("button",{type:"button",class:"btn btn-sm jumpbutton",onClick:G},Z[1]||(Z[1]=[n("i",{class:"fa fa-sm fa-arrow-left"},null,-1)])),n("button",{type:"button",class:"btn btn-sm jumpbutton",onClick:xe},Z[2]||(Z[2]=[n("i",{class:"fa fa-sm fa-arrow-right"},null,-1)]))]),W.chargepoint!=null?(l(),f("div",Bi,[n("span",{class:"me-3 pt-0",onClick:h},[n("button",{type:"button",class:"btn btn-secondary",style:K(k.value),disabled:!r.value}," Bestätigen ",12,Vi)])])):w("",!0)],64))}}),Ta=R(Li,[["__scopeId","data-v-8d837517"]]),Oi={class:"status-string"},Ai={style:{color:"red"}},Ti={class:"m-0 mt-4 p-0 grid-col-12 tabarea"},Ei={class:"nav nav-tabs nav-justified mx-1 mt-1",role:"tablist"},zi=["data-bs-target"],Wi=["data-bs-target"],Di=["data-bs-target"],Gi=["data-bs-target"],ji=["data-bs-target"],Ui=["data-bs-target"],Fi=["data-bs-target"],Ni={id:"settingsPanes",class:"tab-content mx-1 p-1 pb-3"},Hi=["id"],Ri=["id"],Ji=["id"],Yi=["id"],qi=["id"],Qi=["id"],Zi=["id"],Xi=L({__name:"CPChargeConfigPanel",props:{chargepoint:{}},emits:["closeConfig"],setup(a){const t=a.chargepoint,r=m(()=>_e[t.chargeTemplate]),s=m(()=>t.id);return Le(()=>{}),(o,h)=>(l(),f(F,null,[v(N,{title:"Status",icon:"fa-info-circle",fullwidth:!0,class:"item"},{default:_(()=>[n("span",Oi,S(i(t).stateStr),1)]),_:1}),i(t).faultState!=0?(l(),$(N,{key:0,title:"Fehler",class:"grid-col-12",icon:"fa-triangle-exclamation"},{default:_(()=>[n("span",Ai,S(i(t).faultStr),1)]),_:1})):w("",!0),n("div",Ti,[n("nav",Ei,[n("a",{class:"nav-link active","data-bs-toggle":"tab","data-bs-target":"#chargeSettings"+s.value},h[0]||(h[0]=[n("i",{class:"fa-solid fa-charging-station"},null,-1)]),8,zi),o.chargepoint.chargeMode=="instant_charging"?(l(),f("a",{key:0,class:"nav-link","data-bs-toggle":"tab","data-bs-target":"#instantSettings"+s.value},h[1]||(h[1]=[n("i",{class:"fa-solid fa-lg fa-bolt"},null,-1)]),8,Wi)):w("",!0),o.chargepoint.chargeMode=="pv_charging"?(l(),f("a",{key:1,class:"nav-link","data-bs-toggle":"tab","data-bs-target":"#pvSettings"+s.value},h[2]||(h[2]=[n("i",{class:"fa-solid fa-solar-panel me-1"},null,-1)]),8,Di)):w("",!0),o.chargepoint.chargeMode=="scheduled_charging"?(l(),f("a",{key:2,class:"nav-link","data-bs-toggle":"tab","data-bs-target":"#scheduledSettings"+s.value},h[3]||(h[3]=[n("i",{class:"fa-solid fa-bullseye me-1"},null,-1)]),8,Gi)):w("",!0),o.chargepoint.timedCharging?(l(),f("a",{key:3,class:"nav-link","data-bs-toggle":"tab","data-bs-target":"#timeSettings"+s.value},h[4]||(h[4]=[n("i",{class:"fa-solid fa-clock"},null,-1)]),8,ji)):w("",!0),n("a",{class:"nav-link","data-bs-toggle":"tab","data-bs-target":"#carSettings"+s.value},h[5]||(h[5]=[n("i",{class:"fa-solid fa-rectangle-list"},null,-1)]),8,Ui),i(re).active&&i(t).etActive?(l(),f("a",{key:4,class:"nav-link","data-bs-toggle":"tab","data-bs-target":"#priceChart"+s.value},h[6]||(h[6]=[n("i",{class:"fa-solid fa-chart-line"},null,-1)]),8,Fi)):w("",!0)]),n("div",Ni,[n("div",{id:"chargeSettings"+s.value,class:"tab-pane active",role:"tabpanel","aria-labelledby":"instant-tab"},[v(xi,{chargepoint:o.chargepoint},null,8,["chargepoint"])],8,Hi),n("div",{id:"instantSettings"+s.value,class:"tab-pane",role:"tabpanel","aria-labelledby":"instant-tab"},[v(Ys,{chargepoint:i(t),vehicles:i(Y),"charge-templates":i(_e)},null,8,["chargepoint","vehicles","charge-templates"])],8,Ri),n("div",{id:"pvSettings"+s.value,class:"tab-pane",role:"tabpanel","aria-labelledby":"pv-tab"},[v(Ks,{chargepoint:i(t),vehicles:i(Y),"charge-templates":i(_e)},null,8,["chargepoint","vehicles","charge-templates"])],8,Ji),n("div",{id:"scheduledSettings"+s.value,class:"tab-pane",role:"tabpanel","aria-labelledby":"scheduled-tab"},[r.value!=null?(l(),$(li,{key:0,"charge-template-id":i(t).chargeTemplate},null,8,["charge-template-id"])):w("",!0)],8,Yi),n("div",{id:"timeSettings"+s.value,class:"tab-pane",role:"tabpanel","aria-labelledby":"time-tab"},[r.value!=null?(l(),$(vi,{key:0,"charge-template-id":i(t).chargeTemplate},null,8,["charge-template-id"])):w("",!0)],8,qi),n("div",{id:"carSettings"+s.value,class:"tab-pane",role:"tabpanel","aria-labelledby":"car-tab"},[i(Y)[i(t).connectedVehicle]!=null?(l(),$(_i,{key:0,"vehicle-id":i(t).connectedVehicle},null,8,["vehicle-id"])):w("",!0)],8,Qi),n("div",{id:"priceChart"+s.value,class:"tab-pane",role:"tabpanel","aria-labelledby":"price-tab"},[i(Y)[i(t).connectedVehicle]!=null?(l(),$(Ta,{key:0,chargepoint:i(t)},null,8,["chargepoint"])):w("",!0)],8,Zi)])])],64))}}),Jt=R(Xi,[["__scopeId","data-v-1164316d"]]),Ki={class:"d-flex justify-content-center align-items-center"},el=L({__name:"BatterySymbol",props:{soc:{},color:{}},setup(a){const e=a,t=m(()=>e.soc<=12?"fa-battery-empty":e.soc<38?"fa-battery-quarter":e.soc<62?"fa-battery-half":e.soc<87?"fa-battery-three-quarters":"fa-battery-full"),r=m(()=>({color:e.color??"var(--color-menu)"}));return(s,o)=>(l(),f("span",Ki,[n("i",{class:q(["fa me-1",t.value]),style:K(r.value)},null,6),H(" "+S(Math.round(s.soc)+"%"),1)]))}}),Ct=R(el,[["__scopeId","data-v-a68c844a"]]),Ge=L({__name:"FormatWattH",props:{wattH:{}},setup(a){const e=a,t=m(()=>ct(e.wattH,g.decimalPlaces));return(r,s)=>(l(),f("span",null,S(t.value),1))}}),tl={class:"wb-widget p-0 m-0 shadow widgetWidth"},al={class:"py-4 px-3 d-flex justify-content-between align-items-center titlerow"},nl={class:"d-flex align-items-center widgetname p-0 m-0"},rl={class:"buttonrea d-flex float-right justify-content-end align-items-center"},ol={class:"grid12 pb-3"},sl=L({__name:"WbWidgetFlex",props:{variableWidth:{type:Boolean},fullWidth:{type:Boolean}},setup(a){const e=a,t=m(()=>e.fullWidth?"col-12":e.variableWidth&&g.preferWideBoxes?"col-lg-6":"col-lg-4");return(r,s)=>(l(),f("div",{class:q(["p-2 m-0",t.value])},[n("div",tl,[n("div",al,[n("div",nl,[pe(r.$slots,"title",{},()=>[s[0]||(s[0]=n("div",{class:"p-0"},"(title goes here)",-1))],!0),pe(r.$slots,"subtitle",{},void 0,!0)]),n("div",rl,[pe(r.$slots,"buttons",{},void 0,!0)])]),n("div",ol,[pe(r.$slots,"default",{},void 0,!0)])])],2))}}),je=R(sl,[["__scopeId","data-v-1d5bc1d9"]]),il=L({__name:"WbBadge",props:{color:{},bgcolor:{}},setup(a){const e=a,t=m(()=>({color:e.color??"var(--color-bg)","background-color":e.bgcolor??"var(--color-menu)"}));return(r,s)=>(l(),f("span",{class:"pillWbBadge rounded-pill ms-2 px-2",style:K(t.value)},[pe(r.$slots,"default",{},void 0,!0)],4))}}),Pe=R(il,[["__scopeId","data-v-36112fa3"]]),ll={class:"d-flex justify-content-center align-items-center"},cl={key:0,class:"WbBadge rounded-pill errorWbBadge ms-3"},ul={key:0},dl={key:1,class:"row m-0 mt-0 p-0"},hl={class:"col m-0 p-0"},pl={key:0},gl={class:"row"},ml={class:"col"},fl={class:"carTitleLine d-flex justify-content-between align-items-center"},vl={key:0,class:"me-1 fa-solid fa-xs fa-star ps-1"},yl={key:1,class:"me-1 fa-solid fa-xs fa-coins ps-0"},bl={key:2,class:"me-0 fa-solid fa-xs fa-clock ps-1"},_l={class:"grid12"},wl={style:{color:"var(--color-charging)"}},kl={style:{color:"var(--color-charging)"}},xl={style:{color:"var(--color-charging)"}},Sl={class:"targetCurrent"},Ml={key:5,class:"socEditor rounded mt-2 d-flex flex-column align-items-center grid-col-12 grid-left"},$l={class:"d-flex justify-content-stretch align-items-center"},Pl={key:0,class:"fa-solid fa-sm fas fa-edit ms-2"},Il=["id"],Cl=L({__name:"CPChargePoint",props:{chargepoint:{},fullWidth:{type:Boolean}},setup(a){const e=a,t=ee(e.chargepoint),r=m({get(){return e.chargepoint.chargeMode},set(I){O[e.chargepoint.id].chargeMode=I}}),s=m(()=>(Math.round(e.chargepoint.current*10)/10).toLocaleString(void 0)+" A"),o=m(()=>(Math.round(e.chargepoint.realCurrent*10)/10).toLocaleString(void 0)+" A"),h=m(()=>{const I=e.chargepoint.rangeCharged,x=e.chargepoint.chargedSincePlugged,G=e.chargepoint.dailyYield;return x>0?Math.round(I/x*G).toString()+" "+e.chargepoint.rangeUnit:"0 km"}),d=m(()=>e.chargepoint.isLocked?"Gesperrt":e.chargepoint.isCharging?"Lädt":e.chargepoint.isPluggedIn?"Bereit":"Frei"),u=m(()=>e.chargepoint.isLocked?"var(--color-evu)":e.chargepoint.isCharging?"var(--color-charging)":e.chargepoint.isPluggedIn?"var(--color-battery)":"var(--color-axis)"),p=m(()=>{let I="";return e.chargepoint.isLocked?I="fa-lock":e.chargepoint.isCharging?I=" fa-bolt":e.chargepoint.isPluggedIn&&(I="fa-plug"),"fa "+I}),c=m(()=>{switch(e.chargepoint.chargeMode){case"stop":return{color:"var(--fg)"};default:return{color:ye[e.chargepoint.chargeMode].color}}}),k=m(()=>e.chargepoint.soc),P=m(()=>({color:e.chargepoint.color})),z=m(()=>e.chargepoint.etMaxPrice>=+M.value?{color:"var(--color-charging)"}:{color:"var(--color-menu)"}),D=m(()=>e.chargepoint.soc<20?"var(--color-evu)":e.chargepoint.soc>=80?"var(--color-pv)":"var(--color-battery)"),B=ee(!1),A=ee(!1);function V(){oe("socUpdate",1,e.chargepoint.connectedVehicle),O[e.chargepoint.id].waitingForSoc=!0}function J(){oe("setSoc",C.value,e.chargepoint.connectedVehicle),A.value=!1}const C=m({get(){return e.chargepoint.soc},set(I){O[e.chargepoint.id].soc=I}}),M=m(()=>{const[I]=re.etPriceList.values();return(Math.round(I*10)/10).toFixed(1)}),E=ee(!1);return(I,x)=>(l(),f(F,null,[B.value?w("",!0):(l(),$(_t,{key:0,"variable-width":!0,"full-width":e.fullWidth},{title:_(()=>[n("span",ll,[n("span",{style:K(P.value),onClick:x[0]||(x[0]=G=>B.value=!B.value)},[x[12]||(x[12]=n("span",{class:"fa-solid fa-charging-station"}," ",-1)),H(" "+S(e.chargepoint.name),1)],4),t.value.faultState==2?(l(),f("span",cl,"Fehler")):w("",!0)])]),buttons:_(()=>[n("span",{type:"button",class:"ms-2 ps-1 pt-1",style:K(c.value),onClick:x[1]||(x[1]=G=>B.value=!B.value)},x[13]||(x[13]=[n("span",{class:"fa-solid fa-lg ps-1 fa-ellipsis-vertical"},null,-1)]),4)]),footer:_(()=>[B.value?w("",!0):(l(),f("div",pl,[n("div",gl,[n("div",ml,[n("div",fl,[n("h3",{onClick:x[3]||(x[3]=G=>B.value=!B.value)},[x[14]||(x[14]=n("i",{class:"fa-solid fa-sm fa-car me-2"},null,-1)),H(" "+S(I.chargepoint.vehicleName)+" ",1),I.chargepoint.hasPriority?(l(),f("span",vl)):w("",!0),I.chargepoint.etActive?(l(),f("span",yl)):w("",!0),I.chargepoint.timedCharging?(l(),f("span",bl)):w("",!0)]),I.chargepoint.isSocConfigured?(l(),$(Pe,{key:0,bgcolor:D.value},{default:_(()=>[v(Ct,{soc:k.value??0,color:"var(--color-bg)",class:"me-2"},null,8,["soc"]),I.chargepoint.isSocManual?(l(),f("i",{key:0,class:"fa-solid fa-sm fas fa-edit",style:{color:"var(--color-bg)"},onClick:x[4]||(x[4]=G=>A.value=!A.value)})):w("",!0),I.chargepoint.isSocManual?w("",!0):(l(),f("i",{key:1,type:"button",class:q(["fa-solid fa-sm",I.chargepoint.waitingForSoc?"fa-spinner fa-spin":"fa-sync"]),onClick:V},null,2))]),_:1},8,["bgcolor"])):w("",!0)])])]),n("div",_l,[v(Oa,{id:"chargemode-"+I.chargepoint.name,modelValue:r.value,"onUpdate:modelValue":x[5]||(x[5]=G=>r.value=G),class:"chargemodes mt-3 mb-3",options:Object.keys(i(ye)).map(G=>({text:i(ye)[G].name,value:G,color:i(ye)[G].color,icon:i(ye)[G].icon,active:i(ye)[G].mode==I.chargepoint.chargeMode}))},null,8,["id","modelValue","options"]),e.chargepoint.power>0?(l(),$(X,{key:0,heading:"Leistung:",class:"grid-col-3 grid-left mb-3"},{default:_(()=>[n("span",wl,[v(bt,{watt:e.chargepoint.power},null,8,["watt"])])]),_:1})):w("",!0),e.chargepoint.power>0?(l(),$(X,{key:1,heading:"Strom:",class:"grid-col-3"},{default:_(()=>[n("span",kl,S(o.value),1)]),_:1})):w("",!0),e.chargepoint.power>0?(l(),$(X,{key:2,heading:"Phasen:",class:"grid-col-3"},{default:_(()=>[n("span",xl,S(e.chargepoint.phasesInUse),1)]),_:1})):w("",!0),e.chargepoint.power>0?(l(),$(X,{key:3,heading:"Sollstrom:",class:"grid-col-3 grid-right"},{default:_(()=>[n("span",Sl,S(s.value),1)]),_:1})):w("",!0),v(X,{heading:"letzte Ladung:",class:"grid-col-4 grid-left"},{default:_(()=>[v(Ge,{"watt-h":Math.max(I.chargepoint.chargedSincePlugged,0)},null,8,["watt-h"])]),_:1}),v(X,{heading:"gel. Reichw.:",class:"grid-col-4"},{default:_(()=>[H(S(h.value),1)]),_:1}),I.chargepoint.isSocConfigured?(l(),$(X,{key:4,heading:"Reichweite:",class:"grid-col-4 grid-right"},{default:_(()=>[H(S(i(Y)[e.chargepoint.connectedVehicle]?Math.round(i(Y)[e.chargepoint.connectedVehicle].range):0)+" km ",1)]),_:1})):w("",!0),A.value?(l(),f("div",Ml,[x[15]||(x[15]=n("span",{class:"d-flex m-1 p-0 socEditTitle"},"Ladestand einstellen:",-1)),n("span",$l,[n("span",null,[v(Me,{id:"manualSoc",modelValue:C.value,"onUpdate:modelValue":x[6]||(x[6]=G=>C.value=G),min:0,max:100,step:1,unit:"%"},null,8,["modelValue"])])]),n("span",{type:"button",class:"fa-solid d-flex fa-lg me-2 mb-3 align-self-end fa-circle-check",onClick:J})])):w("",!0),x[17]||(x[17]=n("hr",{class:"divider grid-col-12"},null,-1)),i(re).active?(l(),$(X,{key:6,heading:"Preisladen:",class:"grid-col-4 grid-left"},{default:_(()=>[v(se,{modelValue:t.value.etActive,"onUpdate:modelValue":x[7]||(x[7]=G=>t.value.etActive=G)},null,8,["modelValue"])]),_:1})):w("",!0),i(re).active?(l(),$(X,{key:7,heading:"max. Preis:",class:"grid-col-4"},{default:_(()=>[n("span",{type:"button",onClick:x[8]||(x[8]=G=>E.value=!E.value)},[H(S(e.chargepoint.etActive?(Math.round(e.chargepoint.etMaxPrice*10)/10).toFixed(1)+" ct":"-")+" ",1),e.chargepoint.etActive?(l(),f("i",Pl)):w("",!0)])]),_:1})):w("",!0),i(re).active?(l(),$(X,{key:8,heading:"akt. Preis:",class:"grid-col-4 grid-right"},{default:_(()=>[n("span",{style:K(z.value)},S(M.value)+" ct ",5)]),_:1})):w("",!0),E.value?(l(),f("div",{key:9,id:"priceChartInline"+e.chargepoint.id,class:"d-flex flex-column rounded priceEditor grid-col-12"},[i(Y)[e.chargepoint.connectedVehicle]!=null?(l(),$(Ta,{key:0,chargepoint:e.chargepoint},null,8,["chargepoint"])):w("",!0),n("span",{class:"d-flex ms-2 my-4 pe-3 pt-1 d-flex align-self-end",style:K(c.value),onClick:x[9]||(x[9]=G=>E.value=!1)},x[16]||(x[16]=[n("span",{type:"button",class:"d-flex fa-solid fa-lg ps-1 fa-circle-check"},null,-1)]),4)],8,Il)):w("",!0)])]))]),default:_(()=>[B.value?w("",!0):(l(),f("div",ul,[n("div",{class:"grid12",onClick:x[2]||(x[2]=G=>B.value=!B.value)},[v(X,{heading:"Status:",class:"grid-col-4 grid-left"},{default:_(()=>[n("span",{style:K({color:u.value})},[n("i",{class:q(p.value)},null,2),H(" "+S(d.value),1)],4)]),_:1}),v(X,{heading:"Geladen:",class:"grid-col-4 grid-left"},{default:_(()=>[v(Ge,{"watt-h":I.chargepoint.dailyYield},null,8,["watt-h"])]),_:1})])])),B.value?(l(),f("div",dl,[n("div",hl,[I.chargepoint!=null?(l(),$(Jt,{key:0,chargepoint:I.chargepoint},null,8,["chargepoint"])):w("",!0)])])):w("",!0)]),_:1},8,["full-width"])),B.value?(l(),$(je,{key:1,"full-width":e.fullWidth},{title:_(()=>[n("span",{style:K(P.value),onClick:x[10]||(x[10]=G=>B.value=!B.value)},[x[18]||(x[18]=n("span",{class:"fas fa-gear"}," ",-1)),H(" Einstellungen "+S(e.chargepoint.name),1)],4)]),buttons:_(()=>[n("span",{class:"ms-2 pt-1",style:K(c.value),onClick:x[11]||(x[11]=G=>B.value=!B.value)},x[19]||(x[19]=[n("span",{class:"fa-solid fa-lg ps-1 fa-circle-check"},null,-1)]),4)]),default:_(()=>[I.chargepoint!=null?(l(),$(Jt,{key:0,chargepoint:I.chargepoint},null,8,["chargepoint"])):w("",!0)]),_:1},8,["full-width"])):w("",!0)],64))}}),Bl=R(Cl,[["__scopeId","data-v-3a733de3"]]),Vl=["id"],Ll={class:"modal-dialog modal-lg modal-fullscreen-lg-down"},Ol={class:"modal-content"},Al={class:"modal-header"},Tl={class:"modal-title"},El={class:"modal-body",style:{"background-color":"var(--color-bg)"}},zl=L({__name:"ModalComponent",props:{modalId:{}},setup(a){const e=a;return Le(()=>{}),(t,r)=>(l(),f("div",{id:e.modalId,class:"modal fade"},[n("div",Ll,[n("div",Ol,[n("div",Al,[n("h3",Tl,[pe(t.$slots,"title",{},void 0,!0)]),r[0]||(r[0]=n("button",{type:"button",class:"btn-close buttonTextSize d-flex justify-content-center pt-3 pb-0","data-bs-dismiss":"modal"},[n("i",{class:"fa-solid fa-lg fa-rectangle-xmark m-0 p-0"})],-1))]),n("div",El,[pe(t.$slots,"default",{},void 0,!0),r[1]||(r[1]=n("button",{class:"btn btn-secondary float-end mt-3 ms-1","data-bs-dismiss":"modal"}," Schließen ",-1))])])])],8,Vl))}}),Ea=R(zl,[["__scopeId","data-v-eaefae30"]]),Wl={class:"d-flex align-items-center"},Dl={class:"cpname"},Gl={class:"d-flex float-right justify-content-end align-items-center"},jl=["data-bs-target"],Ul=["data-bs-target"],Fl={class:"subgrid"},Nl={key:0,class:"d-flex justify-content-center align-items-center vehiclestatus"},Hl={class:"d-flex flex-column align-items-center px-0"},Rl={class:"d-flex justify-content-center flex-wrap"},Jl={class:"d-flex align-items-center"},Yl={class:"badge phasesInUse rounded-pill"},ql={class:"d-flex flex-wrap justify-content-center chargeinfo"},Ql={class:"me-1"},Zl={key:0,class:"subgrid socEditRow m-0 p-0"},Xl={class:"socEditor rounded mt-2 d-flex flex-column align-items-center grid-col-12"},Kl={class:"d-flex justify-content-stretch align-items-center"},ec=L({__name:"CpsListItem2",props:{chargepoint:{}},setup(a){const e=a,t=ee(!1),r=m(()=>ye[e.chargepoint.chargeMode].icon),s=m(()=>{let V="";return e.chargepoint.isLocked?V="fa-lock":e.chargepoint.isCharging?V=" fa-bolt":e.chargepoint.isPluggedIn&&(V="fa-plug"),"fa "+V}),o=m(()=>{let V="var(--color-axis)";return e.chargepoint.isLocked?V="var(--color-evu)":e.chargepoint.isCharging?V="var(--color-charging)":e.chargepoint.isPluggedIn&&(V="var(--color-battery)"),{color:V,border:`0.5px solid ${V} `}}),h=m(()=>{switch(e.chargepoint.chargeMode){case"stop":return{"background-color":"var(--fg)"};default:return{"background-color":ye[e.chargepoint.chargeMode].color}}}),d=m(()=>$e(e.chargepoint.power,g.decimalPlaces)),u=m(()=>e.chargepoint.current+" A"),p=m(()=>e.chargepoint.phasesInUse),c=m(()=>e.chargepoint.dailyYield>0?ct(e.chargepoint.dailyYield,g.decimalPlaces):"0 Wh"),k=m(()=>"("+Math.round(e.chargepoint.rangeCharged).toString()+" "+e.chargepoint.rangeUnit+")"),P=m(()=>ye[e.chargepoint.chargeMode].name);function z(){oe("socUpdate",1,e.chargepoint.connectedVehicle),O[e.chargepoint.id].waitingForSoc=!0}function D(){oe("setSoc",B.value,e.chargepoint.connectedVehicle),t.value=!1}const B=m({get(){return e.chargepoint.soc},set(V){O[e.chargepoint.id].soc=V}}),A=m(()=>e.chargepoint.isLocked?"Gesperrt":e.chargepoint.isCharging?"Lädt":e.chargepoint.isPluggedIn?"Bereit":"Frei");return(V,J)=>(l(),f(F,null,[v(tt,{titlecolor:V.chargepoint.color,fullwidth:!0,small:!0},{title:_(()=>[n("div",Wl,[n("span",Dl,S(V.chargepoint.name),1),n("span",{class:"badge rounded-pill statusbadge mx-2",style:K(o.value)},[n("i",{class:q([s.value,"me-1"])},null,2),H(" "+S(A.value),1)],4)])]),buttons:_(()=>[n("div",Gl,[n("span",{class:"badge rounded-pill modebadge mx-2",type:"button",style:K(h.value),"data-bs-toggle":"modal","data-bs-target":"#cpsconfig-"+V.chargepoint.id},[n("i",{class:q(["fa me-1",r.value])},null,2),H(" "+S(P.value),1)],12,jl),n("span",{class:"fa-solid ms-2 fa-lg fa-edit ps-1",type:"button","data-bs-toggle":"modal","data-bs-target":"#cpsconfig-"+V.chargepoint.id},null,8,Ul)])]),default:_(()=>[n("div",Fl,[v(X,{heading:V.chargepoint.vehicleName,small:!0,class:"grid-left grid-col-4"},{default:_(()=>[V.chargepoint.isSocConfigured?(l(),f("span",Nl,[V.chargepoint.soc?(l(),$(Ct,{key:0,class:"me-1",soc:V.chargepoint.soc},null,8,["soc"])):w("",!0),V.chargepoint.isSocConfigured&&V.chargepoint.isSocManual?(l(),f("i",{key:1,type:"button",class:"fa-solid fa-sm fas fa-edit",style:{color:"var(--color-menu)"},onClick:J[0]||(J[0]=C=>t.value=!t.value)})):w("",!0),V.chargepoint.isSocConfigured&&!V.chargepoint.isSocManual?(l(),f("i",{key:2,type:"button",class:q(["fa-solid fa-sm me-2",V.chargepoint.waitingForSoc?"fa-spinner fa-spin":"fa-sync"]),style:{color:"var(--color-menu)"},onClick:z},null,2)):w("",!0)])):w("",!0)]),_:1},8,["heading"]),v(X,{heading:"Parameter:",small:!0,class:"grid-col-4"},{default:_(()=>[n("div",Hl,[n("span",Rl,[n("span",null,S(d.value),1),n("span",Jl,[n("span",Yl,S(p.value),1),n("span",null,S(u.value),1)])])])]),_:1}),v(X,{heading:"Geladen:",small:!0,class:"grid-right grid-col-4"},{default:_(()=>[n("div",ql,[n("span",Ql,S(c.value),1),n("span",null,S(k.value),1)])]),_:1})]),t.value?(l(),f("div",Zl,[n("div",Xl,[J[2]||(J[2]=n("span",{class:"d-flex m-1 p-0 socEditTitle"},"Ladestand einstellen:",-1)),n("span",Kl,[n("span",null,[v(Me,{id:"manualSoc",modelValue:B.value,"onUpdate:modelValue":J[1]||(J[1]=C=>B.value=C),min:0,max:100,step:1,unit:"%"},null,8,["modelValue"])])]),n("span",{type:"button",class:"fa-solid d-flex fa-lg me-2 mb-3 align-self-end fa-circle-check",onClick:D})])])):w("",!0)]),_:1},8,["titlecolor"]),(l(),$(Xa,{to:"body"},[(l(),$(Ea,{key:V.chargepoint.id,"modal-id":"cpsconfig-"+V.chargepoint.id},{title:_(()=>[H(" Konfiguration: "+S(V.chargepoint.name),1)]),default:_(()=>[V.chargepoint!=null?(l(),$(Jt,{key:0,chargepoint:V.chargepoint},null,8,["chargepoint"])):w("",!0)]),_:1},8,["modal-id"]))]))],64))}}),tc=R(ec,[["__scopeId","data-v-25e4aa5d"]]),ac=L({__name:"CpSimpleList2",setup(a){const e=m(()=>Object.values(O));return(t,r)=>(l(),$(je,{"variable-width":!0},{title:_(()=>r[0]||(r[0]=[n("span",{class:"fa-solid fa-charging-station"}," ",-1),H(" Ladepunkte ")])),buttons:_(()=>[i(re).active?(l(),$(Pe,{key:0,bgcolor:"var(--color-menu)"},{default:_(()=>[H("Strompreis: "+S(i(re).etCurrentPriceString),1)]),_:1})):w("",!0)]),default:_(()=>[(l(!0),f(F,null,te(e.value,(s,o)=>(l(),f("div",{key:o,class:"subgrid pb-2"},[v(tc,{chargepoint:s},null,8,["chargepoint"])]))),128))]),_:1}))}}),nc=R(ac,[["__scopeId","data-v-b8c6b557"]]),Tt=L({__name:"ChargePointList",props:{id:{},compact:{type:Boolean}},setup(a){let e,t;const r=a,s=m(()=>{let p=Object.values(O);return u(),p}),o=m(()=>h.value+" "+d.value),h=m(()=>{switch(Object.values(O).length){case 0:return g.preferWideBoxes?"col-lg-6":"col-lg-4";case 1:return g.preferWideBoxes?"col-lg-6":"col-lg-4";case 2:return g.preferWideBoxes?"col-lg-12":"col-lg-8 ";default:return"col-lg-12"}}),d=m(()=>"swiper-chargepoints-"+r.id);function u(){let p=document.querySelector("."+d.value);if(p&&(t=p,e=t.swiper),e){let c="1";if(De.value)switch(Object.values(O).length){case 0:case 1:c="1";break;case 2:c="2";break;default:c="3"}t.setAttribute("slides-per-view",c),e.update()}}return Le(()=>{let p=document.querySelector("."+d.value);p&&(t=p,e=t.swiper),window.addEventListener("resize",u),window.document.addEventListener("visibilitychange",u)}),(p,c)=>(l(),f(F,null,[r.compact?w("",!0):(l(),f("swiper-container",{key:0,"space-between":0,"slides-per-view":1,pagination:{clickable:!0},class:q(["cplist m-0 p-0 d-flex align-items-stretch",o.value])},[(l(!0),f(F,null,te(s.value,k=>(l(),f("swiper-slide",{key:k.id},[n("div",{class:q([i(De)?"mb-0":"mb-5","d-flex align-items-stretch flex-fill"])},[v(Bl,{chargepoint:k,"full-width":!0},null,8,["chargepoint"])],2)]))),128))],2)),r.compact?(l(),$(nc,{key:1})):w("",!0)],64))}}),rc={class:"container-fluid p-0 m-0"},oc={class:"row p-0 m-0"},sc={class:"d-grid gap-2"},ic=["onClick"],lc={class:"col-md-4 p-1"},cc={class:"d-grid gap-2"},uc={key:0},dc={class:"row justify-content-center m-1 p-0"},hc={class:"col-lg-4 p-1 m-0"},pc={class:"d-grid gap-2"},gc={class:"col-lg-4 p-1 m-0"},mc={class:"d-grid gap-2"},fc={class:"col-lg-4 p-1 m-0"},vc={class:"d-grid gap-2"},yc=L({__name:"BBSelect",props:{cpId:{}},setup(a){const e=a,t=[{mode:"instant_charging",name:"Sofort",color:"var(--color-charging)"},{mode:"pv_charging",name:"PV",color:"var(--color-pv)"},{mode:"scheduled_charging",name:"Zielladen",color:"var(--color-battery)"},{mode:"standby",name:"Standby",color:"var(--color-axis)"},{mode:"stop",name:"Stop",color:"var(--color-axis)"}],r=m(()=>O[e.cpId]);function s(p){return p==r.value.chargeMode?"btn btn-success buttonTextSize":"btn btn-secondary buttonTextSize"}function o(p){return de.pvBatteryPriority==p?"btn-success":"btn-secondary"}function h(p){r.value.chargeMode=p}function d(p){r.value.isLocked=p}function u(p){de.pvBatteryPriority=p}return(p,c)=>(l(),f("div",rc,[n("div",oc,[(l(),f(F,null,te(t,(k,P)=>n("div",{key:P,class:"col-md-4 p-1"},[n("div",sc,[n("button",{type:"button",class:q(s(k.mode)),style:{},onClick:z=>h(k.mode)},S(k.name),11,ic)])])),64)),n("div",lc,[n("div",cc,[r.value.isLocked?(l(),f("button",{key:0,type:"button",class:"btn btn-outline-success buttonTextSize","data-bs-dismiss":"modal",onClick:c[0]||(c[0]=k=>d(!1))}," Entsperren ")):w("",!0),r.value.isLocked?w("",!0):(l(),f("button",{key:1,type:"button",class:"btn btn-outline-danger buttonTextSize","data-bs-dismiss":"modal",onClick:c[1]||(c[1]=k=>d(!0))}," Sperren "))])])]),i(de).isBatteryConfigured?(l(),f("div",uc,[c[8]||(c[8]=n("hr",null,null,-1)),c[9]||(c[9]=n("div",{class:"row"},[n("div",{class:"col text-center"},"Vorrang im Lademodus PV-Laden:")],-1)),n("div",dc,[n("div",hc,[n("div",pc,[n("button",{id:"evPriorityBtn",type:"button",class:q(["priorityModeBtn btn btn-secondary buttonTextSize",o("ev_mode")]),"data-dismiss":"modal",priority:"1",onClick:c[2]||(c[2]=k=>u("ev_mode"))},c[5]||(c[5]=[H(" EV "),n("span",{class:"fas fa-car ms-2"}," ",-1)]),2)])]),n("div",gc,[n("div",mc,[n("button",{id:"batteryPriorityBtn",type:"button",class:q(["priorityModeBtn btn btn-secondary buttonTextSize",o("bat_mode")]),"data-dismiss":"modal",priority:"0",onClick:c[3]||(c[3]=k=>u("bat_mode"))},c[6]||(c[6]=[H(" Speicher "),n("span",{class:"fas fa-car-battery ms-2"}," ",-1)]),2)])]),n("div",fc,[n("div",vc,[n("button",{id:"minsocPriorityBtn",type:"button",class:q(["priorityModeBtn btn btn-secondary buttonTextSize",o("min_soc_bat_mode")]),"data-dismiss":"modal",priority:"0",onClick:c[4]||(c[4]=k=>u("min_soc_bat_mode"))},c[7]||(c[7]=[H(" MinSoc "),n("span",{class:"fas fa-battery-half"}," ",-1)]),2)])])])])):w("",!0)]))}}),bc={class:"col-lg-4 p-0 m-0 mt-1"},_c={class:"d-grid gap-2"},wc=["data-bs-target"],kc={class:"m-0 p-0 d-flex justify-content-between align-items-center"},xc={class:"mx-1 badge rounded-pill smallTextSize plugIndicator"},Sc={key:0,class:"ms-2"},Mc={class:"m-0 p-0"},$c={key:0,class:"ps-1"},Pc=L({__name:"BbChargeButton",props:{chargepoint:{}},setup(a){const e=a,t="chargeSelectModal"+e.chargepoint.id,r=m(()=>ye[e.chargepoint.chargeMode].name),s=m(()=>{let c={background:"var(--color-menu)"};return e.chargepoint.isLocked?c.background="var(--color-evu)":e.chargepoint.isCharging?c.background="var(--color-charging)":e.chargepoint.isPluggedIn&&(c.background="var(--color-battery)"),c}),o=m(()=>{{let c={background:ye[e.chargepoint.chargeMode].color,color:"white"};switch(e.chargepoint.chargeMode){case ve.instant_charging:e.chargepoint.isCharging&&!e.chargepoint.isLocked&&(c=p(c));break;case ve.standby:case ve.stop:c.background="darkgrey",c.color="black";break;case ve.scheduled_charging:e.chargepoint.isPluggedIn&&!e.chargepoint.isCharging&&!e.chargepoint.isLocked&&(c=p(c));break}return c}}),h=m(()=>ye[e.chargepoint.chargeMode].icon),d=m(()=>{switch(de.pvBatteryPriority){case"ev_mode":return"fa-car";case"bat_mode":return"fa-car-battery";case"min_soc_bat_mode":return"fa-battery-half";default:return console.log("default"),""}}),u=m(()=>{let c="fa-ellipsis";return e.chargepoint.isLocked?c="fa-lock":e.chargepoint.isCharging?c=" fa-bolt":e.chargepoint.isPluggedIn&&(c="fa-plug"),"fa "+c});function p(c){let k=c.color;return c.color=c.background,c.background=k,c}return(c,k)=>(l(),f("div",bc,[n("div",_c,[n("button",{type:"button",class:"btn mx-1 mb-0 p-1 mediumTextSize chargeButton shadow",style:K(s.value),"data-bs-toggle":"modal","data-bs-target":"#"+t},[n("div",kc,[n("span",xc,[n("i",{class:q(u.value)},null,2),c.chargepoint.isCharging?(l(),f("span",Sc,S(i($e)(c.chargepoint.power)),1)):w("",!0)]),n("span",Mc,S(c.chargepoint.name),1),n("span",{class:"mx-2 m-0 badge rounded-pill smallTextSize modeIndicator",style:K(o.value)},[n("i",{class:q(["fa me-1",h.value])},null,2),H(" "+S(r.value)+" ",1),c.chargepoint.chargeMode==i(ve).pv_charging&&i(de).isBatteryConfigured?(l(),f("span",$c,[k[0]||(k[0]=H(" ( ")),n("i",{class:q(["fa m-0",d.value])},null,2),k[1]||(k[1]=H(") "))])):w("",!0)],4)])],12,wc)]),v(Ea,{"modal-id":t},{title:_(()=>[H(" Lademodus für "+S(c.chargepoint.vehicleName),1)]),default:_(()=>[v(yc,{"cp-id":c.chargepoint.id},null,8,["cp-id"])]),_:1})]))}}),Ic=R(Pc,[["__scopeId","data-v-31df6764"]]),Cc={class:"row p-0 mt-0 mb-1 m-0"},Bc={class:"col p-0 m-0"},Vc={class:"container-fluid p-0 m-0"},Lc={class:"row p-0 m-0 d-flex justify-content-center align-items-center"},Oc={key:0,class:"col time-display"},Ac=L({__name:"ButtonBar",setup(a){return(e,t)=>(l(),f("div",Cc,[n("div",Bc,[n("div",Vc,[n("div",Lc,[i(g).showClock=="buttonbar"?(l(),f("span",Oc,S(i(La)(i(Rt))),1)):w("",!0),(l(!0),f(F,null,te(i(O),(r,s)=>(l(),$(Ic,{key:s,chargepoint:r,"charge-point-count":Object.values(i(O)).length},null,8,["chargepoint","charge-point-count"]))),128))])])])]))}}),Tc=R(Ac,[["__scopeId","data-v-791e4be0"]]),Ec={class:"battery-title"},zc={class:"subgrid pt-1"},Wc=L({__name:"BLBattery",props:{bat:{}},setup(a){const e=a,t=m(()=>e.bat.power<0?`Liefert (${$e(-e.bat.power)})`:e.bat.power>0?`Lädt (${$e(e.bat.power)})`:"Bereit"),r=m(()=>e.bat.power<0?"var(--color-pv)":e.bat.power>0?"var(--color-battery)":"var(--color-menu)");return(s,o)=>(l(),$(tt,{titlecolor:"var(--color-title)",fullwidth:!0},{title:_(()=>[n("span",Ec,S(s.bat.name),1)]),buttons:_(()=>[v(Pe,{bgcolor:r.value},{default:_(()=>[H(S(t.value),1)]),_:1},8,["bgcolor"])]),default:_(()=>[n("div",zc,[v(X,{heading:"Ladestand:",small:!0,class:"grid-left grid-col-4"},{default:_(()=>[v(Ct,{soc:e.bat.soc},null,8,["soc"])]),_:1}),v(X,{heading:"Geladen:",small:!0,class:"grid-col-4"},{default:_(()=>[v(Ge,{"watt-h":e.bat.dailyYieldImport},null,8,["watt-h"])]),_:1}),v(X,{heading:"Geliefert:",small:!0,class:"grid-right grid-col-4"},{default:_(()=>[v(Ge,{"watt-h":e.bat.dailyYieldExport},null,8,["watt-h"])]),_:1})])]),_:1}))}}),Dc=R(Wc,[["__scopeId","data-v-f7f825f7"]]),Gc={class:"px-3 subgrid grid-12"},jc=L({__name:"BatteryList",setup(a){const e=m(()=>Q.batOut.power>0?`Liefert (${$e(Q.batOut.power)})`:U.batIn.power>0?`Lädt (${$e(U.batIn.power)})`:"Bereit:"),t=m(()=>Q.batOut.power>0?"var(--color-pv)":U.batIn.power>0?"var(--color-battery)":"var(--color-menu)"),r=m(()=>{let s=0;return he.value.forEach(o=>{s+=o.dailyYieldImport}),s});return(s,o)=>i(de).isBatteryConfigured?(l(),$(je,{key:0,"variable-width":!0,"full-width":!1},{title:_(()=>o[0]||(o[0]=[n("span",{class:"fas fa-car-battery me-2",style:{color:"var(--color-battery)"}}," ",-1),n("span",null,"Speicher",-1)])),buttons:_(()=>[v(Pe,{bgcolor:t.value},{default:_(()=>[H(S(e.value),1)]),_:1},8,["bgcolor"])]),default:_(()=>[n("div",Gc,[v(X,{heading:"Ladestand:",class:"grid-left grid-col-4"},{default:_(()=>[v(Ct,{color:"var(--color-battery)",soc:i(de).batterySoc},null,8,["soc"])]),_:1}),v(X,{heading:"Geladen:",class:"grid-col-4"},{default:_(()=>[n("span",null,S(i(ct)(r.value)),1)]),_:1}),v(X,{heading:"Geliefert",class:"grid-right grid-col-4"},{default:_(()=>[n("span",null,S(i(ct)(i(Q).batOut.energy)),1)]),_:1})]),(l(!0),f(F,null,te(i(he),([h,d])=>(l(),$(Dc,{key:h,bat:d},null,8,["bat"]))),128))]),_:1})):w("",!0)}}),Et=R(jc,[["__scopeId","data-v-cc4da23c"]]),Uc={class:"devicename"},Fc={class:"subgrid"},Nc=L({__name:"SHListItem",props:{device:{}},setup(a){const e=a,t=m(()=>e.device.status=="on"?"fa-toggle-on fa-xl":e.device.status=="waiting"?"fa-spinner fa-spin":"fa-toggle-off fa-xl"),r=m(()=>{let d="var(--color-switchRed)";switch(e.device.status){case"on":d="var(--color-switchGreen)";break;case"detection":d="var(--color-switchBlue)";break;case"timeout":d="var(--color-switchWhite)";break;case"waiting":d="var(--color-menu)";break;default:d="var(--color-switchRed)"}return{color:d}});function s(){e.device.isAutomatic||(e.device.status=="on"?oe("shSwitchOn",0,e.device.id):oe("shSwitchOn",1,e.device.id),ae.get(e.device.id).status="waiting")}function o(){e.device.isAutomatic?oe("shSetManual",1,e.device.id):oe("shSetManual",0,e.device.id)}const h=m(()=>e.device.isAutomatic?"Auto":"Man");return(d,u)=>(l(),$(tt,{titlecolor:d.device.color,fullwidth:!0},{title:_(()=>[n("span",Uc,S(d.device.name),1)]),buttons:_(()=>[(l(!0),f(F,null,te(d.device.temp,(p,c)=>(l(),f("span",{key:c},[p<300?(l(),$(Pe,{key:0,bgcolor:"var(--color-battery)"},{default:_(()=>[n("span",null,S(i(Nn)(p)),1)]),_:2},1024)):w("",!0)]))),128)),e.device.canSwitch?(l(),f("span",{key:0,class:q([t.value,"fa-solid statusbutton mr-2 ms-2"]),style:K(r.value),onClick:s},null,6)):w("",!0),e.device.canSwitch?(l(),$(Pe,{key:1,type:"button",onClick:o},{default:_(()=>[H(S(h.value),1)]),_:1})):w("",!0)]),default:_(()=>[n("div",Fc,[v(X,{heading:"Leistung:",small:!0,class:"grid-col-4 grid-left"},{default:_(()=>[v(bt,{watt:d.device.power},null,8,["watt"])]),_:1}),v(X,{heading:"Energie:",small:!0,class:"grid-col-4"},{default:_(()=>[v(Ge,{"watt-h":d.device.energy},null,8,["watt-h"])]),_:1}),v(X,{heading:"Laufzeit:",small:!0,class:"grid-col-4 grid-right"},{default:_(()=>[H(S(i(Un)(d.device.runningTime)),1)]),_:1})])]),_:1},8,["titlecolor"]))}}),Hc=R(Nc,[["__scopeId","data-v-20651ac6"]]),Rc={class:"sh-title py-4"},Jc=["id","onUpdate:modelValue","value"],Yc=["for"],qc=3,Qc=L({__name:"SmartHomeList",setup(a){const e=m(()=>De.value?t.value.reduce((h,d)=>{const u=h;let p=h[h.length-1];return p.length>=qc?h.push([d]):p.push(d),u},[[]]):[t.value]),t=m(()=>[...ae.values()].filter(h=>h.configured));function r(h){return"Geräte"+(De.value&&e.value.length>1?"("+(h+1)+")":"")}function s(){o.value=!o.value}const o=ee(!1);return(h,d)=>(l(),f(F,null,[(l(!0),f(F,null,te(e.value,(u,p)=>(l(),$(je,{key:p,"variable-width":!0},{title:_(()=>[n("span",{onClick:s},[d[0]||(d[0]=n("span",{class:"fas fa-plug me-2",style:{color:"var(--color-devices)"}}," ",-1)),n("span",Rc,S(r(p)),1)])]),buttons:_(()=>[n("span",{class:"ms-2 pt-1",onClick:s},d[1]||(d[1]=[n("span",{class:"fa-solid fa-lg ps-1 fa-ellipsis-vertical"},null,-1)]))]),default:_(()=>[(l(!0),f(F,null,te(u,c=>(l(),$(Hc,{key:c.id,device:c,class:"subgrid pb-2"},null,8,["device"]))),128))]),_:2},1024))),128)),o.value?(l(),$(je,{key:0},{title:_(()=>[n("span",{class:"smarthome",onClick:s},d[2]||(d[2]=[n("span",{class:"fas fa-gear"}," ",-1),H(" Einstellungen")]))]),buttons:_(()=>[n("span",{class:"ms-2 pt-1",onClick:s},d[3]||(d[3]=[n("span",{class:"fa-solid fa-lg ps-1 fa-circle-check"},null,-1)]))]),default:_(()=>[v(N,{title:"Im Energie-Graph anzeigen:",icon:"fa-chart-column",fullwidth:!0},{default:_(()=>[(l(!0),f(F,null,te(t.value,(u,p)=>(l(),f("div",{key:p},[vt(n("input",{id:"check"+p,"onUpdate:modelValue":c=>u.showInGraph=c,class:"form-check-input",type:"checkbox",value:u},null,8,Jc),[[Ma,u.showInGraph]]),n("label",{class:"form-check-label px-2",for:"check"+p},S(u.name),9,Yc)]))),128))]),_:1}),n("div",{class:"row p-0 m-0",onClick:s},d[4]||(d[4]=[n("div",{class:"col-12 mb-3 pe-3 mt-0"},[n("button",{class:"btn btn-sm btn-secondary float-end"},"Schließen")],-1)]))]),_:1})):w("",!0)],64))}}),zt=R(Qc,[["__scopeId","data-v-5b5cf6b3"]]),Zc={class:"countername"},Xc={class:"subgrid pt-1"},Kc=L({__name:"ClCounter",props:{counter:{}},setup(a){const e=a,t=m(()=>e.counter.power>0?"Bezug":"Export"),r=m(()=>e.counter.power>0?"var(--color-evu)":"var(--color-pv)");return(s,o)=>(l(),$(tt,{titlecolor:"var(--color-title)",fullwidth:!0},{title:_(()=>[n("span",Zc,S(s.counter.name),1)]),buttons:_(()=>[e.counter.power!=0?(l(),$(Pe,{key:0,bgcolor:r.value},{default:_(()=>[H(S(t.value),1)]),_:1},8,["bgcolor"])):w("",!0),v(Pe,{color:"var(--color-bg)"},{default:_(()=>[H(" ID: "+S(e.counter.id),1)]),_:1})]),default:_(()=>[n("div",Xc,[v(X,{heading:"Leistung:",small:!0,class:"grid-left grid-col-4"},{default:_(()=>[v(bt,{watt:Math.abs(e.counter.power)},null,8,["watt"])]),_:1}),v(X,{heading:"Bezogen:",small:!0,class:"grid-col-4"},{default:_(()=>[v(Ge,{"watt-h":e.counter.energy_imported},null,8,["watt-h"])]),_:1}),v(X,{heading:"Exportiert:",small:!0,class:"grid-right grid-col-4"},{default:_(()=>[v(Ge,{"watt-h":e.counter.energy_exported},null,8,["watt-h"])]),_:1})])]),_:1}))}}),eu=R(Kc,[["__scopeId","data-v-01dd8c4d"]]);class tu{constructor(e){b(this,"id");b(this,"name","Zähler");b(this,"power",0);b(this,"energy_imported",0);b(this,"energy_exported",0);b(this,"grid",!1);b(this,"type","counter");b(this,"color","var(--color-evu)");b(this,"energyPv",0);b(this,"energyBat",0);b(this,"pvPercentage",0);b(this,"icon","");this.id=e}}const ke=le({});function au(a,e){if(a in ke)console.info("Duplicate counter message: "+a);else switch(ke[a]=new tu(a),ke[a].type=e,e){case"counter":ke[a].color="var(--color-evu)";break;case"inverter":ke[a].color="var(--color-pv)";break;case"cp":ke[a].color="var(--color-charging)";break;case"bat":ke[a].color="var(--color-bat)";break}}const nu=L({__name:"CounterList",setup(a){return(e,t)=>(l(),$(je,{"variable-width":!0},{title:_(()=>t[0]||(t[0]=[n("span",{class:"fas fa-bolt me-2",style:{color:"var(--color-evu)"}}," ",-1),n("span",null,"Zähler",-1)])),default:_(()=>[(l(!0),f(F,null,te(i(ke),(r,s)=>(l(),f("div",{key:s,class:"subgrid pb-2"},[v(eu,{counter:r},null,8,["counter"])]))),128))]),_:1}))}}),Wt=R(nu,[["__scopeId","data-v-5f059284"]]),ru={class:"vehiclename"},ou={class:"subgrid"},su=L({__name:"VlVehicle",props:{vehicle:{}},setup(a){const e=a,t=m(()=>{let s="Unterwegs",o=e.vehicle.chargepoint;return o!=null&&(o.isCharging?s="Lädt ("+o.name+")":o.isPluggedIn&&(s="Bereit ("+o.name+")")),s}),r=m(()=>{let s=e.vehicle.chargepoint;return s!=null?s.isLocked?"var(--color-evu)":s.isCharging?"var(--color-charging)":s.isPluggedIn?"var(--color-battery)":"var(--color-axis)":"var(--color-axis)"});return(s,o)=>(l(),$(tt,{titlecolor:"var(--color-title)",fullwidth:!0},{title:_(()=>[n("span",ru,S(e.vehicle.name),1)]),default:_(()=>[n("div",ou,[v(X,{heading:"Status:",small:!0,class:"grid-left grid-col-4"},{default:_(()=>[n("span",{style:K({color:r.value}),class:"d-flex justify-content-center align-items-center status-string"},S(t.value),5)]),_:1}),v(X,{heading:"Ladestand:",small:!0,class:"grid-col-4"},{default:_(()=>[H(S(Math.round(e.vehicle.soc))+" % ",1)]),_:1}),v(X,{heading:"Reichweite:",small:!0,class:"grid-right grid-col-4"},{default:_(()=>[H(S(Math.round(e.vehicle.range))+" km ",1)]),_:1})])]),_:1}))}}),iu=R(su,[["__scopeId","data-v-9e2cb63e"]]),lu=L({__name:"VehicleList",setup(a){return(e,t)=>(l(),$(je,{"variable-width":!0},{title:_(()=>t[0]||(t[0]=[n("span",{class:"fas fa-car me-2",style:{color:"var(--color-charging)"}}," ",-1),n("span",null,"Fahrzeuge",-1)])),default:_(()=>[(l(!0),f(F,null,te(Object.values(i(Y)).filter(r=>r.visible),(r,s)=>(l(),f("div",{key:s,class:"subgrid"},[v(iu,{vehicle:r},null,8,["vehicle"])]))),128))]),_:1}))}}),Dt=R(lu,[["__scopeId","data-v-23b437ea"]]),cu={class:"grapharea"},uu={id:"pricechart",class:"p-1 m-0 pricefigure"},du={viewBox:"0 0 400 280"},hu=["id","origin","transform"],ut=380,_a=250,Gt=12,pu=L({__name:"GlobalPriceChart",props:{id:{}},setup(a){const e=a,t=ee(!1),r={top:0,bottom:15,left:20,right:0},s=m(()=>{let A=[];return re.etPriceList.size>0&&re.etPriceList.forEach((V,J)=>{A.push([J,V])}),A}),o=m(()=>s.value.length>1?(ut-r.left-r.right)/s.value.length:0),h=m(()=>{let A=Ve(s.value,V=>V[0]);return A[1]&&(A[1]=new Date(A[1]),A[1].setTime(A[1].getTime()+36e5)),et().range([r.left,ut-r.right]).domain(A)}),d=m(()=>{let A=[0,0];return s.value.length>0&&(A=Ve(s.value,V=>V[1]),A[0]=Math.floor(A[0])-1,A[1]=Math.floor(A[1])+1),A}),u=m(()=>He().range([_a-r.bottom,0]).domain(d.value)),p=m(()=>{const A=Ne(),V=[[r.left,u.value(g.lowerPriceBound)],[ut-r.right,u.value(g.lowerPriceBound)]];return A(V)}),c=m(()=>{const A=Ne(),V=[[r.left,u.value(g.upperPriceBound)],[ut-r.right,u.value(g.upperPriceBound)]];return A(V)}),k=m(()=>{const A=Ne(),V=[[r.left,u.value(0)],[ut-r.right,u.value(0)]];return A(V)}),P=m(()=>ht(h.value).ticks(s.value.length).tickSize(5).tickSizeInner(-250).tickFormat(A=>A.getHours()%6==0?st("%H:%M")(A):"")),z=m(()=>ft(u.value).ticks(d.value[1]-d.value[0]).tickSize(0).tickSizeInner(-360).tickFormat(A=>A.toString())),D=m(()=>{t.value==!0;const A=ce("g#"+B.value);A.selectAll("*").remove(),A.selectAll("bar").data(s.value).enter().append("g").append("rect").attr("class","bar").attr("x",x=>h.value(x[0])).attr("y",x=>u.value(x[1])).attr("width",o.value).attr("height",x=>u.value(d.value[0])-u.value(x[1])).attr("fill","var(--color-charging)");const J=A.append("g").attr("class","axis").call(P.value);J.attr("transform","translate(0,"+(_a-r.bottom)+")"),J.selectAll(".tick").attr("font-size",Gt).attr("color","var(--color-bg)"),J.selectAll(".tick line").attr("stroke","var(--color-bg)").attr("stroke-width",x=>x.getHours()%6==0?"2":"0.5"),J.select(".domain").attr("stroke","var(--color-bg");const C=A.append("g").attr("class","axis").call(z.value);C.attr("transform","translate("+r.left+",0)"),C.selectAll(".tick").attr("font-size",Gt).attr("color","var(--color-bg)"),C.selectAll(".tick line").attr("stroke","var(--color-bg)").attr("stroke-width",x=>x%5==0?"2":"0.5"),C.select(".domain").attr("stroke","var(--color-bg)"),d.value[0]<0&&A.append("path").attr("d",k.value).attr("stroke","var(--color-fg)"),A.append("path").attr("d",p.value).attr("stroke","green"),A.append("path").attr("d",c.value).attr("stroke","red");const M=A.selectAll("ttip").data(s.value).enter().append("g").attr("class","ttarea");M.append("rect").attr("x",x=>h.value(x[0])).attr("y",x=>u.value(x[1])).attr("height",x=>u.value(d.value[0])-u.value(x[1])).attr("class","ttrect").attr("width",o.value).attr("opacity","1%").attr("fill","var(--color-charging)");const E=M.append("g").attr("class","ttmessage").attr("transform",x=>"translate("+(h.value(x[0])-30+o.value/2)+","+(u.value(x[1])-16)+")");E.append("rect").attr("rx",5).attr("width","60").attr("height","30").attr("fill","var(--color-menu)");const I=E.append("text").attr("text-anchor","middle").attr("x",30).attr("y",12).attr("font-size",Gt).attr("fill","var(--color-bg)");return I.append("tspan").attr("x",30).attr("dy","0em").text(x=>st("%H:%M")(x[0])),I.append("tspan").attr("x",30).attr("dy","1.1em").text(x=>Math.round(x[1]*10)/10+" ct"),"PriceChart.vue"}),B=m(()=>"priceChartCanvas"+e.id);return Le(()=>{t.value=!t.value}),(A,V)=>(l(),$(je,{"variable-width":!0},{title:_(()=>V[0]||(V[0]=[n("span",{class:"fas fa-coins me-2",style:{color:"var(--color-battery)"}}," ",-1),n("span",null,"Strompreis",-1)])),buttons:_(()=>[i(re).active?(l(),$(Pe,{key:0,bgcolor:"var(--color-charging)"},{default:_(()=>[H(S(i(re).etCurrentPriceString),1)]),_:1})):w("",!0),i(re).active?(l(),$(Pe,{key:1,bgcolor:"var(--color-menu)"},{default:_(()=>[H(S(i(re).etProvider),1)]),_:1})):w("",!0)]),default:_(()=>[n("div",cu,[n("figure",uu,[(l(),f("svg",du,[n("g",{id:B.value,origin:D.value,transform:"translate("+r.top+","+r.left+") "},null,8,hu)]))])])]),_:1}))}}),jt=R(pu,[["__scopeId","data-v-6000c955"]]),gu={class:"subgrid pt-1"},mu=L({__name:"IlInverter",props:{inverter:{}},setup(a){const e=a,t=m(()=>({color:e.inverter.color}));return(r,s)=>(l(),$(tt,{titlecolor:"var(--color-title)",fullwidth:!0},{title:_(()=>[n("span",{class:"invertername",style:K(t.value)},S(r.inverter.name),5)]),buttons:_(()=>[e.inverter.power<0?(l(),$(Pe,{key:0,bgcolor:"var(--color-pv)"},{default:_(()=>[H(S(i($e)(-e.inverter.power)),1)]),_:1})):w("",!0)]),default:_(()=>[n("div",gu,[v(X,{heading:"Heute:",small:!0,class:"grid-col-4 grid-left"},{default:_(()=>[v(Ge,{"watt-h":e.inverter.energy},null,8,["watt-h"])]),_:1}),v(X,{heading:"Monat:",small:!0,class:"grid-col-4"},{default:_(()=>[v(Ge,{"watt-h":e.inverter.energy_month},null,8,["watt-h"])]),_:1}),v(X,{heading:"Jahr:",small:!0,class:"grid-right grid-col-4"},{default:_(()=>[v(Ge,{"watt-h":e.inverter.energy_year},null,8,["watt-h"])]),_:1})])]),_:1}))}}),fu=R(mu,[["__scopeId","data-v-258d8f17"]]),vu=L({__name:"InverterList",setup(a){return(e,t)=>(l(),$(je,{"variable-width":!0},{title:_(()=>t[0]||(t[0]=[n("span",{class:"fas fa-solar-panel me-2",style:{color:"var(--color-pv)"}}," ",-1),n("span",null,"Wechselrichter",-1)])),buttons:_(()=>[i(Q).pv.power>0?(l(),$(Pe,{key:0,bgcolor:"var(--color-pv)"},{default:_(()=>[H(S(i($e)(i(Q).pv.power)),1)]),_:1})):w("",!0)]),default:_(()=>[(l(!0),f(F,null,te(i(we),([r,s])=>(l(),f("div",{key:r,class:"subgrid pb-2"},[v(fu,{inverter:s},null,8,["inverter"])]))),128))]),_:1}))}}),Ut=R(vu,[["__scopeId","data-v-b7a71f81"]]),yu={class:"row py-0 px-0 m-0"},bu=["breakpoints"],_u=L({__name:"CarouselFix",setup(a){let e,t;const r=ee(!1),s=m(()=>r.value?{992:{slidesPerView:1,spaceBetween:0}}:{992:{slidesPerView:3,spaceBetween:0}});return Ka(()=>g.zoomGraph,o=>{if(e){let h=o?"1":"3";t.setAttribute("slides-per-view",h),e.activeIndex=g.zoomedWidget,e.update()}}),Le(()=>{let o=document.querySelector(".swiper-carousel");o&&(t=o,e=t.swiper)}),(o,h)=>(l(),f("div",yu,[n("swiper-container",{"space-between":0,pagination:{clickable:!0},"slides-per-view":"1",class:"p-0 m-0 swiper-carousel",breakpoints:s.value},[n("swiper-slide",null,[n("div",{class:q([i(De)?"mb-0":"mb-5","flex-fill d-flex align-items-stretch"])},[pe(o.$slots,"item1",{},void 0,!0)],2)]),n("swiper-slide",null,[n("div",{class:q([i(De)?"mb-0":"mb-5","flex-fill d-flex align-items-stretch"])},[pe(o.$slots,"item2",{},void 0,!0)],2)]),n("swiper-slide",null,[n("div",{class:q([i(De)?"mb-0":"mb-5","flex-fill d-flex align-items-stretch"])},[pe(o.$slots,"item3",{},void 0,!0)],2)])],8,bu)]))}}),wu=R(_u,[["__scopeId","data-v-17424929"]]);function ku(a,e){a=="openWB/graph/boolDisplayLiveGraph"?de.displayLiveGraph=+e==1:a.match(/^openwb\/graph\/alllivevaluesJson[1-9][0-9]*$/i)?xu(a,e):a=="openWB/graph/lastlivevaluesJson"?Su(a,e):a=="openWB/graph/config/duration"&&(ge.duration=JSON.parse(e))}function xu(a,e){if(!ge.initialized){let t=[];const r=e.toString().split(` +var Ua=Object.defineProperty;var Fa=(a,e,t)=>e in a?Ua(a,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[e]=t;var b=(a,e,t)=>Fa(a,typeof e!="symbol"?e+"":e,t);import{r as le,m as Na,c as m,a as ee,i as Ha,e as Ve,u as Ft,t as et,b as xt,s as ce,d as L,p as wa,f as ka,w as Ra,o as l,g as f,h as S,j as n,n as q,k as $,l as w,q as pe,v as _,x as H,y as i,z as v,F,A as te,B as xa,C as He,D as ft,E as nt,G as rt,H as dt,I as ht,J as st,K as Ja,L as Ne,M as K,N as Ya,O as Le,P as vt,Q as qa,R as Qa,S as Sa,T as Za,U as Ma,V as Xa,W as Ka,X as en,Y as tn,Z as an,_ as nn,$ as rn,a0 as on,a1 as sn,a2 as ln}from"./vendor-CmSLe-Fc.js";(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const h of o.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&r(h)}).observe(document,{childList:!0,subtree:!0});function t(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(s){if(s.ep)return;s.ep=!0;const o=t(s);fetch(s.href,o)}})();var ve=(a=>(a.instant_charging="instant_charging",a.pv_charging="pv_charging",a.scheduled_charging="scheduled_charging",a.standby="standby",a.stop="stop",a))(ve||{});class $a{constructor(e){b(this,"id");b(this,"name","Wechselrichter");b(this,"color","var(--color-pv)");b(this,"power",0);b(this,"energy",0);b(this,"energy_month",0);b(this,"energy_year",0);b(this,"energy_total",0);this.id=e}}const cn=[["EV","ev_mode"],["Speicher","bat_mode"],["MinSoc","min_soc_bat_mode"]];class un{constructor(e){b(this,"id");b(this,"name","Gerät");b(this,"power",0);b(this,"status","off");b(this,"energy",0);b(this,"runningTime",0);b(this,"configured",!1);b(this,"_showInGraph",!0);b(this,"color","white");b(this,"canSwitch",!1);b(this,"countAsHouse",!1);b(this,"energyPv",0);b(this,"energyBat",0);b(this,"pvPercentage",0);b(this,"tempConfigured",0);b(this,"temp",[300,300,300]);b(this,"on",!1);b(this,"isAutomatic",!0);b(this,"icon","");this.id=e}get showInGraph(){return this._showInGraph}set showInGraph(e){this._showInGraph=e,T.items["sh"+this.id].showInGraph=e,ne()}setShowInGraph(e){this._showInGraph=e}}const ae=le(new Map);function Yt(a){ae.has(a)?console.info("Duplicate sh device message: "+a):(ae.set(a,new un(a)),ae.get(a).color="var(--color-sh"+ae.size+")")}const dn=0,Pa={host:location.hostname,port:location.protocol=="https:"?443:80,endpoint:"/ws",protocol:location.protocol=="https:"?"wss":"ws",connectTimeout:4e3,reconnectPeriod:4e3,clean:!1,clientId:Math.random().toString(36).replace(/[^a-z]+/g,"").substring(0,6)},St={topic:"",qos:dn};let Ce;const{host:hn,port:pn,endpoint:gn,...Ia}=Pa,sa=`${Ia.protocol}://${hn}:${pn}${gn}`;try{console.debug("connectURL",sa),Ce=Na.connect(sa,Ia),Ce.on("connect",()=>{console.info("MQTT connection successful")}),Ce.on("disconnect",()=>{console.info("MQTT disconnected")}),Ce.on("error",a=>{console.error("MQTT connection failed: ",a)})}catch(a){console.error("MQTT connect error: ",a)}function mn(a){Ce?Ce.on("message",a):console.error("MqttRegister: MQTT client not available")}function Xe(a){St.topic=a;const{topic:e,qos:t}=St;Ce.subscribe(e,{qos:t},r=>{if(r){console.error("MQTT Subscription error: "+r);return}})}function ot(a){St.topic=a;const{topic:e}=St;Ce.unsubscribe(e,t=>{if(t){console.error("MQTT Unsubscribe from "+a+" failed: "+t);return}})}async function Nt(a,e){let r=Ce.connected,s=0;for(;!r&&s<20;)console.warn("MQTT publish: Not connected. Waiting 0.1 seconds"),await fn(100),r=Ce.connected,s+=1;if(s<20)try{Ce.publish(a,e,{qos:0},o=>{o&&console.warn("MQTT publish error: ",o),console.info("MQTT publish: Message sent: ["+a+"]("+e+")")})}catch(o){console.warn("MQTT publish: caught error: "+o)}else console.error("MQTT publish: Lost connection to MQTT server. Please reload the page")}function qt(){return Pa.clientId}function fn(a){return new Promise(e=>setTimeout(e,a))}class vn{constructor(e){b(this,"id");b(this,"name","Ladepunkt");b(this,"icon","Ladepunkt");b(this,"type","");b(this,"ev",0);b(this,"template",0);b(this,"connectedPhases",0);b(this,"phase_1",0);b(this,"autoPhaseSwitchHw",!1);b(this,"controlPilotInterruptionHw",!1);b(this,"isEnabled",!0);b(this,"isPluggedIn",!1);b(this,"isCharging",!1);b(this,"_isLocked",!1);b(this,"_connectedVehicle",0);b(this,"chargeTemplate",0);b(this,"evTemplate",0);b(this,"_chargeMode",ve.pv_charging);b(this,"_hasPriority",!1);b(this,"currentPlan","");b(this,"averageConsumption",0);b(this,"vehicleName","");b(this,"rangeCharged",0);b(this,"rangeUnit","");b(this,"counter",0);b(this,"dailyYield",0);b(this,"energyPv",0);b(this,"energyBat",0);b(this,"pvPercentage",0);b(this,"faultState",0);b(this,"faultStr","");b(this,"phasesInUse",0);b(this,"power",0);b(this,"chargedSincePlugged",0);b(this,"stateStr","");b(this,"current",0);b(this,"currents",[0,0,0]);b(this,"phasesToUse",0);b(this,"isSocConfigured",!0);b(this,"isSocManual",!1);b(this,"waitingForSoc",!1);b(this,"color","white");b(this,"_timedCharging",!1);b(this,"_instantChargeLimitMode","");b(this,"_instantTargetCurrent",0);b(this,"_instantTargetSoc",0);b(this,"_instantMaxEnergy",0);b(this,"_pvFeedInLimit",!1);b(this,"_pvMinCurrent",0);b(this,"_pvMaxSoc",0);b(this,"_pvMinSoc",0);b(this,"_pvMinSocCurrent",0);b(this,"_etActive",!1);b(this,"_etMaxPrice",20);this.id=e}get isLocked(){return this._isLocked}set isLocked(e){this._isLocked=e,oe("cpLock",e,this.id)}updateIsLocked(e){this._isLocked=e}get connectedVehicle(){return this._connectedVehicle}set connectedVehicle(e){this._connectedVehicle=e,oe("cpVehicle",e,this.id)}updateConnectedVehicle(e){this._connectedVehicle=e}get soc(){return Y[this.connectedVehicle]?Y[this.connectedVehicle].soc:0}set soc(e){Y[this.connectedVehicle]&&(Y[this.connectedVehicle].soc=e)}get chargeMode(){return this._chargeMode}set chargeMode(e){this._chargeMode=e,oe("chargeMode",e,this.id)}updateChargeMode(e){this._chargeMode=e}get hasPriority(){return this._hasPriority}set hasPriority(e){this._hasPriority=e,oe("cpPriority",e,this.id)}updateCpPriority(e){this._hasPriority=e}get timedCharging(){return _e[this.chargeTemplate]?_e[this.chargeTemplate].time_charging.active:!1}set timedCharging(e){_e[this.chargeTemplate].time_charging.active=e,oe("cpTimedCharging",e,this.chargeTemplate)}get instantTargetCurrent(){return this._instantTargetCurrent}set instantTargetCurrent(e){this._instantTargetCurrent=e,oe("cpInstantTargetCurrent",e,this.id)}updateInstantTargetCurrent(e){this._instantTargetCurrent=e}get instantChargeLimitMode(){return this._instantChargeLimitMode}set instantChargeLimitMode(e){this._instantChargeLimitMode=e,oe("cpInstantChargeLimitMode",e,this.id)}updateInstantChargeLimitMode(e){this._instantChargeLimitMode=e}get instantTargetSoc(){return this._instantTargetSoc}set instantTargetSoc(e){this._instantTargetSoc=e,oe("cpInstantTargetSoc",e,this.id)}updateInstantTargetSoc(e){this._instantTargetSoc=e}get instantMaxEnergy(){return this._instantMaxEnergy}set instantMaxEnergy(e){this._instantMaxEnergy=e,oe("cpInstantMaxEnergy",e,this.id)}updateInstantMaxEnergy(e){this._instantMaxEnergy=e}get pvFeedInLimit(){return this._pvFeedInLimit}set pvFeedInLimit(e){this._pvFeedInLimit=e,oe("cpPvFeedInLimit",e,this.id)}updatePvFeedInLimit(e){this._pvFeedInLimit=e}get pvMinCurrent(){return this._pvMinCurrent}set pvMinCurrent(e){this._pvMinCurrent=e,oe("cpPvMinCurrent",e,this.id)}updatePvMinCurrent(e){this._pvMinCurrent=e}get pvMaxSoc(){return this._pvMaxSoc}set pvMaxSoc(e){this._pvMaxSoc=e,oe("cpPvMaxSoc",e,this.id)}updatePvMaxSoc(e){this._pvMaxSoc=e}get pvMinSoc(){return this._pvMinSoc}set pvMinSoc(e){this._pvMinSoc=e,oe("cpPvMinSoc",e,this.id)}updatePvMinSoc(e){this._pvMinSoc=e}get pvMinSocCurrent(){return this._pvMinSocCurrent}set pvMinSocCurrent(e){this._pvMinSocCurrent=e,oe("cpPvMinSocCurrent",e,this.id)}updatePvMinSocCurrent(e){this._pvMinSocCurrent=e}get realCurrent(){switch(this.phasesInUse){case 0:return 0;case 1:return this.currents[0];case 2:return(this.currents[0]+this.currents[1])/2;case 3:return(this.currents[0]+this.currents[1]+this.currents[2])/3;default:return 0}}get etActive(){return Y[this.connectedVehicle]?Y[this.connectedVehicle].etActive:!1}set etActive(e){Y[this.connectedVehicle]&&(Y[this.connectedVehicle].etActive=e)}get etMaxPrice(){return Y[this.connectedVehicle].etMaxPrice??0}set etMaxPrice(e){oe("cpEtMaxPrice",Math.round(e*10)/1e6,this.id)}toPowerItem(){return{name:this.name,power:this.power,energy:this.dailyYield,energyPv:this.energyPv,energyBat:this.energyBat,pvPercentage:this.pvPercentage,color:this.color,icon:this.icon,showInGraph:!0}}}class yn{constructor(e){b(this,"id");b(this,"name","__invalid");b(this,"tags",[]);b(this,"config",{});b(this,"soc",0);b(this,"range",0);b(this,"_chargeTemplateId",0);b(this,"_evTemplateId",0);this.id=e}get chargeTemplateId(){return this._chargeTemplateId}set chargeTemplateId(e){this._chargeTemplateId=e,oe("vhChargeTemplateId",e,this.id)}updateChargeTemplateId(e){this._chargeTemplateId=e}get evTemplateId(){return this._evTemplateId}set evTemplateId(e){this._evTemplateId=e,oe("vhEvTemplateId",e,this.id)}updateEvTemplateId(e){this._evTemplateId=e}get etActive(){return _e[this.chargeTemplateId]?_e[this.chargeTemplateId].et.active:!1}set etActive(e){_e[this.chargeTemplateId]&&oe("priceCharging",e,this.chargeTemplateId)}get etMaxPrice(){if(_e[this.chargeTemplateId]&&_e[this.chargeTemplateId].et.active)return _e[this.chargeTemplateId].et.max_price*1e5}get chargepoint(){for(const e of Object.values(O))if(e.connectedVehicle==this.id)return e}get visible(){return this.name!="__invalid"&&(this.id!=0||g.showStandardVehicle)}}const O=le({}),Y=le({}),_e=le({}),pt=le({}),gt=le({}),Ht=le({});function bn(a){if(!(a in O)){O[a]=new vn(a);const e="var(--color-cp"+(Object.values(O).length-1)+")";O[a].color=e;const t="cp"+a;ie[t]?ie["cp"+a].color=e:ie[t]={name:"Ladepunkt",color:e,icon:"Ladepunkt"}}}function _n(){Object.keys(O).forEach(a=>{delete O[parseInt(a)]})}const me=m(()=>{const a=[],e=Object.values(O),t=Object.values(Y).filter(o=>o.visible);let r=-1;switch(e.length){case 0:r=t[0]?t[0].id:-1;break;default:r=e[0].connectedVehicle}let s=-1;switch(e.length){case 0:case 1:s=t[0]?t[0].id:-1;break;default:s=e[1].connectedVehicle}return r==s&&(s=t[1]?t[1].id:-1),r!=-1&&a.push(r),s!=-1&&a.push(s),a}),wn={cpLock:"openWB/set/chargepoint/%/set/manual_lock",chargeMode:"openWB/set/vehicle/template/charge_template/%/chargemode/selected",cpPriority:"openWB/set/vehicle/template/charge_template/%/prio",cpTimedCharging:"openWB/set/vehicle/template/charge_template/%/time_charging/active",pvBatteryPriority:"openWB/set/general/chargemode_config/pv_charging/bat_mode",cpVehicle:"openWB/set/chargepoint/%/config/ev",cpInstantChargeLimitMode:"openWB/set/vehicle/template/charge_template/%/chargemode/instant_charging/limit/selected",cpInstantTargetCurrent:"openWB/set/vehicle/template/charge_template/%/chargemode/instant_charging/current",cpInstantTargetSoc:"openWB/set/vehicle/template/charge_template/%/chargemode/instant_charging/limit/soc",cpInstantMaxEnergy:"openWB/set/vehicle/template/charge_template/%/chargemode/instant_charging/limit/amount",cpPvFeedInLimit:"openWB/set/vehicle/template/charge_template/%/chargemode/pv_charging/feed_in_limit",cpPvMinCurrent:"openWB/set/vehicle/template/charge_template/%/chargemode/pv_charging/min_current",cpPvMaxSoc:"openWB/set/vehicle/template/charge_template/%/chargemode/pv_charging/max_soc",cpPvMinSoc:"openWB/set/vehicle/template/charge_template/%/chargemode/pv_charging/min_soc",cpPvMinSocCurrent:"openWB/set/vehicle/template/charge_template/%/chargemode/pv_charging/min_soc_current",cpEtMaxPrice:"openWB/set/vehicle/template/charge_template/%/et/max_price",vhChargeTemplateId:"openWB/set/vehicle/%/charge_template",vhEvTemplateId:"openWB/set/vehicle/%/ev_template",shSetManual:"openWB/set/LegacySmartHome/config/set/Devices/%/mode",shSwitchOn:"openWB/set/LegacySmartHome/config/set/Devices/%/device_manual_control",socUpdate:"openWB/set/vehicle/%/get/force_soc_update",setSoc:"openWB/set/vehicle/%/soc_module/calculated_soc_state/manual_soc",priceCharging:"openWB/set/vehicle/template/charge_template/%/et/active"};function oe(a,e,t=0){if(isNaN(t)){console.warn("Invalid index");return}let r=wn[a];if(!r){console.warn("No topic for update type "+a);return}switch(a){case"chargeMode":case"cpPriority":case"cpScheduledCharging":case"cpInstantTargetCurrent":case"cpInstantChargeLimitMode":case"cpInstantTargetSoc":case"cpInstantMaxEnergy":case"cpPvFeedInLimit":case"cpPvMinCurrent":case"cpPvMaxSoc":case"cpPvMinSoc":case"cpEtMaxPrice":case"cpPvMinSocCurrent":r=r.replace("%",O[t].chargeTemplate.toString());break;default:r=r.replace("%",String(t))}switch(typeof e){case"number":Nt(r,JSON.stringify(+e));break;default:Nt(r,JSON.stringify(e))}}function Qt(a){Nt("openWB/set/command/"+qt()+"/todo",JSON.stringify(a))}const be=500,Se=500,j={top:15,right:20,bottom:10,left:25},Zt=["charging","house","batIn","devices"];class kn{constructor(){b(this,"data",[]);b(this,"_graphMode","");b(this,"waitForData",!0)}get graphMode(){return this._graphMode}set graphMode(e){this._graphMode=e}}const y=le(new kn),Ca=ee(Ha),Ye=m(()=>[0,be-j.left-2*j.right].map(a=>Ca.value.applyX(a)));let mt=!0,it=!0;function ia(){mt=!1}function la(){mt=!0}function ca(){it=!1}function ua(){it=!0}function xn(a){it=a}function yt(a){y.data=a,y.waitForData=!1}const ge=le({refreshTopicPrefix:"openWB/graph/alllivevaluesJson",updateTopic:"openWB/graph/lastlivevaluesJson",configTopic:"openWB/graph/config/#",initialized:!1,initCounter:0,graphRefreshCounter:0,rawDataPacks:[],duration:0,activate(a){this.unsubscribeUpdates(),this.subscribeRefresh(),a&&(y.data=[]),y.waitForData=!0,Xe(this.configTopic),this.initialized=!1,this.initCounter=0,this.graphRefreshCounter=0,this.rawDataPacks=[],In(),lt.value=!0},deactivate(){this.unsubscribeRefresh(),this.unsubscribeUpdates(),ot(this.configTopic)},subscribeRefresh(){for(let a=1;a<17;a++)Xe(this.refreshTopicPrefix+a)},unsubscribeRefresh(){for(let a=1;a<17;a++)ot(this.refreshTopicPrefix+a)},subscribeUpdates(){Xe(this.updateTopic)},unsubscribeUpdates(){ot(this.updateTopic)}}),ue=le({topic:"openWB/log/daily/#",date:new Date,activate(a){if(y.graphMode=="day"||y.graphMode=="today"){y.graphMode=="today"&&(this.date=new Date);const e=this.date.getFullYear().toString()+(this.date.getMonth()+1).toString().padStart(2,"0")+this.date.getDate().toString().padStart(2,"0");this.topic="openWB/log/daily/"+e,Xe(this.topic),a&&(y.data=[]),y.waitForData=!0,Qt({command:"getDailyLog",data:{day:e}})}},deactivate(){ot(this.topic)},back(){this.date=new Date(this.date.setTime(this.date.getTime()-864e5))},forward(){this.date=new Date(this.date.setTime(this.date.getTime()+864e5))},setDate(a){this.date=a},getDate(){return this.date}}),Ee=le({topic:"openWB/log/monthly/#",month:new Date().getMonth()+1,year:new Date().getFullYear(),activate(a){const e=this.year.toString()+this.month.toString().padStart(2,"0");y.data=[],Xe(this.topic),a&&(y.data=[]),y.waitForData=!0,Qt({command:"getMonthlyLog",data:{month:e}})},deactivate(){ot(this.topic)},back(){this.month-=1,this.month<1&&(this.month=12,this.year-=1),this.activate()},forward(){const a=new Date;a.getFullYear()==this.year?this.month-112&&(this.month=1,this.year+=1)),this.activate()},getDate(){return new Date(this.year,this.month)}}),Re=le({topic:"openWB/log/yearly/#",month:new Date().getMonth()+1,year:new Date().getFullYear(),activate(a){const e=this.year.toString();Xe(this.topic),a&&(y.data=[]),y.waitForData=!0,Qt({command:"getYearlyLog",data:{year:e}})},deactivate(){ot(this.topic)},back(){this.year-=1,this.activate()},forward(){this.year0&&(T.items[a].energyPv+=1e3/12*(e[a]*(e.pv-e.evuOut))/(e.pv-e.evuOut+e.evuIn+e.batOut),T.items[a].energyBat+=1e3/12*(e[a]*e.batOut)/(e.pv-e.evuOut+e.evuIn+e.batOut))}function $n(a,e){e[a]>0&&(T.items[a].energyPv+=1e3*(e[a]*(e.pv-e.evuOut))/(e.pv-e.evuOut+e.evuIn+e.batOut),T.items[a].energyBat+=1e3*(e[a]*e.batOut)/(e.pv-e.evuOut+e.evuIn+e.batOut))}const Pn=["evuIn","pv","batOut","evuOut"],qe=ee(!1);function Xt(a,e){Object.entries(a).length>0?(qe.value=!1,Object.entries(a.counter).forEach(([t,r])=>{(e.length==0||e.includes(t))&&(T.items.evuIn.energy+=r.energy_imported,T.items.evuOut.energy+=r.energy_exported)}),T.items.pv.energy=a.pv.all.energy_exported,a.bat.all&&(T.items.batIn.energy=a.bat.all.energy_imported,T.items.batOut.energy=a.bat.all.energy_exported),Object.entries(a.cp).forEach(([t,r])=>{t=="all"?(T.setEnergy("charging",r.energy_imported),r.energy_imported_pv!=null&&(T.setEnergyPv("charging",r.energy_imported_pv),T.setEnergyBat("charging",r.energy_imported_bat))):T.setEnergy(t,r.energy_imported)}),T.setEnergy("devices",0),Object.entries(a.sh).forEach(([t,r])=>{T.setEnergy(t,r.energy_imported);const s=t.substring(2);ae.get(+s).countAsHouse||(T.items.devices.energy+=r.energy_imported)}),a.hc&&a.hc.all?(T.setEnergy("house",a.hc.all.energy_imported),a.hc.all.energy_imported_pv!=null&&(T.setEnergyPv("house",a.hc.all.energy_imported_pv),T.setEnergyBat("house",a.hc.all.energy_imported_bat))):T.calculateHouseEnergy(),T.keys().forEach(t=>{Pn.includes(t)||(T.setPvPercentage(t,Math.round((T.items[t].energyPv+T.items[t].energyBat)/T.items[t].energy*100)),Zt.includes(t)&&(U[t].energy=T.items[t].energy,U[t].energyPv=T.items[t].energyPv,U[t].energyBat=T.items[t].energyBat,U[t].pvPercentage=T.items[t].pvPercentage))}),y.graphMode=="today"&&(Object.values(O).forEach(t=>{const r=T.items["cp"+t.id];r&&(t.energyPv=r.energyPv,t.energyBat=r.energyBat,t.pvPercentage=r.pvPercentage)}),ae.forEach(t=>{const r=T.items["sh"+t.id];r&&(t.energy=r.energy,t.energyPv=r.energyPv,t.energyBat=r.energyBat,t.pvPercentage=r.pvPercentage)}))):qe.value=!0,lt.value=!0}const Be=m(()=>{const a=Ve(y.data,e=>new Date(e.date));return a[0]&&a[1]?Ft().domain(a).range([0,be-j.left-2*j.right]):et().range([0,0])});function In(){T.keys().forEach(a=>{Zt.includes(a)&&(U[a].energy=T.items[a].energy,U[a].energyPv=0,U[a].energyBat=0,U[a].pvPercentage=0)}),Object.values(O).forEach(a=>{a.energyPv=0,a.energyBat=0,a.pvPercentage=0}),ae.forEach(a=>{a.energyPv=0,a.energyBat=0,a.pvPercentage=0})}const Je=m(()=>{const a=Ve(y.data,e=>e.date);return a[1]?xt().domain(Array.from({length:a[1]},(e,t)=>t+1)).paddingInner(.4).range([0,be-j.left-2]):xt().range([0,0])});function It(){switch(y.graphMode){case"live":y.graphMode="today",g.showRightButton=!0,fe();break;case"today":y.graphMode="day",ue.deactivate(),ue.back(),ue.activate(),fe();break;case"day":ue.back(),fe();break;case"month":Ee.back();break;case"year":Re.back();break}}function Kt(){const a=new Date;switch(y.graphMode){case"live":break;case"today":y.graphMode="live",g.showRightButton=!1,fe();break;case"day":ue.forward(),ue.date.getDate()==a.getDate()&&ue.date.getMonth()==a.getMonth()&&ue.date.getFullYear()==a.getFullYear()&&(y.graphMode="today"),fe();break;case"month":Ee.forward();break;case"year":Re.forward();break}}function ea(){switch(y.graphMode){case"live":It();break;case"day":case"today":y.graphMode="month",fe();break;case"month":y.graphMode="year",fe();break}}function ta(){switch(y.graphMode){case"year":y.graphMode="month",fe();break;case"month":y.graphMode="today",fe();break;case"today":case"day":y.graphMode="live",fe();break}}function da(a){if(y.graphMode=="day"||y.graphMode=="today"){ue.setDate(a);const e=new Date;ue.date.getDate()==e.getDate()&&ue.date.getMonth()==e.getMonth()&&ue.date.getFullYear()==e.getFullYear()?y.graphMode="today":y.graphMode="day",fe()}}const Fe=ee(new Map);class Cn{constructor(){b(this,"_showRelativeArcs",!1);b(this,"showTodayGraph",!0);b(this,"_graphPreference","today");b(this,"_usageStackOrder",0);b(this,"_displayMode","dark");b(this,"_showGrid",!1);b(this,"_smartHomeColors","normal");b(this,"_decimalPlaces",1);b(this,"_showQuickAccess",!0);b(this,"_simpleCpList",!1);b(this,"_shortCpList","no");b(this,"_showAnimations",!0);b(this,"_preferWideBoxes",!1);b(this,"_maxPower",4e3);b(this,"_fluidDisplay",!1);b(this,"_showClock","no");b(this,"_showButtonBar",!0);b(this,"_showCounters",!1);b(this,"_showVehicles",!1);b(this,"_showStandardVehicle",!0);b(this,"_showPrices",!1);b(this,"_showInverters",!1);b(this,"_alternativeEnergy",!1);b(this,"_sslPrefs",!1);b(this,"_debug",!1);b(this,"_lowerPriceBound",0);b(this,"_upperPriceBound",0);b(this,"isEtEnabled",!1);b(this,"etPrice",20.5);b(this,"showRightButton",!0);b(this,"showLeftButton",!0);b(this,"animationDuration",300);b(this,"animationDelay",100);b(this,"zoomGraph",!1);b(this,"zoomedWidget",1)}get showRelativeArcs(){return this._showRelativeArcs}set showRelativeArcs(e){this._showRelativeArcs=e,ne()}setShowRelativeArcs(e){this._showRelativeArcs=e}get graphPreference(){return this._graphPreference}set graphPreference(e){this._graphPreference=e,ne()}setGraphPreference(e){this._graphPreference=e}get usageStackOrder(){return this._usageStackOrder}set usageStackOrder(e){this._usageStackOrder=e,ne()}setUsageStackOrder(e){this._usageStackOrder=e}get displayMode(){return this._displayMode}set displayMode(e){this._displayMode=e,On(e)}setDisplayMode(e){this._displayMode=e}get showGrid(){return this._showGrid}set showGrid(e){this._showGrid=e,ne()}setShowGrid(e){this._showGrid=e}get decimalPlaces(){return this._decimalPlaces}set decimalPlaces(e){this._decimalPlaces=e,ne()}setDecimalPlaces(e){this._decimalPlaces=e}get smartHomeColors(){return this._smartHomeColors}set smartHomeColors(e){this._smartHomeColors=e,ha(e),ne()}setSmartHomeColors(e){this._smartHomeColors=e,ha(e)}get showQuickAccess(){return this._showQuickAccess}set showQuickAccess(e){this._showQuickAccess=e,ne()}setShowQuickAccess(e){this._showQuickAccess=e}get simpleCpList(){return this._simpleCpList}set simpleCpList(e){this._simpleCpList=e,ne()}setSimpleCpList(e){this._simpleCpList=e}get shortCpList(){return this._shortCpList}set shortCpList(e){this._shortCpList=e,ne()}setShortCpList(e){this._shortCpList=e}get showAnimations(){return this._showAnimations}set showAnimations(e){this._showAnimations=e,ne()}setShowAnimations(e){this._showAnimations=e}get preferWideBoxes(){return this._preferWideBoxes}set preferWideBoxes(e){this._preferWideBoxes=e,ne()}setPreferWideBoxes(e){this._preferWideBoxes=e}get maxPower(){return this._maxPower}set maxPower(e){this._maxPower=e,ne()}setMaxPower(e){this._maxPower=e}get fluidDisplay(){return this._fluidDisplay}set fluidDisplay(e){this._fluidDisplay=e,ne()}setFluidDisplay(e){this._fluidDisplay=e}get showClock(){return this._showClock}set showClock(e){this._showClock=e,ne()}setShowClock(e){this._showClock=e}get sslPrefs(){return this._sslPrefs}set sslPrefs(e){this._sslPrefs=e,ne()}setSslPrefs(e){this.sslPrefs=e}get debug(){return this._debug}set debug(e){this._debug=e,ne()}setDebug(e){this._debug=e}get showButtonBar(){return this._showButtonBar}set showButtonBar(e){this._showButtonBar=e,ne()}setShowButtonBar(e){this._showButtonBar=e}get showCounters(){return this._showCounters}set showCounters(e){this._showCounters=e,ne()}setShowCounters(e){this._showCounters=e}get showVehicles(){return this._showVehicles}set showVehicles(e){this._showVehicles=e,ne()}setShowVehicles(e){this._showVehicles=e}get showStandardVehicle(){return this._showStandardVehicle}set showStandardVehicle(e){this._showStandardVehicle=e,ne()}setShowStandardVehicle(e){this._showStandardVehicle=e}get showPrices(){return this._showPrices}set showPrices(e){this._showPrices=e,ne()}setShowPrices(e){this._showPrices=e}get showInverters(){return this._showInverters}set showInverters(e){this._showInverters=e,la(),ua(),ne()}setShowInverters(e){this._showInverters=e}get alternativeEnergy(){return this._alternativeEnergy}set alternativeEnergy(e){this._alternativeEnergy=e,la(),ua(),ne()}setAlternativeEnergy(e){this._alternativeEnergy=e}get lowerPriceBound(){return this._lowerPriceBound}set lowerPriceBound(e){this._lowerPriceBound=e,ne()}setLowerPriceBound(e){this._lowerPriceBound=e}get upperPriceBound(){return this._upperPriceBound}set upperPriceBound(e){this._upperPriceBound=e,ne()}setUpperPriceBound(e){this._upperPriceBound=e}}const g=le(new Cn);function Ba(){En();const a=ce("html");a.classed("theme-dark",g.displayMode=="dark"),a.classed("theme-light",g.displayMode=="light"),a.classed("theme-blue",g.displayMode=="blue"),a.classed("shcolors-standard",g.smartHomeColors=="standard"),a.classed("shcolors-advanced",g.smartHomeColors=="advanced"),a.classed("shcolors-normal",g.smartHomeColors=="normal")}const Bn=992,Mt=le({x:document.documentElement.clientWidth,y:document.documentElement.clientHeight});function Vn(){Mt.x=document.documentElement.clientWidth,Mt.y=document.documentElement.clientHeight,Ba()}const De=m(()=>Mt.x>=Bn),ye={instant_charging:{mode:ve.instant_charging,name:"Sofort",color:"var(--color-charging)",icon:"fa-bolt"},pv_charging:{mode:ve.pv_charging,name:"PV",color:"var(--color-pv",icon:"fa-solar-panel"},scheduled_charging:{mode:ve.scheduled_charging,name:"Zielladen",color:"var(--color-battery)",icon:"fa-bullseye"},standby:{mode:ve.standby,name:"Standby",color:"var(--color-axis",icon:"fa-pause"},stop:{mode:ve.stop,name:"Stop",color:"var(--color-fg)",icon:"fa-power-off"}};class Ln{constructor(){b(this,"batterySoc",0);b(this,"isBatteryConfigured",!0);b(this,"chargeMode","0");b(this,"_pvBatteryPriority","ev_mode");b(this,"displayLiveGraph",!0);b(this,"isEtEnabled",!0);b(this,"etMaxPrice",0);b(this,"etCurrentPrice",0);b(this,"cpDailyExported",0);b(this,"evuId",0);b(this,"etProvider","")}get pvBatteryPriority(){return this._pvBatteryPriority}set pvBatteryPriority(e){this._pvBatteryPriority=e,oe("pvBatteryPriority",e)}updatePvBatteryPriority(e){this._pvBatteryPriority=e}}function ne(){Tn()}function On(a){const e=ce("html");e.classed("theme-dark",a=="dark"),e.classed("theme-light",a=="light"),e.classed("theme-blue",a=="blue"),ne()}function An(){g.maxPower=Q.evuIn.power+Q.pv.power+Q.batOut.power,ne()}function ha(a){const e=ce("html");e.classed("shcolors-normal",a=="normal"),e.classed("shcolors-standard",a=="standard"),e.classed("shcolors-advanced",a=="advanced")}const Te={chargemode:"Der Lademodus für das Fahrzeug an diesem Ladepunkt",vehicle:"Das Fahrzeug, das an diesem Ladepounkt geladen wird",locked:"Für das Laden sperren",priority:"Fahrzeuge mit Priorität werden bevorzugt mit mehr Leistung geladen, falls verfügbar",timeplan:"Das Laden nach Zeitplan für dieses Fahrzeug aktivieren",minsoc:"Immer mindestens bis zum eingestellten Ladestand laden. Wenn notwendig mit Netzstrom.",minpv:"Durchgehend mit mindestens dem eingestellten Strom laden. Wenn notwendig mit Netzstrom.",pricebased:"Laden bei dynamischem Stromtarif, wenn eingestellter Maximalpreis unterboten wird.",pvpriority:"Ladepriorität bei PV-Produktion. Bevorzung von Fahzeugen, Speicher, oder Fahrzeugen bis zum eingestellten Mindest-Ladestand. Die Einstellung ist für alle Ladepunkte gleich."};function Tn(){const a={};a.hideSH=[...ae.values()].filter(e=>!e.showInGraph).map(e=>e.id),a.showLG=g.graphPreference=="live",a.displayM=g.displayMode,a.stackO=g.usageStackOrder,a.showGr=g.showGrid,a.decimalP=g.decimalPlaces,a.smartHomeC=g.smartHomeColors,a.relPM=g.showRelativeArcs,a.maxPow=g.maxPower,a.showQA=g.showQuickAccess,a.simpleCP=g.simpleCpList,a.shortCP=g.shortCpList,a.animation=g.showAnimations,a.wideB=g.preferWideBoxes,a.fluidD=g.fluidDisplay,a.clock=g.showClock,a.showButtonBar=g.showButtonBar,a.showCounters=g.showCounters,a.showVehicles=g.showVehicles,a.showStandardV=g.showStandardVehicle,a.showPrices=g.showPrices,a.showInv=g.showInverters,a.altEngy=g.alternativeEnergy,a.lowerP=g.lowerPriceBound,a.upperP=g.upperPriceBound,a.sslPrefs=g.sslPrefs,a.debug=g.debug,document.cookie="openWBColorTheme="+JSON.stringify(a)+";max-age=16000000;"+(g.sslPrefs?"SameSite=None;Secure":"SameSite=Strict")}function En(){const e=document.cookie.split(";").filter(t=>t.split("=")[0]==="openWBColorTheme");if(e.length>0){const t=JSON.parse(e[0].split("=")[1]);t.decimalP!==void 0&&g.setDecimalPlaces(+t.decimalP),t.smartHomeC!==void 0&&g.setSmartHomeColors(t.smartHomeC),t.hideSH!==void 0&&t.hideSH.forEach(r=>{ae.get(r)==null&&Yt(r),ae.get(r).setShowInGraph(!1)}),t.showLG!==void 0&&g.setGraphPreference(t.showLG?"live":"today"),t.maxPow!==void 0&&g.setMaxPower(+t.maxPow),t.relPM!==void 0&&g.setShowRelativeArcs(t.relPM),t.displayM!==void 0&&g.setDisplayMode(t.displayM),t.stackO!==void 0&&g.setUsageStackOrder(t.stackO),t.showGr!==void 0&&g.setShowGrid(t.showGr),t.showQA!==void 0&&g.setShowQuickAccess(t.showQA),t.simpleCP!==void 0&&g.setSimpleCpList(t.simpleCP),t.shortCP!==void 0&&g.setShortCpList(t.shortCP),t.animation!=null&&g.setShowAnimations(t.animation),t.wideB!=null&&g.setPreferWideBoxes(t.wideB),t.fluidD!=null&&g.setFluidDisplay(t.fluidD),t.clock!=null&&g.setShowClock(t.clock),t.showButtonBar!==void 0&&g.setShowButtonBar(t.showButtonBar),t.showCounters!==void 0&&g.setShowCounters(t.showCounters),t.showVehicles!==void 0&&g.setShowVehicles(t.showVehicles),t.showStandardV!==void 0&&g.setShowStandardVehicle(t.showStandardV),t.showPrices!==void 0&&g.setShowPrices(t.showPrices),t.showInv!==void 0&&g.setShowInverters(t.showInv),t.altEngy!==void 0&&g.setAlternativeEnergy(t.altEngy),t.lowerP!==void 0&&g.setLowerPriceBound(t.lowerP),t.upperP!==void 0&&g.setUpperPriceBound(t.upperP),t.sslPrefs!==void 0&&g.setSslPrefs(t.sslPrefs),t.debug!==void 0&&g.setDebug(t.debug)}}const ie=le({evuIn:{name:"Netz",color:"var(--color-evu)",icon:""},pv:{name:"PV",color:"var(--color-pv",icon:""},batOut:{name:"Bat >",color:"var(--color-battery)",icon:""},evuOut:{name:"Export",color:"var(--color-export)",icon:""},charging:{name:"Laden",color:"var(--color-charging)",icon:""},devices:{name:"Geräte",color:"var(--color-devices)",icon:""},batIn:{name:"> Bat",color:"var(--color-battery)",icon:""},house:{name:"Haus",color:"var(--color-house)",icon:""},cp1:{name:"Ladepunkt",color:"var(--color-cp1)",icon:"Ladepunkt"},cp2:{name:"Ladepunkt",color:"var(--color-cp2)",icon:"Ladepunkt"},cp3:{name:"Ladepunkt",color:"var(--color-cp3)",icon:"Ladepunkt"},cp4:{name:"Ladepunkt",color:"var(--color-cp4)",icon:"Ladepunkt"},cp5:{name:"Ladepunkt",color:"var(--color-cp5)",icon:"Ladepunkt"},cp6:{name:"Ladepunkt",color:"var(--color-cp6)",icon:"Ladepunkt"},cp7:{name:"Ladepunkt",color:"var(--color-cp7)",icon:"Ladepunkt"},cp8:{name:"Ladepunkt",color:"var(--color-cp8)",icon:"Ladepunkt"},sh1:{name:"Gerät",color:"var(--color-sh1)",icon:"Gerät"},sh2:{name:"Gerät",color:"var(--color-sh2)",icon:"Gerät"},sh3:{name:"Gerät",color:"var(--color-sh3)",icon:"Gerät"},sh4:{name:"Gerät",color:"var(--color-sh4)",icon:"Gerät"},sh5:{name:"Gerät",color:"var(--color-sh5)",icon:"Gerät"},sh6:{name:"Gerät",color:"var(--color-sh6)",icon:"Gerät"},sh7:{name:"Gerät",color:"var(--color-sh7)",icon:"Gerät"},sh8:{name:"Gerät",color:"var(--color-sh8)",icon:"Gerät"},sh9:{name:"Gerät",color:"var(--color-sh9)",icon:"Gerät"},pv1:{name:"PV",color:"var(--color-pv1)",icon:"Wechselrichter"},pv2:{name:"PV",color:"var(--color-pv2)",icon:"Wechselrichter"},pv3:{name:"PV",color:"var(--color-pv3)",icon:"Wechselrichter"},pv4:{name:"PV",color:"var(--color-pv4)",icon:"Wechselrichter"},pv5:{name:"PV",color:"var(--color-pv5)",icon:"Wechselrichter"},pv6:{name:"PV",color:"var(--color-pv6)",icon:"Wechselrichter"},pv7:{name:"PV",color:"var(--color-pv7)",icon:"Wechselrichter"},pv8:{name:"PV",color:"var(--color-pv8)",icon:"Wechselrichter"},pv9:{name:"PV",color:"var(--color-pv9)",icon:"Wechselrichter"},bat1:{name:"Speicher",color:"var(--color-battery)",icon:"Speicher"},bat2:{name:"Speicher",color:"var(--color-battery)",icon:"Speicher"},bat3:{name:"Speicher",color:"var(--color-battery)",icon:"Speicher"},bat4:{name:"Speicher",color:"var(--color-battery)",icon:"Speicher"},bat5:{name:"Speicher",color:"var(--color-battery)",icon:"Speicher"},bat6:{name:"Speicher",color:"var(--color-battery)",icon:"Speicher"},bat7:{name:"Speicher",color:"var(--color-battery)",icon:"Speicher"},bat8:{name:"Speicher",color:"var(--color-battery)",icon:"Speicher"},bat9:{name:"Speicher",color:"var(--color-battery)",icon:"Speicher"}});class Va{constructor(){b(this,"_items",{});this.addItem("evuIn"),this.addItem("pv"),this.addItem("batOut"),this.addItem("evuOut"),this.addItem("charging"),this.addItem("devices"),this.addItem("batIn"),this.addItem("house")}get items(){return this._items}keys(){return Object.keys(this._items)}values(){return Object.values(this._items)}addItem(e,t){this._items[e]=t?ze(e,t):ze(e)}setEnergy(e,t){this.keys().includes(e)||this.addItem(e),this._items[e].energy=t}setEnergyPv(e,t){this.keys().includes(e)||this.addItem(e),this._items[e].energyPv=t}setEnergyBat(e,t){this.keys().includes(e)||this.addItem(e),this._items[e].energyBat=t}setPvPercentage(e,t){this.keys().includes(e)||this.addItem(e),this._items[e].pvPercentage=t<=100?t:100}calculateHouseEnergy(){this._items.house.energy=this._items.evuIn.energy+this._items.pv.energy+this._items.batOut.energy-this._items.evuOut.energy-this._items.batIn.energy-this._items.charging.energy-this._items.devices.energy}}let T=le(new Va);function aa(){T=new Va}const Q=le({evuIn:ze("evuIn"),pv:ze("pv"),batOut:ze("batOut")}),U=le({evuOut:ze("evuOut"),charging:ze("charging"),devices:ze("devices"),batIn:ze("batIn"),house:ze("house")}),de=le(new Ln);ee("");const lt=ee(!1);function ze(a,e){return{name:ie[a]?ie[a].name:"item",power:0,energy:0,energyPv:0,energyBat:0,pvPercentage:0,color:e||(ie[a]?ie[a].color:"var(--color-charging)"),icon:ie[a]?ie[a].icon:"",showInGraph:!0}}const Rt=ee(new Date),we=ee(new Map),zn=a=>{we.value.set(a,new $a(a)),we.value.get(a).color=ie["pv"+we.value.size].color},Wn=["origin"],Dn=L({__name:"PMSourceArc",props:{radius:{},cornerRadius:{},circleGapSize:{},emptyPower:{}},setup(a){const e=a,t=m(()=>{let r={name:"",power:e.emptyPower,energy:0,energyPv:0,energyBat:0,pvPercentage:0,color:"var(--color-bg)",icon:"",showInGraph:!0},s=Q;s["zz-empty"]=r;const o=Object.values(Q).length-1,h=wa().value(p=>p.power).startAngle(-Math.PI/2+e.circleGapSize).endAngle(Math.PI/2-e.circleGapSize).sort(null),d=ka().innerRadius(e.radius/6*5).outerRadius(e.radius).cornerRadius(e.cornerRadius).padAngle(0),u=ce("g#pmSourceArc");return u.selectAll("*").remove(),u.selectAll("sources").data(h(Object.values(s))).enter().append("path").attr("d",d).attr("fill",p=>p.data.color).attr("stroke",(p,c)=>c==o?p.data.power>0?"var(--color-scale)":"null":p.data.color),"pmSourceArc.vue"});return Ra(()=>{let r=Q.pv.power+Q.evuIn.power+Q.batOut.power;r>g.maxPower&&(g.maxPower=r)}),(r,s)=>(l(),f("g",{id:"pmSourceArc",origin:t.value},null,8,Wn))}}),Gn=["origin"],jn=L({__name:"PMUsageArc",props:{radius:{},cornerRadius:{},circleGapSize:{},emptyPower:{}},setup(a){const e=a,t=m(()=>{let r={name:"",power:e.emptyPower,energy:0,energyPv:0,energyBat:0,pvPercentage:0,color:"var(--color-bg)",icon:"",showInGraph:!0};const s=[U.evuOut,U.charging].concat([...ae.values()].filter(p=>p.configured&&!p.countAsHouse).sort((p,c)=>c.power-p.power)).concat([U.batIn,U.house]).concat(r),o=s.length-1,h=wa().value(p=>p.power).startAngle(Math.PI*1.5-e.circleGapSize).endAngle(Math.PI/2+e.circleGapSize).sort(null),d=ka().innerRadius(e.radius/6*5).outerRadius(e.radius).cornerRadius(e.cornerRadius),u=ce("g#pmUsageArc");return u.selectAll("*").remove(),u.selectAll("consumers").data(h(s)).enter().append("path").attr("d",d).attr("fill",p=>p.data.color).attr("stroke",(p,c)=>c==o?p.data.power>0?"var(--color-scale)":"null":p.data.color),"pmUsageArc.vue"});return(r,s)=>(l(),f("g",{id:"pmUsageArc",origin:t.value},null,8,Gn))}});function $e(a,e=1){let t;if(a>=1e3&&e<4){switch(e){case 0:t=Math.round(a/1e3);break;case 1:t=Math.round(a/100)/10;break;case 2:t=Math.round(a/10)/100;break;case 3:t=Math.round(a)/1e3;break;default:t=Math.round(a/100)/10;break}return(t==null?void 0:t.toLocaleString(void 0,{minimumFractionDigits:e}))+" kW"}else return Math.round(a).toLocaleString()+" W"}function ct(a,e=1,t=!1){let r;if(a>1e6&&(t=!0,a=a/1e3),a>=1e3&&e<4){switch(e){case 0:r=Math.round(a/1e3);break;case 1:r=Math.round(a/100)/10;break;case 2:r=Math.round(a/10)/100;break;case 3:r=Math.round(a)/1e3;break;default:r=Math.round(a/100)/10;break}return r.toLocaleString(void 0,{minimumFractionDigits:e})+(t?" MWh":" kWh")}else return Math.round(a).toLocaleString()+(t?" kWh":" Wh")}function Un(a){const e=Math.floor(a/3600),t=(a%3600/60).toFixed(0);return e>0?e+"h "+t+" min":t+" min"}function La(a){return a.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}function Fn(a,e){return["Jan","Feb","März","April","Mai","Juni","Juli","Aug","Sep","Okt","Nov","Dez"][a]+" "+e}function Nn(a){return a!=999?(Math.round(a*10)/10).toLocaleString(void 0,{minimumFractionDigits:1})+"°":"-"}const bt=L({__name:"FormatWatt",props:{watt:{}},setup(a){const e=a,t=m(()=>$e(e.watt,g.decimalPlaces));return(r,s)=>S(t.value)}}),Hn={key:0,id:"pmLabel"},Rn=["x","y","fill","text-anchor"],Jn=22,Ae=L({__name:"PMLabel",props:{x:{},y:{},data:{},props:{},anchor:{},labeltext:{},labelicon:{},labelcolor:{}},setup(a){const e=a,t=m(()=>e.labeltext?e.labeltext:e.props?e.props.icon+" ":e.labelicon?e.labelicon+" ":""),r=m(()=>e.labelcolor?e.labelcolor:e.props?e.props.color:""),s=m(()=>!e.data||e.data.power>0),o=m(()=>e.labeltext?"":"fas");return(h,d)=>s.value?(l(),f("g",Hn,[n("text",{x:h.x,y:h.y,fill:r.value,"text-anchor":h.anchor,"font-size":Jn,class:"pmLabel"},[n("tspan",{class:q(o.value)},S(t.value),3),n("tspan",null,[h.data!==void 0?(l(),$(bt,{key:0,watt:h.data.power},null,8,["watt"])):w("",!0)])],8,Rn)])):w("",!0)}}),Yn={class:"wb-widget p-0 m-0 shadow"},qn={class:"d-flex justify-content-between"},Qn={class:"m-4 me-0 mb-0"},Zn={class:"p-4 pb-0 ps-0 m-0",style:{"text-align":"right"}},Xn={class:"px-4 pt-4 pb-2 wb-subwidget"},Kn={class:"row"},er={class:"col m-0 p-0"},tr={class:"container-fluid m-0 p-0"},ar={key:0},nr={class:"px-4 py-2 wb-subwidget"},rr={class:"row"},or={class:"col"},sr={class:"container-fluid m-0 p-0"},_t=L({__name:"WBWidget",props:{variableWidth:{type:Boolean},fullWidth:{type:Boolean}},setup(a){const e=a,t=m(()=>e.fullWidth?"col-12":e.variableWidth&&g.preferWideBoxes?"col-lg-6":"col-lg-4");return(r,s)=>(l(),f("div",{class:q(["p-2 m-0 d-flex",t.value])},[n("div",Yn,[n("div",qn,[n("h3",Qn,[pe(r.$slots,"title",{},()=>[s[0]||(s[0]=n("div",{class:"p-0"},"(title goes here)",-1))]),pe(r.$slots,"subtitle")]),n("div",Zn,[pe(r.$slots,"buttons")])]),n("div",Xn,[n("div",Kn,[n("div",er,[n("div",tr,[pe(r.$slots,"default")])])])]),r.$slots.footer!=null?(l(),f("div",ar,[s[1]||(s[1]=n("hr",null,null,-1)),n("div",nr,[n("div",rr,[n("div",or,[n("div",sr,[pe(r.$slots,"footer")])])])])])):w("",!0)])],2))}});class ir{constructor(){b(this,"active",!1);b(this,"etPriceList",new Map);b(this,"etProvider","");b(this,"etMaxPrice",0)}get etCurrentPriceString(){const[e]=re.etPriceList.values();return(Math.round(e*10)/10).toFixed(1)+" ct"}}const re=le(new ir),lr={id:"powermeter",class:"p-0 m-0"},cr=["viewBox"],ur=["transform"],dr=["x"],Ze=500,Ue=20,pa=1,hr=L({__name:"PowerMeter",setup(a){const e=Ze,t=Math.PI/40,r=[[4],[4,6],[1,4,6],[0,2,4,6],[0,2,3,5,6]],s=[{x:-85,y:e/2*1/5},{x:0,y:e/2*1/5},{x:85,y:e/2*1/5},{x:-85,y:e/2*2/5},{x:0,y:e/2*2/5},{x:85,y:e/2*2/5},{x:0,y:e/2*3/5}],o=m(()=>Ze/2-Ue),h=m(()=>{let B="",A=Object.values(Q).filter(V=>V.power>0);return A.length==1&&A[0].name=="PV"?B="Aktueller Verbrauch: ":B="Bezug/Verbrauch: ",B+$e(U.house.power+U.charging.power+U.devices.power+U.batIn.power,g.decimalPlaces)}),d=m(()=>{let B=Q.pv.power+Q.evuIn.power+Q.batOut.power;return g.maxPower>B?$e(g.maxPower,g.decimalPlaces):$e(B,g.decimalPlaces)}),u=m(()=>Object.values(O)),p=m(()=>{let B=0;return g.showRelativeArcs&&(B=g.maxPower-(Q.pv.power+Q.evuIn.power+Q.batOut.power)),B<0?0:B}),c=m(()=>[U.evuOut,U.charging,U.devices,U.batIn,U.house].filter(B=>B.power>0)),k=m(()=>r[c.value.length-1]);function P(B){return s[k.value[B]]}function z(B){return B.length>12?B.slice(0,11)+".":B}const D=m(()=>{const[B]=re.etPriceList.values();return Math.round(B*10)/10});return(B,A)=>(l(),$(_t,{"full-width":!0},{title:_(()=>A[0]||(A[0]=[H(" Aktuelle Leistung ")])),default:_(()=>[n("figure",lr,[(l(),f("svg",{viewBox:"0 0 "+Ze+" "+i(e)},[n("g",{transform:"translate("+Ze/2+","+i(e)/2+")"},[v(Dn,{radius:o.value,"corner-radius":pa,"circle-gap-size":t,"empty-power":p.value},null,8,["radius","empty-power"]),v(jn,{"sh-device":i(ae),radius:o.value,"corner-radius":pa,"circle-gap-size":t,"empty-power":p.value},null,8,["sh-device","radius","empty-power"]),v(Ae,{x:0,y:-i(e)/10*2,data:i(Q).pv,props:i(ie).pv,anchor:"middle",config:i(g)},null,8,["y","data","props","config"]),v(Ae,{x:0,y:-i(e)/10*3,data:i(Q).evuIn,props:i(ie).evuIn,anchor:"middle",config:i(g)},null,8,["y","data","props","config"]),v(Ae,{x:0,y:-i(e)/10,data:i(Q).batOut,props:i(ie).batOut,anchor:"middle",config:i(g)},null,8,["y","data","props","config"]),i(re).active?(l(),$(Ae,{key:0,x:0,y:-i(e)/10,data:i(Q).batOut,props:i(ie).batOut,anchor:"middle",config:i(g)},null,8,["y","data","props","config"])):w("",!0),(l(!0),f(F,null,te(c.value,(V,J)=>(l(),$(Ae,{key:J,x:P(J).x,y:P(J).y,data:V,labelicon:V.icon,labelcolor:V.color,anchor:"middle",config:i(g)},null,8,["x","y","data","labelicon","labelcolor","config"]))),128)),i(me)[0]!=null&&i(Y)[i(me)[0]]!=null?(l(),$(Ae,{key:1,x:-500/2-Ue/4+10,y:-i(e)/2+Ue+5,labeltext:z(i(Y)[i(me)[0]].name)+": "+Math.round(i(Y)[i(me)[0]].soc)+"%",labelcolor:u.value[0]?u.value[0].color:"var(--color-charging)",anchor:"start",config:i(g)},null,8,["x","y","labeltext","labelcolor","config"])):w("",!0),i(me)[1]!=null&&i(Y)[i(me)[1]]!=null?(l(),$(Ae,{key:2,x:Ze/2+Ue/4-10,y:-i(e)/2+Ue+5,labeltext:z(i(Y)[i(me)[1]].name)+": "+Math.round(i(Y)[i(me)[1]].soc)+"%",labelcolor:u.value[1]?u.value[1].color:"var(--color-charging)",anchor:"end",config:i(g)},null,8,["x","y","labeltext","labelcolor","config"])):w("",!0),i(de).batterySoc>0?(l(),$(Ae,{key:3,x:-500/2-Ue/4+10,y:i(e)/2-Ue+15,labeltext:"Speicher: "+i(de).batterySoc+"%",labelcolor:i(U).batIn.color,anchor:"start",config:i(g)},null,8,["x","y","labeltext","labelcolor","config"])):w("",!0),i(re).active?(l(),$(Ae,{key:4,x:Ze/2+Ue/4-10,y:i(e)/2-Ue+15,value:D.value,labeltext:i(re).etCurrentPriceString,labelcolor:"var(--color-charging)",anchor:"end",config:i(g)},null,8,["x","y","value","labeltext","config"])):w("",!0),v(Ae,{x:0,y:0,labeltext:h.value,labelcolor:"var(--color-fg)",anchor:"middle",config:i(g)},null,8,["labeltext","config"]),i(g).showRelativeArcs?(l(),f("text",{key:5,x:Ze/2-44,y:"2","text-anchor":"middle",fill:"var(--color-axis)","font-size":"12"}," Peak: "+S(d.value),9,dr)):w("",!0)],8,ur)],8,cr))])]),_:1}))}}),pr=["origin","origin2","transform"],gr=L({__name:"PgSourceGraph",props:{width:{},height:{},margin:{}},setup(a){const e=a,t={house:"var(--color-house)",batIn:"var(--color-battery)",inverter:"var(--color-pv)",batOut:"var(--color-battery)",selfUsage:"var(--color-pv)",pv:"var(--color-pv)",evuOut:"var(--color-export)",evuIn:"var(--color-evu)"};var r,s;const o=g.showAnimations?g.animationDuration:0,h=g.showAnimations?g.animationDelay:0,d=m(()=>{const M=ce("g#pgSourceGraph");if(y.data.length>0){y.graphMode=="month"||y.graphMode=="year"?J(M,Je.value):V(M,Be.value),M.selectAll(".axis").remove();const E=M.append("g").attr("class","axis");E.call(D.value),E.selectAll(".tick").attr("font-size",12),E.selectAll(".tick line").attr("stroke",A.value).attr("stroke-width",B.value),E.select(".domain").attr("stroke","var(--color-bg)")}return"pgSourceGraph.vue"}),u=m(()=>xa().value((M,E)=>M[E]??0).keys(k.value)),p=m(()=>u.value(y.data)),c=m(()=>He().range([e.height-10,0]).domain(y.graphMode=="year"?[0,Math.ceil(P.value[1]*10)/10]:[0,Math.ceil(P.value[1])])),k=m(()=>{let M=[];const E=["batOut","evuIn"];if(g.showInverters){const I=/pv\d+/;y.data.length>0&&(M=Object.keys(y.data[0]).reduce((x,G)=>(G.match(I)&&x.push(G),x),[]))}switch(y.graphMode){case"live":return g.showInverters?["pv","batOut","evuIn"]:["selfUsage","evuOut","batOut","evuIn"];case"today":case"day":return M.forEach((I,x)=>{t[I]="var(--color-pv"+(x+1)+")"}),g.showInverters?[...M,...E]:["selfUsage","evuOut","batOut","evuIn"];default:return["evuIn","batOut","selfUsage","evuOut"]}}),P=m(()=>{let M=Ve(y.data,E=>Math.max(E.pv+E.evuIn+E.batOut,E.selfUsage+E.evuOut));return M[0]!=null&&M[1]!=null?(y.graphMode=="year"&&(M[0]=M[0]/1e3,M[1]=M[1]/1e3),M):[0,0]}),z=m(()=>y.graphMode=="month"||y.graphMode=="year"?-e.width-e.margin.right-22:-e.width),D=m(()=>ft(c.value).tickSizeInner(z.value).ticks(4).tickFormat(M=>(M==0?"":Math.round(M*10)/10).toLocaleString(void 0))),B=m(()=>g.showGrid?"0.5":"1"),A=m(()=>g.showGrid?"var(--color-grid)":"var(--color-bg)");function V(M,E){const I=nt().x((G,xe)=>E(y.data[xe].date)).y(c.value(0)).curve(rt),x=nt().x((G,xe)=>E(y.data[xe].date)).y0(G=>c.value(y.graphMode=="year"?G[0]/1e3:G[0])).y1(G=>c.value(y.graphMode=="year"?G[1]/1e3:G[1])).curve(rt);mt?(M.selectAll("*").remove(),r=M.append("svg").attr("x",0).attr("width",e.width).selectAll(".sourceareas").data(p.value).enter().append("path").attr("fill",(xe,W)=>t[k.value[W]]).attr("d",xe=>I(xe)),r.transition().duration(o).delay(h).ease(dt).attr("d",xe=>x(xe)),ia()):r.data(p.value).transition().duration(0).ease(dt).attr("d",G=>x(G))}function J(M,E){y.data.length>0&&(mt?(M.selectAll("*").remove(),s=M.selectAll(".sourcebar").data(p.value).enter().append("g").attr("fill",(I,x)=>t[k.value[x]]).selectAll("rect").data(I=>I).enter().append("rect").attr("x",(I,x)=>E(y.data[x].date)??0).attr("y",()=>c.value(0)).attr("height",0).attr("width",E.bandwidth()),s.transition().duration(o).delay(h).ease(dt).attr("height",I=>y.graphMode=="year"?c.value(I[0]/1e3)-c.value(I[1]/1e3):c.value(I[0])-c.value(I[1])).attr("y",I=>y.graphMode=="year"?c.value(I[1]/1e3):c.value(I[1])),ia()):(M.selectAll("*").remove(),s=M.selectAll(".sourcebar").data(p.value).enter().append("g").attr("fill",(I,x)=>t[k.value[x]]).selectAll("rect").data(I=>I).enter().append("rect").attr("x",(I,x)=>E(y.data[x].date)??0).attr("y",I=>y.graphMode=="year"?c.value(I[1]/1e3):c.value(I[1])).attr("width",E.bandwidth()).attr("height",I=>y.graphMode=="year"?c.value(I[0]/1e3)-c.value(I[1]/1e3):c.value(I[0])-c.value(I[1]))))}const C=m(()=>{const M=ce("g#pgSourceGraph");if(y.graphMode!="month"&&y.graphMode!="year"&&y.data.length>0){Be.value.range(Ye.value);const E=nt().x((I,x)=>Be.value(y.data[x].date)).y0(I=>c.value(I[0])).y1(I=>c.value(I[1])).curve(rt);M.selectAll("path").attr("d",I=>I?E(I):""),M.selectAll("g#sourceToolTips").select("rect").attr("x",I=>Be.value(I.date)).attr("width",e.width/y.data.length)}return"zoomed"});return(M,E)=>(l(),f("g",{id:"pgSourceGraph",origin:d.value,origin2:C.value,transform:"translate("+M.margin.left+","+M.margin.top+")"},null,8,pr))}}),mr=["origin","origin2","transform"],fr=L({__name:"PgUsageGraph",props:{width:{},height:{},margin:{},stackOrder:{}},setup(a){const e=a,t=m(()=>g.showInverters?[["house","charging","devices","batIn","evuOut"],["charging","devices","batIn","house","evuOut"],["devices","batIn","charging","house","evuOut"],["batIn","charging","house","devices","evuOut"]]:[["house","charging","devices","batIn"],["charging","devices","batIn","house"],["devices","batIn","charging","house"],["batIn","charging","house","devices"]]),r={house:"var(--color-house)",charging:"var(--color-charging)",batIn:"var(--color-battery)",batOut:"var(--color-battery)",selfUsage:"var(--color-pv)",evuOut:"var(--color-export)",evuIn:"var(--color-evu)",cp0:"var(--color-cp0)",cp1:"var(--color-cp1)",cp2:"var(--color-cp2)",cp3:"var(--color-cp3)",sh1:"var(--color-sh1)",sh2:"var(--color-sh2)",sh3:"var(--color-sh3)",sh4:"var(--color-sh4)",devices:"var(--color-devices)"};var s,o;const h=g.showAnimations?g.animationDuration:0,d=g.showAnimations?g.animationDelay:0,u=m(()=>{const C=ce("g#pgUsageGraph");y.graphMode=="month"||y.graphMode=="year"?V(C):A(C),C.selectAll(".axis").remove();const M=C.append("g").attr("class","axis");return M.call(B.value),M.selectAll(".tick").attr("font-size",12).attr("color","var(--color-axis)"),g.showGrid?M.selectAll(".tick line").attr("stroke","var(--color-grid)").attr("stroke-width","0.5"):M.selectAll(".tick line").attr("stroke","var(--color-bg)"),M.select(".domain").attr("stroke","var(--color-bg)"),"pgUsageGraph.vue"}),p=m(()=>xa().value((C,M)=>C[M]??0).keys(P.value)),c=m(()=>p.value(y.data)),k=m(()=>He().range([e.height+10,2*e.height]).domain(y.graphMode=="year"?[0,Math.ceil(z.value[1]*10)/10]:[0,Math.ceil(z.value[1])])),P=m(()=>{if(y.graphMode!="today"&&y.graphMode!="day"&&y.graphMode!="live")return t.value[e.stackOrder];{const C=t.value[e.stackOrder].slice(),M=C.indexOf("charging");C.splice(M,1);const E=/cp\d+/;let I=[];return y.data.length>0&&(I=Object.keys(y.data[0]).reduce((x,G)=>(G.match(E)&&x.push(G),x),[])),I.forEach((x,G)=>{var xe;C.splice(M+G,0,x),r[x]=((xe=O[+x.slice(2)])==null?void 0:xe.color)??"black"}),g.showInverters&&C.push("evuOut"),C}}),z=m(()=>{let C=Ve(y.data,M=>M.house+M.charging+M.batIn+M.devices+M.evuOut);return C[0]!=null&&C[1]!=null?(y.graphMode=="year"&&(C[0]=C[0]/1e3,C[1]=C[1]/1e3),C):[0,0]}),D=m(()=>y.graphMode=="month"||y.graphMode=="year"?-e.width-e.margin.right-22:-e.width),B=m(()=>ft(k.value).tickSizeInner(D.value).ticks(4).tickFormat(C=>(C==0?"":Math.round(C*10)/10).toLocaleString(void 0)));function A(C){const M=nt().x((I,x)=>Be.value(y.data[x].date)).y(k.value(0)).curve(rt),E=nt().x((I,x)=>Be.value(y.data[x].date)).y0(I=>k.value(I[0])).y1(I=>k.value(I[1])).curve(rt);g.showAnimations?it?(C.selectAll("*").remove(),s=C.append("svg").attr("x",0).attr("width",e.width).selectAll(".usageareas").data(c.value).enter().append("path").attr("d",x=>M(x)).attr("fill",(x,G)=>r[P.value[G]]),s.transition().duration(300).delay(100).ease(dt).attr("d",x=>E(x)),ca()):(C.selectAll("*").remove(),C.append("svg").attr("x",0).attr("width",e.width).selectAll(".usageareas").data(c.value).enter().append("path").attr("d",x=>E(x)).attr("fill",(x,G)=>r[P.value[G]])):(C.selectAll("*").remove(),C.append("svg").attr("x",0).attr("width",e.width).selectAll(".usageareas").data(c.value).enter().append("path").attr("d",x=>E(x)).attr("fill",(x,G)=>r[P.value[G]]))}function V(C){it?(C.selectAll("*").remove(),o=C.selectAll(".usagebar").data(c.value).enter().append("g").attr("fill",(M,E)=>r[t.value[e.stackOrder][E]]).selectAll("rect").data(M=>M).enter().append("rect").attr("x",(M,E)=>Je.value(y.data[E].date)??0).attr("y",()=>k.value(0)).attr("height",0).attr("width",Je.value.bandwidth()),o.transition().duration(h).delay(d).ease(dt).attr("y",M=>y.graphMode=="year"?k.value(M[0]/1e3):k.value(M[0])).attr("height",M=>y.graphMode=="year"?k.value(M[1]/1e3)-k.value(M[0]/1e3):k.value(M[1])-k.value(M[0])),ca()):(C.selectAll("*").remove(),o=C.selectAll(".usagebar").data(c.value).enter().append("g").attr("fill",(M,E)=>r[t.value[e.stackOrder][E]]).selectAll("rect").data(M=>M).enter().append("rect").attr("x",(M,E)=>Je.value(y.data[E].date)??0).attr("y",M=>y.graphMode=="year"?k.value(M[0]/1e3):k.value(M[0])).attr("height",M=>y.graphMode=="year"?k.value(M[1]/1e3)-k.value(M[0]/1e3):k.value(M[1])-k.value(M[0])).attr("width",Je.value.bandwidth()))}const J=m(()=>{const C=ce("g#pgUsageGraph");if(y.graphMode!="month"&&y.graphMode!="year"){Be.value.range(Ye.value);const M=nt().x((E,I)=>Be.value(y.data[I].date)).y0(E=>k.value(E[0])).y1(E=>k.value(E[1])).curve(rt);C.selectAll("path").attr("d",E=>E?M(E):"")}return"zoomed"});return(C,M)=>(l(),f("g",{id:"pgUsageGraph",origin:u.value,origin2:J.value,transform:"translate("+C.margin.left+","+C.margin.top+")"},null,8,mr))}}),vr=["width"],yr=["transform"],br=["x","width"],_r=["transform"],wr=["origin","origin2","transform"],kr=["origin","transform"],xr={key:0},Sr=["width","height"],Mr={key:1},$r=["y","width","height"],Bt=12,Pr=L({__name:"PgXAxis",props:{width:{},height:{},margin:{}},setup(a){const e=a,t=m(()=>ht(Be.value).ticks(6).tickSizeInner(h.value).tickFormat(st("%H:%M"))),r=m(()=>Ja(Be.value).ticks(6).tickSizeInner(h.value+3).tickFormat(st(""))),s=m(()=>ht(Je.value).ticks(4).tickSizeInner(h.value).tickFormat(c=>c.toString())),o=m(()=>ht(Je.value).ticks(4).tickSizeInner(h.value).tickFormat(()=>"")),h=m(()=>y.graphMode!=="month"&&y.graphMode!=="year"?g.showGrid?-(e.height/2-7):-10:0),d=m(()=>{let c=ce("g#PGXAxis"),k=ce("g#PgUnit");return c.selectAll("*").remove(),k.selectAll("*").remove(),y.graphMode=="month"||y.graphMode=="year"?c.call(s.value):c.call(t.value),c.selectAll(".tick > text").attr("fill",(P,z)=>z>=0||y.graphMode=="month"||y.graphMode=="year"?"var(--color-axis)":"var(--color-bg)").attr("font-size",Bt),g.showGrid?c.selectAll(".tick line").attr("stroke","var(--color-grid)").attr("stroke-width","0.5"):c.selectAll(".tick line").attr("stroke","var(--color-bg)"),c.select(".domain").attr("stroke","var(--color-bg)"),k.append("text").attr("x",0).attr("y",12).attr("fill","var(--color-axis)").attr("font-size",Bt).text(y.graphMode=="year"?"MW":"kW").attr("text-anchor","start"),"PGXAxis.vue"}),u=m(()=>{let c=ce("g#PGXAxis2");return c.selectAll("*").remove(),y.graphMode=="month"||y.graphMode=="year"?c.call(o.value):c.call(r.value),c.selectAll(".tick > text").attr("fill",(k,P)=>P>=0||y.graphMode=="month"||y.graphMode=="year"?"var(--color-axis)":"var(--color-bg)").attr("font-size",Bt),g.showGrid?(c.selectAll(".tick line").attr("stroke","var(--color-grid)").attr("stroke-width","0.5"),c.select(".domain").attr("stroke","var(--color-bg)")):c.selectAll(".tick line").attr("stroke","var(--color-bg)"),c.select(".domain").attr("stroke","var(--color-bg)"),"PGXAxis2.vue"}),p=m(()=>{if(y.graphMode!="month"&&y.graphMode!="year"){const c=ce("g#PGXAxis"),k=ce("g#PGXAxis2");y.graphMode=="month"||y.graphMode=="year"?(Je.value.range(Ye.value),c.call(s.value),k.call(o.value)):(Be.value.range(Ye.value),c.call(t.value),k.call(r.value))}return"zoomed"});return(c,k)=>(l(),f(F,null,[(l(),f("svg",{x:"0",width:e.width},[n("g",{id:"PgUnit",transform:"translate(0,"+(c.height/2+9)+")"},null,8,yr)],8,vr)),(l(),f("svg",{x:e.margin.left,width:e.width},[n("g",{transform:"translate("+c.margin.left+","+c.margin.top+")"},[n("g",{id:"PGXAxis",class:"axis",origin:d.value,origin2:p.value,transform:"translate(0,"+(c.height/2-6)+")"},null,8,wr),n("g",{id:"PGXAxis2",class:"axis",origin:u.value,transform:"translate(0,"+(c.height/2+10)+")"},null,8,kr),i(g).showGrid?(l(),f("g",xr,[n("rect",{x:"0",y:"0",width:c.width,height:c.height/2-10,fill:"none",stroke:"var(--color-grid)","stroke-width":"0.5"},null,8,Sr)])):w("",!0),i(g).showGrid?(l(),f("g",Mr,[n("rect",{x:"0",y:c.height/2+10,width:c.width,height:c.height/2-10,fill:"none",stroke:"var(--color-grid)","stroke-width":"0.5"},null,8,$r)])):w("",!0)],8,_r)],8,br))],64))}}),Ir=["width"],Cr=["id",".origin","d"],Br=["id","d","stroke"],Vr=["x","y","text-anchor"],Vt=L({__name:"PgSoc",props:{width:{},height:{},margin:{},order:{}},setup(a){const e=a,t=m(()=>{let P=Ve(y.data,z=>z.date);return P[0]&&P[1]?et().domain(P).range([0,e.width]):et().range([0,0])}),r=m(()=>He().range([e.height-10,0]).domain([0,100])),s=m(()=>{let z=Ne().x(D=>t.value(D.date)).y(D=>r.value(e.order==2?D.batSoc:e.order==0?D["soc"+me.value[0]]:D["soc"+me.value[1]])??r.value(0))(y.data);return z||""}),o=m(()=>e.order),h=m(()=>{switch(e.order){case 2:return"Speicher";case 1:return Y[me.value[1]]!=null?Y[me.value[1]].name:"???";default:return Y[me.value[0]]!=null?Y[me.value[0]].name:"???"}}),d=m(()=>{switch(e.order){case 0:return"var(--color-cp1)";case 1:return"var(--color-cp2)";case 2:return"var(--color-battery)";default:return"red"}}),u=m(()=>{switch(e.order){case 0:return 3;case 1:return e.width-3;case 2:return e.width/2;default:return 0}}),p=m(()=>{if(y.data.length>0){let P;switch(e.order){case 0:return P=y.data.length-1,r.value(y.data[P]["soc"+me.value[0]]+2);case 1:return P=0,r.value(y.data[P]["soc"+me.value[1]]+2);case 2:return P=Math.round(y.data.length/2),r.value(y.data[P].batSoc+2);default:return 0}}else return 0}),c=m(()=>{switch(e.order){case 0:return"start";case 1:return"end";case 2:return"middle";default:return"middle"}}),k=m(()=>{if(y.graphMode!="month"&&y.graphMode!="year"){const P=ce("path#soc-"+o.value),z=ce("path#socdashes-"+o.value);t.value.range(Ye.value);const D=Ne().x(B=>t.value(B.date)).y(B=>r.value(e.order==2?B.batSoc:e.order==1?B["soc"+me.value[0]]:B["soc"+me.value[1]])??r.value(0));P.attr("d",D(y.data)),z.attr("d",D(y.data))}return"zoomed"});return(P,z)=>(l(),f("svg",{x:"0",width:e.width},[n("path",{id:"soc-"+o.value,".origin":k.value,class:"soc-baseline",d:s.value,stroke:"var(--color-bg)","stroke-width":"1",fill:"none"},null,40,Cr),n("path",{id:"socdashes-"+o.value,class:"soc-dashes",d:s.value,stroke:d.value,"stroke-width":"1",style:{strokeDasharray:"3,3"},fill:"none"},null,8,Br),n("text",{class:"cpname",x:u.value,y:p.value,style:K({fill:d.value,fontSize:10}),"text-anchor":c.value},S(h.value),13,Vr)],8,Ir))}}),Lr=["transform"],Or=L({__name:"PgSocAxis",props:{width:{},height:{},margin:{}},setup(a){const e=a,t=m(()=>He().range([e.height-10,0]).domain([0,100])),r=m(()=>Ya(t.value).ticks(5).tickFormat(o=>o.toString()+"%"));function s(){let o=ce("g#PGSocAxis");o.call(r.value),o.selectAll(".tick").attr("font-size",12),o.selectAll(".tick line").attr("stroke","var(--color-bg)"),o.select(".domain").attr("stroke","var(--color-bg)")}return Le(()=>{s()}),(o,h)=>(l(),f("g",{id:"PGSocAxis",class:"axis",transform:"translate("+(o.width-20)+",0)"},null,8,Lr))}}),Ar={class:"d-flex align-self-top justify-content-center align-items-center"},Tr={class:"input-group input-group-xs"},Er={key:0,class:"btn dropdown-toggle",type:"button","data-bs-toggle":"dropdown"},zr={class:"dropdown-menu"},Wr={class:"table optiontable"},Dr=["onClick"],Gr={key:1,class:"btn dropdown-toggle",type:"button","data-bs-toggle":"dropdown"},jr={class:"dropdown-menu"},Ur={class:"table optiontable"},Fr=["onClick"],Nr={key:2,class:"btn dropdown-toggle",type:"button","data-bs-toggle":"dropdown"},Hr={class:"dropdown-menu"},Rr={class:"table optiontable"},Jr=["onClick"],Yr=L({__name:"DateInput",props:{modelValue:{type:Date,required:!0},mode:{type:String,default:"day"}},emits:["update:modelValue"],setup(a,{emit:e}){const t=a,r=new Date().getFullYear();let s=Array.from({length:10},(z,D)=>r-D);const o=ee(!0),h=e,d=[[0,1,2,3],[4,5,6,7],[8,9,10,11]],u=ee(t.modelValue.getDate()),p=ee(t.modelValue.getMonth()),c=ee(t.modelValue.getFullYear()),k=m(()=>{const D=new Date(c.value,p.value,1).getDay();let B=0;switch(p.value){case 1:case 3:case 5:case 7:case 8:case 10:case 12:B=31;break;case 4:case 6:case 9:case 11:B=30;break;case 2:Math.trunc(c.value/4)*4==c.value?B=29:B=28}let A=[],V=[0,0,0,0,0,0,0],J=D;for(let C=0;C(l(),f("span",Ar,[n("div",Tr,[t.mode=="day"||t.mode=="today"?(l(),f("button",Er,S(u.value),1)):w("",!0),n("div",zr,[n("table",Wr,[(l(!0),f(F,null,te(k.value,(B,A)=>(l(),f("tr",{key:A,class:""},[(l(!0),f(F,null,te(B,(V,J)=>(l(),f("td",{key:J},[V!=0?(l(),f("span",{key:0,type:"button",class:"btn optionbutton",onClick:C=>u.value=V},S(V),9,Dr)):w("",!0)]))),128))]))),128))])]),t.mode!="year"&&t.mode!="live"?(l(),f("button",Gr,S(p.value+1),1)):w("",!0),n("div",jr,[n("table",Ur,[(l(),f(F,null,te(d,(B,A)=>n("tr",{key:A,class:""},[(l(!0),f(F,null,te(B,(V,J)=>(l(),f("td",{key:J,class:"p-0 m-0"},[n("span",{type:"button",class:"btn btn-sm optionbutton",onClick:C=>p.value=V},S(V+1),9,Fr)]))),128))])),64))])]),t.mode!="live"?(l(),f("button",Nr,S(c.value),1)):w("",!0),n("div",Hr,[n("table",Rr,[(l(!0),f(F,null,te(i(s),(B,A)=>(l(),f("tr",{key:A,class:""},[n("td",null,[n("span",{type:"button",class:"btn optionbutton",onClick:V=>c.value=B},S(B),9,Jr)])]))),128))])]),t.mode!="live"?(l(),f("button",{key:3,class:"button-outline-secondary",type:"button",onClick:P},D[0]||(D[0]=[n("span",{class:"fa-solid fa-circle-check"},null,-1)]))):w("",!0)])]))}}),R=(a,e)=>{const t=a.__vccOpts||a;for(const[r,s]of e)t[r]=s;return t},qr=R(Yr,[["__scopeId","data-v-98690e5d"]]),Qr={class:"btn-group m-0",role:"group","aria-label":"radiobar"},Zr=["id","value"],Xr=L({__name:"RadioBarInput",props:{options:{},modelValue:{}},emits:["update:modelValue"],setup(a,{emit:e}){const t=a,r=e,s=m({get(){return t.modelValue},set(d){r("update:modelValue",d)}});function o(d){let u=t.options[d].color?t.options[d].color:"var(--color-fg)";return t.options[d].active?{color:"var(--color-bg)",background:u}:{color:u}}function h(d){let u=d.target;for(;u&&!u.value&&u.parentElement;)u=u.parentElement;u.value&&(s.value=u.value)}return(d,u)=>(l(),f("div",null,[n("div",Qr,[(l(!0),f(F,null,te(d.options,(p,c)=>(l(),f("button",{id:"radio-"+p.value,key:c,class:q(["btn btn-outline-secondary btn-sm radiobutton mx-0 mb-0 px-2",p.value==s.value?"active":""]),value:p.value,style:K(o(c)),onClick:h},[n("span",{style:K(o(c))},[p.icon?(l(),f("i",{key:0,class:q(["fa-solid",p.icon])},null,2)):w("",!0),H(" "+S(p.text),1)],4)],14,Zr))),128))])]))}}),Oa=R(Xr,[["__scopeId","data-v-82ab6829"]]),Kr=L({__name:"PgSelector",props:{widgetid:{},showLeftButton:{type:Boolean},showRightButton:{type:Boolean},ignoreLive:{type:Boolean}},emits:["shiftLeft","shiftRight","shiftUp","shiftDown"],setup(a){const e=a,t=ee(0),r=m(()=>{if(y.waitForData)return"Lädt";switch(y.graphMode){case"live":return e.ignoreLive?"heute":`${ge.duration} min`;case"today":return"heute";case"day":return ue.date.getDate()+"."+(ue.date.getMonth()+1)+".";case"month":return Fn(Ee.month-1,Ee.year);case"year":return Re.year.toString();default:return"???"}}),s=["live","today","day","month","year"],o=["Live","Heute","Tag","Monat","Jahr"],h=m({get(){return y.graphMode},set(J){switch(J){case"day":k();break;case"today":P();break;case"live":c();break;case"month":z();break;case"year":D()}}}),d=m(()=>{switch(y.graphMode){case"live":case"today":return ue.getDate();case"month":return Ee.getDate();default:return ue.getDate()}});function u(J){da(J)}function p(){t.value+=1,t.value>2&&(t.value=0)}function c(){y.graphMode!="live"&&(y.graphMode="live",fe())}function k(){y.graphMode!="day"&&y.graphMode!="today"&&(y.graphMode="day",fe())}function P(){y.graphMode!="today"&&(y.graphMode="today",da(new Date),fe())}function z(){y.graphMode!="month"&&(y.graphMode="month",fe())}function D(){y.graphMode!="year"&&(y.graphMode="year",fe())}const B=m(()=>t.value>0?{border:"1px solid var(--color-frame)"}:""),A=m(()=>t.value==1?"justify-content-between":"justify-content-end"),V=m(()=>t.value==1?"justify-content-between":"justify-content-center");return(J,C)=>(l(),f("div",{class:"d-flex flex-column justify-content-center pgselector rounded",style:K(B.value)},[t.value==2?(l(),$(Oa,{key:0,id:"pgm2",modelValue:h.value,"onUpdate:modelValue":C[0]||(C[0]=M=>h.value=M),class:"m-2",options:s.map((M,E)=>({text:o[E],value:M,color:"var(--color-menu)",active:M==i(y).graphMode}))},null,8,["modelValue","options"])):w("",!0),t.value==1?(l(),f("span",{key:1,type:"button",class:q(["arrowButton d-flex align-self-center mb-3 mt-3",{disabled:!e.showLeftButton}]),onClick:C[1]||(C[1]=M=>J.$emit("shiftUp"))},C[6]||(C[6]=[n("i",{class:"fa-solid fa-xl fa-chevron-circle-up"},null,-1)]),2)):w("",!0),n("div",{class:q(["d-flex align-items-center",V.value])},[t.value==1?(l(),f("span",{key:0,type:"button",class:q(["p-1",{disabled:!e.showLeftButton}]),onClick:C[2]||(C[2]=M=>J.$emit("shiftLeft"))},C[7]||(C[7]=[n("span",{class:"fa-solid fa-xl fa-chevron-circle-left arrowButton"},null,-1)]),2)):w("",!0),t.value<2?(l(),f("span",{key:1,type:"button",class:"btn-outline-secondary p-2 px-3 badge rounded-pill datebadge",onClick:p},S(r.value),1)):w("",!0),t.value==2?(l(),$(qr,{key:2,"model-value":d.value,mode:i(y).graphMode,"onUpdate:modelValue":u},null,8,["model-value","mode"])):w("",!0),t.value==1?(l(),f("span",{key:3,id:"graphRightButton",type:"button",class:q(["arrowButton fa-solid fa-xl fa-chevron-circle-right p-1",{disabled:!e.showRightButton}]),onClick:C[3]||(C[3]=M=>J.$emit("shiftRight"))},null,2)):w("",!0)],2),n("div",{class:q(["d-flex align-items-center",A.value])},[t.value==1?(l(),f("span",{key:0,type:"button",class:"p-1",onClick:p},C[8]||(C[8]=[n("span",{class:"fa-solid fa-xl fa-gear"},null,-1)]))):w("",!0),t.value==1?(l(),f("span",{key:1,id:"graphLeftButton",type:"button",class:q(["arrowButton fa-solid fa-xl fa-chevron-circle-down p-1",{disabled:!e.showLeftButton}]),onClick:C[4]||(C[4]=M=>J.$emit("shiftDown"))},null,2)):w("",!0),t.value>0?(l(),f("span",{key:2,type:"button",class:"p-1",onClick:C[5]||(C[5]=M=>t.value=0)},C[9]||(C[9]=[n("span",{class:"fa-solid fa-xl fa-circle-check"},null,-1)]))):w("",!0)],2)],4))}}),na=R(Kr,[["__scopeId","data-v-d75ec1a4"]]),eo=["x","fill"],to=["x"],Ie=L({__name:"PgToolTipLine",props:{cat:{},name:{},indent:{},power:{},width:{}},setup(a){const e=a;return(t,r)=>(l(),f(F,null,[t.power>0?(l(),f("tspan",{key:0,x:t.indent,dy:"1.3em",class:q(t.name?"":"fas"),fill:i(ie)[t.cat].color},S(t.name?t.name:i(ie)[t.cat].icon)+"   ",11,eo)):w("",!0),n("tspan",{"text-anchor":"end",x:t.width-t.indent},[e.power>0?(l(),$(bt,{key:0,watt:t.power*1e3},null,8,["watt"])):w("",!0)],8,to)],64))}}),ao=["transform"],no=["width","height"],ro={"text-anchor":"start",x:"5",y:"20","font-size":"16",fill:"var(--color-fg)"},oo=["x"],so=L({__name:"PgToolTipItem",props:{entry:{},boxwidth:{},xScale:{type:[Function,Object]}},setup(a){const e=a,t=m(()=>Object.values(e.entry).filter(u=>u>0).length),r=m(()=>t.value*16),s=m(()=>Object.entries(e.entry).filter(([u,p])=>u.startsWith("pv")&&u.length>2&&p>0).map(([u,p])=>({power:p,name:Fe.value.get(u)?d(Fe.value.get(u)):"Wechselr.",id:u}))),o=m(()=>Object.entries(e.entry).filter(([u,p])=>u.startsWith("cp")&&u.length>2&&p>0).map(([u,p])=>({power:p,name:Fe.value.get(u)?d(Fe.value.get(u)):"Ladep.",id:u}))),h=m(()=>Object.entries(e.entry).filter(([u,p])=>u.startsWith("sh")&&u.length>2&&p>0).map(([u,p])=>({power:p,name:Fe.value.get(u)?d(Fe.value.get(u)):"Gerät",id:u})));function d(u){return u.length>6?u.slice(0,6)+"...":u}return(u,p)=>(l(),f("g",{class:"ttmessage",transform:"translate("+u.xScale(u.entry.date)+",0)"},[n("rect",{rx:"5",width:u.boxwidth,height:r.value,fill:"var(--color-bg)",opacity:"80%",stroke:"var(--color-menu)"},null,8,no),n("text",ro,[n("tspan",{"text-anchor":"middle",x:u.boxwidth/2,dy:"0em"},S(i(st)("%H:%M")(new Date(u.entry.date))),9,oo),p[0]||(p[0]=n("line",{y:"120",x1:"5",x2:"100",stroke:"var(--color-fg)","stroke-width":"1"},null,-1)),v(Ie,{cat:"evuIn",indent:5,power:u.entry.evuIn,width:u.boxwidth},null,8,["power","width"]),v(Ie,{cat:"batOut",indent:5,power:u.entry.batOut,width:u.boxwidth},null,8,["power","width"]),v(Ie,{cat:"pv",indent:5,power:u.entry.pv,width:u.boxwidth},null,8,["power","width"]),(l(!0),f(F,null,te(s.value,c=>(l(),$(Ie,{key:c.id,cat:"pv",name:c.name,power:c.power,indent:10,width:u.boxwidth},null,8,["name","power","width"]))),128)),v(Ie,{cat:"house",indent:5,power:u.entry.house,width:u.boxwidth},null,8,["power","width"]),v(Ie,{cat:"charging",indent:5,power:u.entry.charging,width:u.boxwidth},null,8,["power","width"]),(l(!0),f(F,null,te(o.value,c=>(l(),$(Ie,{key:c.id,cat:"charging",name:c.name,power:c.power,indent:10,width:u.boxwidth},null,8,["name","power","width"]))),128)),v(Ie,{cat:"devices",indent:5,power:u.entry.devices,width:u.boxwidth},null,8,["power","width"]),(l(!0),f(F,null,te(h.value,c=>(l(),$(Ie,{key:c.id,cat:"devices",name:c.name,power:c.power,indent:10,width:u.boxwidth},null,8,["name","power","width"]))),128)),v(Ie,{cat:"batIn",indent:5,power:u.entry.batIn,width:u.boxwidth},null,8,["power","width"]),v(Ie,{cat:"evuOut",indent:5,power:u.entry.evuOut,width:u.boxwidth},null,8,["power","width"])])],8,ao))}}),io=["origin","transform"],lo=["x","height","width"],ga=140,co=L({__name:"PgToolTips",props:{width:{},height:{},margin:{},data:{}},setup(a){const e=a,t=m(()=>{const o=Ve(e.data,h=>new Date(h.date));return o[0]&&o[1]?Ft().domain(o).range([0,e.width-e.margin.right]):et().range([0,0])}),r=m(()=>{const o=Ve(e.data,h=>new Date(h.date));return o[0]&&o[1]?Ft().domain(o).range([0,e.width-e.margin.right-ga]):et().range([0,0])}),s=m(()=>((y.graphMode=="day"||y.graphMode=="today")&&(t.value.range(Ye.value),ce("g#pgToolTips").selectAll("g.ttarea").select("rect").attr("x",(o,h)=>e.data.length>h?t.value(e.data[h].date):0).attr("width",e.data.length>0?(Ye.value[1]-Ye.value[0])/e.data.length:0)),"PgToolTips.vue:autozoom"));return(o,h)=>(l(),f("g",{id:"pgToolTips",origin:s.value,transform:"translate("+o.margin.left+","+o.margin.top+")"},[(l(!0),f(F,null,te(o.data,d=>(l(),f("g",{key:d.date,class:"ttarea"},[n("rect",{x:t.value(d.date),y:"0",height:o.height,class:"ttrect",width:i(y).data.length>0?o.width/i(y).data.length:0,opacity:"1%",fill:"var(--color-charging)"},null,8,lo),v(so,{entry:d,boxwidth:ga,"x-scale":r.value},null,8,["entry","x-scale"])]))),128))],8,io))}}),uo={class:"d-flex justify-content-end"},ho={id:"powergraphFigure",class:"p-0 m-0"},po=["viewBox"],go=["transform"],mo=["x","y"],fo=2,vo="Leistung / Ladestand ",yo=L({__name:"PowerGraph",setup(a){function e(){let h=g.usageStackOrder+1;h>fo&&(h=0),g.usageStackOrder=h,xn(!0)}function t(h){const d=[[0,j.top],[be,Se-j.top]];h.call(Qa().scaleExtent([1,8]).translateExtent([[0,0],[be,Se]]).extent(d).filter(s).on("zoom",r))}function r(h){Ca.value=h.transform}function s(h){return h.preventDefault(),(!h.ctrlKey||h.type==="wheel")&&!h.button}function o(){g.zoomedWidget=1,g.zoomGraph=!g.zoomGraph}return Le(()=>{const h=ce("svg#powergraph");t(h)}),(h,d)=>(l(),$(_t,{"full-width":!0},{title:_(()=>[H(S(vo))]),buttons:_(()=>[n("div",uo,[v(na,{widgetid:"graphsettings","show-left-button":!0,"show-right-button":!0,"ignore-live":!1,onShiftLeft:i(It),onShiftRight:i(Kt),onShiftUp:i(ea),onShiftDown:i(ta)},null,8,["onShiftLeft","onShiftRight","onShiftUp","onShiftDown"]),i(De)?(l(),f("span",{key:0,type:"button",class:"ms-1 p-0 pt-1",onClick:o},d[0]||(d[0]=[n("span",{class:"fa-solid fa-lg ps-1 fa-magnifying-glass"},null,-1)]))):w("",!0)])]),default:_(()=>[vt(n("figure",ho,[(l(),f("svg",{id:"powergraph",class:"powergraphSvg",viewBox:"0 0 "+i(be)+" "+i(Se)},[v(gr,{width:i(be)-i(j).left-2*i(j).right,height:(i(Se)-i(j).top-i(j).bottom)/2,margin:i(j)},null,8,["width","height","margin"]),v(fr,{width:i(be)-i(j).left-2*i(j).right,height:(i(Se)-i(j).top-i(j).bottom)/2,margin:i(j),"stack-order":i(g).usageStackOrder},null,8,["width","height","margin","stack-order"]),v(Pr,{width:i(be)-i(j).left-2*i(j).right,height:i(Se)-i(j).top-i(j).bottom,margin:i(j)},null,8,["width","height","margin"]),n("g",{transform:"translate("+i(j).left+","+i(j).top+")"},[(i(y).graphMode=="day"||i(y).graphMode=="today"||i(y).graphMode=="live")&&Object.values(i(Y)).filter(u=>u.visible).length>0?(l(),$(Vt,{key:0,width:i(be)-i(j).left-2*i(j).right,height:(i(Se)-i(j).top-i(j).bottom)/2,margin:i(j),order:0},null,8,["width","height","margin"])):w("",!0),(i(y).graphMode=="day"||i(y).graphMode=="today"||i(y).graphMode=="live")&&Object.values(i(Y)).filter(u=>u.visible).length>1?(l(),$(Vt,{key:1,width:i(be)-i(j).left-2*i(j).right,height:(i(Se)-i(j).top-i(j).bottom)/2,margin:i(j),order:1},null,8,["width","height","margin"])):w("",!0),(i(y).graphMode=="day"||i(y).graphMode=="today"||i(y).graphMode=="live")&&i(de).isBatteryConfigured?(l(),$(Vt,{key:2,width:i(be)-i(j).left-2*i(j).right,height:(i(Se)-i(j).top-i(j).bottom)/2,margin:i(j),order:2},null,8,["width","height","margin"])):w("",!0),i(y).graphMode=="day"||i(y).graphMode=="today"||i(y).graphMode=="live"?(l(),$(Or,{key:3,width:i(be)-i(j).left-i(j).right,height:(i(Se)-i(j).top-i(j).bottom)/2,margin:i(j)},null,8,["width","height","margin"])):w("",!0)],8,go),i(y).graphMode=="day"||i(y).graphMode=="today"?(l(),$(co,{key:0,width:i(be)-i(j).left-i(j).right,height:i(Se)-i(j).top-i(j).bottom,margin:i(j),data:i(y).data},null,8,["width","height","margin","data"])):w("",!0),n("g",{id:"button",type:"button",onClick:e},[n("text",{x:i(be)-10,y:i(Se)-10,color:"var(--color-menu)","text-anchor":"end"},d[1]||(d[1]=[n("tspan",{fill:"var(--color-menu)",class:"fas fa-lg"},S(""),-1)]),8,mo)])],8,po))],512),[[qa,i(y).data.length>0]])]),_:1}))}}),bo=R(yo,[["__scopeId","data-v-7cbcf9ef"]]),_o=["id"],wo=["x","width","height","fill"],ko=["x","width","height"],xo=["x","y","width","height"],So=L({__name:"EmBar",props:{item:{},xScale:{},yScale:{},margin:{},height:{},barcount:{},autarchy:{},autText:{}},setup(a){const e=a,t=m(()=>e.height-e.yScale(e.item.energy)-e.margin.top-e.margin.bottom),r=m(()=>{let o=0;return e.item.energyPv>0&&(o=e.height-e.yScale(e.item.energyPv)-e.margin.top-e.margin.bottom),o>t.value&&(o=t.value),o}),s=m(()=>{let o=0;return e.item.energyBat>0&&(o=e.height-e.yScale(e.item.energyBat)-e.margin.top-e.margin.bottom),o>t.value&&(o=t.value),o});return(o,h)=>(l(),f("g",{id:"bar-"+e.item.name,transform:"scale(1,-1) translate (0,-445)"},[n("rect",{class:"bar",x:e.xScale(o.item.name),y:"0",width:e.xScale.bandwidth(),height:t.value,fill:o.item.color},null,8,wo),n("rect",{class:"bar",x:e.xScale(o.item.name)+e.xScale.bandwidth()/6,y:"0",width:e.xScale.bandwidth()*2/3,height:r.value,fill:"var(--color-pv)","fill-opacity":"66%"},null,8,ko),n("rect",{class:"bar",x:e.xScale(o.item.name)+e.xScale.bandwidth()/6,y:r.value,width:e.xScale.bandwidth()*2/3,height:s.value,fill:"var(--color-battery)","fill-opacity":"66%"},null,8,xo)],8,_o))}}),Mo={id:"emBargraph"},$o=L({__name:"EMBarGraph",props:{plotdata:{},xScale:{},yScale:{},margin:{},height:{}},setup(a){const e=a;function t(s){if(s.name=="PV"){const o=y.graphMode=="live"||y.graphMode=="day"?Q:T.items,d=(y.graphMode=="live"||y.graphMode=="day"?U:T.items).evuOut.energy,u=o.pv.energy;return Math.round((u-d)/u*100)}else if(s.name=="Netz"){const o=y.graphMode=="live"||y.graphMode=="day"?Q:T.items,h=y.graphMode=="live"||y.graphMode=="day"?U:T.items,d=h.evuOut.energy,u=o.evuIn.energy,p=o.pv.energy,c=o.batOut.energy,k=h.batIn.energy;return Math.round((p+c-d-k)/(p+c+u-d-k)*100)}else return s.pvPercentage}function r(s){return s.name=="PV"?"Eigen":"Aut"}return(s,o)=>(l(),f("g",Mo,[(l(!0),f(F,null,te(e.plotdata,(h,d)=>(l(),f("g",{key:d},[v(So,{item:h,"x-scale":e.xScale,"y-scale":e.yScale,margin:e.margin,height:e.height,barcount:e.plotdata.length,"aut-text":r(h),autarchy:t(h)},null,8,["item","x-scale","y-scale","margin","height","barcount","aut-text","autarchy"])]))),128)),o[0]||(o[0]=n("animateTransform",{"attribute-name":"transform",type:"scale",from:"1 0",to:"1 1",begin:"0s",dur:"2s"},null,-1))]))}}),Po=["origin"],Io=L({__name:"EMYAxis",props:{yScale:{type:[Function,Object]},width:{},fontsize:{}},setup(a){const e=a,t=m(()=>ft(e.yScale).tickFormat(o=>s(o)).ticks(6).tickSizeInner(-e.width)),r=m(()=>{const o=ce("g#emYAxis");return o.attr("class","axis").call(t.value),o.append("text").attr("y",6).attr("dy","0.71em").attr("text-anchor","end").text("energy"),o.selectAll(".tick").attr("font-size",e.fontsize),g.showGrid?o.selectAll(".tick line").attr("stroke","var(--color-grid)").attr("stroke-width","0.5"):o.selectAll(".tick line").attr("stroke","var(--color-bg)"),o.select(".domain").attr("stroke","var(--color-bg)"),"emYAxis.vue"});function s(o){return o>0?y.graphMode=="year"?(o/1e6).toString():(o/1e3).toString():""}return(o,h)=>(l(),f("g",{id:"emYAxis",class:"axis",origin:r.value},null,8,Po))}}),Co=["id"],Bo=["x","y","font-size"],Vo=["x","y","font-size","fill"],Lo=["x","y","font-size","fill"],Oo=L({__name:"EmLabel",props:{item:{},xScale:{},yScale:{},margin:{},height:{},barcount:{},autarchy:{},autText:{}},setup(a){const e=a,t=m(()=>e.autarchy?e.yScale(e.item.energy)-25:e.yScale(e.item.energy)-10),r=m(()=>{let u=16,p=e.barcount;return p<=5?u=16:p==6?u=14:p>6&&p<=8?u=13:p==9?u=11:p==10?u=10:u=9,u}),s=m(()=>{let u=12,p=e.barcount;return p<=5?u=12:p==6?u=11:p>6&&p<=8||p==9?u=8:p==10?u=7:u=6,u});function o(u,p){return p.length>s.value?p.substring(0,s.value)+".":p}function h(){return e.autarchy?e.autText+": "+e.autarchy.toLocaleString(void 0)+" %":""}function d(){return"var(--color-pv)"}return(u,p)=>(l(),f("g",{id:"barlabel-"+e.item.name},[n("text",{x:e.xScale(u.item.name)+e.xScale.bandwidth()/2,y:t.value,"font-size":r.value,"text-anchor":"middle",fill:"var(--color-menu)"},S(i(ct)(u.item.energy,i(g).decimalPlaces,!1)),9,Bo),n("text",{x:e.xScale(u.item.name)+e.xScale.bandwidth()/2,y:e.yScale(u.item.energy)-10,"font-size":r.value-2,"text-anchor":"middle",fill:d()},S(h()),9,Vo),n("text",{x:e.xScale(u.item.name)+e.xScale.bandwidth()/2,y:e.height-e.margin.bottom-5,"font-size":r.value,"text-anchor":"middle",fill:u.item.color,class:q(u.item.icon.length<=2?"fas":"")},S(o(u.item.name,u.item.icon)),11,Lo)],8,Co))}}),Ao={id:"emBarLabels"},To=L({__name:"EMLabels",props:{plotdata:{},xScale:{},yScale:{},height:{},margin:{}},setup(a){const e=a;function t(s){if(s.name=="PV"){const o=y.graphMode=="live"||y.graphMode=="today"?Q:T.items,d=(y.graphMode=="live"||y.graphMode=="today"?U:T.items).evuOut.energy,u=o.pv.energy;return Math.round((u-d)/u*100)}else if(s.name=="Netz"){const o=y.graphMode=="live"||y.graphMode=="today"?Q:T.items,h=y.graphMode=="live"||y.graphMode=="today"?U:T.items,d=h.evuOut.energy,u=o.evuIn.energy,p=o.pv.energy,c=o.batOut.energy,k=h.batIn.energy;return p+c-d-k>0?Math.round((p+c-d-k)/(p+c+u-d-k)*100):0}else return s.pvPercentage}function r(s){return s.name=="PV"?"Eigen":"Aut"}return(s,o)=>(l(),f("g",Ao,[(l(!0),f(F,null,te(e.plotdata,(h,d)=>(l(),f("g",{key:d},[v(Oo,{item:h,"x-scale":e.xScale,"y-scale":e.yScale,margin:e.margin,height:e.height,barcount:e.plotdata.length,"aut-text":r(h),autarchy:t(h)},null,8,["item","x-scale","y-scale","margin","height","barcount","aut-text","autarchy"])]))),128))]))}}),Eo={class:"d-flex justify-content-end"},zo={id:"energymeter",class:"p-0 m-0"},Wo={viewBox:"0 0 500 500"},Do=["transform"],Go=["x"],jo={key:0},ma=500,Lt=500,fa=12,Uo="Energie",Fo=L({__name:"EnergyMeter",setup(a){const e={top:25,bottom:30,left:25,right:0},t=m(()=>{let u=Object.values(Q),p=o.value;const c=T.items;let k=[];switch(g.debug&&h(),lt.value==!0&&(lt.value=!1),y.graphMode){default:case"live":case"today":k=u.concat(p);break;case"day":case"month":case"year":Object.values(c).length==0?qe.value=!0:(qe.value=!1,k=[c.evuIn,c.pv,c.evuOut,c.batOut,c.charging],Object.values(O).length>1&&Object.keys(O).forEach(P=>{c["cp"+P]&&k.push(c["cp"+P])}),k.push(c.devices),ae.forEach((P,z)=>{P.showInGraph&&c["sh"+z]&&k.push(c["sh"+z])}),k=k.concat([c.batIn,c.house]))}return k.filter(P=>P.energy&&P.energy>0)}),r=m(()=>xt().range([0,ma-e.left-e.right]).domain(t.value.map(u=>u.name)).padding(.4)),s=m(()=>He().range([Lt-e.bottom-e.top,15]).domain([0,Sa(t.value,u=>u.energy)])),o=m(()=>{const u=Object.values(O).length,p=[...ae.values()].filter(k=>k.configured).length;let c=U;return[...[c.evuOut,c.charging].concat(u>1?Object.values(O).map(k=>k.toPowerItem()):[]),...[c.devices].concat(p>1?[...ae.values()].filter(k=>k.configured&&k.showInGraph):[]).concat([U.batIn,U.house])]});function h(){console.debug(["source summary:",Q]),console.debug(["usage details:",o.value]),console.debug(["historic summary:",T])}function d(){g.zoomedWidget=2,g.zoomGraph=!g.zoomGraph}return(u,p)=>(l(),$(_t,{"full-width":!0},{title:_(()=>[H(S(Uo))]),buttons:_(()=>[n("div",Eo,[v(na,{widgetid:"graphsettings","show-left-button":!0,"show-right-button":!0,"ignore-live":!0,onShiftLeft:i(It),onShiftRight:i(Kt),onShiftUp:i(ea),onShiftDown:i(ta)},null,8,["onShiftLeft","onShiftRight","onShiftUp","onShiftDown"]),i(De)?(l(),f("span",{key:0,type:"button",class:"ms-1 p-0 pt-1",onClick:d},p[0]||(p[0]=[n("span",{class:"fa-solid fa-lg ps-1 fa-magnifying-glass"},null,-1)]))):w("",!0)])]),default:_(()=>[n("figure",zo,[(l(),f("svg",Wo,[n("g",{transform:"translate("+e.left+","+e.top+")"},[v($o,{plotdata:t.value,"x-scale":r.value,"y-scale":s.value,height:Lt,margin:e},null,8,["plotdata","x-scale","y-scale"]),v(Io,{"y-scale":s.value,width:ma,fontsize:fa,config:i(g)},null,8,["y-scale","config"]),n("text",{x:-e.left,y:"-15",fill:"var(--color-axis)","font-size":fa},S(i(y).graphMode=="year"?"MWh":"kWh"),9,Go),v(To,{plotdata:t.value,"x-scale":r.value,"y-scale":s.value,height:Lt,margin:e,config:i(g)},null,8,["plotdata","x-scale","y-scale","config"])],8,Do)]))]),i(qe)?(l(),f("p",jo,"No data")):w("",!0)]),_:1}))}}),No=R(Fo,[["__scopeId","data-v-32c82102"]]),Ho=["id"],Ro=["y","width","fill"],Jo=["y","width"],Yo=["y","x","width"],qo=L({__name:"EnergyBar",props:{id:{},item:{},yScale:{},xScale:{},itemHeight:{}},setup(a){const e=a,t=m(()=>e.xScale(e.item.energy)),r=m(()=>{let o=0;return e.item.energyPv>0&&(o=e.xScale(e.item.energyPv)),o>t.value&&(o=t.value),o}),s=m(()=>{let o=0;return e.item.energyBat>0&&(o=e.xScale(e.item.energyBat)),o>t.value&&(o=t.value),o});return(o,h)=>(l(),f("g",{id:`bar-${e.item.name}`},[n("rect",{class:"bar",y:e.yScale(e.id)+e.itemHeight/2-4,x:"0",rx:"6",ry:"6",height:"12",width:t.value,fill:o.item.color},null,8,Ro),n("rect",{class:"bar",y:e.yScale(e.id)+e.itemHeight/2+10,x:"0",rx:"3",ry:"3",height:"7",width:r.value,fill:"var(--color-pv)","fill-opacity":"100%"},null,8,Jo),n("rect",{class:"bar",y:e.yScale(e.id)+e.itemHeight/2+10,x:r.value,rx:"3",ry:"3",height:"7",width:s.value,fill:"var(--color-battery)","fill-opacity":"100%"},null,8,Yo)],8,Ho))}}),Qo={id:"emBargraph"},Zo=L({__name:"BarGraph",props:{plotdata:{},yscale:{},xscale:{},itemHeight:{}},setup(a){const e=a;return(t,r)=>(l(),f("g",Qo,[(l(!0),f(F,null,te(e.plotdata,(s,o)=>(l(),f("g",{key:o},[v(qo,{id:o.toString(),item:s,"x-scale":e.xscale,"y-scale":e.yscale,"item-height":t.itemHeight},null,8,["id","item","x-scale","y-scale","item-height"])]))),128))]))}}),Xo=["id"],Ko=["y","x","fill"],es=["y","x"],ts=["y","x","font-size"],Ot=24,as=L({__name:"EnergyLabel",props:{id:{},item:{},yscale:{},margin:{},width:{},itemHeight:{},autarchy:{},autText:{}},setup(a){const e=a,t=m(()=>e.yscale(e.id)+e.itemHeight/3);function r(){return e.autarchy?e.autText+": "+e.autarchy.toLocaleString(void 0)+" %":""}function s(o){return o.length>14?o.slice(0,13)+"...":o}return(o,h)=>(l(),f("g",{id:"barlabel-"+e.id},[n("text",{y:t.value,x:e.margin.left,"font-size":Ot,"text-anchor":"start",fill:o.item.color,class:q(o.item.icon.length<=2?"fas":"")},S(s(e.item.icon)),11,Ko),n("text",{y:t.value,x:e.width/2+e.margin.left,"font-size":Ot,"text-anchor":"middle",fill:"var(--color-menu)"},S(i(ct)(o.item.energy,i(g).decimalPlaces,!1)),9,es),n("text",{y:t.value,x:e.width-e.margin.right,"font-size":Ot-2,"text-anchor":"end",fill:"var(--color-pv)"},S(r()),9,ts)],8,Xo))}}),ns={id:"emBarLabels"},rs=L({__name:"EnergyLabels",props:{plotdata:{},yscale:{},width:{},itemHeight:{},margin:{}},setup(a){const e=a;function t(s){if(s.name=="PV"){const o=y.graphMode=="live"||y.graphMode=="today"?Q:T.items,d=(y.graphMode=="live"||y.graphMode=="today"?U:T.items).evuOut.energy,u=o.pv.energy;return Math.round((u-d)/u*100)}else if(s.name=="Netz"){const o=y.graphMode=="live"||y.graphMode=="today"?Q:T.items,h=y.graphMode=="live"||y.graphMode=="today"?U:T.items,d=h.evuOut.energy,u=o.evuIn.energy,p=o.pv.energy,c=o.batOut.energy,k=h.batIn.energy;return p+c-d-k>0?Math.round((p+c-d-k)/(p+c+u-d-k)*100):0}else return s.pvPercentage}function r(s){return s.name=="PV"?"Eigen":"Aut"}return(s,o)=>(l(),f("g",ns,[(l(!0),f(F,null,te(e.plotdata,(h,d)=>(l(),f("g",{key:d},[v(as,{id:d.toString(),item:h,yscale:e.yscale,margin:e.margin,width:e.width,"item-height":s.itemHeight,"aut-text":r(h),autarchy:t(h)},null,8,["id","item","yscale","margin","width","item-height","aut-text","autarchy"])]))),128))]))}});class os{constructor(e){b(this,"id");b(this,"name","Speicher");b(this,"color","var(--color-battery)");b(this,"dailyYieldExport",0);b(this,"dailyYieldImport",0);b(this,"monthlyYieldExport",0);b(this,"monthlyYieldImport",0);b(this,"yearlyYieldExport",0);b(this,"yearlyYieldImport",0);b(this,"exported",0);b(this,"faultState",0);b(this,"faultStr","");b(this,"imported",0);b(this,"power",0);b(this,"soc",0);this.id=e}}class ss{constructor(){b(this,"dailyExport",0);b(this,"dailyImport",0);b(this,"exported",0);b(this,"imported",0);b(this,"power",0);b(this,"soc",0)}}le(new ss);const he=ee(new Map),Aa=a=>{he.value.set(a,new os(a)),he.value.get(a).color=ie["bat"+he.value.size].color};function is(){he.value=new Map}const ls={class:"d-flex justify-content-end"},cs={id:"energymeter",class:"p-0 m-0"},us=["viewBox"],ds=["transform"],hs=["x"],ps={key:0},va=500,At=60,gs=12,ms="Energie",fs=L({__name:"EnergyMeter2",setup(a){const e={top:0,bottom:30,left:0,right:0},t=m(()=>r.value.length*At+e.top+e.bottom),r=m(()=>{let c=Object.values(Q),k=h.value;const P=T.items;let z=[];switch(g.debug&&u(),lt.value==!0&&(lt.value=!1),y.graphMode){default:case"live":case"today":z=d(c).concat(k);break;case"day":case"month":case"year":Object.values(P).length==0?qe.value=!0:(qe.value=!1,z=[P.evuIn,P.pv,P.evuOut,P.batOut,P.charging],Object.values(O).length>1&&Object.keys(O).forEach(D=>{P["cp"+D]&&z.push(P["cp"+D])}),z.push(P.devices),ae.forEach((D,B)=>{D.showInGraph&&P["sh"+B]&&z.push(P["sh"+B])}),z=z.concat([P.batIn,P.house]))}return z.filter(D=>D.energy&&D.energy>0)}),s=m(()=>He().range([0,va-e.left-e.right]).domain([0,Sa(r.value,c=>c.energy)])),o=m(()=>xt().range([e.top,t.value-e.bottom]).domain(r.value.map((c,k)=>k.toString())).padding(.1)),h=m(()=>{const c=Object.values(O).length,k=[...ae.values()].filter(z=>z.configured).length;let P=U;return[...[P.evuOut,P.charging].concat(c>1?Object.values(O).map(z=>z.toPowerItem()):[]),...[P.devices].concat(k>1?[...ae.values()].filter(z=>z.configured&&z.showInGraph):[]).concat([U.batIn,U.house])]});function d(c){let k=0;return we.value.size>1&&we.value.forEach(P=>{c.splice(2+k++,0,{name:P.name,power:P.power,energy:P.energy,energyPv:0,energyBat:0,pvPercentage:0,color:P.color,icon:P.name,showInGraph:!0})}),he.value.size>1&&he.value.forEach(P=>{c.splice(3+k++,0,{name:P.name,power:P.power,energy:P.dailyYieldExport,energyPv:0,energyBat:0,pvPercentage:0,color:P.color,icon:P.name,showInGraph:!0})}),c}function u(){console.debug(["source summary:",Q]),console.debug(["usage details:",h.value]),console.debug(["historic summary:",T])}function p(){g.zoomedWidget=2,g.zoomGraph=!g.zoomGraph}return(c,k)=>(l(),$(_t,{"full-width":!0},{title:_(()=>[H(S(ms))]),buttons:_(()=>[n("div",ls,[v(na,{widgetid:"graphsettings","show-left-button":!0,"show-right-button":!0,"ignore-live":!0,onShiftLeft:i(It),onShiftRight:i(Kt),onShiftUp:i(ea),onShiftDown:i(ta)},null,8,["onShiftLeft","onShiftRight","onShiftUp","onShiftDown"]),i(De)?(l(),f("span",{key:0,type:"button",class:"ms-1 p-0 pt-1",onClick:p},k[0]||(k[0]=[n("span",{class:"fa-solid fa-lg ps-1 fa-magnifying-glass"},null,-1)]))):w("",!0)])]),default:_(()=>[n("figure",cs,[(l(),f("svg",{viewBox:"0 0 500 "+t.value},[n("g",{transform:"translate("+e.left+","+e.top+")"},[v(Zo,{plotdata:r.value,xscale:s.value,yscale:o.value,"item-height":At},null,8,["plotdata","xscale","yscale"]),n("text",{x:-e.left,y:"-15",fill:"var(--color-axis)","font-size":gs},S(i(y).graphMode=="year"?"MWh":"kWh"),9,hs),v(rs,{plotdata:r.value,yscale:o.value,width:va,"item-height":At,margin:e},null,8,["plotdata","yscale"])],8,ds)],8,us))]),i(qe)?(l(),f("p",ps,"No data")):w("",!0)]),_:1}))}}),vs=R(fs,[["__scopeId","data-v-63a4748e"]]),ys={class:"d-flex flex-column align-items-center justify-content-start infoitem"},bs=L({__name:"InfoItem",props:{heading:{},small:{type:Boolean}},setup(a){const e=a,t=m(()=>e.small?{"font-size":"var(--font-small)"}:{"font-size":"var(--font-small)"}),r=m(()=>e.small?{"font-size":"var(--font-small)"}:{"font-size":"var(--font-normal)"}),s=m(()=>e.small?"mt-0":"mt-1");return(o,h)=>(l(),f("span",ys,[n("span",{class:q(["d-flex heading",s.value]),style:K(t.value)},S(e.heading),7),n("span",{class:"d-flex my-0 me-0 align-items-center content",style:K(r.value)},[pe(o.$slots,"default",{},void 0,!0)],4)]))}}),X=R(bs,[["__scopeId","data-v-f6af00e8"]]),_s={class:"d-flex justify-content-between align-items-center titlerow"},ws={class:"buttonrea d-flex float-right justify-content-end align-items-center"},ks={class:"contentrow grid-col-12"},xs=L({__name:"WbSubwidget",props:{titlecolor:{},fullwidth:{type:Boolean},small:{type:Boolean}},setup(a){const e=a,t=m(()=>{let s={"font-weight":"bold",color:"var(--color-fg)","font-size":"var(--font-normal)"};return e.titlecolor&&(s.color=e.titlecolor),e.small&&(s["font-size"]="var(--font-verysmall)"),s}),r=m(()=>e.fullwidth?"grid-col-12":"grid-col-4");return(s,o)=>(l(),f("div",{class:q(["wb-subwidget px-3 pt-2 my-0",r.value])},[n("div",_s,[n("div",{class:"d-flex widgetname p-0 m-0",style:K(t.value)},[pe(s.$slots,"title",{},void 0,!0)],4),n("div",ws,[pe(s.$slots,"buttons",{},void 0,!0)])]),n("div",ks,[pe(s.$slots,"default",{},void 0,!0)])],2))}}),tt=R(xs,[["__scopeId","data-v-e989060d"]]),Ss={class:"grid-col-12 mt-2 mb-0 px-0 py-0 configitem"},Ms={class:"titlecolumn m-0 p-0 d-flex align-items-center"},$s={class:"ms-1 mb-2 p-0 pt-2 d-flex justify-content-stretch align-items-center"},Ps={class:"justify-content-stretch d-flex"},Is=L({__name:"ConfigItem",props:{title:{},infotext:{},icon:{},fullwidth:{type:Boolean}},setup(a){const e=a,t=ee(!1);function r(){t.value=!t.value}const s=m(()=>{let o={color:"var(--color-charging)"};return t.value&&(o.color="var(--color-battery)"),o});return(o,h)=>(l(),$(tt,{fullwidth:!!o.fullwidth},{default:_(()=>[n("div",Ss,[n("div",Ms,[n("span",{class:"d-flex align-items-baseline m-0 p-0",onClick:r},[e.icon?(l(),f("i",{key:0,class:q(["fa-solid fa-sm m-0 p-0 me-2 item-icon",e.icon])},null,2)):w("",!0),H(" "+S(o.title),1)]),n("span",null,[e.infotext?(l(),f("i",{key:0,class:"fa-solid fa-sm fa-circle-question ms-4 me-2",style:K(s.value),onClick:r},null,4)):w("",!0)])]),t.value?(l(),f("p",{key:0,class:"infotext shadow m-0 ps-2 mb-1 p-1",onClick:r},[h[0]||(h[0]=n("i",{class:"me-1 fa-solid fa-sm fa-circle-info"},null,-1)),H(" "+S(o.infotext),1)])):w("",!0),n("div",$s,[n("span",Ps,[pe(o.$slots,"default",{},void 0,!0)])])])]),_:3},8,["fullwidth"]))}}),N=R(Is,[["__scopeId","data-v-b935eb33"]]),Cs={class:"d-flex flex-column"},Bs={class:"d-flex flex-fill justify-content-between align-items-center"},Vs={class:"d-flex flex-fill flex-column justify-content-center m-0 p-0"},Ls={key:0,id:"rangeIndicator",class:"rangeIndicator"},Os={viewBox:"0 0 100 2"},As=["width"],Ts=["x","width"],Es=["x","width"],zs=["id","min","max","step"],Ws={class:"d-flex justify-content-between align-items-center"},Ds={class:"minlabel ps-4"},Gs={class:"valuelabel"},js={class:"maxlabel pe-4"},Us=L({__name:"RangeInput",props:{id:{},min:{},max:{},step:{},unit:{},decimals:{},showSubrange:{type:Boolean},subrangeMin:{},subrangeMax:{},modelValue:{}},emits:["update:modelValue"],setup(a,{emit:e}){const t=a,r=t.decimals??0,s=e,o=m({get(){return Math.round(t.modelValue*Math.pow(10,r))/Math.pow(10,r)},set(k){s("update:modelValue",k)}});function h(){o.value>t.min&&(o.value=Math.round((o.value-t.step)*Math.pow(10,r))/Math.pow(10,r))}function d(){o.valueHe().domain([t.min,t.max]).range([0,100])),p=m(()=>u.value(t.subrangeMin?t.subrangeMin:0)),c=m(()=>t.subrangeMin&&t.subrangeMax?u.value(t.subrangeMax)-u.value(t.subrangeMin):0);return(k,P)=>(l(),f("span",Cs,[n("span",Bs,[n("span",{type:"button",class:"minusButton",onClick:h},P[1]||(P[1]=[n("i",{class:"fa fa-xl fa-minus-square me-2"},null,-1)])),n("div",Vs,[t.showSubrange?(l(),f("figure",Ls,[(l(),f("svg",Os,[n("g",null,[n("rect",{class:"below",x:0,y:"0",width:p.value,height:"2",rx:"1",ry:"1",fill:"var(--color-evu)"},null,8,As),n("rect",{class:"bar",x:p.value,y:"0",width:c.value,height:"2",rx:"1",ry:"1",fill:"var(--color-charging)"},null,8,Ts),n("rect",{class:"above",x:p.value+c.value,y:"0",width:p.value,height:"2",rx:"1",ry:"1",fill:"var(--color-pv)"},null,8,Es)])]))])):w("",!0),vt(n("input",{id:k.id,"onUpdate:modelValue":P[0]||(P[0]=z=>o.value=z),type:"range",class:"form-range flex-fill",min:k.min,max:k.max,step:k.step},null,8,zs),[[Za,o.value,void 0,{number:!0}]])]),n("span",{type:"button",class:"plusButton",onClick:d},P[2]||(P[2]=[n("i",{class:"fa fa-xl fa-plus-square ms-2"},null,-1)]))]),n("span",Ws,[n("span",Ds,S(k.min),1),n("span",Gs,S(o.value)+" "+S(k.unit),1),n("span",js,S(k.max),1)])]))}}),Me=R(Us,[["__scopeId","data-v-267ede95"]]),Fs=["id","value"],Ns=L({__name:"RadioInput",props:{options:{},modelValue:{}},emits:["update:modelValue"],setup(a,{emit:e}){const t=a,r=e,s=m({get(){return t.modelValue},set(d){r("update:modelValue",d)}});function o(d){return t.options[d][2]?{color:t.options[d][2]}:{color:"var(--color-fg)"}}function h(d){let u=d.target;for(;u&&!u.value&&u.parentElement;)u=u.parentElement;u.value&&(s.value=u.value)}return(d,u)=>(l(),f("div",null,[(l(!0),f(F,null,te(d.options,(p,c)=>(l(),f("button",{id:"radio-"+p[1],key:c,class:q(["btn btn-outline-secondary radiobutton me-2 mb-0 px-2",p[1]==s.value?"active":""]),value:p[1],style:K(o(c)),onClick:h},[n("span",{style:K(o(c))},[p[3]?(l(),f("i",{key:0,class:q(["fa-solid",p[3]])},null,2)):w("",!0),H(" "+S(p[0]),1)],4)],14,Fs))),128))]))}}),We=R(Ns,[["__scopeId","data-v-df222cbe"]]),Hs={class:"mt-2"},Rs={key:0},Js=L({__name:"CPConfigInstant",props:{chargepoint:{}},setup(a){const t=ee(a.chargepoint),r=[{name:"keine",id:"none"},{name:"EV-SoC",id:"soc"},{name:"Energiemenge",id:"amount"}],s=m({get(){return t.value.instantMaxEnergy/1e3},set(o){t.value.instantMaxEnergy=o*1e3}});return(o,h)=>(l(),f("div",Hs,[h[4]||(h[4]=n("p",{class:"heading ms-1"},"Sofortladen:",-1)),v(N,{title:"Stromstärke",icon:"fa-bolt",fullwidth:!0},{default:_(()=>[v(Me,{id:"targetCurrent",modelValue:t.value.instantTargetCurrent,"onUpdate:modelValue":h[0]||(h[0]=d=>t.value.instantTargetCurrent=d),min:6,max:32,step:1,unit:"A"},null,8,["modelValue"])]),_:1}),t.value.instantChargeLimitMode!="none"?(l(),f("hr",Rs)):w("",!0),v(N,{title:"Begrenzung",icon:"fa-hand",fullwidth:!0},{default:_(()=>[v(We,{modelValue:t.value.instantChargeLimitMode,"onUpdate:modelValue":h[1]||(h[1]=d=>t.value.instantChargeLimitMode=d),options:r.map(d=>[d.name,d.id])},null,8,["modelValue","options"])]),_:1}),t.value.instantChargeLimitMode=="soc"?(l(),$(N,{key:1,title:"Maximaler SoC",icon:"fa-sliders",fullwidth:!0},{default:_(()=>[v(Me,{id:"maxSoc",modelValue:t.value.instantTargetSoc,"onUpdate:modelValue":h[2]||(h[2]=d=>t.value.instantTargetSoc=d),min:0,max:100,step:1,unit:"%"},null,8,["modelValue"])]),_:1})):w("",!0),t.value.instantChargeLimitMode=="amount"?(l(),$(N,{key:2,title:"Zu ladende Energie",icon:"fa-sliders",fullwidth:!0},{default:_(()=>[v(Me,{id:"maxEnergy",modelValue:s.value,"onUpdate:modelValue":h[3]||(h[3]=d=>s.value=d),min:0,max:100,step:1,unit:"kWh"},null,8,["modelValue"])]),_:1})):w("",!0)]))}}),Ys=R(Js,[["__scopeId","data-v-0303d179"]]),qs={class:"form-check form-switch"},se=L({__name:"SwitchInput",props:{modelValue:{type:Boolean},onColor:{},offColor:{}},emits:["update:modelValue"],setup(a,{emit:e}){const t=a,r=e,s=m({get(){return t.modelValue},set(h){r("update:modelValue",h)}}),o=m(()=>s.value?{"background-color":"green"}:{"background-color":"white"});return(h,d)=>(l(),f("div",qs,[vt(n("input",{"onUpdate:modelValue":d[0]||(d[0]=u=>s.value=u),class:"form-check-input",type:"checkbox",role:"switch",style:K(o.value)},null,4),[[Ma,s.value]])]))}}),Qs={class:"pt-2"},Zs={key:3},Xs=L({__name:"CPConfigPv",props:{chargepoint:{}},setup(a){const t=ee(a.chargepoint),r=m({get(){return t.value.pvMinCurrent>5},set(h){h?t.value.pvMinCurrent=6:t.value.pvMinCurrent=0}}),s=m({get(){return t.value.pvMinSoc>0},set(h){h?t.value.pvMinSoc=50:t.value.pvMinSoc=0}}),o=m({get(){return t.value.pvMaxSoc<=100},set(h){h?t.value.pvMaxSoc=100:t.value.pvMaxSoc=101}});return(h,d)=>(l(),f("div",Qs,[d[8]||(d[8]=n("p",{class:"heading ms-1"},"PV-Laden:",-1)),v(N,{title:"Ladestand begrenzen",icon:"fa-battery-three-quarters",fullwidth:!0},{default:_(()=>[v(se,{id:"limitSoc",modelValue:o.value,"onUpdate:modelValue":d[0]||(d[0]=u=>o.value=u)},null,8,["modelValue"])]),_:1}),o.value?(l(),$(N,{key:0,title:"...auf maximal...",icon:"fa-battery-three-quarters",fullwidth:!0},{default:_(()=>[v(Me,{id:"maxSoc",modelValue:t.value.pvMaxSoc,"onUpdate:modelValue":d[1]||(d[1]=u=>t.value.pvMaxSoc=u),min:0,max:100,step:1,unit:"%"},null,8,["modelValue"])]),_:1})):w("",!0),v(N,{title:"Einspeisegrenze beachten",icon:"fa-hand",fullwidth:!0},{default:_(()=>[v(se,{modelValue:t.value.pvFeedInLimit,"onUpdate:modelValue":d[2]||(d[2]=u=>t.value.pvFeedInLimit=u)},null,8,["modelValue"])]),_:1}),v(N,{title:"Mindest-Ladestand",icon:"fa-battery-half",infotext:i(Te).minsoc,fullwidth:!0},{default:_(()=>[v(se,{modelValue:s.value,"onUpdate:modelValue":d[3]||(d[3]=u=>s.value=u)},null,8,["modelValue"])]),_:1},8,["infotext"]),s.value?(l(),$(N,{key:1,title:"...bis SoC",fullwidth:!0},{info:_(()=>[H(S(i(Te).minsoc),1)]),default:_(()=>[v(Me,{id:"minSoc",modelValue:t.value.pvMinSoc,"onUpdate:modelValue":d[4]||(d[4]=u=>t.value.pvMinSoc=u),min:0,max:100,step:1,unit:"%"},null,8,["modelValue"])]),_:1})):w("",!0),s.value?(l(),$(N,{key:2,title:"...mit Ladestrom",fullwidth:!0},{default:_(()=>[v(Me,{id:"minSocCurrent",modelValue:t.value.pvMinSocCurrent,"onUpdate:modelValue":d[5]||(d[5]=u=>t.value.pvMinSocCurrent=u),min:6,max:32,step:1,unit:"A"},null,8,["modelValue"])]),_:1})):w("",!0),r.value||s.value?(l(),f("hr",Zs)):w("",!0),v(N,{title:"Minimaler Ladestrom",icon:"fa-bolt",infotext:i(Te).minpv,fullwidth:!0},{default:_(()=>[v(se,{modelValue:r.value,"onUpdate:modelValue":d[6]||(d[6]=u=>r.value=u)},null,8,["modelValue"])]),_:1},8,["infotext"]),r.value?(l(),$(N,{key:4,title:"...bei Ladestrom (minimal)",fullwidth:!0},{default:_(()=>[v(Me,{id:"minCurrent",modelValue:t.value.pvMinCurrent,"onUpdate:modelValue":d[7]||(d[7]=u=>t.value.pvMinCurrent=u),min:6,max:32,step:1,unit:"A"},null,8,["modelValue"])]),_:1})):w("",!0)]))}}),Ks=R(Xs,[["__scopeId","data-v-faa69015"]]),ei={class:"table table-borderless"},ti={class:"tablecell"},ai={class:"tablecell"},ni={class:"tablecell"},ri={class:"tablecell"},oi={class:"tablecell left"},si=["href"],ii=L({__name:"CPConfigScheduled",props:{chargeTemplateId:{}},setup(a){const e={daily:"Täglich",once:"Einmal",weekly:"Wöchentlich"},t=a,r=m(()=>{let d=[];return pt[t.chargeTemplateId]&&(d=Object.values(pt[t.chargeTemplateId])),d});function s(d){return r.value[d].time}function o(d){return{color:r.value[d].active?"var(--color-switchGreen)":"var(--color-switchRed)"}}function h(d){return{"font-weight":r.value[d].active?"bold":"regular"}}return(d,u)=>(l(),f(F,null,[u[1]||(u[1]=n("p",{class:"heading ms-1 pt-2"},"Zielladen:",-1)),n("table",ei,[u[0]||(u[0]=n("thead",null,[n("tr",null,[n("th",{class:"tableheader"},"Ziel"),n("th",{class:"tableheader"},"Limit"),n("th",{class:"tableheader"},"Zeit"),n("th",{class:"tableheader"},"Wiederholung"),n("th",{class:"tableheader"})])],-1)),n("tbody",null,[(l(!0),f(F,null,te(r.value,(p,c)=>(l(),f("tr",{key:c,style:K(h(c))},[n("td",ti,S(p.limit.soc_scheduled)+"%",1),n("td",ai,S(p.limit.soc_limit)+"%",1),n("td",ni,S(s(c)),1),n("td",ri,S(e[p.frequency.selected]),1),n("td",oi,[n("a",{href:"../../settings/#/VehicleConfiguration/charge_template/"+t.chargeTemplateId},[n("span",{class:q([p.active?"fa-toggle-on":"fa-toggle-off","fa"]),style:K(o(c)),type:"button"},null,6)],8,si)])],4))),128))])])],64))}}),li=R(ii,[["__scopeId","data-v-e8f5ad9d"]]),ci={class:"table table-borderless"},ui={class:"tablecell"},di={class:"tablecell"},hi={class:"tablecell"},pi={class:"tablecell"},gi={class:"tablecell left"},mi=["href"],fi=L({__name:"CPConfigTimed",props:{chargeTemplateId:{}},setup(a){const e={daily:"Täglich",once:"Einmal",weekly:"Wöchentlich"},t=a,r=m(()=>gt[t.chargeTemplateId]?Object.values(gt[t.chargeTemplateId])??[]:[]);function s(h){return{color:r.value[h].active?"var(--color-switchGreen)":"var(--color-switchRed)"}}function o(h){return{"font-weight":r.value[h].active?"bold":"regular"}}return(h,d)=>(l(),f(F,null,[d[1]||(d[1]=n("p",{class:"heading ms-1 pt-2"},"Zeitpläne:",-1)),n("table",ci,[d[0]||(d[0]=n("thead",null,[n("tr",null,[n("th",{class:"tableheader"},"Von"),n("th",{class:"tableheader"},"Bis"),n("th",{class:"tableheader"},"Ladestrom"),n("th",{class:"tableheader"},"Wiederholung"),n("th",{class:"tableheader right"})])],-1)),n("tbody",null,[(l(!0),f(F,null,te(r.value,(u,p)=>(l(),f("tr",{key:p,style:K(o(p))},[n("td",ui,S(u.time[0]),1),n("td",di,S(u.time[1]),1),n("td",hi,S(u.current)+" A",1),n("td",pi,S(e[u.frequency.selected]),1),n("td",gi,[n("a",{href:"../../settings/#/VehicleConfiguration/charge_template/"+t.chargeTemplateId},[n("span",{class:q([u.active?"fa-toggle-on":"fa-toggle-off","fa"]),style:K(s(p)),type:"button"},null,6)],8,mi)])],4))),128))])])],64))}}),vi=R(fi,[["__scopeId","data-v-192e287b"]]),yi={class:"settingsheader mt-2 ms-1"},bi=L({__name:"CPConfigVehicle",props:{vehicleId:{}},setup(a){const e=a;return(t,r)=>(l(),f(F,null,[n("p",yi," Profile für "+S(i(Y)[e.vehicleId].name)+": ",1),v(N,{title:"Ladeprofil",icon:"fa-sliders",fullwidth:!0},{default:_(()=>[v(We,{modelValue:i(Y)[e.vehicleId].chargeTemplateId,"onUpdate:modelValue":r[0]||(r[0]=s=>i(Y)[e.vehicleId].chargeTemplateId=s),modelModifiers:{number:!0},options:Object.keys(i(_e)).map(s=>[i(_e)[+s].name,s])},null,8,["modelValue","options"])]),_:1}),v(N,{title:"Fahrzeug-Vorlage",icon:"fa-sliders",fullwidth:!0},{default:_(()=>[v(We,{modelValue:i(Y)[e.vehicleId].evTemplateId,"onUpdate:modelValue":r[1]||(r[1]=s=>i(Y)[e.vehicleId].evTemplateId=s),modelModifiers:{number:!0},options:Object.keys(i(Ht)).map(s=>[i(Ht)[+s].name,s])},null,8,["modelValue","options"])]),_:1})],64))}}),_i=R(bi,[["__scopeId","data-v-fcb57a44"]]),wi={class:"settingsheader mt-2 ms-1"},ki=L({__name:"CPChargeConfig",props:{chargepoint:{}},emits:["closeConfig"],setup(a){const t=a.chargepoint;return(r,s)=>(l(),f(F,null,[n("p",wi," Ladeeinstellungen für "+S(i(t).vehicleName)+": ",1),v(N,{title:"Lademodus",icon:"fa-charging-station",infotext:i(Te).chargemode,fullwidth:!0},{default:_(()=>[v(We,{modelValue:i(t).chargeMode,"onUpdate:modelValue":s[0]||(s[0]=o=>i(t).chargeMode=o),options:Object.keys(i(ye)).map(o=>[i(ye)[o].name,o,i(ye)[o].color,i(ye)[o].icon])},null,8,["modelValue","options"])]),_:1},8,["infotext"]),v(N,{title:"Fahrzeug wechseln",icon:"fa-car",infotext:i(Te).vehicle,fullwidth:!0},{default:_(()=>[v(We,{modelValue:i(t).connectedVehicle,"onUpdate:modelValue":s[1]||(s[1]=o=>i(t).connectedVehicle=o),modelModifiers:{number:!0},options:Object.values(i(Y)).filter(o=>o.visible).map(o=>[o.name,o.id])},null,8,["modelValue","options"])]),_:1},8,["infotext"]),v(N,{title:"Sperren",icon:"fa-lock",infotext:i(Te).locked,fullwidth:!0},{default:_(()=>[v(se,{modelValue:i(t).isLocked,"onUpdate:modelValue":s[2]||(s[2]=o=>i(t).isLocked=o)},null,8,["modelValue"])]),_:1},8,["infotext"]),v(N,{title:"Priorität",icon:"fa-star",infotext:i(Te).priority,fullwidth:!0},{default:_(()=>[v(se,{modelValue:i(t).hasPriority,"onUpdate:modelValue":s[3]||(s[3]=o=>i(t).hasPriority=o)},null,8,["modelValue"])]),_:1},8,["infotext"]),v(N,{title:"Zeitplan",icon:"fa-clock",infotext:i(Te).timeplan,fullwidth:!0},{default:_(()=>[v(se,{modelValue:i(t).timedCharging,"onUpdate:modelValue":s[4]||(s[4]=o=>i(t).timedCharging=o)},null,8,["modelValue"])]),_:1},8,["infotext"]),i(de).isBatteryConfigured?(l(),$(N,{key:0,title:"PV-Priorität",icon:"fa-car-battery",infotext:i(Te).pvpriority,fullwidth:!0},{default:_(()=>[v(We,{modelValue:i(de).pvBatteryPriority,"onUpdate:modelValue":s[5]||(s[5]=o=>i(de).pvBatteryPriority=o),options:i(cn)},null,8,["modelValue","options"])]),_:1},8,["infotext"])):w("",!0),i(re).active?(l(),$(N,{key:1,title:"Strompreisbasiert laden",icon:"fa-money-bill",infotext:i(Te).pricebased,fullwidth:!0},{default:_(()=>[v(se,{modelValue:i(t).etActive,"onUpdate:modelValue":s[6]||(s[6]=o=>i(t).etActive=o)},null,8,["modelValue"])]),_:1},8,["infotext"])):w("",!0)],64))}}),xi=R(ki,[["__scopeId","data-v-e348a34c"]]),Si={class:"providername ms-1"},Mi={class:"container"},$i={id:"pricechart",class:"p-0 m-0"},Pi={viewBox:"0 0 400 300"},Ii=["id","origin","transform"],Ci={key:0,class:"p-3"},Bi={key:1,class:"d-flex justify-content-end"},Vi=["disabled"],at=400,ya=250,ba=12,Li=L({__name:"PriceChart",props:{chargepoint:{},globalview:{type:Boolean}},setup(a){const e=a;let t=e.chargepoint?ee(e.chargepoint.etMaxPrice):ee(0);const r=ee(!1),s=ee(e.chargepoint),o=m({get(){return t.value},set(W){t.value=W,r.value=!0}});function h(){s.value&&(O[s.value.id].etMaxPrice=o.value),r.value=!1}const d=ee(!1),u={top:0,bottom:15,left:20,right:5},p=m(()=>{let W=[];return re.etPriceList.size>0&&re.etPriceList.forEach((Z,Oe)=>{W.push([Oe,Z])}),W}),c=m(()=>p.value.length>1?(at-u.left-u.right)/p.value.length-1:0),k=m(()=>r.value?{background:"var(--color-charging)"}:{background:"var(--color-menu)"}),P=m(()=>{let W=Ve(p.value,Z=>Z[0]);return W[1]&&(W[1]=new Date(W[1]),W[1].setTime(W[1].getTime()+36e5)),et().range([u.left,at-u.right]).domain(W)}),z=m(()=>{let W=[0,0];return p.value.length>0?(W=Ve(p.value,Z=>Z[1]),W[0]=Math.floor(W[0]-1),W[1]=Math.floor(W[1]+1)):W=[0,0],W}),D=m(()=>He().range([ya-u.bottom,0]).domain(z.value)),B=m(()=>{const W=Ne(),Z=[[u.left,D.value(o.value)],[at-u.right,D.value(o.value)]];return W(Z)}),A=m(()=>{const W=Ne(),Z=[[u.left,D.value(g.lowerPriceBound)],[at-u.right,D.value(g.lowerPriceBound)]];return W(Z)}),V=m(()=>{const W=Ne(),Z=[[u.left,D.value(g.upperPriceBound)],[at-u.right,D.value(g.upperPriceBound)]];return W(Z)}),J=m(()=>{const W=Ne(),Z=[[u.left,D.value(0)],[at-u.right,D.value(0)]];return W(Z)}),C=m(()=>ht(P.value).ticks(6).tickSize(5).tickFormat(st("%H:%M"))),M=m(()=>ft(D.value).ticks(z.value[1]-z.value[0]).tickSizeInner(-375).tickFormat(W=>W.toString())),E=m(()=>{d.value==!0;const W=ce("g#"+I.value);W.selectAll("*").remove(),W.selectAll("bar").data(p.value).enter().append("g").append("rect").attr("class","bar").attr("x",Qe=>P.value(Qe[0])).attr("y",Qe=>D.value(Qe[1])).attr("width",c.value).attr("height",Qe=>D.value(z.value[0])-D.value(Qe[1])).attr("fill",Qe=>Qe[1]<=o.value?"var(--color-charging)":"var(--color-axis)");const Oe=W.append("g").attr("class","axis").call(C.value);Oe.attr("transform","translate(0,"+(ya-u.bottom)+")"),Oe.selectAll(".tick").attr("font-size",ba).attr("color","var(--color-bg)"),Oe.selectAll(".tick line").attr("stroke","var(--color-fg)").attr("stroke-width","0.5"),Oe.select(".domain").attr("stroke","var(--color-bg");const wt=W.append("g").attr("class","axis").call(M.value);return wt.attr("transform","translate("+u.left+",0)"),wt.selectAll(".tick").attr("font-size",ba).attr("color","var(--color-bg)"),wt.selectAll(".tick line").attr("stroke","var(--color-bg)").attr("stroke-width","0.5"),wt.select(".domain").attr("stroke","var(--color-bg)"),z.value[0]<0&&W.append("path").attr("d",J.value).attr("stroke","var(--color-fg)"),W.append("path").attr("d",A.value).attr("stroke","green"),W.append("path").attr("d",V.value).attr("stroke","red"),W.append("path").attr("d",B.value).attr("stroke","yellow"),"PriceChart.vue"}),I=m(()=>e.chargepoint?"priceChartCanvas"+e.chargepoint.id:"priceChartCanvasGlobal"),x=m(()=>{let W=[];return re.etPriceList.forEach(Z=>{W.push(Z)}),W.sort((Z,Oe)=>Z-Oe)});function G(){let W=x.value[0];for(let Z of x.value){if(Z>=o.value)break;W=Z}o.value=W}function xe(){let W=x.value[0];for(let Z of x.value)if(Z>o.value){W=Z;break}else W=Z;o.value=W}return Le(()=>{d.value=!d.value}),(W,Z)=>(l(),f(F,null,[Z[3]||(Z[3]=n("p",{class:"settingsheader mt-2 ms-1"},"Preisbasiertes Laden:",-1)),n("p",Si,"Anbieter: "+S(i(re).etProvider),1),Z[4]||(Z[4]=n("hr",null,null,-1)),n("div",Mi,[n("figure",$i,[(l(),f("svg",Pi,[n("g",{id:I.value,origin:E.value,transform:"translate("+u.top+","+u.right+")"},null,8,Ii)]))])]),W.chargepoint!=null?(l(),f("div",Ci,[W.chargepoint.etActive?(l(),$(Me,{key:0,id:"pricechart_local",modelValue:o.value,"onUpdate:modelValue":Z[0]||(Z[0]=Oe=>o.value=Oe),min:Math.floor(x.value[0]-1),max:Math.ceil(x.value[x.value.length-1]+1),step:.1,decimals:1,"show-subrange":!0,"subrange-min":x.value[0],"subrange-max":x.value[x.value.length-1],unit:"ct"},null,8,["modelValue","min","max","subrange-min","subrange-max"])):w("",!0)])):w("",!0),n("div",{class:"d-flex justify-content-between px-3 pb-2 pt-0 mt-0"},[n("button",{type:"button",class:"btn btn-sm jumpbutton",onClick:G},Z[1]||(Z[1]=[n("i",{class:"fa fa-sm fa-arrow-left"},null,-1)])),n("button",{type:"button",class:"btn btn-sm jumpbutton",onClick:xe},Z[2]||(Z[2]=[n("i",{class:"fa fa-sm fa-arrow-right"},null,-1)]))]),W.chargepoint!=null?(l(),f("div",Bi,[n("span",{class:"me-3 pt-0",onClick:h},[n("button",{type:"button",class:"btn btn-secondary",style:K(k.value),disabled:!r.value}," Bestätigen ",12,Vi)])])):w("",!0)],64))}}),Ta=R(Li,[["__scopeId","data-v-8d837517"]]),Oi={class:"status-string"},Ai={style:{color:"red"}},Ti={class:"m-0 mt-4 p-0 grid-col-12 tabarea"},Ei={class:"nav nav-tabs nav-justified mx-1 mt-1",role:"tablist"},zi=["data-bs-target"],Wi=["data-bs-target"],Di=["data-bs-target"],Gi=["data-bs-target"],ji=["data-bs-target"],Ui=["data-bs-target"],Fi=["data-bs-target"],Ni={id:"settingsPanes",class:"tab-content mx-1 p-1 pb-3"},Hi=["id"],Ri=["id"],Ji=["id"],Yi=["id"],qi=["id"],Qi=["id"],Zi=["id"],Xi=L({__name:"CPChargeConfigPanel",props:{chargepoint:{}},emits:["closeConfig"],setup(a){const t=a.chargepoint,r=m(()=>_e[t.chargeTemplate]),s=m(()=>t.id);return Le(()=>{}),(o,h)=>(l(),f(F,null,[v(N,{title:"Status",icon:"fa-info-circle",fullwidth:!0,class:"item"},{default:_(()=>[n("span",Oi,S(i(t).stateStr),1)]),_:1}),i(t).faultState!=0?(l(),$(N,{key:0,title:"Fehler",class:"grid-col-12",icon:"fa-triangle-exclamation"},{default:_(()=>[n("span",Ai,S(i(t).faultStr),1)]),_:1})):w("",!0),n("div",Ti,[n("nav",Ei,[n("a",{class:"nav-link active","data-bs-toggle":"tab","data-bs-target":"#chargeSettings"+s.value},h[0]||(h[0]=[n("i",{class:"fa-solid fa-charging-station"},null,-1)]),8,zi),o.chargepoint.chargeMode=="instant_charging"?(l(),f("a",{key:0,class:"nav-link","data-bs-toggle":"tab","data-bs-target":"#instantSettings"+s.value},h[1]||(h[1]=[n("i",{class:"fa-solid fa-lg fa-bolt"},null,-1)]),8,Wi)):w("",!0),o.chargepoint.chargeMode=="pv_charging"?(l(),f("a",{key:1,class:"nav-link","data-bs-toggle":"tab","data-bs-target":"#pvSettings"+s.value},h[2]||(h[2]=[n("i",{class:"fa-solid fa-solar-panel me-1"},null,-1)]),8,Di)):w("",!0),o.chargepoint.chargeMode=="scheduled_charging"?(l(),f("a",{key:2,class:"nav-link","data-bs-toggle":"tab","data-bs-target":"#scheduledSettings"+s.value},h[3]||(h[3]=[n("i",{class:"fa-solid fa-bullseye me-1"},null,-1)]),8,Gi)):w("",!0),o.chargepoint.timedCharging?(l(),f("a",{key:3,class:"nav-link","data-bs-toggle":"tab","data-bs-target":"#timeSettings"+s.value},h[4]||(h[4]=[n("i",{class:"fa-solid fa-clock"},null,-1)]),8,ji)):w("",!0),n("a",{class:"nav-link","data-bs-toggle":"tab","data-bs-target":"#carSettings"+s.value},h[5]||(h[5]=[n("i",{class:"fa-solid fa-rectangle-list"},null,-1)]),8,Ui),i(re).active&&i(t).etActive?(l(),f("a",{key:4,class:"nav-link","data-bs-toggle":"tab","data-bs-target":"#priceChart"+s.value},h[6]||(h[6]=[n("i",{class:"fa-solid fa-chart-line"},null,-1)]),8,Fi)):w("",!0)]),n("div",Ni,[n("div",{id:"chargeSettings"+s.value,class:"tab-pane active",role:"tabpanel","aria-labelledby":"instant-tab"},[v(xi,{chargepoint:o.chargepoint},null,8,["chargepoint"])],8,Hi),n("div",{id:"instantSettings"+s.value,class:"tab-pane",role:"tabpanel","aria-labelledby":"instant-tab"},[v(Ys,{chargepoint:i(t),vehicles:i(Y),"charge-templates":i(_e)},null,8,["chargepoint","vehicles","charge-templates"])],8,Ri),n("div",{id:"pvSettings"+s.value,class:"tab-pane",role:"tabpanel","aria-labelledby":"pv-tab"},[v(Ks,{chargepoint:i(t),vehicles:i(Y),"charge-templates":i(_e)},null,8,["chargepoint","vehicles","charge-templates"])],8,Ji),n("div",{id:"scheduledSettings"+s.value,class:"tab-pane",role:"tabpanel","aria-labelledby":"scheduled-tab"},[r.value!=null?(l(),$(li,{key:0,"charge-template-id":i(t).chargeTemplate},null,8,["charge-template-id"])):w("",!0)],8,Yi),n("div",{id:"timeSettings"+s.value,class:"tab-pane",role:"tabpanel","aria-labelledby":"time-tab"},[r.value!=null?(l(),$(vi,{key:0,"charge-template-id":i(t).chargeTemplate},null,8,["charge-template-id"])):w("",!0)],8,qi),n("div",{id:"carSettings"+s.value,class:"tab-pane",role:"tabpanel","aria-labelledby":"car-tab"},[i(Y)[i(t).connectedVehicle]!=null?(l(),$(_i,{key:0,"vehicle-id":i(t).connectedVehicle},null,8,["vehicle-id"])):w("",!0)],8,Qi),n("div",{id:"priceChart"+s.value,class:"tab-pane",role:"tabpanel","aria-labelledby":"price-tab"},[i(Y)[i(t).connectedVehicle]!=null?(l(),$(Ta,{key:0,chargepoint:i(t)},null,8,["chargepoint"])):w("",!0)],8,Zi)])])],64))}}),Jt=R(Xi,[["__scopeId","data-v-1164316d"]]),Ki={class:"d-flex justify-content-center align-items-center"},el=L({__name:"BatterySymbol",props:{soc:{},color:{}},setup(a){const e=a,t=m(()=>e.soc<=12?"fa-battery-empty":e.soc<38?"fa-battery-quarter":e.soc<62?"fa-battery-half":e.soc<87?"fa-battery-three-quarters":"fa-battery-full"),r=m(()=>({color:e.color??"var(--color-menu)"}));return(s,o)=>(l(),f("span",Ki,[n("i",{class:q(["fa me-1",t.value]),style:K(r.value)},null,6),H(" "+S(Math.round(s.soc)+"%"),1)]))}}),Ct=R(el,[["__scopeId","data-v-a68c844a"]]),Ge=L({__name:"FormatWattH",props:{wattH:{}},setup(a){const e=a,t=m(()=>ct(e.wattH,g.decimalPlaces));return(r,s)=>(l(),f("span",null,S(t.value),1))}}),tl={class:"wb-widget p-0 m-0 shadow widgetWidth"},al={class:"py-4 px-3 d-flex justify-content-between align-items-center titlerow"},nl={class:"d-flex align-items-center widgetname p-0 m-0"},rl={class:"buttonrea d-flex float-right justify-content-end align-items-center"},ol={class:"grid12 pb-3"},sl=L({__name:"WbWidgetFlex",props:{variableWidth:{type:Boolean},fullWidth:{type:Boolean}},setup(a){const e=a,t=m(()=>e.fullWidth?"col-12":e.variableWidth&&g.preferWideBoxes?"col-lg-6":"col-lg-4");return(r,s)=>(l(),f("div",{class:q(["p-2 m-0",t.value])},[n("div",tl,[n("div",al,[n("div",nl,[pe(r.$slots,"title",{},()=>[s[0]||(s[0]=n("div",{class:"p-0"},"(title goes here)",-1))],!0),pe(r.$slots,"subtitle",{},void 0,!0)]),n("div",rl,[pe(r.$slots,"buttons",{},void 0,!0)])]),n("div",ol,[pe(r.$slots,"default",{},void 0,!0)])])],2))}}),je=R(sl,[["__scopeId","data-v-1d5bc1d9"]]),il=L({__name:"WbBadge",props:{color:{},bgcolor:{}},setup(a){const e=a,t=m(()=>({color:e.color??"var(--color-bg)","background-color":e.bgcolor??"var(--color-menu)"}));return(r,s)=>(l(),f("span",{class:"pillWbBadge rounded-pill ms-2 px-2",style:K(t.value)},[pe(r.$slots,"default",{},void 0,!0)],4))}}),Pe=R(il,[["__scopeId","data-v-36112fa3"]]),ll={class:"d-flex justify-content-center align-items-center"},cl={key:0,class:"WbBadge rounded-pill errorWbBadge ms-3"},ul={key:0},dl={key:1,class:"row m-0 mt-0 p-0"},hl={class:"col m-0 p-0"},pl={key:0},gl={class:"row"},ml={class:"col"},fl={class:"carTitleLine d-flex justify-content-between align-items-center"},vl={key:0,class:"me-1 fa-solid fa-xs fa-star ps-1"},yl={key:1,class:"me-1 fa-solid fa-xs fa-coins ps-0"},bl={key:2,class:"me-0 fa-solid fa-xs fa-clock ps-1"},_l={class:"grid12"},wl={style:{color:"var(--color-charging)"}},kl={style:{color:"var(--color-charging)"}},xl={style:{color:"var(--color-charging)"}},Sl={class:"targetCurrent"},Ml={key:5,class:"socEditor rounded mt-2 d-flex flex-column align-items-center grid-col-12 grid-left"},$l={class:"d-flex justify-content-stretch align-items-center"},Pl={key:0,class:"fa-solid fa-sm fas fa-edit ms-2"},Il=["id"],Cl=L({__name:"CPChargePoint",props:{chargepoint:{},fullWidth:{type:Boolean}},setup(a){const e=a,t=ee(e.chargepoint),r=m({get(){return e.chargepoint.chargeMode},set(I){O[e.chargepoint.id].chargeMode=I}}),s=m(()=>(Math.round(e.chargepoint.current*10)/10).toLocaleString(void 0)+" A"),o=m(()=>(Math.round(e.chargepoint.realCurrent*10)/10).toLocaleString(void 0)+" A"),h=m(()=>{const I=e.chargepoint.rangeCharged,x=e.chargepoint.chargedSincePlugged,G=e.chargepoint.dailyYield;return x>0?Math.round(I/x*G).toString()+" "+e.chargepoint.rangeUnit:"0 km"}),d=m(()=>e.chargepoint.isLocked?"Gesperrt":e.chargepoint.isCharging?"Lädt":e.chargepoint.isPluggedIn?"Bereit":"Frei"),u=m(()=>e.chargepoint.isLocked?"var(--color-evu)":e.chargepoint.isCharging?"var(--color-charging)":e.chargepoint.isPluggedIn?"var(--color-battery)":"var(--color-axis)"),p=m(()=>{let I="";return e.chargepoint.isLocked?I="fa-lock":e.chargepoint.isCharging?I=" fa-bolt":e.chargepoint.isPluggedIn&&(I="fa-plug"),"fa "+I}),c=m(()=>{switch(e.chargepoint.chargeMode){case"stop":return{color:"var(--fg)"};default:return{color:ye[e.chargepoint.chargeMode].color}}}),k=m(()=>e.chargepoint.soc),P=m(()=>({color:e.chargepoint.color})),z=m(()=>e.chargepoint.etMaxPrice>=+M.value?{color:"var(--color-charging)"}:{color:"var(--color-menu)"}),D=m(()=>e.chargepoint.soc<20?"var(--color-evu)":e.chargepoint.soc>=80?"var(--color-pv)":"var(--color-battery)"),B=ee(!1),A=ee(!1);function V(){oe("socUpdate",1,e.chargepoint.connectedVehicle),O[e.chargepoint.id].waitingForSoc=!0}function J(){oe("setSoc",C.value,e.chargepoint.connectedVehicle),A.value=!1}const C=m({get(){return e.chargepoint.soc},set(I){O[e.chargepoint.id].soc=I}}),M=m(()=>{const[I]=re.etPriceList.values();return(Math.round(I*10)/10).toFixed(1)}),E=ee(!1);return(I,x)=>(l(),f(F,null,[B.value?w("",!0):(l(),$(_t,{key:0,"variable-width":!0,"full-width":e.fullWidth},{title:_(()=>[n("span",ll,[n("span",{style:K(P.value),onClick:x[0]||(x[0]=G=>B.value=!B.value)},[x[12]||(x[12]=n("span",{class:"fa-solid fa-charging-station"}," ",-1)),H(" "+S(e.chargepoint.name),1)],4),t.value.faultState==2?(l(),f("span",cl,"Fehler")):w("",!0)])]),buttons:_(()=>[n("span",{type:"button",class:"ms-2 ps-1 pt-1",style:K(c.value),onClick:x[1]||(x[1]=G=>B.value=!B.value)},x[13]||(x[13]=[n("span",{class:"fa-solid fa-lg ps-1 fa-ellipsis-vertical"},null,-1)]),4)]),footer:_(()=>[B.value?w("",!0):(l(),f("div",pl,[n("div",gl,[n("div",ml,[n("div",fl,[n("h3",{onClick:x[3]||(x[3]=G=>B.value=!B.value)},[x[14]||(x[14]=n("i",{class:"fa-solid fa-sm fa-car me-2"},null,-1)),H(" "+S(I.chargepoint.vehicleName)+" ",1),I.chargepoint.hasPriority?(l(),f("span",vl)):w("",!0),I.chargepoint.etActive?(l(),f("span",yl)):w("",!0),I.chargepoint.timedCharging?(l(),f("span",bl)):w("",!0)]),I.chargepoint.isSocConfigured?(l(),$(Pe,{key:0,bgcolor:D.value},{default:_(()=>[v(Ct,{soc:k.value??0,color:"var(--color-bg)",class:"me-2"},null,8,["soc"]),I.chargepoint.isSocManual?(l(),f("i",{key:0,class:"fa-solid fa-sm fas fa-edit",style:{color:"var(--color-bg)"},onClick:x[4]||(x[4]=G=>A.value=!A.value)})):w("",!0),I.chargepoint.isSocManual?w("",!0):(l(),f("i",{key:1,type:"button",class:q(["fa-solid fa-sm",I.chargepoint.waitingForSoc?"fa-spinner fa-spin":"fa-sync"]),onClick:V},null,2))]),_:1},8,["bgcolor"])):w("",!0)])])]),n("div",_l,[v(Oa,{id:"chargemode-"+I.chargepoint.name,modelValue:r.value,"onUpdate:modelValue":x[5]||(x[5]=G=>r.value=G),class:"chargemodes mt-3 mb-3",options:Object.keys(i(ye)).map(G=>({text:i(ye)[G].name,value:G,color:i(ye)[G].color,icon:i(ye)[G].icon,active:i(ye)[G].mode==I.chargepoint.chargeMode}))},null,8,["id","modelValue","options"]),e.chargepoint.power>0?(l(),$(X,{key:0,heading:"Leistung:",class:"grid-col-3 grid-left mb-3"},{default:_(()=>[n("span",wl,[v(bt,{watt:e.chargepoint.power},null,8,["watt"])])]),_:1})):w("",!0),e.chargepoint.power>0?(l(),$(X,{key:1,heading:"Strom:",class:"grid-col-3"},{default:_(()=>[n("span",kl,S(o.value),1)]),_:1})):w("",!0),e.chargepoint.power>0?(l(),$(X,{key:2,heading:"Phasen:",class:"grid-col-3"},{default:_(()=>[n("span",xl,S(e.chargepoint.phasesInUse),1)]),_:1})):w("",!0),e.chargepoint.power>0?(l(),$(X,{key:3,heading:"Sollstrom:",class:"grid-col-3 grid-right"},{default:_(()=>[n("span",Sl,S(s.value),1)]),_:1})):w("",!0),v(X,{heading:"letzte Ladung:",class:"grid-col-4 grid-left"},{default:_(()=>[v(Ge,{"watt-h":Math.max(I.chargepoint.chargedSincePlugged,0)},null,8,["watt-h"])]),_:1}),v(X,{heading:"gel. Reichw.:",class:"grid-col-4"},{default:_(()=>[H(S(h.value),1)]),_:1}),I.chargepoint.isSocConfigured?(l(),$(X,{key:4,heading:"Reichweite:",class:"grid-col-4 grid-right"},{default:_(()=>[H(S(i(Y)[e.chargepoint.connectedVehicle]?Math.round(i(Y)[e.chargepoint.connectedVehicle].range):0)+" km ",1)]),_:1})):w("",!0),A.value?(l(),f("div",Ml,[x[15]||(x[15]=n("span",{class:"d-flex m-1 p-0 socEditTitle"},"Ladestand einstellen:",-1)),n("span",$l,[n("span",null,[v(Me,{id:"manualSoc",modelValue:C.value,"onUpdate:modelValue":x[6]||(x[6]=G=>C.value=G),min:0,max:100,step:1,unit:"%"},null,8,["modelValue"])])]),n("span",{type:"button",class:"fa-solid d-flex fa-lg me-2 mb-3 align-self-end fa-circle-check",onClick:J})])):w("",!0),x[17]||(x[17]=n("hr",{class:"divider grid-col-12"},null,-1)),i(re).active?(l(),$(X,{key:6,heading:"Preisladen:",class:"grid-col-4 grid-left"},{default:_(()=>[v(se,{modelValue:t.value.etActive,"onUpdate:modelValue":x[7]||(x[7]=G=>t.value.etActive=G)},null,8,["modelValue"])]),_:1})):w("",!0),i(re).active?(l(),$(X,{key:7,heading:"max. Preis:",class:"grid-col-4"},{default:_(()=>[n("span",{type:"button",onClick:x[8]||(x[8]=G=>E.value=!E.value)},[H(S(e.chargepoint.etActive?(Math.round(e.chargepoint.etMaxPrice*10)/10).toFixed(1)+" ct":"-")+" ",1),e.chargepoint.etActive?(l(),f("i",Pl)):w("",!0)])]),_:1})):w("",!0),i(re).active?(l(),$(X,{key:8,heading:"akt. Preis:",class:"grid-col-4 grid-right"},{default:_(()=>[n("span",{style:K(z.value)},S(M.value)+" ct ",5)]),_:1})):w("",!0),E.value?(l(),f("div",{key:9,id:"priceChartInline"+e.chargepoint.id,class:"d-flex flex-column rounded priceEditor grid-col-12"},[i(Y)[e.chargepoint.connectedVehicle]!=null?(l(),$(Ta,{key:0,chargepoint:e.chargepoint},null,8,["chargepoint"])):w("",!0),n("span",{class:"d-flex ms-2 my-4 pe-3 pt-1 d-flex align-self-end",style:K(c.value),onClick:x[9]||(x[9]=G=>E.value=!1)},x[16]||(x[16]=[n("span",{type:"button",class:"d-flex fa-solid fa-lg ps-1 fa-circle-check"},null,-1)]),4)],8,Il)):w("",!0)])]))]),default:_(()=>[B.value?w("",!0):(l(),f("div",ul,[n("div",{class:"grid12",onClick:x[2]||(x[2]=G=>B.value=!B.value)},[v(X,{heading:"Status:",class:"grid-col-4 grid-left"},{default:_(()=>[n("span",{style:K({color:u.value})},[n("i",{class:q(p.value)},null,2),H(" "+S(d.value),1)],4)]),_:1}),v(X,{heading:"Geladen:",class:"grid-col-4 grid-left"},{default:_(()=>[v(Ge,{"watt-h":I.chargepoint.dailyYield},null,8,["watt-h"])]),_:1})])])),B.value?(l(),f("div",dl,[n("div",hl,[I.chargepoint!=null?(l(),$(Jt,{key:0,chargepoint:I.chargepoint},null,8,["chargepoint"])):w("",!0)])])):w("",!0)]),_:1},8,["full-width"])),B.value?(l(),$(je,{key:1,"full-width":e.fullWidth},{title:_(()=>[n("span",{style:K(P.value),onClick:x[10]||(x[10]=G=>B.value=!B.value)},[x[18]||(x[18]=n("span",{class:"fas fa-gear"}," ",-1)),H(" Einstellungen "+S(e.chargepoint.name),1)],4)]),buttons:_(()=>[n("span",{class:"ms-2 pt-1",style:K(c.value),onClick:x[11]||(x[11]=G=>B.value=!B.value)},x[19]||(x[19]=[n("span",{class:"fa-solid fa-lg ps-1 fa-circle-check"},null,-1)]),4)]),default:_(()=>[I.chargepoint!=null?(l(),$(Jt,{key:0,chargepoint:I.chargepoint},null,8,["chargepoint"])):w("",!0)]),_:1},8,["full-width"])):w("",!0)],64))}}),Bl=R(Cl,[["__scopeId","data-v-3a733de3"]]),Vl=["id"],Ll={class:"modal-dialog modal-lg modal-fullscreen-lg-down"},Ol={class:"modal-content"},Al={class:"modal-header"},Tl={class:"modal-title"},El={class:"modal-body",style:{"background-color":"var(--color-bg)"}},zl=L({__name:"ModalComponent",props:{modalId:{}},setup(a){const e=a;return Le(()=>{}),(t,r)=>(l(),f("div",{id:e.modalId,class:"modal fade"},[n("div",Ll,[n("div",Ol,[n("div",Al,[n("h3",Tl,[pe(t.$slots,"title",{},void 0,!0)]),r[0]||(r[0]=n("button",{type:"button",class:"btn-close buttonTextSize d-flex justify-content-center pt-3 pb-0","data-bs-dismiss":"modal"},[n("i",{class:"fa-solid fa-lg fa-rectangle-xmark m-0 p-0"})],-1))]),n("div",El,[pe(t.$slots,"default",{},void 0,!0),r[1]||(r[1]=n("button",{class:"btn btn-secondary float-end mt-3 ms-1","data-bs-dismiss":"modal"}," Schließen ",-1))])])])],8,Vl))}}),Ea=R(zl,[["__scopeId","data-v-eaefae30"]]),Wl={class:"d-flex align-items-center"},Dl={class:"cpname"},Gl={class:"d-flex float-right justify-content-end align-items-center"},jl=["data-bs-target"],Ul=["data-bs-target"],Fl={class:"subgrid"},Nl={key:0,class:"d-flex justify-content-center align-items-center vehiclestatus"},Hl={class:"d-flex flex-column align-items-center px-0"},Rl={class:"d-flex justify-content-center flex-wrap"},Jl={class:"d-flex align-items-center"},Yl={class:"badge phasesInUse rounded-pill"},ql={class:"d-flex flex-wrap justify-content-center chargeinfo"},Ql={class:"me-1"},Zl={key:0,class:"subgrid socEditRow m-0 p-0"},Xl={class:"socEditor rounded mt-2 d-flex flex-column align-items-center grid-col-12"},Kl={class:"d-flex justify-content-stretch align-items-center"},ec=L({__name:"CpsListItem2",props:{chargepoint:{}},setup(a){const e=a,t=ee(!1),r=m(()=>ye[e.chargepoint.chargeMode].icon),s=m(()=>{let V="";return e.chargepoint.isLocked?V="fa-lock":e.chargepoint.isCharging?V=" fa-bolt":e.chargepoint.isPluggedIn&&(V="fa-plug"),"fa "+V}),o=m(()=>{let V="var(--color-axis)";return e.chargepoint.isLocked?V="var(--color-evu)":e.chargepoint.isCharging?V="var(--color-charging)":e.chargepoint.isPluggedIn&&(V="var(--color-battery)"),{color:V,border:`0.5px solid ${V} `}}),h=m(()=>{switch(e.chargepoint.chargeMode){case"stop":return{"background-color":"var(--fg)"};default:return{"background-color":ye[e.chargepoint.chargeMode].color}}}),d=m(()=>$e(e.chargepoint.power,g.decimalPlaces)),u=m(()=>e.chargepoint.current+" A"),p=m(()=>e.chargepoint.phasesInUse),c=m(()=>e.chargepoint.dailyYield>0?ct(e.chargepoint.dailyYield,g.decimalPlaces):"0 Wh"),k=m(()=>"("+Math.round(e.chargepoint.rangeCharged).toString()+" "+e.chargepoint.rangeUnit+")"),P=m(()=>ye[e.chargepoint.chargeMode].name);function z(){oe("socUpdate",1,e.chargepoint.connectedVehicle),O[e.chargepoint.id].waitingForSoc=!0}function D(){oe("setSoc",B.value,e.chargepoint.connectedVehicle),t.value=!1}const B=m({get(){return e.chargepoint.soc},set(V){O[e.chargepoint.id].soc=V}}),A=m(()=>e.chargepoint.isLocked?"Gesperrt":e.chargepoint.isCharging?"Lädt":e.chargepoint.isPluggedIn?"Bereit":"Frei");return(V,J)=>(l(),f(F,null,[v(tt,{titlecolor:V.chargepoint.color,fullwidth:!0,small:!0},{title:_(()=>[n("div",Wl,[n("span",Dl,S(V.chargepoint.name),1),n("span",{class:"badge rounded-pill statusbadge mx-2",style:K(o.value)},[n("i",{class:q([s.value,"me-1"])},null,2),H(" "+S(A.value),1)],4)])]),buttons:_(()=>[n("div",Gl,[n("span",{class:"badge rounded-pill modebadge mx-2",type:"button",style:K(h.value),"data-bs-toggle":"modal","data-bs-target":"#cpsconfig-"+V.chargepoint.id},[n("i",{class:q(["fa me-1",r.value])},null,2),H(" "+S(P.value),1)],12,jl),n("span",{class:"fa-solid ms-2 fa-lg fa-edit ps-1",type:"button","data-bs-toggle":"modal","data-bs-target":"#cpsconfig-"+V.chargepoint.id},null,8,Ul)])]),default:_(()=>[n("div",Fl,[v(X,{heading:V.chargepoint.vehicleName,small:!0,class:"grid-left grid-col-4"},{default:_(()=>[V.chargepoint.isSocConfigured?(l(),f("span",Nl,[V.chargepoint.soc?(l(),$(Ct,{key:0,class:"me-1",soc:V.chargepoint.soc},null,8,["soc"])):w("",!0),V.chargepoint.isSocConfigured&&V.chargepoint.isSocManual?(l(),f("i",{key:1,type:"button",class:"fa-solid fa-sm fas fa-edit",style:{color:"var(--color-menu)"},onClick:J[0]||(J[0]=C=>t.value=!t.value)})):w("",!0),V.chargepoint.isSocConfigured&&!V.chargepoint.isSocManual?(l(),f("i",{key:2,type:"button",class:q(["fa-solid fa-sm me-2",V.chargepoint.waitingForSoc?"fa-spinner fa-spin":"fa-sync"]),style:{color:"var(--color-menu)"},onClick:z},null,2)):w("",!0)])):w("",!0)]),_:1},8,["heading"]),v(X,{heading:"Parameter:",small:!0,class:"grid-col-4"},{default:_(()=>[n("div",Hl,[n("span",Rl,[n("span",null,S(d.value),1),n("span",Jl,[n("span",Yl,S(p.value),1),n("span",null,S(u.value),1)])])])]),_:1}),v(X,{heading:"Geladen:",small:!0,class:"grid-right grid-col-4"},{default:_(()=>[n("div",ql,[n("span",Ql,S(c.value),1),n("span",null,S(k.value),1)])]),_:1})]),t.value?(l(),f("div",Zl,[n("div",Xl,[J[2]||(J[2]=n("span",{class:"d-flex m-1 p-0 socEditTitle"},"Ladestand einstellen:",-1)),n("span",Kl,[n("span",null,[v(Me,{id:"manualSoc",modelValue:B.value,"onUpdate:modelValue":J[1]||(J[1]=C=>B.value=C),min:0,max:100,step:1,unit:"%"},null,8,["modelValue"])])]),n("span",{type:"button",class:"fa-solid d-flex fa-lg me-2 mb-3 align-self-end fa-circle-check",onClick:D})])])):w("",!0)]),_:1},8,["titlecolor"]),(l(),$(Xa,{to:"body"},[(l(),$(Ea,{key:V.chargepoint.id,"modal-id":"cpsconfig-"+V.chargepoint.id},{title:_(()=>[H(" Konfiguration: "+S(V.chargepoint.name),1)]),default:_(()=>[V.chargepoint!=null?(l(),$(Jt,{key:0,chargepoint:V.chargepoint},null,8,["chargepoint"])):w("",!0)]),_:1},8,["modal-id"]))]))],64))}}),tc=R(ec,[["__scopeId","data-v-25e4aa5d"]]),ac=L({__name:"CpSimpleList2",setup(a){const e=m(()=>Object.values(O));return(t,r)=>(l(),$(je,{"variable-width":!0},{title:_(()=>r[0]||(r[0]=[n("span",{class:"fa-solid fa-charging-station"}," ",-1),H(" Ladepunkte ")])),buttons:_(()=>[i(re).active?(l(),$(Pe,{key:0,bgcolor:"var(--color-menu)"},{default:_(()=>[H("Strompreis: "+S(i(re).etCurrentPriceString),1)]),_:1})):w("",!0)]),default:_(()=>[(l(!0),f(F,null,te(e.value,(s,o)=>(l(),f("div",{key:o,class:"subgrid pb-2"},[v(tc,{chargepoint:s},null,8,["chargepoint"])]))),128))]),_:1}))}}),nc=R(ac,[["__scopeId","data-v-b8c6b557"]]),Tt=L({__name:"ChargePointList",props:{id:{},compact:{type:Boolean}},setup(a){let e,t;const r=a,s=m(()=>{let p=Object.values(O);return u(),p}),o=m(()=>h.value+" "+d.value),h=m(()=>{switch(Object.values(O).length){case 0:return g.preferWideBoxes?"col-lg-6":"col-lg-4";case 1:return g.preferWideBoxes?"col-lg-6":"col-lg-4";case 2:return g.preferWideBoxes?"col-lg-12":"col-lg-8 ";default:return"col-lg-12"}}),d=m(()=>"swiper-chargepoints-"+r.id);function u(){let p=document.querySelector("."+d.value);if(p&&(t=p,e=t.swiper),e){let c="1";if(De.value)switch(Object.values(O).length){case 0:case 1:c="1";break;case 2:c="2";break;default:c="3"}t.setAttribute("slides-per-view",c),e.update()}}return Le(()=>{let p=document.querySelector("."+d.value);p&&(t=p,e=t.swiper),window.addEventListener("resize",u),window.document.addEventListener("visibilitychange",u)}),(p,c)=>(l(),f(F,null,[r.compact?w("",!0):(l(),f("swiper-container",{key:0,"space-between":0,"slides-per-view":1,pagination:{clickable:!0},class:q(["cplist m-0 p-0 d-flex align-items-stretch",o.value])},[(l(!0),f(F,null,te(s.value,k=>(l(),f("swiper-slide",{key:k.id},[n("div",{class:q([i(De)?"mb-0":"mb-5","d-flex align-items-stretch flex-fill"])},[v(Bl,{chargepoint:k,"full-width":!0},null,8,["chargepoint"])],2)]))),128))],2)),r.compact?(l(),$(nc,{key:1})):w("",!0)],64))}}),rc={class:"container-fluid p-0 m-0"},oc={class:"row p-0 m-0"},sc={class:"d-grid gap-2"},ic=["onClick"],lc={class:"col-md-4 p-1"},cc={class:"d-grid gap-2"},uc={key:0},dc={class:"row justify-content-center m-1 p-0"},hc={class:"col-lg-4 p-1 m-0"},pc={class:"d-grid gap-2"},gc={class:"col-lg-4 p-1 m-0"},mc={class:"d-grid gap-2"},fc={class:"col-lg-4 p-1 m-0"},vc={class:"d-grid gap-2"},yc=L({__name:"BBSelect",props:{cpId:{}},setup(a){const e=a,t=[{mode:"instant_charging",name:"Sofort",color:"var(--color-charging)"},{mode:"pv_charging",name:"PV",color:"var(--color-pv)"},{mode:"scheduled_charging",name:"Zielladen",color:"var(--color-battery)"},{mode:"standby",name:"Standby",color:"var(--color-axis)"},{mode:"stop",name:"Stop",color:"var(--color-axis)"}],r=m(()=>O[e.cpId]);function s(p){return p==r.value.chargeMode?"btn btn-success buttonTextSize":"btn btn-secondary buttonTextSize"}function o(p){return de.pvBatteryPriority==p?"btn-success":"btn-secondary"}function h(p){r.value.chargeMode=p}function d(p){r.value.isLocked=p}function u(p){de.pvBatteryPriority=p}return(p,c)=>(l(),f("div",rc,[n("div",oc,[(l(),f(F,null,te(t,(k,P)=>n("div",{key:P,class:"col-md-4 p-1"},[n("div",sc,[n("button",{type:"button",class:q(s(k.mode)),style:{},onClick:z=>h(k.mode)},S(k.name),11,ic)])])),64)),n("div",lc,[n("div",cc,[r.value.isLocked?(l(),f("button",{key:0,type:"button",class:"btn btn-outline-success buttonTextSize","data-bs-dismiss":"modal",onClick:c[0]||(c[0]=k=>d(!1))}," Entsperren ")):w("",!0),r.value.isLocked?w("",!0):(l(),f("button",{key:1,type:"button",class:"btn btn-outline-danger buttonTextSize","data-bs-dismiss":"modal",onClick:c[1]||(c[1]=k=>d(!0))}," Sperren "))])])]),i(de).isBatteryConfigured?(l(),f("div",uc,[c[8]||(c[8]=n("hr",null,null,-1)),c[9]||(c[9]=n("div",{class:"row"},[n("div",{class:"col text-center"},"Vorrang im Lademodus PV-Laden:")],-1)),n("div",dc,[n("div",hc,[n("div",pc,[n("button",{id:"evPriorityBtn",type:"button",class:q(["priorityModeBtn btn btn-secondary buttonTextSize",o("ev_mode")]),"data-dismiss":"modal",priority:"1",onClick:c[2]||(c[2]=k=>u("ev_mode"))},c[5]||(c[5]=[H(" EV "),n("span",{class:"fas fa-car ms-2"}," ",-1)]),2)])]),n("div",gc,[n("div",mc,[n("button",{id:"batteryPriorityBtn",type:"button",class:q(["priorityModeBtn btn btn-secondary buttonTextSize",o("bat_mode")]),"data-dismiss":"modal",priority:"0",onClick:c[3]||(c[3]=k=>u("bat_mode"))},c[6]||(c[6]=[H(" Speicher "),n("span",{class:"fas fa-car-battery ms-2"}," ",-1)]),2)])]),n("div",fc,[n("div",vc,[n("button",{id:"minsocPriorityBtn",type:"button",class:q(["priorityModeBtn btn btn-secondary buttonTextSize",o("min_soc_bat_mode")]),"data-dismiss":"modal",priority:"0",onClick:c[4]||(c[4]=k=>u("min_soc_bat_mode"))},c[7]||(c[7]=[H(" MinSoc "),n("span",{class:"fas fa-battery-half"}," ",-1)]),2)])])])])):w("",!0)]))}}),bc={class:"col-lg-4 p-0 m-0 mt-1"},_c={class:"d-grid gap-2"},wc=["data-bs-target"],kc={class:"m-0 p-0 d-flex justify-content-between align-items-center"},xc={class:"mx-1 badge rounded-pill smallTextSize plugIndicator"},Sc={key:0,class:"ms-2"},Mc={class:"m-0 p-0"},$c={key:0,class:"ps-1"},Pc=L({__name:"BbChargeButton",props:{chargepoint:{}},setup(a){const e=a,t="chargeSelectModal"+e.chargepoint.id,r=m(()=>ye[e.chargepoint.chargeMode].name),s=m(()=>{let c={background:"var(--color-menu)"};return e.chargepoint.isLocked?c.background="var(--color-evu)":e.chargepoint.isCharging?c.background="var(--color-charging)":e.chargepoint.isPluggedIn&&(c.background="var(--color-battery)"),c}),o=m(()=>{{let c={background:ye[e.chargepoint.chargeMode].color,color:"white"};switch(e.chargepoint.chargeMode){case ve.instant_charging:e.chargepoint.isCharging&&!e.chargepoint.isLocked&&(c=p(c));break;case ve.standby:case ve.stop:c.background="darkgrey",c.color="black";break;case ve.scheduled_charging:e.chargepoint.isPluggedIn&&!e.chargepoint.isCharging&&!e.chargepoint.isLocked&&(c=p(c));break}return c}}),h=m(()=>ye[e.chargepoint.chargeMode].icon),d=m(()=>{switch(de.pvBatteryPriority){case"ev_mode":return"fa-car";case"bat_mode":return"fa-car-battery";case"min_soc_bat_mode":return"fa-battery-half";default:return console.log("default"),""}}),u=m(()=>{let c="fa-ellipsis";return e.chargepoint.isLocked?c="fa-lock":e.chargepoint.isCharging?c=" fa-bolt":e.chargepoint.isPluggedIn&&(c="fa-plug"),"fa "+c});function p(c){let k=c.color;return c.color=c.background,c.background=k,c}return(c,k)=>(l(),f("div",bc,[n("div",_c,[n("button",{type:"button",class:"btn mx-1 mb-0 p-1 mediumTextSize chargeButton shadow",style:K(s.value),"data-bs-toggle":"modal","data-bs-target":"#"+t},[n("div",kc,[n("span",xc,[n("i",{class:q(u.value)},null,2),c.chargepoint.isCharging?(l(),f("span",Sc,S(i($e)(c.chargepoint.power)),1)):w("",!0)]),n("span",Mc,S(c.chargepoint.name),1),n("span",{class:"mx-2 m-0 badge rounded-pill smallTextSize modeIndicator",style:K(o.value)},[n("i",{class:q(["fa me-1",h.value])},null,2),H(" "+S(r.value)+" ",1),c.chargepoint.chargeMode==i(ve).pv_charging&&i(de).isBatteryConfigured?(l(),f("span",$c,[k[0]||(k[0]=H(" ( ")),n("i",{class:q(["fa m-0",d.value])},null,2),k[1]||(k[1]=H(") "))])):w("",!0)],4)])],12,wc)]),v(Ea,{"modal-id":t},{title:_(()=>[H(" Lademodus für "+S(c.chargepoint.vehicleName),1)]),default:_(()=>[v(yc,{"cp-id":c.chargepoint.id},null,8,["cp-id"])]),_:1})]))}}),Ic=R(Pc,[["__scopeId","data-v-31df6764"]]),Cc={class:"row p-0 mt-0 mb-1 m-0"},Bc={class:"col p-0 m-0"},Vc={class:"container-fluid p-0 m-0"},Lc={class:"row p-0 m-0 d-flex justify-content-center align-items-center"},Oc={key:0,class:"col time-display"},Ac=L({__name:"ButtonBar",setup(a){return(e,t)=>(l(),f("div",Cc,[n("div",Bc,[n("div",Vc,[n("div",Lc,[i(g).showClock=="buttonbar"?(l(),f("span",Oc,S(i(La)(i(Rt))),1)):w("",!0),(l(!0),f(F,null,te(i(O),(r,s)=>(l(),$(Ic,{key:s,chargepoint:r,"charge-point-count":Object.values(i(O)).length},null,8,["chargepoint","charge-point-count"]))),128))])])])]))}}),Tc=R(Ac,[["__scopeId","data-v-791e4be0"]]),Ec={class:"battery-title"},zc={class:"subgrid pt-1"},Wc=L({__name:"BLBattery",props:{bat:{}},setup(a){const e=a,t=m(()=>e.bat.power<0?`Liefert (${$e(-e.bat.power)})`:e.bat.power>0?`Lädt (${$e(e.bat.power)})`:"Bereit"),r=m(()=>e.bat.power<0?"var(--color-pv)":e.bat.power>0?"var(--color-battery)":"var(--color-menu)");return(s,o)=>(l(),$(tt,{titlecolor:"var(--color-title)",fullwidth:!0},{title:_(()=>[n("span",Ec,S(s.bat.name),1)]),buttons:_(()=>[v(Pe,{bgcolor:r.value},{default:_(()=>[H(S(t.value),1)]),_:1},8,["bgcolor"])]),default:_(()=>[n("div",zc,[v(X,{heading:"Ladestand:",small:!0,class:"grid-left grid-col-4"},{default:_(()=>[v(Ct,{soc:e.bat.soc},null,8,["soc"])]),_:1}),v(X,{heading:"Geladen:",small:!0,class:"grid-col-4"},{default:_(()=>[v(Ge,{"watt-h":e.bat.dailyYieldImport},null,8,["watt-h"])]),_:1}),v(X,{heading:"Geliefert:",small:!0,class:"grid-right grid-col-4"},{default:_(()=>[v(Ge,{"watt-h":e.bat.dailyYieldExport},null,8,["watt-h"])]),_:1})])]),_:1}))}}),Dc=R(Wc,[["__scopeId","data-v-f7f825f7"]]),Gc={class:"px-3 subgrid grid-12"},jc=L({__name:"BatteryList",setup(a){const e=m(()=>Q.batOut.power>0?`Liefert (${$e(Q.batOut.power)})`:U.batIn.power>0?`Lädt (${$e(U.batIn.power)})`:"Bereit:"),t=m(()=>Q.batOut.power>0?"var(--color-pv)":U.batIn.power>0?"var(--color-battery)":"var(--color-menu)"),r=m(()=>{let s=0;return he.value.forEach(o=>{s+=o.dailyYieldImport}),s});return(s,o)=>i(de).isBatteryConfigured?(l(),$(je,{key:0,"variable-width":!0,"full-width":!1},{title:_(()=>o[0]||(o[0]=[n("span",{class:"fas fa-car-battery me-2",style:{color:"var(--color-battery)"}}," ",-1),n("span",null,"Speicher",-1)])),buttons:_(()=>[v(Pe,{bgcolor:t.value},{default:_(()=>[H(S(e.value),1)]),_:1},8,["bgcolor"])]),default:_(()=>[n("div",Gc,[v(X,{heading:"Ladestand:",class:"grid-left grid-col-4"},{default:_(()=>[v(Ct,{color:"var(--color-battery)",soc:i(de).batterySoc},null,8,["soc"])]),_:1}),v(X,{heading:"Geladen:",class:"grid-col-4"},{default:_(()=>[n("span",null,S(i(ct)(r.value)),1)]),_:1}),v(X,{heading:"Geliefert",class:"grid-right grid-col-4"},{default:_(()=>[n("span",null,S(i(ct)(i(Q).batOut.energy)),1)]),_:1})]),(l(!0),f(F,null,te(i(he),([h,d])=>(l(),$(Dc,{key:h,bat:d},null,8,["bat"]))),128))]),_:1})):w("",!0)}}),Et=R(jc,[["__scopeId","data-v-cc4da23c"]]),Uc={class:"devicename"},Fc={class:"subgrid"},Nc=L({__name:"SHListItem",props:{device:{}},setup(a){const e=a,t=m(()=>e.device.status=="on"?"fa-toggle-on fa-xl":e.device.status=="waiting"?"fa-spinner fa-spin":"fa-toggle-off fa-xl"),r=m(()=>{let d="var(--color-switchRed)";switch(e.device.status){case"on":d="var(--color-switchGreen)";break;case"detection":d="var(--color-switchBlue)";break;case"timeout":d="var(--color-switchWhite)";break;case"waiting":d="var(--color-menu)";break;default:d="var(--color-switchRed)"}return{color:d}});function s(){e.device.isAutomatic||(e.device.status=="on"?oe("shSwitchOn",0,e.device.id):oe("shSwitchOn",1,e.device.id),ae.get(e.device.id).status="waiting")}function o(){e.device.isAutomatic?oe("shSetManual",1,e.device.id):oe("shSetManual",0,e.device.id)}const h=m(()=>e.device.isAutomatic?"Auto":"Man");return(d,u)=>(l(),$(tt,{titlecolor:d.device.color,fullwidth:!0},{title:_(()=>[n("span",Uc,S(d.device.name),1)]),buttons:_(()=>[(l(!0),f(F,null,te(d.device.temp,(p,c)=>(l(),f("span",{key:c},[p<300?(l(),$(Pe,{key:0,bgcolor:"var(--color-battery)"},{default:_(()=>[n("span",null,S(i(Nn)(p)),1)]),_:2},1024)):w("",!0)]))),128)),e.device.canSwitch?(l(),f("span",{key:0,class:q([t.value,"fa-solid statusbutton mr-2 ms-2"]),style:K(r.value),onClick:s},null,6)):w("",!0),e.device.canSwitch?(l(),$(Pe,{key:1,type:"button",onClick:o},{default:_(()=>[H(S(h.value),1)]),_:1})):w("",!0)]),default:_(()=>[n("div",Fc,[v(X,{heading:"Leistung:",small:!0,class:"grid-col-4 grid-left"},{default:_(()=>[v(bt,{watt:d.device.power},null,8,["watt"])]),_:1}),v(X,{heading:"Energie:",small:!0,class:"grid-col-4"},{default:_(()=>[v(Ge,{"watt-h":d.device.energy},null,8,["watt-h"])]),_:1}),v(X,{heading:"Laufzeit:",small:!0,class:"grid-col-4 grid-right"},{default:_(()=>[H(S(i(Un)(d.device.runningTime)),1)]),_:1})])]),_:1},8,["titlecolor"]))}}),Hc=R(Nc,[["__scopeId","data-v-20651ac6"]]),Rc={class:"sh-title py-4"},Jc=["id","onUpdate:modelValue","value"],Yc=["for"],qc=3,Qc=L({__name:"SmartHomeList",setup(a){const e=m(()=>De.value?t.value.reduce((h,d)=>{const u=h;let p=h[h.length-1];return p.length>=qc?h.push([d]):p.push(d),u},[[]]):[t.value]),t=m(()=>[...ae.values()].filter(h=>h.configured));function r(h){return"Geräte"+(De.value&&e.value.length>1?"("+(h+1)+")":"")}function s(){o.value=!o.value}const o=ee(!1);return(h,d)=>(l(),f(F,null,[(l(!0),f(F,null,te(e.value,(u,p)=>(l(),$(je,{key:p,"variable-width":!0},{title:_(()=>[n("span",{onClick:s},[d[0]||(d[0]=n("span",{class:"fas fa-plug me-2",style:{color:"var(--color-devices)"}}," ",-1)),n("span",Rc,S(r(p)),1)])]),buttons:_(()=>[n("span",{class:"ms-2 pt-1",onClick:s},d[1]||(d[1]=[n("span",{class:"fa-solid fa-lg ps-1 fa-ellipsis-vertical"},null,-1)]))]),default:_(()=>[(l(!0),f(F,null,te(u,c=>(l(),$(Hc,{key:c.id,device:c,class:"subgrid pb-2"},null,8,["device"]))),128))]),_:2},1024))),128)),o.value?(l(),$(je,{key:0},{title:_(()=>[n("span",{class:"smarthome",onClick:s},d[2]||(d[2]=[n("span",{class:"fas fa-gear"}," ",-1),H(" Einstellungen")]))]),buttons:_(()=>[n("span",{class:"ms-2 pt-1",onClick:s},d[3]||(d[3]=[n("span",{class:"fa-solid fa-lg ps-1 fa-circle-check"},null,-1)]))]),default:_(()=>[v(N,{title:"Im Energie-Graph anzeigen:",icon:"fa-chart-column",fullwidth:!0},{default:_(()=>[(l(!0),f(F,null,te(t.value,(u,p)=>(l(),f("div",{key:p},[vt(n("input",{id:"check"+p,"onUpdate:modelValue":c=>u.showInGraph=c,class:"form-check-input",type:"checkbox",value:u},null,8,Jc),[[Ma,u.showInGraph]]),n("label",{class:"form-check-label px-2",for:"check"+p},S(u.name),9,Yc)]))),128))]),_:1}),n("div",{class:"row p-0 m-0",onClick:s},d[4]||(d[4]=[n("div",{class:"col-12 mb-3 pe-3 mt-0"},[n("button",{class:"btn btn-sm btn-secondary float-end"},"Schließen")],-1)]))]),_:1})):w("",!0)],64))}}),zt=R(Qc,[["__scopeId","data-v-5b5cf6b3"]]),Zc={class:"countername"},Xc={class:"subgrid pt-1"},Kc=L({__name:"ClCounter",props:{counter:{}},setup(a){const e=a,t=m(()=>e.counter.power>0?"Bezug":"Export"),r=m(()=>e.counter.power>0?"var(--color-evu)":"var(--color-pv)");return(s,o)=>(l(),$(tt,{titlecolor:"var(--color-title)",fullwidth:!0},{title:_(()=>[n("span",Zc,S(s.counter.name),1)]),buttons:_(()=>[e.counter.power!=0?(l(),$(Pe,{key:0,bgcolor:r.value},{default:_(()=>[H(S(t.value),1)]),_:1},8,["bgcolor"])):w("",!0),v(Pe,{color:"var(--color-bg)"},{default:_(()=>[H(" ID: "+S(e.counter.id),1)]),_:1})]),default:_(()=>[n("div",Xc,[v(X,{heading:"Leistung:",small:!0,class:"grid-left grid-col-4"},{default:_(()=>[v(bt,{watt:Math.abs(e.counter.power)},null,8,["watt"])]),_:1}),v(X,{heading:"Bezogen:",small:!0,class:"grid-col-4"},{default:_(()=>[v(Ge,{"watt-h":e.counter.energy_imported},null,8,["watt-h"])]),_:1}),v(X,{heading:"Exportiert:",small:!0,class:"grid-right grid-col-4"},{default:_(()=>[v(Ge,{"watt-h":e.counter.energy_exported},null,8,["watt-h"])]),_:1})])]),_:1}))}}),eu=R(Kc,[["__scopeId","data-v-01dd8c4d"]]);class tu{constructor(e){b(this,"id");b(this,"name","Zähler");b(this,"power",0);b(this,"energy_imported",0);b(this,"energy_exported",0);b(this,"grid",!1);b(this,"type","counter");b(this,"color","var(--color-evu)");b(this,"energyPv",0);b(this,"energyBat",0);b(this,"pvPercentage",0);b(this,"icon","");this.id=e}}const ke=le({});function au(a,e){if(a in ke)console.info("Duplicate counter message: "+a);else switch(ke[a]=new tu(a),ke[a].type=e,e){case"counter":ke[a].color="var(--color-evu)";break;case"inverter":ke[a].color="var(--color-pv)";break;case"cp":ke[a].color="var(--color-charging)";break;case"bat":ke[a].color="var(--color-bat)";break}}const nu=L({__name:"CounterList",setup(a){return(e,t)=>(l(),$(je,{"variable-width":!0},{title:_(()=>t[0]||(t[0]=[n("span",{class:"fas fa-bolt me-2",style:{color:"var(--color-evu)"}}," ",-1),n("span",null,"Zähler",-1)])),default:_(()=>[(l(!0),f(F,null,te(i(ke),(r,s)=>(l(),f("div",{key:s,class:"subgrid pb-2"},[v(eu,{counter:r},null,8,["counter"])]))),128))]),_:1}))}}),Wt=R(nu,[["__scopeId","data-v-5f059284"]]),ru={class:"vehiclename"},ou={class:"subgrid"},su=L({__name:"VlVehicle",props:{vehicle:{}},setup(a){const e=a,t=m(()=>{let s="Unterwegs",o=e.vehicle.chargepoint;return o!=null&&(o.isCharging?s="Lädt ("+o.name+")":o.isPluggedIn&&(s="Bereit ("+o.name+")")),s}),r=m(()=>{let s=e.vehicle.chargepoint;return s!=null?s.isLocked?"var(--color-evu)":s.isCharging?"var(--color-charging)":s.isPluggedIn?"var(--color-battery)":"var(--color-axis)":"var(--color-axis)"});return(s,o)=>(l(),$(tt,{titlecolor:"var(--color-title)",fullwidth:!0},{title:_(()=>[n("span",ru,S(e.vehicle.name),1)]),default:_(()=>[n("div",ou,[v(X,{heading:"Status:",small:!0,class:"grid-left grid-col-4"},{default:_(()=>[n("span",{style:K({color:r.value}),class:"d-flex justify-content-center align-items-center status-string"},S(t.value),5)]),_:1}),v(X,{heading:"Ladestand:",small:!0,class:"grid-col-4"},{default:_(()=>[H(S(Math.round(e.vehicle.soc))+" % ",1)]),_:1}),v(X,{heading:"Reichweite:",small:!0,class:"grid-right grid-col-4"},{default:_(()=>[H(S(Math.round(e.vehicle.range))+" km ",1)]),_:1})])]),_:1}))}}),iu=R(su,[["__scopeId","data-v-9e2cb63e"]]),lu=L({__name:"VehicleList",setup(a){return(e,t)=>(l(),$(je,{"variable-width":!0},{title:_(()=>t[0]||(t[0]=[n("span",{class:"fas fa-car me-2",style:{color:"var(--color-charging)"}}," ",-1),n("span",null,"Fahrzeuge",-1)])),default:_(()=>[(l(!0),f(F,null,te(Object.values(i(Y)).filter(r=>r.visible),(r,s)=>(l(),f("div",{key:s,class:"subgrid"},[v(iu,{vehicle:r},null,8,["vehicle"])]))),128))]),_:1}))}}),Dt=R(lu,[["__scopeId","data-v-23b437ea"]]),cu={class:"grapharea"},uu={id:"pricechart",class:"p-1 m-0 pricefigure"},du={viewBox:"0 0 400 280"},hu=["id","origin","transform"],ut=380,_a=250,Gt=12,pu=L({__name:"GlobalPriceChart",props:{id:{}},setup(a){const e=a,t=ee(!1),r={top:0,bottom:15,left:20,right:0},s=m(()=>{let A=[];return re.etPriceList.size>0&&re.etPriceList.forEach((V,J)=>{A.push([J,V])}),A}),o=m(()=>s.value.length>1?(ut-r.left-r.right)/s.value.length:0),h=m(()=>{let A=Ve(s.value,V=>V[0]);return A[1]&&(A[1]=new Date(A[1]),A[1].setTime(A[1].getTime()+36e5)),et().range([r.left,ut-r.right]).domain(A)}),d=m(()=>{let A=[0,0];return s.value.length>0&&(A=Ve(s.value,V=>V[1]),A[0]=Math.floor(A[0])-1,A[1]=Math.floor(A[1])+1),A}),u=m(()=>He().range([_a-r.bottom,0]).domain(d.value)),p=m(()=>{const A=Ne(),V=[[r.left,u.value(g.lowerPriceBound)],[ut-r.right,u.value(g.lowerPriceBound)]];return A(V)}),c=m(()=>{const A=Ne(),V=[[r.left,u.value(g.upperPriceBound)],[ut-r.right,u.value(g.upperPriceBound)]];return A(V)}),k=m(()=>{const A=Ne(),V=[[r.left,u.value(0)],[ut-r.right,u.value(0)]];return A(V)}),P=m(()=>ht(h.value).ticks(s.value.length).tickSize(5).tickSizeInner(-250).tickFormat(A=>A.getHours()%6==0?st("%H:%M")(A):"")),z=m(()=>ft(u.value).ticks(d.value[1]-d.value[0]).tickSize(0).tickSizeInner(-360).tickFormat(A=>A.toString())),D=m(()=>{t.value==!0;const A=ce("g#"+B.value);A.selectAll("*").remove(),A.selectAll("bar").data(s.value).enter().append("g").append("rect").attr("class","bar").attr("x",x=>h.value(x[0])).attr("y",x=>u.value(x[1])).attr("width",o.value).attr("height",x=>u.value(d.value[0])-u.value(x[1])).attr("fill","var(--color-charging)");const J=A.append("g").attr("class","axis").call(P.value);J.attr("transform","translate(0,"+(_a-r.bottom)+")"),J.selectAll(".tick").attr("font-size",Gt).attr("color","var(--color-bg)"),J.selectAll(".tick line").attr("stroke","var(--color-bg)").attr("stroke-width",x=>x.getHours()%6==0?"2":"0.5"),J.select(".domain").attr("stroke","var(--color-bg");const C=A.append("g").attr("class","axis").call(z.value);C.attr("transform","translate("+r.left+",0)"),C.selectAll(".tick").attr("font-size",Gt).attr("color","var(--color-bg)"),C.selectAll(".tick line").attr("stroke","var(--color-bg)").attr("stroke-width",x=>x%5==0?"2":"0.5"),C.select(".domain").attr("stroke","var(--color-bg)"),d.value[0]<0&&A.append("path").attr("d",k.value).attr("stroke","var(--color-fg)"),A.append("path").attr("d",p.value).attr("stroke","green"),A.append("path").attr("d",c.value).attr("stroke","red");const M=A.selectAll("ttip").data(s.value).enter().append("g").attr("class","ttarea");M.append("rect").attr("x",x=>h.value(x[0])).attr("y",x=>u.value(x[1])).attr("height",x=>u.value(d.value[0])-u.value(x[1])).attr("class","ttrect").attr("width",o.value).attr("opacity","1%").attr("fill","var(--color-charging)");const E=M.append("g").attr("class","ttmessage").attr("transform",x=>"translate("+(h.value(x[0])-30+o.value/2)+","+(u.value(x[1])-16)+")");E.append("rect").attr("rx",5).attr("width","60").attr("height","30").attr("fill","var(--color-menu)");const I=E.append("text").attr("text-anchor","middle").attr("x",30).attr("y",12).attr("font-size",Gt).attr("fill","var(--color-bg)");return I.append("tspan").attr("x",30).attr("dy","0em").text(x=>st("%H:%M")(x[0])),I.append("tspan").attr("x",30).attr("dy","1.1em").text(x=>Math.round(x[1]*10)/10+" ct"),"PriceChart.vue"}),B=m(()=>"priceChartCanvas"+e.id);return Le(()=>{t.value=!t.value}),(A,V)=>(l(),$(je,{"variable-width":!0},{title:_(()=>V[0]||(V[0]=[n("span",{class:"fas fa-coins me-2",style:{color:"var(--color-battery)"}}," ",-1),n("span",null,"Strompreis",-1)])),buttons:_(()=>[i(re).active?(l(),$(Pe,{key:0,bgcolor:"var(--color-charging)"},{default:_(()=>[H(S(i(re).etCurrentPriceString),1)]),_:1})):w("",!0),i(re).active?(l(),$(Pe,{key:1,bgcolor:"var(--color-menu)"},{default:_(()=>[H(S(i(re).etProvider),1)]),_:1})):w("",!0)]),default:_(()=>[n("div",cu,[n("figure",uu,[(l(),f("svg",du,[n("g",{id:B.value,origin:D.value,transform:"translate("+r.top+","+r.left+") "},null,8,hu)]))])])]),_:1}))}}),jt=R(pu,[["__scopeId","data-v-6000c955"]]),gu={class:"subgrid pt-1"},mu=L({__name:"IlInverter",props:{inverter:{}},setup(a){const e=a,t=m(()=>({color:e.inverter.color}));return(r,s)=>(l(),$(tt,{titlecolor:"var(--color-title)",fullwidth:!0},{title:_(()=>[n("span",{class:"invertername",style:K(t.value)},S(r.inverter.name),5)]),buttons:_(()=>[e.inverter.power<0?(l(),$(Pe,{key:0,bgcolor:"var(--color-pv)"},{default:_(()=>[H(S(i($e)(-e.inverter.power)),1)]),_:1})):w("",!0)]),default:_(()=>[n("div",gu,[v(X,{heading:"Heute:",small:!0,class:"grid-col-4 grid-left"},{default:_(()=>[v(Ge,{"watt-h":e.inverter.energy},null,8,["watt-h"])]),_:1}),v(X,{heading:"Monat:",small:!0,class:"grid-col-4"},{default:_(()=>[v(Ge,{"watt-h":e.inverter.energy_month},null,8,["watt-h"])]),_:1}),v(X,{heading:"Jahr:",small:!0,class:"grid-right grid-col-4"},{default:_(()=>[v(Ge,{"watt-h":e.inverter.energy_year},null,8,["watt-h"])]),_:1})])]),_:1}))}}),fu=R(mu,[["__scopeId","data-v-258d8f17"]]),vu=L({__name:"InverterList",setup(a){return(e,t)=>(l(),$(je,{"variable-width":!0},{title:_(()=>t[0]||(t[0]=[n("span",{class:"fas fa-solar-panel me-2",style:{color:"var(--color-pv)"}}," ",-1),n("span",null,"Wechselrichter",-1)])),buttons:_(()=>[i(Q).pv.power>0?(l(),$(Pe,{key:0,bgcolor:"var(--color-pv)"},{default:_(()=>[H(S(i($e)(i(Q).pv.power)),1)]),_:1})):w("",!0)]),default:_(()=>[(l(!0),f(F,null,te(i(we),([r,s])=>(l(),f("div",{key:r,class:"subgrid pb-2"},[v(fu,{inverter:s},null,8,["inverter"])]))),128))]),_:1}))}}),Ut=R(vu,[["__scopeId","data-v-b7a71f81"]]),yu={class:"row py-0 px-0 m-0"},bu=["breakpoints"],_u=L({__name:"CarouselFix",setup(a){let e,t;const r=ee(!1),s=m(()=>r.value?{992:{slidesPerView:1,spaceBetween:0}}:{992:{slidesPerView:3,spaceBetween:0}});return Ka(()=>g.zoomGraph,o=>{if(e){let h=o?"1":"3";t.setAttribute("slides-per-view",h),e.activeIndex=g.zoomedWidget,e.update()}}),Le(()=>{let o=document.querySelector(".swiper-carousel");o&&(t=o,e=t.swiper)}),(o,h)=>(l(),f("div",yu,[n("swiper-container",{"space-between":0,pagination:{clickable:!0},"slides-per-view":"1",class:"p-0 m-0 swiper-carousel",breakpoints:s.value},[n("swiper-slide",null,[n("div",{class:q([i(De)?"mb-0":"mb-5","flex-fill d-flex align-items-stretch"])},[pe(o.$slots,"item1",{},void 0,!0)],2)]),n("swiper-slide",null,[n("div",{class:q([i(De)?"mb-0":"mb-5","flex-fill d-flex align-items-stretch"])},[pe(o.$slots,"item2",{},void 0,!0)],2)]),n("swiper-slide",null,[n("div",{class:q([i(De)?"mb-0":"mb-5","flex-fill d-flex align-items-stretch"])},[pe(o.$slots,"item3",{},void 0,!0)],2)])],8,bu)]))}}),wu=R(_u,[["__scopeId","data-v-17424929"]]);function ku(a,e){a=="openWB/graph/boolDisplayLiveGraph"?de.displayLiveGraph=+e==1:a.match(/^openwb\/graph\/alllivevaluesJson[1-9][0-9]*$/i)?xu(a,e):a=="openWB/graph/lastlivevaluesJson"?Su(a,e):a=="openWB/graph/config/duration"&&(ge.duration=JSON.parse(e))}function xu(a,e){if(!ge.initialized){let t=[];const r=e.toString().split(` `);r.length>1?t=r.map(h=>JSON.parse(h)):t=[];const s=a.match(/(\d+)$/g),o=s?s[0]:"";o!=""&&typeof ge.rawDataPacks[+o-1]>"u"&&(ge.rawDataPacks[+o-1]=t,ge.initCounter++)}if(ge.initCounter==16){const t=[];ge.unsubscribeRefresh(),ge.initialized=!0,ge.rawDataPacks.forEach(r=>{r.forEach(s=>{const o=za(s);t.push(o)})}),yt(t),ge.subscribeUpdates()}}function Su(a,e){const t=JSON.parse(e),r=za(t);ge.graphRefreshCounter++,yt(y.data.concat(r)),ge.graphRefreshCounter>60&&ge.activate()}function za(a){const e=Object.values(O).length>0?Object.values(O)[0].connectedVehicle:0,t=Object.values(O).length>1?Object.values(O)[1].connectedVehicle:1,r="ev"+e+"-soc",s="ev"+t+"-soc",o={};o.date=+a.timestamp*1e3,+a.grid>0?(o.evuIn=+a.grid,o.evuOut=0):+a.grid<=0?(o.evuIn=0,o.evuOut=-a.grid):(o.evuIn=0,o.evuOut=0),+a["pv-all"]>=0?(o.pv=+a["pv-all"],o.inverter=0):(o.pv=0,o.inverter=-a["pv-all"]),o.house=+a["house-power"],+a["bat-all-power"]>0?(o.batOut=0,o.batIn=+a["bat-all-power"]):+a["bat-all-power"]<0?(o.batOut=-a["bat-all-power"],o.batIn=0):(o.batOut=0,o.batIn=0),a["bat-all-soc"]?o.batSoc=+a["bat-all-soc"]:o.batSoc=0,a[r]&&(o["soc"+e]=+a[r]),a[s]&&(o["soc"+t]=+a[s]),o.charging=+a["charging-all"];for(let h=0;h<10;h++){const d="cp"+h;o[d]=+(a[d+"-power"]??0)}return o.selfUsage=o.pv-o.evuOut,o.selfUsage<0&&(o.selfUsage=0),o.devices=0,o}const Mu=["evuIn","pv","batOut","evuOut","charging","house"];let $t=[];function $u(a,e){const{entries:t,names:r,totals:s}=JSON.parse(e);Fe.value=new Map(Object.entries(r)),aa(),$t=[],Zt.forEach(h=>{T.setEnergyPv(h,0),T.setEnergyBat(h,0)});const o=Pu(t);yt(o),Xt(s,$t),g.debug&&Cu(t,s,o),y.graphMode=="today"&&setTimeout(()=>ue.activate(),3e5)}function Pu(a){const e=[];let t={};return a.forEach(r=>{t=Iu(r);const s=t;e.push(s)}),e}function Iu(a){const e={};e.date=a.timestamp*1e3,e.evuOut=0,e.evuIn=0,Object.entries(a.counter).forEach(([s,o])=>{o.grid&&(e.evuOut+=o.power_exported,e.evuIn+=o.power_imported,$t.includes(s)||$t.push(s))}),e.evuOut==0&&e.evuIn==0&&Object.entries(a.counter).forEach(s=>{e.evuOut+=s[1].power_exported,e.evuIn+=s[1].power_imported}),Object.entries(a.pv).forEach(([s,o])=>{s!="all"?e[s]=o.power_exported:e.pv=o.power_exported}),Object.entries(a.bat).length>0?(e.batIn=a.bat.all.power_imported,e.batOut=a.bat.all.power_exported,e.batSoc=a.bat.all.soc??0):(e.batIn=0,e.batOut=0,e.batSoc=0),Object.entries(a.cp).forEach(([s,o])=>{s!="all"?(e[s]=o.power_imported,T.keys().includes(s)||T.addItem(s)):e.charging=o.power_imported}),Object.entries(a.ev).forEach(([s,o])=>{s!="all"&&(e["soc"+s.substring(2)]=o.soc)}),e.devices=0;let t=0;return Object.entries(a.sh).forEach(([s,o])=>{var h;s!="all"&&(e[s]=o.power_imported??0,T.keys().includes(s)||(T.addItem(s),T.items[s].showInGraph=ae.get(+s.slice(2)).showInGraph),(h=ae.get(+s.slice(2)))!=null&&h.countAsHouse?t+=e[s]:e.devices+=o.power_imported??0)}),e.selfUsage=Math.max(0,e.pv-e.evuOut),a.hc&&a.hc.all?e.house=a.hc.all.power_imported-t:e.house=e.evuIn+e.batOut+e.pv-e.evuOut-e.charging-e.devices-e.batOut,e.evuIn+e.batOut+e.pv>0?T.keys().filter(s=>!Mu.includes(s)&&s!="charging").forEach(s=>{Mn(s,e)}):Object.keys(e).forEach(s=>{e[s+"Pv"]=0,e[s+"Bat"]=0}),e}function Cu(a,e,t){console.debug("---------------------------------------- Graph Data -"),console.debug(["--- Incoming graph data:",a]),console.debug(["--- Incoming energy data:",e]),console.debug(["--- Data to be displayed:",t]),console.debug("-----------------------------------------------------")}let kt={};const ra=["charging","house","batIn","devices"],Bu=["evuIn","pv","batOut","batIn","evuOut","devices","sh1","sh2","sh3","sh4","sh5","sh6","sh7","sh8","sh9"];let Ke=[];function Vu(a,e){const{entries:t,names:r,totals:s}=JSON.parse(e);Fe.value=new Map(Object.entries(r)),aa(),Ke=[],ra.forEach(o=>{T.items[o].energyPv=0,T.items[o].energyBat=0}),t.length>0&&yt(Wa(t)),Xt(s,Ke)}function Lu(a,e){const{entries:t,names:r,totals:s}=JSON.parse(e);Fe.value=new Map(Object.entries(r)),aa(),Ke=[],ra.forEach(o=>{T.items[o].energyPv=0,T.items[o].energyBat=0}),t.length>0&&yt(Wa(t)),Xt(s,Ke)}function Wa(a){const e=[];let t={};return kt={},a.forEach(r=>{t=Ou(r),e.push(t),Object.keys(t).forEach(s=>{s!="date"&&(t[s]<0&&(console.warn(`Negative energy value for ${s} in row ${t.date}. Ignoring the value.`),t[s]=0),kt[s]?kt[s]+=t[s]:kt[s]=t[s])})}),e}function Ou(a){const e={},t=en("%Y%m%d")(a.date);t&&(e.date=y.graphMode=="month"?t.getDate():t.getMonth()+1),e.evuOut=0,e.evuIn=0;let r=0,s=0;return Object.entries(a.counter).forEach(([h,d])=>{r+=d.energy_exported,s+=d.energy_imported,d.grid&&(e.evuOut+=d.energy_exported,e.evuIn+=d.energy_imported,Ke.includes(h)||Ke.push(h))}),Ke.length==0&&(e.evuOut=r,e.evuIn=s),e.pv=a.pv.all.energy_exported,Object.entries(a.bat).length>0?(a.bat.all.energy_imported>=0?e.batIn=a.bat.all.energy_imported:(console.warn("ignoring negative value for batIn on day "+e.date),e.batIn=0),a.bat.all.energy_exported>=0?e.batOut=a.bat.all.energy_exported:(console.warn("ignoring negative value for batOut on day "+e.date),e.batOut=0)):(e.batIn=0,e.batOut=0),Object.entries(a.cp).forEach(([h,d])=>{h!="all"?(T.keys().includes(h)||T.addItem(h),e[h]=d.energy_imported):e.charging=d.energy_imported}),Object.entries(a.ev).forEach(([h,d])=>{h!="all"&&(e["soc-"+h]=d.soc)}),e.devices=Object.entries(a.sh).reduce((h,d)=>(T.keys().includes(d[0])||T.addItem(d[0]),d[1].energy_imported>=0?h+=d[1].energy_imported:console.warn(`Negative energy value for device ${d[0]} in row ${e.date}. Ignoring this value`),h),0),a.hc&&a.hc.all?e.house=a.hc.all.energy_imported:e.house=e.pv+e.evuIn+e.batOut-e.evuOut-e.batIn-e.charging,e.selfUsage=e.pv-e.evuOut,e.evuIn+e.batOut+e.pv>0?T.keys().filter(h=>!Bu.includes(h)).forEach(h=>{$n(h,e)}):ra.map(h=>{e[h+"Pv"]=0,e[h+"Bat"]=0}),e}function Au(a,e){const t=Tu(a);if(t&&!he.value.has(t)){console.warn("Invalid battery index: ",t);return}a=="openWB/bat/config/configured"?de.isBatteryConfigured=e=="true":a=="openWB/bat/get/power"?+e>0?(U.batIn.power=+e,Q.batOut.power=0):(U.batIn.power=0,Q.batOut.power=-e):a=="openWB/bat/get/soc"?de.batterySoc=+e:a=="openWB/bat/get/daily_exported"?Q.batOut.energy=+e:a=="openWB/bat/get/daily_imported"?U.batIn.energy=+e:t&&he.value.has(t)&&(a.match(/^openwb\/bat\/[0-9]+\/get\/daily_exported$/i)?he.value.get(t).dailyYieldExport=+e:a.match(/^openwb\/bat\/[0-9]+\/get\/daily_imported$/i)?he.value.get(t).dailyYieldImport=+e:a.match(/^openwb\/bat\/[0-9]+\/get\/exported$/i)?he.value.get(t).exported=+e:a.match(/^openwb\/bat\/[0-9]+\/get\/fault_state$/i)?he.value.get(t).faultState=+e:a.match(/^openwb\/bat\/[0-9]+\/get\/fault_str$/i)?he.value.get(t).faultStr=e:a.match(/^openwb\/bat\/[0-9]+\/get\/imported$/i)?he.value.get(t).imported=+e:a.match(/^openwb\/bat\/[0-9]+\/get\/power$/i)?he.value.get(t).power=+e:a.match(/^openwb\/bat\/[0-9]+\/get\/soc$/i)&&(he.value.get(t).soc=+e))}function Tu(a){let e=0;try{const t=a.match(/(?:\/)([0-9]+)(?=\/)/g);return t?(e=+t[0].replace(/[^0-9]+/g,""),e):void 0}catch(t){console.warn("Parser error in getIndex for topic "+a+": "+t)}}function Eu(a,e){if(a=="openWB/optional/et/provider")JSON.parse(e).type==null?re.active=!1:(re.active=!0,re.etProvider=JSON.parse(e).name);else if(a=="openWB/optional/et/get/prices"){const t=JSON.parse(e);re.etPriceList=new Map,Object.keys(t).forEach(r=>{re.etPriceList.set(new Date(+r*1e3),t[r]*1e5)})}}function zu(a,e){const t=Da(a);if(t&&!(t in O)){console.warn("Invalid chargepoint id received: "+t);return}if(a=="openWB/chargepoint/get/power"?U.charging.power=+e:a=="openWB/chargepoint/get/daily_imported"&&(U.charging.energy=+e),a=="openWB/chargepoint/get/daily_exported")de.cpDailyExported=+e;else if(t){if(a.match(/^openwb\/chargepoint\/[0-9]+\/config$/i))if(O[t]){const r=JSON.parse(e);O[t].name=r.name,O[t].icon=r.name,ie["cp"+t]?(ie["cp"+t].name=r.name,ie["cp"+t].icon=r.name):ie["cp"+t]={name:r.name,icon:r.name,color:"var(--color-charging)"}}else console.warn("invalid chargepoint index: "+t);else if(a.match(/^openwb\/chargepoint\/[0-9]+\/get\/state_str$/i))O[t].stateStr=JSON.parse(e);else if(a.match(/^openwb\/chargepoint\/[0-9]+\/get\/fault_str$/i))O[t].faultStr=JSON.parse(e);else if(a.match(/^openwb\/chargepoint\/[0-9]+\/get\/fault_state$/i))O[t].faultState=+e;else if(a.match(/^openWB\/chargepoint\/[0-9]+\/get\/power$/i))O[t].power=+e;else if(a.match(/^openWB\/chargepoint\/[0-9]+\/get\/daily_imported$/i))O[t].dailyYield=+e;else if(a.match(/^openwb\/chargepoint\/[0-9]+\/get\/plug_state$/i))O[t].isPluggedIn=e=="true";else if(a.match(/^openwb\/chargepoint\/[0-9]+\/get\/charge_state$/i))O[t].isCharging=e=="true";else if(a.match(/^openwb\/chargepoint\/[0-9]+\/set\/manual_lock$/i))O[t].updateIsLocked(e=="true");else if(a.match(/^openwb\/chargepoint\/[0-9]+\/get\/enabled$/i))O[t].isEnabled=e=="1";else if(a.match(/^openwb\/chargepoint\/[0-9]+\/get\/phases_in_use/i))O[t].phasesInUse=+e;else if(a.match(/^openwb\/chargepoint\/[0-9]+\/set\/current/i))O[t].current=+e;else if(a.match(/^openwb\/chargepoint\/[0-9]+\/get\/currents/i))O[t].currents=JSON.parse(e);else if(a.match(/^openwb\/chargepoint\/[0-9]+\/set\/log/i)){const r=JSON.parse(e);O[t].chargedSincePlugged=r.imported_since_plugged}else if(a.match(/^openwb\/chargepoint\/[0-9]+\/get\/connected_vehicle\/soc$/i)){const r=JSON.parse(e);O[t].soc=r.soc,O[t].waitingForSoc=!1,O[t].rangeCharged=r.range_charged,O[t].rangeUnit=r.range_unit}else if(a.match(/^openwb\/chargepoint\/[0-9]+\/get\/connected_vehicle\/info$/i)){const r=JSON.parse(e);O[t].vehicleName=String(r.name),O[t].updateConnectedVehicle(+r.id)}else if(a.match(/^openwb\/chargepoint\/[0-9]+\/get\/connected_vehicle\/config$/i)){const r=JSON.parse(e);switch(r.chargemode){case"instant_charging":O[t].updateChargeMode(ve.instant_charging);break;case"pv_charging":O[t].updateChargeMode(ve.pv_charging);break;case"scheduled_charging":O[t].updateChargeMode(ve.scheduled_charging);break;case"standby":O[t].updateChargeMode(ve.standby);break;case"stop":O[t].updateChargeMode(ve.stop);break}O[t].chargeTemplate=r.charge_template,O[t].averageConsumption=r.average_consumption}}}function Wu(a,e){const t=Da(a);if(t!=null){if(!(t in Y)){const r=new yn(t);Y[t]=r}if(a.match(/^openwb\/vehicle\/[0-9]+\/name$/i))Object.values(O).forEach(r=>{r.connectedVehicle==t&&(r.vehicleName=JSON.parse(e))}),Y[t].name=JSON.parse(e);else if(a.match(/^openwb\/vehicle\/[0-9]+\/get\/soc$/i))Y[t].soc=JSON.parse(e);else if(a.match(/^openwb\/vehicle\/[0-9]+\/get\/range$/i))isNaN(+e)?Y[t].range=0:Y[t].range=+e;else if(a.match(/^openwb\/vehicle\/[0-9]+\/charge_template$/i))Y[t].updateChargeTemplateId(+e);else if(a.match(/^openwb\/vehicle\/[0-9]+\/ev_template$/i))Y[t].updateEvTemplateId(+e);else if(a.match(/^openwb\/vehicle\/[0-9]+\/soc_module\/config$/i)){const r=JSON.parse(e);Object.values(O).forEach(s=>{s.connectedVehicle==t&&(s.isSocConfigured=r.type!==null,s.isSocManual=r.type=="manual")})}}}function Du(a,e){if(a.match(/^openwb\/vehicle\/template\/charge_template\/[0-9]+$/i)){const t=a.match(/[0-9]+$/i);if(t){const r=+t[0],s=JSON.parse(e);_e[r]=s,Gu(r,s)}}else if(a.match(/^openwb\/vehicle\/template\/charge_template\/[0-9]+\/time_charging\/plans\/[0-9]+$/i)){const t=a.match(/(?:\/)([0-9]+)(?:\/)/g),r=a.match(/[0-9]+$/i);if(t&&r){const s=+t[0].replace(/[^0-9]+/g,""),o=+r[0],h=JSON.parse(e);s in gt||(gt[s]=[]),gt[s][o]=h}}else if(a.match(/^openwb\/vehicle\/template\/charge_template\/[0-9]+\/chargemode\/scheduled_charging\/plans\/[0-9]+$/i)){const t=a.match(/(?:\/)([0-9]+)(?:\/)/g),r=a.match(/[0-9]+$/i);if(t&&r){const s=+t[0].replace(/[^0-9]+/g,""),o=+r[0],h=JSON.parse(e);s in pt||(pt[s]=[]),pt[s][o]=h}}else if(a.match(/^openwb\/vehicle\/template\/ev_template\/[0-9]+$/i)){const t=a.match(/[0-9]+$/i);if(t){const r=+t[0],s=JSON.parse(e);Ht[r]=s}}}function Gu(a,e){Object.values(O).forEach(t=>{t.chargeTemplate==a&&(t.updateCpPriority(e.prio),t.updateInstantChargeLimitMode(e.chargemode.instant_charging.limit.selected),t.updateInstantTargetCurrent(e.chargemode.instant_charging.current),t.updateInstantTargetSoc(e.chargemode.instant_charging.limit.soc),t.updateInstantMaxEnergy(e.chargemode.instant_charging.limit.amount),t.updatePvFeedInLimit(e.chargemode.pv_charging.feed_in_limit),t.updatePvMinCurrent(e.chargemode.pv_charging.min_current),t.updatePvMaxSoc(e.chargemode.pv_charging.max_soc),t.updatePvMinSoc(e.chargemode.pv_charging.min_soc),t.updatePvMinSocCurrent(e.chargemode.pv_charging.min_soc_current))})}function Da(a){let e=0;try{const t=a.match(/(?:\/)([0-9]+)(?=\/)/g);return t?(e=+t[0].replace(/[^0-9]+/g,""),e):void 0}catch(t){console.warn("Parser error in getIndex for topic "+a+": "+t)}}function ju(a,e){a.match(/^openWB\/LegacySmarthome\/config\//i)?Uu(a,e):a.match(/^openWB\/LegacySmarthome\/Devices\//i)&&Fu(a,e)}function Uu(a,e){const t=Ga(a);if(t==null)return;ae.has(t)||Yt(t);const r=ae.get(t);a.match(/^openWB\/LegacySmarthome\/config\/get\/Devices\/[0-9]+\/device_configured$/i)?r.configured=e!="0":a.match(/^openWB\/LegacySmarthome\/config\/get\/Devices\/[0-9]+\/device_name$/i)?(r.name=e.toString(),r.icon=e.toString(),ie["sh"+t].name=e.toString(),ie["sh"+t].icon=e.toString()):a.match(/^openWB\/LegacySmarthome\/config\/set\/Devices\/[0-9]+\/mode$/i)?r.isAutomatic=e=="0":a.match(/^openWB\/LegacySmarthome\/config\/get\/Devices\/[0-9]+\/device_canSwitch$/i)?r.canSwitch=e=="1":a.match(/^openWB\/LegacySmarthome\/config\/get\/Devices\/[0-9]+\/device_homeConsumtion$/i)?r.countAsHouse=e=="1":a.match(/^openWB\/LegacySmarthome\/config\/get\/Devices\/[0-9]+\/device_temperatur_configured$/i)&&(r.tempConfigured=+e)}function Fu(a,e){const t=Ga(a);if(t==null){console.warn("Smarthome: Missing index in "+a);return}ae.has(t)||Yt(t);const r=ae.get(t);if(a.match(/^openWB\/LegacySmarthome\/Devices\/[0-9]+\/Watt$/i))r.power=+e,Nu("power");else if(!a.match(/^openWB\/LegacySmarthome\/Devices\/[0-9]+\/Wh$/i)){if(a.match(/^openWB\/LegacySmarthome\/Devices\/[0-9]+\/RunningTimeToday$/i))r.runningTime=+e;else if(a.match(/^openWB\/LegacySmarthome\/Devices\/[0-9]+\/TemperatureSensor0$/i))r.temp[0]=+e;else if(a.match(/^openWB\/LegacySmarthome\/Devices\/[0-9]+\/TemperatureSensor1$/i))r.temp[1]=+e;else if(a.match(/^openWB\/LegacySmarthome\/Devices\/[0-9]+\/TemperatureSensor2$/i))r.temp[2]=+e;else if(a.match(/^openWB\/LegacySmartHome\/Devices\/[0-9]+\/Status$/i))switch(+e){case 10:r.status="off";break;case 11:r.status="on";break;case 20:r.status="detection";break;case 30:r.status="timeout";break;default:r.status="off"}}}function Nu(a){switch(a){case"power":U.devices.power=[...ae.values()].filter(e=>e.configured&&!e.countAsHouse).reduce((e,t)=>e+t.power,0);break;case"energy":U.devices.energy=[...ae.values()].filter(e=>e.configured&&!e.countAsHouse).reduce((e,t)=>e+t.energy,0);break;default:console.error("Unknown category")}}function Ga(a){let e=0;try{const t=a.match(/(?:\/)([0-9]+)(?=\/)/g);return t?(e=+t[0].replace(/[^0-9]+/g,""),e):void 0}catch(t){console.warn("Parser error in getIndex for topic "+a+": "+t)}}const Pt=le([]);class oa{constructor(e,t,r,s){b(this,"name");b(this,"children");b(this,"count");b(this,"lastValue");this.name=e,this.children=t,this.count=r,this.lastValue=s}insert(e,t){if(e.length){const r=e.splice(1);if(e[0]==this.name)if(r.length){let s=!1;if(this.children.forEach(o=>{o.name==r[0]&&(o.insert(r,t),s=!0)}),!s){const o=new oa(r[0],[],0,"");o.insert(r,t),this.children.push(o)}}else this.count=this.count+1,this.lastValue=t}}}function Hu(a,e){const t=a.split("/");if(t.length){let r=!1;if(Pt.forEach(s=>{s.name==t[0]&&(s.insert(t,e),r=!0)}),!r){const s=new oa(t[0],[],0,"");Pt.push(s),s.insert(t,e)}}}const Ru=["openWB/counter/#","openWB/bat/#","openWB/pv/#","openWB/chargepoint/#","openWB/vehicle/#","openWB/general/chargemode_config/pv_charging/#","openWB/optional/et/#","openWB/system/#","openWB/LegacySmartHome/#","openWB/command/"+qt()+"/#"];function Ju(){mn(Yu),Ru.forEach(a=>{Xe(a)}),fe()}function Yu(a,e){Hu(a,e.toString());const t=e.toString();a.match(/^openwb\/counter\/[0-9]+\//i)?qu(a,t):a.match(/^openwb\/counter\//i)?Qu(a,t):a.match(/^openwb\/bat\//i)?Au(a,t):a.match(/^openwb\/pv\//i)?Zu(a,t):a.match(/^openwb\/chargepoint\//i)?zu(a,t):a.match(/^openwb\/vehicle\/template\//i)?Du(a,t):a.match(/^openwb\/vehicle\//i)?Wu(a,t):a.match(/^openwb\/general\/chargemode_config\/pv_charging\//i)?Xu(a,t):a.match(/^openwb\/graph\//i)?ku(a,t):a.match(/^openwb\/log\/daily\//i)?$u(a,t):a.match(/^openwb\/log\/monthly\//i)?Vu(a,t):a.match(/^openwb\/log\/yearly\//i)?Lu(a,t):a.match(/^openwb\/optional\/et\//i)?Eu(a,t):a.match(/^openwb\/system\//i)?ed(a,t):a.match(/^openwb\/LegacySmartHome\//i)?ju(a,t):a.match(/^openwb\/command\//i)&&td(a,t)}function qu(a,e){const t=a.split("/"),r=+t[2];if(r==de.evuId?Ku(a,e):t[3]=="config",t[3]=="get"&&r in ke)switch(t[4]){case"power":ke[r].power=+e;break;case"config":break;case"fault_str":break;case"fault_state":break;case"power_factors":break;case"imported":break;case"exported":break;case"frequency":break;case"daily_imported":ke[r].energy_imported=+e;break;case"daily_exported":ke[r].energy_exported=+e;break}}function Qu(a,e){if(a.match(/^openwb\/counter\/get\/hierarchy$/i)){const t=JSON.parse(e);if(t.length){_n(),is();for(const r of t)r.type=="counter"&&(de.evuId=r.id);ja(t[0])}}else a.match(/^openwb\/counter\/set\/home_consumption$/i)?U.house.power=+e:a.match(/^openwb\/counter\/set\/daily_yield_home_consumption$/i)&&(U.house.energy=+e)}function ja(a){switch(a.type){case"counter":au(a.id,a.type);break;case"cp":bn(a.id);break;case"bat":Aa(a.id);break}a.children.forEach(e=>ja(e))}function Zu(a,e){const t=ad(a);t&&!we.value.has(t)&&zn(t),a=="openWB/pv/get/power"?Q.pv.power=-e:a=="openWB/pv/get/daily_exported"?Q.pv.energy=+e:a.match(/^openWB\/pv\/[0-9]+\/get\/power$/i)?we.value.get(t).power=+e:a.match(/^openWB\/pv\/[0-9]+\/get\/daily_exported$/i)?we.value.get(t).energy=+e:a.match(/^openWB\/pv\/[0-9]+\/get\/monthly_exported$/i)?we.value.get(t).energy_month=+e:a.match(/^openWB\/pv\/[0-9]+\/get\/yearly_exported$/i)?we.value.get(t).energy_year=+e:a.match(/^openWB\/pv\/[0-9]+\/get\/exported$/i)&&(we.value.get(t).energy_total=+e)}function Xu(a,e){const t=a.split("/");if(t.length>0)switch(t[4]){case"bat_mode":de.updatePvBatteryPriority(JSON.parse(e));break}}function Ku(a,e){switch(a.split("/")[4]){case"power":+e>0?(Q.evuIn.power=+e,U.evuOut.power=0):(Q.evuIn.power=0,U.evuOut.power=-e);break;case"daily_imported":Q.evuIn.energy=+e;break;case"daily_exported":U.evuOut.energy=+e;break}}function ed(a,e){if(a.match(/^openWB\/system\/device\/[0-9]+\/component\/[0-9]+\/config$/i)){const t=JSON.parse(e);switch(t.type){case"counter":case"consumption_counter":ke[t.id]&&(ke[t.id].name=t.name);break;case"inverter":case"inverter_secondary":we.value.has(t.id)||we.value.set(t.id,new $a(t.id)),we.value.get(t.id).name=t.name;break;case"bat":he.value.has(t.id)||Aa(t.id),he.value.get(t.id).name=t.name}}}function td(a,e){const t=a.split("/");if(a.match(/^openWB\/command\/[a-z]+\/error$/i)&&t[2]==qt()){const r=JSON.parse(e);console.error(`Error message from openWB: Command: ${r.command} Data: JSON.stringify(err.data) diff --git a/packages/modules/web_themes/colors/web/index.html b/packages/modules/web_themes/colors/web/index.html index 69c4c345df..5ac7048b4b 100644 --- a/packages/modules/web_themes/colors/web/index.html +++ b/packages/modules/web_themes/colors/web/index.html @@ -24,7 +24,7 @@ openWB - + From 6decd61a04bd87e5be007f8b3ac6ce89fcb8f444 Mon Sep 17 00:00:00 2001 From: Claus Hagen Date: Sun, 2 Feb 2025 14:48:59 +0100 Subject: [PATCH 2/7] fix time display format --- .../web_themes/colors/source/src/assets/js/helpers.ts | 2 +- packages/modules/web_themes/colors/source/vite.config.ts | 3 +++ .../modules/web_themes/colors/web/assets/index-CaUGgs4L.js | 6 ++++++ .../modules/web_themes/colors/web/assets/index-dtFnGfh0.js | 6 ------ packages/modules/web_themes/colors/web/index.html | 2 +- 5 files changed, 11 insertions(+), 8 deletions(-) create mode 100644 packages/modules/web_themes/colors/web/assets/index-CaUGgs4L.js delete mode 100644 packages/modules/web_themes/colors/web/assets/index-dtFnGfh0.js diff --git a/packages/modules/web_themes/colors/source/src/assets/js/helpers.ts b/packages/modules/web_themes/colors/source/src/assets/js/helpers.ts index 920d0e48cb..43c9c965ac 100755 --- a/packages/modules/web_themes/colors/source/src/assets/js/helpers.ts +++ b/packages/modules/web_themes/colors/source/src/assets/js/helpers.ts @@ -81,7 +81,7 @@ export function formatTime(seconds: number) { } } export function formatCurrentTime(d: Date) { - return d.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' }) + return d.toLocaleTimeString(['de-DE'], { hour: '2-digit', minute: '2-digit' }) } export function formatDate(d: Date, mode: string = 'day') { diff --git a/packages/modules/web_themes/colors/source/vite.config.ts b/packages/modules/web_themes/colors/source/vite.config.ts index 3102bcba62..044fcf8f2a 100755 --- a/packages/modules/web_themes/colors/source/vite.config.ts +++ b/packages/modules/web_themes/colors/source/vite.config.ts @@ -7,6 +7,9 @@ import nodePolyfills from "rollup-plugin-polyfill-node"; // https://vitejs.dev/config/ export default defineConfig({ + server: { + allowedHosts: true, + }, plugins: [vue({ template: { compilerOptions: { diff --git a/packages/modules/web_themes/colors/web/assets/index-CaUGgs4L.js b/packages/modules/web_themes/colors/web/assets/index-CaUGgs4L.js new file mode 100644 index 0000000000..ca3365b8a6 --- /dev/null +++ b/packages/modules/web_themes/colors/web/assets/index-CaUGgs4L.js @@ -0,0 +1,6 @@ +var Ua=Object.defineProperty;var Fa=(a,e,t)=>e in a?Ua(a,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[e]=t;var b=(a,e,t)=>Fa(a,typeof e!="symbol"?e+"":e,t);import{r as le,m as Na,c as m,a as ee,i as Ha,e as Ve,u as Ft,t as et,b as xt,s as ce,d as L,p as wa,f as ka,w as Ra,o as l,g as f,h as S,j as n,n as q,k as $,l as w,q as pe,v as _,x as H,y as i,z as v,F,A as te,B as xa,C as He,D as ft,E as nt,G as rt,H as dt,I as ht,J as st,K as Ja,L as Ne,M as K,N as Ya,O as Le,P as vt,Q as qa,R as Qa,S as Sa,T as Za,U as Ma,V as Xa,W as Ka,X as en,Y as tn,Z as an,_ as nn,$ as rn,a0 as on,a1 as sn,a2 as ln}from"./vendor-CmSLe-Fc.js";(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const h of o.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&r(h)}).observe(document,{childList:!0,subtree:!0});function t(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(s){if(s.ep)return;s.ep=!0;const o=t(s);fetch(s.href,o)}})();var ve=(a=>(a.instant_charging="instant_charging",a.pv_charging="pv_charging",a.scheduled_charging="scheduled_charging",a.standby="standby",a.stop="stop",a))(ve||{});class $a{constructor(e){b(this,"id");b(this,"name","Wechselrichter");b(this,"color","var(--color-pv)");b(this,"power",0);b(this,"energy",0);b(this,"energy_month",0);b(this,"energy_year",0);b(this,"energy_total",0);this.id=e}}const cn=[["EV","ev_mode"],["Speicher","bat_mode"],["MinSoc","min_soc_bat_mode"]];class un{constructor(e){b(this,"id");b(this,"name","Gerät");b(this,"power",0);b(this,"status","off");b(this,"energy",0);b(this,"runningTime",0);b(this,"configured",!1);b(this,"_showInGraph",!0);b(this,"color","white");b(this,"canSwitch",!1);b(this,"countAsHouse",!1);b(this,"energyPv",0);b(this,"energyBat",0);b(this,"pvPercentage",0);b(this,"tempConfigured",0);b(this,"temp",[300,300,300]);b(this,"on",!1);b(this,"isAutomatic",!0);b(this,"icon","");this.id=e}get showInGraph(){return this._showInGraph}set showInGraph(e){this._showInGraph=e,T.items["sh"+this.id].showInGraph=e,ne()}setShowInGraph(e){this._showInGraph=e}}const ae=le(new Map);function Yt(a){ae.has(a)?console.info("Duplicate sh device message: "+a):(ae.set(a,new un(a)),ae.get(a).color="var(--color-sh"+ae.size+")")}const dn=0,Pa={host:location.hostname,port:location.protocol=="https:"?443:80,endpoint:"/ws",protocol:location.protocol=="https:"?"wss":"ws",connectTimeout:4e3,reconnectPeriod:4e3,clean:!1,clientId:Math.random().toString(36).replace(/[^a-z]+/g,"").substring(0,6)},St={topic:"",qos:dn};let Ce;const{host:hn,port:pn,endpoint:gn,...Ia}=Pa,sa=`${Ia.protocol}://${hn}:${pn}${gn}`;try{console.debug("connectURL",sa),Ce=Na.connect(sa,Ia),Ce.on("connect",()=>{console.info("MQTT connection successful")}),Ce.on("disconnect",()=>{console.info("MQTT disconnected")}),Ce.on("error",a=>{console.error("MQTT connection failed: ",a)})}catch(a){console.error("MQTT connect error: ",a)}function mn(a){Ce?Ce.on("message",a):console.error("MqttRegister: MQTT client not available")}function Xe(a){St.topic=a;const{topic:e,qos:t}=St;Ce.subscribe(e,{qos:t},r=>{if(r){console.error("MQTT Subscription error: "+r);return}})}function ot(a){St.topic=a;const{topic:e}=St;Ce.unsubscribe(e,t=>{if(t){console.error("MQTT Unsubscribe from "+a+" failed: "+t);return}})}async function Nt(a,e){let r=Ce.connected,s=0;for(;!r&&s<20;)console.warn("MQTT publish: Not connected. Waiting 0.1 seconds"),await fn(100),r=Ce.connected,s+=1;if(s<20)try{Ce.publish(a,e,{qos:0},o=>{o&&console.warn("MQTT publish error: ",o),console.info("MQTT publish: Message sent: ["+a+"]("+e+")")})}catch(o){console.warn("MQTT publish: caught error: "+o)}else console.error("MQTT publish: Lost connection to MQTT server. Please reload the page")}function qt(){return Pa.clientId}function fn(a){return new Promise(e=>setTimeout(e,a))}class vn{constructor(e){b(this,"id");b(this,"name","Ladepunkt");b(this,"icon","Ladepunkt");b(this,"type","");b(this,"ev",0);b(this,"template",0);b(this,"connectedPhases",0);b(this,"phase_1",0);b(this,"autoPhaseSwitchHw",!1);b(this,"controlPilotInterruptionHw",!1);b(this,"isEnabled",!0);b(this,"isPluggedIn",!1);b(this,"isCharging",!1);b(this,"_isLocked",!1);b(this,"_connectedVehicle",0);b(this,"chargeTemplate",0);b(this,"evTemplate",0);b(this,"_chargeMode",ve.pv_charging);b(this,"_hasPriority",!1);b(this,"currentPlan","");b(this,"averageConsumption",0);b(this,"vehicleName","");b(this,"rangeCharged",0);b(this,"rangeUnit","");b(this,"counter",0);b(this,"dailyYield",0);b(this,"energyPv",0);b(this,"energyBat",0);b(this,"pvPercentage",0);b(this,"faultState",0);b(this,"faultStr","");b(this,"phasesInUse",0);b(this,"power",0);b(this,"chargedSincePlugged",0);b(this,"stateStr","");b(this,"current",0);b(this,"currents",[0,0,0]);b(this,"phasesToUse",0);b(this,"isSocConfigured",!0);b(this,"isSocManual",!1);b(this,"waitingForSoc",!1);b(this,"color","white");b(this,"_timedCharging",!1);b(this,"_instantChargeLimitMode","");b(this,"_instantTargetCurrent",0);b(this,"_instantTargetSoc",0);b(this,"_instantMaxEnergy",0);b(this,"_pvFeedInLimit",!1);b(this,"_pvMinCurrent",0);b(this,"_pvMaxSoc",0);b(this,"_pvMinSoc",0);b(this,"_pvMinSocCurrent",0);b(this,"_etActive",!1);b(this,"_etMaxPrice",20);this.id=e}get isLocked(){return this._isLocked}set isLocked(e){this._isLocked=e,oe("cpLock",e,this.id)}updateIsLocked(e){this._isLocked=e}get connectedVehicle(){return this._connectedVehicle}set connectedVehicle(e){this._connectedVehicle=e,oe("cpVehicle",e,this.id)}updateConnectedVehicle(e){this._connectedVehicle=e}get soc(){return Y[this.connectedVehicle]?Y[this.connectedVehicle].soc:0}set soc(e){Y[this.connectedVehicle]&&(Y[this.connectedVehicle].soc=e)}get chargeMode(){return this._chargeMode}set chargeMode(e){this._chargeMode=e,oe("chargeMode",e,this.id)}updateChargeMode(e){this._chargeMode=e}get hasPriority(){return this._hasPriority}set hasPriority(e){this._hasPriority=e,oe("cpPriority",e,this.id)}updateCpPriority(e){this._hasPriority=e}get timedCharging(){return _e[this.chargeTemplate]?_e[this.chargeTemplate].time_charging.active:!1}set timedCharging(e){_e[this.chargeTemplate].time_charging.active=e,oe("cpTimedCharging",e,this.chargeTemplate)}get instantTargetCurrent(){return this._instantTargetCurrent}set instantTargetCurrent(e){this._instantTargetCurrent=e,oe("cpInstantTargetCurrent",e,this.id)}updateInstantTargetCurrent(e){this._instantTargetCurrent=e}get instantChargeLimitMode(){return this._instantChargeLimitMode}set instantChargeLimitMode(e){this._instantChargeLimitMode=e,oe("cpInstantChargeLimitMode",e,this.id)}updateInstantChargeLimitMode(e){this._instantChargeLimitMode=e}get instantTargetSoc(){return this._instantTargetSoc}set instantTargetSoc(e){this._instantTargetSoc=e,oe("cpInstantTargetSoc",e,this.id)}updateInstantTargetSoc(e){this._instantTargetSoc=e}get instantMaxEnergy(){return this._instantMaxEnergy}set instantMaxEnergy(e){this._instantMaxEnergy=e,oe("cpInstantMaxEnergy",e,this.id)}updateInstantMaxEnergy(e){this._instantMaxEnergy=e}get pvFeedInLimit(){return this._pvFeedInLimit}set pvFeedInLimit(e){this._pvFeedInLimit=e,oe("cpPvFeedInLimit",e,this.id)}updatePvFeedInLimit(e){this._pvFeedInLimit=e}get pvMinCurrent(){return this._pvMinCurrent}set pvMinCurrent(e){this._pvMinCurrent=e,oe("cpPvMinCurrent",e,this.id)}updatePvMinCurrent(e){this._pvMinCurrent=e}get pvMaxSoc(){return this._pvMaxSoc}set pvMaxSoc(e){this._pvMaxSoc=e,oe("cpPvMaxSoc",e,this.id)}updatePvMaxSoc(e){this._pvMaxSoc=e}get pvMinSoc(){return this._pvMinSoc}set pvMinSoc(e){this._pvMinSoc=e,oe("cpPvMinSoc",e,this.id)}updatePvMinSoc(e){this._pvMinSoc=e}get pvMinSocCurrent(){return this._pvMinSocCurrent}set pvMinSocCurrent(e){this._pvMinSocCurrent=e,oe("cpPvMinSocCurrent",e,this.id)}updatePvMinSocCurrent(e){this._pvMinSocCurrent=e}get realCurrent(){switch(this.phasesInUse){case 0:return 0;case 1:return this.currents[0];case 2:return(this.currents[0]+this.currents[1])/2;case 3:return(this.currents[0]+this.currents[1]+this.currents[2])/3;default:return 0}}get etActive(){return Y[this.connectedVehicle]?Y[this.connectedVehicle].etActive:!1}set etActive(e){Y[this.connectedVehicle]&&(Y[this.connectedVehicle].etActive=e)}get etMaxPrice(){return Y[this.connectedVehicle].etMaxPrice??0}set etMaxPrice(e){oe("cpEtMaxPrice",Math.round(e*10)/1e6,this.id)}toPowerItem(){return{name:this.name,power:this.power,energy:this.dailyYield,energyPv:this.energyPv,energyBat:this.energyBat,pvPercentage:this.pvPercentage,color:this.color,icon:this.icon,showInGraph:!0}}}class yn{constructor(e){b(this,"id");b(this,"name","__invalid");b(this,"tags",[]);b(this,"config",{});b(this,"soc",0);b(this,"range",0);b(this,"_chargeTemplateId",0);b(this,"_evTemplateId",0);this.id=e}get chargeTemplateId(){return this._chargeTemplateId}set chargeTemplateId(e){this._chargeTemplateId=e,oe("vhChargeTemplateId",e,this.id)}updateChargeTemplateId(e){this._chargeTemplateId=e}get evTemplateId(){return this._evTemplateId}set evTemplateId(e){this._evTemplateId=e,oe("vhEvTemplateId",e,this.id)}updateEvTemplateId(e){this._evTemplateId=e}get etActive(){return _e[this.chargeTemplateId]?_e[this.chargeTemplateId].et.active:!1}set etActive(e){_e[this.chargeTemplateId]&&oe("priceCharging",e,this.chargeTemplateId)}get etMaxPrice(){if(_e[this.chargeTemplateId]&&_e[this.chargeTemplateId].et.active)return _e[this.chargeTemplateId].et.max_price*1e5}get chargepoint(){for(const e of Object.values(O))if(e.connectedVehicle==this.id)return e}get visible(){return this.name!="__invalid"&&(this.id!=0||g.showStandardVehicle)}}const O=le({}),Y=le({}),_e=le({}),pt=le({}),gt=le({}),Ht=le({});function bn(a){if(!(a in O)){O[a]=new vn(a);const e="var(--color-cp"+(Object.values(O).length-1)+")";O[a].color=e;const t="cp"+a;ie[t]?ie["cp"+a].color=e:ie[t]={name:"Ladepunkt",color:e,icon:"Ladepunkt"}}}function _n(){Object.keys(O).forEach(a=>{delete O[parseInt(a)]})}const me=m(()=>{const a=[],e=Object.values(O),t=Object.values(Y).filter(o=>o.visible);let r=-1;switch(e.length){case 0:r=t[0]?t[0].id:-1;break;default:r=e[0].connectedVehicle}let s=-1;switch(e.length){case 0:case 1:s=t[0]?t[0].id:-1;break;default:s=e[1].connectedVehicle}return r==s&&(s=t[1]?t[1].id:-1),r!=-1&&a.push(r),s!=-1&&a.push(s),a}),wn={cpLock:"openWB/set/chargepoint/%/set/manual_lock",chargeMode:"openWB/set/vehicle/template/charge_template/%/chargemode/selected",cpPriority:"openWB/set/vehicle/template/charge_template/%/prio",cpTimedCharging:"openWB/set/vehicle/template/charge_template/%/time_charging/active",pvBatteryPriority:"openWB/set/general/chargemode_config/pv_charging/bat_mode",cpVehicle:"openWB/set/chargepoint/%/config/ev",cpInstantChargeLimitMode:"openWB/set/vehicle/template/charge_template/%/chargemode/instant_charging/limit/selected",cpInstantTargetCurrent:"openWB/set/vehicle/template/charge_template/%/chargemode/instant_charging/current",cpInstantTargetSoc:"openWB/set/vehicle/template/charge_template/%/chargemode/instant_charging/limit/soc",cpInstantMaxEnergy:"openWB/set/vehicle/template/charge_template/%/chargemode/instant_charging/limit/amount",cpPvFeedInLimit:"openWB/set/vehicle/template/charge_template/%/chargemode/pv_charging/feed_in_limit",cpPvMinCurrent:"openWB/set/vehicle/template/charge_template/%/chargemode/pv_charging/min_current",cpPvMaxSoc:"openWB/set/vehicle/template/charge_template/%/chargemode/pv_charging/max_soc",cpPvMinSoc:"openWB/set/vehicle/template/charge_template/%/chargemode/pv_charging/min_soc",cpPvMinSocCurrent:"openWB/set/vehicle/template/charge_template/%/chargemode/pv_charging/min_soc_current",cpEtMaxPrice:"openWB/set/vehicle/template/charge_template/%/et/max_price",vhChargeTemplateId:"openWB/set/vehicle/%/charge_template",vhEvTemplateId:"openWB/set/vehicle/%/ev_template",shSetManual:"openWB/set/LegacySmartHome/config/set/Devices/%/mode",shSwitchOn:"openWB/set/LegacySmartHome/config/set/Devices/%/device_manual_control",socUpdate:"openWB/set/vehicle/%/get/force_soc_update",setSoc:"openWB/set/vehicle/%/soc_module/calculated_soc_state/manual_soc",priceCharging:"openWB/set/vehicle/template/charge_template/%/et/active"};function oe(a,e,t=0){if(isNaN(t)){console.warn("Invalid index");return}let r=wn[a];if(!r){console.warn("No topic for update type "+a);return}switch(a){case"chargeMode":case"cpPriority":case"cpScheduledCharging":case"cpInstantTargetCurrent":case"cpInstantChargeLimitMode":case"cpInstantTargetSoc":case"cpInstantMaxEnergy":case"cpPvFeedInLimit":case"cpPvMinCurrent":case"cpPvMaxSoc":case"cpPvMinSoc":case"cpEtMaxPrice":case"cpPvMinSocCurrent":r=r.replace("%",O[t].chargeTemplate.toString());break;default:r=r.replace("%",String(t))}switch(typeof e){case"number":Nt(r,JSON.stringify(+e));break;default:Nt(r,JSON.stringify(e))}}function Qt(a){Nt("openWB/set/command/"+qt()+"/todo",JSON.stringify(a))}const be=500,Se=500,j={top:15,right:20,bottom:10,left:25},Zt=["charging","house","batIn","devices"];class kn{constructor(){b(this,"data",[]);b(this,"_graphMode","");b(this,"waitForData",!0)}get graphMode(){return this._graphMode}set graphMode(e){this._graphMode=e}}const y=le(new kn),Ca=ee(Ha),Ye=m(()=>[0,be-j.left-2*j.right].map(a=>Ca.value.applyX(a)));let mt=!0,it=!0;function ia(){mt=!1}function la(){mt=!0}function ca(){it=!1}function ua(){it=!0}function xn(a){it=a}function yt(a){y.data=a,y.waitForData=!1}const ge=le({refreshTopicPrefix:"openWB/graph/alllivevaluesJson",updateTopic:"openWB/graph/lastlivevaluesJson",configTopic:"openWB/graph/config/#",initialized:!1,initCounter:0,graphRefreshCounter:0,rawDataPacks:[],duration:0,activate(a){this.unsubscribeUpdates(),this.subscribeRefresh(),a&&(y.data=[]),y.waitForData=!0,Xe(this.configTopic),this.initialized=!1,this.initCounter=0,this.graphRefreshCounter=0,this.rawDataPacks=[],In(),lt.value=!0},deactivate(){this.unsubscribeRefresh(),this.unsubscribeUpdates(),ot(this.configTopic)},subscribeRefresh(){for(let a=1;a<17;a++)Xe(this.refreshTopicPrefix+a)},unsubscribeRefresh(){for(let a=1;a<17;a++)ot(this.refreshTopicPrefix+a)},subscribeUpdates(){Xe(this.updateTopic)},unsubscribeUpdates(){ot(this.updateTopic)}}),ue=le({topic:"openWB/log/daily/#",date:new Date,activate(a){if(y.graphMode=="day"||y.graphMode=="today"){y.graphMode=="today"&&(this.date=new Date);const e=this.date.getFullYear().toString()+(this.date.getMonth()+1).toString().padStart(2,"0")+this.date.getDate().toString().padStart(2,"0");this.topic="openWB/log/daily/"+e,Xe(this.topic),a&&(y.data=[]),y.waitForData=!0,Qt({command:"getDailyLog",data:{day:e}})}},deactivate(){ot(this.topic)},back(){this.date=new Date(this.date.setTime(this.date.getTime()-864e5))},forward(){this.date=new Date(this.date.setTime(this.date.getTime()+864e5))},setDate(a){this.date=a},getDate(){return this.date}}),Ee=le({topic:"openWB/log/monthly/#",month:new Date().getMonth()+1,year:new Date().getFullYear(),activate(a){const e=this.year.toString()+this.month.toString().padStart(2,"0");y.data=[],Xe(this.topic),a&&(y.data=[]),y.waitForData=!0,Qt({command:"getMonthlyLog",data:{month:e}})},deactivate(){ot(this.topic)},back(){this.month-=1,this.month<1&&(this.month=12,this.year-=1),this.activate()},forward(){const a=new Date;a.getFullYear()==this.year?this.month-112&&(this.month=1,this.year+=1)),this.activate()},getDate(){return new Date(this.year,this.month)}}),Re=le({topic:"openWB/log/yearly/#",month:new Date().getMonth()+1,year:new Date().getFullYear(),activate(a){const e=this.year.toString();Xe(this.topic),a&&(y.data=[]),y.waitForData=!0,Qt({command:"getYearlyLog",data:{year:e}})},deactivate(){ot(this.topic)},back(){this.year-=1,this.activate()},forward(){this.year0&&(T.items[a].energyPv+=1e3/12*(e[a]*(e.pv-e.evuOut))/(e.pv-e.evuOut+e.evuIn+e.batOut),T.items[a].energyBat+=1e3/12*(e[a]*e.batOut)/(e.pv-e.evuOut+e.evuIn+e.batOut))}function $n(a,e){e[a]>0&&(T.items[a].energyPv+=1e3*(e[a]*(e.pv-e.evuOut))/(e.pv-e.evuOut+e.evuIn+e.batOut),T.items[a].energyBat+=1e3*(e[a]*e.batOut)/(e.pv-e.evuOut+e.evuIn+e.batOut))}const Pn=["evuIn","pv","batOut","evuOut"],qe=ee(!1);function Xt(a,e){Object.entries(a).length>0?(qe.value=!1,Object.entries(a.counter).forEach(([t,r])=>{(e.length==0||e.includes(t))&&(T.items.evuIn.energy+=r.energy_imported,T.items.evuOut.energy+=r.energy_exported)}),T.items.pv.energy=a.pv.all.energy_exported,a.bat.all&&(T.items.batIn.energy=a.bat.all.energy_imported,T.items.batOut.energy=a.bat.all.energy_exported),Object.entries(a.cp).forEach(([t,r])=>{t=="all"?(T.setEnergy("charging",r.energy_imported),r.energy_imported_pv!=null&&(T.setEnergyPv("charging",r.energy_imported_pv),T.setEnergyBat("charging",r.energy_imported_bat))):T.setEnergy(t,r.energy_imported)}),T.setEnergy("devices",0),Object.entries(a.sh).forEach(([t,r])=>{T.setEnergy(t,r.energy_imported);const s=t.substring(2);ae.get(+s).countAsHouse||(T.items.devices.energy+=r.energy_imported)}),a.hc&&a.hc.all?(T.setEnergy("house",a.hc.all.energy_imported),a.hc.all.energy_imported_pv!=null&&(T.setEnergyPv("house",a.hc.all.energy_imported_pv),T.setEnergyBat("house",a.hc.all.energy_imported_bat))):T.calculateHouseEnergy(),T.keys().forEach(t=>{Pn.includes(t)||(T.setPvPercentage(t,Math.round((T.items[t].energyPv+T.items[t].energyBat)/T.items[t].energy*100)),Zt.includes(t)&&(U[t].energy=T.items[t].energy,U[t].energyPv=T.items[t].energyPv,U[t].energyBat=T.items[t].energyBat,U[t].pvPercentage=T.items[t].pvPercentage))}),y.graphMode=="today"&&(Object.values(O).forEach(t=>{const r=T.items["cp"+t.id];r&&(t.energyPv=r.energyPv,t.energyBat=r.energyBat,t.pvPercentage=r.pvPercentage)}),ae.forEach(t=>{const r=T.items["sh"+t.id];r&&(t.energy=r.energy,t.energyPv=r.energyPv,t.energyBat=r.energyBat,t.pvPercentage=r.pvPercentage)}))):qe.value=!0,lt.value=!0}const Be=m(()=>{const a=Ve(y.data,e=>new Date(e.date));return a[0]&&a[1]?Ft().domain(a).range([0,be-j.left-2*j.right]):et().range([0,0])});function In(){T.keys().forEach(a=>{Zt.includes(a)&&(U[a].energy=T.items[a].energy,U[a].energyPv=0,U[a].energyBat=0,U[a].pvPercentage=0)}),Object.values(O).forEach(a=>{a.energyPv=0,a.energyBat=0,a.pvPercentage=0}),ae.forEach(a=>{a.energyPv=0,a.energyBat=0,a.pvPercentage=0})}const Je=m(()=>{const a=Ve(y.data,e=>e.date);return a[1]?xt().domain(Array.from({length:a[1]},(e,t)=>t+1)).paddingInner(.4).range([0,be-j.left-2]):xt().range([0,0])});function It(){switch(y.graphMode){case"live":y.graphMode="today",g.showRightButton=!0,fe();break;case"today":y.graphMode="day",ue.deactivate(),ue.back(),ue.activate(),fe();break;case"day":ue.back(),fe();break;case"month":Ee.back();break;case"year":Re.back();break}}function Kt(){const a=new Date;switch(y.graphMode){case"live":break;case"today":y.graphMode="live",g.showRightButton=!1,fe();break;case"day":ue.forward(),ue.date.getDate()==a.getDate()&&ue.date.getMonth()==a.getMonth()&&ue.date.getFullYear()==a.getFullYear()&&(y.graphMode="today"),fe();break;case"month":Ee.forward();break;case"year":Re.forward();break}}function ea(){switch(y.graphMode){case"live":It();break;case"day":case"today":y.graphMode="month",fe();break;case"month":y.graphMode="year",fe();break}}function ta(){switch(y.graphMode){case"year":y.graphMode="month",fe();break;case"month":y.graphMode="today",fe();break;case"today":case"day":y.graphMode="live",fe();break}}function da(a){if(y.graphMode=="day"||y.graphMode=="today"){ue.setDate(a);const e=new Date;ue.date.getDate()==e.getDate()&&ue.date.getMonth()==e.getMonth()&&ue.date.getFullYear()==e.getFullYear()?y.graphMode="today":y.graphMode="day",fe()}}const Fe=ee(new Map);class Cn{constructor(){b(this,"_showRelativeArcs",!1);b(this,"showTodayGraph",!0);b(this,"_graphPreference","today");b(this,"_usageStackOrder",0);b(this,"_displayMode","dark");b(this,"_showGrid",!1);b(this,"_smartHomeColors","normal");b(this,"_decimalPlaces",1);b(this,"_showQuickAccess",!0);b(this,"_simpleCpList",!1);b(this,"_shortCpList","no");b(this,"_showAnimations",!0);b(this,"_preferWideBoxes",!1);b(this,"_maxPower",4e3);b(this,"_fluidDisplay",!1);b(this,"_showClock","no");b(this,"_showButtonBar",!0);b(this,"_showCounters",!1);b(this,"_showVehicles",!1);b(this,"_showStandardVehicle",!0);b(this,"_showPrices",!1);b(this,"_showInverters",!1);b(this,"_alternativeEnergy",!1);b(this,"_sslPrefs",!1);b(this,"_debug",!1);b(this,"_lowerPriceBound",0);b(this,"_upperPriceBound",0);b(this,"isEtEnabled",!1);b(this,"etPrice",20.5);b(this,"showRightButton",!0);b(this,"showLeftButton",!0);b(this,"animationDuration",300);b(this,"animationDelay",100);b(this,"zoomGraph",!1);b(this,"zoomedWidget",1)}get showRelativeArcs(){return this._showRelativeArcs}set showRelativeArcs(e){this._showRelativeArcs=e,ne()}setShowRelativeArcs(e){this._showRelativeArcs=e}get graphPreference(){return this._graphPreference}set graphPreference(e){this._graphPreference=e,ne()}setGraphPreference(e){this._graphPreference=e}get usageStackOrder(){return this._usageStackOrder}set usageStackOrder(e){this._usageStackOrder=e,ne()}setUsageStackOrder(e){this._usageStackOrder=e}get displayMode(){return this._displayMode}set displayMode(e){this._displayMode=e,On(e)}setDisplayMode(e){this._displayMode=e}get showGrid(){return this._showGrid}set showGrid(e){this._showGrid=e,ne()}setShowGrid(e){this._showGrid=e}get decimalPlaces(){return this._decimalPlaces}set decimalPlaces(e){this._decimalPlaces=e,ne()}setDecimalPlaces(e){this._decimalPlaces=e}get smartHomeColors(){return this._smartHomeColors}set smartHomeColors(e){this._smartHomeColors=e,ha(e),ne()}setSmartHomeColors(e){this._smartHomeColors=e,ha(e)}get showQuickAccess(){return this._showQuickAccess}set showQuickAccess(e){this._showQuickAccess=e,ne()}setShowQuickAccess(e){this._showQuickAccess=e}get simpleCpList(){return this._simpleCpList}set simpleCpList(e){this._simpleCpList=e,ne()}setSimpleCpList(e){this._simpleCpList=e}get shortCpList(){return this._shortCpList}set shortCpList(e){this._shortCpList=e,ne()}setShortCpList(e){this._shortCpList=e}get showAnimations(){return this._showAnimations}set showAnimations(e){this._showAnimations=e,ne()}setShowAnimations(e){this._showAnimations=e}get preferWideBoxes(){return this._preferWideBoxes}set preferWideBoxes(e){this._preferWideBoxes=e,ne()}setPreferWideBoxes(e){this._preferWideBoxes=e}get maxPower(){return this._maxPower}set maxPower(e){this._maxPower=e,ne()}setMaxPower(e){this._maxPower=e}get fluidDisplay(){return this._fluidDisplay}set fluidDisplay(e){this._fluidDisplay=e,ne()}setFluidDisplay(e){this._fluidDisplay=e}get showClock(){return this._showClock}set showClock(e){this._showClock=e,ne()}setShowClock(e){this._showClock=e}get sslPrefs(){return this._sslPrefs}set sslPrefs(e){this._sslPrefs=e,ne()}setSslPrefs(e){this.sslPrefs=e}get debug(){return this._debug}set debug(e){this._debug=e,ne()}setDebug(e){this._debug=e}get showButtonBar(){return this._showButtonBar}set showButtonBar(e){this._showButtonBar=e,ne()}setShowButtonBar(e){this._showButtonBar=e}get showCounters(){return this._showCounters}set showCounters(e){this._showCounters=e,ne()}setShowCounters(e){this._showCounters=e}get showVehicles(){return this._showVehicles}set showVehicles(e){this._showVehicles=e,ne()}setShowVehicles(e){this._showVehicles=e}get showStandardVehicle(){return this._showStandardVehicle}set showStandardVehicle(e){this._showStandardVehicle=e,ne()}setShowStandardVehicle(e){this._showStandardVehicle=e}get showPrices(){return this._showPrices}set showPrices(e){this._showPrices=e,ne()}setShowPrices(e){this._showPrices=e}get showInverters(){return this._showInverters}set showInverters(e){this._showInverters=e,la(),ua(),ne()}setShowInverters(e){this._showInverters=e}get alternativeEnergy(){return this._alternativeEnergy}set alternativeEnergy(e){this._alternativeEnergy=e,la(),ua(),ne()}setAlternativeEnergy(e){this._alternativeEnergy=e}get lowerPriceBound(){return this._lowerPriceBound}set lowerPriceBound(e){this._lowerPriceBound=e,ne()}setLowerPriceBound(e){this._lowerPriceBound=e}get upperPriceBound(){return this._upperPriceBound}set upperPriceBound(e){this._upperPriceBound=e,ne()}setUpperPriceBound(e){this._upperPriceBound=e}}const g=le(new Cn);function Ba(){En();const a=ce("html");a.classed("theme-dark",g.displayMode=="dark"),a.classed("theme-light",g.displayMode=="light"),a.classed("theme-blue",g.displayMode=="blue"),a.classed("shcolors-standard",g.smartHomeColors=="standard"),a.classed("shcolors-advanced",g.smartHomeColors=="advanced"),a.classed("shcolors-normal",g.smartHomeColors=="normal")}const Bn=992,Mt=le({x:document.documentElement.clientWidth,y:document.documentElement.clientHeight});function Vn(){Mt.x=document.documentElement.clientWidth,Mt.y=document.documentElement.clientHeight,Ba()}const De=m(()=>Mt.x>=Bn),ye={instant_charging:{mode:ve.instant_charging,name:"Sofort",color:"var(--color-charging)",icon:"fa-bolt"},pv_charging:{mode:ve.pv_charging,name:"PV",color:"var(--color-pv",icon:"fa-solar-panel"},scheduled_charging:{mode:ve.scheduled_charging,name:"Zielladen",color:"var(--color-battery)",icon:"fa-bullseye"},standby:{mode:ve.standby,name:"Standby",color:"var(--color-axis",icon:"fa-pause"},stop:{mode:ve.stop,name:"Stop",color:"var(--color-fg)",icon:"fa-power-off"}};class Ln{constructor(){b(this,"batterySoc",0);b(this,"isBatteryConfigured",!0);b(this,"chargeMode","0");b(this,"_pvBatteryPriority","ev_mode");b(this,"displayLiveGraph",!0);b(this,"isEtEnabled",!0);b(this,"etMaxPrice",0);b(this,"etCurrentPrice",0);b(this,"cpDailyExported",0);b(this,"evuId",0);b(this,"etProvider","")}get pvBatteryPriority(){return this._pvBatteryPriority}set pvBatteryPriority(e){this._pvBatteryPriority=e,oe("pvBatteryPriority",e)}updatePvBatteryPriority(e){this._pvBatteryPriority=e}}function ne(){Tn()}function On(a){const e=ce("html");e.classed("theme-dark",a=="dark"),e.classed("theme-light",a=="light"),e.classed("theme-blue",a=="blue"),ne()}function An(){g.maxPower=Q.evuIn.power+Q.pv.power+Q.batOut.power,ne()}function ha(a){const e=ce("html");e.classed("shcolors-normal",a=="normal"),e.classed("shcolors-standard",a=="standard"),e.classed("shcolors-advanced",a=="advanced")}const Te={chargemode:"Der Lademodus für das Fahrzeug an diesem Ladepunkt",vehicle:"Das Fahrzeug, das an diesem Ladepounkt geladen wird",locked:"Für das Laden sperren",priority:"Fahrzeuge mit Priorität werden bevorzugt mit mehr Leistung geladen, falls verfügbar",timeplan:"Das Laden nach Zeitplan für dieses Fahrzeug aktivieren",minsoc:"Immer mindestens bis zum eingestellten Ladestand laden. Wenn notwendig mit Netzstrom.",minpv:"Durchgehend mit mindestens dem eingestellten Strom laden. Wenn notwendig mit Netzstrom.",pricebased:"Laden bei dynamischem Stromtarif, wenn eingestellter Maximalpreis unterboten wird.",pvpriority:"Ladepriorität bei PV-Produktion. Bevorzung von Fahzeugen, Speicher, oder Fahrzeugen bis zum eingestellten Mindest-Ladestand. Die Einstellung ist für alle Ladepunkte gleich."};function Tn(){const a={};a.hideSH=[...ae.values()].filter(e=>!e.showInGraph).map(e=>e.id),a.showLG=g.graphPreference=="live",a.displayM=g.displayMode,a.stackO=g.usageStackOrder,a.showGr=g.showGrid,a.decimalP=g.decimalPlaces,a.smartHomeC=g.smartHomeColors,a.relPM=g.showRelativeArcs,a.maxPow=g.maxPower,a.showQA=g.showQuickAccess,a.simpleCP=g.simpleCpList,a.shortCP=g.shortCpList,a.animation=g.showAnimations,a.wideB=g.preferWideBoxes,a.fluidD=g.fluidDisplay,a.clock=g.showClock,a.showButtonBar=g.showButtonBar,a.showCounters=g.showCounters,a.showVehicles=g.showVehicles,a.showStandardV=g.showStandardVehicle,a.showPrices=g.showPrices,a.showInv=g.showInverters,a.altEngy=g.alternativeEnergy,a.lowerP=g.lowerPriceBound,a.upperP=g.upperPriceBound,a.sslPrefs=g.sslPrefs,a.debug=g.debug,document.cookie="openWBColorTheme="+JSON.stringify(a)+";max-age=16000000;"+(g.sslPrefs?"SameSite=None;Secure":"SameSite=Strict")}function En(){const e=document.cookie.split(";").filter(t=>t.split("=")[0]==="openWBColorTheme");if(e.length>0){const t=JSON.parse(e[0].split("=")[1]);t.decimalP!==void 0&&g.setDecimalPlaces(+t.decimalP),t.smartHomeC!==void 0&&g.setSmartHomeColors(t.smartHomeC),t.hideSH!==void 0&&t.hideSH.forEach(r=>{ae.get(r)==null&&Yt(r),ae.get(r).setShowInGraph(!1)}),t.showLG!==void 0&&g.setGraphPreference(t.showLG?"live":"today"),t.maxPow!==void 0&&g.setMaxPower(+t.maxPow),t.relPM!==void 0&&g.setShowRelativeArcs(t.relPM),t.displayM!==void 0&&g.setDisplayMode(t.displayM),t.stackO!==void 0&&g.setUsageStackOrder(t.stackO),t.showGr!==void 0&&g.setShowGrid(t.showGr),t.showQA!==void 0&&g.setShowQuickAccess(t.showQA),t.simpleCP!==void 0&&g.setSimpleCpList(t.simpleCP),t.shortCP!==void 0&&g.setShortCpList(t.shortCP),t.animation!=null&&g.setShowAnimations(t.animation),t.wideB!=null&&g.setPreferWideBoxes(t.wideB),t.fluidD!=null&&g.setFluidDisplay(t.fluidD),t.clock!=null&&g.setShowClock(t.clock),t.showButtonBar!==void 0&&g.setShowButtonBar(t.showButtonBar),t.showCounters!==void 0&&g.setShowCounters(t.showCounters),t.showVehicles!==void 0&&g.setShowVehicles(t.showVehicles),t.showStandardV!==void 0&&g.setShowStandardVehicle(t.showStandardV),t.showPrices!==void 0&&g.setShowPrices(t.showPrices),t.showInv!==void 0&&g.setShowInverters(t.showInv),t.altEngy!==void 0&&g.setAlternativeEnergy(t.altEngy),t.lowerP!==void 0&&g.setLowerPriceBound(t.lowerP),t.upperP!==void 0&&g.setUpperPriceBound(t.upperP),t.sslPrefs!==void 0&&g.setSslPrefs(t.sslPrefs),t.debug!==void 0&&g.setDebug(t.debug)}}const ie=le({evuIn:{name:"Netz",color:"var(--color-evu)",icon:""},pv:{name:"PV",color:"var(--color-pv",icon:""},batOut:{name:"Bat >",color:"var(--color-battery)",icon:""},evuOut:{name:"Export",color:"var(--color-export)",icon:""},charging:{name:"Laden",color:"var(--color-charging)",icon:""},devices:{name:"Geräte",color:"var(--color-devices)",icon:""},batIn:{name:"> Bat",color:"var(--color-battery)",icon:""},house:{name:"Haus",color:"var(--color-house)",icon:""},cp1:{name:"Ladepunkt",color:"var(--color-cp1)",icon:"Ladepunkt"},cp2:{name:"Ladepunkt",color:"var(--color-cp2)",icon:"Ladepunkt"},cp3:{name:"Ladepunkt",color:"var(--color-cp3)",icon:"Ladepunkt"},cp4:{name:"Ladepunkt",color:"var(--color-cp4)",icon:"Ladepunkt"},cp5:{name:"Ladepunkt",color:"var(--color-cp5)",icon:"Ladepunkt"},cp6:{name:"Ladepunkt",color:"var(--color-cp6)",icon:"Ladepunkt"},cp7:{name:"Ladepunkt",color:"var(--color-cp7)",icon:"Ladepunkt"},cp8:{name:"Ladepunkt",color:"var(--color-cp8)",icon:"Ladepunkt"},sh1:{name:"Gerät",color:"var(--color-sh1)",icon:"Gerät"},sh2:{name:"Gerät",color:"var(--color-sh2)",icon:"Gerät"},sh3:{name:"Gerät",color:"var(--color-sh3)",icon:"Gerät"},sh4:{name:"Gerät",color:"var(--color-sh4)",icon:"Gerät"},sh5:{name:"Gerät",color:"var(--color-sh5)",icon:"Gerät"},sh6:{name:"Gerät",color:"var(--color-sh6)",icon:"Gerät"},sh7:{name:"Gerät",color:"var(--color-sh7)",icon:"Gerät"},sh8:{name:"Gerät",color:"var(--color-sh8)",icon:"Gerät"},sh9:{name:"Gerät",color:"var(--color-sh9)",icon:"Gerät"},pv1:{name:"PV",color:"var(--color-pv1)",icon:"Wechselrichter"},pv2:{name:"PV",color:"var(--color-pv2)",icon:"Wechselrichter"},pv3:{name:"PV",color:"var(--color-pv3)",icon:"Wechselrichter"},pv4:{name:"PV",color:"var(--color-pv4)",icon:"Wechselrichter"},pv5:{name:"PV",color:"var(--color-pv5)",icon:"Wechselrichter"},pv6:{name:"PV",color:"var(--color-pv6)",icon:"Wechselrichter"},pv7:{name:"PV",color:"var(--color-pv7)",icon:"Wechselrichter"},pv8:{name:"PV",color:"var(--color-pv8)",icon:"Wechselrichter"},pv9:{name:"PV",color:"var(--color-pv9)",icon:"Wechselrichter"},bat1:{name:"Speicher",color:"var(--color-battery)",icon:"Speicher"},bat2:{name:"Speicher",color:"var(--color-battery)",icon:"Speicher"},bat3:{name:"Speicher",color:"var(--color-battery)",icon:"Speicher"},bat4:{name:"Speicher",color:"var(--color-battery)",icon:"Speicher"},bat5:{name:"Speicher",color:"var(--color-battery)",icon:"Speicher"},bat6:{name:"Speicher",color:"var(--color-battery)",icon:"Speicher"},bat7:{name:"Speicher",color:"var(--color-battery)",icon:"Speicher"},bat8:{name:"Speicher",color:"var(--color-battery)",icon:"Speicher"},bat9:{name:"Speicher",color:"var(--color-battery)",icon:"Speicher"}});class Va{constructor(){b(this,"_items",{});this.addItem("evuIn"),this.addItem("pv"),this.addItem("batOut"),this.addItem("evuOut"),this.addItem("charging"),this.addItem("devices"),this.addItem("batIn"),this.addItem("house")}get items(){return this._items}keys(){return Object.keys(this._items)}values(){return Object.values(this._items)}addItem(e,t){this._items[e]=t?ze(e,t):ze(e)}setEnergy(e,t){this.keys().includes(e)||this.addItem(e),this._items[e].energy=t}setEnergyPv(e,t){this.keys().includes(e)||this.addItem(e),this._items[e].energyPv=t}setEnergyBat(e,t){this.keys().includes(e)||this.addItem(e),this._items[e].energyBat=t}setPvPercentage(e,t){this.keys().includes(e)||this.addItem(e),this._items[e].pvPercentage=t<=100?t:100}calculateHouseEnergy(){this._items.house.energy=this._items.evuIn.energy+this._items.pv.energy+this._items.batOut.energy-this._items.evuOut.energy-this._items.batIn.energy-this._items.charging.energy-this._items.devices.energy}}let T=le(new Va);function aa(){T=new Va}const Q=le({evuIn:ze("evuIn"),pv:ze("pv"),batOut:ze("batOut")}),U=le({evuOut:ze("evuOut"),charging:ze("charging"),devices:ze("devices"),batIn:ze("batIn"),house:ze("house")}),de=le(new Ln);ee("");const lt=ee(!1);function ze(a,e){return{name:ie[a]?ie[a].name:"item",power:0,energy:0,energyPv:0,energyBat:0,pvPercentage:0,color:e||(ie[a]?ie[a].color:"var(--color-charging)"),icon:ie[a]?ie[a].icon:"",showInGraph:!0}}const Rt=ee(new Date),we=ee(new Map),zn=a=>{we.value.set(a,new $a(a)),we.value.get(a).color=ie["pv"+we.value.size].color},Wn=["origin"],Dn=L({__name:"PMSourceArc",props:{radius:{},cornerRadius:{},circleGapSize:{},emptyPower:{}},setup(a){const e=a,t=m(()=>{let r={name:"",power:e.emptyPower,energy:0,energyPv:0,energyBat:0,pvPercentage:0,color:"var(--color-bg)",icon:"",showInGraph:!0},s=Q;s["zz-empty"]=r;const o=Object.values(Q).length-1,h=wa().value(p=>p.power).startAngle(-Math.PI/2+e.circleGapSize).endAngle(Math.PI/2-e.circleGapSize).sort(null),d=ka().innerRadius(e.radius/6*5).outerRadius(e.radius).cornerRadius(e.cornerRadius).padAngle(0),u=ce("g#pmSourceArc");return u.selectAll("*").remove(),u.selectAll("sources").data(h(Object.values(s))).enter().append("path").attr("d",d).attr("fill",p=>p.data.color).attr("stroke",(p,c)=>c==o?p.data.power>0?"var(--color-scale)":"null":p.data.color),"pmSourceArc.vue"});return Ra(()=>{let r=Q.pv.power+Q.evuIn.power+Q.batOut.power;r>g.maxPower&&(g.maxPower=r)}),(r,s)=>(l(),f("g",{id:"pmSourceArc",origin:t.value},null,8,Wn))}}),Gn=["origin"],jn=L({__name:"PMUsageArc",props:{radius:{},cornerRadius:{},circleGapSize:{},emptyPower:{}},setup(a){const e=a,t=m(()=>{let r={name:"",power:e.emptyPower,energy:0,energyPv:0,energyBat:0,pvPercentage:0,color:"var(--color-bg)",icon:"",showInGraph:!0};const s=[U.evuOut,U.charging].concat([...ae.values()].filter(p=>p.configured&&!p.countAsHouse).sort((p,c)=>c.power-p.power)).concat([U.batIn,U.house]).concat(r),o=s.length-1,h=wa().value(p=>p.power).startAngle(Math.PI*1.5-e.circleGapSize).endAngle(Math.PI/2+e.circleGapSize).sort(null),d=ka().innerRadius(e.radius/6*5).outerRadius(e.radius).cornerRadius(e.cornerRadius),u=ce("g#pmUsageArc");return u.selectAll("*").remove(),u.selectAll("consumers").data(h(s)).enter().append("path").attr("d",d).attr("fill",p=>p.data.color).attr("stroke",(p,c)=>c==o?p.data.power>0?"var(--color-scale)":"null":p.data.color),"pmUsageArc.vue"});return(r,s)=>(l(),f("g",{id:"pmUsageArc",origin:t.value},null,8,Gn))}});function $e(a,e=1){let t;if(a>=1e3&&e<4){switch(e){case 0:t=Math.round(a/1e3);break;case 1:t=Math.round(a/100)/10;break;case 2:t=Math.round(a/10)/100;break;case 3:t=Math.round(a)/1e3;break;default:t=Math.round(a/100)/10;break}return(t==null?void 0:t.toLocaleString(void 0,{minimumFractionDigits:e}))+" kW"}else return Math.round(a).toLocaleString()+" W"}function ct(a,e=1,t=!1){let r;if(a>1e6&&(t=!0,a=a/1e3),a>=1e3&&e<4){switch(e){case 0:r=Math.round(a/1e3);break;case 1:r=Math.round(a/100)/10;break;case 2:r=Math.round(a/10)/100;break;case 3:r=Math.round(a)/1e3;break;default:r=Math.round(a/100)/10;break}return r.toLocaleString(void 0,{minimumFractionDigits:e})+(t?" MWh":" kWh")}else return Math.round(a).toLocaleString()+(t?" kWh":" Wh")}function Un(a){const e=Math.floor(a/3600),t=(a%3600/60).toFixed(0);return e>0?e+"h "+t+" min":t+" min"}function La(a){return a.toLocaleTimeString(["de-DE"],{hour:"2-digit",minute:"2-digit"})}function Fn(a,e){return["Jan","Feb","März","April","Mai","Juni","Juli","Aug","Sep","Okt","Nov","Dez"][a]+" "+e}function Nn(a){return a!=999?(Math.round(a*10)/10).toLocaleString(void 0,{minimumFractionDigits:1})+"°":"-"}const bt=L({__name:"FormatWatt",props:{watt:{}},setup(a){const e=a,t=m(()=>$e(e.watt,g.decimalPlaces));return(r,s)=>S(t.value)}}),Hn={key:0,id:"pmLabel"},Rn=["x","y","fill","text-anchor"],Jn=22,Ae=L({__name:"PMLabel",props:{x:{},y:{},data:{},props:{},anchor:{},labeltext:{},labelicon:{},labelcolor:{}},setup(a){const e=a,t=m(()=>e.labeltext?e.labeltext:e.props?e.props.icon+" ":e.labelicon?e.labelicon+" ":""),r=m(()=>e.labelcolor?e.labelcolor:e.props?e.props.color:""),s=m(()=>!e.data||e.data.power>0),o=m(()=>e.labeltext?"":"fas");return(h,d)=>s.value?(l(),f("g",Hn,[n("text",{x:h.x,y:h.y,fill:r.value,"text-anchor":h.anchor,"font-size":Jn,class:"pmLabel"},[n("tspan",{class:q(o.value)},S(t.value),3),n("tspan",null,[h.data!==void 0?(l(),$(bt,{key:0,watt:h.data.power},null,8,["watt"])):w("",!0)])],8,Rn)])):w("",!0)}}),Yn={class:"wb-widget p-0 m-0 shadow"},qn={class:"d-flex justify-content-between"},Qn={class:"m-4 me-0 mb-0"},Zn={class:"p-4 pb-0 ps-0 m-0",style:{"text-align":"right"}},Xn={class:"px-4 pt-4 pb-2 wb-subwidget"},Kn={class:"row"},er={class:"col m-0 p-0"},tr={class:"container-fluid m-0 p-0"},ar={key:0},nr={class:"px-4 py-2 wb-subwidget"},rr={class:"row"},or={class:"col"},sr={class:"container-fluid m-0 p-0"},_t=L({__name:"WBWidget",props:{variableWidth:{type:Boolean},fullWidth:{type:Boolean}},setup(a){const e=a,t=m(()=>e.fullWidth?"col-12":e.variableWidth&&g.preferWideBoxes?"col-lg-6":"col-lg-4");return(r,s)=>(l(),f("div",{class:q(["p-2 m-0 d-flex",t.value])},[n("div",Yn,[n("div",qn,[n("h3",Qn,[pe(r.$slots,"title",{},()=>[s[0]||(s[0]=n("div",{class:"p-0"},"(title goes here)",-1))]),pe(r.$slots,"subtitle")]),n("div",Zn,[pe(r.$slots,"buttons")])]),n("div",Xn,[n("div",Kn,[n("div",er,[n("div",tr,[pe(r.$slots,"default")])])])]),r.$slots.footer!=null?(l(),f("div",ar,[s[1]||(s[1]=n("hr",null,null,-1)),n("div",nr,[n("div",rr,[n("div",or,[n("div",sr,[pe(r.$slots,"footer")])])])])])):w("",!0)])],2))}});class ir{constructor(){b(this,"active",!1);b(this,"etPriceList",new Map);b(this,"etProvider","");b(this,"etMaxPrice",0)}get etCurrentPriceString(){const[e]=re.etPriceList.values();return(Math.round(e*10)/10).toFixed(1)+" ct"}}const re=le(new ir),lr={id:"powermeter",class:"p-0 m-0"},cr=["viewBox"],ur=["transform"],dr=["x"],Ze=500,Ue=20,pa=1,hr=L({__name:"PowerMeter",setup(a){const e=Ze,t=Math.PI/40,r=[[4],[4,6],[1,4,6],[0,2,4,6],[0,2,3,5,6]],s=[{x:-85,y:e/2*1/5},{x:0,y:e/2*1/5},{x:85,y:e/2*1/5},{x:-85,y:e/2*2/5},{x:0,y:e/2*2/5},{x:85,y:e/2*2/5},{x:0,y:e/2*3/5}],o=m(()=>Ze/2-Ue),h=m(()=>{let B="",A=Object.values(Q).filter(V=>V.power>0);return A.length==1&&A[0].name=="PV"?B="Aktueller Verbrauch: ":B="Bezug/Verbrauch: ",B+$e(U.house.power+U.charging.power+U.devices.power+U.batIn.power,g.decimalPlaces)}),d=m(()=>{let B=Q.pv.power+Q.evuIn.power+Q.batOut.power;return g.maxPower>B?$e(g.maxPower,g.decimalPlaces):$e(B,g.decimalPlaces)}),u=m(()=>Object.values(O)),p=m(()=>{let B=0;return g.showRelativeArcs&&(B=g.maxPower-(Q.pv.power+Q.evuIn.power+Q.batOut.power)),B<0?0:B}),c=m(()=>[U.evuOut,U.charging,U.devices,U.batIn,U.house].filter(B=>B.power>0)),k=m(()=>r[c.value.length-1]);function P(B){return s[k.value[B]]}function z(B){return B.length>12?B.slice(0,11)+".":B}const D=m(()=>{const[B]=re.etPriceList.values();return Math.round(B*10)/10});return(B,A)=>(l(),$(_t,{"full-width":!0},{title:_(()=>A[0]||(A[0]=[H(" Aktuelle Leistung ")])),default:_(()=>[n("figure",lr,[(l(),f("svg",{viewBox:"0 0 "+Ze+" "+i(e)},[n("g",{transform:"translate("+Ze/2+","+i(e)/2+")"},[v(Dn,{radius:o.value,"corner-radius":pa,"circle-gap-size":t,"empty-power":p.value},null,8,["radius","empty-power"]),v(jn,{"sh-device":i(ae),radius:o.value,"corner-radius":pa,"circle-gap-size":t,"empty-power":p.value},null,8,["sh-device","radius","empty-power"]),v(Ae,{x:0,y:-i(e)/10*2,data:i(Q).pv,props:i(ie).pv,anchor:"middle",config:i(g)},null,8,["y","data","props","config"]),v(Ae,{x:0,y:-i(e)/10*3,data:i(Q).evuIn,props:i(ie).evuIn,anchor:"middle",config:i(g)},null,8,["y","data","props","config"]),v(Ae,{x:0,y:-i(e)/10,data:i(Q).batOut,props:i(ie).batOut,anchor:"middle",config:i(g)},null,8,["y","data","props","config"]),i(re).active?(l(),$(Ae,{key:0,x:0,y:-i(e)/10,data:i(Q).batOut,props:i(ie).batOut,anchor:"middle",config:i(g)},null,8,["y","data","props","config"])):w("",!0),(l(!0),f(F,null,te(c.value,(V,J)=>(l(),$(Ae,{key:J,x:P(J).x,y:P(J).y,data:V,labelicon:V.icon,labelcolor:V.color,anchor:"middle",config:i(g)},null,8,["x","y","data","labelicon","labelcolor","config"]))),128)),i(me)[0]!=null&&i(Y)[i(me)[0]]!=null?(l(),$(Ae,{key:1,x:-500/2-Ue/4+10,y:-i(e)/2+Ue+5,labeltext:z(i(Y)[i(me)[0]].name)+": "+Math.round(i(Y)[i(me)[0]].soc)+"%",labelcolor:u.value[0]?u.value[0].color:"var(--color-charging)",anchor:"start",config:i(g)},null,8,["x","y","labeltext","labelcolor","config"])):w("",!0),i(me)[1]!=null&&i(Y)[i(me)[1]]!=null?(l(),$(Ae,{key:2,x:Ze/2+Ue/4-10,y:-i(e)/2+Ue+5,labeltext:z(i(Y)[i(me)[1]].name)+": "+Math.round(i(Y)[i(me)[1]].soc)+"%",labelcolor:u.value[1]?u.value[1].color:"var(--color-charging)",anchor:"end",config:i(g)},null,8,["x","y","labeltext","labelcolor","config"])):w("",!0),i(de).batterySoc>0?(l(),$(Ae,{key:3,x:-500/2-Ue/4+10,y:i(e)/2-Ue+15,labeltext:"Speicher: "+i(de).batterySoc+"%",labelcolor:i(U).batIn.color,anchor:"start",config:i(g)},null,8,["x","y","labeltext","labelcolor","config"])):w("",!0),i(re).active?(l(),$(Ae,{key:4,x:Ze/2+Ue/4-10,y:i(e)/2-Ue+15,value:D.value,labeltext:i(re).etCurrentPriceString,labelcolor:"var(--color-charging)",anchor:"end",config:i(g)},null,8,["x","y","value","labeltext","config"])):w("",!0),v(Ae,{x:0,y:0,labeltext:h.value,labelcolor:"var(--color-fg)",anchor:"middle",config:i(g)},null,8,["labeltext","config"]),i(g).showRelativeArcs?(l(),f("text",{key:5,x:Ze/2-44,y:"2","text-anchor":"middle",fill:"var(--color-axis)","font-size":"12"}," Peak: "+S(d.value),9,dr)):w("",!0)],8,ur)],8,cr))])]),_:1}))}}),pr=["origin","origin2","transform"],gr=L({__name:"PgSourceGraph",props:{width:{},height:{},margin:{}},setup(a){const e=a,t={house:"var(--color-house)",batIn:"var(--color-battery)",inverter:"var(--color-pv)",batOut:"var(--color-battery)",selfUsage:"var(--color-pv)",pv:"var(--color-pv)",evuOut:"var(--color-export)",evuIn:"var(--color-evu)"};var r,s;const o=g.showAnimations?g.animationDuration:0,h=g.showAnimations?g.animationDelay:0,d=m(()=>{const M=ce("g#pgSourceGraph");if(y.data.length>0){y.graphMode=="month"||y.graphMode=="year"?J(M,Je.value):V(M,Be.value),M.selectAll(".axis").remove();const E=M.append("g").attr("class","axis");E.call(D.value),E.selectAll(".tick").attr("font-size",12),E.selectAll(".tick line").attr("stroke",A.value).attr("stroke-width",B.value),E.select(".domain").attr("stroke","var(--color-bg)")}return"pgSourceGraph.vue"}),u=m(()=>xa().value((M,E)=>M[E]??0).keys(k.value)),p=m(()=>u.value(y.data)),c=m(()=>He().range([e.height-10,0]).domain(y.graphMode=="year"?[0,Math.ceil(P.value[1]*10)/10]:[0,Math.ceil(P.value[1])])),k=m(()=>{let M=[];const E=["batOut","evuIn"];if(g.showInverters){const I=/pv\d+/;y.data.length>0&&(M=Object.keys(y.data[0]).reduce((x,G)=>(G.match(I)&&x.push(G),x),[]))}switch(y.graphMode){case"live":return g.showInverters?["pv","batOut","evuIn"]:["selfUsage","evuOut","batOut","evuIn"];case"today":case"day":return M.forEach((I,x)=>{t[I]="var(--color-pv"+(x+1)+")"}),g.showInverters?[...M,...E]:["selfUsage","evuOut","batOut","evuIn"];default:return["evuIn","batOut","selfUsage","evuOut"]}}),P=m(()=>{let M=Ve(y.data,E=>Math.max(E.pv+E.evuIn+E.batOut,E.selfUsage+E.evuOut));return M[0]!=null&&M[1]!=null?(y.graphMode=="year"&&(M[0]=M[0]/1e3,M[1]=M[1]/1e3),M):[0,0]}),z=m(()=>y.graphMode=="month"||y.graphMode=="year"?-e.width-e.margin.right-22:-e.width),D=m(()=>ft(c.value).tickSizeInner(z.value).ticks(4).tickFormat(M=>(M==0?"":Math.round(M*10)/10).toLocaleString(void 0))),B=m(()=>g.showGrid?"0.5":"1"),A=m(()=>g.showGrid?"var(--color-grid)":"var(--color-bg)");function V(M,E){const I=nt().x((G,xe)=>E(y.data[xe].date)).y(c.value(0)).curve(rt),x=nt().x((G,xe)=>E(y.data[xe].date)).y0(G=>c.value(y.graphMode=="year"?G[0]/1e3:G[0])).y1(G=>c.value(y.graphMode=="year"?G[1]/1e3:G[1])).curve(rt);mt?(M.selectAll("*").remove(),r=M.append("svg").attr("x",0).attr("width",e.width).selectAll(".sourceareas").data(p.value).enter().append("path").attr("fill",(xe,W)=>t[k.value[W]]).attr("d",xe=>I(xe)),r.transition().duration(o).delay(h).ease(dt).attr("d",xe=>x(xe)),ia()):r.data(p.value).transition().duration(0).ease(dt).attr("d",G=>x(G))}function J(M,E){y.data.length>0&&(mt?(M.selectAll("*").remove(),s=M.selectAll(".sourcebar").data(p.value).enter().append("g").attr("fill",(I,x)=>t[k.value[x]]).selectAll("rect").data(I=>I).enter().append("rect").attr("x",(I,x)=>E(y.data[x].date)??0).attr("y",()=>c.value(0)).attr("height",0).attr("width",E.bandwidth()),s.transition().duration(o).delay(h).ease(dt).attr("height",I=>y.graphMode=="year"?c.value(I[0]/1e3)-c.value(I[1]/1e3):c.value(I[0])-c.value(I[1])).attr("y",I=>y.graphMode=="year"?c.value(I[1]/1e3):c.value(I[1])),ia()):(M.selectAll("*").remove(),s=M.selectAll(".sourcebar").data(p.value).enter().append("g").attr("fill",(I,x)=>t[k.value[x]]).selectAll("rect").data(I=>I).enter().append("rect").attr("x",(I,x)=>E(y.data[x].date)??0).attr("y",I=>y.graphMode=="year"?c.value(I[1]/1e3):c.value(I[1])).attr("width",E.bandwidth()).attr("height",I=>y.graphMode=="year"?c.value(I[0]/1e3)-c.value(I[1]/1e3):c.value(I[0])-c.value(I[1]))))}const C=m(()=>{const M=ce("g#pgSourceGraph");if(y.graphMode!="month"&&y.graphMode!="year"&&y.data.length>0){Be.value.range(Ye.value);const E=nt().x((I,x)=>Be.value(y.data[x].date)).y0(I=>c.value(I[0])).y1(I=>c.value(I[1])).curve(rt);M.selectAll("path").attr("d",I=>I?E(I):""),M.selectAll("g#sourceToolTips").select("rect").attr("x",I=>Be.value(I.date)).attr("width",e.width/y.data.length)}return"zoomed"});return(M,E)=>(l(),f("g",{id:"pgSourceGraph",origin:d.value,origin2:C.value,transform:"translate("+M.margin.left+","+M.margin.top+")"},null,8,pr))}}),mr=["origin","origin2","transform"],fr=L({__name:"PgUsageGraph",props:{width:{},height:{},margin:{},stackOrder:{}},setup(a){const e=a,t=m(()=>g.showInverters?[["house","charging","devices","batIn","evuOut"],["charging","devices","batIn","house","evuOut"],["devices","batIn","charging","house","evuOut"],["batIn","charging","house","devices","evuOut"]]:[["house","charging","devices","batIn"],["charging","devices","batIn","house"],["devices","batIn","charging","house"],["batIn","charging","house","devices"]]),r={house:"var(--color-house)",charging:"var(--color-charging)",batIn:"var(--color-battery)",batOut:"var(--color-battery)",selfUsage:"var(--color-pv)",evuOut:"var(--color-export)",evuIn:"var(--color-evu)",cp0:"var(--color-cp0)",cp1:"var(--color-cp1)",cp2:"var(--color-cp2)",cp3:"var(--color-cp3)",sh1:"var(--color-sh1)",sh2:"var(--color-sh2)",sh3:"var(--color-sh3)",sh4:"var(--color-sh4)",devices:"var(--color-devices)"};var s,o;const h=g.showAnimations?g.animationDuration:0,d=g.showAnimations?g.animationDelay:0,u=m(()=>{const C=ce("g#pgUsageGraph");y.graphMode=="month"||y.graphMode=="year"?V(C):A(C),C.selectAll(".axis").remove();const M=C.append("g").attr("class","axis");return M.call(B.value),M.selectAll(".tick").attr("font-size",12).attr("color","var(--color-axis)"),g.showGrid?M.selectAll(".tick line").attr("stroke","var(--color-grid)").attr("stroke-width","0.5"):M.selectAll(".tick line").attr("stroke","var(--color-bg)"),M.select(".domain").attr("stroke","var(--color-bg)"),"pgUsageGraph.vue"}),p=m(()=>xa().value((C,M)=>C[M]??0).keys(P.value)),c=m(()=>p.value(y.data)),k=m(()=>He().range([e.height+10,2*e.height]).domain(y.graphMode=="year"?[0,Math.ceil(z.value[1]*10)/10]:[0,Math.ceil(z.value[1])])),P=m(()=>{if(y.graphMode!="today"&&y.graphMode!="day"&&y.graphMode!="live")return t.value[e.stackOrder];{const C=t.value[e.stackOrder].slice(),M=C.indexOf("charging");C.splice(M,1);const E=/cp\d+/;let I=[];return y.data.length>0&&(I=Object.keys(y.data[0]).reduce((x,G)=>(G.match(E)&&x.push(G),x),[])),I.forEach((x,G)=>{var xe;C.splice(M+G,0,x),r[x]=((xe=O[+x.slice(2)])==null?void 0:xe.color)??"black"}),g.showInverters&&C.push("evuOut"),C}}),z=m(()=>{let C=Ve(y.data,M=>M.house+M.charging+M.batIn+M.devices+M.evuOut);return C[0]!=null&&C[1]!=null?(y.graphMode=="year"&&(C[0]=C[0]/1e3,C[1]=C[1]/1e3),C):[0,0]}),D=m(()=>y.graphMode=="month"||y.graphMode=="year"?-e.width-e.margin.right-22:-e.width),B=m(()=>ft(k.value).tickSizeInner(D.value).ticks(4).tickFormat(C=>(C==0?"":Math.round(C*10)/10).toLocaleString(void 0)));function A(C){const M=nt().x((I,x)=>Be.value(y.data[x].date)).y(k.value(0)).curve(rt),E=nt().x((I,x)=>Be.value(y.data[x].date)).y0(I=>k.value(I[0])).y1(I=>k.value(I[1])).curve(rt);g.showAnimations?it?(C.selectAll("*").remove(),s=C.append("svg").attr("x",0).attr("width",e.width).selectAll(".usageareas").data(c.value).enter().append("path").attr("d",x=>M(x)).attr("fill",(x,G)=>r[P.value[G]]),s.transition().duration(300).delay(100).ease(dt).attr("d",x=>E(x)),ca()):(C.selectAll("*").remove(),C.append("svg").attr("x",0).attr("width",e.width).selectAll(".usageareas").data(c.value).enter().append("path").attr("d",x=>E(x)).attr("fill",(x,G)=>r[P.value[G]])):(C.selectAll("*").remove(),C.append("svg").attr("x",0).attr("width",e.width).selectAll(".usageareas").data(c.value).enter().append("path").attr("d",x=>E(x)).attr("fill",(x,G)=>r[P.value[G]]))}function V(C){it?(C.selectAll("*").remove(),o=C.selectAll(".usagebar").data(c.value).enter().append("g").attr("fill",(M,E)=>r[t.value[e.stackOrder][E]]).selectAll("rect").data(M=>M).enter().append("rect").attr("x",(M,E)=>Je.value(y.data[E].date)??0).attr("y",()=>k.value(0)).attr("height",0).attr("width",Je.value.bandwidth()),o.transition().duration(h).delay(d).ease(dt).attr("y",M=>y.graphMode=="year"?k.value(M[0]/1e3):k.value(M[0])).attr("height",M=>y.graphMode=="year"?k.value(M[1]/1e3)-k.value(M[0]/1e3):k.value(M[1])-k.value(M[0])),ca()):(C.selectAll("*").remove(),o=C.selectAll(".usagebar").data(c.value).enter().append("g").attr("fill",(M,E)=>r[t.value[e.stackOrder][E]]).selectAll("rect").data(M=>M).enter().append("rect").attr("x",(M,E)=>Je.value(y.data[E].date)??0).attr("y",M=>y.graphMode=="year"?k.value(M[0]/1e3):k.value(M[0])).attr("height",M=>y.graphMode=="year"?k.value(M[1]/1e3)-k.value(M[0]/1e3):k.value(M[1])-k.value(M[0])).attr("width",Je.value.bandwidth()))}const J=m(()=>{const C=ce("g#pgUsageGraph");if(y.graphMode!="month"&&y.graphMode!="year"){Be.value.range(Ye.value);const M=nt().x((E,I)=>Be.value(y.data[I].date)).y0(E=>k.value(E[0])).y1(E=>k.value(E[1])).curve(rt);C.selectAll("path").attr("d",E=>E?M(E):"")}return"zoomed"});return(C,M)=>(l(),f("g",{id:"pgUsageGraph",origin:u.value,origin2:J.value,transform:"translate("+C.margin.left+","+C.margin.top+")"},null,8,mr))}}),vr=["width"],yr=["transform"],br=["x","width"],_r=["transform"],wr=["origin","origin2","transform"],kr=["origin","transform"],xr={key:0},Sr=["width","height"],Mr={key:1},$r=["y","width","height"],Bt=12,Pr=L({__name:"PgXAxis",props:{width:{},height:{},margin:{}},setup(a){const e=a,t=m(()=>ht(Be.value).ticks(6).tickSizeInner(h.value).tickFormat(st("%H:%M"))),r=m(()=>Ja(Be.value).ticks(6).tickSizeInner(h.value+3).tickFormat(st(""))),s=m(()=>ht(Je.value).ticks(4).tickSizeInner(h.value).tickFormat(c=>c.toString())),o=m(()=>ht(Je.value).ticks(4).tickSizeInner(h.value).tickFormat(()=>"")),h=m(()=>y.graphMode!=="month"&&y.graphMode!=="year"?g.showGrid?-(e.height/2-7):-10:0),d=m(()=>{let c=ce("g#PGXAxis"),k=ce("g#PgUnit");return c.selectAll("*").remove(),k.selectAll("*").remove(),y.graphMode=="month"||y.graphMode=="year"?c.call(s.value):c.call(t.value),c.selectAll(".tick > text").attr("fill",(P,z)=>z>=0||y.graphMode=="month"||y.graphMode=="year"?"var(--color-axis)":"var(--color-bg)").attr("font-size",Bt),g.showGrid?c.selectAll(".tick line").attr("stroke","var(--color-grid)").attr("stroke-width","0.5"):c.selectAll(".tick line").attr("stroke","var(--color-bg)"),c.select(".domain").attr("stroke","var(--color-bg)"),k.append("text").attr("x",0).attr("y",12).attr("fill","var(--color-axis)").attr("font-size",Bt).text(y.graphMode=="year"?"MW":"kW").attr("text-anchor","start"),"PGXAxis.vue"}),u=m(()=>{let c=ce("g#PGXAxis2");return c.selectAll("*").remove(),y.graphMode=="month"||y.graphMode=="year"?c.call(o.value):c.call(r.value),c.selectAll(".tick > text").attr("fill",(k,P)=>P>=0||y.graphMode=="month"||y.graphMode=="year"?"var(--color-axis)":"var(--color-bg)").attr("font-size",Bt),g.showGrid?(c.selectAll(".tick line").attr("stroke","var(--color-grid)").attr("stroke-width","0.5"),c.select(".domain").attr("stroke","var(--color-bg)")):c.selectAll(".tick line").attr("stroke","var(--color-bg)"),c.select(".domain").attr("stroke","var(--color-bg)"),"PGXAxis2.vue"}),p=m(()=>{if(y.graphMode!="month"&&y.graphMode!="year"){const c=ce("g#PGXAxis"),k=ce("g#PGXAxis2");y.graphMode=="month"||y.graphMode=="year"?(Je.value.range(Ye.value),c.call(s.value),k.call(o.value)):(Be.value.range(Ye.value),c.call(t.value),k.call(r.value))}return"zoomed"});return(c,k)=>(l(),f(F,null,[(l(),f("svg",{x:"0",width:e.width},[n("g",{id:"PgUnit",transform:"translate(0,"+(c.height/2+9)+")"},null,8,yr)],8,vr)),(l(),f("svg",{x:e.margin.left,width:e.width},[n("g",{transform:"translate("+c.margin.left+","+c.margin.top+")"},[n("g",{id:"PGXAxis",class:"axis",origin:d.value,origin2:p.value,transform:"translate(0,"+(c.height/2-6)+")"},null,8,wr),n("g",{id:"PGXAxis2",class:"axis",origin:u.value,transform:"translate(0,"+(c.height/2+10)+")"},null,8,kr),i(g).showGrid?(l(),f("g",xr,[n("rect",{x:"0",y:"0",width:c.width,height:c.height/2-10,fill:"none",stroke:"var(--color-grid)","stroke-width":"0.5"},null,8,Sr)])):w("",!0),i(g).showGrid?(l(),f("g",Mr,[n("rect",{x:"0",y:c.height/2+10,width:c.width,height:c.height/2-10,fill:"none",stroke:"var(--color-grid)","stroke-width":"0.5"},null,8,$r)])):w("",!0)],8,_r)],8,br))],64))}}),Ir=["width"],Cr=["id",".origin","d"],Br=["id","d","stroke"],Vr=["x","y","text-anchor"],Vt=L({__name:"PgSoc",props:{width:{},height:{},margin:{},order:{}},setup(a){const e=a,t=m(()=>{let P=Ve(y.data,z=>z.date);return P[0]&&P[1]?et().domain(P).range([0,e.width]):et().range([0,0])}),r=m(()=>He().range([e.height-10,0]).domain([0,100])),s=m(()=>{let z=Ne().x(D=>t.value(D.date)).y(D=>r.value(e.order==2?D.batSoc:e.order==0?D["soc"+me.value[0]]:D["soc"+me.value[1]])??r.value(0))(y.data);return z||""}),o=m(()=>e.order),h=m(()=>{switch(e.order){case 2:return"Speicher";case 1:return Y[me.value[1]]!=null?Y[me.value[1]].name:"???";default:return Y[me.value[0]]!=null?Y[me.value[0]].name:"???"}}),d=m(()=>{switch(e.order){case 0:return"var(--color-cp1)";case 1:return"var(--color-cp2)";case 2:return"var(--color-battery)";default:return"red"}}),u=m(()=>{switch(e.order){case 0:return 3;case 1:return e.width-3;case 2:return e.width/2;default:return 0}}),p=m(()=>{if(y.data.length>0){let P;switch(e.order){case 0:return P=y.data.length-1,r.value(y.data[P]["soc"+me.value[0]]+2);case 1:return P=0,r.value(y.data[P]["soc"+me.value[1]]+2);case 2:return P=Math.round(y.data.length/2),r.value(y.data[P].batSoc+2);default:return 0}}else return 0}),c=m(()=>{switch(e.order){case 0:return"start";case 1:return"end";case 2:return"middle";default:return"middle"}}),k=m(()=>{if(y.graphMode!="month"&&y.graphMode!="year"){const P=ce("path#soc-"+o.value),z=ce("path#socdashes-"+o.value);t.value.range(Ye.value);const D=Ne().x(B=>t.value(B.date)).y(B=>r.value(e.order==2?B.batSoc:e.order==1?B["soc"+me.value[0]]:B["soc"+me.value[1]])??r.value(0));P.attr("d",D(y.data)),z.attr("d",D(y.data))}return"zoomed"});return(P,z)=>(l(),f("svg",{x:"0",width:e.width},[n("path",{id:"soc-"+o.value,".origin":k.value,class:"soc-baseline",d:s.value,stroke:"var(--color-bg)","stroke-width":"1",fill:"none"},null,40,Cr),n("path",{id:"socdashes-"+o.value,class:"soc-dashes",d:s.value,stroke:d.value,"stroke-width":"1",style:{strokeDasharray:"3,3"},fill:"none"},null,8,Br),n("text",{class:"cpname",x:u.value,y:p.value,style:K({fill:d.value,fontSize:10}),"text-anchor":c.value},S(h.value),13,Vr)],8,Ir))}}),Lr=["transform"],Or=L({__name:"PgSocAxis",props:{width:{},height:{},margin:{}},setup(a){const e=a,t=m(()=>He().range([e.height-10,0]).domain([0,100])),r=m(()=>Ya(t.value).ticks(5).tickFormat(o=>o.toString()+"%"));function s(){let o=ce("g#PGSocAxis");o.call(r.value),o.selectAll(".tick").attr("font-size",12),o.selectAll(".tick line").attr("stroke","var(--color-bg)"),o.select(".domain").attr("stroke","var(--color-bg)")}return Le(()=>{s()}),(o,h)=>(l(),f("g",{id:"PGSocAxis",class:"axis",transform:"translate("+(o.width-20)+",0)"},null,8,Lr))}}),Ar={class:"d-flex align-self-top justify-content-center align-items-center"},Tr={class:"input-group input-group-xs"},Er={key:0,class:"btn dropdown-toggle",type:"button","data-bs-toggle":"dropdown"},zr={class:"dropdown-menu"},Wr={class:"table optiontable"},Dr=["onClick"],Gr={key:1,class:"btn dropdown-toggle",type:"button","data-bs-toggle":"dropdown"},jr={class:"dropdown-menu"},Ur={class:"table optiontable"},Fr=["onClick"],Nr={key:2,class:"btn dropdown-toggle",type:"button","data-bs-toggle":"dropdown"},Hr={class:"dropdown-menu"},Rr={class:"table optiontable"},Jr=["onClick"],Yr=L({__name:"DateInput",props:{modelValue:{type:Date,required:!0},mode:{type:String,default:"day"}},emits:["update:modelValue"],setup(a,{emit:e}){const t=a,r=new Date().getFullYear();let s=Array.from({length:10},(z,D)=>r-D);const o=ee(!0),h=e,d=[[0,1,2,3],[4,5,6,7],[8,9,10,11]],u=ee(t.modelValue.getDate()),p=ee(t.modelValue.getMonth()),c=ee(t.modelValue.getFullYear()),k=m(()=>{const D=new Date(c.value,p.value,1).getDay();let B=0;switch(p.value){case 1:case 3:case 5:case 7:case 8:case 10:case 12:B=31;break;case 4:case 6:case 9:case 11:B=30;break;case 2:Math.trunc(c.value/4)*4==c.value?B=29:B=28}let A=[],V=[0,0,0,0,0,0,0],J=D;for(let C=0;C(l(),f("span",Ar,[n("div",Tr,[t.mode=="day"||t.mode=="today"?(l(),f("button",Er,S(u.value),1)):w("",!0),n("div",zr,[n("table",Wr,[(l(!0),f(F,null,te(k.value,(B,A)=>(l(),f("tr",{key:A,class:""},[(l(!0),f(F,null,te(B,(V,J)=>(l(),f("td",{key:J},[V!=0?(l(),f("span",{key:0,type:"button",class:"btn optionbutton",onClick:C=>u.value=V},S(V),9,Dr)):w("",!0)]))),128))]))),128))])]),t.mode!="year"&&t.mode!="live"?(l(),f("button",Gr,S(p.value+1),1)):w("",!0),n("div",jr,[n("table",Ur,[(l(),f(F,null,te(d,(B,A)=>n("tr",{key:A,class:""},[(l(!0),f(F,null,te(B,(V,J)=>(l(),f("td",{key:J,class:"p-0 m-0"},[n("span",{type:"button",class:"btn btn-sm optionbutton",onClick:C=>p.value=V},S(V+1),9,Fr)]))),128))])),64))])]),t.mode!="live"?(l(),f("button",Nr,S(c.value),1)):w("",!0),n("div",Hr,[n("table",Rr,[(l(!0),f(F,null,te(i(s),(B,A)=>(l(),f("tr",{key:A,class:""},[n("td",null,[n("span",{type:"button",class:"btn optionbutton",onClick:V=>c.value=B},S(B),9,Jr)])]))),128))])]),t.mode!="live"?(l(),f("button",{key:3,class:"button-outline-secondary",type:"button",onClick:P},D[0]||(D[0]=[n("span",{class:"fa-solid fa-circle-check"},null,-1)]))):w("",!0)])]))}}),R=(a,e)=>{const t=a.__vccOpts||a;for(const[r,s]of e)t[r]=s;return t},qr=R(Yr,[["__scopeId","data-v-98690e5d"]]),Qr={class:"btn-group m-0",role:"group","aria-label":"radiobar"},Zr=["id","value"],Xr=L({__name:"RadioBarInput",props:{options:{},modelValue:{}},emits:["update:modelValue"],setup(a,{emit:e}){const t=a,r=e,s=m({get(){return t.modelValue},set(d){r("update:modelValue",d)}});function o(d){let u=t.options[d].color?t.options[d].color:"var(--color-fg)";return t.options[d].active?{color:"var(--color-bg)",background:u}:{color:u}}function h(d){let u=d.target;for(;u&&!u.value&&u.parentElement;)u=u.parentElement;u.value&&(s.value=u.value)}return(d,u)=>(l(),f("div",null,[n("div",Qr,[(l(!0),f(F,null,te(d.options,(p,c)=>(l(),f("button",{id:"radio-"+p.value,key:c,class:q(["btn btn-outline-secondary btn-sm radiobutton mx-0 mb-0 px-2",p.value==s.value?"active":""]),value:p.value,style:K(o(c)),onClick:h},[n("span",{style:K(o(c))},[p.icon?(l(),f("i",{key:0,class:q(["fa-solid",p.icon])},null,2)):w("",!0),H(" "+S(p.text),1)],4)],14,Zr))),128))])]))}}),Oa=R(Xr,[["__scopeId","data-v-82ab6829"]]),Kr=L({__name:"PgSelector",props:{widgetid:{},showLeftButton:{type:Boolean},showRightButton:{type:Boolean},ignoreLive:{type:Boolean}},emits:["shiftLeft","shiftRight","shiftUp","shiftDown"],setup(a){const e=a,t=ee(0),r=m(()=>{if(y.waitForData)return"Lädt";switch(y.graphMode){case"live":return e.ignoreLive?"heute":`${ge.duration} min`;case"today":return"heute";case"day":return ue.date.getDate()+"."+(ue.date.getMonth()+1)+".";case"month":return Fn(Ee.month-1,Ee.year);case"year":return Re.year.toString();default:return"???"}}),s=["live","today","day","month","year"],o=["Live","Heute","Tag","Monat","Jahr"],h=m({get(){return y.graphMode},set(J){switch(J){case"day":k();break;case"today":P();break;case"live":c();break;case"month":z();break;case"year":D()}}}),d=m(()=>{switch(y.graphMode){case"live":case"today":return ue.getDate();case"month":return Ee.getDate();default:return ue.getDate()}});function u(J){da(J)}function p(){t.value+=1,t.value>2&&(t.value=0)}function c(){y.graphMode!="live"&&(y.graphMode="live",fe())}function k(){y.graphMode!="day"&&y.graphMode!="today"&&(y.graphMode="day",fe())}function P(){y.graphMode!="today"&&(y.graphMode="today",da(new Date),fe())}function z(){y.graphMode!="month"&&(y.graphMode="month",fe())}function D(){y.graphMode!="year"&&(y.graphMode="year",fe())}const B=m(()=>t.value>0?{border:"1px solid var(--color-frame)"}:""),A=m(()=>t.value==1?"justify-content-between":"justify-content-end"),V=m(()=>t.value==1?"justify-content-between":"justify-content-center");return(J,C)=>(l(),f("div",{class:"d-flex flex-column justify-content-center pgselector rounded",style:K(B.value)},[t.value==2?(l(),$(Oa,{key:0,id:"pgm2",modelValue:h.value,"onUpdate:modelValue":C[0]||(C[0]=M=>h.value=M),class:"m-2",options:s.map((M,E)=>({text:o[E],value:M,color:"var(--color-menu)",active:M==i(y).graphMode}))},null,8,["modelValue","options"])):w("",!0),t.value==1?(l(),f("span",{key:1,type:"button",class:q(["arrowButton d-flex align-self-center mb-3 mt-3",{disabled:!e.showLeftButton}]),onClick:C[1]||(C[1]=M=>J.$emit("shiftUp"))},C[6]||(C[6]=[n("i",{class:"fa-solid fa-xl fa-chevron-circle-up"},null,-1)]),2)):w("",!0),n("div",{class:q(["d-flex align-items-center",V.value])},[t.value==1?(l(),f("span",{key:0,type:"button",class:q(["p-1",{disabled:!e.showLeftButton}]),onClick:C[2]||(C[2]=M=>J.$emit("shiftLeft"))},C[7]||(C[7]=[n("span",{class:"fa-solid fa-xl fa-chevron-circle-left arrowButton"},null,-1)]),2)):w("",!0),t.value<2?(l(),f("span",{key:1,type:"button",class:"btn-outline-secondary p-2 px-3 badge rounded-pill datebadge",onClick:p},S(r.value),1)):w("",!0),t.value==2?(l(),$(qr,{key:2,"model-value":d.value,mode:i(y).graphMode,"onUpdate:modelValue":u},null,8,["model-value","mode"])):w("",!0),t.value==1?(l(),f("span",{key:3,id:"graphRightButton",type:"button",class:q(["arrowButton fa-solid fa-xl fa-chevron-circle-right p-1",{disabled:!e.showRightButton}]),onClick:C[3]||(C[3]=M=>J.$emit("shiftRight"))},null,2)):w("",!0)],2),n("div",{class:q(["d-flex align-items-center",A.value])},[t.value==1?(l(),f("span",{key:0,type:"button",class:"p-1",onClick:p},C[8]||(C[8]=[n("span",{class:"fa-solid fa-xl fa-gear"},null,-1)]))):w("",!0),t.value==1?(l(),f("span",{key:1,id:"graphLeftButton",type:"button",class:q(["arrowButton fa-solid fa-xl fa-chevron-circle-down p-1",{disabled:!e.showLeftButton}]),onClick:C[4]||(C[4]=M=>J.$emit("shiftDown"))},null,2)):w("",!0),t.value>0?(l(),f("span",{key:2,type:"button",class:"p-1",onClick:C[5]||(C[5]=M=>t.value=0)},C[9]||(C[9]=[n("span",{class:"fa-solid fa-xl fa-circle-check"},null,-1)]))):w("",!0)],2)],4))}}),na=R(Kr,[["__scopeId","data-v-d75ec1a4"]]),eo=["x","fill"],to=["x"],Ie=L({__name:"PgToolTipLine",props:{cat:{},name:{},indent:{},power:{},width:{}},setup(a){const e=a;return(t,r)=>(l(),f(F,null,[t.power>0?(l(),f("tspan",{key:0,x:t.indent,dy:"1.3em",class:q(t.name?"":"fas"),fill:i(ie)[t.cat].color},S(t.name?t.name:i(ie)[t.cat].icon)+"   ",11,eo)):w("",!0),n("tspan",{"text-anchor":"end",x:t.width-t.indent},[e.power>0?(l(),$(bt,{key:0,watt:t.power*1e3},null,8,["watt"])):w("",!0)],8,to)],64))}}),ao=["transform"],no=["width","height"],ro={"text-anchor":"start",x:"5",y:"20","font-size":"16",fill:"var(--color-fg)"},oo=["x"],so=L({__name:"PgToolTipItem",props:{entry:{},boxwidth:{},xScale:{type:[Function,Object]}},setup(a){const e=a,t=m(()=>Object.values(e.entry).filter(u=>u>0).length),r=m(()=>t.value*16),s=m(()=>Object.entries(e.entry).filter(([u,p])=>u.startsWith("pv")&&u.length>2&&p>0).map(([u,p])=>({power:p,name:Fe.value.get(u)?d(Fe.value.get(u)):"Wechselr.",id:u}))),o=m(()=>Object.entries(e.entry).filter(([u,p])=>u.startsWith("cp")&&u.length>2&&p>0).map(([u,p])=>({power:p,name:Fe.value.get(u)?d(Fe.value.get(u)):"Ladep.",id:u}))),h=m(()=>Object.entries(e.entry).filter(([u,p])=>u.startsWith("sh")&&u.length>2&&p>0).map(([u,p])=>({power:p,name:Fe.value.get(u)?d(Fe.value.get(u)):"Gerät",id:u})));function d(u){return u.length>6?u.slice(0,6)+"...":u}return(u,p)=>(l(),f("g",{class:"ttmessage",transform:"translate("+u.xScale(u.entry.date)+",0)"},[n("rect",{rx:"5",width:u.boxwidth,height:r.value,fill:"var(--color-bg)",opacity:"80%",stroke:"var(--color-menu)"},null,8,no),n("text",ro,[n("tspan",{"text-anchor":"middle",x:u.boxwidth/2,dy:"0em"},S(i(st)("%H:%M")(new Date(u.entry.date))),9,oo),p[0]||(p[0]=n("line",{y:"120",x1:"5",x2:"100",stroke:"var(--color-fg)","stroke-width":"1"},null,-1)),v(Ie,{cat:"evuIn",indent:5,power:u.entry.evuIn,width:u.boxwidth},null,8,["power","width"]),v(Ie,{cat:"batOut",indent:5,power:u.entry.batOut,width:u.boxwidth},null,8,["power","width"]),v(Ie,{cat:"pv",indent:5,power:u.entry.pv,width:u.boxwidth},null,8,["power","width"]),(l(!0),f(F,null,te(s.value,c=>(l(),$(Ie,{key:c.id,cat:"pv",name:c.name,power:c.power,indent:10,width:u.boxwidth},null,8,["name","power","width"]))),128)),v(Ie,{cat:"house",indent:5,power:u.entry.house,width:u.boxwidth},null,8,["power","width"]),v(Ie,{cat:"charging",indent:5,power:u.entry.charging,width:u.boxwidth},null,8,["power","width"]),(l(!0),f(F,null,te(o.value,c=>(l(),$(Ie,{key:c.id,cat:"charging",name:c.name,power:c.power,indent:10,width:u.boxwidth},null,8,["name","power","width"]))),128)),v(Ie,{cat:"devices",indent:5,power:u.entry.devices,width:u.boxwidth},null,8,["power","width"]),(l(!0),f(F,null,te(h.value,c=>(l(),$(Ie,{key:c.id,cat:"devices",name:c.name,power:c.power,indent:10,width:u.boxwidth},null,8,["name","power","width"]))),128)),v(Ie,{cat:"batIn",indent:5,power:u.entry.batIn,width:u.boxwidth},null,8,["power","width"]),v(Ie,{cat:"evuOut",indent:5,power:u.entry.evuOut,width:u.boxwidth},null,8,["power","width"])])],8,ao))}}),io=["origin","transform"],lo=["x","height","width"],ga=140,co=L({__name:"PgToolTips",props:{width:{},height:{},margin:{},data:{}},setup(a){const e=a,t=m(()=>{const o=Ve(e.data,h=>new Date(h.date));return o[0]&&o[1]?Ft().domain(o).range([0,e.width-e.margin.right]):et().range([0,0])}),r=m(()=>{const o=Ve(e.data,h=>new Date(h.date));return o[0]&&o[1]?Ft().domain(o).range([0,e.width-e.margin.right-ga]):et().range([0,0])}),s=m(()=>((y.graphMode=="day"||y.graphMode=="today")&&(t.value.range(Ye.value),ce("g#pgToolTips").selectAll("g.ttarea").select("rect").attr("x",(o,h)=>e.data.length>h?t.value(e.data[h].date):0).attr("width",e.data.length>0?(Ye.value[1]-Ye.value[0])/e.data.length:0)),"PgToolTips.vue:autozoom"));return(o,h)=>(l(),f("g",{id:"pgToolTips",origin:s.value,transform:"translate("+o.margin.left+","+o.margin.top+")"},[(l(!0),f(F,null,te(o.data,d=>(l(),f("g",{key:d.date,class:"ttarea"},[n("rect",{x:t.value(d.date),y:"0",height:o.height,class:"ttrect",width:i(y).data.length>0?o.width/i(y).data.length:0,opacity:"1%",fill:"var(--color-charging)"},null,8,lo),v(so,{entry:d,boxwidth:ga,"x-scale":r.value},null,8,["entry","x-scale"])]))),128))],8,io))}}),uo={class:"d-flex justify-content-end"},ho={id:"powergraphFigure",class:"p-0 m-0"},po=["viewBox"],go=["transform"],mo=["x","y"],fo=2,vo="Leistung / Ladestand ",yo=L({__name:"PowerGraph",setup(a){function e(){let h=g.usageStackOrder+1;h>fo&&(h=0),g.usageStackOrder=h,xn(!0)}function t(h){const d=[[0,j.top],[be,Se-j.top]];h.call(Qa().scaleExtent([1,8]).translateExtent([[0,0],[be,Se]]).extent(d).filter(s).on("zoom",r))}function r(h){Ca.value=h.transform}function s(h){return h.preventDefault(),(!h.ctrlKey||h.type==="wheel")&&!h.button}function o(){g.zoomedWidget=1,g.zoomGraph=!g.zoomGraph}return Le(()=>{const h=ce("svg#powergraph");t(h)}),(h,d)=>(l(),$(_t,{"full-width":!0},{title:_(()=>[H(S(vo))]),buttons:_(()=>[n("div",uo,[v(na,{widgetid:"graphsettings","show-left-button":!0,"show-right-button":!0,"ignore-live":!1,onShiftLeft:i(It),onShiftRight:i(Kt),onShiftUp:i(ea),onShiftDown:i(ta)},null,8,["onShiftLeft","onShiftRight","onShiftUp","onShiftDown"]),i(De)?(l(),f("span",{key:0,type:"button",class:"ms-1 p-0 pt-1",onClick:o},d[0]||(d[0]=[n("span",{class:"fa-solid fa-lg ps-1 fa-magnifying-glass"},null,-1)]))):w("",!0)])]),default:_(()=>[vt(n("figure",ho,[(l(),f("svg",{id:"powergraph",class:"powergraphSvg",viewBox:"0 0 "+i(be)+" "+i(Se)},[v(gr,{width:i(be)-i(j).left-2*i(j).right,height:(i(Se)-i(j).top-i(j).bottom)/2,margin:i(j)},null,8,["width","height","margin"]),v(fr,{width:i(be)-i(j).left-2*i(j).right,height:(i(Se)-i(j).top-i(j).bottom)/2,margin:i(j),"stack-order":i(g).usageStackOrder},null,8,["width","height","margin","stack-order"]),v(Pr,{width:i(be)-i(j).left-2*i(j).right,height:i(Se)-i(j).top-i(j).bottom,margin:i(j)},null,8,["width","height","margin"]),n("g",{transform:"translate("+i(j).left+","+i(j).top+")"},[(i(y).graphMode=="day"||i(y).graphMode=="today"||i(y).graphMode=="live")&&Object.values(i(Y)).filter(u=>u.visible).length>0?(l(),$(Vt,{key:0,width:i(be)-i(j).left-2*i(j).right,height:(i(Se)-i(j).top-i(j).bottom)/2,margin:i(j),order:0},null,8,["width","height","margin"])):w("",!0),(i(y).graphMode=="day"||i(y).graphMode=="today"||i(y).graphMode=="live")&&Object.values(i(Y)).filter(u=>u.visible).length>1?(l(),$(Vt,{key:1,width:i(be)-i(j).left-2*i(j).right,height:(i(Se)-i(j).top-i(j).bottom)/2,margin:i(j),order:1},null,8,["width","height","margin"])):w("",!0),(i(y).graphMode=="day"||i(y).graphMode=="today"||i(y).graphMode=="live")&&i(de).isBatteryConfigured?(l(),$(Vt,{key:2,width:i(be)-i(j).left-2*i(j).right,height:(i(Se)-i(j).top-i(j).bottom)/2,margin:i(j),order:2},null,8,["width","height","margin"])):w("",!0),i(y).graphMode=="day"||i(y).graphMode=="today"||i(y).graphMode=="live"?(l(),$(Or,{key:3,width:i(be)-i(j).left-i(j).right,height:(i(Se)-i(j).top-i(j).bottom)/2,margin:i(j)},null,8,["width","height","margin"])):w("",!0)],8,go),i(y).graphMode=="day"||i(y).graphMode=="today"?(l(),$(co,{key:0,width:i(be)-i(j).left-i(j).right,height:i(Se)-i(j).top-i(j).bottom,margin:i(j),data:i(y).data},null,8,["width","height","margin","data"])):w("",!0),n("g",{id:"button",type:"button",onClick:e},[n("text",{x:i(be)-10,y:i(Se)-10,color:"var(--color-menu)","text-anchor":"end"},d[1]||(d[1]=[n("tspan",{fill:"var(--color-menu)",class:"fas fa-lg"},S(""),-1)]),8,mo)])],8,po))],512),[[qa,i(y).data.length>0]])]),_:1}))}}),bo=R(yo,[["__scopeId","data-v-7cbcf9ef"]]),_o=["id"],wo=["x","width","height","fill"],ko=["x","width","height"],xo=["x","y","width","height"],So=L({__name:"EmBar",props:{item:{},xScale:{},yScale:{},margin:{},height:{},barcount:{},autarchy:{},autText:{}},setup(a){const e=a,t=m(()=>e.height-e.yScale(e.item.energy)-e.margin.top-e.margin.bottom),r=m(()=>{let o=0;return e.item.energyPv>0&&(o=e.height-e.yScale(e.item.energyPv)-e.margin.top-e.margin.bottom),o>t.value&&(o=t.value),o}),s=m(()=>{let o=0;return e.item.energyBat>0&&(o=e.height-e.yScale(e.item.energyBat)-e.margin.top-e.margin.bottom),o>t.value&&(o=t.value),o});return(o,h)=>(l(),f("g",{id:"bar-"+e.item.name,transform:"scale(1,-1) translate (0,-445)"},[n("rect",{class:"bar",x:e.xScale(o.item.name),y:"0",width:e.xScale.bandwidth(),height:t.value,fill:o.item.color},null,8,wo),n("rect",{class:"bar",x:e.xScale(o.item.name)+e.xScale.bandwidth()/6,y:"0",width:e.xScale.bandwidth()*2/3,height:r.value,fill:"var(--color-pv)","fill-opacity":"66%"},null,8,ko),n("rect",{class:"bar",x:e.xScale(o.item.name)+e.xScale.bandwidth()/6,y:r.value,width:e.xScale.bandwidth()*2/3,height:s.value,fill:"var(--color-battery)","fill-opacity":"66%"},null,8,xo)],8,_o))}}),Mo={id:"emBargraph"},$o=L({__name:"EMBarGraph",props:{plotdata:{},xScale:{},yScale:{},margin:{},height:{}},setup(a){const e=a;function t(s){if(s.name=="PV"){const o=y.graphMode=="live"||y.graphMode=="day"?Q:T.items,d=(y.graphMode=="live"||y.graphMode=="day"?U:T.items).evuOut.energy,u=o.pv.energy;return Math.round((u-d)/u*100)}else if(s.name=="Netz"){const o=y.graphMode=="live"||y.graphMode=="day"?Q:T.items,h=y.graphMode=="live"||y.graphMode=="day"?U:T.items,d=h.evuOut.energy,u=o.evuIn.energy,p=o.pv.energy,c=o.batOut.energy,k=h.batIn.energy;return Math.round((p+c-d-k)/(p+c+u-d-k)*100)}else return s.pvPercentage}function r(s){return s.name=="PV"?"Eigen":"Aut"}return(s,o)=>(l(),f("g",Mo,[(l(!0),f(F,null,te(e.plotdata,(h,d)=>(l(),f("g",{key:d},[v(So,{item:h,"x-scale":e.xScale,"y-scale":e.yScale,margin:e.margin,height:e.height,barcount:e.plotdata.length,"aut-text":r(h),autarchy:t(h)},null,8,["item","x-scale","y-scale","margin","height","barcount","aut-text","autarchy"])]))),128)),o[0]||(o[0]=n("animateTransform",{"attribute-name":"transform",type:"scale",from:"1 0",to:"1 1",begin:"0s",dur:"2s"},null,-1))]))}}),Po=["origin"],Io=L({__name:"EMYAxis",props:{yScale:{type:[Function,Object]},width:{},fontsize:{}},setup(a){const e=a,t=m(()=>ft(e.yScale).tickFormat(o=>s(o)).ticks(6).tickSizeInner(-e.width)),r=m(()=>{const o=ce("g#emYAxis");return o.attr("class","axis").call(t.value),o.append("text").attr("y",6).attr("dy","0.71em").attr("text-anchor","end").text("energy"),o.selectAll(".tick").attr("font-size",e.fontsize),g.showGrid?o.selectAll(".tick line").attr("stroke","var(--color-grid)").attr("stroke-width","0.5"):o.selectAll(".tick line").attr("stroke","var(--color-bg)"),o.select(".domain").attr("stroke","var(--color-bg)"),"emYAxis.vue"});function s(o){return o>0?y.graphMode=="year"?(o/1e6).toString():(o/1e3).toString():""}return(o,h)=>(l(),f("g",{id:"emYAxis",class:"axis",origin:r.value},null,8,Po))}}),Co=["id"],Bo=["x","y","font-size"],Vo=["x","y","font-size","fill"],Lo=["x","y","font-size","fill"],Oo=L({__name:"EmLabel",props:{item:{},xScale:{},yScale:{},margin:{},height:{},barcount:{},autarchy:{},autText:{}},setup(a){const e=a,t=m(()=>e.autarchy?e.yScale(e.item.energy)-25:e.yScale(e.item.energy)-10),r=m(()=>{let u=16,p=e.barcount;return p<=5?u=16:p==6?u=14:p>6&&p<=8?u=13:p==9?u=11:p==10?u=10:u=9,u}),s=m(()=>{let u=12,p=e.barcount;return p<=5?u=12:p==6?u=11:p>6&&p<=8||p==9?u=8:p==10?u=7:u=6,u});function o(u,p){return p.length>s.value?p.substring(0,s.value)+".":p}function h(){return e.autarchy?e.autText+": "+e.autarchy.toLocaleString(void 0)+" %":""}function d(){return"var(--color-pv)"}return(u,p)=>(l(),f("g",{id:"barlabel-"+e.item.name},[n("text",{x:e.xScale(u.item.name)+e.xScale.bandwidth()/2,y:t.value,"font-size":r.value,"text-anchor":"middle",fill:"var(--color-menu)"},S(i(ct)(u.item.energy,i(g).decimalPlaces,!1)),9,Bo),n("text",{x:e.xScale(u.item.name)+e.xScale.bandwidth()/2,y:e.yScale(u.item.energy)-10,"font-size":r.value-2,"text-anchor":"middle",fill:d()},S(h()),9,Vo),n("text",{x:e.xScale(u.item.name)+e.xScale.bandwidth()/2,y:e.height-e.margin.bottom-5,"font-size":r.value,"text-anchor":"middle",fill:u.item.color,class:q(u.item.icon.length<=2?"fas":"")},S(o(u.item.name,u.item.icon)),11,Lo)],8,Co))}}),Ao={id:"emBarLabels"},To=L({__name:"EMLabels",props:{plotdata:{},xScale:{},yScale:{},height:{},margin:{}},setup(a){const e=a;function t(s){if(s.name=="PV"){const o=y.graphMode=="live"||y.graphMode=="today"?Q:T.items,d=(y.graphMode=="live"||y.graphMode=="today"?U:T.items).evuOut.energy,u=o.pv.energy;return Math.round((u-d)/u*100)}else if(s.name=="Netz"){const o=y.graphMode=="live"||y.graphMode=="today"?Q:T.items,h=y.graphMode=="live"||y.graphMode=="today"?U:T.items,d=h.evuOut.energy,u=o.evuIn.energy,p=o.pv.energy,c=o.batOut.energy,k=h.batIn.energy;return p+c-d-k>0?Math.round((p+c-d-k)/(p+c+u-d-k)*100):0}else return s.pvPercentage}function r(s){return s.name=="PV"?"Eigen":"Aut"}return(s,o)=>(l(),f("g",Ao,[(l(!0),f(F,null,te(e.plotdata,(h,d)=>(l(),f("g",{key:d},[v(Oo,{item:h,"x-scale":e.xScale,"y-scale":e.yScale,margin:e.margin,height:e.height,barcount:e.plotdata.length,"aut-text":r(h),autarchy:t(h)},null,8,["item","x-scale","y-scale","margin","height","barcount","aut-text","autarchy"])]))),128))]))}}),Eo={class:"d-flex justify-content-end"},zo={id:"energymeter",class:"p-0 m-0"},Wo={viewBox:"0 0 500 500"},Do=["transform"],Go=["x"],jo={key:0},ma=500,Lt=500,fa=12,Uo="Energie",Fo=L({__name:"EnergyMeter",setup(a){const e={top:25,bottom:30,left:25,right:0},t=m(()=>{let u=Object.values(Q),p=o.value;const c=T.items;let k=[];switch(g.debug&&h(),lt.value==!0&&(lt.value=!1),y.graphMode){default:case"live":case"today":k=u.concat(p);break;case"day":case"month":case"year":Object.values(c).length==0?qe.value=!0:(qe.value=!1,k=[c.evuIn,c.pv,c.evuOut,c.batOut,c.charging],Object.values(O).length>1&&Object.keys(O).forEach(P=>{c["cp"+P]&&k.push(c["cp"+P])}),k.push(c.devices),ae.forEach((P,z)=>{P.showInGraph&&c["sh"+z]&&k.push(c["sh"+z])}),k=k.concat([c.batIn,c.house]))}return k.filter(P=>P.energy&&P.energy>0)}),r=m(()=>xt().range([0,ma-e.left-e.right]).domain(t.value.map(u=>u.name)).padding(.4)),s=m(()=>He().range([Lt-e.bottom-e.top,15]).domain([0,Sa(t.value,u=>u.energy)])),o=m(()=>{const u=Object.values(O).length,p=[...ae.values()].filter(k=>k.configured).length;let c=U;return[...[c.evuOut,c.charging].concat(u>1?Object.values(O).map(k=>k.toPowerItem()):[]),...[c.devices].concat(p>1?[...ae.values()].filter(k=>k.configured&&k.showInGraph):[]).concat([U.batIn,U.house])]});function h(){console.debug(["source summary:",Q]),console.debug(["usage details:",o.value]),console.debug(["historic summary:",T])}function d(){g.zoomedWidget=2,g.zoomGraph=!g.zoomGraph}return(u,p)=>(l(),$(_t,{"full-width":!0},{title:_(()=>[H(S(Uo))]),buttons:_(()=>[n("div",Eo,[v(na,{widgetid:"graphsettings","show-left-button":!0,"show-right-button":!0,"ignore-live":!0,onShiftLeft:i(It),onShiftRight:i(Kt),onShiftUp:i(ea),onShiftDown:i(ta)},null,8,["onShiftLeft","onShiftRight","onShiftUp","onShiftDown"]),i(De)?(l(),f("span",{key:0,type:"button",class:"ms-1 p-0 pt-1",onClick:d},p[0]||(p[0]=[n("span",{class:"fa-solid fa-lg ps-1 fa-magnifying-glass"},null,-1)]))):w("",!0)])]),default:_(()=>[n("figure",zo,[(l(),f("svg",Wo,[n("g",{transform:"translate("+e.left+","+e.top+")"},[v($o,{plotdata:t.value,"x-scale":r.value,"y-scale":s.value,height:Lt,margin:e},null,8,["plotdata","x-scale","y-scale"]),v(Io,{"y-scale":s.value,width:ma,fontsize:fa,config:i(g)},null,8,["y-scale","config"]),n("text",{x:-e.left,y:"-15",fill:"var(--color-axis)","font-size":fa},S(i(y).graphMode=="year"?"MWh":"kWh"),9,Go),v(To,{plotdata:t.value,"x-scale":r.value,"y-scale":s.value,height:Lt,margin:e,config:i(g)},null,8,["plotdata","x-scale","y-scale","config"])],8,Do)]))]),i(qe)?(l(),f("p",jo,"No data")):w("",!0)]),_:1}))}}),No=R(Fo,[["__scopeId","data-v-32c82102"]]),Ho=["id"],Ro=["y","width","fill"],Jo=["y","width"],Yo=["y","x","width"],qo=L({__name:"EnergyBar",props:{id:{},item:{},yScale:{},xScale:{},itemHeight:{}},setup(a){const e=a,t=m(()=>e.xScale(e.item.energy)),r=m(()=>{let o=0;return e.item.energyPv>0&&(o=e.xScale(e.item.energyPv)),o>t.value&&(o=t.value),o}),s=m(()=>{let o=0;return e.item.energyBat>0&&(o=e.xScale(e.item.energyBat)),o>t.value&&(o=t.value),o});return(o,h)=>(l(),f("g",{id:`bar-${e.item.name}`},[n("rect",{class:"bar",y:e.yScale(e.id)+e.itemHeight/2-4,x:"0",rx:"6",ry:"6",height:"12",width:t.value,fill:o.item.color},null,8,Ro),n("rect",{class:"bar",y:e.yScale(e.id)+e.itemHeight/2+10,x:"0",rx:"3",ry:"3",height:"7",width:r.value,fill:"var(--color-pv)","fill-opacity":"100%"},null,8,Jo),n("rect",{class:"bar",y:e.yScale(e.id)+e.itemHeight/2+10,x:r.value,rx:"3",ry:"3",height:"7",width:s.value,fill:"var(--color-battery)","fill-opacity":"100%"},null,8,Yo)],8,Ho))}}),Qo={id:"emBargraph"},Zo=L({__name:"BarGraph",props:{plotdata:{},yscale:{},xscale:{},itemHeight:{}},setup(a){const e=a;return(t,r)=>(l(),f("g",Qo,[(l(!0),f(F,null,te(e.plotdata,(s,o)=>(l(),f("g",{key:o},[v(qo,{id:o.toString(),item:s,"x-scale":e.xscale,"y-scale":e.yscale,"item-height":t.itemHeight},null,8,["id","item","x-scale","y-scale","item-height"])]))),128))]))}}),Xo=["id"],Ko=["y","x","fill"],es=["y","x"],ts=["y","x","font-size"],Ot=24,as=L({__name:"EnergyLabel",props:{id:{},item:{},yscale:{},margin:{},width:{},itemHeight:{},autarchy:{},autText:{}},setup(a){const e=a,t=m(()=>e.yscale(e.id)+e.itemHeight/3);function r(){return e.autarchy?e.autText+": "+e.autarchy.toLocaleString(void 0)+" %":""}function s(o){return o.length>14?o.slice(0,13)+"...":o}return(o,h)=>(l(),f("g",{id:"barlabel-"+e.id},[n("text",{y:t.value,x:e.margin.left,"font-size":Ot,"text-anchor":"start",fill:o.item.color,class:q(o.item.icon.length<=2?"fas":"")},S(s(e.item.icon)),11,Ko),n("text",{y:t.value,x:e.width/2+e.margin.left,"font-size":Ot,"text-anchor":"middle",fill:"var(--color-menu)"},S(i(ct)(o.item.energy,i(g).decimalPlaces,!1)),9,es),n("text",{y:t.value,x:e.width-e.margin.right,"font-size":Ot-2,"text-anchor":"end",fill:"var(--color-pv)"},S(r()),9,ts)],8,Xo))}}),ns={id:"emBarLabels"},rs=L({__name:"EnergyLabels",props:{plotdata:{},yscale:{},width:{},itemHeight:{},margin:{}},setup(a){const e=a;function t(s){if(s.name=="PV"){const o=y.graphMode=="live"||y.graphMode=="today"?Q:T.items,d=(y.graphMode=="live"||y.graphMode=="today"?U:T.items).evuOut.energy,u=o.pv.energy;return Math.round((u-d)/u*100)}else if(s.name=="Netz"){const o=y.graphMode=="live"||y.graphMode=="today"?Q:T.items,h=y.graphMode=="live"||y.graphMode=="today"?U:T.items,d=h.evuOut.energy,u=o.evuIn.energy,p=o.pv.energy,c=o.batOut.energy,k=h.batIn.energy;return p+c-d-k>0?Math.round((p+c-d-k)/(p+c+u-d-k)*100):0}else return s.pvPercentage}function r(s){return s.name=="PV"?"Eigen":"Aut"}return(s,o)=>(l(),f("g",ns,[(l(!0),f(F,null,te(e.plotdata,(h,d)=>(l(),f("g",{key:d},[v(as,{id:d.toString(),item:h,yscale:e.yscale,margin:e.margin,width:e.width,"item-height":s.itemHeight,"aut-text":r(h),autarchy:t(h)},null,8,["id","item","yscale","margin","width","item-height","aut-text","autarchy"])]))),128))]))}});class os{constructor(e){b(this,"id");b(this,"name","Speicher");b(this,"color","var(--color-battery)");b(this,"dailyYieldExport",0);b(this,"dailyYieldImport",0);b(this,"monthlyYieldExport",0);b(this,"monthlyYieldImport",0);b(this,"yearlyYieldExport",0);b(this,"yearlyYieldImport",0);b(this,"exported",0);b(this,"faultState",0);b(this,"faultStr","");b(this,"imported",0);b(this,"power",0);b(this,"soc",0);this.id=e}}class ss{constructor(){b(this,"dailyExport",0);b(this,"dailyImport",0);b(this,"exported",0);b(this,"imported",0);b(this,"power",0);b(this,"soc",0)}}le(new ss);const he=ee(new Map),Aa=a=>{he.value.set(a,new os(a)),he.value.get(a).color=ie["bat"+he.value.size].color};function is(){he.value=new Map}const ls={class:"d-flex justify-content-end"},cs={id:"energymeter",class:"p-0 m-0"},us=["viewBox"],ds=["transform"],hs=["x"],ps={key:0},va=500,At=60,gs=12,ms="Energie",fs=L({__name:"EnergyMeter2",setup(a){const e={top:0,bottom:30,left:0,right:0},t=m(()=>r.value.length*At+e.top+e.bottom),r=m(()=>{let c=Object.values(Q),k=h.value;const P=T.items;let z=[];switch(g.debug&&u(),lt.value==!0&&(lt.value=!1),y.graphMode){default:case"live":case"today":z=d(c).concat(k);break;case"day":case"month":case"year":Object.values(P).length==0?qe.value=!0:(qe.value=!1,z=[P.evuIn,P.pv,P.evuOut,P.batOut,P.charging],Object.values(O).length>1&&Object.keys(O).forEach(D=>{P["cp"+D]&&z.push(P["cp"+D])}),z.push(P.devices),ae.forEach((D,B)=>{D.showInGraph&&P["sh"+B]&&z.push(P["sh"+B])}),z=z.concat([P.batIn,P.house]))}return z.filter(D=>D.energy&&D.energy>0)}),s=m(()=>He().range([0,va-e.left-e.right]).domain([0,Sa(r.value,c=>c.energy)])),o=m(()=>xt().range([e.top,t.value-e.bottom]).domain(r.value.map((c,k)=>k.toString())).padding(.1)),h=m(()=>{const c=Object.values(O).length,k=[...ae.values()].filter(z=>z.configured).length;let P=U;return[...[P.evuOut,P.charging].concat(c>1?Object.values(O).map(z=>z.toPowerItem()):[]),...[P.devices].concat(k>1?[...ae.values()].filter(z=>z.configured&&z.showInGraph):[]).concat([U.batIn,U.house])]});function d(c){let k=0;return we.value.size>1&&we.value.forEach(P=>{c.splice(2+k++,0,{name:P.name,power:P.power,energy:P.energy,energyPv:0,energyBat:0,pvPercentage:0,color:P.color,icon:P.name,showInGraph:!0})}),he.value.size>1&&he.value.forEach(P=>{c.splice(3+k++,0,{name:P.name,power:P.power,energy:P.dailyYieldExport,energyPv:0,energyBat:0,pvPercentage:0,color:P.color,icon:P.name,showInGraph:!0})}),c}function u(){console.debug(["source summary:",Q]),console.debug(["usage details:",h.value]),console.debug(["historic summary:",T])}function p(){g.zoomedWidget=2,g.zoomGraph=!g.zoomGraph}return(c,k)=>(l(),$(_t,{"full-width":!0},{title:_(()=>[H(S(ms))]),buttons:_(()=>[n("div",ls,[v(na,{widgetid:"graphsettings","show-left-button":!0,"show-right-button":!0,"ignore-live":!0,onShiftLeft:i(It),onShiftRight:i(Kt),onShiftUp:i(ea),onShiftDown:i(ta)},null,8,["onShiftLeft","onShiftRight","onShiftUp","onShiftDown"]),i(De)?(l(),f("span",{key:0,type:"button",class:"ms-1 p-0 pt-1",onClick:p},k[0]||(k[0]=[n("span",{class:"fa-solid fa-lg ps-1 fa-magnifying-glass"},null,-1)]))):w("",!0)])]),default:_(()=>[n("figure",cs,[(l(),f("svg",{viewBox:"0 0 500 "+t.value},[n("g",{transform:"translate("+e.left+","+e.top+")"},[v(Zo,{plotdata:r.value,xscale:s.value,yscale:o.value,"item-height":At},null,8,["plotdata","xscale","yscale"]),n("text",{x:-e.left,y:"-15",fill:"var(--color-axis)","font-size":gs},S(i(y).graphMode=="year"?"MWh":"kWh"),9,hs),v(rs,{plotdata:r.value,yscale:o.value,width:va,"item-height":At,margin:e},null,8,["plotdata","yscale"])],8,ds)],8,us))]),i(qe)?(l(),f("p",ps,"No data")):w("",!0)]),_:1}))}}),vs=R(fs,[["__scopeId","data-v-63a4748e"]]),ys={class:"d-flex flex-column align-items-center justify-content-start infoitem"},bs=L({__name:"InfoItem",props:{heading:{},small:{type:Boolean}},setup(a){const e=a,t=m(()=>e.small?{"font-size":"var(--font-small)"}:{"font-size":"var(--font-small)"}),r=m(()=>e.small?{"font-size":"var(--font-small)"}:{"font-size":"var(--font-normal)"}),s=m(()=>e.small?"mt-0":"mt-1");return(o,h)=>(l(),f("span",ys,[n("span",{class:q(["d-flex heading",s.value]),style:K(t.value)},S(e.heading),7),n("span",{class:"d-flex my-0 me-0 align-items-center content",style:K(r.value)},[pe(o.$slots,"default",{},void 0,!0)],4)]))}}),X=R(bs,[["__scopeId","data-v-f6af00e8"]]),_s={class:"d-flex justify-content-between align-items-center titlerow"},ws={class:"buttonrea d-flex float-right justify-content-end align-items-center"},ks={class:"contentrow grid-col-12"},xs=L({__name:"WbSubwidget",props:{titlecolor:{},fullwidth:{type:Boolean},small:{type:Boolean}},setup(a){const e=a,t=m(()=>{let s={"font-weight":"bold",color:"var(--color-fg)","font-size":"var(--font-normal)"};return e.titlecolor&&(s.color=e.titlecolor),e.small&&(s["font-size"]="var(--font-verysmall)"),s}),r=m(()=>e.fullwidth?"grid-col-12":"grid-col-4");return(s,o)=>(l(),f("div",{class:q(["wb-subwidget px-3 pt-2 my-0",r.value])},[n("div",_s,[n("div",{class:"d-flex widgetname p-0 m-0",style:K(t.value)},[pe(s.$slots,"title",{},void 0,!0)],4),n("div",ws,[pe(s.$slots,"buttons",{},void 0,!0)])]),n("div",ks,[pe(s.$slots,"default",{},void 0,!0)])],2))}}),tt=R(xs,[["__scopeId","data-v-e989060d"]]),Ss={class:"grid-col-12 mt-2 mb-0 px-0 py-0 configitem"},Ms={class:"titlecolumn m-0 p-0 d-flex align-items-center"},$s={class:"ms-1 mb-2 p-0 pt-2 d-flex justify-content-stretch align-items-center"},Ps={class:"justify-content-stretch d-flex"},Is=L({__name:"ConfigItem",props:{title:{},infotext:{},icon:{},fullwidth:{type:Boolean}},setup(a){const e=a,t=ee(!1);function r(){t.value=!t.value}const s=m(()=>{let o={color:"var(--color-charging)"};return t.value&&(o.color="var(--color-battery)"),o});return(o,h)=>(l(),$(tt,{fullwidth:!!o.fullwidth},{default:_(()=>[n("div",Ss,[n("div",Ms,[n("span",{class:"d-flex align-items-baseline m-0 p-0",onClick:r},[e.icon?(l(),f("i",{key:0,class:q(["fa-solid fa-sm m-0 p-0 me-2 item-icon",e.icon])},null,2)):w("",!0),H(" "+S(o.title),1)]),n("span",null,[e.infotext?(l(),f("i",{key:0,class:"fa-solid fa-sm fa-circle-question ms-4 me-2",style:K(s.value),onClick:r},null,4)):w("",!0)])]),t.value?(l(),f("p",{key:0,class:"infotext shadow m-0 ps-2 mb-1 p-1",onClick:r},[h[0]||(h[0]=n("i",{class:"me-1 fa-solid fa-sm fa-circle-info"},null,-1)),H(" "+S(o.infotext),1)])):w("",!0),n("div",$s,[n("span",Ps,[pe(o.$slots,"default",{},void 0,!0)])])])]),_:3},8,["fullwidth"]))}}),N=R(Is,[["__scopeId","data-v-b935eb33"]]),Cs={class:"d-flex flex-column"},Bs={class:"d-flex flex-fill justify-content-between align-items-center"},Vs={class:"d-flex flex-fill flex-column justify-content-center m-0 p-0"},Ls={key:0,id:"rangeIndicator",class:"rangeIndicator"},Os={viewBox:"0 0 100 2"},As=["width"],Ts=["x","width"],Es=["x","width"],zs=["id","min","max","step"],Ws={class:"d-flex justify-content-between align-items-center"},Ds={class:"minlabel ps-4"},Gs={class:"valuelabel"},js={class:"maxlabel pe-4"},Us=L({__name:"RangeInput",props:{id:{},min:{},max:{},step:{},unit:{},decimals:{},showSubrange:{type:Boolean},subrangeMin:{},subrangeMax:{},modelValue:{}},emits:["update:modelValue"],setup(a,{emit:e}){const t=a,r=t.decimals??0,s=e,o=m({get(){return Math.round(t.modelValue*Math.pow(10,r))/Math.pow(10,r)},set(k){s("update:modelValue",k)}});function h(){o.value>t.min&&(o.value=Math.round((o.value-t.step)*Math.pow(10,r))/Math.pow(10,r))}function d(){o.valueHe().domain([t.min,t.max]).range([0,100])),p=m(()=>u.value(t.subrangeMin?t.subrangeMin:0)),c=m(()=>t.subrangeMin&&t.subrangeMax?u.value(t.subrangeMax)-u.value(t.subrangeMin):0);return(k,P)=>(l(),f("span",Cs,[n("span",Bs,[n("span",{type:"button",class:"minusButton",onClick:h},P[1]||(P[1]=[n("i",{class:"fa fa-xl fa-minus-square me-2"},null,-1)])),n("div",Vs,[t.showSubrange?(l(),f("figure",Ls,[(l(),f("svg",Os,[n("g",null,[n("rect",{class:"below",x:0,y:"0",width:p.value,height:"2",rx:"1",ry:"1",fill:"var(--color-evu)"},null,8,As),n("rect",{class:"bar",x:p.value,y:"0",width:c.value,height:"2",rx:"1",ry:"1",fill:"var(--color-charging)"},null,8,Ts),n("rect",{class:"above",x:p.value+c.value,y:"0",width:p.value,height:"2",rx:"1",ry:"1",fill:"var(--color-pv)"},null,8,Es)])]))])):w("",!0),vt(n("input",{id:k.id,"onUpdate:modelValue":P[0]||(P[0]=z=>o.value=z),type:"range",class:"form-range flex-fill",min:k.min,max:k.max,step:k.step},null,8,zs),[[Za,o.value,void 0,{number:!0}]])]),n("span",{type:"button",class:"plusButton",onClick:d},P[2]||(P[2]=[n("i",{class:"fa fa-xl fa-plus-square ms-2"},null,-1)]))]),n("span",Ws,[n("span",Ds,S(k.min),1),n("span",Gs,S(o.value)+" "+S(k.unit),1),n("span",js,S(k.max),1)])]))}}),Me=R(Us,[["__scopeId","data-v-267ede95"]]),Fs=["id","value"],Ns=L({__name:"RadioInput",props:{options:{},modelValue:{}},emits:["update:modelValue"],setup(a,{emit:e}){const t=a,r=e,s=m({get(){return t.modelValue},set(d){r("update:modelValue",d)}});function o(d){return t.options[d][2]?{color:t.options[d][2]}:{color:"var(--color-fg)"}}function h(d){let u=d.target;for(;u&&!u.value&&u.parentElement;)u=u.parentElement;u.value&&(s.value=u.value)}return(d,u)=>(l(),f("div",null,[(l(!0),f(F,null,te(d.options,(p,c)=>(l(),f("button",{id:"radio-"+p[1],key:c,class:q(["btn btn-outline-secondary radiobutton me-2 mb-0 px-2",p[1]==s.value?"active":""]),value:p[1],style:K(o(c)),onClick:h},[n("span",{style:K(o(c))},[p[3]?(l(),f("i",{key:0,class:q(["fa-solid",p[3]])},null,2)):w("",!0),H(" "+S(p[0]),1)],4)],14,Fs))),128))]))}}),We=R(Ns,[["__scopeId","data-v-df222cbe"]]),Hs={class:"mt-2"},Rs={key:0},Js=L({__name:"CPConfigInstant",props:{chargepoint:{}},setup(a){const t=ee(a.chargepoint),r=[{name:"keine",id:"none"},{name:"EV-SoC",id:"soc"},{name:"Energiemenge",id:"amount"}],s=m({get(){return t.value.instantMaxEnergy/1e3},set(o){t.value.instantMaxEnergy=o*1e3}});return(o,h)=>(l(),f("div",Hs,[h[4]||(h[4]=n("p",{class:"heading ms-1"},"Sofortladen:",-1)),v(N,{title:"Stromstärke",icon:"fa-bolt",fullwidth:!0},{default:_(()=>[v(Me,{id:"targetCurrent",modelValue:t.value.instantTargetCurrent,"onUpdate:modelValue":h[0]||(h[0]=d=>t.value.instantTargetCurrent=d),min:6,max:32,step:1,unit:"A"},null,8,["modelValue"])]),_:1}),t.value.instantChargeLimitMode!="none"?(l(),f("hr",Rs)):w("",!0),v(N,{title:"Begrenzung",icon:"fa-hand",fullwidth:!0},{default:_(()=>[v(We,{modelValue:t.value.instantChargeLimitMode,"onUpdate:modelValue":h[1]||(h[1]=d=>t.value.instantChargeLimitMode=d),options:r.map(d=>[d.name,d.id])},null,8,["modelValue","options"])]),_:1}),t.value.instantChargeLimitMode=="soc"?(l(),$(N,{key:1,title:"Maximaler SoC",icon:"fa-sliders",fullwidth:!0},{default:_(()=>[v(Me,{id:"maxSoc",modelValue:t.value.instantTargetSoc,"onUpdate:modelValue":h[2]||(h[2]=d=>t.value.instantTargetSoc=d),min:0,max:100,step:1,unit:"%"},null,8,["modelValue"])]),_:1})):w("",!0),t.value.instantChargeLimitMode=="amount"?(l(),$(N,{key:2,title:"Zu ladende Energie",icon:"fa-sliders",fullwidth:!0},{default:_(()=>[v(Me,{id:"maxEnergy",modelValue:s.value,"onUpdate:modelValue":h[3]||(h[3]=d=>s.value=d),min:0,max:100,step:1,unit:"kWh"},null,8,["modelValue"])]),_:1})):w("",!0)]))}}),Ys=R(Js,[["__scopeId","data-v-0303d179"]]),qs={class:"form-check form-switch"},se=L({__name:"SwitchInput",props:{modelValue:{type:Boolean},onColor:{},offColor:{}},emits:["update:modelValue"],setup(a,{emit:e}){const t=a,r=e,s=m({get(){return t.modelValue},set(h){r("update:modelValue",h)}}),o=m(()=>s.value?{"background-color":"green"}:{"background-color":"white"});return(h,d)=>(l(),f("div",qs,[vt(n("input",{"onUpdate:modelValue":d[0]||(d[0]=u=>s.value=u),class:"form-check-input",type:"checkbox",role:"switch",style:K(o.value)},null,4),[[Ma,s.value]])]))}}),Qs={class:"pt-2"},Zs={key:3},Xs=L({__name:"CPConfigPv",props:{chargepoint:{}},setup(a){const t=ee(a.chargepoint),r=m({get(){return t.value.pvMinCurrent>5},set(h){h?t.value.pvMinCurrent=6:t.value.pvMinCurrent=0}}),s=m({get(){return t.value.pvMinSoc>0},set(h){h?t.value.pvMinSoc=50:t.value.pvMinSoc=0}}),o=m({get(){return t.value.pvMaxSoc<=100},set(h){h?t.value.pvMaxSoc=100:t.value.pvMaxSoc=101}});return(h,d)=>(l(),f("div",Qs,[d[8]||(d[8]=n("p",{class:"heading ms-1"},"PV-Laden:",-1)),v(N,{title:"Ladestand begrenzen",icon:"fa-battery-three-quarters",fullwidth:!0},{default:_(()=>[v(se,{id:"limitSoc",modelValue:o.value,"onUpdate:modelValue":d[0]||(d[0]=u=>o.value=u)},null,8,["modelValue"])]),_:1}),o.value?(l(),$(N,{key:0,title:"...auf maximal...",icon:"fa-battery-three-quarters",fullwidth:!0},{default:_(()=>[v(Me,{id:"maxSoc",modelValue:t.value.pvMaxSoc,"onUpdate:modelValue":d[1]||(d[1]=u=>t.value.pvMaxSoc=u),min:0,max:100,step:1,unit:"%"},null,8,["modelValue"])]),_:1})):w("",!0),v(N,{title:"Einspeisegrenze beachten",icon:"fa-hand",fullwidth:!0},{default:_(()=>[v(se,{modelValue:t.value.pvFeedInLimit,"onUpdate:modelValue":d[2]||(d[2]=u=>t.value.pvFeedInLimit=u)},null,8,["modelValue"])]),_:1}),v(N,{title:"Mindest-Ladestand",icon:"fa-battery-half",infotext:i(Te).minsoc,fullwidth:!0},{default:_(()=>[v(se,{modelValue:s.value,"onUpdate:modelValue":d[3]||(d[3]=u=>s.value=u)},null,8,["modelValue"])]),_:1},8,["infotext"]),s.value?(l(),$(N,{key:1,title:"...bis SoC",fullwidth:!0},{info:_(()=>[H(S(i(Te).minsoc),1)]),default:_(()=>[v(Me,{id:"minSoc",modelValue:t.value.pvMinSoc,"onUpdate:modelValue":d[4]||(d[4]=u=>t.value.pvMinSoc=u),min:0,max:100,step:1,unit:"%"},null,8,["modelValue"])]),_:1})):w("",!0),s.value?(l(),$(N,{key:2,title:"...mit Ladestrom",fullwidth:!0},{default:_(()=>[v(Me,{id:"minSocCurrent",modelValue:t.value.pvMinSocCurrent,"onUpdate:modelValue":d[5]||(d[5]=u=>t.value.pvMinSocCurrent=u),min:6,max:32,step:1,unit:"A"},null,8,["modelValue"])]),_:1})):w("",!0),r.value||s.value?(l(),f("hr",Zs)):w("",!0),v(N,{title:"Minimaler Ladestrom",icon:"fa-bolt",infotext:i(Te).minpv,fullwidth:!0},{default:_(()=>[v(se,{modelValue:r.value,"onUpdate:modelValue":d[6]||(d[6]=u=>r.value=u)},null,8,["modelValue"])]),_:1},8,["infotext"]),r.value?(l(),$(N,{key:4,title:"...bei Ladestrom (minimal)",fullwidth:!0},{default:_(()=>[v(Me,{id:"minCurrent",modelValue:t.value.pvMinCurrent,"onUpdate:modelValue":d[7]||(d[7]=u=>t.value.pvMinCurrent=u),min:6,max:32,step:1,unit:"A"},null,8,["modelValue"])]),_:1})):w("",!0)]))}}),Ks=R(Xs,[["__scopeId","data-v-faa69015"]]),ei={class:"table table-borderless"},ti={class:"tablecell"},ai={class:"tablecell"},ni={class:"tablecell"},ri={class:"tablecell"},oi={class:"tablecell left"},si=["href"],ii=L({__name:"CPConfigScheduled",props:{chargeTemplateId:{}},setup(a){const e={daily:"Täglich",once:"Einmal",weekly:"Wöchentlich"},t=a,r=m(()=>{let d=[];return pt[t.chargeTemplateId]&&(d=Object.values(pt[t.chargeTemplateId])),d});function s(d){return r.value[d].time}function o(d){return{color:r.value[d].active?"var(--color-switchGreen)":"var(--color-switchRed)"}}function h(d){return{"font-weight":r.value[d].active?"bold":"regular"}}return(d,u)=>(l(),f(F,null,[u[1]||(u[1]=n("p",{class:"heading ms-1 pt-2"},"Zielladen:",-1)),n("table",ei,[u[0]||(u[0]=n("thead",null,[n("tr",null,[n("th",{class:"tableheader"},"Ziel"),n("th",{class:"tableheader"},"Limit"),n("th",{class:"tableheader"},"Zeit"),n("th",{class:"tableheader"},"Wiederholung"),n("th",{class:"tableheader"})])],-1)),n("tbody",null,[(l(!0),f(F,null,te(r.value,(p,c)=>(l(),f("tr",{key:c,style:K(h(c))},[n("td",ti,S(p.limit.soc_scheduled)+"%",1),n("td",ai,S(p.limit.soc_limit)+"%",1),n("td",ni,S(s(c)),1),n("td",ri,S(e[p.frequency.selected]),1),n("td",oi,[n("a",{href:"../../settings/#/VehicleConfiguration/charge_template/"+t.chargeTemplateId},[n("span",{class:q([p.active?"fa-toggle-on":"fa-toggle-off","fa"]),style:K(o(c)),type:"button"},null,6)],8,si)])],4))),128))])])],64))}}),li=R(ii,[["__scopeId","data-v-e8f5ad9d"]]),ci={class:"table table-borderless"},ui={class:"tablecell"},di={class:"tablecell"},hi={class:"tablecell"},pi={class:"tablecell"},gi={class:"tablecell left"},mi=["href"],fi=L({__name:"CPConfigTimed",props:{chargeTemplateId:{}},setup(a){const e={daily:"Täglich",once:"Einmal",weekly:"Wöchentlich"},t=a,r=m(()=>gt[t.chargeTemplateId]?Object.values(gt[t.chargeTemplateId])??[]:[]);function s(h){return{color:r.value[h].active?"var(--color-switchGreen)":"var(--color-switchRed)"}}function o(h){return{"font-weight":r.value[h].active?"bold":"regular"}}return(h,d)=>(l(),f(F,null,[d[1]||(d[1]=n("p",{class:"heading ms-1 pt-2"},"Zeitpläne:",-1)),n("table",ci,[d[0]||(d[0]=n("thead",null,[n("tr",null,[n("th",{class:"tableheader"},"Von"),n("th",{class:"tableheader"},"Bis"),n("th",{class:"tableheader"},"Ladestrom"),n("th",{class:"tableheader"},"Wiederholung"),n("th",{class:"tableheader right"})])],-1)),n("tbody",null,[(l(!0),f(F,null,te(r.value,(u,p)=>(l(),f("tr",{key:p,style:K(o(p))},[n("td",ui,S(u.time[0]),1),n("td",di,S(u.time[1]),1),n("td",hi,S(u.current)+" A",1),n("td",pi,S(e[u.frequency.selected]),1),n("td",gi,[n("a",{href:"../../settings/#/VehicleConfiguration/charge_template/"+t.chargeTemplateId},[n("span",{class:q([u.active?"fa-toggle-on":"fa-toggle-off","fa"]),style:K(s(p)),type:"button"},null,6)],8,mi)])],4))),128))])])],64))}}),vi=R(fi,[["__scopeId","data-v-192e287b"]]),yi={class:"settingsheader mt-2 ms-1"},bi=L({__name:"CPConfigVehicle",props:{vehicleId:{}},setup(a){const e=a;return(t,r)=>(l(),f(F,null,[n("p",yi," Profile für "+S(i(Y)[e.vehicleId].name)+": ",1),v(N,{title:"Ladeprofil",icon:"fa-sliders",fullwidth:!0},{default:_(()=>[v(We,{modelValue:i(Y)[e.vehicleId].chargeTemplateId,"onUpdate:modelValue":r[0]||(r[0]=s=>i(Y)[e.vehicleId].chargeTemplateId=s),modelModifiers:{number:!0},options:Object.keys(i(_e)).map(s=>[i(_e)[+s].name,s])},null,8,["modelValue","options"])]),_:1}),v(N,{title:"Fahrzeug-Vorlage",icon:"fa-sliders",fullwidth:!0},{default:_(()=>[v(We,{modelValue:i(Y)[e.vehicleId].evTemplateId,"onUpdate:modelValue":r[1]||(r[1]=s=>i(Y)[e.vehicleId].evTemplateId=s),modelModifiers:{number:!0},options:Object.keys(i(Ht)).map(s=>[i(Ht)[+s].name,s])},null,8,["modelValue","options"])]),_:1})],64))}}),_i=R(bi,[["__scopeId","data-v-fcb57a44"]]),wi={class:"settingsheader mt-2 ms-1"},ki=L({__name:"CPChargeConfig",props:{chargepoint:{}},emits:["closeConfig"],setup(a){const t=a.chargepoint;return(r,s)=>(l(),f(F,null,[n("p",wi," Ladeeinstellungen für "+S(i(t).vehicleName)+": ",1),v(N,{title:"Lademodus",icon:"fa-charging-station",infotext:i(Te).chargemode,fullwidth:!0},{default:_(()=>[v(We,{modelValue:i(t).chargeMode,"onUpdate:modelValue":s[0]||(s[0]=o=>i(t).chargeMode=o),options:Object.keys(i(ye)).map(o=>[i(ye)[o].name,o,i(ye)[o].color,i(ye)[o].icon])},null,8,["modelValue","options"])]),_:1},8,["infotext"]),v(N,{title:"Fahrzeug wechseln",icon:"fa-car",infotext:i(Te).vehicle,fullwidth:!0},{default:_(()=>[v(We,{modelValue:i(t).connectedVehicle,"onUpdate:modelValue":s[1]||(s[1]=o=>i(t).connectedVehicle=o),modelModifiers:{number:!0},options:Object.values(i(Y)).filter(o=>o.visible).map(o=>[o.name,o.id])},null,8,["modelValue","options"])]),_:1},8,["infotext"]),v(N,{title:"Sperren",icon:"fa-lock",infotext:i(Te).locked,fullwidth:!0},{default:_(()=>[v(se,{modelValue:i(t).isLocked,"onUpdate:modelValue":s[2]||(s[2]=o=>i(t).isLocked=o)},null,8,["modelValue"])]),_:1},8,["infotext"]),v(N,{title:"Priorität",icon:"fa-star",infotext:i(Te).priority,fullwidth:!0},{default:_(()=>[v(se,{modelValue:i(t).hasPriority,"onUpdate:modelValue":s[3]||(s[3]=o=>i(t).hasPriority=o)},null,8,["modelValue"])]),_:1},8,["infotext"]),v(N,{title:"Zeitplan",icon:"fa-clock",infotext:i(Te).timeplan,fullwidth:!0},{default:_(()=>[v(se,{modelValue:i(t).timedCharging,"onUpdate:modelValue":s[4]||(s[4]=o=>i(t).timedCharging=o)},null,8,["modelValue"])]),_:1},8,["infotext"]),i(de).isBatteryConfigured?(l(),$(N,{key:0,title:"PV-Priorität",icon:"fa-car-battery",infotext:i(Te).pvpriority,fullwidth:!0},{default:_(()=>[v(We,{modelValue:i(de).pvBatteryPriority,"onUpdate:modelValue":s[5]||(s[5]=o=>i(de).pvBatteryPriority=o),options:i(cn)},null,8,["modelValue","options"])]),_:1},8,["infotext"])):w("",!0),i(re).active?(l(),$(N,{key:1,title:"Strompreisbasiert laden",icon:"fa-money-bill",infotext:i(Te).pricebased,fullwidth:!0},{default:_(()=>[v(se,{modelValue:i(t).etActive,"onUpdate:modelValue":s[6]||(s[6]=o=>i(t).etActive=o)},null,8,["modelValue"])]),_:1},8,["infotext"])):w("",!0)],64))}}),xi=R(ki,[["__scopeId","data-v-e348a34c"]]),Si={class:"providername ms-1"},Mi={class:"container"},$i={id:"pricechart",class:"p-0 m-0"},Pi={viewBox:"0 0 400 300"},Ii=["id","origin","transform"],Ci={key:0,class:"p-3"},Bi={key:1,class:"d-flex justify-content-end"},Vi=["disabled"],at=400,ya=250,ba=12,Li=L({__name:"PriceChart",props:{chargepoint:{},globalview:{type:Boolean}},setup(a){const e=a;let t=e.chargepoint?ee(e.chargepoint.etMaxPrice):ee(0);const r=ee(!1),s=ee(e.chargepoint),o=m({get(){return t.value},set(W){t.value=W,r.value=!0}});function h(){s.value&&(O[s.value.id].etMaxPrice=o.value),r.value=!1}const d=ee(!1),u={top:0,bottom:15,left:20,right:5},p=m(()=>{let W=[];return re.etPriceList.size>0&&re.etPriceList.forEach((Z,Oe)=>{W.push([Oe,Z])}),W}),c=m(()=>p.value.length>1?(at-u.left-u.right)/p.value.length-1:0),k=m(()=>r.value?{background:"var(--color-charging)"}:{background:"var(--color-menu)"}),P=m(()=>{let W=Ve(p.value,Z=>Z[0]);return W[1]&&(W[1]=new Date(W[1]),W[1].setTime(W[1].getTime()+36e5)),et().range([u.left,at-u.right]).domain(W)}),z=m(()=>{let W=[0,0];return p.value.length>0?(W=Ve(p.value,Z=>Z[1]),W[0]=Math.floor(W[0]-1),W[1]=Math.floor(W[1]+1)):W=[0,0],W}),D=m(()=>He().range([ya-u.bottom,0]).domain(z.value)),B=m(()=>{const W=Ne(),Z=[[u.left,D.value(o.value)],[at-u.right,D.value(o.value)]];return W(Z)}),A=m(()=>{const W=Ne(),Z=[[u.left,D.value(g.lowerPriceBound)],[at-u.right,D.value(g.lowerPriceBound)]];return W(Z)}),V=m(()=>{const W=Ne(),Z=[[u.left,D.value(g.upperPriceBound)],[at-u.right,D.value(g.upperPriceBound)]];return W(Z)}),J=m(()=>{const W=Ne(),Z=[[u.left,D.value(0)],[at-u.right,D.value(0)]];return W(Z)}),C=m(()=>ht(P.value).ticks(6).tickSize(5).tickFormat(st("%H:%M"))),M=m(()=>ft(D.value).ticks(z.value[1]-z.value[0]).tickSizeInner(-375).tickFormat(W=>W.toString())),E=m(()=>{d.value==!0;const W=ce("g#"+I.value);W.selectAll("*").remove(),W.selectAll("bar").data(p.value).enter().append("g").append("rect").attr("class","bar").attr("x",Qe=>P.value(Qe[0])).attr("y",Qe=>D.value(Qe[1])).attr("width",c.value).attr("height",Qe=>D.value(z.value[0])-D.value(Qe[1])).attr("fill",Qe=>Qe[1]<=o.value?"var(--color-charging)":"var(--color-axis)");const Oe=W.append("g").attr("class","axis").call(C.value);Oe.attr("transform","translate(0,"+(ya-u.bottom)+")"),Oe.selectAll(".tick").attr("font-size",ba).attr("color","var(--color-bg)"),Oe.selectAll(".tick line").attr("stroke","var(--color-fg)").attr("stroke-width","0.5"),Oe.select(".domain").attr("stroke","var(--color-bg");const wt=W.append("g").attr("class","axis").call(M.value);return wt.attr("transform","translate("+u.left+",0)"),wt.selectAll(".tick").attr("font-size",ba).attr("color","var(--color-bg)"),wt.selectAll(".tick line").attr("stroke","var(--color-bg)").attr("stroke-width","0.5"),wt.select(".domain").attr("stroke","var(--color-bg)"),z.value[0]<0&&W.append("path").attr("d",J.value).attr("stroke","var(--color-fg)"),W.append("path").attr("d",A.value).attr("stroke","green"),W.append("path").attr("d",V.value).attr("stroke","red"),W.append("path").attr("d",B.value).attr("stroke","yellow"),"PriceChart.vue"}),I=m(()=>e.chargepoint?"priceChartCanvas"+e.chargepoint.id:"priceChartCanvasGlobal"),x=m(()=>{let W=[];return re.etPriceList.forEach(Z=>{W.push(Z)}),W.sort((Z,Oe)=>Z-Oe)});function G(){let W=x.value[0];for(let Z of x.value){if(Z>=o.value)break;W=Z}o.value=W}function xe(){let W=x.value[0];for(let Z of x.value)if(Z>o.value){W=Z;break}else W=Z;o.value=W}return Le(()=>{d.value=!d.value}),(W,Z)=>(l(),f(F,null,[Z[3]||(Z[3]=n("p",{class:"settingsheader mt-2 ms-1"},"Preisbasiertes Laden:",-1)),n("p",Si,"Anbieter: "+S(i(re).etProvider),1),Z[4]||(Z[4]=n("hr",null,null,-1)),n("div",Mi,[n("figure",$i,[(l(),f("svg",Pi,[n("g",{id:I.value,origin:E.value,transform:"translate("+u.top+","+u.right+")"},null,8,Ii)]))])]),W.chargepoint!=null?(l(),f("div",Ci,[W.chargepoint.etActive?(l(),$(Me,{key:0,id:"pricechart_local",modelValue:o.value,"onUpdate:modelValue":Z[0]||(Z[0]=Oe=>o.value=Oe),min:Math.floor(x.value[0]-1),max:Math.ceil(x.value[x.value.length-1]+1),step:.1,decimals:1,"show-subrange":!0,"subrange-min":x.value[0],"subrange-max":x.value[x.value.length-1],unit:"ct"},null,8,["modelValue","min","max","subrange-min","subrange-max"])):w("",!0)])):w("",!0),n("div",{class:"d-flex justify-content-between px-3 pb-2 pt-0 mt-0"},[n("button",{type:"button",class:"btn btn-sm jumpbutton",onClick:G},Z[1]||(Z[1]=[n("i",{class:"fa fa-sm fa-arrow-left"},null,-1)])),n("button",{type:"button",class:"btn btn-sm jumpbutton",onClick:xe},Z[2]||(Z[2]=[n("i",{class:"fa fa-sm fa-arrow-right"},null,-1)]))]),W.chargepoint!=null?(l(),f("div",Bi,[n("span",{class:"me-3 pt-0",onClick:h},[n("button",{type:"button",class:"btn btn-secondary",style:K(k.value),disabled:!r.value}," Bestätigen ",12,Vi)])])):w("",!0)],64))}}),Ta=R(Li,[["__scopeId","data-v-8d837517"]]),Oi={class:"status-string"},Ai={style:{color:"red"}},Ti={class:"m-0 mt-4 p-0 grid-col-12 tabarea"},Ei={class:"nav nav-tabs nav-justified mx-1 mt-1",role:"tablist"},zi=["data-bs-target"],Wi=["data-bs-target"],Di=["data-bs-target"],Gi=["data-bs-target"],ji=["data-bs-target"],Ui=["data-bs-target"],Fi=["data-bs-target"],Ni={id:"settingsPanes",class:"tab-content mx-1 p-1 pb-3"},Hi=["id"],Ri=["id"],Ji=["id"],Yi=["id"],qi=["id"],Qi=["id"],Zi=["id"],Xi=L({__name:"CPChargeConfigPanel",props:{chargepoint:{}},emits:["closeConfig"],setup(a){const t=a.chargepoint,r=m(()=>_e[t.chargeTemplate]),s=m(()=>t.id);return Le(()=>{}),(o,h)=>(l(),f(F,null,[v(N,{title:"Status",icon:"fa-info-circle",fullwidth:!0,class:"item"},{default:_(()=>[n("span",Oi,S(i(t).stateStr),1)]),_:1}),i(t).faultState!=0?(l(),$(N,{key:0,title:"Fehler",class:"grid-col-12",icon:"fa-triangle-exclamation"},{default:_(()=>[n("span",Ai,S(i(t).faultStr),1)]),_:1})):w("",!0),n("div",Ti,[n("nav",Ei,[n("a",{class:"nav-link active","data-bs-toggle":"tab","data-bs-target":"#chargeSettings"+s.value},h[0]||(h[0]=[n("i",{class:"fa-solid fa-charging-station"},null,-1)]),8,zi),o.chargepoint.chargeMode=="instant_charging"?(l(),f("a",{key:0,class:"nav-link","data-bs-toggle":"tab","data-bs-target":"#instantSettings"+s.value},h[1]||(h[1]=[n("i",{class:"fa-solid fa-lg fa-bolt"},null,-1)]),8,Wi)):w("",!0),o.chargepoint.chargeMode=="pv_charging"?(l(),f("a",{key:1,class:"nav-link","data-bs-toggle":"tab","data-bs-target":"#pvSettings"+s.value},h[2]||(h[2]=[n("i",{class:"fa-solid fa-solar-panel me-1"},null,-1)]),8,Di)):w("",!0),o.chargepoint.chargeMode=="scheduled_charging"?(l(),f("a",{key:2,class:"nav-link","data-bs-toggle":"tab","data-bs-target":"#scheduledSettings"+s.value},h[3]||(h[3]=[n("i",{class:"fa-solid fa-bullseye me-1"},null,-1)]),8,Gi)):w("",!0),o.chargepoint.timedCharging?(l(),f("a",{key:3,class:"nav-link","data-bs-toggle":"tab","data-bs-target":"#timeSettings"+s.value},h[4]||(h[4]=[n("i",{class:"fa-solid fa-clock"},null,-1)]),8,ji)):w("",!0),n("a",{class:"nav-link","data-bs-toggle":"tab","data-bs-target":"#carSettings"+s.value},h[5]||(h[5]=[n("i",{class:"fa-solid fa-rectangle-list"},null,-1)]),8,Ui),i(re).active&&i(t).etActive?(l(),f("a",{key:4,class:"nav-link","data-bs-toggle":"tab","data-bs-target":"#priceChart"+s.value},h[6]||(h[6]=[n("i",{class:"fa-solid fa-chart-line"},null,-1)]),8,Fi)):w("",!0)]),n("div",Ni,[n("div",{id:"chargeSettings"+s.value,class:"tab-pane active",role:"tabpanel","aria-labelledby":"instant-tab"},[v(xi,{chargepoint:o.chargepoint},null,8,["chargepoint"])],8,Hi),n("div",{id:"instantSettings"+s.value,class:"tab-pane",role:"tabpanel","aria-labelledby":"instant-tab"},[v(Ys,{chargepoint:i(t),vehicles:i(Y),"charge-templates":i(_e)},null,8,["chargepoint","vehicles","charge-templates"])],8,Ri),n("div",{id:"pvSettings"+s.value,class:"tab-pane",role:"tabpanel","aria-labelledby":"pv-tab"},[v(Ks,{chargepoint:i(t),vehicles:i(Y),"charge-templates":i(_e)},null,8,["chargepoint","vehicles","charge-templates"])],8,Ji),n("div",{id:"scheduledSettings"+s.value,class:"tab-pane",role:"tabpanel","aria-labelledby":"scheduled-tab"},[r.value!=null?(l(),$(li,{key:0,"charge-template-id":i(t).chargeTemplate},null,8,["charge-template-id"])):w("",!0)],8,Yi),n("div",{id:"timeSettings"+s.value,class:"tab-pane",role:"tabpanel","aria-labelledby":"time-tab"},[r.value!=null?(l(),$(vi,{key:0,"charge-template-id":i(t).chargeTemplate},null,8,["charge-template-id"])):w("",!0)],8,qi),n("div",{id:"carSettings"+s.value,class:"tab-pane",role:"tabpanel","aria-labelledby":"car-tab"},[i(Y)[i(t).connectedVehicle]!=null?(l(),$(_i,{key:0,"vehicle-id":i(t).connectedVehicle},null,8,["vehicle-id"])):w("",!0)],8,Qi),n("div",{id:"priceChart"+s.value,class:"tab-pane",role:"tabpanel","aria-labelledby":"price-tab"},[i(Y)[i(t).connectedVehicle]!=null?(l(),$(Ta,{key:0,chargepoint:i(t)},null,8,["chargepoint"])):w("",!0)],8,Zi)])])],64))}}),Jt=R(Xi,[["__scopeId","data-v-1164316d"]]),Ki={class:"d-flex justify-content-center align-items-center"},el=L({__name:"BatterySymbol",props:{soc:{},color:{}},setup(a){const e=a,t=m(()=>e.soc<=12?"fa-battery-empty":e.soc<38?"fa-battery-quarter":e.soc<62?"fa-battery-half":e.soc<87?"fa-battery-three-quarters":"fa-battery-full"),r=m(()=>({color:e.color??"var(--color-menu)"}));return(s,o)=>(l(),f("span",Ki,[n("i",{class:q(["fa me-1",t.value]),style:K(r.value)},null,6),H(" "+S(Math.round(s.soc)+"%"),1)]))}}),Ct=R(el,[["__scopeId","data-v-a68c844a"]]),Ge=L({__name:"FormatWattH",props:{wattH:{}},setup(a){const e=a,t=m(()=>ct(e.wattH,g.decimalPlaces));return(r,s)=>(l(),f("span",null,S(t.value),1))}}),tl={class:"wb-widget p-0 m-0 shadow widgetWidth"},al={class:"py-4 px-3 d-flex justify-content-between align-items-center titlerow"},nl={class:"d-flex align-items-center widgetname p-0 m-0"},rl={class:"buttonrea d-flex float-right justify-content-end align-items-center"},ol={class:"grid12 pb-3"},sl=L({__name:"WbWidgetFlex",props:{variableWidth:{type:Boolean},fullWidth:{type:Boolean}},setup(a){const e=a,t=m(()=>e.fullWidth?"col-12":e.variableWidth&&g.preferWideBoxes?"col-lg-6":"col-lg-4");return(r,s)=>(l(),f("div",{class:q(["p-2 m-0",t.value])},[n("div",tl,[n("div",al,[n("div",nl,[pe(r.$slots,"title",{},()=>[s[0]||(s[0]=n("div",{class:"p-0"},"(title goes here)",-1))],!0),pe(r.$slots,"subtitle",{},void 0,!0)]),n("div",rl,[pe(r.$slots,"buttons",{},void 0,!0)])]),n("div",ol,[pe(r.$slots,"default",{},void 0,!0)])])],2))}}),je=R(sl,[["__scopeId","data-v-1d5bc1d9"]]),il=L({__name:"WbBadge",props:{color:{},bgcolor:{}},setup(a){const e=a,t=m(()=>({color:e.color??"var(--color-bg)","background-color":e.bgcolor??"var(--color-menu)"}));return(r,s)=>(l(),f("span",{class:"pillWbBadge rounded-pill ms-2 px-2",style:K(t.value)},[pe(r.$slots,"default",{},void 0,!0)],4))}}),Pe=R(il,[["__scopeId","data-v-36112fa3"]]),ll={class:"d-flex justify-content-center align-items-center"},cl={key:0,class:"WbBadge rounded-pill errorWbBadge ms-3"},ul={key:0},dl={key:1,class:"row m-0 mt-0 p-0"},hl={class:"col m-0 p-0"},pl={key:0},gl={class:"row"},ml={class:"col"},fl={class:"carTitleLine d-flex justify-content-between align-items-center"},vl={key:0,class:"me-1 fa-solid fa-xs fa-star ps-1"},yl={key:1,class:"me-1 fa-solid fa-xs fa-coins ps-0"},bl={key:2,class:"me-0 fa-solid fa-xs fa-clock ps-1"},_l={class:"grid12"},wl={style:{color:"var(--color-charging)"}},kl={style:{color:"var(--color-charging)"}},xl={style:{color:"var(--color-charging)"}},Sl={class:"targetCurrent"},Ml={key:5,class:"socEditor rounded mt-2 d-flex flex-column align-items-center grid-col-12 grid-left"},$l={class:"d-flex justify-content-stretch align-items-center"},Pl={key:0,class:"fa-solid fa-sm fas fa-edit ms-2"},Il=["id"],Cl=L({__name:"CPChargePoint",props:{chargepoint:{},fullWidth:{type:Boolean}},setup(a){const e=a,t=ee(e.chargepoint),r=m({get(){return e.chargepoint.chargeMode},set(I){O[e.chargepoint.id].chargeMode=I}}),s=m(()=>(Math.round(e.chargepoint.current*10)/10).toLocaleString(void 0)+" A"),o=m(()=>(Math.round(e.chargepoint.realCurrent*10)/10).toLocaleString(void 0)+" A"),h=m(()=>{const I=e.chargepoint.rangeCharged,x=e.chargepoint.chargedSincePlugged,G=e.chargepoint.dailyYield;return x>0?Math.round(I/x*G).toString()+" "+e.chargepoint.rangeUnit:"0 km"}),d=m(()=>e.chargepoint.isLocked?"Gesperrt":e.chargepoint.isCharging?"Lädt":e.chargepoint.isPluggedIn?"Bereit":"Frei"),u=m(()=>e.chargepoint.isLocked?"var(--color-evu)":e.chargepoint.isCharging?"var(--color-charging)":e.chargepoint.isPluggedIn?"var(--color-battery)":"var(--color-axis)"),p=m(()=>{let I="";return e.chargepoint.isLocked?I="fa-lock":e.chargepoint.isCharging?I=" fa-bolt":e.chargepoint.isPluggedIn&&(I="fa-plug"),"fa "+I}),c=m(()=>{switch(e.chargepoint.chargeMode){case"stop":return{color:"var(--fg)"};default:return{color:ye[e.chargepoint.chargeMode].color}}}),k=m(()=>e.chargepoint.soc),P=m(()=>({color:e.chargepoint.color})),z=m(()=>e.chargepoint.etMaxPrice>=+M.value?{color:"var(--color-charging)"}:{color:"var(--color-menu)"}),D=m(()=>e.chargepoint.soc<20?"var(--color-evu)":e.chargepoint.soc>=80?"var(--color-pv)":"var(--color-battery)"),B=ee(!1),A=ee(!1);function V(){oe("socUpdate",1,e.chargepoint.connectedVehicle),O[e.chargepoint.id].waitingForSoc=!0}function J(){oe("setSoc",C.value,e.chargepoint.connectedVehicle),A.value=!1}const C=m({get(){return e.chargepoint.soc},set(I){O[e.chargepoint.id].soc=I}}),M=m(()=>{const[I]=re.etPriceList.values();return(Math.round(I*10)/10).toFixed(1)}),E=ee(!1);return(I,x)=>(l(),f(F,null,[B.value?w("",!0):(l(),$(_t,{key:0,"variable-width":!0,"full-width":e.fullWidth},{title:_(()=>[n("span",ll,[n("span",{style:K(P.value),onClick:x[0]||(x[0]=G=>B.value=!B.value)},[x[12]||(x[12]=n("span",{class:"fa-solid fa-charging-station"}," ",-1)),H(" "+S(e.chargepoint.name),1)],4),t.value.faultState==2?(l(),f("span",cl,"Fehler")):w("",!0)])]),buttons:_(()=>[n("span",{type:"button",class:"ms-2 ps-1 pt-1",style:K(c.value),onClick:x[1]||(x[1]=G=>B.value=!B.value)},x[13]||(x[13]=[n("span",{class:"fa-solid fa-lg ps-1 fa-ellipsis-vertical"},null,-1)]),4)]),footer:_(()=>[B.value?w("",!0):(l(),f("div",pl,[n("div",gl,[n("div",ml,[n("div",fl,[n("h3",{onClick:x[3]||(x[3]=G=>B.value=!B.value)},[x[14]||(x[14]=n("i",{class:"fa-solid fa-sm fa-car me-2"},null,-1)),H(" "+S(I.chargepoint.vehicleName)+" ",1),I.chargepoint.hasPriority?(l(),f("span",vl)):w("",!0),I.chargepoint.etActive?(l(),f("span",yl)):w("",!0),I.chargepoint.timedCharging?(l(),f("span",bl)):w("",!0)]),I.chargepoint.isSocConfigured?(l(),$(Pe,{key:0,bgcolor:D.value},{default:_(()=>[v(Ct,{soc:k.value??0,color:"var(--color-bg)",class:"me-2"},null,8,["soc"]),I.chargepoint.isSocManual?(l(),f("i",{key:0,class:"fa-solid fa-sm fas fa-edit",style:{color:"var(--color-bg)"},onClick:x[4]||(x[4]=G=>A.value=!A.value)})):w("",!0),I.chargepoint.isSocManual?w("",!0):(l(),f("i",{key:1,type:"button",class:q(["fa-solid fa-sm",I.chargepoint.waitingForSoc?"fa-spinner fa-spin":"fa-sync"]),onClick:V},null,2))]),_:1},8,["bgcolor"])):w("",!0)])])]),n("div",_l,[v(Oa,{id:"chargemode-"+I.chargepoint.name,modelValue:r.value,"onUpdate:modelValue":x[5]||(x[5]=G=>r.value=G),class:"chargemodes mt-3 mb-3",options:Object.keys(i(ye)).map(G=>({text:i(ye)[G].name,value:G,color:i(ye)[G].color,icon:i(ye)[G].icon,active:i(ye)[G].mode==I.chargepoint.chargeMode}))},null,8,["id","modelValue","options"]),e.chargepoint.power>0?(l(),$(X,{key:0,heading:"Leistung:",class:"grid-col-3 grid-left mb-3"},{default:_(()=>[n("span",wl,[v(bt,{watt:e.chargepoint.power},null,8,["watt"])])]),_:1})):w("",!0),e.chargepoint.power>0?(l(),$(X,{key:1,heading:"Strom:",class:"grid-col-3"},{default:_(()=>[n("span",kl,S(o.value),1)]),_:1})):w("",!0),e.chargepoint.power>0?(l(),$(X,{key:2,heading:"Phasen:",class:"grid-col-3"},{default:_(()=>[n("span",xl,S(e.chargepoint.phasesInUse),1)]),_:1})):w("",!0),e.chargepoint.power>0?(l(),$(X,{key:3,heading:"Sollstrom:",class:"grid-col-3 grid-right"},{default:_(()=>[n("span",Sl,S(s.value),1)]),_:1})):w("",!0),v(X,{heading:"letzte Ladung:",class:"grid-col-4 grid-left"},{default:_(()=>[v(Ge,{"watt-h":Math.max(I.chargepoint.chargedSincePlugged,0)},null,8,["watt-h"])]),_:1}),v(X,{heading:"gel. Reichw.:",class:"grid-col-4"},{default:_(()=>[H(S(h.value),1)]),_:1}),I.chargepoint.isSocConfigured?(l(),$(X,{key:4,heading:"Reichweite:",class:"grid-col-4 grid-right"},{default:_(()=>[H(S(i(Y)[e.chargepoint.connectedVehicle]?Math.round(i(Y)[e.chargepoint.connectedVehicle].range):0)+" km ",1)]),_:1})):w("",!0),A.value?(l(),f("div",Ml,[x[15]||(x[15]=n("span",{class:"d-flex m-1 p-0 socEditTitle"},"Ladestand einstellen:",-1)),n("span",$l,[n("span",null,[v(Me,{id:"manualSoc",modelValue:C.value,"onUpdate:modelValue":x[6]||(x[6]=G=>C.value=G),min:0,max:100,step:1,unit:"%"},null,8,["modelValue"])])]),n("span",{type:"button",class:"fa-solid d-flex fa-lg me-2 mb-3 align-self-end fa-circle-check",onClick:J})])):w("",!0),x[17]||(x[17]=n("hr",{class:"divider grid-col-12"},null,-1)),i(re).active?(l(),$(X,{key:6,heading:"Preisladen:",class:"grid-col-4 grid-left"},{default:_(()=>[v(se,{modelValue:t.value.etActive,"onUpdate:modelValue":x[7]||(x[7]=G=>t.value.etActive=G)},null,8,["modelValue"])]),_:1})):w("",!0),i(re).active?(l(),$(X,{key:7,heading:"max. Preis:",class:"grid-col-4"},{default:_(()=>[n("span",{type:"button",onClick:x[8]||(x[8]=G=>E.value=!E.value)},[H(S(e.chargepoint.etActive?(Math.round(e.chargepoint.etMaxPrice*10)/10).toFixed(1)+" ct":"-")+" ",1),e.chargepoint.etActive?(l(),f("i",Pl)):w("",!0)])]),_:1})):w("",!0),i(re).active?(l(),$(X,{key:8,heading:"akt. Preis:",class:"grid-col-4 grid-right"},{default:_(()=>[n("span",{style:K(z.value)},S(M.value)+" ct ",5)]),_:1})):w("",!0),E.value?(l(),f("div",{key:9,id:"priceChartInline"+e.chargepoint.id,class:"d-flex flex-column rounded priceEditor grid-col-12"},[i(Y)[e.chargepoint.connectedVehicle]!=null?(l(),$(Ta,{key:0,chargepoint:e.chargepoint},null,8,["chargepoint"])):w("",!0),n("span",{class:"d-flex ms-2 my-4 pe-3 pt-1 d-flex align-self-end",style:K(c.value),onClick:x[9]||(x[9]=G=>E.value=!1)},x[16]||(x[16]=[n("span",{type:"button",class:"d-flex fa-solid fa-lg ps-1 fa-circle-check"},null,-1)]),4)],8,Il)):w("",!0)])]))]),default:_(()=>[B.value?w("",!0):(l(),f("div",ul,[n("div",{class:"grid12",onClick:x[2]||(x[2]=G=>B.value=!B.value)},[v(X,{heading:"Status:",class:"grid-col-4 grid-left"},{default:_(()=>[n("span",{style:K({color:u.value})},[n("i",{class:q(p.value)},null,2),H(" "+S(d.value),1)],4)]),_:1}),v(X,{heading:"Geladen:",class:"grid-col-4 grid-left"},{default:_(()=>[v(Ge,{"watt-h":I.chargepoint.dailyYield},null,8,["watt-h"])]),_:1})])])),B.value?(l(),f("div",dl,[n("div",hl,[I.chargepoint!=null?(l(),$(Jt,{key:0,chargepoint:I.chargepoint},null,8,["chargepoint"])):w("",!0)])])):w("",!0)]),_:1},8,["full-width"])),B.value?(l(),$(je,{key:1,"full-width":e.fullWidth},{title:_(()=>[n("span",{style:K(P.value),onClick:x[10]||(x[10]=G=>B.value=!B.value)},[x[18]||(x[18]=n("span",{class:"fas fa-gear"}," ",-1)),H(" Einstellungen "+S(e.chargepoint.name),1)],4)]),buttons:_(()=>[n("span",{class:"ms-2 pt-1",style:K(c.value),onClick:x[11]||(x[11]=G=>B.value=!B.value)},x[19]||(x[19]=[n("span",{class:"fa-solid fa-lg ps-1 fa-circle-check"},null,-1)]),4)]),default:_(()=>[I.chargepoint!=null?(l(),$(Jt,{key:0,chargepoint:I.chargepoint},null,8,["chargepoint"])):w("",!0)]),_:1},8,["full-width"])):w("",!0)],64))}}),Bl=R(Cl,[["__scopeId","data-v-3a733de3"]]),Vl=["id"],Ll={class:"modal-dialog modal-lg modal-fullscreen-lg-down"},Ol={class:"modal-content"},Al={class:"modal-header"},Tl={class:"modal-title"},El={class:"modal-body",style:{"background-color":"var(--color-bg)"}},zl=L({__name:"ModalComponent",props:{modalId:{}},setup(a){const e=a;return Le(()=>{}),(t,r)=>(l(),f("div",{id:e.modalId,class:"modal fade"},[n("div",Ll,[n("div",Ol,[n("div",Al,[n("h3",Tl,[pe(t.$slots,"title",{},void 0,!0)]),r[0]||(r[0]=n("button",{type:"button",class:"btn-close buttonTextSize d-flex justify-content-center pt-3 pb-0","data-bs-dismiss":"modal"},[n("i",{class:"fa-solid fa-lg fa-rectangle-xmark m-0 p-0"})],-1))]),n("div",El,[pe(t.$slots,"default",{},void 0,!0),r[1]||(r[1]=n("button",{class:"btn btn-secondary float-end mt-3 ms-1","data-bs-dismiss":"modal"}," Schließen ",-1))])])])],8,Vl))}}),Ea=R(zl,[["__scopeId","data-v-eaefae30"]]),Wl={class:"d-flex align-items-center"},Dl={class:"cpname"},Gl={class:"d-flex float-right justify-content-end align-items-center"},jl=["data-bs-target"],Ul=["data-bs-target"],Fl={class:"subgrid"},Nl={key:0,class:"d-flex justify-content-center align-items-center vehiclestatus"},Hl={class:"d-flex flex-column align-items-center px-0"},Rl={class:"d-flex justify-content-center flex-wrap"},Jl={class:"d-flex align-items-center"},Yl={class:"badge phasesInUse rounded-pill"},ql={class:"d-flex flex-wrap justify-content-center chargeinfo"},Ql={class:"me-1"},Zl={key:0,class:"subgrid socEditRow m-0 p-0"},Xl={class:"socEditor rounded mt-2 d-flex flex-column align-items-center grid-col-12"},Kl={class:"d-flex justify-content-stretch align-items-center"},ec=L({__name:"CpsListItem2",props:{chargepoint:{}},setup(a){const e=a,t=ee(!1),r=m(()=>ye[e.chargepoint.chargeMode].icon),s=m(()=>{let V="";return e.chargepoint.isLocked?V="fa-lock":e.chargepoint.isCharging?V=" fa-bolt":e.chargepoint.isPluggedIn&&(V="fa-plug"),"fa "+V}),o=m(()=>{let V="var(--color-axis)";return e.chargepoint.isLocked?V="var(--color-evu)":e.chargepoint.isCharging?V="var(--color-charging)":e.chargepoint.isPluggedIn&&(V="var(--color-battery)"),{color:V,border:`0.5px solid ${V} `}}),h=m(()=>{switch(e.chargepoint.chargeMode){case"stop":return{"background-color":"var(--fg)"};default:return{"background-color":ye[e.chargepoint.chargeMode].color}}}),d=m(()=>$e(e.chargepoint.power,g.decimalPlaces)),u=m(()=>e.chargepoint.current+" A"),p=m(()=>e.chargepoint.phasesInUse),c=m(()=>e.chargepoint.dailyYield>0?ct(e.chargepoint.dailyYield,g.decimalPlaces):"0 Wh"),k=m(()=>"("+Math.round(e.chargepoint.rangeCharged).toString()+" "+e.chargepoint.rangeUnit+")"),P=m(()=>ye[e.chargepoint.chargeMode].name);function z(){oe("socUpdate",1,e.chargepoint.connectedVehicle),O[e.chargepoint.id].waitingForSoc=!0}function D(){oe("setSoc",B.value,e.chargepoint.connectedVehicle),t.value=!1}const B=m({get(){return e.chargepoint.soc},set(V){O[e.chargepoint.id].soc=V}}),A=m(()=>e.chargepoint.isLocked?"Gesperrt":e.chargepoint.isCharging?"Lädt":e.chargepoint.isPluggedIn?"Bereit":"Frei");return(V,J)=>(l(),f(F,null,[v(tt,{titlecolor:V.chargepoint.color,fullwidth:!0,small:!0},{title:_(()=>[n("div",Wl,[n("span",Dl,S(V.chargepoint.name),1),n("span",{class:"badge rounded-pill statusbadge mx-2",style:K(o.value)},[n("i",{class:q([s.value,"me-1"])},null,2),H(" "+S(A.value),1)],4)])]),buttons:_(()=>[n("div",Gl,[n("span",{class:"badge rounded-pill modebadge mx-2",type:"button",style:K(h.value),"data-bs-toggle":"modal","data-bs-target":"#cpsconfig-"+V.chargepoint.id},[n("i",{class:q(["fa me-1",r.value])},null,2),H(" "+S(P.value),1)],12,jl),n("span",{class:"fa-solid ms-2 fa-lg fa-edit ps-1",type:"button","data-bs-toggle":"modal","data-bs-target":"#cpsconfig-"+V.chargepoint.id},null,8,Ul)])]),default:_(()=>[n("div",Fl,[v(X,{heading:V.chargepoint.vehicleName,small:!0,class:"grid-left grid-col-4"},{default:_(()=>[V.chargepoint.isSocConfigured?(l(),f("span",Nl,[V.chargepoint.soc?(l(),$(Ct,{key:0,class:"me-1",soc:V.chargepoint.soc},null,8,["soc"])):w("",!0),V.chargepoint.isSocConfigured&&V.chargepoint.isSocManual?(l(),f("i",{key:1,type:"button",class:"fa-solid fa-sm fas fa-edit",style:{color:"var(--color-menu)"},onClick:J[0]||(J[0]=C=>t.value=!t.value)})):w("",!0),V.chargepoint.isSocConfigured&&!V.chargepoint.isSocManual?(l(),f("i",{key:2,type:"button",class:q(["fa-solid fa-sm me-2",V.chargepoint.waitingForSoc?"fa-spinner fa-spin":"fa-sync"]),style:{color:"var(--color-menu)"},onClick:z},null,2)):w("",!0)])):w("",!0)]),_:1},8,["heading"]),v(X,{heading:"Parameter:",small:!0,class:"grid-col-4"},{default:_(()=>[n("div",Hl,[n("span",Rl,[n("span",null,S(d.value),1),n("span",Jl,[n("span",Yl,S(p.value),1),n("span",null,S(u.value),1)])])])]),_:1}),v(X,{heading:"Geladen:",small:!0,class:"grid-right grid-col-4"},{default:_(()=>[n("div",ql,[n("span",Ql,S(c.value),1),n("span",null,S(k.value),1)])]),_:1})]),t.value?(l(),f("div",Zl,[n("div",Xl,[J[2]||(J[2]=n("span",{class:"d-flex m-1 p-0 socEditTitle"},"Ladestand einstellen:",-1)),n("span",Kl,[n("span",null,[v(Me,{id:"manualSoc",modelValue:B.value,"onUpdate:modelValue":J[1]||(J[1]=C=>B.value=C),min:0,max:100,step:1,unit:"%"},null,8,["modelValue"])])]),n("span",{type:"button",class:"fa-solid d-flex fa-lg me-2 mb-3 align-self-end fa-circle-check",onClick:D})])])):w("",!0)]),_:1},8,["titlecolor"]),(l(),$(Xa,{to:"body"},[(l(),$(Ea,{key:V.chargepoint.id,"modal-id":"cpsconfig-"+V.chargepoint.id},{title:_(()=>[H(" Konfiguration: "+S(V.chargepoint.name),1)]),default:_(()=>[V.chargepoint!=null?(l(),$(Jt,{key:0,chargepoint:V.chargepoint},null,8,["chargepoint"])):w("",!0)]),_:1},8,["modal-id"]))]))],64))}}),tc=R(ec,[["__scopeId","data-v-25e4aa5d"]]),ac=L({__name:"CpSimpleList2",setup(a){const e=m(()=>Object.values(O));return(t,r)=>(l(),$(je,{"variable-width":!0},{title:_(()=>r[0]||(r[0]=[n("span",{class:"fa-solid fa-charging-station"}," ",-1),H(" Ladepunkte ")])),buttons:_(()=>[i(re).active?(l(),$(Pe,{key:0,bgcolor:"var(--color-menu)"},{default:_(()=>[H("Strompreis: "+S(i(re).etCurrentPriceString),1)]),_:1})):w("",!0)]),default:_(()=>[(l(!0),f(F,null,te(e.value,(s,o)=>(l(),f("div",{key:o,class:"subgrid pb-2"},[v(tc,{chargepoint:s},null,8,["chargepoint"])]))),128))]),_:1}))}}),nc=R(ac,[["__scopeId","data-v-b8c6b557"]]),Tt=L({__name:"ChargePointList",props:{id:{},compact:{type:Boolean}},setup(a){let e,t;const r=a,s=m(()=>{let p=Object.values(O);return u(),p}),o=m(()=>h.value+" "+d.value),h=m(()=>{switch(Object.values(O).length){case 0:return g.preferWideBoxes?"col-lg-6":"col-lg-4";case 1:return g.preferWideBoxes?"col-lg-6":"col-lg-4";case 2:return g.preferWideBoxes?"col-lg-12":"col-lg-8 ";default:return"col-lg-12"}}),d=m(()=>"swiper-chargepoints-"+r.id);function u(){let p=document.querySelector("."+d.value);if(p&&(t=p,e=t.swiper),e){let c="1";if(De.value)switch(Object.values(O).length){case 0:case 1:c="1";break;case 2:c="2";break;default:c="3"}t.setAttribute("slides-per-view",c),e.update()}}return Le(()=>{let p=document.querySelector("."+d.value);p&&(t=p,e=t.swiper),window.addEventListener("resize",u),window.document.addEventListener("visibilitychange",u)}),(p,c)=>(l(),f(F,null,[r.compact?w("",!0):(l(),f("swiper-container",{key:0,"space-between":0,"slides-per-view":1,pagination:{clickable:!0},class:q(["cplist m-0 p-0 d-flex align-items-stretch",o.value])},[(l(!0),f(F,null,te(s.value,k=>(l(),f("swiper-slide",{key:k.id},[n("div",{class:q([i(De)?"mb-0":"mb-5","d-flex align-items-stretch flex-fill"])},[v(Bl,{chargepoint:k,"full-width":!0},null,8,["chargepoint"])],2)]))),128))],2)),r.compact?(l(),$(nc,{key:1})):w("",!0)],64))}}),rc={class:"container-fluid p-0 m-0"},oc={class:"row p-0 m-0"},sc={class:"d-grid gap-2"},ic=["onClick"],lc={class:"col-md-4 p-1"},cc={class:"d-grid gap-2"},uc={key:0},dc={class:"row justify-content-center m-1 p-0"},hc={class:"col-lg-4 p-1 m-0"},pc={class:"d-grid gap-2"},gc={class:"col-lg-4 p-1 m-0"},mc={class:"d-grid gap-2"},fc={class:"col-lg-4 p-1 m-0"},vc={class:"d-grid gap-2"},yc=L({__name:"BBSelect",props:{cpId:{}},setup(a){const e=a,t=[{mode:"instant_charging",name:"Sofort",color:"var(--color-charging)"},{mode:"pv_charging",name:"PV",color:"var(--color-pv)"},{mode:"scheduled_charging",name:"Zielladen",color:"var(--color-battery)"},{mode:"standby",name:"Standby",color:"var(--color-axis)"},{mode:"stop",name:"Stop",color:"var(--color-axis)"}],r=m(()=>O[e.cpId]);function s(p){return p==r.value.chargeMode?"btn btn-success buttonTextSize":"btn btn-secondary buttonTextSize"}function o(p){return de.pvBatteryPriority==p?"btn-success":"btn-secondary"}function h(p){r.value.chargeMode=p}function d(p){r.value.isLocked=p}function u(p){de.pvBatteryPriority=p}return(p,c)=>(l(),f("div",rc,[n("div",oc,[(l(),f(F,null,te(t,(k,P)=>n("div",{key:P,class:"col-md-4 p-1"},[n("div",sc,[n("button",{type:"button",class:q(s(k.mode)),style:{},onClick:z=>h(k.mode)},S(k.name),11,ic)])])),64)),n("div",lc,[n("div",cc,[r.value.isLocked?(l(),f("button",{key:0,type:"button",class:"btn btn-outline-success buttonTextSize","data-bs-dismiss":"modal",onClick:c[0]||(c[0]=k=>d(!1))}," Entsperren ")):w("",!0),r.value.isLocked?w("",!0):(l(),f("button",{key:1,type:"button",class:"btn btn-outline-danger buttonTextSize","data-bs-dismiss":"modal",onClick:c[1]||(c[1]=k=>d(!0))}," Sperren "))])])]),i(de).isBatteryConfigured?(l(),f("div",uc,[c[8]||(c[8]=n("hr",null,null,-1)),c[9]||(c[9]=n("div",{class:"row"},[n("div",{class:"col text-center"},"Vorrang im Lademodus PV-Laden:")],-1)),n("div",dc,[n("div",hc,[n("div",pc,[n("button",{id:"evPriorityBtn",type:"button",class:q(["priorityModeBtn btn btn-secondary buttonTextSize",o("ev_mode")]),"data-dismiss":"modal",priority:"1",onClick:c[2]||(c[2]=k=>u("ev_mode"))},c[5]||(c[5]=[H(" EV "),n("span",{class:"fas fa-car ms-2"}," ",-1)]),2)])]),n("div",gc,[n("div",mc,[n("button",{id:"batteryPriorityBtn",type:"button",class:q(["priorityModeBtn btn btn-secondary buttonTextSize",o("bat_mode")]),"data-dismiss":"modal",priority:"0",onClick:c[3]||(c[3]=k=>u("bat_mode"))},c[6]||(c[6]=[H(" Speicher "),n("span",{class:"fas fa-car-battery ms-2"}," ",-1)]),2)])]),n("div",fc,[n("div",vc,[n("button",{id:"minsocPriorityBtn",type:"button",class:q(["priorityModeBtn btn btn-secondary buttonTextSize",o("min_soc_bat_mode")]),"data-dismiss":"modal",priority:"0",onClick:c[4]||(c[4]=k=>u("min_soc_bat_mode"))},c[7]||(c[7]=[H(" MinSoc "),n("span",{class:"fas fa-battery-half"}," ",-1)]),2)])])])])):w("",!0)]))}}),bc={class:"col-lg-4 p-0 m-0 mt-1"},_c={class:"d-grid gap-2"},wc=["data-bs-target"],kc={class:"m-0 p-0 d-flex justify-content-between align-items-center"},xc={class:"mx-1 badge rounded-pill smallTextSize plugIndicator"},Sc={key:0,class:"ms-2"},Mc={class:"m-0 p-0"},$c={key:0,class:"ps-1"},Pc=L({__name:"BbChargeButton",props:{chargepoint:{}},setup(a){const e=a,t="chargeSelectModal"+e.chargepoint.id,r=m(()=>ye[e.chargepoint.chargeMode].name),s=m(()=>{let c={background:"var(--color-menu)"};return e.chargepoint.isLocked?c.background="var(--color-evu)":e.chargepoint.isCharging?c.background="var(--color-charging)":e.chargepoint.isPluggedIn&&(c.background="var(--color-battery)"),c}),o=m(()=>{{let c={background:ye[e.chargepoint.chargeMode].color,color:"white"};switch(e.chargepoint.chargeMode){case ve.instant_charging:e.chargepoint.isCharging&&!e.chargepoint.isLocked&&(c=p(c));break;case ve.standby:case ve.stop:c.background="darkgrey",c.color="black";break;case ve.scheduled_charging:e.chargepoint.isPluggedIn&&!e.chargepoint.isCharging&&!e.chargepoint.isLocked&&(c=p(c));break}return c}}),h=m(()=>ye[e.chargepoint.chargeMode].icon),d=m(()=>{switch(de.pvBatteryPriority){case"ev_mode":return"fa-car";case"bat_mode":return"fa-car-battery";case"min_soc_bat_mode":return"fa-battery-half";default:return console.log("default"),""}}),u=m(()=>{let c="fa-ellipsis";return e.chargepoint.isLocked?c="fa-lock":e.chargepoint.isCharging?c=" fa-bolt":e.chargepoint.isPluggedIn&&(c="fa-plug"),"fa "+c});function p(c){let k=c.color;return c.color=c.background,c.background=k,c}return(c,k)=>(l(),f("div",bc,[n("div",_c,[n("button",{type:"button",class:"btn mx-1 mb-0 p-1 mediumTextSize chargeButton shadow",style:K(s.value),"data-bs-toggle":"modal","data-bs-target":"#"+t},[n("div",kc,[n("span",xc,[n("i",{class:q(u.value)},null,2),c.chargepoint.isCharging?(l(),f("span",Sc,S(i($e)(c.chargepoint.power)),1)):w("",!0)]),n("span",Mc,S(c.chargepoint.name),1),n("span",{class:"mx-2 m-0 badge rounded-pill smallTextSize modeIndicator",style:K(o.value)},[n("i",{class:q(["fa me-1",h.value])},null,2),H(" "+S(r.value)+" ",1),c.chargepoint.chargeMode==i(ve).pv_charging&&i(de).isBatteryConfigured?(l(),f("span",$c,[k[0]||(k[0]=H(" ( ")),n("i",{class:q(["fa m-0",d.value])},null,2),k[1]||(k[1]=H(") "))])):w("",!0)],4)])],12,wc)]),v(Ea,{"modal-id":t},{title:_(()=>[H(" Lademodus für "+S(c.chargepoint.vehicleName),1)]),default:_(()=>[v(yc,{"cp-id":c.chargepoint.id},null,8,["cp-id"])]),_:1})]))}}),Ic=R(Pc,[["__scopeId","data-v-31df6764"]]),Cc={class:"row p-0 mt-0 mb-1 m-0"},Bc={class:"col p-0 m-0"},Vc={class:"container-fluid p-0 m-0"},Lc={class:"row p-0 m-0 d-flex justify-content-center align-items-center"},Oc={key:0,class:"col time-display"},Ac=L({__name:"ButtonBar",setup(a){return(e,t)=>(l(),f("div",Cc,[n("div",Bc,[n("div",Vc,[n("div",Lc,[i(g).showClock=="buttonbar"?(l(),f("span",Oc,S(i(La)(i(Rt))),1)):w("",!0),(l(!0),f(F,null,te(i(O),(r,s)=>(l(),$(Ic,{key:s,chargepoint:r,"charge-point-count":Object.values(i(O)).length},null,8,["chargepoint","charge-point-count"]))),128))])])])]))}}),Tc=R(Ac,[["__scopeId","data-v-791e4be0"]]),Ec={class:"battery-title"},zc={class:"subgrid pt-1"},Wc=L({__name:"BLBattery",props:{bat:{}},setup(a){const e=a,t=m(()=>e.bat.power<0?`Liefert (${$e(-e.bat.power)})`:e.bat.power>0?`Lädt (${$e(e.bat.power)})`:"Bereit"),r=m(()=>e.bat.power<0?"var(--color-pv)":e.bat.power>0?"var(--color-battery)":"var(--color-menu)");return(s,o)=>(l(),$(tt,{titlecolor:"var(--color-title)",fullwidth:!0},{title:_(()=>[n("span",Ec,S(s.bat.name),1)]),buttons:_(()=>[v(Pe,{bgcolor:r.value},{default:_(()=>[H(S(t.value),1)]),_:1},8,["bgcolor"])]),default:_(()=>[n("div",zc,[v(X,{heading:"Ladestand:",small:!0,class:"grid-left grid-col-4"},{default:_(()=>[v(Ct,{soc:e.bat.soc},null,8,["soc"])]),_:1}),v(X,{heading:"Geladen:",small:!0,class:"grid-col-4"},{default:_(()=>[v(Ge,{"watt-h":e.bat.dailyYieldImport},null,8,["watt-h"])]),_:1}),v(X,{heading:"Geliefert:",small:!0,class:"grid-right grid-col-4"},{default:_(()=>[v(Ge,{"watt-h":e.bat.dailyYieldExport},null,8,["watt-h"])]),_:1})])]),_:1}))}}),Dc=R(Wc,[["__scopeId","data-v-f7f825f7"]]),Gc={class:"px-3 subgrid grid-12"},jc=L({__name:"BatteryList",setup(a){const e=m(()=>Q.batOut.power>0?`Liefert (${$e(Q.batOut.power)})`:U.batIn.power>0?`Lädt (${$e(U.batIn.power)})`:"Bereit:"),t=m(()=>Q.batOut.power>0?"var(--color-pv)":U.batIn.power>0?"var(--color-battery)":"var(--color-menu)"),r=m(()=>{let s=0;return he.value.forEach(o=>{s+=o.dailyYieldImport}),s});return(s,o)=>i(de).isBatteryConfigured?(l(),$(je,{key:0,"variable-width":!0,"full-width":!1},{title:_(()=>o[0]||(o[0]=[n("span",{class:"fas fa-car-battery me-2",style:{color:"var(--color-battery)"}}," ",-1),n("span",null,"Speicher",-1)])),buttons:_(()=>[v(Pe,{bgcolor:t.value},{default:_(()=>[H(S(e.value),1)]),_:1},8,["bgcolor"])]),default:_(()=>[n("div",Gc,[v(X,{heading:"Ladestand:",class:"grid-left grid-col-4"},{default:_(()=>[v(Ct,{color:"var(--color-battery)",soc:i(de).batterySoc},null,8,["soc"])]),_:1}),v(X,{heading:"Geladen:",class:"grid-col-4"},{default:_(()=>[n("span",null,S(i(ct)(r.value)),1)]),_:1}),v(X,{heading:"Geliefert",class:"grid-right grid-col-4"},{default:_(()=>[n("span",null,S(i(ct)(i(Q).batOut.energy)),1)]),_:1})]),(l(!0),f(F,null,te(i(he),([h,d])=>(l(),$(Dc,{key:h,bat:d},null,8,["bat"]))),128))]),_:1})):w("",!0)}}),Et=R(jc,[["__scopeId","data-v-cc4da23c"]]),Uc={class:"devicename"},Fc={class:"subgrid"},Nc=L({__name:"SHListItem",props:{device:{}},setup(a){const e=a,t=m(()=>e.device.status=="on"?"fa-toggle-on fa-xl":e.device.status=="waiting"?"fa-spinner fa-spin":"fa-toggle-off fa-xl"),r=m(()=>{let d="var(--color-switchRed)";switch(e.device.status){case"on":d="var(--color-switchGreen)";break;case"detection":d="var(--color-switchBlue)";break;case"timeout":d="var(--color-switchWhite)";break;case"waiting":d="var(--color-menu)";break;default:d="var(--color-switchRed)"}return{color:d}});function s(){e.device.isAutomatic||(e.device.status=="on"?oe("shSwitchOn",0,e.device.id):oe("shSwitchOn",1,e.device.id),ae.get(e.device.id).status="waiting")}function o(){e.device.isAutomatic?oe("shSetManual",1,e.device.id):oe("shSetManual",0,e.device.id)}const h=m(()=>e.device.isAutomatic?"Auto":"Man");return(d,u)=>(l(),$(tt,{titlecolor:d.device.color,fullwidth:!0},{title:_(()=>[n("span",Uc,S(d.device.name),1)]),buttons:_(()=>[(l(!0),f(F,null,te(d.device.temp,(p,c)=>(l(),f("span",{key:c},[p<300?(l(),$(Pe,{key:0,bgcolor:"var(--color-battery)"},{default:_(()=>[n("span",null,S(i(Nn)(p)),1)]),_:2},1024)):w("",!0)]))),128)),e.device.canSwitch?(l(),f("span",{key:0,class:q([t.value,"fa-solid statusbutton mr-2 ms-2"]),style:K(r.value),onClick:s},null,6)):w("",!0),e.device.canSwitch?(l(),$(Pe,{key:1,type:"button",onClick:o},{default:_(()=>[H(S(h.value),1)]),_:1})):w("",!0)]),default:_(()=>[n("div",Fc,[v(X,{heading:"Leistung:",small:!0,class:"grid-col-4 grid-left"},{default:_(()=>[v(bt,{watt:d.device.power},null,8,["watt"])]),_:1}),v(X,{heading:"Energie:",small:!0,class:"grid-col-4"},{default:_(()=>[v(Ge,{"watt-h":d.device.energy},null,8,["watt-h"])]),_:1}),v(X,{heading:"Laufzeit:",small:!0,class:"grid-col-4 grid-right"},{default:_(()=>[H(S(i(Un)(d.device.runningTime)),1)]),_:1})])]),_:1},8,["titlecolor"]))}}),Hc=R(Nc,[["__scopeId","data-v-20651ac6"]]),Rc={class:"sh-title py-4"},Jc=["id","onUpdate:modelValue","value"],Yc=["for"],qc=3,Qc=L({__name:"SmartHomeList",setup(a){const e=m(()=>De.value?t.value.reduce((h,d)=>{const u=h;let p=h[h.length-1];return p.length>=qc?h.push([d]):p.push(d),u},[[]]):[t.value]),t=m(()=>[...ae.values()].filter(h=>h.configured));function r(h){return"Geräte"+(De.value&&e.value.length>1?"("+(h+1)+")":"")}function s(){o.value=!o.value}const o=ee(!1);return(h,d)=>(l(),f(F,null,[(l(!0),f(F,null,te(e.value,(u,p)=>(l(),$(je,{key:p,"variable-width":!0},{title:_(()=>[n("span",{onClick:s},[d[0]||(d[0]=n("span",{class:"fas fa-plug me-2",style:{color:"var(--color-devices)"}}," ",-1)),n("span",Rc,S(r(p)),1)])]),buttons:_(()=>[n("span",{class:"ms-2 pt-1",onClick:s},d[1]||(d[1]=[n("span",{class:"fa-solid fa-lg ps-1 fa-ellipsis-vertical"},null,-1)]))]),default:_(()=>[(l(!0),f(F,null,te(u,c=>(l(),$(Hc,{key:c.id,device:c,class:"subgrid pb-2"},null,8,["device"]))),128))]),_:2},1024))),128)),o.value?(l(),$(je,{key:0},{title:_(()=>[n("span",{class:"smarthome",onClick:s},d[2]||(d[2]=[n("span",{class:"fas fa-gear"}," ",-1),H(" Einstellungen")]))]),buttons:_(()=>[n("span",{class:"ms-2 pt-1",onClick:s},d[3]||(d[3]=[n("span",{class:"fa-solid fa-lg ps-1 fa-circle-check"},null,-1)]))]),default:_(()=>[v(N,{title:"Im Energie-Graph anzeigen:",icon:"fa-chart-column",fullwidth:!0},{default:_(()=>[(l(!0),f(F,null,te(t.value,(u,p)=>(l(),f("div",{key:p},[vt(n("input",{id:"check"+p,"onUpdate:modelValue":c=>u.showInGraph=c,class:"form-check-input",type:"checkbox",value:u},null,8,Jc),[[Ma,u.showInGraph]]),n("label",{class:"form-check-label px-2",for:"check"+p},S(u.name),9,Yc)]))),128))]),_:1}),n("div",{class:"row p-0 m-0",onClick:s},d[4]||(d[4]=[n("div",{class:"col-12 mb-3 pe-3 mt-0"},[n("button",{class:"btn btn-sm btn-secondary float-end"},"Schließen")],-1)]))]),_:1})):w("",!0)],64))}}),zt=R(Qc,[["__scopeId","data-v-5b5cf6b3"]]),Zc={class:"countername"},Xc={class:"subgrid pt-1"},Kc=L({__name:"ClCounter",props:{counter:{}},setup(a){const e=a,t=m(()=>e.counter.power>0?"Bezug":"Export"),r=m(()=>e.counter.power>0?"var(--color-evu)":"var(--color-pv)");return(s,o)=>(l(),$(tt,{titlecolor:"var(--color-title)",fullwidth:!0},{title:_(()=>[n("span",Zc,S(s.counter.name),1)]),buttons:_(()=>[e.counter.power!=0?(l(),$(Pe,{key:0,bgcolor:r.value},{default:_(()=>[H(S(t.value),1)]),_:1},8,["bgcolor"])):w("",!0),v(Pe,{color:"var(--color-bg)"},{default:_(()=>[H(" ID: "+S(e.counter.id),1)]),_:1})]),default:_(()=>[n("div",Xc,[v(X,{heading:"Leistung:",small:!0,class:"grid-left grid-col-4"},{default:_(()=>[v(bt,{watt:Math.abs(e.counter.power)},null,8,["watt"])]),_:1}),v(X,{heading:"Bezogen:",small:!0,class:"grid-col-4"},{default:_(()=>[v(Ge,{"watt-h":e.counter.energy_imported},null,8,["watt-h"])]),_:1}),v(X,{heading:"Exportiert:",small:!0,class:"grid-right grid-col-4"},{default:_(()=>[v(Ge,{"watt-h":e.counter.energy_exported},null,8,["watt-h"])]),_:1})])]),_:1}))}}),eu=R(Kc,[["__scopeId","data-v-01dd8c4d"]]);class tu{constructor(e){b(this,"id");b(this,"name","Zähler");b(this,"power",0);b(this,"energy_imported",0);b(this,"energy_exported",0);b(this,"grid",!1);b(this,"type","counter");b(this,"color","var(--color-evu)");b(this,"energyPv",0);b(this,"energyBat",0);b(this,"pvPercentage",0);b(this,"icon","");this.id=e}}const ke=le({});function au(a,e){if(a in ke)console.info("Duplicate counter message: "+a);else switch(ke[a]=new tu(a),ke[a].type=e,e){case"counter":ke[a].color="var(--color-evu)";break;case"inverter":ke[a].color="var(--color-pv)";break;case"cp":ke[a].color="var(--color-charging)";break;case"bat":ke[a].color="var(--color-bat)";break}}const nu=L({__name:"CounterList",setup(a){return(e,t)=>(l(),$(je,{"variable-width":!0},{title:_(()=>t[0]||(t[0]=[n("span",{class:"fas fa-bolt me-2",style:{color:"var(--color-evu)"}}," ",-1),n("span",null,"Zähler",-1)])),default:_(()=>[(l(!0),f(F,null,te(i(ke),(r,s)=>(l(),f("div",{key:s,class:"subgrid pb-2"},[v(eu,{counter:r},null,8,["counter"])]))),128))]),_:1}))}}),Wt=R(nu,[["__scopeId","data-v-5f059284"]]),ru={class:"vehiclename"},ou={class:"subgrid"},su=L({__name:"VlVehicle",props:{vehicle:{}},setup(a){const e=a,t=m(()=>{let s="Unterwegs",o=e.vehicle.chargepoint;return o!=null&&(o.isCharging?s="Lädt ("+o.name+")":o.isPluggedIn&&(s="Bereit ("+o.name+")")),s}),r=m(()=>{let s=e.vehicle.chargepoint;return s!=null?s.isLocked?"var(--color-evu)":s.isCharging?"var(--color-charging)":s.isPluggedIn?"var(--color-battery)":"var(--color-axis)":"var(--color-axis)"});return(s,o)=>(l(),$(tt,{titlecolor:"var(--color-title)",fullwidth:!0},{title:_(()=>[n("span",ru,S(e.vehicle.name),1)]),default:_(()=>[n("div",ou,[v(X,{heading:"Status:",small:!0,class:"grid-left grid-col-4"},{default:_(()=>[n("span",{style:K({color:r.value}),class:"d-flex justify-content-center align-items-center status-string"},S(t.value),5)]),_:1}),v(X,{heading:"Ladestand:",small:!0,class:"grid-col-4"},{default:_(()=>[H(S(Math.round(e.vehicle.soc))+" % ",1)]),_:1}),v(X,{heading:"Reichweite:",small:!0,class:"grid-right grid-col-4"},{default:_(()=>[H(S(Math.round(e.vehicle.range))+" km ",1)]),_:1})])]),_:1}))}}),iu=R(su,[["__scopeId","data-v-9e2cb63e"]]),lu=L({__name:"VehicleList",setup(a){return(e,t)=>(l(),$(je,{"variable-width":!0},{title:_(()=>t[0]||(t[0]=[n("span",{class:"fas fa-car me-2",style:{color:"var(--color-charging)"}}," ",-1),n("span",null,"Fahrzeuge",-1)])),default:_(()=>[(l(!0),f(F,null,te(Object.values(i(Y)).filter(r=>r.visible),(r,s)=>(l(),f("div",{key:s,class:"subgrid"},[v(iu,{vehicle:r},null,8,["vehicle"])]))),128))]),_:1}))}}),Dt=R(lu,[["__scopeId","data-v-23b437ea"]]),cu={class:"grapharea"},uu={id:"pricechart",class:"p-1 m-0 pricefigure"},du={viewBox:"0 0 400 280"},hu=["id","origin","transform"],ut=380,_a=250,Gt=12,pu=L({__name:"GlobalPriceChart",props:{id:{}},setup(a){const e=a,t=ee(!1),r={top:0,bottom:15,left:20,right:0},s=m(()=>{let A=[];return re.etPriceList.size>0&&re.etPriceList.forEach((V,J)=>{A.push([J,V])}),A}),o=m(()=>s.value.length>1?(ut-r.left-r.right)/s.value.length:0),h=m(()=>{let A=Ve(s.value,V=>V[0]);return A[1]&&(A[1]=new Date(A[1]),A[1].setTime(A[1].getTime()+36e5)),et().range([r.left,ut-r.right]).domain(A)}),d=m(()=>{let A=[0,0];return s.value.length>0&&(A=Ve(s.value,V=>V[1]),A[0]=Math.floor(A[0])-1,A[1]=Math.floor(A[1])+1),A}),u=m(()=>He().range([_a-r.bottom,0]).domain(d.value)),p=m(()=>{const A=Ne(),V=[[r.left,u.value(g.lowerPriceBound)],[ut-r.right,u.value(g.lowerPriceBound)]];return A(V)}),c=m(()=>{const A=Ne(),V=[[r.left,u.value(g.upperPriceBound)],[ut-r.right,u.value(g.upperPriceBound)]];return A(V)}),k=m(()=>{const A=Ne(),V=[[r.left,u.value(0)],[ut-r.right,u.value(0)]];return A(V)}),P=m(()=>ht(h.value).ticks(s.value.length).tickSize(5).tickSizeInner(-250).tickFormat(A=>A.getHours()%6==0?st("%H:%M")(A):"")),z=m(()=>ft(u.value).ticks(d.value[1]-d.value[0]).tickSize(0).tickSizeInner(-360).tickFormat(A=>A.toString())),D=m(()=>{t.value==!0;const A=ce("g#"+B.value);A.selectAll("*").remove(),A.selectAll("bar").data(s.value).enter().append("g").append("rect").attr("class","bar").attr("x",x=>h.value(x[0])).attr("y",x=>u.value(x[1])).attr("width",o.value).attr("height",x=>u.value(d.value[0])-u.value(x[1])).attr("fill","var(--color-charging)");const J=A.append("g").attr("class","axis").call(P.value);J.attr("transform","translate(0,"+(_a-r.bottom)+")"),J.selectAll(".tick").attr("font-size",Gt).attr("color","var(--color-bg)"),J.selectAll(".tick line").attr("stroke","var(--color-bg)").attr("stroke-width",x=>x.getHours()%6==0?"2":"0.5"),J.select(".domain").attr("stroke","var(--color-bg");const C=A.append("g").attr("class","axis").call(z.value);C.attr("transform","translate("+r.left+",0)"),C.selectAll(".tick").attr("font-size",Gt).attr("color","var(--color-bg)"),C.selectAll(".tick line").attr("stroke","var(--color-bg)").attr("stroke-width",x=>x%5==0?"2":"0.5"),C.select(".domain").attr("stroke","var(--color-bg)"),d.value[0]<0&&A.append("path").attr("d",k.value).attr("stroke","var(--color-fg)"),A.append("path").attr("d",p.value).attr("stroke","green"),A.append("path").attr("d",c.value).attr("stroke","red");const M=A.selectAll("ttip").data(s.value).enter().append("g").attr("class","ttarea");M.append("rect").attr("x",x=>h.value(x[0])).attr("y",x=>u.value(x[1])).attr("height",x=>u.value(d.value[0])-u.value(x[1])).attr("class","ttrect").attr("width",o.value).attr("opacity","1%").attr("fill","var(--color-charging)");const E=M.append("g").attr("class","ttmessage").attr("transform",x=>"translate("+(h.value(x[0])-30+o.value/2)+","+(u.value(x[1])-16)+")");E.append("rect").attr("rx",5).attr("width","60").attr("height","30").attr("fill","var(--color-menu)");const I=E.append("text").attr("text-anchor","middle").attr("x",30).attr("y",12).attr("font-size",Gt).attr("fill","var(--color-bg)");return I.append("tspan").attr("x",30).attr("dy","0em").text(x=>st("%H:%M")(x[0])),I.append("tspan").attr("x",30).attr("dy","1.1em").text(x=>Math.round(x[1]*10)/10+" ct"),"PriceChart.vue"}),B=m(()=>"priceChartCanvas"+e.id);return Le(()=>{t.value=!t.value}),(A,V)=>(l(),$(je,{"variable-width":!0},{title:_(()=>V[0]||(V[0]=[n("span",{class:"fas fa-coins me-2",style:{color:"var(--color-battery)"}}," ",-1),n("span",null,"Strompreis",-1)])),buttons:_(()=>[i(re).active?(l(),$(Pe,{key:0,bgcolor:"var(--color-charging)"},{default:_(()=>[H(S(i(re).etCurrentPriceString),1)]),_:1})):w("",!0),i(re).active?(l(),$(Pe,{key:1,bgcolor:"var(--color-menu)"},{default:_(()=>[H(S(i(re).etProvider),1)]),_:1})):w("",!0)]),default:_(()=>[n("div",cu,[n("figure",uu,[(l(),f("svg",du,[n("g",{id:B.value,origin:D.value,transform:"translate("+r.top+","+r.left+") "},null,8,hu)]))])])]),_:1}))}}),jt=R(pu,[["__scopeId","data-v-6000c955"]]),gu={class:"subgrid pt-1"},mu=L({__name:"IlInverter",props:{inverter:{}},setup(a){const e=a,t=m(()=>({color:e.inverter.color}));return(r,s)=>(l(),$(tt,{titlecolor:"var(--color-title)",fullwidth:!0},{title:_(()=>[n("span",{class:"invertername",style:K(t.value)},S(r.inverter.name),5)]),buttons:_(()=>[e.inverter.power<0?(l(),$(Pe,{key:0,bgcolor:"var(--color-pv)"},{default:_(()=>[H(S(i($e)(-e.inverter.power)),1)]),_:1})):w("",!0)]),default:_(()=>[n("div",gu,[v(X,{heading:"Heute:",small:!0,class:"grid-col-4 grid-left"},{default:_(()=>[v(Ge,{"watt-h":e.inverter.energy},null,8,["watt-h"])]),_:1}),v(X,{heading:"Monat:",small:!0,class:"grid-col-4"},{default:_(()=>[v(Ge,{"watt-h":e.inverter.energy_month},null,8,["watt-h"])]),_:1}),v(X,{heading:"Jahr:",small:!0,class:"grid-right grid-col-4"},{default:_(()=>[v(Ge,{"watt-h":e.inverter.energy_year},null,8,["watt-h"])]),_:1})])]),_:1}))}}),fu=R(mu,[["__scopeId","data-v-258d8f17"]]),vu=L({__name:"InverterList",setup(a){return(e,t)=>(l(),$(je,{"variable-width":!0},{title:_(()=>t[0]||(t[0]=[n("span",{class:"fas fa-solar-panel me-2",style:{color:"var(--color-pv)"}}," ",-1),n("span",null,"Wechselrichter",-1)])),buttons:_(()=>[i(Q).pv.power>0?(l(),$(Pe,{key:0,bgcolor:"var(--color-pv)"},{default:_(()=>[H(S(i($e)(i(Q).pv.power)),1)]),_:1})):w("",!0)]),default:_(()=>[(l(!0),f(F,null,te(i(we),([r,s])=>(l(),f("div",{key:r,class:"subgrid pb-2"},[v(fu,{inverter:s},null,8,["inverter"])]))),128))]),_:1}))}}),Ut=R(vu,[["__scopeId","data-v-b7a71f81"]]),yu={class:"row py-0 px-0 m-0"},bu=["breakpoints"],_u=L({__name:"CarouselFix",setup(a){let e,t;const r=ee(!1),s=m(()=>r.value?{992:{slidesPerView:1,spaceBetween:0}}:{992:{slidesPerView:3,spaceBetween:0}});return Ka(()=>g.zoomGraph,o=>{if(e){let h=o?"1":"3";t.setAttribute("slides-per-view",h),e.activeIndex=g.zoomedWidget,e.update()}}),Le(()=>{let o=document.querySelector(".swiper-carousel");o&&(t=o,e=t.swiper)}),(o,h)=>(l(),f("div",yu,[n("swiper-container",{"space-between":0,pagination:{clickable:!0},"slides-per-view":"1",class:"p-0 m-0 swiper-carousel",breakpoints:s.value},[n("swiper-slide",null,[n("div",{class:q([i(De)?"mb-0":"mb-5","flex-fill d-flex align-items-stretch"])},[pe(o.$slots,"item1",{},void 0,!0)],2)]),n("swiper-slide",null,[n("div",{class:q([i(De)?"mb-0":"mb-5","flex-fill d-flex align-items-stretch"])},[pe(o.$slots,"item2",{},void 0,!0)],2)]),n("swiper-slide",null,[n("div",{class:q([i(De)?"mb-0":"mb-5","flex-fill d-flex align-items-stretch"])},[pe(o.$slots,"item3",{},void 0,!0)],2)])],8,bu)]))}}),wu=R(_u,[["__scopeId","data-v-17424929"]]);function ku(a,e){a=="openWB/graph/boolDisplayLiveGraph"?de.displayLiveGraph=+e==1:a.match(/^openwb\/graph\/alllivevaluesJson[1-9][0-9]*$/i)?xu(a,e):a=="openWB/graph/lastlivevaluesJson"?Su(a,e):a=="openWB/graph/config/duration"&&(ge.duration=JSON.parse(e))}function xu(a,e){if(!ge.initialized){let t=[];const r=e.toString().split(` +`);r.length>1?t=r.map(h=>JSON.parse(h)):t=[];const s=a.match(/(\d+)$/g),o=s?s[0]:"";o!=""&&typeof ge.rawDataPacks[+o-1]>"u"&&(ge.rawDataPacks[+o-1]=t,ge.initCounter++)}if(ge.initCounter==16){const t=[];ge.unsubscribeRefresh(),ge.initialized=!0,ge.rawDataPacks.forEach(r=>{r.forEach(s=>{const o=za(s);t.push(o)})}),yt(t),ge.subscribeUpdates()}}function Su(a,e){const t=JSON.parse(e),r=za(t);ge.graphRefreshCounter++,yt(y.data.concat(r)),ge.graphRefreshCounter>60&&ge.activate()}function za(a){const e=Object.values(O).length>0?Object.values(O)[0].connectedVehicle:0,t=Object.values(O).length>1?Object.values(O)[1].connectedVehicle:1,r="ev"+e+"-soc",s="ev"+t+"-soc",o={};o.date=+a.timestamp*1e3,+a.grid>0?(o.evuIn=+a.grid,o.evuOut=0):+a.grid<=0?(o.evuIn=0,o.evuOut=-a.grid):(o.evuIn=0,o.evuOut=0),+a["pv-all"]>=0?(o.pv=+a["pv-all"],o.inverter=0):(o.pv=0,o.inverter=-a["pv-all"]),o.house=+a["house-power"],+a["bat-all-power"]>0?(o.batOut=0,o.batIn=+a["bat-all-power"]):+a["bat-all-power"]<0?(o.batOut=-a["bat-all-power"],o.batIn=0):(o.batOut=0,o.batIn=0),a["bat-all-soc"]?o.batSoc=+a["bat-all-soc"]:o.batSoc=0,a[r]&&(o["soc"+e]=+a[r]),a[s]&&(o["soc"+t]=+a[s]),o.charging=+a["charging-all"];for(let h=0;h<10;h++){const d="cp"+h;o[d]=+(a[d+"-power"]??0)}return o.selfUsage=o.pv-o.evuOut,o.selfUsage<0&&(o.selfUsage=0),o.devices=0,o}const Mu=["evuIn","pv","batOut","evuOut","charging","house"];let $t=[];function $u(a,e){const{entries:t,names:r,totals:s}=JSON.parse(e);Fe.value=new Map(Object.entries(r)),aa(),$t=[],Zt.forEach(h=>{T.setEnergyPv(h,0),T.setEnergyBat(h,0)});const o=Pu(t);yt(o),Xt(s,$t),g.debug&&Cu(t,s,o),y.graphMode=="today"&&setTimeout(()=>ue.activate(),3e5)}function Pu(a){const e=[];let t={};return a.forEach(r=>{t=Iu(r);const s=t;e.push(s)}),e}function Iu(a){const e={};e.date=a.timestamp*1e3,e.evuOut=0,e.evuIn=0,Object.entries(a.counter).forEach(([s,o])=>{o.grid&&(e.evuOut+=o.power_exported,e.evuIn+=o.power_imported,$t.includes(s)||$t.push(s))}),e.evuOut==0&&e.evuIn==0&&Object.entries(a.counter).forEach(s=>{e.evuOut+=s[1].power_exported,e.evuIn+=s[1].power_imported}),Object.entries(a.pv).forEach(([s,o])=>{s!="all"?e[s]=o.power_exported:e.pv=o.power_exported}),Object.entries(a.bat).length>0?(e.batIn=a.bat.all.power_imported,e.batOut=a.bat.all.power_exported,e.batSoc=a.bat.all.soc??0):(e.batIn=0,e.batOut=0,e.batSoc=0),Object.entries(a.cp).forEach(([s,o])=>{s!="all"?(e[s]=o.power_imported,T.keys().includes(s)||T.addItem(s)):e.charging=o.power_imported}),Object.entries(a.ev).forEach(([s,o])=>{s!="all"&&(e["soc"+s.substring(2)]=o.soc)}),e.devices=0;let t=0;return Object.entries(a.sh).forEach(([s,o])=>{var h;s!="all"&&(e[s]=o.power_imported??0,T.keys().includes(s)||(T.addItem(s),T.items[s].showInGraph=ae.get(+s.slice(2)).showInGraph),(h=ae.get(+s.slice(2)))!=null&&h.countAsHouse?t+=e[s]:e.devices+=o.power_imported??0)}),e.selfUsage=Math.max(0,e.pv-e.evuOut),a.hc&&a.hc.all?e.house=a.hc.all.power_imported-t:e.house=e.evuIn+e.batOut+e.pv-e.evuOut-e.charging-e.devices-e.batOut,e.evuIn+e.batOut+e.pv>0?T.keys().filter(s=>!Mu.includes(s)&&s!="charging").forEach(s=>{Mn(s,e)}):Object.keys(e).forEach(s=>{e[s+"Pv"]=0,e[s+"Bat"]=0}),e}function Cu(a,e,t){console.debug("---------------------------------------- Graph Data -"),console.debug(["--- Incoming graph data:",a]),console.debug(["--- Incoming energy data:",e]),console.debug(["--- Data to be displayed:",t]),console.debug("-----------------------------------------------------")}let kt={};const ra=["charging","house","batIn","devices"],Bu=["evuIn","pv","batOut","batIn","evuOut","devices","sh1","sh2","sh3","sh4","sh5","sh6","sh7","sh8","sh9"];let Ke=[];function Vu(a,e){const{entries:t,names:r,totals:s}=JSON.parse(e);Fe.value=new Map(Object.entries(r)),aa(),Ke=[],ra.forEach(o=>{T.items[o].energyPv=0,T.items[o].energyBat=0}),t.length>0&&yt(Wa(t)),Xt(s,Ke)}function Lu(a,e){const{entries:t,names:r,totals:s}=JSON.parse(e);Fe.value=new Map(Object.entries(r)),aa(),Ke=[],ra.forEach(o=>{T.items[o].energyPv=0,T.items[o].energyBat=0}),t.length>0&&yt(Wa(t)),Xt(s,Ke)}function Wa(a){const e=[];let t={};return kt={},a.forEach(r=>{t=Ou(r),e.push(t),Object.keys(t).forEach(s=>{s!="date"&&(t[s]<0&&(console.warn(`Negative energy value for ${s} in row ${t.date}. Ignoring the value.`),t[s]=0),kt[s]?kt[s]+=t[s]:kt[s]=t[s])})}),e}function Ou(a){const e={},t=en("%Y%m%d")(a.date);t&&(e.date=y.graphMode=="month"?t.getDate():t.getMonth()+1),e.evuOut=0,e.evuIn=0;let r=0,s=0;return Object.entries(a.counter).forEach(([h,d])=>{r+=d.energy_exported,s+=d.energy_imported,d.grid&&(e.evuOut+=d.energy_exported,e.evuIn+=d.energy_imported,Ke.includes(h)||Ke.push(h))}),Ke.length==0&&(e.evuOut=r,e.evuIn=s),e.pv=a.pv.all.energy_exported,Object.entries(a.bat).length>0?(a.bat.all.energy_imported>=0?e.batIn=a.bat.all.energy_imported:(console.warn("ignoring negative value for batIn on day "+e.date),e.batIn=0),a.bat.all.energy_exported>=0?e.batOut=a.bat.all.energy_exported:(console.warn("ignoring negative value for batOut on day "+e.date),e.batOut=0)):(e.batIn=0,e.batOut=0),Object.entries(a.cp).forEach(([h,d])=>{h!="all"?(T.keys().includes(h)||T.addItem(h),e[h]=d.energy_imported):e.charging=d.energy_imported}),Object.entries(a.ev).forEach(([h,d])=>{h!="all"&&(e["soc-"+h]=d.soc)}),e.devices=Object.entries(a.sh).reduce((h,d)=>(T.keys().includes(d[0])||T.addItem(d[0]),d[1].energy_imported>=0?h+=d[1].energy_imported:console.warn(`Negative energy value for device ${d[0]} in row ${e.date}. Ignoring this value`),h),0),a.hc&&a.hc.all?e.house=a.hc.all.energy_imported:e.house=e.pv+e.evuIn+e.batOut-e.evuOut-e.batIn-e.charging,e.selfUsage=e.pv-e.evuOut,e.evuIn+e.batOut+e.pv>0?T.keys().filter(h=>!Bu.includes(h)).forEach(h=>{$n(h,e)}):ra.map(h=>{e[h+"Pv"]=0,e[h+"Bat"]=0}),e}function Au(a,e){const t=Tu(a);if(t&&!he.value.has(t)){console.warn("Invalid battery index: ",t);return}a=="openWB/bat/config/configured"?de.isBatteryConfigured=e=="true":a=="openWB/bat/get/power"?+e>0?(U.batIn.power=+e,Q.batOut.power=0):(U.batIn.power=0,Q.batOut.power=-e):a=="openWB/bat/get/soc"?de.batterySoc=+e:a=="openWB/bat/get/daily_exported"?Q.batOut.energy=+e:a=="openWB/bat/get/daily_imported"?U.batIn.energy=+e:t&&he.value.has(t)&&(a.match(/^openwb\/bat\/[0-9]+\/get\/daily_exported$/i)?he.value.get(t).dailyYieldExport=+e:a.match(/^openwb\/bat\/[0-9]+\/get\/daily_imported$/i)?he.value.get(t).dailyYieldImport=+e:a.match(/^openwb\/bat\/[0-9]+\/get\/exported$/i)?he.value.get(t).exported=+e:a.match(/^openwb\/bat\/[0-9]+\/get\/fault_state$/i)?he.value.get(t).faultState=+e:a.match(/^openwb\/bat\/[0-9]+\/get\/fault_str$/i)?he.value.get(t).faultStr=e:a.match(/^openwb\/bat\/[0-9]+\/get\/imported$/i)?he.value.get(t).imported=+e:a.match(/^openwb\/bat\/[0-9]+\/get\/power$/i)?he.value.get(t).power=+e:a.match(/^openwb\/bat\/[0-9]+\/get\/soc$/i)&&(he.value.get(t).soc=+e))}function Tu(a){let e=0;try{const t=a.match(/(?:\/)([0-9]+)(?=\/)/g);return t?(e=+t[0].replace(/[^0-9]+/g,""),e):void 0}catch(t){console.warn("Parser error in getIndex for topic "+a+": "+t)}}function Eu(a,e){if(a=="openWB/optional/et/provider")JSON.parse(e).type==null?re.active=!1:(re.active=!0,re.etProvider=JSON.parse(e).name);else if(a=="openWB/optional/et/get/prices"){const t=JSON.parse(e);re.etPriceList=new Map,Object.keys(t).forEach(r=>{re.etPriceList.set(new Date(+r*1e3),t[r]*1e5)})}}function zu(a,e){const t=Da(a);if(t&&!(t in O)){console.warn("Invalid chargepoint id received: "+t);return}if(a=="openWB/chargepoint/get/power"?U.charging.power=+e:a=="openWB/chargepoint/get/daily_imported"&&(U.charging.energy=+e),a=="openWB/chargepoint/get/daily_exported")de.cpDailyExported=+e;else if(t){if(a.match(/^openwb\/chargepoint\/[0-9]+\/config$/i))if(O[t]){const r=JSON.parse(e);O[t].name=r.name,O[t].icon=r.name,ie["cp"+t]?(ie["cp"+t].name=r.name,ie["cp"+t].icon=r.name):ie["cp"+t]={name:r.name,icon:r.name,color:"var(--color-charging)"}}else console.warn("invalid chargepoint index: "+t);else if(a.match(/^openwb\/chargepoint\/[0-9]+\/get\/state_str$/i))O[t].stateStr=JSON.parse(e);else if(a.match(/^openwb\/chargepoint\/[0-9]+\/get\/fault_str$/i))O[t].faultStr=JSON.parse(e);else if(a.match(/^openwb\/chargepoint\/[0-9]+\/get\/fault_state$/i))O[t].faultState=+e;else if(a.match(/^openWB\/chargepoint\/[0-9]+\/get\/power$/i))O[t].power=+e;else if(a.match(/^openWB\/chargepoint\/[0-9]+\/get\/daily_imported$/i))O[t].dailyYield=+e;else if(a.match(/^openwb\/chargepoint\/[0-9]+\/get\/plug_state$/i))O[t].isPluggedIn=e=="true";else if(a.match(/^openwb\/chargepoint\/[0-9]+\/get\/charge_state$/i))O[t].isCharging=e=="true";else if(a.match(/^openwb\/chargepoint\/[0-9]+\/set\/manual_lock$/i))O[t].updateIsLocked(e=="true");else if(a.match(/^openwb\/chargepoint\/[0-9]+\/get\/enabled$/i))O[t].isEnabled=e=="1";else if(a.match(/^openwb\/chargepoint\/[0-9]+\/get\/phases_in_use/i))O[t].phasesInUse=+e;else if(a.match(/^openwb\/chargepoint\/[0-9]+\/set\/current/i))O[t].current=+e;else if(a.match(/^openwb\/chargepoint\/[0-9]+\/get\/currents/i))O[t].currents=JSON.parse(e);else if(a.match(/^openwb\/chargepoint\/[0-9]+\/set\/log/i)){const r=JSON.parse(e);O[t].chargedSincePlugged=r.imported_since_plugged}else if(a.match(/^openwb\/chargepoint\/[0-9]+\/get\/connected_vehicle\/soc$/i)){const r=JSON.parse(e);O[t].soc=r.soc,O[t].waitingForSoc=!1,O[t].rangeCharged=r.range_charged,O[t].rangeUnit=r.range_unit}else if(a.match(/^openwb\/chargepoint\/[0-9]+\/get\/connected_vehicle\/info$/i)){const r=JSON.parse(e);O[t].vehicleName=String(r.name),O[t].updateConnectedVehicle(+r.id)}else if(a.match(/^openwb\/chargepoint\/[0-9]+\/get\/connected_vehicle\/config$/i)){const r=JSON.parse(e);switch(r.chargemode){case"instant_charging":O[t].updateChargeMode(ve.instant_charging);break;case"pv_charging":O[t].updateChargeMode(ve.pv_charging);break;case"scheduled_charging":O[t].updateChargeMode(ve.scheduled_charging);break;case"standby":O[t].updateChargeMode(ve.standby);break;case"stop":O[t].updateChargeMode(ve.stop);break}O[t].chargeTemplate=r.charge_template,O[t].averageConsumption=r.average_consumption}}}function Wu(a,e){const t=Da(a);if(t!=null){if(!(t in Y)){const r=new yn(t);Y[t]=r}if(a.match(/^openwb\/vehicle\/[0-9]+\/name$/i))Object.values(O).forEach(r=>{r.connectedVehicle==t&&(r.vehicleName=JSON.parse(e))}),Y[t].name=JSON.parse(e);else if(a.match(/^openwb\/vehicle\/[0-9]+\/get\/soc$/i))Y[t].soc=JSON.parse(e);else if(a.match(/^openwb\/vehicle\/[0-9]+\/get\/range$/i))isNaN(+e)?Y[t].range=0:Y[t].range=+e;else if(a.match(/^openwb\/vehicle\/[0-9]+\/charge_template$/i))Y[t].updateChargeTemplateId(+e);else if(a.match(/^openwb\/vehicle\/[0-9]+\/ev_template$/i))Y[t].updateEvTemplateId(+e);else if(a.match(/^openwb\/vehicle\/[0-9]+\/soc_module\/config$/i)){const r=JSON.parse(e);Object.values(O).forEach(s=>{s.connectedVehicle==t&&(s.isSocConfigured=r.type!==null,s.isSocManual=r.type=="manual")})}}}function Du(a,e){if(a.match(/^openwb\/vehicle\/template\/charge_template\/[0-9]+$/i)){const t=a.match(/[0-9]+$/i);if(t){const r=+t[0],s=JSON.parse(e);_e[r]=s,Gu(r,s)}}else if(a.match(/^openwb\/vehicle\/template\/charge_template\/[0-9]+\/time_charging\/plans\/[0-9]+$/i)){const t=a.match(/(?:\/)([0-9]+)(?:\/)/g),r=a.match(/[0-9]+$/i);if(t&&r){const s=+t[0].replace(/[^0-9]+/g,""),o=+r[0],h=JSON.parse(e);s in gt||(gt[s]=[]),gt[s][o]=h}}else if(a.match(/^openwb\/vehicle\/template\/charge_template\/[0-9]+\/chargemode\/scheduled_charging\/plans\/[0-9]+$/i)){const t=a.match(/(?:\/)([0-9]+)(?:\/)/g),r=a.match(/[0-9]+$/i);if(t&&r){const s=+t[0].replace(/[^0-9]+/g,""),o=+r[0],h=JSON.parse(e);s in pt||(pt[s]=[]),pt[s][o]=h}}else if(a.match(/^openwb\/vehicle\/template\/ev_template\/[0-9]+$/i)){const t=a.match(/[0-9]+$/i);if(t){const r=+t[0],s=JSON.parse(e);Ht[r]=s}}}function Gu(a,e){Object.values(O).forEach(t=>{t.chargeTemplate==a&&(t.updateCpPriority(e.prio),t.updateInstantChargeLimitMode(e.chargemode.instant_charging.limit.selected),t.updateInstantTargetCurrent(e.chargemode.instant_charging.current),t.updateInstantTargetSoc(e.chargemode.instant_charging.limit.soc),t.updateInstantMaxEnergy(e.chargemode.instant_charging.limit.amount),t.updatePvFeedInLimit(e.chargemode.pv_charging.feed_in_limit),t.updatePvMinCurrent(e.chargemode.pv_charging.min_current),t.updatePvMaxSoc(e.chargemode.pv_charging.max_soc),t.updatePvMinSoc(e.chargemode.pv_charging.min_soc),t.updatePvMinSocCurrent(e.chargemode.pv_charging.min_soc_current))})}function Da(a){let e=0;try{const t=a.match(/(?:\/)([0-9]+)(?=\/)/g);return t?(e=+t[0].replace(/[^0-9]+/g,""),e):void 0}catch(t){console.warn("Parser error in getIndex for topic "+a+": "+t)}}function ju(a,e){a.match(/^openWB\/LegacySmarthome\/config\//i)?Uu(a,e):a.match(/^openWB\/LegacySmarthome\/Devices\//i)&&Fu(a,e)}function Uu(a,e){const t=Ga(a);if(t==null)return;ae.has(t)||Yt(t);const r=ae.get(t);a.match(/^openWB\/LegacySmarthome\/config\/get\/Devices\/[0-9]+\/device_configured$/i)?r.configured=e!="0":a.match(/^openWB\/LegacySmarthome\/config\/get\/Devices\/[0-9]+\/device_name$/i)?(r.name=e.toString(),r.icon=e.toString(),ie["sh"+t].name=e.toString(),ie["sh"+t].icon=e.toString()):a.match(/^openWB\/LegacySmarthome\/config\/set\/Devices\/[0-9]+\/mode$/i)?r.isAutomatic=e=="0":a.match(/^openWB\/LegacySmarthome\/config\/get\/Devices\/[0-9]+\/device_canSwitch$/i)?r.canSwitch=e=="1":a.match(/^openWB\/LegacySmarthome\/config\/get\/Devices\/[0-9]+\/device_homeConsumtion$/i)?r.countAsHouse=e=="1":a.match(/^openWB\/LegacySmarthome\/config\/get\/Devices\/[0-9]+\/device_temperatur_configured$/i)&&(r.tempConfigured=+e)}function Fu(a,e){const t=Ga(a);if(t==null){console.warn("Smarthome: Missing index in "+a);return}ae.has(t)||Yt(t);const r=ae.get(t);if(a.match(/^openWB\/LegacySmarthome\/Devices\/[0-9]+\/Watt$/i))r.power=+e,Nu("power");else if(!a.match(/^openWB\/LegacySmarthome\/Devices\/[0-9]+\/Wh$/i)){if(a.match(/^openWB\/LegacySmarthome\/Devices\/[0-9]+\/RunningTimeToday$/i))r.runningTime=+e;else if(a.match(/^openWB\/LegacySmarthome\/Devices\/[0-9]+\/TemperatureSensor0$/i))r.temp[0]=+e;else if(a.match(/^openWB\/LegacySmarthome\/Devices\/[0-9]+\/TemperatureSensor1$/i))r.temp[1]=+e;else if(a.match(/^openWB\/LegacySmarthome\/Devices\/[0-9]+\/TemperatureSensor2$/i))r.temp[2]=+e;else if(a.match(/^openWB\/LegacySmartHome\/Devices\/[0-9]+\/Status$/i))switch(+e){case 10:r.status="off";break;case 11:r.status="on";break;case 20:r.status="detection";break;case 30:r.status="timeout";break;default:r.status="off"}}}function Nu(a){switch(a){case"power":U.devices.power=[...ae.values()].filter(e=>e.configured&&!e.countAsHouse).reduce((e,t)=>e+t.power,0);break;case"energy":U.devices.energy=[...ae.values()].filter(e=>e.configured&&!e.countAsHouse).reduce((e,t)=>e+t.energy,0);break;default:console.error("Unknown category")}}function Ga(a){let e=0;try{const t=a.match(/(?:\/)([0-9]+)(?=\/)/g);return t?(e=+t[0].replace(/[^0-9]+/g,""),e):void 0}catch(t){console.warn("Parser error in getIndex for topic "+a+": "+t)}}const Pt=le([]);class oa{constructor(e,t,r,s){b(this,"name");b(this,"children");b(this,"count");b(this,"lastValue");this.name=e,this.children=t,this.count=r,this.lastValue=s}insert(e,t){if(e.length){const r=e.splice(1);if(e[0]==this.name)if(r.length){let s=!1;if(this.children.forEach(o=>{o.name==r[0]&&(o.insert(r,t),s=!0)}),!s){const o=new oa(r[0],[],0,"");o.insert(r,t),this.children.push(o)}}else this.count=this.count+1,this.lastValue=t}}}function Hu(a,e){const t=a.split("/");if(t.length){let r=!1;if(Pt.forEach(s=>{s.name==t[0]&&(s.insert(t,e),r=!0)}),!r){const s=new oa(t[0],[],0,"");Pt.push(s),s.insert(t,e)}}}const Ru=["openWB/counter/#","openWB/bat/#","openWB/pv/#","openWB/chargepoint/#","openWB/vehicle/#","openWB/general/chargemode_config/pv_charging/#","openWB/optional/et/#","openWB/system/#","openWB/LegacySmartHome/#","openWB/command/"+qt()+"/#"];function Ju(){mn(Yu),Ru.forEach(a=>{Xe(a)}),fe()}function Yu(a,e){Hu(a,e.toString());const t=e.toString();a.match(/^openwb\/counter\/[0-9]+\//i)?qu(a,t):a.match(/^openwb\/counter\//i)?Qu(a,t):a.match(/^openwb\/bat\//i)?Au(a,t):a.match(/^openwb\/pv\//i)?Zu(a,t):a.match(/^openwb\/chargepoint\//i)?zu(a,t):a.match(/^openwb\/vehicle\/template\//i)?Du(a,t):a.match(/^openwb\/vehicle\//i)?Wu(a,t):a.match(/^openwb\/general\/chargemode_config\/pv_charging\//i)?Xu(a,t):a.match(/^openwb\/graph\//i)?ku(a,t):a.match(/^openwb\/log\/daily\//i)?$u(a,t):a.match(/^openwb\/log\/monthly\//i)?Vu(a,t):a.match(/^openwb\/log\/yearly\//i)?Lu(a,t):a.match(/^openwb\/optional\/et\//i)?Eu(a,t):a.match(/^openwb\/system\//i)?ed(a,t):a.match(/^openwb\/LegacySmartHome\//i)?ju(a,t):a.match(/^openwb\/command\//i)&&td(a,t)}function qu(a,e){const t=a.split("/"),r=+t[2];if(r==de.evuId?Ku(a,e):t[3]=="config",t[3]=="get"&&r in ke)switch(t[4]){case"power":ke[r].power=+e;break;case"config":break;case"fault_str":break;case"fault_state":break;case"power_factors":break;case"imported":break;case"exported":break;case"frequency":break;case"daily_imported":ke[r].energy_imported=+e;break;case"daily_exported":ke[r].energy_exported=+e;break}}function Qu(a,e){if(a.match(/^openwb\/counter\/get\/hierarchy$/i)){const t=JSON.parse(e);if(t.length){_n(),is();for(const r of t)r.type=="counter"&&(de.evuId=r.id);ja(t[0])}}else a.match(/^openwb\/counter\/set\/home_consumption$/i)?U.house.power=+e:a.match(/^openwb\/counter\/set\/daily_yield_home_consumption$/i)&&(U.house.energy=+e)}function ja(a){switch(a.type){case"counter":au(a.id,a.type);break;case"cp":bn(a.id);break;case"bat":Aa(a.id);break}a.children.forEach(e=>ja(e))}function Zu(a,e){const t=ad(a);t&&!we.value.has(t)&&zn(t),a=="openWB/pv/get/power"?Q.pv.power=-e:a=="openWB/pv/get/daily_exported"?Q.pv.energy=+e:a.match(/^openWB\/pv\/[0-9]+\/get\/power$/i)?we.value.get(t).power=+e:a.match(/^openWB\/pv\/[0-9]+\/get\/daily_exported$/i)?we.value.get(t).energy=+e:a.match(/^openWB\/pv\/[0-9]+\/get\/monthly_exported$/i)?we.value.get(t).energy_month=+e:a.match(/^openWB\/pv\/[0-9]+\/get\/yearly_exported$/i)?we.value.get(t).energy_year=+e:a.match(/^openWB\/pv\/[0-9]+\/get\/exported$/i)&&(we.value.get(t).energy_total=+e)}function Xu(a,e){const t=a.split("/");if(t.length>0)switch(t[4]){case"bat_mode":de.updatePvBatteryPriority(JSON.parse(e));break}}function Ku(a,e){switch(a.split("/")[4]){case"power":+e>0?(Q.evuIn.power=+e,U.evuOut.power=0):(Q.evuIn.power=0,U.evuOut.power=-e);break;case"daily_imported":Q.evuIn.energy=+e;break;case"daily_exported":U.evuOut.energy=+e;break}}function ed(a,e){if(a.match(/^openWB\/system\/device\/[0-9]+\/component\/[0-9]+\/config$/i)){const t=JSON.parse(e);switch(t.type){case"counter":case"consumption_counter":ke[t.id]&&(ke[t.id].name=t.name);break;case"inverter":case"inverter_secondary":we.value.has(t.id)||we.value.set(t.id,new $a(t.id)),we.value.get(t.id).name=t.name;break;case"bat":he.value.has(t.id)||Aa(t.id),he.value.get(t.id).name=t.name}}}function td(a,e){const t=a.split("/");if(a.match(/^openWB\/command\/[a-z]+\/error$/i)&&t[2]==qt()){const r=JSON.parse(e);console.error(`Error message from openWB: +Command: ${r.command} +Data: JSON.stringify(err.data) +Error: + ${r.error}`)}}function ad(a){let e=0;try{const t=a.match(/(?:\/)([0-9]+)(?=\/)/g);return t?(e=+t[0].replace(/[^0-9]+/g,""),e):void 0}catch(t){console.warn("Parser error in getIndex for topic "+a+": "+t)}}const nd={key:0,class:"fas fa-caret-down"},rd={key:1,class:"fas fa-caret-right"},od={key:0,class:"content p-2 m-2"},sd={key:1,class:"sublist col-md-9 m-0 p-0 ps-2"},id=L({__name:"MqttNode",props:{node:{},level:{},hide:{type:Boolean},expandAll:{type:Boolean}},setup(a){const e=a;let t=ee(!e.hide),r=ee(!1);const s=m(()=>e.node.name),o=m(()=>[...e.node.children].sort((c,k)=>c.namee.node.count>0?"("+e.node.count+")":""),d=m(()=>e.node.children.length),u=m(()=>e.node.lastValue!=""?{"font-style":"italic","grid-column-start":e.level,"grid-column-end":-1}:{"grid-column-start":e.level,"grid-column-end":-1});function p(){d.value>0&&(t.value=!t.value),e.node.lastValue!=""&&(r.value=!r.value)}return(c,k)=>{const P=tn("MqttNode",!0);return l(),f(F,null,[n("div",{class:"name py-2 px-2 m-0",style:K(u.value),onClick:p},[(i(t)||e.expandAll)&&d.value>0||i(r)?(l(),f("span",nd)):(l(),f("span",rd)),H(" "+S(s.value)+S(h.value),1)],4),i(r)?(l(),f("div",od,[n("code",null,S(e.node.lastValue),1)])):w("",!0),(i(t)||e.expandAll)&&d.value>0?(l(),f("div",sd,[(l(!0),f(F,null,te(o.value,(z,D)=>(l(),$(P,{key:D,level:e.level+1,node:z,hide:!0,"expand-all":e.expandAll},null,8,["level","node","expand-all"]))),128))])):w("",!0)],64)}}}),ld=R(id,[["__scopeId","data-v-df7e578a"]]),cd={class:"mqviewer"},ud={class:"row pt-2"},dd={class:"col"},hd={key:0,class:"topiclist"},pd=L({__name:"MQTTViewer",setup(a){Le(()=>{});const e=ee(!1);function t(){e.value=!e.value}const r=m(()=>e.value?"active":"");return(s,o)=>(l(),f("div",cd,[n("div",ud,[n("div",dd,[o[0]||(o[0]=n("h3",{class:"mqtitle ps-2"},"MQTT Message Viewer",-1)),o[1]||(o[1]=n("hr",null,null,-1)),n("button",{class:q(["btn btn-small btn-outline-primary ms-2",r.value]),onClick:t}," Expand All ",2),o[2]||(o[2]=n("hr",null,null,-1))])]),i(Pt)[0]?(l(),f("div",hd,[(l(!0),f(F,null,te(i(Pt)[0].children.sort((h,d)=>h.name(l(),$(ld,{key:d,node:h,level:1,hide:!0,"expand-all":e.value},null,8,["node","expand-all"]))),128))])):w("",!0)]))}}),gd=R(pd,[["__scopeId","data-v-a349646d"]]),md=["value"],fd=L({__name:"SelectInput",props:{options:{},modelValue:{}},emits:["update:modelValue"],setup(a,{emit:e}){const t=a,r=e,s=m({get(){return t.modelValue},set(o){r("update:modelValue",o)}});return(o,h)=>vt((l(),f("select",{id:"selectme","onUpdate:modelValue":h[0]||(h[0]=d=>s.value=d),class:"form-select"},[(l(!0),f(F,null,te(o.options,(d,u)=>(l(),f("option",{key:u,value:d[1]},S(d[0]),9,md))),128))],512)),[[an,s.value]])}}),vd=R(fd,[["__scopeId","data-v-5e33ce1f"]]),yd={class:"subgrid m-0 p-0"},bd={class:"settingscolumn"},_d={class:"settingscolumn"},wd={class:"settingscolumn"},kd=L({__name:"ThemeSettings",emits:["reset-arcs"],setup(a,{emit:e}){const t=e,r=[["Dunkel","dark"],["Hell","light"],["Blau","blue"]],s=[["3 kW","0"],["3,1 kW","1"],["3,14 kW","2"],["3,141 kW","3"],["3141 W","4"]],o=[["Orange","normal"],["Grün/Violett","standard"],["Bunt","advanced"]],h=[["Aus","off"],["Menü","navbar"],["Buttonleiste","buttonbar"]],d=[["Aus","no"],['"Alles"-Reiter',"infoview"],["Immer","always"]];return(u,p)=>(l(),$(je,{"full-width":!0},{title:_(()=>p[23]||(p[23]=[H(" Look & Feel ")])),buttons:_(()=>p[24]||(p[24]=[n("span",{type:"button",class:"float-end mt-0 ms-1","data-bs-toggle":"collapse","data-bs-target":"#themesettings"},[n("span",null,[n("i",{class:"fa-solid fa-circle-check"})])],-1)])),default:_(()=>[n("div",yd,[n("div",bd,[v(N,{fullwidth:!0,title:"Farbschema",icon:"fa-adjust",infotext:"Hintergrundfarbe"},{default:_(()=>[v(We,{modelValue:i(g).displayMode,"onUpdate:modelValue":p[0]||(p[0]=c=>i(g).displayMode=c),options:r},null,8,["modelValue"])]),_:1}),v(N,{fullwidth:!0,title:"Farbschema Smart-Home-Geräte",icon:"fa-palette",infotext:"Für die Smart-Home-Geräte stehen mehrere Schemata zur Verfügung."},{default:_(()=>[v(We,{modelValue:i(g).smartHomeColors,"onUpdate:modelValue":p[1]||(p[1]=c=>i(g).smartHomeColors=c),options:o},null,8,["modelValue"])]),_:1}),v(N,{fullwidth:!0,title:"Grafik: Raster",icon:"fa-th",infotext:"Verwende ein Hintergrundraster in den Grafiken"},{default:_(()=>[v(se,{modelValue:i(g).showGrid,"onUpdate:modelValue":p[2]||(p[2]=c=>i(g).showGrid=c)},null,8,["modelValue"])]),_:1}),v(N,{fullwidth:!0,title:"Variable Bogenlänge",icon:"fa-chart-area",infotext:"Im Graph 'Aktuelle Leistung' können die Bögen immer die volle Länge haben, oder entsprechend des aktuellen Gesamtleistung verkürzt dargestellt werden."},{default:_(()=>[v(se,{modelValue:i(g).showRelativeArcs,"onUpdate:modelValue":p[3]||(p[3]=c=>i(g).showRelativeArcs=c)},null,8,["modelValue"])]),_:1}),i(g).showRelativeArcs?(l(),$(N,{key:0,fullwidth:!0,title:"Bögen zurücksetzen",icon:"fa-undo",infotext:"Durch Click auf den Button wird die Maximallänge der Bögen auf den aktuellen Wert gesetzt."},{default:_(()=>[i(g).showRelativeArcs?(l(),f("button",{key:0,class:"btn btn-secondary",onClick:p[4]||(p[4]=c=>t("reset-arcs"))}," Reset ")):w("",!0)]),_:1})):w("",!0),v(N,{fullwidth:!0,title:"Anzahl Dezimalstellen",icon:"fa-sliders-h",infotext:"Alle kW- und kWh-Werte werden mit der gewählten Anzahl an Stellen angezeigt."},{default:_(()=>[v(vd,{modelValue:i(g).decimalPlaces,"onUpdate:modelValue":p[5]||(p[5]=c=>i(g).decimalPlaces=c),options:s},null,8,["modelValue"])]),_:1}),v(N,{fullwidth:!0,title:"Uhrzeit anzeigen",icon:"fa-clock",infotext:"Zeige die aktuelle Uhrzeit an. In der Menüleiste oder neben den Lade-Buttons."},{default:_(()=>[v(We,{modelValue:i(g).showClock,"onUpdate:modelValue":p[6]||(p[6]=c=>i(g).showClock=c),options:h},null,8,["modelValue"])]),_:1}),v(N,{fullwidth:!0,title:"Kompakte Ladepunktliste",icon:"fa-list",infotext:"Zeige eine einzelne Ladepunktliste statt separater Element pro Ladepunkt."},{default:_(()=>[v(We,{modelValue:i(g).shortCpList,"onUpdate:modelValue":p[7]||(p[7]=c=>i(g).shortCpList=c),options:d},null,8,["modelValue"])]),_:1})]),n("div",_d,[v(N,{fullwidth:!0,title:"Buttonleiste für Ladepunkte",icon:"fa-window-maximize",infotext:"Informationen zu Ladepunkten über den Diagrammen anzeigen."},{default:_(()=>[v(se,{modelValue:i(g).showButtonBar,"onUpdate:modelValue":p[8]||(p[8]=c=>i(g).showButtonBar=c)},null,8,["modelValue"])]),_:1}),v(N,{fullwidth:!0,title:"Filter-Buttons",icon:"fa-filter",infotext:"Hauptseite mit Buttons zur Auswahl der Kategorie."},{default:_(()=>[v(se,{modelValue:i(g).showQuickAccess,"onUpdate:modelValue":p[9]||(p[9]=c=>i(g).showQuickAccess=c)},null,8,["modelValue"])]),_:1}),v(N,{fullwidth:!0,title:"Breite Widgets",icon:"fa-desktop",infotext:"Widgets immer breit machen"},{default:_(()=>[v(se,{modelValue:i(g).preferWideBoxes,"onUpdate:modelValue":p[10]||(p[10]=c=>i(g).preferWideBoxes=c)},null,8,["modelValue"])]),_:1}),v(N,{fullwidth:!0,title:"Stufenlose Displaybreite",icon:"fa-maximize",infotext:"Die Breite des Displays wird immer voll ausgenutzt. Dies kann in einigen Fällen zu inkorrekter Darstellung führen."},{default:_(()=>[v(se,{modelValue:i(g).fluidDisplay,"onUpdate:modelValue":p[11]||(p[11]=c=>i(g).fluidDisplay=c)},null,8,["modelValue"])]),_:1}),v(N,{fullwidth:!0,title:"Animationen",icon:"fa-film",infotext:"Animationen anzeigen"},{default:_(()=>[v(se,{modelValue:i(g).showAnimations,"onUpdate:modelValue":p[12]||(p[12]=c=>i(g).showAnimations=c)},null,8,["modelValue"])]),_:1}),v(N,{fullwidth:!0,title:"Zähler anzeigen",icon:"fa-chart-bar",infotext:"Zeige die Werte zusätzlich angelegter Zähler"},{default:_(()=>[v(se,{modelValue:i(g).showCounters,"onUpdate:modelValue":p[13]||(p[13]=c=>i(g).showCounters=c)},null,8,["modelValue"])]),_:1}),v(N,{fullwidth:!0,title:"Fahrzeuge anzeigen",icon:"fa-car",infotext:"Zeige alle Fahrzeuge mit Ladestand und Reichweite"},{default:_(()=>[v(se,{modelValue:i(g).showVehicles,"onUpdate:modelValue":p[14]||(p[14]=c=>i(g).showVehicles=c)},null,8,["modelValue"])]),_:1}),v(N,{fullwidth:!0,title:"Standardfahrzeug anzeigen",icon:"fa-car",infotext:"Zeige das Standard-Fahrzeug in der Fahzeugliste"},{default:_(()=>[v(se,{modelValue:i(g).showStandardVehicle,"onUpdate:modelValue":p[15]||(p[15]=c=>i(g).showStandardVehicle=c)},null,8,["modelValue"])]),_:1})]),n("div",wd,[v(N,{fullwidth:!0,title:"Wechselrichter-Details anzeigen",icon:"fa-solar-panel",infotext:"Zeige Details zu den einzelnen Wechselrichtern"},{default:_(()=>[v(se,{modelValue:i(g).showInverters,"onUpdate:modelValue":p[16]||(p[16]=c=>i(g).showInverters=c)},null,8,["modelValue"])]),_:1}),v(N,{fullwidth:!0,title:"Alternatives Energie-Widget",icon:"fa-chart-area",infotext:"Horizontale Darstellung der Energie-Werte"},{default:_(()=>[v(se,{modelValue:i(g).alternativeEnergy,"onUpdate:modelValue":p[17]||(p[17]=c=>i(g).alternativeEnergy=c)},null,8,["modelValue"])]),_:1}),v(N,{fullwidth:!0,title:"Preistabelle anzeigen",icon:"fa-car",infotext:"Zeige die Strompreistabelle in einer separaten Box an"},{default:_(()=>[v(se,{modelValue:i(g).showPrices,"onUpdate:modelValue":p[18]||(p[18]=c=>i(g).showPrices=c)},null,8,["modelValue"])]),_:1}),v(N,{fullwidth:!0,title:"Untere Markierung in der Preistabelle",icon:"fa-car",infotext:"Position der unteren Markierung festlegen"},{default:_(()=>[v(Me,{id:"lowerPriceBound",modelValue:i(g).lowerPriceBound,"onUpdate:modelValue":p[19]||(p[19]=c=>i(g).lowerPriceBound=c),min:-25,max:95,step:.1,decimals:1,unit:"ct"},null,8,["modelValue"])]),_:1}),v(N,{fullwidth:!0,title:"Obere Markierung in der Preistabelle",icon:"fa-car",infotext:"Position der oberen Markierung festlegen"},{default:_(()=>[v(Me,{id:"upperPriceBound",modelValue:i(g).upperPriceBound,"onUpdate:modelValue":p[20]||(p[20]=c=>i(g).upperPriceBound=c),min:-25,max:95,step:.1,decimals:1,unit:"ct"},null,8,["modelValue"])]),_:1}),v(N,{fullwidth:!0,title:"IFrame-Support für Einstellungen (Experimentell)",icon:"fa-gear",infotext:"Erlaubt das Lesen der Einstellungen, wenn das UI in andere Applikationen eingebettet ist (z.B. HomeAssistant). Erfordert eine mit SSL verschlüsselte Verbindung über HTTPS! Experimentelles Feature."},{default:_(()=>[v(se,{modelValue:i(g).sslPrefs,"onUpdate:modelValue":p[21]||(p[21]=c=>i(g).sslPrefs=c)},null,8,["modelValue"])]),_:1}),v(N,{fullwidth:!0,title:"Debug-Modus",icon:"fa-bug-slash",infotext:"Kontrollausgaben in der Console sowie Anzeige von Bildschirmbreite und MQ-Viewer"},{default:_(()=>[v(se,{modelValue:i(g).debug,"onUpdate:modelValue":p[22]||(p[22]=c=>i(g).debug=c)},null,8,["modelValue"])]),_:1})]),p[25]||(p[25]=n("div",{class:"grid-col-12 mb-3 me-3"},[n("button",{class:"btn btn-sm btn-secondary float-end","data-bs-toggle":"collapse","data-bs-target":"#themesettings"}," Schließen ")],-1))])]),_:1}))}}),xd=R(kd,[["__scopeId","data-v-d82b4b16"]]),Sd={class:"container-fluid px-2 m-0 theme-colors"},Md={id:"themesettings",class:"collapse"},$d={class:"row py-0 px-0 m-0"},Pd={key:1,class:"row py-0 m-0 d-flex justify-content-center"},Id={key:2,class:"nav nav-tabs nav-justified mx-1 mt-2",role:"tablist"},Cd={key:0,class:"nav-link","data-bs-toggle":"tab","data-bs-target":"#pricecharttabbed"},Bd={key:1,class:"nav-link","data-bs-toggle":"tab","data-bs-target":"#vehiclelist"},Vd={key:2,class:"nav-link","data-bs-toggle":"tab","data-bs-target":"#batterylist"},Ld={key:3,class:"nav-link","data-bs-toggle":"tab","data-bs-target":"#smarthomelist"},Od={key:4,class:"nav-link","data-bs-toggle":"tab","data-bs-target":"#counterlist"},Ad={key:5,class:"nav-link","data-bs-toggle":"tab","data-bs-target":"#inverterlist"},Td={key:3,id:"cpContent",class:"tab-content mx-0 pt-1"},Ed={id:"showAll",class:"tab-pane active",role:"tabpanel","aria-labelledby":"showall-tab"},zd={class:"row py-0 m-0 d-flex justify-content-center"},Wd={id:"chargepointlist",class:"tab-pane",role:"tabpanel","aria-labelledby":"chargepoint-tab"},Dd={class:"row py-0 m-0 d-flex justify-content-center"},Gd={id:"vehiclelist",class:"tab-pane",role:"tabpanel","aria-labelledby":"vehicle-tab"},jd={key:0,class:"row py-0 m-0 d-flex justify-content-center"},Ud={id:"batterylist",class:"tab-pane",role:"tabpanel","aria-labelledby":"battery-tab"},Fd={class:"row py-0 m-0 d-flex justify-content-center"},Nd={id:"smarthomelist",class:"tab-pane",role:"tabpanel","aria-labelledby":"smarthome-tab"},Hd={key:0,class:"row py-0 m-0 d-flex justify-content-center"},Rd={id:"counterlist",class:"tab-pane",role:"tabpanel","aria-labelledby":"counter-tab"},Jd={key:0,class:"row py-0 m-0 d-flex justify-content-center"},Yd={id:"inverterlist",class:"tab-pane",role:"tabpanel","aria-labelledby":"inverter-tab"},qd={key:0,class:"row py-0 m-0 d-flex justify-content-center"},Qd={id:"pricecharttabbed",class:"tab-pane",role:"tabpanel","aria-labelledby":"price-tab"},Zd={key:0,class:"row py-0 m-0 d-flex justify-content-center"},Xd={key:0,class:"row p-2 mt-5"},Kd={class:"col p-2"},eh={class:"d-flex justify-content-between"},th={class:"mx-4"},ah={key:0},nh=L({__name:"ColorsTheme",setup(a){const e=ee(!1),t=m(()=>[...ae.values()].filter(h=>h.configured).length>0);function r(){Ba()}function s(){e.value=!e.value}Le(()=>{r(),window.addEventListener("resize",Vn),window.addEventListener("focus",o),Ju()});function o(){document.hasFocus()&&fe(!0)}return(h,d)=>(l(),f(F,null,[n("div",Sd,[n("div",Md,[v(xd,{onResetArcs:i(An)},null,8,["onResetArcs"])]),i(g).showButtonBar?(l(),$(Tc,{key:0})):w("",!0),n("div",$d,[v(wu,null,nn({item1:_(()=>[v(hr)]),item2:_(()=>[v(bo)]),_:2},[i(g).alternativeEnergy?{name:"item3",fn:_(()=>[v(vs)]),key:"0"}:{name:"item3",fn:_(()=>[v(No)]),key:"1"}]),1024)]),i(g).showQuickAccess?w("",!0):(l(),f("div",Pd,[v(Tt,{id:"1",compact:i(g).shortCpList=="always"},null,8,["compact"]),i(g).showPrices?(l(),$(jt,{key:0,id:"NoTabs"})):w("",!0),i(g).showVehicles?(l(),$(Dt,{key:1})):w("",!0),v(Et),t.value?(l(),$(zt,{key:2})):w("",!0),i(g).showCounters?(l(),$(Wt,{key:3})):w("",!0),i(g).showInverters?(l(),$(Ut,{key:4})):w("",!0)])),i(g).showQuickAccess?(l(),f("nav",Id,[d[6]||(d[6]=rn('AllesLadepunkte',2)),i(g).showPrices?(l(),f("a",Cd,d[0]||(d[0]=[n("i",{class:"fa-solid fa-lg fa-coins"},null,-1),n("span",{class:"d-none d-md-inline ms-2"},"Strompreis",-1)]))):w("",!0),i(g).showVehicles?(l(),f("a",Bd,d[1]||(d[1]=[n("i",{class:"fa-solid fa-lg fa-car"},null,-1),n("span",{class:"d-none d-md-inline ms-2"},"Fahrzeuge",-1)]))):w("",!0),i(de).isBatteryConfigured?(l(),f("a",Vd,d[2]||(d[2]=[n("i",{class:"fa-solid fa-lg fa-car-battery"},null,-1),n("span",{class:"d-none d-md-inline ms-2"},"Speicher",-1)]))):w("",!0),t.value?(l(),f("a",Ld,d[3]||(d[3]=[n("i",{class:"fa-solid fa-lg fa-plug"},null,-1),n("span",{class:"d-none d-md-inline ms-2"},"Smart Home",-1)]))):w("",!0),i(g).showCounters?(l(),f("a",Od,d[4]||(d[4]=[n("i",{class:"fa-solid fa-lg fa-bolt"},null,-1),n("span",{class:"d-none d-md-inline ms-2"},"Zähler",-1)]))):w("",!0),i(g).showInverters?(l(),f("a",Ad,d[5]||(d[5]=[n("i",{class:"fa-solid fa-lg fa-solar-panel"},null,-1),n("span",{class:"d-none d-md-inline ms-2"},"Wechselrichter",-1)]))):w("",!0)])):w("",!0),i(g).showQuickAccess?(l(),f("div",Td,[n("div",Ed,[n("div",zd,[v(Tt,{id:"2",compact:i(g).shortCpList!="no"},null,8,["compact"]),i(g).showPrices?(l(),$(jt,{key:0,id:"Overview"})):w("",!0),i(g).showVehicles?(l(),$(Dt,{key:1})):w("",!0),v(Et),t.value?(l(),$(zt,{key:2})):w("",!0),i(g).showCounters?(l(),$(Wt,{key:3})):w("",!0),i(g).showInverters?(l(),$(Ut,{key:4})):w("",!0)])]),n("div",Wd,[n("div",Dd,[v(Tt,{id:"3",compact:i(g).shortCpList=="always"},null,8,["compact"])])]),n("div",Gd,[i(g).showVehicles?(l(),f("div",jd,[v(Dt)])):w("",!0)]),n("div",Ud,[n("div",Fd,[v(Et)])]),n("div",Nd,[t.value?(l(),f("div",Hd,[v(zt)])):w("",!0)]),n("div",Rd,[i(g).showCounters?(l(),f("div",Jd,[v(Wt)])):w("",!0)]),n("div",Yd,[i(g).showInverters?(l(),f("div",qd,[v(Ut)])):w("",!0)]),n("div",Qd,[i(g).showPrices?(l(),f("div",Zd,[v(jt,{id:"Tabbed"})])):w("",!0)])])):w("",!0)]),i(g).debug?(l(),f("div",Xd,[n("div",Kd,[d[7]||(d[7]=n("hr",null,null,-1)),n("div",eh,[n("p",th,"Screen Width: "+S(i(Mt).x),1),n("button",{class:"btn btn-sm btn-secondary mx-4",onClick:s}," MQ Viewer ")]),e.value?(l(),f("hr",ah)):w("",!0),e.value?(l(),$(gd,{key:1})):w("",!0)])])):w("",!0)],64))}}),rh=R(nh,[["__scopeId","data-v-0542a138"]]),oh={class:"navbar navbar-expand-lg px-0 mb-0"},sh={key:0,class:"position-absolute-50 navbar-text ms-4 navbar-time",style:{color:"var(--color-menu)"}},ih=L({__name:"NavigationBar",setup(a){let e;const t=m(()=>g.fluidDisplay?"container-fluid":"container-lg");return Le(()=>{e=setInterval(()=>{Rt.value=new Date},1e3)}),on(()=>{clearInterval(e)}),(r,s)=>(l(),f(F,null,[n("nav",oh,[n("div",{class:q(t.value)},[s[0]||(s[0]=n("a",{href:"/",class:"navbar-brand"},[n("span",null,"openWB")],-1)),i(g).showClock=="navbar"?(l(),f("span",sh,S(i(La)(i(Rt))),1)):w("",!0),s[1]||(s[1]=n("button",{class:"navbar-toggler togglebutton ps-5",type:"button","data-bs-toggle":"collapse","data-bs-target":"#mainNavbar","aria-controls":"mainNavbar","aria-expanded":"false","aria-label":"Toggle navigation"},[n("span",{class:"fa-solid fa-ellipsis-vertical"})],-1)),s[2]||(s[2]=n("div",{id:"mainNavbar",class:"collapse navbar-collapse justify-content-end"},[n("div",{class:"nav navbar-nav"},[n("a",{id:"navStatus",class:"nav-link",href:"../../settings/#/Status"},"Status"),n("div",{class:"nav-item dropdown"},[n("a",{id:"loggingDropdown",class:"nav-link",href:"#",role:"button","data-bs-toggle":"dropdown","aria-expanded":"false"},[H("Auswertungen "),n("i",{class:"fa-solid fa-caret-down"})]),n("div",{class:"dropdown-menu","aria-labelledby":"loggingDropdown"},[n("a",{href:"../../settings/#/Logging/ChargeLog",class:"dropdown-item"},"Ladeprotokoll"),n("a",{href:"../../settings/#/Logging/Chart",class:"dropdown-item"},"Diagramme")])]),n("div",{class:"nav-item dropdown"},[n("a",{id:"settingsDropdown",class:"nav-link",href:"#",role:"button","data-bs-toggle":"dropdown","aria-expanded":"false"},[H("Einstellungen "),n("span",{class:"fa-solid fa-caret-down"})]),n("div",{class:"dropdown-menu","aria-labelledby":"settingsDropdown"},[n("a",{id:"navSettings",class:"nav-link",href:"../../settings/index.html"},"openWB"),n("a",{class:"nav-link","data-bs-toggle":"collapse","data-bs-target":"#themesettings","aria-expanded":"false","aria-controls":"themeSettings"},[n("span",null,[H("Look&Feel"),n("span",{class:"fa-solid fa-caret-down"})])])])])])],-1))],2)]),n("div",{class:q(t.value)},s[3]||(s[3]=[n("hr",{class:"m-0 p-0 mb-2"},null,-1)]),2)],64))}}),lh=R(ih,[["__scopeId","data-v-ed619966"]]),ch={id:"app",class:"m-0 p-0"},uh={class:"row p-0 m-0"},dh={class:"col-12 p-0 m-0"},hh=L({__name:"App",setup(a){const e=m(()=>g.fluidDisplay?"container-fluid":"container-lg");return(t,r)=>(l(),f("div",ch,[v(lh),n("div",{class:q(["p-0",e.value])},[n("div",uh,[n("div",dh,[v(rh)])])],2)]))}}),ph=sn(hh);ln();ph.mount("#app"); diff --git a/packages/modules/web_themes/colors/web/assets/index-dtFnGfh0.js b/packages/modules/web_themes/colors/web/assets/index-dtFnGfh0.js deleted file mode 100644 index cb7e9905f2..0000000000 --- a/packages/modules/web_themes/colors/web/assets/index-dtFnGfh0.js +++ /dev/null @@ -1,6 +0,0 @@ -var Ua=Object.defineProperty;var Fa=(a,e,t)=>e in a?Ua(a,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[e]=t;var b=(a,e,t)=>Fa(a,typeof e!="symbol"?e+"":e,t);import{r as le,m as Na,c as m,a as ee,i as Ha,e as Ve,u as Ft,t as et,b as xt,s as ce,d as L,p as wa,f as ka,w as Ra,o as l,g as f,h as S,j as n,n as q,k as $,l as w,q as pe,v as _,x as H,y as i,z as v,F,A as te,B as xa,C as He,D as ft,E as nt,G as rt,H as dt,I as ht,J as st,K as Ja,L as Ne,M as K,N as Ya,O as Le,P as vt,Q as qa,R as Qa,S as Sa,T as Za,U as Ma,V as Xa,W as Ka,X as en,Y as tn,Z as an,_ as nn,$ as rn,a0 as on,a1 as sn,a2 as ln}from"./vendor-CmSLe-Fc.js";(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const h of o.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&r(h)}).observe(document,{childList:!0,subtree:!0});function t(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(s){if(s.ep)return;s.ep=!0;const o=t(s);fetch(s.href,o)}})();var ve=(a=>(a.instant_charging="instant_charging",a.pv_charging="pv_charging",a.scheduled_charging="scheduled_charging",a.standby="standby",a.stop="stop",a))(ve||{});class $a{constructor(e){b(this,"id");b(this,"name","Wechselrichter");b(this,"color","var(--color-pv)");b(this,"power",0);b(this,"energy",0);b(this,"energy_month",0);b(this,"energy_year",0);b(this,"energy_total",0);this.id=e}}const cn=[["EV","ev_mode"],["Speicher","bat_mode"],["MinSoc","min_soc_bat_mode"]];class un{constructor(e){b(this,"id");b(this,"name","Gerät");b(this,"power",0);b(this,"status","off");b(this,"energy",0);b(this,"runningTime",0);b(this,"configured",!1);b(this,"_showInGraph",!0);b(this,"color","white");b(this,"canSwitch",!1);b(this,"countAsHouse",!1);b(this,"energyPv",0);b(this,"energyBat",0);b(this,"pvPercentage",0);b(this,"tempConfigured",0);b(this,"temp",[300,300,300]);b(this,"on",!1);b(this,"isAutomatic",!0);b(this,"icon","");this.id=e}get showInGraph(){return this._showInGraph}set showInGraph(e){this._showInGraph=e,T.items["sh"+this.id].showInGraph=e,ne()}setShowInGraph(e){this._showInGraph=e}}const ae=le(new Map);function Yt(a){ae.has(a)?console.info("Duplicate sh device message: "+a):(ae.set(a,new un(a)),ae.get(a).color="var(--color-sh"+ae.size+")")}const dn=0,Pa={host:location.hostname,port:location.protocol=="https:"?443:80,endpoint:"/ws",protocol:location.protocol=="https:"?"wss":"ws",connectTimeout:4e3,reconnectPeriod:4e3,clean:!1,clientId:Math.random().toString(36).replace(/[^a-z]+/g,"").substring(0,6)},St={topic:"",qos:dn};let Ce;const{host:hn,port:pn,endpoint:gn,...Ia}=Pa,sa=`${Ia.protocol}://${hn}:${pn}${gn}`;try{console.debug("connectURL",sa),Ce=Na.connect(sa,Ia),Ce.on("connect",()=>{console.info("MQTT connection successful")}),Ce.on("disconnect",()=>{console.info("MQTT disconnected")}),Ce.on("error",a=>{console.error("MQTT connection failed: ",a)})}catch(a){console.error("MQTT connect error: ",a)}function mn(a){Ce?Ce.on("message",a):console.error("MqttRegister: MQTT client not available")}function Xe(a){St.topic=a;const{topic:e,qos:t}=St;Ce.subscribe(e,{qos:t},r=>{if(r){console.error("MQTT Subscription error: "+r);return}})}function ot(a){St.topic=a;const{topic:e}=St;Ce.unsubscribe(e,t=>{if(t){console.error("MQTT Unsubscribe from "+a+" failed: "+t);return}})}async function Nt(a,e){let r=Ce.connected,s=0;for(;!r&&s<20;)console.warn("MQTT publish: Not connected. Waiting 0.1 seconds"),await fn(100),r=Ce.connected,s+=1;if(s<20)try{Ce.publish(a,e,{qos:0},o=>{o&&console.warn("MQTT publish error: ",o),console.info("MQTT publish: Message sent: ["+a+"]("+e+")")})}catch(o){console.warn("MQTT publish: caught error: "+o)}else console.error("MQTT publish: Lost connection to MQTT server. Please reload the page")}function qt(){return Pa.clientId}function fn(a){return new Promise(e=>setTimeout(e,a))}class vn{constructor(e){b(this,"id");b(this,"name","Ladepunkt");b(this,"icon","Ladepunkt");b(this,"type","");b(this,"ev",0);b(this,"template",0);b(this,"connectedPhases",0);b(this,"phase_1",0);b(this,"autoPhaseSwitchHw",!1);b(this,"controlPilotInterruptionHw",!1);b(this,"isEnabled",!0);b(this,"isPluggedIn",!1);b(this,"isCharging",!1);b(this,"_isLocked",!1);b(this,"_connectedVehicle",0);b(this,"chargeTemplate",0);b(this,"evTemplate",0);b(this,"_chargeMode",ve.pv_charging);b(this,"_hasPriority",!1);b(this,"currentPlan","");b(this,"averageConsumption",0);b(this,"vehicleName","");b(this,"rangeCharged",0);b(this,"rangeUnit","");b(this,"counter",0);b(this,"dailyYield",0);b(this,"energyPv",0);b(this,"energyBat",0);b(this,"pvPercentage",0);b(this,"faultState",0);b(this,"faultStr","");b(this,"phasesInUse",0);b(this,"power",0);b(this,"chargedSincePlugged",0);b(this,"stateStr","");b(this,"current",0);b(this,"currents",[0,0,0]);b(this,"phasesToUse",0);b(this,"isSocConfigured",!0);b(this,"isSocManual",!1);b(this,"waitingForSoc",!1);b(this,"color","white");b(this,"_timedCharging",!1);b(this,"_instantChargeLimitMode","");b(this,"_instantTargetCurrent",0);b(this,"_instantTargetSoc",0);b(this,"_instantMaxEnergy",0);b(this,"_pvFeedInLimit",!1);b(this,"_pvMinCurrent",0);b(this,"_pvMaxSoc",0);b(this,"_pvMinSoc",0);b(this,"_pvMinSocCurrent",0);b(this,"_etActive",!1);b(this,"_etMaxPrice",20);this.id=e}get isLocked(){return this._isLocked}set isLocked(e){this._isLocked=e,oe("cpLock",e,this.id)}updateIsLocked(e){this._isLocked=e}get connectedVehicle(){return this._connectedVehicle}set connectedVehicle(e){this._connectedVehicle=e,oe("cpVehicle",e,this.id)}updateConnectedVehicle(e){this._connectedVehicle=e}get soc(){return Y[this.connectedVehicle]?Y[this.connectedVehicle].soc:0}set soc(e){Y[this.connectedVehicle]&&(Y[this.connectedVehicle].soc=e)}get chargeMode(){return this._chargeMode}set chargeMode(e){this._chargeMode=e,oe("chargeMode",e,this.id)}updateChargeMode(e){this._chargeMode=e}get hasPriority(){return this._hasPriority}set hasPriority(e){this._hasPriority=e,oe("cpPriority",e,this.id)}updateCpPriority(e){this._hasPriority=e}get timedCharging(){return _e[this.chargeTemplate]?_e[this.chargeTemplate].time_charging.active:!1}set timedCharging(e){_e[this.chargeTemplate].time_charging.active=e,oe("cpTimedCharging",e,this.chargeTemplate)}get instantTargetCurrent(){return this._instantTargetCurrent}set instantTargetCurrent(e){this._instantTargetCurrent=e,oe("cpInstantTargetCurrent",e,this.id)}updateInstantTargetCurrent(e){this._instantTargetCurrent=e}get instantChargeLimitMode(){return this._instantChargeLimitMode}set instantChargeLimitMode(e){this._instantChargeLimitMode=e,oe("cpInstantChargeLimitMode",e,this.id)}updateInstantChargeLimitMode(e){this._instantChargeLimitMode=e}get instantTargetSoc(){return this._instantTargetSoc}set instantTargetSoc(e){this._instantTargetSoc=e,oe("cpInstantTargetSoc",e,this.id)}updateInstantTargetSoc(e){this._instantTargetSoc=e}get instantMaxEnergy(){return this._instantMaxEnergy}set instantMaxEnergy(e){this._instantMaxEnergy=e,oe("cpInstantMaxEnergy",e,this.id)}updateInstantMaxEnergy(e){this._instantMaxEnergy=e}get pvFeedInLimit(){return this._pvFeedInLimit}set pvFeedInLimit(e){this._pvFeedInLimit=e,oe("cpPvFeedInLimit",e,this.id)}updatePvFeedInLimit(e){this._pvFeedInLimit=e}get pvMinCurrent(){return this._pvMinCurrent}set pvMinCurrent(e){this._pvMinCurrent=e,oe("cpPvMinCurrent",e,this.id)}updatePvMinCurrent(e){this._pvMinCurrent=e}get pvMaxSoc(){return this._pvMaxSoc}set pvMaxSoc(e){this._pvMaxSoc=e,oe("cpPvMaxSoc",e,this.id)}updatePvMaxSoc(e){this._pvMaxSoc=e}get pvMinSoc(){return this._pvMinSoc}set pvMinSoc(e){this._pvMinSoc=e,oe("cpPvMinSoc",e,this.id)}updatePvMinSoc(e){this._pvMinSoc=e}get pvMinSocCurrent(){return this._pvMinSocCurrent}set pvMinSocCurrent(e){this._pvMinSocCurrent=e,oe("cpPvMinSocCurrent",e,this.id)}updatePvMinSocCurrent(e){this._pvMinSocCurrent=e}get realCurrent(){switch(this.phasesInUse){case 0:return 0;case 1:return this.currents[0];case 2:return(this.currents[0]+this.currents[1])/2;case 3:return(this.currents[0]+this.currents[1]+this.currents[2])/3;default:return 0}}get etActive(){return Y[this.connectedVehicle]?Y[this.connectedVehicle].etActive:!1}set etActive(e){Y[this.connectedVehicle]&&(Y[this.connectedVehicle].etActive=e)}get etMaxPrice(){return Y[this.connectedVehicle].etMaxPrice??0}set etMaxPrice(e){oe("cpEtMaxPrice",Math.round(e*10)/1e6,this.id)}toPowerItem(){return{name:this.name,power:this.power,energy:this.dailyYield,energyPv:this.energyPv,energyBat:this.energyBat,pvPercentage:this.pvPercentage,color:this.color,icon:this.icon,showInGraph:!0}}}class yn{constructor(e){b(this,"id");b(this,"name","__invalid");b(this,"tags",[]);b(this,"config",{});b(this,"soc",0);b(this,"range",0);b(this,"_chargeTemplateId",0);b(this,"_evTemplateId",0);this.id=e}get chargeTemplateId(){return this._chargeTemplateId}set chargeTemplateId(e){this._chargeTemplateId=e,oe("vhChargeTemplateId",e,this.id)}updateChargeTemplateId(e){this._chargeTemplateId=e}get evTemplateId(){return this._evTemplateId}set evTemplateId(e){this._evTemplateId=e,oe("vhEvTemplateId",e,this.id)}updateEvTemplateId(e){this._evTemplateId=e}get etActive(){return _e[this.chargeTemplateId]?_e[this.chargeTemplateId].et.active:!1}set etActive(e){_e[this.chargeTemplateId]&&oe("priceCharging",e,this.chargeTemplateId)}get etMaxPrice(){if(_e[this.chargeTemplateId]&&_e[this.chargeTemplateId].et.active)return _e[this.chargeTemplateId].et.max_price*1e5}get chargepoint(){for(const e of Object.values(O))if(e.connectedVehicle==this.id)return e}get visible(){return this.name!="__invalid"&&(this.id!=0||g.showStandardVehicle)}}const O=le({}),Y=le({}),_e=le({}),pt=le({}),gt=le({}),Ht=le({});function bn(a){if(!(a in O)){O[a]=new vn(a);const e="var(--color-cp"+(Object.values(O).length-1)+")";O[a].color=e;const t="cp"+a;ie[t]?ie["cp"+a].color=e:ie[t]={name:"Ladepunkt",color:e,icon:"Ladepunkt"}}}function _n(){Object.keys(O).forEach(a=>{delete O[parseInt(a)]})}const me=m(()=>{const a=[],e=Object.values(O),t=Object.values(Y).filter(o=>o.visible);let r=-1;switch(e.length){case 0:r=t[0]?t[0].id:-1;break;default:r=e[0].connectedVehicle}let s=-1;switch(e.length){case 0:case 1:s=t[0]?t[0].id:-1;break;default:s=e[1].connectedVehicle}return r==s&&(s=t[1]?t[1].id:-1),r!=-1&&a.push(r),s!=-1&&a.push(s),a}),wn={cpLock:"openWB/set/chargepoint/%/set/manual_lock",chargeMode:"openWB/set/vehicle/template/charge_template/%/chargemode/selected",cpPriority:"openWB/set/vehicle/template/charge_template/%/prio",cpTimedCharging:"openWB/set/vehicle/template/charge_template/%/time_charging/active",pvBatteryPriority:"openWB/set/general/chargemode_config/pv_charging/bat_mode",cpVehicle:"openWB/set/chargepoint/%/config/ev",cpInstantChargeLimitMode:"openWB/set/vehicle/template/charge_template/%/chargemode/instant_charging/limit/selected",cpInstantTargetCurrent:"openWB/set/vehicle/template/charge_template/%/chargemode/instant_charging/current",cpInstantTargetSoc:"openWB/set/vehicle/template/charge_template/%/chargemode/instant_charging/limit/soc",cpInstantMaxEnergy:"openWB/set/vehicle/template/charge_template/%/chargemode/instant_charging/limit/amount",cpPvFeedInLimit:"openWB/set/vehicle/template/charge_template/%/chargemode/pv_charging/feed_in_limit",cpPvMinCurrent:"openWB/set/vehicle/template/charge_template/%/chargemode/pv_charging/min_current",cpPvMaxSoc:"openWB/set/vehicle/template/charge_template/%/chargemode/pv_charging/max_soc",cpPvMinSoc:"openWB/set/vehicle/template/charge_template/%/chargemode/pv_charging/min_soc",cpPvMinSocCurrent:"openWB/set/vehicle/template/charge_template/%/chargemode/pv_charging/min_soc_current",cpEtMaxPrice:"openWB/set/vehicle/template/charge_template/%/et/max_price",vhChargeTemplateId:"openWB/set/vehicle/%/charge_template",vhEvTemplateId:"openWB/set/vehicle/%/ev_template",shSetManual:"openWB/set/LegacySmartHome/config/set/Devices/%/mode",shSwitchOn:"openWB/set/LegacySmartHome/config/set/Devices/%/device_manual_control",socUpdate:"openWB/set/vehicle/%/get/force_soc_update",setSoc:"openWB/set/vehicle/%/soc_module/calculated_soc_state/manual_soc",priceCharging:"openWB/set/vehicle/template/charge_template/%/et/active"};function oe(a,e,t=0){if(isNaN(t)){console.warn("Invalid index");return}let r=wn[a];if(!r){console.warn("No topic for update type "+a);return}switch(a){case"chargeMode":case"cpPriority":case"cpScheduledCharging":case"cpInstantTargetCurrent":case"cpInstantChargeLimitMode":case"cpInstantTargetSoc":case"cpInstantMaxEnergy":case"cpPvFeedInLimit":case"cpPvMinCurrent":case"cpPvMaxSoc":case"cpPvMinSoc":case"cpEtMaxPrice":case"cpPvMinSocCurrent":r=r.replace("%",O[t].chargeTemplate.toString());break;default:r=r.replace("%",String(t))}switch(typeof e){case"number":Nt(r,JSON.stringify(+e));break;default:Nt(r,JSON.stringify(e))}}function Qt(a){Nt("openWB/set/command/"+qt()+"/todo",JSON.stringify(a))}const be=500,Se=500,j={top:15,right:20,bottom:10,left:25},Zt=["charging","house","batIn","devices"];class kn{constructor(){b(this,"data",[]);b(this,"_graphMode","");b(this,"waitForData",!0)}get graphMode(){return this._graphMode}set graphMode(e){this._graphMode=e}}const y=le(new kn),Ca=ee(Ha),Ye=m(()=>[0,be-j.left-2*j.right].map(a=>Ca.value.applyX(a)));let mt=!0,it=!0;function ia(){mt=!1}function la(){mt=!0}function ca(){it=!1}function ua(){it=!0}function xn(a){it=a}function yt(a){y.data=a,y.waitForData=!1}const ge=le({refreshTopicPrefix:"openWB/graph/alllivevaluesJson",updateTopic:"openWB/graph/lastlivevaluesJson",configTopic:"openWB/graph/config/#",initialized:!1,initCounter:0,graphRefreshCounter:0,rawDataPacks:[],duration:0,activate(a){this.unsubscribeUpdates(),this.subscribeRefresh(),a&&(y.data=[]),y.waitForData=!0,Xe(this.configTopic),this.initialized=!1,this.initCounter=0,this.graphRefreshCounter=0,this.rawDataPacks=[],In(),lt.value=!0},deactivate(){this.unsubscribeRefresh(),this.unsubscribeUpdates(),ot(this.configTopic)},subscribeRefresh(){for(let a=1;a<17;a++)Xe(this.refreshTopicPrefix+a)},unsubscribeRefresh(){for(let a=1;a<17;a++)ot(this.refreshTopicPrefix+a)},subscribeUpdates(){Xe(this.updateTopic)},unsubscribeUpdates(){ot(this.updateTopic)}}),ue=le({topic:"openWB/log/daily/#",date:new Date,activate(a){if(y.graphMode=="day"||y.graphMode=="today"){y.graphMode=="today"&&(this.date=new Date);const e=this.date.getFullYear().toString()+(this.date.getMonth()+1).toString().padStart(2,"0")+this.date.getDate().toString().padStart(2,"0");this.topic="openWB/log/daily/"+e,Xe(this.topic),a&&(y.data=[]),y.waitForData=!0,Qt({command:"getDailyLog",data:{day:e}})}},deactivate(){ot(this.topic)},back(){this.date=new Date(this.date.setTime(this.date.getTime()-864e5))},forward(){this.date=new Date(this.date.setTime(this.date.getTime()+864e5))},setDate(a){this.date=a},getDate(){return this.date}}),Ee=le({topic:"openWB/log/monthly/#",month:new Date().getMonth()+1,year:new Date().getFullYear(),activate(a){const e=this.year.toString()+this.month.toString().padStart(2,"0");y.data=[],Xe(this.topic),a&&(y.data=[]),y.waitForData=!0,Qt({command:"getMonthlyLog",data:{month:e}})},deactivate(){ot(this.topic)},back(){this.month-=1,this.month<1&&(this.month=12,this.year-=1),this.activate()},forward(){const a=new Date;a.getFullYear()==this.year?this.month-112&&(this.month=1,this.year+=1)),this.activate()},getDate(){return new Date(this.year,this.month)}}),Re=le({topic:"openWB/log/yearly/#",month:new Date().getMonth()+1,year:new Date().getFullYear(),activate(a){const e=this.year.toString();Xe(this.topic),a&&(y.data=[]),y.waitForData=!0,Qt({command:"getYearlyLog",data:{year:e}})},deactivate(){ot(this.topic)},back(){this.year-=1,this.activate()},forward(){this.year0&&(T.items[a].energyPv+=1e3/12*(e[a]*(e.pv-e.evuOut))/(e.pv-e.evuOut+e.evuIn+e.batOut),T.items[a].energyBat+=1e3/12*(e[a]*e.batOut)/(e.pv-e.evuOut+e.evuIn+e.batOut))}function $n(a,e){e[a]>0&&(T.items[a].energyPv+=1e3*(e[a]*(e.pv-e.evuOut))/(e.pv-e.evuOut+e.evuIn+e.batOut),T.items[a].energyBat+=1e3*(e[a]*e.batOut)/(e.pv-e.evuOut+e.evuIn+e.batOut))}const Pn=["evuIn","pv","batOut","evuOut"],qe=ee(!1);function Xt(a,e){Object.entries(a).length>0?(qe.value=!1,Object.entries(a.counter).forEach(([t,r])=>{(e.length==0||e.includes(t))&&(T.items.evuIn.energy+=r.energy_imported,T.items.evuOut.energy+=r.energy_exported)}),T.items.pv.energy=a.pv.all.energy_exported,a.bat.all&&(T.items.batIn.energy=a.bat.all.energy_imported,T.items.batOut.energy=a.bat.all.energy_exported),Object.entries(a.cp).forEach(([t,r])=>{t=="all"?(T.setEnergy("charging",r.energy_imported),r.energy_imported_pv!=null&&(T.setEnergyPv("charging",r.energy_imported_pv),T.setEnergyBat("charging",r.energy_imported_bat))):T.setEnergy(t,r.energy_imported)}),T.setEnergy("devices",0),Object.entries(a.sh).forEach(([t,r])=>{T.setEnergy(t,r.energy_imported);const s=t.substring(2);ae.get(+s).countAsHouse||(T.items.devices.energy+=r.energy_imported)}),a.hc&&a.hc.all?(T.setEnergy("house",a.hc.all.energy_imported),a.hc.all.energy_imported_pv!=null&&(T.setEnergyPv("house",a.hc.all.energy_imported_pv),T.setEnergyBat("house",a.hc.all.energy_imported_bat))):T.calculateHouseEnergy(),T.keys().forEach(t=>{Pn.includes(t)||(T.setPvPercentage(t,Math.round((T.items[t].energyPv+T.items[t].energyBat)/T.items[t].energy*100)),Zt.includes(t)&&(U[t].energy=T.items[t].energy,U[t].energyPv=T.items[t].energyPv,U[t].energyBat=T.items[t].energyBat,U[t].pvPercentage=T.items[t].pvPercentage))}),y.graphMode=="today"&&(Object.values(O).forEach(t=>{const r=T.items["cp"+t.id];r&&(t.energyPv=r.energyPv,t.energyBat=r.energyBat,t.pvPercentage=r.pvPercentage)}),ae.forEach(t=>{const r=T.items["sh"+t.id];r&&(t.energy=r.energy,t.energyPv=r.energyPv,t.energyBat=r.energyBat,t.pvPercentage=r.pvPercentage)}))):qe.value=!0,lt.value=!0}const Be=m(()=>{const a=Ve(y.data,e=>new Date(e.date));return a[0]&&a[1]?Ft().domain(a).range([0,be-j.left-2*j.right]):et().range([0,0])});function In(){T.keys().forEach(a=>{Zt.includes(a)&&(U[a].energy=T.items[a].energy,U[a].energyPv=0,U[a].energyBat=0,U[a].pvPercentage=0)}),Object.values(O).forEach(a=>{a.energyPv=0,a.energyBat=0,a.pvPercentage=0}),ae.forEach(a=>{a.energyPv=0,a.energyBat=0,a.pvPercentage=0})}const Je=m(()=>{const a=Ve(y.data,e=>e.date);return a[1]?xt().domain(Array.from({length:a[1]},(e,t)=>t+1)).paddingInner(.4).range([0,be-j.left-2]):xt().range([0,0])});function It(){switch(y.graphMode){case"live":y.graphMode="today",g.showRightButton=!0,fe();break;case"today":y.graphMode="day",ue.deactivate(),ue.back(),ue.activate(),fe();break;case"day":ue.back(),fe();break;case"month":Ee.back();break;case"year":Re.back();break}}function Kt(){const a=new Date;switch(y.graphMode){case"live":break;case"today":y.graphMode="live",g.showRightButton=!1,fe();break;case"day":ue.forward(),ue.date.getDate()==a.getDate()&&ue.date.getMonth()==a.getMonth()&&ue.date.getFullYear()==a.getFullYear()&&(y.graphMode="today"),fe();break;case"month":Ee.forward();break;case"year":Re.forward();break}}function ea(){switch(y.graphMode){case"live":It();break;case"day":case"today":y.graphMode="month",fe();break;case"month":y.graphMode="year",fe();break}}function ta(){switch(y.graphMode){case"year":y.graphMode="month",fe();break;case"month":y.graphMode="today",fe();break;case"today":case"day":y.graphMode="live",fe();break}}function da(a){if(y.graphMode=="day"||y.graphMode=="today"){ue.setDate(a);const e=new Date;ue.date.getDate()==e.getDate()&&ue.date.getMonth()==e.getMonth()&&ue.date.getFullYear()==e.getFullYear()?y.graphMode="today":y.graphMode="day",fe()}}const Fe=ee(new Map);class Cn{constructor(){b(this,"_showRelativeArcs",!1);b(this,"showTodayGraph",!0);b(this,"_graphPreference","today");b(this,"_usageStackOrder",0);b(this,"_displayMode","dark");b(this,"_showGrid",!1);b(this,"_smartHomeColors","normal");b(this,"_decimalPlaces",1);b(this,"_showQuickAccess",!0);b(this,"_simpleCpList",!1);b(this,"_shortCpList","no");b(this,"_showAnimations",!0);b(this,"_preferWideBoxes",!1);b(this,"_maxPower",4e3);b(this,"_fluidDisplay",!1);b(this,"_showClock","no");b(this,"_showButtonBar",!0);b(this,"_showCounters",!1);b(this,"_showVehicles",!1);b(this,"_showStandardVehicle",!0);b(this,"_showPrices",!1);b(this,"_showInverters",!1);b(this,"_alternativeEnergy",!1);b(this,"_sslPrefs",!1);b(this,"_debug",!1);b(this,"_lowerPriceBound",0);b(this,"_upperPriceBound",0);b(this,"isEtEnabled",!1);b(this,"etPrice",20.5);b(this,"showRightButton",!0);b(this,"showLeftButton",!0);b(this,"animationDuration",300);b(this,"animationDelay",100);b(this,"zoomGraph",!1);b(this,"zoomedWidget",1)}get showRelativeArcs(){return this._showRelativeArcs}set showRelativeArcs(e){this._showRelativeArcs=e,ne()}setShowRelativeArcs(e){this._showRelativeArcs=e}get graphPreference(){return this._graphPreference}set graphPreference(e){this._graphPreference=e,ne()}setGraphPreference(e){this._graphPreference=e}get usageStackOrder(){return this._usageStackOrder}set usageStackOrder(e){this._usageStackOrder=e,ne()}setUsageStackOrder(e){this._usageStackOrder=e}get displayMode(){return this._displayMode}set displayMode(e){this._displayMode=e,On(e)}setDisplayMode(e){this._displayMode=e}get showGrid(){return this._showGrid}set showGrid(e){this._showGrid=e,ne()}setShowGrid(e){this._showGrid=e}get decimalPlaces(){return this._decimalPlaces}set decimalPlaces(e){this._decimalPlaces=e,ne()}setDecimalPlaces(e){this._decimalPlaces=e}get smartHomeColors(){return this._smartHomeColors}set smartHomeColors(e){this._smartHomeColors=e,ha(e),ne()}setSmartHomeColors(e){this._smartHomeColors=e,ha(e)}get showQuickAccess(){return this._showQuickAccess}set showQuickAccess(e){this._showQuickAccess=e,ne()}setShowQuickAccess(e){this._showQuickAccess=e}get simpleCpList(){return this._simpleCpList}set simpleCpList(e){this._simpleCpList=e,ne()}setSimpleCpList(e){this._simpleCpList=e}get shortCpList(){return this._shortCpList}set shortCpList(e){this._shortCpList=e,ne()}setShortCpList(e){this._shortCpList=e}get showAnimations(){return this._showAnimations}set showAnimations(e){this._showAnimations=e,ne()}setShowAnimations(e){this._showAnimations=e}get preferWideBoxes(){return this._preferWideBoxes}set preferWideBoxes(e){this._preferWideBoxes=e,ne()}setPreferWideBoxes(e){this._preferWideBoxes=e}get maxPower(){return this._maxPower}set maxPower(e){this._maxPower=e,ne()}setMaxPower(e){this._maxPower=e}get fluidDisplay(){return this._fluidDisplay}set fluidDisplay(e){this._fluidDisplay=e,ne()}setFluidDisplay(e){this._fluidDisplay=e}get showClock(){return this._showClock}set showClock(e){this._showClock=e,ne()}setShowClock(e){this._showClock=e}get sslPrefs(){return this._sslPrefs}set sslPrefs(e){this._sslPrefs=e,ne()}setSslPrefs(e){this.sslPrefs=e}get debug(){return this._debug}set debug(e){this._debug=e,ne()}setDebug(e){this._debug=e}get showButtonBar(){return this._showButtonBar}set showButtonBar(e){this._showButtonBar=e,ne()}setShowButtonBar(e){this._showButtonBar=e}get showCounters(){return this._showCounters}set showCounters(e){this._showCounters=e,ne()}setShowCounters(e){this._showCounters=e}get showVehicles(){return this._showVehicles}set showVehicles(e){this._showVehicles=e,ne()}setShowVehicles(e){this._showVehicles=e}get showStandardVehicle(){return this._showStandardVehicle}set showStandardVehicle(e){this._showStandardVehicle=e,ne()}setShowStandardVehicle(e){this._showStandardVehicle=e}get showPrices(){return this._showPrices}set showPrices(e){this._showPrices=e,ne()}setShowPrices(e){this._showPrices=e}get showInverters(){return this._showInverters}set showInverters(e){this._showInverters=e,la(),ua(),ne()}setShowInverters(e){this._showInverters=e}get alternativeEnergy(){return this._alternativeEnergy}set alternativeEnergy(e){this._alternativeEnergy=e,la(),ua(),ne()}setAlternativeEnergy(e){this._alternativeEnergy=e}get lowerPriceBound(){return this._lowerPriceBound}set lowerPriceBound(e){this._lowerPriceBound=e,ne()}setLowerPriceBound(e){this._lowerPriceBound=e}get upperPriceBound(){return this._upperPriceBound}set upperPriceBound(e){this._upperPriceBound=e,ne()}setUpperPriceBound(e){this._upperPriceBound=e}}const g=le(new Cn);function Ba(){En();const a=ce("html");a.classed("theme-dark",g.displayMode=="dark"),a.classed("theme-light",g.displayMode=="light"),a.classed("theme-blue",g.displayMode=="blue"),a.classed("shcolors-standard",g.smartHomeColors=="standard"),a.classed("shcolors-advanced",g.smartHomeColors=="advanced"),a.classed("shcolors-normal",g.smartHomeColors=="normal")}const Bn=992,Mt=le({x:document.documentElement.clientWidth,y:document.documentElement.clientHeight});function Vn(){Mt.x=document.documentElement.clientWidth,Mt.y=document.documentElement.clientHeight,Ba()}const De=m(()=>Mt.x>=Bn),ye={instant_charging:{mode:ve.instant_charging,name:"Sofort",color:"var(--color-charging)",icon:"fa-bolt"},pv_charging:{mode:ve.pv_charging,name:"PV",color:"var(--color-pv",icon:"fa-solar-panel"},scheduled_charging:{mode:ve.scheduled_charging,name:"Zielladen",color:"var(--color-battery)",icon:"fa-bullseye"},standby:{mode:ve.standby,name:"Standby",color:"var(--color-axis",icon:"fa-pause"},stop:{mode:ve.stop,name:"Stop",color:"var(--color-fg)",icon:"fa-power-off"}};class Ln{constructor(){b(this,"batterySoc",0);b(this,"isBatteryConfigured",!0);b(this,"chargeMode","0");b(this,"_pvBatteryPriority","ev_mode");b(this,"displayLiveGraph",!0);b(this,"isEtEnabled",!0);b(this,"etMaxPrice",0);b(this,"etCurrentPrice",0);b(this,"cpDailyExported",0);b(this,"evuId",0);b(this,"etProvider","")}get pvBatteryPriority(){return this._pvBatteryPriority}set pvBatteryPriority(e){this._pvBatteryPriority=e,oe("pvBatteryPriority",e)}updatePvBatteryPriority(e){this._pvBatteryPriority=e}}function ne(){Tn()}function On(a){const e=ce("html");e.classed("theme-dark",a=="dark"),e.classed("theme-light",a=="light"),e.classed("theme-blue",a=="blue"),ne()}function An(){g.maxPower=Q.evuIn.power+Q.pv.power+Q.batOut.power,ne()}function ha(a){const e=ce("html");e.classed("shcolors-normal",a=="normal"),e.classed("shcolors-standard",a=="standard"),e.classed("shcolors-advanced",a=="advanced")}const Te={chargemode:"Der Lademodus für das Fahrzeug an diesem Ladepunkt",vehicle:"Das Fahrzeug, das an diesem Ladepounkt geladen wird",locked:"Für das Laden sperren",priority:"Fahrzeuge mit Priorität werden bevorzugt mit mehr Leistung geladen, falls verfügbar",timeplan:"Das Laden nach Zeitplan für dieses Fahrzeug aktivieren",minsoc:"Immer mindestens bis zum eingestellten Ladestand laden. Wenn notwendig mit Netzstrom.",minpv:"Durchgehend mit mindestens dem eingestellten Strom laden. Wenn notwendig mit Netzstrom.",pricebased:"Laden bei dynamischem Stromtarif, wenn eingestellter Maximalpreis unterboten wird.",pvpriority:"Ladepriorität bei PV-Produktion. Bevorzung von Fahzeugen, Speicher, oder Fahrzeugen bis zum eingestellten Mindest-Ladestand. Die Einstellung ist für alle Ladepunkte gleich."};function Tn(){const a={};a.hideSH=[...ae.values()].filter(e=>!e.showInGraph).map(e=>e.id),a.showLG=g.graphPreference=="live",a.displayM=g.displayMode,a.stackO=g.usageStackOrder,a.showGr=g.showGrid,a.decimalP=g.decimalPlaces,a.smartHomeC=g.smartHomeColors,a.relPM=g.showRelativeArcs,a.maxPow=g.maxPower,a.showQA=g.showQuickAccess,a.simpleCP=g.simpleCpList,a.shortCP=g.shortCpList,a.animation=g.showAnimations,a.wideB=g.preferWideBoxes,a.fluidD=g.fluidDisplay,a.clock=g.showClock,a.showButtonBar=g.showButtonBar,a.showCounters=g.showCounters,a.showVehicles=g.showVehicles,a.showStandardV=g.showStandardVehicle,a.showPrices=g.showPrices,a.showInv=g.showInverters,a.altEngy=g.alternativeEnergy,a.lowerP=g.lowerPriceBound,a.upperP=g.upperPriceBound,a.sslPrefs=g.sslPrefs,a.debug=g.debug,document.cookie="openWBColorTheme="+JSON.stringify(a)+";max-age=16000000;"+(g.sslPrefs?"SameSite=None;Secure":"SameSite=Strict")}function En(){const e=document.cookie.split(";").filter(t=>t.split("=")[0]==="openWBColorTheme");if(e.length>0){const t=JSON.parse(e[0].split("=")[1]);t.decimalP!==void 0&&g.setDecimalPlaces(+t.decimalP),t.smartHomeC!==void 0&&g.setSmartHomeColors(t.smartHomeC),t.hideSH!==void 0&&t.hideSH.forEach(r=>{ae.get(r)==null&&Yt(r),ae.get(r).setShowInGraph(!1)}),t.showLG!==void 0&&g.setGraphPreference(t.showLG?"live":"today"),t.maxPow!==void 0&&g.setMaxPower(+t.maxPow),t.relPM!==void 0&&g.setShowRelativeArcs(t.relPM),t.displayM!==void 0&&g.setDisplayMode(t.displayM),t.stackO!==void 0&&g.setUsageStackOrder(t.stackO),t.showGr!==void 0&&g.setShowGrid(t.showGr),t.showQA!==void 0&&g.setShowQuickAccess(t.showQA),t.simpleCP!==void 0&&g.setSimpleCpList(t.simpleCP),t.shortCP!==void 0&&g.setShortCpList(t.shortCP),t.animation!=null&&g.setShowAnimations(t.animation),t.wideB!=null&&g.setPreferWideBoxes(t.wideB),t.fluidD!=null&&g.setFluidDisplay(t.fluidD),t.clock!=null&&g.setShowClock(t.clock),t.showButtonBar!==void 0&&g.setShowButtonBar(t.showButtonBar),t.showCounters!==void 0&&g.setShowCounters(t.showCounters),t.showVehicles!==void 0&&g.setShowVehicles(t.showVehicles),t.showStandardV!==void 0&&g.setShowStandardVehicle(t.showStandardV),t.showPrices!==void 0&&g.setShowPrices(t.showPrices),t.showInv!==void 0&&g.setShowInverters(t.showInv),t.altEngy!==void 0&&g.setAlternativeEnergy(t.altEngy),t.lowerP!==void 0&&g.setLowerPriceBound(t.lowerP),t.upperP!==void 0&&g.setUpperPriceBound(t.upperP),t.sslPrefs!==void 0&&g.setSslPrefs(t.sslPrefs),t.debug!==void 0&&g.setDebug(t.debug)}}const ie=le({evuIn:{name:"Netz",color:"var(--color-evu)",icon:""},pv:{name:"PV",color:"var(--color-pv",icon:""},batOut:{name:"Bat >",color:"var(--color-battery)",icon:""},evuOut:{name:"Export",color:"var(--color-export)",icon:""},charging:{name:"Laden",color:"var(--color-charging)",icon:""},devices:{name:"Geräte",color:"var(--color-devices)",icon:""},batIn:{name:"> Bat",color:"var(--color-battery)",icon:""},house:{name:"Haus",color:"var(--color-house)",icon:""},cp1:{name:"Ladepunkt",color:"var(--color-cp1)",icon:"Ladepunkt"},cp2:{name:"Ladepunkt",color:"var(--color-cp2)",icon:"Ladepunkt"},cp3:{name:"Ladepunkt",color:"var(--color-cp3)",icon:"Ladepunkt"},cp4:{name:"Ladepunkt",color:"var(--color-cp4)",icon:"Ladepunkt"},cp5:{name:"Ladepunkt",color:"var(--color-cp5)",icon:"Ladepunkt"},cp6:{name:"Ladepunkt",color:"var(--color-cp6)",icon:"Ladepunkt"},cp7:{name:"Ladepunkt",color:"var(--color-cp7)",icon:"Ladepunkt"},cp8:{name:"Ladepunkt",color:"var(--color-cp8)",icon:"Ladepunkt"},sh1:{name:"Gerät",color:"var(--color-sh1)",icon:"Gerät"},sh2:{name:"Gerät",color:"var(--color-sh2)",icon:"Gerät"},sh3:{name:"Gerät",color:"var(--color-sh3)",icon:"Gerät"},sh4:{name:"Gerät",color:"var(--color-sh4)",icon:"Gerät"},sh5:{name:"Gerät",color:"var(--color-sh5)",icon:"Gerät"},sh6:{name:"Gerät",color:"var(--color-sh6)",icon:"Gerät"},sh7:{name:"Gerät",color:"var(--color-sh7)",icon:"Gerät"},sh8:{name:"Gerät",color:"var(--color-sh8)",icon:"Gerät"},sh9:{name:"Gerät",color:"var(--color-sh9)",icon:"Gerät"},pv1:{name:"PV",color:"var(--color-pv1)",icon:"Wechselrichter"},pv2:{name:"PV",color:"var(--color-pv2)",icon:"Wechselrichter"},pv3:{name:"PV",color:"var(--color-pv3)",icon:"Wechselrichter"},pv4:{name:"PV",color:"var(--color-pv4)",icon:"Wechselrichter"},pv5:{name:"PV",color:"var(--color-pv5)",icon:"Wechselrichter"},pv6:{name:"PV",color:"var(--color-pv6)",icon:"Wechselrichter"},pv7:{name:"PV",color:"var(--color-pv7)",icon:"Wechselrichter"},pv8:{name:"PV",color:"var(--color-pv8)",icon:"Wechselrichter"},pv9:{name:"PV",color:"var(--color-pv9)",icon:"Wechselrichter"},bat1:{name:"Speicher",color:"var(--color-battery)",icon:"Speicher"},bat2:{name:"Speicher",color:"var(--color-battery)",icon:"Speicher"},bat3:{name:"Speicher",color:"var(--color-battery)",icon:"Speicher"},bat4:{name:"Speicher",color:"var(--color-battery)",icon:"Speicher"},bat5:{name:"Speicher",color:"var(--color-battery)",icon:"Speicher"},bat6:{name:"Speicher",color:"var(--color-battery)",icon:"Speicher"},bat7:{name:"Speicher",color:"var(--color-battery)",icon:"Speicher"},bat8:{name:"Speicher",color:"var(--color-battery)",icon:"Speicher"},bat9:{name:"Speicher",color:"var(--color-battery)",icon:"Speicher"}});class Va{constructor(){b(this,"_items",{});this.addItem("evuIn"),this.addItem("pv"),this.addItem("batOut"),this.addItem("evuOut"),this.addItem("charging"),this.addItem("devices"),this.addItem("batIn"),this.addItem("house")}get items(){return this._items}keys(){return Object.keys(this._items)}values(){return Object.values(this._items)}addItem(e,t){this._items[e]=t?ze(e,t):ze(e)}setEnergy(e,t){this.keys().includes(e)||this.addItem(e),this._items[e].energy=t}setEnergyPv(e,t){this.keys().includes(e)||this.addItem(e),this._items[e].energyPv=t}setEnergyBat(e,t){this.keys().includes(e)||this.addItem(e),this._items[e].energyBat=t}setPvPercentage(e,t){this.keys().includes(e)||this.addItem(e),this._items[e].pvPercentage=t<=100?t:100}calculateHouseEnergy(){this._items.house.energy=this._items.evuIn.energy+this._items.pv.energy+this._items.batOut.energy-this._items.evuOut.energy-this._items.batIn.energy-this._items.charging.energy-this._items.devices.energy}}let T=le(new Va);function aa(){T=new Va}const Q=le({evuIn:ze("evuIn"),pv:ze("pv"),batOut:ze("batOut")}),U=le({evuOut:ze("evuOut"),charging:ze("charging"),devices:ze("devices"),batIn:ze("batIn"),house:ze("house")}),de=le(new Ln);ee("");const lt=ee(!1);function ze(a,e){return{name:ie[a]?ie[a].name:"item",power:0,energy:0,energyPv:0,energyBat:0,pvPercentage:0,color:e||(ie[a]?ie[a].color:"var(--color-charging)"),icon:ie[a]?ie[a].icon:"",showInGraph:!0}}const Rt=ee(new Date),we=ee(new Map),zn=a=>{we.value.set(a,new $a(a)),we.value.get(a).color=ie["pv"+we.value.size].color},Wn=["origin"],Dn=L({__name:"PMSourceArc",props:{radius:{},cornerRadius:{},circleGapSize:{},emptyPower:{}},setup(a){const e=a,t=m(()=>{let r={name:"",power:e.emptyPower,energy:0,energyPv:0,energyBat:0,pvPercentage:0,color:"var(--color-bg)",icon:"",showInGraph:!0},s=Q;s["zz-empty"]=r;const o=Object.values(Q).length-1,h=wa().value(p=>p.power).startAngle(-Math.PI/2+e.circleGapSize).endAngle(Math.PI/2-e.circleGapSize).sort(null),d=ka().innerRadius(e.radius/6*5).outerRadius(e.radius).cornerRadius(e.cornerRadius).padAngle(0),u=ce("g#pmSourceArc");return u.selectAll("*").remove(),u.selectAll("sources").data(h(Object.values(s))).enter().append("path").attr("d",d).attr("fill",p=>p.data.color).attr("stroke",(p,c)=>c==o?p.data.power>0?"var(--color-scale)":"null":p.data.color),"pmSourceArc.vue"});return Ra(()=>{let r=Q.pv.power+Q.evuIn.power+Q.batOut.power;r>g.maxPower&&(g.maxPower=r)}),(r,s)=>(l(),f("g",{id:"pmSourceArc",origin:t.value},null,8,Wn))}}),Gn=["origin"],jn=L({__name:"PMUsageArc",props:{radius:{},cornerRadius:{},circleGapSize:{},emptyPower:{}},setup(a){const e=a,t=m(()=>{let r={name:"",power:e.emptyPower,energy:0,energyPv:0,energyBat:0,pvPercentage:0,color:"var(--color-bg)",icon:"",showInGraph:!0};const s=[U.evuOut,U.charging].concat([...ae.values()].filter(p=>p.configured&&!p.countAsHouse).sort((p,c)=>c.power-p.power)).concat([U.batIn,U.house]).concat(r),o=s.length-1,h=wa().value(p=>p.power).startAngle(Math.PI*1.5-e.circleGapSize).endAngle(Math.PI/2+e.circleGapSize).sort(null),d=ka().innerRadius(e.radius/6*5).outerRadius(e.radius).cornerRadius(e.cornerRadius),u=ce("g#pmUsageArc");return u.selectAll("*").remove(),u.selectAll("consumers").data(h(s)).enter().append("path").attr("d",d).attr("fill",p=>p.data.color).attr("stroke",(p,c)=>c==o?p.data.power>0?"var(--color-scale)":"null":p.data.color),"pmUsageArc.vue"});return(r,s)=>(l(),f("g",{id:"pmUsageArc",origin:t.value},null,8,Gn))}});function $e(a,e=1){let t;if(a>=1e3&&e<4){switch(e){case 0:t=Math.round(a/1e3);break;case 1:t=Math.round(a/100)/10;break;case 2:t=Math.round(a/10)/100;break;case 3:t=Math.round(a)/1e3;break;default:t=Math.round(a/100)/10;break}return(t==null?void 0:t.toLocaleString(void 0,{minimumFractionDigits:e}))+" kW"}else return Math.round(a).toLocaleString()+" W"}function ct(a,e=1,t=!1){let r;if(a>1e6&&(t=!0,a=a/1e3),a>=1e3&&e<4){switch(e){case 0:r=Math.round(a/1e3);break;case 1:r=Math.round(a/100)/10;break;case 2:r=Math.round(a/10)/100;break;case 3:r=Math.round(a)/1e3;break;default:r=Math.round(a/100)/10;break}return r.toLocaleString(void 0,{minimumFractionDigits:e})+(t?" MWh":" kWh")}else return Math.round(a).toLocaleString()+(t?" kWh":" Wh")}function Un(a){const e=Math.floor(a/3600),t=(a%3600/60).toFixed(0);return e>0?e+"h "+t+" min":t+" min"}function La(a){return a.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}function Fn(a,e){return["Jan","Feb","März","April","Mai","Juni","Juli","Aug","Sep","Okt","Nov","Dez"][a]+" "+e}function Nn(a){return a!=999?(Math.round(a*10)/10).toLocaleString(void 0,{minimumFractionDigits:1})+"°":"-"}const bt=L({__name:"FormatWatt",props:{watt:{}},setup(a){const e=a,t=m(()=>$e(e.watt,g.decimalPlaces));return(r,s)=>S(t.value)}}),Hn={key:0,id:"pmLabel"},Rn=["x","y","fill","text-anchor"],Jn=22,Ae=L({__name:"PMLabel",props:{x:{},y:{},data:{},props:{},anchor:{},labeltext:{},labelicon:{},labelcolor:{}},setup(a){const e=a,t=m(()=>e.labeltext?e.labeltext:e.props?e.props.icon+" ":e.labelicon?e.labelicon+" ":""),r=m(()=>e.labelcolor?e.labelcolor:e.props?e.props.color:""),s=m(()=>!e.data||e.data.power>0),o=m(()=>e.labeltext?"":"fas");return(h,d)=>s.value?(l(),f("g",Hn,[n("text",{x:h.x,y:h.y,fill:r.value,"text-anchor":h.anchor,"font-size":Jn,class:"pmLabel"},[n("tspan",{class:q(o.value)},S(t.value),3),n("tspan",null,[h.data!==void 0?(l(),$(bt,{key:0,watt:h.data.power},null,8,["watt"])):w("",!0)])],8,Rn)])):w("",!0)}}),Yn={class:"wb-widget p-0 m-0 shadow"},qn={class:"d-flex justify-content-between"},Qn={class:"m-4 me-0 mb-0"},Zn={class:"p-4 pb-0 ps-0 m-0",style:{"text-align":"right"}},Xn={class:"px-4 pt-4 pb-2 wb-subwidget"},Kn={class:"row"},er={class:"col m-0 p-0"},tr={class:"container-fluid m-0 p-0"},ar={key:0},nr={class:"px-4 py-2 wb-subwidget"},rr={class:"row"},or={class:"col"},sr={class:"container-fluid m-0 p-0"},_t=L({__name:"WBWidget",props:{variableWidth:{type:Boolean},fullWidth:{type:Boolean}},setup(a){const e=a,t=m(()=>e.fullWidth?"col-12":e.variableWidth&&g.preferWideBoxes?"col-lg-6":"col-lg-4");return(r,s)=>(l(),f("div",{class:q(["p-2 m-0 d-flex",t.value])},[n("div",Yn,[n("div",qn,[n("h3",Qn,[pe(r.$slots,"title",{},()=>[s[0]||(s[0]=n("div",{class:"p-0"},"(title goes here)",-1))]),pe(r.$slots,"subtitle")]),n("div",Zn,[pe(r.$slots,"buttons")])]),n("div",Xn,[n("div",Kn,[n("div",er,[n("div",tr,[pe(r.$slots,"default")])])])]),r.$slots.footer!=null?(l(),f("div",ar,[s[1]||(s[1]=n("hr",null,null,-1)),n("div",nr,[n("div",rr,[n("div",or,[n("div",sr,[pe(r.$slots,"footer")])])])])])):w("",!0)])],2))}});class ir{constructor(){b(this,"active",!1);b(this,"etPriceList",new Map);b(this,"etProvider","");b(this,"etMaxPrice",0)}get etCurrentPriceString(){const[e]=re.etPriceList.values();return(Math.round(e*10)/10).toFixed(1)+" ct"}}const re=le(new ir),lr={id:"powermeter",class:"p-0 m-0"},cr=["viewBox"],ur=["transform"],dr=["x"],Ze=500,Ue=20,pa=1,hr=L({__name:"PowerMeter",setup(a){const e=Ze,t=Math.PI/40,r=[[4],[4,6],[1,4,6],[0,2,4,6],[0,2,3,5,6]],s=[{x:-85,y:e/2*1/5},{x:0,y:e/2*1/5},{x:85,y:e/2*1/5},{x:-85,y:e/2*2/5},{x:0,y:e/2*2/5},{x:85,y:e/2*2/5},{x:0,y:e/2*3/5}],o=m(()=>Ze/2-Ue),h=m(()=>{let B="",A=Object.values(Q).filter(V=>V.power>0);return A.length==1&&A[0].name=="PV"?B="Aktueller Verbrauch: ":B="Bezug/Verbrauch: ",B+$e(U.house.power+U.charging.power+U.devices.power+U.batIn.power,g.decimalPlaces)}),d=m(()=>{let B=Q.pv.power+Q.evuIn.power+Q.batOut.power;return g.maxPower>B?$e(g.maxPower,g.decimalPlaces):$e(B,g.decimalPlaces)}),u=m(()=>Object.values(O)),p=m(()=>{let B=0;return g.showRelativeArcs&&(B=g.maxPower-(Q.pv.power+Q.evuIn.power+Q.batOut.power)),B<0?0:B}),c=m(()=>[U.evuOut,U.charging,U.devices,U.batIn,U.house].filter(B=>B.power>0)),k=m(()=>r[c.value.length-1]);function P(B){return s[k.value[B]]}function z(B){return B.length>12?B.slice(0,11)+".":B}const D=m(()=>{const[B]=re.etPriceList.values();return Math.round(B*10)/10});return(B,A)=>(l(),$(_t,{"full-width":!0},{title:_(()=>A[0]||(A[0]=[H(" Aktuelle Leistung ")])),default:_(()=>[n("figure",lr,[(l(),f("svg",{viewBox:"0 0 "+Ze+" "+i(e)},[n("g",{transform:"translate("+Ze/2+","+i(e)/2+")"},[v(Dn,{radius:o.value,"corner-radius":pa,"circle-gap-size":t,"empty-power":p.value},null,8,["radius","empty-power"]),v(jn,{"sh-device":i(ae),radius:o.value,"corner-radius":pa,"circle-gap-size":t,"empty-power":p.value},null,8,["sh-device","radius","empty-power"]),v(Ae,{x:0,y:-i(e)/10*2,data:i(Q).pv,props:i(ie).pv,anchor:"middle",config:i(g)},null,8,["y","data","props","config"]),v(Ae,{x:0,y:-i(e)/10*3,data:i(Q).evuIn,props:i(ie).evuIn,anchor:"middle",config:i(g)},null,8,["y","data","props","config"]),v(Ae,{x:0,y:-i(e)/10,data:i(Q).batOut,props:i(ie).batOut,anchor:"middle",config:i(g)},null,8,["y","data","props","config"]),i(re).active?(l(),$(Ae,{key:0,x:0,y:-i(e)/10,data:i(Q).batOut,props:i(ie).batOut,anchor:"middle",config:i(g)},null,8,["y","data","props","config"])):w("",!0),(l(!0),f(F,null,te(c.value,(V,J)=>(l(),$(Ae,{key:J,x:P(J).x,y:P(J).y,data:V,labelicon:V.icon,labelcolor:V.color,anchor:"middle",config:i(g)},null,8,["x","y","data","labelicon","labelcolor","config"]))),128)),i(me)[0]!=null&&i(Y)[i(me)[0]]!=null?(l(),$(Ae,{key:1,x:-500/2-Ue/4+10,y:-i(e)/2+Ue+5,labeltext:z(i(Y)[i(me)[0]].name)+": "+Math.round(i(Y)[i(me)[0]].soc)+"%",labelcolor:u.value[0]?u.value[0].color:"var(--color-charging)",anchor:"start",config:i(g)},null,8,["x","y","labeltext","labelcolor","config"])):w("",!0),i(me)[1]!=null&&i(Y)[i(me)[1]]!=null?(l(),$(Ae,{key:2,x:Ze/2+Ue/4-10,y:-i(e)/2+Ue+5,labeltext:z(i(Y)[i(me)[1]].name)+": "+Math.round(i(Y)[i(me)[1]].soc)+"%",labelcolor:u.value[1]?u.value[1].color:"var(--color-charging)",anchor:"end",config:i(g)},null,8,["x","y","labeltext","labelcolor","config"])):w("",!0),i(de).batterySoc>0?(l(),$(Ae,{key:3,x:-500/2-Ue/4+10,y:i(e)/2-Ue+15,labeltext:"Speicher: "+i(de).batterySoc+"%",labelcolor:i(U).batIn.color,anchor:"start",config:i(g)},null,8,["x","y","labeltext","labelcolor","config"])):w("",!0),i(re).active?(l(),$(Ae,{key:4,x:Ze/2+Ue/4-10,y:i(e)/2-Ue+15,value:D.value,labeltext:i(re).etCurrentPriceString,labelcolor:"var(--color-charging)",anchor:"end",config:i(g)},null,8,["x","y","value","labeltext","config"])):w("",!0),v(Ae,{x:0,y:0,labeltext:h.value,labelcolor:"var(--color-fg)",anchor:"middle",config:i(g)},null,8,["labeltext","config"]),i(g).showRelativeArcs?(l(),f("text",{key:5,x:Ze/2-44,y:"2","text-anchor":"middle",fill:"var(--color-axis)","font-size":"12"}," Peak: "+S(d.value),9,dr)):w("",!0)],8,ur)],8,cr))])]),_:1}))}}),pr=["origin","origin2","transform"],gr=L({__name:"PgSourceGraph",props:{width:{},height:{},margin:{}},setup(a){const e=a,t={house:"var(--color-house)",batIn:"var(--color-battery)",inverter:"var(--color-pv)",batOut:"var(--color-battery)",selfUsage:"var(--color-pv)",pv:"var(--color-pv)",evuOut:"var(--color-export)",evuIn:"var(--color-evu)"};var r,s;const o=g.showAnimations?g.animationDuration:0,h=g.showAnimations?g.animationDelay:0,d=m(()=>{const M=ce("g#pgSourceGraph");if(y.data.length>0){y.graphMode=="month"||y.graphMode=="year"?J(M,Je.value):V(M,Be.value),M.selectAll(".axis").remove();const E=M.append("g").attr("class","axis");E.call(D.value),E.selectAll(".tick").attr("font-size",12),E.selectAll(".tick line").attr("stroke",A.value).attr("stroke-width",B.value),E.select(".domain").attr("stroke","var(--color-bg)")}return"pgSourceGraph.vue"}),u=m(()=>xa().value((M,E)=>M[E]??0).keys(k.value)),p=m(()=>u.value(y.data)),c=m(()=>He().range([e.height-10,0]).domain(y.graphMode=="year"?[0,Math.ceil(P.value[1]*10)/10]:[0,Math.ceil(P.value[1])])),k=m(()=>{let M=[];const E=["batOut","evuIn"];if(g.showInverters){const I=/pv\d+/;y.data.length>0&&(M=Object.keys(y.data[0]).reduce((x,G)=>(G.match(I)&&x.push(G),x),[]))}switch(y.graphMode){case"live":return g.showInverters?["pv","batOut","evuIn"]:["selfUsage","evuOut","batOut","evuIn"];case"today":case"day":return M.forEach((I,x)=>{t[I]="var(--color-pv"+(x+1)+")"}),g.showInverters?[...M,...E]:["selfUsage","evuOut","batOut","evuIn"];default:return["evuIn","batOut","selfUsage","evuOut"]}}),P=m(()=>{let M=Ve(y.data,E=>Math.max(E.pv+E.evuIn+E.batOut,E.selfUsage+E.evuOut));return M[0]!=null&&M[1]!=null?(y.graphMode=="year"&&(M[0]=M[0]/1e3,M[1]=M[1]/1e3),M):[0,0]}),z=m(()=>y.graphMode=="month"||y.graphMode=="year"?-e.width-e.margin.right-22:-e.width),D=m(()=>ft(c.value).tickSizeInner(z.value).ticks(4).tickFormat(M=>(M==0?"":Math.round(M*10)/10).toLocaleString(void 0))),B=m(()=>g.showGrid?"0.5":"1"),A=m(()=>g.showGrid?"var(--color-grid)":"var(--color-bg)");function V(M,E){const I=nt().x((G,xe)=>E(y.data[xe].date)).y(c.value(0)).curve(rt),x=nt().x((G,xe)=>E(y.data[xe].date)).y0(G=>c.value(y.graphMode=="year"?G[0]/1e3:G[0])).y1(G=>c.value(y.graphMode=="year"?G[1]/1e3:G[1])).curve(rt);mt?(M.selectAll("*").remove(),r=M.append("svg").attr("x",0).attr("width",e.width).selectAll(".sourceareas").data(p.value).enter().append("path").attr("fill",(xe,W)=>t[k.value[W]]).attr("d",xe=>I(xe)),r.transition().duration(o).delay(h).ease(dt).attr("d",xe=>x(xe)),ia()):r.data(p.value).transition().duration(0).ease(dt).attr("d",G=>x(G))}function J(M,E){y.data.length>0&&(mt?(M.selectAll("*").remove(),s=M.selectAll(".sourcebar").data(p.value).enter().append("g").attr("fill",(I,x)=>t[k.value[x]]).selectAll("rect").data(I=>I).enter().append("rect").attr("x",(I,x)=>E(y.data[x].date)??0).attr("y",()=>c.value(0)).attr("height",0).attr("width",E.bandwidth()),s.transition().duration(o).delay(h).ease(dt).attr("height",I=>y.graphMode=="year"?c.value(I[0]/1e3)-c.value(I[1]/1e3):c.value(I[0])-c.value(I[1])).attr("y",I=>y.graphMode=="year"?c.value(I[1]/1e3):c.value(I[1])),ia()):(M.selectAll("*").remove(),s=M.selectAll(".sourcebar").data(p.value).enter().append("g").attr("fill",(I,x)=>t[k.value[x]]).selectAll("rect").data(I=>I).enter().append("rect").attr("x",(I,x)=>E(y.data[x].date)??0).attr("y",I=>y.graphMode=="year"?c.value(I[1]/1e3):c.value(I[1])).attr("width",E.bandwidth()).attr("height",I=>y.graphMode=="year"?c.value(I[0]/1e3)-c.value(I[1]/1e3):c.value(I[0])-c.value(I[1]))))}const C=m(()=>{const M=ce("g#pgSourceGraph");if(y.graphMode!="month"&&y.graphMode!="year"&&y.data.length>0){Be.value.range(Ye.value);const E=nt().x((I,x)=>Be.value(y.data[x].date)).y0(I=>c.value(I[0])).y1(I=>c.value(I[1])).curve(rt);M.selectAll("path").attr("d",I=>I?E(I):""),M.selectAll("g#sourceToolTips").select("rect").attr("x",I=>Be.value(I.date)).attr("width",e.width/y.data.length)}return"zoomed"});return(M,E)=>(l(),f("g",{id:"pgSourceGraph",origin:d.value,origin2:C.value,transform:"translate("+M.margin.left+","+M.margin.top+")"},null,8,pr))}}),mr=["origin","origin2","transform"],fr=L({__name:"PgUsageGraph",props:{width:{},height:{},margin:{},stackOrder:{}},setup(a){const e=a,t=m(()=>g.showInverters?[["house","charging","devices","batIn","evuOut"],["charging","devices","batIn","house","evuOut"],["devices","batIn","charging","house","evuOut"],["batIn","charging","house","devices","evuOut"]]:[["house","charging","devices","batIn"],["charging","devices","batIn","house"],["devices","batIn","charging","house"],["batIn","charging","house","devices"]]),r={house:"var(--color-house)",charging:"var(--color-charging)",batIn:"var(--color-battery)",batOut:"var(--color-battery)",selfUsage:"var(--color-pv)",evuOut:"var(--color-export)",evuIn:"var(--color-evu)",cp0:"var(--color-cp0)",cp1:"var(--color-cp1)",cp2:"var(--color-cp2)",cp3:"var(--color-cp3)",sh1:"var(--color-sh1)",sh2:"var(--color-sh2)",sh3:"var(--color-sh3)",sh4:"var(--color-sh4)",devices:"var(--color-devices)"};var s,o;const h=g.showAnimations?g.animationDuration:0,d=g.showAnimations?g.animationDelay:0,u=m(()=>{const C=ce("g#pgUsageGraph");y.graphMode=="month"||y.graphMode=="year"?V(C):A(C),C.selectAll(".axis").remove();const M=C.append("g").attr("class","axis");return M.call(B.value),M.selectAll(".tick").attr("font-size",12).attr("color","var(--color-axis)"),g.showGrid?M.selectAll(".tick line").attr("stroke","var(--color-grid)").attr("stroke-width","0.5"):M.selectAll(".tick line").attr("stroke","var(--color-bg)"),M.select(".domain").attr("stroke","var(--color-bg)"),"pgUsageGraph.vue"}),p=m(()=>xa().value((C,M)=>C[M]??0).keys(P.value)),c=m(()=>p.value(y.data)),k=m(()=>He().range([e.height+10,2*e.height]).domain(y.graphMode=="year"?[0,Math.ceil(z.value[1]*10)/10]:[0,Math.ceil(z.value[1])])),P=m(()=>{if(y.graphMode!="today"&&y.graphMode!="day"&&y.graphMode!="live")return t.value[e.stackOrder];{const C=t.value[e.stackOrder].slice(),M=C.indexOf("charging");C.splice(M,1);const E=/cp\d+/;let I=[];return y.data.length>0&&(I=Object.keys(y.data[0]).reduce((x,G)=>(G.match(E)&&x.push(G),x),[])),I.forEach((x,G)=>{var xe;C.splice(M+G,0,x),r[x]=((xe=O[+x.slice(2)])==null?void 0:xe.color)??"black"}),g.showInverters&&C.push("evuOut"),C}}),z=m(()=>{let C=Ve(y.data,M=>M.house+M.charging+M.batIn+M.devices+M.evuOut);return C[0]!=null&&C[1]!=null?(y.graphMode=="year"&&(C[0]=C[0]/1e3,C[1]=C[1]/1e3),C):[0,0]}),D=m(()=>y.graphMode=="month"||y.graphMode=="year"?-e.width-e.margin.right-22:-e.width),B=m(()=>ft(k.value).tickSizeInner(D.value).ticks(4).tickFormat(C=>(C==0?"":Math.round(C*10)/10).toLocaleString(void 0)));function A(C){const M=nt().x((I,x)=>Be.value(y.data[x].date)).y(k.value(0)).curve(rt),E=nt().x((I,x)=>Be.value(y.data[x].date)).y0(I=>k.value(I[0])).y1(I=>k.value(I[1])).curve(rt);g.showAnimations?it?(C.selectAll("*").remove(),s=C.append("svg").attr("x",0).attr("width",e.width).selectAll(".usageareas").data(c.value).enter().append("path").attr("d",x=>M(x)).attr("fill",(x,G)=>r[P.value[G]]),s.transition().duration(300).delay(100).ease(dt).attr("d",x=>E(x)),ca()):(C.selectAll("*").remove(),C.append("svg").attr("x",0).attr("width",e.width).selectAll(".usageareas").data(c.value).enter().append("path").attr("d",x=>E(x)).attr("fill",(x,G)=>r[P.value[G]])):(C.selectAll("*").remove(),C.append("svg").attr("x",0).attr("width",e.width).selectAll(".usageareas").data(c.value).enter().append("path").attr("d",x=>E(x)).attr("fill",(x,G)=>r[P.value[G]]))}function V(C){it?(C.selectAll("*").remove(),o=C.selectAll(".usagebar").data(c.value).enter().append("g").attr("fill",(M,E)=>r[t.value[e.stackOrder][E]]).selectAll("rect").data(M=>M).enter().append("rect").attr("x",(M,E)=>Je.value(y.data[E].date)??0).attr("y",()=>k.value(0)).attr("height",0).attr("width",Je.value.bandwidth()),o.transition().duration(h).delay(d).ease(dt).attr("y",M=>y.graphMode=="year"?k.value(M[0]/1e3):k.value(M[0])).attr("height",M=>y.graphMode=="year"?k.value(M[1]/1e3)-k.value(M[0]/1e3):k.value(M[1])-k.value(M[0])),ca()):(C.selectAll("*").remove(),o=C.selectAll(".usagebar").data(c.value).enter().append("g").attr("fill",(M,E)=>r[t.value[e.stackOrder][E]]).selectAll("rect").data(M=>M).enter().append("rect").attr("x",(M,E)=>Je.value(y.data[E].date)??0).attr("y",M=>y.graphMode=="year"?k.value(M[0]/1e3):k.value(M[0])).attr("height",M=>y.graphMode=="year"?k.value(M[1]/1e3)-k.value(M[0]/1e3):k.value(M[1])-k.value(M[0])).attr("width",Je.value.bandwidth()))}const J=m(()=>{const C=ce("g#pgUsageGraph");if(y.graphMode!="month"&&y.graphMode!="year"){Be.value.range(Ye.value);const M=nt().x((E,I)=>Be.value(y.data[I].date)).y0(E=>k.value(E[0])).y1(E=>k.value(E[1])).curve(rt);C.selectAll("path").attr("d",E=>E?M(E):"")}return"zoomed"});return(C,M)=>(l(),f("g",{id:"pgUsageGraph",origin:u.value,origin2:J.value,transform:"translate("+C.margin.left+","+C.margin.top+")"},null,8,mr))}}),vr=["width"],yr=["transform"],br=["x","width"],_r=["transform"],wr=["origin","origin2","transform"],kr=["origin","transform"],xr={key:0},Sr=["width","height"],Mr={key:1},$r=["y","width","height"],Bt=12,Pr=L({__name:"PgXAxis",props:{width:{},height:{},margin:{}},setup(a){const e=a,t=m(()=>ht(Be.value).ticks(6).tickSizeInner(h.value).tickFormat(st("%H:%M"))),r=m(()=>Ja(Be.value).ticks(6).tickSizeInner(h.value+3).tickFormat(st(""))),s=m(()=>ht(Je.value).ticks(4).tickSizeInner(h.value).tickFormat(c=>c.toString())),o=m(()=>ht(Je.value).ticks(4).tickSizeInner(h.value).tickFormat(()=>"")),h=m(()=>y.graphMode!=="month"&&y.graphMode!=="year"?g.showGrid?-(e.height/2-7):-10:0),d=m(()=>{let c=ce("g#PGXAxis"),k=ce("g#PgUnit");return c.selectAll("*").remove(),k.selectAll("*").remove(),y.graphMode=="month"||y.graphMode=="year"?c.call(s.value):c.call(t.value),c.selectAll(".tick > text").attr("fill",(P,z)=>z>=0||y.graphMode=="month"||y.graphMode=="year"?"var(--color-axis)":"var(--color-bg)").attr("font-size",Bt),g.showGrid?c.selectAll(".tick line").attr("stroke","var(--color-grid)").attr("stroke-width","0.5"):c.selectAll(".tick line").attr("stroke","var(--color-bg)"),c.select(".domain").attr("stroke","var(--color-bg)"),k.append("text").attr("x",0).attr("y",12).attr("fill","var(--color-axis)").attr("font-size",Bt).text(y.graphMode=="year"?"MW":"kW").attr("text-anchor","start"),"PGXAxis.vue"}),u=m(()=>{let c=ce("g#PGXAxis2");return c.selectAll("*").remove(),y.graphMode=="month"||y.graphMode=="year"?c.call(o.value):c.call(r.value),c.selectAll(".tick > text").attr("fill",(k,P)=>P>=0||y.graphMode=="month"||y.graphMode=="year"?"var(--color-axis)":"var(--color-bg)").attr("font-size",Bt),g.showGrid?(c.selectAll(".tick line").attr("stroke","var(--color-grid)").attr("stroke-width","0.5"),c.select(".domain").attr("stroke","var(--color-bg)")):c.selectAll(".tick line").attr("stroke","var(--color-bg)"),c.select(".domain").attr("stroke","var(--color-bg)"),"PGXAxis2.vue"}),p=m(()=>{if(y.graphMode!="month"&&y.graphMode!="year"){const c=ce("g#PGXAxis"),k=ce("g#PGXAxis2");y.graphMode=="month"||y.graphMode=="year"?(Je.value.range(Ye.value),c.call(s.value),k.call(o.value)):(Be.value.range(Ye.value),c.call(t.value),k.call(r.value))}return"zoomed"});return(c,k)=>(l(),f(F,null,[(l(),f("svg",{x:"0",width:e.width},[n("g",{id:"PgUnit",transform:"translate(0,"+(c.height/2+9)+")"},null,8,yr)],8,vr)),(l(),f("svg",{x:e.margin.left,width:e.width},[n("g",{transform:"translate("+c.margin.left+","+c.margin.top+")"},[n("g",{id:"PGXAxis",class:"axis",origin:d.value,origin2:p.value,transform:"translate(0,"+(c.height/2-6)+")"},null,8,wr),n("g",{id:"PGXAxis2",class:"axis",origin:u.value,transform:"translate(0,"+(c.height/2+10)+")"},null,8,kr),i(g).showGrid?(l(),f("g",xr,[n("rect",{x:"0",y:"0",width:c.width,height:c.height/2-10,fill:"none",stroke:"var(--color-grid)","stroke-width":"0.5"},null,8,Sr)])):w("",!0),i(g).showGrid?(l(),f("g",Mr,[n("rect",{x:"0",y:c.height/2+10,width:c.width,height:c.height/2-10,fill:"none",stroke:"var(--color-grid)","stroke-width":"0.5"},null,8,$r)])):w("",!0)],8,_r)],8,br))],64))}}),Ir=["width"],Cr=["id",".origin","d"],Br=["id","d","stroke"],Vr=["x","y","text-anchor"],Vt=L({__name:"PgSoc",props:{width:{},height:{},margin:{},order:{}},setup(a){const e=a,t=m(()=>{let P=Ve(y.data,z=>z.date);return P[0]&&P[1]?et().domain(P).range([0,e.width]):et().range([0,0])}),r=m(()=>He().range([e.height-10,0]).domain([0,100])),s=m(()=>{let z=Ne().x(D=>t.value(D.date)).y(D=>r.value(e.order==2?D.batSoc:e.order==0?D["soc"+me.value[0]]:D["soc"+me.value[1]])??r.value(0))(y.data);return z||""}),o=m(()=>e.order),h=m(()=>{switch(e.order){case 2:return"Speicher";case 1:return Y[me.value[1]]!=null?Y[me.value[1]].name:"???";default:return Y[me.value[0]]!=null?Y[me.value[0]].name:"???"}}),d=m(()=>{switch(e.order){case 0:return"var(--color-cp1)";case 1:return"var(--color-cp2)";case 2:return"var(--color-battery)";default:return"red"}}),u=m(()=>{switch(e.order){case 0:return 3;case 1:return e.width-3;case 2:return e.width/2;default:return 0}}),p=m(()=>{if(y.data.length>0){let P;switch(e.order){case 0:return P=y.data.length-1,r.value(y.data[P]["soc"+me.value[0]]+2);case 1:return P=0,r.value(y.data[P]["soc"+me.value[1]]+2);case 2:return P=Math.round(y.data.length/2),r.value(y.data[P].batSoc+2);default:return 0}}else return 0}),c=m(()=>{switch(e.order){case 0:return"start";case 1:return"end";case 2:return"middle";default:return"middle"}}),k=m(()=>{if(y.graphMode!="month"&&y.graphMode!="year"){const P=ce("path#soc-"+o.value),z=ce("path#socdashes-"+o.value);t.value.range(Ye.value);const D=Ne().x(B=>t.value(B.date)).y(B=>r.value(e.order==2?B.batSoc:e.order==1?B["soc"+me.value[0]]:B["soc"+me.value[1]])??r.value(0));P.attr("d",D(y.data)),z.attr("d",D(y.data))}return"zoomed"});return(P,z)=>(l(),f("svg",{x:"0",width:e.width},[n("path",{id:"soc-"+o.value,".origin":k.value,class:"soc-baseline",d:s.value,stroke:"var(--color-bg)","stroke-width":"1",fill:"none"},null,40,Cr),n("path",{id:"socdashes-"+o.value,class:"soc-dashes",d:s.value,stroke:d.value,"stroke-width":"1",style:{strokeDasharray:"3,3"},fill:"none"},null,8,Br),n("text",{class:"cpname",x:u.value,y:p.value,style:K({fill:d.value,fontSize:10}),"text-anchor":c.value},S(h.value),13,Vr)],8,Ir))}}),Lr=["transform"],Or=L({__name:"PgSocAxis",props:{width:{},height:{},margin:{}},setup(a){const e=a,t=m(()=>He().range([e.height-10,0]).domain([0,100])),r=m(()=>Ya(t.value).ticks(5).tickFormat(o=>o.toString()+"%"));function s(){let o=ce("g#PGSocAxis");o.call(r.value),o.selectAll(".tick").attr("font-size",12),o.selectAll(".tick line").attr("stroke","var(--color-bg)"),o.select(".domain").attr("stroke","var(--color-bg)")}return Le(()=>{s()}),(o,h)=>(l(),f("g",{id:"PGSocAxis",class:"axis",transform:"translate("+(o.width-20)+",0)"},null,8,Lr))}}),Ar={class:"d-flex align-self-top justify-content-center align-items-center"},Tr={class:"input-group input-group-xs"},Er={key:0,class:"btn dropdown-toggle",type:"button","data-bs-toggle":"dropdown"},zr={class:"dropdown-menu"},Wr={class:"table optiontable"},Dr=["onClick"],Gr={key:1,class:"btn dropdown-toggle",type:"button","data-bs-toggle":"dropdown"},jr={class:"dropdown-menu"},Ur={class:"table optiontable"},Fr=["onClick"],Nr={key:2,class:"btn dropdown-toggle",type:"button","data-bs-toggle":"dropdown"},Hr={class:"dropdown-menu"},Rr={class:"table optiontable"},Jr=["onClick"],Yr=L({__name:"DateInput",props:{modelValue:{type:Date,required:!0},mode:{type:String,default:"day"}},emits:["update:modelValue"],setup(a,{emit:e}){const t=a,r=new Date().getFullYear();let s=Array.from({length:10},(z,D)=>r-D);const o=ee(!0),h=e,d=[[0,1,2,3],[4,5,6,7],[8,9,10,11]],u=ee(t.modelValue.getDate()),p=ee(t.modelValue.getMonth()),c=ee(t.modelValue.getFullYear()),k=m(()=>{const D=new Date(c.value,p.value,1).getDay();let B=0;switch(p.value){case 1:case 3:case 5:case 7:case 8:case 10:case 12:B=31;break;case 4:case 6:case 9:case 11:B=30;break;case 2:Math.trunc(c.value/4)*4==c.value?B=29:B=28}let A=[],V=[0,0,0,0,0,0,0],J=D;for(let C=0;C(l(),f("span",Ar,[n("div",Tr,[t.mode=="day"||t.mode=="today"?(l(),f("button",Er,S(u.value),1)):w("",!0),n("div",zr,[n("table",Wr,[(l(!0),f(F,null,te(k.value,(B,A)=>(l(),f("tr",{key:A,class:""},[(l(!0),f(F,null,te(B,(V,J)=>(l(),f("td",{key:J},[V!=0?(l(),f("span",{key:0,type:"button",class:"btn optionbutton",onClick:C=>u.value=V},S(V),9,Dr)):w("",!0)]))),128))]))),128))])]),t.mode!="year"&&t.mode!="live"?(l(),f("button",Gr,S(p.value+1),1)):w("",!0),n("div",jr,[n("table",Ur,[(l(),f(F,null,te(d,(B,A)=>n("tr",{key:A,class:""},[(l(!0),f(F,null,te(B,(V,J)=>(l(),f("td",{key:J,class:"p-0 m-0"},[n("span",{type:"button",class:"btn btn-sm optionbutton",onClick:C=>p.value=V},S(V+1),9,Fr)]))),128))])),64))])]),t.mode!="live"?(l(),f("button",Nr,S(c.value),1)):w("",!0),n("div",Hr,[n("table",Rr,[(l(!0),f(F,null,te(i(s),(B,A)=>(l(),f("tr",{key:A,class:""},[n("td",null,[n("span",{type:"button",class:"btn optionbutton",onClick:V=>c.value=B},S(B),9,Jr)])]))),128))])]),t.mode!="live"?(l(),f("button",{key:3,class:"button-outline-secondary",type:"button",onClick:P},D[0]||(D[0]=[n("span",{class:"fa-solid fa-circle-check"},null,-1)]))):w("",!0)])]))}}),R=(a,e)=>{const t=a.__vccOpts||a;for(const[r,s]of e)t[r]=s;return t},qr=R(Yr,[["__scopeId","data-v-98690e5d"]]),Qr={class:"btn-group m-0",role:"group","aria-label":"radiobar"},Zr=["id","value"],Xr=L({__name:"RadioBarInput",props:{options:{},modelValue:{}},emits:["update:modelValue"],setup(a,{emit:e}){const t=a,r=e,s=m({get(){return t.modelValue},set(d){r("update:modelValue",d)}});function o(d){let u=t.options[d].color?t.options[d].color:"var(--color-fg)";return t.options[d].active?{color:"var(--color-bg)",background:u}:{color:u}}function h(d){let u=d.target;for(;u&&!u.value&&u.parentElement;)u=u.parentElement;u.value&&(s.value=u.value)}return(d,u)=>(l(),f("div",null,[n("div",Qr,[(l(!0),f(F,null,te(d.options,(p,c)=>(l(),f("button",{id:"radio-"+p.value,key:c,class:q(["btn btn-outline-secondary btn-sm radiobutton mx-0 mb-0 px-2",p.value==s.value?"active":""]),value:p.value,style:K(o(c)),onClick:h},[n("span",{style:K(o(c))},[p.icon?(l(),f("i",{key:0,class:q(["fa-solid",p.icon])},null,2)):w("",!0),H(" "+S(p.text),1)],4)],14,Zr))),128))])]))}}),Oa=R(Xr,[["__scopeId","data-v-82ab6829"]]),Kr=L({__name:"PgSelector",props:{widgetid:{},showLeftButton:{type:Boolean},showRightButton:{type:Boolean},ignoreLive:{type:Boolean}},emits:["shiftLeft","shiftRight","shiftUp","shiftDown"],setup(a){const e=a,t=ee(0),r=m(()=>{if(y.waitForData)return"Lädt";switch(y.graphMode){case"live":return e.ignoreLive?"heute":`${ge.duration} min`;case"today":return"heute";case"day":return ue.date.getDate()+"."+(ue.date.getMonth()+1)+".";case"month":return Fn(Ee.month-1,Ee.year);case"year":return Re.year.toString();default:return"???"}}),s=["live","today","day","month","year"],o=["Live","Heute","Tag","Monat","Jahr"],h=m({get(){return y.graphMode},set(J){switch(J){case"day":k();break;case"today":P();break;case"live":c();break;case"month":z();break;case"year":D()}}}),d=m(()=>{switch(y.graphMode){case"live":case"today":return ue.getDate();case"month":return Ee.getDate();default:return ue.getDate()}});function u(J){da(J)}function p(){t.value+=1,t.value>2&&(t.value=0)}function c(){y.graphMode!="live"&&(y.graphMode="live",fe())}function k(){y.graphMode!="day"&&y.graphMode!="today"&&(y.graphMode="day",fe())}function P(){y.graphMode!="today"&&(y.graphMode="today",da(new Date),fe())}function z(){y.graphMode!="month"&&(y.graphMode="month",fe())}function D(){y.graphMode!="year"&&(y.graphMode="year",fe())}const B=m(()=>t.value>0?{border:"1px solid var(--color-frame)"}:""),A=m(()=>t.value==1?"justify-content-between":"justify-content-end"),V=m(()=>t.value==1?"justify-content-between":"justify-content-center");return(J,C)=>(l(),f("div",{class:"d-flex flex-column justify-content-center pgselector rounded",style:K(B.value)},[t.value==2?(l(),$(Oa,{key:0,id:"pgm2",modelValue:h.value,"onUpdate:modelValue":C[0]||(C[0]=M=>h.value=M),class:"m-2",options:s.map((M,E)=>({text:o[E],value:M,color:"var(--color-menu)",active:M==i(y).graphMode}))},null,8,["modelValue","options"])):w("",!0),t.value==1?(l(),f("span",{key:1,type:"button",class:q(["arrowButton d-flex align-self-center mb-3 mt-3",{disabled:!e.showLeftButton}]),onClick:C[1]||(C[1]=M=>J.$emit("shiftUp"))},C[6]||(C[6]=[n("i",{class:"fa-solid fa-xl fa-chevron-circle-up"},null,-1)]),2)):w("",!0),n("div",{class:q(["d-flex align-items-center",V.value])},[t.value==1?(l(),f("span",{key:0,type:"button",class:q(["p-1",{disabled:!e.showLeftButton}]),onClick:C[2]||(C[2]=M=>J.$emit("shiftLeft"))},C[7]||(C[7]=[n("span",{class:"fa-solid fa-xl fa-chevron-circle-left arrowButton"},null,-1)]),2)):w("",!0),t.value<2?(l(),f("span",{key:1,type:"button",class:"btn-outline-secondary p-2 px-3 badge rounded-pill datebadge",onClick:p},S(r.value),1)):w("",!0),t.value==2?(l(),$(qr,{key:2,"model-value":d.value,mode:i(y).graphMode,"onUpdate:modelValue":u},null,8,["model-value","mode"])):w("",!0),t.value==1?(l(),f("span",{key:3,id:"graphRightButton",type:"button",class:q(["arrowButton fa-solid fa-xl fa-chevron-circle-right p-1",{disabled:!e.showRightButton}]),onClick:C[3]||(C[3]=M=>J.$emit("shiftRight"))},null,2)):w("",!0)],2),n("div",{class:q(["d-flex align-items-center",A.value])},[t.value==1?(l(),f("span",{key:0,type:"button",class:"p-1",onClick:p},C[8]||(C[8]=[n("span",{class:"fa-solid fa-xl fa-gear"},null,-1)]))):w("",!0),t.value==1?(l(),f("span",{key:1,id:"graphLeftButton",type:"button",class:q(["arrowButton fa-solid fa-xl fa-chevron-circle-down p-1",{disabled:!e.showLeftButton}]),onClick:C[4]||(C[4]=M=>J.$emit("shiftDown"))},null,2)):w("",!0),t.value>0?(l(),f("span",{key:2,type:"button",class:"p-1",onClick:C[5]||(C[5]=M=>t.value=0)},C[9]||(C[9]=[n("span",{class:"fa-solid fa-xl fa-circle-check"},null,-1)]))):w("",!0)],2)],4))}}),na=R(Kr,[["__scopeId","data-v-d75ec1a4"]]),eo=["x","fill"],to=["x"],Ie=L({__name:"PgToolTipLine",props:{cat:{},name:{},indent:{},power:{},width:{}},setup(a){const e=a;return(t,r)=>(l(),f(F,null,[t.power>0?(l(),f("tspan",{key:0,x:t.indent,dy:"1.3em",class:q(t.name?"":"fas"),fill:i(ie)[t.cat].color},S(t.name?t.name:i(ie)[t.cat].icon)+"   ",11,eo)):w("",!0),n("tspan",{"text-anchor":"end",x:t.width-t.indent},[e.power>0?(l(),$(bt,{key:0,watt:t.power*1e3},null,8,["watt"])):w("",!0)],8,to)],64))}}),ao=["transform"],no=["width","height"],ro={"text-anchor":"start",x:"5",y:"20","font-size":"16",fill:"var(--color-fg)"},oo=["x"],so=L({__name:"PgToolTipItem",props:{entry:{},boxwidth:{},xScale:{type:[Function,Object]}},setup(a){const e=a,t=m(()=>Object.values(e.entry).filter(u=>u>0).length),r=m(()=>t.value*16),s=m(()=>Object.entries(e.entry).filter(([u,p])=>u.startsWith("pv")&&u.length>2&&p>0).map(([u,p])=>({power:p,name:Fe.value.get(u)?d(Fe.value.get(u)):"Wechselr.",id:u}))),o=m(()=>Object.entries(e.entry).filter(([u,p])=>u.startsWith("cp")&&u.length>2&&p>0).map(([u,p])=>({power:p,name:Fe.value.get(u)?d(Fe.value.get(u)):"Ladep.",id:u}))),h=m(()=>Object.entries(e.entry).filter(([u,p])=>u.startsWith("sh")&&u.length>2&&p>0).map(([u,p])=>({power:p,name:Fe.value.get(u)?d(Fe.value.get(u)):"Gerät",id:u})));function d(u){return u.length>6?u.slice(0,6)+"...":u}return(u,p)=>(l(),f("g",{class:"ttmessage",transform:"translate("+u.xScale(u.entry.date)+",0)"},[n("rect",{rx:"5",width:u.boxwidth,height:r.value,fill:"var(--color-bg)",opacity:"80%",stroke:"var(--color-menu)"},null,8,no),n("text",ro,[n("tspan",{"text-anchor":"middle",x:u.boxwidth/2,dy:"0em"},S(i(st)("%H:%M")(new Date(u.entry.date))),9,oo),p[0]||(p[0]=n("line",{y:"120",x1:"5",x2:"100",stroke:"var(--color-fg)","stroke-width":"1"},null,-1)),v(Ie,{cat:"evuIn",indent:5,power:u.entry.evuIn,width:u.boxwidth},null,8,["power","width"]),v(Ie,{cat:"batOut",indent:5,power:u.entry.batOut,width:u.boxwidth},null,8,["power","width"]),v(Ie,{cat:"pv",indent:5,power:u.entry.pv,width:u.boxwidth},null,8,["power","width"]),(l(!0),f(F,null,te(s.value,c=>(l(),$(Ie,{key:c.id,cat:"pv",name:c.name,power:c.power,indent:10,width:u.boxwidth},null,8,["name","power","width"]))),128)),v(Ie,{cat:"house",indent:5,power:u.entry.house,width:u.boxwidth},null,8,["power","width"]),v(Ie,{cat:"charging",indent:5,power:u.entry.charging,width:u.boxwidth},null,8,["power","width"]),(l(!0),f(F,null,te(o.value,c=>(l(),$(Ie,{key:c.id,cat:"charging",name:c.name,power:c.power,indent:10,width:u.boxwidth},null,8,["name","power","width"]))),128)),v(Ie,{cat:"devices",indent:5,power:u.entry.devices,width:u.boxwidth},null,8,["power","width"]),(l(!0),f(F,null,te(h.value,c=>(l(),$(Ie,{key:c.id,cat:"devices",name:c.name,power:c.power,indent:10,width:u.boxwidth},null,8,["name","power","width"]))),128)),v(Ie,{cat:"batIn",indent:5,power:u.entry.batIn,width:u.boxwidth},null,8,["power","width"]),v(Ie,{cat:"evuOut",indent:5,power:u.entry.evuOut,width:u.boxwidth},null,8,["power","width"])])],8,ao))}}),io=["origin","transform"],lo=["x","height","width"],ga=140,co=L({__name:"PgToolTips",props:{width:{},height:{},margin:{},data:{}},setup(a){const e=a,t=m(()=>{const o=Ve(e.data,h=>new Date(h.date));return o[0]&&o[1]?Ft().domain(o).range([0,e.width-e.margin.right]):et().range([0,0])}),r=m(()=>{const o=Ve(e.data,h=>new Date(h.date));return o[0]&&o[1]?Ft().domain(o).range([0,e.width-e.margin.right-ga]):et().range([0,0])}),s=m(()=>((y.graphMode=="day"||y.graphMode=="today")&&(t.value.range(Ye.value),ce("g#pgToolTips").selectAll("g.ttarea").select("rect").attr("x",(o,h)=>e.data.length>h?t.value(e.data[h].date):0).attr("width",e.data.length>0?(Ye.value[1]-Ye.value[0])/e.data.length:0)),"PgToolTips.vue:autozoom"));return(o,h)=>(l(),f("g",{id:"pgToolTips",origin:s.value,transform:"translate("+o.margin.left+","+o.margin.top+")"},[(l(!0),f(F,null,te(o.data,d=>(l(),f("g",{key:d.date,class:"ttarea"},[n("rect",{x:t.value(d.date),y:"0",height:o.height,class:"ttrect",width:i(y).data.length>0?o.width/i(y).data.length:0,opacity:"1%",fill:"var(--color-charging)"},null,8,lo),v(so,{entry:d,boxwidth:ga,"x-scale":r.value},null,8,["entry","x-scale"])]))),128))],8,io))}}),uo={class:"d-flex justify-content-end"},ho={id:"powergraphFigure",class:"p-0 m-0"},po=["viewBox"],go=["transform"],mo=["x","y"],fo=2,vo="Leistung / Ladestand ",yo=L({__name:"PowerGraph",setup(a){function e(){let h=g.usageStackOrder+1;h>fo&&(h=0),g.usageStackOrder=h,xn(!0)}function t(h){const d=[[0,j.top],[be,Se-j.top]];h.call(Qa().scaleExtent([1,8]).translateExtent([[0,0],[be,Se]]).extent(d).filter(s).on("zoom",r))}function r(h){Ca.value=h.transform}function s(h){return h.preventDefault(),(!h.ctrlKey||h.type==="wheel")&&!h.button}function o(){g.zoomedWidget=1,g.zoomGraph=!g.zoomGraph}return Le(()=>{const h=ce("svg#powergraph");t(h)}),(h,d)=>(l(),$(_t,{"full-width":!0},{title:_(()=>[H(S(vo))]),buttons:_(()=>[n("div",uo,[v(na,{widgetid:"graphsettings","show-left-button":!0,"show-right-button":!0,"ignore-live":!1,onShiftLeft:i(It),onShiftRight:i(Kt),onShiftUp:i(ea),onShiftDown:i(ta)},null,8,["onShiftLeft","onShiftRight","onShiftUp","onShiftDown"]),i(De)?(l(),f("span",{key:0,type:"button",class:"ms-1 p-0 pt-1",onClick:o},d[0]||(d[0]=[n("span",{class:"fa-solid fa-lg ps-1 fa-magnifying-glass"},null,-1)]))):w("",!0)])]),default:_(()=>[vt(n("figure",ho,[(l(),f("svg",{id:"powergraph",class:"powergraphSvg",viewBox:"0 0 "+i(be)+" "+i(Se)},[v(gr,{width:i(be)-i(j).left-2*i(j).right,height:(i(Se)-i(j).top-i(j).bottom)/2,margin:i(j)},null,8,["width","height","margin"]),v(fr,{width:i(be)-i(j).left-2*i(j).right,height:(i(Se)-i(j).top-i(j).bottom)/2,margin:i(j),"stack-order":i(g).usageStackOrder},null,8,["width","height","margin","stack-order"]),v(Pr,{width:i(be)-i(j).left-2*i(j).right,height:i(Se)-i(j).top-i(j).bottom,margin:i(j)},null,8,["width","height","margin"]),n("g",{transform:"translate("+i(j).left+","+i(j).top+")"},[(i(y).graphMode=="day"||i(y).graphMode=="today"||i(y).graphMode=="live")&&Object.values(i(Y)).filter(u=>u.visible).length>0?(l(),$(Vt,{key:0,width:i(be)-i(j).left-2*i(j).right,height:(i(Se)-i(j).top-i(j).bottom)/2,margin:i(j),order:0},null,8,["width","height","margin"])):w("",!0),(i(y).graphMode=="day"||i(y).graphMode=="today"||i(y).graphMode=="live")&&Object.values(i(Y)).filter(u=>u.visible).length>1?(l(),$(Vt,{key:1,width:i(be)-i(j).left-2*i(j).right,height:(i(Se)-i(j).top-i(j).bottom)/2,margin:i(j),order:1},null,8,["width","height","margin"])):w("",!0),(i(y).graphMode=="day"||i(y).graphMode=="today"||i(y).graphMode=="live")&&i(de).isBatteryConfigured?(l(),$(Vt,{key:2,width:i(be)-i(j).left-2*i(j).right,height:(i(Se)-i(j).top-i(j).bottom)/2,margin:i(j),order:2},null,8,["width","height","margin"])):w("",!0),i(y).graphMode=="day"||i(y).graphMode=="today"||i(y).graphMode=="live"?(l(),$(Or,{key:3,width:i(be)-i(j).left-i(j).right,height:(i(Se)-i(j).top-i(j).bottom)/2,margin:i(j)},null,8,["width","height","margin"])):w("",!0)],8,go),i(y).graphMode=="day"||i(y).graphMode=="today"?(l(),$(co,{key:0,width:i(be)-i(j).left-i(j).right,height:i(Se)-i(j).top-i(j).bottom,margin:i(j),data:i(y).data},null,8,["width","height","margin","data"])):w("",!0),n("g",{id:"button",type:"button",onClick:e},[n("text",{x:i(be)-10,y:i(Se)-10,color:"var(--color-menu)","text-anchor":"end"},d[1]||(d[1]=[n("tspan",{fill:"var(--color-menu)",class:"fas fa-lg"},S(""),-1)]),8,mo)])],8,po))],512),[[qa,i(y).data.length>0]])]),_:1}))}}),bo=R(yo,[["__scopeId","data-v-7cbcf9ef"]]),_o=["id"],wo=["x","width","height","fill"],ko=["x","width","height"],xo=["x","y","width","height"],So=L({__name:"EmBar",props:{item:{},xScale:{},yScale:{},margin:{},height:{},barcount:{},autarchy:{},autText:{}},setup(a){const e=a,t=m(()=>e.height-e.yScale(e.item.energy)-e.margin.top-e.margin.bottom),r=m(()=>{let o=0;return e.item.energyPv>0&&(o=e.height-e.yScale(e.item.energyPv)-e.margin.top-e.margin.bottom),o>t.value&&(o=t.value),o}),s=m(()=>{let o=0;return e.item.energyBat>0&&(o=e.height-e.yScale(e.item.energyBat)-e.margin.top-e.margin.bottom),o>t.value&&(o=t.value),o});return(o,h)=>(l(),f("g",{id:"bar-"+e.item.name,transform:"scale(1,-1) translate (0,-445)"},[n("rect",{class:"bar",x:e.xScale(o.item.name),y:"0",width:e.xScale.bandwidth(),height:t.value,fill:o.item.color},null,8,wo),n("rect",{class:"bar",x:e.xScale(o.item.name)+e.xScale.bandwidth()/6,y:"0",width:e.xScale.bandwidth()*2/3,height:r.value,fill:"var(--color-pv)","fill-opacity":"66%"},null,8,ko),n("rect",{class:"bar",x:e.xScale(o.item.name)+e.xScale.bandwidth()/6,y:r.value,width:e.xScale.bandwidth()*2/3,height:s.value,fill:"var(--color-battery)","fill-opacity":"66%"},null,8,xo)],8,_o))}}),Mo={id:"emBargraph"},$o=L({__name:"EMBarGraph",props:{plotdata:{},xScale:{},yScale:{},margin:{},height:{}},setup(a){const e=a;function t(s){if(s.name=="PV"){const o=y.graphMode=="live"||y.graphMode=="day"?Q:T.items,d=(y.graphMode=="live"||y.graphMode=="day"?U:T.items).evuOut.energy,u=o.pv.energy;return Math.round((u-d)/u*100)}else if(s.name=="Netz"){const o=y.graphMode=="live"||y.graphMode=="day"?Q:T.items,h=y.graphMode=="live"||y.graphMode=="day"?U:T.items,d=h.evuOut.energy,u=o.evuIn.energy,p=o.pv.energy,c=o.batOut.energy,k=h.batIn.energy;return Math.round((p+c-d-k)/(p+c+u-d-k)*100)}else return s.pvPercentage}function r(s){return s.name=="PV"?"Eigen":"Aut"}return(s,o)=>(l(),f("g",Mo,[(l(!0),f(F,null,te(e.plotdata,(h,d)=>(l(),f("g",{key:d},[v(So,{item:h,"x-scale":e.xScale,"y-scale":e.yScale,margin:e.margin,height:e.height,barcount:e.plotdata.length,"aut-text":r(h),autarchy:t(h)},null,8,["item","x-scale","y-scale","margin","height","barcount","aut-text","autarchy"])]))),128)),o[0]||(o[0]=n("animateTransform",{"attribute-name":"transform",type:"scale",from:"1 0",to:"1 1",begin:"0s",dur:"2s"},null,-1))]))}}),Po=["origin"],Io=L({__name:"EMYAxis",props:{yScale:{type:[Function,Object]},width:{},fontsize:{}},setup(a){const e=a,t=m(()=>ft(e.yScale).tickFormat(o=>s(o)).ticks(6).tickSizeInner(-e.width)),r=m(()=>{const o=ce("g#emYAxis");return o.attr("class","axis").call(t.value),o.append("text").attr("y",6).attr("dy","0.71em").attr("text-anchor","end").text("energy"),o.selectAll(".tick").attr("font-size",e.fontsize),g.showGrid?o.selectAll(".tick line").attr("stroke","var(--color-grid)").attr("stroke-width","0.5"):o.selectAll(".tick line").attr("stroke","var(--color-bg)"),o.select(".domain").attr("stroke","var(--color-bg)"),"emYAxis.vue"});function s(o){return o>0?y.graphMode=="year"?(o/1e6).toString():(o/1e3).toString():""}return(o,h)=>(l(),f("g",{id:"emYAxis",class:"axis",origin:r.value},null,8,Po))}}),Co=["id"],Bo=["x","y","font-size"],Vo=["x","y","font-size","fill"],Lo=["x","y","font-size","fill"],Oo=L({__name:"EmLabel",props:{item:{},xScale:{},yScale:{},margin:{},height:{},barcount:{},autarchy:{},autText:{}},setup(a){const e=a,t=m(()=>e.autarchy?e.yScale(e.item.energy)-25:e.yScale(e.item.energy)-10),r=m(()=>{let u=16,p=e.barcount;return p<=5?u=16:p==6?u=14:p>6&&p<=8?u=13:p==9?u=11:p==10?u=10:u=9,u}),s=m(()=>{let u=12,p=e.barcount;return p<=5?u=12:p==6?u=11:p>6&&p<=8||p==9?u=8:p==10?u=7:u=6,u});function o(u,p){return p.length>s.value?p.substring(0,s.value)+".":p}function h(){return e.autarchy?e.autText+": "+e.autarchy.toLocaleString(void 0)+" %":""}function d(){return"var(--color-pv)"}return(u,p)=>(l(),f("g",{id:"barlabel-"+e.item.name},[n("text",{x:e.xScale(u.item.name)+e.xScale.bandwidth()/2,y:t.value,"font-size":r.value,"text-anchor":"middle",fill:"var(--color-menu)"},S(i(ct)(u.item.energy,i(g).decimalPlaces,!1)),9,Bo),n("text",{x:e.xScale(u.item.name)+e.xScale.bandwidth()/2,y:e.yScale(u.item.energy)-10,"font-size":r.value-2,"text-anchor":"middle",fill:d()},S(h()),9,Vo),n("text",{x:e.xScale(u.item.name)+e.xScale.bandwidth()/2,y:e.height-e.margin.bottom-5,"font-size":r.value,"text-anchor":"middle",fill:u.item.color,class:q(u.item.icon.length<=2?"fas":"")},S(o(u.item.name,u.item.icon)),11,Lo)],8,Co))}}),Ao={id:"emBarLabels"},To=L({__name:"EMLabels",props:{plotdata:{},xScale:{},yScale:{},height:{},margin:{}},setup(a){const e=a;function t(s){if(s.name=="PV"){const o=y.graphMode=="live"||y.graphMode=="today"?Q:T.items,d=(y.graphMode=="live"||y.graphMode=="today"?U:T.items).evuOut.energy,u=o.pv.energy;return Math.round((u-d)/u*100)}else if(s.name=="Netz"){const o=y.graphMode=="live"||y.graphMode=="today"?Q:T.items,h=y.graphMode=="live"||y.graphMode=="today"?U:T.items,d=h.evuOut.energy,u=o.evuIn.energy,p=o.pv.energy,c=o.batOut.energy,k=h.batIn.energy;return p+c-d-k>0?Math.round((p+c-d-k)/(p+c+u-d-k)*100):0}else return s.pvPercentage}function r(s){return s.name=="PV"?"Eigen":"Aut"}return(s,o)=>(l(),f("g",Ao,[(l(!0),f(F,null,te(e.plotdata,(h,d)=>(l(),f("g",{key:d},[v(Oo,{item:h,"x-scale":e.xScale,"y-scale":e.yScale,margin:e.margin,height:e.height,barcount:e.plotdata.length,"aut-text":r(h),autarchy:t(h)},null,8,["item","x-scale","y-scale","margin","height","barcount","aut-text","autarchy"])]))),128))]))}}),Eo={class:"d-flex justify-content-end"},zo={id:"energymeter",class:"p-0 m-0"},Wo={viewBox:"0 0 500 500"},Do=["transform"],Go=["x"],jo={key:0},ma=500,Lt=500,fa=12,Uo="Energie",Fo=L({__name:"EnergyMeter",setup(a){const e={top:25,bottom:30,left:25,right:0},t=m(()=>{let u=Object.values(Q),p=o.value;const c=T.items;let k=[];switch(g.debug&&h(),lt.value==!0&&(lt.value=!1),y.graphMode){default:case"live":case"today":k=u.concat(p);break;case"day":case"month":case"year":Object.values(c).length==0?qe.value=!0:(qe.value=!1,k=[c.evuIn,c.pv,c.evuOut,c.batOut,c.charging],Object.values(O).length>1&&Object.keys(O).forEach(P=>{c["cp"+P]&&k.push(c["cp"+P])}),k.push(c.devices),ae.forEach((P,z)=>{P.showInGraph&&c["sh"+z]&&k.push(c["sh"+z])}),k=k.concat([c.batIn,c.house]))}return k.filter(P=>P.energy&&P.energy>0)}),r=m(()=>xt().range([0,ma-e.left-e.right]).domain(t.value.map(u=>u.name)).padding(.4)),s=m(()=>He().range([Lt-e.bottom-e.top,15]).domain([0,Sa(t.value,u=>u.energy)])),o=m(()=>{const u=Object.values(O).length,p=[...ae.values()].filter(k=>k.configured).length;let c=U;return[...[c.evuOut,c.charging].concat(u>1?Object.values(O).map(k=>k.toPowerItem()):[]),...[c.devices].concat(p>1?[...ae.values()].filter(k=>k.configured&&k.showInGraph):[]).concat([U.batIn,U.house])]});function h(){console.debug(["source summary:",Q]),console.debug(["usage details:",o.value]),console.debug(["historic summary:",T])}function d(){g.zoomedWidget=2,g.zoomGraph=!g.zoomGraph}return(u,p)=>(l(),$(_t,{"full-width":!0},{title:_(()=>[H(S(Uo))]),buttons:_(()=>[n("div",Eo,[v(na,{widgetid:"graphsettings","show-left-button":!0,"show-right-button":!0,"ignore-live":!0,onShiftLeft:i(It),onShiftRight:i(Kt),onShiftUp:i(ea),onShiftDown:i(ta)},null,8,["onShiftLeft","onShiftRight","onShiftUp","onShiftDown"]),i(De)?(l(),f("span",{key:0,type:"button",class:"ms-1 p-0 pt-1",onClick:d},p[0]||(p[0]=[n("span",{class:"fa-solid fa-lg ps-1 fa-magnifying-glass"},null,-1)]))):w("",!0)])]),default:_(()=>[n("figure",zo,[(l(),f("svg",Wo,[n("g",{transform:"translate("+e.left+","+e.top+")"},[v($o,{plotdata:t.value,"x-scale":r.value,"y-scale":s.value,height:Lt,margin:e},null,8,["plotdata","x-scale","y-scale"]),v(Io,{"y-scale":s.value,width:ma,fontsize:fa,config:i(g)},null,8,["y-scale","config"]),n("text",{x:-e.left,y:"-15",fill:"var(--color-axis)","font-size":fa},S(i(y).graphMode=="year"?"MWh":"kWh"),9,Go),v(To,{plotdata:t.value,"x-scale":r.value,"y-scale":s.value,height:Lt,margin:e,config:i(g)},null,8,["plotdata","x-scale","y-scale","config"])],8,Do)]))]),i(qe)?(l(),f("p",jo,"No data")):w("",!0)]),_:1}))}}),No=R(Fo,[["__scopeId","data-v-32c82102"]]),Ho=["id"],Ro=["y","width","fill"],Jo=["y","width"],Yo=["y","x","width"],qo=L({__name:"EnergyBar",props:{id:{},item:{},yScale:{},xScale:{},itemHeight:{}},setup(a){const e=a,t=m(()=>e.xScale(e.item.energy)),r=m(()=>{let o=0;return e.item.energyPv>0&&(o=e.xScale(e.item.energyPv)),o>t.value&&(o=t.value),o}),s=m(()=>{let o=0;return e.item.energyBat>0&&(o=e.xScale(e.item.energyBat)),o>t.value&&(o=t.value),o});return(o,h)=>(l(),f("g",{id:`bar-${e.item.name}`},[n("rect",{class:"bar",y:e.yScale(e.id)+e.itemHeight/2-4,x:"0",rx:"6",ry:"6",height:"12",width:t.value,fill:o.item.color},null,8,Ro),n("rect",{class:"bar",y:e.yScale(e.id)+e.itemHeight/2+10,x:"0",rx:"3",ry:"3",height:"7",width:r.value,fill:"var(--color-pv)","fill-opacity":"100%"},null,8,Jo),n("rect",{class:"bar",y:e.yScale(e.id)+e.itemHeight/2+10,x:r.value,rx:"3",ry:"3",height:"7",width:s.value,fill:"var(--color-battery)","fill-opacity":"100%"},null,8,Yo)],8,Ho))}}),Qo={id:"emBargraph"},Zo=L({__name:"BarGraph",props:{plotdata:{},yscale:{},xscale:{},itemHeight:{}},setup(a){const e=a;return(t,r)=>(l(),f("g",Qo,[(l(!0),f(F,null,te(e.plotdata,(s,o)=>(l(),f("g",{key:o},[v(qo,{id:o.toString(),item:s,"x-scale":e.xscale,"y-scale":e.yscale,"item-height":t.itemHeight},null,8,["id","item","x-scale","y-scale","item-height"])]))),128))]))}}),Xo=["id"],Ko=["y","x","fill"],es=["y","x"],ts=["y","x","font-size"],Ot=24,as=L({__name:"EnergyLabel",props:{id:{},item:{},yscale:{},margin:{},width:{},itemHeight:{},autarchy:{},autText:{}},setup(a){const e=a,t=m(()=>e.yscale(e.id)+e.itemHeight/3);function r(){return e.autarchy?e.autText+": "+e.autarchy.toLocaleString(void 0)+" %":""}function s(o){return o.length>14?o.slice(0,13)+"...":o}return(o,h)=>(l(),f("g",{id:"barlabel-"+e.id},[n("text",{y:t.value,x:e.margin.left,"font-size":Ot,"text-anchor":"start",fill:o.item.color,class:q(o.item.icon.length<=2?"fas":"")},S(s(e.item.icon)),11,Ko),n("text",{y:t.value,x:e.width/2+e.margin.left,"font-size":Ot,"text-anchor":"middle",fill:"var(--color-menu)"},S(i(ct)(o.item.energy,i(g).decimalPlaces,!1)),9,es),n("text",{y:t.value,x:e.width-e.margin.right,"font-size":Ot-2,"text-anchor":"end",fill:"var(--color-pv)"},S(r()),9,ts)],8,Xo))}}),ns={id:"emBarLabels"},rs=L({__name:"EnergyLabels",props:{plotdata:{},yscale:{},width:{},itemHeight:{},margin:{}},setup(a){const e=a;function t(s){if(s.name=="PV"){const o=y.graphMode=="live"||y.graphMode=="today"?Q:T.items,d=(y.graphMode=="live"||y.graphMode=="today"?U:T.items).evuOut.energy,u=o.pv.energy;return Math.round((u-d)/u*100)}else if(s.name=="Netz"){const o=y.graphMode=="live"||y.graphMode=="today"?Q:T.items,h=y.graphMode=="live"||y.graphMode=="today"?U:T.items,d=h.evuOut.energy,u=o.evuIn.energy,p=o.pv.energy,c=o.batOut.energy,k=h.batIn.energy;return p+c-d-k>0?Math.round((p+c-d-k)/(p+c+u-d-k)*100):0}else return s.pvPercentage}function r(s){return s.name=="PV"?"Eigen":"Aut"}return(s,o)=>(l(),f("g",ns,[(l(!0),f(F,null,te(e.plotdata,(h,d)=>(l(),f("g",{key:d},[v(as,{id:d.toString(),item:h,yscale:e.yscale,margin:e.margin,width:e.width,"item-height":s.itemHeight,"aut-text":r(h),autarchy:t(h)},null,8,["id","item","yscale","margin","width","item-height","aut-text","autarchy"])]))),128))]))}});class os{constructor(e){b(this,"id");b(this,"name","Speicher");b(this,"color","var(--color-battery)");b(this,"dailyYieldExport",0);b(this,"dailyYieldImport",0);b(this,"monthlyYieldExport",0);b(this,"monthlyYieldImport",0);b(this,"yearlyYieldExport",0);b(this,"yearlyYieldImport",0);b(this,"exported",0);b(this,"faultState",0);b(this,"faultStr","");b(this,"imported",0);b(this,"power",0);b(this,"soc",0);this.id=e}}class ss{constructor(){b(this,"dailyExport",0);b(this,"dailyImport",0);b(this,"exported",0);b(this,"imported",0);b(this,"power",0);b(this,"soc",0)}}le(new ss);const he=ee(new Map),Aa=a=>{he.value.set(a,new os(a)),he.value.get(a).color=ie["bat"+he.value.size].color};function is(){he.value=new Map}const ls={class:"d-flex justify-content-end"},cs={id:"energymeter",class:"p-0 m-0"},us=["viewBox"],ds=["transform"],hs=["x"],ps={key:0},va=500,At=60,gs=12,ms="Energie",fs=L({__name:"EnergyMeter2",setup(a){const e={top:0,bottom:30,left:0,right:0},t=m(()=>r.value.length*At+e.top+e.bottom),r=m(()=>{let c=Object.values(Q),k=h.value;const P=T.items;let z=[];switch(g.debug&&u(),lt.value==!0&&(lt.value=!1),y.graphMode){default:case"live":case"today":z=d(c).concat(k);break;case"day":case"month":case"year":Object.values(P).length==0?qe.value=!0:(qe.value=!1,z=[P.evuIn,P.pv,P.evuOut,P.batOut,P.charging],Object.values(O).length>1&&Object.keys(O).forEach(D=>{P["cp"+D]&&z.push(P["cp"+D])}),z.push(P.devices),ae.forEach((D,B)=>{D.showInGraph&&P["sh"+B]&&z.push(P["sh"+B])}),z=z.concat([P.batIn,P.house]))}return z.filter(D=>D.energy&&D.energy>0)}),s=m(()=>He().range([0,va-e.left-e.right]).domain([0,Sa(r.value,c=>c.energy)])),o=m(()=>xt().range([e.top,t.value-e.bottom]).domain(r.value.map((c,k)=>k.toString())).padding(.1)),h=m(()=>{const c=Object.values(O).length,k=[...ae.values()].filter(z=>z.configured).length;let P=U;return[...[P.evuOut,P.charging].concat(c>1?Object.values(O).map(z=>z.toPowerItem()):[]),...[P.devices].concat(k>1?[...ae.values()].filter(z=>z.configured&&z.showInGraph):[]).concat([U.batIn,U.house])]});function d(c){let k=0;return we.value.size>1&&we.value.forEach(P=>{c.splice(2+k++,0,{name:P.name,power:P.power,energy:P.energy,energyPv:0,energyBat:0,pvPercentage:0,color:P.color,icon:P.name,showInGraph:!0})}),he.value.size>1&&he.value.forEach(P=>{c.splice(3+k++,0,{name:P.name,power:P.power,energy:P.dailyYieldExport,energyPv:0,energyBat:0,pvPercentage:0,color:P.color,icon:P.name,showInGraph:!0})}),c}function u(){console.debug(["source summary:",Q]),console.debug(["usage details:",h.value]),console.debug(["historic summary:",T])}function p(){g.zoomedWidget=2,g.zoomGraph=!g.zoomGraph}return(c,k)=>(l(),$(_t,{"full-width":!0},{title:_(()=>[H(S(ms))]),buttons:_(()=>[n("div",ls,[v(na,{widgetid:"graphsettings","show-left-button":!0,"show-right-button":!0,"ignore-live":!0,onShiftLeft:i(It),onShiftRight:i(Kt),onShiftUp:i(ea),onShiftDown:i(ta)},null,8,["onShiftLeft","onShiftRight","onShiftUp","onShiftDown"]),i(De)?(l(),f("span",{key:0,type:"button",class:"ms-1 p-0 pt-1",onClick:p},k[0]||(k[0]=[n("span",{class:"fa-solid fa-lg ps-1 fa-magnifying-glass"},null,-1)]))):w("",!0)])]),default:_(()=>[n("figure",cs,[(l(),f("svg",{viewBox:"0 0 500 "+t.value},[n("g",{transform:"translate("+e.left+","+e.top+")"},[v(Zo,{plotdata:r.value,xscale:s.value,yscale:o.value,"item-height":At},null,8,["plotdata","xscale","yscale"]),n("text",{x:-e.left,y:"-15",fill:"var(--color-axis)","font-size":gs},S(i(y).graphMode=="year"?"MWh":"kWh"),9,hs),v(rs,{plotdata:r.value,yscale:o.value,width:va,"item-height":At,margin:e},null,8,["plotdata","yscale"])],8,ds)],8,us))]),i(qe)?(l(),f("p",ps,"No data")):w("",!0)]),_:1}))}}),vs=R(fs,[["__scopeId","data-v-63a4748e"]]),ys={class:"d-flex flex-column align-items-center justify-content-start infoitem"},bs=L({__name:"InfoItem",props:{heading:{},small:{type:Boolean}},setup(a){const e=a,t=m(()=>e.small?{"font-size":"var(--font-small)"}:{"font-size":"var(--font-small)"}),r=m(()=>e.small?{"font-size":"var(--font-small)"}:{"font-size":"var(--font-normal)"}),s=m(()=>e.small?"mt-0":"mt-1");return(o,h)=>(l(),f("span",ys,[n("span",{class:q(["d-flex heading",s.value]),style:K(t.value)},S(e.heading),7),n("span",{class:"d-flex my-0 me-0 align-items-center content",style:K(r.value)},[pe(o.$slots,"default",{},void 0,!0)],4)]))}}),X=R(bs,[["__scopeId","data-v-f6af00e8"]]),_s={class:"d-flex justify-content-between align-items-center titlerow"},ws={class:"buttonrea d-flex float-right justify-content-end align-items-center"},ks={class:"contentrow grid-col-12"},xs=L({__name:"WbSubwidget",props:{titlecolor:{},fullwidth:{type:Boolean},small:{type:Boolean}},setup(a){const e=a,t=m(()=>{let s={"font-weight":"bold",color:"var(--color-fg)","font-size":"var(--font-normal)"};return e.titlecolor&&(s.color=e.titlecolor),e.small&&(s["font-size"]="var(--font-verysmall)"),s}),r=m(()=>e.fullwidth?"grid-col-12":"grid-col-4");return(s,o)=>(l(),f("div",{class:q(["wb-subwidget px-3 pt-2 my-0",r.value])},[n("div",_s,[n("div",{class:"d-flex widgetname p-0 m-0",style:K(t.value)},[pe(s.$slots,"title",{},void 0,!0)],4),n("div",ws,[pe(s.$slots,"buttons",{},void 0,!0)])]),n("div",ks,[pe(s.$slots,"default",{},void 0,!0)])],2))}}),tt=R(xs,[["__scopeId","data-v-e989060d"]]),Ss={class:"grid-col-12 mt-2 mb-0 px-0 py-0 configitem"},Ms={class:"titlecolumn m-0 p-0 d-flex align-items-center"},$s={class:"ms-1 mb-2 p-0 pt-2 d-flex justify-content-stretch align-items-center"},Ps={class:"justify-content-stretch d-flex"},Is=L({__name:"ConfigItem",props:{title:{},infotext:{},icon:{},fullwidth:{type:Boolean}},setup(a){const e=a,t=ee(!1);function r(){t.value=!t.value}const s=m(()=>{let o={color:"var(--color-charging)"};return t.value&&(o.color="var(--color-battery)"),o});return(o,h)=>(l(),$(tt,{fullwidth:!!o.fullwidth},{default:_(()=>[n("div",Ss,[n("div",Ms,[n("span",{class:"d-flex align-items-baseline m-0 p-0",onClick:r},[e.icon?(l(),f("i",{key:0,class:q(["fa-solid fa-sm m-0 p-0 me-2 item-icon",e.icon])},null,2)):w("",!0),H(" "+S(o.title),1)]),n("span",null,[e.infotext?(l(),f("i",{key:0,class:"fa-solid fa-sm fa-circle-question ms-4 me-2",style:K(s.value),onClick:r},null,4)):w("",!0)])]),t.value?(l(),f("p",{key:0,class:"infotext shadow m-0 ps-2 mb-1 p-1",onClick:r},[h[0]||(h[0]=n("i",{class:"me-1 fa-solid fa-sm fa-circle-info"},null,-1)),H(" "+S(o.infotext),1)])):w("",!0),n("div",$s,[n("span",Ps,[pe(o.$slots,"default",{},void 0,!0)])])])]),_:3},8,["fullwidth"]))}}),N=R(Is,[["__scopeId","data-v-b935eb33"]]),Cs={class:"d-flex flex-column"},Bs={class:"d-flex flex-fill justify-content-between align-items-center"},Vs={class:"d-flex flex-fill flex-column justify-content-center m-0 p-0"},Ls={key:0,id:"rangeIndicator",class:"rangeIndicator"},Os={viewBox:"0 0 100 2"},As=["width"],Ts=["x","width"],Es=["x","width"],zs=["id","min","max","step"],Ws={class:"d-flex justify-content-between align-items-center"},Ds={class:"minlabel ps-4"},Gs={class:"valuelabel"},js={class:"maxlabel pe-4"},Us=L({__name:"RangeInput",props:{id:{},min:{},max:{},step:{},unit:{},decimals:{},showSubrange:{type:Boolean},subrangeMin:{},subrangeMax:{},modelValue:{}},emits:["update:modelValue"],setup(a,{emit:e}){const t=a,r=t.decimals??0,s=e,o=m({get(){return Math.round(t.modelValue*Math.pow(10,r))/Math.pow(10,r)},set(k){s("update:modelValue",k)}});function h(){o.value>t.min&&(o.value=Math.round((o.value-t.step)*Math.pow(10,r))/Math.pow(10,r))}function d(){o.valueHe().domain([t.min,t.max]).range([0,100])),p=m(()=>u.value(t.subrangeMin?t.subrangeMin:0)),c=m(()=>t.subrangeMin&&t.subrangeMax?u.value(t.subrangeMax)-u.value(t.subrangeMin):0);return(k,P)=>(l(),f("span",Cs,[n("span",Bs,[n("span",{type:"button",class:"minusButton",onClick:h},P[1]||(P[1]=[n("i",{class:"fa fa-xl fa-minus-square me-2"},null,-1)])),n("div",Vs,[t.showSubrange?(l(),f("figure",Ls,[(l(),f("svg",Os,[n("g",null,[n("rect",{class:"below",x:0,y:"0",width:p.value,height:"2",rx:"1",ry:"1",fill:"var(--color-evu)"},null,8,As),n("rect",{class:"bar",x:p.value,y:"0",width:c.value,height:"2",rx:"1",ry:"1",fill:"var(--color-charging)"},null,8,Ts),n("rect",{class:"above",x:p.value+c.value,y:"0",width:p.value,height:"2",rx:"1",ry:"1",fill:"var(--color-pv)"},null,8,Es)])]))])):w("",!0),vt(n("input",{id:k.id,"onUpdate:modelValue":P[0]||(P[0]=z=>o.value=z),type:"range",class:"form-range flex-fill",min:k.min,max:k.max,step:k.step},null,8,zs),[[Za,o.value,void 0,{number:!0}]])]),n("span",{type:"button",class:"plusButton",onClick:d},P[2]||(P[2]=[n("i",{class:"fa fa-xl fa-plus-square ms-2"},null,-1)]))]),n("span",Ws,[n("span",Ds,S(k.min),1),n("span",Gs,S(o.value)+" "+S(k.unit),1),n("span",js,S(k.max),1)])]))}}),Me=R(Us,[["__scopeId","data-v-267ede95"]]),Fs=["id","value"],Ns=L({__name:"RadioInput",props:{options:{},modelValue:{}},emits:["update:modelValue"],setup(a,{emit:e}){const t=a,r=e,s=m({get(){return t.modelValue},set(d){r("update:modelValue",d)}});function o(d){return t.options[d][2]?{color:t.options[d][2]}:{color:"var(--color-fg)"}}function h(d){let u=d.target;for(;u&&!u.value&&u.parentElement;)u=u.parentElement;u.value&&(s.value=u.value)}return(d,u)=>(l(),f("div",null,[(l(!0),f(F,null,te(d.options,(p,c)=>(l(),f("button",{id:"radio-"+p[1],key:c,class:q(["btn btn-outline-secondary radiobutton me-2 mb-0 px-2",p[1]==s.value?"active":""]),value:p[1],style:K(o(c)),onClick:h},[n("span",{style:K(o(c))},[p[3]?(l(),f("i",{key:0,class:q(["fa-solid",p[3]])},null,2)):w("",!0),H(" "+S(p[0]),1)],4)],14,Fs))),128))]))}}),We=R(Ns,[["__scopeId","data-v-df222cbe"]]),Hs={class:"mt-2"},Rs={key:0},Js=L({__name:"CPConfigInstant",props:{chargepoint:{}},setup(a){const t=ee(a.chargepoint),r=[{name:"keine",id:"none"},{name:"EV-SoC",id:"soc"},{name:"Energiemenge",id:"amount"}],s=m({get(){return t.value.instantMaxEnergy/1e3},set(o){t.value.instantMaxEnergy=o*1e3}});return(o,h)=>(l(),f("div",Hs,[h[4]||(h[4]=n("p",{class:"heading ms-1"},"Sofortladen:",-1)),v(N,{title:"Stromstärke",icon:"fa-bolt",fullwidth:!0},{default:_(()=>[v(Me,{id:"targetCurrent",modelValue:t.value.instantTargetCurrent,"onUpdate:modelValue":h[0]||(h[0]=d=>t.value.instantTargetCurrent=d),min:6,max:32,step:1,unit:"A"},null,8,["modelValue"])]),_:1}),t.value.instantChargeLimitMode!="none"?(l(),f("hr",Rs)):w("",!0),v(N,{title:"Begrenzung",icon:"fa-hand",fullwidth:!0},{default:_(()=>[v(We,{modelValue:t.value.instantChargeLimitMode,"onUpdate:modelValue":h[1]||(h[1]=d=>t.value.instantChargeLimitMode=d),options:r.map(d=>[d.name,d.id])},null,8,["modelValue","options"])]),_:1}),t.value.instantChargeLimitMode=="soc"?(l(),$(N,{key:1,title:"Maximaler SoC",icon:"fa-sliders",fullwidth:!0},{default:_(()=>[v(Me,{id:"maxSoc",modelValue:t.value.instantTargetSoc,"onUpdate:modelValue":h[2]||(h[2]=d=>t.value.instantTargetSoc=d),min:0,max:100,step:1,unit:"%"},null,8,["modelValue"])]),_:1})):w("",!0),t.value.instantChargeLimitMode=="amount"?(l(),$(N,{key:2,title:"Zu ladende Energie",icon:"fa-sliders",fullwidth:!0},{default:_(()=>[v(Me,{id:"maxEnergy",modelValue:s.value,"onUpdate:modelValue":h[3]||(h[3]=d=>s.value=d),min:0,max:100,step:1,unit:"kWh"},null,8,["modelValue"])]),_:1})):w("",!0)]))}}),Ys=R(Js,[["__scopeId","data-v-0303d179"]]),qs={class:"form-check form-switch"},se=L({__name:"SwitchInput",props:{modelValue:{type:Boolean},onColor:{},offColor:{}},emits:["update:modelValue"],setup(a,{emit:e}){const t=a,r=e,s=m({get(){return t.modelValue},set(h){r("update:modelValue",h)}}),o=m(()=>s.value?{"background-color":"green"}:{"background-color":"white"});return(h,d)=>(l(),f("div",qs,[vt(n("input",{"onUpdate:modelValue":d[0]||(d[0]=u=>s.value=u),class:"form-check-input",type:"checkbox",role:"switch",style:K(o.value)},null,4),[[Ma,s.value]])]))}}),Qs={class:"pt-2"},Zs={key:3},Xs=L({__name:"CPConfigPv",props:{chargepoint:{}},setup(a){const t=ee(a.chargepoint),r=m({get(){return t.value.pvMinCurrent>5},set(h){h?t.value.pvMinCurrent=6:t.value.pvMinCurrent=0}}),s=m({get(){return t.value.pvMinSoc>0},set(h){h?t.value.pvMinSoc=50:t.value.pvMinSoc=0}}),o=m({get(){return t.value.pvMaxSoc<=100},set(h){h?t.value.pvMaxSoc=100:t.value.pvMaxSoc=101}});return(h,d)=>(l(),f("div",Qs,[d[8]||(d[8]=n("p",{class:"heading ms-1"},"PV-Laden:",-1)),v(N,{title:"Ladestand begrenzen",icon:"fa-battery-three-quarters",fullwidth:!0},{default:_(()=>[v(se,{id:"limitSoc",modelValue:o.value,"onUpdate:modelValue":d[0]||(d[0]=u=>o.value=u)},null,8,["modelValue"])]),_:1}),o.value?(l(),$(N,{key:0,title:"...auf maximal...",icon:"fa-battery-three-quarters",fullwidth:!0},{default:_(()=>[v(Me,{id:"maxSoc",modelValue:t.value.pvMaxSoc,"onUpdate:modelValue":d[1]||(d[1]=u=>t.value.pvMaxSoc=u),min:0,max:100,step:1,unit:"%"},null,8,["modelValue"])]),_:1})):w("",!0),v(N,{title:"Einspeisegrenze beachten",icon:"fa-hand",fullwidth:!0},{default:_(()=>[v(se,{modelValue:t.value.pvFeedInLimit,"onUpdate:modelValue":d[2]||(d[2]=u=>t.value.pvFeedInLimit=u)},null,8,["modelValue"])]),_:1}),v(N,{title:"Mindest-Ladestand",icon:"fa-battery-half",infotext:i(Te).minsoc,fullwidth:!0},{default:_(()=>[v(se,{modelValue:s.value,"onUpdate:modelValue":d[3]||(d[3]=u=>s.value=u)},null,8,["modelValue"])]),_:1},8,["infotext"]),s.value?(l(),$(N,{key:1,title:"...bis SoC",fullwidth:!0},{info:_(()=>[H(S(i(Te).minsoc),1)]),default:_(()=>[v(Me,{id:"minSoc",modelValue:t.value.pvMinSoc,"onUpdate:modelValue":d[4]||(d[4]=u=>t.value.pvMinSoc=u),min:0,max:100,step:1,unit:"%"},null,8,["modelValue"])]),_:1})):w("",!0),s.value?(l(),$(N,{key:2,title:"...mit Ladestrom",fullwidth:!0},{default:_(()=>[v(Me,{id:"minSocCurrent",modelValue:t.value.pvMinSocCurrent,"onUpdate:modelValue":d[5]||(d[5]=u=>t.value.pvMinSocCurrent=u),min:6,max:32,step:1,unit:"A"},null,8,["modelValue"])]),_:1})):w("",!0),r.value||s.value?(l(),f("hr",Zs)):w("",!0),v(N,{title:"Minimaler Ladestrom",icon:"fa-bolt",infotext:i(Te).minpv,fullwidth:!0},{default:_(()=>[v(se,{modelValue:r.value,"onUpdate:modelValue":d[6]||(d[6]=u=>r.value=u)},null,8,["modelValue"])]),_:1},8,["infotext"]),r.value?(l(),$(N,{key:4,title:"...bei Ladestrom (minimal)",fullwidth:!0},{default:_(()=>[v(Me,{id:"minCurrent",modelValue:t.value.pvMinCurrent,"onUpdate:modelValue":d[7]||(d[7]=u=>t.value.pvMinCurrent=u),min:6,max:32,step:1,unit:"A"},null,8,["modelValue"])]),_:1})):w("",!0)]))}}),Ks=R(Xs,[["__scopeId","data-v-faa69015"]]),ei={class:"table table-borderless"},ti={class:"tablecell"},ai={class:"tablecell"},ni={class:"tablecell"},ri={class:"tablecell"},oi={class:"tablecell left"},si=["href"],ii=L({__name:"CPConfigScheduled",props:{chargeTemplateId:{}},setup(a){const e={daily:"Täglich",once:"Einmal",weekly:"Wöchentlich"},t=a,r=m(()=>{let d=[];return pt[t.chargeTemplateId]&&(d=Object.values(pt[t.chargeTemplateId])),d});function s(d){return r.value[d].time}function o(d){return{color:r.value[d].active?"var(--color-switchGreen)":"var(--color-switchRed)"}}function h(d){return{"font-weight":r.value[d].active?"bold":"regular"}}return(d,u)=>(l(),f(F,null,[u[1]||(u[1]=n("p",{class:"heading ms-1 pt-2"},"Zielladen:",-1)),n("table",ei,[u[0]||(u[0]=n("thead",null,[n("tr",null,[n("th",{class:"tableheader"},"Ziel"),n("th",{class:"tableheader"},"Limit"),n("th",{class:"tableheader"},"Zeit"),n("th",{class:"tableheader"},"Wiederholung"),n("th",{class:"tableheader"})])],-1)),n("tbody",null,[(l(!0),f(F,null,te(r.value,(p,c)=>(l(),f("tr",{key:c,style:K(h(c))},[n("td",ti,S(p.limit.soc_scheduled)+"%",1),n("td",ai,S(p.limit.soc_limit)+"%",1),n("td",ni,S(s(c)),1),n("td",ri,S(e[p.frequency.selected]),1),n("td",oi,[n("a",{href:"../../settings/#/VehicleConfiguration/charge_template/"+t.chargeTemplateId},[n("span",{class:q([p.active?"fa-toggle-on":"fa-toggle-off","fa"]),style:K(o(c)),type:"button"},null,6)],8,si)])],4))),128))])])],64))}}),li=R(ii,[["__scopeId","data-v-e8f5ad9d"]]),ci={class:"table table-borderless"},ui={class:"tablecell"},di={class:"tablecell"},hi={class:"tablecell"},pi={class:"tablecell"},gi={class:"tablecell left"},mi=["href"],fi=L({__name:"CPConfigTimed",props:{chargeTemplateId:{}},setup(a){const e={daily:"Täglich",once:"Einmal",weekly:"Wöchentlich"},t=a,r=m(()=>gt[t.chargeTemplateId]?Object.values(gt[t.chargeTemplateId])??[]:[]);function s(h){return{color:r.value[h].active?"var(--color-switchGreen)":"var(--color-switchRed)"}}function o(h){return{"font-weight":r.value[h].active?"bold":"regular"}}return(h,d)=>(l(),f(F,null,[d[1]||(d[1]=n("p",{class:"heading ms-1 pt-2"},"Zeitpläne:",-1)),n("table",ci,[d[0]||(d[0]=n("thead",null,[n("tr",null,[n("th",{class:"tableheader"},"Von"),n("th",{class:"tableheader"},"Bis"),n("th",{class:"tableheader"},"Ladestrom"),n("th",{class:"tableheader"},"Wiederholung"),n("th",{class:"tableheader right"})])],-1)),n("tbody",null,[(l(!0),f(F,null,te(r.value,(u,p)=>(l(),f("tr",{key:p,style:K(o(p))},[n("td",ui,S(u.time[0]),1),n("td",di,S(u.time[1]),1),n("td",hi,S(u.current)+" A",1),n("td",pi,S(e[u.frequency.selected]),1),n("td",gi,[n("a",{href:"../../settings/#/VehicleConfiguration/charge_template/"+t.chargeTemplateId},[n("span",{class:q([u.active?"fa-toggle-on":"fa-toggle-off","fa"]),style:K(s(p)),type:"button"},null,6)],8,mi)])],4))),128))])])],64))}}),vi=R(fi,[["__scopeId","data-v-192e287b"]]),yi={class:"settingsheader mt-2 ms-1"},bi=L({__name:"CPConfigVehicle",props:{vehicleId:{}},setup(a){const e=a;return(t,r)=>(l(),f(F,null,[n("p",yi," Profile für "+S(i(Y)[e.vehicleId].name)+": ",1),v(N,{title:"Ladeprofil",icon:"fa-sliders",fullwidth:!0},{default:_(()=>[v(We,{modelValue:i(Y)[e.vehicleId].chargeTemplateId,"onUpdate:modelValue":r[0]||(r[0]=s=>i(Y)[e.vehicleId].chargeTemplateId=s),modelModifiers:{number:!0},options:Object.keys(i(_e)).map(s=>[i(_e)[+s].name,s])},null,8,["modelValue","options"])]),_:1}),v(N,{title:"Fahrzeug-Vorlage",icon:"fa-sliders",fullwidth:!0},{default:_(()=>[v(We,{modelValue:i(Y)[e.vehicleId].evTemplateId,"onUpdate:modelValue":r[1]||(r[1]=s=>i(Y)[e.vehicleId].evTemplateId=s),modelModifiers:{number:!0},options:Object.keys(i(Ht)).map(s=>[i(Ht)[+s].name,s])},null,8,["modelValue","options"])]),_:1})],64))}}),_i=R(bi,[["__scopeId","data-v-fcb57a44"]]),wi={class:"settingsheader mt-2 ms-1"},ki=L({__name:"CPChargeConfig",props:{chargepoint:{}},emits:["closeConfig"],setup(a){const t=a.chargepoint;return(r,s)=>(l(),f(F,null,[n("p",wi," Ladeeinstellungen für "+S(i(t).vehicleName)+": ",1),v(N,{title:"Lademodus",icon:"fa-charging-station",infotext:i(Te).chargemode,fullwidth:!0},{default:_(()=>[v(We,{modelValue:i(t).chargeMode,"onUpdate:modelValue":s[0]||(s[0]=o=>i(t).chargeMode=o),options:Object.keys(i(ye)).map(o=>[i(ye)[o].name,o,i(ye)[o].color,i(ye)[o].icon])},null,8,["modelValue","options"])]),_:1},8,["infotext"]),v(N,{title:"Fahrzeug wechseln",icon:"fa-car",infotext:i(Te).vehicle,fullwidth:!0},{default:_(()=>[v(We,{modelValue:i(t).connectedVehicle,"onUpdate:modelValue":s[1]||(s[1]=o=>i(t).connectedVehicle=o),modelModifiers:{number:!0},options:Object.values(i(Y)).filter(o=>o.visible).map(o=>[o.name,o.id])},null,8,["modelValue","options"])]),_:1},8,["infotext"]),v(N,{title:"Sperren",icon:"fa-lock",infotext:i(Te).locked,fullwidth:!0},{default:_(()=>[v(se,{modelValue:i(t).isLocked,"onUpdate:modelValue":s[2]||(s[2]=o=>i(t).isLocked=o)},null,8,["modelValue"])]),_:1},8,["infotext"]),v(N,{title:"Priorität",icon:"fa-star",infotext:i(Te).priority,fullwidth:!0},{default:_(()=>[v(se,{modelValue:i(t).hasPriority,"onUpdate:modelValue":s[3]||(s[3]=o=>i(t).hasPriority=o)},null,8,["modelValue"])]),_:1},8,["infotext"]),v(N,{title:"Zeitplan",icon:"fa-clock",infotext:i(Te).timeplan,fullwidth:!0},{default:_(()=>[v(se,{modelValue:i(t).timedCharging,"onUpdate:modelValue":s[4]||(s[4]=o=>i(t).timedCharging=o)},null,8,["modelValue"])]),_:1},8,["infotext"]),i(de).isBatteryConfigured?(l(),$(N,{key:0,title:"PV-Priorität",icon:"fa-car-battery",infotext:i(Te).pvpriority,fullwidth:!0},{default:_(()=>[v(We,{modelValue:i(de).pvBatteryPriority,"onUpdate:modelValue":s[5]||(s[5]=o=>i(de).pvBatteryPriority=o),options:i(cn)},null,8,["modelValue","options"])]),_:1},8,["infotext"])):w("",!0),i(re).active?(l(),$(N,{key:1,title:"Strompreisbasiert laden",icon:"fa-money-bill",infotext:i(Te).pricebased,fullwidth:!0},{default:_(()=>[v(se,{modelValue:i(t).etActive,"onUpdate:modelValue":s[6]||(s[6]=o=>i(t).etActive=o)},null,8,["modelValue"])]),_:1},8,["infotext"])):w("",!0)],64))}}),xi=R(ki,[["__scopeId","data-v-e348a34c"]]),Si={class:"providername ms-1"},Mi={class:"container"},$i={id:"pricechart",class:"p-0 m-0"},Pi={viewBox:"0 0 400 300"},Ii=["id","origin","transform"],Ci={key:0,class:"p-3"},Bi={key:1,class:"d-flex justify-content-end"},Vi=["disabled"],at=400,ya=250,ba=12,Li=L({__name:"PriceChart",props:{chargepoint:{},globalview:{type:Boolean}},setup(a){const e=a;let t=e.chargepoint?ee(e.chargepoint.etMaxPrice):ee(0);const r=ee(!1),s=ee(e.chargepoint),o=m({get(){return t.value},set(W){t.value=W,r.value=!0}});function h(){s.value&&(O[s.value.id].etMaxPrice=o.value),r.value=!1}const d=ee(!1),u={top:0,bottom:15,left:20,right:5},p=m(()=>{let W=[];return re.etPriceList.size>0&&re.etPriceList.forEach((Z,Oe)=>{W.push([Oe,Z])}),W}),c=m(()=>p.value.length>1?(at-u.left-u.right)/p.value.length-1:0),k=m(()=>r.value?{background:"var(--color-charging)"}:{background:"var(--color-menu)"}),P=m(()=>{let W=Ve(p.value,Z=>Z[0]);return W[1]&&(W[1]=new Date(W[1]),W[1].setTime(W[1].getTime()+36e5)),et().range([u.left,at-u.right]).domain(W)}),z=m(()=>{let W=[0,0];return p.value.length>0?(W=Ve(p.value,Z=>Z[1]),W[0]=Math.floor(W[0]-1),W[1]=Math.floor(W[1]+1)):W=[0,0],W}),D=m(()=>He().range([ya-u.bottom,0]).domain(z.value)),B=m(()=>{const W=Ne(),Z=[[u.left,D.value(o.value)],[at-u.right,D.value(o.value)]];return W(Z)}),A=m(()=>{const W=Ne(),Z=[[u.left,D.value(g.lowerPriceBound)],[at-u.right,D.value(g.lowerPriceBound)]];return W(Z)}),V=m(()=>{const W=Ne(),Z=[[u.left,D.value(g.upperPriceBound)],[at-u.right,D.value(g.upperPriceBound)]];return W(Z)}),J=m(()=>{const W=Ne(),Z=[[u.left,D.value(0)],[at-u.right,D.value(0)]];return W(Z)}),C=m(()=>ht(P.value).ticks(6).tickSize(5).tickFormat(st("%H:%M"))),M=m(()=>ft(D.value).ticks(z.value[1]-z.value[0]).tickSizeInner(-375).tickFormat(W=>W.toString())),E=m(()=>{d.value==!0;const W=ce("g#"+I.value);W.selectAll("*").remove(),W.selectAll("bar").data(p.value).enter().append("g").append("rect").attr("class","bar").attr("x",Qe=>P.value(Qe[0])).attr("y",Qe=>D.value(Qe[1])).attr("width",c.value).attr("height",Qe=>D.value(z.value[0])-D.value(Qe[1])).attr("fill",Qe=>Qe[1]<=o.value?"var(--color-charging)":"var(--color-axis)");const Oe=W.append("g").attr("class","axis").call(C.value);Oe.attr("transform","translate(0,"+(ya-u.bottom)+")"),Oe.selectAll(".tick").attr("font-size",ba).attr("color","var(--color-bg)"),Oe.selectAll(".tick line").attr("stroke","var(--color-fg)").attr("stroke-width","0.5"),Oe.select(".domain").attr("stroke","var(--color-bg");const wt=W.append("g").attr("class","axis").call(M.value);return wt.attr("transform","translate("+u.left+",0)"),wt.selectAll(".tick").attr("font-size",ba).attr("color","var(--color-bg)"),wt.selectAll(".tick line").attr("stroke","var(--color-bg)").attr("stroke-width","0.5"),wt.select(".domain").attr("stroke","var(--color-bg)"),z.value[0]<0&&W.append("path").attr("d",J.value).attr("stroke","var(--color-fg)"),W.append("path").attr("d",A.value).attr("stroke","green"),W.append("path").attr("d",V.value).attr("stroke","red"),W.append("path").attr("d",B.value).attr("stroke","yellow"),"PriceChart.vue"}),I=m(()=>e.chargepoint?"priceChartCanvas"+e.chargepoint.id:"priceChartCanvasGlobal"),x=m(()=>{let W=[];return re.etPriceList.forEach(Z=>{W.push(Z)}),W.sort((Z,Oe)=>Z-Oe)});function G(){let W=x.value[0];for(let Z of x.value){if(Z>=o.value)break;W=Z}o.value=W}function xe(){let W=x.value[0];for(let Z of x.value)if(Z>o.value){W=Z;break}else W=Z;o.value=W}return Le(()=>{d.value=!d.value}),(W,Z)=>(l(),f(F,null,[Z[3]||(Z[3]=n("p",{class:"settingsheader mt-2 ms-1"},"Preisbasiertes Laden:",-1)),n("p",Si,"Anbieter: "+S(i(re).etProvider),1),Z[4]||(Z[4]=n("hr",null,null,-1)),n("div",Mi,[n("figure",$i,[(l(),f("svg",Pi,[n("g",{id:I.value,origin:E.value,transform:"translate("+u.top+","+u.right+")"},null,8,Ii)]))])]),W.chargepoint!=null?(l(),f("div",Ci,[W.chargepoint.etActive?(l(),$(Me,{key:0,id:"pricechart_local",modelValue:o.value,"onUpdate:modelValue":Z[0]||(Z[0]=Oe=>o.value=Oe),min:Math.floor(x.value[0]-1),max:Math.ceil(x.value[x.value.length-1]+1),step:.1,decimals:1,"show-subrange":!0,"subrange-min":x.value[0],"subrange-max":x.value[x.value.length-1],unit:"ct"},null,8,["modelValue","min","max","subrange-min","subrange-max"])):w("",!0)])):w("",!0),n("div",{class:"d-flex justify-content-between px-3 pb-2 pt-0 mt-0"},[n("button",{type:"button",class:"btn btn-sm jumpbutton",onClick:G},Z[1]||(Z[1]=[n("i",{class:"fa fa-sm fa-arrow-left"},null,-1)])),n("button",{type:"button",class:"btn btn-sm jumpbutton",onClick:xe},Z[2]||(Z[2]=[n("i",{class:"fa fa-sm fa-arrow-right"},null,-1)]))]),W.chargepoint!=null?(l(),f("div",Bi,[n("span",{class:"me-3 pt-0",onClick:h},[n("button",{type:"button",class:"btn btn-secondary",style:K(k.value),disabled:!r.value}," Bestätigen ",12,Vi)])])):w("",!0)],64))}}),Ta=R(Li,[["__scopeId","data-v-8d837517"]]),Oi={class:"status-string"},Ai={style:{color:"red"}},Ti={class:"m-0 mt-4 p-0 grid-col-12 tabarea"},Ei={class:"nav nav-tabs nav-justified mx-1 mt-1",role:"tablist"},zi=["data-bs-target"],Wi=["data-bs-target"],Di=["data-bs-target"],Gi=["data-bs-target"],ji=["data-bs-target"],Ui=["data-bs-target"],Fi=["data-bs-target"],Ni={id:"settingsPanes",class:"tab-content mx-1 p-1 pb-3"},Hi=["id"],Ri=["id"],Ji=["id"],Yi=["id"],qi=["id"],Qi=["id"],Zi=["id"],Xi=L({__name:"CPChargeConfigPanel",props:{chargepoint:{}},emits:["closeConfig"],setup(a){const t=a.chargepoint,r=m(()=>_e[t.chargeTemplate]),s=m(()=>t.id);return Le(()=>{}),(o,h)=>(l(),f(F,null,[v(N,{title:"Status",icon:"fa-info-circle",fullwidth:!0,class:"item"},{default:_(()=>[n("span",Oi,S(i(t).stateStr),1)]),_:1}),i(t).faultState!=0?(l(),$(N,{key:0,title:"Fehler",class:"grid-col-12",icon:"fa-triangle-exclamation"},{default:_(()=>[n("span",Ai,S(i(t).faultStr),1)]),_:1})):w("",!0),n("div",Ti,[n("nav",Ei,[n("a",{class:"nav-link active","data-bs-toggle":"tab","data-bs-target":"#chargeSettings"+s.value},h[0]||(h[0]=[n("i",{class:"fa-solid fa-charging-station"},null,-1)]),8,zi),o.chargepoint.chargeMode=="instant_charging"?(l(),f("a",{key:0,class:"nav-link","data-bs-toggle":"tab","data-bs-target":"#instantSettings"+s.value},h[1]||(h[1]=[n("i",{class:"fa-solid fa-lg fa-bolt"},null,-1)]),8,Wi)):w("",!0),o.chargepoint.chargeMode=="pv_charging"?(l(),f("a",{key:1,class:"nav-link","data-bs-toggle":"tab","data-bs-target":"#pvSettings"+s.value},h[2]||(h[2]=[n("i",{class:"fa-solid fa-solar-panel me-1"},null,-1)]),8,Di)):w("",!0),o.chargepoint.chargeMode=="scheduled_charging"?(l(),f("a",{key:2,class:"nav-link","data-bs-toggle":"tab","data-bs-target":"#scheduledSettings"+s.value},h[3]||(h[3]=[n("i",{class:"fa-solid fa-bullseye me-1"},null,-1)]),8,Gi)):w("",!0),o.chargepoint.timedCharging?(l(),f("a",{key:3,class:"nav-link","data-bs-toggle":"tab","data-bs-target":"#timeSettings"+s.value},h[4]||(h[4]=[n("i",{class:"fa-solid fa-clock"},null,-1)]),8,ji)):w("",!0),n("a",{class:"nav-link","data-bs-toggle":"tab","data-bs-target":"#carSettings"+s.value},h[5]||(h[5]=[n("i",{class:"fa-solid fa-rectangle-list"},null,-1)]),8,Ui),i(re).active&&i(t).etActive?(l(),f("a",{key:4,class:"nav-link","data-bs-toggle":"tab","data-bs-target":"#priceChart"+s.value},h[6]||(h[6]=[n("i",{class:"fa-solid fa-chart-line"},null,-1)]),8,Fi)):w("",!0)]),n("div",Ni,[n("div",{id:"chargeSettings"+s.value,class:"tab-pane active",role:"tabpanel","aria-labelledby":"instant-tab"},[v(xi,{chargepoint:o.chargepoint},null,8,["chargepoint"])],8,Hi),n("div",{id:"instantSettings"+s.value,class:"tab-pane",role:"tabpanel","aria-labelledby":"instant-tab"},[v(Ys,{chargepoint:i(t),vehicles:i(Y),"charge-templates":i(_e)},null,8,["chargepoint","vehicles","charge-templates"])],8,Ri),n("div",{id:"pvSettings"+s.value,class:"tab-pane",role:"tabpanel","aria-labelledby":"pv-tab"},[v(Ks,{chargepoint:i(t),vehicles:i(Y),"charge-templates":i(_e)},null,8,["chargepoint","vehicles","charge-templates"])],8,Ji),n("div",{id:"scheduledSettings"+s.value,class:"tab-pane",role:"tabpanel","aria-labelledby":"scheduled-tab"},[r.value!=null?(l(),$(li,{key:0,"charge-template-id":i(t).chargeTemplate},null,8,["charge-template-id"])):w("",!0)],8,Yi),n("div",{id:"timeSettings"+s.value,class:"tab-pane",role:"tabpanel","aria-labelledby":"time-tab"},[r.value!=null?(l(),$(vi,{key:0,"charge-template-id":i(t).chargeTemplate},null,8,["charge-template-id"])):w("",!0)],8,qi),n("div",{id:"carSettings"+s.value,class:"tab-pane",role:"tabpanel","aria-labelledby":"car-tab"},[i(Y)[i(t).connectedVehicle]!=null?(l(),$(_i,{key:0,"vehicle-id":i(t).connectedVehicle},null,8,["vehicle-id"])):w("",!0)],8,Qi),n("div",{id:"priceChart"+s.value,class:"tab-pane",role:"tabpanel","aria-labelledby":"price-tab"},[i(Y)[i(t).connectedVehicle]!=null?(l(),$(Ta,{key:0,chargepoint:i(t)},null,8,["chargepoint"])):w("",!0)],8,Zi)])])],64))}}),Jt=R(Xi,[["__scopeId","data-v-1164316d"]]),Ki={class:"d-flex justify-content-center align-items-center"},el=L({__name:"BatterySymbol",props:{soc:{},color:{}},setup(a){const e=a,t=m(()=>e.soc<=12?"fa-battery-empty":e.soc<38?"fa-battery-quarter":e.soc<62?"fa-battery-half":e.soc<87?"fa-battery-three-quarters":"fa-battery-full"),r=m(()=>({color:e.color??"var(--color-menu)"}));return(s,o)=>(l(),f("span",Ki,[n("i",{class:q(["fa me-1",t.value]),style:K(r.value)},null,6),H(" "+S(Math.round(s.soc)+"%"),1)]))}}),Ct=R(el,[["__scopeId","data-v-a68c844a"]]),Ge=L({__name:"FormatWattH",props:{wattH:{}},setup(a){const e=a,t=m(()=>ct(e.wattH,g.decimalPlaces));return(r,s)=>(l(),f("span",null,S(t.value),1))}}),tl={class:"wb-widget p-0 m-0 shadow widgetWidth"},al={class:"py-4 px-3 d-flex justify-content-between align-items-center titlerow"},nl={class:"d-flex align-items-center widgetname p-0 m-0"},rl={class:"buttonrea d-flex float-right justify-content-end align-items-center"},ol={class:"grid12 pb-3"},sl=L({__name:"WbWidgetFlex",props:{variableWidth:{type:Boolean},fullWidth:{type:Boolean}},setup(a){const e=a,t=m(()=>e.fullWidth?"col-12":e.variableWidth&&g.preferWideBoxes?"col-lg-6":"col-lg-4");return(r,s)=>(l(),f("div",{class:q(["p-2 m-0",t.value])},[n("div",tl,[n("div",al,[n("div",nl,[pe(r.$slots,"title",{},()=>[s[0]||(s[0]=n("div",{class:"p-0"},"(title goes here)",-1))],!0),pe(r.$slots,"subtitle",{},void 0,!0)]),n("div",rl,[pe(r.$slots,"buttons",{},void 0,!0)])]),n("div",ol,[pe(r.$slots,"default",{},void 0,!0)])])],2))}}),je=R(sl,[["__scopeId","data-v-1d5bc1d9"]]),il=L({__name:"WbBadge",props:{color:{},bgcolor:{}},setup(a){const e=a,t=m(()=>({color:e.color??"var(--color-bg)","background-color":e.bgcolor??"var(--color-menu)"}));return(r,s)=>(l(),f("span",{class:"pillWbBadge rounded-pill ms-2 px-2",style:K(t.value)},[pe(r.$slots,"default",{},void 0,!0)],4))}}),Pe=R(il,[["__scopeId","data-v-36112fa3"]]),ll={class:"d-flex justify-content-center align-items-center"},cl={key:0,class:"WbBadge rounded-pill errorWbBadge ms-3"},ul={key:0},dl={key:1,class:"row m-0 mt-0 p-0"},hl={class:"col m-0 p-0"},pl={key:0},gl={class:"row"},ml={class:"col"},fl={class:"carTitleLine d-flex justify-content-between align-items-center"},vl={key:0,class:"me-1 fa-solid fa-xs fa-star ps-1"},yl={key:1,class:"me-1 fa-solid fa-xs fa-coins ps-0"},bl={key:2,class:"me-0 fa-solid fa-xs fa-clock ps-1"},_l={class:"grid12"},wl={style:{color:"var(--color-charging)"}},kl={style:{color:"var(--color-charging)"}},xl={style:{color:"var(--color-charging)"}},Sl={class:"targetCurrent"},Ml={key:5,class:"socEditor rounded mt-2 d-flex flex-column align-items-center grid-col-12 grid-left"},$l={class:"d-flex justify-content-stretch align-items-center"},Pl={key:0,class:"fa-solid fa-sm fas fa-edit ms-2"},Il=["id"],Cl=L({__name:"CPChargePoint",props:{chargepoint:{},fullWidth:{type:Boolean}},setup(a){const e=a,t=ee(e.chargepoint),r=m({get(){return e.chargepoint.chargeMode},set(I){O[e.chargepoint.id].chargeMode=I}}),s=m(()=>(Math.round(e.chargepoint.current*10)/10).toLocaleString(void 0)+" A"),o=m(()=>(Math.round(e.chargepoint.realCurrent*10)/10).toLocaleString(void 0)+" A"),h=m(()=>{const I=e.chargepoint.rangeCharged,x=e.chargepoint.chargedSincePlugged,G=e.chargepoint.dailyYield;return x>0?Math.round(I/x*G).toString()+" "+e.chargepoint.rangeUnit:"0 km"}),d=m(()=>e.chargepoint.isLocked?"Gesperrt":e.chargepoint.isCharging?"Lädt":e.chargepoint.isPluggedIn?"Bereit":"Frei"),u=m(()=>e.chargepoint.isLocked?"var(--color-evu)":e.chargepoint.isCharging?"var(--color-charging)":e.chargepoint.isPluggedIn?"var(--color-battery)":"var(--color-axis)"),p=m(()=>{let I="";return e.chargepoint.isLocked?I="fa-lock":e.chargepoint.isCharging?I=" fa-bolt":e.chargepoint.isPluggedIn&&(I="fa-plug"),"fa "+I}),c=m(()=>{switch(e.chargepoint.chargeMode){case"stop":return{color:"var(--fg)"};default:return{color:ye[e.chargepoint.chargeMode].color}}}),k=m(()=>e.chargepoint.soc),P=m(()=>({color:e.chargepoint.color})),z=m(()=>e.chargepoint.etMaxPrice>=+M.value?{color:"var(--color-charging)"}:{color:"var(--color-menu)"}),D=m(()=>e.chargepoint.soc<20?"var(--color-evu)":e.chargepoint.soc>=80?"var(--color-pv)":"var(--color-battery)"),B=ee(!1),A=ee(!1);function V(){oe("socUpdate",1,e.chargepoint.connectedVehicle),O[e.chargepoint.id].waitingForSoc=!0}function J(){oe("setSoc",C.value,e.chargepoint.connectedVehicle),A.value=!1}const C=m({get(){return e.chargepoint.soc},set(I){O[e.chargepoint.id].soc=I}}),M=m(()=>{const[I]=re.etPriceList.values();return(Math.round(I*10)/10).toFixed(1)}),E=ee(!1);return(I,x)=>(l(),f(F,null,[B.value?w("",!0):(l(),$(_t,{key:0,"variable-width":!0,"full-width":e.fullWidth},{title:_(()=>[n("span",ll,[n("span",{style:K(P.value),onClick:x[0]||(x[0]=G=>B.value=!B.value)},[x[12]||(x[12]=n("span",{class:"fa-solid fa-charging-station"}," ",-1)),H(" "+S(e.chargepoint.name),1)],4),t.value.faultState==2?(l(),f("span",cl,"Fehler")):w("",!0)])]),buttons:_(()=>[n("span",{type:"button",class:"ms-2 ps-1 pt-1",style:K(c.value),onClick:x[1]||(x[1]=G=>B.value=!B.value)},x[13]||(x[13]=[n("span",{class:"fa-solid fa-lg ps-1 fa-ellipsis-vertical"},null,-1)]),4)]),footer:_(()=>[B.value?w("",!0):(l(),f("div",pl,[n("div",gl,[n("div",ml,[n("div",fl,[n("h3",{onClick:x[3]||(x[3]=G=>B.value=!B.value)},[x[14]||(x[14]=n("i",{class:"fa-solid fa-sm fa-car me-2"},null,-1)),H(" "+S(I.chargepoint.vehicleName)+" ",1),I.chargepoint.hasPriority?(l(),f("span",vl)):w("",!0),I.chargepoint.etActive?(l(),f("span",yl)):w("",!0),I.chargepoint.timedCharging?(l(),f("span",bl)):w("",!0)]),I.chargepoint.isSocConfigured?(l(),$(Pe,{key:0,bgcolor:D.value},{default:_(()=>[v(Ct,{soc:k.value??0,color:"var(--color-bg)",class:"me-2"},null,8,["soc"]),I.chargepoint.isSocManual?(l(),f("i",{key:0,class:"fa-solid fa-sm fas fa-edit",style:{color:"var(--color-bg)"},onClick:x[4]||(x[4]=G=>A.value=!A.value)})):w("",!0),I.chargepoint.isSocManual?w("",!0):(l(),f("i",{key:1,type:"button",class:q(["fa-solid fa-sm",I.chargepoint.waitingForSoc?"fa-spinner fa-spin":"fa-sync"]),onClick:V},null,2))]),_:1},8,["bgcolor"])):w("",!0)])])]),n("div",_l,[v(Oa,{id:"chargemode-"+I.chargepoint.name,modelValue:r.value,"onUpdate:modelValue":x[5]||(x[5]=G=>r.value=G),class:"chargemodes mt-3 mb-3",options:Object.keys(i(ye)).map(G=>({text:i(ye)[G].name,value:G,color:i(ye)[G].color,icon:i(ye)[G].icon,active:i(ye)[G].mode==I.chargepoint.chargeMode}))},null,8,["id","modelValue","options"]),e.chargepoint.power>0?(l(),$(X,{key:0,heading:"Leistung:",class:"grid-col-3 grid-left mb-3"},{default:_(()=>[n("span",wl,[v(bt,{watt:e.chargepoint.power},null,8,["watt"])])]),_:1})):w("",!0),e.chargepoint.power>0?(l(),$(X,{key:1,heading:"Strom:",class:"grid-col-3"},{default:_(()=>[n("span",kl,S(o.value),1)]),_:1})):w("",!0),e.chargepoint.power>0?(l(),$(X,{key:2,heading:"Phasen:",class:"grid-col-3"},{default:_(()=>[n("span",xl,S(e.chargepoint.phasesInUse),1)]),_:1})):w("",!0),e.chargepoint.power>0?(l(),$(X,{key:3,heading:"Sollstrom:",class:"grid-col-3 grid-right"},{default:_(()=>[n("span",Sl,S(s.value),1)]),_:1})):w("",!0),v(X,{heading:"letzte Ladung:",class:"grid-col-4 grid-left"},{default:_(()=>[v(Ge,{"watt-h":Math.max(I.chargepoint.chargedSincePlugged,0)},null,8,["watt-h"])]),_:1}),v(X,{heading:"gel. Reichw.:",class:"grid-col-4"},{default:_(()=>[H(S(h.value),1)]),_:1}),I.chargepoint.isSocConfigured?(l(),$(X,{key:4,heading:"Reichweite:",class:"grid-col-4 grid-right"},{default:_(()=>[H(S(i(Y)[e.chargepoint.connectedVehicle]?Math.round(i(Y)[e.chargepoint.connectedVehicle].range):0)+" km ",1)]),_:1})):w("",!0),A.value?(l(),f("div",Ml,[x[15]||(x[15]=n("span",{class:"d-flex m-1 p-0 socEditTitle"},"Ladestand einstellen:",-1)),n("span",$l,[n("span",null,[v(Me,{id:"manualSoc",modelValue:C.value,"onUpdate:modelValue":x[6]||(x[6]=G=>C.value=G),min:0,max:100,step:1,unit:"%"},null,8,["modelValue"])])]),n("span",{type:"button",class:"fa-solid d-flex fa-lg me-2 mb-3 align-self-end fa-circle-check",onClick:J})])):w("",!0),x[17]||(x[17]=n("hr",{class:"divider grid-col-12"},null,-1)),i(re).active?(l(),$(X,{key:6,heading:"Preisladen:",class:"grid-col-4 grid-left"},{default:_(()=>[v(se,{modelValue:t.value.etActive,"onUpdate:modelValue":x[7]||(x[7]=G=>t.value.etActive=G)},null,8,["modelValue"])]),_:1})):w("",!0),i(re).active?(l(),$(X,{key:7,heading:"max. Preis:",class:"grid-col-4"},{default:_(()=>[n("span",{type:"button",onClick:x[8]||(x[8]=G=>E.value=!E.value)},[H(S(e.chargepoint.etActive?(Math.round(e.chargepoint.etMaxPrice*10)/10).toFixed(1)+" ct":"-")+" ",1),e.chargepoint.etActive?(l(),f("i",Pl)):w("",!0)])]),_:1})):w("",!0),i(re).active?(l(),$(X,{key:8,heading:"akt. Preis:",class:"grid-col-4 grid-right"},{default:_(()=>[n("span",{style:K(z.value)},S(M.value)+" ct ",5)]),_:1})):w("",!0),E.value?(l(),f("div",{key:9,id:"priceChartInline"+e.chargepoint.id,class:"d-flex flex-column rounded priceEditor grid-col-12"},[i(Y)[e.chargepoint.connectedVehicle]!=null?(l(),$(Ta,{key:0,chargepoint:e.chargepoint},null,8,["chargepoint"])):w("",!0),n("span",{class:"d-flex ms-2 my-4 pe-3 pt-1 d-flex align-self-end",style:K(c.value),onClick:x[9]||(x[9]=G=>E.value=!1)},x[16]||(x[16]=[n("span",{type:"button",class:"d-flex fa-solid fa-lg ps-1 fa-circle-check"},null,-1)]),4)],8,Il)):w("",!0)])]))]),default:_(()=>[B.value?w("",!0):(l(),f("div",ul,[n("div",{class:"grid12",onClick:x[2]||(x[2]=G=>B.value=!B.value)},[v(X,{heading:"Status:",class:"grid-col-4 grid-left"},{default:_(()=>[n("span",{style:K({color:u.value})},[n("i",{class:q(p.value)},null,2),H(" "+S(d.value),1)],4)]),_:1}),v(X,{heading:"Geladen:",class:"grid-col-4 grid-left"},{default:_(()=>[v(Ge,{"watt-h":I.chargepoint.dailyYield},null,8,["watt-h"])]),_:1})])])),B.value?(l(),f("div",dl,[n("div",hl,[I.chargepoint!=null?(l(),$(Jt,{key:0,chargepoint:I.chargepoint},null,8,["chargepoint"])):w("",!0)])])):w("",!0)]),_:1},8,["full-width"])),B.value?(l(),$(je,{key:1,"full-width":e.fullWidth},{title:_(()=>[n("span",{style:K(P.value),onClick:x[10]||(x[10]=G=>B.value=!B.value)},[x[18]||(x[18]=n("span",{class:"fas fa-gear"}," ",-1)),H(" Einstellungen "+S(e.chargepoint.name),1)],4)]),buttons:_(()=>[n("span",{class:"ms-2 pt-1",style:K(c.value),onClick:x[11]||(x[11]=G=>B.value=!B.value)},x[19]||(x[19]=[n("span",{class:"fa-solid fa-lg ps-1 fa-circle-check"},null,-1)]),4)]),default:_(()=>[I.chargepoint!=null?(l(),$(Jt,{key:0,chargepoint:I.chargepoint},null,8,["chargepoint"])):w("",!0)]),_:1},8,["full-width"])):w("",!0)],64))}}),Bl=R(Cl,[["__scopeId","data-v-3a733de3"]]),Vl=["id"],Ll={class:"modal-dialog modal-lg modal-fullscreen-lg-down"},Ol={class:"modal-content"},Al={class:"modal-header"},Tl={class:"modal-title"},El={class:"modal-body",style:{"background-color":"var(--color-bg)"}},zl=L({__name:"ModalComponent",props:{modalId:{}},setup(a){const e=a;return Le(()=>{}),(t,r)=>(l(),f("div",{id:e.modalId,class:"modal fade"},[n("div",Ll,[n("div",Ol,[n("div",Al,[n("h3",Tl,[pe(t.$slots,"title",{},void 0,!0)]),r[0]||(r[0]=n("button",{type:"button",class:"btn-close buttonTextSize d-flex justify-content-center pt-3 pb-0","data-bs-dismiss":"modal"},[n("i",{class:"fa-solid fa-lg fa-rectangle-xmark m-0 p-0"})],-1))]),n("div",El,[pe(t.$slots,"default",{},void 0,!0),r[1]||(r[1]=n("button",{class:"btn btn-secondary float-end mt-3 ms-1","data-bs-dismiss":"modal"}," Schließen ",-1))])])])],8,Vl))}}),Ea=R(zl,[["__scopeId","data-v-eaefae30"]]),Wl={class:"d-flex align-items-center"},Dl={class:"cpname"},Gl={class:"d-flex float-right justify-content-end align-items-center"},jl=["data-bs-target"],Ul=["data-bs-target"],Fl={class:"subgrid"},Nl={key:0,class:"d-flex justify-content-center align-items-center vehiclestatus"},Hl={class:"d-flex flex-column align-items-center px-0"},Rl={class:"d-flex justify-content-center flex-wrap"},Jl={class:"d-flex align-items-center"},Yl={class:"badge phasesInUse rounded-pill"},ql={class:"d-flex flex-wrap justify-content-center chargeinfo"},Ql={class:"me-1"},Zl={key:0,class:"subgrid socEditRow m-0 p-0"},Xl={class:"socEditor rounded mt-2 d-flex flex-column align-items-center grid-col-12"},Kl={class:"d-flex justify-content-stretch align-items-center"},ec=L({__name:"CpsListItem2",props:{chargepoint:{}},setup(a){const e=a,t=ee(!1),r=m(()=>ye[e.chargepoint.chargeMode].icon),s=m(()=>{let V="";return e.chargepoint.isLocked?V="fa-lock":e.chargepoint.isCharging?V=" fa-bolt":e.chargepoint.isPluggedIn&&(V="fa-plug"),"fa "+V}),o=m(()=>{let V="var(--color-axis)";return e.chargepoint.isLocked?V="var(--color-evu)":e.chargepoint.isCharging?V="var(--color-charging)":e.chargepoint.isPluggedIn&&(V="var(--color-battery)"),{color:V,border:`0.5px solid ${V} `}}),h=m(()=>{switch(e.chargepoint.chargeMode){case"stop":return{"background-color":"var(--fg)"};default:return{"background-color":ye[e.chargepoint.chargeMode].color}}}),d=m(()=>$e(e.chargepoint.power,g.decimalPlaces)),u=m(()=>e.chargepoint.current+" A"),p=m(()=>e.chargepoint.phasesInUse),c=m(()=>e.chargepoint.dailyYield>0?ct(e.chargepoint.dailyYield,g.decimalPlaces):"0 Wh"),k=m(()=>"("+Math.round(e.chargepoint.rangeCharged).toString()+" "+e.chargepoint.rangeUnit+")"),P=m(()=>ye[e.chargepoint.chargeMode].name);function z(){oe("socUpdate",1,e.chargepoint.connectedVehicle),O[e.chargepoint.id].waitingForSoc=!0}function D(){oe("setSoc",B.value,e.chargepoint.connectedVehicle),t.value=!1}const B=m({get(){return e.chargepoint.soc},set(V){O[e.chargepoint.id].soc=V}}),A=m(()=>e.chargepoint.isLocked?"Gesperrt":e.chargepoint.isCharging?"Lädt":e.chargepoint.isPluggedIn?"Bereit":"Frei");return(V,J)=>(l(),f(F,null,[v(tt,{titlecolor:V.chargepoint.color,fullwidth:!0,small:!0},{title:_(()=>[n("div",Wl,[n("span",Dl,S(V.chargepoint.name),1),n("span",{class:"badge rounded-pill statusbadge mx-2",style:K(o.value)},[n("i",{class:q([s.value,"me-1"])},null,2),H(" "+S(A.value),1)],4)])]),buttons:_(()=>[n("div",Gl,[n("span",{class:"badge rounded-pill modebadge mx-2",type:"button",style:K(h.value),"data-bs-toggle":"modal","data-bs-target":"#cpsconfig-"+V.chargepoint.id},[n("i",{class:q(["fa me-1",r.value])},null,2),H(" "+S(P.value),1)],12,jl),n("span",{class:"fa-solid ms-2 fa-lg fa-edit ps-1",type:"button","data-bs-toggle":"modal","data-bs-target":"#cpsconfig-"+V.chargepoint.id},null,8,Ul)])]),default:_(()=>[n("div",Fl,[v(X,{heading:V.chargepoint.vehicleName,small:!0,class:"grid-left grid-col-4"},{default:_(()=>[V.chargepoint.isSocConfigured?(l(),f("span",Nl,[V.chargepoint.soc?(l(),$(Ct,{key:0,class:"me-1",soc:V.chargepoint.soc},null,8,["soc"])):w("",!0),V.chargepoint.isSocConfigured&&V.chargepoint.isSocManual?(l(),f("i",{key:1,type:"button",class:"fa-solid fa-sm fas fa-edit",style:{color:"var(--color-menu)"},onClick:J[0]||(J[0]=C=>t.value=!t.value)})):w("",!0),V.chargepoint.isSocConfigured&&!V.chargepoint.isSocManual?(l(),f("i",{key:2,type:"button",class:q(["fa-solid fa-sm me-2",V.chargepoint.waitingForSoc?"fa-spinner fa-spin":"fa-sync"]),style:{color:"var(--color-menu)"},onClick:z},null,2)):w("",!0)])):w("",!0)]),_:1},8,["heading"]),v(X,{heading:"Parameter:",small:!0,class:"grid-col-4"},{default:_(()=>[n("div",Hl,[n("span",Rl,[n("span",null,S(d.value),1),n("span",Jl,[n("span",Yl,S(p.value),1),n("span",null,S(u.value),1)])])])]),_:1}),v(X,{heading:"Geladen:",small:!0,class:"grid-right grid-col-4"},{default:_(()=>[n("div",ql,[n("span",Ql,S(c.value),1),n("span",null,S(k.value),1)])]),_:1})]),t.value?(l(),f("div",Zl,[n("div",Xl,[J[2]||(J[2]=n("span",{class:"d-flex m-1 p-0 socEditTitle"},"Ladestand einstellen:",-1)),n("span",Kl,[n("span",null,[v(Me,{id:"manualSoc",modelValue:B.value,"onUpdate:modelValue":J[1]||(J[1]=C=>B.value=C),min:0,max:100,step:1,unit:"%"},null,8,["modelValue"])])]),n("span",{type:"button",class:"fa-solid d-flex fa-lg me-2 mb-3 align-self-end fa-circle-check",onClick:D})])])):w("",!0)]),_:1},8,["titlecolor"]),(l(),$(Xa,{to:"body"},[(l(),$(Ea,{key:V.chargepoint.id,"modal-id":"cpsconfig-"+V.chargepoint.id},{title:_(()=>[H(" Konfiguration: "+S(V.chargepoint.name),1)]),default:_(()=>[V.chargepoint!=null?(l(),$(Jt,{key:0,chargepoint:V.chargepoint},null,8,["chargepoint"])):w("",!0)]),_:1},8,["modal-id"]))]))],64))}}),tc=R(ec,[["__scopeId","data-v-25e4aa5d"]]),ac=L({__name:"CpSimpleList2",setup(a){const e=m(()=>Object.values(O));return(t,r)=>(l(),$(je,{"variable-width":!0},{title:_(()=>r[0]||(r[0]=[n("span",{class:"fa-solid fa-charging-station"}," ",-1),H(" Ladepunkte ")])),buttons:_(()=>[i(re).active?(l(),$(Pe,{key:0,bgcolor:"var(--color-menu)"},{default:_(()=>[H("Strompreis: "+S(i(re).etCurrentPriceString),1)]),_:1})):w("",!0)]),default:_(()=>[(l(!0),f(F,null,te(e.value,(s,o)=>(l(),f("div",{key:o,class:"subgrid pb-2"},[v(tc,{chargepoint:s},null,8,["chargepoint"])]))),128))]),_:1}))}}),nc=R(ac,[["__scopeId","data-v-b8c6b557"]]),Tt=L({__name:"ChargePointList",props:{id:{},compact:{type:Boolean}},setup(a){let e,t;const r=a,s=m(()=>{let p=Object.values(O);return u(),p}),o=m(()=>h.value+" "+d.value),h=m(()=>{switch(Object.values(O).length){case 0:return g.preferWideBoxes?"col-lg-6":"col-lg-4";case 1:return g.preferWideBoxes?"col-lg-6":"col-lg-4";case 2:return g.preferWideBoxes?"col-lg-12":"col-lg-8 ";default:return"col-lg-12"}}),d=m(()=>"swiper-chargepoints-"+r.id);function u(){let p=document.querySelector("."+d.value);if(p&&(t=p,e=t.swiper),e){let c="1";if(De.value)switch(Object.values(O).length){case 0:case 1:c="1";break;case 2:c="2";break;default:c="3"}t.setAttribute("slides-per-view",c),e.update()}}return Le(()=>{let p=document.querySelector("."+d.value);p&&(t=p,e=t.swiper),window.addEventListener("resize",u),window.document.addEventListener("visibilitychange",u)}),(p,c)=>(l(),f(F,null,[r.compact?w("",!0):(l(),f("swiper-container",{key:0,"space-between":0,"slides-per-view":1,pagination:{clickable:!0},class:q(["cplist m-0 p-0 d-flex align-items-stretch",o.value])},[(l(!0),f(F,null,te(s.value,k=>(l(),f("swiper-slide",{key:k.id},[n("div",{class:q([i(De)?"mb-0":"mb-5","d-flex align-items-stretch flex-fill"])},[v(Bl,{chargepoint:k,"full-width":!0},null,8,["chargepoint"])],2)]))),128))],2)),r.compact?(l(),$(nc,{key:1})):w("",!0)],64))}}),rc={class:"container-fluid p-0 m-0"},oc={class:"row p-0 m-0"},sc={class:"d-grid gap-2"},ic=["onClick"],lc={class:"col-md-4 p-1"},cc={class:"d-grid gap-2"},uc={key:0},dc={class:"row justify-content-center m-1 p-0"},hc={class:"col-lg-4 p-1 m-0"},pc={class:"d-grid gap-2"},gc={class:"col-lg-4 p-1 m-0"},mc={class:"d-grid gap-2"},fc={class:"col-lg-4 p-1 m-0"},vc={class:"d-grid gap-2"},yc=L({__name:"BBSelect",props:{cpId:{}},setup(a){const e=a,t=[{mode:"instant_charging",name:"Sofort",color:"var(--color-charging)"},{mode:"pv_charging",name:"PV",color:"var(--color-pv)"},{mode:"scheduled_charging",name:"Zielladen",color:"var(--color-battery)"},{mode:"standby",name:"Standby",color:"var(--color-axis)"},{mode:"stop",name:"Stop",color:"var(--color-axis)"}],r=m(()=>O[e.cpId]);function s(p){return p==r.value.chargeMode?"btn btn-success buttonTextSize":"btn btn-secondary buttonTextSize"}function o(p){return de.pvBatteryPriority==p?"btn-success":"btn-secondary"}function h(p){r.value.chargeMode=p}function d(p){r.value.isLocked=p}function u(p){de.pvBatteryPriority=p}return(p,c)=>(l(),f("div",rc,[n("div",oc,[(l(),f(F,null,te(t,(k,P)=>n("div",{key:P,class:"col-md-4 p-1"},[n("div",sc,[n("button",{type:"button",class:q(s(k.mode)),style:{},onClick:z=>h(k.mode)},S(k.name),11,ic)])])),64)),n("div",lc,[n("div",cc,[r.value.isLocked?(l(),f("button",{key:0,type:"button",class:"btn btn-outline-success buttonTextSize","data-bs-dismiss":"modal",onClick:c[0]||(c[0]=k=>d(!1))}," Entsperren ")):w("",!0),r.value.isLocked?w("",!0):(l(),f("button",{key:1,type:"button",class:"btn btn-outline-danger buttonTextSize","data-bs-dismiss":"modal",onClick:c[1]||(c[1]=k=>d(!0))}," Sperren "))])])]),i(de).isBatteryConfigured?(l(),f("div",uc,[c[8]||(c[8]=n("hr",null,null,-1)),c[9]||(c[9]=n("div",{class:"row"},[n("div",{class:"col text-center"},"Vorrang im Lademodus PV-Laden:")],-1)),n("div",dc,[n("div",hc,[n("div",pc,[n("button",{id:"evPriorityBtn",type:"button",class:q(["priorityModeBtn btn btn-secondary buttonTextSize",o("ev_mode")]),"data-dismiss":"modal",priority:"1",onClick:c[2]||(c[2]=k=>u("ev_mode"))},c[5]||(c[5]=[H(" EV "),n("span",{class:"fas fa-car ms-2"}," ",-1)]),2)])]),n("div",gc,[n("div",mc,[n("button",{id:"batteryPriorityBtn",type:"button",class:q(["priorityModeBtn btn btn-secondary buttonTextSize",o("bat_mode")]),"data-dismiss":"modal",priority:"0",onClick:c[3]||(c[3]=k=>u("bat_mode"))},c[6]||(c[6]=[H(" Speicher "),n("span",{class:"fas fa-car-battery ms-2"}," ",-1)]),2)])]),n("div",fc,[n("div",vc,[n("button",{id:"minsocPriorityBtn",type:"button",class:q(["priorityModeBtn btn btn-secondary buttonTextSize",o("min_soc_bat_mode")]),"data-dismiss":"modal",priority:"0",onClick:c[4]||(c[4]=k=>u("min_soc_bat_mode"))},c[7]||(c[7]=[H(" MinSoc "),n("span",{class:"fas fa-battery-half"}," ",-1)]),2)])])])])):w("",!0)]))}}),bc={class:"col-lg-4 p-0 m-0 mt-1"},_c={class:"d-grid gap-2"},wc=["data-bs-target"],kc={class:"m-0 p-0 d-flex justify-content-between align-items-center"},xc={class:"mx-1 badge rounded-pill smallTextSize plugIndicator"},Sc={key:0,class:"ms-2"},Mc={class:"m-0 p-0"},$c={key:0,class:"ps-1"},Pc=L({__name:"BbChargeButton",props:{chargepoint:{}},setup(a){const e=a,t="chargeSelectModal"+e.chargepoint.id,r=m(()=>ye[e.chargepoint.chargeMode].name),s=m(()=>{let c={background:"var(--color-menu)"};return e.chargepoint.isLocked?c.background="var(--color-evu)":e.chargepoint.isCharging?c.background="var(--color-charging)":e.chargepoint.isPluggedIn&&(c.background="var(--color-battery)"),c}),o=m(()=>{{let c={background:ye[e.chargepoint.chargeMode].color,color:"white"};switch(e.chargepoint.chargeMode){case ve.instant_charging:e.chargepoint.isCharging&&!e.chargepoint.isLocked&&(c=p(c));break;case ve.standby:case ve.stop:c.background="darkgrey",c.color="black";break;case ve.scheduled_charging:e.chargepoint.isPluggedIn&&!e.chargepoint.isCharging&&!e.chargepoint.isLocked&&(c=p(c));break}return c}}),h=m(()=>ye[e.chargepoint.chargeMode].icon),d=m(()=>{switch(de.pvBatteryPriority){case"ev_mode":return"fa-car";case"bat_mode":return"fa-car-battery";case"min_soc_bat_mode":return"fa-battery-half";default:return console.log("default"),""}}),u=m(()=>{let c="fa-ellipsis";return e.chargepoint.isLocked?c="fa-lock":e.chargepoint.isCharging?c=" fa-bolt":e.chargepoint.isPluggedIn&&(c="fa-plug"),"fa "+c});function p(c){let k=c.color;return c.color=c.background,c.background=k,c}return(c,k)=>(l(),f("div",bc,[n("div",_c,[n("button",{type:"button",class:"btn mx-1 mb-0 p-1 mediumTextSize chargeButton shadow",style:K(s.value),"data-bs-toggle":"modal","data-bs-target":"#"+t},[n("div",kc,[n("span",xc,[n("i",{class:q(u.value)},null,2),c.chargepoint.isCharging?(l(),f("span",Sc,S(i($e)(c.chargepoint.power)),1)):w("",!0)]),n("span",Mc,S(c.chargepoint.name),1),n("span",{class:"mx-2 m-0 badge rounded-pill smallTextSize modeIndicator",style:K(o.value)},[n("i",{class:q(["fa me-1",h.value])},null,2),H(" "+S(r.value)+" ",1),c.chargepoint.chargeMode==i(ve).pv_charging&&i(de).isBatteryConfigured?(l(),f("span",$c,[k[0]||(k[0]=H(" ( ")),n("i",{class:q(["fa m-0",d.value])},null,2),k[1]||(k[1]=H(") "))])):w("",!0)],4)])],12,wc)]),v(Ea,{"modal-id":t},{title:_(()=>[H(" Lademodus für "+S(c.chargepoint.vehicleName),1)]),default:_(()=>[v(yc,{"cp-id":c.chargepoint.id},null,8,["cp-id"])]),_:1})]))}}),Ic=R(Pc,[["__scopeId","data-v-31df6764"]]),Cc={class:"row p-0 mt-0 mb-1 m-0"},Bc={class:"col p-0 m-0"},Vc={class:"container-fluid p-0 m-0"},Lc={class:"row p-0 m-0 d-flex justify-content-center align-items-center"},Oc={key:0,class:"col time-display"},Ac=L({__name:"ButtonBar",setup(a){return(e,t)=>(l(),f("div",Cc,[n("div",Bc,[n("div",Vc,[n("div",Lc,[i(g).showClock=="buttonbar"?(l(),f("span",Oc,S(i(La)(i(Rt))),1)):w("",!0),(l(!0),f(F,null,te(i(O),(r,s)=>(l(),$(Ic,{key:s,chargepoint:r,"charge-point-count":Object.values(i(O)).length},null,8,["chargepoint","charge-point-count"]))),128))])])])]))}}),Tc=R(Ac,[["__scopeId","data-v-791e4be0"]]),Ec={class:"battery-title"},zc={class:"subgrid pt-1"},Wc=L({__name:"BLBattery",props:{bat:{}},setup(a){const e=a,t=m(()=>e.bat.power<0?`Liefert (${$e(-e.bat.power)})`:e.bat.power>0?`Lädt (${$e(e.bat.power)})`:"Bereit"),r=m(()=>e.bat.power<0?"var(--color-pv)":e.bat.power>0?"var(--color-battery)":"var(--color-menu)");return(s,o)=>(l(),$(tt,{titlecolor:"var(--color-title)",fullwidth:!0},{title:_(()=>[n("span",Ec,S(s.bat.name),1)]),buttons:_(()=>[v(Pe,{bgcolor:r.value},{default:_(()=>[H(S(t.value),1)]),_:1},8,["bgcolor"])]),default:_(()=>[n("div",zc,[v(X,{heading:"Ladestand:",small:!0,class:"grid-left grid-col-4"},{default:_(()=>[v(Ct,{soc:e.bat.soc},null,8,["soc"])]),_:1}),v(X,{heading:"Geladen:",small:!0,class:"grid-col-4"},{default:_(()=>[v(Ge,{"watt-h":e.bat.dailyYieldImport},null,8,["watt-h"])]),_:1}),v(X,{heading:"Geliefert:",small:!0,class:"grid-right grid-col-4"},{default:_(()=>[v(Ge,{"watt-h":e.bat.dailyYieldExport},null,8,["watt-h"])]),_:1})])]),_:1}))}}),Dc=R(Wc,[["__scopeId","data-v-f7f825f7"]]),Gc={class:"px-3 subgrid grid-12"},jc=L({__name:"BatteryList",setup(a){const e=m(()=>Q.batOut.power>0?`Liefert (${$e(Q.batOut.power)})`:U.batIn.power>0?`Lädt (${$e(U.batIn.power)})`:"Bereit:"),t=m(()=>Q.batOut.power>0?"var(--color-pv)":U.batIn.power>0?"var(--color-battery)":"var(--color-menu)"),r=m(()=>{let s=0;return he.value.forEach(o=>{s+=o.dailyYieldImport}),s});return(s,o)=>i(de).isBatteryConfigured?(l(),$(je,{key:0,"variable-width":!0,"full-width":!1},{title:_(()=>o[0]||(o[0]=[n("span",{class:"fas fa-car-battery me-2",style:{color:"var(--color-battery)"}}," ",-1),n("span",null,"Speicher",-1)])),buttons:_(()=>[v(Pe,{bgcolor:t.value},{default:_(()=>[H(S(e.value),1)]),_:1},8,["bgcolor"])]),default:_(()=>[n("div",Gc,[v(X,{heading:"Ladestand:",class:"grid-left grid-col-4"},{default:_(()=>[v(Ct,{color:"var(--color-battery)",soc:i(de).batterySoc},null,8,["soc"])]),_:1}),v(X,{heading:"Geladen:",class:"grid-col-4"},{default:_(()=>[n("span",null,S(i(ct)(r.value)),1)]),_:1}),v(X,{heading:"Geliefert",class:"grid-right grid-col-4"},{default:_(()=>[n("span",null,S(i(ct)(i(Q).batOut.energy)),1)]),_:1})]),(l(!0),f(F,null,te(i(he),([h,d])=>(l(),$(Dc,{key:h,bat:d},null,8,["bat"]))),128))]),_:1})):w("",!0)}}),Et=R(jc,[["__scopeId","data-v-cc4da23c"]]),Uc={class:"devicename"},Fc={class:"subgrid"},Nc=L({__name:"SHListItem",props:{device:{}},setup(a){const e=a,t=m(()=>e.device.status=="on"?"fa-toggle-on fa-xl":e.device.status=="waiting"?"fa-spinner fa-spin":"fa-toggle-off fa-xl"),r=m(()=>{let d="var(--color-switchRed)";switch(e.device.status){case"on":d="var(--color-switchGreen)";break;case"detection":d="var(--color-switchBlue)";break;case"timeout":d="var(--color-switchWhite)";break;case"waiting":d="var(--color-menu)";break;default:d="var(--color-switchRed)"}return{color:d}});function s(){e.device.isAutomatic||(e.device.status=="on"?oe("shSwitchOn",0,e.device.id):oe("shSwitchOn",1,e.device.id),ae.get(e.device.id).status="waiting")}function o(){e.device.isAutomatic?oe("shSetManual",1,e.device.id):oe("shSetManual",0,e.device.id)}const h=m(()=>e.device.isAutomatic?"Auto":"Man");return(d,u)=>(l(),$(tt,{titlecolor:d.device.color,fullwidth:!0},{title:_(()=>[n("span",Uc,S(d.device.name),1)]),buttons:_(()=>[(l(!0),f(F,null,te(d.device.temp,(p,c)=>(l(),f("span",{key:c},[p<300?(l(),$(Pe,{key:0,bgcolor:"var(--color-battery)"},{default:_(()=>[n("span",null,S(i(Nn)(p)),1)]),_:2},1024)):w("",!0)]))),128)),e.device.canSwitch?(l(),f("span",{key:0,class:q([t.value,"fa-solid statusbutton mr-2 ms-2"]),style:K(r.value),onClick:s},null,6)):w("",!0),e.device.canSwitch?(l(),$(Pe,{key:1,type:"button",onClick:o},{default:_(()=>[H(S(h.value),1)]),_:1})):w("",!0)]),default:_(()=>[n("div",Fc,[v(X,{heading:"Leistung:",small:!0,class:"grid-col-4 grid-left"},{default:_(()=>[v(bt,{watt:d.device.power},null,8,["watt"])]),_:1}),v(X,{heading:"Energie:",small:!0,class:"grid-col-4"},{default:_(()=>[v(Ge,{"watt-h":d.device.energy},null,8,["watt-h"])]),_:1}),v(X,{heading:"Laufzeit:",small:!0,class:"grid-col-4 grid-right"},{default:_(()=>[H(S(i(Un)(d.device.runningTime)),1)]),_:1})])]),_:1},8,["titlecolor"]))}}),Hc=R(Nc,[["__scopeId","data-v-20651ac6"]]),Rc={class:"sh-title py-4"},Jc=["id","onUpdate:modelValue","value"],Yc=["for"],qc=3,Qc=L({__name:"SmartHomeList",setup(a){const e=m(()=>De.value?t.value.reduce((h,d)=>{const u=h;let p=h[h.length-1];return p.length>=qc?h.push([d]):p.push(d),u},[[]]):[t.value]),t=m(()=>[...ae.values()].filter(h=>h.configured));function r(h){return"Geräte"+(De.value&&e.value.length>1?"("+(h+1)+")":"")}function s(){o.value=!o.value}const o=ee(!1);return(h,d)=>(l(),f(F,null,[(l(!0),f(F,null,te(e.value,(u,p)=>(l(),$(je,{key:p,"variable-width":!0},{title:_(()=>[n("span",{onClick:s},[d[0]||(d[0]=n("span",{class:"fas fa-plug me-2",style:{color:"var(--color-devices)"}}," ",-1)),n("span",Rc,S(r(p)),1)])]),buttons:_(()=>[n("span",{class:"ms-2 pt-1",onClick:s},d[1]||(d[1]=[n("span",{class:"fa-solid fa-lg ps-1 fa-ellipsis-vertical"},null,-1)]))]),default:_(()=>[(l(!0),f(F,null,te(u,c=>(l(),$(Hc,{key:c.id,device:c,class:"subgrid pb-2"},null,8,["device"]))),128))]),_:2},1024))),128)),o.value?(l(),$(je,{key:0},{title:_(()=>[n("span",{class:"smarthome",onClick:s},d[2]||(d[2]=[n("span",{class:"fas fa-gear"}," ",-1),H(" Einstellungen")]))]),buttons:_(()=>[n("span",{class:"ms-2 pt-1",onClick:s},d[3]||(d[3]=[n("span",{class:"fa-solid fa-lg ps-1 fa-circle-check"},null,-1)]))]),default:_(()=>[v(N,{title:"Im Energie-Graph anzeigen:",icon:"fa-chart-column",fullwidth:!0},{default:_(()=>[(l(!0),f(F,null,te(t.value,(u,p)=>(l(),f("div",{key:p},[vt(n("input",{id:"check"+p,"onUpdate:modelValue":c=>u.showInGraph=c,class:"form-check-input",type:"checkbox",value:u},null,8,Jc),[[Ma,u.showInGraph]]),n("label",{class:"form-check-label px-2",for:"check"+p},S(u.name),9,Yc)]))),128))]),_:1}),n("div",{class:"row p-0 m-0",onClick:s},d[4]||(d[4]=[n("div",{class:"col-12 mb-3 pe-3 mt-0"},[n("button",{class:"btn btn-sm btn-secondary float-end"},"Schließen")],-1)]))]),_:1})):w("",!0)],64))}}),zt=R(Qc,[["__scopeId","data-v-5b5cf6b3"]]),Zc={class:"countername"},Xc={class:"subgrid pt-1"},Kc=L({__name:"ClCounter",props:{counter:{}},setup(a){const e=a,t=m(()=>e.counter.power>0?"Bezug":"Export"),r=m(()=>e.counter.power>0?"var(--color-evu)":"var(--color-pv)");return(s,o)=>(l(),$(tt,{titlecolor:"var(--color-title)",fullwidth:!0},{title:_(()=>[n("span",Zc,S(s.counter.name),1)]),buttons:_(()=>[e.counter.power!=0?(l(),$(Pe,{key:0,bgcolor:r.value},{default:_(()=>[H(S(t.value),1)]),_:1},8,["bgcolor"])):w("",!0),v(Pe,{color:"var(--color-bg)"},{default:_(()=>[H(" ID: "+S(e.counter.id),1)]),_:1})]),default:_(()=>[n("div",Xc,[v(X,{heading:"Leistung:",small:!0,class:"grid-left grid-col-4"},{default:_(()=>[v(bt,{watt:Math.abs(e.counter.power)},null,8,["watt"])]),_:1}),v(X,{heading:"Bezogen:",small:!0,class:"grid-col-4"},{default:_(()=>[v(Ge,{"watt-h":e.counter.energy_imported},null,8,["watt-h"])]),_:1}),v(X,{heading:"Exportiert:",small:!0,class:"grid-right grid-col-4"},{default:_(()=>[v(Ge,{"watt-h":e.counter.energy_exported},null,8,["watt-h"])]),_:1})])]),_:1}))}}),eu=R(Kc,[["__scopeId","data-v-01dd8c4d"]]);class tu{constructor(e){b(this,"id");b(this,"name","Zähler");b(this,"power",0);b(this,"energy_imported",0);b(this,"energy_exported",0);b(this,"grid",!1);b(this,"type","counter");b(this,"color","var(--color-evu)");b(this,"energyPv",0);b(this,"energyBat",0);b(this,"pvPercentage",0);b(this,"icon","");this.id=e}}const ke=le({});function au(a,e){if(a in ke)console.info("Duplicate counter message: "+a);else switch(ke[a]=new tu(a),ke[a].type=e,e){case"counter":ke[a].color="var(--color-evu)";break;case"inverter":ke[a].color="var(--color-pv)";break;case"cp":ke[a].color="var(--color-charging)";break;case"bat":ke[a].color="var(--color-bat)";break}}const nu=L({__name:"CounterList",setup(a){return(e,t)=>(l(),$(je,{"variable-width":!0},{title:_(()=>t[0]||(t[0]=[n("span",{class:"fas fa-bolt me-2",style:{color:"var(--color-evu)"}}," ",-1),n("span",null,"Zähler",-1)])),default:_(()=>[(l(!0),f(F,null,te(i(ke),(r,s)=>(l(),f("div",{key:s,class:"subgrid pb-2"},[v(eu,{counter:r},null,8,["counter"])]))),128))]),_:1}))}}),Wt=R(nu,[["__scopeId","data-v-5f059284"]]),ru={class:"vehiclename"},ou={class:"subgrid"},su=L({__name:"VlVehicle",props:{vehicle:{}},setup(a){const e=a,t=m(()=>{let s="Unterwegs",o=e.vehicle.chargepoint;return o!=null&&(o.isCharging?s="Lädt ("+o.name+")":o.isPluggedIn&&(s="Bereit ("+o.name+")")),s}),r=m(()=>{let s=e.vehicle.chargepoint;return s!=null?s.isLocked?"var(--color-evu)":s.isCharging?"var(--color-charging)":s.isPluggedIn?"var(--color-battery)":"var(--color-axis)":"var(--color-axis)"});return(s,o)=>(l(),$(tt,{titlecolor:"var(--color-title)",fullwidth:!0},{title:_(()=>[n("span",ru,S(e.vehicle.name),1)]),default:_(()=>[n("div",ou,[v(X,{heading:"Status:",small:!0,class:"grid-left grid-col-4"},{default:_(()=>[n("span",{style:K({color:r.value}),class:"d-flex justify-content-center align-items-center status-string"},S(t.value),5)]),_:1}),v(X,{heading:"Ladestand:",small:!0,class:"grid-col-4"},{default:_(()=>[H(S(Math.round(e.vehicle.soc))+" % ",1)]),_:1}),v(X,{heading:"Reichweite:",small:!0,class:"grid-right grid-col-4"},{default:_(()=>[H(S(Math.round(e.vehicle.range))+" km ",1)]),_:1})])]),_:1}))}}),iu=R(su,[["__scopeId","data-v-9e2cb63e"]]),lu=L({__name:"VehicleList",setup(a){return(e,t)=>(l(),$(je,{"variable-width":!0},{title:_(()=>t[0]||(t[0]=[n("span",{class:"fas fa-car me-2",style:{color:"var(--color-charging)"}}," ",-1),n("span",null,"Fahrzeuge",-1)])),default:_(()=>[(l(!0),f(F,null,te(Object.values(i(Y)).filter(r=>r.visible),(r,s)=>(l(),f("div",{key:s,class:"subgrid"},[v(iu,{vehicle:r},null,8,["vehicle"])]))),128))]),_:1}))}}),Dt=R(lu,[["__scopeId","data-v-23b437ea"]]),cu={class:"grapharea"},uu={id:"pricechart",class:"p-1 m-0 pricefigure"},du={viewBox:"0 0 400 280"},hu=["id","origin","transform"],ut=380,_a=250,Gt=12,pu=L({__name:"GlobalPriceChart",props:{id:{}},setup(a){const e=a,t=ee(!1),r={top:0,bottom:15,left:20,right:0},s=m(()=>{let A=[];return re.etPriceList.size>0&&re.etPriceList.forEach((V,J)=>{A.push([J,V])}),A}),o=m(()=>s.value.length>1?(ut-r.left-r.right)/s.value.length:0),h=m(()=>{let A=Ve(s.value,V=>V[0]);return A[1]&&(A[1]=new Date(A[1]),A[1].setTime(A[1].getTime()+36e5)),et().range([r.left,ut-r.right]).domain(A)}),d=m(()=>{let A=[0,0];return s.value.length>0&&(A=Ve(s.value,V=>V[1]),A[0]=Math.floor(A[0])-1,A[1]=Math.floor(A[1])+1),A}),u=m(()=>He().range([_a-r.bottom,0]).domain(d.value)),p=m(()=>{const A=Ne(),V=[[r.left,u.value(g.lowerPriceBound)],[ut-r.right,u.value(g.lowerPriceBound)]];return A(V)}),c=m(()=>{const A=Ne(),V=[[r.left,u.value(g.upperPriceBound)],[ut-r.right,u.value(g.upperPriceBound)]];return A(V)}),k=m(()=>{const A=Ne(),V=[[r.left,u.value(0)],[ut-r.right,u.value(0)]];return A(V)}),P=m(()=>ht(h.value).ticks(s.value.length).tickSize(5).tickSizeInner(-250).tickFormat(A=>A.getHours()%6==0?st("%H:%M")(A):"")),z=m(()=>ft(u.value).ticks(d.value[1]-d.value[0]).tickSize(0).tickSizeInner(-360).tickFormat(A=>A.toString())),D=m(()=>{t.value==!0;const A=ce("g#"+B.value);A.selectAll("*").remove(),A.selectAll("bar").data(s.value).enter().append("g").append("rect").attr("class","bar").attr("x",x=>h.value(x[0])).attr("y",x=>u.value(x[1])).attr("width",o.value).attr("height",x=>u.value(d.value[0])-u.value(x[1])).attr("fill","var(--color-charging)");const J=A.append("g").attr("class","axis").call(P.value);J.attr("transform","translate(0,"+(_a-r.bottom)+")"),J.selectAll(".tick").attr("font-size",Gt).attr("color","var(--color-bg)"),J.selectAll(".tick line").attr("stroke","var(--color-bg)").attr("stroke-width",x=>x.getHours()%6==0?"2":"0.5"),J.select(".domain").attr("stroke","var(--color-bg");const C=A.append("g").attr("class","axis").call(z.value);C.attr("transform","translate("+r.left+",0)"),C.selectAll(".tick").attr("font-size",Gt).attr("color","var(--color-bg)"),C.selectAll(".tick line").attr("stroke","var(--color-bg)").attr("stroke-width",x=>x%5==0?"2":"0.5"),C.select(".domain").attr("stroke","var(--color-bg)"),d.value[0]<0&&A.append("path").attr("d",k.value).attr("stroke","var(--color-fg)"),A.append("path").attr("d",p.value).attr("stroke","green"),A.append("path").attr("d",c.value).attr("stroke","red");const M=A.selectAll("ttip").data(s.value).enter().append("g").attr("class","ttarea");M.append("rect").attr("x",x=>h.value(x[0])).attr("y",x=>u.value(x[1])).attr("height",x=>u.value(d.value[0])-u.value(x[1])).attr("class","ttrect").attr("width",o.value).attr("opacity","1%").attr("fill","var(--color-charging)");const E=M.append("g").attr("class","ttmessage").attr("transform",x=>"translate("+(h.value(x[0])-30+o.value/2)+","+(u.value(x[1])-16)+")");E.append("rect").attr("rx",5).attr("width","60").attr("height","30").attr("fill","var(--color-menu)");const I=E.append("text").attr("text-anchor","middle").attr("x",30).attr("y",12).attr("font-size",Gt).attr("fill","var(--color-bg)");return I.append("tspan").attr("x",30).attr("dy","0em").text(x=>st("%H:%M")(x[0])),I.append("tspan").attr("x",30).attr("dy","1.1em").text(x=>Math.round(x[1]*10)/10+" ct"),"PriceChart.vue"}),B=m(()=>"priceChartCanvas"+e.id);return Le(()=>{t.value=!t.value}),(A,V)=>(l(),$(je,{"variable-width":!0},{title:_(()=>V[0]||(V[0]=[n("span",{class:"fas fa-coins me-2",style:{color:"var(--color-battery)"}}," ",-1),n("span",null,"Strompreis",-1)])),buttons:_(()=>[i(re).active?(l(),$(Pe,{key:0,bgcolor:"var(--color-charging)"},{default:_(()=>[H(S(i(re).etCurrentPriceString),1)]),_:1})):w("",!0),i(re).active?(l(),$(Pe,{key:1,bgcolor:"var(--color-menu)"},{default:_(()=>[H(S(i(re).etProvider),1)]),_:1})):w("",!0)]),default:_(()=>[n("div",cu,[n("figure",uu,[(l(),f("svg",du,[n("g",{id:B.value,origin:D.value,transform:"translate("+r.top+","+r.left+") "},null,8,hu)]))])])]),_:1}))}}),jt=R(pu,[["__scopeId","data-v-6000c955"]]),gu={class:"subgrid pt-1"},mu=L({__name:"IlInverter",props:{inverter:{}},setup(a){const e=a,t=m(()=>({color:e.inverter.color}));return(r,s)=>(l(),$(tt,{titlecolor:"var(--color-title)",fullwidth:!0},{title:_(()=>[n("span",{class:"invertername",style:K(t.value)},S(r.inverter.name),5)]),buttons:_(()=>[e.inverter.power<0?(l(),$(Pe,{key:0,bgcolor:"var(--color-pv)"},{default:_(()=>[H(S(i($e)(-e.inverter.power)),1)]),_:1})):w("",!0)]),default:_(()=>[n("div",gu,[v(X,{heading:"Heute:",small:!0,class:"grid-col-4 grid-left"},{default:_(()=>[v(Ge,{"watt-h":e.inverter.energy},null,8,["watt-h"])]),_:1}),v(X,{heading:"Monat:",small:!0,class:"grid-col-4"},{default:_(()=>[v(Ge,{"watt-h":e.inverter.energy_month},null,8,["watt-h"])]),_:1}),v(X,{heading:"Jahr:",small:!0,class:"grid-right grid-col-4"},{default:_(()=>[v(Ge,{"watt-h":e.inverter.energy_year},null,8,["watt-h"])]),_:1})])]),_:1}))}}),fu=R(mu,[["__scopeId","data-v-258d8f17"]]),vu=L({__name:"InverterList",setup(a){return(e,t)=>(l(),$(je,{"variable-width":!0},{title:_(()=>t[0]||(t[0]=[n("span",{class:"fas fa-solar-panel me-2",style:{color:"var(--color-pv)"}}," ",-1),n("span",null,"Wechselrichter",-1)])),buttons:_(()=>[i(Q).pv.power>0?(l(),$(Pe,{key:0,bgcolor:"var(--color-pv)"},{default:_(()=>[H(S(i($e)(i(Q).pv.power)),1)]),_:1})):w("",!0)]),default:_(()=>[(l(!0),f(F,null,te(i(we),([r,s])=>(l(),f("div",{key:r,class:"subgrid pb-2"},[v(fu,{inverter:s},null,8,["inverter"])]))),128))]),_:1}))}}),Ut=R(vu,[["__scopeId","data-v-b7a71f81"]]),yu={class:"row py-0 px-0 m-0"},bu=["breakpoints"],_u=L({__name:"CarouselFix",setup(a){let e,t;const r=ee(!1),s=m(()=>r.value?{992:{slidesPerView:1,spaceBetween:0}}:{992:{slidesPerView:3,spaceBetween:0}});return Ka(()=>g.zoomGraph,o=>{if(e){let h=o?"1":"3";t.setAttribute("slides-per-view",h),e.activeIndex=g.zoomedWidget,e.update()}}),Le(()=>{let o=document.querySelector(".swiper-carousel");o&&(t=o,e=t.swiper)}),(o,h)=>(l(),f("div",yu,[n("swiper-container",{"space-between":0,pagination:{clickable:!0},"slides-per-view":"1",class:"p-0 m-0 swiper-carousel",breakpoints:s.value},[n("swiper-slide",null,[n("div",{class:q([i(De)?"mb-0":"mb-5","flex-fill d-flex align-items-stretch"])},[pe(o.$slots,"item1",{},void 0,!0)],2)]),n("swiper-slide",null,[n("div",{class:q([i(De)?"mb-0":"mb-5","flex-fill d-flex align-items-stretch"])},[pe(o.$slots,"item2",{},void 0,!0)],2)]),n("swiper-slide",null,[n("div",{class:q([i(De)?"mb-0":"mb-5","flex-fill d-flex align-items-stretch"])},[pe(o.$slots,"item3",{},void 0,!0)],2)])],8,bu)]))}}),wu=R(_u,[["__scopeId","data-v-17424929"]]);function ku(a,e){a=="openWB/graph/boolDisplayLiveGraph"?de.displayLiveGraph=+e==1:a.match(/^openwb\/graph\/alllivevaluesJson[1-9][0-9]*$/i)?xu(a,e):a=="openWB/graph/lastlivevaluesJson"?Su(a,e):a=="openWB/graph/config/duration"&&(ge.duration=JSON.parse(e))}function xu(a,e){if(!ge.initialized){let t=[];const r=e.toString().split(` -`);r.length>1?t=r.map(h=>JSON.parse(h)):t=[];const s=a.match(/(\d+)$/g),o=s?s[0]:"";o!=""&&typeof ge.rawDataPacks[+o-1]>"u"&&(ge.rawDataPacks[+o-1]=t,ge.initCounter++)}if(ge.initCounter==16){const t=[];ge.unsubscribeRefresh(),ge.initialized=!0,ge.rawDataPacks.forEach(r=>{r.forEach(s=>{const o=za(s);t.push(o)})}),yt(t),ge.subscribeUpdates()}}function Su(a,e){const t=JSON.parse(e),r=za(t);ge.graphRefreshCounter++,yt(y.data.concat(r)),ge.graphRefreshCounter>60&&ge.activate()}function za(a){const e=Object.values(O).length>0?Object.values(O)[0].connectedVehicle:0,t=Object.values(O).length>1?Object.values(O)[1].connectedVehicle:1,r="ev"+e+"-soc",s="ev"+t+"-soc",o={};o.date=+a.timestamp*1e3,+a.grid>0?(o.evuIn=+a.grid,o.evuOut=0):+a.grid<=0?(o.evuIn=0,o.evuOut=-a.grid):(o.evuIn=0,o.evuOut=0),+a["pv-all"]>=0?(o.pv=+a["pv-all"],o.inverter=0):(o.pv=0,o.inverter=-a["pv-all"]),o.house=+a["house-power"],+a["bat-all-power"]>0?(o.batOut=0,o.batIn=+a["bat-all-power"]):+a["bat-all-power"]<0?(o.batOut=-a["bat-all-power"],o.batIn=0):(o.batOut=0,o.batIn=0),a["bat-all-soc"]?o.batSoc=+a["bat-all-soc"]:o.batSoc=0,a[r]&&(o["soc"+e]=+a[r]),a[s]&&(o["soc"+t]=+a[s]),o.charging=+a["charging-all"];for(let h=0;h<10;h++){const d="cp"+h;o[d]=+(a[d+"-power"]??0)}return o.selfUsage=o.pv-o.evuOut,o.selfUsage<0&&(o.selfUsage=0),o.devices=0,o}const Mu=["evuIn","pv","batOut","evuOut","charging","house"];let $t=[];function $u(a,e){const{entries:t,names:r,totals:s}=JSON.parse(e);Fe.value=new Map(Object.entries(r)),aa(),$t=[],Zt.forEach(h=>{T.setEnergyPv(h,0),T.setEnergyBat(h,0)});const o=Pu(t);yt(o),Xt(s,$t),g.debug&&Cu(t,s,o),y.graphMode=="today"&&setTimeout(()=>ue.activate(),3e5)}function Pu(a){const e=[];let t={};return a.forEach(r=>{t=Iu(r);const s=t;e.push(s)}),e}function Iu(a){const e={};e.date=a.timestamp*1e3,e.evuOut=0,e.evuIn=0,Object.entries(a.counter).forEach(([s,o])=>{o.grid&&(e.evuOut+=o.power_exported,e.evuIn+=o.power_imported,$t.includes(s)||$t.push(s))}),e.evuOut==0&&e.evuIn==0&&Object.entries(a.counter).forEach(s=>{e.evuOut+=s[1].power_exported,e.evuIn+=s[1].power_imported}),Object.entries(a.pv).forEach(([s,o])=>{s!="all"?e[s]=o.power_exported:e.pv=o.power_exported}),Object.entries(a.bat).length>0?(e.batIn=a.bat.all.power_imported,e.batOut=a.bat.all.power_exported,e.batSoc=a.bat.all.soc??0):(e.batIn=0,e.batOut=0,e.batSoc=0),Object.entries(a.cp).forEach(([s,o])=>{s!="all"?(e[s]=o.power_imported,T.keys().includes(s)||T.addItem(s)):e.charging=o.power_imported}),Object.entries(a.ev).forEach(([s,o])=>{s!="all"&&(e["soc"+s.substring(2)]=o.soc)}),e.devices=0;let t=0;return Object.entries(a.sh).forEach(([s,o])=>{var h;s!="all"&&(e[s]=o.power_imported??0,T.keys().includes(s)||(T.addItem(s),T.items[s].showInGraph=ae.get(+s.slice(2)).showInGraph),(h=ae.get(+s.slice(2)))!=null&&h.countAsHouse?t+=e[s]:e.devices+=o.power_imported??0)}),e.selfUsage=Math.max(0,e.pv-e.evuOut),a.hc&&a.hc.all?e.house=a.hc.all.power_imported-t:e.house=e.evuIn+e.batOut+e.pv-e.evuOut-e.charging-e.devices-e.batOut,e.evuIn+e.batOut+e.pv>0?T.keys().filter(s=>!Mu.includes(s)&&s!="charging").forEach(s=>{Mn(s,e)}):Object.keys(e).forEach(s=>{e[s+"Pv"]=0,e[s+"Bat"]=0}),e}function Cu(a,e,t){console.debug("---------------------------------------- Graph Data -"),console.debug(["--- Incoming graph data:",a]),console.debug(["--- Incoming energy data:",e]),console.debug(["--- Data to be displayed:",t]),console.debug("-----------------------------------------------------")}let kt={};const ra=["charging","house","batIn","devices"],Bu=["evuIn","pv","batOut","batIn","evuOut","devices","sh1","sh2","sh3","sh4","sh5","sh6","sh7","sh8","sh9"];let Ke=[];function Vu(a,e){const{entries:t,names:r,totals:s}=JSON.parse(e);Fe.value=new Map(Object.entries(r)),aa(),Ke=[],ra.forEach(o=>{T.items[o].energyPv=0,T.items[o].energyBat=0}),t.length>0&&yt(Wa(t)),Xt(s,Ke)}function Lu(a,e){const{entries:t,names:r,totals:s}=JSON.parse(e);Fe.value=new Map(Object.entries(r)),aa(),Ke=[],ra.forEach(o=>{T.items[o].energyPv=0,T.items[o].energyBat=0}),t.length>0&&yt(Wa(t)),Xt(s,Ke)}function Wa(a){const e=[];let t={};return kt={},a.forEach(r=>{t=Ou(r),e.push(t),Object.keys(t).forEach(s=>{s!="date"&&(t[s]<0&&(console.warn(`Negative energy value for ${s} in row ${t.date}. Ignoring the value.`),t[s]=0),kt[s]?kt[s]+=t[s]:kt[s]=t[s])})}),e}function Ou(a){const e={},t=en("%Y%m%d")(a.date);t&&(e.date=y.graphMode=="month"?t.getDate():t.getMonth()+1),e.evuOut=0,e.evuIn=0;let r=0,s=0;return Object.entries(a.counter).forEach(([h,d])=>{r+=d.energy_exported,s+=d.energy_imported,d.grid&&(e.evuOut+=d.energy_exported,e.evuIn+=d.energy_imported,Ke.includes(h)||Ke.push(h))}),Ke.length==0&&(e.evuOut=r,e.evuIn=s),e.pv=a.pv.all.energy_exported,Object.entries(a.bat).length>0?(a.bat.all.energy_imported>=0?e.batIn=a.bat.all.energy_imported:(console.warn("ignoring negative value for batIn on day "+e.date),e.batIn=0),a.bat.all.energy_exported>=0?e.batOut=a.bat.all.energy_exported:(console.warn("ignoring negative value for batOut on day "+e.date),e.batOut=0)):(e.batIn=0,e.batOut=0),Object.entries(a.cp).forEach(([h,d])=>{h!="all"?(T.keys().includes(h)||T.addItem(h),e[h]=d.energy_imported):e.charging=d.energy_imported}),Object.entries(a.ev).forEach(([h,d])=>{h!="all"&&(e["soc-"+h]=d.soc)}),e.devices=Object.entries(a.sh).reduce((h,d)=>(T.keys().includes(d[0])||T.addItem(d[0]),d[1].energy_imported>=0?h+=d[1].energy_imported:console.warn(`Negative energy value for device ${d[0]} in row ${e.date}. Ignoring this value`),h),0),a.hc&&a.hc.all?e.house=a.hc.all.energy_imported:e.house=e.pv+e.evuIn+e.batOut-e.evuOut-e.batIn-e.charging,e.selfUsage=e.pv-e.evuOut,e.evuIn+e.batOut+e.pv>0?T.keys().filter(h=>!Bu.includes(h)).forEach(h=>{$n(h,e)}):ra.map(h=>{e[h+"Pv"]=0,e[h+"Bat"]=0}),e}function Au(a,e){const t=Tu(a);if(t&&!he.value.has(t)){console.warn("Invalid battery index: ",t);return}a=="openWB/bat/config/configured"?de.isBatteryConfigured=e=="true":a=="openWB/bat/get/power"?+e>0?(U.batIn.power=+e,Q.batOut.power=0):(U.batIn.power=0,Q.batOut.power=-e):a=="openWB/bat/get/soc"?de.batterySoc=+e:a=="openWB/bat/get/daily_exported"?Q.batOut.energy=+e:a=="openWB/bat/get/daily_imported"?U.batIn.energy=+e:t&&he.value.has(t)&&(a.match(/^openwb\/bat\/[0-9]+\/get\/daily_exported$/i)?he.value.get(t).dailyYieldExport=+e:a.match(/^openwb\/bat\/[0-9]+\/get\/daily_imported$/i)?he.value.get(t).dailyYieldImport=+e:a.match(/^openwb\/bat\/[0-9]+\/get\/exported$/i)?he.value.get(t).exported=+e:a.match(/^openwb\/bat\/[0-9]+\/get\/fault_state$/i)?he.value.get(t).faultState=+e:a.match(/^openwb\/bat\/[0-9]+\/get\/fault_str$/i)?he.value.get(t).faultStr=e:a.match(/^openwb\/bat\/[0-9]+\/get\/imported$/i)?he.value.get(t).imported=+e:a.match(/^openwb\/bat\/[0-9]+\/get\/power$/i)?he.value.get(t).power=+e:a.match(/^openwb\/bat\/[0-9]+\/get\/soc$/i)&&(he.value.get(t).soc=+e))}function Tu(a){let e=0;try{const t=a.match(/(?:\/)([0-9]+)(?=\/)/g);return t?(e=+t[0].replace(/[^0-9]+/g,""),e):void 0}catch(t){console.warn("Parser error in getIndex for topic "+a+": "+t)}}function Eu(a,e){if(a=="openWB/optional/et/provider")JSON.parse(e).type==null?re.active=!1:(re.active=!0,re.etProvider=JSON.parse(e).name);else if(a=="openWB/optional/et/get/prices"){const t=JSON.parse(e);re.etPriceList=new Map,Object.keys(t).forEach(r=>{re.etPriceList.set(new Date(+r*1e3),t[r]*1e5)})}}function zu(a,e){const t=Da(a);if(t&&!(t in O)){console.warn("Invalid chargepoint id received: "+t);return}if(a=="openWB/chargepoint/get/power"?U.charging.power=+e:a=="openWB/chargepoint/get/daily_imported"&&(U.charging.energy=+e),a=="openWB/chargepoint/get/daily_exported")de.cpDailyExported=+e;else if(t){if(a.match(/^openwb\/chargepoint\/[0-9]+\/config$/i))if(O[t]){const r=JSON.parse(e);O[t].name=r.name,O[t].icon=r.name,ie["cp"+t]?(ie["cp"+t].name=r.name,ie["cp"+t].icon=r.name):ie["cp"+t]={name:r.name,icon:r.name,color:"var(--color-charging)"}}else console.warn("invalid chargepoint index: "+t);else if(a.match(/^openwb\/chargepoint\/[0-9]+\/get\/state_str$/i))O[t].stateStr=JSON.parse(e);else if(a.match(/^openwb\/chargepoint\/[0-9]+\/get\/fault_str$/i))O[t].faultStr=JSON.parse(e);else if(a.match(/^openwb\/chargepoint\/[0-9]+\/get\/fault_state$/i))O[t].faultState=+e;else if(a.match(/^openWB\/chargepoint\/[0-9]+\/get\/power$/i))O[t].power=+e;else if(a.match(/^openWB\/chargepoint\/[0-9]+\/get\/daily_imported$/i))O[t].dailyYield=+e;else if(a.match(/^openwb\/chargepoint\/[0-9]+\/get\/plug_state$/i))O[t].isPluggedIn=e=="true";else if(a.match(/^openwb\/chargepoint\/[0-9]+\/get\/charge_state$/i))O[t].isCharging=e=="true";else if(a.match(/^openwb\/chargepoint\/[0-9]+\/set\/manual_lock$/i))O[t].updateIsLocked(e=="true");else if(a.match(/^openwb\/chargepoint\/[0-9]+\/get\/enabled$/i))O[t].isEnabled=e=="1";else if(a.match(/^openwb\/chargepoint\/[0-9]+\/get\/phases_in_use/i))O[t].phasesInUse=+e;else if(a.match(/^openwb\/chargepoint\/[0-9]+\/set\/current/i))O[t].current=+e;else if(a.match(/^openwb\/chargepoint\/[0-9]+\/get\/currents/i))O[t].currents=JSON.parse(e);else if(a.match(/^openwb\/chargepoint\/[0-9]+\/set\/log/i)){const r=JSON.parse(e);O[t].chargedSincePlugged=r.imported_since_plugged}else if(a.match(/^openwb\/chargepoint\/[0-9]+\/get\/connected_vehicle\/soc$/i)){const r=JSON.parse(e);O[t].soc=r.soc,O[t].waitingForSoc=!1,O[t].rangeCharged=r.range_charged,O[t].rangeUnit=r.range_unit}else if(a.match(/^openwb\/chargepoint\/[0-9]+\/get\/connected_vehicle\/info$/i)){const r=JSON.parse(e);O[t].vehicleName=String(r.name),O[t].updateConnectedVehicle(+r.id)}else if(a.match(/^openwb\/chargepoint\/[0-9]+\/get\/connected_vehicle\/config$/i)){const r=JSON.parse(e);switch(r.chargemode){case"instant_charging":O[t].updateChargeMode(ve.instant_charging);break;case"pv_charging":O[t].updateChargeMode(ve.pv_charging);break;case"scheduled_charging":O[t].updateChargeMode(ve.scheduled_charging);break;case"standby":O[t].updateChargeMode(ve.standby);break;case"stop":O[t].updateChargeMode(ve.stop);break}O[t].chargeTemplate=r.charge_template,O[t].averageConsumption=r.average_consumption}}}function Wu(a,e){const t=Da(a);if(t!=null){if(!(t in Y)){const r=new yn(t);Y[t]=r}if(a.match(/^openwb\/vehicle\/[0-9]+\/name$/i))Object.values(O).forEach(r=>{r.connectedVehicle==t&&(r.vehicleName=JSON.parse(e))}),Y[t].name=JSON.parse(e);else if(a.match(/^openwb\/vehicle\/[0-9]+\/get\/soc$/i))Y[t].soc=JSON.parse(e);else if(a.match(/^openwb\/vehicle\/[0-9]+\/get\/range$/i))isNaN(+e)?Y[t].range=0:Y[t].range=+e;else if(a.match(/^openwb\/vehicle\/[0-9]+\/charge_template$/i))Y[t].updateChargeTemplateId(+e);else if(a.match(/^openwb\/vehicle\/[0-9]+\/ev_template$/i))Y[t].updateEvTemplateId(+e);else if(a.match(/^openwb\/vehicle\/[0-9]+\/soc_module\/config$/i)){const r=JSON.parse(e);Object.values(O).forEach(s=>{s.connectedVehicle==t&&(s.isSocConfigured=r.type!==null,s.isSocManual=r.type=="manual")})}}}function Du(a,e){if(a.match(/^openwb\/vehicle\/template\/charge_template\/[0-9]+$/i)){const t=a.match(/[0-9]+$/i);if(t){const r=+t[0],s=JSON.parse(e);_e[r]=s,Gu(r,s)}}else if(a.match(/^openwb\/vehicle\/template\/charge_template\/[0-9]+\/time_charging\/plans\/[0-9]+$/i)){const t=a.match(/(?:\/)([0-9]+)(?:\/)/g),r=a.match(/[0-9]+$/i);if(t&&r){const s=+t[0].replace(/[^0-9]+/g,""),o=+r[0],h=JSON.parse(e);s in gt||(gt[s]=[]),gt[s][o]=h}}else if(a.match(/^openwb\/vehicle\/template\/charge_template\/[0-9]+\/chargemode\/scheduled_charging\/plans\/[0-9]+$/i)){const t=a.match(/(?:\/)([0-9]+)(?:\/)/g),r=a.match(/[0-9]+$/i);if(t&&r){const s=+t[0].replace(/[^0-9]+/g,""),o=+r[0],h=JSON.parse(e);s in pt||(pt[s]=[]),pt[s][o]=h}}else if(a.match(/^openwb\/vehicle\/template\/ev_template\/[0-9]+$/i)){const t=a.match(/[0-9]+$/i);if(t){const r=+t[0],s=JSON.parse(e);Ht[r]=s}}}function Gu(a,e){Object.values(O).forEach(t=>{t.chargeTemplate==a&&(t.updateCpPriority(e.prio),t.updateInstantChargeLimitMode(e.chargemode.instant_charging.limit.selected),t.updateInstantTargetCurrent(e.chargemode.instant_charging.current),t.updateInstantTargetSoc(e.chargemode.instant_charging.limit.soc),t.updateInstantMaxEnergy(e.chargemode.instant_charging.limit.amount),t.updatePvFeedInLimit(e.chargemode.pv_charging.feed_in_limit),t.updatePvMinCurrent(e.chargemode.pv_charging.min_current),t.updatePvMaxSoc(e.chargemode.pv_charging.max_soc),t.updatePvMinSoc(e.chargemode.pv_charging.min_soc),t.updatePvMinSocCurrent(e.chargemode.pv_charging.min_soc_current))})}function Da(a){let e=0;try{const t=a.match(/(?:\/)([0-9]+)(?=\/)/g);return t?(e=+t[0].replace(/[^0-9]+/g,""),e):void 0}catch(t){console.warn("Parser error in getIndex for topic "+a+": "+t)}}function ju(a,e){a.match(/^openWB\/LegacySmarthome\/config\//i)?Uu(a,e):a.match(/^openWB\/LegacySmarthome\/Devices\//i)&&Fu(a,e)}function Uu(a,e){const t=Ga(a);if(t==null)return;ae.has(t)||Yt(t);const r=ae.get(t);a.match(/^openWB\/LegacySmarthome\/config\/get\/Devices\/[0-9]+\/device_configured$/i)?r.configured=e!="0":a.match(/^openWB\/LegacySmarthome\/config\/get\/Devices\/[0-9]+\/device_name$/i)?(r.name=e.toString(),r.icon=e.toString(),ie["sh"+t].name=e.toString(),ie["sh"+t].icon=e.toString()):a.match(/^openWB\/LegacySmarthome\/config\/set\/Devices\/[0-9]+\/mode$/i)?r.isAutomatic=e=="0":a.match(/^openWB\/LegacySmarthome\/config\/get\/Devices\/[0-9]+\/device_canSwitch$/i)?r.canSwitch=e=="1":a.match(/^openWB\/LegacySmarthome\/config\/get\/Devices\/[0-9]+\/device_homeConsumtion$/i)?r.countAsHouse=e=="1":a.match(/^openWB\/LegacySmarthome\/config\/get\/Devices\/[0-9]+\/device_temperatur_configured$/i)&&(r.tempConfigured=+e)}function Fu(a,e){const t=Ga(a);if(t==null){console.warn("Smarthome: Missing index in "+a);return}ae.has(t)||Yt(t);const r=ae.get(t);if(a.match(/^openWB\/LegacySmarthome\/Devices\/[0-9]+\/Watt$/i))r.power=+e,Nu("power");else if(!a.match(/^openWB\/LegacySmarthome\/Devices\/[0-9]+\/Wh$/i)){if(a.match(/^openWB\/LegacySmarthome\/Devices\/[0-9]+\/RunningTimeToday$/i))r.runningTime=+e;else if(a.match(/^openWB\/LegacySmarthome\/Devices\/[0-9]+\/TemperatureSensor0$/i))r.temp[0]=+e;else if(a.match(/^openWB\/LegacySmarthome\/Devices\/[0-9]+\/TemperatureSensor1$/i))r.temp[1]=+e;else if(a.match(/^openWB\/LegacySmarthome\/Devices\/[0-9]+\/TemperatureSensor2$/i))r.temp[2]=+e;else if(a.match(/^openWB\/LegacySmartHome\/Devices\/[0-9]+\/Status$/i))switch(+e){case 10:r.status="off";break;case 11:r.status="on";break;case 20:r.status="detection";break;case 30:r.status="timeout";break;default:r.status="off"}}}function Nu(a){switch(a){case"power":U.devices.power=[...ae.values()].filter(e=>e.configured&&!e.countAsHouse).reduce((e,t)=>e+t.power,0);break;case"energy":U.devices.energy=[...ae.values()].filter(e=>e.configured&&!e.countAsHouse).reduce((e,t)=>e+t.energy,0);break;default:console.error("Unknown category")}}function Ga(a){let e=0;try{const t=a.match(/(?:\/)([0-9]+)(?=\/)/g);return t?(e=+t[0].replace(/[^0-9]+/g,""),e):void 0}catch(t){console.warn("Parser error in getIndex for topic "+a+": "+t)}}const Pt=le([]);class oa{constructor(e,t,r,s){b(this,"name");b(this,"children");b(this,"count");b(this,"lastValue");this.name=e,this.children=t,this.count=r,this.lastValue=s}insert(e,t){if(e.length){const r=e.splice(1);if(e[0]==this.name)if(r.length){let s=!1;if(this.children.forEach(o=>{o.name==r[0]&&(o.insert(r,t),s=!0)}),!s){const o=new oa(r[0],[],0,"");o.insert(r,t),this.children.push(o)}}else this.count=this.count+1,this.lastValue=t}}}function Hu(a,e){const t=a.split("/");if(t.length){let r=!1;if(Pt.forEach(s=>{s.name==t[0]&&(s.insert(t,e),r=!0)}),!r){const s=new oa(t[0],[],0,"");Pt.push(s),s.insert(t,e)}}}const Ru=["openWB/counter/#","openWB/bat/#","openWB/pv/#","openWB/chargepoint/#","openWB/vehicle/#","openWB/general/chargemode_config/pv_charging/#","openWB/optional/et/#","openWB/system/#","openWB/LegacySmartHome/#","openWB/command/"+qt()+"/#"];function Ju(){mn(Yu),Ru.forEach(a=>{Xe(a)}),fe()}function Yu(a,e){Hu(a,e.toString());const t=e.toString();a.match(/^openwb\/counter\/[0-9]+\//i)?qu(a,t):a.match(/^openwb\/counter\//i)?Qu(a,t):a.match(/^openwb\/bat\//i)?Au(a,t):a.match(/^openwb\/pv\//i)?Zu(a,t):a.match(/^openwb\/chargepoint\//i)?zu(a,t):a.match(/^openwb\/vehicle\/template\//i)?Du(a,t):a.match(/^openwb\/vehicle\//i)?Wu(a,t):a.match(/^openwb\/general\/chargemode_config\/pv_charging\//i)?Xu(a,t):a.match(/^openwb\/graph\//i)?ku(a,t):a.match(/^openwb\/log\/daily\//i)?$u(a,t):a.match(/^openwb\/log\/monthly\//i)?Vu(a,t):a.match(/^openwb\/log\/yearly\//i)?Lu(a,t):a.match(/^openwb\/optional\/et\//i)?Eu(a,t):a.match(/^openwb\/system\//i)?ed(a,t):a.match(/^openwb\/LegacySmartHome\//i)?ju(a,t):a.match(/^openwb\/command\//i)&&td(a,t)}function qu(a,e){const t=a.split("/"),r=+t[2];if(r==de.evuId?Ku(a,e):t[3]=="config",t[3]=="get"&&r in ke)switch(t[4]){case"power":ke[r].power=+e;break;case"config":break;case"fault_str":break;case"fault_state":break;case"power_factors":break;case"imported":break;case"exported":break;case"frequency":break;case"daily_imported":ke[r].energy_imported=+e;break;case"daily_exported":ke[r].energy_exported=+e;break}}function Qu(a,e){if(a.match(/^openwb\/counter\/get\/hierarchy$/i)){const t=JSON.parse(e);if(t.length){_n(),is();for(const r of t)r.type=="counter"&&(de.evuId=r.id);ja(t[0])}}else a.match(/^openwb\/counter\/set\/home_consumption$/i)?U.house.power=+e:a.match(/^openwb\/counter\/set\/daily_yield_home_consumption$/i)&&(U.house.energy=+e)}function ja(a){switch(a.type){case"counter":au(a.id,a.type);break;case"cp":bn(a.id);break;case"bat":Aa(a.id);break}a.children.forEach(e=>ja(e))}function Zu(a,e){const t=ad(a);t&&!we.value.has(t)&&zn(t),a=="openWB/pv/get/power"?Q.pv.power=-e:a=="openWB/pv/get/daily_exported"?Q.pv.energy=+e:a.match(/^openWB\/pv\/[0-9]+\/get\/power$/i)?we.value.get(t).power=+e:a.match(/^openWB\/pv\/[0-9]+\/get\/daily_exported$/i)?we.value.get(t).energy=+e:a.match(/^openWB\/pv\/[0-9]+\/get\/monthly_exported$/i)?we.value.get(t).energy_month=+e:a.match(/^openWB\/pv\/[0-9]+\/get\/yearly_exported$/i)?we.value.get(t).energy_year=+e:a.match(/^openWB\/pv\/[0-9]+\/get\/exported$/i)&&(we.value.get(t).energy_total=+e)}function Xu(a,e){const t=a.split("/");if(t.length>0)switch(t[4]){case"bat_mode":de.updatePvBatteryPriority(JSON.parse(e));break}}function Ku(a,e){switch(a.split("/")[4]){case"power":+e>0?(Q.evuIn.power=+e,U.evuOut.power=0):(Q.evuIn.power=0,U.evuOut.power=-e);break;case"daily_imported":Q.evuIn.energy=+e;break;case"daily_exported":U.evuOut.energy=+e;break}}function ed(a,e){if(a.match(/^openWB\/system\/device\/[0-9]+\/component\/[0-9]+\/config$/i)){const t=JSON.parse(e);switch(t.type){case"counter":case"consumption_counter":ke[t.id]&&(ke[t.id].name=t.name);break;case"inverter":case"inverter_secondary":we.value.has(t.id)||we.value.set(t.id,new $a(t.id)),we.value.get(t.id).name=t.name;break;case"bat":he.value.has(t.id)||Aa(t.id),he.value.get(t.id).name=t.name}}}function td(a,e){const t=a.split("/");if(a.match(/^openWB\/command\/[a-z]+\/error$/i)&&t[2]==qt()){const r=JSON.parse(e);console.error(`Error message from openWB: -Command: ${r.command} -Data: JSON.stringify(err.data) -Error: - ${r.error}`)}}function ad(a){let e=0;try{const t=a.match(/(?:\/)([0-9]+)(?=\/)/g);return t?(e=+t[0].replace(/[^0-9]+/g,""),e):void 0}catch(t){console.warn("Parser error in getIndex for topic "+a+": "+t)}}const nd={key:0,class:"fas fa-caret-down"},rd={key:1,class:"fas fa-caret-right"},od={key:0,class:"content p-2 m-2"},sd={key:1,class:"sublist col-md-9 m-0 p-0 ps-2"},id=L({__name:"MqttNode",props:{node:{},level:{},hide:{type:Boolean},expandAll:{type:Boolean}},setup(a){const e=a;let t=ee(!e.hide),r=ee(!1);const s=m(()=>e.node.name),o=m(()=>[...e.node.children].sort((c,k)=>c.namee.node.count>0?"("+e.node.count+")":""),d=m(()=>e.node.children.length),u=m(()=>e.node.lastValue!=""?{"font-style":"italic","grid-column-start":e.level,"grid-column-end":-1}:{"grid-column-start":e.level,"grid-column-end":-1});function p(){d.value>0&&(t.value=!t.value),e.node.lastValue!=""&&(r.value=!r.value)}return(c,k)=>{const P=tn("MqttNode",!0);return l(),f(F,null,[n("div",{class:"name py-2 px-2 m-0",style:K(u.value),onClick:p},[(i(t)||e.expandAll)&&d.value>0||i(r)?(l(),f("span",nd)):(l(),f("span",rd)),H(" "+S(s.value)+S(h.value),1)],4),i(r)?(l(),f("div",od,[n("code",null,S(e.node.lastValue),1)])):w("",!0),(i(t)||e.expandAll)&&d.value>0?(l(),f("div",sd,[(l(!0),f(F,null,te(o.value,(z,D)=>(l(),$(P,{key:D,level:e.level+1,node:z,hide:!0,"expand-all":e.expandAll},null,8,["level","node","expand-all"]))),128))])):w("",!0)],64)}}}),ld=R(id,[["__scopeId","data-v-df7e578a"]]),cd={class:"mqviewer"},ud={class:"row pt-2"},dd={class:"col"},hd={key:0,class:"topiclist"},pd=L({__name:"MQTTViewer",setup(a){Le(()=>{});const e=ee(!1);function t(){e.value=!e.value}const r=m(()=>e.value?"active":"");return(s,o)=>(l(),f("div",cd,[n("div",ud,[n("div",dd,[o[0]||(o[0]=n("h3",{class:"mqtitle ps-2"},"MQTT Message Viewer",-1)),o[1]||(o[1]=n("hr",null,null,-1)),n("button",{class:q(["btn btn-small btn-outline-primary ms-2",r.value]),onClick:t}," Expand All ",2),o[2]||(o[2]=n("hr",null,null,-1))])]),i(Pt)[0]?(l(),f("div",hd,[(l(!0),f(F,null,te(i(Pt)[0].children.sort((h,d)=>h.name(l(),$(ld,{key:d,node:h,level:1,hide:!0,"expand-all":e.value},null,8,["node","expand-all"]))),128))])):w("",!0)]))}}),gd=R(pd,[["__scopeId","data-v-a349646d"]]),md=["value"],fd=L({__name:"SelectInput",props:{options:{},modelValue:{}},emits:["update:modelValue"],setup(a,{emit:e}){const t=a,r=e,s=m({get(){return t.modelValue},set(o){r("update:modelValue",o)}});return(o,h)=>vt((l(),f("select",{id:"selectme","onUpdate:modelValue":h[0]||(h[0]=d=>s.value=d),class:"form-select"},[(l(!0),f(F,null,te(o.options,(d,u)=>(l(),f("option",{key:u,value:d[1]},S(d[0]),9,md))),128))],512)),[[an,s.value]])}}),vd=R(fd,[["__scopeId","data-v-5e33ce1f"]]),yd={class:"subgrid m-0 p-0"},bd={class:"settingscolumn"},_d={class:"settingscolumn"},wd={class:"settingscolumn"},kd=L({__name:"ThemeSettings",emits:["reset-arcs"],setup(a,{emit:e}){const t=e,r=[["Dunkel","dark"],["Hell","light"],["Blau","blue"]],s=[["3 kW","0"],["3,1 kW","1"],["3,14 kW","2"],["3,141 kW","3"],["3141 W","4"]],o=[["Orange","normal"],["Grün/Violett","standard"],["Bunt","advanced"]],h=[["Aus","off"],["Menü","navbar"],["Buttonleiste","buttonbar"]],d=[["Aus","no"],['"Alles"-Reiter',"infoview"],["Immer","always"]];return(u,p)=>(l(),$(je,{"full-width":!0},{title:_(()=>p[23]||(p[23]=[H(" Look & Feel ")])),buttons:_(()=>p[24]||(p[24]=[n("span",{type:"button",class:"float-end mt-0 ms-1","data-bs-toggle":"collapse","data-bs-target":"#themesettings"},[n("span",null,[n("i",{class:"fa-solid fa-circle-check"})])],-1)])),default:_(()=>[n("div",yd,[n("div",bd,[v(N,{fullwidth:!0,title:"Farbschema",icon:"fa-adjust",infotext:"Hintergrundfarbe"},{default:_(()=>[v(We,{modelValue:i(g).displayMode,"onUpdate:modelValue":p[0]||(p[0]=c=>i(g).displayMode=c),options:r},null,8,["modelValue"])]),_:1}),v(N,{fullwidth:!0,title:"Farbschema Smart-Home-Geräte",icon:"fa-palette",infotext:"Für die Smart-Home-Geräte stehen mehrere Schemata zur Verfügung."},{default:_(()=>[v(We,{modelValue:i(g).smartHomeColors,"onUpdate:modelValue":p[1]||(p[1]=c=>i(g).smartHomeColors=c),options:o},null,8,["modelValue"])]),_:1}),v(N,{fullwidth:!0,title:"Grafik: Raster",icon:"fa-th",infotext:"Verwende ein Hintergrundraster in den Grafiken"},{default:_(()=>[v(se,{modelValue:i(g).showGrid,"onUpdate:modelValue":p[2]||(p[2]=c=>i(g).showGrid=c)},null,8,["modelValue"])]),_:1}),v(N,{fullwidth:!0,title:"Variable Bogenlänge",icon:"fa-chart-area",infotext:"Im Graph 'Aktuelle Leistung' können die Bögen immer die volle Länge haben, oder entsprechend des aktuellen Gesamtleistung verkürzt dargestellt werden."},{default:_(()=>[v(se,{modelValue:i(g).showRelativeArcs,"onUpdate:modelValue":p[3]||(p[3]=c=>i(g).showRelativeArcs=c)},null,8,["modelValue"])]),_:1}),i(g).showRelativeArcs?(l(),$(N,{key:0,fullwidth:!0,title:"Bögen zurücksetzen",icon:"fa-undo",infotext:"Durch Click auf den Button wird die Maximallänge der Bögen auf den aktuellen Wert gesetzt."},{default:_(()=>[i(g).showRelativeArcs?(l(),f("button",{key:0,class:"btn btn-secondary",onClick:p[4]||(p[4]=c=>t("reset-arcs"))}," Reset ")):w("",!0)]),_:1})):w("",!0),v(N,{fullwidth:!0,title:"Anzahl Dezimalstellen",icon:"fa-sliders-h",infotext:"Alle kW- und kWh-Werte werden mit der gewählten Anzahl an Stellen angezeigt."},{default:_(()=>[v(vd,{modelValue:i(g).decimalPlaces,"onUpdate:modelValue":p[5]||(p[5]=c=>i(g).decimalPlaces=c),options:s},null,8,["modelValue"])]),_:1}),v(N,{fullwidth:!0,title:"Uhrzeit anzeigen",icon:"fa-clock",infotext:"Zeige die aktuelle Uhrzeit an. In der Menüleiste oder neben den Lade-Buttons."},{default:_(()=>[v(We,{modelValue:i(g).showClock,"onUpdate:modelValue":p[6]||(p[6]=c=>i(g).showClock=c),options:h},null,8,["modelValue"])]),_:1}),v(N,{fullwidth:!0,title:"Kompakte Ladepunktliste",icon:"fa-list",infotext:"Zeige eine einzelne Ladepunktliste statt separater Element pro Ladepunkt."},{default:_(()=>[v(We,{modelValue:i(g).shortCpList,"onUpdate:modelValue":p[7]||(p[7]=c=>i(g).shortCpList=c),options:d},null,8,["modelValue"])]),_:1})]),n("div",_d,[v(N,{fullwidth:!0,title:"Buttonleiste für Ladepunkte",icon:"fa-window-maximize",infotext:"Informationen zu Ladepunkten über den Diagrammen anzeigen."},{default:_(()=>[v(se,{modelValue:i(g).showButtonBar,"onUpdate:modelValue":p[8]||(p[8]=c=>i(g).showButtonBar=c)},null,8,["modelValue"])]),_:1}),v(N,{fullwidth:!0,title:"Filter-Buttons",icon:"fa-filter",infotext:"Hauptseite mit Buttons zur Auswahl der Kategorie."},{default:_(()=>[v(se,{modelValue:i(g).showQuickAccess,"onUpdate:modelValue":p[9]||(p[9]=c=>i(g).showQuickAccess=c)},null,8,["modelValue"])]),_:1}),v(N,{fullwidth:!0,title:"Breite Widgets",icon:"fa-desktop",infotext:"Widgets immer breit machen"},{default:_(()=>[v(se,{modelValue:i(g).preferWideBoxes,"onUpdate:modelValue":p[10]||(p[10]=c=>i(g).preferWideBoxes=c)},null,8,["modelValue"])]),_:1}),v(N,{fullwidth:!0,title:"Stufenlose Displaybreite",icon:"fa-maximize",infotext:"Die Breite des Displays wird immer voll ausgenutzt. Dies kann in einigen Fällen zu inkorrekter Darstellung führen."},{default:_(()=>[v(se,{modelValue:i(g).fluidDisplay,"onUpdate:modelValue":p[11]||(p[11]=c=>i(g).fluidDisplay=c)},null,8,["modelValue"])]),_:1}),v(N,{fullwidth:!0,title:"Animationen",icon:"fa-film",infotext:"Animationen anzeigen"},{default:_(()=>[v(se,{modelValue:i(g).showAnimations,"onUpdate:modelValue":p[12]||(p[12]=c=>i(g).showAnimations=c)},null,8,["modelValue"])]),_:1}),v(N,{fullwidth:!0,title:"Zähler anzeigen",icon:"fa-chart-bar",infotext:"Zeige die Werte zusätzlich angelegter Zähler"},{default:_(()=>[v(se,{modelValue:i(g).showCounters,"onUpdate:modelValue":p[13]||(p[13]=c=>i(g).showCounters=c)},null,8,["modelValue"])]),_:1}),v(N,{fullwidth:!0,title:"Fahrzeuge anzeigen",icon:"fa-car",infotext:"Zeige alle Fahrzeuge mit Ladestand und Reichweite"},{default:_(()=>[v(se,{modelValue:i(g).showVehicles,"onUpdate:modelValue":p[14]||(p[14]=c=>i(g).showVehicles=c)},null,8,["modelValue"])]),_:1}),v(N,{fullwidth:!0,title:"Standardfahrzeug anzeigen",icon:"fa-car",infotext:"Zeige das Standard-Fahrzeug in der Fahzeugliste"},{default:_(()=>[v(se,{modelValue:i(g).showStandardVehicle,"onUpdate:modelValue":p[15]||(p[15]=c=>i(g).showStandardVehicle=c)},null,8,["modelValue"])]),_:1})]),n("div",wd,[v(N,{fullwidth:!0,title:"Wechselrichter-Details anzeigen",icon:"fa-solar-panel",infotext:"Zeige Details zu den einzelnen Wechselrichtern"},{default:_(()=>[v(se,{modelValue:i(g).showInverters,"onUpdate:modelValue":p[16]||(p[16]=c=>i(g).showInverters=c)},null,8,["modelValue"])]),_:1}),v(N,{fullwidth:!0,title:"Alternatives Energie-Widget",icon:"fa-chart-area",infotext:"Horizontale Darstellung der Energie-Werte"},{default:_(()=>[v(se,{modelValue:i(g).alternativeEnergy,"onUpdate:modelValue":p[17]||(p[17]=c=>i(g).alternativeEnergy=c)},null,8,["modelValue"])]),_:1}),v(N,{fullwidth:!0,title:"Preistabelle anzeigen",icon:"fa-car",infotext:"Zeige die Strompreistabelle in einer separaten Box an"},{default:_(()=>[v(se,{modelValue:i(g).showPrices,"onUpdate:modelValue":p[18]||(p[18]=c=>i(g).showPrices=c)},null,8,["modelValue"])]),_:1}),v(N,{fullwidth:!0,title:"Untere Markierung in der Preistabelle",icon:"fa-car",infotext:"Position der unteren Markierung festlegen"},{default:_(()=>[v(Me,{id:"lowerPriceBound",modelValue:i(g).lowerPriceBound,"onUpdate:modelValue":p[19]||(p[19]=c=>i(g).lowerPriceBound=c),min:-25,max:95,step:.1,decimals:1,unit:"ct"},null,8,["modelValue"])]),_:1}),v(N,{fullwidth:!0,title:"Obere Markierung in der Preistabelle",icon:"fa-car",infotext:"Position der oberen Markierung festlegen"},{default:_(()=>[v(Me,{id:"upperPriceBound",modelValue:i(g).upperPriceBound,"onUpdate:modelValue":p[20]||(p[20]=c=>i(g).upperPriceBound=c),min:-25,max:95,step:.1,decimals:1,unit:"ct"},null,8,["modelValue"])]),_:1}),v(N,{fullwidth:!0,title:"IFrame-Support für Einstellungen (Experimentell)",icon:"fa-gear",infotext:"Erlaubt das Lesen der Einstellungen, wenn das UI in andere Applikationen eingebettet ist (z.B. HomeAssistant). Erfordert eine mit SSL verschlüsselte Verbindung über HTTPS! Experimentelles Feature."},{default:_(()=>[v(se,{modelValue:i(g).sslPrefs,"onUpdate:modelValue":p[21]||(p[21]=c=>i(g).sslPrefs=c)},null,8,["modelValue"])]),_:1}),v(N,{fullwidth:!0,title:"Debug-Modus",icon:"fa-bug-slash",infotext:"Kontrollausgaben in der Console sowie Anzeige von Bildschirmbreite und MQ-Viewer"},{default:_(()=>[v(se,{modelValue:i(g).debug,"onUpdate:modelValue":p[22]||(p[22]=c=>i(g).debug=c)},null,8,["modelValue"])]),_:1})]),p[25]||(p[25]=n("div",{class:"grid-col-12 mb-3 me-3"},[n("button",{class:"btn btn-sm btn-secondary float-end","data-bs-toggle":"collapse","data-bs-target":"#themesettings"}," Schließen ")],-1))])]),_:1}))}}),xd=R(kd,[["__scopeId","data-v-d82b4b16"]]),Sd={class:"container-fluid px-2 m-0 theme-colors"},Md={id:"themesettings",class:"collapse"},$d={class:"row py-0 px-0 m-0"},Pd={key:1,class:"row py-0 m-0 d-flex justify-content-center"},Id={key:2,class:"nav nav-tabs nav-justified mx-1 mt-2",role:"tablist"},Cd={key:0,class:"nav-link","data-bs-toggle":"tab","data-bs-target":"#pricecharttabbed"},Bd={key:1,class:"nav-link","data-bs-toggle":"tab","data-bs-target":"#vehiclelist"},Vd={key:2,class:"nav-link","data-bs-toggle":"tab","data-bs-target":"#batterylist"},Ld={key:3,class:"nav-link","data-bs-toggle":"tab","data-bs-target":"#smarthomelist"},Od={key:4,class:"nav-link","data-bs-toggle":"tab","data-bs-target":"#counterlist"},Ad={key:5,class:"nav-link","data-bs-toggle":"tab","data-bs-target":"#inverterlist"},Td={key:3,id:"cpContent",class:"tab-content mx-0 pt-1"},Ed={id:"showAll",class:"tab-pane active",role:"tabpanel","aria-labelledby":"showall-tab"},zd={class:"row py-0 m-0 d-flex justify-content-center"},Wd={id:"chargepointlist",class:"tab-pane",role:"tabpanel","aria-labelledby":"chargepoint-tab"},Dd={class:"row py-0 m-0 d-flex justify-content-center"},Gd={id:"vehiclelist",class:"tab-pane",role:"tabpanel","aria-labelledby":"vehicle-tab"},jd={key:0,class:"row py-0 m-0 d-flex justify-content-center"},Ud={id:"batterylist",class:"tab-pane",role:"tabpanel","aria-labelledby":"battery-tab"},Fd={class:"row py-0 m-0 d-flex justify-content-center"},Nd={id:"smarthomelist",class:"tab-pane",role:"tabpanel","aria-labelledby":"smarthome-tab"},Hd={key:0,class:"row py-0 m-0 d-flex justify-content-center"},Rd={id:"counterlist",class:"tab-pane",role:"tabpanel","aria-labelledby":"counter-tab"},Jd={key:0,class:"row py-0 m-0 d-flex justify-content-center"},Yd={id:"inverterlist",class:"tab-pane",role:"tabpanel","aria-labelledby":"inverter-tab"},qd={key:0,class:"row py-0 m-0 d-flex justify-content-center"},Qd={id:"pricecharttabbed",class:"tab-pane",role:"tabpanel","aria-labelledby":"price-tab"},Zd={key:0,class:"row py-0 m-0 d-flex justify-content-center"},Xd={key:0,class:"row p-2 mt-5"},Kd={class:"col p-2"},eh={class:"d-flex justify-content-between"},th={class:"mx-4"},ah={key:0},nh=L({__name:"ColorsTheme",setup(a){const e=ee(!1),t=m(()=>[...ae.values()].filter(h=>h.configured).length>0);function r(){Ba()}function s(){e.value=!e.value}Le(()=>{r(),window.addEventListener("resize",Vn),window.addEventListener("focus",o),Ju()});function o(){document.hasFocus()&&fe(!0)}return(h,d)=>(l(),f(F,null,[n("div",Sd,[n("div",Md,[v(xd,{onResetArcs:i(An)},null,8,["onResetArcs"])]),i(g).showButtonBar?(l(),$(Tc,{key:0})):w("",!0),n("div",$d,[v(wu,null,nn({item1:_(()=>[v(hr)]),item2:_(()=>[v(bo)]),_:2},[i(g).alternativeEnergy?{name:"item3",fn:_(()=>[v(vs)]),key:"0"}:{name:"item3",fn:_(()=>[v(No)]),key:"1"}]),1024)]),i(g).showQuickAccess?w("",!0):(l(),f("div",Pd,[v(Tt,{id:"1",compact:i(g).shortCpList=="always"},null,8,["compact"]),i(g).showPrices?(l(),$(jt,{key:0,id:"NoTabs"})):w("",!0),i(g).showVehicles?(l(),$(Dt,{key:1})):w("",!0),v(Et),t.value?(l(),$(zt,{key:2})):w("",!0),i(g).showCounters?(l(),$(Wt,{key:3})):w("",!0),i(g).showInverters?(l(),$(Ut,{key:4})):w("",!0)])),i(g).showQuickAccess?(l(),f("nav",Id,[d[6]||(d[6]=rn('AllesLadepunkte',2)),i(g).showPrices?(l(),f("a",Cd,d[0]||(d[0]=[n("i",{class:"fa-solid fa-lg fa-coins"},null,-1),n("span",{class:"d-none d-md-inline ms-2"},"Strompreis",-1)]))):w("",!0),i(g).showVehicles?(l(),f("a",Bd,d[1]||(d[1]=[n("i",{class:"fa-solid fa-lg fa-car"},null,-1),n("span",{class:"d-none d-md-inline ms-2"},"Fahrzeuge",-1)]))):w("",!0),i(de).isBatteryConfigured?(l(),f("a",Vd,d[2]||(d[2]=[n("i",{class:"fa-solid fa-lg fa-car-battery"},null,-1),n("span",{class:"d-none d-md-inline ms-2"},"Speicher",-1)]))):w("",!0),t.value?(l(),f("a",Ld,d[3]||(d[3]=[n("i",{class:"fa-solid fa-lg fa-plug"},null,-1),n("span",{class:"d-none d-md-inline ms-2"},"Smart Home",-1)]))):w("",!0),i(g).showCounters?(l(),f("a",Od,d[4]||(d[4]=[n("i",{class:"fa-solid fa-lg fa-bolt"},null,-1),n("span",{class:"d-none d-md-inline ms-2"},"Zähler",-1)]))):w("",!0),i(g).showInverters?(l(),f("a",Ad,d[5]||(d[5]=[n("i",{class:"fa-solid fa-lg fa-solar-panel"},null,-1),n("span",{class:"d-none d-md-inline ms-2"},"Wechselrichter",-1)]))):w("",!0)])):w("",!0),i(g).showQuickAccess?(l(),f("div",Td,[n("div",Ed,[n("div",zd,[v(Tt,{id:"2",compact:i(g).shortCpList!="no"},null,8,["compact"]),i(g).showPrices?(l(),$(jt,{key:0,id:"Overview"})):w("",!0),i(g).showVehicles?(l(),$(Dt,{key:1})):w("",!0),v(Et),t.value?(l(),$(zt,{key:2})):w("",!0),i(g).showCounters?(l(),$(Wt,{key:3})):w("",!0),i(g).showInverters?(l(),$(Ut,{key:4})):w("",!0)])]),n("div",Wd,[n("div",Dd,[v(Tt,{id:"3",compact:i(g).shortCpList=="always"},null,8,["compact"])])]),n("div",Gd,[i(g).showVehicles?(l(),f("div",jd,[v(Dt)])):w("",!0)]),n("div",Ud,[n("div",Fd,[v(Et)])]),n("div",Nd,[t.value?(l(),f("div",Hd,[v(zt)])):w("",!0)]),n("div",Rd,[i(g).showCounters?(l(),f("div",Jd,[v(Wt)])):w("",!0)]),n("div",Yd,[i(g).showInverters?(l(),f("div",qd,[v(Ut)])):w("",!0)]),n("div",Qd,[i(g).showPrices?(l(),f("div",Zd,[v(jt,{id:"Tabbed"})])):w("",!0)])])):w("",!0)]),i(g).debug?(l(),f("div",Xd,[n("div",Kd,[d[7]||(d[7]=n("hr",null,null,-1)),n("div",eh,[n("p",th,"Screen Width: "+S(i(Mt).x),1),n("button",{class:"btn btn-sm btn-secondary mx-4",onClick:s}," MQ Viewer ")]),e.value?(l(),f("hr",ah)):w("",!0),e.value?(l(),$(gd,{key:1})):w("",!0)])])):w("",!0)],64))}}),rh=R(nh,[["__scopeId","data-v-0542a138"]]),oh={class:"navbar navbar-expand-lg px-0 mb-0"},sh={key:0,class:"position-absolute-50 navbar-text ms-4 navbar-time",style:{color:"var(--color-menu)"}},ih=L({__name:"NavigationBar",setup(a){let e;const t=m(()=>g.fluidDisplay?"container-fluid":"container-lg");return Le(()=>{e=setInterval(()=>{Rt.value=new Date},1e3)}),on(()=>{clearInterval(e)}),(r,s)=>(l(),f(F,null,[n("nav",oh,[n("div",{class:q(t.value)},[s[0]||(s[0]=n("a",{href:"/",class:"navbar-brand"},[n("span",null,"openWB")],-1)),i(g).showClock=="navbar"?(l(),f("span",sh,S(i(La)(i(Rt))),1)):w("",!0),s[1]||(s[1]=n("button",{class:"navbar-toggler togglebutton ps-5",type:"button","data-bs-toggle":"collapse","data-bs-target":"#mainNavbar","aria-controls":"mainNavbar","aria-expanded":"false","aria-label":"Toggle navigation"},[n("span",{class:"fa-solid fa-ellipsis-vertical"})],-1)),s[2]||(s[2]=n("div",{id:"mainNavbar",class:"collapse navbar-collapse justify-content-end"},[n("div",{class:"nav navbar-nav"},[n("a",{id:"navStatus",class:"nav-link",href:"../../settings/#/Status"},"Status"),n("div",{class:"nav-item dropdown"},[n("a",{id:"loggingDropdown",class:"nav-link",href:"#",role:"button","data-bs-toggle":"dropdown","aria-expanded":"false"},[H("Auswertungen "),n("i",{class:"fa-solid fa-caret-down"})]),n("div",{class:"dropdown-menu","aria-labelledby":"loggingDropdown"},[n("a",{href:"../../settings/#/Logging/ChargeLog",class:"dropdown-item"},"Ladeprotokoll"),n("a",{href:"../../settings/#/Logging/Chart",class:"dropdown-item"},"Diagramme")])]),n("div",{class:"nav-item dropdown"},[n("a",{id:"settingsDropdown",class:"nav-link",href:"#",role:"button","data-bs-toggle":"dropdown","aria-expanded":"false"},[H("Einstellungen "),n("span",{class:"fa-solid fa-caret-down"})]),n("div",{class:"dropdown-menu","aria-labelledby":"settingsDropdown"},[n("a",{id:"navSettings",class:"nav-link",href:"../../settings/index.html"},"openWB"),n("a",{class:"nav-link","data-bs-toggle":"collapse","data-bs-target":"#themesettings","aria-expanded":"false","aria-controls":"themeSettings"},[n("span",null,[H("Look&Feel"),n("span",{class:"fa-solid fa-caret-down"})])])])])])],-1))],2)]),n("div",{class:q(t.value)},s[3]||(s[3]=[n("hr",{class:"m-0 p-0 mb-2"},null,-1)]),2)],64))}}),lh=R(ih,[["__scopeId","data-v-ed619966"]]),ch={id:"app",class:"m-0 p-0"},uh={class:"row p-0 m-0"},dh={class:"col-12 p-0 m-0"},hh=L({__name:"App",setup(a){const e=m(()=>g.fluidDisplay?"container-fluid":"container-lg");return(t,r)=>(l(),f("div",ch,[v(lh),n("div",{class:q(["p-0",e.value])},[n("div",uh,[n("div",dh,[v(rh)])])],2)]))}}),ph=sn(hh);ln();ph.mount("#app"); diff --git a/packages/modules/web_themes/colors/web/index.html b/packages/modules/web_themes/colors/web/index.html index 5ac7048b4b..928892965c 100644 --- a/packages/modules/web_themes/colors/web/index.html +++ b/packages/modules/web_themes/colors/web/index.html @@ -24,7 +24,7 @@ openWB - + From a0affbbbfc9c23a7a6cd2616e34a92477621a51e Mon Sep 17 00:00:00 2001 From: Claus Hagen Date: Mon, 3 Feb 2025 16:16:17 +0100 Subject: [PATCH 3/7] remove vite server.allowedhosts --- packages/modules/web_themes/colors/source/vite.config.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/modules/web_themes/colors/source/vite.config.ts b/packages/modules/web_themes/colors/source/vite.config.ts index 044fcf8f2a..51d6e5db0f 100755 --- a/packages/modules/web_themes/colors/source/vite.config.ts +++ b/packages/modules/web_themes/colors/source/vite.config.ts @@ -7,9 +7,7 @@ import nodePolyfills from "rollup-plugin-polyfill-node"; // https://vitejs.dev/config/ export default defineConfig({ - server: { - allowedHosts: true, - }, + plugins: [vue({ template: { compilerOptions: { From d4790965005133cbf507a6a9d5c064e4ce914aaa Mon Sep 17 00:00:00 2001 From: Claus Hagen Date: Mon, 3 Feb 2025 16:21:17 +0100 Subject: [PATCH 4/7] cleanup --- packages/modules/web_themes/colors/source/vite.config.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/modules/web_themes/colors/source/vite.config.ts b/packages/modules/web_themes/colors/source/vite.config.ts index 51d6e5db0f..dd40d3b97a 100755 --- a/packages/modules/web_themes/colors/source/vite.config.ts +++ b/packages/modules/web_themes/colors/source/vite.config.ts @@ -7,8 +7,7 @@ import nodePolyfills from "rollup-plugin-polyfill-node"; // https://vitejs.dev/config/ export default defineConfig({ - - plugins: [vue({ + plugins: [vue({ template: { compilerOptions: { isCustomElement: (tag) => ['swiper-slide', 'swiper-container', 'swiper-pagination'].includes(tag) From 6d06a258d4d7549cbc7f70d66c54ff916b5d5b24 Mon Sep 17 00:00:00 2001 From: Claus Hagen Date: Mon, 3 Feb 2025 16:25:04 +0100 Subject: [PATCH 5/7] cleanup --- packages/modules/web_themes/colors/source/vite.config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/modules/web_themes/colors/source/vite.config.ts b/packages/modules/web_themes/colors/source/vite.config.ts index dd40d3b97a..6e15bcd405 100755 --- a/packages/modules/web_themes/colors/source/vite.config.ts +++ b/packages/modules/web_themes/colors/source/vite.config.ts @@ -7,7 +7,7 @@ import nodePolyfills from "rollup-plugin-polyfill-node"; // https://vitejs.dev/config/ export default defineConfig({ - plugins: [vue({ + plugins: [vue({ template: { compilerOptions: { isCustomElement: (tag) => ['swiper-slide', 'swiper-container', 'swiper-pagination'].includes(tag) From 3958af6f37d0cd3074423c1fcb7baa5d9aa4887c Mon Sep 17 00:00:00 2001 From: Claus Hagen Date: Mon, 3 Feb 2025 16:28:39 +0100 Subject: [PATCH 6/7] prettify vite.config.ts --- .../modules/web_themes/colors/source/vite.config.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/modules/web_themes/colors/source/vite.config.ts b/packages/modules/web_themes/colors/source/vite.config.ts index 6e15bcd405..6c42832871 100755 --- a/packages/modules/web_themes/colors/source/vite.config.ts +++ b/packages/modules/web_themes/colors/source/vite.config.ts @@ -9,11 +9,11 @@ import nodePolyfills from "rollup-plugin-polyfill-node"; export default defineConfig({ plugins: [vue({ template: { - compilerOptions: { - isCustomElement: (tag) => ['swiper-slide', 'swiper-container', 'swiper-pagination'].includes(tag) - } - } - }), + compilerOptions: { + isCustomElement: (tag) => ['swiper-slide', 'swiper-container', 'swiper-pagination'].includes(tag) + } + } + }), splitVendorChunkPlugin(), ], resolve: { From d883e4727863a09a3edcf275ab7654c590c84c3e Mon Sep 17 00:00:00 2001 From: Claus Hagen Date: Mon, 3 Feb 2025 16:41:30 +0100 Subject: [PATCH 7/7] prettify vite.config.ts --- .../modules/web_themes/colors/source/vite.config.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/modules/web_themes/colors/source/vite.config.ts b/packages/modules/web_themes/colors/source/vite.config.ts index 6c42832871..3821596212 100755 --- a/packages/modules/web_themes/colors/source/vite.config.ts +++ b/packages/modules/web_themes/colors/source/vite.config.ts @@ -8,16 +8,16 @@ import nodePolyfills from "rollup-plugin-polyfill-node"; // https://vitejs.dev/config/ export default defineConfig({ plugins: [vue({ - template: { + template: { compilerOptions: { isCustomElement: (tag) => ['swiper-slide', 'swiper-container', 'swiper-pagination'].includes(tag) - } + } } }), splitVendorChunkPlugin(), - ], - resolve: { - alias: { + ], + resolve: { + alias: { '@': fileURLToPath(new URL('./src', import.meta.url)), url: "rollup-plugin-node-polyfills/polyfills/url", util: "rollup-plugin-node-polyfills/polyfills/util",