zwave-js-ui
Version:
Z-Wave Control Panel and MQTT Gateway
3 lines • 55.7 kB
JavaScript
import{n as Ko,aj as $o}from"./index-CtTdmJsx.js";const jo=!0,De="u-",qo="uplot",Jo=De+"hz",Zo=De+"vt",Qo=De+"title",Xo=De+"wrap",er=De+"under",tr=De+"over",lr=De+"axis",Xt=De+"off",nr=De+"select",ir=De+"cursor-x",sr=De+"cursor-y",or=De+"cursor-pt",rr=De+"legend",fr=De+"live",ur=De+"inline",cr=De+"series",ar=De+"marker",Ki=De+"label",hr=De+"value",Bl="width",Yl="height",Gl="top",$i="bottom",xl="left",Gn="right",ni="#000",ji=ni+"0",qi="mousemove",Ji="mousedown",In="mouseup",Zi="mouseenter",Qi="mouseleave",Xi="dblclick",pr="resize",mr="scroll",es="change",cn="dppxchange",ii="--",Dl=typeof window<"u",$n=Dl?document:null,kl=Dl?window:null,dr=Dl?navigator:null;let oe,on;function jn(){let e=devicePixelRatio;oe!=e&&(oe=e,on&&Jn(es,on,jn),on=matchMedia(`(min-resolution: ${oe-.001}dppx) and (max-resolution: ${oe+.001}dppx)`),el(es,on,jn),kl.dispatchEvent(new CustomEvent(cn)))}function et(e,l){if(l!=null){let s=e.classList;!s.contains(l)&&s.add(l)}}function qn(e,l){let s=e.classList;s.contains(l)&&s.remove(l)}function ge(e,l,s){e.style[l]=s+"px"}function wt(e,l,s,n){let o=$n.createElement(e);return l!=null&&et(o,l),s!=null&&s.insertBefore(o,n),o}function ct(e,l){return wt("div",e,l)}const ts=new WeakMap;function bt(e,l,s,n,o){let c="translate("+l+"px,"+s+"px)",u=ts.get(e);c!=u&&(e.style.transform=c,ts.set(e,c),l<0||s<0||l>n||s>o?et(e,Xt):qn(e,Xt))}const ls=new WeakMap;function ns(e,l,s){let n=l+s,o=ls.get(e);n!=o&&(ls.set(e,n),e.style.background=l,e.style.borderColor=s)}const is=new WeakMap;function ss(e,l,s,n){let o=l+""+s,c=is.get(e);o!=c&&(is.set(e,o),e.style.height=s+"px",e.style.width=l+"px",e.style.marginLeft=n?-l/2+"px":0,e.style.marginTop=n?-s/2+"px":0)}const si={passive:!0},gr={...si,capture:!0};function el(e,l,s,n){l.addEventListener(e,s,n?gr:si)}function Jn(e,l,s,n){l.removeEventListener(e,s,si)}Dl&&jn();function St(e,l,s,n){let o;s=s||0,n=n||l.length-1;let c=n<=2147483647;for(;n-s>1;)o=c?s+n>>1:tt((s+n)/2),l[o]<e?s=o:n=o;return e-l[s]<=l[n]-e?s:n}function bl(e,l,s,n){for(let o=n==1?l:s;o>=l&&o<=s;o+=n)if(e[o]!=null)return o;return-1}function wr(e,l,s,n){let o=ee,c=-ee;if(n==1)o=e[l],c=e[s];else if(n==-1)o=e[s],c=e[l];else for(let u=l;u<=s;u++){let d=e[u];d!=null&&(d<o&&(o=d),d>c&&(c=d))}return[o,c]}function Sr(e,l,s){let n=ee,o=-ee;for(let c=l;c<=s;c++){let u=e[c];u!=null&&u>0&&(u<n&&(n=u),u>o&&(o=u))}return[n,o]}function pn(e,l,s,n){let o=fs(e),c=fs(l);e==l&&(o==-1?(e*=s,l/=s):(e/=s,l*=s));let u=s==10?At:Rs,d=o==1?tt:at,m=c==1?at:tt,g=d(u(Ae(e))),y=m(u(Ae(l))),_=Ml(s,g),h=Ml(s,y);return s==10&&(g<0&&(_=he(_,-g)),y<0&&(h=he(h,-y))),n||s==2?(e=_*o,l=h*c):(e=Fs(e,_),l=mn(l,h)),[e,l]}function oi(e,l,s,n){let o=pn(e,l,s,n);return e==0&&(o[0]=0),l==0&&(o[1]=0),o}const ri=.1,os={mode:3,pad:ri},Kl={pad:0,soft:null,mode:0},_r={min:Kl,max:Kl};function an(e,l,s,n){return dn(s)?rs(e,l,s):(Kl.pad=s,Kl.soft=n?0:null,Kl.mode=n?3:0,rs(e,l,_r))}function se(e,l){return e??l}function yr(e,l,s){for(l=se(l,0),s=se(s,e.length-1);l<=s;){if(e[l]!=null)return!0;l++}return!1}function rs(e,l,s){let n=s.min,o=s.max,c=se(n.pad,0),u=se(o.pad,0),d=se(n.hard,-ee),m=se(o.hard,ee),g=se(n.soft,ee),y=se(o.soft,-ee),_=se(n.mode,0),h=se(o.mode,0),T=l-e,z=At(T),D=Oe(Ae(e),Ae(l)),F=At(D),P=Ae(F-z);(T<1e-24||P>10)&&(T=0,(e==0||l==0)&&(T=1e-24,_==2&&g!=ee&&(c=0),h==2&&y!=-ee&&(u=0)));let H=T||D||1e3,k=At(H),C=Ml(10,tt(k)),E=H*(T==0?e==0?.1:1:c),W=he(Fs(e-E,C/10),24),L=e>=g&&(_==1||_==3&&W<=g||_==2&&W>=g)?g:ee,I=Oe(d,W<L&&e>=L?L:ht(L,W)),B=H*(T==0?l==0?.1:1:u),V=he(mn(l+B,C/10),24),v=l<=y&&(h==1||h==3&&V>=y||h==2&&V<=y)?y:-ee,N=ht(m,V>v&&l<=v?v:Oe(v,V));return I==N&&I==0&&(N=100),[I,N]}const xr=new Intl.NumberFormat(Dl?dr.language:"en-US"),fi=e=>xr.format(e),lt=Math,un=lt.PI,Ae=lt.abs,tt=lt.floor,Te=lt.round,at=lt.ceil,ht=lt.min,Oe=lt.max,Ml=lt.pow,fs=lt.sign,At=lt.log10,Rs=lt.log2,vr=(e,l=1)=>lt.sinh(e)*l,Bn=(e,l=1)=>lt.asinh(e/l),ee=1/0;function us(e){return(At((e^e>>31)-(e>>31))|0)+1}function Zn(e,l,s){return ht(Oe(e,l),s)}function X(e){return typeof e=="function"?e:()=>e}const kr=()=>{},zs=e=>e,Vs=(e,l)=>l,br=e=>null,cs=e=>!0,as=(e,l)=>e==l,Mr=/\.\d*?(?=9{6,}|0{6,})/gm,tl=e=>{if(Ns(e)||Bt.has(e))return e;const l=`${e}`,s=l.match(Mr);if(s==null)return e;let n=s[0].length-1;if(l.indexOf("e-")!=-1){let[o,c]=l.split("e");return+`${tl(o)}e${c}`}return he(e,n)};function Zt(e,l){return tl(he(tl(e/l))*l)}function mn(e,l){return tl(at(tl(e/l))*l)}function Fs(e,l){return tl(tt(tl(e/l))*l)}function he(e,l=0){if(Ns(e))return e;let s=10**l,n=e*s*(1+Number.EPSILON);return Te(n)/s}const Bt=new Map;function Hs(e){return((""+e).split(".")[1]||"").length}function jl(e,l,s,n){let o=[],c=n.map(Hs);for(let u=l;u<s;u++){let d=Ae(u),m=he(Ml(e,u),d);for(let g=0;g<n.length;g++){let y=e==10?+`${n[g]}e${u}`:n[g]*m,_=(u>=0?0:d)+(u>=c[g]?0:c[g]),h=e==10?y:he(y,_);o.push(h),Bt.set(h,_)}}return o}const $l={},ui=[],El=[null,null],It=Array.isArray,Ns=Number.isInteger,Er=e=>e===void 0;function hs(e){return typeof e=="string"}function dn(e){let l=!1;if(e!=null){let s=e.constructor;l=s==null||s==Object}return l}function Tr(e){return e!=null&&typeof e=="object"}const Ar=Object.getPrototypeOf(Uint8Array),Os="__proto__";function Tl(e,l=dn){let s;if(It(e)){let n=e.find(o=>o!=null);if(It(n)||l(n)){s=Array(e.length);for(let o=0;o<e.length;o++)s[o]=Tl(e[o],l)}else s=e.slice()}else if(e instanceof Ar)s=e.slice();else if(l(e)){s={};for(let n in e)n!=Os&&(s[n]=Tl(e[n],l))}else s=e;return s}function Me(e){let l=arguments;for(let s=1;s<l.length;s++){let n=l[s];for(let o in n)o!=Os&&(dn(e[o])?Me(e[o],Tl(n[o])):e[o]=Tl(n[o]))}return e}const Dr=0,Lr=1,Pr=2;function Cr(e,l,s){for(let n=0,o,c=-1;n<l.length;n++){let u=l[n];if(u>c){for(o=u-1;o>=0&&e[o]==null;)e[o--]=null;for(o=u+1;o<s&&e[o]==null;)e[c=o++]=null}}}function Rr(e,l){if(Fr(e)){let u=e[0].slice();for(let d=1;d<e.length;d++)u.push(...e[d].slice(1));return Hr(u[0])||(u=Vr(u)),u}let s=new Set;for(let u=0;u<e.length;u++){let m=e[u][0],g=m.length;for(let y=0;y<g;y++)s.add(m[y])}let n=[Array.from(s).sort((u,d)=>u-d)],o=n[0].length,c=new Map;for(let u=0;u<o;u++)c.set(n[0][u],u);for(let u=0;u<e.length;u++){let d=e[u],m=d[0];for(let g=1;g<d.length;g++){let y=d[g],_=Array(o).fill(void 0),h=l?l[u][g]:Lr,T=[];for(let z=0;z<y.length;z++){let D=y[z],F=c.get(m[z]);D===null?h!=Dr&&(_[F]=D,h==Pr&&T.push(F)):_[F]=D}Cr(_,T,o),n.push(_)}}return n}const zr=typeof queueMicrotask>"u"?e=>Promise.resolve().then(e):queueMicrotask;function Vr(e){let l=e[0],s=l.length,n=Array(s);for(let c=0;c<n.length;c++)n[c]=c;n.sort((c,u)=>l[c]-l[u]);let o=[];for(let c=0;c<e.length;c++){let u=e[c],d=Array(s);for(let m=0;m<s;m++)d[m]=u[n[m]];o.push(d)}return o}function Fr(e){let l=e[0][0],s=l.length;for(let n=1;n<e.length;n++){let o=e[n][0];if(o.length!=s)return!1;if(o!=l){for(let c=0;c<s;c++)if(o[c]!=l[c])return!1}}return!0}function Hr(e,l=100){const s=e.length;if(s<=1)return!0;let n=0,o=s-1;for(;n<=o&&e[n]==null;)n++;for(;o>=n&&e[o]==null;)o--;if(o<=n)return!0;const c=Oe(1,tt((o-n+1)/l));for(let u=e[n],d=n+c;d<=o;d+=c){const m=e[d];if(m!=null){if(m<=u)return!1;u=m}}return!0}const Ws=["January","February","March","April","May","June","July","August","September","October","November","December"],Gs=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function Is(e){return e.slice(0,3)}const Nr=Gs.map(Is),Or=Ws.map(Is),Wr={MMMM:Ws,MMM:Or,WWWW:Gs,WWW:Nr};function Il(e){return(e<10?"0":"")+e}function Gr(e){return(e<10?"00":e<100?"0":"")+e}const Ir={YYYY:e=>e.getFullYear(),YY:e=>(e.getFullYear()+"").slice(2),MMMM:(e,l)=>l.MMMM[e.getMonth()],MMM:(e,l)=>l.MMM[e.getMonth()],MM:e=>Il(e.getMonth()+1),M:e=>e.getMonth()+1,DD:e=>Il(e.getDate()),D:e=>e.getDate(),WWWW:(e,l)=>l.WWWW[e.getDay()],WWW:(e,l)=>l.WWW[e.getDay()],HH:e=>Il(e.getHours()),H:e=>e.getHours(),h:e=>{let l=e.getHours();return l==0?12:l>12?l-12:l},AA:e=>e.getHours()>=12?"PM":"AM",aa:e=>e.getHours()>=12?"pm":"am",a:e=>e.getHours()>=12?"p":"a",mm:e=>Il(e.getMinutes()),m:e=>e.getMinutes(),ss:e=>Il(e.getSeconds()),s:e=>e.getSeconds(),fff:e=>Gr(e.getMilliseconds())};function ci(e,l){l=l||Wr;let s=[],n=/\{([a-z]+)\}|[^{]+/gi,o;for(;o=n.exec(e);)s.push(o[0][0]=="{"?Ir[o[1]]:o[0]);return c=>{let u="";for(let d=0;d<s.length;d++)u+=typeof s[d]=="string"?s[d]:s[d](c,l);return u}}const Br=new Intl.DateTimeFormat().resolvedOptions().timeZone;function Yr(e,l){let s;return l=="UTC"||l=="Etc/UTC"?s=new Date(+e+e.getTimezoneOffset()*6e4):l==Br?s=e:(s=new Date(e.toLocaleString("en-US",{timeZone:l})),s.setMilliseconds(e.getMilliseconds())),s}const Bs=e=>e%1==0,hn=[1,2,2.5,5],Ur=jl(10,-32,0,hn),Ys=jl(10,0,32,hn),Kr=Ys.filter(Bs),Qt=Ur.concat(Ys),ai=`
`,Us="{YYYY}",ps=ai+Us,Ks="{M}/{D}",Ul=ai+Ks,rn=Ul+"/{YY}",$s="{aa}",$r="{h}:{mm}",vl=$r+$s,ms=ai+vl,ds=":{ss}",re=null;function js(e){let l=e*1e3,s=l*60,n=s*60,o=n*24,c=o*30,u=o*365,m=(e==1?jl(10,0,3,hn).filter(Bs):jl(10,-3,0,hn)).concat([l,l*5,l*10,l*15,l*30,s,s*5,s*10,s*15,s*30,n,n*2,n*3,n*4,n*6,n*8,n*12,o,o*2,o*3,o*4,o*5,o*6,o*7,o*8,o*9,o*10,o*15,c,c*2,c*3,c*4,c*6,u,u*2,u*5,u*10,u*25,u*50,u*100]);const g=[[u,Us,re,re,re,re,re,re,1],[o*28,"{MMM}",ps,re,re,re,re,re,1],[o,Ks,ps,re,re,re,re,re,1],[n,"{h}"+$s,rn,re,Ul,re,re,re,1],[s,vl,rn,re,Ul,re,re,re,1],[l,ds,rn+" "+vl,re,Ul+" "+vl,re,ms,re,1],[e,ds+".{fff}",rn+" "+vl,re,Ul+" "+vl,re,ms,re,1]];function y(_){return(h,T,z,D,F,P)=>{let H=[],k=F>=u,C=F>=c&&F<u,E=_(z),W=he(E*e,3),L=Yn(E.getFullYear(),k?0:E.getMonth(),C||k?1:E.getDate()),I=he(L*e,3);if(C||k){let B=C?F/c:0,V=k?F/u:0,v=W==I?W:he(Yn(L.getFullYear()+V,L.getMonth()+B,1)*e,3),N=new Date(Te(v/e)),q=N.getFullYear(),le=N.getMonth();for(let U=0;v<=D;U++){let ue=Yn(q+V*U,le+B*U,1),Z=ue-_(he(ue*e,3));v=he((+ue+Z)*e,3),v<=D&&H.push(v)}}else{let B=F>=o?o:F,V=tt(z)-tt(W),v=I+V+mn(W-I,B);H.push(v);let N=_(v),q=N.getHours()+N.getMinutes()/s+N.getSeconds()/n,le=F/n,U=h.axes[T]._space,ue=P/U;for(;v=he(v+F,e==1?0:3),!(v>D);)if(le>1){let Z=tt(he(q+le,6))%24,ne=_(v).getHours()-Z;ne>1&&(ne=-1),v-=ne*n,q=(q+le)%24;let fe=H[H.length-1];he((v-fe)/F,3)*ue>=.7&&H.push(v)}else H.push(v)}return H}}return[m,g,y]}const[jr,qr,Jr]=js(1),[Zr,Qr,Xr]=js(.001);jl(2,-53,53,[1]);function gs(e,l){return e.map(s=>s.map((n,o)=>o==0||o==8||n==null?n:l(o==1||s[8]==0?n:s[1]+n)))}function ws(e,l){return(s,n,o,c,u)=>{let d=l.find(z=>u>=z[0])||l[l.length-1],m,g,y,_,h,T;return n.map(z=>{let D=e(z),F=D.getFullYear(),P=D.getMonth(),H=D.getDate(),k=D.getHours(),C=D.getMinutes(),E=D.getSeconds(),W=F!=m&&d[2]||P!=g&&d[3]||H!=y&&d[4]||k!=_&&d[5]||C!=h&&d[6]||E!=T&&d[7]||d[1];return m=F,g=P,y=H,_=k,h=C,T=E,W(D)})}}function ef(e,l){let s=ci(l);return(n,o,c,u,d)=>o.map(m=>s(e(m)))}function Yn(e,l,s){return new Date(e,l,s)}function Ss(e,l){return l(e)}const tf="{YYYY}-{MM}-{DD} {h}:{mm}{aa}";function _s(e,l){return(s,n,o,c)=>c==null?ii:l(e(n))}function lf(e,l){let s=e.series[l];return s.width?s.stroke(e,l):s.points.width?s.points.stroke(e,l):null}function nf(e,l){return e.series[l].fill(e,l)}const sf={show:!0,live:!0,isolate:!1,mount:kr,markers:{show:!0,width:2,stroke:lf,fill:nf,dash:"solid"},idx:null,idxs:null,values:[]};function of(e,l){let s=e.cursor.points,n=ct(),o=s.size(e,l);ge(n,Bl,o),ge(n,Yl,o);let c=o/-2;ge(n,"marginLeft",c),ge(n,"marginTop",c);let u=s.width(e,l,o);return u&&ge(n,"borderWidth",u),n}function rf(e,l){let s=e.series[l].points;return s._fill||s._stroke}function ff(e,l){let s=e.series[l].points;return s._stroke||s._fill}function uf(e,l){return e.series[l].points.size}const Un=[0,0];function cf(e,l,s){return Un[0]=l,Un[1]=s,Un}function fn(e,l,s,n=!0){return o=>{o.button==0&&(!n||o.target==l)&&s(o)}}function Kn(e,l,s,n=!0){return o=>{(!n||o.target==l)&&s(o)}}const af={show:!0,x:!0,y:!0,lock:!1,move:cf,points:{one:!1,show:of,size:uf,width:0,stroke:ff,fill:rf},bind:{mousedown:fn,mouseup:fn,click:fn,dblclick:fn,mousemove:Kn,mouseleave:Kn,mouseenter:Kn},drag:{setScale:!0,x:!0,y:!1,dist:0,uni:null,click:(e,l)=>{l.stopPropagation(),l.stopImmediatePropagation()},_x:!1,_y:!1},focus:{dist:(e,l,s,n,o)=>n-o,prox:-1,bias:0},hover:{skip:[void 0],prox:null,bias:0},left:-10,top:-10,idx:null,dataIdx:null,idxs:null,event:null},qs={show:!0,stroke:"rgba(0,0,0,0.07)",width:2},hi=Me({},qs,{filter:Vs}),Js=Me({},hi,{size:10}),Zs=Me({},qs,{show:!1}),pi='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"',Qs="bold "+pi,Xs=1.5,ys={show:!0,scale:"x",stroke:ni,space:50,gap:5,size:50,labelGap:0,labelSize:30,labelFont:Qs,side:2,grid:hi,ticks:Js,border:Zs,font:pi,lineGap:Xs,rotate:0},hf="Value",pf="Time",xs={show:!0,scale:"x",auto:!1,sorted:1,min:ee,max:-ee,idxs:[]};function mf(e,l,s,n,o){return l.map(c=>c==null?"":fi(c))}function df(e,l,s,n,o,c,u){let d=[],m=Bt.get(o)||0;s=u?s:he(mn(s,o),m);for(let g=s;g<=n;g=he(g+o,m))d.push(Object.is(g,-0)?0:g);return d}function Qn(e,l,s,n,o,c,u){const d=[],m=e.scales[e.axes[l].scale].log,g=m==10?At:Rs,y=tt(g(s));o=Ml(m,y),m==10&&(o=Qt[St(o,Qt)]);let _=s,h=o*m;m==10&&(h=Qt[St(h,Qt)]);do d.push(_),_=_+o,m==10&&!Bt.has(_)&&(_=he(_,Bt.get(o))),_>=h&&(o=_,h=o*m,m==10&&(h=Qt[St(h,Qt)]));while(_<=n);return d}function gf(e,l,s,n,o,c,u){let m=e.scales[e.axes[l].scale].asinh,g=n>m?Qn(e,l,Oe(m,s),n,o):[m],y=n>=0&&s<=0?[0]:[];return(s<-m?Qn(e,l,Oe(m,-n),-s,o):[m]).reverse().map(h=>-h).concat(y,g)}const eo=/./,wf=/[12357]/,Sf=/[125]/,vs=/1/,Xn=(e,l,s,n)=>e.map((o,c)=>l==4&&o==0||c%n==0&&s.test(o.toExponential()[o<0?1:0])?o:null);function _f(e,l,s,n,o){let c=e.axes[s],u=c.scale,d=e.scales[u],m=e.valToPos,g=c._space,y=m(10,u),_=m(9,u)-y>=g?eo:m(7,u)-y>=g?wf:m(5,u)-y>=g?Sf:vs;if(_==vs){let h=Ae(m(1,u)-y);if(h<g)return Xn(l.slice().reverse(),d.distr,_,at(g/h)).reverse()}return Xn(l,d.distr,_,1)}function yf(e,l,s,n,o){let c=e.axes[s],u=c.scale,d=c._space,m=e.valToPos,g=Ae(m(1,u)-m(2,u));return g<d?Xn(l.slice().reverse(),3,eo,at(d/g)).reverse():l}function xf(e,l,s,n){return n==null?ii:l==null?"":fi(l)}const ks={show:!0,scale:"y",stroke:ni,space:30,gap:5,size:50,labelGap:0,labelSize:30,labelFont:Qs,side:3,grid:hi,ticks:Js,border:Zs,font:pi,lineGap:Xs,rotate:0};function vf(e,l){let s=3+(e||1)*2;return he(s*l,3)}function kf(e,l){let{scale:s,idxs:n}=e.series[0],o=e._data[0],c=e.valToPos(o[n[0]],s,!0),u=e.valToPos(o[n[1]],s,!0),d=Ae(u-c),m=e.series[l],g=d/(m.points.space*oe);return n[1]-n[0]<=g}const bs={scale:null,auto:!0,sorted:0,min:ee,max:-ee},to=(e,l,s,n,o)=>o,Ms={show:!0,auto:!0,sorted:0,gaps:to,alpha:1,facets:[Me({},bs,{scale:"x"}),Me({},bs,{scale:"y"})]},Es={scale:"y",auto:!0,sorted:0,show:!0,spanGaps:!1,gaps:to,alpha:1,points:{show:kf,filter:null},values:null,min:ee,max:-ee,idxs:[],path:null,clip:null};function bf(e,l,s,n,o){return s/10}const lo={time:jo,auto:!0,distr:1,log:10,asinh:1,min:null,max:null,dir:1,ori:0},Mf=Me({},lo,{time:!1,ori:1}),Ts={};function no(e,l){let s=Ts[e];return s||(s={key:e,plots:[],sub(n){s.plots.push(n)},unsub(n){s.plots=s.plots.filter(o=>o!=n)},pub(n,o,c,u,d,m,g){for(let y=0;y<s.plots.length;y++)s.plots[y]!=o&&s.plots[y].pub(n,o,c,u,d,m,g)}},e!=null&&(Ts[e]=s)),s}const Al=1,ei=2;function ll(e,l,s){const n=e.mode,o=e.series[l],c=n==2?e._data[l]:e._data,u=e.scales,d=e.bbox;let m=c[0],g=n==2?c[1]:c[l],y=n==2?u[o.facets[0].scale]:u[e.series[0].scale],_=n==2?u[o.facets[1].scale]:u[o.scale],h=d.left,T=d.top,z=d.width,D=d.height,F=e.valToPosH,P=e.valToPosV;return y.ori==0?s(o,m,g,y,_,F,P,h,T,z,D,wn,Ll,_n,so,ro):s(o,m,g,y,_,P,F,T,h,D,z,Sn,Pl,gi,oo,fo)}function mi(e,l){let s=0,n=0,o=se(e.bands,ui);for(let c=0;c<o.length;c++){let u=o[c];u.series[0]==l?s=u.dir:u.series[1]==l&&(u.dir==1?n|=1:n|=2)}return[s,n==1?-1:n==2?1:n==3?2:0]}function Ef(e,l,s,n,o){let c=e.mode,u=e.series[l],d=c==2?u.facets[1].scale:u.scale,m=e.scales[d];return o==-1?m.min:o==1?m.max:m.distr==3?m.dir==1?m.min:m.max:0}function Dt(e,l,s,n,o,c){return ll(e,l,(u,d,m,g,y,_,h,T,z,D,F)=>{let P=u.pxRound;const H=g.dir*(g.ori==0?1:-1),k=g.ori==0?Ll:Pl;let C,E;H==1?(C=s,E=n):(C=n,E=s);let W=P(_(d[C],g,D,T)),L=P(h(m[C],y,F,z)),I=P(_(d[E],g,D,T)),B=P(h(c==1?y.max:y.min,y,F,z)),V=new Path2D(o);return k(V,I,B),k(V,W,B),k(V,W,L),V})}function gn(e,l,s,n,o,c){let u=null;if(e.length>0){u=new Path2D;const d=l==0?_n:gi;let m=s;for(let _=0;_<e.length;_++){let h=e[_];if(h[1]>h[0]){let T=h[0]-m;T>0&&d(u,m,n,T,n+c),m=h[1]}}let g=s+o-m,y=10;g>0&&d(u,m,n-y/2,g,n+c+y)}return u}function Tf(e,l,s){let n=e[e.length-1];n&&n[0]==l?n[1]=s:e.push([l,s])}function di(e,l,s,n,o,c,u){let d=[],m=e.length;for(let g=o==1?s:n;g>=s&&g<=n;g+=o)if(l[g]===null){let _=g,h=g;if(o==1)for(;++g<=n&&l[g]===null;)h=g;else for(;--g>=s&&l[g]===null;)h=g;let T=c(e[_]),z=h==_?T:c(e[h]),D=_-o;T=u<=0&&D>=0&&D<m?c(e[D]):T;let P=h+o;z=u>=0&&P>=0&&P<m?c(e[P]):z,z>=T&&d.push([T,z])}return d}function As(e){return e==0?zs:e==1?Te:l=>Zt(l,e)}function io(e){let l=e==0?wn:Sn,s=e==0?(o,c,u,d,m,g)=>{o.arcTo(c,u,d,m,g)}:(o,c,u,d,m,g)=>{o.arcTo(u,c,m,d,g)},n=e==0?(o,c,u,d,m)=>{o.rect(c,u,d,m)}:(o,c,u,d,m)=>{o.rect(u,c,m,d)};return(o,c,u,d,m,g=0,y=0)=>{g==0&&y==0?n(o,c,u,d,m):(g=ht(g,d/2,m/2),y=ht(y,d/2,m/2),l(o,c+g,u),s(o,c+d,u,c+d,u+m,g),s(o,c+d,u+m,c,u+m,y),s(o,c,u+m,c,u,y),s(o,c,u,c+d,u,g),o.closePath())}}const wn=(e,l,s)=>{e.moveTo(l,s)},Sn=(e,l,s)=>{e.moveTo(s,l)},Ll=(e,l,s)=>{e.lineTo(l,s)},Pl=(e,l,s)=>{e.lineTo(s,l)},_n=io(0),gi=io(1),so=(e,l,s,n,o,c)=>{e.arc(l,s,n,o,c)},oo=(e,l,s,n,o,c)=>{e.arc(s,l,n,o,c)},ro=(e,l,s,n,o,c,u)=>{e.bezierCurveTo(l,s,n,o,c,u)},fo=(e,l,s,n,o,c,u)=>{e.bezierCurveTo(s,l,o,n,u,c)};function uo(e){return(l,s,n,o,c)=>ll(l,s,(u,d,m,g,y,_,h,T,z,D,F)=>{let{pxRound:P,points:H}=u,k,C;g.ori==0?(k=wn,C=so):(k=Sn,C=oo);const E=he(H.width*oe,3);let W=(H.size-H.width)/2*oe,L=he(W*2,3),I=new Path2D,B=new Path2D,{left:V,top:v,width:N,height:q}=l.bbox;_n(B,V-L,v-L,N+L*2,q+L*2);const le=U=>{if(m[U]!=null){let ue=P(_(d[U],g,D,T)),Z=P(h(m[U],y,F,z));k(I,ue+W,Z),C(I,ue,Z,W,0,un*2)}};if(c)c.forEach(le);else for(let U=n;U<=o;U++)le(U);return{stroke:E>0?I:null,fill:I,clip:B,flags:Al|ei}})}function co(e){return(l,s,n,o,c,u)=>{n!=o&&(c!=n&&u!=n&&e(l,s,n),c!=o&&u!=o&&e(l,s,o),e(l,s,u))}}const Af=co(Ll),Df=co(Pl);function ao(e){const l=se(e==null?void 0:e.alignGaps,0);return(s,n,o,c)=>ll(s,n,(u,d,m,g,y,_,h,T,z,D,F)=>{let P=u.pxRound,H=O=>P(_(O,g,D,T)),k=O=>P(h(O,y,F,z)),C,E;g.ori==0?(C=Ll,E=Af):(C=Pl,E=Df);const W=g.dir*(g.ori==0?1:-1),L={stroke:new Path2D,fill:null,clip:null,band:null,gaps:null,flags:Al},I=L.stroke;let B=ee,V=-ee,v,N,q,le=H(d[W==1?o:c]),U=bl(m,o,c,1*W),ue=bl(m,o,c,-1*W),Z=H(d[U]),Ue=H(d[ue]),ve=!1;for(let O=W==1?o:c;O>=o&&O<=c;O+=W){let Se=H(d[O]),ie=m[O];Se==le?ie!=null?(N=k(ie),B==ee&&(C(I,Se,N),v=N),B=ht(N,B),V=Oe(N,V)):ie===null&&(ve=!0):(B!=ee&&(E(I,le,B,V,v,N),q=le),ie!=null?(N=k(ie),C(I,Se,N),B=V=v=N):(B=ee,V=-ee,ie===null&&(ve=!0)),le=Se)}B!=ee&&B!=V&&q!=le&&E(I,le,B,V,v,N);let[ne,fe]=mi(s,n);if(u.fill!=null||ne!=0){let O=L.fill=new Path2D(I),Se=u.fillTo(s,n,u.min,u.max,ne),ie=k(Se);C(O,Ue,ie),C(O,Z,ie)}if(!u.spanGaps){let O=[];ve&&O.push(...di(d,m,o,c,W,H,l)),L.gaps=O=u.gaps(s,n,o,c,O),L.clip=gn(O,g.ori,T,z,D,F)}return fe!=0&&(L.band=fe==2?[Dt(s,n,o,c,I,-1),Dt(s,n,o,c,I,1)]:Dt(s,n,o,c,I,fe)),L})}function Lf(e){const l=se(e.align,1),s=se(e.ascDesc,!1),n=se(e.alignGaps,0),o=se(e.extend,!1);return(c,u,d,m)=>ll(c,u,(g,y,_,h,T,z,D,F,P,H,k)=>{let C=g.pxRound,{left:E,width:W}=c.bbox,L=ne=>C(z(ne,h,H,F)),I=ne=>C(D(ne,T,k,P)),B=h.ori==0?Ll:Pl;const V={stroke:new Path2D,fill:null,clip:null,band:null,gaps:null,flags:Al},v=V.stroke,N=h.dir*(h.ori==0?1:-1);d=bl(_,d,m,1),m=bl(_,d,m,-1);let q=I(_[N==1?d:m]),le=L(y[N==1?d:m]),U=le,ue=le;o&&l==-1&&(ue=E,B(v,ue,q)),B(v,le,q);for(let ne=N==1?d:m;ne>=d&&ne<=m;ne+=N){let fe=_[ne];if(fe==null)continue;let O=L(y[ne]),Se=I(fe);l==1?B(v,O,q):B(v,U,Se),B(v,O,Se),q=Se,U=O}let Z=U;o&&l==1&&(Z=E+W,B(v,Z,q));let[Ue,ve]=mi(c,u);if(g.fill!=null||Ue!=0){let ne=V.fill=new Path2D(v),fe=g.fillTo(c,u,g.min,g.max,Ue),O=I(fe);B(ne,Z,O),B(ne,ue,O)}if(!g.spanGaps){let ne=[];ne.push(...di(y,_,d,m,N,L,n));let fe=g.width*oe/2,O=s||l==1?fe:-fe,Se=s||l==-1?-fe:fe;ne.forEach(ie=>{ie[0]+=O,ie[1]+=Se}),V.gaps=ne=g.gaps(c,u,d,m,ne),V.clip=gn(ne,h.ori,F,P,H,k)}return ve!=0&&(V.band=ve==2?[Dt(c,u,d,m,v,-1),Dt(c,u,d,m,v,1)]:Dt(c,u,d,m,v,ve)),V})}function Ds(e,l,s,n,o,c,u=ee){if(e.length>1){let d=null;for(let m=0,g=1/0;m<e.length;m++)if(l[m]!==void 0){if(d!=null){let y=Ae(e[m]-e[d]);y<g&&(g=y,u=Ae(s(e[m],n,o,c)-s(e[d],n,o,c)))}d=m}}return u}function Pf(e){e=e||$l;const l=se(e.size,[.6,ee,1]),s=e.align||0,n=e.gap||0;let o=e.radius;o=o==null?[0,0]:typeof o=="number"?[o,0]:o;const c=X(o),u=1-l[0],d=se(l[1],ee),m=se(l[2],1),g=se(e.disp,$l),y=se(e.each,T=>{}),{fill:_,stroke:h}=g;return(T,z,D,F)=>ll(T,z,(P,H,k,C,E,W,L,I,B,V,v)=>{let N=P.pxRound,q=s,le=n*oe,U=d*oe,ue=m*oe,Z,Ue;C.ori==0?[Z,Ue]=c(T,z):[Ue,Z]=c(T,z);const ve=C.dir*(C.ori==0?1:-1);let ne=C.ori==0?_n:gi,fe=C.ori==0?y:($,Ge,Ct,Ut,Rt,qe,pt)=>{y($,Ge,Ct,Rt,Ut,pt,qe)},O=se(T.bands,ui).find($=>$.series[0]==z),Se=O!=null?O.dir:0,ie=P.fillTo(T,z,P.min,P.max,Se),Ke=N(L(ie,E,v,B)),Cl,Ee,$e,nt=V,ye=N(P.width*oe),je=!1,Lt=null,nl=null,Yt=null,il=null;_!=null&&(ye==0||h!=null)&&(je=!0,Lt=_.values(T,z,D,F),nl=new Map,new Set(Lt).forEach($=>{$!=null&&nl.set($,new Path2D)}),ye>0&&(Yt=h.values(T,z,D,F),il=new Map,new Set(Yt).forEach($=>{$!=null&&il.set($,new Path2D)})));let{x0:Rl,size:Mt}=g;if(Rl!=null&&Mt!=null){q=1,H=Rl.values(T,z,D,F),Rl.unit==2&&(H=H.map(Ct=>T.posToVal(I+Ct*V,C.key,!0)));let $=Mt.values(T,z,D,F);Mt.unit==2?Ee=$[0]*V:Ee=W($[0],C,V,I)-W(0,C,V,I),nt=Ds(H,k,W,C,V,I,nt),$e=nt-Ee+le}else nt=Ds(H,k,W,C,V,I,nt),$e=nt*u+le,Ee=nt-$e;$e<1&&($e=0),ye>=Ee/2&&(ye=0),$e<5&&(N=zs);let it=$e>0,ql=nt-$e-(it?ye:0);Ee=N(Zn(ql,ue,U)),Cl=(q==0?Ee/2:q==ve?0:Ee)-q*ve*((q==0?le/2:0)+(it?ye/2:0));const _t={stroke:null,fill:null,clip:null,band:null,gaps:null,flags:0},Pt=je?null:new Path2D;let K=null;if(O!=null)K=T.data[O.series[1]];else{let{y0:$,y1:Ge}=g;$!=null&&Ge!=null&&(k=Ge.values(T,z,D,F),K=$.values(T,z,D,F))}let J=Z*Ee,He=Ue*Ee;for(let $=ve==1?D:F;$>=D&&$<=F;$+=ve){let Ge=k[$];if(Ge==null)continue;if(K!=null){let yt=K[$]??0;if(Ge-yt==0)continue;Ke=L(yt,E,v,B)}let Ct=C.distr!=2||g!=null?H[$]:$,Ut=W(Ct,C,V,I),Rt=L(se(Ge,ie),E,v,B),qe=N(Ut-Cl),pt=N(Oe(Rt,Ke)),Qe=N(ht(Rt,Ke)),st=pt-Qe;if(Ge!=null){let yt=Ge<0?He:J,zt=Ge<0?J:He;je?(ye>0&&Yt[$]!=null&&ne(il.get(Yt[$]),qe,Qe+tt(ye/2),Ee,Oe(0,st-ye),yt,zt),Lt[$]!=null&&ne(nl.get(Lt[$]),qe,Qe+tt(ye/2),Ee,Oe(0,st-ye),yt,zt)):ne(Pt,qe,Qe+tt(ye/2),Ee,Oe(0,st-ye),yt,zt),fe(T,z,$,qe-ye/2,Qe,Ee+ye,st)}}return ye>0?_t.stroke=je?il:Pt:je||(_t._fill=P.width==0?P._fill:P._stroke??P._fill,_t.width=0),_t.fill=je?nl:Pt,_t})}function Cf(e,l){const s=se(l==null?void 0:l.alignGaps,0);return(n,o,c,u)=>ll(n,o,(d,m,g,y,_,h,T,z,D,F,P)=>{let H=d.pxRound,k=Z=>H(h(Z,y,F,z)),C=Z=>H(T(Z,_,P,D)),E,W,L;y.ori==0?(E=wn,L=Ll,W=ro):(E=Sn,L=Pl,W=fo);const I=y.dir*(y.ori==0?1:-1);c=bl(g,c,u,1),u=bl(g,c,u,-1);let B=k(m[I==1?c:u]),V=B,v=[],N=[];for(let Z=I==1?c:u;Z>=c&&Z<=u;Z+=I)if(g[Z]!=null){let ve=m[Z],ne=k(ve);v.push(V=ne),N.push(C(g[Z]))}const q={stroke:e(v,N,E,L,W,H),fill:null,clip:null,band:null,gaps:null,flags:Al},le=q.stroke;let[U,ue]=mi(n,o);if(d.fill!=null||U!=0){let Z=q.fill=new Path2D(le),Ue=d.fillTo(n,o,d.min,d.max,U),ve=C(Ue);L(Z,V,ve),L(Z,B,ve)}if(!d.spanGaps){let Z=[];Z.push(...di(m,g,c,u,I,k,s)),q.gaps=Z=d.gaps(n,o,c,u,Z),q.clip=gn(Z,y.ori,z,D,F,P)}return ue!=0&&(q.band=ue==2?[Dt(n,o,c,u,le,-1),Dt(n,o,c,u,le,1)]:Dt(n,o,c,u,le,ue)),q})}function Rf(e){return Cf(zf,e)}function zf(e,l,s,n,o,c){const u=e.length;if(u<2)return null;const d=new Path2D;if(s(d,e[0],l[0]),u==2)n(d,e[1],l[1]);else{let m=Array(u),g=Array(u-1),y=Array(u-1),_=Array(u-1);for(let h=0;h<u-1;h++)y[h]=l[h+1]-l[h],_[h]=e[h+1]-e[h],g[h]=y[h]/_[h];m[0]=g[0];for(let h=1;h<u-1;h++)g[h]===0||g[h-1]===0||g[h-1]>0!=g[h]>0?m[h]=0:(m[h]=3*(_[h-1]+_[h])/((2*_[h]+_[h-1])/g[h-1]+(_[h]+2*_[h-1])/g[h]),isFinite(m[h])||(m[h]=0));m[u-1]=g[u-2];for(let h=0;h<u-1;h++)o(d,e[h]+_[h]/3,l[h]+m[h]*_[h]/3,e[h+1]-_[h]/3,l[h+1]-m[h+1]*_[h]/3,e[h+1],l[h+1])}return d}const ti=new Set;function Ls(){for(let e of ti)e.syncRect(!0)}Dl&&(el(pr,kl,Ls),el(mr,kl,Ls,!0),el(cn,kl,()=>{We.pxRatio=oe}));const Vf=ao(),Ff=uo();function Ps(e,l,s,n){return(n?[e[0],e[1]].concat(e.slice(2)):[e[0]].concat(e.slice(1))).map((c,u)=>li(c,u,l,s))}function Hf(e,l){return e.map((s,n)=>n==0?{}:Me({},l,s))}function li(e,l,s,n){return Me({},l==0?s:n,e)}function ho(e,l,s){return l==null?El:[l,s]}const Nf=ho;function Of(e,l,s){return l==null?El:an(l,s,ri,!0)}function po(e,l,s,n){return l==null?El:pn(l,s,e.scales[n].log,!1)}const Wf=po;function mo(e,l,s,n){return l==null?El:oi(l,s,e.scales[n].log,!1)}const Gf=mo;function If(e,l,s,n,o){let c=Oe(us(e),us(l)),u=l-e,d=St(o/n*u,s);do{let m=s[d],g=n*m/u;if(g>=o&&c+(m<5?Bt.get(m):0)<=17)return[m,g]}while(++d<s.length);return[0,0]}function Cs(e){let l,s;return e=e.replace(/(\d+)px/,(n,o)=>(l=Te((s=+o)*oe))+"px"),[e,l,s]}function Bf(e){e.show&&[e.font,e.labelFont].forEach(l=>{let s=he(l[2]*oe,1);l[0]=l[0].replace(/[0-9.]+px/,s+"px"),l[1]=s})}function We(e,l,s){const n={mode:se(e.mode,1)},o=n.mode;function c(t,i){return((i.distr==3?At(t>0?t:i.clamp(n,t,i.min,i.max,i.key)):i.distr==4?Bn(t,i.asinh):i.distr==100?i.fwd(t):t)-i._min)/(i._max-i._min)}function u(t,i,r,f){let a=c(t,i);return f+r*(i.dir==-1?1-a:a)}function d(t,i,r,f){let a=c(t,i);return f+r*(i.dir==-1?a:1-a)}function m(t,i,r,f){return i.ori==0?u(t,i,r,f):d(t,i,r,f)}n.valToPosH=u,n.valToPosV=d;let g=!1;n.status=0;const y=n.root=ct(qo);if(e.id!=null&&(y.id=e.id),et(y,e.class),e.title){let t=ct(Qo,y);t.textContent=e.title}const _=wt("canvas"),h=n.ctx=_.getContext("2d"),T=ct(Xo,y);el("click",T,t=>{t.target===D&&(pe!=dl||we!=gl)&&Fe.click(n,t)},!0);const z=n.under=ct(er,T);T.appendChild(_);const D=n.over=ct(tr,T);e=Tl(e);const F=+se(e.pxAlign,1),P=As(F);(e.plugins||[]).forEach(t=>{t.opts&&(e=t.opts(n,e)||e)});const H=e.ms||.001,k=n.series=o==1?Ps(e.series||[],xs,Es,!1):Hf(e.series||[null],Ms),C=n.axes=Ps(e.axes||[],ys,ks,!0),E=n.scales={},W=n.bands=e.bands||[];W.forEach(t=>{t.fill=X(t.fill||null),t.dir=se(t.dir,-1)});const L=o==2?k[1].facets[0].scale:k[0].scale,I={axes:Po,series:Eo},B=(e.drawOrder||["axes","series"]).map(t=>I[t]);function V(t){let i=E[t];if(i==null){let r=(e.scales||$l)[t]||$l;if(r.from!=null)V(r.from),E[t]=Me({},E[r.from],r,{key:t});else{i=E[t]=Me({},t==L?lo:Mf,r),i.key=t;let f=i.time,a=i.range,p=It(a);if((t!=L||o==2&&!f)&&(p&&(a[0]==null||a[1]==null)&&(a={min:a[0]==null?os:{mode:1,hard:a[0],soft:a[0]},max:a[1]==null?os:{mode:1,hard:a[1],soft:a[1]}},p=!1),!p&&dn(a))){let w=a;a=(S,x,b)=>x==null?El:an(x,b,w)}i.range=X(a||(f?Nf:t==L?i.distr==3?Wf:i.distr==4?Gf:ho:i.distr==3?po:i.distr==4?mo:Of)),i.auto=X(p?!1:i.auto),i.clamp=X(i.clamp||bf),i._min=i._max=null}}}V("x"),V("y"),o==1&&k.forEach(t=>{V(t.scale)}),C.forEach(t=>{V(t.scale)});for(let t in e.scales)V(t);const v=E[L],N=v.distr;let q,le;v.ori==0?(et(y,Jo),q=u,le=d):(et(y,Zo),q=d,le=u);const U={};for(let t in E){let i=E[t];(i.min!=null||i.max!=null)&&(U[t]={min:i.min,max:i.max},i.min=i.max=null)}const ue=e.tzDate||(t=>new Date(Te(t/H))),Z=e.fmtDate||ci,Ue=H==1?Jr(ue):Xr(ue),ve=ws(ue,gs(H==1?qr:Qr,Z)),ne=_s(ue,Ss(tf,Z)),fe=[],O=n.legend=Me({},sf,e.legend),Se=O.show,ie=O.markers;O.idxs=fe,ie.width=X(ie.width),ie.dash=X(ie.dash),ie.stroke=X(ie.stroke),ie.fill=X(ie.fill);let Ke,Cl,Ee,$e=[],nt=[],ye,je=!1,Lt={};if(O.live){const t=k[1]?k[1].values:null;je=t!=null,ye=je?t(n,1,0):{_:0};for(let i in ye)Lt[i]=ii}if(Se)if(Ke=wt("table",rr,y),Ee=wt("tbody",null,Ke),O.mount(n,Ke),je){Cl=wt("thead",null,Ke,Ee);let t=wt("tr",null,Cl);wt("th",null,t);for(var nl in ye)wt("th",Ki,t).textContent=nl}else et(Ke,ur),O.live&&et(Ke,fr);const Yt={show:!0},il={show:!1};function Rl(t,i){if(i==0&&(je||!O.live||o==2))return El;let r=[],f=wt("tr",cr,Ee,Ee.childNodes[i]);et(f,t.class),t.show||et(f,Xt);let a=wt("th",null,f);if(ie.show){let S=ct(ar,a);if(i>0){let x=ie.width(n,i);x&&(S.style.border=x+"px "+ie.dash(n,i)+" "+ie.stroke(n,i)),S.style.background=ie.fill(n,i)}}let p=ct(Ki,a);p.textContent=t.label,i>0&&(ie.show||(p.style.color=t.width>0?ie.stroke(n,i):ie.fill(n,i)),it("click",a,S=>{if(G._lock)return;$t(S);let x=k.indexOf(t);if((S.ctrlKey||S.metaKey)!=O.isolate){let b=k.some((M,A)=>A>0&&A!=x&&M.show);k.forEach((M,A)=>{A>0&&xt(A,b?A==x?Yt:il:Yt,!0,ke.setSeries)})}else xt(x,{show:!t.show},!0,ke.setSeries)},!1),ol&&it(Zi,a,S=>{G._lock||($t(S),xt(k.indexOf(t),Sl,!0,ke.setSeries))},!1));for(var w in ye){let S=wt("td",hr,f);S.textContent="--",r.push(S)}return[f,r]}const Mt=new Map;function it(t,i,r,f=!0){const a=Mt.get(i)||{},p=G.bind[t](n,i,r,f);p&&(el(t,i,a[t]=p),Mt.set(i,a))}function ql(t,i,r){const f=Mt.get(i)||{};for(let a in f)(t==null||a==t)&&(Jn(a,i,f[a]),delete f[a]);t==null&&Mt.delete(i)}let _t=0,Pt=0,K=0,J=0,He=0,$=0,Ge=He,Ct=$,Ut=K,Rt=J,qe=0,pt=0,Qe=0,st=0;n.bbox={};let yt=!1,zt=!1,sl=!1,Kt=!1,Jl=!1,ot=!1;function yn(t,i,r){(r||t!=n.width||i!=n.height)&&wi(t,i),al(!1),sl=!0,zt=!0,hl()}function wi(t,i){n.width=_t=K=t,n.height=Pt=J=i,He=$=0,_o(),yo();let r=n.bbox;qe=r.left=Zt(He*oe,.5),pt=r.top=Zt($*oe,.5),Qe=r.width=Zt(K*oe,.5),st=r.height=Zt(J*oe,.5)}const go=3;function wo(){let t=!1,i=0;for(;!t;){i++;let r=Do(i),f=Lo(i);t=i==go||r&&f,t||(wi(n.width,n.height),zt=!0)}}function So({width:t,height:i}){yn(t,i)}n.setSize=So;function _o(){let t=!1,i=!1,r=!1,f=!1;C.forEach((a,p)=>{if(a.show&&a._show){let{side:w,_size:S}=a,x=w%2,b=a.label!=null?a.labelSize:0,M=S+b;M>0&&(x?(K-=M,w==3?(He+=M,f=!0):r=!0):(J-=M,w==0?($+=M,t=!0):i=!0))}}),jt[0]=t,jt[1]=r,jt[2]=i,jt[3]=f,K-=Ft[1]+Ft[3],He+=Ft[3],J-=Ft[2]+Ft[0],$+=Ft[0]}function yo(){let t=He+K,i=$+J,r=He,f=$;function a(p,w){switch(p){case 1:return t+=w,t-w;case 2:return i+=w,i-w;case 3:return r-=w,r+w;case 0:return f-=w,f+w}}C.forEach((p,w)=>{if(p.show&&p._show){let S=p.side;p._pos=a(S,p._size),p.label!=null&&(p._lpos=a(S,p.labelSize))}})}const G=n.cursor=Me({},af,{drag:{y:o==2}},e.cursor);if(G.dataIdx==null){let t=G.hover,i=t.skip=new Set(t.skip??[]);i.add(void 0);let r=t.prox=X(t.prox),f=t.bias??(t.bias=0);G.dataIdx=(a,p,w,S)=>{if(p==0)return w;let x=w,b=r(a,p,w,S)??ee,M=b>=0&&b<ee,A=v.ori==0?K:J,Y=G.left,ae=l[0],te=l[p];if(i.has(te[w])){x=null;let Q=null,j=null,R;if(f==0||f==-1)for(R=w;Q==null&&R-- >0;)i.has(te[R])||(Q=R);if(f==0||f==1)for(R=w;j==null&&R++<te.length;)i.has(te[R])||(j=R);if(Q!=null||j!=null)if(M){let ce=Q==null?-1/0:q(ae[Q],v,A,0),xe=j==null?1/0:q(ae[j],v,A,0),_e=Y-ce,de=xe-Y;_e<=de?_e<=b&&(x=Q):de<=b&&(x=j)}else x=j==null?Q:Q==null?j:w-Q<=j-w?Q:j}else M&&Ae(Y-q(ae[w],v,A,0))>b&&(x=null);return x}}const $t=t=>{G.event=t};G.idxs=fe,G._lock=!1;let Ne=G.points;Ne.show=X(Ne.show),Ne.size=X(Ne.size),Ne.stroke=X(Ne.stroke),Ne.width=X(Ne.width),Ne.fill=X(Ne.fill);const Vt=n.focus=Me({},e.focus||{alpha:.3},G.focus),ol=Vt.prox>=0,rl=ol&&Ne.one;let rt=[],fl=[],ul=[];function Si(t,i){let r=Ne.show(n,i);if(r)return et(r,or),et(r,t.class),bt(r,-10,-10,K,J),D.insertBefore(r,rt[i]),r}function _i(t,i){if(o==1||i>0){let r=o==1&&E[t.scale].time,f=t.value;t.value=r?hs(f)?_s(ue,Ss(f,Z)):f||ne:f||xf,t.label=t.label||(r?pf:hf)}if(rl||i>0){t.width=t.width==null?1:t.width,t.paths=t.paths||Vf||br,t.fillTo=X(t.fillTo||Ef),t.pxAlign=+se(t.pxAlign,F),t.pxRound=As(t.pxAlign),t.stroke=X(t.stroke||null),t.fill=X(t.fill||null),t._stroke=t._fill=t._paths=t._focus=null;let r=vf(Oe(1,t.width),1),f=t.points=Me({},{size:r,width:Oe(1,r*.2),stroke:t.stroke,space:r*2,paths:Ff,_stroke:null,_fill:null},t.points);f.show=X(f.show),f.filter=X(f.filter),f.fill=X(f.fill),f.stroke=X(f.stroke),f.paths=X(f.paths),f.pxAlign=t.pxAlign}if(Se){let r=Rl(t,i);$e.splice(i,0,r[0]),nt.splice(i,0,r[1]),O.values.push(null)}if(G.show){fe.splice(i,0,null);let r=null;rl?i==0&&(r=Si(t,i)):i>0&&(r=Si(t,i)),rt.splice(i,0,r),fl.splice(i,0,0),ul.splice(i,0,0)}ze("addSeries",i)}function xo(t,i){i=i??k.length,t=o==1?li(t,i,xs,Es):li(t,i,{},Ms),k.splice(i,0,t),_i(k[i],i)}n.addSeries=xo;function vo(t){if(k.splice(t,1),Se){O.values.splice(t,1),nt.splice(t,1);let i=$e.splice(t,1)[0];ql(null,i.firstChild),i.remove()}G.show&&(fe.splice(t,1),rt.splice(t,1)[0].remove(),fl.splice(t,1),ul.splice(t,1)),ze("delSeries",t)}n.delSeries=vo;const jt=[!1,!1,!1,!1];function ko(t,i){if(t._show=t.show,t.show){let r=t.side%2,f=E[t.scale];f==null&&(t.scale=r?k[1].scale:L,f=E[t.scale]);let a=f.time;t.size=X(t.size),t.space=X(t.space),t.rotate=X(t.rotate),It(t.incrs)&&t.incrs.forEach(w=>{!Bt.has(w)&&Bt.set(w,Hs(w))}),t.incrs=X(t.incrs||(f.distr==2?Kr:a?H==1?jr:Zr:Qt)),t.splits=X(t.splits||(a&&f.distr==1?Ue:f.distr==3?Qn:f.distr==4?gf:df)),t.stroke=X(t.stroke),t.grid.stroke=X(t.grid.stroke),t.ticks.stroke=X(t.ticks.stroke),t.border.stroke=X(t.border.stroke);let p=t.values;t.values=It(p)&&!It(p[0])?X(p):a?It(p)?ws(ue,gs(p,Z)):hs(p)?ef(ue,p):p||ve:p||mf,t.filter=X(t.filter||(f.distr>=3&&f.log==10?_f:f.distr==3&&f.log==2?yf:Vs)),t.font=Cs(t.font),t.labelFont=Cs(t.labelFont),t._size=t.size(n,null,i,0),t._space=t._rotate=t._incrs=t._found=t._splits=t._values=null,t._size>0&&(jt[i]=!0,t._el=ct(lr,T))}}function zl(t,i,r,f){let[a,p,w,S]=r,x=i%2,b=0;return x==0&&(S||p)&&(b=i==0&&!a||i==2&&!w?Te(ys.size/3):0),x==1&&(a||w)&&(b=i==1&&!p||i==3&&!S?Te(ks.size/2):0),b}const yi=n.padding=(e.padding||[zl,zl,zl,zl]).map(t=>X(se(t,zl))),Ft=n._padding=yi.map((t,i)=>t(n,i,jt,0));let Ve,Le=null,Pe=null;const Zl=o==1?k[0].idxs:null;let mt=null,Vl=!1;function xi(t,i){if(l=t??[],n.data=n._data=l,o==2){Ve=0;for(let r=1;r<k.length;r++)Ve+=l[r][0].length}else{l.length==0&&(n.data=n._data=l=[[]]),mt=l[0],Ve=mt.length;let r=l;if(N==2){r=l.slice();let f=r[0]=Array(Ve);for(let a=0;a<Ve;a++)f[a]=a}n._data=l=r}if(al(!0),ze("setData"),N==2&&(sl=!0),i!==!1){let r=v;r.auto(n,Vl)?xn():Nt(L,r.min,r.max),Kt=Kt||G.left>=0,ot=!0,hl()}}n.setData=xi;function xn(){Vl=!0;let t,i;o==1&&(Ve>0?(Le=Zl[0]=0,Pe=Zl[1]=Ve-1,t=l[0][Le],i=l[0][Pe],N==2?(t=Le,i=Pe):t==i&&(N==3?[t,i]=pn(t,t,v.log,!1):N==4?[t,i]=oi(t,t,v.log,!1):v.time?i=t+Te(86400/H):[t,i]=an(t,i,ri,!0))):(Le=Zl[0]=t=null,Pe=Zl[1]=i=null)),Nt(L,t,i)}let Ql,cl,vn,kn,bn,Mn,En,Tn,An,Et;function vi(t,i,r,f,a,p){t??(t=ji),r??(r=ui),f??(f="butt"),a??(a=ji),p??(p="round"),t!=Ql&&(h.strokeStyle=Ql=t),a!=cl&&(h.fillStyle=cl=a),i!=vn&&(h.lineWidth=vn=i),p!=bn&&(h.lineJoin=bn=p),f!=Mn&&(h.lineCap=Mn=f),r!=kn&&h.setLineDash(kn=r)}function ki(t,i,r,f){i!=cl&&(h.fillStyle=cl=i),t!=En&&(h.font=En=t),r!=Tn&&(h.textAlign=Tn=r),f!=An&&(h.textBaseline=An=f)}function Dn(t,i,r,f,a=0){if(f.length>0&&t.auto(n,Vl)&&(i==null||i.min==null)){let p=se(Le,0),w=se(Pe,f.length-1),S=r.min==null?t.distr==3?Sr(f,p,w):wr(f,p,w,a):[r.min,r.max];t.min=ht(t.min,r.min=S[0]),t.max=Oe(t.max,r.max=S[1])}}const bi={min:null,max:null};function bo(){for(let f in E){let a=E[f];U[f]==null&&(a.min==null||U[L]!=null&&a.auto(n,Vl))&&(U[f]=bi)}for(let f in E){let a=E[f];U[f]==null&&a.from!=null&&U[a.from]!=null&&(U[f]=bi)}U[L]!=null&&al(!0);let t={};for(let f in U){let a=U[f];if(a!=null){let p=t[f]=Tl(E[f],Tr);if(a.min!=null)Me(p,a);else if(f!=L||o==2)if(Ve==0&&p.from==null){let w=p.range(n,null,null,f);p.min=w[0],p.max=w[1]}else p.min=ee,p.max=-ee}}if(Ve>0){k.forEach((f,a)=>{if(o==1){let p=f.scale,w=U[p];if(w==null)return;let S=t[p];if(a==0){let x=S.range(n,S.min,S.max,p);S.min=x[0],S.max=x[1],Le=St(S.min,l[0]),Pe=St(S.max,l[0]),Pe-Le>1&&(l[0][Le]<S.min&&Le++,l[0][Pe]>S.max&&Pe--),f.min=mt[Le],f.max=mt[Pe]}else f.show&&f.auto&&Dn(S,w,f,l[a],f.sorted);f.idxs[0]=Le,f.idxs[1]=Pe}else if(a>0&&f.show&&f.auto){let[p,w]=f.facets,S=p.scale,x=w.scale,[b,M]=l[a],A=t[S],Y=t[x];A!=null&&Dn(A,U[S],p,b,p.sorted),Y!=null&&Dn(Y,U[x],w,M,w.sorted),f.min=w.min,f.max=w.max}});for(let f in t){let a=t[f],p=U[f];if(a.from==null&&(p==null||p.min==null)){let w=a.range(n,a.min==ee?null:a.min,a.max==-ee?null:a.max,f);a.min=w[0],a.max=w[1]}}}for(let f in t){let a=t[f];if(a.from!=null){let p=t[a.from];if(p.min==null)a.min=a.max=null;else{let w=a.range(n,p.min,p.max,f);a.min=w[0],a.max=w[1]}}}let i={},r=!1;for(let f in t){let a=t[f],p=E[f];if(p.min!=a.min||p.max!=a.max){p.min=a.min,p.max=a.max;let w=p.distr;p._min=w==3?At(p.min):w==4?Bn(p.min,p.asinh):w==100?p.fwd(p.min):p.min,p._max=w==3?At(p.max):w==4?Bn(p.max,p.asinh):w==100?p.fwd(p.max):p.max,i[f]=r=!0}}if(r){k.forEach((f,a)=>{o==2?a>0&&i.y&&(f._paths=null):i[f.scale]&&(f._paths=null)});for(let f in i)sl=!0,ze("setScale",f);G.show&&G.left>=0&&(Kt=ot=!0)}for(let f in U)U[f]=null}function Mo(t){let i=Zn(Le-1,0,Ve-1),r=Zn(Pe+1,0,Ve-1);for(;t[i]==null&&i>0;)i--;for(;t[r]==null&&r<Ve-1;)r++;return[i,r]}function Eo(){Ve>0&&(k.forEach((t,i)=>{if(i>0&&t.show&&(Mi(i,!1),Mi(i,!0),t._paths==null)){Et!=t.alpha&&(h.globalAlpha=Et=t.alpha);let r=o==2?[0,l[i][0].length-1]:Mo(l[i]);t._paths=t.paths(n,i,r[0],r[1]),Et!=1&&(h.globalAlpha=Et=1)}}),k.forEach((t,i)=>{if(i>0&&t.show){Et!=t.alpha&&(h.globalAlpha=Et=t.alpha),t._paths!=null&&Ei(i,!1);{let r=t._paths!=null?t._paths.gaps:null,f=t.points.show(n,i,Le,Pe,r),a=t.points.filter(n,i,f,r);(f||a)&&(t.points._paths=t.points.paths(n,i,Le,Pe,a),Ei(i,!0))}Et!=1&&(h.globalAlpha=Et=1),ze("drawSeries",i)}}))}function Mi(t,i){let r=i?k[t].points:k[t];r._stroke=r.stroke(n,t),r._fill=r.fill(n,t)}function Ei(t,i){let r=i?k[t].points:k[t],{stroke:f,fill:a,clip:p,flags:w,_stroke:S=r._stroke,_fill:x=r._fill,_width:b=r.width}=r._paths;b=he(b*oe,3);let M=null,A=b%2/2;i&&x==null&&(x=b>0?"#fff":S);let Y=r.pxAlign==1&&A>0;if(Y&&h.translate(A,A),!i){let ae=qe-b/2,te=pt-b/2,Q=Qe+b,j=st+b;M=new Path2D,M.rect(ae,te,Q,j)}i?Ln(S,b,r.dash,r.cap,x,f,a,w,p):To(t,S,b,r.dash,r.cap,x,f,a,w,M,p),Y&&h.translate(-A,-A)}function To(t,i,r,f,a,p,w,S,x,b,M){let A=!1;x!=0&&W.forEach((Y,ae)=>{if(Y.series[0]==t){let te=k[Y.series[1]],Q=l[Y.series[1]],j=(te._paths||$l).band;It(j)&&(j=Y.dir==1?j[0]:j[1]);let R,ce=null;te.show&&j&&yr(Q,Le,Pe)?(ce=Y.fill(n,ae)||p,R=te._paths.clip):j=null,Ln(i,r,f,a,ce,w,S,x,b,M,R,j),A=!0}}),A||Ln(i,r,f,a,p,w,S,x,b,M)}const Ti=Al|ei;function Ln(t,i,r,f,a,p,w,S,x,b,M,A){vi(t,i,r,f,a),(x||b||A)&&(h.save(),x&&h.clip(x),b&&h.clip(b)),A?(S&Ti)==Ti?(h.clip(A),M&&h.clip(M),en(a,w),Xl(t,p,i)):S&ei?(en(a,w),h.clip(A),Xl(t,p,i)):S&Al&&(h.save(),h.clip(A),M&&h.clip(M),en(a,w),h.restore(),Xl(t,p,i)):(en(a,w),Xl(t,p,i)),(x||b||A)&&h.restore()}function Xl(t,i,r){r>0&&(i instanceof Map?i.forEach((f,a)=>{h.strokeStyle=Ql=a,h.stroke(f)}):i!=null&&t&&h.stroke(i))}function en(t,i){i instanceof Map?i.forEach((r,f)=>{h.fillStyle=cl=f,h.fill(r)}):i!=null&&t&&h.fill(i)}function Ao(t,i,r,f){let a=C[t],p;if(f<=0)p=[0,0];else{let w=a._space=a.space(n,t,i,r,f),S=a._incrs=a.incrs(n,t,i,r,f,w);p=If(i,r,S,f,w)}return a._found=p}function Pn(t,i,r,f,a,p,w,S,x,b){let M=w%2/2;F==1&&h.translate(M,M),vi(S,w,x,b,S),h.beginPath();let A,Y,ae,te,Q=a+(f==0||f==3?-p:p);r==0?(Y=a,te=Q):(A=a,ae=Q);for(let j=0;j<t.length;j++)i[j]!=null&&(r==0?A=ae=t[j]:Y=te=t[j],h.moveTo(A,Y),h.lineTo(ae,te));h.stroke(),F==1&&h.translate(-M,-M)}function Do(t){let i=!0;return C.forEach((r,f)=>{if(!r.show)return;let a=E[r.scale];if(a.min==null){r._show&&(i=!1,r._show=!1,al(!1));return}else r._show||(i=!1,r._show=!0,al(!1));let p=r.side,w=p%2,{min:S,max:x}=a,[b,M]=Ao(f,S,x,w==0?K:J);if(M==0)return;let A=a.distr==2,Y=r._splits=r.splits(n,f,S,x,b,M,A),ae=a.distr==2?Y.map(R=>mt[R]):Y,te=a.distr==2?mt[Y[1]]-mt[Y[0]]:b,Q=r._values=r.values(n,r.filter(n,ae,f,M,te),f,M,te);r._rotate=p==2?r.rotate(n,Q,f,M):0;let j=r._size;r._size=at(r.size(n,Q,f,t)),j!=null&&r._size!=j&&(i=!1)}),i}function Lo(t){let i=!0;return yi.forEach((r,f)=>{let a=r(n,f,jt,t);a!=Ft[f]&&(i=!1),Ft[f]=a}),i}function Po(){for(let t=0;t<C.length;t++){let i=C[t];if(!i.show||!i._show)continue;let r=i.side,f=r%2,a,p,w=i.stroke(n,t),S=r==0||r==3?-1:1;if(i.label){let Ye=i.labelGap*S,Xe=Te((i._lpos+Ye)*oe);ki(i.labelFont[0],w,"center",r==2?Gl:$i),h.save(),f==1?(a=p=0,h.translate(Xe,Te(pt+st/2)),h.rotate((r==3?-un:un)/2)):(a=Te(qe+Qe/2),p=Xe),h.fillText(i.label,a,p),h.restore()}let[x,b]=i._found;if(b==0)continue;let M=E[i.scale],A=f==0?Qe:st,Y=f==0?qe:pt,ae=Te(i.gap*oe),te=i._splits,Q=M.distr==2?te.map(Ye=>mt[Ye]):te,j=M.distr==2?mt[te[1]]-mt[te[0]]:x,R=i.ticks,ce=i.border,xe=R.show?Te(R.size*oe):0,_e=i._rotate*-un/180,de=P(i._pos*oe),be=(xe+ae)*S,Je=de+be;p=f==0?Je:0,a=f==1?Je:0;let Ze=i.font[0],ft=i.align==1?xl:i.align==2?Gn:_e>0?xl:_e<0?Gn:f==0?"center":r==3?Gn:xl,dt=_e||f==1?"middle":r==2?Gl:$i;ki(Ze,w,ft,dt);let gt=i.font[1]*i.lineGap,Ie=te.map(Ye=>P(m(Ye,M,A,Y))),kt=i._values;for(let Ye=0;Ye<kt.length;Ye++){let Xe=kt[Ye];if(Xe!=null){f==0?a=Ie[Ye]:p=Ie[Ye],Xe=""+Xe;let yl=Xe.indexOf(`
`)==-1?[Xe]:Xe.split(/\n/gm);for(let Gt=0;Gt<yl.length;Gt++){let ut=yl[Gt];_e?(h.save(),h.translate(a,p+Gt*gt),h.rotate(_e),h.fillText(ut,0,0),h.restore()):h.fillText(ut,a,p+Gt*gt)}}}R.show&&Pn(Ie,R.filter(n,Q,t,b,j),f,r,de,xe,he(R.width*oe,3),R.stroke(n,t),R.dash,R.cap);let Be=i.grid;Be.show&&Pn(Ie,Be.filter(n,Q,t,b,j),f,f==0?2:1,f==0?pt:qe,f==0?st:Qe,he(Be.width*oe,3),Be.stroke(n,t),Be.dash,Be.cap),ce.show&&Pn([de],[1],f==0?1:0,f==0?1:2,f==1?pt:qe,f==1?st:Qe,he(ce.width*oe,3),ce.stroke(n,t),ce.dash,ce.cap)}ze("drawAxes")}function al(t){k.forEach((i,r)=>{r>0&&(i._paths=null,t&&(o==1?(i.min=null,i.max=null):i.facets.forEach(f=>{f.min=null,f.max=null})))})}let tn=!1,Cn=!1,Fl=[];function Co(){Cn=!1;for(let t=0;t<Fl.length;t++)ze(...Fl[t]);Fl.length=0}function hl(){tn||(zr(Ai),tn=!0)}function Ro(t,i=!1){tn=!0,Cn=i,t(n),Ai(),i&&Fl.length>0&&queueMicrotask(Co)}n.batch=Ro;function Ai(){if(yt&&(bo(),yt=!1),sl&&(wo(),sl=!1),zt){if(ge(z,xl,He),ge(z,Gl,$),ge(z,Bl,K),ge(z,Yl,J),ge(D,xl,He),ge(D,Gl,$),ge(D,Bl,K),ge(D,Yl,J),ge(T,Bl,_t),ge(T,Yl,Pt),_.width=Te(_t*oe),_.height=Te(Pt*oe),C.forEach(({_el:t,_show:i,_size:r,_pos:f,side:a})=>{if(t!=null)if(i){let p=a===3||a===0?r:0,w=a%2==1;ge(t,w?"left":"top",f-p),ge(t,w?"width":"height",r),ge(t,w?"top":"left",w?$:He),ge(t,w?"height":"width",w?J:K),qn(t,Xt)}else et(t,Xt)}),Ql=cl=vn=bn=Mn=En=Tn=An=kn=null,Et=1,Ol(!0),He!=Ge||$!=Ct||K!=Ut||J!=Rt){al(!1);let t=K/Ut,i=J/Rt;if(G.show&&!Kt&&G.left>=0){G.left*=t,G.top*=i,pl&&bt(pl,Te(G.left),0,K,J),ml&&bt(ml,0,Te(G.top),K,J);for(let r=0;r<rt.length;r++){let f=rt[r];f!=null&&(fl[r]*=t,ul[r]*=i,bt(f,at(fl[r]),at(ul[r]),K,J))}}if(me.show&&!Jl&&me.left>=0&&me.width>0){me.left*=t,me.width*=t,me.top*=i,me.height*=i;for(let r in Nn)ge(wl,r,me[r])}Ge=He,Ct=$,Ut=K,Rt=J}ze("setSize"),zt=!1}_t>0&&Pt>0&&(h.clearRect(0,0,_.width,_.height),ze("drawClear"),B.forEach(t=>t()),ze("draw")),me.show&&Jl&&(ln(me),Jl=!1),G.show&&Kt&&(Jt(null,!0,!1),Kt=!1),O.show&&O.live&&ot&&(Fn(),ot=!1),g||(g=!0,n.status=1,ze("ready")),Vl=!1,tn=!1}n.redraw=(t,i)=>{sl=i||!1,t!==!1?Nt(L,v.min,v.max):hl()};function Rn(t,i){let r=E[t];if(r.from==null){if(Ve==0){let f=r.range(n,i.min,i.max,t);i.min=f[0],i.max=f[1]}if(i.min>i.max){let f=i.min;i.min=i.max,i.max=f}if(Ve>1&&i.min!=null&&i.max!=null&&i.max-i.min<1e-16)return;t==L&&r.distr==2&&Ve>0&&(i.min=St(i.min,l[0]),i.max=St(i.max,l[0]),i.min==i.max&&i.max++),U[t]=i,yt=!0,hl()}}n.setScale=Rn;let zn,Vn,pl,ml,Di,Li,dl,gl,Pi,Ci,pe,we,Ht=!1;const Fe=G.drag;let Ce=Fe.x,Re=Fe.y;G.show&&(G.x&&(zn=ct(ir,D)),G.y&&(Vn=ct(sr,D)),v.ori==0?(pl=zn,ml=Vn):(pl=Vn,ml=zn),pe=G.left,we=G.top);const me=n.select=Me({show:!0,over:!0,left:0,width:0,top:0,height:0},e.select),wl=me.show?ct(nr,me.over?D:z):null;function ln(t,i){if(me.show){for(let r in t)me[r]=t[r],r in Nn&&ge(wl,r,t[r]);i!==!1&&ze("setSelect")}}n.setSelect=ln;function zo(t,i){let r=k[t],f=Se?$e[t]:null;if(r.show)f&&qn(f,Xt);else{f&&et(f,Xt);let a=rl?rt[0]:rt[t];bt(a,-10,-10,K,J)}}function Nt(t,i,r){Rn(t,{min:i,max:r})}function xt(t,i,r,f){i.focus!=null&&Oo(t),i.show!=null&&k.forEach((a,p)=>{p>0&&(t==p||t==null)&&(a.show=i.show,zo(p,i.show),o==2?(Nt(a.facets[0].scale,null,null),Nt(a.facets[1].scale,null,null)):Nt(a.scale,null,null),hl())}),r!==!1&&ze("setSeries",t,i),f&&Wl("setSeries",n,t,i)}n.setSeries=xt;function Vo(t,i){Me(W[t],i)}function Fo(t,i){t.fill=X(t.fill||null),t.dir=se(t.dir,-1),i=i??W.length,W.splice(i,0,t)}function Ho(t){t==null?W.length=0:W.splice(t,1)}n.addBand=Fo,n.setBand=Vo,n.delBand=Ho;function No(t,i){k[t].alpha=i,G.show&&rt[t]&&(rt[t].style.opacity=i),Se&&$e[t]&&($e[t].style.opacity=i)}let Tt,Ot,qt;const Sl={focus:!0};function Oo(t){if(t!=qt){let i=t==null,r=Vt.alpha!=1;k.forEach((f,a)=>{if(o==1||a>0){let p=i||a==0||a==t;f._focus=i?null:p,r&&No(a,p?1:Vt.alpha)}}),qt=t,r&&hl()}}Se&&ol&&it(Qi,Ke,t=>{G._lock||($t(t),qt!=null&&xt(null,Sl,!0,ke.setSeries))});function vt(t,i,r){let f=E[i];r&&(t=t/oe-(f.ori==1?$:He));let a=K;f.ori==1&&(a=J,t=a-t),f.dir==-1&&(t=a-t);let p=f._min,w=f._max,S=t/a,x=p+(w-p)*S,b=f.distr;return b==3?Ml(10,x):b==4?vr(x,f.asinh):b==100?f.bwd(x):x}function Wo(t,i){let r=vt(t,L,i);return St(r,l[0],Le,Pe)}n.valToIdx=t=>St(t,l[0]),n.posToIdx=Wo,n.posToVal=vt,n.valToPos=(t,i,r)=>E[i].ori==0?u(t,E[i],r?Qe:K,r?qe:0):d(t,E[i],r?st:J,r?pt:0),n.setCursor=(t,i,r)=>{pe=t.left,we=t.top,Jt(null,i,r)};function Ri(t,i){ge(wl,xl,me.left=t),ge(wl,Bl,me.width=i)}function zi(t,i){ge(wl,Gl,me.top=t),ge(wl,Yl,me.height=i)}let Hl=v.ori==0?Ri:zi,Nl=v.ori==1?Ri:zi;function Go(){if(Se&&O.live)for(let t=o==2?1:0;t<k.length;t++){if(t==0&&je)continue;let i=O.values[t],r=0;for(let f in i)nt[t][r++].firstChild.nodeValue=i[f]}}function Fn(t,i){if(t!=null&&(t.idxs?t.idxs.forEach((r,f)=>{fe[f]=r}):Er(t.idx)||fe.fill(t.idx),O.idx=fe[0]),Se&&O.live){for(let r=0;r<k.length;r++)(r>0||o==1&&!je)&&Io(r,fe[r]);Go()}ot=!1,i!==!1&&ze("setLegend")}n.setLegend=Fn;function Io(t,i){let r=k[t],f=t==0&&N==2?mt:l[t],a;je?a=r.values(n,t,i)??Lt:(a=r.value(n,i==null?null:f[i],t,i),a=a==null?Lt:{_:a}),O.values[t]=a}function Jt(t,i,r){Pi=pe,Ci=we,[pe,we]=G.move(n,pe,we),G.left=pe,G.top=we,G.show&&(pl&&bt(pl,Te(pe),0,K,J),ml&&bt(ml,0,Te(we),K,J));let f,a=Le>Pe;Tt=ee,Ot=null;let p=v.ori==0?K:J,w=v.ori==1?K:J;if(pe<0||Ve==0||a){f=G.idx=null;for(let S=0;S<k.length;S++){let x=rt[S];x!=null&&bt(x,-10,-10,K,J)}ol&&xt(null,Sl,!0,t==null&&ke.setSeries),O.live&&(fe.fill(f),ot=!0)}else{let S,x,b;o==1&&(S=v.ori==0?pe:we,x=vt(S,L),f=G.idx=St(x,l[0],Le,Pe),b=q(l[0][f],v,p,0));let M=-10,A=-10,Y=0,ae=0,te=!0,Q="",j="";for(let R=o==2?1:0;R<k.length;R++){let ce=k[R],xe=fe[R],_e=xe==null?null:o==1?l[R][xe]:l[R][1][xe],de=G.dataIdx(n,R,f,x),be=de==null?null:o==1?l[R][de]:l[R][1][de];ot=ot||be!=_e||de!=xe,fe[R]=de;let Je=de==f?b:q(o==1?l[0][de]:l[R][0][de],v,p,0);if(R>0&&ce.show){let Ze=be==null?-10:le(be,o==1?E[ce.scale]:E[ce.facets[1].scale],w,0);if(ol&&be!=null){let ft=v.ori==1?pe:we,dt=Ae(Vt.dist(n,R,de,Ze,ft));if(dt<Tt){let gt=Vt.bias;if(gt!=0){let Ie=vt(ft,ce.scale),kt=be>=0?1:-1,Be=Ie>=0?1:-1;Be==kt&&(Be==1?gt==1?be>=Ie:be<=Ie:gt==1?be<=Ie:be>=Ie)&&(Tt=dt,Ot=R)}else Tt=dt,Ot=R}}if(ot||rl){let ft,dt;v.ori==0?(ft=Je,dt=Ze):(ft=Ze,dt=Je);let gt,Ie,kt,Be,Ye,Xe,yl=!0,Gt=Ne.bbox;if(Gt!=null){yl=!1;let ut=Gt(n,R);kt=ut.left,Be=ut.top,gt=ut.width,Ie=ut.height}else kt=ft,Be=dt,gt=Ie=Ne.size(n,R);if(Xe=Ne.fill(n,R),Ye=Ne.stroke(n,R),rl)R==Ot&&Tt<=Vt.prox&&(M=kt,A=Be,Y=gt,ae=Ie,te=yl,Q=Xe,j=Ye);else{let ut=rt[R];ut!=null&&(fl[R]=kt,ul[R]=Be,ss(ut,gt,Ie,yl),ns(ut,Xe,Ye),bt(ut,at(kt),at(Be),K,J))}}}}if(rl){let R=Vt.prox,ce=qt==null?Tt<=R:Tt>R||Ot!=qt;if(ot||ce){let xe=rt[0];fl[0]=M,ul[0]=A,ss(xe,Y,ae,te),ns(xe,Q,j),bt(xe,at(M),at(A),K,J)}}}if(me.show&&Ht)if(t!=null){let[S,x]=ke.scales,[b,M]=ke.match,[A,Y]=t.cursor.sync.scales,ae=t.cursor.drag;if(Ce=ae._x,Re=ae._y,Ce||Re){let{left:te,top:Q,width:j,height:R}=t.select,ce=t.scales[A].ori,xe=t.posToVal,_e,de,be,Je,Ze,ft=S!=null&&b(S,A),dt=x!=null&&M(x,Y);ft&&Ce?(ce==0?(_e=te,de=j):(_e=Q,de=R),be=E[S],Je=q(xe(_e,A),be,p,0),Ze=q(xe(_e+de,A),be,p,0),Hl(ht(Je,Ze),Ae(Ze-Je))):Hl(0,p),dt&&Re?(ce==1?(_e=te,de=j):(_e=Q,de=R),be=E[x],Je=le(xe(_e,Y),be,w,0),Ze=le(xe(_e+de,Y),be,w,0),Nl(ht(Je,Ze),Ae(Ze-Je))):Nl(0,w)}else nn()}else{let S=Ae(Pi-Di),x=Ae(Ci-Li);if(v.ori==1){let Y=S;S=x,x=Y}Ce=Fe.x&&S>=Fe.dist,Re=Fe.y&&x>=Fe.dist;let b=Fe.uni;b!=null?Ce&&Re&&(Ce=S>=b,Re=x>=b,!Ce&&!Re&&(x>S?Re=!0:Ce=!0)):Fe.x&&Fe.y&&(Ce||Re)&&(Ce=Re=!0);let M,A;Ce&&(v.ori==0?(M=dl,A=pe):(M=gl,A=we),Hl(ht(M,A),Ae(A-M)),Re||Nl(0,w)),Re&&(v.ori==1?(M=dl,A=pe):(M=gl,A=we),Nl(ht(M,A),Ae(A-M)),Ce||Hl(0,p)),!Ce&&!Re&&(Hl(0,0),Nl(0,0))}if(Fe._x=Ce,Fe._y=Re,t==null){if(r){if(Ui!=null){let[S,x]=ke.scales;ke.values[0]=S!=null?vt(v.ori==0?pe:we,S):null,ke.values[1]=x!=null?vt(v.ori==1?pe:we,x):null}Wl(qi,n,pe,we,K,J,f)}if(ol){let S=r&&ke.setSeries,x=Vt.prox;qt==null?Tt<=x&&xt(Ot,Sl,!0,S):Tt>x?xt(null,Sl,!0,S):Ot!=qt&&xt(Ot,Sl,!0,S)}}ot&&(O.idx=f,Fn()),i!==!1&&ze("setCursor")}let Wt=null;Object.defineProperty(n,"rect",{get(){return Wt==null&&Ol(!1),Wt}});function Ol(t=!1){t?Wt=null:(Wt=D.getBoundingClientRect(),ze("syncRect",Wt))}function Vi(t,i,r,f,a,p,w){G._lock||Ht&&t!=null&&t.movementX==0&&t.movementY==0||(Hn(t,i,r,f,a,p,w,!1,t!=null),t!=null?Jt(null,!0,!0):Jt(i,!0,!1))}function Hn(t,i,r,f,a,p,w,S,x){if(Wt==null&&Ol(!1),$t(t),t!=null)r=t.clientX-Wt.left,f=t.clientY-Wt.top;else{if(r<0||f<0){pe=-10,we=-10;return}let[b,M]=ke.scales,A=i.cursor.sync,[Y,ae]=A.values,[te,Q]=A.scales,[j,R]=ke.match,ce=i.axes[0].side%2==1,xe=v.ori==0?K:J,_e=v.ori==1?K:J,de=ce?p:a,be=ce?a:p,Je=ce?f:r,Ze=ce?r:f;if(te!=null?r=j(b,te)?m(Y,E[b],xe,0):-10:r=xe*(Je/de),Q!=null?f=R(M,Q)?m(ae,E[M],_e,0):-10:f=_e*(Ze/be),v.ori==1){let ft=r;r=f,f=ft}}x&&((r<=1||r>=K-1)&&(r=Zt(r,K)),(f<=1||f>=J-1)&&(f=Zt(f,J))),S?(Di=r,Li=f,[dl,gl]=G.move(n,r,f)):(pe=r,we=f)}const Nn={width:0,height:0,left:0,top:0};function nn(){ln(Nn,!1)}let Fi,Hi,Ni,Oi;function Wi(t,i,r,f,a,p,w){Ht=!0,Ce=Re=Fe._x=Fe._y=!1,Hn(t,i,r,f,a,p,w,!0,!1),t!=null&&(it(In,$n,Gi,!1),Wl(Ji,n,dl,gl,K,J,null));let{left:S,top:x,width:b,height:M}=me;Fi=S,Hi=x,Ni=b,Oi=M,nn()}function Gi(t,i,r,f,a,p,w){Ht=Fe._x=Fe._y=!1,Hn(t,i,r,f,a,p,w,!1,!0);let{left:S,top:x,width:b,height:M}=me,A=b>0||M>0,Y=Fi!=S||Hi!=x||Ni!=b||Oi!=M;if(A&&Y&&ln(me),Fe.setScale&&A&&Y){let ae=S,te=b,Q=x,j=M;if(v.ori==1&&(ae=x,te=M,Q=S,j=b),Ce&&Nt(L,vt(ae,L),vt(ae+te,L)),Re)for(let R in E){let ce=E[R];R!=L&&ce.from==null&&ce.min!=ee&&Nt(R,vt(Q+j,R),vt(Q,R))}nn()}else G.lock&&(G._lock=!G._lock,Jt(null,!0,!1));t!=null&&(ql(In,$n),Wl(In,n,pe,we,K,J,null))}function Bo(t,i,r,f,a,p,w){if(G._lock)return;$t(t);let S=Ht;if(Ht){let x=!0,b=!0,M=10,A,Y;v.ori==0?(A=Ce,Y=Re):(A=Re,Y=Ce),A&&Y&&(x=pe<=M||pe>=K-M,b=we<=M||we>=J-M),A&&x&&(pe=pe<dl?0:K),Y&&b&&(we=w