text: "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[409],{6409:function(e,t,n){n.d(t,{fH:function(){return fe}});var i=n(67294),r=n(2430),o=n(18761),l=n(8522),s=n(69680),a=n(49742),u=n(25049),h=n(37633),c=n(52190),d=n(45697),f=n.n(d),g=n(85893),y=n(81472);const p=Math.pow(2,-52),m=new Uint32Array(512);class x{static from(e,t=C,n=O){const i=e.length,r=new Float64Array(2*i);for(let o=0;o<i;o++){const i=e[o];r[2*o]=t(i),r[2*o+1]=n(i)}return new x(r)}constructor(e){const t=e.length>>1;if(t>0&&"number"!==typeof e[0])throw new Error("Expected coords to contain numbers.");this.coords=e;const n=Math.max(2*t-5,0);this._triangles=new Uint32Array(3*n),this._halfedges=new Int32Array(3*n),this._hashSize=Math.ceil(Math.sqrt(t)),this._hullPrev=new Uint32Array(t),this._hullNext=new Uint32Array(t),this._hullTri=new Uint32Array(t),this._hullHash=new Int32Array(this._hashSize).fill(-1),this._ids=new Uint32Array(t),this._dists=new Float64Array(t),this.update()}update(){const{coords:e,_hullPrev:t,_hullNext:n,_hullTri:i,_hullHash:r}=this,o=e.length>>1;let l=1/0,s=1/0,a=-1/0,u=-1/0;for(let p=0;p<o;p++){const t=e[2*p],n=e[2*p+1];t<l&&(l=t),n<s&&(s=n),t>a&&(a=t),n>u&&(u=n),this._ids[p]=p}const h=(l+a)/2,c=(s+u)/2;let d,f,g,y=1/0;for(let p=0;p<o;p++){const t=b(h,c,e[2*p],e[2*p+1]);t<y&&(d=p,y=t)}const m=e[2*d],x=e[2*d+1];y=1/0;for(let p=0;p<o;p++){if(p===d)continue;const t=b(m,x,e[2*p],e[2*p+1]);t<y&&t>0&&(f=p,y=t)}let v=e[2*f],w=e[2*f+1],k=1/0;for(let p=0;p<o;p++){if(p===d||p===f)continue;const t=S(m,x,v,w,e[2*p],e[2*p+1]);t<k&&(g=p,k=t)}let C=e[2*g],O=e[2*g+1];if(k===1/0){for(let i=0;i<o;i++)this._dists[i]=e[2*i]-e[0]||e[2*i+1]-e[1];M(this._ids,this._dists,0,o-1);const t=new Uint32Array(o);let n=0;for(let e=0,i=-1/0;e<o;e++){const r=this._ids[e];this._dists[r]>i&&(t[n++]=r,i=this._dists[r])}return this.hull=t.subarray(0,n),this.triangles=new Uint32Array(0),void(this.halfedges=new Uint32Array(0))}if(_(m,x,v,w,C,O)){const e=f,t=v,n=w;f=g,v=C,w=O,g=e,C=t,O=n}const j=function(e,t,n,i,r,o){const l=n-e,s=i-t,a=r-e,u=o-t,h=l*l+s*s,c=a*a+u*u,d=.5/(l*u-s*a);return{x:e+(u*h-s*c)*d,y:t+(l*c-a*h)*d}}(m,x,v,w,C,O);this._cx=j.x,this._cy=j.y;for(let p=0;p<o;p++)this._dists[p]=b(e[2*p],e[2*p+1],j.x,j.y);M(this._ids,this._dists,0,o-1),this._hullStart=d;let T=3;n[d]=t[g]=f,n[f]=t[d]=g,n[g]=t[f]=d,i[d]=0,i[f]=1,i[g]=2,r.fill(-1),r[this._hashKey(m,x)]=d,r[this._hashKey(v,w)]=f,r[this._hashKey(C,O)]=g,this.trianglesLen=0,this._addTriangle(d,f,g,-1,-1,-1);for(let b,S,M=0;M<this._ids.length;M++){const o=this._ids[M],l=e[2*o],s=e[2*o+1];if(M>0&&Math.abs(l-b)<=p&&Math.abs(s-S)<=p)continue;if(b=l,S=s,o===d||o===f||o===g)continue;let a=0;for(let e=0,t=this._hashKey(l,s);e<this._hashSize&&(a=r[(t+e)%this._hashSize],-1===a||a===n[a]);e++);a=t[a];let u,h=a;for(;u=n[h],!_(l,s,e[2*h],e[2*h+1],e[2*u],e[2*u+1]);)if(h=u,h===a){h=-1;break}if(-1===h)continue;let c=this._addTriangle(h,o,n[h],-1,-1,i[h]);i[o]=this._legalize(c+2),i[h]=c,T++;let y=n[h];for(;u=n[y],_(l,s,e[2*y],e[2*y+1],e[2*u],e[2*u+1]);)c=this._addTriangle(y,o,u,i[o],-1,i[y]),i[o]=this._legalize(c+2),n[y]=y,T--,y=u;if(h===a)for(;u=t[h],_(l,s,e[2*u],e[2*u+1],e[2*h],e[2*h+1]);)c=this._addTriangle(u,o,h,-1,i[h],i[u]),this._legalize(c+2),i[u]=c,n[h]=h,T--,h=u;this._hullStart=t[o]=h,n[h]=t[y]=o,n[o]=y,r[this._hashKey(l,s)]=o,r[this._hashKey(e[2*h],e[2*h+1])]=h}this.hull=new Uint32Array(T);for(let p=0,b=this._hullStart;p<T;p++)this.hull[p]=b,b=n[b];this.triangles=this._triangles.subarray(0,this.trianglesLen),this.halfedges=this._halfedges.subarray(0,this.trianglesLen)}_hashKey(e,t){return Math.floor(function(e,t){const n=e/(Math.abs(e)+Math.abs(t));return(t>0?3-n:1+n)/4}(e-this._cx,t-this._cy)*this._hashSize)%this._hashSize}_legalize(e){const{_triangles:t,_halfedges:n,coords:i}=this;let r=0,o=0;for(;;){const l=n[e],s=e-e%3;if(o=s+(e+2)%3,-1===l){if(0===r)break;e=m[--r];continue}const a=l-l%3,u=s+(e+1)%3,h=a+(l+2)%3,c=t[o],d=t[e],f=t[u],g=t[h];if(w(i[2*c],i[2*c+1],i[2*d],i[2*d+1],i[2*f],i[2*f+1],i[2*g],i[2*g+1])){t[e]=g,t[l]=c;const i=n[h];if(-1===i){let t=this._hullStart;do{if(this._hullTri[t]===h){this._hullTri[t]=e;break}t=this._hullPrev[t]}while(t!==this._hullStart)}this._link(e,i),this._link(l,n[o]),this._link(o,h);const s=a+(l+1)%3;r<m.length&&(m[r++]=s)}else{if(0===r)break;e=m[--r]}}return o}_link(e,t){this._halfedges[e]=t,-1!==t&&(this._halfedges[t]=e)}_addTriangle(e,t,n,i,r,o){const l=this.trianglesLen;return this._triangles[l]=e,this._triangles[l+1]=t,this._triangles[l+2]=n,this._link(l,i),this._link(l+1,r),this._link(l+2,o),this.trianglesLen+=3,l}}function b(e,t,n,i){const r=e-n,o=t-i;return r*r+o*o}function v(e,t,n,i,r,o){const l=(i-t)*(r-e),s=(n-e)*(o-t);return Math.abs(l-s)>=33306690738754716e-32*Math.abs(l+s)?l-s:0}function _(e,t,n,i,r,o){return(v(r,o,e,t,n,i)||v(e,t,n,i,r,o)||v(n,i,r,o,e,t))<0}function w(e,t,n,i,r,o,l,s){const a=e-l,u=t-s,h=n-l,c=i-s,d=r-l,f=o-s,g=h*h+c*c,y=d*d+f*f;return a*(c*y-g*f)-u*(h*y-g*d)+(a*a+u*u)*(h*f-c*d)<0}function S(e,t,n,i,r,o){const l=n-e,s=i-t,a=r-e,u=o-t,h=l*l+s*s,c=a*a+u*u,d=.5/(l*u-s*a),f=(u*h-s*c)*d,g=(l*c-a*h)*d;return f*f+g*g}function M(e,t,n,i){if(i-n<=20)for(let r=n+1;r<=i;r++){const i=e[r],o=t[i];let l=r-1;for(;l>=n&&t[e[l]]>o;)e[l+1]=e[l--];e[l+1]=i}else{let r=n+1,o=i;k(e,n+i>>1,r),t[e[n]]>t[e[i]]&&k(e,n,i),t[e[r]]>t[e[i]]&&k(e,r,i),t[e[n]]>t[e[r]]&&k(e,n,r);const l=e[r],s=t[l];for(;;){do{r++}while(t[e[r]]<s);do{o--}while(t[e[o]]>s);if(o<r)break;k(e,r,o)}e[n+1]=e[o],e[o]=l,i-r+1>=o-n?(M(e,t,r,i),M(e,t,n,o-1)):(M(e,t,n,o-1),M(e,t,r,i))}}function k(e,t,n){const i=e[t];e[t]=e[n],e[n]=i}function C(e){return e[0]}function O(e){return e[1]}const j=1e-6;class T{constructor(){this._x0=this._y0=this._x1=this._y1=null,this._=""}moveTo(e,t){this._+=`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}`}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}lineTo(e,t){this._+=`L${this._x1=+e},${this._y1=+t}`}arc(e,t,n){const i=(e=+e)+(n=+n),r=t=+t;if(n<0)throw new Error("negative radius");null===this._x1?this._+=`M${i},${r}`:(Math.abs(this._x1-i)>j||Math.abs(this._y1-r)>j)&&(this._+="L"+i+","+r),n&&(this._+=`A${n},${n},0,1,1,${e-n},${t}A${n},${n},0,1,1,${this._x1=i},${this._y1=r}`)}rect(e,t,n,i){this._+=`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${+n}v${+i}h${-n}Z`}value(){return this._||null}}class A{constructor(){this._=[]}moveTo(e,t){this._.push([e,t])}closePath(){this._.push(this._[0].slice())}lineTo(e,t){this._.push([e,t])}value(){return this._.length?this._:null}}class P{constructor(e,[t,n,i,r]=[0,0,960,500]){if(!((i=+i)>=(t=+t))||!((r=+r)>=(n=+n)))throw new Error("invalid bounds");this.delaunay=e,this._circumcenters=new Float64Array(2*e.points.length),this.vectors=new Float64Array(2*e.points.length),this.xmax=i,this.xmin=t,this.ymax=r,this.ymin=n,this._init()}update(){return this.delaunay.update(),this._init(),this}_init(){const{delaunay:{points:e,hull:t,triangles:n},vectors:i}=this,r=this.circumcenters=this._circumcenters.subarray(0,n.length/3*2);for(let d,f,g=0,y=0,p=n.length;g<p;g+=3,y+=2){const t=2*n[g],i=2*n[g+1],o=2*n[g+2],l=e[t],s=e[t+1],a=e[i],u=e[i+1],h=e[o],c=e[o+1],p=a-l,m=u-s,x=h-l,b=c-s,v=p*p+m*m,_=x*x+b*b,w=2*(p*b-m*x);if(w)if(Math.abs(w)<1e-8)d=(l+h)/2,f=(s+c)/2;else{const e=1/w;d=l+(b*v-m*_)*e,f=s+(p*_-x*v)*e}else d=(l+h)/2-1e8*b,f=(s+c)/2+1e8*x;r[y]=d,r[y+1]=f}let o,l,s,a=t[t.length-1],u=4*a,h=e[2*a],c=e[2*a+1];i.fill(0);for(let d=0;d<t.length;++d)a=t[d],o=u,l=h,s=c,u=4*a,h=e[2*a],c=e[2*a+1],i[o+2]=i[u]=s-c,i[o+3]=i[u+1]=h-l}render(e){const t=null==e?e=new T:void 0,{delaunay:{halfedges:n,inedges:i,hull:r},circumcenters:o,vectors:l}=this;if(r.length<=1)return null;for(let u=0,h=n.length;u<h;++u){const t=n[u];if(t<u)continue;const i=2*Math.floor(u/3),r=2*Math.floor(t/3),l=o[i],s=o[i+1],a=o[r],h=o[r+1];this._renderSegment(l,s,a,h,e)}let s,a=r[r.length-1];for(let u=0;u<r.length;++u){s=a,a=r[u];const t=2*Math.floor(i[a]/3),n=o[t],h=o[t+1],c=4*s,d=this._project(n,h,l[c+2],l[c+3]);d&&this._renderSegment(n,h,d[0],d[1],e)}return t&&t.value()}renderBounds(e){const t=null==e?e=new T:void 0;return e.rect(this.xmin,this.ymin,this.xmax-this.xmin,this.ymax-this.ymin),t&&t.value()}renderCell(e,t){const n=null==t?t=new T:void 0,i=this._clip(e);if(null===i||!i.length)return;t.moveTo(i[0],i[1]);let r=i.length;for(;i[0]===i[r-2]&&i[1]===i[r-1]&&r>1;)r-=2;for(let o=2;o<r;o+=2)i[o]===i[o-2]&&i[o+1]===i[o-1]||t.lineTo(i[o],i[o+1]);return t.closePath(),n&&n.value()}*cellPolygons(){const{delaunay:{points:e}}=this;for(let t=0,n=e.length/2;t<n;++t){const e=this.cellPolygon(t);e&&(e.index=t,yield e)}}cellPolygon(e){const t=new A;return this.renderCell(e,t),t.value()}_renderSegment(e,t,n,i,r){let o;const l=this._regioncode(e,t),s=this._regioncode(n,i);0===l&&0===s?(r.moveTo(e,t),r.lineTo(n,i)):(o=this._clipSegment(e,t,n,i,l,s))&&(r.moveTo(o[0],o[1]),r.lineTo(o[2],o[3]))}contains(e,t,n){return(t=+t)===t&&(n=+n)===n&&this.delaunay._step(e,t,n)===e}*neighbors(e){const t=this._clip(e);if(t)for(const n of this.delaunay.neighbors(e)){const e=this._clip(n);if(e)e:for(let i=0,r=t.length;i<r;i+=2)for(let o=0,l=e.length;o<l;o+=2)if(t[i]==e[o]&&t[i+1]==e[o+1]&&t[(i+2)%r]==e[(o+l-2)%l]&&t[(i+3)%r]==e[(o+l-1)%l]){yield n;break e}}}_cell(e){const{circumcenters:t,delaunay:{inedges:n,halfedges:i,triangles:r}}=this,o=n[e];if(-1===o)return null;const l=[];let s=o;do{const n=Math.floor(s/3);if(l.push(t[2*n],t[2*n+1]),s=s%3===2?s-2:s+1,r[s]!==e)break;s=i[s]}while(s!==o&&-1!==s);return l}_clip(e){if(0===e&&1===this.delaunay.hull.length)return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];const t=this._cell(e);if(null===t)return null;const{vectors:n}=this,i=4*e;return n[i]||n[i+1]?this._clipInfinite(e,t,n[i],n[i+1],n[i+2],n[i+3]):this._clipFinite(e,t)}_clipFinite(e,t){const n=t.length;let i,r,o,l,s,a=null,u=t[n-2],h=t[n-1],c=this._regioncode(u,h);for(let d=0;d<n;d+=2)if(i=u,r=h,u=t[d],h=t[d+1],o=c,c=this._regioncode(u,h),0===o&&0===c)l=s,s=0,a?a.push(u,h):a=[u,h];else{let t,n,d,f,g;if(0===o){if(null===(t=this._clipSegment(i,r,u,h,o,c)))continue;[n,d,f,g]=t}else{if(null===(t=this._clipSegment(u,h,i,r,c,o)))continue;[f,g,n,d]=t,l=s,s=this._edgecode(n,d),l&&s&&this._edge(e,l,s,a,a.length),a?a.push(n,d):a=[n,d]}l=s,s=this._edgecode(f,g),l&&s&&this._edge(e,l,s,a,a.length),a?a.push(f,g):a=[f,g]}if(a)l=s,s=this._edgecode(a[0],a[1]),l&&s&&this._edge(e,l,s,a,a.length);else if(this.contains(e,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2))return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];return a}_clipSegment(e,t,n,i,r,o){for(;;){if(0===r&&0===o)return[e,t,n,i];if(r&o)return null;let l,s,a=r||o;8&a?(l=e+(n-e)*(this.ymax-t)/(i-t),s=this.ymax):4&a?(l=e+(n-e)*(this.ymin-t)/(i-t),s=this.ymin):2&a?(s=t+(i-t)*(this.xmax-e)/(n-e),l=this.xmax):(s=t+(i-t)*(this.xmin-e)/(n-e),l=this.xmin),r?(e=l,t=s,r=this._regioncode(e,t)):(n=l,i=s,o=this._regioncode(n,i))}}_clipInfinite(e,t,n,i,r,o){let l,s=Array.from(t);if((l=this._project(s[0],s[1],n,i))&&s.unshift(l[0],l[1]),(l=this._project(s[s.length-2],s[s.length-1],r,o))&&s.push(l[0],l[1]),s=this._clipFinite(e,s))for(let a,u=0,h=s.length,c=this._edgecode(s[h-2],s[h-1]);u<h;u+=2)a=c,c=this._edgecode(s[u],s[u+1]),a&&c&&(u=this._edge(e,a,c,s,u),h=s.length);else this.contains(e,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2)&&(s=[this.xmin,this.ymin,this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax]);return s}_edge(e,t,n,i,r){for(;t!==n;){let n,o;switch(t){case 5:t=4;continue;case 4:t=6,n=this.xmax,o=this.ymin;break;case 6:t=2;continue;case 2:t=10,n=this.xmax,o=this.ymax;break;case 10:t=8;continue;case 8:t=9,n=this.xmin,o=this.ymax;break;case 9:t=1;continue;case 1:t=5,n=this.xmin,o=this.ymin}i[r]===n&&i[r+1]===o||!this.contains(e,n,o)||(i.splice(r,0,n,o),r+=2)}if(i.length>4)for(let o=0;o<i.length;o+=2){const e=(o+2)%i.length,t=(o+4)%i.length;(i[o]===i[e]&&i[e]===i[t]||i[o+1]===i[e+1]&&i[e+1]===i[t+1])&&(i.splice(e,2),o-=2)}return r}_project(e,t,n,i){let r,o,l,s=1/0;if(i<0){if(t<=this.ymin)return null;(r=(this.ymin-t)/i)<s&&(l=this.ymin,o=e+(s=r)*n)}else if(i>0){if(t>=this.ymax)return null;(r=(this.ymax-t)/i)<s&&(l=this.ymax,o=e+(s=r)*n)}if(n>0){if(e>=this.xmax)return null;(r=(this.xmax-e)/n)<s&&(o=this.xmax,l=t+(s=r)*i)}else if(n<0){if(e<=this.xmin)return null;(r=(this.xmin-e)/n)<s&&(o=this.xmin,l=t+(s=r)*i)}return[o,l]}_edgecode(e,t){return(e===this.xmin?1:e===this.xmax?2:0)|(t===this.ymin?4:t===this.ymax?8:0)}_regioncode(e,t){return(e<this.xmin?1:e>this.xmax?2:0)|(t<this.ymin?4:t>this.ymax?8:0)}}const R=2*Math.PI,B=Math.pow;function q(e){return e[0]}function F(e){return e[1]}function E(e,t,n){return[e+Math.sin(e+t)*n,t+Math.cos(e-t)*n]}class L{static from(e,t=q,n=F,i){return new L("length"in e?function(e,t,n,i){const r=e.length,o=new Float64Array(2*r);for(let l=0;l<r;++l){const r=e[l];o[2*l]=t.call(i,r,l,e),o[2*l+1]=n.call(i,r,l,e)}return o}(e,t,n,i):Float64Array.from(function*(e,t,n,i){let r=0;for(const o of e)yield t.call(i,o,r,e),yield n.call(i,o,r,e),++r}(e,t,n,i)))}constructor(e){this._delaunator=new x(e),this.inedges=new Int32Array(e.length/2),this._hullIndex=new Int32Array(e.length/2),this.points=this._delaunator.coords,this._init()}update(){return this._delaunator.update(),this._init(),this}_init(){const e=this._delaunator,t=this.points;if(e.hull&&e.hull.length>2&&function(e){const{triangles:t,coords:n}=e;for(let i=0;i<t.length;i+=3){const e=2*t[i],r=2*t[i+1],o=2*t[i+2];if((n[o]-n[e])*(n[r+1]-n[e+1])-(n[r]-n[e])*(n[o+1]-n[e+1])>1e-10)return!1}return!0}(e)){this.collinear=Int32Array.from({length:t.length/2},((e,t)=>t)).sort(((e,n)=>t[2*e]-t[2*n]||t[2*e+1]-t[2*n+1]));const e=this.collinear[0],n=this.collinear[this.collinear.length-1],i=[t[2*e],t[2*e+1],t[2*n],t[2*n+1]],r=1e-8*Math.hypot(i[3]-i[1],i[2]-i[0]);for(let o=0,l=t.length/2;o<l;++o){const e=E(t[2*o],t[2*o+1],r);t[2*o]=e[0],t[2*o+1]=e[1]}this._delaunator=new x(t)}else delete this.collinear;const n=this.halfedges=this._delaunator.halfedges,i=this.hull=this._delaunator.hull,r=this.triangles=this._delaunator.triangles,o=this.inedges.fill(-1),l=this._hullIndex.fill(-1);for(let s=0,a=n.length;s<a;++s){const e=r[s%3===2?s-2:s+1];-1!==n[s]&&-1!==o[e]||(o[e]=s)}for(let s=0,a=i.length;s<a;++s)l[i[s]]=s;i.length<=2&&i.length>0&&(this.triangles=new Int32Array(3).fill(-1),this.halfedges=new Int32Array(3).fill(-1),this.triangles[0]=i[0],this.triangles[1]=i[1],this.triangles[2]=i[1],o[i[0]]=1,2===i.length&&(o[i[1]]=0))}voronoi(e){return new P(this,e)}*neighbors(e){const{inedges:t,hull:n,_hullIndex:i,halfedges:r,triangles:o,collinear:l}=this;if(l){const t=l.indexOf(e);return t>0&&(yield l[t-1]),void(t<l.length-1&&(yield l[t+1]))}const s=t[e];if(-1===s)return;let a=s,u=-1;do{if(yield u=o[a],a=a%3===2?a-2:a+1,o[a]!==e)return;if(a=r[a],-1===a){const t=n[(i[e]+1)%n.length];return void(t!==u&&(yield t))}}while(a!==s)}find(e,t,n=0){if((e=+e)!==e||(t=+t)!==t)return-1;const i=n;let r;for(;(r=this._step(n,e,t))>=0&&r!==n&&r!==i;)n=r;return r}_step(e,t,n){const{inedges:i,hull:r,_hullIndex:o,halfedges:l,triangles:s,points:a}=this;if(-1===i[e]||!a.length)return(e+1)%(a.length>>1);let u=e,h=B(t-a[2*e],2)+B(n-a[2*e+1],2);const c=i[e];let d=c;do{let i=s[d];const c=B(t-a[2*i],2)+B(n-a[2*i+1],2);if(c<h&&(h=c,u=i),d=d%3===2?d-2:d+1,s[d]!==e)break;if(d=l[d],-1===d){if(d=r[(o[e]+1)%r.length],d!==i&&B(t-a[2*d],2)+B(n-a[2*d+1],2)<h)return d;break}}while(d!==c);return u}render(e){const t=null==e?e=new T:void 0,{points:n,halfedges:i,triangles:r}=this;for(let o=0,l=i.length;o<l;++o){const t=i[o];if(t<o)continue;const l=2*r[o],s=2*r[t];e.moveTo(n[l],n[l+1]),e.lineTo(n[s],n[s+1])}return this.renderHull(e),t&&t.value()}renderPoints(e,t=2){const n=null==e?e=new T:void 0,{points:i}=this;for(let r=0,o=i.length;r<o;r+=2){const n=i[r],o=i[r+1];e.moveTo(n+t,o),e.arc(n,o,t,0,R)}return n&&n.value()}renderHull(e){const t=null==e?e=new T:void 0,{hull:n,points:i}=this,r=2*n[0],o=n.length;e.moveTo(i[r],i[r+1]);for(let l=1;l<o;++l){const t=2*n[l];e.lineTo(i[t],i[t+1])}return e.closePath(),t&&t.value()}hullPolygon(){const e=new A;return this.renderHull(e),e.value()}renderTriangle(e,t){const n=null==t?t=new T:void 0,{points:i,triangles:r}=this,o=2*r[e*=3],l=2*r[e+1],s=2*r[e+2];return t.moveTo(i[o],i[o+1]),t.lineTo(i[l],i[l+1]),t.lineTo(i[s],i[s+1]),t.closePath(),n&&n.value()}*trianglePolygons(){const{triangles:e}=this;for(let t=0,n=e.length/3;t<n;++t)yield this.trianglePolygon(t)}trianglePolygon(e){const t=new A;return this.renderTriangle(e,t),t.value()}}var W=function(e){return"function"===typeof e?e:function(t){return t[e]}},I=function(e){var t=e.points,n=e.x,r=e.y,o=e.width,l=e.height,s=e.debug,a=(0,i.useMemo)((function(){return function(e){var t=e.points,n=e.x,i=void 0===n?"x":n,r=e.y,o=void 0===r?"y":r,l=W(i),s=W(o);return t.map((function(e){return[l(e),s(e)]}))}({points:t,x:n,y:r})}),[t,n,r]);return(0,i.useMemo)((function(){return function(e){var t=e.points,n=e.width,i=e.height,r=e.debug,o=L.from(t),l=r?o.voronoi([0,0,n,i]):void 0;return{delaunay:o,voronoi:l}}({points:a,width:o,height:l,debug:s})}),[a,o,l,s])};function G(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function V(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(e)){var n=[],i=!0,r=!1,o=void 0;try{for(var l,s=e[Symbol.iterator]();!(i=(l=s.next()).done)&&(n.push(l.value),!t||n.length!==t);i=!0);}catch(a){r=!0,o=a}finally{try{i||null==s.return||s.return()}finally{if(r)throw o}}return n}}(e,t)||function(e,t){if(e){if("string"===typeof e)return G(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?G(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var $=function(e){var t=e.nodes,n=e.width,o=e.height,l=e.x,s=e.y,a=e.onMouseEnter,u=e.onMouseMove,h=e.onMouseLeave,c=e.onClick,d=e.debug,f=(0,i.useRef)(null),y=V((0,i.useState)(null),2),p=y[0],m=y[1],x=I({points:t,x:l,y:s,width:n,height:o,debug:d}),b=x.delaunay,v=x.voronoi,_=(0,i.useMemo)((function(){if(d&&v)return v.render()}),[d,v]),w=(0,i.useCallback)((function(e){if(!f.current)return[null,null];var n=V((0,r.P6)(f.current,e),2),i=n[0],o=n[1],l=b.find(i,o);return[l,void 0!==l?t[l]:null]}),[f,b]),S=(0,i.useCallback)((function(e){var t=V(w(e),2),n=t[0],i=t[1];m(n),i&&(null===a||void 0===a||a(i,e))}),[w,m,a]),M=(0,i.useCallback)((function(e){var t=V(w(e),2),n=t[0],i=t[1];m(n),i&&(null===u||void 0===u||u(i,e))}),[w,m,u]),k=(0,i.useCallback)((function(e){if(m(null),h){var n=void 0;null!==p&&(n=t[p]),n&&h(n,e)}}),[m,p,h,t]),C=(0,i.useCallback)((function(e){var t=V(w(e),2),n=t[0],i=t[1];m(n),i&&(null===c||void 0===c||c(i,e))}),[w,m,c]);return(0,g.jsxs)("g",{ref:f,children:[d&&v&&(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)("path",{d:_,stroke:"red",strokeWidth:1,opacity:.75}),null!==p&&(0,g.jsx)("path",{fill:"pink",opacity:.35,d:v.renderCell(p)})]}),(0,g.jsx)("rect",{width:n,height:o,fill:"red",opacity:0,style:{cursor:"auto"},onMouseEnter:S,onMouseMove:M,onMouseLeave:k,onClick:C})]})};function z(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Z(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function Y(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Z(Object(n),!0).forEach((function(t){z(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Z(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function D(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function U(e,t){if(e){if("string"===typeof e)return D(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?D(e,t):void 0}}function H(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(e)){var n=[],i=!0,r=!1,o=void 0;try{for(var l,s=e[Symbol.iterator]();!(i=(l=s.next()).done)&&(n.push(l.value),!t||n.length!==t);i=!0);}catch(a){r=!0,o=a}finally{try{i||null==s.return||s.return()}finally{if(r)throw o}}return n}}(e,t)||U(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function X(e){return function(e){if(Array.isArray(e))return D(e)}(e)||function(e){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||U(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var K=(0,i.memo)((function(e){var t=e.point;return(0,g.jsx)(a._5,{id:(0,g.jsxs)("span",{children:["x: ",(0,g.jsx)("strong",{children:t.data.xFormatted}),", y:"," ",(0,g.jsx)("strong",{children:t.data.yFormatted})]}),enableChip:!0,color:t.serieColor})})),N=(0,i.memo)((function(e){var t=e.slice,n=e.axis,i=(0,r.Fg)(),o="x"===n?"y":"x";return(0,g.jsx)(a.zI,{rows:t.points.map((function(e){return[(0,g.jsx)(a.Af,{color:e.serieColor,style:i.tooltip.chip},"chip"),e.serieId,(0,g.jsx)("span",{style:i.tooltip.tableCellValue,children:e.data["".concat(o,"Formatted")]},"value")]}))})})),Q={data:f().arrayOf(f().shape({id:f().oneOfType([f().string,f().number]).isRequired,data:f().arrayOf(f().shape({x:f().oneOfType([f().number,f().string,f().instanceOf(Date)]),y:f().oneOfType([f().number,f().string,f().instanceOf(Date)])})).isRequired})).isRequired,xScale:f().object.isRequired,xFormat:f().oneOfType([f().func,f().string]),yScale:f().object.isRequired,yFormat:f().oneOfType([f().func,f().string]),layers:f().arrayOf(f().oneOfType([f().oneOf(["grid","markers","axes","areas","crosshair","lines","slices","points","mesh","legends"]),f().func])).isRequired,curve:r.VZ.isRequired,axisTop:l.VT,axisRight:l.VT,axisBottom:l.VT,axisLeft:l.VT,enableGridX:f().bool.isRequired,enableGridY:f().bool.isRequired,gridXValues:f().oneOfType([f().number,f().arrayOf(f().oneOfType([f().number,f().string,f().instanceOf(Date)]))]),gridYValues:f().oneOfType([f().number,f().arrayOf(f().oneOfType([f().number,f().string,f().instanceOf(Date)]))]),enablePoints:f().bool.isRequired,pointSymbol:f().func,pointSize:f().number.isRequired,pointColor:f().any.isRequired,pointBorderWidth:f().number.isRequired,pointBorderColor:f().any.isRequired,enablePointLabel:f().bool.isRequired,pointLabel:f().oneOfType([f().string,f().func]).isRequired,markers:f().arrayOf(f().shape({axis:f().oneOf(["x","y"]).isRequired,value:f().oneOfType([f().number,f().string,f().instanceOf(Date)]).isRequired,style:f().object})),colors:o.qi.isRequired,enableArea:f().bool.isRequired,areaOpacity:f().number.isRequired,areaBlendMode:r.wM.isRequired,areaBaselineValue:f().oneOfType([f().number,f().string,f().instanceOf(Date)]).isRequired,lineWidth:f().number.isRequired,legends:f().arrayOf(f().shape(s.iQ)).isRequired,isInteractive:f().bool.isRequired,debugMesh:f().bool.isRequired,tooltip:f().oneOfType([f().func,f().object]).isRequired,enableSlices:f().oneOf(["x","y",!1]).isRequired,debugSlices:f().bool.isRequired,sliceTooltip:f().oneOfType([f().func,f().object]).isRequired,enableCrosshair:f().bool.isRequired,crosshairType:f().string.isRequired},J=(Y(Y(Y({},Q),{},{enablePointLabel:f().bool.isRequired,role:f().string.isRequired,useMesh:f().bool.isRequired},r.w$),r._U),Y({pixelRatio:f().number.isRequired},Q),{curve:"linear",xScale:{type:"point"},yScale:{type:"linear",min:0,max:"auto"},layers:["grid","markers","axes","areas","crosshair","lines","points","slices","mesh","legends"],axisBottom:{},axisLeft:{},enableGridX:!0,enableGridY:!0,enablePoints:!0,pointSize:6,pointColor:{from:"color"},pointBorderWidth:0,pointBorderColor:{theme:"background"},enablePointLabel:!1,pointLabel:"yFormatted",colors:{scheme:"nivo"},enableArea:!1,areaBaselineValue:0,areaOpacity:.2,areaBlendMode:"normal",lineWidth:2,legends:[],isInteractive:!0,tooltip:K,enableSlices:!1,debugSlices:!1,sliceTooltip:N,debugMesh:!1,enableCrosshair:!0,crosshairType:"bottom-left"}),ee=Y(Y({},J),{},{enablePointLabel:!1,useMesh:!1,animate:!0,motionConfig:"gentle",defs:[],fill:[],role:"img"}),te=Y(Y({},J),{},{pixelRatio:"undefined"!==typeof window&&window.devicePixelRatio||1}),ne=function(e){var t=e.data,n=e.xScale,l=void 0===n?ee.xScale:n,s=e.xFormat,a=e.yScale,d=void 0===a?ee.yScale:a,f=e.yFormat,g=e.width,y=e.height,p=e.colors,m=void 0===p?ee.colors:p,x=e.curve,b=void 0===x?ee.curve:x,v=e.areaBaselineValue,_=void 0===v?ee.areaBaselineValue:v,w=e.pointColor,S=void 0===w?ee.pointColor:w,M=e.pointBorderColor,k=void 0===M?ee.pointBorderColor:M,C=e.enableSlices,O=void 0===C?ee.enableSlicesTooltip:C,j=(0,r.O_)(s),T=(0,r.O_)(f),A=(0,o.U)(m,"id"),P=(0,r.Fg)(),R=(0,o.Bf)(S,P),B=(0,o.Bf)(k,P),q=H((0,i.useState)([]),2),F=q[0],E=q[1],L=(0,i.useMemo)((function(){return(0,c.Gi)(t.filter((function(e){return-1===F.indexOf(e.id)})),l,d,g,y)}),[t,F,l,d,g,y]),W=L.xScale,I=L.yScale,G=L.series,V=(0,i.useMemo)((function(){var e=t.map((function(e){return{id:e.id,label:e.id,color:A(e)}})),n=e.map((function(e){return Y(Y({},G.find((function(t){return t.id===e.id}))),{},{color:e.color})})).filter((function(e){return Boolean(e.id)}));return{legendData:e.map((function(e){return Y(Y({},e),{},{hidden:!n.find((function(t){return t.id===e.id}))})})).reverse(),series:n}}),[t,G,A]),$=V.legendData,z=V.series,Z=(0,i.useCallback)((function(e){E((function(t){return t.indexOf(e)>-1?t.filter((function(t){return t!==e})):[].concat(X(t),[e])}))}),[]),D=function(e){var t=e.series,n=e.getPointColor,r=e.getPointBorderColor,o=e.formatX,l=e.formatY;return(0,i.useMemo)((function(){return t.reduce((function(e,t){return[].concat(X(e),X(t.data.filter((function(e){return null!==e.position.x&&null!==e.position.y})).map((function(i,s){var a={id:"".concat(t.id,".").concat(s),index:e.length+s,serieId:t.id,serieColor:t.color,x:i.position.x,y:i.position.y};return a.color=n(t),a.borderColor=r(a),a.data=Y(Y({},i.data),{},{xFormatted:o(i.data.x),yFormatted:l(i.data.y)}),a}))))}),[])}),[t,n,r,o,l])}({series:z,getPointColor:R,getPointBorderColor:B,formatX:j,formatY:T}),U=function(e){var t=e.enableSlices,n=e.points,r=e.width,o=e.height;return(0,i.useMemo)((function(){if(!1===t)return[];if("x"===t){var e=new Map;return n.forEach((function(t){null!==t.data.x&&null!==t.data.y&&(e.has(t.x)?e.get(t.x).push(t):e.set(t.x,[t]))})),Array.from(e.entries()).sort((function(e,t){return e[0]-t[0]})).map((function(e,t,n){var i,l=H(e,2),s=l[0],a=l[1],u=n[t-1],h=n[t+1];return{id:s,x0:i=u?s-(s-u[0])/2:s,x:s,y0:0,y:0,width:h?s-i+(h[0]-s)/2:r-i,height:o,points:a.reverse()}}))}if("y"===t){var i=new Map;return n.forEach((function(e){null!==e.data.x&&null!==e.data.y&&(i.has(e.y)?i.get(e.y).push(e):i.set(e.y,[e]))})),Array.from(i.entries()).sort((function(e,t){return e[0]-t[0]})).map((function(e,t,n){var i,l,s=H(e,2),a=s[0],u=s[1],h=n[t-1],c=n[t+1];return i=h?a-(a-h[0])/2:a,l=c?a-i+(c[0]-a)/2:o-i,{id:a,x0:0,x:0,y0:i,y:a,width:r,height:l,points:u.reverse()}}))}}),[t,n])}({enableSlices:O,points:D,width:g,height:y});return{legendData:$,toggleSerie:Z,lineGenerator:function(e){var t=e.curve;return(0,i.useMemo)((function(){return(0,u.Z)().defined((function(e){return null!==e.x&&null!==e.y})).x((function(e){return e.x})).y((function(e){return e.y})).curve((0,r.Bg)(t))}),[t])}({curve:b}),areaGenerator:function(e){var t=e.curve,n=e.yScale,o=e.areaBaselineValue;return(0,i.useMemo)((function(){return(0,h.Z)().defined((function(e){return null!==e.x&&null!==e.y})).x((function(e){return e.x})).y1((function(e){return e.y})).curve((0,r.Bg)(t)).y0(n(o))}),[t,n,o])}({curve:b,yScale:I,areaBaselineValue:_}),getColor:A,series:z,xScale:W,yScale:I,slices:U,points:D}},ie=function(e){var t=e.areaBlendMode,n=e.areaOpacity,i=e.color,o=e.fill,l=e.path,s=(0,r.tf)(),a=s.animate,u=s.config,h=(0,r.NS)(l),c=(0,y.useSpring)({color:i,config:u,immediate:!a});return(0,g.jsx)(y.q.path,{d:h,fill:o||c.color,fillOpacity:n,strokeWidth:0,style:{mixBlendMode:t}})},re=(0,i.memo)((function(e){var t=e.areaGenerator,n=e.areaOpacity,i=e.areaBlendMode,r=e.lines.slice(0).reverse();return(0,g.jsx)("g",{children:r.map((function(e){return(0,g.jsx)(ie,Y({path:t(e.data.map((function(e){return e.position})))},Y({areaOpacity:n,areaBlendMode:i},e)),e.id)}))})})),oe=(0,i.memo)((function(e){var t=e.lineGenerator,n=e.points,o=e.color,l=e.thickness,s=(0,i.useMemo)((function(){return t(n)}),[t,n]),a=(0,r.NS)(s);return(0,g.jsx)(y.q.path,{d:a,fill:"none",strokeWidth:l,stroke:o})})),le=(0,i.memo)((function(e){var t=e.lines,n=e.lineGenerator,i=e.lineWidth;return t.slice(0).reverse().map((function(e){var t=e.id,r=e.data,o=e.color;return(0,g.jsx)(oe,{id:t,points:r.map((function(e){return e.position})),lineGenerator:n,color:o,thickness:i},t)}))})),se=(0,i.memo)((function(e){var t=e.slice,n=e.axis,r=e.debug,o=e.tooltip,l=e.isCurrent,s=e.setCurrent,u=(0,a.lL)(),h=u.showTooltipFromEvent,c=u.hideTooltip,d=(0,i.useCallback)((function(e){h((0,i.createElement)(o,{slice:t,axis:n}),e,"right"),s(t)}),[h,o,t]),f=(0,i.useCallback)((function(e){h((0,i.createElement)(o,{slice:t,axis:n}),e,"right")}),[h,o,t]),y=(0,i.useCallback)((function(){c(),s(null)}),[c]);return(0,g.jsx)("rect",{x:t.x0,y:t.y0,width:t.width,height:t.height,stroke:"red",strokeWidth:r?1:0,strokeOpacity:.75,fill:"red",fillOpacity:l&&r?.35:0,onMouseEnter:d,onMouseMove:f,onMouseLeave:y})})),ae=(0,i.memo)((function(e){var t=e.slices,n=e.axis,i=e.debug,r=e.height,o=e.tooltip,l=e.current,s=e.setCurrent;return t.map((function(e){return(0,g.jsx)(se,{slice:e,axis:n,debug:i,height:r,tooltip:o,setCurrent:s,isCurrent:null!==l&&l.id===e.id},e.id)}))})),ue=(0,i.memo)((function(e){var t=e.points,n=e.symbol,i=e.size,o=e.borderWidth,l=e.enableLabel,s=e.label,a=e.labelYOffset,u=(0,r.Fg)(),h=(0,r.ji)(s),c=t.reverse().map((function(e){return{id:e.id,x:e.x,y:e.y,datum:e.data,fill:e.color,stroke:e.borderColor,label:l?h(e.data):null}}));return(0,g.jsx)("g",{children:c.map((function(e){return(0,g.jsx)(r.F_,{x:e.x,y:e.y,datum:e.datum,symbol:n,size:i,color:e.fill,borderWidth:o,borderColor:e.stroke,label:e.label,labelYOffset:a,theme:u},e.id)}))})})),he=(0,i.memo)((function(e){var t=e.points,n=e.width,r=e.height,o=e.margin,l=e.setCurrent,s=e.onMouseEnter,u=e.onMouseMove,h=e.onMouseLeave,c=e.onClick,d=e.tooltip,f=e.debug,y=(0,a.lL)(),p=y.showTooltipAt,m=y.hideTooltip,x=(0,i.useCallback)((function(e,t){p((0,i.createElement)(d,{point:e}),[e.x+o.left,e.y+o.top],"top"),l(e),s&&s(e,t)}),[l,p,d,s,o]),b=(0,i.useCallback)((function(e,t){p((0,i.createElement)(d,{point:e}),[e.x+o.left,e.y+o.top],"top"),l(e),u&&u(e,t)}),[l,p,d,u]),v=(0,i.useCallback)((function(e,t){m(),l(null),h&&h(e,t)}),[m,l,h]),_=(0,i.useCallback)((function(e,t){c&&c(e,t)}),[c]);return(0,g.jsx)($,{nodes:t,width:n,height:r,onMouseEnter:x,onMouseMove:b,onMouseLeave:v,onClick:_,debug:f})})),ce=function(e){var t=e.data,n=e.xScale,u=e.xFormat,h=e.yScale,c=e.yFormat,d=e.layers,f=e.curve,y=e.areaBaselineValue,p=e.colors,m=e.margin,x=e.width,b=e.height,v=e.axisTop,_=e.axisRight,w=e.axisBottom,S=e.axisLeft,M=e.enableGridX,k=e.enableGridY,C=e.gridXValues,O=e.gridYValues,j=e.lineWidth,T=e.enableArea,A=e.areaOpacity,P=e.areaBlendMode,R=e.enablePoints,B=e.pointSymbol,q=e.pointSize,F=e.pointColor,E=e.pointBorderWidth,L=e.pointBorderColor,W=e.enablePointLabel,I=e.pointLabel,G=e.pointLabelYOffset,V=e.defs,$=e.fill,z=e.markers,Z=e.legends,D=e.isInteractive,U=e.useMesh,X=e.debugMesh,K=e.onMouseEnter,N=e.onMouseMove,Q=e.onMouseLeave,J=e.onClick,ee=e.tooltip,te=e.enableSlices,ie=e.debugSlices,oe=e.sliceTooltip,se=e.enableCrosshair,ce=e.crosshairType,de=e.role,fe=(0,r.Bs)(x,b,m),ge=fe.margin,ye=fe.innerWidth,pe=fe.innerHeight,me=fe.outerWidth,xe=fe.outerHeight,be=ne({data:t,xScale:n,xFormat:u,yScale:h,yFormat:c,width:ye,height:pe,colors:p,curve:f,areaBaselineValue:y,pointColor:F,pointBorderColor:L,enableSlices:te}),ve=be.legendData,_e=be.toggleSerie,we=be.lineGenerator,Se=be.areaGenerator,Me=be.series,ke=be.xScale,Ce=be.yScale,Oe=be.slices,je=be.points,Te=(0,r.Fg)(),Ae=(0,o.Bf)(F,Te),Pe=(0,o.Bf)(L,Te),Re=H((0,i.useState)(null),2),Be=Re[0],qe=Re[1],Fe=H((0,i.useState)(null),2),Ee=Fe[0],Le=Fe[1],We={grid:(0,g.jsx)(l.rj,{theme:Te,width:ye,height:pe,xScale:M?ke:null,yScale:k?Ce:null,xValues:C,yValues:O},"grid"),markers:(0,g.jsx)(r.TL,{markers:z,width:ye,height:pe,xScale:ke,yScale:Ce,theme:Te},"markers"),axes:(0,g.jsx)(l.dk,{xScale:ke,yScale:Ce,width:ye,height:pe,theme:Te,top:v,right:_,bottom:w,left:S},"axes"),areas:null,lines:(0,g.jsx)(le,{lines:Me,lineGenerator:we,lineWidth:j},"lines"),slices:null,points:null,crosshair:null,mesh:null,legends:Z.map((function(e,t){return(0,g.jsx)(s.$6,Y(Y({},e),{},{containerWidth:ye,containerHeight:pe,data:e.data||ve,theme:Te,toggleSerie:e.toggleSerie?_e:void 0}),"legend.".concat(t))}))},Ie=(0,r.yU)(V,Me,$);return T&&(We.areas=(0,g.jsx)(re,{areaGenerator:Se,areaOpacity:A,areaBlendMode:P,lines:Me},"areas")),D&&!1!==te&&(We.slices=(0,g.jsx)(ae,{slices:Oe,axis:te,debug:ie,height:pe,tooltip:oe,current:Ee,setCurrent:Le},"slices")),R&&(We.points=(0,g.jsx)(ue,{points:je,symbol:B,size:q,color:Ae,borderWidth:E,borderColor:Pe,enableLabel:W,label:I,labelYOffset:G},"points")),D&&se&&(null!==Be&&(We.crosshair=(0,g.jsx)(a.YS,{width:ye,height:pe,x:Be.x,y:Be.y,type:ce},"crosshair")),null!==Ee&&(We.crosshair=(0,g.jsx)(a.YS,{width:ye,height:pe,x:Ee.x,y:Ee.y,type:te},"crosshair"))),D&&U&&!1===te&&(We.mesh=(0,g.jsx)(he,{points:je,width:ye,height:pe,margin:ge,current:Be,setCurrent:qe,onMouseEnter:K,onMouseMove:N,onMouseLeave:Q,onClick:J,tooltip:ee,debug:X},"mesh")),(0,g.jsx)(r.tM,{defs:Ie,width:me,height:xe,margin:ge,role:de,children:d.map((function(t,n){return"function"===typeof t?(0,g.jsx)(i.Fragment,{children:t(Y(Y({},e),{},{innerWidth:ye,innerHeight:pe,series:Me,slices:Oe,points:je,xScale:ke,yScale:Ce,lineGenerator:we,areaGenerator:Se,currentPoint:Be,setCurrentPoint:qe,currentSlice:Ee,setCurrentSlice:Le}))},n):We[t]}))})};ce.defaultProps=ee;var de=(0,r.li)(ce),fe=function(e){return(0,g.jsx)(r.d,{children:function(t){var n=t.width,i=t.height;return(0,g.jsx)(de,Y({width:n,height:i},e))}})},ge=function(e){var t=e.width,n=e.height,o=e.margin,u=e.pixelRatio,h=e.data,c=e.xScale,d=e.xFormat,f=e.yScale,y=e.yFormat,p=e.curve,m=e.layers,x=e.colors,b=e.lineWidth,v=e.enableArea,_=e.areaBaselineValue,w=e.areaOpacity,S=e.enablePoints,M=e.pointSize,k=e.pointColor,C=e.pointBorderWidth,O=e.pointBorderColor,j=e.enableGridX,T=e.gridXValues,A=e.enableGridY,P=e.gridYValues,R=e.axisTop,B=e.axisRight,q=e.axisBottom,F=e.axisLeft,E=e.legends,L=e.isInteractive,W=e.debugMesh,G=e.onMouseLeave,V=e.onClick,$=e.tooltip,z=e.canvasRef,Z=(0,i.useRef)(null),D=(0,r.Bs)(t,n,o),U=D.margin,X=D.innerWidth,K=D.innerHeight,N=D.outerWidth,Q=D.outerHeight,J=(0,r.Fg)(),ee=H((0,i.useState)(null),2),te=ee[0],ie=ee[1],re=ne({data:h,xScale:c,xFormat:d,yScale:f,yFormat:y,width:X,height:K,colors:x,curve:p,areaBaselineValue:_,pointColor:k,pointBorderColor:O}),oe=re.lineGenerator,le=re.areaGenerator,se=re.series,ae=re.xScale,ue=re.yScale,he=re.points,ce=I({points:he,width:X,height:K,debug:W}),de=ce.delaunay,fe=ce.voronoi;(0,i.useEffect)((function(){z&&(z.current=Z.current),Z.current.width=N*u,Z.current.height=Q*u;var e=Z.current.getContext("2d");e.scale(u,u),e.fillStyle=J.background,e.fillRect(0,0,N,Q),e.translate(U.left,U.top),m.forEach((function(t){if("function"===typeof t&&t({ctx:e,innerWidth:X,innerHeight:K,series:se,points:he,xScale:ae,yScale:ue,lineWidth:b,lineGenerator:oe,areaGenerator:le,currentPoint:te,setCurrentPoint:ie}),"grid"===t&&J.grid.line.strokeWidth>0&&(e.lineWidth=J.grid.line.strokeWidth,e.strokeStyle=J.grid.line.stroke,j&&(0,l.FA)(e,{width:X,height:K,scale:ae,axis:"x",values:T}),A&&(0,l.FA)(e,{width:X,height:K,scale:ue,axis:"y",values:P})),"axes"===t&&(0,l.DZ)(e,{xScale:ae,yScale:ue,width:X,height:K,top:R,right:B,bottom:q,left:F,theme:J}),"areas"===t&&!0===v&&(e.save(),e.globalAlpha=w,le.context(e),se.forEach((function(t){e.fillStyle=t.color,e.beginPath(),le(t.data.map((function(e){return e.position}))),e.fill()})),e.restore()),"lines"===t&&(oe.context(e),se.forEach((function(t){e.strokeStyle=t.color,e.lineWidth=b,e.beginPath(),oe(t.data.map((function(e){return e.position}))),e.stroke()}))),"points"===t&&!0===S&&M>0&&he.forEach((function(t){e.fillStyle=t.color,e.beginPath(),e.arc(t.x,t.y,M/2,0,2*Math.PI),e.fill(),C>0&&(e.strokeStyle=t.borderColor,e.lineWidth=C,e.stroke())})),"mesh"===t&&!0===W&&(function(e,t){e.save(),e.globalAlpha=.75,e.beginPath(),t.render(e),e.strokeStyle="red",e.lineWidth=1,e.stroke(),e.restore()}(e,fe),te&&function(e,t,n){e.save(),e.globalAlpha=.35,e.beginPath(),t.renderCell(n,e),e.fillStyle="red",e.fill(),e.restore()}(e,fe,te.index)),"legends"===t){var n=se.map((function(e){return{id:e.id,label:e.id,color:e.color}})).reverse();E.forEach((function(t){(0,s.as)(e,Y(Y({},t),{},{data:t.data||n,containerWidth:X,containerHeight:K,theme:J}))}))}}))}),[Z,N,Q,m,J,oe,se,ae,ue,j,T,A,P,R,B,q,F,E,he,S,M,te]);var ge=(0,i.useCallback)((function(e){var t=H((0,r.P6)(Z.current,e),2),n=t[0],i=t[1];if(!(0,r.zn)(U.left,U.top,X,K,n,i))return null;var o=de.find(n-U.left,i-U.top);return he[o]}),[Z,U,X,K,de]),ye=(0,a.lL)(),pe=ye.showTooltipFromEvent,me=ye.hideTooltip,xe=(0,i.useCallback)((function(e){var t=ge(e);ie(t),t?pe((0,i.createElement)($,{point:t}),e):me()}),[ge,ie,pe,me,$]),be=(0,i.useCallback)((function(e){me(),ie(null),te&&G&&G(te,e)}),[me,ie,G]),ve=(0,i.useCallback)((function(e){if(V){var t=ge(e);t&&V(t,e)}}),[ge,V]);return(0,g.jsx)("canvas",{ref:Z,width:N*u,height:Q*u,style:{width:N,height:Q,cursor:L?"auto":"normal"},onMouseEnter:L?xe:void 0,onMouseMove:L?xe:void 0,onMouseLeave:L?be:void 0,onClick:L?ve:void 0})};ge.defaultProps=te;var ye=(0,r.li)(ge),pe=(0,i.forwardRef)((function(e,t){return(0,g.jsx)(ye,Y(Y({},e),{},{canvasRef:t}))}));(0,i.forwardRef)((function(e,t){return(0,g.jsx)(r.d,{children:function(n){var i=n.width,r=n.height;return(0,g.jsx)(pe,Y(Y({width:i,height:r},e),{},{ref:t}))}})}))},37633:function(e,t,n){n.d(t,{Z:function(){return a}});var i=n(11108),r=n(93072),o=n(18143),l=n(25049),s=n(78260);function a(){var e=s.x,t=null,n=(0,r.Z)(0),a=s.y,u=(0,r.Z)(!0),h=null,c=o.Z,d=null;function f(r){var o,l,s,f,g,y=r.length,p=!1,m=new Array(y),x=new Array(y);for(null==h&&(d=c(g=(0,i.Z)())),o=0;o<=y;++o){if(!(o<y&&u(f=r[o],o,r))===p)if(p=!p)l=o,d.areaStart(),d.lineStart();else{for(d.lineEnd(),d.lineStart(),s=o-1;s>=l;--s)d.point(m[s],x[s]);d.lineEnd(),d.areaEnd()}p&&(m[o]=+e(f,o,r),x[o]=+n(f,o,r),d.point(t?+t(f,o,r):m[o],a?+a(f,o,r):x[o]))}if(g)return d=null,g+""||null}function g(){return(0,l.Z)().defined(u).curve(c).context(h)}return f.x=function(n){return arguments.length?(e="function"===typeof n?n:(0,r.Z)(+n),t=null,f):e},f.x0=function(t){return arguments.length?(e="function"===typeof t?t:(0,r.Z)(+t),f):e},f.x1=function(e){return arguments.length?(t=null==e?null:"function"===typeof e?e:(0,r.Z)(+e),f):t},f.y=function(e){return arguments.length?(n="function"===typeof e?e:(0,r.Z)(+e),a=null,f):n},f.y0=function(e){return arguments.length?(n="function"===typeof e?e:(0,r.Z)(+e),f):n},f.y1=function(e){return arguments.length?(a=null==e?null:"function"===typeof e?e:(0,r.Z)(+e),f):a},f.lineX0=f.lineY0=function(){return g().x(e).y(n)},f.lineY1=function(){return g().x(e).y(a)},f.lineX1=function(){return g().x(t).y(n)},f.defined=function(e){return arguments.length?(u="function"===typeof e?e:(0,r.Z)(!!e),f):u},f.curve=function(e){return arguments.length?(c=e,null!=h&&(d=c(h)),f):c},f.context=function(e){return arguments.length?(null==e?h=d=null:d=c(h=e),f):h},f}}}]);