diff --git a/lib/SvelteUi/app/dist/index.js b/lib/SvelteUi/app/dist/index.js index f4d9ae34..f8ad0ee7 100644 --- a/lib/SvelteUi/app/dist/index.js +++ b/lib/SvelteUi/app/dist/index.js @@ -4,7 +4,7 @@ Occurred in: ${i}`:"",u=vo(t),a=_c(e)?e(u):e;return`<${u}> ${a}${o}`}const Tc=t= `),o.c(),l=Ke()},m(u,a){S(u,e,a),o.m(u,a),S(u,l,a)},p(u,a){i===(i=n(u))&&o?o.p(u,a):(o.d(1),o=i(u),o&&(o.c(),o.m(l.parentNode,l)))},d(u){u&&$(e),o.d(u),u&&$(l)}}}function A0(t){let e,l;return{c(){e=E(t[0]),l=E(" seconds")},m(n,i){S(n,e,i),S(n,l,i)},p(n,i){i&1&&J(e,n[0])},d(n){n&&$(e),n&&$(l)}}}function P0(t){let e,l;return{c(){e=E(t[3]),l=E(" minute")},m(n,i){S(n,e,i),S(n,l,i)},p(n,i){i&8&&J(e,n[3])},d(n){n&&$(e),n&&$(l)}}}function D0(t){let e,l;return{c(){e=E(t[3]),l=E(" minutes")},m(n,i){S(n,e,i),S(n,l,i)},p(n,i){i&8&&J(e,n[3])},d(n){n&&$(e),n&&$(l)}}}function R0(t){let e,l;return{c(){e=E(t[2]),l=E(" hour")},m(n,i){S(n,e,i),S(n,l,i)},p(n,i){i&4&&J(e,n[2])},d(n){n&&$(e),n&&$(l)}}}function I0(t){let e,l;return{c(){e=E(t[2]),l=E(" hours")},m(n,i){S(n,e,i),S(n,l,i)},p(n,i){i&4&&J(e,n[2])},d(n){n&&$(e),n&&$(l)}}}function L0(t){let e,l;return{c(){e=E(t[1]),l=E(" day")},m(n,i){S(n,e,i),S(n,l,i)},p(n,i){i&2&&J(e,n[1])},d(n){n&&$(e),n&&$(l)}}}function O0(t){let e,l;return{c(){e=E(t[1]),l=E(" days")},m(n,i){S(n,e,i),S(n,l,i)},p(n,i){i&2&&J(e,n[1])},d(n){n&&$(e),n&&$(l)}}}function F0(t){let e,l=t[0]&&Oa(t);return{c(){l&&l.c(),e=Ke()},m(n,i){l&&l.m(n,i),S(n,e,i)},p(n,[i]){n[0]?l?l.p(n,i):(l=Oa(n),l.c(),l.m(e.parentNode,e)):l&&(l.d(1),l=null)},i:pe,o:pe,d(n){l&&l.d(n),n&&$(e)}}}function q0(t,e,l){let{epoch:n}=e,i=0,o=0,u=0;return t.$$set=a=>{"epoch"in a&&l(0,n=a.epoch)},t.$$.update=()=>{t.$$.dirty&1&&(l(1,i=Math.floor(n/86400)),l(2,o=Math.floor(n/3600)),l(3,u=Math.floor(n/60)))},[n,i,o,u]}class B0 extends Ie{constructor(e){super(),Re(this,e,q0,F0,Ee,{epoch:0})}}function U0(t){let e,l,n;return{c(){e=m("span"),l=E(t[2]),r(e,"title",t[1]),r(e,"class",n="bd-"+t[0])},m(i,o){S(i,e,o),s(e,l)},p(i,[o]){o&4&&J(l,i[2]),o&2&&r(e,"title",i[1]),o&1&&n!==(n="bd-"+i[0])&&r(e,"class",n)},i:pe,o:pe,d(i){i&&$(e)}}}function j0(t,e,l){let{color:n}=e,{title:i}=e,{text:o}=e;return t.$$set=u=>{"color"in u&&l(0,n=u.color),"title"in u&&l(1,i=u.title),"text"in u&&l(2,o=u.text)},[n,i,o]}class an extends Ie{constructor(e){super(),Re(this,e,j0,U0,Ee,{color:0,title:1,text:2})}}function H0(t){let e,l=`${Ue(t[0].getDate())}.${Ue(t[0].getMonth()+1)}.${t[0].getFullYear()} ${Ue(t[0].getHours())}:${Ue(t[0].getMinutes())}`,n;return{c(){e=m("span"),n=E(l),r(e,"class",t[1])},m(i,o){S(i,e,o),s(e,n)},p(i,o){o&1&&l!==(l=`${Ue(i[0].getDate())}.${Ue(i[0].getMonth()+1)}.${i[0].getFullYear()} ${Ue(i[0].getHours())}:${Ue(i[0].getMinutes())}`)&&J(n,l),o&2&&r(e,"class",i[1])},d(i){i&&$(e)}}}function W0(t){let e=`${Ue(t[0].getDate())}. ${Ys[t[0].getMonth()]} ${Ue(t[0].getHours())}:${Ue(t[0].getMinutes())}`,l;return{c(){l=E(e)},m(n,i){S(n,l,i)},p(n,i){i&1&&e!==(e=`${Ue(n[0].getDate())}. ${Ys[n[0].getMonth()]} ${Ue(n[0].getHours())}:${Ue(n[0].getMinutes())}`)&&J(l,e)},d(n){n&&$(l)}}}function z0(t){let e;function l(o,u){return o[2]?W0:H0}let n=l(t),i=n(t);return{c(){i.c(),e=Ke()},m(o,u){i.m(o,u),S(o,e,u)},p(o,[u]){n===(n=l(o))&&i?i.p(o,u):(i.d(1),i=n(o),i&&(i.c(),i.m(e.parentNode,e)))},i:pe,o:pe,d(o){i.d(o),o&&$(e)}}}function G0(t,e,l){let{timestamp:n}=e,{fullTimeColor:i}=e,{offset:o}=e,u;return t.$$set=a=>{"timestamp"in a&&l(0,n=a.timestamp),"fullTimeColor"in a&&l(1,i=a.fullTimeColor),"offset"in a&&l(3,o=a.offset)},t.$$.update=()=>{t.$$.dirty&9&&(l(2,u=Math.abs(new Date().getTime()-n.getTime())<3e5),isNaN(o)||dl(n,o-(24+n.getHours()-n.getUTCHours())%24))},[n,i,u,o]}class Zc extends Ie{constructor(e){super(),Re(this,e,G0,z0,Ee,{timestamp:0,fullTimeColor:1,offset:3})}}function V0(t){let e,l,n;return{c(){e=De("svg"),l=De("path"),n=De("path"),r(l,"stroke-linecap","round"),r(l,"stroke-linejoin","round"),r(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"),r(n,"stroke-linecap","round"),r(n,"stroke-linejoin","round"),r(n,"d","M15 12a3 3 0 11-6 0 3 3 0 016 0z"),r(e,"xmlns","http://www.w3.org/2000/svg"),r(e,"fill","none"),r(e,"viewBox","0 0 24 24"),r(e,"stroke-width","1.5"),r(e,"stroke","currentColor"),r(e,"class","w-6 h-6")},m(i,o){S(i,e,o),s(e,l),s(e,n)},p:pe,i:pe,o:pe,d(i){i&&$(e)}}}class K0 extends Ie{constructor(e){super(),Re(this,e,null,V0,Ee,{})}}function Y0(t){let e,l;return{c(){e=De("svg"),l=De("path"),r(l,"stroke-linecap","round"),r(l,"stroke-linejoin","round"),r(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"),r(e,"xmlns","http://www.w3.org/2000/svg"),r(e,"fill","none"),r(e,"viewBox","0 0 24 24"),r(e,"stroke-width","1.5"),r(e,"stroke","currentColor"),r(e,"class","w-6 h-6")},m(n,i){S(n,e,i),s(e,l)},p:pe,i:pe,o:pe,d(n){n&&$(e)}}}class Q0 extends Ie{constructor(e){super(),Re(this,e,null,Y0,Ee,{})}}function X0(t){let e,l;return{c(){e=De("svg"),l=De("path"),r(l,"stroke-linecap","round"),r(l,"stroke-linejoin","round"),r(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"),r(e,"xmlns","http://www.w3.org/2000/svg"),r(e,"fill","none"),r(e,"viewBox","0 0 24 24"),r(e,"stroke-width","1.5"),r(e,"stroke","currentColor"),r(e,"class","w-6 h-6")},m(n,i){S(n,e,i),s(e,l)},p:pe,i:pe,o:pe,d(n){n&&$(e)}}}class Rt extends Ie{constructor(e){super(),Re(this,e,null,X0,Ee,{})}}function Z0(t){let e,l;return{c(){e=De("svg"),l=De("path"),r(l,"stroke-linecap","round"),r(l,"stroke-linejoin","round"),r(l,"d","M9 8.25H7.5a2.25 2.25 0 00-2.25 2.25v9a2.25 2.25 0 002.25 2.25h9a2.25 2.25 0 002.25-2.25v-9a2.25 2.25 0 00-2.25-2.25H15M9 12l3 3m0 0l3-3m-3 3V2.25"),r(e,"xmlns","http://www.w3.org/2000/svg"),r(e,"fill","none"),r(e,"viewBox","0 0 24 24"),r(e,"stroke-width","1.5"),r(e,"stroke","currentColor"),r(e,"class","w-6 h-6")},m(n,i){S(n,e,i),s(e,l)},p:pe,i:pe,o:pe,d(n){n&&$(e)}}}class Jc extends Ie{constructor(e){super(),Re(this,e,null,Z0,Ee,{})}}function J0(t){let e,l,n=t[1].version+"",i;return{c(){e=E("AMS reader "),l=m("span"),i=E(n)},m(o,u){S(o,e,u),S(o,l,u),s(l,i)},p(o,u){u&2&&n!==(n=o[1].version+"")&&J(i,n)},d(o){o&&$(e),o&&$(l)}}}function Fa(t){let e,l=(t[0].t>-50?t[0].t.toFixed(1):"-")+"",n,i;return{c(){e=m("div"),n=E(l),i=E("\xB0C"),r(e,"class","flex-none my-auto")},m(o,u){S(o,e,u),s(e,n),s(e,i)},p(o,u){u&1&&l!==(l=(o[0].t>-50?o[0].t.toFixed(1):"-")+"")&&J(n,l)},d(o){o&&$(e)}}}function qa(t){let e,l="HAN: "+Ta(t[0].he),n;return{c(){e=m("div"),n=E(l),r(e,"class","bd-red")},m(i,o){S(i,e,o),s(e,n)},p(i,o){o&1&&l!==(l="HAN: "+Ta(i[0].he))&&J(n,l)},d(i){i&&$(e)}}}function Ba(t){let e,l="MQTT: "+Na(t[0].me),n;return{c(){e=m("div"),n=E(l),r(e,"class","bd-red")},m(i,o){S(i,e,o),s(e,n)},p(i,o){o&1&&l!==(l="MQTT: "+Na(i[0].me))&&J(n,l)},d(i){i&&$(e)}}}function Ua(t){let e,l="Price service: "+Ea(t[0].ee),n;return{c(){e=m("div"),n=E(l),r(e,"class","bd-red")},m(i,o){S(i,e,o),s(e,n)},p(i,o){o&1&&l!==(l="Price service: "+Ea(i[0].ee))&&J(n,l)},d(i){i&&$(e)}}}function ja(t){let e,l,n,i,o,u;return l=new Qt({props:{to:"/configuration",$$slots:{default:[x0]},$$scope:{ctx:t}}}),o=new Qt({props:{to:"/status",$$slots:{default:[em]},$$scope:{ctx:t}}}),{c(){e=m("div"),re(l.$$.fragment),n=h(),i=m("div"),re(o.$$.fragment),r(e,"class","flex-none px-1 mt-1"),r(e,"title","Configuration"),r(i,"class","flex-none px-1 mt-1"),r(i,"title","Device information")},m(a,c){S(a,e,c),ie(l,e,null),S(a,n,c),S(a,i,c),ie(o,i,null),u=!0},i(a){u||(O(l.$$.fragment,a),O(o.$$.fragment,a),u=!0)},o(a){q(l.$$.fragment,a),q(o.$$.fragment,a),u=!1},d(a){a&&$(e),se(l),a&&$(n),a&&$(i),se(o)}}}function x0(t){let e,l;return e=new K0({}),{c(){re(e.$$.fragment)},m(n,i){ie(e,n,i),l=!0},i(n){l||(O(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){se(e,n)}}}function em(t){let e,l;return e=new Q0({}),{c(){re(e.$$.fragment)},m(n,i){ie(e,n,i),l=!0},i(n){l||(O(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){se(e,n)}}}function Ha(t){let e,l,n,i,o;const u=[lm,tm],a=[];function c(f,_){return f[1].security==0||f[0].a?0:1}return l=c(t),n=a[l]=u[l](t),{c(){e=m("div"),n.c(),r(e,"class","flex-none mr-3 text-yellow-500"),r(e,"title",i="New version: "+t[2].tag_name)},m(f,_){S(f,e,_),a[l].m(e,null),o=!0},p(f,_){let p=l;l=c(f),l===p?a[l].p(f,_):(Ae(),q(a[p],1,1,()=>{a[p]=null}),Pe(),n=a[l],n?n.p(f,_):(n=a[l]=u[l](f),n.c()),O(n,1),n.m(e,null)),(!o||_&4&&i!==(i="New version: "+f[2].tag_name))&&r(e,"title",i)},i(f){o||(O(n),o=!0)},o(f){q(n),o=!1},d(f){f&&$(e),a[l].d()}}}function tm(t){let e,l,n=t[2].tag_name+"",i;return{c(){e=m("span"),l=E("New version: "),i=E(n)},m(o,u){S(o,e,u),s(e,l),s(e,i)},p(o,u){u&4&&n!==(n=o[2].tag_name+"")&&J(i,n)},i:pe,o:pe,d(o){o&&$(e)}}}function lm(t){let e,l,n,i=t[2].tag_name+"",o,u,a,c,f,_;return a=new Jc({}),{c(){e=m("button"),l=m("span"),n=E("New version: "),o=E(i),u=h(),re(a.$$.fragment),r(l,"class","mt-1"),r(e,"class","flex")},m(p,b){S(p,e,b),s(e,l),s(l,n),s(l,o),s(e,u),ie(a,e,null),c=!0,f||(_=te(e,"click",t[3]),f=!0)},p(p,b){(!c||b&4)&&i!==(i=p[2].tag_name+"")&&J(o,i)},i(p){c||(O(a.$$.fragment,p),c=!0)},o(p){q(a.$$.fragment,p),c=!1},d(p){p&&$(e),se(a),f=!1,_()}}}function nm(t){let e,l,n,i,o,u,a,c,f,_,p,b,v=(t[0].m?(t[0].m/1e3).toFixed(1):"-")+"",d,g,w,T,M,P,L,I,F,C,R,ne,H,z,U,K,Q,G,X,Y,j,x,ae,ee,V,W,we,He,Le,Se;i=new Qt({props:{to:"/",$$slots:{default:[J0]},$$scope:{ctx:t}}}),c=new B0({props:{epoch:t[0].u}});let ye=t[0].t>-50&&Fa(t);M=new an({props:{title:"ESP",text:t[1].booting?"Booting":t[0].v>2?t[0].v.toFixed(2)+"V":"ESP",color:Bl(t[1].booting?2:t[0].em)}}),L=new an({props:{title:"HAN",text:"HAN",color:Bl(t[1].booting?9:t[0].hm)}}),F=new an({props:{title:"WiFi",text:t[0].r?t[0].r.toFixed(0)+"dBm":"WiFi",color:Bl(t[1].booting?9:t[0].wm)}}),R=new an({props:{title:"MQTT",text:"MQTT",color:Bl(t[1].booting?9:t[0].mm)}});let ve=(t[0].he<0||t[0].he>0)&&qa(t),Te=t[0].me<0&&Ba(t),be=(t[0].ee>0||t[0].ee<0)&&Ua(t);ae=new Zc({props:{timestamp:t[0].c?new Date(t[0].c*1e3):new Date(0),offset:t[1].clock_offset,fullTimeColor:"text-red-500"}});let N=t[1].vndcfg&&t[1].usrcfg&&ja(t);He=new Rt({});let y=t[1].fwconsent===1&&t[2]&&Ha(t);return{c(){e=m("nav"),l=m("div"),n=m("div"),re(i.$$.fragment),o=h(),u=m("div"),a=m("div"),re(c.$$.fragment),f=h(),ye&&ye.c(),_=h(),p=m("div"),b=E("Free mem: "),d=E(v),g=E("kb"),w=h(),T=m("div"),re(M.$$.fragment),P=h(),re(L.$$.fragment),I=h(),re(F.$$.fragment),C=h(),re(R.$$.fragment),ne=h(),ve&&ve.c(),H=h(),Te&&Te.c(),z=h(),be&&be.c(),U=h(),K=m("div"),Q=m("div"),G=m("a"),X=m("img"),j=h(),x=m("div"),re(ae.$$.fragment),ee=h(),N&&N.c(),V=h(),W=m("div"),we=m("a"),re(He.$$.fragment),Le=h(),y&&y.c(),r(n,"class","flex text-lg text-gray-100 p-2"),r(a,"class","flex-none my-auto"),r(p,"class","flex-none my-auto"),r(u,"class","flex-none my-auto p-2 flex space-x-4"),r(T,"class","flex-auto flex-wrap my-auto justify-center p-2"),r(X,"class","gh-logo"),Ws(X.src,Y=E0)||r(X,"src",Y),r(X,"alt","GitHub repo"),r(G,"class","float-right"),r(G,"href","https://github.com/UtilitechAS/amsreader-firmware"),r(G,"target","_blank"),r(G,"rel","noreferrer"),r(G,"aria-label","GitHub"),r(Q,"class","flex-none"),r(x,"class","flex-none my-auto px-2"),r(we,"href",It("")),r(we,"target","_blank"),r(we,"rel","noreferrer"),r(W,"class","flex-none px-1 mt-1"),r(W,"title","Documentation"),r(K,"class","flex-auto p-2 flex flex-row-reverse flex-wrap"),r(l,"class","flex flex-wrap space-x-4 text-sm text-gray-300"),r(e,"class","bg-violet-600 p-1 rounded-md mx-2")},m(k,A){S(k,e,A),s(e,l),s(l,n),ie(i,n,null),s(l,o),s(l,u),s(u,a),ie(c,a,null),s(u,f),ye&&ye.m(u,null),s(u,_),s(u,p),s(p,b),s(p,d),s(p,g),s(l,w),s(l,T),ie(M,T,null),s(T,P),ie(L,T,null),s(T,I),ie(F,T,null),s(T,C),ie(R,T,null),s(l,ne),ve&&ve.m(l,null),s(l,H),Te&&Te.m(l,null),s(l,z),be&&be.m(l,null),s(l,U),s(l,K),s(K,Q),s(Q,G),s(G,X),s(K,j),s(K,x),ie(ae,x,null),s(K,ee),N&&N.m(K,null),s(K,V),s(K,W),s(W,we),ie(He,we,null),s(K,Le),y&&y.m(K,null),Se=!0},p(k,[A]){const D={};A&18&&(D.$$scope={dirty:A,ctx:k}),i.$set(D);const Z={};A&1&&(Z.epoch=k[0].u),c.$set(Z),k[0].t>-50?ye?ye.p(k,A):(ye=Fa(k),ye.c(),ye.m(u,_)):ye&&(ye.d(1),ye=null),(!Se||A&1)&&v!==(v=(k[0].m?(k[0].m/1e3).toFixed(1):"-")+"")&&J(d,v);const le={};A&3&&(le.text=k[1].booting?"Booting":k[0].v>2?k[0].v.toFixed(2)+"V":"ESP"),A&3&&(le.color=Bl(k[1].booting?2:k[0].em)),M.$set(le);const fe={};A&3&&(fe.color=Bl(k[1].booting?9:k[0].hm)),L.$set(fe);const de={};A&1&&(de.text=k[0].r?k[0].r.toFixed(0)+"dBm":"WiFi"),A&3&&(de.color=Bl(k[1].booting?9:k[0].wm)),F.$set(de);const Ce={};A&3&&(Ce.color=Bl(k[1].booting?9:k[0].mm)),R.$set(Ce),k[0].he<0||k[0].he>0?ve?ve.p(k,A):(ve=qa(k),ve.c(),ve.m(l,H)):ve&&(ve.d(1),ve=null),k[0].me<0?Te?Te.p(k,A):(Te=Ba(k),Te.c(),Te.m(l,z)):Te&&(Te.d(1),Te=null),k[0].ee>0||k[0].ee<0?be?be.p(k,A):(be=Ua(k),be.c(),be.m(l,U)):be&&(be.d(1),be=null);const Oe={};A&1&&(Oe.timestamp=k[0].c?new Date(k[0].c*1e3):new Date(0)),A&2&&(Oe.offset=k[1].clock_offset),ae.$set(Oe),k[1].vndcfg&&k[1].usrcfg?N?A&2&&O(N,1):(N=ja(k),N.c(),O(N,1),N.m(K,V)):N&&(Ae(),q(N,1,1,()=>{N=null}),Pe()),k[1].fwconsent===1&&k[2]?y?(y.p(k,A),A&6&&O(y,1)):(y=Ha(k),y.c(),O(y,1),y.m(K,null)):y&&(Ae(),q(y,1,1,()=>{y=null}),Pe())},i(k){Se||(O(i.$$.fragment,k),O(c.$$.fragment,k),O(M.$$.fragment,k),O(L.$$.fragment,k),O(F.$$.fragment,k),O(R.$$.fragment,k),O(ae.$$.fragment,k),O(N),O(He.$$.fragment,k),O(y),Se=!0)},o(k){q(i.$$.fragment,k),q(c.$$.fragment,k),q(M.$$.fragment,k),q(L.$$.fragment,k),q(F.$$.fragment,k),q(R.$$.fragment,k),q(ae.$$.fragment,k),q(N),q(He.$$.fragment,k),q(y),Se=!1},d(k){k&&$(e),se(i),se(c),ye&&ye.d(),se(M),se(L),se(F),se(R),ve&&ve.d(),Te&&Te.d(),be&&be.d(),se(ae),N&&N.d(),se(He),y&&y.d()}}}function im(t,e,l){let{data:n={}}=e,i={},o={};function u(){confirm("Do you want to upgrade this device to "+o.tag_name+"?")&&(!ti(i.board)||confirm(hs(he(i.chip,i.board))))&&(Wt.update(a=>(a.upgrading=!0,a)),Qc(o.tag_name))}return Wt.subscribe(a=>{l(1,i=a),a.fwconsent===1&&T0()}),yo.subscribe(a=>{l(2,o=Xc(i.version,a))}),t.$$set=a=>{"data"in a&&l(0,n=a.data)},[n,i,o,u]}class sm extends Ie{constructor(e){super(),Re(this,e,im,nm,Ee,{data:0})}}function om(t){let e,l,n,i;return{c(){e=De("svg"),l=De("path"),n=De("path"),r(l,"d",Hs(150,150,115,210,510)),r(l,"stroke","rgba(128, 128, 128, 0.15)"),r(l,"fill","none"),r(l,"stroke-width","55"),r(n,"d",i=Hs(150,150,115,210,210+300*t[0]/100)),r(n,"stroke",t[1]),r(n,"fill","none"),r(n,"stroke-width","55"),r(e,"viewBox","0 0 300 300"),r(e,"xmlns","http://www.w3.org/2000/svg"),r(e,"height","100%")},m(o,u){S(o,e,u),s(e,l),s(e,n)},p(o,[u]){u&1&&i!==(i=Hs(150,150,115,210,210+300*o[0]/100))&&r(n,"d",i),u&2&&r(n,"stroke",o[1])},i:pe,o:pe,d(o){o&&$(e)}}}function Wa(t,e,l,n){var i=(n-90)*Math.PI/180;return{x:t+l*Math.cos(i),y:e+l*Math.sin(i)}}function Hs(t,e,l,n,i){var o=Wa(t,e,l,i),u=Wa(t,e,l,n),a=i-n<=180?"0":"1",c=["M",o.x,o.y,"A",l,l,0,a,0,u.x,u.y].join(" ");return c}function rm(t,e,l){let{pct:n=0}=e,{color:i="red"}=e;return t.$$set=o=>{"pct"in o&&l(0,n=o.pct),"color"in o&&l(1,i=o.color)},[n,i]}class am extends Ie{constructor(e){super(),Re(this,e,rm,om,Ee,{pct:0,color:1})}}function za(t){let e,l,n,i,o,u,a,c;return{c(){e=m("br"),l=h(),n=m("span"),i=E(t[3]),o=h(),u=m("span"),a=E(t[4]),c=E("/kWh"),r(n,"class","pl-sub"),r(u,"class","pl-snt")},m(f,_){S(f,e,_),S(f,l,_),S(f,n,_),s(n,i),S(f,o,_),S(f,u,_),s(u,a),s(u,c)},p(f,_){_&8&&J(i,f[3]),_&16&&J(a,f[4])},d(f){f&&$(e),f&&$(l),f&&$(n),f&&$(o),f&&$(u)}}}function um(t){let e,l,n,i,o,u,a,c,f,_,p,b,v,d,g,w;l=new am({props:{pct:t[6],color:t[5](t[6])}});let T=t[3]&&za(t);return{c(){e=m("div"),re(l.$$.fragment),n=h(),i=m("span"),o=m("span"),u=E(t[2]),a=h(),c=m("br"),f=h(),_=m("span"),p=E(t[0]),b=h(),v=m("span"),d=E(t[1]),g=h(),T&&T.c(),r(o,"class","pl-lab"),r(_,"class","pl-val"),r(v,"class","pl-unt"),r(i,"class","pl-ov"),r(e,"class","pl-root")},m(M,P){S(M,e,P),ie(l,e,null),s(e,n),s(e,i),s(i,o),s(o,u),s(i,a),s(i,c),s(i,f),s(i,_),s(_,p),s(i,b),s(i,v),s(v,d),s(i,g),T&&T.m(i,null),w=!0},p(M,[P]){const L={};P&64&&(L.pct=M[6]),P&96&&(L.color=M[5](M[6])),l.$set(L),(!w||P&4)&&J(u,M[2]),(!w||P&1)&&J(p,M[0]),(!w||P&2)&&J(d,M[1]),M[3]?T?T.p(M,P):(T=za(M),T.c(),T.m(i,null)):T&&(T.d(1),T=null)},i(M){w||(O(l.$$.fragment,M),w=!0)},o(M){q(l.$$.fragment,M),w=!1},d(M){M&&$(e),se(l),T&&T.d()}}}function fm(t,e,l){let{val:n}=e,{max:i}=e,{unit:o}=e,{label:u}=e,{sub:a=""}=e,{subunit:c=""}=e,{colorFn:f}=e,_=0;return t.$$set=p=>{"val"in p&&l(0,n=p.val),"max"in p&&l(7,i=p.max),"unit"in p&&l(1,o=p.unit),"label"in p&&l(2,u=p.label),"sub"in p&&l(3,a=p.sub),"subunit"in p&&l(4,c=p.subunit),"colorFn"in p&&l(5,f=p.colorFn)},t.$$.update=()=>{t.$$.dirty&129&&l(6,_=Math.min(n,i)/i*100)},[n,o,u,a,c,f,_,i]}class xc extends Ie{constructor(e){super(),Re(this,e,fm,um,Ee,{val:0,max:7,unit:1,label:2,sub:3,subunit:4,colorFn:5})}}function Ga(t,e,l){const n=t.slice();return n[11]=e[l],n[13]=l,n}function Va(t,e,l){const n=t.slice();return n[11]=e[l],n[13]=l,n}function Ka(t,e,l){const n=t.slice();return n[15]=e[l],n}function Ya(t){let e,l,n,i,o,u,a=t[0].title&&Qa(t),c=t[0].y.ticks,f=[];for(let d=0;dt[9].call(e))},m(o,u){S(o,e,u),s(e,n),i=mo(e,t[9].bind(e))},p(o,u){u&1&&l!==(l=o[0].title+"")&&J(n,l)},d(o){o&&$(e),i()}}}function Xa(t){let e,l,n,i=t[15].label+"",o,u,a,c;return{c(){e=De("g"),l=De("line"),n=De("text"),o=E(i),r(l,"x2","100%"),r(n,"y","-4"),r(n,"x",u=t[15].align=="right"?"85%":""),r(e,"class",a="tick tick-"+t[15].value+" tick-"+t[15].color),r(e,"transform",c="translate(0, "+t[7](t[15].value)+")")},m(f,_){S(f,e,_),s(e,l),s(e,n),s(n,o)},p(f,_){_&1&&i!==(i=f[15].label+"")&&J(o,i),_&1&&u!==(u=f[15].align=="right"?"85%":"")&&r(n,"x",u),_&1&&a!==(a="tick tick-"+f[15].value+" tick-"+f[15].color)&&r(e,"class",a),_&129&&c!==(c="translate(0, "+f[7](f[15].value)+")")&&r(e,"transform",c)},d(f){f&&$(e)}}}function Za(t){let e=!isNaN(t[7](t[15].value)),l,n=e&&Xa(t);return{c(){n&&n.c(),l=Ke()},m(i,o){n&&n.m(i,o),S(i,l,o)},p(i,o){o&129&&(e=!isNaN(i[7](i[15].value))),e?n?n.p(i,o):(n=Xa(i),n.c(),n.m(l.parentNode,l)):n&&(n.d(1),n=null)},d(i){n&&n.d(i),i&&$(l)}}}function Ja(t){let e,l,n=(t[3]>20||t[13]%2==0)&&xa(t);return{c(){e=De("g"),n&&n.c(),r(e,"class","tick"),r(e,"transform",l="translate("+t[6](t[13])+","+t[4]+")")},m(i,o){S(i,e,o),n&&n.m(e,null)},p(i,o){i[3]>20||i[13]%2==0?n?n.p(i,o):(n=xa(i),n.c(),n.m(e,null)):n&&(n.d(1),n=null),o&80&&l!==(l="translate("+i[6](i[13])+","+i[4]+")")&&r(e,"transform",l)},d(i){i&&$(e),n&&n.d()}}}function xa(t){let e,l=t[11].label+"",n,i;return{c(){e=De("text"),n=E(l),r(e,"x",i=t[3]/2),r(e,"y","-4")},m(o,u){S(o,e,u),s(e,n)},p(o,u){u&1&&l!==(l=o[11].label+"")&&J(n,l),u&8&&i!==(i=o[3]/2)&&r(e,"x",i)},d(o){o&&$(e)}}}function eu(t){let e=!isNaN(t[6](t[13])),l,n=e&&Ja(t);return{c(){n&&n.c(),l=Ke()},m(i,o){n&&n.m(i,o),S(i,l,o)},p(i,o){o&64&&(e=!isNaN(i[6](i[13]))),e?n?n.p(i,o):(n=Ja(i),n.c(),n.m(l.parentNode,l)):n&&(n.d(1),n=null)},d(i){n&&n.d(i),i&&$(l)}}}function tu(t){let e,l,n=t[11].value!==void 0&&lu(t),i=t[11].value2>1e-4&&su(t);return{c(){e=De("g"),n&&n.c(),l=De("g"),i&&i.c()},m(o,u){S(o,e,u),n&&n.m(e,null),S(o,l,u),i&&i.m(l,null)},p(o,u){o[11].value!==void 0?n?n.p(o,u):(n=lu(o),n.c(),n.m(e,null)):n&&(n.d(1),n=null),o[11].value2>1e-4?i?i.p(o,u):(i=su(o),i.c(),i.m(l,null)):i&&(i.d(1),i=null)},d(o){o&&$(e),n&&n.d(),o&&$(l),i&&i.d()}}}function lu(t){let e,l,n,i,o,u,a,c=t[3]>15&&nu(t);return{c(){e=De("rect"),c&&c.c(),a=Ke(),r(e,"x",l=t[6](t[13])+2),r(e,"y",n=t[7](t[11].value)),r(e,"width",i=t[3]-4),r(e,"height",o=t[7](t[0].y.min)-t[7](Math.min(t[0].y.min,0)+t[11].value)),r(e,"fill",u=t[11].color)},m(f,_){S(f,e,_),c&&c.m(f,_),S(f,a,_)},p(f,_){_&64&&l!==(l=f[6](f[13])+2)&&r(e,"x",l),_&129&&n!==(n=f[7](f[11].value))&&r(e,"y",n),_&8&&i!==(i=f[3]-4)&&r(e,"width",i),_&129&&o!==(o=f[7](f[0].y.min)-f[7](Math.min(f[0].y.min,0)+f[11].value))&&r(e,"height",o),_&1&&u!==(u=f[11].color)&&r(e,"fill",u),f[3]>15?c?c.p(f,_):(c=nu(f),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null)},d(f){f&&$(e),c&&c.d(f),f&&$(a)}}}function nu(t){let e,l=t[11].label+"",n,i,o,u,a,c,f=t[11].title&&iu(t);return{c(){e=De("text"),n=E(l),f&&f.c(),c=Ke(),r(e,"width",i=t[3]-4),r(e,"dominant-baseline","middle"),r(e,"text-anchor",o=t[3]t[7](0)-t[8]?t[11].color:"white"),r(e,"transform",a="translate("+(t[6](t[13])+t[3]/2)+" "+(t[7](t[11].value)>t[7](0)-t[8]?t[7](t[11].value)-t[8]:t[7](t[11].value)+10)+") rotate("+(t[11].labelAngle?t[11].labelAngle:t[3]_[7](0)-_[8]?_[11].color:"white")&&r(e,"fill",u),p&457&&a!==(a="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&&ou(t);return{c(){e=De("rect"),c&&c.c(),a=Ke(),r(e,"x",l=t[6](t[13])+2),r(e,"y",n=t[7](0)),r(e,"width",i=t[3]-4),r(e,"height",o=t[7](t[0].y.min)-t[7](t[0].y.min+t[11].value2)),r(e,"fill",u=t[11].color2?t[11].color2:t[11].color)},m(f,_){S(f,e,_),c&&c.m(f,_),S(f,a,_)},p(f,_){_&64&&l!==(l=f[6](f[13])+2)&&r(e,"x",l),_&128&&n!==(n=f[7](0))&&r(e,"y",n),_&8&&i!==(i=f[3]-4)&&r(e,"width",i),_&129&&o!==(o=f[7](f[0].y.min)-f[7](f[0].y.min+f[11].value2))&&r(e,"height",o),_&1&&u!==(u=f[11].color2?f[11].color2:f[11].color)&&r(e,"fill",u),f[3]>15?c?c.p(f,_):(c=ou(f),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null)},d(f){f&&$(e),c&&c.d(f),f&&$(a)}}}function ou(t){let e,l=t[11].label2+"",n,i,o,u,a,c=t[11].title2&&ru(t);return{c(){e=De("text"),n=E(l),c&&c.c(),a=Ke(),r(e,"width",i=t[3]-4),r(e,"dominant-baseline","middle"),r(e,"text-anchor","middle"),r(e,"fill",o=t[7](-t[11].value2)t[10].call(e))},m(i,o){S(i,e,o),n&&n.m(e,null),l=mo(e,t[10].bind(e))},p(i,[o]){i[0].x.ticks&&i[0].points&&i[4]?n?n.p(i,o):(n=Ya(i),n.c(),n.m(e,null)):n&&(n.d(1),n=null)},i:pe,o:pe,d(i){i&&$(e),n&&n.d(),l()}}}let un=30;function mm(t,e,l){let{config:n}=e,i,o,u,a,c,f,_,p=0;function b(){p=this.clientHeight,l(5,p)}function v(){i=this.clientWidth,o=this.clientHeight,l(1,i),l(2,o)}return t.$$set=d=>{"config"in d&&l(0,n=d.config)},t.$$.update=()=>{if(t.$$.dirty&63){l(4,f=o-p);let d=i-(n.padding.left+n.padding.right);l(3,u=d/n.points.length),l(8,_=un.y.max?T=n.padding.bottom:wf||T<0?0:T})}},[n,i,o,u,f,p,a,c,_,b,v]}class mn extends Ie{constructor(e){super(),Re(this,e,mm,cm,Ee,{config:0})}}function _m(t){let e,l;return e=new mn({props:{config:t[0]}}),{c(){re(e.$$.fragment)},m(n,i){ie(e,n,i),l=!0},p(n,[i]){const o={};i&1&&(o.config=n[0]),e.$set(o)},i(n){l||(O(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){se(e,n)}}}function pm(t,e,l){let{u1:n}=e,{u2:i}=e,{u3:o}=e,{ds:u}=e,a={};function c(f){return{label:ke(f)+"V",title:f.toFixed(1)+" V",value:isNaN(f)?0:f,color:$0(f||0)}}return t.$$set=f=>{"u1"in f&&l(1,n=f.u1),"u2"in f&&l(2,i=f.u2),"u3"in f&&l(3,o=f.u3),"ds"in f&&l(4,u=f.ds)},t.$$.update=()=>{if(t.$$.dirty&30){let f=[],_=[];n>0&&(f.push({label:u===1?"L1-L2":"L1"}),_.push(c(n))),i>0&&(f.push({label:u===1?"L1-L3":"L2"}),_.push(c(i))),o>0&&(f.push({label:u===1?"L2-L3":"L3"}),_.push(c(o))),l(0,a={title:"Voltage",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:f},points:_})}},[a,n,i,o,u]}class dm extends Ie{constructor(e){super(),Re(this,e,pm,_m,Ee,{u1:1,u2:2,u3:3,ds:4})}}function vm(t){let e,l;return e=new mn({props:{config:t[0]}}),{c(){re(e.$$.fragment)},m(n,i){ie(e,n,i),l=!0},p(n,[i]){const o={};i&1&&(o.config=n[0]),e.$set(o)},i(n){l||(O(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){se(e,n)}}}function hm(t,e,l){let{u1:n}=e,{u2:i}=e,{u3:o}=e,{i1:u}=e,{i2:a}=e,{i2e:c}=e,{i3:f}=e,{max:_}=e,p={};function b(v){return{label:ke(v)+"A",title:v.toFixed(1)+" A",value:isNaN(v)?0:v,color:qc(v?v/_*100:0)}}return t.$$set=v=>{"u1"in v&&l(1,n=v.u1),"u2"in v&&l(2,i=v.u2),"u3"in v&&l(3,o=v.u3),"i1"in v&&l(4,u=v.i1),"i2"in v&&l(5,a=v.i2),"i2e"in v&&l(6,c=v.i2e),"i3"in v&&l(7,f=v.i3),"max"in v&&l(8,_=v.max)},t.$$.update=()=>{if(t.$$.dirty&510){let v=[],d=[];n>0&&(v.push({label:"L1"}),d.push(b(u))),i>0&&(c?(v.push({label:"L2"}),d.push({label:"Not available",labelAngle:-90,title:"L2 current is not reported by your meter",value:0,color:"#7c3aedcc"})):(v.push({label:"L2"}),d.push(b(a)))),o>0&&(v.push({label:"L3"}),d.push(b(f))),l(0,p={title:"Amperage",padding:{top:20,right:15,bottom:20,left:35},y:{min:0,max:_,ticks:[{value:0,label:"0%"},{value:_/4,label:"25%"},{value:_/2,label:"50%"},{value:_/4*3,label:"75%"},{value:_,label:"100%"}]},x:{ticks:v},points:d})}},[p,n,i,o,u,a,c,f,_]}class bm extends Ie{constructor(e){super(),Re(this,e,hm,vm,Ee,{u1:1,u2:2,u3:3,i1:4,i2:5,i2e:6,i3:7,max:8})}}function gm(t){let e,l,n,i,o,u,a,c=(typeof t[0]<"u"?t[0].toFixed(0):"-")+"",f,_,p,b,v,d,g=(typeof t[1]<"u"?t[1].toFixed(0):"-")+"",w,T,M,P,L,I,F,C=(typeof t[2]<"u"?t[2].toFixed(1):"-")+"",R,ne,H,z,U,K,Q=(typeof t[3]<"u"?t[3].toFixed(1):"-")+"",G,X;return{c(){e=m("div"),l=m("strong"),l.textContent="Reactive",n=h(),i=m("div"),o=m("div"),o.textContent="Instant in",u=h(),a=m("div"),f=E(c),_=E(" VAr"),p=h(),b=m("div"),b.textContent="Instant out",v=h(),d=m("div"),w=E(g),T=E(" VAr"),M=h(),P=m("div"),L=m("div"),L.textContent="Total in",I=h(),F=m("div"),R=E(C),ne=E(" kVArh"),H=h(),z=m("div"),z.textContent="Total out",U=h(),K=m("div"),G=E(Q),X=E(" kVArh"),r(a,"class","text-right"),r(d,"class","text-right"),r(i,"class","grid grid-cols-2 mt-4"),r(F,"class","text-right"),r(K,"class","text-right"),r(P,"class","grid grid-cols-2 mt-4"),r(e,"class","mx-2 text-sm")},m(Y,j){S(Y,e,j),s(e,l),s(e,n),s(e,i),s(i,o),s(i,u),s(i,a),s(a,f),s(a,_),s(i,p),s(i,b),s(i,v),s(i,d),s(d,w),s(d,T),s(e,M),s(e,P),s(P,L),s(P,I),s(P,F),s(F,R),s(F,ne),s(P,H),s(P,z),s(P,U),s(P,K),s(K,G),s(K,X)},p(Y,[j]){j&1&&c!==(c=(typeof Y[0]<"u"?Y[0].toFixed(0):"-")+"")&&J(f,c),j&2&&g!==(g=(typeof Y[1]<"u"?Y[1].toFixed(0):"-")+"")&&J(w,g),j&4&&C!==(C=(typeof Y[2]<"u"?Y[2].toFixed(1):"-")+"")&&J(R,C),j&8&&Q!==(Q=(typeof Y[3]<"u"?Y[3].toFixed(1):"-")+"")&&J(G,Q)},i:pe,o:pe,d(Y){Y&&$(e)}}}function km(t,e,l){let{importInstant:n}=e,{exportInstant:i}=e,{importTotal:o}=e,{exportTotal:u}=e;return t.$$set=a=>{"importInstant"in a&&l(0,n=a.importInstant),"exportInstant"in a&&l(1,i=a.exportInstant),"importTotal"in a&&l(2,o=a.importTotal),"exportTotal"in a&&l(3,u=a.exportTotal)},[n,i,o,u]}class wm extends Ie{constructor(e){super(),Re(this,e,km,gm,Ee,{importInstant:0,exportInstant:1,importTotal:2,exportTotal:3})}}function uu(t){let e;function l(o,u){return o[3]?Cm:ym}let n=l(t),i=n(t);return{c(){i.c(),e=Ke()},m(o,u){i.m(o,u),S(o,e,u)},p(o,u){n===(n=l(o))&&i?i.p(o,u):(i.d(1),i=n(o),i&&(i.c(),i.m(e.parentNode,e)))},d(o){i.d(o),o&&$(e)}}}function ym(t){let e,l,n,i,o,u,a=ke(t[1].h.u,2)+"",c,f,_,p,b,v,d=ke(t[1].d.u,1)+"",g,w,T,M,P,L,I=ke(t[1].m.u)+"",F,C,R,ne,H,z,U=ke(t[0].last_month.u)+"",K,Q,G,X,Y=t[4]&&fu(t);return{c(){e=m("strong"),e.textContent="Consumption",l=h(),n=m("div"),i=m("div"),i.textContent="Hour",o=h(),u=m("div"),c=E(a),f=E(" kWh"),_=h(),p=m("div"),p.textContent="Day",b=h(),v=m("div"),g=E(d),w=E(" kWh"),T=h(),M=m("div"),M.textContent="Month",P=h(),L=m("div"),F=E(I),C=E(" kWh"),R=h(),ne=m("div"),ne.textContent="Last month",H=h(),z=m("div"),K=E(U),Q=E(" kWh"),G=h(),Y&&Y.c(),X=Ke(),r(u,"class","text-right"),r(v,"class","text-right"),r(L,"class","text-right"),r(z,"class","text-right"),r(n,"class","grid grid-cols-2 mb-3")},m(j,x){S(j,e,x),S(j,l,x),S(j,n,x),s(n,i),s(n,o),s(n,u),s(u,c),s(u,f),s(n,_),s(n,p),s(n,b),s(n,v),s(v,g),s(v,w),s(n,T),s(n,M),s(n,P),s(n,L),s(L,F),s(L,C),s(n,R),s(n,ne),s(n,H),s(n,z),s(z,K),s(z,Q),S(j,G,x),Y&&Y.m(j,x),S(j,X,x)},p(j,x){x&2&&a!==(a=ke(j[1].h.u,2)+"")&&J(c,a),x&2&&d!==(d=ke(j[1].d.u,1)+"")&&J(g,d),x&2&&I!==(I=ke(j[1].m.u)+"")&&J(F,I),x&1&&U!==(U=ke(j[0].last_month.u)+"")&&J(K,U),j[4]?Y?Y.p(j,x):(Y=fu(j),Y.c(),Y.m(X.parentNode,X)):Y&&(Y.d(1),Y=null)},d(j){j&&$(e),j&&$(l),j&&$(n),j&&$(G),Y&&Y.d(j),j&&$(X)}}}function Cm(t){let e,l,n,i,o,u,a=ke(t[1].h.u,2)+"",c,f,_,p,b,v,d,g=ke(t[1].d.u,1)+"",w,T,M,P,L,I,F,C=ke(t[1].m.u)+"",R,ne,H,z,U,K,Q,G=ke(t[0].last_month.u)+"",X,Y,j,x,ae,ee,V,W,we,He,Le,Se=ke(t[1].h.p,2)+"",ye,ve,Te,be,N,y,k,A=ke(t[1].d.p,1)+"",D,Z,le,fe,de,Ce,Oe,ue=ke(t[1].m.p)+"",Me,Je,Lt,st,wt,nt,Ot,Qe=ke(t[0].last_month.p)+"",Xt,zt,vt,xe,Ge=t[4]&&cu(t),Ye=t[4]&&mu(t),Ne=t[4]&&_u(t),Ze=t[4]&&pu(t),et=t[4]&&du(t),qe=t[4]&&vu(t),Fe=t[4]&&hu(t),_e=t[4]&&bu(t);return{c(){e=m("strong"),e.textContent="Import",l=h(),n=m("div"),i=m("div"),i.textContent="Hour",o=h(),u=m("div"),c=E(a),f=E(" kWh"),_=h(),Ge&&Ge.c(),p=h(),b=m("div"),b.textContent="Day",v=h(),d=m("div"),w=E(g),T=E(" kWh"),M=h(),Ye&&Ye.c(),P=h(),L=m("div"),L.textContent="Month",I=h(),F=m("div"),R=E(C),ne=E(" kWh"),H=h(),Ne&&Ne.c(),z=h(),U=m("div"),U.textContent="Last mo.",K=h(),Q=m("div"),X=E(G),Y=E(" kWh"),j=h(),Ze&&Ze.c(),ae=h(),ee=m("strong"),ee.textContent="Export",V=h(),W=m("div"),we=m("div"),we.textContent="Hour",He=h(),Le=m("div"),ye=E(Se),ve=E(" kWh"),Te=h(),et&&et.c(),be=h(),N=m("div"),N.textContent="Day",y=h(),k=m("div"),D=E(A),Z=E(" kWh"),le=h(),qe&&qe.c(),fe=h(),de=m("div"),de.textContent="Month",Ce=h(),Oe=m("div"),Me=E(ue),Je=E(" kWh"),Lt=h(),Fe&&Fe.c(),st=h(),wt=m("div"),wt.textContent="Last mo.",nt=h(),Ot=m("div"),Xt=E(Qe),zt=E(" kWh"),vt=h(),_e&&_e.c(),r(u,"class","text-right"),r(d,"class","text-right"),r(F,"class","text-right"),r(Q,"class","text-right"),r(n,"class",x="grid grid-cols-"+t[5]+" mb-3"),r(Le,"class","text-right"),r(k,"class","text-right"),r(Oe,"class","text-right"),r(Ot,"class","text-right"),r(W,"class",xe="grid grid-cols-"+t[5])},m(ce,Be){S(ce,e,Be),S(ce,l,Be),S(ce,n,Be),s(n,i),s(n,o),s(n,u),s(u,c),s(u,f),s(n,_),Ge&&Ge.m(n,null),s(n,p),s(n,b),s(n,v),s(n,d),s(d,w),s(d,T),s(n,M),Ye&&Ye.m(n,null),s(n,P),s(n,L),s(n,I),s(n,F),s(F,R),s(F,ne),s(n,H),Ne&&Ne.m(n,null),s(n,z),s(n,U),s(n,K),s(n,Q),s(Q,X),s(Q,Y),s(n,j),Ze&&Ze.m(n,null),S(ce,ae,Be),S(ce,ee,Be),S(ce,V,Be),S(ce,W,Be),s(W,we),s(W,He),s(W,Le),s(Le,ye),s(Le,ve),s(W,Te),et&&et.m(W,null),s(W,be),s(W,N),s(W,y),s(W,k),s(k,D),s(k,Z),s(W,le),qe&&qe.m(W,null),s(W,fe),s(W,de),s(W,Ce),s(W,Oe),s(Oe,Me),s(Oe,Je),s(W,Lt),Fe&&Fe.m(W,null),s(W,st),s(W,wt),s(W,nt),s(W,Ot),s(Ot,Xt),s(Ot,zt),s(W,vt),_e&&_e.m(W,null)},p(ce,Be){Be&2&&a!==(a=ke(ce[1].h.u,2)+"")&&J(c,a),ce[4]?Ge?Ge.p(ce,Be):(Ge=cu(ce),Ge.c(),Ge.m(n,p)):Ge&&(Ge.d(1),Ge=null),Be&2&&g!==(g=ke(ce[1].d.u,1)+"")&&J(w,g),ce[4]?Ye?Ye.p(ce,Be):(Ye=mu(ce),Ye.c(),Ye.m(n,P)):Ye&&(Ye.d(1),Ye=null),Be&2&&C!==(C=ke(ce[1].m.u)+"")&&J(R,C),ce[4]?Ne?Ne.p(ce,Be):(Ne=_u(ce),Ne.c(),Ne.m(n,z)):Ne&&(Ne.d(1),Ne=null),Be&1&&G!==(G=ke(ce[0].last_month.u)+"")&&J(X,G),ce[4]?Ze?Ze.p(ce,Be):(Ze=pu(ce),Ze.c(),Ze.m(n,null)):Ze&&(Ze.d(1),Ze=null),Be&32&&x!==(x="grid grid-cols-"+ce[5]+" mb-3")&&r(n,"class",x),Be&2&&Se!==(Se=ke(ce[1].h.p,2)+"")&&J(ye,Se),ce[4]?et?et.p(ce,Be):(et=du(ce),et.c(),et.m(W,be)):et&&(et.d(1),et=null),Be&2&&A!==(A=ke(ce[1].d.p,1)+"")&&J(D,A),ce[4]?qe?qe.p(ce,Be):(qe=vu(ce),qe.c(),qe.m(W,fe)):qe&&(qe.d(1),qe=null),Be&2&&ue!==(ue=ke(ce[1].m.p)+"")&&J(Me,ue),ce[4]?Fe?Fe.p(ce,Be):(Fe=hu(ce),Fe.c(),Fe.m(W,st)):Fe&&(Fe.d(1),Fe=null),Be&1&&Qe!==(Qe=ke(ce[0].last_month.p)+"")&&J(Xt,Qe),ce[4]?_e?_e.p(ce,Be):(_e=bu(ce),_e.c(),_e.m(W,null)):_e&&(_e.d(1),_e=null),Be&32&&xe!==(xe="grid grid-cols-"+ce[5])&&r(W,"class",xe)},d(ce){ce&&$(e),ce&&$(l),ce&&$(n),Ge&&Ge.d(),Ye&&Ye.d(),Ne&&Ne.d(),Ze&&Ze.d(),ce&&$(ae),ce&&$(ee),ce&&$(V),ce&&$(W),et&&et.d(),qe&&qe.d(),Fe&&Fe.d(),_e&&_e.d()}}}function fu(t){let e,l,n,i,o,u,a=ke(t[1].h.c,2)+"",c,f,_,p,b,v,d,g=ke(t[1].d.c,1)+"",w,T,M,P,L,I,F,C=ke(t[1].m.c)+"",R,ne,H,z,U,K,Q,G=ke(t[0].last_month.c)+"",X,Y,j;return{c(){e=m("strong"),e.textContent="Cost",l=h(),n=m("div"),i=m("div"),i.textContent="Hour",o=h(),u=m("div"),c=E(a),f=h(),_=E(t[2]),p=h(),b=m("div"),b.textContent="Day",v=h(),d=m("div"),w=E(g),T=h(),M=E(t[2]),P=h(),L=m("div"),L.textContent="Month",I=h(),F=m("div"),R=E(C),ne=h(),H=E(t[2]),z=h(),U=m("div"),U.textContent="Last month",K=h(),Q=m("div"),X=E(G),Y=h(),j=E(t[2]),r(u,"class","text-right"),r(d,"class","text-right"),r(F,"class","text-right"),r(Q,"class","text-right"),r(n,"class","grid grid-cols-2")},m(x,ae){S(x,e,ae),S(x,l,ae),S(x,n,ae),s(n,i),s(n,o),s(n,u),s(u,c),s(u,f),s(u,_),s(n,p),s(n,b),s(n,v),s(n,d),s(d,w),s(d,T),s(d,M),s(n,P),s(n,L),s(n,I),s(n,F),s(F,R),s(F,ne),s(F,H),s(n,z),s(n,U),s(n,K),s(n,Q),s(Q,X),s(Q,Y),s(Q,j)},p(x,ae){ae&2&&a!==(a=ke(x[1].h.c,2)+"")&&J(c,a),ae&4&&J(_,x[2]),ae&2&&g!==(g=ke(x[1].d.c,1)+"")&&J(w,g),ae&4&&J(M,x[2]),ae&2&&C!==(C=ke(x[1].m.c)+"")&&J(R,C),ae&4&&J(H,x[2]),ae&1&&G!==(G=ke(x[0].last_month.c)+"")&&J(X,G),ae&4&&J(j,x[2])},d(x){x&&$(e),x&&$(l),x&&$(n)}}}function cu(t){let e,l=ke(t[1].h.c,2)+"",n,i,o;return{c(){e=m("div"),n=E(l),i=h(),o=E(t[2]),r(e,"class","text-right")},m(u,a){S(u,e,a),s(e,n),s(e,i),s(e,o)},p(u,a){a&2&&l!==(l=ke(u[1].h.c,2)+"")&&J(n,l),a&4&&J(o,u[2])},d(u){u&&$(e)}}}function mu(t){let e,l=ke(t[1].d.c,1)+"",n,i,o;return{c(){e=m("div"),n=E(l),i=h(),o=E(t[2]),r(e,"class","text-right")},m(u,a){S(u,e,a),s(e,n),s(e,i),s(e,o)},p(u,a){a&2&&l!==(l=ke(u[1].d.c,1)+"")&&J(n,l),a&4&&J(o,u[2])},d(u){u&&$(e)}}}function _u(t){let e,l=ke(t[1].m.c)+"",n,i,o;return{c(){e=m("div"),n=E(l),i=h(),o=E(t[2]),r(e,"class","text-right")},m(u,a){S(u,e,a),s(e,n),s(e,i),s(e,o)},p(u,a){a&2&&l!==(l=ke(u[1].m.c)+"")&&J(n,l),a&4&&J(o,u[2])},d(u){u&&$(e)}}}function pu(t){let e,l=ke(t[0].last_month.c)+"",n,i,o;return{c(){e=m("div"),n=E(l),i=h(),o=E(t[2]),r(e,"class","text-right")},m(u,a){S(u,e,a),s(e,n),s(e,i),s(e,o)},p(u,a){a&1&&l!==(l=ke(u[0].last_month.c)+"")&&J(n,l),a&4&&J(o,u[2])},d(u){u&&$(e)}}}function du(t){let e,l=ke(t[1].h.i,2)+"",n,i,o;return{c(){e=m("div"),n=E(l),i=h(),o=E(t[2]),r(e,"class","text-right")},m(u,a){S(u,e,a),s(e,n),s(e,i),s(e,o)},p(u,a){a&2&&l!==(l=ke(u[1].h.i,2)+"")&&J(n,l),a&4&&J(o,u[2])},d(u){u&&$(e)}}}function vu(t){let e,l=ke(t[1].d.i,1)+"",n,i,o;return{c(){e=m("div"),n=E(l),i=h(),o=E(t[2]),r(e,"class","text-right")},m(u,a){S(u,e,a),s(e,n),s(e,i),s(e,o)},p(u,a){a&2&&l!==(l=ke(u[1].d.i,1)+"")&&J(n,l),a&4&&J(o,u[2])},d(u){u&&$(e)}}}function hu(t){let e,l=ke(t[1].m.i)+"",n,i,o;return{c(){e=m("div"),n=E(l),i=h(),o=E(t[2]),r(e,"class","text-right")},m(u,a){S(u,e,a),s(e,n),s(e,i),s(e,o)},p(u,a){a&2&&l!==(l=ke(u[1].m.i)+"")&&J(n,l),a&4&&J(o,u[2])},d(u){u&&$(e)}}}function bu(t){let e,l=ke(t[0].last_month.i)+"",n,i,o;return{c(){e=m("div"),n=E(l),i=h(),o=E(t[2]),r(e,"class","text-right")},m(u,a){S(u,e,a),s(e,n),s(e,i),s(e,o)},p(u,a){a&1&&l!==(l=ke(u[0].last_month.i)+"")&&J(n,l),a&4&&J(o,u[2])},d(u){u&&$(e)}}}function $m(t){let e,l,n,i,o,u,a=t[1]&&uu(t);return{c(){e=m("div"),l=m("strong"),l.textContent="Real time calculation",n=h(),i=m("br"),o=m("br"),u=h(),a&&a.c(),r(e,"class","mx-2 text-sm")},m(c,f){S(c,e,f),s(e,l),s(e,n),s(e,i),s(e,o),s(e,u),a&&a.m(e,null)},p(c,[f]){c[1]?a?a.p(c,f):(a=uu(c),a.c(),a.m(e,null)):a&&(a.d(1),a=null)},i:pe,o:pe,d(c){c&&$(e),a&&a.d()}}}function Sm(t,e,l){let{sysinfo:n}=e,{data:i}=e,{currency:o}=e,{hasExport:u}=e,a=!1,c=3;return t.$$set=f=>{"sysinfo"in f&&l(0,n=f.sysinfo),"data"in f&&l(1,i=f.data),"currency"in f&&l(2,o=f.currency),"hasExport"in f&&l(3,u=f.hasExport)},t.$$.update=()=>{t.$$.dirty&18&&(l(4,a=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(5,c=a?3:2))},[n,i,o,u,a,c]}class Mm extends Ie{constructor(e){super(),Re(this,e,Sm,$m,Ee,{sysinfo:0,data:1,currency:2,hasExport:3})}}function Tm(t){let e,l,n=Da(t[0].source)+"",i,o,u,a,c;return a=new mn({props:{config:t[1]}}),{c(){e=m("a"),l=E("Provided by: "),i=E(n),u=h(),re(a.$$.fragment),r(e,"href",o=Ra(t[0].source)),r(e,"target","_blank"),r(e,"class","text-xs float-right z-40")},m(f,_){S(f,e,_),s(e,l),s(e,i),S(f,u,_),ie(a,f,_),c=!0},p(f,[_]){(!c||_&1)&&n!==(n=Da(f[0].source)+"")&&J(i,n),(!c||_&1&&o!==(o=Ra(f[0].source)))&&r(e,"href",o);const p={};_&2&&(p.config=f[1]),a.$set(p)},i(f){c||(O(a.$$.fragment,f),c=!0)},o(f){q(a.$$.fragment,f),c=!1},d(f){f&&$(e),f&&$(u),se(a,f)}}}function Nm(t,e,l){let{json:n}=e,{sysinfo:i}=e,o={},u,a;return t.$$set=c=>{"json"in c&&l(0,n=c.json),"sysinfo"in c&&l(2,i=c.sysinfo)},t.$$.update=()=>{if(t.$$.dirty&29){let c=n.currency,f=new Date().getUTCHours(),_=0,p=0,b=0,v=[],d=[],g=[];l(4,a=l(3,u=0));let w=new Date;for(dl(w,i.clock_offset-(24+w.getHours()-w.getUTCHours())%24),_=f;_<24&&(p=n[Ue(b++)],p!=null);_++)d.push({label:Ue(w.getHours())}),g.push(p*100),l(4,a=Math.min(a,p*100)),l(3,u=Math.max(u,p*100)),dl(w,1);for(_=0;_<24&&(p=n[Ue(b++)],p!=null);_++)d.push({label:Ue(w.getHours())}),g.push(p*100),l(4,a=Math.min(a,p*100)),l(3,u=Math.max(u,p*100)),dl(w,1);if(a>-100&&u<100){switch(c){case"NOK":case"DKK":c="\xF8re";break;case"SEK":c="\xF6re";break;case"EUR":c="cent";break;case"CHF":c="rp.";break;default:c=c+"/100"}for(l(4,a*=100),l(3,u*=100),_=0;_=0?I.toFixed(F):"",title:I>=0?I.toFixed(2)+" "+c:"",value:p>=0?Math.abs(p):0,label2:I<0?I.toFixed(F):"",title2:I<0?I.toFixed(2)+" "+c:"",value2:p<0?Math.abs(p):0,color:"#7c3aed"})}let M=Math.max(u,Math.abs(a));if(a<0){l(4,a=Math.min(M/4*-1,a));let I=Math.ceil(Math.abs(a)/M*4),F=a/I;for(_=1;_{"json"in c&&l(1,n=c.json),"sysinfo"in c&&l(2,i=c.sysinfo)},t.$$.update=()=>{if(t.$$.dirty&30){let c=0,f=[],_=[],p=[];l(4,a=l(3,u=0));let b=dl(new Date,-24),v=new Date().getUTCHours();for(dl(b,i.clock_offset-(24+b.getHours()-b.getUTCHours())%24),c=v;c<24;c++){let T=n["i"+Ue(c)],M=n["e"+Ue(c)];T===void 0&&(T=0),M===void 0&&(M=0),_.push({label:Ue(b.getHours())}),p.push({label:T.toFixed(1),title:T.toFixed(2)+" kWh",value:T*10,label2:M.toFixed(1),title2:M.toFixed(2)+" kWh",value2:M*10,color:"#7c3aed",color2:"#37829E"}),l(4,a=Math.max(a,M*10)),l(3,u=Math.max(u,T*10)),dl(b,1)}for(c=0;c{"json"in c&&l(1,n=c.json),"sysinfo"in c&&l(2,i=c.sysinfo)},t.$$.update=()=>{if(t.$$.dirty&30){let c=0,f=[],_=[],p=[];l(4,a=l(3,u=0));let b=new Date,v=new Date;for(dl(b,i.clock_offset-(24+b.getHours()-b.getUTCHours())%24),dl(v,i.clock_offset-(24+v.getHours()-v.getUTCHours())%24),v.setDate(0),c=b.getDate();c<=v.getDate();c++){let T=n["i"+Ue(c)],M=n["e"+Ue(c)];T===void 0&&(T=0),M===void 0&&(M=0),_.push({label:Ue(c)}),p.push({label:T.toFixed(T<10?1:0),title:T.toFixed(2)+" kWh",value:T,label2:M.toFixed(M<10?1:0),title2:M.toFixed(2)+" kWh",value2:M,color:"#7c3aed",color2:"#37829E"}),l(4,a=Math.max(a,M)),l(3,u=Math.max(u,T))}for(c=1;c{"json"in a&&l(1,n=a.json)},t.$$.update=()=>{if(t.$$.dirty&14){let a=0,c=0,f=[],_=[],p=[];n.s&&n.s.forEach((d,g)=>{var w=d.n?d.n:d.a;c=d.v,c==-127&&(c=0),_.push({label:w.slice(-4)}),p.push({label:c.toFixed(1),value:c,color:"#7c3aed"}),l(3,u=Math.min(u,c)),l(2,o=Math.max(o,c))}),l(2,o=Math.ceil(o)),l(3,u=Math.floor(u));let b=o;u<0&&(b+=Math.abs(u));let v=b/4;for(a=0;a<5;a++)c=u+v*a,f.push({value:c,label:c.toFixed(1)});l(0,i={title:"Temperature sensors (\xB0C)",height:226,width:1520,padding:{top:20,right:15,bottom:20,left:35},y:{min:u,max:o,ticks:f},x:{ticks:_},points:p})}},[i,n,o,u]}class qm extends Ie{constructor(e){super(),Re(this,e,Fm,Om,Ee,{json:1})}}function Bm(t){let e,l;return e=new mn({props:{config:t[0]}}),{c(){re(e.$$.fragment)},m(n,i){ie(e,n,i),l=!0},p(n,[i]){const o={};i&1&&(o.config=n[0]),e.$set(o)},i(n){l||(O(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){se(e,n)}}}let Um=0;function jm(t,e,l){let n={},i=0,o;return Kc.subscribe(u=>{l(2,o=u)}),Vc(),t.$$.update=()=>{if(t.$$.dirty&6){let u=0,a=[],c=[],f=[];if(a.push({value:0,label:0}),o&&o.p)for(u=0;u0?Ue(_.d)+"."+Ys[new Date().getMonth()]:"-"}),l(1,i=Math.max(i,_.v))}if(o&&o.t){for(u=0;u=i)break;a.push({value:_,label:_})}a.push({label:o.m.toFixed(1),align:"right",color:"green",value:o.m})}o&&o.c&&(a.push({label:o.c.toFixed(0),color:"orange",value:o.c}),l(1,i=Math.max(i,o.c))),l(1,i=Math.ceil(i)),l(0,n={title:"Tariff peaks",padding:{top:20,right:35,bottom:20,left:35},y:{min:Um,max:i,ticks:a},x:{ticks:c},points:f})}},[n,i,o]}class Hm extends Ie{constructor(e){super(),Re(this,e,jm,Bm,Ee,{})}}function gu(t,e,l){const n=t.slice();return n[18]=e[l],n[20]=l,n}function ku(t,e,l){const n=t.slice();return n[21]=e[l],n}function wu(t){let e,l,n,i,o,u=t[7],a=[];for(let _=0;_t[14].call(e))},m(f,_){S(f,e,_),s(e,l),s(l,n),s(l,i),s(l,o),s(e,u),c&&c.m(e,null),a=mo(e,t[14].bind(e))},p(f,[_]){_&1024&&J(i,f[10]),f[7]?c?c.p(f,_):(c=wu(f),c.c(),c.m(e,null)):c&&(c.d(1),c=null)},i:pe,o:pe,d(f){f&&$(e),c&&c.d(),a()}}}let zm=12;function Gm(t,e,l){let n;Yc.subscribe(I=>{l(11,n=I)});let i,o=0;function u(){n.data.unshift(0),l(11,n.data=n.data.slice(0,n.size),n),o+=10,i=setTimeout(u,1e4)}Bc.subscribe(I=>{o>0?n.data&&I.u-o>=10&&(i&&clearTimeout(i),n.data.unshift(I.i-I.e),l(11,n.data=n.data.slice(0,n.size),n),o+=10,i=setTimeout(u,1e4)):o=I.u});let a,c,f,_,p,b,v,d,g,w,T,M,P;function L(){f=this.clientWidth,_=this.clientHeight,l(0,f),l(1,_)}return t.$$.update=()=>{if(t.$$.dirty&14847&&(l(2,p=parseInt(_)-50),l(3,b=f-35),l(9,M=b/n.size),l(13,c=0),l(12,a=0),n.data)){for(let F in n.data){let C=n.data[F];l(12,a=Math.max(Math.ceil(C/1e3)*1e3,a)),l(13,c=Math.min(Math.ceil(C/1e3)*1e3,c))}l(10,P=a>2500?"kW":"W"),l(7,w=[]);for(let F=c;F2500?(F/1e3).toFixed(1):F});l(8,T=[]);for(let F=c;F0||t[0].e>0}}),{c(){e=m("div"),re(l.$$.fragment),r(e,"class","cnt")},m(i,o){S(i,e,o),ie(l,e,null),n=!0},p(i,o){const u={};o&2&&(u.sysinfo=i[1]),o&1&&(u.data=i[0].ea),o&1&&(u.currency=i[0].pc),o&1&&(u.hasExport=i[0].om>0||i[0].e>0),l.$set(u)},i(i){n||(O(l.$$.fragment,i),n=!0)},o(i){q(l.$$.fragment,i),n=!1},d(i){i&&$(e),se(l)}}}function Ru(t){let e,l,n;return l=new Hm({}),{c(){e=m("div"),re(l.$$.fragment),r(e,"class","cnt h-64")},m(i,o){S(i,e,o),ie(l,e,null),n=!0},i(i){n||(O(l.$$.fragment,i),n=!0)},o(i){q(l.$$.fragment,i),n=!1},d(i){i&&$(e),se(l)}}}function Iu(t){let e,l,n;return l=new Vm({}),{c(){e=m("div"),re(l.$$.fragment),r(e,"class","cnt gwf")},m(i,o){S(i,e,o),ie(l,e,null),n=!0},i(i){n||(O(l.$$.fragment,i),n=!0)},o(i){q(l.$$.fragment,i),n=!1},d(i){i&&$(e),se(l)}}}function Lu(t){let e,l,n;return l=new Em({props:{json:t[2],sysinfo:t[1]}}),{c(){e=m("div"),re(l.$$.fragment),r(e,"class","cnt gwf")},m(i,o){S(i,e,o),ie(l,e,null),n=!0},p(i,o){const u={};o&4&&(u.json=i[2]),o&2&&(u.sysinfo=i[1]),l.$set(u)},i(i){n||(O(l.$$.fragment,i),n=!0)},o(i){q(l.$$.fragment,i),n=!1},d(i){i&&$(e),se(l)}}}function Ou(t){let e,l,n;return l=new Dm({props:{json:t[3],sysinfo:t[1]}}),{c(){e=m("div"),re(l.$$.fragment),r(e,"class","cnt gwf")},m(i,o){S(i,e,o),ie(l,e,null),n=!0},p(i,o){const u={};o&8&&(u.json=i[3]),o&2&&(u.sysinfo=i[1]),l.$set(u)},i(i){n||(O(l.$$.fragment,i),n=!0)},o(i){q(l.$$.fragment,i),n=!1},d(i){i&&$(e),se(l)}}}function Fu(t){let e,l,n;return l=new Lm({props:{json:t[4],sysinfo:t[1]}}),{c(){e=m("div"),re(l.$$.fragment),r(e,"class","cnt gwf")},m(i,o){S(i,e,o),ie(l,e,null),n=!0},p(i,o){const u={};o&16&&(u.json=i[4]),o&2&&(u.sysinfo=i[1]),l.$set(u)},i(i){n||(O(l.$$.fragment,i),n=!0)},o(i){q(l.$$.fragment,i),n=!1},d(i){i&&$(e),se(l)}}}function qu(t){let e,l,n;return l=new qm({props:{json:t[5]}}),{c(){e=m("div"),re(l.$$.fragment),r(e,"class","cnt gwf")},m(i,o){S(i,e,o),ie(l,e,null),n=!0},p(i,o){const u={};o&32&&(u.json=i[5]),l.$set(u)},i(i){n||(O(l.$$.fragment,i),n=!0)},o(i){q(l.$$.fragment,i),n=!1},d(i){i&&$(e),se(l)}}}function Km(t){let e,l=Xe(t[1].ui.i,t[0].i),n,i=Xe(t[1].ui.e,t[0].om||t[0].e>0),o,u=Xe(t[1].ui.v,t[0].u1>100||t[0].u2>100||t[0].u3>100),a,c=Xe(t[1].ui.a,t[0].i1>.01||t[0].i2>.01||t[0].i3>.01),f,_=Xe(t[1].ui.r,t[0].ri>0||t[0].re>0||t[0].ric>0||t[0].rec>0),p,b=Xe(t[1].ui.c,t[0].ea),v,d=Xe(t[1].ui.t,t[0].pr&&(t[0].pr.startsWith("10YNO")||t[0].pr.startsWith("10Y1001A1001A4"))),g,w=Xe(t[1].ui.l),T,M=Xe(t[1].ui.p,t[0].pe&&!Number.isNaN(t[0].p)),P,L=Xe(t[1].ui.d,t[3]),I,F=Xe(t[1].ui.m,t[4]),C,R=Xe(t[1].ui.s,t[0].t&&t[0].t!=-127&&t[5].c>1),ne,H=l&&Tu(t),z=i&&Nu(t),U=u&&Eu(t),K=c&&Au(t),Q=_&&Pu(t),G=b&&Du(t),X=d&&Ru(),Y=w&&Iu(),j=M&&Lu(t),x=L&&Ou(t),ae=F&&Fu(t),ee=R&&qu(t);return{c(){e=m("div"),H&&H.c(),n=h(),z&&z.c(),o=h(),U&&U.c(),a=h(),K&&K.c(),f=h(),Q&&Q.c(),p=h(),G&&G.c(),v=h(),X&&X.c(),g=h(),Y&&Y.c(),T=h(),j&&j.c(),P=h(),x&&x.c(),I=h(),ae&&ae.c(),C=h(),ee&&ee.c(),r(e,"class","grid 2xl:grid-cols-6 xl:grid-cols-5 lg:grid-cols-4 md:grid-cols-3 sm:grid-cols-2")},m(V,W){S(V,e,W),H&&H.m(e,null),s(e,n),z&&z.m(e,null),s(e,o),U&&U.m(e,null),s(e,a),K&&K.m(e,null),s(e,f),Q&&Q.m(e,null),s(e,p),G&&G.m(e,null),s(e,v),X&&X.m(e,null),s(e,g),Y&&Y.m(e,null),s(e,T),j&&j.m(e,null),s(e,P),x&&x.m(e,null),s(e,I),ae&&ae.m(e,null),s(e,C),ee&&ee.m(e,null),ne=!0},p(V,[W]){W&3&&(l=Xe(V[1].ui.i,V[0].i)),l?H?(H.p(V,W),W&3&&O(H,1)):(H=Tu(V),H.c(),O(H,1),H.m(e,n)):H&&(Ae(),q(H,1,1,()=>{H=null}),Pe()),W&3&&(i=Xe(V[1].ui.e,V[0].om||V[0].e>0)),i?z?(z.p(V,W),W&3&&O(z,1)):(z=Nu(V),z.c(),O(z,1),z.m(e,o)):z&&(Ae(),q(z,1,1,()=>{z=null}),Pe()),W&3&&(u=Xe(V[1].ui.v,V[0].u1>100||V[0].u2>100||V[0].u3>100)),u?U?(U.p(V,W),W&3&&O(U,1)):(U=Eu(V),U.c(),O(U,1),U.m(e,a)):U&&(Ae(),q(U,1,1,()=>{U=null}),Pe()),W&3&&(c=Xe(V[1].ui.a,V[0].i1>.01||V[0].i2>.01||V[0].i3>.01)),c?K?(K.p(V,W),W&3&&O(K,1)):(K=Au(V),K.c(),O(K,1),K.m(e,f)):K&&(Ae(),q(K,1,1,()=>{K=null}),Pe()),W&3&&(_=Xe(V[1].ui.r,V[0].ri>0||V[0].re>0||V[0].ric>0||V[0].rec>0)),_?Q?(Q.p(V,W),W&3&&O(Q,1)):(Q=Pu(V),Q.c(),O(Q,1),Q.m(e,p)):Q&&(Ae(),q(Q,1,1,()=>{Q=null}),Pe()),W&3&&(b=Xe(V[1].ui.c,V[0].ea)),b?G?(G.p(V,W),W&3&&O(G,1)):(G=Du(V),G.c(),O(G,1),G.m(e,v)):G&&(Ae(),q(G,1,1,()=>{G=null}),Pe()),W&3&&(d=Xe(V[1].ui.t,V[0].pr&&(V[0].pr.startsWith("10YNO")||V[0].pr.startsWith("10Y1001A1001A4")))),d?X?W&3&&O(X,1):(X=Ru(),X.c(),O(X,1),X.m(e,g)):X&&(Ae(),q(X,1,1,()=>{X=null}),Pe()),W&2&&(w=Xe(V[1].ui.l)),w?Y?W&2&&O(Y,1):(Y=Iu(),Y.c(),O(Y,1),Y.m(e,T)):Y&&(Ae(),q(Y,1,1,()=>{Y=null}),Pe()),W&3&&(M=Xe(V[1].ui.p,V[0].pe&&!Number.isNaN(V[0].p))),M?j?(j.p(V,W),W&3&&O(j,1)):(j=Lu(V),j.c(),O(j,1),j.m(e,P)):j&&(Ae(),q(j,1,1,()=>{j=null}),Pe()),W&10&&(L=Xe(V[1].ui.d,V[3])),L?x?(x.p(V,W),W&10&&O(x,1)):(x=Ou(V),x.c(),O(x,1),x.m(e,I)):x&&(Ae(),q(x,1,1,()=>{x=null}),Pe()),W&18&&(F=Xe(V[1].ui.m,V[4])),F?ae?(ae.p(V,W),W&18&&O(ae,1)):(ae=Fu(V),ae.c(),O(ae,1),ae.m(e,C)):ae&&(Ae(),q(ae,1,1,()=>{ae=null}),Pe()),W&35&&(R=Xe(V[1].ui.s,V[0].t&&V[0].t!=-127&&V[5].c>1)),R?ee?(ee.p(V,W),W&35&&O(ee,1)):(ee=qu(V),ee.c(),O(ee,1),ee.m(e,null)):ee&&(Ae(),q(ee,1,1,()=>{ee=null}),Pe())},i(V){ne||(O(H),O(z),O(U),O(K),O(Q),O(G),O(X),O(Y),O(j),O(x),O(ae),O(ee),ne=!0)},o(V){q(H),q(z),q(U),q(K),q(Q),q(G),q(X),q(Y),q(j),q(x),q(ae),q(ee),ne=!1},d(V){V&&$(e),H&&H.d(),z&&z.d(),U&&U.d(),K&&K.d(),Q&&Q.d(),G&&G.d(),X&&X.d(),Y&&Y.d(),j&&j.d(),x&&x.d(),ae&&ae.d(),ee&&ee.d()}}}function Ym(t,e,l){let{data:n={}}=e,{sysinfo:i={}}=e,o={},u={},a={},c={};return go.subscribe(f=>{l(2,o=f)}),Hc.subscribe(f=>{l(3,u=f)}),Wc.subscribe(f=>{l(4,a=f)}),Gc.subscribe(f=>{l(5,c=f)}),t.$$set=f=>{"data"in f&&l(0,n=f.data),"sysinfo"in f&&l(1,i=f.sysinfo)},[n,i,o,u,a,c]}class Qm extends Ie{constructor(e){super(),Re(this,e,Ym,Km,Ee,{data:0,sysinfo:1})}}let lo={};const hi=it(lo);async function Xm(){lo=await(await fetch("/configuration.json")).json(),hi.set(lo)}let no={};const e1=it(no);async function Zm(){no=await(await fetch("/priceconfig.json")).json(),e1.set(no)}function Bu(t,e,l){const n=t.slice();return n[2]=e[l],n[4]=l,n}function Jm(t){let e;return{c(){e=m("option"),e.textContent="UART0",e.__value=3,e.value=e.__value},m(l,n){S(l,e,n)},d(l){l&&$(e)}}}function xm(t){let e;return{c(){e=m("option"),e.textContent="UART0",e.__value=20,e.value=e.__value},m(l,n){S(l,e,n)},d(l){l&&$(e)}}}function Uu(t){let e;return{c(){e=m("option"),e.textContent="UART2",e.__value=113,e.value=e.__value},m(l,n){S(l,e,n)},d(l){l&&$(e)}}}function ju(t){let e,l,n;return{c(){e=m("option"),e.textContent="UART1",l=h(),n=m("option"),n.textContent="UART2",e.__value=9,e.value=e.__value,n.__value=16,n.value=n.__value},m(i,o){S(i,e,o),S(i,l,o),S(i,n,o)},d(i){i&&$(e),i&&$(l),i&&$(n)}}}function Hu(t){let e;return{c(){e=m("option"),e.textContent="UART1",e.__value=18,e.value=e.__value},m(l,n){S(l,e,n)},d(l){l&&$(e)}}}function Wu(t){let e,l,n;return{c(){e=m("option"),l=E("GPIO"),n=E(t[4]),e.__value=t[4],e.value=e.__value},m(i,o){S(i,e,o),s(e,l),s(e,n)},d(i){i&&$(e)}}}function zu(t){let e,l=t[4]>1&&!(t[0]=="esp32"&&(t[4]==9||t[4]==16))&&!((t[0]=="esp32s2"||t[0]=="esp32s3")&&t[4]==18)&&!(t[0]=="esp8266"&&(t[4]==3||t[4]==113))&&Wu(t);return{c(){l&&l.c(),e=Ke()},m(n,i){l&&l.m(n,i),S(n,e,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=Wu(n),l.c(),l.m(e.parentNode,e)):l&&(l.d(1),l=null)},d(n){l&&l.d(n),n&&$(e)}}}function e_(t){let e,l,n,i,o;function u(d,g){return d[0]=="esp32c3"?xm:Jm}let a=u(t),c=a(t),f=t[0]=="esp8266"&&Uu(),_=(t[0]=="esp32"||t[0]=="esp32solo")&&ju(),p=(t[0]=="esp32s2"||t[0]=="esp32s3")&&Hu(),b={length:t[1]+1},v=[];for(let d=0;d{"chip"in o&&l(0,n=o.chip)},t.$$.update=()=>{if(t.$$.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 io extends Ie{constructor(e){super(),Re(this,e,t_,e_,Ee,{chip:0})}}function Gu(t){let e,l,n=t[1]&&Vu(t);return{c(){e=m("div"),l=m("div"),n&&n.c(),r(l,"class","fixed inset-0 bg-gray-500 dark:bg-gray-900 bg-opacity-50 flex items-center justify-center"),r(e,"class","z-50"),r(e,"aria-modal","true")},m(i,o){S(i,e,o),s(e,l),n&&n.m(l,null)},p(i,o){i[1]?n?n.p(i,o):(n=Vu(i),n.c(),n.m(l,null)):n&&(n.d(1),n=null)},d(i){i&&$(e),n&&n.d()}}}function Vu(t){let e,l;return{c(){e=m("div"),l=E(t[1]),r(e,"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){S(n,e,i),s(e,l)},p(n,i){i&2&&J(l,n[1])},d(n){n&&$(e)}}}function l_(t){let e,l=t[0]&&Gu(t);return{c(){l&&l.c(),e=Ke()},m(n,i){l&&l.m(n,i),S(n,e,i)},p(n,[i]){n[0]?l?l.p(n,i):(l=Gu(n),l.c(),l.m(e.parentNode,e)):l&&(l.d(1),l=null)},i:pe,o:pe,d(n){l&&l.d(n),n&&$(e)}}}function n_(t,e,l){let{active:n}=e,{message:i}=e;return t.$$set=o=>{"active"in o&&l(0,n=o.active),"message"in o&&l(1,i=o.message)},[n,i]}class kt extends Ie{constructor(e){super(),Re(this,e,n_,l_,Ee,{active:0,message:1})}}function Ku(t,e,l){const n=t.slice();return n[1]=e[l],n}function Yu(t){let e,l,n=t[1]+"",i;return{c(){e=m("option"),l=E("Europe/"),i=E(n),e.__value="Europe/"+t[1],e.value=e.__value},m(o,u){S(o,e,u),s(e,l),s(e,i)},p:pe,d(o){o&&$(e)}}}function i_(t){let e,l,n,i=t[0],o=[];for(let u=0;u>1&1,A=0;A0;y--)A[y]=A[y]?A[y-1]^I.EXPONENT[R._modN(I.LOG[A[y]]+N)]:A[y-1];A[0]=I.EXPONENT[R._modN(I.LOG[A[0]]+N)]}for(N=0;N<=k;N++)A[N]=I.LOG[A[N]]},_checkBadness:function(){var N,y,k,A,D,Z=0,le=this._badness,fe=this.buffer,de=this.width;for(D=0;Dde*de;)ue-=de*de,Oe++;for(Z+=Oe*R.N4,A=0;A=le-2&&(N=le-2,D>9&&N--);var fe=N;if(D>9){for(Z[fe+2]=0,Z[fe+3]=0;fe--;)y=Z[fe],Z[fe+3]|=255&y<<4,Z[fe+2]=y>>4;Z[2]|=255&N<<4,Z[1]=N>>4,Z[0]=64|N>>12}else{for(Z[fe+1]=0,Z[fe+2]=0;fe--;)y=Z[fe],Z[fe+2]|=255&y<<4,Z[fe+1]=y>>4;Z[1]|=255&N<<4,Z[0]=64|N>>4}for(fe=N+3-(D<10);fe=5&&(k+=R.N1+A[y]-5);for(y=3;yN||A[y-3]*3>=A[y]*4||A[y+3]*3>=A[y]*4)&&(k+=R.N3);return k},_finish:function(){this._stringBuffer=this.buffer.slice();var N,y,k=0,A=3e4;for(y=0;y<8&&(this._applyMask(y),N=this._checkBadness(),N>=1)A&1&&(D[Z-1-y+Z*8]=1,y<6?D[8+Z*y]=1:D[8+Z*(y+1)]=1);for(y=0;y<7;y++,A>>=1)A&1&&(D[8+Z*(Z-7+y)]=1,y?D[6-y+Z*8]=1:D[7+Z*8]=1)},_interleaveBlocks:function(){var N,y,k=this._dataBlock,A=this._ecc,D=this._eccBlock,Z=0,le=this._calculateMaxLength(),fe=this._neccBlock1,de=this._neccBlock2,Ce=this._stringBuffer;for(N=0;N1)for(N=T.BLOCK[A],k=D-7;;){for(y=D-7;y>N-3&&(this._addAlignment(y,k),!(y6)for(N=C.BLOCK[Z-7],y=17,k=0;k<6;k++)for(A=0;A<3;A++,y--)1&(y>11?Z>>y-12:N>>y)?(D[5-k+le*(2-A+le-11)]=1,D[2-A+le-11+le*(5-k)]=1):(this._setMask(5-k,2-A+le-11),this._setMask(2-A+le-11,5-k))},_isMasked:function(N,y){var k=R._getMaskBit(N,y);return this._mask[k]===1},_pack:function(){var N,y,k,A=1,D=1,Z=this.width,le=Z-1,fe=Z-1,de=(this._dataBlock+this._eccBlock)*(this._neccBlock1+this._neccBlock2)+this._neccBlock2;for(y=0;yy&&(k=N,N=y,y=k),k=y,k+=y*y,k>>=1,k+=N,k},_modN:function(N){for(;N>=255;)N-=255,N=(N>>8)+(N&255);return N},N1:3,N2:3,N3:40,N4:10}),ne=R,H=v.extend({draw:function(){this.element.src=this.qrious.toDataURL()},reset:function(){this.element.src=""},resize:function(){var N=this.element;N.width=N.height=this.qrious.size}}),z=H,U=p.extend(function(N,y,k,A){this.name=N,this.modifiable=Boolean(y),this.defaultValue=k,this._valueTransformer=A},{transform:function(N){var y=this._valueTransformer;return typeof y=="function"?y(N,this):N}}),K=U,Q=p.extend(null,{abs:function(N){return N!=null?Math.abs(N):null},hasOwn:function(N,y){return Object.prototype.hasOwnProperty.call(N,y)},noop:function(){},toUpperCase:function(N){return N!=null?N.toUpperCase():null}}),G=Q,X=p.extend(function(N){this.options={},N.forEach(function(y){this.options[y.name]=y},this)},{exists:function(N){return this.options[N]!=null},get:function(N,y){return X._get(this.options[N],y)},getAll:function(N){var y,k=this.options,A={};for(y in k)G.hasOwn(k,y)&&(A[y]=X._get(k[y],N));return A},init:function(N,y,k){typeof k!="function"&&(k=G.noop);var A,D;for(A in this.options)G.hasOwn(this.options,A)&&(D=this.options[A],X._set(D,D.defaultValue,y),X._createAccessor(D,y,k));this._setAll(N,y,!0)},set:function(N,y,k){return this._set(N,y,k)},setAll:function(N,y){return this._setAll(N,y)},_set:function(N,y,k,A){var D=this.options[N];if(!D)throw new Error("Invalid option: "+N);if(!D.modifiable&&!A)throw new Error("Option cannot be modified: "+N);return X._set(D,y,k)},_setAll:function(N,y,k){if(!N)return!1;var A,D=!1;for(A in N)G.hasOwn(N,A)&&this._set(A,N[A],y,k)&&(D=!0);return D}},{_createAccessor:function(N,y,k){var A={get:function(){return X._get(N,y)}};N.modifiable&&(A.set=function(D){X._set(N,D,y)&&k(D,N)}),Object.defineProperty(y,N.name,A)},_get:function(N,y){return y["_"+N.name]},_set:function(N,y,k){var A="_"+N.name,D=k[A],Z=N.transform(y!=null?y:N.defaultValue);return k[A]=Z,Z!==D}}),Y=X,j=p.extend(function(){this._services={}},{getService:function(N){var y=this._services[N];if(!y)throw new Error("Service is not being managed with name: "+N);return y},setService:function(N,y){if(this._services[N])throw new Error("Service is already managed with name: "+N);y&&(this._services[N]=y)}}),x=j,ae=new Y([new K("background",!0,"white"),new K("backgroundAlpha",!0,1,G.abs),new K("element"),new K("foreground",!0,"black"),new K("foregroundAlpha",!0,1,G.abs),new K("level",!0,"L",G.toUpperCase),new K("mime",!0,"image/png"),new K("padding",!0,null,G.abs),new K("size",!0,100,G.abs),new K("value",!0,"")]),ee=new x,V=p.extend(function(N){ae.init(N,this,this.update.bind(this));var y=ae.get("element",this),k=ee.getService("element"),A=y&&k.isCanvas(y)?y:k.createCanvas(),D=y&&k.isImage(y)?y:k.createImage();this._canvasRenderer=new g(this,A,!0),this._imageRenderer=new z(this,D,D===y),this.update()},{get:function(){return ae.getAll(this)},set:function(N){ae.setAll(N,this)&&this.update()},toDataURL:function(N){return this.canvas.toDataURL(N||this.mime)},update:function(){var N=new ne({level:this.level,value:this.value});this._canvasRenderer.render(N),this._imageRenderer.render(N)}},{use:function(N){ee.setService(N.getName(),N)}});Object.defineProperties(V.prototype,{canvas:{get:function(){return this._canvasRenderer.getElement()}},image:{get:function(){return this._imageRenderer.getElement()}}});var W=V,we=W,He=p.extend({getName:function(){}}),Le=He,Se=Le.extend({createCanvas:function(){},createImage:function(){},getName:function(){return"element"},isCanvas:function(N){},isImage:function(N){}}),ye=Se,ve=ye.extend({createCanvas:function(){return document.createElement("canvas")},createImage:function(){return document.createElement("img")},isCanvas:function(N){return N instanceof HTMLCanvasElement},isImage:function(N){return N instanceof HTMLImageElement}}),Te=ve;we.use(new Te);var be=we;return be})})(l1);const f_=l1.exports;function c_(t){let e,l;return{c(){e=m("img"),Ws(e.src,l=t[2])||r(e,"src",l),r(e,"alt",t[0]),r(e,"class",t[1])},m(n,i){S(n,e,i)},p(n,[i]){i&4&&!Ws(e.src,l=n[2])&&r(e,"src",l),i&1&&r(e,"alt",n[0]),i&2&&r(e,"class",n[1])},i:pe,o:pe,d(n){n&&$(e)}}}function m_(t,e,l){const n=new f_;let{errorCorrection:i="L"}=e,{background:o="#fff"}=e,{color:u="#000"}=e,{size:a="200"}=e,{value:c=""}=e,{padding:f=0}=e,{className:_="qrcode"}=e,p="";function b(){n.set({background:o,foreground:u,level:i,padding:f,size:a,value:c}),l(2,p=n.toDataURL("image/jpeg"))}return ac(()=>{b()}),t.$$set=v=>{"errorCorrection"in v&&l(3,i=v.errorCorrection),"background"in v&&l(4,o=v.background),"color"in v&&l(5,u=v.color),"size"in v&&l(6,a=v.size),"value"in v&&l(0,c=v.value),"padding"in v&&l(7,f=v.padding),"className"in v&&l(1,_=v.className)},t.$$.update=()=>{t.$$.dirty&1&&c&&b()},[c,_,p,i,o,u,a,f]}class __ extends Ie{constructor(e){super(),Re(this,e,m_,c_,Ee,{errorCorrection:3,background:4,color:5,size:6,value:0,padding:7,className:1})}}function Qu(t,e,l){const n=t.slice();return n[101]=e[l],n[102]=e,n[103]=l,n}function Xu(t,e,l){const n=t.slice();return n[104]=e[l],n[105]=e,n[106]=l,n}function p_(t,e,l){const n=t.slice();return n[107]=e[l],n}function d_(t,e,l){const n=t.slice();return n[110]=e[l],n}function v_(t){let e,l;return{c(){e=m("option"),l=E(t[110]),e.__value=t[110],e.value=e.__value},m(n,i){S(n,e,i),s(e,l)},p:pe,d(n){n&&$(e)}}}function h_(t){let e;return{c(){e=E("Configure price")},m(l,n){S(l,e,n)},d(l){l&&$(e)}}}function Zu(t){let e,l,n,i;return{c(){e=m("br"),l=m("input"),r(l,"name","pt"),r(l,"type","text"),r(l,"class","in-s"),r(l,"placeholder","ENTSO-E API key, optional, read docs")},m(o,u){S(o,e,u),S(o,l,u),oe(l,t[3].p.t),n||(i=te(l,"input",t[20]),n=!0)},p(o,u){u[0]&8&&l.value!==o[3].p.t&&oe(l,o[3].p.t)},d(o){o&&$(e),o&&$(l),n=!1,i()}}}function Ju(t){let e,l,n,i,o,u,a,c,f,_,p,b,v;return{c(){e=m("div"),l=E("Username"),n=m("br"),i=h(),o=m("input"),u=h(),a=m("div"),c=E("Password"),f=m("br"),_=h(),p=m("input"),r(o,"name","gu"),r(o,"type","text"),r(o,"class","in-s"),r(e,"class","my-1"),r(p,"name","gp"),r(p,"type","password"),r(p,"class","in-s"),r(a,"class","my-1")},m(d,g){S(d,e,g),s(e,l),s(e,n),s(e,i),s(e,o),oe(o,t[3].g.u),S(d,u,g),S(d,a,g),s(a,c),s(a,f),s(a,_),s(a,p),oe(p,t[3].g.p),b||(v=[te(o,"input",t[22]),te(p,"input",t[23])],b=!0)},p(d,g){g[0]&8&&o.value!==d[3].g.u&&oe(o,d[3].g.u),g[0]&8&&p.value!==d[3].g.p&&oe(p,d[3].g.p)},d(d){d&&$(e),d&&$(u),d&&$(a),b=!1,ze(v)}}}function b_(t){let e,l=t[107]*100+"",n;return{c(){e=m("option"),n=E(l),e.__value=t[107]*100,e.value=e.__value},m(i,o){S(i,e,o),s(e,n)},p:pe,d(i){i&&$(e)}}}function xu(t){let e,l,n,i;return{c(){e=m("br"),l=m("input"),r(l,"name","mek"),r(l,"type","text"),r(l,"class","in-s")},m(o,u){S(o,e,u),S(o,l,u),oe(l,t[3].m.e.k),n||(i=te(l,"input",t[33]),n=!0)},p(o,u){u[0]&8&&l.value!==o[3].m.e.k&&oe(l,o[3].m.e.k)},d(o){o&&$(e),o&&$(l),n=!1,i()}}}function ef(t){let e,l,n,i,o,u,a;return{c(){e=m("div"),l=E("Authentication key"),n=m("br"),i=h(),o=m("input"),r(o,"name","mea"),r(o,"type","text"),r(o,"class","in-s"),r(e,"class","my-1")},m(c,f){S(c,e,f),s(e,l),s(e,n),s(e,i),s(e,o),oe(o,t[3].m.e.a),u||(a=te(o,"input",t[34]),u=!0)},p(c,f){f[0]&8&&o.value!==c[3].m.e.a&&oe(o,c[3].m.e.a)},d(c){c&&$(e),u=!1,a()}}}function tf(t){let e,l,n,i,o,u,a,c,f,_,p,b,v,d,g,w,T,M,P,L,I,F,C,R,ne,H;return{c(){e=m("div"),l=m("div"),n=E("Watt"),i=m("br"),o=h(),u=m("input"),a=h(),c=m("div"),f=E("Volt"),_=m("br"),p=h(),b=m("input"),v=h(),d=m("div"),g=E("Amp"),w=m("br"),T=h(),M=m("input"),P=h(),L=m("div"),I=E("kWh"),F=m("br"),C=h(),R=m("input"),r(u,"name","mmw"),r(u,"type","number"),r(u,"min","0.00"),r(u,"max","1000"),r(u,"step","0.001"),r(u,"class","in-f tr w-full"),r(l,"class","w-1/4"),r(b,"name","mmv"),r(b,"type","number"),r(b,"min","0.00"),r(b,"max","1000"),r(b,"step","0.001"),r(b,"class","in-m tr w-full"),r(c,"class","w-1/4"),r(M,"name","mma"),r(M,"type","number"),r(M,"min","0.00"),r(M,"max","1000"),r(M,"step","0.001"),r(M,"class","in-m tr w-full"),r(d,"class","w-1/4"),r(R,"name","mmc"),r(R,"type","number"),r(R,"min","0.00"),r(R,"max","1000"),r(R,"step","0.001"),r(R,"class","in-l tr w-full"),r(L,"class","w-1/4"),r(e,"class","flex my-1")},m(z,U){S(z,e,U),s(e,l),s(l,n),s(l,i),s(l,o),s(l,u),oe(u,t[3].m.m.w),s(e,a),s(e,c),s(c,f),s(c,_),s(c,p),s(c,b),oe(b,t[3].m.m.v),s(e,v),s(e,d),s(d,g),s(d,w),s(d,T),s(d,M),oe(M,t[3].m.m.a),s(e,P),s(e,L),s(L,I),s(L,F),s(L,C),s(L,R),oe(R,t[3].m.m.c),ne||(H=[te(u,"input",t[36]),te(b,"input",t[37]),te(M,"input",t[38]),te(R,"input",t[39])],ne=!0)},p(z,U){U[0]&8&&ge(u.value)!==z[3].m.m.w&&oe(u,z[3].m.m.w),U[0]&8&&ge(b.value)!==z[3].m.m.v&&oe(b,z[3].m.m.v),U[0]&8&&ge(M.value)!==z[3].m.m.a&&oe(M,z[3].m.m.a),U[0]&8&&ge(R.value)!==z[3].m.m.c&&oe(R,z[3].m.m.c)},d(z){z&&$(e),ne=!1,ze(H)}}}function lf(t){let e;return{c(){e=m("option"),e.textContent="Ethernet",e.__value=3,e.value=e.__value},m(l,n){S(l,e,n)},d(l){l&&$(e)}}}function nf(t){let e,l,n,i,o,u,a,c,f,_,p,b,v,d,g,w,T,M,P,L,I,F,C,R,ne,H,z,U,K,Q,G,X,Y,j,x,ae,ee,V;return{c(){e=m("div"),l=E("SSID"),n=m("br"),i=h(),o=m("input"),u=h(),a=m("div"),c=E("Password"),f=m("br"),_=h(),p=m("input"),b=h(),v=m("div"),d=m("div"),g=E("Power saving"),w=m("br"),T=h(),M=m("select"),P=m("option"),P.textContent="Default",L=m("option"),L.textContent="Off",I=m("option"),I.textContent="Minimum",F=m("option"),F.textContent="Maximum",C=h(),R=m("div"),ne=E("Power"),H=m("br"),z=h(),U=m("div"),K=m("input"),Q=h(),G=m("span"),G.textContent="dBm",X=h(),Y=m("div"),j=m("label"),x=m("input"),ae=E(" Allow 802.11b legacy rates"),r(o,"name","ws"),r(o,"type","text"),r(o,"class","in-s"),r(e,"class","my-1"),r(p,"name","wp"),r(p,"type","password"),r(p,"class","in-s"),r(a,"class","my-1"),P.__value=255,P.value=P.__value,L.__value=0,L.value=L.__value,I.__value=1,I.value=I.__value,F.__value=2,F.value=F.__value,r(M,"name","wz"),r(M,"class","in-s"),t[3].w.z===void 0&&We(()=>t[43].call(M)),r(d,"class","w-1/2"),r(K,"name","ww"),r(K,"type","number"),r(K,"min","0"),r(K,"max","20.5"),r(K,"step","0.5"),r(K,"class","in-f tr w-full"),r(G,"class","in-post"),r(U,"class","flex"),r(R,"class","ml-2 w-1/2"),r(v,"class","my-1 flex"),r(x,"type","checkbox"),r(x,"name","wb"),x.__value="true",x.value=x.__value,r(x,"class","rounded mb-1"),r(Y,"class","my-3")},m(W,we){S(W,e,we),s(e,l),s(e,n),s(e,i),s(e,o),oe(o,t[3].w.s),S(W,u,we),S(W,a,we),s(a,c),s(a,f),s(a,_),s(a,p),oe(p,t[3].w.p),S(W,b,we),S(W,v,we),s(v,d),s(d,g),s(d,w),s(d,T),s(d,M),s(M,P),s(M,L),s(M,I),s(M,F),$e(M,t[3].w.z,!0),s(v,C),s(v,R),s(R,ne),s(R,H),s(R,z),s(R,U),s(U,K),oe(K,t[3].w.w),s(U,Q),s(U,G),S(W,X,we),S(W,Y,we),s(Y,j),s(j,x),x.checked=t[3].w.b,s(j,ae),ee||(V=[te(o,"input",t[41]),te(p,"input",t[42]),te(M,"change",t[43]),te(K,"input",t[44]),te(x,"change",t[45])],ee=!0)},p(W,we){we[0]&8&&o.value!==W[3].w.s&&oe(o,W[3].w.s),we[0]&8&&p.value!==W[3].w.p&&oe(p,W[3].w.p),we[0]&8&&$e(M,W[3].w.z),we[0]&8&&ge(K.value)!==W[3].w.w&&oe(K,W[3].w.w),we[0]&8&&(x.checked=W[3].w.b)},d(W){W&&$(e),W&&$(u),W&&$(a),W&&$(b),W&&$(v),W&&$(X),W&&$(Y),ee=!1,ze(V)}}}function sf(t){let e,l,n,i,o,u,a,c,f,_,p,b,v,d,g,w;return{c(){e=m("div"),l=E("Gateway"),n=m("br"),i=h(),o=m("input"),u=h(),a=m("div"),c=E("DNS"),f=m("br"),_=h(),p=m("div"),b=m("input"),v=h(),d=m("input"),r(o,"name","ng"),r(o,"type","text"),r(o,"class","in-s"),r(e,"class","my-1"),r(b,"name","nd1"),r(b,"type","text"),r(b,"class","in-f w-full"),r(d,"name","nd2"),r(d,"type","text"),r(d,"class","in-l w-full"),r(p,"class","flex"),r(a,"class","my-1")},m(T,M){S(T,e,M),s(e,l),s(e,n),s(e,i),s(e,o),oe(o,t[3].n.g),S(T,u,M),S(T,a,M),s(a,c),s(a,f),s(a,_),s(a,p),s(p,b),oe(b,t[3].n.d1),s(p,v),s(p,d),oe(d,t[3].n.d2),g||(w=[te(o,"input",t[49]),te(b,"input",t[50]),te(d,"input",t[51])],g=!0)},p(T,M){M[0]&8&&o.value!==T[3].n.g&&oe(o,T[3].n.g),M[0]&8&&b.value!==T[3].n.d1&&oe(b,T[3].n.d1),M[0]&8&&d.value!==T[3].n.d2&&oe(d,T[3].n.d2)},d(T){T&&$(e),T&&$(u),T&&$(a),g=!1,ze(w)}}}function of(t){let e,l,n,i,o;return{c(){e=m("label"),l=m("input"),n=E(" SSL"),r(l,"type","checkbox"),r(l,"name","qs"),l.__value="true",l.value=l.__value,r(l,"class","rounded mb-1"),r(e,"class","float-right mr-3")},m(u,a){S(u,e,a),s(e,l),l.checked=t[3].q.s.e,s(e,n),i||(o=[te(l,"change",t[55]),te(l,"change",t[14])],i=!0)},p(u,a){a[0]&8&&(l.checked=u[3].q.s.e)},d(u){u&&$(e),i=!1,ze(o)}}}function rf(t){let e,l,n,i,o,u,a,c,f,_,p,b,v;const d=[k_,g_],g=[];function w(C,R){return C[3].q.s.c?0:1}n=w(t),i=g[n]=d[n](t);const T=[$_,C_],M=[];function P(C,R){return C[3].q.s.r?0:1}a=P(t),c=M[a]=T[a](t);const L=[N_,T_],I=[];function F(C,R){return C[3].q.s.k?0:1}return p=F(t),b=I[p]=L[p](t),{c(){e=m("div"),l=m("span"),i.c(),o=h(),u=m("span"),c.c(),f=h(),_=m("span"),b.c(),r(l,"class","flex pr-2"),r(u,"class","flex pr-2"),r(_,"class","flex pr-2"),r(e,"class","my-1 flex")},m(C,R){S(C,e,R),s(e,l),g[n].m(l,null),s(e,o),s(e,u),M[a].m(u,null),s(e,f),s(e,_),I[p].m(_,null),v=!0},p(C,R){let ne=n;n=w(C),n===ne?g[n].p(C,R):(Ae(),q(g[ne],1,1,()=>{g[ne]=null}),Pe(),i=g[n],i?i.p(C,R):(i=g[n]=d[n](C),i.c()),O(i,1),i.m(l,null));let H=a;a=P(C),a===H?M[a].p(C,R):(Ae(),q(M[H],1,1,()=>{M[H]=null}),Pe(),c=M[a],c?c.p(C,R):(c=M[a]=T[a](C),c.c()),O(c,1),c.m(u,null));let z=p;p=F(C),p===z?I[p].p(C,R):(Ae(),q(I[z],1,1,()=>{I[z]=null}),Pe(),b=I[p],b?b.p(C,R):(b=I[p]=L[p](C),b.c()),O(b,1),b.m(_,null))},i(C){v||(O(i),O(c),O(b),v=!0)},o(C){q(i),q(c),q(b),v=!1},d(C){C&&$(e),g[n].d(),M[a].d(),I[p].d()}}}function g_(t){let e,l;return e=new Qt({props:{to:"/mqtt-ca",$$slots:{default:[w_]},$$scope:{ctx:t}}}),{c(){re(e.$$.fragment)},m(n,i){ie(e,n,i),l=!0},p(n,i){const o={};i[3]&1048576&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){l||(O(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){se(e,n)}}}function k_(t){let e,l,n,i,o,u,a,c;return l=new Qt({props:{to:"/mqtt-ca",$$slots:{default:[y_]},$$scope:{ctx:t}}}),o=new gs({}),{c(){e=m("span"),re(l.$$.fragment),n=h(),i=m("span"),re(o.$$.fragment),r(e,"class","rounded-l-md bg-green-500 text-green-100 text-xs font-semibold px-2.5 py-1"),r(i,"class","rounded-r-md bg-red-500 text-red-100 text-xs px-2.5 py-1")},m(f,_){S(f,e,_),ie(l,e,null),S(f,n,_),S(f,i,_),ie(o,i,null),u=!0,a||(c=[te(i,"click",t[11]),te(i,"keypress",t[11])],a=!0)},p(f,_){const p={};_[3]&1048576&&(p.$$scope={dirty:_,ctx:f}),l.$set(p)},i(f){u||(O(l.$$.fragment,f),O(o.$$.fragment,f),u=!0)},o(f){q(l.$$.fragment,f),q(o.$$.fragment,f),u=!1},d(f){f&&$(e),se(l),f&&$(n),f&&$(i),se(o),a=!1,ze(c)}}}function w_(t){let e,l;return e=new an({props:{color:"blue",text:"Upload CA",title:"Click here to upload CA"}}),{c(){re(e.$$.fragment)},m(n,i){ie(e,n,i),l=!0},p:pe,i(n){l||(O(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){se(e,n)}}}function y_(t){let e;return{c(){e=E("CA OK")},m(l,n){S(l,e,n)},d(l){l&&$(e)}}}function C_(t){let e,l;return e=new Qt({props:{to:"/mqtt-cert",$$slots:{default:[S_]},$$scope:{ctx:t}}}),{c(){re(e.$$.fragment)},m(n,i){ie(e,n,i),l=!0},p(n,i){const o={};i[3]&1048576&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){l||(O(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){se(e,n)}}}function $_(t){let e,l,n,i,o,u,a,c;return l=new Qt({props:{to:"/mqtt-cert",$$slots:{default:[M_]},$$scope:{ctx:t}}}),o=new gs({}),{c(){e=m("span"),re(l.$$.fragment),n=h(),i=m("span"),re(o.$$.fragment),r(e,"class","rounded-l-md bg-green-500 text-green-100 text-xs font-semibold px-2.5 py-1"),r(i,"class","rounded-r-md bg-red-500 text-red-100 text-xs px-2.5 py-1")},m(f,_){S(f,e,_),ie(l,e,null),S(f,n,_),S(f,i,_),ie(o,i,null),u=!0,a||(c=[te(i,"click",t[12]),te(i,"keypress",t[12])],a=!0)},p(f,_){const p={};_[3]&1048576&&(p.$$scope={dirty:_,ctx:f}),l.$set(p)},i(f){u||(O(l.$$.fragment,f),O(o.$$.fragment,f),u=!0)},o(f){q(l.$$.fragment,f),q(o.$$.fragment,f),u=!1},d(f){f&&$(e),se(l),f&&$(n),f&&$(i),se(o),a=!1,ze(c)}}}function S_(t){let e,l;return e=new an({props:{color:"blue",text:"Upload cert",title:"Click here to upload certificate"}}),{c(){re(e.$$.fragment)},m(n,i){ie(e,n,i),l=!0},p:pe,i(n){l||(O(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){se(e,n)}}}function M_(t){let e;return{c(){e=E("Cert OK")},m(l,n){S(l,e,n)},d(l){l&&$(e)}}}function T_(t){let e,l;return e=new Qt({props:{to:"/mqtt-key",$$slots:{default:[E_]},$$scope:{ctx:t}}}),{c(){re(e.$$.fragment)},m(n,i){ie(e,n,i),l=!0},p(n,i){const o={};i[3]&1048576&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){l||(O(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){se(e,n)}}}function N_(t){let e,l,n,i,o,u,a,c;return l=new Qt({props:{to:"/mqtt-key",$$slots:{default:[A_]},$$scope:{ctx:t}}}),o=new gs({}),{c(){e=m("span"),re(l.$$.fragment),n=h(),i=m("span"),re(o.$$.fragment),r(e,"class","rounded-l-md bg-green-500 text-green-100 text-xs font-semibold px-2.5 py-1"),r(i,"class","rounded-r-md bg-red-500 text-red-100 text-xs px-2.5 py-1")},m(f,_){S(f,e,_),ie(l,e,null),S(f,n,_),S(f,i,_),ie(o,i,null),u=!0,a||(c=[te(i,"click",t[13]),te(i,"keypress",t[13])],a=!0)},p(f,_){const p={};_[3]&1048576&&(p.$$scope={dirty:_,ctx:f}),l.$set(p)},i(f){u||(O(l.$$.fragment,f),O(o.$$.fragment,f),u=!0)},o(f){q(l.$$.fragment,f),q(o.$$.fragment,f),u=!1},d(f){f&&$(e),se(l),f&&$(n),f&&$(i),se(o),a=!1,ze(c)}}}function E_(t){let e,l;return e=new an({props:{color:"blue",text:"Upload key",title:"Click here to upload key"}}),{c(){re(e.$$.fragment)},m(n,i){ie(e,n,i),l=!0},p:pe,i(n){l||(O(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){se(e,n)}}}function A_(t){let e;return{c(){e=E("Key OK")},m(l,n){S(l,e,n)},d(l){l&&$(e)}}}function af(t){let e,l,n,i,o,u,a,c,f,_,p,b,v,d,g,w,T,M,P,L,I,F,C,R,ne,H,z,U,K,Q,G,X;return o=new Rt({}),{c(){e=m("div"),l=m("strong"),l.textContent="Domoticz",n=h(),i=m("a"),re(o.$$.fragment),u=h(),a=m("input"),c=h(),f=m("div"),_=m("div"),p=E("Electricity IDX"),b=m("br"),v=h(),d=m("input"),g=h(),w=m("div"),T=E("Current IDX"),M=m("br"),P=h(),L=m("input"),I=h(),F=m("div"),C=E(`Voltage IDX: L1, L2 & L3 `),R=m("div"),ne=m("input"),H=h(),z=m("input"),U=h(),K=m("input"),r(l,"class","text-sm"),r(i,"href",It("MQTT-configuration#domoticz")),r(i,"target","_blank"),r(i,"class","float-right"),r(a,"type","hidden"),r(a,"name","o"),a.value="true",r(d,"name","oe"),r(d,"type","text"),r(d,"class","in-f tr w-full"),r(_,"class","w-1/2"),r(L,"name","oc"),r(L,"type","text"),r(L,"class","in-l tr w-full"),r(w,"class","w-1/2"),r(f,"class","my-1 flex"),r(ne,"name","ou1"),r(ne,"type","text"),r(ne,"class","in-f tr w-1/3"),r(z,"name","ou2"),r(z,"type","text"),r(z,"class","in-m tr w-1/3"),r(K,"name","ou3"),r(K,"type","text"),r(K,"class","in-l tr w-1/3"),r(R,"class","flex"),r(F,"class","my-1"),r(e,"class","cnt")},m(Y,j){S(Y,e,j),s(e,l),s(e,n),s(e,i),ie(o,i,null),s(e,u),s(e,a),s(e,c),s(e,f),s(f,_),s(_,p),s(_,b),s(_,v),s(_,d),oe(d,t[3].o.e),s(f,g),s(f,w),s(w,T),s(w,M),s(w,P),s(w,L),oe(L,t[3].o.c),s(e,I),s(e,F),s(F,C),s(F,R),s(R,ne),oe(ne,t[3].o.u1),s(R,H),s(R,z),oe(z,t[3].o.u2),s(R,U),s(R,K),oe(K,t[3].o.u3),Q=!0,G||(X=[te(d,"input",t[63]),te(L,"input",t[64]),te(ne,"input",t[65]),te(z,"input",t[66]),te(K,"input",t[67])],G=!0)},p(Y,j){j[0]&8&&d.value!==Y[3].o.e&&oe(d,Y[3].o.e),j[0]&8&&L.value!==Y[3].o.c&&oe(L,Y[3].o.c),j[0]&8&&ne.value!==Y[3].o.u1&&oe(ne,Y[3].o.u1),j[0]&8&&z.value!==Y[3].o.u2&&oe(z,Y[3].o.u2),j[0]&8&&K.value!==Y[3].o.u3&&oe(K,Y[3].o.u3)},i(Y){Q||(O(o.$$.fragment,Y),Q=!0)},o(Y){q(o.$$.fragment,Y),Q=!1},d(Y){Y&&$(e),se(o),G=!1,ze(X)}}}function uf(t){let e,l,n,i,o,u,a,c,f,_,p,b,v,d,g,w,T,M,P,L,I,F,C,R,ne,H,z,U,K;return o=new Rt({}),{c(){e=m("div"),l=m("strong"),l.textContent="Home-Assistant",n=h(),i=m("a"),re(o.$$.fragment),u=h(),a=m("input"),c=h(),f=m("div"),_=E("Discovery topic prefix"),p=m("br"),b=h(),v=m("input"),d=h(),g=m("div"),w=E("Hostname for URL"),T=m("br"),M=h(),P=m("input"),I=h(),F=m("div"),C=E("Name tag"),R=m("br"),ne=h(),H=m("input"),r(l,"class","text-sm"),r(i,"href",It("MQTT-configuration#home-assistant")),r(i,"target","_blank"),r(i,"class","float-right"),r(a,"type","hidden"),r(a,"name","h"),a.value="true",r(v,"name","ht"),r(v,"type","text"),r(v,"class","in-s"),r(v,"placeholder","homeassistant"),r(f,"class","my-1"),r(P,"name","hh"),r(P,"type","text"),r(P,"class","in-s"),r(P,"placeholder",L=t[3].g.h+".local"),r(g,"class","my-1"),r(H,"name","hn"),r(H,"type","text"),r(H,"class","in-s"),r(F,"class","my-1"),r(e,"class","cnt")},m(Q,G){S(Q,e,G),s(e,l),s(e,n),s(e,i),ie(o,i,null),s(e,u),s(e,a),s(e,c),s(e,f),s(f,_),s(f,p),s(f,b),s(f,v),oe(v,t[3].h.t),s(e,d),s(e,g),s(g,w),s(g,T),s(g,M),s(g,P),oe(P,t[3].h.h),s(e,I),s(e,F),s(F,C),s(F,R),s(F,ne),s(F,H),oe(H,t[3].h.n),z=!0,U||(K=[te(v,"input",t[68]),te(P,"input",t[69]),te(H,"input",t[70])],U=!0)},p(Q,G){G[0]&8&&v.value!==Q[3].h.t&&oe(v,Q[3].h.t),(!z||G[0]&8&&L!==(L=Q[3].g.h+".local"))&&r(P,"placeholder",L),G[0]&8&&P.value!==Q[3].h.h&&oe(P,Q[3].h.h),G[0]&8&&H.value!==Q[3].h.n&&oe(H,Q[3].h.n)},i(Q){z||(O(o.$$.fragment,Q),z=!0)},o(Q){q(o.$$.fragment,Q),z=!1},d(Q){Q&&$(e),se(o),U=!1,ze(K)}}}function ff(t){let e,l,n,i,o,u,a,c,f,_,p,b,v,d,g,w,T,M,P,L,I,F,C,R,ne,H,z,U,K,Q,G,X,Y,j,x,ae;o=new Rt({});let ee=t[3].c.es&&cf(t);return{c(){e=m("div"),l=m("strong"),l.textContent="Cloud connections",n=h(),i=m("a"),re(o.$$.fragment),u=h(),a=m("input"),c=h(),f=m("div"),_=m("label"),p=m("input"),b=E(" Enable cloud upload"),v=h(),d=m("div"),g=E("Client ID"),w=m("br"),T=h(),M=m("input"),I=h(),F=m("div"),C=E("Client secret"),R=m("br"),ne=h(),H=m("input"),U=h(),K=m("div"),Q=m("label"),G=m("input"),X=E(" Energy Speedometer"),Y=h(),ee&&ee.c(),r(l,"class","text-sm"),r(i,"href",It("Cloud")),r(i,"target","_blank"),r(i,"class","float-right"),r(a,"type","hidden"),r(a,"name","c"),a.value="true",r(p,"type","checkbox"),r(p,"name","ce"),p.__value="true",p.value=p.__value,r(p,"class","rounded mb-1"),r(f,"class","my-1"),r(M,"name","ci"),r(M,"type","text"),r(M,"class","in-s"),r(M,"pattern",P=t[3].c.e?"[A-Z0-9]{16}":".*"),M.required=L=t[3].c.e,r(d,"class","my-1"),r(H,"name","cs"),r(H,"type","text"),r(H,"class","in-s"),r(H,"pattern",z=t[3].c.e&&t[3].c.s!="***"?"[A-Z0-9]{16}":".*"),r(F,"class","my-1"),r(G,"type","checkbox"),r(G,"class","rounded mb-1"),r(G,"name","ces"),G.__value="true",G.value=G.__value,r(K,"class","my-1"),r(e,"class","cnt")},m(V,W){S(V,e,W),s(e,l),s(e,n),s(e,i),ie(o,i,null),s(e,u),s(e,a),s(e,c),s(e,f),s(f,_),s(_,p),p.checked=t[3].c.e,s(_,b),s(e,v),s(e,d),s(d,g),s(d,w),s(d,T),s(d,M),oe(M,t[3].c.i),s(e,I),s(e,F),s(F,C),s(F,R),s(F,ne),s(F,H),oe(H,t[3].c.s),s(e,U),s(e,K),s(K,Q),s(Q,G),G.checked=t[3].c.es,s(Q,X),s(K,Y),ee&&ee.m(K,null),j=!0,x||(ae=[te(p,"change",t[71]),te(M,"input",t[72]),te(H,"input",t[73]),te(G,"change",t[74])],x=!0)},p(V,W){W[0]&8&&(p.checked=V[3].c.e),(!j||W[0]&8&&P!==(P=V[3].c.e?"[A-Z0-9]{16}":".*"))&&r(M,"pattern",P),(!j||W[0]&8&&L!==(L=V[3].c.e))&&(M.required=L),W[0]&8&&M.value!==V[3].c.i&&oe(M,V[3].c.i),(!j||W[0]&8&&z!==(z=V[3].c.e&&V[3].c.s!="***"?"[A-Z0-9]{16}":".*"))&&r(H,"pattern",z),W[0]&8&&H.value!==V[3].c.s&&oe(H,V[3].c.s),W[0]&8&&(G.checked=V[3].c.es),V[3].c.es?ee?(ee.p(V,W),W[0]&8&&O(ee,1)):(ee=cf(V),ee.c(),O(ee,1),ee.m(K,null)):ee&&(Ae(),q(ee,1,1,()=>{ee=null}),Pe())},i(V){j||(O(o.$$.fragment,V),O(ee),j=!0)},o(V){q(o.$$.fragment,V),q(ee),j=!1},d(V){V&&$(e),se(o),ee&&ee.d(),x=!1,ze(ae)}}}function cf(t){let e,l,n=t[0].mac+"",i,o,u,a,c=(t[0].meter.id?t[0].meter.id:"missing, required")+"",f,_,p,b,v=t[0].mac&&t[0].meter.id&&mf(t);return{c(){e=m("div"),l=E("MAC: "),i=E(n),o=h(),u=m("div"),a=E("Meter ID: "),f=E(c),_=h(),v&&v.c(),p=Ke(),r(e,"class","pl-5"),r(u,"class","pl-5")},m(d,g){S(d,e,g),s(e,l),s(e,i),S(d,o,g),S(d,u,g),s(u,a),s(u,f),S(d,_,g),v&&v.m(d,g),S(d,p,g),b=!0},p(d,g){(!b||g[0]&1)&&n!==(n=d[0].mac+"")&&J(i,n),(!b||g[0]&1)&&c!==(c=(d[0].meter.id?d[0].meter.id:"missing, required")+"")&&J(f,c),d[0].mac&&d[0].meter.id?v?(v.p(d,g),g[0]&1&&O(v,1)):(v=mf(d),v.c(),O(v,1),v.m(p.parentNode,p)):v&&(Ae(),q(v,1,1,()=>{v=null}),Pe())},i(d){b||(O(v),b=!0)},o(d){q(v),b=!1},d(d){d&&$(e),d&&$(o),d&&$(u),d&&$(_),v&&v.d(d),d&&$(p)}}}function mf(t){let e,l,n;return l=new __({props:{value:'{"mac":"'+t[0].mac+'","meter":"'+t[0].meter.id+'"}'}}),{c(){e=m("div"),re(l.$$.fragment),r(e,"class","pl-2")},m(i,o){S(i,e,o),ie(l,e,null),n=!0},p(i,o){const u={};o[0]&1&&(u.value='{"mac":"'+i[0].mac+'","meter":"'+i[0].meter.id+'"}'),l.$set(u)},i(i){n||(O(l.$$.fragment,i),n=!0)},o(i){q(l.$$.fragment,i),n=!1},d(i){i&&$(e),se(l)}}}function _f(t){let e,l,n,i,o,u,a,c,f,_,p,b,v,d,g,w,T,M,P;o=new Rt({});let L={length:9},I=[];for(let F=0;F20&&hf(t),p=t[3].i.d.d>0&&kf(t),b=t[0].chip=="esp8266"&&wf(t);return{c(){e=m("div"),l=m("strong"),l.textContent="Hardware",n=h(),i=m("a"),re(o.$$.fragment),u=h(),_&&_.c(),a=h(),p&&p.c(),c=h(),b&&b.c(),r(l,"class","text-sm"),r(i,"href",It("GPIO-configuration")),r(i,"target","_blank"),r(i,"class","float-right"),r(e,"class","cnt")},m(v,d){S(v,e,d),s(e,l),s(e,n),s(e,i),ie(o,i,null),s(e,u),_&&_.m(e,null),s(e,a),p&&p.m(e,null),s(e,c),b&&b.m(e,null),f=!0},p(v,d){v[0].board>20?_?(_.p(v,d),d[0]&1&&O(_,1)):(_=hf(v),_.c(),O(_,1),_.m(e,a)):_&&(Ae(),q(_,1,1,()=>{_=null}),Pe()),v[3].i.d.d>0?p?p.p(v,d):(p=kf(v),p.c(),p.m(e,c)):p&&(p.d(1),p=null),v[0].chip=="esp8266"?b?b.p(v,d):(b=wf(v),b.c(),b.m(e,null)):b&&(b.d(1),b=null)},i(v){f||(O(o.$$.fragment,v),O(_),f=!0)},o(v){q(o.$$.fragment,v),q(_),f=!1},d(v){v&&$(e),se(o),_&&_.d(),p&&p.d(),b&&b.d()}}}function hf(t){let e,l,n,i,o,u,a,c,f,_,p,b,v,d,g,w,T,M,P,L,I,F,C,R,ne,H,z,U,K,Q,G,X,Y,j,x,ae,ee,V,W,we,He,Le,Se,ye,ve,Te,be,N,y,k,A,D,Z,le,fe,de,Ce,Oe,ue,Me,Je,Lt,st,wt,nt,Ot,Qe,Xt,zt,vt,xe,Ge,Ye,Ne,Ze,et;f=new io({props:{chip:t[0].chip}}),w=new io({props:{chip:t[0].chip}});let qe=t[0].chip!="esp8266"&&bf(t),Fe=t[3].i.v.p>0&&gf(t);return{c(){e=m("input"),l=h(),n=m("div"),i=m("div"),o=E("HAN RX"),u=m("br"),a=h(),c=m("select"),re(f.$$.fragment),_=h(),p=m("div"),b=E("HAN TX"),v=m("br"),d=h(),g=m("select"),re(w.$$.fragment),T=h(),M=m("div"),P=m("label"),L=m("input"),I=E(" pullup"),F=h(),C=m("div"),R=m("div"),ne=E("AP button"),H=m("br"),z=h(),U=m("input"),K=h(),Q=m("div"),G=E("LED"),X=m("br"),Y=h(),j=m("div"),x=m("input"),ae=h(),ee=m("div"),V=m("label"),W=m("input"),we=E(" inverted"),He=h(),Le=m("div"),Se=E("RGB"),ye=m("label"),ve=m("input"),Te=E(" inverted"),be=m("br"),N=h(),y=m("div"),k=m("input"),A=h(),D=m("input"),Z=h(),le=m("input"),fe=h(),de=m("div"),Ce=m("div"),Oe=E(`LED dis. GPIO `),ue=m("input"),Me=h(),Je=m("div"),Lt=E("Temperature"),st=m("br"),wt=h(),nt=m("input"),Ot=h(),Qe=m("div"),Xt=E("Analog temp"),zt=m("br"),vt=h(),xe=m("input"),Ge=h(),qe&&qe.c(),Ye=h(),Fe&&Fe.c(),r(e,"type","hidden"),r(e,"name","i"),e.value="true",r(c,"name","ihp"),r(c,"class","in-f w-full"),t[3].i.h.p===void 0&&We(()=>t[78].call(c)),r(i,"class","w-1/3"),r(g,"name","iht"),r(g,"class","in-l w-full"),t[3].i.h.t===void 0&&We(()=>t[79].call(g)),r(p,"class","w-1/3"),r(L,"name","ihu"),L.__value="true",L.value=L.__value,r(L,"type","checkbox"),r(L,"class","rounded mb-1"),r(P,"class","ml-2"),r(M,"class","w-1/3"),r(n,"class","flex flex-wrap"),r(U,"name","ia"),r(U,"type","number"),r(U,"min","0"),r(U,"max",t[6]),r(U,"class","in-f tr w-full"),r(R,"class","w-1/3"),r(x,"name","ilp"),r(x,"type","number"),r(x,"min","0"),r(x,"max",t[6]),r(x,"class","in-l tr w-full"),r(j,"class","flex"),r(Q,"class","w-1/3"),r(W,"name","ili"),W.__value="true",W.value=W.__value,r(W,"type","checkbox"),r(W,"class","rounded mb-1"),r(V,"class","ml-4"),r(ee,"class","w-1/3"),r(ve,"name","iri"),ve.__value="true",ve.value=ve.__value,r(ve,"type","checkbox"),r(ve,"class","rounded mb-1"),r(ye,"class","ml-4"),r(k,"name","irr"),r(k,"type","number"),r(k,"min","0"),r(k,"max",t[6]),r(k,"class","in-f tr w-1/3"),r(D,"name","irg"),r(D,"type","number"),r(D,"min","0"),r(D,"max",t[6]),r(D,"class","in-m tr w-1/3"),r(le,"name","irb"),r(le,"type","number"),r(le,"min","0"),r(le,"max",t[6]),r(le,"class","in-l tr w-1/3"),r(y,"class","flex"),r(Le,"class","w-full"),r(ue,"name","idd"),r(ue,"type","number"),r(ue,"min","0"),r(ue,"max",t[6]),r(ue,"class","in-s tr"),r(Ce,"class","my-1 pr-1 w-1/3"),r(de,"class","w-full"),r(nt,"name","itd"),r(nt,"type","number"),r(nt,"min","0"),r(nt,"max",t[6]),r(nt,"class","in-f tr w-full"),r(Je,"class","my-1 w-1/3"),r(xe,"name","ita"),r(xe,"type","number"),r(xe,"min","0"),r(xe,"max",t[6]),r(xe,"class","in-l tr w-full"),r(Qe,"class","my-1 pr-1 w-1/3"),r(C,"class","flex flex-wrap")},m(_e,ce){S(_e,e,ce),S(_e,l,ce),S(_e,n,ce),s(n,i),s(i,o),s(i,u),s(i,a),s(i,c),ie(f,c,null),$e(c,t[3].i.h.p,!0),s(n,_),s(n,p),s(p,b),s(p,v),s(p,d),s(p,g),ie(w,g,null),$e(g,t[3].i.h.t,!0),s(n,T),s(n,M),s(M,P),s(P,L),L.checked=t[3].i.h.u,s(P,I),S(_e,F,ce),S(_e,C,ce),s(C,R),s(R,ne),s(R,H),s(R,z),s(R,U),oe(U,t[3].i.a),s(C,K),s(C,Q),s(Q,G),s(Q,X),s(Q,Y),s(Q,j),s(j,x),oe(x,t[3].i.l.p),s(C,ae),s(C,ee),s(ee,V),s(V,W),W.checked=t[3].i.l.i,s(V,we),s(C,He),s(C,Le),s(Le,Se),s(Le,ye),s(ye,ve),ve.checked=t[3].i.r.i,s(ye,Te),s(Le,be),s(Le,N),s(Le,y),s(y,k),oe(k,t[3].i.r.r),s(y,A),s(y,D),oe(D,t[3].i.r.g),s(y,Z),s(y,le),oe(le,t[3].i.r.b),s(C,fe),s(C,de),s(de,Ce),s(Ce,Oe),s(Ce,ue),oe(ue,t[3].i.d.d),s(C,Me),s(C,Je),s(Je,Lt),s(Je,st),s(Je,wt),s(Je,nt),oe(nt,t[3].i.t.d),s(C,Ot),s(C,Qe),s(Qe,Xt),s(Qe,zt),s(Qe,vt),s(Qe,xe),oe(xe,t[3].i.t.a),s(C,Ge),qe&&qe.m(C,null),s(C,Ye),Fe&&Fe.m(C,null),Ne=!0,Ze||(et=[te(c,"change",t[78]),te(g,"change",t[79]),te(L,"change",t[80]),te(U,"input",t[81]),te(x,"input",t[82]),te(W,"change",t[83]),te(ve,"change",t[84]),te(k,"input",t[85]),te(D,"input",t[86]),te(le,"input",t[87]),te(ue,"input",t[88]),te(nt,"input",t[89]),te(xe,"input",t[90])],Ze=!0)},p(_e,ce){const Be={};ce[0]&1&&(Be.chip=_e[0].chip),f.$set(Be),ce[0]&8&&$e(c,_e[3].i.h.p);const pt={};ce[0]&1&&(pt.chip=_e[0].chip),w.$set(pt),ce[0]&8&&$e(g,_e[3].i.h.t),ce[0]&8&&(L.checked=_e[3].i.h.u),(!Ne||ce[0]&64)&&r(U,"max",_e[6]),ce[0]&8&&ge(U.value)!==_e[3].i.a&&oe(U,_e[3].i.a),(!Ne||ce[0]&64)&&r(x,"max",_e[6]),ce[0]&8&&ge(x.value)!==_e[3].i.l.p&&oe(x,_e[3].i.l.p),ce[0]&8&&(W.checked=_e[3].i.l.i),ce[0]&8&&(ve.checked=_e[3].i.r.i),(!Ne||ce[0]&64)&&r(k,"max",_e[6]),ce[0]&8&&ge(k.value)!==_e[3].i.r.r&&oe(k,_e[3].i.r.r),(!Ne||ce[0]&64)&&r(D,"max",_e[6]),ce[0]&8&&ge(D.value)!==_e[3].i.r.g&&oe(D,_e[3].i.r.g),(!Ne||ce[0]&64)&&r(le,"max",_e[6]),ce[0]&8&&ge(le.value)!==_e[3].i.r.b&&oe(le,_e[3].i.r.b),(!Ne||ce[0]&64)&&r(ue,"max",_e[6]),ce[0]&8&&ge(ue.value)!==_e[3].i.d.d&&oe(ue,_e[3].i.d.d),(!Ne||ce[0]&64)&&r(nt,"max",_e[6]),ce[0]&8&&ge(nt.value)!==_e[3].i.t.d&&oe(nt,_e[3].i.t.d),(!Ne||ce[0]&64)&&r(xe,"max",_e[6]),ce[0]&8&&ge(xe.value)!==_e[3].i.t.a&&oe(xe,_e[3].i.t.a),_e[0].chip!="esp8266"?qe?qe.p(_e,ce):(qe=bf(_e),qe.c(),qe.m(C,Ye)):qe&&(qe.d(1),qe=null),_e[3].i.v.p>0?Fe?Fe.p(_e,ce):(Fe=gf(_e),Fe.c(),Fe.m(C,null)):Fe&&(Fe.d(1),Fe=null)},i(_e){Ne||(O(f.$$.fragment,_e),O(w.$$.fragment,_e),Ne=!0)},o(_e){q(f.$$.fragment,_e),q(w.$$.fragment,_e),Ne=!1},d(_e){_e&&$(e),_e&&$(l),_e&&$(n),se(f),se(w),_e&&$(F),_e&&$(C),qe&&qe.d(),Fe&&Fe.d(),Ze=!1,ze(et)}}}function bf(t){let e,l,n,i,o,u,a;return{c(){e=m("div"),l=E("Vcc"),n=m("br"),i=h(),o=m("input"),r(o,"name","ivp"),r(o,"type","number"),r(o,"min","0"),r(o,"max",t[6]),r(o,"class","in-s tr w-full"),r(e,"class","my-1 pl-1 w-1/3")},m(c,f){S(c,e,f),s(e,l),s(e,n),s(e,i),s(e,o),oe(o,t[3].i.v.p),u||(a=te(o,"input",t[91]),u=!0)},p(c,f){f[0]&64&&r(o,"max",c[6]),f[0]&8&&ge(o.value)!==c[3].i.v.p&&oe(o,c[3].i.v.p)},d(c){c&&$(e),u=!1,a()}}}function gf(t){let e,l,n,i,o,u,a,c,f,_;return{c(){e=m("div"),l=E("Voltage divider"),n=m("br"),i=h(),o=m("div"),u=m("input"),a=h(),c=m("input"),r(u,"name","ivdv"),r(u,"type","number"),r(u,"min","0"),r(u,"max","65535"),r(u,"class","in-f tr w-full"),r(u,"placeholder","VCC"),r(c,"name","ivdg"),r(c,"type","number"),r(c,"min","0"),r(c,"max","65535"),r(c,"class","in-l tr w-full"),r(c,"placeholder","GND"),r(o,"class","flex"),r(e,"class","my-1")},m(p,b){S(p,e,b),s(e,l),s(e,n),s(e,i),s(e,o),s(o,u),oe(u,t[3].i.v.d.v),s(o,a),s(o,c),oe(c,t[3].i.v.d.g),f||(_=[te(u,"input",t[92]),te(c,"input",t[93])],f=!0)},p(p,b){b[0]&8&&ge(u.value)!==p[3].i.v.d.v&&oe(u,p[3].i.v.d.v),b[0]&8&&ge(c.value)!==p[3].i.v.d.g&&oe(c,p[3].i.v.d.g)},d(p){p&&$(e),f=!1,ze(_)}}}function kf(t){let e,l,n,i,o,u,a;return{c(){e=m("div"),l=E(`LED behaviour - `),n=m("select"),i=m("option"),i.textContent="Enabled",o=m("option"),o.textContent="Disabled",i.__value=0,i.value=i.__value,o.__value=1,o.value=o.__value,r(n,"name","idb"),r(n,"class","in-s"),t[3].i.d.b===void 0&&We(()=>t[94].call(n)),r(e,"class","my-1 w-full")},m(c,f){S(c,e,f),s(e,l),s(e,n),s(n,i),s(n,o),$e(n,t[3].i.d.b,!0),u||(a=te(n,"change",t[94]),u=!0)},p(c,f){f[0]&8&&$e(n,c[3].i.d.b)},d(c){c&&$(e),u=!1,a()}}}function wf(t){let e,l,n,i,o,u,a,c,f,_,p,b,v,d,g,w,T,M=(t[0].board==2||t[0].board==100)&&yf(t);return{c(){e=m("input"),l=h(),n=m("div"),i=m("div"),o=E("Vcc offset"),u=m("br"),a=h(),c=m("input"),f=h(),_=m("div"),p=E("Multiplier"),b=m("br"),v=h(),d=m("input"),g=h(),M&&M.c(),r(e,"type","hidden"),r(e,"name","iv"),e.value="true",r(c,"name","ivo"),r(c,"type","number"),r(c,"min","0.0"),r(c,"max","3.5"),r(c,"step","0.01"),r(c,"class","in-f tr w-full"),r(i,"class","w-1/3"),r(d,"name","ivm"),r(d,"type","number"),r(d,"min","0.1"),r(d,"max","10"),r(d,"step","0.01"),r(d,"class","in-l tr w-full"),r(_,"class","w-1/3 pr-1"),r(n,"class","my-1 flex flex-wrap")},m(P,L){S(P,e,L),S(P,l,L),S(P,n,L),s(n,i),s(i,o),s(i,u),s(i,a),s(i,c),oe(c,t[3].i.v.o),s(n,f),s(n,_),s(_,p),s(_,b),s(_,v),s(_,d),oe(d,t[3].i.v.m),s(n,g),M&&M.m(n,null),w||(T=[te(c,"input",t[95]),te(d,"input",t[96])],w=!0)},p(P,L){L[0]&8&&ge(c.value)!==P[3].i.v.o&&oe(c,P[3].i.v.o),L[0]&8&&ge(d.value)!==P[3].i.v.m&&oe(d,P[3].i.v.m),P[0].board==2||P[0].board==100?M?M.p(P,L):(M=yf(P),M.c(),M.m(n,null)):M&&(M.d(1),M=null)},d(P){P&&$(e),P&&$(l),P&&$(n),M&&M.d(),w=!1,ze(T)}}}function yf(t){let e,l,n,i,o,u,a;return{c(){e=m("div"),l=E("Boot limit"),n=m("br"),i=h(),o=m("input"),r(o,"name","ivb"),r(o,"type","number"),r(o,"min","2.5"),r(o,"max","3.5"),r(o,"step","0.1"),r(o,"class","in-s tr w-full"),r(e,"class","w-1/3 pl-1")},m(c,f){S(c,e,f),s(e,l),s(e,n),s(e,i),s(e,o),oe(o,t[3].i.v.b),u||(a=te(o,"input",t[97]),u=!0)},p(c,f){f[0]&8&&ge(o.value)!==c[3].i.v.b&&oe(o,c[3].i.v.b)},d(c){c&&$(e),u=!1,a()}}}function Cf(t){let e,l,n,i,o,u,a,c,f,_,p,b,v,d,g,w,T=t[3].d.t&&$f();return{c(){e=m("div"),e.textContent="Debug can cause sudden reboots. Do not leave on!",l=h(),n=m("div"),i=m("label"),o=m("input"),u=E(" Enable telnet"),a=h(),T&&T.c(),c=h(),f=m("div"),_=m("select"),p=m("option"),p.textContent="Verbose",b=m("option"),b.textContent="Debug",v=m("option"),v.textContent="Info",d=m("option"),d.textContent="Warning",r(e,"class","bd-red"),r(o,"type","checkbox"),r(o,"name","dt"),o.__value="true",o.value=o.__value,r(o,"class","rounded mb-1"),r(n,"class","my-1"),p.__value=1,p.value=p.__value,b.__value=2,b.value=b.__value,v.__value=3,v.value=v.__value,d.__value=4,d.value=d.__value,r(_,"name","dl"),r(_,"class","in-s"),t[3].d.l===void 0&&We(()=>t[100].call(_)),r(f,"class","my-1")},m(M,P){S(M,e,P),S(M,l,P),S(M,n,P),s(n,i),s(i,o),o.checked=t[3].d.t,s(i,u),S(M,a,P),T&&T.m(M,P),S(M,c,P),S(M,f,P),s(f,_),s(_,p),s(_,b),s(_,v),s(_,d),$e(_,t[3].d.l,!0),g||(w=[te(o,"change",t[99]),te(_,"change",t[100])],g=!0)},p(M,P){P[0]&8&&(o.checked=M[3].d.t),M[3].d.t?T||(T=$f(),T.c(),T.m(c.parentNode,c)):T&&(T.d(1),T=null),P[0]&8&&$e(_,M[3].d.l)},d(M){M&&$(e),M&&$(l),M&&$(n),M&&$(a),T&&T.d(M),M&&$(c),M&&$(f),g=!1,ze(w)}}}function $f(t){let e;return{c(){e=m("div"),e.textContent="Telnet is unsafe and should be off when not in use",r(e,"class","bd-red")},m(l,n){S(l,e,n)},d(l){l&&$(e)}}}function P_(t){let e,l,n,i,o,u,a,c,f,_,p,b,v,d,g,w,T,M,P,L,I,F,C,R,ne,H,z,U,K,Q,G,X,Y,j,x,ae,ee,V,W,we,He,Le,Se,ye,ve,Te,be,N,y,k,A,D,Z,le,fe,de,Ce,Oe,ue,Me,Je,Lt,st,wt,nt,Ot,Qe,Xt,zt,vt,xe,Ge,Ye,Ne,Ze,et,qe,Fe,_e,ce,Be,pt,Tl,Nl,El,Mi,Ti,je,_n,Ni,Al,Pl,Ei,Hl,Ai,Wl,Pi,hl,Di,Ri,Ii,Gt,Dl,Ve,yt,ht,si,Li,bl,Oi,zl,Zt,$o,So,Rl,rl,Il,Mo,Fi,To,bt,Ll,No,qi,pn,dn,vn,hn,Bi,Eo,Ft,Ui,Ao,Gl,Po,Do,Ro,al,bn,gn,Io,kn,Vl,Lo,Oo,Fo,wn,Jt,qo,ji,Bo,Kl,Uo,jo,Ho,yn,xt,Wo,Hi,zo,ks,Go,Yl,Wi,el,Vo,Ko,Yo,ws,zi,tl,Qo,Xo,Zo,qt,Gi,Jo,Cn,$n,xo,oi,er,Ql,tr,lr,nr,Vt,Sn,Mn,ir,sr,mt,Vi,or,Tn,Nn,rr,Xl,ar,ur,fr,Ol,ul,En,An,cr,Bt,Ki,Yi,mr,Ut,Pn,Qi,Xi,_r,ys,Zi,Ji,ll,pr,dr,ri,vr,Fl,hr,ai,nl,br,gr,kr,xi,gl,wr,lt,es,yr,Dn,Rn,Cr,ui,$r,fl,Sr,Cs,Mr,Tr,In,kl,Nr,il,Er,$s,Zl,Ar,Pr,Dr,wl,Rr,Jl,Ir,Lr,Or,yl,Fr,Ln,On,qr,Br,Ur,Cl,jr,Fn,Hr,Wr,zr,Ct,qn,Bn,Un,jn,Hn,Wn,Gr,xl,Vr,Kr,Yr,$l,Qr,Ss,Ms,Ts,Ns=t[3].p.r.startsWith("10YNO")||t[3].p.r.startsWith("10Y1001A1001A4"),Es,cl,ts,Xr,zn,Gn,Zr,fi,Jr,ci,xr,As,jt,ls,ea,Vn,Kn,ta,mi,la,ns,is,sl,na,ia,sa,ql,Ps,Yn,oa,ss,Qn,ra,os,Ds,en,Rs,tn,Is,ln,Ls,nn,Kt,Os,aa;a=new Rt({}),R=new o_({});let n1=["NOK","SEK","DKK","EUR","CHF"],_i=[];for(let B=0;B<5;B+=1)_i[B]=v_(d_(t,n1,B));vt=new Qt({props:{to:"/priceconfig",$$slots:{default:[h_]},$$scope:{ctx:t}}});let $t=t[3].p.e&&t[0].chip!="esp8266"&&Zu(t),St=t[3].g.s>0&&Ju(t);Pl=new Rt({});let i1=[24,48,96,192,384,576,1152],pi=[];for(let B=0;B<7;B+=1)pi[B]=b_(p_(t,i1,B));let Mt=t[3].m.e.e&&xu(t),Tt=t[3].m.e.e&&ef(t),Nt=t[3].m.m.e&&tf(t);$n=new Rt({});let Ht=t[0].if&&t[0].if.eth&&lf(),Et=(t[3].n.c==1||t[3].n.c==2)&&nf(t);Nn=new Rt({}),Pn=new t1({});let At=t[3].n.m=="static"&&sf(t);Rn=new Rt({});let Pt=t[0].chip!="esp8266"&&of(t),ot=t[3].q.s.e&&rf(t),rt=t[3].q.m==3&&af(t),at=t[3].q.m==4&&uf(t),ut=t[3].c.es!=null&&ff(t),ft=Ns&&_f(t);Gn=new Rt({});let Xn=t[7],gt=[];for(let B=0;B20||t[0].chip=="esp8266"||t[3].i.d.d>0)&&vf(t);Kn=new Rt({});let Dt=t[3].d.s&&Cf(t);return en=new kt({props:{active:t[1],message:"Loading configuration"}}),tn=new kt({props:{active:t[2],message:"Saving configuration"}}),ln=new kt({props:{active:t[4],message:"Performing factory reset"}}),nn=new kt({props:{active:t[5],message:"Device have been factory reset and switched to AP mode"}}),{c(){e=m("form"),l=m("div"),n=m("div"),i=m("strong"),i.textContent="General",o=h(),u=m("a"),re(a.$$.fragment),c=h(),f=m("input"),_=h(),p=m("div"),b=m("div"),v=m("div"),d=E("Hostname"),g=m("br"),w=h(),T=m("input"),M=h(),P=m("div"),L=E("Time zone"),I=m("br"),F=h(),C=m("select"),re(R.$$.fragment),ne=h(),H=m("input"),z=h(),U=m("div"),K=m("div"),Q=m("div"),G=E("Price region"),X=m("br"),Y=h(),j=m("select"),x=m("optgroup"),ae=m("option"),ae.textContent="NO1",ee=m("option"),ee.textContent="NO2",V=m("option"),V.textContent="NO3",W=m("option"),W.textContent="NO4",we=m("option"),we.textContent="NO5",He=m("optgroup"),Le=m("option"),Le.textContent="SE1",Se=m("option"),Se.textContent="SE2",ye=m("option"),ye.textContent="SE3",ve=m("option"),ve.textContent="SE4",Te=m("optgroup"),be=m("option"),be.textContent="DK1",N=m("option"),N.textContent="DK2",y=m("option"),y.textContent="Austria",k=m("option"),k.textContent="Belgium",A=m("option"),A.textContent="Czech Republic",D=m("option"),D.textContent="Estonia",Z=m("option"),Z.textContent="Finland",le=m("option"),le.textContent="France",fe=m("option"),fe.textContent="Germany",de=m("option"),de.textContent="Great Britain",Ce=m("option"),Ce.textContent="Latvia",Oe=m("option"),Oe.textContent="Lithuania",ue=m("option"),ue.textContent="Netherland",Me=m("option"),Me.textContent="Poland",Je=m("option"),Je.textContent="Switzerland",Lt=h(),st=m("div"),wt=E("Currency"),nt=m("br"),Ot=h(),Qe=m("select");for(let B=0;B<5;B+=1)_i[B].c();Xt=h(),zt=m("div"),re(vt.$$.fragment),xe=h(),Ge=m("div"),Ye=m("label"),Ne=m("input"),Ze=E(" Enable price fetch from remote server"),et=h(),$t&&$t.c(),qe=h(),Fe=m("div"),_e=E("Security"),ce=m("br"),Be=h(),pt=m("select"),Tl=m("option"),Tl.textContent="None",Nl=m("option"),Nl.textContent="Only configuration",El=m("option"),El.textContent="Everything",Mi=h(),St&&St.c(),Ti=h(),je=m("div"),_n=m("strong"),_n.textContent="Meter",Ni=h(),Al=m("a"),re(Pl.$$.fragment),Ei=h(),Hl=m("input"),Ai=h(),Wl=m("input"),Pi=h(),hl=m("div"),Di=E("Communication"),Ri=m("br"),Ii=h(),Gt=m("select"),Dl=m("option"),Dl.textContent="Passive (Push)",Ve=m("option"),Ve.textContent="Kamstrup (Pull)",yt=h(),ht=m("div"),si=m("span"),si.textContent="Buffer size",Li=h(),bl=m("span"),bl.textContent="Serial conf.",Oi=h(),zl=m("label"),Zt=m("input"),$o=E(" inverted"),So=h(),Rl=m("div"),rl=m("select"),Il=m("option"),Mo=E("Autodetect");for(let B=0;B<7;B+=1)pi[B].c();To=h(),bt=m("select"),Ll=m("option"),No=E("-"),pn=m("option"),pn.textContent="7N1",dn=m("option"),dn.textContent="8N1",vn=m("option"),vn.textContent="7E1",hn=m("option"),hn.textContent="8E1",Eo=h(),Ft=m("input"),Ao=h(),Gl=m("div"),Po=E("Voltage"),Do=m("br"),Ro=h(),al=m("select"),bn=m("option"),bn.textContent="400V (TN)",gn=m("option"),gn.textContent="230V (IT/TT)",Io=h(),kn=m("div"),Vl=m("div"),Lo=E("Main fuse"),Oo=m("br"),Fo=h(),wn=m("label"),Jt=m("input"),qo=h(),ji=m("span"),ji.textContent="A",Bo=h(),Kl=m("div"),Uo=E("Production"),jo=m("br"),Ho=h(),yn=m("label"),xt=m("input"),Wo=h(),Hi=m("span"),Hi.textContent="kWp",zo=h(),ks=m("div"),Go=h(),Yl=m("div"),Wi=m("label"),el=m("input"),Vo=E(" Meter is encrypted"),Ko=h(),Mt&&Mt.c(),Yo=h(),Tt&&Tt.c(),ws=h(),zi=m("label"),tl=m("input"),Qo=E(" Multipliers"),Xo=h(),Nt&&Nt.c(),Zo=h(),qt=m("div"),Gi=m("strong"),Gi.textContent="Connection",Jo=h(),Cn=m("a"),re($n.$$.fragment),xo=h(),oi=m("input"),er=h(),Ql=m("div"),tr=E("Connection"),lr=m("br"),nr=h(),Vt=m("select"),Sn=m("option"),Sn.textContent="WiFi",Mn=m("option"),Mn.textContent="Access point",Ht&&Ht.c(),ir=h(),Et&&Et.c(),sr=h(),mt=m("div"),Vi=m("strong"),Vi.textContent="Network",or=h(),Tn=m("a"),re(Nn.$$.fragment),rr=h(),Xl=m("div"),ar=E("IP"),ur=m("br"),fr=h(),Ol=m("div"),ul=m("select"),En=m("option"),En.textContent="DHCP",An=m("option"),An.textContent="Static",cr=h(),Bt=m("input"),mr=h(),Ut=m("select"),re(Pn.$$.fragment),_r=h(),At&&At.c(),ys=h(),Zi=m("div"),Ji=m("label"),ll=m("input"),pr=E(" enable mDNS"),dr=h(),ri=m("input"),vr=h(),Fl=m("div"),hr=E("NTP "),ai=m("label"),nl=m("input"),br=E(" obtain from DHCP"),gr=m("br"),kr=h(),xi=m("div"),gl=m("input"),wr=h(),lt=m("div"),es=m("strong"),es.textContent="MQTT",yr=h(),Dn=m("a"),re(Rn.$$.fragment),Cr=h(),ui=m("input"),$r=h(),fl=m("div"),Sr=E(`Server + `),n=m("select"),i=m("option"),i.textContent="Enabled",o=m("option"),o.textContent="Disabled",i.__value=0,i.value=i.__value,o.__value=1,o.value=o.__value,r(n,"name","idb"),r(n,"class","in-s"),t[3].i.d.b===void 0&&We(()=>t[94].call(n)),r(e,"class","my-1 w-full")},m(c,f){S(c,e,f),s(e,l),s(e,n),s(n,i),s(n,o),$e(n,t[3].i.d.b,!0),u||(a=te(n,"change",t[94]),u=!0)},p(c,f){f[0]&8&&$e(n,c[3].i.d.b)},d(c){c&&$(e),u=!1,a()}}}function wf(t){let e,l,n,i,o,u,a,c,f,_,p,b,v,d,g,w,T,M=(t[0].board==2||t[0].board==100)&&yf(t);return{c(){e=m("input"),l=h(),n=m("div"),i=m("div"),o=E("Vcc offset"),u=m("br"),a=h(),c=m("input"),f=h(),_=m("div"),p=E("Multiplier"),b=m("br"),v=h(),d=m("input"),g=h(),M&&M.c(),r(e,"type","hidden"),r(e,"name","iv"),e.value="true",r(c,"name","ivo"),r(c,"type","number"),r(c,"min","0.0"),r(c,"max","3.5"),r(c,"step","0.01"),r(c,"class","in-f tr w-full"),r(i,"class","w-1/3"),r(d,"name","ivm"),r(d,"type","number"),r(d,"min","0.1"),r(d,"max","10"),r(d,"step","0.01"),r(d,"class","in-l tr w-full"),r(_,"class","w-1/3 pr-1"),r(n,"class","my-1 flex flex-wrap")},m(P,L){S(P,e,L),S(P,l,L),S(P,n,L),s(n,i),s(i,o),s(i,u),s(i,a),s(i,c),oe(c,t[3].i.v.o),s(n,f),s(n,_),s(_,p),s(_,b),s(_,v),s(_,d),oe(d,t[3].i.v.m),s(n,g),M&&M.m(n,null),w||(T=[te(c,"input",t[95]),te(d,"input",t[96])],w=!0)},p(P,L){L[0]&8&&ge(c.value)!==P[3].i.v.o&&oe(c,P[3].i.v.o),L[0]&8&&ge(d.value)!==P[3].i.v.m&&oe(d,P[3].i.v.m),P[0].board==2||P[0].board==100?M?M.p(P,L):(M=yf(P),M.c(),M.m(n,null)):M&&(M.d(1),M=null)},d(P){P&&$(e),P&&$(l),P&&$(n),M&&M.d(),w=!1,ze(T)}}}function yf(t){let e,l,n,i,o,u,a;return{c(){e=m("div"),l=E("Boot limit"),n=m("br"),i=h(),o=m("input"),r(o,"name","ivb"),r(o,"type","number"),r(o,"min","2.5"),r(o,"max","3.5"),r(o,"step","0.1"),r(o,"class","in-s tr w-full"),r(e,"class","w-1/3 pl-1")},m(c,f){S(c,e,f),s(e,l),s(e,n),s(e,i),s(e,o),oe(o,t[3].i.v.b),u||(a=te(o,"input",t[97]),u=!0)},p(c,f){f[0]&8&&ge(o.value)!==c[3].i.v.b&&oe(o,c[3].i.v.b)},d(c){c&&$(e),u=!1,a()}}}function Cf(t){let e,l,n,i,o,u,a,c,f,_,p,b,v,d,g,w,T=t[3].d.t&&$f();return{c(){e=m("div"),e.textContent="Debug can cause sudden reboots. Do not leave on!",l=h(),n=m("div"),i=m("label"),o=m("input"),u=E(" Enable telnet"),a=h(),T&&T.c(),c=h(),f=m("div"),_=m("select"),p=m("option"),p.textContent="Verbose",b=m("option"),b.textContent="Debug",v=m("option"),v.textContent="Info",d=m("option"),d.textContent="Warning",r(e,"class","bd-red"),r(o,"type","checkbox"),r(o,"name","dt"),o.__value="true",o.value=o.__value,r(o,"class","rounded mb-1"),r(n,"class","my-1"),p.__value=1,p.value=p.__value,b.__value=2,b.value=b.__value,v.__value=3,v.value=v.__value,d.__value=4,d.value=d.__value,r(_,"name","dl"),r(_,"class","in-s"),t[3].d.l===void 0&&We(()=>t[100].call(_)),r(f,"class","my-1")},m(M,P){S(M,e,P),S(M,l,P),S(M,n,P),s(n,i),s(i,o),o.checked=t[3].d.t,s(i,u),S(M,a,P),T&&T.m(M,P),S(M,c,P),S(M,f,P),s(f,_),s(_,p),s(_,b),s(_,v),s(_,d),$e(_,t[3].d.l,!0),g||(w=[te(o,"change",t[99]),te(_,"change",t[100])],g=!0)},p(M,P){P[0]&8&&(o.checked=M[3].d.t),M[3].d.t?T||(T=$f(),T.c(),T.m(c.parentNode,c)):T&&(T.d(1),T=null),P[0]&8&&$e(_,M[3].d.l)},d(M){M&&$(e),M&&$(l),M&&$(n),M&&$(a),T&&T.d(M),M&&$(c),M&&$(f),g=!1,ze(w)}}}function $f(t){let e;return{c(){e=m("div"),e.textContent="Telnet is unsafe and should be off when not in use",r(e,"class","bd-red")},m(l,n){S(l,e,n)},d(l){l&&$(e)}}}function P_(t){let e,l,n,i,o,u,a,c,f,_,p,b,v,d,g,w,T,M,P,L,I,F,C,R,ne,H,z,U,K,Q,G,X,Y,j,x,ae,ee,V,W,we,He,Le,Se,ye,ve,Te,be,N,y,k,A,D,Z,le,fe,de,Ce,Oe,ue,Me,Je,Lt,st,wt,nt,Ot,Qe,Xt,zt,vt,xe,Ge,Ye,Ne,Ze,et,qe,Fe,_e,ce,Be,pt,Tl,Nl,El,Mi,Ti,je,_n,Ni,Al,Pl,Ei,Hl,Ai,Wl,Pi,hl,Di,Ri,Ii,Gt,Dl,Ve,yt,ht,si,Li,bl,Oi,zl,Zt,$o,So,Rl,rl,Il,Mo,Fi,To,bt,Ll,No,qi,pn,dn,vn,hn,Bi,Eo,Ft,Ui,Ao,Gl,Po,Do,Ro,al,bn,gn,Io,kn,Vl,Lo,Oo,Fo,wn,Jt,qo,ji,Bo,Kl,Uo,jo,Ho,yn,xt,Wo,Hi,zo,ks,Go,Yl,Wi,el,Vo,Ko,Yo,ws,zi,tl,Qo,Xo,Zo,qt,Gi,Jo,Cn,$n,xo,oi,er,Ql,tr,lr,nr,Vt,Sn,Mn,ir,sr,mt,Vi,or,Tn,Nn,rr,Xl,ar,ur,fr,Ol,ul,En,An,cr,Bt,Ki,Yi,mr,Ut,Pn,Qi,Xi,_r,ys,Zi,Ji,ll,pr,dr,ri,vr,Fl,hr,ai,nl,br,gr,kr,xi,gl,wr,lt,es,yr,Dn,Rn,Cr,ui,$r,fl,Sr,Cs,Mr,Tr,In,kl,Nr,il,Er,$s,Zl,Ar,Pr,Dr,wl,Rr,Jl,Ir,Lr,Or,yl,Fr,Ln,On,qr,Br,Ur,Cl,jr,Fn,Hr,Wr,zr,Ct,qn,Bn,Un,jn,Hn,Wn,Gr,xl,Vr,Kr,Yr,$l,Qr,Ss,Ms,Ts,Ns=t[3].p.r.startsWith("10YNO")||t[3].p.r.startsWith("10Y1001A1001A4"),Es,cl,ts,Xr,zn,Gn,Zr,fi,Jr,ci,xr,As,jt,ls,ea,Vn,Kn,ta,mi,la,ns,is,sl,na,ia,sa,ql,Ps,Yn,oa,ss,Qn,ra,os,Ds,en,Rs,tn,Is,ln,Ls,nn,Kt,Os,aa;a=new Rt({}),R=new o_({});let n1=["NOK","SEK","DKK","EUR","CHF"],_i=[];for(let B=0;B<5;B+=1)_i[B]=v_(d_(t,n1,B));vt=new Qt({props:{to:"/priceconfig",class:"text-blue-600 hover:text-blue-800",$$slots:{default:[h_]},$$scope:{ctx:t}}});let $t=t[3].p.e&&t[0].chip!="esp8266"&&Zu(t),St=t[3].g.s>0&&Ju(t);Pl=new Rt({});let i1=[24,48,96,192,384,576,1152],pi=[];for(let B=0;B<7;B+=1)pi[B]=b_(p_(t,i1,B));let Mt=t[3].m.e.e&&xu(t),Tt=t[3].m.e.e&&ef(t),Nt=t[3].m.m.e&&tf(t);$n=new Rt({});let Ht=t[0].if&&t[0].if.eth&&lf(),Et=(t[3].n.c==1||t[3].n.c==2)&&nf(t);Nn=new Rt({}),Pn=new t1({});let At=t[3].n.m=="static"&&sf(t);Rn=new Rt({});let Pt=t[0].chip!="esp8266"&&of(t),ot=t[3].q.s.e&&rf(t),rt=t[3].q.m==3&&af(t),at=t[3].q.m==4&&uf(t),ut=t[3].c.es!=null&&ff(t),ft=Ns&&_f(t);Gn=new Rt({});let Xn=t[7],gt=[];for(let B=0;B20||t[0].chip=="esp8266"||t[3].i.d.d>0)&&vf(t);Kn=new Rt({});let Dt=t[3].d.s&&Cf(t);return en=new kt({props:{active:t[1],message:"Loading configuration"}}),tn=new kt({props:{active:t[2],message:"Saving configuration"}}),ln=new kt({props:{active:t[4],message:"Performing factory reset"}}),nn=new kt({props:{active:t[5],message:"Device have been factory reset and switched to AP mode"}}),{c(){e=m("form"),l=m("div"),n=m("div"),i=m("strong"),i.textContent="General",o=h(),u=m("a"),re(a.$$.fragment),c=h(),f=m("input"),_=h(),p=m("div"),b=m("div"),v=m("div"),d=E("Hostname"),g=m("br"),w=h(),T=m("input"),M=h(),P=m("div"),L=E("Time zone"),I=m("br"),F=h(),C=m("select"),re(R.$$.fragment),ne=h(),H=m("input"),z=h(),U=m("div"),K=m("div"),Q=m("div"),G=E("Price region"),X=m("br"),Y=h(),j=m("select"),x=m("optgroup"),ae=m("option"),ae.textContent="NO1",ee=m("option"),ee.textContent="NO2",V=m("option"),V.textContent="NO3",W=m("option"),W.textContent="NO4",we=m("option"),we.textContent="NO5",He=m("optgroup"),Le=m("option"),Le.textContent="SE1",Se=m("option"),Se.textContent="SE2",ye=m("option"),ye.textContent="SE3",ve=m("option"),ve.textContent="SE4",Te=m("optgroup"),be=m("option"),be.textContent="DK1",N=m("option"),N.textContent="DK2",y=m("option"),y.textContent="Austria",k=m("option"),k.textContent="Belgium",A=m("option"),A.textContent="Czech Republic",D=m("option"),D.textContent="Estonia",Z=m("option"),Z.textContent="Finland",le=m("option"),le.textContent="France",fe=m("option"),fe.textContent="Germany",de=m("option"),de.textContent="Great Britain",Ce=m("option"),Ce.textContent="Latvia",Oe=m("option"),Oe.textContent="Lithuania",ue=m("option"),ue.textContent="Netherland",Me=m("option"),Me.textContent="Poland",Je=m("option"),Je.textContent="Switzerland",Lt=h(),st=m("div"),wt=E("Currency"),nt=m("br"),Ot=h(),Qe=m("select");for(let B=0;B<5;B+=1)_i[B].c();Xt=h(),zt=m("div"),re(vt.$$.fragment),xe=h(),Ge=m("div"),Ye=m("label"),Ne=m("input"),Ze=E(" Enable price fetch from remote server"),et=h(),$t&&$t.c(),qe=h(),Fe=m("div"),_e=E("Security"),ce=m("br"),Be=h(),pt=m("select"),Tl=m("option"),Tl.textContent="None",Nl=m("option"),Nl.textContent="Only configuration",El=m("option"),El.textContent="Everything",Mi=h(),St&&St.c(),Ti=h(),je=m("div"),_n=m("strong"),_n.textContent="Meter",Ni=h(),Al=m("a"),re(Pl.$$.fragment),Ei=h(),Hl=m("input"),Ai=h(),Wl=m("input"),Pi=h(),hl=m("div"),Di=E("Communication"),Ri=m("br"),Ii=h(),Gt=m("select"),Dl=m("option"),Dl.textContent="Passive (Push)",Ve=m("option"),Ve.textContent="Kamstrup (Pull)",yt=h(),ht=m("div"),si=m("span"),si.textContent="Buffer size",Li=h(),bl=m("span"),bl.textContent="Serial conf.",Oi=h(),zl=m("label"),Zt=m("input"),$o=E(" inverted"),So=h(),Rl=m("div"),rl=m("select"),Il=m("option"),Mo=E("Autodetect");for(let B=0;B<7;B+=1)pi[B].c();To=h(),bt=m("select"),Ll=m("option"),No=E("-"),pn=m("option"),pn.textContent="7N1",dn=m("option"),dn.textContent="8N1",vn=m("option"),vn.textContent="7E1",hn=m("option"),hn.textContent="8E1",Eo=h(),Ft=m("input"),Ao=h(),Gl=m("div"),Po=E("Voltage"),Do=m("br"),Ro=h(),al=m("select"),bn=m("option"),bn.textContent="400V (TN)",gn=m("option"),gn.textContent="230V (IT/TT)",Io=h(),kn=m("div"),Vl=m("div"),Lo=E("Main fuse"),Oo=m("br"),Fo=h(),wn=m("label"),Jt=m("input"),qo=h(),ji=m("span"),ji.textContent="A",Bo=h(),Kl=m("div"),Uo=E("Production"),jo=m("br"),Ho=h(),yn=m("label"),xt=m("input"),Wo=h(),Hi=m("span"),Hi.textContent="kWp",zo=h(),ks=m("div"),Go=h(),Yl=m("div"),Wi=m("label"),el=m("input"),Vo=E(" Meter is encrypted"),Ko=h(),Mt&&Mt.c(),Yo=h(),Tt&&Tt.c(),ws=h(),zi=m("label"),tl=m("input"),Qo=E(" Multipliers"),Xo=h(),Nt&&Nt.c(),Zo=h(),qt=m("div"),Gi=m("strong"),Gi.textContent="Connection",Jo=h(),Cn=m("a"),re($n.$$.fragment),xo=h(),oi=m("input"),er=h(),Ql=m("div"),tr=E("Connection"),lr=m("br"),nr=h(),Vt=m("select"),Sn=m("option"),Sn.textContent="WiFi",Mn=m("option"),Mn.textContent="Access point",Ht&&Ht.c(),ir=h(),Et&&Et.c(),sr=h(),mt=m("div"),Vi=m("strong"),Vi.textContent="Network",or=h(),Tn=m("a"),re(Nn.$$.fragment),rr=h(),Xl=m("div"),ar=E("IP"),ur=m("br"),fr=h(),Ol=m("div"),ul=m("select"),En=m("option"),En.textContent="DHCP",An=m("option"),An.textContent="Static",cr=h(),Bt=m("input"),mr=h(),Ut=m("select"),re(Pn.$$.fragment),_r=h(),At&&At.c(),ys=h(),Zi=m("div"),Ji=m("label"),ll=m("input"),pr=E(" enable mDNS"),dr=h(),ri=m("input"),vr=h(),Fl=m("div"),hr=E("NTP "),ai=m("label"),nl=m("input"),br=E(" obtain from DHCP"),gr=m("br"),kr=h(),xi=m("div"),gl=m("input"),wr=h(),lt=m("div"),es=m("strong"),es.textContent="MQTT",yr=h(),Dn=m("a"),re(Rn.$$.fragment),Cr=h(),ui=m("input"),$r=h(),fl=m("div"),Sr=E(`Server `),Pt&&Pt.c(),Cs=h(),Mr=m("br"),Tr=h(),In=m("div"),kl=m("input"),Nr=h(),il=m("input"),Er=h(),ot&&ot.c(),$s=h(),Zl=m("div"),Ar=E("Username"),Pr=m("br"),Dr=h(),wl=m("input"),Rr=h(),Jl=m("div"),Ir=E("Password"),Lr=m("br"),Or=h(),yl=m("input"),Fr=h(),Ln=m("div"),On=m("div"),qr=E("Client ID"),Br=m("br"),Ur=h(),Cl=m("input"),jr=h(),Fn=m("div"),Hr=E("Payload"),Wr=m("br"),zr=h(),Ct=m("select"),qn=m("option"),qn.textContent="JSON",Bn=m("option"),Bn.textContent="Raw (minimal)",Un=m("option"),Un.textContent="Raw (full)",jn=m("option"),jn.textContent="Domoticz",Hn=m("option"),Hn.textContent="HomeAssistant",Wn=m("option"),Wn.textContent="HEX dump",Gr=h(),xl=m("div"),Vr=E("Publish topic"),Kr=m("br"),Yr=h(),$l=m("input"),Qr=h(),rt&&rt.c(),Ss=h(),at&&at.c(),Ms=h(),ut&&ut.c(),Ts=h(),ft&&ft.c(),Es=h(),cl=m("div"),ts=m("strong"),ts.textContent="User interface",Xr=h(),zn=m("a"),re(Gn.$$.fragment),Zr=h(),fi=m("input"),Jr=h(),ci=m("div");for(let B=0;BSave',Ds=h(),re(en.$$.fragment),Rs=h(),re(tn.$$.fragment),Is=h(),re(ln.$$.fragment),Ls=h(),re(nn.$$.fragment),r(i,"class","text-sm"),r(u,"href",It("General-configuration")),r(u,"target","_blank"),r(u,"class","float-right"),r(f,"type","hidden"),r(f,"name","g"),f.value="true",r(T,"name","gh"),r(T,"type","text"),r(T,"class","in-f w-full"),r(T,"pattern","[A-Za-z0-9-]+"),r(C,"name","gt"),r(C,"class","in-l w-full"),t[3].g.t===void 0&&We(()=>t[16].call(C)),r(b,"class","flex"),r(p,"class","my-1"),r(H,"type","hidden"),r(H,"name","p"),H.value="true",ae.__value="10YNO-1--------2",ae.value=ae.__value,ee.__value="10YNO-2--------T",ee.value=ee.__value,V.__value="10YNO-3--------J",V.value=V.__value,W.__value="10YNO-4--------9",W.value=W.__value,we.__value="10Y1001A1001A48H",we.value=we.__value,r(x,"label","Norway"),Le.__value="10Y1001A1001A44P",Le.value=Le.__value,Se.__value="10Y1001A1001A45N",Se.value=Se.__value,ye.__value="10Y1001A1001A46L",ye.value=ye.__value,ve.__value="10Y1001A1001A47J",ve.value=ve.__value,r(He,"label","Sweden"),be.__value="10YDK-1--------W",be.value=be.__value,N.__value="10YDK-2--------M",N.value=N.__value,r(Te,"label","Denmark"),y.__value="10YAT-APG------L",y.value=y.__value,k.__value="10YBE----------2",k.value=k.__value,A.__value="10YCZ-CEPS-----N",A.value=A.__value,D.__value="10Y1001A1001A39I",D.value=D.__value,Z.__value="10YFI-1--------U",Z.value=Z.__value,le.__value="10YFR-RTE------C",le.value=le.__value,fe.__value="10Y1001A1001A83F",fe.value=fe.__value,de.__value="10YGB----------A",de.value=de.__value,Ce.__value="10YLV-1001A00074",Ce.value=Ce.__value,Oe.__value="10YLT-1001A0008Q",Oe.value=Oe.__value,ue.__value="10YNL----------L",ue.value=ue.__value,Me.__value="10YPL-AREA-----S",Me.value=Me.__value,Je.__value="10YCH-SWISSGRIDZ",Je.value=Je.__value,r(j,"name","pr"),r(j,"class","in-f w-full"),t[3].p.r===void 0&&We(()=>t[17].call(j)),r(Q,"class","w-full"),r(Qe,"name","pc"),r(Qe,"class","in-l"),t[3].p.c===void 0&&We(()=>t[18].call(Qe)),r(K,"class","flex"),r(U,"class","my-1"),r(zt,"class","my-1"),r(Ne,"type","checkbox"),r(Ne,"name","pe"),Ne.__value="true",Ne.value=Ne.__value,r(Ne,"class","rounded mb-1"),r(Ge,"class","my-1"),Tl.__value=0,Tl.value=Tl.__value,Nl.__value=1,Nl.value=Nl.__value,El.__value=2,El.value=El.__value,r(pt,"name","gs"),r(pt,"class","in-s"),t[3].g.s===void 0&&We(()=>t[21].call(pt)),r(Fe,"class","my-1"),r(n,"class","cnt"),r(_n,"class","text-sm"),r(Al,"href",It("Meter-configuration")),r(Al,"target","_blank"),r(Al,"class","float-right"),r(Hl,"type","hidden"),r(Hl,"name","m"),Hl.value="true",r(Wl,"type","hidden"),r(Wl,"name","mo"),Wl.value="1",Dl.__value=0,Dl.value=Dl.__value,Ve.__value=9,Ve.value=Ve.__value,r(Gt,"name","ma"),r(Gt,"class","in-s"),t[3].m.a===void 0&&We(()=>t[24].call(Gt)),r(hl,"class","my-1"),r(si,"class","float-right"),r(Zt,"name","mi"),Zt.__value="true",Zt.value=Zt.__value,r(Zt,"type","checkbox"),r(Zt,"class","rounded mb-1"),r(zl,"class","mt-2 ml-3 whitespace-nowrap"),Il.__value=0,Il.value=Il.__value,Il.disabled=Fi=t[3].m.b!=0,r(rl,"name","mb"),r(rl,"class","in-f tr w-1/2"),t[3].m.b===void 0&&We(()=>t[26].call(rl)),Ll.__value=0,Ll.value=Ll.__value,Ll.disabled=qi=t[3].m.b!=0,pn.__value=2,pn.value=pn.__value,dn.__value=3,dn.value=dn.__value,vn.__value=10,vn.value=vn.__value,hn.__value=11,hn.value=hn.__value,r(bt,"name","mp"),r(bt,"class","in-m"),bt.disabled=Bi=t[3].m.b==0,t[3].m.p===void 0&&We(()=>t[27].call(bt)),r(Ft,"name","ms"),r(Ft,"type","number"),r(Ft,"min",64),r(Ft,"max",Ui=t[0].chip=="esp8266"?t[3].i.h.p==3||t[3].i.h.p==113?512:128:4096),r(Ft,"step",64),r(Ft,"class","in-l tr w-1/2"),r(Rl,"class","flex w-full"),r(ht,"class","my-1"),bn.__value=2,bn.value=bn.__value,gn.__value=1,gn.value=gn.__value,r(al,"name","md"),r(al,"class","in-s"),t[3].m.d===void 0&&We(()=>t[29].call(al)),r(Gl,"class","my-1"),r(Jt,"name","mf"),r(Jt,"type","number"),r(Jt,"min","5"),r(Jt,"max","65535"),r(Jt,"class","in-f tr w-full"),r(ji,"class","in-post"),r(wn,"class","flex"),r(Vl,"class","mx-1"),r(xt,"name","mr"),r(xt,"type","number"),r(xt,"min","0"),r(xt,"max","65535"),r(xt,"class","in-f tr w-full"),r(Hi,"class","in-post"),r(yn,"class","flex"),r(Kl,"class","mx-1"),r(kn,"class","my-1 flex"),r(ks,"class","my-1"),r(el,"type","checkbox"),r(el,"name","me"),el.__value="true",el.value=el.__value,r(el,"class","rounded mb-1"),r(Yl,"class","my-1"),r(tl,"type","checkbox"),r(tl,"name","mm"),tl.__value="true",tl.value=tl.__value,r(tl,"class","rounded mb-1"),r(je,"class","cnt"),r(Gi,"class","text-sm"),r(Cn,"href",It("WiFi-configuration")),r(Cn,"target","_blank"),r(Cn,"class","float-right"),r(oi,"type","hidden"),r(oi,"name","w"),oi.value="true",Sn.__value=1,Sn.value=Sn.__value,Mn.__value=2,Mn.value=Mn.__value,r(Vt,"name","nc"),r(Vt,"class","in-s"),t[3].n.c===void 0&&We(()=>t[40].call(Vt)),r(Ql,"class","my-1"),r(qt,"class","cnt"),r(Vi,"class","text-sm"),r(Tn,"href",It("Network-configuration")),r(Tn,"target","_blank"),r(Tn,"class","float-right"),En.__value="dhcp",En.value=En.__value,An.__value="static",An.value=An.__value,r(ul,"name","nm"),r(ul,"class","in-f"),t[3].n.m===void 0&&We(()=>t[46].call(ul)),r(Bt,"name","ni"),r(Bt,"type","text"),r(Bt,"class","in-m w-full"),Bt.disabled=Ki=t[3].n.m=="dhcp",Bt.required=Yi=t[3].n.m=="static",r(Ut,"name","ns"),r(Ut,"class","in-l"),Ut.disabled=Qi=t[3].n.m=="dhcp",Ut.required=Xi=t[3].n.m=="static",t[3].n.s===void 0&&We(()=>t[48].call(Ut)),r(Ol,"class","flex"),r(Xl,"class","my-1"),r(ll,"name","nd"),ll.__value="true",ll.value=ll.__value,r(ll,"type","checkbox"),r(ll,"class","rounded mb-1"),r(Zi,"class","my-1"),r(ri,"type","hidden"),r(ri,"name","ntp"),ri.value="true",r(nl,"name","ntpd"),nl.__value="true",nl.value=nl.__value,r(nl,"type","checkbox"),r(nl,"class","rounded mb-1"),r(ai,"class","ml-4"),r(gl,"name","ntph"),r(gl,"type","text"),r(gl,"class","in-s"),r(xi,"class","flex"),r(Fl,"class","my-1"),r(mt,"class","cnt"),r(es,"class","text-sm"),r(Dn,"href",It("MQTT-configuration")),r(Dn,"target","_blank"),r(Dn,"class","float-right"),r(ui,"type","hidden"),r(ui,"name","q"),ui.value="true",r(kl,"name","qh"),r(kl,"type","text"),r(kl,"class","in-f w-3/4"),r(il,"name","qp"),r(il,"type","number"),r(il,"min","1024"),r(il,"max","65535"),r(il,"class","in-l tr w-1/4"),r(In,"class","flex"),r(fl,"class","my-1"),r(wl,"name","qu"),r(wl,"type","text"),r(wl,"class","in-s"),r(Zl,"class","my-1"),r(yl,"name","qa"),r(yl,"type","password"),r(yl,"class","in-s"),r(Jl,"class","my-1"),r(Cl,"name","qc"),r(Cl,"type","text"),r(Cl,"class","in-f w-full"),qn.__value=0,qn.value=qn.__value,Bn.__value=1,Bn.value=Bn.__value,Un.__value=2,Un.value=Un.__value,jn.__value=3,jn.value=jn.__value,Hn.__value=4,Hn.value=Hn.__value,Wn.__value=255,Wn.value=Wn.__value,r(Ct,"name","qm"),r(Ct,"class","in-l"),t[3].q.m===void 0&&We(()=>t[61].call(Ct)),r(Ln,"class","my-1 flex"),r($l,"name","qb"),r($l,"type","text"),r($l,"class","in-s"),r(xl,"class","my-1"),r(lt,"class","cnt"),r(ts,"class","text-sm"),r(zn,"href",It("User-interface")),r(zn,"target","_blank"),r(zn,"class","float-right"),r(fi,"type","hidden"),r(fi,"name","u"),fi.value="true",r(ci,"class","flex flex-wrap"),r(cl,"class","cnt"),r(ls,"class","text-sm"),r(Vn,"href","https://amsleser.no/blog/post/24-telnet-debug"),r(Vn,"target","_blank"),r(Vn,"class","float-right"),r(mi,"type","hidden"),r(mi,"name","d"),mi.value="true",r(sl,"type","checkbox"),r(sl,"name","ds"),sl.__value="true",sl.value=sl.__value,r(sl,"class","rounded mb-1"),r(ns,"class","mt-3"),r(jt,"class","cnt"),r(l,"class","grid xl:grid-cols-4 lg:grid-cols-2 md:grid-cols-2"),r(Yn,"type","button"),r(Yn,"class","py-2 px-4 rounded bg-red-500 text-white ml-2"),r(Qn,"type","button"),r(Qn,"class","py-2 px-4 rounded bg-yellow-500 text-white"),r(ss,"class","text-center"),r(os,"class","text-right"),r(ql,"class","grid grid-cols-3"),r(e,"autocomplete","off")},m(B,me){S(B,e,me),s(e,l),s(l,n),s(n,i),s(n,o),s(n,u),ie(a,u,null),s(n,c),s(n,f),s(n,_),s(n,p),s(p,b),s(b,v),s(v,d),s(v,g),s(v,w),s(v,T),oe(T,t[3].g.h),s(b,M),s(b,P),s(P,L),s(P,I),s(P,F),s(P,C),ie(R,C,null),$e(C,t[3].g.t,!0),s(n,ne),s(n,H),s(n,z),s(n,U),s(U,K),s(K,Q),s(Q,G),s(Q,X),s(Q,Y),s(Q,j),s(j,x),s(x,ae),s(x,ee),s(x,V),s(x,W),s(x,we),s(j,He),s(He,Le),s(He,Se),s(He,ye),s(He,ve),s(j,Te),s(Te,be),s(Te,N),s(j,y),s(j,k),s(j,A),s(j,D),s(j,Z),s(j,le),s(j,fe),s(j,de),s(j,Ce),s(j,Oe),s(j,ue),s(j,Me),s(j,Je),$e(j,t[3].p.r,!0),s(K,Lt),s(K,st),s(st,wt),s(st,nt),s(st,Ot),s(st,Qe);for(let _t=0;_t<5;_t+=1)_i[_t]&&_i[_t].m(Qe,null);$e(Qe,t[3].p.c,!0),s(n,Xt),s(n,zt),ie(vt,zt,null),s(n,xe),s(n,Ge),s(Ge,Ye),s(Ye,Ne),Ne.checked=t[3].p.e,s(Ye,Ze),s(Ge,et),$t&&$t.m(Ge,null),s(n,qe),s(n,Fe),s(Fe,_e),s(Fe,ce),s(Fe,Be),s(Fe,pt),s(pt,Tl),s(pt,Nl),s(pt,El),$e(pt,t[3].g.s,!0),s(n,Mi),St&&St.m(n,null),s(l,Ti),s(l,je),s(je,_n),s(je,Ni),s(je,Al),ie(Pl,Al,null),s(je,Ei),s(je,Hl),s(je,Ai),s(je,Wl),s(je,Pi),s(je,hl),s(hl,Di),s(hl,Ri),s(hl,Ii),s(hl,Gt),s(Gt,Dl),s(Gt,Ve),$e(Gt,t[3].m.a,!0),s(je,yt),s(je,ht),s(ht,si),s(ht,Li),s(ht,bl),s(ht,Oi),s(ht,zl),s(zl,Zt),Zt.checked=t[3].m.i,s(zl,$o),s(ht,So),s(ht,Rl),s(Rl,rl),s(rl,Il),s(Il,Mo);for(let _t=0;_t<7;_t+=1)pi[_t]&&pi[_t].m(rl,null);$e(rl,t[3].m.b,!0),s(Rl,To),s(Rl,bt),s(bt,Ll),s(Ll,No),s(bt,pn),s(bt,dn),s(bt,vn),s(bt,hn),$e(bt,t[3].m.p,!0),s(Rl,Eo),s(Rl,Ft),oe(Ft,t[3].m.s),s(je,Ao),s(je,Gl),s(Gl,Po),s(Gl,Do),s(Gl,Ro),s(Gl,al),s(al,bn),s(al,gn),$e(al,t[3].m.d,!0),s(je,Io),s(je,kn),s(kn,Vl),s(Vl,Lo),s(Vl,Oo),s(Vl,Fo),s(Vl,wn),s(wn,Jt),oe(Jt,t[3].m.f),s(wn,qo),s(wn,ji),s(kn,Bo),s(kn,Kl),s(Kl,Uo),s(Kl,jo),s(Kl,Ho),s(Kl,yn),s(yn,xt),oe(xt,t[3].m.r),s(yn,Wo),s(yn,Hi),s(je,zo),s(je,ks),s(je,Go),s(je,Yl),s(Yl,Wi),s(Wi,el),el.checked=t[3].m.e.e,s(Wi,Vo),s(Yl,Ko),Mt&&Mt.m(Yl,null),s(je,Yo),Tt&&Tt.m(je,null),s(je,ws),s(je,zi),s(zi,tl),tl.checked=t[3].m.m.e,s(zi,Qo),s(je,Xo),Nt&&Nt.m(je,null),s(l,Zo),s(l,qt),s(qt,Gi),s(qt,Jo),s(qt,Cn),ie($n,Cn,null),s(qt,xo),s(qt,oi),s(qt,er),s(qt,Ql),s(Ql,tr),s(Ql,lr),s(Ql,nr),s(Ql,Vt),s(Vt,Sn),s(Vt,Mn),Ht&&Ht.m(Vt,null),$e(Vt,t[3].n.c,!0),s(qt,ir),Et&&Et.m(qt,null),s(l,sr),s(l,mt),s(mt,Vi),s(mt,or),s(mt,Tn),ie(Nn,Tn,null),s(mt,rr),s(mt,Xl),s(Xl,ar),s(Xl,ur),s(Xl,fr),s(Xl,Ol),s(Ol,ul),s(ul,En),s(ul,An),$e(ul,t[3].n.m,!0),s(Ol,cr),s(Ol,Bt),oe(Bt,t[3].n.i),s(Ol,mr),s(Ol,Ut),ie(Pn,Ut,null),$e(Ut,t[3].n.s,!0),s(mt,_r),At&&At.m(mt,null),s(mt,ys),s(mt,Zi),s(Zi,Ji),s(Ji,ll),ll.checked=t[3].n.d,s(Ji,pr),s(mt,dr),s(mt,ri),s(mt,vr),s(mt,Fl),s(Fl,hr),s(Fl,ai),s(ai,nl),nl.checked=t[3].n.h,s(ai,br),s(Fl,gr),s(Fl,kr),s(Fl,xi),s(xi,gl),oe(gl,t[3].n.n1),s(l,wr),s(l,lt),s(lt,es),s(lt,yr),s(lt,Dn),ie(Rn,Dn,null),s(lt,Cr),s(lt,ui),s(lt,$r),s(lt,fl),s(fl,Sr),Pt&&Pt.m(fl,null),s(fl,Cs),s(fl,Mr),s(fl,Tr),s(fl,In),s(In,kl),oe(kl,t[3].q.h),s(In,Nr),s(In,il),oe(il,t[3].q.p),s(lt,Er),ot&&ot.m(lt,null),s(lt,$s),s(lt,Zl),s(Zl,Ar),s(Zl,Pr),s(Zl,Dr),s(Zl,wl),oe(wl,t[3].q.u),s(lt,Rr),s(lt,Jl),s(Jl,Ir),s(Jl,Lr),s(Jl,Or),s(Jl,yl),oe(yl,t[3].q.a),s(lt,Fr),s(lt,Ln),s(Ln,On),s(On,qr),s(On,Br),s(On,Ur),s(On,Cl),oe(Cl,t[3].q.c),s(Ln,jr),s(Ln,Fn),s(Fn,Hr),s(Fn,Wr),s(Fn,zr),s(Fn,Ct),s(Ct,qn),s(Ct,Bn),s(Ct,Un),s(Ct,jn),s(Ct,Hn),s(Ct,Wn),$e(Ct,t[3].q.m,!0),s(lt,Gr),s(lt,xl),s(xl,Vr),s(xl,Kr),s(xl,Yr),s(xl,$l),oe($l,t[3].q.b),s(l,Qr),rt&&rt.m(l,null),s(l,Ss),at&&at.m(l,null),s(l,Ms),ut&&ut.m(l,null),s(l,Ts),ft&&ft.m(l,null),s(l,Es),s(l,cl),s(cl,ts),s(cl,Xr),s(cl,zn),ie(Gn,zn,null),s(cl,Zr),s(cl,fi),s(cl,Jr),s(cl,ci);for(let _t=0;_t0?St?St.p(B,me):(St=Ju(B),St.c(),St.m(n,null)):St&&(St.d(1),St=null),me[0]&8&&$e(Gt,B[3].m.a),me[0]&8&&(Zt.checked=B[3].m.i),(!Kt||me[0]&8&&Fi!==(Fi=B[3].m.b!=0))&&(Il.disabled=Fi),me[0]&8&&$e(rl,B[3].m.b),(!Kt||me[0]&8&&qi!==(qi=B[3].m.b!=0))&&(Ll.disabled=qi),(!Kt||me[0]&8&&Bi!==(Bi=B[3].m.b==0))&&(bt.disabled=Bi),me[0]&8&&$e(bt,B[3].m.p),(!Kt||me[0]&9&&Ui!==(Ui=B[0].chip=="esp8266"?B[3].i.h.p==3||B[3].i.h.p==113?512:128:4096))&&r(Ft,"max",Ui),me[0]&8&&ge(Ft.value)!==B[3].m.s&&oe(Ft,B[3].m.s),me[0]&8&&$e(al,B[3].m.d),me[0]&8&&ge(Jt.value)!==B[3].m.f&&oe(Jt,B[3].m.f),me[0]&8&&ge(xt.value)!==B[3].m.r&&oe(xt,B[3].m.r),me[0]&8&&(el.checked=B[3].m.e.e),B[3].m.e.e?Mt?Mt.p(B,me):(Mt=xu(B),Mt.c(),Mt.m(Yl,null)):Mt&&(Mt.d(1),Mt=null),B[3].m.e.e?Tt?Tt.p(B,me):(Tt=ef(B),Tt.c(),Tt.m(je,ws)):Tt&&(Tt.d(1),Tt=null),me[0]&8&&(tl.checked=B[3].m.m.e),B[3].m.m.e?Nt?Nt.p(B,me):(Nt=tf(B),Nt.c(),Nt.m(je,null)):Nt&&(Nt.d(1),Nt=null),B[0].if&&B[0].if.eth?Ht||(Ht=lf(),Ht.c(),Ht.m(Vt,null)):Ht&&(Ht.d(1),Ht=null),me[0]&8&&$e(Vt,B[3].n.c),B[3].n.c==1||B[3].n.c==2?Et?Et.p(B,me):(Et=nf(B),Et.c(),Et.m(qt,null)):Et&&(Et.d(1),Et=null),me[0]&8&&$e(ul,B[3].n.m),(!Kt||me[0]&8&&Ki!==(Ki=B[3].n.m=="dhcp"))&&(Bt.disabled=Ki),(!Kt||me[0]&8&&Yi!==(Yi=B[3].n.m=="static"))&&(Bt.required=Yi),me[0]&8&&Bt.value!==B[3].n.i&&oe(Bt,B[3].n.i),(!Kt||me[0]&8&&Qi!==(Qi=B[3].n.m=="dhcp"))&&(Ut.disabled=Qi),(!Kt||me[0]&8&&Xi!==(Xi=B[3].n.m=="static"))&&(Ut.required=Xi),me[0]&8&&$e(Ut,B[3].n.s),B[3].n.m=="static"?At?At.p(B,me):(At=sf(B),At.c(),At.m(mt,ys)):At&&(At.d(1),At=null),me[0]&8&&(ll.checked=B[3].n.d),me[0]&8&&(nl.checked=B[3].n.h),me[0]&8&&gl.value!==B[3].n.n1&&oe(gl,B[3].n.n1),B[0].chip!="esp8266"?Pt?Pt.p(B,me):(Pt=of(B),Pt.c(),Pt.m(fl,Cs)):Pt&&(Pt.d(1),Pt=null),me[0]&8&&kl.value!==B[3].q.h&&oe(kl,B[3].q.h),me[0]&8&&ge(il.value)!==B[3].q.p&&oe(il,B[3].q.p),B[3].q.s.e?ot?(ot.p(B,me),me[0]&8&&O(ot,1)):(ot=rf(B),ot.c(),O(ot,1),ot.m(lt,$s)):ot&&(Ae(),q(ot,1,1,()=>{ot=null}),Pe()),me[0]&8&&wl.value!==B[3].q.u&&oe(wl,B[3].q.u),me[0]&8&&yl.value!==B[3].q.a&&oe(yl,B[3].q.a),me[0]&8&&Cl.value!==B[3].q.c&&oe(Cl,B[3].q.c),me[0]&8&&$e(Ct,B[3].q.m),me[0]&8&&$l.value!==B[3].q.b&&oe($l,B[3].q.b),B[3].q.m==3?rt?(rt.p(B,me),me[0]&8&&O(rt,1)):(rt=af(B),rt.c(),O(rt,1),rt.m(l,Ss)):rt&&(Ae(),q(rt,1,1,()=>{rt=null}),Pe()),B[3].q.m==4?at?(at.p(B,me),me[0]&8&&O(at,1)):(at=uf(B),at.c(),O(at,1),at.m(l,Ms)):at&&(Ae(),q(at,1,1,()=>{at=null}),Pe()),B[3].c.es!=null?ut?(ut.p(B,me),me[0]&8&&O(ut,1)):(ut=ff(B),ut.c(),O(ut,1),ut.m(l,Ts)):ut&&(Ae(),q(ut,1,1,()=>{ut=null}),Pe()),me[0]&8&&(Ns=B[3].p.r.startsWith("10YNO")||B[3].p.r.startsWith("10Y1001A1001A4")),Ns?ft?(ft.p(B,me),me[0]&8&&O(ft,1)):(ft=_f(B),ft.c(),O(ft,1),ft.m(l,Es)):ft&&(Ae(),q(ft,1,1,()=>{ft=null}),Pe()),me[0]&136){Xn=B[7];let Yt;for(Yt=0;Yt20||B[0].chip=="esp8266"||B[3].i.d.d>0?ct?(ct.p(B,me),me[0]&9&&O(ct,1)):(ct=vf(B),ct.c(),O(ct,1),ct.m(l,As)):ct&&(Ae(),q(ct,1,1,()=>{ct=null}),Pe()),me[0]&8&&(sl.checked=B[3].d.s),B[3].d.s?Dt?Dt.p(B,me):(Dt=Cf(B),Dt.c(),Dt.m(jt,null)):Dt&&(Dt.d(1),Dt=null);const ua={};me[0]&2&&(ua.active=B[1]),en.$set(ua);const fa={};me[0]&4&&(fa.active=B[2]),tn.$set(fa);const ca={};me[0]&16&&(ca.active=B[4]),ln.$set(ca);const ma={};me[0]&32&&(ma.active=B[5]),nn.$set(ma)},i(B){Kt||(O(a.$$.fragment,B),O(R.$$.fragment,B),O(vt.$$.fragment,B),O(Pl.$$.fragment,B),O($n.$$.fragment,B),O(Nn.$$.fragment,B),O(Pn.$$.fragment,B),O(Rn.$$.fragment,B),O(ot),O(rt),O(at),O(ut),O(ft),O(Gn.$$.fragment,B),O(ct),O(Kn.$$.fragment,B),O(en.$$.fragment,B),O(tn.$$.fragment,B),O(ln.$$.fragment,B),O(nn.$$.fragment,B),Kt=!0)},o(B){q(a.$$.fragment,B),q(R.$$.fragment,B),q(vt.$$.fragment,B),q(Pl.$$.fragment,B),q($n.$$.fragment,B),q(Nn.$$.fragment,B),q(Pn.$$.fragment,B),q(Rn.$$.fragment,B),q(ot),q(rt),q(at),q(ut),q(ft),q(Gn.$$.fragment,B),q(ct),q(Kn.$$.fragment,B),q(en.$$.fragment,B),q(tn.$$.fragment,B),q(ln.$$.fragment,B),q(nn.$$.fragment,B),Kt=!1},d(B){B&&$(e),se(a),se(R),dt(_i,B),se(vt),$t&&$t.d(),St&&St.d(),se(Pl),dt(pi,B),Mt&&Mt.d(),Tt&&Tt.d(),Nt&&Nt.d(),se($n),Ht&&Ht.d(),Et&&Et.d(),se(Nn),se(Pn),At&&At.d(),se(Rn),Pt&&Pt.d(),ot&&ot.d(),rt&&rt.d(),at&&at.d(),ut&&ut.d(),ft&&ft.d(),se(Gn),dt(gt,B),ct&&ct.d(),se(Kn),Dt&&Dt.d(),B&&$(Ds),se(en,B),B&&$(Rs),se(tn,B),B&&$(Is),se(ln,B),B&&$(Ls),se(nn,B),Os=!1,ze(aa)}}}async function D_(){await(await fetch("/reboot",{method:"POST"})).json()}function R_(t,e,l){let{sysinfo:n={}}=e,i=[{name:"Import gauge",key:"i"},{name:"Export gauge",key:"e"},{name:"Voltage",key:"v"},{name:"Amperage",key:"a"},{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"}],o=!0,u=!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},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},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,s:null,es:null}};hi.subscribe(Ve=>{Ve.version&&(l(3,a=Ve),l(1,o=!1))}),Xm();let c=!1,f=!1;async function _(){if(confirm("Are you sure you want to factory reset the device?")){l(4,c=!0);const Ve=new URLSearchParams;Ve.append("perform","true");let ht=await(await fetch("/reset",{method:"POST",body:Ve})).json();l(4,c=!1),l(5,f=ht.success)}}async function p(Ve){l(2,u=!0);const yt=new FormData(Ve.target),ht=new URLSearchParams;for(let bl of yt){const[Oi,zl]=bl;ht.append(Oi,zl)}let Li=await(await fetch("/save",{method:"POST",body:ht})).json();Wt.update(bl=>(bl.booting=Li.reboot,bl.ui=a.u,bl)),l(2,u=!1),fn("/")}const b=function(){confirm("Are you sure you want to reboot the device?")&&(Wt.update(Ve=>(Ve.booting=!0,Ve)),D_())};async function v(){confirm("Are you sure you want to delete CA?")&&(await(await fetch("/mqtt-ca",{method:"POST"})).text(),hi.update(yt=>(yt.q.s.c=!1,yt)))}async function d(){confirm("Are you sure you want to delete cert?")&&(await(await fetch("/mqtt-cert",{method:"POST"})).text(),hi.update(yt=>(yt.q.s.r=!1,yt)))}async function g(){confirm("Are you sure you want to delete key?")&&(await(await fetch("/mqtt-key",{method:"POST"})).text(),hi.update(yt=>(yt.q.s.k=!1,yt)))}const w=function(){a.q.s.e?a.q.p==1883&&l(3,a.q.p=8883,a):a.q.p==8883&&l(3,a.q.p=1883,a)};let T=44;function M(){a.g.h=this.value,l(3,a)}function P(){a.g.t=tt(this),l(3,a)}function L(){a.p.r=tt(this),l(3,a)}function I(){a.p.c=tt(this),l(3,a)}function F(){a.p.e=this.checked,l(3,a)}function C(){a.p.t=this.value,l(3,a)}function R(){a.g.s=tt(this),l(3,a)}function ne(){a.g.u=this.value,l(3,a)}function H(){a.g.p=this.value,l(3,a)}function z(){a.m.a=tt(this),l(3,a)}function U(){a.m.i=this.checked,l(3,a)}function K(){a.m.b=tt(this),l(3,a)}function Q(){a.m.p=tt(this),l(3,a)}function G(){a.m.s=ge(this.value),l(3,a)}function X(){a.m.d=tt(this),l(3,a)}function Y(){a.m.f=ge(this.value),l(3,a)}function j(){a.m.r=ge(this.value),l(3,a)}function x(){a.m.e.e=this.checked,l(3,a)}function ae(){a.m.e.k=this.value,l(3,a)}function ee(){a.m.e.a=this.value,l(3,a)}function V(){a.m.m.e=this.checked,l(3,a)}function W(){a.m.m.w=ge(this.value),l(3,a)}function we(){a.m.m.v=ge(this.value),l(3,a)}function He(){a.m.m.a=ge(this.value),l(3,a)}function Le(){a.m.m.c=ge(this.value),l(3,a)}function Se(){a.n.c=tt(this),l(3,a)}function ye(){a.w.s=this.value,l(3,a)}function ve(){a.w.p=this.value,l(3,a)}function Te(){a.w.z=tt(this),l(3,a)}function be(){a.w.w=ge(this.value),l(3,a)}function N(){a.w.b=this.checked,l(3,a)}function y(){a.n.m=tt(this),l(3,a)}function k(){a.n.i=this.value,l(3,a)}function A(){a.n.s=tt(this),l(3,a)}function D(){a.n.g=this.value,l(3,a)}function Z(){a.n.d1=this.value,l(3,a)}function le(){a.n.d2=this.value,l(3,a)}function fe(){a.n.d=this.checked,l(3,a)}function de(){a.n.h=this.checked,l(3,a)}function Ce(){a.n.n1=this.value,l(3,a)}function Oe(){a.q.s.e=this.checked,l(3,a)}function ue(){a.q.h=this.value,l(3,a)}function Me(){a.q.p=ge(this.value),l(3,a)}function Je(){a.q.u=this.value,l(3,a)}function Lt(){a.q.a=this.value,l(3,a)}function st(){a.q.c=this.value,l(3,a)}function wt(){a.q.m=tt(this),l(3,a)}function nt(){a.q.b=this.value,l(3,a)}function Ot(){a.o.e=this.value,l(3,a)}function Qe(){a.o.c=this.value,l(3,a)}function Xt(){a.o.u1=this.value,l(3,a)}function zt(){a.o.u2=this.value,l(3,a)}function vt(){a.o.u3=this.value,l(3,a)}function xe(){a.h.t=this.value,l(3,a)}function Ge(){a.h.h=this.value,l(3,a)}function Ye(){a.h.n=this.value,l(3,a)}function Ne(){a.c.e=this.checked,l(3,a)}function Ze(){a.c.i=this.value,l(3,a)}function et(){a.c.s=this.value,l(3,a)}function qe(){a.c.es=this.checked,l(3,a)}function Fe(Ve){a.t.t[Ve]=ge(this.value),l(3,a)}function _e(){a.t.h=ge(this.value),l(3,a)}function ce(Ve){a.u[Ve.key]=tt(this),l(3,a)}function Be(){a.i.h.p=tt(this),l(3,a)}function pt(){a.i.h.t=tt(this),l(3,a)}function Tl(){a.i.h.u=this.checked,l(3,a)}function Nl(){a.i.a=ge(this.value),l(3,a)}function El(){a.i.l.p=ge(this.value),l(3,a)}function Mi(){a.i.l.i=this.checked,l(3,a)}function Ti(){a.i.r.i=this.checked,l(3,a)}function je(){a.i.r.r=ge(this.value),l(3,a)}function _n(){a.i.r.g=ge(this.value),l(3,a)}function Ni(){a.i.r.b=ge(this.value),l(3,a)}function Al(){a.i.d.d=ge(this.value),l(3,a)}function Pl(){a.i.t.d=ge(this.value),l(3,a)}function Ei(){a.i.t.a=ge(this.value),l(3,a)}function Hl(){a.i.v.p=ge(this.value),l(3,a)}function Ai(){a.i.v.d.v=ge(this.value),l(3,a)}function Wl(){a.i.v.d.g=ge(this.value),l(3,a)}function Pi(){a.i.d.b=tt(this),l(3,a)}function hl(){a.i.v.o=ge(this.value),l(3,a)}function Di(){a.i.v.m=ge(this.value),l(3,a)}function Ri(){a.i.v.b=ge(this.value),l(3,a)}function Ii(){a.d.s=this.checked,l(3,a)}function Gt(){a.d.t=this.checked,l(3,a)}function Dl(){a.d.l=tt(this),l(3,a)}return t.$$set=Ve=>{"sysinfo"in Ve&&l(0,n=Ve.sysinfo)},t.$$.update=()=>{t.$$.dirty[0]&1&&l(6,T=n.chip=="esp8266"?16:n.chip=="esp32s2"?44:39)},[n,o,u,a,c,f,T,i,_,p,b,v,d,g,w,M,P,L,I,F,C,R,ne,H,z,U,K,Q,G,X,Y,j,x,ae,ee,V,W,we,He,Le,Se,ye,ve,Te,be,N,y,k,A,D,Z,le,fe,de,Ce,Oe,ue,Me,Je,Lt,st,wt,nt,Ot,Qe,Xt,zt,vt,xe,Ge,Ye,Ne,Ze,et,qe,Fe,_e,ce,Be,pt,Tl,Nl,El,Mi,Ti,je,_n,Ni,Al,Pl,Ei,Hl,Ai,Wl,Pi,hl,Di,Ri,Ii,Gt,Dl]}class I_ extends Ie{constructor(e){super(),Re(this,e,R_,P_,Ee,{sysinfo:0},null,[-1,-1,-1,-1])}}function Sf(t,e,l){const n=t.slice();return n[20]=e[l],n}function L_(t){let e=he(t[1].chip,t[1].board)+"",l;return{c(){l=E(e)},m(n,i){S(n,l,i)},p(n,i){i&2&&e!==(e=he(n[1].chip,n[1].board)+"")&&J(l,e)},d(n){n&&$(l)}}}function Mf(t){let e,l,n=t[1].apmac+"",i,o,u,a,c,f,_,p,b,v=Pa(t[1])+"",d,g,w=t[1].boot_reason+"",T,M,P=t[1].ex_cause+"",L,I,F;const C=[F_,O_],R=[];function ne(H,z){return H[0].u>0?0:1}return c=ne(t),f=R[c]=C[c](t),{c(){e=m("div"),l=E("AP MAC: "),i=E(n),o=h(),u=m("div"),a=E(`Last boot: `),f.c(),_=h(),p=m("div"),b=E("Reason: "),d=E(v),g=E(" ("),T=E(w),M=E("/"),L=E(P),I=E(")"),r(e,"class","my-2"),r(u,"class","my-2"),r(p,"class","my-2")},m(H,z){S(H,e,z),s(e,l),s(e,i),S(H,o,z),S(H,u,z),s(u,a),R[c].m(u,null),S(H,_,z),S(H,p,z),s(p,b),s(p,d),s(p,g),s(p,T),s(p,M),s(p,L),s(p,I),F=!0},p(H,z){(!F||z&2)&&n!==(n=H[1].apmac+"")&&J(i,n);let U=c;c=ne(H),c===U?R[c].p(H,z):(Ae(),q(R[U],1,1,()=>{R[U]=null}),Pe(),f=R[c],f?f.p(H,z):(f=R[c]=C[c](H),f.c()),O(f,1),f.m(u,null)),(!F||z&2)&&v!==(v=Pa(H[1])+"")&&J(d,v),(!F||z&2)&&w!==(w=H[1].boot_reason+"")&&J(T,w),(!F||z&2)&&P!==(P=H[1].ex_cause+"")&&J(L,P)},i(H){F||(O(f),F=!0)},o(H){q(f),F=!1},d(H){H&&$(e),H&&$(o),H&&$(u),R[c].d(),H&&$(_),H&&$(p)}}}function O_(t){let e;return{c(){e=E("-")},m(l,n){S(l,e,n)},p:pe,i:pe,o:pe,d(l){l&&$(e)}}}function F_(t){let e,l;return e=new Zc({props:{timestamp:new Date(new Date().getTime()-t[0].u*1e3),fullTimeColor:""}}),{c(){re(e.$$.fragment)},m(n,i){ie(e,n,i),l=!0},p(n,i){const o={};i&1&&(o.timestamp=new Date(new Date().getTime()-n[0].u*1e3)),e.$set(o)},i(n){l||(O(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){se(e,n)}}}function q_(t){let e;return{c(){e=m("span"),e.textContent="Update consents",r(e,"class","btn-pri-sm")},m(l,n){S(l,e,n)},p:pe,d(l){l&&$(e)}}}function Tf(t){let e,l,n,i,o,u=vs(t[1].meter.mfg)+"",a,c,f,_,p=(t[1].meter.model?t[1].meter.model:"unknown")+"",b,v,d,g,w=(t[1].meter.id?t[1].meter.id:"unknown")+"",T;return{c(){e=m("div"),l=m("strong"),l.textContent="Meter",n=h(),i=m("div"),o=E("Manufacturer: "),a=E(u),c=h(),f=m("div"),_=E("Model: "),b=E(p),v=h(),d=m("div"),g=E("ID: "),T=E(w),r(l,"class","text-sm"),r(i,"class","my-2"),r(f,"class","my-2"),r(d,"class","my-2"),r(e,"class","cnt")},m(M,P){S(M,e,P),s(e,l),s(e,n),s(e,i),s(i,o),s(i,a),s(e,c),s(e,f),s(f,_),s(f,b),s(e,v),s(e,d),s(d,g),s(d,T)},p(M,P){P&2&&u!==(u=vs(M[1].meter.mfg)+"")&&J(a,u),P&2&&p!==(p=(M[1].meter.model?M[1].meter.model:"unknown")+"")&&J(b,p),P&2&&w!==(w=(M[1].meter.id?M[1].meter.id:"unknown")+"")&&J(T,w)},d(M){M&&$(e)}}}function Nf(t){let e,l,n,i,o,u=t[1].net.ip+"",a,c,f,_,p=t[1].net.mask+"",b,v,d,g,w=t[1].net.gw+"",T,M,P,L,I=t[1].net.dns1+"",F,C,R=t[1].net.dns2&&Ef(t);return{c(){e=m("div"),l=m("strong"),l.textContent="Network",n=h(),i=m("div"),o=E("IP: "),a=E(u),c=h(),f=m("div"),_=E("Mask: "),b=E(p),v=h(),d=m("div"),g=E("Gateway: "),T=E(w),M=h(),P=m("div"),L=E("DNS: "),F=E(I),C=h(),R&&R.c(),r(l,"class","text-sm"),r(i,"class","my-2"),r(f,"class","my-2"),r(d,"class","my-2"),r(P,"class","my-2"),r(e,"class","cnt")},m(ne,H){S(ne,e,H),s(e,l),s(e,n),s(e,i),s(i,o),s(i,a),s(e,c),s(e,f),s(f,_),s(f,b),s(e,v),s(e,d),s(d,g),s(d,T),s(e,M),s(e,P),s(P,L),s(P,F),s(P,C),R&&R.m(P,null)},p(ne,H){H&2&&u!==(u=ne[1].net.ip+"")&&J(a,u),H&2&&p!==(p=ne[1].net.mask+"")&&J(b,p),H&2&&w!==(w=ne[1].net.gw+"")&&J(T,w),H&2&&I!==(I=ne[1].net.dns1+"")&&J(F,I),ne[1].net.dns2?R?R.p(ne,H):(R=Ef(ne),R.c(),R.m(P,null)):R&&(R.d(1),R=null)},d(ne){ne&&$(e),R&&R.d()}}}function Ef(t){let e,l=t[1].net.dns2+"",n;return{c(){e=E("/ "),n=E(l)},m(i,o){S(i,e,o),S(i,n,o)},p(i,o){o&2&&l!==(l=i[1].net.dns2+"")&&J(n,l)},d(i){i&&$(e),i&&$(n)}}}function Af(t){let e,l,n,i=t[1].upgrade.f+"",o,u,a=t[1].upgrade.t+"",c,f,_=Aa(t[1].upgrade.e)+"",p;return{c(){e=m("div"),l=m("div"),n=E("Previous upgrade attempt from "),o=E(i),u=E(" to "),c=E(a),f=E(" failed. "),p=E(_),r(l,"class","bd-yellow"),r(e,"class","my-2")},m(b,v){S(b,e,v),s(e,l),s(l,n),s(l,o),s(l,u),s(l,c),s(l,f),s(l,p)},p(b,v){v&2&&i!==(i=b[1].upgrade.f+"")&&J(o,i),v&2&&a!==(a=b[1].upgrade.t+"")&&J(c,a),v&2&&_!==(_=Aa(b[1].upgrade.e)+"")&&J(p,_)},d(b){b&&$(e)}}}function Pf(t){let e,l,n,i=t[2].tag_name+"",o,u,a,c,f,_,p=(t[1].security==0||t[0].a)&&t[1].fwconsent===1&&t[2]&&t[2].tag_name!=t[1].version&&Df(t),b=t[1].fwconsent===2&&Rf();return{c(){e=m("div"),l=E(`Latest version: `),n=m("a"),o=E(i),a=h(),p&&p.c(),c=h(),b&&b.c(),f=Ke(),r(n,"href",u=t[2].html_url),r(n,"class","ml-2 text-blue-600 hover:text-blue-800"),r(n,"target","_blank"),r(n,"rel","noreferrer"),r(e,"class","my-2 flex")},m(v,d){S(v,e,d),s(e,l),s(e,n),s(n,o),s(e,a),p&&p.m(e,null),S(v,c,d),b&&b.m(v,d),S(v,f,d),_=!0},p(v,d){(!_||d&4)&&i!==(i=v[2].tag_name+"")&&J(o,i),(!_||d&4&&u!==(u=v[2].html_url))&&r(n,"href",u),(v[1].security==0||v[0].a)&&v[1].fwconsent===1&&v[2]&&v[2].tag_name!=v[1].version?p?(p.p(v,d),d&7&&O(p,1)):(p=Df(v),p.c(),O(p,1),p.m(e,null)):p&&(Ae(),q(p,1,1,()=>{p=null}),Pe()),v[1].fwconsent===2?b||(b=Rf(),b.c(),b.m(f.parentNode,f)):b&&(b.d(1),b=null)},i(v){_||(O(p),_=!0)},o(v){q(p),_=!1},d(v){v&&$(e),p&&p.d(),v&&$(c),b&&b.d(v),v&&$(f)}}}function Df(t){let e,l,n,i,o,u;return n=new Jc({}),{c(){e=m("div"),l=m("button"),re(n.$$.fragment),r(e,"class","flex-none ml-2 text-green-500"),r(e,"title","Install this version")},m(a,c){S(a,e,c),s(e,l),ie(n,l,null),i=!0,o||(u=te(l,"click",t[10]),o=!0)},p:pe,i(a){i||(O(n.$$.fragment,a),i=!0)},o(a){q(n.$$.fragment,a),i=!1},d(a){a&&$(e),se(n),o=!1,u()}}}function Rf(t){let e;return{c(){e=m("div"),e.innerHTML='
You have disabled one-click firmware upgrade, link to self-upgrade is disabled
',r(e,"class","my-2")},m(l,n){S(l,e,n)},d(l){l&&$(e)}}}function If(t){let e,l=hs(he(t[1].chip,t[1].board))+"",n;return{c(){e=m("div"),n=E(l),r(e,"class","bd-red")},m(i,o){S(i,e,o),s(e,n)},p(i,o){o&2&&l!==(l=hs(he(i[1].chip,i[1].board))+"")&&J(n,l)},d(i){i&&$(e)}}}function Lf(t){let e,l,n,i,o,u;function a(_,p){return _[4].length==0?U_:B_}let c=a(t),f=c(t);return{c(){e=m("div"),l=m("form"),n=m("input"),i=h(),f.c(),co(n,"display","none"),r(n,"name","file"),r(n,"type","file"),r(n,"accept",".bin"),r(l,"action","/firmware"),r(l,"enctype","multipart/form-data"),r(l,"method","post"),r(l,"autocomplete","off"),r(e,"class","my-2 flex")},m(_,p){S(_,e,p),s(e,l),s(l,n),t[12](n),s(l,i),f.m(l,null),o||(u=[te(n,"change",t[13]),te(l,"submit",t[15])],o=!0)},p(_,p){c===(c=a(_))&&f?f.p(_,p):(f.d(1),f=c(_),f&&(f.c(),f.m(l,null)))},d(_){_&&$(e),t[12](null),f.d(),o=!1,ze(u)}}}function B_(t){let e=t[4][0].name+"",l,n,i;return{c(){l=E(e),n=h(),i=m("button"),i.textContent="Upload",r(i,"type","submit"),r(i,"class","btn-pri-sm float-right")},m(o,u){S(o,l,u),S(o,n,u),S(o,i,u)},p(o,u){u&16&&e!==(e=o[4][0].name+"")&&J(l,e)},d(o){o&&$(l),o&&$(n),o&&$(i)}}}function U_(t){let e,l,n;return{c(){e=m("button"),e.textContent="Select firmware file for upgrade",r(e,"type","button"),r(e,"class","btn-pri-sm float-right")},m(i,o){S(i,e,o),l||(n=te(e,"click",t[14]),l=!0)},p:pe,d(i){i&&$(e),l=!1,n()}}}function Of(t){let e,l,n,i,o,u,a,c,f,_,p,b,v,d,g=t[9],w=[];for(let I=0;I Include Secrets
(SSID, PSK, passwords and tokens)',c=h(),T&&T.c(),f=h(),_=m("form"),p=m("input"),b=h(),L.c(),r(l,"class","text-sm"),r(a,"class","my-1 mx-3 col-span-2"),r(o,"class","grid grid-cols-2"),r(i,"method","get"),r(i,"action","/configfile.cfg"),r(i,"autocomplete","off"),co(p,"display","none"),r(p,"name","file"),r(p,"type","file"),r(p,"accept",".cfg"),r(_,"action","/configfile"),r(_,"enctype","multipart/form-data"),r(_,"method","post"),r(_,"autocomplete","off"),r(e,"class","cnt")},m(I,F){S(I,e,F),s(e,l),s(e,n),s(e,i),s(i,o);for(let C=0;C{A=null}),Pe());const Lt={};Me&8388608&&(Lt.$$scope={dirty:Me,ctx:ue}),ne.$set(Lt),ue[1].meter?D?D.p(ue,Me):(D=Tf(ue),D.c(),D.m(e,K)):D&&(D.d(1),D=null),ue[1].net?Z?Z.p(ue,Me):(Z=Nf(ue),Z.c(),Z.m(e,Q)):Z&&(Z.d(1),Z=null),(!N||Me&2)&&ae!==(ae=ue[1].version+"")&&J(ee,ae),ue[1].upgrade.t&&ue[1].upgrade.t!=ue[1].version?le?le.p(ue,Me):(le=Af(ue),le.c(),le.m(G,W)):le&&(le.d(1),le=null),ue[2]?fe?(fe.p(ue,Me),Me&4&&O(fe,1)):(fe=Pf(ue),fe.c(),O(fe,1),fe.m(G,we)):fe&&(Ae(),q(fe,1,1,()=>{fe=null}),Pe()),Me&3&&(He=(ue[1].security==0||ue[0].a)&&ti(ue[1].board)),He?de?de.p(ue,Me):(de=If(ue),de.c(),de.m(G,Le)):de&&(de.d(1),de=null),ue[1].security==0||ue[0].a?Ce?Ce.p(ue,Me):(Ce=Lf(ue),Ce.c(),Ce.m(G,null)):Ce&&(Ce.d(1),Ce=null),ue[1].security==0||ue[0].a?Oe?Oe.p(ue,Me):(Oe=Of(ue),Oe.c(),Oe.m(e,null)):Oe&&(Oe.d(1),Oe=null);const st={};Me&32&&(st.active=ue[5]),ve.$set(st);const wt={};Me&256&&(wt.active=ue[8]),be.$set(wt)},i(ue){N||(O(w.$$.fragment,ue),O(A),O(ne.$$.fragment,ue),O(fe),O(ve.$$.fragment,ue),O(be.$$.fragment,ue),N=!0)},o(ue){q(w.$$.fragment,ue),q(A),q(ne.$$.fragment,ue),q(fe),q(ve.$$.fragment,ue),q(be.$$.fragment,ue),N=!1},d(ue){ue&&$(e),se(w),A&&A.d(),se(ne),D&&D.d(),Z&&Z.d(),le&&le.d(),fe&&fe.d(),de&&de.d(),Ce&&Ce.d(),Oe&&Oe.d(),ue&&$(ye),se(ve,ue),ue&&$(Te),se(be,ue),y=!1,k()}}}async function z_(){await(await fetch("/reboot",{method:"POST"})).json()}function G_(t,e,l){let{data:n}=e,{sysinfo:i}=e,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 API",key:"is"}],u={};yo.subscribe(C=>{l(2,u=Xc(i.version,C)),u||l(2,u=C[0])});function a(){confirm("Do you want to upgrade this device to "+u.tag_name+"?")&&(i.board!=2&&i.board!=4&&i.board!=7||confirm(hs(he(i.chip,i.board))))&&(Wt.update(C=>(C.upgrading=!0,C)),Qc(u.tag_name))}const c=function(){confirm("Are you sure you want to reboot the device?")&&(Wt.update(C=>(C.booting=!0,C)),z_())};let f,_=[],p=!1,b,v=[],d=!1;bo();function g(C){ps[C?"unshift":"push"](()=>{f=C,l(3,f)})}function w(){_=this.files,l(4,_)}const T=()=>{f.click()},M=()=>l(5,p=!0);function P(C){ps[C?"unshift":"push"](()=>{b=C,l(6,b)})}function L(){v=this.files,l(7,v)}const I=()=>{b.click()},F=()=>l(8,d=!0);return t.$$set=C=>{"data"in C&&l(0,n=C.data),"sysinfo"in C&&l(1,i=C.sysinfo)},[n,i,u,f,_,p,b,v,d,o,a,c,g,w,T,M,P,L,I,F]}class V_ extends Ie{constructor(e){super(),Re(this,e,G_,W_,Ee,{data:0,sysinfo:1})}}function Bf(t){let e,l,n=he(t[0],7)+"",i,o,u=he(t[0],5)+"",a,c,f=he(t[0],4)+"",_,p,b=he(t[0],3)+"",v,d,g,w,T=he(t[0],2)+"",M,P,L=he(t[0],1)+"",I,F,C=he(t[0],0)+"",R,ne,H,z,U=he(t[0],101)+"",K,Q,G=he(t[0],100)+"",X;return{c(){e=m("optgroup"),l=m("option"),i=E(n),o=m("option"),a=E(u),c=m("option"),_=E(f),p=m("option"),v=E(b),d=h(),g=m("optgroup"),w=m("option"),M=E(T),P=m("option"),I=E(L),F=m("option"),R=E(C),ne=h(),H=m("optgroup"),z=m("option"),K=E(U),Q=m("option"),X=E(G),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,r(e,"label","amsleser.no"),w.__value=2,w.value=w.__value,P.__value=1,P.value=P.__value,F.__value=0,F.value=F.__value,r(g,"label","Custom hardware"),z.__value=101,z.value=z.__value,Q.__value=100,Q.value=Q.__value,r(H,"label","Generic hardware")},m(Y,j){S(Y,e,j),s(e,l),s(l,i),s(e,o),s(o,a),s(e,c),s(c,_),s(e,p),s(p,v),S(Y,d,j),S(Y,g,j),s(g,w),s(w,M),s(g,P),s(P,I),s(g,F),s(F,R),S(Y,ne,j),S(Y,H,j),s(H,z),s(z,K),s(H,Q),s(Q,X)},p(Y,j){j&1&&n!==(n=he(Y[0],7)+"")&&J(i,n),j&1&&u!==(u=he(Y[0],5)+"")&&J(a,u),j&1&&f!==(f=he(Y[0],4)+"")&&J(_,f),j&1&&b!==(b=he(Y[0],3)+"")&&J(v,b),j&1&&T!==(T=he(Y[0],2)+"")&&J(M,T),j&1&&L!==(L=he(Y[0],1)+"")&&J(I,L),j&1&&C!==(C=he(Y[0],0)+"")&&J(R,C),j&1&&U!==(U=he(Y[0],101)+"")&&J(K,U),j&1&&G!==(G=he(Y[0],100)+"")&&J(X,G)},d(Y){Y&&$(e),Y&&$(d),Y&&$(g),Y&&$(ne),Y&&$(H)}}}function Uf(t){let e,l,n=he(t[0],201)+"",i,o,u=he(t[0],202)+"",a,c,f=he(t[0],203)+"",_,p,b=he(t[0],241)+"",v,d,g=he(t[0],242)+"",w,T,M=he(t[0],243)+"",P,L,I=he(t[0],200)+"",F;return{c(){e=m("optgroup"),l=m("option"),i=E(n),o=m("option"),a=E(u),c=m("option"),_=E(f),p=m("option"),v=E(b),d=m("option"),w=E(g),T=m("option"),P=E(M),L=m("option"),F=E(I),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,d.__value=242,d.value=d.__value,T.__value=243,T.value=T.__value,L.__value=200,L.value=L.__value,r(e,"label","Generic hardware")},m(C,R){S(C,e,R),s(e,l),s(l,i),s(e,o),s(o,a),s(e,c),s(c,_),s(e,p),s(p,v),s(e,d),s(d,w),s(e,T),s(T,P),s(e,L),s(L,F)},p(C,R){R&1&&n!==(n=he(C[0],201)+"")&&J(i,n),R&1&&u!==(u=he(C[0],202)+"")&&J(a,u),R&1&&f!==(f=he(C[0],203)+"")&&J(_,f),R&1&&b!==(b=he(C[0],241)+"")&&J(v,b),R&1&&g!==(g=he(C[0],242)+"")&&J(w,g),R&1&&M!==(M=he(C[0],243)+"")&&J(P,M),R&1&&I!==(I=he(C[0],200)+"")&&J(F,I)},d(C){C&&$(e)}}}function jf(t){let e,l,n=he(t[0],7)+"",i,o,u=he(t[0],6)+"",a,c,f=he(t[0],5)+"",_,p,b,v,d=he(t[0],51)+"",g,w,T=he(t[0],50)+"",M;return{c(){e=m("optgroup"),l=m("option"),i=E(n),o=m("option"),a=E(u),c=m("option"),_=E(f),p=h(),b=m("optgroup"),v=m("option"),g=E(d),w=m("option"),M=E(T),l.__value=7,l.value=l.__value,o.__value=6,o.value=o.__value,c.__value=5,c.value=c.__value,r(e,"label","amsleser.no"),v.__value=51,v.value=v.__value,w.__value=50,w.value=w.__value,r(b,"label","Generic hardware")},m(P,L){S(P,e,L),s(e,l),s(l,i),s(e,o),s(o,a),s(e,c),s(c,_),S(P,p,L),S(P,b,L),s(b,v),s(v,g),s(b,w),s(w,M)},p(P,L){L&1&&n!==(n=he(P[0],7)+"")&&J(i,n),L&1&&u!==(u=he(P[0],6)+"")&&J(a,u),L&1&&f!==(f=he(P[0],5)+"")&&J(_,f),L&1&&d!==(d=he(P[0],51)+"")&&J(g,d),L&1&&T!==(T=he(P[0],50)+"")&&J(M,T)},d(P){P&&$(e),P&&$(p),P&&$(b)}}}function Hf(t){let e,l,n=he(t[0],8)+"",i,o,u,a,c=he(t[0],71)+"",f,_,p=he(t[0],70)+"",b;return{c(){e=m("optgroup"),l=m("option"),i=E(n),o=h(),u=m("optgroup"),a=m("option"),f=E(c),_=m("option"),b=E(p),l.__value=8,l.value=l.__value,r(e,"label","Custom hardware"),a.__value=71,a.value=a.__value,_.__value=70,_.value=_.__value,r(u,"label","Generic hardware")},m(v,d){S(v,e,d),s(e,l),s(l,i),S(v,o,d),S(v,u,d),s(u,a),s(a,f),s(u,_),s(_,b)},p(v,d){d&1&&n!==(n=he(v[0],8)+"")&&J(i,n),d&1&&c!==(c=he(v[0],71)+"")&&J(f,c),d&1&&p!==(p=he(v[0],70)+"")&&J(b,p)},d(v){v&&$(e),v&&$(o),v&&$(u)}}}function Wf(t){let e,l,n=he(t[0],200)+"",i;return{c(){e=m("optgroup"),l=m("option"),i=E(n),l.__value=200,l.value=l.__value,r(e,"label","Generic hardware")},m(o,u){S(o,e,u),s(e,l),s(l,i)},p(o,u){u&1&&n!==(n=he(o[0],200)+"")&&J(i,n)},d(o){o&&$(e)}}}function zf(t){let e,l,n=he(t[0],80)+"",i;return{c(){e=m("optgroup"),l=m("option"),i=E(n),l.__value=80,l.value=l.__value,r(e,"label","Generic hardware")},m(o,u){S(o,e,u),s(e,l),s(l,i)},p(o,u){u&1&&n!==(n=he(o[0],80)+"")&&J(i,n)},d(o){o&&$(e)}}}function K_(t){let e,l,n,i,o,u,a,c,f=t[0]=="esp8266"&&Bf(t),_=t[0]=="esp32"&&Uf(t),p=t[0]=="esp32s2"&&jf(t),b=t[0]=="esp32c3"&&Hf(t),v=t[0]=="esp32solo"&&Wf(t),d=t[0]=="esp32s3"&&zf(t);return{c(){e=m("option"),l=h(),f&&f.c(),n=h(),_&&_.c(),i=h(),p&&p.c(),o=h(),b&&b.c(),u=h(),v&&v.c(),a=h(),d&&d.c(),c=Ke(),e.__value=-1,e.value=e.__value},m(g,w){S(g,e,w),S(g,l,w),f&&f.m(g,w),S(g,n,w),_&&_.m(g,w),S(g,i,w),p&&p.m(g,w),S(g,o,w),b&&b.m(g,w),S(g,u,w),v&&v.m(g,w),S(g,a,w),d&&d.m(g,w),S(g,c,w)},p(g,[w]){g[0]=="esp8266"?f?f.p(g,w):(f=Bf(g),f.c(),f.m(n.parentNode,n)):f&&(f.d(1),f=null),g[0]=="esp32"?_?_.p(g,w):(_=Uf(g),_.c(),_.m(i.parentNode,i)):_&&(_.d(1),_=null),g[0]=="esp32s2"?p?p.p(g,w):(p=jf(g),p.c(),p.m(o.parentNode,o)):p&&(p.d(1),p=null),g[0]=="esp32c3"?b?b.p(g,w):(b=Hf(g),b.c(),b.m(u.parentNode,u)):b&&(b.d(1),b=null),g[0]=="esp32solo"?v?v.p(g,w):(v=Wf(g),v.c(),v.m(a.parentNode,a)):v&&(v.d(1),v=null),g[0]=="esp32s3"?d?d.p(g,w):(d=zf(g),d.c(),d.m(c.parentNode,c)):d&&(d.d(1),d=null)},i:pe,o:pe,d(g){g&&$(e),g&&$(l),f&&f.d(g),g&&$(n),_&&_.d(g),g&&$(i),p&&p.d(g),g&&$(o),b&&b.d(g),g&&$(u),v&&v.d(g),g&&$(a),d&&d.d(g),g&&$(c)}}}function Y_(t,e,l){let{chip:n}=e;return t.$$set=i=>{"chip"in i&&l(0,n=i.chip)},[n]}class Q_ extends Ie{constructor(e){super(),Re(this,e,Y_,K_,Ee,{chip:0})}}function Gf(t){let e;return{c(){e=m("div"),e.textContent="WARNING: Changing this configuration will affect basic configuration of your device. Only make changes here if instructed by vendor",r(e,"class","bd-red")},m(l,n){S(l,e,n)},d(l){l&&$(e)}}}function Vf(t){let e,l,n,i,o,u,a;return u=new io({props:{chip:t[0].chip}}),{c(){e=m("div"),l=E("HAN GPIO"),n=m("br"),i=h(),o=m("select"),re(u.$$.fragment),r(o,"name","vh"),r(o,"class","in-s"),r(e,"class","my-3")},m(c,f){S(c,e,f),s(e,l),s(e,n),s(e,i),s(e,o),ie(u,o,null),a=!0},p(c,f){const _={};f&1&&(_.chip=c[0].chip),u.$set(_)},i(c){a||(O(u.$$.fragment,c),a=!0)},o(c){q(u.$$.fragment,c),a=!1},d(c){c&&$(e),se(u)}}}function X_(t){let e,l,n,i,o,u,a,c,f,_,p,b,v,d,g,w,T,M,P,L,I,F,C,R,ne,H,z,U,K,Q=t[0].usrcfg&&Gf();d=new Q_({props:{chip:t[0].chip}});let G=t[0].board&&t[0].board>20&&Vf(t);return H=new kt({props:{active:t[1],message:"Saving device configuration"}}),{c(){e=m("div"),l=m("div"),n=m("form"),i=m("input"),o=h(),u=m("strong"),u.textContent="Initial configuration",a=h(),Q&&Q.c(),c=h(),f=m("div"),_=E("Board type"),p=m("br"),b=h(),v=m("select"),re(d.$$.fragment),g=h(),G&&G.c(),w=h(),T=m("div"),M=m("label"),P=m("input"),L=E(" Clear all other configuration"),I=h(),F=m("div"),F.innerHTML='',C=h(),R=m("span"),R.textContent="\xA0",ne=h(),re(H.$$.fragment),r(i,"type","hidden"),r(i,"name","v"),i.value="true",r(u,"class","text-sm"),r(v,"name","vb"),r(v,"class","in-s"),t[0].board===void 0&&We(()=>t[4].call(v)),r(f,"class","my-3"),r(P,"type","checkbox"),r(P,"name","vr"),P.__value="true",P.value=P.__value,r(P,"class","rounded mb-1"),r(T,"class","my-3"),r(F,"class","my-3"),r(R,"class","clear-both"),r(n,"autocomplete","off"),r(l,"class","cnt"),r(e,"class","grid xl:grid-cols-4 lg:grid-cols-3 md:grid-cols-2")},m(X,Y){S(X,e,Y),s(e,l),s(l,n),s(n,i),s(n,o),s(n,u),s(n,a),Q&&Q.m(n,null),s(n,c),s(n,f),s(f,_),s(f,p),s(f,b),s(f,v),ie(d,v,null),$e(v,t[0].board,!0),s(n,g),G&&G.m(n,null),s(n,w),s(n,T),s(T,M),s(M,P),P.checked=t[2],s(M,L),s(n,I),s(n,F),s(n,C),s(n,R),S(X,ne,Y),ie(H,X,Y),z=!0,U||(K=[te(v,"change",t[4]),te(P,"change",t[5]),te(n,"submit",wi(t[3]))],U=!0)},p(X,[Y]){X[0].usrcfg?Q||(Q=Gf(),Q.c(),Q.m(n,c)):Q&&(Q.d(1),Q=null);const j={};Y&1&&(j.chip=X[0].chip),d.$set(j),Y&1&&$e(v,X[0].board),X[0].board&&X[0].board>20?G?(G.p(X,Y),Y&1&&O(G,1)):(G=Vf(X),G.c(),O(G,1),G.m(n,w)):G&&(Ae(),q(G,1,1,()=>{G=null}),Pe()),Y&4&&(P.checked=X[2]);const x={};Y&2&&(x.active=X[1]),H.$set(x)},i(X){z||(O(d.$$.fragment,X),O(G),O(H.$$.fragment,X),z=!0)},o(X){q(d.$$.fragment,X),q(G),q(H.$$.fragment,X),z=!1},d(X){X&&$(e),Q&&Q.d(),se(d),G&&G.d(),X&&$(ne),se(H,X),U=!1,ze(K)}}}function Z_(t,e,l){let{sysinfo:n={}}=e,i=!1;async function o(f){l(1,i=!0);const _=new FormData(f.target),p=new URLSearchParams;for(let d of _){const[g,w]=d;p.append(g,w)}let v=await(await fetch("/save",{method:"POST",body:p})).json();l(1,i=!1),Wt.update(d=>(d.vndcfg=v.success,d.booting=v.reboot,d.if.eth=d.boardType>240&&d.boardType<250,d)),fn(n.usrcfg?"/":"/setup")}let u=!1;Wt.subscribe(f=>{l(0,n=f),f.fwconsent===1&&l(2,u=!n.usrcfg)});function a(){n.board=tt(this),l(0,n)}function c(){u=this.checked,l(2,u)}return t.$$set=f=>{"sysinfo"in f&&l(0,n=f.sysinfo)},[n,i,u,o,a,c]}class J_ extends Ie{constructor(e){super(),Re(this,e,Z_,X_,Ee,{sysinfo:0})}}function Kf(t){let e;return{c(){e=m("option"),e.textContent="Ethernet",e.__value=3,e.value=e.__value},m(l,n){S(l,e,n)},d(l){l&&$(e)}}}function Yf(t){let e,l,n,i,o,u,a,c,f,_,p,b,v;return{c(){e=m("div"),l=E("SSID"),n=m("br"),i=h(),o=m("input"),a=h(),c=m("div"),f=E("PSK"),_=m("br"),p=h(),b=m("input"),r(o,"name","ss"),r(o,"type","text"),r(o,"class","in-s"),o.required=u=t[2]==1||t[2]==2,r(e,"class","my-3"),r(b,"name","sp"),r(b,"type","password"),r(b,"class","in-s"),r(b,"autocomplete","off"),b.required=v=t[2]==2,r(c,"class","my-3")},m(d,g){S(d,e,g),s(e,l),s(e,n),s(e,i),s(e,o),S(d,a,g),S(d,c,g),s(c,f),s(c,_),s(c,p),s(c,b)},p(d,g){g&4&&u!==(u=d[2]==1||d[2]==2)&&(o.required=u),g&4&&v!==(v=d[2]==2)&&(b.required=v)},d(d){d&&$(e),d&&$(a),d&&$(c)}}}function Qf(t){let e,l,n,i,o,u,a,c;return a=new t1({}),{c(){e=m("br"),l=h(),n=m("div"),i=m("input"),o=h(),u=m("select"),re(a.$$.fragment),r(i,"name","si"),r(i,"type","text"),r(i,"class","in-f w-full"),i.required=t[1],r(u,"name","su"),r(u,"class","in-l"),u.required=t[1],r(n,"class","flex")},m(f,_){S(f,e,_),S(f,l,_),S(f,n,_),s(n,i),s(n,o),s(n,u),ie(a,u,null),c=!0},p(f,_){(!c||_&2)&&(i.required=f[1]),(!c||_&2)&&(u.required=f[1])},i(f){c||(O(a.$$.fragment,f),c=!0)},o(f){q(a.$$.fragment,f),c=!1},d(f){f&&$(e),f&&$(l),f&&$(n),se(a)}}}function Xf(t){let e;return{c(){e=m("div"),e.innerHTML=`
Gateway