diff --git a/lib/SvelteUi/app/dist/index.js b/lib/SvelteUi/app/dist/index.js index 299ecc8f..10981ee5 100644 --- a/lib/SvelteUi/app/dist/index.js +++ b/lib/SvelteUi/app/dist/index.js @@ -1,7 +1,7 @@ -(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const f of o.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&n(f)}).observe(document,{childList:!0,subtree:!0});function l(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerpolicy&&(o.referrerPolicy=i.referrerpolicy),i.crossorigin==="use-credentials"?o.credentials="include":i.crossorigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function n(i){if(i.ep)return;i.ep=!0;const o=l(i);fetch(i.href,o)}})();function ze(){}function pn(e,t){for(const l in t)e[l]=t[l];return e}function Xd(e){return e()}function zm(){return Object.create(null)}function Et(e){e.forEach(Xd)}function cf(e){return typeof e=="function"}function ct(e,t){return e!=e?t==t:e!==t||e&&typeof e=="object"||typeof e=="function"}let Io;function yo(e,t){return Io||(Io=document.createElement("a")),Io.href=t,e===Io.href}function Yv(e){return Object.keys(e).length===0}function _f(e,...t){if(e==null)return ze;const l=e.subscribe(...t);return l.unsubscribe?()=>l.unsubscribe():l}function ss(e){let t;return _f(e,l=>t=l)(),t}function Nn(e,t,l){e.$$.on_destroy.push(_f(t,l))}function mf(e,t,l,n){if(e){const i=Zd(e,t,l,n);return e[0](i)}}function Zd(e,t,l,n){return e[1]&&n?pn(l.ctx.slice(),e[1](n(t))):l.ctx}function pf(e,t,l,n){if(e[2]&&n){const i=e[2](n(l));if(t.dirty===void 0)return i;if(typeof i=="object"){const o=[],f=Math.max(t.dirty.length,i.length);for(let r=0;r32){const t=[],l=e.ctx.length/32;for(let n=0;ne.removeEventListener(t,l,n)}function fs(e){return function(t){return t.preventDefault(),e.call(this,t)}}function u(e,t,l){l==null?e.removeAttribute(t):e.getAttribute(t)!==l&&e.setAttribute(t,l)}const Xv=["width","height"];function os(e,t){const l=Object.getOwnPropertyDescriptors(e.__proto__);for(const n in t)t[n]==null?e.removeAttribute(n):n==="style"?e.style.cssText=t[n]:n==="__value"?e.value=e[n]=t[n]:l[n]&&l[n].set&&Xv.indexOf(n)===-1?e[n]=t[n]:u(e,n,t[n])}function Xe(e){return e===""?null:+e}function Zv(e){return Array.from(e.childNodes)}function C(e,t){t=""+t,e.data!==t&&(e.data=t)}function Jv(e,t){t=""+t,e.wholeText!==t&&(e.data=t)}function $v(e,t,l){~Qv.indexOf(l)?Jv(e,t):C(e,t)}function be(e,t){e.value=t==null?"":t}function mn(e,t,l,n){l==null?e.style.removeProperty(t):e.style.setProperty(t,l,n?"important":"")}function Ze(e,t,l){for(let n=0;n{f.source===n.contentWindow&&t()})):(n.src="about:blank",n.onload=()=>{o=re(n.contentWindow,"resize",t),t()}),s(e,n),()=>{(i||o&&n.contentWindow)&&o(),T(n)}}function eh(e,t,{bubbles:l=!1,cancelable:n=!1}={}){const i=document.createEvent("CustomEvent");return i.initCustomEvent(e,l,n,t),i}function Wm(e,t){return new e(t)}let Ls;function Os(e){Ls=e}function Bs(){if(!Ls)throw new Error("Function called outside component initialization");return Ls}function Jd(e){Bs().$$.on_mount.push(e)}function th(e){Bs().$$.on_destroy.push(e)}function lh(){const e=Bs();return(t,l,{cancelable:n=!1}={})=>{const i=e.$$.callbacks[t];if(i){const o=eh(t,l,{cancelable:n});return i.slice().forEach(f=>{f.call(e,o)}),!o.defaultPrevented}return!0}}function Is(e,t){return Bs().$$.context.set(e,t),t}function xn(e){return Bs().$$.context.get(e)}const ls=[],Go=[];let ns=[];const Gm=[],$d=Promise.resolve();let Xa=!1;function xd(){Xa||(Xa=!0,$d.then(ev))}function nh(){return xd(),$d}function Ct(e){ns.push(e)}const za=new Set;let xi=0;function ev(){if(xi!==0)return;const e=Ls;do{try{for(;xie.indexOf(n)===-1?t.push(n):l.push(n)),l.forEach(n=>n()),ns=t}const Uo=new Set;let pi;function pt(){pi={r:0,c:[],p:pi}}function dt(){pi.r||Et(pi.c),pi=pi.p}function Q(e,t){e&&e.i&&(Uo.delete(e),e.i(t))}function ee(e,t,l,n){if(e&&e.o){if(Uo.has(e))return;Uo.add(e),pi.c.push(()=>{Uo.delete(e),n&&(l&&e.d(1),n())}),e.o(t)}else n&&n()}function tv(e,t){const l={},n={},i={$$scope:1};let o=e.length;for(;o--;){const f=e[o],r=t[o];if(r){for(const c in f)c in r||(n[c]=1);for(const c in r)i[c]||(l[c]=r[c],i[c]=1);e[o]=r}else for(const c in f)i[c]=1}for(const f in n)f in l||(l[f]=void 0);return l}function Vm(e){return typeof e=="object"&&e!==null?e:{}}function Ne(e){e&&e.c()}function Se(e,t,l,n){const{fragment:i,after_update:o}=e.$$;i&&i.m(t,l),n||Ct(()=>{const f=e.$$.on_mount.map(Xd).filter(cf);e.$$.on_destroy?e.$$.on_destroy.push(...f):Et(f),e.$$.on_mount=[]}),o.forEach(Ct)}function Ce(e,t){const l=e.$$;l.fragment!==null&&(sh(l.after_update),Et(l.on_destroy),l.fragment&&l.fragment.d(t),l.on_destroy=l.fragment=null,l.ctx=[])}function oh(e,t){e.$$.dirty[0]===-1&&(ls.push(e),xd(),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<{const h=d.length?d[0]:v;return a.ctx&&i(a.ctx[p],a.ctx[p]=h)&&(!a.skip_bound&&a.bound[p]&&a.bound[p](h),_&&oh(e,p)),v}):[],a.update(),_=!0,Et(a.before_update),a.fragment=n?n(a.ctx):!1,t.target){if(t.hydrate){const p=Zv(t.target);a.fragment&&a.fragment.l(p),p.forEach(T)}else a.fragment&&a.fragment.c();t.intro&&Q(e.$$.fragment),Se(e,t.target,t.anchor,t.customElement),ev()}Os(c)}class mt{$destroy(){Ce(this,1),this.$destroy=ze}$on(t,l){if(!cf(l))return ze;const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(l),()=>{const i=n.indexOf(l);i!==-1&&n.splice(i,1)}}$set(t){this.$$set&&!Yv(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const Km=e=>typeof e>"u",lv=e=>typeof e=="function",nv=e=>typeof e=="number";function ah(e){return!e.defaultPrevented&&e.button===0&&!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function iv(){let e=0;return()=>e++}function fh(){return Math.random().toString(36).substring(2)}const ei=typeof window>"u";function sv(e,t,l){return e.addEventListener(t,l),()=>e.removeEventListener(t,l)}const ov=(e,t)=>e?{}:{style:t},Za=e=>({"aria-hidden":"true",...ov(e,"display:none;")}),es=[];function av(e,t){return{subscribe:xt(e,t).subscribe}}function xt(e,t=ze){let l;const n=new Set;function i(r){if(ct(e,r)&&(e=r,l)){const c=!es.length;for(const a of n)a[1](),es.push(a,e);if(c){for(let a=0;a{n.delete(a),n.size===0&&l&&(l(),l=null)}}return{set:i,update:o,subscribe:f}}function uh(e,t,l){const n=!Array.isArray(e),i=n?[e]:e,o=t.length<2;return av(l,f=>{let r=!1;const c=[];let a=0,_=ze;const p=()=>{if(a)return;_();const d=t(n?c[0]:c,f);o?f(d):_=cf(d)?d:ze},v=i.map((d,h)=>_f(d,g=>{c[h]=g,a&=~(1<{a|=1<`@@svnav-ctx__${e}`,Ja=Us("LOCATION"),as=Us("ROUTER"),fv=Us("ROUTE"),rh=Us("ROUTE_PARAMS"),ch=Us("FOCUS_ELEM"),uv=/^:(.+)/,As=(e,t,l)=>e.substr(t,l),$a=(e,t)=>As(e,0,t.length)===t,_h=e=>e==="",mh=e=>uv.test(e),rv=e=>e[0]==="*",ph=e=>e.replace(/\*.*$/,""),cv=e=>e.replace(/(^\/+|\/+$)/g,"");function Pn(e,t=!1){const l=cv(e).split("/");return t?l.filter(Boolean):l}const Wa=(e,t)=>e+(t?`?${t}`:""),bf=e=>`/${cv(e)}`;function js(...e){const t=n=>Pn(n,!0).join("/"),l=e.map(t).join("/");return bf(l)}const gf=1,Qo=2,ki=3,dh=4,_v=5,vh=6,mv=7,hh=8,bh=9,pv=10,dv=11,gh={[gf]:"Link",[Qo]:"Route",[ki]:"Router",[dh]:"useFocus",[_v]:"useLocation",[vh]:"useMatch",[mv]:"useNavigate",[hh]:"useParams",[bh]:"useResolvable",[pv]:"useResolve",[dv]:"navigate"},kf=e=>gh[e];function kh(e,t){let l;return e===Qo?l=t.path?`path="${t.path}"`:"default":e===gf?l=`to="${t.to}"`:e===ki&&(l=`basepath="${t.basepath||""}"`),`<${kf(e)} ${l||""} />`}function wh(e,t,l,n){const i=l&&kh(n||e,l),o=i?` +(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const f of o.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&n(f)}).observe(document,{childList:!0,subtree:!0});function l(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerpolicy&&(o.referrerPolicy=i.referrerpolicy),i.crossorigin==="use-credentials"?o.credentials="include":i.crossorigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function n(i){if(i.ep)return;i.ep=!0;const o=l(i);fetch(i.href,o)}})();function ze(){}function pn(e,t){for(const l in t)e[l]=t[l];return e}function Qd(e){return e()}function z_(){return Object.create(null)}function Et(e){e.forEach(Qd)}function cf(e){return typeof e=="function"}function ct(e,t){return e!=e?t==t:e!==t||e&&typeof e=="object"||typeof e=="function"}let Io;function yo(e,t){return Io||(Io=document.createElement("a")),Io.href=t,e===Io.href}function Kv(e){return Object.keys(e).length===0}function mf(e,...t){if(e==null)return ze;const l=e.subscribe(...t);return l.unsubscribe?()=>l.unsubscribe():l}function ss(e){let t;return mf(e,l=>t=l)(),t}function Nn(e,t,l){e.$$.on_destroy.push(mf(t,l))}function _f(e,t,l,n){if(e){const i=Xd(e,t,l,n);return e[0](i)}}function Xd(e,t,l,n){return e[1]&&n?pn(l.ctx.slice(),e[1](n(t))):l.ctx}function pf(e,t,l,n){if(e[2]&&n){const i=e[2](n(l));if(t.dirty===void 0)return i;if(typeof i=="object"){const o=[],f=Math.max(t.dirty.length,i.length);for(let r=0;r32){const t=[],l=e.ctx.length/32;for(let n=0;ne.removeEventListener(t,l,n)}function fs(e){return function(t){return t.preventDefault(),e.call(this,t)}}function u(e,t,l){l==null?e.removeAttribute(t):e.getAttribute(t)!==l&&e.setAttribute(t,l)}const Qv=["width","height"];function os(e,t){const l=Object.getOwnPropertyDescriptors(e.__proto__);for(const n in t)t[n]==null?e.removeAttribute(n):n==="style"?e.style.cssText=t[n]:n==="__value"?e.value=e[n]=t[n]:l[n]&&l[n].set&&Qv.indexOf(n)===-1?e[n]=t[n]:u(e,n,t[n])}function Xe(e){return e===""?null:+e}function Xv(e){return Array.from(e.childNodes)}function C(e,t){t=""+t,e.data!==t&&(e.data=t)}function Zv(e,t){t=""+t,e.wholeText!==t&&(e.data=t)}function Jv(e,t,l){~Yv.indexOf(l)?Zv(e,t):C(e,t)}function be(e,t){e.value=t==null?"":t}function _n(e,t,l,n){l==null?e.style.removeProperty(t):e.style.setProperty(t,l,n?"important":"")}function Ze(e,t,l){for(let n=0;n{f.source===n.contentWindow&&t()})):(n.src="about:blank",n.onload=()=>{o=re(n.contentWindow,"resize",t),t()}),s(e,n),()=>{(i||o&&n.contentWindow)&&o(),T(n)}}function xv(e,t,{bubbles:l=!1,cancelable:n=!1}={}){const i=document.createEvent("CustomEvent");return i.initCustomEvent(e,l,n,t),i}function W_(e,t){return new e(t)}let Ls;function Os(e){Ls=e}function Bs(){if(!Ls)throw new Error("Function called outside component initialization");return Ls}function Zd(e){Bs().$$.on_mount.push(e)}function eh(e){Bs().$$.on_destroy.push(e)}function th(){const e=Bs();return(t,l,{cancelable:n=!1}={})=>{const i=e.$$.callbacks[t];if(i){const o=xv(t,l,{cancelable:n});return i.slice().forEach(f=>{f.call(e,o)}),!o.defaultPrevented}return!0}}function Is(e,t){return Bs().$$.context.set(e,t),t}function xn(e){return Bs().$$.context.get(e)}const ls=[],Go=[];let ns=[];const G_=[],Jd=Promise.resolve();let Xa=!1;function $d(){Xa||(Xa=!0,Jd.then(xd))}function lh(){return $d(),Jd}function Ct(e){ns.push(e)}const za=new Set;let xi=0;function xd(){if(xi!==0)return;const e=Ls;do{try{for(;xie.indexOf(n)===-1?t.push(n):l.push(n)),l.forEach(n=>n()),ns=t}const Uo=new Set;let pi;function pt(){pi={r:0,c:[],p:pi}}function dt(){pi.r||Et(pi.c),pi=pi.p}function Q(e,t){e&&e.i&&(Uo.delete(e),e.i(t))}function ee(e,t,l,n){if(e&&e.o){if(Uo.has(e))return;Uo.add(e),pi.c.push(()=>{Uo.delete(e),n&&(l&&e.d(1),n())}),e.o(t)}else n&&n()}function ev(e,t){const l={},n={},i={$$scope:1};let o=e.length;for(;o--;){const f=e[o],r=t[o];if(r){for(const c in f)c in r||(n[c]=1);for(const c in r)i[c]||(l[c]=r[c],i[c]=1);e[o]=r}else for(const c in f)i[c]=1}for(const f in n)f in l||(l[f]=void 0);return l}function V_(e){return typeof e=="object"&&e!==null?e:{}}function Ne(e){e&&e.c()}function Se(e,t,l,n){const{fragment:i,after_update:o}=e.$$;i&&i.m(t,l),n||Ct(()=>{const f=e.$$.on_mount.map(Qd).filter(cf);e.$$.on_destroy?e.$$.on_destroy.push(...f):Et(f),e.$$.on_mount=[]}),o.forEach(Ct)}function Ce(e,t){const l=e.$$;l.fragment!==null&&(ih(l.after_update),Et(l.on_destroy),l.fragment&&l.fragment.d(t),l.on_destroy=l.fragment=null,l.ctx=[])}function sh(e,t){e.$$.dirty[0]===-1&&(ls.push(e),$d(),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<{const h=d.length?d[0]:v;return a.ctx&&i(a.ctx[p],a.ctx[p]=h)&&(!a.skip_bound&&a.bound[p]&&a.bound[p](h),m&&sh(e,p)),v}):[],a.update(),m=!0,Et(a.before_update),a.fragment=n?n(a.ctx):!1,t.target){if(t.hydrate){const p=Xv(t.target);a.fragment&&a.fragment.l(p),p.forEach(T)}else a.fragment&&a.fragment.c();t.intro&&Q(e.$$.fragment),Se(e,t.target,t.anchor,t.customElement),xd()}Os(c)}class _t{$destroy(){Ce(this,1),this.$destroy=ze}$on(t,l){if(!cf(l))return ze;const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(l),()=>{const i=n.indexOf(l);i!==-1&&n.splice(i,1)}}$set(t){this.$$set&&!Kv(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const K_=e=>typeof e>"u",tv=e=>typeof e=="function",lv=e=>typeof e=="number";function oh(e){return!e.defaultPrevented&&e.button===0&&!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function nv(){let e=0;return()=>e++}function ah(){return Math.random().toString(36).substring(2)}const ei=typeof window>"u";function iv(e,t,l){return e.addEventListener(t,l),()=>e.removeEventListener(t,l)}const sv=(e,t)=>e?{}:{style:t},Za=e=>({"aria-hidden":"true",...sv(e,"display:none;")}),es=[];function ov(e,t){return{subscribe:xt(e,t).subscribe}}function xt(e,t=ze){let l;const n=new Set;function i(r){if(ct(e,r)&&(e=r,l)){const c=!es.length;for(const a of n)a[1](),es.push(a,e);if(c){for(let a=0;a{n.delete(a),n.size===0&&l&&(l(),l=null)}}return{set:i,update:o,subscribe:f}}function fh(e,t,l){const n=!Array.isArray(e),i=n?[e]:e,o=t.length<2;return ov(l,f=>{let r=!1;const c=[];let a=0,m=ze;const p=()=>{if(a)return;m();const d=t(n?c[0]:c,f);o?f(d):m=cf(d)?d:ze},v=i.map((d,h)=>mf(d,g=>{c[h]=g,a&=~(1<{a|=1<`@@svnav-ctx__${e}`,Ja=Us("LOCATION"),as=Us("ROUTER"),av=Us("ROUTE"),uh=Us("ROUTE_PARAMS"),rh=Us("FOCUS_ELEM"),fv=/^:(.+)/,As=(e,t,l)=>e.substr(t,l),$a=(e,t)=>As(e,0,t.length)===t,ch=e=>e==="",mh=e=>fv.test(e),uv=e=>e[0]==="*",_h=e=>e.replace(/\*.*$/,""),rv=e=>e.replace(/(^\/+|\/+$)/g,"");function Pn(e,t=!1){const l=rv(e).split("/");return t?l.filter(Boolean):l}const Wa=(e,t)=>e+(t?`?${t}`:""),bf=e=>`/${rv(e)}`;function js(...e){const t=n=>Pn(n,!0).join("/"),l=e.map(t).join("/");return bf(l)}const gf=1,Qo=2,ki=3,ph=4,cv=5,dh=6,mv=7,vh=8,hh=9,_v=10,pv=11,bh={[gf]:"Link",[Qo]:"Route",[ki]:"Router",[ph]:"useFocus",[cv]:"useLocation",[dh]:"useMatch",[mv]:"useNavigate",[vh]:"useParams",[hh]:"useResolvable",[_v]:"useResolve",[pv]:"navigate"},kf=e=>bh[e];function gh(e,t){let l;return e===Qo?l=t.path?`path="${t.path}"`:"default":e===gf?l=`to="${t.to}"`:e===ki&&(l=`basepath="${t.basepath||""}"`),`<${kf(e)} ${l||""} />`}function kh(e,t,l,n){const i=l&&gh(n||e,l),o=i?` -Occurred in: ${i}`:"",f=kf(e),r=lv(t)?t(f):t;return`<${f}> ${r}${o}`}const vv=e=>(...t)=>e(wh(...t)),hv=vv(e=>{throw new Error(e)}),Vo=vv(console.warn),Ym=4,Mh=3,Sh=2,Ch=1,Nh=1;function Th(e,t){const l=e.default?0:Pn(e.fullPath).reduce((n,i)=>{let o=n;return o+=Ym,_h(i)?o+=Nh:mh(i)?o+=Sh:rv(i)?o-=Ym+Ch:o+=Mh,o},0);return{route:e,score:l,index:t}}function Ph(e){return e.map(Th).sort((t,l)=>t.scorel.score?-1:t.index-l.index)}function bv(e,t){let l,n;const[i]=t.split("?"),o=Pn(i),f=o[0]==="",r=Ph(e);for(let c=0,a=r.length;c({..._,params:v,uri:A});if(_.default){n=d(t);continue}const h=Pn(_.fullPath),g=Math.max(o.length,h.length);let M=0;for(;M{a===".."?c.pop():a!=="."&&c.push(a)}),Wa(`/${c.join("/")}`,n)}function Qm(e,t){const{pathname:l,hash:n="",search:i="",state:o}=e,f=Pn(t,!0),r=Pn(l,!0);for(;f.length;)f[0]!==r[0]&&hv(ki,`Invalid state: All locations must begin with the basepath "${t}", found "${l}"`),f.shift(),r.shift();return{pathname:js(...r),hash:n,search:i,state:o}}const Xm=e=>e.length===1?"":e,wf=e=>{const t=e.indexOf("?"),l=e.indexOf("#"),n=t!==-1,i=l!==-1,o=i?Xm(As(e,l)):"",f=i?As(e,0,l):e,r=n?Xm(As(f,t)):"";return{pathname:(n?As(f,0,t):f)||"/",search:r,hash:o}},Ah=e=>{const{pathname:t,search:l,hash:n}=e;return t+l+n};function Dh(e,t,l){return js(l,Eh(e,t))}function qh(e,t){const l=bf(ph(e)),n=Pn(l,!0),i=Pn(t,!0).slice(0,n.length),o=gv({fullPath:l},js(...i));return o&&o.uri}const Ga="POP",Oh="PUSH",Ih="REPLACE";function Va(e){return{...e.location,pathname:encodeURI(decodeURI(e.location.pathname)),state:e.history.state,_key:e.history.state&&e.history.state._key||"initial"}}function Lh(e){let t=[],l=Va(e),n=Ga;const i=(o=t)=>o.forEach(f=>f({location:l,action:n}));return{get location(){return l},listen(o){t.push(o);const f=()=>{l=Va(e),n=Ga,i([o])};i([o]);const r=sv(e,"popstate",f);return()=>{r(),t=t.filter(c=>c!==o)}},navigate(o,f){const{state:r={},replace:c=!1}=f||{};if(n=c?Ih:Oh,nv(o))f&&Vo(dv,"Navigation options (state or replace) are not supported, when passing a number as the first argument to navigate. They are ignored."),n=Ga,e.history.go(o);else{const a={...r,_key:fh()};try{e.history[c?"replaceState":"pushState"](a,"",o)}catch{e.location[c?"replace":"assign"](o)}}l=Va(e),i()}}}function Ka(e,t){return{...wf(t),state:e}}function Rh(e="/"){let t=0,l=[Ka(null,e)];return{get entries(){return l},get location(){return l[t]},addEventListener(){},removeEventListener(){},history:{get state(){return l[t].state},pushState(n,i,o){t++,l=l.slice(0,t),l.push(Ka(n,o))},replaceState(n,i,o){l[t]=Ka(n,o)},go(n){const i=t+n;i<0||i>l.length-1||(t=i)}}}}const Fh=!!(!ei&&window.document&&window.document.createElement),Bh=!ei&&window.location.origin==="null",kv=Lh(Fh&&!Bh?window:Rh()),{navigate:gi}=kv;let yn=null,wv=!0;function Uh(e,t){const l=document.querySelectorAll("[data-svnav-router]");for(let n=0;nyn.level||e.level===yn.level&&Uh(e.routerId,yn.routerId))&&(yn=e)}function Hh(){yn=null}function yh(){wv=!1}function Zm(e){if(!e)return!1;const t="tabindex";try{if(!e.hasAttribute(t)){e.setAttribute(t,"-1");let l;l=sv(e,"blur",()=>{e.removeAttribute(t),l()})}return e.focus(),document.activeElement===e}catch{return!1}}function zh(e,t){return Number(e.dataset.svnavRouteEnd)===t}function Wh(e){return/^H[1-6]$/i.test(e.tagName)}function Jm(e,t=document){return t.querySelector(e)}function Gh(e){let l=Jm(`[data-svnav-route-start="${e}"]`).nextElementSibling;for(;!zh(l,e);){if(Wh(l))return l;const n=Jm("h1,h2,h3,h4,h5,h6",l);if(n)return n;l=l.nextElementSibling}return null}function Vh(e){Promise.resolve(ss(e.focusElement)).then(t=>{const l=t||Gh(e.id);l||Vo(ki,`Could not find an element to focus. You should always render a header for accessibility reasons, or set a custom focus element via the "useFocus" hook. If you don't want this Route or Router to manage focus, pass "primary={false}" to it.`,e,Qo),!Zm(l)&&Zm(document.documentElement)})}const Kh=(e,t,l)=>(n,i)=>nh().then(()=>{if(!yn||wv){yh();return}if(n&&Vh(yn.route),e.announcements&&i){const{path:o,fullPath:f,meta:r,params:c,uri:a}=yn.route,_=e.createAnnouncement({path:o,fullPath:f,meta:r,params:c,uri:a},ss(l));Promise.resolve(_).then(p=>{t.set(p)})}Hh()}),Yh="position:fixed;top:-1px;left:0;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;";function Qh(e){let t,l,n=[{role:"status"},{"aria-atomic":"true"},{"aria-live":"polite"},{"data-svnav-announcer":""},ov(e[6],Yh)],i={};for(let o=0;o`Navigated to ${ie.uri}`,announcements:!0,...h},A=_,I=bf(_),O=xn(Ja),L=xn(as),q=!O,U=Zh(),E=d&&!(L&&!L.manageFocus),F=xt("");Nn(e,F,ie=>l(0,r=ie));const z=L?L.disableInlineStyles:g,G=xt([]);Nn(e,G,ie=>l(20,f=ie));const B=xt(null);Nn(e,B,ie=>l(18,i=ie));let R=!1;const K=q?0:L.level+1,H=q?xt((()=>Qm(ei?wf(p):v.location,I))()):O;Nn(e,H,ie=>l(17,n=ie));const Y=xt(n);Nn(e,Y,ie=>l(19,o=ie));const X=Kh(M,F,H),J=ie=>oe=>oe.filter(ae=>ae.id!==ie);function $(ie){if(ei){if(R)return;const oe=gv(ie,n.pathname);if(oe)return R=!0,oe}else G.update(oe=>{const ae=J(ie.id)(oe);return ae.push(ie),ae})}function ce(ie){G.update(J(ie))}return!q&&_!==$m&&Vo(ki,'Only top-level Routers can have a "basepath" prop. It is ignored.',{basepath:_}),q&&(Jd(()=>v.listen(oe=>{const ae=Qm(oe.location,I);Y.set(n),H.set(ae)})),Is(Ja,H)),Is(as,{activeRoute:B,registerRoute:$,unregisterRoute:ce,manageFocus:E,level:K,id:U,history:q?v:L.history,basepath:q?I:L.basepath,disableInlineStyles:z}),e.$$set=ie=>{"basepath"in ie&&l(11,_=ie.basepath),"url"in ie&&l(12,p=ie.url),"history"in ie&&l(13,v=ie.history),"primary"in ie&&l(14,d=ie.primary),"a11y"in ie&&l(15,h=ie.a11y),"disableInlineStyles"in ie&&l(16,g=ie.disableInlineStyles),"$$scope"in ie&&l(21,a=ie.$$scope)},e.$$.update=()=>{if(e.$$.dirty[0]&2048&&_!==A&&Vo(ki,'You cannot change the "basepath" prop. It is ignored.'),e.$$.dirty[0]&1179648){const ie=bv(f,n.pathname);B.set(ie)}if(e.$$.dirty[0]&655360&&q){const ie=!!n.hash,oe=!ie&&E,ae=!ie||n.pathname!==o.pathname;X(oe,ae)}e.$$.dirty[0]&262144&&E&&i&&i.primary&&jh({level:K,routerId:U,route:i})},[r,M,q,U,E,F,z,G,B,H,Y,_,p,v,d,h,g,n,i,o,f,a,c]}class $h extends mt{constructor(t){super(),_t(this,t,Jh,Xh,ct,{basepath:11,url:12,history:13,primary:14,a11y:15,disableInlineStyles:16},null,[-1,-1])}}const Mv=$h;function Hs(e,t,l=as,n=ki){xn(l)||hv(e,o=>`You cannot use ${o} outside of a ${kf(n)}.`,t)}const xh=e=>{const{subscribe:t}=xn(e);return{subscribe:t}};function Sv(){return Hs(_v),xh(Ja)}function Cv(){const{history:e}=xn(as);return e}function Nv(){const e=xn(fv);return e?uh(e,t=>t.base):xt("/")}function Tv(){Hs(pv);const e=Nv(),{basepath:t}=xn(as);return n=>Dh(n,ss(e),t)}function eb(){Hs(mv);const e=Tv(),{navigate:t}=Cv();return(n,i)=>{const o=nv(n)?n:e(n);return t(o,i)}}const tb=e=>({params:e&16,location:e&8}),xm=e=>({params:ei?ss(e[10]):e[4],location:e[3],navigate:e[11]});function ep(e){let t,l;return t=new Mv({props:{primary:e[1],$$slots:{default:[ib]},$$scope:{ctx:e}}}),{c(){Ne(t.$$.fragment)},m(n,i){Se(t,n,i),l=!0},p(n,i){const o={};i&2&&(o.primary=n[1]),i&528409&&(o.$$scope={dirty:i,ctx:n}),t.$set(o)},i(n){l||(Q(t.$$.fragment,n),l=!0)},o(n){ee(t.$$.fragment,n),l=!1},d(n){Ce(t,n)}}}function lb(e){let t;const l=e[18].default,n=mf(l,e,e[19],xm);return{c(){n&&n.c()},m(i,o){n&&n.m(i,o),t=!0},p(i,o){n&&n.p&&(!t||o&524312)&&df(n,l,i,i[19],t?pf(l,i[19],o,tb):vf(i[19]),xm)},i(i){t||(Q(n,i),t=!0)},o(i){ee(n,i),t=!1},d(i){n&&n.d(i)}}}function nb(e){let t,l,n;const i=[{location:e[3]},{navigate:e[11]},ei?ss(e[10]):e[4],e[12]];var o=e[0];function f(r){let c={};for(let a=0;a{Ce(_,1)}),dt()}o?(t=Wm(o,f()),Ne(t.$$.fragment),Q(t.$$.fragment,1),Se(t,l.parentNode,l)):t=null}else o&&t.$set(a)},i(r){n||(t&&Q(t.$$.fragment,r),n=!0)},o(r){t&&ee(t.$$.fragment,r),n=!1},d(r){r&&T(l),t&&Ce(t,r)}}}function ib(e){let t,l,n,i;const o=[nb,lb],f=[];function r(c,a){return c[0]!==null?0:1}return t=r(e),l=f[t]=o[t](e),{c(){l.c(),n=Ut()},m(c,a){f[t].m(c,a),P(c,n,a),i=!0},p(c,a){let _=t;t=r(c),t===_?f[t].p(c,a):(pt(),ee(f[_],1,1,()=>{f[_]=null}),dt(),l=f[t],l?l.p(c,a):(l=f[t]=o[t](c),l.c()),Q(l,1),l.m(n.parentNode,n))},i(c){i||(Q(l),i=!0)},o(c){ee(l),i=!1},d(c){f[t].d(c),c&&T(n)}}}function sb(e){let t,l,n,i,o,f=[Za(e[7]),{"data-svnav-route-start":e[5]}],r={};for(let p=0;p{c=null}),dt())},i(p){o||(Q(c),o=!0)},o(p){ee(c),o=!1},d(p){p&&T(t),p&&T(l),c&&c.d(p),p&&T(n),p&&T(i)}}}const ob=iv();function ab(e,t,l){let n;const i=["path","component","meta","primary"];let o=Wo(t,i),f,r,c,a,{$$slots:_={},$$scope:p}=t,{path:v=""}=t,{component:d=null}=t,{meta:h={}}=t,{primary:g=!0}=t;Hs(Qo,t);const M=ob(),{registerRoute:A,unregisterRoute:I,activeRoute:O,disableInlineStyles:L}=xn(as);Nn(e,O,R=>l(16,f=R));const q=Nv();Nn(e,q,R=>l(17,c=R));const U=Sv();Nn(e,U,R=>l(3,r=R));const E=xt(null);let F;const z=xt(),G=xt({});Nn(e,G,R=>l(4,a=R)),Is(fv,z),Is(rh,G),Is(ch,E);const B=eb();return ei||th(()=>I(M)),e.$$set=R=>{l(24,t=pn(pn({},t),zo(R))),l(12,o=Wo(t,i)),"path"in R&&l(13,v=R.path),"component"in R&&l(0,d=R.component),"meta"in R&&l(14,h=R.meta),"primary"in R&&l(1,g=R.primary),"$$scope"in R&&l(19,p=R.$$scope)},e.$$.update=()=>{if(e.$$.dirty&155658){const R=v==="",K=js(c,v),y={id:M,path:v,meta:h,default:R,fullPath:R?"":K,base:R?c:qh(K,r.pathname),primary:g,focusElement:E};z.set(y),l(15,F=A(y))}if(e.$$.dirty&98304&&l(2,n=!!(F||f&&f.id===M)),e.$$.dirty&98308&&n){const{params:R}=F||f;G.set(R)}},t=zo(t),[d,g,n,r,a,M,O,L,q,U,G,B,o,v,h,F,f,c,_,p]}class fb extends mt{constructor(t){super(),_t(this,t,ab,sb,ct,{path:13,component:0,meta:14,primary:1})}}const Cn=fb;function ub(e){let t,l,n,i;const o=e[13].default,f=mf(o,e,e[12],null);let r=[{href:e[0]},e[2],e[1]],c={};for(let a=0;al(11,p=E));const O=lh(),L=Tv(),{navigate:q}=Cv();function U(E){O("click",E),ah(E)&&(E.preventDefault(),q(n,{state:M,replace:f||g}))}return e.$$set=E=>{l(19,t=pn(pn({},t),zo(E))),l(18,_=Wo(t,a)),"to"in E&&l(5,h=E.to),"replace"in E&&l(6,g=E.replace),"state"in E&&l(7,M=E.state),"getProps"in E&&l(8,A=E.getProps),"$$scope"in E&&l(12,d=E.$$scope)},e.$$.update=()=>{e.$$.dirty&2080&&l(0,n=L(h,p)),e.$$.dirty&2049&&l(10,i=$a(p.pathname,n)),e.$$.dirty&2049&&l(9,o=n===p.pathname),e.$$.dirty&2049&&(f=wf(n)===Ah(p)),e.$$.dirty&512&&l(2,r=o?{"aria-current":"page"}:{}),l(1,c=(()=>{if(lv(A)){const E=A({location:p,href:n,isPartiallyCurrent:i,isCurrent:o});return{..._,...E}}return _})())},t=zo(t),[n,c,r,I,U,h,g,M,A,o,i,p,d,v]}class cb extends mt{constructor(t){super(),_t(this,t,rb,ub,ct,{to:5,replace:6,state:7,getProps:8})}}const ln=cb;function $n(e){return e===1?"green":e===2?"yellow":e===3?"red":"gray"}function _b(e,t){return e>218&&e<242?"#23ac05":e>212&&e<248?"#b1d900":e>208&&e<252?"#a3b200":"#b20000"}function Mf(e,t){let l;return e>90?l="#b20000":e>85?l="#b19601":e>80?l="#a3b200":e>75?l="#569f12":l="#23ac05",l}function Rs(e){return e>75?"#23ac05":e>50?"#77d900":e>25?"#94d900":"#569f12"}function Ko(e){switch(e){case 1:return"Aidon";case 2:return"Kaifa";case 3:return"Kamstrup";case 8:return"Iskra";case 9:return"Landis+Gyr";case 10:return"Sagemcom";default:return"Unknown"}}function ht(e){for(e=e.toString();e.length<2;)e="0"+e;return e}function Ge(e,t){switch(t){case 5:switch(e){case"esp8266":return"Pow-K (GPIO12)";case"esp32s2":return"Pow-K+"}case 7:switch(e){case"esp8266":return"Pow-U (GPIO12)";case"esp32s2":return"Pow-U+"}case 6:return"Pow-P1";case 51:return"Wemos S2 mini";case 50:return"Generic ESP32-S2";case 201:return"Wemos LOLIN D32";case 202:return"Adafruit HUZZAH32";case 203:return"DevKitC";case 241:return"LilyGO T-ETH-POE";case 242:return"M5 PoESP32";case 243:return"WT32-ETH01";case 200:return"Generic ESP32";case 2:return"HAN Reader 2.0 by Max Spencer";case 0:return"Custom hardware by Roar Fredriksen";case 1:return"Kamstrup module by Egil Opsahl";case 8:return"\xB5HAN mosquito by dbeinder";case 3:return"Pow-K (UART0)";case 4:return"Pow-U (UART0)";case 101:return"Wemos D1 mini";case 100:return"Generic ESP8266";case 70:return"Generic ESP32-C3";case 71:return"ESP32-C3-DevKitM-1";case 80:return"Generic ESP32-S3"}}function is(e){switch(e){case 2:case 4:case 7:return!0}return!1}function Ot(e,t){return e==1||e==2&&t}function zl(e){return"https://github.com/UtilitechAS/amsreader-firmware/wiki/"+e}function Bt(e,t){return isNaN(e)?"-":(isNaN(t)&&(t=e<1?2:e<10?1:0),e.toFixed(t))}function Tn(e,t){return e.setTime(e.getTime()+t*36e5),e}function tp(e){return e=="EOE"?"ENTSO-E":e=="HKS"?"hvakosterstrommen.no":e=="EDS"?"Energi Data Service":e=="MIX"?"Mixed sources":"Unknown ("+e+")"}function lp(e){return e=="EOE"?"https://transparency.entsoe.eu/-E":e=="HKS"?"https://www.hvakosterstrommen.no/":e=="EDS"?"https://www.energidataservice.dk/":"#"}let Ro=0;function Fs(e,t){var l="";Ro++;var n=function(){setTimeout(Fs,1e3,e,t)};if(e.net.ip&&Ro%3==0){if(!e.net.ip){n();return}l="http://"+e.net.ip}else e.hostname&&Ro%3==1?l="http://"+e.hostname:e.hostname&&Ro%3==2?l="http://"+e.hostname+".local":l="";console&&console.log("Trying url "+l),t&&t(l);var i=new XMLHttpRequest;i.timeout=5e3,i.addEventListener("abort",n),i.addEventListener("error",n),i.addEventListener("timeout",n),i.addEventListener("load",function(o){window.location.href=l||"/"}),i.open("GET",l+"/is-alive",!0),i.send()}function Vt(e){return e.charAt(0).toUpperCase()+e.slice(1)}function np(e){return e.startsWith("esp32")?"esp32":e}function gl(e,t){let l=[e,t];return typeof e>"u"?(l[0]="-",l[1]=t):e>=1e9?(l[0]=(e/1e6).toFixed(e>1e10?0:1),l[1]="M"+t):e>1e5?(l[0]=(e/1e3).toFixed(e>1e6?0:e>1e5?1:2),l[1]="k"+t):(l[0]=e.toFixed(0),l[1]=t),l}let jo={},xa=[];async function mb(e,t={}){const{timeout:l=8e3}=t,n=new AbortController,i=setTimeout(()=>n.abort(),l),o=await fetch(e,{...t,signal:n.signal});return clearTimeout(i),o}let Ya;async function Pv(){if(xa.length){let e=xa.shift();delete jo[e.resource];let t=await mb(e.resource,e.options);for(let l in e.callbacks)e.callbacks[l](t)}Ya&&clearTimeout(Ya),Ya=setTimeout(Pv,100)}Pv();async function dn(e,t={}){let l;return jo[e]?l=jo[e]:(l={resource:e,options:t,callbacks:[]},jo[e]=l,xa.push(l)),new Promise(i=>l.callbacks.push(i))}let _n={version:"",chip:"",mac:null,apmac:null,vndcfg:null,usrcfg:null,fwconsent:null,booting:!1,upgrading:!1,ui:{},security:0,boot_reason:0,upgrade:{x:-1,e:0,f:null,t:null},trying:null,if:{eth:!1}};const wl=xt(_n);async function Sf(){_n=await(await dn("sysinfo.json?t="+Math.floor(Date.now()/1e3))).json(),wl.set(_n)}function pb(e){wl.update(t=>(t.trying=e,t))}let Fo=0,ip=-127,sp=null,db={};const Ev=av(db,e=>{let t,l;async function n(){dn("data.json").then(i=>i.json()).then(i=>{e(i),ip!=i.t&&(ip=i.t,setTimeout(Iv,2e3)),sp==null&&i.pe&&i.p!=null&&(sp=i.p,Dv()),_n.upgrading?window.location.reload():(!_n||!_n.chip||_n.booting||Fo>1&&!is(_n.board))&&(Sf(),di&&clearTimeout(di),di=setTimeout(Nf,2e3),vi&&clearTimeout(vi),vi=setTimeout(Tf,3e3));let o=5e3;if(is(_n.board)&&i.v>2.5){let f=3.3-Math.min(3.3,i.v);f>0&&(o=Math.max(f,.1)*10*5e3)}o>5e3&&console.log("Next in "+o+"ms"),t&&clearTimeout(t),t=setTimeout(n,o),Fo=0}).catch(i=>{Fo++,Fo>3?(e({em:3,hm:0,wm:0,mm:0}),t=setTimeout(n,15e3),l||(l=setTimeout(Fs,5e3,_n,pb))):t=setTimeout(n,is(_n.board)?1e4:5e3)})}return n(),function(){clearTimeout(t)}});let ef={},Ds;const Cf=xt(ef);async function Av(){let e=!1;if(Cf.update(t=>{for(var l=0;l<36;l++){if(t[ht(l)]==null){e=l<12;break}t[ht(l)]=t[ht(l+1)]}return t}),e)Dv();else{let t=new Date;Ds=setTimeout(Av,(60-t.getMinutes())*6e4)}}async function Dv(){Ds&&(clearTimeout(Ds),Ds=0),ef=await(await dn("energyprice.json")).json(),Cf.set(ef);let t=new Date;Ds=setTimeout(Av,(60-t.getMinutes())*6e4)}let tf={},di;async function Nf(){di&&(clearTimeout(di),di=0),tf=await(await dn("dayplot.json")).json(),qv.set(tf);let t=new Date;di=setTimeout(Nf,(60-t.getMinutes())*6e4+20)}const qv=xt(tf,e=>(Nf(),function(){}));let lf={},vi;async function Tf(){vi&&(clearTimeout(vi),vi=0),lf=await(await dn("monthplot.json")).json(),Ov.set(lf);let t=new Date;vi=setTimeout(Tf,(24-t.getHours())*36e5+40)}const Ov=xt(lf,e=>(Tf(),function(){}));let nf={};async function Iv(){nf=await(await dn("temperature.json")).json(),Lv.set(nf)}const Lv=xt(nf,e=>(Iv(),function(){}));let sf={},Bo;async function Rv(){Bo&&(clearTimeout(Bo),Bo=0),sf=await(await dn("tariff.json")).json(),Fv.set(sf);let t=new Date;Bo=setTimeout(Rv,(60-t.getMinutes())*6e4+30)}const Fv=xt(sf,e=>function(){});let of=[];const Pf=xt(of);async function vb(){of=await(await dn("https://api.github.com/repos/UtilitechAS/amsreader-firmware/releases")).json(),Pf.set(of)}let ts=0,hb={data:[]};async function Ho(){let t=await(await dn(ts<0?"realtime.json":"realtime.json?offset="+ts)).json();Bv.update(l=>{for(let n=0;n=0&&(ts+=t.size,tso&&(r=p):g==i+1&&(c=p);else if(h==n+1)if(a){let A=a.tag_name.substring(1).split(".");parseInt(A[0]);let I=parseInt(A[1]);parseInt(A[2]),g==I&&(a=p)}else a=p}return c||a||r||!1}else return t[0]}function ap(e){var c,a;let t=((a=(c=e[1].header)==null?void 0:c.uptime)!=null?a:"Up")+"",l,n,i;function o(_,p){return _[2]>1?Cb:_[2]>0?Sb:_[3]>1?Mb:_[3]>0?wb:_[4]>1?kb:_[4]>0?gb:bb}let f=o(e),r=f(e);return{c(){l=k(t),n=b(),r.c(),i=Ut()},m(_,p){P(_,l,p),P(_,n,p),r.m(_,p),P(_,i,p)},p(_,p){var v,d;p&2&&t!==(t=((d=(v=_[1].header)==null?void 0:v.uptime)!=null?d:"Up")+"")&&C(l,t),f===(f=o(_))&&r?r.p(_,p):(r.d(1),r=f(_),r&&(r.c(),r.m(i.parentNode,i)))},d(_){_&&T(l),_&&T(n),r.d(_),_&&T(i)}}}function bb(e){var o,f;let t,l,n=((f=(o=e[1].common)==null?void 0:o.seconds)!=null?f:"s")+"",i;return{c(){t=k(e[0]),l=b(),i=k(n)},m(r,c){P(r,t,c),P(r,l,c),P(r,i,c)},p(r,c){var a,_;c&1&&C(t,r[0]),c&2&&n!==(n=((_=(a=r[1].common)==null?void 0:a.seconds)!=null?_:"s")+"")&&C(i,n)},d(r){r&&T(t),r&&T(l),r&&T(i)}}}function gb(e){var o,f;let t,l,n=((f=(o=e[1].common)==null?void 0:o.minute)!=null?f:"m")+"",i;return{c(){t=k(e[4]),l=b(),i=k(n)},m(r,c){P(r,t,c),P(r,l,c),P(r,i,c)},p(r,c){var a,_;c&16&&C(t,r[4]),c&2&&n!==(n=((_=(a=r[1].common)==null?void 0:a.minute)!=null?_:"m")+"")&&C(i,n)},d(r){r&&T(t),r&&T(l),r&&T(i)}}}function kb(e){var o,f;let t,l,n=((f=(o=e[1].common)==null?void 0:o.minutes)!=null?f:"m")+"",i;return{c(){t=k(e[4]),l=b(),i=k(n)},m(r,c){P(r,t,c),P(r,l,c),P(r,i,c)},p(r,c){var a,_;c&16&&C(t,r[4]),c&2&&n!==(n=((_=(a=r[1].common)==null?void 0:a.minutes)!=null?_:"m")+"")&&C(i,n)},d(r){r&&T(t),r&&T(l),r&&T(i)}}}function wb(e){var o,f;let t,l,n=((f=(o=e[1].common)==null?void 0:o.hour)!=null?f:"h")+"",i;return{c(){t=k(e[3]),l=b(),i=k(n)},m(r,c){P(r,t,c),P(r,l,c),P(r,i,c)},p(r,c){var a,_;c&8&&C(t,r[3]),c&2&&n!==(n=((_=(a=r[1].common)==null?void 0:a.hour)!=null?_:"h")+"")&&C(i,n)},d(r){r&&T(t),r&&T(l),r&&T(i)}}}function Mb(e){var o,f;let t,l,n=((f=(o=e[1].common)==null?void 0:o.hours)!=null?f:"h")+"",i;return{c(){t=k(e[3]),l=b(),i=k(n)},m(r,c){P(r,t,c),P(r,l,c),P(r,i,c)},p(r,c){var a,_;c&8&&C(t,r[3]),c&2&&n!==(n=((_=(a=r[1].common)==null?void 0:a.hours)!=null?_:"h")+"")&&C(i,n)},d(r){r&&T(t),r&&T(l),r&&T(i)}}}function Sb(e){var o,f;let t,l,n=((f=(o=e[1].common)==null?void 0:o.day)!=null?f:"d")+"",i;return{c(){t=k(e[2]),l=b(),i=k(n)},m(r,c){P(r,t,c),P(r,l,c),P(r,i,c)},p(r,c){var a,_;c&4&&C(t,r[2]),c&2&&n!==(n=((_=(a=r[1].common)==null?void 0:a.day)!=null?_:"d")+"")&&C(i,n)},d(r){r&&T(t),r&&T(l),r&&T(i)}}}function Cb(e){var o,f;let t,l,n=((f=(o=e[1].common)==null?void 0:o.days)!=null?f:"d")+"",i;return{c(){t=k(e[2]),l=b(),i=k(n)},m(r,c){P(r,t,c),P(r,l,c),P(r,i,c)},p(r,c){var a,_;c&4&&C(t,r[2]),c&2&&n!==(n=((_=(a=r[1].common)==null?void 0:a.days)!=null?_:"d")+"")&&C(i,n)},d(r){r&&T(t),r&&T(l),r&&T(i)}}}function Nb(e){let t,l=e[0]&&ap(e);return{c(){l&&l.c(),t=Ut()},m(n,i){l&&l.m(n,i),P(n,t,i)},p(n,[i]){n[0]?l?l.p(n,i):(l=ap(n),l.c(),l.m(t.parentNode,t)):l&&(l.d(1),l=null)},i:ze,o:ze,d(n){l&&l.d(n),n&&T(t)}}}function Tb(e,t,l){let{epoch:n}=t,i={};Ml.subscribe(c=>{l(1,i=c)});let o=0,f=0,r=0;return e.$$set=c=>{"epoch"in c&&l(0,n=c.epoch)},e.$$.update=()=>{e.$$.dirty&1&&(l(2,o=Math.floor(n/86400)),l(3,f=Math.floor(n/3600)),l(4,r=Math.floor(n/60)))},[n,i,o,f,r]}class Pb extends mt{constructor(t){super(),_t(this,t,Tb,Nb,ct,{epoch:0})}}function Eb(e){let t,l,n;return{c(){t=m("span"),l=k(e[2]),u(t,"title",e[1]),u(t,"class",n="bd-"+e[0])},m(i,o){P(i,t,o),s(t,l)},p(i,[o]){o&4&&C(l,i[2]),o&2&&u(t,"title",i[1]),o&1&&n!==(n="bd-"+i[0])&&u(t,"class",n)},i:ze,o:ze,d(i){i&&T(t)}}}function Ab(e,t,l){let{color:n}=t,{title:i}=t,{text:o}=t;return e.$$set=f=>{"color"in f&&l(0,n=f.color),"title"in f&&l(1,i=f.title),"text"in f&&l(2,o=f.text)},[n,i,o]}class hi extends mt{constructor(t){super(),_t(this,t,Ab,Eb,ct,{color:0,title:1,text:2})}}function Db(e){let t,l=`${ht(e[0].getDate())}.${ht(e[0].getMonth()+1)}.${e[0].getFullYear()} ${ht(e[0].getHours())}:${ht(e[0].getMinutes())}`,n;return{c(){t=m("span"),n=k(l),u(t,"class",e[1])},m(i,o){P(i,t,o),s(t,n)},p(i,o){o&1&&l!==(l=`${ht(i[0].getDate())}.${ht(i[0].getMonth()+1)}.${i[0].getFullYear()} ${ht(i[0].getHours())}:${ht(i[0].getMinutes())}`)&&C(n,l),o&2&&u(t,"class",i[1])},d(i){i&&T(t)}}}function qb(e){var n;let t=`${ht(e[0].getDate())}. ${e[2].months?(n=e[2].months)==null?void 0:n[e[0].getMonth()]:ht(e[0].getMonth())} ${ht(e[0].getHours())}:${ht(e[0].getMinutes())}`,l;return{c(){l=k(t)},m(i,o){P(i,l,o)},p(i,o){var f;o&5&&t!==(t=`${ht(i[0].getDate())}. ${i[2].months?(f=i[2].months)==null?void 0:f[i[0].getMonth()]:ht(i[0].getMonth())} ${ht(i[0].getHours())}:${ht(i[0].getMinutes())}`)&&C(l,t)},d(i){i&&T(l)}}}function Ob(e){let t;function l(o,f){return o[3]?qb:Db}let n=l(e),i=n(e);return{c(){i.c(),t=Ut()},m(o,f){i.m(o,f),P(o,t,f)},p(o,[f]){n===(n=l(o))&&i?i.p(o,f):(i.d(1),i=n(o),i&&(i.c(),i.m(t.parentNode,t)))},i:ze,o:ze,d(o){i.d(o),o&&T(t)}}}function Ib(e,t,l){let n={};Ml.subscribe(c=>{l(2,n=c)});let{timestamp:i}=t,{fullTimeColor:o}=t,{offset:f}=t,r;return e.$$set=c=>{"timestamp"in c&&l(0,i=c.timestamp),"fullTimeColor"in c&&l(1,o=c.fullTimeColor),"offset"in c&&l(4,f=c.offset)},e.$$.update=()=>{e.$$.dirty&17&&(l(3,r=Math.abs(new Date().getTime()-i.getTime())<3e5),isNaN(f)||Tn(i,f-(24+i.getHours()-i.getUTCHours())%24))},[i,o,n,r,f]}class yv extends mt{constructor(t){super(),_t(this,t,Ib,Ob,ct,{timestamp:0,fullTimeColor:1,offset:4})}}function Lb(e){let t,l,n;return{c(){t=bt("svg"),l=bt("path"),n=bt("path"),u(l,"stroke-linecap","round"),u(l,"stroke-linejoin","round"),u(l,"d","M10.343 3.94c.09-.542.56-.94 1.11-.94h1.093c.55 0 1.02.398 1.11.94l.149.894c.07.424.384.764.78.93.398.164.855.142 1.205-.108l.737-.527a1.125 1.125 0 011.45.12l.773.774c.39.389.44 1.002.12 1.45l-.527.737c-.25.35-.272.806-.107 1.204.165.397.505.71.93.78l.893.15c.543.09.94.56.94 1.109v1.094c0 .55-.397 1.02-.94 1.11l-.893.149c-.425.07-.765.383-.93.78-.165.398-.143.854.107 1.204l.527.738c.32.447.269 1.06-.12 1.45l-.774.773a1.125 1.125 0 01-1.449.12l-.738-.527c-.35-.25-.806-.272-1.203-.107-.397.165-.71.505-.781.929l-.149.894c-.09.542-.56.94-1.11.94h-1.094c-.55 0-1.019-.398-1.11-.94l-.148-.894c-.071-.424-.384-.764-.781-.93-.398-.164-.854-.142-1.204.108l-.738.527c-.447.32-1.06.269-1.45-.12l-.773-.774a1.125 1.125 0 01-.12-1.45l.527-.737c.25-.35.273-.806.108-1.204-.165-.397-.505-.71-.93-.78l-.894-.15c-.542-.09-.94-.56-.94-1.109v-1.094c0-.55.398-1.02.94-1.11l.894-.149c.424-.07.765-.383.93-.78.165-.398.143-.854-.107-1.204l-.527-.738a1.125 1.125 0 01.12-1.45l.773-.773a1.125 1.125 0 011.45-.12l.737.527c.35.25.807.272 1.204.107.397-.165.71-.505.78-.929l.15-.894z"),u(n,"stroke-linecap","round"),u(n,"stroke-linejoin","round"),u(n,"d","M15 12a3 3 0 11-6 0 3 3 0 016 0z"),u(t,"xmlns","http://www.w3.org/2000/svg"),u(t,"fill","none"),u(t,"viewBox","0 0 24 24"),u(t,"stroke-width","1.5"),u(t,"stroke","currentColor"),u(t,"class","w-6 h-6")},m(i,o){P(i,t,o),s(t,l),s(t,n)},p:ze,i:ze,o:ze,d(i){i&&T(t)}}}class Rb extends mt{constructor(t){super(),_t(this,t,null,Lb,ct,{})}}function Fb(e){let t,l;return{c(){t=bt("svg"),l=bt("path"),u(l,"stroke-linecap","round"),u(l,"stroke-linejoin","round"),u(l,"d","M11.25 11.25l.041-.02a.75.75 0 011.063.852l-.708 2.836a.75.75 0 001.063.853l.041-.021M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9-3.75h.008v.008H12V8.25z"),u(t,"xmlns","http://www.w3.org/2000/svg"),u(t,"fill","none"),u(t,"viewBox","0 0 24 24"),u(t,"stroke-width","1.5"),u(t,"stroke","currentColor"),u(t,"class","w-6 h-6")},m(n,i){P(n,t,i),s(t,l)},p:ze,i:ze,o:ze,d(n){n&&T(t)}}}class Bb extends mt{constructor(t){super(),_t(this,t,null,Fb,ct,{})}}function Ub(e){let t,l;return{c(){t=bt("svg"),l=bt("path"),u(l,"stroke-linecap","round"),u(l,"stroke-linejoin","round"),u(l,"d","M9.879 7.519c1.171-1.025 3.071-1.025 4.242 0 1.172 1.025 1.172 2.687 0 3.712-.203.179-.43.326-.67.442-.745.361-1.45.999-1.45 1.827v.75M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9 5.25h.008v.008H12v-.008z"),u(t,"xmlns","http://www.w3.org/2000/svg"),u(t,"fill","none"),u(t,"viewBox","0 0 24 24"),u(t,"stroke-width","1.5"),u(t,"stroke","currentColor"),u(t,"class","w-6 h-6")},m(n,i){P(n,t,i),s(t,l)},p:ze,i:ze,o:ze,d(n){n&&T(t)}}}class jb extends mt{constructor(t){super(),_t(this,t,null,Ub,ct,{})}}function Hb(e){let t,l,n=e[2].version+"",i;return{c(){t=k("AMS reader "),l=m("span"),i=k(n)},m(o,f){P(o,t,f),P(o,l,f),s(l,i)},p(o,f){f&4&&n!==(n=o[2].version+"")&&C(i,n)},d(o){o&&T(t),o&&T(l)}}}function fp(e){let t,l=(e[1].t>-50?e[1].t.toFixed(1):"-")+"",n,i;return{c(){t=m("div"),n=k(l),i=k("\xB0C"),u(t,"class","flex-none my-auto")},m(o,f){P(o,t,f),s(t,n),s(t,i)},p(o,f){f&2&&l!==(l=(o[1].t>-50?o[1].t.toFixed(1):"-")+"")&&C(n,l)},d(o){o&&T(t)}}}function up(e){var i,o,f,r,c;let t,l=((o=(i=e[4].header)==null?void 0:i.han)!=null?o:"HAN")+": "+((c=(r=(f=e[4].errors)==null?void 0:f.han)==null?void 0:r[e[1].he])!=null?c:e[1].he),n;return{c(){t=m("div"),n=k(l),u(t,"class","bd-red")},m(a,_){P(a,t,_),s(t,n)},p(a,_){var p,v,d,h,g;_&18&&l!==(l=((v=(p=a[4].header)==null?void 0:p.han)!=null?v:"HAN")+": "+((g=(h=(d=a[4].errors)==null?void 0:d.han)==null?void 0:h[a[1].he])!=null?g:a[1].he))&&C(n,l)},d(a){a&&T(t)}}}function rp(e){var i,o,f,r,c;let t,l=((o=(i=e[4].header)==null?void 0:i.mqtt)!=null?o:"MQTT")+": "+((c=(r=(f=e[4].errors)==null?void 0:f.mqtt)==null?void 0:r[e[1].me])!=null?c:e[1].me),n;return{c(){t=m("div"),n=k(l),u(t,"class","bd-red")},m(a,_){P(a,t,_),s(t,n)},p(a,_){var p,v,d,h,g;_&18&&l!==(l=((v=(p=a[4].header)==null?void 0:p.mqtt)!=null?v:"MQTT")+": "+((g=(h=(d=a[4].errors)==null?void 0:d.mqtt)==null?void 0:h[a[1].me])!=null?g:a[1].me))&&C(n,l)},d(a){a&&T(t)}}}function cp(e){var i,o,f,r,c;let t,l=((o=(i=e[4].header)==null?void 0:i.price)!=null?o:"PS")+": "+((c=(r=(f=e[4].errors)==null?void 0:f.price)==null?void 0:r[e[1].ee])!=null?c:e[1].ee),n;return{c(){t=m("div"),n=k(l),u(t,"class","bd-red")},m(a,_){P(a,t,_),s(t,n)},p(a,_){var p,v,d,h,g;_&18&&l!==(l=((v=(p=a[4].header)==null?void 0:p.price)!=null?v:"PS")+": "+((g=(h=(d=a[4].errors)==null?void 0:d.price)==null?void 0:h[a[1].ee])!=null?g:a[1].ee))&&C(n,l)},d(a){a&&T(t)}}}function _p(e){let t,l,n,i,o,f,r,c;return l=new ln({props:{to:"/configuration",$$slots:{default:[yb]},$$scope:{ctx:e}}}),f=new ln({props:{to:"/status",$$slots:{default:[zb]},$$scope:{ctx:e}}}),{c(){var a,_,p,v;t=m("div"),Ne(l.$$.fragment),i=b(),o=m("div"),Ne(f.$$.fragment),u(t,"class","flex-none px-1 mt-1"),mn(t,"font-size","18px"),mn(t,"font-weight","bold"),u(t,"title",n=(_=(a=e[4].header)==null?void 0:a.config)!=null?_:""),u(o,"class","flex-none px-1 mt-1"),mn(o,"font-size","18px"),mn(o,"font-weight","bold"),u(o,"title",r=(v=(p=e[4].header)==null?void 0:p.status)!=null?v:"")},m(a,_){P(a,t,_),Se(l,t,null),P(a,i,_),P(a,o,_),Se(f,o,null),c=!0},p(a,_){var d,h,g,M;const p={};_&64&&(p.$$scope={dirty:_,ctx:a}),l.$set(p),(!c||_&16&&n!==(n=(h=(d=a[4].header)==null?void 0:d.config)!=null?h:""))&&u(t,"title",n);const v={};_&64&&(v.$$scope={dirty:_,ctx:a}),f.$set(v),(!c||_&16&&r!==(r=(M=(g=a[4].header)==null?void 0:g.status)!=null?M:""))&&u(o,"title",r)},i(a){c||(Q(l.$$.fragment,a),Q(f.$$.fragment,a),c=!0)},o(a){ee(l.$$.fragment,a),ee(f.$$.fragment,a),c=!1},d(a){a&&T(t),Ce(l),a&&T(i),a&&T(o),Ce(f)}}}function yb(e){let t,l;return t=new Rb({}),{c(){Ne(t.$$.fragment)},m(n,i){Se(t,n,i),l=!0},i(n){l||(Q(t.$$.fragment,n),l=!0)},o(n){ee(t.$$.fragment,n),l=!1},d(n){Ce(t,n)}}}function zb(e){let t,l;return t=new Bb({}),{c(){Ne(t.$$.fragment)},m(n,i){Se(t,n,i),l=!0},i(n){l||(Q(t.$$.fragment,n),l=!0)},o(n){ee(t.$$.fragment,n),l=!1},d(n){Ce(t,n)}}}function mp(e){let t,l;function n(f,r){return f[2].security==0||f[1].a?Gb:Wb}let i=n(e),o=i(e);return{c(){var f,r;t=m("div"),o.c(),u(t,"class","flex-none mr-3 text-yellow-500"),u(t,"title",l=((r=(f=e[4].header)==null?void 0:f.new_version)!=null?r:"New version")+": "+e[3].tag_name)},m(f,r){P(f,t,r),o.m(t,null)},p(f,r){var c,a;i===(i=n(f))&&o?o.p(f,r):(o.d(1),o=i(f),o&&(o.c(),o.m(t,null))),r&24&&l!==(l=((a=(c=f[4].header)==null?void 0:c.new_version)!=null?a:"New version")+": "+f[3].tag_name)&&u(t,"title",l)},d(f){f&&T(t),o.d()}}}function Wb(e){var r,c;let t,l=((c=(r=e[4].header)==null?void 0:r.new_version)!=null?c:"New version")+"",n,i,o=e[3].tag_name+"",f;return{c(){t=m("span"),n=k(l),i=k(": "),f=k(o)},m(a,_){P(a,t,_),s(t,n),s(t,i),s(t,f)},p(a,_){var p,v;_&16&&l!==(l=((v=(p=a[4].header)==null?void 0:p.new_version)!=null?v:"New version")+"")&&C(n,l),_&8&&o!==(o=a[3].tag_name+"")&&C(f,o)},d(a){a&&T(t)}}}function Gb(e){var _,p;let t,l,n=((p=(_=e[4].header)==null?void 0:_.new_version)!=null?p:"New version")+"",i,o,f=e[3].tag_name+"",r,c,a;return{c(){t=m("button"),l=m("span"),i=k(n),o=k(": "),r=k(f),u(l,"class","mt-1"),u(t,"class","flex")},m(v,d){P(v,t,d),s(t,l),s(l,i),s(l,o),s(l,r),c||(a=re(t,"click",e[5]),c=!0)},p(v,d){var h,g;d&16&&n!==(n=((g=(h=v[4].header)==null?void 0:h.new_version)!=null?g:"New version")+"")&&C(i,n),d&8&&f!==(f=v[3].tag_name+"")&&C(r,f)},d(v){v&&T(t),c=!1,a()}}}function Vb(e){var te,le,fe,de,qe,Pe,we,Fe,Ae,ke,De,He,Oe,je,Qe,We,Je,$e,tt,Te;let t,l,n,i,o,f,r,c,a,_,p,v=((le=(te=e[4].header)==null?void 0:te.mem)!=null?le:"Free")+"",d,h,g=(e[1].m?(e[1].m/1e3).toFixed(1):"-")+"",M,A,I,O,L,q,U,E,F,z,G,B,R,K,y,H,Y,X,J,$,ce,ie,oe,ae,se,x,me,pe,V,Z,ge;i=new ln({props:{to:"/",$$slots:{default:[Hb]},$$scope:{ctx:e}}}),c=new Pb({props:{epoch:e[1].u}});let ve=e[1].t>-50&&fp(e);L=new hi({props:{title:(de=(fe=e[4].header)==null?void 0:fe.esp)!=null?de:"ESP",text:e[2].booting?(Pe=(qe=e[4].header)==null?void 0:qe.booting)!=null?Pe:"Booting":e[1].v>2?e[1].v.toFixed(2)+"V":(Fe=(we=e[4].header)==null?void 0:we.esp)!=null?Fe:"ESP",color:$n(e[2].booting?2:e[1].em)}}),U=new hi({props:{title:(ke=(Ae=e[4].header)==null?void 0:Ae.han)!=null?ke:"HAN",text:(He=(De=e[4].header)==null?void 0:De.han)!=null?He:"HAN",color:$n(e[2].booting?9:e[1].hm)}}),F=new hi({props:{title:(je=(Oe=e[4].header)==null?void 0:Oe.wifi)!=null?je:"WiFi",text:e[1].r?e[1].r.toFixed(0)+"dBm":(We=(Qe=e[4].header)==null?void 0:Qe.wifi)!=null?We:"WiFi",color:$n(e[2].booting?9:e[1].wm)}}),G=new hi({props:{title:($e=(Je=e[4].header)==null?void 0:Je.mqtt)!=null?$e:"MQTT",text:(Te=(tt=e[4].header)==null?void 0:tt.mqtt)!=null?Te:"MQTT",color:$n(e[2].booting?9:e[1].mm)}});let S=(e[1].he<0||e[1].he>0)&&up(e),w=e[1].me<0&&rp(e),N=(e[1].ee>0||e[1].ee<0)&&cp(e);oe=new yv({props:{timestamp:e[1].c?new Date(e[1].c*1e3):new Date(0),offset:e[2].clock_offset,fullTimeColor:"text-red-500"}});let D=e[2].vndcfg&&e[2].usrcfg&&_p(e);pe=new jb({});let j=e[2].fwconsent===1&&e[3]&&mp(e);return{c(){var ue,Ie;t=m("nav"),l=m("div"),n=m("div"),Ne(i.$$.fragment),o=b(),f=m("div"),r=m("div"),Ne(c.$$.fragment),a=b(),ve&&ve.c(),_=b(),p=m("div"),d=k(v),h=k(": "),M=k(g),A=k("kb"),I=b(),O=m("div"),Ne(L.$$.fragment),q=b(),Ne(U.$$.fragment),E=b(),Ne(F.$$.fragment),z=b(),Ne(G.$$.fragment),B=b(),S&&S.c(),R=b(),w&&w.c(),K=b(),N&&N.c(),y=b(),H=m("div"),Y=m("div"),X=m("a"),J=m("img"),ce=b(),ie=m("div"),Ne(oe.$$.fragment),ae=b(),D&&D.c(),se=b(),x=m("div"),me=m("a"),Ne(pe.$$.fragment),Z=b(),j&&j.c(),u(n,"class","flex text-lg text-gray-100 p-2"),u(r,"class","flex-none my-auto"),u(p,"class","flex-none my-auto"),u(f,"class","flex-none my-auto p-2 flex space-x-4"),u(O,"class","flex-auto flex-wrap my-auto justify-center p-2"),u(J,"class","logo"),yo(J.src,$=(e[0]+op).replace("//","/"))||u(J,"src",$),u(J,"alt","GitHub repo"),u(X,"class","float-right"),u(X,"href","https://github.com/UtilitechAS/amsreader-firmware"),u(X,"target","_blank"),u(X,"rel","noreferrer"),u(X,"aria-label","GitHub"),u(Y,"class","flex-none"),u(ie,"class","flex-none my-auto px-2"),u(me,"href",zl("")),u(me,"target","_blank"),u(me,"rel","noreferrer"),u(x,"class","flex-none px-1 mt-1"),mn(x,"font-size","18px"),mn(x,"font-weight","bold"),u(x,"title",V=(Ie=(ue=e[4].header)==null?void 0:ue.doc)!=null?Ie:""),u(H,"class","flex-auto p-2 flex flex-row-reverse flex-wrap"),u(l,"class","flex flex-wrap space-x-4 text-sm text-gray-300"),u(t,"class","hdr")},m(ue,Ie){P(ue,t,Ie),s(t,l),s(l,n),Se(i,n,null),s(l,o),s(l,f),s(f,r),Se(c,r,null),s(f,a),ve&&ve.m(f,null),s(f,_),s(f,p),s(p,d),s(p,h),s(p,M),s(p,A),s(l,I),s(l,O),Se(L,O,null),s(O,q),Se(U,O,null),s(O,E),Se(F,O,null),s(O,z),Se(G,O,null),s(l,B),S&&S.m(l,null),s(l,R),w&&w.m(l,null),s(l,K),N&&N.m(l,null),s(l,y),s(l,H),s(H,Y),s(Y,X),s(X,J),s(H,ce),s(H,ie),Se(oe,ie,null),s(H,ae),D&&D.m(H,null),s(H,se),s(H,x),s(x,me),Se(pe,me,null),s(H,Z),j&&j.m(H,null),ge=!0},p(ue,[Ie]){var gt,At,Pt,Be,ye,It,vt,nt,Tt,it,at,rt,jt,Lt,Ht,yt,Me,Ve,Rt,Gt,zt,Dt;const kt={};Ie&68&&(kt.$$scope={dirty:Ie,ctx:ue}),i.$set(kt);const lt={};Ie&2&&(lt.epoch=ue[1].u),c.$set(lt),ue[1].t>-50?ve?ve.p(ue,Ie):(ve=fp(ue),ve.c(),ve.m(f,_)):ve&&(ve.d(1),ve=null),(!ge||Ie&16)&&v!==(v=((At=(gt=ue[4].header)==null?void 0:gt.mem)!=null?At:"Free")+"")&&C(d,v),(!ge||Ie&2)&&g!==(g=(ue[1].m?(ue[1].m/1e3).toFixed(1):"-")+"")&&C(M,g);const wt={};Ie&16&&(wt.title=(Be=(Pt=ue[4].header)==null?void 0:Pt.esp)!=null?Be:"ESP"),Ie&22&&(wt.text=ue[2].booting?(It=(ye=ue[4].header)==null?void 0:ye.booting)!=null?It:"Booting":ue[1].v>2?ue[1].v.toFixed(2)+"V":(nt=(vt=ue[4].header)==null?void 0:vt.esp)!=null?nt:"ESP"),Ie&6&&(wt.color=$n(ue[2].booting?2:ue[1].em)),L.$set(wt);const st={};Ie&16&&(st.title=(it=(Tt=ue[4].header)==null?void 0:Tt.han)!=null?it:"HAN"),Ie&16&&(st.text=(rt=(at=ue[4].header)==null?void 0:at.han)!=null?rt:"HAN"),Ie&6&&(st.color=$n(ue[2].booting?9:ue[1].hm)),U.$set(st);const ot={};Ie&16&&(ot.title=(Lt=(jt=ue[4].header)==null?void 0:jt.wifi)!=null?Lt:"WiFi"),Ie&18&&(ot.text=ue[1].r?ue[1].r.toFixed(0)+"dBm":(yt=(Ht=ue[4].header)==null?void 0:Ht.wifi)!=null?yt:"WiFi"),Ie&6&&(ot.color=$n(ue[2].booting?9:ue[1].wm)),F.$set(ot);const xe={};Ie&16&&(xe.title=(Ve=(Me=ue[4].header)==null?void 0:Me.mqtt)!=null?Ve:"MQTT"),Ie&16&&(xe.text=(Gt=(Rt=ue[4].header)==null?void 0:Rt.mqtt)!=null?Gt:"MQTT"),Ie&6&&(xe.color=$n(ue[2].booting?9:ue[1].mm)),G.$set(xe),ue[1].he<0||ue[1].he>0?S?S.p(ue,Ie):(S=up(ue),S.c(),S.m(l,R)):S&&(S.d(1),S=null),ue[1].me<0?w?w.p(ue,Ie):(w=rp(ue),w.c(),w.m(l,K)):w&&(w.d(1),w=null),ue[1].ee>0||ue[1].ee<0?N?N.p(ue,Ie):(N=cp(ue),N.c(),N.m(l,y)):N&&(N.d(1),N=null),(!ge||Ie&1&&!yo(J.src,$=(ue[0]+op).replace("//","/")))&&u(J,"src",$);const Nt={};Ie&2&&(Nt.timestamp=ue[1].c?new Date(ue[1].c*1e3):new Date(0)),Ie&4&&(Nt.offset=ue[2].clock_offset),oe.$set(Nt),ue[2].vndcfg&&ue[2].usrcfg?D?(D.p(ue,Ie),Ie&4&&Q(D,1)):(D=_p(ue),D.c(),Q(D,1),D.m(H,se)):D&&(pt(),ee(D,1,1,()=>{D=null}),dt()),(!ge||Ie&16&&V!==(V=(Dt=(zt=ue[4].header)==null?void 0:zt.doc)!=null?Dt:""))&&u(x,"title",V),ue[2].fwconsent===1&&ue[3]?j?j.p(ue,Ie):(j=mp(ue),j.c(),j.m(H,null)):j&&(j.d(1),j=null)},i(ue){ge||(Q(i.$$.fragment,ue),Q(c.$$.fragment,ue),Q(L.$$.fragment,ue),Q(U.$$.fragment,ue),Q(F.$$.fragment,ue),Q(G.$$.fragment,ue),Q(oe.$$.fragment,ue),Q(D),Q(pe.$$.fragment,ue),ge=!0)},o(ue){ee(i.$$.fragment,ue),ee(c.$$.fragment,ue),ee(L.$$.fragment,ue),ee(U.$$.fragment,ue),ee(F.$$.fragment,ue),ee(G.$$.fragment,ue),ee(oe.$$.fragment,ue),ee(D),ee(pe.$$.fragment,ue),ge=!1},d(ue){ue&&T(t),Ce(i),Ce(c),ve&&ve.d(),Ce(L),Ce(U),Ce(F),Ce(G),S&&S.d(),w&&w.d(),N&&N.d(),Ce(oe),D&&D.d(),Ce(pe),j&&j.d()}}}function Kb(e,t,l){let{basepath:n="/"}=t,{data:i={}}=t,o={},f={};function r(){var a,_;confirm(((_=(a=c.header)==null?void 0:a.upgrade)!=null?_:"Upgrade to {0}?").replace("{0}",f.tag_name))&&(!is(o.board)||confirm(Yo(Ge(o.chip,o.board))))&&(wl.update(p=>(p.upgrading=!0,p)),jv(f.tag_name))}wl.subscribe(a=>{l(2,o=a),a.fwconsent===1&&vb()}),Pf.subscribe(a=>{l(3,f=Hv(o.version,a))});let c={};return Ml.subscribe(a=>{l(4,c=a)}),e.$$set=a=>{"basepath"in a&&l(0,n=a.basepath),"data"in a&&l(1,i=a.data)},[n,i,o,f,c,r]}class Yb extends mt{constructor(t){super(),_t(this,t,Kb,Vb,ct,{basepath:0,data:1})}}function Qb(e){let t,l,n,i;return{c(){t=bt("svg"),l=bt("path"),n=bt("path"),u(l,"d",Qa(150,150,115,210,510)),u(l,"stroke","rgba(128, 128, 128, 0.15)"),u(l,"fill","none"),u(l,"stroke-width","55"),u(n,"d",i=Qa(150,150,115,210,210+300*e[0]/100)),u(n,"stroke",e[1]),u(n,"fill","none"),u(n,"stroke-width","55"),u(t,"viewBox","0 0 300 300"),u(t,"xmlns","http://www.w3.org/2000/svg"),u(t,"height","100%")},m(o,f){P(o,t,f),s(t,l),s(t,n)},p(o,[f]){f&1&&i!==(i=Qa(150,150,115,210,210+300*o[0]/100))&&u(n,"d",i),f&2&&u(n,"stroke",o[1])},i:ze,o:ze,d(o){o&&T(t)}}}function pp(e,t,l,n){var i=(n-90)*Math.PI/180;return{x:e+l*Math.cos(i),y:t+l*Math.sin(i)}}function Qa(e,t,l,n,i){var o=pp(e,t,l,i),f=pp(e,t,l,n),r=i-n<=180?"0":"1",c=["M",o.x,o.y,"A",l,l,0,r,0,f.x,f.y].join(" ");return c}function Xb(e,t,l){let{pct:n=0}=t,{color:i="red"}=t;return e.$$set=o=>{"pct"in o&&l(0,n=o.pct),"color"in o&&l(1,i=o.color)},[n,i]}class Zb extends mt{constructor(t){super(),_t(this,t,Xb,Qb,ct,{pct:0,color:1})}}function dp(e){let t,l,n,i,o,f,r,c;return{c(){t=m("br"),l=b(),n=m("span"),i=k(e[1]),o=b(),f=m("span"),r=k(e[2]),c=k("/kWh"),u(n,"class","pl-sub"),u(f,"class","pl-snt")},m(a,_){P(a,t,_),P(a,l,_),P(a,n,_),s(n,i),P(a,o,_),P(a,f,_),s(f,r),s(f,c)},p(a,_){_&2&&C(i,a[1]),_&4&&C(r,a[2])},d(a){a&&T(t),a&&T(l),a&&T(n),a&&T(o),a&&T(f)}}}function Jb(e){let t,l,n,i,o,f,r,c,a,_,p=e[4][0]+"",v,d,h,g=e[4][1]+"",M,A,I;l=new Zb({props:{pct:e[5],color:e[3](e[5],document.documentElement.classList.contains("dark"))}});let O=e[1]&&dp(e);return{c(){t=m("div"),Ne(l.$$.fragment),n=b(),i=m("span"),o=m("span"),f=k(e[0]),r=b(),c=m("br"),a=b(),_=m("span"),v=k(p),d=b(),h=m("span"),M=k(g),A=b(),O&&O.c(),u(o,"class","pl-lab"),u(_,"class","pl-val"),u(h,"class","pl-unt"),u(i,"class","pl-ov"),u(t,"class","pl-root")},m(L,q){P(L,t,q),Se(l,t,null),s(t,n),s(t,i),s(i,o),s(o,f),s(i,r),s(i,c),s(i,a),s(i,_),s(_,v),s(i,d),s(i,h),s(h,M),s(i,A),O&&O.m(i,null),I=!0},p(L,[q]){const U={};q&32&&(U.pct=L[5]),q&40&&(U.color=L[3](L[5],document.documentElement.classList.contains("dark"))),l.$set(U),(!I||q&1)&&C(f,L[0]),(!I||q&16)&&p!==(p=L[4][0]+"")&&C(v,p),(!I||q&16)&&g!==(g=L[4][1]+"")&&C(M,g),L[1]?O?O.p(L,q):(O=dp(L),O.c(),O.m(i,null)):O&&(O.d(1),O=null)},i(L){I||(Q(l.$$.fragment,L),I=!0)},o(L){ee(l.$$.fragment,L),I=!1},d(L){L&&T(t),Ce(l),O&&O.d()}}}function $b(e,t,l){let{val:n}=t,{max:i}=t,{unit:o}=t,{label:f}=t,{sub:r=""}=t,{subunit:c=""}=t,{colorFn:a}=t,_,p=0;return e.$$set=v=>{"val"in v&&l(6,n=v.val),"max"in v&&l(7,i=v.max),"unit"in v&&l(8,o=v.unit),"label"in v&&l(0,f=v.label),"sub"in v&&l(1,r=v.sub),"subunit"in v&&l(2,c=v.subunit),"colorFn"in v&&l(3,a=v.colorFn)},e.$$.update=()=>{e.$$.dirty&448&&(l(4,_=gl(n,o)),l(5,p=Math.min(n,i)/i*100))},[f,r,c,a,_,p,n,i,o]}class zv extends mt{constructor(t){super(),_t(this,t,$b,Jb,ct,{val:6,max:7,unit:8,label:0,sub:1,subunit:2,colorFn:3})}}function vp(e,t,l){const n=e.slice();return n[11]=t[l],n[13]=l,n}function hp(e,t,l){const n=e.slice();return n[11]=t[l],n[13]=l,n}function bp(e,t,l){const n=e.slice();return n[15]=t[l],n}function gp(e){let t,l,n,i,o,f,r=e[0].title&&kp(e),c=e[0].y.ticks,a=[];for(let h=0;he[9].call(t))},m(o,f){P(o,t,f),s(t,n),i=hf(t,e[9].bind(t))},p(o,f){f&1&&l!==(l=o[0].title+"")&&C(n,l)},d(o){o&&T(t),i()}}}function wp(e){let t,l,n,i=e[15].label+"",o,f,r,c;return{c(){t=bt("g"),l=bt("line"),n=bt("text"),o=k(i),u(l,"x2","100%"),u(n,"y","-4"),u(n,"x",f=e[15].align=="right"?"85%":""),u(t,"class",r="tick tick-"+e[15].value+" tick-"+e[15].color),u(t,"transform",c="translate(0, "+e[7](e[15].value)+")")},m(a,_){P(a,t,_),s(t,l),s(t,n),s(n,o)},p(a,_){_&1&&i!==(i=a[15].label+"")&&C(o,i),_&1&&f!==(f=a[15].align=="right"?"85%":"")&&u(n,"x",f),_&1&&r!==(r="tick tick-"+a[15].value+" tick-"+a[15].color)&&u(t,"class",r),_&129&&c!==(c="translate(0, "+a[7](a[15].value)+")")&&u(t,"transform",c)},d(a){a&&T(t)}}}function Mp(e){let t=!isNaN(e[7](e[15].value)),l,n=t&&wp(e);return{c(){n&&n.c(),l=Ut()},m(i,o){n&&n.m(i,o),P(i,l,o)},p(i,o){o&129&&(t=!isNaN(i[7](i[15].value))),t?n?n.p(i,o):(n=wp(i),n.c(),n.m(l.parentNode,l)):n&&(n.d(1),n=null)},d(i){n&&n.d(i),i&&T(l)}}}function Sp(e){let t,l,n=(e[3]>20||e[13]%2==0)&&Cp(e);return{c(){t=bt("g"),n&&n.c(),u(t,"class","tick"),u(t,"transform",l="translate("+e[6](e[13])+","+e[4]+")")},m(i,o){P(i,t,o),n&&n.m(t,null)},p(i,o){i[3]>20||i[13]%2==0?n?n.p(i,o):(n=Cp(i),n.c(),n.m(t,null)):n&&(n.d(1),n=null),o&80&&l!==(l="translate("+i[6](i[13])+","+i[4]+")")&&u(t,"transform",l)},d(i){i&&T(t),n&&n.d()}}}function Cp(e){let t,l=e[11].label+"",n,i;return{c(){t=bt("text"),n=k(l),u(t,"x",i=e[3]/2),u(t,"y","-4")},m(o,f){P(o,t,f),s(t,n)},p(o,f){f&1&&l!==(l=o[11].label+"")&&C(n,l),f&8&&i!==(i=o[3]/2)&&u(t,"x",i)},d(o){o&&T(t)}}}function Np(e){let t=!isNaN(e[6](e[13])),l,n=t&&Sp(e);return{c(){n&&n.c(),l=Ut()},m(i,o){n&&n.m(i,o),P(i,l,o)},p(i,o){o&64&&(t=!isNaN(i[6](i[13]))),t?n?n.p(i,o):(n=Sp(i),n.c(),n.m(l.parentNode,l)):n&&(n.d(1),n=null)},d(i){n&&n.d(i),i&&T(l)}}}function Tp(e){let t,l,n=e[11].value!==void 0&&Pp(e),i=e[11].value2>1e-4&&Dp(e);return{c(){t=bt("g"),n&&n.c(),l=bt("g"),i&&i.c()},m(o,f){P(o,t,f),n&&n.m(t,null),P(o,l,f),i&&i.m(l,null)},p(o,f){o[11].value!==void 0?n?n.p(o,f):(n=Pp(o),n.c(),n.m(t,null)):n&&(n.d(1),n=null),o[11].value2>1e-4?i?i.p(o,f):(i=Dp(o),i.c(),i.m(l,null)):i&&(i.d(1),i=null)},d(o){o&&T(t),n&&n.d(),o&&T(l),i&&i.d()}}}function Pp(e){let t,l,n,i,o,f,r,c=e[3]>15&&Ep(e);return{c(){t=bt("rect"),c&&c.c(),r=Ut(),u(t,"x",l=e[6](e[13])+2),u(t,"y",n=e[7](e[11].value)),u(t,"width",i=e[3]-4),u(t,"height",o=e[7](e[0].y.min)-e[7](Math.min(e[0].y.min,0)+e[11].value)),u(t,"fill",f=e[11].color)},m(a,_){P(a,t,_),c&&c.m(a,_),P(a,r,_)},p(a,_){_&64&&l!==(l=a[6](a[13])+2)&&u(t,"x",l),_&129&&n!==(n=a[7](a[11].value))&&u(t,"y",n),_&8&&i!==(i=a[3]-4)&&u(t,"width",i),_&129&&o!==(o=a[7](a[0].y.min)-a[7](Math.min(a[0].y.min,0)+a[11].value))&&u(t,"height",o),_&1&&f!==(f=a[11].color)&&u(t,"fill",f),a[3]>15?c?c.p(a,_):(c=Ep(a),c.c(),c.m(r.parentNode,r)):c&&(c.d(1),c=null)},d(a){a&&T(t),c&&c.d(a),a&&T(r)}}}function Ep(e){let t,l=e[11].label+"",n,i,o,f,r,c,a=e[11].title&&Ap(e);return{c(){t=bt("text"),n=k(l),a&&a.c(),c=Ut(),u(t,"width",i=e[3]-4),u(t,"dominant-baseline","middle"),u(t,"text-anchor",o=e[3]e[7](0)-e[8]?e[11].color:"white"),u(t,"transform",r="translate("+(e[6](e[13])+e[3]/2)+" "+(e[7](e[11].value)>e[7](0)-e[8]?e[7](e[11].value)-e[8]:e[7](e[11].value)+10)+") rotate("+(e[11].labelAngle?e[11].labelAngle:e[3]_[7](0)-_[8]?_[11].color:"white")&&u(t,"fill",f),p&457&&r!==(r="translate("+(_[6](_[13])+_[3]/2)+" "+(_[7](_[11].value)>_[7](0)-_[8]?_[7](_[11].value)-_[8]:_[7](_[11].value)+10)+") rotate("+(_[11].labelAngle?_[11].labelAngle:_[3]15&&qp(e);return{c(){t=bt("rect"),c&&c.c(),r=Ut(),u(t,"x",l=e[6](e[13])+2),u(t,"y",n=e[7](0)),u(t,"width",i=e[3]-4),u(t,"height",o=e[7](e[0].y.min)-e[7](e[0].y.min+e[11].value2)),u(t,"fill",f=e[11].color2?e[11].color2:e[11].color)},m(a,_){P(a,t,_),c&&c.m(a,_),P(a,r,_)},p(a,_){_&64&&l!==(l=a[6](a[13])+2)&&u(t,"x",l),_&128&&n!==(n=a[7](0))&&u(t,"y",n),_&8&&i!==(i=a[3]-4)&&u(t,"width",i),_&129&&o!==(o=a[7](a[0].y.min)-a[7](a[0].y.min+a[11].value2))&&u(t,"height",o),_&1&&f!==(f=a[11].color2?a[11].color2:a[11].color)&&u(t,"fill",f),a[3]>15?c?c.p(a,_):(c=qp(a),c.c(),c.m(r.parentNode,r)):c&&(c.d(1),c=null)},d(a){a&&T(t),c&&c.d(a),a&&T(r)}}}function qp(e){let t,l=e[11].label2+"",n,i,o,f,r,c=e[11].title2&&Op(e);return{c(){t=bt("text"),n=k(l),c&&c.c(),r=Ut(),u(t,"width",i=e[3]-4),u(t,"dominant-baseline","middle"),u(t,"text-anchor","middle"),u(t,"fill",o=e[7](-e[11].value2)e[10].call(t))},m(i,o){P(i,t,o),n&&n.m(t,null),l=hf(t,e[10].bind(t))},p(i,[o]){i[0].x.ticks&&i[0].points&&i[4]?n?n.p(i,o):(n=gp(i),n.c(),n.m(t,null)):n&&(n.d(1),n=null)},i:ze,o:ze,d(i){i&&T(t),n&&n.d(),l()}}}let bi=30;function e4(e,t,l){let{config:n}=t,i,o,f,r,c,a,_,p=0;function v(){p=this.clientHeight,l(5,p)}function d(){i=this.clientWidth,o=this.clientHeight,l(1,i),l(2,o)}return e.$$set=h=>{"config"in h&&l(0,n=h.config)},e.$$.update=()=>{if(e.$$.dirty&63){l(4,a=o-p);let h=i-(n.padding.left+n.padding.right);l(3,f=h/n.points.length),l(8,_=fn.y.max?A=n.padding.bottom:Ma||A<0?0:A})}},[n,i,o,f,a,p,r,c,_,v,d]}class wi extends mt{constructor(t){super(),_t(this,t,e4,xb,ct,{config:0})}}function t4(e){let t,l;return t=new wi({props:{config:e[0]}}),{c(){Ne(t.$$.fragment)},m(n,i){Se(t,n,i),l=!0},p(n,[i]){const o={};i&1&&(o.config=n[0]),t.$set(o)},i(n){l||(Q(t.$$.fragment,n),l=!0)},o(n){ee(t.$$.fragment,n),l=!1},d(n){Ce(t,n)}}}function l4(e,t,l){let{title:n}=t,{u1:i}=t,{u2:o}=t,{u3:f}=t,{ds:r}=t,c={};function a(_){return{label:Bt(_)+"V",title:_.toFixed(1)+" V",value:isNaN(_)?0:_,color:_b(_||0,document.documentElement.classList.contains("dark"))}}return e.$$set=_=>{"title"in _&&l(1,n=_.title),"u1"in _&&l(2,i=_.u1),"u2"in _&&l(3,o=_.u2),"u3"in _&&l(4,f=_.u3),"ds"in _&&l(5,r=_.ds)},e.$$.update=()=>{if(e.$$.dirty&62){let _=[],p=[];i>0&&(_.push({label:r===1?"L1-L2":"L1"}),p.push(a(i))),o>0&&(_.push({label:r===1?"L1-L3":"L2"}),p.push(a(o))),f>0&&(_.push({label:r===1?"L2-L3":"L3"}),p.push(a(f))),l(0,c={title:n,padding:{top:20,right:15,bottom:20,left:35},y:{min:200,max:260,ticks:[{value:207,label:"-10%"},{value:230,label:"230v"},{value:253,label:"+10%"}]},x:{ticks:_},points:p})}},[c,n,i,o,f,r]}class n4 extends mt{constructor(t){super(),_t(this,t,l4,t4,ct,{title:1,u1:2,u2:3,u3:4,ds:5})}}function i4(e){var D,j,te,le,fe,de,qe,Pe,we,Fe;let t,l,n=((j=(D=e[0].reactive)==null?void 0:D.title)!=null?j:"Reactive")+"",i,o,f,r,c=((le=(te=e[0].reactive)==null?void 0:te.instant_in)!=null?le:"Instant in")+"",a,_,p,v=e[1][0]+"",d,h,g=e[1][1]+"",M,A,I,O=((de=(fe=e[0].reactive)==null?void 0:fe.instant_out)!=null?de:"Instant out")+"",L,q,U,E=e[2][0]+"",F,z,G=e[2][1]+"",B,R,K,y,H=((Pe=(qe=e[0].reactive)==null?void 0:qe.total_in)!=null?Pe:"Total in")+"",Y,X,J,$=e[3][0]+"",ce,ie,oe=e[3][1]+"",ae,se,x,me=((Fe=(we=e[0].reactive)==null?void 0:we.total_out)!=null?Fe:"Total out")+"",pe,V,Z,ge=e[4][0]+"",ve,S,w=e[4][1]+"",N;return{c(){t=m("div"),l=m("strong"),i=k(n),o=b(),f=m("div"),r=m("div"),a=k(c),_=b(),p=m("div"),d=k(v),h=b(),M=k(g),A=b(),I=m("div"),L=k(O),q=b(),U=m("div"),F=k(E),z=b(),B=k(G),R=b(),K=m("div"),y=m("div"),Y=k(H),X=b(),J=m("div"),ce=k($),ie=b(),ae=k(oe),se=b(),x=m("div"),pe=k(me),V=b(),Z=m("div"),ve=k(ge),S=b(),N=k(w),u(p,"class","text-right"),u(U,"class","text-right"),u(f,"class","grid grid-cols-2 mt-4"),u(J,"class","text-right"),u(Z,"class","text-right"),u(K,"class","grid grid-cols-2 mt-4"),u(t,"class","mx-2 text-sm")},m(Ae,ke){P(Ae,t,ke),s(t,l),s(l,i),s(t,o),s(t,f),s(f,r),s(r,a),s(f,_),s(f,p),s(p,d),s(p,h),s(p,M),s(f,A),s(f,I),s(I,L),s(f,q),s(f,U),s(U,F),s(U,z),s(U,B),s(t,R),s(t,K),s(K,y),s(y,Y),s(K,X),s(K,J),s(J,ce),s(J,ie),s(J,ae),s(K,se),s(K,x),s(x,pe),s(K,V),s(K,Z),s(Z,ve),s(Z,S),s(Z,N)},p(Ae,[ke]){var De,He,Oe,je,Qe,We,Je,$e,tt,Te;ke&1&&n!==(n=((He=(De=Ae[0].reactive)==null?void 0:De.title)!=null?He:"Reactive")+"")&&C(i,n),ke&1&&c!==(c=((je=(Oe=Ae[0].reactive)==null?void 0:Oe.instant_in)!=null?je:"Instant in")+"")&&C(a,c),ke&2&&v!==(v=Ae[1][0]+"")&&C(d,v),ke&2&&g!==(g=Ae[1][1]+"")&&C(M,g),ke&1&&O!==(O=((We=(Qe=Ae[0].reactive)==null?void 0:Qe.instant_out)!=null?We:"Instant out")+"")&&C(L,O),ke&4&&E!==(E=Ae[2][0]+"")&&C(F,E),ke&4&&G!==(G=Ae[2][1]+"")&&C(B,G),ke&1&&H!==(H=(($e=(Je=Ae[0].reactive)==null?void 0:Je.total_in)!=null?$e:"Total in")+"")&&C(Y,H),ke&8&&$!==($=Ae[3][0]+"")&&C(ce,$),ke&8&&oe!==(oe=Ae[3][1]+"")&&C(ae,oe),ke&1&&me!==(me=((Te=(tt=Ae[0].reactive)==null?void 0:tt.total_out)!=null?Te:"Total out")+"")&&C(pe,me),ke&16&&ge!==(ge=Ae[4][0]+"")&&C(ve,ge),ke&16&&w!==(w=Ae[4][1]+"")&&C(N,w)},i:ze,o:ze,d(Ae){Ae&&T(t)}}}function s4(e,t,l){let{importInstant:n}=t,{exportInstant:i}=t,{importTotal:o}=t,{exportTotal:f}=t,r={};Ml.subscribe(v=>{l(0,r=v)});let c,a,_,p;return e.$$set=v=>{"importInstant"in v&&l(5,n=v.importInstant),"exportInstant"in v&&l(6,i=v.exportInstant),"importTotal"in v&&l(7,o=v.importTotal),"exportTotal"in v&&l(8,f=v.exportTotal)},e.$$.update=()=>{e.$$.dirty&480&&(l(1,c=gl(n,"VAr")),l(2,a=gl(i,"VAr")),l(3,_=gl(o*1e3,"VArh")),l(4,p=gl(f*1e3,"VArh")))},[r,c,a,_,p,n,i,o,f]}class o4 extends mt{constructor(t){super(),_t(this,t,s4,i4,ct,{importInstant:5,exportInstant:6,importTotal:7,exportTotal:8})}}function Lp(e){let t;function l(o,f){return o[3]?f4:a4}let n=l(e),i=n(e);return{c(){i.c(),t=Ut()},m(o,f){i.m(o,f),P(o,t,f)},p(o,f){n===(n=l(o))&&i?i.p(o,f):(i.d(1),i=n(o),i&&(i.c(),i.m(t.parentNode,t)))},d(o){i.d(o),o&&T(t)}}}function a4(e){var j,te,le,fe,de,qe,Pe,we,Fe,Ae;let t,l=((te=(j=e[5].realtime)==null?void 0:j.consumption)!=null?te:"Consumption")+"",n,i,o,f,r=Vt((fe=(le=e[5].common)==null?void 0:le.hour)!=null?fe:"Hour")+"",c,a,_,p=e[6][0]+"",v,d,h=e[6][1]+"",g,M,A,I=Vt((qe=(de=e[5].common)==null?void 0:de.day)!=null?qe:"Day")+"",O,L,q,U=e[7][0]+"",E,F,z=e[7][1]+"",G,B,R,K=Vt((we=(Pe=e[5].common)==null?void 0:Pe.month)!=null?we:"Month")+"",y,H,Y,X=e[8][0]+"",J,$,ce=e[8][1]+"",ie,oe,ae,se=((Ae=(Fe=e[5].realtime)==null?void 0:Fe.last_month)!=null?Ae:"Last month")+"",x,me,pe,V=e[9][0]+"",Z,ge,ve=e[9][1]+"",S,w,N,D=e[4]&&Rp(e);return{c(){t=m("strong"),n=k(l),i=b(),o=m("div"),f=m("div"),c=k(r),a=b(),_=m("div"),v=k(p),d=b(),g=k(h),M=b(),A=m("div"),O=k(I),L=b(),q=m("div"),E=k(U),F=b(),G=k(z),B=b(),R=m("div"),y=k(K),H=b(),Y=m("div"),J=k(X),$=b(),ie=k(ce),oe=b(),ae=m("div"),x=k(se),me=b(),pe=m("div"),Z=k(V),ge=b(),S=k(ve),w=b(),D&&D.c(),N=Ut(),u(_,"class","text-right"),u(q,"class","text-right"),u(Y,"class","text-right"),u(pe,"class","text-right"),u(o,"class","grid grid-cols-2 mb-3")},m(ke,De){P(ke,t,De),s(t,n),P(ke,i,De),P(ke,o,De),s(o,f),s(f,c),s(o,a),s(o,_),s(_,v),s(_,d),s(_,g),s(o,M),s(o,A),s(A,O),s(o,L),s(o,q),s(q,E),s(q,F),s(q,G),s(o,B),s(o,R),s(R,y),s(o,H),s(o,Y),s(Y,J),s(Y,$),s(Y,ie),s(o,oe),s(o,ae),s(ae,x),s(o,me),s(o,pe),s(pe,Z),s(pe,ge),s(pe,S),P(ke,w,De),D&&D.m(ke,De),P(ke,N,De)},p(ke,De){var He,Oe,je,Qe,We,Je,$e,tt,Te,ue;De&32&&l!==(l=((Oe=(He=ke[5].realtime)==null?void 0:He.consumption)!=null?Oe:"Consumption")+"")&&C(n,l),De&32&&r!==(r=Vt((Qe=(je=ke[5].common)==null?void 0:je.hour)!=null?Qe:"Hour")+"")&&C(c,r),De&64&&p!==(p=ke[6][0]+"")&&C(v,p),De&64&&h!==(h=ke[6][1]+"")&&C(g,h),De&32&&I!==(I=Vt((Je=(We=ke[5].common)==null?void 0:We.day)!=null?Je:"Day")+"")&&C(O,I),De&128&&U!==(U=ke[7][0]+"")&&C(E,U),De&128&&z!==(z=ke[7][1]+"")&&C(G,z),De&32&&K!==(K=Vt((tt=($e=ke[5].common)==null?void 0:$e.month)!=null?tt:"Month")+"")&&C(y,K),De&256&&X!==(X=ke[8][0]+"")&&C(J,X),De&256&&ce!==(ce=ke[8][1]+"")&&C(ie,ce),De&32&&se!==(se=((ue=(Te=ke[5].realtime)==null?void 0:Te.last_month)!=null?ue:"Last month")+"")&&C(x,se),De&512&&V!==(V=ke[9][0]+"")&&C(Z,V),De&512&&ve!==(ve=ke[9][1]+"")&&C(S,ve),ke[4]?D?D.p(ke,De):(D=Rp(ke),D.c(),D.m(N.parentNode,N)):D&&(D.d(1),D=null)},d(ke){ke&&T(t),ke&&T(i),ke&&T(o),ke&&T(w),D&&D.d(ke),ke&&T(N)}}}function f4(e){var Yt,ll,fl,ul,Sl,rl,Cl,nl,_l,dl,Nl,Tl,Qt,Ee,qt,En,Zl,vn,An,Le;let t,l=((ll=(Yt=e[5].common)==null?void 0:Yt.import)!=null?ll:"Import")+"",n,i,o,f,r=Vt((ul=(fl=e[5].common)==null?void 0:fl.hour)!=null?ul:"Hour")+"",c,a,_,p=e[6][0]+"",v,d,h=e[6][1]+"",g,M,A,I,O=Vt((rl=(Sl=e[5].common)==null?void 0:Sl.day)!=null?rl:"Day")+"",L,q,U,E=e[7][0]+"",F,z,G=e[7][1]+"",B,R,K,y,H=Vt((nl=(Cl=e[5].common)==null?void 0:Cl.month)!=null?nl:"Month")+"",Y,X,J,$=e[8][0]+"",ce,ie,oe=e[8][1]+"",ae,se,x,me,pe=((dl=(_l=e[5].realtime)==null?void 0:_l.last_mo)!=null?dl:"Last mo.")+"",V,Z,ge,ve=e[9][0]+"",S,w,N=e[9][1]+"",D,j,te,le,fe,de=((Tl=(Nl=e[5].common)==null?void 0:Nl.export)!=null?Tl:"Export")+"",qe,Pe,we,Fe,Ae=Vt((Ee=(Qt=e[5].common)==null?void 0:Qt.hour)!=null?Ee:"Hour")+"",ke,De,He,Oe=e[10][0]+"",je,Qe,We=e[10][1]+"",Je,$e,tt,Te,ue=Vt((En=(qt=e[5].common)==null?void 0:qt.day)!=null?En:"Day")+"",Ie,kt,lt,wt=e[11][0]+"",st,ot,xe=e[11][1]+"",Nt,gt,At,Pt,Be=Vt((vn=(Zl=e[5].common)==null?void 0:Zl.month)!=null?vn:"Month")+"",ye,It,vt,nt=e[12][0]+"",Tt,it,at=e[12][1]+"",rt,jt,Lt,Ht,yt=((Le=(An=e[5].realtime)==null?void 0:An.last_mo)!=null?Le:"Last mo.")+"",Me,Ve,Rt,Gt=e[13][0]+"",zt,Dt,Kt=e[13][1]+"",Zt,tl,Jt,ft=e[4]&&Fp(e),Mt=e[4]&&Bp(e),Ke=e[4]&&Up(e),ne=e[4]&&jp(e),Ue=e[4]&&Hp(e),Re=e[4]&&yp(e),St=e[4]&&zp(e),ut=e[4]&&Wp(e);return{c(){t=m("strong"),n=k(l),i=b(),o=m("div"),f=m("div"),c=k(r),a=b(),_=m("div"),v=k(p),d=b(),g=k(h),M=b(),ft&&ft.c(),A=b(),I=m("div"),L=k(O),q=b(),U=m("div"),F=k(E),z=b(),B=k(G),R=b(),Mt&&Mt.c(),K=b(),y=m("div"),Y=k(H),X=b(),J=m("div"),ce=k($),ie=b(),ae=k(oe),se=b(),Ke&&Ke.c(),x=b(),me=m("div"),V=k(pe),Z=b(),ge=m("div"),S=k(ve),w=b(),D=k(N),j=b(),ne&&ne.c(),le=b(),fe=m("strong"),qe=k(de),Pe=b(),we=m("div"),Fe=m("div"),ke=k(Ae),De=b(),He=m("div"),je=k(Oe),Qe=b(),Je=k(We),$e=b(),Ue&&Ue.c(),tt=b(),Te=m("div"),Ie=k(ue),kt=b(),lt=m("div"),st=k(wt),ot=b(),Nt=k(xe),gt=b(),Re&&Re.c(),At=b(),Pt=m("div"),ye=k(Be),It=b(),vt=m("div"),Tt=k(nt),it=b(),rt=k(at),jt=b(),St&&St.c(),Lt=b(),Ht=m("div"),Me=k(yt),Ve=b(),Rt=m("div"),zt=k(Gt),Dt=b(),Zt=k(Kt),tl=b(),ut&&ut.c(),u(_,"class","text-right"),u(U,"class","text-right"),u(J,"class","text-right"),u(ge,"class","text-right"),u(o,"class",te="grid grid-cols-"+e[14]+" mb-3"),u(He,"class","text-right"),u(lt,"class","text-right"),u(vt,"class","text-right"),u(Rt,"class","text-right"),u(we,"class",Jt="grid grid-cols-"+e[14])},m(he,et){P(he,t,et),s(t,n),P(he,i,et),P(he,o,et),s(o,f),s(f,c),s(o,a),s(o,_),s(_,v),s(_,d),s(_,g),s(o,M),ft&&ft.m(o,null),s(o,A),s(o,I),s(I,L),s(o,q),s(o,U),s(U,F),s(U,z),s(U,B),s(o,R),Mt&&Mt.m(o,null),s(o,K),s(o,y),s(y,Y),s(o,X),s(o,J),s(J,ce),s(J,ie),s(J,ae),s(o,se),Ke&&Ke.m(o,null),s(o,x),s(o,me),s(me,V),s(o,Z),s(o,ge),s(ge,S),s(ge,w),s(ge,D),s(o,j),ne&&ne.m(o,null),P(he,le,et),P(he,fe,et),s(fe,qe),P(he,Pe,et),P(he,we,et),s(we,Fe),s(Fe,ke),s(we,De),s(we,He),s(He,je),s(He,Qe),s(He,Je),s(we,$e),Ue&&Ue.m(we,null),s(we,tt),s(we,Te),s(Te,Ie),s(we,kt),s(we,lt),s(lt,st),s(lt,ot),s(lt,Nt),s(we,gt),Re&&Re.m(we,null),s(we,At),s(we,Pt),s(Pt,ye),s(we,It),s(we,vt),s(vt,Tt),s(vt,it),s(vt,rt),s(we,jt),St&&St.m(we,null),s(we,Lt),s(we,Ht),s(Ht,Me),s(we,Ve),s(we,Rt),s(Rt,zt),s(Rt,Dt),s(Rt,Zt),s(we,tl),ut&&ut.m(we,null)},p(he,et){var zn,Dn,Wl,hn,qn,Wn,Gn,ml,Jl,$l,Vn,xl,Gl,bn,On,Kn,Yn,en,cl,Qn;et&32&&l!==(l=((Dn=(zn=he[5].common)==null?void 0:zn.import)!=null?Dn:"Import")+"")&&C(n,l),et&32&&r!==(r=Vt((hn=(Wl=he[5].common)==null?void 0:Wl.hour)!=null?hn:"Hour")+"")&&C(c,r),et&64&&p!==(p=he[6][0]+"")&&C(v,p),et&64&&h!==(h=he[6][1]+"")&&C(g,h),he[4]?ft?ft.p(he,et):(ft=Fp(he),ft.c(),ft.m(o,A)):ft&&(ft.d(1),ft=null),et&32&&O!==(O=Vt((Wn=(qn=he[5].common)==null?void 0:qn.day)!=null?Wn:"Day")+"")&&C(L,O),et&128&&E!==(E=he[7][0]+"")&&C(F,E),et&128&&G!==(G=he[7][1]+"")&&C(B,G),he[4]?Mt?Mt.p(he,et):(Mt=Bp(he),Mt.c(),Mt.m(o,K)):Mt&&(Mt.d(1),Mt=null),et&32&&H!==(H=Vt((ml=(Gn=he[5].common)==null?void 0:Gn.month)!=null?ml:"Month")+"")&&C(Y,H),et&256&&$!==($=he[8][0]+"")&&C(ce,$),et&256&&oe!==(oe=he[8][1]+"")&&C(ae,oe),he[4]?Ke?Ke.p(he,et):(Ke=Up(he),Ke.c(),Ke.m(o,x)):Ke&&(Ke.d(1),Ke=null),et&32&&pe!==(pe=(($l=(Jl=he[5].realtime)==null?void 0:Jl.last_mo)!=null?$l:"Last mo.")+"")&&C(V,pe),et&512&&ve!==(ve=he[9][0]+"")&&C(S,ve),et&512&&N!==(N=he[9][1]+"")&&C(D,N),he[4]?ne?ne.p(he,et):(ne=jp(he),ne.c(),ne.m(o,null)):ne&&(ne.d(1),ne=null),et&16384&&te!==(te="grid grid-cols-"+he[14]+" mb-3")&&u(o,"class",te),et&32&&de!==(de=((xl=(Vn=he[5].common)==null?void 0:Vn.export)!=null?xl:"Export")+"")&&C(qe,de),et&32&&Ae!==(Ae=Vt((bn=(Gl=he[5].common)==null?void 0:Gl.hour)!=null?bn:"Hour")+"")&&C(ke,Ae),et&1024&&Oe!==(Oe=he[10][0]+"")&&C(je,Oe),et&1024&&We!==(We=he[10][1]+"")&&C(Je,We),he[4]?Ue?Ue.p(he,et):(Ue=Hp(he),Ue.c(),Ue.m(we,tt)):Ue&&(Ue.d(1),Ue=null),et&32&&ue!==(ue=Vt((Kn=(On=he[5].common)==null?void 0:On.day)!=null?Kn:"Day")+"")&&C(Ie,ue),et&2048&&wt!==(wt=he[11][0]+"")&&C(st,wt),et&2048&&xe!==(xe=he[11][1]+"")&&C(Nt,xe),he[4]?Re?Re.p(he,et):(Re=yp(he),Re.c(),Re.m(we,At)):Re&&(Re.d(1),Re=null),et&32&&Be!==(Be=Vt((en=(Yn=he[5].common)==null?void 0:Yn.month)!=null?en:"Month")+"")&&C(ye,Be),et&4096&&nt!==(nt=he[12][0]+"")&&C(Tt,nt),et&4096&&at!==(at=he[12][1]+"")&&C(rt,at),he[4]?St?St.p(he,et):(St=zp(he),St.c(),St.m(we,Lt)):St&&(St.d(1),St=null),et&32&&yt!==(yt=((Qn=(cl=he[5].realtime)==null?void 0:cl.last_mo)!=null?Qn:"Last mo.")+"")&&C(Me,yt),et&8192&&Gt!==(Gt=he[13][0]+"")&&C(zt,Gt),et&8192&&Kt!==(Kt=he[13][1]+"")&&C(Zt,Kt),he[4]?ut?ut.p(he,et):(ut=Wp(he),ut.c(),ut.m(we,null)):ut&&(ut.d(1),ut=null),et&16384&&Jt!==(Jt="grid grid-cols-"+he[14])&&u(we,"class",Jt)},d(he){he&&T(t),he&&T(i),he&&T(o),ft&&ft.d(),Mt&&Mt.d(),Ke&&Ke.d(),ne&&ne.d(),he&&T(le),he&&T(fe),he&&T(Pe),he&&T(we),Ue&&Ue.d(),Re&&Re.d(),St&&St.d(),ut&&ut.d()}}}function Rp(e){var Z,ge,ve,S,w,N,D,j,te,le;let t,l=((ge=(Z=e[5].realtime)==null?void 0:Z.cost)!=null?ge:"Cost")+"",n,i,o,f,r=Vt((S=(ve=e[5].common)==null?void 0:ve.hour)!=null?S:"Hour")+"",c,a,_,p=Bt(e[1].h.c,2)+"",v,d,h,g,M,A=Vt((N=(w=e[5].common)==null?void 0:w.day)!=null?N:"Day")+"",I,O,L,q=Bt(e[1].d.c,1)+"",U,E,F,z,G,B=Vt((j=(D=e[5].common)==null?void 0:D.month)!=null?j:"Month")+"",R,K,y,H=Bt(e[1].m.c)+"",Y,X,J,$,ce,ie=((le=(te=e[5].realtime)==null?void 0:te.last_month)!=null?le:"Last month")+"",oe,ae,se,x=Bt(e[0].last_month.c)+"",me,pe,V;return{c(){t=m("strong"),n=k(l),i=b(),o=m("div"),f=m("div"),c=k(r),a=b(),_=m("div"),v=k(p),d=b(),h=k(e[2]),g=b(),M=m("div"),I=k(A),O=b(),L=m("div"),U=k(q),E=b(),F=k(e[2]),z=b(),G=m("div"),R=k(B),K=b(),y=m("div"),Y=k(H),X=b(),J=k(e[2]),$=b(),ce=m("div"),oe=k(ie),ae=b(),se=m("div"),me=k(x),pe=b(),V=k(e[2]),u(_,"class","text-right"),u(L,"class","text-right"),u(y,"class","text-right"),u(se,"class","text-right"),u(o,"class","grid grid-cols-2")},m(fe,de){P(fe,t,de),s(t,n),P(fe,i,de),P(fe,o,de),s(o,f),s(f,c),s(o,a),s(o,_),s(_,v),s(_,d),s(_,h),s(o,g),s(o,M),s(M,I),s(o,O),s(o,L),s(L,U),s(L,E),s(L,F),s(o,z),s(o,G),s(G,R),s(o,K),s(o,y),s(y,Y),s(y,X),s(y,J),s(o,$),s(o,ce),s(ce,oe),s(o,ae),s(o,se),s(se,me),s(se,pe),s(se,V)},p(fe,de){var qe,Pe,we,Fe,Ae,ke,De,He,Oe,je;de&32&&l!==(l=((Pe=(qe=fe[5].realtime)==null?void 0:qe.cost)!=null?Pe:"Cost")+"")&&C(n,l),de&32&&r!==(r=Vt((Fe=(we=fe[5].common)==null?void 0:we.hour)!=null?Fe:"Hour")+"")&&C(c,r),de&2&&p!==(p=Bt(fe[1].h.c,2)+"")&&C(v,p),de&4&&C(h,fe[2]),de&32&&A!==(A=Vt((ke=(Ae=fe[5].common)==null?void 0:Ae.day)!=null?ke:"Day")+"")&&C(I,A),de&2&&q!==(q=Bt(fe[1].d.c,1)+"")&&C(U,q),de&4&&C(F,fe[2]),de&32&&B!==(B=Vt((He=(De=fe[5].common)==null?void 0:De.month)!=null?He:"Month")+"")&&C(R,B),de&2&&H!==(H=Bt(fe[1].m.c)+"")&&C(Y,H),de&4&&C(J,fe[2]),de&32&&ie!==(ie=((je=(Oe=fe[5].realtime)==null?void 0:Oe.last_month)!=null?je:"Last month")+"")&&C(oe,ie),de&1&&x!==(x=Bt(fe[0].last_month.c)+"")&&C(me,x),de&4&&C(V,fe[2])},d(fe){fe&&T(t),fe&&T(i),fe&&T(o)}}}function Fp(e){let t,l=Bt(e[1].h.c,2)+"",n,i,o;return{c(){t=m("div"),n=k(l),i=b(),o=k(e[2]),u(t,"class","text-right")},m(f,r){P(f,t,r),s(t,n),s(t,i),s(t,o)},p(f,r){r&2&&l!==(l=Bt(f[1].h.c,2)+"")&&C(n,l),r&4&&C(o,f[2])},d(f){f&&T(t)}}}function Bp(e){let t,l=Bt(e[1].d.c,1)+"",n,i,o;return{c(){t=m("div"),n=k(l),i=b(),o=k(e[2]),u(t,"class","text-right")},m(f,r){P(f,t,r),s(t,n),s(t,i),s(t,o)},p(f,r){r&2&&l!==(l=Bt(f[1].d.c,1)+"")&&C(n,l),r&4&&C(o,f[2])},d(f){f&&T(t)}}}function Up(e){let t,l=Bt(e[1].m.c)+"",n,i,o;return{c(){t=m("div"),n=k(l),i=b(),o=k(e[2]),u(t,"class","text-right")},m(f,r){P(f,t,r),s(t,n),s(t,i),s(t,o)},p(f,r){r&2&&l!==(l=Bt(f[1].m.c)+"")&&C(n,l),r&4&&C(o,f[2])},d(f){f&&T(t)}}}function jp(e){let t,l=Bt(e[0].last_month.c)+"",n,i,o;return{c(){t=m("div"),n=k(l),i=b(),o=k(e[2]),u(t,"class","text-right")},m(f,r){P(f,t,r),s(t,n),s(t,i),s(t,o)},p(f,r){r&1&&l!==(l=Bt(f[0].last_month.c)+"")&&C(n,l),r&4&&C(o,f[2])},d(f){f&&T(t)}}}function Hp(e){let t,l=Bt(e[1].h.i,2)+"",n,i,o;return{c(){t=m("div"),n=k(l),i=b(),o=k(e[2]),u(t,"class","text-right")},m(f,r){P(f,t,r),s(t,n),s(t,i),s(t,o)},p(f,r){r&2&&l!==(l=Bt(f[1].h.i,2)+"")&&C(n,l),r&4&&C(o,f[2])},d(f){f&&T(t)}}}function yp(e){let t,l=Bt(e[1].d.i,1)+"",n,i,o;return{c(){t=m("div"),n=k(l),i=b(),o=k(e[2]),u(t,"class","text-right")},m(f,r){P(f,t,r),s(t,n),s(t,i),s(t,o)},p(f,r){r&2&&l!==(l=Bt(f[1].d.i,1)+"")&&C(n,l),r&4&&C(o,f[2])},d(f){f&&T(t)}}}function zp(e){let t,l=Bt(e[1].m.i)+"",n,i,o;return{c(){t=m("div"),n=k(l),i=b(),o=k(e[2]),u(t,"class","text-right")},m(f,r){P(f,t,r),s(t,n),s(t,i),s(t,o)},p(f,r){r&2&&l!==(l=Bt(f[1].m.i)+"")&&C(n,l),r&4&&C(o,f[2])},d(f){f&&T(t)}}}function Wp(e){let t,l=Bt(e[0].last_month.i)+"",n,i,o;return{c(){t=m("div"),n=k(l),i=b(),o=k(e[2]),u(t,"class","text-right")},m(f,r){P(f,t,r),s(t,n),s(t,i),s(t,o)},p(f,r){r&1&&l!==(l=Bt(f[0].last_month.i)+"")&&C(n,l),r&4&&C(o,f[2])},d(f){f&&T(t)}}}function u4(e){var _,p;let t,l,n=((p=(_=e[5].realtime)==null?void 0:_.title)!=null?p:"Real time calculations")+"",i,o,f,r,c,a=e[1]&&Lp(e);return{c(){t=m("div"),l=m("strong"),i=k(n),o=b(),f=m("br"),r=m("br"),c=b(),a&&a.c(),u(t,"class","mx-2 text-sm")},m(v,d){P(v,t,d),s(t,l),s(l,i),s(t,o),s(t,f),s(t,r),s(t,c),a&&a.m(t,null)},p(v,[d]){var h,g;d&32&&n!==(n=((g=(h=v[5].realtime)==null?void 0:h.title)!=null?g:"Real time calculations")+"")&&C(i,n),v[1]?a?a.p(v,d):(a=Lp(v),a.c(),a.m(t,null)):a&&(a.d(1),a=null)},i:ze,o:ze,d(v){v&&T(t),a&&a.d()}}}function r4(e,t,l){let{sysinfo:n}=t,{data:i}=t,{currency:o}=t,{hasExport:f}=t,r={};Ml.subscribe(I=>{l(5,r=I)});let c,a,_,p,v,d,h,g,M=!1,A=3;return e.$$set=I=>{"sysinfo"in I&&l(0,n=I.sysinfo),"data"in I&&l(1,i=I.data),"currency"in I&&l(2,o=I.currency),"hasExport"in I&&l(3,f=I.hasExport)},e.$$.update=()=>{var I,O,L,q,U,E,F,z;e.$$.dirty&19&&(l(4,M=i&&i.h&&(Math.abs(i.h.c)>.01||Math.abs(i.d.c)>.01||Math.abs(i.m.c)>.01||Math.abs(i.h.i)>.01||Math.abs(i.d.i)>.01||Math.abs(i.m.i)>.01)),l(14,A=M?3:2),l(6,c=gl(((I=i==null?void 0:i.h)==null?void 0:I.u)*1e3,"Wh")),l(7,a=gl(((O=i==null?void 0:i.d)==null?void 0:O.u)*1e3,"Wh")),l(8,_=gl(((L=i==null?void 0:i.m)==null?void 0:L.u)*1e3,"Wh")),l(9,p=gl(((q=n==null?void 0:n.last_month)==null?void 0:q.c)*1e3,"Wh")),l(10,v=gl(((U=i==null?void 0:i.h)==null?void 0:U.p)*1e3,"Wh")),l(11,d=gl(((E=i==null?void 0:i.d)==null?void 0:E.p)*1e3,"Wh")),l(12,h=gl(((F=i==null?void 0:i.m)==null?void 0:F.p)*1e3,"Wh")),l(13,g=gl(((z=n==null?void 0:n.last_month)==null?void 0:z.p)*1e3,"Wh")))},[n,i,o,f,M,r,c,a,_,p,v,d,h,g,A]}class c4 extends mt{constructor(t){super(),_t(this,t,r4,u4,ct,{sysinfo:0,data:1,currency:2,hasExport:3})}}function _4(e){let t,l,n=tp(e[0].source)+"",i,o,f,r,c;return r=new wi({props:{config:e[1]}}),{c(){t=m("a"),l=k("Provided by: "),i=k(n),f=b(),Ne(r.$$.fragment),u(t,"href",o=lp(e[0].source)),u(t,"target","_blank"),u(t,"class","text-xs float-right z-40")},m(a,_){P(a,t,_),s(t,l),s(t,i),P(a,f,_),Se(r,a,_),c=!0},p(a,[_]){(!c||_&1)&&n!==(n=tp(a[0].source)+"")&&C(i,n),(!c||_&1&&o!==(o=lp(a[0].source)))&&u(t,"href",o);const p={};_&2&&(p.config=a[1]),r.$set(p)},i(a){c||(Q(r.$$.fragment,a),c=!0)},o(a){ee(r.$$.fragment,a),c=!1},d(a){a&&T(t),a&&T(f),Ce(r,a)}}}function m4(e,t,l){let{title:n}=t,{json:i}=t,{sysinfo:o}=t,f={},r,c,a=document.documentElement.classList.contains("dark");return e.$$set=_=>{"title"in _&&l(2,n=_.title),"json"in _&&l(0,i=_.json),"sysinfo"in _&&l(3,o=_.sysinfo)},e.$$.update=()=>{if(e.$$.dirty&61){let _=i.currency,p=new Date().getUTCHours(),v=0,d=0,h=0,g=[],M=[],A=[];l(5,c=l(4,r=0));let I=new Date;for(Tn(I,o.clock_offset-(24+I.getHours()-I.getUTCHours())%24),v=p;v<24&&(d=i[ht(h++)],d!=null);v++)M.push({label:ht(I.getHours())}),A.push(d*100),l(5,c=Math.min(c,d*100)),l(4,r=Math.max(r,d*100)),Tn(I,1);for(v=0;v<24&&(d=i[ht(h++)],d!=null);v++)M.push({label:ht(I.getHours())}),A.push(d*100),l(5,c=Math.min(c,d*100)),l(4,r=Math.max(r,d*100)),Tn(I,1);if(c>-100&&r<100){switch(_){case"NOK":case"DKK":_="\xF8re";break;case"SEK":_="\xF6re";break;case"EUR":_="cent";break;case"CHF":_="rp.";break;default:_=_+"/100"}for(l(5,c*=100),l(4,r*=100),v=0;v=0?E.toFixed(F):"",title:E>=0?E.toFixed(2)+" "+_:"",value:d>=0?Math.abs(d):0,label2:E<0?E.toFixed(F):"",title2:E<0?E.toFixed(2)+" "+_:"",value2:d<0?Math.abs(d):0,color:a?"#5c2da5":"#7c3aed"})}let L=Math.max(r,Math.abs(c));if(c<0){l(5,c=Math.min(L/4*-1,c));let E=Math.ceil(Math.abs(c)/L*4),F=c/E;for(v=1;v{"title"in _&&l(1,n=_.title),"json"in _&&l(2,i=_.json),"sysinfo"in _&&l(3,o=_.sysinfo)},e.$$.update=()=>{if(e.$$.dirty&62){let _=0,p=[],v=[],d=[];l(5,c=l(4,r=0));let h=Tn(new Date,-24),g=new Date().getUTCHours();for(Tn(h,o.clock_offset-(24+h.getHours()-h.getUTCHours())%24),_=g;_<24;_++){let O=i["i"+ht(_)],L=i["e"+ht(_)];O===void 0&&(O=0),L===void 0&&(L=0),v.push({label:ht(h.getHours())}),d.push({label:O.toFixed(1),title:O.toFixed(2)+" kWh",value:O*10,label2:L.toFixed(1),title2:L.toFixed(2)+" kWh",value2:L*10,color:a?"#5c2da5":"#7c3aed",color2:a?"#27728e":"#37829e"}),l(5,c=Math.max(c,L*10)),l(4,r=Math.max(r,O*10)),Tn(h,1)}for(_=0;_{"title"in _&&l(1,n=_.title),"json"in _&&l(2,i=_.json),"sysinfo"in _&&l(3,o=_.sysinfo)},e.$$.update=()=>{if(e.$$.dirty&62){let _=0,p=[],v=[],d=[];l(5,c=l(4,r=0));let h=new Date,g=new Date;for(Tn(h,o.clock_offset-(24+h.getHours()-h.getUTCHours())%24),Tn(g,o.clock_offset-(24+g.getHours()-g.getUTCHours())%24),g.setDate(0),_=h.getDate();_<=g.getDate();_++){let O=i["i"+ht(_)],L=i["e"+ht(_)];O===void 0&&(O=0),L===void 0&&(L=0),v.push({label:ht(_)}),d.push({label:O.toFixed(O<10?1:0),title:O.toFixed(2)+" kWh",value:O,label2:L.toFixed(L<10?1:0),title2:L.toFixed(2)+" kWh",value2:L,color:a?"#5c2da5":"#7c3aed",color2:a?"#27728e":"#37829e"}),l(5,c=Math.max(c,L)),l(4,r=Math.max(r,O))}for(_=1;_{"title"in a&&l(1,n=a.title),"json"in a&&l(2,i=a.json)},e.$$.update=()=>{if(e.$$.dirty&30){let a=0,_=0,p=[],v=[],d=[];i.s&&i.s.forEach((M,A)=>{var I=M.n?M.n:M.a;_=M.v,_==-127&&(_=0),v.push({label:I.slice(-4)}),d.push({label:_.toFixed(1),value:_,color:o?"#5c2da5":"#7c3aed"}),l(4,c=Math.min(c,_)),l(3,r=Math.max(r,_))}),l(3,r=Math.ceil(r)),l(4,c=Math.floor(c));let h=r;c<0&&(h+=Math.abs(c));let g=h/4;for(a=0;a<5;a++)_=c+g*a,p.push({value:_,label:_.toFixed(1)});l(0,f={title:n+" (\xB0C)",height:226,width:1520,padding:{top:20,right:15,bottom:20,left:35},y:{min:c,max:r,ticks:p},x:{ticks:v},points:d})}},[f,n,i,r,c]}class S4 extends mt{constructor(t){super(),_t(this,t,M4,w4,ct,{title:1,json:2})}}function C4(e){let t,l;return t=new wi({props:{config:e[0]}}),{c(){Ne(t.$$.fragment)},m(n,i){Se(t,n,i),l=!0},p(n,[i]){const o={};i&1&&(o.config=n[0]),t.$set(o)},i(n){l||(Q(t.$$.fragment,n),l=!0)},o(n){ee(t.$$.fragment,n),l=!1},d(n){Ce(t,n)}}}let N4=0;function T4(e,t,l){let n={};Ml.subscribe(a=>{l(2,n=a)});let{title:i}=t,o=document.documentElement.classList.contains("dark"),f={},r=0,c;return Fv.subscribe(a=>{l(4,c=a)}),Rv(),e.$$set=a=>{"title"in a&&l(1,i=a.title)},e.$$.update=()=>{var a;if(e.$$.dirty&30){let _=0,p=[],v=[],d=[];if(p.push({value:0,label:0}),c&&c.p)for(_=0;_0?ht(h.d)+"."+((a=n.months)==null?void 0:a[new Date().getMonth()]):"-"}),l(3,r=Math.max(r,h.v))}if(c&&c.t){for(_=0;_=r)break;p.push({value:h,label:h})}p.push({label:c.m.toFixed(1),align:"right",color:"green",value:c.m})}c&&c.c&&(p.push({label:c.c.toFixed(0),color:"orange",value:c.c}),l(3,r=Math.max(r,c.c))),l(3,r=Math.ceil(r)),l(0,f={title:i,padding:{top:20,right:35,bottom:20,left:35},y:{min:N4,max:r,ticks:p},x:{ticks:v},points:d})}},[f,i,n,r,c]}class P4 extends mt{constructor(t){super(),_t(this,t,T4,C4,ct,{title:1})}}function Gp(e,t,l){const n=e.slice();return n[24]=t[l],n[26]=l,n}function Vp(e,t,l){const n=e.slice();return n[27]=t[l],n}function Kp(e){let t,l,n,i,o,f=e[8],r=[];for(let _=0;_e[16].call(t))},m(_,p){P(_,t,p),s(t,l),s(l,n),s(l,i),s(l,o),s(l,f),s(t,r),a&&a.m(t,null),c=hf(t,e[16].bind(t))},p(_,[p]){p&1&&C(n,_[0]),p&2048&&C(o,_[11]),_[8]?a?a.p(_,p):(a=Kp(_),a.c(),a.m(t,null)):a&&(a.d(1),a=null)},i:ze,o:ze,d(_){_&&T(t),a&&a.d(),c()}}}let A4=12;function D4(e,t,l){let{title:n}=t,i=document.documentElement.classList.contains("dark"),o,f=0,r=0,c=0,a=!1,_=null,p;Bv.subscribe(B=>{l(13,_=B),c=f,p&&clearTimeout(p),p=setTimeout(Ho,6e5)});function v(){if(o&&clearTimeout(o),c>f||c-f>300)Ho();else{for(;f>c;)_.data.unshift(r),l(13,_.data=_.data.slice(0,_.size),_),c+=10;o=setTimeout(v,1e4)}}Ev.subscribe(B=>{var R;if(r=B.i-B.e,f=B.u,!a){Ho(),a=!0;return}!((R=_==null?void 0:_.data)!=null&&R.length)||o||(o=setTimeout(v,1e4))});let d,h,g,M,A,I,O,L,q,U,E,F,z;function G(){g=this.clientWidth,M=this.clientHeight,l(1,g),l(2,M)}return e.$$set=B=>{"title"in B&&l(0,n=B.title)},e.$$.update=()=>{if(e.$$.dirty&58366&&(l(3,A=parseInt(M)-50),l(4,I=g-35),l(10,F=I/_.size),l(15,h=0),l(14,d=0),_.data)){for(let R in _.data){let K=_.data[R];isNaN(K)&&(K=0),l(14,d=Math.max(Math.ceil(K/1e3)*1e3,d)),l(15,h=Math.min(Math.ceil(K/1e3)*1e3,h))}l(11,z=d>2500?"kW":"W"),l(8,U=[]);for(let R=h;R2500?(R/1e3).toFixed(1):R});l(9,E=[]);for(let R=h;R<_.size;R+=_.size/A4)E.push({value:R,label:"-"+Math.round((_.size-R)/6)+" min"});l(6,L=function(R){return Math.ceil(A-R/d*A)-25}),l(7,q=function(R){return 30+Math.ceil(R/_.size*(I-35))});let B=_.size;l(5,O=q(_.size)+","+L(0)+" "+q(1)+","+L(0));for(let R in _.data){if(B<0)break;let K=_.data[R];isNaN(K)&&(K=0),l(5,O=q(B--)+","+L(K)+" "+O)}}},[n,g,M,A,I,O,L,q,U,E,F,z,i,_,d,h,G]}class q4 extends mt{constructor(t){super(),_t(this,t,D4,E4,ct,{title:0})}}function O4(e){let t,l;return t=new wi({props:{config:e[0]}}),{c(){Ne(t.$$.fragment)},m(n,i){Se(t,n,i),l=!0},p(n,[i]){const o={};i&1&&(o.config=n[0]),t.$set(o)},i(n){l||(Q(t.$$.fragment,n),l=!0)},o(n){ee(t.$$.fragment,n),l=!1},d(n){Ce(t,n)}}}function I4(e,t,l){let{title:n}=t,{unit:i=""}=t,{l1:o=!1}=t,{l2:f=!1}=t,{l2x:r=!1}=t,{l3:c=!1}=t,{l1i:a=0}=t,{l2i:_=0}=t,{l3i:p=0}=t,{l1e:v=0}=t,{l2e:d=0}=t,{l3e:h=0}=t,{maxImport:g=0}=t,{maxExport:M=0}=t,{importColorFn:A}=t,{exportColorFn:I}=t,O={};function L(q,U){return{label:Bt(q>900?q/1e3:q)+(q>900?"k":"")+i,title:q.toFixed(2)+" "+i,value:isNaN(q)?0:q,color:A(q?q/g*100:0,document.documentElement.classList.contains("dark")),label2:Bt(U>900?U/1e3:U)+(U>900?"k":"")+i,title2:U.toFixed(2)+" "+i,value2:isNaN(U)?0:U,color2:I(U?U/M*100:0)}}return e.$$set=q=>{"title"in q&&l(1,n=q.title),"unit"in q&&l(2,i=q.unit),"l1"in q&&l(3,o=q.l1),"l2"in q&&l(4,f=q.l2),"l2x"in q&&l(5,r=q.l2x),"l3"in q&&l(6,c=q.l3),"l1i"in q&&l(7,a=q.l1i),"l2i"in q&&l(8,_=q.l2i),"l3i"in q&&l(9,p=q.l3i),"l1e"in q&&l(10,v=q.l1e),"l2e"in q&&l(11,d=q.l2e),"l3e"in q&&l(12,h=q.l3e),"maxImport"in q&&l(13,g=q.maxImport),"maxExport"in q&&l(14,M=q.maxExport),"importColorFn"in q&&l(15,A=q.importColorFn),"exportColorFn"in q&&l(16,I=q.exportColorFn)},e.$$.update=()=>{if(e.$$.dirty&32762){let q=[],U=[];o&&(q.push({label:"L1"}),U.push(L(a,v))),f&&(r?(q.push({label:"L2"}),U.push({label:"Not available",labelAngle:-90,title:"L2 current is not reported by your meter",value:0,color:"#7c3aedcc"})):(q.push({label:"L2"}),U.push(L(_,d)))),c&&(q.push({label:"L3"}),U.push(L(p,h)));let E=[];M&&(E.push({value:-M,label:"-100%"}),E.push({value:-M/4*3,label:"-75%"}),E.push({value:-M/2,label:"-50%"}),E.push({value:-M/4,label:"-25%"})),E.push({value:0,label:"0%"}),g&&(E.push({value:g/4,label:"25%"}),E.push({value:g/2,label:"50%"}),E.push({value:g/4*3,label:"75%"}),E.push({value:g,label:"100%"})),l(0,O={title:n,padding:{top:20,right:15,bottom:20,left:35},y:{min:-M,max:g,ticks:E},x:{ticks:q},points:U})}},[O,n,i,o,f,r,c,a,_,p,v,d,h,g,M,A,I]}class Ef extends mt{constructor(t){super(),_t(this,t,I4,O4,ct,{title:1,unit:2,l1:3,l2:4,l2x:5,l3:6,l1i:7,l2i:8,l3i:9,l1e:10,l2e:11,l3e:12,maxImport:13,maxExport:14,importColorFn:15,exportColorFn:16})}}function $p(e){var A,I;let t,l,n,i,o,f,r=(e[0].mt?Ko(e[0].mt):"-")+"",c,a,_,p=e[7][0]+"",v,d,h=e[7][1]+"",g,M;return i=new zv({props:{val:e[0].i?e[0].i:0,max:e[0].im?e[0].im:15e3,unit:"W",label:(I=(A=e[6].common)==null?void 0:A.import)!=null?I:"Import",sub:e[0].p,subunit:e[0].pc,colorFn:Mf}}),{c(){t=m("div"),l=m("div"),n=m("div"),Ne(i.$$.fragment),o=b(),f=m("div"),c=k(r),a=b(),_=m("div"),v=k(p),d=b(),g=k(h),u(n,"class","col-span-2"),u(_,"class","text-right"),u(l,"class","grid grid-cols-2"),u(t,"class","cnt")},m(O,L){P(O,t,L),s(t,l),s(l,n),Se(i,n,null),s(l,o),s(l,f),s(f,c),s(l,a),s(l,_),s(_,v),s(_,d),s(_,g),M=!0},p(O,L){var U,E;const q={};L&1&&(q.val=O[0].i?O[0].i:0),L&1&&(q.max=O[0].im?O[0].im:15e3),L&64&&(q.label=(E=(U=O[6].common)==null?void 0:U.import)!=null?E:"Import"),L&1&&(q.sub=O[0].p),L&1&&(q.subunit=O[0].pc),i.$set(q),(!M||L&1)&&r!==(r=(O[0].mt?Ko(O[0].mt):"-")+"")&&C(c,r),(!M||L&128)&&p!==(p=O[7][0]+"")&&C(v,p),(!M||L&128)&&h!==(h=O[7][1]+"")&&C(g,h)},i(O){M||(Q(i.$$.fragment,O),M=!0)},o(O){ee(i.$$.fragment,O),M=!1},d(O){O&&T(t),Ce(i)}}}function xp(e){var g,M;let t,l,n,i,o,f,r,c,a=e[8][0]+"",_,p,v=e[8][1]+"",d,h;return i=new zv({props:{val:e[0].e?e[0].e:0,max:e[0].om?e[0].om*1e3:1e4,unit:"W",label:(M=(g=e[6].common)==null?void 0:g.export)!=null?M:"Export",colorFn:Rs}}),{c(){t=m("div"),l=m("div"),n=m("div"),Ne(i.$$.fragment),o=b(),f=m("div"),r=b(),c=m("div"),_=k(a),p=b(),d=k(v),u(n,"class","col-span-2"),u(c,"class","text-right"),u(l,"class","grid grid-cols-2"),u(t,"class","cnt")},m(A,I){P(A,t,I),s(t,l),s(l,n),Se(i,n,null),s(l,o),s(l,f),s(l,r),s(l,c),s(c,_),s(c,p),s(c,d),h=!0},p(A,I){var L,q;const O={};I&1&&(O.val=A[0].e?A[0].e:0),I&1&&(O.max=A[0].om?A[0].om*1e3:1e4),I&64&&(O.label=(q=(L=A[6].common)==null?void 0:L.export)!=null?q:"Export"),i.$set(O),(!h||I&256)&&a!==(a=A[8][0]+"")&&C(_,a),(!h||I&256)&&v!==(v=A[8][1]+"")&&C(d,v)},i(A){h||(Q(i.$$.fragment,A),h=!0)},o(A){ee(i.$$.fragment,A),h=!1},d(A){A&&T(t),Ce(i)}}}function e2(e){let t,l,n=e[0].l1&&t2(e);return{c(){t=m("div"),n&&n.c(),u(t,"class","cnt")},m(i,o){P(i,t,o),n&&n.m(t,null),l=!0},p(i,o){i[0].l1?n?(n.p(i,o),o&1&&Q(n,1)):(n=t2(i),n.c(),Q(n,1),n.m(t,null)):n&&(pt(),ee(n,1,1,()=>{n=null}),dt())},i(i){l||(Q(n),l=!0)},o(i){ee(n),l=!1},d(i){i&&T(t),n&&n.d()}}}function t2(e){var n,i;let t,l;return t=new n4({props:{title:(i=(n=e[6].common)==null?void 0:n.voltage)!=null?i:"Volt",u1:e[0].l1.u,u2:e[0].l2.u,u3:e[0].l3.u,ds:e[0].ds}}),{c(){Ne(t.$$.fragment)},m(o,f){Se(t,o,f),l=!0},p(o,f){var c,a;const r={};f&64&&(r.title=(a=(c=o[6].common)==null?void 0:c.voltage)!=null?a:"Volt"),f&1&&(r.u1=o[0].l1.u),f&1&&(r.u2=o[0].l2.u),f&1&&(r.u3=o[0].l3.u),f&1&&(r.ds=o[0].ds),t.$set(r)},i(o){l||(Q(t.$$.fragment,o),l=!0)},o(o){ee(t.$$.fragment,o),l=!1},d(o){Ce(t,o)}}}function l2(e){let t,l,n=e[0].l1&&n2(e);return{c(){t=m("div"),n&&n.c(),u(t,"class","cnt")},m(i,o){P(i,t,o),n&&n.m(t,null),l=!0},p(i,o){i[0].l1?n?(n.p(i,o),o&1&&Q(n,1)):(n=n2(i),n.c(),Q(n,1),n.m(t,null)):n&&(pt(),ee(n,1,1,()=>{n=null}),dt())},i(i){l||(Q(n),l=!0)},o(i){ee(n),l=!1},d(i){i&&T(t),n&&n.d()}}}function n2(e){var n,i;let t,l;return t=new Ef({props:{title:(i=(n=e[6].common)==null?void 0:n.amperage)!=null?i:"Amp",unit:"A",importColorFn:Mf,exportColorFn:Rs,maxImport:e[0].mf,maxExport:e[0].om?e[9]?e[0].om/.4/Math.sqrt(3):e[0].om/.23:0,l1:e[0].l1&&e[0].l1.u>100,l2:e[0].l2&&e[0].l2.u>100,l3:e[0].l3&&e[0].l3.u>100,l2x:e[0].i2e,l1i:Math.max(e[0].l1.i,0),l2i:Math.max(e[0].l2.i,0),l3i:Math.max(e[0].l3.i,0),l1e:Math.max(e[0].l1.e,0),l2e:Math.max(e[0].l2.e,0),l3e:Math.max(e[0].l3.e,0)}}),{c(){Ne(t.$$.fragment)},m(o,f){Se(t,o,f),l=!0},p(o,f){var c,a;const r={};f&64&&(r.title=(a=(c=o[6].common)==null?void 0:c.amperage)!=null?a:"Amp"),f&1&&(r.maxImport=o[0].mf),f&513&&(r.maxExport=o[0].om?o[9]?o[0].om/.4/Math.sqrt(3):o[0].om/.23:0),f&1&&(r.l1=o[0].l1&&o[0].l1.u>100),f&1&&(r.l2=o[0].l2&&o[0].l2.u>100),f&1&&(r.l3=o[0].l3&&o[0].l3.u>100),f&1&&(r.l2x=o[0].i2e),f&1&&(r.l1i=Math.max(o[0].l1.i,0)),f&1&&(r.l2i=Math.max(o[0].l2.i,0)),f&1&&(r.l3i=Math.max(o[0].l3.i,0)),f&1&&(r.l1e=Math.max(o[0].l1.e,0)),f&1&&(r.l2e=Math.max(o[0].l2.e,0)),f&1&&(r.l3e=Math.max(o[0].l3.e,0)),t.$set(r)},i(o){l||(Q(t.$$.fragment,o),l=!0)},o(o){ee(t.$$.fragment,o),l=!1},d(o){Ce(t,o)}}}function i2(e){let t,l,n=e[0].l1&&s2(e);return{c(){t=m("div"),n&&n.c(),u(t,"class","cnt")},m(i,o){P(i,t,o),n&&n.m(t,null),l=!0},p(i,o){i[0].l1?n?(n.p(i,o),o&1&&Q(n,1)):(n=s2(i),n.c(),Q(n,1),n.m(t,null)):n&&(pt(),ee(n,1,1,()=>{n=null}),dt())},i(i){l||(Q(n),l=!0)},o(i){ee(n),l=!1},d(i){i&&T(t),n&&n.d()}}}function s2(e){var n,i;let t,l;return t=new Ef({props:{title:(i=(n=e[6].dashboard)==null?void 0:n.phase)!=null?i:"Phase",unit:"W",importColorFn:Mf,exportColorFn:Rs,maxImport:(e[0].mf?e[0].mf:32)*230,maxExport:e[0].om?e[9]?e[0].om*1e3/Math.sqrt(3):e[0].om*1e3:0,l1:e[0].l1&&e[0].l1.u>100,l2:e[0].l2&&e[0].l2.u>100,l3:e[0].l3&&e[0].l3.u>100,l1i:e[0].l1.p,l2i:e[0].l2.p,l3i:e[0].l3.p,l1e:e[0].l1.q,l2e:e[0].l2.q,l3e:e[0].l3.q}}),{c(){Ne(t.$$.fragment)},m(o,f){Se(t,o,f),l=!0},p(o,f){var c,a;const r={};f&64&&(r.title=(a=(c=o[6].dashboard)==null?void 0:c.phase)!=null?a:"Phase"),f&1&&(r.maxImport=(o[0].mf?o[0].mf:32)*230),f&513&&(r.maxExport=o[0].om?o[9]?o[0].om*1e3/Math.sqrt(3):o[0].om*1e3:0),f&1&&(r.l1=o[0].l1&&o[0].l1.u>100),f&1&&(r.l2=o[0].l2&&o[0].l2.u>100),f&1&&(r.l3=o[0].l3&&o[0].l3.u>100),f&1&&(r.l1i=o[0].l1.p),f&1&&(r.l2i=o[0].l2.p),f&1&&(r.l3i=o[0].l3.p),f&1&&(r.l1e=o[0].l1.q),f&1&&(r.l2e=o[0].l2.q),f&1&&(r.l3e=o[0].l3.q),t.$set(r)},i(o){l||(Q(t.$$.fragment,o),l=!0)},o(o){ee(t.$$.fragment,o),l=!1},d(o){Ce(t,o)}}}function o2(e){let t,l,n=e[0].l1&&a2(e);return{c(){t=m("div"),n&&n.c(),u(t,"class","cnt")},m(i,o){P(i,t,o),n&&n.m(t,null),l=!0},p(i,o){i[0].l1?n?(n.p(i,o),o&1&&Q(n,1)):(n=a2(i),n.c(),Q(n,1),n.m(t,null)):n&&(pt(),ee(n,1,1,()=>{n=null}),dt())},i(i){l||(Q(n),l=!0)},o(i){ee(n),l=!1},d(i){i&&T(t),n&&n.d()}}}function a2(e){var n,i;let t,l;return t=new Ef({props:{title:(i=(n=e[6].dashboard)==null?void 0:n.pf)!=null?i:"Pf",importColorFn:Rs,exportColorFn:Rs,maxImport:1,l1:e[0].l1&&e[0].l1.u>100,l2:e[0].l2&&e[0].l2.u>100,l3:e[0].l3&&e[0].l3.u>100,l1i:e[0].l1.f,l2i:e[0].l2.f,l3i:e[0].l3.f}}),{c(){Ne(t.$$.fragment)},m(o,f){Se(t,o,f),l=!0},p(o,f){var c,a;const r={};f&64&&(r.title=(a=(c=o[6].dashboard)==null?void 0:c.pf)!=null?a:"Pf"),f&1&&(r.l1=o[0].l1&&o[0].l1.u>100),f&1&&(r.l2=o[0].l2&&o[0].l2.u>100),f&1&&(r.l3=o[0].l3&&o[0].l3.u>100),f&1&&(r.l1i=o[0].l1.f),f&1&&(r.l2i=o[0].l2.f),f&1&&(r.l3i=o[0].l3.f),t.$set(r)},i(o){l||(Q(t.$$.fragment,o),l=!0)},o(o){ee(t.$$.fragment,o),l=!1},d(o){Ce(t,o)}}}function f2(e){let t,l,n;return l=new o4({props:{importInstant:e[0].ri,exportInstant:e[0].re,importTotal:e[0].ric,exportTotal:e[0].rec}}),{c(){t=m("div"),Ne(l.$$.fragment),u(t,"class","cnt")},m(i,o){P(i,t,o),Se(l,t,null),n=!0},p(i,o){const f={};o&1&&(f.importInstant=i[0].ri),o&1&&(f.exportInstant=i[0].re),o&1&&(f.importTotal=i[0].ric),o&1&&(f.exportTotal=i[0].rec),l.$set(f)},i(i){n||(Q(l.$$.fragment,i),n=!0)},o(i){ee(l.$$.fragment,i),n=!1},d(i){i&&T(t),Ce(l)}}}function u2(e){let t,l,n;return l=new c4({props:{sysinfo:e[1],data:e[0].ea,currency:e[0].pc,hasExport:e[0].om>0||e[0].e>0}}),{c(){t=m("div"),Ne(l.$$.fragment),u(t,"class","cnt")},m(i,o){P(i,t,o),Se(l,t,null),n=!0},p(i,o){const f={};o&2&&(f.sysinfo=i[1]),o&1&&(f.data=i[0].ea),o&1&&(f.currency=i[0].pc),o&1&&(f.hasExport=i[0].om>0||i[0].e>0),l.$set(f)},i(i){n||(Q(l.$$.fragment,i),n=!0)},o(i){ee(l.$$.fragment,i),n=!1},d(i){i&&T(t),Ce(l)}}}function r2(e){var i,o;let t,l,n;return l=new P4({props:{title:(o=(i=e[6].dashboard)==null?void 0:i.tariffpeak)!=null?o:"Tariff peaks"}}),{c(){t=m("div"),Ne(l.$$.fragment),u(t,"class","cnt h-64")},m(f,r){P(f,t,r),Se(l,t,null),n=!0},p(f,r){var a,_;const c={};r&64&&(c.title=(_=(a=f[6].dashboard)==null?void 0:a.tariffpeak)!=null?_:"Tariff peaks"),l.$set(c)},i(f){n||(Q(l.$$.fragment,f),n=!0)},o(f){ee(l.$$.fragment,f),n=!1},d(f){f&&T(t),Ce(l)}}}function c2(e){var i,o;let t,l,n;return l=new q4({props:{title:(o=(i=e[6].dashboard)==null?void 0:i.realtime)!=null?o:"Real time"}}),{c(){t=m("div"),Ne(l.$$.fragment),u(t,"class","cnt gwf")},m(f,r){P(f,t,r),Se(l,t,null),n=!0},p(f,r){var a,_;const c={};r&64&&(c.title=(_=(a=f[6].dashboard)==null?void 0:a.realtime)!=null?_:"Real time"),l.$set(c)},i(f){n||(Q(l.$$.fragment,f),n=!0)},o(f){ee(l.$$.fragment,f),n=!1},d(f){f&&T(t),Ce(l)}}}function _2(e){var i,o;let t,l,n;return l=new p4({props:{title:(o=(i=e[6].dashboard)==null?void 0:i.price)!=null?o:"Price",json:e[2],sysinfo:e[1]}}),{c(){t=m("div"),Ne(l.$$.fragment),u(t,"class","cnt gwf")},m(f,r){P(f,t,r),Se(l,t,null),n=!0},p(f,r){var a,_;const c={};r&64&&(c.title=(_=(a=f[6].dashboard)==null?void 0:a.price)!=null?_:"Price"),r&4&&(c.json=f[2]),r&2&&(c.sysinfo=f[1]),l.$set(c)},i(f){n||(Q(l.$$.fragment,f),n=!0)},o(f){ee(l.$$.fragment,f),n=!1},d(f){f&&T(t),Ce(l)}}}function m2(e){var i,o;let t,l,n;return l=new h4({props:{title:(o=(i=e[6].dashboard)==null?void 0:i.day)!=null?o:"24 hours",json:e[3],sysinfo:e[1]}}),{c(){t=m("div"),Ne(l.$$.fragment),u(t,"class","cnt gwf")},m(f,r){P(f,t,r),Se(l,t,null),n=!0},p(f,r){var a,_;const c={};r&64&&(c.title=(_=(a=f[6].dashboard)==null?void 0:a.day)!=null?_:"24 hours"),r&8&&(c.json=f[3]),r&2&&(c.sysinfo=f[1]),l.$set(c)},i(f){n||(Q(l.$$.fragment,f),n=!0)},o(f){ee(l.$$.fragment,f),n=!1},d(f){f&&T(t),Ce(l)}}}function p2(e){var i,o;let t,l,n;return l=new k4({props:{title:(o=(i=e[6].dashboard)==null?void 0:i.month)!=null?o:"{0} days",json:e[4],sysinfo:e[1]}}),{c(){t=m("div"),Ne(l.$$.fragment),u(t,"class","cnt gwf")},m(f,r){P(f,t,r),Se(l,t,null),n=!0},p(f,r){var a,_;const c={};r&64&&(c.title=(_=(a=f[6].dashboard)==null?void 0:a.month)!=null?_:"{0} days"),r&16&&(c.json=f[4]),r&2&&(c.sysinfo=f[1]),l.$set(c)},i(f){n||(Q(l.$$.fragment,f),n=!0)},o(f){ee(l.$$.fragment,f),n=!1},d(f){f&&T(t),Ce(l)}}}function d2(e){var i,o;let t,l,n;return l=new S4({props:{title:(o=(i=e[6].dashboard)==null?void 0:i.temperature)!=null?o:"Temperature",json:e[5]}}),{c(){t=m("div"),Ne(l.$$.fragment),u(t,"class","cnt gwf")},m(f,r){P(f,t,r),Se(l,t,null),n=!0},p(f,r){var a,_;const c={};r&64&&(c.title=(_=(a=f[6].dashboard)==null?void 0:a.temperature)!=null?_:"Temperature"),r&32&&(c.json=f[5]),l.$set(c)},i(f){n||(Q(l.$$.fragment,f),n=!0)},o(f){ee(l.$$.fragment,f),n=!1},d(f){f&&T(t),Ce(l)}}}function L4(e){let t,l=Ot(e[1].ui.i,e[0].i),n,i=Ot(e[1].ui.e,e[0].om||e[0].e>0),o,f=Ot(e[1].ui.v,e[0].l1&&(e[0].l1.u>100||e[0].l2.u>100||e[0].l3.u>100)),r,c=Ot(e[1].ui.a,e[0].l1&&(e[0].l1.i>.01||e[0].l2.i>.01||e[0].l3.i>.01)),a,_=Ot(e[1].ui.h,e[0].l1&&(e[0].l1.p>.01||e[0].l2.p>.01||e[0].l3.p>.01||e[0].l1.q>.01||e[0].l2.q>.01||e[0].l3.q>.01)),p,v=Ot(e[1].ui.f,e[0].l1&&(e[0].l1.f>.01||e[0].l2.f>.01||e[0].l3.f>.01)),d,h=Ot(e[1].ui.r,e[0].ri>0||e[0].re>0||e[0].ric>0||e[0].rec>0),g,M=Ot(e[1].ui.c,e[0].ea),A,I=Ot(e[1].ui.t,e[0].pr&&(e[0].pr.startsWith("NO")||e[0].pr.startsWith("10YNO")||e[0].pr.startsWith("10Y1001A1001A4"))),O,L=Ot(e[1].ui.l),q,U=Ot(e[1].ui.p,e[0].pe&&!Number.isNaN(e[0].p)),E,F=Ot(e[1].ui.d,e[3]),z,G=Ot(e[1].ui.m,e[4]),B,R=Ot(e[1].ui.s,e[0].t&&e[0].t!=-127&&e[5].c>1),K,y=l&&$p(e),H=i&&xp(e),Y=f&&e2(e),X=c&&l2(e),J=_&&i2(e),$=v&&o2(e),ce=h&&f2(e),ie=M&&u2(e),oe=I&&r2(e),ae=L&&c2(e),se=U&&_2(e),x=F&&m2(e),me=G&&p2(e),pe=R&&d2(e);return{c(){t=m("div"),y&&y.c(),n=b(),H&&H.c(),o=b(),Y&&Y.c(),r=b(),X&&X.c(),a=b(),J&&J.c(),p=b(),$&&$.c(),d=b(),ce&&ce.c(),g=b(),ie&&ie.c(),A=b(),oe&&oe.c(),O=b(),ae&&ae.c(),q=b(),se&&se.c(),E=b(),x&&x.c(),z=b(),me&&me.c(),B=b(),pe&&pe.c(),u(t,"class","grid 2xl:grid-cols-6 xl:grid-cols-5 lg:grid-cols-4 md:grid-cols-3 sm:grid-cols-2")},m(V,Z){P(V,t,Z),y&&y.m(t,null),s(t,n),H&&H.m(t,null),s(t,o),Y&&Y.m(t,null),s(t,r),X&&X.m(t,null),s(t,a),J&&J.m(t,null),s(t,p),$&&$.m(t,null),s(t,d),ce&&ce.m(t,null),s(t,g),ie&&ie.m(t,null),s(t,A),oe&&oe.m(t,null),s(t,O),ae&&ae.m(t,null),s(t,q),se&&se.m(t,null),s(t,E),x&&x.m(t,null),s(t,z),me&&me.m(t,null),s(t,B),pe&&pe.m(t,null),K=!0},p(V,[Z]){Z&3&&(l=Ot(V[1].ui.i,V[0].i)),l?y?(y.p(V,Z),Z&3&&Q(y,1)):(y=$p(V),y.c(),Q(y,1),y.m(t,n)):y&&(pt(),ee(y,1,1,()=>{y=null}),dt()),Z&3&&(i=Ot(V[1].ui.e,V[0].om||V[0].e>0)),i?H?(H.p(V,Z),Z&3&&Q(H,1)):(H=xp(V),H.c(),Q(H,1),H.m(t,o)):H&&(pt(),ee(H,1,1,()=>{H=null}),dt()),Z&3&&(f=Ot(V[1].ui.v,V[0].l1&&(V[0].l1.u>100||V[0].l2.u>100||V[0].l3.u>100))),f?Y?(Y.p(V,Z),Z&3&&Q(Y,1)):(Y=e2(V),Y.c(),Q(Y,1),Y.m(t,r)):Y&&(pt(),ee(Y,1,1,()=>{Y=null}),dt()),Z&3&&(c=Ot(V[1].ui.a,V[0].l1&&(V[0].l1.i>.01||V[0].l2.i>.01||V[0].l3.i>.01))),c?X?(X.p(V,Z),Z&3&&Q(X,1)):(X=l2(V),X.c(),Q(X,1),X.m(t,a)):X&&(pt(),ee(X,1,1,()=>{X=null}),dt()),Z&3&&(_=Ot(V[1].ui.h,V[0].l1&&(V[0].l1.p>.01||V[0].l2.p>.01||V[0].l3.p>.01||V[0].l1.q>.01||V[0].l2.q>.01||V[0].l3.q>.01))),_?J?(J.p(V,Z),Z&3&&Q(J,1)):(J=i2(V),J.c(),Q(J,1),J.m(t,p)):J&&(pt(),ee(J,1,1,()=>{J=null}),dt()),Z&3&&(v=Ot(V[1].ui.f,V[0].l1&&(V[0].l1.f>.01||V[0].l2.f>.01||V[0].l3.f>.01))),v?$?($.p(V,Z),Z&3&&Q($,1)):($=o2(V),$.c(),Q($,1),$.m(t,d)):$&&(pt(),ee($,1,1,()=>{$=null}),dt()),Z&3&&(h=Ot(V[1].ui.r,V[0].ri>0||V[0].re>0||V[0].ric>0||V[0].rec>0)),h?ce?(ce.p(V,Z),Z&3&&Q(ce,1)):(ce=f2(V),ce.c(),Q(ce,1),ce.m(t,g)):ce&&(pt(),ee(ce,1,1,()=>{ce=null}),dt()),Z&3&&(M=Ot(V[1].ui.c,V[0].ea)),M?ie?(ie.p(V,Z),Z&3&&Q(ie,1)):(ie=u2(V),ie.c(),Q(ie,1),ie.m(t,A)):ie&&(pt(),ee(ie,1,1,()=>{ie=null}),dt()),Z&3&&(I=Ot(V[1].ui.t,V[0].pr&&(V[0].pr.startsWith("NO")||V[0].pr.startsWith("10YNO")||V[0].pr.startsWith("10Y1001A1001A4")))),I?oe?(oe.p(V,Z),Z&3&&Q(oe,1)):(oe=r2(V),oe.c(),Q(oe,1),oe.m(t,O)):oe&&(pt(),ee(oe,1,1,()=>{oe=null}),dt()),Z&2&&(L=Ot(V[1].ui.l)),L?ae?(ae.p(V,Z),Z&2&&Q(ae,1)):(ae=c2(V),ae.c(),Q(ae,1),ae.m(t,q)):ae&&(pt(),ee(ae,1,1,()=>{ae=null}),dt()),Z&3&&(U=Ot(V[1].ui.p,V[0].pe&&!Number.isNaN(V[0].p))),U?se?(se.p(V,Z),Z&3&&Q(se,1)):(se=_2(V),se.c(),Q(se,1),se.m(t,E)):se&&(pt(),ee(se,1,1,()=>{se=null}),dt()),Z&10&&(F=Ot(V[1].ui.d,V[3])),F?x?(x.p(V,Z),Z&10&&Q(x,1)):(x=m2(V),x.c(),Q(x,1),x.m(t,z)):x&&(pt(),ee(x,1,1,()=>{x=null}),dt()),Z&18&&(G=Ot(V[1].ui.m,V[4])),G?me?(me.p(V,Z),Z&18&&Q(me,1)):(me=p2(V),me.c(),Q(me,1),me.m(t,B)):me&&(pt(),ee(me,1,1,()=>{me=null}),dt()),Z&35&&(R=Ot(V[1].ui.s,V[0].t&&V[0].t!=-127&&V[5].c>1)),R?pe?(pe.p(V,Z),Z&35&&Q(pe,1)):(pe=d2(V),pe.c(),Q(pe,1),pe.m(t,null)):pe&&(pt(),ee(pe,1,1,()=>{pe=null}),dt())},i(V){K||(Q(y),Q(H),Q(Y),Q(X),Q(J),Q($),Q(ce),Q(ie),Q(oe),Q(ae),Q(se),Q(x),Q(me),Q(pe),K=!0)},o(V){ee(y),ee(H),ee(Y),ee(X),ee(J),ee($),ee(ce),ee(ie),ee(oe),ee(ae),ee(se),ee(x),ee(me),ee(pe),K=!1},d(V){V&&T(t),y&&y.d(),H&&H.d(),Y&&Y.d(),X&&X.d(),J&&J.d(),$&&$.d(),ce&&ce.d(),ie&&ie.d(),oe&&oe.d(),ae&&ae.d(),se&&se.d(),x&&x.d(),me&&me.d(),pe&&pe.d()}}}function R4(e,t,l){let{data:n={}}=t,{sysinfo:i={}}=t,o={},f={},r={},c={};Cf.subscribe(d=>{l(2,o=d)}),qv.subscribe(d=>{l(3,f=d)}),Ov.subscribe(d=>{l(4,r=d)}),Lv.subscribe(d=>{l(5,c=d)});let a={};Ml.subscribe(d=>{l(6,a=d)});let _,p,v;return e.$$set=d=>{"data"in d&&l(0,n=d.data),"sysinfo"in d&&l(1,i=d.sysinfo)},e.$$.update=()=>{var d,h,g;e.$$.dirty&1&&(l(7,_=gl((n==null?void 0:n.ic)*1e3,"Wh")),l(8,p=gl((n==null?void 0:n.ec)*1e3,"Wh")),l(9,v=((d=n==null?void 0:n.l1)==null?void 0:d.u)>100&&((h=n==null?void 0:n.l2)==null?void 0:h.u)>100&&((g=n==null?void 0:n.l3)==null?void 0:g.u)>100))},[n,i,o,f,r,c,a,_,p,v]}class F4 extends mt{constructor(t){super(),_t(this,t,R4,L4,ct,{data:0,sysinfo:1})}}let ff={};const qs=xt(ff);async function B4(){ff=await(await fetch("configuration.json")).json(),qs.set(ff)}let uf={};const Wv=xt(uf);async function U4(){uf=await(await fetch("priceconfig.json")).json(),Wv.set(uf)}function v2(e,t,l){const n=e.slice();return n[2]=t[l],n[4]=l,n}function j4(e){let t;return{c(){t=m("option"),t.textContent="UART0",t.__value=3,t.value=t.__value},m(l,n){P(l,t,n)},d(l){l&&T(t)}}}function H4(e){let t;return{c(){t=m("option"),t.textContent="UART0",t.__value=20,t.value=t.__value},m(l,n){P(l,t,n)},d(l){l&&T(t)}}}function h2(e){let t;return{c(){t=m("option"),t.textContent="UART2",t.__value=113,t.value=t.__value},m(l,n){P(l,t,n)},d(l){l&&T(t)}}}function b2(e){let t,l,n;return{c(){t=m("option"),t.textContent="UART1",l=b(),n=m("option"),n.textContent="UART2",t.__value=9,t.value=t.__value,n.__value=16,n.value=n.__value},m(i,o){P(i,t,o),P(i,l,o),P(i,n,o)},d(i){i&&T(t),i&&T(l),i&&T(n)}}}function g2(e){let t;return{c(){t=m("option"),t.textContent="UART1",t.__value=18,t.value=t.__value},m(l,n){P(l,t,n)},d(l){l&&T(t)}}}function k2(e){let t,l,n;return{c(){t=m("option"),l=k("GPIO"),n=k(e[4]),t.__value=e[4],t.value=t.__value},m(i,o){P(i,t,o),s(t,l),s(t,n)},d(i){i&&T(t)}}}function w2(e){let t,l=e[4]>1&&!(e[0]=="esp32"&&(e[4]==9||e[4]==16))&&!((e[0]=="esp32s2"||e[0]=="esp32s3")&&e[4]==18)&&!(e[0]=="esp8266"&&(e[4]==3||e[4]==113))&&k2(e);return{c(){l&&l.c(),t=Ut()},m(n,i){l&&l.m(n,i),P(n,t,i)},p(n,i){n[4]>1&&!(n[0]=="esp32"&&(n[4]==9||n[4]==16))&&!((n[0]=="esp32s2"||n[0]=="esp32s3")&&n[4]==18)&&!(n[0]=="esp8266"&&(n[4]==3||n[4]==113))?l||(l=k2(n),l.c(),l.m(t.parentNode,t)):l&&(l.d(1),l=null)},d(n){l&&l.d(n),n&&T(t)}}}function y4(e){let t,l,n,i,o;function f(h,g){return h[0]=="esp32c3"?H4:j4}let r=f(e),c=r(e),a=e[0]=="esp8266"&&h2(),_=(e[0]=="esp32"||e[0]=="esp32solo")&&b2(),p=(e[0]=="esp32s2"||e[0]=="esp32s3")&&g2(),v={length:e[1]+1},d=[];for(let h=0;h{"chip"in o&&l(0,n=o.chip)},e.$$.update=()=>{if(e.$$.dirty&1)switch(n){case"esp8266":l(1,i=16);break;case"esp32s2":l(1,i=44);break;case"esp32s3":l(1,i=46);break;case"esp32c3":l(1,i=19);break}},[n,i]}class rf extends mt{constructor(t){super(),_t(this,t,z4,y4,ct,{chip:0})}}function M2(e){let t,l,n=e[1]&&S2(e);return{c(){t=m("div"),l=m("div"),n&&n.c(),u(l,"class","fixed inset-0 bg-gray-500 dark:bg-gray-900 bg-opacity-50 dark:bg-opacity-80 flex items-center justify-center"),u(t,"class","z-50"),u(t,"aria-modal","true")},m(i,o){P(i,t,o),s(t,l),n&&n.m(l,null)},p(i,o){i[1]?n?n.p(i,o):(n=S2(i),n.c(),n.m(l,null)):n&&(n.d(1),n=null)},d(i){i&&T(t),n&&n.d()}}}function S2(e){let t,l;return{c(){t=m("div"),l=k(e[1]),u(t,"class","bg-white dark:bg-gray-600 m-2 p-3 rounded-md shadow-lg pb-4 text-gray-700 dark:text-white w-96")},m(n,i){P(n,t,i),s(t,l)},p(n,i){i&2&&C(l,n[1])},d(n){n&&T(t)}}}function W4(e){let t,l=e[0]&&M2(e);return{c(){l&&l.c(),t=Ut()},m(n,i){l&&l.m(n,i),P(n,t,i)},p(n,[i]){n[0]?l?l.p(n,i):(l=M2(n),l.c(),l.m(t.parentNode,t)):l&&(l.d(1),l=null)},i:ze,o:ze,d(n){l&&l.d(n),n&&T(t)}}}function G4(e,t,l){let{active:n}=t,{message:i}=t;return e.$$set=o=>{"active"in o&&l(0,n=o.active),"message"in o&&l(1,i=o.message)},[n,i]}class kl extends mt{constructor(t){super(),_t(this,t,G4,W4,ct,{active:0,message:1})}}function C2(e,t,l){const n=e.slice();return n[1]=t[l],n}function N2(e){let t,l,n=e[1]+"",i;return{c(){t=m("option"),l=k("Europe/"),i=k(n),t.__value="Europe/"+e[1],t.value=t.__value},m(o,f){P(o,t,f),s(t,l),s(t,i)},p:ze,d(o){o&&T(t)}}}function V4(e){let t,l,n,i=e[0],o=[];for(let f=0;f>1&1,D=0;D0;w--)D[w]=D[w]?D[w-1]^q.EXPONENT[F._modN(q.LOG[D[w]]+S)]:D[w-1];D[0]=q.EXPONENT[F._modN(q.LOG[D[0]]+S)]}for(S=0;S<=N;S++)D[S]=q.LOG[D[S]]},_checkBadness:function(){var S,w,N,D,j,te=0,le=this._badness,fe=this.buffer,de=this.width;for(j=0;jde*de;)we-=de*de,Pe++;for(te+=Pe*F.N4,D=0;D=le-2&&(S=le-2,j>9&&S--);var fe=S;if(j>9){for(te[fe+2]=0,te[fe+3]=0;fe--;)w=te[fe],te[fe+3]|=255&w<<4,te[fe+2]=w>>4;te[2]|=255&S<<4,te[1]=S>>4,te[0]=64|S>>12}else{for(te[fe+1]=0,te[fe+2]=0;fe--;)w=te[fe],te[fe+2]|=255&w<<4,te[fe+1]=w>>4;te[1]|=255&S<<4,te[0]=64|S>>4}for(fe=S+3-(j<10);fe=5&&(N+=F.N1+D[w]-5);for(w=3;wS||D[w-3]*3>=D[w]*4||D[w+3]*3>=D[w]*4)&&(N+=F.N3);return N},_finish:function(){this._stringBuffer=this.buffer.slice();var S,w,N=0,D=3e4;for(w=0;w<8&&(this._applyMask(w),S=this._checkBadness(),S>=1)D&1&&(j[te-1-w+te*8]=1,w<6?j[8+te*w]=1:j[8+te*(w+1)]=1);for(w=0;w<7;w++,D>>=1)D&1&&(j[8+te*(te-7+w)]=1,w?j[6-w+te*8]=1:j[7+te*8]=1)},_interleaveBlocks:function(){var S,w,N=this._dataBlock,D=this._ecc,j=this._eccBlock,te=0,le=this._calculateMaxLength(),fe=this._neccBlock1,de=this._neccBlock2,qe=this._stringBuffer;for(S=0;S1)for(S=A.BLOCK[D],N=j-7;;){for(w=j-7;w>S-3&&(this._addAlignment(w,N),!(w6)for(S=E.BLOCK[te-7],w=17,N=0;N<6;N++)for(D=0;D<3;D++,w--)1&(w>11?te>>w-12:S>>w)?(j[5-N+le*(2-D+le-11)]=1,j[2-D+le-11+le*(5-N)]=1):(this._setMask(5-N,2-D+le-11),this._setMask(2-D+le-11,5-N))},_isMasked:function(S,w){var N=F._getMaskBit(S,w);return this._mask[N]===1},_pack:function(){var S,w,N,D=1,j=1,te=this.width,le=te-1,fe=te-1,de=(this._dataBlock+this._eccBlock)*(this._neccBlock1+this._neccBlock2)+this._neccBlock2;for(w=0;ww&&(N=S,S=w,w=N),N=w,N+=w*w,N>>=1,N+=S,N},_modN:function(S){for(;S>=255;)S-=255,S=(S>>8)+(S&255);return S},N1:3,N2:3,N3:40,N4:10}),z=F,G=d.extend({draw:function(){this.element.src=this.qrious.toDataURL()},reset:function(){this.element.src=""},resize:function(){var S=this.element;S.width=S.height=this.qrious.size}}),B=G,R=p.extend(function(S,w,N,D){this.name=S,this.modifiable=Boolean(w),this.defaultValue=N,this._valueTransformer=D},{transform:function(S){var w=this._valueTransformer;return typeof w=="function"?w(S,this):S}}),K=R,y=p.extend(null,{abs:function(S){return S!=null?Math.abs(S):null},hasOwn:function(S,w){return Object.prototype.hasOwnProperty.call(S,w)},noop:function(){},toUpperCase:function(S){return S!=null?S.toUpperCase():null}}),H=y,Y=p.extend(function(S){this.options={},S.forEach(function(w){this.options[w.name]=w},this)},{exists:function(S){return this.options[S]!=null},get:function(S,w){return Y._get(this.options[S],w)},getAll:function(S){var w,N=this.options,D={};for(w in N)H.hasOwn(N,w)&&(D[w]=Y._get(N[w],S));return D},init:function(S,w,N){typeof N!="function"&&(N=H.noop);var D,j;for(D in this.options)H.hasOwn(this.options,D)&&(j=this.options[D],Y._set(j,j.defaultValue,w),Y._createAccessor(j,w,N));this._setAll(S,w,!0)},set:function(S,w,N){return this._set(S,w,N)},setAll:function(S,w){return this._setAll(S,w)},_set:function(S,w,N,D){var j=this.options[S];if(!j)throw new Error("Invalid option: "+S);if(!j.modifiable&&!D)throw new Error("Option cannot be modified: "+S);return Y._set(j,w,N)},_setAll:function(S,w,N){if(!S)return!1;var D,j=!1;for(D in S)H.hasOwn(S,D)&&this._set(D,S[D],w,N)&&(j=!0);return j}},{_createAccessor:function(S,w,N){var D={get:function(){return Y._get(S,w)}};S.modifiable&&(D.set=function(j){Y._set(S,j,w)&&N(j,S)}),Object.defineProperty(w,S.name,D)},_get:function(S,w){return w["_"+S.name]},_set:function(S,w,N){var D="_"+S.name,j=N[D],te=S.transform(w!=null?w:S.defaultValue);return N[D]=te,te!==j}}),X=Y,J=p.extend(function(){this._services={}},{getService:function(S){var w=this._services[S];if(!w)throw new Error("Service is not being managed with name: "+S);return w},setService:function(S,w){if(this._services[S])throw new Error("Service is already managed with name: "+S);w&&(this._services[S]=w)}}),$=J,ce=new X([new K("background",!0,"white"),new K("backgroundAlpha",!0,1,H.abs),new K("element"),new K("foreground",!0,"black"),new K("foregroundAlpha",!0,1,H.abs),new K("level",!0,"L",H.toUpperCase),new K("mime",!0,"image/png"),new K("padding",!0,null,H.abs),new K("size",!0,100,H.abs),new K("value",!0,"")]),ie=new $,oe=p.extend(function(S){ce.init(S,this,this.update.bind(this));var w=ce.get("element",this),N=ie.getService("element"),D=w&&N.isCanvas(w)?w:N.createCanvas(),j=w&&N.isImage(w)?w:N.createImage();this._canvasRenderer=new g(this,D,!0),this._imageRenderer=new B(this,j,j===w),this.update()},{get:function(){return ce.getAll(this)},set:function(S){ce.setAll(S,this)&&this.update()},toDataURL:function(S){return this.canvas.toDataURL(S||this.mime)},update:function(){var S=new z({level:this.level,value:this.value});this._canvasRenderer.render(S),this._imageRenderer.render(S)}},{use:function(S){ie.setService(S.getName(),S)}});Object.defineProperties(oe.prototype,{canvas:{get:function(){return this._canvasRenderer.getElement()}},image:{get:function(){return this._imageRenderer.getElement()}}});var ae=oe,se=ae,x=p.extend({getName:function(){}}),me=x,pe=me.extend({createCanvas:function(){},createImage:function(){},getName:function(){return"element"},isCanvas:function(S){},isImage:function(S){}}),V=pe,Z=V.extend({createCanvas:function(){return document.createElement("canvas")},createImage:function(){return document.createElement("img")},isCanvas:function(S){return S instanceof HTMLCanvasElement},isImage:function(S){return S instanceof HTMLImageElement}}),ge=Z;se.use(new ge);var ve=se;return ve})})(Vv);const Z4=Vv.exports;function J4(e){let t,l;return{c(){t=m("img"),yo(t.src,l=e[2])||u(t,"src",l),u(t,"alt",e[0]),u(t,"class",e[1])},m(n,i){P(n,t,i)},p(n,[i]){i&4&&!yo(t.src,l=n[2])&&u(t,"src",l),i&1&&u(t,"alt",n[0]),i&2&&u(t,"class",n[1])},i:ze,o:ze,d(n){n&&T(t)}}}function $4(e,t,l){const n=new Z4;let{errorCorrection:i="L"}=t,{background:o="#fff"}=t,{color:f="#000"}=t,{size:r="200"}=t,{value:c=""}=t,{padding:a=0}=t,{className:_="qrcode"}=t,p="";function v(){n.set({background:o,foreground:f,level:i,padding:a,size:r,value:c}),l(2,p=n.toDataURL("image/jpeg"))}return Jd(()=>{v()}),e.$$set=d=>{"errorCorrection"in d&&l(3,i=d.errorCorrection),"background"in d&&l(4,o=d.background),"color"in d&&l(5,f=d.color),"size"in d&&l(6,r=d.size),"value"in d&&l(0,c=d.value),"padding"in d&&l(7,a=d.padding),"className"in d&&l(1,_=d.className)},e.$$.update=()=>{e.$$.dirty&1&&c&&v()},[c,_,p,i,o,f,r,a]}class x4 extends mt{constructor(t){super(),_t(this,t,$4,J4,ct,{errorCorrection:3,background:4,color:5,size:6,value:0,padding:7,className:1})}}function T2(e,t,l){const n=e.slice();return n[107]=t[l],n}function P2(e,t,l){const n=e.slice();return n[110]=t[l],n[111]=t,n[112]=l,n}function E2(e,t,l){const n=e.slice();return n[113]=t[l],n[114]=t,n[115]=l,n}function eg(e,t,l){const n=e.slice();return n[116]=t[l],n}function tg(e,t,l){const n=e.slice();return n[119]=t[l],n}function A2(e){let t,l,n,i,o;return{c(){t=m("option"),t.textContent="NO1 with support",l=m("option"),l.textContent="NO2 with support",n=m("option"),n.textContent="NO3 with support",i=m("option"),i.textContent="NO4 with support",o=m("option"),o.textContent="NO5 with support",t.__value="NO1S",t.value=t.__value,l.__value="NO2S",l.value=l.__value,n.__value="NO3S",n.value=n.__value,i.__value="NO4S",i.value=i.__value,o.__value="NO5S",o.value=o.__value},m(f,r){P(f,t,r),P(f,l,r),P(f,n,r),P(f,i,r),P(f,o,r)},d(f){f&&T(t),f&&T(l),f&&T(n),f&&T(i),f&&T(o)}}}function lg(e){let t,l;return{c(){t=m("option"),l=k(e[119]),t.__value=e[119],t.value=t.__value},m(n,i){P(n,t,i),s(t,l)},p:ze,d(n){n&&T(t)}}}function ng(e){var n,i,o;let t=((o=(i=(n=e[1].conf)==null?void 0:n.price)==null?void 0:i.conf)!=null?o:"Configure")+"",l;return{c(){l=k(t)},m(f,r){P(f,l,r)},p(f,r){var c,a,_;r[0]&2&&t!==(t=((_=(a=(c=f[1].conf)==null?void 0:c.price)==null?void 0:a.conf)!=null?_:"Configure")+"")&&C(l,t)},d(f){f&&T(l)}}}function D2(e){let t,l,n,i,o;return{c(){var f,r,c;t=m("br"),l=m("input"),u(l,"name","pt"),u(l,"type","text"),u(l,"class","in-s"),u(l,"placeholder",n=(c=(r=(f=e[1].conf)==null?void 0:f.price)==null?void 0:r.api_key_placeholder)!=null?c:"")},m(f,r){P(f,t,r),P(f,l,r),be(l,e[4].p.t),i||(o=re(l,"input",e[24]),i=!0)},p(f,r){var c,a,_;r[0]&2&&n!==(n=(_=(a=(c=f[1].conf)==null?void 0:c.price)==null?void 0:a.api_key_placeholder)!=null?_:"")&&u(l,"placeholder",n),r[0]&16&&l.value!==f[4].p.t&&be(l,f[4].p.t)},d(f){f&&T(t),f&&T(l),i=!1,o()}}}function q2(e){var M,A,I,O,L,q,U,E;let t,l=((O=(I=(A=(M=e[1].conf)==null?void 0:M.general)==null?void 0:A.security)==null?void 0:I.username)!=null?O:"Username")+"",n,i,o,f,r,c,a=((E=(U=(q=(L=e[1].conf)==null?void 0:L.general)==null?void 0:q.security)==null?void 0:U.password)!=null?E:"Password")+"",_,p,v,d,h,g;return{c(){t=m("div"),n=k(l),i=m("br"),o=b(),f=m("input"),r=b(),c=m("div"),_=k(a),p=m("br"),v=b(),d=m("input"),u(f,"name","gu"),u(f,"type","text"),u(f,"class","in-s"),u(f,"maxlength","36"),u(t,"class","my-1"),u(d,"name","gp"),u(d,"type","password"),u(d,"class","in-s"),u(d,"maxlength","36"),u(c,"class","my-1")},m(F,z){P(F,t,z),s(t,n),s(t,i),s(t,o),s(t,f),be(f,e[4].g.u),P(F,r,z),P(F,c,z),s(c,_),s(c,p),s(c,v),s(c,d),be(d,e[4].g.p),h||(g=[re(f,"input",e[26]),re(d,"input",e[27])],h=!0)},p(F,z){var G,B,R,K,y,H,Y,X;z[0]&2&&l!==(l=((K=(R=(B=(G=F[1].conf)==null?void 0:G.general)==null?void 0:B.security)==null?void 0:R.username)!=null?K:"Username")+"")&&C(n,l),z[0]&16&&f.value!==F[4].g.u&&be(f,F[4].g.u),z[0]&2&&a!==(a=((X=(Y=(H=(y=F[1].conf)==null?void 0:y.general)==null?void 0:H.security)==null?void 0:Y.password)!=null?X:"Password")+"")&&C(_,a),z[0]&16&&d.value!==F[4].g.p&&be(d,F[4].g.p)},d(F){F&&T(t),F&&T(r),F&&T(c),h=!1,Et(g)}}}function ig(e){var ae,se,x,me,pe,V,Z,ge,ve;let t,l,n=((x=(se=(ae=e[1].conf)==null?void 0:ae.meter)==null?void 0:se.buffer)!=null?x:"Buffer size")+"",i,o,f,r=((V=(pe=(me=e[1].conf)==null?void 0:me.meter)==null?void 0:pe.serial)!=null?V:"Serial conf.")+"",c,a,_,p,v,d=((ve=(ge=(Z=e[1].conf)==null?void 0:Z.meter)==null?void 0:ge.inverted)!=null?ve:"inverted")+"",h,g,M,A,I,O,L,q,U,E,F,z,G,B,R,K,y,H,Y,X,J,$,ce,ie=[3,12,24,48,96,192,384,576,1152],oe=[];for(let S=0;S<9;S+=1)oe[S]=og(eg(e,ie,S));return{c(){t=m("div"),l=m("span"),i=k(n),o=b(),f=m("span"),c=k(r),a=b(),_=m("label"),p=m("input"),v=b(),h=k(d),g=b(),M=m("div"),A=m("select"),I=m("option"),O=k("Autodetect");for(let S=0;S<9;S+=1)oe[S].c();q=b(),U=m("select"),E=m("option"),F=k("-"),G=m("option"),G.textContent="7N1",B=m("option"),B.textContent="8N1",R=m("option"),R.textContent="8N2",K=m("option"),K.textContent="7E1",y=m("option"),y.textContent="8E1",Y=b(),X=m("input"),u(l,"class","float-right"),u(p,"name","mi"),p.__value="true",p.value=p.__value,u(p,"type","checkbox"),u(p,"class","rounded mb-1"),u(_,"class","mt-2 ml-3 whitespace-nowrap"),I.__value=0,I.value=I.__value,I.disabled=L=e[4].m.b!=0,u(A,"name","mb"),u(A,"class","in-f tr w-1/2"),e[4].m.b===void 0&&Ct(()=>e[32].call(A)),E.__value=0,E.value=E.__value,E.disabled=z=e[4].m.b!=0,G.__value=2,G.value=G.__value,B.__value=3,B.value=B.__value,R.__value=7,R.value=R.__value,K.__value=10,K.value=K.__value,y.__value=11,y.value=y.__value,u(U,"name","mp"),u(U,"class","in-m"),U.disabled=H=e[4].m.b==0,e[4].m.p===void 0&&Ct(()=>e[33].call(U)),u(X,"name","ms"),u(X,"type","number"),u(X,"min",64),u(X,"max",J=e[0].chip=="esp8266"?e[4].i.h.p==3||e[4].i.h.p==113?512:128:4096),u(X,"step",64),u(X,"class","in-l tr w-1/2"),u(M,"class","flex w-full"),u(t,"class","my-1")},m(S,w){P(S,t,w),s(t,l),s(l,i),s(t,o),s(t,f),s(f,c),s(t,a),s(t,_),s(_,p),p.checked=e[4].m.i,s(_,v),s(_,h),s(t,g),s(t,M),s(M,A),s(A,I),s(I,O);for(let N=0;N<9;N+=1)oe[N]&&oe[N].m(A,null);Ze(A,e[4].m.b,!0),s(M,q),s(M,U),s(U,E),s(E,F),s(U,G),s(U,B),s(U,R),s(U,K),s(U,y),Ze(U,e[4].m.p,!0),s(M,Y),s(M,X),be(X,e[4].m.s),$||(ce=[re(p,"change",e[31]),re(A,"change",e[32]),re(U,"change",e[33]),re(X,"input",e[34])],$=!0)},p(S,w){var N,D,j,te,le,fe,de,qe,Pe;w[0]&2&&n!==(n=((j=(D=(N=S[1].conf)==null?void 0:N.meter)==null?void 0:D.buffer)!=null?j:"Buffer size")+"")&&C(i,n),w[0]&2&&r!==(r=((fe=(le=(te=S[1].conf)==null?void 0:te.meter)==null?void 0:le.serial)!=null?fe:"Serial conf.")+"")&&C(c,r),w[0]&16&&(p.checked=S[4].m.i),w[0]&2&&d!==(d=((Pe=(qe=(de=S[1].conf)==null?void 0:de.meter)==null?void 0:qe.inverted)!=null?Pe:"inverted")+"")&&C(h,d),w[0]&16&&L!==(L=S[4].m.b!=0)&&(I.disabled=L),w[0]&16&&Ze(A,S[4].m.b),w[0]&16&&z!==(z=S[4].m.b!=0)&&(E.disabled=z),w[0]&16&&H!==(H=S[4].m.b==0)&&(U.disabled=H),w[0]&16&&Ze(U,S[4].m.p),w[0]&17&&J!==(J=S[0].chip=="esp8266"?S[4].i.h.p==3||S[4].i.h.p==113?512:128:4096)&&u(X,"max",J),w[0]&16&&Xe(X.value)!==S[4].m.s&&be(X,S[4].m.s)},d(S){S&&T(t),Xt(oe,S),$=!1,Et(ce)}}}function sg(e){var a,_,p;let t,l,n=((p=(_=(a=e[1].conf)==null?void 0:a.meter)==null?void 0:_.pulses)!=null?p:"Pulses per kWh")+"",i,o,f,r,c;return{c(){t=m("div"),l=m("span"),i=k(n),o=b(),f=m("input"),u(f,"name","mb"),u(f,"class","in-s tr"),u(f,"type","number"),u(f,"min",1),u(f,"max",3600),u(t,"class","my-1")},m(v,d){P(v,t,d),s(t,l),s(l,i),s(t,o),s(t,f),be(f,e[4].m.b),r||(c=re(f,"input",e[30]),r=!0)},p(v,d){var h,g,M;d[0]&2&&n!==(n=((M=(g=(h=v[1].conf)==null?void 0:h.meter)==null?void 0:g.pulses)!=null?M:"Pulses per kWh")+"")&&C(i,n),d[0]&16&&Xe(f.value)!==v[4].m.b&&be(f,v[4].m.b)},d(v){v&&T(t),r=!1,c()}}}function og(e){let t,l=e[116]*100+"",n;return{c(){t=m("option"),n=k(l),t.__value=e[116]*100,t.value=t.__value},m(i,o){P(i,t,o),s(t,n)},p:ze,d(i){i&&T(t)}}}function O2(e){let t,l,n,i;return{c(){t=m("br"),l=m("input"),u(l,"name","mek"),u(l,"type","text"),u(l,"class","in-s")},m(o,f){P(o,t,f),P(o,l,f),be(l,e[4].m.e.k),n||(i=re(l,"input",e[39]),n=!0)},p(o,f){f[0]&16&&l.value!==o[4].m.e.k&&be(l,o[4].m.e.k)},d(o){o&&T(t),o&&T(l),n=!1,i()}}}function I2(e){var a,_,p;let t,l=((p=(_=(a=e[1].conf)==null?void 0:a.meter)==null?void 0:_.authkey)!=null?p:"Authentication key")+"",n,i,o,f,r,c;return{c(){t=m("div"),n=k(l),i=m("br"),o=b(),f=m("input"),u(f,"name","mea"),u(f,"type","text"),u(f,"class","in-s"),u(t,"class","my-1")},m(v,d){P(v,t,d),s(t,n),s(t,i),s(t,o),s(t,f),be(f,e[4].m.e.a),r||(c=re(f,"input",e[40]),r=!0)},p(v,d){var h,g,M;d[0]&2&&l!==(l=((M=(g=(h=v[1].conf)==null?void 0:h.meter)==null?void 0:g.authkey)!=null?M:"Authentication key")+"")&&C(n,l),d[0]&16&&f.value!==v[4].m.e.a&&be(f,v[4].m.e.a)},d(v){v&&T(t),r=!1,c()}}}function L2(e){var H,Y,X,J,$,ce,ie,oe,ae,se,x,me,pe,V,Z,ge;let t,l,n=((J=(X=(Y=(H=e[1].conf)==null?void 0:H.meter)==null?void 0:Y.multipliers)==null?void 0:X.watt)!=null?J:"Watt")+"",i,o,f,r,c,a,_=((oe=(ie=(ce=($=e[1].conf)==null?void 0:$.meter)==null?void 0:ce.multipliers)==null?void 0:ie.volt)!=null?oe:"Volt")+"",p,v,d,h,g,M,A=((me=(x=(se=(ae=e[1].conf)==null?void 0:ae.meter)==null?void 0:se.multipliers)==null?void 0:x.amp)!=null?me:"Amp")+"",I,O,L,q,U,E,F=((ge=(Z=(V=(pe=e[1].conf)==null?void 0:pe.meter)==null?void 0:V.multipliers)==null?void 0:Z.kwh)!=null?ge:"kWh")+"",z,G,B,R,K,y;return{c(){t=m("div"),l=m("div"),i=k(n),o=m("br"),f=b(),r=m("input"),c=b(),a=m("div"),p=k(_),v=m("br"),d=b(),h=m("input"),g=b(),M=m("div"),I=k(A),O=m("br"),L=b(),q=m("input"),U=b(),E=m("div"),z=k(F),G=m("br"),B=b(),R=m("input"),u(r,"name","mmw"),u(r,"type","number"),u(r,"min","0.00"),u(r,"max","1000"),u(r,"step","0.001"),u(r,"class","in-f tr w-full"),u(l,"class","w-1/4"),u(h,"name","mmv"),u(h,"type","number"),u(h,"min","0.00"),u(h,"max","1000"),u(h,"step","0.001"),u(h,"class","in-m tr w-full"),u(a,"class","w-1/4"),u(q,"name","mma"),u(q,"type","number"),u(q,"min","0.00"),u(q,"max","1000"),u(q,"step","0.001"),u(q,"class","in-m tr w-full"),u(M,"class","w-1/4"),u(R,"name","mmc"),u(R,"type","number"),u(R,"min","0.00"),u(R,"max","1000"),u(R,"step","0.001"),u(R,"class","in-l tr w-full"),u(E,"class","w-1/4"),u(t,"class","flex my-1")},m(ve,S){P(ve,t,S),s(t,l),s(l,i),s(l,o),s(l,f),s(l,r),be(r,e[4].m.m.w),s(t,c),s(t,a),s(a,p),s(a,v),s(a,d),s(a,h),be(h,e[4].m.m.v),s(t,g),s(t,M),s(M,I),s(M,O),s(M,L),s(M,q),be(q,e[4].m.m.a),s(t,U),s(t,E),s(E,z),s(E,G),s(E,B),s(E,R),be(R,e[4].m.m.c),K||(y=[re(r,"input",e[42]),re(h,"input",e[43]),re(q,"input",e[44]),re(R,"input",e[45])],K=!0)},p(ve,S){var w,N,D,j,te,le,fe,de,qe,Pe,we,Fe,Ae,ke,De,He;S[0]&2&&n!==(n=((j=(D=(N=(w=ve[1].conf)==null?void 0:w.meter)==null?void 0:N.multipliers)==null?void 0:D.watt)!=null?j:"Watt")+"")&&C(i,n),S[0]&16&&Xe(r.value)!==ve[4].m.m.w&&be(r,ve[4].m.m.w),S[0]&2&&_!==(_=((de=(fe=(le=(te=ve[1].conf)==null?void 0:te.meter)==null?void 0:le.multipliers)==null?void 0:fe.volt)!=null?de:"Volt")+"")&&C(p,_),S[0]&16&&Xe(h.value)!==ve[4].m.m.v&&be(h,ve[4].m.m.v),S[0]&2&&A!==(A=((Fe=(we=(Pe=(qe=ve[1].conf)==null?void 0:qe.meter)==null?void 0:Pe.multipliers)==null?void 0:we.amp)!=null?Fe:"Amp")+"")&&C(I,A),S[0]&16&&Xe(q.value)!==ve[4].m.m.a&&be(q,ve[4].m.m.a),S[0]&2&&F!==(F=((He=(De=(ke=(Ae=ve[1].conf)==null?void 0:Ae.meter)==null?void 0:ke.multipliers)==null?void 0:De.kwh)!=null?He:"kWh")+"")&&C(z,F),S[0]&16&&Xe(R.value)!==ve[4].m.m.c&&be(R,ve[4].m.m.c)},d(ve){ve&&T(t),K=!1,Et(y)}}}function R2(e){var i,o,f;let t,l=((f=(o=(i=e[1].conf)==null?void 0:i.connection)==null?void 0:o.eth)!=null?f:"Ethernet")+"",n;return{c(){t=m("option"),n=k(l),t.__value=3,t.value=t.__value},m(r,c){P(r,t,c),s(t,n)},p(r,c){var a,_,p;c[0]&2&&l!==(l=((p=(_=(a=r[1].conf)==null?void 0:a.connection)==null?void 0:_.eth)!=null?p:"Ethernet")+"")&&C(n,l)},d(r){r&&T(t)}}}function F2(e){var te,le,fe,de,qe,Pe,we,Fe,Ae,ke,De,He,Oe,je,Qe,We,Je,$e,tt,Te,ue,Ie,kt,lt,wt,st,ot,xe,Nt,gt,At,Pt;let t,l=((fe=(le=(te=e[1].conf)==null?void 0:te.connection)==null?void 0:le.ssid)!=null?fe:"SSID")+"",n,i,o,f,r,c,a=((Pe=(qe=(de=e[1].conf)==null?void 0:de.connection)==null?void 0:qe.psk)!=null?Pe:"Password")+"",_,p,v,d,h,g,M,A=((ke=(Ae=(Fe=(we=e[1].conf)==null?void 0:we.connection)==null?void 0:Fe.ps)==null?void 0:Ae.title)!=null?ke:"Power saving")+"",I,O,L,q,U,E=((je=(Oe=(He=(De=e[1].conf)==null?void 0:De.connection)==null?void 0:He.ps)==null?void 0:Oe.default)!=null?je:"Default")+"",F,z,G=(($e=(Je=(We=(Qe=e[1].conf)==null?void 0:Qe.connection)==null?void 0:We.ps)==null?void 0:Je.off)!=null?$e:"Off")+"",B,R,K=((Ie=(ue=(Te=(tt=e[1].conf)==null?void 0:tt.connection)==null?void 0:Te.ps)==null?void 0:ue.min)!=null?Ie:"Min")+"",y,H,Y=((st=(wt=(lt=(kt=e[1].conf)==null?void 0:kt.connection)==null?void 0:lt.ps)==null?void 0:wt.max)!=null?st:"Max")+"",X,J,$,ce=((Nt=(xe=(ot=e[1].conf)==null?void 0:ot.connection)==null?void 0:xe.pwr)!=null?Nt:"Power")+"",ie,oe,ae,se,x,me,pe,V,Z,ge,ve,S,w=((Pt=(At=(gt=e[1].conf)==null?void 0:gt.connection)==null?void 0:At.tick_11b)!=null?Pt:"802.11b")+"",N,D,j;return{c(){t=m("div"),n=k(l),i=m("br"),o=b(),f=m("input"),r=b(),c=m("div"),_=k(a),p=m("br"),v=b(),d=m("input"),h=b(),g=m("div"),M=m("div"),I=k(A),O=m("br"),L=b(),q=m("select"),U=m("option"),F=k(E),z=m("option"),B=k(G),R=m("option"),y=k(K),H=m("option"),X=k(Y),J=b(),$=m("div"),ie=k(ce),oe=m("br"),ae=b(),se=m("div"),x=m("input"),me=b(),pe=m("span"),pe.textContent="dBm",V=b(),Z=m("div"),ge=m("label"),ve=m("input"),S=b(),N=k(w),u(f,"name","ws"),u(f,"type","text"),u(f,"class","in-s"),u(t,"class","my-1"),u(d,"name","wp"),u(d,"type","password"),u(d,"class","in-s"),u(c,"class","my-1"),U.__value=255,U.value=U.__value,z.__value=0,z.value=z.__value,R.__value=1,R.value=R.__value,H.__value=2,H.value=H.__value,u(q,"name","wz"),u(q,"class","in-s"),e[4].w.z===void 0&&Ct(()=>e[49].call(q)),u(M,"class","w-1/2"),u(x,"name","ww"),u(x,"type","number"),u(x,"min","0"),u(x,"max","20.5"),u(x,"step","0.5"),u(x,"class","in-f tr w-full"),u(pe,"class","in-post"),u(se,"class","flex"),u($,"class","ml-2 w-1/2"),u(g,"class","my-1 flex"),u(ve,"type","checkbox"),u(ve,"name","wb"),ve.__value="true",ve.value=ve.__value,u(ve,"class","rounded mb-1"),u(Z,"class","my-3")},m(Be,ye){P(Be,t,ye),s(t,n),s(t,i),s(t,o),s(t,f),be(f,e[4].w.s),P(Be,r,ye),P(Be,c,ye),s(c,_),s(c,p),s(c,v),s(c,d),be(d,e[4].w.p),P(Be,h,ye),P(Be,g,ye),s(g,M),s(M,I),s(M,O),s(M,L),s(M,q),s(q,U),s(U,F),s(q,z),s(z,B),s(q,R),s(R,y),s(q,H),s(H,X),Ze(q,e[4].w.z,!0),s(g,J),s(g,$),s($,ie),s($,oe),s($,ae),s($,se),s(se,x),be(x,e[4].w.w),s(se,me),s(se,pe),P(Be,V,ye),P(Be,Z,ye),s(Z,ge),s(ge,ve),ve.checked=e[4].w.b,s(ge,S),s(ge,N),D||(j=[re(f,"input",e[47]),re(d,"input",e[48]),re(q,"change",e[49]),re(x,"input",e[50]),re(ve,"change",e[51])],D=!0)},p(Be,ye){var It,vt,nt,Tt,it,at,rt,jt,Lt,Ht,yt,Me,Ve,Rt,Gt,zt,Dt,Kt,Zt,tl,Jt,ft,Mt,Ke,ne,Ue,Re,St,ut,Yt,ll,fl;ye[0]&2&&l!==(l=((nt=(vt=(It=Be[1].conf)==null?void 0:It.connection)==null?void 0:vt.ssid)!=null?nt:"SSID")+"")&&C(n,l),ye[0]&16&&f.value!==Be[4].w.s&&be(f,Be[4].w.s),ye[0]&2&&a!==(a=((at=(it=(Tt=Be[1].conf)==null?void 0:Tt.connection)==null?void 0:it.psk)!=null?at:"Password")+"")&&C(_,a),ye[0]&16&&d.value!==Be[4].w.p&&be(d,Be[4].w.p),ye[0]&2&&A!==(A=((Ht=(Lt=(jt=(rt=Be[1].conf)==null?void 0:rt.connection)==null?void 0:jt.ps)==null?void 0:Lt.title)!=null?Ht:"Power saving")+"")&&C(I,A),ye[0]&2&&E!==(E=((Rt=(Ve=(Me=(yt=Be[1].conf)==null?void 0:yt.connection)==null?void 0:Me.ps)==null?void 0:Ve.default)!=null?Rt:"Default")+"")&&C(F,E),ye[0]&2&&G!==(G=((Kt=(Dt=(zt=(Gt=Be[1].conf)==null?void 0:Gt.connection)==null?void 0:zt.ps)==null?void 0:Dt.off)!=null?Kt:"Off")+"")&&C(B,G),ye[0]&2&&K!==(K=((ft=(Jt=(tl=(Zt=Be[1].conf)==null?void 0:Zt.connection)==null?void 0:tl.ps)==null?void 0:Jt.min)!=null?ft:"Min")+"")&&C(y,K),ye[0]&2&&Y!==(Y=((Ue=(ne=(Ke=(Mt=Be[1].conf)==null?void 0:Mt.connection)==null?void 0:Ke.ps)==null?void 0:ne.max)!=null?Ue:"Max")+"")&&C(X,Y),ye[0]&16&&Ze(q,Be[4].w.z),ye[0]&2&&ce!==(ce=((ut=(St=(Re=Be[1].conf)==null?void 0:Re.connection)==null?void 0:St.pwr)!=null?ut:"Power")+"")&&C(ie,ce),ye[0]&16&&Xe(x.value)!==Be[4].w.w&&be(x,Be[4].w.w),ye[0]&16&&(ve.checked=Be[4].w.b),ye[0]&2&&w!==(w=((fl=(ll=(Yt=Be[1].conf)==null?void 0:Yt.connection)==null?void 0:ll.tick_11b)!=null?fl:"802.11b")+"")&&C(N,w)},d(Be){Be&&T(t),Be&&T(r),Be&&T(c),Be&&T(h),Be&&T(g),Be&&T(V),Be&&T(Z),D=!1,Et(j)}}}function B2(e){var O,L,q,U,E,F;let t,l=((q=(L=(O=e[1].conf)==null?void 0:O.network)==null?void 0:L.gw)!=null?q:"Gateway")+"",n,i,o,f,r,c,a=((F=(E=(U=e[1].conf)==null?void 0:U.network)==null?void 0:E.dns)!=null?F:"DNS")+"",_,p,v,d,h,g,M,A,I;return{c(){t=m("div"),n=k(l),i=m("br"),o=b(),f=m("input"),r=b(),c=m("div"),_=k(a),p=m("br"),v=b(),d=m("div"),h=m("input"),g=b(),M=m("input"),u(f,"name","ng"),u(f,"type","text"),u(f,"class","in-s"),u(t,"class","my-1"),u(h,"name","nd1"),u(h,"type","text"),u(h,"class","in-f w-full"),u(M,"name","nd2"),u(M,"type","text"),u(M,"class","in-l w-full"),u(d,"class","flex"),u(c,"class","my-1")},m(z,G){P(z,t,G),s(t,n),s(t,i),s(t,o),s(t,f),be(f,e[4].n.g),P(z,r,G),P(z,c,G),s(c,_),s(c,p),s(c,v),s(c,d),s(d,h),be(h,e[4].n.d1),s(d,g),s(d,M),be(M,e[4].n.d2),A||(I=[re(f,"input",e[55]),re(h,"input",e[56]),re(M,"input",e[57])],A=!0)},p(z,G){var B,R,K,y,H,Y;G[0]&2&&l!==(l=((K=(R=(B=z[1].conf)==null?void 0:B.network)==null?void 0:R.gw)!=null?K:"Gateway")+"")&&C(n,l),G[0]&16&&f.value!==z[4].n.g&&be(f,z[4].n.g),G[0]&2&&a!==(a=((Y=(H=(y=z[1].conf)==null?void 0:y.network)==null?void 0:H.dns)!=null?Y:"DNS")+"")&&C(_,a),G[0]&16&&h.value!==z[4].n.d1&&be(h,z[4].n.d1),G[0]&16&&M.value!==z[4].n.d2&&be(M,z[4].n.d2)},d(z){z&&T(t),z&&T(r),z&&T(c),A=!1,Et(I)}}}function U2(e){let t,l,n,i,o;return{c(){t=m("label"),l=m("input"),n=k(" SSL"),u(l,"type","checkbox"),u(l,"name","qs"),l.__value="true",l.value=l.__value,u(l,"class","rounded mb-1"),u(t,"class","float-right mr-3")},m(f,r){P(f,t,r),s(t,l),l.checked=e[4].q.s.e,s(t,n),i||(o=[re(l,"change",e[62]),re(l,"change",e[16])],i=!0)},p(f,r){r[0]&16&&(l.checked=f[4].q.s.e)},d(f){f&&T(t),i=!1,Et(o)}}}function j2(e){let t,l,n,i,o,f,r,c,a,_,p,v,d;const h=[fg,ag],g=[];function M(E,F){return E[4].q.s.c?0:1}n=M(e),i=g[n]=h[n](e);const A=[_g,cg],I=[];function O(E,F){return E[4].q.s.r?0:1}r=O(e),c=I[r]=A[r](e);const L=[vg,dg],q=[];function U(E,F){return E[4].q.s.k?0:1}return p=U(e),v=q[p]=L[p](e),{c(){t=m("div"),l=m("span"),i.c(),o=b(),f=m("span"),c.c(),a=b(),_=m("span"),v.c(),u(l,"class","flex pr-2"),u(f,"class","flex pr-2"),u(_,"class","flex pr-2"),u(t,"class","my-1 flex")},m(E,F){P(E,t,F),s(t,l),g[n].m(l,null),s(t,o),s(t,f),I[r].m(f,null),s(t,a),s(t,_),q[p].m(_,null),d=!0},p(E,F){let z=n;n=M(E),n===z?g[n].p(E,F):(pt(),ee(g[z],1,1,()=>{g[z]=null}),dt(),i=g[n],i?i.p(E,F):(i=g[n]=h[n](E),i.c()),Q(i,1),i.m(l,null));let G=r;r=O(E),r===G?I[r].p(E,F):(pt(),ee(I[G],1,1,()=>{I[G]=null}),dt(),c=I[r],c?c.p(E,F):(c=I[r]=A[r](E),c.c()),Q(c,1),c.m(f,null));let B=p;p=U(E),p===B?q[p].p(E,F):(pt(),ee(q[B],1,1,()=>{q[B]=null}),dt(),v=q[p],v?v.p(E,F):(v=q[p]=L[p](E),v.c()),Q(v,1),v.m(_,null))},i(E){d||(Q(i),Q(c),Q(v),d=!0)},o(E){ee(i),ee(c),ee(v),d=!1},d(E){E&&T(t),g[n].d(),I[r].d(),q[p].d()}}}function ag(e){let t,l;return t=new ln({props:{to:"/mqtt-ca",$$slots:{default:[ug]},$$scope:{ctx:e}}}),{c(){Ne(t.$$.fragment)},m(n,i){Se(t,n,i),l=!0},p(n,i){const o={};i[0]&2|i[3]&536870912&&(o.$$scope={dirty:i,ctx:n}),t.$set(o)},i(n){l||(Q(t.$$.fragment,n),l=!0)},o(n){ee(t.$$.fragment,n),l=!1},d(n){Ce(t,n)}}}function fg(e){let t,l,n,i,o,f,r;return l=new ln({props:{to:"/mqtt-ca",$$slots:{default:[rg]},$$scope:{ctx:e}}}),{c(){t=m("span"),Ne(l.$$.fragment),n=b(),i=m("span"),i.textContent="\u{1F5D1}",u(t,"class","bd-on"),u(i,"class","bd-off")},m(c,a){P(c,t,a),Se(l,t,null),P(c,n,a),P(c,i,a),o=!0,f||(r=[re(i,"click",e[13]),re(i,"keypress",e[13])],f=!0)},p(c,a){const _={};a[0]&2|a[3]&536870912&&(_.$$scope={dirty:a,ctx:c}),l.$set(_)},i(c){o||(Q(l.$$.fragment,c),o=!0)},o(c){ee(l.$$.fragment,c),o=!1},d(c){c&&T(t),Ce(l),c&&T(n),c&&T(i),f=!1,Et(r)}}}function ug(e){var n,i,o,f,r,c;let t,l;return t=new hi({props:{color:"blue",text:(o=(i=(n=e[1].conf)==null?void 0:n.mqtt)==null?void 0:i.btn_ca_upload)!=null?o:"Upload CA",title:(c=(r=(f=e[1].conf)==null?void 0:f.mqtt)==null?void 0:r.title_ca)!=null?c:""}}),{c(){Ne(t.$$.fragment)},m(a,_){Se(t,a,_),l=!0},p(a,_){var v,d,h,g,M,A;const p={};_[0]&2&&(p.text=(h=(d=(v=a[1].conf)==null?void 0:v.mqtt)==null?void 0:d.btn_ca_upload)!=null?h:"Upload CA"),_[0]&2&&(p.title=(A=(M=(g=a[1].conf)==null?void 0:g.mqtt)==null?void 0:M.title_ca)!=null?A:""),t.$set(p)},i(a){l||(Q(t.$$.fragment,a),l=!0)},o(a){ee(t.$$.fragment,a),l=!1},d(a){Ce(t,a)}}}function rg(e){var n,i,o;let t=((o=(i=(n=e[1].conf)==null?void 0:n.mqtt)==null?void 0:i.ca_ok)!=null?o:"CA OK")+"",l;return{c(){l=k(t)},m(f,r){P(f,l,r)},p(f,r){var c,a,_;r[0]&2&&t!==(t=((_=(a=(c=f[1].conf)==null?void 0:c.mqtt)==null?void 0:a.ca_ok)!=null?_:"CA OK")+"")&&C(l,t)},d(f){f&&T(l)}}}function cg(e){let t,l;return t=new ln({props:{to:"/mqtt-cert",$$slots:{default:[mg]},$$scope:{ctx:e}}}),{c(){Ne(t.$$.fragment)},m(n,i){Se(t,n,i),l=!0},p(n,i){const o={};i[0]&2|i[3]&536870912&&(o.$$scope={dirty:i,ctx:n}),t.$set(o)},i(n){l||(Q(t.$$.fragment,n),l=!0)},o(n){ee(t.$$.fragment,n),l=!1},d(n){Ce(t,n)}}}function _g(e){let t,l,n,i,o,f,r;return l=new ln({props:{to:"/mqtt-cert",$$slots:{default:[pg]},$$scope:{ctx:e}}}),{c(){t=m("span"),Ne(l.$$.fragment),n=b(),i=m("span"),i.textContent="\u{1F5D1}",u(t,"class","bd-on"),u(i,"class","bd-off")},m(c,a){P(c,t,a),Se(l,t,null),P(c,n,a),P(c,i,a),o=!0,f||(r=[re(i,"click",e[14]),re(i,"keypress",e[14])],f=!0)},p(c,a){const _={};a[0]&2|a[3]&536870912&&(_.$$scope={dirty:a,ctx:c}),l.$set(_)},i(c){o||(Q(l.$$.fragment,c),o=!0)},o(c){ee(l.$$.fragment,c),o=!1},d(c){c&&T(t),Ce(l),c&&T(n),c&&T(i),f=!1,Et(r)}}}function mg(e){var n,i,o,f,r,c;let t,l;return t=new hi({props:{color:"blue",text:(o=(i=(n=e[1].conf)==null?void 0:n.mqtt)==null?void 0:i.btn_crt_upload)!=null?o:"Upload cert",title:(c=(r=(f=e[1].conf)==null?void 0:f.mqtt)==null?void 0:r.title_crt)!=null?c:""}}),{c(){Ne(t.$$.fragment)},m(a,_){Se(t,a,_),l=!0},p(a,_){var v,d,h,g,M,A;const p={};_[0]&2&&(p.text=(h=(d=(v=a[1].conf)==null?void 0:v.mqtt)==null?void 0:d.btn_crt_upload)!=null?h:"Upload cert"),_[0]&2&&(p.title=(A=(M=(g=a[1].conf)==null?void 0:g.mqtt)==null?void 0:M.title_crt)!=null?A:""),t.$set(p)},i(a){l||(Q(t.$$.fragment,a),l=!0)},o(a){ee(t.$$.fragment,a),l=!1},d(a){Ce(t,a)}}}function pg(e){var n,i,o;let t=((o=(i=(n=e[1].conf)==null?void 0:n.mqtt)==null?void 0:i.crt_ok)!=null?o:"Cert OK")+"",l;return{c(){l=k(t)},m(f,r){P(f,l,r)},p(f,r){var c,a,_;r[0]&2&&t!==(t=((_=(a=(c=f[1].conf)==null?void 0:c.mqtt)==null?void 0:a.crt_ok)!=null?_:"Cert OK")+"")&&C(l,t)},d(f){f&&T(l)}}}function dg(e){let t,l;return t=new ln({props:{to:"/mqtt-key",$$slots:{default:[hg]},$$scope:{ctx:e}}}),{c(){Ne(t.$$.fragment)},m(n,i){Se(t,n,i),l=!0},p(n,i){const o={};i[0]&2|i[3]&536870912&&(o.$$scope={dirty:i,ctx:n}),t.$set(o)},i(n){l||(Q(t.$$.fragment,n),l=!0)},o(n){ee(t.$$.fragment,n),l=!1},d(n){Ce(t,n)}}}function vg(e){let t,l,n,i,o,f,r;return l=new ln({props:{to:"/mqtt-key",$$slots:{default:[bg]},$$scope:{ctx:e}}}),{c(){t=m("span"),Ne(l.$$.fragment),n=b(),i=m("span"),i.textContent="\u{1F5D1}",u(t,"class","bd-on"),u(i,"class","bd-off")},m(c,a){P(c,t,a),Se(l,t,null),P(c,n,a),P(c,i,a),o=!0,f||(r=[re(i,"click",e[15]),re(i,"keypress",e[15])],f=!0)},p(c,a){const _={};a[0]&2|a[3]&536870912&&(_.$$scope={dirty:a,ctx:c}),l.$set(_)},i(c){o||(Q(l.$$.fragment,c),o=!0)},o(c){ee(l.$$.fragment,c),o=!1},d(c){c&&T(t),Ce(l),c&&T(n),c&&T(i),f=!1,Et(r)}}}function hg(e){var n,i,o,f,r,c;let t,l;return t=new hi({props:{color:"blue",text:(o=(i=(n=e[1].conf)==null?void 0:n.mqtt)==null?void 0:i.btn_key_upload)!=null?o:"Upload key",title:(c=(r=(f=e[1].conf)==null?void 0:f.mqtt)==null?void 0:r.title_key)!=null?c:""}}),{c(){Ne(t.$$.fragment)},m(a,_){Se(t,a,_),l=!0},p(a,_){var v,d,h,g,M,A;const p={};_[0]&2&&(p.text=(h=(d=(v=a[1].conf)==null?void 0:v.mqtt)==null?void 0:d.btn_key_upload)!=null?h:"Upload key"),_[0]&2&&(p.title=(A=(M=(g=a[1].conf)==null?void 0:g.mqtt)==null?void 0:M.title_key)!=null?A:""),t.$set(p)},i(a){l||(Q(t.$$.fragment,a),l=!0)},o(a){ee(t.$$.fragment,a),l=!1},d(a){Ce(t,a)}}}function bg(e){var n,i,o;let t=((o=(i=(n=e[1].conf)==null?void 0:n.mqtt)==null?void 0:i.key_ok)!=null?o:"Key OK")+"",l;return{c(){l=k(t)},m(f,r){P(f,l,r)},p(f,r){var c,a,_;r[0]&2&&t!==(t=((_=(a=(c=f[1].conf)==null?void 0:c.mqtt)==null?void 0:a.key_ok)!=null?_:"Key OK")+"")&&C(l,t)},d(f){f&&T(l)}}}function H2(e){var oe,ae,se,x,me,pe,V,Z,ge,ve,S,w,N,D,j,te;let t,l,n=((x=(se=(ae=(oe=e[1].conf)==null?void 0:oe.mqtt)==null?void 0:ae.domoticz)==null?void 0:se.title)!=null?x:"Domoticz")+"",i,o,f,r,c,a,_,p,v,d=((Z=(V=(pe=(me=e[1].conf)==null?void 0:me.mqtt)==null?void 0:pe.domoticz)==null?void 0:V.eidx)!=null?Z:"Electricity IDX")+"",h,g,M,A,I,O,L=((w=(S=(ve=(ge=e[1].conf)==null?void 0:ge.mqtt)==null?void 0:ve.domoticz)==null?void 0:S.cidx)!=null?w:"Current IDX")+"",q,U,E,F,z,G,B=((te=(j=(D=(N=e[1].conf)==null?void 0:N.mqtt)==null?void 0:D.domoticz)==null?void 0:j.vidx)!=null?te:"Voltage IDX")+"",R,K,y,H,Y,X,J,$,ce,ie;return{c(){t=m("div"),l=m("strong"),i=k(n),o=b(),f=m("a"),r=k("\u24D8"),c=b(),a=m("input"),_=b(),p=m("div"),v=m("div"),h=k(d),g=m("br"),M=b(),A=m("input"),I=b(),O=m("div"),q=k(L),U=m("br"),E=b(),F=m("input"),z=b(),G=m("div"),R=k(B),K=k(`: L1, L2 & L3 - `),y=m("div"),H=m("input"),Y=b(),X=m("input"),J=b(),$=m("input"),u(l,"class","text-sm"),u(f,"href",zl("MQTT-configuration#domoticz")),u(f,"target","_blank"),u(f,"class","float-right"),u(a,"type","hidden"),u(a,"name","o"),a.value="true",u(A,"name","oe"),u(A,"type","text"),u(A,"class","in-f tr w-full"),u(v,"class","w-1/2"),u(F,"name","oc"),u(F,"type","text"),u(F,"class","in-l tr w-full"),u(O,"class","w-1/2"),u(p,"class","my-1 flex"),u(H,"name","ou1"),u(H,"type","text"),u(H,"class","in-f tr w-1/3"),u(X,"name","ou2"),u(X,"type","text"),u(X,"class","in-m tr w-1/3"),u($,"name","ou3"),u($,"type","text"),u($,"class","in-l tr w-1/3"),u(y,"class","flex"),u(G,"class","my-1"),u(t,"class","cnt")},m(le,fe){P(le,t,fe),s(t,l),s(l,i),s(t,o),s(t,f),s(f,r),s(t,c),s(t,a),s(t,_),s(t,p),s(p,v),s(v,h),s(v,g),s(v,M),s(v,A),be(A,e[4].o.e),s(p,I),s(p,O),s(O,q),s(O,U),s(O,E),s(O,F),be(F,e[4].o.c),s(t,z),s(t,G),s(G,R),s(G,K),s(G,y),s(y,H),be(H,e[4].o.u1),s(y,Y),s(y,X),be(X,e[4].o.u2),s(y,J),s(y,$),be($,e[4].o.u3),ce||(ie=[re(A,"input",e[70]),re(F,"input",e[71]),re(H,"input",e[72]),re(X,"input",e[73]),re($,"input",e[74])],ce=!0)},p(le,fe){var de,qe,Pe,we,Fe,Ae,ke,De,He,Oe,je,Qe,We,Je,$e,tt;fe[0]&2&&n!==(n=((we=(Pe=(qe=(de=le[1].conf)==null?void 0:de.mqtt)==null?void 0:qe.domoticz)==null?void 0:Pe.title)!=null?we:"Domoticz")+"")&&C(i,n),fe[0]&2&&d!==(d=((De=(ke=(Ae=(Fe=le[1].conf)==null?void 0:Fe.mqtt)==null?void 0:Ae.domoticz)==null?void 0:ke.eidx)!=null?De:"Electricity IDX")+"")&&C(h,d),fe[0]&16&&A.value!==le[4].o.e&&be(A,le[4].o.e),fe[0]&2&&L!==(L=((Qe=(je=(Oe=(He=le[1].conf)==null?void 0:He.mqtt)==null?void 0:Oe.domoticz)==null?void 0:je.cidx)!=null?Qe:"Current IDX")+"")&&C(q,L),fe[0]&16&&F.value!==le[4].o.c&&be(F,le[4].o.c),fe[0]&2&&B!==(B=((tt=($e=(Je=(We=le[1].conf)==null?void 0:We.mqtt)==null?void 0:Je.domoticz)==null?void 0:$e.vidx)!=null?tt:"Voltage IDX")+"")&&C(R,B),fe[0]&16&&H.value!==le[4].o.u1&&be(H,le[4].o.u1),fe[0]&16&&X.value!==le[4].o.u2&&be(X,le[4].o.u2),fe[0]&16&&$.value!==le[4].o.u3&&be($,le[4].o.u3)},d(le){le&&T(t),ce=!1,Et(ie)}}}function y2(e){var J,$,ce,ie,oe,ae,se,x,me,pe,V,Z,ge,ve,S,w;let t,l,n=((ie=(ce=($=(J=e[1].conf)==null?void 0:J.mqtt)==null?void 0:$.ha)==null?void 0:ce.title)!=null?ie:"Home-Assistant")+"",i,o,f,r,c,a,_,p,v=((x=(se=(ae=(oe=e[1].conf)==null?void 0:oe.mqtt)==null?void 0:ae.ha)==null?void 0:se.discovery)!=null?x:"Discovery topic prefix")+"",d,h,g,M,A,I,O=((Z=(V=(pe=(me=e[1].conf)==null?void 0:me.mqtt)==null?void 0:pe.ha)==null?void 0:V.hostname)!=null?Z:"Hostname for URL")+"",L,q,U,E,F,z,G,B=((w=(S=(ve=(ge=e[1].conf)==null?void 0:ge.mqtt)==null?void 0:ve.ha)==null?void 0:S.tag)!=null?w:"Name tag")+"",R,K,y,H,Y,X;return{c(){t=m("div"),l=m("strong"),i=k(n),o=b(),f=m("a"),r=k("\u24D8"),c=b(),a=m("input"),_=b(),p=m("div"),d=k(v),h=m("br"),g=b(),M=m("input"),A=b(),I=m("div"),L=k(O),q=m("br"),U=b(),E=m("input"),z=b(),G=m("div"),R=k(B),K=m("br"),y=b(),H=m("input"),u(l,"class","text-sm"),u(f,"href",zl("MQTT-configuration#home-assistant")),u(f,"target","_blank"),u(f,"class","float-right"),u(a,"type","hidden"),u(a,"name","h"),a.value="true",u(M,"name","ht"),u(M,"type","text"),u(M,"class","in-s"),u(M,"placeholder","homeassistant"),u(p,"class","my-1"),u(E,"name","hh"),u(E,"type","text"),u(E,"class","in-s"),u(E,"placeholder",F=e[4].g.h+".local"),u(I,"class","my-1"),u(H,"name","hn"),u(H,"type","text"),u(H,"class","in-s"),u(G,"class","my-1"),u(t,"class","cnt")},m(N,D){P(N,t,D),s(t,l),s(l,i),s(t,o),s(t,f),s(f,r),s(t,c),s(t,a),s(t,_),s(t,p),s(p,d),s(p,h),s(p,g),s(p,M),be(M,e[4].h.t),s(t,A),s(t,I),s(I,L),s(I,q),s(I,U),s(I,E),be(E,e[4].h.h),s(t,z),s(t,G),s(G,R),s(G,K),s(G,y),s(G,H),be(H,e[4].h.n),Y||(X=[re(M,"input",e[75]),re(E,"input",e[76]),re(H,"input",e[77])],Y=!0)},p(N,D){var j,te,le,fe,de,qe,Pe,we,Fe,Ae,ke,De,He,Oe,je,Qe;D[0]&2&&n!==(n=((fe=(le=(te=(j=N[1].conf)==null?void 0:j.mqtt)==null?void 0:te.ha)==null?void 0:le.title)!=null?fe:"Home-Assistant")+"")&&C(i,n),D[0]&2&&v!==(v=((we=(Pe=(qe=(de=N[1].conf)==null?void 0:de.mqtt)==null?void 0:qe.ha)==null?void 0:Pe.discovery)!=null?we:"Discovery topic prefix")+"")&&C(d,v),D[0]&16&&M.value!==N[4].h.t&&be(M,N[4].h.t),D[0]&2&&O!==(O=((De=(ke=(Ae=(Fe=N[1].conf)==null?void 0:Fe.mqtt)==null?void 0:Ae.ha)==null?void 0:ke.hostname)!=null?De:"Hostname for URL")+"")&&C(L,O),D[0]&16&&F!==(F=N[4].g.h+".local")&&u(E,"placeholder",F),D[0]&16&&E.value!==N[4].h.h&&be(E,N[4].h.h),D[0]&2&&B!==(B=((Qe=(je=(Oe=(He=N[1].conf)==null?void 0:He.mqtt)==null?void 0:Oe.ha)==null?void 0:je.tag)!=null?Qe:"Name tag")+"")&&C(R,B),D[0]&16&&H.value!==N[4].h.n&&be(H,N[4].h.n)},d(N){N&&T(t),Y=!1,Et(X)}}}function z2(e){var K,y,H,Y,X,J,$,ce,ie;let t,l,n=((H=(y=(K=e[1].conf)==null?void 0:K.cloud)==null?void 0:y.title)!=null?H:"Cloud connections")+"",i,o,f,r,c,a,_,p,v,d,h,g=((J=(X=(Y=e[1].conf)==null?void 0:Y.cloud)==null?void 0:X.ams)!=null?J:"AMS reader cloud")+"",M,A,I,O,L,q,U=((ie=(ce=($=e[1].conf)==null?void 0:$.cloud)==null?void 0:ce.es)!=null?ie:"Energy Speedometer")+"",E,F,z,G,B,R=e[4].c.es&&W2(e);return{c(){t=m("div"),l=m("strong"),i=k(n),o=b(),f=m("a"),r=k("\u24D8"),c=b(),a=m("input"),_=b(),p=m("div"),v=m("label"),d=m("input"),h=b(),M=k(g),A=b(),I=m("div"),O=m("label"),L=m("input"),q=b(),E=k(U),F=b(),R&&R.c(),u(l,"class","text-sm"),u(f,"href",zl("Cloud")),u(f,"target","_blank"),u(f,"class","float-right"),u(a,"type","hidden"),u(a,"name","c"),a.value="true",u(d,"type","checkbox"),u(d,"name","ce"),d.__value="true",d.value=d.__value,u(d,"class","rounded mb-1"),u(p,"class","my-1"),u(L,"type","checkbox"),u(L,"class","rounded mb-1"),u(L,"name","ces"),L.__value="true",L.value=L.__value,u(I,"class","my-1"),u(t,"class","cnt")},m(oe,ae){P(oe,t,ae),s(t,l),s(l,i),s(t,o),s(t,f),s(f,r),s(t,c),s(t,a),s(t,_),s(t,p),s(p,v),s(v,d),d.checked=e[4].c.e,s(v,h),s(v,M),s(t,A),s(t,I),s(I,O),s(O,L),L.checked=e[4].c.es,s(O,q),s(O,E),s(I,F),R&&R.m(I,null),z=!0,G||(B=[re(d,"change",e[78]),re(L,"change",e[79])],G=!0)},p(oe,ae){var se,x,me,pe,V,Z,ge,ve,S;(!z||ae[0]&2)&&n!==(n=((me=(x=(se=oe[1].conf)==null?void 0:se.cloud)==null?void 0:x.title)!=null?me:"Cloud connections")+"")&&C(i,n),ae[0]&16&&(d.checked=oe[4].c.e),(!z||ae[0]&2)&&g!==(g=((Z=(V=(pe=oe[1].conf)==null?void 0:pe.cloud)==null?void 0:V.ams)!=null?Z:"AMS reader cloud")+"")&&C(M,g),ae[0]&16&&(L.checked=oe[4].c.es),(!z||ae[0]&2)&&U!==(U=((S=(ve=(ge=oe[1].conf)==null?void 0:ge.cloud)==null?void 0:ve.es)!=null?S:"Energy Speedometer")+"")&&C(E,U),oe[4].c.es?R?(R.p(oe,ae),ae[0]&16&&Q(R,1)):(R=W2(oe),R.c(),Q(R,1),R.m(I,null)):R&&(pt(),ee(R,1,1,()=>{R=null}),dt())},i(oe){z||(Q(R),z=!0)},o(oe){ee(R),z=!1},d(oe){oe&&T(t),R&&R.d(),G=!1,Et(B)}}}function W2(e){let t,l,n=e[0].mac+"",i,o,f,r,c=(e[0].meter.id?e[0].meter.id:"missing, required")+"",a,_,p,v,d=e[0].mac&&e[0].meter.id&&G2(e);return{c(){t=m("div"),l=k("MAC: "),i=k(n),o=b(),f=m("div"),r=k("Meter ID: "),a=k(c),_=b(),d&&d.c(),p=Ut(),u(t,"class","pl-5"),u(f,"class","pl-5")},m(h,g){P(h,t,g),s(t,l),s(t,i),P(h,o,g),P(h,f,g),s(f,r),s(f,a),P(h,_,g),d&&d.m(h,g),P(h,p,g),v=!0},p(h,g){(!v||g[0]&1)&&n!==(n=h[0].mac+"")&&C(i,n),(!v||g[0]&1)&&c!==(c=(h[0].meter.id?h[0].meter.id:"missing, required")+"")&&C(a,c),h[0].mac&&h[0].meter.id?d?(d.p(h,g),g[0]&1&&Q(d,1)):(d=G2(h),d.c(),Q(d,1),d.m(p.parentNode,p)):d&&(pt(),ee(d,1,1,()=>{d=null}),dt())},i(h){v||(Q(d),v=!0)},o(h){ee(d),v=!1},d(h){h&&T(t),h&&T(o),h&&T(f),h&&T(_),d&&d.d(h),h&&T(p)}}}function G2(e){let t,l,n;return l=new x4({props:{value:'{"mac":"'+e[0].mac+'","meter":"'+e[0].meter.id+'"}'}}),{c(){t=m("div"),Ne(l.$$.fragment),u(t,"class","pl-2")},m(i,o){P(i,t,o),Se(l,t,null),n=!0},p(i,o){const f={};o[0]&1&&(f.value='{"mac":"'+i[0].mac+'","meter":"'+i[0].meter.id+'"}'),l.$set(f)},i(i){n||(Q(l.$$.fragment,i),n=!0)},o(i){ee(l.$$.fragment,i),n=!1},d(i){i&&T(t),Ce(l)}}}function V2(e){var B,R,K,y,H,Y,X,J;let t,l,n=((K=(R=(B=e[1].conf)==null?void 0:B.thresholds)==null?void 0:R.title)!=null?K:"Thresholds")+"",i,o,f,r,c,a,_,p,v,d,h,g=((Y=(H=(y=e[1].conf)==null?void 0:y.thresholds)==null?void 0:H.avg)!=null?Y:"Average of")+"",M,A,I,O,L,q=((J=(X=e[1].common)==null?void 0:X.hours)!=null?J:"hours")+"",U,E,F,z={length:9},G=[];for(let $=0;$20&&Z2(e),d=e[4].i.d.d>0&&x2(e),h=e[0].chip=="esp8266"&&ed(e);return{c(){t=m("div"),l=m("strong"),i=k(n),o=b(),f=m("a"),r=k("\u24D8"),c=b(),v&&v.c(),a=b(),d&&d.c(),_=b(),h&&h.c(),u(l,"class","text-sm"),u(f,"href",zl("GPIO-configuration")),u(f,"target","_blank"),u(f,"class","float-right"),u(t,"class","cnt")},m(I,O){P(I,t,O),s(t,l),s(l,i),s(t,o),s(t,f),s(f,r),s(t,c),v&&v.m(t,null),s(t,a),d&&d.m(t,null),s(t,_),h&&h.m(t,null),p=!0},p(I,O){var L,q,U;(!p||O[0]&2)&&n!==(n=((U=(q=(L=I[1].conf)==null?void 0:L.hw)==null?void 0:q.title)!=null?U:"Hardware")+"")&&C(i,n),I[0].board>20?v?(v.p(I,O),O[0]&1&&Q(v,1)):(v=Z2(I),v.c(),Q(v,1),v.m(t,a)):v&&(pt(),ee(v,1,1,()=>{v=null}),dt()),I[4].i.d.d>0?d?d.p(I,O):(d=x2(I),d.c(),d.m(t,_)):d&&(d.d(1),d=null),I[0].chip=="esp8266"?h?h.p(I,O):(h=ed(I),h.c(),h.m(t,null)):h&&(h.d(1),h=null)},i(I){p||(Q(v),p=!0)},o(I){ee(v),p=!1},d(I){I&&T(t),v&&v.d(),d&&d.d(),h&&h.d()}}}function Z2(e){var jt,Lt,Ht,yt,Me,Ve,Rt,Gt,zt,Dt,Kt,Zt,tl,Jt,ft,Mt,Ke,ne,Ue,Re,St,ut,Yt,ll,fl,ul,Sl,rl,Cl,nl,_l,dl,Nl,Tl,Qt,Ee,qt,En,Zl,vn,An;let t,l,n,i,o=((yt=(Ht=(Lt=(jt=e[1].conf)==null?void 0:jt.hw)==null?void 0:Lt.han)==null?void 0:Ht.rx)!=null?yt:"HAN RX")+"",f,r,c,a,_,p,v,d=((Gt=(Rt=(Ve=(Me=e[1].conf)==null?void 0:Me.hw)==null?void 0:Ve.han)==null?void 0:Rt.tx)!=null?Gt:"HAN TX")+"",h,g,M,A,I,O,L,q,U,E,F=((Zt=(Kt=(Dt=(zt=e[1].conf)==null?void 0:zt.hw)==null?void 0:Dt.han)==null?void 0:Kt.pullup)!=null?Zt:"pullup")+"",z,G,B,R,K=((ft=(Jt=(tl=e[1].conf)==null?void 0:tl.hw)==null?void 0:Jt.ap_btn)!=null?ft:"AP button")+"",y,H,Y,X,J,$,ce=((Ue=(ne=(Ke=(Mt=e[1].conf)==null?void 0:Mt.hw)==null?void 0:Ke.led)==null?void 0:ne.title)!=null?Ue:"LED")+"",ie,oe,ae,se,x,me,pe,V,Z,ge,ve=((Yt=(ut=(St=(Re=e[1].conf)==null?void 0:Re.hw)==null?void 0:St.led)==null?void 0:ut.inverted)!=null?Yt:"inverted")+"",S,w,N,D=((Sl=(ul=(fl=(ll=e[1].conf)==null?void 0:ll.hw)==null?void 0:fl.led)==null?void 0:ul.rgb)!=null?Sl:"RGB")+"",j,te,le,fe,de=((_l=(nl=(Cl=(rl=e[1].conf)==null?void 0:rl.hw)==null?void 0:Cl.led)==null?void 0:nl.inverted)!=null?_l:"inverted")+"",qe,Pe,we,Fe,Ae,ke,De,He,Oe,je,Qe,We,Je=((Qt=(Tl=(Nl=(dl=e[1].conf)==null?void 0:dl.hw)==null?void 0:Nl.led)==null?void 0:Tl.disable)!=null?Qt:"LED dis. GPIO")+"",$e,tt,Te,ue,Ie,kt=((En=(qt=(Ee=e[1].conf)==null?void 0:Ee.hw)==null?void 0:qt.temp)!=null?En:"Temperature")+"",lt,wt,st,ot,xe,Nt,gt=((An=(vn=(Zl=e[1].conf)==null?void 0:Zl.hw)==null?void 0:vn.temp_analog)!=null?An:"Analog temp")+"",At,Pt,Be,ye,It,vt,nt,Tt,it;_=new rf({props:{chip:e[0].chip}}),I=new rf({props:{chip:e[0].chip}});let at=e[0].chip!="esp8266"&&J2(e),rt=e[4].i.v.p>0&&$2(e);return{c(){t=m("input"),l=b(),n=m("div"),i=m("div"),f=k(o),r=m("br"),c=b(),a=m("select"),Ne(_.$$.fragment),p=b(),v=m("div"),h=k(d),g=m("br"),M=b(),A=m("select"),Ne(I.$$.fragment),O=b(),L=m("div"),q=m("label"),U=m("input"),E=b(),z=k(F),G=b(),B=m("div"),R=m("div"),y=k(K),H=m("br"),Y=b(),X=m("input"),J=b(),$=m("div"),ie=k(ce),oe=m("br"),ae=b(),se=m("div"),x=m("input"),me=b(),pe=m("div"),V=m("label"),Z=m("input"),ge=b(),S=k(ve),w=b(),N=m("div"),j=k(D),te=m("label"),le=m("input"),fe=b(),qe=k(de),Pe=m("br"),we=b(),Fe=m("div"),Ae=m("input"),ke=b(),De=m("input"),He=b(),Oe=m("input"),je=b(),Qe=m("div"),We=m("div"),$e=k(Je),tt=b(),Te=m("input"),ue=b(),Ie=m("div"),lt=k(kt),wt=m("br"),st=b(),ot=m("input"),xe=b(),Nt=m("div"),At=k(gt),Pt=m("br"),Be=b(),ye=m("input"),It=b(),at&&at.c(),vt=b(),rt&&rt.c(),u(t,"type","hidden"),u(t,"name","i"),t.value="true",u(a,"name","ihp"),u(a,"class","in-f w-full"),e[4].i.h.p===void 0&&Ct(()=>e[84].call(a)),u(i,"class","w-1/3"),u(A,"name","iht"),u(A,"class","in-l w-full"),e[4].i.h.t===void 0&&Ct(()=>e[85].call(A)),u(v,"class","w-1/3"),u(U,"name","ihu"),U.__value="true",U.value=U.__value,u(U,"type","checkbox"),u(U,"class","rounded mb-1"),u(q,"class","ml-2"),u(L,"class","w-1/3"),u(n,"class","flex flex-wrap"),u(X,"name","ia"),u(X,"type","number"),u(X,"min","0"),u(X,"max",e[8]),u(X,"class","in-f tr w-full"),u(R,"class","w-1/3"),u(x,"name","ilp"),u(x,"type","number"),u(x,"min","0"),u(x,"max",e[8]),u(x,"class","in-l tr w-full"),u(se,"class","flex"),u($,"class","w-1/3"),u(Z,"name","ili"),Z.__value="true",Z.value=Z.__value,u(Z,"type","checkbox"),u(Z,"class","rounded mb-1"),u(V,"class","ml-4"),u(pe,"class","w-1/3"),u(le,"name","iri"),le.__value="true",le.value=le.__value,u(le,"type","checkbox"),u(le,"class","rounded mb-1"),u(te,"class","ml-4"),u(Ae,"name","irr"),u(Ae,"type","number"),u(Ae,"min","0"),u(Ae,"max",e[8]),u(Ae,"class","in-f tr w-1/3"),u(De,"name","irg"),u(De,"type","number"),u(De,"min","0"),u(De,"max",e[8]),u(De,"class","in-m tr w-1/3"),u(Oe,"name","irb"),u(Oe,"type","number"),u(Oe,"min","0"),u(Oe,"max",e[8]),u(Oe,"class","in-l tr w-1/3"),u(Fe,"class","flex"),u(N,"class","w-full"),u(Te,"name","idd"),u(Te,"type","number"),u(Te,"min","0"),u(Te,"max",e[8]),u(Te,"class","in-s tr"),u(We,"class","my-1 pr-1 w-1/3"),u(Qe,"class","w-full"),u(ot,"name","itd"),u(ot,"type","number"),u(ot,"min","0"),u(ot,"max",e[8]),u(ot,"class","in-f tr w-full"),u(Ie,"class","my-1 w-1/3"),u(ye,"name","ita"),u(ye,"type","number"),u(ye,"min","0"),u(ye,"max",e[8]),u(ye,"class","in-l tr w-full"),u(Nt,"class","my-1 pr-1 w-1/3"),u(B,"class","flex flex-wrap")},m(Le,he){P(Le,t,he),P(Le,l,he),P(Le,n,he),s(n,i),s(i,f),s(i,r),s(i,c),s(i,a),Se(_,a,null),Ze(a,e[4].i.h.p,!0),s(n,p),s(n,v),s(v,h),s(v,g),s(v,M),s(v,A),Se(I,A,null),Ze(A,e[4].i.h.t,!0),s(n,O),s(n,L),s(L,q),s(q,U),U.checked=e[4].i.h.u,s(q,E),s(q,z),P(Le,G,he),P(Le,B,he),s(B,R),s(R,y),s(R,H),s(R,Y),s(R,X),be(X,e[4].i.a),s(B,J),s(B,$),s($,ie),s($,oe),s($,ae),s($,se),s(se,x),be(x,e[4].i.l.p),s(B,me),s(B,pe),s(pe,V),s(V,Z),Z.checked=e[4].i.l.i,s(V,ge),s(V,S),s(B,w),s(B,N),s(N,j),s(N,te),s(te,le),le.checked=e[4].i.r.i,s(te,fe),s(te,qe),s(N,Pe),s(N,we),s(N,Fe),s(Fe,Ae),be(Ae,e[4].i.r.r),s(Fe,ke),s(Fe,De),be(De,e[4].i.r.g),s(Fe,He),s(Fe,Oe),be(Oe,e[4].i.r.b),s(B,je),s(B,Qe),s(Qe,We),s(We,$e),s(We,tt),s(We,Te),be(Te,e[4].i.d.d),s(B,ue),s(B,Ie),s(Ie,lt),s(Ie,wt),s(Ie,st),s(Ie,ot),be(ot,e[4].i.t.d),s(B,xe),s(B,Nt),s(Nt,At),s(Nt,Pt),s(Nt,Be),s(Nt,ye),be(ye,e[4].i.t.a),s(B,It),at&&at.m(B,null),s(B,vt),rt&&rt.m(B,null),nt=!0,Tt||(it=[re(a,"change",e[84]),re(A,"change",e[85]),re(U,"change",e[86]),re(X,"input",e[87]),re(x,"input",e[88]),re(Z,"change",e[89]),re(le,"change",e[90]),re(Ae,"input",e[91]),re(De,"input",e[92]),re(Oe,"input",e[93]),re(Te,"input",e[94]),re(ot,"input",e[95]),re(ye,"input",e[96])],Tt=!0)},p(Le,he){var Dn,Wl,hn,qn,Wn,Gn,ml,Jl,$l,Vn,xl,Gl,bn,On,Kn,Yn,en,cl,Qn,ti,us,gn,li,Mi,rs,cs,In,Pl,_s,ni,ms,Si,ps,kn,Xn,El,ds,ii,Ci,vs,hs;(!nt||he[0]&2)&&o!==(o=((qn=(hn=(Wl=(Dn=Le[1].conf)==null?void 0:Dn.hw)==null?void 0:Wl.han)==null?void 0:hn.rx)!=null?qn:"HAN RX")+"")&&C(f,o);const et={};he[0]&1&&(et.chip=Le[0].chip),_.$set(et),he[0]&16&&Ze(a,Le[4].i.h.p),(!nt||he[0]&2)&&d!==(d=((Jl=(ml=(Gn=(Wn=Le[1].conf)==null?void 0:Wn.hw)==null?void 0:Gn.han)==null?void 0:ml.tx)!=null?Jl:"HAN TX")+"")&&C(h,d);const zn={};he[0]&1&&(zn.chip=Le[0].chip),I.$set(zn),he[0]&16&&Ze(A,Le[4].i.h.t),he[0]&16&&(U.checked=Le[4].i.h.u),(!nt||he[0]&2)&&F!==(F=((Gl=(xl=(Vn=($l=Le[1].conf)==null?void 0:$l.hw)==null?void 0:Vn.han)==null?void 0:xl.pullup)!=null?Gl:"pullup")+"")&&C(z,F),(!nt||he[0]&2)&&K!==(K=((Kn=(On=(bn=Le[1].conf)==null?void 0:bn.hw)==null?void 0:On.ap_btn)!=null?Kn:"AP button")+"")&&C(y,K),(!nt||he[0]&256)&&u(X,"max",Le[8]),he[0]&16&&Xe(X.value)!==Le[4].i.a&&be(X,Le[4].i.a),(!nt||he[0]&2)&&ce!==(ce=((Qn=(cl=(en=(Yn=Le[1].conf)==null?void 0:Yn.hw)==null?void 0:en.led)==null?void 0:cl.title)!=null?Qn:"LED")+"")&&C(ie,ce),(!nt||he[0]&256)&&u(x,"max",Le[8]),he[0]&16&&Xe(x.value)!==Le[4].i.l.p&&be(x,Le[4].i.l.p),he[0]&16&&(Z.checked=Le[4].i.l.i),(!nt||he[0]&2)&&ve!==(ve=((li=(gn=(us=(ti=Le[1].conf)==null?void 0:ti.hw)==null?void 0:us.led)==null?void 0:gn.inverted)!=null?li:"inverted")+"")&&C(S,ve),(!nt||he[0]&2)&&D!==(D=((In=(cs=(rs=(Mi=Le[1].conf)==null?void 0:Mi.hw)==null?void 0:rs.led)==null?void 0:cs.rgb)!=null?In:"RGB")+"")&&C(j,D),he[0]&16&&(le.checked=Le[4].i.r.i),(!nt||he[0]&2)&&de!==(de=((ms=(ni=(_s=(Pl=Le[1].conf)==null?void 0:Pl.hw)==null?void 0:_s.led)==null?void 0:ni.inverted)!=null?ms:"inverted")+"")&&C(qe,de),(!nt||he[0]&256)&&u(Ae,"max",Le[8]),he[0]&16&&Xe(Ae.value)!==Le[4].i.r.r&&be(Ae,Le[4].i.r.r),(!nt||he[0]&256)&&u(De,"max",Le[8]),he[0]&16&&Xe(De.value)!==Le[4].i.r.g&&be(De,Le[4].i.r.g),(!nt||he[0]&256)&&u(Oe,"max",Le[8]),he[0]&16&&Xe(Oe.value)!==Le[4].i.r.b&&be(Oe,Le[4].i.r.b),(!nt||he[0]&2)&&Je!==(Je=((Xn=(kn=(ps=(Si=Le[1].conf)==null?void 0:Si.hw)==null?void 0:ps.led)==null?void 0:kn.disable)!=null?Xn:"LED dis. GPIO")+"")&&C($e,Je),(!nt||he[0]&256)&&u(Te,"max",Le[8]),he[0]&16&&Xe(Te.value)!==Le[4].i.d.d&&be(Te,Le[4].i.d.d),(!nt||he[0]&2)&&kt!==(kt=((ii=(ds=(El=Le[1].conf)==null?void 0:El.hw)==null?void 0:ds.temp)!=null?ii:"Temperature")+"")&&C(lt,kt),(!nt||he[0]&256)&&u(ot,"max",Le[8]),he[0]&16&&Xe(ot.value)!==Le[4].i.t.d&&be(ot,Le[4].i.t.d),(!nt||he[0]&2)&>!==(gt=((hs=(vs=(Ci=Le[1].conf)==null?void 0:Ci.hw)==null?void 0:vs.temp_analog)!=null?hs:"Analog temp")+"")&&C(At,gt),(!nt||he[0]&256)&&u(ye,"max",Le[8]),he[0]&16&&Xe(ye.value)!==Le[4].i.t.a&&be(ye,Le[4].i.t.a),Le[0].chip!="esp8266"?at?at.p(Le,he):(at=J2(Le),at.c(),at.m(B,vt)):at&&(at.d(1),at=null),Le[4].i.v.p>0?rt?rt.p(Le,he):(rt=$2(Le),rt.c(),rt.m(B,null)):rt&&(rt.d(1),rt=null)},i(Le){nt||(Q(_.$$.fragment,Le),Q(I.$$.fragment,Le),nt=!0)},o(Le){ee(_.$$.fragment,Le),ee(I.$$.fragment,Le),nt=!1},d(Le){Le&&T(t),Le&&T(l),Le&&T(n),Ce(_),Ce(I),Le&&T(G),Le&&T(B),at&&at.d(),rt&&rt.d(),Tt=!1,Et(it)}}}function J2(e){var a,_,p,v;let t,l=((v=(p=(_=(a=e[1].conf)==null?void 0:a.hw)==null?void 0:_.vcc)==null?void 0:p.title)!=null?v:"Vcc")+"",n,i,o,f,r,c;return{c(){t=m("div"),n=k(l),i=m("br"),o=b(),f=m("input"),u(f,"name","ivp"),u(f,"type","number"),u(f,"min","0"),u(f,"max",e[8]),u(f,"class","in-s tr w-full"),u(t,"class","my-1 pl-1 w-1/3")},m(d,h){P(d,t,h),s(t,n),s(t,i),s(t,o),s(t,f),be(f,e[4].i.v.p),r||(c=re(f,"input",e[97]),r=!0)},p(d,h){var g,M,A,I;h[0]&2&&l!==(l=((I=(A=(M=(g=d[1].conf)==null?void 0:g.hw)==null?void 0:M.vcc)==null?void 0:A.title)!=null?I:"Vcc")+"")&&C(n,l),h[0]&256&&u(f,"max",d[8]),h[0]&16&&Xe(f.value)!==d[4].i.v.p&&be(f,d[4].i.v.p)},d(d){d&&T(t),r=!1,c()}}}function $2(e){var h,g,M,A;let t,l=((A=(M=(g=(h=e[1].conf)==null?void 0:h.hw)==null?void 0:g.vcc)==null?void 0:M.divider)!=null?A:"Voltage divider")+"",n,i,o,f,r,c,a,_,p,v,d;return{c(){var I,O,L,q,U,E,F,z;t=m("div"),n=k(l),i=m("br"),o=b(),f=m("div"),r=m("input"),a=b(),_=m("input"),u(r,"name","ivdv"),u(r,"type","number"),u(r,"min","0"),u(r,"max","65535"),u(r,"class","in-f tr w-full"),u(r,"placeholder",c=(q=(L=(O=(I=e[1].conf)==null?void 0:I.hw)==null?void 0:O.vcc)==null?void 0:L.div_vcc)!=null?q:"VCC"),u(_,"name","ivdg"),u(_,"type","number"),u(_,"min","0"),u(_,"max","65535"),u(_,"class","in-l tr w-full"),u(_,"placeholder",p=(z=(F=(E=(U=e[1].conf)==null?void 0:U.hw)==null?void 0:E.vcc)==null?void 0:F.div_gnd)!=null?z:"GND"),u(f,"class","flex"),u(t,"class","my-1")},m(I,O){P(I,t,O),s(t,n),s(t,i),s(t,o),s(t,f),s(f,r),be(r,e[4].i.v.d.v),s(f,a),s(f,_),be(_,e[4].i.v.d.g),v||(d=[re(r,"input",e[98]),re(_,"input",e[99])],v=!0)},p(I,O){var L,q,U,E,F,z,G,B,R,K,y,H;O[0]&2&&l!==(l=((E=(U=(q=(L=I[1].conf)==null?void 0:L.hw)==null?void 0:q.vcc)==null?void 0:U.divider)!=null?E:"Voltage divider")+"")&&C(n,l),O[0]&2&&c!==(c=(B=(G=(z=(F=I[1].conf)==null?void 0:F.hw)==null?void 0:z.vcc)==null?void 0:G.div_vcc)!=null?B:"VCC")&&u(r,"placeholder",c),O[0]&16&&Xe(r.value)!==I[4].i.v.d.v&&be(r,I[4].i.v.d.v),O[0]&2&&p!==(p=(H=(y=(K=(R=I[1].conf)==null?void 0:R.hw)==null?void 0:K.vcc)==null?void 0:y.div_gnd)!=null?H:"GND")&&u(_,"placeholder",p),O[0]&16&&Xe(_.value)!==I[4].i.v.d.g&&be(_,I[4].i.v.d.g)},d(I){I&&T(t),v=!1,Et(d)}}}function x2(e){var h,g,M,A,I,O,L,q,U,E,F,z,G,B,R;let t,l=((I=(A=(M=(g=(h=e[1].conf)==null?void 0:h.hw)==null?void 0:g.led)==null?void 0:M.behaviour)==null?void 0:A.title)!=null?I:"LED behaviour")+"",n,i,o,f,r=((E=(U=(q=(L=(O=e[1].conf)==null?void 0:O.hw)==null?void 0:L.led)==null?void 0:q.behaviour)==null?void 0:U.enabled)!=null?E:"Enabled")+"",c,a,_=((R=(B=(G=(z=(F=e[1].conf)==null?void 0:F.hw)==null?void 0:z.led)==null?void 0:G.behaviour)==null?void 0:B.disabled)!=null?R:"Disabled")+"",p,v,d;return{c(){t=m("div"),n=k(l),i=b(),o=m("select"),f=m("option"),c=k(r),a=m("option"),p=k(_),f.__value=0,f.value=f.__value,a.__value=1,a.value=a.__value,u(o,"name","idb"),u(o,"class","in-s"),e[4].i.d.b===void 0&&Ct(()=>e[100].call(o)),u(t,"class","my-1 w-full")},m(K,y){P(K,t,y),s(t,n),s(t,i),s(t,o),s(o,f),s(f,c),s(o,a),s(a,p),Ze(o,e[4].i.d.b,!0),v||(d=re(o,"change",e[100]),v=!0)},p(K,y){var H,Y,X,J,$,ce,ie,oe,ae,se,x,me,pe,V,Z;y[0]&2&&l!==(l=(($=(J=(X=(Y=(H=K[1].conf)==null?void 0:H.hw)==null?void 0:Y.led)==null?void 0:X.behaviour)==null?void 0:J.title)!=null?$:"LED behaviour")+"")&&C(n,l),y[0]&2&&r!==(r=((se=(ae=(oe=(ie=(ce=K[1].conf)==null?void 0:ce.hw)==null?void 0:ie.led)==null?void 0:oe.behaviour)==null?void 0:ae.enabled)!=null?se:"Enabled")+"")&&C(c,r),y[0]&2&&_!==(_=((Z=(V=(pe=(me=(x=K[1].conf)==null?void 0:x.hw)==null?void 0:me.led)==null?void 0:pe.behaviour)==null?void 0:V.disabled)!=null?Z:"Disabled")+"")&&C(p,_),y[0]&16&&Ze(o,K[4].i.d.b)},d(K){K&&T(t),v=!1,d()}}}function ed(e){var q,U,E,F,z,G,B,R;let t,l,n,i,o=((F=(E=(U=(q=e[1].conf)==null?void 0:q.hw)==null?void 0:U.vcc)==null?void 0:E.offset)!=null?F:"Vcc offset")+"",f,r,c,a,_,p,v=((R=(B=(G=(z=e[1].conf)==null?void 0:z.hw)==null?void 0:G.vcc)==null?void 0:B.multiplier)!=null?R:"Multiplier")+"",d,h,g,M,A,I,O,L=(e[0].board==2||e[0].board==100)&&td(e);return{c(){t=m("input"),l=b(),n=m("div"),i=m("div"),f=k(o),r=m("br"),c=b(),a=m("input"),_=b(),p=m("div"),d=k(v),h=m("br"),g=b(),M=m("input"),A=b(),L&&L.c(),u(t,"type","hidden"),u(t,"name","iv"),t.value="true",u(a,"name","ivo"),u(a,"type","number"),u(a,"min","0.0"),u(a,"max","3.5"),u(a,"step","0.01"),u(a,"class","in-f tr w-full"),u(i,"class","w-1/3"),u(M,"name","ivm"),u(M,"type","number"),u(M,"min","0.1"),u(M,"max","10"),u(M,"step","0.01"),u(M,"class","in-l tr w-full"),u(p,"class","w-1/3 pr-1"),u(n,"class","my-1 flex flex-wrap")},m(K,y){P(K,t,y),P(K,l,y),P(K,n,y),s(n,i),s(i,f),s(i,r),s(i,c),s(i,a),be(a,e[4].i.v.o),s(n,_),s(n,p),s(p,d),s(p,h),s(p,g),s(p,M),be(M,e[4].i.v.m),s(n,A),L&&L.m(n,null),I||(O=[re(a,"input",e[101]),re(M,"input",e[102])],I=!0)},p(K,y){var H,Y,X,J,$,ce,ie,oe;y[0]&2&&o!==(o=((J=(X=(Y=(H=K[1].conf)==null?void 0:H.hw)==null?void 0:Y.vcc)==null?void 0:X.offset)!=null?J:"Vcc offset")+"")&&C(f,o),y[0]&16&&Xe(a.value)!==K[4].i.v.o&&be(a,K[4].i.v.o),y[0]&2&&v!==(v=((oe=(ie=(ce=($=K[1].conf)==null?void 0:$.hw)==null?void 0:ce.vcc)==null?void 0:ie.multiplier)!=null?oe:"Multiplier")+"")&&C(d,v),y[0]&16&&Xe(M.value)!==K[4].i.v.m&&be(M,K[4].i.v.m),K[0].board==2||K[0].board==100?L?L.p(K,y):(L=td(K),L.c(),L.m(n,null)):L&&(L.d(1),L=null)},d(K){K&&T(t),K&&T(l),K&&T(n),L&&L.d(),I=!1,Et(O)}}}function td(e){var a,_,p,v;let t,l=((v=(p=(_=(a=e[1].conf)==null?void 0:a.hw)==null?void 0:_.vcc)==null?void 0:p.boot)!=null?v:"Boot limit")+"",n,i,o,f,r,c;return{c(){t=m("div"),n=k(l),i=m("br"),o=b(),f=m("input"),u(f,"name","ivb"),u(f,"type","number"),u(f,"min","2.5"),u(f,"max","3.5"),u(f,"step","0.1"),u(f,"class","in-s tr w-full"),u(t,"class","w-1/3 pl-1")},m(d,h){P(d,t,h),s(t,n),s(t,i),s(t,o),s(t,f),be(f,e[4].i.v.b),r||(c=re(f,"input",e[103]),r=!0)},p(d,h){var g,M,A,I;h[0]&2&&l!==(l=((I=(A=(M=(g=d[1].conf)==null?void 0:g.hw)==null?void 0:M.vcc)==null?void 0:A.boot)!=null?I:"Boot limit")+"")&&C(n,l),h[0]&16&&Xe(f.value)!==d[4].i.v.b&&be(f,d[4].i.v.b)},d(d){d&&T(t),r=!1,c()}}}function ld(e){var U,E,F,z,G,B;let t,l=((F=(E=(U=e[1].conf)==null?void 0:U.debug)==null?void 0:E.danger)!=null?F:"Disable when done")+"",n,i,o,f,r,c,a=((B=(G=(z=e[1].conf)==null?void 0:z.debug)==null?void 0:G.telnet)!=null?B:"Enable telnet")+"",_,p,v,d,h,g,M,A,I,O,L,q=e[4].d.t&&nd(e);return{c(){t=m("div"),n=k(l),i=b(),o=m("div"),f=m("label"),r=m("input"),c=b(),_=k(a),p=b(),q&&q.c(),v=b(),d=m("div"),h=m("select"),g=m("option"),g.textContent="Verbose",M=m("option"),M.textContent="Debug",A=m("option"),A.textContent="Info",I=m("option"),I.textContent="Warning",u(t,"class","bd-red"),u(r,"type","checkbox"),u(r,"name","dt"),r.__value="true",r.value=r.__value,u(r,"class","rounded mb-1"),u(o,"class","my-1"),g.__value=1,g.value=g.__value,M.__value=2,M.value=M.__value,A.__value=3,A.value=A.__value,I.__value=4,I.value=I.__value,u(h,"name","dl"),u(h,"class","in-s"),e[4].d.l===void 0&&Ct(()=>e[106].call(h)),u(d,"class","my-1")},m(R,K){P(R,t,K),s(t,n),P(R,i,K),P(R,o,K),s(o,f),s(f,r),r.checked=e[4].d.t,s(f,c),s(f,_),P(R,p,K),q&&q.m(R,K),P(R,v,K),P(R,d,K),s(d,h),s(h,g),s(h,M),s(h,A),s(h,I),Ze(h,e[4].d.l,!0),O||(L=[re(r,"change",e[105]),re(h,"change",e[106])],O=!0)},p(R,K){var y,H,Y,X,J,$;K[0]&2&&l!==(l=((Y=(H=(y=R[1].conf)==null?void 0:y.debug)==null?void 0:H.danger)!=null?Y:"Disable when done")+"")&&C(n,l),K[0]&16&&(r.checked=R[4].d.t),K[0]&2&&a!==(a=(($=(J=(X=R[1].conf)==null?void 0:X.debug)==null?void 0:J.telnet)!=null?$:"Enable telnet")+"")&&C(_,a),R[4].d.t?q?q.p(R,K):(q=nd(R),q.c(),q.m(v.parentNode,v)):q&&(q.d(1),q=null),K[0]&16&&Ze(h,R[4].d.l)},d(R){R&&T(t),R&&T(i),R&&T(o),R&&T(p),q&&q.d(R),R&&T(v),R&&T(d),O=!1,Et(L)}}}function nd(e){var i,o,f;let t,l=((f=(o=(i=e[1].conf)==null?void 0:i.debug)==null?void 0:o.telnet_danger)!=null?f:"Disable when done")+"",n;return{c(){t=m("div"),n=k(l),u(t,"class","bd-red")},m(r,c){P(r,t,c),s(t,n)},p(r,c){var a,_,p;c[0]&2&&l!==(l=((p=(_=(a=r[1].conf)==null?void 0:a.debug)==null?void 0:_.telnet_danger)!=null?p:"Disable when done")+"")&&C(n,l)},d(r){r&&T(t)}}}function gg(e){var Wu,Gu,Vu,Ku,Yu,Qu,Xu,Zu,Ju,$u,xu,er,tr,lr,nr,ir,sr,or,ar,fr,ur,rr,cr,_r,mr,pr,dr,vr,hr,br,gr,kr,wr,Mr,Sr,Cr,Nr,Tr,Pr,Er,Ar,Dr,qr,Or,Ir,Lr,Rr,Fr,Br,Ur,jr,Hr,yr,zr,Wr,Gr,Vr,Kr,Yr,Qr,Xr,Zr,Jr,$r,xr,e1,t1,l1,n1,i1,s1,o1,a1,f1,u1,r1,c1,_1,m1,p1,d1,v1,h1,b1,g1,k1,w1,M1,S1,C1,N1,T1,P1,E1,A1,D1,q1,O1,I1,L1,R1,F1,B1,U1,j1,H1,y1,z1,W1,G1,V1,K1,Y1,Q1,X1,Z1,J1,$1,x1,e0,t0,l0,n0,i0,s0,o0,a0,f0,u0,r0,c0,_0,m0,p0,d0,v0,h0,b0,g0,k0,w0,M0,S0,C0,N0,T0,P0,E0,A0,D0,q0,O0,I0,L0,R0,F0,B0,U0,j0,H0;let t,l,n,i,o=((Vu=(Gu=(Wu=e[1].conf)==null?void 0:Wu.general)==null?void 0:Gu.title)!=null?Vu:"General")+"",f,r,c,a,_,p,v,d,h,g,M=((Qu=(Yu=(Ku=e[1].conf)==null?void 0:Ku.general)==null?void 0:Yu.hostname)!=null?Qu:"Hostname")+"",A,I,O,L,q,U,E=((Ju=(Zu=(Xu=e[1].conf)==null?void 0:Xu.general)==null?void 0:Zu.timezone)!=null?Ju:"Time zone")+"",F,z,G,B,R,K,y,H,Y,X,J,$=((er=(xu=($u=e[1].conf)==null?void 0:$u.price)==null?void 0:xu.region)!=null?er:"Price region")+"",ce,ie,oe,ae,se,x,me,pe,V,Z,ge,ve,S,w,N,D,j,te,le,fe,de,qe,Pe,we,Fe,Ae,ke,De,He,Oe,je,Qe,We,Je=((nr=(lr=(tr=e[1].conf)==null?void 0:tr.price)==null?void 0:lr.currency)!=null?nr:"Currency")+"",$e,tt,Te,ue,Ie,kt,lt,wt,st,ot,xe,Nt,gt=((or=(sr=(ir=e[1].conf)==null?void 0:ir.price)==null?void 0:sr.enabled)!=null?or:"Enabled")+"",At,Pt,Be,ye,It=((rr=(ur=(fr=(ar=e[1].conf)==null?void 0:ar.general)==null?void 0:fr.security)==null?void 0:ur.title)!=null?rr:"Security")+"",vt,nt,Tt,it,at,rt=((pr=(mr=(_r=(cr=e[1].conf)==null?void 0:cr.general)==null?void 0:_r.security)==null?void 0:mr.none)!=null?pr:"None")+"",jt,Lt,Ht=((br=(hr=(vr=(dr=e[1].conf)==null?void 0:dr.general)==null?void 0:vr.security)==null?void 0:hr.conf)!=null?br:"Conf")+"",yt,Me,Ve=((Mr=(wr=(kr=(gr=e[1].conf)==null?void 0:gr.general)==null?void 0:kr.security)==null?void 0:wr.all)!=null?Mr:"All")+"",Rt,Gt,zt,Dt,Kt=((Nr=(Cr=(Sr=e[1].conf)==null?void 0:Sr.general)==null?void 0:Cr.context)!=null?Nr:"Context")+"",Zt,tl,Jt,ft,Mt,Ke,ne,Ue,Re=((Er=(Pr=(Tr=e[1].conf)==null?void 0:Tr.meter)==null?void 0:Pr.title)!=null?Er:"Meter")+"",St,ut,Yt,ll,fl,ul,Sl,rl,Cl,nl,_l=((Or=(qr=(Dr=(Ar=e[1].conf)==null?void 0:Ar.meter)==null?void 0:Dr.comm)==null?void 0:qr.title)!=null?Or:"Communication")+"",dl,Nl,Tl,Qt,Ee,qt=((Fr=(Rr=(Lr=(Ir=e[1].conf)==null?void 0:Ir.meter)==null?void 0:Lr.comm)==null?void 0:Rr.passive)!=null?Fr:"Passive")+"",En,Zl,vn=((Hr=(jr=(Ur=(Br=e[1].conf)==null?void 0:Br.meter)==null?void 0:Ur.comm)==null?void 0:jr.pulse)!=null?Hr:"Pulse")+"",An,Le,he=((Gr=(Wr=(zr=(yr=e[1].conf)==null?void 0:yr.meter)==null?void 0:zr.comm)==null?void 0:Wr.kmp)!=null?Gr:"KMP")+"",et,zn,Dn,Wl,hn=((Kr=(Vr=e[1].common)==null?void 0:Vr.voltage)!=null?Kr:"Voltage")+"",qn,Wn,Gn,ml,Jl,$l,Vn,xl,Gl,bn=((Xr=(Qr=(Yr=e[1].conf)==null?void 0:Yr.meter)==null?void 0:Qr.fuse)!=null?Xr:"Main fuse")+"",On,Kn,Yn,en,cl,Qn,ti,us,gn,li=(($r=(Jr=(Zr=e[1].conf)==null?void 0:Zr.meter)==null?void 0:Jr.prod)!=null?$r:"Production")+"",Mi,rs,cs,In,Pl,_s,ni,ms,Si,ps,kn,Xn,El,ds,ii=((t1=(e1=(xr=e[1].conf)==null?void 0:xr.meter)==null?void 0:e1.encrypted)!=null?t1:"Encrypted")+"",Ci,vs,hs,Xo,bs,nn,Df,ys=((s1=(i1=(n1=(l1=e[1].conf)==null?void 0:l1.meter)==null?void 0:n1.multipliers)==null?void 0:i1.title)!=null?s1:"Multipliers")+"",Zo,qf,Of,Vl,zs,Ws=((f1=(a1=(o1=e[1].conf)==null?void 0:o1.connection)==null?void 0:a1.title)!=null?f1:"Connection")+"",Jo,If,Ni,Lf,Rf,gs,Ff,Gs,tn,Ti,Vs=((c1=(r1=(u1=e[1].conf)==null?void 0:u1.connection)==null?void 0:r1.wifi)!=null?c1:"WiFi")+"",$o,Pi,Ks=((p1=(m1=(_1=e[1].conf)==null?void 0:_1.connection)==null?void 0:m1.ap)!=null?p1:"AP")+"",xo,Bf,Uf,il,Ys,Qs=((h1=(v1=(d1=e[1].conf)==null?void 0:d1.network)==null?void 0:v1.title)!=null?h1:"Network")+"",ea,jf,Ei,Hf,yf,si,Xs=((k1=(g1=(b1=e[1].conf)==null?void 0:b1.network)==null?void 0:g1.ip)!=null?k1:"IP")+"",ta,zf,Wf,Zn,wn,Ai,Zs=((S1=(M1=(w1=e[1].conf)==null?void 0:w1.network)==null?void 0:M1.dhcp)!=null?S1:"DHCP")+"",la,Di,Js=((T1=(N1=(C1=e[1].conf)==null?void 0:C1.network)==null?void 0:N1.static)!=null?T1:"Static")+"",na,Gf,Kl,$s,xs,Vf,Yl,qi,eo,to,Kf,ia,lo,no,sn,Yf,Qf,io,ks,on,Xf,so=((A1=(E1=(P1=e[1].conf)==null?void 0:P1.network)==null?void 0:E1.tick_mdns)!=null?A1:"mDNS")+"",sa,Zf,ws,Jf,Ln,oo=((O1=(q1=(D1=e[1].conf)==null?void 0:D1.network)==null?void 0:q1.ntp)!=null?O1:"NTP")+"",oa,$f,Oi,an,xf,ao=((R1=(L1=(I1=e[1].conf)==null?void 0:I1.network)==null?void 0:L1.tick_ntp_dhcp)!=null?R1:"from DHCP")+"",aa,eu,tu,fo,Rn,lu,$t,uo,ro=((U1=(B1=(F1=e[1].conf)==null?void 0:F1.mqtt)==null?void 0:B1.title)!=null?U1:"MQTT")+"",fa,nu,Ii,iu,su,Ms,ou,fn,co=((y1=(H1=(j1=e[1].conf)==null?void 0:j1.mqtt)==null?void 0:H1.server)!=null?y1:"Server")+"",ua,au,ra,fu,uu,Li,Fn,ru,un,cu,ca,oi,_o=((G1=(W1=(z1=e[1].conf)==null?void 0:z1.mqtt)==null?void 0:W1.user)!=null?G1:"Username")+"",_a,_u,mu,Bn,pu,ai,mo=((Y1=(K1=(V1=e[1].conf)==null?void 0:V1.mqtt)==null?void 0:K1.pass)!=null?Y1:"Password")+"",ma,du,vu,Un,hu,Ri,Fi,po=((Z1=(X1=(Q1=e[1].conf)==null?void 0:Q1.mqtt)==null?void 0:X1.id)!=null?Z1:"Client ID")+"",pa,bu,gu,jn,ku,Bi,vo=((x1=($1=(J1=e[1].conf)==null?void 0:J1.mqtt)==null?void 0:$1.payload)!=null?x1:"Payload")+"",da,wu,Mu,pl,Ui,ji,Hi,ho=((n0=(l0=(t0=(e0=e[1].conf)==null?void 0:e0.mqtt)==null?void 0:t0.domoticz)==null?void 0:l0.title)!=null?n0:"Domoticz")+"",va,yi,bo=((a0=(o0=(s0=(i0=e[1].conf)==null?void 0:i0.mqtt)==null?void 0:s0.ha)==null?void 0:o0.title)!=null?a0:"Home-Assistant")+"",ha,zi,Wi,Gi,Vi,Su,fi,go=((r0=(u0=(f0=e[1].conf)==null?void 0:f0.mqtt)==null?void 0:u0.publish)!=null?r0:"Publish topic")+"",ba,Cu,Nu,Hn,Tu,ga,ka,wa,Ma=e[4].p.r.startsWith("NO")||e[4].p.r.startsWith("10YNO")||e[4].p.r.startsWith("10Y1001A1001A4"),Sa,Mn,ko,wo=((m0=(_0=(c0=e[1].conf)==null?void 0:c0.ui)==null?void 0:_0.title)!=null?m0:"User interface")+"",Ca,Pu,Ki,Eu,Au,Ss,Du,ui,Na,Yi,Mo=((v0=(d0=(p0=e[1].conf)==null?void 0:p0.ui)==null?void 0:d0.lang)!=null?v0:"Language")+"",Ta,qu,rn,Ou,Pa,Ql,So,Co=((g0=(b0=(h0=e[1].conf)==null?void 0:h0.debug)==null?void 0:b0.title)!=null?g0:"Debugging")+"",Ea,Iu,Qi,Lu,Cs,Ru,No,Ns,cn,Fu,To=((M0=(w0=(k0=e[1].conf)==null?void 0:k0.debug)==null?void 0:w0.enable)!=null?M0:"Enable debugging")+"",Aa,Bu,Uu,Jn,Da,Xi,Po=((C0=(S0=e[1].conf)==null?void 0:S0.btn_reset)!=null?C0:"Factory reset")+"",qa,ju,Eo,Zi,Ao=((T0=(N0=e[1].btn)==null?void 0:N0.reboot)!=null?T0:"Reboot")+"",Oa,Hu,Do,Ts,qo=((E0=(P0=e[1].btn)==null?void 0:P0.save)!=null?E0:"Save")+"",Ia,La,ri,Ra,ci,Fa,_i,Ba,mi,Ye,Ua,yu;R=new Y4({});let Xl=!e[4].p.t&&A2(),Kv=["NOK","SEK","DKK","EUR","CHF"],Ps=[];for(let W=0;W<5;W+=1)Ps[W]=lg(tg(e,Kv,W));lt=new ln({props:{to:"/priceconfig",class:"text-blue-600 hover:text-blue-800",$$slots:{default:[ng]},$$scope:{ctx:e}}});let Al=e[4].p.e&&e[0].chip!="esp8266"&&D2(e),Dl=e[4].g.s>0&&q2(e);function zu(W,_e){return W[4].m.a===2?sg:ig}let Oo=zu(e),Sn=Oo(e),ql=e[4].m.e.e&&O2(e),Ol=e[4].m.e.e&&I2(e),Il=e[4].m.m.e&&L2(e),Ll=e[0].if&&e[0].if.eth&&R2(e),Rl=(e[4].n.c==1||e[4].n.c==2)&&F2(e);qi=new Gv({});let Fl=e[4].n.m=="static"&&B2(e),Bl=e[0].chip!="esp8266"&&U2(e),sl=e[4].q.s.e&&j2(e),Ul=e[4].q.m==3&&H2(e),jl=e[4].q.m==4&&y2(e),ol=e[4].c.es!=null&&z2(e),Hl=Ma&&V2(e),Ji=e[9],vl=[];for(let W=0;W20||e[0].chip=="esp8266"||e[4].i.d.d>0)&&X2(e),yl=e[4].d.s&&ld(e);return ri=new kl({props:{active:e[2],message:(q0=(D0=(A0=e[1].conf)==null?void 0:A0.mask)==null?void 0:D0.loading)!=null?q0:"Loading"}}),ci=new kl({props:{active:e[3],message:(L0=(I0=(O0=e[1].conf)==null?void 0:O0.mask)==null?void 0:I0.saving)!=null?L0:"Saving"}}),_i=new kl({props:{active:e[6],message:(B0=(F0=(R0=e[1].conf)==null?void 0:R0.mask)==null?void 0:F0.reset)!=null?B0:"Factory reset"}}),mi=new kl({props:{active:e[7],message:(H0=(j0=(U0=e[1].conf)==null?void 0:U0.mask)==null?void 0:j0.reset_done)!=null?H0:"Done"}}),{c(){var W,_e,el;t=m("form"),l=m("div"),n=m("div"),i=m("strong"),f=k(o),r=b(),c=m("a"),a=k("\u24D8"),_=b(),p=m("input"),v=b(),d=m("div"),h=m("div"),g=m("div"),A=k(M),I=m("br"),O=b(),L=m("input"),q=b(),U=m("div"),F=k(E),z=m("br"),G=b(),B=m("select"),Ne(R.$$.fragment),K=b(),y=m("input"),H=b(),Y=m("div"),X=m("div"),J=m("div"),ce=k($),ie=m("br"),oe=b(),ae=m("select"),se=m("optgroup"),Xl&&Xl.c(),x=m("option"),x.textContent="NO1",me=m("option"),me.textContent="NO2",pe=m("option"),pe.textContent="NO3",V=m("option"),V.textContent="NO4",Z=m("option"),Z.textContent="NO5",ge=m("optgroup"),ve=m("option"),ve.textContent="SE1",S=m("option"),S.textContent="SE2",w=m("option"),w.textContent="SE3",N=m("option"),N.textContent="SE4",D=m("optgroup"),j=m("option"),j.textContent="DK1",te=m("option"),te.textContent="DK2",le=m("option"),le.textContent="Austria",fe=m("option"),fe.textContent="Belgium",de=m("option"),de.textContent="Czech Republic",qe=m("option"),qe.textContent="Estonia",Pe=m("option"),Pe.textContent="Finland",we=m("option"),we.textContent="France",Fe=m("option"),Fe.textContent="Germany",Ae=m("option"),Ae.textContent="Great Britain",ke=m("option"),ke.textContent="Latvia",De=m("option"),De.textContent="Lithuania",He=m("option"),He.textContent="Netherland",Oe=m("option"),Oe.textContent="Poland",je=m("option"),je.textContent="Switzerland",Qe=b(),We=m("div"),$e=k(Je),tt=m("br"),Te=b(),ue=m("select");for(let bl=0;bl<5;bl+=1)Ps[bl].c();Ie=b(),kt=m("div"),Ne(lt.$$.fragment),wt=b(),st=m("div"),ot=m("label"),xe=m("input"),Nt=b(),At=k(gt),Pt=b(),Al&&Al.c(),Be=b(),ye=m("div"),vt=k(It),nt=m("br"),Tt=b(),it=m("select"),at=m("option"),jt=k(rt),Lt=m("option"),yt=k(Ht),Me=m("option"),Rt=k(Ve),Gt=b(),Dl&&Dl.c(),zt=b(),Dt=m("div"),Zt=k(Kt),tl=m("br"),Jt=b(),ft=m("input"),Ke=b(),ne=m("div"),Ue=m("strong"),St=k(Re),ut=b(),Yt=m("a"),ll=k("\u24D8"),fl=b(),ul=m("input"),Sl=b(),rl=m("input"),Cl=b(),nl=m("div"),dl=k(_l),Nl=m("br"),Tl=b(),Qt=m("select"),Ee=m("option"),En=k(qt),Zl=m("option"),An=k(vn),Le=m("option"),et=k(he),zn=b(),Sn.c(),Dn=b(),Wl=m("div"),qn=k(hn),Wn=m("br"),Gn=b(),ml=m("select"),Jl=m("option"),Jl.textContent="400V (TN)",$l=m("option"),$l.textContent="230V (IT/TT)",Vn=b(),xl=m("div"),Gl=m("div"),On=k(bn),Kn=m("br"),Yn=b(),en=m("label"),cl=m("input"),Qn=b(),ti=m("span"),ti.textContent="A",us=b(),gn=m("div"),Mi=k(li),rs=m("br"),cs=b(),In=m("label"),Pl=m("input"),_s=b(),ni=m("span"),ni.textContent="kWp",ms=b(),Si=m("div"),ps=b(),kn=m("div"),Xn=m("label"),El=m("input"),ds=b(),Ci=k(ii),vs=b(),ql&&ql.c(),hs=b(),Ol&&Ol.c(),Xo=b(),bs=m("label"),nn=m("input"),Df=b(),Zo=k(ys),qf=b(),Il&&Il.c(),Of=b(),Vl=m("div"),zs=m("strong"),Jo=k(Ws),If=b(),Ni=m("a"),Lf=k("\u24D8"),Rf=b(),gs=m("input"),Ff=b(),Gs=m("div"),tn=m("select"),Ti=m("option"),$o=k(Vs),Pi=m("option"),xo=k(Ks),Ll&&Ll.c(),Bf=b(),Rl&&Rl.c(),Uf=b(),il=m("div"),Ys=m("strong"),ea=k(Qs),jf=b(),Ei=m("a"),Hf=k("\u24D8"),yf=b(),si=m("div"),ta=k(Xs),zf=m("br"),Wf=b(),Zn=m("div"),wn=m("select"),Ai=m("option"),la=k(Zs),Di=m("option"),na=k(Js),Gf=b(),Kl=m("input"),Vf=b(),Yl=m("select"),Ne(qi.$$.fragment),Kf=b(),Fl&&Fl.c(),ia=b(),lo=m("div"),no=m("label"),sn=m("input"),Yf=k(" IPv6"),Qf=b(),io=m("div"),ks=m("label"),on=m("input"),Xf=b(),sa=k(so),Zf=b(),ws=m("input"),Jf=b(),Ln=m("div"),oa=k(oo),$f=b(),Oi=m("label"),an=m("input"),xf=b(),aa=k(ao),eu=m("br"),tu=b(),fo=m("div"),Rn=m("input"),lu=b(),$t=m("div"),uo=m("strong"),fa=k(ro),nu=b(),Ii=m("a"),iu=k("\u24D8"),su=b(),Ms=m("input"),ou=b(),fn=m("div"),ua=k(co),au=b(),Bl&&Bl.c(),ra=b(),fu=m("br"),uu=b(),Li=m("div"),Fn=m("input"),ru=b(),un=m("input"),cu=b(),sl&&sl.c(),ca=b(),oi=m("div"),_a=k(_o),_u=m("br"),mu=b(),Bn=m("input"),pu=b(),ai=m("div"),ma=k(mo),du=m("br"),vu=b(),Un=m("input"),hu=b(),Ri=m("div"),Fi=m("div"),pa=k(po),bu=m("br"),gu=b(),jn=m("input"),ku=b(),Bi=m("div"),da=k(vo),wu=m("br"),Mu=b(),pl=m("select"),Ui=m("option"),Ui.textContent="Raw (minimal)",ji=m("option"),ji.textContent="Raw (full)",Hi=m("option"),va=k(ho),yi=m("option"),ha=k(bo),zi=m("option"),zi.textContent="JSON (classic)",Wi=m("option"),Wi.textContent="JSON (multi topic)",Gi=m("option"),Gi.textContent="JSON (flat)",Vi=m("option"),Vi.textContent="HEX dump",Su=b(),fi=m("div"),ba=k(go),Cu=m("br"),Nu=b(),Hn=m("input"),Tu=b(),Ul&&Ul.c(),ga=b(),jl&&jl.c(),ka=b(),ol&&ol.c(),wa=b(),Hl&&Hl.c(),Sa=b(),Mn=m("div"),ko=m("strong"),Ca=k(wo),Pu=b(),Ki=m("a"),Eu=k("\u24D8"),Au=b(),Ss=m("input"),Du=b(),ui=m("div");for(let bl=0;ble[20].call(B)),u(h,"class","flex"),u(d,"class","my-1"),u(y,"type","hidden"),u(y,"name","p"),y.value="true",x.__value="10YNO-1--------2",x.value=x.__value,me.__value="10YNO-2--------T",me.value=me.__value,pe.__value="10YNO-3--------J",pe.value=pe.__value,V.__value="10YNO-4--------9",V.value=V.__value,Z.__value="10Y1001A1001A48H",Z.value=Z.__value,u(se,"label","Norway"),ve.__value="10Y1001A1001A44P",ve.value=ve.__value,S.__value="10Y1001A1001A45N",S.value=S.__value,w.__value="10Y1001A1001A46L",w.value=w.__value,N.__value="10Y1001A1001A47J",N.value=N.__value,u(ge,"label","Sweden"),j.__value="10YDK-1--------W",j.value=j.__value,te.__value="10YDK-2--------M",te.value=te.__value,u(D,"label","Denmark"),le.__value="10YAT-APG------L",le.value=le.__value,fe.__value="10YBE----------2",fe.value=fe.__value,de.__value="10YCZ-CEPS-----N",de.value=de.__value,qe.__value="10Y1001A1001A39I",qe.value=qe.__value,Pe.__value="10YFI-1--------U",Pe.value=Pe.__value,we.__value="10YFR-RTE------C",we.value=we.__value,Fe.__value="10Y1001A1001A83F",Fe.value=Fe.__value,Ae.__value="10YGB----------A",Ae.value=Ae.__value,ke.__value="10YLV-1001A00074",ke.value=ke.__value,De.__value="10YLT-1001A0008Q",De.value=De.__value,He.__value="10YNL----------L",He.value=He.__value,Oe.__value="10YPL-AREA-----S",Oe.value=Oe.__value,je.__value="10YCH-SWISSGRIDZ",je.value=je.__value,u(ae,"name","pr"),u(ae,"class","in-f w-full"),e[4].p.r===void 0&&Ct(()=>e[21].call(ae)),u(J,"class","w-full"),u(ue,"name","pc"),u(ue,"class","in-l"),e[4].p.c===void 0&&Ct(()=>e[22].call(ue)),u(X,"class","flex"),u(Y,"class","my-1"),u(kt,"class","my-1"),u(xe,"type","checkbox"),u(xe,"name","pe"),xe.__value="true",xe.value=xe.__value,u(xe,"class","rounded mb-1"),u(st,"class","my-1"),at.__value=0,at.value=at.__value,Lt.__value=1,Lt.value=Lt.__value,Me.__value=2,Me.value=Me.__value,u(it,"name","gs"),u(it,"class","in-s"),e[4].g.s===void 0&&Ct(()=>e[25].call(it)),u(ye,"class","my-1"),u(ft,"name","gc"),u(ft,"type","text"),u(ft,"pattern","[A-Za-z0-9]+"),u(ft,"placeholder",Mt=(el=(_e=(W=e[1].conf)==null?void 0:W.general)==null?void 0:_e.context_placeholder)!=null?el:"/"),u(ft,"class","in-s"),u(ft,"maxlength","36"),u(Dt,"class","my-1"),u(n,"class","cnt"),u(Ue,"class","text-sm"),u(Yt,"href",zl("Meter-configuration")),u(Yt,"target","_blank"),u(Yt,"class","float-right"),u(ul,"type","hidden"),u(ul,"name","m"),ul.value="true",u(rl,"type","hidden"),u(rl,"name","mo"),rl.value="1",Ee.__value=0,Ee.value=Ee.__value,Zl.__value=2,Zl.value=Zl.__value,Le.__value=9,Le.value=Le.__value,u(Qt,"name","ma"),u(Qt,"class","in-s"),e[4].m.a===void 0&&Ct(()=>e[29].call(Qt)),u(nl,"class","my-1"),Jl.__value=2,Jl.value=Jl.__value,$l.__value=1,$l.value=$l.__value,u(ml,"name","md"),u(ml,"class","in-s"),e[4].m.d===void 0&&Ct(()=>e[35].call(ml)),u(Wl,"class","my-1"),u(cl,"name","mf"),u(cl,"type","number"),u(cl,"min","5"),u(cl,"max","65535"),u(cl,"class","in-f tr w-full"),u(ti,"class","in-post"),u(en,"class","flex"),u(Gl,"class","mx-1"),u(Pl,"name","mr"),u(Pl,"type","number"),u(Pl,"min","0"),u(Pl,"max","65535"),u(Pl,"class","in-f tr w-full"),u(ni,"class","in-post"),u(In,"class","flex"),u(gn,"class","mx-1"),u(xl,"class","my-1 flex"),u(Si,"class","my-1"),u(El,"type","checkbox"),u(El,"name","me"),El.__value="true",El.value=El.__value,u(El,"class","rounded mb-1"),u(kn,"class","my-1"),u(nn,"type","checkbox"),u(nn,"name","mm"),nn.__value="true",nn.value=nn.__value,u(nn,"class","rounded mb-1"),u(ne,"class","cnt"),u(zs,"class","text-sm"),u(Ni,"href",zl("WiFi-configuration")),u(Ni,"target","_blank"),u(Ni,"class","float-right"),u(gs,"type","hidden"),u(gs,"name","w"),gs.value="true",Ti.__value=1,Ti.value=Ti.__value,Pi.__value=2,Pi.value=Pi.__value,u(tn,"name","nc"),u(tn,"class","in-s"),e[4].n.c===void 0&&Ct(()=>e[46].call(tn)),u(Gs,"class","my-1"),u(Vl,"class","cnt"),u(Ys,"class","text-sm"),u(Ei,"href",zl("Network-configuration")),u(Ei,"target","_blank"),u(Ei,"class","float-right"),Ai.__value="dhcp",Ai.value=Ai.__value,Di.__value="static",Di.value=Di.__value,u(wn,"name","nm"),u(wn,"class","in-f"),e[4].n.m===void 0&&Ct(()=>e[52].call(wn)),u(Kl,"name","ni"),u(Kl,"type","text"),u(Kl,"class","in-m w-full"),Kl.disabled=$s=e[4].n.m=="dhcp",Kl.required=xs=e[4].n.m=="static",u(Yl,"name","ns"),u(Yl,"class","in-l"),Yl.disabled=eo=e[4].n.m=="dhcp",Yl.required=to=e[4].n.m=="static",e[4].n.s===void 0&&Ct(()=>e[54].call(Yl)),u(Zn,"class","flex"),u(si,"class","my-1"),u(sn,"name","nx"),sn.__value="true",sn.value=sn.__value,u(sn,"type","checkbox"),u(sn,"class","rounded mb-1"),u(lo,"class","my-1"),u(on,"name","nd"),on.__value="true",on.value=on.__value,u(on,"type","checkbox"),u(on,"class","rounded mb-1"),u(io,"class","my-1"),u(ws,"type","hidden"),u(ws,"name","ntp"),ws.value="true",u(an,"name","ntpd"),an.__value="true",an.value=an.__value,u(an,"type","checkbox"),u(an,"class","rounded mb-1"),u(Oi,"class","ml-4"),u(Rn,"name","ntph"),u(Rn,"type","text"),u(Rn,"class","in-s"),u(fo,"class","flex"),u(Ln,"class","my-1"),u(il,"class","cnt"),u(uo,"class","text-sm"),u(Ii,"href",zl("MQTT-configuration")),u(Ii,"target","_blank"),u(Ii,"class","float-right"),u(Ms,"type","hidden"),u(Ms,"name","q"),Ms.value="true",u(Fn,"name","qh"),u(Fn,"type","text"),u(Fn,"class","in-f w-2/3"),u(un,"name","qp"),u(un,"type","number"),u(un,"min","1024"),u(un,"max","65535"),u(un,"class","in-l tr w-1/3"),u(Li,"class","flex"),u(fn,"class","my-1"),u(Bn,"name","qu"),u(Bn,"type","text"),u(Bn,"class","in-s"),u(oi,"class","my-1"),u(Un,"name","qa"),u(Un,"type","password"),u(Un,"class","in-s"),u(ai,"class","my-1"),u(jn,"name","qc"),u(jn,"type","text"),u(jn,"class","in-f w-full"),Ui.__value=1,Ui.value=Ui.__value,ji.__value=2,ji.value=ji.__value,Hi.__value=3,Hi.value=Hi.__value,yi.__value=4,yi.value=yi.__value,zi.__value=0,zi.value=zi.__value,Wi.__value=5,Wi.value=Wi.__value,Gi.__value=6,Gi.value=Gi.__value,Vi.__value=255,Vi.value=Vi.__value,u(pl,"name","qm"),u(pl,"class","in-l"),e[4].q.m===void 0&&Ct(()=>e[68].call(pl)),u(Ri,"class","my-1 flex"),u(Hn,"name","qb"),u(Hn,"type","text"),u(Hn,"class","in-s"),u(fi,"class","my-1"),u($t,"class","cnt"),u(ko,"class","text-sm"),u(Ki,"href",zl("User-interface")),u(Ki,"target","_blank"),u(Ki,"class","float-right"),u(Ss,"type","hidden"),u(Ss,"name","u"),Ss.value="true",u(rn,"name","ulang"),u(rn,"class","in-s"),e[4].u.lang===void 0&&Ct(()=>e[83].call(rn)),u(Yi,"class","w-1/2"),u(ui,"class","flex flex-wrap"),u(Mn,"class","cnt"),u(So,"class","text-sm"),u(Qi,"href","https://amsleser.no/blog/post/24-telnet-debug"),u(Qi,"target","_blank"),u(Qi,"class","float-right"),u(Cs,"type","hidden"),u(Cs,"name","d"),Cs.value="true",u(cn,"type","checkbox"),u(cn,"name","ds"),cn.__value="true",cn.value=cn.__value,u(cn,"class","rounded mb-1"),u(No,"class","mt-3"),u(Ql,"class","cnt"),u(l,"class","grid xl:grid-cols-4 lg:grid-cols-2 md:grid-cols-2"),u(Xi,"type","button"),u(Xi,"class","btn-red"),u(Zi,"type","button"),u(Zi,"class","btn-yellow"),u(Eo,"class","text-center"),u(Ts,"type","submit"),u(Ts,"class","btn-pri"),u(Do,"class","text-right"),u(Jn,"class","grid grid-cols-3 mt-3"),u(t,"autocomplete","off")},m(W,_e){P(W,t,_e),s(t,l),s(l,n),s(n,i),s(i,f),s(n,r),s(n,c),s(c,a),s(n,_),s(n,p),s(n,v),s(n,d),s(d,h),s(h,g),s(g,A),s(g,I),s(g,O),s(g,L),be(L,e[4].g.h),s(h,q),s(h,U),s(U,F),s(U,z),s(U,G),s(U,B),Se(R,B,null),Ze(B,e[4].g.t,!0),s(n,K),s(n,y),s(n,H),s(n,Y),s(Y,X),s(X,J),s(J,ce),s(J,ie),s(J,oe),s(J,ae),s(ae,se),Xl&&Xl.m(se,null),s(se,x),s(se,me),s(se,pe),s(se,V),s(se,Z),s(ae,ge),s(ge,ve),s(ge,S),s(ge,w),s(ge,N),s(ae,D),s(D,j),s(D,te),s(ae,le),s(ae,fe),s(ae,de),s(ae,qe),s(ae,Pe),s(ae,we),s(ae,Fe),s(ae,Ae),s(ae,ke),s(ae,De),s(ae,He),s(ae,Oe),s(ae,je),Ze(ae,e[4].p.r,!0),s(X,Qe),s(X,We),s(We,$e),s(We,tt),s(We,Te),s(We,ue);for(let el=0;el<5;el+=1)Ps[el]&&Ps[el].m(ue,null);Ze(ue,e[4].p.c,!0),s(n,Ie),s(n,kt),Se(lt,kt,null),s(n,wt),s(n,st),s(st,ot),s(ot,xe),xe.checked=e[4].p.e,s(ot,Nt),s(ot,At),s(st,Pt),Al&&Al.m(st,null),s(n,Be),s(n,ye),s(ye,vt),s(ye,nt),s(ye,Tt),s(ye,it),s(it,at),s(at,jt),s(it,Lt),s(Lt,yt),s(it,Me),s(Me,Rt),Ze(it,e[4].g.s,!0),s(n,Gt),Dl&&Dl.m(n,null),s(n,zt),s(n,Dt),s(Dt,Zt),s(Dt,tl),s(Dt,Jt),s(Dt,ft),be(ft,e[4].g.c),s(l,Ke),s(l,ne),s(ne,Ue),s(Ue,St),s(ne,ut),s(ne,Yt),s(Yt,ll),s(ne,fl),s(ne,ul),s(ne,Sl),s(ne,rl),s(ne,Cl),s(ne,nl),s(nl,dl),s(nl,Nl),s(nl,Tl),s(nl,Qt),s(Qt,Ee),s(Ee,En),s(Qt,Zl),s(Zl,An),s(Qt,Le),s(Le,et),Ze(Qt,e[4].m.a,!0),s(ne,zn),Sn.m(ne,null),s(ne,Dn),s(ne,Wl),s(Wl,qn),s(Wl,Wn),s(Wl,Gn),s(Wl,ml),s(ml,Jl),s(ml,$l),Ze(ml,e[4].m.d,!0),s(ne,Vn),s(ne,xl),s(xl,Gl),s(Gl,On),s(Gl,Kn),s(Gl,Yn),s(Gl,en),s(en,cl),be(cl,e[4].m.f),s(en,Qn),s(en,ti),s(xl,us),s(xl,gn),s(gn,Mi),s(gn,rs),s(gn,cs),s(gn,In),s(In,Pl),be(Pl,e[4].m.r),s(In,_s),s(In,ni),s(ne,ms),s(ne,Si),s(ne,ps),s(ne,kn),s(kn,Xn),s(Xn,El),El.checked=e[4].m.e.e,s(Xn,ds),s(Xn,Ci),s(kn,vs),ql&&ql.m(kn,null),s(ne,hs),Ol&&Ol.m(ne,null),s(ne,Xo),s(ne,bs),s(bs,nn),nn.checked=e[4].m.m.e,s(bs,Df),s(bs,Zo),s(ne,qf),Il&&Il.m(ne,null),s(l,Of),s(l,Vl),s(Vl,zs),s(zs,Jo),s(Vl,If),s(Vl,Ni),s(Ni,Lf),s(Vl,Rf),s(Vl,gs),s(Vl,Ff),s(Vl,Gs),s(Gs,tn),s(tn,Ti),s(Ti,$o),s(tn,Pi),s(Pi,xo),Ll&&Ll.m(tn,null),Ze(tn,e[4].n.c,!0),s(Vl,Bf),Rl&&Rl.m(Vl,null),s(l,Uf),s(l,il),s(il,Ys),s(Ys,ea),s(il,jf),s(il,Ei),s(Ei,Hf),s(il,yf),s(il,si),s(si,ta),s(si,zf),s(si,Wf),s(si,Zn),s(Zn,wn),s(wn,Ai),s(Ai,la),s(wn,Di),s(Di,na),Ze(wn,e[4].n.m,!0),s(Zn,Gf),s(Zn,Kl),be(Kl,e[4].n.i),s(Zn,Vf),s(Zn,Yl),Se(qi,Yl,null),Ze(Yl,e[4].n.s,!0),s(il,Kf),Fl&&Fl.m(il,null),s(il,ia),s(il,lo),s(lo,no),s(no,sn),sn.checked=e[4].n.x,s(no,Yf),s(il,Qf),s(il,io),s(io,ks),s(ks,on),on.checked=e[4].n.d,s(ks,Xf),s(ks,sa),s(il,Zf),s(il,ws),s(il,Jf),s(il,Ln),s(Ln,oa),s(Ln,$f),s(Ln,Oi),s(Oi,an),an.checked=e[4].n.h,s(Oi,xf),s(Oi,aa),s(Ln,eu),s(Ln,tu),s(Ln,fo),s(fo,Rn),be(Rn,e[4].n.n1),s(l,lu),s(l,$t),s($t,uo),s(uo,fa),s($t,nu),s($t,Ii),s(Ii,iu),s($t,su),s($t,Ms),s($t,ou),s($t,fn),s(fn,ua),s(fn,au),Bl&&Bl.m(fn,null),s(fn,ra),s(fn,fu),s(fn,uu),s(fn,Li),s(Li,Fn),be(Fn,e[4].q.h),s(Li,ru),s(Li,un),be(un,e[4].q.p),s($t,cu),sl&&sl.m($t,null),s($t,ca),s($t,oi),s(oi,_a),s(oi,_u),s(oi,mu),s(oi,Bn),be(Bn,e[4].q.u),s($t,pu),s($t,ai),s(ai,ma),s(ai,du),s(ai,vu),s(ai,Un),be(Un,e[4].q.a),s($t,hu),s($t,Ri),s(Ri,Fi),s(Fi,pa),s(Fi,bu),s(Fi,gu),s(Fi,jn),be(jn,e[4].q.c),s(Ri,ku),s(Ri,Bi),s(Bi,da),s(Bi,wu),s(Bi,Mu),s(Bi,pl),s(pl,Ui),s(pl,ji),s(pl,Hi),s(Hi,va),s(pl,yi),s(yi,ha),s(pl,zi),s(pl,Wi),s(pl,Gi),s(pl,Vi),Ze(pl,e[4].q.m,!0),s($t,Su),s($t,fi),s(fi,ba),s(fi,Cu),s(fi,Nu),s(fi,Hn),be(Hn,e[4].q.b),s(l,Tu),Ul&&Ul.m(l,null),s(l,ga),jl&&jl.m(l,null),s(l,ka),ol&&ol.m(l,null),s(l,wa),Hl&&Hl.m(l,null),s(l,Sa),s(l,Mn),s(Mn,ko),s(ko,Ca),s(Mn,Pu),s(Mn,Ki),s(Ki,Eu),s(Mn,Au),s(Mn,Ss),s(Mn,Du),s(Mn,ui);for(let el=0;el0?Dl?Dl.p(W,_e):(Dl=q2(W),Dl.c(),Dl.m(n,zt)):Dl&&(Dl.d(1),Dl=null),(!Ye||_e[0]&2)&&Kt!==(Kt=((Sc=(Mc=(wc=W[1].conf)==null?void 0:wc.general)==null?void 0:Mc.context)!=null?Sc:"Context")+"")&&C(Zt,Kt),(!Ye||_e[0]&2&&Mt!==(Mt=(Tc=(Nc=(Cc=W[1].conf)==null?void 0:Cc.general)==null?void 0:Nc.context_placeholder)!=null?Tc:"/"))&&u(ft,"placeholder",Mt),_e[0]&16&&ft.value!==W[4].g.c&&be(ft,W[4].g.c),(!Ye||_e[0]&2)&&Re!==(Re=((Ac=(Ec=(Pc=W[1].conf)==null?void 0:Pc.meter)==null?void 0:Ec.title)!=null?Ac:"Meter")+"")&&C(St,Re),(!Ye||_e[0]&2)&&_l!==(_l=((Ic=(Oc=(qc=(Dc=W[1].conf)==null?void 0:Dc.meter)==null?void 0:qc.comm)==null?void 0:Oc.title)!=null?Ic:"Communication")+"")&&C(dl,_l),(!Ye||_e[0]&2)&&qt!==(qt=((Bc=(Fc=(Rc=(Lc=W[1].conf)==null?void 0:Lc.meter)==null?void 0:Rc.comm)==null?void 0:Fc.passive)!=null?Bc:"Passive")+"")&&C(En,qt),(!Ye||_e[0]&2)&&vn!==(vn=((yc=(Hc=(jc=(Uc=W[1].conf)==null?void 0:Uc.meter)==null?void 0:jc.comm)==null?void 0:Hc.pulse)!=null?yc:"Pulse")+"")&&C(An,vn),(!Ye||_e[0]&2)&&he!==(he=((Vc=(Gc=(Wc=(zc=W[1].conf)==null?void 0:zc.meter)==null?void 0:Wc.comm)==null?void 0:Gc.kmp)!=null?Vc:"KMP")+"")&&C(et,he),_e[0]&16&&Ze(Qt,W[4].m.a),Oo===(Oo=zu(W))&&Sn?Sn.p(W,_e):(Sn.d(1),Sn=Oo(W),Sn&&(Sn.c(),Sn.m(ne,Dn))),(!Ye||_e[0]&2)&&hn!==(hn=((Yc=(Kc=W[1].common)==null?void 0:Kc.voltage)!=null?Yc:"Voltage")+"")&&C(qn,hn),_e[0]&16&&Ze(ml,W[4].m.d),(!Ye||_e[0]&2)&&bn!==(bn=((Zc=(Xc=(Qc=W[1].conf)==null?void 0:Qc.meter)==null?void 0:Xc.fuse)!=null?Zc:"Main fuse")+"")&&C(On,bn),_e[0]&16&&Xe(cl.value)!==W[4].m.f&&be(cl,W[4].m.f),(!Ye||_e[0]&2)&&li!==(li=((xc=($c=(Jc=W[1].conf)==null?void 0:Jc.meter)==null?void 0:$c.prod)!=null?xc:"Production")+"")&&C(Mi,li),_e[0]&16&&Xe(Pl.value)!==W[4].m.r&&be(Pl,W[4].m.r),_e[0]&16&&(El.checked=W[4].m.e.e),(!Ye||_e[0]&2)&&ii!==(ii=((l_=(t_=(e_=W[1].conf)==null?void 0:e_.meter)==null?void 0:t_.encrypted)!=null?l_:"Encrypted")+"")&&C(Ci,ii),W[4].m.e.e?ql?ql.p(W,_e):(ql=O2(W),ql.c(),ql.m(kn,null)):ql&&(ql.d(1),ql=null),W[4].m.e.e?Ol?Ol.p(W,_e):(Ol=I2(W),Ol.c(),Ol.m(ne,Xo)):Ol&&(Ol.d(1),Ol=null),_e[0]&16&&(nn.checked=W[4].m.m.e),(!Ye||_e[0]&2)&&ys!==(ys=((o_=(s_=(i_=(n_=W[1].conf)==null?void 0:n_.meter)==null?void 0:i_.multipliers)==null?void 0:s_.title)!=null?o_:"Multipliers")+"")&&C(Zo,ys),W[4].m.m.e?Il?Il.p(W,_e):(Il=L2(W),Il.c(),Il.m(ne,null)):Il&&(Il.d(1),Il=null),(!Ye||_e[0]&2)&&Ws!==(Ws=((u_=(f_=(a_=W[1].conf)==null?void 0:a_.connection)==null?void 0:f_.title)!=null?u_:"Connection")+"")&&C(Jo,Ws),(!Ye||_e[0]&2)&&Vs!==(Vs=((__=(c_=(r_=W[1].conf)==null?void 0:r_.connection)==null?void 0:c_.wifi)!=null?__:"WiFi")+"")&&C($o,Vs),(!Ye||_e[0]&2)&&Ks!==(Ks=((d_=(p_=(m_=W[1].conf)==null?void 0:m_.connection)==null?void 0:p_.ap)!=null?d_:"AP")+"")&&C(xo,Ks),W[0].if&&W[0].if.eth?Ll?Ll.p(W,_e):(Ll=R2(W),Ll.c(),Ll.m(tn,null)):Ll&&(Ll.d(1),Ll=null),_e[0]&16&&Ze(tn,W[4].n.c),W[4].n.c==1||W[4].n.c==2?Rl?Rl.p(W,_e):(Rl=F2(W),Rl.c(),Rl.m(Vl,null)):Rl&&(Rl.d(1),Rl=null),(!Ye||_e[0]&2)&&Qs!==(Qs=((b_=(h_=(v_=W[1].conf)==null?void 0:v_.network)==null?void 0:h_.title)!=null?b_:"Network")+"")&&C(ea,Qs),(!Ye||_e[0]&2)&&Xs!==(Xs=((w_=(k_=(g_=W[1].conf)==null?void 0:g_.network)==null?void 0:k_.ip)!=null?w_:"IP")+"")&&C(ta,Xs),(!Ye||_e[0]&2)&&Zs!==(Zs=((C_=(S_=(M_=W[1].conf)==null?void 0:M_.network)==null?void 0:S_.dhcp)!=null?C_:"DHCP")+"")&&C(la,Zs),(!Ye||_e[0]&2)&&Js!==(Js=((P_=(T_=(N_=W[1].conf)==null?void 0:N_.network)==null?void 0:T_.static)!=null?P_:"Static")+"")&&C(na,Js),_e[0]&16&&Ze(wn,W[4].n.m),(!Ye||_e[0]&16&&$s!==($s=W[4].n.m=="dhcp"))&&(Kl.disabled=$s),(!Ye||_e[0]&16&&xs!==(xs=W[4].n.m=="static"))&&(Kl.required=xs),_e[0]&16&&Kl.value!==W[4].n.i&&be(Kl,W[4].n.i),(!Ye||_e[0]&16&&eo!==(eo=W[4].n.m=="dhcp"))&&(Yl.disabled=eo),(!Ye||_e[0]&16&&to!==(to=W[4].n.m=="static"))&&(Yl.required=to),_e[0]&16&&Ze(Yl,W[4].n.s),W[4].n.m=="static"?Fl?Fl.p(W,_e):(Fl=B2(W),Fl.c(),Fl.m(il,ia)):Fl&&(Fl.d(1),Fl=null),_e[0]&16&&(sn.checked=W[4].n.x),_e[0]&16&&(on.checked=W[4].n.d),(!Ye||_e[0]&2)&&so!==(so=((D_=(A_=(E_=W[1].conf)==null?void 0:E_.network)==null?void 0:A_.tick_mdns)!=null?D_:"mDNS")+"")&&C(sa,so),(!Ye||_e[0]&2)&&oo!==(oo=((I_=(O_=(q_=W[1].conf)==null?void 0:q_.network)==null?void 0:O_.ntp)!=null?I_:"NTP")+"")&&C(oa,oo),_e[0]&16&&(an.checked=W[4].n.h),(!Ye||_e[0]&2)&&ao!==(ao=((F_=(R_=(L_=W[1].conf)==null?void 0:L_.network)==null?void 0:R_.tick_ntp_dhcp)!=null?F_:"from DHCP")+"")&&C(aa,ao),_e[0]&16&&Rn.value!==W[4].n.n1&&be(Rn,W[4].n.n1),(!Ye||_e[0]&2)&&ro!==(ro=((j_=(U_=(B_=W[1].conf)==null?void 0:B_.mqtt)==null?void 0:U_.title)!=null?j_:"MQTT")+"")&&C(fa,ro),(!Ye||_e[0]&2)&&co!==(co=((z_=(y_=(H_=W[1].conf)==null?void 0:H_.mqtt)==null?void 0:y_.server)!=null?z_:"Server")+"")&&C(ua,co),W[0].chip!="esp8266"?Bl?Bl.p(W,_e):(Bl=U2(W),Bl.c(),Bl.m(fn,ra)):Bl&&(Bl.d(1),Bl=null),_e[0]&16&&Fn.value!==W[4].q.h&&be(Fn,W[4].q.h),_e[0]&16&&Xe(un.value)!==W[4].q.p&&be(un,W[4].q.p),W[4].q.s.e?sl?(sl.p(W,_e),_e[0]&16&&Q(sl,1)):(sl=j2(W),sl.c(),Q(sl,1),sl.m($t,ca)):sl&&(pt(),ee(sl,1,1,()=>{sl=null}),dt()),(!Ye||_e[0]&2)&&_o!==(_o=((V_=(G_=(W_=W[1].conf)==null?void 0:W_.mqtt)==null?void 0:G_.user)!=null?V_:"Username")+"")&&C(_a,_o),_e[0]&16&&Bn.value!==W[4].q.u&&be(Bn,W[4].q.u),(!Ye||_e[0]&2)&&mo!==(mo=((Q_=(Y_=(K_=W[1].conf)==null?void 0:K_.mqtt)==null?void 0:Y_.pass)!=null?Q_:"Password")+"")&&C(ma,mo),_e[0]&16&&Un.value!==W[4].q.a&&be(Un,W[4].q.a),(!Ye||_e[0]&2)&&po!==(po=((J_=(Z_=(X_=W[1].conf)==null?void 0:X_.mqtt)==null?void 0:Z_.id)!=null?J_:"Client ID")+"")&&C(pa,po),_e[0]&16&&jn.value!==W[4].q.c&&be(jn,W[4].q.c),(!Ye||_e[0]&2)&&vo!==(vo=((em=(x_=($_=W[1].conf)==null?void 0:$_.mqtt)==null?void 0:x_.payload)!=null?em:"Payload")+"")&&C(da,vo),(!Ye||_e[0]&2)&&ho!==(ho=((im=(nm=(lm=(tm=W[1].conf)==null?void 0:tm.mqtt)==null?void 0:lm.domoticz)==null?void 0:nm.title)!=null?im:"Domoticz")+"")&&C(va,ho),(!Ye||_e[0]&2)&&bo!==(bo=((fm=(am=(om=(sm=W[1].conf)==null?void 0:sm.mqtt)==null?void 0:om.ha)==null?void 0:am.title)!=null?fm:"Home-Assistant")+"")&&C(ha,bo),_e[0]&16&&Ze(pl,W[4].q.m),(!Ye||_e[0]&2)&&go!==(go=((cm=(rm=(um=W[1].conf)==null?void 0:um.mqtt)==null?void 0:rm.publish)!=null?cm:"Publish topic")+"")&&C(ba,go),_e[0]&16&&Hn.value!==W[4].q.b&&be(Hn,W[4].q.b),W[4].q.m==3?Ul?Ul.p(W,_e):(Ul=H2(W),Ul.c(),Ul.m(l,ga)):Ul&&(Ul.d(1),Ul=null),W[4].q.m==4?jl?jl.p(W,_e):(jl=y2(W),jl.c(),jl.m(l,ka)):jl&&(jl.d(1),jl=null),W[4].c.es!=null?ol?(ol.p(W,_e),_e[0]&16&&Q(ol,1)):(ol=z2(W),ol.c(),Q(ol,1),ol.m(l,wa)):ol&&(pt(),ee(ol,1,1,()=>{ol=null}),dt()),_e[0]&16&&(Ma=W[4].p.r.startsWith("NO")||W[4].p.r.startsWith("10YNO")||W[4].p.r.startsWith("10Y1001A1001A4")),Ma?Hl?Hl.p(W,_e):(Hl=V2(W),Hl.c(),Hl.m(l,Sa)):Hl&&(Hl.d(1),Hl=null),(!Ye||_e[0]&2)&&wo!==(wo=((pm=(mm=(_m=W[1].conf)==null?void 0:_m.ui)==null?void 0:mm.title)!=null?pm:"User interface")+"")&&C(Ca,wo),_e[0]&530){Ji=W[9];let Wt;for(Wt=0;Wt20||W[0].chip=="esp8266"||W[4].i.d.d>0?al?(al.p(W,_e),_e[0]&17&&Q(al,1)):(al=X2(W),al.c(),Q(al,1),al.m(l,Pa)):al&&(pt(),ee(al,1,1,()=>{al=null}),dt()),(!Ye||_e[0]&2)&&Co!==(Co=((km=(gm=(bm=W[1].conf)==null?void 0:bm.debug)==null?void 0:gm.title)!=null?km:"Debugging")+"")&&C(Ea,Co),_e[0]&16&&(cn.checked=W[4].d.s),(!Ye||_e[0]&2)&&To!==(To=((Sm=(Mm=(wm=W[1].conf)==null?void 0:wm.debug)==null?void 0:Mm.enable)!=null?Sm:"Enable debugging")+"")&&C(Aa,To),W[4].d.s?yl?yl.p(W,_e):(yl=ld(W),yl.c(),yl.m(Ql,null)):yl&&(yl.d(1),yl=null),(!Ye||_e[0]&2)&&Po!==(Po=((Nm=(Cm=W[1].conf)==null?void 0:Cm.btn_reset)!=null?Nm:"Factory reset")+"")&&C(qa,Po),(!Ye||_e[0]&2)&&Ao!==(Ao=((Pm=(Tm=W[1].btn)==null?void 0:Tm.reboot)!=null?Pm:"Reboot")+"")&&C(Oa,Ao),(!Ye||_e[0]&2)&&qo!==(qo=((Am=(Em=W[1].btn)==null?void 0:Em.save)!=null?Am:"Save")+"")&&C(Ia,qo);const bl={};_e[0]&4&&(bl.active=W[2]),_e[0]&2&&(bl.message=(Om=(qm=(Dm=W[1].conf)==null?void 0:Dm.mask)==null?void 0:qm.loading)!=null?Om:"Loading"),ri.$set(bl);const ja={};_e[0]&8&&(ja.active=W[3]),_e[0]&2&&(ja.message=(Rm=(Lm=(Im=W[1].conf)==null?void 0:Im.mask)==null?void 0:Lm.saving)!=null?Rm:"Saving"),ci.$set(ja);const Ha={};_e[0]&64&&(Ha.active=W[6]),_e[0]&2&&(Ha.message=(Um=(Bm=(Fm=W[1].conf)==null?void 0:Fm.mask)==null?void 0:Bm.reset)!=null?Um:"Factory reset"),_i.$set(Ha);const ya={};_e[0]&128&&(ya.active=W[7]),_e[0]&2&&(ya.message=(ym=(Hm=(jm=W[1].conf)==null?void 0:jm.mask)==null?void 0:Hm.reset_done)!=null?ym:"Done"),mi.$set(ya)},i(W){Ye||(Q(R.$$.fragment,W),Q(lt.$$.fragment,W),Q(qi.$$.fragment,W),Q(sl),Q(ol),Q(al),Q(ri.$$.fragment,W),Q(ci.$$.fragment,W),Q(_i.$$.fragment,W),Q(mi.$$.fragment,W),Ye=!0)},o(W){ee(R.$$.fragment,W),ee(lt.$$.fragment,W),ee(qi.$$.fragment,W),ee(sl),ee(ol),ee(al),ee(ri.$$.fragment,W),ee(ci.$$.fragment,W),ee(_i.$$.fragment,W),ee(mi.$$.fragment,W),Ye=!1},d(W){W&&T(t),Ce(R),Xl&&Xl.d(),Xt(Ps,W),Ce(lt),Al&&Al.d(),Dl&&Dl.d(),Sn.d(),ql&&ql.d(),Ol&&Ol.d(),Il&&Il.d(),Ll&&Ll.d(),Rl&&Rl.d(),Ce(qi),Fl&&Fl.d(),Bl&&Bl.d(),sl&&sl.d(),Ul&&Ul.d(),jl&&jl.d(),ol&&ol.d(),Hl&&Hl.d(),Xt(vl,W),Xt(hl,W),al&&al.d(),yl&&yl.d(),W&&T(La),Ce(ri,W),W&&T(Ra),Ce(ci,W),W&&T(Fa),Ce(_i,W),W&&T(Ba),Ce(mi,W),Ua=!1,Et(yu)}}}async function kg(){await(await fetch("reboot",{method:"POST"})).json()}function wg(e,t,l){let{basepath:n="/"}=t,{sysinfo:i={}}=t,o={};Ml.subscribe(Ke=>{l(1,o=Ke)});let f=[{name:"Import gauge",key:"i"},{name:"Export gauge",key:"e"},{name:"Voltage",key:"v"},{name:"Amperage",key:"a"},{name:"Per phase",key:"h"},{name:"Power factor",key:"f"},{name:"Reactive",key:"r"},{name:"Realtime",key:"c"},{name:"Peaks",key:"t"},{name:"Realtime plot",key:"l"},{name:"Price",key:"p"},{name:"Day plot",key:"d"},{name:"Month plot",key:"m"},{name:"Temperature plot",key:"s"},{name:"Dark mode",key:"k"}],r=!0,c=!1,a={g:{t:"",h:"",s:0,u:"",p:""},m:{b:2400,p:11,i:!1,d:0,f:0,r:0,e:{e:!1,k:"",a:""},m:{e:!1,w:!1,v:!1,a:!1,c:!1}},w:{s:"",p:"",w:0,z:255,a:!0,b:!0},n:{m:"",i:"",s:"",g:"",d1:"",d2:"",d:!1,n1:"",n2:"",h:!1,x:!1},q:{h:"",p:1883,u:"",a:"",b:"",s:{e:!1,c:!1,r:!0,k:!1}},o:{e:"",c:"",u1:"",u2:"",u3:""},t:{t:[0,0,0,0,0,0,0,0,0,0],h:1},p:{e:!1,t:"",r:"",c:"",m:1,f:null},d:{s:!1,t:!1,l:5},u:{i:0,e:0,v:0,a:0,r:0,c:0,t:0,p:0,d:0,m:0,s:0,lang:"en"},i:{h:{p:null,u:!0},a:null,l:{p:null,i:!1},r:{r:null,g:null,b:null,i:!1},d:{d:null,b:0},t:{d:null,a:null},v:{p:null,d:{v:null,g:null},o:null,m:null,b:null}},h:{t:"",h:"",n:""},c:{e:!1,i:null,es:null}},_=[];qs.subscribe(Ke=>{var ne,Ue;Ke.version&&(l(4,a=Ke),l(2,r=!1),l(5,_=[{code:"en",name:"English"}]),a.u.lang&&a.u.lang!="en"&&_.push({code:a.u.lang,name:(Ue=(ne=o.language)==null?void 0:ne.name)!=null?Ue:"Unknown"}),_.push({code:"hub",name:"Load from server"}))}),B4();let p=!1,v=!1;async function d(){if(confirm("Factory reset?")){l(6,p=!0);const Ke=new URLSearchParams;Ke.append("perform","true");let Ue=await(await fetch("reset",{method:"POST",body:Ke})).json();l(6,p=!1),l(7,v=Ue.success)}}async function h(Ke){l(3,c=!0);const ne=new FormData(Ke.target),Ue=new URLSearchParams;for(let ut of ne){const[Yt,ll]=ut;Ue.append(Yt,ll)}let St=await(await fetch("save",{method:"POST",body:Ue})).json();wl.update(ut=>(ut.hostname=ne.get("gh"),ut.usrcfg=St.success,ut.booting=St.reboot,ne.get("nm")=="static"&&(ut.net.ip=ne.get("ni"),ut.net.mask=ne.get("nu"),ut.net.gw=ne.get("ng"),ut.net.dns1=ne.get("nd")),ut.ui=a.u,ut)),l(3,c=!1),gi(n)}const g=function(){confirm("Reboot?")&&(wl.update(Ke=>(Ke.booting=!0,Ke)),kg())};async function M(){confirm("Are you sure you want to delete CA?")&&(await(await fetch("mqtt-ca",{method:"POST"})).text(),qs.update(ne=>(ne.q.s.c=!1,ne)))}async function A(){confirm("Are you sure you want to delete cert?")&&(await(await fetch("mqtt-cert",{method:"POST"})).text(),qs.update(ne=>(ne.q.s.r=!1,ne)))}async function I(){confirm("Are you sure you want to delete key?")&&(await(await fetch("mqtt-key",{method:"POST"})).text(),qs.update(ne=>(ne.q.s.k=!1,ne)))}const O=function(){a.q.s.e?a.q.p==1883&&l(4,a.q.p=8883,a):a.q.p==8883&&l(4,a.q.p=1883,a)};async function L(){if(a.u.lang=="hub"){const Ke=await dn("http://hub.amsleser.no/hub/language/list.json");l(5,_=await Ke.json()),l(4,a.u.lang=o.language.code,a)}}let q=44;function U(){a.g.h=this.value,l(4,a)}function E(){a.g.t=Ft(this),l(4,a)}function F(){a.p.r=Ft(this),l(4,a)}function z(){a.p.c=Ft(this),l(4,a)}function G(){a.p.e=this.checked,l(4,a)}function B(){a.p.t=this.value,l(4,a)}function R(){a.g.s=Ft(this),l(4,a)}function K(){a.g.u=this.value,l(4,a)}function y(){a.g.p=this.value,l(4,a)}function H(){a.g.c=this.value,l(4,a)}function Y(){a.m.a=Ft(this),l(4,a)}function X(){a.m.b=Xe(this.value),l(4,a)}function J(){a.m.i=this.checked,l(4,a)}function $(){a.m.b=Ft(this),l(4,a)}function ce(){a.m.p=Ft(this),l(4,a)}function ie(){a.m.s=Xe(this.value),l(4,a)}function oe(){a.m.d=Ft(this),l(4,a)}function ae(){a.m.f=Xe(this.value),l(4,a)}function se(){a.m.r=Xe(this.value),l(4,a)}function x(){a.m.e.e=this.checked,l(4,a)}function me(){a.m.e.k=this.value,l(4,a)}function pe(){a.m.e.a=this.value,l(4,a)}function V(){a.m.m.e=this.checked,l(4,a)}function Z(){a.m.m.w=Xe(this.value),l(4,a)}function ge(){a.m.m.v=Xe(this.value),l(4,a)}function ve(){a.m.m.a=Xe(this.value),l(4,a)}function S(){a.m.m.c=Xe(this.value),l(4,a)}function w(){a.n.c=Ft(this),l(4,a)}function N(){a.w.s=this.value,l(4,a)}function D(){a.w.p=this.value,l(4,a)}function j(){a.w.z=Ft(this),l(4,a)}function te(){a.w.w=Xe(this.value),l(4,a)}function le(){a.w.b=this.checked,l(4,a)}function fe(){a.n.m=Ft(this),l(4,a)}function de(){a.n.i=this.value,l(4,a)}function qe(){a.n.s=Ft(this),l(4,a)}function Pe(){a.n.g=this.value,l(4,a)}function we(){a.n.d1=this.value,l(4,a)}function Fe(){a.n.d2=this.value,l(4,a)}function Ae(){a.n.x=this.checked,l(4,a)}function ke(){a.n.d=this.checked,l(4,a)}function De(){a.n.h=this.checked,l(4,a)}function He(){a.n.n1=this.value,l(4,a)}function Oe(){a.q.s.e=this.checked,l(4,a)}function je(){a.q.h=this.value,l(4,a)}function Qe(){a.q.p=Xe(this.value),l(4,a)}function We(){a.q.u=this.value,l(4,a)}function Je(){a.q.a=this.value,l(4,a)}function $e(){a.q.c=this.value,l(4,a)}function tt(){a.q.m=Ft(this),l(4,a)}function Te(){a.q.b=this.value,l(4,a)}function ue(){a.o.e=this.value,l(4,a)}function Ie(){a.o.c=this.value,l(4,a)}function kt(){a.o.u1=this.value,l(4,a)}function lt(){a.o.u2=this.value,l(4,a)}function wt(){a.o.u3=this.value,l(4,a)}function st(){a.h.t=this.value,l(4,a)}function ot(){a.h.h=this.value,l(4,a)}function xe(){a.h.n=this.value,l(4,a)}function Nt(){a.c.e=this.checked,l(4,a)}function gt(){a.c.es=this.checked,l(4,a)}function At(Ke){a.t.t[Ke]=Xe(this.value),l(4,a)}function Pt(){a.t.h=Xe(this.value),l(4,a)}function Be(Ke){a.u[Ke.key]=Ft(this),l(4,a)}function ye(){a.u.lang=Ft(this),l(4,a)}function It(){a.i.h.p=Ft(this),l(4,a)}function vt(){a.i.h.t=Ft(this),l(4,a)}function nt(){a.i.h.u=this.checked,l(4,a)}function Tt(){a.i.a=Xe(this.value),l(4,a)}function it(){a.i.l.p=Xe(this.value),l(4,a)}function at(){a.i.l.i=this.checked,l(4,a)}function rt(){a.i.r.i=this.checked,l(4,a)}function jt(){a.i.r.r=Xe(this.value),l(4,a)}function Lt(){a.i.r.g=Xe(this.value),l(4,a)}function Ht(){a.i.r.b=Xe(this.value),l(4,a)}function yt(){a.i.d.d=Xe(this.value),l(4,a)}function Me(){a.i.t.d=Xe(this.value),l(4,a)}function Ve(){a.i.t.a=Xe(this.value),l(4,a)}function Rt(){a.i.v.p=Xe(this.value),l(4,a)}function Gt(){a.i.v.d.v=Xe(this.value),l(4,a)}function zt(){a.i.v.d.g=Xe(this.value),l(4,a)}function Dt(){a.i.d.b=Ft(this),l(4,a)}function Kt(){a.i.v.o=Xe(this.value),l(4,a)}function Zt(){a.i.v.m=Xe(this.value),l(4,a)}function tl(){a.i.v.b=Xe(this.value),l(4,a)}function Jt(){a.d.s=this.checked,l(4,a)}function ft(){a.d.t=this.checked,l(4,a)}function Mt(){a.d.l=Ft(this),l(4,a)}return e.$$set=Ke=>{"basepath"in Ke&&l(18,n=Ke.basepath),"sysinfo"in Ke&&l(0,i=Ke.sysinfo)},e.$$.update=()=>{e.$$.dirty[0]&1&&l(8,q=i.chip=="esp8266"?16:i.chip=="esp32s2"?44:39)},[i,o,r,c,a,_,p,v,q,f,d,h,g,M,A,I,O,L,n,U,E,F,z,G,B,R,K,y,H,Y,X,J,$,ce,ie,oe,ae,se,x,me,pe,V,Z,ge,ve,S,w,N,D,j,te,le,fe,de,qe,Pe,we,Fe,Ae,ke,De,He,Oe,je,Qe,We,Je,$e,tt,Te,ue,Ie,kt,lt,wt,st,ot,xe,Nt,gt,At,Pt,Be,ye,It,vt,nt,Tt,it,at,rt,jt,Lt,Ht,yt,Me,Ve,Rt,Gt,zt,Dt,Kt,Zt,tl,Jt,ft,Mt]}class Mg extends mt{constructor(t){super(),_t(this,t,wg,gg,ct,{basepath:18,sysinfo:0},null,[-1,-1,-1,-1])}}function id(e,t,l){const n=e.slice();return n[22]=t[l],n}function Sg(e){let t=Ge(e[1].chip,e[1].board)+"",l;return{c(){l=k(t)},m(n,i){P(n,l,i)},p(n,i){i&2&&t!==(t=Ge(n[1].chip,n[1].board)+"")&&C(l,t)},d(n){n&&T(l)}}}function sd(e){var Y,X,J,$,ce,ie,oe,ae,se,x,me,pe;let t,l=((J=(X=(Y=e[3].status)==null?void 0:Y.device)==null?void 0:X.apmac)!=null?J:"AP MAC")+"",n,i,o=e[1].apmac+"",f,r,c,a=((ie=(ce=($=e[3].status)==null?void 0:$.device)==null?void 0:ce.last_boot)!=null?ie:"Last boot")+"",_,p,v,d,h,g,M=((se=(ae=(oe=e[3].status)==null?void 0:oe.device)==null?void 0:ae.reason)!=null?se:"Reason")+"",A,I,O=((pe=(me=(x=e[3][np(e[1].chip)])==null?void 0:x.reason)==null?void 0:me[e[1].boot_reason])!=null?pe:e[1].boot_reason)+"",L,q,U=e[1].boot_reason+"",E,F,z=e[1].ex_cause+"",G,B,R;const K=[Ng,Cg],y=[];function H(V,Z){return V[0].u>0?0:1}return v=H(e),d=y[v]=K[v](e),{c(){t=m("div"),n=k(l),i=k(": "),f=k(o),r=b(),c=m("div"),_=k(a),p=k(`: - `),d.c(),h=b(),g=m("div"),A=k(M),I=k(": "),L=k(O),q=k(" ("),E=k(U),F=k("/"),G=k(z),B=k(")"),u(t,"class","my-2"),u(c,"class","my-2"),u(g,"class","my-2")},m(V,Z){P(V,t,Z),s(t,n),s(t,i),s(t,f),P(V,r,Z),P(V,c,Z),s(c,_),s(c,p),y[v].m(c,null),P(V,h,Z),P(V,g,Z),s(g,A),s(g,I),s(g,L),s(g,q),s(g,E),s(g,F),s(g,G),s(g,B),R=!0},p(V,Z){var ve,S,w,N,D,j,te,le,fe,de,qe,Pe;(!R||Z&8)&&l!==(l=((w=(S=(ve=V[3].status)==null?void 0:ve.device)==null?void 0:S.apmac)!=null?w:"AP MAC")+"")&&C(n,l),(!R||Z&2)&&o!==(o=V[1].apmac+"")&&C(f,o),(!R||Z&8)&&a!==(a=((j=(D=(N=V[3].status)==null?void 0:N.device)==null?void 0:D.last_boot)!=null?j:"Last boot")+"")&&C(_,a);let ge=v;v=H(V),v===ge?y[v].p(V,Z):(pt(),ee(y[ge],1,1,()=>{y[ge]=null}),dt(),d=y[v],d?d.p(V,Z):(d=y[v]=K[v](V),d.c()),Q(d,1),d.m(c,null)),(!R||Z&8)&&M!==(M=((fe=(le=(te=V[3].status)==null?void 0:te.device)==null?void 0:le.reason)!=null?fe:"Reason")+"")&&C(A,M),(!R||Z&10)&&O!==(O=((Pe=(qe=(de=V[3][np(V[1].chip)])==null?void 0:de.reason)==null?void 0:qe[V[1].boot_reason])!=null?Pe:V[1].boot_reason)+"")&&C(L,O),(!R||Z&2)&&U!==(U=V[1].boot_reason+"")&&C(E,U),(!R||Z&2)&&z!==(z=V[1].ex_cause+"")&&C(G,z)},i(V){R||(Q(d),R=!0)},o(V){ee(d),R=!1},d(V){V&&T(t),V&&T(r),V&&T(c),y[v].d(),V&&T(h),V&&T(g)}}}function Cg(e){let t;return{c(){t=k("-")},m(l,n){P(l,t,n)},p:ze,i:ze,o:ze,d(l){l&&T(t)}}}function Ng(e){let t,l;return t=new yv({props:{timestamp:new Date(new Date().getTime()-e[0].u*1e3),fullTimeColor:""}}),{c(){Ne(t.$$.fragment)},m(n,i){Se(t,n,i),l=!0},p(n,i){const o={};i&1&&(o.timestamp=new Date(new Date().getTime()-n[0].u*1e3)),t.$set(o)},i(n){l||(Q(t.$$.fragment,n),l=!0)},o(n){ee(t.$$.fragment,n),l=!1},d(n){Ce(t,n)}}}function Tg(e){var i,o,f;let t,l=((f=(o=(i=e[3].status)==null?void 0:i.device)==null?void 0:o.btn_consents)!=null?f:"Consents")+"",n;return{c(){t=m("span"),n=k(l),u(t,"class","btn-pri-sm")},m(r,c){P(r,t,c),s(t,n)},p(r,c){var a,_,p;c&8&&l!==(l=((p=(_=(a=r[3].status)==null?void 0:a.device)==null?void 0:_.btn_consents)!=null?p:"Consents")+"")&&C(n,l)},d(r){r&&T(t)}}}function od(e){var G,B,R,K,y,H,Y,X,J,$,ce,ie;let t,l,n=((R=(B=(G=e[3].status)==null?void 0:G.meter)==null?void 0:B.title)!=null?R:"Meter")+"",i,o,f,r=((H=(y=(K=e[3].status)==null?void 0:K.meter)==null?void 0:y.manufacturer)!=null?H:"Manufacturer")+"",c,a,_=Ko(e[1].meter.mfg)+"",p,v,d,h=((J=(X=(Y=e[3].status)==null?void 0:Y.meter)==null?void 0:X.model)!=null?J:"Model")+"",g,M,A=(e[1].meter.model?e[1].meter.model:"unknown")+"",I,O,L,q=((ie=(ce=($=e[3].status)==null?void 0:$.meter)==null?void 0:ce.id)!=null?ie:"ID")+"",U,E,F=(e[1].meter.id?e[1].meter.id:"unknown")+"",z;return{c(){t=m("div"),l=m("strong"),i=k(n),o=b(),f=m("div"),c=k(r),a=k(": "),p=k(_),v=b(),d=m("div"),g=k(h),M=k(": "),I=k(A),O=b(),L=m("div"),U=k(q),E=k(": "),z=k(F),u(l,"class","text-sm"),u(f,"class","my-2"),u(d,"class","my-2"),u(L,"class","my-2"),u(t,"class","cnt")},m(oe,ae){P(oe,t,ae),s(t,l),s(l,i),s(t,o),s(t,f),s(f,c),s(f,a),s(f,p),s(t,v),s(t,d),s(d,g),s(d,M),s(d,I),s(t,O),s(t,L),s(L,U),s(L,E),s(L,z)},p(oe,ae){var se,x,me,pe,V,Z,ge,ve,S,w,N,D;ae&8&&n!==(n=((me=(x=(se=oe[3].status)==null?void 0:se.meter)==null?void 0:x.title)!=null?me:"Meter")+"")&&C(i,n),ae&8&&r!==(r=((Z=(V=(pe=oe[3].status)==null?void 0:pe.meter)==null?void 0:V.manufacturer)!=null?Z:"Manufacturer")+"")&&C(c,r),ae&2&&_!==(_=Ko(oe[1].meter.mfg)+"")&&C(p,_),ae&8&&h!==(h=((S=(ve=(ge=oe[3].status)==null?void 0:ge.meter)==null?void 0:ve.model)!=null?S:"Model")+"")&&C(g,h),ae&2&&A!==(A=(oe[1].meter.model?oe[1].meter.model:"unknown")+"")&&C(I,A),ae&8&&q!==(q=((D=(N=(w=oe[3].status)==null?void 0:w.meter)==null?void 0:N.id)!=null?D:"ID")+"")&&C(U,q),ae&2&&F!==(F=(oe[1].meter.id?oe[1].meter.id:"unknown")+"")&&C(z,F)},d(oe){oe&&T(t)}}}function ad(e){var X,J,$,ce,ie,oe,ae,se,x,me,pe,V;let t,l,n=(($=(J=(X=e[3].status)==null?void 0:X.network)==null?void 0:J.title)!=null?$:"Network")+"",i,o,f,r=((oe=(ie=(ce=e[3].conf)==null?void 0:ce.network)==null?void 0:ie.ip)!=null?oe:"IP")+"",c,a,_=e[1].net.ip+"",p,v,d,h=((x=(se=(ae=e[3].conf)==null?void 0:ae.network)==null?void 0:se.mask)!=null?x:"Mask")+"",g,M,A=e[1].net.mask+"",I,O,L,q=((V=(pe=(me=e[3].conf)==null?void 0:me.network)==null?void 0:pe.gw)!=null?V:"Gateway")+"",U,E,F=e[1].net.gw+"",z,G,B,R,K,y=e[1].net.dns1&&fd(e),H=e[1].net.dns2&&ud(e),Y=e[1].net.ipv6&&rd(e);return{c(){t=m("div"),l=m("strong"),i=k(n),o=b(),f=m("div"),c=k(r),a=k(": "),p=k(_),v=b(),d=m("div"),g=k(h),M=k(": "),I=k(A),O=b(),L=m("div"),U=k(q),E=k(": "),z=k(F),G=b(),B=m("div"),y&&y.c(),R=b(),H&&H.c(),K=b(),Y&&Y.c(),u(l,"class","text-sm"),u(f,"class","my-2"),u(d,"class","my-2"),u(L,"class","my-2"),u(B,"class","my-2"),u(t,"class","cnt")},m(Z,ge){P(Z,t,ge),s(t,l),s(l,i),s(t,o),s(t,f),s(f,c),s(f,a),s(f,p),s(t,v),s(t,d),s(d,g),s(d,M),s(d,I),s(t,O),s(t,L),s(L,U),s(L,E),s(L,z),s(t,G),s(t,B),y&&y.m(B,null),s(B,R),H&&H.m(B,null),s(t,K),Y&&Y.m(t,null)},p(Z,ge){var ve,S,w,N,D,j,te,le,fe,de,qe,Pe;ge&8&&n!==(n=((w=(S=(ve=Z[3].status)==null?void 0:ve.network)==null?void 0:S.title)!=null?w:"Network")+"")&&C(i,n),ge&8&&r!==(r=((j=(D=(N=Z[3].conf)==null?void 0:N.network)==null?void 0:D.ip)!=null?j:"IP")+"")&&C(c,r),ge&2&&_!==(_=Z[1].net.ip+"")&&C(p,_),ge&8&&h!==(h=((fe=(le=(te=Z[3].conf)==null?void 0:te.network)==null?void 0:le.mask)!=null?fe:"Mask")+"")&&C(g,h),ge&2&&A!==(A=Z[1].net.mask+"")&&C(I,A),ge&8&&q!==(q=((Pe=(qe=(de=Z[3].conf)==null?void 0:de.network)==null?void 0:qe.gw)!=null?Pe:"Gateway")+"")&&C(U,q),ge&2&&F!==(F=Z[1].net.gw+"")&&C(z,F),Z[1].net.dns1?y?y.p(Z,ge):(y=fd(Z),y.c(),y.m(B,R)):y&&(y.d(1),y=null),Z[1].net.dns2?H?H.p(Z,ge):(H=ud(Z),H.c(),H.m(B,null)):H&&(H.d(1),H=null),Z[1].net.ipv6?Y?Y.p(Z,ge):(Y=rd(Z),Y.c(),Y.m(t,null)):Y&&(Y.d(1),Y=null)},d(Z){Z&&T(t),y&&y.d(),H&&H.d(),Y&&Y.d()}}}function fd(e){var f,r,c;let t=((c=(r=(f=e[3].conf)==null?void 0:f.network)==null?void 0:r.dns)!=null?c:"DNS")+"",l,n,i=e[1].net.dns1+"",o;return{c(){l=k(t),n=k(": "),o=k(i)},m(a,_){P(a,l,_),P(a,n,_),P(a,o,_)},p(a,_){var p,v,d;_&8&&t!==(t=((d=(v=(p=a[3].conf)==null?void 0:p.network)==null?void 0:v.dns)!=null?d:"DNS")+"")&&C(l,t),_&2&&i!==(i=a[1].net.dns1+"")&&C(o,i)},d(a){a&&T(l),a&&T(n),a&&T(o)}}}function ud(e){var f,r,c;let t=((c=(r=(f=e[3].conf)==null?void 0:f.network)==null?void 0:r.dns)!=null?c:"DNS")+"",l,n,i=e[1].net.dns2+"",o;return{c(){l=k(t),n=k(": "),o=k(i)},m(a,_){P(a,l,_),P(a,n,_),P(a,o,_)},p(a,_){var p,v,d;_&8&&t!==(t=((d=(v=(p=a[3].conf)==null?void 0:p.network)==null?void 0:v.dns)!=null?d:"DNS")+"")&&C(l,t),_&2&&i!==(i=a[1].net.dns2+"")&&C(o,i)},d(a){a&&T(l),a&&T(n),a&&T(o)}}}function rd(e){let t,l,n=e[1].net.ipv6+"",i,o,f,r,c=e[1].net.dns1v6&&cd(e),a=e[1].net.dns2v6&&_d(e);return{c(){t=m("div"),l=k("IPv6: "),i=k(n),o=b(),f=m("div"),c&&c.c(),r=b(),a&&a.c(),u(t,"class","my-2"),u(f,"class","my-2")},m(_,p){P(_,t,p),s(t,l),s(t,i),P(_,o,p),P(_,f,p),c&&c.m(f,null),s(f,r),a&&a.m(f,null)},p(_,p){p&2&&n!==(n=_[1].net.ipv6+"")&&C(i,n),_[1].net.dns1v6?c?c.p(_,p):(c=cd(_),c.c(),c.m(f,r)):c&&(c.d(1),c=null),_[1].net.dns2v6?a?a.p(_,p):(a=_d(_),a.c(),a.m(f,null)):a&&(a.d(1),a=null)},d(_){_&&T(t),_&&T(o),_&&T(f),c&&c.d(),a&&a.d()}}}function cd(e){let t,l=e[1].net.dns1v6+"",n;return{c(){t=k("DNSv6: "),n=k(l)},m(i,o){P(i,t,o),P(i,n,o)},p(i,o){o&2&&l!==(l=i[1].net.dns1v6+"")&&C(n,l)},d(i){i&&T(t),i&&T(n)}}}function _d(e){let t,l=e[1].net.dns2v6+"",n;return{c(){t=k("DNSv6: "),n=k(l)},m(i,o){P(i,t,o),P(i,n,o)},p(i,o){o&2&&l!==(l=i[1].net.dns2v6+"")&&C(n,l)},d(i){i&&T(t),i&&T(n)}}}function md(e){var c,a,_,p,v,d;let t,l,n=((_=(a=(c=e[3].status)==null?void 0:c.firmware)==null?void 0:a.failed)!=null?_:"Upgrade from {0} to {1} failed").replace("{0}",e[1].upgrade.f).replace("{1}",e[1].upgrade.t)+"",i,o,f=((d=(v=(p=e[3].errors)==null?void 0:p.http)==null?void 0:v[e[1].upgrade.e])!=null?d:e[1].upgrade.e)+"",r;return{c(){t=m("div"),l=m("div"),i=k(n),o=b(),r=k(f),u(l,"class","bd-yellow"),u(t,"class","my-2")},m(h,g){P(h,t,g),s(t,l),s(l,i),s(l,o),s(l,r)},p(h,g){var M,A,I,O,L,q;g&10&&n!==(n=((I=(A=(M=h[3].status)==null?void 0:M.firmware)==null?void 0:A.failed)!=null?I:"Upgrade from {0} to {1} failed").replace("{0}",h[1].upgrade.f).replace("{1}",h[1].upgrade.t)+"")&&C(i,n),g&10&&f!==(f=((q=(L=(O=h[3].errors)==null?void 0:O.http)==null?void 0:L[h[1].upgrade.e])!=null?q:h[1].upgrade.e)+"")&&C(r,f)},d(h){h&&T(t)}}}function pd(e){var h,g,M;let t,l=((M=(g=(h=e[3].status)==null?void 0:h.firmware)==null?void 0:g.latest)!=null?M:"Latest")+"",n,i,o,f=e[4].tag_name+"",r,c,a,_,p,v=(e[1].security==0||e[0].a)&&e[1].fwconsent===1&&e[4]&&e[4].tag_name!=e[1].version&&dd(e),d=e[1].fwconsent===2&&vd(e);return{c(){t=m("div"),n=k(l),i=k(`: - `),o=m("a"),r=k(f),a=b(),v&&v.c(),_=b(),d&&d.c(),p=Ut(),u(o,"href",c=e[4].html_url),u(o,"class","ml-2 text-blue-600 hover:text-blue-800"),u(o,"target","_blank"),u(o,"rel","noreferrer"),u(t,"class","my-2 flex")},m(A,I){P(A,t,I),s(t,n),s(t,i),s(t,o),s(o,r),s(t,a),v&&v.m(t,null),P(A,_,I),d&&d.m(A,I),P(A,p,I)},p(A,I){var O,L,q;I&8&&l!==(l=((q=(L=(O=A[3].status)==null?void 0:O.firmware)==null?void 0:L.latest)!=null?q:"Latest")+"")&&C(n,l),I&16&&f!==(f=A[4].tag_name+"")&&C(r,f),I&16&&c!==(c=A[4].html_url)&&u(o,"href",c),(A[1].security==0||A[0].a)&&A[1].fwconsent===1&&A[4]&&A[4].tag_name!=A[1].version?v?v.p(A,I):(v=dd(A),v.c(),v.m(t,null)):v&&(v.d(1),v=null),A[1].fwconsent===2?d?d.p(A,I):(d=vd(A),d.c(),d.m(p.parentNode,p)):d&&(d.d(1),d=null)},d(A){A&&T(t),v&&v.d(),A&&T(_),d&&d.d(A),A&&T(p)}}}function dd(e){let t,l,n,i,o;return{c(){var f,r,c;t=m("div"),l=m("button"),l.textContent="\u21D3",u(t,"class","flex-none ml-2 text-green-500"),u(t,"title",n=(c=(r=(f=e[3].status)==null?void 0:f.firmware)==null?void 0:r.install)!=null?c:"Install")},m(f,r){P(f,t,r),s(t,l),i||(o=re(l,"click",e[11]),i=!0)},p(f,r){var c,a,_;r&8&&n!==(n=(_=(a=(c=f[3].status)==null?void 0:c.firmware)==null?void 0:a.install)!=null?_:"Install")&&u(t,"title",n)},d(f){f&&T(t),i=!1,o()}}}function vd(e){var o,f,r;let t,l,n=((r=(f=(o=e[3].status)==null?void 0:o.firmware)==null?void 0:f.no_one_click)!=null?r:"One-click upgrade disabled")+"",i;return{c(){t=m("div"),l=m("div"),i=k(n),u(l,"class","bd-yellow"),u(t,"class","my-2")},m(c,a){P(c,t,a),s(t,l),s(l,i)},p(c,a){var _,p,v;a&8&&n!==(n=((v=(p=(_=c[3].status)==null?void 0:_.firmware)==null?void 0:p.no_one_click)!=null?v:"One-click upgrade disabled")+"")&&C(i,n)},d(c){c&&T(t)}}}function hd(e){let t,l=Yo(Ge(e[1].chip,e[1].board))+"",n;return{c(){t=m("div"),n=k(l),u(t,"class","bd-red")},m(i,o){P(i,t,o),s(t,n)},p(i,o){o&2&&l!==(l=Yo(Ge(i[1].chip,i[1].board))+"")&&C(n,l)},d(i){i&&T(t)}}}function bd(e){let t,l,n,i,o,f;function r(_,p){return _[6].length==0?Eg:Pg}let c=r(e),a=c(e);return{c(){t=m("div"),l=m("form"),n=m("input"),i=b(),a.c(),mn(n,"display","none"),u(n,"name","file"),u(n,"type","file"),u(n,"accept",".bin"),u(l,"action","/firmware"),u(l,"enctype","multipart/form-data"),u(l,"method","post"),u(l,"autocomplete","off"),u(t,"class","my-2 flex")},m(_,p){P(_,t,p),s(t,l),s(l,n),e[14](n),s(l,i),a.m(l,null),o||(f=[re(n,"change",e[15]),re(l,"submit",e[17])],o=!0)},p(_,p){c===(c=r(_))&&a?a.p(_,p):(a.d(1),a=c(_),a&&(a.c(),a.m(l,null)))},d(_){_&&T(t),e[14](null),a.d(),o=!1,Et(f)}}}function Pg(e){var r,c;let t=e[6][0].name+"",l,n,i,o=((c=(r=e[3].btn)==null?void 0:r.upload)!=null?c:"Upload")+"",f;return{c(){l=k(t),n=b(),i=m("button"),f=k(o),u(i,"type","submit"),u(i,"class","btn-pri-sm float-right ml-2")},m(a,_){P(a,l,_),P(a,n,_),P(a,i,_),s(i,f)},p(a,_){var p,v;_&64&&t!==(t=a[6][0].name+"")&&C(l,t),_&8&&o!==(o=((v=(p=a[3].btn)==null?void 0:p.upload)!=null?v:"Upload")+"")&&C(f,o)},d(a){a&&T(l),a&&T(n),a&&T(i)}}}function Eg(e){var f,r,c;let t,l=((c=(r=(f=e[3].status)==null?void 0:f.firmware)==null?void 0:r.btn_select_file)!=null?c:"Select file")+"",n,i,o;return{c(){t=m("button"),n=k(l),u(t,"type","button"),u(t,"class","btn-pri-sm float-right")},m(a,_){P(a,t,_),s(t,n),i||(o=re(t,"click",e[16]),i=!0)},p(a,_){var p,v,d;_&8&&l!==(l=((d=(v=(p=a[3].status)==null?void 0:p.firmware)==null?void 0:v.btn_select_file)!=null?d:"Select file")+"")&&C(n,l)},d(a){a&&T(t),i=!1,o()}}}function gd(e){var H,Y,X,J,$,ce,ie,oe,ae;let t,l,n=((X=(Y=(H=e[3].status)==null?void 0:H.backup)==null?void 0:Y.title)!=null?X:"Backup")+"",i,o,f,r,c,a,_,p,v=((ce=($=(J=e[3].status)==null?void 0:J.backup)==null?void 0:$.secrets)!=null?ce:"Include secrets")+"",d,h,g,M=((ae=(oe=(ie=e[3].status)==null?void 0:ie.backup)==null?void 0:oe.secrets_desc)!=null?ae:"")+"",A,I,O,L,q,U,E,F,z=e[10],G=[];for(let se=0;se{Oe=null}),dt());const Gt={};Ve&33554440&&(Gt.$$scope={dirty:Ve,ctx:Me}),X.$set(Gt),(!ke||Ve&8)&&ce!==(ce=((Yt=(ut=Me[3].btn)==null?void 0:ut.reboot)!=null?Yt:"Reboot")+"")&&C(ie,ce),Me[1].meter?je?je.p(Me,Ve):(je=od(Me),je.c(),je.m(t,ae)):je&&(je.d(1),je=null),Me[1].net?Qe?Qe.p(Me,Ve):(Qe=ad(Me),Qe.c(),Qe.m(t,se)):Qe&&(Qe.d(1),Qe=null),(!ke||Ve&8)&&pe!==(pe=((ul=(fl=(ll=Me[3].status)==null?void 0:ll.firmware)==null?void 0:fl.title)!=null?ul:"Firmware")+"")&&C(V,pe),(!ke||Ve&8)&&ve!==(ve=((Cl=(rl=(Sl=Me[3].status)==null?void 0:Sl.firmware)==null?void 0:rl.installed)!=null?Cl:"Installed")+"")&&C(S,ve),(!ke||Ve&2)&&N!==(N=Me[1].version+"")&&C(D,N),Me[1].upgrade.t&&Me[1].upgrade.t!=Me[1].version?We?We.p(Me,Ve):(We=md(Me),We.c(),We.m(x,te)):We&&(We.d(1),We=null),Me[4]?Je?Je.p(Me,Ve):(Je=pd(Me),Je.c(),Je.m(x,le)):Je&&(Je.d(1),Je=null),Ve&3&&(fe=(Me[1].security==0||Me[0].a)&&is(Me[1].board)),fe?$e?$e.p(Me,Ve):($e=hd(Me),$e.c(),$e.m(x,de)):$e&&($e.d(1),$e=null),Me[1].security==0||Me[0].a?tt?tt.p(Me,Ve):(tt=bd(Me),tt.c(),tt.m(x,null)):tt&&(tt.d(1),tt=null),Me[1].security==0||Me[0].a?Te?Te.p(Me,Ve):(Te=gd(Me),Te.c(),Te.m(t,null)):Te&&(Te.d(1),Te=null);const zt={};Ve&128&&(zt.active=Me[7]),Ve&8&&(zt.message=(dl=(_l=(nl=Me[3].status)==null?void 0:nl.mask)==null?void 0:_l.firmware)!=null?dl:"Uploading"),we.$set(zt);const Dt={};Ve&512&&(Dt.active=Me[9]),Ve&8&&(Dt.message=(Qt=(Tl=(Nl=Me[3].status)==null?void 0:Nl.mask)==null?void 0:Tl.config)!=null?Qt:"Uploading"),Ae.$set(Dt)},i(Me){ke||(Q(U.$$.fragment,Me),Q(Oe),Q(X.$$.fragment,Me),Q(we.$$.fragment,Me),Q(Ae.$$.fragment,Me),ke=!0)},o(Me){ee(U.$$.fragment,Me),ee(Oe),ee(X.$$.fragment,Me),ee(we.$$.fragment,Me),ee(Ae.$$.fragment,Me),ke=!1},d(Me){Me&&T(t),Ce(U),Oe&&Oe.d(),Ce(X),je&&je.d(),Qe&&Qe.d(),We&&We.d(),Je&&Je.d(),$e&&$e.d(),tt&&tt.d(),Te&&Te.d(),Me&&T(Pe),Ce(we,Me),Me&&T(Fe),Ce(Ae,Me),De=!1,He()}}}async function Og(){await(await fetch("reboot",{method:"POST"})).json()}function Ig(e,t,l){let{data:n}=t,{sysinfo:i}=t,o=[{name:"WiFi",key:"iw"},{name:"MQTT",key:"im"},{name:"Web",key:"ie"},{name:"Meter",key:"it"},{name:"Thresholds",key:"ih"},{name:"GPIO",key:"ig"},{name:"NTP",key:"in"},{name:"Price",key:"is"}],f={};Ml.subscribe(z=>{l(3,f=z)});let r={};Pf.subscribe(z=>{l(4,r=Hv(i.version,z)),r||l(4,r=z[0])});function c(){var z,G;confirm(((G=(z=f.header)==null?void 0:z.upgrade)!=null?G:"Upgrade to {0}?").replace("{0}",r.tag_name))&&(i.board!=2&&i.board!=4&&i.board!=7||confirm(Yo(Ge(i.chip,i.board))))&&(wl.update(B=>(B.upgrading=!0,B)),jv(r.tag_name))}const a=function(){var z,G;confirm((G=(z=f.device)==null?void 0:z.reboot_confirm)!=null?G:"Reboot?")&&(wl.update(B=>(B.booting=!0,B)),Og())};let _,p=[],v=!1,d,h=[],g=!1;Sf();let M={hostname:"",ip:""};function A(z){l(9,g=!0);const G=new FormData;G.append("file",h[0]),fetch("/configfile",{method:"POST",body:G}).then(B=>B.json()).then(B=>{wl.update(R=>(M&&M.hostname&&(R.hostname=M.hostname),R.booting=B.reboot,M&&M.ip&&(R.net.ip=M.ip),setTimeout(Fs,5e3,i),R))}).catch(B=>{console.error("Error:",B),setTimeout(Fs,5e3,i)})}function I(z){Go[z?"unshift":"push"](()=>{_=z,l(5,_)})}function O(){p=this.files,l(6,p)}const L=()=>{_.click()},q=()=>l(7,v=!0);function U(z){Go[z?"unshift":"push"](()=>{d=z,l(8,d)})}function E(){h=this.files,l(2,h)}const F=()=>{d.click()};return e.$$set=z=>{"data"in z&&l(0,n=z.data),"sysinfo"in z&&l(1,i=z.sysinfo)},e.$$.update=()=>{if(e.$$.dirty&4&&h.length==1){let z=h[0],G=new FileReader,B=R=>{let K=R.target.result.split(` -`);for(let y in K){let H=K[y];H.startsWith("hostname ")?M.hostname=H.split(" ")[1]:H.startsWith("ip ")&&(M.ip=H.split(" ")[1])}};G.onload=B,G.readAsText(z)}},[n,i,h,f,r,_,p,v,d,g,o,c,a,A,I,O,L,q,U,E,F]}class Lg extends mt{constructor(t){super(),_t(this,t,Ig,qg,ct,{data:0,sysinfo:1})}}function Md(e){let t,l,n=Ge(e[0],7)+"",i,o,f=Ge(e[0],5)+"",r,c,a=Ge(e[0],4)+"",_,p,v=Ge(e[0],3)+"",d,h,g,M,A=Ge(e[0],2)+"",I,O,L=Ge(e[0],1)+"",q,U,E=Ge(e[0],0)+"",F,z,G,B,R=Ge(e[0],101)+"",K,y,H=Ge(e[0],100)+"",Y;return{c(){t=m("optgroup"),l=m("option"),i=k(n),o=m("option"),r=k(f),c=m("option"),_=k(a),p=m("option"),d=k(v),h=b(),g=m("optgroup"),M=m("option"),I=k(A),O=m("option"),q=k(L),U=m("option"),F=k(E),z=b(),G=m("optgroup"),B=m("option"),K=k(R),y=m("option"),Y=k(H),l.__value=7,l.value=l.__value,o.__value=5,o.value=o.__value,c.__value=4,c.value=c.__value,p.__value=3,p.value=p.__value,u(t,"label","amsleser.no"),M.__value=2,M.value=M.__value,O.__value=1,O.value=O.__value,U.__value=0,U.value=U.__value,u(g,"label","Custom hardware"),B.__value=101,B.value=B.__value,y.__value=100,y.value=y.__value,u(G,"label","Generic hardware")},m(X,J){P(X,t,J),s(t,l),s(l,i),s(t,o),s(o,r),s(t,c),s(c,_),s(t,p),s(p,d),P(X,h,J),P(X,g,J),s(g,M),s(M,I),s(g,O),s(O,q),s(g,U),s(U,F),P(X,z,J),P(X,G,J),s(G,B),s(B,K),s(G,y),s(y,Y)},p(X,J){J&1&&n!==(n=Ge(X[0],7)+"")&&C(i,n),J&1&&f!==(f=Ge(X[0],5)+"")&&C(r,f),J&1&&a!==(a=Ge(X[0],4)+"")&&C(_,a),J&1&&v!==(v=Ge(X[0],3)+"")&&C(d,v),J&1&&A!==(A=Ge(X[0],2)+"")&&C(I,A),J&1&&L!==(L=Ge(X[0],1)+"")&&C(q,L),J&1&&E!==(E=Ge(X[0],0)+"")&&C(F,E),J&1&&R!==(R=Ge(X[0],101)+"")&&C(K,R),J&1&&H!==(H=Ge(X[0],100)+"")&&C(Y,H)},d(X){X&&T(t),X&&T(h),X&&T(g),X&&T(z),X&&T(G)}}}function Sd(e){let t,l,n=Ge(e[0],201)+"",i,o,f=Ge(e[0],202)+"",r,c,a=Ge(e[0],203)+"",_,p,v=Ge(e[0],241)+"",d,h,g=Ge(e[0],242)+"",M,A,I=Ge(e[0],243)+"",O,L,q=Ge(e[0],200)+"",U;return{c(){t=m("optgroup"),l=m("option"),i=k(n),o=m("option"),r=k(f),c=m("option"),_=k(a),p=m("option"),d=k(v),h=m("option"),M=k(g),A=m("option"),O=k(I),L=m("option"),U=k(q),l.__value=201,l.value=l.__value,o.__value=202,o.value=o.__value,c.__value=203,c.value=c.__value,p.__value=241,p.value=p.__value,h.__value=242,h.value=h.__value,A.__value=243,A.value=A.__value,L.__value=200,L.value=L.__value,u(t,"label","Generic hardware")},m(E,F){P(E,t,F),s(t,l),s(l,i),s(t,o),s(o,r),s(t,c),s(c,_),s(t,p),s(p,d),s(t,h),s(h,M),s(t,A),s(A,O),s(t,L),s(L,U)},p(E,F){F&1&&n!==(n=Ge(E[0],201)+"")&&C(i,n),F&1&&f!==(f=Ge(E[0],202)+"")&&C(r,f),F&1&&a!==(a=Ge(E[0],203)+"")&&C(_,a),F&1&&v!==(v=Ge(E[0],241)+"")&&C(d,v),F&1&&g!==(g=Ge(E[0],242)+"")&&C(M,g),F&1&&I!==(I=Ge(E[0],243)+"")&&C(O,I),F&1&&q!==(q=Ge(E[0],200)+"")&&C(U,q)},d(E){E&&T(t)}}}function Cd(e){let t,l,n=Ge(e[0],7)+"",i,o,f=Ge(e[0],6)+"",r,c,a=Ge(e[0],5)+"",_,p,v,d,h=Ge(e[0],51)+"",g,M,A=Ge(e[0],50)+"",I;return{c(){t=m("optgroup"),l=m("option"),i=k(n),o=m("option"),r=k(f),c=m("option"),_=k(a),p=b(),v=m("optgroup"),d=m("option"),g=k(h),M=m("option"),I=k(A),l.__value=7,l.value=l.__value,o.__value=6,o.value=o.__value,c.__value=5,c.value=c.__value,u(t,"label","amsleser.no"),d.__value=51,d.value=d.__value,M.__value=50,M.value=M.__value,u(v,"label","Generic hardware")},m(O,L){P(O,t,L),s(t,l),s(l,i),s(t,o),s(o,r),s(t,c),s(c,_),P(O,p,L),P(O,v,L),s(v,d),s(d,g),s(v,M),s(M,I)},p(O,L){L&1&&n!==(n=Ge(O[0],7)+"")&&C(i,n),L&1&&f!==(f=Ge(O[0],6)+"")&&C(r,f),L&1&&a!==(a=Ge(O[0],5)+"")&&C(_,a),L&1&&h!==(h=Ge(O[0],51)+"")&&C(g,h),L&1&&A!==(A=Ge(O[0],50)+"")&&C(I,A)},d(O){O&&T(t),O&&T(p),O&&T(v)}}}function Nd(e){let t,l,n=Ge(e[0],8)+"",i,o,f,r,c=Ge(e[0],71)+"",a,_,p=Ge(e[0],70)+"",v;return{c(){t=m("optgroup"),l=m("option"),i=k(n),o=b(),f=m("optgroup"),r=m("option"),a=k(c),_=m("option"),v=k(p),l.__value=8,l.value=l.__value,u(t,"label","Custom hardware"),r.__value=71,r.value=r.__value,_.__value=70,_.value=_.__value,u(f,"label","Generic hardware")},m(d,h){P(d,t,h),s(t,l),s(l,i),P(d,o,h),P(d,f,h),s(f,r),s(r,a),s(f,_),s(_,v)},p(d,h){h&1&&n!==(n=Ge(d[0],8)+"")&&C(i,n),h&1&&c!==(c=Ge(d[0],71)+"")&&C(a,c),h&1&&p!==(p=Ge(d[0],70)+"")&&C(v,p)},d(d){d&&T(t),d&&T(o),d&&T(f)}}}function Td(e){let t,l,n=Ge(e[0],200)+"",i;return{c(){t=m("optgroup"),l=m("option"),i=k(n),l.__value=200,l.value=l.__value,u(t,"label","Generic hardware")},m(o,f){P(o,t,f),s(t,l),s(l,i)},p(o,f){f&1&&n!==(n=Ge(o[0],200)+"")&&C(i,n)},d(o){o&&T(t)}}}function Pd(e){let t,l,n=Ge(e[0],80)+"",i;return{c(){t=m("optgroup"),l=m("option"),i=k(n),l.__value=80,l.value=l.__value,u(t,"label","Generic hardware")},m(o,f){P(o,t,f),s(t,l),s(l,i)},p(o,f){f&1&&n!==(n=Ge(o[0],80)+"")&&C(i,n)},d(o){o&&T(t)}}}function Rg(e){let t,l,n,i,o,f,r,c,a=e[0]=="esp8266"&&Md(e),_=e[0]=="esp32"&&Sd(e),p=e[0]=="esp32s2"&&Cd(e),v=e[0]=="esp32c3"&&Nd(e),d=e[0]=="esp32solo"&&Td(e),h=e[0]=="esp32s3"&&Pd(e);return{c(){t=m("option"),l=b(),a&&a.c(),n=b(),_&&_.c(),i=b(),p&&p.c(),o=b(),v&&v.c(),f=b(),d&&d.c(),r=b(),h&&h.c(),c=Ut(),t.__value=-1,t.value=t.__value},m(g,M){P(g,t,M),P(g,l,M),a&&a.m(g,M),P(g,n,M),_&&_.m(g,M),P(g,i,M),p&&p.m(g,M),P(g,o,M),v&&v.m(g,M),P(g,f,M),d&&d.m(g,M),P(g,r,M),h&&h.m(g,M),P(g,c,M)},p(g,[M]){g[0]=="esp8266"?a?a.p(g,M):(a=Md(g),a.c(),a.m(n.parentNode,n)):a&&(a.d(1),a=null),g[0]=="esp32"?_?_.p(g,M):(_=Sd(g),_.c(),_.m(i.parentNode,i)):_&&(_.d(1),_=null),g[0]=="esp32s2"?p?p.p(g,M):(p=Cd(g),p.c(),p.m(o.parentNode,o)):p&&(p.d(1),p=null),g[0]=="esp32c3"?v?v.p(g,M):(v=Nd(g),v.c(),v.m(f.parentNode,f)):v&&(v.d(1),v=null),g[0]=="esp32solo"?d?d.p(g,M):(d=Td(g),d.c(),d.m(r.parentNode,r)):d&&(d.d(1),d=null),g[0]=="esp32s3"?h?h.p(g,M):(h=Pd(g),h.c(),h.m(c.parentNode,c)):h&&(h.d(1),h=null)},i:ze,o:ze,d(g){g&&T(t),g&&T(l),a&&a.d(g),g&&T(n),_&&_.d(g),g&&T(i),p&&p.d(g),g&&T(o),v&&v.d(g),g&&T(f),d&&d.d(g),g&&T(r),h&&h.d(g),g&&T(c)}}}function Fg(e,t,l){let{chip:n}=t;return e.$$set=i=>{"chip"in i&&l(0,n=i.chip)},[n]}class Bg extends mt{constructor(t){super(),_t(this,t,Fg,Rg,ct,{chip:0})}}function Ed(e){let t;return{c(){t=m("div"),t.textContent="WARNING: Changing this configuration will affect basic configuration of your device. Only make changes here if instructed by vendor",u(t,"class","bd-red")},m(l,n){P(l,t,n)},d(l){l&&T(t)}}}function Ad(e){let t,l,n,i,o,f,r;return f=new rf({props:{chip:e[0].chip}}),{c(){t=m("div"),l=k("HAN GPIO"),n=m("br"),i=b(),o=m("select"),Ne(f.$$.fragment),u(o,"name","vh"),u(o,"class","in-s"),u(t,"class","my-3")},m(c,a){P(c,t,a),s(t,l),s(t,n),s(t,i),s(t,o),Se(f,o,null),r=!0},p(c,a){const _={};a&1&&(_.chip=c[0].chip),f.$set(_)},i(c){r||(Q(f.$$.fragment,c),r=!0)},o(c){ee(f.$$.fragment,c),r=!1},d(c){c&&T(t),Ce(f)}}}function Ug(e){let t,l,n,i,o,f,r,c,a,_,p,v,d,h,g,M,A,I,O,L,q,U,E,F,z,G,B,R,K,y=e[0].usrcfg&&Ed();h=new Bg({props:{chip:e[0].chip}});let H=e[0].board&&e[0].board>20&&Ad(e);return G=new kl({props:{active:e[1],message:"Saving"}}),{c(){t=m("div"),l=m("div"),n=m("form"),i=m("input"),o=b(),f=m("strong"),f.textContent="Initial configuration",r=b(),y&&y.c(),c=b(),a=m("div"),_=k("Board type"),p=m("br"),v=b(),d=m("select"),Ne(h.$$.fragment),g=b(),H&&H.c(),M=b(),A=m("div"),I=m("label"),O=m("input"),L=k(" Clear all other configuration"),q=b(),U=m("div"),U.innerHTML='',E=b(),F=m("span"),F.textContent="\xA0",z=b(),Ne(G.$$.fragment),u(i,"type","hidden"),u(i,"name","v"),i.value="true",u(f,"class","text-sm"),u(d,"name","vb"),u(d,"class","in-s"),e[0].board===void 0&&Ct(()=>e[5].call(d)),u(a,"class","my-3"),u(O,"type","checkbox"),u(O,"name","vr"),O.__value="true",O.value=O.__value,u(O,"class","rounded mb-1"),u(A,"class","my-3"),u(U,"class","my-3"),u(F,"class","clear-both"),u(n,"autocomplete","off"),u(l,"class","cnt"),u(t,"class","grid xl:grid-cols-4 lg:grid-cols-3 md:grid-cols-2")},m(Y,X){P(Y,t,X),s(t,l),s(l,n),s(n,i),s(n,o),s(n,f),s(n,r),y&&y.m(n,null),s(n,c),s(n,a),s(a,_),s(a,p),s(a,v),s(a,d),Se(h,d,null),Ze(d,e[0].board,!0),s(n,g),H&&H.m(n,null),s(n,M),s(n,A),s(A,I),s(I,O),O.checked=e[2],s(I,L),s(n,q),s(n,U),s(n,E),s(n,F),P(Y,z,X),Se(G,Y,X),B=!0,R||(K=[re(d,"change",e[5]),re(O,"change",e[6]),re(n,"submit",fs(e[3]))],R=!0)},p(Y,[X]){Y[0].usrcfg?y||(y=Ed(),y.c(),y.m(n,c)):y&&(y.d(1),y=null);const J={};X&1&&(J.chip=Y[0].chip),h.$set(J),X&1&&Ze(d,Y[0].board),Y[0].board&&Y[0].board>20?H?(H.p(Y,X),X&1&&Q(H,1)):(H=Ad(Y),H.c(),Q(H,1),H.m(n,M)):H&&(pt(),ee(H,1,1,()=>{H=null}),dt()),X&4&&(O.checked=Y[2]);const $={};X&2&&($.active=Y[1]),G.$set($)},i(Y){B||(Q(h.$$.fragment,Y),Q(H),Q(G.$$.fragment,Y),B=!0)},o(Y){ee(h.$$.fragment,Y),ee(H),ee(G.$$.fragment,Y),B=!1},d(Y){Y&&T(t),y&&y.d(),Ce(h),H&&H.d(),Y&&T(z),Ce(G,Y),R=!1,Et(K)}}}function jg(e,t,l){let{basepath:n="/"}=t,{sysinfo:i={}}=t,o=!1;async function f(_){l(1,o=!0);const p=new FormData(_.target),v=new URLSearchParams;for(let g of p){const[M,A]=g;v.append(M,A)}let h=await(await fetch("save",{method:"POST",body:v})).json();l(1,o=!1),wl.update(g=>(g.vndcfg=h.success,g.booting=h.reboot,g.if.eth=g.boardType>240&&g.boardType<250,g)),gi(n+(i.usrcfg?"/":"/setup"))}let r=!1;wl.subscribe(_=>{l(0,i=_),_.fwconsent===1&&l(2,r=!i.usrcfg)});function c(){i.board=Ft(this),l(0,i)}function a(){r=this.checked,l(2,r)}return e.$$set=_=>{"basepath"in _&&l(4,n=_.basepath),"sysinfo"in _&&l(0,i=_.sysinfo)},[i,o,r,f,n,c,a]}class Hg extends mt{constructor(t){super(),_t(this,t,jg,Ug,ct,{basepath:4,sysinfo:0})}}function Dd(e){var i,o,f;let t,l=((f=(o=(i=e[1].conf)==null?void 0:i.connection)==null?void 0:o.eth)!=null?f:"Ethernet")+"",n;return{c(){t=m("option"),n=k(l),t.__value=3,t.value=t.__value},m(r,c){P(r,t,c),s(t,n)},p(r,c){var a,_,p;c&2&&l!==(l=((p=(_=(a=r[1].conf)==null?void 0:a.connection)==null?void 0:_.eth)!=null?p:"Ethernet")+"")&&C(n,l)},d(r){r&&T(t)}}}function qd(e){var M,A,I,O,L,q;let t,l=((I=(A=(M=e[1].conf)==null?void 0:M.connection)==null?void 0:A.ssid)!=null?I:"SSID")+"",n,i,o,f,r,c,a,_=((q=(L=(O=e[1].conf)==null?void 0:O.connection)==null?void 0:L.psk)!=null?q:"Password")+"",p,v,d,h,g;return{c(){t=m("div"),n=k(l),i=m("br"),o=b(),f=m("input"),c=b(),a=m("div"),p=k(_),v=m("br"),d=b(),h=m("input"),u(f,"name","ss"),u(f,"type","text"),u(f,"class","in-s"),f.required=r=e[3]==1||e[3]==2,u(t,"class","my-3"),u(h,"name","sp"),u(h,"type","password"),u(h,"class","in-s"),u(h,"autocomplete","off"),h.required=g=e[3]==2,u(a,"class","my-3")},m(U,E){P(U,t,E),s(t,n),s(t,i),s(t,o),s(t,f),P(U,c,E),P(U,a,E),s(a,p),s(a,v),s(a,d),s(a,h)},p(U,E){var F,z,G,B,R,K;E&2&&l!==(l=((G=(z=(F=U[1].conf)==null?void 0:F.connection)==null?void 0:z.ssid)!=null?G:"SSID")+"")&&C(n,l),E&8&&r!==(r=U[3]==1||U[3]==2)&&(f.required=r),E&2&&_!==(_=((K=(R=(B=U[1].conf)==null?void 0:B.connection)==null?void 0:R.psk)!=null?K:"Password")+"")&&C(p,_),E&8&&g!==(g=U[3]==2)&&(h.required=g)},d(U){U&&T(t),U&&T(c),U&&T(a)}}}function Od(e){let t,l,n,i,o,f,r,c;return r=new Gv({}),{c(){t=m("br"),l=b(),n=m("div"),i=m("input"),o=b(),f=m("select"),Ne(r.$$.fragment),u(i,"name","si"),u(i,"type","text"),u(i,"class","in-f w-full"),i.required=e[2],u(f,"name","su"),u(f,"class","in-l"),f.required=e[2],u(n,"class","flex")},m(a,_){P(a,t,_),P(a,l,_),P(a,n,_),s(n,i),s(n,o),s(n,f),Se(r,f,null),c=!0},p(a,_){(!c||_&4)&&(i.required=a[2]),(!c||_&4)&&(f.required=a[2])},i(a){c||(Q(r.$$.fragment,a),c=!0)},o(a){ee(r.$$.fragment,a),c=!1},d(a){a&&T(t),a&&T(l),a&&T(n),Ce(r)}}}function Id(e){var g,M,A,I,O,L;let t,l,n=((A=(M=(g=e[1].conf)==null?void 0:g.network)==null?void 0:M.gw)!=null?A:"Gateway")+"",i,o,f,r,c,a,_=((L=(O=(I=e[1].conf)==null?void 0:I.network)==null?void 0:O.dns)!=null?L:"DNS")+"",p,v,d,h;return{c(){t=m("div"),l=m("div"),i=k(n),o=m("br"),f=b(),r=m("input"),c=b(),a=m("div"),p=k(_),v=m("br"),d=b(),h=m("input"),u(r,"name","sg"),u(r,"type","text"),u(r,"class","in-f w-full"),u(h,"name","sd"),u(h,"type","text"),u(h,"class","in-l w-full"),u(t,"class","my-3 flex")},m(q,U){P(q,t,U),s(t,l),s(l,i),s(l,o),s(l,f),s(l,r),s(t,c),s(t,a),s(a,p),s(a,v),s(a,d),s(a,h)},p(q,U){var E,F,z,G,B,R;U&2&&n!==(n=((z=(F=(E=q[1].conf)==null?void 0:E.network)==null?void 0:F.gw)!=null?z:"Gateway")+"")&&C(i,n),U&2&&_!==(_=((R=(B=(G=q[1].conf)==null?void 0:G.network)==null?void 0:B.dns)!=null?R:"DNS")+"")&&C(p,_)},d(q){q&&T(t)}}}function yg(e){var j,te,le,fe,de,qe,Pe,we,Fe,Ae,ke,De,He,Oe,je,Qe,We,Je,$e,tt;let t,l,n,i,o,f,r=((te=(j=e[1].setup)==null?void 0:j.title)!=null?te:"Setup")+"",c,a,_,p=((de=(fe=(le=e[1].conf)==null?void 0:le.connection)==null?void 0:fe.title)!=null?de:"Connection")+"",v,d,h,g,M,A=((we=(Pe=(qe=e[1].conf)==null?void 0:qe.connection)==null?void 0:Pe.wifi)!=null?we:"Connect to WiFi")+"",I,O,L=((ke=(Ae=(Fe=e[1].conf)==null?void 0:Fe.connection)==null?void 0:Ae.ap)!=null?ke:"Standalone access point")+"",q,U,E,F,z=((Oe=(He=(De=e[1].conf)==null?void 0:De.general)==null?void 0:He.hostname)!=null?Oe:"Hostname")+"",G,B,R,K,y,H,Y,X,J=((Qe=(je=e[1].setup)==null?void 0:je.static)!=null?Qe:"Static IP")+"",$,ce,ie,oe,ae,se,x=((Je=(We=e[1].btn)==null?void 0:We.save)!=null?Je:"Save")+"",me,pe,V,Z,ge,ve,S=e[0].if&&e[0].if.eth&&Dd(e),w=(e[3]==1||e[3]==2)&&qd(e),N=e[2]&&Od(e),D=e[2]&&Id(e);return V=new kl({props:{active:e[4],message:(tt=($e=e[1].setup)==null?void 0:$e.mask)!=null?tt:"Saving"}}),{c(){t=m("div"),l=m("div"),n=m("form"),i=m("input"),o=b(),f=m("strong"),c=k(r),a=b(),_=m("div"),v=k(p),d=m("br"),h=b(),g=m("select"),M=m("option"),I=k(A),O=m("option"),q=k(L),S&&S.c(),U=b(),w&&w.c(),E=b(),F=m("div"),G=k(z),B=b(),R=m("input"),K=b(),y=m("div"),H=m("label"),Y=m("input"),X=b(),$=k(J),ce=b(),N&&N.c(),ie=b(),D&&D.c(),oe=b(),ae=m("div"),se=m("button"),me=k(x),pe=b(),Ne(V.$$.fragment),u(i,"type","hidden"),u(i,"name","s"),i.value="true",u(f,"class","text-sm"),M.__value=1,M.value=M.__value,O.__value=2,O.value=O.__value,u(g,"name","sc"),u(g,"class","in-s"),e[3]===void 0&&Ct(()=>e[6].call(g)),u(_,"class","my-3"),u(R,"name","sh"),u(R,"type","text"),u(R,"class","in-s"),u(R,"maxlength","32"),u(R,"pattern","[a-z0-9_-]+"),u(R,"placeholder","Optional, ex.: ams-reader"),u(R,"autocomplete","off"),u(Y,"type","checkbox"),u(Y,"name","sm"),Y.__value="static",Y.value=Y.__value,u(Y,"class","rounded mb-1"),u(y,"class","my-3"),u(se,"type","submit"),u(se,"class","btn-pri"),u(ae,"class","my-3"),u(l,"class","cnt"),u(t,"class","grid xl:grid-cols-4 lg:grid-cols-3 md:grid-cols-2")},m(Te,ue){P(Te,t,ue),s(t,l),s(l,n),s(n,i),s(n,o),s(n,f),s(f,c),s(n,a),s(n,_),s(_,v),s(_,d),s(_,h),s(_,g),s(g,M),s(M,I),s(g,O),s(O,q),S&&S.m(g,null),Ze(g,e[3],!0),s(n,U),w&&w.m(n,null),s(n,E),s(n,F),s(F,G),s(F,B),s(F,R),be(R,e[0].hostname),s(n,K),s(n,y),s(y,H),s(H,Y),Y.checked=e[2],s(H,X),s(H,$),s(y,ce),N&&N.m(y,null),s(n,ie),D&&D.m(n,null),s(n,oe),s(n,ae),s(ae,se),s(se,me),P(Te,pe,ue),Se(V,Te,ue),Z=!0,ge||(ve=[re(g,"change",e[6]),re(R,"input",e[7]),re(Y,"change",e[8]),re(n,"submit",fs(e[5]))],ge=!0)},p(Te,[ue]){var kt,lt,wt,st,ot,xe,Nt,gt,At,Pt,Be,ye,It,vt,nt,Tt,it,at,rt,jt;(!Z||ue&2)&&r!==(r=((lt=(kt=Te[1].setup)==null?void 0:kt.title)!=null?lt:"Setup")+"")&&C(c,r),(!Z||ue&2)&&p!==(p=((ot=(st=(wt=Te[1].conf)==null?void 0:wt.connection)==null?void 0:st.title)!=null?ot:"Connection")+"")&&C(v,p),(!Z||ue&2)&&A!==(A=((gt=(Nt=(xe=Te[1].conf)==null?void 0:xe.connection)==null?void 0:Nt.wifi)!=null?gt:"Connect to WiFi")+"")&&C(I,A),(!Z||ue&2)&&L!==(L=((Be=(Pt=(At=Te[1].conf)==null?void 0:At.connection)==null?void 0:Pt.ap)!=null?Be:"Standalone access point")+"")&&C(q,L),Te[0].if&&Te[0].if.eth?S?S.p(Te,ue):(S=Dd(Te),S.c(),S.m(g,null)):S&&(S.d(1),S=null),ue&8&&Ze(g,Te[3]),Te[3]==1||Te[3]==2?w?w.p(Te,ue):(w=qd(Te),w.c(),w.m(n,E)):w&&(w.d(1),w=null),(!Z||ue&2)&&z!==(z=((vt=(It=(ye=Te[1].conf)==null?void 0:ye.general)==null?void 0:It.hostname)!=null?vt:"Hostname")+"")&&C(G,z),ue&1&&R.value!==Te[0].hostname&&be(R,Te[0].hostname),ue&4&&(Y.checked=Te[2]),(!Z||ue&2)&&J!==(J=((Tt=(nt=Te[1].setup)==null?void 0:nt.static)!=null?Tt:"Static IP")+"")&&C($,J),Te[2]?N?(N.p(Te,ue),ue&4&&Q(N,1)):(N=Od(Te),N.c(),Q(N,1),N.m(y,null)):N&&(pt(),ee(N,1,1,()=>{N=null}),dt()),Te[2]?D?D.p(Te,ue):(D=Id(Te),D.c(),D.m(n,oe)):D&&(D.d(1),D=null),(!Z||ue&2)&&x!==(x=((at=(it=Te[1].btn)==null?void 0:it.save)!=null?at:"Save")+"")&&C(me,x);const Ie={};ue&16&&(Ie.active=Te[4]),ue&2&&(Ie.message=(jt=(rt=Te[1].setup)==null?void 0:rt.mask)!=null?jt:"Saving"),V.$set(Ie)},i(Te){Z||(Q(N),Q(V.$$.fragment,Te),Z=!0)},o(Te){ee(N),ee(V.$$.fragment,Te),Z=!1},d(Te){Te&&T(t),S&&S.d(),w&&w.d(),N&&N.d(),D&&D.d(),Te&&T(pe),Ce(V,Te),ge=!1,Et(ve)}}}function zg(e,t,l){let n={};Ml.subscribe(d=>{l(1,n=d)});let{sysinfo:i={}}=t,o=!1,f=1,r=!1;function c(d){wl.update(h=>(h.trying=d,h))}async function a(d){l(4,r=!0);const h=new FormData(d.target),g=new URLSearchParams;for(let I of h){const[O,L]=I;g.append(O,L)}let A=await(await fetch("save",{method:"POST",body:g})).json();l(4,r=!1),wl.update(I=>(I.hostname=h.get("sh"),I.usrcfg=A.success,I.booting=A.reboot,o&&(I.net.ip=h.get("si"),I.net.mask=h.get("su"),I.net.gw=h.get("sg"),I.net.dns1=h.get("sd")),A.reboot&&setTimeout(Fs,5e3,i,c),I))}function _(){f=Ft(this),l(3,f)}function p(){i.hostname=this.value,l(0,i)}function v(){o=this.checked,l(2,o)}return e.$$set=d=>{"sysinfo"in d&&l(0,i=d.sysinfo)},[i,n,o,f,r,a,_,p,v]}class Wg extends mt{constructor(t){super(),_t(this,t,zg,yg,ct,{sysinfo:0})}}function Gg(e){var G,B,R,K,y,H,Y,X;let t,l,n,i=((B=(G=e[2].upload)==null?void 0:G.title)!=null?B:"Upload")+"",o,f,r,c,a,_=((K=(R=e[2].upload)==null?void 0:R.desc)!=null?K:"")+"",p,v,d,h,g,M,A,I,O=((H=(y=e[2].btn)==null?void 0:y.upload)!=null?H:"Upload")+"",L,q,U,E,F,z;return U=new kl({props:{active:e[3],message:(X=(Y=e[2].upload)==null?void 0:Y.mask)!=null?X:"Uploading"}}),{c(){t=m("div"),l=m("div"),n=m("strong"),o=k(i),f=b(),r=k(e[1]),c=b(),a=m("p"),p=k(_),v=b(),d=m("form"),h=m("input"),g=b(),M=m("div"),A=m("button"),I=m("p"),L=k(O),q=b(),Ne(U.$$.fragment),u(a,"class","mb-4"),u(h,"name","file"),u(h,"type","file"),u(I,"class","mb-4"),u(A,"type","submit"),u(A,"class","btn-pri"),u(M,"class","w-full text-right mt-4"),u(d,"action",e[0]),u(d,"enctype","multipart/form-data"),u(d,"method","post"),u(d,"autocomplete","off"),u(l,"class","cnt"),u(t,"class","grid xl:grid-cols-4 lg:grid-cols-2 md:grid-cols-2")},m(J,$){P(J,t,$),s(t,l),s(l,n),s(n,o),s(n,f),s(n,r),s(l,c),s(l,a),s(a,p),s(l,v),s(l,d),s(d,h),s(d,g),s(d,M),s(M,A),s(A,I),s(I,L),P(J,q,$),Se(U,J,$),E=!0,F||(z=re(d,"submit",e[4]),F=!0)},p(J,[$]){var ie,oe,ae,se,x,me,pe,V;(!E||$&4)&&i!==(i=((oe=(ie=J[2].upload)==null?void 0:ie.title)!=null?oe:"Upload")+"")&&C(o,i),(!E||$&2)&&C(r,J[1]),(!E||$&4)&&_!==(_=((se=(ae=J[2].upload)==null?void 0:ae.desc)!=null?se:"")+"")&&C(p,_),(!E||$&4)&&O!==(O=((me=(x=J[2].btn)==null?void 0:x.upload)!=null?me:"Upload")+"")&&C(L,O),(!E||$&1)&&u(d,"action",J[0]);const ce={};$&8&&(ce.active=J[3]),$&4&&(ce.message=(V=(pe=J[2].upload)==null?void 0:pe.mask)!=null?V:"Uploading"),U.$set(ce)},i(J){E||(Q(U.$$.fragment,J),E=!0)},o(J){ee(U.$$.fragment,J),E=!1},d(J){J&&T(t),J&&T(q),Ce(U,J),F=!1,z()}}}function Vg(e,t,l){let{action:n}=t,{title:i}=t,o={};Ml.subscribe(c=>{l(2,o=c)});let f=!1;const r=()=>l(3,f=!0);return e.$$set=c=>{"action"in c&&l(0,n=c.action),"title"in c&&l(1,i=c.title)},[n,i,o,f,r]}class Af extends mt{constructor(t){super(),_t(this,t,Vg,Gg,ct,{action:0,title:1})}}function Kg(e){var V,Z,ge,ve,S,w,N,D,j,te,le,fe,de,qe;let t,l,n,i,o=((Z=(V=e[1].consent)==null?void 0:V.title)!=null?Z:"Consents")+"",f,r,c,a,_,p=((ve=(ge=e[1].consent)==null?void 0:ge.one_click)!=null?ve:"One-click")+"",v,d,h,g,M=((w=(S=e[1].consent)==null?void 0:S.read_more)!=null?w:"Read more")+"",A,I,O,L,q,U,E,F=((D=(N=e[1].consent)==null?void 0:N.yes)!=null?D:"Yes")+"",z,G,B,R,K,y,H=((te=(j=e[1].consent)==null?void 0:j.no)!=null?te:"No")+"",Y,X,J,$,ce,ie=((fe=(le=e[1].btn)==null?void 0:le.save)!=null?fe:"Save")+"",oe,ae,se,x,me,pe;return se=new kl({props:{active:e[2],message:(qe=(de=e[1].consent)==null?void 0:de.mask_saving)!=null?qe:"Saving"}}),{c(){t=m("div"),l=m("div"),n=m("form"),i=m("div"),f=k(o),r=b(),c=m("hr"),a=b(),_=m("div"),v=k(p),d=m("br"),h=b(),g=m("a"),A=k(M),I=m("br"),O=b(),L=m("label"),q=m("input"),E=b(),z=k(F),G=b(),B=m("label"),R=m("input"),y=b(),Y=k(H),X=m("br"),J=b(),$=m("div"),ce=m("button"),oe=k(ie),ae=b(),Ne(se.$$.fragment),u(g,"href",zl("Data-collection-on-one-click-firmware-upgrade")),u(g,"target","_blank"),u(g,"class","text-blue-600 hover:text-blue-800"),u(q,"type","radio"),u(q,"name","sf"),q.value=1,q.checked=U=e[0].fwconsent===1,u(q,"class","rounded m-2"),q.required=!0,u(R,"type","radio"),u(R,"name","sf"),R.value=2,R.checked=K=e[0].fwconsent===2,u(R,"class","rounded m-2"),R.required=!0,u(_,"class","my-3"),u(ce,"type","submit"),u(ce,"class","btn-pri"),u($,"class","my-3"),u(n,"autocomplete","off"),u(l,"class","cnt"),u(t,"class","grid xl:grid-cols-3 lg:grid-cols-2")},m(Pe,we){P(Pe,t,we),s(t,l),s(l,n),s(n,i),s(i,f),s(n,r),s(n,c),s(n,a),s(n,_),s(_,v),s(_,d),s(_,h),s(_,g),s(g,A),s(_,I),s(_,O),s(_,L),s(L,q),s(L,E),s(L,z),s(_,G),s(_,B),s(B,R),s(B,y),s(B,Y),s(_,X),s(n,J),s(n,$),s($,ce),s(ce,oe),P(Pe,ae,we),Se(se,Pe,we),x=!0,me||(pe=re(n,"submit",fs(e[3])),me=!0)},p(Pe,[we]){var Ae,ke,De,He,Oe,je,Qe,We,Je,$e,tt,Te,ue,Ie;(!x||we&2)&&o!==(o=((ke=(Ae=Pe[1].consent)==null?void 0:Ae.title)!=null?ke:"Consents")+"")&&C(f,o),(!x||we&2)&&p!==(p=((He=(De=Pe[1].consent)==null?void 0:De.one_click)!=null?He:"One-click")+"")&&C(v,p),(!x||we&2)&&M!==(M=((je=(Oe=Pe[1].consent)==null?void 0:Oe.read_more)!=null?je:"Read more")+"")&&C(A,M),(!x||we&1&&U!==(U=Pe[0].fwconsent===1))&&(q.checked=U),(!x||we&2)&&F!==(F=((We=(Qe=Pe[1].consent)==null?void 0:Qe.yes)!=null?We:"Yes")+"")&&C(z,F),(!x||we&1&&K!==(K=Pe[0].fwconsent===2))&&(R.checked=K),(!x||we&2)&&H!==(H=(($e=(Je=Pe[1].consent)==null?void 0:Je.no)!=null?$e:"No")+"")&&C(Y,H),(!x||we&2)&&ie!==(ie=((Te=(tt=Pe[1].btn)==null?void 0:tt.save)!=null?Te:"Save")+"")&&C(oe,ie);const Fe={};we&4&&(Fe.active=Pe[2]),we&2&&(Fe.message=(Ie=(ue=Pe[1].consent)==null?void 0:ue.mask_saving)!=null?Ie:"Saving"),se.$set(Fe)},i(Pe){x||(Q(se.$$.fragment,Pe),x=!0)},o(Pe){ee(se.$$.fragment,Pe),x=!1},d(Pe){Pe&&T(t),Pe&&T(ae),Ce(se,Pe),me=!1,pe()}}}function Yg(e,t,l){let{basepath:n="/"}=t,{sysinfo:i={}}=t,o={};Ml.subscribe(c=>{l(1,o=c)});let f=!1;async function r(c){l(2,f=!0);const a=new FormData(c.target),_=new URLSearchParams;for(let d of a){const[h,g]=d;_.append(h,g)}let v=await(await fetch("save",{method:"POST",body:_})).json();l(2,f=!1),wl.update(d=>(d.fwconsent=a.sf===!0?1:a.sf===!1?2:0,d.booting=v.reboot,d)),gi(n)}return e.$$set=c=>{"basepath"in c&&l(4,n=c.basepath),"sysinfo"in c&&l(0,i=c.sysinfo)},[i,o,f,r,n]}class Qg extends mt{constructor(t){super(),_t(this,t,Yg,Kg,ct,{basepath:4,sysinfo:0})}}function Ld(e,t,l){const n=e.slice();return n[24]=t[l],n[25]=t,n[26]=l,n}function Rd(e,t,l){const n=e.slice();return n[27]=t[l],n[29]=l,n}function Xg(e,t,l){const n=e.slice();return n[27]=t[l],n[29]=l,n}function Fd(e,t,l){const n=e.slice();return n[27]=t[l],n[29]=l,n}function Zg(e,t,l){const n=e.slice();return n[27]=t[l],n[29]=l,n}function Bd(e,t,l){const n=e.slice();return n[27]=t[l],n[29]=l,n}function Ud(e,t,l){const n=e.slice();return n[27]=t[l],n[29]=l,n}function jd(e,t,l){const n=e.slice();return n[27]=t[l],n[29]=l,n}function Hd(e,t,l){const n=e.slice();return n[27]=t[l],n[29]=l,n}function yd(e){let t,l=e[1].o,n=[];for(let i=0;i{l(0,i=B)});let o=["mo","tu","we","th","fr","sa","su"],f={},r=!0,c=!1;Wv.subscribe(B=>{B.o&&(l(1,f=B),l(2,r=!1))}),U4();async function a(B){l(3,c=!0);const R=new URLSearchParams;R.append("r","true"),R.append("rc",f.o.length),f.o.forEach(function(y,H){R.append("rt"+H,y.t),R.append("rn"+H,y.n),R.append("rd"+H,y.d),R.append("ra"+H,y.a),R.append("rh"+H,y.h),R.append("rv"+H,y.v),R.append("rsm"+H,y.s.m),R.append("rsd"+H,y.s.d),R.append("rem"+H,y.e.m),R.append("red"+H,y.e.d)}),await(await fetch("save",{method:"POST",body:R})).json(),l(3,c=!1),gi(n+"configuration")}let _=function(B,R){return B.includes(R)?B=B.filter(function(K){return K!==R}):B.push(R),B},p=function(){let B=f.o;B.push({t:1,n:"",d:3,a:[0,1,2,3,4,5,6,7],h:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23],v:.001,s:{m:0,d:0},e:{m:0,d:0}}),l(1,f.o=B,f)},v=function(B){let R=f.o;R.splice(B,1),l(1,f.o=R,f)};function d(B,R){B[R].n=this.value,l(1,f)}function h(B,R){B[R].d=Ft(this),l(1,f)}function g(B,R){B[R].t=Ft(this),l(1,f)}function M(B,R){B[R].v=Xe(this.value),l(1,f)}const A=(B,R,K,y)=>l(1,K[y].a=_(B.a,R),f),I=(B,R,K,y)=>l(1,K[y].h=_(B.h,R),f),O=(B,R,K,y)=>l(1,K[y].h=_(B.h,R+8),f),L=(B,R,K,y)=>l(1,K[y].h=_(B.h,R+16),f);function q(B,R){B[R].s.m=Ft(this),l(1,f)}function U(B,R){B[R].s.d=Ft(this),l(1,f)}function E(B,R){B[R].e.m=Ft(this),l(1,f)}function F(B,R){B[R].e.d=Ft(this),l(1,f)}const z=B=>v(B),G=B=>v(B);return e.$$set=B=>{"basepath"in B&&l(9,n=B.basepath)},[i,f,r,c,o,a,_,p,v,n,d,h,g,M,A,I,O,L,q,U,E,F,z,G]}class t3 extends mt{constructor(t){super(),_t(this,t,e3,xg,ct,{basepath:9},null,[-1,-1])}}function l3(e){let t,l;return t=new F4({props:{data:e[2],sysinfo:e[1]}}),{c(){Ne(t.$$.fragment)},m(n,i){Se(t,n,i),l=!0},p(n,i){const o={};i&4&&(o.data=n[2]),i&2&&(o.sysinfo=n[1]),t.$set(o)},i(n){l||(Q(t.$$.fragment,n),l=!0)},o(n){ee(t.$$.fragment,n),l=!1},d(n){Ce(t,n)}}}function n3(e){let t,l;return t=new Mg({props:{sysinfo:e[1],basepath:e[0]}}),{c(){Ne(t.$$.fragment)},m(n,i){Se(t,n,i),l=!0},p(n,i){const o={};i&2&&(o.sysinfo=n[1]),i&1&&(o.basepath=n[0]),t.$set(o)},i(n){l||(Q(t.$$.fragment,n),l=!0)},o(n){ee(t.$$.fragment,n),l=!1},d(n){Ce(t,n)}}}function i3(e){let t,l;return t=new t3({props:{basepath:e[0]}}),{c(){Ne(t.$$.fragment)},m(n,i){Se(t,n,i),l=!0},p(n,i){const o={};i&1&&(o.basepath=n[0]),t.$set(o)},i(n){l||(Q(t.$$.fragment,n),l=!0)},o(n){ee(t.$$.fragment,n),l=!1},d(n){Ce(t,n)}}}function s3(e){let t,l;return t=new Lg({props:{sysinfo:e[1],data:e[2]}}),{c(){Ne(t.$$.fragment)},m(n,i){Se(t,n,i),l=!0},p(n,i){const o={};i&2&&(o.sysinfo=n[1]),i&4&&(o.data=n[2]),t.$set(o)},i(n){l||(Q(t.$$.fragment,n),l=!0)},o(n){ee(t.$$.fragment,n),l=!1},d(n){Ce(t,n)}}}function o3(e){let t,l;return t=new Af({props:{title:"CA",action:"/mqtt-ca"}}),{c(){Ne(t.$$.fragment)},m(n,i){Se(t,n,i),l=!0},p:ze,i(n){l||(Q(t.$$.fragment,n),l=!0)},o(n){ee(t.$$.fragment,n),l=!1},d(n){Ce(t,n)}}}function a3(e){let t,l;return t=new Af({props:{title:"certificate",action:"/mqtt-cert"}}),{c(){Ne(t.$$.fragment)},m(n,i){Se(t,n,i),l=!0},p:ze,i(n){l||(Q(t.$$.fragment,n),l=!0)},o(n){ee(t.$$.fragment,n),l=!1},d(n){Ce(t,n)}}}function f3(e){let t,l;return t=new Af({props:{title:"private key",action:"/mqtt-key"}}),{c(){Ne(t.$$.fragment)},m(n,i){Se(t,n,i),l=!0},p:ze,i(n){l||(Q(t.$$.fragment,n),l=!0)},o(n){ee(t.$$.fragment,n),l=!1},d(n){Ce(t,n)}}}function u3(e){let t,l;return t=new Qg({props:{sysinfo:e[1],basepath:e[0]}}),{c(){Ne(t.$$.fragment)},m(n,i){Se(t,n,i),l=!0},p(n,i){const o={};i&2&&(o.sysinfo=n[1]),i&1&&(o.basepath=n[0]),t.$set(o)},i(n){l||(Q(t.$$.fragment,n),l=!0)},o(n){ee(t.$$.fragment,n),l=!1},d(n){Ce(t,n)}}}function r3(e){let t,l;return t=new Wg({props:{sysinfo:e[1]}}),{c(){Ne(t.$$.fragment)},m(n,i){Se(t,n,i),l=!0},p(n,i){const o={};i&2&&(o.sysinfo=n[1]),t.$set(o)},i(n){l||(Q(t.$$.fragment,n),l=!0)},o(n){ee(t.$$.fragment,n),l=!1},d(n){Ce(t,n)}}}function c3(e){let t,l;return t=new Hg({props:{sysinfo:e[1],basepath:e[0]}}),{c(){Ne(t.$$.fragment)},m(n,i){Se(t,n,i),l=!0},p(n,i){const o={};i&2&&(o.sysinfo=n[1]),i&1&&(o.basepath=n[0]),t.$set(o)},i(n){l||(Q(t.$$.fragment,n),l=!0)},o(n){ee(t.$$.fragment,n),l=!1},d(n){Ce(t,n)}}}function _3(e){let t,l,n,i,o,f,r,c,a,_,p,v,d,h,g,M,A,I,O,L,q,U;return t=new Yb({props:{data:e[2],basepath:e[0]}}),n=new Cn({props:{path:"/",$$slots:{default:[l3]},$$scope:{ctx:e}}}),o=new Cn({props:{path:"/configuration",$$slots:{default:[n3]},$$scope:{ctx:e}}}),r=new Cn({props:{path:"/priceconfig",$$slots:{default:[i3]},$$scope:{ctx:e}}}),a=new Cn({props:{path:"/status",$$slots:{default:[s3]},$$scope:{ctx:e}}}),p=new Cn({props:{path:"/mqtt-ca",$$slots:{default:[o3]},$$scope:{ctx:e}}}),d=new Cn({props:{path:"/mqtt-cert",$$slots:{default:[a3]},$$scope:{ctx:e}}}),g=new Cn({props:{path:"/mqtt-key",$$slots:{default:[f3]},$$scope:{ctx:e}}}),A=new Cn({props:{path:"/consent",$$slots:{default:[u3]},$$scope:{ctx:e}}}),O=new Cn({props:{path:"/setup",$$slots:{default:[r3]},$$scope:{ctx:e}}}),q=new Cn({props:{path:"/vendor",$$slots:{default:[c3]},$$scope:{ctx:e}}}),{c(){Ne(t.$$.fragment),l=b(),Ne(n.$$.fragment),i=b(),Ne(o.$$.fragment),f=b(),Ne(r.$$.fragment),c=b(),Ne(a.$$.fragment),_=b(),Ne(p.$$.fragment),v=b(),Ne(d.$$.fragment),h=b(),Ne(g.$$.fragment),M=b(),Ne(A.$$.fragment),I=b(),Ne(O.$$.fragment),L=b(),Ne(q.$$.fragment)},m(E,F){Se(t,E,F),P(E,l,F),Se(n,E,F),P(E,i,F),Se(o,E,F),P(E,f,F),Se(r,E,F),P(E,c,F),Se(a,E,F),P(E,_,F),Se(p,E,F),P(E,v,F),Se(d,E,F),P(E,h,F),Se(g,E,F),P(E,M,F),Se(A,E,F),P(E,I,F),Se(O,E,F),P(E,L,F),Se(q,E,F),U=!0},p(E,F){const z={};F&4&&(z.data=E[2]),F&1&&(z.basepath=E[0]),t.$set(z);const G={};F&22&&(G.$$scope={dirty:F,ctx:E}),n.$set(G);const B={};F&19&&(B.$$scope={dirty:F,ctx:E}),o.$set(B);const R={};F&17&&(R.$$scope={dirty:F,ctx:E}),r.$set(R);const K={};F&22&&(K.$$scope={dirty:F,ctx:E}),a.$set(K);const y={};F&16&&(y.$$scope={dirty:F,ctx:E}),p.$set(y);const H={};F&16&&(H.$$scope={dirty:F,ctx:E}),d.$set(H);const Y={};F&16&&(Y.$$scope={dirty:F,ctx:E}),g.$set(Y);const X={};F&19&&(X.$$scope={dirty:F,ctx:E}),A.$set(X);const J={};F&18&&(J.$$scope={dirty:F,ctx:E}),O.$set(J);const $={};F&19&&($.$$scope={dirty:F,ctx:E}),q.$set($)},i(E){U||(Q(t.$$.fragment,E),Q(n.$$.fragment,E),Q(o.$$.fragment,E),Q(r.$$.fragment,E),Q(a.$$.fragment,E),Q(p.$$.fragment,E),Q(d.$$.fragment,E),Q(g.$$.fragment,E),Q(A.$$.fragment,E),Q(O.$$.fragment,E),Q(q.$$.fragment,E),U=!0)},o(E){ee(t.$$.fragment,E),ee(n.$$.fragment,E),ee(o.$$.fragment,E),ee(r.$$.fragment,E),ee(a.$$.fragment,E),ee(p.$$.fragment,E),ee(d.$$.fragment,E),ee(g.$$.fragment,E),ee(A.$$.fragment,E),ee(O.$$.fragment,E),ee(q.$$.fragment,E),U=!1},d(E){Ce(t,E),E&&T(l),Ce(n,E),E&&T(i),Ce(o,E),E&&T(f),Ce(r,E),E&&T(c),Ce(a,E),E&&T(_),Ce(p,E),E&&T(v),Ce(d,E),E&&T(h),Ce(g,E),E&&T(M),Ce(A,E),E&&T(I),Ce(O,E),E&&T(L),Ce(q,E)}}}function m3(e){let t,l,n,i;const o=[v3,d3],f=[];function r(c,a){return c[1].trying?0:1}return t=r(e),l=f[t]=o[t](e),{c(){l.c(),n=Ut()},m(c,a){f[t].m(c,a),P(c,n,a),i=!0},p(c,a){let _=t;t=r(c),t===_?f[t].p(c,a):(pt(),ee(f[_],1,1,()=>{f[_]=null}),dt(),l=f[t],l?l.p(c,a):(l=f[t]=o[t](c),l.c()),Q(l,1),l.m(n.parentNode,n))},i(c){i||(Q(l),i=!0)},o(c){ee(l),i=!1},d(c){f[t].d(c),c&&T(n)}}}function p3(e){let t,l;return t=new kl({props:{active:"true",message:"Device is upgrading, please wait"}}),{c(){Ne(t.$$.fragment)},m(n,i){Se(t,n,i),l=!0},p:ze,i(n){l||(Q(t.$$.fragment,n),l=!0)},o(n){ee(t.$$.fragment,n),l=!1},d(n){Ce(t,n)}}}function d3(e){let t,l;return t=new kl({props:{active:"true",message:"Device is booting, please wait"}}),{c(){Ne(t.$$.fragment)},m(n,i){Se(t,n,i),l=!0},p:ze,i(n){l||(Q(t.$$.fragment,n),l=!0)},o(n){ee(t.$$.fragment,n),l=!1},d(n){Ce(t,n)}}}function v3(e){let t,l;return t=new kl({props:{active:"true",message:"Device is booting, please wait. Trying to reach it on "+e[1].trying}}),{c(){Ne(t.$$.fragment)},m(n,i){Se(t,n,i),l=!0},p(n,i){const o={};i&2&&(o.message="Device is booting, please wait. Trying to reach it on "+n[1].trying),t.$set(o)},i(n){l||(Q(t.$$.fragment,n),l=!0)},o(n){ee(t.$$.fragment,n),l=!1},d(n){Ce(t,n)}}}function h3(e){let t,l,n,i,o,f;l=new Mv({props:{basepath:e[0],$$slots:{default:[_3]},$$scope:{ctx:e}}});const r=[p3,m3],c=[];function a(_,p){return _[1].upgrading?0:_[1].booting?1:-1}return~(i=a(e))&&(o=c[i]=r[i](e)),{c(){t=m("div"),Ne(l.$$.fragment),n=b(),o&&o.c(),u(t,"class","container mx-auto m-3")},m(_,p){P(_,t,p),Se(l,t,null),s(t,n),~i&&c[i].m(t,null),f=!0},p(_,[p]){const v={};p&1&&(v.basepath=_[0]),p&23&&(v.$$scope={dirty:p,ctx:_}),l.$set(v);let d=i;i=a(_),i===d?~i&&c[i].p(_,p):(o&&(pt(),ee(c[d],1,1,()=>{c[d]=null}),dt()),~i?(o=c[i],o?o.p(_,p):(o=c[i]=r[i](_),o.c()),Q(o,1),o.m(t,null)):o=null)},i(_){f||(Q(l.$$.fragment,_),Q(o),f=!0)},o(_){ee(l.$$.fragment,_),ee(o),f=!1},d(_){_&&T(t),Ce(l),~i&&c[i].d()}}}function b3(e,t,l){let n=document.getElementsByTagName("base")[0].getAttribute("href");n||(n="/");let i={};Ml.subscribe(r=>{i=r});let o={};wl.subscribe(r=>{var c;l(1,o=r),o.vndcfg===!1?gi(n+"vendor"):o.usrcfg===!1?gi(n+"setup"):o.fwconsent===0&&gi(n+"consent"),o.ui.k===1?document.documentElement.classList.add("dark"):o.ui.k===0?document.documentElement.classList.remove("dark"):window.matchMedia("(prefers-color-scheme: dark)").matches?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark"),o.ui.lang&&o.ui.lang!=((c=i==null?void 0:i.language)==null?void 0:c.code)&&Uv(o.ui.lang)}),Sf();let f={};return Ev.subscribe(r=>{l(2,f=r)}),[n,o,f]}class g3 extends mt{constructor(t){super(),_t(this,t,b3,h3,ct,{})}}new g3({target:document.getElementById("app")}); +Occurred in: ${i}`:"",f=kf(e),r=tv(t)?t(f):t;return`<${f}> ${r}${o}`}const dv=e=>(...t)=>e(kh(...t)),vv=dv(e=>{throw new Error(e)}),Vo=dv(console.warn),Y_=4,wh=3,Mh=2,Sh=1,Ch=1;function Nh(e,t){const l=e.default?0:Pn(e.fullPath).reduce((n,i)=>{let o=n;return o+=Y_,ch(i)?o+=Ch:mh(i)?o+=Mh:uv(i)?o-=Y_+Sh:o+=wh,o},0);return{route:e,score:l,index:t}}function Th(e){return e.map(Nh).sort((t,l)=>t.scorel.score?-1:t.index-l.index)}function hv(e,t){let l,n;const[i]=t.split("?"),o=Pn(i),f=o[0]==="",r=Th(e);for(let c=0,a=r.length;c({...m,params:v,uri:A});if(m.default){n=d(t);continue}const h=Pn(m.fullPath),g=Math.max(o.length,h.length);let M=0;for(;M{a===".."?c.pop():a!=="."&&c.push(a)}),Wa(`/${c.join("/")}`,n)}function Q_(e,t){const{pathname:l,hash:n="",search:i="",state:o}=e,f=Pn(t,!0),r=Pn(l,!0);for(;f.length;)f[0]!==r[0]&&vv(ki,`Invalid state: All locations must begin with the basepath "${t}", found "${l}"`),f.shift(),r.shift();return{pathname:js(...r),hash:n,search:i,state:o}}const X_=e=>e.length===1?"":e,wf=e=>{const t=e.indexOf("?"),l=e.indexOf("#"),n=t!==-1,i=l!==-1,o=i?X_(As(e,l)):"",f=i?As(e,0,l):e,r=n?X_(As(f,t)):"";return{pathname:(n?As(f,0,t):f)||"/",search:r,hash:o}},Eh=e=>{const{pathname:t,search:l,hash:n}=e;return t+l+n};function Ah(e,t,l){return js(l,Ph(e,t))}function Dh(e,t){const l=bf(_h(e)),n=Pn(l,!0),i=Pn(t,!0).slice(0,n.length),o=bv({fullPath:l},js(...i));return o&&o.uri}const Ga="POP",qh="PUSH",Oh="REPLACE";function Va(e){return{...e.location,pathname:encodeURI(decodeURI(e.location.pathname)),state:e.history.state,_key:e.history.state&&e.history.state._key||"initial"}}function Ih(e){let t=[],l=Va(e),n=Ga;const i=(o=t)=>o.forEach(f=>f({location:l,action:n}));return{get location(){return l},listen(o){t.push(o);const f=()=>{l=Va(e),n=Ga,i([o])};i([o]);const r=iv(e,"popstate",f);return()=>{r(),t=t.filter(c=>c!==o)}},navigate(o,f){const{state:r={},replace:c=!1}=f||{};if(n=c?Oh:qh,lv(o))f&&Vo(pv,"Navigation options (state or replace) are not supported, when passing a number as the first argument to navigate. They are ignored."),n=Ga,e.history.go(o);else{const a={...r,_key:ah()};try{e.history[c?"replaceState":"pushState"](a,"",o)}catch{e.location[c?"replace":"assign"](o)}}l=Va(e),i()}}}function Ka(e,t){return{...wf(t),state:e}}function Lh(e="/"){let t=0,l=[Ka(null,e)];return{get entries(){return l},get location(){return l[t]},addEventListener(){},removeEventListener(){},history:{get state(){return l[t].state},pushState(n,i,o){t++,l=l.slice(0,t),l.push(Ka(n,o))},replaceState(n,i,o){l[t]=Ka(n,o)},go(n){const i=t+n;i<0||i>l.length-1||(t=i)}}}}const Rh=!!(!ei&&window.document&&window.document.createElement),Fh=!ei&&window.location.origin==="null",gv=Ih(Rh&&!Fh?window:Lh()),{navigate:gi}=gv;let yn=null,kv=!0;function Bh(e,t){const l=document.querySelectorAll("[data-svnav-router]");for(let n=0;nyn.level||e.level===yn.level&&Bh(e.routerId,yn.routerId))&&(yn=e)}function jh(){yn=null}function Hh(){kv=!1}function Z_(e){if(!e)return!1;const t="tabindex";try{if(!e.hasAttribute(t)){e.setAttribute(t,"-1");let l;l=iv(e,"blur",()=>{e.removeAttribute(t),l()})}return e.focus(),document.activeElement===e}catch{return!1}}function yh(e,t){return Number(e.dataset.svnavRouteEnd)===t}function zh(e){return/^H[1-6]$/i.test(e.tagName)}function J_(e,t=document){return t.querySelector(e)}function Wh(e){let l=J_(`[data-svnav-route-start="${e}"]`).nextElementSibling;for(;!yh(l,e);){if(zh(l))return l;const n=J_("h1,h2,h3,h4,h5,h6",l);if(n)return n;l=l.nextElementSibling}return null}function Gh(e){Promise.resolve(ss(e.focusElement)).then(t=>{const l=t||Wh(e.id);l||Vo(ki,`Could not find an element to focus. You should always render a header for accessibility reasons, or set a custom focus element via the "useFocus" hook. If you don't want this Route or Router to manage focus, pass "primary={false}" to it.`,e,Qo),!Z_(l)&&Z_(document.documentElement)})}const Vh=(e,t,l)=>(n,i)=>lh().then(()=>{if(!yn||kv){Hh();return}if(n&&Gh(yn.route),e.announcements&&i){const{path:o,fullPath:f,meta:r,params:c,uri:a}=yn.route,m=e.createAnnouncement({path:o,fullPath:f,meta:r,params:c,uri:a},ss(l));Promise.resolve(m).then(p=>{t.set(p)})}jh()}),Kh="position:fixed;top:-1px;left:0;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;";function Yh(e){let t,l,n=[{role:"status"},{"aria-atomic":"true"},{"aria-live":"polite"},{"data-svnav-announcer":""},sv(e[6],Kh)],i={};for(let o=0;o`Navigated to ${ie.uri}`,announcements:!0,...h},A=m,I=bf(m),O=xn(Ja),L=xn(as),q=!O,U=Xh(),P=d&&!(L&&!L.manageFocus),F=xt("");Nn(e,F,ie=>l(0,r=ie));const z=L?L.disableInlineStyles:g,G=xt([]);Nn(e,G,ie=>l(20,f=ie));const B=xt(null);Nn(e,B,ie=>l(18,i=ie));let R=!1;const K=q?0:L.level+1,H=q?xt((()=>Q_(ei?wf(p):v.location,I))()):O;Nn(e,H,ie=>l(17,n=ie));const Y=xt(n);Nn(e,Y,ie=>l(19,o=ie));const X=Vh(M,F,H),J=ie=>oe=>oe.filter(ae=>ae.id!==ie);function $(ie){if(ei){if(R)return;const oe=bv(ie,n.pathname);if(oe)return R=!0,oe}else G.update(oe=>{const ae=J(ie.id)(oe);return ae.push(ie),ae})}function ce(ie){G.update(J(ie))}return!q&&m!==$_&&Vo(ki,'Only top-level Routers can have a "basepath" prop. It is ignored.',{basepath:m}),q&&(Zd(()=>v.listen(oe=>{const ae=Q_(oe.location,I);Y.set(n),H.set(ae)})),Is(Ja,H)),Is(as,{activeRoute:B,registerRoute:$,unregisterRoute:ce,manageFocus:P,level:K,id:U,history:q?v:L.history,basepath:q?I:L.basepath,disableInlineStyles:z}),e.$$set=ie=>{"basepath"in ie&&l(11,m=ie.basepath),"url"in ie&&l(12,p=ie.url),"history"in ie&&l(13,v=ie.history),"primary"in ie&&l(14,d=ie.primary),"a11y"in ie&&l(15,h=ie.a11y),"disableInlineStyles"in ie&&l(16,g=ie.disableInlineStyles),"$$scope"in ie&&l(21,a=ie.$$scope)},e.$$.update=()=>{if(e.$$.dirty[0]&2048&&m!==A&&Vo(ki,'You cannot change the "basepath" prop. It is ignored.'),e.$$.dirty[0]&1179648){const ie=hv(f,n.pathname);B.set(ie)}if(e.$$.dirty[0]&655360&&q){const ie=!!n.hash,oe=!ie&&P,ae=!ie||n.pathname!==o.pathname;X(oe,ae)}e.$$.dirty[0]&262144&&P&&i&&i.primary&&Uh({level:K,routerId:U,route:i})},[r,M,q,U,P,F,z,G,B,H,Y,m,p,v,d,h,g,n,i,o,f,a,c]}class Jh extends _t{constructor(t){super(),mt(this,t,Zh,Qh,ct,{basepath:11,url:12,history:13,primary:14,a11y:15,disableInlineStyles:16},null,[-1,-1])}}const wv=Jh;function Hs(e,t,l=as,n=ki){xn(l)||vv(e,o=>`You cannot use ${o} outside of a ${kf(n)}.`,t)}const $h=e=>{const{subscribe:t}=xn(e);return{subscribe:t}};function Mv(){return Hs(cv),$h(Ja)}function Sv(){const{history:e}=xn(as);return e}function Cv(){const e=xn(av);return e?fh(e,t=>t.base):xt("/")}function Nv(){Hs(_v);const e=Cv(),{basepath:t}=xn(as);return n=>Ah(n,ss(e),t)}function xh(){Hs(mv);const e=Nv(),{navigate:t}=Sv();return(n,i)=>{const o=lv(n)?n:e(n);return t(o,i)}}const eb=e=>({params:e&16,location:e&8}),x_=e=>({params:ei?ss(e[10]):e[4],location:e[3],navigate:e[11]});function ep(e){let t,l;return t=new wv({props:{primary:e[1],$$slots:{default:[nb]},$$scope:{ctx:e}}}),{c(){Ne(t.$$.fragment)},m(n,i){Se(t,n,i),l=!0},p(n,i){const o={};i&2&&(o.primary=n[1]),i&528409&&(o.$$scope={dirty:i,ctx:n}),t.$set(o)},i(n){l||(Q(t.$$.fragment,n),l=!0)},o(n){ee(t.$$.fragment,n),l=!1},d(n){Ce(t,n)}}}function tb(e){let t;const l=e[18].default,n=_f(l,e,e[19],x_);return{c(){n&&n.c()},m(i,o){n&&n.m(i,o),t=!0},p(i,o){n&&n.p&&(!t||o&524312)&&df(n,l,i,i[19],t?pf(l,i[19],o,eb):vf(i[19]),x_)},i(i){t||(Q(n,i),t=!0)},o(i){ee(n,i),t=!1},d(i){n&&n.d(i)}}}function lb(e){let t,l,n;const i=[{location:e[3]},{navigate:e[11]},ei?ss(e[10]):e[4],e[12]];var o=e[0];function f(r){let c={};for(let a=0;a{Ce(m,1)}),dt()}o?(t=W_(o,f()),Ne(t.$$.fragment),Q(t.$$.fragment,1),Se(t,l.parentNode,l)):t=null}else o&&t.$set(a)},i(r){n||(t&&Q(t.$$.fragment,r),n=!0)},o(r){t&&ee(t.$$.fragment,r),n=!1},d(r){r&&T(l),t&&Ce(t,r)}}}function nb(e){let t,l,n,i;const o=[lb,tb],f=[];function r(c,a){return c[0]!==null?0:1}return t=r(e),l=f[t]=o[t](e),{c(){l.c(),n=Ut()},m(c,a){f[t].m(c,a),E(c,n,a),i=!0},p(c,a){let m=t;t=r(c),t===m?f[t].p(c,a):(pt(),ee(f[m],1,1,()=>{f[m]=null}),dt(),l=f[t],l?l.p(c,a):(l=f[t]=o[t](c),l.c()),Q(l,1),l.m(n.parentNode,n))},i(c){i||(Q(l),i=!0)},o(c){ee(l),i=!1},d(c){f[t].d(c),c&&T(n)}}}function ib(e){let t,l,n,i,o,f=[Za(e[7]),{"data-svnav-route-start":e[5]}],r={};for(let p=0;p{c=null}),dt())},i(p){o||(Q(c),o=!0)},o(p){ee(c),o=!1},d(p){p&&T(t),p&&T(l),c&&c.d(p),p&&T(n),p&&T(i)}}}const sb=nv();function ob(e,t,l){let n;const i=["path","component","meta","primary"];let o=Wo(t,i),f,r,c,a,{$$slots:m={},$$scope:p}=t,{path:v=""}=t,{component:d=null}=t,{meta:h={}}=t,{primary:g=!0}=t;Hs(Qo,t);const M=sb(),{registerRoute:A,unregisterRoute:I,activeRoute:O,disableInlineStyles:L}=xn(as);Nn(e,O,R=>l(16,f=R));const q=Cv();Nn(e,q,R=>l(17,c=R));const U=Mv();Nn(e,U,R=>l(3,r=R));const P=xt(null);let F;const z=xt(),G=xt({});Nn(e,G,R=>l(4,a=R)),Is(av,z),Is(uh,G),Is(rh,P);const B=xh();return ei||eh(()=>I(M)),e.$$set=R=>{l(24,t=pn(pn({},t),zo(R))),l(12,o=Wo(t,i)),"path"in R&&l(13,v=R.path),"component"in R&&l(0,d=R.component),"meta"in R&&l(14,h=R.meta),"primary"in R&&l(1,g=R.primary),"$$scope"in R&&l(19,p=R.$$scope)},e.$$.update=()=>{if(e.$$.dirty&155658){const R=v==="",K=js(c,v),y={id:M,path:v,meta:h,default:R,fullPath:R?"":K,base:R?c:Dh(K,r.pathname),primary:g,focusElement:P};z.set(y),l(15,F=A(y))}if(e.$$.dirty&98304&&l(2,n=!!(F||f&&f.id===M)),e.$$.dirty&98308&&n){const{params:R}=F||f;G.set(R)}},t=zo(t),[d,g,n,r,a,M,O,L,q,U,G,B,o,v,h,F,f,c,m,p]}class ab extends _t{constructor(t){super(),mt(this,t,ob,ib,ct,{path:13,component:0,meta:14,primary:1})}}const Cn=ab;function fb(e){let t,l,n,i;const o=e[13].default,f=_f(o,e,e[12],null);let r=[{href:e[0]},e[2],e[1]],c={};for(let a=0;al(11,p=P));const O=th(),L=Nv(),{navigate:q}=Sv();function U(P){O("click",P),oh(P)&&(P.preventDefault(),q(n,{state:M,replace:f||g}))}return e.$$set=P=>{l(19,t=pn(pn({},t),zo(P))),l(18,m=Wo(t,a)),"to"in P&&l(5,h=P.to),"replace"in P&&l(6,g=P.replace),"state"in P&&l(7,M=P.state),"getProps"in P&&l(8,A=P.getProps),"$$scope"in P&&l(12,d=P.$$scope)},e.$$.update=()=>{e.$$.dirty&2080&&l(0,n=L(h,p)),e.$$.dirty&2049&&l(10,i=$a(p.pathname,n)),e.$$.dirty&2049&&l(9,o=n===p.pathname),e.$$.dirty&2049&&(f=wf(n)===Eh(p)),e.$$.dirty&512&&l(2,r=o?{"aria-current":"page"}:{}),l(1,c=(()=>{if(tv(A)){const P=A({location:p,href:n,isPartiallyCurrent:i,isCurrent:o});return{...m,...P}}return m})())},t=zo(t),[n,c,r,I,U,h,g,M,A,o,i,p,d,v]}class rb extends _t{constructor(t){super(),mt(this,t,ub,fb,ct,{to:5,replace:6,state:7,getProps:8})}}const ln=rb;function $n(e){return e===1?"green":e===2?"yellow":e===3?"red":"gray"}function cb(e,t){return e>218&&e<242?"#23ac05":e>212&&e<248?"#b1d900":e>208&&e<252?"#a3b200":"#b20000"}function Mf(e,t){let l;return e>90?l="#b20000":e>85?l="#b19601":e>80?l="#a3b200":e>75?l="#569f12":l="#23ac05",l}function Rs(e){return e>75?"#23ac05":e>50?"#77d900":e>25?"#94d900":"#569f12"}function Ko(e){switch(e){case 1:return"Aidon";case 2:return"Kaifa";case 3:return"Kamstrup";case 8:return"Iskra";case 9:return"Landis+Gyr";case 10:return"Sagemcom";default:return"Unknown"}}function ht(e){for(e=e.toString();e.length<2;)e="0"+e;return e}function Ge(e,t){switch(t){case 5:switch(e){case"esp8266":return"Pow-K (GPIO12)";case"esp32s2":return"Pow-K+"}case 7:switch(e){case"esp8266":return"Pow-U (GPIO12)";case"esp32s2":return"Pow-U+"}case 6:return"Pow-P1";case 51:return"Wemos S2 mini";case 50:return"Generic ESP32-S2";case 201:return"Wemos LOLIN D32";case 202:return"Adafruit HUZZAH32";case 203:return"DevKitC";case 241:return"LilyGO T-ETH-POE";case 242:return"M5 PoESP32";case 243:return"WT32-ETH01";case 200:return"Generic ESP32";case 2:return"HAN Reader 2.0 by Max Spencer";case 0:return"Custom hardware by Roar Fredriksen";case 1:return"Kamstrup module by Egil Opsahl";case 8:return"\xB5HAN mosquito by dbeinder";case 3:return"Pow-K (UART0)";case 4:return"Pow-U (UART0)";case 101:return"Wemos D1 mini";case 100:return"Generic ESP8266";case 70:return"Generic ESP32-C3";case 71:return"ESP32-C3-DevKitM-1";case 80:return"Generic ESP32-S3"}}function is(e){switch(e){case 2:case 4:case 7:return!0}return!1}function Ot(e,t){return e==1||e==2&&t}function zl(e){return"https://github.com/UtilitechAS/amsreader-firmware/wiki/"+e}function Bt(e,t){return isNaN(e)?"-":(isNaN(t)&&(t=e<1?2:e<10?1:0),e.toFixed(t))}function Tn(e,t){return e.setTime(e.getTime()+t*36e5),e}function tp(e){return e=="EOE"?"ENTSO-E":e=="HKS"?"hvakosterstrommen.no":e=="EDS"?"Energi Data Service":e=="MIX"?"Mixed sources":"Unknown ("+e+")"}function lp(e){return e=="EOE"?"https://transparency.entsoe.eu/-E":e=="HKS"?"https://www.hvakosterstrommen.no/":e=="EDS"?"https://www.energidataservice.dk/":"#"}let Ro=0;function Fs(e,t){var l="";Ro++;var n=function(){setTimeout(Fs,1e3,e,t)};if(e.net.ip&&Ro%3==0){if(!e.net.ip){n();return}l="http://"+e.net.ip}else e.hostname&&Ro%3==1?l="http://"+e.hostname:e.hostname&&Ro%3==2?l="http://"+e.hostname+".local":l="";console&&console.log("Trying url "+l),t&&t(l);var i=new XMLHttpRequest;i.timeout=5e3,i.addEventListener("abort",n),i.addEventListener("error",n),i.addEventListener("timeout",n),i.addEventListener("load",function(o){window.location.href=l||"/"}),i.open("GET",l+"/is-alive",!0),i.send()}function Vt(e){return e.charAt(0).toUpperCase()+e.slice(1)}function np(e){return e.startsWith("esp32")?"esp32":e}function gl(e,t){let l=[e,t];return typeof e>"u"?(l[0]="-",l[1]=t):e>=1e9?(l[0]=(e/1e6).toFixed(e>1e10?0:1),l[1]="M"+t):e>1e4?(l[0]=(e/1e3).toFixed(e>1e6?0:e>1e5?1:2),l[1]="k"+t):(l[0]=e.toFixed(0),l[1]=t),l}let jo={},xa=[];async function mb(e,t={}){const{timeout:l=8e3}=t,n=new AbortController,i=setTimeout(()=>n.abort(),l),o=await fetch(e,{...t,signal:n.signal});return clearTimeout(i),o}let Ya;async function Tv(){if(xa.length){let e=xa.shift();delete jo[e.resource];let t=await mb(e.resource,e.options);for(let l in e.callbacks)e.callbacks[l](t)}Ya&&clearTimeout(Ya),Ya=setTimeout(Tv,100)}Tv();async function dn(e,t={}){let l;return jo[e]?l=jo[e]:(l={resource:e,options:t,callbacks:[]},jo[e]=l,xa.push(l)),new Promise(i=>l.callbacks.push(i))}let mn={version:"",chip:"",mac:null,apmac:null,vndcfg:null,usrcfg:null,fwconsent:null,booting:!1,upgrading:!1,ui:{},security:0,boot_reason:0,upgrade:{x:-1,e:0,f:null,t:null},trying:null,if:{eth:!1}};const wl=xt(mn);async function Sf(){mn=await(await dn("sysinfo.json?t="+Math.floor(Date.now()/1e3))).json(),wl.set(mn)}function _b(e){wl.update(t=>(t.trying=e,t))}let Fo=0,ip=-127,sp=null,pb={};const Pv=ov(pb,e=>{let t,l;async function n(){dn("data.json").then(i=>i.json()).then(i=>{e(i),ip!=i.t&&(ip=i.t,setTimeout(Ov,2e3)),sp==null&&i.pe&&i.p!=null&&(sp=i.p,Av()),mn.upgrading?window.location.reload():(!mn||!mn.chip||mn.booting||Fo>1&&!is(mn.board))&&(Sf(),di&&clearTimeout(di),di=setTimeout(Nf,2e3),vi&&clearTimeout(vi),vi=setTimeout(Tf,3e3));let o=5e3;if(is(mn.board)&&i.v>2.5){let f=3.3-Math.min(3.3,i.v);f>0&&(o=Math.max(f,.1)*10*5e3)}o>5e3&&console.log("Next in "+o+"ms"),t&&clearTimeout(t),t=setTimeout(n,o),Fo=0}).catch(i=>{Fo++,Fo>3?(e({em:3,hm:0,wm:0,mm:0}),t=setTimeout(n,15e3),l||(l=setTimeout(Fs,5e3,mn,_b))):t=setTimeout(n,is(mn.board)?1e4:5e3)})}return n(),function(){clearTimeout(t)}});let ef={},Ds;const Cf=xt(ef);async function Ev(){let e=!1;if(Cf.update(t=>{for(var l=0;l<36;l++){if(t[ht(l)]==null){e=l<12;break}t[ht(l)]=t[ht(l+1)]}return t}),e)Av();else{let t=new Date;Ds=setTimeout(Ev,(60-t.getMinutes())*6e4)}}async function Av(){Ds&&(clearTimeout(Ds),Ds=0),ef=await(await dn("energyprice.json")).json(),Cf.set(ef);let t=new Date;Ds=setTimeout(Ev,(60-t.getMinutes())*6e4)}let tf={},di;async function Nf(){di&&(clearTimeout(di),di=0),tf=await(await dn("dayplot.json")).json(),Dv.set(tf);let t=new Date;di=setTimeout(Nf,(60-t.getMinutes())*6e4+20)}const Dv=xt(tf,e=>(Nf(),function(){}));let lf={},vi;async function Tf(){vi&&(clearTimeout(vi),vi=0),lf=await(await dn("monthplot.json")).json(),qv.set(lf);let t=new Date;vi=setTimeout(Tf,(24-t.getHours())*36e5+40)}const qv=xt(lf,e=>(Tf(),function(){}));let nf={};async function Ov(){nf=await(await dn("temperature.json")).json(),Iv.set(nf)}const Iv=xt(nf,e=>(Ov(),function(){}));let sf={},Bo;async function Lv(){Bo&&(clearTimeout(Bo),Bo=0),sf=await(await dn("tariff.json")).json(),Rv.set(sf);let t=new Date;Bo=setTimeout(Lv,(60-t.getMinutes())*6e4+30)}const Rv=xt(sf,e=>function(){});let of=[];const Pf=xt(of);async function db(){of=await(await dn("https://api.github.com/repos/UtilitechAS/amsreader-firmware/releases")).json(),Pf.set(of)}let ts=0,vb={data:[]};async function Ho(){let t=await(await dn(ts<0?"realtime.json":"realtime.json?offset="+ts)).json();Fv.update(l=>{for(let n=0;n=0&&(ts+=t.size,tso&&(r=p):g==i+1&&(c=p);else if(h==n+1)if(a){let A=a.tag_name.substring(1).split(".");parseInt(A[0]);let I=parseInt(A[1]);parseInt(A[2]),g==I&&(a=p)}else a=p}return c||a||r||!1}else return t[0]}function ap(e){var c,a;let t=((a=(c=e[1].header)==null?void 0:c.uptime)!=null?a:"Up")+"",l,n,i;function o(m,p){return m[2]>1?Sb:m[2]>0?Mb:m[3]>1?wb:m[3]>0?kb:m[4]>1?gb:m[4]>0?bb:hb}let f=o(e),r=f(e);return{c(){l=k(t),n=b(),r.c(),i=Ut()},m(m,p){E(m,l,p),E(m,n,p),r.m(m,p),E(m,i,p)},p(m,p){var v,d;p&2&&t!==(t=((d=(v=m[1].header)==null?void 0:v.uptime)!=null?d:"Up")+"")&&C(l,t),f===(f=o(m))&&r?r.p(m,p):(r.d(1),r=f(m),r&&(r.c(),r.m(i.parentNode,i)))},d(m){m&&T(l),m&&T(n),r.d(m),m&&T(i)}}}function hb(e){var o,f;let t,l,n=((f=(o=e[1].common)==null?void 0:o.seconds)!=null?f:"s")+"",i;return{c(){t=k(e[0]),l=b(),i=k(n)},m(r,c){E(r,t,c),E(r,l,c),E(r,i,c)},p(r,c){var a,m;c&1&&C(t,r[0]),c&2&&n!==(n=((m=(a=r[1].common)==null?void 0:a.seconds)!=null?m:"s")+"")&&C(i,n)},d(r){r&&T(t),r&&T(l),r&&T(i)}}}function bb(e){var o,f;let t,l,n=((f=(o=e[1].common)==null?void 0:o.minute)!=null?f:"m")+"",i;return{c(){t=k(e[4]),l=b(),i=k(n)},m(r,c){E(r,t,c),E(r,l,c),E(r,i,c)},p(r,c){var a,m;c&16&&C(t,r[4]),c&2&&n!==(n=((m=(a=r[1].common)==null?void 0:a.minute)!=null?m:"m")+"")&&C(i,n)},d(r){r&&T(t),r&&T(l),r&&T(i)}}}function gb(e){var o,f;let t,l,n=((f=(o=e[1].common)==null?void 0:o.minutes)!=null?f:"m")+"",i;return{c(){t=k(e[4]),l=b(),i=k(n)},m(r,c){E(r,t,c),E(r,l,c),E(r,i,c)},p(r,c){var a,m;c&16&&C(t,r[4]),c&2&&n!==(n=((m=(a=r[1].common)==null?void 0:a.minutes)!=null?m:"m")+"")&&C(i,n)},d(r){r&&T(t),r&&T(l),r&&T(i)}}}function kb(e){var o,f;let t,l,n=((f=(o=e[1].common)==null?void 0:o.hour)!=null?f:"h")+"",i;return{c(){t=k(e[3]),l=b(),i=k(n)},m(r,c){E(r,t,c),E(r,l,c),E(r,i,c)},p(r,c){var a,m;c&8&&C(t,r[3]),c&2&&n!==(n=((m=(a=r[1].common)==null?void 0:a.hour)!=null?m:"h")+"")&&C(i,n)},d(r){r&&T(t),r&&T(l),r&&T(i)}}}function wb(e){var o,f;let t,l,n=((f=(o=e[1].common)==null?void 0:o.hours)!=null?f:"h")+"",i;return{c(){t=k(e[3]),l=b(),i=k(n)},m(r,c){E(r,t,c),E(r,l,c),E(r,i,c)},p(r,c){var a,m;c&8&&C(t,r[3]),c&2&&n!==(n=((m=(a=r[1].common)==null?void 0:a.hours)!=null?m:"h")+"")&&C(i,n)},d(r){r&&T(t),r&&T(l),r&&T(i)}}}function Mb(e){var o,f;let t,l,n=((f=(o=e[1].common)==null?void 0:o.day)!=null?f:"d")+"",i;return{c(){t=k(e[2]),l=b(),i=k(n)},m(r,c){E(r,t,c),E(r,l,c),E(r,i,c)},p(r,c){var a,m;c&4&&C(t,r[2]),c&2&&n!==(n=((m=(a=r[1].common)==null?void 0:a.day)!=null?m:"d")+"")&&C(i,n)},d(r){r&&T(t),r&&T(l),r&&T(i)}}}function Sb(e){var o,f;let t,l,n=((f=(o=e[1].common)==null?void 0:o.days)!=null?f:"d")+"",i;return{c(){t=k(e[2]),l=b(),i=k(n)},m(r,c){E(r,t,c),E(r,l,c),E(r,i,c)},p(r,c){var a,m;c&4&&C(t,r[2]),c&2&&n!==(n=((m=(a=r[1].common)==null?void 0:a.days)!=null?m:"d")+"")&&C(i,n)},d(r){r&&T(t),r&&T(l),r&&T(i)}}}function Cb(e){let t,l=e[0]&&ap(e);return{c(){l&&l.c(),t=Ut()},m(n,i){l&&l.m(n,i),E(n,t,i)},p(n,[i]){n[0]?l?l.p(n,i):(l=ap(n),l.c(),l.m(t.parentNode,t)):l&&(l.d(1),l=null)},i:ze,o:ze,d(n){l&&l.d(n),n&&T(t)}}}function Nb(e,t,l){let{epoch:n}=t,i={};Ml.subscribe(c=>{l(1,i=c)});let o=0,f=0,r=0;return e.$$set=c=>{"epoch"in c&&l(0,n=c.epoch)},e.$$.update=()=>{e.$$.dirty&1&&(l(2,o=Math.floor(n/86400)),l(3,f=Math.floor(n/3600)),l(4,r=Math.floor(n/60)))},[n,i,o,f,r]}class Tb extends _t{constructor(t){super(),mt(this,t,Nb,Cb,ct,{epoch:0})}}function Pb(e){let t,l,n;return{c(){t=_("span"),l=k(e[2]),u(t,"title",e[1]),u(t,"class",n="bd-"+e[0])},m(i,o){E(i,t,o),s(t,l)},p(i,[o]){o&4&&C(l,i[2]),o&2&&u(t,"title",i[1]),o&1&&n!==(n="bd-"+i[0])&&u(t,"class",n)},i:ze,o:ze,d(i){i&&T(t)}}}function Eb(e,t,l){let{color:n}=t,{title:i}=t,{text:o}=t;return e.$$set=f=>{"color"in f&&l(0,n=f.color),"title"in f&&l(1,i=f.title),"text"in f&&l(2,o=f.text)},[n,i,o]}class hi extends _t{constructor(t){super(),mt(this,t,Eb,Pb,ct,{color:0,title:1,text:2})}}function Ab(e){let t,l=`${ht(e[0].getDate())}.${ht(e[0].getMonth()+1)}.${e[0].getFullYear()} ${ht(e[0].getHours())}:${ht(e[0].getMinutes())}`,n;return{c(){t=_("span"),n=k(l),u(t,"class",e[1])},m(i,o){E(i,t,o),s(t,n)},p(i,o){o&1&&l!==(l=`${ht(i[0].getDate())}.${ht(i[0].getMonth()+1)}.${i[0].getFullYear()} ${ht(i[0].getHours())}:${ht(i[0].getMinutes())}`)&&C(n,l),o&2&&u(t,"class",i[1])},d(i){i&&T(t)}}}function Db(e){var n;let t=`${ht(e[0].getDate())}. ${e[2].months?(n=e[2].months)==null?void 0:n[e[0].getMonth()]:ht(e[0].getMonth())} ${ht(e[0].getHours())}:${ht(e[0].getMinutes())}`,l;return{c(){l=k(t)},m(i,o){E(i,l,o)},p(i,o){var f;o&5&&t!==(t=`${ht(i[0].getDate())}. ${i[2].months?(f=i[2].months)==null?void 0:f[i[0].getMonth()]:ht(i[0].getMonth())} ${ht(i[0].getHours())}:${ht(i[0].getMinutes())}`)&&C(l,t)},d(i){i&&T(l)}}}function qb(e){let t;function l(o,f){return o[3]?Db:Ab}let n=l(e),i=n(e);return{c(){i.c(),t=Ut()},m(o,f){i.m(o,f),E(o,t,f)},p(o,[f]){n===(n=l(o))&&i?i.p(o,f):(i.d(1),i=n(o),i&&(i.c(),i.m(t.parentNode,t)))},i:ze,o:ze,d(o){i.d(o),o&&T(t)}}}function Ob(e,t,l){let n={};Ml.subscribe(c=>{l(2,n=c)});let{timestamp:i}=t,{fullTimeColor:o}=t,{offset:f}=t,r;return e.$$set=c=>{"timestamp"in c&&l(0,i=c.timestamp),"fullTimeColor"in c&&l(1,o=c.fullTimeColor),"offset"in c&&l(4,f=c.offset)},e.$$.update=()=>{e.$$.dirty&17&&(l(3,r=Math.abs(new Date().getTime()-i.getTime())<3e5),isNaN(f)||Tn(i,f-(24+i.getHours()-i.getUTCHours())%24))},[i,o,n,r,f]}class Hv extends _t{constructor(t){super(),mt(this,t,Ob,qb,ct,{timestamp:0,fullTimeColor:1,offset:4})}}function Ib(e){let t,l,n;return{c(){t=bt("svg"),l=bt("path"),n=bt("path"),u(l,"stroke-linecap","round"),u(l,"stroke-linejoin","round"),u(l,"d","M10.343 3.94c.09-.542.56-.94 1.11-.94h1.093c.55 0 1.02.398 1.11.94l.149.894c.07.424.384.764.78.93.398.164.855.142 1.205-.108l.737-.527a1.125 1.125 0 011.45.12l.773.774c.39.389.44 1.002.12 1.45l-.527.737c-.25.35-.272.806-.107 1.204.165.397.505.71.93.78l.893.15c.543.09.94.56.94 1.109v1.094c0 .55-.397 1.02-.94 1.11l-.893.149c-.425.07-.765.383-.93.78-.165.398-.143.854.107 1.204l.527.738c.32.447.269 1.06-.12 1.45l-.774.773a1.125 1.125 0 01-1.449.12l-.738-.527c-.35-.25-.806-.272-1.203-.107-.397.165-.71.505-.781.929l-.149.894c-.09.542-.56.94-1.11.94h-1.094c-.55 0-1.019-.398-1.11-.94l-.148-.894c-.071-.424-.384-.764-.781-.93-.398-.164-.854-.142-1.204.108l-.738.527c-.447.32-1.06.269-1.45-.12l-.773-.774a1.125 1.125 0 01-.12-1.45l.527-.737c.25-.35.273-.806.108-1.204-.165-.397-.505-.71-.93-.78l-.894-.15c-.542-.09-.94-.56-.94-1.109v-1.094c0-.55.398-1.02.94-1.11l.894-.149c.424-.07.765-.383.93-.78.165-.398.143-.854-.107-1.204l-.527-.738a1.125 1.125 0 01.12-1.45l.773-.773a1.125 1.125 0 011.45-.12l.737.527c.35.25.807.272 1.204.107.397-.165.71-.505.78-.929l.15-.894z"),u(n,"stroke-linecap","round"),u(n,"stroke-linejoin","round"),u(n,"d","M15 12a3 3 0 11-6 0 3 3 0 016 0z"),u(t,"xmlns","http://www.w3.org/2000/svg"),u(t,"fill","none"),u(t,"viewBox","0 0 24 24"),u(t,"stroke-width","1.5"),u(t,"stroke","currentColor"),u(t,"class","w-6 h-6")},m(i,o){E(i,t,o),s(t,l),s(t,n)},p:ze,i:ze,o:ze,d(i){i&&T(t)}}}class Lb extends _t{constructor(t){super(),mt(this,t,null,Ib,ct,{})}}function Rb(e){let t,l;return{c(){t=bt("svg"),l=bt("path"),u(l,"stroke-linecap","round"),u(l,"stroke-linejoin","round"),u(l,"d","M11.25 11.25l.041-.02a.75.75 0 011.063.852l-.708 2.836a.75.75 0 001.063.853l.041-.021M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9-3.75h.008v.008H12V8.25z"),u(t,"xmlns","http://www.w3.org/2000/svg"),u(t,"fill","none"),u(t,"viewBox","0 0 24 24"),u(t,"stroke-width","1.5"),u(t,"stroke","currentColor"),u(t,"class","w-6 h-6")},m(n,i){E(n,t,i),s(t,l)},p:ze,i:ze,o:ze,d(n){n&&T(t)}}}class Fb extends _t{constructor(t){super(),mt(this,t,null,Rb,ct,{})}}function Bb(e){let t,l;return{c(){t=bt("svg"),l=bt("path"),u(l,"stroke-linecap","round"),u(l,"stroke-linejoin","round"),u(l,"d","M9.879 7.519c1.171-1.025 3.071-1.025 4.242 0 1.172 1.025 1.172 2.687 0 3.712-.203.179-.43.326-.67.442-.745.361-1.45.999-1.45 1.827v.75M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9 5.25h.008v.008H12v-.008z"),u(t,"xmlns","http://www.w3.org/2000/svg"),u(t,"fill","none"),u(t,"viewBox","0 0 24 24"),u(t,"stroke-width","1.5"),u(t,"stroke","currentColor"),u(t,"class","w-6 h-6")},m(n,i){E(n,t,i),s(t,l)},p:ze,i:ze,o:ze,d(n){n&&T(t)}}}class Ub extends _t{constructor(t){super(),mt(this,t,null,Bb,ct,{})}}function jb(e){let t,l,n=e[2].version+"",i;return{c(){t=k("AMS reader "),l=_("span"),i=k(n)},m(o,f){E(o,t,f),E(o,l,f),s(l,i)},p(o,f){f&4&&n!==(n=o[2].version+"")&&C(i,n)},d(o){o&&T(t),o&&T(l)}}}function fp(e){let t,l=(e[1].t>-50?e[1].t.toFixed(1):"-")+"",n,i;return{c(){t=_("div"),n=k(l),i=k("\xB0C"),u(t,"class","flex-none my-auto")},m(o,f){E(o,t,f),s(t,n),s(t,i)},p(o,f){f&2&&l!==(l=(o[1].t>-50?o[1].t.toFixed(1):"-")+"")&&C(n,l)},d(o){o&&T(t)}}}function up(e){var i,o,f,r,c;let t,l=((o=(i=e[4].header)==null?void 0:i.han)!=null?o:"HAN")+": "+((c=(r=(f=e[4].errors)==null?void 0:f.han)==null?void 0:r[e[1].he])!=null?c:e[1].he),n;return{c(){t=_("div"),n=k(l),u(t,"class","bd-red")},m(a,m){E(a,t,m),s(t,n)},p(a,m){var p,v,d,h,g;m&18&&l!==(l=((v=(p=a[4].header)==null?void 0:p.han)!=null?v:"HAN")+": "+((g=(h=(d=a[4].errors)==null?void 0:d.han)==null?void 0:h[a[1].he])!=null?g:a[1].he))&&C(n,l)},d(a){a&&T(t)}}}function rp(e){var i,o,f,r,c;let t,l=((o=(i=e[4].header)==null?void 0:i.mqtt)!=null?o:"MQTT")+": "+((c=(r=(f=e[4].errors)==null?void 0:f.mqtt)==null?void 0:r[e[1].me])!=null?c:e[1].me),n;return{c(){t=_("div"),n=k(l),u(t,"class","bd-red")},m(a,m){E(a,t,m),s(t,n)},p(a,m){var p,v,d,h,g;m&18&&l!==(l=((v=(p=a[4].header)==null?void 0:p.mqtt)!=null?v:"MQTT")+": "+((g=(h=(d=a[4].errors)==null?void 0:d.mqtt)==null?void 0:h[a[1].me])!=null?g:a[1].me))&&C(n,l)},d(a){a&&T(t)}}}function cp(e){var i,o,f,r,c;let t,l=((o=(i=e[4].header)==null?void 0:i.price)!=null?o:"PS")+": "+((c=(r=(f=e[4].errors)==null?void 0:f.price)==null?void 0:r[e[1].ee])!=null?c:e[1].ee),n;return{c(){t=_("div"),n=k(l),u(t,"class","bd-red")},m(a,m){E(a,t,m),s(t,n)},p(a,m){var p,v,d,h,g;m&18&&l!==(l=((v=(p=a[4].header)==null?void 0:p.price)!=null?v:"PS")+": "+((g=(h=(d=a[4].errors)==null?void 0:d.price)==null?void 0:h[a[1].ee])!=null?g:a[1].ee))&&C(n,l)},d(a){a&&T(t)}}}function mp(e){let t,l,n,i,o,f,r,c;return l=new ln({props:{to:"/configuration",$$slots:{default:[Hb]},$$scope:{ctx:e}}}),f=new ln({props:{to:"/status",$$slots:{default:[yb]},$$scope:{ctx:e}}}),{c(){var a,m,p,v;t=_("div"),Ne(l.$$.fragment),i=b(),o=_("div"),Ne(f.$$.fragment),u(t,"class","flex-none px-1 mt-1"),_n(t,"font-size","18px"),_n(t,"font-weight","bold"),u(t,"title",n=(m=(a=e[4].header)==null?void 0:a.config)!=null?m:""),u(o,"class","flex-none px-1 mt-1"),_n(o,"font-size","18px"),_n(o,"font-weight","bold"),u(o,"title",r=(v=(p=e[4].header)==null?void 0:p.status)!=null?v:"")},m(a,m){E(a,t,m),Se(l,t,null),E(a,i,m),E(a,o,m),Se(f,o,null),c=!0},p(a,m){var d,h,g,M;const p={};m&64&&(p.$$scope={dirty:m,ctx:a}),l.$set(p),(!c||m&16&&n!==(n=(h=(d=a[4].header)==null?void 0:d.config)!=null?h:""))&&u(t,"title",n);const v={};m&64&&(v.$$scope={dirty:m,ctx:a}),f.$set(v),(!c||m&16&&r!==(r=(M=(g=a[4].header)==null?void 0:g.status)!=null?M:""))&&u(o,"title",r)},i(a){c||(Q(l.$$.fragment,a),Q(f.$$.fragment,a),c=!0)},o(a){ee(l.$$.fragment,a),ee(f.$$.fragment,a),c=!1},d(a){a&&T(t),Ce(l),a&&T(i),a&&T(o),Ce(f)}}}function Hb(e){let t,l;return t=new Lb({}),{c(){Ne(t.$$.fragment)},m(n,i){Se(t,n,i),l=!0},i(n){l||(Q(t.$$.fragment,n),l=!0)},o(n){ee(t.$$.fragment,n),l=!1},d(n){Ce(t,n)}}}function yb(e){let t,l;return t=new Fb({}),{c(){Ne(t.$$.fragment)},m(n,i){Se(t,n,i),l=!0},i(n){l||(Q(t.$$.fragment,n),l=!0)},o(n){ee(t.$$.fragment,n),l=!1},d(n){Ce(t,n)}}}function _p(e){let t,l;function n(f,r){return f[2].security==0||f[1].a?Wb:zb}let i=n(e),o=i(e);return{c(){var f,r;t=_("div"),o.c(),u(t,"class","flex-none mr-3 text-yellow-500"),u(t,"title",l=((r=(f=e[4].header)==null?void 0:f.new_version)!=null?r:"New version")+": "+e[3].tag_name)},m(f,r){E(f,t,r),o.m(t,null)},p(f,r){var c,a;i===(i=n(f))&&o?o.p(f,r):(o.d(1),o=i(f),o&&(o.c(),o.m(t,null))),r&24&&l!==(l=((a=(c=f[4].header)==null?void 0:c.new_version)!=null?a:"New version")+": "+f[3].tag_name)&&u(t,"title",l)},d(f){f&&T(t),o.d()}}}function zb(e){var r,c;let t,l=((c=(r=e[4].header)==null?void 0:r.new_version)!=null?c:"New version")+"",n,i,o=e[3].tag_name+"",f;return{c(){t=_("span"),n=k(l),i=k(": "),f=k(o)},m(a,m){E(a,t,m),s(t,n),s(t,i),s(t,f)},p(a,m){var p,v;m&16&&l!==(l=((v=(p=a[4].header)==null?void 0:p.new_version)!=null?v:"New version")+"")&&C(n,l),m&8&&o!==(o=a[3].tag_name+"")&&C(f,o)},d(a){a&&T(t)}}}function Wb(e){var m,p;let t,l,n=((p=(m=e[4].header)==null?void 0:m.new_version)!=null?p:"New version")+"",i,o,f=e[3].tag_name+"",r,c,a;return{c(){t=_("button"),l=_("span"),i=k(n),o=k(": "),r=k(f),u(l,"class","mt-1"),u(t,"class","flex")},m(v,d){E(v,t,d),s(t,l),s(l,i),s(l,o),s(l,r),c||(a=re(t,"click",e[5]),c=!0)},p(v,d){var h,g;d&16&&n!==(n=((g=(h=v[4].header)==null?void 0:h.new_version)!=null?g:"New version")+"")&&C(i,n),d&8&&f!==(f=v[3].tag_name+"")&&C(r,f)},d(v){v&&T(t),c=!1,a()}}}function Gb(e){var te,le,fe,de,qe,Pe,we,Fe,Ae,ke,De,He,Oe,je,Qe,We,Je,$e,tt,Te;let t,l,n,i,o,f,r,c,a,m,p,v=((le=(te=e[4].header)==null?void 0:te.mem)!=null?le:"Free")+"",d,h,g=(e[1].m?(e[1].m/1e3).toFixed(1):"-")+"",M,A,I,O,L,q,U,P,F,z,G,B,R,K,y,H,Y,X,J,$,ce,ie,oe,ae,se,x,_e,pe,V,Z,ge;i=new ln({props:{to:"/",$$slots:{default:[jb]},$$scope:{ctx:e}}}),c=new Tb({props:{epoch:e[1].u}});let ve=e[1].t>-50&&fp(e);L=new hi({props:{title:(de=(fe=e[4].header)==null?void 0:fe.esp)!=null?de:"ESP",text:e[2].booting?(Pe=(qe=e[4].header)==null?void 0:qe.booting)!=null?Pe:"Booting":e[1].v>2?e[1].v.toFixed(2)+"V":(Fe=(we=e[4].header)==null?void 0:we.esp)!=null?Fe:"ESP",color:$n(e[2].booting?2:e[1].em)}}),U=new hi({props:{title:(ke=(Ae=e[4].header)==null?void 0:Ae.han)!=null?ke:"HAN",text:(He=(De=e[4].header)==null?void 0:De.han)!=null?He:"HAN",color:$n(e[2].booting?9:e[1].hm)}}),F=new hi({props:{title:(je=(Oe=e[4].header)==null?void 0:Oe.wifi)!=null?je:"WiFi",text:e[1].r?e[1].r.toFixed(0)+"dBm":(We=(Qe=e[4].header)==null?void 0:Qe.wifi)!=null?We:"WiFi",color:$n(e[2].booting?9:e[1].wm)}}),G=new hi({props:{title:($e=(Je=e[4].header)==null?void 0:Je.mqtt)!=null?$e:"MQTT",text:(Te=(tt=e[4].header)==null?void 0:tt.mqtt)!=null?Te:"MQTT",color:$n(e[2].booting?9:e[1].mm)}});let S=(e[1].he<0||e[1].he>0)&&up(e),w=e[1].me<0&&rp(e),N=(e[1].ee>0||e[1].ee<0)&&cp(e);oe=new Hv({props:{timestamp:e[1].c?new Date(e[1].c*1e3):new Date(0),offset:e[2].clock_offset,fullTimeColor:"text-red-500"}});let D=e[2].vndcfg&&e[2].usrcfg&&mp(e);pe=new Ub({});let j=e[2].fwconsent===1&&e[3]&&_p(e);return{c(){var ue,Ie;t=_("nav"),l=_("div"),n=_("div"),Ne(i.$$.fragment),o=b(),f=_("div"),r=_("div"),Ne(c.$$.fragment),a=b(),ve&&ve.c(),m=b(),p=_("div"),d=k(v),h=k(": "),M=k(g),A=k("kb"),I=b(),O=_("div"),Ne(L.$$.fragment),q=b(),Ne(U.$$.fragment),P=b(),Ne(F.$$.fragment),z=b(),Ne(G.$$.fragment),B=b(),S&&S.c(),R=b(),w&&w.c(),K=b(),N&&N.c(),y=b(),H=_("div"),Y=_("div"),X=_("a"),J=_("img"),ce=b(),ie=_("div"),Ne(oe.$$.fragment),ae=b(),D&&D.c(),se=b(),x=_("div"),_e=_("a"),Ne(pe.$$.fragment),Z=b(),j&&j.c(),u(n,"class","flex text-lg text-gray-100 p-2"),u(r,"class","flex-none my-auto"),u(p,"class","flex-none my-auto"),u(f,"class","flex-none my-auto p-2 flex space-x-4"),u(O,"class","flex-auto flex-wrap my-auto justify-center p-2"),u(J,"class","logo"),yo(J.src,$=(e[0]+op).replace("//","/"))||u(J,"src",$),u(J,"alt","GitHub repo"),u(X,"class","float-right"),u(X,"href","https://github.com/UtilitechAS/amsreader-firmware"),u(X,"target","_blank"),u(X,"rel","noreferrer"),u(X,"aria-label","GitHub"),u(Y,"class","flex-none"),u(ie,"class","flex-none my-auto px-2"),u(_e,"href",zl("")),u(_e,"target","_blank"),u(_e,"rel","noreferrer"),u(x,"class","flex-none px-1 mt-1"),_n(x,"font-size","18px"),_n(x,"font-weight","bold"),u(x,"title",V=(Ie=(ue=e[4].header)==null?void 0:ue.doc)!=null?Ie:""),u(H,"class","flex-auto p-2 flex flex-row-reverse flex-wrap"),u(l,"class","flex flex-wrap space-x-4 text-sm text-gray-300"),u(t,"class","hdr")},m(ue,Ie){E(ue,t,Ie),s(t,l),s(l,n),Se(i,n,null),s(l,o),s(l,f),s(f,r),Se(c,r,null),s(f,a),ve&&ve.m(f,null),s(f,m),s(f,p),s(p,d),s(p,h),s(p,M),s(p,A),s(l,I),s(l,O),Se(L,O,null),s(O,q),Se(U,O,null),s(O,P),Se(F,O,null),s(O,z),Se(G,O,null),s(l,B),S&&S.m(l,null),s(l,R),w&&w.m(l,null),s(l,K),N&&N.m(l,null),s(l,y),s(l,H),s(H,Y),s(Y,X),s(X,J),s(H,ce),s(H,ie),Se(oe,ie,null),s(H,ae),D&&D.m(H,null),s(H,se),s(H,x),s(x,_e),Se(pe,_e,null),s(H,Z),j&&j.m(H,null),ge=!0},p(ue,[Ie]){var gt,At,Pt,Be,ye,It,vt,nt,Tt,it,at,rt,jt,Lt,Ht,yt,Me,Ve,Rt,Gt,zt,Dt;const kt={};Ie&68&&(kt.$$scope={dirty:Ie,ctx:ue}),i.$set(kt);const lt={};Ie&2&&(lt.epoch=ue[1].u),c.$set(lt),ue[1].t>-50?ve?ve.p(ue,Ie):(ve=fp(ue),ve.c(),ve.m(f,m)):ve&&(ve.d(1),ve=null),(!ge||Ie&16)&&v!==(v=((At=(gt=ue[4].header)==null?void 0:gt.mem)!=null?At:"Free")+"")&&C(d,v),(!ge||Ie&2)&&g!==(g=(ue[1].m?(ue[1].m/1e3).toFixed(1):"-")+"")&&C(M,g);const wt={};Ie&16&&(wt.title=(Be=(Pt=ue[4].header)==null?void 0:Pt.esp)!=null?Be:"ESP"),Ie&22&&(wt.text=ue[2].booting?(It=(ye=ue[4].header)==null?void 0:ye.booting)!=null?It:"Booting":ue[1].v>2?ue[1].v.toFixed(2)+"V":(nt=(vt=ue[4].header)==null?void 0:vt.esp)!=null?nt:"ESP"),Ie&6&&(wt.color=$n(ue[2].booting?2:ue[1].em)),L.$set(wt);const st={};Ie&16&&(st.title=(it=(Tt=ue[4].header)==null?void 0:Tt.han)!=null?it:"HAN"),Ie&16&&(st.text=(rt=(at=ue[4].header)==null?void 0:at.han)!=null?rt:"HAN"),Ie&6&&(st.color=$n(ue[2].booting?9:ue[1].hm)),U.$set(st);const ot={};Ie&16&&(ot.title=(Lt=(jt=ue[4].header)==null?void 0:jt.wifi)!=null?Lt:"WiFi"),Ie&18&&(ot.text=ue[1].r?ue[1].r.toFixed(0)+"dBm":(yt=(Ht=ue[4].header)==null?void 0:Ht.wifi)!=null?yt:"WiFi"),Ie&6&&(ot.color=$n(ue[2].booting?9:ue[1].wm)),F.$set(ot);const xe={};Ie&16&&(xe.title=(Ve=(Me=ue[4].header)==null?void 0:Me.mqtt)!=null?Ve:"MQTT"),Ie&16&&(xe.text=(Gt=(Rt=ue[4].header)==null?void 0:Rt.mqtt)!=null?Gt:"MQTT"),Ie&6&&(xe.color=$n(ue[2].booting?9:ue[1].mm)),G.$set(xe),ue[1].he<0||ue[1].he>0?S?S.p(ue,Ie):(S=up(ue),S.c(),S.m(l,R)):S&&(S.d(1),S=null),ue[1].me<0?w?w.p(ue,Ie):(w=rp(ue),w.c(),w.m(l,K)):w&&(w.d(1),w=null),ue[1].ee>0||ue[1].ee<0?N?N.p(ue,Ie):(N=cp(ue),N.c(),N.m(l,y)):N&&(N.d(1),N=null),(!ge||Ie&1&&!yo(J.src,$=(ue[0]+op).replace("//","/")))&&u(J,"src",$);const Nt={};Ie&2&&(Nt.timestamp=ue[1].c?new Date(ue[1].c*1e3):new Date(0)),Ie&4&&(Nt.offset=ue[2].clock_offset),oe.$set(Nt),ue[2].vndcfg&&ue[2].usrcfg?D?(D.p(ue,Ie),Ie&4&&Q(D,1)):(D=mp(ue),D.c(),Q(D,1),D.m(H,se)):D&&(pt(),ee(D,1,1,()=>{D=null}),dt()),(!ge||Ie&16&&V!==(V=(Dt=(zt=ue[4].header)==null?void 0:zt.doc)!=null?Dt:""))&&u(x,"title",V),ue[2].fwconsent===1&&ue[3]?j?j.p(ue,Ie):(j=_p(ue),j.c(),j.m(H,null)):j&&(j.d(1),j=null)},i(ue){ge||(Q(i.$$.fragment,ue),Q(c.$$.fragment,ue),Q(L.$$.fragment,ue),Q(U.$$.fragment,ue),Q(F.$$.fragment,ue),Q(G.$$.fragment,ue),Q(oe.$$.fragment,ue),Q(D),Q(pe.$$.fragment,ue),ge=!0)},o(ue){ee(i.$$.fragment,ue),ee(c.$$.fragment,ue),ee(L.$$.fragment,ue),ee(U.$$.fragment,ue),ee(F.$$.fragment,ue),ee(G.$$.fragment,ue),ee(oe.$$.fragment,ue),ee(D),ee(pe.$$.fragment,ue),ge=!1},d(ue){ue&&T(t),Ce(i),Ce(c),ve&&ve.d(),Ce(L),Ce(U),Ce(F),Ce(G),S&&S.d(),w&&w.d(),N&&N.d(),Ce(oe),D&&D.d(),Ce(pe),j&&j.d()}}}function Vb(e,t,l){let{basepath:n="/"}=t,{data:i={}}=t,o={},f={};function r(){var a,m;confirm(((m=(a=c.header)==null?void 0:a.upgrade)!=null?m:"Upgrade to {0}?").replace("{0}",f.tag_name))&&(!is(o.board)||confirm(Yo(Ge(o.chip,o.board))))&&(wl.update(p=>(p.upgrading=!0,p)),Uv(f.tag_name))}wl.subscribe(a=>{l(2,o=a),a.fwconsent===1&&db()}),Pf.subscribe(a=>{l(3,f=jv(o.version,a))});let c={};return Ml.subscribe(a=>{l(4,c=a)}),e.$$set=a=>{"basepath"in a&&l(0,n=a.basepath),"data"in a&&l(1,i=a.data)},[n,i,o,f,c,r]}class Kb extends _t{constructor(t){super(),mt(this,t,Vb,Gb,ct,{basepath:0,data:1})}}function Yb(e){let t,l,n,i;return{c(){t=bt("svg"),l=bt("path"),n=bt("path"),u(l,"d",Qa(150,150,115,210,510)),u(l,"stroke","rgba(128, 128, 128, 0.15)"),u(l,"fill","none"),u(l,"stroke-width","55"),u(n,"d",i=Qa(150,150,115,210,210+300*e[0]/100)),u(n,"stroke",e[1]),u(n,"fill","none"),u(n,"stroke-width","55"),u(t,"viewBox","0 0 300 300"),u(t,"xmlns","http://www.w3.org/2000/svg"),u(t,"height","100%")},m(o,f){E(o,t,f),s(t,l),s(t,n)},p(o,[f]){f&1&&i!==(i=Qa(150,150,115,210,210+300*o[0]/100))&&u(n,"d",i),f&2&&u(n,"stroke",o[1])},i:ze,o:ze,d(o){o&&T(t)}}}function pp(e,t,l,n){var i=(n-90)*Math.PI/180;return{x:e+l*Math.cos(i),y:t+l*Math.sin(i)}}function Qa(e,t,l,n,i){var o=pp(e,t,l,i),f=pp(e,t,l,n),r=i-n<=180?"0":"1",c=["M",o.x,o.y,"A",l,l,0,r,0,f.x,f.y].join(" ");return c}function Qb(e,t,l){let{pct:n=0}=t,{color:i="red"}=t;return e.$$set=o=>{"pct"in o&&l(0,n=o.pct),"color"in o&&l(1,i=o.color)},[n,i]}class Xb extends _t{constructor(t){super(),mt(this,t,Qb,Yb,ct,{pct:0,color:1})}}function dp(e){let t,l,n,i,o,f,r,c;return{c(){t=_("br"),l=b(),n=_("span"),i=k(e[1]),o=b(),f=_("span"),r=k(e[2]),c=k("/kWh"),u(n,"class","pl-sub"),u(f,"class","pl-snt")},m(a,m){E(a,t,m),E(a,l,m),E(a,n,m),s(n,i),E(a,o,m),E(a,f,m),s(f,r),s(f,c)},p(a,m){m&2&&C(i,a[1]),m&4&&C(r,a[2])},d(a){a&&T(t),a&&T(l),a&&T(n),a&&T(o),a&&T(f)}}}function Zb(e){let t,l,n,i,o,f,r,c,a,m,p=e[4][0]+"",v,d,h,g=e[4][1]+"",M,A,I;l=new Xb({props:{pct:e[5],color:e[3](e[5],document.documentElement.classList.contains("dark"))}});let O=e[1]&&dp(e);return{c(){t=_("div"),Ne(l.$$.fragment),n=b(),i=_("span"),o=_("span"),f=k(e[0]),r=b(),c=_("br"),a=b(),m=_("span"),v=k(p),d=b(),h=_("span"),M=k(g),A=b(),O&&O.c(),u(o,"class","pl-lab"),u(m,"class","pl-val"),u(h,"class","pl-unt"),u(i,"class","pl-ov"),u(t,"class","pl-root")},m(L,q){E(L,t,q),Se(l,t,null),s(t,n),s(t,i),s(i,o),s(o,f),s(i,r),s(i,c),s(i,a),s(i,m),s(m,v),s(i,d),s(i,h),s(h,M),s(i,A),O&&O.m(i,null),I=!0},p(L,[q]){const U={};q&32&&(U.pct=L[5]),q&40&&(U.color=L[3](L[5],document.documentElement.classList.contains("dark"))),l.$set(U),(!I||q&1)&&C(f,L[0]),(!I||q&16)&&p!==(p=L[4][0]+"")&&C(v,p),(!I||q&16)&&g!==(g=L[4][1]+"")&&C(M,g),L[1]?O?O.p(L,q):(O=dp(L),O.c(),O.m(i,null)):O&&(O.d(1),O=null)},i(L){I||(Q(l.$$.fragment,L),I=!0)},o(L){ee(l.$$.fragment,L),I=!1},d(L){L&&T(t),Ce(l),O&&O.d()}}}function Jb(e,t,l){let{val:n}=t,{max:i}=t,{unit:o}=t,{label:f}=t,{sub:r=""}=t,{subunit:c=""}=t,{colorFn:a}=t,m,p=0;return e.$$set=v=>{"val"in v&&l(6,n=v.val),"max"in v&&l(7,i=v.max),"unit"in v&&l(8,o=v.unit),"label"in v&&l(0,f=v.label),"sub"in v&&l(1,r=v.sub),"subunit"in v&&l(2,c=v.subunit),"colorFn"in v&&l(3,a=v.colorFn)},e.$$.update=()=>{e.$$.dirty&448&&(l(4,m=gl(n,o)),l(5,p=Math.min(n,i)/i*100))},[f,r,c,a,m,p,n,i,o]}class yv extends _t{constructor(t){super(),mt(this,t,Jb,Zb,ct,{val:6,max:7,unit:8,label:0,sub:1,subunit:2,colorFn:3})}}function vp(e,t,l){const n=e.slice();return n[11]=t[l],n[13]=l,n}function hp(e,t,l){const n=e.slice();return n[11]=t[l],n[13]=l,n}function bp(e,t,l){const n=e.slice();return n[15]=t[l],n}function gp(e){let t,l,n,i,o,f,r=e[0].title&&kp(e),c=e[0].y.ticks,a=[];for(let h=0;he[9].call(t))},m(o,f){E(o,t,f),s(t,n),i=hf(t,e[9].bind(t))},p(o,f){f&1&&l!==(l=o[0].title+"")&&C(n,l)},d(o){o&&T(t),i()}}}function wp(e){let t,l,n,i=e[15].label+"",o,f,r,c;return{c(){t=bt("g"),l=bt("line"),n=bt("text"),o=k(i),u(l,"x2","100%"),u(n,"y","-4"),u(n,"x",f=e[15].align=="right"?"85%":""),u(t,"class",r="tick tick-"+e[15].value+" tick-"+e[15].color),u(t,"transform",c="translate(0, "+e[7](e[15].value)+")")},m(a,m){E(a,t,m),s(t,l),s(t,n),s(n,o)},p(a,m){m&1&&i!==(i=a[15].label+"")&&C(o,i),m&1&&f!==(f=a[15].align=="right"?"85%":"")&&u(n,"x",f),m&1&&r!==(r="tick tick-"+a[15].value+" tick-"+a[15].color)&&u(t,"class",r),m&129&&c!==(c="translate(0, "+a[7](a[15].value)+")")&&u(t,"transform",c)},d(a){a&&T(t)}}}function Mp(e){let t=!isNaN(e[7](e[15].value)),l,n=t&&wp(e);return{c(){n&&n.c(),l=Ut()},m(i,o){n&&n.m(i,o),E(i,l,o)},p(i,o){o&129&&(t=!isNaN(i[7](i[15].value))),t?n?n.p(i,o):(n=wp(i),n.c(),n.m(l.parentNode,l)):n&&(n.d(1),n=null)},d(i){n&&n.d(i),i&&T(l)}}}function Sp(e){let t,l,n=(e[3]>20||e[13]%2==0)&&Cp(e);return{c(){t=bt("g"),n&&n.c(),u(t,"class","tick"),u(t,"transform",l="translate("+e[6](e[13])+","+e[4]+")")},m(i,o){E(i,t,o),n&&n.m(t,null)},p(i,o){i[3]>20||i[13]%2==0?n?n.p(i,o):(n=Cp(i),n.c(),n.m(t,null)):n&&(n.d(1),n=null),o&80&&l!==(l="translate("+i[6](i[13])+","+i[4]+")")&&u(t,"transform",l)},d(i){i&&T(t),n&&n.d()}}}function Cp(e){let t,l=e[11].label+"",n,i;return{c(){t=bt("text"),n=k(l),u(t,"x",i=e[3]/2),u(t,"y","-4")},m(o,f){E(o,t,f),s(t,n)},p(o,f){f&1&&l!==(l=o[11].label+"")&&C(n,l),f&8&&i!==(i=o[3]/2)&&u(t,"x",i)},d(o){o&&T(t)}}}function Np(e){let t=!isNaN(e[6](e[13])),l,n=t&&Sp(e);return{c(){n&&n.c(),l=Ut()},m(i,o){n&&n.m(i,o),E(i,l,o)},p(i,o){o&64&&(t=!isNaN(i[6](i[13]))),t?n?n.p(i,o):(n=Sp(i),n.c(),n.m(l.parentNode,l)):n&&(n.d(1),n=null)},d(i){n&&n.d(i),i&&T(l)}}}function Tp(e){let t,l,n=e[11].value!==void 0&&Pp(e),i=e[11].value2>1e-4&&Dp(e);return{c(){t=bt("g"),n&&n.c(),l=bt("g"),i&&i.c()},m(o,f){E(o,t,f),n&&n.m(t,null),E(o,l,f),i&&i.m(l,null)},p(o,f){o[11].value!==void 0?n?n.p(o,f):(n=Pp(o),n.c(),n.m(t,null)):n&&(n.d(1),n=null),o[11].value2>1e-4?i?i.p(o,f):(i=Dp(o),i.c(),i.m(l,null)):i&&(i.d(1),i=null)},d(o){o&&T(t),n&&n.d(),o&&T(l),i&&i.d()}}}function Pp(e){let t,l,n,i,o,f,r,c=e[3]>15&&Ep(e);return{c(){t=bt("rect"),c&&c.c(),r=Ut(),u(t,"x",l=e[6](e[13])+2),u(t,"y",n=e[7](e[11].value)),u(t,"width",i=e[3]-4),u(t,"height",o=e[7](e[0].y.min)-e[7](Math.min(e[0].y.min,0)+e[11].value)),u(t,"fill",f=e[11].color)},m(a,m){E(a,t,m),c&&c.m(a,m),E(a,r,m)},p(a,m){m&64&&l!==(l=a[6](a[13])+2)&&u(t,"x",l),m&129&&n!==(n=a[7](a[11].value))&&u(t,"y",n),m&8&&i!==(i=a[3]-4)&&u(t,"width",i),m&129&&o!==(o=a[7](a[0].y.min)-a[7](Math.min(a[0].y.min,0)+a[11].value))&&u(t,"height",o),m&1&&f!==(f=a[11].color)&&u(t,"fill",f),a[3]>15?c?c.p(a,m):(c=Ep(a),c.c(),c.m(r.parentNode,r)):c&&(c.d(1),c=null)},d(a){a&&T(t),c&&c.d(a),a&&T(r)}}}function Ep(e){let t,l=e[11].label+"",n,i,o,f,r,c,a=e[11].title&&Ap(e);return{c(){t=bt("text"),n=k(l),a&&a.c(),c=Ut(),u(t,"width",i=e[3]-4),u(t,"dominant-baseline","middle"),u(t,"text-anchor",o=e[3]e[7](0)-e[8]?e[11].color:"white"),u(t,"transform",r="translate("+(e[6](e[13])+e[3]/2)+" "+(e[7](e[11].value)>e[7](0)-e[8]?e[7](e[11].value)-e[8]:e[7](e[11].value)+10)+") rotate("+(e[11].labelAngle?e[11].labelAngle:e[3]m[7](0)-m[8]?m[11].color:"white")&&u(t,"fill",f),p&457&&r!==(r="translate("+(m[6](m[13])+m[3]/2)+" "+(m[7](m[11].value)>m[7](0)-m[8]?m[7](m[11].value)-m[8]:m[7](m[11].value)+10)+") rotate("+(m[11].labelAngle?m[11].labelAngle:m[3]15&&qp(e);return{c(){t=bt("rect"),c&&c.c(),r=Ut(),u(t,"x",l=e[6](e[13])+2),u(t,"y",n=e[7](0)),u(t,"width",i=e[3]-4),u(t,"height",o=e[7](e[0].y.min)-e[7](e[0].y.min+e[11].value2)),u(t,"fill",f=e[11].color2?e[11].color2:e[11].color)},m(a,m){E(a,t,m),c&&c.m(a,m),E(a,r,m)},p(a,m){m&64&&l!==(l=a[6](a[13])+2)&&u(t,"x",l),m&128&&n!==(n=a[7](0))&&u(t,"y",n),m&8&&i!==(i=a[3]-4)&&u(t,"width",i),m&129&&o!==(o=a[7](a[0].y.min)-a[7](a[0].y.min+a[11].value2))&&u(t,"height",o),m&1&&f!==(f=a[11].color2?a[11].color2:a[11].color)&&u(t,"fill",f),a[3]>15?c?c.p(a,m):(c=qp(a),c.c(),c.m(r.parentNode,r)):c&&(c.d(1),c=null)},d(a){a&&T(t),c&&c.d(a),a&&T(r)}}}function qp(e){let t,l=e[11].label2+"",n,i,o,f,r,c=e[11].title2&&Op(e);return{c(){t=bt("text"),n=k(l),c&&c.c(),r=Ut(),u(t,"width",i=e[3]-4),u(t,"dominant-baseline","middle"),u(t,"text-anchor","middle"),u(t,"fill",o=e[7](-e[11].value2)e[10].call(t))},m(i,o){E(i,t,o),n&&n.m(t,null),l=hf(t,e[10].bind(t))},p(i,[o]){i[0].x.ticks&&i[0].points&&i[4]?n?n.p(i,o):(n=gp(i),n.c(),n.m(t,null)):n&&(n.d(1),n=null)},i:ze,o:ze,d(i){i&&T(t),n&&n.d(),l()}}}let bi=30;function xb(e,t,l){let{config:n}=t,i,o,f,r,c,a,m,p=0;function v(){p=this.clientHeight,l(5,p)}function d(){i=this.clientWidth,o=this.clientHeight,l(1,i),l(2,o)}return e.$$set=h=>{"config"in h&&l(0,n=h.config)},e.$$.update=()=>{if(e.$$.dirty&63){l(4,a=o-p);let h=i-(n.padding.left+n.padding.right);l(3,f=h/n.points.length),l(8,m=fn.y.max?A=n.padding.bottom:Ma||A<0?0:A})}},[n,i,o,f,a,p,r,c,m,v,d]}class wi extends _t{constructor(t){super(),mt(this,t,xb,$b,ct,{config:0})}}function e4(e){let t,l;return t=new wi({props:{config:e[0]}}),{c(){Ne(t.$$.fragment)},m(n,i){Se(t,n,i),l=!0},p(n,[i]){const o={};i&1&&(o.config=n[0]),t.$set(o)},i(n){l||(Q(t.$$.fragment,n),l=!0)},o(n){ee(t.$$.fragment,n),l=!1},d(n){Ce(t,n)}}}function t4(e,t,l){let{title:n}=t,{u1:i}=t,{u2:o}=t,{u3:f}=t,{ds:r}=t,c={};function a(m){return{label:Bt(m)+"V",title:m.toFixed(1)+" V",value:isNaN(m)?0:m,color:cb(m||0,document.documentElement.classList.contains("dark"))}}return e.$$set=m=>{"title"in m&&l(1,n=m.title),"u1"in m&&l(2,i=m.u1),"u2"in m&&l(3,o=m.u2),"u3"in m&&l(4,f=m.u3),"ds"in m&&l(5,r=m.ds)},e.$$.update=()=>{if(e.$$.dirty&62){let m=[],p=[];i>0&&(m.push({label:r===1?"L1-L2":"L1"}),p.push(a(i))),o>0&&(m.push({label:r===1?"L1-L3":"L2"}),p.push(a(o))),f>0&&(m.push({label:r===1?"L2-L3":"L3"}),p.push(a(f))),l(0,c={title:n,padding:{top:20,right:15,bottom:20,left:35},y:{min:200,max:260,ticks:[{value:207,label:"-10%"},{value:230,label:"230v"},{value:253,label:"+10%"}]},x:{ticks:m},points:p})}},[c,n,i,o,f,r]}class l4 extends _t{constructor(t){super(),mt(this,t,t4,e4,ct,{title:1,u1:2,u2:3,u3:4,ds:5})}}function n4(e){var D,j,te,le,fe,de,qe,Pe,we,Fe;let t,l,n=((j=(D=e[0].reactive)==null?void 0:D.title)!=null?j:"Reactive")+"",i,o,f,r,c=((le=(te=e[0].reactive)==null?void 0:te.instant_in)!=null?le:"Instant in")+"",a,m,p,v=e[1][0]+"",d,h,g=e[1][1]+"",M,A,I,O=((de=(fe=e[0].reactive)==null?void 0:fe.instant_out)!=null?de:"Instant out")+"",L,q,U,P=e[2][0]+"",F,z,G=e[2][1]+"",B,R,K,y,H=((Pe=(qe=e[0].reactive)==null?void 0:qe.total_in)!=null?Pe:"Total in")+"",Y,X,J,$=e[3][0]+"",ce,ie,oe=e[3][1]+"",ae,se,x,_e=((Fe=(we=e[0].reactive)==null?void 0:we.total_out)!=null?Fe:"Total out")+"",pe,V,Z,ge=e[4][0]+"",ve,S,w=e[4][1]+"",N;return{c(){t=_("div"),l=_("strong"),i=k(n),o=b(),f=_("div"),r=_("div"),a=k(c),m=b(),p=_("div"),d=k(v),h=b(),M=k(g),A=b(),I=_("div"),L=k(O),q=b(),U=_("div"),F=k(P),z=b(),B=k(G),R=b(),K=_("div"),y=_("div"),Y=k(H),X=b(),J=_("div"),ce=k($),ie=b(),ae=k(oe),se=b(),x=_("div"),pe=k(_e),V=b(),Z=_("div"),ve=k(ge),S=b(),N=k(w),u(p,"class","text-right"),u(U,"class","text-right"),u(f,"class","grid grid-cols-2 mt-4"),u(J,"class","text-right"),u(Z,"class","text-right"),u(K,"class","grid grid-cols-2 mt-4"),u(t,"class","mx-2 text-sm")},m(Ae,ke){E(Ae,t,ke),s(t,l),s(l,i),s(t,o),s(t,f),s(f,r),s(r,a),s(f,m),s(f,p),s(p,d),s(p,h),s(p,M),s(f,A),s(f,I),s(I,L),s(f,q),s(f,U),s(U,F),s(U,z),s(U,B),s(t,R),s(t,K),s(K,y),s(y,Y),s(K,X),s(K,J),s(J,ce),s(J,ie),s(J,ae),s(K,se),s(K,x),s(x,pe),s(K,V),s(K,Z),s(Z,ve),s(Z,S),s(Z,N)},p(Ae,[ke]){var De,He,Oe,je,Qe,We,Je,$e,tt,Te;ke&1&&n!==(n=((He=(De=Ae[0].reactive)==null?void 0:De.title)!=null?He:"Reactive")+"")&&C(i,n),ke&1&&c!==(c=((je=(Oe=Ae[0].reactive)==null?void 0:Oe.instant_in)!=null?je:"Instant in")+"")&&C(a,c),ke&2&&v!==(v=Ae[1][0]+"")&&C(d,v),ke&2&&g!==(g=Ae[1][1]+"")&&C(M,g),ke&1&&O!==(O=((We=(Qe=Ae[0].reactive)==null?void 0:Qe.instant_out)!=null?We:"Instant out")+"")&&C(L,O),ke&4&&P!==(P=Ae[2][0]+"")&&C(F,P),ke&4&&G!==(G=Ae[2][1]+"")&&C(B,G),ke&1&&H!==(H=(($e=(Je=Ae[0].reactive)==null?void 0:Je.total_in)!=null?$e:"Total in")+"")&&C(Y,H),ke&8&&$!==($=Ae[3][0]+"")&&C(ce,$),ke&8&&oe!==(oe=Ae[3][1]+"")&&C(ae,oe),ke&1&&_e!==(_e=((Te=(tt=Ae[0].reactive)==null?void 0:tt.total_out)!=null?Te:"Total out")+"")&&C(pe,_e),ke&16&&ge!==(ge=Ae[4][0]+"")&&C(ve,ge),ke&16&&w!==(w=Ae[4][1]+"")&&C(N,w)},i:ze,o:ze,d(Ae){Ae&&T(t)}}}function i4(e,t,l){let{importInstant:n}=t,{exportInstant:i}=t,{importTotal:o}=t,{exportTotal:f}=t,r={};Ml.subscribe(v=>{l(0,r=v)});let c,a,m,p;return e.$$set=v=>{"importInstant"in v&&l(5,n=v.importInstant),"exportInstant"in v&&l(6,i=v.exportInstant),"importTotal"in v&&l(7,o=v.importTotal),"exportTotal"in v&&l(8,f=v.exportTotal)},e.$$.update=()=>{e.$$.dirty&480&&(l(1,c=gl(n,"VAr")),l(2,a=gl(i,"VAr")),l(3,m=gl(o*1e3,"VArh")),l(4,p=gl(f*1e3,"VArh")))},[r,c,a,m,p,n,i,o,f]}class s4 extends _t{constructor(t){super(),mt(this,t,i4,n4,ct,{importInstant:5,exportInstant:6,importTotal:7,exportTotal:8})}}function Lp(e){let t;function l(o,f){return o[3]?a4:o4}let n=l(e),i=n(e);return{c(){i.c(),t=Ut()},m(o,f){i.m(o,f),E(o,t,f)},p(o,f){n===(n=l(o))&&i?i.p(o,f):(i.d(1),i=n(o),i&&(i.c(),i.m(t.parentNode,t)))},d(o){i.d(o),o&&T(t)}}}function o4(e){var j,te,le,fe,de,qe,Pe,we,Fe,Ae;let t,l=((te=(j=e[5].realtime)==null?void 0:j.consumption)!=null?te:"Consumption")+"",n,i,o,f,r=Vt((fe=(le=e[5].common)==null?void 0:le.hour)!=null?fe:"Hour")+"",c,a,m,p=e[6][0]+"",v,d,h=e[6][1]+"",g,M,A,I=Vt((qe=(de=e[5].common)==null?void 0:de.day)!=null?qe:"Day")+"",O,L,q,U=e[7][0]+"",P,F,z=e[7][1]+"",G,B,R,K=Vt((we=(Pe=e[5].common)==null?void 0:Pe.month)!=null?we:"Month")+"",y,H,Y,X=e[8][0]+"",J,$,ce=e[8][1]+"",ie,oe,ae,se=((Ae=(Fe=e[5].realtime)==null?void 0:Fe.last_month)!=null?Ae:"Last month")+"",x,_e,pe,V=e[9][0]+"",Z,ge,ve=e[9][1]+"",S,w,N,D=e[4]&&Rp(e);return{c(){t=_("strong"),n=k(l),i=b(),o=_("div"),f=_("div"),c=k(r),a=b(),m=_("div"),v=k(p),d=b(),g=k(h),M=b(),A=_("div"),O=k(I),L=b(),q=_("div"),P=k(U),F=b(),G=k(z),B=b(),R=_("div"),y=k(K),H=b(),Y=_("div"),J=k(X),$=b(),ie=k(ce),oe=b(),ae=_("div"),x=k(se),_e=b(),pe=_("div"),Z=k(V),ge=b(),S=k(ve),w=b(),D&&D.c(),N=Ut(),u(m,"class","text-right"),u(q,"class","text-right"),u(Y,"class","text-right"),u(pe,"class","text-right"),u(o,"class","grid grid-cols-2 mb-3")},m(ke,De){E(ke,t,De),s(t,n),E(ke,i,De),E(ke,o,De),s(o,f),s(f,c),s(o,a),s(o,m),s(m,v),s(m,d),s(m,g),s(o,M),s(o,A),s(A,O),s(o,L),s(o,q),s(q,P),s(q,F),s(q,G),s(o,B),s(o,R),s(R,y),s(o,H),s(o,Y),s(Y,J),s(Y,$),s(Y,ie),s(o,oe),s(o,ae),s(ae,x),s(o,_e),s(o,pe),s(pe,Z),s(pe,ge),s(pe,S),E(ke,w,De),D&&D.m(ke,De),E(ke,N,De)},p(ke,De){var He,Oe,je,Qe,We,Je,$e,tt,Te,ue;De&32&&l!==(l=((Oe=(He=ke[5].realtime)==null?void 0:He.consumption)!=null?Oe:"Consumption")+"")&&C(n,l),De&32&&r!==(r=Vt((Qe=(je=ke[5].common)==null?void 0:je.hour)!=null?Qe:"Hour")+"")&&C(c,r),De&64&&p!==(p=ke[6][0]+"")&&C(v,p),De&64&&h!==(h=ke[6][1]+"")&&C(g,h),De&32&&I!==(I=Vt((Je=(We=ke[5].common)==null?void 0:We.day)!=null?Je:"Day")+"")&&C(O,I),De&128&&U!==(U=ke[7][0]+"")&&C(P,U),De&128&&z!==(z=ke[7][1]+"")&&C(G,z),De&32&&K!==(K=Vt((tt=($e=ke[5].common)==null?void 0:$e.month)!=null?tt:"Month")+"")&&C(y,K),De&256&&X!==(X=ke[8][0]+"")&&C(J,X),De&256&&ce!==(ce=ke[8][1]+"")&&C(ie,ce),De&32&&se!==(se=((ue=(Te=ke[5].realtime)==null?void 0:Te.last_month)!=null?ue:"Last month")+"")&&C(x,se),De&512&&V!==(V=ke[9][0]+"")&&C(Z,V),De&512&&ve!==(ve=ke[9][1]+"")&&C(S,ve),ke[4]?D?D.p(ke,De):(D=Rp(ke),D.c(),D.m(N.parentNode,N)):D&&(D.d(1),D=null)},d(ke){ke&&T(t),ke&&T(i),ke&&T(o),ke&&T(w),D&&D.d(ke),ke&&T(N)}}}function a4(e){var Yt,ll,fl,ul,Sl,rl,Cl,nl,ml,dl,Nl,Tl,Qt,Ee,qt,En,Zl,vn,An,Le;let t,l=((ll=(Yt=e[5].common)==null?void 0:Yt.import)!=null?ll:"Import")+"",n,i,o,f,r=Vt((ul=(fl=e[5].common)==null?void 0:fl.hour)!=null?ul:"Hour")+"",c,a,m,p=e[6][0]+"",v,d,h=e[6][1]+"",g,M,A,I,O=Vt((rl=(Sl=e[5].common)==null?void 0:Sl.day)!=null?rl:"Day")+"",L,q,U,P=e[7][0]+"",F,z,G=e[7][1]+"",B,R,K,y,H=Vt((nl=(Cl=e[5].common)==null?void 0:Cl.month)!=null?nl:"Month")+"",Y,X,J,$=e[8][0]+"",ce,ie,oe=e[8][1]+"",ae,se,x,_e,pe=((dl=(ml=e[5].realtime)==null?void 0:ml.last_mo)!=null?dl:"Last mo.")+"",V,Z,ge,ve=e[9][0]+"",S,w,N=e[9][1]+"",D,j,te,le,fe,de=((Tl=(Nl=e[5].common)==null?void 0:Nl.export)!=null?Tl:"Export")+"",qe,Pe,we,Fe,Ae=Vt((Ee=(Qt=e[5].common)==null?void 0:Qt.hour)!=null?Ee:"Hour")+"",ke,De,He,Oe=e[10][0]+"",je,Qe,We=e[10][1]+"",Je,$e,tt,Te,ue=Vt((En=(qt=e[5].common)==null?void 0:qt.day)!=null?En:"Day")+"",Ie,kt,lt,wt=e[11][0]+"",st,ot,xe=e[11][1]+"",Nt,gt,At,Pt,Be=Vt((vn=(Zl=e[5].common)==null?void 0:Zl.month)!=null?vn:"Month")+"",ye,It,vt,nt=e[12][0]+"",Tt,it,at=e[12][1]+"",rt,jt,Lt,Ht,yt=((Le=(An=e[5].realtime)==null?void 0:An.last_mo)!=null?Le:"Last mo.")+"",Me,Ve,Rt,Gt=e[13][0]+"",zt,Dt,Kt=e[13][1]+"",Zt,tl,Jt,ft=e[4]&&Fp(e),Mt=e[4]&&Bp(e),Ke=e[4]&&Up(e),ne=e[4]&&jp(e),Ue=e[4]&&Hp(e),Re=e[4]&&yp(e),St=e[4]&&zp(e),ut=e[4]&&Wp(e);return{c(){t=_("strong"),n=k(l),i=b(),o=_("div"),f=_("div"),c=k(r),a=b(),m=_("div"),v=k(p),d=b(),g=k(h),M=b(),ft&&ft.c(),A=b(),I=_("div"),L=k(O),q=b(),U=_("div"),F=k(P),z=b(),B=k(G),R=b(),Mt&&Mt.c(),K=b(),y=_("div"),Y=k(H),X=b(),J=_("div"),ce=k($),ie=b(),ae=k(oe),se=b(),Ke&&Ke.c(),x=b(),_e=_("div"),V=k(pe),Z=b(),ge=_("div"),S=k(ve),w=b(),D=k(N),j=b(),ne&&ne.c(),le=b(),fe=_("strong"),qe=k(de),Pe=b(),we=_("div"),Fe=_("div"),ke=k(Ae),De=b(),He=_("div"),je=k(Oe),Qe=b(),Je=k(We),$e=b(),Ue&&Ue.c(),tt=b(),Te=_("div"),Ie=k(ue),kt=b(),lt=_("div"),st=k(wt),ot=b(),Nt=k(xe),gt=b(),Re&&Re.c(),At=b(),Pt=_("div"),ye=k(Be),It=b(),vt=_("div"),Tt=k(nt),it=b(),rt=k(at),jt=b(),St&&St.c(),Lt=b(),Ht=_("div"),Me=k(yt),Ve=b(),Rt=_("div"),zt=k(Gt),Dt=b(),Zt=k(Kt),tl=b(),ut&&ut.c(),u(m,"class","text-right"),u(U,"class","text-right"),u(J,"class","text-right"),u(ge,"class","text-right"),u(o,"class",te="grid grid-cols-"+e[14]+" mb-3"),u(He,"class","text-right"),u(lt,"class","text-right"),u(vt,"class","text-right"),u(Rt,"class","text-right"),u(we,"class",Jt="grid grid-cols-"+e[14])},m(he,et){E(he,t,et),s(t,n),E(he,i,et),E(he,o,et),s(o,f),s(f,c),s(o,a),s(o,m),s(m,v),s(m,d),s(m,g),s(o,M),ft&&ft.m(o,null),s(o,A),s(o,I),s(I,L),s(o,q),s(o,U),s(U,F),s(U,z),s(U,B),s(o,R),Mt&&Mt.m(o,null),s(o,K),s(o,y),s(y,Y),s(o,X),s(o,J),s(J,ce),s(J,ie),s(J,ae),s(o,se),Ke&&Ke.m(o,null),s(o,x),s(o,_e),s(_e,V),s(o,Z),s(o,ge),s(ge,S),s(ge,w),s(ge,D),s(o,j),ne&&ne.m(o,null),E(he,le,et),E(he,fe,et),s(fe,qe),E(he,Pe,et),E(he,we,et),s(we,Fe),s(Fe,ke),s(we,De),s(we,He),s(He,je),s(He,Qe),s(He,Je),s(we,$e),Ue&&Ue.m(we,null),s(we,tt),s(we,Te),s(Te,Ie),s(we,kt),s(we,lt),s(lt,st),s(lt,ot),s(lt,Nt),s(we,gt),Re&&Re.m(we,null),s(we,At),s(we,Pt),s(Pt,ye),s(we,It),s(we,vt),s(vt,Tt),s(vt,it),s(vt,rt),s(we,jt),St&&St.m(we,null),s(we,Lt),s(we,Ht),s(Ht,Me),s(we,Ve),s(we,Rt),s(Rt,zt),s(Rt,Dt),s(Rt,Zt),s(we,tl),ut&&ut.m(we,null)},p(he,et){var zn,Dn,Wl,hn,qn,Wn,Gn,_l,Jl,$l,Vn,xl,Gl,bn,On,Kn,Yn,en,cl,Qn;et&32&&l!==(l=((Dn=(zn=he[5].common)==null?void 0:zn.import)!=null?Dn:"Import")+"")&&C(n,l),et&32&&r!==(r=Vt((hn=(Wl=he[5].common)==null?void 0:Wl.hour)!=null?hn:"Hour")+"")&&C(c,r),et&64&&p!==(p=he[6][0]+"")&&C(v,p),et&64&&h!==(h=he[6][1]+"")&&C(g,h),he[4]?ft?ft.p(he,et):(ft=Fp(he),ft.c(),ft.m(o,A)):ft&&(ft.d(1),ft=null),et&32&&O!==(O=Vt((Wn=(qn=he[5].common)==null?void 0:qn.day)!=null?Wn:"Day")+"")&&C(L,O),et&128&&P!==(P=he[7][0]+"")&&C(F,P),et&128&&G!==(G=he[7][1]+"")&&C(B,G),he[4]?Mt?Mt.p(he,et):(Mt=Bp(he),Mt.c(),Mt.m(o,K)):Mt&&(Mt.d(1),Mt=null),et&32&&H!==(H=Vt((_l=(Gn=he[5].common)==null?void 0:Gn.month)!=null?_l:"Month")+"")&&C(Y,H),et&256&&$!==($=he[8][0]+"")&&C(ce,$),et&256&&oe!==(oe=he[8][1]+"")&&C(ae,oe),he[4]?Ke?Ke.p(he,et):(Ke=Up(he),Ke.c(),Ke.m(o,x)):Ke&&(Ke.d(1),Ke=null),et&32&&pe!==(pe=(($l=(Jl=he[5].realtime)==null?void 0:Jl.last_mo)!=null?$l:"Last mo.")+"")&&C(V,pe),et&512&&ve!==(ve=he[9][0]+"")&&C(S,ve),et&512&&N!==(N=he[9][1]+"")&&C(D,N),he[4]?ne?ne.p(he,et):(ne=jp(he),ne.c(),ne.m(o,null)):ne&&(ne.d(1),ne=null),et&16384&&te!==(te="grid grid-cols-"+he[14]+" mb-3")&&u(o,"class",te),et&32&&de!==(de=((xl=(Vn=he[5].common)==null?void 0:Vn.export)!=null?xl:"Export")+"")&&C(qe,de),et&32&&Ae!==(Ae=Vt((bn=(Gl=he[5].common)==null?void 0:Gl.hour)!=null?bn:"Hour")+"")&&C(ke,Ae),et&1024&&Oe!==(Oe=he[10][0]+"")&&C(je,Oe),et&1024&&We!==(We=he[10][1]+"")&&C(Je,We),he[4]?Ue?Ue.p(he,et):(Ue=Hp(he),Ue.c(),Ue.m(we,tt)):Ue&&(Ue.d(1),Ue=null),et&32&&ue!==(ue=Vt((Kn=(On=he[5].common)==null?void 0:On.day)!=null?Kn:"Day")+"")&&C(Ie,ue),et&2048&&wt!==(wt=he[11][0]+"")&&C(st,wt),et&2048&&xe!==(xe=he[11][1]+"")&&C(Nt,xe),he[4]?Re?Re.p(he,et):(Re=yp(he),Re.c(),Re.m(we,At)):Re&&(Re.d(1),Re=null),et&32&&Be!==(Be=Vt((en=(Yn=he[5].common)==null?void 0:Yn.month)!=null?en:"Month")+"")&&C(ye,Be),et&4096&&nt!==(nt=he[12][0]+"")&&C(Tt,nt),et&4096&&at!==(at=he[12][1]+"")&&C(rt,at),he[4]?St?St.p(he,et):(St=zp(he),St.c(),St.m(we,Lt)):St&&(St.d(1),St=null),et&32&&yt!==(yt=((Qn=(cl=he[5].realtime)==null?void 0:cl.last_mo)!=null?Qn:"Last mo.")+"")&&C(Me,yt),et&8192&&Gt!==(Gt=he[13][0]+"")&&C(zt,Gt),et&8192&&Kt!==(Kt=he[13][1]+"")&&C(Zt,Kt),he[4]?ut?ut.p(he,et):(ut=Wp(he),ut.c(),ut.m(we,null)):ut&&(ut.d(1),ut=null),et&16384&&Jt!==(Jt="grid grid-cols-"+he[14])&&u(we,"class",Jt)},d(he){he&&T(t),he&&T(i),he&&T(o),ft&&ft.d(),Mt&&Mt.d(),Ke&&Ke.d(),ne&&ne.d(),he&&T(le),he&&T(fe),he&&T(Pe),he&&T(we),Ue&&Ue.d(),Re&&Re.d(),St&&St.d(),ut&&ut.d()}}}function Rp(e){var Z,ge,ve,S,w,N,D,j,te,le;let t,l=((ge=(Z=e[5].realtime)==null?void 0:Z.cost)!=null?ge:"Cost")+"",n,i,o,f,r=Vt((S=(ve=e[5].common)==null?void 0:ve.hour)!=null?S:"Hour")+"",c,a,m,p=Bt(e[1].h.c,2)+"",v,d,h,g,M,A=Vt((N=(w=e[5].common)==null?void 0:w.day)!=null?N:"Day")+"",I,O,L,q=Bt(e[1].d.c,1)+"",U,P,F,z,G,B=Vt((j=(D=e[5].common)==null?void 0:D.month)!=null?j:"Month")+"",R,K,y,H=Bt(e[1].m.c)+"",Y,X,J,$,ce,ie=((le=(te=e[5].realtime)==null?void 0:te.last_month)!=null?le:"Last month")+"",oe,ae,se,x=Bt(e[0].last_month.c)+"",_e,pe,V;return{c(){t=_("strong"),n=k(l),i=b(),o=_("div"),f=_("div"),c=k(r),a=b(),m=_("div"),v=k(p),d=b(),h=k(e[2]),g=b(),M=_("div"),I=k(A),O=b(),L=_("div"),U=k(q),P=b(),F=k(e[2]),z=b(),G=_("div"),R=k(B),K=b(),y=_("div"),Y=k(H),X=b(),J=k(e[2]),$=b(),ce=_("div"),oe=k(ie),ae=b(),se=_("div"),_e=k(x),pe=b(),V=k(e[2]),u(m,"class","text-right"),u(L,"class","text-right"),u(y,"class","text-right"),u(se,"class","text-right"),u(o,"class","grid grid-cols-2")},m(fe,de){E(fe,t,de),s(t,n),E(fe,i,de),E(fe,o,de),s(o,f),s(f,c),s(o,a),s(o,m),s(m,v),s(m,d),s(m,h),s(o,g),s(o,M),s(M,I),s(o,O),s(o,L),s(L,U),s(L,P),s(L,F),s(o,z),s(o,G),s(G,R),s(o,K),s(o,y),s(y,Y),s(y,X),s(y,J),s(o,$),s(o,ce),s(ce,oe),s(o,ae),s(o,se),s(se,_e),s(se,pe),s(se,V)},p(fe,de){var qe,Pe,we,Fe,Ae,ke,De,He,Oe,je;de&32&&l!==(l=((Pe=(qe=fe[5].realtime)==null?void 0:qe.cost)!=null?Pe:"Cost")+"")&&C(n,l),de&32&&r!==(r=Vt((Fe=(we=fe[5].common)==null?void 0:we.hour)!=null?Fe:"Hour")+"")&&C(c,r),de&2&&p!==(p=Bt(fe[1].h.c,2)+"")&&C(v,p),de&4&&C(h,fe[2]),de&32&&A!==(A=Vt((ke=(Ae=fe[5].common)==null?void 0:Ae.day)!=null?ke:"Day")+"")&&C(I,A),de&2&&q!==(q=Bt(fe[1].d.c,1)+"")&&C(U,q),de&4&&C(F,fe[2]),de&32&&B!==(B=Vt((He=(De=fe[5].common)==null?void 0:De.month)!=null?He:"Month")+"")&&C(R,B),de&2&&H!==(H=Bt(fe[1].m.c)+"")&&C(Y,H),de&4&&C(J,fe[2]),de&32&&ie!==(ie=((je=(Oe=fe[5].realtime)==null?void 0:Oe.last_month)!=null?je:"Last month")+"")&&C(oe,ie),de&1&&x!==(x=Bt(fe[0].last_month.c)+"")&&C(_e,x),de&4&&C(V,fe[2])},d(fe){fe&&T(t),fe&&T(i),fe&&T(o)}}}function Fp(e){let t,l=Bt(e[1].h.c,2)+"",n,i,o;return{c(){t=_("div"),n=k(l),i=b(),o=k(e[2]),u(t,"class","text-right")},m(f,r){E(f,t,r),s(t,n),s(t,i),s(t,o)},p(f,r){r&2&&l!==(l=Bt(f[1].h.c,2)+"")&&C(n,l),r&4&&C(o,f[2])},d(f){f&&T(t)}}}function Bp(e){let t,l=Bt(e[1].d.c,1)+"",n,i,o;return{c(){t=_("div"),n=k(l),i=b(),o=k(e[2]),u(t,"class","text-right")},m(f,r){E(f,t,r),s(t,n),s(t,i),s(t,o)},p(f,r){r&2&&l!==(l=Bt(f[1].d.c,1)+"")&&C(n,l),r&4&&C(o,f[2])},d(f){f&&T(t)}}}function Up(e){let t,l=Bt(e[1].m.c)+"",n,i,o;return{c(){t=_("div"),n=k(l),i=b(),o=k(e[2]),u(t,"class","text-right")},m(f,r){E(f,t,r),s(t,n),s(t,i),s(t,o)},p(f,r){r&2&&l!==(l=Bt(f[1].m.c)+"")&&C(n,l),r&4&&C(o,f[2])},d(f){f&&T(t)}}}function jp(e){let t,l=Bt(e[0].last_month.c)+"",n,i,o;return{c(){t=_("div"),n=k(l),i=b(),o=k(e[2]),u(t,"class","text-right")},m(f,r){E(f,t,r),s(t,n),s(t,i),s(t,o)},p(f,r){r&1&&l!==(l=Bt(f[0].last_month.c)+"")&&C(n,l),r&4&&C(o,f[2])},d(f){f&&T(t)}}}function Hp(e){let t,l=Bt(e[1].h.i,2)+"",n,i,o;return{c(){t=_("div"),n=k(l),i=b(),o=k(e[2]),u(t,"class","text-right")},m(f,r){E(f,t,r),s(t,n),s(t,i),s(t,o)},p(f,r){r&2&&l!==(l=Bt(f[1].h.i,2)+"")&&C(n,l),r&4&&C(o,f[2])},d(f){f&&T(t)}}}function yp(e){let t,l=Bt(e[1].d.i,1)+"",n,i,o;return{c(){t=_("div"),n=k(l),i=b(),o=k(e[2]),u(t,"class","text-right")},m(f,r){E(f,t,r),s(t,n),s(t,i),s(t,o)},p(f,r){r&2&&l!==(l=Bt(f[1].d.i,1)+"")&&C(n,l),r&4&&C(o,f[2])},d(f){f&&T(t)}}}function zp(e){let t,l=Bt(e[1].m.i)+"",n,i,o;return{c(){t=_("div"),n=k(l),i=b(),o=k(e[2]),u(t,"class","text-right")},m(f,r){E(f,t,r),s(t,n),s(t,i),s(t,o)},p(f,r){r&2&&l!==(l=Bt(f[1].m.i)+"")&&C(n,l),r&4&&C(o,f[2])},d(f){f&&T(t)}}}function Wp(e){let t,l=Bt(e[0].last_month.i)+"",n,i,o;return{c(){t=_("div"),n=k(l),i=b(),o=k(e[2]),u(t,"class","text-right")},m(f,r){E(f,t,r),s(t,n),s(t,i),s(t,o)},p(f,r){r&1&&l!==(l=Bt(f[0].last_month.i)+"")&&C(n,l),r&4&&C(o,f[2])},d(f){f&&T(t)}}}function f4(e){var m,p;let t,l,n=((p=(m=e[5].realtime)==null?void 0:m.title)!=null?p:"Real time calculations")+"",i,o,f,r,c,a=e[1]&&Lp(e);return{c(){t=_("div"),l=_("strong"),i=k(n),o=b(),f=_("br"),r=_("br"),c=b(),a&&a.c(),u(t,"class","mx-2 text-sm")},m(v,d){E(v,t,d),s(t,l),s(l,i),s(t,o),s(t,f),s(t,r),s(t,c),a&&a.m(t,null)},p(v,[d]){var h,g;d&32&&n!==(n=((g=(h=v[5].realtime)==null?void 0:h.title)!=null?g:"Real time calculations")+"")&&C(i,n),v[1]?a?a.p(v,d):(a=Lp(v),a.c(),a.m(t,null)):a&&(a.d(1),a=null)},i:ze,o:ze,d(v){v&&T(t),a&&a.d()}}}function u4(e,t,l){let{sysinfo:n}=t,{data:i}=t,{currency:o}=t,{hasExport:f}=t,r={};Ml.subscribe(I=>{l(5,r=I)});let c,a,m,p,v,d,h,g,M=!1,A=3;return e.$$set=I=>{"sysinfo"in I&&l(0,n=I.sysinfo),"data"in I&&l(1,i=I.data),"currency"in I&&l(2,o=I.currency),"hasExport"in I&&l(3,f=I.hasExport)},e.$$.update=()=>{var I,O,L,q,U,P,F,z;e.$$.dirty&19&&(l(4,M=i&&i.h&&(Math.abs(i.h.c)>.01||Math.abs(i.d.c)>.01||Math.abs(i.m.c)>.01||Math.abs(i.h.i)>.01||Math.abs(i.d.i)>.01||Math.abs(i.m.i)>.01)),l(14,A=M?3:2),l(6,c=gl(((I=i==null?void 0:i.h)==null?void 0:I.u)*1e3,"Wh")),l(7,a=gl(((O=i==null?void 0:i.d)==null?void 0:O.u)*1e3,"Wh")),l(8,m=gl(((L=i==null?void 0:i.m)==null?void 0:L.u)*1e3,"Wh")),l(9,p=gl(((q=n==null?void 0:n.last_month)==null?void 0:q.c)*1e3,"Wh")),l(10,v=gl(((U=i==null?void 0:i.h)==null?void 0:U.p)*1e3,"Wh")),l(11,d=gl(((P=i==null?void 0:i.d)==null?void 0:P.p)*1e3,"Wh")),l(12,h=gl(((F=i==null?void 0:i.m)==null?void 0:F.p)*1e3,"Wh")),l(13,g=gl(((z=n==null?void 0:n.last_month)==null?void 0:z.p)*1e3,"Wh")))},[n,i,o,f,M,r,c,a,m,p,v,d,h,g,A]}class r4 extends _t{constructor(t){super(),mt(this,t,u4,f4,ct,{sysinfo:0,data:1,currency:2,hasExport:3})}}function c4(e){let t,l,n=tp(e[0].source)+"",i,o,f,r,c;return r=new wi({props:{config:e[1]}}),{c(){t=_("a"),l=k("Provided by: "),i=k(n),f=b(),Ne(r.$$.fragment),u(t,"href",o=lp(e[0].source)),u(t,"target","_blank"),u(t,"class","text-xs float-right z-40")},m(a,m){E(a,t,m),s(t,l),s(t,i),E(a,f,m),Se(r,a,m),c=!0},p(a,[m]){(!c||m&1)&&n!==(n=tp(a[0].source)+"")&&C(i,n),(!c||m&1&&o!==(o=lp(a[0].source)))&&u(t,"href",o);const p={};m&2&&(p.config=a[1]),r.$set(p)},i(a){c||(Q(r.$$.fragment,a),c=!0)},o(a){ee(r.$$.fragment,a),c=!1},d(a){a&&T(t),a&&T(f),Ce(r,a)}}}function m4(e,t,l){let{title:n}=t,{json:i}=t,{sysinfo:o}=t,f={},r,c,a=document.documentElement.classList.contains("dark");return e.$$set=m=>{"title"in m&&l(2,n=m.title),"json"in m&&l(0,i=m.json),"sysinfo"in m&&l(3,o=m.sysinfo)},e.$$.update=()=>{if(e.$$.dirty&61){let m=i.currency,p=new Date().getUTCHours(),v=0,d=0,h=0,g=[],M=[],A=[];l(5,c=l(4,r=0));let I=new Date;for(Tn(I,o.clock_offset-(24+I.getHours()-I.getUTCHours())%24),v=p;v<24&&(d=i[ht(h++)],d!=null);v++)M.push({label:ht(I.getHours())}),A.push(d*100),l(5,c=Math.min(c,d*100)),l(4,r=Math.max(r,d*100)),Tn(I,1);for(v=0;v<24&&(d=i[ht(h++)],d!=null);v++)M.push({label:ht(I.getHours())}),A.push(d*100),l(5,c=Math.min(c,d*100)),l(4,r=Math.max(r,d*100)),Tn(I,1);if(c>-100&&r<100){switch(m){case"NOK":case"DKK":m="\xF8re";break;case"SEK":m="\xF6re";break;case"EUR":m="cent";break;case"CHF":m="rp.";break;default:m=m+"/100"}for(l(5,c*=100),l(4,r*=100),v=0;v=0?P.toFixed(F):"",title:P>=0?P.toFixed(2)+" "+m:"",value:d>=0?Math.abs(d):0,label2:P<0?P.toFixed(F):"",title2:P<0?P.toFixed(2)+" "+m:"",value2:d<0?Math.abs(d):0,color:a?"#5c2da5":"#7c3aed"})}let L=Math.max(r,Math.abs(c));if(c<0){l(5,c=Math.min(L/4*-1,c));let P=Math.ceil(Math.abs(c)/L*4),F=c/P;for(v=1;v{"title"in m&&l(1,n=m.title),"json"in m&&l(2,i=m.json),"sysinfo"in m&&l(3,o=m.sysinfo)},e.$$.update=()=>{if(e.$$.dirty&62){let m=0,p=[],v=[],d=[];l(5,c=l(4,r=0));let h=Tn(new Date,-24),g=new Date().getUTCHours();for(Tn(h,o.clock_offset-(24+h.getHours()-h.getUTCHours())%24),m=g;m<24;m++){let O=i["i"+ht(m)],L=i["e"+ht(m)];O===void 0&&(O=0),L===void 0&&(L=0),v.push({label:ht(h.getHours())}),d.push({label:O.toFixed(1),title:O.toFixed(2)+" kWh",value:O*10,label2:L.toFixed(1),title2:L.toFixed(2)+" kWh",value2:L*10,color:a?"#5c2da5":"#7c3aed",color2:a?"#27728e":"#37829e"}),l(5,c=Math.max(c,L*10)),l(4,r=Math.max(r,O*10)),Tn(h,1)}for(m=0;m{"title"in m&&l(1,n=m.title),"json"in m&&l(2,i=m.json),"sysinfo"in m&&l(3,o=m.sysinfo)},e.$$.update=()=>{if(e.$$.dirty&62){let m=0,p=[],v=[],d=[];l(5,c=l(4,r=0));let h=new Date,g=new Date;for(Tn(h,o.clock_offset-(24+h.getHours()-h.getUTCHours())%24),Tn(g,o.clock_offset-(24+g.getHours()-g.getUTCHours())%24),g.setDate(0),m=h.getDate();m<=g.getDate();m++){let O=i["i"+ht(m)],L=i["e"+ht(m)];O===void 0&&(O=0),L===void 0&&(L=0),v.push({label:ht(m)}),d.push({label:O.toFixed(O<10?1:0),title:O.toFixed(2)+" kWh",value:O,label2:L.toFixed(L<10?1:0),title2:L.toFixed(2)+" kWh",value2:L,color:a?"#5c2da5":"#7c3aed",color2:a?"#27728e":"#37829e"}),l(5,c=Math.max(c,L)),l(4,r=Math.max(r,O))}for(m=1;m{"title"in a&&l(1,n=a.title),"json"in a&&l(2,i=a.json)},e.$$.update=()=>{if(e.$$.dirty&30){let a=0,m=0,p=[],v=[],d=[];i.s&&i.s.forEach((M,A)=>{var I=M.n?M.n:M.a;m=M.v,m==-127&&(m=0),v.push({label:I.slice(-4)}),d.push({label:m.toFixed(1),value:m,color:o?"#5c2da5":"#7c3aed"}),l(4,c=Math.min(c,m)),l(3,r=Math.max(r,m))}),l(3,r=Math.ceil(r)),l(4,c=Math.floor(c));let h=r;c<0&&(h+=Math.abs(c));let g=h/4;for(a=0;a<5;a++)m=c+g*a,p.push({value:m,label:m.toFixed(1)});l(0,f={title:n+" (\xB0C)",height:226,width:1520,padding:{top:20,right:15,bottom:20,left:35},y:{min:c,max:r,ticks:p},x:{ticks:v},points:d})}},[f,n,i,r,c]}class M4 extends _t{constructor(t){super(),mt(this,t,w4,k4,ct,{title:1,json:2})}}function S4(e){let t,l;return t=new wi({props:{config:e[0]}}),{c(){Ne(t.$$.fragment)},m(n,i){Se(t,n,i),l=!0},p(n,[i]){const o={};i&1&&(o.config=n[0]),t.$set(o)},i(n){l||(Q(t.$$.fragment,n),l=!0)},o(n){ee(t.$$.fragment,n),l=!1},d(n){Ce(t,n)}}}let C4=0;function N4(e,t,l){let n={};Ml.subscribe(a=>{l(2,n=a)});let{title:i}=t,o=document.documentElement.classList.contains("dark"),f={},r=0,c;return Rv.subscribe(a=>{l(4,c=a)}),Lv(),e.$$set=a=>{"title"in a&&l(1,i=a.title)},e.$$.update=()=>{var a;if(e.$$.dirty&30){let m=0,p=[],v=[],d=[];if(p.push({value:0,label:0}),c&&c.p)for(m=0;m0?ht(h.d)+"."+((a=n.months)==null?void 0:a[new Date().getMonth()]):"-"}),l(3,r=Math.max(r,h.v))}if(c&&c.t){for(m=0;m=r)break;p.push({value:h,label:h})}p.push({label:c.m.toFixed(1),align:"right",color:"green",value:c.m})}c&&c.c&&(p.push({label:c.c.toFixed(0),color:"orange",value:c.c}),l(3,r=Math.max(r,c.c))),l(3,r=Math.ceil(r)),l(0,f={title:i,padding:{top:20,right:35,bottom:20,left:35},y:{min:C4,max:r,ticks:p},x:{ticks:v},points:d})}},[f,i,n,r,c]}class T4 extends _t{constructor(t){super(),mt(this,t,N4,S4,ct,{title:1})}}function Gp(e,t,l){const n=e.slice();return n[24]=t[l],n[26]=l,n}function Vp(e,t,l){const n=e.slice();return n[27]=t[l],n}function Kp(e){let t,l,n,i,o,f=e[8],r=[];for(let m=0;me[16].call(t))},m(m,p){E(m,t,p),s(t,l),s(l,n),s(l,i),s(l,o),s(l,f),s(t,r),a&&a.m(t,null),c=hf(t,e[16].bind(t))},p(m,[p]){p&1&&C(n,m[0]),p&2048&&C(o,m[11]),m[8]?a?a.p(m,p):(a=Kp(m),a.c(),a.m(t,null)):a&&(a.d(1),a=null)},i:ze,o:ze,d(m){m&&T(t),a&&a.d(),c()}}}function E4(e,t,l){let{title:n}=t,i=document.documentElement.classList.contains("dark"),o,f=0,r=0,c=0,a=!1,m=null,p;Fv.subscribe(B=>{l(13,m=B),c=f,p&&clearTimeout(p),p=setTimeout(Ho,6e5)});function v(){if(o&&clearTimeout(o),c>f||c-f>300)Ho();else{for(;f>c;)m.data.unshift(r),l(13,m.data=m.data.slice(0,m.size),m),c+=10;o=setTimeout(v,1e4)}}Pv.subscribe(B=>{var R;if(r=B.i-B.e,f=B.u,!a){Ho(),a=!0;return}!((R=m==null?void 0:m.data)!=null&&R.length)||o||(o=setTimeout(v,1e4))});let d,h,g,M,A,I,O,L,q,U,P,F,z;function G(){g=this.clientWidth,M=this.clientHeight,l(1,g),l(2,M)}return e.$$set=B=>{"title"in B&&l(0,n=B.title)},e.$$.update=()=>{if(e.$$.dirty&59390&&(l(3,A=parseInt(M)-50),l(4,I=g-35),l(10,F=I/m.size),l(15,h=0),l(14,d=0),m.data)){for(let R in m.data){let K=m.data[R];isNaN(K)&&(K=0),l(14,d=Math.max(Math.ceil(K/1e3)*1e3,d)),l(15,h=Math.min(Math.ceil(K/1e3)*1e3,h))}l(11,z=d>2500?"kW":"W"),l(8,U=[]);for(let R=h;R2500?(R/1e3).toFixed(1):R});l(9,P=[]);for(let R=0;R900?q/1e3:q)+(q>900?"k":"")+i,title:q.toFixed(2)+" "+i,value:isNaN(q)?0:q,color:A(q?q/g*100:0,document.documentElement.classList.contains("dark")),label2:Bt(U>900?U/1e3:U)+(U>900?"k":"")+i,title2:U.toFixed(2)+" "+i,value2:isNaN(U)?0:U,color2:I(U?U/M*100:0)}}return e.$$set=q=>{"title"in q&&l(1,n=q.title),"unit"in q&&l(2,i=q.unit),"l1"in q&&l(3,o=q.l1),"l2"in q&&l(4,f=q.l2),"l2x"in q&&l(5,r=q.l2x),"l3"in q&&l(6,c=q.l3),"l1i"in q&&l(7,a=q.l1i),"l2i"in q&&l(8,m=q.l2i),"l3i"in q&&l(9,p=q.l3i),"l1e"in q&&l(10,v=q.l1e),"l2e"in q&&l(11,d=q.l2e),"l3e"in q&&l(12,h=q.l3e),"maxImport"in q&&l(13,g=q.maxImport),"maxExport"in q&&l(14,M=q.maxExport),"importColorFn"in q&&l(15,A=q.importColorFn),"exportColorFn"in q&&l(16,I=q.exportColorFn)},e.$$.update=()=>{if(e.$$.dirty&32762){let q=[],U=[];o&&(q.push({label:"L1"}),U.push(L(a,v))),f&&(r?(q.push({label:"L2"}),U.push({label:"Not available",labelAngle:-90,title:"L2 current is not reported by your meter",value:0,color:"#7c3aedcc"})):(q.push({label:"L2"}),U.push(L(m,d)))),c&&(q.push({label:"L3"}),U.push(L(p,h)));let P=[];M&&(P.push({value:-M,label:"-100%"}),P.push({value:-M/4*3,label:"-75%"}),P.push({value:-M/2,label:"-50%"}),P.push({value:-M/4,label:"-25%"})),P.push({value:0,label:"0%"}),g&&(P.push({value:g/4,label:"25%"}),P.push({value:g/2,label:"50%"}),P.push({value:g/4*3,label:"75%"}),P.push({value:g,label:"100%"})),l(0,O={title:n,padding:{top:20,right:15,bottom:20,left:35},y:{min:-M,max:g,ticks:P},x:{ticks:q},points:U})}},[O,n,i,o,f,r,c,a,m,p,v,d,h,g,M,A,I]}class Ef extends _t{constructor(t){super(),mt(this,t,q4,D4,ct,{title:1,unit:2,l1:3,l2:4,l2x:5,l3:6,l1i:7,l2i:8,l3i:9,l1e:10,l2e:11,l3e:12,maxImport:13,maxExport:14,importColorFn:15,exportColorFn:16})}}function Jp(e){var A,I;let t,l,n,i,o,f,r=(e[0].mt?Ko(e[0].mt):"-")+"",c,a,m,p=e[7][0]+"",v,d,h=e[7][1]+"",g,M;return i=new yv({props:{val:e[0].i?e[0].i:0,max:e[0].im?e[0].im:15e3,unit:"W",label:(I=(A=e[6].common)==null?void 0:A.import)!=null?I:"Import",sub:e[0].p,subunit:e[0].pc,colorFn:Mf}}),{c(){t=_("div"),l=_("div"),n=_("div"),Ne(i.$$.fragment),o=b(),f=_("div"),c=k(r),a=b(),m=_("div"),v=k(p),d=b(),g=k(h),u(n,"class","col-span-2"),u(m,"class","text-right"),u(l,"class","grid grid-cols-2"),u(t,"class","cnt")},m(O,L){E(O,t,L),s(t,l),s(l,n),Se(i,n,null),s(l,o),s(l,f),s(f,c),s(l,a),s(l,m),s(m,v),s(m,d),s(m,g),M=!0},p(O,L){var U,P;const q={};L&1&&(q.val=O[0].i?O[0].i:0),L&1&&(q.max=O[0].im?O[0].im:15e3),L&64&&(q.label=(P=(U=O[6].common)==null?void 0:U.import)!=null?P:"Import"),L&1&&(q.sub=O[0].p),L&1&&(q.subunit=O[0].pc),i.$set(q),(!M||L&1)&&r!==(r=(O[0].mt?Ko(O[0].mt):"-")+"")&&C(c,r),(!M||L&128)&&p!==(p=O[7][0]+"")&&C(v,p),(!M||L&128)&&h!==(h=O[7][1]+"")&&C(g,h)},i(O){M||(Q(i.$$.fragment,O),M=!0)},o(O){ee(i.$$.fragment,O),M=!1},d(O){O&&T(t),Ce(i)}}}function $p(e){var g,M;let t,l,n,i,o,f,r,c,a=e[8][0]+"",m,p,v=e[8][1]+"",d,h;return i=new yv({props:{val:e[0].e?e[0].e:0,max:e[0].om?e[0].om*1e3:1e4,unit:"W",label:(M=(g=e[6].common)==null?void 0:g.export)!=null?M:"Export",colorFn:Rs}}),{c(){t=_("div"),l=_("div"),n=_("div"),Ne(i.$$.fragment),o=b(),f=_("div"),r=b(),c=_("div"),m=k(a),p=b(),d=k(v),u(n,"class","col-span-2"),u(c,"class","text-right"),u(l,"class","grid grid-cols-2"),u(t,"class","cnt")},m(A,I){E(A,t,I),s(t,l),s(l,n),Se(i,n,null),s(l,o),s(l,f),s(l,r),s(l,c),s(c,m),s(c,p),s(c,d),h=!0},p(A,I){var L,q;const O={};I&1&&(O.val=A[0].e?A[0].e:0),I&1&&(O.max=A[0].om?A[0].om*1e3:1e4),I&64&&(O.label=(q=(L=A[6].common)==null?void 0:L.export)!=null?q:"Export"),i.$set(O),(!h||I&256)&&a!==(a=A[8][0]+"")&&C(m,a),(!h||I&256)&&v!==(v=A[8][1]+"")&&C(d,v)},i(A){h||(Q(i.$$.fragment,A),h=!0)},o(A){ee(i.$$.fragment,A),h=!1},d(A){A&&T(t),Ce(i)}}}function xp(e){let t,l,n=e[0].l1&&e2(e);return{c(){t=_("div"),n&&n.c(),u(t,"class","cnt")},m(i,o){E(i,t,o),n&&n.m(t,null),l=!0},p(i,o){i[0].l1?n?(n.p(i,o),o&1&&Q(n,1)):(n=e2(i),n.c(),Q(n,1),n.m(t,null)):n&&(pt(),ee(n,1,1,()=>{n=null}),dt())},i(i){l||(Q(n),l=!0)},o(i){ee(n),l=!1},d(i){i&&T(t),n&&n.d()}}}function e2(e){var n,i;let t,l;return t=new l4({props:{title:(i=(n=e[6].common)==null?void 0:n.voltage)!=null?i:"Volt",u1:e[0].l1.u,u2:e[0].l2.u,u3:e[0].l3.u,ds:e[0].ds}}),{c(){Ne(t.$$.fragment)},m(o,f){Se(t,o,f),l=!0},p(o,f){var c,a;const r={};f&64&&(r.title=(a=(c=o[6].common)==null?void 0:c.voltage)!=null?a:"Volt"),f&1&&(r.u1=o[0].l1.u),f&1&&(r.u2=o[0].l2.u),f&1&&(r.u3=o[0].l3.u),f&1&&(r.ds=o[0].ds),t.$set(r)},i(o){l||(Q(t.$$.fragment,o),l=!0)},o(o){ee(t.$$.fragment,o),l=!1},d(o){Ce(t,o)}}}function t2(e){let t,l,n=e[0].l1&&l2(e);return{c(){t=_("div"),n&&n.c(),u(t,"class","cnt")},m(i,o){E(i,t,o),n&&n.m(t,null),l=!0},p(i,o){i[0].l1?n?(n.p(i,o),o&1&&Q(n,1)):(n=l2(i),n.c(),Q(n,1),n.m(t,null)):n&&(pt(),ee(n,1,1,()=>{n=null}),dt())},i(i){l||(Q(n),l=!0)},o(i){ee(n),l=!1},d(i){i&&T(t),n&&n.d()}}}function l2(e){var n,i;let t,l;return t=new Ef({props:{title:(i=(n=e[6].common)==null?void 0:n.amperage)!=null?i:"Amp",unit:"A",importColorFn:Mf,exportColorFn:Rs,maxImport:e[0].mf,maxExport:e[0].om?e[9]?e[0].om/.4/Math.sqrt(3):e[0].om/.23:0,l1:e[0].l1&&e[0].l1.u>100,l2:e[0].l2&&e[0].l2.u>100,l3:e[0].l3&&e[0].l3.u>100,l2x:e[0].i2e,l1i:Math.max(e[0].l1.i,0),l2i:Math.max(e[0].l2.i,0),l3i:Math.max(e[0].l3.i,0),l1e:Math.max(e[0].l1.e,0),l2e:Math.max(e[0].l2.e,0),l3e:Math.max(e[0].l3.e,0)}}),{c(){Ne(t.$$.fragment)},m(o,f){Se(t,o,f),l=!0},p(o,f){var c,a;const r={};f&64&&(r.title=(a=(c=o[6].common)==null?void 0:c.amperage)!=null?a:"Amp"),f&1&&(r.maxImport=o[0].mf),f&513&&(r.maxExport=o[0].om?o[9]?o[0].om/.4/Math.sqrt(3):o[0].om/.23:0),f&1&&(r.l1=o[0].l1&&o[0].l1.u>100),f&1&&(r.l2=o[0].l2&&o[0].l2.u>100),f&1&&(r.l3=o[0].l3&&o[0].l3.u>100),f&1&&(r.l2x=o[0].i2e),f&1&&(r.l1i=Math.max(o[0].l1.i,0)),f&1&&(r.l2i=Math.max(o[0].l2.i,0)),f&1&&(r.l3i=Math.max(o[0].l3.i,0)),f&1&&(r.l1e=Math.max(o[0].l1.e,0)),f&1&&(r.l2e=Math.max(o[0].l2.e,0)),f&1&&(r.l3e=Math.max(o[0].l3.e,0)),t.$set(r)},i(o){l||(Q(t.$$.fragment,o),l=!0)},o(o){ee(t.$$.fragment,o),l=!1},d(o){Ce(t,o)}}}function n2(e){let t,l,n=e[0].l1&&i2(e);return{c(){t=_("div"),n&&n.c(),u(t,"class","cnt")},m(i,o){E(i,t,o),n&&n.m(t,null),l=!0},p(i,o){i[0].l1?n?(n.p(i,o),o&1&&Q(n,1)):(n=i2(i),n.c(),Q(n,1),n.m(t,null)):n&&(pt(),ee(n,1,1,()=>{n=null}),dt())},i(i){l||(Q(n),l=!0)},o(i){ee(n),l=!1},d(i){i&&T(t),n&&n.d()}}}function i2(e){var n,i;let t,l;return t=new Ef({props:{title:(i=(n=e[6].dashboard)==null?void 0:n.phase)!=null?i:"Phase",unit:"W",importColorFn:Mf,exportColorFn:Rs,maxImport:(e[0].mf?e[0].mf:32)*230,maxExport:e[0].om?e[9]?e[0].om*1e3/Math.sqrt(3):e[0].om*1e3:0,l1:e[0].l1&&e[0].l1.u>100,l2:e[0].l2&&e[0].l2.u>100,l3:e[0].l3&&e[0].l3.u>100,l1i:e[0].l1.p,l2i:e[0].l2.p,l3i:e[0].l3.p,l1e:e[0].l1.q,l2e:e[0].l2.q,l3e:e[0].l3.q}}),{c(){Ne(t.$$.fragment)},m(o,f){Se(t,o,f),l=!0},p(o,f){var c,a;const r={};f&64&&(r.title=(a=(c=o[6].dashboard)==null?void 0:c.phase)!=null?a:"Phase"),f&1&&(r.maxImport=(o[0].mf?o[0].mf:32)*230),f&513&&(r.maxExport=o[0].om?o[9]?o[0].om*1e3/Math.sqrt(3):o[0].om*1e3:0),f&1&&(r.l1=o[0].l1&&o[0].l1.u>100),f&1&&(r.l2=o[0].l2&&o[0].l2.u>100),f&1&&(r.l3=o[0].l3&&o[0].l3.u>100),f&1&&(r.l1i=o[0].l1.p),f&1&&(r.l2i=o[0].l2.p),f&1&&(r.l3i=o[0].l3.p),f&1&&(r.l1e=o[0].l1.q),f&1&&(r.l2e=o[0].l2.q),f&1&&(r.l3e=o[0].l3.q),t.$set(r)},i(o){l||(Q(t.$$.fragment,o),l=!0)},o(o){ee(t.$$.fragment,o),l=!1},d(o){Ce(t,o)}}}function s2(e){let t,l,n=e[0].l1&&o2(e);return{c(){t=_("div"),n&&n.c(),u(t,"class","cnt")},m(i,o){E(i,t,o),n&&n.m(t,null),l=!0},p(i,o){i[0].l1?n?(n.p(i,o),o&1&&Q(n,1)):(n=o2(i),n.c(),Q(n,1),n.m(t,null)):n&&(pt(),ee(n,1,1,()=>{n=null}),dt())},i(i){l||(Q(n),l=!0)},o(i){ee(n),l=!1},d(i){i&&T(t),n&&n.d()}}}function o2(e){var n,i;let t,l;return t=new Ef({props:{title:(i=(n=e[6].dashboard)==null?void 0:n.pf)!=null?i:"Pf",importColorFn:Rs,exportColorFn:Rs,maxImport:1,l1:e[0].l1&&e[0].l1.u>100,l2:e[0].l2&&e[0].l2.u>100,l3:e[0].l3&&e[0].l3.u>100,l1i:e[0].l1.f,l2i:e[0].l2.f,l3i:e[0].l3.f}}),{c(){Ne(t.$$.fragment)},m(o,f){Se(t,o,f),l=!0},p(o,f){var c,a;const r={};f&64&&(r.title=(a=(c=o[6].dashboard)==null?void 0:c.pf)!=null?a:"Pf"),f&1&&(r.l1=o[0].l1&&o[0].l1.u>100),f&1&&(r.l2=o[0].l2&&o[0].l2.u>100),f&1&&(r.l3=o[0].l3&&o[0].l3.u>100),f&1&&(r.l1i=o[0].l1.f),f&1&&(r.l2i=o[0].l2.f),f&1&&(r.l3i=o[0].l3.f),t.$set(r)},i(o){l||(Q(t.$$.fragment,o),l=!0)},o(o){ee(t.$$.fragment,o),l=!1},d(o){Ce(t,o)}}}function a2(e){let t,l,n;return l=new s4({props:{importInstant:e[0].ri,exportInstant:e[0].re,importTotal:e[0].ric,exportTotal:e[0].rec}}),{c(){t=_("div"),Ne(l.$$.fragment),u(t,"class","cnt")},m(i,o){E(i,t,o),Se(l,t,null),n=!0},p(i,o){const f={};o&1&&(f.importInstant=i[0].ri),o&1&&(f.exportInstant=i[0].re),o&1&&(f.importTotal=i[0].ric),o&1&&(f.exportTotal=i[0].rec),l.$set(f)},i(i){n||(Q(l.$$.fragment,i),n=!0)},o(i){ee(l.$$.fragment,i),n=!1},d(i){i&&T(t),Ce(l)}}}function f2(e){let t,l,n;return l=new r4({props:{sysinfo:e[1],data:e[0].ea,currency:e[0].pc,hasExport:e[0].om>0||e[0].e>0}}),{c(){t=_("div"),Ne(l.$$.fragment),u(t,"class","cnt")},m(i,o){E(i,t,o),Se(l,t,null),n=!0},p(i,o){const f={};o&2&&(f.sysinfo=i[1]),o&1&&(f.data=i[0].ea),o&1&&(f.currency=i[0].pc),o&1&&(f.hasExport=i[0].om>0||i[0].e>0),l.$set(f)},i(i){n||(Q(l.$$.fragment,i),n=!0)},o(i){ee(l.$$.fragment,i),n=!1},d(i){i&&T(t),Ce(l)}}}function u2(e){var i,o;let t,l,n;return l=new T4({props:{title:(o=(i=e[6].dashboard)==null?void 0:i.tariffpeak)!=null?o:"Tariff peaks"}}),{c(){t=_("div"),Ne(l.$$.fragment),u(t,"class","cnt h-64")},m(f,r){E(f,t,r),Se(l,t,null),n=!0},p(f,r){var a,m;const c={};r&64&&(c.title=(m=(a=f[6].dashboard)==null?void 0:a.tariffpeak)!=null?m:"Tariff peaks"),l.$set(c)},i(f){n||(Q(l.$$.fragment,f),n=!0)},o(f){ee(l.$$.fragment,f),n=!1},d(f){f&&T(t),Ce(l)}}}function r2(e){var i,o;let t,l,n;return l=new A4({props:{title:(o=(i=e[6].dashboard)==null?void 0:i.realtime)!=null?o:"Real time"}}),{c(){t=_("div"),Ne(l.$$.fragment),u(t,"class","cnt gwf")},m(f,r){E(f,t,r),Se(l,t,null),n=!0},p(f,r){var a,m;const c={};r&64&&(c.title=(m=(a=f[6].dashboard)==null?void 0:a.realtime)!=null?m:"Real time"),l.$set(c)},i(f){n||(Q(l.$$.fragment,f),n=!0)},o(f){ee(l.$$.fragment,f),n=!1},d(f){f&&T(t),Ce(l)}}}function c2(e){var i,o;let t,l,n;return l=new _4({props:{title:(o=(i=e[6].dashboard)==null?void 0:i.price)!=null?o:"Price",json:e[2],sysinfo:e[1]}}),{c(){t=_("div"),Ne(l.$$.fragment),u(t,"class","cnt gwf")},m(f,r){E(f,t,r),Se(l,t,null),n=!0},p(f,r){var a,m;const c={};r&64&&(c.title=(m=(a=f[6].dashboard)==null?void 0:a.price)!=null?m:"Price"),r&4&&(c.json=f[2]),r&2&&(c.sysinfo=f[1]),l.$set(c)},i(f){n||(Q(l.$$.fragment,f),n=!0)},o(f){ee(l.$$.fragment,f),n=!1},d(f){f&&T(t),Ce(l)}}}function m2(e){var i,o;let t,l,n;return l=new v4({props:{title:(o=(i=e[6].dashboard)==null?void 0:i.day)!=null?o:"24 hours",json:e[3],sysinfo:e[1]}}),{c(){t=_("div"),Ne(l.$$.fragment),u(t,"class","cnt gwf")},m(f,r){E(f,t,r),Se(l,t,null),n=!0},p(f,r){var a,m;const c={};r&64&&(c.title=(m=(a=f[6].dashboard)==null?void 0:a.day)!=null?m:"24 hours"),r&8&&(c.json=f[3]),r&2&&(c.sysinfo=f[1]),l.$set(c)},i(f){n||(Q(l.$$.fragment,f),n=!0)},o(f){ee(l.$$.fragment,f),n=!1},d(f){f&&T(t),Ce(l)}}}function _2(e){var i,o;let t,l,n;return l=new g4({props:{title:(o=(i=e[6].dashboard)==null?void 0:i.month)!=null?o:"{0} days",json:e[4],sysinfo:e[1]}}),{c(){t=_("div"),Ne(l.$$.fragment),u(t,"class","cnt gwf")},m(f,r){E(f,t,r),Se(l,t,null),n=!0},p(f,r){var a,m;const c={};r&64&&(c.title=(m=(a=f[6].dashboard)==null?void 0:a.month)!=null?m:"{0} days"),r&16&&(c.json=f[4]),r&2&&(c.sysinfo=f[1]),l.$set(c)},i(f){n||(Q(l.$$.fragment,f),n=!0)},o(f){ee(l.$$.fragment,f),n=!1},d(f){f&&T(t),Ce(l)}}}function p2(e){var i,o;let t,l,n;return l=new M4({props:{title:(o=(i=e[6].dashboard)==null?void 0:i.temperature)!=null?o:"Temperature",json:e[5]}}),{c(){t=_("div"),Ne(l.$$.fragment),u(t,"class","cnt gwf")},m(f,r){E(f,t,r),Se(l,t,null),n=!0},p(f,r){var a,m;const c={};r&64&&(c.title=(m=(a=f[6].dashboard)==null?void 0:a.temperature)!=null?m:"Temperature"),r&32&&(c.json=f[5]),l.$set(c)},i(f){n||(Q(l.$$.fragment,f),n=!0)},o(f){ee(l.$$.fragment,f),n=!1},d(f){f&&T(t),Ce(l)}}}function O4(e){let t,l=Ot(e[1].ui.i,e[0].i),n,i=Ot(e[1].ui.e,e[0].om||e[0].e>0),o,f=Ot(e[1].ui.v,e[0].l1&&(e[0].l1.u>100||e[0].l2.u>100||e[0].l3.u>100)),r,c=Ot(e[1].ui.a,e[0].l1&&(e[0].l1.i>.01||e[0].l2.i>.01||e[0].l3.i>.01)),a,m=Ot(e[1].ui.h,e[0].l1&&(e[0].l1.p>.01||e[0].l2.p>.01||e[0].l3.p>.01||e[0].l1.q>.01||e[0].l2.q>.01||e[0].l3.q>.01)),p,v=Ot(e[1].ui.f,e[0].l1&&(e[0].l1.f>.01||e[0].l2.f>.01||e[0].l3.f>.01)),d,h=Ot(e[1].ui.r,e[0].ri>0||e[0].re>0||e[0].ric>0||e[0].rec>0),g,M=Ot(e[1].ui.c,e[0].ea),A,I=Ot(e[1].ui.t,e[0].pr&&(e[0].pr.startsWith("NO")||e[0].pr.startsWith("10YNO")||e[0].pr.startsWith("10Y1001A1001A4"))),O,L=Ot(e[1].ui.l),q,U=Ot(e[1].ui.p,e[0].pe&&!Number.isNaN(e[0].p)),P,F=Ot(e[1].ui.d,e[3]),z,G=Ot(e[1].ui.m,e[4]),B,R=Ot(e[1].ui.s,e[0].t&&e[0].t!=-127&&e[5].c>1),K,y=l&&Jp(e),H=i&&$p(e),Y=f&&xp(e),X=c&&t2(e),J=m&&n2(e),$=v&&s2(e),ce=h&&a2(e),ie=M&&f2(e),oe=I&&u2(e),ae=L&&r2(e),se=U&&c2(e),x=F&&m2(e),_e=G&&_2(e),pe=R&&p2(e);return{c(){t=_("div"),y&&y.c(),n=b(),H&&H.c(),o=b(),Y&&Y.c(),r=b(),X&&X.c(),a=b(),J&&J.c(),p=b(),$&&$.c(),d=b(),ce&&ce.c(),g=b(),ie&&ie.c(),A=b(),oe&&oe.c(),O=b(),ae&&ae.c(),q=b(),se&&se.c(),P=b(),x&&x.c(),z=b(),_e&&_e.c(),B=b(),pe&&pe.c(),u(t,"class","grid 2xl:grid-cols-6 xl:grid-cols-5 lg:grid-cols-4 md:grid-cols-3 sm:grid-cols-2")},m(V,Z){E(V,t,Z),y&&y.m(t,null),s(t,n),H&&H.m(t,null),s(t,o),Y&&Y.m(t,null),s(t,r),X&&X.m(t,null),s(t,a),J&&J.m(t,null),s(t,p),$&&$.m(t,null),s(t,d),ce&&ce.m(t,null),s(t,g),ie&&ie.m(t,null),s(t,A),oe&&oe.m(t,null),s(t,O),ae&&ae.m(t,null),s(t,q),se&&se.m(t,null),s(t,P),x&&x.m(t,null),s(t,z),_e&&_e.m(t,null),s(t,B),pe&&pe.m(t,null),K=!0},p(V,[Z]){Z&3&&(l=Ot(V[1].ui.i,V[0].i)),l?y?(y.p(V,Z),Z&3&&Q(y,1)):(y=Jp(V),y.c(),Q(y,1),y.m(t,n)):y&&(pt(),ee(y,1,1,()=>{y=null}),dt()),Z&3&&(i=Ot(V[1].ui.e,V[0].om||V[0].e>0)),i?H?(H.p(V,Z),Z&3&&Q(H,1)):(H=$p(V),H.c(),Q(H,1),H.m(t,o)):H&&(pt(),ee(H,1,1,()=>{H=null}),dt()),Z&3&&(f=Ot(V[1].ui.v,V[0].l1&&(V[0].l1.u>100||V[0].l2.u>100||V[0].l3.u>100))),f?Y?(Y.p(V,Z),Z&3&&Q(Y,1)):(Y=xp(V),Y.c(),Q(Y,1),Y.m(t,r)):Y&&(pt(),ee(Y,1,1,()=>{Y=null}),dt()),Z&3&&(c=Ot(V[1].ui.a,V[0].l1&&(V[0].l1.i>.01||V[0].l2.i>.01||V[0].l3.i>.01))),c?X?(X.p(V,Z),Z&3&&Q(X,1)):(X=t2(V),X.c(),Q(X,1),X.m(t,a)):X&&(pt(),ee(X,1,1,()=>{X=null}),dt()),Z&3&&(m=Ot(V[1].ui.h,V[0].l1&&(V[0].l1.p>.01||V[0].l2.p>.01||V[0].l3.p>.01||V[0].l1.q>.01||V[0].l2.q>.01||V[0].l3.q>.01))),m?J?(J.p(V,Z),Z&3&&Q(J,1)):(J=n2(V),J.c(),Q(J,1),J.m(t,p)):J&&(pt(),ee(J,1,1,()=>{J=null}),dt()),Z&3&&(v=Ot(V[1].ui.f,V[0].l1&&(V[0].l1.f>.01||V[0].l2.f>.01||V[0].l3.f>.01))),v?$?($.p(V,Z),Z&3&&Q($,1)):($=s2(V),$.c(),Q($,1),$.m(t,d)):$&&(pt(),ee($,1,1,()=>{$=null}),dt()),Z&3&&(h=Ot(V[1].ui.r,V[0].ri>0||V[0].re>0||V[0].ric>0||V[0].rec>0)),h?ce?(ce.p(V,Z),Z&3&&Q(ce,1)):(ce=a2(V),ce.c(),Q(ce,1),ce.m(t,g)):ce&&(pt(),ee(ce,1,1,()=>{ce=null}),dt()),Z&3&&(M=Ot(V[1].ui.c,V[0].ea)),M?ie?(ie.p(V,Z),Z&3&&Q(ie,1)):(ie=f2(V),ie.c(),Q(ie,1),ie.m(t,A)):ie&&(pt(),ee(ie,1,1,()=>{ie=null}),dt()),Z&3&&(I=Ot(V[1].ui.t,V[0].pr&&(V[0].pr.startsWith("NO")||V[0].pr.startsWith("10YNO")||V[0].pr.startsWith("10Y1001A1001A4")))),I?oe?(oe.p(V,Z),Z&3&&Q(oe,1)):(oe=u2(V),oe.c(),Q(oe,1),oe.m(t,O)):oe&&(pt(),ee(oe,1,1,()=>{oe=null}),dt()),Z&2&&(L=Ot(V[1].ui.l)),L?ae?(ae.p(V,Z),Z&2&&Q(ae,1)):(ae=r2(V),ae.c(),Q(ae,1),ae.m(t,q)):ae&&(pt(),ee(ae,1,1,()=>{ae=null}),dt()),Z&3&&(U=Ot(V[1].ui.p,V[0].pe&&!Number.isNaN(V[0].p))),U?se?(se.p(V,Z),Z&3&&Q(se,1)):(se=c2(V),se.c(),Q(se,1),se.m(t,P)):se&&(pt(),ee(se,1,1,()=>{se=null}),dt()),Z&10&&(F=Ot(V[1].ui.d,V[3])),F?x?(x.p(V,Z),Z&10&&Q(x,1)):(x=m2(V),x.c(),Q(x,1),x.m(t,z)):x&&(pt(),ee(x,1,1,()=>{x=null}),dt()),Z&18&&(G=Ot(V[1].ui.m,V[4])),G?_e?(_e.p(V,Z),Z&18&&Q(_e,1)):(_e=_2(V),_e.c(),Q(_e,1),_e.m(t,B)):_e&&(pt(),ee(_e,1,1,()=>{_e=null}),dt()),Z&35&&(R=Ot(V[1].ui.s,V[0].t&&V[0].t!=-127&&V[5].c>1)),R?pe?(pe.p(V,Z),Z&35&&Q(pe,1)):(pe=p2(V),pe.c(),Q(pe,1),pe.m(t,null)):pe&&(pt(),ee(pe,1,1,()=>{pe=null}),dt())},i(V){K||(Q(y),Q(H),Q(Y),Q(X),Q(J),Q($),Q(ce),Q(ie),Q(oe),Q(ae),Q(se),Q(x),Q(_e),Q(pe),K=!0)},o(V){ee(y),ee(H),ee(Y),ee(X),ee(J),ee($),ee(ce),ee(ie),ee(oe),ee(ae),ee(se),ee(x),ee(_e),ee(pe),K=!1},d(V){V&&T(t),y&&y.d(),H&&H.d(),Y&&Y.d(),X&&X.d(),J&&J.d(),$&&$.d(),ce&&ce.d(),ie&&ie.d(),oe&&oe.d(),ae&&ae.d(),se&&se.d(),x&&x.d(),_e&&_e.d(),pe&&pe.d()}}}function I4(e,t,l){let{data:n={}}=t,{sysinfo:i={}}=t,o={},f={},r={},c={};Cf.subscribe(d=>{l(2,o=d)}),Dv.subscribe(d=>{l(3,f=d)}),qv.subscribe(d=>{l(4,r=d)}),Iv.subscribe(d=>{l(5,c=d)});let a={};Ml.subscribe(d=>{l(6,a=d)});let m,p,v;return e.$$set=d=>{"data"in d&&l(0,n=d.data),"sysinfo"in d&&l(1,i=d.sysinfo)},e.$$.update=()=>{var d,h,g;e.$$.dirty&1&&(l(7,m=gl((n==null?void 0:n.ic)*1e3,"Wh")),l(8,p=gl((n==null?void 0:n.ec)*1e3,"Wh")),l(9,v=((d=n==null?void 0:n.l1)==null?void 0:d.u)>100&&((h=n==null?void 0:n.l2)==null?void 0:h.u)>100&&((g=n==null?void 0:n.l3)==null?void 0:g.u)>100))},[n,i,o,f,r,c,a,m,p,v]}class L4 extends _t{constructor(t){super(),mt(this,t,I4,O4,ct,{data:0,sysinfo:1})}}let ff={};const qs=xt(ff);async function R4(){ff=await(await fetch("configuration.json")).json(),qs.set(ff)}let uf={};const zv=xt(uf);async function F4(){uf=await(await fetch("priceconfig.json")).json(),zv.set(uf)}function d2(e,t,l){const n=e.slice();return n[2]=t[l],n[4]=l,n}function B4(e){let t;return{c(){t=_("option"),t.textContent="UART0",t.__value=3,t.value=t.__value},m(l,n){E(l,t,n)},d(l){l&&T(t)}}}function U4(e){let t;return{c(){t=_("option"),t.textContent="UART0",t.__value=20,t.value=t.__value},m(l,n){E(l,t,n)},d(l){l&&T(t)}}}function v2(e){let t;return{c(){t=_("option"),t.textContent="UART2",t.__value=113,t.value=t.__value},m(l,n){E(l,t,n)},d(l){l&&T(t)}}}function h2(e){let t,l,n;return{c(){t=_("option"),t.textContent="UART1",l=b(),n=_("option"),n.textContent="UART2",t.__value=9,t.value=t.__value,n.__value=16,n.value=n.__value},m(i,o){E(i,t,o),E(i,l,o),E(i,n,o)},d(i){i&&T(t),i&&T(l),i&&T(n)}}}function b2(e){let t;return{c(){t=_("option"),t.textContent="UART1",t.__value=18,t.value=t.__value},m(l,n){E(l,t,n)},d(l){l&&T(t)}}}function g2(e){let t,l,n;return{c(){t=_("option"),l=k("GPIO"),n=k(e[4]),t.__value=e[4],t.value=t.__value},m(i,o){E(i,t,o),s(t,l),s(t,n)},d(i){i&&T(t)}}}function k2(e){let t,l=e[4]>1&&!(e[0]=="esp32"&&(e[4]==9||e[4]==16))&&!((e[0]=="esp32s2"||e[0]=="esp32s3")&&e[4]==18)&&!(e[0]=="esp8266"&&(e[4]==3||e[4]==113))&&g2(e);return{c(){l&&l.c(),t=Ut()},m(n,i){l&&l.m(n,i),E(n,t,i)},p(n,i){n[4]>1&&!(n[0]=="esp32"&&(n[4]==9||n[4]==16))&&!((n[0]=="esp32s2"||n[0]=="esp32s3")&&n[4]==18)&&!(n[0]=="esp8266"&&(n[4]==3||n[4]==113))?l||(l=g2(n),l.c(),l.m(t.parentNode,t)):l&&(l.d(1),l=null)},d(n){l&&l.d(n),n&&T(t)}}}function j4(e){let t,l,n,i,o;function f(h,g){return h[0]=="esp32c3"?U4:B4}let r=f(e),c=r(e),a=e[0]=="esp8266"&&v2(),m=(e[0]=="esp32"||e[0]=="esp32solo")&&h2(),p=(e[0]=="esp32s2"||e[0]=="esp32s3")&&b2(),v={length:e[1]+1},d=[];for(let h=0;h{"chip"in o&&l(0,n=o.chip)},e.$$.update=()=>{if(e.$$.dirty&1)switch(n){case"esp8266":l(1,i=16);break;case"esp32s2":l(1,i=44);break;case"esp32s3":l(1,i=46);break;case"esp32c3":l(1,i=19);break}},[n,i]}class rf extends _t{constructor(t){super(),mt(this,t,H4,j4,ct,{chip:0})}}function w2(e){let t,l,n=e[1]&&M2(e);return{c(){t=_("div"),l=_("div"),n&&n.c(),u(l,"class","fixed inset-0 bg-gray-500 dark:bg-gray-900 bg-opacity-50 dark:bg-opacity-80 flex items-center justify-center"),u(t,"class","z-50"),u(t,"aria-modal","true")},m(i,o){E(i,t,o),s(t,l),n&&n.m(l,null)},p(i,o){i[1]?n?n.p(i,o):(n=M2(i),n.c(),n.m(l,null)):n&&(n.d(1),n=null)},d(i){i&&T(t),n&&n.d()}}}function M2(e){let t,l;return{c(){t=_("div"),l=k(e[1]),u(t,"class","bg-white dark:bg-gray-600 m-2 p-3 rounded-md shadow-lg pb-4 text-gray-700 dark:text-white w-96")},m(n,i){E(n,t,i),s(t,l)},p(n,i){i&2&&C(l,n[1])},d(n){n&&T(t)}}}function y4(e){let t,l=e[0]&&w2(e);return{c(){l&&l.c(),t=Ut()},m(n,i){l&&l.m(n,i),E(n,t,i)},p(n,[i]){n[0]?l?l.p(n,i):(l=w2(n),l.c(),l.m(t.parentNode,t)):l&&(l.d(1),l=null)},i:ze,o:ze,d(n){l&&l.d(n),n&&T(t)}}}function z4(e,t,l){let{active:n}=t,{message:i}=t;return e.$$set=o=>{"active"in o&&l(0,n=o.active),"message"in o&&l(1,i=o.message)},[n,i]}class kl extends _t{constructor(t){super(),mt(this,t,z4,y4,ct,{active:0,message:1})}}function S2(e,t,l){const n=e.slice();return n[1]=t[l],n}function C2(e){let t,l,n=e[1]+"",i;return{c(){t=_("option"),l=k("Europe/"),i=k(n),t.__value="Europe/"+e[1],t.value=t.__value},m(o,f){E(o,t,f),s(t,l),s(t,i)},p:ze,d(o){o&&T(t)}}}function W4(e){let t,l,n,i=e[0],o=[];for(let f=0;f>1&1,D=0;D0;w--)D[w]=D[w]?D[w-1]^q.EXPONENT[F._modN(q.LOG[D[w]]+S)]:D[w-1];D[0]=q.EXPONENT[F._modN(q.LOG[D[0]]+S)]}for(S=0;S<=N;S++)D[S]=q.LOG[D[S]]},_checkBadness:function(){var S,w,N,D,j,te=0,le=this._badness,fe=this.buffer,de=this.width;for(j=0;jde*de;)we-=de*de,Pe++;for(te+=Pe*F.N4,D=0;D=le-2&&(S=le-2,j>9&&S--);var fe=S;if(j>9){for(te[fe+2]=0,te[fe+3]=0;fe--;)w=te[fe],te[fe+3]|=255&w<<4,te[fe+2]=w>>4;te[2]|=255&S<<4,te[1]=S>>4,te[0]=64|S>>12}else{for(te[fe+1]=0,te[fe+2]=0;fe--;)w=te[fe],te[fe+2]|=255&w<<4,te[fe+1]=w>>4;te[1]|=255&S<<4,te[0]=64|S>>4}for(fe=S+3-(j<10);fe=5&&(N+=F.N1+D[w]-5);for(w=3;wS||D[w-3]*3>=D[w]*4||D[w+3]*3>=D[w]*4)&&(N+=F.N3);return N},_finish:function(){this._stringBuffer=this.buffer.slice();var S,w,N=0,D=3e4;for(w=0;w<8&&(this._applyMask(w),S=this._checkBadness(),S>=1)D&1&&(j[te-1-w+te*8]=1,w<6?j[8+te*w]=1:j[8+te*(w+1)]=1);for(w=0;w<7;w++,D>>=1)D&1&&(j[8+te*(te-7+w)]=1,w?j[6-w+te*8]=1:j[7+te*8]=1)},_interleaveBlocks:function(){var S,w,N=this._dataBlock,D=this._ecc,j=this._eccBlock,te=0,le=this._calculateMaxLength(),fe=this._neccBlock1,de=this._neccBlock2,qe=this._stringBuffer;for(S=0;S1)for(S=A.BLOCK[D],N=j-7;;){for(w=j-7;w>S-3&&(this._addAlignment(w,N),!(w6)for(S=P.BLOCK[te-7],w=17,N=0;N<6;N++)for(D=0;D<3;D++,w--)1&(w>11?te>>w-12:S>>w)?(j[5-N+le*(2-D+le-11)]=1,j[2-D+le-11+le*(5-N)]=1):(this._setMask(5-N,2-D+le-11),this._setMask(2-D+le-11,5-N))},_isMasked:function(S,w){var N=F._getMaskBit(S,w);return this._mask[N]===1},_pack:function(){var S,w,N,D=1,j=1,te=this.width,le=te-1,fe=te-1,de=(this._dataBlock+this._eccBlock)*(this._neccBlock1+this._neccBlock2)+this._neccBlock2;for(w=0;ww&&(N=S,S=w,w=N),N=w,N+=w*w,N>>=1,N+=S,N},_modN:function(S){for(;S>=255;)S-=255,S=(S>>8)+(S&255);return S},N1:3,N2:3,N3:40,N4:10}),z=F,G=d.extend({draw:function(){this.element.src=this.qrious.toDataURL()},reset:function(){this.element.src=""},resize:function(){var S=this.element;S.width=S.height=this.qrious.size}}),B=G,R=p.extend(function(S,w,N,D){this.name=S,this.modifiable=Boolean(w),this.defaultValue=N,this._valueTransformer=D},{transform:function(S){var w=this._valueTransformer;return typeof w=="function"?w(S,this):S}}),K=R,y=p.extend(null,{abs:function(S){return S!=null?Math.abs(S):null},hasOwn:function(S,w){return Object.prototype.hasOwnProperty.call(S,w)},noop:function(){},toUpperCase:function(S){return S!=null?S.toUpperCase():null}}),H=y,Y=p.extend(function(S){this.options={},S.forEach(function(w){this.options[w.name]=w},this)},{exists:function(S){return this.options[S]!=null},get:function(S,w){return Y._get(this.options[S],w)},getAll:function(S){var w,N=this.options,D={};for(w in N)H.hasOwn(N,w)&&(D[w]=Y._get(N[w],S));return D},init:function(S,w,N){typeof N!="function"&&(N=H.noop);var D,j;for(D in this.options)H.hasOwn(this.options,D)&&(j=this.options[D],Y._set(j,j.defaultValue,w),Y._createAccessor(j,w,N));this._setAll(S,w,!0)},set:function(S,w,N){return this._set(S,w,N)},setAll:function(S,w){return this._setAll(S,w)},_set:function(S,w,N,D){var j=this.options[S];if(!j)throw new Error("Invalid option: "+S);if(!j.modifiable&&!D)throw new Error("Option cannot be modified: "+S);return Y._set(j,w,N)},_setAll:function(S,w,N){if(!S)return!1;var D,j=!1;for(D in S)H.hasOwn(S,D)&&this._set(D,S[D],w,N)&&(j=!0);return j}},{_createAccessor:function(S,w,N){var D={get:function(){return Y._get(S,w)}};S.modifiable&&(D.set=function(j){Y._set(S,j,w)&&N(j,S)}),Object.defineProperty(w,S.name,D)},_get:function(S,w){return w["_"+S.name]},_set:function(S,w,N){var D="_"+S.name,j=N[D],te=S.transform(w!=null?w:S.defaultValue);return N[D]=te,te!==j}}),X=Y,J=p.extend(function(){this._services={}},{getService:function(S){var w=this._services[S];if(!w)throw new Error("Service is not being managed with name: "+S);return w},setService:function(S,w){if(this._services[S])throw new Error("Service is already managed with name: "+S);w&&(this._services[S]=w)}}),$=J,ce=new X([new K("background",!0,"white"),new K("backgroundAlpha",!0,1,H.abs),new K("element"),new K("foreground",!0,"black"),new K("foregroundAlpha",!0,1,H.abs),new K("level",!0,"L",H.toUpperCase),new K("mime",!0,"image/png"),new K("padding",!0,null,H.abs),new K("size",!0,100,H.abs),new K("value",!0,"")]),ie=new $,oe=p.extend(function(S){ce.init(S,this,this.update.bind(this));var w=ce.get("element",this),N=ie.getService("element"),D=w&&N.isCanvas(w)?w:N.createCanvas(),j=w&&N.isImage(w)?w:N.createImage();this._canvasRenderer=new g(this,D,!0),this._imageRenderer=new B(this,j,j===w),this.update()},{get:function(){return ce.getAll(this)},set:function(S){ce.setAll(S,this)&&this.update()},toDataURL:function(S){return this.canvas.toDataURL(S||this.mime)},update:function(){var S=new z({level:this.level,value:this.value});this._canvasRenderer.render(S),this._imageRenderer.render(S)}},{use:function(S){ie.setService(S.getName(),S)}});Object.defineProperties(oe.prototype,{canvas:{get:function(){return this._canvasRenderer.getElement()}},image:{get:function(){return this._imageRenderer.getElement()}}});var ae=oe,se=ae,x=p.extend({getName:function(){}}),_e=x,pe=_e.extend({createCanvas:function(){},createImage:function(){},getName:function(){return"element"},isCanvas:function(S){},isImage:function(S){}}),V=pe,Z=V.extend({createCanvas:function(){return document.createElement("canvas")},createImage:function(){return document.createElement("img")},isCanvas:function(S){return S instanceof HTMLCanvasElement},isImage:function(S){return S instanceof HTMLImageElement}}),ge=Z;se.use(new ge);var ve=se;return ve})})(Gv);const Q4=Gv.exports;function X4(e){let t,l;return{c(){t=_("img"),yo(t.src,l=e[2])||u(t,"src",l),u(t,"alt",e[0]),u(t,"class",e[1])},m(n,i){E(n,t,i)},p(n,[i]){i&4&&!yo(t.src,l=n[2])&&u(t,"src",l),i&1&&u(t,"alt",n[0]),i&2&&u(t,"class",n[1])},i:ze,o:ze,d(n){n&&T(t)}}}function Z4(e,t,l){const n=new Q4;let{errorCorrection:i="L"}=t,{background:o="#fff"}=t,{color:f="#000"}=t,{size:r="200"}=t,{value:c=""}=t,{padding:a=0}=t,{className:m="qrcode"}=t,p="";function v(){n.set({background:o,foreground:f,level:i,padding:a,size:r,value:c}),l(2,p=n.toDataURL("image/jpeg"))}return Zd(()=>{v()}),e.$$set=d=>{"errorCorrection"in d&&l(3,i=d.errorCorrection),"background"in d&&l(4,o=d.background),"color"in d&&l(5,f=d.color),"size"in d&&l(6,r=d.size),"value"in d&&l(0,c=d.value),"padding"in d&&l(7,a=d.padding),"className"in d&&l(1,m=d.className)},e.$$.update=()=>{e.$$.dirty&1&&c&&v()},[c,m,p,i,o,f,r,a]}class J4 extends _t{constructor(t){super(),mt(this,t,Z4,X4,ct,{errorCorrection:3,background:4,color:5,size:6,value:0,padding:7,className:1})}}function N2(e,t,l){const n=e.slice();return n[107]=t[l],n}function T2(e,t,l){const n=e.slice();return n[110]=t[l],n[111]=t,n[112]=l,n}function P2(e,t,l){const n=e.slice();return n[113]=t[l],n[114]=t,n[115]=l,n}function $4(e,t,l){const n=e.slice();return n[116]=t[l],n}function x4(e,t,l){const n=e.slice();return n[119]=t[l],n}function E2(e){let t,l,n,i,o;return{c(){t=_("option"),t.textContent="NO1 with support",l=_("option"),l.textContent="NO2 with support",n=_("option"),n.textContent="NO3 with support",i=_("option"),i.textContent="NO4 with support",o=_("option"),o.textContent="NO5 with support",t.__value="NO1S",t.value=t.__value,l.__value="NO2S",l.value=l.__value,n.__value="NO3S",n.value=n.__value,i.__value="NO4S",i.value=i.__value,o.__value="NO5S",o.value=o.__value},m(f,r){E(f,t,r),E(f,l,r),E(f,n,r),E(f,i,r),E(f,o,r)},d(f){f&&T(t),f&&T(l),f&&T(n),f&&T(i),f&&T(o)}}}function eg(e){let t,l;return{c(){t=_("option"),l=k(e[119]),t.__value=e[119],t.value=t.__value},m(n,i){E(n,t,i),s(t,l)},p:ze,d(n){n&&T(t)}}}function tg(e){var n,i,o;let t=((o=(i=(n=e[1].conf)==null?void 0:n.price)==null?void 0:i.conf)!=null?o:"Configure")+"",l;return{c(){l=k(t)},m(f,r){E(f,l,r)},p(f,r){var c,a,m;r[0]&2&&t!==(t=((m=(a=(c=f[1].conf)==null?void 0:c.price)==null?void 0:a.conf)!=null?m:"Configure")+"")&&C(l,t)},d(f){f&&T(l)}}}function A2(e){let t,l,n,i,o;return{c(){var f,r,c;t=_("br"),l=_("input"),u(l,"name","pt"),u(l,"type","text"),u(l,"class","in-s"),u(l,"placeholder",n=(c=(r=(f=e[1].conf)==null?void 0:f.price)==null?void 0:r.api_key_placeholder)!=null?c:"")},m(f,r){E(f,t,r),E(f,l,r),be(l,e[4].p.t),i||(o=re(l,"input",e[24]),i=!0)},p(f,r){var c,a,m;r[0]&2&&n!==(n=(m=(a=(c=f[1].conf)==null?void 0:c.price)==null?void 0:a.api_key_placeholder)!=null?m:"")&&u(l,"placeholder",n),r[0]&16&&l.value!==f[4].p.t&&be(l,f[4].p.t)},d(f){f&&T(t),f&&T(l),i=!1,o()}}}function D2(e){var M,A,I,O,L,q,U,P;let t,l=((O=(I=(A=(M=e[1].conf)==null?void 0:M.general)==null?void 0:A.security)==null?void 0:I.username)!=null?O:"Username")+"",n,i,o,f,r,c,a=((P=(U=(q=(L=e[1].conf)==null?void 0:L.general)==null?void 0:q.security)==null?void 0:U.password)!=null?P:"Password")+"",m,p,v,d,h,g;return{c(){t=_("div"),n=k(l),i=_("br"),o=b(),f=_("input"),r=b(),c=_("div"),m=k(a),p=_("br"),v=b(),d=_("input"),u(f,"name","gu"),u(f,"type","text"),u(f,"class","in-s"),u(f,"maxlength","36"),u(t,"class","my-1"),u(d,"name","gp"),u(d,"type","password"),u(d,"class","in-s"),u(d,"maxlength","36"),u(c,"class","my-1")},m(F,z){E(F,t,z),s(t,n),s(t,i),s(t,o),s(t,f),be(f,e[4].g.u),E(F,r,z),E(F,c,z),s(c,m),s(c,p),s(c,v),s(c,d),be(d,e[4].g.p),h||(g=[re(f,"input",e[26]),re(d,"input",e[27])],h=!0)},p(F,z){var G,B,R,K,y,H,Y,X;z[0]&2&&l!==(l=((K=(R=(B=(G=F[1].conf)==null?void 0:G.general)==null?void 0:B.security)==null?void 0:R.username)!=null?K:"Username")+"")&&C(n,l),z[0]&16&&f.value!==F[4].g.u&&be(f,F[4].g.u),z[0]&2&&a!==(a=((X=(Y=(H=(y=F[1].conf)==null?void 0:y.general)==null?void 0:H.security)==null?void 0:Y.password)!=null?X:"Password")+"")&&C(m,a),z[0]&16&&d.value!==F[4].g.p&&be(d,F[4].g.p)},d(F){F&&T(t),F&&T(r),F&&T(c),h=!1,Et(g)}}}function lg(e){var ae,se,x,_e,pe,V,Z,ge,ve;let t,l,n=((x=(se=(ae=e[1].conf)==null?void 0:ae.meter)==null?void 0:se.buffer)!=null?x:"Buffer size")+"",i,o,f,r=((V=(pe=(_e=e[1].conf)==null?void 0:_e.meter)==null?void 0:pe.serial)!=null?V:"Serial conf.")+"",c,a,m,p,v,d=((ve=(ge=(Z=e[1].conf)==null?void 0:Z.meter)==null?void 0:ge.inverted)!=null?ve:"inverted")+"",h,g,M,A,I,O,L,q,U,P,F,z,G,B,R,K,y,H,Y,X,J,$,ce,ie=[3,12,24,48,96,192,384,576,1152],oe=[];for(let S=0;S<9;S+=1)oe[S]=ig($4(e,ie,S));return{c(){t=_("div"),l=_("span"),i=k(n),o=b(),f=_("span"),c=k(r),a=b(),m=_("label"),p=_("input"),v=b(),h=k(d),g=b(),M=_("div"),A=_("select"),I=_("option"),O=k("Autodetect");for(let S=0;S<9;S+=1)oe[S].c();q=b(),U=_("select"),P=_("option"),F=k("-"),G=_("option"),G.textContent="7N1",B=_("option"),B.textContent="8N1",R=_("option"),R.textContent="8N2",K=_("option"),K.textContent="7E1",y=_("option"),y.textContent="8E1",Y=b(),X=_("input"),u(l,"class","float-right"),u(p,"name","mi"),p.__value="true",p.value=p.__value,u(p,"type","checkbox"),u(p,"class","rounded mb-1"),u(m,"class","mt-2 ml-3 whitespace-nowrap"),I.__value=0,I.value=I.__value,I.disabled=L=e[4].m.b!=0,u(A,"name","mb"),u(A,"class","in-f tr w-1/2"),e[4].m.b===void 0&&Ct(()=>e[32].call(A)),P.__value=0,P.value=P.__value,P.disabled=z=e[4].m.b!=0,G.__value=2,G.value=G.__value,B.__value=3,B.value=B.__value,R.__value=7,R.value=R.__value,K.__value=10,K.value=K.__value,y.__value=11,y.value=y.__value,u(U,"name","mp"),u(U,"class","in-m"),U.disabled=H=e[4].m.b==0,e[4].m.p===void 0&&Ct(()=>e[33].call(U)),u(X,"name","ms"),u(X,"type","number"),u(X,"min",64),u(X,"max",J=e[0].chip=="esp8266"?e[4].i.h.p==3||e[4].i.h.p==113?512:128:4096),u(X,"step",64),u(X,"class","in-l tr w-1/2"),u(M,"class","flex w-full"),u(t,"class","my-1")},m(S,w){E(S,t,w),s(t,l),s(l,i),s(t,o),s(t,f),s(f,c),s(t,a),s(t,m),s(m,p),p.checked=e[4].m.i,s(m,v),s(m,h),s(t,g),s(t,M),s(M,A),s(A,I),s(I,O);for(let N=0;N<9;N+=1)oe[N]&&oe[N].m(A,null);Ze(A,e[4].m.b,!0),s(M,q),s(M,U),s(U,P),s(P,F),s(U,G),s(U,B),s(U,R),s(U,K),s(U,y),Ze(U,e[4].m.p,!0),s(M,Y),s(M,X),be(X,e[4].m.s),$||(ce=[re(p,"change",e[31]),re(A,"change",e[32]),re(U,"change",e[33]),re(X,"input",e[34])],$=!0)},p(S,w){var N,D,j,te,le,fe,de,qe,Pe;w[0]&2&&n!==(n=((j=(D=(N=S[1].conf)==null?void 0:N.meter)==null?void 0:D.buffer)!=null?j:"Buffer size")+"")&&C(i,n),w[0]&2&&r!==(r=((fe=(le=(te=S[1].conf)==null?void 0:te.meter)==null?void 0:le.serial)!=null?fe:"Serial conf.")+"")&&C(c,r),w[0]&16&&(p.checked=S[4].m.i),w[0]&2&&d!==(d=((Pe=(qe=(de=S[1].conf)==null?void 0:de.meter)==null?void 0:qe.inverted)!=null?Pe:"inverted")+"")&&C(h,d),w[0]&16&&L!==(L=S[4].m.b!=0)&&(I.disabled=L),w[0]&16&&Ze(A,S[4].m.b),w[0]&16&&z!==(z=S[4].m.b!=0)&&(P.disabled=z),w[0]&16&&H!==(H=S[4].m.b==0)&&(U.disabled=H),w[0]&16&&Ze(U,S[4].m.p),w[0]&17&&J!==(J=S[0].chip=="esp8266"?S[4].i.h.p==3||S[4].i.h.p==113?512:128:4096)&&u(X,"max",J),w[0]&16&&Xe(X.value)!==S[4].m.s&&be(X,S[4].m.s)},d(S){S&&T(t),Xt(oe,S),$=!1,Et(ce)}}}function ng(e){var a,m,p;let t,l,n=((p=(m=(a=e[1].conf)==null?void 0:a.meter)==null?void 0:m.pulses)!=null?p:"Pulses per kWh")+"",i,o,f,r,c;return{c(){t=_("div"),l=_("span"),i=k(n),o=b(),f=_("input"),u(f,"name","mb"),u(f,"class","in-s tr"),u(f,"type","number"),u(f,"min",1),u(f,"max",3600),u(t,"class","my-1")},m(v,d){E(v,t,d),s(t,l),s(l,i),s(t,o),s(t,f),be(f,e[4].m.b),r||(c=re(f,"input",e[30]),r=!0)},p(v,d){var h,g,M;d[0]&2&&n!==(n=((M=(g=(h=v[1].conf)==null?void 0:h.meter)==null?void 0:g.pulses)!=null?M:"Pulses per kWh")+"")&&C(i,n),d[0]&16&&Xe(f.value)!==v[4].m.b&&be(f,v[4].m.b)},d(v){v&&T(t),r=!1,c()}}}function ig(e){let t,l=e[116]*100+"",n;return{c(){t=_("option"),n=k(l),t.__value=e[116]*100,t.value=t.__value},m(i,o){E(i,t,o),s(t,n)},p:ze,d(i){i&&T(t)}}}function q2(e){let t,l,n,i;return{c(){t=_("br"),l=_("input"),u(l,"name","mek"),u(l,"type","text"),u(l,"class","in-s")},m(o,f){E(o,t,f),E(o,l,f),be(l,e[4].m.e.k),n||(i=re(l,"input",e[39]),n=!0)},p(o,f){f[0]&16&&l.value!==o[4].m.e.k&&be(l,o[4].m.e.k)},d(o){o&&T(t),o&&T(l),n=!1,i()}}}function O2(e){var a,m,p;let t,l=((p=(m=(a=e[1].conf)==null?void 0:a.meter)==null?void 0:m.authkey)!=null?p:"Authentication key")+"",n,i,o,f,r,c;return{c(){t=_("div"),n=k(l),i=_("br"),o=b(),f=_("input"),u(f,"name","mea"),u(f,"type","text"),u(f,"class","in-s"),u(t,"class","my-1")},m(v,d){E(v,t,d),s(t,n),s(t,i),s(t,o),s(t,f),be(f,e[4].m.e.a),r||(c=re(f,"input",e[40]),r=!0)},p(v,d){var h,g,M;d[0]&2&&l!==(l=((M=(g=(h=v[1].conf)==null?void 0:h.meter)==null?void 0:g.authkey)!=null?M:"Authentication key")+"")&&C(n,l),d[0]&16&&f.value!==v[4].m.e.a&&be(f,v[4].m.e.a)},d(v){v&&T(t),r=!1,c()}}}function I2(e){var H,Y,X,J,$,ce,ie,oe,ae,se,x,_e,pe,V,Z,ge;let t,l,n=((J=(X=(Y=(H=e[1].conf)==null?void 0:H.meter)==null?void 0:Y.multipliers)==null?void 0:X.watt)!=null?J:"Watt")+"",i,o,f,r,c,a,m=((oe=(ie=(ce=($=e[1].conf)==null?void 0:$.meter)==null?void 0:ce.multipliers)==null?void 0:ie.volt)!=null?oe:"Volt")+"",p,v,d,h,g,M,A=((_e=(x=(se=(ae=e[1].conf)==null?void 0:ae.meter)==null?void 0:se.multipliers)==null?void 0:x.amp)!=null?_e:"Amp")+"",I,O,L,q,U,P,F=((ge=(Z=(V=(pe=e[1].conf)==null?void 0:pe.meter)==null?void 0:V.multipliers)==null?void 0:Z.kwh)!=null?ge:"kWh")+"",z,G,B,R,K,y;return{c(){t=_("div"),l=_("div"),i=k(n),o=_("br"),f=b(),r=_("input"),c=b(),a=_("div"),p=k(m),v=_("br"),d=b(),h=_("input"),g=b(),M=_("div"),I=k(A),O=_("br"),L=b(),q=_("input"),U=b(),P=_("div"),z=k(F),G=_("br"),B=b(),R=_("input"),u(r,"name","mmw"),u(r,"type","number"),u(r,"min","0.00"),u(r,"max","1000"),u(r,"step","0.001"),u(r,"class","in-f tr w-full"),u(l,"class","w-1/4"),u(h,"name","mmv"),u(h,"type","number"),u(h,"min","0.00"),u(h,"max","1000"),u(h,"step","0.001"),u(h,"class","in-m tr w-full"),u(a,"class","w-1/4"),u(q,"name","mma"),u(q,"type","number"),u(q,"min","0.00"),u(q,"max","1000"),u(q,"step","0.001"),u(q,"class","in-m tr w-full"),u(M,"class","w-1/4"),u(R,"name","mmc"),u(R,"type","number"),u(R,"min","0.00"),u(R,"max","1000"),u(R,"step","0.001"),u(R,"class","in-l tr w-full"),u(P,"class","w-1/4"),u(t,"class","flex my-1")},m(ve,S){E(ve,t,S),s(t,l),s(l,i),s(l,o),s(l,f),s(l,r),be(r,e[4].m.m.w),s(t,c),s(t,a),s(a,p),s(a,v),s(a,d),s(a,h),be(h,e[4].m.m.v),s(t,g),s(t,M),s(M,I),s(M,O),s(M,L),s(M,q),be(q,e[4].m.m.a),s(t,U),s(t,P),s(P,z),s(P,G),s(P,B),s(P,R),be(R,e[4].m.m.c),K||(y=[re(r,"input",e[42]),re(h,"input",e[43]),re(q,"input",e[44]),re(R,"input",e[45])],K=!0)},p(ve,S){var w,N,D,j,te,le,fe,de,qe,Pe,we,Fe,Ae,ke,De,He;S[0]&2&&n!==(n=((j=(D=(N=(w=ve[1].conf)==null?void 0:w.meter)==null?void 0:N.multipliers)==null?void 0:D.watt)!=null?j:"Watt")+"")&&C(i,n),S[0]&16&&Xe(r.value)!==ve[4].m.m.w&&be(r,ve[4].m.m.w),S[0]&2&&m!==(m=((de=(fe=(le=(te=ve[1].conf)==null?void 0:te.meter)==null?void 0:le.multipliers)==null?void 0:fe.volt)!=null?de:"Volt")+"")&&C(p,m),S[0]&16&&Xe(h.value)!==ve[4].m.m.v&&be(h,ve[4].m.m.v),S[0]&2&&A!==(A=((Fe=(we=(Pe=(qe=ve[1].conf)==null?void 0:qe.meter)==null?void 0:Pe.multipliers)==null?void 0:we.amp)!=null?Fe:"Amp")+"")&&C(I,A),S[0]&16&&Xe(q.value)!==ve[4].m.m.a&&be(q,ve[4].m.m.a),S[0]&2&&F!==(F=((He=(De=(ke=(Ae=ve[1].conf)==null?void 0:Ae.meter)==null?void 0:ke.multipliers)==null?void 0:De.kwh)!=null?He:"kWh")+"")&&C(z,F),S[0]&16&&Xe(R.value)!==ve[4].m.m.c&&be(R,ve[4].m.m.c)},d(ve){ve&&T(t),K=!1,Et(y)}}}function L2(e){var i,o,f;let t,l=((f=(o=(i=e[1].conf)==null?void 0:i.connection)==null?void 0:o.eth)!=null?f:"Ethernet")+"",n;return{c(){t=_("option"),n=k(l),t.__value=3,t.value=t.__value},m(r,c){E(r,t,c),s(t,n)},p(r,c){var a,m,p;c[0]&2&&l!==(l=((p=(m=(a=r[1].conf)==null?void 0:a.connection)==null?void 0:m.eth)!=null?p:"Ethernet")+"")&&C(n,l)},d(r){r&&T(t)}}}function R2(e){var te,le,fe,de,qe,Pe,we,Fe,Ae,ke,De,He,Oe,je,Qe,We,Je,$e,tt,Te,ue,Ie,kt,lt,wt,st,ot,xe,Nt,gt,At,Pt;let t,l=((fe=(le=(te=e[1].conf)==null?void 0:te.connection)==null?void 0:le.ssid)!=null?fe:"SSID")+"",n,i,o,f,r,c,a=((Pe=(qe=(de=e[1].conf)==null?void 0:de.connection)==null?void 0:qe.psk)!=null?Pe:"Password")+"",m,p,v,d,h,g,M,A=((ke=(Ae=(Fe=(we=e[1].conf)==null?void 0:we.connection)==null?void 0:Fe.ps)==null?void 0:Ae.title)!=null?ke:"Power saving")+"",I,O,L,q,U,P=((je=(Oe=(He=(De=e[1].conf)==null?void 0:De.connection)==null?void 0:He.ps)==null?void 0:Oe.default)!=null?je:"Default")+"",F,z,G=(($e=(Je=(We=(Qe=e[1].conf)==null?void 0:Qe.connection)==null?void 0:We.ps)==null?void 0:Je.off)!=null?$e:"Off")+"",B,R,K=((Ie=(ue=(Te=(tt=e[1].conf)==null?void 0:tt.connection)==null?void 0:Te.ps)==null?void 0:ue.min)!=null?Ie:"Min")+"",y,H,Y=((st=(wt=(lt=(kt=e[1].conf)==null?void 0:kt.connection)==null?void 0:lt.ps)==null?void 0:wt.max)!=null?st:"Max")+"",X,J,$,ce=((Nt=(xe=(ot=e[1].conf)==null?void 0:ot.connection)==null?void 0:xe.pwr)!=null?Nt:"Power")+"",ie,oe,ae,se,x,_e,pe,V,Z,ge,ve,S,w=((Pt=(At=(gt=e[1].conf)==null?void 0:gt.connection)==null?void 0:At.tick_11b)!=null?Pt:"802.11b")+"",N,D,j;return{c(){t=_("div"),n=k(l),i=_("br"),o=b(),f=_("input"),r=b(),c=_("div"),m=k(a),p=_("br"),v=b(),d=_("input"),h=b(),g=_("div"),M=_("div"),I=k(A),O=_("br"),L=b(),q=_("select"),U=_("option"),F=k(P),z=_("option"),B=k(G),R=_("option"),y=k(K),H=_("option"),X=k(Y),J=b(),$=_("div"),ie=k(ce),oe=_("br"),ae=b(),se=_("div"),x=_("input"),_e=b(),pe=_("span"),pe.textContent="dBm",V=b(),Z=_("div"),ge=_("label"),ve=_("input"),S=b(),N=k(w),u(f,"name","ws"),u(f,"type","text"),u(f,"class","in-s"),u(t,"class","my-1"),u(d,"name","wp"),u(d,"type","password"),u(d,"class","in-s"),u(c,"class","my-1"),U.__value=255,U.value=U.__value,z.__value=0,z.value=z.__value,R.__value=1,R.value=R.__value,H.__value=2,H.value=H.__value,u(q,"name","wz"),u(q,"class","in-s"),e[4].w.z===void 0&&Ct(()=>e[49].call(q)),u(M,"class","w-1/2"),u(x,"name","ww"),u(x,"type","number"),u(x,"min","0"),u(x,"max","20.5"),u(x,"step","0.5"),u(x,"class","in-f tr w-full"),u(pe,"class","in-post"),u(se,"class","flex"),u($,"class","ml-2 w-1/2"),u(g,"class","my-1 flex"),u(ve,"type","checkbox"),u(ve,"name","wb"),ve.__value="true",ve.value=ve.__value,u(ve,"class","rounded mb-1"),u(Z,"class","my-3")},m(Be,ye){E(Be,t,ye),s(t,n),s(t,i),s(t,o),s(t,f),be(f,e[4].w.s),E(Be,r,ye),E(Be,c,ye),s(c,m),s(c,p),s(c,v),s(c,d),be(d,e[4].w.p),E(Be,h,ye),E(Be,g,ye),s(g,M),s(M,I),s(M,O),s(M,L),s(M,q),s(q,U),s(U,F),s(q,z),s(z,B),s(q,R),s(R,y),s(q,H),s(H,X),Ze(q,e[4].w.z,!0),s(g,J),s(g,$),s($,ie),s($,oe),s($,ae),s($,se),s(se,x),be(x,e[4].w.w),s(se,_e),s(se,pe),E(Be,V,ye),E(Be,Z,ye),s(Z,ge),s(ge,ve),ve.checked=e[4].w.b,s(ge,S),s(ge,N),D||(j=[re(f,"input",e[47]),re(d,"input",e[48]),re(q,"change",e[49]),re(x,"input",e[50]),re(ve,"change",e[51])],D=!0)},p(Be,ye){var It,vt,nt,Tt,it,at,rt,jt,Lt,Ht,yt,Me,Ve,Rt,Gt,zt,Dt,Kt,Zt,tl,Jt,ft,Mt,Ke,ne,Ue,Re,St,ut,Yt,ll,fl;ye[0]&2&&l!==(l=((nt=(vt=(It=Be[1].conf)==null?void 0:It.connection)==null?void 0:vt.ssid)!=null?nt:"SSID")+"")&&C(n,l),ye[0]&16&&f.value!==Be[4].w.s&&be(f,Be[4].w.s),ye[0]&2&&a!==(a=((at=(it=(Tt=Be[1].conf)==null?void 0:Tt.connection)==null?void 0:it.psk)!=null?at:"Password")+"")&&C(m,a),ye[0]&16&&d.value!==Be[4].w.p&&be(d,Be[4].w.p),ye[0]&2&&A!==(A=((Ht=(Lt=(jt=(rt=Be[1].conf)==null?void 0:rt.connection)==null?void 0:jt.ps)==null?void 0:Lt.title)!=null?Ht:"Power saving")+"")&&C(I,A),ye[0]&2&&P!==(P=((Rt=(Ve=(Me=(yt=Be[1].conf)==null?void 0:yt.connection)==null?void 0:Me.ps)==null?void 0:Ve.default)!=null?Rt:"Default")+"")&&C(F,P),ye[0]&2&&G!==(G=((Kt=(Dt=(zt=(Gt=Be[1].conf)==null?void 0:Gt.connection)==null?void 0:zt.ps)==null?void 0:Dt.off)!=null?Kt:"Off")+"")&&C(B,G),ye[0]&2&&K!==(K=((ft=(Jt=(tl=(Zt=Be[1].conf)==null?void 0:Zt.connection)==null?void 0:tl.ps)==null?void 0:Jt.min)!=null?ft:"Min")+"")&&C(y,K),ye[0]&2&&Y!==(Y=((Ue=(ne=(Ke=(Mt=Be[1].conf)==null?void 0:Mt.connection)==null?void 0:Ke.ps)==null?void 0:ne.max)!=null?Ue:"Max")+"")&&C(X,Y),ye[0]&16&&Ze(q,Be[4].w.z),ye[0]&2&&ce!==(ce=((ut=(St=(Re=Be[1].conf)==null?void 0:Re.connection)==null?void 0:St.pwr)!=null?ut:"Power")+"")&&C(ie,ce),ye[0]&16&&Xe(x.value)!==Be[4].w.w&&be(x,Be[4].w.w),ye[0]&16&&(ve.checked=Be[4].w.b),ye[0]&2&&w!==(w=((fl=(ll=(Yt=Be[1].conf)==null?void 0:Yt.connection)==null?void 0:ll.tick_11b)!=null?fl:"802.11b")+"")&&C(N,w)},d(Be){Be&&T(t),Be&&T(r),Be&&T(c),Be&&T(h),Be&&T(g),Be&&T(V),Be&&T(Z),D=!1,Et(j)}}}function F2(e){var O,L,q,U,P,F;let t,l=((q=(L=(O=e[1].conf)==null?void 0:O.network)==null?void 0:L.gw)!=null?q:"Gateway")+"",n,i,o,f,r,c,a=((F=(P=(U=e[1].conf)==null?void 0:U.network)==null?void 0:P.dns)!=null?F:"DNS")+"",m,p,v,d,h,g,M,A,I;return{c(){t=_("div"),n=k(l),i=_("br"),o=b(),f=_("input"),r=b(),c=_("div"),m=k(a),p=_("br"),v=b(),d=_("div"),h=_("input"),g=b(),M=_("input"),u(f,"name","ng"),u(f,"type","text"),u(f,"class","in-s"),u(t,"class","my-1"),u(h,"name","nd1"),u(h,"type","text"),u(h,"class","in-f w-full"),u(M,"name","nd2"),u(M,"type","text"),u(M,"class","in-l w-full"),u(d,"class","flex"),u(c,"class","my-1")},m(z,G){E(z,t,G),s(t,n),s(t,i),s(t,o),s(t,f),be(f,e[4].n.g),E(z,r,G),E(z,c,G),s(c,m),s(c,p),s(c,v),s(c,d),s(d,h),be(h,e[4].n.d1),s(d,g),s(d,M),be(M,e[4].n.d2),A||(I=[re(f,"input",e[55]),re(h,"input",e[56]),re(M,"input",e[57])],A=!0)},p(z,G){var B,R,K,y,H,Y;G[0]&2&&l!==(l=((K=(R=(B=z[1].conf)==null?void 0:B.network)==null?void 0:R.gw)!=null?K:"Gateway")+"")&&C(n,l),G[0]&16&&f.value!==z[4].n.g&&be(f,z[4].n.g),G[0]&2&&a!==(a=((Y=(H=(y=z[1].conf)==null?void 0:y.network)==null?void 0:H.dns)!=null?Y:"DNS")+"")&&C(m,a),G[0]&16&&h.value!==z[4].n.d1&&be(h,z[4].n.d1),G[0]&16&&M.value!==z[4].n.d2&&be(M,z[4].n.d2)},d(z){z&&T(t),z&&T(r),z&&T(c),A=!1,Et(I)}}}function B2(e){let t,l,n,i,o;return{c(){t=_("label"),l=_("input"),n=k(" SSL"),u(l,"type","checkbox"),u(l,"name","qs"),l.__value="true",l.value=l.__value,u(l,"class","rounded mb-1"),u(t,"class","float-right mr-3")},m(f,r){E(f,t,r),s(t,l),l.checked=e[4].q.s.e,s(t,n),i||(o=[re(l,"change",e[62]),re(l,"change",e[16])],i=!0)},p(f,r){r[0]&16&&(l.checked=f[4].q.s.e)},d(f){f&&T(t),i=!1,Et(o)}}}function U2(e){let t,l,n,i,o,f,r,c,a,m,p,v,d;const h=[og,sg],g=[];function M(P,F){return P[4].q.s.c?0:1}n=M(e),i=g[n]=h[n](e);const A=[rg,ug],I=[];function O(P,F){return P[4].q.s.r?0:1}r=O(e),c=I[r]=A[r](e);const L=[pg,_g],q=[];function U(P,F){return P[4].q.s.k?0:1}return p=U(e),v=q[p]=L[p](e),{c(){t=_("div"),l=_("span"),i.c(),o=b(),f=_("span"),c.c(),a=b(),m=_("span"),v.c(),u(l,"class","flex pr-2"),u(f,"class","flex pr-2"),u(m,"class","flex pr-2"),u(t,"class","my-1 flex")},m(P,F){E(P,t,F),s(t,l),g[n].m(l,null),s(t,o),s(t,f),I[r].m(f,null),s(t,a),s(t,m),q[p].m(m,null),d=!0},p(P,F){let z=n;n=M(P),n===z?g[n].p(P,F):(pt(),ee(g[z],1,1,()=>{g[z]=null}),dt(),i=g[n],i?i.p(P,F):(i=g[n]=h[n](P),i.c()),Q(i,1),i.m(l,null));let G=r;r=O(P),r===G?I[r].p(P,F):(pt(),ee(I[G],1,1,()=>{I[G]=null}),dt(),c=I[r],c?c.p(P,F):(c=I[r]=A[r](P),c.c()),Q(c,1),c.m(f,null));let B=p;p=U(P),p===B?q[p].p(P,F):(pt(),ee(q[B],1,1,()=>{q[B]=null}),dt(),v=q[p],v?v.p(P,F):(v=q[p]=L[p](P),v.c()),Q(v,1),v.m(m,null))},i(P){d||(Q(i),Q(c),Q(v),d=!0)},o(P){ee(i),ee(c),ee(v),d=!1},d(P){P&&T(t),g[n].d(),I[r].d(),q[p].d()}}}function sg(e){let t,l;return t=new ln({props:{to:"/mqtt-ca",$$slots:{default:[ag]},$$scope:{ctx:e}}}),{c(){Ne(t.$$.fragment)},m(n,i){Se(t,n,i),l=!0},p(n,i){const o={};i[0]&2|i[3]&536870912&&(o.$$scope={dirty:i,ctx:n}),t.$set(o)},i(n){l||(Q(t.$$.fragment,n),l=!0)},o(n){ee(t.$$.fragment,n),l=!1},d(n){Ce(t,n)}}}function og(e){let t,l,n,i,o,f,r;return l=new ln({props:{to:"/mqtt-ca",$$slots:{default:[fg]},$$scope:{ctx:e}}}),{c(){t=_("span"),Ne(l.$$.fragment),n=b(),i=_("span"),i.textContent="\u{1F5D1}",u(t,"class","bd-on"),u(i,"class","bd-off")},m(c,a){E(c,t,a),Se(l,t,null),E(c,n,a),E(c,i,a),o=!0,f||(r=[re(i,"click",e[13]),re(i,"keypress",e[13])],f=!0)},p(c,a){const m={};a[0]&2|a[3]&536870912&&(m.$$scope={dirty:a,ctx:c}),l.$set(m)},i(c){o||(Q(l.$$.fragment,c),o=!0)},o(c){ee(l.$$.fragment,c),o=!1},d(c){c&&T(t),Ce(l),c&&T(n),c&&T(i),f=!1,Et(r)}}}function ag(e){var n,i,o,f,r,c;let t,l;return t=new hi({props:{color:"blue",text:(o=(i=(n=e[1].conf)==null?void 0:n.mqtt)==null?void 0:i.btn_ca_upload)!=null?o:"Upload CA",title:(c=(r=(f=e[1].conf)==null?void 0:f.mqtt)==null?void 0:r.title_ca)!=null?c:""}}),{c(){Ne(t.$$.fragment)},m(a,m){Se(t,a,m),l=!0},p(a,m){var v,d,h,g,M,A;const p={};m[0]&2&&(p.text=(h=(d=(v=a[1].conf)==null?void 0:v.mqtt)==null?void 0:d.btn_ca_upload)!=null?h:"Upload CA"),m[0]&2&&(p.title=(A=(M=(g=a[1].conf)==null?void 0:g.mqtt)==null?void 0:M.title_ca)!=null?A:""),t.$set(p)},i(a){l||(Q(t.$$.fragment,a),l=!0)},o(a){ee(t.$$.fragment,a),l=!1},d(a){Ce(t,a)}}}function fg(e){var n,i,o;let t=((o=(i=(n=e[1].conf)==null?void 0:n.mqtt)==null?void 0:i.ca_ok)!=null?o:"CA OK")+"",l;return{c(){l=k(t)},m(f,r){E(f,l,r)},p(f,r){var c,a,m;r[0]&2&&t!==(t=((m=(a=(c=f[1].conf)==null?void 0:c.mqtt)==null?void 0:a.ca_ok)!=null?m:"CA OK")+"")&&C(l,t)},d(f){f&&T(l)}}}function ug(e){let t,l;return t=new ln({props:{to:"/mqtt-cert",$$slots:{default:[cg]},$$scope:{ctx:e}}}),{c(){Ne(t.$$.fragment)},m(n,i){Se(t,n,i),l=!0},p(n,i){const o={};i[0]&2|i[3]&536870912&&(o.$$scope={dirty:i,ctx:n}),t.$set(o)},i(n){l||(Q(t.$$.fragment,n),l=!0)},o(n){ee(t.$$.fragment,n),l=!1},d(n){Ce(t,n)}}}function rg(e){let t,l,n,i,o,f,r;return l=new ln({props:{to:"/mqtt-cert",$$slots:{default:[mg]},$$scope:{ctx:e}}}),{c(){t=_("span"),Ne(l.$$.fragment),n=b(),i=_("span"),i.textContent="\u{1F5D1}",u(t,"class","bd-on"),u(i,"class","bd-off")},m(c,a){E(c,t,a),Se(l,t,null),E(c,n,a),E(c,i,a),o=!0,f||(r=[re(i,"click",e[14]),re(i,"keypress",e[14])],f=!0)},p(c,a){const m={};a[0]&2|a[3]&536870912&&(m.$$scope={dirty:a,ctx:c}),l.$set(m)},i(c){o||(Q(l.$$.fragment,c),o=!0)},o(c){ee(l.$$.fragment,c),o=!1},d(c){c&&T(t),Ce(l),c&&T(n),c&&T(i),f=!1,Et(r)}}}function cg(e){var n,i,o,f,r,c;let t,l;return t=new hi({props:{color:"blue",text:(o=(i=(n=e[1].conf)==null?void 0:n.mqtt)==null?void 0:i.btn_crt_upload)!=null?o:"Upload cert",title:(c=(r=(f=e[1].conf)==null?void 0:f.mqtt)==null?void 0:r.title_crt)!=null?c:""}}),{c(){Ne(t.$$.fragment)},m(a,m){Se(t,a,m),l=!0},p(a,m){var v,d,h,g,M,A;const p={};m[0]&2&&(p.text=(h=(d=(v=a[1].conf)==null?void 0:v.mqtt)==null?void 0:d.btn_crt_upload)!=null?h:"Upload cert"),m[0]&2&&(p.title=(A=(M=(g=a[1].conf)==null?void 0:g.mqtt)==null?void 0:M.title_crt)!=null?A:""),t.$set(p)},i(a){l||(Q(t.$$.fragment,a),l=!0)},o(a){ee(t.$$.fragment,a),l=!1},d(a){Ce(t,a)}}}function mg(e){var n,i,o;let t=((o=(i=(n=e[1].conf)==null?void 0:n.mqtt)==null?void 0:i.crt_ok)!=null?o:"Cert OK")+"",l;return{c(){l=k(t)},m(f,r){E(f,l,r)},p(f,r){var c,a,m;r[0]&2&&t!==(t=((m=(a=(c=f[1].conf)==null?void 0:c.mqtt)==null?void 0:a.crt_ok)!=null?m:"Cert OK")+"")&&C(l,t)},d(f){f&&T(l)}}}function _g(e){let t,l;return t=new ln({props:{to:"/mqtt-key",$$slots:{default:[dg]},$$scope:{ctx:e}}}),{c(){Ne(t.$$.fragment)},m(n,i){Se(t,n,i),l=!0},p(n,i){const o={};i[0]&2|i[3]&536870912&&(o.$$scope={dirty:i,ctx:n}),t.$set(o)},i(n){l||(Q(t.$$.fragment,n),l=!0)},o(n){ee(t.$$.fragment,n),l=!1},d(n){Ce(t,n)}}}function pg(e){let t,l,n,i,o,f,r;return l=new ln({props:{to:"/mqtt-key",$$slots:{default:[vg]},$$scope:{ctx:e}}}),{c(){t=_("span"),Ne(l.$$.fragment),n=b(),i=_("span"),i.textContent="\u{1F5D1}",u(t,"class","bd-on"),u(i,"class","bd-off")},m(c,a){E(c,t,a),Se(l,t,null),E(c,n,a),E(c,i,a),o=!0,f||(r=[re(i,"click",e[15]),re(i,"keypress",e[15])],f=!0)},p(c,a){const m={};a[0]&2|a[3]&536870912&&(m.$$scope={dirty:a,ctx:c}),l.$set(m)},i(c){o||(Q(l.$$.fragment,c),o=!0)},o(c){ee(l.$$.fragment,c),o=!1},d(c){c&&T(t),Ce(l),c&&T(n),c&&T(i),f=!1,Et(r)}}}function dg(e){var n,i,o,f,r,c;let t,l;return t=new hi({props:{color:"blue",text:(o=(i=(n=e[1].conf)==null?void 0:n.mqtt)==null?void 0:i.btn_key_upload)!=null?o:"Upload key",title:(c=(r=(f=e[1].conf)==null?void 0:f.mqtt)==null?void 0:r.title_key)!=null?c:""}}),{c(){Ne(t.$$.fragment)},m(a,m){Se(t,a,m),l=!0},p(a,m){var v,d,h,g,M,A;const p={};m[0]&2&&(p.text=(h=(d=(v=a[1].conf)==null?void 0:v.mqtt)==null?void 0:d.btn_key_upload)!=null?h:"Upload key"),m[0]&2&&(p.title=(A=(M=(g=a[1].conf)==null?void 0:g.mqtt)==null?void 0:M.title_key)!=null?A:""),t.$set(p)},i(a){l||(Q(t.$$.fragment,a),l=!0)},o(a){ee(t.$$.fragment,a),l=!1},d(a){Ce(t,a)}}}function vg(e){var n,i,o;let t=((o=(i=(n=e[1].conf)==null?void 0:n.mqtt)==null?void 0:i.key_ok)!=null?o:"Key OK")+"",l;return{c(){l=k(t)},m(f,r){E(f,l,r)},p(f,r){var c,a,m;r[0]&2&&t!==(t=((m=(a=(c=f[1].conf)==null?void 0:c.mqtt)==null?void 0:a.key_ok)!=null?m:"Key OK")+"")&&C(l,t)},d(f){f&&T(l)}}}function j2(e){var oe,ae,se,x,_e,pe,V,Z,ge,ve,S,w,N,D,j,te;let t,l,n=((x=(se=(ae=(oe=e[1].conf)==null?void 0:oe.mqtt)==null?void 0:ae.domoticz)==null?void 0:se.title)!=null?x:"Domoticz")+"",i,o,f,r,c,a,m,p,v,d=((Z=(V=(pe=(_e=e[1].conf)==null?void 0:_e.mqtt)==null?void 0:pe.domoticz)==null?void 0:V.eidx)!=null?Z:"Electricity IDX")+"",h,g,M,A,I,O,L=((w=(S=(ve=(ge=e[1].conf)==null?void 0:ge.mqtt)==null?void 0:ve.domoticz)==null?void 0:S.cidx)!=null?w:"Current IDX")+"",q,U,P,F,z,G,B=((te=(j=(D=(N=e[1].conf)==null?void 0:N.mqtt)==null?void 0:D.domoticz)==null?void 0:j.vidx)!=null?te:"Voltage IDX")+"",R,K,y,H,Y,X,J,$,ce,ie;return{c(){t=_("div"),l=_("strong"),i=k(n),o=b(),f=_("a"),r=k("\u24D8"),c=b(),a=_("input"),m=b(),p=_("div"),v=_("div"),h=k(d),g=_("br"),M=b(),A=_("input"),I=b(),O=_("div"),q=k(L),U=_("br"),P=b(),F=_("input"),z=b(),G=_("div"),R=k(B),K=k(`: L1, L2 & L3 + `),y=_("div"),H=_("input"),Y=b(),X=_("input"),J=b(),$=_("input"),u(l,"class","text-sm"),u(f,"href",zl("MQTT-configuration#domoticz")),u(f,"target","_blank"),u(f,"class","float-right"),u(a,"type","hidden"),u(a,"name","o"),a.value="true",u(A,"name","oe"),u(A,"type","text"),u(A,"class","in-f tr w-full"),u(v,"class","w-1/2"),u(F,"name","oc"),u(F,"type","text"),u(F,"class","in-l tr w-full"),u(O,"class","w-1/2"),u(p,"class","my-1 flex"),u(H,"name","ou1"),u(H,"type","text"),u(H,"class","in-f tr w-1/3"),u(X,"name","ou2"),u(X,"type","text"),u(X,"class","in-m tr w-1/3"),u($,"name","ou3"),u($,"type","text"),u($,"class","in-l tr w-1/3"),u(y,"class","flex"),u(G,"class","my-1"),u(t,"class","cnt")},m(le,fe){E(le,t,fe),s(t,l),s(l,i),s(t,o),s(t,f),s(f,r),s(t,c),s(t,a),s(t,m),s(t,p),s(p,v),s(v,h),s(v,g),s(v,M),s(v,A),be(A,e[4].o.e),s(p,I),s(p,O),s(O,q),s(O,U),s(O,P),s(O,F),be(F,e[4].o.c),s(t,z),s(t,G),s(G,R),s(G,K),s(G,y),s(y,H),be(H,e[4].o.u1),s(y,Y),s(y,X),be(X,e[4].o.u2),s(y,J),s(y,$),be($,e[4].o.u3),ce||(ie=[re(A,"input",e[70]),re(F,"input",e[71]),re(H,"input",e[72]),re(X,"input",e[73]),re($,"input",e[74])],ce=!0)},p(le,fe){var de,qe,Pe,we,Fe,Ae,ke,De,He,Oe,je,Qe,We,Je,$e,tt;fe[0]&2&&n!==(n=((we=(Pe=(qe=(de=le[1].conf)==null?void 0:de.mqtt)==null?void 0:qe.domoticz)==null?void 0:Pe.title)!=null?we:"Domoticz")+"")&&C(i,n),fe[0]&2&&d!==(d=((De=(ke=(Ae=(Fe=le[1].conf)==null?void 0:Fe.mqtt)==null?void 0:Ae.domoticz)==null?void 0:ke.eidx)!=null?De:"Electricity IDX")+"")&&C(h,d),fe[0]&16&&A.value!==le[4].o.e&&be(A,le[4].o.e),fe[0]&2&&L!==(L=((Qe=(je=(Oe=(He=le[1].conf)==null?void 0:He.mqtt)==null?void 0:Oe.domoticz)==null?void 0:je.cidx)!=null?Qe:"Current IDX")+"")&&C(q,L),fe[0]&16&&F.value!==le[4].o.c&&be(F,le[4].o.c),fe[0]&2&&B!==(B=((tt=($e=(Je=(We=le[1].conf)==null?void 0:We.mqtt)==null?void 0:Je.domoticz)==null?void 0:$e.vidx)!=null?tt:"Voltage IDX")+"")&&C(R,B),fe[0]&16&&H.value!==le[4].o.u1&&be(H,le[4].o.u1),fe[0]&16&&X.value!==le[4].o.u2&&be(X,le[4].o.u2),fe[0]&16&&$.value!==le[4].o.u3&&be($,le[4].o.u3)},d(le){le&&T(t),ce=!1,Et(ie)}}}function H2(e){var J,$,ce,ie,oe,ae,se,x,_e,pe,V,Z,ge,ve,S,w;let t,l,n=((ie=(ce=($=(J=e[1].conf)==null?void 0:J.mqtt)==null?void 0:$.ha)==null?void 0:ce.title)!=null?ie:"Home-Assistant")+"",i,o,f,r,c,a,m,p,v=((x=(se=(ae=(oe=e[1].conf)==null?void 0:oe.mqtt)==null?void 0:ae.ha)==null?void 0:se.discovery)!=null?x:"Discovery topic prefix")+"",d,h,g,M,A,I,O=((Z=(V=(pe=(_e=e[1].conf)==null?void 0:_e.mqtt)==null?void 0:pe.ha)==null?void 0:V.hostname)!=null?Z:"Hostname for URL")+"",L,q,U,P,F,z,G,B=((w=(S=(ve=(ge=e[1].conf)==null?void 0:ge.mqtt)==null?void 0:ve.ha)==null?void 0:S.tag)!=null?w:"Name tag")+"",R,K,y,H,Y,X;return{c(){t=_("div"),l=_("strong"),i=k(n),o=b(),f=_("a"),r=k("\u24D8"),c=b(),a=_("input"),m=b(),p=_("div"),d=k(v),h=_("br"),g=b(),M=_("input"),A=b(),I=_("div"),L=k(O),q=_("br"),U=b(),P=_("input"),z=b(),G=_("div"),R=k(B),K=_("br"),y=b(),H=_("input"),u(l,"class","text-sm"),u(f,"href",zl("MQTT-configuration#home-assistant")),u(f,"target","_blank"),u(f,"class","float-right"),u(a,"type","hidden"),u(a,"name","h"),a.value="true",u(M,"name","ht"),u(M,"type","text"),u(M,"class","in-s"),u(M,"placeholder","homeassistant"),u(p,"class","my-1"),u(P,"name","hh"),u(P,"type","text"),u(P,"class","in-s"),u(P,"placeholder",F=e[4].g.h+".local"),u(I,"class","my-1"),u(H,"name","hn"),u(H,"type","text"),u(H,"class","in-s"),u(G,"class","my-1"),u(t,"class","cnt")},m(N,D){E(N,t,D),s(t,l),s(l,i),s(t,o),s(t,f),s(f,r),s(t,c),s(t,a),s(t,m),s(t,p),s(p,d),s(p,h),s(p,g),s(p,M),be(M,e[4].h.t),s(t,A),s(t,I),s(I,L),s(I,q),s(I,U),s(I,P),be(P,e[4].h.h),s(t,z),s(t,G),s(G,R),s(G,K),s(G,y),s(G,H),be(H,e[4].h.n),Y||(X=[re(M,"input",e[75]),re(P,"input",e[76]),re(H,"input",e[77])],Y=!0)},p(N,D){var j,te,le,fe,de,qe,Pe,we,Fe,Ae,ke,De,He,Oe,je,Qe;D[0]&2&&n!==(n=((fe=(le=(te=(j=N[1].conf)==null?void 0:j.mqtt)==null?void 0:te.ha)==null?void 0:le.title)!=null?fe:"Home-Assistant")+"")&&C(i,n),D[0]&2&&v!==(v=((we=(Pe=(qe=(de=N[1].conf)==null?void 0:de.mqtt)==null?void 0:qe.ha)==null?void 0:Pe.discovery)!=null?we:"Discovery topic prefix")+"")&&C(d,v),D[0]&16&&M.value!==N[4].h.t&&be(M,N[4].h.t),D[0]&2&&O!==(O=((De=(ke=(Ae=(Fe=N[1].conf)==null?void 0:Fe.mqtt)==null?void 0:Ae.ha)==null?void 0:ke.hostname)!=null?De:"Hostname for URL")+"")&&C(L,O),D[0]&16&&F!==(F=N[4].g.h+".local")&&u(P,"placeholder",F),D[0]&16&&P.value!==N[4].h.h&&be(P,N[4].h.h),D[0]&2&&B!==(B=((Qe=(je=(Oe=(He=N[1].conf)==null?void 0:He.mqtt)==null?void 0:Oe.ha)==null?void 0:je.tag)!=null?Qe:"Name tag")+"")&&C(R,B),D[0]&16&&H.value!==N[4].h.n&&be(H,N[4].h.n)},d(N){N&&T(t),Y=!1,Et(X)}}}function y2(e){var K,y,H,Y,X,J,$,ce,ie;let t,l,n=((H=(y=(K=e[1].conf)==null?void 0:K.cloud)==null?void 0:y.title)!=null?H:"Cloud connections")+"",i,o,f,r,c,a,m,p,v,d,h,g=((J=(X=(Y=e[1].conf)==null?void 0:Y.cloud)==null?void 0:X.ams)!=null?J:"AMS reader cloud")+"",M,A,I,O,L,q,U=((ie=(ce=($=e[1].conf)==null?void 0:$.cloud)==null?void 0:ce.es)!=null?ie:"Energy Speedometer")+"",P,F,z,G,B,R=e[4].c.es&&z2(e);return{c(){t=_("div"),l=_("strong"),i=k(n),o=b(),f=_("a"),r=k("\u24D8"),c=b(),a=_("input"),m=b(),p=_("div"),v=_("label"),d=_("input"),h=b(),M=k(g),A=b(),I=_("div"),O=_("label"),L=_("input"),q=b(),P=k(U),F=b(),R&&R.c(),u(l,"class","text-sm"),u(f,"href",zl("Cloud")),u(f,"target","_blank"),u(f,"class","float-right"),u(a,"type","hidden"),u(a,"name","c"),a.value="true",u(d,"type","checkbox"),u(d,"name","ce"),d.__value="true",d.value=d.__value,u(d,"class","rounded mb-1"),u(p,"class","my-1"),u(L,"type","checkbox"),u(L,"class","rounded mb-1"),u(L,"name","ces"),L.__value="true",L.value=L.__value,u(I,"class","my-1"),u(t,"class","cnt")},m(oe,ae){E(oe,t,ae),s(t,l),s(l,i),s(t,o),s(t,f),s(f,r),s(t,c),s(t,a),s(t,m),s(t,p),s(p,v),s(v,d),d.checked=e[4].c.e,s(v,h),s(v,M),s(t,A),s(t,I),s(I,O),s(O,L),L.checked=e[4].c.es,s(O,q),s(O,P),s(I,F),R&&R.m(I,null),z=!0,G||(B=[re(d,"change",e[78]),re(L,"change",e[79])],G=!0)},p(oe,ae){var se,x,_e,pe,V,Z,ge,ve,S;(!z||ae[0]&2)&&n!==(n=((_e=(x=(se=oe[1].conf)==null?void 0:se.cloud)==null?void 0:x.title)!=null?_e:"Cloud connections")+"")&&C(i,n),ae[0]&16&&(d.checked=oe[4].c.e),(!z||ae[0]&2)&&g!==(g=((Z=(V=(pe=oe[1].conf)==null?void 0:pe.cloud)==null?void 0:V.ams)!=null?Z:"AMS reader cloud")+"")&&C(M,g),ae[0]&16&&(L.checked=oe[4].c.es),(!z||ae[0]&2)&&U!==(U=((S=(ve=(ge=oe[1].conf)==null?void 0:ge.cloud)==null?void 0:ve.es)!=null?S:"Energy Speedometer")+"")&&C(P,U),oe[4].c.es?R?(R.p(oe,ae),ae[0]&16&&Q(R,1)):(R=z2(oe),R.c(),Q(R,1),R.m(I,null)):R&&(pt(),ee(R,1,1,()=>{R=null}),dt())},i(oe){z||(Q(R),z=!0)},o(oe){ee(R),z=!1},d(oe){oe&&T(t),R&&R.d(),G=!1,Et(B)}}}function z2(e){let t,l,n=e[0].mac+"",i,o,f,r,c=(e[0].meter.id?e[0].meter.id:"missing, required")+"",a,m,p,v,d=e[0].mac&&e[0].meter.id&&W2(e);return{c(){t=_("div"),l=k("MAC: "),i=k(n),o=b(),f=_("div"),r=k("Meter ID: "),a=k(c),m=b(),d&&d.c(),p=Ut(),u(t,"class","pl-5"),u(f,"class","pl-5")},m(h,g){E(h,t,g),s(t,l),s(t,i),E(h,o,g),E(h,f,g),s(f,r),s(f,a),E(h,m,g),d&&d.m(h,g),E(h,p,g),v=!0},p(h,g){(!v||g[0]&1)&&n!==(n=h[0].mac+"")&&C(i,n),(!v||g[0]&1)&&c!==(c=(h[0].meter.id?h[0].meter.id:"missing, required")+"")&&C(a,c),h[0].mac&&h[0].meter.id?d?(d.p(h,g),g[0]&1&&Q(d,1)):(d=W2(h),d.c(),Q(d,1),d.m(p.parentNode,p)):d&&(pt(),ee(d,1,1,()=>{d=null}),dt())},i(h){v||(Q(d),v=!0)},o(h){ee(d),v=!1},d(h){h&&T(t),h&&T(o),h&&T(f),h&&T(m),d&&d.d(h),h&&T(p)}}}function W2(e){let t,l,n;return l=new J4({props:{value:'{"mac":"'+e[0].mac+'","meter":"'+e[0].meter.id+'"}'}}),{c(){t=_("div"),Ne(l.$$.fragment),u(t,"class","pl-2")},m(i,o){E(i,t,o),Se(l,t,null),n=!0},p(i,o){const f={};o[0]&1&&(f.value='{"mac":"'+i[0].mac+'","meter":"'+i[0].meter.id+'"}'),l.$set(f)},i(i){n||(Q(l.$$.fragment,i),n=!0)},o(i){ee(l.$$.fragment,i),n=!1},d(i){i&&T(t),Ce(l)}}}function G2(e){var B,R,K,y,H,Y,X,J;let t,l,n=((K=(R=(B=e[1].conf)==null?void 0:B.thresholds)==null?void 0:R.title)!=null?K:"Thresholds")+"",i,o,f,r,c,a,m,p,v,d,h,g=((Y=(H=(y=e[1].conf)==null?void 0:y.thresholds)==null?void 0:H.avg)!=null?Y:"Average of")+"",M,A,I,O,L,q=((J=(X=e[1].common)==null?void 0:X.hours)!=null?J:"hours")+"",U,P,F,z={length:9},G=[];for(let $=0;$20&&X2(e),d=e[4].i.d.d>0&&$2(e),h=e[0].chip=="esp8266"&&x2(e);return{c(){t=_("div"),l=_("strong"),i=k(n),o=b(),f=_("a"),r=k("\u24D8"),c=b(),v&&v.c(),a=b(),d&&d.c(),m=b(),h&&h.c(),u(l,"class","text-sm"),u(f,"href",zl("GPIO-configuration")),u(f,"target","_blank"),u(f,"class","float-right"),u(t,"class","cnt")},m(I,O){E(I,t,O),s(t,l),s(l,i),s(t,o),s(t,f),s(f,r),s(t,c),v&&v.m(t,null),s(t,a),d&&d.m(t,null),s(t,m),h&&h.m(t,null),p=!0},p(I,O){var L,q,U;(!p||O[0]&2)&&n!==(n=((U=(q=(L=I[1].conf)==null?void 0:L.hw)==null?void 0:q.title)!=null?U:"Hardware")+"")&&C(i,n),I[0].board>20?v?(v.p(I,O),O[0]&1&&Q(v,1)):(v=X2(I),v.c(),Q(v,1),v.m(t,a)):v&&(pt(),ee(v,1,1,()=>{v=null}),dt()),I[4].i.d.d>0?d?d.p(I,O):(d=$2(I),d.c(),d.m(t,m)):d&&(d.d(1),d=null),I[0].chip=="esp8266"?h?h.p(I,O):(h=x2(I),h.c(),h.m(t,null)):h&&(h.d(1),h=null)},i(I){p||(Q(v),p=!0)},o(I){ee(v),p=!1},d(I){I&&T(t),v&&v.d(),d&&d.d(),h&&h.d()}}}function X2(e){var jt,Lt,Ht,yt,Me,Ve,Rt,Gt,zt,Dt,Kt,Zt,tl,Jt,ft,Mt,Ke,ne,Ue,Re,St,ut,Yt,ll,fl,ul,Sl,rl,Cl,nl,ml,dl,Nl,Tl,Qt,Ee,qt,En,Zl,vn,An;let t,l,n,i,o=((yt=(Ht=(Lt=(jt=e[1].conf)==null?void 0:jt.hw)==null?void 0:Lt.han)==null?void 0:Ht.rx)!=null?yt:"HAN RX")+"",f,r,c,a,m,p,v,d=((Gt=(Rt=(Ve=(Me=e[1].conf)==null?void 0:Me.hw)==null?void 0:Ve.han)==null?void 0:Rt.tx)!=null?Gt:"HAN TX")+"",h,g,M,A,I,O,L,q,U,P,F=((Zt=(Kt=(Dt=(zt=e[1].conf)==null?void 0:zt.hw)==null?void 0:Dt.han)==null?void 0:Kt.pullup)!=null?Zt:"pullup")+"",z,G,B,R,K=((ft=(Jt=(tl=e[1].conf)==null?void 0:tl.hw)==null?void 0:Jt.ap_btn)!=null?ft:"AP button")+"",y,H,Y,X,J,$,ce=((Ue=(ne=(Ke=(Mt=e[1].conf)==null?void 0:Mt.hw)==null?void 0:Ke.led)==null?void 0:ne.title)!=null?Ue:"LED")+"",ie,oe,ae,se,x,_e,pe,V,Z,ge,ve=((Yt=(ut=(St=(Re=e[1].conf)==null?void 0:Re.hw)==null?void 0:St.led)==null?void 0:ut.inverted)!=null?Yt:"inverted")+"",S,w,N,D=((Sl=(ul=(fl=(ll=e[1].conf)==null?void 0:ll.hw)==null?void 0:fl.led)==null?void 0:ul.rgb)!=null?Sl:"RGB")+"",j,te,le,fe,de=((ml=(nl=(Cl=(rl=e[1].conf)==null?void 0:rl.hw)==null?void 0:Cl.led)==null?void 0:nl.inverted)!=null?ml:"inverted")+"",qe,Pe,we,Fe,Ae,ke,De,He,Oe,je,Qe,We,Je=((Qt=(Tl=(Nl=(dl=e[1].conf)==null?void 0:dl.hw)==null?void 0:Nl.led)==null?void 0:Tl.disable)!=null?Qt:"LED dis. GPIO")+"",$e,tt,Te,ue,Ie,kt=((En=(qt=(Ee=e[1].conf)==null?void 0:Ee.hw)==null?void 0:qt.temp)!=null?En:"Temperature")+"",lt,wt,st,ot,xe,Nt,gt=((An=(vn=(Zl=e[1].conf)==null?void 0:Zl.hw)==null?void 0:vn.temp_analog)!=null?An:"Analog temp")+"",At,Pt,Be,ye,It,vt,nt,Tt,it;m=new rf({props:{chip:e[0].chip}}),I=new rf({props:{chip:e[0].chip}});let at=e[0].chip!="esp8266"&&Z2(e),rt=e[4].i.v.p>0&&J2(e);return{c(){t=_("input"),l=b(),n=_("div"),i=_("div"),f=k(o),r=_("br"),c=b(),a=_("select"),Ne(m.$$.fragment),p=b(),v=_("div"),h=k(d),g=_("br"),M=b(),A=_("select"),Ne(I.$$.fragment),O=b(),L=_("div"),q=_("label"),U=_("input"),P=b(),z=k(F),G=b(),B=_("div"),R=_("div"),y=k(K),H=_("br"),Y=b(),X=_("input"),J=b(),$=_("div"),ie=k(ce),oe=_("br"),ae=b(),se=_("div"),x=_("input"),_e=b(),pe=_("div"),V=_("label"),Z=_("input"),ge=b(),S=k(ve),w=b(),N=_("div"),j=k(D),te=_("label"),le=_("input"),fe=b(),qe=k(de),Pe=_("br"),we=b(),Fe=_("div"),Ae=_("input"),ke=b(),De=_("input"),He=b(),Oe=_("input"),je=b(),Qe=_("div"),We=_("div"),$e=k(Je),tt=b(),Te=_("input"),ue=b(),Ie=_("div"),lt=k(kt),wt=_("br"),st=b(),ot=_("input"),xe=b(),Nt=_("div"),At=k(gt),Pt=_("br"),Be=b(),ye=_("input"),It=b(),at&&at.c(),vt=b(),rt&&rt.c(),u(t,"type","hidden"),u(t,"name","i"),t.value="true",u(a,"name","ihp"),u(a,"class","in-f w-full"),e[4].i.h.p===void 0&&Ct(()=>e[84].call(a)),u(i,"class","w-1/3"),u(A,"name","iht"),u(A,"class","in-l w-full"),e[4].i.h.t===void 0&&Ct(()=>e[85].call(A)),u(v,"class","w-1/3"),u(U,"name","ihu"),U.__value="true",U.value=U.__value,u(U,"type","checkbox"),u(U,"class","rounded mb-1"),u(q,"class","ml-2"),u(L,"class","w-1/3"),u(n,"class","flex flex-wrap"),u(X,"name","ia"),u(X,"type","number"),u(X,"min","0"),u(X,"max",e[8]),u(X,"class","in-f tr w-full"),u(R,"class","w-1/3"),u(x,"name","ilp"),u(x,"type","number"),u(x,"min","0"),u(x,"max",e[8]),u(x,"class","in-l tr w-full"),u(se,"class","flex"),u($,"class","w-1/3"),u(Z,"name","ili"),Z.__value="true",Z.value=Z.__value,u(Z,"type","checkbox"),u(Z,"class","rounded mb-1"),u(V,"class","ml-4"),u(pe,"class","w-1/3"),u(le,"name","iri"),le.__value="true",le.value=le.__value,u(le,"type","checkbox"),u(le,"class","rounded mb-1"),u(te,"class","ml-4"),u(Ae,"name","irr"),u(Ae,"type","number"),u(Ae,"min","0"),u(Ae,"max",e[8]),u(Ae,"class","in-f tr w-1/3"),u(De,"name","irg"),u(De,"type","number"),u(De,"min","0"),u(De,"max",e[8]),u(De,"class","in-m tr w-1/3"),u(Oe,"name","irb"),u(Oe,"type","number"),u(Oe,"min","0"),u(Oe,"max",e[8]),u(Oe,"class","in-l tr w-1/3"),u(Fe,"class","flex"),u(N,"class","w-full"),u(Te,"name","idd"),u(Te,"type","number"),u(Te,"min","0"),u(Te,"max",e[8]),u(Te,"class","in-s tr"),u(We,"class","my-1 pr-1 w-1/3"),u(Qe,"class","w-full"),u(ot,"name","itd"),u(ot,"type","number"),u(ot,"min","0"),u(ot,"max",e[8]),u(ot,"class","in-f tr w-full"),u(Ie,"class","my-1 w-1/3"),u(ye,"name","ita"),u(ye,"type","number"),u(ye,"min","0"),u(ye,"max",e[8]),u(ye,"class","in-l tr w-full"),u(Nt,"class","my-1 pr-1 w-1/3"),u(B,"class","flex flex-wrap")},m(Le,he){E(Le,t,he),E(Le,l,he),E(Le,n,he),s(n,i),s(i,f),s(i,r),s(i,c),s(i,a),Se(m,a,null),Ze(a,e[4].i.h.p,!0),s(n,p),s(n,v),s(v,h),s(v,g),s(v,M),s(v,A),Se(I,A,null),Ze(A,e[4].i.h.t,!0),s(n,O),s(n,L),s(L,q),s(q,U),U.checked=e[4].i.h.u,s(q,P),s(q,z),E(Le,G,he),E(Le,B,he),s(B,R),s(R,y),s(R,H),s(R,Y),s(R,X),be(X,e[4].i.a),s(B,J),s(B,$),s($,ie),s($,oe),s($,ae),s($,se),s(se,x),be(x,e[4].i.l.p),s(B,_e),s(B,pe),s(pe,V),s(V,Z),Z.checked=e[4].i.l.i,s(V,ge),s(V,S),s(B,w),s(B,N),s(N,j),s(N,te),s(te,le),le.checked=e[4].i.r.i,s(te,fe),s(te,qe),s(N,Pe),s(N,we),s(N,Fe),s(Fe,Ae),be(Ae,e[4].i.r.r),s(Fe,ke),s(Fe,De),be(De,e[4].i.r.g),s(Fe,He),s(Fe,Oe),be(Oe,e[4].i.r.b),s(B,je),s(B,Qe),s(Qe,We),s(We,$e),s(We,tt),s(We,Te),be(Te,e[4].i.d.d),s(B,ue),s(B,Ie),s(Ie,lt),s(Ie,wt),s(Ie,st),s(Ie,ot),be(ot,e[4].i.t.d),s(B,xe),s(B,Nt),s(Nt,At),s(Nt,Pt),s(Nt,Be),s(Nt,ye),be(ye,e[4].i.t.a),s(B,It),at&&at.m(B,null),s(B,vt),rt&&rt.m(B,null),nt=!0,Tt||(it=[re(a,"change",e[84]),re(A,"change",e[85]),re(U,"change",e[86]),re(X,"input",e[87]),re(x,"input",e[88]),re(Z,"change",e[89]),re(le,"change",e[90]),re(Ae,"input",e[91]),re(De,"input",e[92]),re(Oe,"input",e[93]),re(Te,"input",e[94]),re(ot,"input",e[95]),re(ye,"input",e[96])],Tt=!0)},p(Le,he){var Dn,Wl,hn,qn,Wn,Gn,_l,Jl,$l,Vn,xl,Gl,bn,On,Kn,Yn,en,cl,Qn,ti,us,gn,li,Mi,rs,cs,In,Pl,ms,ni,_s,Si,ps,kn,Xn,El,ds,ii,Ci,vs,hs;(!nt||he[0]&2)&&o!==(o=((qn=(hn=(Wl=(Dn=Le[1].conf)==null?void 0:Dn.hw)==null?void 0:Wl.han)==null?void 0:hn.rx)!=null?qn:"HAN RX")+"")&&C(f,o);const et={};he[0]&1&&(et.chip=Le[0].chip),m.$set(et),he[0]&16&&Ze(a,Le[4].i.h.p),(!nt||he[0]&2)&&d!==(d=((Jl=(_l=(Gn=(Wn=Le[1].conf)==null?void 0:Wn.hw)==null?void 0:Gn.han)==null?void 0:_l.tx)!=null?Jl:"HAN TX")+"")&&C(h,d);const zn={};he[0]&1&&(zn.chip=Le[0].chip),I.$set(zn),he[0]&16&&Ze(A,Le[4].i.h.t),he[0]&16&&(U.checked=Le[4].i.h.u),(!nt||he[0]&2)&&F!==(F=((Gl=(xl=(Vn=($l=Le[1].conf)==null?void 0:$l.hw)==null?void 0:Vn.han)==null?void 0:xl.pullup)!=null?Gl:"pullup")+"")&&C(z,F),(!nt||he[0]&2)&&K!==(K=((Kn=(On=(bn=Le[1].conf)==null?void 0:bn.hw)==null?void 0:On.ap_btn)!=null?Kn:"AP button")+"")&&C(y,K),(!nt||he[0]&256)&&u(X,"max",Le[8]),he[0]&16&&Xe(X.value)!==Le[4].i.a&&be(X,Le[4].i.a),(!nt||he[0]&2)&&ce!==(ce=((Qn=(cl=(en=(Yn=Le[1].conf)==null?void 0:Yn.hw)==null?void 0:en.led)==null?void 0:cl.title)!=null?Qn:"LED")+"")&&C(ie,ce),(!nt||he[0]&256)&&u(x,"max",Le[8]),he[0]&16&&Xe(x.value)!==Le[4].i.l.p&&be(x,Le[4].i.l.p),he[0]&16&&(Z.checked=Le[4].i.l.i),(!nt||he[0]&2)&&ve!==(ve=((li=(gn=(us=(ti=Le[1].conf)==null?void 0:ti.hw)==null?void 0:us.led)==null?void 0:gn.inverted)!=null?li:"inverted")+"")&&C(S,ve),(!nt||he[0]&2)&&D!==(D=((In=(cs=(rs=(Mi=Le[1].conf)==null?void 0:Mi.hw)==null?void 0:rs.led)==null?void 0:cs.rgb)!=null?In:"RGB")+"")&&C(j,D),he[0]&16&&(le.checked=Le[4].i.r.i),(!nt||he[0]&2)&&de!==(de=((_s=(ni=(ms=(Pl=Le[1].conf)==null?void 0:Pl.hw)==null?void 0:ms.led)==null?void 0:ni.inverted)!=null?_s:"inverted")+"")&&C(qe,de),(!nt||he[0]&256)&&u(Ae,"max",Le[8]),he[0]&16&&Xe(Ae.value)!==Le[4].i.r.r&&be(Ae,Le[4].i.r.r),(!nt||he[0]&256)&&u(De,"max",Le[8]),he[0]&16&&Xe(De.value)!==Le[4].i.r.g&&be(De,Le[4].i.r.g),(!nt||he[0]&256)&&u(Oe,"max",Le[8]),he[0]&16&&Xe(Oe.value)!==Le[4].i.r.b&&be(Oe,Le[4].i.r.b),(!nt||he[0]&2)&&Je!==(Je=((Xn=(kn=(ps=(Si=Le[1].conf)==null?void 0:Si.hw)==null?void 0:ps.led)==null?void 0:kn.disable)!=null?Xn:"LED dis. GPIO")+"")&&C($e,Je),(!nt||he[0]&256)&&u(Te,"max",Le[8]),he[0]&16&&Xe(Te.value)!==Le[4].i.d.d&&be(Te,Le[4].i.d.d),(!nt||he[0]&2)&&kt!==(kt=((ii=(ds=(El=Le[1].conf)==null?void 0:El.hw)==null?void 0:ds.temp)!=null?ii:"Temperature")+"")&&C(lt,kt),(!nt||he[0]&256)&&u(ot,"max",Le[8]),he[0]&16&&Xe(ot.value)!==Le[4].i.t.d&&be(ot,Le[4].i.t.d),(!nt||he[0]&2)&>!==(gt=((hs=(vs=(Ci=Le[1].conf)==null?void 0:Ci.hw)==null?void 0:vs.temp_analog)!=null?hs:"Analog temp")+"")&&C(At,gt),(!nt||he[0]&256)&&u(ye,"max",Le[8]),he[0]&16&&Xe(ye.value)!==Le[4].i.t.a&&be(ye,Le[4].i.t.a),Le[0].chip!="esp8266"?at?at.p(Le,he):(at=Z2(Le),at.c(),at.m(B,vt)):at&&(at.d(1),at=null),Le[4].i.v.p>0?rt?rt.p(Le,he):(rt=J2(Le),rt.c(),rt.m(B,null)):rt&&(rt.d(1),rt=null)},i(Le){nt||(Q(m.$$.fragment,Le),Q(I.$$.fragment,Le),nt=!0)},o(Le){ee(m.$$.fragment,Le),ee(I.$$.fragment,Le),nt=!1},d(Le){Le&&T(t),Le&&T(l),Le&&T(n),Ce(m),Ce(I),Le&&T(G),Le&&T(B),at&&at.d(),rt&&rt.d(),Tt=!1,Et(it)}}}function Z2(e){var a,m,p,v;let t,l=((v=(p=(m=(a=e[1].conf)==null?void 0:a.hw)==null?void 0:m.vcc)==null?void 0:p.title)!=null?v:"Vcc")+"",n,i,o,f,r,c;return{c(){t=_("div"),n=k(l),i=_("br"),o=b(),f=_("input"),u(f,"name","ivp"),u(f,"type","number"),u(f,"min","0"),u(f,"max",e[8]),u(f,"class","in-s tr w-full"),u(t,"class","my-1 pl-1 w-1/3")},m(d,h){E(d,t,h),s(t,n),s(t,i),s(t,o),s(t,f),be(f,e[4].i.v.p),r||(c=re(f,"input",e[97]),r=!0)},p(d,h){var g,M,A,I;h[0]&2&&l!==(l=((I=(A=(M=(g=d[1].conf)==null?void 0:g.hw)==null?void 0:M.vcc)==null?void 0:A.title)!=null?I:"Vcc")+"")&&C(n,l),h[0]&256&&u(f,"max",d[8]),h[0]&16&&Xe(f.value)!==d[4].i.v.p&&be(f,d[4].i.v.p)},d(d){d&&T(t),r=!1,c()}}}function J2(e){var h,g,M,A;let t,l=((A=(M=(g=(h=e[1].conf)==null?void 0:h.hw)==null?void 0:g.vcc)==null?void 0:M.divider)!=null?A:"Voltage divider")+"",n,i,o,f,r,c,a,m,p,v,d;return{c(){var I,O,L,q,U,P,F,z;t=_("div"),n=k(l),i=_("br"),o=b(),f=_("div"),r=_("input"),a=b(),m=_("input"),u(r,"name","ivdv"),u(r,"type","number"),u(r,"min","0"),u(r,"max","65535"),u(r,"class","in-f tr w-full"),u(r,"placeholder",c=(q=(L=(O=(I=e[1].conf)==null?void 0:I.hw)==null?void 0:O.vcc)==null?void 0:L.div_vcc)!=null?q:"VCC"),u(m,"name","ivdg"),u(m,"type","number"),u(m,"min","0"),u(m,"max","65535"),u(m,"class","in-l tr w-full"),u(m,"placeholder",p=(z=(F=(P=(U=e[1].conf)==null?void 0:U.hw)==null?void 0:P.vcc)==null?void 0:F.div_gnd)!=null?z:"GND"),u(f,"class","flex"),u(t,"class","my-1")},m(I,O){E(I,t,O),s(t,n),s(t,i),s(t,o),s(t,f),s(f,r),be(r,e[4].i.v.d.v),s(f,a),s(f,m),be(m,e[4].i.v.d.g),v||(d=[re(r,"input",e[98]),re(m,"input",e[99])],v=!0)},p(I,O){var L,q,U,P,F,z,G,B,R,K,y,H;O[0]&2&&l!==(l=((P=(U=(q=(L=I[1].conf)==null?void 0:L.hw)==null?void 0:q.vcc)==null?void 0:U.divider)!=null?P:"Voltage divider")+"")&&C(n,l),O[0]&2&&c!==(c=(B=(G=(z=(F=I[1].conf)==null?void 0:F.hw)==null?void 0:z.vcc)==null?void 0:G.div_vcc)!=null?B:"VCC")&&u(r,"placeholder",c),O[0]&16&&Xe(r.value)!==I[4].i.v.d.v&&be(r,I[4].i.v.d.v),O[0]&2&&p!==(p=(H=(y=(K=(R=I[1].conf)==null?void 0:R.hw)==null?void 0:K.vcc)==null?void 0:y.div_gnd)!=null?H:"GND")&&u(m,"placeholder",p),O[0]&16&&Xe(m.value)!==I[4].i.v.d.g&&be(m,I[4].i.v.d.g)},d(I){I&&T(t),v=!1,Et(d)}}}function $2(e){var h,g,M,A,I,O,L,q,U,P,F,z,G,B,R;let t,l=((I=(A=(M=(g=(h=e[1].conf)==null?void 0:h.hw)==null?void 0:g.led)==null?void 0:M.behaviour)==null?void 0:A.title)!=null?I:"LED behaviour")+"",n,i,o,f,r=((P=(U=(q=(L=(O=e[1].conf)==null?void 0:O.hw)==null?void 0:L.led)==null?void 0:q.behaviour)==null?void 0:U.enabled)!=null?P:"Enabled")+"",c,a,m=((R=(B=(G=(z=(F=e[1].conf)==null?void 0:F.hw)==null?void 0:z.led)==null?void 0:G.behaviour)==null?void 0:B.disabled)!=null?R:"Disabled")+"",p,v,d;return{c(){t=_("div"),n=k(l),i=b(),o=_("select"),f=_("option"),c=k(r),a=_("option"),p=k(m),f.__value=0,f.value=f.__value,a.__value=1,a.value=a.__value,u(o,"name","idb"),u(o,"class","in-s"),e[4].i.d.b===void 0&&Ct(()=>e[100].call(o)),u(t,"class","my-1 w-full")},m(K,y){E(K,t,y),s(t,n),s(t,i),s(t,o),s(o,f),s(f,c),s(o,a),s(a,p),Ze(o,e[4].i.d.b,!0),v||(d=re(o,"change",e[100]),v=!0)},p(K,y){var H,Y,X,J,$,ce,ie,oe,ae,se,x,_e,pe,V,Z;y[0]&2&&l!==(l=(($=(J=(X=(Y=(H=K[1].conf)==null?void 0:H.hw)==null?void 0:Y.led)==null?void 0:X.behaviour)==null?void 0:J.title)!=null?$:"LED behaviour")+"")&&C(n,l),y[0]&2&&r!==(r=((se=(ae=(oe=(ie=(ce=K[1].conf)==null?void 0:ce.hw)==null?void 0:ie.led)==null?void 0:oe.behaviour)==null?void 0:ae.enabled)!=null?se:"Enabled")+"")&&C(c,r),y[0]&2&&m!==(m=((Z=(V=(pe=(_e=(x=K[1].conf)==null?void 0:x.hw)==null?void 0:_e.led)==null?void 0:pe.behaviour)==null?void 0:V.disabled)!=null?Z:"Disabled")+"")&&C(p,m),y[0]&16&&Ze(o,K[4].i.d.b)},d(K){K&&T(t),v=!1,d()}}}function x2(e){var q,U,P,F,z,G,B,R;let t,l,n,i,o=((F=(P=(U=(q=e[1].conf)==null?void 0:q.hw)==null?void 0:U.vcc)==null?void 0:P.offset)!=null?F:"Vcc offset")+"",f,r,c,a,m,p,v=((R=(B=(G=(z=e[1].conf)==null?void 0:z.hw)==null?void 0:G.vcc)==null?void 0:B.multiplier)!=null?R:"Multiplier")+"",d,h,g,M,A,I,O,L=(e[0].board==2||e[0].board==100)&&ed(e);return{c(){t=_("input"),l=b(),n=_("div"),i=_("div"),f=k(o),r=_("br"),c=b(),a=_("input"),m=b(),p=_("div"),d=k(v),h=_("br"),g=b(),M=_("input"),A=b(),L&&L.c(),u(t,"type","hidden"),u(t,"name","iv"),t.value="true",u(a,"name","ivo"),u(a,"type","number"),u(a,"min","0.0"),u(a,"max","3.5"),u(a,"step","0.01"),u(a,"class","in-f tr w-full"),u(i,"class","w-1/3"),u(M,"name","ivm"),u(M,"type","number"),u(M,"min","0.1"),u(M,"max","10"),u(M,"step","0.01"),u(M,"class","in-l tr w-full"),u(p,"class","w-1/3 pr-1"),u(n,"class","my-1 flex flex-wrap")},m(K,y){E(K,t,y),E(K,l,y),E(K,n,y),s(n,i),s(i,f),s(i,r),s(i,c),s(i,a),be(a,e[4].i.v.o),s(n,m),s(n,p),s(p,d),s(p,h),s(p,g),s(p,M),be(M,e[4].i.v.m),s(n,A),L&&L.m(n,null),I||(O=[re(a,"input",e[101]),re(M,"input",e[102])],I=!0)},p(K,y){var H,Y,X,J,$,ce,ie,oe;y[0]&2&&o!==(o=((J=(X=(Y=(H=K[1].conf)==null?void 0:H.hw)==null?void 0:Y.vcc)==null?void 0:X.offset)!=null?J:"Vcc offset")+"")&&C(f,o),y[0]&16&&Xe(a.value)!==K[4].i.v.o&&be(a,K[4].i.v.o),y[0]&2&&v!==(v=((oe=(ie=(ce=($=K[1].conf)==null?void 0:$.hw)==null?void 0:ce.vcc)==null?void 0:ie.multiplier)!=null?oe:"Multiplier")+"")&&C(d,v),y[0]&16&&Xe(M.value)!==K[4].i.v.m&&be(M,K[4].i.v.m),K[0].board==2||K[0].board==100?L?L.p(K,y):(L=ed(K),L.c(),L.m(n,null)):L&&(L.d(1),L=null)},d(K){K&&T(t),K&&T(l),K&&T(n),L&&L.d(),I=!1,Et(O)}}}function ed(e){var a,m,p,v;let t,l=((v=(p=(m=(a=e[1].conf)==null?void 0:a.hw)==null?void 0:m.vcc)==null?void 0:p.boot)!=null?v:"Boot limit")+"",n,i,o,f,r,c;return{c(){t=_("div"),n=k(l),i=_("br"),o=b(),f=_("input"),u(f,"name","ivb"),u(f,"type","number"),u(f,"min","2.5"),u(f,"max","3.5"),u(f,"step","0.1"),u(f,"class","in-s tr w-full"),u(t,"class","w-1/3 pl-1")},m(d,h){E(d,t,h),s(t,n),s(t,i),s(t,o),s(t,f),be(f,e[4].i.v.b),r||(c=re(f,"input",e[103]),r=!0)},p(d,h){var g,M,A,I;h[0]&2&&l!==(l=((I=(A=(M=(g=d[1].conf)==null?void 0:g.hw)==null?void 0:M.vcc)==null?void 0:A.boot)!=null?I:"Boot limit")+"")&&C(n,l),h[0]&16&&Xe(f.value)!==d[4].i.v.b&&be(f,d[4].i.v.b)},d(d){d&&T(t),r=!1,c()}}}function td(e){var U,P,F,z,G,B;let t,l=((F=(P=(U=e[1].conf)==null?void 0:U.debug)==null?void 0:P.danger)!=null?F:"Disable when done")+"",n,i,o,f,r,c,a=((B=(G=(z=e[1].conf)==null?void 0:z.debug)==null?void 0:G.telnet)!=null?B:"Enable telnet")+"",m,p,v,d,h,g,M,A,I,O,L,q=e[4].d.t&&ld(e);return{c(){t=_("div"),n=k(l),i=b(),o=_("div"),f=_("label"),r=_("input"),c=b(),m=k(a),p=b(),q&&q.c(),v=b(),d=_("div"),h=_("select"),g=_("option"),g.textContent="Verbose",M=_("option"),M.textContent="Debug",A=_("option"),A.textContent="Info",I=_("option"),I.textContent="Warning",u(t,"class","bd-red"),u(r,"type","checkbox"),u(r,"name","dt"),r.__value="true",r.value=r.__value,u(r,"class","rounded mb-1"),u(o,"class","my-1"),g.__value=1,g.value=g.__value,M.__value=2,M.value=M.__value,A.__value=3,A.value=A.__value,I.__value=4,I.value=I.__value,u(h,"name","dl"),u(h,"class","in-s"),e[4].d.l===void 0&&Ct(()=>e[106].call(h)),u(d,"class","my-1")},m(R,K){E(R,t,K),s(t,n),E(R,i,K),E(R,o,K),s(o,f),s(f,r),r.checked=e[4].d.t,s(f,c),s(f,m),E(R,p,K),q&&q.m(R,K),E(R,v,K),E(R,d,K),s(d,h),s(h,g),s(h,M),s(h,A),s(h,I),Ze(h,e[4].d.l,!0),O||(L=[re(r,"change",e[105]),re(h,"change",e[106])],O=!0)},p(R,K){var y,H,Y,X,J,$;K[0]&2&&l!==(l=((Y=(H=(y=R[1].conf)==null?void 0:y.debug)==null?void 0:H.danger)!=null?Y:"Disable when done")+"")&&C(n,l),K[0]&16&&(r.checked=R[4].d.t),K[0]&2&&a!==(a=(($=(J=(X=R[1].conf)==null?void 0:X.debug)==null?void 0:J.telnet)!=null?$:"Enable telnet")+"")&&C(m,a),R[4].d.t?q?q.p(R,K):(q=ld(R),q.c(),q.m(v.parentNode,v)):q&&(q.d(1),q=null),K[0]&16&&Ze(h,R[4].d.l)},d(R){R&&T(t),R&&T(i),R&&T(o),R&&T(p),q&&q.d(R),R&&T(v),R&&T(d),O=!1,Et(L)}}}function ld(e){var i,o,f;let t,l=((f=(o=(i=e[1].conf)==null?void 0:i.debug)==null?void 0:o.telnet_danger)!=null?f:"Disable when done")+"",n;return{c(){t=_("div"),n=k(l),u(t,"class","bd-red")},m(r,c){E(r,t,c),s(t,n)},p(r,c){var a,m,p;c[0]&2&&l!==(l=((p=(m=(a=r[1].conf)==null?void 0:a.debug)==null?void 0:m.telnet_danger)!=null?p:"Disable when done")+"")&&C(n,l)},d(r){r&&T(t)}}}function hg(e){var Wu,Gu,Vu,Ku,Yu,Qu,Xu,Zu,Ju,$u,xu,er,tr,lr,nr,ir,sr,or,ar,fr,ur,rr,cr,mr,_r,pr,dr,vr,hr,br,gr,kr,wr,Mr,Sr,Cr,Nr,Tr,Pr,Er,Ar,Dr,qr,Or,Ir,Lr,Rr,Fr,Br,Ur,jr,Hr,yr,zr,Wr,Gr,Vr,Kr,Yr,Qr,Xr,Zr,Jr,$r,xr,e1,t1,l1,n1,i1,s1,o1,a1,f1,u1,r1,c1,m1,_1,p1,d1,v1,h1,b1,g1,k1,w1,M1,S1,C1,N1,T1,P1,E1,A1,D1,q1,O1,I1,L1,R1,F1,B1,U1,j1,H1,y1,z1,W1,G1,V1,K1,Y1,Q1,X1,Z1,J1,$1,x1,e0,t0,l0,n0,i0,s0,o0,a0,f0,u0,r0,c0,m0,_0,p0,d0,v0,h0,b0,g0,k0,w0,M0,S0,C0,N0,T0,P0,E0,A0,D0,q0,O0,I0,L0,R0,F0,B0,U0,j0,H0;let t,l,n,i,o=((Vu=(Gu=(Wu=e[1].conf)==null?void 0:Wu.general)==null?void 0:Gu.title)!=null?Vu:"General")+"",f,r,c,a,m,p,v,d,h,g,M=((Qu=(Yu=(Ku=e[1].conf)==null?void 0:Ku.general)==null?void 0:Yu.hostname)!=null?Qu:"Hostname")+"",A,I,O,L,q,U,P=((Ju=(Zu=(Xu=e[1].conf)==null?void 0:Xu.general)==null?void 0:Zu.timezone)!=null?Ju:"Time zone")+"",F,z,G,B,R,K,y,H,Y,X,J,$=((er=(xu=($u=e[1].conf)==null?void 0:$u.price)==null?void 0:xu.region)!=null?er:"Price region")+"",ce,ie,oe,ae,se,x,_e,pe,V,Z,ge,ve,S,w,N,D,j,te,le,fe,de,qe,Pe,we,Fe,Ae,ke,De,He,Oe,je,Qe,We,Je=((nr=(lr=(tr=e[1].conf)==null?void 0:tr.price)==null?void 0:lr.currency)!=null?nr:"Currency")+"",$e,tt,Te,ue,Ie,kt,lt,wt,st,ot,xe,Nt,gt=((or=(sr=(ir=e[1].conf)==null?void 0:ir.price)==null?void 0:sr.enabled)!=null?or:"Enabled")+"",At,Pt,Be,ye,It=((rr=(ur=(fr=(ar=e[1].conf)==null?void 0:ar.general)==null?void 0:fr.security)==null?void 0:ur.title)!=null?rr:"Security")+"",vt,nt,Tt,it,at,rt=((pr=(_r=(mr=(cr=e[1].conf)==null?void 0:cr.general)==null?void 0:mr.security)==null?void 0:_r.none)!=null?pr:"None")+"",jt,Lt,Ht=((br=(hr=(vr=(dr=e[1].conf)==null?void 0:dr.general)==null?void 0:vr.security)==null?void 0:hr.conf)!=null?br:"Conf")+"",yt,Me,Ve=((Mr=(wr=(kr=(gr=e[1].conf)==null?void 0:gr.general)==null?void 0:kr.security)==null?void 0:wr.all)!=null?Mr:"All")+"",Rt,Gt,zt,Dt,Kt=((Nr=(Cr=(Sr=e[1].conf)==null?void 0:Sr.general)==null?void 0:Cr.context)!=null?Nr:"Context")+"",Zt,tl,Jt,ft,Mt,Ke,ne,Ue,Re=((Er=(Pr=(Tr=e[1].conf)==null?void 0:Tr.meter)==null?void 0:Pr.title)!=null?Er:"Meter")+"",St,ut,Yt,ll,fl,ul,Sl,rl,Cl,nl,ml=((Or=(qr=(Dr=(Ar=e[1].conf)==null?void 0:Ar.meter)==null?void 0:Dr.comm)==null?void 0:qr.title)!=null?Or:"Communication")+"",dl,Nl,Tl,Qt,Ee,qt=((Fr=(Rr=(Lr=(Ir=e[1].conf)==null?void 0:Ir.meter)==null?void 0:Lr.comm)==null?void 0:Rr.passive)!=null?Fr:"Passive")+"",En,Zl,vn=((Hr=(jr=(Ur=(Br=e[1].conf)==null?void 0:Br.meter)==null?void 0:Ur.comm)==null?void 0:jr.pulse)!=null?Hr:"Pulse")+"",An,Le,he=((Gr=(Wr=(zr=(yr=e[1].conf)==null?void 0:yr.meter)==null?void 0:zr.comm)==null?void 0:Wr.kmp)!=null?Gr:"KMP")+"",et,zn,Dn,Wl,hn=((Kr=(Vr=e[1].common)==null?void 0:Vr.voltage)!=null?Kr:"Voltage")+"",qn,Wn,Gn,_l,Jl,$l,Vn,xl,Gl,bn=((Xr=(Qr=(Yr=e[1].conf)==null?void 0:Yr.meter)==null?void 0:Qr.fuse)!=null?Xr:"Main fuse")+"",On,Kn,Yn,en,cl,Qn,ti,us,gn,li=(($r=(Jr=(Zr=e[1].conf)==null?void 0:Zr.meter)==null?void 0:Jr.prod)!=null?$r:"Production")+"",Mi,rs,cs,In,Pl,ms,ni,_s,Si,ps,kn,Xn,El,ds,ii=((t1=(e1=(xr=e[1].conf)==null?void 0:xr.meter)==null?void 0:e1.encrypted)!=null?t1:"Encrypted")+"",Ci,vs,hs,Xo,bs,nn,Df,ys=((s1=(i1=(n1=(l1=e[1].conf)==null?void 0:l1.meter)==null?void 0:n1.multipliers)==null?void 0:i1.title)!=null?s1:"Multipliers")+"",Zo,qf,Of,Vl,zs,Ws=((f1=(a1=(o1=e[1].conf)==null?void 0:o1.connection)==null?void 0:a1.title)!=null?f1:"Connection")+"",Jo,If,Ni,Lf,Rf,gs,Ff,Gs,tn,Ti,Vs=((c1=(r1=(u1=e[1].conf)==null?void 0:u1.connection)==null?void 0:r1.wifi)!=null?c1:"WiFi")+"",$o,Pi,Ks=((p1=(_1=(m1=e[1].conf)==null?void 0:m1.connection)==null?void 0:_1.ap)!=null?p1:"AP")+"",xo,Bf,Uf,il,Ys,Qs=((h1=(v1=(d1=e[1].conf)==null?void 0:d1.network)==null?void 0:v1.title)!=null?h1:"Network")+"",ea,jf,Ei,Hf,yf,si,Xs=((k1=(g1=(b1=e[1].conf)==null?void 0:b1.network)==null?void 0:g1.ip)!=null?k1:"IP")+"",ta,zf,Wf,Zn,wn,Ai,Zs=((S1=(M1=(w1=e[1].conf)==null?void 0:w1.network)==null?void 0:M1.dhcp)!=null?S1:"DHCP")+"",la,Di,Js=((T1=(N1=(C1=e[1].conf)==null?void 0:C1.network)==null?void 0:N1.static)!=null?T1:"Static")+"",na,Gf,Kl,$s,xs,Vf,Yl,qi,eo,to,Kf,ia,lo,no,sn,Yf,Qf,io,ks,on,Xf,so=((A1=(E1=(P1=e[1].conf)==null?void 0:P1.network)==null?void 0:E1.tick_mdns)!=null?A1:"mDNS")+"",sa,Zf,ws,Jf,Ln,oo=((O1=(q1=(D1=e[1].conf)==null?void 0:D1.network)==null?void 0:q1.ntp)!=null?O1:"NTP")+"",oa,$f,Oi,an,xf,ao=((R1=(L1=(I1=e[1].conf)==null?void 0:I1.network)==null?void 0:L1.tick_ntp_dhcp)!=null?R1:"from DHCP")+"",aa,eu,tu,fo,Rn,lu,$t,uo,ro=((U1=(B1=(F1=e[1].conf)==null?void 0:F1.mqtt)==null?void 0:B1.title)!=null?U1:"MQTT")+"",fa,nu,Ii,iu,su,Ms,ou,fn,co=((y1=(H1=(j1=e[1].conf)==null?void 0:j1.mqtt)==null?void 0:H1.server)!=null?y1:"Server")+"",ua,au,ra,fu,uu,Li,Fn,ru,un,cu,ca,oi,mo=((G1=(W1=(z1=e[1].conf)==null?void 0:z1.mqtt)==null?void 0:W1.user)!=null?G1:"Username")+"",ma,mu,_u,Bn,pu,ai,_o=((Y1=(K1=(V1=e[1].conf)==null?void 0:V1.mqtt)==null?void 0:K1.pass)!=null?Y1:"Password")+"",_a,du,vu,Un,hu,Ri,Fi,po=((Z1=(X1=(Q1=e[1].conf)==null?void 0:Q1.mqtt)==null?void 0:X1.id)!=null?Z1:"Client ID")+"",pa,bu,gu,jn,ku,Bi,vo=((x1=($1=(J1=e[1].conf)==null?void 0:J1.mqtt)==null?void 0:$1.payload)!=null?x1:"Payload")+"",da,wu,Mu,pl,Ui,ji,Hi,ho=((n0=(l0=(t0=(e0=e[1].conf)==null?void 0:e0.mqtt)==null?void 0:t0.domoticz)==null?void 0:l0.title)!=null?n0:"Domoticz")+"",va,yi,bo=((a0=(o0=(s0=(i0=e[1].conf)==null?void 0:i0.mqtt)==null?void 0:s0.ha)==null?void 0:o0.title)!=null?a0:"Home-Assistant")+"",ha,zi,Wi,Gi,Vi,Su,fi,go=((r0=(u0=(f0=e[1].conf)==null?void 0:f0.mqtt)==null?void 0:u0.publish)!=null?r0:"Publish topic")+"",ba,Cu,Nu,Hn,Tu,ga,ka,wa,Ma=e[4].p.r.startsWith("NO")||e[4].p.r.startsWith("10YNO")||e[4].p.r.startsWith("10Y1001A1001A4"),Sa,Mn,ko,wo=((_0=(m0=(c0=e[1].conf)==null?void 0:c0.ui)==null?void 0:m0.title)!=null?_0:"User interface")+"",Ca,Pu,Ki,Eu,Au,Ss,Du,ui,Na,Yi,Mo=((v0=(d0=(p0=e[1].conf)==null?void 0:p0.ui)==null?void 0:d0.lang)!=null?v0:"Language")+"",Ta,qu,rn,Ou,Pa,Ql,So,Co=((g0=(b0=(h0=e[1].conf)==null?void 0:h0.debug)==null?void 0:b0.title)!=null?g0:"Debugging")+"",Ea,Iu,Qi,Lu,Cs,Ru,No,Ns,cn,Fu,To=((M0=(w0=(k0=e[1].conf)==null?void 0:k0.debug)==null?void 0:w0.enable)!=null?M0:"Enable debugging")+"",Aa,Bu,Uu,Jn,Da,Xi,Po=((C0=(S0=e[1].conf)==null?void 0:S0.btn_reset)!=null?C0:"Factory reset")+"",qa,ju,Eo,Zi,Ao=((T0=(N0=e[1].btn)==null?void 0:N0.reboot)!=null?T0:"Reboot")+"",Oa,Hu,Do,Ts,qo=((E0=(P0=e[1].btn)==null?void 0:P0.save)!=null?E0:"Save")+"",Ia,La,ri,Ra,ci,Fa,mi,Ba,_i,Ye,Ua,yu;R=new V4({});let Xl=!e[4].p.t&&E2(),Vv=["NOK","SEK","DKK","EUR","CHF"],Ps=[];for(let W=0;W<5;W+=1)Ps[W]=eg(x4(e,Vv,W));lt=new ln({props:{to:"/priceconfig",class:"text-blue-600 hover:text-blue-800",$$slots:{default:[tg]},$$scope:{ctx:e}}});let Al=e[4].p.e&&e[0].chip!="esp8266"&&A2(e),Dl=e[4].g.s>0&&D2(e);function zu(W,me){return W[4].m.a===2?ng:lg}let Oo=zu(e),Sn=Oo(e),ql=e[4].m.e.e&&q2(e),Ol=e[4].m.e.e&&O2(e),Il=e[4].m.m.e&&I2(e),Ll=e[0].if&&e[0].if.eth&&L2(e),Rl=(e[4].n.c==1||e[4].n.c==2)&&R2(e);qi=new Wv({});let Fl=e[4].n.m=="static"&&F2(e),Bl=e[0].chip!="esp8266"&&B2(e),sl=e[4].q.s.e&&U2(e),Ul=e[4].q.m==3&&j2(e),jl=e[4].q.m==4&&H2(e),ol=e[4].c.es!=null&&y2(e),Hl=Ma&&G2(e),Ji=e[9],vl=[];for(let W=0;W20||e[0].chip=="esp8266"||e[4].i.d.d>0)&&Q2(e),yl=e[4].d.s&&td(e);return ri=new kl({props:{active:e[2],message:(q0=(D0=(A0=e[1].conf)==null?void 0:A0.mask)==null?void 0:D0.loading)!=null?q0:"Loading"}}),ci=new kl({props:{active:e[3],message:(L0=(I0=(O0=e[1].conf)==null?void 0:O0.mask)==null?void 0:I0.saving)!=null?L0:"Saving"}}),mi=new kl({props:{active:e[6],message:(B0=(F0=(R0=e[1].conf)==null?void 0:R0.mask)==null?void 0:F0.reset)!=null?B0:"Factory reset"}}),_i=new kl({props:{active:e[7],message:(H0=(j0=(U0=e[1].conf)==null?void 0:U0.mask)==null?void 0:j0.reset_done)!=null?H0:"Done"}}),{c(){var W,me,el;t=_("form"),l=_("div"),n=_("div"),i=_("strong"),f=k(o),r=b(),c=_("a"),a=k("\u24D8"),m=b(),p=_("input"),v=b(),d=_("div"),h=_("div"),g=_("div"),A=k(M),I=_("br"),O=b(),L=_("input"),q=b(),U=_("div"),F=k(P),z=_("br"),G=b(),B=_("select"),Ne(R.$$.fragment),K=b(),y=_("input"),H=b(),Y=_("div"),X=_("div"),J=_("div"),ce=k($),ie=_("br"),oe=b(),ae=_("select"),se=_("optgroup"),Xl&&Xl.c(),x=_("option"),x.textContent="NO1",_e=_("option"),_e.textContent="NO2",pe=_("option"),pe.textContent="NO3",V=_("option"),V.textContent="NO4",Z=_("option"),Z.textContent="NO5",ge=_("optgroup"),ve=_("option"),ve.textContent="SE1",S=_("option"),S.textContent="SE2",w=_("option"),w.textContent="SE3",N=_("option"),N.textContent="SE4",D=_("optgroup"),j=_("option"),j.textContent="DK1",te=_("option"),te.textContent="DK2",le=_("option"),le.textContent="Austria",fe=_("option"),fe.textContent="Belgium",de=_("option"),de.textContent="Czech Republic",qe=_("option"),qe.textContent="Estonia",Pe=_("option"),Pe.textContent="Finland",we=_("option"),we.textContent="France",Fe=_("option"),Fe.textContent="Germany",Ae=_("option"),Ae.textContent="Great Britain",ke=_("option"),ke.textContent="Latvia",De=_("option"),De.textContent="Lithuania",He=_("option"),He.textContent="Netherland",Oe=_("option"),Oe.textContent="Poland",je=_("option"),je.textContent="Switzerland",Qe=b(),We=_("div"),$e=k(Je),tt=_("br"),Te=b(),ue=_("select");for(let bl=0;bl<5;bl+=1)Ps[bl].c();Ie=b(),kt=_("div"),Ne(lt.$$.fragment),wt=b(),st=_("div"),ot=_("label"),xe=_("input"),Nt=b(),At=k(gt),Pt=b(),Al&&Al.c(),Be=b(),ye=_("div"),vt=k(It),nt=_("br"),Tt=b(),it=_("select"),at=_("option"),jt=k(rt),Lt=_("option"),yt=k(Ht),Me=_("option"),Rt=k(Ve),Gt=b(),Dl&&Dl.c(),zt=b(),Dt=_("div"),Zt=k(Kt),tl=_("br"),Jt=b(),ft=_("input"),Ke=b(),ne=_("div"),Ue=_("strong"),St=k(Re),ut=b(),Yt=_("a"),ll=k("\u24D8"),fl=b(),ul=_("input"),Sl=b(),rl=_("input"),Cl=b(),nl=_("div"),dl=k(ml),Nl=_("br"),Tl=b(),Qt=_("select"),Ee=_("option"),En=k(qt),Zl=_("option"),An=k(vn),Le=_("option"),et=k(he),zn=b(),Sn.c(),Dn=b(),Wl=_("div"),qn=k(hn),Wn=_("br"),Gn=b(),_l=_("select"),Jl=_("option"),Jl.textContent="400V (TN)",$l=_("option"),$l.textContent="230V (IT/TT)",Vn=b(),xl=_("div"),Gl=_("div"),On=k(bn),Kn=_("br"),Yn=b(),en=_("label"),cl=_("input"),Qn=b(),ti=_("span"),ti.textContent="A",us=b(),gn=_("div"),Mi=k(li),rs=_("br"),cs=b(),In=_("label"),Pl=_("input"),ms=b(),ni=_("span"),ni.textContent="kWp",_s=b(),Si=_("div"),ps=b(),kn=_("div"),Xn=_("label"),El=_("input"),ds=b(),Ci=k(ii),vs=b(),ql&&ql.c(),hs=b(),Ol&&Ol.c(),Xo=b(),bs=_("label"),nn=_("input"),Df=b(),Zo=k(ys),qf=b(),Il&&Il.c(),Of=b(),Vl=_("div"),zs=_("strong"),Jo=k(Ws),If=b(),Ni=_("a"),Lf=k("\u24D8"),Rf=b(),gs=_("input"),Ff=b(),Gs=_("div"),tn=_("select"),Ti=_("option"),$o=k(Vs),Pi=_("option"),xo=k(Ks),Ll&&Ll.c(),Bf=b(),Rl&&Rl.c(),Uf=b(),il=_("div"),Ys=_("strong"),ea=k(Qs),jf=b(),Ei=_("a"),Hf=k("\u24D8"),yf=b(),si=_("div"),ta=k(Xs),zf=_("br"),Wf=b(),Zn=_("div"),wn=_("select"),Ai=_("option"),la=k(Zs),Di=_("option"),na=k(Js),Gf=b(),Kl=_("input"),Vf=b(),Yl=_("select"),Ne(qi.$$.fragment),Kf=b(),Fl&&Fl.c(),ia=b(),lo=_("div"),no=_("label"),sn=_("input"),Yf=k(" IPv6"),Qf=b(),io=_("div"),ks=_("label"),on=_("input"),Xf=b(),sa=k(so),Zf=b(),ws=_("input"),Jf=b(),Ln=_("div"),oa=k(oo),$f=b(),Oi=_("label"),an=_("input"),xf=b(),aa=k(ao),eu=_("br"),tu=b(),fo=_("div"),Rn=_("input"),lu=b(),$t=_("div"),uo=_("strong"),fa=k(ro),nu=b(),Ii=_("a"),iu=k("\u24D8"),su=b(),Ms=_("input"),ou=b(),fn=_("div"),ua=k(co),au=b(),Bl&&Bl.c(),ra=b(),fu=_("br"),uu=b(),Li=_("div"),Fn=_("input"),ru=b(),un=_("input"),cu=b(),sl&&sl.c(),ca=b(),oi=_("div"),ma=k(mo),mu=_("br"),_u=b(),Bn=_("input"),pu=b(),ai=_("div"),_a=k(_o),du=_("br"),vu=b(),Un=_("input"),hu=b(),Ri=_("div"),Fi=_("div"),pa=k(po),bu=_("br"),gu=b(),jn=_("input"),ku=b(),Bi=_("div"),da=k(vo),wu=_("br"),Mu=b(),pl=_("select"),Ui=_("option"),Ui.textContent="Raw (minimal)",ji=_("option"),ji.textContent="Raw (full)",Hi=_("option"),va=k(ho),yi=_("option"),ha=k(bo),zi=_("option"),zi.textContent="JSON (classic)",Wi=_("option"),Wi.textContent="JSON (multi topic)",Gi=_("option"),Gi.textContent="JSON (flat)",Vi=_("option"),Vi.textContent="HEX dump",Su=b(),fi=_("div"),ba=k(go),Cu=_("br"),Nu=b(),Hn=_("input"),Tu=b(),Ul&&Ul.c(),ga=b(),jl&&jl.c(),ka=b(),ol&&ol.c(),wa=b(),Hl&&Hl.c(),Sa=b(),Mn=_("div"),ko=_("strong"),Ca=k(wo),Pu=b(),Ki=_("a"),Eu=k("\u24D8"),Au=b(),Ss=_("input"),Du=b(),ui=_("div");for(let bl=0;ble[20].call(B)),u(h,"class","flex"),u(d,"class","my-1"),u(y,"type","hidden"),u(y,"name","p"),y.value="true",x.__value="10YNO-1--------2",x.value=x.__value,_e.__value="10YNO-2--------T",_e.value=_e.__value,pe.__value="10YNO-3--------J",pe.value=pe.__value,V.__value="10YNO-4--------9",V.value=V.__value,Z.__value="10Y1001A1001A48H",Z.value=Z.__value,u(se,"label","Norway"),ve.__value="10Y1001A1001A44P",ve.value=ve.__value,S.__value="10Y1001A1001A45N",S.value=S.__value,w.__value="10Y1001A1001A46L",w.value=w.__value,N.__value="10Y1001A1001A47J",N.value=N.__value,u(ge,"label","Sweden"),j.__value="10YDK-1--------W",j.value=j.__value,te.__value="10YDK-2--------M",te.value=te.__value,u(D,"label","Denmark"),le.__value="10YAT-APG------L",le.value=le.__value,fe.__value="10YBE----------2",fe.value=fe.__value,de.__value="10YCZ-CEPS-----N",de.value=de.__value,qe.__value="10Y1001A1001A39I",qe.value=qe.__value,Pe.__value="10YFI-1--------U",Pe.value=Pe.__value,we.__value="10YFR-RTE------C",we.value=we.__value,Fe.__value="10Y1001A1001A83F",Fe.value=Fe.__value,Ae.__value="10YGB----------A",Ae.value=Ae.__value,ke.__value="10YLV-1001A00074",ke.value=ke.__value,De.__value="10YLT-1001A0008Q",De.value=De.__value,He.__value="10YNL----------L",He.value=He.__value,Oe.__value="10YPL-AREA-----S",Oe.value=Oe.__value,je.__value="10YCH-SWISSGRIDZ",je.value=je.__value,u(ae,"name","pr"),u(ae,"class","in-f w-full"),e[4].p.r===void 0&&Ct(()=>e[21].call(ae)),u(J,"class","w-full"),u(ue,"name","pc"),u(ue,"class","in-l"),e[4].p.c===void 0&&Ct(()=>e[22].call(ue)),u(X,"class","flex"),u(Y,"class","my-1"),u(kt,"class","my-1"),u(xe,"type","checkbox"),u(xe,"name","pe"),xe.__value="true",xe.value=xe.__value,u(xe,"class","rounded mb-1"),u(st,"class","my-1"),at.__value=0,at.value=at.__value,Lt.__value=1,Lt.value=Lt.__value,Me.__value=2,Me.value=Me.__value,u(it,"name","gs"),u(it,"class","in-s"),e[4].g.s===void 0&&Ct(()=>e[25].call(it)),u(ye,"class","my-1"),u(ft,"name","gc"),u(ft,"type","text"),u(ft,"pattern","[A-Za-z0-9]+"),u(ft,"placeholder",Mt=(el=(me=(W=e[1].conf)==null?void 0:W.general)==null?void 0:me.context_placeholder)!=null?el:"/"),u(ft,"class","in-s"),u(ft,"maxlength","36"),u(Dt,"class","my-1"),u(n,"class","cnt"),u(Ue,"class","text-sm"),u(Yt,"href",zl("Meter-configuration")),u(Yt,"target","_blank"),u(Yt,"class","float-right"),u(ul,"type","hidden"),u(ul,"name","m"),ul.value="true",u(rl,"type","hidden"),u(rl,"name","mo"),rl.value="1",Ee.__value=0,Ee.value=Ee.__value,Zl.__value=2,Zl.value=Zl.__value,Le.__value=9,Le.value=Le.__value,u(Qt,"name","ma"),u(Qt,"class","in-s"),e[4].m.a===void 0&&Ct(()=>e[29].call(Qt)),u(nl,"class","my-1"),Jl.__value=2,Jl.value=Jl.__value,$l.__value=1,$l.value=$l.__value,u(_l,"name","md"),u(_l,"class","in-s"),e[4].m.d===void 0&&Ct(()=>e[35].call(_l)),u(Wl,"class","my-1"),u(cl,"name","mf"),u(cl,"type","number"),u(cl,"min","5"),u(cl,"max","65535"),u(cl,"class","in-f tr w-full"),u(ti,"class","in-post"),u(en,"class","flex"),u(Gl,"class","mx-1"),u(Pl,"name","mr"),u(Pl,"type","number"),u(Pl,"min","0"),u(Pl,"max","65535"),u(Pl,"class","in-f tr w-full"),u(ni,"class","in-post"),u(In,"class","flex"),u(gn,"class","mx-1"),u(xl,"class","my-1 flex"),u(Si,"class","my-1"),u(El,"type","checkbox"),u(El,"name","me"),El.__value="true",El.value=El.__value,u(El,"class","rounded mb-1"),u(kn,"class","my-1"),u(nn,"type","checkbox"),u(nn,"name","mm"),nn.__value="true",nn.value=nn.__value,u(nn,"class","rounded mb-1"),u(ne,"class","cnt"),u(zs,"class","text-sm"),u(Ni,"href",zl("WiFi-configuration")),u(Ni,"target","_blank"),u(Ni,"class","float-right"),u(gs,"type","hidden"),u(gs,"name","w"),gs.value="true",Ti.__value=1,Ti.value=Ti.__value,Pi.__value=2,Pi.value=Pi.__value,u(tn,"name","nc"),u(tn,"class","in-s"),e[4].n.c===void 0&&Ct(()=>e[46].call(tn)),u(Gs,"class","my-1"),u(Vl,"class","cnt"),u(Ys,"class","text-sm"),u(Ei,"href",zl("Network-configuration")),u(Ei,"target","_blank"),u(Ei,"class","float-right"),Ai.__value="dhcp",Ai.value=Ai.__value,Di.__value="static",Di.value=Di.__value,u(wn,"name","nm"),u(wn,"class","in-f"),e[4].n.m===void 0&&Ct(()=>e[52].call(wn)),u(Kl,"name","ni"),u(Kl,"type","text"),u(Kl,"class","in-m w-full"),Kl.disabled=$s=e[4].n.m=="dhcp",Kl.required=xs=e[4].n.m=="static",u(Yl,"name","ns"),u(Yl,"class","in-l"),Yl.disabled=eo=e[4].n.m=="dhcp",Yl.required=to=e[4].n.m=="static",e[4].n.s===void 0&&Ct(()=>e[54].call(Yl)),u(Zn,"class","flex"),u(si,"class","my-1"),u(sn,"name","nx"),sn.__value="true",sn.value=sn.__value,u(sn,"type","checkbox"),u(sn,"class","rounded mb-1"),u(lo,"class","my-1"),u(on,"name","nd"),on.__value="true",on.value=on.__value,u(on,"type","checkbox"),u(on,"class","rounded mb-1"),u(io,"class","my-1"),u(ws,"type","hidden"),u(ws,"name","ntp"),ws.value="true",u(an,"name","ntpd"),an.__value="true",an.value=an.__value,u(an,"type","checkbox"),u(an,"class","rounded mb-1"),u(Oi,"class","ml-4"),u(Rn,"name","ntph"),u(Rn,"type","text"),u(Rn,"class","in-s"),u(fo,"class","flex"),u(Ln,"class","my-1"),u(il,"class","cnt"),u(uo,"class","text-sm"),u(Ii,"href",zl("MQTT-configuration")),u(Ii,"target","_blank"),u(Ii,"class","float-right"),u(Ms,"type","hidden"),u(Ms,"name","q"),Ms.value="true",u(Fn,"name","qh"),u(Fn,"type","text"),u(Fn,"class","in-f w-2/3"),u(un,"name","qp"),u(un,"type","number"),u(un,"min","1024"),u(un,"max","65535"),u(un,"class","in-l tr w-1/3"),u(Li,"class","flex"),u(fn,"class","my-1"),u(Bn,"name","qu"),u(Bn,"type","text"),u(Bn,"class","in-s"),u(oi,"class","my-1"),u(Un,"name","qa"),u(Un,"type","password"),u(Un,"class","in-s"),u(ai,"class","my-1"),u(jn,"name","qc"),u(jn,"type","text"),u(jn,"class","in-f w-full"),Ui.__value=1,Ui.value=Ui.__value,ji.__value=2,ji.value=ji.__value,Hi.__value=3,Hi.value=Hi.__value,yi.__value=4,yi.value=yi.__value,zi.__value=0,zi.value=zi.__value,Wi.__value=5,Wi.value=Wi.__value,Gi.__value=6,Gi.value=Gi.__value,Vi.__value=255,Vi.value=Vi.__value,u(pl,"name","qm"),u(pl,"class","in-l"),e[4].q.m===void 0&&Ct(()=>e[68].call(pl)),u(Ri,"class","my-1 flex"),u(Hn,"name","qb"),u(Hn,"type","text"),u(Hn,"class","in-s"),u(fi,"class","my-1"),u($t,"class","cnt"),u(ko,"class","text-sm"),u(Ki,"href",zl("User-interface")),u(Ki,"target","_blank"),u(Ki,"class","float-right"),u(Ss,"type","hidden"),u(Ss,"name","u"),Ss.value="true",u(rn,"name","ulang"),u(rn,"class","in-s"),e[4].u.lang===void 0&&Ct(()=>e[83].call(rn)),u(Yi,"class","w-1/2"),u(ui,"class","flex flex-wrap"),u(Mn,"class","cnt"),u(So,"class","text-sm"),u(Qi,"href","https://amsleser.no/blog/post/24-telnet-debug"),u(Qi,"target","_blank"),u(Qi,"class","float-right"),u(Cs,"type","hidden"),u(Cs,"name","d"),Cs.value="true",u(cn,"type","checkbox"),u(cn,"name","ds"),cn.__value="true",cn.value=cn.__value,u(cn,"class","rounded mb-1"),u(No,"class","mt-3"),u(Ql,"class","cnt"),u(l,"class","grid xl:grid-cols-4 lg:grid-cols-2 md:grid-cols-2"),u(Xi,"type","button"),u(Xi,"class","btn-red"),u(Zi,"type","button"),u(Zi,"class","btn-yellow"),u(Eo,"class","text-center"),u(Ts,"type","submit"),u(Ts,"class","btn-pri"),u(Do,"class","text-right"),u(Jn,"class","grid grid-cols-3 mt-3"),u(t,"autocomplete","off")},m(W,me){E(W,t,me),s(t,l),s(l,n),s(n,i),s(i,f),s(n,r),s(n,c),s(c,a),s(n,m),s(n,p),s(n,v),s(n,d),s(d,h),s(h,g),s(g,A),s(g,I),s(g,O),s(g,L),be(L,e[4].g.h),s(h,q),s(h,U),s(U,F),s(U,z),s(U,G),s(U,B),Se(R,B,null),Ze(B,e[4].g.t,!0),s(n,K),s(n,y),s(n,H),s(n,Y),s(Y,X),s(X,J),s(J,ce),s(J,ie),s(J,oe),s(J,ae),s(ae,se),Xl&&Xl.m(se,null),s(se,x),s(se,_e),s(se,pe),s(se,V),s(se,Z),s(ae,ge),s(ge,ve),s(ge,S),s(ge,w),s(ge,N),s(ae,D),s(D,j),s(D,te),s(ae,le),s(ae,fe),s(ae,de),s(ae,qe),s(ae,Pe),s(ae,we),s(ae,Fe),s(ae,Ae),s(ae,ke),s(ae,De),s(ae,He),s(ae,Oe),s(ae,je),Ze(ae,e[4].p.r,!0),s(X,Qe),s(X,We),s(We,$e),s(We,tt),s(We,Te),s(We,ue);for(let el=0;el<5;el+=1)Ps[el]&&Ps[el].m(ue,null);Ze(ue,e[4].p.c,!0),s(n,Ie),s(n,kt),Se(lt,kt,null),s(n,wt),s(n,st),s(st,ot),s(ot,xe),xe.checked=e[4].p.e,s(ot,Nt),s(ot,At),s(st,Pt),Al&&Al.m(st,null),s(n,Be),s(n,ye),s(ye,vt),s(ye,nt),s(ye,Tt),s(ye,it),s(it,at),s(at,jt),s(it,Lt),s(Lt,yt),s(it,Me),s(Me,Rt),Ze(it,e[4].g.s,!0),s(n,Gt),Dl&&Dl.m(n,null),s(n,zt),s(n,Dt),s(Dt,Zt),s(Dt,tl),s(Dt,Jt),s(Dt,ft),be(ft,e[4].g.c),s(l,Ke),s(l,ne),s(ne,Ue),s(Ue,St),s(ne,ut),s(ne,Yt),s(Yt,ll),s(ne,fl),s(ne,ul),s(ne,Sl),s(ne,rl),s(ne,Cl),s(ne,nl),s(nl,dl),s(nl,Nl),s(nl,Tl),s(nl,Qt),s(Qt,Ee),s(Ee,En),s(Qt,Zl),s(Zl,An),s(Qt,Le),s(Le,et),Ze(Qt,e[4].m.a,!0),s(ne,zn),Sn.m(ne,null),s(ne,Dn),s(ne,Wl),s(Wl,qn),s(Wl,Wn),s(Wl,Gn),s(Wl,_l),s(_l,Jl),s(_l,$l),Ze(_l,e[4].m.d,!0),s(ne,Vn),s(ne,xl),s(xl,Gl),s(Gl,On),s(Gl,Kn),s(Gl,Yn),s(Gl,en),s(en,cl),be(cl,e[4].m.f),s(en,Qn),s(en,ti),s(xl,us),s(xl,gn),s(gn,Mi),s(gn,rs),s(gn,cs),s(gn,In),s(In,Pl),be(Pl,e[4].m.r),s(In,ms),s(In,ni),s(ne,_s),s(ne,Si),s(ne,ps),s(ne,kn),s(kn,Xn),s(Xn,El),El.checked=e[4].m.e.e,s(Xn,ds),s(Xn,Ci),s(kn,vs),ql&&ql.m(kn,null),s(ne,hs),Ol&&Ol.m(ne,null),s(ne,Xo),s(ne,bs),s(bs,nn),nn.checked=e[4].m.m.e,s(bs,Df),s(bs,Zo),s(ne,qf),Il&&Il.m(ne,null),s(l,Of),s(l,Vl),s(Vl,zs),s(zs,Jo),s(Vl,If),s(Vl,Ni),s(Ni,Lf),s(Vl,Rf),s(Vl,gs),s(Vl,Ff),s(Vl,Gs),s(Gs,tn),s(tn,Ti),s(Ti,$o),s(tn,Pi),s(Pi,xo),Ll&&Ll.m(tn,null),Ze(tn,e[4].n.c,!0),s(Vl,Bf),Rl&&Rl.m(Vl,null),s(l,Uf),s(l,il),s(il,Ys),s(Ys,ea),s(il,jf),s(il,Ei),s(Ei,Hf),s(il,yf),s(il,si),s(si,ta),s(si,zf),s(si,Wf),s(si,Zn),s(Zn,wn),s(wn,Ai),s(Ai,la),s(wn,Di),s(Di,na),Ze(wn,e[4].n.m,!0),s(Zn,Gf),s(Zn,Kl),be(Kl,e[4].n.i),s(Zn,Vf),s(Zn,Yl),Se(qi,Yl,null),Ze(Yl,e[4].n.s,!0),s(il,Kf),Fl&&Fl.m(il,null),s(il,ia),s(il,lo),s(lo,no),s(no,sn),sn.checked=e[4].n.x,s(no,Yf),s(il,Qf),s(il,io),s(io,ks),s(ks,on),on.checked=e[4].n.d,s(ks,Xf),s(ks,sa),s(il,Zf),s(il,ws),s(il,Jf),s(il,Ln),s(Ln,oa),s(Ln,$f),s(Ln,Oi),s(Oi,an),an.checked=e[4].n.h,s(Oi,xf),s(Oi,aa),s(Ln,eu),s(Ln,tu),s(Ln,fo),s(fo,Rn),be(Rn,e[4].n.n1),s(l,lu),s(l,$t),s($t,uo),s(uo,fa),s($t,nu),s($t,Ii),s(Ii,iu),s($t,su),s($t,Ms),s($t,ou),s($t,fn),s(fn,ua),s(fn,au),Bl&&Bl.m(fn,null),s(fn,ra),s(fn,fu),s(fn,uu),s(fn,Li),s(Li,Fn),be(Fn,e[4].q.h),s(Li,ru),s(Li,un),be(un,e[4].q.p),s($t,cu),sl&&sl.m($t,null),s($t,ca),s($t,oi),s(oi,ma),s(oi,mu),s(oi,_u),s(oi,Bn),be(Bn,e[4].q.u),s($t,pu),s($t,ai),s(ai,_a),s(ai,du),s(ai,vu),s(ai,Un),be(Un,e[4].q.a),s($t,hu),s($t,Ri),s(Ri,Fi),s(Fi,pa),s(Fi,bu),s(Fi,gu),s(Fi,jn),be(jn,e[4].q.c),s(Ri,ku),s(Ri,Bi),s(Bi,da),s(Bi,wu),s(Bi,Mu),s(Bi,pl),s(pl,Ui),s(pl,ji),s(pl,Hi),s(Hi,va),s(pl,yi),s(yi,ha),s(pl,zi),s(pl,Wi),s(pl,Gi),s(pl,Vi),Ze(pl,e[4].q.m,!0),s($t,Su),s($t,fi),s(fi,ba),s(fi,Cu),s(fi,Nu),s(fi,Hn),be(Hn,e[4].q.b),s(l,Tu),Ul&&Ul.m(l,null),s(l,ga),jl&&jl.m(l,null),s(l,ka),ol&&ol.m(l,null),s(l,wa),Hl&&Hl.m(l,null),s(l,Sa),s(l,Mn),s(Mn,ko),s(ko,Ca),s(Mn,Pu),s(Mn,Ki),s(Ki,Eu),s(Mn,Au),s(Mn,Ss),s(Mn,Du),s(Mn,ui);for(let el=0;el0?Dl?Dl.p(W,me):(Dl=D2(W),Dl.c(),Dl.m(n,zt)):Dl&&(Dl.d(1),Dl=null),(!Ye||me[0]&2)&&Kt!==(Kt=((Sc=(Mc=(wc=W[1].conf)==null?void 0:wc.general)==null?void 0:Mc.context)!=null?Sc:"Context")+"")&&C(Zt,Kt),(!Ye||me[0]&2&&Mt!==(Mt=(Tc=(Nc=(Cc=W[1].conf)==null?void 0:Cc.general)==null?void 0:Nc.context_placeholder)!=null?Tc:"/"))&&u(ft,"placeholder",Mt),me[0]&16&&ft.value!==W[4].g.c&&be(ft,W[4].g.c),(!Ye||me[0]&2)&&Re!==(Re=((Ac=(Ec=(Pc=W[1].conf)==null?void 0:Pc.meter)==null?void 0:Ec.title)!=null?Ac:"Meter")+"")&&C(St,Re),(!Ye||me[0]&2)&&ml!==(ml=((Ic=(Oc=(qc=(Dc=W[1].conf)==null?void 0:Dc.meter)==null?void 0:qc.comm)==null?void 0:Oc.title)!=null?Ic:"Communication")+"")&&C(dl,ml),(!Ye||me[0]&2)&&qt!==(qt=((Bc=(Fc=(Rc=(Lc=W[1].conf)==null?void 0:Lc.meter)==null?void 0:Rc.comm)==null?void 0:Fc.passive)!=null?Bc:"Passive")+"")&&C(En,qt),(!Ye||me[0]&2)&&vn!==(vn=((yc=(Hc=(jc=(Uc=W[1].conf)==null?void 0:Uc.meter)==null?void 0:jc.comm)==null?void 0:Hc.pulse)!=null?yc:"Pulse")+"")&&C(An,vn),(!Ye||me[0]&2)&&he!==(he=((Vc=(Gc=(Wc=(zc=W[1].conf)==null?void 0:zc.meter)==null?void 0:Wc.comm)==null?void 0:Gc.kmp)!=null?Vc:"KMP")+"")&&C(et,he),me[0]&16&&Ze(Qt,W[4].m.a),Oo===(Oo=zu(W))&&Sn?Sn.p(W,me):(Sn.d(1),Sn=Oo(W),Sn&&(Sn.c(),Sn.m(ne,Dn))),(!Ye||me[0]&2)&&hn!==(hn=((Yc=(Kc=W[1].common)==null?void 0:Kc.voltage)!=null?Yc:"Voltage")+"")&&C(qn,hn),me[0]&16&&Ze(_l,W[4].m.d),(!Ye||me[0]&2)&&bn!==(bn=((Zc=(Xc=(Qc=W[1].conf)==null?void 0:Qc.meter)==null?void 0:Xc.fuse)!=null?Zc:"Main fuse")+"")&&C(On,bn),me[0]&16&&Xe(cl.value)!==W[4].m.f&&be(cl,W[4].m.f),(!Ye||me[0]&2)&&li!==(li=((xc=($c=(Jc=W[1].conf)==null?void 0:Jc.meter)==null?void 0:$c.prod)!=null?xc:"Production")+"")&&C(Mi,li),me[0]&16&&Xe(Pl.value)!==W[4].m.r&&be(Pl,W[4].m.r),me[0]&16&&(El.checked=W[4].m.e.e),(!Ye||me[0]&2)&&ii!==(ii=((lm=(tm=(em=W[1].conf)==null?void 0:em.meter)==null?void 0:tm.encrypted)!=null?lm:"Encrypted")+"")&&C(Ci,ii),W[4].m.e.e?ql?ql.p(W,me):(ql=q2(W),ql.c(),ql.m(kn,null)):ql&&(ql.d(1),ql=null),W[4].m.e.e?Ol?Ol.p(W,me):(Ol=O2(W),Ol.c(),Ol.m(ne,Xo)):Ol&&(Ol.d(1),Ol=null),me[0]&16&&(nn.checked=W[4].m.m.e),(!Ye||me[0]&2)&&ys!==(ys=((om=(sm=(im=(nm=W[1].conf)==null?void 0:nm.meter)==null?void 0:im.multipliers)==null?void 0:sm.title)!=null?om:"Multipliers")+"")&&C(Zo,ys),W[4].m.m.e?Il?Il.p(W,me):(Il=I2(W),Il.c(),Il.m(ne,null)):Il&&(Il.d(1),Il=null),(!Ye||me[0]&2)&&Ws!==(Ws=((um=(fm=(am=W[1].conf)==null?void 0:am.connection)==null?void 0:fm.title)!=null?um:"Connection")+"")&&C(Jo,Ws),(!Ye||me[0]&2)&&Vs!==(Vs=((mm=(cm=(rm=W[1].conf)==null?void 0:rm.connection)==null?void 0:cm.wifi)!=null?mm:"WiFi")+"")&&C($o,Vs),(!Ye||me[0]&2)&&Ks!==(Ks=((dm=(pm=(_m=W[1].conf)==null?void 0:_m.connection)==null?void 0:pm.ap)!=null?dm:"AP")+"")&&C(xo,Ks),W[0].if&&W[0].if.eth?Ll?Ll.p(W,me):(Ll=L2(W),Ll.c(),Ll.m(tn,null)):Ll&&(Ll.d(1),Ll=null),me[0]&16&&Ze(tn,W[4].n.c),W[4].n.c==1||W[4].n.c==2?Rl?Rl.p(W,me):(Rl=R2(W),Rl.c(),Rl.m(Vl,null)):Rl&&(Rl.d(1),Rl=null),(!Ye||me[0]&2)&&Qs!==(Qs=((bm=(hm=(vm=W[1].conf)==null?void 0:vm.network)==null?void 0:hm.title)!=null?bm:"Network")+"")&&C(ea,Qs),(!Ye||me[0]&2)&&Xs!==(Xs=((wm=(km=(gm=W[1].conf)==null?void 0:gm.network)==null?void 0:km.ip)!=null?wm:"IP")+"")&&C(ta,Xs),(!Ye||me[0]&2)&&Zs!==(Zs=((Cm=(Sm=(Mm=W[1].conf)==null?void 0:Mm.network)==null?void 0:Sm.dhcp)!=null?Cm:"DHCP")+"")&&C(la,Zs),(!Ye||me[0]&2)&&Js!==(Js=((Pm=(Tm=(Nm=W[1].conf)==null?void 0:Nm.network)==null?void 0:Tm.static)!=null?Pm:"Static")+"")&&C(na,Js),me[0]&16&&Ze(wn,W[4].n.m),(!Ye||me[0]&16&&$s!==($s=W[4].n.m=="dhcp"))&&(Kl.disabled=$s),(!Ye||me[0]&16&&xs!==(xs=W[4].n.m=="static"))&&(Kl.required=xs),me[0]&16&&Kl.value!==W[4].n.i&&be(Kl,W[4].n.i),(!Ye||me[0]&16&&eo!==(eo=W[4].n.m=="dhcp"))&&(Yl.disabled=eo),(!Ye||me[0]&16&&to!==(to=W[4].n.m=="static"))&&(Yl.required=to),me[0]&16&&Ze(Yl,W[4].n.s),W[4].n.m=="static"?Fl?Fl.p(W,me):(Fl=F2(W),Fl.c(),Fl.m(il,ia)):Fl&&(Fl.d(1),Fl=null),me[0]&16&&(sn.checked=W[4].n.x),me[0]&16&&(on.checked=W[4].n.d),(!Ye||me[0]&2)&&so!==(so=((Dm=(Am=(Em=W[1].conf)==null?void 0:Em.network)==null?void 0:Am.tick_mdns)!=null?Dm:"mDNS")+"")&&C(sa,so),(!Ye||me[0]&2)&&oo!==(oo=((Im=(Om=(qm=W[1].conf)==null?void 0:qm.network)==null?void 0:Om.ntp)!=null?Im:"NTP")+"")&&C(oa,oo),me[0]&16&&(an.checked=W[4].n.h),(!Ye||me[0]&2)&&ao!==(ao=((Fm=(Rm=(Lm=W[1].conf)==null?void 0:Lm.network)==null?void 0:Rm.tick_ntp_dhcp)!=null?Fm:"from DHCP")+"")&&C(aa,ao),me[0]&16&&Rn.value!==W[4].n.n1&&be(Rn,W[4].n.n1),(!Ye||me[0]&2)&&ro!==(ro=((jm=(Um=(Bm=W[1].conf)==null?void 0:Bm.mqtt)==null?void 0:Um.title)!=null?jm:"MQTT")+"")&&C(fa,ro),(!Ye||me[0]&2)&&co!==(co=((zm=(ym=(Hm=W[1].conf)==null?void 0:Hm.mqtt)==null?void 0:ym.server)!=null?zm:"Server")+"")&&C(ua,co),W[0].chip!="esp8266"?Bl?Bl.p(W,me):(Bl=B2(W),Bl.c(),Bl.m(fn,ra)):Bl&&(Bl.d(1),Bl=null),me[0]&16&&Fn.value!==W[4].q.h&&be(Fn,W[4].q.h),me[0]&16&&Xe(un.value)!==W[4].q.p&&be(un,W[4].q.p),W[4].q.s.e?sl?(sl.p(W,me),me[0]&16&&Q(sl,1)):(sl=U2(W),sl.c(),Q(sl,1),sl.m($t,ca)):sl&&(pt(),ee(sl,1,1,()=>{sl=null}),dt()),(!Ye||me[0]&2)&&mo!==(mo=((Vm=(Gm=(Wm=W[1].conf)==null?void 0:Wm.mqtt)==null?void 0:Gm.user)!=null?Vm:"Username")+"")&&C(ma,mo),me[0]&16&&Bn.value!==W[4].q.u&&be(Bn,W[4].q.u),(!Ye||me[0]&2)&&_o!==(_o=((Qm=(Ym=(Km=W[1].conf)==null?void 0:Km.mqtt)==null?void 0:Ym.pass)!=null?Qm:"Password")+"")&&C(_a,_o),me[0]&16&&Un.value!==W[4].q.a&&be(Un,W[4].q.a),(!Ye||me[0]&2)&&po!==(po=((Jm=(Zm=(Xm=W[1].conf)==null?void 0:Xm.mqtt)==null?void 0:Zm.id)!=null?Jm:"Client ID")+"")&&C(pa,po),me[0]&16&&jn.value!==W[4].q.c&&be(jn,W[4].q.c),(!Ye||me[0]&2)&&vo!==(vo=((e_=(xm=($m=W[1].conf)==null?void 0:$m.mqtt)==null?void 0:xm.payload)!=null?e_:"Payload")+"")&&C(da,vo),(!Ye||me[0]&2)&&ho!==(ho=((i_=(n_=(l_=(t_=W[1].conf)==null?void 0:t_.mqtt)==null?void 0:l_.domoticz)==null?void 0:n_.title)!=null?i_:"Domoticz")+"")&&C(va,ho),(!Ye||me[0]&2)&&bo!==(bo=((f_=(a_=(o_=(s_=W[1].conf)==null?void 0:s_.mqtt)==null?void 0:o_.ha)==null?void 0:a_.title)!=null?f_:"Home-Assistant")+"")&&C(ha,bo),me[0]&16&&Ze(pl,W[4].q.m),(!Ye||me[0]&2)&&go!==(go=((c_=(r_=(u_=W[1].conf)==null?void 0:u_.mqtt)==null?void 0:r_.publish)!=null?c_:"Publish topic")+"")&&C(ba,go),me[0]&16&&Hn.value!==W[4].q.b&&be(Hn,W[4].q.b),W[4].q.m==3?Ul?Ul.p(W,me):(Ul=j2(W),Ul.c(),Ul.m(l,ga)):Ul&&(Ul.d(1),Ul=null),W[4].q.m==4?jl?jl.p(W,me):(jl=H2(W),jl.c(),jl.m(l,ka)):jl&&(jl.d(1),jl=null),W[4].c.es!=null?ol?(ol.p(W,me),me[0]&16&&Q(ol,1)):(ol=y2(W),ol.c(),Q(ol,1),ol.m(l,wa)):ol&&(pt(),ee(ol,1,1,()=>{ol=null}),dt()),me[0]&16&&(Ma=W[4].p.r.startsWith("NO")||W[4].p.r.startsWith("10YNO")||W[4].p.r.startsWith("10Y1001A1001A4")),Ma?Hl?Hl.p(W,me):(Hl=G2(W),Hl.c(),Hl.m(l,Sa)):Hl&&(Hl.d(1),Hl=null),(!Ye||me[0]&2)&&wo!==(wo=((p_=(__=(m_=W[1].conf)==null?void 0:m_.ui)==null?void 0:__.title)!=null?p_:"User interface")+"")&&C(Ca,wo),me[0]&530){Ji=W[9];let Wt;for(Wt=0;Wt20||W[0].chip=="esp8266"||W[4].i.d.d>0?al?(al.p(W,me),me[0]&17&&Q(al,1)):(al=Q2(W),al.c(),Q(al,1),al.m(l,Pa)):al&&(pt(),ee(al,1,1,()=>{al=null}),dt()),(!Ye||me[0]&2)&&Co!==(Co=((k_=(g_=(b_=W[1].conf)==null?void 0:b_.debug)==null?void 0:g_.title)!=null?k_:"Debugging")+"")&&C(Ea,Co),me[0]&16&&(cn.checked=W[4].d.s),(!Ye||me[0]&2)&&To!==(To=((S_=(M_=(w_=W[1].conf)==null?void 0:w_.debug)==null?void 0:M_.enable)!=null?S_:"Enable debugging")+"")&&C(Aa,To),W[4].d.s?yl?yl.p(W,me):(yl=td(W),yl.c(),yl.m(Ql,null)):yl&&(yl.d(1),yl=null),(!Ye||me[0]&2)&&Po!==(Po=((N_=(C_=W[1].conf)==null?void 0:C_.btn_reset)!=null?N_:"Factory reset")+"")&&C(qa,Po),(!Ye||me[0]&2)&&Ao!==(Ao=((P_=(T_=W[1].btn)==null?void 0:T_.reboot)!=null?P_:"Reboot")+"")&&C(Oa,Ao),(!Ye||me[0]&2)&&qo!==(qo=((A_=(E_=W[1].btn)==null?void 0:E_.save)!=null?A_:"Save")+"")&&C(Ia,qo);const bl={};me[0]&4&&(bl.active=W[2]),me[0]&2&&(bl.message=(O_=(q_=(D_=W[1].conf)==null?void 0:D_.mask)==null?void 0:q_.loading)!=null?O_:"Loading"),ri.$set(bl);const ja={};me[0]&8&&(ja.active=W[3]),me[0]&2&&(ja.message=(R_=(L_=(I_=W[1].conf)==null?void 0:I_.mask)==null?void 0:L_.saving)!=null?R_:"Saving"),ci.$set(ja);const Ha={};me[0]&64&&(Ha.active=W[6]),me[0]&2&&(Ha.message=(U_=(B_=(F_=W[1].conf)==null?void 0:F_.mask)==null?void 0:B_.reset)!=null?U_:"Factory reset"),mi.$set(Ha);const ya={};me[0]&128&&(ya.active=W[7]),me[0]&2&&(ya.message=(y_=(H_=(j_=W[1].conf)==null?void 0:j_.mask)==null?void 0:H_.reset_done)!=null?y_:"Done"),_i.$set(ya)},i(W){Ye||(Q(R.$$.fragment,W),Q(lt.$$.fragment,W),Q(qi.$$.fragment,W),Q(sl),Q(ol),Q(al),Q(ri.$$.fragment,W),Q(ci.$$.fragment,W),Q(mi.$$.fragment,W),Q(_i.$$.fragment,W),Ye=!0)},o(W){ee(R.$$.fragment,W),ee(lt.$$.fragment,W),ee(qi.$$.fragment,W),ee(sl),ee(ol),ee(al),ee(ri.$$.fragment,W),ee(ci.$$.fragment,W),ee(mi.$$.fragment,W),ee(_i.$$.fragment,W),Ye=!1},d(W){W&&T(t),Ce(R),Xl&&Xl.d(),Xt(Ps,W),Ce(lt),Al&&Al.d(),Dl&&Dl.d(),Sn.d(),ql&&ql.d(),Ol&&Ol.d(),Il&&Il.d(),Ll&&Ll.d(),Rl&&Rl.d(),Ce(qi),Fl&&Fl.d(),Bl&&Bl.d(),sl&&sl.d(),Ul&&Ul.d(),jl&&jl.d(),ol&&ol.d(),Hl&&Hl.d(),Xt(vl,W),Xt(hl,W),al&&al.d(),yl&&yl.d(),W&&T(La),Ce(ri,W),W&&T(Ra),Ce(ci,W),W&&T(Fa),Ce(mi,W),W&&T(Ba),Ce(_i,W),Ua=!1,Et(yu)}}}async function bg(){await(await fetch("reboot",{method:"POST"})).json()}function gg(e,t,l){let{basepath:n="/"}=t,{sysinfo:i={}}=t,o={};Ml.subscribe(Ke=>{l(1,o=Ke)});let f=[{name:"Import gauge",key:"i"},{name:"Export gauge",key:"e"},{name:"Voltage",key:"v"},{name:"Amperage",key:"a"},{name:"Per phase",key:"h"},{name:"Power factor",key:"f"},{name:"Reactive",key:"r"},{name:"Realtime",key:"c"},{name:"Peaks",key:"t"},{name:"Realtime plot",key:"l"},{name:"Price",key:"p"},{name:"Day plot",key:"d"},{name:"Month plot",key:"m"},{name:"Temperature plot",key:"s"},{name:"Dark mode",key:"k"}],r=!0,c=!1,a={g:{t:"",h:"",s:0,u:"",p:""},m:{b:2400,p:11,i:!1,d:0,f:0,r:0,e:{e:!1,k:"",a:""},m:{e:!1,w:!1,v:!1,a:!1,c:!1}},w:{s:"",p:"",w:0,z:255,a:!0,b:!0},n:{m:"",i:"",s:"",g:"",d1:"",d2:"",d:!1,n1:"",n2:"",h:!1,x:!1},q:{h:"",p:1883,u:"",a:"",b:"",s:{e:!1,c:!1,r:!0,k:!1}},o:{e:"",c:"",u1:"",u2:"",u3:""},t:{t:[0,0,0,0,0,0,0,0,0,0],h:1},p:{e:!1,t:"",r:"",c:"",m:1,f:null},d:{s:!1,t:!1,l:5},u:{i:0,e:0,v:0,a:0,r:0,c:0,t:0,p:0,d:0,m:0,s:0,lang:"en"},i:{h:{p:null,u:!0},a:null,l:{p:null,i:!1},r:{r:null,g:null,b:null,i:!1},d:{d:null,b:0},t:{d:null,a:null},v:{p:null,d:{v:null,g:null},o:null,m:null,b:null}},h:{t:"",h:"",n:""},c:{e:!1,i:null,es:null}},m=[];qs.subscribe(Ke=>{var ne,Ue;Ke.version&&(l(4,a=Ke),l(2,r=!1),l(5,m=[{code:"en",name:"English"}]),a.u.lang&&a.u.lang!="en"&&m.push({code:a.u.lang,name:(Ue=(ne=o.language)==null?void 0:ne.name)!=null?Ue:"Unknown"}),m.push({code:"hub",name:"Load from server"}))}),R4();let p=!1,v=!1;async function d(){if(confirm("Factory reset?")){l(6,p=!0);const Ke=new URLSearchParams;Ke.append("perform","true");let Ue=await(await fetch("reset",{method:"POST",body:Ke})).json();l(6,p=!1),l(7,v=Ue.success)}}async function h(Ke){l(3,c=!0);const ne=new FormData(Ke.target),Ue=new URLSearchParams;for(let ut of ne){const[Yt,ll]=ut;Ue.append(Yt,ll)}let St=await(await fetch("save",{method:"POST",body:Ue})).json();wl.update(ut=>(ut.hostname=ne.get("gh"),ut.usrcfg=St.success,ut.booting=St.reboot,ne.get("nm")=="static"&&(ut.net.ip=ne.get("ni"),ut.net.mask=ne.get("nu"),ut.net.gw=ne.get("ng"),ut.net.dns1=ne.get("nd")),ut.ui=a.u,ut)),l(3,c=!1),gi(n)}const g=function(){confirm("Reboot?")&&(wl.update(Ke=>(Ke.booting=!0,Ke)),bg())};async function M(){confirm("Are you sure you want to delete CA?")&&(await(await fetch("mqtt-ca",{method:"POST"})).text(),qs.update(ne=>(ne.q.s.c=!1,ne)))}async function A(){confirm("Are you sure you want to delete cert?")&&(await(await fetch("mqtt-cert",{method:"POST"})).text(),qs.update(ne=>(ne.q.s.r=!1,ne)))}async function I(){confirm("Are you sure you want to delete key?")&&(await(await fetch("mqtt-key",{method:"POST"})).text(),qs.update(ne=>(ne.q.s.k=!1,ne)))}const O=function(){a.q.s.e?a.q.p==1883&&l(4,a.q.p=8883,a):a.q.p==8883&&l(4,a.q.p=1883,a)};async function L(){if(a.u.lang=="hub"){const Ke=await dn("http://hub.amsleser.no/hub/language/list.json");l(5,m=await Ke.json()),l(4,a.u.lang=o.language.code,a)}}let q=44;function U(){a.g.h=this.value,l(4,a)}function P(){a.g.t=Ft(this),l(4,a)}function F(){a.p.r=Ft(this),l(4,a)}function z(){a.p.c=Ft(this),l(4,a)}function G(){a.p.e=this.checked,l(4,a)}function B(){a.p.t=this.value,l(4,a)}function R(){a.g.s=Ft(this),l(4,a)}function K(){a.g.u=this.value,l(4,a)}function y(){a.g.p=this.value,l(4,a)}function H(){a.g.c=this.value,l(4,a)}function Y(){a.m.a=Ft(this),l(4,a)}function X(){a.m.b=Xe(this.value),l(4,a)}function J(){a.m.i=this.checked,l(4,a)}function $(){a.m.b=Ft(this),l(4,a)}function ce(){a.m.p=Ft(this),l(4,a)}function ie(){a.m.s=Xe(this.value),l(4,a)}function oe(){a.m.d=Ft(this),l(4,a)}function ae(){a.m.f=Xe(this.value),l(4,a)}function se(){a.m.r=Xe(this.value),l(4,a)}function x(){a.m.e.e=this.checked,l(4,a)}function _e(){a.m.e.k=this.value,l(4,a)}function pe(){a.m.e.a=this.value,l(4,a)}function V(){a.m.m.e=this.checked,l(4,a)}function Z(){a.m.m.w=Xe(this.value),l(4,a)}function ge(){a.m.m.v=Xe(this.value),l(4,a)}function ve(){a.m.m.a=Xe(this.value),l(4,a)}function S(){a.m.m.c=Xe(this.value),l(4,a)}function w(){a.n.c=Ft(this),l(4,a)}function N(){a.w.s=this.value,l(4,a)}function D(){a.w.p=this.value,l(4,a)}function j(){a.w.z=Ft(this),l(4,a)}function te(){a.w.w=Xe(this.value),l(4,a)}function le(){a.w.b=this.checked,l(4,a)}function fe(){a.n.m=Ft(this),l(4,a)}function de(){a.n.i=this.value,l(4,a)}function qe(){a.n.s=Ft(this),l(4,a)}function Pe(){a.n.g=this.value,l(4,a)}function we(){a.n.d1=this.value,l(4,a)}function Fe(){a.n.d2=this.value,l(4,a)}function Ae(){a.n.x=this.checked,l(4,a)}function ke(){a.n.d=this.checked,l(4,a)}function De(){a.n.h=this.checked,l(4,a)}function He(){a.n.n1=this.value,l(4,a)}function Oe(){a.q.s.e=this.checked,l(4,a)}function je(){a.q.h=this.value,l(4,a)}function Qe(){a.q.p=Xe(this.value),l(4,a)}function We(){a.q.u=this.value,l(4,a)}function Je(){a.q.a=this.value,l(4,a)}function $e(){a.q.c=this.value,l(4,a)}function tt(){a.q.m=Ft(this),l(4,a)}function Te(){a.q.b=this.value,l(4,a)}function ue(){a.o.e=this.value,l(4,a)}function Ie(){a.o.c=this.value,l(4,a)}function kt(){a.o.u1=this.value,l(4,a)}function lt(){a.o.u2=this.value,l(4,a)}function wt(){a.o.u3=this.value,l(4,a)}function st(){a.h.t=this.value,l(4,a)}function ot(){a.h.h=this.value,l(4,a)}function xe(){a.h.n=this.value,l(4,a)}function Nt(){a.c.e=this.checked,l(4,a)}function gt(){a.c.es=this.checked,l(4,a)}function At(Ke){a.t.t[Ke]=Xe(this.value),l(4,a)}function Pt(){a.t.h=Xe(this.value),l(4,a)}function Be(Ke){a.u[Ke.key]=Ft(this),l(4,a)}function ye(){a.u.lang=Ft(this),l(4,a)}function It(){a.i.h.p=Ft(this),l(4,a)}function vt(){a.i.h.t=Ft(this),l(4,a)}function nt(){a.i.h.u=this.checked,l(4,a)}function Tt(){a.i.a=Xe(this.value),l(4,a)}function it(){a.i.l.p=Xe(this.value),l(4,a)}function at(){a.i.l.i=this.checked,l(4,a)}function rt(){a.i.r.i=this.checked,l(4,a)}function jt(){a.i.r.r=Xe(this.value),l(4,a)}function Lt(){a.i.r.g=Xe(this.value),l(4,a)}function Ht(){a.i.r.b=Xe(this.value),l(4,a)}function yt(){a.i.d.d=Xe(this.value),l(4,a)}function Me(){a.i.t.d=Xe(this.value),l(4,a)}function Ve(){a.i.t.a=Xe(this.value),l(4,a)}function Rt(){a.i.v.p=Xe(this.value),l(4,a)}function Gt(){a.i.v.d.v=Xe(this.value),l(4,a)}function zt(){a.i.v.d.g=Xe(this.value),l(4,a)}function Dt(){a.i.d.b=Ft(this),l(4,a)}function Kt(){a.i.v.o=Xe(this.value),l(4,a)}function Zt(){a.i.v.m=Xe(this.value),l(4,a)}function tl(){a.i.v.b=Xe(this.value),l(4,a)}function Jt(){a.d.s=this.checked,l(4,a)}function ft(){a.d.t=this.checked,l(4,a)}function Mt(){a.d.l=Ft(this),l(4,a)}return e.$$set=Ke=>{"basepath"in Ke&&l(18,n=Ke.basepath),"sysinfo"in Ke&&l(0,i=Ke.sysinfo)},e.$$.update=()=>{e.$$.dirty[0]&1&&l(8,q=i.chip=="esp8266"?16:i.chip=="esp32s2"?44:39)},[i,o,r,c,a,m,p,v,q,f,d,h,g,M,A,I,O,L,n,U,P,F,z,G,B,R,K,y,H,Y,X,J,$,ce,ie,oe,ae,se,x,_e,pe,V,Z,ge,ve,S,w,N,D,j,te,le,fe,de,qe,Pe,we,Fe,Ae,ke,De,He,Oe,je,Qe,We,Je,$e,tt,Te,ue,Ie,kt,lt,wt,st,ot,xe,Nt,gt,At,Pt,Be,ye,It,vt,nt,Tt,it,at,rt,jt,Lt,Ht,yt,Me,Ve,Rt,Gt,zt,Dt,Kt,Zt,tl,Jt,ft,Mt]}class kg extends _t{constructor(t){super(),mt(this,t,gg,hg,ct,{basepath:18,sysinfo:0},null,[-1,-1,-1,-1])}}function nd(e,t,l){const n=e.slice();return n[22]=t[l],n}function wg(e){let t=Ge(e[1].chip,e[1].board)+"",l;return{c(){l=k(t)},m(n,i){E(n,l,i)},p(n,i){i&2&&t!==(t=Ge(n[1].chip,n[1].board)+"")&&C(l,t)},d(n){n&&T(l)}}}function id(e){var Y,X,J,$,ce,ie,oe,ae,se,x,_e,pe;let t,l=((J=(X=(Y=e[3].status)==null?void 0:Y.device)==null?void 0:X.apmac)!=null?J:"AP MAC")+"",n,i,o=e[1].apmac+"",f,r,c,a=((ie=(ce=($=e[3].status)==null?void 0:$.device)==null?void 0:ce.last_boot)!=null?ie:"Last boot")+"",m,p,v,d,h,g,M=((se=(ae=(oe=e[3].status)==null?void 0:oe.device)==null?void 0:ae.reason)!=null?se:"Reason")+"",A,I,O=((pe=(_e=(x=e[3][np(e[1].chip)])==null?void 0:x.reason)==null?void 0:_e[e[1].boot_reason])!=null?pe:e[1].boot_reason)+"",L,q,U=e[1].boot_reason+"",P,F,z=e[1].ex_cause+"",G,B,R;const K=[Sg,Mg],y=[];function H(V,Z){return V[0].u>0?0:1}return v=H(e),d=y[v]=K[v](e),{c(){t=_("div"),n=k(l),i=k(": "),f=k(o),r=b(),c=_("div"),m=k(a),p=k(`: + `),d.c(),h=b(),g=_("div"),A=k(M),I=k(": "),L=k(O),q=k(" ("),P=k(U),F=k("/"),G=k(z),B=k(")"),u(t,"class","my-2"),u(c,"class","my-2"),u(g,"class","my-2")},m(V,Z){E(V,t,Z),s(t,n),s(t,i),s(t,f),E(V,r,Z),E(V,c,Z),s(c,m),s(c,p),y[v].m(c,null),E(V,h,Z),E(V,g,Z),s(g,A),s(g,I),s(g,L),s(g,q),s(g,P),s(g,F),s(g,G),s(g,B),R=!0},p(V,Z){var ve,S,w,N,D,j,te,le,fe,de,qe,Pe;(!R||Z&8)&&l!==(l=((w=(S=(ve=V[3].status)==null?void 0:ve.device)==null?void 0:S.apmac)!=null?w:"AP MAC")+"")&&C(n,l),(!R||Z&2)&&o!==(o=V[1].apmac+"")&&C(f,o),(!R||Z&8)&&a!==(a=((j=(D=(N=V[3].status)==null?void 0:N.device)==null?void 0:D.last_boot)!=null?j:"Last boot")+"")&&C(m,a);let ge=v;v=H(V),v===ge?y[v].p(V,Z):(pt(),ee(y[ge],1,1,()=>{y[ge]=null}),dt(),d=y[v],d?d.p(V,Z):(d=y[v]=K[v](V),d.c()),Q(d,1),d.m(c,null)),(!R||Z&8)&&M!==(M=((fe=(le=(te=V[3].status)==null?void 0:te.device)==null?void 0:le.reason)!=null?fe:"Reason")+"")&&C(A,M),(!R||Z&10)&&O!==(O=((Pe=(qe=(de=V[3][np(V[1].chip)])==null?void 0:de.reason)==null?void 0:qe[V[1].boot_reason])!=null?Pe:V[1].boot_reason)+"")&&C(L,O),(!R||Z&2)&&U!==(U=V[1].boot_reason+"")&&C(P,U),(!R||Z&2)&&z!==(z=V[1].ex_cause+"")&&C(G,z)},i(V){R||(Q(d),R=!0)},o(V){ee(d),R=!1},d(V){V&&T(t),V&&T(r),V&&T(c),y[v].d(),V&&T(h),V&&T(g)}}}function Mg(e){let t;return{c(){t=k("-")},m(l,n){E(l,t,n)},p:ze,i:ze,o:ze,d(l){l&&T(t)}}}function Sg(e){let t,l;return t=new Hv({props:{timestamp:new Date(new Date().getTime()-e[0].u*1e3),fullTimeColor:""}}),{c(){Ne(t.$$.fragment)},m(n,i){Se(t,n,i),l=!0},p(n,i){const o={};i&1&&(o.timestamp=new Date(new Date().getTime()-n[0].u*1e3)),t.$set(o)},i(n){l||(Q(t.$$.fragment,n),l=!0)},o(n){ee(t.$$.fragment,n),l=!1},d(n){Ce(t,n)}}}function Cg(e){var i,o,f;let t,l=((f=(o=(i=e[3].status)==null?void 0:i.device)==null?void 0:o.btn_consents)!=null?f:"Consents")+"",n;return{c(){t=_("span"),n=k(l),u(t,"class","btn-pri-sm")},m(r,c){E(r,t,c),s(t,n)},p(r,c){var a,m,p;c&8&&l!==(l=((p=(m=(a=r[3].status)==null?void 0:a.device)==null?void 0:m.btn_consents)!=null?p:"Consents")+"")&&C(n,l)},d(r){r&&T(t)}}}function sd(e){var G,B,R,K,y,H,Y,X,J,$,ce,ie;let t,l,n=((R=(B=(G=e[3].status)==null?void 0:G.meter)==null?void 0:B.title)!=null?R:"Meter")+"",i,o,f,r=((H=(y=(K=e[3].status)==null?void 0:K.meter)==null?void 0:y.manufacturer)!=null?H:"Manufacturer")+"",c,a,m=Ko(e[1].meter.mfg)+"",p,v,d,h=((J=(X=(Y=e[3].status)==null?void 0:Y.meter)==null?void 0:X.model)!=null?J:"Model")+"",g,M,A=(e[1].meter.model?e[1].meter.model:"unknown")+"",I,O,L,q=((ie=(ce=($=e[3].status)==null?void 0:$.meter)==null?void 0:ce.id)!=null?ie:"ID")+"",U,P,F=(e[1].meter.id?e[1].meter.id:"unknown")+"",z;return{c(){t=_("div"),l=_("strong"),i=k(n),o=b(),f=_("div"),c=k(r),a=k(": "),p=k(m),v=b(),d=_("div"),g=k(h),M=k(": "),I=k(A),O=b(),L=_("div"),U=k(q),P=k(": "),z=k(F),u(l,"class","text-sm"),u(f,"class","my-2"),u(d,"class","my-2"),u(L,"class","my-2"),u(t,"class","cnt")},m(oe,ae){E(oe,t,ae),s(t,l),s(l,i),s(t,o),s(t,f),s(f,c),s(f,a),s(f,p),s(t,v),s(t,d),s(d,g),s(d,M),s(d,I),s(t,O),s(t,L),s(L,U),s(L,P),s(L,z)},p(oe,ae){var se,x,_e,pe,V,Z,ge,ve,S,w,N,D;ae&8&&n!==(n=((_e=(x=(se=oe[3].status)==null?void 0:se.meter)==null?void 0:x.title)!=null?_e:"Meter")+"")&&C(i,n),ae&8&&r!==(r=((Z=(V=(pe=oe[3].status)==null?void 0:pe.meter)==null?void 0:V.manufacturer)!=null?Z:"Manufacturer")+"")&&C(c,r),ae&2&&m!==(m=Ko(oe[1].meter.mfg)+"")&&C(p,m),ae&8&&h!==(h=((S=(ve=(ge=oe[3].status)==null?void 0:ge.meter)==null?void 0:ve.model)!=null?S:"Model")+"")&&C(g,h),ae&2&&A!==(A=(oe[1].meter.model?oe[1].meter.model:"unknown")+"")&&C(I,A),ae&8&&q!==(q=((D=(N=(w=oe[3].status)==null?void 0:w.meter)==null?void 0:N.id)!=null?D:"ID")+"")&&C(U,q),ae&2&&F!==(F=(oe[1].meter.id?oe[1].meter.id:"unknown")+"")&&C(z,F)},d(oe){oe&&T(t)}}}function od(e){var X,J,$,ce,ie,oe,ae,se,x,_e,pe,V;let t,l,n=(($=(J=(X=e[3].status)==null?void 0:X.network)==null?void 0:J.title)!=null?$:"Network")+"",i,o,f,r=((oe=(ie=(ce=e[3].conf)==null?void 0:ce.network)==null?void 0:ie.ip)!=null?oe:"IP")+"",c,a,m=e[1].net.ip+"",p,v,d,h=((x=(se=(ae=e[3].conf)==null?void 0:ae.network)==null?void 0:se.mask)!=null?x:"Mask")+"",g,M,A=e[1].net.mask+"",I,O,L,q=((V=(pe=(_e=e[3].conf)==null?void 0:_e.network)==null?void 0:pe.gw)!=null?V:"Gateway")+"",U,P,F=e[1].net.gw+"",z,G,B,R,K,y=e[1].net.dns1&&ad(e),H=e[1].net.dns2&&fd(e),Y=e[1].net.ipv6&&ud(e);return{c(){t=_("div"),l=_("strong"),i=k(n),o=b(),f=_("div"),c=k(r),a=k(": "),p=k(m),v=b(),d=_("div"),g=k(h),M=k(": "),I=k(A),O=b(),L=_("div"),U=k(q),P=k(": "),z=k(F),G=b(),B=_("div"),y&&y.c(),R=b(),H&&H.c(),K=b(),Y&&Y.c(),u(l,"class","text-sm"),u(f,"class","my-2"),u(d,"class","my-2"),u(L,"class","my-2"),u(B,"class","my-2"),u(t,"class","cnt")},m(Z,ge){E(Z,t,ge),s(t,l),s(l,i),s(t,o),s(t,f),s(f,c),s(f,a),s(f,p),s(t,v),s(t,d),s(d,g),s(d,M),s(d,I),s(t,O),s(t,L),s(L,U),s(L,P),s(L,z),s(t,G),s(t,B),y&&y.m(B,null),s(B,R),H&&H.m(B,null),s(t,K),Y&&Y.m(t,null)},p(Z,ge){var ve,S,w,N,D,j,te,le,fe,de,qe,Pe;ge&8&&n!==(n=((w=(S=(ve=Z[3].status)==null?void 0:ve.network)==null?void 0:S.title)!=null?w:"Network")+"")&&C(i,n),ge&8&&r!==(r=((j=(D=(N=Z[3].conf)==null?void 0:N.network)==null?void 0:D.ip)!=null?j:"IP")+"")&&C(c,r),ge&2&&m!==(m=Z[1].net.ip+"")&&C(p,m),ge&8&&h!==(h=((fe=(le=(te=Z[3].conf)==null?void 0:te.network)==null?void 0:le.mask)!=null?fe:"Mask")+"")&&C(g,h),ge&2&&A!==(A=Z[1].net.mask+"")&&C(I,A),ge&8&&q!==(q=((Pe=(qe=(de=Z[3].conf)==null?void 0:de.network)==null?void 0:qe.gw)!=null?Pe:"Gateway")+"")&&C(U,q),ge&2&&F!==(F=Z[1].net.gw+"")&&C(z,F),Z[1].net.dns1?y?y.p(Z,ge):(y=ad(Z),y.c(),y.m(B,R)):y&&(y.d(1),y=null),Z[1].net.dns2?H?H.p(Z,ge):(H=fd(Z),H.c(),H.m(B,null)):H&&(H.d(1),H=null),Z[1].net.ipv6?Y?Y.p(Z,ge):(Y=ud(Z),Y.c(),Y.m(t,null)):Y&&(Y.d(1),Y=null)},d(Z){Z&&T(t),y&&y.d(),H&&H.d(),Y&&Y.d()}}}function ad(e){var f,r,c;let t=((c=(r=(f=e[3].conf)==null?void 0:f.network)==null?void 0:r.dns)!=null?c:"DNS")+"",l,n,i=e[1].net.dns1+"",o;return{c(){l=k(t),n=k(": "),o=k(i)},m(a,m){E(a,l,m),E(a,n,m),E(a,o,m)},p(a,m){var p,v,d;m&8&&t!==(t=((d=(v=(p=a[3].conf)==null?void 0:p.network)==null?void 0:v.dns)!=null?d:"DNS")+"")&&C(l,t),m&2&&i!==(i=a[1].net.dns1+"")&&C(o,i)},d(a){a&&T(l),a&&T(n),a&&T(o)}}}function fd(e){var f,r,c;let t=((c=(r=(f=e[3].conf)==null?void 0:f.network)==null?void 0:r.dns)!=null?c:"DNS")+"",l,n,i=e[1].net.dns2+"",o;return{c(){l=k(t),n=k(": "),o=k(i)},m(a,m){E(a,l,m),E(a,n,m),E(a,o,m)},p(a,m){var p,v,d;m&8&&t!==(t=((d=(v=(p=a[3].conf)==null?void 0:p.network)==null?void 0:v.dns)!=null?d:"DNS")+"")&&C(l,t),m&2&&i!==(i=a[1].net.dns2+"")&&C(o,i)},d(a){a&&T(l),a&&T(n),a&&T(o)}}}function ud(e){let t,l,n=e[1].net.ipv6+"",i,o,f,r,c=e[1].net.dns1v6&&rd(e),a=e[1].net.dns2v6&&cd(e);return{c(){t=_("div"),l=k("IPv6: "),i=k(n),o=b(),f=_("div"),c&&c.c(),r=b(),a&&a.c(),u(t,"class","my-2"),u(f,"class","my-2")},m(m,p){E(m,t,p),s(t,l),s(t,i),E(m,o,p),E(m,f,p),c&&c.m(f,null),s(f,r),a&&a.m(f,null)},p(m,p){p&2&&n!==(n=m[1].net.ipv6+"")&&C(i,n),m[1].net.dns1v6?c?c.p(m,p):(c=rd(m),c.c(),c.m(f,r)):c&&(c.d(1),c=null),m[1].net.dns2v6?a?a.p(m,p):(a=cd(m),a.c(),a.m(f,null)):a&&(a.d(1),a=null)},d(m){m&&T(t),m&&T(o),m&&T(f),c&&c.d(),a&&a.d()}}}function rd(e){let t,l=e[1].net.dns1v6+"",n;return{c(){t=k("DNSv6: "),n=k(l)},m(i,o){E(i,t,o),E(i,n,o)},p(i,o){o&2&&l!==(l=i[1].net.dns1v6+"")&&C(n,l)},d(i){i&&T(t),i&&T(n)}}}function cd(e){let t,l=e[1].net.dns2v6+"",n;return{c(){t=k("DNSv6: "),n=k(l)},m(i,o){E(i,t,o),E(i,n,o)},p(i,o){o&2&&l!==(l=i[1].net.dns2v6+"")&&C(n,l)},d(i){i&&T(t),i&&T(n)}}}function md(e){var c,a,m,p,v,d;let t,l,n=((m=(a=(c=e[3].status)==null?void 0:c.firmware)==null?void 0:a.failed)!=null?m:"Upgrade from {0} to {1} failed").replace("{0}",e[1].upgrade.f).replace("{1}",e[1].upgrade.t)+"",i,o,f=((d=(v=(p=e[3].errors)==null?void 0:p.http)==null?void 0:v[e[1].upgrade.e])!=null?d:e[1].upgrade.e)+"",r;return{c(){t=_("div"),l=_("div"),i=k(n),o=b(),r=k(f),u(l,"class","bd-yellow"),u(t,"class","my-2")},m(h,g){E(h,t,g),s(t,l),s(l,i),s(l,o),s(l,r)},p(h,g){var M,A,I,O,L,q;g&10&&n!==(n=((I=(A=(M=h[3].status)==null?void 0:M.firmware)==null?void 0:A.failed)!=null?I:"Upgrade from {0} to {1} failed").replace("{0}",h[1].upgrade.f).replace("{1}",h[1].upgrade.t)+"")&&C(i,n),g&10&&f!==(f=((q=(L=(O=h[3].errors)==null?void 0:O.http)==null?void 0:L[h[1].upgrade.e])!=null?q:h[1].upgrade.e)+"")&&C(r,f)},d(h){h&&T(t)}}}function _d(e){var h,g,M;let t,l=((M=(g=(h=e[3].status)==null?void 0:h.firmware)==null?void 0:g.latest)!=null?M:"Latest")+"",n,i,o,f=e[4].tag_name+"",r,c,a,m,p,v=(e[1].security==0||e[0].a)&&e[1].fwconsent===1&&e[4]&&e[4].tag_name!=e[1].version&&pd(e),d=e[1].fwconsent===2&&dd(e);return{c(){t=_("div"),n=k(l),i=k(`: + `),o=_("a"),r=k(f),a=b(),v&&v.c(),m=b(),d&&d.c(),p=Ut(),u(o,"href",c=e[4].html_url),u(o,"class","ml-2 text-blue-600 hover:text-blue-800"),u(o,"target","_blank"),u(o,"rel","noreferrer"),u(t,"class","my-2 flex")},m(A,I){E(A,t,I),s(t,n),s(t,i),s(t,o),s(o,r),s(t,a),v&&v.m(t,null),E(A,m,I),d&&d.m(A,I),E(A,p,I)},p(A,I){var O,L,q;I&8&&l!==(l=((q=(L=(O=A[3].status)==null?void 0:O.firmware)==null?void 0:L.latest)!=null?q:"Latest")+"")&&C(n,l),I&16&&f!==(f=A[4].tag_name+"")&&C(r,f),I&16&&c!==(c=A[4].html_url)&&u(o,"href",c),(A[1].security==0||A[0].a)&&A[1].fwconsent===1&&A[4]&&A[4].tag_name!=A[1].version?v?v.p(A,I):(v=pd(A),v.c(),v.m(t,null)):v&&(v.d(1),v=null),A[1].fwconsent===2?d?d.p(A,I):(d=dd(A),d.c(),d.m(p.parentNode,p)):d&&(d.d(1),d=null)},d(A){A&&T(t),v&&v.d(),A&&T(m),d&&d.d(A),A&&T(p)}}}function pd(e){let t,l,n,i,o;return{c(){var f,r,c;t=_("div"),l=_("button"),l.textContent="\u21D3",u(t,"class","flex-none ml-2 text-green-500"),u(t,"title",n=(c=(r=(f=e[3].status)==null?void 0:f.firmware)==null?void 0:r.install)!=null?c:"Install")},m(f,r){E(f,t,r),s(t,l),i||(o=re(l,"click",e[11]),i=!0)},p(f,r){var c,a,m;r&8&&n!==(n=(m=(a=(c=f[3].status)==null?void 0:c.firmware)==null?void 0:a.install)!=null?m:"Install")&&u(t,"title",n)},d(f){f&&T(t),i=!1,o()}}}function dd(e){var o,f,r;let t,l,n=((r=(f=(o=e[3].status)==null?void 0:o.firmware)==null?void 0:f.no_one_click)!=null?r:"One-click upgrade disabled")+"",i;return{c(){t=_("div"),l=_("div"),i=k(n),u(l,"class","bd-yellow"),u(t,"class","my-2")},m(c,a){E(c,t,a),s(t,l),s(l,i)},p(c,a){var m,p,v;a&8&&n!==(n=((v=(p=(m=c[3].status)==null?void 0:m.firmware)==null?void 0:p.no_one_click)!=null?v:"One-click upgrade disabled")+"")&&C(i,n)},d(c){c&&T(t)}}}function vd(e){let t,l=Yo(Ge(e[1].chip,e[1].board))+"",n;return{c(){t=_("div"),n=k(l),u(t,"class","bd-red")},m(i,o){E(i,t,o),s(t,n)},p(i,o){o&2&&l!==(l=Yo(Ge(i[1].chip,i[1].board))+"")&&C(n,l)},d(i){i&&T(t)}}}function hd(e){let t,l,n,i,o,f;function r(m,p){return m[6].length==0?Tg:Ng}let c=r(e),a=c(e);return{c(){t=_("div"),l=_("form"),n=_("input"),i=b(),a.c(),_n(n,"display","none"),u(n,"name","file"),u(n,"type","file"),u(n,"accept",".bin"),u(l,"action","/firmware"),u(l,"enctype","multipart/form-data"),u(l,"method","post"),u(l,"autocomplete","off"),u(t,"class","my-2 flex")},m(m,p){E(m,t,p),s(t,l),s(l,n),e[14](n),s(l,i),a.m(l,null),o||(f=[re(n,"change",e[15]),re(l,"submit",e[17])],o=!0)},p(m,p){c===(c=r(m))&&a?a.p(m,p):(a.d(1),a=c(m),a&&(a.c(),a.m(l,null)))},d(m){m&&T(t),e[14](null),a.d(),o=!1,Et(f)}}}function Ng(e){var r,c;let t=e[6][0].name+"",l,n,i,o=((c=(r=e[3].btn)==null?void 0:r.upload)!=null?c:"Upload")+"",f;return{c(){l=k(t),n=b(),i=_("button"),f=k(o),u(i,"type","submit"),u(i,"class","btn-pri-sm float-right ml-2")},m(a,m){E(a,l,m),E(a,n,m),E(a,i,m),s(i,f)},p(a,m){var p,v;m&64&&t!==(t=a[6][0].name+"")&&C(l,t),m&8&&o!==(o=((v=(p=a[3].btn)==null?void 0:p.upload)!=null?v:"Upload")+"")&&C(f,o)},d(a){a&&T(l),a&&T(n),a&&T(i)}}}function Tg(e){var f,r,c;let t,l=((c=(r=(f=e[3].status)==null?void 0:f.firmware)==null?void 0:r.btn_select_file)!=null?c:"Select file")+"",n,i,o;return{c(){t=_("button"),n=k(l),u(t,"type","button"),u(t,"class","btn-pri-sm float-right")},m(a,m){E(a,t,m),s(t,n),i||(o=re(t,"click",e[16]),i=!0)},p(a,m){var p,v,d;m&8&&l!==(l=((d=(v=(p=a[3].status)==null?void 0:p.firmware)==null?void 0:v.btn_select_file)!=null?d:"Select file")+"")&&C(n,l)},d(a){a&&T(t),i=!1,o()}}}function bd(e){var H,Y,X,J,$,ce,ie,oe,ae;let t,l,n=((X=(Y=(H=e[3].status)==null?void 0:H.backup)==null?void 0:Y.title)!=null?X:"Backup")+"",i,o,f,r,c,a,m,p,v=((ce=($=(J=e[3].status)==null?void 0:J.backup)==null?void 0:$.secrets)!=null?ce:"Include secrets")+"",d,h,g,M=((ae=(oe=(ie=e[3].status)==null?void 0:ie.backup)==null?void 0:oe.secrets_desc)!=null?ae:"")+"",A,I,O,L,q,U,P,F,z=e[10],G=[];for(let se=0;se{Oe=null}),dt());const Gt={};Ve&33554440&&(Gt.$$scope={dirty:Ve,ctx:Me}),X.$set(Gt),(!ke||Ve&8)&&ce!==(ce=((Yt=(ut=Me[3].btn)==null?void 0:ut.reboot)!=null?Yt:"Reboot")+"")&&C(ie,ce),Me[1].meter?je?je.p(Me,Ve):(je=sd(Me),je.c(),je.m(t,ae)):je&&(je.d(1),je=null),Me[1].net?Qe?Qe.p(Me,Ve):(Qe=od(Me),Qe.c(),Qe.m(t,se)):Qe&&(Qe.d(1),Qe=null),(!ke||Ve&8)&&pe!==(pe=((ul=(fl=(ll=Me[3].status)==null?void 0:ll.firmware)==null?void 0:fl.title)!=null?ul:"Firmware")+"")&&C(V,pe),(!ke||Ve&8)&&ve!==(ve=((Cl=(rl=(Sl=Me[3].status)==null?void 0:Sl.firmware)==null?void 0:rl.installed)!=null?Cl:"Installed")+"")&&C(S,ve),(!ke||Ve&2)&&N!==(N=Me[1].version+"")&&C(D,N),Me[1].upgrade.t&&Me[1].upgrade.t!=Me[1].version?We?We.p(Me,Ve):(We=md(Me),We.c(),We.m(x,te)):We&&(We.d(1),We=null),Me[4]?Je?Je.p(Me,Ve):(Je=_d(Me),Je.c(),Je.m(x,le)):Je&&(Je.d(1),Je=null),Ve&3&&(fe=(Me[1].security==0||Me[0].a)&&is(Me[1].board)),fe?$e?$e.p(Me,Ve):($e=vd(Me),$e.c(),$e.m(x,de)):$e&&($e.d(1),$e=null),Me[1].security==0||Me[0].a?tt?tt.p(Me,Ve):(tt=hd(Me),tt.c(),tt.m(x,null)):tt&&(tt.d(1),tt=null),Me[1].security==0||Me[0].a?Te?Te.p(Me,Ve):(Te=bd(Me),Te.c(),Te.m(t,null)):Te&&(Te.d(1),Te=null);const zt={};Ve&128&&(zt.active=Me[7]),Ve&8&&(zt.message=(dl=(ml=(nl=Me[3].status)==null?void 0:nl.mask)==null?void 0:ml.firmware)!=null?dl:"Uploading"),we.$set(zt);const Dt={};Ve&512&&(Dt.active=Me[9]),Ve&8&&(Dt.message=(Qt=(Tl=(Nl=Me[3].status)==null?void 0:Nl.mask)==null?void 0:Tl.config)!=null?Qt:"Uploading"),Ae.$set(Dt)},i(Me){ke||(Q(U.$$.fragment,Me),Q(Oe),Q(X.$$.fragment,Me),Q(we.$$.fragment,Me),Q(Ae.$$.fragment,Me),ke=!0)},o(Me){ee(U.$$.fragment,Me),ee(Oe),ee(X.$$.fragment,Me),ee(we.$$.fragment,Me),ee(Ae.$$.fragment,Me),ke=!1},d(Me){Me&&T(t),Ce(U),Oe&&Oe.d(),Ce(X),je&&je.d(),Qe&&Qe.d(),We&&We.d(),Je&&Je.d(),$e&&$e.d(),tt&&tt.d(),Te&&Te.d(),Me&&T(Pe),Ce(we,Me),Me&&T(Fe),Ce(Ae,Me),De=!1,He()}}}async function Dg(){await(await fetch("reboot",{method:"POST"})).json()}function qg(e,t,l){let{data:n}=t,{sysinfo:i}=t,o=[{name:"WiFi",key:"iw"},{name:"MQTT",key:"im"},{name:"Web",key:"ie"},{name:"Meter",key:"it"},{name:"Thresholds",key:"ih"},{name:"GPIO",key:"ig"},{name:"NTP",key:"in"},{name:"Price",key:"is"}],f={};Ml.subscribe(z=>{l(3,f=z)});let r={};Pf.subscribe(z=>{l(4,r=jv(i.version,z)),r||l(4,r=z[0])});function c(){var z,G;confirm(((G=(z=f.header)==null?void 0:z.upgrade)!=null?G:"Upgrade to {0}?").replace("{0}",r.tag_name))&&(i.board!=2&&i.board!=4&&i.board!=7||confirm(Yo(Ge(i.chip,i.board))))&&(wl.update(B=>(B.upgrading=!0,B)),Uv(r.tag_name))}const a=function(){var z,G;confirm((G=(z=f.device)==null?void 0:z.reboot_confirm)!=null?G:"Reboot?")&&(wl.update(B=>(B.booting=!0,B)),Dg())};let m,p=[],v=!1,d,h=[],g=!1;Sf();let M={hostname:"",ip:""};function A(z){l(9,g=!0);const G=new FormData;G.append("file",h[0]),fetch("/configfile",{method:"POST",body:G}).then(B=>B.json()).then(B=>{wl.update(R=>(M&&M.hostname&&(R.hostname=M.hostname),R.booting=B.reboot,M&&M.ip&&(R.net.ip=M.ip),setTimeout(Fs,5e3,i),R))}).catch(B=>{console.error("Error:",B),setTimeout(Fs,5e3,i)})}function I(z){Go[z?"unshift":"push"](()=>{m=z,l(5,m)})}function O(){p=this.files,l(6,p)}const L=()=>{m.click()},q=()=>l(7,v=!0);function U(z){Go[z?"unshift":"push"](()=>{d=z,l(8,d)})}function P(){h=this.files,l(2,h)}const F=()=>{d.click()};return e.$$set=z=>{"data"in z&&l(0,n=z.data),"sysinfo"in z&&l(1,i=z.sysinfo)},e.$$.update=()=>{if(e.$$.dirty&4&&h.length==1){let z=h[0],G=new FileReader,B=R=>{let K=R.target.result.split(` +`);for(let y in K){let H=K[y];H.startsWith("hostname ")?M.hostname=H.split(" ")[1]:H.startsWith("ip ")&&(M.ip=H.split(" ")[1])}};G.onload=B,G.readAsText(z)}},[n,i,h,f,r,m,p,v,d,g,o,c,a,A,I,O,L,q,U,P,F]}class Og extends _t{constructor(t){super(),mt(this,t,qg,Ag,ct,{data:0,sysinfo:1})}}function wd(e){let t,l,n=Ge(e[0],7)+"",i,o,f=Ge(e[0],5)+"",r,c,a=Ge(e[0],4)+"",m,p,v=Ge(e[0],3)+"",d,h,g,M,A=Ge(e[0],2)+"",I,O,L=Ge(e[0],1)+"",q,U,P=Ge(e[0],0)+"",F,z,G,B,R=Ge(e[0],101)+"",K,y,H=Ge(e[0],100)+"",Y;return{c(){t=_("optgroup"),l=_("option"),i=k(n),o=_("option"),r=k(f),c=_("option"),m=k(a),p=_("option"),d=k(v),h=b(),g=_("optgroup"),M=_("option"),I=k(A),O=_("option"),q=k(L),U=_("option"),F=k(P),z=b(),G=_("optgroup"),B=_("option"),K=k(R),y=_("option"),Y=k(H),l.__value=7,l.value=l.__value,o.__value=5,o.value=o.__value,c.__value=4,c.value=c.__value,p.__value=3,p.value=p.__value,u(t,"label","amsleser.no"),M.__value=2,M.value=M.__value,O.__value=1,O.value=O.__value,U.__value=0,U.value=U.__value,u(g,"label","Custom hardware"),B.__value=101,B.value=B.__value,y.__value=100,y.value=y.__value,u(G,"label","Generic hardware")},m(X,J){E(X,t,J),s(t,l),s(l,i),s(t,o),s(o,r),s(t,c),s(c,m),s(t,p),s(p,d),E(X,h,J),E(X,g,J),s(g,M),s(M,I),s(g,O),s(O,q),s(g,U),s(U,F),E(X,z,J),E(X,G,J),s(G,B),s(B,K),s(G,y),s(y,Y)},p(X,J){J&1&&n!==(n=Ge(X[0],7)+"")&&C(i,n),J&1&&f!==(f=Ge(X[0],5)+"")&&C(r,f),J&1&&a!==(a=Ge(X[0],4)+"")&&C(m,a),J&1&&v!==(v=Ge(X[0],3)+"")&&C(d,v),J&1&&A!==(A=Ge(X[0],2)+"")&&C(I,A),J&1&&L!==(L=Ge(X[0],1)+"")&&C(q,L),J&1&&P!==(P=Ge(X[0],0)+"")&&C(F,P),J&1&&R!==(R=Ge(X[0],101)+"")&&C(K,R),J&1&&H!==(H=Ge(X[0],100)+"")&&C(Y,H)},d(X){X&&T(t),X&&T(h),X&&T(g),X&&T(z),X&&T(G)}}}function Md(e){let t,l,n=Ge(e[0],201)+"",i,o,f=Ge(e[0],202)+"",r,c,a=Ge(e[0],203)+"",m,p,v=Ge(e[0],241)+"",d,h,g=Ge(e[0],242)+"",M,A,I=Ge(e[0],243)+"",O,L,q=Ge(e[0],200)+"",U;return{c(){t=_("optgroup"),l=_("option"),i=k(n),o=_("option"),r=k(f),c=_("option"),m=k(a),p=_("option"),d=k(v),h=_("option"),M=k(g),A=_("option"),O=k(I),L=_("option"),U=k(q),l.__value=201,l.value=l.__value,o.__value=202,o.value=o.__value,c.__value=203,c.value=c.__value,p.__value=241,p.value=p.__value,h.__value=242,h.value=h.__value,A.__value=243,A.value=A.__value,L.__value=200,L.value=L.__value,u(t,"label","Generic hardware")},m(P,F){E(P,t,F),s(t,l),s(l,i),s(t,o),s(o,r),s(t,c),s(c,m),s(t,p),s(p,d),s(t,h),s(h,M),s(t,A),s(A,O),s(t,L),s(L,U)},p(P,F){F&1&&n!==(n=Ge(P[0],201)+"")&&C(i,n),F&1&&f!==(f=Ge(P[0],202)+"")&&C(r,f),F&1&&a!==(a=Ge(P[0],203)+"")&&C(m,a),F&1&&v!==(v=Ge(P[0],241)+"")&&C(d,v),F&1&&g!==(g=Ge(P[0],242)+"")&&C(M,g),F&1&&I!==(I=Ge(P[0],243)+"")&&C(O,I),F&1&&q!==(q=Ge(P[0],200)+"")&&C(U,q)},d(P){P&&T(t)}}}function Sd(e){let t,l,n=Ge(e[0],7)+"",i,o,f=Ge(e[0],6)+"",r,c,a=Ge(e[0],5)+"",m,p,v,d,h=Ge(e[0],51)+"",g,M,A=Ge(e[0],50)+"",I;return{c(){t=_("optgroup"),l=_("option"),i=k(n),o=_("option"),r=k(f),c=_("option"),m=k(a),p=b(),v=_("optgroup"),d=_("option"),g=k(h),M=_("option"),I=k(A),l.__value=7,l.value=l.__value,o.__value=6,o.value=o.__value,c.__value=5,c.value=c.__value,u(t,"label","amsleser.no"),d.__value=51,d.value=d.__value,M.__value=50,M.value=M.__value,u(v,"label","Generic hardware")},m(O,L){E(O,t,L),s(t,l),s(l,i),s(t,o),s(o,r),s(t,c),s(c,m),E(O,p,L),E(O,v,L),s(v,d),s(d,g),s(v,M),s(M,I)},p(O,L){L&1&&n!==(n=Ge(O[0],7)+"")&&C(i,n),L&1&&f!==(f=Ge(O[0],6)+"")&&C(r,f),L&1&&a!==(a=Ge(O[0],5)+"")&&C(m,a),L&1&&h!==(h=Ge(O[0],51)+"")&&C(g,h),L&1&&A!==(A=Ge(O[0],50)+"")&&C(I,A)},d(O){O&&T(t),O&&T(p),O&&T(v)}}}function Cd(e){let t,l,n=Ge(e[0],8)+"",i,o,f,r,c=Ge(e[0],71)+"",a,m,p=Ge(e[0],70)+"",v;return{c(){t=_("optgroup"),l=_("option"),i=k(n),o=b(),f=_("optgroup"),r=_("option"),a=k(c),m=_("option"),v=k(p),l.__value=8,l.value=l.__value,u(t,"label","Custom hardware"),r.__value=71,r.value=r.__value,m.__value=70,m.value=m.__value,u(f,"label","Generic hardware")},m(d,h){E(d,t,h),s(t,l),s(l,i),E(d,o,h),E(d,f,h),s(f,r),s(r,a),s(f,m),s(m,v)},p(d,h){h&1&&n!==(n=Ge(d[0],8)+"")&&C(i,n),h&1&&c!==(c=Ge(d[0],71)+"")&&C(a,c),h&1&&p!==(p=Ge(d[0],70)+"")&&C(v,p)},d(d){d&&T(t),d&&T(o),d&&T(f)}}}function Nd(e){let t,l,n=Ge(e[0],200)+"",i;return{c(){t=_("optgroup"),l=_("option"),i=k(n),l.__value=200,l.value=l.__value,u(t,"label","Generic hardware")},m(o,f){E(o,t,f),s(t,l),s(l,i)},p(o,f){f&1&&n!==(n=Ge(o[0],200)+"")&&C(i,n)},d(o){o&&T(t)}}}function Td(e){let t,l,n=Ge(e[0],80)+"",i;return{c(){t=_("optgroup"),l=_("option"),i=k(n),l.__value=80,l.value=l.__value,u(t,"label","Generic hardware")},m(o,f){E(o,t,f),s(t,l),s(l,i)},p(o,f){f&1&&n!==(n=Ge(o[0],80)+"")&&C(i,n)},d(o){o&&T(t)}}}function Ig(e){let t,l,n,i,o,f,r,c,a=e[0]=="esp8266"&&wd(e),m=e[0]=="esp32"&&Md(e),p=e[0]=="esp32s2"&&Sd(e),v=e[0]=="esp32c3"&&Cd(e),d=e[0]=="esp32solo"&&Nd(e),h=e[0]=="esp32s3"&&Td(e);return{c(){t=_("option"),l=b(),a&&a.c(),n=b(),m&&m.c(),i=b(),p&&p.c(),o=b(),v&&v.c(),f=b(),d&&d.c(),r=b(),h&&h.c(),c=Ut(),t.__value=-1,t.value=t.__value},m(g,M){E(g,t,M),E(g,l,M),a&&a.m(g,M),E(g,n,M),m&&m.m(g,M),E(g,i,M),p&&p.m(g,M),E(g,o,M),v&&v.m(g,M),E(g,f,M),d&&d.m(g,M),E(g,r,M),h&&h.m(g,M),E(g,c,M)},p(g,[M]){g[0]=="esp8266"?a?a.p(g,M):(a=wd(g),a.c(),a.m(n.parentNode,n)):a&&(a.d(1),a=null),g[0]=="esp32"?m?m.p(g,M):(m=Md(g),m.c(),m.m(i.parentNode,i)):m&&(m.d(1),m=null),g[0]=="esp32s2"?p?p.p(g,M):(p=Sd(g),p.c(),p.m(o.parentNode,o)):p&&(p.d(1),p=null),g[0]=="esp32c3"?v?v.p(g,M):(v=Cd(g),v.c(),v.m(f.parentNode,f)):v&&(v.d(1),v=null),g[0]=="esp32solo"?d?d.p(g,M):(d=Nd(g),d.c(),d.m(r.parentNode,r)):d&&(d.d(1),d=null),g[0]=="esp32s3"?h?h.p(g,M):(h=Td(g),h.c(),h.m(c.parentNode,c)):h&&(h.d(1),h=null)},i:ze,o:ze,d(g){g&&T(t),g&&T(l),a&&a.d(g),g&&T(n),m&&m.d(g),g&&T(i),p&&p.d(g),g&&T(o),v&&v.d(g),g&&T(f),d&&d.d(g),g&&T(r),h&&h.d(g),g&&T(c)}}}function Lg(e,t,l){let{chip:n}=t;return e.$$set=i=>{"chip"in i&&l(0,n=i.chip)},[n]}class Rg extends _t{constructor(t){super(),mt(this,t,Lg,Ig,ct,{chip:0})}}function Pd(e){let t;return{c(){t=_("div"),t.textContent="WARNING: Changing this configuration will affect basic configuration of your device. Only make changes here if instructed by vendor",u(t,"class","bd-red")},m(l,n){E(l,t,n)},d(l){l&&T(t)}}}function Ed(e){let t,l,n,i,o,f,r;return f=new rf({props:{chip:e[0].chip}}),{c(){t=_("div"),l=k("HAN GPIO"),n=_("br"),i=b(),o=_("select"),Ne(f.$$.fragment),u(o,"name","vh"),u(o,"class","in-s"),u(t,"class","my-3")},m(c,a){E(c,t,a),s(t,l),s(t,n),s(t,i),s(t,o),Se(f,o,null),r=!0},p(c,a){const m={};a&1&&(m.chip=c[0].chip),f.$set(m)},i(c){r||(Q(f.$$.fragment,c),r=!0)},o(c){ee(f.$$.fragment,c),r=!1},d(c){c&&T(t),Ce(f)}}}function Fg(e){let t,l,n,i,o,f,r,c,a,m,p,v,d,h,g,M,A,I,O,L,q,U,P,F,z,G,B,R,K,y=e[0].usrcfg&&Pd();h=new Rg({props:{chip:e[0].chip}});let H=e[0].board&&e[0].board>20&&Ed(e);return G=new kl({props:{active:e[1],message:"Saving"}}),{c(){t=_("div"),l=_("div"),n=_("form"),i=_("input"),o=b(),f=_("strong"),f.textContent="Initial configuration",r=b(),y&&y.c(),c=b(),a=_("div"),m=k("Board type"),p=_("br"),v=b(),d=_("select"),Ne(h.$$.fragment),g=b(),H&&H.c(),M=b(),A=_("div"),I=_("label"),O=_("input"),L=k(" Clear all other configuration"),q=b(),U=_("div"),U.innerHTML='',P=b(),F=_("span"),F.textContent="\xA0",z=b(),Ne(G.$$.fragment),u(i,"type","hidden"),u(i,"name","v"),i.value="true",u(f,"class","text-sm"),u(d,"name","vb"),u(d,"class","in-s"),e[0].board===void 0&&Ct(()=>e[5].call(d)),u(a,"class","my-3"),u(O,"type","checkbox"),u(O,"name","vr"),O.__value="true",O.value=O.__value,u(O,"class","rounded mb-1"),u(A,"class","my-3"),u(U,"class","my-3"),u(F,"class","clear-both"),u(n,"autocomplete","off"),u(l,"class","cnt"),u(t,"class","grid xl:grid-cols-4 lg:grid-cols-3 md:grid-cols-2")},m(Y,X){E(Y,t,X),s(t,l),s(l,n),s(n,i),s(n,o),s(n,f),s(n,r),y&&y.m(n,null),s(n,c),s(n,a),s(a,m),s(a,p),s(a,v),s(a,d),Se(h,d,null),Ze(d,e[0].board,!0),s(n,g),H&&H.m(n,null),s(n,M),s(n,A),s(A,I),s(I,O),O.checked=e[2],s(I,L),s(n,q),s(n,U),s(n,P),s(n,F),E(Y,z,X),Se(G,Y,X),B=!0,R||(K=[re(d,"change",e[5]),re(O,"change",e[6]),re(n,"submit",fs(e[3]))],R=!0)},p(Y,[X]){Y[0].usrcfg?y||(y=Pd(),y.c(),y.m(n,c)):y&&(y.d(1),y=null);const J={};X&1&&(J.chip=Y[0].chip),h.$set(J),X&1&&Ze(d,Y[0].board),Y[0].board&&Y[0].board>20?H?(H.p(Y,X),X&1&&Q(H,1)):(H=Ed(Y),H.c(),Q(H,1),H.m(n,M)):H&&(pt(),ee(H,1,1,()=>{H=null}),dt()),X&4&&(O.checked=Y[2]);const $={};X&2&&($.active=Y[1]),G.$set($)},i(Y){B||(Q(h.$$.fragment,Y),Q(H),Q(G.$$.fragment,Y),B=!0)},o(Y){ee(h.$$.fragment,Y),ee(H),ee(G.$$.fragment,Y),B=!1},d(Y){Y&&T(t),y&&y.d(),Ce(h),H&&H.d(),Y&&T(z),Ce(G,Y),R=!1,Et(K)}}}function Bg(e,t,l){let{basepath:n="/"}=t,{sysinfo:i={}}=t,o=!1;async function f(m){l(1,o=!0);const p=new FormData(m.target),v=new URLSearchParams;for(let g of p){const[M,A]=g;v.append(M,A)}let h=await(await fetch("save",{method:"POST",body:v})).json();l(1,o=!1),wl.update(g=>(g.vndcfg=h.success,g.booting=h.reboot,g.if.eth=g.boardType>240&&g.boardType<250,g)),gi(n+(i.usrcfg?"/":"/setup"))}let r=!1;wl.subscribe(m=>{l(0,i=m),m.fwconsent===1&&l(2,r=!i.usrcfg)});function c(){i.board=Ft(this),l(0,i)}function a(){r=this.checked,l(2,r)}return e.$$set=m=>{"basepath"in m&&l(4,n=m.basepath),"sysinfo"in m&&l(0,i=m.sysinfo)},[i,o,r,f,n,c,a]}class Ug extends _t{constructor(t){super(),mt(this,t,Bg,Fg,ct,{basepath:4,sysinfo:0})}}function Ad(e){var i,o,f;let t,l=((f=(o=(i=e[1].conf)==null?void 0:i.connection)==null?void 0:o.eth)!=null?f:"Ethernet")+"",n;return{c(){t=_("option"),n=k(l),t.__value=3,t.value=t.__value},m(r,c){E(r,t,c),s(t,n)},p(r,c){var a,m,p;c&2&&l!==(l=((p=(m=(a=r[1].conf)==null?void 0:a.connection)==null?void 0:m.eth)!=null?p:"Ethernet")+"")&&C(n,l)},d(r){r&&T(t)}}}function Dd(e){var M,A,I,O,L,q;let t,l=((I=(A=(M=e[1].conf)==null?void 0:M.connection)==null?void 0:A.ssid)!=null?I:"SSID")+"",n,i,o,f,r,c,a,m=((q=(L=(O=e[1].conf)==null?void 0:O.connection)==null?void 0:L.psk)!=null?q:"Password")+"",p,v,d,h,g;return{c(){t=_("div"),n=k(l),i=_("br"),o=b(),f=_("input"),c=b(),a=_("div"),p=k(m),v=_("br"),d=b(),h=_("input"),u(f,"name","ss"),u(f,"type","text"),u(f,"class","in-s"),f.required=r=e[3]==1||e[3]==2,u(t,"class","my-3"),u(h,"name","sp"),u(h,"type","password"),u(h,"class","in-s"),u(h,"autocomplete","off"),h.required=g=e[3]==2,u(a,"class","my-3")},m(U,P){E(U,t,P),s(t,n),s(t,i),s(t,o),s(t,f),E(U,c,P),E(U,a,P),s(a,p),s(a,v),s(a,d),s(a,h)},p(U,P){var F,z,G,B,R,K;P&2&&l!==(l=((G=(z=(F=U[1].conf)==null?void 0:F.connection)==null?void 0:z.ssid)!=null?G:"SSID")+"")&&C(n,l),P&8&&r!==(r=U[3]==1||U[3]==2)&&(f.required=r),P&2&&m!==(m=((K=(R=(B=U[1].conf)==null?void 0:B.connection)==null?void 0:R.psk)!=null?K:"Password")+"")&&C(p,m),P&8&&g!==(g=U[3]==2)&&(h.required=g)},d(U){U&&T(t),U&&T(c),U&&T(a)}}}function qd(e){let t,l,n,i,o,f,r,c;return r=new Wv({}),{c(){t=_("br"),l=b(),n=_("div"),i=_("input"),o=b(),f=_("select"),Ne(r.$$.fragment),u(i,"name","si"),u(i,"type","text"),u(i,"class","in-f w-full"),i.required=e[2],u(f,"name","su"),u(f,"class","in-l"),f.required=e[2],u(n,"class","flex")},m(a,m){E(a,t,m),E(a,l,m),E(a,n,m),s(n,i),s(n,o),s(n,f),Se(r,f,null),c=!0},p(a,m){(!c||m&4)&&(i.required=a[2]),(!c||m&4)&&(f.required=a[2])},i(a){c||(Q(r.$$.fragment,a),c=!0)},o(a){ee(r.$$.fragment,a),c=!1},d(a){a&&T(t),a&&T(l),a&&T(n),Ce(r)}}}function Od(e){var g,M,A,I,O,L;let t,l,n=((A=(M=(g=e[1].conf)==null?void 0:g.network)==null?void 0:M.gw)!=null?A:"Gateway")+"",i,o,f,r,c,a,m=((L=(O=(I=e[1].conf)==null?void 0:I.network)==null?void 0:O.dns)!=null?L:"DNS")+"",p,v,d,h;return{c(){t=_("div"),l=_("div"),i=k(n),o=_("br"),f=b(),r=_("input"),c=b(),a=_("div"),p=k(m),v=_("br"),d=b(),h=_("input"),u(r,"name","sg"),u(r,"type","text"),u(r,"class","in-f w-full"),u(h,"name","sd"),u(h,"type","text"),u(h,"class","in-l w-full"),u(t,"class","my-3 flex")},m(q,U){E(q,t,U),s(t,l),s(l,i),s(l,o),s(l,f),s(l,r),s(t,c),s(t,a),s(a,p),s(a,v),s(a,d),s(a,h)},p(q,U){var P,F,z,G,B,R;U&2&&n!==(n=((z=(F=(P=q[1].conf)==null?void 0:P.network)==null?void 0:F.gw)!=null?z:"Gateway")+"")&&C(i,n),U&2&&m!==(m=((R=(B=(G=q[1].conf)==null?void 0:G.network)==null?void 0:B.dns)!=null?R:"DNS")+"")&&C(p,m)},d(q){q&&T(t)}}}function jg(e){var j,te,le,fe,de,qe,Pe,we,Fe,Ae,ke,De,He,Oe,je,Qe,We,Je,$e,tt;let t,l,n,i,o,f,r=((te=(j=e[1].setup)==null?void 0:j.title)!=null?te:"Setup")+"",c,a,m,p=((de=(fe=(le=e[1].conf)==null?void 0:le.connection)==null?void 0:fe.title)!=null?de:"Connection")+"",v,d,h,g,M,A=((we=(Pe=(qe=e[1].conf)==null?void 0:qe.connection)==null?void 0:Pe.wifi)!=null?we:"Connect to WiFi")+"",I,O,L=((ke=(Ae=(Fe=e[1].conf)==null?void 0:Fe.connection)==null?void 0:Ae.ap)!=null?ke:"Standalone access point")+"",q,U,P,F,z=((Oe=(He=(De=e[1].conf)==null?void 0:De.general)==null?void 0:He.hostname)!=null?Oe:"Hostname")+"",G,B,R,K,y,H,Y,X,J=((Qe=(je=e[1].setup)==null?void 0:je.static)!=null?Qe:"Static IP")+"",$,ce,ie,oe,ae,se,x=((Je=(We=e[1].btn)==null?void 0:We.save)!=null?Je:"Save")+"",_e,pe,V,Z,ge,ve,S=e[0].if&&e[0].if.eth&&Ad(e),w=(e[3]==1||e[3]==2)&&Dd(e),N=e[2]&&qd(e),D=e[2]&&Od(e);return V=new kl({props:{active:e[4],message:(tt=($e=e[1].setup)==null?void 0:$e.mask)!=null?tt:"Saving"}}),{c(){t=_("div"),l=_("div"),n=_("form"),i=_("input"),o=b(),f=_("strong"),c=k(r),a=b(),m=_("div"),v=k(p),d=_("br"),h=b(),g=_("select"),M=_("option"),I=k(A),O=_("option"),q=k(L),S&&S.c(),U=b(),w&&w.c(),P=b(),F=_("div"),G=k(z),B=b(),R=_("input"),K=b(),y=_("div"),H=_("label"),Y=_("input"),X=b(),$=k(J),ce=b(),N&&N.c(),ie=b(),D&&D.c(),oe=b(),ae=_("div"),se=_("button"),_e=k(x),pe=b(),Ne(V.$$.fragment),u(i,"type","hidden"),u(i,"name","s"),i.value="true",u(f,"class","text-sm"),M.__value=1,M.value=M.__value,O.__value=2,O.value=O.__value,u(g,"name","sc"),u(g,"class","in-s"),e[3]===void 0&&Ct(()=>e[6].call(g)),u(m,"class","my-3"),u(R,"name","sh"),u(R,"type","text"),u(R,"class","in-s"),u(R,"maxlength","32"),u(R,"pattern","[a-z0-9_-]+"),u(R,"placeholder","Optional, ex.: ams-reader"),u(R,"autocomplete","off"),u(Y,"type","checkbox"),u(Y,"name","sm"),Y.__value="static",Y.value=Y.__value,u(Y,"class","rounded mb-1"),u(y,"class","my-3"),u(se,"type","submit"),u(se,"class","btn-pri"),u(ae,"class","my-3"),u(l,"class","cnt"),u(t,"class","grid xl:grid-cols-4 lg:grid-cols-3 md:grid-cols-2")},m(Te,ue){E(Te,t,ue),s(t,l),s(l,n),s(n,i),s(n,o),s(n,f),s(f,c),s(n,a),s(n,m),s(m,v),s(m,d),s(m,h),s(m,g),s(g,M),s(M,I),s(g,O),s(O,q),S&&S.m(g,null),Ze(g,e[3],!0),s(n,U),w&&w.m(n,null),s(n,P),s(n,F),s(F,G),s(F,B),s(F,R),be(R,e[0].hostname),s(n,K),s(n,y),s(y,H),s(H,Y),Y.checked=e[2],s(H,X),s(H,$),s(y,ce),N&&N.m(y,null),s(n,ie),D&&D.m(n,null),s(n,oe),s(n,ae),s(ae,se),s(se,_e),E(Te,pe,ue),Se(V,Te,ue),Z=!0,ge||(ve=[re(g,"change",e[6]),re(R,"input",e[7]),re(Y,"change",e[8]),re(n,"submit",fs(e[5]))],ge=!0)},p(Te,[ue]){var kt,lt,wt,st,ot,xe,Nt,gt,At,Pt,Be,ye,It,vt,nt,Tt,it,at,rt,jt;(!Z||ue&2)&&r!==(r=((lt=(kt=Te[1].setup)==null?void 0:kt.title)!=null?lt:"Setup")+"")&&C(c,r),(!Z||ue&2)&&p!==(p=((ot=(st=(wt=Te[1].conf)==null?void 0:wt.connection)==null?void 0:st.title)!=null?ot:"Connection")+"")&&C(v,p),(!Z||ue&2)&&A!==(A=((gt=(Nt=(xe=Te[1].conf)==null?void 0:xe.connection)==null?void 0:Nt.wifi)!=null?gt:"Connect to WiFi")+"")&&C(I,A),(!Z||ue&2)&&L!==(L=((Be=(Pt=(At=Te[1].conf)==null?void 0:At.connection)==null?void 0:Pt.ap)!=null?Be:"Standalone access point")+"")&&C(q,L),Te[0].if&&Te[0].if.eth?S?S.p(Te,ue):(S=Ad(Te),S.c(),S.m(g,null)):S&&(S.d(1),S=null),ue&8&&Ze(g,Te[3]),Te[3]==1||Te[3]==2?w?w.p(Te,ue):(w=Dd(Te),w.c(),w.m(n,P)):w&&(w.d(1),w=null),(!Z||ue&2)&&z!==(z=((vt=(It=(ye=Te[1].conf)==null?void 0:ye.general)==null?void 0:It.hostname)!=null?vt:"Hostname")+"")&&C(G,z),ue&1&&R.value!==Te[0].hostname&&be(R,Te[0].hostname),ue&4&&(Y.checked=Te[2]),(!Z||ue&2)&&J!==(J=((Tt=(nt=Te[1].setup)==null?void 0:nt.static)!=null?Tt:"Static IP")+"")&&C($,J),Te[2]?N?(N.p(Te,ue),ue&4&&Q(N,1)):(N=qd(Te),N.c(),Q(N,1),N.m(y,null)):N&&(pt(),ee(N,1,1,()=>{N=null}),dt()),Te[2]?D?D.p(Te,ue):(D=Od(Te),D.c(),D.m(n,oe)):D&&(D.d(1),D=null),(!Z||ue&2)&&x!==(x=((at=(it=Te[1].btn)==null?void 0:it.save)!=null?at:"Save")+"")&&C(_e,x);const Ie={};ue&16&&(Ie.active=Te[4]),ue&2&&(Ie.message=(jt=(rt=Te[1].setup)==null?void 0:rt.mask)!=null?jt:"Saving"),V.$set(Ie)},i(Te){Z||(Q(N),Q(V.$$.fragment,Te),Z=!0)},o(Te){ee(N),ee(V.$$.fragment,Te),Z=!1},d(Te){Te&&T(t),S&&S.d(),w&&w.d(),N&&N.d(),D&&D.d(),Te&&T(pe),Ce(V,Te),ge=!1,Et(ve)}}}function Hg(e,t,l){let n={};Ml.subscribe(d=>{l(1,n=d)});let{sysinfo:i={}}=t,o=!1,f=1,r=!1;function c(d){wl.update(h=>(h.trying=d,h))}async function a(d){l(4,r=!0);const h=new FormData(d.target),g=new URLSearchParams;for(let I of h){const[O,L]=I;g.append(O,L)}let A=await(await fetch("save",{method:"POST",body:g})).json();l(4,r=!1),wl.update(I=>(I.hostname=h.get("sh"),I.usrcfg=A.success,I.booting=A.reboot,o&&(I.net.ip=h.get("si"),I.net.mask=h.get("su"),I.net.gw=h.get("sg"),I.net.dns1=h.get("sd")),A.reboot&&setTimeout(Fs,5e3,i,c),I))}function m(){f=Ft(this),l(3,f)}function p(){i.hostname=this.value,l(0,i)}function v(){o=this.checked,l(2,o)}return e.$$set=d=>{"sysinfo"in d&&l(0,i=d.sysinfo)},[i,n,o,f,r,a,m,p,v]}class yg extends _t{constructor(t){super(),mt(this,t,Hg,jg,ct,{sysinfo:0})}}function zg(e){var G,B,R,K,y,H,Y,X;let t,l,n,i=((B=(G=e[2].upload)==null?void 0:G.title)!=null?B:"Upload")+"",o,f,r,c,a,m=((K=(R=e[2].upload)==null?void 0:R.desc)!=null?K:"")+"",p,v,d,h,g,M,A,I,O=((H=(y=e[2].btn)==null?void 0:y.upload)!=null?H:"Upload")+"",L,q,U,P,F,z;return U=new kl({props:{active:e[3],message:(X=(Y=e[2].upload)==null?void 0:Y.mask)!=null?X:"Uploading"}}),{c(){t=_("div"),l=_("div"),n=_("strong"),o=k(i),f=b(),r=k(e[1]),c=b(),a=_("p"),p=k(m),v=b(),d=_("form"),h=_("input"),g=b(),M=_("div"),A=_("button"),I=_("p"),L=k(O),q=b(),Ne(U.$$.fragment),u(a,"class","mb-4"),u(h,"name","file"),u(h,"type","file"),u(I,"class","mb-4"),u(A,"type","submit"),u(A,"class","btn-pri"),u(M,"class","w-full text-right mt-4"),u(d,"action",e[0]),u(d,"enctype","multipart/form-data"),u(d,"method","post"),u(d,"autocomplete","off"),u(l,"class","cnt"),u(t,"class","grid xl:grid-cols-4 lg:grid-cols-2 md:grid-cols-2")},m(J,$){E(J,t,$),s(t,l),s(l,n),s(n,o),s(n,f),s(n,r),s(l,c),s(l,a),s(a,p),s(l,v),s(l,d),s(d,h),s(d,g),s(d,M),s(M,A),s(A,I),s(I,L),E(J,q,$),Se(U,J,$),P=!0,F||(z=re(d,"submit",e[4]),F=!0)},p(J,[$]){var ie,oe,ae,se,x,_e,pe,V;(!P||$&4)&&i!==(i=((oe=(ie=J[2].upload)==null?void 0:ie.title)!=null?oe:"Upload")+"")&&C(o,i),(!P||$&2)&&C(r,J[1]),(!P||$&4)&&m!==(m=((se=(ae=J[2].upload)==null?void 0:ae.desc)!=null?se:"")+"")&&C(p,m),(!P||$&4)&&O!==(O=((_e=(x=J[2].btn)==null?void 0:x.upload)!=null?_e:"Upload")+"")&&C(L,O),(!P||$&1)&&u(d,"action",J[0]);const ce={};$&8&&(ce.active=J[3]),$&4&&(ce.message=(V=(pe=J[2].upload)==null?void 0:pe.mask)!=null?V:"Uploading"),U.$set(ce)},i(J){P||(Q(U.$$.fragment,J),P=!0)},o(J){ee(U.$$.fragment,J),P=!1},d(J){J&&T(t),J&&T(q),Ce(U,J),F=!1,z()}}}function Wg(e,t,l){let{action:n}=t,{title:i}=t,o={};Ml.subscribe(c=>{l(2,o=c)});let f=!1;const r=()=>l(3,f=!0);return e.$$set=c=>{"action"in c&&l(0,n=c.action),"title"in c&&l(1,i=c.title)},[n,i,o,f,r]}class Af extends _t{constructor(t){super(),mt(this,t,Wg,zg,ct,{action:0,title:1})}}function Gg(e){var V,Z,ge,ve,S,w,N,D,j,te,le,fe,de,qe;let t,l,n,i,o=((Z=(V=e[1].consent)==null?void 0:V.title)!=null?Z:"Consents")+"",f,r,c,a,m,p=((ve=(ge=e[1].consent)==null?void 0:ge.one_click)!=null?ve:"One-click")+"",v,d,h,g,M=((w=(S=e[1].consent)==null?void 0:S.read_more)!=null?w:"Read more")+"",A,I,O,L,q,U,P,F=((D=(N=e[1].consent)==null?void 0:N.yes)!=null?D:"Yes")+"",z,G,B,R,K,y,H=((te=(j=e[1].consent)==null?void 0:j.no)!=null?te:"No")+"",Y,X,J,$,ce,ie=((fe=(le=e[1].btn)==null?void 0:le.save)!=null?fe:"Save")+"",oe,ae,se,x,_e,pe;return se=new kl({props:{active:e[2],message:(qe=(de=e[1].consent)==null?void 0:de.mask_saving)!=null?qe:"Saving"}}),{c(){t=_("div"),l=_("div"),n=_("form"),i=_("div"),f=k(o),r=b(),c=_("hr"),a=b(),m=_("div"),v=k(p),d=_("br"),h=b(),g=_("a"),A=k(M),I=_("br"),O=b(),L=_("label"),q=_("input"),P=b(),z=k(F),G=b(),B=_("label"),R=_("input"),y=b(),Y=k(H),X=_("br"),J=b(),$=_("div"),ce=_("button"),oe=k(ie),ae=b(),Ne(se.$$.fragment),u(g,"href",zl("Data-collection-on-one-click-firmware-upgrade")),u(g,"target","_blank"),u(g,"class","text-blue-600 hover:text-blue-800"),u(q,"type","radio"),u(q,"name","sf"),q.value=1,q.checked=U=e[0].fwconsent===1,u(q,"class","rounded m-2"),q.required=!0,u(R,"type","radio"),u(R,"name","sf"),R.value=2,R.checked=K=e[0].fwconsent===2,u(R,"class","rounded m-2"),R.required=!0,u(m,"class","my-3"),u(ce,"type","submit"),u(ce,"class","btn-pri"),u($,"class","my-3"),u(n,"autocomplete","off"),u(l,"class","cnt"),u(t,"class","grid xl:grid-cols-3 lg:grid-cols-2")},m(Pe,we){E(Pe,t,we),s(t,l),s(l,n),s(n,i),s(i,f),s(n,r),s(n,c),s(n,a),s(n,m),s(m,v),s(m,d),s(m,h),s(m,g),s(g,A),s(m,I),s(m,O),s(m,L),s(L,q),s(L,P),s(L,z),s(m,G),s(m,B),s(B,R),s(B,y),s(B,Y),s(m,X),s(n,J),s(n,$),s($,ce),s(ce,oe),E(Pe,ae,we),Se(se,Pe,we),x=!0,_e||(pe=re(n,"submit",fs(e[3])),_e=!0)},p(Pe,[we]){var Ae,ke,De,He,Oe,je,Qe,We,Je,$e,tt,Te,ue,Ie;(!x||we&2)&&o!==(o=((ke=(Ae=Pe[1].consent)==null?void 0:Ae.title)!=null?ke:"Consents")+"")&&C(f,o),(!x||we&2)&&p!==(p=((He=(De=Pe[1].consent)==null?void 0:De.one_click)!=null?He:"One-click")+"")&&C(v,p),(!x||we&2)&&M!==(M=((je=(Oe=Pe[1].consent)==null?void 0:Oe.read_more)!=null?je:"Read more")+"")&&C(A,M),(!x||we&1&&U!==(U=Pe[0].fwconsent===1))&&(q.checked=U),(!x||we&2)&&F!==(F=((We=(Qe=Pe[1].consent)==null?void 0:Qe.yes)!=null?We:"Yes")+"")&&C(z,F),(!x||we&1&&K!==(K=Pe[0].fwconsent===2))&&(R.checked=K),(!x||we&2)&&H!==(H=(($e=(Je=Pe[1].consent)==null?void 0:Je.no)!=null?$e:"No")+"")&&C(Y,H),(!x||we&2)&&ie!==(ie=((Te=(tt=Pe[1].btn)==null?void 0:tt.save)!=null?Te:"Save")+"")&&C(oe,ie);const Fe={};we&4&&(Fe.active=Pe[2]),we&2&&(Fe.message=(Ie=(ue=Pe[1].consent)==null?void 0:ue.mask_saving)!=null?Ie:"Saving"),se.$set(Fe)},i(Pe){x||(Q(se.$$.fragment,Pe),x=!0)},o(Pe){ee(se.$$.fragment,Pe),x=!1},d(Pe){Pe&&T(t),Pe&&T(ae),Ce(se,Pe),_e=!1,pe()}}}function Vg(e,t,l){let{basepath:n="/"}=t,{sysinfo:i={}}=t,o={};Ml.subscribe(c=>{l(1,o=c)});let f=!1;async function r(c){l(2,f=!0);const a=new FormData(c.target),m=new URLSearchParams;for(let d of a){const[h,g]=d;m.append(h,g)}let v=await(await fetch("save",{method:"POST",body:m})).json();l(2,f=!1),wl.update(d=>(d.fwconsent=a.sf===!0?1:a.sf===!1?2:0,d.booting=v.reboot,d)),gi(n)}return e.$$set=c=>{"basepath"in c&&l(4,n=c.basepath),"sysinfo"in c&&l(0,i=c.sysinfo)},[i,o,f,r,n]}class Kg extends _t{constructor(t){super(),mt(this,t,Vg,Gg,ct,{basepath:4,sysinfo:0})}}function Id(e,t,l){const n=e.slice();return n[24]=t[l],n[25]=t,n[26]=l,n}function Ld(e,t,l){const n=e.slice();return n[27]=t[l],n[29]=l,n}function Yg(e,t,l){const n=e.slice();return n[27]=t[l],n[29]=l,n}function Rd(e,t,l){const n=e.slice();return n[27]=t[l],n[29]=l,n}function Qg(e,t,l){const n=e.slice();return n[27]=t[l],n[29]=l,n}function Fd(e,t,l){const n=e.slice();return n[27]=t[l],n[29]=l,n}function Bd(e,t,l){const n=e.slice();return n[27]=t[l],n[29]=l,n}function Ud(e,t,l){const n=e.slice();return n[27]=t[l],n[29]=l,n}function jd(e,t,l){const n=e.slice();return n[27]=t[l],n[29]=l,n}function Hd(e){let t,l=e[1].o,n=[];for(let i=0;i{l(0,i=B)});let o=["mo","tu","we","th","fr","sa","su"],f={},r=!0,c=!1;zv.subscribe(B=>{B.o&&(l(1,f=B),l(2,r=!1))}),F4();async function a(B){l(3,c=!0);const R=new URLSearchParams;R.append("r","true"),R.append("rc",f.o.length),f.o.forEach(function(y,H){R.append("rt"+H,y.t),R.append("rn"+H,y.n),R.append("rd"+H,y.d),R.append("ra"+H,y.a),R.append("rh"+H,y.h),R.append("rv"+H,y.v),R.append("rsm"+H,y.s.m),R.append("rsd"+H,y.s.d),R.append("rem"+H,y.e.m),R.append("red"+H,y.e.d)}),await(await fetch("save",{method:"POST",body:R})).json(),l(3,c=!1),gi(n+"configuration")}let m=function(B,R){return B.includes(R)?B=B.filter(function(K){return K!==R}):B.push(R),B},p=function(){let B=f.o;B.push({t:1,n:"",d:3,a:[0,1,2,3,4,5,6,7],h:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23],v:.001,s:{m:0,d:0},e:{m:0,d:0}}),l(1,f.o=B,f)},v=function(B){let R=f.o;R.splice(B,1),l(1,f.o=R,f)};function d(B,R){B[R].n=this.value,l(1,f)}function h(B,R){B[R].d=Ft(this),l(1,f)}function g(B,R){B[R].t=Ft(this),l(1,f)}function M(B,R){B[R].v=Xe(this.value),l(1,f)}const A=(B,R,K,y)=>l(1,K[y].a=m(B.a,R),f),I=(B,R,K,y)=>l(1,K[y].h=m(B.h,R),f),O=(B,R,K,y)=>l(1,K[y].h=m(B.h,R+8),f),L=(B,R,K,y)=>l(1,K[y].h=m(B.h,R+16),f);function q(B,R){B[R].s.m=Ft(this),l(1,f)}function U(B,R){B[R].s.d=Ft(this),l(1,f)}function P(B,R){B[R].e.m=Ft(this),l(1,f)}function F(B,R){B[R].e.d=Ft(this),l(1,f)}const z=B=>v(B),G=B=>v(B);return e.$$set=B=>{"basepath"in B&&l(9,n=B.basepath)},[i,f,r,c,o,a,m,p,v,n,d,h,g,M,A,I,O,L,q,U,P,F,z,G]}class xg extends _t{constructor(t){super(),mt(this,t,$g,Jg,ct,{basepath:9},null,[-1,-1])}}function e3(e){let t,l;return t=new L4({props:{data:e[2],sysinfo:e[1]}}),{c(){Ne(t.$$.fragment)},m(n,i){Se(t,n,i),l=!0},p(n,i){const o={};i&4&&(o.data=n[2]),i&2&&(o.sysinfo=n[1]),t.$set(o)},i(n){l||(Q(t.$$.fragment,n),l=!0)},o(n){ee(t.$$.fragment,n),l=!1},d(n){Ce(t,n)}}}function t3(e){let t,l;return t=new kg({props:{sysinfo:e[1],basepath:e[0]}}),{c(){Ne(t.$$.fragment)},m(n,i){Se(t,n,i),l=!0},p(n,i){const o={};i&2&&(o.sysinfo=n[1]),i&1&&(o.basepath=n[0]),t.$set(o)},i(n){l||(Q(t.$$.fragment,n),l=!0)},o(n){ee(t.$$.fragment,n),l=!1},d(n){Ce(t,n)}}}function l3(e){let t,l;return t=new xg({props:{basepath:e[0]}}),{c(){Ne(t.$$.fragment)},m(n,i){Se(t,n,i),l=!0},p(n,i){const o={};i&1&&(o.basepath=n[0]),t.$set(o)},i(n){l||(Q(t.$$.fragment,n),l=!0)},o(n){ee(t.$$.fragment,n),l=!1},d(n){Ce(t,n)}}}function n3(e){let t,l;return t=new Og({props:{sysinfo:e[1],data:e[2]}}),{c(){Ne(t.$$.fragment)},m(n,i){Se(t,n,i),l=!0},p(n,i){const o={};i&2&&(o.sysinfo=n[1]),i&4&&(o.data=n[2]),t.$set(o)},i(n){l||(Q(t.$$.fragment,n),l=!0)},o(n){ee(t.$$.fragment,n),l=!1},d(n){Ce(t,n)}}}function i3(e){let t,l;return t=new Af({props:{title:"CA",action:"/mqtt-ca"}}),{c(){Ne(t.$$.fragment)},m(n,i){Se(t,n,i),l=!0},p:ze,i(n){l||(Q(t.$$.fragment,n),l=!0)},o(n){ee(t.$$.fragment,n),l=!1},d(n){Ce(t,n)}}}function s3(e){let t,l;return t=new Af({props:{title:"certificate",action:"/mqtt-cert"}}),{c(){Ne(t.$$.fragment)},m(n,i){Se(t,n,i),l=!0},p:ze,i(n){l||(Q(t.$$.fragment,n),l=!0)},o(n){ee(t.$$.fragment,n),l=!1},d(n){Ce(t,n)}}}function o3(e){let t,l;return t=new Af({props:{title:"private key",action:"/mqtt-key"}}),{c(){Ne(t.$$.fragment)},m(n,i){Se(t,n,i),l=!0},p:ze,i(n){l||(Q(t.$$.fragment,n),l=!0)},o(n){ee(t.$$.fragment,n),l=!1},d(n){Ce(t,n)}}}function a3(e){let t,l;return t=new Kg({props:{sysinfo:e[1],basepath:e[0]}}),{c(){Ne(t.$$.fragment)},m(n,i){Se(t,n,i),l=!0},p(n,i){const o={};i&2&&(o.sysinfo=n[1]),i&1&&(o.basepath=n[0]),t.$set(o)},i(n){l||(Q(t.$$.fragment,n),l=!0)},o(n){ee(t.$$.fragment,n),l=!1},d(n){Ce(t,n)}}}function f3(e){let t,l;return t=new yg({props:{sysinfo:e[1]}}),{c(){Ne(t.$$.fragment)},m(n,i){Se(t,n,i),l=!0},p(n,i){const o={};i&2&&(o.sysinfo=n[1]),t.$set(o)},i(n){l||(Q(t.$$.fragment,n),l=!0)},o(n){ee(t.$$.fragment,n),l=!1},d(n){Ce(t,n)}}}function u3(e){let t,l;return t=new Ug({props:{sysinfo:e[1],basepath:e[0]}}),{c(){Ne(t.$$.fragment)},m(n,i){Se(t,n,i),l=!0},p(n,i){const o={};i&2&&(o.sysinfo=n[1]),i&1&&(o.basepath=n[0]),t.$set(o)},i(n){l||(Q(t.$$.fragment,n),l=!0)},o(n){ee(t.$$.fragment,n),l=!1},d(n){Ce(t,n)}}}function r3(e){let t,l,n,i,o,f,r,c,a,m,p,v,d,h,g,M,A,I,O,L,q,U;return t=new Kb({props:{data:e[2],basepath:e[0]}}),n=new Cn({props:{path:"/",$$slots:{default:[e3]},$$scope:{ctx:e}}}),o=new Cn({props:{path:"/configuration",$$slots:{default:[t3]},$$scope:{ctx:e}}}),r=new Cn({props:{path:"/priceconfig",$$slots:{default:[l3]},$$scope:{ctx:e}}}),a=new Cn({props:{path:"/status",$$slots:{default:[n3]},$$scope:{ctx:e}}}),p=new Cn({props:{path:"/mqtt-ca",$$slots:{default:[i3]},$$scope:{ctx:e}}}),d=new Cn({props:{path:"/mqtt-cert",$$slots:{default:[s3]},$$scope:{ctx:e}}}),g=new Cn({props:{path:"/mqtt-key",$$slots:{default:[o3]},$$scope:{ctx:e}}}),A=new Cn({props:{path:"/consent",$$slots:{default:[a3]},$$scope:{ctx:e}}}),O=new Cn({props:{path:"/setup",$$slots:{default:[f3]},$$scope:{ctx:e}}}),q=new Cn({props:{path:"/vendor",$$slots:{default:[u3]},$$scope:{ctx:e}}}),{c(){Ne(t.$$.fragment),l=b(),Ne(n.$$.fragment),i=b(),Ne(o.$$.fragment),f=b(),Ne(r.$$.fragment),c=b(),Ne(a.$$.fragment),m=b(),Ne(p.$$.fragment),v=b(),Ne(d.$$.fragment),h=b(),Ne(g.$$.fragment),M=b(),Ne(A.$$.fragment),I=b(),Ne(O.$$.fragment),L=b(),Ne(q.$$.fragment)},m(P,F){Se(t,P,F),E(P,l,F),Se(n,P,F),E(P,i,F),Se(o,P,F),E(P,f,F),Se(r,P,F),E(P,c,F),Se(a,P,F),E(P,m,F),Se(p,P,F),E(P,v,F),Se(d,P,F),E(P,h,F),Se(g,P,F),E(P,M,F),Se(A,P,F),E(P,I,F),Se(O,P,F),E(P,L,F),Se(q,P,F),U=!0},p(P,F){const z={};F&4&&(z.data=P[2]),F&1&&(z.basepath=P[0]),t.$set(z);const G={};F&22&&(G.$$scope={dirty:F,ctx:P}),n.$set(G);const B={};F&19&&(B.$$scope={dirty:F,ctx:P}),o.$set(B);const R={};F&17&&(R.$$scope={dirty:F,ctx:P}),r.$set(R);const K={};F&22&&(K.$$scope={dirty:F,ctx:P}),a.$set(K);const y={};F&16&&(y.$$scope={dirty:F,ctx:P}),p.$set(y);const H={};F&16&&(H.$$scope={dirty:F,ctx:P}),d.$set(H);const Y={};F&16&&(Y.$$scope={dirty:F,ctx:P}),g.$set(Y);const X={};F&19&&(X.$$scope={dirty:F,ctx:P}),A.$set(X);const J={};F&18&&(J.$$scope={dirty:F,ctx:P}),O.$set(J);const $={};F&19&&($.$$scope={dirty:F,ctx:P}),q.$set($)},i(P){U||(Q(t.$$.fragment,P),Q(n.$$.fragment,P),Q(o.$$.fragment,P),Q(r.$$.fragment,P),Q(a.$$.fragment,P),Q(p.$$.fragment,P),Q(d.$$.fragment,P),Q(g.$$.fragment,P),Q(A.$$.fragment,P),Q(O.$$.fragment,P),Q(q.$$.fragment,P),U=!0)},o(P){ee(t.$$.fragment,P),ee(n.$$.fragment,P),ee(o.$$.fragment,P),ee(r.$$.fragment,P),ee(a.$$.fragment,P),ee(p.$$.fragment,P),ee(d.$$.fragment,P),ee(g.$$.fragment,P),ee(A.$$.fragment,P),ee(O.$$.fragment,P),ee(q.$$.fragment,P),U=!1},d(P){Ce(t,P),P&&T(l),Ce(n,P),P&&T(i),Ce(o,P),P&&T(f),Ce(r,P),P&&T(c),Ce(a,P),P&&T(m),Ce(p,P),P&&T(v),Ce(d,P),P&&T(h),Ce(g,P),P&&T(M),Ce(A,P),P&&T(I),Ce(O,P),P&&T(L),Ce(q,P)}}}function c3(e){let t,l,n,i;const o=[p3,_3],f=[];function r(c,a){return c[1].trying?0:1}return t=r(e),l=f[t]=o[t](e),{c(){l.c(),n=Ut()},m(c,a){f[t].m(c,a),E(c,n,a),i=!0},p(c,a){let m=t;t=r(c),t===m?f[t].p(c,a):(pt(),ee(f[m],1,1,()=>{f[m]=null}),dt(),l=f[t],l?l.p(c,a):(l=f[t]=o[t](c),l.c()),Q(l,1),l.m(n.parentNode,n))},i(c){i||(Q(l),i=!0)},o(c){ee(l),i=!1},d(c){f[t].d(c),c&&T(n)}}}function m3(e){let t,l;return t=new kl({props:{active:"true",message:"Device is upgrading, please wait"}}),{c(){Ne(t.$$.fragment)},m(n,i){Se(t,n,i),l=!0},p:ze,i(n){l||(Q(t.$$.fragment,n),l=!0)},o(n){ee(t.$$.fragment,n),l=!1},d(n){Ce(t,n)}}}function _3(e){let t,l;return t=new kl({props:{active:"true",message:"Device is booting, please wait"}}),{c(){Ne(t.$$.fragment)},m(n,i){Se(t,n,i),l=!0},p:ze,i(n){l||(Q(t.$$.fragment,n),l=!0)},o(n){ee(t.$$.fragment,n),l=!1},d(n){Ce(t,n)}}}function p3(e){let t,l;return t=new kl({props:{active:"true",message:"Device is booting, please wait. Trying to reach it on "+e[1].trying}}),{c(){Ne(t.$$.fragment)},m(n,i){Se(t,n,i),l=!0},p(n,i){const o={};i&2&&(o.message="Device is booting, please wait. Trying to reach it on "+n[1].trying),t.$set(o)},i(n){l||(Q(t.$$.fragment,n),l=!0)},o(n){ee(t.$$.fragment,n),l=!1},d(n){Ce(t,n)}}}function d3(e){let t,l,n,i,o,f;l=new wv({props:{basepath:e[0],$$slots:{default:[r3]},$$scope:{ctx:e}}});const r=[m3,c3],c=[];function a(m,p){return m[1].upgrading?0:m[1].booting?1:-1}return~(i=a(e))&&(o=c[i]=r[i](e)),{c(){t=_("div"),Ne(l.$$.fragment),n=b(),o&&o.c(),u(t,"class","container mx-auto m-3")},m(m,p){E(m,t,p),Se(l,t,null),s(t,n),~i&&c[i].m(t,null),f=!0},p(m,[p]){const v={};p&1&&(v.basepath=m[0]),p&23&&(v.$$scope={dirty:p,ctx:m}),l.$set(v);let d=i;i=a(m),i===d?~i&&c[i].p(m,p):(o&&(pt(),ee(c[d],1,1,()=>{c[d]=null}),dt()),~i?(o=c[i],o?o.p(m,p):(o=c[i]=r[i](m),o.c()),Q(o,1),o.m(t,null)):o=null)},i(m){f||(Q(l.$$.fragment,m),Q(o),f=!0)},o(m){ee(l.$$.fragment,m),ee(o),f=!1},d(m){m&&T(t),Ce(l),~i&&c[i].d()}}}function v3(e,t,l){let n=document.getElementsByTagName("base")[0].getAttribute("href");n||(n="/");let i={};Ml.subscribe(r=>{i=r});let o={};wl.subscribe(r=>{var c;l(1,o=r),o.vndcfg===!1?gi(n+"vendor"):o.usrcfg===!1?gi(n+"setup"):o.fwconsent===0&&gi(n+"consent"),o.ui.k===1?document.documentElement.classList.add("dark"):o.ui.k===0?document.documentElement.classList.remove("dark"):window.matchMedia("(prefers-color-scheme: dark)").matches?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark"),o.ui.lang&&o.ui.lang!=((c=i==null?void 0:i.language)==null?void 0:c.code)&&Bv(o.ui.lang)}),Sf();let f={};return Pv.subscribe(r=>{l(2,f=r)}),[n,o,f]}class h3 extends _t{constructor(t){super(),mt(this,t,v3,d3,ct,{})}}new h3({target:document.getElementById("app")}); diff --git a/lib/SvelteUi/app/src/lib/Helpers.js b/lib/SvelteUi/app/src/lib/Helpers.js index 89be90e5..40167572 100644 --- a/lib/SvelteUi/app/src/lib/Helpers.js +++ b/lib/SvelteUi/app/src/lib/Helpers.js @@ -211,7 +211,7 @@ export function formatUnit(val, unit) { } else if(val >= 1_000_000_000) { // Over 1000 M ret[0] = (val / 1_000_000).toFixed(val > 10_000_000_000 ? 0 : 1); ret[1] = "M"+unit; - } else if(val > 100_000) { // Over 100 k + } else if(val > 10_000) { // Over 10 k ret[0] = (val / 1000).toFixed(val > 1_000_000 ? 0 : val > 100_000 ? 1 : 2); ret[1] = "k"+unit; } else { diff --git a/lib/SvelteUi/app/src/lib/RealtimePlot.svelte b/lib/SvelteUi/app/src/lib/RealtimePlot.svelte index fb918b3a..0a63fbe9 100644 --- a/lib/SvelteUi/app/src/lib/RealtimePlot.svelte +++ b/lib/SvelteUi/app/src/lib/RealtimePlot.svelte @@ -60,7 +60,6 @@ let yTicks; let xTicks; let barWidth; - let labelSpacing = 12; let unit $:{ @@ -90,7 +89,7 @@ } xTicks = []; - for(let i = min; i < realtime.size; i+=realtime.size/labelSpacing) { + for(let i = 0; i < realtime.size; i+=Math.round(realtime.size/Math.round(barWidth * 3))) { xTicks.push({ value: i, label: '-'+Math.round((realtime.size - i) / 6)+' min' @@ -140,11 +139,9 @@ {#each xTicks as point, i} {#if !isNaN(xScale(point.value))} - {#if i%Math.round(6/barWidth) == 0} - - {point.label} - - {/if} + + {point.label} + {/if} {/each}