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