/*! https://github.com/leeoniya/uPlot (v1.6.32) */ var uPlot=function(){"use strict";function e(e,t,l,n){let i;l=l||0;let s=2147483647>=(n=n||t.length-1);for(;n-l>1;)i=s?l+n>>1:_((l+n)/2),e>t[i]?l=i:n=i;return e-t[l]>t[n]-e?n:l}function t(e){return(t,l,n)=>{let i=-1,s=-1;for(let s=l;n>=s;s++)if(e(t[s])){i=s;break}for(let i=n;i>=l;i--)if(e(t[i])){s=i;break}return[i,s]}}const l=e=>null!=e,n=e=>null!=e&&e>0,i=t(l),s=t(n);function o(e,t,l,n){2==l&&(n=!0);let i=S(e),s=S(t);e==t&&(-1==i?(e*=l,t/=l):(e/=l,t*=l));let o=10==l?z:D,r=1==i?_:k,u=1==s?k:_,a=o(b(e)),f=o(b(t)),c=r(a),h=u(f),p=T(l,c),d=T(l,h);return 10==l&&(0>c&&(p=V(p,-c)),0>h&&(d=V(d,-h))),n?(e=p*i,t=d*s):(e=j(e,T(l,_(a)),!1),t=N(t,T(l,_(f)),!1)),[e,t]}function r(e,t,l,n){let i=o(e,t,l,n);return 0==e&&(i[0]=0),0==t&&(i[1]=0),i}const u=.1,a={mode:3,pad:u},f={pad:0,soft:null,mode:0},c={min:f,max:f};function h(e,t,l,n){return te(l)?d(e,t,l):(f.pad=l,f.soft=n?0:null,f.mode=n?3:0,d(e,t,c))}function p(e,t){return null==e?t:e}function d(e,t,l){let n=l.min,i=l.max,s=p(n.pad,0),o=p(i.pad,0),r=p(n.hard,-P),u=p(i.hard,P),a=p(n.soft,P),f=p(i.soft,-P),c=p(n.mode,0),h=p(i.mode,0),d=t-e,m=z(d),g=M(b(e),b(t)),x=z(g),w=b(x-m);(1e-24>d||w>10)&&(d=0,0!=e&&0!=t||(d=1e-24,2==c&&a!=P&&(s=0),2==h&&f!=-P&&(o=0)));let v=d||g||1e3,k=z(v),S=T(10,_(k)),D=V(j(e-v*(0==d?0==e?.1:1:s),S/10),24),E=a>e||1!=c&&(3!=c||D>a)&&(2!=c||a>D)?P:a,A=M(r,E>D&&e>=E?E:y(E,D)),C=V(N(t+v*(0==d?0==t?.1:1:o),S/10),24),W=t>f||1!=h&&(3!=h||f>C)&&(2!=h||C>f)?-P:f,Y=y(u,C>W&&W>=t?W:M(W,C));return A==Y&&0==A&&(Y=100),[A,Y]}const m=new Intl.NumberFormat,g=e=>m.format(e),x=Math,w=x.PI,b=x.abs,_=x.floor,v=x.round,k=x.ceil,y=x.min,M=x.max,T=x.pow,S=x.sign,z=x.log10,D=x.log2,E=(e,t=1)=>x.asinh(e/t),P=1/0;function A(e){return 1+(0|z((e^e>>31)-(e>>31)))}function C(e,t,l){return y(M(e,t),l)}function W(e){return"function"==typeof e}function Y(e){return W(e)?e:()=>e}const H=e=>e,R=(e,t)=>t,F=()=>null,G=()=>!0,I=(e,t)=>e==t,O=/\.\d*?(?=9{6,}|0{6,})/gm,L=e=>{if(Q(e)||B.has(e))return e;const t=""+e,l=t.match(O);if(null==l)return e;let n=l[0].length-1;if(-1!=t.indexOf("e-")){let[e,l]=t.split("e");return+`${L(e)}e${l}`}return V(e,n)};function U(e,t,l=!0){return l?L(V(L(e/t))*t):V(e/t)*t}function N(e,t,l=!0){return l?L(k(L(e/t))*t):k(e/t)*t}function j(e,t,l=!0){return l?L(_(L(e/t))*t):_(e/t)*t}function V(e,t=0){if(Q(e))return e;let l=10**t;return v(e*l*(1+Number.EPSILON))/l}const B=new Map;function Z(e){return((""+e).split(".")[1]||"").length}function $(e,t,l,n){let i=[],s=n.map(Z);for(let o=t;l>o;o++){let t=b(o),l=V(T(e,o),t);for(let r=0;n.length>r;r++){let u=10==e?+`${n[r]}e${o}`:n[r]*l,a=(0>o?t:0)+(s[r]>o?s[r]:0),f=10==e?u:V(u,a);i.push(f),B.set(f,a)}}return i}const J={},q=[],K=[null,null],X=Array.isArray,Q=Number.isInteger;function ee(e){return"string"==typeof e}function te(e){let t=!1;if(null!=e){let l=e.constructor;t=null==l||l==Object}return t}function le(e){return null!=e&&"object"==typeof e}const ne=Object.getPrototypeOf(Uint8Array),ie="__proto__";function se(e,t=te){let l;if(X(e)){let n=e.find((e=>null!=e));if(X(n)||t(n)){l=Array(e.length);for(let n=0;e.length>n;n++)l[n]=se(e[n],t)}else l=e.slice()}else if(e instanceof ne)l=e.slice();else if(t(e)){l={};for(let n in e)n!=ie&&(l[n]=se(e[n],t))}else l=e;return l}function oe(e){let t=arguments;for(let l=1;t.length>l;l++){let n=t[l];for(let t in n)t!=ie&&(te(e[t])?oe(e[t],se(n[t])):e[t]=se(n[t]))}return e}function re(e,t,l){for(let n,i=0,s=-1;t.length>i;i++){let o=t[i];if(o>s){for(n=o-1;n>=0&&null==e[n];)e[n--]=null;for(n=o+1;l>n&&null==e[n];)e[s=n++]=null}}}const ue="undefined"==typeof queueMicrotask?e=>Promise.resolve().then(e):queueMicrotask,ae="width",fe="height",ce="top",he="bottom",pe="left",de="right",me="#000",ge=me+"0",xe="mousemove",we="mousedown",be="mouseup",_e="mouseenter",ve="mouseleave",ke="dblclick",ye="change",Me="dppxchange",Te="--",Se="u-off",ze="u-label",De="undefined"!=typeof window,Ee=De?document:null,Pe=De?window:null;let Ae,Ce;function We(e,t){if(null!=t){let l=e.classList;!l.contains(t)&&l.add(t)}}function Ye(e,t){let l=e.classList;l.contains(t)&&l.remove(t)}function He(e,t,l){e.style[t]=l+"px"}function Re(e,t,l,n){let i=Ee.createElement(e);return null!=t&&We(i,t),null!=l&&l.insertBefore(i,n),i}function Fe(e,t){return Re("div",e,t)}const Ge=new WeakMap;function Ie(e,t,l,n,i){let s="translate("+t+"px,"+l+"px)";s!=Ge.get(e)&&(e.style.transform=s,Ge.set(e,s),0>t||0>l||t>n||l>i?We(e,Se):Ye(e,Se))}const Oe=new WeakMap;function Le(e,t,l){let n=t+l;n!=Oe.get(e)&&(Oe.set(e,n),e.style.background=t,e.style.borderColor=l)}const Ue=new WeakMap;function Ne(e,t,l,n){let i=t+""+l;i!=Ue.get(e)&&(Ue.set(e,i),e.style.height=l+"px",e.style.width=t+"px",e.style.marginLeft=n?-t/2+"px":0,e.style.marginTop=n?-l/2+"px":0)}const je={passive:!0},Ve={...je,capture:!0};function Be(e,t,l,n){t.addEventListener(e,l,n?Ve:je)}function Ze(e,t,l){t.removeEventListener(e,l,je)}De&&function e(){let t=devicePixelRatio;Ae!=t&&(Ae=t,Ce&&Ze(ye,Ce,e),Ce=matchMedia(`(min-resolution: ${Ae-.001}dppx) and (max-resolution: ${Ae+.001}dppx)`),Be(ye,Ce,e),Pe.dispatchEvent(new CustomEvent(Me)))}();const $e=["January","February","March","April","May","June","July","August","September","October","November","December"],Je=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function qe(e){return e.slice(0,3)}const Ke=Je.map(qe),Xe=$e.map(qe),Qe={MMMM:$e,MMM:Xe,WWWW:Je,WWW:Ke};function et(e){return(10>e?"0":"")+e}const tt={YYYY:e=>e.getFullYear(),YY:e=>(e.getFullYear()+"").slice(2),MMMM:(e,t)=>t.MMMM[e.getMonth()],MMM:(e,t)=>t.MMM[e.getMonth()],MM:e=>et(e.getMonth()+1),M:e=>e.getMonth()+1,DD:e=>et(e.getDate()),D:e=>e.getDate(),WWWW:(e,t)=>t.WWWW[e.getDay()],WWW:(e,t)=>t.WWW[e.getDay()],HH:e=>et(e.getHours()),H:e=>e.getHours(),h:e=>{let t=e.getHours();return 0==t?12:t>12?t-12:t},AA:e=>12>e.getHours()?"AM":"PM",aa:e=>12>e.getHours()?"am":"pm",a:e=>12>e.getHours()?"a":"p",mm:e=>et(e.getMinutes()),m:e=>e.getMinutes(),ss:e=>et(e.getSeconds()),s:e=>e.getSeconds(),fff:e=>function(e){return(10>e?"00":100>e?"0":"")+e}(e.getMilliseconds())};function lt(e,t){t=t||Qe;let l,n=[],i=/\{([a-z]+)\}|[^{]+/gi;for(;l=i.exec(e);)n.push("{"==l[0][0]?tt[l[1]]:l[0]);return e=>{let l="";for(let i=0;n.length>i;i++)l+="string"==typeof n[i]?n[i]:n[i](e,t);return l}}const nt=(new Intl.DateTimeFormat).resolvedOptions().timeZone,it="2-digit",st={weekday:"short",year:"numeric",month:it,day:it,hour:it,minute:it,second:it,fractionalSecondDigits:3,timeZoneName:"longOffset"},ot={};class rt extends Date{tz=null;#e=!1;#t=null;constructor(...e){super(...e),e[0]instanceof rt&&(this.tz=e[0].tz,this.#t=e[0].#t,this.#e=e[0].#e)}#l(e,t,l,n,i=0){let s=this.#t;return this.#e?e.call(this):null==s?t.call(this):+s.slice(l,n)+i}setTimeZone(e){if(this.tz=e,"UTC"==e||"Etc/UTC"==e)this.#e=!0;else{let t=function(e){return null==ot[e]&&(ot[e]=new Intl.DateTimeFormat("sv",{...st,timeZone:e}).format),ot[e]}(e),l=t(this);l.endsWith("GMT")&&(l+="+00:00"),this.#t=l}}getFullYear(){return this.#l(this.getUTCFullYear,super.getFullYear,-33,-29)}getMonth(){return this.#l(this.getUTCMonth,super.getMonth,-28,-26,-1)}getDate(){return this.#l(this.getUTCDate,super.getDate,-25,-23)}getHours(){return this.#l(this.getUTCHours,super.getHours,-22,-20)}getMinutes(){return this.#l(this.getUTCMinutes,super.getMinutes,-19,-17)}getSeconds(){return this.#l(this.getUTCSeconds,super.getSeconds,-16,-14)}getMilliseconds(){return this.#l(this.getUTCMilliseconds,super.getMilliseconds,-13,-10)}getDay(){let e=this.#t;return this.#e?this.getUTCDay():null==e?super.getDay():"s"==e[0]?0:"m"==e[0]?1:"i"==e[1]?2:"o"==e[0]?3:"o"==e[1]?4:"f"==e[0]?5:"l"==e[0]?6:-1}getTimezoneOffset(){let e=this.#t;return this.#e?0:null==e?super.getTimezoneOffset():(60*+e.slice(-5,-3)+ +e.slice(-2))*("-"==e.at(-6)?-1:1)}}const ut=4,at=5;function ft(e,t){let l=e.getTime()-(e.getMilliseconds()+1e3*e.getSeconds()+6e4*e.getMinutes()+36e5*e.getHours()+864e5*(t==ut?e.getDate()-1:t==at?function(e){let t=e.getFullYear(),l=e.getMonth()+1;return 31*--l-(l>1?(1054267675>>3*l-6&7)-(3&t||!(t%25)&&15&t?0:1):0)+e.getDate()}(e)-1:0)),n=new rt(l);n.setTimeZone(e.tz);let i=n.getHours();return i>0&&(n=new rt(l+36e5*(i>12?24-i:-i)),n.setTimeZone(e.tz)),n}const ct=e=>e%1==0,ht=[1,2,2.5,5],pt=$(10,-32,0,ht),dt=$(10,0,32,ht),mt=dt.filter(ct),gt=pt.concat(dt),xt="{YYYY}",wt="\n"+xt,bt="{M}/{D}",_t="\n"+bt,vt=_t+"/{YY}",kt="{aa}",yt="{h}:{mm}"+kt,Mt="\n"+yt,Tt=":{ss}",St=null;function zt(e){let t=1e3*e,l=60*t,n=60*l,i=24*n,s=30*i,o=365*i;return[(1==e?$(10,0,3,ht).filter(ct):$(10,-3,0,ht)).concat([t,5*t,10*t,15*t,30*t,l,5*l,10*l,15*l,30*l,n,2*n,3*n,4*n,6*n,8*n,12*n,i,2*i,3*i,4*i,5*i,6*i,7*i,8*i,9*i,10*i,15*i,s,2*s,3*s,4*s,6*s,o,2*o,5*o,10*o,25*o,50*o,100*o]),[[o,xt,St,St,St,St,St,St,1],[28*i,"{MMM}",wt,St,St,St,St,St,1],[i,bt,wt,St,St,St,St,St,1],[n,"{h}"+kt,vt,St,_t,St,St,St,1],[l,yt,vt,St,_t,St,St,St,1],[t,Tt,vt+" "+yt,St,_t+" "+yt,St,Mt,St,1],[e,Tt+".{fff}",vt+" "+yt,St,_t+" "+yt,St,Mt,St,1]],function(t){return(l,r,u,a,f)=>{let c=[],h=f>=o,p=f>=s&&o>f,d=f>=i&&s>f,m=f>n&&i>f,g=t(u),x=V(g*e,3),w=V(ft(g,h||p?at:d?ut:3)*e,3);if(d){let l=f/i,s=w+f*_((g.getDate()-1)/l);for(;;){let i=t(s),o=i.getHours();if(0!=o&&(s+=o>12?n:-n,i=t(s)),(i.getDate()-1)%l>0&&(i=ft(i,ut),s=i.getTime()*e,.7*f>s-c[c.length-1]&&c.pop()),s>a)break;u>s||c.push(s),s+=f}}else if(p||h){let l=1,n=1,r=0,d=0;p?(l=f/s,n=32,r=ut,d=g.getMonth()):h&&(l=f/o,n=366,r=at,d=g.getYear());let m=w+(f=l*n*i)*_(d/n);for(;m=ft(t(m),r).getTime()*e,m<=a;)u>m||c.push(m),m+=f}else if(m){let e=f/n,l=w+f*_(g.getHours()/e);for(;t(l).getHours()%e>0&&(l+=t(l-n).getHours()%e==0?-n:n),l<=a;)u>l||c.push(l),l+=f}else{let e=w+N(x-w,f);for(;e<=a;)u>e||c.push(e),e+=f}return c}}]}const[Dt,Et,Pt]=zt(1),[At,Ct,Wt]=zt(.001);function Yt(e,t){return e.map((e=>e.map(((l,n)=>0==n||8==n||null==l?l:t(1==n||0==e[8]?l:e[1]+l)))))}function Ht(e,t){return(l,n,i,s,o)=>{let r,u,a,f,c,h,p=t.find((e=>o>=e[0]))||t[t.length-1];return n.map((t=>{let l=e(t),n=l.getFullYear(),i=l.getMonth(),s=l.getDate(),o=l.getHours(),d=l.getMinutes(),m=l.getSeconds(),g=n!=r&&p[2]||i!=u&&p[3]||s!=a&&p[4]||o!=f&&p[5]||d!=c&&p[6]||m!=h&&p[7]||p[1];return r=n,u=i,a=s,f=o,c=d,h=m,g(l)}))}}function Rt(e,t){return t(e)}function Ft(e,t){return(l,n,i,s)=>null==s?Te:t(e(n))}$(2,-53,53,[1]);const Gt={show:!0,live:!0,isolate:!1,mount:()=>{},markers:{show:!0,width:2,stroke:function(e,t){let l=e.series[t];return l.width?l.stroke(e,t):l.points.width?l.points.stroke(e,t):null},fill:function(e,t){return e.series[t].fill(e,t)},dash:"solid"},idx:null,idxs:null,values:[]},It=[0,0];function Ot(e,t,l,n=!0){return e=>{0==e.button&&(!n||e.target==t)&&l(e)}}function Lt(e,t,l,n=!0){return e=>{(!n||e.target==t)&&l(e)}}const Ut={show:!0,x:!0,y:!0,lock:!1,move:function(e,t,l){return It[0]=t,It[1]=l,It},points:{one:!1,show:function(e,t){let l=e.cursor.points,n=Fe(),i=l.size(e,t);He(n,ae,i),He(n,fe,i);let s=i/-2;He(n,"marginLeft",s),He(n,"marginTop",s);let o=l.width(e,t,i);return o&&He(n,"borderWidth",o),n},size:function(e,t){return e.series[t].points.size},width:0,stroke:function(e,t){let l=e.series[t].points;return l._stroke||l._fill},fill:function(e,t){let l=e.series[t].points;return l._fill||l._stroke}},bind:{mousedown:Ot,mouseup:Ot,click:Ot,dblclick:Ot,mousemove:Lt,mouseleave:Lt,mouseenter:Lt},drag:{setScale:!0,x:!0,y:!1,dist:0,uni:null,click:(e,t)=>{t.stopPropagation(),t.stopImmediatePropagation()},_x:!1,_y:!1},focus:{dist:(e,t,l,n,i)=>n-i,prox:-1,bias:0},hover:{skip:[void 0],prox:null,bias:0},left:-10,top:-10,idx:null,dataIdx:null,idxs:null,event:null},Nt={show:!0,stroke:"rgba(0,0,0,0.07)",width:2},jt=oe({},Nt,{filter:R}),Vt=oe({},jt,{size:10}),Bt=oe({},Nt,{show:!1}),Zt='12px system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"',$t="bold "+Zt,Jt={show:!0,scale:"x",stroke:me,space:50,gap:5,alignTo:1,size:50,labelGap:0,labelSize:30,labelFont:$t,side:2,grid:jt,ticks:Vt,border:Bt,font:Zt,lineGap:1.5,rotate:0},qt={show:!0,scale:"x",auto:!1,sorted:1,min:P,max:-P,idxs:[]};function Kt(e,t){return t.map((e=>null==e?"":g(e)))}function Xt(e,t,l,n,i,s,o){let r=[],u=B.get(i)||0;for(let e=l=o?l:V(N(l,i),u);n>=e;e=V(e+i,u))r.push(Object.is(e,-0)?0:e);return r}function Qt(t,l,n,i,s){const o=[],r=t.scales[t.axes[l].scale].log,u=_((10==r?z:D)(n));s=T(r,u),10==r&&(s=gt[e(s,gt)]);let a=s,f=s*r;10==r&&(f=gt[e(f,gt)]);do{n>a||o.push(a),a+=s,10!=r||B.has(a)||(a=V(a,B.get(s))),f>a||(f=(s=a)*r,10==r&&(f=gt[e(f,gt)]))}while(i>=a);return o}function el(e,t,l,n,i){let s=e.scales[e.axes[t].scale].asinh,o=n>s?Qt(e,t,M(s,l),n,i):[s],r=0>n||l>0?[]:[0];return(-s>l?Qt(e,t,M(s,-n),-l,i):[s]).reverse().map((e=>-e)).concat(r,o)}const tl=/./,ll=/[12357]/,nl=/[125]/,il=/1/,sl=(e,t,l,n)=>e.map(((e,i)=>4==t&&0==e||i%n==0&&l.test(e.toExponential()[0>e?1:0])?e:null));function ol(e,t,l){let n=e.axes[l],i=n.scale,s=e.scales[i],o=e.valToPos,r=n._space,u=o(10,i),a=o(9,i)-ue)return sl(t.slice().reverse(),s.distr,a,k(r/e)).reverse()}return sl(t,s.distr,a,1)}function rl(e,t,l){let n=e.axes[l],i=n.scale,s=n._space,o=e.valToPos,r=b(o(1,i)-o(2,i));return s>r?sl(t.slice().reverse(),3,tl,k(s/r)).reverse():t}function ul(e,t,l,n){return null==n?Te:null==t?"":g(t)}const al={show:!0,scale:"y",stroke:me,space:30,gap:5,alignTo:1,size:50,labelGap:0,labelSize:30,labelFont:$t,side:3,grid:jt,ticks:Vt,border:Bt,font:Zt,lineGap:1.5,rotate:0},fl={scale:null,auto:!0,sorted:0,min:P,max:-P},cl=(e,t,l,n,i)=>i,hl={show:!0,auto:!0,sorted:0,gaps:cl,alpha:1,facets:[oe({},fl,{scale:"x"}),oe({},fl,{scale:"y"})]},pl={scale:"y",auto:!0,sorted:0,show:!0,spanGaps:!1,gaps:cl,alpha:1,points:{show:function(e,t){let{scale:l,idxs:n}=e.series[0],i=e._data[0],s=e.valToPos(i[n[0]],l,!0),o=e.valToPos(i[n[1]],l,!0);return b(o-s)/(e.series[t].points.space*e.pxRatio)>=n[1]-n[0]},filter:null},values:null,min:P,max:-P,idxs:[],path:null,clip:null};function dl(e,t,l){return l/10}const ml={time:!0,auto:!0,distr:1,log:10,asinh:1,min:null,max:null,dir:1,ori:0},gl=oe({},ml,{time:!1,ori:1}),xl={};function wl(e){let t=xl[e];return t||(t={key:e,plots:[],sub(e){t.plots.push(e)},unsub(e){t.plots=t.plots.filter((t=>t!=e))},pub(e,l,n,i,s,o,r){for(let u=0;t.plots.length>u;u++)t.plots[u]!=l&&t.plots[u].pub(e,l,n,i,s,o,r)}},null!=e&&(xl[e]=t)),t}function bl(e,t,l){const n=e.mode,i=e.series[t],s=2==n?e._data[t]:e._data,o=e.scales,r=e.bbox;let u=s[0],a=2==n?s[1]:s[t],f=2==n?o[i.facets[0].scale]:o[e.series[0].scale],c=2==n?o[i.facets[1].scale]:o[i.scale],h=r.left,p=r.top,d=r.width,m=r.height,g=e.valToPosH,x=e.valToPosV;return 0==f.ori?l(i,u,a,f,c,g,x,h,p,d,m,zl,El,Al,Wl,Hl):l(i,u,a,f,c,x,g,p,h,m,d,Dl,Pl,Cl,Yl,Rl)}function _l(e,t){let l=0,n=0,i=p(e.bands,q);for(let e=0;i.length>e;e++){let s=i[e];s.series[0]==t?l=s.dir:s.series[1]==t&&(n|=1==s.dir?1:2)}return[l,1==n?-1:2==n?1:3==n?2:0]}function vl(e,t,l,n,i){let s=e.series[t],o=e.scales[2==e.mode?s.facets[1].scale:s.scale];return-1==i?o.min:1==i?o.max:3==o.distr?1==o.dir?o.min:o.max:0}function kl(e,t,l,n,i,s){return bl(e,t,((e,t,o,r,u,a,f,c,h,p,d)=>{let m=e.pxRound;const g=0==r.ori?El:Pl;let x,w;1==r.dir*(0==r.ori?1:-1)?(x=l,w=n):(x=n,w=l);let b=m(a(t[x],r,p,c)),_=m(f(o[x],u,d,h)),v=m(a(t[w],r,p,c)),k=m(f(1==s?u.max:u.min,u,d,h)),y=new Path2D(i);return g(y,v,k),g(y,b,k),g(y,b,_),y}))}function yl(e,t,l,n,i,s){let o=null;if(e.length>0){o=new Path2D;const r=0==t?Al:Cl;let u=l;for(let t=0;e.length>t;t++){let l=e[t];if(l[1]>l[0]){let e=l[0]-u;e>0&&r(o,u,n,e,n+s),u=l[1]}}let a=l+i-u,f=10;a>0&&r(o,u,n-f/2,a,n+s+f)}return o}function Ml(e,t,l,n,i,s,o){let r=[],u=e.length;for(let a=1==i?l:n;a>=l&&n>=a;a+=i)if(null===t[a]){let f=a,c=a;if(1==i)for(;++a<=n&&null===t[a];)c=a;else for(;--a>=l&&null===t[a];)c=a;let h=s(e[f]),p=c==f?h:s(e[c]),d=f-i;h=o>0||0>d||d>=u?h:s(e[d]);let m=c+i;p=0>o||0>m||m>=u?p:s(e[m]),h>p||r.push([h,p])}return r}function Tl(e){return 0==e?H:1==e?v:t=>U(t,e)}function Sl(e){let t=0==e?zl:Dl,l=0==e?(e,t,l,n,i,s)=>{e.arcTo(t,l,n,i,s)}:(e,t,l,n,i,s)=>{e.arcTo(l,t,i,n,s)},n=0==e?(e,t,l,n,i)=>{e.rect(t,l,n,i)}:(e,t,l,n,i)=>{e.rect(l,t,i,n)};return(e,i,s,o,r,u=0,a=0)=>{0==u&&0==a?n(e,i,s,o,r):(u=y(u,o/2,r/2),a=y(a,o/2,r/2),t(e,i+u,s),l(e,i+o,s,i+o,s+r,u),l(e,i+o,s+r,i,s+r,a),l(e,i,s+r,i,s,a),l(e,i,s,i+o,s,u),e.closePath())}}const zl=(e,t,l)=>{e.moveTo(t,l)},Dl=(e,t,l)=>{e.moveTo(l,t)},El=(e,t,l)=>{e.lineTo(t,l)},Pl=(e,t,l)=>{e.lineTo(l,t)},Al=Sl(0),Cl=Sl(1),Wl=(e,t,l,n,i,s)=>{e.arc(t,l,n,i,s)},Yl=(e,t,l,n,i,s)=>{e.arc(l,t,n,i,s)},Hl=(e,t,l,n,i,s,o)=>{e.bezierCurveTo(t,l,n,i,s,o)},Rl=(e,t,l,n,i,s,o)=>{e.bezierCurveTo(l,t,i,n,o,s)};function Fl(){return(e,t,l,n,i)=>{let{pxRatio:s}=e;return bl(e,t,((t,o,r,u,a,f,c,h,p,d,m)=>{let g,x,{pxRound:b,points:_}=t;0==u.ori?(g=zl,x=Wl):(g=Dl,x=Yl);const v=V(_.width*s,3);let k=(_.size-_.width)/2*s,y=V(2*k,3),M=new Path2D,T=new Path2D,{left:S,top:z,width:D,height:E}=e.bbox;Al(T,S-y,z-y,D+2*y,E+2*y);const P=e=>{if(null!=r[e]){let t=b(f(o[e],u,d,h)),l=b(c(r[e],a,m,p));g(M,t+k,l),x(M,t,l,k,0,2*w)}};if(i)i.forEach(P);else for(let e=l;n>=e;e++)P(e);return{stroke:v>0?M:null,fill:M,clip:T,flags:3}}))}}function Gl(e){return(t,l,n,i,s,o)=>{n!=i&&(s!=n&&o!=n&&e(t,l,n),s!=i&&o!=i&&e(t,l,i),e(t,l,o))}}const Il=Gl(El),Ol=Gl(Pl);function Ll(e){return(t,l,n,s)=>bl(t,l,((o,r,u,a,f,c,h,p,d,m,g)=>{[n,s]=i(u,n,s);let x,w,b=o.pxRound,_=e?.alignGaps??o.alignGaps??0,v=e=>b(c(e,a,m,p)),k=e=>b(h(e,f,g,d));0==a.ori?(x=El,w=Il):(x=Pl,w=Ol);const y=a.dir*(0==a.ori?1:-1),M={stroke:new Path2D,fill:null,clip:null,band:null,gaps:null,flags:1},T=M.stroke;let S=!1;if(s-n<4*m)for(let e=1==y?n:s;e>=n&&s>=e;e+=y){let t=u[e];null===t?S=!0:null!=t&&x(T,v(r[e]),k(t))}else{let e,l,i,o=e=>t.posToVal(e,a.key,!0),f=null,c=null,h=v(r[1==y?n:s]),p=v(r[n]),d=v(r[s]),m=o(1==y?p+1:d-1);for(let t=1==y?n:s;t>=n&&s>=t;t+=y){let n=r[t],i=(1==y?m>n:n>m)?h:v(n),s=u[t];i==h?null!=s?(l=s,null==f?(x(T,i,k(l)),e=f=c=l):f>l?f=l:l>c&&(c=l)):null===s&&(S=!0):(null!=f&&w(T,h,k(f),k(c),k(e),k(l)),null!=s?(l=s,x(T,i,k(l)),f=c=e=l):(f=c=null,null===s&&(S=!0)),h=i,m=o(h+y))}null!=f&&f!=c&&i!=h&&w(T,h,k(f),k(c),k(e),k(l))}let[z,D]=_l(t,l);if(null!=o.fill||0!=z){let e=M.fill=new Path2D(T),i=k(o.fillTo(t,l,o.min,o.max,z)),u=v(r[n]),a=v(r[s]);-1==y&&([a,u]=[u,a]),x(e,a,i),x(e,u,i)}if(!o.spanGaps){let e=[];S&&e.push(...Ml(r,u,n,s,y,v,_)),M.gaps=e=o.gaps(t,l,n,s,e),M.clip=yl(e,a.ori,p,d,m,g)}return 0!=D&&(M.band=2==D?[kl(t,l,n,s,T,-1),kl(t,l,n,s,T,1)]:kl(t,l,n,s,T,D)),M}))}function Ul(e,t,l,n,i,s,o=P){if(e.length>1){let r=null;for(let u=0,a=1/0;e.length>u;u++)if(void 0!==t[u]){if(null!=r){let t=b(e[u]-e[r]);a>t&&(a=t,o=b(l(e[u],n,i,s)-l(e[r],n,i,s)))}r=u}}return o}function Nl(e,t,l,n,i){const s=e.length;if(2>s)return null;const o=new Path2D;if(l(o,e[0],t[0]),2==s)n(o,e[1],t[1]);else{let l=Array(s),n=Array(s-1),r=Array(s-1),u=Array(s-1);for(let l=0;s-1>l;l++)r[l]=t[l+1]-t[l],u[l]=e[l+1]-e[l],n[l]=r[l]/u[l];l[0]=n[0];for(let e=1;s-1>e;e++)0===n[e]||0===n[e-1]||n[e-1]>0!=n[e]>0?l[e]=0:(l[e]=3*(u[e-1]+u[e])/((2*u[e]+u[e-1])/n[e-1]+(u[e]+2*u[e-1])/n[e]),isFinite(l[e])||(l[e]=0));l[s-1]=n[s-2];for(let n=0;s-1>n;n++)i(o,e[n]+u[n]/3,t[n]+l[n]*u[n]/3,e[n+1]-u[n]/3,t[n+1]-l[n+1]*u[n]/3,e[n+1],t[n+1])}return o}const jl=new Set;function Vl(){for(let e of jl)e.syncRect(!0)}De&&(Be("resize",Pe,Vl),Be("scroll",Pe,Vl,!0),Be(Me,Pe,(()=>{on.pxRatio=Ae})));const Bl=Ll(),Zl=Fl();function $l(e,t,l,n){return(n?[e[0],e[1]].concat(e.slice(2)):[e[0]].concat(e.slice(1))).map(((e,n)=>Jl(e,n,t,l)))}function Jl(e,t,l,n){return oe({},0==t?l:n,e)}function ql(e,t,l){return null==t?K:[t,l]}const Kl=ql;function Xl(e,t,l){return null==t?K:h(t,l,u,!0)}function Ql(e,t,l,n){return null==t?K:o(t,l,e.scales[n].log,!0)}const en=Ql;function tn(e,t,l,n){return null==t?K:r(t,l,e.scales[n].log,!0)}const ln=tn;function nn(t,l,n,i,s){let o=M(A(t),A(l)),r=l-t,u=e(s/i*r,n);do{let e=n[u],t=i*e/r;if(t>=s&&17>=o+(5>e?B.get(e):0))return[e,t]}while(++u(l=v((n=+i)*t))+"px")),l,n]}function on(t,f,c){let d=t.pxRatio??Ae;function m(e){d=g.pxRatio=e??Ae,ye.forEach((e=>function(e,t){e.show&&[e.font,e.labelFont].forEach((e=>{let l=V(e[2]*t,1);e[0]=e[0].replace(/[0-9.]+px/,l+"px"),e[1]=l}))}(e,d))),kl(g.width,g.height,!0)}const g={mode:p(t.mode,1),pxRatio:d,setPxRatio:m};g.setPxRatio=m;const _=g.mode;function S(e,t,l,n){let i=t.valToPct(e);return n+l*(-1==t.dir?1-i:i)}function D(e,t,l,n){let i=t.valToPct(e);return n+l*(-1==t.dir?i:1-i)}function A(e,t,l,n){return 0==t.ori?S(e,t,l,n):D(e,t,l,n)}g.valToPosH=S,g.valToPosV=D;let H=!1;g.status=0;const O=g.root=Fe("uplot");null!=t.id&&(O.id=t.id),We(O,t.class),t.title&&(Fe("u-title",O).textContent=t.title);const L=Re("canvas"),N=g.ctx=L.getContext("2d"),j=Fe("u-wrap",O);Be("click",j,(e=>{e.target===Q&&(Nn!=In||jn!=On)&&Qn.click(g,e)}),!0);const $=g.under=Fe("u-under",j);j.appendChild(L);const Q=g.over=Fe("u-over",j),ne=+p((t=se(t)).pxAlign,1),ie=Tl(ne);(t.plugins||[]).forEach((e=>{e.opts&&(t=e.opts(g,t)||t)}));const re=t.ms||.001,me=g.series=1==_?$l(t.series||[],qt,pl,!1):function(e,t){return e.map(((e,l)=>0==l?{}:oe({},t,e)))}(t.series||[null],hl),ye=g.axes=$l(t.axes||[],Jt,al,!0),De=g.scales={},Ce=g.bands=t.bands||[];Ce.forEach((e=>{e.fill=Y(e.fill||null),e.dir=p(e.dir,-1)}));const Ge=2==_?me[1].facets[0].scale:me[0].scale,Oe={axes:function(){for(let e=0;ye.length>e;e++){let t=ye[e];if(!t.show||!t._show)continue;let l,n,i=t.side,s=i%2,o=t.stroke(g,e),r=0==i||3==i?-1:1,[u,a]=t._found;if(null!=t.label){let f=v((t._lpos+t.labelGap*r)*d);_n(t.labelFont[0],o,"center",2==i?ce:he),N.save(),1==s?(l=n=0,N.translate(f,v(ll+il/2)),N.rotate((3==i?-w:w)/2)):(l=v(tl+nl/2),n=f);let c=W(t.label)?t.label(g,e,u,a):t.label;N.fillText(c,l,n),N.restore()}if(0==a)continue;let f=De[t.scale],c=0==s?nl:il,h=0==s?tl:ll,p=t._splits,m=2==f.distr?p.map((e=>mn[e])):p,x=2==f.distr?mn[p[1]]-mn[p[0]]:u,b=t.ticks,_=t.border,k=b.show?b.size:0,y=v(k*d),M=v((2==t.alignTo?t._size-k-t.gap:t.gap)*d),T=t._rotate*-w/180,S=ie(t._pos*d),z=S+(y+M)*r;n=0==s?z:0,l=1==s?z:0,_n(t.font[0],o,1==t.align?pe:2==t.align?de:T>0?pe:0>T?de:0==s?"center":3==i?de:pe,T||1==s?"middle":2==i?ce:he);let D=t.font[1]*t.lineGap,E=p.map((e=>ie(A(e,f,c,h)))),P=t._values;for(let e=0;P.length>e;e++){let t=P[e];if(null!=t){0==s?l=E[e]:n=E[e],t=""+t;let i=-1==t.indexOf("\n")?[t]:t.split(/\n/gm);for(let e=0;i.length>e;e++){let t=i[e];T?(N.save(),N.translate(l,n+e*D),N.rotate(T),N.fillText(t,0,0),N.restore()):N.fillText(t,l,n+e*D)}}}b.show&&En(E,b.filter(g,m,e,a,x),s,i,S,y,V(b.width*d,3),b.stroke(g,e),b.dash,b.cap);let C=t.grid;C.show&&En(E,C.filter(g,m,e,a,x),s,0==s?2:1,0==s?ll:tl,0==s?il:nl,V(C.width*d,3),C.stroke(g,e),C.dash,C.cap),_.show&&En([S],[1],0==s?1:0,0==s?1:2,1==s?ll:tl,1==s?il:nl,V(_.width*d,3),_.stroke(g,e),_.dash,_.cap)}Hi("drawAxes")},series:function(){if(Ol>0){let e=me.some((e=>e._focus))&&dn!=Dl.alpha;e&&(N.globalAlpha=dn=Dl.alpha),me.forEach(((e,t)=>{if(t>0&&e.show&&(yn(t,!1),yn(t,!0),null==e._paths)){let l=dn;dn!=e.alpha&&(N.globalAlpha=dn=e.alpha);let n=2==_?[0,f[t][0].length-1]:function(e){let t=C(Ll-1,0,Ol-1),l=C(Ul+1,0,Ol-1);for(;null==e[t]&&t>0;)t--;for(;null==e[l]&&Ol-1>l;)l++;return[t,l]}(f[t]);e._paths=e.paths(g,t,n[0],n[1]),dn!=l&&(N.globalAlpha=dn=l)}})),me.forEach(((e,t)=>{if(t>0&&e.show){let l=dn;dn!=e.alpha&&(N.globalAlpha=dn=e.alpha),null!=e._paths&&Mn(t,!1);{let l=null!=e._paths?e._paths.gaps:null,n=e.points.show(g,t,Ll,Ul,l),i=e.points.filter(g,t,n,l);(n||i)&&(e.points._paths=e.points.paths(g,t,Ll,Ul,i),Mn(t,!0))}dn!=l&&(N.globalAlpha=dn=l),Hi("drawSeries",t)}})),e&&(N.globalAlpha=dn=1)}}},Ue=(t.drawOrder||["axes","series"]).map((e=>Oe[e]));function je(e){const t=3==e.distr?t=>z(t>0?t:e.clamp(g,t,e.min,e.max,e.key)):4==e.distr?t=>E(t,e.asinh):100==e.distr?t=>e.fwd(t):e=>e;return l=>{let n=t(l),{_min:i,_max:s}=e;return(n-i)/(s-i)}}function Ve(e){let l=De[e];if(null==l){let n=(t.scales||J)[e]||J;if(null!=n.from){Ve(n.from);let t=oe({},De[n.from],n,{key:e});t.valToPct=je(t),De[e]=t}else{l=De[e]=oe({},e==Ge?ml:gl,n),l.key=e;let t=l.time,i=l.range,s=X(i);if((e!=Ge||2==_&&!t)&&(!s||null!=i[0]&&null!=i[1]||(i={min:null==i[0]?a:{mode:1,hard:i[0],soft:i[0]},max:null==i[1]?a:{mode:1,hard:i[1],soft:i[1]}},s=!1),!s&&te(i))){let e=i;i=(t,l,n)=>null==l?K:h(l,n,e)}l.range=Y(i||(t?Kl:e==Ge?3==l.distr?en:4==l.distr?ln:ql:3==l.distr?Ql:4==l.distr?tn:Xl)),l.auto=Y(!s&&l.auto),l.clamp=Y(l.clamp||dl),l._min=l._max=null,l.valToPct=je(l)}}}Ve("x"),Ve("y"),1==_&&me.forEach((e=>{Ve(e.scale)})),ye.forEach((e=>{Ve(e.scale)}));for(let e in t.scales)Ve(e);const $e=De[Ge],Je=$e.distr;let qe,Ke;0==$e.ori?(We(O,"u-hz"),qe=S,Ke=D):(We(O,"u-vt"),qe=D,Ke=S);const Xe={};for(let e in De){let t=De[e];null==t.min&&null==t.max||(Xe[e]={min:t.min,max:t.max},t.min=t.max=null)}const Qe=t.tzDate||(e=>new Date(v(e/re))),et=t.fmtDate||lt,tt=1==re?Pt(Qe):Wt(Qe),nt=Ht(Qe,Yt(1==re?Et:Ct,et)),it=Ft(Qe,Rt("{YYYY}-{MM}-{DD} {h}:{mm}{aa}",et)),st=[],ot=g.legend=oe({},Gt,t.legend),rt=g.cursor=oe({},Ut,{drag:{y:2==_}},t.cursor),ut=ot.show,at=rt.show,ft=ot.markers;let ct,ht,pt;ot.idxs=st,ft.width=Y(ft.width),ft.dash=Y(ft.dash),ft.stroke=Y(ft.stroke),ft.fill=Y(ft.fill);let dt,xt=[],wt=[],bt=!1,_t={};if(ot.live){const e=me[1]?me[1].values:null;bt=null!=e,dt=bt?e(g,1,0):{_:0};for(let e in dt)_t[e]=Te}if(ut)if(ct=Re("table","u-legend",O),pt=Re("tbody",null,ct),ot.mount(g,ct),bt){ht=Re("thead",null,ct,pt);let e=Re("tr",null,ht);for(var vt in Re("th",null,e),dt)Re("th",ze,e).textContent=vt}else We(ct,"u-inline"),ot.live&&We(ct,"u-live");const kt={show:!0},yt={show:!1},Mt=new Map;function Tt(e,t,l,n=!0){const i=Mt.get(t)||{},s=rt.bind[e](g,t,l,n);s&&(Be(e,t,i[e]=s),Mt.set(t,i))}function St(e,t){const l=Mt.get(t)||{};for(let n in l)null!=e&&n!=e||(Ze(n,t,l[n]),delete l[n]);null==e&&Mt.delete(t)}let zt=0,It=0,Ot=0,Lt=0,Nt=0,jt=0,Vt=Nt,Bt=jt,Zt=Ot,$t=Lt,tl=0,ll=0,nl=0,il=0;g.bbox={};let sl=!1,fl=!1,cl=!1,xl=!1,bl=!1,_l=!1;function kl(e,t,l){(l||e!=g.width||t!=g.height)&&yl(e,t),Cn(!1),cl=!0,fl=!0,Jn()}function yl(e,t){g.width=zt=Ot=e,g.height=It=Lt=t,Nt=jt=0,function(){let e=!1,t=!1,l=!1,n=!1;ye.forEach((i=>{if(i.show&&i._show){let{side:s,_size:o}=i,r=o+(null!=i.label?i.labelSize:0);r>0&&(s%2?(Ot-=r,3==s?(Nt+=r,n=!0):l=!0):(Lt-=r,0==s?(jt+=r,e=!0):t=!0))}})),Rl[0]=e,Rl[1]=l,Rl[2]=t,Rl[3]=n,Ot-=Il[1]+Il[3],Nt+=Il[3],Lt-=Il[2]+Il[0],jt+=Il[0]}(),function(){let e=Nt+Ot,t=jt+Lt,l=Nt,n=jt;function i(i,s){switch(i){case 1:return e+=s,e-s;case 2:return t+=s,t-s;case 3:return l-=s,l+s;case 0:return n-=s,n+s}}ye.forEach((e=>{if(e.show&&e._show){let t=e.side;e._pos=i(t,e._size),null!=e.label&&(e._lpos=i(t,e.labelSize))}}))}();let l=g.bbox;tl=l.left=U(Nt*d,.5),ll=l.top=U(jt*d,.5),nl=l.width=U(Ot*d,.5),il=l.height=U(Lt*d,.5)}const Ml=3;if(g.setSize=function({width:e,height:t}){kl(e,t)},null==rt.dataIdx){let e=rt.hover,t=e.skip=new Set(e.skip??[]);t.add(void 0);let l=e.prox=Y(e.prox),n=e.bias??=0;rt.dataIdx=(e,i,s,o)=>{if(0==i)return s;let r=s,u=l(e,i,s,o)??P,a=u>=0&&P>u,c=0==$e.ori?Ot:Lt,h=rt.left,p=f[0],d=f[i];if(t.has(d[s])){r=null;let e,l=null,i=null;if(0==n||-1==n)for(e=s;null==l&&--e>=Ll;)t.has(d[e])||(l=e);if(0==n||1==n)for(e=s;null==i&&++e<=Ul;)t.has(d[e])||(i=e);if(null!=l||null!=i)if(a){let e=h-(null==l?-1/0:qe(p[l],$e,c,0)),t=(null==i?1/0:qe(p[i],$e,c,0))-h;e>t?t>u||(r=i):e>u||(r=l)}else r=null==i?l:null==l||s-l>i-s?i:l}else a&&b(h-qe(p[s],$e,c,0))>u&&(r=null);return r}}const Sl=e=>{rt.event=e};rt.idxs=st,rt._lock=!1;let zl=rt.points;zl.show=Y(zl.show),zl.size=Y(zl.size),zl.stroke=Y(zl.stroke),zl.width=Y(zl.width),zl.fill=Y(zl.fill);const Dl=g.focus=oe({},t.focus||{alpha:.3},rt.focus),El=Dl.prox>=0,Pl=El&&zl.one;let Al=[],Cl=[],Wl=[];function Yl(e,t){let l=zl.show(g,t);if(l instanceof HTMLElement)return We(l,"u-cursor-pt"),We(l,e.class),Ie(l,-10,-10,Ot,Lt),Q.insertBefore(l,Al[t]),l}function Hl(e,t){if(1==_||t>0){let t=1==_&&De[e.scale].time,l=e.value;e.value=t?ee(l)?Ft(Qe,Rt(l,et)):l||it:l||ul,e.label=e.label||(t?"Time":"Value")}if(Pl||t>0){e.width=null==e.width?1:e.width,e.paths=e.paths||Bl||F,e.fillTo=Y(e.fillTo||vl),e.pxAlign=+p(e.pxAlign,ne),e.pxRound=Tl(e.pxAlign),e.stroke=Y(e.stroke||null),e.fill=Y(e.fill||null),e._stroke=e._fill=e._paths=e._focus=null;let t=function(e){return V(1*(3+2*(e||1)),3)}(M(1,e.width)),l=e.points=oe({},{size:t,width:M(1,.2*t),stroke:e.stroke,space:2*t,paths:Zl,_stroke:null,_fill:null},e.points);l.show=Y(l.show),l.filter=Y(l.filter),l.fill=Y(l.fill),l.stroke=Y(l.stroke),l.paths=Y(l.paths),l.pxAlign=e.pxAlign}if(ut){let l=function(e,t){if(0==t&&(bt||!ot.live||2==_))return K;let l=[],n=Re("tr","u-series",pt,pt.childNodes[t]);We(n,e.class),e.show||We(n,Se);let i=Re("th",null,n);if(ft.show){let e=Fe("u-marker",i);if(t>0){let l=ft.width(g,t);l&&(e.style.border=l+"px "+ft.dash(g,t)+" "+ft.stroke(g,t)),e.style.background=ft.fill(g,t)}}let s=Fe(ze,i);for(var o in e.label instanceof HTMLElement?s.appendChild(e.label):s.textContent=e.label,t>0&&(ft.show||(s.style.color=e.width>0?ft.stroke(g,t):ft.fill(g,t)),Tt("click",i,(t=>{if(rt._lock)return;Sl(t);let l=me.indexOf(e);if((t.ctrlKey||t.metaKey)!=ot.isolate){let e=me.some(((e,t)=>t>0&&t!=l&&e.show));me.forEach(((t,n)=>{n>0&&oi(n,e?n==l?kt:yt:kt,!0,Fi.setSeries)}))}else oi(l,{show:!e.show},!0,Fi.setSeries)}),!1),El&&Tt(_e,i,(t=>{rt._lock||(Sl(t),oi(me.indexOf(e),fi,!0,Fi.setSeries))}),!1)),dt){let e=Re("td","u-value",n);e.textContent="--",l.push(e)}return[n,l]}(e,t);xt.splice(t,0,l[0]),wt.splice(t,0,l[1]),ot.values.push(null)}if(at){st.splice(t,0,null);let l=null;Pl?0==t&&(l=Yl(e,t)):t>0&&(l=Yl(e,t)),Al.splice(t,0,l),Cl.splice(t,0,0),Wl.splice(t,0,0)}Hi("addSeries",t)}g.addSeries=function(e,t){t=null==t?me.length:t,e=1==_?Jl(e,t,qt,pl):Jl(e,t,{},hl),me.splice(t,0,e),Hl(me[t],t)},g.delSeries=function(e){if(me.splice(e,1),ut){ot.values.splice(e,1),wt.splice(e,1);let t=xt.splice(e,1)[0];St(null,t.firstChild),t.remove()}at&&(st.splice(e,1),Al.splice(e,1)[0].remove(),Cl.splice(e,1),Wl.splice(e,1)),Hi("delSeries",e)};const Rl=[!1,!1,!1,!1];function Fl(e,t,l){let[n,i,s,o]=l,r=t%2,u=0;return 0==r&&(o||i)&&(u=0==t&&!n||2==t&&!s?v(Jt.size/3):0),1==r&&(n||s)&&(u=1==t&&!i||3==t&&!o?v(al.size/2):0),u}const Gl=g.padding=(t.padding||[Fl,Fl,Fl,Fl]).map((e=>Y(p(e,Fl)))),Il=g._padding=Gl.map(((e,t)=>e(g,t,Rl,0)));let Ol,Ll=null,Ul=null;const Nl=1==_?me[0].idxs:null;let Vl,on,rn,un,an,fn,cn,hn,pn,dn,mn=null,gn=!1;function xn(e,t){if(g.data=g._data=f=null==e?[]:e,2==_){Ol=0;for(let e=1;me.length>e;e++)Ol+=f[e][0].length}else{0==f.length&&(g.data=g._data=f=[[]]),mn=f[0],Ol=mn.length;let e=f;if(2==Je){e=f.slice();let t=e[0]=Array(Ol);for(let e=0;Ol>e;e++)t[e]=e}g._data=f=e}if(Cn(!0),Hi("setData"),2==Je&&(cl=!0),!1!==t){let e=$e;e.auto(g,gn)?wn():si(Ge,e.min,e.max),xl=xl||rt.left>=0,_l=!0,Jn()}}function wn(){let e,t;gn=!0,1==_&&(Ol>0?(Ll=Nl[0]=0,Ul=Nl[1]=Ol-1,e=f[0][Ll],t=f[0][Ul],2==Je?(e=Ll,t=Ul):e==t&&(3==Je?[e,t]=o(e,e,$e.log,!1):4==Je?[e,t]=r(e,e,$e.log,!1):$e.time?t=e+v(86400/re):[e,t]=h(e,t,u,!0))):(Ll=Nl[0]=e=null,Ul=Nl[1]=t=null)),si(Ge,e,t)}function bn(e,t,l,n,i,s){e??=ge,l??=q,n??="butt",i??=ge,s??="round",e!=Vl&&(N.strokeStyle=Vl=e),i!=on&&(N.fillStyle=on=i),t!=rn&&(N.lineWidth=rn=t),s!=an&&(N.lineJoin=an=s),n!=fn&&(N.lineCap=fn=n),l!=un&&N.setLineDash(un=l)}function _n(e,t,l,n){t!=on&&(N.fillStyle=on=t),e!=cn&&(N.font=cn=e),l!=hn&&(N.textAlign=hn=l),n!=pn&&(N.textBaseline=pn=n)}function vn(e,t,o,r,u=0){if(r.length>0&&e.auto(g,gn)&&(null==t||null==t.min)){let t=p(Ll,0),a=p(Ul,r.length-1),f=null==o.min?function(e,t,o,r=0,u=!1){let a=u?s:i,f=u?n:l;[t,o]=a(e,t,o);let c=e[t],h=e[t];if(t>-1)if(1==r)c=e[t],h=e[o];else if(-1==r)c=e[o],h=e[t];else for(let l=t;o>=l;l++){let t=e[l];f(t)&&(c>t?c=t:t>h&&(h=t))}return[c??P,h??-P]}(r,t,a,u,3==e.distr):[o.min,o.max];e.min=y(e.min,o.min=f[0]),e.max=M(e.max,o.max=f[1])}}g.setData=xn;const kn={min:null,max:null};function yn(e,t){let l=t?me[e].points:me[e];l._stroke=l.stroke(g,e),l._fill=l.fill(g,e)}function Mn(e,t){let l=t?me[e].points:me[e],{stroke:n,fill:i,clip:s,flags:o,_stroke:r=l._stroke,_fill:u=l._fill,_width:a=l.width}=l._paths;a=V(a*d,3);let c=null,h=a%2/2;t&&null==u&&(u=a>0?"#fff":r);let m=1==l.pxAlign&&h>0;if(m&&N.translate(h,h),!t){let e=tl-a/2,t=ll-a/2,l=nl+a,n=il+a;c=new Path2D,c.rect(e,t,l,n)}t?Sn(r,a,l.dash,l.cap,u,n,i,o,s):function(e,t,l,n,i,s,o,r,u,a,c){let h=!1;0!=u&&Ce.forEach(((d,m)=>{if(d.series[0]==e){let e,x=me[d.series[1]],w=f[d.series[1]],b=(x._paths||J).band;X(b)&&(b=1==d.dir?b[0]:b[1]);let _=null;x.show&&b&&function(e,t,l){for(t=p(t,0),l=p(l,e.length-1);l>=t;){if(null!=e[t])return!0;t++}return!1}(w,Ll,Ul)?(_=d.fill(g,m)||s,e=x._paths.clip):b=null,Sn(t,l,n,i,_,o,r,u,a,c,e,b),h=!0}})),h||Sn(t,l,n,i,s,o,r,u,a,c)}(e,r,a,l.dash,l.cap,u,n,i,o,c,s),m&&N.translate(-h,-h)}const Tn=3;function Sn(e,t,l,n,i,s,o,r,u,a,f,c){bn(e,t,l,n,i),(u||a||c)&&(N.save(),u&&N.clip(u),a&&N.clip(a)),c?(r&Tn)==Tn?(N.clip(c),f&&N.clip(f),Dn(i,o),zn(e,s,t)):2&r?(Dn(i,o),N.clip(c),zn(e,s,t)):1&r&&(N.save(),N.clip(c),f&&N.clip(f),Dn(i,o),N.restore(),zn(e,s,t)):(Dn(i,o),zn(e,s,t)),(u||a||c)&&N.restore()}function zn(e,t,l){l>0&&(t instanceof Map?t.forEach(((e,t)=>{N.strokeStyle=Vl=t,N.stroke(e)})):null!=t&&e&&N.stroke(t))}function Dn(e,t){t instanceof Map?t.forEach(((e,t)=>{N.fillStyle=on=t,N.fill(e)})):null!=t&&e&&N.fill(t)}function En(e,t,l,n,i,s,o,r,u,a){let f=o%2/2;1==ne&&N.translate(f,f),bn(r,o,u,a,r),N.beginPath();let c,h,p,d,m=i+(0==n||3==n?-s:s);0==l?(h=i,d=m):(c=i,p=m);for(let n=0;e.length>n;n++)null!=t[n]&&(0==l?c=p=e[n]:h=d=e[n],N.moveTo(c,h),N.lineTo(p,d));N.stroke(),1==ne&&N.translate(-f,-f)}function Pn(e){let t=!0;return ye.forEach(((l,n)=>{if(!l.show)return;let i=De[l.scale];if(null==i.min)return void(l._show&&(t=!1,l._show=!1,Cn(!1)));l._show||(t=!1,l._show=!0,Cn(!1));let s=l.side,o=s%2,{min:r,max:u}=i,[a,f]=function(e,t,l,n){let i,s=ye[e];if(n>0){let o=s._space=s.space(g,e,t,l,n);i=nn(t,l,s._incrs=s.incrs(g,e,t,l,n,o),n,o)}else i=[0,0];return s._found=i}(n,r,u,0==o?Ot:Lt);if(0==f)return;let c=l._splits=l.splits(g,n,r,u,a,f,2==i.distr),h=2==i.distr?c.map((e=>mn[e])):c,p=2==i.distr?mn[c[1]]-mn[c[0]]:a,d=l._values=l.values(g,l.filter(g,h,n,f,p),n,f,p);l._rotate=2==s?l.rotate(g,d,n,f):0;let m=l._size;l._size=k(l.size(g,d,n,e)),null!=m&&l._size!=m&&(t=!1)})),t}function An(e){let t=!0;return Gl.forEach(((l,n)=>{let i=l(g,n,Rl,e);i!=Il[n]&&(t=!1),Il[n]=i})),t}function Cn(e){me.forEach(((t,l)=>{l>0&&(t._paths=null,e&&(1==_?(t.min=null,t.max=null):t.facets.forEach((e=>{e.min=null,e.max=null}))))}))}let Wn,Yn,Hn,Rn,Fn,Gn,In,On,Ln,Un,Nn,jn,Vn=!1,Bn=!1,Zn=[];function $n(){Bn=!1;for(let e=0;Zn.length>e;e++)Hi(...Zn[e]);Zn.length=0}function Jn(){Vn||(ue(qn),Vn=!0)}function qn(){if(sl&&(function(){for(let e in De){let t=De[e];null==Xe[e]&&(null==t.min||null!=Xe[Ge]&&t.auto(g,gn))&&(Xe[e]=kn)}for(let e in De){let t=De[e];null==Xe[e]&&null!=t.from&&null!=Xe[t.from]&&(Xe[e]=kn)}null!=Xe[Ge]&&Cn(!0);let t={};for(let e in Xe){let l=Xe[e];if(null!=l){let n=t[e]=se(De[e],le);if(null!=l.min)oe(n,l);else if(e!=Ge||2==_)if(0==Ol&&null==n.from){let t=n.range(g,null,null,e);n.min=t[0],n.max=t[1]}else n.min=P,n.max=-P}}if(Ol>0){me.forEach(((l,n)=>{if(1==_){let i=l.scale,s=Xe[i];if(null==s)return;let o=t[i];if(0==n){let t=o.range(g,o.min,o.max,i);o.min=t[0],o.max=t[1],Ll=e(o.min,f[0]),Ul=e(o.max,f[0]),Ul-Ll>1&&(o.min>f[0][Ll]&&Ll++,f[0][Ul]>o.max&&Ul--),l.min=mn[Ll],l.max=mn[Ul]}else l.show&&l.auto&&vn(o,s,l,f[n],l.sorted);l.idxs[0]=Ll,l.idxs[1]=Ul}else if(n>0&&l.show&&l.auto){let[e,i]=l.facets,s=e.scale,o=i.scale,[r,u]=f[n],a=t[s],c=t[o];null!=a&&vn(a,Xe[s],e,r,e.sorted),null!=c&&vn(c,Xe[o],i,u,i.sorted),l.min=i.min,l.max=i.max}}));for(let e in t){let l=t[e],n=Xe[e];if(null==l.from&&(null==n||null==n.min)){let t=l.range(g,l.min==P?null:l.min,l.max==-P?null:l.max,e);l.min=t[0],l.max=t[1]}}}for(let e in t){let l=t[e];if(null!=l.from){let n=t[l.from];if(null==n.min)l.min=l.max=null;else{let t=l.range(g,n.min,n.max,e);l.min=t[0],l.max=t[1]}}}let l={},n=!1;for(let e in t){let i=t[e],s=De[e];if(s.min!=i.min||s.max!=i.max){s.min=i.min,s.max=i.max;let t=s.distr;s._min=3==t?z(s.min):4==t?E(s.min,s.asinh):100==t?s.fwd(s.min):s.min,s._max=3==t?z(s.max):4==t?E(s.max,s.asinh):100==t?s.fwd(s.max):s.max,l[e]=n=!0}}if(n){me.forEach(((e,t)=>{2==_?t>0&&l.y&&(e._paths=null):l[e.scale]&&(e._paths=null)}));for(let e in l)cl=!0,Hi("setScale",e);at&&rt.left>=0&&(xl=_l=!0)}for(let e in Xe)Xe[e]=null}(),sl=!1),cl&&(function(){let e=!1,t=0;for(;!e;){t++;let l=Pn(t),n=An(t);e=t==Ml||l&&n,e||(yl(g.width,g.height),fl=!0)}}(),cl=!1),fl){if(He($,pe,Nt),He($,ce,jt),He($,ae,Ot),He($,fe,Lt),He(Q,pe,Nt),He(Q,ce,jt),He(Q,ae,Ot),He(Q,fe,Lt),He(j,ae,zt),He(j,fe,It),L.width=v(zt*d),L.height=v(It*d),ye.forEach((({_el:e,_show:t,_size:l,_pos:n,side:i})=>{if(null!=e)if(t){let t=i%2==1;He(e,t?"left":"top",n-(3===i||0===i?l:0)),He(e,t?"width":"height",l),He(e,t?"top":"left",t?jt:Nt),He(e,t?"height":"width",t?Lt:Ot),Ye(e,Se)}else We(e,Se)})),Vl=on=rn=an=fn=cn=hn=pn=un=null,dn=1,_i(!0),Nt!=Vt||jt!=Bt||Ot!=Zt||Lt!=$t){Cn(!1);let e=Ot/Zt,t=Lt/$t;if(at&&!xl&&rt.left>=0){rt.left*=e,rt.top*=t,Hn&&Ie(Hn,v(rt.left),0,Ot,Lt),Rn&&Ie(Rn,0,v(rt.top),Ot,Lt);for(let l=0;Al.length>l;l++){let n=Al[l];null!=n&&(Cl[l]*=e,Wl[l]*=t,Ie(n,k(Cl[l]),k(Wl[l]),Ot,Lt))}}if(li.show&&!bl&&li.left>=0&&li.width>0){li.left*=e,li.width*=e,li.top*=t,li.height*=t;for(let e in yi)He(ni,e,li[e])}Vt=Nt,Bt=jt,Zt=Ot,$t=Lt}Hi("setSize"),fl=!1}zt>0&&It>0&&(N.clearRect(0,0,L.width,L.height),Hi("drawClear"),Ue.forEach((e=>e())),Hi("draw")),li.show&&bl&&(ii(li),bl=!1),at&&xl&&(wi(null,!0,!1),xl=!1),ot.show&&ot.live&&_l&&(gi(),_l=!1),H||(H=!0,g.status=1,Hi("ready")),gn=!1,Vn=!1}function Kn(t,l){let n=De[t];if(null==n.from){if(0==Ol){let e=n.range(g,l.min,l.max,t);l.min=e[0],l.max=e[1]}if(l.min>l.max){let e=l.min;l.min=l.max,l.max=e}if(Ol>1&&null!=l.min&&null!=l.max&&1e-16>l.max-l.min)return;t==Ge&&2==n.distr&&Ol>0&&(l.min=e(l.min,f[0]),l.max=e(l.max,f[0]),l.min==l.max&&l.max++),Xe[t]=l,sl=!0,Jn()}}g.batch=function(e,t=!1){Vn=!0,Bn=t,e(g),qn(),t&&Zn.length>0&&queueMicrotask($n)},g.clearCache=()=>{me.forEach(((e,t)=>{t>0&&(e._paths=null)}))},g.redraw=(e,t)=>{cl=t||!1,!1!==e?si(Ge,$e.min,$e.max):Jn()},g.setScale=Kn;let Xn=!1;const Qn=rt.drag;let ei=Qn.x,ti=Qn.y;at&&(rt.x&&(Wn=Fe("u-cursor-x",Q)),rt.y&&(Yn=Fe("u-cursor-y",Q)),0==$e.ori?(Hn=Wn,Rn=Yn):(Hn=Yn,Rn=Wn),Nn=rt.left,jn=rt.top);const li=g.select=oe({show:!0,over:!0,left:0,width:0,top:0,height:0},t.select),ni=li.show?Fe("u-select",li.over?Q:$):null;function ii(e,t){if(li.show){for(let t in e)li[t]=e[t],t in yi&&He(ni,t,e[t]);!1!==t&&Hi("setSelect")}}function si(e,t,l){Kn(e,{min:t,max:l})}function oi(e,t,l,n){null!=t.focus&&function(e){if(e!=ai){let t=null==e,l=1!=Dl.alpha;me.forEach(((n,i)=>{if(1==_||i>0){let s=t||0==i||i==e;n._focus=t?null:s,l&&function(e,t){me[e].alpha=t,at&&null!=Al[e]&&(Al[e].style.opacity=t),ut&&xt[e]&&(xt[e].style.opacity=t)}(i,s?1:Dl.alpha)}})),ai=e,l&&Jn()}}(e),null!=t.show&&me.forEach(((l,n)=>{0>=n||e!=n&&null!=e||(l.show=t.show,function(e){if(me[e].show)ut&&Ye(xt[e],Se);else if(ut&&We(xt[e],Se),at){let t=Pl?Al[0]:Al[e];null!=t&&Ie(t,-10,-10,Ot,Lt)}}(n),2==_?(si(l.facets[0].scale,null,null),si(l.facets[1].scale,null,null)):si(l.scale,null,null),Jn())})),!1!==l&&Hi("setSeries",e,t),n&&Oi("setSeries",g,e,t)}let ri,ui,ai;g.setSelect=ii,g.setSeries=oi,g.addBand=function(e,t){e.fill=Y(e.fill||null),e.dir=p(e.dir,-1),Ce.splice(t=null==t?Ce.length:t,0,e)},g.setBand=function(e,t){oe(Ce[e],t)},g.delBand=function(e){null==e?Ce.length=0:Ce.splice(e,1)};const fi={focus:!0};function ci(e,t,l){let n=De[t];l&&(e=e/d-(1==n.ori?jt:Nt));let i=Ot;1==n.ori&&(i=Lt,e=i-e),-1==n.dir&&(e=i-e);let s=n._min,o=s+e/i*(n._max-s),r=n.distr;return 3==r?T(10,o):4==r?((e,t=1)=>x.sinh(e)*t)(o,n.asinh):100==r?n.bwd(o):o}function hi(e,t){He(ni,pe,li.left=e),He(ni,ae,li.width=t)}function pi(e,t){He(ni,ce,li.top=e),He(ni,fe,li.height=t)}ut&&El&&Tt(ve,ct,(e=>{rt._lock||(Sl(e),null!=ai&&oi(null,fi,!0,Fi.setSeries))})),g.valToIdx=t=>e(t,f[0]),g.posToIdx=function(t,l){return e(ci(t,Ge,l),f[0],Ll,Ul)},g.posToVal=ci,g.valToPos=(e,t,l)=>0==De[t].ori?S(e,De[t],l?nl:Ot,l?tl:0):D(e,De[t],l?il:Lt,l?ll:0),g.setCursor=(e,t,l)=>{Nn=e.left,jn=e.top,wi(null,t,l)};let di=0==$e.ori?hi:pi,mi=1==$e.ori?hi:pi;function gi(e,t){if(null!=e&&(e.idxs?e.idxs.forEach(((e,t)=>{st[t]=e})):(e=>void 0===e)(e.idx)||st.fill(e.idx),ot.idx=st[0]),ut&&ot.live){for(let e=0;me.length>e;e++)(e>0||1==_&&!bt)&&xi(e,st[e]);!function(){if(ut&&ot.live)for(let e=2==_?1:0;me.length>e;e++){if(0==e&&bt)continue;let t=ot.values[e],l=0;for(let n in t)wt[e][l++].firstChild.nodeValue=t[n]}}()}_l=!1,!1!==t&&Hi("setLegend")}function xi(e,t){let l,n=me[e],i=0==e&&2==Je?mn:f[e];bt?l=n.values(g,e,t)??_t:(l=n.value(g,null==t?null:i[t],e,t),l=null==l?_t:{_:l}),ot.values[e]=l}function wi(t,l,n){let i;Ln=Nn,Un=jn,[Nn,jn]=rt.move(g,Nn,jn),rt.left=Nn,rt.top=jn,at&&(Hn&&Ie(Hn,v(Nn),0,Ot,Lt),Rn&&Ie(Rn,0,v(jn),Ot,Lt)),ri=P,ui=null;let s=0==$e.ori?Ot:Lt,o=1==$e.ori?Ot:Lt;if(0>Nn||0==Ol||Ll>Ul){i=rt.idx=null;for(let e=0;me.length>e;e++){let t=Al[e];null!=t&&Ie(t,-10,-10,Ot,Lt)}El&&oi(null,fi,!0,null==t&&Fi.setSeries),ot.live&&(st.fill(i),_l=!0)}else{let t,l,n;1==_&&(t=0==$e.ori?Nn:jn,l=ci(t,Ge),i=rt.idx=e(l,f[0],Ll,Ul),n=qe(f[0][i],$e,s,0));let r=-10,u=-10,a=0,c=0,h=!0,p="",d="";for(let e=2==_?1:0;me.length>e;e++){let t=me[e],m=st[e],x=null==m?null:1==_?f[e][m]:f[e][1][m],w=rt.dataIdx(g,e,i,l),v=null==w?null:1==_?f[e][w]:f[e][1][w];if(_l=_l||v!=x||w!=m,st[e]=w,e>0&&t.show){let l=null==w?-10:w==i?n:qe(1==_?f[0][w]:f[e][0][w],$e,s,0),m=null==v?-10:Ke(v,1==_?De[t.scale]:De[t.facets[1].scale],o,0);if(El&&null!=v){let l=1==$e.ori?Nn:jn,n=b(Dl.dist(g,e,w,m,l));if(ri>n){let i=Dl.bias;if(0!=i){let s=ci(l,t.scale),o=0>s?-1:1;o!=(0>v?-1:1)||(1==o?1==i?s>v:v>s:1==i?v>s:s>v)||(ri=n,ui=e)}else ri=n,ui=e}}if(_l||Pl){let t,n;0==$e.ori?(t=l,n=m):(t=m,n=l);let i,s,o,f,x,w,b=!0,_=zl.bbox;if(null!=_){b=!1;let t=_(g,e);o=t.left,f=t.top,i=t.width,s=t.height}else o=t,f=n,i=s=zl.size(g,e);if(w=zl.fill(g,e),x=zl.stroke(g,e),Pl)e!=ui||ri>Dl.prox||(r=o,u=f,a=i,c=s,h=b,p=w,d=x);else{let t=Al[e];null!=t&&(Cl[e]=o,Wl[e]=f,Ne(t,i,s,b),Le(t,w,x),Ie(t,k(o),k(f),Ot,Lt))}}}}if(Pl){let e=Dl.prox;if(_l||(null==ai?e>=ri:ri>e||ui!=ai)){let e=Al[0];null!=e&&(Cl[0]=r,Wl[0]=u,Ne(e,a,c,h),Le(e,p,d),Ie(e,k(r),k(u),Ot,Lt))}}}if(li.show&&Xn)if(null!=t){let[e,l]=Fi.scales,[n,i]=Fi.match,[r,u]=t.cursor.sync.scales,a=t.cursor.drag;if(ei=a._x,ti=a._y,ei||ti){let a,f,c,h,p,{left:d,top:m,width:g,height:x}=t.select,w=t.scales[r].ori,_=t.posToVal,v=null!=e&&n(e,r),k=null!=l&&i(l,u);v&&ei?(0==w?(a=d,f=g):(a=m,f=x),c=De[e],h=qe(_(a,r),c,s,0),p=qe(_(a+f,r),c,s,0),di(y(h,p),b(p-h))):di(0,s),k&&ti?(1==w?(a=d,f=g):(a=m,f=x),c=De[l],h=Ke(_(a,u),c,o,0),p=Ke(_(a+f,u),c,o,0),mi(y(h,p),b(p-h))):mi(0,o)}else Mi()}else{let e=b(Ln-Fn),t=b(Un-Gn);if(1==$e.ori){let l=e;e=t,t=l}ei=Qn.x&&e>=Qn.dist,ti=Qn.y&&t>=Qn.dist;let l,n,i=Qn.uni;null!=i?ei&&ti&&(ei=e>=i,ti=t>=i,ei||ti||(t>e?ti=!0:ei=!0)):Qn.x&&Qn.y&&(ei||ti)&&(ei=ti=!0),ei&&(0==$e.ori?(l=In,n=Nn):(l=On,n=jn),di(y(l,n),b(n-l)),ti||mi(0,o)),ti&&(1==$e.ori?(l=In,n=Nn):(l=On,n=jn),mi(y(l,n),b(n-l)),ei||di(0,s)),ei||ti||(di(0,0),mi(0,0))}if(Qn._x=ei,Qn._y=ti,null==t){if(n){if(null!=Gi){let[e,t]=Fi.scales;Fi.values[0]=null!=e?ci(0==$e.ori?Nn:jn,e):null,Fi.values[1]=null!=t?ci(1==$e.ori?Nn:jn,t):null}Oi(xe,g,Nn,jn,Ot,Lt,i)}if(El){let e=n&&Fi.setSeries,t=Dl.prox;null==ai?ri>t||oi(ui,fi,!0,e):ri>t?oi(null,fi,!0,e):ui!=ai&&oi(ui,fi,!0,e)}}_l&&(ot.idx=i,gi()),!1!==l&&Hi("setCursor")}g.setLegend=gi;let bi=null;function _i(e=!1){e?bi=null:(bi=Q.getBoundingClientRect(),Hi("syncRect",bi))}function vi(e,t,l,n,i,s){rt._lock||Xn&&null!=e&&0==e.movementX&&0==e.movementY||(ki(e,t,l,n,i,s,0,!1,null!=e),null!=e?wi(null,!0,!0):wi(t,!0,!1))}function ki(e,t,l,n,i,s,o,r,u){if(null==bi&&_i(!1),Sl(e),null!=e)l=e.clientX-bi.left,n=e.clientY-bi.top;else{if(0>l||0>n)return Nn=-10,void(jn=-10);let[e,o]=Fi.scales,r=t.cursor.sync,[u,a]=r.values,[f,c]=r.scales,[h,p]=Fi.match,d=t.axes[0].side%2==1,m=0==$e.ori?Ot:Lt,g=1==$e.ori?Ot:Lt,x=d?s:i,w=d?i:s,b=d?n:l,_=d?l:n;if(l=null!=f?h(e,f)?A(u,De[e],m,0):-10:m*(b/x),n=null!=c?p(o,c)?A(a,De[o],g,0):-10:g*(_/w),1==$e.ori){let e=l;l=n,n=e}}!u||null!=t&&t.cursor.event.type!=xe||(l>1&&Ot-1>l||(l=U(l,Ot)),n>1&&Lt-1>n||(n=U(n,Lt))),r?(Fn=l,Gn=n,[In,On]=rt.move(g,l,n)):(Nn=l,jn=n)}Object.defineProperty(g,"rect",{get:()=>(null==bi&&_i(!1),bi)});const yi={width:0,height:0,left:0,top:0};function Mi(){ii(yi,!1)}let Ti,Si,zi,Di;function Ei(e,t,l,n,i,s){Xn=!0,ei=ti=Qn._x=Qn._y=!1,ki(e,t,l,n,i,s,0,!0,!1),null!=e&&(Tt(be,Ee,Pi,!1),Oi(we,g,In,On,Ot,Lt,null));let{left:o,top:r,width:u,height:a}=li;Ti=o,Si=r,zi=u,Di=a}function Pi(e,t,l,n,i,s){Xn=Qn._x=Qn._y=!1,ki(e,t,l,n,i,s,0,!1,!0);let{left:o,top:r,width:u,height:a}=li,f=u>0||a>0,c=Ti!=o||Si!=r||zi!=u||Di!=a;if(f&&c&&ii(li),Qn.setScale&&f&&c){let e=o,t=u,l=r,n=a;if(1==$e.ori&&(e=r,t=a,l=o,n=u),ei&&si(Ge,ci(e,Ge),ci(e+t,Ge)),ti)for(let e in De){let t=De[e];e!=Ge&&null==t.from&&t.min!=P&&si(e,ci(l+n,e),ci(l,e))}Mi()}else rt.lock&&(rt._lock=!rt._lock,wi(t,!0,null!=e));null!=e&&(St(be,Ee),Oi(be,g,Nn,jn,Ot,Lt,null))}function Ai(e){rt._lock||(Sl(e),wn(),Mi(),null!=e&&Oi(ke,g,Nn,jn,Ot,Lt,null))}function Ci(){m()}Be(Me,Pe,Ci);const Wi={};Wi.mousedown=Ei,Wi.mousemove=vi,Wi.mouseup=Pi,Wi.dblclick=Ai,Wi.setSeries=(e,t,l,n)=>{-1!=(l=(0,Fi.match[2])(g,t,l))&&oi(l,n,!0,!1)},at&&(Tt(we,Q,Ei),Tt(xe,Q,vi),Tt(_e,Q,(e=>{Sl(e),_i(!1)})),Tt(ve,Q,(function(e){if(rt._lock)return;Sl(e);let t=Xn;if(Xn){let e,t,l=!0,n=!0,i=10;0==$e.ori?(e=ei,t=ti):(e=ti,t=ei),e&&t&&(l=i>=Nn||Nn>=Ot-i,n=i>=jn||jn>=Lt-i),e&&l&&(Nn=In>Nn?0:Ot),t&&n&&(jn=On>jn?0:Lt),wi(null,!0,!0),Xn=!1}Nn=-10,jn=-10,st.fill(null),wi(null,!0,!0),t&&(Xn=t)})),Tt(ke,Q,Ai),jl.add(g),g.syncRect=_i);const Yi=g.hooks=t.hooks||{};function Hi(e,t,l){Bn?Zn.push([e,t,l]):e in Yi&&Yi[e].forEach((e=>{e.call(null,g,t,l)}))}(t.plugins||[]).forEach((e=>{for(let t in e.hooks)Yi[t]=(Yi[t]||[]).concat(e.hooks[t])}));const Ri=(e,t,l)=>l,Fi=oe({key:null,setSeries:!1,filters:{pub:G,sub:G},scales:[Ge,me[1]?me[1].scale:null],match:[I,I,Ri],values:[null,null]},rt.sync);2==Fi.match.length&&Fi.match.push(Ri),rt.sync=Fi;const Gi=Fi.key,Ii=wl(Gi);function Oi(e,t,l,n,i,s,o){Fi.filters.pub(e,t,l,n,i,s,o)&&Ii.pub(e,t,l,n,i,s,o)}function Li(){Hi("init",t,f),xn(f||t.data,!1),Xe[Ge]?Kn(Ge,Xe[Ge]):wn(),bl=li.show&&(li.width>0||li.height>0),xl=_l=!0,kl(t.width,t.height)}return Ii.sub(g),g.pub=function(e,t,l,n,i,s,o){Fi.filters.sub(e,t,l,n,i,s,o)&&Wi[e](null,t,l,n,i,s,o)},g.destroy=function(){Ii.unsub(g),jl.delete(g),Mt.clear(),Ze(Me,Pe,Ci),O.remove(),ct?.remove(),Hi("destroy")},me.forEach(Hl),ye.forEach((function(e,t){if(e._show=e.show,e.show){let l=De[e.scale];null==l&&(e.scale=e.side%2?me[1].scale:Ge,l=De[e.scale]);let n=l.time;e.size=Y(e.size),e.space=Y(e.space),e.rotate=Y(e.rotate),X(e.incrs)&&e.incrs.forEach((e=>{!B.has(e)&&B.set(e,Z(e))})),e.incrs=Y(e.incrs||(2==l.distr?mt:n?1==re?Dt:At:gt)),e.splits=Y(e.splits||(n&&1==l.distr?tt:3==l.distr?Qt:4==l.distr?el:Xt)),e.stroke=Y(e.stroke),e.grid.stroke=Y(e.grid.stroke),e.ticks.stroke=Y(e.ticks.stroke),e.border.stroke=Y(e.border.stroke);let i=e.values;e.values=X(i)&&!X(i[0])?Y(i):n?X(i)?Ht(Qe,Yt(i,et)):ee(i)?function(e,t){let l=lt(t);return(t,n)=>n.map((t=>l(e(t))))}(Qe,i):i||nt:i||Kt,e.filter=Y(e.filter||(3>l.distr||10!=l.log?3==l.distr&&2==l.log?rl:R:ol)),e.font=sn(e.font,d),e.labelFont=sn(e.labelFont,d),e._size=e.size(g,null,t,0),e._space=e._rotate=e._incrs=e._found=e._splits=e._values=null,e._size>0&&(Rl[t]=!0,e._el=Fe("u-axis",j))}})),c?c instanceof HTMLElement?(c.appendChild(O),Li()):c(g,Li):Li(),g}on.assign=oe,on.fmtNum=g,on.rangeNum=h,on.rangeLog=o,on.rangeAsinh=r,on.orient=bl,on.pxRatio=Ae,on.join=function(e,t){if(function(e){let t=e[0][0],l=t.length;for(let n=1;e.length>n;n++){let i=e[n][0];if(i.length!=l)return!1;if(i!=t)for(let e=0;l>e;e++)if(i[e]!=t[e])return!1}return!0}(e)){let t=e[0].slice();for(let l=1;e.length>l;l++)t.push(...e[l].slice(1));return function(e,t=100){const l=e.length;if(1>=l)return!0;let n=0,i=l-1;for(;i>=n&&null==e[n];)n++;for(;i>=n&&null==e[i];)i--;if(n>=i)return!0;const s=M(1,_((i-n+1)/t));for(let t=e[n],l=n+s;i>=l;l+=s){const n=e[l];if(null!=n){if(t>=n)return!1;t=n}}return!0}(t[0])||(t=function(e){let t=e[0],l=t.length,n=Array(l);for(let e=0;n.length>e;e++)n[e]=e;n.sort(((e,l)=>t[e]-t[l]));let i=[];for(let t=0;e.length>t;t++){let s=e[t],o=Array(l);for(let e=0;l>e;e++)o[e]=s[n[e]];i.push(o)}return i}(t)),t}let l=new Set;for(let t=0;e.length>t;t++){let n=e[t][0],i=n.length;for(let e=0;i>e;e++)l.add(n[e])}let n=[Array.from(l).sort(((e,t)=>e-t))],i=n[0].length,s=new Map;for(let e=0;i>e;e++)s.set(n[0][e],e);for(let l=0;e.length>l;l++){let o=e[l],r=o[0];for(let e=1;o.length>e;e++){let u=o[e],a=Array(i).fill(void 0),f=t?t[l][e]:1,c=[];for(let e=0;u.length>e;e++){let t=u[e],l=s.get(r[e]);null===t?0!=f&&(a[l]=t,2==f&&c.push(l)):a[l]=t}re(a,c,i),n.push(a)}}return n},on.fmtDate=lt,on.tzDate=function(e,t){if(null==t||t==nt)return"number"==typeof e?new Date(e):e;let l=new rt(e);return l.setTimeZone(t),l},on.sync=wl;{on.addGap=function(e,t,l){let n=e[e.length-1];n&&n[0]==t?n[1]=l:e.push([t,l])},on.clipGaps=yl;let e=on.paths={points:Fl};e.linear=Ll,e.stepped=function(e){const t=p(e.align,1),l=p(e.ascDesc,!1),n=p(e.extend,!1);return(s,o,r,u)=>{let{pxRatio:a}=s;return bl(s,o,((f,c,h,p,d,m,g,x,w,b,_)=>{[r,u]=i(h,r,u);let v=f.pxRound,k=e?.alignGaps??f.alignGaps??0,{left:y,width:M}=s.bbox,T=e=>v(m(e,p,b,x)),S=e=>v(g(e,d,_,w)),z=0==p.ori?El:Pl;const D={stroke:new Path2D,fill:null,clip:null,band:null,gaps:null,flags:1},E=D.stroke,P=p.dir*(0==p.ori?1:-1);let A=S(h[1==P?r:u]),C=T(c[1==P?r:u]),W=C,Y=C;n&&-1==t&&(Y=y,z(E,Y,A)),z(E,C,A);for(let e=1==P?r:u;e>=r&&u>=e;e+=P){let l=h[e];if(null==l)continue;let n=T(c[e]),i=S(l);1==t?z(E,n,A):z(E,W,i),z(E,n,i),A=i,W=n}let H=W;n&&1==t&&(H=y+M,z(E,H,A));let[R,F]=_l(s,o);if(null!=f.fill||0!=R){let e=D.fill=new Path2D(E),t=S(f.fillTo(s,o,f.min,f.max,R));z(e,H,t),z(e,Y,t)}if(!f.spanGaps){let e=[];e.push(...Ml(c,h,r,u,P,T,k));let n=f.width*a/2,i=l||1==t?n:-n,d=l||-1==t?-n:n;e.forEach((e=>{e[0]+=i,e[1]+=d})),D.gaps=e=f.gaps(s,o,r,u,e),D.clip=yl(e,p.ori,x,w,b,_)}return 0!=F&&(D.band=2==F?[kl(s,o,r,u,E,-1),kl(s,o,r,u,E,1)]:kl(s,o,r,u,E,F)),D}))}},e.bars=function(e){const t=p((e=e||J).size,[.6,P,1]),l=e.align||0,n=e.gap||0;let i=e.radius;i=null==i?[0,0]:"number"==typeof i?[i,0]:i;const s=Y(i),o=1-t[0],r=p(t[1],P),u=p(t[2],1),a=p(e.disp,J),f=p(e.each,(()=>{})),{fill:c,stroke:h}=a;return(e,t,i,d)=>{let{pxRatio:m}=e;return bl(e,t,((g,x,w,b,v,k,T,S,z,D,E)=>{let P,A,W=g.pxRound,Y=l,R=n*m,F=r*m,G=u*m;0==b.ori?[P,A]=s(e,t):[A,P]=s(e,t);const I=b.dir*(0==b.ori?1:-1);let O,L,U,N=0==b.ori?Al:Cl,j=0==b.ori?f:(e,t,l,n,i,s,o)=>{f(e,t,l,i,n,o,s)},V=p(e.bands,q).find((e=>e.series[0]==t)),B=g.fillTo(e,t,g.min,g.max,null!=V?V.dir:0),Z=W(T(B,v,E,z)),$=D,J=W(g.width*m),K=!1,X=null,Q=null,ee=null,te=null;null==c||0!=J&&null==h||(K=!0,X=c.values(e,t,i,d),Q=new Map,new Set(X).forEach((e=>{null!=e&&Q.set(e,new Path2D)})),J>0&&(ee=h.values(e,t,i,d),te=new Map,new Set(ee).forEach((e=>{null!=e&&te.set(e,new Path2D)}))));let{x0:le,size:ne}=a;if(null!=le&&null!=ne){Y=1,x=le.values(e,t,i,d),2==le.unit&&(x=x.map((t=>e.posToVal(S+t*D,b.key,!0))));let l=ne.values(e,t,i,d);L=2==ne.unit?l[0]*D:k(l[0],b,D,S)-k(0,b,D,S),$=Ul(x,w,k,b,D,S,$),U=$-L+R}else $=Ul(x,w,k,b,D,S,$),U=$*o+R,L=$-U;1>U&&(U=0),L/2>J||(J=0),5>U&&(W=H);let ie=U>0;L=W(C($-U-(ie?J:0),G,F)),O=(0==Y?L/2:Y==I?0:L)-Y*I*((0==Y?R/2:0)+(ie?J/2:0));const se={stroke:null,fill:null,clip:null,band:null,gaps:null,flags:0},oe=K?null:new Path2D;let re=null;if(null!=V)re=e.data[V.series[1]];else{let{y0:l,y1:n}=a;null!=l&&null!=n&&(w=n.values(e,t,i,d),re=l.values(e,t,i,d))}let ue=P*L,ae=A*L;for(let l=1==I?i:d;l>=i&&d>=l;l+=I){let n=w[l];if(null==n)continue;if(null!=re){let e=re[l]??0;if(n-e==0)continue;Z=T(e,v,E,z)}let i=k(2!=b.distr||null!=a?x[l]:l,b,D,S),s=T(p(n,B),v,E,z),o=W(i-O),r=W(M(s,Z)),u=W(y(s,Z)),f=r-u;if(null!=n&&n!=B){let i=0>n?ae:ue,s=0>n?ue:ae;K?(J>0&&null!=ee[l]&&N(te.get(ee[l]),o,u+_(J/2),L,M(0,f-J),i,s),null!=X[l]&&N(Q.get(X[l]),o,u+_(J/2),L,M(0,f-J),i,s)):N(oe,o,u+_(J/2),L,M(0,f-J),i,s),j(e,t,l,o-J/2,u,L+J,f)}}return J>0?se.stroke=K?te:oe:K||(se._fill=0==g.width?g._fill:g._stroke??g._fill,se.width=0),se.fill=K?Q:oe,se}))}},e.spline=function(e){return function(e,t){return(l,n,s,o)=>bl(l,n,((r,u,a,f,c,h,p,d,m,g,x)=>{[s,o]=i(a,s,o);let w,b,_,v=r.pxRound,k=t?.alignGaps??r.alignGaps??0,y=e=>v(h(e,f,g,d)),M=e=>v(p(e,c,x,m));0==f.ori?(w=zl,_=El,b=Hl):(w=Dl,_=Pl,b=Rl);const T=f.dir*(0==f.ori?1:-1);let S=y(u[1==T?s:o]),z=S,D=[],E=[];for(let e=1==T?s:o;e>=s&&o>=e;e+=T)if(null!=a[e]){let t=y(u[e]);D.push(z=t),E.push(M(a[e]))}const P={stroke:e(D,E,w,_,b,v),fill:null,clip:null,band:null,gaps:null,flags:1},A=P.stroke;let[C,W]=_l(l,n);if(null!=r.fill||0!=C){let e=P.fill=new Path2D(A),t=M(r.fillTo(l,n,r.min,r.max,C));_(e,z,t),_(e,S,t)}if(!r.spanGaps){let e=[];e.push(...Ml(u,a,s,o,T,y,k)),P.gaps=e=r.gaps(l,n,s,o,e),P.clip=yl(e,f.ori,d,m,g,x)}return 0!=W&&(P.band=2==W?[kl(l,n,s,o,A,-1),kl(l,n,s,o,A,1)]:kl(l,n,s,o,A,W)),P}))}(Nl,e)}}return on}();