diff --git a/dist/mlk-power-flow-card.js b/dist/mlk-power-flow-card.js index cb42361..d501f0c 100644 --- a/dist/mlk-power-flow-card.js +++ b/dist/mlk-power-flow-card.js @@ -43,4 +43,4 @@ const lt=t=>(e,n)=>{void 0!==n?n.addInitializer((()=>{customElements.define(t,e) * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ -function ft(t,e){return(e,n,r)=>((t,e,n)=>(n.configurable=!0,n.enumerable=!0,Reflect.decorate&&"object"!=typeof e&&Object.defineProperty(t,e,n),n))(e,n,{get(){return(e=>e.renderRoot?.querySelector(t)??null)(this)}})}function ht(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}var gt;const pt=((t,...e)=>{const n=1===t.length?t[0]:e.reduce(((e,n,r)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+t[r+1]),t[0]);return new o(n,t,r)})(gt||(gt=ht(["\n text_debug {\n outline: 1px solid blue;\n }\n \n \n .container {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n height: 100%;\n width: 100%;\n padding: 5px;\n }\n\n .card {\n border-radius: var(--ha-card-border-radius, 10px);\n box-shadow: var(--ha-card-box-shadow, 0px 0px 0px 1px rgba(0, 0, 0, 0.12), 0px 0px 0px 0px rgba(0, 0, 0, 0.12), 0px 0px 0px 0px rgba(0, 0, 0, 0.12));\n background: var(--ha-card-background, var(--card-background-color, white));\n border-width: var(--ha-card-border-width);\n padding: 0;\n }\n\n text { text-anchor: middle; dominant-baseline: middle; }\n\n .left-align {text-anchor: start;}\n .right-align {text-anchor: end;}\n .st1{fill:#ff9b30;}\n .st2{fill:#f3b3ca;}\n .st3{font-size:9px;}\n .st4{font-size:14px;}\n .st5{fill:#969696;}\n .st6{fill:#5fb6ad;}\n .st7{fill:#5490c2;}\n .st8{font-weight:500}\n .st9{fill:#959595;}\n .st10{font-size:16px;}\n .st11{fill:transparent;}\n .st12{display:none;}\n .st13{font-size:22px;}\n .st14{font-size:12px;}\n\n "])));var yt,mt;!function(t){t.Azzurro="azzurro",t.CESBatteryBox="ces-battery-box",t.Deye="deye",t.E3dc="e3dc",t.FoxESS="foxess",t.Fronius="fronius",t.Goodwe="goodwe",t.GoodweGridMode="goodwe_gridmode",t.Growatt="growatt",t.Huawei="huawei",t.Lux="lux",t.MPPSolar="mppsolar",t.PowMr="powmr",t.SMASolar="smasolar",t.Solax="solax",t.SolarEdge="solaredge",t.Sofar="sofar",t.Solis="solis",t.Sunsynk="sunsynk",t.Victron="victron"}(yt||(yt={})),function(t){t.Energy="energy",t.Power="power",t.AutoSelf="auto&self",t.No="no"}(mt||(mt={}));var vt={description:"A Home Assistant card to emulate the Sunsynk power flow that's shown on the Inverter screen",version:"Version",runtime_to:"RUNTIME TO",battery_floating:"BATTERY FLOATING",charge:"CHARGE",to:"TO",daily_load:"DAILY LOAD",daily_aux:"DAILY AUX",daily_grid_buy:"DAILY GRID BUY",daily_grid_sell:"DAILY GRID SELL",daily_solar:"DAILY SOLAR",monthly_solar:"MONTHLY SOLAR",yearly_solar:"YEARLY SOLAR",total_solar_generation:"TOTAL SOLAR",remaining_solar:"LEFT SOLAR",daily_charge:"DAILY CHARGE",daily_discharge:"DAILY DISCHARGE",ratio:"Ratio",timer_off:"Timer off",timer_on:"Timer on",priority_batt:"Priority Batt",priority_load:"Priority Load",nonessential_name:"Non Essential",aux_name:"Auxiliary",pv1_name:"PV1",pv2_name:"PV2",pv3_name:"PV3",pv4_name:"PV4",pv5_name:"PV5",essential:"Essential",autarky:"Autarky",autarkySelf:"Self use",autarkyAuto:"Auto cons",discharging:"Discharging",charging:"Charging",waiting:"Waiting",standby:"Standby",no_battery:"No Battery",selftest:"Selftest",normal:"Normal",alarm:"Alarm",fault:"Fault",days:"d",hrs:"h",min:"m",flash:"Flash",check:"Check",idle:"Idle",exporting:"Export",importing:"Import",ongrid:"On-Grid",offgrid:"Off-Grid",normalstop:" Normal Stop",shutdown:"Shutdown",offline:"Offline",running:"Running",sleepmode:"Sleep Mode",grid_name:"Grid",limit:"Limit",off:"Off",lowpower:"Low Power",bulk:"Bulk",absorption:"Absorption",float:"Float",storage:"Storage",equalize:"Equalize",passthru:"Passthru",inverting:"Inverting",powerassist:"Power Assist",powersupply:"Power Supply",sustain:"Sustain",externalcontrol:"External Control"},At={battery:{bat:"No battery attributes defined",energy:"Please include the battery energy attribute and value in Wh e.g. 5.32 Battery energy: 5320",shutdown_soc:"Please include the battery shutdown_soc attribute and value e.g shutdown_soc: 20",full_capacity:"Full capacity needs to be between 80 and 100",empty_capacity:"Empty capacity needs to be <= 40",show_daily:"Please include the day_battery_charge_70 and day_battery_discharge_71 attributes and entity IDs"},solar:{sol:"No solar attributes defined",mppts:"Please include the solar mppts attribute and value; 1,2,3 or 4 e.g. mppts: 2",show_daily:"Please include the day_pv_energy_108 attribute and entity ID"},grid:{show_daily:"Please include the day_grid_import_76 and day_grid_export_77 attributes and entity IDs"},essential_power:"The essential_power attribute is set to none. Please include the inverter_power_175 attribute and entity ID in order for the card to calculate this value.",nonessential_power:"The nonessential_power attribute is set to none. Please include the grid_power_169 attribute and entity ID in order for the card to calculate this value.",missing_entity:"`Please include the attribute and entity ID"},wt={title:"Title",title_colour:"Title Colour",title_size:"Title Size (px)",card_height:"Card Height (px)",card_width:"Card Width (px)",decimal_places:"Decimal Places",decimal_places_energy:"Decimal Places (Daily Energy)",model:"Model",autarky:"Autarky",large_font:"Large Font",modern:"Modern",show_solar:"Show Solar",show_battery:"Show Battery",show_grid:"Show Grid",show_aux:"Show Aux",dynamic_line_width:"Dynamic Line Width",max_line_width:"Max Line Width",min_line_width:"Min Line Width",solar:"Solar",mppts:"MPPTs",show_daily:"Show Daily",show_daily_aux:"Show Daily Aux",animation_speed:"Anim. Speed",max_power:"Max Power",pv1_max_power:"PV1 Max Power",pv2_max_power:"PV2 Max Power",pv3_max_power:"PV3 Max Power",pv4_max_power:"PV4 Max Power",pv5_max_power:"PV5 Max Power",pv1_name:"PV1 Name",pv2_name:"PV2 Name",pv3_name:"PV3 Name",pv4_name:"PV4 Name",pv5_name:"PV5 Name",display_mode:"Display Mode",visualize_efficiency:"Show PVs Efficiency",show_mppt_production:"Show PVs production",show_mppt_efficiency:"Show PVs efficiency %",battery:"Battery",load1_name:"Load 1 Name",load2_name:"Load 2 Name",load3_name:"Load 3 Name",load4_name:"Load 4 Name",load5_name:"Load 5 Name",load6_name:"Load 6 Name",load7_name:"Load 7 Name",load8_name:"Load 8 Name",load1_icon:"Load 1 Icon",load2_icon:"Load 2 Icon",load3_icon:"Load 3 Icon",load4_icon:"Load 4 Icon",load5_icon:"Load 5 Icon",load6_icon:"Load 6 Icon",load7_icon:"Load 7 Icon",load8_icon:"Load 8 Icon",aux_load1_name:"Aux Load 1 Name",aux_load2_name:"Aux Load 2 Name",aux_load1_icon:"Aux Load 1 Icon",aux_load2_icon:"Aux Load 2 Icon",aux_dynamic_colour:"Aux Dynamic Colour",off_threshold:"Off Threshold",show_daily_buy:"Show Daily Buy",show_daily_sell:"Show Daily Sell",no_grid_colour:"No Grid Colour",grid_off_colour:"Grid Off Colour",grid_name:"Grid Name",colour:"Colour",charge_colour:"Charge Colour",linear_gradient:"Linear Gradient",animate:"Animate Linear Gradient",aux_colour:"Colour",aux_off_colour:"Off Colour",panel_mode:"Panel Mode",invert_grid:"Invert Values",invert_load:"Invert Values",shutdown_soc:"Shutdown SOC",shutdown_soc_offgrid:"Shutdown SOC (Off Grid)",energy:"Energy",auto_scale:"Auto Scale",three_phase:"Three Phase",dynamic_colour:"Dynamic Colour",dynamic_icon:"Dynamic Icon",invert_power:"Invert Power",show_absolute:"Show Absolute",hide_soc:"Hide SOC",invert_aux:"Invert Aux",show_absolute_aux:"Show Absolute",show_nonessential:"Show Non Essential",aux_name:"Aux Name",aux_daily_name:"Daily Aux Name",aux_type:"Aux Icon",aux_loads:"Aux Loads",essential_name:"Essential Name",additional_loads:"Additional Loads",export_colour:"Export Colour",nonessential_name:"Non Essential Name",nonessential_icon:"Non Essential Icon",energy_cost_decimals:"Energy Cost Decimals",show_remaining_energy:"Show Remaining Energy",path_threshold:"Path Threshold",label_daily_grid_buy:"Daily Grid Buy Label",label_daily_grid_sell:"Daily Grid Sell Label",cat_title:{title:"Title Options",general:"General Options",inverter:"Inverter Options",solar:"Solar Options",battery:"Battery Options",grid:"Grid Options",load:"Load Options",additional_load:"Additional Load Options",aux_load:"Aux Load Options",entities:"Entities",energy:"Energy Entities",bat:"Battery Entities",sol:"Solar Entities",inv:"Inverter Entities",ld:"Load Entities",gri:"Grid Entities",sensor:"Optional Sensors",max_power:"PV Max Power"}},bt={common:vt,errors:At,config:wt};const xt={hass:null},Pt={en:Object.freeze({__proto__:null,common:vt,config:wt,default:bt,errors:At})};function Et(t,e="",n=""){const r=(localStorage.getItem("selectedLanguage")||"en").replace(/['"]+/g,"").replace("-","_"),a="".concat(xt.hass?.selectedLanguage||xt.hass?.locale?.language||xt.hass?.language||r);let o;try{o=t.split(".").reduce(((t,e)=>t[e]),Pt[a])}catch(e){o=t.split(".").reduce(((t,e)=>t[e]),Pt.en)}return void 0===o&&(o=t.split(".").reduce(((t,e)=>t[e]),Pt.en)),""!==e&&""!==n&&(o=o.replace(e,n)),o}var Lt={panel_mode:!1,large_font:!1,show_solar:!0,show_battery:!0,show_grid:!0,card_height:"396px",card_width:"100%",decimal_places:2,decimal_places_energy:1,dynamic_line_width:!0,max_line_width:4,min_line_width:1,inverter:{modern:!0,colour:"grey",autarky:"power",model:yt.Sunsynk,auto_scale:!0,three_phase:!1},battery:{energy:0,shutdown_soc:20,invert_power:!1,hide_soc:!1,colour:"pink",show_daily:!1,show_remaining_energy:!0,animation_speed:6,max_power:4500,show_absolute:!1,auto_scale:!0,dynamic_colour:!0,linear_gradient:!0,animate:!0,path_threshold:100},solar:{colour:"orange",mppts:2,animation_speed:9,max_power:8e3,pv1_name:Et("common.pv1_name"),pv2_name:Et("common.pv2_name"),pv3_name:Et("common.pv3_name"),pv4_name:Et("common.pv4_name"),pv5_name:Et("common.pv5_name"),auto_scale:!0,display_mode:1,dynamic_colour:!0,visualize_efficiency:!0,off_threshold:10,show_mppt_production:!0,show_mppt_efficiency:!1},load:{colour:"#5fb6ad",dynamic_colour:!0,dynamic_icon:!0,aux_dynamic_colour:!0,off_threshold:0,show_daily:!1,show_aux:!1,show_daily_aux:!1,invert_aux:!1,invert_load:!1,show_absolute_aux:!1,animation_speed:4,max_power:8e3,aux_name:Et("common.aux_name"),aux_daily_name:Et("common.daily_aux"),aux_type:"default",additional_loads:0,aux_loads:0,aux_load1_name:"",aux_load2_name:"",essential_name:Et("common.essential"),load1_icon:"default",load2_icon:"default",load1_name:Et("common.load1_name"),load2_name:Et("common.load2_name"),auto_scale:!0,path_threshold:100},grid:{colour:"#5490c2",grid_name:Et("common.grid_name"),label_daily_grid_buy:Et("common.daily_grid_buy"),label_daily_grid_sell:Et("common.daily_grid_sell"),show_daily_buy:!1,show_daily_sell:!1,show_nonessential:!0,nonessential_icon:"default",nonessential_name:Et("common.nonessential_name"),additional_loads:0,load1_name:"",load2_name:"",load3_name:"",load1_icon:"default",load2_icon:"default",load3_icon:"default",invert_grid:!1,animation_speed:8,max_power:8e3,auto_scale:!0,energy_cost_decimals:2,show_absolute:!1,off_threshold:0}};const Mt=[0,1,2,3,4,5,6,7,8],zt=[0,1,2,3],Nt=[!0,!1],Ct=[!0,!1],kt=[0,1,2],Tt=["off","0","off-grid","off grid","offgrid"],jt=["on","1","on-grid","on grid","ongrid"],Dt="mlk-content-card-editor";var Ot,Bt,Ht,Rt,It;!function(t){t.DATE="date",t.ENUM="enum",t.TIMESTAMP="timestamp",t.APPARENT_POWER="apparent_power",t.ATMOSPHERIC_PRESSURE="atmospheric_pressure",t.BATTERY="battery",t.CO="carbon_monoxide",t.CO2="carbon_dioxide",t.CURRENT="current",t.ENERGY="energy",t.ENERGY_STORAGE="energy_storage",t.FREQUENCY="frequency",t.IRRADIANCE="irradiance",t.MONETARY="monetary",t.POWER_FACTOR="power_factor",t.POWER="power",t.REACTIVE_POWER="reactive_power",t.TEMPERATURE="temperature",t.VOLTAGE="voltage"}(Ot||(Ot={})),function(t){t.WATT="W",t.KILO_WATT="kW",t.MEGA_WATT="MW",t.BTU_PER_HOUR="BTU/h"}(Bt||(Bt={})),function(t){t.GIGA_JOULE="GJ",t.KILO_WATT_HOUR="kWh",t.MEGA_JOULE="MJ",t.MEGA_WATT_HOUR="MWh",t.WATT_HOUR="Wh"}(Ht||(Ht={})),function(t){t.MILLIAMPERE="mA",t.AMPERE="A"}(Rt||(Rt={})),function(t){t.MILLIVOLT="mV",t.VOLT="V"}(It||(It={}));const Gt={[Ht.WATT_HOUR]:[{threshold:1e6,divisor:1e6,targetUnit:Ht.MEGA_WATT_HOUR},{threshold:1e3,divisor:1e3,targetUnit:Ht.KILO_WATT_HOUR,decimal:1}],[Ht.KILO_WATT_HOUR]:[{threshold:1e3,divisor:1e3,targetUnit:Ht.MEGA_WATT_HOUR,decimal:2}],[Ht.MEGA_WATT_HOUR]:[],[Ht.GIGA_JOULE]:[{threshold:1e3,divisor:1e3,targetUnit:Ht.MEGA_JOULE}],[Ht.MEGA_JOULE]:[],[Bt.WATT]:[{threshold:1e6,divisor:1e6,targetUnit:Bt.MEGA_WATT},{threshold:1e3,divisor:1e3,targetUnit:Bt.KILO_WATT}],[Bt.KILO_WATT]:[{threshold:1e3,divisor:1e3,targetUnit:Bt.MEGA_WATT}],[Bt.MEGA_WATT]:[],[Bt.BTU_PER_HOUR]:[]};var St="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Qt(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Ut={exports:{}};!function(t,e){var n="__lodash_hash_undefined__",r=9007199254740991,a="[object Arguments]",o="[object AsyncFunction]",i="[object Function]",s="[object GeneratorFunction]",l="[object Null]",c="[object Object]",u="[object Proxy]",d="[object Undefined]",f=/^\[object .+?Constructor\]$/,h=/^(?:0|[1-9]\d*)$/,g={};g["[object Float32Array]"]=g["[object Float64Array]"]=g["[object Int8Array]"]=g["[object Int16Array]"]=g["[object Int32Array]"]=g["[object Uint8Array]"]=g["[object Uint8ClampedArray]"]=g["[object Uint16Array]"]=g["[object Uint32Array]"]=!0,g[a]=g["[object Array]"]=g["[object ArrayBuffer]"]=g["[object Boolean]"]=g["[object DataView]"]=g["[object Date]"]=g["[object Error]"]=g[i]=g["[object Map]"]=g["[object Number]"]=g[c]=g["[object RegExp]"]=g["[object Set]"]=g["[object String]"]=g["[object WeakMap]"]=!1;var p="object"==typeof St&&St&&St.Object===Object&&St,y="object"==typeof self&&self&&self.Object===Object&&self,m=p||y||Function("return this")(),v=e&&!e.nodeType&&e,A=v&&t&&!t.nodeType&&t,w=A&&A.exports===v,b=w&&p.process,x=function(){try{var t=A&&A.require&&A.require("util").types;return t||b&&b.binding&&b.binding("util")}catch(t){}}(),P=x&&x.isTypedArray;var E,L=Array.prototype,M=Function.prototype,z=Object.prototype,N=m["__core-js_shared__"],C=M.toString,k=z.hasOwnProperty,T=(E=/[^.]+$/.exec(N&&N.keys&&N.keys.IE_PROTO||""))?"Symbol(src)_1."+E:"",j=z.toString,D=C.call(Object),O=RegExp("^"+C.call(k).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),B=w?m.Buffer:void 0,H=m.Symbol,R=m.Uint8Array;B&&B.allocUnsafe;var I,G,S=(I=Object.getPrototypeOf,G=Object,function(t){return I(G(t))}),Q=Object.create,U=z.propertyIsEnumerable,V=L.splice,Z=H?H.toStringTag:void 0,_=function(){try{var t=yt(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),W=B?B.isBuffer:void 0,X=Math.max,Y=Date.now,F=yt(m,"Map"),J=yt(Object,"create"),K=function(){function t(){}return function(e){if(!Nt(e))return{};if(Q)return Q(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();function q(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e-1},$.prototype.set=function(t,e){var n=this.__data__,r=ot(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this},tt.prototype.clear=function(){this.size=0,this.__data__={hash:new q,map:new(F||$),string:new q}},tt.prototype.delete=function(t){var e=pt(this,t).delete(t);return this.size-=e?1:0,e},tt.prototype.get=function(t){return pt(this,t).get(t)},tt.prototype.has=function(t){return pt(this,t).has(t)},tt.prototype.set=function(t,e){var n=pt(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this},et.prototype.clear=function(){this.__data__=new $,this.size=0},et.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},et.prototype.get=function(t){return this.__data__.get(t)},et.prototype.has=function(t){return this.__data__.has(t)},et.prototype.set=function(t,e){var n=this.__data__;if(n instanceof $){var r=n.__data__;if(!F||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new tt(r)}return n.set(t,e),this.size=n.size,this};var st=function(t,e,n){for(var r=-1,a=Object(t),o=n(t),i=o.length;i--;){var s=o[++r];if(!1===e(a[s],s,a))break}return t};function lt(t){return null==t?void 0===t?d:l:Z&&Z in Object(t)?function(t){var e=k.call(t,Z),n=t[Z];try{t[Z]=void 0;var r=!0}catch(t){}var a=j.call(t);r&&(e?t[Z]=n:delete t[Z]);return a}(t):function(t){return j.call(t)}(t)}function ct(t){return Ct(t)&<(t)==a}function ut(t){return!(!Nt(t)||function(t){return!!T&&T in t}(t))&&(Mt(t)?O:f).test(function(t){if(null!=t){try{return C.call(t)}catch(t){}try{return t+""}catch(t){}}return""}(t))}function dt(t){if(!Nt(t))return function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e}(t);var e=vt(t),n=[];for(var r in t)("constructor"!=r||!e&&k.call(t,r))&&n.push(r);return n}function ft(t,e,n,r,a){t!==e&&st(e,(function(o,i){if(a||(a=new et),Nt(o))!function(t,e,n,r,a,o,i){var s=At(t,n),l=At(e,n),u=i.get(l);if(u)return void rt(t,n,u);var d=o?o(s,l,n+"",t,e,i):void 0,f=void 0===d;if(f){var h=Pt(l),g=!h&&Lt(l),p=!h&&!g&&kt(l);d=l,h||g||p?Pt(s)?d=s:Ct(y=s)&&Et(y)?d=function(t,e){var n=-1,r=t.length;e||(e=Array(r));for(;++n-1&&t%1==0&&t0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(gt);function bt(t,e){return t===e||t!=t&&e!=e}var xt=ct(function(){return arguments}())?ct:function(t){return Ct(t)&&k.call(t,"callee")&&!U.call(t,"callee")},Pt=Array.isArray;function Et(t){return null!=t&&zt(t.length)&&!Mt(t)}var Lt=W||function(){return!1};function Mt(t){if(!Nt(t))return!1;var e=lt(t);return e==i||e==s||e==o||e==u}function zt(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=r}function Nt(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Ct(t){return null!=t&&"object"==typeof t}var kt=P?function(t){return function(e){return t(e)}}(P):function(t){return Ct(t)&&zt(t.length)&&!!g[lt(t)]};function Tt(t){return Et(t)?nt(t):dt(t)}var jt,Dt=(jt=function(t,e,n){ft(t,e,n)},ht((function(t,e){var n=-1,r=e.length,a=r>1?e[r-1]:void 0,o=r>2?e[2]:void 0;for(a=jt.length>3&&"function"==typeof a?(r--,a):void 0,o&&function(t,e,n){if(!Nt(n))return!1;var r=typeof e;return!!("number"==r?Et(n)&&mt(e,n.length):"string"==r&&e in n)&&bt(n[e],t)}(e[0],e[1],o)&&(a=r<3?void 0:a,r=1),t=Object(t);++n=0&&(r=parseFloat(r.toFixed(e))),n&&(r*=-1),r)}static convertValue(t,e=2){return e=Number.isNaN(e)?2:e,Math.abs(t)>=1e6?"".concat((t/1e6).toFixed(e)," MW"):Math.abs(t)>=1e3?"".concat((t/1e3).toFixed(e)," kW"):"".concat(Math.round(t)," W")}static convertValueNew(t,e="",n=2){n=isNaN(n)?2:n;const r=Number(t);if(isNaN(r))return 0;const a=Gt[e];if(!a)return"".concat(Math.round(r)," ").concat(e);if(e===Bt.WATT&&Math.abs(r)<1e3)return"".concat(Math.round(r)," ").concat(e);if(e===Bt.KILO_WATT&&Math.abs(r)<1)return"".concat(Math.round(1e3*r)," W");if(e===Bt.MEGA_WATT&&Math.abs(r)<1)return"".concat((1e3*r).toFixed(n)," kW");for(const t of a)if(Math.abs(r)>=t.threshold){const e=(r/t.divisor).toFixed(t.decimal||n);return"".concat(e," ").concat(t.targetUnit)}return"".concat(r.toFixed(n)," ").concat(e)}static handlePopup(t,e){e&&(t.preventDefault(),this._handleClick(t,{action:"more-info"},e))}static _handleClick(t,e,n){if(t&&n)if(t.stopPropagation(),"more-info"===e.action)this._dispatchMoreInfoEvent(t,n);else console.warn("Action '".concat(e.action,"' is not supported."))}static _dispatchMoreInfoEvent(t,e){if(Zt.isPopupOpen)return;Zt.isPopupOpen=!0;const n=new CustomEvent("hass-more-info",{composed:!0,detail:{entityId:e}});history.pushState({popupOpen:!0},"",window.location.href),t.target.dispatchEvent(n);const r=()=>{Zt.isPopupOpen&&(Zt.isPopupOpen=!1,window.removeEventListener("popstate",r),history.back())};window.addEventListener("popstate",r,{once:!0})}}Zt.isPopupOpen=!1;const _t="m15 13l-4 4v-3H2v-2h9V9l4 4M5 20v-4h2v2h10v-7.81l-5-4.5L7.21 10H4.22L12 3l10 9h-3v8H5Z",Wt="M15 9h1V7.5h4V9h1c.55 0 1 .45 1 1v11c0 .55-.45 1-1 1h-6c-.55 0-1-.45-1-1V10c0-.55.45-1 1-1m1 2v3h4v-3h-4m-4-5.31l-5 4.5V18h5v2H5v-8H2l10-9l2.78 2.5H14v1.67l-.24.1L12 5.69Z",Xt="M5 20v-8H2l10-9l10 9h-3v8zm7-14.31l-5 4.5V18h10v-7.81zM11.5 18v-4H9l3.5-7v4H15z",Yt="M11.6 3.45zM18.25 19.6v-7.6h2.85L11.6 3.45 2.1 12h2.85v7.6zM11.6 6.015l4.75 4.275V17.7H6.85v-7.41zM6.58 2.8v1.42L8 3.508zm-.4 2.4L5.2 6.184l1.5.5zM2.8 6.58 3.508 8l.712-1.42zM6 2.8H2.8v3.2c.228.068.468.1.708.1 1.432.004 2.596-1.16 2.6-2.6-.004-.236-.04-.472-.108-.7M12.5 3.844l2.25 2.026.5-.5-2.24-2.04zM17.71 8.53 18.2 8.04 15.76 5.84 15.26 6.34ZM20.52 11.09l.48-.49-2.31-2.14-.5.5z M18.1299 5.1169 17.318 4.6482l2.4492-1.6171-.75 1.299.8119.4687-2.4492 1.6171z",Ft="M35 887 l-27 -23 0 -404 0 -404 27 -23 c26 -23 28 -23 329 -23 284 0 305 1 327 19 l24 19 0 412 0 412 -24 19 c-22 18 -43 19 -327 19 -301 0 -303 0 -329 -23z m585 -157 l0 -80 -255 0 -255 0 0 80 0 80 255 0 255 0 0 -80z m-242 -229 c44 -34 40 -46 -14 -46 -60 0 -97 -38 -93 -94 5 -64 -23 -80 -35 -20 -9 44 24 113 63 134 35 18 34 15 21 50 -11 29 -14 30 58 -24z m110 -129 c4 -51 -19 -97 -59 -117 -27 -14 -30 -20 -23 -48 l6 -31 -51 43 c-29 24 -49 46 -46 49 3 4 23 5 44 3 58 -4 95 32 97 95 3 60 1 57 17 52 6 -3 13 -23 15 -46z",Jt="M15 1H9v2h6V1zm-4 13h2V8h-2v6zm8.03-6.61l1.42-1.42c-.43-.51-.9-.99-1.41-1.41l-1.42 1.42A8.962 8.962 0 0 0 12 4c-4.97 0-9 4.03-9 9s4.02 9 9 9a8.994 8.994 0 0 0 7.03-14.61zM12 20c-3.87 0-7-3.13-7-7s3.13-7 7-7s7 3.13 7 7s-3.13 7-7 7z",Kt="m19.95 17.15l-1.5-1.5q.275-.675.413-1.337T19 13q0-2.9-2.05-4.95T12 6q-.6 0-1.275.125t-1.4.4l-1.5-1.5q.95-.5 2.012-.763T12 4q1.5 0 2.938.5t2.712 1.45l1.4-1.4l1.4 1.4l-1.4 1.4q.95 1.275 1.45 2.713T21 13q0 1.05-.263 2.087t-.787 2.063ZM13 10.2V8h-2v.2l2 2Zm6.8 12.4l-2.4-2.4q-1.2.875-2.588 1.338T12 22q-1.85 0-3.488-.713T5.65 19.35q-1.225-1.225-1.938-2.863T3 13q0-1.5.463-2.888T4.8 7.6L1.4 4.2l1.4-1.4l18.4 18.4l-1.4 1.4ZM12 20q1.05 0 2.05-.325t1.875-.925L6.2 9.025q-.6.875-.9 1.875T5 13q0 2.9 2.05 4.95T12 20ZM9 3V1h6v2H9Zm2.075 10.875Zm2.825-2.8Z",qt="m5.18 5.45l-1.78-.9L4.66 2h8.47l1.27 2.55l-1.78.89L11.9 4h-6l-.72 1.45M15.5 8H11l-.8-3H7.6l-.79 3H2.28L1 10.55l1.79.89L3.5 10h10.78l.72 1.45l1.79-.89L15.5 8m-.83 14H12.6l-.24-.9l-3.46-5.2l-3.47 5.2l-.23.9H3.13L6 11h2.09l-.36 1.35L8.9 14.1l1.16-1.75L9.71 11h2.07l2.89 11M8.3 15l-.9-1.35l-1.18 4.48L8.3 15m3.28 3.12l-1.18-4.48L9.5 15l2.08 3.12M23 16l-4-4v3h-4v2h4v3l4-4Z",$t="M 26 16 L 22 12 L 22 15 L 18 15 L 18 17 L 22 17 L 22 20 L 26 16 Z M 22.1 21.5 L 2.4 1.7 L 1.1 3 L 6.1 8 L 5.4 8 L 4.1 10.5 L 5.9 11.4 L 6.6 10 L 8.1 10 L 9.1 11 L 6.2 22 L 8.3 22 L 8.5 21.1 L 12 15.9 L 15.5 21.1 L 15.7 22 L 17.8 22 L 17 18.8 L 20.9 22.7 L 22.1 21.5 M 9.3 18.1 L 10.5 13.6 L 11.4 14.9 L 9.3 18.1 M 14.7 18.1 L 12.6 15 L 12.8 14.7 L 14.1 16 L 14.7 18.1 M 14.2 11 L 14.9 11 L 15.1 11.9 L 14.2 11 M 14.1 8 L 18.6 8 L 19.9 10.6 L 18.1 11.5 L 17.4 10 L 13.2 10 L 10.2 7 L 10.7 5 L 13.3 5 L 14.1 8 M 8.4 5.2 L 6.9 3.7 L 7.8 2 L 16.3 2 L 17.6 4.5 L 15.8 5.4 L 15 4 L 9 4 L 8.4 5.2 Z",te="M15.95 21.175L13.1 18.35l1.425-1.4l1.425 1.4l3.525-3.525l1.425 1.4l-4.95 4.95ZM8 22q-.425 0-.713-.288T7 21V5q0-.425.288-.713T8 4h2V2h4v2h2q.425 0 .713.288T17 5v7q-.525 0-1.025.088T15 12.35V6H9v14h2.35q.2.575.488 1.075t.687.925H8Zm1-2h2.35H11h.35H9Z",ee="m15 13l-4 4v-3H2v-2h9V9l4 4M5 20v-4h2v2h10v-7.81l-5-4.5L7.21 10H4.22L12 3l10 9h-3v8H5Z",ne="M11.5 19h1v-1.85l3.5-3.5V9H8v4.65l3.5 3.5V19Zm-2 2v-3L6 14.5V9q0-.825.588-1.413T8 7h1L8 8V3h2v4h4V3h2v5l-1-1h1q.825 0 1.413.588T18 9v5.5L14.5 18v3h-5Zm2.5-7Z",re="M10 3H8v1.88l2 2zm6 6v3.88l1.8 1.8l.2-.2V9c0-1.1-.9-2-2-2V3h-2v4h-3.88l2 2H16zM4.12 3.84L2.71 5.25L6 8.54v5.96L9.5 18v3h5v-3l.48-.48l4.47 4.47l1.41-1.41L4.12 3.84zm8.38 13.33V19h-1v-1.83L8 13.65v-3.11l5.57 5.57l-1.07 1.06z",ae="m5.39 5.45-1.78-.9L4.87 2h8.47l1.27 2.55-1.78.89L12.11 4h-6zM15.73 8H11.2l-.79-3h-2.6L7 8H2.5l-1.29 2.55 1.79.89.73-1.44H14.5l.71 1.45 1.79-.89zm-.85 14h-2.07l-.24-.9-3.46-5.2-3.47 5.2-.23.9H3.34l2.89-11h2.07l-.36 1.35 1.17 1.75 1.16-1.75-.35-1.35H12zm-6.38-7-.89-1.35-1.18 4.48zm3.29 3.12-1.18-4.48-.9 1.36zM15 16l4-4v3H23v2h-4v3z",oe="M22.1 21.5L2.4 1.7L1.1 3l5 5h-.7l-1.3 2.5l1.8.9l.7-1.4h1.5l1 1l-2.9 11h2.1l.2-.9l3.5-5.2l3.5 5.2l.2.9h2.1l-.8-3.2l3.9 3.9l1.2-1.2M9.3 18.1l1.2-4.5l.9 1.3l-2.1 3.2m5.4 0L12.6 15l.2-.3l1.3 1.3l.6 2.1m-.5-7.1h.7l.2.9l-.9-.9m-.1-3h4.5l1.3 2.6l-1.8.9l-.7-1.5h-4.2l-3-3l.5-2h2.6l.8 3M8.4 5.2L6.9 3.7L7.8 2h8.5l1.3 2.5l-1.8.9L15 4H9l-.6 1.2Z",ie="m8.28 5.45l-1.78-.9L7.76 2h8.47l1.27 2.55l-1.78.89L15 4H9l-.72 1.45M18.62 8h-4.53l-.79-3h-2.6l-.79 3H5.38L4.1 10.55l1.79.89l.73-1.44h10.76l.72 1.45l1.79-.89L18.62 8m-.85 14H15.7l-.24-.9L12 15.9l-3.47 5.2l-.23.9H6.23l2.89-11h2.07l-.36 1.35L12 14.1l1.16-1.75l-.35-1.35h2.07l2.89 11m-6.37-7l-.9-1.35l-1.18 4.48L11.4 15m3.28 3.12l-1.18-4.48l-.9 1.36l2.08 3.12Z",se="M11.45 2v3.55L15 3.77L11.45 2m-1 6L8 10.46l3.75 1.25L10.45 8M2 11.45L3.77 15l1.78-3.55H2M10 2H2v8c.57.17 1.17.25 1.77.25c3.58.01 6.49-2.9 6.5-6.5c-.01-.59-.1-1.18-.27-1.75m7 20v-6h-3l5-9v6h3l-5 9Z";var le,ce,ue,de,fe,he,ge,pe,ye,me,ve,Ae,we,be,xe,Pe,Ee,Le,Me,ze,Ne,Ce,ke,Te,je,De,Oe,Be,He,Re,Ie,Ge,Se,Qe,Ue,Ve,Ze,_e,We,Xe,Ye,Fe,Je,Ke,qe,$e,tn,en,nn,rn,an,on,sn,ln,cn,un,dn,fn,hn,gn,pn,yn,mn,vn,An,wn,bn,xn,Pn,En,Ln,Mn,zn,Nn,Cn,kn,Tn,jn,Dn,On,Bn,Hn,Rn,In,Gn,Sn,Qn,Un,Vn,Zn,_n,Wn,Xn,Yn,Fn,Jn,Kn,qn,$n,tr,er,nr,rr,ar,or,ir,sr,lr,cr,ur,dr,fr,hr;class gr{static generateDailyLoadName(t){return V(le||(le=ht(['\n\t\t\t\n\t\t\t\t',"\n\t\t\t"])),[2,3,4,5,6,7,8].includes(t.additionalLoad)?this.LOAD_X-35:this.LOAD_X+12,[2,3,4,5,6,7,8].includes(t.additionalLoad)?"189":"282.1",t.loadShowDaily?"".concat(t.loadColour):"transparent",Et("common.daily_load"))}static generateDailyLoadValue(t,e){return V(ce||(ce=ht(['\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t',"\n\t\t\t\t\n\t\t\t\n\t\t"])),(t=>Zt.handlePopup(t,e.entities.day_load_energy_84)),[2,3,4,5,6,7,8].includes(t.additionalLoad)?this.LOAD_X-35:this.LOAD_X+12,[2,3,4,5,6,7,8].includes(t.additionalLoad)?"175":"267.9",t.loadShowDaily&&t.stateDayLoadEnergy.isValid()?"":"none",t.loadColour,t.stateDayLoadEnergy?.toPowerString(!0,t.decimalPlacesEnergy))}static generateFlowLines(t,e){const n=this.LOAD_X+3-264.7-70,r=264.7+n/2,a=r+70,o=a+n/2,i="M ".concat(264.7," 218.5 L ").concat(r," 218.5"),s="M ".concat(a," 218.5 L ").concat(o," 218.5");return V(ue||(ue=ht(['\n\t\t\t \n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t'])),i,e.load.dynamic_colour?t.flowColour:t.loadColour,t.loadLineWidth,Math.min(2+t.loadLineWidth+Math.max(t.minLineWidth-2,0),8),0===t.essentialPower?"transparent":"".concat(e.load.dynamic_colour?t.flowColour:t.loadColour),t.durationCur.load,s,e.load.dynamic_colour?t.flowColour:t.loadColour,t.loadLineWidth,Math.min(2+t.loadLineWidth+Math.max(t.minLineWidth-2,0),8),0===t.essentialPower?"transparent":"".concat(e.load.dynamic_colour?t.flowColour:t.loadColour),t.durationCur.load)}static generatePowers(t,e){const n=400+(this.LOAD_X-400)/2-30;return V(de||(de=ht(['\n\t\t\t\n\t\t\t\t','\n\t\t\t\n\t\t\t\n\t\t\t\t','\n\t\t\t\n\t\t\t\n\t\t\t\t',"\n\t\t\t\n\t\t"])),n,e.inverter.three_phase&&e.entities?.load_power_L1?"":"none",t.loadColour,e.load.auto_scale?"".concat(Zt.convertValue(t.loadPowerL1,t.decimalPlaces)||0):"".concat(t.loadPowerL1||0," ").concat(Bt.WATT),n,e.inverter.three_phase&&e.entities?.load_power_L2?"":"none",t.loadColour,e.load.auto_scale?"".concat(Zt.convertValue(t.loadPowerL2,t.decimalPlaces)||0):"".concat(t.loadPowerL2||0," ").concat(Bt.WATT),n,e.inverter.three_phase&&e.entities?.load_power_L3?"":"none",t.loadColour,e.load.auto_scale?"".concat(Zt.convertValue(t.loadPowerL3,t.decimalPlaces)||0):"".concat(t.loadPowerL3||0," ").concat(Bt.WATT))}static generateShapes(t){const e=400+(this.LOAD_X-400)/2-101.3;return V(fe||(fe=ht(['\n\t\t\t\n\t\t'])),e,t.loadColour)}static generateTotalLoad(t,e){const n=400+(this.LOAD_X-400)/2-65.3;return V(he||(he=ht(["\n\t\t\t","\n\t\t"])),e.entities?.essential_power&&"none"!==e.entities.essential_power?V(ge||(ge=ht(['\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t',"\n\t\t\t\t\t\n\t\t\t\t"])),(t=>Zt.handlePopup(t,e.entities.essential_power)),n,!0!==t.largeFont?"st14":"st4",t.loadColour,e.load.auto_scale?"".concat(Zt.convertValue(t.essentialPower,t.decimalPlaces)||0):"".concat(t.essentialPower||0," ").concat(Bt.WATT)):V(pe||(pe=ht(['\n\t\t\t\t\n\t\t\t\t\t',"\n\t\t\t\t"])),n,!0!==t.largeFont?"st14":"st4",t.loadColour,e.load.auto_scale?"".concat(Zt.convertValue(t.essentialPower,t.decimalPlaces)||0):"".concat(t.essentialPower||0," ").concat(Bt.WATT)))}static generateIcon(t,e){return V(ye||(ye=ht(['\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t'])),1===t.essIconSize?this.LOAD_X+5:this.LOAD_X+2,1===t.essIconSize?"186":"177.5",1===t.essIconSize?"75":"79",1===t.essIconSize?"75":"79",t.gridPercentage>0?t.gridColour:t.batteryPercentage>0?t.batteryColour:t.solarColour,t.gridPercentage,t.gridPercentage>0?t.gridColour:t.batteryPercentage>0?t.batteryColour:t.solarColour,t.gridPercentage,t.batteryPercentage>0?t.batteryColour:t.solarColour,t.gridPercentage+t.batteryPercentage,t.batteryPercentage>0?t.batteryColour:t.solarColour,t.gridPercentage+t.batteryPercentage,t.solarColour,t.solarColour,e.load.dynamic_colour?"url(#Lg)":t.loadColour,t.essIcon)}}gr.LOAD_X=410;class pr{static generateLines(t){const e=this.mainX+42,n="M ".concat(e," 190 L ").concat(e," 147"),r="M ".concat(e," 190 L ").concat(e," 147"),a="M ".concat(e," 280 L ").concat(e," 247"),o="M ".concat(e," 360 L ").concat(e," 323"),i="M ".concat(e," 110 L ").concat(e," 73");return V(me||(me=ht(['\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t'])),n,1===t.additionalLoad?"":"st12",t.loadColour,r,[2,3,4,5,6,7,8].includes(t.additionalLoad)?"":"st12",t.loadColour,a,[2,3,4,5,6,7,8].includes(t.additionalLoad)?"":"st12",t.loadColour,o,[5,6,7,8].includes(t.additionalLoad)?"":"st12",t.loadColour,i,[7,8].includes(t.additionalLoad)?"":"st12",t.loadColour)}static generateLoad1(t,e){const n=this.mainX+11,r=this.mainX-29,a=this.mainX,o=this.mainX+39,i=this.mainX+45,s=this.mainX+42,l=this.mainX+23,c=this.mainX+39,u=this.mainX+45,d=this.getIcon([1,2,3].includes(t.additionalLoad),r,114,t.iconEssentialLoad1,"essload1-icon",36),f=this.getIconLink(e.entities.essential_load1_toggle,d),h=this.getIcon(t.additionalLoad>=4,n,81,t.iconEssentialLoad1,"essload1_small-icon"),g=this.getIconLink(e.entities.essential_load1_toggle,h);return V(ve||(ve=ht(["",""])),t.additionalLoad>=1?V(Ae||(Ae=ht(["\n\t\t\t","\n\t\t\t",'\n\t\t\t\n\t\t\t\n\t\t\t\t\t\t\n\t\t\t','\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t','\n\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t',"\n\t\t\t\t\t",'\n\t\t\t\t\n\t\t\t\n\n\t\t\t\n\t\t\t\n\t\t\t\t','\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t','\n\t\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t',"\n\t\t\t\t\t","\n\t\t\t\t\n\t\t\t"])),f,g,a,t.dynamicColourEssentialLoad1,[1,2,3].includes(t.additionalLoad)?"":"none",i,[1,2,3].includes(t.additionalLoad)?"":"none",t.dynamicColourEssentialLoad1,e.load?.load1_name?"".concat(e.load.load1_name):"",(t=>Zt.handlePopup(t,e.entities.essential_load1)),s,[1,2,3].includes(t.additionalLoad)&&t.stateEssentialLoad1.isValid()?"":"none",!0!==t.largeFont?"st14":"st4",t.dynamicColourEssentialLoad1,t.stateEssentialLoad1?.toPowerString(e.load.auto_scale,t.decimalPlaces),(t=>Zt.handlePopup(t,e.entities.essential_load1_extra)),u,e.entities?.essential_load1_extra&&[1,2,3].includes(t.additionalLoad)&&t.stateEssentialLoad1Extra.isValid()?"":"none",t.dynamicColourEssentialLoad1,t.stateEssentialLoad1Extra.toNum(1),t.stateEssentialLoad1Extra.getUOM(),a,t.dynamicColourEssentialLoad1,t.additionalLoad>=4?"":"none",o,t.additionalLoad>=4?"":"none",t.dynamicColourEssentialLoad1,e.load?.load1_name?"".concat(e.load.load1_name):"",(t=>Zt.handlePopup(t,e.entities.essential_load1)),l,t.additionalLoad>=4&&t.stateEssentialLoad1.isValid()?"":"none",t.dynamicColourEssentialLoad1,t.stateEssentialLoad1?.toPowerString(e.load.auto_scale,t.decimalPlaces),(t=>Zt.handlePopup(t,e.entities.essential_load1_extra)),c,e.entities?.essential_load1_extra&&t.additionalLoad>=4&&t.stateEssentialLoad1Extra.isValid()?"":"none",t.dynamicColourEssentialLoad1,t.stateEssentialLoad1Extra.toNum(1),t.stateEssentialLoad1Extra.getUOM()):V(we||(we=ht([""]))))}static generateLoad2(t,e){const n=this.mainX+11,r=this.mainX+53,a=this.mainX-29,o=this.mainX,i=this.mainX+43,s=this.mainX+39,l=this.mainX+45,c=this.mainX+42,u=this.mainX+23,d=this.mainX+63,f=this.mainX+39,h=this.mainX+45,g=this.getIcon(2===t.additionalLoad,a,278,t.iconEssentialLoad2,"essload2-icon",36),p=this.getIconLink(e.entities.essential_load2_toggle,g),y=this.getIcon(3===t.additionalLoad,n,254,t.iconEssentialLoad2,"essload2_small-icon"),m=this.getIconLink(e.entities.essential_load2_toggle,y),v=this.getIcon(t.additionalLoad>=4,r,81,t.iconEssentialLoad2,"essload2_small-icon"),A=this.getIconLink(e.entities.essential_load2_toggle,v);return V(be||(be=ht(["",""])),t.additionalLoad>=4?V(xe||(xe=ht(["\n\t\t\t",""])),this.generateEssentialLoad(2,A,t.dynamicColourEssentialLoad2,i,107,e.load?.load2_name,l,136,t.stateEssentialLoad2,d,118,t.stateEssentialLoad2Extra,h,147,"left-align",e.load.auto_scale,t.decimalPlaces)):V(Pe||(Pe=ht(["",""])),3===t.additionalLoad?V(Ee||(Ee=ht(["\n\t\t\t",""])),this.generateEssentialLoad(2,m,t.dynamicColourEssentialLoad2,o,280,e.load?.load2_name,s,310,t.stateEssentialLoad2,u,291,t.stateEssentialLoad2Extra,f,322,"right-align",e.load.auto_scale,t.decimalPlaces)):V(Le||(Le=ht(["",""])),2===t.additionalLoad?V(Me||(Me=ht(["\n\t\t\t\t\t\t",'\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t','\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t','\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t',"\n\t\t\t\t\t\t\t\t","\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t"])),p,o,t.dynamicColourEssentialLoad2,2===t.additionalLoad?"":"none",l,2===t.additionalLoad?"":"none",t.dynamicColourEssentialLoad2,e.load?.load2_name?"".concat(e.load.load2_name):"",(t=>Zt.handlePopup(t,e.entities.essential_load2)),c,2===t.additionalLoad&&t.stateEssentialLoad2.isValid()?"":"none",!0!==t.largeFont?"st14":"st4",t.dynamicColourEssentialLoad2,t.stateEssentialLoad2?.toPowerString(e.load.auto_scale,t.decimalPlaces),(t=>Zt.handlePopup(t,e.entities.essential_load2_extra)),h,e.entities?.essential_load2_extra&&2===t.additionalLoad&&t.stateEssentialLoad2Extra.isValid()?"":"none",t.dynamicColourEssentialLoad2,t.stateEssentialLoad2Extra.toNum(1),t.stateEssentialLoad2Extra.getUOM()):V(ze||(ze=ht([""]))))))}static generateLoad3(t,e){const n=this.mainX+11,r=this.mainX+53,a=this.mainX,o=this.mainX+43,i=this.mainX+39,s=this.mainX+45,l=this.mainX+23,c=this.mainX+63,u=this.mainX+39,d=this.mainX+45,f=this.getIcon2(r,254,t.iconEssentialLoad3,"essload3_small-icon"),h=this.getIconLink(e.entities.essential_load3_toggle,f),g=this.getIcon2(n,254,t.iconEssentialLoad3,"essload3_small-icon"),p=this.getIconLink(e.entities.essential_load3_toggle,g);return V(Ne||(Ne=ht(["",""])),3===t.additionalLoad?V(Ce||(Ce=ht(["\n\t\t\t\t",""])),this.generateEssentialLoad(3,h,t.dynamicColourEssentialLoad3,o,280,e.load?.load3_name,s,310,t.stateEssentialLoad3,c,291,t.stateEssentialLoad3Extra,d,322,"left-align",e.load.auto_scale,t.decimalPlaces)):V(ke||(ke=ht(["",""])),t.additionalLoad>=4?V(Te||(Te=ht(["\n\t\t\t\t",""])),this.generateEssentialLoad(3,p,t.dynamicColourEssentialLoad3,a,280,e.load?.load3_name,i,310,t.stateEssentialLoad3,l,291,t.stateEssentialLoad3Extra,u,322,"right-align",e.load.auto_scale,t.decimalPlaces)):V(je||(je=ht([""])))))}static generateLoad4(t,e){const n=this.mainX+53,r=this.mainX+43,a=this.mainX+45,o=this.mainX+63,i=this.mainX+45,s=this.getIcon2(n,254,t.iconEssentialLoad4,"essload4_small-icon"),l=this.getIconLink(e.entities.essential_load4_toggle,s);return V(De||(De=ht(["",""])),t.additionalLoad>=4?V(Oe||(Oe=ht(["\n\t\t\t",""])),this.generateEssentialLoad(4,l,t.dynamicColourEssentialLoad4,r,280,e.load?.load4_name,a,310,t.stateEssentialLoad4,o,291,t.stateEssentialLoad4Extra,i,322,"left-align",e.load.auto_scale,t.decimalPlaces)):V(Be||(Be=ht([""]))))}static generateLoad5(t,e){const n=this.mainX+11,r=this.mainX,a=this.mainX+39,o=this.mainX+23,i=this.mainX+39,s=this.getIcon2(n,335,t.iconEssentialLoad5,"essload5_small-icon"),l=this.getIconLink(e.entities.essential_load5_toggle,s);return V(He||(He=ht(["",""])),t.additionalLoad>=5?V(Re||(Re=ht(["\n\t\t\t",""])),this.generateEssentialLoad(5,l,t.dynamicColourEssentialLoad5,r,362,e.load?.load5_name,a,390,t.stateEssentialLoad5,o,372,t.stateEssentialLoad5Extra,i,402,"right-align",e.load.auto_scale,t.decimalPlaces)):V(Ie||(Ie=ht([""]))))}static generateLoad6(t,e){const n=this.mainX+53,r=this.mainX+43,a=this.mainX+45,o=this.mainX+63,i=this.mainX+45,s=this.getIcon2(n,335,t.iconEssentialLoad6,"essload6_small-icon"),l=this.getIconLink(e.entities.essential_load6_toggle,s);return V(Ge||(Ge=ht(["",""])),t.additionalLoad>=6?V(Se||(Se=ht(["\n\t\t\t",""])),this.generateEssentialLoad(6,l,t.dynamicColourEssentialLoad6,r,362,e.load?.load6_name,a,390,t.stateEssentialLoad6,o,372,t.stateEssentialLoad6Extra,i,402,"left-align",e.load.auto_scale,t.decimalPlaces)):V(Qe||(Qe=ht([""]))))}static generateLoad7(t,e){const n=this.mainX+11,r=this.mainX,a=this.mainX+39,o=this.mainX+23,i=this.mainX+39,s=this.getIcon(t.additionalLoad>=7,n,7,t.iconEssentialLoad7,"essload7_small-icon"),l=this.getIconLink(e.entities.essential_load7_toggle,s);return V(Ue||(Ue=ht(["",""])),t.additionalLoad>=7?V(Ve||(Ve=ht(["\n\t\t\t",""])),this.generateEssentialLoad(7,l,t.dynamicColourEssentialLoad7,r,31,e.load?.load7_name,a,60,t.stateEssentialLoad7,o,42,t.stateEssentialLoad7Extra,i,72,"right-align",e.load.auto_scale,t.decimalPlaces)):V(Ze||(Ze=ht([""]))))}static generateLoad8(t,e){const n=this.mainX+53,r=this.mainX+43,a=this.mainX+45,o=this.mainX+63,i=this.mainX+45,s=this.getIcon2(n,7,t.iconEssentialLoad8,"essload8_small-icon"),l=this.getIconLink(e.entities.essential_load8_toggle,s);return V(_e||(_e=ht(["",""])),t.additionalLoad>=8?V(We||(We=ht(["\n\t\t\t",""])),this.generateEssentialLoad(8,l,t.dynamicColourEssentialLoad8,r,31,e.load?.load8_name,a,60,t.stateEssentialLoad8,o,42,t.stateEssentialLoad8Extra,i,72,"left-align",e.load.auto_scale,t.decimalPlaces)):V(Xe||(Xe=ht([""]))))}static getIcon(t,e,n,r,a,o=30){return V(Ye||(Ye=ht(['\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t
'])),t?"":"none",e,n,o,o,r,a)}static getIcon2(t,e,n,r,a=30){return V(Fe||(Fe=ht(['\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t
'])),t,e,a,a,n,r)}static getIconLink(t,e){return V(Je||(Je=ht(["\n\t\t","\n\t\t"])),t?V(Ke||(Ke=ht(['\n\t\t\t\n\t\t\t\t','\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t','\n\t\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t',"\n\t\t\t\t\t","\n\t\t\t\t\n\t\t\t"])),e,t,r,a,n,t,i,s,g,n,o?"".concat(o):"",(t=>Zt.handlePopup(t,l.entity_id)),t,c,u,l.isValid()?"":"none",n,l?.toPowerString(p,y),(t=>Zt.handlePopup(t,d.entity_id)),t,f,h,d.entity_id&&d.isValid()?"":"none",g,n,d.toNum(1),d.getUOM())}}pr.mainX=gr.LOAD_X;class yr{static getTexts(t){const e=this.mainX,n=this.mainX+46;return V(tn||(tn=ht(['\n\t\t\t','%\n\t\t\t\n\t\t\t','%\n\t\t\t\n\t\t\t','%\n\t\t\t\n\t\t\t','%\n\t\t\t\n\t\t\t','%\n\t\t\t\n\t\t\t','%\n\t\t\t\n\t\t\t\n\t\t\t','\n\t\t\t\n\t\t\t\n\t\t\t',"\n\t\t\t \n "])),e,t.enableAutarky===mt.No?"none":"",t.enableAutarky===mt.Energy?"st4 st8 left-align":"st12",t.inverterColour,t.autarkyEnergy,n,t.enableAutarky===mt.No?"none":"",t.enableAutarky===mt.Energy?"st4 st8 left-align":"st12",t.inverterColour,t.ratioEnergy,e,t.enableAutarky===mt.No?"none":"",t.enableAutarky===mt.Power?"st4 st8 left-align":"st12",t.inverterColour,t.autarkyPower,n,t.enableAutarky===mt.No?"none":"",t.enableAutarky===mt.Power?"st4 st8 left-align":"st12",t.inverterColour,t.ratioPower,e,t.enableAutarky===mt.No?"none":"",t.enableAutarky===mt.AutoSelf?"st4 st8 left-align":"st12",t.inverterColour,t.autarkyAuto,n,t.enableAutarky===mt.No?"none":"",t.enableAutarky===mt.AutoSelf?"st4 st8 left-align":"st12",t.inverterColour,t.autarkySelf,e,t.enableAutarky===mt.No?"none":"",t.inverterColour,t.enableAutarky===mt.AutoSelf?Et("common.autarkyAuto"):Et("common.autarky"),n,t.enableAutarky===mt.No?"none":"",t.inverterColour,t.enableAutarky===mt.AutoSelf?Et("common.autarkySelf"):Et("common.ratio"))}}yr.mainX=127;class mr{static getStyle(t){return U(en||(en=ht(["\n\t\t\t"])),t.dynamicColourEssentialLoad1,t.dynamicColourEssentialLoad2,t.dynamicColourEssentialLoad1,t.dynamicColourEssentialLoad2,t.dynamicColourEssentialLoad3,t.dynamicColourEssentialLoad4,t.dynamicColourEssentialLoad5,t.dynamicColourEssentialLoad6,t.dynamicColourEssentialLoad7,t.dynamicColourEssentialLoad8,t.customGridIconColour)}}class vr{static set decimalPlacesEnergy(t){this._decimalPlacesEnergy=t}static set solarColour(t){this._solarColour=t}static get solarColour(){return this._solarColour}static get decimalPlacesEnergy(){return this._decimalPlacesEnergy}static get decimalPlaces(){return this._decimalPlaces}static set decimalPlaces(t){this._decimalPlaces=t}static generateSolarPower(t,e){return V(nn||(nn=ht(['\n\t\t\t\n\t\t\t\t \n\t\t\t\t \n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t \n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t',"%\n\t\t\t\n\t\t\t","\n\t\t"])),e.solar.visualize_efficiency?"url(#SlG)":t.solarColour,1===e.solar.mppts?"none":"",e.show_solar?"":"st12",0===t.totalPVEfficiency?"grey":t.solarColour,t.totalPVEfficiency,0===t.totalPVEfficiency?"grey":t.solarColour,t.totalPVEfficiency,t.totalPVEfficiency<100?"grey":t.solarColour,t.totalPVEfficiency<100?"grey":t.solarColour,e.show_solar&&1!==e.solar.mppts?"":"st12",t.solarColour,t.solarLineWidth,Math.min(2+t.solarLineWidth+Math.max(t.minLineWidth-2,0),8),e.show_solar&&1!==e.solar.mppts?"":"st12",0===t.totalPV?"transparent":"".concat(t.solarColour),t.durationCur.solar,e.solar.show_mppt_efficiency?"st3 st8":"st12",1===e.solar.mppts?"none":"",t.solarColour,t.totalPVEfficiency,e.entities?.pv_total?V(rn||(rn=ht(['\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t',"\n\t\t\t\t\n\t\t\t"])),(t=>Zt.handlePopup(t,e.entities.pv_total)),!0!==t.largeFont?"st14":"st4",e.show_solar&&1!==e.solar.mppts&&t.statePVTotal.isValid()?"":"none",t.solarColour,e.solar.auto_scale?e.entities?.pv_total?Zt.convertValueNew(t.totalPV,t.statePVTotal.getUOM(),t.decimalPlaces):Zt.convertValue(t.totalPV,t.decimalPlaces)||0:"".concat(Zt.toNum(t.totalPV||0,0)," ").concat(Bt.WATT)):V(an||(an=ht(['\n\t\t\t\t\n\t\t\t\t\t',"\n\t\t\t\t"])),!0!==t.largeFont?"st14":"st4",e.show_solar&&1!==e.solar.mppts&&t.statePVTotal.isValid()?"":"none",t.solarColour,e.solar.auto_scale?e.entities?.pv_total?Zt.convertValueNew(t.totalPV,t.statePVTotal.getUOM(),t.decimalPlaces):Zt.convertValue(t.totalPV,t.decimalPlaces)||0:"".concat(Zt.toNum(t.totalPV||0,0)," ").concat(Bt.WATT)))}static generateSolarHeader(t,e){let n,r=V(on||(on=ht([""]))),a=V(sn||(sn=ht([""]))),o=V(ln||(ln=ht([""]))),i=V(cn||(cn=ht([""]))),s=V(un||(un=ht([""]))),l=this.countGenerationElements(t);if(0==l)return V(dn||(dn=ht([""])));n=this.setStartPosition(l),t.stateRemainingSolar.isValid()&&(s=this.getProduction("remaining_solar",t.stateRemainingSolar,n)),t.stateTotalSolarGeneration.isValid()&&(i=this.getProduction("total_solar_generation",t.stateTotalSolarGeneration,n)),t.stateYearlyPVEnergy.isValid()&&(o=this.getProduction("yearly_solar",t.stateYearlyPVEnergy,n)),t.stateMonthlyPVEnergy.isValid()&&(a=this.getProduction("monthly_solar",t.stateMonthlyPVEnergy,n)),t.stateDailyPVEnergy.isValid()&&(r=this.getProduction("daily_solar",t.stateDailyPVEnergy,n)),n.x-=2+n.gap/2;const c=V(fn||(fn=ht(['\n\t\t\t\n\t\t\t\t\n\t\t\t'])),n.x,t.solarColour,se),u=V(hn||(hn=ht(['\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t',"°\n\t\t\t\t\t\n\t\t\t\t"])),(t=>Zt.handlePopup(t,e.entities.environment_temp)),n.x,e.entities?.environment_temp?"st3 left-align":"st12",t.solarColour,t.stateEnvironmentTemp.isValid()?"":"none",t.stateEnvironmentTemp.toNum(1));return V(gn||(gn=ht(["\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n\t\t"])),c,u,r,a,o,i,s)}static setStartPosition(t){switch(t){case 1:return{x:260,gap:0};case 2:return{x:330,gap:0};default:return{x:400,gap:0}}}static countGenerationElements(t){let e=0;return t.stateRemainingSolar.isValid()&&e++,t.stateTotalSolarGeneration.isValid()&&e++,t.stateYearlyPVEnergy.isValid()&&e++,t.stateMonthlyPVEnergy.isValid()&&e++,t.stateDailyPVEnergy.isValid()&&e++,e++}static getProduction(t,e,n){const r=n.x,a=e?.toPowerString(!0,this.decimalPlacesEnergy)||"0",o=Et("common."+t),i=this.getTextWidth(a,"16px Roboto"),s=this.getTextWidth(o,"9px Roboto");return n.gap=Math.max(s,i),n.x-=n.gap+8,V(pn||(pn=ht(['\n \n\t\t\t\t\n\t\t\t\t\t','\n\t\t\t\t\n\t\t\t\n \n ',"\n "])),(t=>Zt.handlePopup(t,e.entity_id)),t,r-n.gap/2,this.solarColour,a,t,r-n.gap/2,this.solarColour,o)}static getTextWidth(t,e){const n=document.createElement("canvas").getContext("2d");let r=0;return null!==n&&(n.font=e,r=Math.round(n.measureText(t)?.width)),r}static getPositions(t,e){switch(t){case 1:switch(e){case 1:return[205,"M 239.23 84 L 239 190",230,244.7,238.8,230,"right-align"];case 2:return[158,"M 193 84 L 193 122 Q 193 132 201 132 L 205 132.03",188,198,192,188,"right-align"];case 3:case 4:return[82,"M 117 84 L 117 125 Q 117 132 124 132 L 205 132.03",113,121,116,113,"right-align"];case 5:return[4,"M 39 84 L 39 125 Q 39 132 46 132 L 205 132.03",35,44,38,35,"right-align"]}break;case 2:switch(e){case 2:return[254,"M 289 84.5 L 289 125 Q 289 132 282 132 L 275 132",281,296,289.5,296,"left-align"];case 3:case 4:return[158,"M 193 84 L 193 122 Q 193 132 201 132 L 205 132.03",188,198,192,188,"right-align"];case 5:return[82,"M 117 84 L 117 125 Q 117 132 124 132 L 205 132.03",113,121,116,113,"right-align"]}break;case 3:switch(e){case 3:case 4:return[254,"M 289 84.5 L 289 125 Q 289 132 282 132 L 275 132",281,296,289.5,296,"left-align"];case 5:return[158,"M 193 84 L 193 122 Q 193 132 201 132 L 205 132.03",188,198,192,188,"right-align"]}break;case 4:switch(e){case 4:return[330,"M 365 85 L 365 125 Q 365 132 358 132 L 275 132",357,372,366,372,"left-align"];case 5:return[254,"M 289 84.5 L 289 125 Q 289 132 282 132 L 275 132",281,296,289.5,296,"left-align"]}break;case 5:return[330,"M 365 85 L 365 125 Q 365 132 358 132 L 275 132",357,372,366,372,"left-align"]}return[]}static generateMppt1(t,e){const n=this.getPositions(1,e.solar.mppts);return V(yn||(yn=ht(["",""])),e.show_solar?V(mn||(mn=ht(["\n ","\n\t\t\t\t","\n\t\t\t ","\n ","\n ","\n\t\t\t\t","\n\t\t\t ","\n\t\t\t ","\n "])),this.generateFrame(n,"pv1",t.PV1Efficiency,e.solar.visualize_efficiency),this.generateFlowLine(n,"pv1",t.statePV1Power,t.durationCur.pv1,t.pv1LineWidth,t.minLineWidth),this.generateName(n,e.solar.pv1_name),this.generateEfficiency(n,t.PV1Efficiency,e.solar.show_mppt_efficiency),this.generateEnergy(n,t.statePV1Energy,e.solar.show_mppt_production,e.solar.show_mppt_efficiency),this.generateVoltage(n,t.statePV1Voltage),this.generateAmperage(n,t.statePV1Current),this.generatePower(n,t.statePV1Power,e.solar.auto_scale,t.largeFont)):V(vn||(vn=ht([""]))))}static generateMppt2(t,e){const n=this.getPositions(2,e.solar.mppts);return V(An||(An=ht(["",""])),e.show_solar&&e.solar.mppts>=2?V(wn||(wn=ht(["\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n\t\t\t ","\n "])),this.generateFrame(n,"PV2",t.PV2Efficiency,e.solar.visualize_efficiency),this.generateFlowLine(n,"pv2",t.statePV2Power,t.durationCur.pv2,t.pv2LineWidth,t.minLineWidth),this.generateName(n,e.solar.pv2_name),this.generateEfficiency(n,t.PV2Efficiency,e.solar.show_mppt_efficiency),this.generateEnergy(n,t.statePV2Energy,e.solar.show_mppt_production,e.solar.show_mppt_efficiency),this.generateVoltage(n,t.statePV2Voltage),this.generateAmperage(n,t.statePV2Current),this.generatePower(n,t.statePV2Power,e.solar.auto_scale,t.largeFont)):V(bn||(bn=ht([""]))))}static generateMppt3(t,e){const n=this.getPositions(3,e.solar.mppts);return V(xn||(xn=ht(["",""])),e.show_solar&&e.solar.mppts>=3?V(Pn||(Pn=ht(["\n ","\n ","\n ","\t\t\t\n ","\n ","\n ","\n ","\n\t\t\t ","\n "])),this.generateFrame(n,"PV3",t.PV3Efficiency,e.solar.visualize_efficiency),this.generateFlowLine(n,"pv3",t.statePV3Power,t.durationCur.pv3,t.pv3LineWidth,t.minLineWidth),this.generateName(n,e.solar.pv3_name),this.generateEfficiency(n,t.PV3Efficiency,e.solar.show_mppt_efficiency),this.generateEnergy(n,t.statePV3Energy,e.solar.show_mppt_production,e.solar.show_mppt_efficiency),this.generateVoltage(n,t.statePV3Voltage),this.generateAmperage(n,t.statePV3Current),this.generatePower(n,t.statePV3Power,e.solar.auto_scale,t.largeFont)):V(En||(En=ht([""]))))}static generateMppt4(t,e){const n=this.getPositions(4,e.solar.mppts);return V(Ln||(Ln=ht(["",""])),e.show_solar&&e.solar.mppts>=4?V(Mn||(Mn=ht(["\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n\t\t\t ","\n "])),this.generateFrame(n,"PV4",t.PV4Efficiency,e.solar.visualize_efficiency),this.generateFlowLine(n,"pv4",t.statePV4Power,t.durationCur.pv4,t.pv4LineWidth,t.minLineWidth),this.generateName(n,e.solar.pv4_name),this.generateEfficiency(n,t.PV4Efficiency,e.solar.show_mppt_efficiency),this.generateEnergy(n,t.statePV4Energy,e.solar.show_mppt_production,e.solar.show_mppt_efficiency),this.generateVoltage(n,t.statePV4Voltage),this.generateAmperage(n,t.statePV4Current),this.generatePower(n,t.statePV4Power,e.solar.auto_scale,t.largeFont)):V(zn||(zn=ht([""]))))}static generateMppt5(t,e){const n=this.getPositions(5,e.solar.mppts);return V(Nn||(Nn=ht(["",""])),e.show_solar&&e.solar.mppts>=5?V(Cn||(Cn=ht(["\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n\t\t\t ","\n\t\t\t"])),this.generateFrame(n,"PV5",t.PV5Efficiency,e.solar.visualize_efficiency),this.generateFlowLine(n,"pv5",t.statePV5Power,t.durationCur.pv5,t.pv5LineWidth,t.minLineWidth),this.generateName(n,e.solar.pv5_name),this.generateEfficiency(n,t.PV5Efficiency,e.solar.show_mppt_efficiency),this.generateEnergy(n,t.statePV5Energy,e.solar.show_mppt_production,e.solar.show_mppt_efficiency),this.generateVoltage(n,t.statePV5Voltage),this.generateAmperage(n,t.statePV5Current),this.generatePower(n,t.statePV5Power,e.solar.auto_scale,t.largeFont)):V(kn||(kn=ht([""]))))}static generatePower(t,e,n,r){return V(Tn||(Tn=ht(['\n \n\t\t\t\t\n\t\t\t\t\t ',"\n \n\t\t\t"])),(t=>Zt.handlePopup(t,e.entity_id)),t[4],!0!==r?"st14":"st4",e.isValid()?"":"none",this.solarColour,n?Zt.convertValue(e,this.decimalPlaces)||0:e.toNum(0)+" "+Bt.WATT)}static generateFrame(t,e,n,r){return V(jn||(jn=ht(['\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t'])),e,t[0],e,r?"url(#"+e+"LG)":this.solarColour,e,0===n?"grey":this.solarColour,n,0===n?"grey":this.solarColour,n,n<100?"grey":this.solarColour,n<100?"grey":this.solarColour)}static generateFlowLine(t,e,n,r,a,o){const i=n.toPower();return V(Dn||(Dn=ht(['\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t"])),e,e,t[1],this.solarColour,a,e,Math.min(2+a+Math.max(o-2,0),8),Math.round(i)<=0?"transparent":"".concat(this.solarColour),r,this.pvLineMap[e])}static generateName(t,e){return V(On||(On=ht(['\n\t\t\t',"\n\t\t\t"])),t[2],this._solarColour,e)}static generateEfficiency(t,e,n){return V(Bn||(Bn=ht(['\n \n ',"%\n "])),t[2],n?"st3 st8 right-align":"st12",n?"":"none",this.solarColour,e)}static generateEnergy(t,e,n,r){return V(Hn||(Hn=ht(['\n \n ',"\n "])),r?t[5]:t[2],r?"118":"106",r?t[6]:"right-align",n?"":"none",this.solarColour,e.toPowerString(!0,0))}static generateVoltage(t,e){return V(Rn||(Rn=ht(['\n \n '," ","\n \n "])),(t=>Zt.handlePopup(t,e.entity_id)),t[3],e.isValid()?"":"none",this.solarColour,e.toNum(1),It.VOLT)}static generateAmperage(t,e){return V(In||(In=ht(['\n \n\t\t\t\t',"\n\t\t\t\t\t","\n\t\t\t\t\n\t\t\t"])),(t=>Zt.handlePopup(t,e.entity_id)),t[3],e.isValid()?"":"none",this.solarColour,e.toNum(1),Rt.AMPERE)}}vr.pvLineMap={pv1:"#pv1-line",pv2:"#pv2-line",pv3:"#pv3-line",pv4:"#pv4-line",pv5:"#pv5-line"};class Ar{static generateShapes(t,e){return V(Gn||(Gn=ht(['\n\t\t\t\n\t\t\t\n\t\t'])),t.batteryColour,e.show_battery?"":"none",t.compactMode?"":"st12",t.compactMode?"348":"329.75",t.compactMode?"50":"70",t.compactMode?"7.5":"10.5",t.compactMode?"7.5":"10.5",t.batteryColour,e.show_battery?"":"none",t.compactMode?"st12":"")}static generateDuration(t,e){return V(Sn||(Sn=ht(['\n\t\t\t\n\t\t\t\t','\n\t\t\t\n\t\t\t\n\t\t\t\t'," ","% @",'\n\t\t\t\n\t\t\t\n\t\t\t\t'," ","% @",'\n\t\t\t\n\t\t\t\n\t\t\t\t',"\n\t\t\t\t\t\n\t\t"])),t.compactMode?"270":"290",!0!==t.largeFont?"st14":"st4",e.show_battery?"":"none",0===t.batteryEnergy||t.isFloating||0===t.batteryPower?"transparent":"".concat(t.batteryColour),t.batteryDuration,t.compactMode?"270":"290",e.show_battery?"":"none",0===t.batteryEnergy||t.batteryPower<=0||t.isFloating?"transparent":"".concat(t.batteryColour),Et("common.runtime_to"),t.batteryCapacity,t.formattedResultTime,t.compactMode?"270":"290",e.show_battery?"":"none",0===t.batteryEnergy||t.batteryPower>=0||t.isFloating?"transparent":"".concat(t.batteryColour),Et("common.to"),t.batteryCapacity,t.formattedResultTime,t.compactMode?"270":"290",e.show_battery?"":"none",0!==t.batteryEnergy&&t.isFloating?"".concat(t.batteryColour):"transparent",Et("common.battery_floating"))}static generateDailyCharge(t,e){return V(Qn||(Qn=ht(['\n\t\t\t\n\t\t\t\t','\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t',"\n\t\t\t\t\n\t\t\t\n\t\t"])),t.compactMode?"132":"77.2",!0===t.batteryShowDaily&&e.show_battery?"".concat(t.batteryColour):"transparent",Et("common.daily_charge"),(t=>Zt.handlePopup(t,e.entities.day_battery_charge_70)),t.compactMode?"132":"77.2",!0===t.batteryShowDaily&&e.show_battery&&t.stateDayBatteryCharge.isValid()?"":"none",t.batteryColour,t.stateDayBatteryCharge?.toPowerString(!0,t.decimalPlacesEnergy))}static generateDailyDischarge(t,e){return V(Un||(Un=ht(['\n\t\t\t\n\t\t\t\t','\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t',"\n\t\t\t\t\n\t\t\t\n\t\t"])),t.compactMode?"132":"77.2",!0===t.batteryShowDaily&&e.show_battery?"".concat(t.batteryColour):"transparent",Et("common.daily_discharge"),(t=>Zt.handlePopup(t,e.entities.day_battery_discharge_71)),t.compactMode?"132":"77.2",!0===t.batteryShowDaily&&e.show_battery&&t.stateDayBatteryDischarge.isValid()?"":"none",t.batteryColour,t.stateDayBatteryDischarge?.toPowerString(!0,t.decimalPlacesEnergy))}static generateFlowLines(t,e){return V(Vn||(Vn=ht(['\n \t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t'])),t.compactMode?"M 239 250 L 239 290":"M 239 250 L 239 324",e.show_battery?"":"st12",e.battery.dynamic_colour?t.flowBatColour:t.batteryColour,t.batLineWidth,Math.min(2+t.batLineWidth+Math.max(t.minLineWidth-2,0),8),e.show_battery?"":"st12",t.batteryPower<0||0===t.batteryPower?"transparent":"".concat(t.batteryColour),t.durationCur.battery,Math.min(2+t.batLineWidth+Math.max(t.minLineWidth-2,0),8),e.show_battery?"":"st12",t.batteryPower>0||0===t.batteryPower?"transparent":"".concat(e.battery.dynamic_colour?t.flowBatColour:t.batteryColour),t.durationCur.battery)}static generateState(t,e){return V(Zn||(Zn=ht(['\n\t\t\t\n\t\t\t\t',"\n\t\t\t"])),e.battery.show_remaining_energy?"311":"320",!e.show_battery||t.compactMode?"none":"",t.batteryColour,t.batteryStateMsg)}static generateCapacity(t,e){return V(_n||(_n=ht(['\n\t\t\t\n\t\t\t\t',"\n\t\t\t\t","\n\t\t\t"])),t.compactMode?"270":e.entities?.battery_status?"169":"193",t.compactMode?"338":"323",e.entities?.battery_status||t.compactMode?"st3 left-align":"st3",e.show_battery&&e.battery.show_remaining_energy?"":"none",t.batteryColour,Zt.toNum(t.batteryEnergy*(t.stateBatterySoc.toNum(2)/100)/1e3,2),Ht.KILO_WATT_HOUR)}static generateShutdownSOC(t,e){return V(Wn||(Wn=ht(['\n\t\t\t\n\t\t\t\t','%\n\t\t\t\n\t\t\t\n\t\t\t\t',"%\n\t\t\t"])),t.compactMode?"343":"363",t.batteryColour,e.battery.hide_soc||!e.show_battery?"st12":"st14 left-align",!t.inverterProg.show&&e.battery?.shutdown_soc_offgrid?"":"none",t.batteryShutdown,t.compactMode?"343":"363",t.batteryColour,e.battery.hide_soc||!e.show_battery?"st12":"st14 left-align",!t.inverterProg.show&&e.battery?.shutdown_soc_offgrid?"":"none",t.shutdownOffGrid)}static generateBatteryGradient(t,e){return V(Xn||(Xn=ht(['\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t'])),t.compactMode?"212.5":"232.5",t.gridPercentageBat>0?t.gridColour:t.pvPercentageBat>0?t.solarColour:t.batteryColour,t.gridPercentageBat<2?0:t.gridPercentageBat,t.gridPercentageBat>0?t.gridColour:t.pvPercentageBat>0?t.solarColour:t.batteryColour,t.gridPercentageBat<2?0:t.gridPercentageBat,t.pvPercentageBat>0?t.solarColour:t.batteryColour,(t.gridPercentageBat<2?0:t.gridPercentageBat)+(t.pvPercentageBat<2?0:t.pvPercentageBat),t.pvPercentageBat>0?t.solarColour:t.batteryColour,(t.gridPercentageBat<2?0:t.gridPercentageBat)+(t.pvPercentageBat<2?0:t.pvPercentageBat),t.batteryColour,t.batteryColour,e.show_battery?"":"st12",e.battery.dynamic_colour?"url(#bLg)":t.batteryColour,e.battery.linear_gradient?t.battery0:t.batteryIcon,t.compactMode?"212.5":"232.5",t.stopColour,e.battery.animate?"y2":"none",e.show_battery?"":"st12",e.battery.linear_gradient?"url(#sLg)":t.batteryColour,e.battery.linear_gradient?"":"none",t.batteryCharge)}}class wr{static generateShapes(t,e){return V(Yn||(Yn=ht(['\n\t\t\t\n\t\t'])),t.gridColour,e.show_grid?"":"none")}static generateDailyBuy(t,e){return V(Fn||(Fn=ht(['\n\t\t\t\n\t\t\t\t',"\n\t\t\t\n\t\t"])),!0!==t.gridShowDailyBuy?"transparent":"".concat(t.gridColour),e.show_grid?"":"none",e.grid.label_daily_grid_buy)}static generateDailySell(t,e){return V(Jn||(Jn=ht(['\n\t\t\t\n\t\t\t\t',"\n\t\t\t\n\t\t"])),!0!==t.gridShowDailySell?"transparent":"".concat(t.gridColour),e.show_grid?"":"none",e.grid.label_daily_grid_sell)}static generatePowers(t,e){return V(Kn||(Kn=ht(['\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t','\n\t\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t','\n\t\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t',"\n\t\t\t\t\n\t\t\t\n\t\t"])),(t=>Zt.handlePopup(t,e.entities.grid_ct_power_172)),e.inverter.three_phase?"":"none",e.show_grid?"st3 left-align":"st12",t.gridColour,e.load.auto_scale?"".concat(Zt.convertValue(t.gridPower,t.decimalPlaces)||0):"".concat(t.gridPower||0," ").concat(Bt.WATT),(t=>Zt.handlePopup(t,e.entities.grid_ct_power_L2)),e.inverter.three_phase&&e.entities?.grid_ct_power_L2?"":"none",e.show_grid?"st3 left-align":"st12",t.gridColour,e.load.auto_scale?"".concat(Zt.convertValue(t.gridPowerL2,t.decimalPlaces)||0):"".concat(t.gridPowerL2||0," ").concat(Bt.WATT),(t=>Zt.handlePopup(t,e.entities.grid_ct_power_L3)),e.inverter.three_phase&&e.entities?.grid_ct_power_L3?"":"none",e.show_grid?"st3 left-align":"st12",t.gridColour,e.load.auto_scale?"".concat(Zt.convertValue(t.gridPowerL3,t.decimalPlaces)||0):"".concat(t.gridPowerL3||0," ").concat(Bt.WATT))}static generatePrepaidUnits(t,e){return V(qn||(qn=ht(['\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t'," ","\n\t\t\t\t\n\t\t\t\n\t\t"])),(t=>Zt.handlePopup(t,e.entities.prepaid_units)),e.entities?.prepaid_units?"st3":"st12",t.gridColour,e.show_grid&&t.statePrepaidUnits.isValid()?"":"none",t.statePrepaidUnits.toNum(1),e.grid.prepaid_unit_name)}static generateTotalPower(t,e){return V($n||($n=ht(["\n\t\t\t","\n\t\t"])),t.totalGridPower>=0?V(tr||(tr=ht(['\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t'," ","\n\t\t\t\t\t\t\n\t\t\t\t\t"])),(t=>Zt.handlePopup(t,e.entities.energy_cost_buy)),e.show_grid?"st3 left-align":"st12",t.gridColour,e.entities?.energy_cost_buy&&t.stateEnergyCostBuy.isValid()?"":"none",t.energyCost,t.stateEnergyCostBuy.getUOM()):V(er||(er=ht(['\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t'," ","\n\t\t\t\t\t\t\n\t\t\t\t\t"])),(t=>Zt.handlePopup(t,e.entities.energy_cost_sell)),e.show_grid?"st3 left-align":"st12",t.gridColour,e.entities?.energy_cost_sell&&t.stateEnergyCostSell.isValid()?"":"none",t.energyCost,t.stateEnergyCostSell.getUOM()))}static generateGridName(t,e){return V(nr||(nr=ht(['\n\t\t\t',"\n\t\t\t"])),e.grid.show_daily_buy?"294":"267",t.gridColour,e.show_grid?"":"none",e.grid.grid_name)}static generateFlowLines(t,e){return V(rr||(rr=ht(['\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t'])),t.gridColour,t.gridLineWidth,e.show_grid?"":"none",Math.min(2+t.gridLineWidth+Math.max(t.minLineWidth-2,0),8),t.totalGridPower<0||0===t.totalGridPower?"transparent":"".concat(t.gridColour),e.show_grid?"":"none",t.durationCur.grid,Math.min(2+t.gridLineWidth+Math.max(t.minLineWidth-2,0),8),t.totalGridPower>0||0===t.totalGridPower?"transparent":"".concat(t.gridColour),e.show_grid?"":"none",t.durationCur.grid,t.gridColour,t.gridLineWidth,e.show_grid?"":"none",Math.min(2+t.gridLineWidth+Math.max(t.minLineWidth-2,0),8),t.totalGridPower<0||0===t.totalGridPower?"transparent":"".concat(t.gridColour),e.show_grid?"":"none",t.durationCur.grid,Math.min(2+t.gridLineWidth+Math.max(t.minLineWidth-2,0),8),t.totalGridPower>0||0===t.totalGridPower?"transparent":"".concat(t.gridColour),e.show_grid?"":"none",t.durationCur.grid)}static generateIcon(t,e){return V(ar||(ar=ht(['\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\t\t\t'])),(t=>Zt.handlePopup(t,e.entities.grid_connected_status_194)),Tt.includes(t.gridStatus.toLowerCase())?"st12":"",t.gridColour,!e.show_grid||t.totalGridPower<0||e.grid.import_icon?"none":"",ie,jt.includes(t.gridStatus.toLowerCase())?"st12":"",t.gridOffColour,!e.show_grid||e.grid.disconnected_icon?"none":"",oe,Tt.includes(t.gridStatus.toLowerCase())?"st12":"",t.gridColour,!e.show_grid||t.totalGridPower>=0||e.grid.export_icon?"none":"",ae,(t=>Zt.handlePopup(t,e.entities.grid_connected_status_194)),e.show_grid||e.grid.import_icon||e.grid.disconnected_icon||e.grid.export_icon?"":"none",t.customGridIcon)}}class br{static generateIcon(t){return V(or||(or=ht(['\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t'])),t.genericInverterImage?1:0,t.inverterColour,Ft)}static generateTimerInfo(t,e){return V(ir||(ir=ht(['\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t','\n\t\t\t\t\n\t\t\t\t',"\n\t\t\t\t\n\t\t\t\n\t\t"])),(t=>Zt.handlePopup(t,e.entities.use_timer_248)),"on"==t.stateUseTimer.state&&"no"!==t.enableTimer?"":"none",t.inverterColour,Jt,"off"==t.stateUseTimer.state&&"no"!==t.enableTimer?"":"none",t.inverterColour,Kt,"off"==t.stateUseTimer.state&&"no"!==t.enableTimer?"":"none",t.inverterColour,Et("common.timer_off"),"on"==t.stateUseTimer.state&&"no"!==t.enableTimer?"":"none",t.inverterColour,Et("common.timer_on"))}}class xr{constructor(){}getBatteryCapacity(t,e,n,r,a){let o=0;return t>0?o="off"===e||"0"===e||"off-grid"===e.toLowerCase()||!r.show||parseInt(a.state)<=r.capacity?n:r.capacity:t<0&&("off"===e||"0"===e||"off-grid"===e.toLowerCase()||!r.show||parseInt(a.state)>=r.capacity?o=100:parseInt(a.state)=95:n="M12 20H4V6h8L12 20m.67-16H11V2H5v2H3.33C2.6 4 2 4.6 2 5.33v15.34C2 21.4 2.6 22 3.33 22h9.34c.74 0 1.33-.59 1.33-1.33V5.33C14 4.6 13.4 4 12.67 4M5.02 18.5v1L11 19.5 11 18.5zM5 18 11 18 11 17H5zM5 16.5 11 16.5 11 15.5H5zM5 14 11 14 11 15H5zM5 12.5 11 12.5 11 13.5H5zM5 11 11 11 11 12H5zM5 9.5 11 9.5 11 10.5H5zM5 8 11 8 11 9H5zM5 6.5 11 6.5 11 7.5H5z",r="M11 19M5.02 18.5v1L11 19.5 11 18.5zM5 18 11 18 11 17H5zM5 16.5 11 16.5 11 15.5H5zM5 14 11 14 11 15H5zM5 12.5 11 12.5 11 13.5H5zM5 11 11 11 11 12H5zM5 9.5 11 9.5 11 10.5H5zM5 8 11 8 11 9H5zM5 6.5 11 6.5 11 7.5H5z",a="green";break;case 85<=parseInt(t.state)&&parseInt(t.state)<95:n="M12 20H4V6h8L12 20m.67-16H11V2H5v2H3.33C2.6 4 2 4.6 2 5.33v15.34C2 21.4 2.6 22 3.33 22h9.34c.74 0 1.33-.59 1.33-1.33V5.33C14 4.6 13.4 4 12.67 4M5.02 18.5v1L11 19.5 11 18.5zM5 18 11 18 11 17H5zM5 16.5 11 16.5 11 15.5H5zM5 14 11 14 11 15H5zM5 12.5 11 12.5 11 13.5H5zM5 11 11 11 11 12H5zM5 9.5 11 9.5 11 10.5H5zM5 8 11 8 11 9H5z",r="M11 19M5.02 18.5v1L11 19.5 11 18.5zM5 18 11 18 11 17H5zM5 16.5 11 16.5 11 15.5H5zM5 14 11 14 11 15H5zM5 12.5 11 12.5 11 13.5H5zM5 11 11 11 11 12H5zM5 9.5 11 9.5 11 10.5H5zM5 8 11 8 11 9H5z",a="green";break;case 75<=parseInt(t.state)&&parseInt(t.state)<85:n="M12 20H4V6h8L12 20m.67-16H11V2H5v2H3.33C2.6 4 2 4.6 2 5.33v15.34C2 21.4 2.6 22 3.33 22h9.34c.74 0 1.33-.59 1.33-1.33V5.33C14 4.6 13.4 4 12.67 4M5.02 18.5v1L11 19.5 11 18.5zM5 18 11 18 11 17H5zM5 16.5 11 16.5 11 15.5H5zM5 14 11 14 11 15H5zM5 12.5 11 12.5 11 13.5H5zM5 11 11 11 11 12H5zM5 9.5 11 9.5 11 10.5H5z",r="M11 19M5.02 18.5v1L11 19.5 11 18.5zM5 18 11 18 11 17H5zM5 16.5 11 16.5 11 15.5H5zM5 14 11 14 11 15H5zM5 12.5 11 12.5 11 13.5H5zM5 11 11 11 11 12H5zM5 9.5 11 9.5 11 10.5H5zH5z",a="#9ACD32";break;case 65<=parseInt(t.state)&&parseInt(t.state)<75:n="M12 20H4V6h8L12 20m.67-16H11V2H5v2H3.33C2.6 4 2 4.6 2 5.33v15.34C2 21.4 2.6 22 3.33 22h9.34c.74 0 1.33-.59 1.33-1.33V5.33C14 4.6 13.4 4 12.67 4M5.02 18.5v1L11 19.5 11 18.5zM5 18 11 18 11 17H5zM5 16.5 11 16.5 11 15.5H5zM5 14 11 14 11 15H5zM5 12.5 11 12.5 11 13.5H5zM5 11 11 11 11 12H5z",r="M11 19M5.02 18.5v1L11 19.5 11 18.5zM5 18 11 18 11 17H5zM5 16.5 11 16.5 11 15.5H5zM5 14 11 14 11 15H5zM5 12.5 11 12.5 11 13.5H5zM5 11 11 11 11 12H5zM5 11z",a="yellow";break;case 55<=parseInt(t.state)&&parseInt(t.state)<65:n="M12 20H4V6h8L12 20m.67-16H11V2H5v2H3.33C2.6 4 2 4.6 2 5.33v15.34C2 21.4 2.6 22 3.33 22h9.34c.74 0 1.33-.59 1.33-1.33V5.33C14 4.6 13.4 4 12.67 4M5.02 18.5v1L11 19.5 11 18.5zM5 18 11 18 11 17H5zM5 16.5 11 16.5 11 15.5H5zM5 14 11 14 11 15H5zM5 12.5 11 12.5 11 13.5H5z",r="M11 19M5.02 18.5v1L11 19.5 11 18.5zM5 18 11 18 11 17H5zM5 16.5 11 16.5 11 15.5H5zM5 14 11 14 11 15H5zM5 12.5 11 12.5 11 13.5H5z",a="yellow";break;case 45<=parseInt(t.state)&&parseInt(t.state)<55:n="M12 20H4V6h8L12 20m.67-16H11V2H5v2H3.33C2.6 4 2 4.6 2 5.33v15.34C2 21.4 2.6 22 3.33 22h9.34c.74 0 1.33-.59 1.33-1.33V5.33C14 4.6 13.4 4 12.67 4M5.02 18.5v1L11 19.5 11 18.5zM5 18 11 18 11 17H5zM5 16.5 11 16.5 11 15.5H5zM5 14 11 14 11 15H5z",r="M11 19M5.02 18.5v1L11 19.5 11 18.5zM5 18 11 18 11 17H5zM5 16.5 11 16.5 11 15.5H5zM5 14 11 14 11 15H5zH5z",a="yellow";break;case 35<=parseInt(t.state)&&parseInt(t.state)<45:n="M12 20H4V6h8L12 20m.67-16H11V2H5v2H3.33C2.6 4 2 4.6 2 5.33v15.34C2 21.4 2.6 22 3.33 22h9.34c.74 0 1.33-.59 1.33-1.33V5.33C14 4.6 13.4 4 12.67 4M5.02 18.5v1L11 19.5 11 18.5zM5 18 11 18 11 17H5zM5 16.5 11 16.5 11 15.5H5z",r="M11 19M5.02 18.5v1L11 19.5 11 18.5zM5 18 11 18 11 17H5zM5 16.5 11 16.5 11 15.5H5zH5z",a="orange";break;case 25<=parseInt(t.state)&&parseInt(t.state)<35:n="M12 20H4V6h8L12 20m.67-16H11V2H5v2H3.33C2.6 4 2 4.6 2 5.33v15.34C2 21.4 2.6 22 3.33 22h9.34c.74 0 1.33-.59 1.33-1.33V5.33C14 4.6 13.4 4 12.67 4M5.02 18.5v1L11 19.5 11 18.5zM5 18 11 18 11 17H5z",r="M11 19M5.02 18.5v1L11 19.5 11 18.5zM5 18 11 18 11 17H5zM5 17z",a="orange";break;case 10<=parseInt(t.state)&&parseInt(t.state)<25:n="M12 20H4V6h8L12 20m.67-16H11V2H5v2H3.33C2.6 4 2 4.6 2 5.33v15.34C2 21.4 2.6 22 3.33 22h9.34c.74 0 1.33-.59 1.33-1.33V5.33C14 4.6 13.4 4 12.67 4M5.02 18.5v1L11 19.5 11 18.5z",r="M11 19M5.02 18.5v1L11 19.5 11 18.5zM5 19z",a="orange";break;case 0<=parseInt(t.state)&&parseInt(t.state)<10:default:n=e,r=e,a="red"}return{batteryIcon:n,batteryCharge:r,stopColour:a,battery0:e}}}function Wr(t){let e=null!==t?.state&&"unknown"!==t.state&&void 0!==t.state&&null!=t?.entity_id&&t.entity_id,n=""!==t?.state&&e;return{...t,toNum:(e,n)=>Zt.toNum(t?.state,e,n),isValid:()=>e||!1,notEmpty:()=>n||!1,isNaN:()=>null===t?.state||Number.isNaN(t?.state),toPower:e=>{const n=(t.attributes?.unit_of_measurement||"").toLowerCase();return"kw"===n||"kwh"===n?Zt.toNum(1e3*(t?.state||"0"),0,e):"mw"===n||"mwh"===n?Zt.toNum(1e6*(t?.state||"0"),0,e):Zt.toNum(t?.state||"0",0,e)||0},toPowerString:(e,n,r)=>e?Zt.convertValueNew(t?.state,t?.attributes?.unit_of_measurement,n||0):"".concat(Zt.toNum(t?.state,0,r)," ").concat(t?.attributes?.unit_of_measurement||""),toString:()=>t?.state?.toString()||"",getUOM:()=>t?.attributes?.unit_of_measurement||""}}console.groupCollapsed("%c ⚡ POWER-FLOW-CARD by Molikk %c ".concat(Et("common.version"),": ").concat("0.1.0"," "),"color: orange; font-weight: bold; background: black","color: white; font-weight: bold; background: dimgray"),console.log("Readme:","https://github.com/molikk/mlk-power-flow-card"),console.groupEnd();let Xr=class extends it{constructor(){super(...arguments),this.durationPrev={},this.durationCur={}}static get styles(){return pt}static async getConfigElement(){return await Promise.resolve().then((function(){return ra})),document.createElement(Dt)}static getStubConfig(){return{show_solar:!0,battery:{energy:0,shutdown_soc:20,show_daily:!0},solar:{mppts:2},load:{show_daily:!0},grid:{show_daily_buy:!0,show_daily_sell:!1,show_nonessential:!0},entities:{use_timer_248:"switch.sunsynk_toggle_system_timer",priority_load_243:"switch.sunsynk_toggle_priority_load",inverter_voltage_154:"sensor.sunsynk_inverter_voltage",load_frequency_192:"sensor.sunsynk_load_frequency",inverter_current_164:"sensor.sunsynk_inverter_current",inverter_power_175:"sensor.sunsynk_inverter_power",grid_connected_status_194:"binary_sensor.sunsynk_grid_connected_status",inverter_status_59:"sensor.sunsynk_overall_state",day_battery_charge_70:"sensor.sunsynk_day_battery_charge",day_battery_discharge_71:"sensor.sunsynk_day_battery_discharge",battery_voltage_183:"sensor.sunsynk_battery_voltage",battery_soc_184:"sensor.sunsynk_battery_soc",battery_power_190:"sensor.sunsynk_battery_power",battery_current_191:"sensor.sunsynk_battery_current",grid_power_169:"sensor.sunsynk_grid_power",day_grid_import_76:"sensor.sunsynk_day_grid_import",day_grid_export_77:"sensor.sunsynk_day_grid_export",grid_ct_power_172:"sensor.sunsynk_grid_ct_power",day_load_energy_84:"sensor.sunsynk_day_load_energy",essential_power:"none",nonessential_power:"none",aux_power_166:"sensor.sunsynk_aux_power",day_pv_energy_108:"sensor.sunsynk_day_pv_energy",pv1_power_186:"sensor.sunsynk_pv1_power",pv2_power_187:"sensor.sunsynk_pv2_power",pv1_voltage_109:"sensor.sunsynk_pv1_voltage",pv1_current_110:"sensor.sunsynk_pv1_current",pv2_voltage_111:"sensor.sunsynk_pv2_voltage",pv2_current_112:"sensor.sunsynk_pv2_current"}}}render(){xt.hass=this.hass;const t=this._config,e=this.getEntity("entities.day_battery_discharge_71"),n=this.getEntity("entities.day_battery_charge_70"),r=this.getEntity("entities.day_load_energy_84"),a=this.getEntity("entities.day_grid_import_76"),o=this.getEntity("entities.day_grid_export_77"),i=this.getEntity("entities.day_aux_energy"),s=this.getEntity("entities.inverter_voltage_154"),l=this.getEntity("entities.load_frequency_192"),c=this.getEntity("entities.inverter_current_164"),u=this.getEntity("entities.inverter_status_59",{state:""}),d=this.getEntity("entities.inverter_power_175"),f=this.getEntity("entities.priority_load_243",{state:t.entities.priority_load_243?.toString()??"false"}),h=this.getEntity("entities.use_timer_248",{state:t.entities.use_timer_248?.toString()??"false"}),g=this.getEntity("entities.dc_transformer_temp_90",{state:""}),p=this.getEntity("entities.radiator_temp_91",{state:""}),y=this.getEntity("entities.inverter_voltage_L2",{state:""}),m=this.getEntity("entities.inverter_voltage_L3",{state:""}),v=this.getEntity("entities.inverter_current_L2",{state:""}),A=this.getEntity("entities.inverter_current_L3",{state:""}),w=this.getEntity("entities.environment_temp",{state:""}),b=this.getEntity("entities.battery_voltage_183"),x=this.getEntity("entities.battery_soc_184"),P=this.getEntity("entities.battery_power_190"),E=this.getEntity("entities.battery_current_191"),L=this.getEntity("entities.battery_temp_182",{state:""}),M=this.getEntity("entities.battery_status",{state:""}),z=this.getEntity("entities.battery_current_direction",{state:""}),N=this.getEntity("entities.battery_rated_capacity",{state:""}),C=this.getEntity("battery.shutdown_soc",{state:t.battery.shutdown_soc?.toString()??""}),k=this.getEntity("battery.shutdown_soc_offgrid",{state:t.battery.shutdown_soc_offgrid?.toString()??""}),T=this.getEntity("entities.battery_soh",{state:""}),j=this.getEntity("entities.essential_power"),D=this.getEntity("entities.aux_power_166"),O=this.getEntity("entities.nonessential_power"),B=this.getEntity("entities.non_essential_load1"),H=this.getEntity("entities.non_essential_load2"),R=this.getEntity("entities.non_essential_load3"),I=this.getEntity("entities.non_essential_load1_extra"),G=this.getEntity("entities.non_essential_load2_extra"),S=this.getEntity("entities.essential_load1"),Q=this.getEntity("entities.essential_load2"),Z=this.getEntity("entities.essential_load3"),_=this.getEntity("entities.essential_load4"),W=this.getEntity("entities.essential_load5"),X=this.getEntity("entities.essential_load6"),Y=this.getEntity("entities.essential_load7"),F=this.getEntity("entities.essential_load8"),J=this.getEntity("entities.aux_connected_status",{state:"on"}),K=this.getEntity("entities.aux_load1"),q=this.getEntity("entities.aux_load2"),$=this.getEntity("entities.essential_load1_extra"),tt=this.getEntity("entities.essential_load2_extra"),et=this.getEntity("entities.essential_load3_extra"),nt=this.getEntity("entities.essential_load4_extra"),rt=this.getEntity("entities.essential_load5_extra"),at=this.getEntity("entities.essential_load6_extra"),ot=this.getEntity("entities.essential_load7_extra"),it=this.getEntity("entities.essential_load8_extra"),st=this.getEntity("entities.load_power_L1"),lt=this.getEntity("entities.load_power_L2"),ct=this.getEntity("entities.load_power_L3"),ut=this.getEntity("entities.aux_load1_extra"),dt=this.getEntity("entities.aux_load2_extra"),ft=this.getEntity("entities.grid_ct_power_172"),gt=this.getEntity("entities.grid_ct_power_L2"),pt=this.getEntity("entities.grid_ct_power_L3"),mt=this.getEntity("entities.grid_ct_power_total"),vt=this.getEntity("entities.grid_connected_status_194",{state:"on"}),At=this.getEntity("entities.grid_power_169"),wt=this.getEntity("entities.energy_cost_buy",{state:"",attributes:{unit_of_measurement:""}}),bt=this.getEntity("entities.energy_cost_sell",{state:"",attributes:{unit_of_measurement:""}}),Pt=this.getEntity("entities.grid_voltage",null),Lt=this.getEntity("entities.prepaid_units"),Dt=this.getEntity("entities.max_sell_power"),Ot=this.getEntity("entities.pv1_voltage_109"),Ht=this.getEntity("entities.pv1_current_110"),Gt=this.getEntity("entities.pv2_voltage_111"),St=this.getEntity("entities.pv2_current_112"),Qt=this.getEntity("entities.pv3_voltage_113"),Ut=this.getEntity("entities.pv3_current_114"),Vt=this.getEntity("entities.pv4_voltage_115"),Ft=this.getEntity("entities.pv4_current_116"),Jt=this.getEntity("entities.pv5_voltage"),Kt=this.getEntity("entities.pv5_current"),ae=this.getEntity("entities.pv1_power_186"),oe=this.getEntity("entities.pv2_power_187"),ie=this.getEntity("entities.pv3_power_188"),se=this.getEntity("entities.pv4_power_189"),le=this.getEntity("entities.pv5_power"),ce=this.getEntity("entities.pv1_production"),ue=this.getEntity("entities.pv2_production"),de=this.getEntity("entities.pv3_production"),fe=this.getEntity("entities.pv4_production"),he=this.getEntity("entities.pv5_production"),ge=this.getEntity("entities.solar_sell_247",{state:"undefined"}),pe=this.getEntity("entities.pv_total"),ye=this.getEntity("entities.day_pv_energy_108"),me=this.getEntity("entities.monthly_pv_generation"),ve=this.getEntity("entities.yearly_pv_generation"),Ae=this.getEntity("entities.total_pv_generation"),we=this.getEntity("entities.remaining_solar"),{invert_aux:be}=t.load,xe=D.toPower(be),{invert_grid:Pe}=t.grid,Ee=ft.toPower(Pe),Le=gt.toPower(Pe),Me=pt.toPower(Pe),ze=t.entities?.grid_ct_power_total?mt.toPower(Pe):Ee+Le+Me,Ne=t.inverter.three_phase?ze:Ee,Ce=Pt.isNaN()?null:Pt.toNum(0),ke=z.isNaN()?null:z.toNum(0),Te=t.inverter?.modern,je=t.decimal_places,De=t.decimal_places_energy,Oe=this.colourConvert(t.load?.colour),Be=this.calculateAuxLoadColour(D.toPower(!1),Zt.toNum(t.load?.off_threshold,0))||Oe,He=this.colourConvert(t.load?.aux_off_colour||Be),Re=this.calculateAuxLoadColour(K.toPower(!1),Zt.toNum(t.load?.off_threshold,0))||Oe,Ie=this.calculateAuxLoadColour(q.toPower(!1),Zt.toNum(t.load?.off_threshold,0))||Oe,Ge=this.calculateEssentialLoadColour(S.toPower(!1),Zt.toNum(t.load?.off_threshold,0))||Oe,Se=this.calculateEssentialLoadColour(Q.toPower(!1),Zt.toNum(t.load?.off_threshold,0))||Oe,Qe=this.calculateEssentialLoadColour(Z.toPower(!1),Zt.toNum(t.load?.off_threshold,0))||Oe,Ue=this.calculateEssentialLoadColour(_.toPower(!1),Zt.toNum(t.load?.off_threshold,0))||Oe,Ve=this.calculateEssentialLoadColour(W.toPower(!1),Zt.toNum(t.load?.off_threshold,0))||Oe,Ze=this.calculateEssentialLoadColour(X.toPower(!1),Zt.toNum(t.load?.off_threshold,0))||Oe,_e=this.calculateEssentialLoadColour(Y.toPower(!1),Zt.toNum(t.load?.off_threshold,0))||Oe,We=this.calculateEssentialLoadColour(F.toPower(!1),Zt.toNum(t.load?.off_threshold,0))||Oe;t.title_colour=this.colourConvert(t.title_colour);const Xe=t.load?.show_daily,Ye=t.grid?.show_nonessential;let Fe=t.entities?.grid_connected_status_194?vt.state:"on";jt.includes(Fe.toLowerCase())||Tt.includes(Fe.toLowerCase())||(Fe="on");const Je=t.entities?.aux_connected_status?J.state:"on",Ke=t.entities?.load_frequency_192?l.toNum(2):0,qe=t.entities?.inverter_voltage_154?t.inverter.three_phase&&(this.isLiteCard||this.isCompactCard)?s.toNum(0):s.toNum(1):0,$e=t.entities?.inverter_voltage_L2?t.inverter.three_phase&&(this.isLiteCard||this.isCompactCard)?y.toNum(0):y.toNum(1):"",tn=t.entities?.inverter_voltage_L3?t.inverter.three_phase&&(this.isLiteCard||this.isCompactCard)?m.toNum(0):m.toNum(1):"",en=t.entities?.inverter_current_164?c.toNum(1):0,nn=t.entities?.inverter_current_L2?v.toNum(1):"",rn=t.entities?.inverter_current_L3?A.toNum(1):"",an=t.entities?.battery_voltage_183?b.toNum(1):0,on=t.entities?.inverter_power_175?d.toPower():0,sn=t.entities?.grid_power_169?At.toPower():0,{invert_load:ln}=t.load,cn=t.entities?.load_power_L1?st.toPower(ln):"",un=t.entities?.load_power_L2?lt.toPower(ln):"",dn=t.entities?.load_power_L3?ct.toPower(ln):"",fn=this.colourConvert(t.grid?.colour),hn=this.colourConvert(t.grid?.export_colour||fn),gn=this.colourConvert(t.grid?.no_grid_colour||fn);let pn;switch(!0){case Ne<0:pn=hn;break;case Ne>=0&&Ne<=Zt.toNum(t.grid?.off_threshold,0):pn=gn;break;default:pn=fn}const yn=Math.abs(B.toPower(!1))>Zt.toNum(t.grid?.off_threshold,0)?pn:"grey",mn=Math.abs(H.toPower(!1))>Zt.toNum(t.grid?.off_threshold,0)?pn:"grey",vn=Math.abs(R.toPower(!1))>Zt.toNum(t.grid?.off_threshold,0)?pn:"grey",An=this.colourConvert(t.grid?.grid_off_colour||pn);let wn=t.grid?.additional_loads;zt.includes(wn)||(wn=0);const bn=t.grid?.show_daily_buy,xn=t.grid?.show_daily_sell,Pn=this.colourConvert(t.battery?.colour),En=this.colourConvert(t.battery?.charge_colour||Pn),Ln=t.battery?.show_daily;let Mn=t.load?.show_aux;Ct.includes(Mn)||(Mn=!1);const zn=t.load?.show_daily_aux;let Nn=t.load?.additional_loads;Mt.includes(Nn)||(Nn=0);let Cn=t.load?.aux_loads;kt.includes(Cn)||(Cn=0);const kn=t.load?.aux_type,Tn=this.getEntity("load.load1_icon",{state:t.load?.load1_icon?.toString()??""}).state,jn=this.getEntity("load.load2_icon",{state:t.load?.load2_icon?.toString()??""}).state,Dn=this.getEntity("load.load3_icon",{state:t.load?.load3_icon?.toString()??""}).state,On=this.getEntity("load.load4_icon",{state:t.load?.load4_icon?.toString()??""}).state,Bn=this.getEntity("load.load5_icon",{state:t.load?.load5_icon?.toString()??""}).state,Hn=this.getEntity("load.load6_icon",{state:t.load?.load6_icon?.toString()??""}).state,Rn=this.getEntity("load.load7_icon",{state:t.load?.load7_icon?.toString()??""}).state,In=this.getEntity("load.load8_icon",{state:t.load?.load8_icon?.toString()??""}).state,Gn=this.getEntity("load.aux_load1_icon",{state:t.load?.aux_load1_icon?.toString()??""}).state,Sn=this.getEntity("load.aux_load2_icon",{state:t.load?.aux_load2_icon?.toString()??""}).state,Qn=this.getEntity("grid.nonessential_icon",{state:t.grid?.nonessential_icon?.toString()??""}).state,Un=this.getEntity("grid.load1_icon",{state:t.grid?.load1_icon?.toString()??""}).state,Vn=this.getEntity("grid.load2_icon",{state:t.grid?.load2_icon?.toString()??""}).state,Zn=this.getEntity("grid.load3_icon",{state:t.grid?.load3_icon?.toString()??""}).state,_n=this.getEntity("grid.import_icon",{state:t.grid?.import_icon?.toString()??""}).state,Wn=this.getEntity("grid.disconnected_icon",{state:t.grid?.disconnected_icon?.toString()??""}).state,Xn=this.getEntity("grid.export_icon",{state:t.grid?.export_icon?.toString()??""}).state,Yn=t.large_font,Fn=t.panel_mode,Jn=this.colourConvert(t.inverter?.colour),Kn=t.inverter?.autarky,qn=!!t.entities.use_timer_248&&h.state,$n=!!t.entities.priority_load_243&&f.state;let tr=P.toPower(t.battery?.invert_power);const er=this.getEntity("card_height",{state:t.card_height?.toString()??""}).state,nr=this.getEntity("card_width",{state:t.card_width?.toString()??""}).state,rr=0===t.grid?.energy_cost_decimals?0:t.grid?.energy_cost_decimals||2,ar=Ne>=0?wt.toNum(rr):bt.toNum(rr);let or=yt.Sunsynk;Object.values(yt).includes(t.inverter.model)&&(or=t.inverter.model);let ir="";const xr=Zr.getInstance(or);Te||(ir=xr.image);let Pr=!1;this.isCompactCard&&(Pr=!0);const Er=ae.toPower(),Lr=oe.toPower(),Mr=ie.toPower(),zr=se.toPower(),Nr=le.toPower(),Cr=Er+Lr+Mr+zr+Nr,kr=t.entities?.pv_total?pe.toNum():Cr,Tr=t.solar.dynamic_colour?Zt.toNum(kr,0)>Zt.toNum(t.solar?.off_threshold,0)?this.colourConvert(t.solar?.colour):"grey":this.colourConvert(t.solar?.colour);let jr,Dr,Or=t.inverter?.three_phase;Nt.includes(Or)||(Or=!1);const{essential_power:Br,nonessential_power:Hr}=t.entities;Dr=!1===Or?"none"!==Hr&&Hr?O.toPower():Ee-sn:"none"!==Hr&&Hr?O.toPower():Ee+Le+Me-sn,jr="none"!==Br&&Br?j.toPower(ln):!0===Or&&t.entities.load_power_L1&&t.entities.load_power_L2&&t.entities.load_power_L3?Number(cn)+Number(un)+Number(dn):kr+tr+sn-xe;const Rr={time:this.getEntity("entities.prog1_time",{state:t.entities.prog1_time??""}),capacity:this.getEntity("entities.prog1_capacity",{state:t.entities.prog1_capacity??""}),charge:this.getEntity("entities.prog1_charge",{state:t.entities.prog1_charge??""})},Ir={time:this.getEntity("entities.prog2_time",{state:t.entities.prog2_time??""}),capacity:this.getEntity("entities.prog2_capacity",{state:t.entities.prog2_capacity??""}),charge:this.getEntity("entities.prog2_charge",{state:t.entities.prog2_charge??""})},Gr={time:this.getEntity("entities.prog3_time",{state:t.entities.prog3_time??""}),capacity:this.getEntity("entities.prog3_capacity",{state:t.entities.prog3_capacity??""}),charge:this.getEntity("entities.prog3_charge",{state:t.entities.prog3_charge??""})},Sr={time:this.getEntity("entities.prog4_time",{state:t.entities.prog4_time??""}),capacity:this.getEntity("entities.prog4_capacity",{state:t.entities.prog4_capacity??""}),charge:this.getEntity("entities.prog4_charge",{state:t.entities.prog4_charge??""})},Qr={time:this.getEntity("entities.prog5_time",{state:t.entities.prog5_time??""}),capacity:this.getEntity("entities.prog5_capacity",{state:t.entities.prog5_capacity??""}),charge:this.getEntity("entities.prog5_charge",{state:t.entities.prog5_charge??""})},Ur={time:this.getEntity("entities.prog6_time",{state:t.entities.prog6_time??""}),capacity:this.getEntity("entities.prog6_capacity",{state:t.entities.prog6_capacity??""}),charge:this.getEntity("entities.prog6_charge",{state:t.entities.prog6_charge??""})},Vr=k.toNum(),Wr=C.toNum(),Xr={capacity:Wr,entityID:""};switch(!0){case"off"===h.state:case!qn:case!t.entities.prog1_time:case!t.entities.prog2_time:case!t.entities.prog3_time:case!t.entities.prog4_time:case!t.entities.prog5_time:case!t.entities.prog6_time:Xr.show=!1;break;default:Xr.show=!0;const bo=new Date,xo=[];[Rr,Ir,Gr,Sr,Qr,Ur].forEach(((t,e)=>{const[n,r]=t.time.state.split(":").map((t=>parseInt(t,10)));xo[e]=new Date(bo.getTime()),xo[e].setHours(n),xo[e].setMinutes(r)}));const[Po,Eo,Lo,Mo,zo,No]=xo;function Co(t,e){"No Grid or Gen"===t.charge.state||"0"===t.charge.state||"off"===t.charge.state?Xr.charge="none":Xr.charge="both",Xr.capacity=parseInt(t.capacity.state),Xr.entityID=e}bo>=No||bo=Po&&bo=Eo&&bo=Lo&&bo=Mo&&bo=zo&&bo50?"on":"off"),null!=ke&&or==yt.Solis&&0===ke&&(tr=-tr);let Yr=0;if(t.show_battery)if(!0==!Xr.show)tr>0?Yr="on"!==Fe&&"1"!==Fe&&"on-grid"!==Fe.toLowerCase()||Xr.show?"off"!==Fe&&"0"!==Fe&&"off-grid"!==Fe.toLowerCase()||!k.notEmpty()||Xr.show?Wr:Vr:Wr:tr<0&&(Yr=100);else Yr=xr.getBatteryCapacity(tr,Fe,Wr,Xr,x);let Fr=0,Jr="",Kr="";let qr=this.getEntity("battery.energy",{state:t.battery.energy?.toString()??""}).toPower(!1);if(an&&N.notEmpty()&&(qr=Zt.toNum(an*N.toNum(0),0)),t.show_battery||0!==qr){0===tr?Fr=(x.toNum()-Wr)/100*qr*60*60:tr>0?Fr=(x.toNum()-Yr)/100*qr/tr*60*60:tr<0&&(Fr=(Yr-x.toNum(0))/100*qr/tr*60*60*-1);const ko=new Date,To=1e3*Fr,jo=new Date(ko.getTime()+To),Do=jo.getHours(),Oo=jo.getMinutes().toString().padStart(2,"0"),Bo=Do.toString().padStart(2,"0");Jr="".concat(Bo,":").concat(Oo);const Ho=Math.floor(Fr/86400),Ro=Math.floor(Fr%86400/3600),Io=Math.floor(Fr%3600/60);if(Ho>0&&(Kr+="".concat(Ho).concat(Et("common.days")," ")),Ro>0){const Go=Ho>0&&Ro<10?"0".concat(Ro):"".concat(Ro);Kr+="".concat(Go).concat(Et("common.hrs")," ")}Kr+="".concat(Io).concat(Et("common.min"))}const $r=-2<=E.toNum(0)&&E.toNum(0)<=2&&x.toNum(0)>=99;let ta;ta=tr<0&&!$r?En:Pn;let ea="",na="",ra=u.state,aa=!1;or==yt.Solis&&(ra=u.isNaN()?u.toString():u.toNum(0).toString());const oa=xr.statusGroups;if(oa)for(const So of Object.keys(oa)){const Qo=oa[So],{states:Uo,color:Vo,message:Zo}=Qo;if(Uo.includes(ra.toLowerCase())){ea=Vo,na=Zo,aa=!0;break}}aa||("none"!==t.entities?.inverter_status_59&&t.entities?.inverter_status_59?(ea="transparent",na="Status"):(ea="transparent",na=""));let ia="transparent",sa="";if([yt.GoodweGridMode,yt.Goodwe,yt.Huawei].includes(or)){const _o=xr.batteryStatusGroups;if(_o)for(const Wo of Object.keys(_o)){const Xo=_o[Wo],{states:Yo,color:Fo,message:Jo}=Xo;if(Yo.includes(M.state.toLowerCase())){ia=Fo,sa=Jo,aa=!0;break}}aa||("none"!==t.entities?.battery_status&&t.entities?.battery_status?(ia="transparent",sa="Status"):(ia="transparent",sa=""))}const la=ye.toNum()+e.toNum(),ca=r.toNum()+n.toNum(),ua=0!=ca?Math.max(Math.min(Math.round(100*la/ca),100),0):0,da=0!=la?Math.max(Math.min(Math.round(100*ca/la),100),0):0,fa=kr+Zt.toNum("".concat(tr>0?tr:0))+Zt.toNum("".concat(xe<0?-1*xe:0)),ha=jr+Math.max(Dr,0)+Zt.toNum("".concat(xe>0?xe:0))+Zt.toNum("".concat(tr<0?-1*tr:0)),ga=0!=ha?Math.max(Math.min(Math.round(100*fa/ha),100),0):0,pa=0!=fa?Math.max(Math.min(Math.round(100*ha/fa),100),0):0,ya=(Zt.toNum(t.max_line_width)<1?1:t.max_line_width)-1,ma=Zt.toNum(t.min_line_width)||1,va=ye.toNum()+e.toNum()+a.toNum(),Aa=0!=la?Math.max(Math.min(Math.round(1e3*ca/la)/10,100),0):0,wa=0!=va?Math.max(Math.min(Math.round(1e3*la/va)/10,100),0):0,ba=this.getEntity("battery.max_power",{state:t.battery.max_power?.toString()??""}).toNum(0),xa=this.getEntity("solar.max_power",{state:t.solar.max_power?.toString()??""}),Pa=this.getEntity("load.max_power",{state:t.load.max_power?.toString()??""}),Ea=this.getEntity("grid.max_power",{state:t.grid.max_power?.toString()??""}),La=t.solar.max_power?this.dynamicLineWidth(Er,xa.toNum()||Er,ya,ma):ma,Ma=t.solar.max_power?this.dynamicLineWidth(Lr,xa.toNum()||Lr,ya,ma):ma,za=t.solar.max_power?this.dynamicLineWidth(Mr,xa.toNum()||Mr,ya,ma):ma,Na=t.solar.max_power?this.dynamicLineWidth(zr,xa.toNum()||zr,ya,ma):ma,Ca=t.solar.max_power?this.dynamicLineWidth(Nr,xa.toNum()||Nr,ya,ma):ma,ka=t.battery.max_power?this.dynamicLineWidth(Math.abs(tr),ba||Math.abs(tr),ya,ma):ma,Ta=t.load.max_power?this.dynamicLineWidth(Math.abs(jr),Pa.toNum()||Math.abs(jr),ya,ma):ma,ja=t.load.max_power?this.dynamicLineWidth(Math.abs(xe),Pa.toNum()||Math.abs(xe),ya,ma):ma,Da=t.grid.max_power?this.dynamicLineWidth(Math.abs(Ne),Ea.toNum()||Math.abs(Ne),ya,ma):ma,Oa=t.grid.max_power?this.dynamicLineWidth(Math.abs(sn),Ea.toNum()||Math.abs(sn),ya,ma):ma,Ba=t.grid.max_power?this.dynamicLineWidth(Math.abs(Dr),Ea.toNum()||Math.abs(Dr),ya,ma):ma,Ha=t.solar.max_power?this.dynamicLineWidth(kr,xa.toNum()||kr,ya,ma):ma;if(t&&t.solar&&t.solar.animation_speed){const Ko=t.solar.animation_speed-(t.solar.animation_speed-1)*(kr/(xa.toNum()||kr));this.changeAnimationSpeed("solar",Ko)}if(t&&t.solar&&t.solar.animation_speed){const qo=t.solar.animation_speed-(t.solar.animation_speed-1)*(Er/(xa.toNum()||Er));this.changeAnimationSpeed("pv1",qo)}if(t&&t.solar&&t.solar.animation_speed){const $o=t.solar.animation_speed-(t.solar.animation_speed-1)*(Lr/(xa.toNum()||Lr));this.changeAnimationSpeed("pv2",$o)}if(t&&t.solar&&t.solar.animation_speed){const ti=t.solar.animation_speed-(t.solar.animation_speed-1)*(Mr/(xa.toNum()||Mr));this.changeAnimationSpeed("pv3",ti)}if(t&&t.solar&&t.solar.animation_speed){const ei=t.solar.animation_speed-(t.solar.animation_speed-1)*(zr/(xa.toNum()||zr));this.changeAnimationSpeed("pv4",ei)}if(t&&t.solar&&t.solar.animation_speed){const ni=t.solar.animation_speed-(t.solar.animation_speed-1)*(Nr/(xa.toNum()||Nr));this.changeAnimationSpeed("pv5",ni)}if(t&&t.battery&&t.battery.animation_speed){const ri=t.battery.animation_speed-(t.battery.animation_speed-1)*(Math.abs(tr)/(ba||Math.abs(tr)));this.changeAnimationSpeed("battery",ri)}if(t&&t.load&&t.load.animation_speed){const ai=t.load.animation_speed-(t.load.animation_speed-1)*(Math.abs(jr)/(Pa.toNum()||Math.abs(jr)));this.changeAnimationSpeed("load",ai),this.changeAnimationSpeed("load1",ai)}if(t&&t.load&&t.load.animation_speed){const oi=t.load.animation_speed-(t.load.animation_speed-1)*(Math.abs(xe)/(Pa.toNum()||Math.abs(xe)));this.changeAnimationSpeed("aux",oi),this.changeAnimationSpeed("aux1",oi)}if(t&&t.grid&&t.grid.animation_speed){const ii=t.grid.animation_speed-(t.grid.animation_speed-1)*(Math.abs(Ne)/(Ea.toNum()||Math.abs(Ne)));this.changeAnimationSpeed("grid1",ii),this.changeAnimationSpeed("grid",ii),this.changeAnimationSpeed("grid2",ii)}if(t&&t.grid&&t.grid.animation_speed){const si=t.grid.animation_speed-(t.grid.animation_speed-1)*(Math.abs(Dr)/(Ea.toNum()||Math.abs(Dr)));this.changeAnimationSpeed("ne",si)}const Ra=0===kr?0:"off"!==$n&&$n||tr>0?kr/(Or?jr+Math.max(xe,0):jr)*100:(kr-Math.abs(tr))/(Or?jr+Math.max(xe,0):jr)*100,Ia=tr<=0?0:Math.abs(tr)/(Or?jr+Math.max(xe,0):jr)*100,Ga=Ra+Ia,Sa=0===Ga?0:Ra/Ga*100,Qa=0===Ga?0:Ia/Ga*100;let Ua=0,Va=0,Za=0;Ga>100?(Ua=Zt.toNum(Sa,0),Va=Zt.toNum(Qa,0)):(Ua=Zt.toNum(Math.min(Ra,100),0),Va=Zt.toNum(Math.min(Ia,100),0),Za=100-(Ua+Va));const _a=0===kr||tr>=0?0:"off"!==$n&&$n?(kr-jr)/Math.abs(tr)*100:kr/Math.abs(tr)*100,Wa=tr>=0||Ne<=0?0:"on"===$n?kr-jr>=Math.abs(tr)?0:(Ne-Math.max(jr-kr,0))/Math.abs(tr)*100:kr>=Math.abs(tr)?0:(Math.abs(tr)-kr)/Math.abs(tr)*100,Xa=_a+Wa,Ya=0===Xa?0:_a/Xa*100,Fa=0===Xa?0:Wa/Xa*100;let Ja,Ka,qa,$a,to,eo=0,no=0;switch(Xa>100?(eo=Zt.toNum(Ya,0),no=Zt.toNum(Fa,0)):(eo=Zt.toNum(Math.min(_a,100),0),no=Zt.toNum(Math.min(Wa,100),0)),!0){case eo>=Zt.toNum(t.battery?.path_threshold,0):Ja=Tr;break;case no>=Zt.toNum(t.battery?.path_threshold,0):Ja=pn;break;default:Ja=ta}switch(!0){case Ua>=Zt.toNum(t.load?.path_threshold,0):Ka=Tr;break;case Va>=Zt.toNum(t.load?.path_threshold,0):Ka=ta;break;case Za>=Zt.toNum(t.load?.path_threshold,0):Ka=pn;break;default:Ka=Oe}switch(!0){case Ua>=Zt.toNum(t.load?.path_threshold,0):qa=Tr;break;case Va>=Zt.toNum(t.load?.path_threshold,0):qa=ta;break;case Za>=Zt.toNum(t.load?.path_threshold,0):case no>=Zt.toNum(t.battery?.path_threshold,0):qa=pn;break;default:qa=Jn}switch(!0){case Ra>=100&&Ia<=5&&Ne-Dr<50&&t.load.dynamic_icon:$a=Yt,to=1;break;case Ia>=100&&Ra<=5&&Ne-Dr<50&&t.load.dynamic_icon:$a=Wt,to=0;break;case Ra<5&&Ia<5&&Za>0&&t.load.dynamic_icon:$a=Xt,to=0;break;default:$a=_t,to=0}const{batteryIcon:ro,batteryCharge:ao,stopColour:oo,battery0:io}=_r.convert(x),so=this.getEntity("solar.pv1_max_power",{state:t.solar.pv1_max_power?.toString()??""}),lo=this.getEntity("solar.pv2_max_power",{state:t.solar.pv2_max_power?.toString()??""}),co=this.getEntity("solar.pv3_max_power",{state:t.solar.pv3_max_power?.toString()??""}),uo=this.getEntity("solar.pv4_max_power",{state:t.solar.pv4_max_power?.toString()??""}),fo=this.getEntity("solar.pv5_max_power",{state:t.solar.pv5_max_power?.toString()??""}),ho=t.solar.max_power&&t.solar.visualize_efficiency?Zt.toNum(Math.min(kr/xa.toNum()*100,200),0):100,go=t.solar.pv1_max_power&&t.solar.visualize_efficiency?Zt.toNum(Math.min(Er/so.toNum()*100,200),0):100,po=t.solar.pv2_max_power&&t.solar.visualize_efficiency?Zt.toNum(Math.min(Lr/lo.toNum()*100,200),0):100,yo=t.solar.pv3_max_power&&t.solar.visualize_efficiency?Zt.toNum(Math.min(Mr/co.toNum()*100,200),0):100,mo=t.solar.pv4_max_power&&t.solar.visualize_efficiency?Zt.toNum(Math.min(zr/uo.toNum()*100,200),0):100,vo=t.solar.pv5_max_power&&t.solar.visualize_efficiency?Zt.toNum(Math.min(Nr/fo.toNum()*100,200),0):100;let Ao,wo;switch(!0){case Ne<0&&jt.includes(Fe.toLowerCase()):Ao=Xn,wo=pn;break;case Ne>=0&&jt.includes(Fe.toLowerCase()):Ao=_n,wo=pn;break;case 0===Ne&&Tt.includes(Fe.toLowerCase()):Ao=Wn,wo=An;break;default:Ao=_n,wo=pn}return((t,e,n)=>(vr.solarColour=n.solarColour,vr.decimalPlacesEnergy=n.decimalPlacesEnergy,vr.decimalPlaces=n.decimalPlaces,U(sr||(sr=ht(["\n \n ",'\n
\n ','\n \n\n ',"\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ",'\n \n \n\n \n \n \n \n \n \n \n X','\n \n Y','\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n\n \n \n ','\n \n \n \n \n ','\n \n \n \n \n ',": ",'\n \n \n \n ',"\n ","\n ","\n ",'\n \n \n \n ',' Hz\n \n \n \n ',"\n ","\n ","\n ",'\n \n \n \n \n '," ",'\n \n \n \n \n '," ",'\n \n \n \n \n ','%\n \n \n \n \n | ','%\n \n \n \n \n | ','%\n \n \n \n \n |\n \n \n \n \n ','\n \n \n \n \n ',"\n ",'\n \n \n \n \n ',"\n ","\n \n \n ",'\n\n \n \n ','°\n \n \n \n \n ','%\n \n \n \n \n AC:\n ','°\n \n \n \n \n DC:\n ',"°\n \n \n\n\n \n
\n
\n "])),mr.getStyle(n),t.title?U(lr||(lr=ht(['\n ',""])),t.title_colour||"inherit",t.title_size||"32px",t.title):"",t.show_solar?1:0===n.additionalLoad&&t.show_battery?145.33:80,t.show_solar?t.show_battery?408:[2,3,4,5,6,7,8].includes(n.additionalLoad)?400:300:t.show_battery&&0!==n.additionalLoad?350:270.67,!1===n.panelMode?"".concat(t.show_solar||t.show_battery?t.show_solar?t.show_solar&&!t.show_battery?[2,3,4,5,6,7,8].includes(n.additionalLoad)?"400px":"300px":"".concat(n.cardHeight):0!==n.additionalLoad?"330px":"246px":"270px"):"".concat(t.show_solar?"100%":"75%"),!0===n.panelMode?"".concat(n.cardWidth):"100%",Ar.generateShapes(n,t),Ar.generateDuration(n,t),Ar.generateDailyCharge(n,t),Ar.generateDailyDischarge(n,t),Ar.generateState(n,t),Ar.generateCapacity(n,t),Ar.generateShutdownSOC(n,t),Ar.generateFlowLines(n,t),Ar.generateBatteryGradient(n,t),wr.generateShapes(n,t),wr.generateDailyBuy(n,t),wr.generateDailySell(n,t),wr.generateGridName(n,t),wr.generateFlowLines(n,t),wr.generateIcon(n,t),wr.generateTotalPower(n,t),wr.generatePowers(n,t),wr.generatePrepaidUnits(n,t),gr.generateShapes(n),gr.generateDailyLoadName(n),gr.generateFlowLines(n,t),gr.generateIcon(n,t),gr.generatePowers(n,t),gr.generateTotalLoad(n,t),gr.generateDailyLoadValue(n,t),pr.generateLines(n),pr.generateLoad1(n,t),pr.generateLoad2(n,t),pr.generateLoad3(n,t),pr.generateLoad4(n,t),pr.generateLoad5(n,t),pr.generateLoad6(n,t),pr.generateLoad7(n,t),pr.generateLoad8(n,t),t.show_solar?V(cr||(cr=ht(["\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n "])),vr.generateSolarHeader(n,t),vr.generateMppt1(n,t),vr.generateMppt2(n,t),vr.generateMppt3(n,t),vr.generateMppt4(n,t),vr.generateMppt5(n,t),vr.generateSolarPower(n,t)):V(ur||(ur=ht([""]))),yr.getTexts(n),br.generateIcon(n),br.generateTimerInfo(n,t),n.inverterStateColour,n.compactMode?"238.5":"162",n.compactMode?"326":t.battery.show_remaining_energy?"310":"319","none"!==t.entities?.battery_status&&t.entities?.battery_status&&t.show_battery?"":"none",n.batteryStateColour,(e=>Zt.handlePopup(e,t.entities.priority_load_243)),"off"!==n.priorityLoad||"no"===n.priorityLoad&&n.priorityLoad?"none":"",n.inverterColour,te,"on"!==n.priorityLoad||"no"===n.priorityLoad&&n.priorityLoad?"none":"",n.inverterColour,ee,"off"!==n.priorityLoad||"no"===n.priorityLoad&&n.priorityLoad?"none":"",n.inverterColour,Et("common.priority_batt"),"on"!==n.priorityLoad||"no"===n.priorityLoad&&n.priorityLoad?"none":"",n.inverterColour,Et("common.priority_load"),(e=>Zt.handlePopup(e,t.entities.solar_sell_247)),t.entities.solar_sell_247&&"off"!==n.stateSolarSell.state&&"0"!==n.stateSolarSell.state&&t.show_solar&&["1","on"].includes(n.stateSolarSell.state)?"":"none",n.solarColour,qt,t.entities.solar_sell_247&&"on"!==n.stateSolarSell.state&&"1"!==n.stateSolarSell.state&&t.show_solar&&["0","off"].includes(n.stateSolarSell.state)?"":"none",n.solarColour,$t,n.genericInverterImage?"st12":"",e,(t=>Zt.handlePopup(t,n.inverterProg.entityID)),!1===n.inverterProg.show||"no"===n.enableTimer?"none":"","none"===n.inverterProg.charge||"off"!=n.stateUseTimer.state&&"on"!=n.stateUseTimer.state?"st12":"",n.inverterColour,ne,!1===n.inverterProg.show||"no"===n.enableTimer?"none":"","none"!==n.inverterProg.charge||"off"!==n.stateUseTimer.state&&"on"!==n.stateUseTimer.state?"st12":"",n.inverterColour,re,(e=>Zt.handlePopup(e,t.entities.day_grid_import_76)),t.show_grid&&!0===n.gridShowDailyBuy&&n.stateDayGridImport.isValid()?"":"none",n.gridColour,n.stateDayGridImport?.toPowerString(!0,n.decimalPlacesEnergy),(e=>Zt.handlePopup(e,t.entities.day_grid_export_77)),t.show_grid&&!0===n.gridShowDailySell&&n.stateDayGridExport.isValid()?"":"none",n.gridColour,n.stateDayGridExport?.toPowerString(!0,n.decimalPlacesEnergy),(e=>Zt.handlePopup(e,t.entities.max_sell_power)),["off","0"].includes(n.stateSolarSell.state)?"grey":n.gridColour,t.show_grid&&n.stateMaxSellPower.isValid&&t.entities?.max_sell_power?"":"none",Et("common.limit"),n.stateMaxSellPower.toPowerString(t.grid.auto_scale,n.decimalPlaces),(e=>Zt.handlePopup(e,t.entities.inverter_voltage_154)),"none"!==t.entities.inverter_voltage_154&&t.entities.inverter_voltage_154?"":"none",n.inverterColour,n.inverterVoltage,t.inverter.three_phase&&t.entities?.inverter_voltage_L2?"| "+n.inverterVoltageL2:"",t.inverter.three_phase&&t.entities?.inverter_voltage_L3?"| "+n.inverterVoltageL3:"",It.VOLT,(e=>Zt.handlePopup(e,t.entities.load_frequency_192)),"none"!==t.entities.load_frequency_192&&t.entities.load_frequency_192?"":"none",n.inverterColour,n.loadFrequency,(e=>Zt.handlePopup(e,t.entities.inverter_current_164)),"none"!==t.entities.inverter_current_164&&t.entities.inverter_current_164?"":"none",n.inverterColour,n.inverterCurrent,t.inverter.three_phase&&t.entities?.inverter_current_L2?"| "+n.inverterCurrentL2:"",t.inverter.three_phase&&t.entities?.inverter_current_L3?"| "+n.inverterCurrentL3:"",Rt.AMPERE,(e=>Zt.handlePopup(e,t.entities.battery_voltage_183)),"none"!==t.entities.battery_voltage_183&&t.entities.battery_voltage_183&&t.show_battery&&!n.compactMode?"":"none",n.batteryColour,!0!==n.largeFont?"st14":"st4",n.batteryVoltage,It.VOLT,(e=>Zt.handlePopup(e,t.entities.battery_voltage_183)),"none"!==t.entities.battery_voltage_183&&t.entities.battery_voltage_183&&t.show_battery&&n.compactMode?"":"none",n.batteryColour,n.compactMode?"st3 left-align":"st12",n.batteryVoltage,It.VOLT,(e=>Zt.handlePopup(e,t.entities.battery_soc_184)),n.compactMode?"270":"290","none"!==t.entities.battery_soc_184&&t.show_battery&&n.stateBatterySoc.isValid()?"":"none",n.batteryColour,n.stateBatterySoc.toNum(0),(e=>Zt.handlePopup(e,t.entities.battery_soc_184)),n.compactMode?"330":"350",n.batteryColour,n.inverterProg.show&&"none"!==t.entities.battery_soc_184&&t.show_battery&&!t.battery.hide_soc?"":"none",n.inverterProg.capacity||0,(e=>Zt.handlePopup(e,t.entities.battery_soc_184)),n.compactMode?"330":"350",n.batteryColour,t.battery.hide_soc||!t.show_battery?"st12":"st13 st8 left-align",n.inverterProg.show||!t.battery?.shutdown_soc||t.battery?.shutdown_soc_offgrid?"none":"",n.batteryShutdown||0,(e=>Zt.handlePopup(e,t.entities.battery_soc_184)),n.compactMode?"330":"350",n.batteryColour,t.battery.hide_soc||!t.show_battery?"st12":"st13 st8 left-align",!n.inverterProg.show&&t.battery.shutdown_soc_offgrid?"":"none",(e=>Zt.handlePopup(e,t.entities.battery_power_190)),n.compactMode?"239":"193",n.compactMode?"307":"386","none"!==t.entities.battery_power_190&&t.show_battery?"":"none",n.batteryColour,!0!==n.largeFont?"st14":"st4",t.battery.auto_scale?"".concat(t.battery.show_absolute?"".concat(Math.abs(parseFloat(Zt.convertValue(n.batteryPower,n.decimalPlaces)))," ").concat(Zt.convertValue(n.batteryPower,n.decimalPlaces).split(" ")[1]):Zt.convertValue(n.batteryPower,n.decimalPlaces)||"0"):"".concat(t.battery.show_absolute?"".concat(Math.abs(n.batteryPower)," ").concat(Bt.WATT):"".concat(n.batteryPower||0," ").concat(Bt.WATT)),(e=>Zt.handlePopup(e,t.entities.battery_current_191)),t.entities.battery_current_191&&"none"!==t.entities.battery_current_191&&t.show_battery&&!n.compactMode&&n.stateBatteryCurrent.isValid()?"":"none",n.batteryColour,!0!==n.largeFont?"st14":"st4",t.battery.show_absolute?Math.abs(n.stateBatteryCurrent.toNum(1)):n.stateBatteryCurrent.toNum(1),Rt.AMPERE,(e=>Zt.handlePopup(e,t.entities.battery_current_191)),t.entities.battery_current_191&&"none"!==t.entities.battery_current_191&&t.show_battery&&n.compactMode&&n.stateBatteryCurrent.isValid()?"":"none",n.batteryColour,n.compactMode?"st3 left-align":"st12",t.battery.show_absolute?Math.abs(n.stateBatteryCurrent.toNum(1)):n.stateBatteryCurrent.toNum(1),Rt.AMPERE,t.inverter.three_phase?t.entities?.grid_ct_power_total?V(dr||(dr=ht(['\n \n \n ',"\n \n "])),(e=>Zt.handlePopup(e,t.entities.grid_ct_power_total)),t.show_grid&&"none"!==t.entities.grid_ct_power_172?"":"none",!0!==n.largeFont?"st14":"st4",n.gridColour,t.grid.auto_scale?"".concat(t.grid.show_absolute?"".concat(Math.abs(parseFloat(Zt.convertValue(n.totalGridPower,n.decimalPlaces)))," ").concat(Zt.convertValue(n.totalGridPower,n.decimalPlaces).split(" ")[1]):Zt.convertValue(n.totalGridPower,n.decimalPlaces)||0):"".concat(t.grid.show_absolute?"".concat(Math.abs(n.totalGridPower)," ").concat(Bt.WATT):"".concat(n.totalGridPower||0," ").concat(Bt.WATT))):V(fr||(fr=ht(['\n \n ',"\n "])),t.show_grid&&"none"!==t.entities.grid_ct_power_172?"":"none",!0!==n.largeFont?"st14":"st4",n.gridColour,t.grid.auto_scale?"".concat(t.grid.show_absolute?"".concat(Math.abs(parseFloat(Zt.convertValue(n.totalGridPower,n.decimalPlaces)))," ").concat(Zt.convertValue(n.totalGridPower,n.decimalPlaces).split(" ")[1]):Zt.convertValue(n.totalGridPower,n.decimalPlaces)||0):"".concat(t.grid.show_absolute?"".concat(Math.abs(n.totalGridPower)," ").concat(Bt.WATT):"".concat(n.totalGridPower||0," ").concat(Bt.WATT))):V(hr||(hr=ht(['\n \n \n ',"\n \n "])),(e=>Zt.handlePopup(e,t.entities.grid_ct_power_172)),t.show_grid&&"none"!==t.entities.grid_ct_power_172?"":"none",!0!==n.largeFont?"st14":"st4",n.gridColour,t.grid.auto_scale?"".concat(t.grid.show_absolute?"".concat(Math.abs(parseFloat(Zt.convertValue(n.totalGridPower,n.decimalPlaces)))," ").concat(Zt.convertValue(n.totalGridPower,n.decimalPlaces).split(" ")[1]):Zt.convertValue(n.totalGridPower,n.decimalPlaces)||0):"".concat(t.grid.show_absolute?"".concat(Math.abs(n.totalGridPower)," ").concat(Bt.WATT):"".concat(n.totalGridPower||0," ").concat(Bt.WATT))),(e=>Zt.handlePopup(e,t.entities.battery_temp_182)),n.compactMode?"205":"250",n.compactMode?"332":"324.5",t.entities?.battery_temp_182?"st3 left-align":"st12",n.batteryColour,t.show_battery&&n.stateBatteryTemp.isValid()?"":"none",n.stateBatteryTemp.toNum(1),(e=>Zt.handlePopup(e,t.entities.battery_soh)),n.compactMode?"205":"250",n.compactMode?"332":"324.5",t.entities?.battery_soh?"st3 left-align":"st12",n.batteryColour,t.show_battery&&n.stateBatterySOH.isValid()&&!t.entities?.battery_temp_182?"":"none",n.stateBatterySOH.toNum(0),(e=>Zt.handlePopup(e,t.entities.radiator_temp_91)),n.inverterColour,t.entities?.radiator_temp_91&&n.stateRadiatorTemp.isValid()?"":"none",n.stateRadiatorTemp.toNum(1),(e=>Zt.handlePopup(e,t.entities.dc_transformer_temp_90)),n.inverterColour,t.entities?.dc_transformer_temp_90&&n.stateDCTransformerTemp.isValid()?"":"none",n.stateDCTransformerTemp.toNum(1))))(t,ir,{config:t,panelMode:Fn,compactMode:Pr,cardHeight:er,cardWidth:nr,loadColour:Oe,batteryColour:ta,gridColour:pn,isFloating:$r,inverterColour:Jn,solarColour:Tr,auxOffColour:He,batteryEnergy:qr,largeFont:Yn,batteryPower:tr,batteryDuration:Kr,batteryCapacity:Yr,additionalLoad:Nn,essIconSize:to,essIcon:$a,stateUseTimer:h,batteryStateMsg:sa,stateBatterySoc:x,inverterProg:Xr,batteryPercentage:Va,pvPercentage:Ua,loadShowDaily:Xe,stateEnergyCostSell:bt,stateEnergyCostBuy:wt,loadPowerL1:cn,loadPowerL2:un,loadPowerL3:dn,durationCur:this.durationCur,stateEssentialLoad1:S,stateEssentialLoad2:Q,stateEssentialLoad3:Z,stateEssentialLoad4:_,stateEssentialLoad5:W,stateEssentialLoad6:X,stateEssentialLoad7:Y,stateEssentialLoad8:F,gridPower:Ee,gridPowerL2:Le,gridPowerL3:Me,decimalPlaces:je,decimalPlacesEnergy:De,stateEssentialLoad1Extra:$,stateEssentialLoad2Extra:tt,stateEssentialLoad3Extra:et,stateEssentialLoad4Extra:nt,stateEssentialLoad5Extra:rt,stateEssentialLoad6Extra:at,stateEssentialLoad7Extra:ot,stateEssentialLoad8Extra:it,stateNonEssentialLoad1Extra:I,stateNonEssentialLoad2Extra:G,loadFrequency:Ke,gridShowDailyBuy:bn,gridShowDailySell:xn,batteryShowDaily:Ln,inverterModel:or,batteryShutdown:Wr,enableAutarky:Kn,autarkyPower:ga,ratioPower:pa,ratioEnergy:da,autarkyEnergy:ua,autarkyAuto:Aa,autarkySelf:wa,shutdownOffGrid:Vr,statePV1Current:Ht,statePV2Current:St,statePV3Current:Ut,statePV4Current:Ft,statePV5Current:Kt,energyCost:ar,inverterCurrent:en,inverterCurrentL2:nn,inverterCurrentL3:rn,stateRadiatorTemp:p,inverterVoltage:qe,inverterVoltageL2:$e,inverterVoltageL3:tn,batteryVoltage:an,stateBatteryCurrent:E,batLineWidth:ka,totalGridPower:Ne,solarLineWidth:Ha,totalPV:kr,loadLineWidth:Ta,pvPercentageBat:eo,gridPercentageBat:no,genericInverterImage:Te,battery0:io,essentialPower:jr,pv1LineWidth:La,pv2LineWidth:Ma,pv3LineWidth:za,pv4LineWidth:Na,pv5LineWidth:Ca,gridLineWidth:Da,stateEnvironmentTemp:w,statePV1Voltage:Ot,statePV2Voltage:Gt,statePV3Voltage:Qt,statePV4Voltage:Vt,statePV5Voltage:Jt,batteryStateColour:ia,inverterStateColour:ea,stateBatteryTemp:L,statePrepaidUnits:Lt,stateDCTransformerTemp:g,iconEssentialLoad1:Tn,iconEssentialLoad2:jn,iconEssentialLoad3:Dn,iconEssentialLoad4:On,iconEssentialLoad5:Bn,iconEssentialLoad6:Hn,iconEssentialLoad7:Rn,iconEssentialLoad8:In,enableTimer:qn,stateSolarSell:ge,priorityLoad:$n,inverterImg:ir,stateDailyPVEnergy:ye,stateMonthlyPVEnergy:me,stateYearlyPVEnergy:ve,stateTotalSolarGeneration:Ae,stateRemainingSolar:we,statePV2Power:oe,statePV3Power:ie,statePV4Power:se,statePV5Power:le,statePV1Energy:ce,statePV2Energy:ue,statePV3Energy:de,statePV4Energy:fe,statePV5Energy:he,stateDayLoadEnergy:r,stateDayBatteryDischarge:e,stateDayGridImport:a,stateDayBatteryCharge:n,stateDayGridExport:o,statePVTotal:pe,statePV1Power:ae,minLineWidth:ma,stopColour:oo,gridStatus:Fe,batteryCharge:ao,gridOffColour:An,batteryIcon:ro,formattedResultTime:Jr,showAux:Mn,nonessentialIcon:Qn,showNonessential:Ye,auxStatus:Je,nonessentialLoads:wn,additionalAuxLoad:Cn,stateAuxLoad1Extra:ut,stateAuxLoad2Extra:dt,iconNonessentialLoad1:Un,iconNonessentialLoad2:Vn,iconNonessentialLoad3:Zn,inverterStateMsg:na,auxType:kn,showDailyAux:zn,nonessentialPower:Dr,auxPower:xe,nonessLineWidth:Ba,grid169LineWidth:Oa,auxLineWidth:ja,iconAuxLoad1:Gn,iconAuxLoad2:Sn,stateDayAuxEnergy:i,stateAuxLoad1:K,stateAuxLoad2:q,stateNonessentialLoad1:B,stateNonessentialLoad2:H,stateNonessentialLoad3:R,autoScaledInverterPower:on,autoScaledGridPower:sn,auxDynamicColour:Be,auxDynamicColourLoad1:Re,auxDynamicColourLoad2:Ie,stateMaxSellPower:Dt,totalPVEfficiency:ho,PV1Efficiency:go,PV2Efficiency:po,PV3Efficiency:yo,PV4Efficiency:mo,PV5Efficiency:vo,gridPercentage:Za,flowColour:Ka,flowBatColour:Ja,flowInvColour:qa,dynamicColourEssentialLoad1:Ge,dynamicColourEssentialLoad2:Se,dynamicColourEssentialLoad3:Qe,dynamicColourEssentialLoad4:Ue,dynamicColourEssentialLoad5:Ve,dynamicColourEssentialLoad6:Ze,dynamicColourEssentialLoad7:_e,dynamicColourEssentialLoad8:We,dynamicColourNonEssentialLoad1:yn,dynamicColourNonEssentialLoad2:mn,dynamicColourNonEssentialLoad3:vn,stateBatterySOH:T,customGridIcon:Ao,customGridIconColour:wo})}getEntity(t,e={state:"0",attributes:{unit_of_measurement:""}}){let n;const r=String(t).split(".");r.length>1?n=this._config[r[0]][r[1]]:r.length>0&&(n=this._config[r[0]]);const a=n?this.hass.states[n]:void 0;return Wr(void 0!==a?a:e||{state:void 0})}changeAnimationSpeed(t,e){const n=e>=1?Zt.toNum(e,3):1,r=this["".concat(t,"Flow")];this.durationCur[t]=n,r&&this.durationPrev[t]!=n&&r.setCurrentTime(r.getCurrentTime()*(n/this.durationPrev[t])),this.durationPrev[t]=this.durationCur[t]}get isCompactCard(){return!0}get isLiteCard(){return!1}colourConvert(t){return t&&Array.isArray(t)?"rgb(".concat(t,")"):t}dynamicLineWidth(t,e,n,r=1){let a;return a=this._config.dynamic_line_width?Math.min(r+Math.min(t/e,1)*n,8):Math.min(r,8),a}calculateAuxLoadColour(t,e){return this._config.load.aux_dynamic_colour?Math.abs(t)>e?this.colourConvert(this._config.load?.aux_colour):"grey":this.colourConvert(this._config.load?.aux_colour)}calculateEssentialLoadColour(t,e){return this._config.load.dynamic_colour?Math.abs(t)>e?this.colourConvert(this._config.load?.colour):"grey":this.colourConvert(this._config.load?.colour)}setConfig(t){if(t.show_battery&&!t.battery)throw Error(Et("errors.battery.bat"));if(t.show_battery&&!t.battery.shutdown_soc)throw new Error(Et("errors.battery.shutdown_soc"));if(t.show_battery&&t.battery.show_daily&&(!t.entities.day_battery_charge_70||!t.entities.day_battery_discharge_71))throw Error(Et("errors.battery.show_daily"));if(t.show_solar&&!t.solar)throw Error(Et("errors.solar.sol"));if(t.show_solar&&!t.solar.mppts)throw Error(Et("errors.solar.mppts"));if(t&&t.grid&&t.grid.show_daily_buy&&!t.entities.day_grid_import_76||t&&t.grid&&t.grid.show_daily_sell&&!t.entities.day_grid_export_77)throw Error(Et("errors.grid.show_daily"));if(t&&t.entities&&"none"===t.entities.essential_power&&!t.entities.inverter_power_175||t&&t.entities&&"none"===t.entities.essential_power&&"none"===t.entities.inverter_power_175)throw Error(Et("errors.essential_power"));if(t&&t.entities&&"none"===t.entities.nonessential_power&&!t.entities.grid_power_169)throw Error(Et("errors.nonessential_power"));const e=["battery_soc_184","battery_power_190","battery_current_191","grid_ct_power_172","pv1_power_186"];for(const n of e)if("pv1_power_186"===n&&t.show_solar&&!t.entities[n]&&!t.entities[n])throw new Error("".concat(Et("errors.missing_entity")," e.g: ").concat(n,": sensor.example"));const n=t;this._config=Vt({},Lt,n)}getCardSize(){return 2}};var Yr,Fr;t([dt()],Xr.prototype,"hass",void 0),t([dt()],Xr.prototype,"_config",void 0),t([ft("#grid-flow")],Xr.prototype,"gridFlow",void 0),t([ft("#grid1-flow")],Xr.prototype,"grid1Flow",void 0),t([ft("#solar-flow")],Xr.prototype,"solarFlow",void 0),t([ft("#pv1-flow")],Xr.prototype,"pv1Flow",void 0),t([ft("#pv2-flow")],Xr.prototype,"pv2Flow",void 0),t([ft("#pv3-flow")],Xr.prototype,"pv3Flow",void 0),t([ft("#pv4-flow")],Xr.prototype,"pv4Flow",void 0),t([ft("#pv5-flow")],Xr.prototype,"pv5Flow",void 0),t([ft("#battery-flow")],Xr.prototype,"batteryFlow",void 0),t([ft("#load-flow")],Xr.prototype,"loadFlow",void 0),t([ft("#aux-flow")],Xr.prototype,"auxFlow",void 0),t([ft("#ne-flow")],Xr.prototype,"neFlow",void 0),t([ft("#ne1-flow")],Xr.prototype,"ne1Flow",void 0),Xr=t([lt("mlk-power-flow-card")],Xr),window.customCards.push({type:"mlk-power-flow-card",name:"Power Flow Card by Molikk",preview:!0,description:Et("common.description"),configurable:!0}),function(t){t.language="language",t.system="system",t.comma_decimal="comma_decimal",t.decimal_comma="decimal_comma",t.space_comma="space_comma",t.none="none"}(Yr||(Yr={})),function(t){t.language="language",t.system="system",t.am_pm="12",t.twenty_four="24"}(Fr||(Fr={}));var Jr,Kr,qr={exports:{}};Jr=qr,Kr=qr.exports,function(){var t,e="Expected a function",n="__lodash_hash_undefined__",r="__lodash_placeholder__",a=16,o=32,i=64,s=128,l=256,c=1/0,u=9007199254740991,d=NaN,f=4294967295,h=[["ary",s],["bind",1],["bindKey",2],["curry",8],["curryRight",a],["flip",512],["partial",o],["partialRight",i],["rearg",l]],g="[object Arguments]",p="[object Array]",y="[object Boolean]",m="[object Date]",v="[object Error]",A="[object Function]",w="[object GeneratorFunction]",b="[object Map]",x="[object Number]",P="[object Object]",E="[object Promise]",L="[object RegExp]",M="[object Set]",z="[object String]",N="[object Symbol]",C="[object WeakMap]",k="[object ArrayBuffer]",T="[object DataView]",j="[object Float32Array]",D="[object Float64Array]",O="[object Int8Array]",B="[object Int16Array]",H="[object Int32Array]",R="[object Uint8Array]",I="[object Uint8ClampedArray]",G="[object Uint16Array]",S="[object Uint32Array]",Q=/\b__p \+= '';/g,U=/\b(__p \+=) '' \+/g,V=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Z=/&(?:amp|lt|gt|quot|#39);/g,_=/[&<>"']/g,W=RegExp(Z.source),X=RegExp(_.source),Y=/<%-([\s\S]+?)%>/g,F=/<%([\s\S]+?)%>/g,J=/<%=([\s\S]+?)%>/g,K=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,q=/^\w*$/,$=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,tt=/[\\^$.*+?()[\]{}|]/g,et=RegExp(tt.source),nt=/^\s+/,rt=/\s/,at=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ot=/\{\n\/\* \[wrapped with (.+)\] \*/,it=/,? & /,st=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,lt=/[()=,{}\[\]\/\s]/,ct=/\\(\\)?/g,ut=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,dt=/\w*$/,ft=/^[-+]0x[0-9a-f]+$/i,ht=/^0b[01]+$/i,gt=/^\[object .+?Constructor\]$/,pt=/^0o[0-7]+$/i,yt=/^(?:0|[1-9]\d*)$/,mt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,vt=/($^)/,At=/['\n\r\u2028\u2029\\]/g,wt="\\ud800-\\udfff",bt="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",xt="\\u2700-\\u27bf",Pt="a-z\\xdf-\\xf6\\xf8-\\xff",Et="A-Z\\xc0-\\xd6\\xd8-\\xde",Lt="\\ufe0e\\ufe0f",Mt="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",zt="['’]",Nt="["+wt+"]",Ct="["+Mt+"]",kt="["+bt+"]",Tt="\\d+",jt="["+xt+"]",Dt="["+Pt+"]",Ot="[^"+wt+Mt+Tt+xt+Pt+Et+"]",Bt="\\ud83c[\\udffb-\\udfff]",Ht="[^"+wt+"]",Rt="(?:\\ud83c[\\udde6-\\uddff]){2}",It="[\\ud800-\\udbff][\\udc00-\\udfff]",Gt="["+Et+"]",Qt="\\u200d",Ut="(?:"+Dt+"|"+Ot+")",Vt="(?:"+Gt+"|"+Ot+")",Zt="(?:['’](?:d|ll|m|re|s|t|ve))?",_t="(?:['’](?:D|LL|M|RE|S|T|VE))?",Wt="(?:"+kt+"|"+Bt+")?",Xt="["+Lt+"]?",Yt=Xt+Wt+"(?:"+Qt+"(?:"+[Ht,Rt,It].join("|")+")"+Xt+Wt+")*",Ft="(?:"+[jt,Rt,It].join("|")+")"+Yt,Jt="(?:"+[Ht+kt+"?",kt,Rt,It,Nt].join("|")+")",Kt=RegExp(zt,"g"),qt=RegExp(kt,"g"),$t=RegExp(Bt+"(?="+Bt+")|"+Jt+Yt,"g"),te=RegExp([Gt+"?"+Dt+"+"+Zt+"(?="+[Ct,Gt,"$"].join("|")+")",Vt+"+"+_t+"(?="+[Ct,Gt+Ut,"$"].join("|")+")",Gt+"?"+Ut+"+"+Zt,Gt+"+"+_t,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Tt,Ft].join("|"),"g"),ee=RegExp("["+Qt+wt+bt+Lt+"]"),ne=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,re=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],ae=-1,oe={};oe[j]=oe[D]=oe[O]=oe[B]=oe[H]=oe[R]=oe[I]=oe[G]=oe[S]=!0,oe[g]=oe[p]=oe[k]=oe[y]=oe[T]=oe[m]=oe[v]=oe[A]=oe[b]=oe[x]=oe[P]=oe[L]=oe[M]=oe[z]=oe[C]=!1;var ie={};ie[g]=ie[p]=ie[k]=ie[T]=ie[y]=ie[m]=ie[j]=ie[D]=ie[O]=ie[B]=ie[H]=ie[b]=ie[x]=ie[P]=ie[L]=ie[M]=ie[z]=ie[N]=ie[R]=ie[I]=ie[G]=ie[S]=!0,ie[v]=ie[A]=ie[C]=!1;var se={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},le=parseFloat,ce=parseInt,ue="object"==typeof St&&St&&St.Object===Object&&St,de="object"==typeof self&&self&&self.Object===Object&&self,fe=ue||de||Function("return this")(),he=Kr&&!Kr.nodeType&&Kr,ge=he&&Jr&&!Jr.nodeType&&Jr,pe=ge&&ge.exports===he,ye=pe&&ue.process,me=function(){try{var t=ge&&ge.require&&ge.require("util").types;return t||ye&&ye.binding&&ye.binding("util")}catch(t){}}(),ve=me&&me.isArrayBuffer,Ae=me&&me.isDate,we=me&&me.isMap,be=me&&me.isRegExp,xe=me&&me.isSet,Pe=me&&me.isTypedArray;function Ee(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function Le(t,e,n,r){for(var a=-1,o=null==t?0:t.length;++a-1}function Te(t,e,n){for(var r=-1,a=null==t?0:t.length;++r-1;);return n}function tn(t,e){for(var n=t.length;n--&&Se(e,t[n],0)>-1;);return n}var en=_e({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),nn=_e({"&":"&","<":"<",">":">",'"':""","'":"'"});function rn(t){return"\\"+se[t]}function an(t){return ee.test(t)}function on(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n}function sn(t,e){return function(n){return t(e(n))}}function ln(t,e){for(var n=-1,a=t.length,o=0,i=[];++n",""":'"',"'":"'"}),pn=function rt(wt){var bt,xt=(wt=null==wt?fe:pn.defaults(fe.Object(),wt,pn.pick(fe,re))).Array,Pt=wt.Date,Et=wt.Error,Lt=wt.Function,Mt=wt.Math,zt=wt.Object,Nt=wt.RegExp,Ct=wt.String,kt=wt.TypeError,Tt=xt.prototype,jt=Lt.prototype,Dt=zt.prototype,Ot=wt["__core-js_shared__"],Bt=jt.toString,Ht=Dt.hasOwnProperty,Rt=0,It=(bt=/[^.]+$/.exec(Ot&&Ot.keys&&Ot.keys.IE_PROTO||""))?"Symbol(src)_1."+bt:"",Gt=Dt.toString,St=Bt.call(zt),Qt=fe._,Ut=Nt("^"+Bt.call(Ht).replace(tt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Vt=pe?wt.Buffer:t,Zt=wt.Symbol,_t=wt.Uint8Array,Wt=Vt?Vt.allocUnsafe:t,Xt=sn(zt.getPrototypeOf,zt),Yt=zt.create,Ft=Dt.propertyIsEnumerable,Jt=Tt.splice,$t=Zt?Zt.isConcatSpreadable:t,ee=Zt?Zt.iterator:t,se=Zt?Zt.toStringTag:t,ue=function(){try{var t=ho(zt,"defineProperty");return t({},"",{}),t}catch(t){}}(),de=wt.clearTimeout!==fe.clearTimeout&&wt.clearTimeout,he=Pt&&Pt.now!==fe.Date.now&&Pt.now,ge=wt.setTimeout!==fe.setTimeout&&wt.setTimeout,ye=Mt.ceil,me=Mt.floor,Re=zt.getOwnPropertySymbols,_e=Vt?Vt.isBuffer:t,yn=wt.isFinite,mn=Tt.join,vn=sn(zt.keys,zt),An=Mt.max,wn=Mt.min,bn=Pt.now,xn=wt.parseInt,Pn=Mt.random,En=Tt.reverse,Ln=ho(wt,"DataView"),Mn=ho(wt,"Map"),zn=ho(wt,"Promise"),Nn=ho(wt,"Set"),Cn=ho(wt,"WeakMap"),kn=ho(zt,"create"),Tn=Cn&&new Cn,jn={},Dn=Go(Ln),On=Go(Mn),Bn=Go(zn),Hn=Go(Nn),Rn=Go(Cn),In=Zt?Zt.prototype:t,Gn=In?In.valueOf:t,Sn=In?In.toString:t;function Qn(t){if(ns(t)&&!_i(t)&&!(t instanceof _n)){if(t instanceof Zn)return t;if(Ht.call(t,"__wrapped__"))return So(t)}return new Zn(t)}var Un=function(){function e(){}return function(n){if(!es(n))return{};if(Yt)return Yt(n);e.prototype=n;var r=new e;return e.prototype=t,r}}();function Vn(){}function Zn(e,n){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!n,this.__index__=0,this.__values__=t}function _n(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=f,this.__views__=[]}function Wn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e=n?e:n)),e}function cr(e,n,r,a,o,i){var s,l=1&n,c=2&n,u=4&n;if(r&&(s=o?r(e,a,o,i):r(e)),s!==t)return s;if(!es(e))return e;var d=_i(e);if(d){if(s=function(t){var e=t.length,n=new t.constructor(e);return e&&"string"==typeof t[0]&&Ht.call(t,"index")&&(n.index=t.index,n.input=t.input),n}(e),!l)return ka(e,s)}else{var f=yo(e),h=f==A||f==w;if(Fi(e))return Ea(e,l);if(f==P||f==g||h&&!o){if(s=c||h?{}:vo(e),!l)return c?function(t,e){return Ta(t,po(t),e)}(e,function(t,e){return t&&Ta(e,Ds(e),t)}(s,e)):function(t,e){return Ta(t,go(t),e)}(e,or(s,e))}else{if(!ie[f])return o?e:{};s=function(t,e,n){var r,a=t.constructor;switch(e){case k:return La(t);case y:case m:return new a(+t);case T:return function(t,e){var n=e?La(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,n);case j:case D:case O:case B:case H:case R:case I:case G:case S:return Ma(t,n);case b:return new a;case x:case z:return new a(t);case L:return function(t){var e=new t.constructor(t.source,dt.exec(t));return e.lastIndex=t.lastIndex,e}(t);case M:return new a;case N:return r=t,Gn?zt(Gn.call(r)):{}}}(e,f,l)}}i||(i=new Jn);var p=i.get(e);if(p)return p;i.set(e,s),ss(e)?e.forEach((function(t){s.add(cr(t,n,r,t,e,i))})):rs(e)&&e.forEach((function(t,a){s.set(a,cr(t,n,r,a,e,i))}));var v=d?t:(u?c?oo:ao:c?Ds:js)(e);return Me(v||e,(function(t,a){v&&(t=e[a=t]),nr(s,a,cr(t,n,r,a,e,i))})),s}function ur(e,n,r){var a=r.length;if(null==e)return!a;for(e=zt(e);a--;){var o=r[a],i=n[o],s=e[o];if(s===t&&!(o in e)||!i(s))return!1}return!0}function dr(n,r,a){if("function"!=typeof n)throw new kt(e);return jo((function(){n.apply(t,a)}),r)}function fr(t,e,n,r){var a=-1,o=ke,i=!0,s=t.length,l=[],c=e.length;if(!s)return l;n&&(e=je(e,Je(n))),r?(o=Te,i=!1):e.length>=200&&(o=qe,i=!1,e=new Fn(e));t:for(;++a-1},Xn.prototype.set=function(t,e){var n=this.__data__,r=rr(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this},Yn.prototype.clear=function(){this.size=0,this.__data__={hash:new Wn,map:new(Mn||Xn),string:new Wn}},Yn.prototype.delete=function(t){var e=uo(this,t).delete(t);return this.size-=e?1:0,e},Yn.prototype.get=function(t){return uo(this,t).get(t)},Yn.prototype.has=function(t){return uo(this,t).has(t)},Yn.prototype.set=function(t,e){var n=uo(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this},Fn.prototype.add=Fn.prototype.push=function(t){return this.__data__.set(t,n),this},Fn.prototype.has=function(t){return this.__data__.has(t)},Jn.prototype.clear=function(){this.__data__=new Xn,this.size=0},Jn.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},Jn.prototype.get=function(t){return this.__data__.get(t)},Jn.prototype.has=function(t){return this.__data__.has(t)},Jn.prototype.set=function(t,e){var n=this.__data__;if(n instanceof Xn){var r=n.__data__;if(!Mn||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new Yn(r)}return n.set(t,e),this.size=n.size,this};var hr=Oa(br),gr=Oa(xr,!0);function pr(t,e){var n=!0;return hr(t,(function(t,r,a){return n=!!e(t,r,a)})),n}function yr(e,n,r){for(var a=-1,o=e.length;++a0&&n(s)?e>1?vr(s,e-1,n,r,a):De(a,s):r||(a[a.length]=s)}return a}var Ar=Ba(),wr=Ba(!0);function br(t,e){return t&&Ar(t,e,js)}function xr(t,e){return t&&wr(t,e,js)}function Pr(t,e){return Ce(e,(function(e){return qi(t[e])}))}function Er(e,n){for(var r=0,a=(n=wa(n,e)).length;null!=e&&re}function Nr(t,e){return null!=t&&Ht.call(t,e)}function Cr(t,e){return null!=t&&e in zt(t)}function kr(e,n,r){for(var a=r?Te:ke,o=e[0].length,i=e.length,s=i,l=xt(i),c=1/0,u=[];s--;){var d=e[s];s&&n&&(d=je(d,Je(n))),c=wn(d.length,c),l[s]=!r&&(n||o>=120&&d.length>=120)?new Fn(s&&d):t}d=e[0];var f=-1,h=l[0];t:for(;++f=s?l:l*("desc"==n[r]?-1:1)}return t.index-e.index}(t,e,n)}))}function Wr(t,e,n){for(var r=-1,a=e.length,o={};++r-1;)s!==t&&Jt.call(s,l,1),Jt.call(t,l,1);return t}function Yr(t,e){for(var n=t?e.length:0,r=n-1;n--;){var a=e[n];if(n==r||a!==o){var o=a;wo(a)?Jt.call(t,a,1):fa(t,a)}}return t}function Fr(t,e){return t+me(Pn()*(e-t+1))}function Jr(t,e){var n="";if(!t||e<1||e>u)return n;do{e%2&&(n+=t),(e=me(e/2))&&(t+=t)}while(e);return n}function Kr(t,e){return Do(No(t,e,al),t+"")}function qr(t){return qn(Qs(t))}function $r(t,e){var n=Qs(t);return Ho(n,lr(e,0,n.length))}function ta(e,n,r,a){if(!es(e))return e;for(var o=-1,i=(n=wa(n,e)).length,s=i-1,l=e;null!=l&&++oa?0:a+e),(n=n>a?a:n)<0&&(n+=a),a=e>n?0:n-e>>>0,e>>>=0;for(var o=xt(a);++r>>1,i=t[o];null!==i&&!cs(i)&&(n?i<=e:i=200){var c=e?null:Ja(t);if(c)return cn(c);i=!1,a=qe,l=new Fn}else l=e?[]:s;t:for(;++r=a?e:aa(e,n,r)}var Pa=de||function(t){return fe.clearTimeout(t)};function Ea(t,e){if(e)return t.slice();var n=t.length,r=Wt?Wt(n):new t.constructor(n);return t.copy(r),r}function La(t){var e=new t.constructor(t.byteLength);return new _t(e).set(new _t(t)),e}function Ma(t,e){var n=e?La(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function za(e,n){if(e!==n){var r=e!==t,a=null===e,o=e==e,i=cs(e),s=n!==t,l=null===n,c=n==n,u=cs(n);if(!l&&!u&&!i&&e>n||i&&s&&c&&!l&&!u||a&&s&&c||!r&&c||!o)return 1;if(!a&&!i&&!u&&e1?r[o-1]:t,s=o>2?r[2]:t;for(i=e.length>3&&"function"==typeof i?(o--,i):t,s&&bo(r[0],r[1],s)&&(i=o<3?t:i,o=1),n=zt(n);++a-1?o[i?n[s]:s]:t}}function Sa(n){return ro((function(r){var a=r.length,o=a,i=Zn.prototype.thru;for(n&&r.reverse();o--;){var s=r[o];if("function"!=typeof s)throw new kt(e);if(i&&!l&&"wrapper"==so(s))var l=new Zn([],!0)}for(o=l?o:a;++o1&&A.reverse(),f&&ul))return!1;var u=i.get(e),d=i.get(n);if(u&&d)return u==n&&d==e;var f=-1,h=!0,g=2&r?new Fn:t;for(i.set(e,n),i.set(n,e);++f-1&&t%1==0&&t1?"& ":"")+e[r],e=e.join(n>2?", ":" "),t.replace(at,"{\n/* [wrapped with "+e+"] */\n")}(r,function(t,e){return Me(h,(function(n){var r="_."+n[0];e&n[1]&&!ke(t,r)&&t.push(r)})),t.sort()}(function(t){var e=t.match(ot);return e?e[1].split(it):[]}(r),n)))}function Bo(e){var n=0,r=0;return function(){var a=bn(),o=16-(a-r);if(r=a,o>0){if(++n>=800)return arguments[0]}else n=0;return e.apply(t,arguments)}}function Ho(e,n){var r=-1,a=e.length,o=a-1;for(n=n===t?a:n;++r1?e[n-1]:t;return r="function"==typeof r?(e.pop(),r):t,ii(e,r)}));function hi(t){var e=Qn(t);return e.__chain__=!0,e}function gi(t,e){return e(t)}var pi=ro((function(e){var n=e.length,r=n?e[0]:0,a=this.__wrapped__,o=function(t){return sr(t,e)};return!(n>1||this.__actions__.length)&&a instanceof _n&&wo(r)?((a=a.slice(r,+r+(n?1:0))).__actions__.push({func:gi,args:[o],thisArg:t}),new Zn(a,this.__chain__).thru((function(e){return n&&!e.length&&e.push(t),e}))):this.thru(o)})),yi=ja((function(t,e,n){Ht.call(t,n)?++t[n]:ir(t,n,1)})),mi=Ga(Zo),vi=Ga(_o);function Ai(t,e){return(_i(t)?Me:hr)(t,co(e,3))}function wi(t,e){return(_i(t)?ze:gr)(t,co(e,3))}var bi=ja((function(t,e,n){Ht.call(t,n)?t[n].push(e):ir(t,n,[e])})),xi=Kr((function(t,e,n){var r=-1,a="function"==typeof e,o=Xi(t)?xt(t.length):[];return hr(t,(function(t){o[++r]=a?Ee(e,t,n):Tr(t,e,n)})),o})),Pi=ja((function(t,e,n){ir(t,n,e)}));function Ei(t,e){return(_i(t)?je:Sr)(t,co(e,3))}var Li=ja((function(t,e,n){t[n?0:1].push(e)}),(function(){return[[],[]]})),Mi=Kr((function(t,e){if(null==t)return[];var n=e.length;return n>1&&bo(t,e[0],e[1])?e=[]:n>2&&bo(e[0],e[1],e[2])&&(e=[e[0]]),_r(t,vr(e,1),[])})),zi=he||function(){return fe.Date.now()};function Ni(e,n,r){return n=r?t:n,n=e&&null==n?e.length:n,qa(e,s,t,t,t,t,n)}function Ci(n,r){var a;if("function"!=typeof r)throw new kt(e);return n=ps(n),function(){return--n>0&&(a=r.apply(this,arguments)),n<=1&&(r=t),a}}var ki=Kr((function(t,e,n){var r=1;if(n.length){var a=ln(n,lo(ki));r|=o}return qa(t,r,e,n,a)})),Ti=Kr((function(t,e,n){var r=3;if(n.length){var a=ln(n,lo(Ti));r|=o}return qa(e,r,t,n,a)}));function ji(n,r,a){var o,i,s,l,c,u,d=0,f=!1,h=!1,g=!0;if("function"!=typeof n)throw new kt(e);function p(e){var r=o,a=i;return o=i=t,d=e,l=n.apply(a,r)}function y(e){var n=e-u;return u===t||n>=r||n<0||h&&e-d>=s}function m(){var t=zi();if(y(t))return v(t);c=jo(m,function(t){var e=r-(t-u);return h?wn(e,s-(t-d)):e}(t))}function v(e){return c=t,g&&o?p(e):(o=i=t,l)}function A(){var e=zi(),n=y(e);if(o=arguments,i=this,u=e,n){if(c===t)return function(t){return d=t,c=jo(m,r),f?p(t):l}(u);if(h)return Pa(c),c=jo(m,r),p(u)}return c===t&&(c=jo(m,r)),l}return r=ms(r)||0,es(a)&&(f=!!a.leading,s=(h="maxWait"in a)?An(ms(a.maxWait)||0,r):s,g="trailing"in a?!!a.trailing:g),A.cancel=function(){c!==t&&Pa(c),d=0,o=u=i=c=t},A.flush=function(){return c===t?l:v(zi())},A}var Di=Kr((function(t,e){return dr(t,1,e)})),Oi=Kr((function(t,e,n){return dr(t,ms(e)||0,n)}));function Bi(t,n){if("function"!=typeof t||null!=n&&"function"!=typeof n)throw new kt(e);var r=function(){var e=arguments,a=n?n.apply(this,e):e[0],o=r.cache;if(o.has(a))return o.get(a);var i=t.apply(this,e);return r.cache=o.set(a,i)||o,i};return r.cache=new(Bi.Cache||Yn),r}function Hi(t){if("function"!=typeof t)throw new kt(e);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}Bi.Cache=Yn;var Ri=ba((function(t,e){var n=(e=1==e.length&&_i(e[0])?je(e[0],Je(co())):je(vr(e,1),Je(co()))).length;return Kr((function(r){for(var a=-1,o=wn(r.length,n);++a=e})),Zi=jr(function(){return arguments}())?jr:function(t){return ns(t)&&Ht.call(t,"callee")&&!Ft.call(t,"callee")},_i=xt.isArray,Wi=ve?Je(ve):function(t){return ns(t)&&Mr(t)==k};function Xi(t){return null!=t&&ts(t.length)&&!qi(t)}function Yi(t){return ns(t)&&Xi(t)}var Fi=_e||ml,Ji=Ae?Je(Ae):function(t){return ns(t)&&Mr(t)==m};function Ki(t){if(!ns(t))return!1;var e=Mr(t);return e==v||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!os(t)}function qi(t){if(!es(t))return!1;var e=Mr(t);return e==A||e==w||"[object AsyncFunction]"==e||"[object Proxy]"==e}function $i(t){return"number"==typeof t&&t==ps(t)}function ts(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=u}function es(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function ns(t){return null!=t&&"object"==typeof t}var rs=we?Je(we):function(t){return ns(t)&&yo(t)==b};function as(t){return"number"==typeof t||ns(t)&&Mr(t)==x}function os(t){if(!ns(t)||Mr(t)!=P)return!1;var e=Xt(t);if(null===e)return!0;var n=Ht.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&Bt.call(n)==St}var is=be?Je(be):function(t){return ns(t)&&Mr(t)==L},ss=xe?Je(xe):function(t){return ns(t)&&yo(t)==M};function ls(t){return"string"==typeof t||!_i(t)&&ns(t)&&Mr(t)==z}function cs(t){return"symbol"==typeof t||ns(t)&&Mr(t)==N}var us=Pe?Je(Pe):function(t){return ns(t)&&ts(t.length)&&!!oe[Mr(t)]},ds=Xa(Gr),fs=Xa((function(t,e){return t<=e}));function hs(t){if(!t)return[];if(Xi(t))return ls(t)?fn(t):ka(t);if(ee&&t[ee])return function(t){for(var e,n=[];!(e=t.next()).done;)n.push(e.value);return n}(t[ee]());var e=yo(t);return(e==b?on:e==M?cn:Qs)(t)}function gs(t){return t?(t=ms(t))===c||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function ps(t){var e=gs(t),n=e%1;return e==e?n?e-n:e:0}function ys(t){return t?lr(ps(t),0,f):0}function ms(t){if("number"==typeof t)return t;if(cs(t))return d;if(es(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=es(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=Fe(t);var n=ht.test(t);return n||pt.test(t)?ce(t.slice(2),n?2:8):ft.test(t)?d:+t}function vs(t){return Ta(t,Ds(t))}function As(t){return null==t?"":ua(t)}var ws=Da((function(t,e){if(Lo(e)||Xi(e))Ta(e,js(e),t);else for(var n in e)Ht.call(e,n)&&nr(t,n,e[n])})),bs=Da((function(t,e){Ta(e,Ds(e),t)})),xs=Da((function(t,e,n,r){Ta(e,Ds(e),t,r)})),Ps=Da((function(t,e,n,r){Ta(e,js(e),t,r)})),Es=ro(sr),Ls=Kr((function(e,n){e=zt(e);var r=-1,a=n.length,o=a>2?n[2]:t;for(o&&bo(n[0],n[1],o)&&(a=1);++r1),e})),Ta(t,oo(t),n),r&&(n=cr(n,7,eo));for(var a=e.length;a--;)fa(n,e[a]);return n})),Rs=ro((function(t,e){return null==t?{}:function(t,e){return Wr(t,e,(function(e,n){return Ns(t,n)}))}(t,e)}));function Is(t,e){if(null==t)return{};var n=je(oo(t),(function(t){return[t]}));return e=co(e),Wr(t,n,(function(t,n){return e(t,n[0])}))}var Gs=Ka(js),Ss=Ka(Ds);function Qs(t){return null==t?[]:Ke(t,js(t))}var Us=Ra((function(t,e,n){return e=e.toLowerCase(),t+(n?Vs(e):e)}));function Vs(t){return Ks(As(t).toLowerCase())}function Zs(t){return(t=As(t))&&t.replace(mt,en).replace(qt,"")}var _s=Ra((function(t,e,n){return t+(n?"-":"")+e.toLowerCase()})),Ws=Ra((function(t,e,n){return t+(n?" ":"")+e.toLowerCase()})),Xs=Ha("toLowerCase"),Ys=Ra((function(t,e,n){return t+(n?"_":"")+e.toLowerCase()})),Fs=Ra((function(t,e,n){return t+(n?" ":"")+Ks(e)})),Js=Ra((function(t,e,n){return t+(n?" ":"")+e.toUpperCase()})),Ks=Ha("toUpperCase");function qs(e,n,r){return e=As(e),(n=r?t:n)===t?function(t){return ne.test(t)}(e)?function(t){return t.match(te)||[]}(e):function(t){return t.match(st)||[]}(e):e.match(n)||[]}var $s=Kr((function(e,n){try{return Ee(e,t,n)}catch(t){return Ki(t)?t:new Et(t)}})),tl=ro((function(t,e){return Me(e,(function(e){e=Io(e),ir(t,e,ki(t[e],t))})),t}));function el(t){return function(){return t}}var nl=Sa(),rl=Sa(!0);function al(t){return t}function ol(t){return Hr("function"==typeof t?t:cr(t,1))}var il=Kr((function(t,e){return function(n){return Tr(n,t,e)}})),sl=Kr((function(t,e){return function(n){return Tr(t,n,e)}}));function ll(t,e,n){var r=js(e),a=Pr(e,r);null!=n||es(e)&&(a.length||!r.length)||(n=e,e=t,t=this,a=Pr(e,js(e)));var o=!(es(n)&&"chain"in n&&!n.chain),i=qi(t);return Me(a,(function(n){var r=e[n];t[n]=r,i&&(t.prototype[n]=function(){var e=this.__chain__;if(o||e){var n=t(this.__wrapped__);return(n.__actions__=ka(this.__actions__)).push({func:r,args:arguments,thisArg:t}),n.__chain__=e,n}return r.apply(t,De([this.value()],arguments))})})),t}function cl(){}var ul=Za(je),dl=Za(Ne),fl=Za(He);function hl(t){return xo(t)?Ze(Io(t)):function(t){return function(e){return Er(e,t)}}(t)}var gl=Wa(),pl=Wa(!0);function yl(){return[]}function ml(){return!1}var vl,Al=Va((function(t,e){return t+e}),0),wl=Fa("ceil"),bl=Va((function(t,e){return t/e}),1),xl=Fa("floor"),Pl=Va((function(t,e){return t*e}),1),El=Fa("round"),Ll=Va((function(t,e){return t-e}),0);return Qn.after=function(t,n){if("function"!=typeof n)throw new kt(e);return t=ps(t),function(){if(--t<1)return n.apply(this,arguments)}},Qn.ary=Ni,Qn.assign=ws,Qn.assignIn=bs,Qn.assignInWith=xs,Qn.assignWith=Ps,Qn.at=Es,Qn.before=Ci,Qn.bind=ki,Qn.bindAll=tl,Qn.bindKey=Ti,Qn.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return _i(t)?t:[t]},Qn.chain=hi,Qn.chunk=function(e,n,r){n=(r?bo(e,n,r):n===t)?1:An(ps(n),0);var a=null==e?0:e.length;if(!a||n<1)return[];for(var o=0,i=0,s=xt(ye(a/n));oo?0:o+r),(a=a===t||a>o?o:ps(a))<0&&(a+=o),a=r>a?0:ys(a);r>>0)?(e=As(e))&&("string"==typeof n||null!=n&&!is(n))&&!(n=ua(n))&&an(e)?xa(fn(e),0,r):e.split(n,r):[]},Qn.spread=function(t,n){if("function"!=typeof t)throw new kt(e);return n=null==n?0:An(ps(n),0),Kr((function(e){var r=e[n],a=xa(e,0,n);return r&&De(a,r),Ee(t,this,a)}))},Qn.tail=function(t){var e=null==t?0:t.length;return e?aa(t,1,e):[]},Qn.take=function(e,n,r){return e&&e.length?aa(e,0,(n=r||n===t?1:ps(n))<0?0:n):[]},Qn.takeRight=function(e,n,r){var a=null==e?0:e.length;return a?aa(e,(n=a-(n=r||n===t?1:ps(n)))<0?0:n,a):[]},Qn.takeRightWhile=function(t,e){return t&&t.length?ga(t,co(e,3),!1,!0):[]},Qn.takeWhile=function(t,e){return t&&t.length?ga(t,co(e,3)):[]},Qn.tap=function(t,e){return e(t),t},Qn.throttle=function(t,n,r){var a=!0,o=!0;if("function"!=typeof t)throw new kt(e);return es(r)&&(a="leading"in r?!!r.leading:a,o="trailing"in r?!!r.trailing:o),ji(t,n,{leading:a,maxWait:n,trailing:o})},Qn.thru=gi,Qn.toArray=hs,Qn.toPairs=Gs,Qn.toPairsIn=Ss,Qn.toPath=function(t){return _i(t)?je(t,Io):cs(t)?[t]:ka(Ro(As(t)))},Qn.toPlainObject=vs,Qn.transform=function(t,e,n){var r=_i(t),a=r||Fi(t)||us(t);if(e=co(e,4),null==n){var o=t&&t.constructor;n=a?r?new o:[]:es(t)&&qi(o)?Un(Xt(t)):{}}return(a?Me:br)(t,(function(t,r,a){return e(n,t,r,a)})),n},Qn.unary=function(t){return Ni(t,1)},Qn.union=ni,Qn.unionBy=ri,Qn.unionWith=ai,Qn.uniq=function(t){return t&&t.length?da(t):[]},Qn.uniqBy=function(t,e){return t&&t.length?da(t,co(e,2)):[]},Qn.uniqWith=function(e,n){return n="function"==typeof n?n:t,e&&e.length?da(e,t,n):[]},Qn.unset=function(t,e){return null==t||fa(t,e)},Qn.unzip=oi,Qn.unzipWith=ii,Qn.update=function(t,e,n){return null==t?t:ha(t,e,Aa(n))},Qn.updateWith=function(e,n,r,a){return a="function"==typeof a?a:t,null==e?e:ha(e,n,Aa(r),a)},Qn.values=Qs,Qn.valuesIn=function(t){return null==t?[]:Ke(t,Ds(t))},Qn.without=si,Qn.words=qs,Qn.wrap=function(t,e){return Ii(Aa(e),t)},Qn.xor=li,Qn.xorBy=ci,Qn.xorWith=ui,Qn.zip=di,Qn.zipObject=function(t,e){return ma(t||[],e||[],nr)},Qn.zipObjectDeep=function(t,e){return ma(t||[],e||[],ta)},Qn.zipWith=fi,Qn.entries=Gs,Qn.entriesIn=Ss,Qn.extend=bs,Qn.extendWith=xs,ll(Qn,Qn),Qn.add=Al,Qn.attempt=$s,Qn.camelCase=Us,Qn.capitalize=Vs,Qn.ceil=wl,Qn.clamp=function(e,n,r){return r===t&&(r=n,n=t),r!==t&&(r=(r=ms(r))==r?r:0),n!==t&&(n=(n=ms(n))==n?n:0),lr(ms(e),n,r)},Qn.clone=function(t){return cr(t,4)},Qn.cloneDeep=function(t){return cr(t,5)},Qn.cloneDeepWith=function(e,n){return cr(e,5,n="function"==typeof n?n:t)},Qn.cloneWith=function(e,n){return cr(e,4,n="function"==typeof n?n:t)},Qn.conformsTo=function(t,e){return null==e||ur(t,e,js(e))},Qn.deburr=Zs,Qn.defaultTo=function(t,e){return null==t||t!=t?e:t},Qn.divide=bl,Qn.endsWith=function(e,n,r){e=As(e),n=ua(n);var a=e.length,o=r=r===t?a:lr(ps(r),0,a);return(r-=n.length)>=0&&e.slice(r,o)==n},Qn.eq=Qi,Qn.escape=function(t){return(t=As(t))&&X.test(t)?t.replace(_,nn):t},Qn.escapeRegExp=function(t){return(t=As(t))&&et.test(t)?t.replace(tt,"\\$&"):t},Qn.every=function(e,n,r){var a=_i(e)?Ne:pr;return r&&bo(e,n,r)&&(n=t),a(e,co(n,3))},Qn.find=mi,Qn.findIndex=Zo,Qn.findKey=function(t,e){return Ie(t,co(e,3),br)},Qn.findLast=vi,Qn.findLastIndex=_o,Qn.findLastKey=function(t,e){return Ie(t,co(e,3),xr)},Qn.floor=xl,Qn.forEach=Ai,Qn.forEachRight=wi,Qn.forIn=function(t,e){return null==t?t:Ar(t,co(e,3),Ds)},Qn.forInRight=function(t,e){return null==t?t:wr(t,co(e,3),Ds)},Qn.forOwn=function(t,e){return t&&br(t,co(e,3))},Qn.forOwnRight=function(t,e){return t&&xr(t,co(e,3))},Qn.get=zs,Qn.gt=Ui,Qn.gte=Vi,Qn.has=function(t,e){return null!=t&&mo(t,e,Nr)},Qn.hasIn=Ns,Qn.head=Xo,Qn.identity=al,Qn.includes=function(t,e,n,r){t=Xi(t)?t:Qs(t),n=n&&!r?ps(n):0;var a=t.length;return n<0&&(n=An(a+n,0)),ls(t)?n<=a&&t.indexOf(e,n)>-1:!!a&&Se(t,e,n)>-1},Qn.indexOf=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var a=null==n?0:ps(n);return a<0&&(a=An(r+a,0)),Se(t,e,a)},Qn.inRange=function(e,n,r){return n=gs(n),r===t?(r=n,n=0):r=gs(r),function(t,e,n){return t>=wn(e,n)&&t=-9007199254740991&&t<=u},Qn.isSet=ss,Qn.isString=ls,Qn.isSymbol=cs,Qn.isTypedArray=us,Qn.isUndefined=function(e){return e===t},Qn.isWeakMap=function(t){return ns(t)&&yo(t)==C},Qn.isWeakSet=function(t){return ns(t)&&"[object WeakSet]"==Mr(t)},Qn.join=function(t,e){return null==t?"":mn.call(t,e)},Qn.kebabCase=_s,Qn.last=Ko,Qn.lastIndexOf=function(e,n,r){var a=null==e?0:e.length;if(!a)return-1;var o=a;return r!==t&&(o=(o=ps(r))<0?An(a+o,0):wn(o,a-1)),n==n?function(t,e,n){for(var r=n+1;r--;)if(t[r]===e)return r;return r}(e,n,o):Ge(e,Ue,o,!0)},Qn.lowerCase=Ws,Qn.lowerFirst=Xs,Qn.lt=ds,Qn.lte=fs,Qn.max=function(e){return e&&e.length?yr(e,al,zr):t},Qn.maxBy=function(e,n){return e&&e.length?yr(e,co(n,2),zr):t},Qn.mean=function(t){return Ve(t,al)},Qn.meanBy=function(t,e){return Ve(t,co(e,2))},Qn.min=function(e){return e&&e.length?yr(e,al,Gr):t},Qn.minBy=function(e,n){return e&&e.length?yr(e,co(n,2),Gr):t},Qn.stubArray=yl,Qn.stubFalse=ml,Qn.stubObject=function(){return{}},Qn.stubString=function(){return""},Qn.stubTrue=function(){return!0},Qn.multiply=Pl,Qn.nth=function(e,n){return e&&e.length?Zr(e,ps(n)):t},Qn.noConflict=function(){return fe._===this&&(fe._=Qt),this},Qn.noop=cl,Qn.now=zi,Qn.pad=function(t,e,n){t=As(t);var r=(e=ps(e))?dn(t):0;if(!e||r>=e)return t;var a=(e-r)/2;return _a(me(a),n)+t+_a(ye(a),n)},Qn.padEnd=function(t,e,n){t=As(t);var r=(e=ps(e))?dn(t):0;return e&&rn){var a=e;e=n,n=a}if(r||e%1||n%1){var o=Pn();return wn(e+o*(n-e+le("1e-"+((o+"").length-1))),n)}return Fr(e,n)},Qn.reduce=function(t,e,n){var r=_i(t)?Oe:We,a=arguments.length<3;return r(t,co(e,4),n,a,hr)},Qn.reduceRight=function(t,e,n){var r=_i(t)?Be:We,a=arguments.length<3;return r(t,co(e,4),n,a,gr)},Qn.repeat=function(e,n,r){return n=(r?bo(e,n,r):n===t)?1:ps(n),Jr(As(e),n)},Qn.replace=function(){var t=arguments,e=As(t[0]);return t.length<3?e:e.replace(t[1],t[2])},Qn.result=function(e,n,r){var a=-1,o=(n=wa(n,e)).length;for(o||(o=1,e=t);++au)return[];var n=f,r=wn(t,f);e=co(e),t-=f;for(var a=Ye(r,e);++n=i)return e;var l=r-dn(a);if(l<1)return a;var c=s?xa(s,0,l).join(""):e.slice(0,l);if(o===t)return c+a;if(s&&(l+=c.length-l),is(o)){if(e.slice(l).search(o)){var u,d=c;for(o.global||(o=Nt(o.source,As(dt.exec(o))+"g")),o.lastIndex=0;u=o.exec(d);)var f=u.index;c=c.slice(0,f===t?l:f)}}else if(e.indexOf(ua(o),l)!=l){var h=c.lastIndexOf(o);h>-1&&(c=c.slice(0,h))}return c+a},Qn.unescape=function(t){return(t=As(t))&&W.test(t)?t.replace(Z,gn):t},Qn.uniqueId=function(t){var e=++Rt;return As(t)+e},Qn.upperCase=Js,Qn.upperFirst=Ks,Qn.each=Ai,Qn.eachRight=wi,Qn.first=Xo,ll(Qn,(vl={},br(Qn,(function(t,e){Ht.call(Qn.prototype,e)||(vl[e]=t)})),vl),{chain:!1}),Qn.VERSION="4.17.21",Me(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){Qn[t].placeholder=Qn})),Me(["drop","take"],(function(e,n){_n.prototype[e]=function(r){r=r===t?1:An(ps(r),0);var a=this.__filtered__&&!n?new _n(this):this.clone();return a.__filtered__?a.__takeCount__=wn(r,a.__takeCount__):a.__views__.push({size:wn(r,f),type:e+(a.__dir__<0?"Right":"")}),a},_n.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),Me(["filter","map","takeWhile"],(function(t,e){var n=e+1,r=1==n||3==n;_n.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:co(t,3),type:n}),e.__filtered__=e.__filtered__||r,e}})),Me(["head","last"],(function(t,e){var n="take"+(e?"Right":"");_n.prototype[t]=function(){return this[n](1).value()[0]}})),Me(["initial","tail"],(function(t,e){var n="drop"+(e?"":"Right");_n.prototype[t]=function(){return this.__filtered__?new _n(this):this[n](1)}})),_n.prototype.compact=function(){return this.filter(al)},_n.prototype.find=function(t){return this.filter(t).head()},_n.prototype.findLast=function(t){return this.reverse().find(t)},_n.prototype.invokeMap=Kr((function(t,e){return"function"==typeof t?new _n(this):this.map((function(n){return Tr(n,t,e)}))})),_n.prototype.reject=function(t){return this.filter(Hi(co(t)))},_n.prototype.slice=function(e,n){e=ps(e);var r=this;return r.__filtered__&&(e>0||n<0)?new _n(r):(e<0?r=r.takeRight(-e):e&&(r=r.drop(e)),n!==t&&(r=(n=ps(n))<0?r.dropRight(-n):r.take(n-e)),r)},_n.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},_n.prototype.toArray=function(){return this.take(f)},br(_n.prototype,(function(e,n){var r=/^(?:filter|find|map|reject)|While$/.test(n),a=/^(?:head|last)$/.test(n),o=Qn[a?"take"+("last"==n?"Right":""):n],i=a||/^find/.test(n);o&&(Qn.prototype[n]=function(){var n=this.__wrapped__,s=a?[1]:arguments,l=n instanceof _n,c=s[0],u=l||_i(n),d=function(t){var e=o.apply(Qn,De([t],s));return a&&f?e[0]:e};u&&r&&"function"==typeof c&&1!=c.length&&(l=u=!1);var f=this.__chain__,h=!!this.__actions__.length,g=i&&!f,p=l&&!h;if(!i&&u){n=p?n:new _n(this);var y=e.apply(n,s);return y.__actions__.push({func:gi,args:[d],thisArg:t}),new Zn(y,f)}return g&&p?e.apply(this,s):(y=this.thru(d),g?a?y.value()[0]:y.value():y)})})),Me(["pop","push","shift","sort","splice","unshift"],(function(t){var e=Tt[t],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",r=/^(?:pop|shift)$/.test(t);Qn.prototype[t]=function(){var t=arguments;if(r&&!this.__chain__){var a=this.value();return e.apply(_i(a)?a:[],t)}return this[n]((function(n){return e.apply(_i(n)?n:[],t)}))}})),br(_n.prototype,(function(t,e){var n=Qn[e];if(n){var r=n.name+"";Ht.call(jn,r)||(jn[r]=[]),jn[r].push({name:e,func:n})}})),jn[Qa(t,2).name]=[{name:"wrapper",func:t}],_n.prototype.clone=function(){var t=new _n(this.__wrapped__);return t.__actions__=ka(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=ka(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=ka(this.__views__),t},_n.prototype.reverse=function(){if(this.__filtered__){var t=new _n(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},_n.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,n=_i(t),r=e<0,a=n?t.length:0,o=function(t,e,n){for(var r=-1,a=n.length;++r=this.__values__.length;return{done:e,value:e?t:this.__values__[this.__index__++]}},Qn.prototype.plant=function(e){for(var n,r=this;r instanceof Vn;){var a=So(r);a.__index__=0,a.__values__=t,n?o.__wrapped__=a:n=a;var o=a;r=r.__wrapped__}return o.__wrapped__=e,n},Qn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof _n){var n=e;return this.__actions__.length&&(n=new _n(this)),(n=n.reverse()).__actions__.push({func:gi,args:[ei],thisArg:t}),new Zn(n,this.__chain__)}return this.thru(ei)},Qn.prototype.toJSON=Qn.prototype.valueOf=Qn.prototype.value=function(){return pa(this.__wrapped__,this.__actions__)},Qn.prototype.first=Qn.prototype.head,ee&&(Qn.prototype[ee]=function(){return this}),Qn}();ge?((ge.exports=pn)._=pn,he._=pn):fe._=pn}.call(St);var $r,ta,ea=qr.exports;let na=class extends it{constructor(){super(...arguments),this._computeLabelCallback=t=>Et("config.".concat(t.name))??t.name}setConfig(t){this._config={...this._config,...t}}render(){return this._config&&this.hass?U(ta||(ta=ht(["\n\t\t\t\n\t\t"])),this.hass,this._config,this._computeLabelCallback.bind(this),[{type:"expandable",title:this._title("title"),schema:[{type:"grid",schema:[{name:"title",selector:{text:{}}},{name:"title_colour",selector:{color_rgb:{}}},{name:"title_size",selector:{text:{}}}]}]},{type:"expandable",title:this._title("general"),schema:[{type:"grid",schema:[{name:"large_font",selector:{boolean:{}}},{name:"panel_mode",selector:{boolean:{}}},{name:"card_height",selector:{text:{}}},{name:"card_width",selector:{text:{}}},{name:"show_solar",selector:{boolean:{}}},{name:"show_battery",selector:{boolean:{}}},{name:"show_grid",selector:{boolean:{}}},{name:"dynamic_line_width",selector:{boolean:{}}},{name:"max_line_width",selector:{number:{}}},{name:"min_line_width",selector:{number:{}}},{name:"decimal_places",selector:{number:{}}},{name:"decimal_places_energy",selector:{number:{}}}]}]},{type:"expandable",title:this._title("inverter"),schema:[{name:"inverter",type:"grid",schema:[{name:"three_phase",selector:{boolean:{}}},{name:"auto_scale",selector:{boolean:{}}},{name:"model",selector:{select:{options:Object.values(yt).map((t=>({label:ea.capitalize(t),value:t})))}}},{name:"modern",selector:{boolean:{}}},{name:"autarky",selector:{select:{options:Object.values(mt).map((t=>({label:ea.capitalize(t),value:t})))}}},{name:"colour",selector:{color_rgb:{}}}]}]},{type:"expandable",title:this._title("solar"),schema:[{name:"solar",type:"grid",schema:[{name:"mppts",selector:{number:{min:1,max:5}}},{name:"auto_scale",selector:{boolean:{}}},{name:"pv1_name",selector:{text:{}}},{name:"pv2_name",selector:{text:{}}},{name:"pv3_name",selector:{text:{}}},{name:"pv4_name",selector:{text:{}}},{name:"pv5_name",selector:{text:{}}},{name:"colour",selector:{color_rgb:{}}},{name:"dynamic_colour",selector:{boolean:{}}},{name:"animation_speed",selector:{number:{}}},{name:"off_threshold",selector:{number:{}}},{name:"visualize_efficiency",selector:{boolean:{}}},{name:"show_mppt_efficiency",selector:{boolean:{}}},{name:"show_mppt_production",selector:{boolean:{}}}]},{type:"expandable",title:this._title("max_power"),schema:[{name:"solar",type:"grid",schema:[{name:"max_power",selector:{entity:{}}},{name:"pv1_max_power",selector:{entity:{}}},{name:"pv2_max_power",selector:{entity:{}}},{name:"pv3_max_power",selector:{entity:{}}},{name:"pv4_max_power",selector:{entity:{}}},{name:"pv5_max_power",selector:{entity:{}}}]}]}]},{type:"expandable",title:this._title("battery"),schema:[{name:"battery",type:"grid",schema:[{name:"energy",selector:{number:{min:0}}},{name:"shutdown_soc",selector:{number:{mode:"box",min:0,max:100}}},{name:"shutdown_soc_offgrid",selector:{number:{mode:"box",min:0,max:100}}},{name:"show_daily",selector:{boolean:{}}},{name:"auto_scale",selector:{boolean:{}}},{name:"invert_power",selector:{boolean:{}}},{name:"show_absolute",selector:{boolean:{}}},{name:"colour",selector:{color_rgb:{}}},{name:"charge_colour",selector:{color_rgb:{}}},{name:"dynamic_colour",selector:{boolean:{}}},{name:"linear_gradient",selector:{boolean:{}}},{name:"animate",selector:{boolean:{}}},{name:"animation_speed",selector:{number:{}}},{name:"hide_soc",selector:{boolean:{}}},{name:"show_remaining_energy",selector:{boolean:{}}},{name:"max_power",selector:{number:{}}},{name:"path_threshold",selector:{number:{}}}]},{type:"expandable",title:this._title("sensor"),schema:[{name:"battery",type:"grid",schema:[{name:"energy",selector:{entity:{}}},{name:"shutdown_soc",selector:{entity:{}}},{name:"shutdown_soc_offgrid",selector:{entity:{}}},{name:"max_power",selector:{entity:{}}}]}]}]},{type:"expandable",title:this._title("load"),schema:[{name:"load",type:"grid",schema:[{name:"show_daily",selector:{boolean:{}}},{name:"auto_scale",selector:{boolean:{}}},{name:"colour",selector:{color_rgb:{}}},{name:"dynamic_colour",selector:{boolean:{}}},{name:"dynamic_icon",selector:{boolean:{}}},{name:"invert_load",selector:{boolean:{}}},{name:"essential_name",selector:{text:{}}},{name:"additional_loads",selector:{number:{mode:"box",min:0,max:8}}},{name:"animation_speed",selector:{number:{}}},{name:"max_power",selector:{number:{}}},{name:"off_threshold",selector:{number:{}}},{name:"path_threshold",selector:{number:{}}}]},{type:"expandable",title:this._title("additional_load"),schema:[{name:"load",type:"grid",schema:[{name:"load1_name",selector:{text:{}}},{name:"load1_icon",selector:{icon:{}}},{name:"load2_name",selector:{text:{}}},{name:"load2_icon",selector:{icon:{}}},{name:"load3_name",selector:{text:{}}},{name:"load3_icon",selector:{icon:{}}},{name:"load4_name",selector:{text:{}}},{name:"load4_icon",selector:{icon:{}}},{name:"load5_name",selector:{text:{}}},{name:"load5_icon",selector:{icon:{}}},{name:"load6_name",selector:{text:{}}},{name:"load6_icon",selector:{icon:{}}},{name:"load7_name",selector:{text:{}}},{name:"load7_icon",selector:{icon:{}}},{name:"load8_name",selector:{text:{}}},{name:"load8_icon",selector:{icon:{}}}]}]},{type:"expandable",title:this._title("aux_load"),schema:[{name:"load",type:"grid",schema:[{name:"show_aux",selector:{boolean:{}}},{name:"aux_name",selector:{text:{}}},{name:"aux_daily_name",selector:{text:{}}},{name:"aux_type",selector:{icon:{}}},{name:"invert_aux",selector:{boolean:{}}},{name:"show_absolute_aux",selector:{boolean:{}}},{name:"aux_dynamic_colour",selector:{boolean:{}}},{name:"aux_colour",selector:{color_rgb:{}}},{name:"aux_off_colour",selector:{color_rgb:{}}},{name:"aux_loads",selector:{number:{mode:"box",min:0,max:2}}},{name:"aux_load1_name",selector:{text:{}}},{name:"aux_load1_icon",selector:{icon:{}}},{name:"aux_load2_name",selector:{text:{}}},{name:"aux_load2_icon",selector:{icon:{}}},{name:"show_daily_aux",selector:{boolean:{}}}]}]}]},{type:"expandable",title:this._title("grid"),schema:[{name:"grid",type:"grid",schema:[{name:"grid_name",selector:{text:{}}},{name:"max_power",selector:{number:{}}},{name:"show_daily_buy",selector:{boolean:{}}},{name:"label_daily_grid_buy",selector:{text:{}}},{name:"show_daily_sell",selector:{boolean:{}}},{name:"label_daily_grid_sell",selector:{text:{}}},{name:"auto_scale",selector:{boolean:{}}},{name:"invert_grid",selector:{boolean:{}}},{name:"show_absolute",selector:{boolean:{}}},{name:"colour",selector:{color_rgb:{}}},{name:"no_grid_colour",selector:{color_rgb:{}}},{name:"export_colour",selector:{color_rgb:{}}},{name:"grid_off_colour",selector:{color_rgb:{}}},{name:"energy_cost_decimals",selector:{number:{mode:"box",min:0,max:3}}},{name:"animation_speed",selector:{number:{}}},{name:"off_threshold",selector:{number:{}}},{name:"import_icon",selector:{icon:{}}},{name:"export_icon",selector:{icon:{}}},{name:"disconnected_icon",selector:{icon:{}}},{name:"prepaid_unit_name",selector:{text:{}}},{name:"show_nonessential",selector:{boolean:{}}},{name:"additional_loads",selector:{number:{mode:"box",min:0,max:3}}},{name:"nonessential_name",selector:{text:{}}},{name:"nonessential_icon",selector:{icon:{}}},{name:"load1_name",selector:{text:{}}},{name:"load1_icon",selector:{icon:{}}},{name:"load2_name",selector:{text:{}}},{name:"load2_icon",selector:{icon:{}}},{name:"load3_name",selector:{text:{}}},{name:"load3_icon",selector:{icon:{}}}]}]},{type:"expandable",title:this._title("entities"),schema:[{type:"expandable",title:this._title("sol"),schema:[{name:"entities",type:"grid",schema:[{name:"day_pv_energy_108",selector:{entity:{device_class:Ot.ENERGY}}},{name:"monthly_pv_generation",selector:{entity:{device_class:Ot.ENERGY}}},{name:"yearly_pv_generation",selector:{entity:{device_class:Ot.ENERGY}}},{name:"total_pv_generation",selector:{entity:{device_class:Ot.ENERGY}}},{name:"pv1_power_186",selector:{entity:{device_class:Ot.POWER}}},{name:"pv1_production",selector:{entity:{device_class:Ot.ENERGY}}},{name:"pv2_power_187",selector:{entity:{device_class:Ot.POWER}}},{name:"pv2_production",selector:{entity:{device_class:Ot.ENERGY}}},{name:"pv3_power_188",selector:{entity:{device_class:Ot.POWER}}},{name:"pv3_production",selector:{entity:{device_class:Ot.ENERGY}}},{name:"pv4_power_189",selector:{entity:{device_class:Ot.POWER}}},{name:"pv5_power",selector:{entity:{device_class:Ot.POWER}}},{name:"pv4_production",selector:{entity:{device_class:Ot.ENERGY}}},{name:"pv5_production",selector:{entity:{device_class:Ot.ENERGY}}},{name:"pv1_voltage_109",selector:{entity:{device_class:Ot.VOLTAGE}}},{name:"pv1_current_110",selector:{entity:{device_class:Ot.CURRENT}}},{name:"pv2_voltage_111",selector:{entity:{device_class:Ot.VOLTAGE}}},{name:"pv2_current_112",selector:{entity:{device_class:Ot.CURRENT}}},{name:"pv3_voltage_113",selector:{entity:{device_class:Ot.VOLTAGE}}},{name:"pv3_current_114",selector:{entity:{device_class:Ot.CURRENT}}},{name:"pv4_voltage_115",selector:{entity:{device_class:Ot.VOLTAGE}}},{name:"pv4_current_116",selector:{entity:{device_class:Ot.CURRENT}}},{name:"pv5_voltage",selector:{entity:{device_class:Ot.VOLTAGE}}},{name:"pv5_current",selector:{entity:{device_class:Ot.CURRENT}}},{name:"pv_total",selector:{entity:{device_class:Ot.POWER}}},{name:"solar_sell_247",selector:{entity:{}}},{name:"environment_temp",selector:{entity:{device_class:Ot.TEMPERATURE}}}]}]},{type:"expandable",title:this._title("bat"),schema:[{name:"entities",type:"grid",schema:[{name:"battery_power_190",selector:{entity:{device_class:Ot.POWER}}},{name:"battery_current_191",selector:{entity:{device_class:Ot.CURRENT}}},{name:"battery_temp_182",selector:{entity:{device_class:Ot.TEMPERATURE}}},{name:"battery_voltage_183",selector:{entity:{device_class:Ot.VOLTAGE}}},{name:"battery_soc_184",selector:{entity:{device_class:Ot.BATTERY}}},{name:"day_battery_charge_70",selector:{entity:{device_class:Ot.ENERGY}}},{name:"day_battery_discharge_71",selector:{entity:{device_class:Ot.ENERGY}}},{name:"battery_rated_capacity",selector:{entity:{}}},{name:"battery_soh",selector:{entity:{}}},{name:"battery_current_direction",selector:{entity:{}}},{name:"battery_status",selector:{entity:{}}}]}]},{type:"expandable",title:this._title("inv"),schema:[{name:"entities",type:"grid",schema:[{name:"inverter_status_59",selector:{entity:{}}},{name:"use_timer_248",selector:{entity:{}}},{name:"priority_load_243",selector:{entity:{}}},{name:"inverter_voltage_154",selector:{entity:{device_class:Ot.VOLTAGE}}},{name:"inverter_voltage_L2",selector:{entity:{device_class:Ot.VOLTAGE}}},{name:"inverter_voltage_L3",selector:{entity:{device_class:Ot.VOLTAGE}}},{name:"load_frequency_192",selector:{entity:{device_class:Ot.FREQUENCY}}},{name:"inverter_current_164",selector:{entity:{device_class:Ot.CURRENT}}},{name:"inverter_current_L2",selector:{entity:{device_class:Ot.CURRENT}}},{name:"inverter_current_L3",selector:{entity:{device_class:Ot.CURRENT}}},{name:"inverter_power_175",selector:{entity:{device_class:Ot.POWER}}},{name:"grid_power_169",selector:{entity:{device_class:Ot.POWER}}},{name:"dc_transformer_temp_90",selector:{entity:{device_class:Ot.TEMPERATURE}}},{name:"radiator_temp_91",selector:{entity:{device_class:Ot.TEMPERATURE}}},{name:"prog1_time",selector:{entity:{}}},{name:"prog1_capacity",selector:{entity:{}}},{name:"prog1_charge",selector:{entity:{}}},{name:"prog2_time",selector:{entity:{}}},{name:"prog2_capacity",selector:{entity:{}}},{name:"prog2_charge",selector:{entity:{}}},{name:"prog3_time",selector:{entity:{}}},{name:"prog3_capacity",selector:{entity:{}}},{name:"prog3_charge",selector:{entity:{}}},{name:"prog4_time",selector:{entity:{}}},{name:"prog4_capacity",selector:{entity:{}}},{name:"prog4_charge",selector:{entity:{}}},{name:"prog5_time",selector:{entity:{}}},{name:"prog5_capacity",selector:{entity:{}}},{name:"prog5_charge",selector:{entity:{}}},{name:"prog6_time",selector:{entity:{}}},{name:"prog6_capacity",selector:{entity:{}}},{name:"prog6_charge",selector:{entity:{}}}]}]},{type:"expandable",title:this._title("ld"),schema:[{name:"entities",type:"grid",schema:[{name:"day_load_energy_84",selector:{entity:{device_class:Ot.ENERGY}}},{name:"day_aux_energy",selector:{entity:{device_class:Ot.ENERGY}}},{name:"essential_power",selector:{entity:{device_class:Ot.POWER}}},{name:"essential_load1",selector:{entity:{device_class:Ot.POWER}}},{name:"essential_load1_extra",selector:{entity:{}}},{name:"essential_load1_toggle",selector:{entity:{}}},{name:"essential_load2",selector:{entity:{device_class:Ot.POWER}}},{name:"essential_load2_extra",selector:{entity:{}}},{name:"essential_load2_toggle",selector:{entity:{}}},{name:"essential_load3",selector:{entity:{device_class:Ot.POWER}}},{name:"essential_load3_extra",selector:{entity:{}}},{name:"essential_load3_toggle",selector:{entity:{}}},{name:"essential_load4",selector:{entity:{device_class:Ot.POWER}}},{name:"essential_load4_extra",selector:{entity:{}}},{name:"essential_load4_toggle",selector:{entity:{}}},{name:"essential_load5",selector:{entity:{device_class:Ot.POWER}}},{name:"essential_load5_extra",selector:{entity:{}}},{name:"essential_load5_toggle",selector:{entity:{}}},{name:"essential_load6",selector:{entity:{device_class:Ot.POWER}}},{name:"essential_load6_extra",selector:{entity:{}}},{name:"essential_load6_toggle",selector:{entity:{}}},{name:"essential_load7",selector:{entity:{device_class:Ot.POWER}}},{name:"essential_load7_extra",selector:{entity:{}}},{name:"essential_load7_toggle",selector:{entity:{}}},{name:"essential_load8",selector:{entity:{device_class:Ot.POWER}}},{name:"essential_load8_extra",selector:{entity:{}}},{name:"essential_load8_toggle",selector:{entity:{}}},{name:"load_power_L1",selector:{entity:{device_class:Ot.POWER}}},{name:"load_power_L2",selector:{entity:{device_class:Ot.POWER}}},{name:"load_power_L3",selector:{entity:{device_class:Ot.POWER}}},{name:"aux_power_166",selector:{entity:{device_class:Ot.POWER}}},{name:"aux_load1",selector:{entity:{device_class:Ot.POWER}}},{name:"aux_load2",selector:{entity:{device_class:Ot.POWER}}},{name:"aux_load1_extra",selector:{entity:{}}},{name:"aux_load2_extra",selector:{entity:{}}},{name:"aux_connected_status",selector:{entity:{}}}]}]},{type:"expandable",title:this._title("gri"),schema:[{name:"entities",type:"grid",schema:[{name:"day_grid_import_76",selector:{entity:{device_class:Ot.ENERGY}}},{name:"day_grid_export_77",selector:{entity:{device_class:Ot.ENERGY}}},{name:"grid_ct_power_172",selector:{entity:{device_class:Ot.POWER}}},{name:"grid_ct_power_L2",selector:{entity:{device_class:Ot.POWER}}},{name:"grid_ct_power_L3",selector:{entity:{device_class:Ot.POWER}}},{name:"grid_ct_power_total",selector:{entity:{device_class:Ot.POWER}}},{name:"grid_voltage",selector:{entity:{device_class:Ot.VOLTAGE}}},{name:"nonessential_power",selector:{entity:{device_class:Ot.POWER}}},{name:"non_essential_load1",selector:{entity:{device_class:Ot.POWER}}},{name:"non_essential_load2",selector:{entity:{device_class:Ot.POWER}}},{name:"non_essential_load3",selector:{entity:{device_class:Ot.POWER}}},{name:"non_essential_load1_extra",selector:{entity:{}}},{name:"non_essential_load2_extra",selector:{entity:{}}},{name:"grid_connected_status_194",selector:{entity:{}}},{name:"energy_cost_buy",selector:{entity:{}}},{name:"energy_cost_sell",selector:{entity:{}}},{name:"prepaid_units",selector:{entity:{}}},{name:"max_sell_power",selector:{entity:{device_class:Ot.POWER}}}]}]}]}],this._valueChanged.bind(this)):U($r||($r=ht([""])))}_title(t){return Et("config.cat_title.".concat(t))??t}_valueChanged(t){!function(t,e,n,r){r=r||{},n=null==n?{}:n;var a=new Event(e,{bubbles:void 0===r.bubbles||r.bubbles,cancelable:Boolean(r.cancelable),composed:void 0===r.composed||r.composed});a.detail=n,t.dispatchEvent(a)}(this,"config-changed",{config:t.detail.value})}};t([dt()],na.prototype,"hass",void 0),t([dt()],na.prototype,"_config",void 0),t([dt()],na.prototype,"lovelace",void 0),na=t([lt(Dt)],na);var ra=Object.freeze({__proto__:null,get SunSynkCardEditor(){return na}});export{Xr as SunsynkPowerFlowCard}; +function ft(t,e){return(e,n,r)=>((t,e,n)=>(n.configurable=!0,n.enumerable=!0,Reflect.decorate&&"object"!=typeof e&&Object.defineProperty(t,e,n),n))(e,n,{get(){return(e=>e.renderRoot?.querySelector(t)??null)(this)}})}function ht(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}var gt;const pt=((t,...e)=>{const n=1===t.length?t[0]:e.reduce(((e,n,r)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+t[r+1]),t[0]);return new o(n,t,r)})(gt||(gt=ht(["\n text_debug {\n outline: 1px solid blue;\n }\n \n \n .container {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n height: 100%;\n width: 100%;\n padding: 5px;\n }\n\n .card {\n border-radius: var(--ha-card-border-radius, 10px);\n box-shadow: var(--ha-card-box-shadow, 0px 0px 0px 1px rgba(0, 0, 0, 0.12), 0px 0px 0px 0px rgba(0, 0, 0, 0.12), 0px 0px 0px 0px rgba(0, 0, 0, 0.12));\n background: var(--ha-card-background, var(--card-background-color, white));\n border-width: var(--ha-card-border-width);\n padding: 0;\n }\n\n text { text-anchor: middle; dominant-baseline: middle; }\n\n .left-align {text-anchor: start;}\n .right-align {text-anchor: end;}\n .st1{fill:#ff9b30;}\n .st2{fill:#f3b3ca;}\n .st3{font-size:9px;}\n .st4{font-size:14px;}\n .st5{fill:#969696;}\n .st6{fill:#5fb6ad;}\n .st7{fill:#5490c2;}\n .st8{font-weight:500}\n .st9{fill:#959595;}\n .st10{font-size:16px;}\n .st11{fill:transparent;}\n .st12{display:none;}\n .st13{font-size:22px;}\n .st14{font-size:12px;}\n\n "])));var yt,mt;!function(t){t.Azzurro="azzurro",t.CESBatteryBox="ces-battery-box",t.Deye="deye",t.E3dc="e3dc",t.FoxESS="foxess",t.Fronius="fronius",t.Goodwe="goodwe",t.GoodweGridMode="goodwe_gridmode",t.Growatt="growatt",t.Huawei="huawei",t.Lux="lux",t.MPPSolar="mppsolar",t.PowMr="powmr",t.SMASolar="smasolar",t.Solax="solax",t.SolarEdge="solaredge",t.Sofar="sofar",t.Solis="solis",t.Sunsynk="sunsynk",t.Victron="victron"}(yt||(yt={})),function(t){t.Energy="energy",t.Power="power",t.AutoSelf="auto&self",t.No="no"}(mt||(mt={}));var vt={description:"A Home Assistant card to emulate the Sunsynk power flow that's shown on the Inverter screen",version:"Version",runtime_to:"RUNTIME TO",battery_floating:"BATTERY FLOATING",charge:"CHARGE",to:"TO",daily_load:"DAILY LOAD",daily_aux:"DAILY AUX",daily_grid_buy:"DAILY GRID BUY",daily_grid_sell:"DAILY GRID SELL",daily_solar:"DAILY SOLAR",monthly_solar:"MONTHLY SOLAR",yearly_solar:"YEARLY SOLAR",total_solar_generation:"TOTAL SOLAR",remaining_solar:"LEFT SOLAR",daily_charge:"DAILY CHARGE",daily_discharge:"DAILY DISCHARGE",ratio:"Ratio",timer_off:"Timer off",timer_on:"Timer on",priority_batt:"Priority Batt",priority_load:"Priority Load",nonessential_name:"Non Essential",aux_name:"Auxiliary",pv1_name:"PV1",pv2_name:"PV2",pv3_name:"PV3",pv4_name:"PV4",pv5_name:"PV5",essential:"Essential",autarky:"Autarky",autarkySelf:"Self use",autarkyAuto:"Auto cons",discharging:"Discharging",charging:"Charging",waiting:"Waiting",standby:"Standby",no_battery:"No Battery",selftest:"Selftest",normal:"Normal",alarm:"Alarm",fault:"Fault",days:"d",hrs:"h",min:"m",flash:"Flash",check:"Check",idle:"Idle",exporting:"Export",importing:"Import",ongrid:"On-Grid",offgrid:"Off-Grid",normalstop:" Normal Stop",shutdown:"Shutdown",offline:"Offline",running:"Running",sleepmode:"Sleep Mode",grid_name:"Grid",limit:"Limit",off:"Off",lowpower:"Low Power",bulk:"Bulk",absorption:"Absorption",float:"Float",storage:"Storage",equalize:"Equalize",passthru:"Passthru",inverting:"Inverting",powerassist:"Power Assist",powersupply:"Power Supply",sustain:"Sustain",externalcontrol:"External Control"},At={battery:{bat:"No battery attributes defined",energy:"Please include the battery energy attribute and value in Wh e.g. 5.32 Battery energy: 5320",shutdown_soc:"Please include the battery shutdown_soc attribute and value e.g shutdown_soc: 20",full_capacity:"Full capacity needs to be between 80 and 100",empty_capacity:"Empty capacity needs to be <= 40",show_daily:"Please include the day_battery_charge_70 and day_battery_discharge_71 attributes and entity IDs"},solar:{sol:"No solar attributes defined",mppts:"Please include the solar mppts attribute and value; 1,2,3 or 4 e.g. mppts: 2",show_daily:"Please include the day_pv_energy_108 attribute and entity ID"},grid:{show_daily:"Please include the day_grid_import_76 and day_grid_export_77 attributes and entity IDs"},essential_power:"The essential_power attribute is set to none. Please include the inverter_power_175 attribute and entity ID in order for the card to calculate this value.",nonessential_power:"The nonessential_power attribute is set to none. Please include the grid_power_169 attribute and entity ID in order for the card to calculate this value.",missing_entity:"`Please include the attribute and entity ID"},wt={title:"Title",title_colour:"Title Colour",title_size:"Title Size (px)",card_height:"Card Height (px)",card_width:"Card Width (px)",decimal_places:"Decimal Places",decimal_places_energy:"Decimal Places (Daily Energy)",model:"Model",autarky:"Autarky",large_font:"Large Font",modern:"Modern",show_solar:"Show Solar",show_battery:"Show Battery",show_grid:"Show Grid",show_aux:"Show Aux",dynamic_line_width:"Dynamic Line Width",max_line_width:"Max Line Width",min_line_width:"Min Line Width",solar:"Solar",mppts:"MPPTs",show_daily:"Show Daily",show_daily_aux:"Show Daily Aux",animation_speed:"Anim. Speed",max_power:"Max Power",pv1_max_power:"PV1 Max Power",pv2_max_power:"PV2 Max Power",pv3_max_power:"PV3 Max Power",pv4_max_power:"PV4 Max Power",pv5_max_power:"PV5 Max Power",pv1_name:"PV1 Name",pv2_name:"PV2 Name",pv3_name:"PV3 Name",pv4_name:"PV4 Name",pv5_name:"PV5 Name",display_mode:"Display Mode",visualize_efficiency:"Show PVs Efficiency",show_mppt_production:"Show PVs production",show_mppt_efficiency:"Show PVs efficiency %",battery:"Battery",load1_name:"Load 1 Name",load2_name:"Load 2 Name",load3_name:"Load 3 Name",load4_name:"Load 4 Name",load5_name:"Load 5 Name",load6_name:"Load 6 Name",load7_name:"Load 7 Name",load8_name:"Load 8 Name",load1_icon:"Load 1 Icon",load2_icon:"Load 2 Icon",load3_icon:"Load 3 Icon",load4_icon:"Load 4 Icon",load5_icon:"Load 5 Icon",load6_icon:"Load 6 Icon",load7_icon:"Load 7 Icon",load8_icon:"Load 8 Icon",aux_load1_name:"Aux Load 1 Name",aux_load2_name:"Aux Load 2 Name",aux_load1_icon:"Aux Load 1 Icon",aux_load2_icon:"Aux Load 2 Icon",aux_dynamic_colour:"Aux Dynamic Colour",off_threshold:"Off Threshold",show_daily_buy:"Show Daily Buy",show_daily_sell:"Show Daily Sell",no_grid_colour:"No Grid Colour",grid_off_colour:"Grid Off Colour",grid_name:"Grid Name",colour:"Colour",charge_colour:"Charge Colour",linear_gradient:"Linear Gradient",animate:"Animate Linear Gradient",aux_colour:"Colour",aux_off_colour:"Off Colour",panel_mode:"Panel Mode",invert_grid:"Invert Values",invert_load:"Invert Values",shutdown_soc:"Shutdown SOC",shutdown_soc_offgrid:"Shutdown SOC (Off Grid)",energy:"Energy",auto_scale:"Auto Scale",three_phase:"Three Phase",dynamic_colour:"Dynamic Colour",dynamic_icon:"Dynamic Icon",invert_power:"Invert Power",show_absolute:"Show Absolute",hide_soc:"Hide SOC",invert_aux:"Invert Aux",show_absolute_aux:"Show Absolute",show_nonessential:"Show Non Essential",aux_name:"Aux Name",aux_daily_name:"Daily Aux Name",aux_type:"Aux Icon",aux_loads:"Aux Loads",essential_name:"Essential Name",additional_loads:"Additional Loads",export_colour:"Export Colour",nonessential_name:"Non Essential Name",nonessential_icon:"Non Essential Icon",energy_cost_decimals:"Energy Cost Decimals",show_remaining_energy:"Show Remaining Energy",path_threshold:"Path Threshold",label_daily_grid_buy:"Daily Grid Buy Label",label_daily_grid_sell:"Daily Grid Sell Label",cat_title:{title:"Title Options",general:"General Options",inverter:"Inverter Options",solar:"Solar Options",battery:"Battery Options",grid:"Grid Options",load:"Load Options",additional_load:"Additional Load Options",aux_load:"Aux Load Options",entities:"Entities",energy:"Energy Entities",bat:"Battery Entities",sol:"Solar Entities",inv:"Inverter Entities",ld:"Load Entities",gri:"Grid Entities",sensor:"Optional Sensors",max_power:"PV Max Power"}},bt={common:vt,errors:At,config:wt};const xt={hass:null},Pt={en:Object.freeze({__proto__:null,common:vt,config:wt,default:bt,errors:At})};function Et(t,e="",n=""){const r=(localStorage.getItem("selectedLanguage")||"en").replace(/['"]+/g,"").replace("-","_"),a="".concat(xt.hass?.selectedLanguage||xt.hass?.locale?.language||xt.hass?.language||r);let o;try{o=t.split(".").reduce(((t,e)=>t[e]),Pt[a])}catch(e){o=t.split(".").reduce(((t,e)=>t[e]),Pt.en)}return void 0===o&&(o=t.split(".").reduce(((t,e)=>t[e]),Pt.en)),""!==e&&""!==n&&(o=o.replace(e,n)),o}var Lt={panel_mode:!1,large_font:!1,show_solar:!0,show_battery:!0,show_grid:!0,card_height:"396px",card_width:"100%",decimal_places:2,decimal_places_energy:1,dynamic_line_width:!0,max_line_width:4,min_line_width:1,inverter:{modern:!0,colour:"grey",autarky:"power",model:yt.Sunsynk,auto_scale:!0,three_phase:!1},battery:{energy:0,shutdown_soc:20,invert_power:!1,hide_soc:!1,colour:"pink",show_daily:!1,show_remaining_energy:!0,animation_speed:6,max_power:4500,show_absolute:!1,auto_scale:!0,dynamic_colour:!0,linear_gradient:!0,animate:!0,path_threshold:100},solar:{colour:"orange",mppts:2,animation_speed:9,max_power:8e3,pv1_name:Et("common.pv1_name"),pv2_name:Et("common.pv2_name"),pv3_name:Et("common.pv3_name"),pv4_name:Et("common.pv4_name"),pv5_name:Et("common.pv5_name"),auto_scale:!0,display_mode:1,dynamic_colour:!0,visualize_efficiency:!0,off_threshold:10,show_mppt_production:!0,show_mppt_efficiency:!1},load:{colour:"#5fb6ad",dynamic_colour:!0,dynamic_icon:!0,aux_dynamic_colour:!0,off_threshold:0,show_daily:!1,show_aux:!1,show_daily_aux:!1,invert_aux:!1,invert_load:!1,show_absolute_aux:!1,animation_speed:4,max_power:8e3,aux_name:Et("common.aux_name"),aux_daily_name:Et("common.daily_aux"),aux_type:"default",additional_loads:0,aux_loads:0,aux_load1_name:"",aux_load2_name:"",essential_name:Et("common.essential"),load1_icon:"default",load2_icon:"default",load1_name:Et("common.load1_name"),load2_name:Et("common.load2_name"),auto_scale:!0,path_threshold:100},grid:{colour:"#5490c2",grid_name:Et("common.grid_name"),label_daily_grid_buy:Et("common.daily_grid_buy"),label_daily_grid_sell:Et("common.daily_grid_sell"),show_daily_buy:!1,show_daily_sell:!1,show_nonessential:!0,nonessential_icon:"default",nonessential_name:Et("common.nonessential_name"),additional_loads:0,load1_name:"",load2_name:"",load3_name:"",load1_icon:"default",load2_icon:"default",load3_icon:"default",invert_grid:!1,animation_speed:8,max_power:8e3,auto_scale:!0,energy_cost_decimals:2,show_absolute:!1,off_threshold:0}};const Mt=[0,1,2,3,4,5,6,7,8],zt=[0,1,2,3],Nt=[!0,!1],Ct=[!0,!1],kt=[0,1,2],Tt=["off","0","off-grid","off grid","offgrid"],jt=["on","1","on-grid","on grid","ongrid"],Dt="mlk-content-card-editor";var Ot,Bt,Ht,Rt,It;!function(t){t.DATE="date",t.ENUM="enum",t.TIMESTAMP="timestamp",t.APPARENT_POWER="apparent_power",t.ATMOSPHERIC_PRESSURE="atmospheric_pressure",t.BATTERY="battery",t.CO="carbon_monoxide",t.CO2="carbon_dioxide",t.CURRENT="current",t.ENERGY="energy",t.ENERGY_STORAGE="energy_storage",t.FREQUENCY="frequency",t.IRRADIANCE="irradiance",t.MONETARY="monetary",t.POWER_FACTOR="power_factor",t.POWER="power",t.REACTIVE_POWER="reactive_power",t.TEMPERATURE="temperature",t.VOLTAGE="voltage"}(Ot||(Ot={})),function(t){t.WATT="W",t.KILO_WATT="kW",t.MEGA_WATT="MW",t.BTU_PER_HOUR="BTU/h"}(Bt||(Bt={})),function(t){t.GIGA_JOULE="GJ",t.KILO_WATT_HOUR="kWh",t.MEGA_JOULE="MJ",t.MEGA_WATT_HOUR="MWh",t.WATT_HOUR="Wh"}(Ht||(Ht={})),function(t){t.MILLIAMPERE="mA",t.AMPERE="A"}(Rt||(Rt={})),function(t){t.MILLIVOLT="mV",t.VOLT="V"}(It||(It={}));const Gt={[Ht.WATT_HOUR]:[{threshold:1e6,divisor:1e6,targetUnit:Ht.MEGA_WATT_HOUR},{threshold:1e3,divisor:1e3,targetUnit:Ht.KILO_WATT_HOUR,decimal:1}],[Ht.KILO_WATT_HOUR]:[{threshold:1e3,divisor:1e3,targetUnit:Ht.MEGA_WATT_HOUR,decimal:2}],[Ht.MEGA_WATT_HOUR]:[],[Ht.GIGA_JOULE]:[{threshold:1e3,divisor:1e3,targetUnit:Ht.MEGA_JOULE}],[Ht.MEGA_JOULE]:[],[Bt.WATT]:[{threshold:1e6,divisor:1e6,targetUnit:Bt.MEGA_WATT},{threshold:1e3,divisor:1e3,targetUnit:Bt.KILO_WATT}],[Bt.KILO_WATT]:[{threshold:1e3,divisor:1e3,targetUnit:Bt.MEGA_WATT}],[Bt.MEGA_WATT]:[],[Bt.BTU_PER_HOUR]:[]};var St="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Qt(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Ut={exports:{}};!function(t,e){var n="__lodash_hash_undefined__",r=9007199254740991,a="[object Arguments]",o="[object AsyncFunction]",i="[object Function]",s="[object GeneratorFunction]",l="[object Null]",c="[object Object]",u="[object Proxy]",d="[object Undefined]",f=/^\[object .+?Constructor\]$/,h=/^(?:0|[1-9]\d*)$/,g={};g["[object Float32Array]"]=g["[object Float64Array]"]=g["[object Int8Array]"]=g["[object Int16Array]"]=g["[object Int32Array]"]=g["[object Uint8Array]"]=g["[object Uint8ClampedArray]"]=g["[object Uint16Array]"]=g["[object Uint32Array]"]=!0,g[a]=g["[object Array]"]=g["[object ArrayBuffer]"]=g["[object Boolean]"]=g["[object DataView]"]=g["[object Date]"]=g["[object Error]"]=g[i]=g["[object Map]"]=g["[object Number]"]=g[c]=g["[object RegExp]"]=g["[object Set]"]=g["[object String]"]=g["[object WeakMap]"]=!1;var p="object"==typeof St&&St&&St.Object===Object&&St,y="object"==typeof self&&self&&self.Object===Object&&self,m=p||y||Function("return this")(),v=e&&!e.nodeType&&e,A=v&&t&&!t.nodeType&&t,w=A&&A.exports===v,b=w&&p.process,x=function(){try{var t=A&&A.require&&A.require("util").types;return t||b&&b.binding&&b.binding("util")}catch(t){}}(),P=x&&x.isTypedArray;var E,L=Array.prototype,M=Function.prototype,z=Object.prototype,N=m["__core-js_shared__"],C=M.toString,k=z.hasOwnProperty,T=(E=/[^.]+$/.exec(N&&N.keys&&N.keys.IE_PROTO||""))?"Symbol(src)_1."+E:"",j=z.toString,D=C.call(Object),O=RegExp("^"+C.call(k).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),B=w?m.Buffer:void 0,H=m.Symbol,R=m.Uint8Array;B&&B.allocUnsafe;var I,G,S=(I=Object.getPrototypeOf,G=Object,function(t){return I(G(t))}),Q=Object.create,U=z.propertyIsEnumerable,V=L.splice,Z=H?H.toStringTag:void 0,_=function(){try{var t=yt(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),W=B?B.isBuffer:void 0,X=Math.max,Y=Date.now,F=yt(m,"Map"),J=yt(Object,"create"),K=function(){function t(){}return function(e){if(!Nt(e))return{};if(Q)return Q(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();function q(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e-1},$.prototype.set=function(t,e){var n=this.__data__,r=ot(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this},tt.prototype.clear=function(){this.size=0,this.__data__={hash:new q,map:new(F||$),string:new q}},tt.prototype.delete=function(t){var e=pt(this,t).delete(t);return this.size-=e?1:0,e},tt.prototype.get=function(t){return pt(this,t).get(t)},tt.prototype.has=function(t){return pt(this,t).has(t)},tt.prototype.set=function(t,e){var n=pt(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this},et.prototype.clear=function(){this.__data__=new $,this.size=0},et.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},et.prototype.get=function(t){return this.__data__.get(t)},et.prototype.has=function(t){return this.__data__.has(t)},et.prototype.set=function(t,e){var n=this.__data__;if(n instanceof $){var r=n.__data__;if(!F||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new tt(r)}return n.set(t,e),this.size=n.size,this};var st=function(t,e,n){for(var r=-1,a=Object(t),o=n(t),i=o.length;i--;){var s=o[++r];if(!1===e(a[s],s,a))break}return t};function lt(t){return null==t?void 0===t?d:l:Z&&Z in Object(t)?function(t){var e=k.call(t,Z),n=t[Z];try{t[Z]=void 0;var r=!0}catch(t){}var a=j.call(t);r&&(e?t[Z]=n:delete t[Z]);return a}(t):function(t){return j.call(t)}(t)}function ct(t){return Ct(t)&<(t)==a}function ut(t){return!(!Nt(t)||function(t){return!!T&&T in t}(t))&&(Mt(t)?O:f).test(function(t){if(null!=t){try{return C.call(t)}catch(t){}try{return t+""}catch(t){}}return""}(t))}function dt(t){if(!Nt(t))return function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e}(t);var e=vt(t),n=[];for(var r in t)("constructor"!=r||!e&&k.call(t,r))&&n.push(r);return n}function ft(t,e,n,r,a){t!==e&&st(e,(function(o,i){if(a||(a=new et),Nt(o))!function(t,e,n,r,a,o,i){var s=At(t,n),l=At(e,n),u=i.get(l);if(u)return void rt(t,n,u);var d=o?o(s,l,n+"",t,e,i):void 0,f=void 0===d;if(f){var h=Pt(l),g=!h&&Lt(l),p=!h&&!g&&kt(l);d=l,h||g||p?Pt(s)?d=s:Ct(y=s)&&Et(y)?d=function(t,e){var n=-1,r=t.length;e||(e=Array(r));for(;++n-1&&t%1==0&&t0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(gt);function bt(t,e){return t===e||t!=t&&e!=e}var xt=ct(function(){return arguments}())?ct:function(t){return Ct(t)&&k.call(t,"callee")&&!U.call(t,"callee")},Pt=Array.isArray;function Et(t){return null!=t&&zt(t.length)&&!Mt(t)}var Lt=W||function(){return!1};function Mt(t){if(!Nt(t))return!1;var e=lt(t);return e==i||e==s||e==o||e==u}function zt(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=r}function Nt(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Ct(t){return null!=t&&"object"==typeof t}var kt=P?function(t){return function(e){return t(e)}}(P):function(t){return Ct(t)&&zt(t.length)&&!!g[lt(t)]};function Tt(t){return Et(t)?nt(t):dt(t)}var jt,Dt=(jt=function(t,e,n){ft(t,e,n)},ht((function(t,e){var n=-1,r=e.length,a=r>1?e[r-1]:void 0,o=r>2?e[2]:void 0;for(a=jt.length>3&&"function"==typeof a?(r--,a):void 0,o&&function(t,e,n){if(!Nt(n))return!1;var r=typeof e;return!!("number"==r?Et(n)&&mt(e,n.length):"string"==r&&e in n)&&bt(n[e],t)}(e[0],e[1],o)&&(a=r<3?void 0:a,r=1),t=Object(t);++n=0&&(r=parseFloat(r.toFixed(e))),n&&(r*=-1),r)}static convertValue(t,e=2){return e=Number.isNaN(e)?2:e,Math.abs(t)>=1e6?"".concat((t/1e6).toFixed(e)," MW"):Math.abs(t)>=1e3?"".concat((t/1e3).toFixed(e)," kW"):"".concat(Math.round(t)," W")}static convertValueNew(t,e="",n=2){n=isNaN(n)?2:n;const r=Number(t);if(isNaN(r))return 0;const a=Gt[e];if(!a)return"".concat(Math.round(r)," ").concat(e);if(e===Bt.WATT&&Math.abs(r)<1e3)return"".concat(Math.round(r)," ").concat(e);if(e===Bt.KILO_WATT&&Math.abs(r)<1)return"".concat(Math.round(1e3*r)," W");if(e===Bt.MEGA_WATT&&Math.abs(r)<1)return"".concat((1e3*r).toFixed(n)," kW");for(const t of a)if(Math.abs(r)>=t.threshold){const e=(r/t.divisor).toFixed(t.decimal||n);return"".concat(e," ").concat(t.targetUnit)}return"".concat(r.toFixed(n)," ").concat(e)}static handlePopup(t,e){e&&(t.preventDefault(),this._handleClick(t,{action:"more-info"},e))}static _handleClick(t,e,n){if(t&&n)if(t.stopPropagation(),"more-info"===e.action)this._dispatchMoreInfoEvent(t,n);else console.warn("Action '".concat(e.action,"' is not supported."))}static _dispatchMoreInfoEvent(t,e){if(Zt.isPopupOpen)return;Zt.isPopupOpen=!0;const n=new CustomEvent("hass-more-info",{composed:!0,detail:{entityId:e}});history.pushState({popupOpen:!0},"",window.location.href),t.target.dispatchEvent(n);const r=()=>{Zt.isPopupOpen&&(Zt.isPopupOpen=!1,window.removeEventListener("popstate",r),history.back())};window.addEventListener("popstate",r,{once:!0})}}Zt.isPopupOpen=!1;const _t="m15 13l-4 4v-3H2v-2h9V9l4 4M5 20v-4h2v2h10v-7.81l-5-4.5L7.21 10H4.22L12 3l10 9h-3v8H5Z",Wt="M15 9h1V7.5h4V9h1c.55 0 1 .45 1 1v11c0 .55-.45 1-1 1h-6c-.55 0-1-.45-1-1V10c0-.55.45-1 1-1m1 2v3h4v-3h-4m-4-5.31l-5 4.5V18h5v2H5v-8H2l10-9l2.78 2.5H14v1.67l-.24.1L12 5.69Z",Xt="M5 20v-8H2l10-9l10 9h-3v8zm7-14.31l-5 4.5V18h10v-7.81zM11.5 18v-4H9l3.5-7v4H15z",Yt="M11.6 3.45zM18.25 19.6v-7.6h2.85L11.6 3.45 2.1 12h2.85v7.6zM11.6 6.015l4.75 4.275V17.7H6.85v-7.41zM6.58 2.8v1.42L8 3.508zm-.4 2.4L5.2 6.184l1.5.5zM2.8 6.58 3.508 8l.712-1.42zM6 2.8H2.8v3.2c.228.068.468.1.708.1 1.432.004 2.596-1.16 2.6-2.6-.004-.236-.04-.472-.108-.7M12.5 3.844l2.25 2.026.5-.5-2.24-2.04zM17.71 8.53 18.2 8.04 15.76 5.84 15.26 6.34ZM20.52 11.09l.48-.49-2.31-2.14-.5.5z M18.1299 5.1169 17.318 4.6482l2.4492-1.6171-.75 1.299.8119.4687-2.4492 1.6171z",Ft="M35 887 l-27 -23 0 -404 0 -404 27 -23 c26 -23 28 -23 329 -23 284 0 305 1 327 19 l24 19 0 412 0 412 -24 19 c-22 18 -43 19 -327 19 -301 0 -303 0 -329 -23z m585 -157 l0 -80 -255 0 -255 0 0 80 0 80 255 0 255 0 0 -80z m-242 -229 c44 -34 40 -46 -14 -46 -60 0 -97 -38 -93 -94 5 -64 -23 -80 -35 -20 -9 44 24 113 63 134 35 18 34 15 21 50 -11 29 -14 30 58 -24z m110 -129 c4 -51 -19 -97 -59 -117 -27 -14 -30 -20 -23 -48 l6 -31 -51 43 c-29 24 -49 46 -46 49 3 4 23 5 44 3 58 -4 95 32 97 95 3 60 1 57 17 52 6 -3 13 -23 15 -46z",Jt="M15 1H9v2h6V1zm-4 13h2V8h-2v6zm8.03-6.61l1.42-1.42c-.43-.51-.9-.99-1.41-1.41l-1.42 1.42A8.962 8.962 0 0 0 12 4c-4.97 0-9 4.03-9 9s4.02 9 9 9a8.994 8.994 0 0 0 7.03-14.61zM12 20c-3.87 0-7-3.13-7-7s3.13-7 7-7s7 3.13 7 7s-3.13 7-7 7z",Kt="m19.95 17.15l-1.5-1.5q.275-.675.413-1.337T19 13q0-2.9-2.05-4.95T12 6q-.6 0-1.275.125t-1.4.4l-1.5-1.5q.95-.5 2.012-.763T12 4q1.5 0 2.938.5t2.712 1.45l1.4-1.4l1.4 1.4l-1.4 1.4q.95 1.275 1.45 2.713T21 13q0 1.05-.263 2.087t-.787 2.063ZM13 10.2V8h-2v.2l2 2Zm6.8 12.4l-2.4-2.4q-1.2.875-2.588 1.338T12 22q-1.85 0-3.488-.713T5.65 19.35q-1.225-1.225-1.938-2.863T3 13q0-1.5.463-2.888T4.8 7.6L1.4 4.2l1.4-1.4l18.4 18.4l-1.4 1.4ZM12 20q1.05 0 2.05-.325t1.875-.925L6.2 9.025q-.6.875-.9 1.875T5 13q0 2.9 2.05 4.95T12 20ZM9 3V1h6v2H9Zm2.075 10.875Zm2.825-2.8Z",qt="m5.18 5.45l-1.78-.9L4.66 2h8.47l1.27 2.55l-1.78.89L11.9 4h-6l-.72 1.45M15.5 8H11l-.8-3H7.6l-.79 3H2.28L1 10.55l1.79.89L3.5 10h10.78l.72 1.45l1.79-.89L15.5 8m-.83 14H12.6l-.24-.9l-3.46-5.2l-3.47 5.2l-.23.9H3.13L6 11h2.09l-.36 1.35L8.9 14.1l1.16-1.75L9.71 11h2.07l2.89 11M8.3 15l-.9-1.35l-1.18 4.48L8.3 15m3.28 3.12l-1.18-4.48L9.5 15l2.08 3.12M23 16l-4-4v3h-4v2h4v3l4-4Z",$t="M 26 16 L 22 12 L 22 15 L 18 15 L 18 17 L 22 17 L 22 20 L 26 16 Z M 22.1 21.5 L 2.4 1.7 L 1.1 3 L 6.1 8 L 5.4 8 L 4.1 10.5 L 5.9 11.4 L 6.6 10 L 8.1 10 L 9.1 11 L 6.2 22 L 8.3 22 L 8.5 21.1 L 12 15.9 L 15.5 21.1 L 15.7 22 L 17.8 22 L 17 18.8 L 20.9 22.7 L 22.1 21.5 M 9.3 18.1 L 10.5 13.6 L 11.4 14.9 L 9.3 18.1 M 14.7 18.1 L 12.6 15 L 12.8 14.7 L 14.1 16 L 14.7 18.1 M 14.2 11 L 14.9 11 L 15.1 11.9 L 14.2 11 M 14.1 8 L 18.6 8 L 19.9 10.6 L 18.1 11.5 L 17.4 10 L 13.2 10 L 10.2 7 L 10.7 5 L 13.3 5 L 14.1 8 M 8.4 5.2 L 6.9 3.7 L 7.8 2 L 16.3 2 L 17.6 4.5 L 15.8 5.4 L 15 4 L 9 4 L 8.4 5.2 Z",te="M15.95 21.175L13.1 18.35l1.425-1.4l1.425 1.4l3.525-3.525l1.425 1.4l-4.95 4.95ZM8 22q-.425 0-.713-.288T7 21V5q0-.425.288-.713T8 4h2V2h4v2h2q.425 0 .713.288T17 5v7q-.525 0-1.025.088T15 12.35V6H9v14h2.35q.2.575.488 1.075t.687.925H8Zm1-2h2.35H11h.35H9Z",ee="m15 13l-4 4v-3H2v-2h9V9l4 4M5 20v-4h2v2h10v-7.81l-5-4.5L7.21 10H4.22L12 3l10 9h-3v8H5Z",ne="M11.5 19h1v-1.85l3.5-3.5V9H8v4.65l3.5 3.5V19Zm-2 2v-3L6 14.5V9q0-.825.588-1.413T8 7h1L8 8V3h2v4h4V3h2v5l-1-1h1q.825 0 1.413.588T18 9v5.5L14.5 18v3h-5Zm2.5-7Z",re="M10 3H8v1.88l2 2zm6 6v3.88l1.8 1.8l.2-.2V9c0-1.1-.9-2-2-2V3h-2v4h-3.88l2 2H16zM4.12 3.84L2.71 5.25L6 8.54v5.96L9.5 18v3h5v-3l.48-.48l4.47 4.47l1.41-1.41L4.12 3.84zm8.38 13.33V19h-1v-1.83L8 13.65v-3.11l5.57 5.57l-1.07 1.06z",ae="m5.39 5.45-1.78-.9L4.87 2h8.47l1.27 2.55-1.78.89L12.11 4h-6zM15.73 8H11.2l-.79-3h-2.6L7 8H2.5l-1.29 2.55 1.79.89.73-1.44H14.5l.71 1.45 1.79-.89zm-.85 14h-2.07l-.24-.9-3.46-5.2-3.47 5.2-.23.9H3.34l2.89-11h2.07l-.36 1.35 1.17 1.75 1.16-1.75-.35-1.35H12zm-6.38-7-.89-1.35-1.18 4.48zm3.29 3.12-1.18-4.48-.9 1.36zM15 16l4-4v3H23v2h-4v3z",oe="M22.1 21.5L2.4 1.7L1.1 3l5 5h-.7l-1.3 2.5l1.8.9l.7-1.4h1.5l1 1l-2.9 11h2.1l.2-.9l3.5-5.2l3.5 5.2l.2.9h2.1l-.8-3.2l3.9 3.9l1.2-1.2M9.3 18.1l1.2-4.5l.9 1.3l-2.1 3.2m5.4 0L12.6 15l.2-.3l1.3 1.3l.6 2.1m-.5-7.1h.7l.2.9l-.9-.9m-.1-3h4.5l1.3 2.6l-1.8.9l-.7-1.5h-4.2l-3-3l.5-2h2.6l.8 3M8.4 5.2L6.9 3.7L7.8 2h8.5l1.3 2.5l-1.8.9L15 4H9l-.6 1.2Z",ie="m8.28 5.45l-1.78-.9L7.76 2h8.47l1.27 2.55l-1.78.89L15 4H9l-.72 1.45M18.62 8h-4.53l-.79-3h-2.6l-.79 3H5.38L4.1 10.55l1.79.89l.73-1.44h10.76l.72 1.45l1.79-.89L18.62 8m-.85 14H15.7l-.24-.9L12 15.9l-3.47 5.2l-.23.9H6.23l2.89-11h2.07l-.36 1.35L12 14.1l1.16-1.75l-.35-1.35h2.07l2.89 11m-6.37-7l-.9-1.35l-1.18 4.48L11.4 15m3.28 3.12l-1.18-4.48l-.9 1.36l2.08 3.12Z",se="M11.45 2v3.55L15 3.77L11.45 2m-1 6L8 10.46l3.75 1.25L10.45 8M2 11.45L3.77 15l1.78-3.55H2M10 2H2v8c.57.17 1.17.25 1.77.25c3.58.01 6.49-2.9 6.5-6.5c-.01-.59-.1-1.18-.27-1.75m7 20v-6h-3l5-9v6h3l-5 9Z";var le,ce,ue,de,fe,he,ge,pe,ye,me,ve,Ae,we,be,xe,Pe,Ee,Le,Me,ze,Ne,Ce,ke,Te,je,De,Oe,Be,He,Re,Ie,Ge,Se,Qe,Ue,Ve,Ze,_e,We,Xe,Ye,Fe,Je,Ke,qe,$e,tn,en,nn,rn,an,on,sn,ln,cn,un,dn,fn,hn,gn,pn,yn,mn,vn,An,wn,bn,xn,Pn,En,Ln,Mn,zn,Nn,Cn,kn,Tn,jn,Dn,On,Bn,Hn,Rn,In,Gn,Sn,Qn,Un,Vn,Zn,_n,Wn,Xn,Yn,Fn,Jn,Kn,qn,$n,tr,er,nr,rr,ar,or,ir,sr,lr,cr,ur,dr,fr,hr;class gr{static generateDailyLoadName(t){return V(le||(le=ht(['\n\t\t\t\n\t\t\t\t',"\n\t\t\t"])),[2,3,4,5,6,7,8].includes(t.additionalLoad)?this.LOAD_X-35:this.LOAD_X+12,[2,3,4,5,6,7,8].includes(t.additionalLoad)?"189":"282.1",t.loadShowDaily?"".concat(t.loadColour):"transparent",Et("common.daily_load"))}static generateDailyLoadValue(t,e){return V(ce||(ce=ht(['\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t',"\n\t\t\t\t\n\t\t\t\n\t\t"])),(t=>Zt.handlePopup(t,e.entities.day_load_energy_84)),[2,3,4,5,6,7,8].includes(t.additionalLoad)?this.LOAD_X-35:this.LOAD_X+12,[2,3,4,5,6,7,8].includes(t.additionalLoad)?"175":"267.9",t.loadShowDaily&&t.stateDayLoadEnergy.isValid()?"":"none",t.loadColour,t.stateDayLoadEnergy?.toPowerString(!0,t.decimalPlacesEnergy))}static generateFlowLines(t,e){const n=this.LOAD_X+3-264.7-70,r=264.7+n/2,a=r+70,o=a+n/2,i="M ".concat(264.7," 218.5 L ").concat(r," 218.5"),s="M ".concat(a," 218.5 L ").concat(o," 218.5");return V(ue||(ue=ht(['\n\t\t\t \n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t'])),i,e.load.dynamic_colour?t.flowColour:t.loadColour,t.loadLineWidth,Math.min(2+t.loadLineWidth+Math.max(t.minLineWidth-2,0),8),0===t.essentialPower?"transparent":"".concat(e.load.dynamic_colour?t.flowColour:t.loadColour),t.durationCur.load,s,e.load.dynamic_colour?t.flowColour:t.loadColour,t.loadLineWidth,Math.min(2+t.loadLineWidth+Math.max(t.minLineWidth-2,0),8),0===t.essentialPower?"transparent":"".concat(e.load.dynamic_colour?t.flowColour:t.loadColour),t.durationCur.load)}static generatePowers(t,e){const n=400+(this.LOAD_X-400)/2-30;return V(de||(de=ht(['\n\t\t\t\n\t\t\t\t','\n\t\t\t\n\t\t\t\n\t\t\t\t','\n\t\t\t\n\t\t\t\n\t\t\t\t',"\n\t\t\t\n\t\t"])),n,e.inverter.three_phase&&e.entities?.load_power_L1?"":"none",t.loadColour,e.load.auto_scale?"".concat(Zt.convertValue(t.loadPowerL1,t.decimalPlaces)||0):"".concat(t.loadPowerL1||0," ").concat(Bt.WATT),n,e.inverter.three_phase&&e.entities?.load_power_L2?"":"none",t.loadColour,e.load.auto_scale?"".concat(Zt.convertValue(t.loadPowerL2,t.decimalPlaces)||0):"".concat(t.loadPowerL2||0," ").concat(Bt.WATT),n,e.inverter.three_phase&&e.entities?.load_power_L3?"":"none",t.loadColour,e.load.auto_scale?"".concat(Zt.convertValue(t.loadPowerL3,t.decimalPlaces)||0):"".concat(t.loadPowerL3||0," ").concat(Bt.WATT))}static generateShapes(t){const e=400+(this.LOAD_X-400)/2-101.3;return V(fe||(fe=ht(['\n\t\t\t\n\t\t'])),e,t.loadColour)}static generateTotalLoad(t,e){const n=400+(this.LOAD_X-400)/2-65.3;return V(he||(he=ht(["\n\t\t\t","\n\t\t"])),e.entities?.essential_power&&"none"!==e.entities.essential_power?V(ge||(ge=ht(['\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t',"\n\t\t\t\t\t\n\t\t\t\t"])),(t=>Zt.handlePopup(t,e.entities.essential_power)),n,!0!==t.largeFont?"st14":"st4",t.loadColour,e.load.auto_scale?"".concat(Zt.convertValue(t.essentialPower,t.decimalPlaces)||0):"".concat(t.essentialPower||0," ").concat(Bt.WATT)):V(pe||(pe=ht(['\n\t\t\t\t\n\t\t\t\t\t',"\n\t\t\t\t"])),n,!0!==t.largeFont?"st14":"st4",t.loadColour,e.load.auto_scale?"".concat(Zt.convertValue(t.essentialPower,t.decimalPlaces)||0):"".concat(t.essentialPower||0," ").concat(Bt.WATT)))}static generateIcon(t,e){return V(ye||(ye=ht(['\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t'])),1===t.essIconSize?this.LOAD_X+5:this.LOAD_X+2,1===t.essIconSize?"186":"177.5",1===t.essIconSize?"75":"79",1===t.essIconSize?"75":"79",t.gridPercentage>0?t.gridColour:t.batteryPercentage>0?t.batteryColour:t.solarColour,t.gridPercentage,t.gridPercentage>0?t.gridColour:t.batteryPercentage>0?t.batteryColour:t.solarColour,t.gridPercentage,t.batteryPercentage>0?t.batteryColour:t.solarColour,t.gridPercentage+t.batteryPercentage,t.batteryPercentage>0?t.batteryColour:t.solarColour,t.gridPercentage+t.batteryPercentage,t.solarColour,t.solarColour,e.load.dynamic_colour?"url(#Lg)":t.loadColour,t.essIcon)}}gr.LOAD_X=410;class pr{static generateLines(t){const e=this.mainX+42,n="M ".concat(e," 190 L ").concat(e," 147"),r="M ".concat(e," 190 L ").concat(e," 147"),a="M ".concat(e," 280 L ").concat(e," 247"),o="M ".concat(e," 360 L ").concat(e," 323"),i="M ".concat(e," 110 L ").concat(e," 73");return V(me||(me=ht(['\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t'])),n,1===t.additionalLoad?"":"st12",t.loadColour,r,[2,3,4,5,6,7,8].includes(t.additionalLoad)?"":"st12",t.loadColour,a,[2,3,4,5,6,7,8].includes(t.additionalLoad)?"":"st12",t.loadColour,o,[5,6,7,8].includes(t.additionalLoad)?"":"st12",t.loadColour,i,[7,8].includes(t.additionalLoad)?"":"st12",t.loadColour)}static generateLoad1(t,e){const n=this.mainX+11,r=this.mainX-29,a=this.mainX,o=this.mainX+39,i=this.mainX+45,s=this.mainX+42,l=this.mainX+23,c=this.mainX+39,u=this.mainX+45,d=this.getIcon([1,2,3].includes(t.additionalLoad),r,114,t.iconEssentialLoad1,"essload1-icon",36),f=this.getIconLink(e.entities.essential_load1_toggle,d),h=this.getIcon(t.additionalLoad>=4,n,81,t.iconEssentialLoad1,"essload1_small-icon"),g=this.getIconLink(e.entities.essential_load1_toggle,h);return V(ve||(ve=ht(["",""])),t.additionalLoad>=1?V(Ae||(Ae=ht(["\n\t\t\t","\n\t\t\t",'\n\t\t\t\n\t\t\t\n\t\t\t\t\t\t\n\t\t\t','\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t','\n\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t',"\n\t\t\t\t\t",'\n\t\t\t\t\n\t\t\t\n\n\t\t\t\n\t\t\t\n\t\t\t\t','\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t','\n\t\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t',"\n\t\t\t\t\t","\n\t\t\t\t\n\t\t\t"])),f,g,a,t.dynamicColourEssentialLoad1,[1,2,3].includes(t.additionalLoad)?"":"none",i,[1,2,3].includes(t.additionalLoad)?"":"none",t.dynamicColourEssentialLoad1,e.load?.load1_name?"".concat(e.load.load1_name):"",(t=>Zt.handlePopup(t,e.entities.essential_load1)),s,[1,2,3].includes(t.additionalLoad)&&t.stateEssentialLoad1.isValid()?"":"none",!0!==t.largeFont?"st14":"st4",t.dynamicColourEssentialLoad1,t.stateEssentialLoad1?.toPowerString(e.load.auto_scale,t.decimalPlaces),(t=>Zt.handlePopup(t,e.entities.essential_load1_extra)),u,e.entities?.essential_load1_extra&&[1,2,3].includes(t.additionalLoad)&&t.stateEssentialLoad1Extra.isValid()?"":"none",t.dynamicColourEssentialLoad1,t.stateEssentialLoad1Extra.toNum(1),t.stateEssentialLoad1Extra.getUOM(),a,t.dynamicColourEssentialLoad1,t.additionalLoad>=4?"":"none",o,t.additionalLoad>=4?"":"none",t.dynamicColourEssentialLoad1,e.load?.load1_name?"".concat(e.load.load1_name):"",(t=>Zt.handlePopup(t,e.entities.essential_load1)),l,t.additionalLoad>=4&&t.stateEssentialLoad1.isValid()?"":"none",t.dynamicColourEssentialLoad1,t.stateEssentialLoad1?.toPowerString(e.load.auto_scale,t.decimalPlaces),(t=>Zt.handlePopup(t,e.entities.essential_load1_extra)),c,e.entities?.essential_load1_extra&&t.additionalLoad>=4&&t.stateEssentialLoad1Extra.isValid()?"":"none",t.dynamicColourEssentialLoad1,t.stateEssentialLoad1Extra.toNum(1),t.stateEssentialLoad1Extra.getUOM()):V(we||(we=ht([""]))))}static generateLoad2(t,e){const n=this.mainX+11,r=this.mainX+53,a=this.mainX-29,o=this.mainX,i=this.mainX+43,s=this.mainX+39,l=this.mainX+45,c=this.mainX+42,u=this.mainX+23,d=this.mainX+63,f=this.mainX+39,h=this.mainX+45,g=this.getIcon(2===t.additionalLoad,a,278,t.iconEssentialLoad2,"essload2-icon",36),p=this.getIconLink(e.entities.essential_load2_toggle,g),y=this.getIcon(3===t.additionalLoad,n,254,t.iconEssentialLoad2,"essload2_small-icon"),m=this.getIconLink(e.entities.essential_load2_toggle,y),v=this.getIcon(t.additionalLoad>=4,r,81,t.iconEssentialLoad2,"essload2_small-icon"),A=this.getIconLink(e.entities.essential_load2_toggle,v);return V(be||(be=ht(["",""])),t.additionalLoad>=4?V(xe||(xe=ht(["\n\t\t\t",""])),this.generateEssentialLoad(2,A,t.dynamicColourEssentialLoad2,i,107,e.load?.load2_name,l,136,t.stateEssentialLoad2,d,118,t.stateEssentialLoad2Extra,h,147,"left-align",e.load.auto_scale,t.decimalPlaces)):V(Pe||(Pe=ht(["",""])),3===t.additionalLoad?V(Ee||(Ee=ht(["\n\t\t\t",""])),this.generateEssentialLoad(2,m,t.dynamicColourEssentialLoad2,o,280,e.load?.load2_name,s,310,t.stateEssentialLoad2,u,291,t.stateEssentialLoad2Extra,f,322,"right-align",e.load.auto_scale,t.decimalPlaces)):V(Le||(Le=ht(["",""])),2===t.additionalLoad?V(Me||(Me=ht(["\n\t\t\t\t\t\t",'\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t','\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t','\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t',"\n\t\t\t\t\t\t\t\t","\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t"])),p,o,t.dynamicColourEssentialLoad2,2===t.additionalLoad?"":"none",l,2===t.additionalLoad?"":"none",t.dynamicColourEssentialLoad2,e.load?.load2_name?"".concat(e.load.load2_name):"",(t=>Zt.handlePopup(t,e.entities.essential_load2)),c,2===t.additionalLoad&&t.stateEssentialLoad2.isValid()?"":"none",!0!==t.largeFont?"st14":"st4",t.dynamicColourEssentialLoad2,t.stateEssentialLoad2?.toPowerString(e.load.auto_scale,t.decimalPlaces),(t=>Zt.handlePopup(t,e.entities.essential_load2_extra)),h,e.entities?.essential_load2_extra&&2===t.additionalLoad&&t.stateEssentialLoad2Extra.isValid()?"":"none",t.dynamicColourEssentialLoad2,t.stateEssentialLoad2Extra.toNum(1),t.stateEssentialLoad2Extra.getUOM()):V(ze||(ze=ht([""]))))))}static generateLoad3(t,e){const n=this.mainX+11,r=this.mainX+53,a=this.mainX,o=this.mainX+43,i=this.mainX+39,s=this.mainX+45,l=this.mainX+23,c=this.mainX+63,u=this.mainX+39,d=this.mainX+45,f=this.getIcon2(r,254,t.iconEssentialLoad3,"essload3_small-icon"),h=this.getIconLink(e.entities.essential_load3_toggle,f),g=this.getIcon2(n,254,t.iconEssentialLoad3,"essload3_small-icon"),p=this.getIconLink(e.entities.essential_load3_toggle,g);return V(Ne||(Ne=ht(["",""])),3===t.additionalLoad?V(Ce||(Ce=ht(["\n\t\t\t\t",""])),this.generateEssentialLoad(3,h,t.dynamicColourEssentialLoad3,o,280,e.load?.load3_name,s,310,t.stateEssentialLoad3,c,291,t.stateEssentialLoad3Extra,d,322,"left-align",e.load.auto_scale,t.decimalPlaces)):V(ke||(ke=ht(["",""])),t.additionalLoad>=4?V(Te||(Te=ht(["\n\t\t\t\t",""])),this.generateEssentialLoad(3,p,t.dynamicColourEssentialLoad3,a,280,e.load?.load3_name,i,310,t.stateEssentialLoad3,l,291,t.stateEssentialLoad3Extra,u,322,"right-align",e.load.auto_scale,t.decimalPlaces)):V(je||(je=ht([""])))))}static generateLoad4(t,e){const n=this.mainX+53,r=this.mainX+43,a=this.mainX+45,o=this.mainX+63,i=this.mainX+45,s=this.getIcon2(n,254,t.iconEssentialLoad4,"essload4_small-icon"),l=this.getIconLink(e.entities.essential_load4_toggle,s);return V(De||(De=ht(["",""])),t.additionalLoad>=4?V(Oe||(Oe=ht(["\n\t\t\t",""])),this.generateEssentialLoad(4,l,t.dynamicColourEssentialLoad4,r,280,e.load?.load4_name,a,310,t.stateEssentialLoad4,o,291,t.stateEssentialLoad4Extra,i,322,"left-align",e.load.auto_scale,t.decimalPlaces)):V(Be||(Be=ht([""]))))}static generateLoad5(t,e){const n=this.mainX+11,r=this.mainX,a=this.mainX+39,o=this.mainX+23,i=this.mainX+39,s=this.getIcon2(n,335,t.iconEssentialLoad5,"essload5_small-icon"),l=this.getIconLink(e.entities.essential_load5_toggle,s);return V(He||(He=ht(["",""])),t.additionalLoad>=5?V(Re||(Re=ht(["\n\t\t\t",""])),this.generateEssentialLoad(5,l,t.dynamicColourEssentialLoad5,r,362,e.load?.load5_name,a,390,t.stateEssentialLoad5,o,372,t.stateEssentialLoad5Extra,i,402,"right-align",e.load.auto_scale,t.decimalPlaces)):V(Ie||(Ie=ht([""]))))}static generateLoad6(t,e){const n=this.mainX+53,r=this.mainX+43,a=this.mainX+45,o=this.mainX+63,i=this.mainX+45,s=this.getIcon2(n,335,t.iconEssentialLoad6,"essload6_small-icon"),l=this.getIconLink(e.entities.essential_load6_toggle,s);return V(Ge||(Ge=ht(["",""])),t.additionalLoad>=6?V(Se||(Se=ht(["\n\t\t\t",""])),this.generateEssentialLoad(6,l,t.dynamicColourEssentialLoad6,r,362,e.load?.load6_name,a,390,t.stateEssentialLoad6,o,372,t.stateEssentialLoad6Extra,i,402,"left-align",e.load.auto_scale,t.decimalPlaces)):V(Qe||(Qe=ht([""]))))}static generateLoad7(t,e){const n=this.mainX+11,r=this.mainX,a=this.mainX+39,o=this.mainX+23,i=this.mainX+39,s=this.getIcon(t.additionalLoad>=7,n,7,t.iconEssentialLoad7,"essload7_small-icon"),l=this.getIconLink(e.entities.essential_load7_toggle,s);return V(Ue||(Ue=ht(["",""])),t.additionalLoad>=7?V(Ve||(Ve=ht(["\n\t\t\t",""])),this.generateEssentialLoad(7,l,t.dynamicColourEssentialLoad7,r,31,e.load?.load7_name,a,60,t.stateEssentialLoad7,o,42,t.stateEssentialLoad7Extra,i,72,"right-align",e.load.auto_scale,t.decimalPlaces)):V(Ze||(Ze=ht([""]))))}static generateLoad8(t,e){const n=this.mainX+53,r=this.mainX+43,a=this.mainX+45,o=this.mainX+63,i=this.mainX+45,s=this.getIcon2(n,7,t.iconEssentialLoad8,"essload8_small-icon"),l=this.getIconLink(e.entities.essential_load8_toggle,s);return V(_e||(_e=ht(["",""])),t.additionalLoad>=8?V(We||(We=ht(["\n\t\t\t",""])),this.generateEssentialLoad(8,l,t.dynamicColourEssentialLoad8,r,31,e.load?.load8_name,a,60,t.stateEssentialLoad8,o,42,t.stateEssentialLoad8Extra,i,72,"left-align",e.load.auto_scale,t.decimalPlaces)):V(Xe||(Xe=ht([""]))))}static getIcon(t,e,n,r,a,o=30){return V(Ye||(Ye=ht(['\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t
'])),t?"":"none",e,n,o,o,r,a)}static getIcon2(t,e,n,r,a=30){return V(Fe||(Fe=ht(['\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t
'])),t,e,a,a,n,r)}static getIconLink(t,e){return V(Je||(Je=ht(["\n\t\t","\n\t\t"])),t?V(Ke||(Ke=ht(['\n\t\t\t\n\t\t\t\t','\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t','\n\t\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t',"\n\t\t\t\t\t","\n\t\t\t\t\n\t\t\t"])),e,t,r,a,n,t,i,s,g,n,o?"".concat(o):"",(t=>Zt.handlePopup(t,l.entity_id)),t,c,u,l.isValid()?"":"none",n,l?.toPowerString(p,y),(t=>Zt.handlePopup(t,d.entity_id)),t,f,h,d.entity_id&&d.isValid()?"":"none",g,n,d.toNum(1),d.getUOM())}}pr.mainX=gr.LOAD_X;class yr{static getTexts(t){const e=this.mainX,n=this.mainX+46;return V(tn||(tn=ht(['\n\t\t\t','%\n\t\t\t\n\t\t\t','%\n\t\t\t\n\t\t\t','%\n\t\t\t\n\t\t\t','%\n\t\t\t\n\t\t\t','%\n\t\t\t\n\t\t\t','%\n\t\t\t\n\t\t\t\n\t\t\t','\n\t\t\t\n\t\t\t\n\t\t\t',"\n\t\t\t \n "])),e,t.enableAutarky===mt.No?"none":"",t.enableAutarky===mt.Energy?"st4 st8 left-align":"st12",t.inverterColour,t.autarkyEnergy,n,t.enableAutarky===mt.No?"none":"",t.enableAutarky===mt.Energy?"st4 st8 left-align":"st12",t.inverterColour,t.ratioEnergy,e,t.enableAutarky===mt.No?"none":"",t.enableAutarky===mt.Power?"st4 st8 left-align":"st12",t.inverterColour,t.autarkyPower,n,t.enableAutarky===mt.No?"none":"",t.enableAutarky===mt.Power?"st4 st8 left-align":"st12",t.inverterColour,t.ratioPower,e,t.enableAutarky===mt.No?"none":"",t.enableAutarky===mt.AutoSelf?"st4 st8 left-align":"st12",t.inverterColour,t.autarkyAuto,n,t.enableAutarky===mt.No?"none":"",t.enableAutarky===mt.AutoSelf?"st4 st8 left-align":"st12",t.inverterColour,t.autarkySelf,e,t.enableAutarky===mt.No?"none":"",t.inverterColour,t.enableAutarky===mt.AutoSelf?Et("common.autarkyAuto"):Et("common.autarky"),n,t.enableAutarky===mt.No?"none":"",t.inverterColour,t.enableAutarky===mt.AutoSelf?Et("common.autarkySelf"):Et("common.ratio"))}}yr.mainX=127;class mr{static getStyle(t){return U(en||(en=ht(["\n\t\t\t"])),t.dynamicColourEssentialLoad1,t.dynamicColourEssentialLoad2,t.dynamicColourEssentialLoad1,t.dynamicColourEssentialLoad2,t.dynamicColourEssentialLoad3,t.dynamicColourEssentialLoad4,t.dynamicColourEssentialLoad5,t.dynamicColourEssentialLoad6,t.dynamicColourEssentialLoad7,t.dynamicColourEssentialLoad8,t.customGridIconColour)}}class vr{static set decimalPlacesEnergy(t){this._decimalPlacesEnergy=t}static set solarColour(t){this._solarColour=t}static get solarColour(){return this._solarColour}static get decimalPlacesEnergy(){return this._decimalPlacesEnergy}static get decimalPlaces(){return this._decimalPlaces}static set decimalPlaces(t){this._decimalPlaces=t}static generateSolarPower(t,e){return V(nn||(nn=ht(['\n\t\t\t\n\t\t\t\t \n\t\t\t\t \n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t \n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t',"%\n\t\t\t\n\t\t\t","\n\t\t"])),e.solar.visualize_efficiency?"url(#SlG)":t.solarColour,1===e.solar.mppts?"none":"",e.show_solar?"":"st12",0===t.totalPVEfficiency?"grey":t.solarColour,t.totalPVEfficiency,0===t.totalPVEfficiency?"grey":t.solarColour,t.totalPVEfficiency,t.totalPVEfficiency<100?"grey":t.solarColour,t.totalPVEfficiency<100?"grey":t.solarColour,e.show_solar&&1!==e.solar.mppts?"":"st12",t.solarColour,t.solarLineWidth,Math.min(2+t.solarLineWidth+Math.max(t.minLineWidth-2,0),8),e.show_solar&&1!==e.solar.mppts?"":"st12",0===t.totalPV?"transparent":"".concat(t.solarColour),t.durationCur.solar,e.solar.show_mppt_efficiency?"st3 st8":"st12",1===e.solar.mppts?"none":"",t.solarColour,t.totalPVEfficiency,e.entities?.pv_total?V(rn||(rn=ht(['\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t',"\n\t\t\t\t\n\t\t\t"])),(t=>Zt.handlePopup(t,e.entities.pv_total)),!0!==t.largeFont?"st14":"st4",e.show_solar&&1!==e.solar.mppts&&t.statePVTotal.isValid()?"":"none",t.solarColour,e.solar.auto_scale?e.entities?.pv_total?Zt.convertValueNew(t.totalPV,t.statePVTotal.getUOM(),t.decimalPlaces):Zt.convertValue(t.totalPV,t.decimalPlaces)||0:"".concat(Zt.toNum(t.totalPV||0,0)," ").concat(Bt.WATT)):V(an||(an=ht(['\n\t\t\t\t\n\t\t\t\t\t',"\n\t\t\t\t"])),!0!==t.largeFont?"st14":"st4",e.show_solar&&1!==e.solar.mppts&&t.statePVTotal.isValid()?"":"none",t.solarColour,e.solar.auto_scale?e.entities?.pv_total?Zt.convertValueNew(t.totalPV,t.statePVTotal.getUOM(),t.decimalPlaces):Zt.convertValue(t.totalPV,t.decimalPlaces)||0:"".concat(Zt.toNum(t.totalPV||0,0)," ").concat(Bt.WATT)))}static generateSolarHeader(t,e){let n,r=V(on||(on=ht([""]))),a=V(sn||(sn=ht([""]))),o=V(ln||(ln=ht([""]))),i=V(cn||(cn=ht([""]))),s=V(un||(un=ht([""]))),l=this.countGenerationElements(t);if(0==l)return V(dn||(dn=ht([""])));n=this.setStartPosition(l),t.stateRemainingSolar.isValid()&&(s=this.getProduction("remaining_solar",t.stateRemainingSolar,n)),t.stateTotalSolarGeneration.isValid()&&(i=this.getProduction("total_solar_generation",t.stateTotalSolarGeneration,n)),t.stateYearlyPVEnergy.isValid()&&(o=this.getProduction("yearly_solar",t.stateYearlyPVEnergy,n)),t.stateMonthlyPVEnergy.isValid()&&(a=this.getProduction("monthly_solar",t.stateMonthlyPVEnergy,n)),t.stateDailyPVEnergy.isValid()&&(r=this.getProduction("daily_solar",t.stateDailyPVEnergy,n)),n.x-=2+n.gap/2;const c=V(fn||(fn=ht(['\n\t\t\t\n\t\t\t\t\n\t\t\t'])),n.x,t.solarColour,se),u=V(hn||(hn=ht(['\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t',"°\n\t\t\t\t\t\n\t\t\t\t"])),(t=>Zt.handlePopup(t,e.entities.environment_temp)),n.x,e.entities?.environment_temp?"st3 left-align":"st12",t.solarColour,t.stateEnvironmentTemp.isValid()?"":"none",t.stateEnvironmentTemp.toNum(1));return V(gn||(gn=ht(["\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n\t\t"])),c,u,r,a,o,i,s)}static setStartPosition(t){switch(t){case 1:return{x:260,gap:0};case 2:return{x:330,gap:0};default:return{x:400,gap:0}}}static countGenerationElements(t){let e=0;return t.stateRemainingSolar.isValid()&&e++,t.stateTotalSolarGeneration.isValid()&&e++,t.stateYearlyPVEnergy.isValid()&&e++,t.stateMonthlyPVEnergy.isValid()&&e++,t.stateDailyPVEnergy.isValid()&&e++,e++}static getProduction(t,e,n){const r=n.x,a=e?.toPowerString(!0,this.decimalPlacesEnergy)||"0",o=Et("common."+t),i=this.getTextWidth(a,"16px Roboto"),s=this.getTextWidth(o,"9px Roboto");return n.gap=Math.max(s,i),n.x-=n.gap+8,V(pn||(pn=ht(['\n \n\t\t\t\t\n\t\t\t\t\t','\n\t\t\t\t\n\t\t\t\n \n ',"\n "])),(t=>Zt.handlePopup(t,e.entity_id)),t,r-n.gap/2,this.solarColour,a,t,r-n.gap/2,this.solarColour,o)}static getTextWidth(t,e){const n=document.createElement("canvas").getContext("2d");let r=0;return null!==n&&(n.font=e,r=Math.round(n.measureText(t)?.width)),r}static getPositions(t,e){switch(t){case 1:switch(e){case 1:return[205,"M 239.23 84 L 239 190",230,244.7,238.8,230,"right-align"];case 2:return[158,"M 193 84 L 193 122 Q 193 132 201 132 L 205 132.03",188,198,192,188,"right-align"];case 3:case 4:return[82,"M 117 84 L 117 125 Q 117 132 124 132 L 205 132.03",113,121,116,113,"right-align"];case 5:return[4,"M 39 84 L 39 125 Q 39 132 46 132 L 205 132.03",35,44,38,35,"right-align"]}break;case 2:switch(e){case 2:return[254,"M 289 84.5 L 289 125 Q 289 132 282 132 L 275 132",281,296,289.5,296,"left-align"];case 3:case 4:return[158,"M 193 84 L 193 122 Q 193 132 201 132 L 205 132.03",188,198,192,188,"right-align"];case 5:return[82,"M 117 84 L 117 125 Q 117 132 124 132 L 205 132.03",113,121,116,113,"right-align"]}break;case 3:switch(e){case 3:case 4:return[254,"M 289 84.5 L 289 125 Q 289 132 282 132 L 275 132",281,296,289.5,296,"left-align"];case 5:return[158,"M 193 84 L 193 122 Q 193 132 201 132 L 205 132.03",188,198,192,188,"right-align"]}break;case 4:switch(e){case 4:return[330,"M 365 85 L 365 125 Q 365 132 358 132 L 275 132",357,372,366,372,"left-align"];case 5:return[254,"M 289 84.5 L 289 125 Q 289 132 282 132 L 275 132",281,296,289.5,296,"left-align"]}break;case 5:return[330,"M 365 85 L 365 125 Q 365 132 358 132 L 275 132",357,372,366,372,"left-align"]}return[]}static generateMppt1(t,e){const n=this.getPositions(1,e.solar.mppts);return V(yn||(yn=ht(["",""])),e.show_solar?V(mn||(mn=ht(["\n ","\n\t\t\t\t","\n\t\t\t ","\n ","\n ","\n\t\t\t\t","\n\t\t\t ","\n\t\t\t ","\n "])),this.generateFrame(n,"pv1",t.PV1Efficiency,e.solar.visualize_efficiency),this.generateFlowLine(n,"pv1",t.statePV1Power,t.durationCur.pv1,t.pv1LineWidth,t.minLineWidth),this.generateName(n,e.solar.pv1_name),this.generateEfficiency(n,t.PV1Efficiency,e.solar.show_mppt_efficiency),this.generateEnergy(n,t.statePV1Energy,e.solar.show_mppt_production,e.solar.show_mppt_efficiency),this.generateVoltage(n,t.statePV1Voltage),this.generateAmperage(n,t.statePV1Current),this.generatePower(n,t.statePV1Power,e.solar.auto_scale,t.largeFont)):V(vn||(vn=ht([""]))))}static generateMppt2(t,e){const n=this.getPositions(2,e.solar.mppts);return V(An||(An=ht(["",""])),e.show_solar&&e.solar.mppts>=2?V(wn||(wn=ht(["\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n\t\t\t ","\n "])),this.generateFrame(n,"PV2",t.PV2Efficiency,e.solar.visualize_efficiency),this.generateFlowLine(n,"pv2",t.statePV2Power,t.durationCur.pv2,t.pv2LineWidth,t.minLineWidth),this.generateName(n,e.solar.pv2_name),this.generateEfficiency(n,t.PV2Efficiency,e.solar.show_mppt_efficiency),this.generateEnergy(n,t.statePV2Energy,e.solar.show_mppt_production,e.solar.show_mppt_efficiency),this.generateVoltage(n,t.statePV2Voltage),this.generateAmperage(n,t.statePV2Current),this.generatePower(n,t.statePV2Power,e.solar.auto_scale,t.largeFont)):V(bn||(bn=ht([""]))))}static generateMppt3(t,e){const n=this.getPositions(3,e.solar.mppts);return V(xn||(xn=ht(["",""])),e.show_solar&&e.solar.mppts>=3?V(Pn||(Pn=ht(["\n ","\n ","\n ","\t\t\t\n ","\n ","\n ","\n ","\n\t\t\t ","\n "])),this.generateFrame(n,"PV3",t.PV3Efficiency,e.solar.visualize_efficiency),this.generateFlowLine(n,"pv3",t.statePV3Power,t.durationCur.pv3,t.pv3LineWidth,t.minLineWidth),this.generateName(n,e.solar.pv3_name),this.generateEfficiency(n,t.PV3Efficiency,e.solar.show_mppt_efficiency),this.generateEnergy(n,t.statePV3Energy,e.solar.show_mppt_production,e.solar.show_mppt_efficiency),this.generateVoltage(n,t.statePV3Voltage),this.generateAmperage(n,t.statePV3Current),this.generatePower(n,t.statePV3Power,e.solar.auto_scale,t.largeFont)):V(En||(En=ht([""]))))}static generateMppt4(t,e){const n=this.getPositions(4,e.solar.mppts);return V(Ln||(Ln=ht(["",""])),e.show_solar&&e.solar.mppts>=4?V(Mn||(Mn=ht(["\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n\t\t\t ","\n "])),this.generateFrame(n,"PV4",t.PV4Efficiency,e.solar.visualize_efficiency),this.generateFlowLine(n,"pv4",t.statePV4Power,t.durationCur.pv4,t.pv4LineWidth,t.minLineWidth),this.generateName(n,e.solar.pv4_name),this.generateEfficiency(n,t.PV4Efficiency,e.solar.show_mppt_efficiency),this.generateEnergy(n,t.statePV4Energy,e.solar.show_mppt_production,e.solar.show_mppt_efficiency),this.generateVoltage(n,t.statePV4Voltage),this.generateAmperage(n,t.statePV4Current),this.generatePower(n,t.statePV4Power,e.solar.auto_scale,t.largeFont)):V(zn||(zn=ht([""]))))}static generateMppt5(t,e){const n=this.getPositions(5,e.solar.mppts);return V(Nn||(Nn=ht(["",""])),e.show_solar&&e.solar.mppts>=5?V(Cn||(Cn=ht(["\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n\t\t\t ","\n\t\t\t"])),this.generateFrame(n,"PV5",t.PV5Efficiency,e.solar.visualize_efficiency),this.generateFlowLine(n,"pv5",t.statePV5Power,t.durationCur.pv5,t.pv5LineWidth,t.minLineWidth),this.generateName(n,e.solar.pv5_name),this.generateEfficiency(n,t.PV5Efficiency,e.solar.show_mppt_efficiency),this.generateEnergy(n,t.statePV5Energy,e.solar.show_mppt_production,e.solar.show_mppt_efficiency),this.generateVoltage(n,t.statePV5Voltage),this.generateAmperage(n,t.statePV5Current),this.generatePower(n,t.statePV5Power,e.solar.auto_scale,t.largeFont)):V(kn||(kn=ht([""]))))}static generatePower(t,e,n,r){return V(Tn||(Tn=ht(['\n \n\t\t\t\t\n\t\t\t\t\t ',"\n \n\t\t\t"])),(t=>Zt.handlePopup(t,e.entity_id)),t[4],!0!==r?"st14":"st4",e.isValid()?"":"none",this.solarColour,n?Zt.convertValue(e,this.decimalPlaces)||0:e.toNum(0)+" "+Bt.WATT)}static generateFrame(t,e,n,r){return V(jn||(jn=ht(['\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t'])),e,t[0],e,r?"url(#"+e+"LG)":this.solarColour,e,0===n?"grey":this.solarColour,n,0===n?"grey":this.solarColour,n,n<100?"grey":this.solarColour,n<100?"grey":this.solarColour)}static generateFlowLine(t,e,n,r,a,o){const i=n.toPower();return V(Dn||(Dn=ht(['\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t"])),e,e,t[1],this.solarColour,a,e,Math.min(2+a+Math.max(o-2,0),8),Math.round(i)<=0?"transparent":"".concat(this.solarColour),r,this.pvLineMap[e])}static generateName(t,e){return V(On||(On=ht(['\n\t\t\t',"\n\t\t\t"])),t[2],this._solarColour,e)}static generateEfficiency(t,e,n){return V(Bn||(Bn=ht(['\n \n ',"%\n "])),t[2],n?"st3 st8 right-align":"st12",n?"":"none",this.solarColour,e)}static generateEnergy(t,e,n,r){return V(Hn||(Hn=ht(['\n \n ',"\n "])),r?t[5]:t[2],r?"118":"106",r?t[6]:"right-align",n?"":"none",this.solarColour,e.toPowerString(!0,0))}static generateVoltage(t,e){return V(Rn||(Rn=ht(['\n \n '," ","\n \n "])),(t=>Zt.handlePopup(t,e.entity_id)),t[3],e.isValid()?"":"none",this.solarColour,e.toNum(1),It.VOLT)}static generateAmperage(t,e){return V(In||(In=ht(['\n \n\t\t\t\t',"\n\t\t\t\t\t","\n\t\t\t\t\n\t\t\t"])),(t=>Zt.handlePopup(t,e.entity_id)),t[3],e.isValid()?"":"none",this.solarColour,e.toNum(1),Rt.AMPERE)}}vr.pvLineMap={pv1:"#pv1-line",pv2:"#pv2-line",pv3:"#pv3-line",pv4:"#pv4-line",pv5:"#pv5-line"};class Ar{static generateShapes(t,e){return V(Gn||(Gn=ht(['\n\t\t\t\n\t\t\t\n\t\t'])),t.batteryColour,e.show_battery?"":"none",t.compactMode?"":"st12",t.compactMode?"348":"329.75",t.compactMode?"50":"70",t.compactMode?"7.5":"10.5",t.compactMode?"7.5":"10.5",t.batteryColour,e.show_battery?"":"none",t.compactMode?"st12":"")}static generateDuration(t,e){return V(Sn||(Sn=ht(['\n\t\t\t\n\t\t\t\t','\n\t\t\t\n\t\t\t\n\t\t\t\t'," ","% @",'\n\t\t\t\n\t\t\t\n\t\t\t\t'," ","% @",'\n\t\t\t\n\t\t\t\n\t\t\t\t',"\n\t\t\t\t\t\n\t\t"])),t.compactMode?"270":"290",!0!==t.largeFont?"st14":"st4",e.show_battery?"":"none",0===t.batteryEnergy||t.isFloating||0===t.batteryPower?"transparent":"".concat(t.batteryColour),t.batteryDuration,t.compactMode?"270":"290",e.show_battery?"":"none",0===t.batteryEnergy||t.batteryPower<=0||t.isFloating?"transparent":"".concat(t.batteryColour),Et("common.runtime_to"),t.batteryCapacity,t.formattedResultTime,t.compactMode?"270":"290",e.show_battery?"":"none",0===t.batteryEnergy||t.batteryPower>=0||t.isFloating?"transparent":"".concat(t.batteryColour),Et("common.to"),t.batteryCapacity,t.formattedResultTime,t.compactMode?"270":"290",e.show_battery?"":"none",0!==t.batteryEnergy&&t.isFloating?"".concat(t.batteryColour):"transparent",Et("common.battery_floating"))}static generateDailyCharge(t,e){return V(Qn||(Qn=ht(['\n\t\t\t\n\t\t\t\t','\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t',"\n\t\t\t\t\n\t\t\t\n\t\t"])),t.compactMode?"132":"77.2",!0===t.batteryShowDaily&&e.show_battery?"".concat(t.batteryColour):"transparent",Et("common.daily_charge"),(t=>Zt.handlePopup(t,e.entities.day_battery_charge_70)),t.compactMode?"132":"77.2",!0===t.batteryShowDaily&&e.show_battery&&t.stateDayBatteryCharge.isValid()?"":"none",t.batteryColour,t.stateDayBatteryCharge?.toPowerString(!0,t.decimalPlacesEnergy))}static generateDailyDischarge(t,e){return V(Un||(Un=ht(['\n\t\t\t\n\t\t\t\t','\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t',"\n\t\t\t\t\n\t\t\t\n\t\t"])),t.compactMode?"132":"77.2",!0===t.batteryShowDaily&&e.show_battery?"".concat(t.batteryColour):"transparent",Et("common.daily_discharge"),(t=>Zt.handlePopup(t,e.entities.day_battery_discharge_71)),t.compactMode?"132":"77.2",!0===t.batteryShowDaily&&e.show_battery&&t.stateDayBatteryDischarge.isValid()?"":"none",t.batteryColour,t.stateDayBatteryDischarge?.toPowerString(!0,t.decimalPlacesEnergy))}static generateFlowLines(t,e){return V(Vn||(Vn=ht(['\n \t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t'])),t.compactMode?"M 239 250 L 239 290":"M 239 250 L 239 324",e.show_battery?"":"st12",e.battery.dynamic_colour?t.flowBatColour:t.batteryColour,t.batLineWidth,Math.min(2+t.batLineWidth+Math.max(t.minLineWidth-2,0),8),e.show_battery?"":"st12",t.batteryPower<0||0===t.batteryPower?"transparent":"".concat(t.batteryColour),t.durationCur.battery,Math.min(2+t.batLineWidth+Math.max(t.minLineWidth-2,0),8),e.show_battery?"":"st12",t.batteryPower>0||0===t.batteryPower?"transparent":"".concat(e.battery.dynamic_colour?t.flowBatColour:t.batteryColour),t.durationCur.battery)}static generateState(t,e){return V(Zn||(Zn=ht(['\n\t\t\t\n\t\t\t\t',"\n\t\t\t"])),e.battery.show_remaining_energy?"311":"320",!e.show_battery||t.compactMode?"none":"",t.batteryColour,t.batteryStateMsg)}static generateCapacity(t,e){return V(_n||(_n=ht(['\n\t\t\t\n\t\t\t\t',"\n\t\t\t\t","\n\t\t\t"])),t.compactMode?"270":e.entities?.battery_status?"169":"193",t.compactMode?"338":"323",e.entities?.battery_status||t.compactMode?"st3 left-align":"st3",e.show_battery&&e.battery.show_remaining_energy?"":"none",t.batteryColour,Zt.toNum(t.batteryEnergy*(t.stateBatterySoc.toNum(2)/100)/1e3,2),Ht.KILO_WATT_HOUR)}static generateShutdownSOC(t,e){return V(Wn||(Wn=ht(['\n\t\t\t\n\t\t\t\t','%\n\t\t\t\n\t\t\t\n\t\t\t\t',"%\n\t\t\t"])),t.compactMode?"343":"363",t.batteryColour,e.battery.hide_soc||!e.show_battery?"st12":"st14 left-align",!t.inverterProg.show&&e.battery?.shutdown_soc_offgrid?"":"none",t.batteryShutdown,t.compactMode?"343":"363",t.batteryColour,e.battery.hide_soc||!e.show_battery?"st12":"st14 left-align",!t.inverterProg.show&&e.battery?.shutdown_soc_offgrid?"":"none",t.shutdownOffGrid)}static generateBatteryGradient(t,e){return V(Xn||(Xn=ht(['\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t'])),t.compactMode?"212.5":"232.5",t.gridPercentageBat>0?t.gridColour:t.pvPercentageBat>0?t.solarColour:t.batteryColour,t.gridPercentageBat<2?0:t.gridPercentageBat,t.gridPercentageBat>0?t.gridColour:t.pvPercentageBat>0?t.solarColour:t.batteryColour,t.gridPercentageBat<2?0:t.gridPercentageBat,t.pvPercentageBat>0?t.solarColour:t.batteryColour,(t.gridPercentageBat<2?0:t.gridPercentageBat)+(t.pvPercentageBat<2?0:t.pvPercentageBat),t.pvPercentageBat>0?t.solarColour:t.batteryColour,(t.gridPercentageBat<2?0:t.gridPercentageBat)+(t.pvPercentageBat<2?0:t.pvPercentageBat),t.batteryColour,t.batteryColour,e.show_battery?"":"st12",e.battery.dynamic_colour?"url(#bLg)":t.batteryColour,e.battery.linear_gradient?t.battery0:t.batteryIcon,t.compactMode?"212.5":"232.5",t.stopColour,e.battery.animate?"y2":"none",e.show_battery?"":"st12",e.battery.linear_gradient?"url(#sLg)":t.batteryColour,e.battery.linear_gradient?"":"none",t.batteryCharge)}}class wr{static generateShapes(t,e){return V(Yn||(Yn=ht(['\n\t\t\t\n\t\t'])),t.gridColour,e.show_grid?"":"none")}static generateDailyBuy(t,e){return V(Fn||(Fn=ht(['\n\t\t\t\n\t\t\t\t',"\n\t\t\t\n\t\t"])),!0!==t.gridShowDailyBuy?"transparent":"".concat(t.gridColour),e.show_grid?"":"none",e.grid.label_daily_grid_buy)}static generateDailySell(t,e){return V(Jn||(Jn=ht(['\n\t\t\t\n\t\t\t\t',"\n\t\t\t\n\t\t"])),!0!==t.gridShowDailySell?"transparent":"".concat(t.gridColour),e.show_grid?"":"none",e.grid.label_daily_grid_sell)}static generatePowers(t,e){return V(Kn||(Kn=ht(['\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t','\n\t\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t','\n\t\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t',"\n\t\t\t\t\n\t\t\t\n\t\t"])),(t=>Zt.handlePopup(t,e.entities.grid_ct_power_172)),e.inverter.three_phase?"":"none",e.show_grid?"st3 left-align":"st12",t.gridColour,e.load.auto_scale?"".concat(Zt.convertValue(t.gridPower,t.decimalPlaces)||0):"".concat(t.gridPower||0," ").concat(Bt.WATT),(t=>Zt.handlePopup(t,e.entities.grid_ct_power_L2)),e.inverter.three_phase&&e.entities?.grid_ct_power_L2?"":"none",e.show_grid?"st3 left-align":"st12",t.gridColour,e.load.auto_scale?"".concat(Zt.convertValue(t.gridPowerL2,t.decimalPlaces)||0):"".concat(t.gridPowerL2||0," ").concat(Bt.WATT),(t=>Zt.handlePopup(t,e.entities.grid_ct_power_L3)),e.inverter.three_phase&&e.entities?.grid_ct_power_L3?"":"none",e.show_grid?"st3 left-align":"st12",t.gridColour,e.load.auto_scale?"".concat(Zt.convertValue(t.gridPowerL3,t.decimalPlaces)||0):"".concat(t.gridPowerL3||0," ").concat(Bt.WATT))}static generatePrepaidUnits(t,e){return V(qn||(qn=ht(['\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t'," ","\n\t\t\t\t\n\t\t\t\n\t\t"])),(t=>Zt.handlePopup(t,e.entities.prepaid_units)),e.entities?.prepaid_units?"st3":"st12",t.gridColour,e.show_grid&&t.statePrepaidUnits.isValid()?"":"none",t.statePrepaidUnits.toNum(1),e.grid.prepaid_unit_name)}static generateTotalPower(t,e){return V($n||($n=ht(["\n\t\t\t","\n\t\t"])),t.totalGridPower>=0?V(tr||(tr=ht(['\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t'," ","\n\t\t\t\t\t\t\n\t\t\t\t\t"])),(t=>Zt.handlePopup(t,e.entities.energy_cost_buy)),e.show_grid?"st3 left-align":"st12",t.gridColour,e.entities?.energy_cost_buy&&t.stateEnergyCostBuy.isValid()?"":"none",t.energyCost,t.stateEnergyCostBuy.getUOM()):V(er||(er=ht(['\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t'," ","\n\t\t\t\t\t\t\n\t\t\t\t\t"])),(t=>Zt.handlePopup(t,e.entities.energy_cost_sell)),e.show_grid?"st3 left-align":"st12",t.gridColour,e.entities?.energy_cost_sell&&t.stateEnergyCostSell.isValid()?"":"none",t.energyCost,t.stateEnergyCostSell.getUOM()))}static generateGridName(t,e){return V(nr||(nr=ht(['\n\t\t\t',"\n\t\t\t"])),e.grid.show_daily_buy?"294":"267",t.gridColour,e.show_grid?"":"none",e.grid.grid_name)}static generateFlowLines(t,e){return V(rr||(rr=ht(['\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t'])),t.gridColour,t.gridLineWidth,e.show_grid?"":"none",Math.min(2+t.gridLineWidth+Math.max(t.minLineWidth-2,0),8),t.totalGridPower<0||0===t.totalGridPower?"transparent":"".concat(t.gridColour),e.show_grid?"":"none",t.durationCur.grid,Math.min(2+t.gridLineWidth+Math.max(t.minLineWidth-2,0),8),t.totalGridPower>0||0===t.totalGridPower?"transparent":"".concat(t.gridColour),e.show_grid?"":"none",t.durationCur.grid,t.gridColour,t.gridLineWidth,e.show_grid?"":"none",Math.min(2+t.gridLineWidth+Math.max(t.minLineWidth-2,0),8),t.totalGridPower<0||0===t.totalGridPower?"transparent":"".concat(t.gridColour),e.show_grid?"":"none",t.durationCur.grid,Math.min(2+t.gridLineWidth+Math.max(t.minLineWidth-2,0),8),t.totalGridPower>0||0===t.totalGridPower?"transparent":"".concat(t.gridColour),e.show_grid?"":"none",t.durationCur.grid)}static generateIcon(t,e){return V(ar||(ar=ht(['\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\t\t\t'])),(t=>Zt.handlePopup(t,e.entities.grid_connected_status_194)),Tt.includes(t.gridStatus.toLowerCase())?"st12":"",t.gridColour,!e.show_grid||t.totalGridPower<0||e.grid.import_icon?"none":"",ie,jt.includes(t.gridStatus.toLowerCase())?"st12":"",t.gridOffColour,!e.show_grid||e.grid.disconnected_icon?"none":"",oe,Tt.includes(t.gridStatus.toLowerCase())?"st12":"",t.gridColour,!e.show_grid||t.totalGridPower>=0||e.grid.export_icon?"none":"",ae,(t=>Zt.handlePopup(t,e.entities.grid_connected_status_194)),e.show_grid||e.grid.import_icon||e.grid.disconnected_icon||e.grid.export_icon?"":"none",t.customGridIcon)}}class br{static generateIcon(t){return V(or||(or=ht(['\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t'])),t.genericInverterImage?1:0,t.inverterColour,Ft)}static generateTimerInfo(t,e){return V(ir||(ir=ht(['\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t','\n\t\t\t\t\n\t\t\t\t',"\n\t\t\t\t\n\t\t\t\n\t\t"])),(t=>Zt.handlePopup(t,e.entities.use_timer_248)),"on"==t.stateUseTimer.state&&"no"!==t.enableTimer?"":"none",t.inverterColour,Jt,"off"==t.stateUseTimer.state&&"no"!==t.enableTimer?"":"none",t.inverterColour,Kt,"off"==t.stateUseTimer.state&&"no"!==t.enableTimer?"":"none",t.inverterColour,Et("common.timer_off"),"on"==t.stateUseTimer.state&&"no"!==t.enableTimer?"":"none",t.inverterColour,Et("common.timer_on"))}}class xr{constructor(){}getBatteryCapacity(t,e,n,r,a){let o=0;return t>0?o="off"===e||"0"===e||"off-grid"===e.toLowerCase()||!r.show||parseInt(a.state)<=r.capacity?n:r.capacity:t<0&&("off"===e||"0"===e||"off-grid"===e.toLowerCase()||!r.show||parseInt(a.state)>=r.capacity?o=100:parseInt(a.state)=95:n="M12 20H4V6h8L12 20m.67-16H11V2H5v2H3.33C2.6 4 2 4.6 2 5.33v15.34C2 21.4 2.6 22 3.33 22h9.34c.74 0 1.33-.59 1.33-1.33V5.33C14 4.6 13.4 4 12.67 4M5.02 18.5v1L11 19.5 11 18.5zM5 18 11 18 11 17H5zM5 16.5 11 16.5 11 15.5H5zM5 14 11 14 11 15H5zM5 12.5 11 12.5 11 13.5H5zM5 11 11 11 11 12H5zM5 9.5 11 9.5 11 10.5H5zM5 8 11 8 11 9H5zM5 6.5 11 6.5 11 7.5H5z",r="M11 19M5.02 18.5v1L11 19.5 11 18.5zM5 18 11 18 11 17H5zM5 16.5 11 16.5 11 15.5H5zM5 14 11 14 11 15H5zM5 12.5 11 12.5 11 13.5H5zM5 11 11 11 11 12H5zM5 9.5 11 9.5 11 10.5H5zM5 8 11 8 11 9H5zM5 6.5 11 6.5 11 7.5H5z",a="green";break;case 85<=parseInt(t.state)&&parseInt(t.state)<95:n="M12 20H4V6h8L12 20m.67-16H11V2H5v2H3.33C2.6 4 2 4.6 2 5.33v15.34C2 21.4 2.6 22 3.33 22h9.34c.74 0 1.33-.59 1.33-1.33V5.33C14 4.6 13.4 4 12.67 4M5.02 18.5v1L11 19.5 11 18.5zM5 18 11 18 11 17H5zM5 16.5 11 16.5 11 15.5H5zM5 14 11 14 11 15H5zM5 12.5 11 12.5 11 13.5H5zM5 11 11 11 11 12H5zM5 9.5 11 9.5 11 10.5H5zM5 8 11 8 11 9H5z",r="M11 19M5.02 18.5v1L11 19.5 11 18.5zM5 18 11 18 11 17H5zM5 16.5 11 16.5 11 15.5H5zM5 14 11 14 11 15H5zM5 12.5 11 12.5 11 13.5H5zM5 11 11 11 11 12H5zM5 9.5 11 9.5 11 10.5H5zM5 8 11 8 11 9H5z",a="green";break;case 75<=parseInt(t.state)&&parseInt(t.state)<85:n="M12 20H4V6h8L12 20m.67-16H11V2H5v2H3.33C2.6 4 2 4.6 2 5.33v15.34C2 21.4 2.6 22 3.33 22h9.34c.74 0 1.33-.59 1.33-1.33V5.33C14 4.6 13.4 4 12.67 4M5.02 18.5v1L11 19.5 11 18.5zM5 18 11 18 11 17H5zM5 16.5 11 16.5 11 15.5H5zM5 14 11 14 11 15H5zM5 12.5 11 12.5 11 13.5H5zM5 11 11 11 11 12H5zM5 9.5 11 9.5 11 10.5H5z",r="M11 19M5.02 18.5v1L11 19.5 11 18.5zM5 18 11 18 11 17H5zM5 16.5 11 16.5 11 15.5H5zM5 14 11 14 11 15H5zM5 12.5 11 12.5 11 13.5H5zM5 11 11 11 11 12H5zM5 9.5 11 9.5 11 10.5H5zH5z",a="#9ACD32";break;case 65<=parseInt(t.state)&&parseInt(t.state)<75:n="M12 20H4V6h8L12 20m.67-16H11V2H5v2H3.33C2.6 4 2 4.6 2 5.33v15.34C2 21.4 2.6 22 3.33 22h9.34c.74 0 1.33-.59 1.33-1.33V5.33C14 4.6 13.4 4 12.67 4M5.02 18.5v1L11 19.5 11 18.5zM5 18 11 18 11 17H5zM5 16.5 11 16.5 11 15.5H5zM5 14 11 14 11 15H5zM5 12.5 11 12.5 11 13.5H5zM5 11 11 11 11 12H5z",r="M11 19M5.02 18.5v1L11 19.5 11 18.5zM5 18 11 18 11 17H5zM5 16.5 11 16.5 11 15.5H5zM5 14 11 14 11 15H5zM5 12.5 11 12.5 11 13.5H5zM5 11 11 11 11 12H5zM5 11z",a="yellow";break;case 55<=parseInt(t.state)&&parseInt(t.state)<65:n="M12 20H4V6h8L12 20m.67-16H11V2H5v2H3.33C2.6 4 2 4.6 2 5.33v15.34C2 21.4 2.6 22 3.33 22h9.34c.74 0 1.33-.59 1.33-1.33V5.33C14 4.6 13.4 4 12.67 4M5.02 18.5v1L11 19.5 11 18.5zM5 18 11 18 11 17H5zM5 16.5 11 16.5 11 15.5H5zM5 14 11 14 11 15H5zM5 12.5 11 12.5 11 13.5H5z",r="M11 19M5.02 18.5v1L11 19.5 11 18.5zM5 18 11 18 11 17H5zM5 16.5 11 16.5 11 15.5H5zM5 14 11 14 11 15H5zM5 12.5 11 12.5 11 13.5H5z",a="yellow";break;case 45<=parseInt(t.state)&&parseInt(t.state)<55:n="M12 20H4V6h8L12 20m.67-16H11V2H5v2H3.33C2.6 4 2 4.6 2 5.33v15.34C2 21.4 2.6 22 3.33 22h9.34c.74 0 1.33-.59 1.33-1.33V5.33C14 4.6 13.4 4 12.67 4M5.02 18.5v1L11 19.5 11 18.5zM5 18 11 18 11 17H5zM5 16.5 11 16.5 11 15.5H5zM5 14 11 14 11 15H5z",r="M11 19M5.02 18.5v1L11 19.5 11 18.5zM5 18 11 18 11 17H5zM5 16.5 11 16.5 11 15.5H5zM5 14 11 14 11 15H5zH5z",a="yellow";break;case 35<=parseInt(t.state)&&parseInt(t.state)<45:n="M12 20H4V6h8L12 20m.67-16H11V2H5v2H3.33C2.6 4 2 4.6 2 5.33v15.34C2 21.4 2.6 22 3.33 22h9.34c.74 0 1.33-.59 1.33-1.33V5.33C14 4.6 13.4 4 12.67 4M5.02 18.5v1L11 19.5 11 18.5zM5 18 11 18 11 17H5zM5 16.5 11 16.5 11 15.5H5z",r="M11 19M5.02 18.5v1L11 19.5 11 18.5zM5 18 11 18 11 17H5zM5 16.5 11 16.5 11 15.5H5zH5z",a="orange";break;case 25<=parseInt(t.state)&&parseInt(t.state)<35:n="M12 20H4V6h8L12 20m.67-16H11V2H5v2H3.33C2.6 4 2 4.6 2 5.33v15.34C2 21.4 2.6 22 3.33 22h9.34c.74 0 1.33-.59 1.33-1.33V5.33C14 4.6 13.4 4 12.67 4M5.02 18.5v1L11 19.5 11 18.5zM5 18 11 18 11 17H5z",r="M11 19M5.02 18.5v1L11 19.5 11 18.5zM5 18 11 18 11 17H5zM5 17z",a="orange";break;case 10<=parseInt(t.state)&&parseInt(t.state)<25:n="M12 20H4V6h8L12 20m.67-16H11V2H5v2H3.33C2.6 4 2 4.6 2 5.33v15.34C2 21.4 2.6 22 3.33 22h9.34c.74 0 1.33-.59 1.33-1.33V5.33C14 4.6 13.4 4 12.67 4M5.02 18.5v1L11 19.5 11 18.5z",r="M11 19M5.02 18.5v1L11 19.5 11 18.5zM5 19z",a="orange";break;case 0<=parseInt(t.state)&&parseInt(t.state)<10:default:n=e,r=e,a="red"}return{batteryIcon:n,batteryCharge:r,stopColour:a,battery0:e}}}function Wr(t){let e=null!==t?.state&&"unknown"!==t.state&&void 0!==t.state&&null!=t?.entity_id&&t.entity_id,n=""!==t?.state&&e;return{...t,toNum:(e,n)=>Zt.toNum(t?.state,e,n),isValid:()=>e||!1,notEmpty:()=>n||!1,isNaN:()=>null===t?.state||Number.isNaN(t?.state),toPower:e=>{const n=(t.attributes?.unit_of_measurement||"").toLowerCase();return"kw"===n||"kwh"===n?Zt.toNum(1e3*(t?.state||"0"),0,e):"mw"===n||"mwh"===n?Zt.toNum(1e6*(t?.state||"0"),0,e):Zt.toNum(t?.state||"0",0,e)||0},toPowerString:(e,n,r)=>e?Zt.convertValueNew(t?.state,t?.attributes?.unit_of_measurement,n||0):"".concat(Zt.toNum(t?.state,0,r)," ").concat(t?.attributes?.unit_of_measurement||""),toString:()=>t?.state?.toString()||"",getUOM:()=>t?.attributes?.unit_of_measurement||""}}console.groupCollapsed("%c ⚡ POWER-FLOW-CARD by Molikk %c ".concat(Et("common.version"),": ").concat("0.1.1"," "),"color: orange; font-weight: bold; background: black","color: white; font-weight: bold; background: dimgray"),console.log("Readme:","https://github.com/molikk/mlk-power-flow-card"),console.groupEnd();let Xr=class extends it{constructor(){super(...arguments),this.durationPrev={},this.durationCur={}}static get styles(){return pt}static async getConfigElement(){return await Promise.resolve().then((function(){return ra})),document.createElement(Dt)}static getStubConfig(){return{show_solar:!0,battery:{energy:0,shutdown_soc:20,show_daily:!0},solar:{mppts:2},load:{show_daily:!0},grid:{show_daily_buy:!0,show_daily_sell:!1,show_nonessential:!0},entities:{use_timer_248:"switch.sunsynk_toggle_system_timer",priority_load_243:"switch.sunsynk_toggle_priority_load",inverter_voltage_154:"sensor.sunsynk_inverter_voltage",load_frequency_192:"sensor.sunsynk_load_frequency",inverter_current_164:"sensor.sunsynk_inverter_current",inverter_power_175:"sensor.sunsynk_inverter_power",grid_connected_status_194:"binary_sensor.sunsynk_grid_connected_status",inverter_status_59:"sensor.sunsynk_overall_state",day_battery_charge_70:"sensor.sunsynk_day_battery_charge",day_battery_discharge_71:"sensor.sunsynk_day_battery_discharge",battery_voltage_183:"sensor.sunsynk_battery_voltage",battery_soc_184:"sensor.sunsynk_battery_soc",battery_power_190:"sensor.sunsynk_battery_power",battery_current_191:"sensor.sunsynk_battery_current",grid_power_169:"sensor.sunsynk_grid_power",day_grid_import_76:"sensor.sunsynk_day_grid_import",day_grid_export_77:"sensor.sunsynk_day_grid_export",grid_ct_power_172:"sensor.sunsynk_grid_ct_power",day_load_energy_84:"sensor.sunsynk_day_load_energy",essential_power:"none",nonessential_power:"none",aux_power_166:"sensor.sunsynk_aux_power",day_pv_energy_108:"sensor.sunsynk_day_pv_energy",pv1_power_186:"sensor.sunsynk_pv1_power",pv2_power_187:"sensor.sunsynk_pv2_power",pv1_voltage_109:"sensor.sunsynk_pv1_voltage",pv1_current_110:"sensor.sunsynk_pv1_current",pv2_voltage_111:"sensor.sunsynk_pv2_voltage",pv2_current_112:"sensor.sunsynk_pv2_current"}}}render(){xt.hass=this.hass;const t=this._config,e=this.getEntity("entities.day_battery_discharge_71"),n=this.getEntity("entities.day_battery_charge_70"),r=this.getEntity("entities.day_load_energy_84"),a=this.getEntity("entities.day_grid_import_76"),o=this.getEntity("entities.day_grid_export_77"),i=this.getEntity("entities.day_aux_energy"),s=this.getEntity("entities.inverter_voltage_154"),l=this.getEntity("entities.load_frequency_192"),c=this.getEntity("entities.inverter_current_164"),u=this.getEntity("entities.inverter_status_59",{state:""}),d=this.getEntity("entities.inverter_power_175"),f=this.getEntity("entities.priority_load_243",{state:t.entities.priority_load_243?.toString()??"false"}),h=this.getEntity("entities.use_timer_248",{state:t.entities.use_timer_248?.toString()??"false"}),g=this.getEntity("entities.dc_transformer_temp_90",{state:""}),p=this.getEntity("entities.radiator_temp_91",{state:""}),y=this.getEntity("entities.inverter_voltage_L2",{state:""}),m=this.getEntity("entities.inverter_voltage_L3",{state:""}),v=this.getEntity("entities.inverter_current_L2",{state:""}),A=this.getEntity("entities.inverter_current_L3",{state:""}),w=this.getEntity("entities.environment_temp",{state:""}),b=this.getEntity("entities.battery_voltage_183"),x=this.getEntity("entities.battery_soc_184"),P=this.getEntity("entities.battery_power_190"),E=this.getEntity("entities.battery_current_191"),L=this.getEntity("entities.battery_temp_182",{state:""}),M=this.getEntity("entities.battery_status",{state:""}),z=this.getEntity("entities.battery_current_direction",{state:""}),N=this.getEntity("entities.battery_rated_capacity",{state:""}),C=this.getEntity("battery.shutdown_soc",{state:t.battery.shutdown_soc?.toString()??""}),k=this.getEntity("battery.shutdown_soc_offgrid",{state:t.battery.shutdown_soc_offgrid?.toString()??""}),T=this.getEntity("entities.battery_soh",{state:""}),j=this.getEntity("entities.essential_power"),D=this.getEntity("entities.aux_power_166"),O=this.getEntity("entities.nonessential_power"),B=this.getEntity("entities.non_essential_load1"),H=this.getEntity("entities.non_essential_load2"),R=this.getEntity("entities.non_essential_load3"),I=this.getEntity("entities.non_essential_load1_extra"),G=this.getEntity("entities.non_essential_load2_extra"),S=this.getEntity("entities.essential_load1"),Q=this.getEntity("entities.essential_load2"),Z=this.getEntity("entities.essential_load3"),_=this.getEntity("entities.essential_load4"),W=this.getEntity("entities.essential_load5"),X=this.getEntity("entities.essential_load6"),Y=this.getEntity("entities.essential_load7"),F=this.getEntity("entities.essential_load8"),J=this.getEntity("entities.aux_connected_status",{state:"on"}),K=this.getEntity("entities.aux_load1"),q=this.getEntity("entities.aux_load2"),$=this.getEntity("entities.essential_load1_extra"),tt=this.getEntity("entities.essential_load2_extra"),et=this.getEntity("entities.essential_load3_extra"),nt=this.getEntity("entities.essential_load4_extra"),rt=this.getEntity("entities.essential_load5_extra"),at=this.getEntity("entities.essential_load6_extra"),ot=this.getEntity("entities.essential_load7_extra"),it=this.getEntity("entities.essential_load8_extra"),st=this.getEntity("entities.load_power_L1"),lt=this.getEntity("entities.load_power_L2"),ct=this.getEntity("entities.load_power_L3"),ut=this.getEntity("entities.aux_load1_extra"),dt=this.getEntity("entities.aux_load2_extra"),ft=this.getEntity("entities.grid_ct_power_172"),gt=this.getEntity("entities.grid_ct_power_L2"),pt=this.getEntity("entities.grid_ct_power_L3"),mt=this.getEntity("entities.grid_ct_power_total"),vt=this.getEntity("entities.grid_connected_status_194",{state:"on"}),At=this.getEntity("entities.grid_power_169"),wt=this.getEntity("entities.energy_cost_buy",{state:"",attributes:{unit_of_measurement:""}}),bt=this.getEntity("entities.energy_cost_sell",{state:"",attributes:{unit_of_measurement:""}}),Pt=this.getEntity("entities.grid_voltage",null),Lt=this.getEntity("entities.prepaid_units"),Dt=this.getEntity("entities.max_sell_power"),Ot=this.getEntity("entities.pv1_voltage_109"),Ht=this.getEntity("entities.pv1_current_110"),Gt=this.getEntity("entities.pv2_voltage_111"),St=this.getEntity("entities.pv2_current_112"),Qt=this.getEntity("entities.pv3_voltage_113"),Ut=this.getEntity("entities.pv3_current_114"),Vt=this.getEntity("entities.pv4_voltage_115"),Ft=this.getEntity("entities.pv4_current_116"),Jt=this.getEntity("entities.pv5_voltage"),Kt=this.getEntity("entities.pv5_current"),ae=this.getEntity("entities.pv1_power_186"),oe=this.getEntity("entities.pv2_power_187"),ie=this.getEntity("entities.pv3_power_188"),se=this.getEntity("entities.pv4_power_189"),le=this.getEntity("entities.pv5_power"),ce=this.getEntity("entities.pv1_production"),ue=this.getEntity("entities.pv2_production"),de=this.getEntity("entities.pv3_production"),fe=this.getEntity("entities.pv4_production"),he=this.getEntity("entities.pv5_production"),ge=this.getEntity("entities.solar_sell_247",{state:"undefined"}),pe=this.getEntity("entities.pv_total"),ye=this.getEntity("entities.day_pv_energy_108"),me=this.getEntity("entities.monthly_pv_generation"),ve=this.getEntity("entities.yearly_pv_generation"),Ae=this.getEntity("entities.total_pv_generation"),we=this.getEntity("entities.remaining_solar"),{invert_aux:be}=t.load,xe=D.toPower(be),{invert_grid:Pe}=t.grid,Ee=ft.toPower(Pe),Le=gt.toPower(Pe),Me=pt.toPower(Pe),ze=t.entities?.grid_ct_power_total?mt.toPower(Pe):Ee+Le+Me,Ne=t.inverter.three_phase?ze:Ee,Ce=Pt.isNaN()?null:Pt.toNum(0),ke=z.isNaN()?null:z.toNum(0),Te=t.inverter?.modern,je=t.decimal_places,De=t.decimal_places_energy,Oe=this.colourConvert(t.load?.colour),Be=this.calculateAuxLoadColour(D.toPower(!1),Zt.toNum(t.load?.off_threshold,0))||Oe,He=this.colourConvert(t.load?.aux_off_colour||Be),Re=this.calculateAuxLoadColour(K.toPower(!1),Zt.toNum(t.load?.off_threshold,0))||Oe,Ie=this.calculateAuxLoadColour(q.toPower(!1),Zt.toNum(t.load?.off_threshold,0))||Oe,Ge=this.calculateEssentialLoadColour(S.toPower(!1),Zt.toNum(t.load?.off_threshold,0))||Oe,Se=this.calculateEssentialLoadColour(Q.toPower(!1),Zt.toNum(t.load?.off_threshold,0))||Oe,Qe=this.calculateEssentialLoadColour(Z.toPower(!1),Zt.toNum(t.load?.off_threshold,0))||Oe,Ue=this.calculateEssentialLoadColour(_.toPower(!1),Zt.toNum(t.load?.off_threshold,0))||Oe,Ve=this.calculateEssentialLoadColour(W.toPower(!1),Zt.toNum(t.load?.off_threshold,0))||Oe,Ze=this.calculateEssentialLoadColour(X.toPower(!1),Zt.toNum(t.load?.off_threshold,0))||Oe,_e=this.calculateEssentialLoadColour(Y.toPower(!1),Zt.toNum(t.load?.off_threshold,0))||Oe,We=this.calculateEssentialLoadColour(F.toPower(!1),Zt.toNum(t.load?.off_threshold,0))||Oe;t.title_colour=this.colourConvert(t.title_colour);const Xe=t.load?.show_daily,Ye=t.grid?.show_nonessential;let Fe=t.entities?.grid_connected_status_194?vt.state:"on";jt.includes(Fe.toLowerCase())||Tt.includes(Fe.toLowerCase())||(Fe="on");const Je=t.entities?.aux_connected_status?J.state:"on",Ke=t.entities?.load_frequency_192?l.toNum(2):0,qe=t.entities?.inverter_voltage_154?t.inverter.three_phase&&(this.isLiteCard||this.isCompactCard)?s.toNum(0):s.toNum(1):0,$e=t.entities?.inverter_voltage_L2?t.inverter.three_phase&&(this.isLiteCard||this.isCompactCard)?y.toNum(0):y.toNum(1):"",tn=t.entities?.inverter_voltage_L3?t.inverter.three_phase&&(this.isLiteCard||this.isCompactCard)?m.toNum(0):m.toNum(1):"",en=t.entities?.inverter_current_164?c.toNum(1):0,nn=t.entities?.inverter_current_L2?v.toNum(1):"",rn=t.entities?.inverter_current_L3?A.toNum(1):"",an=t.entities?.battery_voltage_183?b.toNum(1):0,on=t.entities?.inverter_power_175?d.toPower():0,sn=t.entities?.grid_power_169?At.toPower():0,{invert_load:ln}=t.load,cn=t.entities?.load_power_L1?st.toPower(ln):"",un=t.entities?.load_power_L2?lt.toPower(ln):"",dn=t.entities?.load_power_L3?ct.toPower(ln):"",fn=this.colourConvert(t.grid?.colour),hn=this.colourConvert(t.grid?.export_colour||fn),gn=this.colourConvert(t.grid?.no_grid_colour||fn);let pn;switch(!0){case Ne<0:pn=hn;break;case Ne>=0&&Ne<=Zt.toNum(t.grid?.off_threshold,0):pn=gn;break;default:pn=fn}const yn=Math.abs(B.toPower(!1))>Zt.toNum(t.grid?.off_threshold,0)?pn:"grey",mn=Math.abs(H.toPower(!1))>Zt.toNum(t.grid?.off_threshold,0)?pn:"grey",vn=Math.abs(R.toPower(!1))>Zt.toNum(t.grid?.off_threshold,0)?pn:"grey",An=this.colourConvert(t.grid?.grid_off_colour||pn);let wn=t.grid?.additional_loads;zt.includes(wn)||(wn=0);const bn=t.grid?.show_daily_buy,xn=t.grid?.show_daily_sell,Pn=this.colourConvert(t.battery?.colour),En=this.colourConvert(t.battery?.charge_colour||Pn),Ln=t.battery?.show_daily;let Mn=t.load?.show_aux;Ct.includes(Mn)||(Mn=!1);const zn=t.load?.show_daily_aux;let Nn=t.load?.additional_loads;Mt.includes(Nn)||(Nn=0);let Cn=t.load?.aux_loads;kt.includes(Cn)||(Cn=0);const kn=t.load?.aux_type,Tn=this.getEntity("load.load1_icon",{state:t.load?.load1_icon?.toString()??""}).state,jn=this.getEntity("load.load2_icon",{state:t.load?.load2_icon?.toString()??""}).state,Dn=this.getEntity("load.load3_icon",{state:t.load?.load3_icon?.toString()??""}).state,On=this.getEntity("load.load4_icon",{state:t.load?.load4_icon?.toString()??""}).state,Bn=this.getEntity("load.load5_icon",{state:t.load?.load5_icon?.toString()??""}).state,Hn=this.getEntity("load.load6_icon",{state:t.load?.load6_icon?.toString()??""}).state,Rn=this.getEntity("load.load7_icon",{state:t.load?.load7_icon?.toString()??""}).state,In=this.getEntity("load.load8_icon",{state:t.load?.load8_icon?.toString()??""}).state,Gn=this.getEntity("load.aux_load1_icon",{state:t.load?.aux_load1_icon?.toString()??""}).state,Sn=this.getEntity("load.aux_load2_icon",{state:t.load?.aux_load2_icon?.toString()??""}).state,Qn=this.getEntity("grid.nonessential_icon",{state:t.grid?.nonessential_icon?.toString()??""}).state,Un=this.getEntity("grid.load1_icon",{state:t.grid?.load1_icon?.toString()??""}).state,Vn=this.getEntity("grid.load2_icon",{state:t.grid?.load2_icon?.toString()??""}).state,Zn=this.getEntity("grid.load3_icon",{state:t.grid?.load3_icon?.toString()??""}).state,_n=this.getEntity("grid.import_icon",{state:t.grid?.import_icon?.toString()??""}).state,Wn=this.getEntity("grid.disconnected_icon",{state:t.grid?.disconnected_icon?.toString()??""}).state,Xn=this.getEntity("grid.export_icon",{state:t.grid?.export_icon?.toString()??""}).state,Yn=t.large_font,Fn=t.panel_mode,Jn=this.colourConvert(t.inverter?.colour),Kn=t.inverter?.autarky,qn=!!t.entities.use_timer_248&&h.state,$n=!!t.entities.priority_load_243&&f.state;let tr=P.toPower(t.battery?.invert_power);const er=this.getEntity("card_height",{state:t.card_height?.toString()??""}).state,nr=this.getEntity("card_width",{state:t.card_width?.toString()??""}).state,rr=0===t.grid?.energy_cost_decimals?0:t.grid?.energy_cost_decimals||2,ar=Ne>=0?wt.toNum(rr):bt.toNum(rr);let or=yt.Sunsynk;Object.values(yt).includes(t.inverter.model)&&(or=t.inverter.model);let ir="";const xr=Zr.getInstance(or);Te||(ir=xr.image);let Pr=!1;this.isCompactCard&&(Pr=!0);const Er=ae.toPower(),Lr=oe.toPower(),Mr=ie.toPower(),zr=se.toPower(),Nr=le.toPower(),Cr=Er+Lr+Mr+zr+Nr,kr=t.entities?.pv_total?pe.toNum():Cr,Tr=t.solar.dynamic_colour?Zt.toNum(kr,0)>Zt.toNum(t.solar?.off_threshold,0)?this.colourConvert(t.solar?.colour):"grey":this.colourConvert(t.solar?.colour);let jr,Dr,Or=t.inverter?.three_phase;Nt.includes(Or)||(Or=!1);const{essential_power:Br,nonessential_power:Hr}=t.entities;Dr=!1===Or?"none"!==Hr&&Hr?O.toPower():Ee-sn:"none"!==Hr&&Hr?O.toPower():Ee+Le+Me-sn,jr="none"!==Br&&Br?j.toPower(ln):!0===Or&&t.entities.load_power_L1&&t.entities.load_power_L2&&t.entities.load_power_L3?Number(cn)+Number(un)+Number(dn):kr+tr+sn-xe;const Rr={time:this.getEntity("entities.prog1_time",{state:t.entities.prog1_time??""}),capacity:this.getEntity("entities.prog1_capacity",{state:t.entities.prog1_capacity??""}),charge:this.getEntity("entities.prog1_charge",{state:t.entities.prog1_charge??""})},Ir={time:this.getEntity("entities.prog2_time",{state:t.entities.prog2_time??""}),capacity:this.getEntity("entities.prog2_capacity",{state:t.entities.prog2_capacity??""}),charge:this.getEntity("entities.prog2_charge",{state:t.entities.prog2_charge??""})},Gr={time:this.getEntity("entities.prog3_time",{state:t.entities.prog3_time??""}),capacity:this.getEntity("entities.prog3_capacity",{state:t.entities.prog3_capacity??""}),charge:this.getEntity("entities.prog3_charge",{state:t.entities.prog3_charge??""})},Sr={time:this.getEntity("entities.prog4_time",{state:t.entities.prog4_time??""}),capacity:this.getEntity("entities.prog4_capacity",{state:t.entities.prog4_capacity??""}),charge:this.getEntity("entities.prog4_charge",{state:t.entities.prog4_charge??""})},Qr={time:this.getEntity("entities.prog5_time",{state:t.entities.prog5_time??""}),capacity:this.getEntity("entities.prog5_capacity",{state:t.entities.prog5_capacity??""}),charge:this.getEntity("entities.prog5_charge",{state:t.entities.prog5_charge??""})},Ur={time:this.getEntity("entities.prog6_time",{state:t.entities.prog6_time??""}),capacity:this.getEntity("entities.prog6_capacity",{state:t.entities.prog6_capacity??""}),charge:this.getEntity("entities.prog6_charge",{state:t.entities.prog6_charge??""})},Vr=k.toNum(),Wr=C.toNum(),Xr={capacity:Wr,entityID:""};switch(!0){case"off"===h.state:case!qn:case!t.entities.prog1_time:case!t.entities.prog2_time:case!t.entities.prog3_time:case!t.entities.prog4_time:case!t.entities.prog5_time:case!t.entities.prog6_time:Xr.show=!1;break;default:Xr.show=!0;const bo=new Date,xo=[];[Rr,Ir,Gr,Sr,Qr,Ur].forEach(((t,e)=>{const[n,r]=t.time.state.split(":").map((t=>parseInt(t,10)));xo[e]=new Date(bo.getTime()),xo[e].setHours(n),xo[e].setMinutes(r)}));const[Po,Eo,Lo,Mo,zo,No]=xo;function Co(t,e){"No Grid or Gen"===t.charge.state||"0"===t.charge.state||"off"===t.charge.state?Xr.charge="none":Xr.charge="both",Xr.capacity=parseInt(t.capacity.state),Xr.entityID=e}bo>=No||bo=Po&&bo=Eo&&bo=Lo&&bo=Mo&&bo=zo&&bo50?"on":"off"),null!=ke&&or==yt.Solis&&0===ke&&(tr=-tr);let Yr=0;if(t.show_battery)if(!0==!Xr.show)tr>0?Yr="on"!==Fe&&"1"!==Fe&&"on-grid"!==Fe.toLowerCase()||Xr.show?"off"!==Fe&&"0"!==Fe&&"off-grid"!==Fe.toLowerCase()||!k.notEmpty()||Xr.show?Wr:Vr:Wr:tr<0&&(Yr=100);else Yr=xr.getBatteryCapacity(tr,Fe,Wr,Xr,x);let Fr=0,Jr="",Kr="";let qr=this.getEntity("battery.energy",{state:t.battery.energy?.toString()??""}).toPower(!1);if(an&&N.notEmpty()&&(qr=Zt.toNum(an*N.toNum(0),0)),t.show_battery||0!==qr){0===tr?Fr=(x.toNum()-Wr)/100*qr*60*60:tr>0?Fr=(x.toNum()-Yr)/100*qr/tr*60*60:tr<0&&(Fr=(Yr-x.toNum(0))/100*qr/tr*60*60*-1);const ko=new Date,To=1e3*Fr,jo=new Date(ko.getTime()+To),Do=jo.getHours(),Oo=jo.getMinutes().toString().padStart(2,"0"),Bo=Do.toString().padStart(2,"0");Jr="".concat(Bo,":").concat(Oo);const Ho=Math.floor(Fr/86400),Ro=Math.floor(Fr%86400/3600),Io=Math.floor(Fr%3600/60);if(Ho>0&&(Kr+="".concat(Ho).concat(Et("common.days")," ")),Ro>0){const Go=Ho>0&&Ro<10?"0".concat(Ro):"".concat(Ro);Kr+="".concat(Go).concat(Et("common.hrs")," ")}Kr+="".concat(Io).concat(Et("common.min"))}const $r=-2<=E.toNum(0)&&E.toNum(0)<=2&&x.toNum(0)>=99;let ta;ta=tr<0&&!$r?En:Pn;let ea="",na="",ra=u.state,aa=!1;or==yt.Solis&&(ra=u.isNaN()?u.toString():u.toNum(0).toString());const oa=xr.statusGroups;if(oa)for(const So of Object.keys(oa)){const Qo=oa[So],{states:Uo,color:Vo,message:Zo}=Qo;if(Uo.includes(ra.toLowerCase())){ea=Vo,na=Zo,aa=!0;break}}aa||("none"!==t.entities?.inverter_status_59&&t.entities?.inverter_status_59?(ea="transparent",na="Status"):(ea="transparent",na=""));let ia="transparent",sa="";if([yt.GoodweGridMode,yt.Goodwe,yt.Huawei].includes(or)){const _o=xr.batteryStatusGroups;if(_o)for(const Wo of Object.keys(_o)){const Xo=_o[Wo],{states:Yo,color:Fo,message:Jo}=Xo;if(Yo.includes(M.state.toLowerCase())){ia=Fo,sa=Jo,aa=!0;break}}aa||("none"!==t.entities?.battery_status&&t.entities?.battery_status?(ia="transparent",sa="Status"):(ia="transparent",sa=""))}const la=ye.toNum()+e.toNum(),ca=r.toNum()+n.toNum(),ua=0!=ca?Math.max(Math.min(Math.round(100*la/ca),100),0):0,da=0!=la?Math.max(Math.min(Math.round(100*ca/la),100),0):0,fa=kr+Zt.toNum("".concat(tr>0?tr:0))+Zt.toNum("".concat(xe<0?-1*xe:0)),ha=jr+Math.max(Dr,0)+Zt.toNum("".concat(xe>0?xe:0))+Zt.toNum("".concat(tr<0?-1*tr:0)),ga=0!=ha?Math.max(Math.min(Math.round(100*fa/ha),100),0):0,pa=0!=fa?Math.max(Math.min(Math.round(100*ha/fa),100),0):0,ya=(Zt.toNum(t.max_line_width)<1?1:t.max_line_width)-1,ma=Zt.toNum(t.min_line_width)||1,va=ye.toNum()+e.toNum()+a.toNum(),Aa=0!=la?Math.max(Math.min(Math.round(1e3*ca/la)/10,100),0):0,wa=0!=va?Math.max(Math.min(Math.round(1e3*la/va)/10,100),0):0,ba=this.getEntity("battery.max_power",{state:t.battery.max_power?.toString()??""}).toNum(0),xa=this.getEntity("solar.max_power",{state:t.solar.max_power?.toString()??""}),Pa=this.getEntity("load.max_power",{state:t.load.max_power?.toString()??""}),Ea=this.getEntity("grid.max_power",{state:t.grid.max_power?.toString()??""}),La=t.solar.max_power?this.dynamicLineWidth(Er,xa.toNum()||Er,ya,ma):ma,Ma=t.solar.max_power?this.dynamicLineWidth(Lr,xa.toNum()||Lr,ya,ma):ma,za=t.solar.max_power?this.dynamicLineWidth(Mr,xa.toNum()||Mr,ya,ma):ma,Na=t.solar.max_power?this.dynamicLineWidth(zr,xa.toNum()||zr,ya,ma):ma,Ca=t.solar.max_power?this.dynamicLineWidth(Nr,xa.toNum()||Nr,ya,ma):ma,ka=t.battery.max_power?this.dynamicLineWidth(Math.abs(tr),ba||Math.abs(tr),ya,ma):ma,Ta=t.load.max_power?this.dynamicLineWidth(Math.abs(jr),Pa.toNum()||Math.abs(jr),ya,ma):ma,ja=t.load.max_power?this.dynamicLineWidth(Math.abs(xe),Pa.toNum()||Math.abs(xe),ya,ma):ma,Da=t.grid.max_power?this.dynamicLineWidth(Math.abs(Ne),Ea.toNum()||Math.abs(Ne),ya,ma):ma,Oa=t.grid.max_power?this.dynamicLineWidth(Math.abs(sn),Ea.toNum()||Math.abs(sn),ya,ma):ma,Ba=t.grid.max_power?this.dynamicLineWidth(Math.abs(Dr),Ea.toNum()||Math.abs(Dr),ya,ma):ma,Ha=t.solar.max_power?this.dynamicLineWidth(kr,xa.toNum()||kr,ya,ma):ma;if(t&&t.solar&&t.solar.animation_speed){const Ko=t.solar.animation_speed-(t.solar.animation_speed-1)*(kr/(xa.toNum()||kr));this.changeAnimationSpeed("solar",Ko)}if(t&&t.solar&&t.solar.animation_speed){const qo=t.solar.animation_speed-(t.solar.animation_speed-1)*(Er/(xa.toNum()||Er));this.changeAnimationSpeed("pv1",qo)}if(t&&t.solar&&t.solar.animation_speed){const $o=t.solar.animation_speed-(t.solar.animation_speed-1)*(Lr/(xa.toNum()||Lr));this.changeAnimationSpeed("pv2",$o)}if(t&&t.solar&&t.solar.animation_speed){const ti=t.solar.animation_speed-(t.solar.animation_speed-1)*(Mr/(xa.toNum()||Mr));this.changeAnimationSpeed("pv3",ti)}if(t&&t.solar&&t.solar.animation_speed){const ei=t.solar.animation_speed-(t.solar.animation_speed-1)*(zr/(xa.toNum()||zr));this.changeAnimationSpeed("pv4",ei)}if(t&&t.solar&&t.solar.animation_speed){const ni=t.solar.animation_speed-(t.solar.animation_speed-1)*(Nr/(xa.toNum()||Nr));this.changeAnimationSpeed("pv5",ni)}if(t&&t.battery&&t.battery.animation_speed){const ri=t.battery.animation_speed-(t.battery.animation_speed-1)*(Math.abs(tr)/(ba||Math.abs(tr)));this.changeAnimationSpeed("battery",ri)}if(t&&t.load&&t.load.animation_speed){const ai=t.load.animation_speed-(t.load.animation_speed-1)*(Math.abs(jr)/(Pa.toNum()||Math.abs(jr)));this.changeAnimationSpeed("load",ai),this.changeAnimationSpeed("load1",ai)}if(t&&t.load&&t.load.animation_speed){const oi=t.load.animation_speed-(t.load.animation_speed-1)*(Math.abs(xe)/(Pa.toNum()||Math.abs(xe)));this.changeAnimationSpeed("aux",oi),this.changeAnimationSpeed("aux1",oi)}if(t&&t.grid&&t.grid.animation_speed){const ii=t.grid.animation_speed-(t.grid.animation_speed-1)*(Math.abs(Ne)/(Ea.toNum()||Math.abs(Ne)));this.changeAnimationSpeed("grid1",ii),this.changeAnimationSpeed("grid",ii),this.changeAnimationSpeed("grid2",ii)}if(t&&t.grid&&t.grid.animation_speed){const si=t.grid.animation_speed-(t.grid.animation_speed-1)*(Math.abs(Dr)/(Ea.toNum()||Math.abs(Dr)));this.changeAnimationSpeed("ne",si)}const Ra=0===kr?0:"off"!==$n&&$n||tr>0?kr/(Or?jr+Math.max(xe,0):jr)*100:(kr-Math.abs(tr))/(Or?jr+Math.max(xe,0):jr)*100,Ia=tr<=0?0:Math.abs(tr)/(Or?jr+Math.max(xe,0):jr)*100,Ga=Ra+Ia,Sa=0===Ga?0:Ra/Ga*100,Qa=0===Ga?0:Ia/Ga*100;let Ua=0,Va=0,Za=0;Ga>100?(Ua=Zt.toNum(Sa,0),Va=Zt.toNum(Qa,0)):(Ua=Zt.toNum(Math.min(Ra,100),0),Va=Zt.toNum(Math.min(Ia,100),0),Za=100-(Ua+Va));const _a=0===kr||tr>=0?0:"off"!==$n&&$n?(kr-jr)/Math.abs(tr)*100:kr/Math.abs(tr)*100,Wa=tr>=0||Ne<=0?0:"on"===$n?kr-jr>=Math.abs(tr)?0:(Ne-Math.max(jr-kr,0))/Math.abs(tr)*100:kr>=Math.abs(tr)?0:(Math.abs(tr)-kr)/Math.abs(tr)*100,Xa=_a+Wa,Ya=0===Xa?0:_a/Xa*100,Fa=0===Xa?0:Wa/Xa*100;let Ja,Ka,qa,$a,to,eo=0,no=0;switch(Xa>100?(eo=Zt.toNum(Ya,0),no=Zt.toNum(Fa,0)):(eo=Zt.toNum(Math.min(_a,100),0),no=Zt.toNum(Math.min(Wa,100),0)),!0){case eo>=Zt.toNum(t.battery?.path_threshold,0):Ja=Tr;break;case no>=Zt.toNum(t.battery?.path_threshold,0):Ja=pn;break;default:Ja=ta}switch(!0){case Ua>=Zt.toNum(t.load?.path_threshold,0):Ka=Tr;break;case Va>=Zt.toNum(t.load?.path_threshold,0):Ka=ta;break;case Za>=Zt.toNum(t.load?.path_threshold,0):Ka=pn;break;default:Ka=Oe}switch(!0){case Ua>=Zt.toNum(t.load?.path_threshold,0):qa=Tr;break;case Va>=Zt.toNum(t.load?.path_threshold,0):qa=ta;break;case Za>=Zt.toNum(t.load?.path_threshold,0):case no>=Zt.toNum(t.battery?.path_threshold,0):qa=pn;break;default:qa=Jn}switch(!0){case Ra>=100&&Ia<=5&&Ne-Dr<50&&t.load.dynamic_icon:$a=Yt,to=1;break;case Ia>=100&&Ra<=5&&Ne-Dr<50&&t.load.dynamic_icon:$a=Wt,to=0;break;case Ra<5&&Ia<5&&Za>0&&t.load.dynamic_icon:$a=Xt,to=0;break;default:$a=_t,to=0}const{batteryIcon:ro,batteryCharge:ao,stopColour:oo,battery0:io}=_r.convert(x),so=this.getEntity("solar.pv1_max_power",{state:t.solar.pv1_max_power?.toString()??""}),lo=this.getEntity("solar.pv2_max_power",{state:t.solar.pv2_max_power?.toString()??""}),co=this.getEntity("solar.pv3_max_power",{state:t.solar.pv3_max_power?.toString()??""}),uo=this.getEntity("solar.pv4_max_power",{state:t.solar.pv4_max_power?.toString()??""}),fo=this.getEntity("solar.pv5_max_power",{state:t.solar.pv5_max_power?.toString()??""}),ho=t.solar.max_power&&t.solar.visualize_efficiency?Zt.toNum(Math.min(kr/xa.toNum()*100,200),0):100,go=t.solar.pv1_max_power&&t.solar.visualize_efficiency?Zt.toNum(Math.min(Er/so.toNum()*100,200),0):100,po=t.solar.pv2_max_power&&t.solar.visualize_efficiency?Zt.toNum(Math.min(Lr/lo.toNum()*100,200),0):100,yo=t.solar.pv3_max_power&&t.solar.visualize_efficiency?Zt.toNum(Math.min(Mr/co.toNum()*100,200),0):100,mo=t.solar.pv4_max_power&&t.solar.visualize_efficiency?Zt.toNum(Math.min(zr/uo.toNum()*100,200),0):100,vo=t.solar.pv5_max_power&&t.solar.visualize_efficiency?Zt.toNum(Math.min(Nr/fo.toNum()*100,200),0):100;let Ao,wo;switch(!0){case Ne<0&&jt.includes(Fe.toLowerCase()):Ao=Xn,wo=pn;break;case Ne>=0&&jt.includes(Fe.toLowerCase()):Ao=_n,wo=pn;break;case 0===Ne&&Tt.includes(Fe.toLowerCase()):Ao=Wn,wo=An;break;default:Ao=_n,wo=pn}return((t,e,n)=>(vr.solarColour=n.solarColour,vr.decimalPlacesEnergy=n.decimalPlacesEnergy,vr.decimalPlaces=n.decimalPlaces,U(sr||(sr=ht(["\n \n ",'\n
\n ','\n \n\n ',"\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ",'\n \n \n\n \n \n \n \n \n \n \n X','\n \n Y','\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n\n \n \n ','\n \n \n \n \n ','\n \n \n \n \n ',": ",'\n \n \n \n ',"\n ","\n ","\n ",'\n \n \n \n ',' Hz\n \n \n \n ',"\n ","\n ","\n ",'\n \n \n \n \n '," ",'\n \n \n \n \n '," ",'\n \n \n \n \n ','%\n \n \n \n \n | ','%\n \n \n \n \n | ','%\n \n \n \n \n |\n \n \n \n \n ','\n \n \n \n \n ',"\n ",'\n \n \n \n \n ',"\n ","\n \n \n ",'\n\n \n \n ','°\n \n \n \n \n ','%\n \n \n \n \n AC:\n ','°\n \n \n \n \n DC:\n ',"°\n \n \n\n\n \n
\n
\n "])),mr.getStyle(n),t.title?U(lr||(lr=ht(['\n ',""])),t.title_colour||"inherit",t.title_size||"32px",t.title):"",t.show_solar?1:0===n.additionalLoad&&t.show_battery?145.33:80,t.show_solar?t.show_battery?408:[2,3,4,5,6,7,8].includes(n.additionalLoad)?400:300:t.show_battery&&0!==n.additionalLoad?350:270.67,!1===n.panelMode?"".concat(t.show_solar||t.show_battery?t.show_solar?t.show_solar&&!t.show_battery?[2,3,4,5,6,7,8].includes(n.additionalLoad)?"400px":"300px":"".concat(n.cardHeight):0!==n.additionalLoad?"330px":"246px":"270px"):"".concat(t.show_solar?"100%":"75%"),!0===n.panelMode?"".concat(n.cardWidth):"100%",Ar.generateShapes(n,t),Ar.generateDuration(n,t),Ar.generateDailyCharge(n,t),Ar.generateDailyDischarge(n,t),Ar.generateState(n,t),Ar.generateCapacity(n,t),Ar.generateShutdownSOC(n,t),Ar.generateFlowLines(n,t),Ar.generateBatteryGradient(n,t),wr.generateShapes(n,t),wr.generateDailyBuy(n,t),wr.generateDailySell(n,t),wr.generateGridName(n,t),wr.generateFlowLines(n,t),wr.generateIcon(n,t),wr.generateTotalPower(n,t),wr.generatePowers(n,t),wr.generatePrepaidUnits(n,t),gr.generateShapes(n),gr.generateDailyLoadName(n),gr.generateFlowLines(n,t),gr.generateIcon(n,t),gr.generatePowers(n,t),gr.generateTotalLoad(n,t),gr.generateDailyLoadValue(n,t),pr.generateLines(n),pr.generateLoad1(n,t),pr.generateLoad2(n,t),pr.generateLoad3(n,t),pr.generateLoad4(n,t),pr.generateLoad5(n,t),pr.generateLoad6(n,t),pr.generateLoad7(n,t),pr.generateLoad8(n,t),t.show_solar?V(cr||(cr=ht(["\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n "])),vr.generateSolarHeader(n,t),vr.generateMppt1(n,t),vr.generateMppt2(n,t),vr.generateMppt3(n,t),vr.generateMppt4(n,t),vr.generateMppt5(n,t),vr.generateSolarPower(n,t)):V(ur||(ur=ht([""]))),yr.getTexts(n),br.generateIcon(n),br.generateTimerInfo(n,t),n.inverterStateColour,n.compactMode?"238.5":"162",n.compactMode?"326":t.battery.show_remaining_energy?"310":"319","none"!==t.entities?.battery_status&&t.entities?.battery_status&&t.show_battery?"":"none",n.batteryStateColour,(e=>Zt.handlePopup(e,t.entities.priority_load_243)),"off"!==n.priorityLoad||"no"===n.priorityLoad&&n.priorityLoad?"none":"",n.inverterColour,te,"on"!==n.priorityLoad||"no"===n.priorityLoad&&n.priorityLoad?"none":"",n.inverterColour,ee,"off"!==n.priorityLoad||"no"===n.priorityLoad&&n.priorityLoad?"none":"",n.inverterColour,Et("common.priority_batt"),"on"!==n.priorityLoad||"no"===n.priorityLoad&&n.priorityLoad?"none":"",n.inverterColour,Et("common.priority_load"),(e=>Zt.handlePopup(e,t.entities.solar_sell_247)),t.entities.solar_sell_247&&"off"!==n.stateSolarSell.state&&"0"!==n.stateSolarSell.state&&t.show_solar&&["1","on"].includes(n.stateSolarSell.state)?"":"none",n.solarColour,qt,t.entities.solar_sell_247&&"on"!==n.stateSolarSell.state&&"1"!==n.stateSolarSell.state&&t.show_solar&&["0","off"].includes(n.stateSolarSell.state)?"":"none",n.solarColour,$t,n.genericInverterImage?"st12":"",e,(t=>Zt.handlePopup(t,n.inverterProg.entityID)),!1===n.inverterProg.show||"no"===n.enableTimer?"none":"","none"===n.inverterProg.charge||"off"!=n.stateUseTimer.state&&"on"!=n.stateUseTimer.state?"st12":"",n.inverterColour,ne,!1===n.inverterProg.show||"no"===n.enableTimer?"none":"","none"!==n.inverterProg.charge||"off"!==n.stateUseTimer.state&&"on"!==n.stateUseTimer.state?"st12":"",n.inverterColour,re,(e=>Zt.handlePopup(e,t.entities.day_grid_import_76)),t.show_grid&&!0===n.gridShowDailyBuy&&n.stateDayGridImport.isValid()?"":"none",n.gridColour,n.stateDayGridImport?.toPowerString(!0,n.decimalPlacesEnergy),(e=>Zt.handlePopup(e,t.entities.day_grid_export_77)),t.show_grid&&!0===n.gridShowDailySell&&n.stateDayGridExport.isValid()?"":"none",n.gridColour,n.stateDayGridExport?.toPowerString(!0,n.decimalPlacesEnergy),(e=>Zt.handlePopup(e,t.entities.max_sell_power)),["off","0"].includes(n.stateSolarSell.state)?"grey":n.gridColour,t.show_grid&&n.stateMaxSellPower.isValid&&t.entities?.max_sell_power?"":"none",Et("common.limit"),n.stateMaxSellPower.toPowerString(t.grid.auto_scale,n.decimalPlaces),(e=>Zt.handlePopup(e,t.entities.inverter_voltage_154)),"none"!==t.entities.inverter_voltage_154&&t.entities.inverter_voltage_154?"":"none",n.inverterColour,n.inverterVoltage,t.inverter.three_phase&&t.entities?.inverter_voltage_L2?"| "+n.inverterVoltageL2:"",t.inverter.three_phase&&t.entities?.inverter_voltage_L3?"| "+n.inverterVoltageL3:"",It.VOLT,(e=>Zt.handlePopup(e,t.entities.load_frequency_192)),"none"!==t.entities.load_frequency_192&&t.entities.load_frequency_192?"":"none",n.inverterColour,n.loadFrequency,(e=>Zt.handlePopup(e,t.entities.inverter_current_164)),"none"!==t.entities.inverter_current_164&&t.entities.inverter_current_164?"":"none",n.inverterColour,n.inverterCurrent,t.inverter.three_phase&&t.entities?.inverter_current_L2?"| "+n.inverterCurrentL2:"",t.inverter.three_phase&&t.entities?.inverter_current_L3?"| "+n.inverterCurrentL3:"",Rt.AMPERE,(e=>Zt.handlePopup(e,t.entities.battery_voltage_183)),"none"!==t.entities.battery_voltage_183&&t.entities.battery_voltage_183&&t.show_battery&&!n.compactMode?"":"none",n.batteryColour,!0!==n.largeFont?"st14":"st4",n.batteryVoltage,It.VOLT,(e=>Zt.handlePopup(e,t.entities.battery_voltage_183)),"none"!==t.entities.battery_voltage_183&&t.entities.battery_voltage_183&&t.show_battery&&n.compactMode?"":"none",n.batteryColour,n.compactMode?"st3 left-align":"st12",n.batteryVoltage,It.VOLT,(e=>Zt.handlePopup(e,t.entities.battery_soc_184)),n.compactMode?"270":"290","none"!==t.entities.battery_soc_184&&t.show_battery&&n.stateBatterySoc.isValid()?"":"none",n.batteryColour,n.stateBatterySoc.toNum(0),(e=>Zt.handlePopup(e,t.entities.battery_soc_184)),n.compactMode?"330":"350",n.batteryColour,n.inverterProg.show&&"none"!==t.entities.battery_soc_184&&t.show_battery&&!t.battery.hide_soc?"":"none",n.inverterProg.capacity||0,(e=>Zt.handlePopup(e,t.entities.battery_soc_184)),n.compactMode?"330":"350",n.batteryColour,t.battery.hide_soc||!t.show_battery?"st12":"st13 st8 left-align",n.inverterProg.show||!t.battery?.shutdown_soc||t.battery?.shutdown_soc_offgrid?"none":"",n.batteryShutdown||0,(e=>Zt.handlePopup(e,t.entities.battery_soc_184)),n.compactMode?"330":"350",n.batteryColour,t.battery.hide_soc||!t.show_battery?"st12":"st13 st8 left-align",!n.inverterProg.show&&t.battery.shutdown_soc_offgrid?"":"none",(e=>Zt.handlePopup(e,t.entities.battery_power_190)),n.compactMode?"239":"193",n.compactMode?"307":"386","none"!==t.entities.battery_power_190&&t.show_battery?"":"none",n.batteryColour,!0!==n.largeFont?"st14":"st4",t.battery.auto_scale?"".concat(t.battery.show_absolute?"".concat(Math.abs(parseFloat(Zt.convertValue(n.batteryPower,n.decimalPlaces)))," ").concat(Zt.convertValue(n.batteryPower,n.decimalPlaces).split(" ")[1]):Zt.convertValue(n.batteryPower,n.decimalPlaces)||"0"):"".concat(t.battery.show_absolute?"".concat(Math.abs(n.batteryPower)," ").concat(Bt.WATT):"".concat(n.batteryPower||0," ").concat(Bt.WATT)),(e=>Zt.handlePopup(e,t.entities.battery_current_191)),t.entities.battery_current_191&&"none"!==t.entities.battery_current_191&&t.show_battery&&!n.compactMode&&n.stateBatteryCurrent.isValid()?"":"none",n.batteryColour,!0!==n.largeFont?"st14":"st4",t.battery.show_absolute?Math.abs(n.stateBatteryCurrent.toNum(1)):n.stateBatteryCurrent.toNum(1),Rt.AMPERE,(e=>Zt.handlePopup(e,t.entities.battery_current_191)),t.entities.battery_current_191&&"none"!==t.entities.battery_current_191&&t.show_battery&&n.compactMode&&n.stateBatteryCurrent.isValid()?"":"none",n.batteryColour,n.compactMode?"st3 left-align":"st12",t.battery.show_absolute?Math.abs(n.stateBatteryCurrent.toNum(1)):n.stateBatteryCurrent.toNum(1),Rt.AMPERE,t.inverter.three_phase?t.entities?.grid_ct_power_total?V(dr||(dr=ht(['\n \n \n ',"\n \n "])),(e=>Zt.handlePopup(e,t.entities.grid_ct_power_total)),t.show_grid&&"none"!==t.entities.grid_ct_power_172?"":"none",!0!==n.largeFont?"st14":"st4",n.gridColour,t.grid.auto_scale?"".concat(t.grid.show_absolute?"".concat(Math.abs(parseFloat(Zt.convertValue(n.totalGridPower,n.decimalPlaces)))," ").concat(Zt.convertValue(n.totalGridPower,n.decimalPlaces).split(" ")[1]):Zt.convertValue(n.totalGridPower,n.decimalPlaces)||0):"".concat(t.grid.show_absolute?"".concat(Math.abs(n.totalGridPower)," ").concat(Bt.WATT):"".concat(n.totalGridPower||0," ").concat(Bt.WATT))):V(fr||(fr=ht(['\n \n ',"\n "])),t.show_grid&&"none"!==t.entities.grid_ct_power_172?"":"none",!0!==n.largeFont?"st14":"st4",n.gridColour,t.grid.auto_scale?"".concat(t.grid.show_absolute?"".concat(Math.abs(parseFloat(Zt.convertValue(n.totalGridPower,n.decimalPlaces)))," ").concat(Zt.convertValue(n.totalGridPower,n.decimalPlaces).split(" ")[1]):Zt.convertValue(n.totalGridPower,n.decimalPlaces)||0):"".concat(t.grid.show_absolute?"".concat(Math.abs(n.totalGridPower)," ").concat(Bt.WATT):"".concat(n.totalGridPower||0," ").concat(Bt.WATT))):V(hr||(hr=ht(['\n \n \n ',"\n \n "])),(e=>Zt.handlePopup(e,t.entities.grid_ct_power_172)),t.show_grid&&"none"!==t.entities.grid_ct_power_172?"":"none",!0!==n.largeFont?"st14":"st4",n.gridColour,t.grid.auto_scale?"".concat(t.grid.show_absolute?"".concat(Math.abs(parseFloat(Zt.convertValue(n.totalGridPower,n.decimalPlaces)))," ").concat(Zt.convertValue(n.totalGridPower,n.decimalPlaces).split(" ")[1]):Zt.convertValue(n.totalGridPower,n.decimalPlaces)||0):"".concat(t.grid.show_absolute?"".concat(Math.abs(n.totalGridPower)," ").concat(Bt.WATT):"".concat(n.totalGridPower||0," ").concat(Bt.WATT))),(e=>Zt.handlePopup(e,t.entities.battery_temp_182)),n.compactMode?"205":"250",n.compactMode?"332":"324.5",t.entities?.battery_temp_182?"st3 left-align":"st12",n.batteryColour,t.show_battery&&n.stateBatteryTemp.isValid()?"":"none",n.stateBatteryTemp.toNum(1),(e=>Zt.handlePopup(e,t.entities.battery_soh)),n.compactMode?"205":"250",n.compactMode?"332":"324.5",t.entities?.battery_soh?"st3 left-align":"st12",n.batteryColour,t.show_battery&&n.stateBatterySOH.isValid()&&!t.entities?.battery_temp_182?"":"none",n.stateBatterySOH.toNum(0),(e=>Zt.handlePopup(e,t.entities.radiator_temp_91)),n.inverterColour,t.entities?.radiator_temp_91&&n.stateRadiatorTemp.isValid()?"":"none",n.stateRadiatorTemp.toNum(1),(e=>Zt.handlePopup(e,t.entities.dc_transformer_temp_90)),n.inverterColour,t.entities?.dc_transformer_temp_90&&n.stateDCTransformerTemp.isValid()?"":"none",n.stateDCTransformerTemp.toNum(1))))(t,ir,{config:t,panelMode:Fn,compactMode:Pr,cardHeight:er,cardWidth:nr,loadColour:Oe,batteryColour:ta,gridColour:pn,isFloating:$r,inverterColour:Jn,solarColour:Tr,auxOffColour:He,batteryEnergy:qr,largeFont:Yn,batteryPower:tr,batteryDuration:Kr,batteryCapacity:Yr,additionalLoad:Nn,essIconSize:to,essIcon:$a,stateUseTimer:h,batteryStateMsg:sa,stateBatterySoc:x,inverterProg:Xr,batteryPercentage:Va,pvPercentage:Ua,loadShowDaily:Xe,stateEnergyCostSell:bt,stateEnergyCostBuy:wt,loadPowerL1:cn,loadPowerL2:un,loadPowerL3:dn,durationCur:this.durationCur,stateEssentialLoad1:S,stateEssentialLoad2:Q,stateEssentialLoad3:Z,stateEssentialLoad4:_,stateEssentialLoad5:W,stateEssentialLoad6:X,stateEssentialLoad7:Y,stateEssentialLoad8:F,gridPower:Ee,gridPowerL2:Le,gridPowerL3:Me,decimalPlaces:je,decimalPlacesEnergy:De,stateEssentialLoad1Extra:$,stateEssentialLoad2Extra:tt,stateEssentialLoad3Extra:et,stateEssentialLoad4Extra:nt,stateEssentialLoad5Extra:rt,stateEssentialLoad6Extra:at,stateEssentialLoad7Extra:ot,stateEssentialLoad8Extra:it,stateNonEssentialLoad1Extra:I,stateNonEssentialLoad2Extra:G,loadFrequency:Ke,gridShowDailyBuy:bn,gridShowDailySell:xn,batteryShowDaily:Ln,inverterModel:or,batteryShutdown:Wr,enableAutarky:Kn,autarkyPower:ga,ratioPower:pa,ratioEnergy:da,autarkyEnergy:ua,autarkyAuto:Aa,autarkySelf:wa,shutdownOffGrid:Vr,statePV1Current:Ht,statePV2Current:St,statePV3Current:Ut,statePV4Current:Ft,statePV5Current:Kt,energyCost:ar,inverterCurrent:en,inverterCurrentL2:nn,inverterCurrentL3:rn,stateRadiatorTemp:p,inverterVoltage:qe,inverterVoltageL2:$e,inverterVoltageL3:tn,batteryVoltage:an,stateBatteryCurrent:E,batLineWidth:ka,totalGridPower:Ne,solarLineWidth:Ha,totalPV:kr,loadLineWidth:Ta,pvPercentageBat:eo,gridPercentageBat:no,genericInverterImage:Te,battery0:io,essentialPower:jr,pv1LineWidth:La,pv2LineWidth:Ma,pv3LineWidth:za,pv4LineWidth:Na,pv5LineWidth:Ca,gridLineWidth:Da,stateEnvironmentTemp:w,statePV1Voltage:Ot,statePV2Voltage:Gt,statePV3Voltage:Qt,statePV4Voltage:Vt,statePV5Voltage:Jt,batteryStateColour:ia,inverterStateColour:ea,stateBatteryTemp:L,statePrepaidUnits:Lt,stateDCTransformerTemp:g,iconEssentialLoad1:Tn,iconEssentialLoad2:jn,iconEssentialLoad3:Dn,iconEssentialLoad4:On,iconEssentialLoad5:Bn,iconEssentialLoad6:Hn,iconEssentialLoad7:Rn,iconEssentialLoad8:In,enableTimer:qn,stateSolarSell:ge,priorityLoad:$n,inverterImg:ir,stateDailyPVEnergy:ye,stateMonthlyPVEnergy:me,stateYearlyPVEnergy:ve,stateTotalSolarGeneration:Ae,stateRemainingSolar:we,statePV2Power:oe,statePV3Power:ie,statePV4Power:se,statePV5Power:le,statePV1Energy:ce,statePV2Energy:ue,statePV3Energy:de,statePV4Energy:fe,statePV5Energy:he,stateDayLoadEnergy:r,stateDayBatteryDischarge:e,stateDayGridImport:a,stateDayBatteryCharge:n,stateDayGridExport:o,statePVTotal:pe,statePV1Power:ae,minLineWidth:ma,stopColour:oo,gridStatus:Fe,batteryCharge:ao,gridOffColour:An,batteryIcon:ro,formattedResultTime:Jr,showAux:Mn,nonessentialIcon:Qn,showNonessential:Ye,auxStatus:Je,nonessentialLoads:wn,additionalAuxLoad:Cn,stateAuxLoad1Extra:ut,stateAuxLoad2Extra:dt,iconNonessentialLoad1:Un,iconNonessentialLoad2:Vn,iconNonessentialLoad3:Zn,inverterStateMsg:na,auxType:kn,showDailyAux:zn,nonessentialPower:Dr,auxPower:xe,nonessLineWidth:Ba,grid169LineWidth:Oa,auxLineWidth:ja,iconAuxLoad1:Gn,iconAuxLoad2:Sn,stateDayAuxEnergy:i,stateAuxLoad1:K,stateAuxLoad2:q,stateNonessentialLoad1:B,stateNonessentialLoad2:H,stateNonessentialLoad3:R,autoScaledInverterPower:on,autoScaledGridPower:sn,auxDynamicColour:Be,auxDynamicColourLoad1:Re,auxDynamicColourLoad2:Ie,stateMaxSellPower:Dt,totalPVEfficiency:ho,PV1Efficiency:go,PV2Efficiency:po,PV3Efficiency:yo,PV4Efficiency:mo,PV5Efficiency:vo,gridPercentage:Za,flowColour:Ka,flowBatColour:Ja,flowInvColour:qa,dynamicColourEssentialLoad1:Ge,dynamicColourEssentialLoad2:Se,dynamicColourEssentialLoad3:Qe,dynamicColourEssentialLoad4:Ue,dynamicColourEssentialLoad5:Ve,dynamicColourEssentialLoad6:Ze,dynamicColourEssentialLoad7:_e,dynamicColourEssentialLoad8:We,dynamicColourNonEssentialLoad1:yn,dynamicColourNonEssentialLoad2:mn,dynamicColourNonEssentialLoad3:vn,stateBatterySOH:T,customGridIcon:Ao,customGridIconColour:wo})}getEntity(t,e={state:"0",attributes:{unit_of_measurement:""}}){let n;const r=String(t).split(".");r.length>1?n=this._config[r[0]][r[1]]:r.length>0&&(n=this._config[r[0]]);const a=n?this.hass.states[n]:void 0;return Wr(void 0!==a?a:e||{state:void 0})}changeAnimationSpeed(t,e){const n=e>=1?Zt.toNum(e,3):1,r=this["".concat(t,"Flow")];this.durationCur[t]=n,r&&this.durationPrev[t]!=n&&r.setCurrentTime(r.getCurrentTime()*(n/this.durationPrev[t])),this.durationPrev[t]=this.durationCur[t]}get isCompactCard(){return!0}get isLiteCard(){return!1}colourConvert(t){return t&&Array.isArray(t)?"rgb(".concat(t,")"):t}dynamicLineWidth(t,e,n,r=1){let a;return a=this._config.dynamic_line_width?Math.min(r+Math.min(t/e,1)*n,8):Math.min(r,8),a}calculateAuxLoadColour(t,e){return this._config.load.aux_dynamic_colour?Math.abs(t)>e?this.colourConvert(this._config.load?.aux_colour):"grey":this.colourConvert(this._config.load?.aux_colour)}calculateEssentialLoadColour(t,e){return this._config.load.dynamic_colour?Math.abs(t)>e?this.colourConvert(this._config.load?.colour):"grey":this.colourConvert(this._config.load?.colour)}setConfig(t){if(t.show_battery&&!t.battery)throw Error(Et("errors.battery.bat"));if(t.show_battery&&!t.battery.shutdown_soc)throw new Error(Et("errors.battery.shutdown_soc"));if(t.show_battery&&t.battery.show_daily&&(!t.entities.day_battery_charge_70||!t.entities.day_battery_discharge_71))throw Error(Et("errors.battery.show_daily"));if(t.show_solar&&!t.solar)throw Error(Et("errors.solar.sol"));if(t.show_solar&&!t.solar.mppts)throw Error(Et("errors.solar.mppts"));if(t&&t.grid&&t.grid.show_daily_buy&&!t.entities.day_grid_import_76||t&&t.grid&&t.grid.show_daily_sell&&!t.entities.day_grid_export_77)throw Error(Et("errors.grid.show_daily"));if(t&&t.entities&&"none"===t.entities.essential_power&&!t.entities.inverter_power_175||t&&t.entities&&"none"===t.entities.essential_power&&"none"===t.entities.inverter_power_175)throw Error(Et("errors.essential_power"));if(t&&t.entities&&"none"===t.entities.nonessential_power&&!t.entities.grid_power_169)throw Error(Et("errors.nonessential_power"));const e=["battery_soc_184","battery_power_190","battery_current_191","grid_ct_power_172","pv1_power_186"];for(const n of e)if("pv1_power_186"===n&&t.show_solar&&!t.entities[n]&&!t.entities[n])throw new Error("".concat(Et("errors.missing_entity")," e.g: ").concat(n,": sensor.example"));const n=t;this._config=Vt({},Lt,n)}getCardSize(){return 2}};var Yr,Fr;t([dt()],Xr.prototype,"hass",void 0),t([dt()],Xr.prototype,"_config",void 0),t([ft("#grid-flow")],Xr.prototype,"gridFlow",void 0),t([ft("#grid1-flow")],Xr.prototype,"grid1Flow",void 0),t([ft("#solar-flow")],Xr.prototype,"solarFlow",void 0),t([ft("#pv1-flow")],Xr.prototype,"pv1Flow",void 0),t([ft("#pv2-flow")],Xr.prototype,"pv2Flow",void 0),t([ft("#pv3-flow")],Xr.prototype,"pv3Flow",void 0),t([ft("#pv4-flow")],Xr.prototype,"pv4Flow",void 0),t([ft("#pv5-flow")],Xr.prototype,"pv5Flow",void 0),t([ft("#battery-flow")],Xr.prototype,"batteryFlow",void 0),t([ft("#load-flow")],Xr.prototype,"loadFlow",void 0),t([ft("#aux-flow")],Xr.prototype,"auxFlow",void 0),t([ft("#ne-flow")],Xr.prototype,"neFlow",void 0),t([ft("#ne1-flow")],Xr.prototype,"ne1Flow",void 0),Xr=t([lt("mlk-power-flow-card")],Xr),window.customCards.push({type:"mlk-power-flow-card",name:"Power Flow Card by Molikk",preview:!0,description:Et("common.description"),configurable:!0}),function(t){t.language="language",t.system="system",t.comma_decimal="comma_decimal",t.decimal_comma="decimal_comma",t.space_comma="space_comma",t.none="none"}(Yr||(Yr={})),function(t){t.language="language",t.system="system",t.am_pm="12",t.twenty_four="24"}(Fr||(Fr={}));var Jr,Kr,qr={exports:{}};Jr=qr,Kr=qr.exports,function(){var t,e="Expected a function",n="__lodash_hash_undefined__",r="__lodash_placeholder__",a=16,o=32,i=64,s=128,l=256,c=1/0,u=9007199254740991,d=NaN,f=4294967295,h=[["ary",s],["bind",1],["bindKey",2],["curry",8],["curryRight",a],["flip",512],["partial",o],["partialRight",i],["rearg",l]],g="[object Arguments]",p="[object Array]",y="[object Boolean]",m="[object Date]",v="[object Error]",A="[object Function]",w="[object GeneratorFunction]",b="[object Map]",x="[object Number]",P="[object Object]",E="[object Promise]",L="[object RegExp]",M="[object Set]",z="[object String]",N="[object Symbol]",C="[object WeakMap]",k="[object ArrayBuffer]",T="[object DataView]",j="[object Float32Array]",D="[object Float64Array]",O="[object Int8Array]",B="[object Int16Array]",H="[object Int32Array]",R="[object Uint8Array]",I="[object Uint8ClampedArray]",G="[object Uint16Array]",S="[object Uint32Array]",Q=/\b__p \+= '';/g,U=/\b(__p \+=) '' \+/g,V=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Z=/&(?:amp|lt|gt|quot|#39);/g,_=/[&<>"']/g,W=RegExp(Z.source),X=RegExp(_.source),Y=/<%-([\s\S]+?)%>/g,F=/<%([\s\S]+?)%>/g,J=/<%=([\s\S]+?)%>/g,K=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,q=/^\w*$/,$=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,tt=/[\\^$.*+?()[\]{}|]/g,et=RegExp(tt.source),nt=/^\s+/,rt=/\s/,at=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ot=/\{\n\/\* \[wrapped with (.+)\] \*/,it=/,? & /,st=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,lt=/[()=,{}\[\]\/\s]/,ct=/\\(\\)?/g,ut=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,dt=/\w*$/,ft=/^[-+]0x[0-9a-f]+$/i,ht=/^0b[01]+$/i,gt=/^\[object .+?Constructor\]$/,pt=/^0o[0-7]+$/i,yt=/^(?:0|[1-9]\d*)$/,mt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,vt=/($^)/,At=/['\n\r\u2028\u2029\\]/g,wt="\\ud800-\\udfff",bt="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",xt="\\u2700-\\u27bf",Pt="a-z\\xdf-\\xf6\\xf8-\\xff",Et="A-Z\\xc0-\\xd6\\xd8-\\xde",Lt="\\ufe0e\\ufe0f",Mt="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",zt="['’]",Nt="["+wt+"]",Ct="["+Mt+"]",kt="["+bt+"]",Tt="\\d+",jt="["+xt+"]",Dt="["+Pt+"]",Ot="[^"+wt+Mt+Tt+xt+Pt+Et+"]",Bt="\\ud83c[\\udffb-\\udfff]",Ht="[^"+wt+"]",Rt="(?:\\ud83c[\\udde6-\\uddff]){2}",It="[\\ud800-\\udbff][\\udc00-\\udfff]",Gt="["+Et+"]",Qt="\\u200d",Ut="(?:"+Dt+"|"+Ot+")",Vt="(?:"+Gt+"|"+Ot+")",Zt="(?:['’](?:d|ll|m|re|s|t|ve))?",_t="(?:['’](?:D|LL|M|RE|S|T|VE))?",Wt="(?:"+kt+"|"+Bt+")?",Xt="["+Lt+"]?",Yt=Xt+Wt+"(?:"+Qt+"(?:"+[Ht,Rt,It].join("|")+")"+Xt+Wt+")*",Ft="(?:"+[jt,Rt,It].join("|")+")"+Yt,Jt="(?:"+[Ht+kt+"?",kt,Rt,It,Nt].join("|")+")",Kt=RegExp(zt,"g"),qt=RegExp(kt,"g"),$t=RegExp(Bt+"(?="+Bt+")|"+Jt+Yt,"g"),te=RegExp([Gt+"?"+Dt+"+"+Zt+"(?="+[Ct,Gt,"$"].join("|")+")",Vt+"+"+_t+"(?="+[Ct,Gt+Ut,"$"].join("|")+")",Gt+"?"+Ut+"+"+Zt,Gt+"+"+_t,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Tt,Ft].join("|"),"g"),ee=RegExp("["+Qt+wt+bt+Lt+"]"),ne=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,re=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],ae=-1,oe={};oe[j]=oe[D]=oe[O]=oe[B]=oe[H]=oe[R]=oe[I]=oe[G]=oe[S]=!0,oe[g]=oe[p]=oe[k]=oe[y]=oe[T]=oe[m]=oe[v]=oe[A]=oe[b]=oe[x]=oe[P]=oe[L]=oe[M]=oe[z]=oe[C]=!1;var ie={};ie[g]=ie[p]=ie[k]=ie[T]=ie[y]=ie[m]=ie[j]=ie[D]=ie[O]=ie[B]=ie[H]=ie[b]=ie[x]=ie[P]=ie[L]=ie[M]=ie[z]=ie[N]=ie[R]=ie[I]=ie[G]=ie[S]=!0,ie[v]=ie[A]=ie[C]=!1;var se={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},le=parseFloat,ce=parseInt,ue="object"==typeof St&&St&&St.Object===Object&&St,de="object"==typeof self&&self&&self.Object===Object&&self,fe=ue||de||Function("return this")(),he=Kr&&!Kr.nodeType&&Kr,ge=he&&Jr&&!Jr.nodeType&&Jr,pe=ge&&ge.exports===he,ye=pe&&ue.process,me=function(){try{var t=ge&&ge.require&&ge.require("util").types;return t||ye&&ye.binding&&ye.binding("util")}catch(t){}}(),ve=me&&me.isArrayBuffer,Ae=me&&me.isDate,we=me&&me.isMap,be=me&&me.isRegExp,xe=me&&me.isSet,Pe=me&&me.isTypedArray;function Ee(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function Le(t,e,n,r){for(var a=-1,o=null==t?0:t.length;++a-1}function Te(t,e,n){for(var r=-1,a=null==t?0:t.length;++r-1;);return n}function tn(t,e){for(var n=t.length;n--&&Se(e,t[n],0)>-1;);return n}var en=_e({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),nn=_e({"&":"&","<":"<",">":">",'"':""","'":"'"});function rn(t){return"\\"+se[t]}function an(t){return ee.test(t)}function on(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n}function sn(t,e){return function(n){return t(e(n))}}function ln(t,e){for(var n=-1,a=t.length,o=0,i=[];++n",""":'"',"'":"'"}),pn=function rt(wt){var bt,xt=(wt=null==wt?fe:pn.defaults(fe.Object(),wt,pn.pick(fe,re))).Array,Pt=wt.Date,Et=wt.Error,Lt=wt.Function,Mt=wt.Math,zt=wt.Object,Nt=wt.RegExp,Ct=wt.String,kt=wt.TypeError,Tt=xt.prototype,jt=Lt.prototype,Dt=zt.prototype,Ot=wt["__core-js_shared__"],Bt=jt.toString,Ht=Dt.hasOwnProperty,Rt=0,It=(bt=/[^.]+$/.exec(Ot&&Ot.keys&&Ot.keys.IE_PROTO||""))?"Symbol(src)_1."+bt:"",Gt=Dt.toString,St=Bt.call(zt),Qt=fe._,Ut=Nt("^"+Bt.call(Ht).replace(tt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Vt=pe?wt.Buffer:t,Zt=wt.Symbol,_t=wt.Uint8Array,Wt=Vt?Vt.allocUnsafe:t,Xt=sn(zt.getPrototypeOf,zt),Yt=zt.create,Ft=Dt.propertyIsEnumerable,Jt=Tt.splice,$t=Zt?Zt.isConcatSpreadable:t,ee=Zt?Zt.iterator:t,se=Zt?Zt.toStringTag:t,ue=function(){try{var t=ho(zt,"defineProperty");return t({},"",{}),t}catch(t){}}(),de=wt.clearTimeout!==fe.clearTimeout&&wt.clearTimeout,he=Pt&&Pt.now!==fe.Date.now&&Pt.now,ge=wt.setTimeout!==fe.setTimeout&&wt.setTimeout,ye=Mt.ceil,me=Mt.floor,Re=zt.getOwnPropertySymbols,_e=Vt?Vt.isBuffer:t,yn=wt.isFinite,mn=Tt.join,vn=sn(zt.keys,zt),An=Mt.max,wn=Mt.min,bn=Pt.now,xn=wt.parseInt,Pn=Mt.random,En=Tt.reverse,Ln=ho(wt,"DataView"),Mn=ho(wt,"Map"),zn=ho(wt,"Promise"),Nn=ho(wt,"Set"),Cn=ho(wt,"WeakMap"),kn=ho(zt,"create"),Tn=Cn&&new Cn,jn={},Dn=Go(Ln),On=Go(Mn),Bn=Go(zn),Hn=Go(Nn),Rn=Go(Cn),In=Zt?Zt.prototype:t,Gn=In?In.valueOf:t,Sn=In?In.toString:t;function Qn(t){if(ns(t)&&!_i(t)&&!(t instanceof _n)){if(t instanceof Zn)return t;if(Ht.call(t,"__wrapped__"))return So(t)}return new Zn(t)}var Un=function(){function e(){}return function(n){if(!es(n))return{};if(Yt)return Yt(n);e.prototype=n;var r=new e;return e.prototype=t,r}}();function Vn(){}function Zn(e,n){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!n,this.__index__=0,this.__values__=t}function _n(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=f,this.__views__=[]}function Wn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e=n?e:n)),e}function cr(e,n,r,a,o,i){var s,l=1&n,c=2&n,u=4&n;if(r&&(s=o?r(e,a,o,i):r(e)),s!==t)return s;if(!es(e))return e;var d=_i(e);if(d){if(s=function(t){var e=t.length,n=new t.constructor(e);return e&&"string"==typeof t[0]&&Ht.call(t,"index")&&(n.index=t.index,n.input=t.input),n}(e),!l)return ka(e,s)}else{var f=yo(e),h=f==A||f==w;if(Fi(e))return Ea(e,l);if(f==P||f==g||h&&!o){if(s=c||h?{}:vo(e),!l)return c?function(t,e){return Ta(t,po(t),e)}(e,function(t,e){return t&&Ta(e,Ds(e),t)}(s,e)):function(t,e){return Ta(t,go(t),e)}(e,or(s,e))}else{if(!ie[f])return o?e:{};s=function(t,e,n){var r,a=t.constructor;switch(e){case k:return La(t);case y:case m:return new a(+t);case T:return function(t,e){var n=e?La(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,n);case j:case D:case O:case B:case H:case R:case I:case G:case S:return Ma(t,n);case b:return new a;case x:case z:return new a(t);case L:return function(t){var e=new t.constructor(t.source,dt.exec(t));return e.lastIndex=t.lastIndex,e}(t);case M:return new a;case N:return r=t,Gn?zt(Gn.call(r)):{}}}(e,f,l)}}i||(i=new Jn);var p=i.get(e);if(p)return p;i.set(e,s),ss(e)?e.forEach((function(t){s.add(cr(t,n,r,t,e,i))})):rs(e)&&e.forEach((function(t,a){s.set(a,cr(t,n,r,a,e,i))}));var v=d?t:(u?c?oo:ao:c?Ds:js)(e);return Me(v||e,(function(t,a){v&&(t=e[a=t]),nr(s,a,cr(t,n,r,a,e,i))})),s}function ur(e,n,r){var a=r.length;if(null==e)return!a;for(e=zt(e);a--;){var o=r[a],i=n[o],s=e[o];if(s===t&&!(o in e)||!i(s))return!1}return!0}function dr(n,r,a){if("function"!=typeof n)throw new kt(e);return jo((function(){n.apply(t,a)}),r)}function fr(t,e,n,r){var a=-1,o=ke,i=!0,s=t.length,l=[],c=e.length;if(!s)return l;n&&(e=je(e,Je(n))),r?(o=Te,i=!1):e.length>=200&&(o=qe,i=!1,e=new Fn(e));t:for(;++a-1},Xn.prototype.set=function(t,e){var n=this.__data__,r=rr(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this},Yn.prototype.clear=function(){this.size=0,this.__data__={hash:new Wn,map:new(Mn||Xn),string:new Wn}},Yn.prototype.delete=function(t){var e=uo(this,t).delete(t);return this.size-=e?1:0,e},Yn.prototype.get=function(t){return uo(this,t).get(t)},Yn.prototype.has=function(t){return uo(this,t).has(t)},Yn.prototype.set=function(t,e){var n=uo(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this},Fn.prototype.add=Fn.prototype.push=function(t){return this.__data__.set(t,n),this},Fn.prototype.has=function(t){return this.__data__.has(t)},Jn.prototype.clear=function(){this.__data__=new Xn,this.size=0},Jn.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},Jn.prototype.get=function(t){return this.__data__.get(t)},Jn.prototype.has=function(t){return this.__data__.has(t)},Jn.prototype.set=function(t,e){var n=this.__data__;if(n instanceof Xn){var r=n.__data__;if(!Mn||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new Yn(r)}return n.set(t,e),this.size=n.size,this};var hr=Oa(br),gr=Oa(xr,!0);function pr(t,e){var n=!0;return hr(t,(function(t,r,a){return n=!!e(t,r,a)})),n}function yr(e,n,r){for(var a=-1,o=e.length;++a0&&n(s)?e>1?vr(s,e-1,n,r,a):De(a,s):r||(a[a.length]=s)}return a}var Ar=Ba(),wr=Ba(!0);function br(t,e){return t&&Ar(t,e,js)}function xr(t,e){return t&&wr(t,e,js)}function Pr(t,e){return Ce(e,(function(e){return qi(t[e])}))}function Er(e,n){for(var r=0,a=(n=wa(n,e)).length;null!=e&&re}function Nr(t,e){return null!=t&&Ht.call(t,e)}function Cr(t,e){return null!=t&&e in zt(t)}function kr(e,n,r){for(var a=r?Te:ke,o=e[0].length,i=e.length,s=i,l=xt(i),c=1/0,u=[];s--;){var d=e[s];s&&n&&(d=je(d,Je(n))),c=wn(d.length,c),l[s]=!r&&(n||o>=120&&d.length>=120)?new Fn(s&&d):t}d=e[0];var f=-1,h=l[0];t:for(;++f=s?l:l*("desc"==n[r]?-1:1)}return t.index-e.index}(t,e,n)}))}function Wr(t,e,n){for(var r=-1,a=e.length,o={};++r-1;)s!==t&&Jt.call(s,l,1),Jt.call(t,l,1);return t}function Yr(t,e){for(var n=t?e.length:0,r=n-1;n--;){var a=e[n];if(n==r||a!==o){var o=a;wo(a)?Jt.call(t,a,1):fa(t,a)}}return t}function Fr(t,e){return t+me(Pn()*(e-t+1))}function Jr(t,e){var n="";if(!t||e<1||e>u)return n;do{e%2&&(n+=t),(e=me(e/2))&&(t+=t)}while(e);return n}function Kr(t,e){return Do(No(t,e,al),t+"")}function qr(t){return qn(Qs(t))}function $r(t,e){var n=Qs(t);return Ho(n,lr(e,0,n.length))}function ta(e,n,r,a){if(!es(e))return e;for(var o=-1,i=(n=wa(n,e)).length,s=i-1,l=e;null!=l&&++oa?0:a+e),(n=n>a?a:n)<0&&(n+=a),a=e>n?0:n-e>>>0,e>>>=0;for(var o=xt(a);++r>>1,i=t[o];null!==i&&!cs(i)&&(n?i<=e:i=200){var c=e?null:Ja(t);if(c)return cn(c);i=!1,a=qe,l=new Fn}else l=e?[]:s;t:for(;++r=a?e:aa(e,n,r)}var Pa=de||function(t){return fe.clearTimeout(t)};function Ea(t,e){if(e)return t.slice();var n=t.length,r=Wt?Wt(n):new t.constructor(n);return t.copy(r),r}function La(t){var e=new t.constructor(t.byteLength);return new _t(e).set(new _t(t)),e}function Ma(t,e){var n=e?La(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function za(e,n){if(e!==n){var r=e!==t,a=null===e,o=e==e,i=cs(e),s=n!==t,l=null===n,c=n==n,u=cs(n);if(!l&&!u&&!i&&e>n||i&&s&&c&&!l&&!u||a&&s&&c||!r&&c||!o)return 1;if(!a&&!i&&!u&&e1?r[o-1]:t,s=o>2?r[2]:t;for(i=e.length>3&&"function"==typeof i?(o--,i):t,s&&bo(r[0],r[1],s)&&(i=o<3?t:i,o=1),n=zt(n);++a-1?o[i?n[s]:s]:t}}function Sa(n){return ro((function(r){var a=r.length,o=a,i=Zn.prototype.thru;for(n&&r.reverse();o--;){var s=r[o];if("function"!=typeof s)throw new kt(e);if(i&&!l&&"wrapper"==so(s))var l=new Zn([],!0)}for(o=l?o:a;++o1&&A.reverse(),f&&ul))return!1;var u=i.get(e),d=i.get(n);if(u&&d)return u==n&&d==e;var f=-1,h=!0,g=2&r?new Fn:t;for(i.set(e,n),i.set(n,e);++f-1&&t%1==0&&t1?"& ":"")+e[r],e=e.join(n>2?", ":" "),t.replace(at,"{\n/* [wrapped with "+e+"] */\n")}(r,function(t,e){return Me(h,(function(n){var r="_."+n[0];e&n[1]&&!ke(t,r)&&t.push(r)})),t.sort()}(function(t){var e=t.match(ot);return e?e[1].split(it):[]}(r),n)))}function Bo(e){var n=0,r=0;return function(){var a=bn(),o=16-(a-r);if(r=a,o>0){if(++n>=800)return arguments[0]}else n=0;return e.apply(t,arguments)}}function Ho(e,n){var r=-1,a=e.length,o=a-1;for(n=n===t?a:n;++r1?e[n-1]:t;return r="function"==typeof r?(e.pop(),r):t,ii(e,r)}));function hi(t){var e=Qn(t);return e.__chain__=!0,e}function gi(t,e){return e(t)}var pi=ro((function(e){var n=e.length,r=n?e[0]:0,a=this.__wrapped__,o=function(t){return sr(t,e)};return!(n>1||this.__actions__.length)&&a instanceof _n&&wo(r)?((a=a.slice(r,+r+(n?1:0))).__actions__.push({func:gi,args:[o],thisArg:t}),new Zn(a,this.__chain__).thru((function(e){return n&&!e.length&&e.push(t),e}))):this.thru(o)})),yi=ja((function(t,e,n){Ht.call(t,n)?++t[n]:ir(t,n,1)})),mi=Ga(Zo),vi=Ga(_o);function Ai(t,e){return(_i(t)?Me:hr)(t,co(e,3))}function wi(t,e){return(_i(t)?ze:gr)(t,co(e,3))}var bi=ja((function(t,e,n){Ht.call(t,n)?t[n].push(e):ir(t,n,[e])})),xi=Kr((function(t,e,n){var r=-1,a="function"==typeof e,o=Xi(t)?xt(t.length):[];return hr(t,(function(t){o[++r]=a?Ee(e,t,n):Tr(t,e,n)})),o})),Pi=ja((function(t,e,n){ir(t,n,e)}));function Ei(t,e){return(_i(t)?je:Sr)(t,co(e,3))}var Li=ja((function(t,e,n){t[n?0:1].push(e)}),(function(){return[[],[]]})),Mi=Kr((function(t,e){if(null==t)return[];var n=e.length;return n>1&&bo(t,e[0],e[1])?e=[]:n>2&&bo(e[0],e[1],e[2])&&(e=[e[0]]),_r(t,vr(e,1),[])})),zi=he||function(){return fe.Date.now()};function Ni(e,n,r){return n=r?t:n,n=e&&null==n?e.length:n,qa(e,s,t,t,t,t,n)}function Ci(n,r){var a;if("function"!=typeof r)throw new kt(e);return n=ps(n),function(){return--n>0&&(a=r.apply(this,arguments)),n<=1&&(r=t),a}}var ki=Kr((function(t,e,n){var r=1;if(n.length){var a=ln(n,lo(ki));r|=o}return qa(t,r,e,n,a)})),Ti=Kr((function(t,e,n){var r=3;if(n.length){var a=ln(n,lo(Ti));r|=o}return qa(e,r,t,n,a)}));function ji(n,r,a){var o,i,s,l,c,u,d=0,f=!1,h=!1,g=!0;if("function"!=typeof n)throw new kt(e);function p(e){var r=o,a=i;return o=i=t,d=e,l=n.apply(a,r)}function y(e){var n=e-u;return u===t||n>=r||n<0||h&&e-d>=s}function m(){var t=zi();if(y(t))return v(t);c=jo(m,function(t){var e=r-(t-u);return h?wn(e,s-(t-d)):e}(t))}function v(e){return c=t,g&&o?p(e):(o=i=t,l)}function A(){var e=zi(),n=y(e);if(o=arguments,i=this,u=e,n){if(c===t)return function(t){return d=t,c=jo(m,r),f?p(t):l}(u);if(h)return Pa(c),c=jo(m,r),p(u)}return c===t&&(c=jo(m,r)),l}return r=ms(r)||0,es(a)&&(f=!!a.leading,s=(h="maxWait"in a)?An(ms(a.maxWait)||0,r):s,g="trailing"in a?!!a.trailing:g),A.cancel=function(){c!==t&&Pa(c),d=0,o=u=i=c=t},A.flush=function(){return c===t?l:v(zi())},A}var Di=Kr((function(t,e){return dr(t,1,e)})),Oi=Kr((function(t,e,n){return dr(t,ms(e)||0,n)}));function Bi(t,n){if("function"!=typeof t||null!=n&&"function"!=typeof n)throw new kt(e);var r=function(){var e=arguments,a=n?n.apply(this,e):e[0],o=r.cache;if(o.has(a))return o.get(a);var i=t.apply(this,e);return r.cache=o.set(a,i)||o,i};return r.cache=new(Bi.Cache||Yn),r}function Hi(t){if("function"!=typeof t)throw new kt(e);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}Bi.Cache=Yn;var Ri=ba((function(t,e){var n=(e=1==e.length&&_i(e[0])?je(e[0],Je(co())):je(vr(e,1),Je(co()))).length;return Kr((function(r){for(var a=-1,o=wn(r.length,n);++a=e})),Zi=jr(function(){return arguments}())?jr:function(t){return ns(t)&&Ht.call(t,"callee")&&!Ft.call(t,"callee")},_i=xt.isArray,Wi=ve?Je(ve):function(t){return ns(t)&&Mr(t)==k};function Xi(t){return null!=t&&ts(t.length)&&!qi(t)}function Yi(t){return ns(t)&&Xi(t)}var Fi=_e||ml,Ji=Ae?Je(Ae):function(t){return ns(t)&&Mr(t)==m};function Ki(t){if(!ns(t))return!1;var e=Mr(t);return e==v||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!os(t)}function qi(t){if(!es(t))return!1;var e=Mr(t);return e==A||e==w||"[object AsyncFunction]"==e||"[object Proxy]"==e}function $i(t){return"number"==typeof t&&t==ps(t)}function ts(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=u}function es(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function ns(t){return null!=t&&"object"==typeof t}var rs=we?Je(we):function(t){return ns(t)&&yo(t)==b};function as(t){return"number"==typeof t||ns(t)&&Mr(t)==x}function os(t){if(!ns(t)||Mr(t)!=P)return!1;var e=Xt(t);if(null===e)return!0;var n=Ht.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&Bt.call(n)==St}var is=be?Je(be):function(t){return ns(t)&&Mr(t)==L},ss=xe?Je(xe):function(t){return ns(t)&&yo(t)==M};function ls(t){return"string"==typeof t||!_i(t)&&ns(t)&&Mr(t)==z}function cs(t){return"symbol"==typeof t||ns(t)&&Mr(t)==N}var us=Pe?Je(Pe):function(t){return ns(t)&&ts(t.length)&&!!oe[Mr(t)]},ds=Xa(Gr),fs=Xa((function(t,e){return t<=e}));function hs(t){if(!t)return[];if(Xi(t))return ls(t)?fn(t):ka(t);if(ee&&t[ee])return function(t){for(var e,n=[];!(e=t.next()).done;)n.push(e.value);return n}(t[ee]());var e=yo(t);return(e==b?on:e==M?cn:Qs)(t)}function gs(t){return t?(t=ms(t))===c||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function ps(t){var e=gs(t),n=e%1;return e==e?n?e-n:e:0}function ys(t){return t?lr(ps(t),0,f):0}function ms(t){if("number"==typeof t)return t;if(cs(t))return d;if(es(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=es(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=Fe(t);var n=ht.test(t);return n||pt.test(t)?ce(t.slice(2),n?2:8):ft.test(t)?d:+t}function vs(t){return Ta(t,Ds(t))}function As(t){return null==t?"":ua(t)}var ws=Da((function(t,e){if(Lo(e)||Xi(e))Ta(e,js(e),t);else for(var n in e)Ht.call(e,n)&&nr(t,n,e[n])})),bs=Da((function(t,e){Ta(e,Ds(e),t)})),xs=Da((function(t,e,n,r){Ta(e,Ds(e),t,r)})),Ps=Da((function(t,e,n,r){Ta(e,js(e),t,r)})),Es=ro(sr),Ls=Kr((function(e,n){e=zt(e);var r=-1,a=n.length,o=a>2?n[2]:t;for(o&&bo(n[0],n[1],o)&&(a=1);++r1),e})),Ta(t,oo(t),n),r&&(n=cr(n,7,eo));for(var a=e.length;a--;)fa(n,e[a]);return n})),Rs=ro((function(t,e){return null==t?{}:function(t,e){return Wr(t,e,(function(e,n){return Ns(t,n)}))}(t,e)}));function Is(t,e){if(null==t)return{};var n=je(oo(t),(function(t){return[t]}));return e=co(e),Wr(t,n,(function(t,n){return e(t,n[0])}))}var Gs=Ka(js),Ss=Ka(Ds);function Qs(t){return null==t?[]:Ke(t,js(t))}var Us=Ra((function(t,e,n){return e=e.toLowerCase(),t+(n?Vs(e):e)}));function Vs(t){return Ks(As(t).toLowerCase())}function Zs(t){return(t=As(t))&&t.replace(mt,en).replace(qt,"")}var _s=Ra((function(t,e,n){return t+(n?"-":"")+e.toLowerCase()})),Ws=Ra((function(t,e,n){return t+(n?" ":"")+e.toLowerCase()})),Xs=Ha("toLowerCase"),Ys=Ra((function(t,e,n){return t+(n?"_":"")+e.toLowerCase()})),Fs=Ra((function(t,e,n){return t+(n?" ":"")+Ks(e)})),Js=Ra((function(t,e,n){return t+(n?" ":"")+e.toUpperCase()})),Ks=Ha("toUpperCase");function qs(e,n,r){return e=As(e),(n=r?t:n)===t?function(t){return ne.test(t)}(e)?function(t){return t.match(te)||[]}(e):function(t){return t.match(st)||[]}(e):e.match(n)||[]}var $s=Kr((function(e,n){try{return Ee(e,t,n)}catch(t){return Ki(t)?t:new Et(t)}})),tl=ro((function(t,e){return Me(e,(function(e){e=Io(e),ir(t,e,ki(t[e],t))})),t}));function el(t){return function(){return t}}var nl=Sa(),rl=Sa(!0);function al(t){return t}function ol(t){return Hr("function"==typeof t?t:cr(t,1))}var il=Kr((function(t,e){return function(n){return Tr(n,t,e)}})),sl=Kr((function(t,e){return function(n){return Tr(t,n,e)}}));function ll(t,e,n){var r=js(e),a=Pr(e,r);null!=n||es(e)&&(a.length||!r.length)||(n=e,e=t,t=this,a=Pr(e,js(e)));var o=!(es(n)&&"chain"in n&&!n.chain),i=qi(t);return Me(a,(function(n){var r=e[n];t[n]=r,i&&(t.prototype[n]=function(){var e=this.__chain__;if(o||e){var n=t(this.__wrapped__);return(n.__actions__=ka(this.__actions__)).push({func:r,args:arguments,thisArg:t}),n.__chain__=e,n}return r.apply(t,De([this.value()],arguments))})})),t}function cl(){}var ul=Za(je),dl=Za(Ne),fl=Za(He);function hl(t){return xo(t)?Ze(Io(t)):function(t){return function(e){return Er(e,t)}}(t)}var gl=Wa(),pl=Wa(!0);function yl(){return[]}function ml(){return!1}var vl,Al=Va((function(t,e){return t+e}),0),wl=Fa("ceil"),bl=Va((function(t,e){return t/e}),1),xl=Fa("floor"),Pl=Va((function(t,e){return t*e}),1),El=Fa("round"),Ll=Va((function(t,e){return t-e}),0);return Qn.after=function(t,n){if("function"!=typeof n)throw new kt(e);return t=ps(t),function(){if(--t<1)return n.apply(this,arguments)}},Qn.ary=Ni,Qn.assign=ws,Qn.assignIn=bs,Qn.assignInWith=xs,Qn.assignWith=Ps,Qn.at=Es,Qn.before=Ci,Qn.bind=ki,Qn.bindAll=tl,Qn.bindKey=Ti,Qn.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return _i(t)?t:[t]},Qn.chain=hi,Qn.chunk=function(e,n,r){n=(r?bo(e,n,r):n===t)?1:An(ps(n),0);var a=null==e?0:e.length;if(!a||n<1)return[];for(var o=0,i=0,s=xt(ye(a/n));oo?0:o+r),(a=a===t||a>o?o:ps(a))<0&&(a+=o),a=r>a?0:ys(a);r>>0)?(e=As(e))&&("string"==typeof n||null!=n&&!is(n))&&!(n=ua(n))&&an(e)?xa(fn(e),0,r):e.split(n,r):[]},Qn.spread=function(t,n){if("function"!=typeof t)throw new kt(e);return n=null==n?0:An(ps(n),0),Kr((function(e){var r=e[n],a=xa(e,0,n);return r&&De(a,r),Ee(t,this,a)}))},Qn.tail=function(t){var e=null==t?0:t.length;return e?aa(t,1,e):[]},Qn.take=function(e,n,r){return e&&e.length?aa(e,0,(n=r||n===t?1:ps(n))<0?0:n):[]},Qn.takeRight=function(e,n,r){var a=null==e?0:e.length;return a?aa(e,(n=a-(n=r||n===t?1:ps(n)))<0?0:n,a):[]},Qn.takeRightWhile=function(t,e){return t&&t.length?ga(t,co(e,3),!1,!0):[]},Qn.takeWhile=function(t,e){return t&&t.length?ga(t,co(e,3)):[]},Qn.tap=function(t,e){return e(t),t},Qn.throttle=function(t,n,r){var a=!0,o=!0;if("function"!=typeof t)throw new kt(e);return es(r)&&(a="leading"in r?!!r.leading:a,o="trailing"in r?!!r.trailing:o),ji(t,n,{leading:a,maxWait:n,trailing:o})},Qn.thru=gi,Qn.toArray=hs,Qn.toPairs=Gs,Qn.toPairsIn=Ss,Qn.toPath=function(t){return _i(t)?je(t,Io):cs(t)?[t]:ka(Ro(As(t)))},Qn.toPlainObject=vs,Qn.transform=function(t,e,n){var r=_i(t),a=r||Fi(t)||us(t);if(e=co(e,4),null==n){var o=t&&t.constructor;n=a?r?new o:[]:es(t)&&qi(o)?Un(Xt(t)):{}}return(a?Me:br)(t,(function(t,r,a){return e(n,t,r,a)})),n},Qn.unary=function(t){return Ni(t,1)},Qn.union=ni,Qn.unionBy=ri,Qn.unionWith=ai,Qn.uniq=function(t){return t&&t.length?da(t):[]},Qn.uniqBy=function(t,e){return t&&t.length?da(t,co(e,2)):[]},Qn.uniqWith=function(e,n){return n="function"==typeof n?n:t,e&&e.length?da(e,t,n):[]},Qn.unset=function(t,e){return null==t||fa(t,e)},Qn.unzip=oi,Qn.unzipWith=ii,Qn.update=function(t,e,n){return null==t?t:ha(t,e,Aa(n))},Qn.updateWith=function(e,n,r,a){return a="function"==typeof a?a:t,null==e?e:ha(e,n,Aa(r),a)},Qn.values=Qs,Qn.valuesIn=function(t){return null==t?[]:Ke(t,Ds(t))},Qn.without=si,Qn.words=qs,Qn.wrap=function(t,e){return Ii(Aa(e),t)},Qn.xor=li,Qn.xorBy=ci,Qn.xorWith=ui,Qn.zip=di,Qn.zipObject=function(t,e){return ma(t||[],e||[],nr)},Qn.zipObjectDeep=function(t,e){return ma(t||[],e||[],ta)},Qn.zipWith=fi,Qn.entries=Gs,Qn.entriesIn=Ss,Qn.extend=bs,Qn.extendWith=xs,ll(Qn,Qn),Qn.add=Al,Qn.attempt=$s,Qn.camelCase=Us,Qn.capitalize=Vs,Qn.ceil=wl,Qn.clamp=function(e,n,r){return r===t&&(r=n,n=t),r!==t&&(r=(r=ms(r))==r?r:0),n!==t&&(n=(n=ms(n))==n?n:0),lr(ms(e),n,r)},Qn.clone=function(t){return cr(t,4)},Qn.cloneDeep=function(t){return cr(t,5)},Qn.cloneDeepWith=function(e,n){return cr(e,5,n="function"==typeof n?n:t)},Qn.cloneWith=function(e,n){return cr(e,4,n="function"==typeof n?n:t)},Qn.conformsTo=function(t,e){return null==e||ur(t,e,js(e))},Qn.deburr=Zs,Qn.defaultTo=function(t,e){return null==t||t!=t?e:t},Qn.divide=bl,Qn.endsWith=function(e,n,r){e=As(e),n=ua(n);var a=e.length,o=r=r===t?a:lr(ps(r),0,a);return(r-=n.length)>=0&&e.slice(r,o)==n},Qn.eq=Qi,Qn.escape=function(t){return(t=As(t))&&X.test(t)?t.replace(_,nn):t},Qn.escapeRegExp=function(t){return(t=As(t))&&et.test(t)?t.replace(tt,"\\$&"):t},Qn.every=function(e,n,r){var a=_i(e)?Ne:pr;return r&&bo(e,n,r)&&(n=t),a(e,co(n,3))},Qn.find=mi,Qn.findIndex=Zo,Qn.findKey=function(t,e){return Ie(t,co(e,3),br)},Qn.findLast=vi,Qn.findLastIndex=_o,Qn.findLastKey=function(t,e){return Ie(t,co(e,3),xr)},Qn.floor=xl,Qn.forEach=Ai,Qn.forEachRight=wi,Qn.forIn=function(t,e){return null==t?t:Ar(t,co(e,3),Ds)},Qn.forInRight=function(t,e){return null==t?t:wr(t,co(e,3),Ds)},Qn.forOwn=function(t,e){return t&&br(t,co(e,3))},Qn.forOwnRight=function(t,e){return t&&xr(t,co(e,3))},Qn.get=zs,Qn.gt=Ui,Qn.gte=Vi,Qn.has=function(t,e){return null!=t&&mo(t,e,Nr)},Qn.hasIn=Ns,Qn.head=Xo,Qn.identity=al,Qn.includes=function(t,e,n,r){t=Xi(t)?t:Qs(t),n=n&&!r?ps(n):0;var a=t.length;return n<0&&(n=An(a+n,0)),ls(t)?n<=a&&t.indexOf(e,n)>-1:!!a&&Se(t,e,n)>-1},Qn.indexOf=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var a=null==n?0:ps(n);return a<0&&(a=An(r+a,0)),Se(t,e,a)},Qn.inRange=function(e,n,r){return n=gs(n),r===t?(r=n,n=0):r=gs(r),function(t,e,n){return t>=wn(e,n)&&t=-9007199254740991&&t<=u},Qn.isSet=ss,Qn.isString=ls,Qn.isSymbol=cs,Qn.isTypedArray=us,Qn.isUndefined=function(e){return e===t},Qn.isWeakMap=function(t){return ns(t)&&yo(t)==C},Qn.isWeakSet=function(t){return ns(t)&&"[object WeakSet]"==Mr(t)},Qn.join=function(t,e){return null==t?"":mn.call(t,e)},Qn.kebabCase=_s,Qn.last=Ko,Qn.lastIndexOf=function(e,n,r){var a=null==e?0:e.length;if(!a)return-1;var o=a;return r!==t&&(o=(o=ps(r))<0?An(a+o,0):wn(o,a-1)),n==n?function(t,e,n){for(var r=n+1;r--;)if(t[r]===e)return r;return r}(e,n,o):Ge(e,Ue,o,!0)},Qn.lowerCase=Ws,Qn.lowerFirst=Xs,Qn.lt=ds,Qn.lte=fs,Qn.max=function(e){return e&&e.length?yr(e,al,zr):t},Qn.maxBy=function(e,n){return e&&e.length?yr(e,co(n,2),zr):t},Qn.mean=function(t){return Ve(t,al)},Qn.meanBy=function(t,e){return Ve(t,co(e,2))},Qn.min=function(e){return e&&e.length?yr(e,al,Gr):t},Qn.minBy=function(e,n){return e&&e.length?yr(e,co(n,2),Gr):t},Qn.stubArray=yl,Qn.stubFalse=ml,Qn.stubObject=function(){return{}},Qn.stubString=function(){return""},Qn.stubTrue=function(){return!0},Qn.multiply=Pl,Qn.nth=function(e,n){return e&&e.length?Zr(e,ps(n)):t},Qn.noConflict=function(){return fe._===this&&(fe._=Qt),this},Qn.noop=cl,Qn.now=zi,Qn.pad=function(t,e,n){t=As(t);var r=(e=ps(e))?dn(t):0;if(!e||r>=e)return t;var a=(e-r)/2;return _a(me(a),n)+t+_a(ye(a),n)},Qn.padEnd=function(t,e,n){t=As(t);var r=(e=ps(e))?dn(t):0;return e&&rn){var a=e;e=n,n=a}if(r||e%1||n%1){var o=Pn();return wn(e+o*(n-e+le("1e-"+((o+"").length-1))),n)}return Fr(e,n)},Qn.reduce=function(t,e,n){var r=_i(t)?Oe:We,a=arguments.length<3;return r(t,co(e,4),n,a,hr)},Qn.reduceRight=function(t,e,n){var r=_i(t)?Be:We,a=arguments.length<3;return r(t,co(e,4),n,a,gr)},Qn.repeat=function(e,n,r){return n=(r?bo(e,n,r):n===t)?1:ps(n),Jr(As(e),n)},Qn.replace=function(){var t=arguments,e=As(t[0]);return t.length<3?e:e.replace(t[1],t[2])},Qn.result=function(e,n,r){var a=-1,o=(n=wa(n,e)).length;for(o||(o=1,e=t);++au)return[];var n=f,r=wn(t,f);e=co(e),t-=f;for(var a=Ye(r,e);++n=i)return e;var l=r-dn(a);if(l<1)return a;var c=s?xa(s,0,l).join(""):e.slice(0,l);if(o===t)return c+a;if(s&&(l+=c.length-l),is(o)){if(e.slice(l).search(o)){var u,d=c;for(o.global||(o=Nt(o.source,As(dt.exec(o))+"g")),o.lastIndex=0;u=o.exec(d);)var f=u.index;c=c.slice(0,f===t?l:f)}}else if(e.indexOf(ua(o),l)!=l){var h=c.lastIndexOf(o);h>-1&&(c=c.slice(0,h))}return c+a},Qn.unescape=function(t){return(t=As(t))&&W.test(t)?t.replace(Z,gn):t},Qn.uniqueId=function(t){var e=++Rt;return As(t)+e},Qn.upperCase=Js,Qn.upperFirst=Ks,Qn.each=Ai,Qn.eachRight=wi,Qn.first=Xo,ll(Qn,(vl={},br(Qn,(function(t,e){Ht.call(Qn.prototype,e)||(vl[e]=t)})),vl),{chain:!1}),Qn.VERSION="4.17.21",Me(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){Qn[t].placeholder=Qn})),Me(["drop","take"],(function(e,n){_n.prototype[e]=function(r){r=r===t?1:An(ps(r),0);var a=this.__filtered__&&!n?new _n(this):this.clone();return a.__filtered__?a.__takeCount__=wn(r,a.__takeCount__):a.__views__.push({size:wn(r,f),type:e+(a.__dir__<0?"Right":"")}),a},_n.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),Me(["filter","map","takeWhile"],(function(t,e){var n=e+1,r=1==n||3==n;_n.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:co(t,3),type:n}),e.__filtered__=e.__filtered__||r,e}})),Me(["head","last"],(function(t,e){var n="take"+(e?"Right":"");_n.prototype[t]=function(){return this[n](1).value()[0]}})),Me(["initial","tail"],(function(t,e){var n="drop"+(e?"":"Right");_n.prototype[t]=function(){return this.__filtered__?new _n(this):this[n](1)}})),_n.prototype.compact=function(){return this.filter(al)},_n.prototype.find=function(t){return this.filter(t).head()},_n.prototype.findLast=function(t){return this.reverse().find(t)},_n.prototype.invokeMap=Kr((function(t,e){return"function"==typeof t?new _n(this):this.map((function(n){return Tr(n,t,e)}))})),_n.prototype.reject=function(t){return this.filter(Hi(co(t)))},_n.prototype.slice=function(e,n){e=ps(e);var r=this;return r.__filtered__&&(e>0||n<0)?new _n(r):(e<0?r=r.takeRight(-e):e&&(r=r.drop(e)),n!==t&&(r=(n=ps(n))<0?r.dropRight(-n):r.take(n-e)),r)},_n.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},_n.prototype.toArray=function(){return this.take(f)},br(_n.prototype,(function(e,n){var r=/^(?:filter|find|map|reject)|While$/.test(n),a=/^(?:head|last)$/.test(n),o=Qn[a?"take"+("last"==n?"Right":""):n],i=a||/^find/.test(n);o&&(Qn.prototype[n]=function(){var n=this.__wrapped__,s=a?[1]:arguments,l=n instanceof _n,c=s[0],u=l||_i(n),d=function(t){var e=o.apply(Qn,De([t],s));return a&&f?e[0]:e};u&&r&&"function"==typeof c&&1!=c.length&&(l=u=!1);var f=this.__chain__,h=!!this.__actions__.length,g=i&&!f,p=l&&!h;if(!i&&u){n=p?n:new _n(this);var y=e.apply(n,s);return y.__actions__.push({func:gi,args:[d],thisArg:t}),new Zn(y,f)}return g&&p?e.apply(this,s):(y=this.thru(d),g?a?y.value()[0]:y.value():y)})})),Me(["pop","push","shift","sort","splice","unshift"],(function(t){var e=Tt[t],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",r=/^(?:pop|shift)$/.test(t);Qn.prototype[t]=function(){var t=arguments;if(r&&!this.__chain__){var a=this.value();return e.apply(_i(a)?a:[],t)}return this[n]((function(n){return e.apply(_i(n)?n:[],t)}))}})),br(_n.prototype,(function(t,e){var n=Qn[e];if(n){var r=n.name+"";Ht.call(jn,r)||(jn[r]=[]),jn[r].push({name:e,func:n})}})),jn[Qa(t,2).name]=[{name:"wrapper",func:t}],_n.prototype.clone=function(){var t=new _n(this.__wrapped__);return t.__actions__=ka(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=ka(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=ka(this.__views__),t},_n.prototype.reverse=function(){if(this.__filtered__){var t=new _n(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},_n.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,n=_i(t),r=e<0,a=n?t.length:0,o=function(t,e,n){for(var r=-1,a=n.length;++r=this.__values__.length;return{done:e,value:e?t:this.__values__[this.__index__++]}},Qn.prototype.plant=function(e){for(var n,r=this;r instanceof Vn;){var a=So(r);a.__index__=0,a.__values__=t,n?o.__wrapped__=a:n=a;var o=a;r=r.__wrapped__}return o.__wrapped__=e,n},Qn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof _n){var n=e;return this.__actions__.length&&(n=new _n(this)),(n=n.reverse()).__actions__.push({func:gi,args:[ei],thisArg:t}),new Zn(n,this.__chain__)}return this.thru(ei)},Qn.prototype.toJSON=Qn.prototype.valueOf=Qn.prototype.value=function(){return pa(this.__wrapped__,this.__actions__)},Qn.prototype.first=Qn.prototype.head,ee&&(Qn.prototype[ee]=function(){return this}),Qn}();ge?((ge.exports=pn)._=pn,he._=pn):fe._=pn}.call(St);var $r,ta,ea=qr.exports;let na=class extends it{constructor(){super(...arguments),this._computeLabelCallback=t=>Et("config.".concat(t.name))??t.name}setConfig(t){this._config={...this._config,...t}}render(){return this._config&&this.hass?U(ta||(ta=ht(["\n\t\t\t\n\t\t"])),this.hass,this._config,this._computeLabelCallback.bind(this),[{type:"expandable",title:this._title("title"),schema:[{type:"grid",schema:[{name:"title",selector:{text:{}}},{name:"title_colour",selector:{color_rgb:{}}},{name:"title_size",selector:{text:{}}}]}]},{type:"expandable",title:this._title("general"),schema:[{type:"grid",schema:[{name:"large_font",selector:{boolean:{}}},{name:"panel_mode",selector:{boolean:{}}},{name:"card_height",selector:{text:{}}},{name:"card_width",selector:{text:{}}},{name:"show_solar",selector:{boolean:{}}},{name:"show_battery",selector:{boolean:{}}},{name:"show_grid",selector:{boolean:{}}},{name:"dynamic_line_width",selector:{boolean:{}}},{name:"max_line_width",selector:{number:{}}},{name:"min_line_width",selector:{number:{}}},{name:"decimal_places",selector:{number:{}}},{name:"decimal_places_energy",selector:{number:{}}}]}]},{type:"expandable",title:this._title("inverter"),schema:[{name:"inverter",type:"grid",schema:[{name:"three_phase",selector:{boolean:{}}},{name:"auto_scale",selector:{boolean:{}}},{name:"model",selector:{select:{options:Object.values(yt).map((t=>({label:ea.capitalize(t),value:t})))}}},{name:"modern",selector:{boolean:{}}},{name:"autarky",selector:{select:{options:Object.values(mt).map((t=>({label:ea.capitalize(t),value:t})))}}},{name:"colour",selector:{color_rgb:{}}}]}]},{type:"expandable",title:this._title("solar"),schema:[{name:"solar",type:"grid",schema:[{name:"mppts",selector:{number:{min:1,max:5}}},{name:"auto_scale",selector:{boolean:{}}},{name:"pv1_name",selector:{text:{}}},{name:"pv2_name",selector:{text:{}}},{name:"pv3_name",selector:{text:{}}},{name:"pv4_name",selector:{text:{}}},{name:"pv5_name",selector:{text:{}}},{name:"colour",selector:{color_rgb:{}}},{name:"dynamic_colour",selector:{boolean:{}}},{name:"animation_speed",selector:{number:{}}},{name:"off_threshold",selector:{number:{}}},{name:"visualize_efficiency",selector:{boolean:{}}},{name:"show_mppt_efficiency",selector:{boolean:{}}},{name:"show_mppt_production",selector:{boolean:{}}}]},{type:"expandable",title:this._title("max_power"),schema:[{name:"solar",type:"grid",schema:[{name:"max_power",selector:{entity:{}}},{name:"pv1_max_power",selector:{entity:{}}},{name:"pv2_max_power",selector:{entity:{}}},{name:"pv3_max_power",selector:{entity:{}}},{name:"pv4_max_power",selector:{entity:{}}},{name:"pv5_max_power",selector:{entity:{}}}]}]}]},{type:"expandable",title:this._title("battery"),schema:[{name:"battery",type:"grid",schema:[{name:"energy",selector:{number:{min:0}}},{name:"shutdown_soc",selector:{number:{mode:"box",min:0,max:100}}},{name:"shutdown_soc_offgrid",selector:{number:{mode:"box",min:0,max:100}}},{name:"show_daily",selector:{boolean:{}}},{name:"auto_scale",selector:{boolean:{}}},{name:"invert_power",selector:{boolean:{}}},{name:"show_absolute",selector:{boolean:{}}},{name:"colour",selector:{color_rgb:{}}},{name:"charge_colour",selector:{color_rgb:{}}},{name:"dynamic_colour",selector:{boolean:{}}},{name:"linear_gradient",selector:{boolean:{}}},{name:"animate",selector:{boolean:{}}},{name:"animation_speed",selector:{number:{}}},{name:"hide_soc",selector:{boolean:{}}},{name:"show_remaining_energy",selector:{boolean:{}}},{name:"max_power",selector:{number:{}}},{name:"path_threshold",selector:{number:{}}}]},{type:"expandable",title:this._title("sensor"),schema:[{name:"battery",type:"grid",schema:[{name:"energy",selector:{entity:{}}},{name:"shutdown_soc",selector:{entity:{}}},{name:"shutdown_soc_offgrid",selector:{entity:{}}},{name:"max_power",selector:{entity:{}}}]}]}]},{type:"expandable",title:this._title("load"),schema:[{name:"load",type:"grid",schema:[{name:"show_daily",selector:{boolean:{}}},{name:"auto_scale",selector:{boolean:{}}},{name:"colour",selector:{color_rgb:{}}},{name:"dynamic_colour",selector:{boolean:{}}},{name:"dynamic_icon",selector:{boolean:{}}},{name:"invert_load",selector:{boolean:{}}},{name:"essential_name",selector:{text:{}}},{name:"additional_loads",selector:{number:{mode:"box",min:0,max:8}}},{name:"animation_speed",selector:{number:{}}},{name:"max_power",selector:{number:{}}},{name:"off_threshold",selector:{number:{}}},{name:"path_threshold",selector:{number:{}}}]},{type:"expandable",title:this._title("additional_load"),schema:[{name:"load",type:"grid",schema:[{name:"load1_name",selector:{text:{}}},{name:"load1_icon",selector:{icon:{}}},{name:"load2_name",selector:{text:{}}},{name:"load2_icon",selector:{icon:{}}},{name:"load3_name",selector:{text:{}}},{name:"load3_icon",selector:{icon:{}}},{name:"load4_name",selector:{text:{}}},{name:"load4_icon",selector:{icon:{}}},{name:"load5_name",selector:{text:{}}},{name:"load5_icon",selector:{icon:{}}},{name:"load6_name",selector:{text:{}}},{name:"load6_icon",selector:{icon:{}}},{name:"load7_name",selector:{text:{}}},{name:"load7_icon",selector:{icon:{}}},{name:"load8_name",selector:{text:{}}},{name:"load8_icon",selector:{icon:{}}}]}]},{type:"expandable",title:this._title("aux_load"),schema:[{name:"load",type:"grid",schema:[{name:"show_aux",selector:{boolean:{}}},{name:"aux_name",selector:{text:{}}},{name:"aux_daily_name",selector:{text:{}}},{name:"aux_type",selector:{icon:{}}},{name:"invert_aux",selector:{boolean:{}}},{name:"show_absolute_aux",selector:{boolean:{}}},{name:"aux_dynamic_colour",selector:{boolean:{}}},{name:"aux_colour",selector:{color_rgb:{}}},{name:"aux_off_colour",selector:{color_rgb:{}}},{name:"aux_loads",selector:{number:{mode:"box",min:0,max:2}}},{name:"aux_load1_name",selector:{text:{}}},{name:"aux_load1_icon",selector:{icon:{}}},{name:"aux_load2_name",selector:{text:{}}},{name:"aux_load2_icon",selector:{icon:{}}},{name:"show_daily_aux",selector:{boolean:{}}}]}]}]},{type:"expandable",title:this._title("grid"),schema:[{name:"grid",type:"grid",schema:[{name:"grid_name",selector:{text:{}}},{name:"max_power",selector:{number:{}}},{name:"show_daily_buy",selector:{boolean:{}}},{name:"label_daily_grid_buy",selector:{text:{}}},{name:"show_daily_sell",selector:{boolean:{}}},{name:"label_daily_grid_sell",selector:{text:{}}},{name:"auto_scale",selector:{boolean:{}}},{name:"invert_grid",selector:{boolean:{}}},{name:"show_absolute",selector:{boolean:{}}},{name:"colour",selector:{color_rgb:{}}},{name:"no_grid_colour",selector:{color_rgb:{}}},{name:"export_colour",selector:{color_rgb:{}}},{name:"grid_off_colour",selector:{color_rgb:{}}},{name:"energy_cost_decimals",selector:{number:{mode:"box",min:0,max:3}}},{name:"animation_speed",selector:{number:{}}},{name:"off_threshold",selector:{number:{}}},{name:"import_icon",selector:{icon:{}}},{name:"export_icon",selector:{icon:{}}},{name:"disconnected_icon",selector:{icon:{}}},{name:"prepaid_unit_name",selector:{text:{}}},{name:"show_nonessential",selector:{boolean:{}}},{name:"additional_loads",selector:{number:{mode:"box",min:0,max:3}}},{name:"nonessential_name",selector:{text:{}}},{name:"nonessential_icon",selector:{icon:{}}},{name:"load1_name",selector:{text:{}}},{name:"load1_icon",selector:{icon:{}}},{name:"load2_name",selector:{text:{}}},{name:"load2_icon",selector:{icon:{}}},{name:"load3_name",selector:{text:{}}},{name:"load3_icon",selector:{icon:{}}}]}]},{type:"expandable",title:this._title("entities"),schema:[{type:"expandable",title:this._title("sol"),schema:[{name:"entities",type:"grid",schema:[{name:"pv_total",selector:{entity:{device_class:Ot.POWER}}},{name:"day_pv_energy_108",selector:{entity:{device_class:Ot.ENERGY}}},{name:"monthly_pv_generation",selector:{entity:{device_class:Ot.ENERGY}}},{name:"yearly_pv_generation",selector:{entity:{device_class:Ot.ENERGY}}},{name:"total_pv_generation",selector:{entity:{device_class:Ot.ENERGY}}},{name:"remaining_solar",selector:{entity:{device_class:Ot.ENERGY}}},{name:"pv1_power_186",selector:{entity:{device_class:Ot.POWER}}},{name:"pv1_production",selector:{entity:{device_class:Ot.ENERGY}}},{name:"pv1_voltage_109",selector:{entity:{device_class:Ot.VOLTAGE}}},{name:"pv1_current_110",selector:{entity:{device_class:Ot.CURRENT}}},{name:"pv2_power_187",selector:{entity:{device_class:Ot.POWER}}},{name:"pv2_production",selector:{entity:{device_class:Ot.ENERGY}}},{name:"pv2_voltage_111",selector:{entity:{device_class:Ot.VOLTAGE}}},{name:"pv2_current_112",selector:{entity:{device_class:Ot.CURRENT}}},{name:"pv3_power_188",selector:{entity:{device_class:Ot.POWER}}},{name:"pv3_production",selector:{entity:{device_class:Ot.ENERGY}}},{name:"pv3_voltage_113",selector:{entity:{device_class:Ot.VOLTAGE}}},{name:"pv3_current_114",selector:{entity:{device_class:Ot.CURRENT}}},{name:"pv4_power_189",selector:{entity:{device_class:Ot.POWER}}},{name:"pv4_production",selector:{entity:{device_class:Ot.ENERGY}}},{name:"pv4_voltage_115",selector:{entity:{device_class:Ot.VOLTAGE}}},{name:"pv4_current_116",selector:{entity:{device_class:Ot.CURRENT}}},{name:"pv5_power",selector:{entity:{device_class:Ot.POWER}}},{name:"pv5_production",selector:{entity:{device_class:Ot.ENERGY}}},{name:"pv5_voltage",selector:{entity:{device_class:Ot.VOLTAGE}}},{name:"pv5_current",selector:{entity:{device_class:Ot.CURRENT}}},{name:"solar_sell_247",selector:{entity:{}}},{name:"environment_temp",selector:{entity:{device_class:Ot.TEMPERATURE}}}]}]},{type:"expandable",title:this._title("bat"),schema:[{name:"entities",type:"grid",schema:[{name:"battery_power_190",selector:{entity:{device_class:Ot.POWER}}},{name:"battery_current_191",selector:{entity:{device_class:Ot.CURRENT}}},{name:"battery_temp_182",selector:{entity:{device_class:Ot.TEMPERATURE}}},{name:"battery_voltage_183",selector:{entity:{device_class:Ot.VOLTAGE}}},{name:"battery_soc_184",selector:{entity:{device_class:Ot.BATTERY}}},{name:"day_battery_charge_70",selector:{entity:{device_class:Ot.ENERGY}}},{name:"day_battery_discharge_71",selector:{entity:{device_class:Ot.ENERGY}}},{name:"battery_rated_capacity",selector:{entity:{}}},{name:"battery_soh",selector:{entity:{}}},{name:"battery_current_direction",selector:{entity:{}}},{name:"battery_status",selector:{entity:{}}}]}]},{type:"expandable",title:this._title("inv"),schema:[{name:"entities",type:"grid",schema:[{name:"inverter_status_59",selector:{entity:{}}},{name:"use_timer_248",selector:{entity:{}}},{name:"priority_load_243",selector:{entity:{}}},{name:"inverter_voltage_154",selector:{entity:{device_class:Ot.VOLTAGE}}},{name:"inverter_voltage_L2",selector:{entity:{device_class:Ot.VOLTAGE}}},{name:"inverter_voltage_L3",selector:{entity:{device_class:Ot.VOLTAGE}}},{name:"load_frequency_192",selector:{entity:{device_class:Ot.FREQUENCY}}},{name:"inverter_current_164",selector:{entity:{device_class:Ot.CURRENT}}},{name:"inverter_current_L2",selector:{entity:{device_class:Ot.CURRENT}}},{name:"inverter_current_L3",selector:{entity:{device_class:Ot.CURRENT}}},{name:"inverter_power_175",selector:{entity:{device_class:Ot.POWER}}},{name:"grid_power_169",selector:{entity:{device_class:Ot.POWER}}},{name:"dc_transformer_temp_90",selector:{entity:{device_class:Ot.TEMPERATURE}}},{name:"radiator_temp_91",selector:{entity:{device_class:Ot.TEMPERATURE}}},{name:"prog1_time",selector:{entity:{}}},{name:"prog1_capacity",selector:{entity:{}}},{name:"prog1_charge",selector:{entity:{}}},{name:"prog2_time",selector:{entity:{}}},{name:"prog2_capacity",selector:{entity:{}}},{name:"prog2_charge",selector:{entity:{}}},{name:"prog3_time",selector:{entity:{}}},{name:"prog3_capacity",selector:{entity:{}}},{name:"prog3_charge",selector:{entity:{}}},{name:"prog4_time",selector:{entity:{}}},{name:"prog4_capacity",selector:{entity:{}}},{name:"prog4_charge",selector:{entity:{}}},{name:"prog5_time",selector:{entity:{}}},{name:"prog5_capacity",selector:{entity:{}}},{name:"prog5_charge",selector:{entity:{}}},{name:"prog6_time",selector:{entity:{}}},{name:"prog6_capacity",selector:{entity:{}}},{name:"prog6_charge",selector:{entity:{}}}]}]},{type:"expandable",title:this._title("ld"),schema:[{name:"entities",type:"grid",schema:[{name:"day_load_energy_84",selector:{entity:{device_class:Ot.ENERGY}}},{name:"day_aux_energy",selector:{entity:{device_class:Ot.ENERGY}}},{name:"essential_power",selector:{entity:{device_class:Ot.POWER}}},{name:"essential_load1",selector:{entity:{device_class:Ot.POWER}}},{name:"essential_load1_extra",selector:{entity:{}}},{name:"essential_load1_toggle",selector:{entity:{}}},{name:"essential_load2",selector:{entity:{device_class:Ot.POWER}}},{name:"essential_load2_extra",selector:{entity:{}}},{name:"essential_load2_toggle",selector:{entity:{}}},{name:"essential_load3",selector:{entity:{device_class:Ot.POWER}}},{name:"essential_load3_extra",selector:{entity:{}}},{name:"essential_load3_toggle",selector:{entity:{}}},{name:"essential_load4",selector:{entity:{device_class:Ot.POWER}}},{name:"essential_load4_extra",selector:{entity:{}}},{name:"essential_load4_toggle",selector:{entity:{}}},{name:"essential_load5",selector:{entity:{device_class:Ot.POWER}}},{name:"essential_load5_extra",selector:{entity:{}}},{name:"essential_load5_toggle",selector:{entity:{}}},{name:"essential_load6",selector:{entity:{device_class:Ot.POWER}}},{name:"essential_load6_extra",selector:{entity:{}}},{name:"essential_load6_toggle",selector:{entity:{}}},{name:"essential_load7",selector:{entity:{device_class:Ot.POWER}}},{name:"essential_load7_extra",selector:{entity:{}}},{name:"essential_load7_toggle",selector:{entity:{}}},{name:"essential_load8",selector:{entity:{device_class:Ot.POWER}}},{name:"essential_load8_extra",selector:{entity:{}}},{name:"essential_load8_toggle",selector:{entity:{}}},{name:"load_power_L1",selector:{entity:{device_class:Ot.POWER}}},{name:"load_power_L2",selector:{entity:{device_class:Ot.POWER}}},{name:"load_power_L3",selector:{entity:{device_class:Ot.POWER}}},{name:"aux_power_166",selector:{entity:{device_class:Ot.POWER}}},{name:"aux_load1",selector:{entity:{device_class:Ot.POWER}}},{name:"aux_load2",selector:{entity:{device_class:Ot.POWER}}},{name:"aux_load1_extra",selector:{entity:{}}},{name:"aux_load2_extra",selector:{entity:{}}},{name:"aux_connected_status",selector:{entity:{}}}]}]},{type:"expandable",title:this._title("gri"),schema:[{name:"entities",type:"grid",schema:[{name:"day_grid_import_76",selector:{entity:{device_class:Ot.ENERGY}}},{name:"day_grid_export_77",selector:{entity:{device_class:Ot.ENERGY}}},{name:"grid_ct_power_172",selector:{entity:{device_class:Ot.POWER}}},{name:"grid_ct_power_L2",selector:{entity:{device_class:Ot.POWER}}},{name:"grid_ct_power_L3",selector:{entity:{device_class:Ot.POWER}}},{name:"grid_ct_power_total",selector:{entity:{device_class:Ot.POWER}}},{name:"grid_voltage",selector:{entity:{device_class:Ot.VOLTAGE}}},{name:"nonessential_power",selector:{entity:{device_class:Ot.POWER}}},{name:"non_essential_load1",selector:{entity:{device_class:Ot.POWER}}},{name:"non_essential_load2",selector:{entity:{device_class:Ot.POWER}}},{name:"non_essential_load3",selector:{entity:{device_class:Ot.POWER}}},{name:"non_essential_load1_extra",selector:{entity:{}}},{name:"non_essential_load2_extra",selector:{entity:{}}},{name:"grid_connected_status_194",selector:{entity:{}}},{name:"energy_cost_buy",selector:{entity:{}}},{name:"energy_cost_sell",selector:{entity:{}}},{name:"prepaid_units",selector:{entity:{}}},{name:"max_sell_power",selector:{entity:{device_class:Ot.POWER}}}]}]}]}],this._valueChanged.bind(this)):U($r||($r=ht([""])))}_title(t){return Et("config.cat_title.".concat(t))??t}_valueChanged(t){!function(t,e,n,r){r=r||{},n=null==n?{}:n;var a=new Event(e,{bubbles:void 0===r.bubbles||r.bubbles,cancelable:Boolean(r.cancelable),composed:void 0===r.composed||r.composed});a.detail=n,t.dispatchEvent(a)}(this,"config-changed",{config:t.detail.value})}};t([dt()],na.prototype,"hass",void 0),t([dt()],na.prototype,"_config",void 0),t([dt()],na.prototype,"lovelace",void 0),na=t([lt(Dt)],na);var ra=Object.freeze({__proto__:null,get SunSynkCardEditor(){return na}});export{Xr as SunsynkPowerFlowCard}; diff --git a/docs/configuration.md b/docs/configuration.md index a805a32..38b4ebd 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -7,19 +7,19 @@ myst: The card can be configured through the following attributes: -| Attribute | Requirement | Default | Description | -|------------------------|--------------|-----------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| type: | **Required** | `custom:mlk-power-flow-card` | The custom card | -| title: | Optional | See optional [Title](#title) attributes below | List of title attributes. | -| general: | Optional | See optional [General](#general) attributes below | List of general attributes. | -| inverter: | Optional | See optional [Inverter](#inverter) attributes below | List of inverter attributes. | -| solar: | Optional | See optional [Solar](#solar) attributes below | List of solar attributes. | -| battery: | Optional | See required [Battery](#battery) attributes below | List of battery attributes. Required if `show_battery: true` | -| load: | Optional | See optional [Load](#load) attributes below | List of load attributes. | -| grid: | Optional | See optional [Grid](#grid) attributes below | List of grid attributes. | -| entities: | **Required** | See required [Entities](#entities) attributes below | List of sensor entities. | - -### Title +| Attribute | Requirement | Default | Description | +|-----------|--------------|-----------------------------------------------------|--------------------------------------------------------------| +| type: | **Required** | `custom:mlk-power-flow-card` | The custom card | +| title: | Optional | See optional [Title](#title) attributes below | List of title attributes. | +| general: | Optional | See optional [General](#general) attributes below | List of general attributes. | +| inverter: | Optional | See optional [Inverter](#inverter) attributes below | List of inverter attributes. | +| solar: | Optional | See optional [Solar](#solar) attributes below | List of solar attributes. Required if `show_solar: true` | +| battery: | Optional | See required [Battery](#battery) attributes below | List of battery attributes. Required if `show_battery: true` | +| load: | Optional | See optional [Load](#load) attributes below | List of load attributes. | +| grid: | Optional | See optional [Grid](#grid) attributes below | List of grid attributes. Required if `show_grid: true` | +| entities: | **Required** | See required [Entities](#entities) attributes below | List of sensor entities. | + +## Title | Attribute | Requirement | Default | Description | |---------------|-------------|---------|-----------------------------------------------------------------| @@ -27,24 +27,24 @@ The card can be configured through the following attributes: | title_colour: | Optional | | Sets the colour of the card title. (`red`, `green`, `blue` etc) | | title_size: | Optional | `32px` | Set the font size for the card title i.e. `16px`, `24px` | -### General - -| Attribute | Requirement | Default | Description | -|------------------------|-------------|----------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| large_font: | Optional | `false` | Increases font size of sensor data | -| panel_mode: | Optional | `false` | Toggles panel mode setting card height to `100%`. For use with Panel(1 card) view types or grid layouts | -| card_height: | Optional | `396px` | Only used when `panel_mode: false`. Sets the card height in pixels. Specify the value i.e. `400px` or provide a sensor i.e. `input.number_height` | -| card_width: | Optional | `100%` | Only used when `panel_mode: true`. Sets the card width in pixels or percentage. Specify the value i.e. `400px`, `80%` or provide a sensor i.e. `input.number_width`. For adjustments when using the Panel(1 card) view types or grid layouts | -| show_solar: | Optional | `true` | Toggle display of solar information | -| show_battery: | Optional | `true` | Toggle display of battery information | -| show_grid: | Optional | `true` | Toggle display of grid information | -| dynamic_line_width: | Optional | `false` | Adjusts the width of the lines and animated dot based on the ratio of current power to `max_power` (defined in each section below). Requires `max_power` to be explicitly defined | -| max_line_width: | Optional | `4` | Sets the maximum line width when `dynamic_line_width: true`. If you prefer thick lines set a larger value. Reduce this value for a more subtle scaling affect. Values greater the `8` are ignored | -| min_line_width: | Optional | `1` | Sets the minimum or default line width on the card. Values greater the `8` are ignored | -| decimal_places: | Optional | `2` | Sets the number of decimal places to display when using the `auto_scale` option. | -| decimal_places_energy: | Optional | `1` | Sets the number of decimal places to display for the daily energy values. | - -### Inverter +## General + +| Attribute | Requirement | Default | Description | +|------------------------|-------------|---------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| large_font: | Optional | `false` | Increases font size of sensor data | +| panel_mode: | Optional | `false` | Toggles panel mode setting card height to `100%`. For use with Panel(1 card) view types or grid layouts | +| card_height: | Optional | `396px` | Only used when `panel_mode: false`. Sets the card height in pixels. Specify the value i.e. `400px` or provide a sensor i.e. `input.number_height` | +| card_width: | Optional | `100%` | Only used when `panel_mode: true`. Sets the card width in pixels or percentage. Specify the value i.e. `400px`, `80%` or provide a sensor i.e. `input.number_width`. For adjustments when using the Panel(1 card) view types or grid layouts | +| show_solar: | Optional | `true` | Toggle display of solar information | +| show_battery: | Optional | `true` | Toggle display of battery information | +| show_grid: | Optional | `true` | Toggle display of grid information | +| dynamic_line_width: | Optional | `false` | Adjusts the width of the lines and animated dot based on the ratio of current power to `max_power` (defined in each section below). Requires `max_power` to be explicitly defined | +| max_line_width: | Optional | `4` | Sets the maximum line width when `dynamic_line_width: true`. If you prefer thick lines set a larger value. Reduce this value for a more subtle scaling affect. Values greater the `8` are ignored | +| min_line_width: | Optional | `1` | Sets the minimum or default line width on the card. Values greater the `8` are ignored | +| decimal_places: | Optional | `2` | Sets the number of decimal places to display when using the `auto_scale` option. | +| decimal_places_energy: | Optional | `1` | Sets the number of decimal places to display for the daily energy values. | + +## Inverter | Attribute | Requirement | Default | Description | |--------------|-------------|-----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| @@ -55,60 +55,64 @@ The card can be configured through the following attributes: | autarky: | Optional | `power` | Display autarky and ratio as a percentage using either realtime power or daily energy values. Set to `no` to hide (`energy/power/Auto$Self/no`).
Autarky is the percentage of self sufficiency through Home Production. Ratio is the percentage of produced electricity used by the home.
It is calculated based on the formula below and borrowed from the [Power Distribution Card](https://github.com/JonahKr/power-distribution-card)
  • Autarky in Percent = Home Production / Home Consumption
  • Ratio in Percent = Home Consumption / Home Production
Home Production = Solar + Battery (discharge) + Aux (in), Home Consumption = Essential power + Nonessential power + Aux (out) + Battery (charge)
Auto&Self mode represents Auto consumption & Self usage. Auto consumption is similar to Power Ratio, Self consumption is ratio between produced energy to all energy (produced energy + imported energy) | | colour: | Optional | `grey` | Sets the colour of the inverter and data. Hex codes (`'#66ff00'` etc) or names (`red`, `green`, `blue` etc) | -### Solar +## Solar These attributes are only needed if `show_solar` is set to `true` -| Attribute | Requirement | Default | Description | -|-------------------------|--------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| mppts: | **Required** | `2` | Specify the number of MPPT's in use `1`, `2`, `3`, `4` or `5` | -| auto_scale: | Optional | `true` | If set to `true` the card will use the entities `unit_of_measurement` attribute to perform the correct scaling (i,e, power values greater than 999W will be displayed as kW e.g. 1.23kW) and display the correct unit. The number of decimal places can be changed using the `decimal_places` card attribute apart from the daily energy values which are set using the `decimal_places_energy` attribute | -| pv1_name: | Optional | `PV1` | Set the disaply name for MPPT1 | -| pv2_name: | Optional | `PV2` | Set the disaply name for MPPT2 | -| pv3_name: | Optional | `PV3` | Set the disaply name for MPPT3 | -| pv4_name: | Optional | `PV4` | Set the disaply name for MPPT4 | -| pv5_name: | Optional | `PV5` | Set the disaply name for MPPT4 | -| colour: | Optional | `orange` | Sets the colour of all the solar card objects. Hex codes (`'#66ff00'` etc) or names (`red`, `green`, `blue` etc) | -| dynamic_colour: | Optional | `true` | The solar elements on the card will be greyed out if total solar power < 10W. | -| animation_speed: | Optional | `9` | Set slowest animation speed in seconds, depending on Power produced | -| off_threshold: | Optional | `10` | When total PV power falls belows this threshold colour will change to grey. Requires `dynamic_colour` to be enabled | -| visualize_efficiency: | Optional | `true` | `false` - Disabled, `true` - Graphic display of Efficiency | -| show_mppt_production: | Optional | `true` | Show each MPPT energy production | -| show_mppt_efficiency: | Optional | `false` | Show % of each MPPT efficiency | -| max_power: | Optional | `8000` | Maximum power draw to calculate animation speed. This value is also used to calculate the solar efficiency for the total PV power and should equal the total size of your PV array. Numeric value or sensor. | -| pv1_max_power: | Optional | | Maximum power of MPPT1 based on the number and size of panels. Used to calculate solar efficiency of the string (W). Numeric value or sensor. | -| pv2_max_power: | Optional | | Maximum power of MPPT2 based on the number and size of panels. Used to calculate solar efficiency of the string (W). Numeric value or sensor. | -| pv3_max_power: | Optional | | Maximum power of MPPT3 based on the number and size of panels. Used to calculate solar efficiency of the string (W). Numeric value or sensor. | -| pv4_max_power: | Optional | | Maximum power of MPPT4 based on the number and size of panels. Used to calculate solar efficiency of the string (W). Numeric value or sensor | -| pv5_max_power: | Optional | | Maximum power of MPPT4 based on the number and size of panels. Used to calculate solar efficiency of the string (W). Numeric value or sensor | - -### Battery +| Attribute | Requirement | Default | Description | +|-----------------------|--------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| mppts: | **Required** | `2` | Specify the number of MPPT's in use `1`, `2`, `3`, `4` or `5` | +| auto_scale: | Optional | `true` | If set to `true` the card will use the entities `unit_of_measurement` attribute to perform the correct scaling (i,e, power values greater than 999W will be displayed as kW e.g. 1.23kW) and display the correct unit. The number of decimal places can be changed using the `decimal_places` card attribute apart from the daily energy values which are set using the `decimal_places_energy` attribute | +| pv1_name: | Optional | `PV1` | Set the disaply name for MPPT1 | +| pv2_name: | Optional | `PV2` | Set the disaply name for MPPT2 | +| pv3_name: | Optional | `PV3` | Set the disaply name for MPPT3 | +| pv4_name: | Optional | `PV4` | Set the disaply name for MPPT4 | +| pv5_name: | Optional | `PV5` | Set the disaply name for MPPT4 | +| colour: | Optional | `orange` | Sets the colour of all the solar card objects. Hex codes (`'#66ff00'` etc) or names (`red`, `green`, `blue` etc) | +| dynamic_colour: | Optional | `true` | The solar elements on the card will be greyed out if total solar power < 10W. | +| animation_speed: | Optional | `9` | Set slowest animation speed in seconds, depending on Power produced | +| off_threshold: | Optional | `10` | When total PV power falls belows this threshold colour will change to grey. Requires `dynamic_colour` to be enabled | +| visualize_efficiency: | Optional | `true` | `false` - Disabled, `true` - Graphic display of Efficiency | +| show_mppt_production: | Optional | `true` | Show each MPPT energy production | +| show_mppt_efficiency: | Optional | `false` | Show % of each MPPT efficiency | +| PV Max Power | Sub-menu | | Shows sub-menu w Max Power values required to calculate and visualize efficiency | + +| Attribute | Requirement | Default | Description | +|----------------|-------------|---------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| max_power: | Optional | `8000` | Maximum power draw to calculate animation speed. This value is also used to calculate the solar efficiency for the total PV power and should equal the total size of your PV array. Numeric value or sensor. | +| pv1_max_power: | Optional | | Maximum power of MPPT1 based on the number and size of panels. Used to calculate solar efficiency of the string (W). Numeric value or sensor. | +| pv2_max_power: | Optional | | Maximum power of MPPT2 based on the number and size of panels. Used to calculate solar efficiency of the string (W). Numeric value or sensor. | +| pv3_max_power: | Optional | | Maximum power of MPPT3 based on the number and size of panels. Used to calculate solar efficiency of the string (W). Numeric value or sensor. | +| pv4_max_power: | Optional | | Maximum power of MPPT4 based on the number and size of panels. Used to calculate solar efficiency of the string (W). Numeric value or sensor | +| pv5_max_power: | Optional | | Maximum power of MPPT4 based on the number and size of panels. Used to calculate solar efficiency of the string (W). Numeric value or sensor | + +## Battery To display battery power and current as absolute values set `show_absolute: true`. This is set to false by default and will return your sensor value. The animated dot will change direction depending on the charging or discharging state. The `invert_power` attribute can be used to reverse direction if needed by your sensor. -| Attribute | Requirement | Default | Description | -|--------------------------|---------------|---------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| energy: | **Required** | `0` | Total battery energy in Wh (e.g. 3 x 5.32kWh = 15960). If set to `0` the remaining battery runtime will be hidden. Numeric value or sensor i.e. `sensor.sunsynk_battery_energy` | -| shutdown_soc: | **Required** | `20` | The battery shutdown percentage used to calculate remaining runtime. Numeric value or sensor i.e. `sensor.sunsynk_battery_capacity_shutdown` | -| shutdown_soc_offgrid: | Optional | | The offgrid battery shutdown percentage used to calculate remaining runtime. Numeric value or sensor i.e. `sensor.offgrid_battery_capacity_shutdown` | -| show_daily: | Optional | `false` | Toggles the daily total | -| auto_scale: | Optional | `true` | If set to `true` the card will use the entities `unit_of_measurement` attribute to perform the correct scaling (i,e, power values greater than 999W will be displayed as kW e.g. 1.23kW) and display the correct unit. The number of decimal places can be changed using the `decimal_places` card attribute apart from the daily energy values which are set using the `decimal_places_energy` attribute | -| invert_power: | Optional | `false` | Set to `true` if your sensor provides a positive number for battery charge and negative number for battery discharge | -| show_absolute: | Optional | `false` | set to `true` to display power and current as absolute values | -| colour: | Optional | `pink` | Sets the colour of all the battery card objects. Hex codes (`'#66ff00'` etc) or names (`red`, `green`, `blue` etc) | -| charge_colour: | Optional | | Sets the colour of all the battery card objects when charging. Hex codes (`'#66ff00'` etc) or names (`red`, `green`, `blue` etc) | -| dynamic_colour: | Optional | `true` | The battery icon colour will change based on the % contribution of the power source (grid, solar) supplying the battery. Set to `false` to disable. If `priority_load_243: on` solar will prioritise the essential load. If `false` or ommited solar will prioritise the battery. | -| linear_gradient: | Optional | `true` | The blocks inside the battery icon that represent SOC will be coloured using a linear gradient that ranges from red to green | -| animate: | Optional | `true` | Animates the linear gradient inside the battery icon | -| animation_speed: | Optional | `6` | Set slowest animation speed in seconds, depending on power draw | -| hide_soc: | Optional | `false` | If set to `true` the current program capacity (soc), or for Goodwe inverters the shutdown soc and offgrid shutdown soc that is shown to the left of the current battery SOC will be hidden. | -| show_remaining_energy: | Optional | `true` | Set to `true` to display the remaining battery energy in kWh based on the current SOC. Only visable on the `lite` and `full` cards | -| max_power: | Optional | `4500` | Maximum power draw to calculate animation speed. Numeric value or sensor i.e. `number.battery_maximum_discharging_power` | -| path_threshold: | Optional | `100` | Specify threshold to apply dynamic colour to the battery path element. The colour of the path will change to the source colour if the percentage supply by a single source equals or exceeds this value | - -### Load +| Attribute | Requirement | Default | Description | +|------------------------|--------------|---------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| energy: | **Required** | `0` | Total battery energy in Wh (e.g. 3 x 5.32kWh = 15960). If set to `0` the remaining battery runtime will be hidden. Numeric value or sensor i.e. `sensor.sunsynk_battery_energy` | +| shutdown_soc: | **Required** | `20` | The battery shutdown percentage used to calculate remaining runtime. Numeric value or sensor i.e. `sensor.sunsynk_battery_capacity_shutdown` | +| shutdown_soc_offgrid: | Optional | | The offgrid battery shutdown percentage used to calculate remaining runtime. Numeric value or sensor i.e. `sensor.offgrid_battery_capacity_shutdown` | +| show_daily: | Optional | `false` | Toggles the daily total | +| auto_scale: | Optional | `true` | If set to `true` the card will use the entities `unit_of_measurement` attribute to perform the correct scaling (i,e, power values greater than 999W will be displayed as kW e.g. 1.23kW) and display the correct unit. The number of decimal places can be changed using the `decimal_places` card attribute apart from the daily energy values which are set using the `decimal_places_energy` attribute | +| invert_power: | Optional | `false` | Set to `true` if your sensor provides a positive number for battery charge and negative number for battery discharge | +| show_absolute: | Optional | `false` | set to `true` to display power and current as absolute values | +| colour: | Optional | `pink` | Sets the colour of all the battery card objects. Hex codes (`'#66ff00'` etc) or names (`red`, `green`, `blue` etc) | +| charge_colour: | Optional | | Sets the colour of all the battery card objects when charging. Hex codes (`'#66ff00'` etc) or names (`red`, `green`, `blue` etc) | +| dynamic_colour: | Optional | `true` | The battery icon colour will change based on the % contribution of the power source (grid, solar) supplying the battery. Set to `false` to disable. If `priority_load_243: on` solar will prioritise the essential load. If `false` or ommited solar will prioritise the battery. | +| linear_gradient: | Optional | `true` | The blocks inside the battery icon that represent SOC will be coloured using a linear gradient that ranges from red to green | +| animate: | Optional | `true` | Animates the linear gradient inside the battery icon | +| animation_speed: | Optional | `6` | Set slowest animation speed in seconds, depending on power draw | +| hide_soc: | Optional | `false` | If set to `true` the current program capacity (soc), or for Goodwe inverters the shutdown soc and offgrid shutdown soc that is shown to the left of the current battery SOC will be hidden. | +| show_remaining_energy: | Optional | `true` | Set to `true` to display the remaining battery energy in kWh based on the current SOC. Only visable on the `lite` and `full` cards | +| max_power: | Optional | `4500` | Maximum power draw to calculate animation speed. Numeric value or sensor i.e. `number.battery_maximum_discharging_power` | +| path_threshold: | Optional | `100` | Specify threshold to apply dynamic colour to the battery path element. The colour of the path will change to the source colour if the percentage supply by a single source equals or exceeds this value | + +## Load | Attribute | Requirement | Default | Description | |-------------------|-------------|-------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| @@ -127,28 +131,28 @@ The `invert_power` attribute can be used to reverse direction if needed by your | additional_load | Optional | | Additional Load details: [Additional Load](#load-additional-load) | | aux | Optional | | Additional Load details: [Aux Load](#load-aux) | -#### Load: Additional Load - -| Attribute | Requirement | Default | Description | -|-------------|-------------|-------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| load1_name: | Optional | | Set the display name for the essential load 1 | -| load1_icon: | Optional | none | Set the essential load (1 image using preset or any mdi icon e.g. `mdi:ev-station` Presets are: `boiler`, `pump`, `aircon`, `oven`. You can also provide a sensor that returns the mdi icon. | -| load2_name: | Optional | | Set the display name for the essential load 2 | -| load2_icon: | Optional | none | Set the essential load 2 image using preset or any mdi icon e.g. `mdi:ev-station` Presets are: `boiler`, `pump`, `aircon`, `oven`. You can also provide a sensor that returns the mdi icon. | -| load3_name: | Optional | | Set the display name for the essential load 3 | -| load3_icon: | Optional | none | Set the essential load 3image using preset or any mdi icon e.g. `mdi:ev-station` Presets are: `boiler`, `pump`, `aircon`, `oven`. You can also provide a sensor that returns the mdi icon. | -| load4_name: | Optional | | Set the display name for the essential load 4 | -| load4_icon: | Optional | none | Set the essential load 4 image using preset or any mdi icon e.g. `mdi:ev-station` Presets are: `boiler`, `pump`, `aircon`, `oven`. You can also provide a sensor that returns the mdi icon. | -| load5_name: | Optional | | Set the display name for the essential load 5 | -| load5_icon: | Optional | none | Set the essential load 5 image using preset or any mdi icon e.g. `mdi:ev-station` Presets are: `boiler`, `pump`, `aircon`, `oven`. You can also provide a sensor that returns the mdi icon. | -| load6_name: | Optional | | Set the display name for the essential load 6 | -| load6_icon: | Optional | none | Set the essential load 6 image using preset or any mdi icon e.g. `mdi:ev-station` Presets are: `boiler`, `pump`, `aircon`, `oven`. You can also provide a sensor that returns the mdi icon. | -| load7_name: | Optional | | Set the display name for the essential load 7 | -| load7_icon: | Optional | none | Set the essential load 7 image using preset or any mdi icon e.g. `mdi:ev-station` Presets are: `boiler`, `pump`, `aircon`, `oven`. You can also provide a sensor that returns the mdi icon. | -| load8_name: | Optional | | Set the display name for the essential load 8 | -| load8_icon: | Optional | none | Set the essential load 8 image using preset or any mdi icon e.g. `mdi:ev-station` Presets are: `boiler`, `pump`, `aircon`, `oven`. You can also provide a sensor that returns the mdi icon. | - -#### Load: aux +### Load: Additional Load + +| Attribute | Requirement | Default | Description | +|-------------|-------------|---------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| load1_name: | Optional | | Set the display name for the essential load 1 | +| load1_icon: | Optional | none | Set the essential load (1 image using preset or any mdi icon e.g. `mdi:ev-station` Presets are: `boiler`, `pump`, `aircon`, `oven`. You can also provide a sensor that returns the mdi icon. | +| load2_name: | Optional | | Set the display name for the essential load 2 | +| load2_icon: | Optional | none | Set the essential load 2 image using preset or any mdi icon e.g. `mdi:ev-station` Presets are: `boiler`, `pump`, `aircon`, `oven`. You can also provide a sensor that returns the mdi icon. | +| load3_name: | Optional | | Set the display name for the essential load 3 | +| load3_icon: | Optional | none | Set the essential load 3image using preset or any mdi icon e.g. `mdi:ev-station` Presets are: `boiler`, `pump`, `aircon`, `oven`. You can also provide a sensor that returns the mdi icon. | +| load4_name: | Optional | | Set the display name for the essential load 4 | +| load4_icon: | Optional | none | Set the essential load 4 image using preset or any mdi icon e.g. `mdi:ev-station` Presets are: `boiler`, `pump`, `aircon`, `oven`. You can also provide a sensor that returns the mdi icon. | +| load5_name: | Optional | | Set the display name for the essential load 5 | +| load5_icon: | Optional | none | Set the essential load 5 image using preset or any mdi icon e.g. `mdi:ev-station` Presets are: `boiler`, `pump`, `aircon`, `oven`. You can also provide a sensor that returns the mdi icon. | +| load6_name: | Optional | | Set the display name for the essential load 6 | +| load6_icon: | Optional | none | Set the essential load 6 image using preset or any mdi icon e.g. `mdi:ev-station` Presets are: `boiler`, `pump`, `aircon`, `oven`. You can also provide a sensor that returns the mdi icon. | +| load7_name: | Optional | | Set the display name for the essential load 7 | +| load7_icon: | Optional | none | Set the essential load 7 image using preset or any mdi icon e.g. `mdi:ev-station` Presets are: `boiler`, `pump`, `aircon`, `oven`. You can also provide a sensor that returns the mdi icon. | +| load8_name: | Optional | | Set the display name for the essential load 8 | +| load8_icon: | Optional | none | Set the essential load 8 image using preset or any mdi icon e.g. `mdi:ev-station` Presets are: `boiler`, `pump`, `aircon`, `oven`. You can also provide a sensor that returns the mdi icon. | + +### Load: aux | Attribute | Requirement | Default | Description | |---------------------|-------------|-------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------| @@ -168,41 +172,41 @@ The `invert_power` attribute can be used to reverse direction if needed by your | aux_load2_icon: | Optional | | Set the AUX load 2 image using any mdi icon e.g. `mdi:ev-station`. You can also provide a sensor that returns the mdi icon. | | show_daily_aux: | Optional | `false` | Toggles the daily AUX total. Only displayed if `show_aux` is set to `true` | -### Grid - -| Attribute | Requirement | Default | Description | -|------------------------|--------------|-----------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| grid_name: | Optional | | Set the display name for the grid | -| max_power: | Optional | `8000` | Maximum power draw to calculate animation speed. Numeric value or sensor | -| show_daily_buy: | Optional | `false` | Toggles the daily buy total | -| label_daily_grid_buy: | Optional | | Set custom text for the "DAILY GRID BUY" label that is displayed. | -| show_daily_sell: | Optional | `false` | Toggles the daily sell total | -| label_daily_grid_sell: | Optional | | Set custom test for the "DAILY GRID SELL" label that is displayed. | -| auto_scale: | Optional | `true` | If set to `true` the card will use the entities `unit_of_measurement` attribute to perform the correct scaling (i,e, power values greater than 999W will be displayed as kW e.g. 1.23kW) and display the correct unit. The number of decimal places can be changed using the `decimal_places` card attribute apart from the daily energy values which are set using the `decimal_places_energy` attribute | -| invert_grid: | Optional | `false` | Set to `true` if your sensor provides a negative number for grid import and positive number for grid export | -| show_absolute: | Optional | `false` | set to `true` to display power as absolute | -| colour: | Optional | `'#5490c2'` | Sets the colour of all the grid card objects. Hex codes (`'#66ff00'` etc) or names (`red`, `green`, `blue` etc). | -| no_grid_colour: | Optional | | Sets the colour of all the grid card objects when there is no grid power. Hex codes (`'#66ff00'` etc) or names (`red`, `green`, `blue` etc). If not set will use the `colour:` value defined above total | -| export_colour: | Optional | | Sets the colour of all the grid card objects when exporting (selling) energy. Hex codes (`'#66ff00'` etc) or names (`red`, `green`, `blue` etc). If not set will use the `colour:` value defined above. | -| grid_off_colour: | Optional | | Sets the colour of the grid icon when the grid is disconnected. | | -| energy_cost_decimals: | Optional | `2` | Sets the number of decimal places to display the buy and sell energy costs | -| animation_speed: | Optional | `8` | Set slowest animation speed in seconds, depending on power draw | -| off_threshold: | Optional | `0` | When power falls below this value the load will be considered off and colour will change to grey. Requires `dynamic_colour` to be enabled. Can also be set to `-1` to disable. | -| import_icon: | Optional | | Set the grid connected/import image using any mdi icon e.g. `mdi:transmission-tower-import`. You can also provide a sensor that returns the mdi icon. If defined overrides the card default icon. | -| export_icon: | Optional | | Set the grid export image using any mdi icon e.g. `mdi:transmission-tower-export`. You can also provide a sensor that returns the mdi icon. If defined overrides the card default icon. | -| disconnected_icon: | Optional | | Set the grid disconnected image using any mdi icon e.g. `mdi:transmission-tower-off`. You can also provide a sensor that returns the mdi icon. If defined overrides the card default icon. | -| show_nonessential: | Optional | `true` | Toggles the display of non-essential | -| additional_loads: | Optional | `0` | Toggle the display of additional loads on the non-essential side (`0/1/2/3`) The third load will only be displayed if the inverter timer schedules are not used due to limited space. Set the battery attribute `hide_soc: true` to display | -| nonessential_icon: | Optional | `default` | Change the non-essential image using presets or any mdi icon e.g. `mdi:ev-station`. Presets are:
`default` `oven`, `boiler`

`pump`, `aircon`
| -| nonessential_name: | Optional | `Non Essential` | Set the display name for the non-essential load | -| load1_name: | Optional | | Set the display name for the non-essential load 1 | -| load1_icon: | Optional | `default` | Change the non-essential load 1 image using presets or any mdi icon e.g. `mdi:ev-station`. Presets are: `default`, `oven`, `boiler`, `pump`, `aircon` You can also provide a sensor that returns the mdi icon. | -| load2_name: | Optional | | Set the display name for the non-essential load 2 | -| load2_icon: | Optional | `default` | Change the non-essential load 2 image using presets or any mdi icon e.g. `mdi:ev-station`. Presets are: `default`, `oven`, `boiler`, `pump`, `aircon` You can also provide a sensor that returns the mdi icon. | -| load3_name: | Optional | | Set the display name for the non-essential load 3 | -| load3_icon: | Optional | none | Change the non-essential load 3 image using any mdi icon e.g. `mdi:ev-station`. You can also provide a sensor that returns the mdi icon. | - -### Entities +## Grid + +| Attribute | Requirement | Default | Description | +|------------------------|-------------|-----------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| grid_name: | Optional | | Set the display name for the grid | +| max_power: | Optional | `8000` | Maximum power draw to calculate animation speed. Numeric value or sensor | +| show_daily_buy: | Optional | `false` | Toggles the daily buy total | +| label_daily_grid_buy: | Optional | | Set custom text for the "DAILY GRID BUY" label that is displayed. | +| show_daily_sell: | Optional | `false` | Toggles the daily sell total | +| label_daily_grid_sell: | Optional | | Set custom test for the "DAILY GRID SELL" label that is displayed. | +| auto_scale: | Optional | `true` | If set to `true` the card will use the entities `unit_of_measurement` attribute to perform the correct scaling (i,e, power values greater than 999W will be displayed as kW e.g. 1.23kW) and display the correct unit. The number of decimal places can be changed using the `decimal_places` card attribute apart from the daily energy values which are set using the `decimal_places_energy` attribute | +| invert_grid: | Optional | `false` | Set to `true` if your sensor provides a negative number for grid import and positive number for grid export | +| show_absolute: | Optional | `false` | set to `true` to display power as absolute | +| colour: | Optional | `'#5490c2'` | Sets the colour of all the grid card objects. Hex codes (`'#66ff00'` etc) or names (`red`, `green`, `blue` etc). | +| no_grid_colour: | Optional | | Sets the colour of all the grid card objects when there is no grid power. Hex codes (`'#66ff00'` etc) or names (`red`, `green`, `blue` etc). If not set will use the `colour:` value defined above total | +| export_colour: | Optional | | Sets the colour of all the grid card objects when exporting (selling) energy. Hex codes (`'#66ff00'` etc) or names (`red`, `green`, `blue` etc). If not set will use the `colour:` value defined above. | +| grid_off_colour: | Optional | | Sets the colour of the grid icon when the grid is disconnected. | | +| energy_cost_decimals: | Optional | `2` | Sets the number of decimal places to display the buy and sell energy costs | +| animation_speed: | Optional | `8` | Set slowest animation speed in seconds, depending on power draw | +| off_threshold: | Optional | `0` | When power falls below this value the load will be considered off and colour will change to grey. Requires `dynamic_colour` to be enabled. Can also be set to `-1` to disable. | +| import_icon: | Optional | | Set the grid connected/import image using any mdi icon e.g. `mdi:transmission-tower-import`. You can also provide a sensor that returns the mdi icon. If defined overrides the card default icon. | +| export_icon: | Optional | | Set the grid export image using any mdi icon e.g. `mdi:transmission-tower-export`. You can also provide a sensor that returns the mdi icon. If defined overrides the card default icon. | +| disconnected_icon: | Optional | | Set the grid disconnected image using any mdi icon e.g. `mdi:transmission-tower-off`. You can also provide a sensor that returns the mdi icon. If defined overrides the card default icon. | +| show_nonessential: | Optional | `true` | Toggles the display of non-essential | +| additional_loads: | Optional | `0` | Toggle the display of additional loads on the non-essential side (`0/1/2/3`) The third load will only be displayed if the inverter timer schedules are not used due to limited space. Set the battery attribute `hide_soc: true` to display | +| nonessential_icon: | Optional | `default` | Change the non-essential image using presets or any mdi icon e.g. `mdi:ev-station`. Presets are:
`default` `oven`, `boiler`

`pump`, `aircon`
| +| nonessential_name: | Optional | `Non Essential` | Set the display name for the non-essential load | +| load1_name: | Optional | | Set the display name for the non-essential load 1 | +| load1_icon: | Optional | `default` | Change the non-essential load 1 image using presets or any mdi icon e.g. `mdi:ev-station`. Presets are: `default`, `oven`, `boiler`, `pump`, `aircon` You can also provide a sensor that returns the mdi icon. | +| load2_name: | Optional | | Set the display name for the non-essential load 2 | +| load2_icon: | Optional | `default` | Change the non-essential load 2 image using presets or any mdi icon e.g. `mdi:ev-station`. Presets are: `default`, `oven`, `boiler`, `pump`, `aircon` You can also provide a sensor that returns the mdi icon. | +| load3_name: | Optional | | Set the display name for the non-essential load 3 | +| load3_icon: | Optional | none | Change the non-essential load 3 image using any mdi icon e.g. `mdi:ev-station`. You can also provide a sensor that returns the mdi icon. | + +## Entities Entity attributes below have been appended with the modbus register # e.g. `pv2_power_187` to indicate which Sunsynk register should be read when configuring your sensors. Replace the default sensors with your own specific sensor names. @@ -213,106 +217,136 @@ with a default value of 0 set it to `zero` or any other value i.e. `solarday_108 See the [WIKI](https://github.com/molikk/mlk-power-flow-card/wiki/Sensor-Mappings) for more information on sensor mappings if using other integration methods. -| Attribute | Requirement | Default | Description | -|----------------------------|--------------|------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| use_timer_248: | Optional | `switch.sunsynk_toggle_system_timer` | Displays "Use timer" status as an icon next to the inverter. Set to `no` to hide | -| priority_load_243: | Optional | `switch.sunsynk_toggle_priority_load` | Shows if energy pattern is set to priority load or priority battery as an icon next to the inverter. Set to `no` to hide | -| day_battery_discharge_71: | Optional | `sensor.sunsynk_day_battery_discharge` | Daily battery usage (kWh) | -| day_battery_charge_70: | Optional | `sensor.sunsynk_day_battery_charge` | Daily battery charge (kWh) | -| day_load_energy_84: | Optional | `sensor.sunsynk_day_load_energy` | Daily load (kWh) | -| day_grid_import_76: | Optional | `sensor.sunsynk_day_grid_import` | Daily grid import (kWh) | -| day_grid_export_77: | Optional | `sensor.sunsynk_day_grid_export` | Daily grid export (kWh) | -| day_pv_energy_108: | Optional | `sensor.sunsynk_day_pv_energy` | Daily solar usage (kWh) | -| day_aux_energy: | Optional | | Sensor that provides the daily AUX energy (kWh) | -| inverter_voltage_154: | Optional | `sensor.sunsynk_inverter_voltage` | Inverter L1 voltage (V) | -| inverter_voltage_L2: | Optional | | Inverter L2 voltage (V) | -| inverter_voltage_L3: | Optional | | Inverter L3 voltage (V) | -| load_frequency_192: | Optional | `sensor.sunsynk_load_frequency` | Load frequency (Hz) | -| inverter_current_164: | Optional | `sensor.sunsynk_inverter_current` | Inverter L1 current (A) | -| inverter_current_L2: | Optional | | Inverter L2 current (A) | -| inverter_current_L3: | Optional | | Inverter L3 current (A) | -| inverter_power_175: | Optional | `sensor.sunsynk_inverter_power` | Inverter power (W). Required if the essential_power attribute is set to `none` | -| grid_power_169: | Optional | `sensor.sunsynk_grid_power` | Grid power (W) See NOTE below. Use **167** (Grid LD Power) if non-essential and essential readings are wrong. Required if the nonessential_power attribute is set to `none` | -| pv1_power_186: | Optional | `sensor.sunsynk_pv1_power` | PV string 1 power (W) | -| pv2_power_187: | Optional | `sensor.sunsynk_pv2_power` | PV string 2 power (W) | -| pv3_power_188: | Optional | `sensor.sunsynk_pv3_power` | PV string 3 power (W) | -| pv4_power_189: | Optional | `sensor.sunsynk_pv4_power` | PV string 4 power (W) | -| pv_total: | Optional | `none` | Provide a sensor for total pv power. If omitted the card uses internal logic to calculate this based on the pv1-4 power (W) | -| battery_voltage_183: | Optional | `sensor.sunsynk_battery_voltage` | Battery voltage (V) | -| battery_soc_184: | **Required** | `sensor.sunsynk_battery_soc` | Battery state of charge (%) | -| battery_power_190: | **Required** | `sensor.sunsynk_battery_power` | Battery power (W). Requires a negative number for battery charging and a positive number for battery discharging. Set the `invert_power:` battery attribute to `yes` if your sensor reports this the other way around | -| battery_current_191: | **Required** | `sensor.sunsynk_battery_current` | Battery current (A) | -| battery_temp_182: | Optional | `sensor.sunsynk_battery_temperature` | Battery temperature (°). Note do not define this sensor if you want to display battery SOH. See below. | -| battery_soh: | Optional | | Battery State of Health (SOH) (%). You can chose to display either battery temperature or battery SOH but not both. They are displayed in the same place on the card. If `battery_temp_182:` is defined it will take priority and this sensor will not be displayed. | -| battery_rated_capacity: | Optional | | Battery rated capacity (Ah). If provided this sensor will be used to calculate battery energy. The`energy` attribute under the battery card configuration will be ignored. | -| essential_power: | Optional | `none` | The card will automatically calculate this sensor based on the formula below if the attribute is set to `none` or the sensor is not defined. You can overide this by supplying a sensor that measures essential power e.g. `Load power Essential` in the case of Solar Assistant (W) | -| essential_load1: | Optional | | Sensor that contains the power of your essential load 1 (W). Can also be used to display any sensor data i.e. temp, energy etc if `auto_scale: false` | -| essential_load2: | Optional | | Sensor that contains the power of your essential load 2 (W). Can also be used to display any sensor data i.e. temp, energy etc if `auto_scale: false` | -| essential_load3: | Optional | | Sensor that contains the power of your essential load 3 (W). Can also be used to display any sensor data i.e. temp, energy etc if `auto_scale: false` For lite and compact cards | -| essential_load4: | Optional | | Sensor that contains the power of your essential load 4 (W). Can also be used to display any sensor data i.e. temp, energy etc if `auto_scale: false` | -| essential_load1_extra: | Optional | | Sensor that contains additional information you want displayed for your essential load 1 e.g. Daily kWh, Temperature etc | -| essential_load2_extra: | Optional | | Sensor that contains additional information you want displayed for your essential load 2 e.g. Daily kWh, Temperature etc | -| load_power_L1: | Optional | | Load L1 Power (W) | -| load_power_L2: | Optional | | Load L2 Power (W) | -| load_power_L3: | Optional | | Load L3 Power (W) | -| nonessential_power | Optional | `none` | The card will automatically calculate this sensor based on the formula below if the attribute is set to `none` or the sensor is not defined. You can overide this by supplying a sensor that measures non-essential power e.g. `Load power Non-Essential` in the case of Solar Assistant. You can also disable this sensor by setting it's value to any arbitrary value i.e. `nonessential_power: no` and it will display a zero value and not effect autarky and ratio calculations (W) | -| non_essential_load1: | Optional | | Sensor that contains the power of your non-essential load 1 (W) | -| non_essential_load2: | Optional | | Sensor that contains the power of your non-essential load 2 (W) | -| non_essential_load3: | Optional | | Sensor that contains the power of your non-essential load 3 (W) | -| non_essential_load1_extra: | Optional | | Sensor that contains additional information you want displayed for your nonessential load 1 e.g. Daily kWh, Temperature etc | -| non_essential_load2_extra: | Optional | | Sensor that contains additional information you want displayed for your nonessential load 2 e.g. Daily kWh, Temperature etc | -| grid_ct_power_total: | Optional | | For three phase systems. The card will automatically calculate this based on (Grid CT L1 power + Grid CT L2 power + Grid CT L3 power) You can optionally provide your own sensor for total grid power. (W) | -| grid_ct_power_172: | **Required** | `sensor.sunsynk_grid_ct_power` | Grid CT L1 power (W) | -| grid_ct_power_L2: | Optional | `none` | Grid CT L2 power (W) | -| grid_ct_power_L3: | Optional | `none` | Grid CT L3 power (W) | -| pv1_voltage_109: | Optional | `sensor.sunsynk_pv1_voltage` | PV string 1 voltage (V) | -| pv1_current_110: | Optional | `sensor.sunsynk_pv1_current` | PV string 1 current (A) | -| pv2_voltage_111: | Optional | `sensor.sunsynk_pv2_voltage` | PV string 2 voltage (V) | -| pv2_current_112: | Optional | `sensor.sunsynk_pv2_current` | PV string 2 current (A) | -| pv3_voltage_113: | Optional | `sensor.sunsynk_pv3_voltage` | PV string 3 voltage (V) | -| pv3_current_114: | Optional | `sensor.sunsynk_pv3_current` | PV string 3 current (A) | -| pv4_voltage_115: | Optional | `sensor.sunsynk_pv4_voltage` | PV string 4 voltage (V) | -| pv4_current_116: | Optional | `sensor.sunsynk_pv4_current` | PV string 4 current (A) | -| grid_connected_status_194: | Optional | `binary_sensor.sunsynk_grid_connected_status` | Grid connected status (case insensitive) `on/off`,`1/0`, `On-Grid/Off-Grid`, or `On Grid/Off Grid` | -| inverter_status_59: | Optional | `sensor.sunsynk_overall_state` | Expects a sensor that contains inverter status represented as a string or number. For Sunsynk `0, 1, 2, 3, 4` or `standby, selftest, normal, alarm, fault`. For Lux `0,1,2,4,5,7,8,9,10,11,12,16,17,20,32,40,64,136,192`. For Solis expects a numeric value `0-57`. For Goodwe `0,1,2,3,4,5` or `Wait mode, Normal (On-Grid), Normal (Off-Grid), Fault Mode, Flash Mode, Check Mode`. For Goodwe_gridmode `0,1,2` or `Idle, Exporting, Importing` | -| battery_status: | Optional | `sensor.battery_mode_code` | Used only when inverter model is set to `goodwe`, `goodwe_gridmode` or `huawei`. Battery status `0, 1, 2, 3, 4` | -| aux_power_166: | Optional | `sensor.sunsynk_aux_power` | Auxilary power (W) | -| aux_load1: | Optional | | Sensor that contains the power of your AUX load 1 (W) | -| aux_load2: | Optional | | Sensor that contains the power of your AUX load 2 (W) | -| aux_load1_extra: | Optional | | Sensor that contains additional information you want displayed for your aux load 1 e.g. Daily kWh, Temperature etc. This entity can also be used to display additioanl sensor information above the aux icon when `aux_loads: 0` | -| aux_load2_extra: | Optional | | Sensor that contains additional information you want displayed for your aux load 2 e.g. Daily kWh, Temperature etc | -| aux_connected_status: | Optional | | AUX Connected Status `on/off` or `1/0` | -| remaining_solar: | Optional | `sensor.solcast_forecast_remaining_today` | The remaining solar forecast for the day (kWh). Use with solar `display_mode:2` | -| total_pv_generation: | Optional | | Total Solar generation (Lifetime or forecast for the day) (kWh). Use with solar `display_mode:3` | -| radiator_temp_91: | Optional | `sensor.sunsynk_radiator_temperature` | Inverter AC temperature (℃) | -| environment_temp: | Optional | | Display outside temperature or other environment temperature below the sun icon | -| dc_transformer_temp_90: | Optional | `sensor.sunsynk_dc_transformer_temperature` | Inverter DC temperature (℃) | -| prog1_time: | Optional | `sensor.sunsynk_time_slot_1` | Program 1 start time (`HH:MM`) | -| prog1_capacity: | Optional | `number.sunsynk_system_mode_soc_time1` | Program 1 capacity (SOC) setting | -| prog1_charge: | Optional | `switch.sunsynk_system_mode_grid_charge_time1` | Program 1 charge options (`on/off`, `1/0`, `No Grid or Gen`) | -| prog2_time: | Optional | `sensor.sunsynk_time_slot_2` | Program 2 start time (`HH:MM`) | -| prog2_capacity: | Optional | `number.sunsynk_system_mode_soc_time2` | Program 2 capacity (SOC) setting | -| prog2_charge: | Optional | `switch.sunsynk_system_mode_grid_charge_time2` | Program 2 charge options (`on/off`, `1/0`, `No Grid or Gen`) | -| prog3_time: | Optional | `sensor.sunsynk_time_slot_3` | Program 3 start time (`HH:MM`) | -| prog3_capacity: | Optional | `number.sunsynk_system_mode_soc_time3` | Program 3 capacity (SOC) setting | -| prog3_charge: | Optional | `switch.sunsynk_system_mode_grid_charge_time3` | Program 3 charge options (`on/off`, `1/0`, `No Grid or Gen`) | -| prog4_time: | Optional | `sensor.sunsynk_time_slot_4` | Program 4 start time (`HH:MM`) | -| prog4_capacity: | Optional | `number.sunsynk_system_mode_soc_time4` | Program 4 capacity (SOC) setting | -| prog4_charge: | Optional | `switch.sunsynk_system_mode_grid_charge_time4` | Program 4 charge options (`on/off`, `1/0`, `No Grid or Gen`) | -| prog5_time: | Optional | `sensor.sunsynk_time_slot_5` | Program 5 start time (`HH:MM`) | -| prog5_capacity: | Optional | `number.sunsynk_system_mode_soc_time5` | Program 5 capacity (SOC) setting | -| prog5_charge: | Optional | `switch.sunsynk_system_mode_grid_charge_time5` | Program 5 charge options (`on/off`, `1/0`, `No Grid or Gen`) | -| prog6_time: | Optional | `sensor.sunsynk_time_slot_6` | Program 6 start time (`HH:MM`) | -| prog6_capacity: | Optional | `number.sunsynk_system_mode_soc_time6` | Program 6 capacity (SOC) setting | -| prog6_charge: | Optional | `switch.sunsynk_system_mode_grid_charge_time6` | Program 6 charge options (`on/off`, `1/0`, `No Grid or Gen`) | -| energy_cost_buy: | Optional | | Sensor that provides current buy energy cost per kWh | -| energy_cost_sell: | Optional | | Sensor that provides current sell energy cost per kWh | -| solar_sell_247: | Optional | `switch.sunsynk_toggle_solar_sell` | Displays icons to indicate if sell solar is active or not. The switch can be toggled by clicking on the icon (`on/off`, `1/0`) | -| grid_voltage: | Optional | `sensor.solis_grid_voltage` | Sensor providing grid voltage (v). Used only when inverter model is set to `solis` | -| battery_current_direction: | Optional | `sensor.solis_battery_current_direction` | Used only when inverter model is set to `solis` (`0`, `1`) | -| prepaid_units: | Optional | | Account balance of prepaid electricity units | -| max_sell_power: | Optional | `number.sunsynk_max_sell_power` | Sets the maximum allowed output power to flow to the grid. Also known as "Export Control User Limit" (W) | - +| Sub-menu | Default | Description | +|-------------------|-------------------------------------------------------------|--------------------------| +| Solar Entities | See [Solar Entites](#solar-entities) attributes below | List of solar entities | +| Battery Entities | See [Battery Entites](#battery-entities) attributes below | List of battery entities | +| Inverter Entities | See [Inverter Entites](#inverter-entities) attributes below | List of battery entities | +| Load Entities | See [Load Entites](#load-entities) attributes below | List of load entities | +| Grid Entities | See [Grid Entites](#grid-entities) attributes below | List of grid entities | + +### Solar entities + +| Attribute | Requirement | Default | Description | +|------------------------|-------------|--------------------------------|--------------------------------------------------------------------------------------------------------------------------------| +| pv_total: | Optional | | Provide a sensor for total pv power. If omitted the card uses internal logic to calculate this based on the pv1-5 power (W) | +| day_pv_energy_108: | Optional | `sensor.sunsynk_day_pv_energy` | Daily solar generation (kWh) | +| monthly_pv_generation: | Optional | | Monthly solar generation (kWh) | +| yearly_pv_generation: | Optional | | Yearly solar generation (kWh) | +| total_pv_generation: | Optional | | Total Solar generation | +| remaining_solar: | Optional | | The remaining solar forecast for the day (kWh). | +| pv1_power_186: | Optional | `sensor.sunsynk_pv1_power` | PV string 1 power (W) | +| pv1_production: | Optional | | PV string 1 daily energy (kWh) | +| pv1_voltage_109: | Optional | `sensor.sunsynk_pv1_voltage` | PV string 1 voltage (V) | +| pv1_current_110: | Optional | `sensor.sunsynk_pv1_current` | PV string 1 current (A) | +| pv2_power_187: | Optional | `sensor.sunsynk_pv2_power` | PV string 2 power (W) | +| pv2_production: | Optional | | PV string 2 daily energy (kWh) | +| pv2_voltage_111: | Optional | `sensor.sunsynk_pv2_voltage` | PV string 2 voltage (V) | +| pv2_current_112: | Optional | `sensor.sunsynk_pv2_current` | PV string 2 current (A) | +| pv3_power_188: | Optional | | PV string 3 power (W) | +| pv3_production: | Optional | | PV string 3 daily energy (kWh) | +| pv3_voltage_113: | Optional | | PV string 3 voltage (V) | +| pv3_current_114: | Optional | | PV string 3 current (A) | +| pv4_power_189: | Optional | | PV string 4 power (W) | +| pv4_production: | Optional | | PV string 4 daily energy (kWh) | +| pv4_voltage_115: | Optional | | PV string 4 voltage (V) | +| pv4_current_116: | Optional | | PV string 4 current (A) | +| pv5_power_189: | Optional | | PV string 5 power (W) | +| pv5_production: | Optional | | PV string 5 daily energy (kWh) | +| pv5_voltage_115: | Optional | | PV string 5 voltage (V) | +| pv5_current_116: | Optional | | PV string 5 current (A) | +| solar_sell_247: | Optional | | Displays icons to indicate if sell solar is active or not. The switch can be toggled by clicking on the icon (`on/off`, `1/0`) | +| environment_temp: | Optional | | Display outside temperature or other environment temperature below the sun icon | + +### Battery Entities + +### Inverter Entities + +### Load Entities + +### Grid Entities + +| Attribute | Requirement | Default | Description | +|----------------------------|--------------|------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| use_timer_248: | Optional | `switch.sunsynk_toggle_system_timer` | Displays "Use timer" status as an icon next to the inverter. Set to `no` to hide | +| priority_load_243: | Optional | `switch.sunsynk_toggle_priority_load` | Shows if energy pattern is set to priority load or priority battery as an icon next to the inverter. Set to `no` to hide | +| day_battery_discharge_71: | Optional | `sensor.sunsynk_day_battery_discharge` | Daily battery usage (kWh) | +| day_battery_charge_70: | Optional | `sensor.sunsynk_day_battery_charge` | Daily battery charge (kWh) | +| day_load_energy_84: | Optional | `sensor.sunsynk_day_load_energy` | Daily load (kWh) | +| day_grid_import_76: | Optional | `sensor.sunsynk_day_grid_import` | Daily grid import (kWh) | +| day_grid_export_77: | Optional | `sensor.sunsynk_day_grid_export` | Daily grid export (kWh) | +| day_aux_energy: | Optional | | Sensor that provides the daily AUX energy (kWh) | +| inverter_voltage_154: | Optional | `sensor.sunsynk_inverter_voltage` | Inverter L1 voltage (V) | +| inverter_voltage_L2: | Optional | | Inverter L2 voltage (V) | +| inverter_voltage_L3: | Optional | | Inverter L3 voltage (V) | +| load_frequency_192: | Optional | `sensor.sunsynk_load_frequency` | Load frequency (Hz) | +| inverter_current_164: | Optional | `sensor.sunsynk_inverter_current` | Inverter L1 current (A) | +| inverter_current_L2: | Optional | | Inverter L2 current (A) | +| inverter_current_L3: | Optional | | Inverter L3 current (A) | +| inverter_power_175: | Optional | `sensor.sunsynk_inverter_power` | Inverter power (W). Required if the essential_power attribute is set to `none` | +| grid_power_169: | Optional | `sensor.sunsynk_grid_power` | Grid power (W) See NOTE below. Use **167** (Grid LD Power) if non-essential and essential readings are wrong. Required if the nonessential_power attribute is set to `none` | +| battery_voltage_183: | Optional | `sensor.sunsynk_battery_voltage` | Battery voltage (V) | +| battery_soc_184: | **Required** | `sensor.sunsynk_battery_soc` | Battery state of charge (%) | +| battery_power_190: | **Required** | `sensor.sunsynk_battery_power` | Battery power (W). Requires a negative number for battery charging and a positive number for battery discharging. Set the `invert_power:` battery attribute to `yes` if your sensor reports this the other way around | +| battery_current_191: | **Required** | `sensor.sunsynk_battery_current` | Battery current (A) | +| battery_temp_182: | Optional | `sensor.sunsynk_battery_temperature` | Battery temperature (°). Note do not define this sensor if you want to display battery SOH. See below. | +| battery_soh: | Optional | | Battery State of Health (SOH) (%). You can chose to display either battery temperature or battery SOH but not both. They are displayed in the same place on the card. If `battery_temp_182:` is defined it will take priority and this sensor will not be displayed. | +| battery_rated_capacity: | Optional | | Battery rated capacity (Ah). If provided this sensor will be used to calculate battery energy. The`energy` attribute under the battery card configuration will be ignored. | +| essential_power: | Optional | `none` | The card will automatically calculate this sensor based on the formula below if the attribute is set to `none` or the sensor is not defined. You can overide this by supplying a sensor that measures essential power e.g. `Load power Essential` in the case of Solar Assistant (W) | +| essential_load1: | Optional | | Sensor that contains the power of your essential load 1 (W). Can also be used to display any sensor data i.e. temp, energy etc if `auto_scale: false` | +| essential_load2: | Optional | | Sensor that contains the power of your essential load 2 (W). Can also be used to display any sensor data i.e. temp, energy etc if `auto_scale: false` | +| essential_load3: | Optional | | Sensor that contains the power of your essential load 3 (W). Can also be used to display any sensor data i.e. temp, energy etc if `auto_scale: false` For lite and compact cards | +| essential_load4: | Optional | | Sensor that contains the power of your essential load 4 (W). Can also be used to display any sensor data i.e. temp, energy etc if `auto_scale: false` | +| essential_load1_extra: | Optional | | Sensor that contains additional information you want displayed for your essential load 1 e.g. Daily kWh, Temperature etc | +| essential_load2_extra: | Optional | | Sensor that contains additional information you want displayed for your essential load 2 e.g. Daily kWh, Temperature etc | +| load_power_L1: | Optional | | Load L1 Power (W) | +| load_power_L2: | Optional | | Load L2 Power (W) | +| load_power_L3: | Optional | | Load L3 Power (W) | +| nonessential_power | Optional | `none` | The card will automatically calculate this sensor based on the formula below if the attribute is set to `none` or the sensor is not defined. You can overide this by supplying a sensor that measures non-essential power e.g. `Load power Non-Essential` in the case of Solar Assistant. You can also disable this sensor by setting it's value to any arbitrary value i.e. `nonessential_power: no` and it will display a zero value and not effect autarky and ratio calculations (W) | +| non_essential_load1: | Optional | | Sensor that contains the power of your non-essential load 1 (W) | +| non_essential_load2: | Optional | | Sensor that contains the power of your non-essential load 2 (W) | +| non_essential_load3: | Optional | | Sensor that contains the power of your non-essential load 3 (W) | +| non_essential_load1_extra: | Optional | | Sensor that contains additional information you want displayed for your nonessential load 1 e.g. Daily kWh, Temperature etc | +| non_essential_load2_extra: | Optional | | Sensor that contains additional information you want displayed for your nonessential load 2 e.g. Daily kWh, Temperature etc | +| grid_ct_power_total: | Optional | | For three phase systems. The card will automatically calculate this based on (Grid CT L1 power + Grid CT L2 power + Grid CT L3 power) You can optionally provide your own sensor for total grid power. (W) | +| grid_ct_power_172: | **Required** | `sensor.sunsynk_grid_ct_power` | Grid CT L1 power (W) | +| grid_ct_power_L2: | Optional | `none` | Grid CT L2 power (W) | +| grid_ct_power_L3: | Optional | `none` | Grid CT L3 power (W) | +| grid_connected_status_194: | Optional | `binary_sensor.sunsynk_grid_connected_status` | Grid connected status (case insensitive) `on/off`,`1/0`, `On-Grid/Off-Grid`, or `On Grid/Off Grid` | +| inverter_status_59: | Optional | `sensor.sunsynk_overall_state` | Expects a sensor that contains inverter status represented as a string or number. For Sunsynk `0, 1, 2, 3, 4` or `standby, selftest, normal, alarm, fault`. For Lux `0,1,2,4,5,7,8,9,10,11,12,16,17,20,32,40,64,136,192`. For Solis expects a numeric value `0-57`. For Goodwe `0,1,2,3,4,5` or `Wait mode, Normal (On-Grid), Normal (Off-Grid), Fault Mode, Flash Mode, Check Mode`. For Goodwe_gridmode `0,1,2` or `Idle, Exporting, Importing` | +| battery_status: | Optional | `sensor.battery_mode_code` | Used only when inverter model is set to `goodwe`, `goodwe_gridmode` or `huawei`. Battery status `0, 1, 2, 3, 4` | +| aux_power_166: | Optional | `sensor.sunsynk_aux_power` | Auxilary power (W) | +| aux_load1: | Optional | | Sensor that contains the power of your AUX load 1 (W) | +| aux_load2: | Optional | | Sensor that contains the power of your AUX load 2 (W) | +| aux_load1_extra: | Optional | | Sensor that contains additional information you want displayed for your aux load 1 e.g. Daily kWh, Temperature etc. This entity can also be used to display additioanl sensor information above the aux icon when `aux_loads: 0` | +| aux_load2_extra: | Optional | | Sensor that contains additional information you want displayed for your aux load 2 e.g. Daily kWh, Temperature etc | +| aux_connected_status: | Optional | | AUX Connected Status `on/off` or `1/0` | +| radiator_temp_91: | Optional | `sensor.sunsynk_radiator_temperature` | Inverter AC temperature (℃) | +| dc_transformer_temp_90: | Optional | `sensor.sunsynk_dc_transformer_temperature` | Inverter DC temperature (℃) | +| prog1_time: | Optional | `sensor.sunsynk_time_slot_1` | Program 1 start time (`HH:MM`) | +| prog1_capacity: | Optional | `number.sunsynk_system_mode_soc_time1` | Program 1 capacity (SOC) setting | +| prog1_charge: | Optional | `switch.sunsynk_system_mode_grid_charge_time1` | Program 1 charge options (`on/off`, `1/0`, `No Grid or Gen`) | +| prog2_time: | Optional | `sensor.sunsynk_time_slot_2` | Program 2 start time (`HH:MM`) | +| prog2_capacity: | Optional | `number.sunsynk_system_mode_soc_time2` | Program 2 capacity (SOC) setting | +| prog2_charge: | Optional | `switch.sunsynk_system_mode_grid_charge_time2` | Program 2 charge options (`on/off`, `1/0`, `No Grid or Gen`) | +| prog3_time: | Optional | `sensor.sunsynk_time_slot_3` | Program 3 start time (`HH:MM`) | +| prog3_capacity: | Optional | `number.sunsynk_system_mode_soc_time3` | Program 3 capacity (SOC) setting | +| prog3_charge: | Optional | `switch.sunsynk_system_mode_grid_charge_time3` | Program 3 charge options (`on/off`, `1/0`, `No Grid or Gen`) | +| prog4_time: | Optional | `sensor.sunsynk_time_slot_4` | Program 4 start time (`HH:MM`) | +| prog4_capacity: | Optional | `number.sunsynk_system_mode_soc_time4` | Program 4 capacity (SOC) setting | +| prog4_charge: | Optional | `switch.sunsynk_system_mode_grid_charge_time4` | Program 4 charge options (`on/off`, `1/0`, `No Grid or Gen`) | +| prog5_time: | Optional | `sensor.sunsynk_time_slot_5` | Program 5 start time (`HH:MM`) | +| prog5_capacity: | Optional | `number.sunsynk_system_mode_soc_time5` | Program 5 capacity (SOC) setting | +| prog5_charge: | Optional | `switch.sunsynk_system_mode_grid_charge_time5` | Program 5 charge options (`on/off`, `1/0`, `No Grid or Gen`) | +| prog6_time: | Optional | `sensor.sunsynk_time_slot_6` | Program 6 start time (`HH:MM`) | +| prog6_capacity: | Optional | `number.sunsynk_system_mode_soc_time6` | Program 6 capacity (SOC) setting | +| prog6_charge: | Optional | `switch.sunsynk_system_mode_grid_charge_time6` | Program 6 charge options (`on/off`, `1/0`, `No Grid or Gen`) | +| energy_cost_buy: | Optional | | Sensor that provides current buy energy cost per kWh | +| energy_cost_sell: | Optional | | Sensor that provides current sell energy cost per kWh | +| grid_voltage: | Optional | `sensor.solis_grid_voltage` | Sensor providing grid voltage (v). Used only when inverter model is set to `solis` | +| battery_current_direction: | Optional | `sensor.solis_battery_current_direction` | Used only when inverter model is set to `solis` (`0`, `1`) | +| prepaid_units: | Optional | | Account balance of prepaid electricity units | +| max_sell_power: | Optional | `number.sunsynk_max_sell_power` | Sets the maximum allowed output power to flow to the grid. Also known as "Export Control User Limit" (W) | The card calculates the sensors below based on supplied attributes in the config so you dont need to define them in Home Assistant. NOTE if your essential and non-essential readings are innacurate replace sensor 169 with 167. Alternatively @@ -321,7 +355,7 @@ provide the card with sensors that calculate this data i.e essential_power: and If `three_phase:false` ``` - totalsolar = pv1_power_186 + pv2_power_187 + pv3_power_188 + pv4_power_189 + totalsolar = pv1_power_186 + pv2_power_187 + pv3_power_188 + pv4_power_189 + pv5_power nonessential = grid_ct_power_172 - grid_power_169 essential = inverter_power_175 + grid_power_169 - aux_power_166 ``` @@ -329,11 +363,7 @@ If `three_phase:false` If `three_phase:true` ``` - totalsolar = pv1_power_186 + pv2_power_187 + pv3_power_188 + pv4_power_189 + totalsolar = pv1_power_186 + pv2_power_187 + pv3_power_188 + pv4_power_189 + pv5_power nonessential = grid_ct_power_172 + grid_ct_power_L2 + grid_ct_power_L3 - grid_power_169 essential = load_power_L1 + load_power_L2 + load_power_L3 ``` - -The modbus registers can be visualised on the `full` card below: - -![image](https://user-images.githubusercontent.com/7227275/235479493-b322d5b2-f2b1-431f-9048-f845fc2989b4.png) diff --git a/package.json b/package.json index fdc56f0..f924d5a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mlk-power-flow-card", - "version": "0.1.0", + "version": "0.1.1", "description": "A customizable Home Assistant card to emulate the Sunsynk System flow that's displayed on the Inverter screen.", "main": "mlk-power-flow-card.js", "scripts": { diff --git a/src/editor.ts b/src/editor.ts index 032810b..cf704d8 100644 --- a/src/editor.ts +++ b/src/editor.ts @@ -297,31 +297,32 @@ export class SunSynkCardEditor extends LitElement implements LovelaceCardEditor name: 'entities', type: 'grid', schema: [ + { name: 'pv_total', selector: { entity: { device_class: SensorDeviceClass.POWER } } }, { name: 'day_pv_energy_108', selector: { entity: { device_class: SensorDeviceClass.ENERGY } } }, { name: 'monthly_pv_generation', selector: { entity: { device_class: SensorDeviceClass.ENERGY } } }, { name: 'yearly_pv_generation', selector: { entity: { device_class: SensorDeviceClass.ENERGY } } }, { name: 'total_pv_generation', selector: { entity: { device_class: SensorDeviceClass.ENERGY } } }, + { name: 'remaining_solar', selector: { entity: { device_class: SensorDeviceClass.ENERGY } } }, { name: 'pv1_power_186', selector: { entity: { device_class: SensorDeviceClass.POWER } } }, { name: 'pv1_production', selector: { entity: { device_class: SensorDeviceClass.ENERGY } } }, - { name: 'pv2_power_187', selector: { entity: { device_class: SensorDeviceClass.POWER } } }, - { name: 'pv2_production', selector: { entity: { device_class: SensorDeviceClass.ENERGY } } }, - { name: 'pv3_power_188', selector: { entity: { device_class: SensorDeviceClass.POWER } } }, - { name: 'pv3_production', selector: { entity: { device_class: SensorDeviceClass.ENERGY } } }, - { name: 'pv4_power_189', selector: { entity: { device_class: SensorDeviceClass.POWER } } }, - { name: 'pv5_power', selector: { entity: { device_class: SensorDeviceClass.POWER } } }, - { name: 'pv4_production', selector: { entity: { device_class: SensorDeviceClass.ENERGY } } }, - { name: 'pv5_production', selector: { entity: { device_class: SensorDeviceClass.ENERGY } } }, { name: 'pv1_voltage_109', selector: { entity: { device_class: SensorDeviceClass.VOLTAGE } } }, { name: 'pv1_current_110', selector: { entity: { device_class: SensorDeviceClass.CURRENT } } }, + { name: 'pv2_power_187', selector: { entity: { device_class: SensorDeviceClass.POWER } } }, + { name: 'pv2_production', selector: { entity: { device_class: SensorDeviceClass.ENERGY } } }, { name: 'pv2_voltage_111', selector: { entity: { device_class: SensorDeviceClass.VOLTAGE } } }, { name: 'pv2_current_112', selector: { entity: { device_class: SensorDeviceClass.CURRENT } } }, + { name: 'pv3_power_188', selector: { entity: { device_class: SensorDeviceClass.POWER } } }, + { name: 'pv3_production', selector: { entity: { device_class: SensorDeviceClass.ENERGY } } }, { name: 'pv3_voltage_113', selector: { entity: { device_class: SensorDeviceClass.VOLTAGE } } }, { name: 'pv3_current_114', selector: { entity: { device_class: SensorDeviceClass.CURRENT } } }, + { name: 'pv4_power_189', selector: { entity: { device_class: SensorDeviceClass.POWER } } }, + { name: 'pv4_production', selector: { entity: { device_class: SensorDeviceClass.ENERGY } } }, { name: 'pv4_voltage_115', selector: { entity: { device_class: SensorDeviceClass.VOLTAGE } } }, { name: 'pv4_current_116', selector: { entity: { device_class: SensorDeviceClass.CURRENT } } }, + { name: 'pv5_power', selector: { entity: { device_class: SensorDeviceClass.POWER } } }, + { name: 'pv5_production', selector: { entity: { device_class: SensorDeviceClass.ENERGY } } }, { name: 'pv5_voltage', selector: { entity: { device_class: SensorDeviceClass.VOLTAGE } } }, { name: 'pv5_current', selector: { entity: { device_class: SensorDeviceClass.CURRENT } } }, - { name: 'pv_total', selector: { entity: { device_class: SensorDeviceClass.POWER } } }, { name: 'solar_sell_247', selector: { entity: {} } }, { name: 'environment_temp', selector: { entity: { device_class: SensorDeviceClass.TEMPERATURE } } }, ],