g2-lite.min.js 742 KB

12345678910
  1. !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@antv/g"),require("@antv/g-canvas")):"function"==typeof define&&define.amd?define(["exports","@antv/g","@antv/g-canvas"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).G2={},t.window.G,t.window.G.Canvas2D)}(this,function(m,nt,_){"use strict";const E="main-layer",st="label-layer",lt="element",U="view",ct="plot",ut="component",ft="label",ht="area";var N="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};function P(t,e,n,r,i){!function t(e,n,r,i,a){for(;r<i;){600<i-r&&(o=i-r+1,u=n-r+1,l=Math.log(o),s=.5*Math.exp(2*l/3),l=.5*Math.sqrt(l*s*(o-s)/o)*(u-o/2<0?-1:1),c=Math.max(r,Math.floor(n-u*s/o+l)),u=Math.min(i,Math.floor(n+(o-u)*s/o+l)),t(e,n,c,u,a));var o,s,l,c,u,f=e[n],h=r,d=i;for(C(e,r,n),0<a(e[i],f)&&C(e,r,i);h<d;){for(C(e,h,d),h++,d--;a(e[h],f)<0;)h++;for(;0<a(e[d],f);)d--}0===a(e[r],f)?C(e,r,d):C(e,++d,i),d<=n&&(r=d+1),n<=d&&(i=d-1)}}(t,e,n||0,r||t.length-1,i||I)}function C(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function I(t,e){return t<e?-1:e<t?1:0}function B(t,e){F(t,0,t.children.length,e,t)}function F(t,e,n,r,i){(i=i||Y(null)).minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(var a=e;a<n;a++){var o=t.children[a];D(i,t.leaf?r(o):o)}return i}function D(t,e){t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY)}function z(t,e){return t.minX-e.minX}function W(t,e){return t.minY-e.minY}function G(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function q(t){return t.maxX-t.minX+(t.maxY-t.minY)}function H(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function V(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function Y(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function K(t,e,n,r,i){for(var a,o=[e,n];o.length;)(n=o.pop())-(e=o.pop())<=r||(P(t,a=e+Math.ceil((n-e)/r/2)*r,e,n,i),o.push(e,a,a,n))}(e=function(t){void 0===t&&(t=9),this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()}).prototype.all=function(){return this._all(this.data,[])},e.prototype.search=function(t){var e=this.data,n=[];if(V(t,e))for(var r=this.toBBox,i=[];e;){for(var a=0;a<e.children.length;a++){var o=e.children[a],s=e.leaf?r(o):o;V(t,s)&&(e.leaf?n.push(o):H(t,s)?this._all(o,n):i.push(o))}e=i.pop()}return n},e.prototype.collides=function(t){var e=this.data;if(V(t,e))for(var n=[];e;){for(var r=0;r<e.children.length;r++){var i=e.children[r],a=e.leaf?this.toBBox(i):i;if(V(t,a)){if(e.leaf||H(t,a))return!0;n.push(i)}}e=n.pop()}return!1},e.prototype.load=function(t){if(t&&t.length)if(t.length<this._minEntries)for(var e=0;e<t.length;e++)this.insert(t[e]);else{var n,r=this._build(t.slice(),0,t.length-1,0);this.data.children.length?this.data.height===r.height?this._splitRoot(this.data,r):(this.data.height<r.height&&(n=this.data,this.data=r,r=n),this._insert(r,this.data.height-r.height-1,!0)):this.data=r}return this},e.prototype.insert=function(t){return t&&this._insert(t,this.data.height-1),this},e.prototype.clear=function(){return this.data=Y([]),this},e.prototype.remove=function(t,e){if(t)for(var n,r,i,a=this.data,o=this.toBBox(t),s=[],l=[];a||s.length;){if(a||(a=s.pop(),r=s[s.length-1],n=l.pop(),i=!0),a.leaf){var c=function(t,e,n){if(!n)return e.indexOf(t);for(var r=0;r<e.length;r++)if(n(t,e[r]))return r;return-1}(t,a.children,e);if(-1!==c)return a.children.splice(c,1),s.push(a),this._condense(s),this}i||a.leaf||!H(a,o)?r?(n++,a=r.children[n],i=!1):a=null:(s.push(a),l.push(n),a=(r=a).children[n=0])}return this},e.prototype.toBBox=function(t){return t},e.prototype.compareMinX=function(t,e){return t.minX-e.minX},e.prototype.compareMinY=function(t,e){return t.minY-e.minY},e.prototype.toJSON=function(){return this.data},e.prototype.fromJSON=function(t){return this.data=t,this},e.prototype._all=function(t,e){for(var n=[];t;)t.leaf?e.push.apply(e,t.children):n.push.apply(n,t.children),t=n.pop();return e},e.prototype._build=function(t,e,n,r){var i,a=n-e+1,o=this._maxEntries;if(a<=o)B(i=Y(t.slice(e,n+1)),this.toBBox);else{r||(r=Math.ceil(Math.log(a)/Math.log(o)),o=Math.ceil(a/Math.pow(o,r-1))),(i=Y([])).leaf=!1,i.height=r;var s=Math.ceil(a/o),l=s*Math.ceil(Math.sqrt(o));K(t,e,n,l,this.compareMinX);for(var c=e;c<=n;c+=l){var u=Math.min(c+l-1,n);K(t,c,u,s,this.compareMinY);for(var f=c;f<=u;f+=s){var h=Math.min(f+s-1,u);i.children.push(this._build(t,f,h,r-1))}}B(i,this.toBBox)}return i},e.prototype._chooseSubtree=function(t,e,n,r){for(;;){if(r.push(e),e.leaf||r.length-1===n)break;for(var i=1/0,a=1/0,o=void 0,s=0;s<e.children.length;s++){var l=e.children[s],c=G(l),u=(f=t,u=l,(Math.max(u.maxX,f.maxX)-Math.min(u.minX,f.minX))*(Math.max(u.maxY,f.maxY)-Math.min(u.minY,f.minY))-c);u<a?(a=u,i=c<i?c:i,o=l):u===a&&c<i&&(i=c,o=l)}e=o||e.children[0]}var f,u;return e},e.prototype._insert=function(t,e,n){var n=n?t:this.toBBox(t),r=[],i=this._chooseSubtree(n,this.data,e,r);for(i.children.push(t),D(i,n);0<=e&&r[e].children.length>this._maxEntries;)this._split(r,e),e--;this._adjustParentBBoxes(n,r,e)},e.prototype._split=function(t,e){var n=t[e],r=n.children.length,i=this._minEntries,i=(this._chooseSplitAxis(n,i,r),this._chooseSplitIndex(n,i,r)),r=Y(n.children.splice(i,n.children.length-i));r.height=n.height,r.leaf=n.leaf,B(n,this.toBBox),B(r,this.toBBox),e?t[e-1].children.push(r):this._splitRoot(n,r)},e.prototype._splitRoot=function(t,e){this.data=Y([t,e]),this.data.height=t.height+1,this.data.leaf=!1,B(this.data,this.toBBox)},e.prototype._chooseSplitIndex=function(t,e,n){for(var r,i,a,o,s=1/0,l=1/0,c=e;c<=n-e;c++){var u=F(t,0,c,this.toBBox),f=F(t,c,n,this.toBBox),h=(i=u,h=f,d=o=a=void 0,a=Math.max(i.minX,h.minX),o=Math.max(i.minY,h.minY),d=Math.min(i.maxX,h.maxX),i=Math.min(i.maxY,h.maxY),Math.max(0,d-a)*Math.max(0,i-o)),d=G(u)+G(f);h<s?(s=h,r=c,l=d<l?d:l):h===s&&d<l&&(l=d,r=c)}return r||n-e},e.prototype._chooseSplitAxis=function(t,e,n){var r=t.leaf?this.compareMinX:z,i=t.leaf?this.compareMinY:W;this._allDistMargin(t,e,n,r)<this._allDistMargin(t,e,n,i)&&t.children.sort(r)},e.prototype._allDistMargin=function(t,e,n,r){t.children.sort(r);for(var i=this.toBBox,a=F(t,0,e,i),o=F(t,n-e,n,i),s=q(a)+q(o),l=e;l<n-e;l++){var c=t.children[l];D(a,t.leaf?i(c):c),s+=q(a)}for(var u=n-e-1;e<=u;u--){var f=t.children[u];D(o,t.leaf?i(f):f),s+=q(o)}return s},e.prototype._adjustParentBBoxes=function(t,e,n){for(var r=n;0<=r;r--)D(e[r],t)},e.prototype._condense=function(t){for(var e=t.length-1,n=void 0;0<=e;e--)0===t[e].children.length?0<e?(n=t[e-1].children).splice(n.indexOf(t[e]),1):this.clear():B(t[e],this.toBBox)};var X=1e-6,Z="undefined"!=typeof Float32Array?Float32Array:Array;function Q(){var t=new Z(9);return Z!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var J=function(t,e,n){var r=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],c=e[6],u=e[7],e=e[8],f=n[0],h=n[1],d=n[2],p=n[3],g=n[4],m=n[5],y=n[6],v=n[7],n=n[8];return t[0]=f*r+h*o+d*c,t[1]=f*i+h*s+d*u,t[2]=f*a+h*l+d*e,t[3]=p*r+g*o+m*c,t[4]=p*i+g*s+m*u,t[5]=p*a+g*l+m*e,t[6]=y*r+v*o+n*c,t[7]=y*i+v*s+n*u,t[8]=y*a+v*l+n*e,t};function tt(){var t=new Z(16);return Z!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function et(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function dt(t,e,n,r,i,a,o,s,l,c,u,f,h,d,p,g,m){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=l,t[8]=c,t[9]=u,t[10]=f,t[11]=h,t[12]=d,t[13]=p,t[14]=g,t[15]=m,t}function pt(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function gt(t,e){var n,r,i,a,o,s;return t===e?(n=e[1],r=e[2],i=e[3],a=e[6],o=e[7],s=e[11],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=a,t[11]=e[14],t[12]=i,t[13]=o,t[14]=s):(t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15]),t}function mt(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],s=e[5],l=e[6],c=e[7],u=e[8],f=e[9],h=e[10],d=e[11],p=e[12],g=e[13],m=e[14],e=e[15],y=n*s-r*o,v=n*l-i*o,b=n*c-a*o,x=r*l-i*s,w=r*c-a*s,M=i*c-a*l,O=u*g-f*p,k=u*m-h*p,_=u*e-d*p,E=f*m-h*g,S=f*e-d*g,A=h*e-d*m,L=y*A-v*S+b*E+x*_-w*k+M*O;return L?(t[0]=(s*A-l*S+c*E)*(L=1/L),t[1]=(i*S-r*A-a*E)*L,t[2]=(g*M-m*w+e*x)*L,t[3]=(h*w-f*M-d*x)*L,t[4]=(l*_-o*A-c*k)*L,t[5]=(n*A-i*_+a*k)*L,t[6]=(m*b-p*M-e*v)*L,t[7]=(u*M-h*b+d*v)*L,t[8]=(o*S-s*_+c*O)*L,t[9]=(r*_-n*S-a*O)*L,t[10]=(p*w-g*b+e*y)*L,t[11]=(f*b-u*w-d*y)*L,t[12]=(s*k-o*E-l*O)*L,t[13]=(n*E-r*k+i*O)*L,t[14]=(g*v-p*x-m*y)*L,t[15]=(u*x-f*v+h*y)*L,t):null}function yt(t){var e=t[0],n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],l=t[7],c=t[8],u=t[9],f=t[10],h=t[11],d=t[12],p=t[13],g=t[14],t=t[15];return(e*o-n*a)*(f*t-h*g)-(e*s-r*a)*(u*t-h*p)+(e*l-i*a)*(u*g-f*p)+(n*s-r*o)*(c*t-h*d)-(n*l-i*o)*(c*g-f*d)+(r*l-i*s)*(c*p-u*d)}function vt(t,e,n){var r=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],c=e[6],u=e[7],f=e[8],h=e[9],d=e[10],p=e[11],g=e[12],m=e[13],y=e[14],e=e[15],v=n[0],b=n[1],x=n[2],w=n[3];return t[0]=v*r+b*s+x*f+w*g,t[1]=v*i+b*l+x*h+w*m,t[2]=v*a+b*c+x*d+w*y,t[3]=v*o+b*u+x*p+w*e,v=n[4],b=n[5],x=n[6],w=n[7],t[4]=v*r+b*s+x*f+w*g,t[5]=v*i+b*l+x*h+w*m,t[6]=v*a+b*c+x*d+w*y,t[7]=v*o+b*u+x*p+w*e,v=n[8],b=n[9],x=n[10],w=n[11],t[8]=v*r+b*s+x*f+w*g,t[9]=v*i+b*l+x*h+w*m,t[10]=v*a+b*c+x*d+w*y,t[11]=v*o+b*u+x*p+w*e,v=n[12],b=n[13],x=n[14],w=n[15],t[12]=v*r+b*s+x*f+w*g,t[13]=v*i+b*l+x*h+w*m,t[14]=v*a+b*c+x*d+w*y,t[15]=v*o+b*u+x*p+w*e,t}function bt(t,e,n){var r,i,a,o,s,l,c,u,f,h,d,p,g=n[0],m=n[1],n=n[2];return e===t?(t[12]=e[0]*g+e[4]*m+e[8]*n+e[12],t[13]=e[1]*g+e[5]*m+e[9]*n+e[13],t[14]=e[2]*g+e[6]*m+e[10]*n+e[14],t[15]=e[3]*g+e[7]*m+e[11]*n+e[15]):(r=e[0],i=e[1],a=e[2],o=e[3],s=e[4],l=e[5],c=e[6],u=e[7],f=e[8],h=e[9],d=e[10],p=e[11],t[0]=r,t[1]=i,t[2]=a,t[3]=o,t[4]=s,t[5]=l,t[6]=c,t[7]=u,t[8]=f,t[9]=h,t[10]=d,t[11]=p,t[12]=r*g+s*m+f*n+e[12],t[13]=i*g+l*m+h*n+e[13],t[14]=a*g+c*m+d*n+e[14],t[15]=o*g+u*m+p*n+e[15]),t}function xt(t,e,n){var r=n[0],i=n[1],n=n[2];return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*n,t[9]=e[9]*n,t[10]=e[10]*n,t[11]=e[11]*n,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function wt(t,e,n){var r=Math.sin(n),n=Math.cos(n),i=e[4],a=e[5],o=e[6],s=e[7],l=e[8],c=e[9],u=e[10],f=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=i*n+l*r,t[5]=a*n+c*r,t[6]=o*n+u*r,t[7]=s*n+f*r,t[8]=l*n-i*r,t[9]=c*n-a*r,t[10]=u*n-o*r,t[11]=f*n-s*r,t}function Mt(t,e,n){var r=Math.sin(n),n=Math.cos(n),i=e[0],a=e[1],o=e[2],s=e[3],l=e[8],c=e[9],u=e[10],f=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=i*n-l*r,t[1]=a*n-c*r,t[2]=o*n-u*r,t[3]=s*n-f*r,t[8]=i*r+l*n,t[9]=a*r+c*n,t[10]=o*r+u*n,t[11]=s*r+f*n,t}function Ot(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=e[0],t[13]=e[1],t[14]=e[2],t[15]=1,t}function kt(t,e,n){var r=e[0],i=e[1],a=e[2],e=e[3],o=r+r,s=i+i,l=a+a,c=r*o,u=r*s,r=r*l,f=i*s,i=i*l,a=a*l,o=e*o,s=e*s,e=e*l;return t[0]=1-(f+a),t[1]=u+e,t[2]=r-s,t[3]=0,t[4]=u-e,t[5]=1-(c+a),t[6]=i+o,t[7]=0,t[8]=r+s,t[9]=i-o,t[10]=1-(c+f),t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t}function _t(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function Et(t,e){var n=e[0],r=e[1],i=e[2],a=e[4],o=e[5],s=e[6],l=e[8],c=e[9],e=e[10];return t[0]=Math.hypot(n,r,i),t[1]=Math.hypot(a,o,s),t[2]=Math.hypot(l,c,e),t}function St(t,e){var n=new Z(3),r=(Et(n,e),1/n[0]),i=1/n[1],n=1/n[2],a=e[0]*r,o=e[1]*i,s=e[2]*n,l=e[4]*r,c=e[5]*i,u=e[6]*n,r=e[8]*r,i=e[9]*i,e=e[10]*n,n=a+c+e,f=0;return 0<n?(f=2*Math.sqrt(1+n),t[3]=.25*f,t[0]=(u-i)/f,t[1]=(r-s)/f,t[2]=(o-l)/f):c<a&&e<a?(f=2*Math.sqrt(1+a-c-e),t[3]=(u-i)/f,t[0]=.25*f,t[1]=(o+l)/f,t[2]=(r+s)/f):e<c?(f=2*Math.sqrt(1+c-a-e),t[3]=(r-s)/f,t[0]=(o+l)/f,t[1]=.25*f,t[2]=(u+i)/f):(f=2*Math.sqrt(1+e-a-c),t[3]=(o-l)/f,t[0]=(r+s)/f,t[1]=(u+i)/f,t[2]=.25*f),t}function At(t,e,n,r,i){var a=e[0],o=e[1],s=e[2],e=e[3],l=a+a,c=o+o,u=s+s,f=a*l,h=a*c,a=a*u,d=o*c,o=o*u,s=s*u,l=e*l,c=e*c,e=e*u,u=r[0],p=r[1],r=r[2],g=i[0],m=i[1],i=i[2],y=(1-(d+s))*u,v=(h+e)*u,u=(a-c)*u,h=(h-e)*p,e=(1-(f+s))*p,s=(o+l)*p,p=(a+c)*r,a=(o-l)*r,c=(1-(f+d))*r;return t[0]=y,t[1]=v,t[2]=u,t[3]=0,t[4]=h,t[5]=e,t[6]=s,t[7]=0,t[8]=p,t[9]=a,t[10]=c,t[11]=0,t[12]=n[0]+g-(y*g+h*m+p*i),t[13]=n[1]+m-(v*g+e*m+a*i),t[14]=n[2]+i-(u*g+s*m+c*i),t[15]=1,t}function Lt(t,e){var n=e[0],r=e[1],i=e[2],e=e[3],a=n+n,o=r+r,s=i+i,n=n*a,l=r*a,r=r*o,c=i*a,u=i*o,i=i*s,a=e*a,o=e*o,e=e*s;return t[0]=1-r-i,t[1]=l+e,t[2]=c-o,t[3]=0,t[4]=l-e,t[5]=1-n-i,t[6]=u+a,t[7]=0,t[8]=c+o,t[9]=u-a,t[10]=1-n-r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Tt(t,e,n,r,i){e=1/Math.tan(e/2);return t[0]=e/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(t[10]=(i+r)*(n=1/(r-i)),t[14]=2*i*r*n):(t[10]=-1,t[14]=-2*r),t}function jt(t,e,n,r,i,a,o){var s=1/(e-n),l=1/(r-i),c=1/(a-o);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+n)*s,t[13]=(i+r)*l,t[14]=(o+a)*c,t[15]=1,t}var Nt=jt;function Pt(t,e,n,r){var i,a,o,s,l=e[0],c=e[1],e=e[2],u=r[0],f=r[1],r=r[2],h=n[0],d=n[1],n=n[2];return Math.abs(l-h)<X&&Math.abs(c-d)<X&&Math.abs(e-n)<X?pt(t):(h=l-h,d=c-d,n=e-n,i=f*(n*=s=1/Math.hypot(h,d,n))-r*(d*=s),r=r*(h*=s)-u*n,u=u*d-f*h,(s=Math.hypot(i,r,u))?(i*=s=1/s,r*=s,u*=s):u=r=i=0,f=d*u-n*r,a=n*i-h*u,o=h*r-d*i,(s=Math.hypot(f,a,o))?(f*=s=1/s,a*=s,o*=s):o=a=f=0,t[0]=i,t[1]=f,t[2]=h,t[3]=0,t[4]=r,t[5]=a,t[6]=d,t[7]=0,t[8]=u,t[9]=o,t[10]=n,t[11]=0,t[12]=-(i*l+r*c+u*e),t[13]=-(f*l+a*c+o*e),t[14]=-(h*l+d*c+n*e),t[15]=1,t)}function Ct(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t[6]=e[6]-n[6],t[7]=e[7]-n[7],t[8]=e[8]-n[8],t[9]=e[9]-n[9],t[10]=e[10]-n[10],t[11]=e[11]-n[11],t[12]=e[12]-n[12],t[13]=e[13]-n[13],t[14]=e[14]-n[14],t[15]=e[15]-n[15],t}var Rt=Object.freeze({__proto__:null,create:tt,clone:function(t){var e=new Z(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},copy:et,fromValues:function(t,e,n,r,i,a,o,s,l,c,u,f,h,d,p,g){var m=new Z(16);return m[0]=t,m[1]=e,m[2]=n,m[3]=r,m[4]=i,m[5]=a,m[6]=o,m[7]=s,m[8]=l,m[9]=c,m[10]=u,m[11]=f,m[12]=h,m[13]=d,m[14]=p,m[15]=g,m},set:dt,identity:pt,transpose:gt,invert:mt,adjoint:function(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],s=e[5],l=e[6],c=e[7],u=e[8],f=e[9],h=e[10],d=e[11],p=e[12],g=e[13],m=e[14],e=e[15];return t[0]=s*(h*e-d*m)-f*(l*e-c*m)+g*(l*d-c*h),t[1]=-(r*(h*e-d*m)-f*(i*e-a*m)+g*(i*d-a*h)),t[2]=r*(l*e-c*m)-s*(i*e-a*m)+g*(i*c-a*l),t[3]=-(r*(l*d-c*h)-s*(i*d-a*h)+f*(i*c-a*l)),t[4]=-(o*(h*e-d*m)-u*(l*e-c*m)+p*(l*d-c*h)),t[5]=n*(h*e-d*m)-u*(i*e-a*m)+p*(i*d-a*h),t[6]=-(n*(l*e-c*m)-o*(i*e-a*m)+p*(i*c-a*l)),t[7]=n*(l*d-c*h)-o*(i*d-a*h)+u*(i*c-a*l),t[8]=o*(f*e-d*g)-u*(s*e-c*g)+p*(s*d-c*f),t[9]=-(n*(f*e-d*g)-u*(r*e-a*g)+p*(r*d-a*f)),t[10]=n*(s*e-c*g)-o*(r*e-a*g)+p*(r*c-a*s),t[11]=-(n*(s*d-c*f)-o*(r*d-a*f)+u*(r*c-a*s)),t[12]=-(o*(f*m-h*g)-u*(s*m-l*g)+p*(s*h-l*f)),t[13]=n*(f*m-h*g)-u*(r*m-i*g)+p*(r*h-i*f),t[14]=-(n*(s*m-l*g)-o*(r*m-i*g)+p*(r*l-i*s)),t[15]=n*(s*h-l*f)-o*(r*h-i*f)+u*(r*l-i*s),t},determinant:yt,multiply:vt,translate:bt,scale:xt,rotate:function(t,e,n,r){var i,a,o,s,l,c,u,f,h,d,p,g,m,y,v,b,x,w,M,O,k=r[0],_=r[1],r=r[2],E=Math.hypot(k,_,r);return E<X?null:(k*=E=1/E,_*=E,r*=E,E=Math.sin(n),n=Math.cos(n),a=e[0],o=e[1],s=e[2],l=e[3],c=e[4],u=e[5],f=e[6],h=e[7],d=e[8],p=e[9],g=e[10],m=e[11],v=k*_*(i=1-n)-r*E,b=_*_*i+n,x=r*_*i+k*E,w=k*r*i+_*E,M=_*r*i-k*E,O=r*r*i+n,t[0]=a*(n=k*k*i+n)+c*(y=_*k*i+r*E)+d*(r=r*k*i-_*E),t[1]=o*n+u*y+p*r,t[2]=s*n+f*y+g*r,t[3]=l*n+h*y+m*r,t[4]=a*v+c*b+d*x,t[5]=o*v+u*b+p*x,t[6]=s*v+f*b+g*x,t[7]=l*v+h*b+m*x,t[8]=a*w+c*M+d*O,t[9]=o*w+u*M+p*O,t[10]=s*w+f*M+g*O,t[11]=l*w+h*M+m*O,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)},rotateX:wt,rotateY:Mt,rotateZ:function(t,e,n){var r=Math.sin(n),n=Math.cos(n),i=e[0],a=e[1],o=e[2],s=e[3],l=e[4],c=e[5],u=e[6],f=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=i*n+l*r,t[1]=a*n+c*r,t[2]=o*n+u*r,t[3]=s*n+f*r,t[4]=l*n-i*r,t[5]=c*n-a*r,t[6]=u*n-o*r,t[7]=f*n-s*r,t},fromTranslation:Ot,fromScaling:function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},fromRotation:function(t,e,n){var r,i=n[0],a=n[1],n=n[2],o=Math.hypot(i,a,n);return o<X?null:(i*=o=1/o,a*=o,n*=o,o=Math.sin(e),e=Math.cos(e),t[0]=i*i*(r=1-e)+e,t[1]=a*i*r+n*o,t[2]=n*i*r-a*o,t[3]=0,t[4]=i*a*r-n*o,t[5]=a*a*r+e,t[6]=n*a*r+i*o,t[7]=0,t[8]=i*n*r+a*o,t[9]=a*n*r-i*o,t[10]=n*n*r+e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)},fromXRotation:function(t,e){var n=Math.sin(e),e=Math.cos(e);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=n,t[7]=0,t[8]=0,t[9]=-n,t[10]=e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},fromYRotation:function(t,e){var n=Math.sin(e),e=Math.cos(e);return t[0]=e,t[1]=0,t[2]=-n,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=n,t[9]=0,t[10]=e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},fromZRotation:function(t,e){var n=Math.sin(e),e=Math.cos(e);return t[0]=e,t[1]=n,t[2]=0,t[3]=0,t[4]=-n,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},fromRotationTranslation:kt,fromQuat2:function(t,e){var n=new Z(3),r=-e[0],i=-e[1],a=-e[2],o=e[3],s=e[4],l=e[5],c=e[6],u=e[7],f=r*r+i*i+a*a+o*o;return 0<f?(n[0]=2*(s*o+u*r+l*a-c*i)/f,n[1]=2*(l*o+u*i+c*r-s*a)/f,n[2]=2*(c*o+u*a+s*i-l*r)/f):(n[0]=2*(s*o+u*r+l*a-c*i),n[1]=2*(l*o+u*i+c*r-s*a),n[2]=2*(c*o+u*a+s*i-l*r)),kt(t,e,n),t},getTranslation:_t,getScaling:Et,getRotation:St,fromRotationTranslationScale:function(t,e,n,r){var i=e[0],a=e[1],o=e[2],e=e[3],s=i*(u=i+i),l=i*(f=a+a),i=i*(h=o+o),c=a*f,a=a*h,o=o*h,u=e*u,f=e*f,e=e*h,h=r[0],d=r[1],r=r[2];return t[0]=(1-(c+o))*h,t[1]=(l+e)*h,t[2]=(i-f)*h,t[3]=0,t[4]=(l-e)*d,t[5]=(1-(s+o))*d,t[6]=(a+u)*d,t[7]=0,t[8]=(i+f)*r,t[9]=(a-u)*r,t[10]=(1-(s+c))*r,t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t},fromRotationTranslationScaleOrigin:At,fromQuat:Lt,frustum:function(t,e,n,r,i,a,o){var s=1/(n-e),l=1/(i-r),c=1/(a-o);return t[0]=2*a*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*a*l,t[6]=0,t[7]=0,t[8]=(n+e)*s,t[9]=(i+r)*l,t[10]=(o+a)*c,t[11]=-1,t[12]=0,t[13]=0,t[14]=o*a*2*c,t[15]=0,t},perspectiveNO:Tt,perspective:Tt,perspectiveZO:function(t,e,n,r,i){return e=1/Math.tan(e/2),t[0]=e/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(t[10]=i*(n=1/(r-i)),t[14]=i*r*n):(t[10]=-1,t[14]=-r),t},perspectiveFromFieldOfView:function(t,e,n,r){var i=Math.tan(e.upDegrees*Math.PI/180),a=Math.tan(e.downDegrees*Math.PI/180),o=Math.tan(e.leftDegrees*Math.PI/180),e=Math.tan(e.rightDegrees*Math.PI/180),s=2/(o+e),l=2/(i+a);return t[0]=s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=l,t[6]=0,t[7]=0,t[8]=-(o-e)*s*.5,t[9]=(i-a)*l*.5,t[10]=r/(n-r),t[11]=-1,t[12]=0,t[13]=0,t[14]=r*n/(n-r),t[15]=0,t},orthoNO:jt,ortho:Nt,orthoZO:function(t,e,n,r,i,a,o){var s=1/(e-n),l=1/(r-i),o=1/(a-o);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=o,t[11]=0,t[12]=(e+n)*s,t[13]=(i+r)*l,t[14]=a*o,t[15]=1,t},lookAt:Pt,targetTo:function(t,e,n,r){var i=e[0],a=e[1],e=e[2],o=r[0],s=r[1],r=r[2],l=i-n[0],c=a-n[1],n=e-n[2],u=l*l+c*c+n*n,f=(0<u&&(l*=u=1/Math.sqrt(u),c*=u,n*=u),s*n-r*c);return 0<(u=f*f+(r=r*l-o*n)*r+(o=o*c-s*l)*o)&&(f*=u=1/Math.sqrt(u),r*=u,o*=u),t[0]=f,t[1]=r,t[2]=o,t[3]=0,t[4]=c*o-n*r,t[5]=n*f-l*o,t[6]=l*r-c*f,t[7]=0,t[8]=l,t[9]=c,t[10]=n,t[11]=0,t[12]=i,t[13]=a,t[14]=e,t[15]=1,t},str:function(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"},frob:function(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])},add:function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t[6]=e[6]+n[6],t[7]=e[7]+n[7],t[8]=e[8]+n[8],t[9]=e[9]+n[9],t[10]=e[10]+n[10],t[11]=e[11]+n[11],t[12]=e[12]+n[12],t[13]=e[13]+n[13],t[14]=e[14]+n[14],t[15]=e[15]+n[15],t},subtract:Ct,multiplyScalar:function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*n,t[9]=e[9]*n,t[10]=e[10]*n,t[11]=e[11]*n,t[12]=e[12]*n,t[13]=e[13]*n,t[14]=e[14]*n,t[15]=e[15]*n,t},multiplyScalarAndAdd:function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t[4]=e[4]+n[4]*r,t[5]=e[5]+n[5]*r,t[6]=e[6]+n[6]*r,t[7]=e[7]+n[7]*r,t[8]=e[8]+n[8]*r,t[9]=e[9]+n[9]*r,t[10]=e[10]+n[10]*r,t[11]=e[11]+n[11]*r,t[12]=e[12]+n[12]*r,t[13]=e[13]+n[13]*r,t[14]=e[14]+n[14]*r,t[15]=e[15]+n[15]*r,t},exactEquals:function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]},equals:function(t,e){var n=t[0],r=t[1],i=t[2],a=t[3],o=t[4],s=t[5],l=t[6],c=t[7],u=t[8],f=t[9],h=t[10],d=t[11],p=t[12],g=t[13],m=t[14],t=t[15],y=e[0],v=e[1],b=e[2],x=e[3],w=e[4],M=e[5],O=e[6],k=e[7],_=e[8],E=e[9],S=e[10],A=e[11],L=e[12],T=e[13],j=e[14],e=e[15];return Math.abs(n-y)<=X*Math.max(1,Math.abs(n),Math.abs(y))&&Math.abs(r-v)<=X*Math.max(1,Math.abs(r),Math.abs(v))&&Math.abs(i-b)<=X*Math.max(1,Math.abs(i),Math.abs(b))&&Math.abs(a-x)<=X*Math.max(1,Math.abs(a),Math.abs(x))&&Math.abs(o-w)<=X*Math.max(1,Math.abs(o),Math.abs(w))&&Math.abs(s-M)<=X*Math.max(1,Math.abs(s),Math.abs(M))&&Math.abs(l-O)<=X*Math.max(1,Math.abs(l),Math.abs(O))&&Math.abs(c-k)<=X*Math.max(1,Math.abs(c),Math.abs(k))&&Math.abs(u-_)<=X*Math.max(1,Math.abs(u),Math.abs(_))&&Math.abs(f-E)<=X*Math.max(1,Math.abs(f),Math.abs(E))&&Math.abs(h-S)<=X*Math.max(1,Math.abs(h),Math.abs(S))&&Math.abs(d-A)<=X*Math.max(1,Math.abs(d),Math.abs(A))&&Math.abs(p-L)<=X*Math.max(1,Math.abs(p),Math.abs(L))&&Math.abs(g-T)<=X*Math.max(1,Math.abs(g),Math.abs(T))&&Math.abs(m-j)<=X*Math.max(1,Math.abs(m),Math.abs(j))&&Math.abs(t-e)<=X*Math.max(1,Math.abs(t),Math.abs(e))},mul:vt,sub:Ct});function It(){var t=new Z(3);return Z!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function Bt(t){var e=t[0],n=t[1],t=t[2];return Math.hypot(e,n,t)}function Ft(t,e,n){var r=new Z(3);return r[0]=t,r[1]=e,r[2]=n,r}function Dt(t,e){t[0]=e[0],t[1]=e[1],t[2]=e[2]}function zt(t,e,n,r){return t[0]=e,t[1]=n,t[2]=r,t}function Wt(t,e,n){t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2]}function Gt(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function qt(t,e){var n=e[0],r=e[1],i=e[2],n=n*n+r*r+i*i;0<n&&(n=1/Math.sqrt(n)),t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n}function Ht(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Vt(t,e,n){var r=e[0],i=e[1],e=e[2],a=n[0],o=n[1],n=n[2];t[0]=i*n-e*o,t[1]=e*a-r*n,t[2]=r*o-i*a}function Yt(t,e,n){var r=e[0],i=e[1],e=e[2],a=n[3]*r+n[7]*i+n[11]*e+n[15];return t[0]=(n[0]*r+n[4]*i+n[8]*e+n[12])/(a=a||1),t[1]=(n[1]*r+n[5]*i+n[9]*e+n[13])/a,t[2]=(n[2]*r+n[6]*i+n[10]*e+n[14])/a,t}function $t(t,e,n){var r=e[0],i=e[1],e=e[2];t[0]=r*n[0]+i*n[3]+e*n[6],t[1]=r*n[1]+i*n[4]+e*n[7],t[2]=r*n[2]+i*n[5]+e*n[8]}function Ut(t,e){var n=t[0],r=t[1],t=t[2],i=e[0],a=e[1],e=e[2];return Math.abs(n-i)<=X*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(r-a)<=X*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(t-e)<=X*Math.max(1,Math.abs(t),Math.abs(e))}var Kt=Bt;function Xt(){var t=new Z(4);return Z!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function Zt(t,e,n){var r=e[0],i=e[1],a=e[2],e=e[3];return t[0]=n[0]*r+n[4]*i+n[8]*a+n[12]*e,t[1]=n[1]*r+n[5]*i+n[9]*a+n[13]*e,t[2]=n[2]*r+n[6]*i+n[10]*a+n[14]*e,t[3]=n[3]*r+n[7]*i+n[11]*a+n[15]*e,t}function Qt(){var t=new Z(4);return Z!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function Jt(t,e,n){n*=.5;var r=Math.sin(n);return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=Math.cos(n),t}function te(t,e,n){var r=e[0],i=e[1],a=e[2],e=e[3],o=n[0],s=n[1],l=n[2],n=n[3];return t[0]=r*n+e*o+i*l-a*s,t[1]=i*n+e*s+a*o-r*l,t[2]=a*n+e*l+r*s-i*o,t[3]=e*n-r*o-i*s-a*l,t}function ee(t,e){var n=e[0],r=e[1],i=e[2],e=e[3],a=n*n+r*r+i*i+e*e,a=a?1/a:0;return t[0]=-n*a,t[1]=-r*a,t[2]=-i*a,t[3]=e*a,t}function ne(t,e,n,r){var i=.5*Math.PI/180,i=(e*=i,n*=i,r*=i,Math.sin(e)),e=Math.cos(e),a=Math.sin(n),n=Math.cos(n),o=Math.sin(r),r=Math.cos(r);t[0]=i*n*r-e*a*o,t[1]=e*a*r+i*n*o,t[2]=e*n*o-i*a*r,t[3]=e*n*r+i*a*o}It(),Xt();var re=function(t,e,n,r){var i=new Z(4);return i[0]=t,i[1]=e,i[2]=n,i[3]=r,i},ie=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},ae=te,oe=function(t,e){var n=e[0],r=e[1],i=e[2],e=e[3],a=n*n+r*r+i*i+e*e;return 0<a&&(a=1/Math.sqrt(a)),t[0]=n*a,t[1]=r*a,t[2]=i*a,t[3]=e*a,t};function se(t){return t.map(function(t){return Array.isArray(t)?[].concat(t):t})}It(),Ft(1,0,0),Ft(0,1,0),Qt(),Qt(),Q(),e=new Z(2),Z!=Float32Array&&(e[0]=0,e[1]=0);var le=function(t,e){return(le=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}))(t,e)};function ce(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}le(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var y=function(){return(y=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};function rt(t,e){var n={};for(i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]]);return n}function t(t,e,n,r){var i,a=arguments.length,o=a<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;0<=s;s--)(i=t[s])&&(o=(a<3?i(o):3<a?i(e,n,o):i(e,n))||o);return 3<a&&o&&Object.defineProperty(e,n,o),o}function ue(t,o,s,l){return new(s=s||Promise)(function(n,e){function r(t){try{a(l.next(t))}catch(t){e(t)}}function i(t){try{a(l.throw(t))}catch(t){e(t)}}function a(t){var e;t.done?n(t.value):((e=t.value)instanceof s?e:new s(function(t){t(e)})).then(r,i)}a((l=l.apply(t,o||[])).next())})}function fe(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return{value:(t=t&&r>=t.length?void 0:t)&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function O(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||0<e--)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o}function v(t,e,n){if(n||2===arguments.length)for(var r,i=0,a=e.length;i<a;i++)!r&&i in e||((r=r||Array.prototype.slice.call(e,0,i))[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}function he(t,e,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t===e&&r:e.has(t))return"m"===n?r:"a"===n?r.call(t):r?r.value:e.get(t);throw new TypeError("Cannot read private member from an object whose class did not declare it")}var de={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null};var pe={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function ge(t){return Array.isArray(t)&&t.every(function(t){var e=t[0].toLowerCase();return pe[e]===t.length-1&&"achlmqstvz".includes(e)})}function me(t){return ge(t)&&t.every(function(t){t=t[0];return t===t.toUpperCase()})}function ye(t){return me(t)&&t.every(function(t){t=t[0];return"ACLMQZ".includes(t)})}function ve(t){for(var e=t.pathValue[t.segmentStart],n=e.toLowerCase(),r=t.data;r.length>=pe[n]&&("m"===n&&2<r.length?(t.segments.push([e].concat(r.splice(0,2))),n="l",e="m"===e?"l":"L"):t.segments.push([e].concat(r.splice(0,pe[n]))),pe[n]););}function be(t){return 48<=t&&t<=57}function xe(t){for(var e,n=t.pathValue,r=t.max;t.index<r&&(10===(e=n.charCodeAt(t.index))||13===e||8232===e||8233===e||32===e||9===e||11===e||12===e||160===e||5760<=e&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].includes(e));)t.index+=1}function we(t){var e,n,r,i,a,o=t.max,s=t.pathValue,l=t.index,c=s.charCodeAt(l),u=pe[s[l].toLowerCase()];if(t.segmentStart=l,function(t){switch(32|t){case 109:case 122:case 108:case 104:case 118:case 99:case 115:case 113:case 116:case 97:return 1;default:return}}(c)){if(t.index+=1,xe(t),t.data=[],u)for(;;){for(var f=u;0<f;--f){if(97!=(32|c)||3!==f&&4!==f?function(t){var e,n,r=t.max,i=t.pathValue,a=t.index,o=a,s=!1,l=!1,c=!1;if(r<=o)t.err="[path-util]: Invalid path value at index "+o+', "pathValue" is missing param';else if(be(n=43!==(n=i.charCodeAt(o))&&45!==n?n:i.charCodeAt(o+=1))||46===n){if(46!==n){if(e=48===n,n=i.charCodeAt(o+=1),e&&o<r&&n&&be(n))return t.err="[path-util]: Invalid path value at index "+a+', "'+i[a]+'" illegal number';for(;o<r&&be(i.charCodeAt(o));)o+=1,s=!0;n=i.charCodeAt(o)}if(46===n){for(c=!0,o+=1;be(i.charCodeAt(o));)o+=1,l=!0;n=i.charCodeAt(o)}if(101===n||69===n){if(c&&!s&&!l)return t.err="[path-util]: Invalid path value at index "+o+', "'+i[o]+'" invalid float exponent';if(43!==(n=i.charCodeAt(o+=1))&&45!==n||(o+=1),!(o<r&&be(i.charCodeAt(o))))return t.err="[path-util]: Invalid path value at index "+o+', "'+i[o]+'" invalid integer exponent';for(;o<r&&be(i.charCodeAt(o));)o+=1}t.index=o,t.param=+t.pathValue.slice(a,o)}else t.err="[path-util]: Invalid path value at index "+o+', "'+i[o]+'" is not a number'}(t):(a=i=r=void 0,r=(n=t).index,i=n.pathValue,48===(a=i.charCodeAt(r))?(n.param=0,n.index+=1):49===a?(n.param=1,n.index+=1):n.err='[path-util]: invalid Arc flag "'+i[r]+'", expecting 0 or 1 at index '+r),t.err.length)return;t.data.push(t.param),xe(t),t.index<o&&44===s.charCodeAt(t.index)&&(t.index+=1,xe(t))}if(t.index>=t.max)break;if(!(48<=(e=s.charCodeAt(t.index))&&e<=57||43===e||45===e||46===e))break}ve(t)}else t.err='[path-util]: Invalid path value "'+s[l]+'" is not a path command'}var Me=function(t){this.pathValue=t,this.segments=[],this.max=t.length,this.index=0,this.param=0,this.segmentStart=0,this.data=[],this.err=""};function Oe(t){var o,s,l,c;return me(t)?se(t):(t=function(t){if(ge(t))return se(t);var e=new Me(t);for(xe(e);e.index<e.max&&!e.err.length;)we(e);return e.err||e.segments}(t),c=l=s=o=0,t.map(function(t){var e=t.slice(1).map(Number),t=t[0],n=t.toUpperCase();if("M"===t)return o=e[0],s=e[1],["M",l=o,c=s];if(t!==n)switch(n){case"A":i=[n,e[0],e[1],e[2],e[3],e[4],e[5]+o,e[6]+s];break;case"V":i=[n,e[0]+s];break;case"H":i=[n,e[0]+o];break;default:var r=e.map(function(t,e){return t+(e%2?s:o)}),i=[n].concat(r)}else i=[n].concat(e);var a=i.length;switch(n){case"Z":o=l,s=c;break;case"H":o=i[1];break;case"V":s=i[1];break;default:o=i[a-2],s=i[a-1],"M"===n&&(l=o,c=s)}return i}))}function ke(t){if(ye(t))return se(t);for(var e,n,r,i,a,o,s,l=Oe(t),c=y({},de),u=0;u<l.length;u+=1){l[u]=(e=l[u],n=c,s=o=h=a=f=i=r=void 0,r=e[0],i=n.x1,f=n.y1,a=n.x2,h=n.y2,o=e.slice(1).map(Number),s=e,"TQ".includes(r)||(n.qx=null,n.qy=null),"H"===r?s=["L",e[1],f]:"V"===r?s=["L",i,e[1]]:"S"===r?(e=2*f-h,s=["C",n.x1=2*i-a,n.y1=e].concat(o)):"T"===r?(h=2*i-n.qx,a=2*f-n.qy,s=["Q",n.qx=h,n.qy=a].concat(o)):"Q"===r&&(e=o[0],i=o[1],n.qx=e,n.qy=i),s);var f=l[u],h=f.length;c.x1=+f[h-2],c.y1=+f[h-1],c.x2=+f[h-4]||c.x1,c.y2=+f[h-3]||c.y1}return l}function _e(t,e,n){return{x:t*Math.cos(n)-e*Math.sin(n),y:t*Math.sin(n)+e*Math.cos(n)}}function Ee(t,e,n){var r=t[0],t=t[1];return[r+(e[0]-r)*n,t+(e[1]-t)*n]}function Se(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}function Ae(t,e,n,r,i){var a=Se([t,e],[n,r]),o={x:0,y:0};return{length:a,point:o="number"==typeof i?i<=0?{x:t,y:e}:a<=i?{x:n,y:r}:{x:(i=Ee([t,e],[n,r],i/a))[0],y:i[1]}:o,min:{x:Math.min(t,n),y:Math.min(e,r)},max:{x:Math.max(t,n),y:Math.max(e,r)}}}function Le(t,e,n,r){var t=[t,e],e=[n,r],i=Ee(t,e,.5),e=Ee(e,i,.5),a=Ee(i,e,.5),o=Ee(e,a,.5),s=Ee(a,o,.5),t=Ae(t[0],t[1],i[0],i[1],a[0]).point,i=Ae(s[0],s[1],o[0],o[1],e[0]).point;return[t.x,t.y,i.x,i.y,n,r]}function Te(t,e){var n,r,i,a,o,s,l=t[0],c=t.slice(1).map(Number),u=c[0],f=c[1],h=e.x1,d=e.y1,p=e.x,g=e.y;switch("TQ".includes(l)||(e.qx=null,e.qy=null),l){case"M":return e.x=u,e.y=f,t;case"A":return s=[h,d].concat(c),["C"].concat(function t(e,n,r,i,a,o,s,l,c,u){var f=120*Math.PI/180,h=Math.PI/180*(+a||0),d=[],p=(u?(x=u[0],w=u[1],v=u[2],b=u[3]):(e=(m=_e(e,n,-h)).x,n=m.y,1<(p=(g=(e-(l=(m=_e(l,c,-h)).x))/2)*g/(r*r)+(m=(n-(c=m.y))/2)*m/(i*i))&&(r*=p=Math.sqrt(p),i*=p),p=r*r,y=i*i,v=(o=(o===s?-1:1)*Math.sqrt(Math.abs((p*y-p*m*m-y*g*g)/(p*m*m+y*g*g))))*r*m/i+(e+l)/2,b=o*-i*g/r+(n+c)/2,x=Math.asin(((n-b)/i*Math.pow(10,9)>>0)/Math.pow(10,9)),w=Math.asin(((c-b)/i*Math.pow(10,9)>>0)/Math.pow(10,9)),x=e<v?Math.PI-x:x,w=l<v?Math.PI-w:w,x<0&&(x=2*Math.PI+x),w<0&&(w=2*Math.PI+w),s&&w<x&&(x-=2*Math.PI),!s&&x<w&&(w-=2*Math.PI)),w-x),g=(Math.abs(p)>f&&(y=w,m=l,o=c,w=x+f*(s&&x<w?1:-1),d=t(l=v+r*Math.cos(w),c=b+i*Math.sin(w),r,i,a,0,s,m,o,[w,y,v,b])),p=w-x,Math.cos(x)),f=Math.sin(x),a=Math.cos(w),s=Math.sin(w),m=Math.tan(p/4),o=4/3*r*m,y=4/3*i*m,v=[e,n],b=[e+o*f,n-y*g],x=[l+o*s,c-y*a],w=[l,c];if(b[0]=2*v[0]-b[0],b[1]=2*v[1]-b[1],u)return b.concat(x,w,d);for(var M=[],O=0,k=(d=b.concat(x,w,d)).length;O<k;O+=1)M[O]=O%2?_e(d[O-1],d[O],h).y:_e(d[O],d[O+1],h).x;return M}(s[0],s[1],s[2],s[3],s[4],s[5],s[6],s[7],s[8],s[9]));case"Q":return e.qx=u,e.qy=f,s=[h,d].concat(c),["C"].concat((n=s[0],r=s[1],i=s[2],a=s[3],o=s[4],s=s[5],[1/3*n+2/3*i,1/3*r+2/3*a,1/3*o+2/3*i,1/3*s+2/3*a,o,s]));case"L":return["C"].concat(Le(h,d,u,f));case"Z":return h===p&&d===g?["C",h,d,p,g,p,g]:["C"].concat(Le(h,d,p,g))}return t}function je(t,e){var n;if(void 0===e&&(e=!1),ye(n=t)&&n.every(function(t){t=t[0];return"MC".includes(t)}))return n=se(t),e?[n,[]]:n;for(var r,i=ke(t),a=y({},de),o=[],s="",l=i.length,c=[],u=0;u<l;u+=1){i[u]&&(s=i[u][0]),o[u]=s;var f=Te(i[u],a),h=(i[u]=f,m=g=p=d=h=void 0,i),d=o,p=u;if(7<h[p].length){h[p].shift();for(var g=h[p],m=p;g.length;)d[p]="A",h.splice(m+=1,0,["C"].concat(g.splice(0,6)));h.splice(p,1)}l=i.length,"Z"===s&&c.push(u),r=(f=i[u]).length,a.x1=+f[r-2],a.y1=+f[r-1],a.x2=+f[r-4]||a.x1,a.y2=+f[r-3]||a.y1}return e?[i,c]:i}function Ne(t,e,n,r,i,a,o,s,l,c){var u=c.bbox,f=void 0===u||u,u=c.length,h=void 0===u||u,u=c.sampleSize,d=void 0===u?10:u,p="number"==typeof l,g=t,m=e,y=0,v=[g,m,y],b=[g,m],x={x:0,y:0},w=[{x:g,y:m}];p&&l<=0&&(x={x:g,y:m});for(var M,O,k,_,E,S,A,L,T,j,N=0;N<=d;N+=1)M=t,O=e,k=n,_=r,E=i,S=a,A=o,L=s,j=void 0,j=1-(T=N/d),g=(M={x:Math.pow(j,3)*M+3*Math.pow(j,2)*T*k+3*j*Math.pow(T,2)*E+Math.pow(T,3)*A,y:Math.pow(j,3)*O+3*Math.pow(j,2)*T*_+3*j*Math.pow(T,2)*S+Math.pow(T,3)*L}).x,m=M.y,f&&w.push({x:g,y:m}),h&&(y+=Se(b,[g,m])),b=[g,m],p&&l<=y&&l>v[2]&&(k=(y-l)/(y-v[2]),x={x:b[0]*(1-k)+v[0]*k,y:b[1]*(1-k)+v[1]*k}),v=[g,m,y];return{length:y,point:x=p&&y<=l?{x:o,y:s}:x,min:{x:Math.min.apply(null,w.map(function(t){return t.x})),y:Math.min.apply(null,w.map(function(t){return t.y}))},max:{x:Math.max.apply(null,w.map(function(t){return t.x})),y:Math.max.apply(null,w.map(function(t){return t.y}))}}}function Pe(t){return(c=l=s=0)<=je(t).map(function(t){var e,n,r,i,a,o;return"M"===t[0]?(s=t[1],l=t[2],0):(o=t.slice(1),e=o[0],n=o[1],r=o[2],i=o[3],a=o[4],o=o[5],c=3*((o-l)*(e+r)-(a-s)*(n+i)+n*(s-r)-e*(l-i)+o*(r+s/3)-a*(i+l/3))/20,n=t.slice(-2),s=n[0],l=n[1],c)}).reduce(function(t,e){return t+e},0);var s,l,c}function Ce(t){return t.map(function(t,e,n){var r,i,a,o,n=e&&n[e-1].slice(-2).concat(t.slice(1)),s=e?Ne(n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7],n[8],{bbox:!1}).length:0,n=e?s?(void 0===r&&(r=.5),n=(e=n).slice(0,2),i=e.slice(2,4),a=e.slice(4,6),e=e.slice(6,8),n=Ee(n,i,r),i=Ee(i,a,r),a=Ee(a,e,r),o=Ee(n,i,r),i=Ee(i,a,r),r=Ee(o,i,r),[["C"].concat(n,o,r),["C"].concat(i,a,e)]):[t,t]:[t];return{s:t,ss:n,l:s}})}var Re=function(t){return null!==t&&"function"!=typeof t&&isFinite(t.length)},Ie=function(t){return"function"==typeof t},p=function(t){return null==t},Be={}.toString,Fe=function(t,e){return Be.call(t)==="[object "+e+"]"},De=function(t){return Array.isArray?Array.isArray(t):Fe(t,"Array")},ze=function(t){var e=typeof t;return null!==t&&"object"==e||"function"==e},We=function(t){return"object"==typeof t&&null!==t},Ge=function(t){if(!We(t)||!Fe(t,"Object"))return!1;if(null===Object.getPrototypeOf(t))return!0;for(var e=t;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e},qe=function(t){if(De(t))return t.reduce(function(t,e){return Math.max(t,e)},t[0])},He=function(t){if(De(t))return t.reduce(function(t,e){return Math.min(t,e)},t[0])},Ve=function(t){return Fe(t,"String")};var Ye=function(t,e,n){return t<e?e:n<t?n:t},$e=function(t){return Fe(t,"Number")};function Ue(t){return p(t)?"":t.toString()}var Ke=function(t,e){return(t%e+e)%e},Xe=function(t){t=Ue(t);return t.charAt(0).toLowerCase()+t.substring(1)};function Ze(t){if("object"!=typeof t||null===t)return t;if(De(t))for(var e=[],n=0,r=t.length;n<r;n++)"object"==typeof t[n]&&null!=t[n]?e[n]=Ze(t[n]):e[n]=t[n];else for(var i in e={},t)"object"==typeof t[i]&&null!=t[i]?e[i]=Ze(t[i]):e[i]=t[i];return e}var Qe=function(t){t=Ue(t);return t.charAt(0).toUpperCase()+t.substring(1)},Je=function(t){return Fe(t,"Boolean")},tn=function(t){return void 0===t},en=Ze;function nn(r,i,a){var o;return function(){var t=this,e=arguments,n=a&&!o;clearTimeout(o),o=setTimeout(function(){o=null,a||r.apply(t,e)},i),n&&r.apply(t,e)}}function rn(a,o){var s;if(Ie(a))return(s=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n,r=o?o.apply(this,t):t[0],i=s.cache;return i.has(r)?i.get(r):(n=a.apply(this,t),i.set(r,n),n)}).cache=new Map,s;throw new TypeError("Expected a function")}var an=5;function on(t,e){if(t===e)return!0;if(t&&e&&!Ve(t)&&!Ve(e)){if(Re(t)||Re(e)){if(t.length!==e.length)return!1;for(var n=!0,r=0;r<t.length&&(n=on(t[r],e[r]));r++);return n}if(We(t)||We(e)){var i=Object.keys(t),a=Object.keys(e);if(i.length!==a.length)return!1;for(n=!0,r=0;r<i.length&&(n=on(t[i[r]],e[i[r]]));r++);return n}}return!1}function sn(){}var it=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r+=1)!function t(e,n,r,i){for(var a in r=r||0,i=i||an,n){var o;n.hasOwnProperty(a)&&(null!==(o=n[a])&&Ge(o)?(Ge(e[a])||(e[a]={}),r<i?t(e[a],o,r+1,i):e[a]=n[a]):De(o)?(e[a]=[],e[a]=e[a].concat(o)):void 0!==o&&(e[a]=o))}}(t,e[r]);return t},ln=on,cn=function(t,e,n){for(var r=0,i=Ve(e)?e.split("."):e;t&&r<i.length;)t=t[i[r++]];return void 0===t||r<i.length?n:t},un=function(n,r,i){function a(){u=!1===i.leading?0:Date.now(),o=null,c=n.apply(s,l),o||(s=l=null)}function t(){var t=Date.now(),e=(u||!1!==i.leading||(u=t),r-(t-u));return s=this,l=arguments,e<=0||r<e?(o&&(clearTimeout(o),o=null),u=t,c=n.apply(s,l),o||(s=l=null)):o||!1===i.trailing||(o=setTimeout(a,e)),c}var o,s,l,c,u=0;i=i||{};return t.cancel=function(){clearTimeout(o),u=0,o=s=l=null},t};function fn(t,e,n){(t.prototype=e.prototype=n).constructor=t}function hn(t,e){var n,r=Object.create(t.prototype);for(n in e)r[n]=e[n];return r}function dn(){}var e="\\s*([+-]?\\d+)\\s*",n="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",r="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",pn=/^#([0-9a-f]{3,8})$/,gn=new RegExp("^rgb\\("+[e,e,e]+"\\)$"),mn=new RegExp("^rgb\\("+[r,r,r]+"\\)$"),yn=new RegExp("^rgba\\("+[e,e,e,n]+"\\)$"),vn=new RegExp("^rgba\\("+[r,r,r,n]+"\\)$"),bn=new RegExp("^hsl\\("+[n,r,r]+"\\)$"),xn=new RegExp("^hsla\\("+[n,r,r,n]+"\\)$"),wn={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function Mn(){return this.rgb().formatHex()}function On(){return this.rgb().formatRgb()}function kn(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=pn.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?_n(e):3===n?new Sn(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?En(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?En(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=gn.exec(t))?new Sn(e[1],e[2],e[3],1):(e=mn.exec(t))?new Sn(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=yn.exec(t))?En(e[1],e[2],e[3],e[4]):(e=vn.exec(t))?En(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=bn.exec(t))?jn(e[1],e[2]/100,e[3]/100,1):(e=xn.exec(t))?jn(e[1],e[2]/100,e[3]/100,e[4]):wn.hasOwnProperty(t)?_n(wn[t]):"transparent"===t?new Sn(NaN,NaN,NaN,0):null}function _n(t){return new Sn(t>>16&255,t>>8&255,255&t,1)}function En(t,e,n,r){return new Sn(t=r<=0?e=n=NaN:t,e,n,r)}function Sn(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function An(){return"#"+Tn(this.r)+Tn(this.g)+Tn(this.b)}function Ln(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}function Tn(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function jn(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||1<=n?t=e=NaN:e<=0&&(t=NaN),new Pn(t,e,n,r)}function Nn(t){var e,n,r,i,a,o,s,l;return t instanceof Pn?new Pn(t.h,t.s,t.l,t.opacity):(t=t instanceof dn?t:kn(t))?t instanceof Pn?t:(e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=NaN,l=((a=Math.max(e,n,r))+i)/2,(s=a-i)?(o=e===a?(n-r)/s+6*(n<r):n===a?(r-e)/s+2:(e-n)/s+4,s/=l<.5?a+i:2-a-i,o*=60):s=0<l&&l<1?0:o,new Pn(o,s,l,t.opacity)):new Pn}function Pn(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function Cn(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}function Rn(t,e,n,r){t-=n,n=e-r;return Math.sqrt(t*t+n*n)}function In(t,e){return Math.abs(t-e)<.001}function Bn(t,e){var n=Math.min.apply(Math,t),r=Math.min.apply(Math,e);return{x:n,y:r,width:Math.max.apply(Math,t)-n,height:Math.max.apply(Math,e)-r}}function Fn(t){return(t+2*Math.PI)%(2*Math.PI)}fn(dn,kn,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:Mn,formatHex:Mn,formatHsl:function(){return Nn(this).formatHsl()},formatRgb:On,toString:On}),fn(Sn,function(t,e,n,r){return 1===arguments.length?(i=(i=t)instanceof dn?i:kn(i))?new Sn((i=i.rgb()).r,i.g,i.b,i.opacity):new Sn:new Sn(t,e,n,null==r?1:r);var i},hn(dn,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new Sn(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new Sn(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:An,formatHex:An,formatRgb:Ln,toString:Ln})),fn(Pn,function(t,e,n,r){return 1===arguments.length?Nn(t):new Pn(t,e,n,null==r?1:r)},hn(dn,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new Pn(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new Pn(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,e=n+(n<.5?n:1-n)*e,n=2*n-e;return new Sn(Cn(240<=t?t-240:120+t,n,e),Cn(t,n,e),Cn(t<120?240+t:t-120,n,e),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));var Dn={box:function(t,e,n,r){return Bn([t,n],[e,r])},length:Rn,pointAt:function(t,e,n,r,i){return{x:(1-i)*t+i*n,y:(1-i)*e+i*r}},pointDistance:function(t,e,n,r,i,a){var o=(n-t)*(i-t)+(r-e)*(a-e);return o<0?Rn(t,e,i,a):(n-t)*(n-t)+(r-e)*(r-e)<o?Rn(n,r,i,a):this.pointToLine(t,e,n,r,i,a)},pointToLine:function(t,e,n,r,i,a){var o,s,l,n=[n-t,r-e];return(r=n)[0]===(o=[0,0])[0]&&r[1]===o[1]?Math.sqrt((i-t)*(i-t)+(a-e)*(a-e)):(s=(n=o=r=[-n[1],n[0]])[0],l=n[1],0<(s=s*s+l*l)&&(s=1/Math.sqrt(s)),o[0]=n[0]*s,o[1]=n[1]*s,l=[i-t,a-e],Math.abs(l[0]*r[0]+l[1]*r[1]))},tangentAngle:function(t,e,n,r){return Math.atan2(r-e,n-t)}};function zn(t,e,n,r,i,a){for(var o=-1,s=1/0,l=[n,r],c=20,u=1/(c=a&&200<a?a/10:c),f=u/10,h=0;h<=c;h++){var d=h*u,p=[i.apply(void 0,t.concat([d])),i.apply(void 0,e.concat([d]))],p=Rn(l[0],l[1],p[0],p[1]);p<s&&(o=d,s=p)}if(0===o)return{x:t[0],y:e[0]};if(1===o)return{x:t[(n=t.length)-1],y:e[n-1]};for(var s=1/0,g=0;g<32&&!(f<1e-4);g++){var m=o-f,y=o+f,v=[i.apply(void 0,t.concat([m])),i.apply(void 0,e.concat([m]))],v=Rn(l[0],l[1],v[0],v[1]);0<=m&&v<s?(o=m,s=v):(m=[i.apply(void 0,t.concat([y])),i.apply(void 0,e.concat([y]))],v=Rn(l[0],l[1],m[0],m[1]),y<=1&&v<s?(o=y,s=v):f*=.5)}return{x:i.apply(void 0,t.concat([o])),y:i.apply(void 0,e.concat([o]))}}function Wn(t,e,n,r){var i=1-r;return i*i*t+2*r*i*e+r*r*n}function Gn(t,e,n){n=t+n-2*e;return In(n,0)?[.5]:(t=(t-e)/n)<=1&&0<=t?[t]:[]}function qn(t,e,n,r){return 2*(1-r)*(e-t)+2*r*(n-e)}function Hn(t,e,n,r,i,a,o){var s=Wn(t,n,i,o),l=Wn(e,r,a,o),c=Dn.pointAt(t,e,n,r,o),n=Dn.pointAt(n,r,i,a,o);return[[t,e,c.x,c.y,s,l],[s,l,n.x,n.y,i,a]]}function Vn(t,e,n,r,i,a,o){return 0===o?(Rn(t,e,n,r)+Rn(n,r,i,a)+Rn(t,e,i,a))/2:(e=(t=Hn(t,e,n,r,i,a,.5))[0],n=t[1],e.push(o-1),n.push(o-1),Vn.apply(void 0,e)+Vn.apply(void 0,n))}var Yn={box:function(t,e,n,r,i,a){var o=Gn(t,n,i)[0],s=Gn(e,r,a)[0],l=[t,i],c=[e,a];return void 0!==o&&l.push(Wn(t,n,i,o)),void 0!==s&&c.push(Wn(e,r,a,s)),Bn(l,c)},length:function(t,e,n,r,i,a){return Vn(t,e,n,r,i,a,3)},nearestPoint:function(t,e,n,r,i,a,o,s){return zn([t,n,i],[e,r,a],o,s,Wn)},pointDistance:function(t,e,n,r,i,a,o,s){t=this.nearestPoint(t,e,n,r,i,a,o,s);return Rn(t.x,t.y,o,s)},interpolationAt:Wn,pointAt:function(t,e,n,r,i,a,o){return{x:Wn(t,n,i,o),y:Wn(e,r,a,o)}},divide:Hn,tangentAngle:function(t,e,n,r,i,a,o){t=qn(t,n,i,o),n=qn(e,r,a,o);return Fn(Math.atan2(n,t))}};function $n(t,e,n,r,i){var a=1-i;return a*a*a*t+3*e*i*a*a+3*n*i*i*a+r*i*i*i}function Un(t,e,n,r,i){var a=1-i;return 3*(a*a*(e-t)+2*a*i*(n-e)+i*i*(r-n))}function Kn(t,e,n,r){var i,a,r=-3*t+9*e-9*n+3*r,n=6*t-12*e+6*n,e=3*e-3*t,t=[];return In(r,0)?In(n,0)||0<=(i=-e/n)&&i<=1&&t.push(i):In(e=n*n-4*r*e,0)?t.push(-n/(2*r)):0<e&&(a=(-n-(e=Math.sqrt(e)))/(2*r),0<=(i=(-n+e)/(2*r))&&i<=1&&t.push(i),0<=a)&&a<=1&&t.push(a),t}function Xn(t,e,n,r,i,a,o,s,l){var c=$n(t,n,i,o,l),u=$n(e,r,a,s,l),f=Dn.pointAt(t,e,n,r,l),n=Dn.pointAt(n,r,i,a,l),r=Dn.pointAt(i,a,o,s,l),i=Dn.pointAt(f.x,f.y,n.x,n.y,l),a=Dn.pointAt(n.x,n.y,r.x,r.y,l);return[[t,e,f.x,f.y,i.x,i.y,c,u],[c,u,a.x,a.y,r.x,r.y,o,s]]}function Zn(t,e,n,r,i,a,o,s,l){if(0===l){for(var c=[t,n,i,o],u=[e,r,a,s],f=0,h=c.length,d=0;d<h;d++)f+=Rn(c[d],u[d],c[(d+1)%h],u[(d+1)%h]);return f/2}t=Xn(t,e,n,r,i,a,o,s,.5),e=[].concat(t[0],[l-1]),n=[].concat(t[1],[l-1]);return Zn.apply(void 0,e)+Zn.apply(void 0,n)}var Qn={extrema:Kn,box:function(t,e,n,r,i,a,o,s){for(var l=[t,o],c=[e,s],u=Kn(t,n,i,o),f=Kn(e,r,a,s),h=0;h<u.length;h++)l.push($n(t,n,i,o,u[h]));for(var d=0;d<f.length;d++)c.push($n(e,r,a,s,f[d]));return Bn(l,c)},length:function(t,e,n,r,i,a,o,s){return Zn(t,e,n,r,i,a,o,s,3)},nearestPoint:function(t,e,n,r,i,a,o,s,l,c,u){return zn([t,n,i,o],[e,r,a,s],l,c,$n,u)},pointDistance:function(t,e,n,r,i,a,o,s,l,c,u){t=this.nearestPoint(t,e,n,r,i,a,o,s,l,c,u);return Rn(t.x,t.y,l,c)},interpolationAt:$n,pointAt:function(t,e,n,r,i,a,o,s,l){return{x:$n(t,n,i,o,l),y:$n(e,r,a,s,l)}},divide:Xn,tangentAngle:function(t,e,n,r,i,a,o,s,l){t=Un(t,n,i,o,l),n=Un(e,r,a,s,l);return Fn(Math.atan2(n,t))}};function Jn(t,e){t=Math.abs(t);return 0<e?t:-1*t}var tr=function(t,e,n,r,i,a){var o=n,s=r;if(0===o||0===s)return{x:t,y:e};for(var n=i-t,r=a-e,l=Math.abs(n),c=Math.abs(r),u=o*o,f=s*s,h=Math.PI/4,d=0,p=0,g=0;g<4;g++){var d=o*Math.cos(h),p=s*Math.sin(h),m=(u-f)*Math.pow(Math.cos(h),3)/o,y=(f-u)*Math.pow(Math.sin(h),3)/s,v=d-m,b=p-y,m=l-m,y=c-y,x=Math.hypot(b,v),w=Math.hypot(y,m);h+=x*Math.asin((v*y-b*m)/(x*w))/Math.sqrt(u+f-d*d-p*p),h=Math.min(Math.PI/2,Math.max(0,h))}return{x:t+Jn(d,n),y:e+Jn(p,r)}};function er(t,e,n,r,i,a){return n*Math.cos(i)*Math.cos(a)-r*Math.sin(i)*Math.sin(a)+t}function nr(t,e,n,r,i,a){return n*Math.sin(i)*Math.cos(a)+r*Math.cos(i)*Math.sin(a)+e}function rr(t,e,n){return{x:t*Math.cos(n),y:e*Math.sin(n)}}function ir(t,e,n){var r=Math.cos(n),n=Math.sin(n);return[t*r-e*n,t*n+e*r]}var ar={box:function(t,e,n,r,i,a,o){for(var s=Math.atan(-r/n*Math.tan(i)),l=1/0,c=-1/0,u=[a,o],f=2*-Math.PI;f<=2*Math.PI;f+=Math.PI){var h=s+f;a<o?a<h&&h<o&&u.push(h):o<h&&h<a&&u.push(h)}for(var d=0;d<u.length;d++){var p=er(t,0,n,r,i,u[d]);p<l&&(l=p),c<p&&(c=p)}for(var g=Math.atan(r/(n*Math.tan(i))),m=1/0,y=-1/0,v=[a,o],b=2*-Math.PI;b<=2*Math.PI;b+=Math.PI){var x=g+b;a<o?a<x&&x<o&&v.push(x):o<x&&x<a&&v.push(x)}for(var w=0;w<v.length;w++){var M=nr(0,e,n,r,i,v[w]);M<m&&(m=M),y<M&&(y=M)}return{x:l,y:m,width:c-l,height:y-m}},length:function(t,e,n,r,i,a,o){},nearestPoint:function(t,e,n,r,i,a,o,s,l){var s=ir(s-t,l-e,-i),l=s[0],s=s[1],l=tr(0,0,n,r,l,s),c=(s=l.x,c=l.y,(Math.atan2(c*n,s*r)+2*Math.PI)%(2*Math.PI)),s=(c<a?l=rr(n,r,a):o<c&&(l=rr(n,r,o)),ir(l.x,l.y,i));return{x:s[0]+t,y:s[1]+e}},pointDistance:function(t,e,n,r,i,a,o,s,l){t=this.nearestPoint(t,e,n,r,i,a,o,s,l);return Rn(t.x,t.y,s,l)},pointAt:function(t,e,n,r,i,a,o,s){o=(o-a)*s+a;return{x:er(t,0,n,r,i,o),y:nr(0,e,n,r,i,o)}},tangentAngle:function(t,e,n,r,i,a,o,s){var l,o=(o-a)*s+a,s=(s=r,a=i,l=o,-1*n*Math.cos(a)*Math.sin(l)-s*Math.sin(a)*Math.cos(l)),i=(a=r,l=i,r=o,-1*n*Math.sin(l)*Math.sin(r)+a*Math.cos(l)*Math.cos(r));return Fn(Math.atan2(i,s))}};function or(t){for(var e=0,n=[],r=0;r<t.length-1;r++){var i=t[r],a=t[r+1],o=Rn(i[0],i[1],a[0],a[1]);n.push({from:i,to:a,length:o}),e+=o}return{segments:n,totalLength:e}}var sr,lr,cr={box:function(t){for(var e=[],n=[],r=0;r<t.length;r++){var i=t[r];e.push(i[0]),n.push(i[1])}return Bn(e,n)},length:function(t){var e=t;if(e.length<2)return 0;for(var n=0,r=0;r<e.length-1;r++){var i=e[r],a=e[r+1];n+=Rn(i[0],i[1],a[0],a[1])}return n},pointAt:function(t,e){var n=e;if(1<n||n<0||t.length<2)return null;var e=or(t),r=e.segments,i=e.totalLength;if(0===i)return{x:t[0][0],y:t[0][1]};for(var a=0,o=null,s=0;s<r.length;s++){var l=r[s],c=l.from,u=l.to,l=l.length/i;if(a<=n&&n<=a+l){o=Dn.pointAt(c[0],c[1],u[0],u[1],(n-a)/l);break}a+=l}return o},pointDistance:function(t,e,n){for(var r=t,i=e,a=n,o=1/0,s=0;s<r.length-1;s++){var l=r[s],c=r[s+1],l=Dn.pointDistance(l[0],l[1],c[0],c[1],i,a);l<o&&(o=l)}return o},tangentAngle:function(t,e){var n=e;if(1<n||n<0||t.length<2)return 0;for(var r=(t=or(t)).segments,i=t.totalLength,a=0,o=0,s=0;s<r.length;s++){var l=r[s],c=l.from,u=l.to,l=l.length/i;if(a<=n&&n<=a+l){o=Math.atan2(u[1]-c[1],u[0]-c[0]);break}a+=l}return o}},e={exports:{}};function ur(){}function fr(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function hr(t,e,n,r,i){if("function"!=typeof n)throw new TypeError("The listener must be a function");n=new fr(n,r||t,i),r=lr?lr+e:e;return t._events[r]?t._events[r].fn?t._events[r]=[t._events[r],n]:t._events[r].push(n):(t._events[r]=n,t._eventsCount++),t}function dr(t,e){0==--t._eventsCount?t._events=new ur:delete t._events[e]}function pr(){this._events=new ur,this._eventsCount=0}r=e,sr=Object.prototype.hasOwnProperty,lr="~",Object.create&&(ur.prototype=Object.create(null),(new ur).__proto__||(lr=!1)),pr.prototype.eventNames=function(){var t,e,n=[];if(0===this._eventsCount)return n;for(e in t=this._events)sr.call(t,e)&&n.push(lr?e.slice(1):e);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(t)):n},pr.prototype.listeners=function(t){var t=lr?lr+t:t,e=this._events[t];if(!e)return[];if(e.fn)return[e.fn];for(var n=0,r=e.length,i=new Array(r);n<r;n++)i[n]=e[n].fn;return i},pr.prototype.listenerCount=function(t){t=lr?lr+t:t,t=this._events[t];return t?t.fn?1:t.length:0},pr.prototype.emit=function(t,e,n,r,i,a){var o=lr?lr+t:t;if(!this._events[o])return!1;var s,l=this._events[o],c=arguments.length;if(l.fn){switch(l.once&&this.removeListener(t,l.fn,void 0,!0),c){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,e),!0;case 3:return l.fn.call(l.context,e,n),!0;case 4:return l.fn.call(l.context,e,n,r),!0;case 5:return l.fn.call(l.context,e,n,r,i),!0;case 6:return l.fn.call(l.context,e,n,r,i,a),!0}for(h=1,s=new Array(c-1);h<c;h++)s[h-1]=arguments[h];l.fn.apply(l.context,s)}else for(var u,f=l.length,h=0;h<f;h++)switch(l[h].once&&this.removeListener(t,l[h].fn,void 0,!0),c){case 1:l[h].fn.call(l[h].context);break;case 2:l[h].fn.call(l[h].context,e);break;case 3:l[h].fn.call(l[h].context,e,n);break;case 4:l[h].fn.call(l[h].context,e,n,r);break;default:if(!s)for(u=1,s=new Array(c-1);u<c;u++)s[u-1]=arguments[u];l[h].fn.apply(l[h].context,s)}return!0},pr.prototype.on=function(t,e,n){return hr(this,t,e,n,!1)},pr.prototype.once=function(t,e,n){return hr(this,t,e,n,!0)},pr.prototype.removeListener=function(t,e,n,r){t=lr?lr+t:t;if(this._events[t])if(e){var i=this._events[t];if(i.fn)i.fn!==e||r&&!i.once||n&&i.context!==n||dr(this,t);else{for(var a=0,o=[],s=i.length;a<s;a++)(i[a].fn!==e||r&&!i[a].once||n&&i[a].context!==n)&&o.push(i[a]);o.length?this._events[t]=1===o.length?o[0]:o:dr(this,t)}}else dr(this,t);return this},pr.prototype.removeAllListeners=function(t){return t?(t=lr?lr+t:t,this._events[t]&&dr(this,t)):(this._events=new ur,this._eventsCount=0),this},pr.prototype.off=pr.prototype.removeListener,pr.prototype.addListener=pr.prototype.on,pr.prefixed=lr,r.exports=pr.EventEmitter=pr;var s,gr,mr,yr,vr=e.exports;function br(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,function(t){t=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0===n)return("string"===e?String:Number)(t);n=n.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==typeof t?t:String(t)}(r.key),r)}}function xr(t,e,n){e&&br(t.prototype,e),n&&br(t,n),Object.defineProperty(t,"prototype",{writable:!1})}function wr(){return(wr=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n,r=arguments[e];for(n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t}).apply(this,arguments)}function Mr(t,e){t.prototype=Object.create(e.prototype),Or(t.prototype.constructor=t,e)}function Or(t,e){return(Or=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function kr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function _r(t,e){var n,r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(r)return(r=r.call(t)).next.bind(r);if(Array.isArray(t)||(r=function(t,e){var n;if(t)return"string"==typeof t?kr(t,e):"Map"===(n="Object"===(n=Object.prototype.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:n)||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?kr(t,e):void 0}(t))||e&&t&&"number"==typeof t.length)return r&&(t=r),n=0,function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(n=o=o||{}).COORDINATE="<coordinate>",n.COLOR="<color>",n.PAINT="<paint>",n.NUMBER="<number>",n.ANGLE="<angle>",n.OPACITY_VALUE="<opacity-value>",n.SHADOW_BLUR="<shadow-blur>",n.LENGTH="<length>",n.PERCENTAGE="<percentage>",n.LENGTH_PERCENTAGE="<length> | <percentage>",n.LENGTH_PERCENTAGE_12="[<length> | <percentage>]{1,2}",n.LENGTH_PERCENTAGE_14="[<length> | <percentage>]{1,4}",n.LIST_OF_POINTS="<list-of-points>",n.PATH="<path>",n.FILTER="<filter>",n.Z_INDEX="<z-index>",n.OFFSET_DISTANCE="<offset-distance>",n.DEFINED_PATH="<defined-path>",n.MARKER="<marker>",n.TRANSFORM="<transform>",n.TRANSFORM_ORIGIN="<transform-origin>",n.TEXT="<text>",n.TEXT_TRANSFORM="<text-transform>",(r=s=s||{})[r.kUnknown=0]="kUnknown",r[r.kNumber=1]="kNumber",r[r.kPercentage=2]="kPercentage",r[r.kEms=3]="kEms",r[r.kPixels=4]="kPixels",r[r.kRems=5]="kRems",r[r.kDegrees=6]="kDegrees",r[r.kRadians=7]="kRadians",r[r.kGradians=8]="kGradians",r[r.kTurns=9]="kTurns",r[r.kMilliseconds=10]="kMilliseconds",r[r.kSeconds=11]="kSeconds",r[r.kInteger=12]="kInteger",(e=gr=gr||{})[e.kUNumber=0]="kUNumber",e[e.kUPercent=1]="kUPercent",e[e.kULength=2]="kULength",e[e.kUAngle=3]="kUAngle",e[e.kUTime=4]="kUTime",e[e.kUOther=5]="kUOther",(n=mr=mr||{})[n.kYes=0]="kYes",n[n.kNo=1]="kNo",(r=yr=yr||{})[r.kYes=0]="kYes",r[r.kNo=1]="kNo";function Er(t){var e=1;switch(t){case s.kPixels:case s.kDegrees:case s.kSeconds:break;case s.kMilliseconds:e=.001;break;case s.kRadians:e=180/Math.PI;break;case s.kGradians:e=.9;break;case s.kTurns:e=360}return e}function Sr(t){switch(t){case s.kNumber:case s.kInteger:return"";case s.kPercentage:return"%";case s.kEms:return"em";case s.kRems:return"rem";case s.kPixels:return"px";case s.kDegrees:return"deg";case s.kRadians:return"rad";case s.kGradians:return"grad";case s.kMilliseconds:return"ms";case s.kSeconds:return"s";case s.kTurns:return"turn"}return""}var Ar,Lr,Tr=[{name:"em",unit_type:s.kEms},{name:"px",unit_type:s.kPixels},{name:"deg",unit_type:s.kDegrees},{name:"rad",unit_type:s.kRadians},{name:"grad",unit_type:s.kGradians},{name:"ms",unit_type:s.kMilliseconds},{name:"s",unit_type:s.kSeconds},{name:"rem",unit_type:s.kRems},{name:"turn",unit_type:s.kTurns}],jr=((e=Ar=Ar||{})[e.kUnknownType=0]="kUnknownType",e[e.kUnparsedType=1]="kUnparsedType",e[e.kKeywordType=2]="kKeywordType",e[e.kUnitType=3]="kUnitType",e[e.kSumType=4]="kSumType",e[e.kProductType=5]="kProductType",e[e.kNegateType=6]="kNegateType",e[e.kInvertType=7]="kInvertType",e[e.kMinType=8]="kMinType",e[e.kMaxType=9]="kMaxType",e[e.kClampType=10]="kClampType",e[e.kTransformType=11]="kTransformType",e[e.kPositionType=12]="kPositionType",e[e.kURLImageType=13]="kURLImageType",e[e.kColorType=14]="kColorType",e[e.kUnsupportedColorType=15]="kUnsupportedColorType",function(e){return Tr.find(function(t){return t.name===e}).unit_type}),n=function(){function t(){}t.isAngle=function(t){return t===s.kDegrees||t===s.kRadians||t===s.kGradians||t===s.kTurns},t.isLength=function(t){return t>=s.kEms&&t<s.kDegrees},t.isRelativeUnit=function(t){return t===s.kPercentage||t===s.kEms||t===s.kRems},t.isTime=function(t){return t===s.kSeconds||t===s.kMilliseconds};var e=t.prototype;return e.toString=function(){return this.buildCSSText(mr.kNo,yr.kNo,"")},e.isNumericValue=function(){return this.getType()>=Ar.kUnitType&&this.getType()<=Ar.kClampType},t}(),r=function(n){function t(t){var e=n.call(this)||this;return e.colorSpace=void 0,e.colorSpace=t,e}Mr(t,n);var e=t.prototype;return e.getType=function(){return Ar.kColorType},e.to=function(t){return this},t}(n),Nr=((e=Lr=Lr||{})[e.Constant=0]="Constant",e[e.LinearGradient=1]="LinearGradient",e[e.RadialGradient=2]="RadialGradient",function(r){function t(t,e){var n=r.call(this)||this;return n.type=void 0,n.value=void 0,n.type=t,n.value=e,n}Mr(t,r);var e=t.prototype;return e.clone=function(){return new t(this.type,this.value)},e.buildCSSText=function(t,e,n){return n},e.getType=function(){return Ar.kColorType},t}(n)),Pr=function(n){function t(t){var e=n.call(this)||this;return e.value=void 0,e.value=t,e}Mr(t,n);var e=t.prototype;return e.clone=function(){return new t(this.value)},e.getType=function(){return Ar.kKeywordType},e.buildCSSText=function(t,e,n){return n+this.value},t}(n);function Cr(o,s){if("function"!=typeof o||null!=s&&"function"!=typeof s)throw new TypeError("Expected a function");function l(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var r,i=s?s.apply(this,e):e[0],a=l.cache;return a.has(i)?a.get(i):(r=o.apply(this,e),l.cache=a.set(i,r)||a,r)}return l.cache=new(Cr.Cache||Map),l}Cr.Cache=Map;function Rr(t){return t.split("").map(function(t,e){return t.toUpperCase()===t?(0!==e?"-":"")+t.toLowerCase():t}).join("")}var Ir=Cr(function(t){return(t=void 0===t?"":t).replace(/-([a-z])/g,function(t){return t[1].toUpperCase()})});function Br(t){return"function"==typeof t}function Fr(t,e){void 0===e&&(e="");var n="";if(Number.isFinite(t)){if(!Number.isNaN(t))throw new Error;n="NaN"}else n=0<t?"infinity":"-infinity";return n+e}function Dr(t){switch(function(t){switch(t){case s.kNumber:case s.kInteger:return gr.kUNumber;case s.kPercentage:return gr.kUPercent;case s.kPixels:return gr.kULength;case s.kMilliseconds:case s.kSeconds:return gr.kUTime;case s.kDegrees:case s.kRadians:case s.kGradians:case s.kTurns:return gr.kUAngle;default:return gr.kUOther}}(t)){case gr.kUNumber:return s.kNumber;case gr.kULength:return s.kPixels;case gr.kUPercent:return s.kPercentage;case gr.kUTime:return s.kSeconds;case gr.kUAngle:return s.kDegrees;default:return s.kUnknown}}function zr(t){return Ur[t]||(Ur[t]=new Pr(t)),Ur[t]}var Wr={d:{alias:"path"},strokeDasharray:{alias:"lineDash"},strokeWidth:{alias:"lineWidth"},textAnchor:{alias:"textAlign"},src:{alias:"img"}},Gr=Cr(function(t){var t=Ir(t),e=Wr[t];return(null==e?void 0:e.alias)||t}),qr=function(i){function n(t,e){var n,r;return void 0===e&&(e=s.kNumber),(n=i.call(this)||this).unit=void 0,n.value=void 0,r="string"==typeof e?(r=e)?"number"===r?s.kNumber:"percent"===r||"%"===r?s.kPercentage:jr(r):s.kUnknown:e,n.unit=r,n.value=t,n}Mr(n,i);var t=n.prototype;return t.clone=function(){return new n(this.value,this.unit)},t.equals=function(t){return this.value===t.value&&this.unit===t.unit},t.getType=function(){return Ar.kUnitType},t.convertTo=function(t){var e;return this.unit===t?new n(this.value,this.unit):(e=Dr(this.unit))!==Dr(t)||e===s.kUnknown?null:(e=Er(this.unit)/Er(t),new n(this.value*e,t))},t.buildCSSText=function(t,e,n){switch(this.unit){case s.kUnknown:break;case s.kInteger:i=Number(this.value).toFixed(0);break;case s.kNumber:case s.kPercentage:case s.kEms:case s.kRems:case s.kPixels:case s.kDegrees:case s.kRadians:case s.kGradians:case s.kMilliseconds:case s.kSeconds:case s.kTurns:var r,i,a=this.value,o=Sr(this.unit);i=a<-999999||999999<a?(r=Sr(this.unit),!Number.isFinite(a)||Number.isNaN(a)?Fr(a,r):a+(r||"")):""+a+o}return n+=i},n}(n),Hr=new qr(0,"px"),Vr=(new qr(1,"px"),new qr(0,"deg")),Yr=function(o){function t(t,e,n,r,i){var a;return void 0===r&&(r=1),void 0===i&&(i=!1),(a=o.call(this,"rgb")||this).r=void 0,a.g=void 0,a.b=void 0,a.alpha=void 0,a.isNone=void 0,a.r=t,a.g=e,a.b=n,a.alpha=r,a.isNone=i,a}Mr(t,o);var e=t.prototype;return e.clone=function(){return new t(this.r,this.g,this.b,this.alpha)},e.buildCSSText=function(t,e,n){return n+("rgba("+this.r+","+this.g+","+this.b+","+this.alpha)+")"},t}(r),$r=new Pr("unset"),e=new Pr("initial"),n=new Pr("inherit"),Ur={"":$r,unset:$r,initial:e,inherit:n},Kr=new Yr(0,0,0,0,!0),Xr=new Yr(0,0,0,0),Zr=Cr(function(t,e,n,r){return new Yr(t,e,n,r)},function(t,e,n,r){return"rgba("+t+","+e+","+n+","+r+")"}),Qr=function(t,e){return void 0===e&&(e=s.kNumber),new qr(t,e)};new qr(50,"%");var Jr="Method not implemented.";function ti(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function ei(t,e,n){t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2]}function ni(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function ri(t,e,n){t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n}function ii(t){return void 0===t?0:360<t||t<-360?t%360:t}function ai(t,e,n){var r,i;return void 0===e&&(e=0),void 0===n&&(n=0),Array.isArray(t)&&3===t.length?(r=t,(i=new Z(3))[0]=r[0],i[1]=r[1],i[2]=r[2],i):$e(t)?Ft(t,e,n):Ft(t[0],t[1]||e,t[2]||n)}function oi(t){return t*(Math.PI/180)}function si(t){return t*(180/Math.PI)}function li(t,e){return 16===e.length?(n=t,r=e,o=.5*Math.PI,s=(c=Et(It(),r))[0],l=c[1],c=c[2],(u=Math.asin(-r[2]/s))<o?-o<u?(i=Math.atan2(r[6]/l,r[10]/c),a=Math.atan2(r[1]/s,r[0]/s)):(a=0,i=-Math.atan2(r[4]/l,r[5]/l)):(a=0,i=Math.atan2(r[4]/l,r[5]/l)),n[0]=i,n[1]=u,n[2]=a,n):(o=t,s=(c=e)[0],r=c[1],l=c[2],c=c[3],.499995*(n=s*s+(i=r*r)+(u=l*l)+(a=c*c))<(t=s*c-r*l)?(o[0]=Math.PI/2,o[1]=2*Math.atan2(r,s),o[2]=0):t<-.499995*n?(o[0]=-Math.PI/2,o[1]=2*Math.atan2(r,s),o[2]=0):(o[0]=Math.asin(2*(s*l-c*r)),o[1]=Math.atan2(2*(s*c+r*l),1-2*(u+a)),o[2]=Math.atan2(2*(s*r+l*c),1-2*(i+u))),o);var n,r,i,a,o,s,l,c,u}function ci(t,e,n,r,i){var a,o,s,l,c=Math.cos(t),t=Math.sin(t);return a=r*c,o=i*t,r=-r*t,t=i*c,c=i=0,e=e,n=n,s=1,(l=new Z(9))[0]=a,l[1]=o,l[2]=i,l[3]=r,l[4]=t,l[5]=c,l[6]=e,l[7]=n,l[8]=s,l}function ui(t){var e=t[0],n=t[1],r=t[3],i=t[4],a=Math.sqrt(e*e+n*n),o=Math.sqrt(r*r+i*i);e*i-n*r<0&&(e<i?a=-a:o=-o),a&&(e*=1/a,n*=1/a);r=si(Math.atan2(n,e));return[t[6],t[7],a,o,r]}var fi=tt(),hi=tt(),di=Xt(),d=[It(),It(),It()],pi=It();function gi(t,e,n,r,i,a){if(function(t,e){var n=e[15];if(0===n)return;for(var r=1/n,i=0;i<16;i++)t[i]=e[i]*r;return 1}(fi,t)&&(et(hi,fi),hi[3]=0,hi[7]=0,hi[11]=0,hi[15]=1,!(Math.abs(yt(hi))<1e-8))){var t=fi[3],o=fi[7],s=fi[11],l=fi[12],c=fi[13],u=fi[14],f=fi[15];if(0!==t||0!==o||0!==s){if(di[0]=t,di[1]=o,di[2]=s,di[3]=f,!mt(hi,hi))return;gt(hi,hi),Zt(i,di,hi)}else i[0]=i[1]=i[2]=0,i[3]=1;if(e[0]=l,e[1]=c,e[2]=u,t=fi,(o=d)[0][0]=t[0],o[0][1]=t[1],o[0][2]=t[2],o[1][0]=t[4],o[1][1]=t[5],o[1][2]=t[6],o[2][0]=t[8],o[2][1]=t[9],o[2][2]=t[10],n[0]=Bt(d[0]),qt(d[0],d[0]),r[0]=Ht(d[0],d[1]),mi(d[1],d[1],d[0],1,-r[0]),n[1]=Bt(d[1]),qt(d[1],d[1]),r[0]/=n[1],r[1]=Ht(d[0],d[2]),mi(d[2],d[2],d[0],1,-r[1]),r[2]=Ht(d[1],d[2]),mi(d[2],d[2],d[1],1,-r[2]),n[2]=Bt(d[2]),qt(d[2],d[2]),r[1]/=n[2],r[2]/=n[2],Vt(pi,d[1],d[2]),Ht(d[0],pi)<0)for(var h=0;h<3;h++)n[h]*=-1,d[h][0]*=-1,d[h][1]*=-1,d[h][2]*=-1;a[0]=.5*Math.sqrt(Math.max(1+d[0][0]-d[1][1]-d[2][2],0)),a[1]=.5*Math.sqrt(Math.max(1-d[0][0]+d[1][1]-d[2][2],0)),a[2]=.5*Math.sqrt(Math.max(1-d[0][0]-d[1][1]+d[2][2],0)),a[3]=.5*Math.sqrt(Math.max(1+d[0][0]+d[1][1]+d[2][2],0)),d[2][1]>d[1][2]&&(a[0]=-a[0]),d[0][2]>d[2][0]&&(a[1]=-a[1]),d[1][0]>d[0][1]&&(a[2]=-a[2])}}function mi(t,e,n,r,i){t[0]=e[0]*r+n[0]*i,t[1]=e[1]*r+n[1]*i,t[2]=e[2]*r+n[2]*i}var yi=tt();function vi(t,l){var c,u;t&&t.length&&(u=c=0,l?(c=l.parsedStyle.defX||0,u=l.parsedStyle.defY||0,l.resetLocalTransform(),l.setLocalPosition(c,u)):l=new Xo({}),t.forEach(function(t){var e,n,r,i,a,o,s=t.t,t=t.d;"scale"===s?(o=(null==t?void 0:t.map(function(t){return t.value}))||[1,1],l.scaleLocal(o[0],o[1],1)):"scalex"===s?(o=(null==t?void 0:t.map(function(t){return t.value}))||[1],l.scaleLocal(o[0],1,1)):"scaley"===s?(o=(null==t?void 0:t.map(function(t){return t.value}))||[1],l.scaleLocal(1,o[0],1)):"scalez"===s?(o=(null==t?void 0:t.map(function(t){return t.value}))||[1],l.scaleLocal(1,1,o[0])):"scale3d"===s?(o=(null==t?void 0:t.map(function(t){return t.value}))||[1,1,1],l.scaleLocal(o[0],o[1],o[2])):"translate"===s?(o=t||[Hr,Hr],l.translateLocal(o[0].value,o[1].value,0)):"translatex"===s?(o=t||[Hr],l.translateLocal(o[0].value,0,0)):"translatey"===s?(o=t||[Hr],l.translateLocal(0,o[0].value,0)):"translatez"===s?(o=t||[Hr],l.translateLocal(0,0,o[0].value)):"translate3d"===s?(o=t||[Hr,Hr,Hr],l.translateLocal(o[0].value,o[1].value,o[2].value)):"rotate"===s?(o=t||[Vr],l.rotateLocal(0,0,_a(o[0]))):"rotatex"===s?(o=t||[Vr],l.rotateLocal(_a(o[0]),0,0)):"rotatey"===s?(o=t||[Vr],l.rotateLocal(0,_a(o[0]),0)):"rotatez"===s?(o=t||[Vr],l.rotateLocal(0,0,_a(o[0]))):"rotate3d"!==s&&("skew"===s?(o=(null==t?void 0:t.map(function(t){return t.value}))||[0,0],l.setLocalSkew(oi(o[0]),oi(o[1]))):"skewx"===s?(o=(null==t?void 0:t.map(function(t){return t.value}))||[0],l.setLocalSkew(oi(o[0]),l.getLocalSkew()[1])):"skewy"===s?(o=(null==t?void 0:t.map(function(t){return t.value}))||[0],l.setLocalSkew(l.getLocalSkew()[0],oi(o[0]))):"matrix"===s?(e=(o=t.map(function(t){return t.value}))[0],n=o[1],r=o[2],i=o[3],a=o[4],o=o[5],l.setLocalTransform(dt(yi,e,n,0,0,r,i,0,0,0,0,1,0,a+c,o+u,0,1))):"matrix3d"===s&&(dt.apply(Rt,[yi].concat(t.map(function(t){return t.value}))),yi[12]+=c,yi[13]+=u,l.setLocalTransform(yi)))})),l.getLocalTransform()}bi={linearGradient:/^(linear\-gradient)/i,repeatingLinearGradient:/^(repeating\-linear\-gradient)/i,radialGradient:/^(radial\-gradient)/i,repeatingRadialGradient:/^(repeating\-radial\-gradient)/i,conicGradient:/^(conic\-gradient)/i,sideOrCorner:/^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|left|right|top|bottom)/i,extentKeywords:/^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,positionKeywords:/^(left|center|right|top|bottom)/i,pixelValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,percentageValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,emValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,angleValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,startCall:/^\(/,endCall:/^\)/,comma:/^,/,hexColor:/^\#([0-9a-fA-F]+)/,literalColor:/^([a-zA-Z]+)/,rgbColor:/^rgb/i,rgbaColor:/^rgba/i,number:/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/},xi="";var bi,xi,b,wi=function(t){return xi=t,Oi()};function Mi(t){throw new Error(xi+": "+t)}function Oi(){var t=Pi(ki);return 0<xi.length&&Mi("Invalid input not EOF"),t}function ki(){return _i("linear-gradient",bi.linearGradient,Si)||_i("repeating-linear-gradient",bi.repeatingLinearGradient,Si)||_i("radial-gradient",bi.radialGradient,Ai)||_i("repeating-radial-gradient",bi.repeatingRadialGradient,Ai)||_i("conic-gradient",bi.conicGradient,Ai)}function _i(n,t,r){return Ei(t,function(t){var e=r();return e&&!zi(bi.comma)&&Mi("Missing comma before color stops"),{type:n,orientation:e,colorStops:Pi(Ci)}})}function Ei(t,e){t=zi(t);if(t)return zi(bi.startCall)||Mi("Missing ("),e=e(t),zi(bi.endCall)||Mi("Missing )"),e}function Si(){return Di("directional",bi.sideOrCorner,1)||Di("angular",bi.angleValue,1)}function Ai(){var t,e,n=Li();return n&&((t=[]).push(n),e=xi,zi(bi.comma))&&((n=Li())?t.push(n):xi=e),t}function Li(){var t,e=function(){var t=Di("shape",/^(circle)/i,0);t&&(t.style=Fi()||Ti());return t}()||function(){var t=Di("shape",/^(ellipse)/i,0);t&&(t.style=Ii()||Ti());return t}();return e?e.at=ji():(t=Ti())?(e=t,(t=ji())&&(e.at=t)):(t=Ni())&&(e={type:"default-radial",at:t}),e}function Ti(){return Di("extent-keyword",bi.extentKeywords,1)}function ji(){var t;if(Di("position",/^at/,0))return(t=Ni())||Mi("Missing positioning value"),t}function Ni(){var t={x:Ii(),y:Ii()};if(t.x||t.y)return{type:"position",value:t}}function Pi(t){var e=t(),n=[];if(e)for(n.push(e);zi(bi.comma);)(e=t())?n.push(e):Mi("One extra comma");return n}function Ci(){var t=Di("hex",bi.hexColor,1)||Ei(bi.rgbaColor,function(){return{type:"rgba",value:Pi(Ri)}})||Ei(bi.rgbColor,function(){return{type:"rgb",value:Pi(Ri)}})||Di("literal",bi.literalColor,0);return t||Mi("Expected color definition"),t.length=Ii(),t}function Ri(){return zi(bi.number)[1]}function Ii(){return Di("%",bi.percentageValue,1)||Bi()||Fi()}function Bi(){return Di("position-keyword",bi.positionKeywords,1)}function Fi(){return Di("px",bi.pixelValue,1)||Di("em",bi.emValue,1)}function Di(t,e,n){e=zi(e);if(e)return{type:t,value:e[n]}}function zi(t){var e=/^[\n\r\t\s]+/.exec(xi),e=(e&&Wi(e[0].length),t.exec(xi));return e&&Wi(e[0].length),e}function Wi(t){xi=xi.substring(t)}function Gi(t,e){return t[0]===e[0]&&t[1]===e[1]}function qi(t,e){var n,r=t.prePoint,i=t.currentPoint,t=t.nextPoint,a=Math.pow(i[0]-r[0],2)+Math.pow(i[1]-r[1],2),o=Math.pow(i[0]-t[0],2)+Math.pow(i[1]-t[1],2),r=Math.pow(r[0]-t[0],2)+Math.pow(r[1]-t[1],2),r=Math.acos((a+o-r)/(2*Math.sqrt(a)*Math.sqrt(o)));return!r||0===Math.sin(r)||(void(a=0)===n&&(n=1e-5),Math.abs(r-a)<n)?{xExtra:0,yExtra:0}:(o=Math.abs(Math.atan2(t[1]-i[1],t[0]-i[0])),a=Math.abs(Math.atan2(t[0]-i[0],t[1]-i[1])),o=o>Math.PI/2?Math.PI-o:o,a=a>Math.PI/2?Math.PI-a:a,{xExtra:Math.cos(r/2-o)*(e/2*(1/Math.sin(r/2)))-e/2||0,yExtra:Math.cos(a-r/2)*(e/2*(1/Math.sin(r/2)))-e/2||0})}function Hi(t,e){return[e[0]+(e[0]-t[0]),e[1]+(e[1]-t[1])]}(r=b=b||{}).GROUP="g",r.CIRCLE="circle",r.ELLIPSE="ellipse",r.IMAGE="image",r.RECT="rect",r.LINE="line",r.POLYLINE="polyline",r.POLYGON="polygon",r.TEXT="text",r.PATH="path",r.HTML="html",r.MESH="mesh";function Vi(t,e,n,r,i,a,o,s){var l,c,u;return e=Math.abs(e),n=Math.abs(n),r=oi(r=Ke(r,360)),t.x===o.x&&t.y===o.y?{x:t.x,y:t.y,ellipticalArcAngle:0}:0===e||0===n?{x:0,y:0,ellipticalArcAngle:0}:(u=(t.x-o.x)/2,c=(t.y-o.y)/2,u={x:Math.cos(r)*u+Math.sin(r)*c,y:-Math.sin(r)*u+Math.cos(r)*c},1<(c=Math.pow(u.x,2)/Math.pow(e,2)+Math.pow(u.y,2)/Math.pow(n,2))&&(e=Math.sqrt(c)*e,n=Math.sqrt(c)*n),c=(c=(Math.pow(e,2)*Math.pow(n,2)-Math.pow(e,2)*Math.pow(u.y,2)-Math.pow(n,2)*Math.pow(u.x,2))/(Math.pow(e,2)*Math.pow(u.y,2)+Math.pow(n,2)*Math.pow(u.x,2)))<0?0:c,i=(i!==a?1:-1)*Math.sqrt(c),c=e*u.y/n*i,i*=-n*u.x/e,t={x:Math.cos(r)*c-Math.sin(r)*i+(t.x+o.x)/2,y:Math.sin(r)*c+Math.cos(r)*i+(t.y+o.y)/2},l=Yi({x:1,y:0},o={x:(u.x-c)/e,y:(u.y-i)/n}),o=Yi(o,{x:(-u.x-c)/e,y:(-u.y-i)/n}),!a&&0<o?o-=2*Math.PI:a&&o<0&&(o+=2*Math.PI),c=l+(o%=2*Math.PI)*s,u=e*Math.cos(c),i=n*Math.sin(c),{x:Math.cos(r)*u-Math.sin(r)*i+t.x,y:Math.sin(r)*u+Math.cos(r)*i+t.y,ellipticalArcStartAngle:l,ellipticalArcEndAngle:l+o,ellipticalArcAngle:c,ellipticalArcCenter:t,resultantRx:e,resultantRy:n})}var Yi=function(t,e){var n=t.x*e.x+t.y*e.y,r=Math.sqrt((Math.pow(t.x,2)+Math.pow(t.y,2))*(Math.pow(e.x,2)+Math.pow(e.y,2)));return(t.x*e.y-t.y*e.x<0?-1:1)*Math.acos(n/r)};function $i(t){for(var e=[],n=null,r=null,i=null,a=0,o=t.length,s=0;s<o;s++){var l=t[s],r=t[s+1],c=l[0],u={command:c,prePoint:n,params:l,startTangent:null,endTangent:null,currentPoint:null,nextPoint:null,arcParams:null,box:null,cubicParams:null};switch(c){case"M":i=[l[1],l[2]],a=s;break;case"A":var f=function(t,e){var n=e[1],r=e[2],i=Ke(oi(e[3]),2*Math.PI),a=e[4],o=e[5],s=t[0],l=t[1],c=e[6],e=e[7],u=Math.cos(i)*(s-c)/2+Math.sin(i)*(l-e)/2,f=-1*Math.sin(i)*(s-c)/2+Math.cos(i)*(l-e)/2,h=u*u/(n*n)+f*f/(r*r);1<h&&(n*=Math.sqrt(h),r*=Math.sqrt(h));h=n*n*(f*f)+r*r*(u*u),h=h?Math.sqrt((n*n*(r*r)-h)/h):1;a===o&&(h*=-1);isNaN(h)&&(h=0);var d=r?h*n*f/r:0,h=n?h*-r*u/n:0,s=(s+c)/2+Math.cos(i)*d-Math.sin(i)*h,l=(l+e)/2+Math.sin(i)*d+Math.cos(i)*h,p=[(u-d)/n,(f-h)/r],u=[(-1*u-d)/n,(-1*f-h)/r],d=Zi([1,0],p),f=Zi(p,u);Xi(p,u)<=-1&&(f=Math.PI);1<=Xi(p,u)&&(f=0);0===o&&0<f&&(f-=2*Math.PI);1===o&&f<0&&(f+=2*Math.PI);return{cx:s,cy:l,rx:Gi(t,[c,e])?0:n,ry:Gi(t,[c,e])?0:r,startAngle:d,endAngle:d+f,xRotation:i,arcFlag:a,sweepFlag:o}}(n,l);u.arcParams=f}"Z"===c?(n=i,r=t[a+1]):n=[l[(v=l.length)-2],l[v-1]],r&&"Z"===r[0]&&(r=t[a],e[a])&&(e[a].prePoint=n),u.currentPoint=n,e[a]&&Gi(n,e[a].currentPoint)&&(e[a].prePoint=u.prePoint);var h,d,p,g,m,y,v=r?[r[r.length-2],r[r.length-1]]:null,b=(u.nextPoint=v,u.prePoint);["L","H","V"].includes(c)?(u.startTangent=[b[0]-n[0],b[1]-n[1]],u.endTangent=[n[0]-b[0],n[1]-b[1]]):"Q"===c?(h=[l[1],l[2]],u.startTangent=[b[0]-h[0],b[1]-h[1]],u.endTangent=[n[0]-h[0],n[1]-h[1]]):"T"===c?(d=Hi((h=e[s-1]).currentPoint,b),"Q"===h.command?(u.command="Q",u.startTangent=[b[0]-d[0],b[1]-d[1]],u.endTangent=[n[0]-d[0],n[1]-d[1]]):(u.command="TL",u.startTangent=[b[0]-n[0],b[1]-n[1]],u.endTangent=[n[0]-b[0],n[1]-b[1]])):"C"===c?(d=[l[1],l[2]],p=[l[3],l[4]],u.startTangent=[b[0]-d[0],b[1]-d[1]],u.endTangent=[n[0]-p[0],n[1]-p[1]],0===u.startTangent[0]&&0===u.startTangent[1]&&(u.startTangent=[d[0]-p[0],d[1]-p[1]]),0===u.endTangent[0]&&0===u.endTangent[1]&&(u.endTangent=[p[0]-d[0],p[1]-d[1]])):"S"===c?(g=Hi((p=e[s-1]).currentPoint,b),m=[l[1],l[2]],"C"===p.command?(u.command="C",u.startTangent=[b[0]-g[0],b[1]-g[1]]):(u.command="SQ",u.startTangent=[b[0]-m[0],b[1]-m[1]]),u.endTangent=[n[0]-m[0],n[1]-m[1]]):"A"===c&&(b=(g=Ui(u,0)).x,m=g.y,y=(c=Ui(u,1,!1)).x,c=c.y,u.startTangent=[b,m],u.endTangent=[y,c]),e.push(u)}return e}function Ui(t,e,n){void 0===n&&(n=!0);var r=t.arcParams,i=r.rx,i=void 0===i?0:i,a=r.ry,a=void 0===a?0:a,o=r.xRotation,s=r.arcFlag,r=r.sweepFlag,l=Vi({x:t.prePoint[0],y:t.prePoint[1]},i,a,o,!!s,!!r,{x:t.currentPoint[0],y:t.currentPoint[1]},e),i=Vi({x:t.prePoint[0],y:t.prePoint[1]},i,a,o,!!s,!!r,{x:t.currentPoint[0],y:t.currentPoint[1]},n?e+.005:e-.005),a=i.x-l.x,o=i.y-l.y,s=Math.sqrt(a*a+o*o);return{x:-a/s,y:-o/s}}function Ki(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function Xi(t,e){return Ki(t)*Ki(e)?(t[0]*e[0]+t[1]*e[1])/(Ki(t)*Ki(e)):1}function Zi(t,e){return(t[0]*e[1]<t[1]*e[0]?-1:1)*Math.acos(Xi(t,e))}var Qi=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],Ji=/([\"\'])[^\'\"]+\1/;function ta(t){if("function"!=typeof t)throw new TypeError(t+" is not a function");var n=Date.now(),e=16<(e=n-ca)?0:16-e,r=ia();return la[r]=t,1<Object.keys(la).length||setTimeout(function(){ca=n;var e=la;la={},Object.keys(e).forEach(function(t){return e[t](sa())})},e),r}function ea(t){delete la[t]}function na(t){return"string"!=typeof t?ta:""===t?aa.requestAnimationFrame:aa[t+"RequestAnimationFrame"]}var ra=1,ia=function(){return ra++},aa="object"==typeof self&&self.self==self?self:"object"==typeof N&&N.global==N?N:{},oa=Date.now(),sa=function(){return aa.performance&&"function"==typeof aa.performance.now?aa.performance.now():Date.now()-oa},la={},ca=Date.now(),e=function(t,e){for(var n=0;void 0!==t[n];){if(e(t[n]))return t[n];n+=1}}(["","webkit","moz","ms","o"],na),n=na(e),e="string"!=typeof(r=e)?ea:""===r?aa.cancelAnimationFrame:aa[r+"CancelAnimationFrame"]||aa[r+"CancelRequestAnimationFrame"],ua=(aa.requestAnimationFrame=n,aa.cancelAnimationFrame=e,/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i),fa=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,ha=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,da=/[\d.]+:(#[^\s]+|[^\)]+\))/gi;var pa={left:180,top:-90,bottom:90,right:0,"left top":225,"top left":225,"left bottom":135,"bottom left":135,"right top":-45,"top right":-45,"right bottom":45,"bottom right":45},ga=Cr(function(t){t="angular"===t.type?Number(t.value):pa[t.value]||0;return Qr(t,"deg")}),ma=Cr(function(t){var e,n=50,r=50,i="%",a="%";return"position"===(null==t?void 0:t.type)&&(e=(t=t.value).x,t=t.y,"position-keyword"===(null==e?void 0:e.type)&&("left"===e.value?n=0:"center"===e.value?n=50:"right"===e.value?n=100:"top"===e.value?r=0:"bottom"===e.value&&(r=100)),"position-keyword"===(null==t?void 0:t.type)&&("left"===t.value?n=0:"center"===t.value?r=50:"right"===t.value?n=100:"top"===t.value?r=0:"bottom"===t.value&&(r=100)),"px"!==(null==e?void 0:e.type)&&"%"!==(null==e?void 0:e.type)&&"em"!==(null==e?void 0:e.type)||(i=null==e?void 0:e.type,n=Number(e.value)),"px"!==(null==t?void 0:t.type)&&"%"!==(null==t?void 0:t.type)&&"em"!==(null==t?void 0:t.type)||(a=null==t?void 0:t.type,r=Number(t.value))),{cx:Qr(n,i),cy:Qr(r,a)}}),ya=Cr(function(t){if(-1<t.indexOf("linear")||-1<t.indexOf("radial"))return wi(t).map(function(t){for(var e=t.type,n=t.orientation,t=t.colorStops,r=t,i=r.length,a=(r[i-1].length=null!=(h=r[i-1].length)?h:{type:"%",value:"100"},1<i&&(r[0].length=null!=(h=r[0].length)?h:{type:"%",value:"0"}),0),o=Number(r[0].length.value),s=1;s<i;s++){var l,c=null==(l=r[s].length)?void 0:l.value;if(!p(c)&&!p(o)){for(var u=1;u<s-a;u++)r[a+u].length={type:"%",value:""+(o+(Number(c)-o)*u/(s-a))};a=s,o=Number(c)}}var f,h=t.map(function(t){return{offset:Qr(Number(t.length.value),"%"),color:(e=(t=t).type,t=t.value,"hex"===e?"#"+t:"literal"===e?t:"rgb"===e?"rgb("+t.join(",")+")":"rgba("+t.join(",")+")")};var e});return"linear-gradient"===e?new Nr(Lr.LinearGradient,{angle:n?ga(n):Vr,steps:h}):"radial-gradient"===e&&"shape"===(n=n||[{type:"shape",value:"circle"}])[0].type&&"circle"===n[0].value?(e=(t=ma(n[0].at)).cx,t=t.cy,n[0].style&&(f=(n=n[0].style).type,n=n.value,f="extent-keyword"===f?zr(n):Qr(n,f)),new Nr(Lr.RadialGradient,{cx:e,cy:t,size:f,steps:h})):void 0});var e=t[0];if("("===t[1]||"("===t[2])if("l"===e){var n=ua.exec(t);if(n)return r=(null==(r=n[2].match(da))?void 0:r.map(function(t){return t.split(":")}))||[],[new Nr(Lr.LinearGradient,{angle:Qr(parseFloat(n[1]),"deg"),steps:r.map(function(t){var e=t[0],t=t[1];return{offset:Qr(100*Number(e),"%"),color:t}})})]}else if("r"===e){n=function(t){var t=fa.exec(t);if(t)return t=(null==(t=t[4].match(da))?void 0:t.map(function(t){return t.split(":")}))||[],{cx:Qr(50,"%"),cy:Qr(50,"%"),steps:t.map(function(t){var e=t[0],t=t[1];return{offset:Qr(100*Number(e),"%"),color:t}})};return null}(t);if(n&&!Ve(n))return[new Nr(Lr.RadialGradient,n)]}else if("p"===e){var r=t;if(r=ha.exec(r)){var i=r[1],r=r[2];switch(i){case"a":i="repeat";break;case"x":i="repeat-x";break;case"y":i="repeat-y";break;default:i="no-repeat"}return{image:r,repetition:i}}return null}});function va(t){return t&&!p(t.r)&&!p(t.g)&&!p(t.b)}var ba=Cr(function(t){var e;return(e=t)&&e.image?wr({repetition:"repeat"},t):"transparent"===(t=p(t)?"":t)?Xr:ya(t="currentColor"===t?"black":t)||(e=[0,0,0,0],null!==(t=kn(t))&&(e[0]=t.r||0,e[1]=t.g||0,e[2]=t.b||0,e[3]=t.opacity),Zr.apply(void 0,e))});function xa(t,e){if(va(t)&&va(e))return[[Number(t.r),Number(t.g),Number(t.b),Number(t.alpha)],[Number(e.r),Number(e.g),Number(e.b),Number(e.alpha)],function(t){var e=t.slice();if(e[3])for(var n=0;n<3;n++)e[n]=Math.round(Ye(e[n],0,255));return e[3]=Ye(e[3],0,1),"rgba("+e.join(",")+")"}]}function wa(t,e){if(p(e))return Qr(0,"px");if(e=(""+e).trim().toLowerCase(),isFinite(Number(e))){if(0<="px".search(t))return Qr(Number(e),"px");if(0<="deg".search(t))return Qr(Number(e),"deg")}var n=[],r=(e=e.replace(t,function(t){return n.push(t),"U"+t}),"U("+t.source+")");return n.map(function(t){return Qr(Number(e.replace(new RegExp("U"+t,"g"),"").replace(new RegExp(r,"g"),"*0")),t)})[0]}var Ma=Cr(function(t){return wa(new RegExp("px","g"),t)}),Oa=(Cr(function(t){return wa(new RegExp("%","g"),t)}),function(t){return $e(t)||isFinite(Number(t))?Qr(Number(t)||0,"px"):wa(new RegExp("px|%|em|rem","g"),t)}),ka=Cr(function(t){return wa(new RegExp("deg|rad|grad|turn","g"),t)});function _a(t){var e=0;return t.unit===s.kDegrees?e=t.value:t.unit===s.kRadians?e=si(Number(t.value)):t.unit===s.kTurns&&(e=360*Number(t.value)),e}function Ea(t,e){var n;return Array.isArray(t)?n=t.map(function(t){return Number(t)}):Ve(t)?n=t.split(" ").map(function(t){return Number(t)}):$e(t)&&(n=[t]),2===e?1===n.length?[n[0],n[0]]:[n[0],n[1]]:1===n.length?[n[0],n[0],n[0],n[0]]:2===n.length?[n[0],n[1],n[0],n[1]]:3===n.length?[n[0],n[1],n[2],n[1]]:[n[0],n[1],n[2],n[3]]}function Sa(t){return Ve(t)?t.split(" ").map(function(t){return Oa(t)}):t.map(function(t){return Oa(t.toString())})}function Aa(t,e,n){return 0===t.value?0:t.unit===s.kPixels?Number(t.value):t.unit===s.kPercentage&&n?(n=n.nodeName===b.GROUP?n.getLocalBounds():n.geometry.contentBounds,t.value/100*n.halfExtents[e]*2):0}var La=function(t){return wa(/deg|rad|grad|turn|px|%/g,t)},Ta=["blur","brightness","drop-shadow","contrast","grayscale","sepia","saturate","hue-rotate","invert"];function ja(t){if("none"!==(t=(t=void 0===t?"":t).toLowerCase().trim()))for(var e,n=/\s*([\w-]+)\(([^)]*)\)/g,r=[],i=0;e=n.exec(t);){if(e.index!==i)return[];if(i=e.index+e[0].length,-1<Ta.indexOf(e[1])&&r.push({name:e[1],params:e[2].split(" ").map(function(t){return La(t)||ba(t)})}),n.lastIndex===t.length)return r}return[]}function Na(t){return t.toString()}var Pa=Cr(function(t){return"number"==typeof t?Qr(t):/^\s*[-+]?(\d*\.)?\d+\s*$/.test(t)?Qr(Number(t)):Qr(0)});function Ca(t,e){return[t,e,Na]}function Ra(n,r){return function(t,e){return[t,e,function(t){return Na(Ye(t,n,r))}]}}function Ia(t,e){if(t.length===e.length)return[t,e,function(t){return t}]}Cr(function(t){return(Ve(t)?t.split(" "):t).map(Pa)});var Ba=function(e){if(""===e||Array.isArray(e)&&0===e.length)return{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:{x:0,y:0,width:0,height:0}};var n;try{n=ke(e)}catch(t){n=ke(""),console.error("[g]: Invalid SVG Path definition: "+e)}var e=function(t){for(var e=!1,n=t.length,r=0;r<n;r++){var i=t[r][0];if("C"===i||"A"===i||"Q"===i){e=!0;break}}return e}(n),t=function(t){for(var e=[],n=[],r=[],i=0;i<t.length;i++){var a=t[i],o=a[0];"M"===o?(r.length&&(n.push(r),r=[]),r.push([a[1],a[2]])):"Z"===o?r.length&&(e.push(r),r=[]):r.push([a[1],a[2]])}return 0<r.length&&n.push(r),{polygons:e,polylines:n}}(n),r=t.polygons,t=t.polylines,i=$i(n),a=function(t,e){for(var n=[],r=[],i=[],a=0;a<t.length;a++){var o=t[a],s=o.currentPoint,l=o.params,c=o.prePoint,u=void 0;switch(o.command){case"Q":u=Yn.box(c[0],c[1],l[1],l[2],l[3],l[4]);break;case"C":u=Qn.box(c[0],c[1],l[1],l[2],l[3],l[4],l[5],l[6]);break;case"A":var f=o.arcParams,u=ar.box(f.cx,f.cy,f.rx,f.ry,f.xRotation,f.startAngle,f.endAngle);break;default:n.push(s[0]),r.push(s[1])}u&&(o.box=u,n.push(u.x,u.x+u.width),r.push(u.y,u.y+u.height)),e&&("L"===o.command||"M"===o.command)&&o.prePoint&&o.nextPoint&&i.push(o)}var n=n.filter(function(t){return!Number.isNaN(t)&&t!==1/0&&t!==-1/0}),r=r.filter(function(t){return!Number.isNaN(t)&&t!==1/0&&t!==-1/0}),h=He(n),d=He(r),p=qe(n),g=qe(r);if(0!==i.length)for(var m=0;m<i.length;m++){var y=i[m],v=y.currentPoint;v[0]===h?h-=qi(y,e).xExtra:v[0]===p&&(p+=qi(y,e).xExtra),v[1]===d?d-=qi(y,e).yExtra:v[1]===g&&(g+=qi(y,e).yExtra)}return{x:h,y:d,width:p-h,height:g-d}}(i,0),o=a.x,s=a.y,l=a.width,a=a.height;return{absolutePath:n,hasArc:e,segments:i,polygons:r,polylines:t,totalLength:0,rect:{x:Number.isFinite(o)?o:0,y:Number.isFinite(s)?s:0,width:Number.isFinite(l)?l:0,height:Number.isFinite(a)?a:0}}},Fa=Cr(Ba);function Da(t,e){t=(Ve(t)?Fa:Ba)(t);return e&&(e.parsedStyle.defX=t.rect.x,e.parsedStyle.defY=t.rect.y),t}function za(t,e,n){var r,i,a,o,s,l,c,u,f,h=t.curve,d=e.curve,t=(h&&0!==h.length||(h=je(t.absolutePath,!1),t.curve=h),d&&0!==d.length||(d=je(e.absolutePath,!1),e.curve=d),[h,d]),h=Pe((t=h.length!==d.length?function t(e,n,r){var i,e=Ce(e),n=Ce(n),a=e.length,o=n.length,s=e.filter(function(t){return t.l}).length,l=n.filter(function(t){return t.l}).length,s=e.filter(function(t){return t.l}).reduce(function(t,e){return t+e.l},0)/s||0,l=n.filter(function(t){return t.l}).reduce(function(t,e){return t+e.l},0)/l||0,c=r||Math.max(a,o),u=[s,l],f=[c-a,c-o],r=[e,n].map(function(t,n){return t.l===c?t.map(function(t){return t.s}):t.map(function(t,e){return i=e&&f[n]&&t.l>=u[n],f[n]-=i?1:0,i?t.ss:[t.s]}).flat()});return r[0].length===r[1].length?r:t(r[0],r[1],c)}(h,d):t)[0])!==Pe(t[1])?(r=t[0],e=r.slice(1).map(function(t,e,n){return(e?n[e-1].slice(-2):r[0].slice(1)).concat(t.slice(1))}).map(function(n){return n.map(function(t,e){return n[n.length-e-2*(1-e%2)]})}).reverse(),[["M"].concat(e[0].slice(0,2))].concat(e.map(function(t){return["C"].concat(t.slice(2))}))):se(t[0]);return[h,(i=t[1],a=h,c=i.length-1,u=[],f=0,s=(o=i).length,l=s-1,(d=o.map(function(t,r){return o.map(function(t,e){var n=r+e;return 0===e||o[n]&&"M"===o[n][0]?(e=o[n],["M"].concat(e.slice(-2))):(s<=n&&(n-=l),o[n])})})).forEach(function(t,n){i.slice(1).forEach(function(t,e){f+=Se(i[(n+e)%c].slice(-2),a[e%c].slice(-2))}),u[n]=f,f=0}),d[u.indexOf(Math.min.apply(null,u))]),function(t){return t}]}function Wa(t,e){var n,r,i=Ve(t)?t.split(" ").map(function(t){var t=t.split(","),e=t[0],t=t[1];return[Number(e),Number(t)]}):t,a=[],o=0,s=cr.length(i),t=(i.forEach(function(t,e){i[e+1]&&((n=[0,0])[0]=o/s,r=Dn.length(t[0],t[1],i[e+1][0],i[e+1][1]),o+=r,n[1]=o/s,a.push(n))}),Math.min.apply(Math,i.map(function(t){return t[0]}))),l=Math.min.apply(Math,i.map(function(t){return t[1]}));return e&&(e.parsedStyle.defX=t,e.parsedStyle.defY=l),{points:i,totalLength:s,segments:a}}function Ga(t,e){return[t.points,e.points,function(t){return t}]}var qa=null;function Ha(t){return function(e){var n=0;return t.map(function(t){return t===qa?e[n++]:t})}}function Va(t){return t}var Ya={matrix:["NNNNNN",[qa,qa,0,0,qa,qa,0,0,0,0,1,0,qa,qa,0,1],Va],matrix3d:["NNNNNNNNNNNNNNNN",Va],rotate:["A"],rotatex:["A"],rotatey:["A"],rotatez:["A"],rotate3d:["NNNA"],perspective:["L"],scale:["Nn",Ha([qa,qa,new qr(1)]),Va],scalex:["N",Ha([qa,new qr(1),new qr(1)]),Ha([qa,new qr(1)])],scaley:["N",Ha([new qr(1),qa,new qr(1)]),Ha([new qr(1),qa])],scalez:["N",Ha([new qr(1),new qr(1),qa])],scale3d:["NNN",Va],skew:["Aa",null,Va],skewx:["A",null,Ha([qa,Vr])],skewy:["A",null,Ha([Vr,qa])],translate:["Tt",Ha([qa,qa,Hr]),Va],translatex:["T",Ha([qa,Hr,Hr]),Ha([qa,Hr])],translatey:["T",Ha([Hr,qa,Hr]),Ha([Hr,qa])],translatez:["L",Ha([Hr,Hr,qa])],translate3d:["TTL",Va]};function $a(t){if("none"!==(t=(t||"none").toLowerCase().trim()))for(var e,n=/\s*(\w+)\(([^)]*)\)/g,r=[],i=0;e=n.exec(t);){if(e.index!==i)return[];var i=e.index+e[0].length,a=e[1],o=Ya[a];if(!o)return[];var s=e[2].split(","),l=o[0];if(l.length<s.length)return[];for(var c=[],u=0;u<l.length;u++){var f=s[u],h=l[u],d=void 0;if(void 0===(d=f?{A:function(t){return"0"===t.trim()?Vr:ka(t)},N:Pa,T:Oa,L:Ma}[h.toUpperCase()](f):{a:Vr,n:c[0],t:Hr}[h]))return[];c.push(d)}if(r.push({t:a,d:c}),n.lastIndex===t.length)return r}return[]}function Ua(t){switch(t.t){case"rotatex":return i=oi(_a(t.d[0])),[1,0,0,0,0,Math.cos(i),Math.sin(i),0,0,-Math.sin(i),Math.cos(i),0,0,0,0,1];case"rotatey":return i=oi(_a(t.d[0])),[Math.cos(i),0,-Math.sin(i),0,0,1,0,0,Math.sin(i),0,Math.cos(i),0,0,0,0,1];case"rotate":case"rotatez":return i=oi(_a(t.d[0])),[Math.cos(i),Math.sin(i),0,0,-Math.sin(i),Math.cos(i),0,0,0,0,1,0,0,0,0,1];case"rotate3d":var e=t.d[0].value,n=t.d[1].value,r=t.d[2].value,i=oi(_a(t.d[3])),a=e*e+n*n+r*r,a=(0==a?(e=1,r=n=0):1!=a&&(e/=a=Math.sqrt(a),n/=a,r/=a),Math.sin(i/2)),o=a*Math.cos(i/2),a=a*a;return[1-2*(n*n+r*r)*a,2*(e*n*a+r*o),2*(e*r*a-n*o),0,2*(e*n*a-r*o),1-2*(e*e+r*r)*a,2*(n*r*a+e*o),0,2*(e*r*a+n*o),2*(n*r*a-e*o),1-2*(e*e+n*n)*a,0,0,0,0,1];case"scale":return[t.d[0].value,0,0,0,0,t.d[1].value,0,0,0,0,1,0,0,0,0,1];case"scalex":return[t.d[0].value,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];case"scaley":return[1,0,0,0,0,t.d[0].value,0,0,0,0,1,0,0,0,0,1];case"scalez":return[1,0,0,0,0,1,0,0,0,0,t.d[0].value,0,0,0,0,1];case"scale3d":return[t.d[0].value,0,0,0,0,t.d[1].value,0,0,0,0,t.d[2].value,0,0,0,0,1];case"skew":o=oi(_a(t.d[0])),a=oi(_a(t.d[1]));return[1,Math.tan(a),0,0,Math.tan(o),1,0,0,0,0,1,0,0,0,0,1];case"skewx":return i=oi(_a(t.d[0])),[1,0,0,0,Math.tan(i),1,0,0,0,0,1,0,0,0,0,1];case"skewy":return i=oi(_a(t.d[0])),[1,Math.tan(i),0,0,0,1,0,0,0,0,1,0,0,0,0,1];case"translate":return[1,0,0,0,0,1,0,0,0,0,1,0,e=Aa(t.d[0],0,null)||0,n=Aa(t.d[1],0,null)||0,0,1];case"translatex":return[1,0,0,0,0,1,0,0,0,0,1,0,e=Aa(t.d[0],0,null)||0,0,0,1];case"translatey":return[1,0,0,0,0,1,0,0,0,0,1,0,0,n=Aa(t.d[0],0,null)||0,0,1];case"translatez":return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,r=Aa(t.d[0],0,null)||0,1];case"translate3d":return[1,0,0,0,0,1,0,0,0,0,1,0,e=Aa(t.d[0],0,null)||0,n=Aa(t.d[1],0,null)||0,r=Aa(t.d[2],0,null)||0,1];case"perspective":a=Aa(t.d[0],0,null)||0;return[1,0,0,0,0,1,0,0,0,0,1,a?-1/a:0,0,0,0,1];case"matrix":return[t.d[0].value,t.d[1].value,0,0,t.d[2].value,t.d[3].value,0,0,0,0,1,0,t.d[4].value,t.d[5].value,0,1];case"matrix3d":return t.d.map(function(t){return t.value})}}function Ka(t,e){return[t[0]*e[0]+t[4]*e[1]+t[8]*e[2]+t[12]*e[3],t[1]*e[0]+t[5]*e[1]+t[9]*e[2]+t[13]*e[3],t[2]*e[0]+t[6]*e[1]+t[10]*e[2]+t[14]*e[3],t[3]*e[0]+t[7]*e[1]+t[11]*e[2]+t[15]*e[3],t[0]*e[4]+t[4]*e[5]+t[8]*e[6]+t[12]*e[7],t[1]*e[4]+t[5]*e[5]+t[9]*e[6]+t[13]*e[7],t[2]*e[4]+t[6]*e[5]+t[10]*e[6]+t[14]*e[7],t[3]*e[4]+t[7]*e[5]+t[11]*e[6]+t[15]*e[7],t[0]*e[8]+t[4]*e[9]+t[8]*e[10]+t[12]*e[11],t[1]*e[8]+t[5]*e[9]+t[9]*e[10]+t[13]*e[11],t[2]*e[8]+t[6]*e[9]+t[10]*e[10]+t[14]*e[11],t[3]*e[8]+t[7]*e[9]+t[11]*e[10]+t[15]*e[11],t[0]*e[12]+t[4]*e[13]+t[8]*e[14]+t[12]*e[15],t[1]*e[12]+t[5]*e[13]+t[9]*e[14]+t[13]*e[15],t[2]*e[12]+t[6]*e[13]+t[10]*e[14]+t[14]*e[15],t[3]*e[12]+t[7]*e[13]+t[11]*e[14]+t[15]*e[15]]}function Xa(t){var e=[0,0,0],n=[1,1,1],r=[0,0,0],i=[0,0,0,1],a=[0,0,0,1];return gi(0===(t=t).length?[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]:t.map(Ua).reduce(Ka),e,n,r,i,a),[[e,n,r,a,i]]}var Za=function(t,e,n,r,i){for(var a=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]],o=0;o<4;o++)a[o][3]=i[o];for(var s=0;s<3;s++)for(var l=0;l<3;l++)a[3][s]+=t[l]*a[l][s];var c=r[0],u=r[1],f=r[2],r=r[3],h=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]],f=(h[0][0]=1-2*(u*u+f*f),h[0][1]=2*(c*u-f*r),h[0][2]=2*(c*f+u*r),h[1][0]=2*(c*u+f*r),h[1][1]=1-2*(c*c+f*f),h[1][2]=2*(u*f-c*r),h[2][0]=2*(c*f-u*r),h[2][1]=2*(u*f+c*r),h[2][2]=1-2*(c*c+u*u),a=Qa(a,h),[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]]);n[2]&&(f[2][1]=n[2],a=Qa(a,f)),n[1]&&(f[2][1]=0,f[2][0]=n[0],a=Qa(a,f)),n[0]&&(f[2][0]=0,f[1][0]=n[0],a=Qa(a,f));for(var d=0;d<3;d++)for(var p=0;p<3;p++)a[d][p]*=e[d];return 0==(r=a)[0][2]&&0==r[0][3]&&0==r[1][2]&&0==r[1][3]&&0==r[2][0]&&0==r[2][1]&&1==r[2][2]&&0==r[2][3]&&0==r[3][2]&&1==r[3][3]?[a[0][0],a[0][1],a[1][0],a[1][1],a[3][0],a[3][1]]:a[0].concat(a[1],a[2],a[3])};function Qa(t,e){for(var n=[[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0]],r=0;r<4;r++)for(var i=0;i<4;i++)for(var a=0;a<4;a++)n[r][i]+=e[r][a]*t[a][i];return n}function Ja(t){return t.toFixed(6).replace(".000000","")}function to(e,n){var r,i;return e.decompositionPair!==n&&(e.decompositionPair=n,r=Xa(e)),n.decompositionPair!==e&&(n.decompositionPair=e,i=Xa(n)),null===r[0]||null===i[0]?[[!1],[!0],function(t){return(t?n:e)[0].d}]:(r[0].push(0),i[0].push(1),[r,i,function(t){var e=function(t,e,n){var r=function(t,e){for(var n=0,r=0;r<t.length;r++)n+=t[r]*e[r];return n}(t,e),i=(r=Ye(r,-1,1),[]);if(1===r)i=t;else for(var a=Math.acos(r),o=+Math.sin(n*a)/Math.sqrt(1-r*r),s=0;s<4;s++)i.push(t[s]*(Math.cos(n*a)-r*o)+e[s]*o);return i}(r[0][3],i[0][3],t[5]);return Za(t[0],t[1],t[2],e,t[4]).map(Ja).join(",")}])}function eo(t){return t.replace(/[xy]/,"")}function no(t){return t.replace(/(x|y|z|3d)?$/,"3d")}var ro=function(t,e){return"perspective"===t&&"perspective"===e||("matrix"===t||"matrix3d"===t)&&("matrix"===e||"matrix3d"===e)};function io(r,i,t){var e=!1;if(!r.length||!i.length){r.length||(e=!0,r=i,i=[]);for(var a=0;a<r.length;a++)!function(){var t=r[a],e=t.t,t=t.d,n="scale"===e.substring(0,5)?1:0;i.push({t:e,d:t.map(function(t){return"number"==typeof t?Qr(n):Qr(n,t.unit)})})}()}var n=[],o=[],s=[];if(r.length!==i.length)var l=to(r,i),n=[l[0]],o=[l[1]],s=[["matrix",[l[2]]]];else for(var c=0;c<r.length;c++){var u=r[c].t,f=i[c].t,h=r[c].d,d=i[c].d,p=Ya[u],g=Ya[f],m=void 0;if(ro(u,f)){var y=to([r[c]],[i[c]]);n.push(y[0]),o.push(y[1]),s.push(["matrix",[y[2]]])}else{if(u===f)m=u;else if(p[2]&&g[2]&&eo(u)===eo(f))m=eo(u),h=p[2](h),d=g[2](d);else{if(!p[1]||!g[1]||no(u)!==no(f)){y=to(r,i);n=[y[0]],o=[y[1]],s=[["matrix",[y[2]]]];break}m=no(u),h=p[1](h),d=g[1](d)}for(var v=[],b=[],x=[],w=0;w<h.length;w++){var M=function(t,e,n,r,i){void 0===i&&(i=0);var a="",o=t.value||0,s=e.value||0,l=Dr(t.unit),c=t.convertTo(l),l=e.convertTo(l);return c&&l?(o=c.value,s=l.value,a=Sr(t.unit)):(qr.isLength(t.unit)||qr.isLength(e.unit))&&(o=Aa(t,i,n),s=Aa(e,i,n),a="px"),[o,s,function(t){return(t=r?Math.max(t,0):t)+a}]}(h[w],d[w],t,!1,w);v[w]=M[0],b[w]=M[1],x.push(M[2])}n.push(v),o.push(b),s.push([m,x])}}return e&&(l=n,n=o,o=l),[n,o,function(t){return t.map(function(t,n){t=t.map(function(t,e){return s[n][1][e](t)}).join(",");return"matrix"===s[n][0]&&16===t.split(",").length&&(s[n][0]="matrix3d"),"matrix3d"===s[n][0]&&6===t.split(",").length&&(s[n][0]="matrix"),s[n][0]+"("+t+")"}).join(" ")}]}var ao=Cr(function(t){var e;return Ve(t)?"text-anchor"===t?[Qr(0,"px"),Qr(0,"px")]:(1===(e=t.split(" ")).length&&("top"===e[0]||"bottom"===e[0]?(e[1]=e[0],e[0]="center"):e[1]="center"),2!==e.length?null:[Oa(oo(e[0])),Oa(oo(e[1]))]):[Qr(t[0]||0,"px"),Qr(t[1]||0,"px")]});function oo(t){return"center"===t?"50%":"left"===t||"top"===t?"0":"right"===t||"bottom"===t?"100%":t}var r=function(){function t(){this.parser=ka,this.parserWithCSSDisabled=null,this.mixer=Ca}return t.prototype.calculator=function(t,e,n,r){return _a(n)},t}(),n=function(){function t(){}return t.prototype.calculator=function(t,e,n,r){return n instanceof Pr&&(n=null),x.sceneGraphService.updateDisplayObjectDependency(t,e,n,r),"clipPath"===t&&r.forEach(function(t){0===t.childNodes.length&&x.sceneGraphService.dirtifyToRoot(t)}),n},t}(),e=function(){function t(){this.parser=ba,this.parserWithCSSDisabled=ba,this.mixer=xa}return t.prototype.calculator=function(t,e,n,r){return n instanceof Pr?"none"===n.value?Kr:Xr:n},t}(),so=function(){function t(){this.parser=ja}return t.prototype.calculator=function(t,e,n){return n instanceof Pr?[]:n},t}();function lo(t){t=t.parsedStyle.fontSize;return p(t)?null:t}function co(){this.parser=ao}var uo,fo,ho=function(){function t(){this.parser=Oa,this.parserWithCSSDisabled=null,this.mixer=Ca}return t.prototype.calculator=function(t,e,n,r,i){if($e(n))return n;if(!qr.isRelativeUnit(n.unit))return n.value;if(n.unit===s.kPercentage)return 0;if(n.unit===s.kEms){if(r.parentNode){var a=lo(r.parentNode);if(a)return a*=n.value}return i.addUnresolveProperty(r,t),0}if(n.unit===s.kRems){if(null!=r&&null!=(a=r.ownerDocument)&&a.documentElement){a=lo(r.ownerDocument.documentElement);if(a)return a*=n.value}return i.addUnresolveProperty(r,t),0}},t}(),po=function(){function t(){this.mixer=Ia}var e=t.prototype;return e.parser=function(t){t=Sa($e(t)?[t]:t),t=1===t.length?[t[0],t[0]]:[t[0],t[1]];return t},e.calculator=function(t,e,n){return n.map(function(t){return t.value})},t}(),go=function(){function t(){this.mixer=Ia}var e=t.prototype;return e.parser=function(t){t=Sa($e(t)?[t]:t),t=1===t.length?[t[0],t[0],t[0],t[0]]:2===t.length?[t[0],t[1],t[0],t[1]]:3===t.length?[t[0],t[1],t[2],t[1]]:[t[0],t[1],t[2],t[3]];return t},e.calculator=function(t,e,n){return n.map(function(t){return t.value})},t}(),i=function(t){function e(){return t.apply(this,arguments)||this}return Mr(e,t),e.prototype.postProcessor=function(t,e){var n,r;switch(t.nodeName){case b.CIRCLE:case b.ELLIPSE:var i=t.parsedStyle,a=i.cx,o=i.cy,i=i.cz;p(a)||(l=a),p(o)||(c=o),p(i)||(u=i);break;case b.LINE:var a=t.parsedStyle,o=a.x1,i=a.x2,s=a.y1,a=a.y2,l=Math.min(o,i),c=Math.min(s,a),u=0;break;case b.RECT:case b.IMAGE:case b.GROUP:case b.HTML:case b.TEXT:case b.MESH:p(t.parsedStyle.x)||(l=t.parsedStyle.x),p(t.parsedStyle.y)||(c=t.parsedStyle.y),p(t.parsedStyle.z)||(u=t.parsedStyle.z)}t.nodeName!==b.PATH&&t.nodeName!==b.POLYLINE&&t.nodeName!==b.POLYGON&&(t.parsedStyle.defX=l||0,t.parsedStyle.defY=c||0),p(l)&&p(c)&&p(u)||-1!==e.indexOf("transform")||((e=t.parsedStyle.transform)&&e.length?vi(e,t):(n=(e=t.getLocalPosition())[0],r=e[1],e=e[2],t.setLocalPosition(p(l)?n:l,p(c)?r:c,p(u)?e:u)))},e}(ho),mo=function(){function t(){}return t.prototype.calculator=function(t,e,n,r){n=null==(n=n=n instanceof Pr?null:n)?void 0:n.cloneNode(!0);return n&&(n.style.isMarker=!0),n},t}(),yo=function(){function t(){this.mixer=Ca,this.parser=Pa,this.parserWithCSSDisabled=null}return t.prototype.calculator=function(t,e,n){return n.value},t}(),vo=function(){function t(){this.parser=Pa,this.parserWithCSSDisabled=null,this.mixer=Ra(0,1)}var e=t.prototype;return e.calculator=function(t,e,n){return n.value},e.postProcessor=function(t){var e,n=t.parsedStyle,r=n.offsetPath,n=n.offsetDistance;!r||(e=r.nodeName)!==b.LINE&&e!==b.PATH&&e!==b.POLYLINE||(e=r.getPoint(n))&&(t.parsedStyle.defX=e.x,t.parsedStyle.defY=e.y,t.setLocalPosition(e.x,e.y))},t}(),bo=function(){function t(){this.parser=Pa,this.parserWithCSSDisabled=null,this.mixer=Ra(0,1)}return t.prototype.calculator=function(t,e,n){return n.value},t}(),xo=function(){function m(){this.center=[0,0,0],this.halfExtents=[0,0,0],this.min=[0,0,0],this.max=[0,0,0]}m.isEmpty=function(t){return!t||0===t.halfExtents[0]&&0===t.halfExtents[1]&&0===t.halfExtents[2]};var t=m.prototype;return t.update=function(t,e){ti(this.center,t),ti(this.halfExtents,e),ei(this.min,this.center,this.halfExtents),ni(this.max,this.center,this.halfExtents)},t.setMinMax=function(t,e){ni(this.center,e,t),ri(this.center,this.center,.5),ei(this.halfExtents,e,t),ri(this.halfExtents,this.halfExtents,.5),ti(this.min,t),ti(this.max,e)},t.getMin=function(){return this.min},t.getMax=function(){return this.max},t.add=function(t){var e,n,r,i,a,o,s,l,c,u,f,h,d,p,g;m.isEmpty(t)||(m.isEmpty(this)?this.setMinMax(t.getMin(),t.getMax()):(n=(e=this.center)[0],p=e[1],a=e[2],i=(r=this.halfExtents)[0],f=r[1],o=r[2],l=(h=t.center)[0],g=h[1],h=h[2],c=(t=t.halfExtents)[0],(d=g-(u=t[1]))<(s=p-f)&&(s=d),(d=p+f)<(p=g+u)&&(d=p),(g=h-(f=t[2]))<(u=a-o)&&(u=g),(p=a+o)<(t=h+f)&&(p=t),e[0]=.5*((a=(g=l-c)<(a=n-i)?g:a)+(o=(o=n+i)<(h=l+c)?h:o)),e[1]=.5*(s+d),e[2]=.5*(u+p),r[0]=.5*(o-a),r[1]=.5*(d-s),r[2]=.5*(p-u),this.min[0]=a,this.min[1]=s,this.min[2]=u,this.max[0]=o,this.max[1]=d,this.max[2]=p))},t.setFromTransformedAABB=function(t,e){var n=this.center,r=this.halfExtents,i=t.center,t=t.halfExtents,a=e[0],o=e[4],s=e[8],l=e[1],c=e[5],u=e[9],f=e[2],h=e[6],d=e[10],p=Math.abs(a),g=Math.abs(o),m=Math.abs(s),y=Math.abs(l),v=Math.abs(c),b=Math.abs(u),x=Math.abs(f),w=Math.abs(h),M=Math.abs(d);n[0]=e[12]+a*i[0]+o*i[1]+s*i[2],n[1]=e[13]+l*i[0]+c*i[1]+u*i[2],n[2]=e[14]+f*i[0]+h*i[1]+d*i[2],r[0]=p*t[0]+g*t[1]+m*t[2],r[1]=y*t[0]+v*t[1]+b*t[2],r[2]=x*t[0]+w*t[1]+M*t[2],ei(this.min,n,r),ni(this.max,n,r)},t.intersects=function(t){var e=this.getMax(),n=this.getMin(),r=t.getMax(),t=t.getMin();return n[0]<=r[0]&&e[0]>=t[0]&&n[1]<=r[1]&&e[1]>=t[1]&&n[2]<=r[2]&&e[2]>=t[2]},t.intersection=function(t){var e,n,r,i;return this.intersects(t)?(e=new m,i=[0,0,0],n=this.getMin(),r=t.getMin(),i[0]=Math.max(n[0],r[0]),i[1]=Math.max(n[1],r[1]),i[2]=Math.max(n[2],r[2]),n=i,r=[0,0,0],i=this.getMax(),t=t.getMax(),r[0]=Math.min(i[0],t[0]),r[1]=Math.min(i[1],t[1]),r[2]=Math.min(i[2],t[2]),e.setMinMax(n,r),e):null},t.getNegativeFarPoint=function(t){return 273===t.pnVertexFlag?ti([0,0,0],this.min):272===t.pnVertexFlag?[this.min[0],this.min[1],this.max[2]]:257===t.pnVertexFlag?[this.min[0],this.max[1],this.min[2]]:256===t.pnVertexFlag?[this.min[0],this.max[1],this.max[2]]:17===t.pnVertexFlag?[this.max[0],this.min[1],this.min[2]]:16===t.pnVertexFlag?[this.max[0],this.min[1],this.max[2]]:1===t.pnVertexFlag?[this.max[0],this.max[1],this.min[2]]:[this.max[0],this.max[1],this.max[2]]},t.getPositiveFarPoint=function(t){return 273===t.pnVertexFlag?ti([0,0,0],this.max):272===t.pnVertexFlag?[this.max[0],this.max[1],this.min[2]]:257===t.pnVertexFlag?[this.max[0],this.min[1],this.max[2]]:256===t.pnVertexFlag?[this.max[0],this.min[1],this.min[2]]:17===t.pnVertexFlag?[this.min[0],this.max[1],this.max[2]]:16===t.pnVertexFlag?[this.min[0],this.max[1],this.min[2]]:1===t.pnVertexFlag?[this.min[0],this.min[1],this.max[2]]:[this.min[0],this.min[1],this.min[2]]},m}(),wo=function(){function t(t,e){this.distance=void 0,this.normal=void 0,this.pnVertexFlag=void 0,this.distance=t||0,this.normal=e||Ft(0,1,0),this.updatePNVertexFlag()}var e=t.prototype;return e.updatePNVertexFlag=function(){this.pnVertexFlag=(Number(0<=this.normal[0])<<8)+(Number(0<=this.normal[1])<<4)+Number(0<=this.normal[2])},e.distanceToPoint=function(t){return Ht(t,this.normal)-this.distance},e.normalize=function(){var t,e,n,r=1/Kt(this.normal);t=this.normal,e=this.normal,n=r,t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,this.distance*=r},e.intersectsLine=function(t,e,n){var r,i,a=this.distanceToPoint(t),a=a/(a-this.distanceToPoint(e)),o=0<=a&&a<=1;return o&&n&&(n=n,e=e,a=a,r=(t=t)[0],i=t[1],t=t[2],n[0]=r+a*(e[0]-r),n[1]=i+a*(e[1]-i),n[2]=t+a*(e[2]-t)),o},t}(),Mo=(0,function(){function t(t){if(this.planes=[],t)this.planes=t;else for(var e=0;e<6;e++)this.planes.push(new wo)}return t.prototype.extractFromVPMatrix=function(t){var e=t[0],n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],l=t[7],c=t[8],u=t[9],f=t[10],h=t[11],d=t[12],p=t[13],g=t[14],t=t[15];zt(this.planes[0].normal,i-e,l-a,h-c),this.planes[0].distance=t-d,zt(this.planes[1].normal,i+e,l+a,h+c),this.planes[1].distance=t+d,zt(this.planes[2].normal,i+n,l+o,h+u),this.planes[2].distance=t+p,zt(this.planes[3].normal,i-n,l-o,h-u),this.planes[3].distance=t-p,zt(this.planes[4].normal,i-r,l-s,h-f),this.planes[4].distance=t-g,zt(this.planes[5].normal,i+r,l+s,h+f),this.planes[5].distance=t+g,this.planes.forEach(function(t){t.normalize(),t.updatePNVertexFlag()})},t}()),Oo=function(){function t(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.x=0,this.y=0,this.x=t,this.y=e}var e=t.prototype;return e.clone=function(){return new t(this.x,this.y)},e.copyFrom=function(t){this.x=t.x,this.y=t.y},t}(),ko=function(){function t(t,e,n,r){this.x=void 0,this.y=void 0,this.width=void 0,this.height=void 0,this.left=void 0,this.right=void 0,this.top=void 0,this.bottom=void 0,this.x=t,this.y=e,this.width=n,this.height=r,this.left=t,this.right=t+n,this.top=e,this.bottom=e+r}return t.prototype.toJSON=function(){},t}(),_o=function(){function t(){this.parser=Da,this.parserWithCSSDisabled=Da,this.mixer=za}var e=t.prototype;return e.calculator=function(t,e,n){return n instanceof Pr&&"unset"===n.value?{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new ko(0,0,0,0)}:n},e.postProcessor=function(t,e){var n;t.nodeName===b.PATH&&-1===e.indexOf("transform")&&(n=(e=t.parsedStyle).defX,e=e.defY,t.setLocalPosition(void 0===n?0:n,void 0===e?0:e))},t}(),Eo=function(){function t(){this.parser=Wa,this.mixer=Ga}return t.prototype.postProcessor=function(t,e){var n;t.nodeName!==b.POLYGON&&t.nodeName!==b.POLYLINE||-1!==e.indexOf("transform")||(n=(e=t.parsedStyle).defX,e=e.defY,t.setLocalPosition(n,e))},t}(),So=function(i){function t(){for(var t,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return(t=i.call.apply(i,[this].concat(n))||this).mixer=Ra(0,1/0),t}return Mr(t,i),t}(ho),Ao=function(){function t(){}var e=t.prototype;return e.calculator=function(t,e,n,r){return n instanceof Pr?"unset"===n.value?"":n.value:""+n},e.postProcessor=function(t){t.nodeValue=""+t.parsedStyle.text||""},t}(),Lo=function(){function t(){}return t.prototype.calculator=function(t,e,n,r){var i,a=r.getAttribute("text");return a&&(i=a,"capitalize"===n.value?i=a.charAt(0).toUpperCase()+a.slice(1):"lowercase"===n.value?i=a.toLowerCase():"uppercase"===n.value&&(i=a.toUpperCase()),r.parsedStyle.text=i),n.value},t}(),To=function(){function t(){this.parser=$a,this.parserWithCSSDisabled=$a,this.mixer=io}var e=t.prototype;return e.calculator=function(t,e,n,r){return n instanceof Pr?[]:n},e.postProcessor=function(t){vi(t.parsedStyle.transform,t)},t}(),jo=(uo=uo||{},uo[uo.Standard=0]="Standard",(jo=fo=fo||{})[jo.ADDED=0]="ADDED",jo[jo.REMOVED=1]="REMOVED",jo[jo.Z_INDEX_CHANGED=2]="Z_INDEX_CHANGED",function(){function t(){this.parser=Pa}var e=t.prototype;return e.calculator=function(t,e,n,r){return n.value},e.postProcessor=function(t){var e;t.parentNode&&(e=(t=t.parentNode).renderable,t=t.sortable,e&&(e.dirty=!0),t)&&(t.dirty=!0,t.dirtyReason=fo.Z_INDEX_CHANGED)},t}());var No,Po=function(){function e(t){this.type=void 0,this.eventPhase=e.prototype.NONE,this.target=void 0,this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.currentTarget=void 0,this.defaultPrevented=!1,this.timeStamp=void 0,this.nativeEvent=void 0,this.originalEvent=void 0,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.manager=void 0,this.detail=void 0,this.layer=new Oo,this.page=new Oo,this.canvas=new Oo,this.viewport=new Oo,this.path=void 0,this.view=void 0,this.which=void 0,this.returnValue=void 0,this.srcElement=void 0,this.composed=!1,this.isTrusted=void 0,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=t}var t=e.prototype;return t.composedPath=function(){return!this.manager||this.path&&this.path[0]===this.target||(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path},t.preventDefault=function(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0},t.stopImmediatePropagation=function(){this.propagationImmediatelyStopped=!0},t.stopPropagation=function(){this.propagationStopped=!0},t.initEvent=function(){},t.initUIEvent=function(){},t.clone=function(){throw new Error(Jr)},xr(e,[{key:"name",get:function(){return this.type}},{key:"layerX",get:function(){return this.layer.x}},{key:"layerY",get:function(){return this.layer.y}},{key:"pageX",get:function(){return this.page.x}},{key:"pageY",get:function(){return this.page.y}},{key:"x",get:function(){return this.canvas.x}},{key:"y",get:function(){return this.canvas.y}},{key:"canvasX",get:function(){return this.canvas.x}},{key:"canvasY",get:function(){return this.canvas.y}},{key:"viewportX",get:function(){return this.viewport.x}},{key:"viewportY",get:function(){return this.viewport.y}},{key:"propagationPath",get:function(){return this.composedPath()}}]),e}(),Co=function(r){function t(t,e){var n=r.call(this,null)||this;return n.type=t,n.detail=e,Object.assign(function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(n),e),n}return Mr(t,r),t}(Po),Ro=function(i){function d(){for(var t,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return(t=i.call.apply(i,[this].concat(n))||this).shadow=!1,t.ownerDocument=null,t.isConnected=!1,t.baseURI="",t.childNodes=[],t.nodeType=0,t.nodeName="",t.nodeValue=null,t.parentNode=null,t}Mr(d,i),d.isNode=function(t){return!!t.childNodes};var t=d.prototype;return t.getRootNode=function(t){return void 0===t&&(t={}),this.parentNode?this.parentNode.getRootNode(t):t.composed&&this.host?this.host.getRootNode(t):this},t.hasChildNodes=function(){return 0<this.childNodes.length},t.isDefaultNamespace=function(t){throw new Error(Jr)},t.lookupNamespaceURI=function(t){throw new Error(Jr)},t.lookupPrefix=function(t){throw new Error(Jr)},t.normalize=function(){throw new Error(Jr)},t.isEqualNode=function(t){return this===t},t.isSameNode=function(t){return this.isEqualNode(t)},t.compareDocumentPosition=function(t){if(t===this)return 0;for(var e=[i=t],n=[a=this];null!=(r=i.parentNode)?r:a.parentNode;)var r,i=i.parentNode?(e.push(i.parentNode),i.parentNode):i,a=a.parentNode?(n.push(a.parentNode),a.parentNode):a;if(i!==a)return d.DOCUMENT_POSITION_DISCONNECTED|d.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC|d.DOCUMENT_POSITION_PRECEDING;var o=n.length<e.length?e:n,s=o===e?n:e;if(o[o.length-s.length]===s[0])return o===e?d.DOCUMENT_POSITION_CONTAINED_BY|d.DOCUMENT_POSITION_FOLLOWING:d.DOCUMENT_POSITION_CONTAINS|d.DOCUMENT_POSITION_PRECEDING;for(var l=o.length-s.length,c=s.length-1;0<=c;c--){var u,f=s[c],h=o[l+c];if(h!==f)return(u=f.parentNode.childNodes).indexOf(f)<u.indexOf(h)?s===e?d.DOCUMENT_POSITION_PRECEDING:d.DOCUMENT_POSITION_FOLLOWING:o===e?d.DOCUMENT_POSITION_PRECEDING:d.DOCUMENT_POSITION_FOLLOWING}return d.DOCUMENT_POSITION_FOLLOWING},t.contain=function(t){return this.contains(t)},t.contains=function(t){for(var e=t;e&&this!==e;)e=e.parentNode;return!!e},t.getAncestor=function(t){for(var e=this;0<t&&e;)e=e.parentNode,t--;return e},t.forEach=function(e,t){void 0===t&&(t=!1),e(this)||(t?this.childNodes.slice():this.childNodes).forEach(function(t){t.forEach(e)})},xr(d,[{key:"textContent",get:function(){var t="";this.nodeName===b.TEXT&&(t+=this.style.text);for(var e=_r(this.childNodes);!(n=e()).done;){var n=n.value;n.nodeName===b.TEXT?t+=n.nodeValue:t+=n.textContent}return t},set:function(t){var e=this;this.childNodes.slice().forEach(function(t){e.removeChild(t)}),this.nodeName===b.TEXT&&(this.style.text=""+t)}},{key:"parent",get:function(){return this.parentNode}},{key:"parentElement",get:function(){return null}},{key:"nextSibling",get:function(){return null}},{key:"previousSibling",get:function(){return null}},{key:"firstChild",get:function(){return 0<this.childNodes.length?this.childNodes[0]:null}},{key:"lastChild",get:function(){return 0<this.childNodes.length?this.childNodes[this.childNodes.length-1]:null}}]),d}(function(){function t(){this.emitter=new vr}var e=t.prototype;return e.on=function(t,e,n){return this.addEventListener(t,e,n),this},e.addEventListener=function(t,e,n){var r,i,a,o=Je(n)&&n||ze(n)&&n.capture,n=ze(n)&&n.once,s=Br(e)?void 0:e,l=!1,c="";return-1<t.indexOf(":")&&(i=(r=t.split(":"))[0],t=r[1],c=i,l=!0),t=o?t+"capture":t,e=Br(e)?e:e.handleEvent,l&&(a=e,e=function(){for(var t,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];(null==(t=n[0].target)?void 0:t.name)===c&&a.apply(void 0,n)}),n?this.emitter.once(t,e,s):this.emitter.on(t,e,s),this},e.off=function(t,e,n){return t?this.removeEventListener(t,e,n):this.removeAllEventListeners(),this},e.removeAllEventListeners=function(){this.emitter.removeAllListeners()},e.removeEventListener=function(t,e,n){var r,n=Je(n)&&n||ze(n)&&n.capture,i=Br(e)?void 0:e;return e=Br(e)?e:null==(r=e)?void 0:r.handleEvent,this.emitter.off(t=n?t+"capture":t,e,i),this},e.emit=function(t,e){this.dispatchEvent(new Co(t,e))},e.dispatchEvent=function(t,e){if(void 0===e&&(e=!1),!t.type)throw new Error("DisplayObject cannot propagate events outside of the Federated Events API");var n;if(n=this.document?this:this.defaultView||(null==(n=this.ownerDocument)?void 0:n.defaultView)){if(t.manager=n.getEventService()||null,!t.manager)return!1;t.defaultPrevented=!1,t.path=[],e||(t.target=this),null!=(n=t.manager)&&n.dispatchEvent(t,t.type,e)}return!t.defaultPrevented},t}()),Io=(Ro.DOCUMENT_POSITION_DISCONNECTED=1,Ro.DOCUMENT_POSITION_PRECEDING=2,Ro.DOCUMENT_POSITION_FOLLOWING=4,Ro.DOCUMENT_POSITION_CONTAINS=8,Ro.DOCUMENT_POSITION_CONTAINED_BY=16,Ro.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC=32,(Wo=No=No||{}).REPARENT="reparent",Wo.DESTROY="destroy",Wo.ATTR_MODIFIED="DOMAttrModified",Wo.INSERTED="DOMNodeInserted",Wo.REMOVED="removed",Wo.MOUNTED="DOMNodeInsertedIntoDocument",Wo.UNMOUNTED="DOMNodeRemovedFromDocument",Wo.BOUNDS_CHANGED="bounds-changed",Wo.CULLED="culled",function(c){function t(t,e,n,r,i,a,o,s){var l=c.call(this,null)||this;return l.relatedNode=void 0,l.prevValue=void 0,l.newValue=void 0,l.attrName=void 0,l.attrChange=void 0,l.prevParsedValue=void 0,l.newParsedValue=void 0,l.relatedNode=e,l.prevValue=n,l.newValue=r,l.attrName=i,l.attrChange=a,l.prevParsedValue=o,l.newParsedValue=s,l.type=t,l}return Mr(t,c),t}(Po)),Bo=(Io.ADDITION=2,Io.MODIFICATION=1,Io.REMOVAL=3,0),Fo=new Io(No.INSERTED,null,"","","",0,"",""),Do=new Io(No.REMOVED,null,"","","",0,"",""),zo=new Co(No.DESTROY),Wo=function(i){function t(){for(var t,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return(t=i.call.apply(i,[this].concat(n))||this).entity=Bo++,t.renderable={bounds:void 0,boundsDirty:!0,renderBounds:void 0,renderBoundsDirty:!0,dirtyRenderBounds:void 0,dirty:!1,proxyNodeName:void 0},t.cullable={strategy:uo.Standard,visibilityPlaneMask:-1,visible:!0,enable:!0},t.transformable={dirtyFlag:!1,localDirtyFlag:!1,frozen:!1,localPosition:[0,0,0],localRotation:[0,0,0,1],localScale:[1,1,1],localTransform:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],localSkew:[0,0],position:[0,0,0],rotation:[0,0,0,1],scaling:[1,1,1],worldTransform:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],origin:[0,0,0]},t.sortable={dirty:!1,sorted:void 0,renderOrder:0,dirtyChildren:[],dirtyReason:void 0},t.geometry={contentBounds:void 0,renderBounds:void 0},t.rBushNode={aabb:void 0},t.id=void 0,t.name=void 0,t.namespaceURI="g",t.scrollLeft=0,t.scrollTop=0,t.clientTop=0,t.clientLeft=0,t.destroyed=!1,t.style={},t.computedStyle=x.enableCSSParsing?{anchor:$r,opacity:$r,fillOpacity:$r,strokeOpacity:$r,fill:$r,stroke:$r,transform:$r,transformOrigin:$r,visibility:$r,pointerEvents:$r,lineWidth:$r,lineCap:$r,lineJoin:$r,increasedLineWidthForHitTesting:$r,fontSize:$r,fontFamily:$r,fontStyle:$r,fontWeight:$r,fontVariant:$r,textAlign:$r,textBaseline:$r,textTransform:$r,zIndex:$r,filter:$r,shadowType:$r}:null,t.parsedStyle={},t.attributes={},t}Mr(t,i),t.isElement=function(t){return!!t.getAttribute};var e=t.prototype;return e.cloneNode=function(t){throw new Error(Jr)},e.appendChild=function(t,e){if(t.destroyed)throw new Error("Cannot append a destroyed element.");return x.sceneGraphService.attach(t,this,e),null!=(e=this.ownerDocument)&&e.defaultView&&this.ownerDocument.defaultView.mountChildren(t),Fo.relatedNode=this,t.dispatchEvent(Fo),t},e.insertBefore=function(t,e){return e?(e=this.childNodes.indexOf(e),this.appendChild(t,e-1)):this.appendChild(t),t},e.replaceChild=function(t,e){var n=this.childNodes.indexOf(e);return this.removeChild(e),this.appendChild(t,n),e},e.removeChild=function(t){var e;return Do.relatedNode=this,t.dispatchEvent(Do),null!=(e=t.ownerDocument)&&e.defaultView&&t.ownerDocument.defaultView.unmountChildren(t),x.sceneGraphService.detach(t),t},e.removeChildren=function(){for(var t=this.childNodes.length-1;0<=t;t--){var e=this.childNodes[t];this.removeChild(e)}},e.destroyChildren=function(){for(var t=this.childNodes.length-1;0<=t;t--){var e=this.childNodes[t];e.childNodes.length&&e.destroyChildren(),e.destroy()}},e.matches=function(t){return x.sceneGraphService.matches(t,this)},e.getElementById=function(t){return x.sceneGraphService.querySelector("#"+t,this)},e.getElementsByName=function(t){return x.sceneGraphService.querySelectorAll('[name="'+t+'"]',this)},e.getElementsByClassName=function(t){return x.sceneGraphService.querySelectorAll("."+t,this)},e.getElementsByTagName=function(t){return x.sceneGraphService.querySelectorAll(t,this)},e.querySelector=function(t){return x.sceneGraphService.querySelector(t,this)},e.querySelectorAll=function(t){return x.sceneGraphService.querySelectorAll(t,this)},e.closest=function(t){var e=this;do{if(x.sceneGraphService.matches(t,e))return e}while(null!==(e=e.parentElement));return null},e.find=function(e){var n=this,r=null;return this.forEach(function(t){return!(t===n||!e(t)||(r=t,0))}),r},e.findAll=function(e){var n=this,r=[];return this.forEach(function(t){t!==n&&e(t)&&r.push(t)}),r},e.after=function(){var r=this;if(this.parentNode){for(var i=this.parentNode.childNodes.indexOf(this),t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];e.forEach(function(t,e){var n;return null==(n=r.parentNode)?void 0:n.appendChild(t,i+e+1)})}},e.before=function(){if(this.parentNode){for(var t=this.parentNode.childNodes.indexOf(this),e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];var i=n[0],a=n.slice(1);this.parentNode.appendChild(i,t),i.after.apply(i,a)}},e.replaceWith=function(){this.after.apply(this,arguments),this.remove()},e.append=function(){for(var e=this,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];n.forEach(function(t){return e.appendChild(t)})},e.prepend=function(){for(var n=this,t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];e.forEach(function(t,e){return n.appendChild(t,e)})},e.replaceChildren=function(){for(;this.childNodes.length&&this.firstChild;)this.removeChild(this.firstChild);this.append.apply(this,arguments)},e.remove=function(){return this.parentNode?this.parentNode.removeChild(this):this},e.destroy=function(){this.dispatchEvent(zo),this.remove(),this.emitter.removeAllListeners(),this.destroyed=!0},e.getGeometryBounds=function(){return x.sceneGraphService.getGeometryBounds(this)},e.getRenderBounds=function(){return x.sceneGraphService.getBounds(this,!0)},e.getBounds=function(){return x.sceneGraphService.getBounds(this)},e.getLocalBounds=function(){return x.sceneGraphService.getLocalBounds(this)},e.getBoundingClientRect=function(){return x.sceneGraphService.getBoundingClientRect(this)},e.getClientRects=function(){return[this.getBoundingClientRect()]},e.computedStyleMap=function(){return new Map(Object.entries(this.computedStyle))},e.getAttributeNames=function(){return Object.keys(this.attributes)},e.getAttribute=function(t){var e;return"symbol"==typeof t?x.enableCSSParsing?null:void 0:void 0===(e=this.attributes[t])&&(t=Gr(t),e=this.attributes[t],x.enableCSSParsing)&&p(e)?null:e},e.hasAttribute=function(t){return this.getAttributeNames().includes(t)},e.hasAttributes=function(){return!!this.getAttributeNames().length},e.removeAttribute=function(t){this.setAttribute(t,null),delete this.attributes[t]},e.setAttribute=function(t,e,n){this.attributes[t]=e},e.getAttributeNS=function(t,e){throw new Error(Jr)},e.getAttributeNode=function(t){throw new Error(Jr)},e.getAttributeNodeNS=function(t,e){throw new Error(Jr)},e.hasAttributeNS=function(t,e){throw new Error(Jr)},e.removeAttributeNS=function(t,e){throw new Error(Jr)},e.removeAttributeNode=function(t){throw new Error(Jr)},e.setAttributeNS=function(t,e,n){throw new Error(Jr)},e.setAttributeNode=function(t){throw new Error(Jr)},e.setAttributeNodeNS=function(t){throw new Error(Jr)},e.toggleAttribute=function(t,e){throw new Error(Jr)},xr(t,[{key:"className",get:function(){return this.getAttribute("class")||""},set:function(t){this.setAttribute("class",t)}},{key:"classList",get:function(){return this.className.split(" ").filter(function(t){return""!==t})}},{key:"tagName",get:function(){return this.nodeName}},{key:"children",get:function(){return this.childNodes}},{key:"childElementCount",get:function(){return this.childNodes.length}},{key:"firstElementChild",get:function(){return this.firstChild}},{key:"lastElementChild",get:function(){return this.lastChild}},{key:"parentElement",get:function(){return this.parentNode}},{key:"nextSibling",get:function(){var t;return this.parentNode&&(t=this.parentNode.childNodes.indexOf(this),this.parentNode.childNodes[t+1])||null}},{key:"previousSibling",get:function(){var t;return this.parentNode&&(t=this.parentNode.childNodes.indexOf(this),this.parentNode.childNodes[t-1])||null}}]),t}(Ro);var Go,qo,Ho,Vo=new Io(No.ATTR_MODIFIED,null,null,null,null,Io.MODIFICATION,null,null),Yo={anchor:"",opacity:"",fillOpacity:"",strokeOpacity:"",fill:"",stroke:"",transform:"",transformOrigin:"",visibility:"",pointerEvents:"",lineWidth:"",lineCap:"",lineJoin:"",increasedLineWidthForHitTesting:"",fontSize:"",fontFamily:"",fontStyle:"",fontWeight:"",fontVariant:"",textAlign:"",textBaseline:"",textTransform:"",zIndex:"",filter:"",shadowType:""},$o={anchor:[0,0],fill:Kr,stroke:Kr,transform:[],zIndex:0,filter:[],shadowType:"outer",miterLimit:10},Uo=wr({},$o,{opacity:1,fillOpacity:1,strokeOpacity:1,visibility:"visible",pointerEvents:"auto",lineWidth:1,lineCap:"butt",lineJoin:"miter",increasedLineWidthForHitTesting:0,fillRule:"nonzero"}),Ko=[].concat(["opacity","fillOpacity","strokeOpacity","transformOrigin","visibility","pointerEvents","lineWidth","lineCap","lineJoin","increasedLineWidthForHitTesting"],["fontSize","fontFamily","fontStyle","fontWeight","fontVariant","textAlign","textBaseline","textTransform"]),Xo=function(i){function t(t){var r=i.call(this)||this,t=(r.config=void 0,r.isCustomElement=!1,r.isMutationObserved=!1,r.activeAnimations=[],r.dataset=void 0,r.getClip=function(){return this.style.clipPath||null},r.config=t,r.config.interactive=null!=(t=r.config.capture)?t:r.config.interactive,r.id=r.config.id||"",r.name=r.config.name||"",(r.config.className||r.config.class)&&(r.className=r.config.className||r.config.class),r.nodeName=r.config.type||b.GROUP,r.config.style=r.config.style||r.config.attrs||{},Object.assign(r.config.style,r.config.attrs),null!=r.config.visible&&(r.config.style.visibility=!1===r.config.visible?"hidden":"visible"),null!=r.config.interactive&&(r.config.style.pointerEvents=!1===r.config.interactive?"none":"auto"),Object.assign(r.parsedStyle,x.enableCSSParsing?$o:Uo,r.config.initialParsedStyle),x.enableCSSParsing&&Object.assign(r.attributes,Yo),r.initAttributes(r.config.style),x.globalThis.Proxy||function(){});return x.enableDataset&&(r.dataset=new t({},{get:function(t,e){e="data-"+Rr(e);return void 0!==t[e]?t[e]:r.getAttribute(e)},set:function(t,e,n){return r.setAttribute("data-"+Rr(e),n),!0}})),x.enableStyleSyntax&&(r.style=new t({setProperty:function(t,e){r.setAttribute(t,e)},getPropertyValue:function(t){return r.getAttribute(t)},removeProperty:function(t){r.removeAttribute(t)},item:function(){return""}},{get:function(t,e){return void 0!==t[e]?t[e]:r.getAttribute(e)},set:function(t,e,n){return r.setAttribute(e,n),!0}})),r}Mr(t,i);var e=t.prototype;return e.destroy=function(){i.prototype.destroy.call(this),this.getAnimations().forEach(function(t){t.cancel()})},e.cloneNode=function(e,t){var n,r,i=wr({},this.attributes);for(n in i){var a=i[n];null!=(r=a)&&r.nodeName&&"clipPath"!==n&&"offsetPath"!==n&&"textPath"!==n&&(i[n]=a.cloneNode(e)),t&&(i[n]=t(n,a))}var o=new this.constructor({id:this.id,name:this.name,className:this.name,interactive:this.interactive,style:i});return o.setLocalTransform(this.getLocalTransform()),e&&this.children.forEach(function(t){t.style.isMarker||(t=t.cloneNode(e),o.appendChild(t))}),o},e.initAttributes=function(t){void 0===t&&(t={});var e,n=this.renderable,r={forceUpdateGeometry:!0},i=(x.enableCSSParsing&&(r.usedAttributes=Ko),{});for(e in t)i[Gr(e)]=t[e];x.styleValueRegistry.processProperties(this,i,r),n.dirty=!0},e.setAttribute=function(t,e,n){void 0===n&&(n=!1);t=Gr(t);tn(e)||!n&&e===this.attributes[t]||(this.internalSetAttribute(t,e),i.prototype.setAttribute.call(this,t,e))},e.internalSetAttribute=function(t,e,n){void 0===n&&(n={});var r=this.renderable,i=this.attributes[t],a=this.parsedStyle[t],o=(x.styleValueRegistry.processProperties(this,((o={})[t]=e,o),n),r.dirty=!0,this.parsedStyle[t]);this.isConnected&&(Vo.relatedNode=this,Vo.prevValue=i,Vo.newValue=e,Vo.attrName=t,Vo.prevParsedValue=a,Vo.newParsedValue=o,this.isMutationObserved?this.dispatchEvent(Vo):(Vo.target=this).ownerDocument.defaultView.dispatchEvent(Vo,!0)),(this.isCustomElement&&this.isConnected||!this.isCustomElement)&&this.attributeChangedCallback&&this.attributeChangedCallback(t,i,e,a,o)},e.getBBox=function(){var t=this.getBounds(),e=t.getMin(),n=e[0],e=e[1],t=t.getMax(),r=t[0],t=t[1];return new ko(n,e,r-n,t-e)},e.setOrigin=function(t,e,n){return x.sceneGraphService.setOrigin(this,ai(t,e=void 0===e?0:e,n=void 0===n?0:n)),this},e.getOrigin=function(){return x.sceneGraphService.getOrigin(this)},e.setPosition=function(t,e,n){return x.sceneGraphService.setPosition(this,ai(t,e=void 0===e?0:e,n=void 0===n?0:n)),this},e.setLocalPosition=function(t,e,n){return x.sceneGraphService.setLocalPosition(this,ai(t,e=void 0===e?0:e,n=void 0===n?0:n)),this},e.translate=function(t,e,n){return x.sceneGraphService.translate(this,ai(t,e=void 0===e?0:e,n=void 0===n?0:n)),this},e.translateLocal=function(t,e,n){return x.sceneGraphService.translateLocal(this,ai(t,e=void 0===e?0:e,n=void 0===n?0:n)),this},e.getPosition=function(){return x.sceneGraphService.getPosition(this)},e.getLocalPosition=function(){return x.sceneGraphService.getLocalPosition(this)},e.scale=function(t,e,n){return this.scaleLocal(t,e,n)},e.scaleLocal=function(t,e,n){return"number"==typeof t&&(t=ai(t,e=e||t,n=n||t)),x.sceneGraphService.scaleLocal(this,t),this},e.setLocalScale=function(t,e,n){return"number"==typeof t&&(t=ai(t,e=e||t,n=n||t)),x.sceneGraphService.setLocalScale(this,t),this},e.getLocalScale=function(){return x.sceneGraphService.getLocalScale(this)},e.getScale=function(){return x.sceneGraphService.getScale(this)},e.getEulerAngles=function(){return si(li(It(),x.sceneGraphService.getWorldTransform(this))[2])},e.getLocalEulerAngles=function(){return si(li(It(),x.sceneGraphService.getLocalRotation(this))[2])},e.setEulerAngles=function(t){return x.sceneGraphService.setEulerAngles(this,0,0,t),this},e.setLocalEulerAngles=function(t){return x.sceneGraphService.setLocalEulerAngles(this,0,0,t),this},e.rotateLocal=function(t,e,n){return p(e)&&p(n)?x.sceneGraphService.rotateLocal(this,0,0,t):x.sceneGraphService.rotateLocal(this,t,e,n),this},e.rotate=function(t,e,n){return p(e)&&p(n)?x.sceneGraphService.rotate(this,0,0,t):x.sceneGraphService.rotate(this,t,e,n),this},e.setRotation=function(t,e,n,r){return x.sceneGraphService.setRotation(this,t,e,n,r),this},e.setLocalRotation=function(t,e,n,r){return x.sceneGraphService.setLocalRotation(this,t,e,n,r),this},e.setLocalSkew=function(t,e){return x.sceneGraphService.setLocalSkew(this,t,e),this},e.getRotation=function(){return x.sceneGraphService.getRotation(this)},e.getLocalRotation=function(){return x.sceneGraphService.getLocalRotation(this)},e.getLocalSkew=function(){return x.sceneGraphService.getLocalSkew(this)},e.getLocalTransform=function(){return x.sceneGraphService.getLocalTransform(this)},e.getWorldTransform=function(){return x.sceneGraphService.getWorldTransform(this)},e.setLocalTransform=function(t){return x.sceneGraphService.setLocalTransform(this,t),this},e.resetLocalTransform=function(){x.sceneGraphService.resetLocalTransform(this)},e.getAnimations=function(){return this.activeAnimations},e.animate=function(t,e){var n=null==(n=this.ownerDocument)?void 0:n.timeline;return n?n.play(this,t,e):null},e.isVisible=function(){var t;return"visible"===(null==(t=this.parsedStyle)?void 0:t.visibility)},e.isInteractive=function(){var t;return"none"!==(null==(t=this.parsedStyle)?void 0:t.pointerEvents)},e.isCulled=function(){return!(!this.cullable||!this.cullable.enable||this.cullable.visible)},e.toFront=function(){return this.parentNode&&(this.style.zIndex=Math.max.apply(Math,this.parentNode.children.map(function(t){return Number(t.style.zIndex)}))+1),this},e.toBack=function(){return this.parentNode&&(this.style.zIndex=Math.min.apply(Math,this.parentNode.children.map(function(t){return Number(t.style.zIndex)}))-1),this},e.getConfig=function(){return this.config},e.attr=function(){for(var e=this,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=n[0],a=n[1];return i?ze(i)?(Object.keys(i).forEach(function(t){e.setAttribute(t,i[t])}),this):2===n.length?(this.setAttribute(i,a),this):this.attributes[i]:this.attributes},e.getMatrix=function(t){var t=t||this.getWorldTransform(),e=_t(It(),t),n=e[0],e=e[1],r=Et(It(),t),i=r[0],r=r[1],t=St(Qt(),t),t=li(It(),t),a=t[0],t=t[2];return ci(a||t,n,e,i,r)},e.getLocalMatrix=function(){return this.getMatrix(this.getLocalTransform())},e.setMatrix=function(t){var t=ui(t),e=t[0],n=t[1],r=t[2],i=t[3],t=t[4];this.setEulerAngles(t).setPosition(e,n).setLocalScale(r,i)},e.setLocalMatrix=function(t){var t=ui(t),e=t[0],n=t[1],r=t[2],i=t[3],t=t[4];this.setLocalEulerAngles(t).setLocalPosition(e,n).setLocalScale(r,i)},e.show=function(){x.enableCSSParsing?this.style.visibility="visible":this.forEach(function(t){t.style.visibility="visible"})},e.hide=function(){x.enableCSSParsing?this.style.visibility="hidden":this.forEach(function(t){t.style.visibility="hidden"})},e.getCount=function(){return this.childElementCount},e.getParent=function(){return this.parentElement},e.getChildren=function(){return this.children},e.getFirst=function(){return this.firstElementChild},e.getLast=function(){return this.lastElementChild},e.getChildByIndex=function(t){return this.children[t]||null},e.add=function(t,e){return this.appendChild(t,e)},e.setClip=function(t){this.style.clipPath=t},e.set=function(t,e){this.config[t]=e},e.get=function(t){return this.config[t]},e.moveTo=function(t,e,n){return this.setPosition(t,e=void 0===e?0:e,n=void 0===n?0:n),this},e.move=function(t,e,n){return this.setPosition(t,e=void 0===e?0:e,n=void 0===n?0:n),this},e.setZIndex=function(t){return this.style.zIndex=t,this},xr(t,[{key:"interactive",get:function(){return this.isInteractive()},set:function(t){this.style.pointerEvents=t?"auto":"none"}}]),t}(Wo),Zo={absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new ko(0,0,0,0)},Qo=[{n:"display",k:["none"]},{n:"opacity",int:!0,inh:!0,d:"1",syntax:o.OPACITY_VALUE},{n:"fillOpacity",int:!0,inh:!0,d:"1",syntax:o.OPACITY_VALUE},{n:"strokeOpacity",int:!0,inh:!0,d:"1",syntax:o.OPACITY_VALUE},{n:"fill",int:!0,k:["none"],d:"none",syntax:o.PAINT},{n:"fillRule",k:["nonzero","evenodd"],d:"nonzero"},{n:"stroke",int:!0,k:["none"],d:"none",syntax:o.PAINT,l:!0},{n:"shadowType",k:["inner","outer","both"],d:"outer",l:!0},{n:"shadowColor",int:!0,syntax:o.COLOR},{n:"shadowOffsetX",int:!0,l:!0,d:"0",syntax:o.LENGTH_PERCENTAGE},{n:"shadowOffsetY",int:!0,l:!0,d:"0",syntax:o.LENGTH_PERCENTAGE},{n:"shadowBlur",int:!0,l:!0,d:"0",syntax:o.SHADOW_BLUR},{n:"lineWidth",int:!0,inh:!0,d:"1",l:!0,a:["strokeWidth"],syntax:o.LENGTH_PERCENTAGE},{n:"increasedLineWidthForHitTesting",inh:!0,d:"0",l:!0,syntax:o.LENGTH_PERCENTAGE},{n:"lineJoin",inh:!0,l:!0,a:["strokeLinejoin"],k:["miter","bevel","round"],d:"miter"},{n:"lineCap",inh:!0,l:!0,a:["strokeLinecap"],k:["butt","round","square"],d:"butt"},{n:"lineDash",int:!0,inh:!0,k:["none"],a:["strokeDasharray"],syntax:o.LENGTH_PERCENTAGE_12},{n:"lineDashOffset",int:!0,inh:!0,d:"0",a:["strokeDashoffset"],syntax:o.LENGTH_PERCENTAGE},{n:"offsetPath",syntax:o.DEFINED_PATH},{n:"offsetDistance",int:!0,syntax:o.OFFSET_DISTANCE},{n:"dx",int:!0,l:!0,d:"0",syntax:o.LENGTH_PERCENTAGE},{n:"dy",int:!0,l:!0,d:"0",syntax:o.LENGTH_PERCENTAGE},{n:"zIndex",ind:!0,int:!0,d:"0",k:["auto"],syntax:o.Z_INDEX},{n:"visibility",k:["visible","hidden"],ind:!0,inh:!0,int:!0,d:"visible"},{n:"pointerEvents",inh:!0,k:["none","auto","stroke","fill","painted","visible","visiblestroke","visiblefill","visiblepainted","all"],d:"auto"},{n:"filter",ind:!0,l:!0,k:["none"],d:"none",syntax:o.FILTER},{n:"clipPath",syntax:o.DEFINED_PATH},{n:"textPath",syntax:o.DEFINED_PATH},{n:"textPathSide",k:["left","right"],d:"left"},{n:"textPathStartOffset",l:!0,d:"0",syntax:o.LENGTH_PERCENTAGE},{n:"transform",p:100,int:!0,k:["none"],d:"none",syntax:o.TRANSFORM},{n:"transformOrigin",p:100,d:function(t){return t===b.CIRCLE||t===b.ELLIPSE?"center":t===b.TEXT?"text-anchor":"left top"},l:!0,syntax:o.TRANSFORM_ORIGIN},{n:"anchor",p:99,d:function(t){return t===b.CIRCLE||t===b.ELLIPSE?"0.5 0.5":"0 0"},l:!0,syntax:o.LENGTH_PERCENTAGE_12},{n:"cx",int:!0,d:"0",syntax:o.COORDINATE},{n:"cy",int:!0,d:"0",syntax:o.COORDINATE},{n:"cz",int:!0,d:"0",syntax:o.COORDINATE},{n:"r",int:!0,l:!0,d:"0",syntax:o.LENGTH_PERCENTAGE},{n:"rx",int:!0,l:!0,d:"0",syntax:o.LENGTH_PERCENTAGE},{n:"ry",int:!0,l:!0,d:"0",syntax:o.LENGTH_PERCENTAGE},{n:"x",int:!0,d:"0",syntax:o.COORDINATE},{n:"y",int:!0,d:"0",syntax:o.COORDINATE},{n:"z",int:!0,d:"0",syntax:o.COORDINATE},{n:"width",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:o.LENGTH_PERCENTAGE},{n:"height",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:o.LENGTH_PERCENTAGE},{n:"radius",int:!0,l:!0,d:"0",syntax:o.LENGTH_PERCENTAGE_14},{n:"x1",int:!0,l:!0,syntax:o.COORDINATE},{n:"y1",int:!0,l:!0,syntax:o.COORDINATE},{n:"z1",int:!0,l:!0,syntax:o.COORDINATE},{n:"x2",int:!0,l:!0,syntax:o.COORDINATE},{n:"y2",int:!0,l:!0,syntax:o.COORDINATE},{n:"z2",int:!0,l:!0,syntax:o.COORDINATE},{n:"path",int:!0,l:!0,d:"",a:["d"],syntax:o.PATH,p:50},{n:"points",int:!0,l:!0,syntax:o.LIST_OF_POINTS,p:50},{n:"text",l:!0,d:"",syntax:o.TEXT,p:50},{n:"textTransform",l:!0,inh:!0,k:["capitalize","uppercase","lowercase","none"],d:"none",syntax:o.TEXT_TRANSFORM,p:51},{n:"font",l:!0},{n:"fontSize",int:!0,inh:!0,d:"16px",l:!0,syntax:o.LENGTH_PERCENTAGE},{n:"fontFamily",l:!0,inh:!0,d:"sans-serif"},{n:"fontStyle",l:!0,inh:!0,k:["normal","italic","oblique"],d:"normal"},{n:"fontWeight",l:!0,inh:!0,k:["normal","bold","bolder","lighter"],d:"normal"},{n:"fontVariant",l:!0,inh:!0,k:["normal","small-caps"],d:"normal"},{n:"lineHeight",l:!0,syntax:o.LENGTH,int:!0,d:"0"},{n:"letterSpacing",l:!0,syntax:o.LENGTH,int:!0,d:"0"},{n:"miterLimit",l:!0,syntax:o.NUMBER,d:function(t){return t===b.PATH||t===b.POLYGON||t===b.POLYLINE?"4":"10"}},{n:"wordWrap",l:!0},{n:"wordWrapWidth",l:!0},{n:"maxLines",l:!0},{n:"textOverflow",l:!0,d:"clip"},{n:"leading",l:!0},{n:"textBaseline",l:!0,inh:!0,k:["top","hanging","middle","alphabetic","ideographic","bottom"],d:"alphabetic"},{n:"textAlign",l:!0,inh:!0,k:["start","center","middle","end","left","right"],d:"start"},{n:"markerStart",syntax:o.MARKER},{n:"markerEnd",syntax:o.MARKER},{n:"markerMid",syntax:o.MARKER},{n:"markerStartOffset",syntax:o.LENGTH,l:!0,int:!0,d:"0"},{n:"markerEndOffset",syntax:o.LENGTH,l:!0,int:!0,d:"0"}],Jo=Qo.filter(function(t){return!!t.l}).map(function(t){return t.n}),ts={},es=new WeakMap,Po=function(){function t(){var e=this;Qo.forEach(function(t){e.registerMetadata(t)})}var e=t.prototype;return e.registerMetadata=function(e){[e.n].concat(e.a||[]).forEach(function(t){ts[t]=e})},e.unregisterMetadata=function(t){delete ts[t]},e.getPropertySyntax=function(t){return x.CSSPropertySyntaxFactory[t]},e.processProperties=function(n,e,t){var r=this;if(void 0===t&&(t={skipUpdateAttribute:!1,skipParse:!1,forceUpdateGeometry:!1,usedAttributes:[]}),x.enableCSSParsing){var i=t,a=i.skipUpdateAttribute,o=i.skipParse,s=i.forceUpdateGeometry,i=i.usedAttributes,l=s,c=Object.keys(e);c.forEach(function(t){a||(n.attributes[t]=e[t]),!l&&null!=(t=ts[t])&&t.l&&(l=!0)}),o||c.forEach(function(t){n.computedStyle[t]=r.parseProperty(t,n.attributes[t],n)}),(c=null!=i&&i.length?Array.from(new Set(c.concat(i))):c).forEach(function(t){t in n.computedStyle&&(n.parsedStyle[t]=r.computeProperty(t,n.computedStyle[t],n))}),l&&this.updateGeometry(n),c.forEach(function(t){t in n.parsedStyle&&r.postProcessProperty(t,n,c)}),x.enableCSSParsing&&n.children.length&&c.forEach(function(e){e in n.parsedStyle&&r.isPropertyInheritable(e)&&n.children.forEach(function(t){t.internalSetAttribute(e,null,{skipUpdateAttribute:!0,skipParse:!0})})})}else{Object.assign(n.attributes,e);var s=Object.keys(e),o=n.parsedStyle.clipPath,i=n.parsedStyle.offsetPath,u=(n.parsedStyle=Object.assign(n.parsedStyle,e),!!t.forceUpdateGeometry);if(!u)for(var f=0;f<Jo.length;f++)if(Jo[f]in e){u=!0;break}e.fill&&(n.parsedStyle.fill=ba(e.fill)),e.stroke&&(n.parsedStyle.stroke=ba(e.stroke)),e.shadowColor&&(n.parsedStyle.shadowColor=ba(e.shadowColor)),e.filter&&(n.parsedStyle.filter=ja(e.filter)),p(e.radius)||(n.parsedStyle.radius=Ea(e.radius,4)),p(e.lineDash)||(n.parsedStyle.lineDash=Ea(e.lineDash,2)),e.points&&(n.parsedStyle.points=Wa(e.points,n)),""===e.path&&(n.parsedStyle.path=wr({},Zo)),e.path&&(n.parsedStyle.path=Da(e.path,n)),e.textTransform&&x.CSSPropertySyntaxFactory["<text-transform>"].calculator(null,null,{value:e.textTransform},n,null),e.clipPath&&x.CSSPropertySyntaxFactory["<defined-path>"].calculator("clipPath",o,e.clipPath,n,this),e.offsetPath&&x.CSSPropertySyntaxFactory["<defined-path>"].calculator("offsetPath",i,e.offsetPath,n,this),e.anchor&&(n.parsedStyle.anchor=Ea(e.anchor,2)),e.transform&&(n.parsedStyle.transform=$a(e.transform)),e.transformOrigin&&(n.parsedStyle.transformOrigin=ao(e.transformOrigin)),e.markerStart&&(n.parsedStyle.markerStart=x.CSSPropertySyntaxFactory["<marker>"].calculator(null,e.markerStart,e.markerStart,null,null)),e.markerEnd&&(n.parsedStyle.markerEnd=x.CSSPropertySyntaxFactory["<marker>"].calculator(null,e.markerEnd,e.markerEnd,null,null)),e.markerMid&&(n.parsedStyle.markerMid=x.CSSPropertySyntaxFactory["<marker>"].calculator("",e.markerMid,e.markerMid,null,null)),(n.nodeName!==b.CIRCLE&&n.nodeName!==b.ELLIPSE||p(e.cx)&&p(e.cy))&&(n.nodeName!==b.RECT&&n.nodeName!==b.IMAGE&&n.nodeName!==b.GROUP&&n.nodeName!==b.HTML&&n.nodeName!==b.TEXT&&n.nodeName!==b.MESH||p(e.x)&&p(e.y)&&p(e.z))&&(n.nodeName!==b.LINE||p(e.x1)&&p(e.y1)&&p(e.z1)&&p(e.x2)&&p(e.y2)&&p(e.z2))||x.CSSPropertySyntaxFactory["<coordinate>"].postProcessor(n,s),p(e.zIndex)||x.CSSPropertySyntaxFactory["<z-index>"].postProcessor(n,s),e.path&&x.CSSPropertySyntaxFactory["<path>"].postProcessor(n,s),e.points&&x.CSSPropertySyntaxFactory["<list-of-points>"].postProcessor(n,s),p(e.offsetDistance)||x.CSSPropertySyntaxFactory["<offset-distance>"].postProcessor(n,s),e.transform&&x.CSSPropertySyntaxFactory["<transform>"].postProcessor(n,s),u&&this.updateGeometry(n)}},e.parseProperty=function(t,e,n){var r,t=ts[t],i=e;return"unset"===(e=""!==e&&!p(e)?e:"unset")||"initial"===e||"inherit"===e?i=zr(e):t&&(r=t.k,t=(t=t.syntax)&&this.getPropertySyntax(t),r&&-1<r.indexOf(e)?i=zr(e):t&&t.parser&&(i=t.parser(e,n))),i},e.computeProperty=function(t,e,n){var r=ts[t],i="g-root"===n.id,a=e;if(r){var o=r.syntax,s=r.inh,r=r.d;if(e instanceof Pr){var l=e.value;if("initial"===(l="unset"===l?s&&!i?"inherit":"initial":l))p(r)||(e=this.parseProperty(t,Br(r)?r(n.nodeName):r,n));else if("inherit"===l)return s=this.tryToResolveProperty(n,t,{inherited:!0}),p(s)?void this.addUnresolveProperty(n,t):s}i=o&&this.getPropertySyntax(o);a=i&&i.calculator?(r=n.parsedStyle[t],i.calculator(t,r,e,n,this)):e instanceof Pr?e.value:e}return a},e.postProcessProperty=function(t,e,n){var t=ts[t];t&&t.syntax&&(t=t.syntax&&this.getPropertySyntax(t.syntax))&&t.postProcessor&&t.postProcessor(e,n)},e.addUnresolveProperty=function(t,e){var n=es.get(t);n||(es.set(t,[]),n=es.get(t)),-1===n.indexOf(e)&&n.push(e)},e.tryToResolveProperty=function(t,e,n){var n=(n=void 0===n?{}:n).inherited;if(n&&(t.parentElement&&function(t,e){t=es.get(t);return!t||0===t.length||t.includes(e)}(t.parentElement,e)))return"unset"===(n=t.parentElement.parsedStyle[e])||"initial"===n||"inherit"===n?void 0:n},e.recalc=function(e){var n,t=es.get(e);t&&t.length&&(n={},t.forEach(function(t){n[t]=e.attributes[t]}),this.processProperties(e,n),es.delete(e))},e.updateGeometry=function(t){var s,e,n,r,i,a,o,l,c,u,f,h,d,p,g,m=t.nodeName,y=x.geometryUpdaterFactory[m];y&&((s=t.geometry).contentBounds||(s.contentBounds=new xo),s.renderBounds||(s.renderBounds=new xo),e=t.parsedStyle,n=(y=y.update(e,t)).width,r=y.height,f=void 0===(f=y.depth)?0:f,u=void 0===(u=y.offsetX)?0:u,p=void 0===(p=y.offsetY)?0:p,y=void 0===(y=y.offsetZ)?0:y,f=[Math.abs(n)/2,Math.abs(r)/2,f/2],l=e.stroke,c=e.lineWidth,g=e.increasedLineWidthForHitTesting,d=e.shadowType,h=e.shadowColor,i=void 0===(i=e.filter)?[]:i,a=e.transformOrigin,o=e.anchor,m===b.TEXT?delete e.anchor:m===b.MESH&&(e.anchor[2]=.5),u=[(1-2*(o&&o[0]||0))*n/2+u,(1-2*(o&&o[1]||0))*r/2+p,(1-2*(o&&o[2]||0))*f[2]+y],s.contentBounds.update(u,f),p=m===b.POLYLINE||m===b.POLYGON||m===b.PATH?Math.SQRT2:.5,l&&!l.isNone&&(f[0]+=y=((c||0)+(g||0))*p,f[1]+=y),s.renderBounds.update(u,f),h&&d&&"inner"!==d&&(l=(m=s.renderBounds).min,c=m.max,g=e.shadowBlur||0,p=e.shadowOffsetX||0,y=e.shadowOffsetY||0,u=l[0]-g+p,f=c[0]+g+p,h=l[1]-g+y,d=c[1]+g+y,l[0]=Math.min(l[0],u),c[0]=Math.max(c[0],f),l[1]=Math.min(l[1],h),c[1]=Math.max(c[1],d),s.renderBounds.setMinMax(l,c)),i.forEach(function(t){var e,n,r,i,a,o=t.name,t=t.params;"blur"===o?(i=t[0].value,s.renderBounds.update(s.renderBounds.center,ni(s.renderBounds.halfExtents,s.renderBounds.halfExtents,[i,i,0]))):"drop-shadow"===o&&(i=t[0].value,o=t[1].value,t=t[2].value,e=(n=s.renderBounds).min,n=n.max,r=e[0]-t+i,i=n[0]+t+i,a=e[1]-t+o,t=n[1]+t+o,e[0]=Math.min(e[0],r),n[0]=Math.max(n[0],i),e[1]=Math.min(e[1],a),n[1]=Math.max(n[1],t),s.renderBounds.setMinMax(e,n))}),o=e.anchor,m=r<0,g=((p=n<0)?-1:1)*(a?Aa(a[0],0,t):0),y=(m?-1:1)*(a?Aa(a[1],1,t):0),g-=(p?-1:1)*(o&&o[0]||0)*s.contentBounds.halfExtents[0]*2,y-=(m?-1:1)*(o&&o[1]||0)*s.contentBounds.halfExtents[1]*2,t.setOrigin(g,y),x.sceneGraphService.dirtifyToRoot(t))},e.isPropertyInheritable=function(t){t=ts[t];return!!t&&t.inh},t}();(Ro=Go=Go||{})[Ro.ORBITING=0]="ORBITING",Ro[Ro.EXPLORING=1]="EXPLORING",Ro[Ro.TRACKING=2]="TRACKING",(Wo=qo=qo||{})[Wo.DEFAULT=0]="DEFAULT",Wo[Wo.ROTATIONAL=1]="ROTATIONAL",Wo[Wo.TRANSLATIONAL=2]="TRANSLATIONAL",Wo[Wo.CINEMATIC=3]="CINEMATIC",(Ro=Ho=Ho||{})[Ro.ORTHOGRAPHIC=0]="ORTHOGRAPHIC",Ro[Ro.PERSPECTIVE=1]="PERSPECTIVE";var ns="updated",Wo=function(){function t(){this.canvas=void 0,this.eventEmitter=new vr,this.matrix=tt(),this.right=Ft(1,0,0),this.up=Ft(0,1,0),this.forward=Ft(0,0,1),this.position=Ft(0,0,1),this.focalPoint=Ft(0,0,0),this.distanceVector=Ft(0,0,-1),this.distance=1,this.azimuth=0,this.elevation=0,this.roll=0,this.relAzimuth=0,this.relElevation=0,this.relRoll=0,this.dollyingStep=0,this.maxDistance=1/0,this.minDistance=-1/0,this.zoom=1,this.rotateWorld=!1,this.fov=30,this.near=.1,this.far=1e3,this.aspect=1,this.left=void 0,this.rright=void 0,this.top=void 0,this.bottom=void 0,this.projectionMatrix=tt(),this.projectionMatrixInverse=tt(),this.jitteredProjectionMatrix=void 0,this.view=void 0,this.enableUpdate=!0,this.type=Go.EXPLORING,this.trackingMode=qo.DEFAULT,this.projectionMode=Ho.PERSPECTIVE,this.frustum=new Mo,this.orthoMatrix=tt()}var e=t.prototype;return e.isOrtho=function(){return this.projectionMode===Ho.ORTHOGRAPHIC},e.getProjectionMode=function(){return this.projectionMode},e.getPerspective=function(){return this.jitteredProjectionMatrix||this.projectionMatrix},e.getPerspectiveInverse=function(){return this.projectionMatrixInverse},e.getFrustum=function(){return this.frustum},e.getPosition=function(){return this.position},e.getFocalPoint=function(){return this.focalPoint},e.getDollyingStep=function(){return this.dollyingStep},e.getNear=function(){return this.near},e.getFar=function(){return this.far},e.getZoom=function(){return this.zoom},e.getOrthoMatrix=function(){return this.orthoMatrix},e.getView=function(){return this.view},e.setEnableUpdate=function(t){this.enableUpdate=t},e.setType=function(t,e){return this.type=t,this.type===Go.EXPLORING?this.setWorldRotation(!0):this.setWorldRotation(!1),this._getAngles(),this.type===Go.TRACKING&&void 0!==e&&this.setTrackingMode(e),this},e.setProjectionMode=function(t){return this.projectionMode=t,this},e.setTrackingMode=function(t){if(this.type!==Go.TRACKING)throw new Error("Impossible to set a tracking mode if the camera is not of tracking type");return this.trackingMode=t,this},e.setWorldRotation=function(t){return this.rotateWorld=t,this._getAngles(),this},e.getViewTransform=function(){return mt(tt(),this.matrix)},e.getWorldTransform=function(){return this.matrix},e.jitterProjectionMatrix=function(t,e){t=Ot(tt(),[t,e,0]);this.jitteredProjectionMatrix=vt(tt(),t,this.projectionMatrix)},e.clearJitterProjectionMatrix=function(){this.jitteredProjectionMatrix=void 0},e.setMatrix=function(t){return this.matrix=t,this._update(),this},e.setFov=function(t){return this.setPerspective(this.near,this.far,t,this.aspect),this},e.setAspect=function(t){return this.setPerspective(this.near,this.far,this.fov,t),this},e.setNear=function(t){return this.projectionMode===Ho.PERSPECTIVE?this.setPerspective(t,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,t,this.far),this},e.setFar=function(t){return this.projectionMode===Ho.PERSPECTIVE?this.setPerspective(this.near,t,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,t),this},e.setViewOffset=function(t,e,n,r,i,a){return this.aspect=t/e,void 0===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=a,this.projectionMode===Ho.PERSPECTIVE?this.setPerspective(this.near,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far),this},e.clearViewOffset=function(){return void 0!==this.view&&(this.view.enabled=!1),this.projectionMode===Ho.PERSPECTIVE?this.setPerspective(this.near,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far),this},e.setZoom=function(t){return this.zoom=t,this.projectionMode===Ho.ORTHOGRAPHIC?this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far):this.projectionMode===Ho.PERSPECTIVE&&this.setPerspective(this.near,this.far,this.fov,this.aspect),this},e.setZoomByViewportPoint=function(t,e){var n=this.canvas.viewport2Canvas({x:e[0],y:e[1]}),r=n.x,n=n.y,i=this.roll,t=(this.rotate(0,0,-i),this.setPosition(r,n),this.setFocalPoint(r,n),this.setZoom(t),this.rotate(0,0,i),this.canvas.viewport2Canvas({x:e[0],y:e[1]})),i=Ft(t.x-r,t.y-n,0),e=Ht(i,this.right)/Bt(this.right),r=Ht(i,this.up)/Bt(this.up);return this.pan(-e,-r),this},e.setPerspective=function(t,e,n,r){this.projectionMode=Ho.PERSPECTIVE,this.fov=n,this.near=t,this.far=e,this.aspect=r;var i,a,o,s,n=this.near*Math.tan(oi(.5*this.fov))/this.zoom,e=2*n,r=this.aspect*e,l=-.5*r;return null!=(i=this.view)&&i.enabled&&(i=this.view.fullWidth,a=this.view.fullHeight,l+=this.view.offsetX*r/i,n-=this.view.offsetY*e/a,r*=this.view.width/i,e*=this.view.height/a),i=this.projectionMatrix,l=(a=l)+r,n=(r=n)-e,e=this.far,o=2*t/(r-n),s=(l+a)/(l-a),r=(r+n)/(r-n),n=-(e+t)/(e-t),e=-2*e*t/(e-t),i[0]=2*t/(l-a),i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=o,i[6]=0,i[7]=0,i[8]=s,i[9]=r,i[10]=n,i[11]=-1,i[12]=0,i[13]=0,i[14]=e,i[15]=0,xt(this.projectionMatrix,this.projectionMatrix,Ft(1,-1,1)),mt(this.projectionMatrixInverse,this.projectionMatrix),this.triggerUpdate(),this},e.setOrthographic=function(t,e,n,r,i,a){this.projectionMode=Ho.ORTHOGRAPHIC,this.rright=e,this.left=t,this.top=n,this.bottom=r,this.near=i,this.far=a;var o,e=(this.rright-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.rright+this.left)/2,r=(this.top+this.bottom)/2,s=n-e,n=n+e,e=r+t,r=r-t;return null!=(t=this.view)&&t.enabled&&(t=(this.rright-this.left)/this.view.fullWidth/this.zoom,o=(this.top-this.bottom)/this.view.fullHeight/this.zoom,n=(s+=t*this.view.offsetX)+t*this.view.width,r=(e-=o*this.view.offsetY)-o*this.view.height),Nt(this.projectionMatrix,s,n,r,e,i,a),xt(this.projectionMatrix,this.projectionMatrix,Ft(1,-1,1)),mt(this.projectionMatrixInverse,this.projectionMatrix),this._getOrthoMatrix(),this.triggerUpdate(),this},e.setPosition=function(t,e,n){t=ai(t,e=void 0===e?this.position[1]:e,n=void 0===n?this.position[2]:n);return this._setPosition(t),this.setFocalPoint(this.focalPoint),this.triggerUpdate(),this},e.setFocalPoint=function(t,e,n){void 0===e&&(e=this.focalPoint[1]),void 0===n&&(n=this.focalPoint[2]);var r,i=Ft(0,1,0);return this.focalPoint=ai(t,e,n),this.trackingMode===qo.CINEMATIC&&(t=(r=Gt(It(),this.focalPoint,this.position))[0],e=r[1],n=r[2],r=Bt(r),e=si(Math.asin(e/r)),r=90+si(Math.atan2(n,t)),Mt(n=tt(),n,oi(r)),wt(n,n,oi(e)),i=Yt(It(),[0,1,0],n)),mt(this.matrix,Pt(tt(),this.position,this.focalPoint,i)),this._getAxes(),this._getDistance(),this._getAngles(),this.triggerUpdate(),this},e.getDistance=function(){return this.distance},e.getDistanceVector=function(){return this.distanceVector},e.setDistance=function(t){var e,n,r;return this.distance===t||t<0||(this.distance=t,this.distance<2e-4&&(this.distance=2e-4),this.dollyingStep=this.distance/100,e=It(),t=this.distance,n=this.forward,r=this.focalPoint,e[0]=t*n[0]+r[0],e[1]=t*n[1]+r[1],e[2]=t*n[2]+r[2],this._setPosition(e),this.triggerUpdate()),this},e.setMaxDistance=function(t){return this.maxDistance=t,this},e.setMinDistance=function(t){return this.minDistance=t,this},e.setAzimuth=function(t){return this.azimuth=ii(t),this.computeMatrix(),this._getAxes(),this.type===Go.ORBITING||this.type===Go.EXPLORING?this._getPosition():this.type===Go.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},e.getAzimuth=function(){return this.azimuth},e.setElevation=function(t){return this.elevation=ii(t),this.computeMatrix(),this._getAxes(),this.type===Go.ORBITING||this.type===Go.EXPLORING?this._getPosition():this.type===Go.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},e.getElevation=function(){return this.elevation},e.setRoll=function(t){return this.roll=ii(t),this.computeMatrix(),this._getAxes(),this.type===Go.ORBITING||this.type===Go.EXPLORING?this._getPosition():this.type===Go.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},e.getRoll=function(){return this.roll},e._update=function(){this._getAxes(),this._getPosition(),this._getDistance(),this._getAngles(),this._getOrthoMatrix(),this.triggerUpdate()},e.computeMatrix=function(){var t=Jt(Qt(),[0,0,1],oi(this.roll)),e=(pt(this.matrix),Jt(Qt(),[1,0,0],oi((this.rotateWorld&&this.type!==Go.TRACKING||this.type===Go.TRACKING?1:-1)*this.elevation))),n=Jt(Qt(),[0,1,0],oi((this.rotateWorld&&this.type!==Go.TRACKING||this.type===Go.TRACKING?1:-1)*this.azimuth)),n=te(Qt(),n,e),n=te(Qt(),n,t),e=Lt(tt(),n);this.type===Go.ORBITING||this.type===Go.EXPLORING?(bt(this.matrix,this.matrix,this.focalPoint),vt(this.matrix,this.matrix,e),bt(this.matrix,this.matrix,[0,0,this.distance])):this.type===Go.TRACKING&&(bt(this.matrix,this.matrix,this.position),vt(this.matrix,this.matrix,e))},e._setPosition=function(t,e,n){this.position=ai(t,e,n);t=this.matrix;t[12]=this.position[0],t[13]=this.position[1],t[14]=this.position[2],t[15]=1,this._getOrthoMatrix()},e._getAxes=function(){Dt(this.right,ai(Zt(Xt(),[1,0,0,0],this.matrix))),Dt(this.up,ai(Zt(Xt(),[0,1,0,0],this.matrix))),Dt(this.forward,ai(Zt(Xt(),[0,0,1,0],this.matrix))),qt(this.right,this.right),qt(this.up,this.up),qt(this.forward,this.forward)},e._getAngles=function(){var t=this.distanceVector[0],e=this.distanceVector[1],n=this.distanceVector[2],r=Bt(this.distanceVector);0===r?(this.elevation=0,this.azimuth=0):this.type===Go.TRACKING||this.rotateWorld?(this.elevation=si(Math.asin(e/r)),this.azimuth=si(Math.atan2(-t,-n))):(this.elevation=-si(Math.asin(e/r)),this.azimuth=-si(Math.atan2(-t,-n)))},e._getPosition=function(){Dt(this.position,ai(Zt(Xt(),[0,0,0,1],this.matrix))),this._getDistance()},e._getFocalPoint=function(){var t,e;$t(this.distanceVector,[0,0,-this.distance],(t=Q(),e=this.matrix,t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t)),Wt(this.focalPoint,this.position,this.distanceVector),this._getDistance()},e._getDistance=function(){this.distanceVector=Gt(It(),this.focalPoint,this.position),this.distance=Bt(this.distanceVector),this.dollyingStep=this.distance/100},e._getOrthoMatrix=function(){var t,e;this.projectionMode===Ho.ORTHOGRAPHIC&&(t=this.position,e=Jt(Qt(),[0,0,1],-this.roll*Math.PI/180),At(this.orthoMatrix,e,Ft((this.rright-this.left)/2-t[0],(this.top-this.bottom)/2-t[1],0),Ft(this.zoom,this.zoom,1),t))},e.triggerUpdate=function(){var t;this.enableUpdate&&(t=this.getViewTransform(),t=vt(tt(),this.getPerspective(),t),this.getFrustum().extractFromVPMatrix(t),this.eventEmitter.emit(ns))},e.rotate=function(t,e,n){throw new Error(Jr)},e.pan=function(t,e){throw new Error(Jr)},e.dolly=function(t){throw new Error(Jr)},e.createLandmark=function(t,e){throw new Error(Jr)},e.gotoLandmark=function(t,e){throw new Error(Jr)},e.cancelLandmarkAnimation=function(){throw new Error(Jr)},t}(),Ro=function(){function t(){}return t.prototype.update=function(t,e){t=t.r;return{width:2*t,height:2*t}},t}(),rs=function(){function t(){}return t.prototype.update=function(t,e){return{width:2*t.rx,height:2*t.ry}},t}(),is=function(){function t(){}return t.prototype.update=function(t){var e=t.x1,n=t.y1,r=t.x2,t=t.y2,i=Math.min(e,r),e=Math.max(e,r),r=Math.min(n,t);return{width:e-i,height:Math.max(n,t)-r}},t}(),as=function(){function t(){}return t.prototype.update=function(t){t=t.path.rect;return{width:t.width,height:t.height}},t}(),os=function(){function t(){}return t.prototype.update=function(t){var t=t.points.points,e=Math.min.apply(Math,t.map(function(t){return t[0]})),n=Math.max.apply(Math,t.map(function(t){return t[0]})),r=Math.min.apply(Math,t.map(function(t){return t[1]}));return{width:n-e,height:Math.max.apply(Math,t.map(function(t){return t[1]}))-r}},t}(),a=function(){function t(){}return t.prototype.update=function(t,e){var n=t.img,r=t.width,i=t.height,r=void 0===r?0:r,i=void 0===i?0:i;return n&&!Ve(n)&&(r||(r=n.width,t.width=r),i||(i=n.height,t.height=i)),{width:r,height:i}},t}(),ss=function(){function t(t){this.globalRuntime=void 0,this.globalRuntime=t}var e=t.prototype;return e.isReadyToMeasure=function(t,e){var n=t.text,r=t.textAlign,i=t.textBaseline,a=t.fontSize,o=t.fontStyle,s=t.fontWeight,l=t.fontVariant,t=t.lineWidth;return n&&a&&o&&s&&l&&r&&i&&!p(t)},e.update=function(t,e){var n,r,i=t.text,a=t.textAlign,o=t.lineWidth,s=t.textBaseline,l=t.dx,c=t.dy,u=((null==e||null==(u=e.ownerDocument)||null==(u=u.defaultView)?void 0:u.getConfig())||{}).offscreenCanvas;return this.isReadyToMeasure(t,e)?(e=this.globalRuntime.textService.measureText(i,t,u),i=(t.metrics=e).width,u=e.height,n=e.lineHeight,e=e.fontProperties,i=[i/2,u/2,0],u=[0,1],r=0,"center"===a||"middle"===a?(r=o/2,u=[.5,1]):"right"!==a&&"end"!==a||(r=o,u=[1,1]),a=0,"middle"===s?a=i[1]:"top"===s||"hanging"===s?a=2*i[1]:"alphabetic"===s?a=x.enableCSSParsing?n-e.ascent:0:"bottom"!==s&&"ideographic"!==s||(a=0),l&&(r+=l),c&&(a+=c),t.anchor=[u[0],u[1],0],{width:2*i[0],height:2*i[1],offsetX:r,offsetY:a}):(t.metrics={font:"",width:0,height:0,lines:[],lineWidths:[],lineHeight:0,maxLineWidth:0,fontProperties:{ascent:0,descent:0,fontSize:0},lineMetrics:[]},{width:0,height:0,x:0,y:0,offsetX:0,offsetY:0})},t}(),ls=function(){function t(){this.canvas=void 0,this.context=void 0}var e=t.prototype;return e.getOrCreateCanvas=function(t,e){if(!this.canvas){if(t)this.canvas=t,this.context=this.canvas.getContext("2d",e);else try{this.canvas=new window.OffscreenCanvas(0,0),this.context=this.canvas.getContext("2d",e),this.context&&this.context.measureText||(this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"))}catch(t){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d",e)}this.canvas.width=10,this.canvas.height=10}return this.canvas},e.getOrCreateContext=function(t,e){return this.context||this.getOrCreateCanvas(t,e),this.context},t}(),cs=(0,/\[\s*(.*)=(.*)\s*\]/),us=function(){function t(){}var e=t.prototype;return e.selectOne=function(e,n){var t,r,i,a=this;return e.startsWith(".")?n.find(function(t){return-1<((null==t?void 0:t.classList)||[]).indexOf(a.getIdOrClassname(e))}):e.startsWith("#")?n.find(function(t){return t.id===a.getIdOrClassname(e)}):e.startsWith("[")?(t=this.getAttribute(e),r=t.name,i=t.value,r?n.find(function(t){return n!==t&&("name"===r?t.name===i:a.attributeToString(t,r)===i)}):null):n.find(function(t){return n!==t&&t.nodeName===e})},e.selectAll=function(e,n){var t,r,i,a=this;return e.startsWith(".")?n.findAll(function(t){return n!==t&&-1<((null==t?void 0:t.classList)||[]).indexOf(a.getIdOrClassname(e))}):e.startsWith("#")?n.findAll(function(t){return n!==t&&t.id===a.getIdOrClassname(e)}):e.startsWith("[")?(t=this.getAttribute(e),r=t.name,i=t.value,r?n.findAll(function(t){return n!==t&&("name"===r?t.name===i:a.attributeToString(t,r)===i)}):[]):n.findAll(function(t){return n!==t&&t.nodeName===e})},e.is=function(t,e){var n,r;return t.startsWith(".")?e.className===this.getIdOrClassname(t):t.startsWith("#")?e.id===this.getIdOrClassname(t):t.startsWith("[")?(n=(r=this.getAttribute(t)).name,r=r.value,"name"===n?e.name===r:this.attributeToString(e,n)===r):e.nodeName===t},e.getIdOrClassname=function(t){return t.substring(1)},e.getAttribute=function(t){var t=t.match(cs),e="",n="";return t&&2<t.length&&(e=t[1].replace(/"/g,""),n=t[2].replace(/"/g,"")),{name:e,value:n}},e.attributeToString=function(t,e){return t.getAttribute&&(t=t.getAttribute(e),!p(t))&&t.toString?t.toString():""},t}();function fs(t){t=t.renderable;t&&(t.renderBoundsDirty=!0,t.boundsDirty=!0)}var hs=new Io(No.REPARENT,null,"","","",0,"",""),ds=function(){function t(t){var o,i,a,r,s,l,c,u,f,n,h,d,g=this;this.runtime=void 0,this.pendingEvents=[],this.boundsChangedEvent=new Co(No.BOUNDS_CHANGED),this.rotate=(o=Qt(),function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=Ft(e,n,r));var i,a,n=t.transformable;null!==t.parentNode&&t.parentNode.transformable?(ne(r=Qt(),e[0],e[1],e[2]),i=g.getRotation(t),a=g.getRotation(t.parentNode),ie(o,a),ee(o,o),te(r,o,r),te(n.localRotation,r,i),oe(n.localRotation,n.localRotation),g.dirtifyLocal(t,n)):g.rotateLocal(t,e)}),this.rotateLocal=(i=Qt(),function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=Ft(e,n,r));n=t.transformable;ne(i,e[0],e[1],e[2]),ae(n.localRotation,n.localRotation,i),g.dirtifyLocal(t,n)}),this.setEulerAngles=(a=Qt(),function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=Ft(e,n,r));n=t.transformable;null!==t.parentNode&&t.parentNode.transformable?(ne(n.localRotation,e[0],e[1],e[2]),r=g.getRotation(t.parentNode),ie(a,ee(Qt(),r)),ae(n.localRotation,n.localRotation,a),g.dirtifyLocal(t,n)):g.setLocalEulerAngles(t,e)}),this.translateLocal=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=Ft(e,n,r));var i,a,o,s,l,c,u,f,h,d,p,n=t.transformable;Ut(e,It())||(i=r=e,a=n.localRotation,o=a[0],s=a[1],l=a[2],a=a[3],c=i[0],u=i[1],i=i[2],p=s*(d=o*u-s*c)-l*(h=l*c-o*i),l=l*(f=s*i-l*u)-o*d,o=o*h-s*f,h*=s=2*a,d*=s,l*=2,o*=2,r[0]=c+(f*=s)+(p*=2),r[1]=u+h+l,r[2]=i+d+o,Wt(n.localPosition,n.localPosition,e),g.dirtifyLocal(t,n))},this.setPosition=(r=tt(),s=It(),function(t,e){var n=t.transformable;s[0]=e[0],s[1]=e[1],s[2]=e[2]||0,Ut(g.getPosition(t),s)||(Dt(n.position,s),null!==t.parentNode&&t.parentNode.transformable?(e=t.parentNode.transformable,et(r,e.worldTransform),mt(r,r),Yt(n.localPosition,s,r)):Dt(n.localPosition,s),g.dirtifyLocal(t,n))}),this.setLocalPosition=(l=It(),function(t,e){var n=t.transformable;l[0]=e[0],l[1]=e[1],l[2]=e[2]||0,Ut(n.localPosition,l)||(Dt(n.localPosition,l),g.dirtifyLocal(t,n))}),this.translate=(c=It(),u=It(),f=It(),function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),Ut(e="number"==typeof e?zt(u,e,n,r):e,c)||(Wt(f,g.getPosition(t),e),g.setPosition(t,f))}),this.setRotation=function(){var o=Qt();return function(t,e,n,r,i){var a=t.transformable;"number"==typeof e&&(e=re(e,n,r,i)),null!==t.parentNode&&t.parentNode.transformable?(n=g.getRotation(t.parentNode),ie(o,n),ee(o,o),te(a.localRotation,o,e),oe(a.localRotation,a.localRotation),g.dirtifyLocal(t,a)):g.setLocalRotation(t,e)}},this.displayObjectDependencyMap=new WeakMap,this.calcLocalTransform=(n=tt(),h=It(),d=re(0,0,0,1),function(t){var e;0!==t.localSkew[0]||0!==t.localSkew[1]?(At(t.localTransform,t.localRotation,t.localPosition,Ft(1,1,1),t.origin),0===t.localSkew[0]&&0===t.localSkew[1]||((e=pt(n))[4]=Math.tan(t.localSkew[0]),e[1]=Math.tan(t.localSkew[1]),vt(t.localTransform,t.localTransform,e)),e=At(n,d,h,t.localScale,t.origin),vt(t.localTransform,t.localTransform,e)):At(t.localTransform,t.localRotation,t.localPosition,t.localScale,t.origin)}),this.runtime=t}var e=t.prototype;return e.matches=function(t,e){return this.runtime.sceneGraphSelector.is(t,e)},e.querySelector=function(t,e){return this.runtime.sceneGraphSelector.selectOne(t,e)},e.querySelectorAll=function(t,e){return this.runtime.sceneGraphSelector.selectAll(t,e)},e.attach=function(t,e,n){var r=!1,n=(t.parentNode&&(r=t.parentNode!==e,this.detach(t)),t.parentNode=e,p(n)?t.parentNode.childNodes.push(t):t.parentNode.childNodes.splice(n,0,t),e.sortable),e=((null!=n&&null!=(e=n.sorted)&&e.length||null!=(e=t.style)&&e.zIndex)&&(-1===n.dirtyChildren.indexOf(t)&&n.dirtyChildren.push(t),n.dirty=!0,n.dirtyReason=fo.ADDED),t.transformable);e&&this.dirtifyWorld(t,e),e.frozen&&this.unfreezeParentToRoot(t),r&&t.dispatchEvent(hs)},e.detach=function(t){var e,n,r;t.parentNode&&(e=t.transformable,(null!=(n=t.parentNode.sortable)&&null!=(r=n.sorted)&&r.length||null!=(r=t.style)&&r.zIndex)&&(-1===n.dirtyChildren.indexOf(t)&&n.dirtyChildren.push(t),n.dirty=!0,n.dirtyReason=fo.REMOVED),-1<(r=t.parentNode.childNodes.indexOf(t))&&t.parentNode.childNodes.splice(r,1),e&&this.dirtifyWorld(t,e),t.parentNode=null)},e.getOrigin=function(t){return t.transformable.origin},e.setOrigin=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0);var i=t.transformable;(e="number"==typeof e?[e,n,r]:e)[0]===i.origin[0]&&e[1]===i.origin[1]&&e[2]===i.origin[2]||((n=i.origin)[0]=e[0],n[1]=e[1],n[2]=e[2]||0,this.dirtifyLocal(t,i))},e.setLocalEulerAngles=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=Ft(e,n,r));n=t.transformable;ne(n.localRotation,e[0],e[1],e[2]),this.dirtifyLocal(t,n)},e.scaleLocal=function(t,e){var n,r,i=t.transformable;n=i.localScale,r=i.localScale,e=Ft(e[0],e[1],e[2]||1),n[0]=r[0]*e[0],n[1]=r[1]*e[1],n[2]=r[2]*e[2],this.dirtifyLocal(t,i)},e.setLocalScale=function(t,e){var n=t.transformable,e=Ft(e[0],e[1],e[2]||n.localScale[2]);Ut(e,n.localScale)||(Dt(n.localScale,e),this.dirtifyLocal(t,n))},e.setLocalRotation=function(t,e,n,r,i){"number"==typeof e&&(e=re(e,n,r,i));n=t.transformable;ie(n.localRotation,e),this.dirtifyLocal(t,n)},e.setLocalSkew=function(t,e,n){"number"==typeof e&&(i=e,n=n,(r=new Z(2))[0]=i,r[1]=n,e=r);var r,i=t.transformable;n=i.localSkew,r=e,n[0]=r[0],n[1]=r[1],this.dirtifyLocal(t,i)},e.dirtifyLocal=function(t,e){e.localDirtyFlag||(e.localDirtyFlag=!0,e.dirtyFlag)||this.dirtifyWorld(t,e)},e.dirtifyWorld=function(t,e){e.dirtyFlag||this.unfreezeParentToRoot(t),this.dirtifyWorldInternal(t,e),this.dirtifyToRoot(t,!0)},e.triggerPendingEvents=function(){function r(t,e){t.isConnected&&!i.has(t.entity)&&(n.boundsChangedEvent.detail=e,(n.boundsChangedEvent.target=t).isMutationObserved?t.dispatchEvent(n.boundsChangedEvent):t.ownerDocument.defaultView.dispatchEvent(n.boundsChangedEvent,!0),i.add(t.entity))}var n=this,i=new Set;this.pendingEvents.forEach(function(t){var e=t[0],n=t[1];n.affectChildren?e.forEach(function(t){r(t,n)}):r(e,n)}),this.clearPendingEvents(),i.clear()},e.clearPendingEvents=function(){this.pendingEvents=[]},e.dirtifyToRoot=function(t,e){void 0===e&&(e=!1);var n=t;for(n.renderable&&(n.renderable.dirty=!0);n;)fs(n),n=n.parentNode;e&&t.forEach(function(t){fs(t)}),this.informDependentDisplayObjects(t),this.pendingEvents.push([t,{affectChildren:e}])},e.updateDisplayObjectDependency=function(t,e,n,r){var i;e&&e!==n&&(e=this.displayObjectDependencyMap.get(e))&&e[t]&&(i=e[t].indexOf(r),e[t].splice(i,1)),n&&((e=this.displayObjectDependencyMap.get(n))||(this.displayObjectDependencyMap.set(n,{}),e=this.displayObjectDependencyMap.get(n)),e[t]||(e[t]=[]),e[t].push(r))},e.informDependentDisplayObjects=function(t){var n=this,r=this.displayObjectDependencyMap.get(t);r&&Object.keys(r).forEach(function(e){r[e].forEach(function(t){n.dirtifyToRoot(t,!0),t.dispatchEvent(new Io(No.ATTR_MODIFIED,t,n,n,e,Io.MODIFICATION,n,n)),t.isCustomElement&&t.isConnected&&t.attributeChangedCallback&&t.attributeChangedCallback(e,n,n)})})},e.getPosition=function(t){var e=t.transformable;return _t(e.position,this.getWorldTransform(t,e))},e.getRotation=function(t){var e=t.transformable;return St(e.rotation,this.getWorldTransform(t,e))},e.getScale=function(t){var e=t.transformable;return Et(e.scaling,this.getWorldTransform(t,e))},e.getWorldTransform=function(t,e){return((e=void 0===e?t.transformable:e).localDirtyFlag||e.dirtyFlag)&&(t.parentNode&&t.parentNode.transformable&&this.getWorldTransform(t.parentNode),this.sync(t,e)),e.worldTransform},e.getLocalPosition=function(t){return t.transformable.localPosition},e.getLocalRotation=function(t){return t.transformable.localRotation},e.getLocalScale=function(t){return t.transformable.localScale},e.getLocalSkew=function(t){return t.transformable.localSkew},e.getLocalTransform=function(t){t=t.transformable;return t.localDirtyFlag&&(this.calcLocalTransform(t),t.localDirtyFlag=!1),t.localTransform},e.setLocalTransform=function(t,e){var n=_t(It(),e),r=St(Qt(),e),e=Et(It(),e);this.setLocalScale(t,e),this.setLocalPosition(t,n),this.setLocalRotation(t,r)},e.resetLocalTransform=function(t){this.setLocalScale(t,[1,1,1]),this.setLocalPosition(t,[0,0,0]),this.setLocalEulerAngles(t,[0,0,0]),this.setLocalSkew(t,[0,0])},e.getTransformedGeometryBounds=function(t,e,n){e=this.getGeometryBounds(t,e=void 0===e?!1:e);return xo.isEmpty(e)?null:((n=n||new xo).setFromTransformedAABB(e,this.getWorldTransform(t)),n)},e.getGeometryBounds=function(t,e){t=t.geometry;return((e=void 0===e?!1:e)?t.renderBounds:t.contentBounds||null)||new xo},e.getBounds=function(t,e){var n,r,i=this,a=(void 0===e&&(e=!1),t.renderable);return a.boundsDirty||e||!a.bounds?!a.renderBoundsDirty&&e&&a.renderBounds?a.renderBounds:(n=e?a.renderBounds:a.bounds,r=this.getTransformedGeometryBounds(t,e,n),t.childNodes.forEach(function(t){t=i.getBounds(t,e);t&&(r?r.add(t):(r=n||new xo).update(t.center,t.halfExtents))}),e&&(t=function(t){var e,n=t;do{if(null==(e=n.parsedStyle)?void 0:e.clipPath)return n}while(null!==(n=n.parentElement));return null}(t))&&(t=t.parsedStyle.clipPath.getBounds(e),r?t&&(r=t.intersection(r)):r=t),(r=r||new xo)&&(e?a.renderBounds=r:a.bounds=r),e?a.renderBoundsDirty=!1:a.boundsDirty=!1,r):a.bounds},e.getLocalBounds=function(t){if(t.parentNode){var e,n=tt(),r=(t.parentNode.transformable&&(n=mt(tt(),this.getWorldTransform(t.parentNode))),this.getBounds(t));if(!xo.isEmpty(r))return(e=new xo).setFromTransformedAABB(r,n),e}return this.getBounds(t)},e.getBoundingClientRect=function(t){var e,n,r,i=this.getGeometryBounds(t),i=(xo.isEmpty(i)||(r=new xo).setFromTransformedAABB(i,this.getWorldTransform(t)),null==(i=t.ownerDocument)||null==(t=i.defaultView)?void 0:t.getContextService().getBoundingClientRect());return r?(e=(t=r.getMin())[0],t=t[1],n=(r=r.getMax())[0],r=r[1],new ko(e+((null==i?void 0:i.left)||0),t+((null==i?void 0:i.top)||0),n-e,r-t)):new ko((null==i?void 0:i.left)||0,(null==i?void 0:i.top)||0,0,0)},e.dirtifyWorldInternal=function(t,e){var n=this;!e.dirtyFlag&&(e.dirtyFlag=!0,e.frozen=!1,t.childNodes.forEach(function(t){var e=t.transformable;e.dirtyFlag||n.dirtifyWorldInternal(t,e)}),e=t.renderable)&&(e.renderBoundsDirty=!0,e.boundsDirty=!0,e.dirty=!0)},e.syncHierarchy=function(t){var e=t.transformable;if(!e.frozen){e.frozen=!0,(e.localDirtyFlag||e.dirtyFlag)&&this.sync(t,e);for(var n=t.childNodes,r=0;r<n.length;r++)this.syncHierarchy(n[r])}},e.sync=function(t,e){var n;e.localDirtyFlag&&(this.calcLocalTransform(e),e.localDirtyFlag=!1),e.dirtyFlag&&(n=(t=t.parentNode)&&t.transformable,null!==t&&n?vt(e.worldTransform,n.worldTransform,e.localTransform):et(e.worldTransform,e.localTransform),e.dirtyFlag=!1)},e.unfreezeParentToRoot=function(t){for(var e=t.parentNode;e;){var n=e.transformable;n&&(n.frozen=!1),e=e.parentNode}},t}(),ps={MetricsString:"|ÉqÅ",BaselineSymbol:"M",BaselineMultiplier:1.4,HeightMultiplier:2,Newlines:[10,13],BreakingSpaces:[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288]},gs=/[a-zA-Z0-9\u00C0-\u00D6\u00D8-\u00f6\u00f8-\u00ff!"#$%&'()*+,-./:;]/,ms=new RegExp(/[!%),.:;?\]}¢°·'""†‡›℃∶、。〃〆〕〗〞﹚﹜!"%'),.:;?!]}~]/.source+"|"+/[!),.:;?\]}¢·–—'"•"、。〆〞〕〉》」︰︱︲︳﹐﹑﹒﹓﹔﹕﹖﹘﹚﹜!),.:;?︶︸︺︼︾﹀﹂﹗]|}、]/.source+"|"+/[)\]}〕〉》」』】〙〗〟'"⦆»ヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻‐゠–〜?!‼⁇⁈⁉・、:;,。.]/.source+"|"+/[!%),.:;?\]}¢°'"†‡℃〆〈《「『〕!%),.:;?]}]/.source),ys=new RegExp(/[$(£¥·'"〈《「『【〔〖〝﹙﹛$(.[{£¥]/.source+"|"+/[([{£¥'"‵〈《「『〔〝︴﹙﹛({︵︷︹︻︽︿﹁﹃﹏]/.source+"|"+/[([{〔〈《「『【〘〖〝'"⦅«—...‥〳〴〵]/.source+"|"+/[$([{£¥'"々〇〉》」〔$([{⦆¥₩#]/.source),vs=function(){function t(t){var n=this;this.runtime=void 0,this.fontMetricsCache={},this.shouldBreakByKinsokuShorui=function(t,e){return!n.isBreakingSpace(e)&&!(!t||!ys.exec(e)&&!ms.exec(t))},this.trimByKinsokuShorui=function(t){var e,n=[].concat(t),r=n[n.length-2];return r?(e=r[r.length-1],n[n.length-2]=r.slice(0,-1),n[n.length-1]=e+n[n.length-1],n):t},this.runtime=t}var e=t.prototype;return e.measureFont=function(t,e){if(this.fontMetricsCache[t])return this.fontMetricsCache[t];for(var n={ascent:0,descent:0,fontSize:0},r=this.runtime.offscreenCanvas.getOrCreateCanvas(e),e=this.runtime.offscreenCanvas.getOrCreateContext(e),i=(e.font=t,ps.MetricsString+ps.BaselineSymbol),a=Math.ceil(e.measureText(i).width),o=Math.ceil(e.measureText(ps.BaselineSymbol).width),s=ps.HeightMultiplier*o,o=o*ps.BaselineMultiplier|0,l=(r.width=a,r.height=s,e.fillStyle="#f00",e.fillRect(0,0,a,s),e.font=t,e.textBaseline="alphabetic",e.fillStyle="#000",e.fillText(i,0,o),e.getImageData(0,0,a||1,s||1).data),r=l.length,c=4*a,u=0,f=0,h=!1,u=0;u<o;++u){for(var d=0;d<c;d+=4)if(255!==l[f+d]){h=!0;break}if(h)break;f+=c}for(n.ascent=o-u,f=r-c,h=!1,u=s;o<u;--u){for(var p=0;p<c;p+=4)if(255!==l[f+p]){h=!0;break}if(h)break;f-=c}return n.descent=u-o,n.fontSize=n.ascent+n.descent,this.fontMetricsCache[t]=n},e.measureText=function(t,e,n){var r=e.fontSize,i=e.wordWrap,a=e.lineHeight,o=e.lineWidth,s=e.textBaseline,l=e.textAlign,c=e.letterSpacing,u=e.textPath,f=(e.textPathSide,e.textPathStartOffset,e.leading),f=void 0===f?0:f,h=function(t){for(var e=t.fontSize,n=t.fontFamily,r=t.fontStyle,i=t.fontVariant,t=t.fontWeight,e=$e(e)&&e+"px"||"16px",a=n.split(","),o=a.length-1;0<=o;o--){var s=a[o].trim();!Ji.test(s)&&Qi.indexOf(s)<0&&(s='"'+s+'"'),a[o]=s}return r+" "+i+" "+t+" "+e+" "+a.join(",")}(e),d=this.measureFont(h,n),p=(0===d.fontSize&&(d.fontSize=r,d.ascent=r),this.runtime.offscreenCanvas.getOrCreateContext(n));p.font=h,e.isOverflowing=!1;var g=(i?this.wordWrap(t,e,n):t).split(/(?:\r\n|\r|\n)/),m=new Array(g.length),y=0;if(!u){for(var v=0;v<g.length;v++){var b=p.measureText(g[v]).width+(g[v].length-1)*c;m[v]=b,y=Math.max(y,b)}var r=y+o,x=a||d.fontSize+o,i=Math.max(x,d.fontSize+o)+(g.length-1)*(x+f),w=0;return"middle"===s?w=-i/2:"bottom"===s||"alphabetic"===s||"ideographic"===s?w=-i:"top"!==s&&"hanging"!==s||(w=0),{font:h,width:r,height:i,lines:g,lineWidths:m,lineHeight:x+=f,maxLineWidth:y,fontProperties:d,lineMetrics:m.map(function(t,e){var n=0;return"center"===l||"middle"===l?n-=t/2:"right"!==l&&"end"!==l||(n-=t),new ko(n-o/2,w+e*x,t+o,x)})}}u.getTotalLength();for(var M=0;M<g.length;M++)p.measureText(g[M]).width,g[M].length},e.setGraphemeOnPath=function(){},e.wordWrap=function(t,e,n){for(var r=this,i=e.wordWrapWidth,i=void 0===i?0:i,a=e.letterSpacing,o=e.maxLines,s=void 0===o?1/0:o,o=e.textOverflow,l=this.runtime.offscreenCanvas.getOrCreateContext(n),c=i+a,u="",f=("ellipsis"===o?u="...":o&&"clip"!==o&&(u=o),[]),h=0,d=0,p={},g=function(t){return r.getFromCache(t,a,p,l)},m=Array.from(u).reduce(function(t,e){return t+g(e)},0),y=Array.from(t),v=0;v<y.length;v++){var b=y[v],x=t[v-1],w=t[v+1],M=g(b);if(this.isNewline(b)){if(s<=++h){e.isOverflowing=!0;break}d=0,f[h]=""}else{if(0<d&&c<d+M){if(s<=h+1){if(e.isOverflowing=!0,0<m&&m<=c){for(var O=f[h].length,k=0,_=O,E=0;E<O;E++){var S=g(f[h][E]);if(c<k+S+m){_=E;break}k+=S}f[h]=(f[h]||"").slice(0,_)+u}break}if(d=0,f[++h]="",this.isBreakingSpace(b))continue;this.canBreakInLastChar(b)||(f=this.trimToBreakable(f),d=this.sumTextWidthByCache(f[h]||"",p)),this.shouldBreakByKinsokuShorui(b,w)&&(f=this.trimByKinsokuShorui(f),d+=g(x||""))}d+=M,f[h]=(f[h]||"")+b}}return f.join("\n")},e.isBreakingSpace=function(t){return"string"==typeof t&&0<=ps.BreakingSpaces.indexOf(t.charCodeAt(0))},e.isNewline=function(t){return"string"==typeof t&&0<=ps.Newlines.indexOf(t.charCodeAt(0))},e.trimToBreakable=function(t){var e,t=[].concat(t),n=t[t.length-2],r=this.findBreakableIndex(n);return-1!==r&&n&&(e=n.slice(r,r+1),e=r+(this.isBreakingSpace(e)?0:1),t[t.length-1]+=n.slice(r+1,n.length),t[t.length-2]=n.slice(0,e)),t},e.canBreakInLastChar=function(t){return!t||!gs.test(t)},e.sumTextWidthByCache=function(t,n){return t.split("").reduce(function(t,e){if(n[e])return t+n[e];throw Error("cannot count the word without cache")},0)},e.findBreakableIndex=function(t){for(var e=t.length-1;0<=e;e--)if(!gs.test(t[e]))return e;return-1},e.getFromCache=function(t,e,n,r){var i=n[t];return"number"!=typeof i&&(e=t.length*e,i=r.measureText(t).width+e,n[t]=i),i},t}(),x={},Ro=(a=new a,os=new os,(Bl={})[b.CIRCLE]=new Ro,Bl[b.ELLIPSE]=new rs,Bl[b.RECT]=a,Bl[b.IMAGE]=a,Bl[b.GROUP]=a,Bl[b.LINE]=new is,Bl[b.TEXT]=new ss(x),Bl[b.POLYLINE]=os,Bl[b.POLYGON]=os,Bl[b.PATH]=new as,Bl[b.HTML]=null,Bl[b.MESH]=null,Bl),ss=(rs=new e,a=new ho,(is={})[o.PERCENTAGE]=null,is[o.NUMBER]=new yo,is[o.ANGLE]=new r,is[o.DEFINED_PATH]=new n,is[o.PAINT]=rs,is[o.COLOR]=rs,is[o.FILTER]=new so,is[o.LENGTH]=a,is[o.LENGTH_PERCENTAGE]=a,is[o.LENGTH_PERCENTAGE_12]=new po,is[o.LENGTH_PERCENTAGE_14]=new go,is[o.COORDINATE]=new i,is[o.OFFSET_DISTANCE]=new vo,is[o.OPACITY_VALUE]=new bo,is[o.PATH]=new _o,is[o.LIST_OF_POINTS]=new Eo,is[o.SHADOW_BLUR]=new So,is[o.TEXT]=new Ao,is[o.TEXT_TRANSFORM]=new Lo,is[o.TRANSFORM]=new To,is[o.TRANSFORM_ORIGIN]=new co,is[o.Z_INDEX]=new jo,is[o.MARKER]=new mo,is),os=(x.CameraContribution=Wo,x.AnimationTimeline=null,x.EasingFunction=null,x.offscreenCanvas=new ls,x.nativeHTMLMap=new WeakMap,x.sceneGraphSelector=new us,x.sceneGraphService=new ds(x),x.textService=new vs(x),x.geometryUpdaterFactory=Ro,x.CSSPropertySyntaxFactory=ss,x.styleValueRegistry=new Po,x.layoutRegistry=null,x.globalThis=function(){if("undefined"!=typeof globalThis)return globalThis;if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==N)return N;throw new Error("Unable to locate global `this`")}(),x.enableCSSParsing=!0,x.enableDataset=!1,x.enableStyleSyntax=!0,function(){function t(){this.context=void 0,this.plugins=[]}var e=t.prototype;return e.addRenderingPlugin=function(t){this.plugins.push(t),this.context.renderingPlugins.push(t)},e.removeAllRenderingPlugins=function(){var e=this;this.plugins.forEach(function(t){t=e.context.renderingPlugins.indexOf(t);0<=t&&e.context.renderingPlugins.splice(t,1)})},t}());function bs(){bs=function(){return o};var o={},t=Object.prototype,l=t.hasOwnProperty,c=Object.defineProperty||function(t,e,n){t[e]=n.value},e="function"==typeof Symbol?Symbol:{},r=e.iterator||"@@iterator",n=e.asyncIterator||"@@asyncIterator",i=e.toStringTag||"@@toStringTag";function a(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{a({},"")}catch(t){a=function(t,e,n){return t[e]=n}}function s(t,e,n,r){var i,a,o,s,e=e&&e.prototype instanceof h?e:h,e=Object.create(e.prototype),r=new w(r||[]);return c(e,"_invoke",{value:(i=t,a=n,o=r,s="suspendedStart",function(t,e){if("executing"===s)throw new Error("Generator is already running");if("completed"===s){if("throw"===t)throw e;return O()}for(o.method=t,o.arg=e;;){var n=o.delegate;if(n){n=function t(e,n){var r=n.method,i=e.iterator[r];if(void 0===i)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=void 0,t(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;r=u(i,e.iterator,n.arg);if("throw"===r.type)return n.method="throw",n.arg=r.arg,n.delegate=null,f;i=r.arg;return i?i.done?(n[e.resultName]=i.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=void 0),n.delegate=null,f):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,f)}(n,o);if(n){if(n===f)continue;return n}}if("next"===o.method)o.sent=o._sent=o.arg;else if("throw"===o.method){if("suspendedStart"===s)throw s="completed",o.arg;o.dispatchException(o.arg)}else"return"===o.method&&o.abrupt("return",o.arg);s="executing";n=u(i,a,o);if("normal"===n.type){if(s=o.done?"completed":"suspendedYield",n.arg===f)continue;return{value:n.arg,done:o.done}}"throw"===n.type&&(s="completed",o.method="throw",o.arg=n.arg)}})}),e}function u(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}o.wrap=s;var f={};function h(){}function d(){}function p(){}var e={},g=(a(e,r,function(){return this}),Object.getPrototypeOf),g=g&&g(g(M([]))),m=(g&&g!==t&&l.call(g,r)&&(e=g),p.prototype=h.prototype=Object.create(e));function y(t){["next","throw","return"].forEach(function(e){a(t,e,function(t){return this._invoke(e,t)})})}function v(o,s){var e;c(this,"_invoke",{value:function(n,r){function t(){return new s(function(t,e){!function e(t,n,r,i){var a,t=u(o[t],o,n);if("throw"!==t.type)return(n=(a=t.arg).value)&&"object"==typeof n&&l.call(n,"__await")?s.resolve(n.__await).then(function(t){e("next",t,r,i)},function(t){e("throw",t,r,i)}):s.resolve(n).then(function(t){a.value=t,r(a)},function(t){return e("throw",t,r,i)});i(t.arg)}(n,r,t,e)})}return e=e?e.then(t,t):t()}})}function b(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function w(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(b,this),this.reset(!0)}function M(e){if(e){var n,t=e[r];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return n=-1,(t=function t(){for(;++n<e.length;)if(l.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t}).next=t}return{next:O}}function O(){return{value:void 0,done:!0}}return c(m,"constructor",{value:d.prototype=p,configurable:!0}),c(p,"constructor",{value:d,configurable:!0}),d.displayName=a(p,i,"GeneratorFunction"),o.isGeneratorFunction=function(t){t="function"==typeof t&&t.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))},o.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,a(t,i,"GeneratorFunction")),t.prototype=Object.create(m),t},o.awrap=function(t){return{__await:t}},y(v.prototype),a(v.prototype,n,function(){return this}),o.AsyncIterator=v,o.async=function(t,e,n,r,i){void 0===i&&(i=Promise);var a=new v(s(t,e,n,r),i);return o.isGeneratorFunction(e)?a:a.next().then(function(t){return t.done?t.value:a.next()})},y(m),a(m,i,"Generator"),a(m,r,function(){return this}),a(m,"toString",function(){return"[object Generator]"}),o.keys=function(t){var e,n=Object(t),r=[];for(e in n)r.push(e);return r.reverse(),function t(){for(;r.length;){var e=r.pop();if(e in n)return t.value=e,t.done=!1,t}return t.done=!0,t}},o.values=M,w.prototype={constructor:w,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(x),!t)for(var e in this)"t"===e.charAt(0)&&l.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(n){if(this.done)throw n;var r=this;function t(t,e){return a.type="throw",a.arg=n,r.next=t,e&&(r.method="next",r.arg=void 0),!!e}for(var e=this.tryEntries.length-1;0<=e;--e){var i=this.tryEntries[e],a=i.completion;if("root"===i.tryLoc)return t("end");if(i.tryLoc<=this.prev){var o=l.call(i,"catchLoc"),s=l.call(i,"finallyLoc");if(o&&s){if(this.prev<i.catchLoc)return t(i.catchLoc,!0);if(this.prev<i.finallyLoc)return t(i.finallyLoc)}else if(o){if(this.prev<i.catchLoc)return t(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return t(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;0<=n;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&l.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}var a=(i=i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc?null:i)?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),x(n),f}},catch:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var n,r,i=this.tryEntries[e];if(i.tryLoc===t)return"throw"===(n=i.completion).type&&(r=n.arg,x(i)),r}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:M(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),f}},o}function xs(t,e,n,r,i,a,o){try{var s=t[a](o),l=s.value}catch(t){return void n(t)}s.done?e(l):Promise.resolve(l).then(r,i)}function ws(s){return function(){var t=this,o=arguments;return new Promise(function(e,n){var r=s.apply(t,o);function i(t){xs(r,e,n,i,a,"next",t)}function a(t){xs(r,e,n,i,a,"throw",t)}i(void 0)})}}function Ms(){return(Ms=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n,r=arguments[e];for(n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t}).apply(this,arguments)}function Os(t,e){return(Os=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}b.CIRCLE,b.ELLIPSE,b.IMAGE,b.RECT,b.LINE,b.POLYLINE,b.POLYGON,b.TEXT,b.PATH,b.HTML,(as=Rg=Rg||{}).READY="ready",as.BEFORE_RENDER="beforerender",as.RERENDER="rerender",as.AFTER_RENDER="afterrender",as.BEFORE_DESTROY="beforedestroy",as.AFTER_DESTROY="afterdestroy",as.RESIZE="resize",as.DIRTY_RECTANGLE="dirtyrectangle",new Co(No.MOUNTED),new Co(No.UNMOUNTED),new Co(Rg.BEFORE_RENDER),new Co(Rg.RERENDER),new Co(Rg.AFTER_RENDER);var ks=function(){function i(t){this.dragndropPluginOptions=void 0,this.dragndropPluginOptions=t}return i.prototype.apply=function(t){function e(t){var a,o,s,l,c,e,u=t.target,f=u===p,h=f&&d.dragndropPluginOptions.isDocumentDraggable?p:u.closest&&u.closest("[draggable=true]");h&&(a=!1,o=t.timeStamp,s=[t.clientX,t.clientY],l=null,c=[t.clientX,t.clientY],e=function(){var e=ws(bs().mark(function t(e){var n,r,i;return bs().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(a)t.next=8;else{if(n=e.timeStamp-o,r=Se([e.clientX,e.clientY],s),n<=d.dragndropPluginOptions.dragstartTimeThreshold||r<=d.dragndropPluginOptions.dragstartDistanceThreshold)return t.abrupt("return");t.next=5}break;case 5:e.type="dragstart",h.dispatchEvent(e),a=!0;case 8:if(e.type="drag",e.dx=e.clientX-c[0],e.dy=e.clientY-c[1],h.dispatchEvent(e),c=[e.clientX,e.clientY],f){t.next=21;break}return n="pointer"===d.dragndropPluginOptions.overlap?[e.canvasX,e.canvasY]:u.getBounds().center,t.next=17,p.elementsFromPoint(n[0],n[1]);case 17:r=t.sent,i=r[r.indexOf(u)+1],i=(null==i?void 0:i.closest("[droppable=true]"))||(d.dragndropPluginOptions.isDocumentDroppable?p:null),l!==i&&(l&&(e.type="dragleave",(e.target=l).dispatchEvent(e)),i&&(e.type="dragenter",(e.target=i).dispatchEvent(e)),l=i)&&(e.type="dragover",(e.target=l).dispatchEvent(e));case 21:case"end":return t.stop()}},t)}));return function(t){return e.apply(this,arguments)}}(),r.addEventListener("pointermove",e),u.addEventListener("pointerup",t=function(t){a&&(t.detail={preventClick:!0},t=t.clone(),l&&(t.type="drop",(t.target=l).dispatchEvent(t)),t.type="dragend",h.dispatchEvent(t),a=!1),r.removeEventListener("pointermove",e)},{once:!0}),u.addEventListener("pointerupoutside",t,{once:!0}))}var d=this,n=t.renderingService,p=t.renderingContext.root.ownerDocument,r=p.defaultView;n.hooks.init.tapPromise(i.tag,ws(bs().mark(function t(){return bs().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:r.addEventListener("pointerdown",e);case 1:case"end":return t.stop()}},t)}))),n.hooks.destroy.tap(i.tag,function(){r.removeEventListener("pointerdown",e)})},i}(),_s=(ks.tag="Dragndrop",function(n){var t;function e(t){var e;return void 0===t&&(t={}),(e=n.call(this)||this).options=void 0,e.name="dragndrop",e.options=t,e}t=n,(r=e).prototype=Object.create(t.prototype),Os(r.prototype.constructor=r,t);var r=e.prototype;return r.init=function(){this.addRenderingPlugin(new ks(Ms({overlap:"pointer",isDocumentDraggable:!1,isDocumentDroppable:!1,dragstartDistanceThreshold:0,dragstartTimeThreshold:0},this.options)))},r.destroy=function(){this.removeAllRenderingPlugins()},r.setOptions=function(t){Object.assign(this.plugins[0].dragndropPluginOptions,t)},e}(os)),Es=(Ss.prototype.on=function(t,e,n){return this._events[t]||(this._events[t]=[]),this._events[t].push({callback:e,once:!!n}),this},Ss.prototype.once=function(t,e){return this.on(t,e,!0)},Ss.prototype.emit=function(a){for(var o=this,s=[],t=1;t<arguments.length;t++)s[t-1]=arguments[t];function e(t){for(var e,n,r=t.length,i=0;i<r;i++)t[i]&&(n=(e=t[i]).callback,e.once&&(t.splice(i,1),0===t.length&&delete o._events[a],r--,i--),n.apply(o,s))}var n=this._events[a]||[],r=this._events["*"]||[];e(n),e(r)},Ss.prototype.off=function(t,e){if(t)if(e){for(var n=this._events[t]||[],r=n.length,i=0;i<r;i++)n[i].callback===e&&(n.splice(i,1),r--,i--);0===n.length&&delete this._events[t]}else delete this._events[t];else this._events={};return this},Ss.prototype.getEvents=function(){return this._events},Ss);function Ss(){this._events={}}const As=()=>[["cartesian"]],Ls=(As.props={},(t={})=>{var e={startAngle:-Math.PI/2,endAngle:3*Math.PI/2,innerRadius:0,outerRadius:1};return Object.assign(Object.assign({},e),t)}),Ts=t=>{var{startAngle:t,endAngle:e,innerRadius:n,outerRadius:r}=Ls(t);return[["translate",0,.5],["reflect.y"],["translate",0,-.5],["polar",t,e,n,r]]},js=(Ts.props={},({startAngle:t=0,endAngle:e=6*Math.PI,innerRadius:n=0,outerRadius:r=1})=>[["translate",.5,.5],["reflect.y"],["translate",-.5,-.5],["helix",t,e,n,r]]),Ns=(js.props={},()=>[["transpose"],["translate",.5,.5],["reflect.x"],["translate",-.5,-.5]]),Ps=(Ns.props={transform:!0},t=>{[t={}]=[t],e={startAngle:-Math.PI/2,endAngle:3*Math.PI/2,innerRadius:0,outerRadius:1};var{startAngle:e,endAngle:t,innerRadius:n,outerRadius:r}=Object.assign(Object.assign({},e),t);return[...Ns(),...Ts({startAngle:e,endAngle:t,innerRadius:n,outerRadius:r})]}),Cs=(Ps.props={},(t={})=>{var e={startAngle:-Math.PI/2,endAngle:3*Math.PI/2,innerRadius:0,outerRadius:1};return Object.assign(Object.assign({},e),t)}),Rs=t=>{var{startAngle:t,endAngle:e,innerRadius:n,outerRadius:r}=Cs(t);return[["transpose"],["translate",.5,.5],["reflect"],["translate",-.5,-.5],...Ts({startAngle:t,endAngle:e,innerRadius:n,outerRadius:r})]},Is=(Rs.props={},()=>[["parallel",0,1,0,1]]),Bs=(Is.props={},({focusX:t=0,focusY:e=0,distortionX:n=2,distortionY:r=2,visual:i=!1})=>[["fisheye",t,e,n,r,i]]),Fs=(Bs.props={transform:!0},t=>{var{startAngle:t=-Math.PI/2,endAngle:e=3*Math.PI/2,innerRadius:n=0,outerRadius:r=1}=t;return[...Is(),...Ts({startAngle:t,endAngle:e,innerRadius:n,outerRadius:r})]}),Ds=(Fs.props={},({value:e})=>t=>t.map(()=>e)),zs=(Ds.props={},({value:e})=>t=>t.map(e)),Ws=(zs.props={},({value:e})=>t=>t.map(t=>t[e])),Gs=(Ws.props={},({value:t})=>()=>t);function qs(t,e){return t.parent===e.parent?1:2}function Hs(t,e){return t+e.x}function Vs(t,e){return Math.max(t,e.y)}function Ys(){var s=qs,l=1,c=1,u=!1;function e(e){var r,i=0,t=(e.eachAfter(function(t){var e,n=t.children;n?(t.x=(e=n).reduce(Hs,0)/e.length,t.y=1+n.reduce(Vs,0)):(t.x=r?i+=s(t,r):0,t.y=0,r=t)}),function(t){for(var e;e=t.children;)t=e[0];return t}(e)),n=function(t){for(var e;e=t.children;)t=e[e.length-1];return t}(e),a=t.x-s(t,n)/2,o=n.x+s(n,t)/2;return e.eachAfter(u?function(t){t.x=(t.x-e.x)*l,t.y=(e.y-t.y)*c}:function(t){t.x=(t.x-a)/(o-a)*l,t.y=(1-(e.y?t.y/e.y:1))*c})}return e.separation=function(t){return arguments.length?(s=t,e):s},e.size=function(t){return arguments.length?(u=!1,l=+t[0],c=+t[1],e):u?null:[l,c]},e.nodeSize=function(t){return arguments.length?(u=!0,l=+t[0],c=+t[1],e):u?[l,c]:null},e}function $s(t){var e=0,n=t.children,r=n&&n.length;if(r)for(;0<=--r;)e+=n[r].value;else e=1;t.value=e}function Us(t,e){t instanceof Map?(t=[void 0,t],void 0===e&&(e=Xs)):void 0===e&&(e=Ks);for(var n,r,i,a,o,t=new Js(t),s=[t];n=s.pop();)if((i=e(n.data))&&(o=(i=Array.from(i)).length))for(n.children=i,a=o-1;0<=a;--a)s.push(r=i[a]=new Js(i[a])),r.parent=n,r.depth=n.depth+1;return t.eachBefore(Qs)}function Ks(t){return t.children}function Xs(t){return Array.isArray(t)?t[1]:null}function Zs(t){void 0!==t.data.value&&(t.value=t.data.value),t.data=t.data.data}function Qs(t){for(var e=0;t.height=e,(t=t.parent)&&t.height<++e;);}function Js(t){this.data=t,this.depth=this.height=0,this.parent=null}function tl(t){return null==t?null:el(t)}function el(t){if("function"!=typeof t)throw new Error;return t}function nl(){return 0}function rl(t){return function(){return t}}Gs.props={},Js.prototype=Us.prototype={constructor:Js,count:function(){return this.eachAfter($s)},each:function(t,e){let n=-1;for(const r of this)t.call(e,r,++n,this);return this},eachAfter:function(t,e){for(var n,r,i,a=this,o=[a],s=[],l=-1;a=o.pop();)if(s.push(a),n=a.children)for(r=0,i=n.length;r<i;++r)o.push(n[r]);for(;a=s.pop();)t.call(e,a,++l,this);return this},eachBefore:function(t,e){for(var n,r,i,a=[this],o=-1;n=a.pop();)if(t.call(e,n,++o,this),r=n.children)for(i=r.length-1;0<=i;--i)a.push(r[i]);return this},find:function(t,e){let n=-1;for(const r of this)if(t.call(e,r,++n,this))return r},sum:function(i){return this.eachAfter(function(t){for(var e=+i(t.data)||0,n=t.children,r=n&&n.length;0<=--r;)e+=n[r].value;t.value=e})},sort:function(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})},path:function(t){for(var e=this,n=function(t,e){if(t===e)return t;var n=t.ancestors(),r=e.ancestors(),i=null;t=n.pop(),e=r.pop();for(;t===e;)i=t,t=n.pop(),e=r.pop();return i}(e,t),r=[e];e!==n;)e=e.parent,r.push(e);for(var i=r.length;t!==n;)r.splice(i,0,t),t=t.parent;return r},ancestors:function(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e},descendants:function(){return Array.from(this)},leaves:function(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e},links:function(){var e=this,n=[];return e.each(function(t){t!==e&&n.push({source:t.parent,target:t})}),n},copy:function(){return Us(this).eachBefore(Zs)},[Symbol.iterator]:function*(){var t,e,n,r,i,a=[this];do{for(e=a.reverse(),a=[];t=e.pop();)if(yield t,n=t.children)for(r=0,i=n.length;r<i;++r)a.push(n[r])}while(a.length)}};const il=4294967296;function al(t,e){for(var n,r,i=0,a=(t=function(t,e){let n=t.length,r,i;for(;n;)i=e()*n--|0,r=t[n],t[n]=t[i],t[i]=r;return t}(Array.from(t),e)).length,o=[];i<a;)n=t[i],r&&sl(r,n)?++i:(r=function(t){switch(t.length){case 1:return function(t){return{x:t.x,y:t.y,r:t.r}}(t[0]);case 2:return cl(t[0],t[1]);case 3:return ul(t[0],t[1],t[2])}}(o=function(t,e){var n,r;if(ll(e,t))return[e];for(n=0;n<t.length;++n)if(ol(e,t[n])&&ll(cl(t[n],e),t))return[t[n],e];for(n=0;n<t.length-1;++n)for(r=n+1;r<t.length;++r)if(ol(cl(t[n],t[r]),e)&&ol(cl(t[n],e),t[r])&&ol(cl(t[r],e),t[n])&&ll(ul(t[n],t[r],e),t))return[t[n],t[r],e];throw new Error}(o,n)),i=0);return r}function ol(t,e){var n=t.r-e.r,r=e.x-t.x,e=e.y-t.y;return n<0||n*n<r*r+e*e}function sl(t,e){var n=t.r-e.r+1e-9*Math.max(t.r,e.r,1),r=e.x-t.x,e=e.y-t.y;return 0<n&&r*r+e*e<n*n}function ll(t,e){for(var n=0;n<e.length;++n)if(!sl(t,e[n]))return;return 1}function cl(t,e){var n=t.x,r=t.y,t=t.r,i=e.x,a=e.y,e=e.r,o=i-n,s=a-r,l=e-t,c=Math.sqrt(o*o+s*s);return{x:(n+i+o/c*l)/2,y:(r+a+s/c*l)/2,r:(c+t+e)/2}}function ul(t,e,n){var r=t.x,i=t.y,t=t.r,a=e.x,o=e.y,e=e.r,s=n.x,l=n.y,n=n.r,c=r-a,u=r-s,f=i-o,h=i-l,d=e-t,p=n-t,g=r*r+i*i-t*t,a=g-a*a-o*o+e*e,o=g-s*s-l*l+n*n,e=u*f-c*h,g=(f*o-h*a)/(2*e)-r,s=(h*d-f*p)/e,l=(u*a-c*o)/(2*e)-i,n=(c*p-u*d)/e,h=s*s+n*n-1,f=2*(t+g*s+l*n),a=g*g+l*l-t*t,o=-(1e-6<Math.abs(h)?(f+Math.sqrt(f*f-4*h*a))/(2*h):a/f);return{x:r+g+s*o,y:i+l+n*o,r:o}}function fl(t,e,n){var r,i,a,o,s=t.x-e.x,l=t.y-e.y,c=s*s+l*l;c?(i=e.r+n.r,o=t.r+n.r,(o*=o)<(i*=i)?(r=(c+o-i)/(2*c),a=Math.sqrt(Math.max(0,o/c-r*r)),n.x=t.x-r*s-a*l,n.y=t.y-r*l+a*s):(r=(c+i-o)/(2*c),a=Math.sqrt(Math.max(0,i/c-r*r)),n.x=e.x+r*s-a*l,n.y=e.y+r*l+a*s)):(n.x=e.x+n.r,n.y=e.y)}function hl(t,e){var n=t.r+e.r-1e-6,r=e.x-t.x,e=e.y-t.y;return 0<n&&r*r+e*e<n*n}function dl(t){var e=t._,t=t.next._,n=e.r+t.r,r=(e.x*t.r+t.x*e.r)/n,t=(e.y*t.r+t.y*e.r)/n;return r*r+t*t}function pl(t){this._=t,this.next=null,this.previous=null}function gl(t,e){if(!(a=(t="object"==typeof(n=t)&&"length"in n?n:Array.from(n)).length))return 0;var n,r,i,a,o,s,l,c,u,f,h,d=t[0];if(d.x=0,d.y=0,!(1<a))return d.r;if(r=t[1],d.x=-r.r,r.x=d.r,r.y=0,!(2<a))return d.r+r.r;fl(r,d,i=t[2]),d=new pl(d),r=new pl(r),i=new pl(i),((d.next=i.previous=r).next=d.previous=i).next=r.previous=d;t:for(l=3;l<a;++l){fl(d._,r._,i=t[l]),i=new pl(i),c=r.next,u=d.previous,f=r._.r,h=d._.r;do{if(f<=h){if(hl(c._,i._)){r=c,(d.next=r).previous=d,--l;continue t}f+=c._.r,c=c.next}else{if(hl(u._,i._)){((d=u).next=r).previous=d,--l;continue t}h+=u._.r,u=u.previous}}while(c!==u.next);for(i.previous=d,i.next=r,d.next=r.previous=r=i,o=dl(d);(i=i.next)!==r;)(s=dl(i))<o&&(d=i,o=s);r=d.next}for(d=[r._],i=r;(i=i.next)!==r;)d.push(i._);for(i=al(d,e),l=0;l<a;++l)(d=t[l]).x-=i.x,d.y-=i.y;return i.r}function ml(t){return Math.sqrt(t.value)}function yl(){var n=null,r=1,i=1,a=nl;function e(t){var e=function(){let t=1;return()=>(t=(1664525*t+1013904223)%il)/il}();return t.x=r/2,t.y=i/2,n?t.eachBefore(vl(n)).eachAfter(bl(a,.5,e)).eachBefore(xl(1)):t.eachBefore(vl(ml)).eachAfter(bl(nl,1,e)).eachAfter(bl(a,t.r/Math.min(r,i),e)).eachBefore(xl(Math.min(r,i)/(2*t.r))),t}return e.radius=function(t){return arguments.length?(n=tl(t),e):n},e.size=function(t){return arguments.length?(r=+t[0],i=+t[1],e):[r,i]},e.padding=function(t){return arguments.length?(a="function"==typeof t?t:rl(+t),e):a},e}function vl(e){return function(t){t.children||(t.r=Math.max(0,+e(t)||0))}}function bl(o,s,l){return function(t){if(e=t.children){var e,n,r,i=e.length,a=o(t)*s||0;if(a)for(n=0;n<i;++n)e[n].r+=a;if(r=gl(e,l),a)for(n=0;n<i;++n)e[n].r-=a;t.r=r+a}}}function xl(n){return function(t){var e=t.parent;t.r*=n,e&&(t.x=e.x+n*t.x,t.y=e.y+n*t.y)}}function wl(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}function Ml(t,e,n,r,i){for(var a,o=t.children,s=-1,l=o.length,c=t.value&&(r-e)/t.value;++s<l;)(a=o[s]).y0=n,a.y1=i,a.x0=e,a.x1=e+=a.value*c}var Ol={depth:-1},kl={},_l={};function El(t){return t.id}function Sl(t){return t.parentId}function Al(){var m,y=El,v=Sl;function e(n){var e,t,r,i,a,o,s,l,c=Array.from(n),u=y,f=v,h=new Map;if(null!=m){const p=c.map((t,e)=>{t=m(t,e,n),e=(t=""+t).length;return"/"===(t=Tl(t,e-1)&&!Tl(t,e-2)?t.slice(0,-1):t)[0]?t:"/"+t}),g=p.map(Ll);var d=new Set(p).add("");for(const r of g)d.has(r)||(d.add(r),p.push(r),g.push(Ll(r)),c.push(_l));u=(t,e)=>p[e],f=(t,e)=>g[e]}for(r=0,e=c.length;r<e;++r)t=c[r],o=c[r]=new Js(t),null!=(s=u(t,r,n))&&(s+="")&&(l=o.id=s,h.set(l,h.has(l)?kl:o)),null!=(s=f(t,r,n))&&(s+="")&&(o.parent=s);for(r=0;r<e;++r)if(s=(o=c[r]).parent){if(!(a=h.get(s)))throw new Error("missing: "+s);if(a===kl)throw new Error("ambiguous: "+s);a.children?a.children.push(o):a.children=[o],o.parent=a}else{if(i)throw new Error("multiple roots");i=o}if(!i)throw new Error("no root");if(null!=m){for(;i.data===_l&&1===i.children.length;)i=i.children[0],--e;for(let t=c.length-1;0<=t&&(o=c[t]).data===_l;--t)o.data=null}if(i.parent=Ol,i.eachBefore(function(t){t.depth=t.parent.depth+1,--e}).eachBefore(Qs),i.parent=null,0<e)throw new Error("cycle");return i}return e.id=function(t){return arguments.length?(y=tl(t),e):y},e.parentId=function(t){return arguments.length?(v=tl(t),e):v},e.path=function(t){return arguments.length?(m=tl(t),e):m},e}function Ll(t){let e=t.length;if(e<2)return"";for(;1<--e&&!Tl(t,e););return t.slice(0,e)}function Tl(e,n){if("/"===e[n]){let t=0;for(;0<n&&"\\"===e[--n];)++t;if(0==(1&t))return 1}}function jl(t,e){return t.parent===e.parent?1:2}function Nl(t){var e=t.children;return e?e[0]:t.t}function Pl(t){var e=t.children;return e?e[e.length-1]:t.t}function Cl(t,e){this._=t,this.parent=null,this.children=null,this.A=null,(this.a=this).z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=e}function Rl(){var h=jl,l=1,c=1,u=null;function e(t){var e,n,r,i,a,o,s=function(t){for(var e,n,r,i,a,o=[t=new Cl(t,0)];e=o.pop();)if(r=e._.children)for(e.children=new Array(a=r.length),i=a-1;0<=i;--i)o.push(n=e.children[i]=new Cl(r[i],i)),n.parent=e;return(t.parent=new Cl(null,0)).children=[t],t}(t);return s.eachAfter(f),s.parent.m=-s.z,s.eachBefore(d),u?t.eachBefore(p):((r=n=e=t).eachBefore(function(t){t.x<e.x&&(e=t),t.x>n.x&&(n=t),t.depth>r.depth&&(r=t)}),s=e===n?1:h(e,n)/2,i=s-e.x,a=l/(n.x+s+i),o=c/(r.depth||1),t.eachBefore(function(t){t.x=(t.x+i)*a,t.y=t.depth*o})),t}function f(t){var e=t.children,n=t.parent.children,r=t.i?n[t.i-1]:null;if(e){for(var i,a=0,o=0,s=t.children,l=s.length;0<=--l;)(i=s[l]).z+=a,i.m+=a,a+=i.s+(o+=i.c);e=(e[0].z+e[e.length-1].z)/2;r?(t.z=r.z+h(t._,r._),t.m=t.z-e):t.z=e}else r&&(t.z=r.z+h(t._,r._));t.parent.A=function(t,e,n){if(e){for(var r,i=t,a=t,o=e,s=i.parent.children[0],l=i.m,c=a.m,u=o.m,f=s.m;o=Pl(o),i=Nl(i),o&&i;)s=Nl(s),(a=Pl(a)).a=t,0<(r=o.z+u-i.z-l+h(o._,i._))&&(function(t,e,n){var r=n/(e.i-t.i);e.c-=r,e.s+=n,t.c+=r,e.z+=n,e.m+=n}(function(t,e,n){return t.a.parent===e.parent?t.a:n}(o,t,n),t,r),l+=r,c+=r),u+=o.m,l+=i.m,f+=s.m,c+=a.m;o&&!Pl(a)&&(a.t=o,a.m+=u-c),i&&!Nl(s)&&(s.t=i,s.m+=l-f,n=t)}return n}(t,r,t.parent.A||n[0])}function d(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function p(t){t.x*=l,t.y=t.depth*c}return e.separation=function(t){return arguments.length?(h=t,e):h},e.size=function(t){return arguments.length?(u=!1,l=+t[0],c=+t[1],e):u?null:[l,c]},e.nodeSize=function(t){return arguments.length?(u=!0,l=+t[0],c=+t[1],e):u?[l,c]:null},e}function Il(t,e,n,r,i){for(var a,o=t.children,s=-1,l=o.length,c=t.value&&(i-n)/t.value;++s<l;)(a=o[s]).x0=e,a.x1=r,a.y0=n,a.y1=n+=a.value*c}Cl.prototype=Object.create(Js.prototype);var Bl=(1+Math.sqrt(5))/2;function Fl(t,e,n,r,i,a){for(var o,s,l,c,u,f,h,d,p,g,m,y=[],v=e.children,b=0,x=0,w=v.length,M=e.value;b<w;){for(l=i-n,c=a-r;!(u=v[x++].value)&&x<w;);for(m=(f=h=u)*u*(g=Math.max(c/l,l/c)/(M*t)),p=Math.max(h/m,m/f);x<w;++x){if(u+=s=v[x].value,s<f&&(f=s),h<s&&(h=s),m=u*u*g,p<(d=Math.max(h/m,m/f))){u-=s;break}p=d}y.push(o={value:u,dice:l<c,children:v.slice(b,x)}),o.dice?Ml(o,n,r,i,M?r+=c*u/M:a):Il(o,n,r,M?n+=l*u/M:i,a),M-=u,b=x}return y}var Dl=function e(a){function t(t,e,n,r,i){Fl(a,t,e,n,r,i)}return t.ratio=function(t){return e(1<(t=+t)?t:1)},t}(Bl);function zl(t,e,n,r,i){var a,o,g=t.children,s=g.length,m=new Array(s+1);for(m[0]=o=a=0;a<s;++a)m[a+1]=o+=g[a].value;!function t(e,n,r,i,a,o,s){if(n-1<=e)return(l=g[e]).x0=i,l.y0=a,l.x1=o,void(l.y1=s);var l=m[e],c=r/2+l,u=e+1,f=n-1;for(;u<f;){var h=u+f>>>1;m[h]<c?u=1+h:f=h}c-m[u-1]<m[u]-c&&e+1<u&&--u;var l=m[u]-l,d=r-l;{var p;s-a<o-i?(t(e,u,l,i,a,p=r?(i*d+o*l)/r:o,s),t(u,n,d,p,a,o,s)):(t(e,u,l,i,a,o,p=r?(a*d+s*l)/r:s),t(u,n,d,i,p,o,s))}}(0,s,t.value,e,n,r,i)}function Wl(t,e,n,r,i){(1&t.depth?Il:Ml)(t,e,n,r,i)}var Gl=function e(d){function t(t,e,n,r,i){if((a=t._squarify)&&a.ratio===d)for(var a,o,s,l,c,u=-1,f=a.length,h=t.value;++u<f;){for(s=(o=a[u]).children,l=o.value=0,c=s.length;l<c;++l)o.value+=s[l].value;o.dice?Ml(o,e,n,r,h?n+=(i-n)*o.value/h:i):Il(o,e,n,h?e+=(r-e)*o.value/h:r,i),h-=o.value}else t._squarify=a=Fl(d,t,e,n,r,i),a.ratio=d}return t.ratio=function(t){return e(1<(t=+t)?t:1)},t}(Bl);function ql(t={}){t=t.shapes;return[{name:"color"},{name:"opacity"},{name:"shape",range:t},{name:"enterType"},{name:"enterDelay",scaleKey:"enter"},{name:"enterDuration",scaleKey:"enter"},{name:"enterEasing"},{name:"key",scale:"identity"},{name:"groupKey",scale:"identity"},{name:"label",scale:"identity"}]}function Hl(t={}){return[...ql(t),{name:"title",scale:"identity"}]}function Vl(){return[{type:"maybeTitle",channel:"color"},{type:"maybeTooltip",channel:["x","y"]}]}function Yl(){return[{type:"maybeTitle",channel:"x"},{type:"maybeTooltip",channel:["y"]}]}function $l(t={}){return ql(t)}function Ul(){return[{type:"maybeKey"}]}function Kl(t,e){return t.getBandWidth(t.invert(e))}function Xl(t,e,n={}){const{x:a,y:o,series:s}=e,{x:l,y:c,series:u}=t,{style:{bandOffset:r=u?0:.5,bandOffsetX:f=r,bandOffsetY:h=r}={}}=n,d=!(null===l||void 0===l||!l.getBandWidth),p=!(null===c||void 0===c||!c.getBandWidth),g=!(null===u||void 0===u||!u.getBandWidth);return d||p?(t,e)=>{const n=d?Kl(l,a[e]):0;var r=p?Kl(c,o[e]):0,e=g&&s?(Kl(u,s[e])/2+ +s[e])*n:0,[t,i]=t;return[t+f*n+e,i+h*r]}:t=>t}function Zl(t){return parseFloat(t)/100}function Ql(t,e,n,r){const{x:i,y:a}=n,{width:o,height:s}=r.getOptions();return[t,Array.from(t,t=>{var e=i[t],t=a[t];return[["string"==typeof e?Zl(e)*o:+e,"string"==typeof t?Zl(t)*s:+t]]})]}function Jl(e){return"function"==typeof e?e:t=>t[e]}function tc(t,e){return Array.from(t,Jl(e))}function ec(t,e){var{source:e=t=>t.source,target:n=t=>t.target,value:r=t=>t.value}=e,{links:t,nodes:i}=t;const a=tc(t,e),o=tc(t,n),s=tc(t,r);return{links:t.map((t,e)=>({target:o[e],source:a[e],value:s[e]})),nodes:i||Array.from(new Set([...a,...o]),t=>({key:t}))}}function nc(t,e){return t.getBandWidth(t.invert(e))}const rc=()=>(t,e,n,i)=>{const{x:a,y:o,y1:s,series:l,size:r}=n,c=e.x,u=e.series,[f]=i.getSize(),h=r?r.map(t=>+t/f):null,d=r?(t,e,n)=>{t+=e/2,e=h[n];return[t-e/2,t+e/2]}:(t,e,n)=>[t,t+e];return[t,Array.from(t,t=>{var e=nc(c,a[t]),n=e*(u?nc(u,null===l||void 0===l?void 0:l[t]):1),e=(+(null===l||void 0===l?void 0:l[t])||0)*e,e=+a[t]+e,[e,n]=d(e,n,t),r=+o[t],t=+s[t];return[[e,r],[n,r],[n,t],[e,t]].map(t=>i.map(t))})]};rc.props={defaultShape:"rect",defaultLabelShape:"label",composite:!1,channels:[...Hl({shapes:["rect","hollow","funnel","pyramid"]}),{name:"x",scale:"band",required:!0},{name:"y",required:!0},{name:"series",scale:"band"},{name:"size"}],preInference:[...Ul(),{type:"maybeZeroY1"},{type:"maybeZeroX"}],postInference:[...Yl()],interaction:{shareTooltip:!0}};const ic=()=>(t,e,n,r)=>{const{x:i,x1:a,y:o,y1:s}=n;return[t,Array.from(t,t=>{return[[+i[t],+o[t]],[+a[t],+o[t]],[+a[t],+s[t]],[+i[t],+s[t]]].map(t=>r.map(t))})]};function ac(t,e){return null==t||null==e?NaN:t<e?-1:e<t?1:e<=t?0:NaN}function oc(n){let a,o,i;function s(t,e,n=0,r=t.length){if(n<r){if(0!==a(e,e))return r;do{var i=n+r>>>1;o(t[i],e)<0?n=1+i:r=i}while(n<r)}return n}return i=2!==n.length?(a=ac,o=(t,e)=>ac(n(t),e),(t,e)=>n(t)-e):(a=n===ac||n===function(t,e){return null==t||null==e?NaN:e<t?-1:t<e?1:t<=e?0:NaN}?n:sc,o=n),{left:s,center:function(t,e,n=0,r=t.length){return r=s(t,e,n,r-1),n<r&&i(t[r-1],e)>-i(t[r],e)?r-1:r},right:function(t,e,n=0,r=t.length){if(n<r){if(0!==a(e,e))return r;do{var i=n+r>>>1;o(t[i],e)<=0?n=1+i:r=i}while(n<r)}return n}}}function sc(){return 0}function lc(t){return null===t?NaN:+t}ic.props={defaultShape:"rect",defaultLabelShape:"label",composite:!1,channels:[...Hl({shapes:["rect","hollow"]}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...Ul(),{type:"maybeZeroY1"}],postInference:[...Yl()],interaction:{shareTooltip:!0}};e=oc(ac);const cc=e.right,uc=e.left,fc=oc(lc).center;function hc(e,n){let r=0;if(void 0===n)for(var t of e)null!=t&&(t=+t)>=t&&++r;else{let t=-1;for(var i of e)null!=(i=n(i,++t,e))&&(i=+i)>=i&&++r}return r}function dc(t,e){t=function(e,n){let r=0,i,a=0,o=0;if(void 0===n)for(var t of e)null!=t&&(t=+t)>=t&&(i=t-a,a+=i/++r,o+=i*(t-a));else{let t=-1;for(var s of e)null!=(s=n(s,++t,e))&&(s=+s)>=s&&(i=s-a,a+=i/++r,o+=i*(s-a))}if(1<r)return o/(r-1)}(t,e);return t&&Math.sqrt(t)}function pc(e,n){let r,i;if(void 0===n)for(const t of e)null!=t&&(void 0===r?t>=t&&(r=i=t):(r>t&&(r=t),i<t&&(i=t)));else{let t=-1;for(var a of e)null!=(a=n(a,++t,e))&&(void 0===r?a>=a&&(r=i=a):(r>a&&(r=a),i<a&&(i=a)))}return[r,i]}class gc{constructor(){this._partials=new Float64Array(32),this._n=0}add(e){var n=this._partials;let r=0;for(let t=0;t<this._n&&t<32;t++){var i=n[t],a=e+i,i=Math.abs(e)<Math.abs(i)?e-(a-i):i-(a-e);i&&(n[r++]=i),e=a}return n[r]=e,this._n=r+1,this}valueOf(){var t=this._partials;let e=this._n,n,r,i,a=0;if(0<e){for(a=t[--e];0<e&&(n=a,r=t[--e],a=n+r,!(i=r-(a-n))););0<e&&(i<0&&t[e-1]<0||0<i&&0<t[e-1])&&(r=2*i,n=a+r,r==n-a)&&(a=n)}return a}}class mc extends Map{constructor(t,e=function(t){return null!==t&&"object"==typeof t?t.valueOf():t}){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:e}}),null!=t)for(const[e,n]of t)this.set(e,n)}get(t){return super.get(yc(this,t))}has(t){return super.has(yc(this,t))}set(t,e){return super.set(function({_intern:t,_key:e},n){e=e(n);return t.has(e)?t.get(e):(t.set(e,n),n)}(this,t),e)}delete(t){return super.delete(function({_intern:t,_key:e},n){e=e(n);t.has(e)&&(n=t.get(e),t.delete(e));return n}(this,t))}}function yc({_intern:t,_key:e},n){e=e(n);return t.has(e)?t.get(e):n}function vc(t){return t}function bc(t,...e){return Mc(t,vc,vc,e)}function xc(t,e,...n){return Mc(t,vc,e,n)}function wc(t,e,...n){return Mc(t,Array.from,e,n)}function Mc(t,u,f,h){return function t(e,n){if(n>=h.length)return f(e);var r=new mc,i=h[n++];let a=-1;for(const l of e){var o=i(l,++a,e),s=r.get(o);s?s.push(l):r.set(o,[l])}for(const[c,e]of r)r.set(c,t(e,n));return u(r)}(t,0)}function Oc(e,...i){if("function"!=typeof e[Symbol.iterator])throw new TypeError("values is not iterable");e=Array.from(e);let[n]=i;var t,r;return n&&2!==n.length||1<i.length?(t=Uint32Array.from(e,(t,e)=>e),1<i.length?(i=i.map(t=>e.map(t)),t.sort((t,e)=>{for(const r of i){var n=_c(r[t],r[e]);if(n)return n}})):(n=e.map(n),t.sort((t,e)=>_c(n[t],n[e]))),r=e,Array.from(t,t=>r[t])):e.sort(kc(n))}function kc(r=ac){if(r===ac)return _c;if("function"!=typeof r)throw new TypeError("compare is not a function");return(t,e)=>{var n=r(t,e);return n||0===n?n:(0===r(e,e))-(0===r(t,t))}}function _c(t,e){return(null==t||!(t<=t))-(null==e||!(e<=e))||(t<e?-1:e<t?1:0)}var Ec=Array.prototype.slice;function Sc(t){return()=>t}const Ac=Math.sqrt(50),Lc=Math.sqrt(10),Tc=Math.sqrt(2);function jc(t,e,n){var r=(e-t)/Math.max(0,n),i=Math.floor(Math.log10(r)),r=r/Math.pow(10,i),r=r>=Ac?10:r>=Lc?5:r>=Tc?2:1;let a,o,s;return i<0?(s=Math.pow(10,-i)/r,a=Math.round(t*s),o=Math.round(e*s),a/s<t&&++a,o/s>e&&--o,s=-s):(s=Math.pow(10,i)*r,a=Math.round(t/s),o=Math.round(e/s),a*s<t&&++a,o*s>e&&--o),o<a&&.5<=n&&n<2?jc(t,e,2*n):[a,o,s]}function Nc(t,e,n){return jc(t=+t,e=+e,n=+n)[2]}function Pc(t){return Math.max(1,Math.ceil(Math.log(hc(t))/Math.LN2)+1)}function Cc(){var y=vc,v=pc,b=Pc;function e(t){for(var e,n,r=(t=Array.isArray(t)?t:Array.from(t)).length,i=new Array(r),a=0;a<r;++a)i[a]=y(t[a],a,t);var o=v(i),s=o[0],l=o[1],c=b(i,s,l);if(!Array.isArray(c)){var o=l,u=+c;if(v===pc&&([s,l]=function(t,e,n){let r;for(;;){var i=Nc(t,e,n);if(i===r||0===i||!isFinite(i))return[t,e];0<i?(t=Math.floor(t/i)*i,e=Math.ceil(e/i)*i):i<0&&(t=Math.ceil(t*i)/i,e=Math.floor(e*i)/i),r=i}}(s,l,u)),(c=function(t,e,n){if(!(0<(n=+n)))return[];if((t=+t)===(e=+e))return[t];var r=e<t,[i,a,o]=r?jc(e,t,n):jc(t,e,n);if(!(i<=a))return[];var s=a-i+1,l=new Array(s);if(r)if(o<0)for(let t=0;t<s;++t)l[t]=(a-t)/-o;else for(let t=0;t<s;++t)l[t]=(a-t)*o;else if(o<0)for(let t=0;t<s;++t)l[t]=(i+t)/-o;else for(let t=0;t<s;++t)l[t]=(i+t)*o;return l}(s,l,u))[0]<=s&&(n=Nc(s,l,u)),c[c.length-1]>=l)if(l<=o&&v===pc){const n=Nc(s,l,u);isFinite(n)&&(0<n?l=(Math.floor(l/n)+1)*n:n<0&&(l=(Math.ceil(l*-n)+1)/-n))}else c.pop()}for(var f=c.length,h=0,d=f;c[h]<=s;)++h;for(;c[d-1]>l;)--d;(h||d<f)&&(c=c.slice(h,d),f=d-h);var p,g,m=new Array(f+1);for(a=0;a<=f;++a)(p=m[a]=[]).x0=0<a?c[a-1]:s,p.x1=a<f?c[a]:l;if(isFinite(n)){if(0<n)for(a=0;a<r;++a)null!=(e=i[a])&&s<=e&&e<=l&&m[Math.min(f,Math.floor((e-s)/n))].push(t[a]);else if(n<0)for(a=0;a<r;++a)null!=(e=i[a])&&s<=e&&e<=l&&(g=Math.floor((s-e)*n),m[Math.min(f,g+(c[g]<=e))].push(t[a]))}else for(a=0;a<r;++a)null!=(e=i[a])&&s<=e&&e<=l&&m[cc(c,e,0,f)].push(t[a]);return m}return e.value=function(t){return arguments.length?(y="function"==typeof t?t:Sc(t),e):y},e.domain=function(t){return arguments.length?(v="function"==typeof t?t:Sc([t[0],t[1]]),e):v},e.thresholds=function(t){return arguments.length?(b="function"==typeof t?t:Sc(Array.isArray(t)?Ec.call(t):t),e):b},e}function Rc(e,n){let r;if(void 0===n)for(const t of e)null!=t&&(r<t||void 0===r&&t>=t)&&(r=t);else{let t=-1;for(var i of e)null!=(i=n(i,++t,e))&&(r<i||void 0===r&&i>=i)&&(r=i)}return r}function Ic(t,e){let n,r=-1,i=-1;if(void 0===e)for(const o of t)++i,null!=o&&(n<o||void 0===n&&o>=o)&&(n=o,r=i);else for(var a of t)null!=(a=e(a,++i,t))&&(n<a||void 0===n&&a>=a)&&(n=a,r=i);return r}function Bc(e,n){let r;if(void 0===n)for(const t of e)null!=t&&(r>t||void 0===r&&t>=t)&&(r=t);else{let t=-1;for(var i of e)null!=(i=n(i,++t,e))&&(r>i||void 0===r&&i>=i)&&(r=i)}return r}function Fc(t,e){let n,r=-1,i=-1;if(void 0===e)for(const o of t)++i,null!=o&&(n>o||void 0===n&&o>=o)&&(n=o,r=i);else for(var a of t)null!=(a=e(a,++i,t))&&(n>a||void 0===n&&a>=a)&&(n=a,r=i);return r}function Dc(n,r,i=0,a=1/0,o){if(r=Math.floor(r),i=Math.floor(Math.max(0,i)),a=Math.floor(Math.min(n.length-1,a)),i<=r&&r<=a)for(o=void 0===o?_c:kc(o);i<a;){600<a-i&&(s=a-i+1,l=r-i+1,u=Math.log(s),c=.5*Math.exp(2*u/3),u=.5*Math.sqrt(u*c*(s-c)/s)*(l-s/2<0?-1:1),Dc(n,r,Math.max(i,Math.floor(r-l*c/s+u)),Math.min(a,Math.floor(r+(s-l)*c/s+u)),o));var s,l,c,u,f=n[r];let t=i,e=a;for(zc(n,i,r),0<o(n[a],f)&&zc(n,i,a);t<e;){for(zc(n,t,e),++t,--e;o(n[t],f)<0;)++t;for(;0<o(n[e],f);)--e}0===o(n[i],f)?zc(n,i,e):zc(n,++e,a),e<=r&&(i=e+1),r<=e&&(a=e-1)}return n}function zc(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function Wc(t,e,n){var r;if((n=(t=Float64Array.from(function*(e,n){if(void 0===n)for(var t of e)null!=t&&(t=+t)>=t&&(yield t);else{let t=-1;for(var r of e)null!=(r=n(r,++t,e))&&(r=+r)>=r&&(yield r)}}(t,n))).length)&&!isNaN(e=+e))return e<=0||n<2?Bc(t):1<=e?Rc(t):(n=(n-1)*e,(r=Rc(Dc(t,e=Math.floor(n)).subarray(0,e+1)))+(Bc(t.subarray(e+1))-r)*(n-e))}function Gc(n,t,r=lc){var i,e,a;if(!isNaN(t=+t))return i=Float64Array.from(n,(t,e)=>lc(r(n[e],e,n))),t<=0?Fc(i):1<=t?Ic(i):(e=Uint32Array.from(n,(t,e)=>e),a=i.length-1,Dc(e,t=Math.floor(a*t),0,a,(t,e)=>_c(i[t],i[e])),0<=(t=function(e,n){let r,i=!1;if(1===n.length){let t;for(const o of e){var a=n(o);(i?0<ac(a,t):0===ac(a,a))&&(r=o,t=a,i=!0)}}else for(const t of e)(i?0<n(t,r):0===n(t,t))&&(r=t,i=!0);return r}(e.subarray(0,t+1),t=>i[t]))?t:-1)}function qc(e,n){let r=0,i=0;if(void 0===n)for(var t of e)null!=t&&(t=+t)>=t&&(++r,i+=t);else{let t=-1;for(var a of e)null!=(a=n(a,++t,e))&&(a=+a)>=a&&(++r,i+=a)}if(r)return i/r}function Hc(t,e){return Wc(t,.5,e)}function Vc(t){return Array.from(function*(t){for(const e of t)yield*e}(t))}function Yc(t,e,n){t=+t,e=+e,n=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+n;for(var r=-1,i=0|Math.max(0,Math.ceil((e-t)/n)),a=new Array(i);++r<i;)a[r]=t+r*n;return a}function $c(e,n){let r=0;if(void 0===n)for(var t of e)(t=+t)&&(r+=t);else{let t=-1;for(var i of e)(i=+n(i,++t,e))&&(r+=i)}return r}function Uc(t){t=t.getOptions().transformations;return t.map(([t])=>t).filter(t=>"transpose"===t).length%2!=0}function Kc(t){t=t.getOptions().transformations;return t.some(([t])=>"polar"===t)}function Xc(t){t=t.getOptions().transformations;return t.some(([t])=>"reflect"===t)&&t.some(([t])=>t.startsWith("transpose"))}function Zc(t){t=t.getOptions().transformations;return t.some(([t])=>"helix"===t)}function Qc(t){t=t.getOptions().transformations;return t.some(([t])=>"parallel"===t)}function Jc(t){t=t.getOptions().transformations;return t.some(([t])=>"fisheye"===t)}function tu(t){return Zc(t)||Kc(t)}function eu(t){var t=t.getOptions()["transformations"],[,,,t,e]=t.find(t=>"polar"===t[0]);return[+t,+e]}function nu(t,e=!0){var t=t.getOptions()["transformations"],[,t,n]=t.find(t=>"polar"===t[0]);return e?[180*+t/Math.PI,180*+n/Math.PI]:[t,n]}const ru=(t,e,n,r)=>{var i;const{series:a,x:o,y:s}=n;var{x:n,y:e}=e;if(void 0===o||void 0===s)throw new Error("Missing encode for x or y channel.");var t=a?Array.from(bc(t,t=>a[t]).values()):[t],l=t.map(t=>t[0]).filter(t=>void 0!==t);const c=((null==(i=null==n?void 0:n.getBandWidth)?void 0:i.call(n))||0)/2,u=((null==(i=null==e?void 0:e.getBandWidth)?void 0:i.call(e))||0)/2;return[l,Array.from(t,t=>t.map(t=>r.map([+o[t]+c,+s[t]+u]))),t]},iu=(t,e,n,i)=>{const a=Object.entries(n).filter(([t])=>t.startsWith("position")).map(([,t])=>t);if(0===a.length)throw new Error("Missing encode for position channel.");return[t,Array.from(t,e=>{var t=a.map(t=>+t[e]),n=i.map(t),r=[];for(let t=0;t<n.length;t+=2)r.push([n[t],n[t+1]]);return r})]},au=()=>(t,e,n,r)=>{return(Qc(r)?iu:ru)(t,e,n,r)};au.props={defaultShape:"line",defaultLabelShape:"label",composite:!1,channels:[...Hl({shapes:["line","smooth"]}),{name:"x"},{name:"y"},{name:"position",independent:!0},{name:"size"},{name:"series",scale:"identity"}],preInference:[...Ul(),{type:"maybeSeries"},{type:"maybeGradient"}],postInference:[...Yl(),{type:"maybeTitle",channel:"color"},{type:"maybeTooltip",channel:["position"]}],interaction:{shareTooltip:!0,seriesTooltip:!0,crosshairs:!0}};const ou=g=>(t,e,n,o)=>{const{x:r,y:i,x1:a,y1:s,size:l,dx:c,dy:u}=n,[f,h]=o.getSize(),d=Xl(e,n,g),p=t=>{var e=+((null===c||void 0===c?void 0:c[t])||0),n=+((null===u||void 0===u?void 0:u[t])||0);return[(a?(+r[t]+ +a[t])/2:+r[t])+e,(s?(+i[t]+ +s[t])/2:+i[t])+n]};return[t,l?Array.from(t,t=>{var[e,n]=p(t),r=+l[t],i=r/f,r=r/h,a=[e-i,n-r],e=[e+i,n+r];return[o.map(d(a,t)),o.map(d(e,t))]}):Array.from(t,t=>[o.map(d(p(t),t))])]};ou.props={defaultShape:"hollow",defaultLabelShape:"label",composite:!1,channels:[...Hl({shapes:["hollow","hollowDiamond","hollowHexagon","hollowSquare","hollowTriangleDown","hollowTriangle","hollowBowtie","point","plus","diamond","square","triangle","hexagon","cross","bowtie","hyphen","line","tick","triangleDown"]}),{name:"x",required:!0},{name:"y",required:!0},{name:"series",scale:"band"},{name:"size",scale:"sqrt"},{name:"dx",scale:"identity"},{name:"dy",scale:"identity"}],preInference:[...Ul(),{type:"maybeZeroY"},{type:"maybeZeroX"}],postInference:[{type:"maybeSize"},...Vl()]};const su=s=>{var{cartesian:t=!1}=s;return t?Ql:(t,e,n,r)=>{const{x:i,y:a}=n,o=Xl(e,n,s);return[t,Array.from(t,t=>{var e=[+i[t],+a[t]];return[r.map(o(e,t))]})]}};su.props={defaultShape:"text",defaultLabelShape:"label",composite:!1,channels:[...Hl({shapes:["text","badge"]}),{name:"x",required:!0},{name:"y",required:!0},{name:"text",scale:"identity"},{name:"fontSize"},{name:"rotate"}],preInference:[...Ul(),{type:"maybeTuple"},{type:"maybeVisualPosition"}],postInference:[...Vl()]};const lu=()=>(t,e,n,i)=>{const{x:a,y:o}=n,s=e.x,l=e.y;return[t,Array.from(t,t=>{var e=s.getBandWidth(s.invert(+a[t])),n=l.getBandWidth(l.invert(+o[t])),r=+a[t],t=+o[t];return[[r,t],[r+e,t],[r+e,t+n],[r,t+n]].map(t=>i.map(t))})]};lu.props={defaultShape:"cell",defaultLabelShape:"label",composite:!1,channels:[...Hl({shapes:["cell","hollow"]}),{name:"x",required:!0,scale:"band"},{name:"y",required:!0,scale:"band"}],preInference:[...Ul(),{type:"maybeZeroX"},{type:"maybeZeroY"},{type:"maybeZeroPadding"}],postInference:[...Vl()]};const cu=()=>(t,e,n,a)=>{var r;const{x:o,y:s,y1:l,series:i}=n;var{x:n,y:e}=e,t=i?Array.from(bc(t,t=>i[t]).values()):[t],c=t.map(t=>t[0]).filter(t=>void 0!==t);const u=((null==(r=null==n?void 0:n.getBandWidth)?void 0:r.call(n))||0)/2,f=((null==(r=null==e?void 0:e.getBandWidth)?void 0:r.call(e))||0)/2;return[c,Array.from(t,e=>{var n=e.length,r=new Array(2*n);for(let t=0;t<e.length;t++){var i=e[t];r[t]=a.map([+o[i]+u,+s[i]+f]),r[n+t]=a.map([+o[i]+u,+l[i]+f])}return r}),t]};cu.props={defaultShape:"area",defaultLabelShape:"label",composite:!1,channels:[...Hl({shapes:["area","smooth","hvh","hv","vh"]}),{name:"x",required:!0},{name:"y",required:!0},{name:"size"},{name:"series",scale:"identity"}],preInference:[...Ul(),{type:"maybeSeries"},{type:"maybeZeroY1"},{type:"maybeZeroPadding"}],postInference:[...Yl()],interaction:{shareTooltip:!0,seriesTooltip:!0,crosshairs:!0}};const uu=c=>(t,e,n,r)=>{const{x:i,y:a,x1:o=i,y1:s=a}=n,l=Xl(e,n,c);e=t.map(t=>[r.map(l([+i[t],+a[t]],t)),r.map(l([+o[t],+s[t]],t))]);return[t,e]};uu.props={defaultShape:"link",defaultLabelShape:"label",composite:!1,channels:[...Hl({shapes:["link","arc","vhv","smooth"]}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...Ul(),{type:"maybeIdentityY"},{type:"maybeIdentityX"}],postInference:[...Vl()]};const fu=s=>{var t=s["cartesian"];return t?Ql:(t,e,n,r)=>{const{x:i,y:a}=n,o=Xl(e,n,s);return[t,Array.from(t,t=>{var e=[+i[t],+a[t]];return[r.map(o(e,t))]})]}};fu.props={defaultShape:"image",defaultLabelShape:"label",composite:!1,channels:[...Hl({shapes:["image"]}),{name:"x",required:!0},{name:"y",required:!0},{name:"src",scale:"identity"},{name:"size"}],preInference:[...Ul(),{type:"maybeTuple"},{type:"maybeVisualPosition"}],postInference:[...Vl()]};const hu=()=>(t,e,n,a)=>{const o=Object.entries(n).filter(([t])=>t.startsWith("x")).map(([,t])=>t),s=Object.entries(n).filter(([t])=>t.startsWith("y")).map(([,t])=>t);n=t.map(e=>{var n=[];for(let t=0;t<o.length;t++){var r=o[t][e];if(void 0===r)break;var i=s[t][e];n.push(a.map([+r,+i]))}return n});return[t,n]};hu.props={defaultShape:"polygon",defaultLabelShape:"label",composite:!1,channels:[...Hl({shapes:["polygon","ribbon"]}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...Ul()],postInference:[...Vl()]};const du=()=>(t,e,n,s)=>{const{x:l,y:c,y1:u,y2:f,y3:h,y4:d,series:p}=n,g=e.x,m=e.series;return[t,Array.from(t,t=>{var e=g.getBandWidth(g.invert(+l[t])),n=e*(m?m.getBandWidth(m.invert(+(null===p||void 0===p?void 0:p[t]))):1),e=(+(null===p||void 0===p?void 0:p[t])||0)*e,e=+l[t]+e+n/2,[t,r,i,a,o]=[+c[t],+u[t],+f[t],+h[t],+d[t]];return[[e-n/2,o],[e+n/2,o],[e,o],[e,a],[e-n/2,a],[e+n/2,a],[e+n/2,r],[e-n/2,r],[e-n/2,i],[e+n/2,i],[e,r],[e,t],[e-n/2,t],[e+n/2,t]].map(t=>s.map(t))})]},pu=(du.props={defaultShape:"box",defaultLabelShape:"label",composite:!1,channels:[...Hl({shapes:["box"]}),{name:"x",scale:"band",required:!0},{name:"y",required:!0},{name:"series",scale:"band"}],preInference:[...Ul(),{type:"maybeZeroX"}],postInference:[...Yl()],interaction:{shareTooltip:!0}},()=>(t,e,n,i)=>{const{x:a,y:o,size:s,rotate:l}=n,[c,u]=i.getSize();n=t.map(t=>{var e=+l[t]/180*Math.PI,n=+s[t],r=n/c,n=n/u,r=r*Math.cos(e),n=-n*Math.sin(e);return[i.map([+a[t]-r/2,+o[t]-n/2]),i.map([+a[t]+r/2,+o[t]+n/2])]});return[t,n]});pu.props={defaultShape:"vector",defaultLabelShape:"label",composite:!1,channels:[...Hl({shapes:["vector"]}),{name:"x",required:!0},{name:"y",required:!0},{name:"rotate",required:!0,scale:"identity"},{name:"size",required:!0}],preInference:[...Ul()],postInference:[...Vl()]};const gu=()=>(t,e,n,r)=>{const i=n["y"];return[t,Array.from(t,t=>{return[[0,i[t]],[1,i[t]]].map(t=>r.map(t))})]};gu.props={defaultShape:"line",defaultLabelShape:"label",composite:!1,channels:[...$l({shapes:["line"]}),{name:"y",required:!0}],preInference:[...Ul(),{type:"maybeTupleY"}],postInference:[]};const mu=()=>(t,e,n,r)=>{const i=n["x"];return[t,Array.from(t,t=>{return[[i[t],1],[i[t],0]].map(t=>r.map(t))})]};mu.props={defaultShape:"line",defaultLabelShape:"label",composite:!1,channels:[...$l({shapes:["line"]}),{name:"x",required:!0}],preInference:[...Ul(),{type:"maybeTupleX"}],postInference:[]};const yu=(...t)=>uu(...t);function vu(t,e,n,r){if(e)return()=>[0,1];const{[t]:i,[t+"1"]:a}=n;return t=>{var e=(null==(e=r.getBandWidth)?void 0:e.call(r,r.invert(+a[t])))||0;return[i[t],a[t]+e]}}function bu(t={}){const{extendX:r=!1,extendY:s=!1}=t;return(t,e,n,i)=>{const a=vu("x",r,n,e.x),o=vu("y",s,n,e.y);return[t,Array.from(t,t=>{var[e,n]=a(t),[t,r]=o(t);return[[e,t],[n,t],[n,r],[e,r]].map(t=>i.map(t))})]}}yu.props={defaultShape:"connector",defaultLabelShape:"label",composite:!1,channels:[...$l({shapes:["connector"]}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...Ul()],postInference:[]};const xu=()=>bu();xu.props={defaultShape:"range",defaultLabelShape:"label",composite:!1,channels:[...$l({shapes:["range"]}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...Ul()],postInference:[]};const wu=()=>bu({extendY:!0});wu.props={defaultShape:"range",defaultLabelShape:"label",composite:!1,channels:[...$l({shapes:["range"]}),{name:"x",required:!0}],preInference:[...Ul()],postInference:[]};const Mu=()=>bu({extendX:!0});function Ou(t){return t.target.depth}function ku(t,e){return t.sourceLinks.length?t.depth:e-1}function _u(t){return function(){return t}}function Eu(t,e){return Au(t.source,e.source)||t.index-e.index}function Su(t,e){return Au(t.target,e.target)||t.index-e.index}function Au(t,e){return t.y0-e.y0}function Lu(t){return t.value}function Tu(t){return t.index}function ju(t){return t.nodes}function Nu(t){return t.links}function Pu(t,e){t=t.get(e);if(t)return t;throw new Error("missing: "+e)}function Cu({nodes:t}){for(const n of t){let t=n.y0,e=t;for(const r of n.sourceLinks)r.y0=t+r.width/2,t+=r.width;for(const i of n.targetLinks)i.y1=e+i.width/2,e+=i.width}}function Ru(){let x=0,w=0,M=1,O=1,k=24,_=8,E,S=Tu,A=ku,L,T,j,N=ju,P=Nu,C=6;function e(e){e={nodes:N(e),links:P(e)};{var{nodes:i,links:t}=e;i.forEach((t,e)=>{t.index=e,t.sourceLinks=[],t.targetLinks=[]});const g=new Map(i.map(t=>[S(t),t]));if(t.forEach((t,e)=>{t.index=e;let{source:n,target:r}=t;"object"!=typeof n&&(n=t.source=Pu(g,n)),"object"!=typeof r&&(r=t.target=Pu(g,r)),n.sourceLinks.push(t),r.targetLinks.push(t)}),null!=j)for(var{sourceLinks:n,targetLinks:r}of i)n.sort(j),r.sort(j)}t=e.nodes;for(const m of t)m.value=void 0===m.fixedValue?Math.max($c(m.sourceLinks,Lu),$c(m.targetLinks,Lu)):m.fixedValue;{var a=e.nodes,o=a.length;let t=new Set(a),n=new Set,r=0;for(;t.size;){if(t.forEach(t=>{t.depth=r;for(var{target:e}of t.sourceLinks)n.add(e)}),++r>o)throw new Error("circular link");t=n,n=new Set}if(L){var s,l=Math.max(Rc(a,t=>t.depth)+1,0);for(let t=0;t<a.length;t++)(s=a[t]).depth=L.call(null,s,l)}}{var c=(i=e.nodes).length;let t=new Set(i),n=new Set,r=0;for(;t.size;){if(t.forEach(t=>{t.height=r;for(var{source:e}of t.targetLinks)n.add(e)}),++r>c)throw new Error("circular link");t=n,n=new Set}}var u=function({nodes:t}){var e=Math.max(Rc(t,t=>t.depth)+1,0),n=(M-x-k)/(e-1),r=new Array(e).fill(0).map(()=>[]);for(const a of t){var i=Math.max(0,Math.min(e-1,Math.floor(A.call(null,a,e))));a.layer=i,a.x0=x+i*n,a.x1=a.x0+k,r[i]?r[i].push(a):r[i]=[a]}if(T)for(const o of r)o.sort(T);return r}(e),t=(E=Math.min(_,(O-w)/(Rc(u,t=>t.length)-1)),u),f=Bc(t,t=>(O-w-(t.length-1)*E)/$c(t,Lu));for(const y of t){let e=w;for(const v of y){v.y0=e,v.y1=e+v.value*f,e=v.y1+E;for(const b of v.sourceLinks)b.width=b.value*f}e=(O-e+E)/(y.length+1);for(let t=0;t<y.length;++t){var h=y[t];h.y0+=e*(t+1),h.y1+=e*(t+1)}!function(t){if(void 0===j)for(var{sourceLinks:e,targetLinks:n}of t)e.sort(Su),n.sort(Eu)}(y)}for(let t=0;t<C;++t){var d=Math.pow(.99,t),p=Math.max(1-d,(t+1)/C);!function(n,r,i){for(let t=n.length,e=t-2;0<=e;--e){var a,o=n[e];for(const c of o){let t=0,e=0;for(var{target:s,value:l}of c.sourceLinks){l=l*(s.layer-c.layer);t+=function(t,e){let n=e.y0-(e.targetLinks.length-1)*E/2;for(var{source:r,width:i}of e.targetLinks){if(r===t)break;n+=i+E}for(var{target:a,width:o}of t.sourceLinks){if(a===e)break;n-=o}return n}(c,s)*l,e+=l}0<e&&(a=(t/e-c.y0)*r,c.y0+=a,c.y1+=a,I(c))}void 0===T&&o.sort(Au),o.length&&R(o,i)}}(u,d,p),!function(n,r,i){for(let t=1,e=n.length;t<e;++t){var a,o=n[t];for(const c of o){let t=0,e=0;for(var{source:s,value:l}of c.targetLinks){l=l*(c.layer-s.layer);t+=function(t,e){let n=t.y0-(t.sourceLinks.length-1)*E/2;for(var{target:r,width:i}of t.sourceLinks){if(r===e)break;n+=i+E}for(var{source:a,width:o}of e.targetLinks){if(a===t)break;n-=o}return n}(s,c)*l,e+=l}0<e&&(a=(t/e-c.y0)*r,c.y0+=a,c.y1+=a,I(c))}void 0===T&&o.sort(Au),o.length&&R(o,i)}}(u,d,p)}return Cu(e),e}function R(t,e){var n=t.length>>1,r=t[n];a(t,r.y0-E,n-1,e),i(t,r.y1+E,1+n,e),a(t,O,t.length-1,e),i(t,w,0,e)}function i(t,e,n,r){for(;n<t.length;++n){var i=t[n],a=(e-i.y0)*r;1e-6<a&&(i.y0+=a,i.y1+=a),e=i.y1+E}}function a(t,e,n,r){for(;0<=n;--n){var i=t[n],a=(i.y1-e)*r;1e-6<a&&(i.y0-=a,i.y1-=a),e=i.y0-E}}function I({sourceLinks:t,targetLinks:e}){if(void 0===j){for(const{source:{sourceLinks:t}}of e)t.sort(Su);for(const{target:{targetLinks:e}}of t)e.sort(Eu)}}return e.update=function(t){return Cu(t),t},e.nodeId=function(t){return arguments.length?(S="function"==typeof t?t:_u(t),e):S},e.nodeAlign=function(t){return arguments.length?(A="function"==typeof t?t:_u(t),e):A},e.nodeDepth=function(t){return arguments.length?(L=t,e):L},e.nodeSort=function(t){return arguments.length?(T=t,e):T},e.nodeWidth=function(t){return arguments.length?(k=+t,e):k},e.nodePadding=function(t){return arguments.length?(_=E=+t,e):_},e.nodes=function(t){return arguments.length?(N="function"==typeof t?t:_u(t),e):N},e.links=function(t){return arguments.length?(P="function"==typeof t?t:_u(t),e):P},e.linkSort=function(t){return arguments.length?(j=t,e):j},e.size=function(t){return arguments.length?(x=w=0,M=+t[0],O=+t[1],e):[M-x,O-w]},e.extent=function(t){return arguments.length?(x=+t[0][0],M=+t[1][0],w=+t[0][1],O=+t[1][1],e):[[x,w],[M,O]]},e.iterations=function(t){return arguments.length?(C=+t,e):C},e}Mu.props={defaultShape:"range",defaultLabelShape:"label",composite:!1,channels:[...$l({shapes:["range"]}),{name:"y",required:!0}],preInference:[...Ul()],postInference:[]};const Iu={nodeAlign:"justify",nodeWidth:.008,nodePadding:.03,nodes:t=>t.nodes,links:t=>t.links,nodeSort:void 0,linkSort:void 0,iterations:6},Bu={left:function(t){return t.depth},right:function(t,e){return e-1-t.height},center:function(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?Bc(t.sourceLinks,Ou)-1:0},justify:ku};const Fu=f=>t=>{var{nodeId:e,nodeSort:n,nodeAlign:r,nodeWidth:i,nodePadding:a,nodeDepth:o,nodes:s,links:l,linkSort:c,iterations:u}=Object.assign({},Iu,f),l=Ru().nodeSort(n).linkSort(c).links(l).nodes(s).nodeWidth(i).nodePadding(a).nodeDepth(o).nodeAlign("string"==(c=typeof(n=r))?Bu[n]||ku:"function"==c?n:ku).iterations(u).extent([[0,0],[1,1]]),s=("function"==typeof e&&l.nodeId(e),l(t)),{nodes:i,links:a}=s;return{nodes:i.map(t=>{var{x0:e,x1:n,y0:r,y1:i}=t;return Object.assign(Object.assign({},t),{x:[e,n,n,e],y:[r,r,i,i]})}),links:a.map(t=>{var{source:e,target:n}=t,e=e.x1,n=n.x0,r=t.width/2;return Object.assign(Object.assign({},t),{x:[e,e,n,n],y:[t.y0+r,t.y0-r,t.y1+r,t.y1-r]})})}};function Du(t){return t}function zu(t){return t.replace(/( |^)[a-z]/g,t=>t.toUpperCase())}function Wu(t=""){throw new Error(t)}function Gu(t,e){var n,r,e=e["attributes"],i=new Set(["id","className"]);for([n,r]of Object.entries(e))i.has(n)||t.attr(n,r)}function qu(t){return null!=t&&!Number.isNaN(t)}function at(t,e){return Hu(t,e)||{}}function Hu(t,n){t=Object.entries(t||{}).filter(([t])=>t.startsWith(n)).map(([t,e])=>[Xe(t.replace(n,"").trim()),e]).filter(([t])=>!!t);return 0===t.length?null:Object.fromEntries(t)}function Vu(t,...n){return Object.fromEntries(Object.entries(t).filter(([e])=>n.every(t=>!e.startsWith(t))))}function Yu(t,e){return void 0===t?null:"number"==typeof t?t:(t=+t.replace("%",""),Number.isNaN(t)?null:t/100*e)}function $u(t){return!("object"!=typeof t||t instanceof Date||null===t||Array.isArray(t))}function Uu(t){return null===t||!1===t}function Ku(t,e,n={},r=!1){return Uu(t)||Array.isArray(t)&&r?t:(r=at(t,e),it(n,r))}function Xu(t,e={}){return!Uu(t)&&!Array.isArray(t)&&Zu(t)?it(e,t):t}function Zu(t){var e;return 0===Object.keys(t).length||({title:t,items:e}=t,void 0!==t)||void 0!==e}function Qu(t,e){return"object"==typeof t?at(t,e):t}Fu.props={};const Ju=v=>{const b={nodeId:t=>t.key,nodeWidth:.02,nodePadding:.02},x={type:"polygon",axis:!1,legend:!1,encode:{shape:"polygon",x:"x",y:"y"},scale:{x:{type:"identity"},y:{type:"identity"}},style:{stroke:"#000"}},w={type:"polygon",axis:!1,legend:!1,encode:{shape:"ribbon",x:"x",y:"y"},style:{fillOpacity:.5,stroke:void 0}},M={textAlign:t=>t.x[0]<.5?"start":"end",position:t=>t.x[0]<.5?"right":"left",fontSize:10};return()=>{var{data:t,encode:e={},scale:n,style:r={},layout:i={},nodeLabels:a=[],linkLabels:o=[],animate:s={},tooltip:l={}}=v,{links:t,nodes:c}=ec(t,e),u=at(e,"node"),e=at(e,"link"),{key:f=t=>t.key,color:h=f}=u,{links:i,nodes:t}=Fu(Object.assign(Object.assign(Object.assign({},b),{nodeId:Jl(f)}),i))({links:t,nodes:c});const d=at(r,"label"),{text:p=f,spacing:g=5}=d,m=rt(d,["text","spacing"]),y=Jl(f);c=Ku(l,"node",{title:y,items:[{field:"value"}]},!0),f=Ku(l,"link",{title:"",items:[t=>({name:"source",value:y(t.source)}),t=>({name:"target",value:y(t.target)})]});return[it({},x,{data:t,encode:Object.assign(Object.assign({},u),{color:h}),scale:n,style:at(r,"node"),labels:[Object.assign(Object.assign(Object.assign({},M),{text:p,dx:t=>t.x[0]<.5?g:-g}),m),...a],tooltip:c,animate:Qu(s,"node"),axis:!1}),it({},w,{data:i,encode:e,labels:o,style:Object.assign({fill:e.color?void 0:"#aaa",strokeWidth:0},at(r,"link")),tooltip:f,animate:Qu(s,"link")})]}},tf=(Ju.props={},t=>(t,e,n,r)=>[t,t.map(()=>[[0,0]])]);tf.props={defaultShape:"path",defaultLabelShape:"label",composite:!1,channels:[...Hl({shapes:["path","hollow"]}),{name:"d",scale:"identity"}],preInference:[...Ul()],postInference:[]};const ef=t=>t?parseInt(t):0;function nf(t){var{height:t,width:e,padding:n=0,paddingLeft:r=n,paddingRight:i=n,paddingTop:a=n,paddingBottom:n=n,margin:o=0,marginLeft:s=o,marginRight:l=o,marginTop:c=o,marginBottom:o=o,inset:u=0,insetLeft:f=u,insetRight:h=u,insetTop:d=u,insetBottom:u=u}=t,p=t=>"auto"===t?30:t;return{width:e-p(r)-p(i)-s-l-f-h,height:t-p(a)-p(n)-c-o-d-u}}function rf(t,e,n){const r=n["value"];var o,i,a,s,l,c,u,f,h,d,n=function(t,e){var n={treemapBinary:zl,treemapDice:Ml,treemapSlice:Il,treemapSliceDice:Wl,treemapSquarify:Dl,treemapResquarify:Gl};if(e="treemapSquarify"===t?n[t].ratio(e):n[t])return e;throw new TypeError("Invalid tile method!")}(e.tile,e.ratio),p=(t=t,p=e.path,(Array.isArray(t)?"function"==typeof p?Al().path(p):Al():Us)(t));function g(t){return t.x0=t.y0=0,t.x1=a,t.y1=s,t.eachBefore(m),l=[0],i&&t.eachBefore(wl),t}function m(t){var e=l[t.depth],n=t.x0+e,r=t.y0+e,i=t.x1-e,a=t.y1-e;i<n&&(n=i=(n+i)/2),a<r&&(r=a=(r+a)/2),t.x0=n,t.y0=r,t.x1=i,t.y1=a,t.children&&(e=l[t.depth+1]=c(t)/2,n+=d(t)-e,r+=u(t)-e,(i-=f(t)-e)<n&&(n=i=(n+i)/2),(a-=h(t)-e)<r&&(r=a=(r+a)/2),o(t,n,r,i,a))}return r?p.sum(t=>e.ignoreParentValue&&t.children?0:Jl(r)(t)).sort(e.sort):p.count(),o=Dl,i=!1,s=a=1,l=[0],d=h=f=u=c=nl,g.round=function(t){return arguments.length?(i=!!t,g):i},g.size=function(t){return arguments.length?(a=+t[0],s=+t[1],g):[a,s]},g.tile=function(t){return arguments.length?(o=el(t),g):o},g.padding=function(t){return arguments.length?g.paddingInner(t).paddingOuter(t):g.paddingInner()},g.paddingInner=function(t){return arguments.length?(c="function"==typeof t?t:rl(+t),g):c},g.paddingOuter=function(t){return arguments.length?g.paddingTop(t).paddingRight(t).paddingBottom(t).paddingLeft(t):g.paddingTop()},g.paddingTop=function(t){return arguments.length?(u="function"==typeof t?t:rl(+t),g):u},g.paddingRight=function(t){return arguments.length?(f="function"==typeof t?t:rl(+t),g):f},g.paddingBottom=function(t){return arguments.length?(h="function"==typeof t?t:rl(+t),g):h},g.paddingLeft=function(t){return arguments.length?(d="function"==typeof t?t:rl(+t),g):d},g.tile(n).size(e.size).round(e.round).paddingInner(e.paddingInner).paddingOuter(e.paddingOuter).paddingTop(e.paddingTop).paddingRight(e.paddingRight).paddingBottom(e.paddingBottom).paddingLeft(e.paddingLeft)(p),p.descendants().map(t=>Object.assign(t,{x:[t.x0,t.x1],y:[t.y0,t.y1]})).filter("function"==typeof e.layer?e.layer:t=>t.height===e.layer)}const af=f=>t=>{var{width:t,height:e}=nf(t),{data:n,encode:r={},scale:i,style:a={},layout:o={},labels:s=[],tooltip:l={}}=f,c=rt(f,["data","encode","scale","style","layout","labels","tooltip"]),u={tile:"treemapSquarify",ratio:.5*(1+Math.sqrt(5)),size:[t,e],round:!1,ignoreParentValue:!0,padding:0,paddingInner:0,paddingOuter:0,paddingTop:0,paddingRight:0,paddingBottom:0,paddingLeft:0,sort:(t,e)=>e.value-t.value,layer:0},t={type:"rect",axis:!1,encode:{x:"x",y:"y",color:t=>t.data.parent.name},scale:{x:{domain:[0,t],range:[0,1]},y:{domain:[0,e],range:[0,1]}},style:{stroke:"#fff"}},e=rf(n,it({},u,o),r),n=at(a,"label");return[it({},t,Object.assign(Object.assign({data:e,encode:r,scale:i,style:a,labels:[Object.assign(Object.assign({},{fontSize:10,text:t=>t.data.name,position:"inside",fill:"#000",textOverflow:"clip",wordWrap:!0,maxLines:1,wordWrapWidth:t=>t.x1-t.x0}),n),...s]},c),{tooltip:Xu(l,{title:t=>t.data.name,items:[{field:"value"}]}),axis:!1}))]},of=(af.props={},f=>t=>{var{width:t,height:e}=nf(t),{data:n,encode:r={},scale:i={},style:a={},layout:o={},labels:s=[],tooltip:l={}}=f,c=rt(f,["data","encode","scale","style","layout","labels","tooltip"]),u={type:"point",axis:!1,legend:!1,scale:{x:{domain:[0,t]},y:{domain:[0,e]},size:{type:"identity"}},encode:{x:"x",y:"y",size:"r",shape:"point"},style:{fill:r.color?void 0:t=>0===t.height?"#ddd":"#fff",stroke:r.color?void 0:t=>0===t.height?"":"#000"}},n=((t,e,n)=>{const r=n["value"];n=(De(t)?Al().path(e.path):Us)(t);return r?n.sum(t=>Jl(r)(t)).sort(e.sort):n.count(),yl().size(e.size).padding(e.padding)(n),n.descendants()})(n,it({},{size:[t,e],padding:0,sort:(t,e)=>e.value-t.value},o),it({},u.encode,r)),t=at(a,"label");return[it({},u,Object.assign(Object.assign({data:n,encode:r,scale:i,style:a,labels:[Object.assign(Object.assign({},{text:"",position:"inside",textOverflow:"clip",wordWrap:!0,maxLines:1,wordWrapWidth:t=>2*t.r}),t),...s]},c),{tooltip:Xu(l,{title:t=>t.data.name,items:[{field:"value"}]}),axis:!1}))]});function sf(t,e){return Bc(t,t=>e[t])}function lf(t,e){return Rc(t,t=>e[t])}function cf(t,e){const n=2.5*uf(t,e)-1.5*hf(t,e);return Bc(t,t=>e[t]>=n?e[t]:NaN)}function uf(t,e){return Wc(t,.25,t=>e[t])}function ff(t,e){return Wc(t,.5,t=>e[t])}function hf(t,e){return Wc(t,.75,t=>e[t])}function df(t,e){const n=2.5*hf(t,e)-1.5*uf(t,e);return Rc(t,t=>e[t]<=n?e[t]:NaN)}function pf(){return(t,e)=>{var n=e["encode"],{y:n,x:r}=n;const i=n["value"],a=r["value"];return[Array.from(bc(t,t=>a[+t]).values()).flatMap(t=>{const e=cf(t,i),n=df(t,i);return t.filter(t=>i[t]<e||i[t]>n)}),e]}}of.props={};const gf=f=>()=>{var t,{data:e,encode:n,style:r={},tooltip:i={},animate:a}=f,o=rt(f,["data","encode","style","tooltip","transform","animate"]),{point:s=!0}=r,r=rt(r,["point"]),l=n["y"],l={y:l,y1:l,y2:l,y3:l,y4:l},c={y1:uf,y2:ff,y3:hf},u=Ku(i,"box",{items:[{channel:"y",name:"min"},{channel:"y1",name:"q1"},{channel:"y2",name:"q2"},{channel:"y3",name:"q3"},{channel:"y4",name:"max"}]},!0),i=Ku(i,"point",{title:{channel:"x"},items:[{name:"outlier",channel:"y"}]});return s?(s=at(r,"box"),t=at(r,"point"),[Object.assign({type:"box",data:e,transform:[Object.assign(Object.assign({type:"groupX",y:cf},c),{y4:df})],encode:Object.assign(Object.assign({},n),l),style:s,tooltip:u,animate:Qu(a,"box")},o),{type:"point",data:e,transform:[{type:pf}],encode:n,style:Object.assign({},t),tooltip:i,animate:Qu(a,"point")}]):[Object.assign({type:"box",data:e,transform:[Object.assign(Object.assign({type:"groupX",y:sf},c),{y4:lf})],encode:Object.assign(Object.assign({},n),l),style:r,tooltip:u},o)]},mf=(gf.props={},s=>{var t=s["cartesian"];return t?Ql:(t,e,n,r)=>{const{x:i,y:a}=n,o=Xl(e,n,s);return[t,Array.from(t,t=>{var e=[+i[t],+a[t]];return[r.map(o(e,t))]})]}});function yf(t,e,n,r){if(!isNaN(e)&&!isNaN(n)){var i,a,o,s,l,c,u,f,h,d=t._root,p={data:r},g=t._x0,m=t._y0,y=t._x1,v=t._y1;if(d){for(;d.length;)if((c=e>=(a=(g+y)/2))?g=a:y=a,(u=n>=(o=(m+v)/2))?m=o:v=o,!(d=(i=d)[f=u<<1|c]))return i[f]=p,t;if(s=+t._x.call(null,d.data),l=+t._y.call(null,d.data),e===s&&n===l)p.next=d,i?i[f]=p:t._root=p;else{for(;i=i?i[f]=new Array(4):t._root=new Array(4),(c=e>=(a=(g+y)/2))?g=a:y=a,(u=n>=(o=(m+v)/2))?m=o:v=o,(f=u<<1|c)==(h=(o<=l)<<1|a<=s););i[h]=d,i[f]=p}}else t._root=p}return t}function vf(t,e,n,r,i){this.node=t,this.x0=e,this.y0=n,this.x1=r,this.y1=i}function bf(t){return t[0]}function xf(t){return t[1]}function wf(t,e,n){e=new Mf(null==e?bf:e,null==n?xf:n,NaN,NaN,NaN,NaN);return null==t?e:e.addAll(t)}function Mf(t,e,n,r,i,a){this._x=t,this._y=e,this._x0=n,this._y0=r,this._x1=i,this._y1=a,this._root=void 0}function Of(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}mf.props={defaultShape:"shape",defaultLabelShape:"label",composite:!1,channels:[{name:"x",required:!0},{name:"y",required:!0}],preInference:[...Ul(),{type:"maybeTuple"},{type:"maybeVisualPosition"},{type:"maybeFunctionAttribute"}]};ho=wf.prototype=Mf.prototype;function kf(t){return function(){return t}}function _f(t){return 1e-6*(t()-.5)}function Ef(t){return t.index}function Sf(t,e){t=t.get(e);if(t)return t;throw new Error("node not found: "+e)}function Af(c){var u,f,a,o,h,d,s=Ef,n=function(t){return 1/Math.min(o[t.source.index],o[t.target.index])},r=kf(30),p=1;function e(t){for(var e=0,n=c.length;e<p;++e)for(var r,i,a,o,s,l=0;l<n;++l)r=(i=c[l]).source,a=(i=i.target).x+i.vx-r.x-r.vx||_f(d),o=i.y+i.vy-r.y-r.vy||_f(d),a*=s=((s=Math.sqrt(a*a+o*o))-f[l])/s*t*u[l],o*=s,i.vx-=a*(s=h[l]),i.vy-=o*s,r.vx+=a*(s=1-s),r.vy+=o*s}function i(){if(a){var t,e=a.length,n=c.length,r=new Map(a.map((t,e)=>[s(t,e,a),t])),i=0;for(o=new Array(e);i<n;++i)(t=c[i]).index=i,"object"!=typeof t.source&&(t.source=Sf(r,t.source)),"object"!=typeof t.target&&(t.target=Sf(r,t.target)),o[t.source.index]=(o[t.source.index]||0)+1,o[t.target.index]=(o[t.target.index]||0)+1;for(i=0,h=new Array(n);i<n;++i)t=c[i],h[i]=o[t.source.index]/(o[t.source.index]+o[t.target.index]);u=new Array(n),l(),f=new Array(n),g()}}function l(){if(a)for(var t=0,e=c.length;t<e;++t)u[t]=+n(c[t],t,c)}function g(){if(a)for(var t=0,e=c.length;t<e;++t)f[t]=+r(c[t],t,c)}return null==c&&(c=[]),e.initialize=function(t,e){a=t,d=e,i()},e.links=function(t){return arguments.length?(c=t,i(),e):c},e.id=function(t){return arguments.length?(s=t,e):s},e.iterations=function(t){return arguments.length?(p=+t,e):p},e.strength=function(t){return arguments.length?(n="function"==typeof t?t:kf(+t),l(),e):n},e.distance=function(t){return arguments.length?(r="function"==typeof t?t:kf(+t),g(),e):r},e}ho.copy=function(){var t,e,n=new Mf(this._x,this._y,this._x0,this._y0,this._x1,this._y1),r=this._root;if(r)if(r.length)for(t=[{source:r,target:n._root=new Array(4)}];r=t.pop();)for(var i=0;i<4;++i)(e=r.source[i])&&(e.length?t.push({source:e,target:r.target[i]=new Array(4)}):r.target[i]=Of(e));else n._root=Of(r);return n},ho.add=function(t){var e=+this._x.call(null,t),n=+this._y.call(null,t);return yf(this.cover(e,n),e,n,t)},ho.addAll=function(t){for(var e,n,r=t.length,i=new Array(r),a=new Array(r),o=1/0,s=1/0,l=-1/0,c=-1/0,u=0;u<r;++u)isNaN(e=+this._x.call(null,n=t[u]))||isNaN(n=+this._y.call(null,n))||((i[u]=e)<o&&(o=e),l<e&&(l=e),(a[u]=n)<s&&(s=n),c<n&&(c=n));if(!(l<o||c<s))for(this.cover(o,s).cover(l,c),u=0;u<r;++u)yf(this,i[u],a[u],t[u]);return this},ho.cover=function(t,e){if(!isNaN(t=+t)&&!isNaN(e=+e)){var n=this._x0,r=this._y0,i=this._x1,a=this._y1;if(isNaN(n))i=(n=Math.floor(t))+1,a=(r=Math.floor(e))+1;else{for(var o,s,l=i-n||1,c=this._root;t<n||i<=t||e<r||a<=e;)switch(s=(e<r)<<1|t<n,(o=new Array(4))[s]=c,c=o,l*=2,s){case 0:i=n+l,a=r+l;break;case 1:n=i-l,a=r+l;break;case 2:i=n+l,r=a-l;break;case 3:n=i-l,r=a-l}this._root&&this._root.length&&(this._root=c)}this._x0=n,this._y0=r,this._x1=i,this._y1=a}return this},ho.data=function(){var e=[];return this.visit(function(t){if(!t.length)for(;e.push(t.data),t=t.next;);}),e},ho.extent=function(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]},ho.find=function(t,e,n){var r,i,a,o,s,l,c,u,f=this._x0,h=this._y0,d=this._x1,p=this._y1,g=[],m=this._root;for(m&&g.push(new vf(m,f,h,d,p)),null==n?n=1/0:(f=t-n,h=e-n,d=t+n,p=e+n,n*=n);r=g.pop();)!(m=r.node)||(s=r.x0)>d||(l=r.y0)>p||(o=r.x1)<f||(i=r.y1)<h||(m.length?(g.push(new vf(m[3],a=(s+o)/2,c=(l+i)/2,o,i),new vf(m[2],s,c,a,i),new vf(m[1],a,l,o,c),new vf(m[0],s,l,a,c)),(i=(c<=e)<<1|a<=t)&&(r=g[g.length-1],g[g.length-1]=g[g.length-1-i],g[g.length-1-i]=r)):(l=(o=t-+this._x.call(null,m.data))*o+(s=e-+this._y.call(null,m.data))*s)<n&&(f=t-(c=Math.sqrt(n=l)),h=e-c,d=t+c,p=e+c,u=m.data));return u},ho.remove=function(t){if(!isNaN(a=+this._x.call(null,t))&&!isNaN(o=+this._y.call(null,t))){var e,n,r,i,a,o,s,l,c,u,f,h=this._root,d=this._x0,p=this._y0,g=this._x1,m=this._y1;if(h){if(h.length)for(;;){if((l=a>=(s=(d+g)/2))?d=s:g=s,(c=o>=(s=(p+m)/2))?p=s:m=s,!(h=(e=h)[u=c<<1|l]))return this;if(!h.length)break;(e[u+1&3]||e[u+2&3]||e[u+3&3])&&(n=e,f=u)}for(;h.data!==t;)if(!(h=(r=h).next))return this;(i=h.next)&&delete h.next,r?i?r.next=i:delete r.next:e?(i?e[u]=i:delete e[u],(h=e[0]||e[1]||e[2]||e[3])&&h===(e[3]||e[2]||e[1]||e[0])&&!h.length&&(n?n[f]=h:this._root=h)):this._root=i}}return this},ho.removeAll=function(t){for(var e=0,n=t.length;e<n;++e)this.remove(t[e]);return this},ho.root=function(){return this._root},ho.size=function(){var e=0;return this.visit(function(t){if(!t.length)for(;++e,t=t.next;);}),e},ho.visit=function(t){var e,n,r,i,a,o,s,l=[],c=this._root;for(c&&l.push(new vf(c,this._x0,this._y0,this._x1,this._y1));a=l.pop();)!t(c=a.node,n=a.x0,r=a.y0,i=a.x1,a=a.y1)&&c.length&&(o=(n+i)/2,s=(r+a)/2,(e=c[3])&&l.push(new vf(e,o,s,i,a)),(e=c[2])&&l.push(new vf(e,n,s,o,a)),(e=c[1])&&l.push(new vf(e,o,r,i,s)),e=c[0])&&l.push(new vf(e,n,r,o,s));return this},ho.visitAfter=function(t){var e,n=[],r=[];for(this._root&&n.push(new vf(this._root,this._x0,this._y0,this._x1,this._y1));e=n.pop();){var i,a,o,s,l,c,u,f=e.node;f.length&&(a=e.x0,o=e.y0,c=(a+(s=e.x1))/2,u=(o+(l=e.y1))/2,(i=f[0])&&n.push(new vf(i,a,o,c,u)),(i=f[1])&&n.push(new vf(i,c,o,s,u)),(i=f[2])&&n.push(new vf(i,a,u,c,l)),i=f[3])&&n.push(new vf(i,c,u,s,l)),r.push(e)}for(;e=r.pop();)t(e.node,e.x0,e.y0,e.x1,e.y1);return this},ho.x=function(t){return arguments.length?(this._x=t,this):this._x},ho.y=function(t){return arguments.length?(this._y=t,this):this._y};var Lf={value:()=>{}};function Tf(){for(var t,e=0,n=arguments.length,r={};e<n;++e){if(!(t=arguments[e]+"")||t in r||/[\s.]/.test(t))throw new Error("illegal type: "+t);r[t]=[]}return new jf(r)}function jf(t){this._=t}function Nf(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=Lf,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=n&&t.push({name:e,value:n}),t}jf.prototype=Tf.prototype={constructor:jf,on:function(t,e){var n,r,i=this._,a=(r=i,(t+"").trim().split(/^|\s+/).map(function(t){var e="",n=t.indexOf(".");if(0<=n&&(e=t.slice(n+1),t=t.slice(0,n)),t&&!r.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}})),o=-1,s=a.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++o<s;)if(n=(t=a[o]).type)i[n]=Nf(i[n],t.name,e);else if(null==e)for(n in i)i[n]=Nf(i[n],t.name,null);return this}for(;++o<s;)if(n=(n=(t=a[o]).type)&&function(t,e){for(var n,r=0,i=t.length;r<i;++r)if((n=t[r]).name===e)return n.value}(i[n],t.name))return n},copy:function(){var t,e={},n=this._;for(t in n)e[t]=n[t].slice();return new jf(e)},call:function(t,e){if(0<(n=arguments.length-2))for(var n,r,i=new Array(n),a=0;a<n;++a)i[a]=arguments[a+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(a=0,n=(r=this._[t]).length;a<n;++a)r[a].value.apply(e,i)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,a=r.length;i<a;++i)r[i].value.apply(e,n)}};var Pf,Cf,Rf=0,If=0,Bf=0,Ff=1e3,Df=0,zf=0,Wf=0,Gf="object"==typeof performance&&performance.now?performance:Date,qf="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Hf(){return zf||(qf(Vf),zf=Gf.now()+Wf)}function Vf(){zf=0}function Yf(){this._call=this._time=this._next=null}function $f(t,e,n){var r=new Yf;return r.restart(t,e,n),r}function Uf(){zf=(Df=Gf.now())+Wf,Rf=If=0;try{Hf(),++Rf;for(var t,e=Pf;e;)0<=(t=zf-e._time)&&e._call.call(void 0,t),e=e._next;--Rf}finally{for(var n,r,i=Pf,a=1/(Rf=0);i;)i=i._call?(a>i._time&&(a=i._time),(n=i)._next):(r=i._next,i._next=null,n?n._next=r:Pf=r);Cf=n,Xf(a),zf=0}}function Kf(){var t=Gf.now(),e=t-Df;Ff<e&&(Wf-=e,Df=t)}function Xf(t){Rf||(If=If&&clearTimeout(If),24<t-zf?(t<1/0&&(If=setTimeout(Uf,t-Gf.now()-Wf)),Bf=Bf&&clearInterval(Bf)):(Bf||(Df=Gf.now(),Bf=setInterval(Kf,Ff)),Rf=1,qf(Uf)))}Yf.prototype=$f.prototype={constructor:Yf,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?Hf():+n)+(null==e?0:+e),this._next||Cf===this||(Cf?Cf._next=this:Pf=this,Cf=this),this._call=t,this._time=n,Xf()},stop:function(){this._call&&(this._call=null,this._time=1/0,Xf())}};const Zf=4294967296;function Qf(t){return t.x}function Jf(t){return t.y}var th=10,eh=Math.PI*(3-Math.sqrt(5));function nh(l){var a,o=1,e=.001,s=1-Math.pow(e,1/300),c=0,u=.6,f=new Map,t=$f(i),n=Tf("tick","end"),r=function(){let t=1;return()=>(t=(1664525*t+1013904223)%Zf)/Zf}();function i(){h(),n.call("tick",a),o<e&&(t.stop(),n.call("end",a))}function h(t){var e,n,r=l.length;void 0===t&&(t=1);for(var i=0;i<t;++i)for(o+=(c-o)*s,f.forEach(function(t){t(o)}),e=0;e<r;++e)null==(n=l[e]).fx?n.x+=n.vx*=u:(n.x=n.fx,n.vx=0),null==n.fy?n.y+=n.vy*=u:(n.y=n.fy,n.vy=0);return a}function d(){for(var t,e,n,r=0,i=l.length;r<i;++r)(n=l[r]).index=r,null!=n.fx&&(n.x=n.fx),null!=n.fy&&(n.y=n.fy),(isNaN(n.x)||isNaN(n.y))&&(t=th*Math.sqrt(.5+r),e=r*eh,n.x=t*Math.cos(e),n.y=t*Math.sin(e)),(isNaN(n.vx)||isNaN(n.vy))&&(n.vx=n.vy=0)}function p(t){return t.initialize&&t.initialize(l,r),t}return null==l&&(l=[]),d(),a={tick:h,restart:function(){return t.restart(i),a},stop:function(){return t.stop(),a},nodes:function(t){return arguments.length?(l=t,d(),f.forEach(p),a):l},alpha:function(t){return arguments.length?(o=+t,a):o},alphaMin:function(t){return arguments.length?(e=+t,a):e},alphaDecay:function(t){return arguments.length?(s=+t,a):+s},alphaTarget:function(t){return arguments.length?(c=+t,a):c},velocityDecay:function(t){return arguments.length?(u=1-t,a):1-u},randomSource:function(t){return arguments.length?(r=t,f.forEach(p),a):r},force:function(t,e){return 1<arguments.length?(null==e?f.delete(t):f.set(t,p(e)),a):f.get(t)},find:function(t,e,n){var r,i,a,o=0,s=l.length;for(null==n?n=1/0:n*=n,o=0;o<s;++o)(r=(r=t-(i=l[o]).x)*r+(r=e-i.y)*r)<n&&(a=i,n=r);return a},on:function(t,e){return 1<arguments.length?(n.on(t,e),a):n.on(t)}}}function rh(t,e,n){var i,l,c,u,f,r,h,d,p,{nodes:t,links:a}=t,{joint:e,nodeStrength:o,linkStrength:s}=e,{linkKey:n=t=>t.id}=n,I=(r=kf(-30),d=(h=1)/0,p=.81,g.initialize=function(t,e){i=t,c=e,B()},g.strength=function(t){return arguments.length?(r="function"==typeof t?t:kf(+t),B(),g):r},g.distanceMin=function(t){return arguments.length?(h=t*t,g):Math.sqrt(h)},g.distanceMax=function(t){return arguments.length?(d=t*t,g):Math.sqrt(d)},g.theta=function(t){return arguments.length?(p=t*t,g):Math.sqrt(p)},g);function g(t){var e,n=i.length,r=wf(i,Qf,Jf).visitAfter(F);for(u=t,e=0;e<n;++e)l=i[e],r.visit(D)}function B(){if(i){var t,e,n=i.length;for(f=new Array(n),t=0;t<n;++t)e=i[t],f[e.index]=+r(e,t,i)}}function F(t){var e,n,r,i,a,o=0,s=0;if(t.length){for(r=i=a=0;a<4;++a)(e=t[a])&&(n=Math.abs(e.value))&&(o+=e.value,s+=n,r+=n*e.x,i+=n*e.y);t.x=r/s,t.y=i/s}else for((e=t).x=e.data.x,e.y=e.data.y;o+=f[e.data.index],e=e.next;);t.value=o}function D(t,e,n,r){if(!t.value)return!0;var i=t.x-l.x,a=t.y-l.y,o=r-e,s=i*i+a*a;if(o*o/p<s)return s<d&&(0===i&&(s+=(i=_f(c))*i),0===a&&(s+=(a=_f(c))*a),s<h&&(s=Math.sqrt(h*s)),l.vx+=i*t.value*u/s,l.vy+=a*t.value*u/s),!0;if(!(t.length||d<=s))for((t.data!==l||t.next)&&(0===i&&(s+=(i=_f(c))*i),0===a&&(s+=(a=_f(c))*a),s<h)&&(s=Math.sqrt(h*s));t.data!==l&&(o=f[t.data.index]*u/s,l.vx+=i*o,l.vy+=a*o),t=t.next;);}var m,y,v,b,x,w,M,O,k,_,E,S,A,L,n=Af(a).id(Jl(n)),T=("function"==typeof o&&I.strength(o),"function"==typeof s&&n.strength(s),nh(t).force("link",n).force("charge",I));function j(t){for(var e,n=0,r=y.length;n<r;++n)(e=y[n]).vy+=(b[n]-e.y)*v[n]*t}function N(){if(y){var t,e=y.length;for(v=new Array(e),b=new Array(e),t=0;t<e;++t)v[t]=isNaN(b[t]=+m(y[t],t,y))?0:+x(y[t],t,y)}}function P(t){for(var e,n=0,r=M.length;n<r;++n)(e=M[n]).vx+=(k[n]-e.x)*O[n]*t}function C(){if(M){var t,e=M.length;for(O=new Array(e),k=new Array(e),t=0;t<e;++t)O[t]=isNaN(k[t]=+w(M[t],t,M))?0:+_(M[t],t,M)}}function R(){for(var t,e=A.length,n=0,r=0,i=0;i<e;++i)n+=(t=A[i]).x,r+=t.y;for(n=(n/e-E)*L,r=(r/e-S)*L,i=0;i<e;++i)(t=A[i]).x-=n,t.y-=r}e?T.force("center",(L=1,null==E&&(E=0),null==S&&(S=0),R.initialize=function(t){A=t},R.x=function(t){return arguments.length?(E=+t,R):E},R.y=function(t){return arguments.length?(S=+t,R):S},R.strength=function(t){return arguments.length?(L=+t,R):L},R)):T.force("x",(_=kf(.1),"function"!=typeof w&&(w=kf(null==w?0:+w)),P.initialize=function(t){M=t,C()},P.strength=function(t){return arguments.length?(_="function"==typeof t?t:kf(+t),C(),P):_},P.x=function(t){return arguments.length?(w="function"==typeof t?t:kf(+t),C(),P):w},P)).force("y",(x=kf(.1),"function"!=typeof m&&(m=kf(null==m?0:+m)),j.initialize=function(t){y=t,N()},j.strength=function(t){return arguments.length?(x="function"==typeof t?t:kf(+t),N(),j):x},j.y=function(t){return arguments.length?(m="function"==typeof t?t:kf(+t),N(),j):m},j)),T.stop();var z=Math.ceil(Math.log(T.alphaMin())/Math.log(1-T.alphaDecay()));for(let t=0;t<z;t++)T.tick();return{nodesData:t,linksData:a}}const ih=g=>()=>{var{data:t,encode:e={},scale:n,style:r={},layout:i={},nodeLabels:a=[],linkLabels:o=[],animate:s={},tooltip:l={}}=g;const{nodeKey:c=t=>t.id,linkKey:u=t=>t.id}=e,f=rt(e,["nodeKey","linkKey"]);var e=Object.assign({nodeKey:c,linkKey:u},f),h=at(e,"node"),d=at(e,"link"),{links:t,nodes:p}=ec(t,e),{nodesData:t,linksData:p}=rh({links:t,nodes:p},it({},{joint:!0},i),e),i=Ku(l,"link",{items:[t=>({name:"source",value:Jl(u)(t.source)}),t=>({name:"target",value:Jl(u)(t.target)})]}),e=Ku(l,"node",{items:[t=>({name:"key",value:Jl(c)(t)})]},!0);return[it({},{type:"link",axis:!1,legend:!1,encode:{x:[t=>t.source.x,t=>t.target.x],y:[t=>t.source.y,t=>t.target.y]},style:{stroke:"#999",strokeOpacity:.6}},{data:p,encode:d,labels:o,style:at(r,"link"),tooltip:i,animate:Qu(s,"link")}),it({},{type:"point",axis:!1,legend:!1,encode:{x:"x",y:"y",size:5,color:"group",shape:"point"},scale:{color:{type:"ordinal"}},style:{stroke:"#fff"}},{data:t,encode:Object.assign({},h),scale:n,style:at(r,"node"),tooltip:e,labels:[Object.assign(Object.assign({},{text:""}),at(r,"label")),...a],animate:Qu(s,"link")})]},ah=(ih.props={},f=>u=>t=>{const{field:e="value",nodeSize:n,separation:r,sortBy:i,as:a=["x","y"]}=u,[o,s]=a;var t=Us(t,t=>t.children).sum(t=>t[e]).sort(i),l=f();l.size([1,1]),n&&l.nodeSize(n),r&&l.separation(r),l(t);const c=[];t.each(t=>{t[o]=t.x,t[s]=t.y,t.name=t.data.name,c.push(t)});l=t.links();return l.forEach(t=>{t[o]=[t.source[o],t.target[o]],t[s]=[t.source[s],t.target[s]]}),{nodes:c,edges:l}}),oh=t=>ah(Ys)(t),sh=(oh.props={},t=>ah(Rl)(t)),lh=(sh.props={},u=>{const f={sortBy:(t,e)=>e.value-t.value},h={axis:!1,legend:!1,type:"point",encode:{x:"x",y:"y",size:2,shape:"point"}},d={type:"link",encode:{x:"x",y:"y",shape:"smooth"}},p={text:"",fontSize:10};return()=>{var{data:t,encode:e={},scale:n={},style:r={},layout:i={},nodeLabels:a=[],linkLabels:o=[],animate:s={},tooltip:l={}}=u,c=null==e?void 0:e.value,{nodes:i,edges:c}=sh(Object.assign(Object.assign(Object.assign({},f),i),{field:c}))(t),t=Ku(l,"node",{title:"name",items:["value"]},!0),l=Ku(l,"link",{title:"",items:[t=>({name:"source",value:t.source.name}),t=>({name:"target",value:t.target.name})]});return[it({},d,{data:c,encode:at(e,"link"),scale:at(n,"link"),labels:o,style:Object.assign({stroke:"#999"},at(r,"link")),tooltip:l,animate:Qu(s,"link")}),it({},h,{data:i,scale:at(n,"node"),encode:at(e,"node"),labels:[Object.assign(Object.assign({},p),at(r,"label")),...a],style:Object.assign({},at(r,"node")),tooltip:t,animate:Qu(s,"node")})]}});lh.props={};var ch={},uh={},fh=34,hh=10,dh=13;function ph(t){return new Function("d","return {"+t.map(function(t,e){return JSON.stringify(t)+": d["+e+'] || ""'}).join(",")+"}")}function gh(t){var n=Object.create(null),r=[];return t.forEach(function(t){for(var e in t)e in n||r.push(n[e]=e)}),r}function mh(t,e){var t=t+"",n=t.length;return n<e?new Array(e-n+1).join(0)+t:t}function yh(t){var e,n=t.getUTCHours(),r=t.getUTCMinutes(),i=t.getUTCSeconds(),a=t.getUTCMilliseconds();return isNaN(t)?"Invalid Date":((e=t.getUTCFullYear())<0?"-"+mh(-e,6):9999<e?"+"+mh(e,6):mh(e,4))+"-"+mh(t.getUTCMonth()+1,2)+"-"+mh(t.getUTCDate(),2)+(a?"T"+mh(n,2)+":"+mh(r,2)+":"+mh(i,2)+"."+mh(a,3)+"Z":i?"T"+mh(n,2)+":"+mh(r,2)+":"+mh(i,2)+"Z":r||n?"T"+mh(n,2)+":"+mh(r,2)+"Z":"")}function vh(r){var e=new RegExp('["'+r+"\n\r]"),f=r.charCodeAt(0);function n(r,t){var e,n=[],i=r.length,a=0,o=0,s=i<=0,l=!1;function c(){if(s)return uh;if(l)return l=!1,ch;var t,e,n=a;if(r.charCodeAt(n)===fh){for(;a++<i&&r.charCodeAt(a)!==fh||r.charCodeAt(++a)===fh;);return(t=a)>=i?s=!0:(e=r.charCodeAt(a++))===hh?l=!0:e===dh&&(l=!0,r.charCodeAt(a)===hh)&&++a,r.slice(n+1,t-1).replace(/""/g,'"')}for(;a<i;){if((e=r.charCodeAt(t=a++))===hh)l=!0;else if(e===dh)l=!0,r.charCodeAt(a)===hh&&++a;else if(e!==f)continue;return r.slice(n,t)}return s=!0,r.slice(n,i)}for(r.charCodeAt(i-1)===hh&&--i,r.charCodeAt(i-1)===dh&&--i;(e=c())!==uh;){for(var u=[];e!==ch&&e!==uh;)u.push(e),e=c();t&&null==(u=t(u,o++))||n.push(u)}return n}function i(t,n){return t.map(function(e){return n.map(function(t){return o(e[t])}).join(r)})}function a(t){return t.map(o).join(r)}function o(t){return null==t?"":t instanceof Date?yh(t):e.test(t+="")?'"'+t.replace(/"/g,'""')+'"':t}return{parse:function(t,a){var o,s;return(t=n(t,function(t,e){if(o)return o(t,e-1);var n,r,i;s=t,o=a?(r=a,i=ph(n=t),function(t,e){return r(i(t),e,n)}):ph(t)})).columns=s||[],t},parseRows:n,format:function(t,e){return[(e=null==e?gh(t):e).map(o).join(r)].concat(i(t,e)).join("\n")},formatBody:function(t,e){return i(t,e=null==e?gh(t):e).join("\n")},formatRows:function(t){return t.map(a).join("\n")},formatRow:a,formatValue:o}}function bh(t){for(var e in t){var n,r,i=t[e].trim();if(i)if("true"===i)i=!0;else if("false"===i)i=!1;else if("NaN"===i)i=NaN;else if(isNaN(n=+i)){if(!(r=i.match(/^([-+]\d{2})?\d{4}(-\d{2}(-\d{2})?)?(T\d{2}:\d{2}(:\d{2}(\.\d{3})?)?(Z|[-+]\d{2}:\d{2})?)?$/)))continue;xh&&r[4]&&!r[7]&&(i=i.replace(/-/g,"/").replace(/T/," ")),i=new Date(i)}else i=n;else i=null;t[e]=i}return t}const xh=new Date("2019-01-01T00:00").getHours()||new Date("2019-07-01T00:00").getHours(),wh=t=>{const{value:n,format:r=n.split(".").pop(),delimiter:i=",",autoType:a=!0}=t;return()=>ue(void 0,void 0,void 0,function*(){var t,e=yield fetch(n);if("csv"===r)return t=yield e.text(),vh(i).parse(t,a?bh:Du);if("json"===r)return yield e.json();throw new Error(`Unknown format: ${r}.`)})};wh.props={};const Mh=t=>{const{fields:n,key:r="key",value:i="value"}=t;return t=>{var e;return(e=n)&&0!==Object.keys(e).length?t.flatMap(e=>n.map(t=>Object.assign(Object.assign({},e),{[r]:t,[i]:e[t]}))):t}};Mh.props={};const Oh=t=>{const{callback:e=function(t){return null!=t&&!Number.isNaN(t)}}=t;return t=>t.filter(e)},kh=(Oh.props={},t=>{const e=t["callback"];return t=>Array.isArray(t)?[...t].sort(e):t});kh.props={};const _h=t=>{const e=t["fields"];return t=>t.map(t=>{return[n,t=[]]=[t,e],t.reduce((t,e)=>(e in n&&(t[e]=n[e]),t),{});var n})};_h.props={};const Eh=r=>t=>{return r&&0!==Object.keys(r).length?t.map(t=>Object.entries(t).reduce((t,[e,n])=>(t[r[e]||e]=n,t),{})):t};Eh.props={};const Sh=t=>{var r,{fields:t=[]}=t;r=!0;const e=t.map(t=>{var e,n;return Array.isArray(t)?([e,n=r]=t,[e,n]):[t,r]});return t=>{return[...t].sort((r,i)=>e.reduce((t,[e,n=!0])=>0!==t?t:n?r[e]<i[e]?-1:+(r[e]!==i[e]):r[e]>i[e]?-1:+(r[e]!==i[e]),0))}},Ah=(Sh.props={},t=>{const e=t["value"];return()=>e}),Lh=(Ah.props={},t=>{const{callback:e=Du}=t;return t=>e(t)}),Th=(Lh.props={},t=>{const{callback:e=Du}=t;return t=>Array.isArray(t)?t.map(e):t});Th.props={};var jh=Object.freeze({__proto__:null,weight:function(t,e){return e.value-t.value},frequency:function(t,e){return e.frequency-t.frequency},id:function(t,e){return(""+t.id).localeCompare(""+e.id)},name:function(t,e){return(""+t.name).localeCompare(""+e.name)}});const Nh={y:0,thickness:.05,weight:!1,marginRatio:.1,id:t=>t.id,source:t=>t.source,target:t=>t.target,sourceWeight:t=>t.value||1,targetWeight:t=>t.value||1,sortBy:null};function Ph(t){const{y:c,thickness:u,weight:f,marginRatio:h,id:d,source:p,target:g,sourceWeight:m,targetWeight:y,sortBy:v}=Object.assign(Object.assign({},Nh),t);return function(t){var e=t.nodes.map(t=>Object.assign({},t)),t=t.edges.map(t=>Object.assign({},t));{var n=e,r=t;r.forEach(t=>{t.source=p(t),t.target=g(t),t.sourceWeight=m(t),t.targetWeight=y(t)});const i=bc(r,t=>t.source),a=bc(r,t=>t.target);n.forEach(t=>{t.id=d(t);var e=i.has(t.id)?i.get(t.id):[],n=a.has(t.id)?a.get(t.id):[];t.frequency=e.length+n.length,t.value=$c(e,t=>t.sourceWeight)+$c(n,t=>t.targetWeight)})}if(r=e,(n="function"==typeof v?v:jh[v])&&r.sort(n),!(n=(r=e).length))throw Wu("Invalid nodes: it's empty!");if(f){const o=h/(2*n),s=r.reduce((t,e)=>t+e.value,0);r.reduce((t,e)=>{e.weight=e.value/s,e.width=e.weight*(1-h),e.height=u;var n=o+t,r=n+e.width,i=c-u/2,a=i+u;return e.x=[n,r,r,n],e.y=[i,i,a,a],t+e.width+2*o},0)}else{const l=1/n;r.forEach((t,e)=>{t.x=(e+.5)*l,t.y=c})}return function(t,e){const r=new Map(t.map(t=>[t.id,t]));if(!f)return e.forEach(t=>{var e=p(t),n=g(t),e=r.get(e),n=r.get(n);e&&n&&(t.x=[e.x,n.x],t.y=[e.y,n.y])});e.forEach(t=>{t.x=[0,0,0,0],t.y=[c,c,c,c]});const s=bc(e,t=>t.source),l=bc(e,t=>t.target);t.forEach(n=>{const{width:r,value:i,id:t}=n;var e=s.get(t)||[],a=l.get(t)||[];let o=0;e.map(t=>{var e=t.sourceWeight/i*r;t.x[0]=n.x[0]+o,t.x[1]=n.x[0]+o+e,o+=e}),a.forEach(t=>{var e=t.targetWeight/i*r;t.x[3]=n.x[0]+o,t.x[2]=n.x[0]+o+e,o+=e})})}(e,t),{nodes:e,edges:t}}}const Ch=e=>t=>Ph(e)(t),Rh=(Ch.props={},Math.PI/180),Ih=64,Bh=2048;function Fh(t){return t.text}function Dh(){return"serif"}function zh(){return"normal"}function Wh(t){return t.value}function Gh(){return 90*~~(2*Math.random())}function qh(){return 1}function Hh(){}function Vh(t,o,r,s){if(!o.sprite){var l=t.context,c=t.ratio;l.clearRect(0,0,(Ih<<5)/c,Bh/c);let i=0,a=0,n=0;var u,f,h,d,e=r.length;for(--s;++s<e;){o=r[s],l.save(),l.font=o.style+" "+o.weight+" "+~~((o.size+1)/c)+"px "+o.font;let t=l.measureText(o.text+"m").width*c,e=o.size<<1;if(o.rotate?(d=Math.sin(o.rotate*Rh),h=Math.cos(o.rotate*Rh),u=t*h,f=t*d,h=e*h,d=e*d,t=Math.max(Math.abs(u+d),Math.abs(u-d))+31>>5<<5,e=~~Math.max(Math.abs(f+h),Math.abs(f-h))):t=t+31>>5<<5,e>n&&(n=e),i+t>=Ih<<5&&(i=0,a+=n,n=0),a+e>=Bh)break;l.translate((i+(t>>1))/c,(a+(e>>1))/c),o.rotate&&l.rotate(o.rotate*Rh),l.fillText(o.text,0,0),o.padding&&(l.lineWidth=2*o.padding,l.strokeText(o.text,0,0)),l.restore(),o.width=t,o.height=e,o.xoff=i,o.yoff=a,o.x1=t>>1,o.y1=e>>1,o.x0=-o.x1,o.y0=-o.y1,o.hasText=!0,i+=t}for(var p=l.getImageData(0,0,(Ih<<5)/c,Bh/c).data,g=[];0<=--s;)if((o=r[s]).hasText){var m=o.width,y=m>>5;let n=o.y1-o.y0;for(let t=0;t<n*y;t++)g[t]=0;if(null==(i=o.xoff))return;a=o.yoff;let r=0,t=-1;for(let e=0;e<n;e++){for(let t=0;t<m;t++){var v=y*e+(t>>5),b=p[(a+e)*(Ih<<5)+(i+t)<<2]?1<<31-t%32:0;g[v]|=b,r|=b}r?t=e:(o.y0++,n--,e--,a++)}o.y1=o.y0+t,o.sprite=g.slice(0,(o.y1-o.y0)*y)}}}function Yh(t){const e=t[0]/t[1];return function(t){return[e*(t*=.1)*Math.cos(t),t*Math.sin(t)]}}function $h(t){var e=[];let n=-1;for(;++n<t;)e[n]=0;return e}function Uh(){return document.createElement("canvas")}function Kh(t){return"function"==typeof t?t:function(){return t}}const Xh={archimedean:Yh,rectangular:function(t){const n=4*t[0]/t[1];let r=0,i=0;return function(t){var e=t<0?-1:1;switch(Math.sqrt(1+4*e*t)-e&3){case 0:r+=n;break;case 1:i+=4;break;case 2:r-=n;break;default:i-=4}return[r,i]}}};function Zh(){let b=[256,256],r=Fh,i=Dh,p=Wh,g=zh,m=Gh,y=qh,x=Yh,w=Math.random,v=Hh,M=[],O=null,k=1/0;const _=zh,E=Uh,S={};return S.start=function(){const[a,o]=b,s=((t=E()).width=t.height=1,e=Math.sqrt(t.getContext("2d").getImageData(0,0,1,1).data.length>>2),t.width=(Ih<<5)/e,t.height=Bh/e,(t=t.getContext("2d")).fillStyle=t.strokeStyle="red",t.textAlign="center",{context:t,ratio:e}),l=S.board||$h((b[0]>>5)*b[1]),c=M.length,u=[],f=M.map(function(t,e,n){return t.text=r.call(this,t,e,n),t.font=i.call(this,t,e,n),t.style=_.call(this,t,e,n),t.weight=g.call(this,t,e,n),t.rotate=m.call(this,t,e,n),t.size=~~p.call(this,t,e,n),t.padding=y.call(this,t,e,n),t}).sort(function(t,e){return e.size-t.size});var t,e;let h=-1,d=S.board?[{x:0,y:0},{x:a,y:o}]:void 0;function n(){for(var t,e,n,r=Date.now();Date.now()-r<k&&++h<c;){var i=f[h];i.x=a*(w()+.5)>>1,i.y=o*(w()+.5)>>1,Vh(s,i,f,h),i.hasText&&function(i,t,e){var n=t.x,r=t.y,a=Math.sqrt(b[0]*b[0]+b[1]*b[1]),o=x(b),s=w()<.5?1:-1;let l,c=-s,u,f;for(;(l=o(c+=s))&&(u=~~l[0],f=~~l[1],!(Math.min(Math.abs(u),Math.abs(f))>=a));)if(t.x=n+u,t.y=r+f,!(t.x+t.x0<0||t.y+t.y0<0||t.x+t.x1>b[0]||t.y+t.y1>b[1])&&(!e||!function(t,n,r){var i=t.sprite,a=t.width>>5,e=t.x-(a<<4),o=127&e,s=32-o,l=t.y1-t.y0;let c=(t.y+t.y0)*(r>>=5)+(e>>5),u;for(let e=0;e<l;e++){for(let t=u=0;t<=a;t++)if((u<<s|(t<a?(u=i[e*a+t])>>>o:0))&n[c+t])return 1;c+=r}}(t,i,b[0]))&&(!e||function(t,e){return t.x+t.x1>e[0].x&&t.x+t.x0<e[1].x&&t.y+t.y1>e[0].y&&t.y+t.y0<e[1].y}(t,e))){var h=t.sprite,d=t.width>>5,p=b[0]>>5,g=t.x-(d<<4),m=127&g,y=32-m,v=t.y1-t.y0;let n,r=(t.y+t.y0)*p+(g>>5);for(let e=0;e<v;e++){for(let t=n=0;t<=d;t++)i[r+t]|=n<<y|(t<d?(n=h[e*d+t])>>>m:0);r+=p}return delete t.sprite,1}return}(l,i,d)&&(v.call(null,"word",{cloud:S,word:i}),u.push(i),d?S.hasImage||(t=d,e=i,n=void 0,n=t[0],t=t[1],e.x+e.x0<n.x&&(n.x=e.x+e.x0),e.y+e.y0<n.y&&(n.y=e.y+e.y0),e.x+e.x1>t.x&&(t.x=e.x+e.x1),e.y+e.y1>t.y&&(t.y=e.y+e.y1)):d=[{x:i.x+i.x0,y:i.y+i.y0},{x:i.x+i.x1,y:i.y+i.y1}],i.x-=b[0]>>1,i.y-=b[1]>>1)}S._tags=u,S._bounds=d,h>=c&&(S.stop(),v.call(null,"end",{cloud:S,words:u,bounds:d}))}return O&&clearInterval(O),O=setInterval(n,0),n(),S},S.stop=function(){return O&&(clearInterval(O),O=null),S},S.createMask=t=>{var e=document.createElement("canvas"),[n,r]=b;if(n&&r){var i=n>>5,a=$h((n>>5)*r),e=(e.width=n,e.height=r,e.getContext("2d")),o=(e.drawImage(t,0,0,t.width,t.height,0,0,n,r),e.getImageData(0,0,n,r).data);for(let e=0;e<r;e++)for(let t=0;t<n;t++){var s=i*e+(t>>5),l=e*n+t<<2,l=250<=o[l]&&250<=o[1+l]&&250<=o[2+l]?1<<31-t%32:0;a[s]|=l}S.board=a,S.hasImage=!0}},S.timeInterval=function(t){k=null==t?1/0:t},S.words=function(t){M=t},S.size=function(t=[]){b=[+t[0],+t[1]]},S.text=function(t){r=Kh(t)},S.font=function(t){i=Kh(t)},S.fontWeight=function(t){g=Kh(t)},S.rotate=function(t){m=Kh(t)},S.spiral=function(t){x=Xh[t]||t},S.fontSize=function(t){p=Kh(t)},S.padding=function(t){y=Kh(t)},S.random=function(t){w=Kh(t)},S.on=function(t){v=Kh(t)},S}const Qh={size:[500,500],fontSize:[14,28]};function Jh(r){return new Promise((t,e)=>{if(r instanceof HTMLImageElement)t(r);else if("string"==typeof r){const n=new Image;n.crossOrigin="anonymous",n.src=r,n.onload=()=>t(n),void(n.onerror=()=>{console.error(`'image ${r} load failed !!!'`),e()})}else e()})}const td=h=>f=>ue(void 0,void 0,void 0,function*(){var i,a,t=Object.assign({},Qh,h),e=Zh(),e=(i=e,a=t,yield{set(t,e,n){return void 0!==a[t]&&(e=e?e.call(null,a[t]):a[t],n?n.call(null,e):"function"==typeof i[t]?i[t](e):i[t]=e),this},setAsync(e,n,r){return ue(this,void 0,void 0,function*(){var t;return void 0!==a[e]&&(t=n?yield n.call(null,a[e]):a[e],r?r.call(null,t):"function"==typeof i[e]?i[e](t):i[e]=t),this})}}.set("fontSize",t=>{var e=f.map(t=>t.value),n=t,t=[Bc(e),Rc(e)];if("function"==typeof n)return n;if(Array.isArray(n)){const[r,i]=n;if(!t)return()=>(i+r)/2;const[a,o]=t;return o===a?()=>(i+r)/2:({value:t})=>(i-r)/(o-a)*(t-a)+r}return()=>n}).set("font").set("fontStyle").set("fontWeight").set("padding").set("rotate").set("size").set("spiral").set("timeInterval").set("random").set("text").set("on").setAsync("imageMask",Jh,e.createMask),e.words([...f]),e.start());const[r,o]=t.size;var t=[{x:0,y:0},{x:r,y:o}],{_bounds:e=t,_tags:t,hasImage:n}=e,t=t.map(t=>{var{x:e,y:n}=t,t=rt(t,["x","y"]);return Object.assign(Object.assign({},t),{x:e+r/2,y:n+o/2})}),[{x:e,y:s},{x:l,y:c}]=e,u={text:"",value:0,opacity:0,fontSize:0};return t.push(Object.assign(Object.assign({},u),{x:n?0:e,y:n?0:s}),Object.assign(Object.assign({},u),{x:n?r:l,y:n?o:c})),t});function ed(e){return"string"==typeof e?t=>t[e]:e}td.props={};const nd=t=>{const{join:e,on:n,select:i=[],as:a=i,unknown:o=NaN}=t;var[t,r]=n;const s=ed(r),l=ed(t),c=xc(e,([t])=>t,t=>s(t));return t=>t.map(t=>{const r=c.get(l(t));return Object.assign(Object.assign({},t),i.reduce((t,e,n)=>(t[a[n]]=r?r[e]:o,t),{}))})},rd=(nd.props={},t=>{const{start:e,end:n}=t;return t=>t.slice(e,n)});rd.props={};var id,ad,od,sd,yo={exports:{}},r={exports:{}};function ld(t){return 1-Math.abs(t)}id=(n=r).exports,n.exports.isNumber=function(t){return"number"==typeof t},n.exports.findMin=function(t){if(0===t.length)return 1/0;for(var e=t[0],n=1;n<t.length;n++)e=Math.min(e,t[n]);return e},n.exports.findMax=function(t){if(0===t.length)return-1/0;for(var e=t[0],n=1;n<t.length;n++)e=Math.max(e,t[n]);return e},n.exports.findMinMulti=function(t){for(var e=id.findMin(t[0]),n=1;n<t.length;n++)e=Math.min(e,id.findMin(t[n]));return e},n.exports.findMaxMulti=function(t){for(var e=id.findMax(t[0]),n=1;n<t.length;n++)e=Math.max(e,id.findMax(t[n]));return e},n.exports.inside=function(t,e,n){return t<=n&&n<=e},rs=yo,ad=Math.log(2),od=rs.exports,sd=r.exports,rs.exports.getUnifiedMinMax=function(t,e){return od.getUnifiedMinMaxMulti([t],e)},rs.exports.getUnifiedMinMaxMulti=function(t,e){var n=!1,r=!1,i=sd.isNumber((e=e||{}).width)?e.width:2,a=sd.isNumber(e.size)?e.size:50,o=sd.isNumber(e.min)?e.min:(n=!0,sd.findMinMulti(t)),e=sd.isNumber(e.max)?e.max:(r=!0,sd.findMaxMulti(t)),t=(e-o)/(a-1);return n&&(o-=2*i*t),r&&(e+=2*i*t),{min:o,max:e}},rs.exports.create=function(t,e){if(!t||0===t.length)return[];var n=sd.isNumber((e=e||{}).size)?e.size:50,o=sd.isNumber(e.width)?e.width:2,e=od.getUnifiedMinMax(t,{size:n,width:o,min:e.min,max:e.max}),s=e.min,e=e.max-s,l=e/(n-1);if(0==e)return[{x:s,y:1}];for(var c=[],r=0;r<n;r++)c.push({x:s+r*l,y:0});var u=function(t,e){for(var n={},r=0,i=-e;i<=e;i++)r+=t(i/e),n[i]=r;return n}(ld,o),f=u[o],h=u[o-1]-u[o-2],d=0,i=(t.forEach(function(t){var e,n,r,i,a,t=Math.floor((t-s)/l);t+o<0||c.length<=t-o||(r=Math.max(t-o,0),e=t,n=Math.min(t+o,c.length-1),i=u[-o-1+(r=r-(t-o))]||0,a=u[-o-1+(t+o-n)]||0,i=f/(f-i-a),0<r&&(d+=i*(r-1)*h),a=Math.max(0,t-o+1),sd.inside(0,c.length-1,a)&&(c[a].y+=i*h),sd.inside(0,c.length-1,e+1)&&(c[e+1].y-=2*i*h),sd.inside(0,c.length-1,n+1)&&(c[n+1].y+=i*h))}),d),a=0,p=0;return c.forEach(function(t){a+=t.y,i+=a,t.y=i,p+=i}),0<p&&c.forEach(function(t){t.y/=p}),c},rs.exports.getExpectedValueFromPdf=function(t){var e;if(t&&0!==t.length)return e=0,t.forEach(function(t){e+=t.x*t.y}),e},rs.exports.getXWithLeftTailArea=function(t,e){if(t&&0!==t.length){for(var n=0,r=0,i=0;i<t.length&&!(e<=(n+=t[r=i].y));i++);return t[r].x}},rs.exports.getPerplexity=function(t){var n;if(t&&0!==t.length)return n=0,t.forEach(function(t){var e=Math.log(t.y);isFinite(e)&&(n+=t.y*e)}),n=-n/ad,Math.pow(2,n)};var cd=yo.exports;const ud=t=>{const{field:r,groupBy:n,as:e=["y","size"],min:i,max:a,size:o=10,width:s}=t,[l,c]=e;return t=>{return Array.from(bc(t,e=>n.map(t=>e[t]).join("-")).values()).map(t=>{var e=cd.create(t.map(t=>t[r]),{min:i,max:a,size:o,width:s}),n=e.map(t=>t.x),e=e.map(t=>t.y);return Object.assign(Object.assign({},t[0]),{[l]:n,[c]:e})})}};ud.props={};var fd={exports:{}};function hd(t){for(var e=new Array(t),n=0;n<t;++n)e[n]=0;return e}function dd(t,e){for(var n=0,r=0;r<t.length;++r)n+=t[r]*e[r];return n}function pd(t){return Math.sqrt(dd(t,t))}function gd(t,e,n){for(var r=0;r<e.length;++r)t[r]=e[r]*n}function md(t,e,n,r,i){for(var a=0;a<t.length;++a)t[a]=e*n[a]+r*i[a]}function yd(i,a,o,s,l,c,u){var f=o.fx,h=dd(o.fxprime,a),d=f,t=f,p=h,e=0;function n(t,e,n){for(var r=0;r<16;++r)if(l=(t+e)/2,md(s.x,1,o.x,l,a),d=s.fx=i(s.x,s.fxprime),p=dd(s.fxprime,a),f+c*l*h<d||n<=d)e=l;else{if(Math.abs(p)<=-u*h)return l;0<=p*(e-t)&&(e=t),t=l,n=d}return 0}l=l||1,c=c||1e-6,u=u||.1;for(var r=0;r<10;++r){if(md(s.x,1,o.x,l,a),d=s.fx=i(s.x,s.fxprime),p=dd(s.fxprime,a),f+c*l*h<d||r&&t<=d)return n(e,l,t);if(Math.abs(p)<=-u*h)return l;if(0<=p)return n(l,e,d);t=d,e=l,l*=2}return l}(so=so=fd.exports).bisect=function(t,e,n,r){var i=(r=r||{}).maxIterations||100,a=r.tolerance||1e-10,o=t(e),r=t(n),s=n-e;if(0<o*r)throw"Initial bisect points must have opposite signs";if(0===o)return e;if(0===r)return n;for(var l=0;l<i;++l){var c=e+(s/=2),u=t(c);if(0<=u*o&&(e=c),Math.abs(s)<a||0===u)return c}return e+s},so.nelderMead=function(t,e,n){var r,i=(n=n||{}).maxIterations||200*e.length,a=n.nonZeroDelta||1.05,o=n.zeroDelta||.001,s=n.minErrorDelta||1e-6,l=n.minErrorDelta||1e-5,c=void 0!==n.rho?n.rho:1,u=void 0!==n.chi?n.chi:2,f=void 0!==n.psi?n.psi:-.5,h=void 0!==n.sigma?n.sigma:.5,d=e.length,p=new Array(d+1);p[0]=e,p[0].fx=t(e);for(var g=p[0].id=0;g<d;++g){var m=e.slice();m[g]=m[g]?m[g]*a:o,p[g+1]=m,p[g+1].fx=t(m),p[g+1].id=g+1}function y(t){for(var e=0;e<t.length;e++)p[d][e]=t[e];p[d].fx=t.fx}for(var v=function(t,e){return t.fx-e.fx},b=e.slice(),x=e.slice(),w=e.slice(),M=e.slice(),O=0;O<i;++O){for(p.sort(v),n.history&&((_=p.map(function(t){var e=t.slice();return e.fx=t.fx,e.id=t.id,e})).sort(function(t,e){return t.id-e.id}),n.history.push({x:p[0].slice(),fx:p[0].fx,simplex:_})),g=r=0;g<d;++g)r=Math.max(r,Math.abs(p[0][g]-p[1][g]));if(Math.abs(p[0].fx-p[d].fx)<s&&r<l)break;for(g=0;g<d;++g){for(var k=b[g]=0;k<d;++k)b[g]+=p[k][g];b[g]/=d}var _=p[d];if(md(x,1+c,b,-c,_),x.fx=t(x),x.fx<p[0].fx)md(M,1+u,b,-u,_),M.fx=t(M),M.fx<x.fx?y(M):y(x);else if(x.fx>=p[d-1].fx){var E=!1;if(x.fx>_.fx?(md(w,1+f,b,-f,_),w.fx=t(w),w.fx<_.fx?y(w):E=!0):(md(w,1-f*c,b,f*c,_),w.fx=t(w),w.fx<x.fx?y(w):E=!0),E){if(1<=h)break;for(g=1;g<p.length;++g)md(p[g],1-h,p[0],h,p[g]),p[g].fx=t(p[g])}}else y(x)}return p.sort(v),{fx:p[0].fx,x:p[0]}},so.conjugateGradient=function(t,e,n){var r,i,a={x:e.slice(),fx:0,fxprime:e.slice()},o={x:e.slice(),fx:0,fxprime:e.slice()},s=e.slice(),l=1;i=(n=n||{}).maxIterations||20*e.length,a.fx=t(a.x,a.fxprime),gd(r=a.fxprime.slice(),a.fxprime,-1);for(var c=0;c<i;++c){var u;if(l=yd(t,r,a,o,l),n.history&&n.history.push({x:a.x.slice(),fx:a.fx,fxprime:a.fxprime.slice(),alpha:l}),l?(md(s,1,o.fxprime,-1,a.fxprime),u=dd(a.fxprime,a.fxprime),u=Math.max(0,dd(s,o.fxprime)/u),md(r,u,r,-1,o.fxprime),u=a,a=o,o=u):gd(r,a.fxprime,-1),pd(a.fxprime)<=1e-5)break}n.history&&n.history.push({x:a.x.slice(),fx:a.fx,fxprime:a.fxprime.slice(),alpha:l});return a},so.gradientDescent=function(t,e,n){for(var r=(n=n||{}).maxIterations||100*e.length,i=n.learnRate||.001,a={x:e.slice(),fx:0,fxprime:e.slice()},o=0;o<r&&(a.fx=t(a.x,a.fxprime),n.history&&n.history.push({x:a.x.slice(),fx:a.fx,fxprime:a.fxprime.slice()}),md(a.x,1,a.x,-i,a.fxprime),!(pd(a.fxprime)<=1e-5));++o);return a},so.gradientDescentLineSearch=function(t,e,n){n=n||{};var r,i={x:e.slice(),fx:0,fxprime:e.slice()},a={x:e.slice(),fx:0,fxprime:e.slice()},o=n.maxIterations||100*e.length,s=n.learnRate||1,l=e.slice(),c=n.c1||.001,u=n.c2||.1,f=[];{var h;n.history&&(h=t,t=function(t,e){return f.push(t.slice()),h(t,e)})}i.fx=t(i.x,i.fxprime);for(var d=0;d<o&&(gd(l,i.fxprime,-1),s=yd(t,l,i,a,s,c,u),n.history&&(n.history.push({x:i.x.slice(),fx:i.fx,fxprime:i.fxprime.slice(),functionCalls:f,learnRate:s,alpha:s}),f=[]),r=i,i=a,a=r,!(0===s||pd(i.fxprime)<1e-5));++d);return i},so.zeros=hd,so.zerosM=function(t,e){return hd(t).map(function(){return hd(e)})},so.norm2=pd,so.weightedSum=md,so.scale=gd;const vd=1e-10;function bd(a,t){var e=function(t){var r=[];for(let n=0;n<t.length;++n)for(let e=n+1;e<t.length;++e){var i=Od(t[n],t[e]);for(let t=0;t<i.length;++t){var a=i[t];a.parentIndex=[n,e],r.push(a)}}return r}(a),n=e.filter(function(t){var e=t,n=a;for(let t=0;t<n.length;++t)if(wd(e,n[t])>n[t].radius+vd)return!1;return!0});let o=0,s=0,l;var c=[];if(1<n.length){var r=function(e){var n={x:0,y:0};for(let t=0;t<e.length;++t)n.x+=e[t].x,n.y+=e[t].y;return n.x/=e.length,n.y/=e.length,n}(n);for(l=0;l<n.length;++l){var u=n[l];u.angle=Math.atan2(u.x-r.x,u.y-r.y)}n.sort(function(t,e){return e.angle-t.angle});let i=n[n.length-1];for(l=0;l<n.length;++l){var f=n[l],h=(s+=(i.x+f.x)*(f.y-i.y),{x:(f.x+i.x)/2,y:(f.y+i.y)/2});let r=null;for(let n=0;n<f.parentIndex.length;++n)if(-1<i.parentIndex.indexOf(f.parentIndex[n])){var d=a[f.parentIndex[n]],p=Math.atan2(f.x-d.x,f.y-d.y),g=Math.atan2(i.x-d.x,i.y-d.y);let t=g-p;t<0&&(t+=2*Math.PI);p=g-t/2;let e=wd(h,{x:d.x+d.radius*Math.sin(p),y:d.y+d.radius*Math.cos(p)});e>2*d.radius&&(e=2*d.radius),(null===r||r.width>e)&&(r={circle:d,width:e,p1:f,p2:i})}null!==r&&(c.push(r),o+=xd(r.circle.radius,r.width),i=f)}}else{let t=a[0];for(l=1;l<a.length;++l)a[l].radius<t.radius&&(t=a[l]);let e=!1;for(l=0;l<a.length;++l)if(wd(a[l],t)>Math.abs(t.radius-a[l].radius)){e=!0;break}e?o=s=0:(o=t.radius*t.radius*Math.PI,c.push({circle:t,p1:{x:t.x,y:t.y+t.radius},p2:{x:t.x-vd,y:t.y+t.radius},width:2*t.radius}))}return s/=2,t&&(t.area=o+s,t.arcArea=o,t.polygonArea=s,t.arcs=c,t.innerPoints=n,t.intersectionPoints=e),o+s}function xd(t,e){return t*t*Math.acos(1-e/t)-(t-e)*Math.sqrt(e*(2*t-e))}function wd(t,e){return Math.sqrt((t.x-e.x)*(t.x-e.x)+(t.y-e.y)*(t.y-e.y))}function Md(t,e,n){var r;return t+e<=n?0:n<=Math.abs(t-e)?Math.PI*Math.min(t,e)*Math.min(t,e):(r=e-(n*n-t*t+e*e)/(2*n),xd(t,t-(n*n-e*e+t*t)/(2*n))+xd(e,r))}function Od(t,e){var n,r,i=wd(t,e),a=t.radius,o=e.radius;return a+o<=i||i<=Math.abs(a-o)?[]:(o=(a*a-o*o+i*i)/(2*i),a=Math.sqrt(a*a-o*o),n=t.x+o*(e.x-t.x)/i,o=t.y+o*(e.y-t.y)/i,[{x:n+(r=-(e.y-t.y)*(a/i)),y:o-(e=-(e.x-t.x)*(a/i))},{x:n-r,y:o+e}])}function kd(t,e){(e=e||{}).maxIterations=e.maxIterations||500;var n=e.initialLayout||Sd;const i=e.lossFunction||Ad,a=n(t=function(t){t=t.slice();var e=[],n={};let r,i,a,o;for(r=0;r<t.length;++r){var s=t[r];1==s.sets.length?e.push(s.sets[0]):2==s.sets.length&&(a=s.sets[0],o=s.sets[1],n[[a,o]]=!0,n[[o,a]]=!0)}for(e.sort((t,e)=>e<t?1:-1),r=0;r<e.length;++r)for(a=e[r],i=r+1;i<e.length;++i)o=e[i],[a,o]in n||t.push({sets:[a,o],size:0});return t}(t),e),r=[],o=[];let s;for(s in a)a.hasOwnProperty(s)&&(r.push(a[s].x),r.push(a[s].y),o.push(s));var l=fd.exports.nelderMead(function(e){var n={};for(let t=0;t<o.length;++t){var r=o[t];n[r]={x:e[2*t],y:e[2*t+1],radius:a[r].radius}}return i(n,t)},r,e).x;for(let t=0;t<o.length;++t)s=o[t],a[s].x=l[2*t],a[s].y=l[2*t+1];return a}const _d=1e-10;function Ed(e,n,r){return Math.min(e,n)*Math.min(e,n)*Math.PI<=r+_d?Math.abs(e-n):fd.exports.bisect(function(t){return Md(e,n,t)-r},0,e+n)}function Sd(t,e){let n=function(r,t){const i=t&&t.lossFunction?t.lossFunction:Ad,a={},o={};let s;for(let t=0;t<r.length;++t){var e=r[t];1==e.sets.length&&(s=e.sets[0],a[s]={x:1e10,y:1e10,rowid:Object.keys(a).length,size:e.size,radius:Math.sqrt(e.size/Math.PI)},o[s]=[])}r=r.filter(function(t){return 2==t.sets.length});for(let e=0;e<r.length;++e){var n=r[e];let t=n.hasOwnProperty("weight")?n.weight:1;var l=n.sets[0],c=n.sets[1];n.size+_d>=Math.min(a[l].size,a[c].size)&&(t=0),o[l].push({set:c,size:n.size,weight:t}),o[c].push({set:l,size:n.size,weight:t})}var u=[];for(s in o)if(o.hasOwnProperty(s)){let e=0;for(let t=0;t<o[s].length;++t)e+=o[s][t].size*o[s][t].weight;u.push({set:s,size:e})}function f(t,e){return e.size-t.size}u.sort(f);const h={};function d(t){return t.set in h}function p(t,e){a[e].x=t.x,a[e].y=t.y,h[e]=!0}p({x:0,y:0},u[0].set);for(let t=1;t<u.length;++t){var g=u[t].set,m=o[g].filter(d);if(s=a[g],m.sort(f),0===m.length)throw"ERROR: missing pairwise overlap information";var y=[];for(let e=0;e<m.length;++e){var v=a[m[e].set],b=Ed(s.radius,v.radius,m[e].size);y.push({x:v.x+b,y:v.y}),y.push({x:v.x-b,y:v.y}),y.push({y:v.y+b,x:v.x}),y.push({y:v.y-b,x:v.x});for(let t=e+1;t<m.length;++t){var x=a[m[t].set],w=Ed(s.radius,x.radius,m[t].size),M=Od({x:v.x,y:v.y,radius:b},{x:x.x,y:x.y,radius:w});for(let t=0;t<M.length;++t)y.push(M[t])}}let e=1e50,n=y[0];for(let t=0;t<y.length;++t){a[g].x=y[t].x,a[g].y=y[t].y;var O=i(a,r);O<e&&(e=O,n=y[t])}p(n,g)}return a}(t,e);var r=e.lossFunction||Ad;return n=8<=t.length&&r(e=function(t,e){var n=(e=e||{}).restarts||10,r=[],i={};let a;for(a=0;a<t.length;++a){var o=t[a];1==o.sets.length&&(i[o.sets[0]]=r.length,r.push(o))}var s=function(t,a,o){const s=fd.exports.zerosM(a.length,a.length),l=fd.exports.zerosM(a.length,a.length);return t.filter(function(t){return 2==t.sets.length}).map(function(t){var e=o[t.sets[0]],n=o[t.sets[1]],r=Ed(Math.sqrt(a[e].size/Math.PI),Math.sqrt(a[n].size/Math.PI),t.size);s[e][n]=s[n][e]=r;let i=0;t.size+1e-10>=Math.min(a[e].size,a[n].size)?i=1:t.size<=1e-10&&(i=-1),l[e][n]=l[n][e]=i}),{distances:s,constraints:l}}(t,r,i);let m=s.distances;function l(t,r){{var i=t,a=r,o=m,s=y;let e=0,n;for(n=0;n<a.length;++n)a[n]=0;for(n=0;n<o.length;++n){var l=i[2*n],c=i[2*n+1];for(let t=n+1;t<o.length;++t){var u=i[2*t],f=i[2*t+1],h=o[n][t],d=s[n][t],p=(u-l)*(u-l)+(f-c)*(f-c),g=Math.sqrt(p),p=p-h*h;0<d&&g<=h||d<0&&h<=g||(e+=2*p*p,a[2*n]+=4*p*(l-u),a[2*n+1]+=4*p*(c-f),a[2*t]+=4*p*(u-l),a[2*t+1]+=4*p*(f-c))}}return e}}const y=s.constraints,c=fd.exports.norm2(m.map(fd.exports.norm2))/m.length;m=m.map(function(t){return t.map(function(t){return t/c})});let u,f;for(a=0;a<n;++a){var h=fd.exports.zeros(2*m.length).map(Math.random);f=fd.exports.conjugateGradient(l,h,e),(!u||f.fx<u.fx)&&(u=f)}var d=u.x,p={};for(a=0;a<r.length;++a){var g=r[a];p[g.sets[0]]={x:d[2*a]*c,y:d[2*a+1]*c,radius:Math.sqrt(g.size/Math.PI)}}if(e.history)for(a=0;a<e.history.length;++a)fd.exports.scale(e.history[a].x,c);return p}(t,e),t)+1e-8<r(n,t)?e:n}function Ad(n,r){let i=0;for(let e=0;e<r.length;++e){var a,o,s=r[e];let t;1!=s.sets.length&&(t=2==s.sets.length?(o=n[s.sets[0]],a=n[s.sets[1]],Md(o.radius,a.radius,wd(o,a))):bd(s.sets.map(function(t){return n[t]})),o=s.hasOwnProperty("weight")?s.weight:1,i+=o*(t-s.size)*(t-s.size))}return i}function Ld(t){function e(e){return{max:Math.max.apply(null,t.map(function(t){return t[e]+t.radius})),min:Math.min.apply(null,t.map(function(t){return t[e]-t.radius}))}}return{xRange:e("x"),yRange:e("y")}}const Td=t=>{const{sets:e="sets",size:n="size",as:r=["key","path"],padding:o=0}=t,[s,l]=r;return t=>{t=t.map(t=>Object.assign(Object.assign({},t),{sets:t[e],size:t[n],[s]:t.sets.join("&")}));t.sort((t,e)=>t.sets.length-e.sets.length);const i=kd(t);let a;return t.map(t=>{const r=t[e];return Object.assign(Object.assign({},t),{[l]:({width:t,height:e})=>{a=a||function(t,e,n,r){var i=[],a=[];for(const g in t)t.hasOwnProperty(g)&&(a.push(g),i.push(t[g]));e-=2*r,n-=2*r;var o=(l=Ld(i)).xRange,s=l.yRange;if(o.max==o.min||s.max==s.min)return console.log("not scaling solution: zero size detected"),t;var l=e/(o.max-o.min),c=n/(s.max-s.min),u=Math.min(c,l),f=(e-(o.max-o.min)*u)/2,h=(n-(s.max-s.min)*u)/2,d={};for(let t=0;t<i.length;++t){var p=i[t];d[a[t]]={radius:u*p.radius,x:r+f+(p.x-o.min)*u,y:r+h+(p.y-s.min)*u}}return d}(i,t,e,o);let n=function(t){var e={},n=(bd(t,e),e.arcs);if(0===n.length)return"M 0 0";if(1==n.length)return t=n[0].circle,e=t.x,r=t.y,t=t.radius,(i=[]).push("M",e-=t,r),i.push("A",t,t,0,1,0,e+2*t,r),i.push("A",t,t,0,1,0,e,r),i.join(" ");var r,i,a=["\nM",n[0].p2.x,n[0].p2.y];for(let t=0;t<n.length;++t){var o=n[t],s=o.circle.radius,l=o.width>s;a.push("\nA",s,s,0,l?1:0,1,o.p1.x,o.p1.y)}return a.join(" ")}(r.map(t=>a[t]));return/[zZ]$/.test(n)||(n+=" Z"),n}})})}};Td.props={};const jd=u=>c=>ue(void 0,void 0,void 0,function*(){var{width:t,height:e}=nf(c),{data:n,encode:r={},scale:i,style:a={},layout:o={}}=u,s=rt(u,["data","encode","scale","style","layout"]),l={size:[t,e]},t={axis:!1,type:"text",encode:{x:"x",y:"y",text:"text",rotate:"rotate",fontSize:"size"},scale:{x:{domain:[0,t],range:[0,1]},y:{domain:[0,e],range:[0,1]},fontSize:{type:"identity"},rotate:{type:"identity"}},style:{textAlign:"center"}},e=function(t,e){const{text:n="text",value:r="value"}=e;return t.map(t=>Object.assign(Object.assign({},t),{text:t[n],value:t[r]}))}(n,r),n=yield td(Object.assign(Object.assign({},l),o))(e);return[it({},t,Object.assign(Object.assign({data:n,encode:r,scale:i,style:a},s),{axis:!1}))]});function Nd(t,...e){return e.reduce((e,n)=>t=>e(n(t)),t)}function Pd(e,n){return n-e?t=>(t-e)/(n-e):t=>.5}function Cd(t,e,n,r,i){let a=n||0,o=r||t.length;for(var s=i||(t=>t);a<o;){var l=Math.floor((a+o)/2);s(t[l])>e?o=l:a=l+1}return a}jd.props={};const Rd=Math.sqrt(50),Id=Math.sqrt(10),Bd=Math.sqrt(2);function Fd(t,e,n){e=(e-t)/Math.max(0,n),t=Math.floor(Math.log(e)/Math.LN10),n=e/10**t;return 0<=t?(n>=Rd?10:n>=Id?5:n>=Bd?2:1)*10**t:-(10**-t)/(n>=Rd?10:n>=Id?5:n>=Bd?2:1)}function Dd(t,e,n){n=Math.abs(e-t)/Math.max(0,n);let r=10**Math.floor(Math.log(n)/Math.LN10);n/=r;return n>=Rd?r*=10:n>=Id?r*=5:n>=Bd&&(r*=2),e<t?-r:r}const zd=(t,e,n=5)=>{t=[t,e];let r=0,i=t.length-1,a=t[r],o=t[i],s;return o<a&&([a,o]=[o,a],[r,i]=[i,r]),0<(s=Fd(a,o,n))?(a=Math.floor(a/s)*s,o=Math.ceil(o/s)*s,s=Fd(a,o,n)):s<0&&(a=Math.ceil(a*s)/s,o=Math.floor(o*s)/s,s=Fd(a,o,n)),0<s?(t[r]=Math.floor(a/s)*s,t[i]=Math.ceil(o/s)*s):s<0&&(t[r]=Math.ceil(a*s)/s,t[i]=Math.floor(o*s)/s),t},Wd=36e5,Gd=864e5,qd=7*Gd;Gd,Gd;function Hd(t,n,s,r){const i=(t,e)=>{let n=e;for(;n&&r(t)%e!=0;)s(t,-1),--n;return t},l=(t,e)=>{e&&i(t,e),n(t)};const c=(t,e)=>{t=new Date(+t-1);return l(t,e),s(t,e),l(t),t};return{ceil:c,floor:(t,e)=>{t=new Date(+t);return l(t,e),t},range:(t,e,n,r)=>{for(var i=[],a=Math.floor(n),o=r?c(t,n):c(t);+o<+e;s(o,a),l(o))i.push(new Date(+o));return i},duration:t}}a=Hd(1,t=>t,(t,e=1)=>{t.setTime(+t+e)},t=>t.getTime()),po=Hd(1e3,t=>{t.setMilliseconds(0)},(t,e=1)=>{t.setTime(+t+1e3*e)},t=>t.getSeconds()),go=Hd(6e4,t=>{t.setSeconds(0,0)},(t,e=1)=>{t.setTime(+t+6e4*e)},t=>t.getMinutes()),i=Hd(Wd,t=>{t.setMinutes(0,0,0)},(t,e=1)=>{t.setTime(+t+Wd*e)},t=>t.getHours()),vo=Hd(Gd,t=>{t.setHours(0,0,0,0)},(t,e=1)=>{t.setTime(+t+Gd*e)},t=>t.getDate()-1);const Vd=Hd(2592e6,t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e=1)=>{var n=t.getMonth();t.setMonth(n+e)},t=>t.getMonth());bo=Hd(qd,t=>{t.setDate(t.getDate()-t.getDay()%7),t.setHours(0,0,0,0)},(t,e=1)=>{t.setTime(+t+qd*e)},t=>{var e=Vd.floor(t),t=new Date(+t);return Math.floor((+t-+e)/qd)}),_o=Hd(31536e6,t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e=1)=>{var n=t.getFullYear();t.setFullYear(n+e)},t=>t.getFullYear());const Yd={millisecond:a,second:po,minute:go,hour:i,day:vo,week:bo,month:Vd,year:_o};Eo=Hd(1,t=>t,(t,e=1)=>{t.setTime(+t+e)},t=>t.getTime()),So=Hd(1e3,t=>{t.setUTCMilliseconds(0)},(t,e=1)=>{t.setTime(+t+1e3*e)},t=>t.getUTCSeconds()),Ao=Hd(6e4,t=>{t.setUTCSeconds(0,0)},(t,e=1)=>{t.setTime(+t+6e4*e)},t=>t.getUTCMinutes()),Lo=Hd(Wd,t=>{t.setUTCMinutes(0,0,0)},(t,e=1)=>{t.setTime(+t+Wd*e)},t=>t.getUTCHours()),To=Hd(Gd,t=>{t.setUTCHours(0,0,0,0)},(t,e=1)=>{t.setTime(+t+Gd*e)},t=>t.getUTCDate()-1);const $d=Hd(2592e6,t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e=1)=>{var n=t.getUTCMonth();t.setUTCMonth(n+e)},t=>t.getUTCMonth());var jo=Hd(qd,t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7)%7),t.setUTCHours(0,0,0,0)},(t,e=1)=>{t.setTime(+t+qd*e)},t=>{var e=$d.floor(t),t=new Date(+t);return Math.floor((+t-+e)/qd)}),o=Hd(31536e6,t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e=1)=>{var n=t.getUTCFullYear();t.setUTCFullYear(n+e)},t=>t.getUTCFullYear());const Ud={millisecond:Eo,second:So,minute:Ao,hour:Lo,day:To,week:jo,month:$d,year:o};function Kd(t,e,n,r,i){var t=+t,e=+e,{tickIntervals:i,year:a,millisecond:o}=function(t){var{year:t,month:e,week:n,day:r,hour:i,minute:a,second:o,millisecond:s}=t?Ud:Yd;return{tickIntervals:[[o,1],[o,5],[o,15],[o,30],[a,1],[a,5],[a,15],[a,30],[i,1],[i,3],[i,6],[i,12],[r,1],[r,2],[n,1],[e,1],[e,3],[t,1]],year:t,millisecond:s}}(i),s=([t,e])=>t.duration*e,n=r?(e-t)/r:n||5,l=r||(e-t)/n,c=i.length,u=Cd(i,l,0,c,s);let f;return f=u===c?[a,Dd(t/a.duration,e/a.duration,n)]:u?([c,a]=l/s(i[u-1])<s(i[u])/l?i[u-1]:i[u],[c,r?Math.ceil(r/c.duration):a]):[o,Math.max(Dd(t,e,n),1)]}const Xd=(t,e,n,r,i)=>{var a=e<t,o=a?e:t,t=a?t:e,[e,n]=Kd(o,t,n,r,i),r=[e.floor(o,n),e.ceil(t,n)];return a?r.reverse():r};function Zd(t){return null!==t&&"function"!=typeof t&&isFinite(t.length)}function Qd(t){return ep(t,"Function")}function Jd(t){return null==t}var tp={}.toString,ep=function(t,e){return tp.call(t)==="[object "+e+"]"},np=function(t){return Array.isArray?Array.isArray(t):ep(t,"Array")};var rp=function(t){if("object"!=typeof(e=t)||null===e||!ep(t,"Object"))return!1;var e;if(null===Object.getPrototypeOf(t))return!0;for(var n=t;null!==Object.getPrototypeOf(n);)n=Object.getPrototypeOf(n);return Object.getPrototypeOf(t)===n},ip=function(t){return ep(t,"Number")},ap=Object.values?function(t){return Object.values(t)}:function(n){var t,r=[],e=n,i=function(t,e){Qd(n)&&"prototype"===e||r.push(t)};if(e)if(np(e))for(var a=0,o=e.length;a<o&&!1!==i(e[a],a);a++);else if(t=typeof e,null!==e&&"object"==t||"function"==t)for(var s in e)if(e.hasOwnProperty(s)&&!1===i(e[s],s))break;return r},op=5;function sp(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r+=1)!function t(e,n,r,i){for(var a in r=r||0,i=i||op,n){var o;n.hasOwnProperty(a)&&(null!==(o=n[a])&&rp(o)?(rp(e[a])||(e[a]={}),r<i?t(e[a],o,r+1,i):e[a]=n[a]):np(o)?(e[a]=[],e[a]=e[a].concat(o)):void 0!==o&&(e[a]=o))}}(t,e[r]);return t}function lp(t){return t}var cp,up=function(t,e){if(!Zd(t))return-1;var n=Array.prototype.indexOf;if(n)return n.call(t,e);for(var r=-1,i=0;i<t.length;i++)if(t[i]===e){r=i;break}return r};function fp(t){return Jd(t)?0:(Zd(t)?t:Object.keys(t)).length}function hp(t){return null!=t&&!Number.isNaN(t)}!function(a,o){var s;if(Qd(a))return(s=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n,r=o?o.apply(this,t):t[0],i=s.cache;return i.has(r)?i.get(r):(n=a.apply(this,t),i.set(r,n),n)}).cache=new Map;throw new TypeError("Expected a function")}(function(t,e){var n=(e=void 0===e?{}:e).fontSize,r=e.fontFamily,i=e.fontWeight,a=e.fontStyle,e=e.fontVariant;return(cp=cp||document.createElement("canvas").getContext("2d")).font=[a,e,i,n+"px",r].join(" "),cp.measureText(ep(t,"String")?t:"").width},function(t,e){return function(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;for(var r=Array(t),i=0,e=0;e<n;e++)for(var a=arguments[e],o=0,s=a.length;o<s;o++,i++)r[i]=a[o];return r}([t],ap(e=void 0===e?{}:e)).join("")});const dp=e=>t=>-e(-t),pp=(t,e)=>{const n=Math.log(t);t=t===Math.E?Math.log:10===t?Math.log10:2===t?Math.log2:t=>Math.log(t)/n;return e?dp(t):t},gp=(e,t)=>{var n=e===Math.E?Math.exp:t=>e**t;return t?dp(n):n},mp=(t,e,n,r)=>{var i=t<0,a=pp(r,i),r=gp(r,i),i=e<t,o=i?t:e,e=[r(Math.floor(a(i?e:t))),r(Math.ceil(a(o)))];return i?e.reverse():e};function yp(e,o){return t=>{t.prototype.rescale=function(){this.initRange(),this.nice();var[t]=this.chooseTransforms();this.composeOutput(t,this.chooseClamp(t))},t.prototype.initRange=function(){var t=this.options["interpolator"];this.options.range=e(t)},t.prototype.composeOutput=function(t,e){var n,{domain:r,interpolator:i,round:a}=this.getOptions(),r=o(r.map(t)),a=a?(n=i,t=>{t=n(t);return ip(t)?Math.round(t):t}):i;this.output=Nd(a,r,e,t)},t.prototype.invert=void 0}}var vp,mo={exports:{}},is={exports:{}},bp=function(t){return!(!t||"string"==typeof t)&&(t instanceof Array||Array.isArray(t)||0<=t.length&&(t.splice instanceof Function||Object.getOwnPropertyDescriptor(t,t.length-1)&&"String"!==t.constructor.name))},xp=Array.prototype.concat,wp=Array.prototype.slice,Mp=is.exports=function(t){for(var e=[],n=0,r=t.length;n<r;n++){var i=t[n];bp(i)?e=xp.call(e,wp.call(i)):e.push(i)}return e},Op=(Mp.wrap=function(t){return function(){return t(Mp(arguments))}},{aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}),kp=is.exports,_p=Object.hasOwnProperty,Ep=Object.create(null);for(vp in Op)_p.call(Op,vp)&&(Ep[Op[vp]]=vp);var Sp=mo.exports={to:{},get:{}};function Ap(t,e,n){return Math.min(Math.max(e,t),n)}function Lp(t){t=Math.round(t).toString(16).toUpperCase();return t.length<2?"0"+t:t}Sp.get=function(t){var e,n;switch(t.substring(0,3).toLowerCase()){case"hsl":e=Sp.get.hsl(t),n="hsl";break;case"hwb":e=Sp.get.hwb(t),n="hwb";break;default:e=Sp.get.rgb(t),n="rgb"}return e?{model:n,value:e}:null},Sp.get.rgb=function(t){if(!t)return null;var e,n,r,i=[0,0,0,1];if(e=t.match(/^#([a-f0-9]{6})([a-f0-9]{2})?$/i)){for(r=e[2],e=e[1],n=0;n<3;n++){var a=2*n;i[n]=parseInt(e.slice(a,2+a),16)}r&&(i[3]=parseInt(r,16)/255)}else if(e=t.match(/^#([a-f0-9]{3,4})$/i)){for(r=(e=e[1])[3],n=0;n<3;n++)i[n]=parseInt(e[n]+e[n],16);r&&(i[3]=parseInt(r+r,16)/255)}else{if(e=t.match(/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/))for(n=0;n<3;n++)i[n]=parseInt(e[n+1],0);else{if(!(e=t.match(/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)))return(e=t.match(/^(\w+)$/))?"transparent"===e[1]?[0,0,0,0]:_p.call(Op,e[1])?((i=Op[e[1]])[3]=1,i):null:null;for(n=0;n<3;n++)i[n]=Math.round(2.55*parseFloat(e[n+1]))}e[4]&&(e[5]?i[3]=.01*parseFloat(e[4]):i[3]=parseFloat(e[4]))}for(n=0;n<3;n++)i[n]=Ap(i[n],0,255);return i[3]=Ap(i[3],0,1),i},Sp.get.hsl=function(t){var e;return(t=t&&t.match(/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/))?(e=parseFloat(t[4]),[(parseFloat(t[1])%360+360)%360,Ap(parseFloat(t[2]),0,100),Ap(parseFloat(t[3]),0,100),Ap(isNaN(e)?1:e,0,1)]):null},Sp.get.hwb=function(t){var e;return(t=t&&t.match(/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/))?(e=parseFloat(t[4]),[(parseFloat(t[1])%360+360)%360,Ap(parseFloat(t[2]),0,100),Ap(parseFloat(t[3]),0,100),Ap(isNaN(e)?1:e,0,1)]):null},Sp.to.hex=function(){var t=kp(arguments);return"#"+Lp(t[0])+Lp(t[1])+Lp(t[2])+(t[3]<1?Lp(Math.round(255*t[3])):"")},Sp.to.rgb=function(){var t=kp(arguments);return t.length<4||1===t[3]?"rgb("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+")":"rgba("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+", "+t[3]+")"},Sp.to.rgb.percent=function(){var t=kp(arguments),e=Math.round(t[0]/255*100),n=Math.round(t[1]/255*100),r=Math.round(t[2]/255*100);return t.length<4||1===t[3]?"rgb("+e+"%, "+n+"%, "+r+"%)":"rgba("+e+"%, "+n+"%, "+r+"%, "+t[3]+")"},Sp.to.hsl=function(){var t=kp(arguments);return t.length<4||1===t[3]?"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)":"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+t[3]+")"},Sp.to.hwb=function(){var t=kp(arguments),e="";return 4<=t.length&&1!==t[3]&&(e=", "+t[3]),"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+e+")"},Sp.to.keyword=function(t){return Ep[t.slice(0,3)]};var Tp=mo.exports;function jp(t,e,n){let r=n;return r<0&&(r+=1),1<r&&--r,r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}function Np(t){var e,n,r,t=Tp.get(t);return t?({model:t,value:e}=t,"rgb"===t?e:"hsl"===t?(e=(t=e)[0]/360,n=t[1]/100,r=t[2]/100,t=t[3],0==n?[255*r,255*r,255*r,t]:[255*jp(n=2*r-(r=r<.5?r*(1+n):r+n-r*n),r,e+1/3),255*jp(n,r,e),255*jp(n,r,e-1/3),t]):null):null}const Pp=(e,n)=>t=>e*(1-t)+n*t,Cp=(t,e)=>{if("number"==typeof t&&"number"==typeof e)return Pp(t,e);if("string"!=typeof t||"string"!=typeof e)return()=>t;{var n=t,r=e;const l=Np(n),c=Np(r);return null===l||null===c?l?()=>n:()=>r:e=>{var n=new Array(4);for(let t=0;t<4;t+=1){var r=l[t],i=c[t];n[t]=r*(1-e)+i*e}var[t,a,o,s]=n;return`rgba(${Math.round(t)}, ${Math.round(a)}, ${Math.round(o)}, ${s})`}}},Rp=(t,e)=>{const n=Pp(t,e);return t=>Math.round(n(t))};function Ip({map:t,initKey:e},n){e=e(n);return t.has(e)?t.get(e):n}function Bp(t){return"object"==typeof t?t.valueOf():t}class Fp extends Map{constructor(t){if(super(),this.map=new Map,this.initKey=Bp,null!==t)for(var[e,n]of t)this.set(e,n)}get(t){return super.get(Ip({map:this.map,initKey:this.initKey},t))}has(t){return super.has(Ip({map:this.map,initKey:this.initKey},t))}set(t,e){return super.set(([{map:t,initKey:n},r]=[{map:this.map,initKey:this.initKey},t],n=n(r),t.has(n)?t.get(n):(t.set(n,r),r)),e);var n,r}delete(t){return super.delete(([{map:t,initKey:e},n]=[{map:this.map,initKey:this.initKey},t],e=e(n),t.has(e)&&(n=t.get(e),t.delete(e)),n));var e,n}}class Dp{constructor(t){this.options=sp({},this.getDefaultOptions()),this.update(t)}getOptions(){return this.options}update(t={}){this.options=sp({},this.options,t),this.rescale(t)}rescale(t){}}const zp=Symbol("defaultUnknown");function Wp(e,n,r){for(let t=0;t<n.length;t+=1)e.has(n[t])||e.set(r(n[t]),t)}function Gp(t){var{value:t,from:e,to:n,mapper:r,notFoundReturn:i}=t;let a=r.get(t);if(void 0===a){if(i!==zp)return i;a=e.push(t)-1,r.set(t,a)}return n[a%n.length]}function qp(t){return t instanceof Date?t=>""+t:"object"==typeof t?t=>JSON.stringify(t):t=>t}class Hp extends Dp{getDefaultOptions(){return{domain:[],range:[],unknown:zp}}constructor(t){super(t)}map(t){return 0===this.domainIndexMap.size&&Wp(this.domainIndexMap,this.getDomain(),this.domainKey),Gp({value:this.domainKey(t),mapper:this.domainIndexMap,from:this.getDomain(),to:this.getRange(),notFoundReturn:this.options.unknown})}invert(t){return 0===this.rangeIndexMap.size&&Wp(this.rangeIndexMap,this.getRange(),this.rangeKey),Gp({value:this.rangeKey(t),mapper:this.rangeIndexMap,from:this.getRange(),to:this.getDomain(),notFoundReturn:this.options.unknown})}rescale(t){var[e]=this.options.domain,[n]=this.options.range;this.domainKey=qp(e),this.rangeKey=qp(n),this.rangeIndexMap?(t&&!t.range||this.rangeIndexMap.clear(),t&&!t.domain&&!t.compare||(this.domainIndexMap.clear(),this.sortedDomain=void 0)):(this.rangeIndexMap=new Map,this.domainIndexMap=new Map)}clone(){return new Hp(this.options)}getRange(){return this.options.range}getDomain(){var t,e;return this.sortedDomain||({domain:t,compare:e}=this.options,this.sortedDomain=e?[...t].sort(e):t),this.sortedDomain}}function Vp(t){const{domain:e,range:n,paddingOuter:r,paddingInner:i,flex:a,round:o,align:s}=t;var l=e.length,c=0<(c=(t=l)-(u=a).length)?[...u,...new Array(c).fill(1)]:c<0?u.slice(0,t):u,[t,u]=n,u=u-t,f=u/(2/l*r+1-1/l*i);const h=f*i/l;f-=l*h;const d=function(t){const e=Math.min(...t);return t.map(t=>t/e)}(c),p=f/d.reduce((t,e)=>t+e);var c=new Fp(e.map((t,e)=>{e=d[e]*p;return[t,o?Math.floor(e):e]})),g=new Fp(e.map((t,e)=>{e=d[e]*p+h;return[t,o?Math.floor(e):e]})),f=Array.from(g.values()).reduce((t,e)=>t+e),t=t+(u-(f-f/l*i))*s;let m=o?Math.round(t):t;var y=new Array(l);for(let t=0;t<l;t+=1){y[t]=(v=m,Math.round(1e12*v)/1e12);var v=e[t];m+=g.get(v)}return{valueBandWidth:c,valueStep:g,adjustedRange:y}}class Yp extends Hp{getDefaultOptions(){return{domain:[],range:[0,1],align:.5,round:!1,paddingInner:0,paddingOuter:0,padding:0,unknown:zp,flex:[]}}constructor(t){super(t)}clone(){return new Yp(this.options)}getStep(t){return void 0===this.valueStep?1:"number"==typeof this.valueStep?this.valueStep:void 0===t?Array.from(this.valueStep.values())[0]:this.valueStep.get(t)}getBandWidth(t){return void 0===this.valueBandWidth?1:"number"==typeof this.valueBandWidth?this.valueBandWidth:void 0===t?Array.from(this.valueBandWidth.values())[0]:this.valueBandWidth.get(t)}getRange(){return this.adjustedRange}getPaddingInner(){var{padding:t,paddingInner:e}=this.options;return 0<t?t:e}getPaddingOuter(){var{padding:t,paddingOuter:e}=this.options;return 0<t?t:e}rescale(){super.rescale();var{align:t,domain:e,range:n,round:r,flex:i}=this.options,{adjustedRange:t,valueBandWidth:n,valueStep:r}=function(t){var e=t["domain"];if(0===(e=e.length))return{valueBandWidth:void 0,valueStep:void 0,adjustedRange:[]};if(!(null==(n=t.flex)||!n.length))return Vp(t);var{range:n,paddingOuter:t,paddingInner:r,round:i,align:a}=t;let o,s,l=n[0];return n=n[1]-l,o=n/Math.max(1,2*t+(e-r)),i&&(o=Math.floor(o)),l+=(n-o*(e-r))*a,s=o*(1-r),i&&(l=Math.round(l),s=Math.round(s)),t=new Array(e).fill(0).map((t,e)=>l+e*o),{valueStep:o,valueBandWidth:s,adjustedRange:t}}({align:t,range:n,round:r,flex:i,paddingInner:this.getPaddingInner(),paddingOuter:this.getPaddingOuter(),domain:e});this.valueStep=r,this.valueBandWidth=n,this.adjustedRange=t}}const $p=(t,e,n)=>{let r,i,a=t,o=e;if(a===o&&0<n)return[a];let s=Fd(a,o,n);if(0===s||!Number.isFinite(s))return[];if(0<s){a=Math.ceil(a/s),o=Math.floor(o/s),i=new Array(r=Math.ceil(o-a+1));for(let t=0;t<r;t+=1)i[t]=(a+t)*s}else{s=-s,a=Math.ceil(a*s),o=Math.floor(o*s),i=new Array(r=Math.ceil(o-a+1));for(let t=0;t<r;t+=1)i[t]=(a+t)/s}return i};class Up extends Dp{getDefaultOptions(){return{range:[0],domain:[0,1],unknown:void 0,tickCount:5,tickMethod:$p}}map(t){var[e]=this.options.range;return void 0!==e?e:this.options.unknown}invert(t){var[e]=this.options.range;return t===e&&void 0!==e?this.options.domain:[]}getTicks(){var{tickMethod:t,domain:e,tickCount:n}=this.options,[e,r]=e;return ip(e)&&ip(r)?t(e,r,n):[]}clone(){return new Up(this.options)}}function Kp(t){return Math.abs(t)<1e-15?t:parseFloat(t.toFixed(15))}const Xp=[1,5,2,2.5,4,3],Zp=100*Number.EPSILON;const Qp=(n,r,t=5,i=!0,a=Xp,o=[.25,.2,.5,.05])=>{var s=t<0?0:Math.round(t);if(Number.isNaN(n)||Number.isNaN(r)||"number"!=typeof n||"number"!=typeof r||!s)return[];if(r-n<1e-15||1===s)return[n];var l,c,u,f,h,d,p,g={score:-2,lmin:0,lmax:0,lstep:0};let m=1;for(;m<1/0;){for(let t=0;t<a.length;t+=1){var y=a[t],v=(f=y,h=a,d=m,p=void 0,p=fp(h),1-up(h,f)/(p-1)-d+1);if(o[0]*v+o[1]+o[2]+o[3]<g.score){m=1/0;break}let e=2;for(;e<1/0;){x=e;var b=(u=s)<=x?2-(x-1)/(u-1):1;if(o[0]*v+o[1]+o[2]*b+o[3]<g.score)break;var x=(r-n)/(e+1)/m/y;let t=Math.ceil(Math.log10(x));for(;t<1/0;){var w=m*y*10**t,M=(k=r,M=w*(e-1),(k-=n)<M?1-((M-k)/2)**2/(.1*k)**2:1);if(o[0]*v+o[1]*M+o[2]*b+o[3]<g.score)break;var O=Math.floor(r/w)*m-(e-1)*m,k=Math.ceil(n/w)*m;if(O<=k){var _=k-O;for(let t=0;t<=_;t+=1){var E=(O+t)*(w/m),S=E+w*(e-1),A=w,L=function(t,e,n,r,i,a){var o=fp(e),e=up(e,t);let s=0;return t=(r%a+a)%a,1-e/(o-1)-n+(s=(t<Zp||a-t<Zp)&&r<=0&&0<=i?1:s)}(y,a,m,E,S,A),T=1-.5*((r-S)**2+(n-E)**2)/(.1*(r-n))**2,j=(l=e,j=n,l=(l-1)/(S-(N=E)),c=((c=s)-1)/(Math.max(S,r)-Math.min(j,N)),2-Math.max(l/c,c/l)),N=o[0]*L+o[1]*T+o[2]*j+ +o[3];g.score<N&&(!i||E<=n&&r<=S)&&(g.lmin=E,g.lmax=S,g.lstep=A,g.score=N)}}t+=1}e+=1}}m+=1}var t=Kp(g.lmax),e=Kp(g.lmin),P=Kp(g.lstep),C=Math.floor((t=(t-e)/P,Math.round(1e12*t)/1e12))+1,R=new Array(C);R[0]=Kp(e);for(let t=1;t<C;t+=1)R[t]=Kp(R[t-1]+P);return R};class Jp extends Dp{getDefaultOptions(){return{domain:[0,1],range:[0,1],tickCount:5,unknown:void 0,tickMethod:Qp}}map(t){return hp(t)?t:this.options.unknown}invert(t){return this.map(t)}clone(){return new Jp(this.options)}getTicks(){var{domain:t,tickCount:e,tickMethod:n}=this.options,[t,r]=t;return ip(t)&&ip(r)?n(t,r,e):[]}}const t0=(t,e,n)=>{var[t,r]=t,[e,i]=e;let a,o;return Nd(o=t<r?(a=Pd(t,r),n(e,i)):(a=Pd(r,t),n(i,e)),a)},e0=(r,t,e)=>{const i=Math.min(r.length,t.length)-1,a=new Array(i),o=new Array(i);var n=r[0]>r[i],s=n?[...r].reverse():r,l=n?[...t].reverse():t;for(let t=0;t<i;t+=1)a[t]=Pd(s[t],s[t+1]),o[t]=e(l[t],l[t+1]);return t=>{var e=Cd(r,t,1,i)-1,n=a[e];return Nd(o[e],n)(t)}},n0=(t,e,n,r)=>{return(2<Math.min(t.length,e.length)?e0:t0)(t,e,r?Rp:n)};class r0 extends Dp{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,interpolate:Pp,tickCount:5}}map(t){return hp(t)?this.output(t):this.options.unknown}invert(t){return hp(t)?this.input(t):this.options.unknown}nice(){var t,e,n,r;this.options.nice&&([t,e,n,...r]=this.getTickMethodOptions(),this.options.domain=this.chooseNice()(t,e,n,...r))}getTicks(){var t=this.options["tickMethod"],[e,n,r,...i]=this.getTickMethodOptions();return t(e,n,r,...i)}getTickMethodOptions(){var{domain:t,tickCount:e}=this.options;return[t[0],t[t.length-1],e]}chooseNice(){return zd}rescale(){this.nice();var[t,e]=this.chooseTransforms();this.composeOutput(t,this.chooseClamp(t)),this.composeInput(t,e,this.chooseClamp(e))}chooseClamp(t){var{clamp:e,range:n}=this.options,t=this.options.domain.map(t),n=Math.min(t.length,n.length);if(e){e=t[0],t=t[n-1];const r=t<e?t:e,i=t<e?e:t;return t=>Math.min(Math.max(r,t),i)}return lp}composeOutput(t,e){var{domain:n,range:r,round:i,interpolate:a}=this.options,n=n0(n.map(t),r,a,i);this.output=Nd(n,e,t)}composeInput(t,e,n){var{domain:r,range:i}=this.options,i=n0(i,r.map(t),Pp);this.input=Nd(e,n,i)}}class i0 extends r0{getDefaultOptions(){return{domain:[0,1],range:[0,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolate:Cp,tickMethod:$p,tickCount:5}}chooseTransforms(){return[lp,lp]}clone(){return new i0(this.options)}}class a0 extends Yp{getDefaultOptions(){return{domain:[],range:[0,1],align:.5,round:!1,padding:0,unknown:zp,paddingInner:1,paddingOuter:0}}constructor(t){super(t)}getPaddingInner(){return 1}clone(){return new a0(this.options)}update(t){super.update(t)}getPaddingOuter(){return this.options.padding}}const o0=t=>t<0?-Math.sqrt(-t):Math.sqrt(t);class s0 extends r0{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,exponent:2,interpolate:Cp,tickMethod:$p,tickCount:5}}constructor(t){super(t)}chooseTransforms(){var t,e,n,r=this.options["exponent"];return 1===r?[lp,lp]:(t=.5===r?o0:(e=r,t=>t<0?-((-t)**e):t**e),n=r,[t,t=>t<0?-((-t)**(1/n)):t**(1/n)])}clone(){return new s0(this.options)}}class l0 extends s0{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,interpolate:Cp,tickMethod:$p,tickCount:5,exponent:.5}}constructor(t){super(t)}update(t){super.update(t)}clone(){return new l0(this.options)}}class c0 extends Dp{getDefaultOptions(){return{domain:[.5],range:[0,1]}}constructor(t){super(t)}map(t){return hp(t)?(t=Cd(this.thresholds,t,0,this.n),this.options.range[t]):this.options.unknown}invert(t){var e=this.options["range"],e=e.indexOf(t),t=this.thresholds;return[t[e-1],t[e]]}clone(){return new c0(this.options)}rescale(){var{domain:t,range:e}=this.options;this.n=Math.min(t.length,e.length-1),this.thresholds=t}}const u0=(t,e,n,r=10)=>{var i=t<0,a=gp(r,i),o=pp(r,i),s=e<t,l=s?e:t,c=s?t:e;let u=o(l),f=o(c),h=[];if(!(r%1)&&f-u<n){if(u=Math.floor(u),f=Math.ceil(f),i)for(;u<=f;u+=1){var d=a(u);for(let t=r-1;1<=t;--t){var p=d*t;if(c<p)break;l<=p&&h.push(p)}}else for(;u<=f;u+=1){var g=a(u);for(let t=1;t<r;t+=1){var m=g*t;if(c<m)break;l<=m&&h.push(m)}}2*h.length<n&&(h=$p(l,c,n))}else{t=-1===n?f-u:Math.min(f-u,n);h=$p(u,f,t).map(a)}return s?h.reverse():h};class f0 extends r0{getDefaultOptions(){return{domain:[1,10],range:[0,1],base:10,interpolate:Cp,tickMethod:u0,tickCount:5}}chooseNice(){return mp}getTickMethodOptions(){var{domain:t,tickCount:e,base:n}=this.options;return[t[0],t[t.length-1],e,n]}chooseTransforms(){var{base:t,domain:e}=this.options,e=e[0]<0;return[pp(t,e),gp(t,e)]}clone(){return new f0(this.options)}}class h0 extends c0{getDefaultOptions(){return{domain:[0,1],range:[.5],nice:!1,tickCount:5,tickMethod:Qp}}constructor(t){super(t)}nice(){var t,e,n=this.options["nice"];n&&([n,t,e]=this.getTickMethodOptions(),this.options.domain=zd(n,t,e))}getTicks(){var t=this.options["tickMethod"],[e,n,r]=this.getTickMethodOptions();return t(e,n,r)}getTickMethodOptions(){var{domain:t,tickCount:e}=this.options;return[t[0],t[t.length-1],e]}rescale(){this.nice();var{range:t,domain:e}=this.options,[n,r]=e;this.n=t.length-1,this.thresholds=new Array(this.n);for(let t=0;t<this.n;t+=1)this.thresholds[t]=((t+1)*r-(t-this.n)*n)/(this.n+1)}invert(t){var[t,e]=super.invert(t),[n,r]=this.options.domain;return void 0===t&&void 0===e?[t,e]:[t||n,e||r]}getThresholds(){return this.thresholds}clone(){return new h0(this.options)}}function d0(t,e,n=!1){var r=t,i=(n||r.sort((t,e)=>t-e),[]);for(let t=1;t<e;t+=1)i.push(function(t,e){var n,r=t.length;if(r)return r<2?t[r-1]:(r=(r-1)*e,(n=t[e=Math.floor(r)])+(t[e+1]-n)*(r-e))}(r,t/e));return i}class p0 extends c0{getDefaultOptions(){return{domain:[],range:[],tickCount:5,unknown:void 0,tickMethod:Qp}}constructor(t){super(t)}rescale(){var{domain:t,range:e}=this.options;this.n=e.length-1,this.thresholds=d0(t,this.n+1,!1)}invert(t){var[t,e]=super.invert(t),n=this.options["domain"],r=n[0],n=n[n.length-1];return void 0===t&&void 0===e?[t,e]:[t||r,e||n]}getThresholds(){return this.thresholds}clone(){return new p0(this.options)}getTicks(){var{tickCount:t,domain:e,tickMethod:n}=this.options,r=e.length-1;return n(e[0],e[r],t)}}var g0=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,m0=/\[([^]*?)\]/gm;function y0(t,e){for(var n=[],r=0,i=t.length;r<i;r++)n.push(t[r].substr(0,e));return n}function v0(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0,i=e;r<i.length;r++){var a,o=i[r];for(a in o)t[a]=o[a]}return t}function b0(t,e){for(void 0===e&&(e=2),t=String(t);t.length<e;)t="0"+t;return t}var x0,Wo=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],ls=["January","February","March","April","May","June","July","August","September","October","November","December"],us=y0(ls,3),w0=v0({},{dayNamesShort:y0(Wo,3),dayNames:Wo,monthNamesShort:us,monthNames:ls,amPm:["am","pm"],DoFn:function(t){return t+["th","st","nd","rd"][3<t%10?0:(t-t%10!=10?1:0)*t%10]}}),M0={D:function(t){return String(t.getDate())},DD:function(t){return b0(t.getDate())},Do:function(t,e){return e.DoFn(t.getDate())},d:function(t){return String(t.getDay())},dd:function(t){return b0(t.getDay())},ddd:function(t,e){return e.dayNamesShort[t.getDay()]},dddd:function(t,e){return e.dayNames[t.getDay()]},M:function(t){return String(t.getMonth()+1)},MM:function(t){return b0(t.getMonth()+1)},MMM:function(t,e){return e.monthNamesShort[t.getMonth()]},MMMM:function(t,e){return e.monthNames[t.getMonth()]},YY:function(t){return b0(String(t.getFullYear()),4).substr(2)},YYYY:function(t){return b0(t.getFullYear(),4)},h:function(t){return String(t.getHours()%12||12)},hh:function(t){return b0(t.getHours()%12||12)},H:function(t){return String(t.getHours())},HH:function(t){return b0(t.getHours())},m:function(t){return String(t.getMinutes())},mm:function(t){return b0(t.getMinutes())},s:function(t){return String(t.getSeconds())},ss:function(t){return b0(t.getSeconds())},S:function(t){return String(Math.round(t.getMilliseconds()/100))},SS:function(t){return b0(Math.round(t.getMilliseconds()/10),2)},SSS:function(t){return b0(t.getMilliseconds(),3)},a:function(t,e){return t.getHours()<12?e.amPm[0]:e.amPm[1]},A:function(t,e){return(t.getHours()<12?e.amPm[0]:e.amPm[1]).toUpperCase()},ZZ:function(t){t=t.getTimezoneOffset();return(0<t?"-":"+")+b0(100*Math.floor(Math.abs(t)/60)+Math.abs(t)%60,4)},Z:function(t){t=t.getTimezoneOffset();return(0<t?"-":"+")+b0(Math.floor(Math.abs(t)/60),2)+":"+b0(Math.abs(t)%60,2)}},O0={default:"ddd MMM DD YYYY HH:mm:ss",shortDate:"M/D/YY",mediumDate:"MMM D, YYYY",longDate:"MMMM D, YYYY",fullDate:"dddd, MMMM D, YYYY",isoDate:"YYYY-MM-DD",isoDateTime:"YYYY-MM-DDTHH:mm:ssZ",shortTime:"HH:mm",mediumTime:"HH:mm:ss",longTime:"HH:mm:ss.SSS"};const k0=(t,e,n,r,i)=>{var a=e<t,o=a?e:t,t=a?t:e,[e,n]=Kd(o,t,n,r,i),r=e.range(o,new Date(+t+1),n,!0);return a?r.reverse():r};function _0(t){var e=t.getTimezoneOffset(),t=new Date(t);return t.setMinutes(t.getMinutes()+e,t.getSeconds(),t.getMilliseconds()),t}class E0 extends r0{getDefaultOptions(){return{domain:[new Date(2e3,0,1),new Date(2e3,0,2)],range:[0,1],nice:!1,tickCount:5,tickInterval:void 0,unknown:void 0,clamp:!1,tickMethod:k0,interpolate:Pp,mask:void 0,utc:!1}}chooseTransforms(){return[t=>+t,t=>new Date(t)]}chooseNice(){return Xd}getTickMethodOptions(){var{domain:t,tickCount:e,tickInterval:n,utc:r}=this.options;return[t[0],t[t.length-1],e,n,r]}getFormatter(){const{mask:a,utc:t}=this.options,o=t?Ud:Yd,s=t?_0:lp;return t=>{var e=s(t),t=a||function(t,e){var{second:e,minute:n,hour:r,day:i,week:a,month:o,year:s}=e;return e.floor(t)<t?".SSS":n.floor(t)<t?":ss":r.floor(t)<t?"hh:mm":i.floor(t)<t?"hh A":o.floor(t)<t?a.floor(t)<t?"MMM DD":"ddd DD":s.floor(t)<t?"MMMM":"YYYY"}(t,o),n=void 0;if(void 0===t&&(t=O0.default),void 0===n&&(n={}),"number"==typeof e&&(e=new Date(e)),"[object Date]"!==Object.prototype.toString.call(e)||isNaN(e.getTime()))throw new Error("Invalid Date pass to format");var r=[],i=(t=(t=O0[t]||t).replace(m0,function(t,e){return r.push(e),"@@@"}),v0(v0({},w0),n));return(t=t.replace(g0,function(t){return M0[t](e,i)})).replace(/@@@/g,function(){return r.shift()})}}clone(){return new E0(this.options)}}var S0;let A0=x0=class extends i0{getDefaultOptions(){return{domain:[0,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolator:lp,tickMethod:$p,tickCount:5}}constructor(t){super(t)}clone(){return new x0(this.options)}};A0=x0=function(t,e,n,r){var i,a=arguments.length,o=a<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;0<=s;s--)(i=t[s])&&(o=(a<3?i(o):3<a?i(e,n,o):i(e,n))||o);return 3<a&&o&&Object.defineProperty(e,n,o),o}([yp(function(t){return[t(0),t(1)]},t=>{var[t,e]=t;return Nd(Pp(0,1),Pd(t,e))})],A0);let L0=S0=class extends i0{getDefaultOptions(){return{domain:[0,.5,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolator:lp,tickMethod:$p,tickCount:5}}constructor(t){super(t)}clone(){return new S0(this.options)}};function T0(r,i){return Object.entries(r).reduce((t,[e,n])=>(t[e]=i(n,e,r),t),{})}function j0(t){return t.map((t,e)=>e)}function N0(t){return t[t.length-1]}function P0(t,e){const n=[[],[]];return t.forEach(t=>{n[e(t)?0:1].push(t)}),n}function C0(n,t=n.length){if(1===t)return n.map(t=>[t]);const r=[];for(let e=0;e<n.length;e++)C0(n.slice(e+1),t-1).forEach(t=>{r.push([n[e],...t])});return r}function R0([t,e],[n,r]){return[t-n,e-r]}function I0([t,e],[n,r]){return[t+n,e+r]}function B0([t,e],[n,r]){return Math.sqrt(Math.pow(t-n,2)+Math.pow(e-r,2))}function F0([t,e]){return Math.atan2(e,t)}function D0([t,e]){return F0([t,e])+Math.PI/2}function z0(t,e){t=F0(t),e=F0(e);return t<e?e-t:2*Math.PI-(t-e)}function W0(t){let e=1/0,n=-1/0,r=1/0,i=-1/0;for(var[a,o]of t)e=Math.min(a,e),n=Math.max(a,n),r=Math.min(o,r),i=Math.max(o,i);var t=n-e,s=i-r;return[e,r,t,s]}function G0([t,e],[n,r]){return[(t+n)/2,(e+r)/2]}function j(t,e){for(var[n,r]of Object.entries(e))t.style(n,r)}function q0(t,e,n,r,i){e=F0(R0(r,e))+Math.PI,n=F0(R0(r,n))+Math.PI;t.arc(r[0],r[1],i,e,n,n-e<0)}function H0(e,t,n,r="y",i="between"){const a="y"===r||!0===r?n:t;var n="y"===r||!0===r?90:0,t=j0(a),[r,o]=pc(t,t=>a[t]);const s=new i0({domain:[r,o],range:[0,100]}),l=t=>s.map(a[t]);r={between:t=>`${e[t]} ${l(t)}%`,start:t=>0===t?`${e[t]} ${l(t)}%`:`${e[t-1]} ${l(t)}%, ${e[t]} ${l(t)}%`,end:t=>t===e.length-1?`${e[t]} ${l(t)}%`:`${e[t]} ${l(t)}%, ${e[t+1]} ${l(t)}%`};return`linear-gradient(${n}deg, ${t.sort((t,e)=>l(t)-l(e)).map(r[i]||r.between).join(",")})`}function V0(t){var[t,e,n,r]=t;return[r,t,e,n]}function Y0(t,e,n){var[e,r,,i]=Uc(t)?V0(e):e,[n,a]=n,t=t.getCenter(),o=D0(R0(e,t)),r=D0(R0(r,t)),n=r===o&&n!==a?r+2*Math.PI:r;return{startAngle:o,endAngle:0<=n-o?n:2*Math.PI+n,innerRadius:B0(i,t),outerRadius:B0(e,t)}}function $0(t,e,n,r){var i=t["defaultColor"],t=t[e]||{},e=t[n]||t[r];return Object.assign({defaultColor:i},e)}function U0(t){var{colorAttribute:t,opacityAttribute:t=t}=t;return t+"Opacity"}function K0(t,e){return Kc(t)?(e=e["transform"],`translate(${(t=t.getCenter())[0]}, ${t[1]}) `+(e||"")):""}function X0(t){var e,n,r;return 1===t.length?t[0]:([[t,e],[n,r]]=t,[(t+n)/2,(e+r)/2])}function ot(t){return new Z0([t],null,t,t.ownerDocument)}L0=S0=function(t,e,n,r){var i,a=arguments.length,o=a<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;0<=s;s--)(i=t[s])&&(o=(a<3?i(o):3<a?i(e,n,o):i(e,n))||o);return 3<a&&o&&Object.defineProperty(e,n,o),o}([yp(function(t){return[t(0),t(.5),t(1)]},t=>{const[e,n,r]=t,i=Nd(Pp(0,.5),Pd(e,n)),a=Nd(Pp(.5,1),Pd(n,r));return t=>(e>r?t<n?a:i:t<n?i:a)(t)})],L0);class Z0{constructor(t=null,e=null,n=null,r=null,i=[null,null,null,null,null],a=[],o=[]){this._elements=Array.from(t),this._data=e,this._parent=n,this._document=r,this._enter=i[0],this._update=i[1],this._exit=i[2],this._merge=i[3],this._split=i[4],this._transitions=a,this._facetElements=o}selectAll(t){t="string"==typeof t?this._parent.querySelectorAll(t):t;return new Z0(t,null,this._elements[0],this._document)}selectFacetAll(t){t="string"==typeof t?this._parent.querySelectorAll(t):t;return new Z0(this._elements,null,this._parent,this._document,void 0,void 0,t)}select(t){t="string"==typeof t?this._parent.querySelectorAll(t)[0]||null:t;return new Z0([t],null,t,this._document)}append(t){var e="function"==typeof t?t:()=>this.createElement(t),n=[];if(null!==this._data){for(let t=0;t<this._data.length;t++){var r=this._data[t],[r,i]=Array.isArray(r)?r:[r,null],a=e(r,t);a.__data__=r,null!==i&&(a.__fromElements__=i),this._parent.appendChild(a),n.push(a)}return new Z0(n,null,this._parent,this._document)}for(let t=0;t<this._elements.length;t++){var o=this._elements[t],s=e(o.__data__,t);o.appendChild(s),n.push(s)}return new Z0(n,null,n[0],this._document)}maybeAppend(t,e){var n=this._elements[0],r=n.getElementById(t);return r||((r="string"==typeof e?this.createElement(e):e()).id=t,n.appendChild(r)),new Z0([r],null,this._parent,this._document)}data(e,n=t=>t,r=()=>null){var i=[],a=[],o=new Set(this._elements),s=[],l=new Set,c=new Map(this._elements.map((t,e)=>[n(t.__data__,e),t])),u=new Map(this._facetElements.map((t,e)=>[n(t.__data__,e),t])),f=bc(this._elements,t=>r(t.__data__));for(let t=0;t<e.length;t++){var h=e[t],d=n(h,t),p=r(h,t);if(c.has(d)){var g=c.get(d);g.__data__=h,g.__facet__=!1,a.push(g),o.delete(g),c.delete(d)}else if(u.has(d)){g=u.get(d);g.__data__=h,g.__facet__=!0,a.push(g),u.delete(d)}else if(f.has(d)){const bc=f.get(d);s.push([h,bc]);for(const m of bc)o.delete(m);f.delete(d)}else c.has(p)?((d=c.get(p)).__toData__?d.__toData__.push(h):d.__toData__=[h],l.add(d),o.delete(d)):i.push(h)}var t=[new Z0([],i,this._parent,this._document),new Z0(a,null,this._parent,this._document),new Z0(o,null,this._parent,this._document),new Z0([],s,this._parent,this._document),new Z0(l,null,this._parent,this._document)];return new Z0(this._elements,null,this._parent,this._document,t)}merge(t){var e=[...this._elements,...t._elements],t=[...this._transitions,...t._transitions];return new Z0(e,null,this._parent,this._document,void 0,t)}createElement(t){var e;return this._document?this._document.createElement(t,{}):(e=Z0.registry[t])?new e:Wu("Unknown node type: "+t)}join(t=t=>t,e=t=>t,n=t=>t.remove(),r=t=>t,i=t=>t.remove()){t=t(this._enter),e=e(this._update),n=n(this._exit),r=r(this._merge),i=i(this._split);return e.merge(t).merge(n).merge(r).merge(i)}remove(){for(let t=0;t<this._elements.length;t++){var e=this._transitions[t];e?(e=Array.isArray(e)?e:[e],Promise.all(e.map(t=>t.finished)).then(()=>{this._elements[t].remove()})):this._elements[t].remove()}return new Z0([],null,this._parent,this._document,void 0,this._transitions)}each(e){for(let t=0;t<this._elements.length;t++){var n=this._elements[t],r=n.__data__;e.call(n,r,t)}return this}attr(n,r){const i="function"!=typeof r?()=>r:r;return this.each(function(t,e){void 0!==r&&(this[n]=i.call(this,t,e))})}style(n,r){const i="function"!=typeof r?()=>r:r;return this.each(function(t,e){void 0!==r&&(this.style[n]=i.call(this,t,e))})}transition(t){const n="function"!=typeof t?()=>t:t,r=this["_transitions"];return this.each(function(t,e){r[e]=n.call(this,t,e)})}on(t,e){return this.each(function(){this.addEventListener(t,e)}),this}call(t,...e){return t.call(this._parent,this,...e),this}node(){return this._elements[0]}nodes(){return this._elements}transitions(){return this._transitions}parent(){return this._parent}}Z0.registry={g:nt.Group,rect:nt.Rect,circle:nt.Circle,path:nt.Path,text:nt.Text,ellipse:nt.Ellipse,image:nt.Image,line:nt.Line,polygon:nt.Polygon,polyline:nt.Polyline,html:nt.HTML};const Q0=t=>{const u=t["radius"],f=rt(t,["shape","radius"]);var t=at(f,"pointer"),e=at(f,"pin");const h=t["shape"],d=rt(t,["shape"]),p=e["shape"],g=rt(e,["shape"]);return(t,e,n,r)=>{var t=t.map(t=>n.invert(t)),[i,a,o]=function(t,e){var[,...t]=(t=t.getOptions()["transformations"]).find(t=>t[0]===e);return t}(n,"polar");const s=n.clone();var l=e["color"],i=Rs({startAngle:i,endAngle:a,innerRadius:o,outerRadius:u});i.push(["cartesian"]),s.update({transformations:i});const c=t.map(t=>s.map(t));var[a,o]=X0(c),[i,t]=n.getCenter(),a=Object.assign(Object.assign({x1:a,y1:o,x2:i,y2:t,stroke:l},d),f),o=Object.assign(Object.assign({cx:i,cy:t,stroke:l},g),f),i=ot(new nt.Group);return Uu(h)||("function"==typeof h?i.append(()=>h(c,e,s,r)):i.append("line").call(j,a).node()),Uu(p)||("function"==typeof p?i.append(()=>p(c,e,s,r)):i.append("circle").call(j,o).node()),i.node()}},J0=f=>{const h={coordinate:{type:"radial",innerRadius:.9,outerRadius:1,startAngle:-1.1*Math.PI,endAngle:.1*Math.PI},axis:{x:!1},legend:!1,tooltip:!1,encode:{x:"x",y:"y",color:"color"},scale:{color:{range:["#30BF78","#D0D0D0"]}}},d={style:{shape:Q0,lineWidth:4,pointerLineCap:"round",pinR:10,pinFill:"#fff",radius:.6}},p={type:"text",style:{x:"50%",y:"60%",textAlign:"center",textBaseline:"middle",fontSize:20,fontWeight:800,fill:"#888"}};return()=>{var t,{data:e={},scale:n={},style:r={},animate:i={}}=f,a=rt(f,["data","scale","style","animate","transform"]),{targetData:e,totalData:n,target:o,total:s,scale:l}=function(t,e){const{name:n="score",target:r,total:i,percent:a,thresholds:o=[]}=t;var t=a||r,s=a?1:i,e=Object.assign({y:{domain:[0,s]}},e);return o.length?{targetData:[{x:n,y:t,color:"target"}],totalData:o.map((t,e)=>({x:n,y:1<=e?t-o[e-1]:t,color:e})),target:t,total:s,scale:e}:{targetData:[{x:n,y:t,color:"target"}],totalData:[{x:n,y:t,color:"target"},{x:n,y:s-t,color:"total"}],target:t,total:s,scale:e}}(e,n),c=at(r,"text"),u=(t=["pointer","pin"],Object.fromEntries(Object.entries(r).filter(([e])=>t.find(t=>e.startsWith(t)))));return[it({},h,Object.assign({type:"interval",transform:[{type:"stackY"}],data:n,scale:l,style:at(r,"arc"),animate:"object"==typeof i?at(i,"arc"):i},a)),it({},h,d,Object.assign({type:"point",data:e,scale:l,style:u,animate:"object"==typeof i?at(i,"indicator"):i},a)),it({},p,{style:Object.assign({text:([n,{target:r,total:e}]=[c,{target:o,total:s}],(n=n.content)?n(r,e):r.toString())},c),animate:"object"==typeof i?at(i,"text"):i})]}},t1=(J0.props={},()=>(i,t,e,a)=>{const{x:o,series:s}=e,l=Object.entries(e).filter(([t])=>t.startsWith("y")).map(([,t])=>t),c=Object.entries(e).filter(([t])=>t.startsWith("size")).map(([,t])=>t);if(void 0===o||void 0===l||void 0===c)throw new Error("Missing encode for x or y or size channel.");const u=t.x,f=t.series;e=Array.from(i,n=>{var t=u.getBandWidth(u.invert(+o[n])),e=t*(f?f.getBandWidth(f.invert(+(null===s||void 0===s?void 0:s[n]))):1),t=(+(null===s||void 0===s?void 0:s[n])||0)*t;const r=+o[n]+t+e/2;return[...l.map((t,e)=>[r+ +c[e][n]/i.length,+l[e][n]]),...l.map((t,e)=>[r-+c[e][n]/i.length,+l[e][n]]).reverse()].map(t=>a.map(t))});return[i,e]});t1.props={defaultShape:"density",defaultLabelShape:"label",composite:!1,channels:[...Hl({shapes:["density"]}),{name:"x",scale:"band",required:!0},{name:"y",required:!0},{name:"size",required:!0},{name:"series",scale:"band"},{name:"size",required:!0,scale:"identity"}],preInference:[...Ul(),{type:"maybeZeroY1"},{type:"maybeZeroX"}],postInference:[...Yl()],interaction:{shareTooltip:!0}};const e1=t=>(t,e,n,r)=>{const{x:i,y:a,size:o,color:s}=n;return[[0],[Array.from(t,t=>{var e=o?+o[t]:40;return[...r.map([+i[t],+a[t]]),s[t],e]})]]};e1.props={defaultShape:"heatmap",defaultLabelShape:"label",composite:!1,channels:[...Hl({shapes:["heatmap"]}),{name:"x",required:!0},{name:"y",required:!0},{name:"color",scale:"identity",required:!0},{name:"size"}],preInference:[...Ul(),{type:"maybeZeroY"},{type:"maybeZeroX"}],postInference:[...Vl()]};const n1=()=>["#5B8FF9","#5AD8A6","#5D7092","#F6BD16","#6F5EF9","#6DC8EC","#945FB9","#FF9845","#1E9493","#FF99C3"],r1=(n1.props={},()=>["#5B8FF9","#CDDDFD","#5AD8A6","#CDF3E4","#5D7092","#CED4DE","#F6BD16","#FCEBB9","#6F5EF9","#D3CEFD","#6DC8EC","#D3EEF9","#945FB9","#DECFEA","#FF9845","#FFE0C7","#1E9493","#BBDEDE","#FF99C3","#FFE0ED"]),i1=(r1.props={},t=>new Yp(t)),a1=(i1.props={},t=>new i0(t)),o1=(a1.props={},t=>new Hp(t)),s1=(o1.props={},t=>new Jp(t)),l1=(s1.props={},t=>new a0(t)),c1=(l1.props={},t=>new E0(t)),u1=(c1.props={},t=>new f0(t)),f1=(u1.props={},t=>new s0(t)),h1=(f1.props={},t=>new c0(t)),d1=(h1.props={},t=>new p0(t)),p1=(d1.props={},t=>new h0(t)),g1=(p1.props={},t=>new l0(t)),m1=(g1.props={},t=>new A0(t)),y1=(m1.props={},t=>new Up(t));function v1(t){return function(){return t}}y1.props={};const b1=Math.abs,x1=Math.atan2,w1=Math.cos,M1=Math.max,O1=Math.min,k1=Math.sin,_1=Math.sqrt,E1=1e-12,S1=Math.PI,A1=S1/2,L1=2*S1;function T1(t){return 1<=t?A1:t<=-1?-A1:Math.asin(t)}const j1=Math.PI,N1=2*j1,P1=1e-6,C1=N1-P1;function R1(n){this._+=n[0];for(let t=1,e=n.length;t<e;++t)this._+=arguments[t]+n[t]}class I1{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=null==t?R1:function(t){var e=Math.floor(t);if(!(0<=e))throw new Error("invalid digits: "+t);if(15<e)return R1;const r=10**e;return function(n){this._+=n[0];for(let t=1,e=n.length;t<e;++t)this._+=Math.round(arguments[t]*r)/r+n[t]}}(t)}moveTo(t,e){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}`}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,e){this._append`L${this._x1=+t},${this._y1=+e}`}quadraticCurveTo(t,e,n,r){this._append`Q${+t},${+e},${this._x1=+n},${this._y1=+r}`}bezierCurveTo(t,e,n,r,i,a){this._append`C${+t},${+e},${+n},${+r},${this._x1=+i},${this._y1=+a}`}arcTo(t,e,n,r,i){if(t=+t,e=+e,n=+n,r=+r,(i=+i)<0)throw new Error("negative radius: "+i);var a,o,s=this._x1,l=this._y1,c=n-t,u=r-e,f=s-t,h=l-e,d=f*f+h*h;null===this._x1?this._append`M${this._x1=t},${this._y1=e}`:d>P1&&(Math.abs(h*c-u*f)>P1&&i?(o=c*c+u*u,r=(n=n-s)*n+(s=r-l)*s,l=Math.sqrt(o),a=Math.sqrt(d),d=(o=i*Math.tan((j1-Math.acos((o+d-r)/(2*l*a)))/2))/a,r=o/l,Math.abs(d-1)>P1&&this._append`L${t+d*f},${e+d*h}`,this._append`A${i},${i},0,0,${+(f*s<h*n)},${this._x1=t+r*c},${this._y1=e+r*u}`):this._append`L${this._x1=t},${this._y1=e}`)}arc(t,e,n,r,i,a){if(t=+t,e=+e,a=!!a,(n=+n)<0)throw new Error("negative radius: "+n);let o=n*Math.cos(r),s=n*Math.sin(r),l=t+o,c=e+s,u=1^a,f=a?r-i:i-r;null===this._x1?this._append`M${l},${c}`:(Math.abs(this._x1-l)>P1||Math.abs(this._y1-c)>P1)&&this._append`L${l},${c}`,n&&((f=f<0?f%N1+N1:f)>C1?this._append`A${n},${n},0,1,${u},${t-o},${e-s}A${n},${n},0,1,${u},${this._x1=l},${this._y1=c}`:f>P1&&this._append`A${n},${n},0,${+(f>=j1)},${u},${this._x1=t+n*Math.cos(i)},${this._y1=e+n*Math.sin(i)}`)}rect(t,e,n,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}h${n=+n}v${+r}h${-n}Z`}toString(){return this._}}function B1(){return new I1}function F1(n){let r=3;return n.digits=function(t){if(!arguments.length)return r;if(null==t)r=null;else{var e=Math.floor(t);if(!(0<=e))throw new RangeError("invalid digits: "+t);r=e}return n},()=>new I1(r)}function D1(t){return t.innerRadius}function z1(t){return t.outerRadius}function W1(t){return t.startAngle}function G1(t){return t.endAngle}function q1(t){return t&&t.padAngle}function H1(t,e,n,r,i,a,o){var s=t-n,l=e-r,o=(o?a:-a)/_1(s*s+l*l),l=o*l,o=-o*s,s=t+l,t=e+o,e=n+l,n=r+o,r=(s+e)/2,c=(t+n)/2,u=e-s,f=n-t,h=u*u+f*f,a=i-a,s=s*n-e*t,n=(f<0?-1:1)*_1(M1(0,a*a*h-s*s)),e=(s*f-u*n)/h,t=(-s*u-f*n)/h,d=(s*f+u*n)/h,s=(-s*u+f*n)/h,u=e-r,f=t-c,n=d-r,h=s-c;return n*n+h*h<u*u+f*f&&(e=d,t=s),{cx:e,cy:t,x01:-l,y01:-o,x11:e*(i/a-1),y11:t*(i/a-1)}}function V1(){var A=D1,L=z1,T=v1(0),j=null,N=W1,P=G1,C=q1,R=null,I=F1(e);function e(){var t,e,n,r,i,a,o,s,l,c,u,f,h,d,p,g,m,y,v,b,x,w,M=+A.apply(this,arguments),O=+L.apply(this,arguments),k=N.apply(this,arguments)-A1,_=P.apply(this,arguments)-A1,E=b1(_-k),S=k<_;if(R=R||(t=I()),O<M&&(e=O,O=M,M=e),O>E1?E>L1-E1?(R.moveTo(O*w1(k),O*k1(k)),R.arc(0,0,O,k,_,!S),M>E1&&(R.moveTo(M*w1(_),M*k1(_)),R.arc(0,0,M,_,k,S))):(r=e=k,i=n=_,o=a=E,h=(u=C.apply(this,arguments)/2)>E1&&(j?+j.apply(this,arguments):_1(M*M+O*O)),w=x=s=O1(b1(O-M)/2,+T.apply(this,arguments)),h>E1&&(f=T1(h/M*k1(u)),h=T1(h/O*k1(u)),(a-=2*f)>E1?(r+=f*=S?1:-1,i-=f):(a=0,r=i=(k+_)/2),(o-=2*h)>E1?(e+=h*=S?1:-1,n-=h):(o=0,e=n=(k+_)/2)),u=O*w1(e),f=O*k1(e),h=M*w1(i),k=M*k1(i),s>E1&&(d=O*w1(n),p=O*k1(n),g=M*w1(r),m=M*k1(r),E<S1)&&((_=function(t,e,n,r,i,a,o,s){var l=(s=s-a)*(n=n-t)-(o=o-i)*(r=r-e);if(!(l*l<E1))return[t+(l=(o*(e-a)-s*(t-i))/l)*n,e+l*r]}(u,f,g,m,d,p,h,k))?(E=u-_[0],v=f-_[1],b=d-_[0],y=p-_[1],v=1/k1((1<(E=(E*b+v*y)/(_1(E*E+v*v)*_1(b*b+y*y)))?0:E<-1?S1:Math.acos(E))/2),b=_1(_[0]*_[0]+_[1]*_[1]),x=O1(s,(M-b)/(v-1)),w=O1(s,(O-b)/(1+v))):x=w=0),o>E1?w>E1?(l=H1(g,m,u,f,O,w,S),c=H1(d,p,h,k,O,w,S),R.moveTo(l.cx+l.x01,l.cy+l.y01),w<s?R.arc(l.cx,l.cy,w,x1(l.y01,l.x01),x1(c.y01,c.x01),!S):(R.arc(l.cx,l.cy,w,x1(l.y01,l.x01),x1(l.y11,l.x11),!S),R.arc(0,0,O,x1(l.cy+l.y11,l.cx+l.x11),x1(c.cy+c.y11,c.cx+c.x11),!S),R.arc(c.cx,c.cy,w,x1(c.y11,c.x11),x1(c.y01,c.x01),!S))):(R.moveTo(u,f),R.arc(0,0,O,e,n,!S)):R.moveTo(u,f),M>E1&&a>E1?x>E1?(l=H1(h,k,d,p,M,-x,S),c=H1(u,f,g,m,M,-x,S),R.lineTo(l.cx+l.x01,l.cy+l.y01),x<s?R.arc(l.cx,l.cy,x,x1(l.y01,l.x01),x1(c.y01,c.x01),!S):(R.arc(l.cx,l.cy,x,x1(l.y01,l.x01),x1(l.y11,l.x11),!S),R.arc(0,0,M,x1(l.cy+l.y11,l.cx+l.x11),x1(c.cy+c.y11,c.cx+c.x11),S),R.arc(c.cx,c.cy,x,x1(c.y11,c.x11),x1(c.y01,c.x01),!S))):R.arc(0,0,M,i,r,S):R.lineTo(h,k)):R.moveTo(0,0),R.closePath(),t)return R=null,t+""||null}return e.centroid=function(){var t=(+A.apply(this,arguments)+ +L.apply(this,arguments))/2,e=(+N.apply(this,arguments)+ +P.apply(this,arguments))/2-S1/2;return[w1(e)*t,k1(e)*t]},e.innerRadius=function(t){return arguments.length?(A="function"==typeof t?t:v1(+t),e):A},e.outerRadius=function(t){return arguments.length?(L="function"==typeof t?t:v1(+t),e):L},e.cornerRadius=function(t){return arguments.length?(T="function"==typeof t?t:v1(+t),e):T},e.padRadius=function(t){return arguments.length?(j=null==t?null:"function"==typeof t?t:v1(+t),e):j},e.startAngle=function(t){return arguments.length?(N="function"==typeof t?t:v1(+t),e):N},e.endAngle=function(t){return arguments.length?(P="function"==typeof t?t:v1(+t),e):P},e.padAngle=function(t){return arguments.length?(C="function"==typeof t?t:v1(+t),e):C},e.context=function(t){return arguments.length?(R=null==t?null:t,e):R},e}function Y1(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function $1(t){this._context=t}function U1(t){return new $1(t)}function K1(t){return t[0]}function X1(t){return t[1]}function Z1(o,s){var l=v1(!0),c=null,u=U1,f=null,h=F1(e);function e(t){var e,n,r,i=(t=Y1(t)).length,a=!1;for(null==c&&(f=u(r=h())),e=0;e<=i;++e)!(e<i&&l(n=t[e],e,t))===a&&((a=!a)?f.lineStart():f.lineEnd()),a&&f.point(+o(n,e,t),+s(n,e,t));if(r)return f=null,r+""||null}return o="function"==typeof o?o:void 0===o?K1:v1(o),s="function"==typeof s?s:void 0===s?X1:v1(s),e.x=function(t){return arguments.length?(o="function"==typeof t?t:v1(+t),e):o},e.y=function(t){return arguments.length?(s="function"==typeof t?t:v1(+t),e):s},e.defined=function(t){return arguments.length?(l="function"==typeof t?t:v1(!!t),e):l},e.curve=function(t){return arguments.length?(u=t,null!=c&&(f=u(c)),e):u},e.context=function(t){return arguments.length?(null==t?c=f=null:f=u(c=t),e):c},e}function Q1(u,f,h){var d=null,p=v1(!0),g=null,m=U1,y=null,v=F1(e);function e(t){var e,n,r,i,a,o=(t=Y1(t)).length,s=!1,l=new Array(o),c=new Array(o);for(null==g&&(y=m(a=v())),e=0;e<=o;++e){if(!(e<o&&p(i=t[e],e,t))===s)if(s=!s)n=e,y.areaStart(),y.lineStart();else{for(y.lineEnd(),y.lineStart(),r=e-1;n<=r;--r)y.point(l[r],c[r]);y.lineEnd(),y.areaEnd()}s&&(l[e]=+u(i,e,t),c[e]=+f(i,e,t),y.point(d?+d(i,e,t):l[e],h?+h(i,e,t):c[e]))}if(a)return y=null,a+""||null}function t(){return Z1().defined(p).curve(m).context(g)}return u="function"==typeof u?u:void 0===u?K1:v1(+u),f="function"==typeof f?f:v1(void 0===f?0:+f),h="function"==typeof h?h:void 0===h?X1:v1(+h),e.x=function(t){return arguments.length?(u="function"==typeof t?t:v1(+t),d=null,e):u},e.x0=function(t){return arguments.length?(u="function"==typeof t?t:v1(+t),e):u},e.x1=function(t){return arguments.length?(d=null==t?null:"function"==typeof t?t:v1(+t),e):d},e.y=function(t){return arguments.length?(f="function"==typeof t?t:v1(+t),h=null,e):f},e.y0=function(t){return arguments.length?(f="function"==typeof t?t:v1(+t),e):f},e.y1=function(t){return arguments.length?(h=null==t?null:"function"==typeof t?t:v1(+t),e):h},e.lineX0=e.lineY0=function(){return t().x(u).y(f)},e.lineY1=function(){return t().x(u).y(h)},e.lineX1=function(){return t().x(d).y(f)},e.defined=function(t){return arguments.length?(p="function"==typeof t?t:v1(!!t),e):p},e.curve=function(t){return arguments.length?(m=t,null!=g&&(y=m(g)),e):m},e.context=function(t){return arguments.length?(null==t?g=y=null:y=m(g=t),e):g},e}B1.prototype=I1.prototype,$1.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e)}}};var J1=eg(U1);function tg(t){this._curve=t}function eg(e){function t(t){return new tg(e(t))}return t._curve=e,t}function ng(t){var e=t.curve;return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t.curve=function(t){return arguments.length?e(eg(t)):e()._curve},t}function rg(){}function ig(t,e,n){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-n),t._x2,t._y2)}function ag(t,e){this._context=t,this._k=(1-e)/6}function og(t,e){this._context=t,this._k=(1-e)/6}function sg(t,e,n){var r,i,a=t._x1,o=t._y1,s=t._x2,l=t._y2;t._l01_a>E1&&(r=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,i=3*t._l01_a*(t._l01_a+t._l12_a),a=(a*r-t._x0*t._l12_2a+t._x2*t._l01_2a)/i,o=(o*r-t._y0*t._l12_2a+t._y2*t._l01_2a)/i),t._l23_a>E1&&(r=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,i=3*t._l23_a*(t._l23_a+t._l12_a),s=(s*r+t._x1*t._l23_2a-e*t._l12_2a)/i,l=(l*r+t._y1*t._l23_2a-n*t._l12_2a)/i),t._context.bezierCurveTo(a,o,s,l,t._x2,t._y2)}function lg(t,e){this._context=t,this._alpha=e}tg.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,e){this._curve.point(e*Math.sin(t),e*-Math.cos(t))}},ag.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:ig(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:ig(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}},function e(n){function t(t){return new ag(t,n)}return t.tension=function(t){return e(+t)},t}(0),og.prototype={areaStart:rg,areaEnd:rg,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:ig(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}},function e(n){function t(t){return new og(t,n)}return t.tension=function(t){return e(+t)},t}(0),lg.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var n,r;switch(t=+t,e=+e,this._point&&(n=this._x2-t,r=this._y2-e,this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))),this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:sg(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var cg=function e(n){function t(t){return n?new lg(t,n):new ag(t,0)}return t.alpha=function(t){return e(+t)},t}(.5);function ug(t,e){this._context=t,this._alpha=e}ug.prototype={areaStart:rg,areaEnd:rg,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){var n,r;switch(t=+t,e=+e,this._point&&(n=this._x2-t,r=this._y2-e,this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))),this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:sg(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var fg=function e(n){function t(t){return n?new ug(t,n):new og(t,0)}return t.alpha=function(t){return e(+t)},t}(.5);function hg(t){this._context=t}function dg(t){return new hg(t)}function pg(t,e){this._context=t,this._t=e}function gg(t){return new pg(t,.5)}function mg(t){return new pg(t,0)}function yg(t){return new pg(t,1)}function vg(t,e,n){return Math.max(e,Math.min(t,n))}function bg(t,e,n,r={}){var{inset:i=0,radius:a=0,insetLeft:o=i,insetTop:s=i,insetRight:l=i,insetBottom:c=i,radiusBottomLeft:u=a,radiusBottomRight:f=a,radiusTopLeft:h=a,radiusTopRight:d=a,minWidth:p=-1/0,maxWidth:g=1/0}=r,r=rt(r,["inset","radius","insetLeft","insetTop","insetRight","insetBottom","radiusBottomLeft","radiusBottomRight","radiusTopLeft","radiusTopRight","minWidth","maxWidth"]);if(!Kc(n)&&!Zc(n)){var m=!!Uc(n),[y,,v]=m?V0(t):t;const[O,w]=y;var[v,y]=R0(v,y),b=(0<v?O:O+v)+o,x=(0<y?w:w+y)+s,v=Math.abs(v)-(o+l),o=Math.abs(y)-(s+c),l=m?v:vg(v,p,g),y=m?vg(o,p,g):o,s=b-(l-v)/2,c=x-(y-o)/2;return ot(new nt.Rect({})).style("x",s).style("y",c).style("width",l).style("height",y).style("radius",[h,d,f,u]).call(j,r).node()}const{y:w,y1:M}=e;m=n.getCenter(),p=Y0(n,t,[w,M]),g=V1().cornerRadius(a).padAngle(i*Math.PI/180);return ot(new nt.Path({})).style("path",g(p)).style("transform",`translate(${m[0]}, ${m[1]})`).style("radius",a).style("inset",i).call(j,r).node()}hg.prototype={areaStart:rg,areaEnd:rg,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}},pg.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&2===this._point&&this._context.lineTo(this._x,this._y),(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),0<=this._line&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:var n;this._t<=0?(this._context.lineTo(this._x,e),this._context.lineTo(t,e)):(n=this._x*(1-this._t)+t*this._t,this._context.lineTo(n,this._y),this._context.lineTo(n,e))}this._x=t,this._y=e}};const xg=E=>{const{colorAttribute:S,first:A=!0,last:L=!0}=E,T=rt(E,["colorAttribute","opacityAttribute","first","last"]);return(t,e,n,r)=>{var{mark:i,shape:a,defaultShape:o}=e,r=$0(r,i,a,o),{defaultColor:i,radius:a=0}=r,o=rt(r,["defaultColor","radius"]),r=o.lineWidth||1,{stroke:s,radius:a=a,radiusTopLeft:l=a,radiusTopRight:c=a,radiusBottomRight:u=a,radiusBottomLeft:f=a,innerRadius:h=0,innerRadiusTopLeft:d=h,innerRadiusTopRight:p=h,innerRadiusBottomRight:g=h,innerRadiusBottomLeft:h=h,lineWidth:r="stroke"===S||s?r:0,inset:m=0,insetLeft:y=m,insetRight:v=m,insetBottom:b=m,insetTop:x=m,minWidth:w,maxWidth:M}=T,O=rt(T,["stroke","radius","radiusTopLeft","radiusTopRight","radiusBottomRight","radiusBottomLeft","innerRadius","innerRadiusTopLeft","innerRadiusTopRight","innerRadiusBottomRight","innerRadiusBottomLeft","lineWidth","inset","insetLeft","insetRight","insetBottom","insetTop","minWidth","maxWidth"]),{color:i=i,opacity:k}=e;const _=[A?l:d,A?c:p,L?u:g,L?f:h];l=["radiusTopLeft","radiusTopRight","radiusBottomRight","radiusBottomLeft"],Uc(n)&&l.push(l.shift()),d=Object.assign(Object.assign({radius:a},Object.fromEntries(l.map((t,e)=>[t,_[e]]))),{inset:m,insetLeft:y,insetRight:v,insetBottom:b,insetTop:x,minWidth:w,maxWidth:M});return ot(bg(t,e,n,d)).call(j,o).style("fill","transparent").style(S,i).style(U0(E),k).style("lineWidth",r).style("stroke",void 0===s?i:s).call(j,O).node()}},wg=(xg.props={defaultEnterAnimation:"scaleInY",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},t=>xg(Object.assign({colorAttribute:"fill"},t))),Mg=(wg.props=Object.assign(Object.assign({},xg.props),{defaultMarker:"square"}),t=>xg(Object.assign({colorAttribute:"stroke"},t)));Mg.props=Object.assign(Object.assign({},xg.props),{defaultMarker:"hollowSquare"});const Og=t=>{const{adjustPoints:c=function(t,e,n){var[t,r,i,a]=t;if(Uc(n)){const o=[(e?e[0]:r)[0],r[1]],s=[(e?e[3]:i)[0],i[1]];return[t,o,s,a]}const o=[r[0],(e?e[0]:r)[1]],s=[i[0],(e?e[3]:i)[1]];return[t,o,s,a]}}=t,u=rt(t,["adjustPoints"]);return(t,e,n,r,i)=>{var{index:a,mark:o,shape:s,defaultShape:l}=e,r=$0(r,o,s,l),o=r["defaultColor"],s=rt(r,["defaultColor"]),l=i[a+1],r=c(t,l,n),[i,a,t,l]=!!Uc(n)?V0(r):r,{color:n=o,opacity:r}=e,e=Z1().curve(dg)([i,a,t,l]);return ot(new nt.Path({})).call(j,s).style("path",e).style("fill",n).style("fillOpacity",r).call(j,u).node()}};function kg(t,e,n){var[t,r,i,a]=t;if(Uc(n)){const o=[e?e[0][0]:(r[0]+i[0])/2,r[1]],s=[e?e[3][0]:(r[0]+i[0])/2,i[1]];return[t,o,s,a]}const o=[r[0],e?e[0][1]:(r[1]+i[1])/2],s=[i[0],e?e[3][1]:(r[1]+i[1])/2];return[t,o,s,a]}Og.props={defaultMarker:"square"};const _g=t=>Og(Object.assign({adjustPoints:kg},t));function Eg(t){const e="function"==typeof t?t:t.render;return class extends nt.CustomElement{connectedCallback(){this.draw()}attributeChangedCallback(){this.draw()}draw(){e(this)}}}_g.props={defaultMarker:"square"};const Sg=Eg(t=>{var{d1:e,d2:n,style1:r,style2:i}=t.attributes;ot(t).maybeAppend("line",()=>new nt.Path({})).style("d",e).call(j,r),ot(t).maybeAppend("line1",()=>new nt.Path({})).style("d",n).call(j,i)});const Ag=t=>{const{curve:f,gradient:h=!1,gradientColor:d="between",defined:p=t=>!Number.isNaN(t)&&null!=t,connect:g=!1}=t,m=rt(t,["curve","gradient","gradientColor","defined","connect"]);return(t,e,n,r)=>{var{mark:i,shape:a,defaultShape:o}=e,r=$0(r,i,a,o),{defaultColor:i,lineWidth:a}=r,o=rt(r,["defaultColor","lineWidth"]),{color:r=i,size:i=a,seriesColor:a,seriesX:s,seriesY:l}=e,a=h&&a?H0(a,s,l,h,d):r,s=K0(n,e),l=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},o),a&&{stroke:a}),i&&{lineWidth:i}),s&&{transform:s}),m);let c;if(Kc(n)){const u=n.getCenter();c=n=>ng(Z1().curve(J1)).angle((t,e)=>D0(R0(n[e],u))).radius((t,e)=>B0(n[e],u)).defined(([t,e])=>p(t)&&p(e)).curve(f)(n)}else c=Z1().x(t=>t[0]).y(t=>t[1]).defined(([t,e])=>p(t)&&p(e)).curve(f);var[r,e]=function(t,e){var n=[],r=[];let i=!1,a=null;for(const o of t)e(o[0])&&e(o[1])?(n.push(o),i&&(i=!1,r.push([a,o])),a=o):i=!0;return[n,r]}(t,p),o=at(l,"connect"),a=!!e.length;return(!a||g&&!Object.keys(o).length?ot(new nt.Path({})).style("d",c(r)||[]).call(j,l):a&&!g?ot(new nt.Path({})).style("d",c(t)).call(j,l):ot(new Sg).style("style1",Object.assign(Object.assign({},l),o)).style("style2",l).style("d1",e.map(c).join(",")).style("d2",c(t))).node()}},Lg=(Ag.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},a=>(t,e,n,r)=>{var i=Kc(n)?dg:U1;return Ag(Object.assign({curve:i},a))(t,e,n,r)}),Tg=(Lg.props=Object.assign(Object.assign({},Ag.props),{defaultMarker:"line"}),t=>{const{alpha:a=.5}=t,o=rt(t,["alpha"]);return(t,e,n,r)=>{var i=Kc(n)?fg:cg;return Ag(Object.assign({curve:i.alpha(a)},o))(t,e,n,r)}}),jg=(Tg.props=Object.assign(Object.assign({},Ag.props),{defaultMarker:"smooth"}),t=>Ag(Object.assign({curve:yg},t))),Ng=(jg.props=Object.assign(Object.assign({},Ag.props),{defaultMarker:"hv"}),t=>Ag(Object.assign({curve:mg},t))),Pg=(Ng.props=Object.assign(Object.assign({},Ag.props),{defaultMarker:"vh"}),t=>Ag(Object.assign({curve:gg},t)));Pg.props=Object.assign(Object.assign({},Ag.props),{defaultMarker:"hvh"});const Cg=M=>(e,t,n,r)=>{var i,a,o,s,l,c,u,f,h,{mark:t,shape:d,defaultShape:p,seriesSize:g,color:m}=t,r=$0(r,t,d,p),t=r["defaultColor"],d=rt(r,["defaultColor"]),y=B1();for(let t=0;t<e.length-1;t++){var v=e[t],b=e[t+1],x=g[t],w=g[t+1];i=y,x=x,w=w,l=o=a=h=f=u=c=l=s=a=o=a=void 0,a=(l=F0(R0(b=b,v=v)))+Math.PI/2,o=[x/2*Math.cos(a),x/2*Math.sin(a)],a=[w/2*Math.cos(a),w/2*Math.sin(a)],s=[w/2*Math.cos(l),w/2*Math.sin(l)],l=[x/2*Math.cos(l),x/2*Math.sin(l)],c=I0(v,o),u=I0(b,a),f=I0(u,s),h=R0(s=I0(b,s),a),b=R0(b,a),a=R0(v,o),o=R0(a,l),v=R0(v,l),l=R0(c,l),i.moveTo(...c),i.lineTo(...u),i.arcTo(...f,...s,w/2),i.arcTo(...h,...b,w/2),i.lineTo(...a),i.arcTo(...o,...v,x/2),i.arcTo(...l,...c,x/2),i.closePath()}return ot(new nt.Path({})).call(j,d).style("fill",m||t).style("d",y.toString()).call(j,M).node()};Cg.props=Object.assign(Object.assign({},Ag.props),{defaultMarker:"line"});var ds=(t,e,n)=>[["M",t-n,e],["A",n,n,0,1,0,t+n,e],["A",n,n,0,1,0,t-n,e],["Z"]],vs=(ds.style=["fill"],ds.bind(void 0)),Ro=(vs.style=["stroke","lineWidth"],(t,e,n)=>[["M",t-n,e-n],["L",t+n,e-n],["L",t+n,e+n],["L",t-n,e+n],["Z"]]),ss=(Ro.style=["fill"],Ro.bind(void 0)),Po=(ss.style=["fill"],Ro.bind(void 0)),as=(Po.style=["stroke","lineWidth"],(t,e,n)=>{var r=.618*n;return[["M",t-r,e],["L",t,e-n],["L",t+r,e],["L",t,e+n],["Z"]]}),Rg=(as.style=["fill"],as.bind(void 0)),os=(Rg.style=["stroke","lineWidth"],(t,e,n)=>{var r=n*Math.sin(1/3*Math.PI);return[["M",t-n,e+r],["L",t,e-r],["L",t+n,e+r],["Z"]]}),Bl=(os.style=["fill"],os.bind(void 0)),e=(Bl.style=["stroke","lineWidth"],(t,e,n)=>{var r=n*Math.sin(1/3*Math.PI);return[["M",t-n,e-r],["L",t+n,e-r],["L",t,e+r],["Z"]]}),ho=(e.style=["fill"],e.bind(void 0)),n=(ho.style=["stroke","lineWidth"],(t,e,n)=>{var r=n/2*Math.sqrt(3);return[["M",t,e-n],["L",t+r,e-n/2],["L",t+r,e+n/2],["L",t,e+n],["L",t-r,e+n/2],["L",t-r,e-n/2],["Z"]]}),r=(n.style=["fill"],n.bind(void 0)),rs=(r.style=["stroke","lineWidth"],(t,e,n)=>{var r=n-1.5;return[["M",t-n,e-r],["L",t+n,e+r],["L",t+n,e-r],["L",t-n,e+r],["Z"]]}),yo=(rs.style=["fill"],rs.bind(void 0)),so=(yo.style=["stroke","lineWidth"],(t,e,n)=>[["M",t,e+n],["L",t,e-n]]),a=(so.style=["stroke","lineWidth"],(t,e,n)=>[["M",t-n,e-n],["L",t+n,e+n],["M",t+n,e-n],["L",t-n,e+n]]),po=(a.style=["stroke","lineWidth"],(t,e,n)=>[["M",t-n/2,e-n],["L",t+n/2,e-n],["M",t,e-n],["L",t,e+n],["M",t-n/2,e+n],["L",t+n/2,e+n]]),go=(po.style=["stroke","lineWidth"],(t,e,n)=>[["M",t-n,e],["L",t+n,e],["M",t,e-n],["L",t,e+n]]),i=(go.style=["stroke","lineWidth"],(t,e,n)=>[["M",t-n,e],["L",t+n,e]]),vo=(i.style=["stroke","lineWidth"],(t,e,n)=>[["M",t-n,e],["L",t+n,e]]),bo=(vo.style=["stroke","lineWidth"],vo.bind(void 0)),_o=(bo.style=["stroke","lineWidth"],(t,e,n)=>[["M",t-n,e],["A",n/2,n/2,0,1,1,t,e],["A",n/2,n/2,0,1,0,t+n,e]]),Eo=(_o.style=["stroke","lineWidth"],(t,e,n)=>[["M",t-n-1,e-2.5],["L",t,e-2.5],["L",t,e+2.5],["L",t+n+1,e+2.5]]),So=(Eo.style=["stroke","lineWidth"],(t,e,n)=>[["M",t-n-1,e+2.5],["L",t,e+2.5],["L",t,e-2.5],["L",t+n+1,e-2.5]]),Ao=(So.style=["stroke","lineWidth"],(t,e,n)=>[["M",t-(n+1),e+2.5],["L",t-n/2,e+2.5],["L",t-n/2,e-2.5],["L",t+n/2,e-2.5],["L",t+n/2,e+2.5],["L",t+n+1,e+2.5]]),Lo=(Ao.style=["stroke","lineWidth"],(t,e,n)=>[["M",t-5,e+2.5],["L",t-5,e],["L",t,e],["L",t,e-3],["L",t,e+3],["L",t+6.5,e+3]]);Lo.style=["stroke","lineWidth"];const Ig=new Map([["bowtie",rs],["cross",a],["dash",bo],["diamond",as],["dot",vo],["hexagon",n],["hollowBowtie",yo],["hollowDiamond",Rg],["hollowHexagon",r],["hollowPoint",vs],["hollowSquare",Po],["hollowTriangle",Bl],["hollowTriangleDown",ho],["hv",Eo],["hvh",Ao],["hyphen",i],["line",so],["plus",go],["point",ds],["rect",ss],["smooth",_o],["square",Ro],["tick",po],["triangleDown",e],["triangle",os],["vh",So],["vhv",Lo]]);const l=u=>{const{colorAttribute:f,symbol:t,mode:h="auto"}=u,d=rt(u,["colorAttribute","symbol","mode"]),p=Ig.get(t)||Ig.get("point");return(t,e,n,r)=>{var{mark:i,shape:a,defaultShape:o}=e,r=$0(r,i,a,o),{defaultColor:i,lineWidth:a}=r,o=rt(r,["defaultColor","lineWidth"]),r=d.stroke?a||1:a,{color:a=i,transform:i,opacity:s}=e,[l,c]=X0(t),t=function(t,e,n,r){var i;if(1!==e.length)return n=n["size"],"fixed"!==t&&("normal"===t||Jc(r))?([[t,r],[e,i]]=e,e=Math.abs((e-t)/2),t=Math.abs((i-r)/2),Math.max(0,(e+t)/2)):n}(h,t,e,n)||d.r||o.r;return ot(new nt.Path).call(j,o).style("fill","transparent").style("d",p(l,c,t)).style("lineWidth",r).style("transform",i).style("stroke",a).style(U0(u),s).style(f,a).call(j,d).node()}},Bg=(l.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},t=>l(Object.assign({colorAttribute:"fill",symbol:"bowtie"},t))),Fg=(Bg.props=Object.assign({defaultMarker:"bowtie"},l.props),t=>l(Object.assign({colorAttribute:"stroke",symbol:"cross"},t))),Dg=(Fg.props=Object.assign({defaultMarker:"cross"},l.props),t=>l(Object.assign({colorAttribute:"fill",symbol:"diamond"},t))),zg=(Dg.props=Object.assign({defaultMarker:"diamond"},l.props),t=>l(Object.assign({colorAttribute:"fill",symbol:"hexagon"},t))),Wg=(zg.props=Object.assign({defaultMarker:"hexagon"},l.props),t=>l(Object.assign({colorAttribute:"stroke",symbol:"bowtie"},t))),Gg=(Wg.props=Object.assign({defaultMarker:"hollowBowtie"},l.props),t=>l(Object.assign({colorAttribute:"stroke",symbol:"diamond"},t))),qg=(Gg.props=Object.assign({defaultMarker:"hollowDiamond"},l.props),t=>l(Object.assign({colorAttribute:"stroke",symbol:"hexagon"},t))),Hg=(qg.props=Object.assign({defaultMarker:"hollowHexagon"},l.props),t=>l(Object.assign({colorAttribute:"stroke",symbol:"point"},t))),Vg=(Hg.props=Object.assign({defaultMarker:"hollowPoint"},l.props),t=>l(Object.assign({colorAttribute:"stroke",symbol:"square"},t))),Yg=(Vg.props=Object.assign({defaultMarker:"hollowSquare"},l.props),t=>l(Object.assign({colorAttribute:"stroke",symbol:"triangle"},t))),$g=(Yg.props=Object.assign({defaultMarker:"hollowTriangle"},l.props),t=>l(Object.assign({colorAttribute:"stroke",symbol:"triangle-down"},t))),Ug=($g.props=Object.assign({defaultMarker:"hollowTriangleDown"},l.props),t=>l(Object.assign({colorAttribute:"stroke",symbol:"hyphen"},t))),Kg=(Ug.props=Object.assign({defaultMarker:"hyphen"},l.props),t=>l(Object.assign({colorAttribute:"stroke",symbol:"line"},t))),Xg=(Kg.props=Object.assign({defaultMarker:"line"},l.props),t=>l(Object.assign({colorAttribute:"stroke",symbol:"plus"},t))),Zg=(Xg.props=Object.assign({defaultMarker:"plus"},l.props),t=>l(Object.assign({colorAttribute:"fill",symbol:"point"},t))),Qg=(Zg.props=Object.assign({defaultMarker:"point"},l.props),t=>l(Object.assign({colorAttribute:"fill",symbol:"square"},t))),Jg=(Qg.props=Object.assign({defaultMarker:"square"},l.props),t=>l(Object.assign({colorAttribute:"stroke",symbol:"tick"},t))),tm=(Jg.props=Object.assign({defaultMarker:"tick"},l.props),t=>l(Object.assign({colorAttribute:"fill",symbol:"triangle"},t))),em=(tm.props=Object.assign({defaultMarker:"triangle"},l.props),t=>l(Object.assign({colorAttribute:"fill",symbol:"triangle-down"},t))),nm=(em.props=Object.assign({defaultMarker:"triangleDown"},l.props),t=>{const{arrow:h=!0,arrowSize:d="40%"}=t,p=rt(t,["arrow","arrowSize"]);return(t,e,n,r)=>{var i,a,o,s,{mark:l,shape:c,defaultShape:u,transform:f}=e,r=$0(r,l,c,u),l=r["defaultColor"],c=rt(r,["defaultColor"]),{color:u=l}=e,[r,e]=t,t=B1();return t.moveTo(...r),t.lineTo(...e),h&&([o,s]=(r=r,i=e,a="string"==typeof(a=(a={arrowSize:d})["arrowSize"])?+parseFloat(a)/100*B0(r,i):a,o=Math.PI/6,r=Math.atan2(i[1]-r[1],i[0]-r[0]),s=Math.PI/2-r-o,r-=o,[[i[0]-a*Math.sin(s),i[1]-a*Math.cos(s)],[i[0]-a*Math.cos(r),i[1]-a*Math.sin(r)]]),t.moveTo(...e),t.lineTo(...o),t.moveTo(...e),t.lineTo(...s)),ot(new nt.Path).call(j,c).style("d",t.toString()).style("stroke",u||l).style("transform",f).call(j,p).node()}});function rm(t){am(t,!0)}function im(t){am(t,!1)}function am(t,e){var n=e?"visible":"hidden";!function e(t,n){n(t),t.children&&t.children.forEach(function(t){t&&e(t,n)})}(t,function(t){t.attr("visibility",n)})}nm.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};ce(lm,om=nt.Group);var om,sm=lm;function lm(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=om.apply(this,v([],O(t),!1))||this;return n.addEventListener(nt.ElementEvent.INSERTED,function(){im(n)}),n}function cm(t){t=t.appendChild(new sm({class:"offscreen"}));return im(t),t}ce(hm,um=nt.Text),Object.defineProperty(hm.prototype,"offscreenGroup",{get:function(){return this._offscreen||(this._offscreen=cm(this)),this._offscreen},enumerable:!1,configurable:!0}),hm.prototype.disconnectedCallback=function(){var t;null!=(t=this._offscreen)&&t.destroy()};var um,fm=hm;function hm(t){var e=(t=void 0===t?{}:t).style,t=rt(t,["style"]);return um.call(this,y({style:y({text:"",fill:"black",fontFamily:"sans-serif",fontSize:16,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",lineWidth:1,textAlign:"start",textBaseline:"middle"},e)},t))||this}function dm(t){return t*Math.PI/180}function pm(t){return Number((180*t/Math.PI).toPrecision(5))}Object.defineProperty(mm.prototype,"bottom",{get:function(){return this.y+this.height},enumerable:!1,configurable:!0}),Object.defineProperty(mm.prototype,"left",{get:function(){return this.x},enumerable:!1,configurable:!0}),Object.defineProperty(mm.prototype,"right",{get:function(){return this.x+this.width},enumerable:!1,configurable:!0}),Object.defineProperty(mm.prototype,"top",{get:function(){return this.y},enumerable:!1,configurable:!0}),mm.fromRect=function(t){return new mm(t.x,t.y,t.width,t.height)},mm.prototype.toJSON=function(){return{x:this.x,y:this.y,width:this.width,height:this.height,top:this.top,right:this.right,bottom:this.bottom,left:this.left}};var gm=mm;function mm(t,e,n,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===n&&(n=0),void 0===r&&(r=0),this.x=0,this.y=0,this.width=0,this.height=0,this.x=t,this.y=e,this.width=n,this.height=r}function ym(t,e){return Ie(t)?t.apply(void 0,v([],O(e),!1)):t}function vm(t,e){function r(t){return"".concat(e,"-").concat(t)}return t=Object.fromEntries(Object.entries(t).map(function(t){var t=O(t,2),e=t[0],t=t[1],n=r(t);return[e,{name:n,class:".".concat(n),id:"#".concat(n),toString:function(){return n}}]})),Object.assign(t,{prefix:r}),t}function bm(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r+=1)wm(t,e[r]);return t}var xm,wm=function(r,i,a,o){void 0===a&&(a=0),void 0===o&&(o=5),Object.entries(i).forEach(function(t){var t=O(t,2),e=t[0],t=t[1],n=r;Object.prototype.hasOwnProperty.call(i,e)&&(t?Ge(t)?(Ge(r[e])||(n[e]={}),a<o?wm(r[e],t,a+1,o):n[e]=i[e]):De(t)?(n[e]=[],n[e]=n[e].concat(t)):n[e]=t:n[e]=t)})},Mm=function(t){return void 0!==t&&null!=t&&!Number.isNaN(t)},Om=rn(function(t,e){var n=Ve(t)?t:t.style.text.toString(),e=e||km(t),t=e.fontSize,r=e.fontFamily,i=e.fontWeight,a=e.fontStyle,e=e.fontVariant;return(xm=xm||document.createElement("canvas").getContext("2d")).font=[a,e,i,"".concat(t,"px"),r].join(" "),xm.measureText(n).width},function(t,e){return[Ve(t)?t:t.style.text.toString(),Object.values(e||km(t)).join()].join("")}),km=function(t){var e=t.style.fontFamily||"sans-serif",n=t.style.fontWeight||"normal",r=t.style.fontStyle||"normal",i=t.style.fontVariant,t=t.style.fontSize;return{fontSize:"object"==typeof t?t.value:t,fontFamily:e,fontWeight:n,fontStyle:r,fontVariant:i}};function _m(t){return"text"===t.nodeName?t:"g"===t.nodeName&&1===t.children.length&&"text"===t.children[0].nodeName?t.children[0]:null}function Em(t,e){t=_m(t);t&&t.attr(e)}function Sm(t,e,n){Em(t,{wordWrap:!0,wordWrapWidth:e,maxLines:1,textOverflow:n=void 0===n?"...":n})}function Am(t){var e=t.canvas,n=t.touches,r=t.offsetX,t=t.offsetY;return e?[e.x,e.y]:n?[(e=n[0]).clientX,e.clientY]:r&&t?[r,t]:[0,0]}function Lm(t){return"function"==typeof t?t():Ve(t)||$e(t)?new fm({style:{text:String(t)}}):t}function Tm(t,e,n,r,i){return void 0===r&&(r=!0),void 0===i&&(i=function(t){t.node().removeChildren()}),t?n(e):(r&&i(e),null)}function jm(t,e,n,r,i){return(r=void 0===r?!0:r)&&t===e||i&&t===n||e<t&&t<n}var Nm=function(e,n){return function(t){return e*(1-t)+n*t}};function Pm(e,t){var i,a,o,s,n,r,l;return"number"==typeof e&&"number"==typeof t?Nm(e,t):Array.isArray(e)&&Array.isArray(t)?(i=e,o=(a=t)?a.length:0,s=i?Math.min(o,i.length):0,function(t){for(var e=new Array(s),n=new Array(o),r=0,r=0;r<s;++r)e[r]=Pm(i[r],a[r]);for(;r<o;++r)n[r]=a[r];for(r=0;r<s;++r)n[r]=e[r](t);return n}):"object"==typeof e&&"object"==typeof t?(void 0===(n=e)&&(n={}),void 0===(t=t)&&(t={}),r={},l={},Object.entries(t).forEach(function(t){var t=O(t,2),e=t[0],t=t[1];e in n?r[e]=Pm(n[e],t):l[e]=t}),function(n){return Object.entries(r).forEach(function(t){var t=O(t,2),e=t[0],t=t[1];return l[e]=t(n)}),l}):function(t){return e}}function Cm(t){for(var e=1/0,n=1/0,r=-1/0,i=-1/0,a=0;a<t.length;a++){var o=t[a],s=o.x,l=o.y,o=O([s+o.width,l+o.height],2),c=o[0],o=o[1];s<e&&(e=s),l<n&&(n=l),r<c&&(r=c),i<o&&(i=o)}return new gm(e,n,r-e,i-n)}function Rm(n,t,e){function r(t){var e=O(u?["height",a]:["width",i],2),n=e[0],r=e[1];switch(c){case"flex-start":return 0;case"flex-end":return r-t[n];case"center":return r/2-t[n]/2;default:return 0}}var i=n.width,a=n.height,o=void 0===(o=e.flexDirection)?"row":o,s=(e.flexWrap,e.justifyContent),l=void 0===s?"flex-start":s;e.alignContent;var c=void 0===(s=e.alignItems)?"flex-start":s,u="row"===o,e="row"===o||"column"===o,f=u?e?[1,0]:[-1,0]:e?[0,1]:[0,-1],h=(s=O([0,0],2))[0],d=s[1],e=Cm(o=t.map(function(t){var e=t.width,t=t.height,n=O([h,d],2),r=n[0],n=n[1],i=O([h+e*f[0],d+t*f[1]],2);return h=i[0],d=i[1],new gm(r,n,e,t)})),p={"flex-start":0,"flex-end":u?i-e.width:a-e.height,center:u?(i-e.width)/2:(a-e.height)/2};return Cm(s=o.map(function(t){var e=t.x,n=t.y,t=gm.fromRect(t);return t.x=u?e+p[l]:e,t.y=u?n:n+p[l],t})),s.map(function(t){var e=t.x,n=t.y,t=gm.fromRect(t);return t.x=u?e:e+r(t),t.y=u?n+r(t):n,t}).map(function(t){var e,t=gm.fromRect(t);return t.x+=null!=(e=n.x)?e:0,t.y+=null!=(e=n.y)?e:0,t})}function Im(t,e,n){return[]}function Bm(t,e){return[t[0]*e,t[1]*e]}function Fm(t,e){return[t[0]+e[0],t[1]+e[1]]}function Dm(t,e){return[t[0]-e[0],t[1]-e[1]]}function zm(t,e){return[Math.min(t[0],e[0]),Math.min(t[1],e[1])]}function Wm(t,e){return[Math.max(t[0],e[0]),Math.max(t[1],e[1])]}function Gm(t,e){return Math.sqrt(Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2))}function qm(t){var e;return 0===t[0]&&0===t[1]?[0,0]:(e=Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)),[t[0]/e,t[1]/e])}function Hm(t,e){e=Math.pow(10,e);return~~(t*e)/e}function Vm(t,e){var n,r={},i=Array.isArray(e)?e:[e];for(n in t)i.includes(n)||(r[n]=t[n]);return r}function Ym(t,e,n){void 0===n&&(n=[[0,0],[1,1]]);for(var e=!!(e=void 0===e?!1:e),r=[],i=0,a=t.length;i<a;i+=2)r.push([t[i],t[i+1]]);for(var o,s,l,c=function(t,e,n,r){var i,a=[],o=!!r,s=[1/0,1/0],l=[-1/0,-1/0];if(o){s=(r=O(r,2))[0],l=r[1];for(var c=0,u=t.length;c<u;c+=1)s=zm(s,x=t[c]),l=Wm(l,x)}for(var c=0,f=t.length;c<f;c+=1){var h,d,p,g,m,y,v,b,x=t[c];0!==c||n?c!==f-1||n?(h=t[[c?c-1:f-1,c-1][n?0:1]],y=[0,0],y=Bm(y=Dm(d=t[n?(c+1)%f:c+1],h),e),0!==(m=(p=Gm(x,h))+(g=Gm(x,d)))&&(p/=m,g/=m),m=Bm(y,-p),y=Bm(y,g),v=Fm(x,m),b=zm(b=Fm(x,y),Wm(d,x)),b=Wm(b,zm(d,x)),v=zm(v=Fm(x,m=Bm(m=Dm(b,x),-p/g)),Wm(h,x)),b=Fm(x,y=Bm(y=Dm(x,v=Wm(v,zm(h,x))),g/p)),o&&(v=zm(v=Wm(v,s),l),b=zm(b=Wm(b,s),l)),a.push(i),a.push(v),i=b):(v=x,a.push(i),a.push(v)):i=x}return n&&a.push(a.shift()),a}(r,.4,e,n),u=r.length,f=[],i=0;i<u-1;i+=1)o=c[2*i],s=c[2*i+1],f.push(["C",o[0],o[1],s[0],s[1],(l=r[i+1])[0],l[1]]);return e&&(o=c[u],s=c[u+1],l=O(r,1)[0],f.push(["C",o[0],o[1],s[0],s[1],l[0],l[1]])),f}var $m=["$el","anchor","cx","cy","d","defX","defY","dx","dy","fill","fillOpacity","filter","fontFamily","fontSize","fontStyle","fontVariant","fontWeight","height","img","increasedLineWidthForHitTesting","innerHTML","isBillboard","isClosed","isOverflowing","leading","letterSpacing","lineDash","lineHeight","lineWidth","markerEnd","markerEndOffset","markerMid","markerStart","markerStartOffset","maxLines","metrics","miterLimit","offsetX","offsetY","opacity","path","points","r","radius","rx","ry","shadowColor","src","stroke","strokeOpacity","text","textAlign","textBaseline","textDecorationColor","textDecorationLine","textDecorationStyle","textOverflow","textPath","textPathSide","textPathStartOffset","transform","transformOrigin","visibility","width","wordWrap","wordWrapWidth","x","x1","x2","y","y1","y2","z1","z2","zIndex"];function Um(t){var e,n,r={};for(e in t)n=e,$m.includes(n)&&(r[e]=t[e]);return r}function Km(t,e,n){void 0===n&&(n=!1);var r=t.getBBox(),i=r.width,r=r.height,e=e/Math.max(i,r);n&&t.scale(e)}M.prototype.selectAll=function(t){return new M("string"==typeof t?this._parent.querySelectorAll(t):t,null,this._elements[0],this._document)},M.prototype.selectFacetAll=function(t){t="string"==typeof t?this._parent.querySelectorAll(t):t;return new M(this._elements,null,this._parent,this._document,void 0,void 0,t)},M.prototype.select=function(t){t="string"==typeof t?this._parent.querySelectorAll(t)[0]||null:t;return new M([t],null,t,this._document)},M.prototype.append=function(t){var e=this,n="function"==typeof t?t:function(){return e.createElement(t)},r=[];if(null!==this._data){for(var i=0;i<this._data.length;i++){var a=this._data[i],a=O(Array.isArray(a)?a:[a,null],2),o=a[0],a=a[1];(l=n(o,i)).__data__=o,null!==a&&(l.__fromElements__=a),this._parent.appendChild(l),r.push(l)}return new M(r,null,this._parent,this._document)}for(i=0;i<this._elements.length;i++){var s=this._elements[i],l=n(o=s.__data__,i);s.appendChild(l),r.push(l)}return new M(r,null,r[0],this._document)},M.prototype.maybeAppend=function(t,e){e=he(this,Xm,"m",Zm).call(this,"#"===t[0]?t:"#".concat(t),e);return e.attr("id",t),e},M.prototype.maybeAppendByClassName=function(t,e){t=t.toString(),e=he(this,Xm,"m",Zm).call(this,"."===t[0]?t:".".concat(t),e);return e.attr("className",t),e},M.prototype.maybeAppendByName=function(t,e){e=he(this,Xm,"m",Zm).call(this,'[name="'.concat(t,'"]'),e);return e.attr("name",t),e},M.prototype.data=function(t,n,e){void 0===n&&(n=function(t){return t}),void 0===e&&(e=function(){return null});for(var r,i,a=[],o=[],s=new Set(this._elements),l=[],c=new Set,u=new Map(this._elements.map(function(t,e){return[n(t.__data__,e),t]})),f=new Map(this._facetElements.map(function(t,e){return[n(t.__data__,e),t]})),h=bc(this._elements,function(t){return e(t.__data__)}),d=0;d<t.length;d++){var p=t[d],g=n(p,d),m=e(p,d);if(u.has(g))(x=u.get(g)).__data__=p,x.__facet__=!1,o.push(x),s.delete(x),u.delete(g);else if(f.has(g))(x=f.get(g)).__data__=p,x.__facet__=!0,o.push(x),f.delete(g);else if(h.has(g)){var y=h.get(g);l.push([p,y]);try{r=void 0;for(var v=fe(y),b=v.next();!b.done;b=v.next()){var x=b.value;s.delete(x)}}catch(t){r={error:t}}finally{try{b&&!b.done&&(i=v.return)&&i.call(v)}finally{if(r)throw r.error}}h.delete(g)}else u.has(m)?((x=u.get(m)).__toData__?x.__toData__.push(p):x.__toData__=[p],c.add(x),s.delete(x)):a.push(p)}var w=[new M([],a,this._parent,this._document),new M(o,null,this._parent,this._document),new M(s,null,this._parent,this._document),new M([],l,this._parent,this._document),new M(c,null,this._parent,this._document)];return new M(this._elements,null,this._parent,this._document,w)},M.prototype.merge=function(t){var e=v(v([],O(this._elements),!1),O(t._elements),!1),t=v(v([],O(this._transitions),!1),O(t._transitions),!1);return new M(e,null,this._parent,this._document,void 0,t)},M.prototype.createElement=function(t){if(this._document)return this._document.createElement(t,{});var e=M.registry[t];if(e)return new e;throw e="Unknown node type: ".concat(t),new Error(e)},M.prototype.join=function(t,e,n,r,i){void 0===e&&(e=function(t){return t}),void 0===n&&(n=function(t){return t.remove()}),void 0===r&&(r=function(t){return t}),void 0===i&&(i=function(t){return t.remove()});t=(t=void 0===t?function(t){return t}:t)(this._enter),e=e(this._update),n=n(this._exit),r=r(this._merge),i=i(this._split);return e.merge(t).merge(n).merge(r).merge(i)},M.prototype.remove=function(){for(var n=this,t=0;t<this._elements.length;t++)!function(t){var e=n._elements[t],t=n._transitions[t];t?t.then(function(){return e.remove()}):e.remove()}(t);return new M([],null,this._parent,this._document,void 0,this._transitions)},M.prototype.each=function(t){for(var e=0;e<this._elements.length;e++){var n=this._elements[e],r=n.__data__;t.call(n,r,e)}return this},M.prototype.attr=function(n,r){var i="function"!=typeof r?function(){return r}:r;return this.each(function(t,e){void 0!==r&&(this[n]=i.call(this,t,e))})},M.prototype.style=function(n,r,t){void 0===t&&(t=!0);var i="function"==typeof r&&t?r:function(){return r};return this.each(function(t,e){void 0!==r&&(this.style[n]=i.call(this,t,e))})},M.prototype.styles=function(t,o){return void 0===t&&(t={}),void 0===o&&(o=!0),this.each(function(r,i){var a=this;Object.entries(t).forEach(function(t){var t=O(t,2),e=t[0],n=t[1],t="function"==typeof n&&o?n:function(){return n};void 0!==n&&a.attr(e,t.call(a,r,i))})})},M.prototype.update=function(n,t){void 0===t&&(t=!0);var r="function"==typeof n&&t?n:function(){return n};return this.each(function(t,e){n&&this.update&&this.update(r.call(this,t,e))})},M.prototype.maybeUpdate=function(n,t){void 0===t&&(t=!0);var r="function"==typeof n&&t?n:function(){return n};return this.each(function(t,e){n&&this.update&&this.update(r.call(this,t,e))})},M.prototype.transition=function(n){var r=this._transitions;return this.each(function(t,e){r[e]=n.call(this,t,e)})},M.prototype.on=function(t,e){return this.each(function(){this.addEventListener(t,e)}),this},M.prototype.call=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return t.call.apply(t,v([this._parent,this],O(e),!1)),this},M.prototype.node=function(){return this._elements[0]},M.prototype.nodes=function(){return this._elements},M.prototype.transitions=function(){return this._transitions.filter(function(t){return!!t})},M.prototype.parent=function(){return this._parent},Xm=new WeakSet,Zm=function(t,e){var n=this._elements[0],t=n.querySelector(t);return t||(t="string"==typeof e?this.createElement(e):e(),n.appendChild(t)),new M([t],null,this._parent,this._document)},M.registry={g:nt.Group,rect:nt.Rect,circle:nt.Circle,path:nt.Path,text:fm,ellipse:nt.Ellipse,image:nt.Image,line:nt.Line,polygon:nt.Polygon,polyline:nt.Polyline,html:nt.HTML};var Xm,Zm,Qm=M;function M(t,e,n,r,i,a,o){void 0===t&&(t=null),void 0===e&&(e=null),void 0===n&&(n=null),void 0===r&&(r=null),void 0===i&&(i=[null,null,null,null,null]),void 0===a&&(a=[]),void 0===o&&(o=[]),Xm.add(this),this._elements=Array.from(t),this._data=e,this._parent=n,this._document=r,this._enter=i[0],this._update=i[1],this._exit=i[2],this._merge=i[3],this._split=i[4],this._transitions=a,this._facetElements=o}function w(t){return new Qm([t],null,t,t.ownerDocument)}function Jm(t,e,n){return t.querySelector(e)?w(t).select(e):w(t).append(n)}function ty(t){if($e(t))return[t,t,t,t];if(De(t)){var e=t.length;if(1===e)return[t[0],t[0],t[0],t[0]];if(2===e)return[t[0],t[1],t[0],t[1]];if(3===e)return[t[0],t[1],t[2],t[1]];if(4===e)return t}return[0,0,0,0]}function ey(t){var t=t.getLocalBounds(),t=O([t.min,t.max],2),e=O(t[0],2),n=e[0],e=e[1],t=O(t[1],2),r=t[0],t=t[1];return{x:n,y:e,width:r-n,height:t-e,left:n,bottom:t,top:e,right:r}}function ny(t){return t.toString().charAt(0).toUpperCase()+t.toString().slice(1)}function ry(t,e,n){void 0===n&&(n=!0);var e=e||(null==(e=t.match(/^([a-z][a-z0-9]+)/))?void 0:e[0])||"",t=t.replace(new RegExp("^(".concat(e,")")),"");return n?(e=t).toString().charAt(0).toLowerCase()+e.toString().slice(1):t}function k(t,r,i){void 0===i&&(i=!1);var a={};return Object.entries(t).forEach(function(t){var e,t=O(t,2),n=t[0],t=t[1];"className"!==n&&"class"!==n&&(n.startsWith("show")&&ry(n,"show").startsWith(r)!==i?n===(e=r,"".concat("show").concat(ny(e)))?a[n]=t:a[n.replace(new RegExp(ny(r)),"")]=t:n.startsWith("show")||n.startsWith(r)===i||"filter"===(e=ry(n,r))&&"function"==typeof t||(a[e]=t))}),a}function iy(t,r){return Object.entries(t).reduce(function(t,e){var e=O(e,2),n=e[0],e=e[1];return n.startsWith("show")?t["show".concat(r).concat(n.slice(4))]=e:t["".concat(r).concat(ny(n))]=e,t},{})}function ay(t,n){void 0===n&&(n=["x","y","class","className"]);var r=["transform","transformOrigin","anchor","visibility","pointerEvents","zIndex","cursor","clipPath","clipPathTargets","offsetPath","offsetPathTargets","offsetDistance","draggable","droppable"],i={},a={};return Object.entries(t).forEach(function(t){var t=O(t,2),e=t[0],t=t[1];n.includes(e)||(-1!==r.indexOf(e)?a[e]=t:i[e]=t)}),[i,a]}function oy(o,t){if(t)try{var e=t.replace(/translate\(([+-]*[\d]+[%]*),[ ]*([+-]*[\d]+[%]*)\)/g,function(t,e,n){return"translate(".concat((e=e,n=n,i=(r=(r=o).getBBox()).width,a=r.height,[(r=O([e,n].map(function(t,e){var n;return t.includes("%")?parseFloat((null==(n=t.match(/[+-]?([0-9]*[.])?[0-9]+/))?void 0:n[0])||"0")/100*(0===e?i:a):t}),2))[0],r[1]]),")");var r,i,a});o.attr("transform",e)}catch(t){}}ce(ly,sy=nt.CustomElement),Object.defineProperty(ly.prototype,"offscreenGroup",{get:function(){return this._offscreen||(this._offscreen=cm(this)),this._offscreen},enumerable:!1,configurable:!0}),Object.defineProperty(ly.prototype,"defaultOptions",{get:function(){return this._defaultOptions},enumerable:!1,configurable:!0}),ly.prototype.connectedCallback=function(){this.render(this.attributes,this),this.bindEvents(this.attributes,this),this.initialized=!0},ly.prototype.disconnectedCallback=function(){var t;null!=(t=this._offscreen)&&t.destroy()},ly.prototype.attributeChangedCallback=function(t){"visibility"===t&&!function(){am(this,"hidden"!==this.attributes.visibility)}.call(this)},ly.prototype.update=function(t,e){return this.attr(bm({},this.attributes,t=void 0===t?{}:t)),null==(t=this.render)?void 0:t.call(this,this.attributes,this,e)},ly.prototype.clear=function(){this.removeChildren()},ly.prototype.bindEvents=function(t,e){};var sy,To=ly;function ly(t,e){t=sy.call(this,bm({},{style:e=void 0===e?{}:e},t))||this;return t.initialized=!1,t._defaultOptions=e,t}function cy(t,e,n){return[["M",t-n,e],["A",n,n,0,1,0,t+n,e],["A",n,n,0,1,0,t-n,e],["Z"]]}function uy(t,e,n){return[["M",t,e+n],["L",t,e-n]]}function fy(t,e,n){return[["M",t-n,e],["L",t+n,e]]}jo=cy,o=fy;function hy(t){n="default",ze(e=t)&&e instanceof Image?n="image":Ie(e)?n="symbol":Ve(e)&&(r=new RegExp("data:(image|text)"),n=e.match(r)?"base64":/^(https?:\/\/(([a-zA-Z0-9]+-?)+[a-zA-Z0-9]+\.)+[a-zA-Z]+)(:\d+)?(\/.*)?(\?.*)?(#.*)?$/.test(e)?"url":"symbol");var e,n,r=n;return["base64","url","image"].includes(r)?"image":t&&"symbol"===r?"path":null}ce(gy,dy=To),gy.prototype.render=function(t,e){var r=t.symbol,n=t.size,i=void 0===n?16:n,a=rt(t,["symbol","size"]),o=hy(r);Tm(!!o,w(e),function(t){t.maybeAppendByClassName("marker",o).attr("className","marker ".concat(o,"-marker")).call(function(t){var e,n;"image"===o?t.styles({img:r,width:e=2*i,height:e,x:-i,y:-i}):(e=i/2,n=Ie(r)?r:gy.getSymbol(r),t.styles(y({path:null==n?void 0:n(0,0,e)},a)))})})},gy.MARKER_SYMBOL_MAP=new Map,gy.registerSymbol=function(t,e){gy.MARKER_SYMBOL_MAP.set(t,e)},gy.getSymbol=function(t){return gy.MARKER_SYMBOL_MAP.get(t)};var dy,py=gy;function gy(){return null!==dy&&dy.apply(this,arguments)||this}py.registerSymbol("cross",function(t,e,n){return[["M",t-n,e-n],["L",t+n,e+n],["M",t+n,e-n],["L",t-n,e+n]]}),py.registerSymbol("hyphen",function(t,e,n){return[["M",t-n,e],["L",t+n,e]]}),py.registerSymbol("line",uy),py.registerSymbol("plus",function(t,e,n){return[["M",t-n,e],["L",t+n,e],["M",t,e-n],["L",t,e+n]]}),py.registerSymbol("tick",function(t,e,n){return[["M",t-n/2,e-n],["L",t+n/2,e-n],["M",t,e-n],["L",t,e+n],["M",t-n/2,e+n],["L",t+n/2,e+n]]}),py.registerSymbol("circle",cy),py.registerSymbol("point",jo),py.registerSymbol("bowtie",function(t,e,n){var r=n-1.5;return[["M",t-n,e-r],["L",t+n,e+r],["L",t+n,e-r],["L",t-n,e+r],["Z"]]}),py.registerSymbol("hexagon",function(t,e,n){var r=n/2*Math.sqrt(3);return[["M",t,e-n],["L",t+r,e-n/2],["L",t+r,e+n/2],["L",t,e+n],["L",t-r,e+n/2],["L",t-r,e-n/2],["Z"]]}),py.registerSymbol("square",function(t,e,n){return[["M",t-n,e-n],["L",t+n,e-n],["L",t+n,e+n],["L",t-n,e+n],["Z"]]}),py.registerSymbol("diamond",function(t,e,n){return[["M",t-n,e],["L",t,e-n],["L",t+n,e],["L",t,e+n],["Z"]]}),py.registerSymbol("triangle",function(t,e,n){var r=n*Math.sin(1/3*Math.PI);return[["M",t-n,e+r],["L",t,e-r],["L",t+n,e+r],["Z"]]}),py.registerSymbol("triangle-down",function(t,e,n){var r=n*Math.sin(1/3*Math.PI);return[["M",t-n,e-r],["L",t+n,e-r],["L",t,e+r],["Z"]]}),py.registerSymbol("line",uy),py.registerSymbol("dot",fy),py.registerSymbol("dash",o),py.registerSymbol("smooth",function(t,e,n){return[["M",t-n,e],["A",n/2,n/2,0,1,1,t,e],["A",n/2,n/2,0,1,0,t+n,e]]}),py.registerSymbol("hv",function(t,e,n){return[["M",t-n-1,e-2.5],["L",t,e-2.5],["L",t,e+2.5],["L",t+n+1,e+2.5]]}),py.registerSymbol("vh",function(t,e,n){return[["M",t-n-1,e+2.5],["L",t,e+2.5],["L",t,e-2.5],["L",t+n+1,e-2.5]]}),py.registerSymbol("hvh",function(t,e,n){return[["M",t-(n+1),e+2.5],["L",t-n/2,e+2.5],["L",t-n/2,e-2.5],["L",t+n/2,e-2.5],["L",t+n/2,e+2.5],["L",t+n+1,e+2.5]]}),py.registerSymbol("vhv",function(t,e){return[["M",t-5,e+2.5],["L",t-5,e],["L",t,e],["L",t,e-3],["L",t,e+3],["L",t+6.5,e+3]]});ce(vy,my=nt.DisplayObject),vy.prototype.render=function(){var t=this.attributes.columns;w(this.columnsGroup).selectAll(".column").data(t.flat()).join(function(t){return t.append("rect").attr("className","column").each(function(t){this.attr(t)})},function(t){return t.each(function(t){this.attr(t)})},function(t){return t.remove()})},vy.prototype.update=function(t){this.attr(bm({},this.attributes,t)),this.render()},vy.prototype.clear=function(){this.removeChildren()};var my,yy=vy;function vy(t){var e=this,n=t.style,t=rt(t,["style"]);return(e=my.call(this,it({},{type:"column"},y({style:n},t)))||this).columnsGroup=new nt.Group({name:"columns"}),e.appendChild(e.columnsGroup),e.render(),e}ce(wy,by=nt.DisplayObject),wy.prototype.render=function(){var t=this.attributes,e=t.lines,t=t.areas;e&&this.renderLines(e),t&&this.renderAreas(t)},wy.prototype.clear=function(){this.linesGroup.removeChildren(),this.areasGroup.removeChildren()},wy.prototype.update=function(t){this.attr(bm({},this.attributes,t)),this.render()},wy.prototype.renderLines=function(t){w(this.linesGroup).selectAll(".line").data(t).join(function(t){return t.append("path").attr("className","line").each(function(t){this.attr(t)})},function(t){return t.each(function(t){this.attr(t)})},function(t){return t.remove()})},wy.prototype.renderAreas=function(t){w(this.linesGroup).selectAll(".area").data(t).join(function(t){return t.append("path").attr("className","area").each(function(t){this.attr(t)})},function(t){return t.each(function(t){this.style(t)})},function(t){return t.remove()})};var by,xy=wy;function wy(t){var e=this,n=t.style,t=rt(t,["style"]);return(e=by.call(this,it({},{type:"lines"},y({style:n},t)))||this).linesGroup=e.appendChild(new nt.Group),e.areasGroup=e.appendChild(new nt.Group),e.render(),e}function My(t,e){var n=(e=void 0===e?!1:e)?t.length-1:0,t=t.map(function(t,e){return v([e===n?"M":"L"],O(t),!1)});return e?t.reverse():t}function Oy(t,e){if(void 0===e&&(e=!1),t.length<=2)return My(t);for(var n=[],r=t.length,i=0;i<r;i+=1){var a=e?t[r-i-1]:t[i];ln(a,n.slice(-2))||n.push.apply(n,v([],O(a),!1))}var o=Ym(n,!1);return e?o.unshift(v(["M"],O(t[r-1]),!1)):o.unshift(v(["M"],O(t[0]),!1)),o}function ky(t,e,n){t=en(t);return t.push(["L",e,n],["L",0,n],["Z"]),t}function _y(t){return 0===t.length?[0,0]:[He(function(t,e){if(De(t)){for(var n,r=1/0,i=0;i<t.length;i++){var a=t[i],o=Ie(e)?e(a):a[e];o<r&&(n=a,r=o)}return n}}(t,function(t){return He(t)||0})),qe(function(t,e){if(De(t)){for(var n,r=-1/0,i=0;i<t.length;i++){var a=t[i],o=Ie(e)?e(a):a[e];r<o&&(n=a,r=o)}return n}}(t,function(t){return qe(t)||0}))]}function Ey(t){for(var e=en(t),n=e[0].length,t=O([Array(n).fill(0),Array(n).fill(0)],2),r=t[0],i=t[1],a=0;a<e.length;a+=1)for(var o=e[a],s=0;s<n;s+=1)0<=o[s]?(o[s]+=r[s],r[s]=o[s]):(o[s]+=i[s],i[s]=o[s]);return e}ce(Ly,Sy=To),Object.defineProperty(Ly.prototype,"rawData",{get:function(){var t=this.attributes.data;return t&&0!==(null==t?void 0:t.length)?(t=en(t),$e(t[0])?[t]:t):[[]]},enumerable:!1,configurable:!0}),Object.defineProperty(Ly.prototype,"data",{get:function(){return this.attributes.isStack?Ey(this.rawData):this.rawData},enumerable:!1,configurable:!0}),Object.defineProperty(Ly.prototype,"scales",{get:function(){return this.createScales(this.data)},enumerable:!1,configurable:!0}),Object.defineProperty(Ly.prototype,"baseline",{get:function(){var t=this.scales.y,e=O(t.getOptions().domain||[0,0],2),n=e[0],e=e[1];return e<0?t.map(e):t.map(n<0?0:n)},enumerable:!1,configurable:!0}),Object.defineProperty(Ly.prototype,"containerShape",{get:function(){var t=this.attributes;return{width:t.width,height:t.height}},enumerable:!1,configurable:!0}),Object.defineProperty(Ly.prototype,"linesStyle",{get:function(){var n=this,t=this.attributes,e=t.type,r=t.isStack,i=t.smooth;if("line"!==e)throw new Error("linesStyle can only be used in line type");var a,o,s,l,c,u,f,h,d,p=k(this.attributes,"area"),g=k(this.attributes,"line"),t=this.containerShape.width,e=this.data;return 0===e[0].length?{lines:[],areas:[]}:(a=this.scales,u=a.x,a=a.y,e=e,o=(u={type:"line",x:u,y:a}).x,s=u.y,l=(u=O(s.getOptions().range||[0,0],2))[0],c=u[1],l<c&&(u=O([l,c],2),c=u[0],l=u[1]),a=e.map(function(t){return t.map(function(t,e){return[o.map(e),Ye(s.map(t),c,l)]})}),u=[],p&&(e=this.baseline,u=r?(i?function(t,e,n){for(var r=[],i=t.length-1;0<=i;--i){var a,o=t[i],s=Oy(o),l=void 0,l=0===i?ky(s,e,n):(a=Oy(t[i-1],!0),o=o[0],a[0][0]="L",v(v(v([],O(s),!1),O(a),!1),[v(["M"],O(o),!1),["Z"]],!1));r.push(l)}return r}:function(t,e,n){for(var r=[],i=t.length-1;0<=i;--i){var a,o=My(t[i]),s=void 0,s=0===i?ky(o,e,n):((a=My(t[i-1],!0))[0][0]="L",v(v(v([],O(o),!1),O(a),!1),[["Z"]],!1));r.push(s)}return r})(a,t,e):(f=i,h=t,d=e,a.map(function(t){return ky((f?Oy:My)(t),h,d)}))),{lines:a.map(function(t,e){return y({stroke:n.getColor(e),path:(i?Oy:My)(t)},g)}),areas:u.map(function(t,e){return y({path:t,fill:n.getColor(e)},p)})})},enumerable:!1,configurable:!0}),Object.defineProperty(Ly.prototype,"columnsStyle",{get:function(){var i=this,a=k(this.attributes,"column"),t=this.attributes,o=t.isStack;if("column"!==t.type)throw new Error("columnsStyle can only be used in column type");var t=this.containerShape.height,s=this.rawData;if(!s)return{columns:[]};o&&(s=Ey(s));var e=this.createScales(s),l=e.x,c=e.y,e=O(_y(s),2),n=e[0],e=e[1],u=new i0({domain:[0,e-(0<n?0:n)],range:[0,t]}),f=l.getBandWidth(),h=this.rawData;return{columns:s.map(function(t,r){return t.map(function(t,e){var n=f/s.length;return y(y({fill:i.getColor(r)},a),o?{x:l.map(e),y:c.map(t),width:f,height:u.map(h[r][e])}:{x:l.map(e)+n*r,y:0<=t?c.map(t):c.map(0),width:n,height:u.map(Math.abs(t))})})})}},enumerable:!1,configurable:!0}),Ly.prototype.render=function(t,e){this.container=Jm(e,".container","rect").attr("className","container").node();var n=t.type,r="spark".concat(n),i="line"===n?this.linesStyle:this.columnsStyle;this.spark=Jm(e,".".concat(r),function(){return new("line"===n?xy:yy)({className:r,style:i})}).styles(i).node()},Ly.prototype.getColor=function(t){var e=this.attributes.color;return De(e)?e[t%e.length]:Ie(e)?e.call(null,t):e},Ly.prototype.createScales=function(t){var e,n=this.attributes,r=n.type,i=n.range,i=void 0===i?[]:i,a=n.isGroup,n=n.spacing,o=this.containerShape,s=o.width,o=o.height,l=O(_y(t),2),c=l[0],l=l[1],c=new i0({domain:[null!=(e=i[0])?e:c,null!=(e=i[1])?e:l],range:[o,0]});return"line"===r?{type:r,x:new i0({domain:[0,t[0].length-1],range:[0,s]}),y:c}:{type:r,x:new Yp({domain:t[0].map(function(t,e){return e}),range:[0,s],paddingInner:a?n:0}),y:c}},Ly.tag="sparkline";var Sy,Ay=Ly;function Ly(t){return Sy.call(this,t,{type:"line",width:200,height:20,isStack:!1,color:["#83daad","#edbf45","#d2cef9","#e290b3","#6f63f4"],smooth:!0,lineLineWidth:1,areaOpacity:0,isGroup:!1,columnLineWidth:1,columnStroke:"#fff"})||this}function Ty(n){var e,r;return n?(e=["enter","update","exit"],r=Object.fromEntries(Object.entries(n).filter(function(t){t=O(t,1)[0];return!e.includes(t)})),Object.fromEntries(e.map(function(t){var e;return"boolean"!=typeof(e=n)&&"enter"in e&&"update"in e&&"exit"in e?!1===n[t]?[t,!1]:[t,y(y({},n[t]),r)]:[t,r]}))):{enter:!1,update:!1,exit:!1}}function jy(t,e){t?t.finished.then(e):e()}function Ny(t,e){"update"in t?t.update(e):t.attr(e)}function Py(t,e,n){return 0===e.length?null:n?t.animate(e,n):(Ny(t,{style:e.slice(-1)[0]}),null)}function Cy(r,t,e){var i={},a={};return Object.entries(t).forEach(function(t){var e,t=O(t,2),n=t[0],t=t[1];p(t)||(e=r.style[n]||r.parsedStyle[n]||0)!==t&&(i[n]=e,a[n]=t)}),e?Py(r,[i,a],y({fill:"both"},e)):(Ny(r,a),null)}function Ry(t,e){return t.style.opacity||(t.style.opacity=1),Cy(t,{opacity:0},e)}var Iy,By={fill:"#fff",lineWidth:1,radius:2,size:10,stroke:"#bfbfbf",strokeOpacity:1,zIndex:0},Fy={fill:"#000",fillOpacity:.45,fontSize:12,textAlign:"center",textBaseline:"middle",zIndex:1},Dy={orientation:"horizontal",showLabel:!0,type:"start"},zy=vm({foreground:"foreground",handle:"handle",selection:"selection",sparkline:"sparkline",sparklineGroup:"sparkline-group",track:"track"},"slider"),Wy=vm({labelGroup:"label-group",label:"label",iconGroup:"icon-group",icon:"icon",iconRect:"icon-rect",iconLine:"icon-line"},"handle"),Gy=(ce(qy,Iy=To),qy.prototype.render=function(t,e){var n=t.size,n=void 0===n?10:n,r=t.radius,r=void 0===r?n/4:r,i=t.orientation,t=rt(t,["size","radius","orientation"]),a=2.4*n,r=w(e).maybeAppendByClassName(Wy.iconRect,"rect").styles(y(y({},t),{width:n,height:a,radius:r,x:-n/2,y:-a/2})),o=1/3*n,s=2/3*n,l=.25*a,c=.75*a;r.maybeAppendByClassName("".concat(Wy.iconLine,"-1"),"line").styles(y({x1:o,x2:o,y1:l,y2:c},t)),r.maybeAppendByClassName("".concat(Wy.iconLine,"-2"),"line").styles(y({x1:s,x2:s,y1:l,y2:c},t)),r.node().setOrigin(n/2,a/2),"vertical"===i?e.setLocalEulerAngles(90):e.setLocalEulerAngles(0)},qy);function qy(){return null!==Iy&&Iy.apply(this,arguments)||this}ce(Yy,Hy=To),Yy.prototype.renderLabel=function(t){var e=this,n=this.attributes.showLabel,r=O(ay(k(this.attributes,"label"),[]),2),i=r[0],r=r[1];Tm(!!n,w(t).maybeAppendByClassName(Wy.labelGroup,"g").styles(r),function(t){e.label=t.maybeAppendByClassName(Wy.label,"text").styles(y(y({},Fy),i)),e.label.on("mousedown",function(t){t.stopPropagation()}),e.label.on("touchstart",function(t){t.stopPropagation()})})},Yy.prototype.renderIcon=function(t){var e=this.attributes.orientation,n=y(y({orientation:e},By),k(this.attributes,"icon")),e=this.attributes.iconShape,r=void 0===e?function(){return new Gy({style:n})}:e;w(t).maybeAppendByClassName(Wy.iconGroup,"g").selectAll(Wy.icon.class).data([r]).join(function(t){return t.append(r).attr("className",Wy.icon.name)},function(t){return t.update(n)},function(t){return t.remove()})},Yy.prototype.render=function(t,e){this.renderIcon(e),this.renderLabel(e)};var Hy,Vy=Yy;function Yy(t){return Hy.call(this,t,Dy)||this}ce(Ky,$y=To),Object.defineProperty(Ky.prototype,"values",{get:function(){return this.attributes.values},set:function(t){this.attributes.values=this.clampValues(t)},enumerable:!1,configurable:!0}),Object.defineProperty(Ky.prototype,"sparklineStyle",{get:function(){var t;return"horizontal"!==this.attributes.orientation?null:(t=k(this.attributes,"sparkline"),y(y({zIndex:0},this.availableSpace),t))},enumerable:!1,configurable:!0}),Object.defineProperty(Ky.prototype,"shape",{get:function(){var t=this.attributes,e=t.trackLength,t=t.trackSize,t=O(this.getOrientVal([[e,t],[t,e]]),2);return{width:t[0],height:t[1]}},enumerable:!1,configurable:!0}),Object.defineProperty(Ky.prototype,"availableSpace",{get:function(){var t=O(ty(this.attributes.padding),4),e=t[0],n=t[1],r=t[2],t=t[3],i=this.shape;return{x:t,y:e,width:i.width-(t+n),height:i.height-(e+r)}},enumerable:!1,configurable:!0}),Ky.prototype.getValues=function(){return this.values},Ky.prototype.setValues=function(t,e){void 0===e&&(e=!1),this.attributes.values=t=void 0===t?[0,0]:t;t=!1!==e&&this.attributes.animate;Cy(this.selectionShape.node(),this.selectionStyle,t),this.updateHandlesPosition(t)},Ky.prototype.updateHandlesPosition=function(t){this.attributes.showHandle&&(Cy(this.startHandle,this.getHandleStyle("start"),t),Cy(this.endHandle,this.getHandleStyle("end"),t))},Ky.prototype.innerSetValues=function(t,e){void 0===e&&(e=!1);var n=this.values,t=this.clampValues(t=void 0===t?[0,0]:t);this.attr("values",t),this.setValues(t),e&&this.onValueChange(n)},Ky.prototype.renderTrack=function(t){var e=this.attributes.brushable,n=k(this.attributes,"track");this.trackShape=w(t).maybeAppendByClassName(zy.track,"rect").styles(y(y({cursor:e?"crosshair":"default"},this.shape),n))},Ky.prototype.renderSparkline=function(t){var n=this;Tm("horizontal"===this.attributes.orientation,w(t).maybeAppendByClassName(zy.sparklineGroup,"g"),function(t){var e=n.sparklineStyle;t.maybeAppendByClassName(zy.sparkline,function(){return new Ay({style:e})}).update(e)})},Object.defineProperty(Ky.prototype,"selectionStyle",{get:function(){var t=k(this.attributes,"selection");return y(y({},t),this.calcMask())},enumerable:!1,configurable:!0}),Ky.prototype.renderHandles=function(){var t,e=this,n=(this.attributes.showHandle?["start","end"]:[]).map(function(t){return{type:t}}),r=this;null!=(t=this.foregroundGroup)&&t.selectAll(zy.handle.class).data(n,function(t){return t.type}).join(function(t){return t.append(function(t){t=t.type;return new Vy({style:e.getHandleStyle(t)})}).each(function(t){var e=t.type,t=(this.attr("class","".concat(zy.handle.name," ").concat(e,"-handle")),"".concat(e,"Handle"));(r[t]=this).addEventListener("pointerdown",function(t){r.onDragStart(e)(t)})})},function(t){return t.each(function(t){t=t.type;this.update(r.getHandleStyle(t))})},function(t){return t.each(function(t){t=t.type,t="".concat(t,"Handle");r[t]=void 0}).remove()})},Ky.prototype.renderSelection=function(t){this.foregroundGroup=w(t).maybeAppendByClassName(zy.foreground,"g"),this.selectionShape=this.foregroundGroup.maybeAppendByClassName(zy.selection,"rect").styles(this.selectionStyle),this.renderHandles()},Ky.prototype.render=function(t,e){this.renderTrack(e),this.renderSparkline(e),this.renderSelection(e)},Ky.prototype.clampValues=function(t,e){void 0===e&&(e=4);var n=O(this.range,2),r=n[0],n=n[1],i=O(this.getValues().map(function(t){return Hm(t,e)}),2),a=i[0],i=i[1],t=O((t||[a,i]).map(function(t){return Hm(t,e)}),2),o=t[0],t=t[1],s=(t<o&&(o=(s=O([t,o],2))[0],t=s[1]),t-o);return n-r<s?[r,n]:o<r?a===r&&i===t?[r,t]:[r,s+r]:n<t?i===n&&a===o?[o,n]:[n-s,n]:[o,t]},Ky.prototype.calcMask=function(t){var t=O(this.clampValues(t),2),e=t[0],t=t[1],n=this.availableSpace,r=n.x,i=n.y,a=n.width,n=n.height;return this.getOrientVal([{y:i,height:n,x:e*a+r,width:(t-e)*a},{x:r,width:a,y:e*n+i,height:(t-e)*n}])},Ky.prototype.calcHandlePosition=function(t){var e=this.availableSpace,n=e.x,r=e.y,i=e.width,e=e.height,a=O(this.clampValues(),2),o=a[0],a=a[1],t=("start"===t?o:a)*this.getOrientVal([i,e]);return{x:n+this.getOrientVal([t,i/2]),y:r+this.getOrientVal([e/2,t])}},Ky.prototype.calcHandleText=function(t){var e,n,r,i,a,o,s,l,c=this.attributes,u=c.orientation,f=c.formatter,c=c.autoFitLabel,h=k(this.attributes,"handle"),d=k(h,"label"),h=h.spacing,p=this.getHandleSize(),g=this.clampValues(),f=f("start"===t?g[0]:g[1]),g=new fm({style:y(y({},d),{text:f})}),d=g.getBBox(),m=d.width,d=d.height;return g.destroy(),c?(c=g=0,e=(n=this.availableSpace).width,n=n.height,r=(o=this.calcMask()).x,i=o.y,a=o.width,o=o.height,"horizontal"===u?(l=(s=h+p)+m/2,g="start"===t?0<r-s-m?-l:l:m<e-r-a-s?l:-l):(l=h+p,c="start"===t?d<i-p?-l:l:d<n-i-o-p?l:-l),{x:g,y:c,text:f}):(e=h+p+("horizontal"===u?m/2:0),(r={text:f})["horizontal"===u?"x":"y"]="start"===t?-e:e,r)},Ky.prototype.getHandleLabelStyle=function(t){var e;return this.attributes.showLabel?(e=k(this.attributes,"handleLabel"),y(y({},e),this.calcHandleText(t))):{}},Ky.prototype.getHandleIconStyle=function(){var t=this.attributes.handleIconShape,e=k(this.attributes,"handleIcon"),n=this.getOrientVal(["ew-resize","ns-resize"]),r=this.getHandleSize();return y({cursor:n,shape:t,size:r},e)},Ky.prototype.getHandleStyle=function(t){var e=this.attributes,n=e.showLabel,e=e.orientation,r=this.calcHandlePosition(t),i=this.calcHandleText(t);return y(y(y(y({},iy(this.getHandleIconStyle(),"icon")),iy(y(y({},this.getHandleLabelStyle(t)),i),"label")),r),{orientation:e,showLabel:n,type:t,zIndex:3})},Ky.prototype.getHandleSize=function(){var t=this.attributes,e=t.handleIconSize,n=t.width,t=t.height;return e||Math.floor((this.getOrientVal([+t,+n])+4)/2.4)},Ky.prototype.getOrientVal=function(t){var t=O(t,2),e=t[0],t=t[1];return"horizontal"===this.attributes.orientation?e:t},Ky.prototype.setValuesOffset=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=!1);var r=O(this.getValues(),2),t=[r[0]+t,r[1]+e].sort();n?this.setValues(t):this.innerSetValues(t,!0)},Ky.prototype.getRatio=function(t){var e=this.availableSpace,n=e.width,e=e.height;return t/this.getOrientVal([n,e])},Ky.prototype.dispatchCustomEvent=function(t,e,n){var r=this;t.on(e,function(t){t.stopPropagation(),r.dispatchEvent(new nt.CustomEvent(n,{detail:t}))})},Ky.prototype.bindEvents=function(){var t=this.selectionShape,t=(this.addEventListener("wheel",this.onScroll),t.on("mousedown",this.onDragStart("selection")),t.on("touchstart",this.onDragStart("selection")),this.dispatchCustomEvent(t,"mouseenter","selectionMouseenter"),this.dispatchCustomEvent(t,"mouseleave","selectionMouseleave"),this.dispatchCustomEvent(t,"click","selectionClick"),this.trackShape);this.dispatchCustomEvent(t,"click","trackClick"),this.dispatchCustomEvent(t,"mouseenter","trackMouseenter"),this.dispatchCustomEvent(t,"mouseleave","trackMouseleave"),t.on("mousedown",this.onDragStart("track")),t.on("touchstart",this.onDragStart("track"))},Ky.prototype.onScroll=function(t){var e;this.attributes.scrollable&&(e=t.deltaX,t=t.deltaY,t=this.getRatio(t||e),this.setValuesOffset(t,t,!0))},Ky.tag="slider";var $y,Uy=Ky;function Ky(t){var a=$y.call(this,t,y(y(y({animate:{duration:100,fill:"both"},brushable:!0,formatter:function(t){return t.toString()},handleSpacing:2,orientation:"horizontal",padding:0,autoFitLabel:!0,scrollable:!0,selectionCursor:"move",selectionFill:"#5B8FF9",selectionFillOpacity:.45,selectionZIndex:2,showHandle:!0,showLabel:!0,slidable:!0,trackFill:"#416180",trackLength:200,trackOpacity:.05,trackSize:20,trackZIndex:-1,values:[0,1]},iy(Dy,"handle")),iy(By,"handleIcon")),iy(Fy,"handleLabel")))||this;return a.range=[0,1],a.onDragStart=function(i){return function(t){t.stopPropagation(),a.target=i,a.prevPos=a.getOrientVal(Am(t));var t=a.availableSpace,e=t.x,t=t.y,n=a.attributes,r=n.x,n=n.y;a.selectionStartPos=a.getRatio(a.prevPos-a.getOrientVal([e,t])-a.getOrientVal([+r,+n])),a.selectionWidth=0,document.addEventListener("mousemove",a.onDragging),document.addEventListener("touchmove",a.onDragging),document.addEventListener("mouseup",a.onDragEnd),document.addEventListener("touchend",a.onDragEnd)}},a.onDragging=function(t){var e=a.attributes,n=e.slidable,r=e.brushable,e=(t.stopPropagation(),a.getOrientVal(Am(t))),t=e-a.prevPos;if(t){var i=a.getRatio(t);switch(a.target){case"start":n&&a.setValuesOffset(i);break;case"end":n&&a.setValuesOffset(0,i);break;case"selection":n&&a.setValuesOffset(i,i);break;case"track":if(!r)return;a.selectionWidth+=i,a.innerSetValues([a.selectionStartPos,a.selectionStartPos+a.selectionWidth].sort(),!0)}a.prevPos=e}},a.onDragEnd=function(){document.removeEventListener("mousemove",a.onDragging),document.removeEventListener("mousemove",a.onDragging),document.removeEventListener("mouseup",a.onDragEnd),document.removeEventListener("touchend",a.onDragEnd)},a.onValueChange=function(t){t=new nt.CustomEvent("valuechange",{detail:{oldValue:t,value:a.getValues()}});a.dispatchEvent(t)},a.selectionStartPos=0,a.selectionWidth=0,a.prevPos=0,a.target="",a}ce(Qy,Xy=To),Object.defineProperty(Qy.prototype,"padding",{get:function(){return ty(this.attributes.padding)},enumerable:!1,configurable:!0}),Object.defineProperty(Qy.prototype,"value",{get:function(){var t=this.attributes.value,e=O(this.range,2),n=e[0],e=e[1];return Ye(t,n,e)},enumerable:!1,configurable:!0}),Object.defineProperty(Qy.prototype,"trackLength",{get:function(){var t=this.attributes,e=t.viewportLength,t=t.trackLength;return void 0===t?e:t},enumerable:!1,configurable:!0}),Object.defineProperty(Qy.prototype,"availableSpace",{get:function(){var t=this.attributes.trackSize,e=this.trackLength,n=O(this.padding,4),r=n[0],i=n[1],a=n[2],n=n[3],t=O(this.getOrientVal([[e,t],[t,e]]),2);return{x:n,y:r,width:+t[0]-(n+i),height:+t[1]-(r+a)}},enumerable:!1,configurable:!0}),Object.defineProperty(Qy.prototype,"trackRadius",{get:function(){var t=this.attributes,e=t.isRound,t=t.trackSize;return e?t/2:0},enumerable:!1,configurable:!0}),Object.defineProperty(Qy.prototype,"thumbRadius",{get:function(){var t,e=this.attributes,n=e.isRound,e=e.thumbRadius;return n?(t=(n=this.availableSpace).width,n=n.height,e||this.getOrientVal([n,t])/2):0},enumerable:!1,configurable:!0}),Qy.prototype.getValues=function(t){void 0===t&&(t=this.value);var e=this.attributes,e=e.viewportLength/e.contentLength,n=O(this.range,2),r=n[0],t=t*(n[1]-r-e);return[t,t+e]},Qy.prototype.getValue=function(){return this.value},Qy.prototype.renderSlider=function(t){var e=this.attributes,n=e.orientation,r=e.trackSize,i=e.padding,e=e.slidable,a=k(this.attributes,"track"),o=k(this.attributes,"thumb"),s=y(y({brushable:!1,orientation:n,padding:i,selectionRadius:this.thumbRadius,showHandle:!1,slidable:e,trackLength:this.trackLength,trackRadius:this.trackRadius,trackSize:r,values:this.getValues()},iy(a,"track")),iy(o,"selection"));this.slider=w(t).maybeAppendByClassName("scrollbar",function(){return new Uy({style:s})}).update(s).node()},Qy.prototype.render=function(t,e){this.renderSlider(e)},Qy.prototype.setValue=function(t,e){void 0===e&&(e=!1);var n=this.attributes.value,r=O(this.range,2),i=r[0],r=r[1];this.slider.setValues(this.getValues(Ye(t,i,r)),e),this.onValueChange(n)},Qy.prototype.bindEvents=function(){var e=this;this.slider.addEventListener("trackClick",function(t){t.stopPropagation(),e.onTrackClick(t.detail)}),this.onHover()},Qy.prototype.getOrientVal=function(t){return"horizontal"===this.attributes.orientation?t[0]:t[1]},Qy.prototype.onHover=function(){this.slider.addEventListener("selectionMouseenter",this.onThumbMouseenter),this.slider.addEventListener("trackMouseenter",this.onTrackMouseenter),this.slider.addEventListener("selectionMouseleave",this.onThumbMouseleave),this.slider.addEventListener("trackMouseleave",this.onTrackMouseleave)},Qy.tag="scrollbar";var Xy,Zy=Qy;function Qy(t){var a=Xy.call(this,t,{isRound:!0,orientation:"vertical",padding:[2,2,2,2],scrollable:!0,slidable:!0,thumbCursor:"default",trackSize:10,value:0})||this;return a.range=[0,1],a.onValueChange=function(t){var e=a.attributes.value;t!==e&&(a.dispatchEvent(new nt.CustomEvent("scroll",t={detail:{oldValue:t,value:e}})),a.dispatchEvent(new nt.CustomEvent("valuechange",t)))},a.onTrackClick=function(t){var e,n,r,i;a.attributes.slidable&&(r=(e=O(a.getLocalPosition(),2))[0],e=e[1],n=(i=O(a.padding,4))[0],i=i[3],r=a.getOrientVal([r+i,e+n]),i=(a.getOrientVal(Am(t))-r)/a.trackLength,a.setValue(i,!0))},a.onThumbMouseenter=function(t){a.dispatchEvent(new nt.CustomEvent("thumbMouseenter",{detail:t.detail}))},a.onTrackMouseenter=function(t){a.dispatchEvent(new nt.CustomEvent("trackMouseenter",{detail:t.detail}))},a.onThumbMouseleave=function(t){a.dispatchEvent(new nt.CustomEvent("thumbMouseleave",{detail:t.detail}))},a.onTrackMouseleave=function(t){a.dispatchEvent(new nt.CustomEvent("trackMouseleave",{detail:t.detail}))},a}var Jy={data:[],animate:{enter:!1,update:{duration:100,easing:"ease-in-out-sine",fill:"both"},exit:{duration:100,fill:"both"}},showArrow:!0,showGrid:!0,showLabel:!0,showLine:!0,showTick:!0,showTitle:!0,showTrunc:!1,dataThreshold:100,lineLineWidth:1,lineStroke:"black",crossPadding:10,titleFill:"black",titleFontSize:12,titlePosition:"lb",titleSpacing:0,titleTextAlign:"center",titleTextBaseline:"middle",lineArrow:function(){return new nt.Path({style:{path:[["M",10,10],["L",-10,0],["L",10,-10],["L",0,0],["L",10,10],["Z"]],anchor:"0.5 0.5",fill:"black",transformOrigin:"center"}})},labelAlign:"parallel",labelDirection:"positive",labelFontSize:12,labelSpacing:0,gridConnect:"line",gridControlAngles:[],gridDirection:"positive",gridLength:0,gridType:"segment",lineArrowOffset:15,lineArrowSize:10,tickDirection:"positive",tickLength:5,tickLineWidth:1,tickStroke:"black",tickStrokeOpacity:.65,labelOverlap:[]},tv=(it({},Jy,{style:{type:"arc"}}),it({},Jy,{style:{}}),vm({mainGroup:"main-group",gridGroup:"grid-group",grid:"grid",lineGroup:"line-group",line:"line",tickGroup:"tick-group",tick:"tick",tickItem:"tick-item",labelGroup:"label-group",label:"label",labelItem:"label-item",titleGroup:"title-group",title:"title",lineFirst:"line-first",lineSecond:"line-second"},"axis")),ev=vm({lineGroup:"line-group",line:"line",regionGroup:"region-group",region:"region"},"grid");function nv(t){return t.reduce(function(t,e,n){return t.push(v([0===n?"M":"L"],O(e),!1)),t},[])}function rv(t,e,n){var r,i,a,o;return"surround"===e.type?(r=t,n=n,o=(e=e).connect,e=e.center,"line"===(void 0===o?"line":o)?nv(r):e?(i=Gm(r[0],e),a=n?0:1,r.reduce(function(t,e,n){return 0===n?t.push(v(["M"],O(e),!1)):t.push(v(["A",i,i,0,0,a],O(e),!1)),t},[])):[]):nv(t)}function iv(t,e,n){function r(t,e){return[l,t,c,e,s].flat()}var i=n.type,a=n.connect,o=n.center,s=n.closed?[["Z"]]:[],n=O([rv(t,n),rv(e.slice().reverse(),n,!0)],2),l=n[0],c=n[1],n=O([t[0],e.slice(-1)[0]],2),t=n[0],e=n[1];if("line"===a||"surround"===i)return r([v(["L"],O(e),!1)],[v(["L"],O(t),!1)]);if(o)return a=(n=O([Gm(e,o),Gm(t,o)],2))[0],i=n[1],r([v(["A",a,a,0,0,1],O(e),!1),v(["L"],O(e),!1)],[v(["A",i,i,0,0,0],O(t),!1),v(["L"],O(t),!1)]);throw new Error("Arc grid need to specified center")}function av(t,e,n){var r=n.animate,i=n.connect,a=n.areaFill;if(e.length<2||!a||!i)return[];for(var o=Array.isArray(a)?a:[a,"transparent"],s=[],l=0;l<e.length-1;l++){var c=O([e[l].points,e[l+1].points],2),c=iv(c[0],c[1],n);s.push({path:c,fill:o[l%o.length]})}return t.selectAll(ev.region.class).data(s,function(t,e){return e}).join(function(t){return t.append("path").each(function(t,e){t=ym(t,[t,e,s]);this.attr(t)}).attr("className",ev.region.name)},function(t){return t.transition(function(t,e){return Cy(this,ym(t,[t,e,s]),r.update)})},function(t){return t.transition(function(){var t=this,e=Ry(this,r.exit);return jy(e,function(){return t.remove()}),e})}).transitions()}ce(lv,ov=To),lv.prototype.render=function(t,e){t.type,t.center,t.areaFill,t.closed;var n,r,i,a,o=rt(t,["type","center","areaFill","closed"]),s=(s=void 0===(s=t.data)?[]:s,t.closed?s.map(function(t){var e=t.points,n=O(e,1)[0];return y(y({},t),{points:v(v([],O(e),!1),[n],!1)})}):s),l=w(e).maybeAppendByClassName(ev.lineGroup,"g"),e=w(e).maybeAppendByClassName(ev.regionGroup,"g"),o=(l=l,r=o,i=(n=t).animate,a=s.map(function(t,e){return{id:t.id||"grid-line-".concat(e),path:rv(t.points,n)}}),l.selectAll(ev.line.class).data(a,function(t){return t.id}).join(function(t){return t.append("path").each(function(t,e){t=ym(Um(y({path:t.path},r)),[t,e,a]);this.attr(y({class:ev.line.name,stroke:"#D9D9D9",lineWidth:1,lineDash:[4,4]},t))})},function(t){return t.transition(function(t,e){return Cy(this,ym(Um(y({path:t.path},r)),[t,e,a]),i.update)})},function(t){return t.transition(function(){var t=this,e=Ry(this,i.exit);return jy(e,function(){return t.remove()}),e})}).transitions()),l=av(e,s,t);return v(v([],O(o),!1),O(l),!1)};var ov,sv=lv;function lv(){return null!==ov&&ov.apply(this,arguments)||this}function cv(t,e){return Object.fromEntries(Object.entries(t).map(function(t){t=O(t,2);return[t[0],ym(t[1],e)]}))}function uv(t,e){return e&&Ie(e)?t.filter(e):t}var fv=rn(function(t,e){var n=e.startAngle;return(e.endAngle-n)*t+n},function(t,e){return[t,e.startAngle,e.endAngle].join()}),hv=rn(function(t,e){var n,r,i;return"linear"===e.type?(r=(n=O(e.startPos,2))[0],n=n[1],i=O(e.endPos,2),qm([(r=O([i[0]-r,i[1]-n],2))[0],r[1]])):(i=dm(fv(t,e)),[-Math.sin(i),Math.cos(i)])},function(t,e){var n,r,i,a="linear"===(n=e).type?(a=n.startPos,r=n.endPos,v(v([],O(a),!1),O(r),!1)):(a=n.startAngle,r=n.endAngle,i=n.center,n=n.radius,v(v([a,r],O(i),!1),[n],!1));return"arc"===e.type&&a.push(t),a.join()});function dv(t,e,n){t=hv(t,n);return n=t,"positive"!==e?[n[1],-n[0]]:[-n[1],n[0]]}function pv(t,e){return dv(t,e.labelDirection,e)}var gv=rn(function(t,e){var n=O(e.startPos,2),r=n[0],n=n[1],e=O(e.endPos,2),e=O([e[0]-r,e[1]-n],2);return[r+e[0]*t,n+e[1]*t]},function(t,e){return v(v([t],O(e.startPos),!1),O(e.endPos),!1).join()}),mv=rn(function(t,e){var n=e.radius,r=O(e.center,2),i=r[0],r=r[1],t=dm(fv(t,e));return[i+n*Math.cos(t),r+n*Math.sin(t)]},function(t,e){return v([t,e.startAngle,e.endAngle,e.radius],O(e.center),!1).join()});function yv(t,e){return("linear"===e.type?gv:mv)(t,e)}function vv(t){return 0===hv(0,t)[1]}function bv(t){return 0===hv(0,t)[0]}function xv(t,e){return e-t==360}function wv(t,e,n,r,i){function a(t){return[n+i*Math.cos(t),r+i*Math.sin(t)]}var o=e-t,s=O([i,i],2),l=s[0],s=s[1],c=O([dm(t),dm(e)],2),u=c[0],c=c[1],f=O(a(u),2),h=f[0],f=f[1],d=O(a(c),2),p=d[0],d=d[1];return xv(t,e)?[["M",h,f],["A",l,s,0,1,0,(c=O(a((c+u)/2),2))[0],c[1]],["A",l,s,0,1,0,p,d]]:(u=180<o?1:0,c=e<t?0:1,"M".concat(h,",").concat(f,",A").concat(l,",").concat(s,",0,").concat(u,",").concat(c,",").concat(p,",").concat(d))}function Mv(t,e,n,s){var l=e.startAngle,c=e.endAngle,u=e.center,f=e.radius;return t.selectAll(tv.line.class).data([{path:wv.apply(void 0,v(v([l,c],O(u),!1),[f],!1))}],function(t,e){return e}).join(function(t){return t.append("path").attr("className",tv.line.name).styles(e).styles({path:function(t){return t.path}})},function(t){return t.transition(function(){var t,r,e,n,i,a=this,o=(o=(i=(i=t=this).attributes).startAngle,e=i.endAngle,n=i.center,i=i.radius,o=v(v([o,e],O(n),!1),[i],!1),e=v(v([l,c],O(u),!1),[f],!1),(n=s.update)?(i=void 0===(i=n.duration)?0:i,r=Pm(o,e),o=Math.ceil(+i/16),i=new Array(o).fill(0).map(function(t,e,n){return{__keyframe_data__:r(e/(n.length-1))}}),t.animate(i,y({fill:"both"},n))):(t.attr("__keyframe_data__",e),null));return o&&(o.onframe=i=function(){var t=cn(a.attributes,"__keyframe_data__");a.style.path=wv.apply(void 0,v([],O(t),!1))},o.onfinish=i),o}).styles(e)},function(t){return t.remove()}).styles(n).transitions()}function Ov(t){var t=O(t,2),e=O(t[0],2),n=e[0],e=e[1],t=O(t[1],2);return{x1:n,y1:e,x2:t[0],y2:t[1]}}function kv(e,t,n,r){function i(t){return e.selectAll(tv.line.class).data(t,function(t,e){return e}).join(function(t){return t.append("line").attr("className",function(t){return"".concat(tv.line.name," ").concat(t.className)}).styles(n).transition(function(t){return Cy(this,Ov(t.line),!1)})},function(t){return t.styles(n).transition(function(t){return Cy(this,Ov(t.line),r.update)})},function(t){return t.remove()}).transitions()}var a,o,s,l=t.showTrunc,c=t.startPos,u=t.endPos,f=t.truncRange,h=t.lineExtension,d=O([c,u],2),p=O(d[0],2),g=p[0],p=p[1],d=O(d[1],2),m=d[0],d=d[1],u=O(h?(c=O([c=c,u=u,h=void 0===(h=h)?[0,0]:h],3),h=(u=O(c[0],2))[0],u=u[1],y=(a=O(c[1],2))[0],a=a[1],v=(c=O(c[2],2))[0],c=c[1],h=(y=O([y-h,a-u],2))[0],a=y[1],u=Math.sqrt(Math.pow(h,2)+Math.pow(a,2)),v=(y=O([-v/u,c/u],2))[0],c=y[1],[v*h,v*a,c*h,c*a]):new Array(4).fill(0),4),y=u[0],v=u[1],h=u[2],c=u[3];return l&&f?(u=(a=O(f,2))[0],l=a[1],o=(u=O([g+(f=m-g)*u,p+(s=d-p)*u],2))[0],u=u[1],s=(f=O([g+f*l,p+s*l],2))[0],l=f[1],f=i([{line:[[g+y,p+v],[o,u]],className:tv.lineFirst.name},{line:[[s,l],[m+h,d+c]],className:tv.lineSecond.name}]),t.truncRange,t.truncShape,t.lineExtension,f):i([{line:[[g+y,p+v],[m+h,d+c]],className:tv.line.name}])}function _v(t,e,n){var r,i,a,o,s,l=e.type,c=k(e,"line"),n=("linear"===l?kv:Mv)(t,e,Vm(c,"arrow"),n);return t=t,l=l,c=c,r=(e=e).showArrow,i=e.showTrunc,a=e.lineArrow,o=e.lineArrowOffset,s=e.lineArrowSize,l="arc"!==l&&i?t.select(tv.lineSecond.class):t.select(tv.line.class),!r||!a||"arc"===e.type&&xv(e.startAngle,e.endAngle)?(i=l.node())&&(i.style.markerEnd=void 0):((t=Lm(a)).attr(c),Km(t,s,!0),l.style("markerEnd",t).style("markerEndOffset",-o)),n}function Ev(t){var e=t.type,n=t.gridCenter;return"linear"===e?n:n||t.center}function Sv(t,i){var a=i.gridLength;return t.map(function(t,e){var t=t.value,n=O(yv(t,i),2),r=n[0],n=n[1],t=O(Bm(dv(t,i.gridDirection,i),a),2);return{id:e,points:[[r,n],[r+t[0],n+t[1]]]}})}function Av(t,e,n,r){var i=k(n,"grid"),a=i.type,o=i.areaFill,s=Ev(n),l=uv(e,n.gridFilter),e=("segment"===a?Sv:function(t,o){var s,l,c=o.gridControlAngles,e=Ev(o);if(!e)throw new Error("grid center is not provide");if(t.length<2)throw new Error("Invalid grid data");if(c&&0!==c.length)return e=O(e,2),s=e[0],l=e[1],t.map(function(t,e){var t=O(yv(t.value,o),2),n=t[0],t=t[1],n=O([n-s,t-l],2),r=n[0],i=n[1],a=[];return c.forEach(function(t){var t=dm(t),t=O([Math.cos(t),Math.sin(t)],2),e=t[0],t=t[1];a.push([r*e-i*t+s,r*t+i*e+l])}),{points:a,id:e}});throw new Error("Invalid gridControlAngles")})(l,n),c=y(y({},i),{center:s,areaFill:Ie(o)?l.map(function(t,e){return ym(o,[t,e,l])}):o,animate:r,data:e});return t.selectAll(tv.grid.class).data([1]).join(function(t){return t.append(function(){return new sv({style:c})}).attr("className",tv.grid.name)},function(t){return t.transition(function(){return this.update(c)})},function(t){return t.remove()}).transitions()}Object.defineProperty(Tv.prototype,"left",{get:function(){return this.x1},enumerable:!1,configurable:!0}),Object.defineProperty(Tv.prototype,"top",{get:function(){return this.y1},enumerable:!1,configurable:!0}),Object.defineProperty(Tv.prototype,"right",{get:function(){return this.x2},enumerable:!1,configurable:!0}),Object.defineProperty(Tv.prototype,"bottom",{get:function(){return this.y2},enumerable:!1,configurable:!0}),Object.defineProperty(Tv.prototype,"width",{get:function(){return this.defined("x2")&&this.defined("x1")?this.x2-this.x1:void 0},enumerable:!1,configurable:!0}),Object.defineProperty(Tv.prototype,"height",{get:function(){return this.defined("y2")&&this.defined("y1")?this.y2-this.y1:void 0},enumerable:!1,configurable:!0}),Tv.prototype.rotatedPoints=function(t,e,n){var r=this.x1,i=this.y1,a=this.x2,o=this.y2,s=Math.cos(t),t=Math.sin(t),l=e-e*s+n*t,e=n-e*t-n*s;return[[s*r-t*o+l,t*r+s*o+e],[s*a-t*o+l,t*a+s*o+e],[s*r-t*i+l,t*r+s*i+e],[s*a-t*i+l,t*a+s*i+e]]},Tv.prototype.set=function(t,e,n,r){return n<t?(this.x2=t,this.x1=n):(this.x1=t,this.x2=n),r<e?(this.y2=e,this.y1=r):(this.y1=e,this.y2=r),this},Tv.prototype.defined=function(t){return this[t]!==Number.MAX_VALUE&&this[t]!==-Number.MAX_VALUE};var Lv=Tv;function Tv(t,e,n,r){this.set(t,e,n,r)}function jv(t,e){var n=t.getEulerAngles()||0,r=(t.setEulerAngles(0),t.getLocalBounds()),i=O(r.min,2),a=i[0],i=i[1],r=O(r.max,2),o=r[0],r=r[1],s=Nv(t),l=s.width,s=s.height,c=0,u=0,f=a,h=i,d=_m(t),o=(d&&(s-=1.5,"center"===(p=d.style.textAlign)?f=(a+o)/2:"right"!==p&&"end"!==p||(f=o),"middle"===(p=d.style.textBaseline)?h=(i+r)/2:"bottom"===p&&(h=r)),O(ty(e),4)),d=o[0],p=void 0===d?0:d,r=o[1],e=void 0===r?0:r,d=o[2],r=o[3],o=new Lv((c+=a)-(void 0===r?e:r),(u+=i)-p,c+l+e,u+s+(void 0===d?p:d));return t.setEulerAngles(n),o.rotatedPoints(dm(n),f,h)}function Nv(t){return t.__bbox__||t.getBBox()}function Pv(t,e){return e[0]<=Math.max(t[0][0],t[1][0])&&e[0]<=Math.min(t[0][0],t[1][0])&&e[1]<=Math.max(t[0][1],t[1][1])&&e[1]<=Math.min(t[0][1],t[1][1])}function Cv(t,e,n){t=(e[1]-t[1])*(n[0]-e[0])-(e[0]-t[0])*(n[1]-e[1]);return 0==t?0:t<0?2:1}function Rv(t,e){var n=t.length;if(n<3)return!1;var r,i,a,o,s,l,c=[e,[9999,e[1]]],u=0,f=0;do{var h=[t[f],t[(f+1)%n]];if(i=c,l=s=o=a=void 0,a=Cv((r=h)[0],r[1],i[0]),o=Cv(r[0],r[1],i[1]),s=Cv(i[0],i[1],r[0]),l=Cv(i[0],i[1],r[1]),a!==o&&s!==l||0===a&&Pv(r,i[0])||0===o&&Pv(r,i[1])||0===s&&Pv(i,r[0])||!(0!==l||!Pv(i,r[1]))){if(0===Cv(h[0],e,h[1]))return Pv(h,e);u++}}while(0!==(f=(f+1)%n));return!!(1&u)}function Iv(t,e,n){var r,i=t.x1,a=t.x2,o=t.y1,t=t.y2,o=[[i,o],[a,o],[a,t],[i,t]],a=jv(e,n);return r=o,a.every(function(t){return Rv(r,t)})}function Bv(t,c){return[[t[0],t[1],t[2],t[3]],[t[2],t[3],t[4],t[5]],[t[4],t[5],t[6],t[7]],[t[6],t[7],t[0],t[1]]].some(function(t){return t=t,n=(e=O(e=c,4))[0],r=e[1],i=e[2],e=e[3],a=(t=O(t,4))[0],o=t[1],i-=n,e-=r,s=t[2]-a,t=t[3]-o,0!=(l=i*t-s*e)&&(o=i*(i=r-o)-e*(r=n-a))<0!=(e=0<l)&&(n=s*i-t*r)<0!=e&&l<o!=e&&l<n!=e;var e,n,r,i,a,o,s,l})}function Fv(t,e,l){function n(t,e){if(t){var n,r,i=ty(l),t=jv(t,i).flat(1),a=jv(e,i).flat(1),e=[[t[0],t[1],t[2],t[3]],[t[0],t[1],t[4],t[5]],[t[4],t[5],t[6],t[7]],[t[2],t[3],t[6],t[7]]];try{for(var o=fe(e),s=o.next();!s.done;s=o.next())if(Bv(a,s.value))return}catch(t){n={error:t}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}}return 1}var r,i,a,o,s,c,u,f,h,d,p,g,m=e.crossPadding,y=new Set,v=null,b=(m=m,h=(e=e).type,d=e.labelDirection,!!(p=e.crossSize)&&("arc"===h?(h=e.center,f=e.radius,u=(h=O(h,2))[0],h=h[1],a=-f-(d="negative"===d?0:p),f=f+d,o=(d=O(ty(m),4))[0],s=d[1],c=d[2],d=d[3],new Lv(u+a-d,h+a-o,u+f+s,h+f+c)):(a=(d=O(e.startPos,2))[0],o=d[1],s=(u=O(e.endPos,2))[0],h=u[1],c=(f=O(bv(e)?[-m,0,m,0]:[0,m,0,-m],4))[0],d=f[1],u=f[2],m=f[3],f=Bm(pv(0,e),p),(e=new Lv(a,o,s,h)).x1+=m,e.y1+=c,e.x2+=d+f[0],e.y2+=u+f[1],e)));try{for(var x=fe(t),w=x.next();!w.done;w=x.next()){var M=w.value;g=M,b&&!Iv(b,g)?y.add(M):!v||n(v,M)?v=M:(y.add(v),y.add(M))}}catch(t){r={error:t}}finally{try{w&&!w.done&&(i=x.return)&&i.call(x)}finally{if(r)throw r.error}}return Array.from(y)}function Dv(t,e){return void 0===e&&(e={}),p(t)?0:"number"==typeof t?t:Math.floor(Om(t,e))}var zv=function(t,e){var e=e.seq,n=void 0===e?2:e;return t.filter(function(t,e){return!(e%n&&(im(t),1))})};var Wv=new Map([["hide",function(t,e,n,r){var i=t.length,a=e.keepHeader,o=e.keepTail;if(!(i<=1||2===i&&a&&o)){var s,l,c,u,f=zv,h=function(t){return t.forEach(r.show),t},d=2,p=t.slice(),g=t.slice(),m=Math.min.apply(Math,v([1],O(t.map(function(t){return Nv(t).width})),!1));for("linear"===n.type&&(vv(n)||bv(n))&&(s=ey(t[0]).left,l=ey(t[i-1]).right,l=Math.abs(l-s)||1,d=Math.max(Math.floor(i*m/l),d)),a&&(c=p.splice(0,1)[0]),o&&(u=p.splice(-1,1)[0],p.reverse()),h(p);d<t.length&&Fv((u?v(v([u],O(g),!1),[c],!1):v([c],O(g),!1)).filter(Mm),n,null==e?void 0:e.margin).length;)(u&&!c&&d%2==0||u&&c)&&p.splice(0,1).forEach(r.hide),g=f(h(p),{seq:d}),d++}}],["rotate",function(t,e,n,r){function i(n){t.forEach(function(t,e){e=Array.isArray(n)?n[e]:n;r.rotate(t,+e)})}var a,o,s=void 0===(s=e.optionalAngles)?[0,45,90]:s,l=e.margin,e=void 0===(e=e.recoverWhenFailed)||e,c=t.map(function(t){return t.getLocalEulerAngles()});try{for(var u=fe(s),f=u.next();!f.done;f=u.next())if(i(f.value),Fv(t,n,l).length<1)return}catch(t){a={error:t}}finally{try{f&&!f.done&&(o=u.return)&&o.call(u)}finally{if(a)throw a.error}}e&&i(c)}],["ellipsis",function(t,e,n,r){if(!(t.length<=1))for(var i=void 0===(a=e.suffix)?"...":a,a=e.minLength,o=void 0===(o=e.maxLength)?1/0:o,s=void 0===(s=e.step)?" ":s,l=void 0===(e=e.margin)?[0,0,0,0]:e,e=km(r.getTextShape(t[0])),c=Dv(s,e),u=a?Dv(a,e):c,s=Dv(o,e),f=(!p(s)&&s!==1/0||(s=Math.max.apply(null,t.map(function(t){return Nv(t).width}))),t.slice()),h=((a=O(l,4))[0],a[1],a[2],a[3],s);u+c<h;h-=c){var d=function(e){if(f.forEach(function(t){r.ellipsis(r.getTextShape(t),e,i)}),(f=Fv(t,n,l)).length<1)return{value:void 0}}(h);if("object"==typeof d)return d.value}}],["wrap",function(t,e,n,r){function i(n){t.forEach(function(t,e){e=Array.isArray(n)?n[e]:n;r.wrap(t,l,e,d)})}var a,o,s,l=void 0===(u=e.wordWrapWidth)?50:u,c=void 0===(u=e.maxLines)?3:u,u=void 0===(u=e.recoverWhenFailed)||u,f=void 0===(e=e.margin)?[0,0,0,0]:e,e=t.map(function(t){return t.attr("maxLines")||1}),h=Math.min.apply(Math,v([],O(e),!1)),d=(o=(a=n).type,s=a.labelDirection,"linear"===o&&vv(a)?"negative"===s?"bottom":"top":"middle");if(!(c<h)){for(var p=h;p<=c;p++)if(i(p),Fv(t,n,f).length<1)return;u&&i(e)}}]]);function Gv(r,i,a){var t=i.labelOverlap,t=void 0===t?[]:t;t.length&&t.forEach(function(t){var e=t.type,n=Wv.get(e);!function(t,e,n){if(!(e.labelOverlap.length<1))if("hide"===n){for(var r=t[0];r;){if("offscreen"===r.className)return;r=r.parent}return 1}else return"rotate"===n?!t.some(function(t){return!(null==(t=t.attr("transform"))||!t.includes("rotate"))}):"ellipsis"!==n&&"wrap"!==n||1<t.filter(function(t){return t.querySelector("text")}).length}(r,i,e)||null==n||n(r,t,i,a)})}function qv(t){for(var e=t;e<0;)e+=360;return Math.round(e%360)}var Hv=rn(function(t,e){var t=O(t,2),n=t[0],t=t[1],e=O(e,2),r=e[0],e=e[1],n=O([n*r+t*e,n*e-t*r],2),e=n[0],t=n[1];return Math.atan2(t,e)},function(t,e){return v(v([],O(t),!1),O(e),!1).join()});function Vv(t,e,n){var r,i=n.labelAlign;return(null==(r=e.style.transform)?void 0:r.includes("rotate"))?e.getLocalEulerAngles():(r=0,e=pv(t.value,n),t=hv(t.value,n),"horizontal"===i?0:(r="perpendicular"===i?Hv([1,0],e):Hv([t[0]<0?-1:1,0],t),jm(n=((n=pm(r))+360)%180,-90,90)||(n+=180),n))}function Yv(t,e,n){var r=n.type,i=n.labelAlign,t=pv(t,n),n=qv(e),e=qv(pm(Hv([1,0],t))),a="center",o="middle";return"linear"===r?[90,270].includes(e)&&0===n?(a="center",o=1===t[1]?"top":"bottom"):e%180||![90,270].includes(n)?0===e?(jm(n,0,90,!1,!0)||jm(n,0,90)||jm(n,270,360))&&(a="start"):90===e?jm(n,0,90,!1,!0)?a="start":(jm(n,90,180)||jm(n,270,360))&&(a="end"):270===e?jm(n,0,90,!1,!0)?a="end":(jm(n,90,180)||jm(n,270,360))&&(a="start"):180===e&&(90===n?a="start":(jm(n,0,90)||jm(n,270,360))&&(a="end")):a="center":"parallel"===i?o=jm(e,0,180,!0)?"top":"bottom":"horizontal"===i?jm(e,90,270,!1)?a="end":(jm(e,270,360,!1)||jm(e,0,90))&&(a="start"):"perpendicular"===i&&(a=jm(e,90,270)?"end":"start"),{textAlign:a,textBaseline:o}}function $v(t,e,n){var r=n.showTick,i=n.tickLength,a=n.tickDirection,o=n.labelDirection,s=n.labelSpacing,l=e.indexOf(t),s=ym(s,[t,l,e]),o=O([pv(t.value,n),function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t.reduce(function(t,e){return t*("positive"===e?-1:1)},1)}(o,a)],2),a=O(Fm(Bm(o[0],s+(1===o[1]?ym(r?i:0,[t,l,e]):0)),yv(t.value,n)),2);return{x:a[0],y:a[1]}}function Uv(t,e){"text"===t.nodeName&&t.attr(e)}function Kv(r){Gv(this.node().childNodes,r,{hide:im,show:rm,rotate:function(t,e){var n;e=+e,n=r,(t=t).setLocalEulerAngles(e),e=Yv(t.__data__.value,e,n),(n=t.querySelector(tv.labelItem.class))&&Uv(n,e)},ellipsis:function(t,e,n){void 0===e&&(e=1/0),t&&Sm(t,e,n)},wrap:function(t,e,n){var r;t&&Em(t,{wordWrap:!0,wordWrapWidth:e,maxLines:t=void 0===(t=n)?2:t,textBaseline:r=void 0===r?"top":r})},getTextShape:function(t){return t.querySelector("text")}})}function Xv(t,e,n,r,i){var a,o,s,l,c,u=n.indexOf(e),f=w(t).append((a=e,o=u,s=n,c=(l=i).labelFormatter,Ie(c)?function(){return Lm(ym(c,[a,o,s,pv(a.value,l)]))}:function(){return Lm(a.label||"")})).attr("className",tv.labelItem.name).node(),r=O(ay(cv(r,[e,u,n])),2),u=r[0],n=r[1],r=n.transform,n=rt(n,["transform"]),h=(oy(t,r),Vv(e,t,i));return t.setLocalEulerAngles(+h),Uv(f,y(y({},Yv(e.value,h,i)),u)),oy(t,r),t.attr(n),f}function Zv(n,h,d,p){var t=uv(h,d.labelFilter),g=k(d,"label");return n.selectAll(tv.label.class).data(t,function(t,e){return e}).join(function(t){return t.append("g").attr("className",tv.label.name).transition(function(t){return Xv(this,t,h,g,d),this.attr($v(t,h,d)),this.__bbox__=t.bbox,null}).call(function(){return Kv.call(n,d)})},function(t){return t.transition(function(t){var e,n,r,i,a,o,s,l=this.querySelector(tv.labelItem.class),c=Xv(this,t,h,g,d),u=(e=l,n=c,l=p.update,void 0===r&&(r="destroy"),l?(c=void 0===(c=l.duration)?0:c,i=void 0===(i=l.delay)?0:i,a=Math.ceil(+c/2),c=+c/4,o=(u=O((s=function(t){var e,n;return"circle"===t.nodeName?(n=(e=O(t.getLocalPosition(),2))[0],e=e[1],[n-(n=t.attr("r")),e-n]):t.getLocalPosition()})(e),2))[0],u=u[1],s=O(s(n),2),s=(o=O([(o+s[0])/2-o,(u+s[1])/2-u],2))[0],u=o[1],o=e.animate([{opacity:1,transform:"translate(0, 0)"},{opacity:0,transform:"translate(".concat(s,", ").concat(u,")")}],y(y({fill:"both"},l),{duration:i+a+c})),jy(s=n.animate([{opacity:0,transform:"translate(".concat(-s,", ").concat(-u,")"),offset:.01},{opacity:1,transform:"translate(0, 0)"}],y(y({fill:"both"},l),{duration:a+c,delay:i+a-c})),f),[o,s]):(f(),[null]));function f(){"destroy"===r?e.destroy():"hide"===r&&im(e),n.isVisible()&&rm(n)}l=Cy(this,$v(t,h,d),p.update);return this.__bbox__=t.bbox,v(v([],O(u),!1),[l],!1)}).call(function(t){var e,t=cn(t,"_transitions").flat().filter(Mm);e=function(){return Kv.call(n,d)},0===(t=t).length?e():Promise.all(t.map(function(t){return null==t?void 0:t.finished})).then(e)})},function(t){return t.transition(function(){var t=this,e=Ry(this,p.exit);return jy(e,function(){return w(t).remove()}),e})}).transitions()}function Qv(t,e){return dv(t,e.tickDirection,e)}var Jv=rn(function(t,e){t=O(t,2);return[[0,0],[t[0]*e,t[1]*e]]},function(t,e){return v(v([],O(t),!1),[e],!1).join()});function tb(t,e,n,r,i,a,o){var s=Qv(t.value,a),a=(c=t,u=e,f=n,l=s,a=(a=a).tickLength,l=O(Jv(l,ym(a,[c,u,f])),2),a=O(l[0],2),c=a[0],u=a[1],f=O(l[1],2),{x1:c,x2:f[0],y1:u,y2:f[1]}),l=a.x1,c=a.x2,u=a.y1,f=a.y2,a=O(ay(cv(o,[t,e,n,s])),2),o=a[0],t=a[1];"line"===r.node().nodeName&&r.styles(y({x1:l,x2:c,y1:u,y2:f},o)),i.attr(t),r.styles(o)}function eb(t,e,n,r,i,a){o=w(this),s=t,l=e,c=n,f=(u=r).tickFormatter,h=Qv(s.value,u),u="line",Ie(f)&&(u=function(){return ym(f,[s,l,c,h])});tb(t,e,n,o.append(u).attr("className",tv.tickItem.name),this,r,i);var o,s,l,c,u,f,h,e=O(yv(t.value,r),2);return Cy(this,{x:e[0],y:e[1]},a)}var nb=vm({text:"text"},"title");function rb(t){return/\S+-\S+/g.test(t)?t.split("-").map(function(t){return t[0]}):2<t.length?[t[0]]:t.split("")}function ib(r,t){t=Object.entries(t).reduce(function(t,e){var e=O(e,2),n=e[0],e=e[1];return r.node().attr(n)||(t[n]=e),t},{});r.styles(t)}ce(sb,ab=To),sb.prototype.getAvailableSpace=function(){var t=this.attributes,r=t.width,i=t.height,e=t.position,n=t.spacing,t=t.inset,a=this.querySelector(nb.text.class);if(!a)return new gm(0,0,+r,+i);var a=a.getBBox(),o=a.width,s=a.height,a=O(ty(n),4),l=a[0],c=a[1],u=a[2],f=a[3],n=O([0,0,+r,+i],4),h=n[0],d=n[1],p=n[2],g=n[3],a=rb(e);if(a.includes("i"))return new gm(h,d,p,g);a.forEach(function(t,e){var n;"t"===t&&(n=O(0===e?[s+u,+i-s-u]:[0,+i],2),d=n[0],g=n[1]),"r"===t&&(n=O([+r-o-f],1),p=n[0]),"b"===t&&(n=O([+i-s-l],1),g=n[0]),"l"===t&&(n=O(0===e?[o+c,+r-o-c]:[0,+r],2),h=n[0],p=n[1])});n=O(ty(t),4),e=n[0],a=n[1],t=n[2],n=n[3],a=O([n+a,e+t],2),t=a[0],a=a[1];return new gm(h+n,d+e,p-t,g-a)},sb.prototype.getBBox=function(){return this.title?this.title.getBBox():new gm(0,0,0,0)},sb.prototype.render=function(t,e){var n,r,i,a,o,s,l=this,c=(t.width,t.height,t.position,t.spacing,rt(t,["width","height","position","spacing"])),u=O(ay(c),1)[0],f=(f=(t=t).width,r=t.height,t=t.position,i=O([+f/2,+r/2],2),a=(i=O([+i[0],+i[1],"center","middle"],4))[0],o=i[1],s=i[2],i=i[3],(t=rb(t)).includes("l")&&(a=(n=O([0,"start"],2))[0],s=n[1]),t.includes("r")&&(a=(n=O([+f,"end"],2))[0],s=n[1]),t.includes("t")&&(o=(f=O([0,"top"],2))[0],i=f[1]),t.includes("b")&&(o=(n=O([+r,"bottom"],2))[0],i=n[1]),{x:a,y:o,textAlign:s,textBaseline:i}),h=f.x,d=f.y,p=f.textAlign,g=f.textBaseline;Tm(!!c.text,w(e),function(t){l.title=t.maybeAppendByClassName(nb.text,"text").styles(u).call(ib,{x:h,y:d,textAlign:p,textBaseline:g}).node()})};var ab,ob=sb;function sb(t){return ab.call(this,t,{text:"",width:0,height:0,fill:"#4a505a",fontWeight:"bold",fontSize:12,fontFamily:"sans-serif",inset:0,spacing:0,position:"top-left"})||this}function lb(t,e,n,r,i){var a,o,s,l,c,u,f,h,d=O(ay(k(r,"title")),2),p=d[0],d=d[1],g=d.transform,g=void 0===g?"":g,d=rt(d,["transform"]),m=(t.styles(p),e.styles(d),oy(t.node(),g),p=w(n._offscreen||n.querySelector(tv.mainGroup.class)),d=e,r=void 0===(r=(n=r).titlePosition)?"lb":r,a=n.titleSpacing,o=rb(r),p=p.node().getLocalBounds(),s=(l=O(p.min,2))[0],l=l[1],c=(p=O(p.halfExtents,2))[0],p=p[1],u=(d=O(d.node().getLocalBounds().halfExtents,2))[0],d=d[1],l=(s=O([s+c,l+p],2))[0],s=s[1],y=(a=O(ty(a),4))[0],f=a[1],h=a[2],a=a[3],["start","end"].includes(r)&&"linear"===n.type?(m=n.startPos,n=n.endPos,n=(r=O("start"===r?[m,n]:[n,m],2))[0],m=(r=O(Bm(qm([-(m=r[1])[0]+n[0],-m[1]+n[1]]),y),2))[0],r=r[1],{x:n[0]+m,y:n[1]+r}):(o.includes("t")&&(s-=p+d+y),o.includes("r")&&(l+=c+u+f),o.includes("l")&&(l-=c+u+a),o.includes("b")&&(s+=p+d+h),{x:l,y:s})),n=m.x,r=m.y,y=Cy(e.node(),{x:n,y:r},i);return oy(t.node(),g),y}function cb(e,t,o,s){var n=e.showLine,r=e.showTick,i=e.showLabel,n=Tm(n,t.maybeAppendByClassName(tv.lineGroup,"g"),function(t){return _v(t,e,s)})||[],r=Tm(r,t.maybeAppendByClassName(tv.tickGroup,"g"),function(t){return t=t,r=s,i=uv(o,(n=e).tickFilter),a=k(n,"tick"),t.selectAll(tv.tick.class).data(i,function(t){return t.id||t.label}).join(function(t){return t.append("g").attr("className",tv.tick.name).transition(function(t,e){return eb.call(this,t,e,i,n,a,!1)})},function(t){return t.transition(function(t,e){return this.removeChildren(),eb.call(this,t,e,i,n,a,r.update)})},function(t){return t.transition(function(){var t=this,e=Ry(this,r.exit);return jy(e,function(){return t.remove()}),e})}).transitions();var n,r,i,a})||[],i=Tm(i,t.maybeAppendByClassName(tv.labelGroup,"g"),function(t){return Zv(t,o,e,s)})||[];return v(v(v([],O(n),!1),O(r),!1),O(i),!1).filter(function(t){return!!t})}ce(hb,ub=To),hb.prototype.render=function(o,t,e){var s=this,n=o.titleText,r=o.data,i=o.animate,a=o.showTitle,l=o.showGrid,c=o.dataThreshold,u=o.truncRange,f=function(t,e){if(t.length<=e)return t;for(var n=Math.floor(t.length/e),r=[],i=0;i<t.length;i+=n)r.push(t[i]);return r}(r,c).filter(function(t){t=t.value;return!(u&&t>u[0]&&t<u[1])}),h=Ty(void 0===e?i:e),r=Tm(l,w(t).maybeAppendByClassName(tv.gridGroup,"g"),function(t){return Av(t,f,o,h)})||[],c=w(t).maybeAppendByClassName(tv.mainGroup,"g"),i=(n&&(!this.initialized&&h.enter||this.initialized&&h.update)&&cb(o,w(this.offscreenGroup),f,Ty(!1)),cb(o,w(c.node()),f,h)),e=Tm(a,w(t).maybeAppendByClassName(tv.titleGroup,"g"),function(t){return e=t,n=s,i=h,a=(r=o).titleText,e.selectAll(tv.title.class).data([{title:a}].filter(function(t){return!!t.title}),function(t,e){return t.title}).join(function(t){return t.append(function(){return Lm(a)}).attr("className",tv.title.name).transition(function(){return lb(w(this),e,n,r,i.enter)})},function(t){return t.transition(function(){return lb(w(this),e,n,r,i.update)})},function(t){return t.remove()}).transitions();var e,n,r,i,a})||[];return v(v(v([],O(r),!1),O(i),!1),O(e),!1).flat().filter(function(t){return!!t})};var ub,fb=hb;function hb(t){return ub.call(this,t,Jy)||this}var db,pb=vm({prevBtnGroup:"prev-btn-group",prevBtn:"prev-btn",nextBtnGroup:"next-btn-group",nextBtn:"next-btn",pageInfoGroup:"page-info-group",pageInfo:"page-info",playWindow:"play-window",contentGroup:"content-group",controller:"controller",clipPath:"clip-path"},"navigator"),gb=(ce(mb,db=To),Object.defineProperty(mb.prototype,"defaultPage",{get:function(){var t=this.attributes.defaultPage;return Ye(t,0,Math.max(this.pageViews.length-1,0))},enumerable:!1,configurable:!0}),Object.defineProperty(mb.prototype,"pageViews",{get:function(){return this.playWindow.children},enumerable:!1,configurable:!0}),Object.defineProperty(mb.prototype,"controllerShape",{get:function(){return 1<this.totalPages?{width:55,height:0}:{width:0,height:0}},enumerable:!1,configurable:!0}),Object.defineProperty(mb.prototype,"pageShape",{get:function(){var n,t=this.pageViews,t=O((n=t.map(function(t){t=t.getBBox();return[t.width,t.height]}),((null==(t=n[0])?void 0:t.map(function(t,e){return n.map(function(t){return t[e]})}))||[]).map(function(t){return Math.max.apply(Math,v([],O(t),!1))})),2),e=t[0],t=t[1],r=this.attributes,i=r.pageWidth,r=r.pageHeight;return{pageWidth:void 0===i?e:i,pageHeight:void 0===r?t:r}},enumerable:!1,configurable:!0}),mb.prototype.getContainer=function(){return this.playWindow},Object.defineProperty(mb.prototype,"totalPages",{get:function(){return this.pageViews.length},enumerable:!1,configurable:!0}),Object.defineProperty(mb.prototype,"currPage",{get:function(){return this.innerCurrPage},enumerable:!1,configurable:!0}),mb.prototype.getBBox=function(){var t=db.prototype.getBBox.call(this),e=t.x,t=t.y,n=this.controllerShape,r=this.pageShape,i=r.pageWidth,r=r.pageHeight;return new gm(e,t,i+n.width,r)},mb.prototype.goTo=function(t){var e=this,n=this.attributes.animate,r=this.currPage,i=this.playState,a=this.playWindow,o=this.pageViews;if("idle"!==i||t<0||o.length<=0||t>=o.length)return null;o[r].setLocalPosition(0,0),this.prepareFollowingPage(t);i=O(this.getFollowingPageDiff(t),2),o=i[0],r=i[1],this.playState="running",i=Py(a,[{transform:"translate(0, 0)"},{transform:"translate(".concat(-o,", ").concat(-r,")")}],n);return jy(i,function(){e.innerCurrPage=t,e.playState="idle",e.setVisiblePages([t]),e.updatePageInfo()}),i},mb.prototype.prev=function(){var t=this.attributes.loop,e=this.pageViews.length,n=this.currPage;return!t&&n<=0?null:(t=t?(n-1+e)%e:Ye(n-1,0,e),this.goTo(t))},mb.prototype.next=function(){var t=this.attributes.loop,e=this.pageViews.length,n=this.currPage;return!t&&e-1<=n?null:(t=t?(n+1)%e:Ye(n+1,0,e),this.goTo(t))},mb.prototype.renderClipPath=function(t){var e=this.pageShape,n=e.pageWidth,e=e.pageHeight;n&&e?(this.clipPath=t.maybeAppendByClassName(pb.clipPath,"rect").styles({width:n,height:e}),this.contentGroup.attr("clipPath",this.clipPath.node())):this.contentGroup.style.clipPath=void 0},mb.prototype.setVisiblePages=function(n){this.playWindow.children.forEach(function(t,e){(n.includes(e)?rm:im)(t)})},mb.prototype.adjustControllerLayout=function(){var t=this.prevBtnGroup,e=this.nextBtnGroup,n=this.pageInfoGroup,r=this.attributes,i=r.orientation,r=r.controllerPadding,a=n.getBBox(),o=a.width,a=(a.height,O("horizontal"===i?[-180,0]:[-90,90],2)),s=a[0],a=a[1],s=(t.setLocalEulerAngles(s),e.setLocalEulerAngles(a),t.getBBox()),a=s.width,s=s.height,l=e.getBBox(),c=l.width,l=l.height,c=Math.max(a,o,c),i="horizontal"===i?{offset:[[0,0],[a/2+r,0],[a+o+2*r,0]],textAlign:"start"}:{offset:[[c/2,-s-r],[c/2,0],[c/2,l+r]],textAlign:"center"},a=O(i.offset,3),o=O(a[0],2),s=o[0],c=o[1],l=O(a[1],2),r=l[0],o=l[1],l=O(a[2],2),a=l[0],l=l[1],i=i.textAlign,u=n.querySelector("text");u&&(u.style.textAlign=i),t.setLocalPosition(s,c),n.setLocalPosition(r,o),e.setLocalPosition(a,l)},mb.prototype.updatePageInfo=function(){var t,e=this.currPage,n=this.pageViews,r=this.attributes.formatter;n.length<2||(null!=(t=this.pageInfoGroup.querySelector(pb.pageInfo.class))&&t.attr("text",r(e+1,n.length)),this.adjustControllerLayout())},mb.prototype.getFollowingPageDiff=function(t){var e,n,r,i=this.currPage;return i===t?[0,0]:(e=this.attributes.orientation,n=(r=this.pageShape).pageWidth,r=r.pageHeight,t=t<i?-1:1,"horizontal"===e?[t*n,0]:[0,t*r])},mb.prototype.prepareFollowingPage=function(t){var e,n=this.currPage,r=this.pageViews;this.setVisiblePages([t,n]),t!==n&&(e=(n=O(this.getFollowingPageDiff(t),2))[0],n=n[1],r[t].setLocalPosition(e,n))},mb.prototype.renderController=function(t){var e,n,r,i,a,o=this,s=this.attributes.controllerSpacing,l=this.pageShape,c=l.pageWidth,l=l.pageHeight,u=2<=this.pageViews.length,t=t.maybeAppendByClassName(pb.controller,"g");am(t.node(),u),u&&(u=k(this.attributes,"button"),e=k(this.attributes,"pageNum"),i=(u=O(ay(u),2))[0],u=u[1],n=i.size,r=rt(i,["size"]),i=!t.select(pb.prevBtnGroup.class).node(),a=t.maybeAppendByClassName(pb.prevBtnGroup,"g").styles(u),this.prevBtnGroup=a.node(),a=a.maybeAppendByClassName(pb.prevBtn,"path"),u=t.maybeAppendByClassName(pb.nextBtnGroup,"g").styles(u),this.nextBtnGroup=u.node(),[a,u.maybeAppendByClassName(pb.nextBtn,"path")].forEach(function(t){t.styles(y(y({},r),{transformOrigin:"center"})),Km(t.node(),n,!0)}),a=t.maybeAppendByClassName(pb.pageInfoGroup,"g"),this.pageInfoGroup=a.node(),a.maybeAppendByClassName(pb.pageInfo,"text").styles(e),this.updatePageInfo(),t.node().setLocalPosition(c+s,l/2),i)&&(this.prevBtnGroup.addEventListener("click",function(){o.prev()}),this.nextBtnGroup.addEventListener("click",function(){o.next()}))},mb.prototype.render=function(t,e){e=w(e);this.renderClipPath(e),this.renderController(e),this.setVisiblePages([this.defaultPage]),this.goTo(this.defaultPage)},mb.prototype.bindEvents=function(){var t=this,e=nn(function(){return t.render(t.attributes,t)},50);this.playWindow.addEventListener(nt.ElementEvent.INSERTED,e),this.playWindow.addEventListener(nt.ElementEvent.REMOVED,e)},mb);function mb(t){var e,n,t=db.call(this,t,{animate:{easing:"linear",duration:200,fill:"both"},buttonCursor:"pointer",buttonFill:"black",buttonPath:[["M",(t=0)-(n=6),(e=0)-n],["L",t+n,e],["L",t-n,e+n],["Z"]],buttonSize:12,controllerPadding:5,controllerSpacing:5,formatter:function(t,e){return"".concat(t,"/").concat(e)},defaultPage:0,loop:!1,orientation:"horizontal",pageNumFill:"black",pageNumFontSize:12,pageNumTextAlign:"start",pageNumTextBaseline:"middle"})||this;return t.playState="idle",t.contentGroup=t.appendChild(new nt.Group({class:pb.contentGroup.name})),t.playWindow=t.contentGroup.appendChild(new nt.Group({class:pb.playWindow.name})),t.innerCurrPage=t.defaultPage,t}function yb(t,e,n){return"horizontal"===(t=void 0===t?"horizontal":t)?e:n}py.registerSymbol("hiddenHandle",function(t,e,n){var r=1.4*n;return[["M",t-n,e-r],["L",t+n,e-r],["L",t+n,e+r],["L",t-n,e+r],["Z"]]}),py.registerSymbol("verticalHandle",function(t,e,n){var r=1.4*n,i=n/2,a=t+.4*r;return[["M",t,e],["L",a,e+i],["L",t+r,e+i],["L",t+r,e-i],["L",a,e-i],["Z"],["M",a,e+(n=n/6)],["L",t+r-2,e+n],["M",a,e-n],["L",t+r-2,e-n]]}),py.registerSymbol("horizontalHandle",function(t,e,n){var r=1.4*n,i=n/2,a=e+.4*r;return[["M",t,e],["L",t-i,a],["L",t-i,e+r],["L",t+i,e+r],["L",t+i,a],["Z"],["M",t-(n=n/6),a],["L",t-n,e+r-2],["M",t+n,a],["L",t+n,e+r-2]]});var vb=vm({layout:"flex",markerGroup:"marker-group",marker:"marker",labelGroup:"label-group",label:"label",valueGroup:"value-group",value:"value",backgroundGroup:"background-group",background:"background"},"legend-category-item");ce(wb,bb=To),Object.defineProperty(wb.prototype,"showValue",{get:function(){var t=this.attributes.valueText;return!!t&&("string"==typeof t||"number"==typeof t?""!==t:"function"==typeof t||""!==t.attr("text"))},enumerable:!1,configurable:!0}),Object.defineProperty(wb.prototype,"actualSpace",{get:function(){var t=this.labelGroup,e=this.valueGroup,n=this.attributes.markerSize,t=t.node().getBBox(),r=t.width,t=t.height,e=e.node().getBBox(),i=e.width,e=e.height;return{markerWidth:n,labelWidth:r,valueWidth:i,height:Math.max(n,t,e)}},enumerable:!1,configurable:!0}),Object.defineProperty(wb.prototype,"span",{get:function(){var t,e=this.attributes.span;return e?(t=(e=O(ty(e),2))[0],e=e[1],[t/(e=t+(t=this.showValue?e:0)),t/e]):[1,1]},enumerable:!1,configurable:!0}),Object.defineProperty(wb.prototype,"shape",{get:function(){var t=this.attributes,e=t.markerSize,t=t.width,n=this.actualSpace,r=n.markerWidth,n=n.height,i=this.actualSpace,a=i.labelWidth,i=i.valueWidth,o=O(this.spacing,2),s=o[0],o=o[1];return t&&(t=t-e-s-o,e=O(this.span,2),a=(e=O([e[0]*t,e[1]*t],2))[0],i=e[1]),{width:r+a+i+s+o,height:n,markerWidth:r,labelWidth:a,valueWidth:i}},enumerable:!1,configurable:!0}),Object.defineProperty(wb.prototype,"spacing",{get:function(){var t,e=this.attributes.spacing;return e?(t=(e=O(ty(e),2))[0],e=e[1],this.showValue?[t,e]:[t,0]):[0,0]},enumerable:!1,configurable:!0}),Object.defineProperty(wb.prototype,"layout",{get:function(){var t=this.shape,e=t.markerWidth,n=t.labelWidth,r=t.valueWidth,i=t.width,t=t.height,a=O(this.spacing,2),o=a[0];return{height:t,width:i,markerWidth:e,labelWidth:n,valueWidth:r,position:[e/2,e+o,e+n+o+a[1]]}},enumerable:!1,configurable:!0}),Object.defineProperty(wb.prototype,"scaleSize",{get:function(){var t=(t=(t=this.markerGroup.node()).querySelector(vb.marker.class))?t.style:{},e=this.attributes,n=e.markerSize,r=e.markerStrokeWidth,r=void 0===r?t.strokeWidth:r,i=e.markerLineWidth,i=void 0===i?t.lineWidth:i,e=e.markerStroke,t=void 0===e?t.stroke:e,e=+(r||i||(t?1:0))*Math.sqrt(2),r=this.markerGroup.node().getBBox(),i=r.width,t=r.height;return(1-e/Math.max(i,t))*n},enumerable:!1,configurable:!0}),wb.prototype.renderMarker=function(t){var e=this,n=this.attributes.marker,r=k(this.attributes,"marker");this.markerGroup=t.maybeAppendByClassName(vb.markerGroup,"g").style("zIndex",0),Tm(!!n,this.markerGroup,function(){e.markerGroup.maybeAppendByClassName(vb.marker,n).styles(r),e.markerGroup.node().scale(1/e.markerGroup.node().getScale()[0]),Km(e.markerGroup.node(),e.scaleSize,!0)})},wb.prototype.renderLabel=function(t){var e=k(this.attributes,"label"),n=e.text,e=rt(e,["text"]);this.labelGroup=t.maybeAppendByClassName(vb.labelGroup,"g").style("zIndex",0),this.labelGroup.maybeAppendByClassName(vb.label,function(){return Lm(n)}).styles(e)},wb.prototype.renderValue=function(t){var e=this,n=k(this.attributes,"value"),r=n.text,i=rt(n,["text"]);this.valueGroup=t.maybeAppendByClassName(vb.valueGroup,"g").style("zIndex",0),Tm(this.showValue,this.valueGroup,function(){e.valueGroup.maybeAppendByClassName(vb.value,function(){return Lm(r)}).styles(i)})},wb.prototype.renderBackground=function(t){var e=this.shape,n=e.width,e=e.height,r=k(this.attributes,"background");this.background=t.maybeAppendByClassName(vb.backgroundGroup,"g").style("zIndex",-1),this.background.maybeAppendByClassName(vb.background,"rect").styles(y({width:n,height:e},r))},wb.prototype.adjustLayout=function(){var t=this.layout,e=t.labelWidth,n=t.valueWidth,r=t.height,t=O(t.position,3),i=t[0],a=t[1],t=t[2],r=r/2;this.markerGroup.styles({x:i,y:r}),this.labelGroup.styles({x:a,y:r}),Sm(this.labelGroup.select(vb.label.class).node(),Math.ceil(e)),this.showValue&&(this.valueGroup.styles({x:t,y:r}),Sm(this.valueGroup.select(vb.value.class).node(),Math.ceil(n)))},wb.prototype.render=function(t,e){e=w(e);this.renderMarker(e),this.renderLabel(e),this.renderValue(e),this.renderBackground(e),this.adjustLayout()};var bb,xb=wb;function wb(t){return bb.call(this,t,{span:[1,1],marker:function(){return new nt.Circle({style:{r:6}})},markerSize:10,labelFill:"#646464",valueFill:"#646464",labelFontSize:12,valueFontSize:12,labelTextBaseline:"middle",valueTextBaseline:"middle"})||this}function Mb(t,e,n){return void 0===n&&(n=!0),t?e(t):n}var Ob,kb=vm({page:"item-page",navigator:"navigator",item:"item"},"items"),_b=(ce(Eb,Ob=To),Object.defineProperty(Eb.prototype,"pageViews",{get:function(){return this.navigator.getContainer()},enumerable:!1,configurable:!0}),Object.defineProperty(Eb.prototype,"grid",{get:function(){var t=this.attributes,e=t.gridRow,n=t.gridCol,t=t.data;if(e||n)return e&&n?[e,n]:e?[e,t.length]:[t.length,n];throw new Error("gridRow and gridCol can not be set null at the same time")},enumerable:!1,configurable:!0}),Object.defineProperty(Eb.prototype,"renderData",{get:function(){var t=this.attributes,a=t.data,o=t.layout,s=k(this.attributes,"item");return a.map(function(e,n){var t=e.id,r=e.label,i=e.value;return{id:"".concat(void 0===t?n:t),index:n,style:y({layout:o,labelText:r,valueText:i},Object.fromEntries(Object.entries(s).map(function(t){t=O(t,2);return[t[0],ym(t[1],[e,n,a])]})))}})},enumerable:!1,configurable:!0}),Eb.prototype.getGridLayout=function(){var u=this,t=this.attributes,f=t.orientation,h=t.width,d=t.rowPadding,p=t.colPadding,g=O(this.navigatorShape,1)[0],t=O(this.grid,2),m=t[0],y=t[1],v=y*m,b=0;return this.pageViews.children.map(function(t,e){var n,r=Math.floor(e/v),i=e%v,a=u.ifHorizontal(y,m),a=[Math.floor(i/a),i%a],a=("vertical"===f&&a.reverse(),O(a,2)),o=a[0],a=a[1],s=(h-g-(y-1)*p)/y,t=t.getBBox().height,l=O([0,0],2),c=l[0],l=l[1];return b="horizontal"===f?(c=(n=O([b,o*(t+d)],2))[0],l=n[1],a===y-1?0:b+s+p):(c=(n=O([a*(s+p),b],2))[0],l=n[1],o===m-1?0:b+t+d),{page:r,index:e,row:o,col:a,pageIndex:i,width:s,height:t,x:c,y:l}})},Eb.prototype.getFlexLayout=function(){var t=this.attributes,e=t.width,n=t.height,a=t.rowPadding,o=t.colPadding,t=O(this.navigatorShape,1)[0],r=O(this.grid,2),s=r[0],l=r[1],r=O([e-t,n],2),c=r[0],u=r[1],e=O([0,0,0,0,0,0,0,0],8),f=e[0],h=e[1],d=e[2],p=e[3],g=e[4],m=e[5],y=e[6],v=e[7];return this.pageViews.children.map(function(t,e){var t=t.getBBox(),n=t.width,t=t.height,r=0===y?0:o,i=y+r+n;return i<=c&&Mb(g,function(t){return t<l})?(r=O([y+r,v,i],3),f=r[0],h=r[1],y=r[2]):(i=O([m+1,0,0,v+t+a],4),m=i[0],g=i[1],y=i[2],(v=i[3])+a+t<=u&&Mb(m,function(t){return t<s})?(r=O([y,v,n],3),f=r[0],h=r[1],y=r[2]):(i=O([0,0,n,0,d+1,0,0,0],8),f=i[0],h=i[1],y=i[2],v=i[3],d=i[4],p=i[5],m=i[6],g=i[7])),{width:n,height:t,x:f,y:h,page:d,index:e,pageIndex:p++,row:m,col:g++}})},Object.defineProperty(Eb.prototype,"itemsLayout",{get:function(){this.navigatorShape=[0,0];var t="grid"===this.attributes.layout?this.getGridLayout:this.getFlexLayout,e=t.call(this);return 0<e.slice(-1)[0].page?(this.navigatorShape=[55,0],t.call(this)):e},enumerable:!1,configurable:!0}),Eb.prototype.ifHorizontal=function(t,e){return yb(this.attributes.orientation,t,e)},Eb.prototype.flattenPage=function(e){e.querySelectorAll(kb.item.class).forEach(function(t){e.appendChild(t)}),e.querySelectorAll(kb.page.class).forEach(function(t){e.removeChild(t).destroy()})},Eb.prototype.renderItems=function(t){var e=this.attributes,n=e.click,r=e.mouseenter,i=e.mouseleave,a=(this.flattenPage(t),this.dispatchCustomEvent.bind(this));w(t).selectAll(kb.item.class).data(this.renderData,function(t){return t.id}).join(function(t){return t.append(function(t){t=t.style;return new xb({style:t})}).attr("className",kb.item.name).on("click",function(){null!=n&&n(this),a("itemClick",{item:this})}).on("pointerenter",function(){null!=r&&r(this),a("itemMouseenter",{item:this})}).on("pointerleave",function(){null!=i&&i(this),a("itemMouseleave",{item:this})})},function(t){return t.each(function(t){t=t.style;this.update(t)})},function(t){return t.remove()})},Eb.prototype.relayoutNavigator=function(){var t=this.attributes,e=t.layout,t=t.width,n=(null==(n=this.pageViews.children[0])?void 0:n.getBBox().height)||0,r=O(this.navigatorShape,2),i=r[0],r=r[1];this.navigator.update("grid"===e?{pageWidth:t-i,pageHeight:n-r}:{})},Eb.prototype.adjustLayout=function(){var n,e=this,t=Object.entries((t=this.itemsLayout,n="page",t.reduce(function(t,e){return(t[e[n]]=t[e[n]]||[]).push(e),t},{}))).map(function(t){t=O(t,2);return{page:t[0],layouts:t[1]}}),u=v([],O(this.navigator.getContainer().children),!1);t.forEach(function(t){var t=t.layouts,c=e.pageViews.appendChild(new nt.Group({className:kb.page.name}));t.forEach(function(t){var n,r,i,e=t.x,a=t.y,o=t.index,s=t.width,l=t.height,o=u[o];c.appendChild(o),n=t,r=o,(i=Ve(t="__layout__")?t.split("."):t).forEach(function(t,e){e<i.length-1?(ze(r[t])||(r[t]=$e(i[e+1])?[]:{}),r=r[t]):r[t]=n}),o.update({x:e,y:a,width:s,height:l})})}),this.relayoutNavigator()},Eb.prototype.renderNavigator=function(t){var e=this.attributes.orientation,n=k(this.attributes,"nav"),r=bm({orientation:e},n),i=this;return t.selectAll(kb.navigator.class).data(["nav"]).join(function(t){return t.append(function(){return new gb({style:r})}).attr("className",kb.navigator.name).each(function(){i.navigator=this})},function(t){return t.each(function(){this.update(r)})},function(t){return t.remove()}),this.navigator},Eb.prototype.getBBox=function(){return this.navigator.getBBox()},Eb.prototype.render=function(t,e){var n=this.attributes.data;n&&0!==n.length&&(n=this.renderNavigator(w(e)),this.renderItems(n.getContainer()),this.adjustLayout())},Eb.prototype.dispatchCustomEvent=function(t,e){t=new nt.CustomEvent(t,{detail:e});this.dispatchEvent(t)},Eb);function Eb(t){t=Ob.call(this,t,{data:[],gridRow:1/0,gridCol:void 0,padding:0,width:1e3,height:100,rowPadding:0,colPadding:0,layout:"flex",orientation:"horizontal",click:sn,mouseenter:sn,mouseleave:sn})||this;return t.navigatorShape=[0,0],t}var Sb,Ab=vm({markerGroup:"marker-group",marker:"marker",labelGroup:"label-group",label:"label"},"handle"),Lb={showLabel:!0,formatter:function(t){return t.toString()},markerSize:25,markerStroke:"#c5c5c5",markerFill:"#fff",markerLineWidth:1,labelFontSize:12,labelFill:"#c5c5c5",labelText:"",orientation:"vertical",spacing:0},Tb=(ce(jb,Sb=To),jb.prototype.render=function(t,e){var n=w(e).maybeAppendByClassName(Ab.markerGroup,"g"),n=(this.renderMarker(n),w(e).maybeAppendByClassName(Ab.labelGroup,"g"));this.renderLabel(n)},jb.prototype.renderMarker=function(t){var r=this,e=this.attributes,n=e.orientation,e=e.markerSymbol,i=void 0===e?yb(n,"horizontalHandle","verticalHandle"):e;Tm(!!i,t,function(t){var e=k(r.attributes,"marker"),n=y({symbol:i},e);r.marker=t.maybeAppendByClassName(Ab.marker,function(){return new py({style:n})}).update(n)})},jb.prototype.renderLabel=function(t){var s=this,e=this.attributes,n=e.showLabel,l=e.orientation,r=e.spacing,c=void 0===r?0:r,u=e.formatter;Tm(n,t,function(t){var e=k(s.attributes,"label"),n=e.text,e=rt(e,["text"]),r=(null==(r=t.select(Ab.marker.class))?void 0:r.node().getBBox())||{},i=r.width,r=r.height,r=O(yb(l,[0,(void 0===r?0:r)+c,"center","top"],[(void 0===i?0:i)+c,0,"start","middle"]),4),i=r[0],a=r[1],o=r[2],r=r[3];t.maybeAppendByClassName(Ab.label,"text").styles(y(y({},e),{x:i,y:a,text:u(n).toString(),textAlign:o,textBaseline:r}))})},jb);function jb(t){return Sb.call(this,t,Lb)||this}var Nb,is={showTitle:!0,padding:0,orientation:"horizontal",backgroundFill:"transparent",titleText:"",titleSpacing:4,titlePosition:"top-left",titleFill:"#2C3542",titleFontWeight:"bold",titleFontFamily:"sans-serif",titleFontSize:12},Pb=bm({},is,{}),Cb=bm({},is,iy(Lb,"handle"),{color:["#d0e3fa","#acc7f6","#8daaf2","#6d8eea","#4d73cd","#325bb1","#5a3e75","#8c3c79","#e23455","#e7655b"],indicatorBackgroundFill:"#262626",indicatorLabelFill:"white",indicatorLabelFontSize:12,indicatorVisibility:"hidden",labelAlign:"value",labelDirection:"positive",labelSpacing:5,showHandle:!0,showIndicator:!0,showLabel:!0,slidable:!0,titleText:"",type:"continuous"}),Rb=vm({title:"title",titleGroup:"title-group",items:"items",itemsGroup:"items-group",contentGroup:"content-group",ribbonGroup:"ribbon-group",ribbon:"ribbon",handlesGroup:"handles-group",handle:"handle",startHandle:"start-handle",endHandle:"end-handle",labelGroup:"label-group",label:"label",indicator:"indicator"},"legend"),Ib=(ce(Bb,Nb=To),Bb.prototype.renderTitle=function(t,e,n){var r=this.attributes,i=r.showTitle,r=r.titleText,a=O(ay(k(this.attributes,"title")),2),o=a[0],a=a[1],s=(this.titleGroup=t.maybeAppendByClassName(Rb.titleGroup,"g").styles(a),y(y({width:e,height:n},o),{text:i?r:""}));this.title=this.titleGroup.maybeAppendByClassName(Rb.title,function(){return new ob({style:s})}).update(s)},Bb.prototype.renderItems=function(t,e){var n=e.x,r=e.y,i=e.width,e=e.height,a=O(ay(k(this.attributes,"title",!0)),2),o=a[0],a=a[1],s=y(y({},o),{width:i,height:e,x:0,y:0}),l=(this.itemsGroup=t.maybeAppendByClassName(Rb.itemsGroup,"g").styles(y({x:n,y:r},a)),this);this.itemsGroup.selectAll(Rb.items.class).data(["items"]).join(function(t){return t.append(function(){return new _b({style:s})}).attr("className",Rb.items.name).each(function(){l.items=w(this)})},function(t){return t.update(s)},function(t){return t.remove()})},Bb.prototype.adjustLayout=function(){var t,e;this.attributes.showTitle&&(t=(e=this.title.node().getAvailableSpace()).x,e=e.y,this.itemsGroup.node().setLocalPosition(t,e))},Object.defineProperty(Bb.prototype,"availableSpace",{get:function(){var t=this.attributes,e=t.showTitle,n=t.width,t=t.height;return e?this.title.node().getAvailableSpace():new gm(0,0,n,t)},enumerable:!1,configurable:!0}),Bb.prototype.getBBox=function(){var t,e,n,r,i,a,o,s,l,c,u=null==(u=this.title)?void 0:u.node(),f=null==(f=this.items)?void 0:f.node();return u&&f?(f=f,t=(r=(u=u).attributes).position,e=r.spacing,n=r.inset,r=r.text,u=u.getBBox(),i=f.getBBox(),t=rb(t),e=(r=O(ty(r?e:0),4))[0],a=r[1],o=r[2],r=r[3],s=(n=O(ty(n),4))[0],l=n[1],c=n[2],n=n[3],a=(r=O([r+a,e+o],2))[0],e=r[1],r=(o=O([n+l,s+c],2))[0],n=o[1],"l"===t[0]?new gm(u.x,u.y,i.width+u.width+a+r,Math.max(i.height+n,u.height)):"t"===t[0]?new gm(u.x,u.y,Math.max(i.width+r,u.width),i.height+u.height+e+n):(s=(l=O([f.attributes.width||i.width,f.attributes.height||i.height],2))[0],c=l[1],new gm(i.x,i.y,s+u.width+a+r,c+u.height+e+n))):Nb.prototype.getBBox.call(this)},Bb.prototype.render=function(t,e){var n=t.width,t=t.height,e=w(e);this.renderTitle(e,n,t),this.renderItems(e,this.availableSpace),this.adjustLayout()},Bb);function Bb(t){return Nb.call(this,t,Pb)||this}var Fb,Db={backgroundFill:"#262626",backgroundLineCap:"round",backgroundLineWidth:1,backgroundStroke:"#333",backgroundZIndex:-1,formatter:function(t){return t.toString()},labelFill:"#fff",labelFontSize:12,labelTextBaseline:"middle",padding:[2,4],position:"right",zIndex:999},zb=vm({background:"background",labelGroup:"label-group",label:"label"},"indicator"),Wb=(ce(Gb,Fb=To),Gb.prototype.renderBackground=function(){var t,e,n,r,i,a,o;this.label&&(t=(i=this.attributes).position,o=(i=O(ty(i.padding),4))[0],e=i[1],n=i[2],i=i[3],a=(r=this.label.node().getLocalBounds()).min,r=r.max,i=[[a[0]-i,a[1]-o],[r[0]+e,r[1]+n]],a=this.getPath(t,i),o=k(this.attributes,"background"),this.background=w(this.group).maybeAppendByClassName(zb.background,"path").styles(y(y({},o),{path:a})),this.group.appendChild(this.label.node()))},Gb.prototype.renderLabel=function(){var t=this.attributes,e=t.formatter,n=t.labelText,t=O(ay(k(this.attributes,"label")),2),r=t[0],t=t[1],r=(r.text,rt(r,["text"]));this.label=w(this.group).maybeAppendByClassName(zb.labelGroup,"g").styles(t),n&&this.label.maybeAppendByClassName(zb.label,function(){return Lm(e(n))}).style("text",e(n).toString()).selectAll("text").styles(r)},Gb.prototype.adjustLayout=function(){var t=O(this.point,2),e=t[0],t=t[1];this.group.attr("x",-e).attr("y",-t)},Gb.prototype.getPath=function(n,t){var r=this,t=O(t,2),e=O(t[0],2),i=e[0],e=e[1],t=O(t[1],2),a=t[0],t=t[1],o={top:"bottom",right:"left",bottom:"top",left:"right"},a=Object.entries({top:[[i,e],[a,e]],right:[[a,e],[a,t]],bottom:[[a,t],[i,t]],left:[[i,t],[i,e]]}).map(function(t){var t=O(t,2),e=t[0],t=t[1];return e===o[n]?r.createCorner(t):[v(["M"],O(t[0]),!1),v(["L"],O(t[1]),!1)]});return a.push([["Z"]]),a.flat().filter(function(t,e,n){return 0===e||"M"!==t[0]})},Gb.prototype.createCorner=function(t,e){void 0===e&&(e=10);var n=function(t,e){var n=(t=O(t,2))[0],t=t[1],r=(e=O(e,2))[0],e=e[1];return n!==r&&t===e}.apply(void 0,v([],O(t),!1)),t=O(t,2),r=O(t[0],2),i=r[0],r=r[1],t=O(t[1],2),a=t[0],t=t[1],a=O(n?[a-i,[i,a]]:[t-r,[r,t]],2),t=a[0],a=O(a[1],2),o=a[0],a=a[1],s=t/2,e=e*(t/Math.abs(t)),t=e/2,e=e*Math.sqrt(3)/2*.8,o=O([o,o+s-t,o+s,o+s+t,a],5),s=o[0],t=o[1],a=o[2],l=o[3],o=o[4];return n?(this.point=[a,r-e],[["M",s,r],["L",t,r],["L",a,r-e],["L",l,r],["L",o,r]]):(this.point=[i+e,a],[["M",i,s],["L",i,t],["L",i+e,a],["L",i,l],["L",i,o]])},Gb.prototype.bindEvents=function(){this.label.on(nt.ElementEvent.BOUNDS_CHANGED,this.renderBackground)},Gb.prototype.render=function(){this.renderLabel(),this.renderBackground(),this.adjustLayout()},Gb);function Gb(t){t=Fb.call(this,t,Db)||this;return t.point=[0,0],t.group=t.appendChild(new nt.Group({})),t.isMutationObserved=!0,t}function qb(t,e){var t=O(function(t,e){for(var n=1;n<t.length;n+=1){var r=t[n-1],i=t[n];if(r<=e&&e<=i)return[r,i]}return[e,e]}(t,e),2),n=t[0],t=t[1];return{tick:(n+t)/2<e?t:n,range:[n,t]}}var Hb=vm({trackGroup:"background-group",track:"background",selectionGroup:"ribbon-group",selection:"ribbon",clipPath:"clip-path"},"ribbon");function Vb(t){var e=t.orientation,n=t.size,t=t.length;return yb(e,[t,n],[n,t])}function Yb(t){var e=t.type,t=O(Vb(t),2),n=t[0],t=t[1];return"size"===e?[["M",0,t],["L",0+n,0],["L",0+n,t],["Z"]]:[["M",0,t],["L",0,0],["L",0+n,0],["L",0+n,t],["Z"]]}function $b(t){var i,a,o,e=t.orientation,r=t.color,n=t.block,t=t.partition,s=(l=Ie(r)?new Array(20).fill(0).map(function(t,e,n){return r(e/(n.length-1))}):r).length,l=l.map(function(t){return nt.parseColor(t).toString()});return s?1===s?l[0]:n?(i=t,n=e,a=Array.from(l),o=i.length,new Array(o).fill(0).reduce(function(t,e,n){var r=a[n%a.length];return t+" ".concat(i[n],":").concat(r).concat(n<o-1?" ".concat(i[n+1],":").concat(r):"")},"l(".concat("horizontal"===n?"0":"270",")"))):l.reduce(function(t,e,n){return t+" ".concat(n/(s-1),":").concat(e)},"l(".concat(yb(e,"0","270"),")")):""}function Ub(t,e){var n,r,i,a=k(e,"selection"),o=$b(e),t=t.maybeAppendByClassName(Hb.selection,"path").styles(y({path:Yb(e),fill:o},a)),a=t.maybeAppendByClassName(Hb.clipPath,"path").styles({path:(a=(o=e).orientation,(e=o.range)?(r=(o=O(Vb(o),2))[0],o=o[1],n=(e=O(e,2))[0],e=e[1],i=yb(a,n*r,0),n=yb(a,0,n*o),r=yb(a,e*r,r),[["M",i,n],["L",i,i=yb(a,o,e*o)],["L",r,i],["L",r,n],["Z"]]):[])}).node();t.style("clip-path",a)}ce(Zb,Kb=To),Zb.prototype.render=function(t,e){var n,r,i=w(e).maybeAppendByClassName(Hb.trackGroup,"g");i=i,r=k(n=t,"track"),i.maybeAppendByClassName(Hb.track,"path").styles(y({path:Yb(n)},r)),Ub(w(e).maybeAppendByClassName(Hb.selectionGroup,"g"),t)};var Kb,Xb=Zb;function Zb(t){return Kb.call(this,t,{type:"color",orientation:"horizontal",size:30,range:[0,1],length:200,block:!1,partition:[],color:["#fff","#000"],trackFill:"#e5e5e5"})||this}var Qb,Jb,t2,e2,n2=rn(function(t){return{min:Math.min.apply(Math,v([],O(t.map(function(t){return t.value})),!1)),max:Math.max.apply(Math,v([],O(t.map(function(t){return t.value})),!1))}},function(t){return t.map(function(t){return t.id})}),r2=(ce(c,Qb=To),Object.defineProperty(c.prototype,"handleOffsetRatio",{get:function(){return this.ifHorizontal(.7,.9)},enumerable:!1,configurable:!0}),c.prototype.getBBox=function(){var t=this.attributes,e=t.width,t=t.height;return new gm(0,0,e,t)},c.prototype.render=function(t,e){var n=this,t=t.showLabel,r=(this.renderTitle(w(e)),this.availableSpace),i=r.x,r=r.y,e=w(e).maybeAppendByClassName(Rb.contentGroup,"g").styles({x:i,y:r}),i=(Tm(!!t,e.maybeAppendByClassName(Rb.labelGroup,"g").styles({zIndex:1}),function(t){n.renderLabel(t)}),e.maybeAppendByClassName(Rb.ribbonGroup,"g").styles({zIndex:0}));this.handlesGroup=e.maybeAppendByClassName(Rb.handlesGroup,"g").styles({zIndex:2}),this.renderHandles(),this.renderRibbon(i),this.renderIndicator(e),this.adjustLabel(),this.adjustHandles()},Object.defineProperty(c.prototype,"range",{get:function(){var t=this.attributes.data;return n2(t)},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"ribbonScale",{get:function(){var t=this.range,e=t.min,t=t.max;return this.innerRibbonScale.update({domain:[e,t],range:[0,1]}),this.innerRibbonScale},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"ribbonRange",{get:function(){var t=O(this.selection,2),e=t[0],t=t[1],n=this.ribbonScale;return[n.map(e),n.map(t)]},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"selection",{get:function(){var t=this.range,e=t.min,t=t.max,n=this.attributes.defaultValue,e=O(void 0===n?[e,t]:n,2);return[e[0],e[1]]},enumerable:!1,configurable:!0}),c.prototype.ifHorizontal=function(t,e){return yb(this.attributes.orientation,"function"==typeof t?t():t,"function"==typeof e?e():e)},c.prototype.renderTitle=function(t){var e=this.attributes,n=e.showTitle,r=e.titleText,i=e.width,e=e.height,a=k(this.attributes,"title"),o=y(y({},a),{width:i,height:e,text:r}),s=this;t.selectAll(Rb.title.class).data(n?[r]:[]).join(function(t){return t.append(function(){return new ob({style:o})}).attr("className",Rb.title.name).each(function(){s.title=this})},function(t){return t.update(o)},function(t){return t.each(function(){s.title=void 0}).remove()})},Object.defineProperty(c.prototype,"availableSpace",{get:function(){var t,e;return this.title?this.title.getAvailableSpace():(t=(e=this.attributes).width,e=e.height,new gm(0,0,t,e))},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"labelFixedSpacing",{get:function(){return this.attributes.showTick?5:0},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"labelPosition",{get:function(){var t=this.attributes,e=t.orientation,t=t.labelDirection;return{vertical:{positive:"right",negative:"left"},horizontal:{positive:"bottom",negative:"top"}}[e][t]},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"labelBBox",{get:function(){var t,e;return this.attributes.showLabel?(this.cacheLabelBBox||(t=(e=(null==(e=this.label.querySelector(tv.labelGroup.class))?void 0:e.children.slice(-1)[0]).getBBox()).width,e=e.height,this.cacheLabelBBox=new gm(0,0,t,e)),this.cacheLabelBBox):new gm(0,0,0,0)},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"labelShape",{get:function(){var t,e=this.attributes,n=e.showLabel,e=e.labelSpacing,e=void 0===e?0:e;return n?{width:t=(n=this.labelBBox).width,height:n=n.height,size:this.ifHorizontal(n,t)+e+this.labelFixedSpacing,length:this.ifHorizontal(t,n)}:{width:0,height:0,size:0,length:0}},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"ribbonBBox",{get:function(){var t=this.attributes,e=t.showHandle,t=t.ribbonSize,n=this.availableSpace,r=n.width,n=n.height,i=this.labelShape,a=i.size,i=i.length,r=O(this.ifHorizontal([n,r],[r,n]),2),n=r[0],r=r[1],e=e?this.handleShape:{size:0,length:0},o=e.size,e=e.length,s=this.handleOffsetRatio,l=0,c=this.labelPosition,l=t||(["bottom","right"].includes(c)?Math.min(n-a,(n-o)/s):o<n*(1-s)?Math.max(n-a,0):Math.max((n-a-o)/s,0)),t=Math.max(e,i),n=r-t,o=O(this.ifHorizontal([n,l],[l,n]),2),s=o[0],e=o[1],i=["top","left"].includes(c)?a:0,r=O(this.ifHorizontal([t/2,i],[i,t/2]),2),l=r[0],n=r[1];return new gm(l,n,s,e)},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"ribbonShape",{get:function(){var t=this.ribbonBBox,e=t.width,t=t.height;return this.ifHorizontal({size:t,length:e},{size:e,length:t})},enumerable:!1,configurable:!0}),c.prototype.renderRibbon=function(t){var e=this.attributes,n=e.data,r=e.type,i=e.orientation,a=e.color,e=e.block,o=k(this.attributes,"ribbon"),s=this.range,l=s.min,c=s.max,s=this.ribbonBBox,u=s.x,s=s.y,f=this.ribbonShape,h=f.length,f=f.size,d=bm({x:u,y:s,length:h,size:f,type:r,orientation:i,color:a,block:e,partition:n.map(function(t){return(t.value-l)/(c-l)}),range:this.ribbonRange},o);this.ribbon=t.maybeAppendByClassName(Rb.ribbon,function(){return new Xb({style:d})}).update(d)},c.prototype.getHandleClassName=function(t){return"".concat(Rb.prefix("".concat(t,"-handle")))},c.prototype.renderHandles=function(){var t=this.attributes,e=t.showHandle,t=t.orientation,n=k(this.attributes,"handle"),r=O(this.selection,2),i=r[0],r=r[1],a=y(y({},n),{orientation:t}),o=this;this.handlesGroup.selectAll(Rb.handle.class).data(e?[{value:i,type:"start"},{value:r,type:"end"}]:[],function(t){return t.type}).join(function(t){return t.append(function(){return new Tb({style:a})}).attr("className",function(t){t=t.type;return"".concat(Rb.handle," ").concat(o.getHandleClassName(t))}).each(function(t){var e=t.type,t=t.value,t=(this.update({labelText:t}),"".concat(e,"Handle"));(o[t]=this).addEventListener("pointerdown",o.onDragStart(e))})},function(t){return t.update(a).each(function(t){t=t.value;this.update({labelText:t})})},function(t){return t.each(function(t){t=t.type,t="".concat(t,"Handle");o[t]=void 0}).remove()})},c.prototype.adjustHandles=function(){var t=O(this.selection,2),e=t[0],t=t[1];this.setHandlePosition("start",e),this.setHandlePosition("end",t)},Object.defineProperty(c.prototype,"handleBBox",{get:function(){if(!this.cacheHandleBBox){if(!this.attributes.showHandle)return new gm(0,0,0,0);var t=this.startHandle.getBBox(),e=t.width,t=t.height,n=this.endHandle.getBBox(),r=n.width,n=n.height,e=O([Math.max(e,r),Math.max(t,n)],2),r=e[0],t=e[1];this.cacheHandleBBox=new gm(0,0,r,t)}return this.cacheHandleBBox},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"handleShape",{get:function(){var t=this.handleBBox,e=t.width,t=t.height,n=O(this.ifHorizontal([t,e],[e,t]),2);return{width:e,height:t,size:n[0],length:n[1]}},enumerable:!1,configurable:!0}),c.prototype.setHandlePosition=function(t,e){var n=this.attributes.handleFormatter,r=this.ribbonBBox,i=r.x,r=r.y,a=this.ribbonShape.size,e=this.getOffset(e),i=O(this.ifHorizontal([i+e,r+a*this.handleOffsetRatio],[i+a*this.handleOffsetRatio,r+e]),2),a=i[0],r=i[1],e=this.handlesGroup.select(".".concat(this.getHandleClassName(t))).node();null!=e&&e.update({x:a,y:r,formatter:n})},c.prototype.renderIndicator=function(t){var e=k(this.attributes,"indicator");this.indicator=t.maybeAppendByClassName(Rb.indicator,function(){return new Wb({})}).update(e)},Object.defineProperty(c.prototype,"labelData",{get:function(){var s=this;return this.attributes.data.reduce(function(t,e,n,r){var i,a,o=null!=(o=null==e?void 0:e.id)?o:n.toString();return t.push(y(y({},e),{id:o,index:n,type:"value",label:null!=(i=null==e?void 0:e.label)?i:e.value.toString(),value:s.ribbonScale.map(e.value)})),n<r.length-1&&(i=r[n+1],a=((i=(r=O([e.value,i.value],2))[0])+(r=r[1]))/2,t.push(y(y({},e),{id:o,index:n,type:"range",range:[i,r],label:[i,r].join("~"),value:s.ribbonScale.map(a)}))),t},[])},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"labelStyle",{get:function(){var t=O(["center","middle"],2),e=t[0],t=t[1],n=this.labelPosition;return"top"===n?t="bottom":"bottom"===n?t="top":"left"===n?e="end":"right"===n&&(e="start"),{labelTextAlign:e,labelTextBaseline:t}},enumerable:!1,configurable:!0}),c.prototype.renderLabel=function(t){var e=this.attributes,n=e.showTick,n=void 0!==n&&n,r=e.labelFilter,e=e.labelFormatter,i=k(this.attributes,"label"),a=i.align,o=k(i,"tick"),i=k(i,"tick",!0),n=bm(y({showLine:!1,showGrid:!1,showTick:n,type:"linear",startPos:[0,0],endPos:[0,0],tickDirection:"negative",labelTransform:"rotate(0)"},this.labelStyle),iy(o,"tick"),iy(i,"label"),{data:this.labelData}),o={tickFilter:function(t,e,n){return"value"===(null==t?void 0:t.type)&&(!r||r(t,t.index,n.filter(function(t){return"value"!==t.type})))},labelFilter:function(t,e,n){return(null==t?void 0:t.type)===a&&(!r||r(t,t.index,n.filter(function(t){return t.type===a})))},labelFormatter:e},s=y(y({},n),o);this.label=t.maybeAppendByClassName(Rb.label,function(){return new fb({style:s})}).node(),this.label.update(s,!1)},Object.defineProperty(c.prototype,"labelAxisStyle",{get:function(){var t=this.attributes,e=t.showTick,n=t.labelDirection,t=t.labelSpacing,r=this.ribbonShape.size,i=this.labelPosition,a=this.labelFixedSpacing,o=O([0,0,0],3),s=o[0],l=o[1],o=o[2],c=r+t;return e?(o=c,l=a,"positive"===n?"right"===i?o=s=c:"bottom"===i&&(s=o):"negative"!==n||"top"!==i&&"left"!==i||(s=r)):"positive"===n?"right"===i?l=c:"bottom"===i&&(s=r+a,l=t):"negative"!==n||"left"!==i&&"top"!==i||(l=t),{offset:s,spacing:l,tickLength:o}},enumerable:!1,configurable:!0}),c.prototype.adjustLabel=function(){var t,e,n,r,i,a,o;this.attributes.showLabel&&(o=(a=this.ribbonBBox).x,t=a.y,i=a.width,a=a.height,e=(r=this.labelAxisStyle).offset,n=r.spacing,r=r.tickLength,a=(i=O(this.ifHorizontal([[o,t+e],[o+i,t+e]],[[o+e,t+a],[o+e,t]]),2))[0],o=i[1],this.label.update({startPos:a,endPos:o,tickLength:r,labelSpacing:n},!1))},c.prototype.bindEvents=function(){this.ribbon.on("pointerdown",this.onDragStart("ribbon")),this.ribbon.on("pointermove",this.onHovering),this.addEventListener("pointerout",this.hideIndicator)},c.prototype.showIndicator=function(t,e){var n,r,i,a;void 0===e&&(e="".concat(t)),this.attributes.showIndicator&&"number"==typeof t?(i=(a=this.range).min,a=a.max,n=(r=this.ribbonBBox).x,r=r.y,t=Ye(t,i,a),i=this.getOffset(t),a=this.ifHorizontal([i+n,r],[n,i+r]),this.indicator.update({x:a[0],y:a[1],position:this.ifHorizontal("top","left"),labelText:e}),rm(this.indicator.node())):this.hideIndicator()},c.prototype.hideIndicator=function(){im(this.indicator.node())},c.prototype.updateMouse=function(){this.attributes.slidable&&(this.style.cursor="grabbing")},c.prototype.setSelection=function(t,e){this.updateSelection(t,e)},c.prototype.updateSelection=function(t,e,n){void 0===n&&(n=!1);var r,i,a,o,s,l=O(this.selection,2),c=l[0],l=l[1],t=O([t,e],2),e=t[0],t=t[1],n=(n&&(e+=c,t+=l),this.range),c=n.min,l=n.max,u=O((n=[c,l],c=[e,t],l=this.selection,void 0===r&&(r=4),i=(n=O(n,2))[0],n=n[1],a=(c=O(c,2))[0],c=c[1],o=(l=O(l,2))[0],l=l[1],c=(a=O([a,c],2))[0],s=(a=a[1])-c,a<c&&(c=(u=O([a,c],2))[0],a=u[1]),n-i<s?[i,n]:c<i?o===i&&l===a?[i,a]:[i,s+i]:n<a?l===n&&o===c?[c,n]:[n-s,n]:[Hm(c,r),Hm(a,r)]),2),e=u[0],t=u[1];this.update({defaultValue:[e,t]}),this.dispatchSelection()},Object.defineProperty(c.prototype,"step",{get:function(){var t=this.attributes.step,t=void 0===t?1:t,e=this.range,n=e.min,e=e.max;return tn(t)?Hm(.01*(e-n),0):t},enumerable:!1,configurable:!0}),c.prototype.getTickValue=function(t){var e=this.attributes,n=e.data,e=e.block,r=this.range.min;return e?qb(n.map(function(t){return t.value}),t).tick:(e=this.step,r+Math.round((t-r)/e)*e)},c.prototype.getValueByCanvasPoint=function(t,e){var n=this.range,r=n.min,n=n.max,i=O(this.ribbon.node().getPosition(),2),a=i[0],i=i[1],a=this.ifHorizontal(a,i),i=this.ifHorizontal.apply(this,v([],O(Am(t)),!1));return Ye(this.getOffset(i-a,!0),r,n)},c.prototype.getOffset=function(t,e){void 0===e&&(e=!1);var n=this.range,r=n.min,n=n.max,i=this.ribbonShape.length,a=this.eventToOffsetScale;return a.update({domain:[r,n],range:[0,i]}),e?a.invert(t):a.map(t)},c.prototype.dispatchSelection=function(){var t=new nt.CustomEvent("valuechange",{detail:{value:this.selection}});this.dispatchEvent(t)},c.prototype.dispatchIndicated=function(t,e){t=new nt.CustomEvent("indicate",{detail:{value:t,range:e}});this.dispatchEvent(t)},c);function c(t){var a=Qb.call(this,t,Cb)||this;return a.eventToOffsetScale=new i0({}),a.innerRibbonScale=new i0({}),a.cacheLabelBBox=null,a.cacheHandleBBox=null,a.onHovering=function(t){var e=a.attributes,n=e.data,e=e.block,t=(t.stopPropagation(),a.getValueByCanvasPoint(t));e?(e=qb(n.map(function(t){return t.value}),t).range,a.showIndicator((e[0]+e[1])/2,"".concat(e[0],"-").concat(e[1])),a.dispatchIndicated(t,e)):(n=a.getTickValue(t),a.showIndicator(n),a.dispatchIndicated(n))},a.onDragStart=function(e){return function(t){t.stopPropagation(),a.attributes.slidable&&(a.target=e,a.prevValue=a.getTickValue(a.getValueByCanvasPoint(t)),document.addEventListener("mousemove",a.onDragging),document.addEventListener("touchmove",a.onDragging),document.addEventListener("mouseleave",a.onDragEnd),document.addEventListener("mouseup",a.onDragEnd),document.addEventListener("mouseup",a.onDragEnd),document.addEventListener("touchend",a.onDragEnd))}},a.onDragging=function(t){var e=a.target,n=(a.updateMouse(),O(a.selection,2)),r=n[0],n=n[1],t=a.getTickValue(a.getValueByCanvasPoint(t)),i=t-a.prevValue;"start"===e?r!==t&&a.updateSelection(t,n):"end"===e?n!==t&&a.updateSelection(r,t):"ribbon"===e&&0!=i&&(a.prevValue=t,a.updateSelection(i,i,!0))},a.onDragEnd=function(){a.style.cursor="default",document.removeEventListener("mousemove",a.onDragging),document.removeEventListener("touchmove",a.onDragging),document.removeEventListener("mouseup",a.onDragEnd),document.removeEventListener("touchend",a.onDragEnd)},a}function i2(t){Jb||(Jb=document.createElement("table"),e2=document.createElement("tr"),t2=/^\s*<(\w+|!)[^>]*>/,e2={tr:document.createElement("tbody"),tbody:Jb,thead:Jb,tfoot:Jb,td:e2,th:e2,"*":document.createElement("div")});var e=t2.test(t)&&RegExp.$1,e=(e&&e in e2||(e="*"),e2[e]),t=(t="string"==typeof t?t.replace(/(^\s*)|(\s*$)/g,""):t,e.innerHTML=""+t,e.childNodes[0]);return t&&e.contains(t)&&e.removeChild(t),t}function a2(t){return{CONTAINER:"".concat(t=void 0===t?"":t,"tooltip"),TITLE:"".concat(t,"tooltip-title"),LIST:"".concat(t,"tooltip-list"),LIST_ITEM:"".concat(t,"tooltip-list-item"),NAME:"".concat(t,"tooltip-list-item-name"),MARKER:"".concat(t,"tooltip-list-item-marker"),NAME_LABEL:"".concat(t,"tooltip-list-item-name-label"),VALUE:"".concat(t,"tooltip-list-item-value"),CROSSHAIR_X:"".concat(t,"tooltip-crosshair-x"),CROSSHAIR_Y:"".concat(t,"tooltip-crosshair-y")}}var o2={overflow:"hidden","white-space":"nowrap","text-overflow":"ellipsis"};ce(f2,s2=To),Object.defineProperty(f2.prototype,"HTMLTooltipElement",{get:function(){return this.element},enumerable:!1,configurable:!0}),f2.prototype.getContainer=function(){return this.element},Object.defineProperty(f2.prototype,"position",{set:function(t){var t=O(t,2),e=t[0],t=t[1];this.attributes.x=e,this.attributes.y=t,this.updatePosition()},enumerable:!1,configurable:!0}),Object.defineProperty(f2.prototype,"elementSize",{get:function(){return{width:this.element.offsetWidth,height:this.element.offsetHeight}},enumerable:!1,configurable:!0}),Object.defineProperty(f2.prototype,"HTMLTooltipItemsElements",{get:function(){var t=this.attributes,e=t.data,o=t.template;return e.map(function(t,e){var n,r=t.name,r=void 0===r?"":r,i=t.color,i=void 0===i?"black":i,a=t.index,t=rt(t,["name","color","index"]),r=y({name:r,color:i,index:null!=a?a:e},t);return i2((i=o.item,n=r,i&&n?i.replace(/\\?\{([^{}]+)\}/g,function(t,e){return"\\"===t.charAt(0)?t.slice(1):void 0===n[e]?"":n[e]}):i))})},enumerable:!1,configurable:!0}),f2.prototype.render=function(t,e){this.renderHTMLTooltipElement(),this.updatePosition()},f2.prototype.destroy=function(){var t;null!=(t=this.element)&&t.remove(),s2.prototype.destroy.call(this)},f2.prototype.show=function(t,e){var n,r=this;void 0!==t&&void 0!==e&&(n=this.element.style.transition,this.element.style.transition="none",this.position=[null!=t?t:+this.attributes.x,null!=e?e:+this.attributes.y],setTimeout(function(){r.element.style.transition=n},10)),this.element.style.visibility="visible"},f2.prototype.hide=function(){this.element.style.visibility="hidden"},f2.prototype.initShape=function(){var t=this.attributes.template;this.element=i2(t.container),this.id&&this.element.setAttribute("id",this.id)},f2.prototype.renderCustomContent=function(){var t;(void 0===this.prevCustomContentKey||this.prevCustomContentKey!==this.attributes.contentKey)&&(this.prevCustomContentKey=this.attributes.contentKey,t=this.attributes.content)&&("string"==typeof t?this.element.innerHTML=t:this.element.replaceChildren(t))},f2.prototype.renderHTMLTooltipElement=function(){var r,t=this.attributes,e=t.template,n=t.title,i=t.enterable,a=t.style,t=t.content,o=a2(e.prefixCls),s=this.element;this.element.style.pointerEvents=i?"auto":"none",t?this.renderCustomContent():(n?(s.innerHTML=e.title,s.getElementsByClassName(o.TITLE)[0].innerHTML=n):null!=(t=null==(i=s.getElementsByClassName(o.TITLE))?void 0:i[0])&&t.remove(),e=this.HTMLTooltipItemsElements,(n=document.createElement("ul")).className=o.LIST,n.replaceChildren.apply(n,v([],O(e),!1)),(i=this.element.querySelector(".".concat(o.LIST)))?i.replaceWith(n):s.appendChild(n)),r=s,Object.entries(a).forEach(function(t){var t=O(t,2),e=t[0],n=t[1];v([r],O(r.querySelectorAll(e)),!1).filter(function(t){return t.matches(e)}).forEach(function(t){t&&(t.style.cssText+=Object.entries(n).reduce(function(t,e){return"".concat(t).concat(e.join(":"),";")},""))})})},f2.prototype.getRelativeOffsetFromCursor=function(t){var e=this.attributes,n=e.position,i=e.offset,e=(t||n).split("-"),a={left:[-1,0],right:[1,0],top:[0,-1],bottom:[0,1]},t=this.elementSize,o=t.width,s=t.height,l=[-o/2,-s/2];return e.forEach(function(t){var e=O(l,2),n=e[0],e=e[1],t=O(a[t],2),r=t[0],t=t[1];l=[n+(o/2+i[0])*r,e+(s/2+i[1])*t]}),l},f2.prototype.setOffsetPosition=function(t){var t=O(t,2),e=t[0],t=t[1],n=this.attributes,r=n.x,i=n.y,i=void 0===i?0:i,n=n.container,a=n.x,n=n.y;this.element.style.left="".concat(+(void 0===r?0:r)+a+e,"px"),this.element.style.top="".concat(+i+n+t,"px")},f2.prototype.updatePosition=function(){this.setOffsetPosition(this.autoPosition(this.getRelativeOffsetFromCursor()))},f2.prototype.autoPosition=function(t){var e,n,r,i,a,o,s,t=O(t,2),l=t[0],t=t[1],c=this.attributes,u=c.x,f=c.y,h=c.bounding,c=c.position;return h?(e=(n=this.element).offsetWidth,n=n.offsetHeight,f=(u=O([+u+l,+f+t],2))[0],u=u[1],r={left:"right",right:"left",top:"bottom",bottom:"top"},s=h.x,i=h.y,a={left:f<s,right:s+h.width<f+e,top:u<i,bottom:i+h.height<u+n},o=[],c.split("-").forEach(function(t){o.push(a[t]?r[t]:t)}),s=o.join("-"),this.getRelativeOffsetFromCursor(s)):[l,t]},f2.tag="tooltip",t([(void 0===(l2=100)&&(l2=0),void 0===(c2=!0)&&(c2=!1),function(t,e,n){var r,i=n.value;"function"==typeof i&&(n.value=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];r||(t=this,c2&&i.apply(t,e),r=window.setTimeout(function(){i.apply(t,e),r=null},l2))})})],f2.prototype,"updatePosition",null);var s2,l2,c2,u2=f2;function f2(t){var e=this,n=null==(n=null==(n=t.style)?void 0:n.template)?void 0:n.prefixCls,r=a2(n);return(e=s2.call(this,t,{data:[],x:0,y:0,visibility:"visible",title:"",position:"bottom-right",offset:[5,5],enterable:!1,container:{x:0,y:0},bounding:null,template:{prefixCls:"",container:'<div class="'.concat(r.CONTAINER,'"></div>'),title:'<div class="'.concat(r.TITLE,'"></div>'),item:'<li class="'.concat(r.LIST_ITEM,'" data-index={index}>\n <span class="').concat(r.NAME,'">\n <span class="').concat(r.MARKER,'" style="background:{color}"></span>\n <span class="').concat(r.NAME_LABEL,'" title="{name}">{name}</span>\n </span>\n <span class="').concat(r.VALUE,'" title="{value}">{value}</span>\n </li>')},style:(t=a2(t=void 0===(t=n)?"":t),(r={})[".".concat(t.CONTAINER)]={position:"absolute",visibility:"visible","z-index":8,transition:"visibility 0.2s cubic-bezier(0.23, 1, 0.32, 1), left 0.4s cubic-bezier(0.23, 1, 0.32, 1), top 0.4s cubic-bezier(0.23, 1, 0.32, 1)","background-color":"rgba(255, 255, 255, 0.96)","box-shadow":"0 6px 12px 0 rgba(0, 0, 0, 0.12)","border-radius":"4px",color:"rgba(0, 0, 0, 0.65)","font-size":"12px","line-height":"20px",padding:"12px","min-width":"120px","max-width":"360px","font-family":"Roboto-Regular"},r[".".concat(t.TITLE)]={color:"rgba(0, 0, 0, 0.45)"},r[".".concat(t.LIST)]={margin:"0px","list-style-type":"none",padding:"0px"},r[".".concat(t.LIST_ITEM)]={"list-style-type":"none",display:"flex","line-height":"2em","align-items":"center","justify-content":"space-between","white-space":"nowrap"},r[".".concat(t.MARKER)]={width:"8px",height:"8px","border-radius":"50%",display:"inline-block","margin-right":"4px"},r[".".concat(t.NAME)]={display:"flex","align-items":"center","max-width":"216px"},r[".".concat(t.NAME_LABEL)]=y({flex:1},o2),r[".".concat(t.VALUE)]=y({display:"inline-block",float:"right",flex:1,"text-align":"right","min-width":"28px","margin-left":"30px",color:"rgba(0, 0, 0, 0.85)"},o2),r[".".concat(t.CROSSHAIR_X)]={position:"absolute",width:"1px","background-color":"rgba(0, 0, 0, 0.25)"},r[".".concat(t.CROSSHAIR_Y)]={position:"absolute",height:"1px","background-color":"rgba(0, 0, 0, 0.25)"},r)})||this).prevCustomContentKey=e.attributes.contentKey,e.initShape(),e.render(e.attributes,e),e}ce(d2,h2=nt.Group),Object.defineProperty(d2.prototype,"margin",{get:function(){return this.$margin},set:function(t){this.$margin=ty(t)},enumerable:!1,configurable:!0}),Object.defineProperty(d2.prototype,"padding",{get:function(){return this.$padding},set:function(t){this.$padding=ty(t)},enumerable:!1,configurable:!0}),d2.prototype.getBBox=function(){var t=this.attributes,e=t.x,e=void 0===e?0:e,n=t.y,n=void 0===n?0:n,r=t.width,t=t.height,i=O(this.$margin,4),a=i[0],o=i[1],s=i[2],i=i[3];return new gm(e-i,n-a,r+i+o,t+a+s)},d2.prototype.appendChild=function(t,e){return t.isMutationObserved=!0,h2.prototype.appendChild.call(this,t,e),t},d2.prototype.getAvailableSpace=function(){var t=this.attributes,e=t.width,t=t.height,n=O(this.$padding,4),r=n[0],i=n[1],a=n[2],n=n[3],o=O(this.$margin,4),s=o[0],o=o[3];return new gm(n+o,r+s,e-n-i,t-r-a)},d2.prototype.layout=function(){var t,e,n,r;if(this.attributes.display&&this.isConnected&&!this.children.some(function(t){return!t.isConnected}))try{t=this.getAvailableSpace(),e=this.children.map(function(t){return t.getBBox()}),n=this.attributes;var i=0!==e.length&&(null==(r=n.display in(r={flex:Rm,grid:Im})?r[n.display]:null)?void 0:r.call(null,t,e,n))||[];this.children.forEach(function(t,e){var e=i[e],n=e.x,e=e.y;t.attr({x:n,y:e})})}catch(t){}},d2.prototype.bindEvents=function(){var e=this;this.layoutEvents.forEach(function(t){e.addEventListener(t,function(t){t.target.isMutationObserved=!0,e.layout()})})},d2.prototype.attributeChangedCallback=function(t,e,n){"margin"===t?this.margin=n:"padding"===t&&(this.padding=n),this.layout()};var h2,mo=d2;function d2(t){var e=h2.call(this,t)||this,t=(e.layoutEvents=[nt.ElementEvent.BOUNDS_CHANGED,nt.ElementEvent.INSERTED,nt.ElementEvent.REMOVED],e.$margin=ty(0),e.$padding=ty(0),t.style||{}),n=t.margin,t=t.padding,t=void 0===t?0:t;return e.margin=void 0===n?0:n,e.padding=t,e.isMutationObserved=!0,e.bindEvents(),e}function p2(r,t,e,n){var[[t,i],[a,o]]=t,[s,l]=function(t){var{min:[t,e],max:[n,r]}=t.getLocalBounds();let i=0,a=0;return 0<t&&(i=t),n<0&&(i=n),0<e&&(a=e),r<0&&(a=r),[i,a]}(r);if(t===a&&i===o)return Z1()([[0,0],[s,l]]);s=[[t-a,i-o]].concat(e.length?e:[0,0]);const c=[n[0]-a,n[1]-o],[u,f]=s;return l=c,t=u,i=f,e=B0(l,t),t=B0(t,i),i=B0(i,l),0<(Math.pow(e,2)+Math.pow(t,2)-Math.pow(i,2))/(2*e*t)&&(a=(()=>{var{min:t,max:e}=r.getLocalBounds(),n=u[0]+(u[1]-c[1])*+u[1]/(u[0]-c[0]);return e[0]<c[0]?Math.min(e[0],n):Math.max(t[0],n)})(),s.splice(1,1,[a,0])),Z1()(s)}const g2=Eg(t=>{var e=t.attributes,{labelTransform:n,labelTransformOrigin:r,x:i,y:a,x0:o=i,y0:s=a,background:l,connector:c,startMarker:u,endMarker:f,coordCenter:h}=e,e=rt(e,["class","transform","rotate","labelTransform","labelTransformOrigin","x","y","x0","y0","background","connector","startMarker","endMarker","coordCenter"]),d=at(e,"background"),p=d["padding"],d=rt(d,["padding"]),g=at(e,"connector"),{points:m=[]}=g,g=rt(g,["points"]),o=[[+o,+s],[+i,+a]],s=ot(t).maybeAppend("text","text").style("zIndex",0).call(j,Object.assign({textBaseline:"middle",transform:n,transformOrigin:r},e)).node(),i=p2(ot(t).maybeAppend("background","rect").style("zIndex",-1).call(j,function(t,e=[]){var[e=0,n=0,r=e,i=n]=e,a=t.parentNode,o=a.getEulerAngles(),{min:t,halfExtents:s}=(a.setEulerAngles(0),t.getLocalBounds()),[t,l]=t,[s,c]=s;return a.setEulerAngles(o),{x:t-i,y:l-e,width:2*s+i+n,height:2*c+e+r}}(s,p)).call(j,l?d:{}).node(),o,m,h),a=u&&new py({id:"startMarker",style:Object.assign({x:0,y:0},at(e,"startMarker"))}),n=f&&new py({id:"endMarker",style:Object.assign({x:0,y:0},at(e,"endMarker"))});ot(t).maybeAppend("connector","path").style("zIndex",0).style("path",i).style("markerStart",a).style("markerEnd",n).call(j,c?g:{})}),m2=t=>{const l=rt(t,[]);return(t,e,n,r)=>{var{mark:i,shape:a,defaultShape:o}=e,r=rt($0(r,i,a,o),[]),{color:i,text:a="",fontSize:o,rotate:e=0,transform:s=""}=e,a={text:String(a),stroke:i,fill:i,fontSize:o},[[i,o]]=t;return ot(new g2).style("x",i).style("y",o).call(j,r).style("transform",s+`rotate(${+e})`).style("coordCenter",n.getCenter()).call(j,a).call(j,l).node()}};m2.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const y2=Eg(t=>{var e=rt(t.attributes,["class","x","y"]);const n=at(e,"marker"),{size:s=24}=n,r=()=>{var t=s/2,e=t/Math.sqrt(2),n=t*Math.sqrt(2),[r,i]=[-e,e-n],[a,o]=[0,0],[e,n]=[e,e-n];return[["M",r,i],["A",t,t,0,1,1,e,n],["L",a,o],["Z"]]};var[i,a]=function(t){var{min:t,max:e}=t.getLocalBounds();return[.5*(t[0]+e[0]),.5*(t[1]+e[1])]}(ot(t).maybeAppend("marker",()=>new py({})).call(t=>t.node().update(Object.assign({symbol:r},n))).node());ot(t).maybeAppend("text","text").style("x",i).style("y",a).call(j,e)}),v2=t=>{const s=rt(t,[]);return(t,e,n,r)=>{var{mark:i,shape:a,defaultShape:o}=e,r=$0(r,i,a,o),i=r["defaultColor"],a=rt(r,["defaultColor"]),{color:o,text:r=""}=e,e={text:String(r),stroke:o||i,fill:o||i},[[r,o]]=t;return ot(new y2).call(j,a).style("x",r).style("y",o).call(j,e).call(j,s).node()}},b2=(v2.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},Eg(t=>{var{areaPath:e,connectPath:n,areaStyle:r,connectStyle:i}=t.attributes;ot(t).maybeAppend("connect-path",()=>new nt.Path({})).style("d",n).call(j,i),ot(t).maybeAppend("area-path",()=>new nt.Path({})).style("d",e).call(j,r)}));const x2=t=>{const{curve:u,gradient:l=!1,defined:f=t=>!Number.isNaN(t)&&null!=t,connect:h=!1}=t,d=rt(t,["curve","gradient","defined","connect"]);return(t,e,c,n)=>{var{mark:r,shape:i,defaultShape:a}=e,n=$0(n,r,i,a),r=n["defaultColor"],i=rt(n,["defaultColor"]),{color:a=r,seriesColor:n,seriesX:r,seriesY:o}=e,e=K0(c,e),n=l&&n?H0(n,r,o,l):a;const s=Object.assign(Object.assign(Object.assign(Object.assign({},i),{stroke:n,fill:n}),e&&{transform:e}),d);var[r,o]=function(e,n){var r=[],i=[],a=[];let o=!1,s=null;var l=e.length/2;for(let t=0;t<l;t++){var c,u,f=e[t],h=e[t+l];[...f,...h].some(t=>!n(t))?o=!0:(r.push(f),i.push(h),o&&s&&(o=!1,[c,u]=s,a.push([c,f,u,h])),s=[f,h])}return[r.concat(i),a]}(t,f),a=at(s,"connect"),i=!!o.length,n=t=>ot(new nt.Path({})).style("d",t).call(j,s).node();return Kc(c)?(e=t=>{const n=c.getCenter(),r=t.slice(0,t.length/2),i=t.slice(t.length/2);return t=Q1().curve(J1),e=t.curve,a=t.lineX0,o=t.lineX1,s=t.lineY0,l=t.lineY1,t.angle=t.x,delete t.x,t.startAngle=t.x0,delete t.x0,t.endAngle=t.x1,delete t.x1,t.radius=t.y,delete t.y,t.innerRadius=t.y0,delete t.y0,t.outerRadius=t.y1,delete t.y1,t.lineStartAngle=function(){return ng(a())},delete t.lineX0,t.lineEndAngle=function(){return ng(o())},delete t.lineX1,t.lineInnerRadius=function(){return ng(s())},delete t.lineY0,t.lineOuterRadius=function(){return ng(l())},delete t.lineY1,t.curve=function(t){return arguments.length?e(eg(t)):e()._curve},t.angle((t,e)=>D0(R0(r[e],n))).outerRadius((t,e)=>B0(r[e],n)).innerRadius((t,e)=>B0(i[e],n)).defined((t,e)=>[...r[e],...i[e]].every(f)).curve(u)(i);var e,a,o,s,l},!i||h&&!Object.keys(a).length?n(e(r)):i&&!h?n(e(t)):ot(new b2).style("areaStyle",s).style("connectStyle",Object.assign(Object.assign({},a),d)).style("areaPath",e(t)).style("connectPath",o.map(e).join("")).node()):(e=t=>{const n=t.slice(0,t.length/2),r=t.slice(t.length/2);return(Uc(c)?Q1().y((t,e)=>n[e][1]).x1((t,e)=>n[e][0]).x0((t,e)=>r[e][0]).defined((t,e)=>[...n[e],...r[e]].every(f)):Q1().x((t,e)=>n[e][0]).y1((t,e)=>n[e][1]).y0((t,e)=>r[e][1]).defined((t,e)=>[...n[e],...r[e]].every(f))).curve(u)(n)},!i||h&&!Object.keys(a).length?n(e(r)):i&&!h?n(e(t)):ot(new b2).style("areaStyle",s).style("connectStyle",Object.assign(Object.assign({},a),d)).style("areaPath",e(t)).style("connectPath",o.map(e).join("")).node())}},w2=(x2.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},a=>(t,e,n,r)=>{var i=Kc(n)?dg:U1;return x2(Object.assign({curve:i},a))(t,e,n,r)}),M2=(w2.props=Object.assign(Object.assign({},x2.props),{defaultMarker:"square"}),t=>{const{alpha:a=.5}=t,o=rt(t,["alpha"]);return(t,e,n,r)=>{var i=Kc(n)?fg:cg;return x2(Object.assign({curve:i.alpha(a)},o))(t,e,n,r)}}),O2=(M2.props=Object.assign(Object.assign({},x2.props),{defaultMarker:"smooth"}),i=>(t,e,n,r)=>x2(Object.assign({curve:gg},i))(t,e,n,r)),k2=(O2.props=Object.assign(Object.assign({},x2.props),{defaultMarker:"hvh"}),i=>(t,e,n,r)=>x2(Object.assign({curve:mg},i))(t,e,n,r)),_2=(k2.props=Object.assign(Object.assign({},x2.props),{defaultMarker:"vh"}),i=>(t,e,n,r)=>x2(Object.assign({curve:yg},i))(t,e,n,r)),E2=(_2.props=Object.assign(Object.assign({},x2.props),{defaultMarker:"hv"}),i=>{const{arrow:a=!1}=i;return(t,e,n,r)=>nm(Object.assign(Object.assign({},i),{arrow:a}))(t,e,n,r)}),S2=(E2.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},t=>{const s=rt(t,[]);return(t,e,n,r)=>{var{mark:i,shape:a,defaultShape:o}=e,r=$0(r,i,a,o),i=r["defaultColor"],a=rt(r,["defaultColor"]),{color:o=i,transform:r}=e,[e,i]=t,t=B1();return t.moveTo(e[0],e[1]),t.bezierCurveTo(e[0]/2+i[0]/2,e[1],e[0]/2+i[0]/2,i[1],i[0],i[1]),ot(new nt.Path).call(j,a).style("d",t.toString()).style("stroke",o).style("transform",r).call(j,s).node()}});S2.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const A2=t=>{const{cornerRatio:u=1/3}=t,f=rt(t,["cornerRatio"]);return(t,e,n,r)=>{var i,a,{mark:o,shape:s,defaultShape:l}=e,r=$0(r,o,s,l),o=r["defaultColor"],s=rt(r,["defaultColor"]),{color:l=o,transform:r}=e,[e,o]=t,c=(t=e,e=o,o=n,n=u,a=B1(),Kc(o)?(i=B0(t,c=o.getCenter()),i=(B0(e,c)-i)*n+i,a.moveTo(t[0],t[1]),q0(a,t,e,c,i)):Uc(o)?(a.moveTo(t[0],t[1]),a.lineTo(t[0]+(e[0]-t[0])*n,t[1]),a.lineTo(t[0]+(e[0]-t[0])*n,e[1])):(a.moveTo(t[0],t[1]),a.lineTo(t[0],t[1]+(e[1]-t[1])*n),a.lineTo(e[0],t[1]+(e[1]-t[1])*n)),a.lineTo(e[0],e[1]),a);return ot(new nt.Path).call(j,s).style("d",c.toString()).style("stroke",l).style("transform",r).call(j,f).node()}},L2=(A2.props={defaultMarker:"vhv",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},t=>{const s=rt(t,[]);return(t,e,n,r)=>{var{mark:i,shape:a,defaultShape:o}=e,r=$0(r,i,a,o),i=r["defaultColor"],a=rt(r,["defaultColor"]),{color:o=i,transform:r}=e,[e,i]=t,t=B1();return t.moveTo(e[0],e[1]),Kc(n)?(n=n.getCenter(),t.quadraticCurveTo(n[0],n[1],i[0],i[1])):q0(t,e,i,G0(e,i),B0(e,i)/2),ot(new nt.Path).call(j,a).style("d",t.toString()).style("stroke",o).style("transform",r).call(j,s).node()}}),T2=(L2.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},t=>{const u=rt(t,[]);return(t,e,n,r)=>{var{mark:i,shape:a,defaultShape:o}=e,r=$0(r,i,a,o),i=r["defaultColor"],a=rt(r,["defaultColor"]),{color:o=i,src:r="",size:e=32,transform:i=""}=e,{width:s=e,height:e=e}=u,[[t,l]]=t,[n,c]=n.getSize(),s="string"==typeof s?Zl(s)*n:s,e="string"==typeof e?Zl(e)*c:e,n=t-Number(s)/2,c=l-Number(e)/2;return ot(new nt.Image).call(j,a).style("x",n).style("y",c).style("img",r).style("stroke",o).style("transform",i).call(j,u).style("width",s).style("height",e).node()}});T2.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const j2=t=>{const l=rt(t,[]);return(t,e,n,r)=>{var{mark:e,shape:i,defaultShape:a,color:o,transform:s}=e,r=$0(r,e,i,a),e=r["defaultColor"],i=rt(r,["defaultColor"]),a=function(i,t){const a=B1();if(Kc(t)){const o=t.getCenter();t=[...i,i[0]];const s=t.map(t=>B0(t,o));return t.forEach((t,e)=>{var n,r;0===e?a.moveTo(t[0],t[1]):(n=s[e],r=i[e-1],void 0!==(e=s[e-1])&&Math.abs(n-e)<1e-10?q0(a,r,t,o,n):a.lineTo(t[0],t[1]))}),a.closePath(),a}return n=a,i.forEach((t,e)=>0===e?n.moveTo(t[0],t[1]):n.lineTo(t[0],t[1])),n.closePath(),n;var n}(t,n);return ot(new nt.Path).call(j,i).style("d",a.toString()).style("stroke",o||e).style("fill",o||e).style("transform",s).call(j,l).node()}};j2.props={defaultMarker:"square",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const N2=t=>{const l=rt(t,[]);return(t,e,n,r)=>{var{mark:e,shape:i,defaultShape:a,color:o,transform:s}=e,r=$0(r,e,i,a),e=r["defaultColor"],i=rt(r,["defaultColor"]),a=function(t,e){var n,[t,r,i,a]=t,o=B1();return Kc(e)?(n=B0(e=e.getCenter(),t),o.moveTo(t[0],t[1]),o.quadraticCurveTo(e[0],e[1],i[0],i[1]),q0(o,i,a,e,n),o.quadraticCurveTo(e[0],e[1],r[0],r[1]),q0(o,r,t,e,n),o.closePath()):(o.moveTo(t[0],t[1]),o.bezierCurveTo(t[0]/2+i[0]/2,t[1],t[0]/2+i[0]/2,i[1],i[0],i[1]),o.lineTo(a[0],a[1]),o.bezierCurveTo(a[0]/2+r[0]/2,a[1],a[0]/2+r[0]/2,r[1],r[0],r[1]),o.lineTo(t[0],t[1]),o.closePath()),o}(t,n);return ot(new nt.Path).call(j,i).style("d",a.toString()).style("fill",o||e).style("stroke",o||e).style("transform",s).call(j,l).node()}};N2.props={defaultMarker:"square",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const P2=t=>{const m=rt(t,[]);return(t,e,n,r)=>{var i,a,o,s,l,c,u,{mark:e,shape:f,defaultShape:h,color:d,transform:p}=e,r=$0(r,e,f,h),{defaultColor:e,fill:f=e,stroke:h=e}=r,e=rt(r,["defaultColor","fill","stroke"]),g=(r=t,t=n,n=B1(),Kc(t)?([i,a]=t=t.getCenter(),o=F0(R0(r[0],t)),s=F0(R0(r[1],t)),g=B0(t,r[2]),l=B0(t,r[3]),c=B0(t,r[8]),u=B0(t,r[10]),t=B0(t,r[11]),n.moveTo(...r[0]),n.arc(i,a,g,o,s),n.arc(i,a,g,s,o,!0),n.moveTo(...r[2]),n.lineTo(...r[3]),n.moveTo(...r[4]),n.arc(i,a,l,o,s),n.lineTo(...r[6]),n.arc(i,a,u,s,o,!0),n.closePath(),n.moveTo(...r[8]),n.arc(i,a,c,o,s),n.arc(i,a,c,s,o,!0),n.moveTo(...r[10]),n.lineTo(...r[11]),n.moveTo(...r[12]),n.arc(i,a,t,o,s),n.arc(i,a,t,s,o,!0)):(n.moveTo(...r[0]),n.lineTo(...r[1]),n.moveTo(...r[2]),n.lineTo(...r[3]),n.moveTo(...r[4]),n.lineTo(...r[5]),n.lineTo(...r[6]),n.lineTo(...r[7]),n.closePath(),n.moveTo(...r[8]),n.lineTo(...r[9]),n.moveTo(...r[10]),n.lineTo(...r[11]),n.moveTo(...r[12]),n.lineTo(...r[13])),n);return ot(new nt.Path).call(j,e).style("d",g.toString()).style("stroke",h).style("fill",d||f).style("transform",p).call(j,m).node()}};P2.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const C2=t=>{const m=rt(t,[]);return(t,e,n,r)=>{var i,a,o,s,l,c,u,{mark:e,shape:f,defaultShape:h,color:d,transform:p}=e,r=$0(r,e,f,h),{defaultColor:e,fill:f=e,stroke:h=e}=r,e=rt(r,["defaultColor","fill","stroke"]),g=(r=t,t=n,n=4,u=B1(),Kc(t)?([i,a]=t=t.getCenter(),o=B0(t,r[3]),s=B0(t,r[8]),g=B0(t,r[10]),l=(t=F0(R0(r[2],t)))-(c=Math.asin(n/s)),t+=c,u.moveTo(...r[2]),u.lineTo(...r[3]),u.moveTo(Math.cos(l)*o+i,Math.sin(l)*o+a),u.arc(i,a,o,l,t),u.lineTo(Math.cos(t)*g+i,Math.sin(t)*g+a),u.arc(i,a,g,t,l,!0),u.lineTo(Math.cos(l)*o+i,Math.sin(l)*o+a),u.closePath(),u.moveTo(...r[10]),u.lineTo(...r[11]),c=(l+t)/2,u.moveTo(Math.cos(c)*(s+n/2)+i,Math.sin(c)*(s+n/2)+a),u.arc(Math.cos(c)*s+i,Math.sin(c)*s+a,n/2,c,2*Math.PI+c)):(u.moveTo(...r[2]),u.lineTo(...r[3]),u.lineTo(r[3][0]-n,r[3][1]),u.lineTo(r[10][0]-n,r[10][1]),u.lineTo(r[10][0]+n,r[10][1]),u.lineTo(r[3][0]+n,r[3][1]),u.lineTo(...r[3]),u.closePath(),u.moveTo(...r[10]),u.lineTo(...r[11]),u.moveTo(r[3][0]+n/2,r[8][1]),u.arc(r[3][0],r[8][1],n/2,0,2*Math.PI)),u.closePath(),u);return ot(new nt.Path).call(j,e).style("d",g.toString()).style("stroke",h).style("fill",d||f).style("transform",p).call(j,m).node()}};C2.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const R2=t=>{const{arrow:c,arrowSize:u=4}=t,f=rt(t,["arrow","arrowSize"]);return(t,e,n,r)=>{var i,a,{mark:o,shape:s,defaultShape:l}=e,r=$0(r,o,s,l),{defaultColor:o,lineWidth:s}=r,l=rt(r,["defaultColor","lineWidth"]),{color:r=o,size:o=s}=e,s=c?(s=u,i=Object.assign({fill:f.stroke||r,stroke:f.stroke||r},at(f,"arrow")),new nt.Path({style:Object.assign({path:`M ${s},${s} L -${s},0 L ${s},-${s} L 0,0 Z`,anchor:"0.5 0.5",transformOrigin:"center"},i)})):null,t=(i=t,Kc(t=n)?(t=t.getCenter(),V1()({startAngle:0,endAngle:2*Math.PI,outerRadius:B0(i[0],t),innerRadius:B0(i[1],t)})):Z1().x(t=>t[0]).y(t=>t[1])(i)),n=(n=n,e=e.transform,Kc(n)?([n,a]=n.getCenter(),`translate(${n}, ${a}) `+(e||"")):e);return ot(new nt.Path({})).call(j,l).style("d",t).style("stroke",r).style("lineWidth",o).style("transform",n).style("markerEnd",s).call(j,f).node()}};function I2(t,e,n){return[["M",t,e],["L",t+2*n,e-n],["L",t+2*n,e+n],["Z"]]}R2.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const B2=Eg(t=>{var e=t.attributes,{points:n,endMarker:r=!0}=e,e=rt(e,["points","class","endMarker","direction"]),i=at(e,"endMarker"),n=(n=n,Z1().x(t=>t[0]).y(t=>t[1])(n));ot(t).maybeAppend("connector","path").style("path",n).style("markerEnd",r?new py({className:"marker",style:Object.assign(Object.assign({},i),{symbol:I2})}):null).call(j,e)});const F2=t=>{const{offset:s=0,connectLength1:l}=t,c=rt(t,["offset","connectLength1"]);return(t,e,n,r)=>{var{mark:i,shape:a,defaultShape:o}=e,r=$0(r,i,a,o),{defaultColor:i,connectLength1:a=l}=r,o=rt(r,["defaultColor","connectLength1"]),{color:r,transform:e}=e,n=function(t,e,n,r=0){var[[e,i],[a,o]]=e;if(Uc(t)){const l=n;var t=e+l,s=t+r;return[[t,i],[s,i],[s,o],[a+l,o]]}const l=-n;return t=i+l,[[e,t],[e,s=t+-r],[a,s],[a,o+l]]}(n,t,s,a);return ot(new B2).call(j,o).style("points",n).style("stroke",r||i).style("transform",e).call(j,c).node()}};function D2(t){return t.replace(/-(\w)/g,function(t,e){return e.toUpperCase()})}function z2(t,e,a,n){var r=a["bounds"];const[[o,s],[i,l]]=r,c=i-o,u=l-s;r=t=>{var{x:e,y:n}=t,r=Yu(a.x,c),i=Yu(a.y,u);return Object.assign(Object.assign({},t),{x:(r||e)+o,y:(i||n)+s})};return r("left"===t?{x:0,y:u/2,textAnchor:"start",textBaseline:"middle"}:"right"===t?{x:c,y:u/2,textAnchor:"end",textBaseline:"middle"}:"top"===t?{x:c/2,y:0,textAnchor:"center",textBaseline:"top"}:"bottom"===t?{x:c/2,y:u,textAnchor:"center",textBaseline:"bottom"}:"top-left"===t?{x:0,y:0,textAnchor:"start",textBaseline:"top"}:"top-right"===t?{x:c,y:0,textAnchor:"end",textBaseline:"top"}:"bottom-left"===t?{x:0,y:u,textAnchor:"start",textBaseline:"bottom"}:"bottom-right"===t?{x:c,y:u,textAnchor:"end",textBaseline:"bottom"}:{x:c/2,y:u/2,textAnchor:"center",textBaseline:"middle"})}function W2(r,i,t,e){var{y:t,y1:n,autoRotate:a,rotateToAlignArc:o}=t;const s=e.getCenter(),{innerRadius:l,outerRadius:c,startAngle:u,endAngle:f}=Y0(e,i,[t,n]),h="inside"===r?(u+f)/2:f;e=q2(h,a,o),t=(()=>{var[t,e]=i,n=l+.5*(c-l),[n,t]="inside"===r?G2(s,h,n):G0(t,e);return{x:n,y:t}})();return Object.assign(Object.assign({},t),{textAlign:"inside"===r?"center":"start",textBaseline:"middle",rotate:e})}function G2(t,e,n){return[t[0]+Math.sin(e)*n,t[1]-Math.cos(e)*n]}function q2(t,e,n){return e?(e=n?0:Math.sin(t)<0?90:-90,t/Math.PI*180+e):0}function H2(t,e,n,r){var{y:n,y1:i,autoRotate:a,rotateToAlignArc:o,radius:s=.5,offset:l=0}=n,e=Y0(r,e,[n,i]),{startAngle:n,endAngle:i}=e,r=r.getCenter(),n=(n+i)/2,i={textAlign:"center",textBaseline:"middle",rotate:q2(n,a,o)},{innerRadius:a,outerRadius:o}=e,[e,r]=G2(r,n,a+(o-a)*s+l);return Object.assign({x:e,y:r},i)}function V2(t,e,n){var n=n["bounds"],[n]=n;return{x:n[0],y:n[1]}}function Y2(t,e,n,r){var i=n["bounds"];return 1===i.length?V2(0,0,n):(Xc(r)?W2:tu(r)?H2:z2)(t,e,n,r)}function $2(t,e,n){var{innerRadius:n,outerRadius:t}=Y0(n,t,[e.y,e.y1]);return n+(t-n)}function U2(t,e,n){var{startAngle:n,endAngle:t}=Y0(n,t,[e.y,e.y1]);return(n+t)/2}function K2(t,e,n,r){var{autoRotate:i,rotateToAlignArc:a,offset:o=0,connector:s=!0,connectorLength:l=o,connectorLength2:c=0,connectorDistance:u=0}=n,f=r.getCenter(),h=U2(e,n,r),d=0<Math.sin(h)?1:-1,i=q2(h,i,a),a={textAlign:0<d||Xc(r)?"start":"end",textBaseline:"middle",rotate:i},i=$2(e,n,r),[[e,n],[r,f],[h,i]]=function(t,e,n,r,i){var[n,a]=G2(t,e,n),[t,r]=G2(t,e,r);return[[n,a],[t,r],[t+(0<Math.sin(e)?1:-1)*i,r]]}(f,h,i,i+(s?l:o),s?c:0),l=s?+u*d:0,o=h+l,c={connector:s,connectorPoints:[[r-o,f-i],[h-o,i-i]]};return Object.assign(Object.assign({x0:e,y0:n,x:h+l,y:i},a),c)}F2.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};var X2=Object.freeze({__proto__:null,area:function(t,e,n,r){var i=e.length/2;const a=e.slice(0,i),o=e.slice(i);var e=Ic(a,(t,e)=>Math.abs(t[1]-o[e][1])),i=(l=t=>[a[t][0],(a[t][1]+o[t][1])/2])(e=Math.max(Math.min(e,i-2),1)),s=l(e-1),l=F0(R0(l(e+1),s))/Math.PI*180;return{x:i[0],y:i[1],transform:`rotate(${l})`,textAlign:"center",textBaseline:"middle"}},bottom:Y2,bottomLeft:Y2,bottomRight:Y2,inside:Y2,left:Y2,outside:function(t,e,n,r){var i=n["bounds"];return 1===i.length?V2(0,0,n):(Xc(r)?W2:tu(r)?K2:z2)(t,e,n,r)},right:Y2,spider:function(t,e,n,r){var i,a,o,s,l,c;return tu(r)?({connectorLength:c,connectorLength2:i,connectorDistance:a}=n,o=rt(K2(0,e,n,r),[]),s=r.getCenter(),l=$2(e,n,r),e=U2(e,n,r),n=l+c+i,r=0<Math.sin(e)?1:-1,l=o["x"],c=s[0]+(n+ +a)*r-l,o.x+=c,o.connectorPoints[0][0]-=c,o):{}},surround:function(t,e,n,r){var i,a,o,s,l;return tu(r)?({connectorLength:o,connectorLength2:i,connectorDistance:a}=n,{x0:n,y0:s}=e=rt(K2(0,e,n,r),[]),l=r.getCenter(),r=function(t){if(tu(t)){var[e,n]=t.getSize(),t=t.getOptions().transformations.find(t=>"polar"===t[0]);if(t)return Math.max(e,n)/2*t[4]}return 0}(r)+o,o=D0([n-l[0],s-l[1]]),n=0<Math.sin(o)?1:-1,[s,l]=G2(l,o,r),e.x=s+(i+a)*n,e.y=l,e):{}},top:Y2,topLeft:Y2,topRight:Y2});function Z2(t,e,n,r,i){var a=e["position"],a=(o=n,void 0!==(a=a)?a:tu(o)?"inside":Uc(o)?"right":"top"),o=r["inside"===a?"innerLabel":"label"],r=Object.assign({},o,e),e=X2[D2(a)];if(e)return Object.assign(Object.assign({},o),e(a,t,r,n,i));throw new Error("Unknown position: "+a)}const Q2=l=>(t,e,n,r)=>{var{text:i,transform:a="",transformOrigin:o}=e,s=rt(e,["text","x","y","transform","transformOrigin"]),t=Z2(t,e,n,r,l),{rotate:e=0,transform:r=""}=t,t=rt(t,["rotate","transform"]);return ot(new g2).call(j,t).style("text",""+i).style("labelTransform",(r+` rotate(${+e}) `+a).trim()).style("labelTransformOrigin",o).style("coordCenter",n.getCenter()).call(j,s).node()},J2=(Q2.props={defaultMarker:"point"},t=>{const s=t["colorAttribute"],l=rt(t,["arrow","colorAttribute"]);return(t,e,n,r)=>{var{mark:i,shape:a,defaultShape:o}=e,r=rt($0(r,i,a,o),["stroke"]),{d:i,color:a}=e,[o,e]=n.getSize();return ot(new nt.Path).call(j,r).style("d","function"==typeof i?i({width:o,height:e}):i).style(s,a).call(j,l).node()}}),tx=(J2.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},t=>J2(Object.assign({colorAttribute:"fill"},t))),ex=(tx.props={defaultMarker:"hvh",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},t=>J2(Object.assign({fill:"none",colorAttribute:"stroke"},t))),nx=(ex.props={defaultMarker:"hvh",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},t=>{const c=rt(t,[]);return(t,e,n,r)=>{var{mark:i,shape:a,defaultShape:o,transform:s}=e,r=$0(r,i,a,o),i=r["defaultColor"],a=rt(r,["defaultColor"]),{color:o=i}=e,[r,...e]=t;const l=B1();return l.moveTo(...r),e.forEach(([t,e])=>{l.lineTo(t,e)}),l.closePath(),ot(new nt.Path).call(j,a).style("d",l.toString()).style("stroke",o||i).style("fill",o||i).style("fillOpacity",.4).style("transform",s).call(j,c).node()}});function rx(t){var n,r,i,a=t||1;function o(t,e){++n>a&&(i=r,s(1),++n),r[t]=e}function s(t){n=0,r=Object.create(null),t||(i=Object.create(null))}return s(),{clear:s,has:function(t){return void 0!==r[t]||void 0!==i[t]},get:function(t){var e=r[t];return void 0!==e?e:void 0!==(e=i[t])?(o(t,e),e):void 0},set:function(t,e){void 0!==r[t]?r[t]=e:o(t,e)}}}function ix(t,e,n){t=t?t():document.createElement("canvas");return t.width=e,t.height=n,t}nx.props={defaultMarker:"square",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},rx(3);const ax=function(n,r,t=16){const i=rx(t);return(...t)=>{var e=r(...t);i.get(e);return i.has(e)?i.get(e):(t=n(...t),i.set(e,t),t)}}((t,e,n)=>{var n=ix(n,2*t,2*t),r=n.getContext("2d"),i=t,a=t;return 1===e?(r.beginPath(),r.arc(i,a,t,0,2*Math.PI,!1),r.fillStyle="rgba(0,0,0,1)",r.fill()):((e=r.createRadialGradient(i,a,t*e,i,a,t)).addColorStop(0,"rgba(0,0,0,1)"),e.addColorStop(1,"rgba(0,0,0,0)"),r.fillStyle=e,r.fillRect(0,0,2*t,2*t)),n},t=>""+t);function ox(t,e,n,r,i,a,o){a=Object.assign({blur:.85,minOpacity:0,opacity:.6,maxOpacity:1,gradient:[[.25,"rgb(0,0,255)"],[.55,"rgb(0,255,0)"],[.85,"yellow"],[1,"rgb(255,0,0)"]]},a);a.minOpacity*=255,a.opacity*=255,a.maxOpacity*=255;var s=ix(o,t,e).getContext("2d"),l=function(t,e){const n=(e=ix(e,256,1).getContext("2d")).createLinearGradient(0,0,256,1);return("string"==typeof(t=t)?t.split(" ").map(t=>{var[t,e]=t.split(":");return[+t,e]}):t).forEach(([t,e])=>{n.addColorStop(t,e)}),e.fillStyle=n,e.fillRect(0,0,256,1),e.getImageData(0,0,256,1).data}(a.gradient,o);s.clearRect(0,0,t,e);{var c=s,u=n,f=r,h=i,d=o,p=(n=a)["blur"];let t=h.length;for(;t--;){var{x:g,y:m,value:y,radius:v}=h[t],y=Math.min(y,f),g=g-v,m=m-v,v=ax(v,1-p,d);c.globalAlpha=Math.max((y-u)/(f-u),.001),c.drawImage(v,g,m)}}r=function(t,e,n,r,i){var{minOpacity:a,opacity:o,maxOpacity:s,useGradientOpacity:l}=i,c=(i=t.getImageData(0,0,e,n)).data,u=c.length;for(let t=3;t<u;t+=4){var f=c[t],h=4*f;h&&(f=o||Math.max(0,Math.min(s,Math.max(a,f))),c[t-3]=r[h],c[t-2]=r[1+h],c[t-1]=r[2+h],c[t]=l?r[3+h]:f)}return i}(s,t,e,l,a),i=ix(o,t,e).getContext("2d");return i.putImageData(r,0,0),i}const sx=t=>{const{gradient:h,opacity:d,maxOpacity:p,minOpacity:g,blur:m,useGradientOpacity:y}=t,v=rt(t,["gradient","opacity","maxOpacity","minOpacity","blur","useGradientOpacity"]);return(t,e,n,r,i,a)=>{var o,s,{mark:e,shape:l,defaultShape:c,transform:u}=e,r=rt($0(r,e,l,c),[]),e=a["createCanvas"],[l,c]=n.getSize(),a=t.map(t=>({x:t[0],y:t[1],value:t[2],radius:t[3]})),n=Bc(t,t=>t[2]),t=Rc(t,t=>t[2]),f={gradient:h,opacity:d,minOpacity:g,maxOpacity:p,blur:m,useGradientOpacity:y},n=l&&c?ox(l,c,n,t,a,(o=f,s=t=>void 0===t,Object.assign({},o),Object.keys(o).reduce((t,e)=>{var n=o[e];return s(n,e)||(t[e]=n),t},{})),e):{canvas:null};return ot(new nt.Image).call(j,r).style("x",0).style("y",0).style("width",l).style("height",c).style("src",n.canvas).style("transform",u).call(j,v).node()}},lx=(sx.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},t=>{const a=t["render"],o=rt(t,["render"]);return(t,e,n,r)=>{var[[t,i]]=t;return a(Object.assign(Object.assign({},o),{x:t,y:i}))}}),u=(lx.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},{BLACK:"#000",WHITE:"#fff",STROKE:"#416180"}),cx=t=>{var e={defaultColor:"#5B8FF9",defaultCategory10:"category10",defaultCategory20:"category20",defaultSize:1,elementActiveStroke:u.BLACK,enter:{duration:300,fill:"both",delay:0},update:{duration:300,fill:"both",delay:0},exit:{duration:300,fill:"both",delay:0},viewFill:"transparent",plotFill:"transparent",mainFill:"transparent",contentFill:"transparent",line:{line:{fill:"",strokeOpacity:1,lineWidth:1}},point:{point:{r:3,fillOpacity:.95,lineWidth:0},hollow:{r:3,strokeOpacity:.95,lineWidth:1},plus:{r:3,strokeOpacity:.95,lineWidth:3},diamond:{r:3,strokeOpacity:.95,lineWidth:1}},interval:{rect:{fillOpacity:.95},hollow:{fill:"",strokeOpacity:1,lineWidth:2}},area:{area:{fillOpacity:.85,lineWidth:0}},polygon:{polygon:{fillOpacity:.95}},cell:{cell:{fillOpacity:.95},hollow:{fill:"",strokeOpacity:1,lineWidth:2}},rect:{rect:{fillOpacity:.95},hollow:{fill:"",strokeOpacity:1,lineWidth:2}},link:{link:{fill:"",strokeOpacity:1}},vector:{vector:{fillOpacity:1}},box:{box:{fillOpacity:.95,stroke:u.BLACK,lineWidth:1}},text:{text:{fill:"#1D2129",fontSize:12,strokeWidth:0,connectorStroke:u.STROKE,connectorStrokeOpacity:.45,connectorLineWidth:1,backgroundFill:u.STROKE,backgroundFillOpacity:.15,backgroundPadding:[2,4],startMarkerSymbol:"circle",startMarkerSize:4,endMarkerSymbol:"circle",endMarkerSize:4},badge:{fill:"#1D2129",fillOpacity:.65,strokeWidth:0,fontSize:10,textAlign:"center",textBaseline:"middle",markerFill:u.STROKE,markerFillOpacity:.25,markerStrokeOpacity:0}},lineX:{line:{stroke:u.STROKE,strokeOpacity:.45,lineWidth:1}},lineY:{line:{stroke:u.STROKE,strokeOpacity:.45,lineWidth:1}},rangeX:{range:{fill:u.STROKE,fillOpacity:.15,lineWidth:0}},rangeY:{range:{fill:u.STROKE,fillOpacity:.15,lineWidth:0}},connector:{connector:{stroke:u.STROKE,strokeOpacity:.45,lineWidth:1,connectLength1:12,endMarker:!0,endMarkerSize:6,endMarkerFill:u.STROKE,endMarkerFillOpacity:.95}},interaction:{active:{line:{line:{lineWidth:3}},interval:{rect:{stroke:u.BLACK}},area:{area:{fillOpacity:.5}}},inactive:{area:{area:{fillOpacity:.3}}},selected:{},disabled:{}},axis:{arrow:!1,gridLineDash:[0,0],gridLineWidth:.5,gridStroke:u.BLACK,gridStrokeOpacity:.05,labelAlign:"horizontal",labelFill:u.BLACK,labelFillOpacity:.65,labelFontSize:12,labelFontWeight:"lighter",labelSpacing:8,line:!1,lineLineWidth:.5,lineStroke:u.BLACK,lineStrokeOpacity:.45,tickLength:4,tickLineWidth:1,tickStroke:u.BLACK,tickStrokeOpacity:.25,titleFill:u.BLACK,titleFillOpacity:.65,titleFontSize:12,titleFontWeight:"normal",titleSpacing:12,titleTransformOrigin:"center"},axisTop:{gridDirection:"positive",labelDirection:"negative",labelSpacing:4,tickDirection:"negative",titlePosition:"top",titleSpacing:0,titleTextBaseline:"middle"},axisBottom:{gridDirection:"negative",labelDirection:"positive",labelSpacing:4,labelAutoRotate:!0,tickDirection:"positive",titlePosition:"bottom",titleSpacing:10,titleTextBaseline:"bottom"},axisLeft:{gridDirection:"negative",labelAutoRotate:!1,labelDirection:"positive",labelSpacing:4,tickDirection:"positive",titlePosition:"left",titleSpacing:10,titleTextBaseline:"middle",titleTransform:"translate(50%, 0) rotate(-90)",titleTransformOrigin:"center"},axisRight:{gridDirection:"positive",labelDirection:"negative",labelSpacing:4,labelAutoRotate:!1,tickDirection:"negative",titlePosition:"right",titleSpacing:0,titleTextBaseline:"top",titleTransform:"translate(-50%, 0) rotate(-90)",titleTransformOrigin:"center"},axisLinear:{girdClosed:!0,gridConnect:"arc",gridDirection:"negative",gridType:"surround",titlePosition:"top",titleSpacing:0},axisRadar:{girdClosed:!0,gridStrokeOpacity:.3,gridType:"surround",label:!1,tick:!1,titlePosition:"start"},legend:{backgroundFill:"transparent",itemBackgroundFill:"transparent",itemLabelFill:u.BLACK,itemLabelFillOpacity:.65,itemLabelFontSize:12,itemLabelFontWeight:"normal",itemMarkerFillOpacity:1,itemMarkerSize:8,itemSpacing:[5,8],itemValueFill:u.BLACK,itemValueFillOpacity:.65,itemValueFontSize:12,itemValueFontWeight:"normal",navButtonFill:u.BLACK,navButtonFillOpacity:.65,navPageNumFill:u.BLACK,navPageNumFillOpacity:.45,navPageNumFontSize:12,padding:8,title:!1,titleFill:u.BLACK,titleFillOpacity:.45,titleFontSize:12,titleFontWeight:"normal",titleSpacing:4},continuousLegend:{handleHeight:12,handleLabelFill:u.BLACK,handleLabelFillOpacity:.45,handleLabelFontSize:12,handleLabelFontWeight:"normal",handleMarkerFill:u.BLACK,handleMarkerFillOpacity:.6,handleMarkerLineWidth:1,handleMarkerStroke:u.BLACK,handleMarkerStrokeOpacity:.25,handleWidth:10,labelFill:u.BLACK,labelFillOpacity:.45,labelFontSize:12,labelFontWeight:"normal",labelSpacing:8,tick:!0},label:{fill:u.BLACK,fillOpacity:.65,fontSize:12,fontWeight:"normal",stroke:void 0,offset:12,connectorStroke:u.BLACK,connectorStrokeOpacity:.45,connectorLineWidth:1,connectorLength:12,connectorLength2:8,connectorDistance:4},innerLabel:{fill:u.WHITE,fontSize:12,fillOpacity:.85,fontWeight:"normal",stroke:void 0,offset:0},slider:{trackSize:16,trackFill:u.STROKE,trackFillOpacity:1,selectionFill:"#5B8FF9",selectionFillOpacity:.15,handleIconSize:10,handleIconFill:"#f7f7f7",handleIconFillOpacity:1,handleIconStroke:u.BLACK,handleIconStrokeOpacity:.25,handleIconLineWidth:1,handleIconRadius:2,handleLabelFill:u.BLACK,handleLabelFillOpacity:.45,handleLabelFontSize:12,handleLabelFontWeight:"normal"},scrollbar:{padding:[2,2,2,2],trackSize:10,isRound:!0,slidable:!0,scrollable:!0,trackFill:"#e5e5e5",trackFillOpacity:0,thumbFill:"#000",thumbFillOpacity:.15,thumbHighlightedFillOpacity:.2},title:{titleFill:u.BLACK,titleFillOpacity:.85,titleFontSize:14,titleFontWeight:"bold",titleTextBaseline:"top",subtitleFill:u.BLACK,subtitleFillOpacity:.65,subtitleFontSize:12,subtitleFontWeight:"normal",subtitleTextBaseline:"top"}};return Object.assign({},e,t)},f=(cx.props={},{BLACK:"#fff",WHITE:"#000",STROKE:"#416180"}),ux=t=>{var e={defaultColor:"#5B8FF9",defaultCategory10:"category10",defaultCategory20:"category20",defaultSize:1,elementActiveStroke:f.BLACK,enter:{duration:300,fill:"both",delay:0},update:{duration:300,fill:"both",delay:0},exit:{duration:300,fill:"both",delay:0},viewFill:"#141414",plotFill:"transparent",mainFill:"transparent",contentFill:"transparent",line:{line:{fill:"",strokeOpacity:1,lineWidth:1}},point:{point:{r:3,fillOpacity:.95,lineWidth:0},hollow:{r:3,strokeOpacity:.95,lineWidth:1},plus:{r:3,strokeOpacity:.95,lineWidth:3},diamond:{r:3,strokeOpacity:.95,lineWidth:1}},interval:{rect:{fillOpacity:.95},hollow:{fill:"",strokeOpacity:1,lineWidth:2}},area:{area:{fillOpacity:.85,lineWidth:0}},polygon:{polygon:{fillOpacity:.95}},cell:{cell:{fillOpacity:.95},hollow:{fill:"",strokeOpacity:1,lineWidth:2}},rect:{rect:{fillOpacity:.95},hollow:{fill:"",strokeOpacity:1,lineWidth:2}},link:{link:{fill:"",strokeOpacity:1}},vector:{vector:{fillOpacity:1}},box:{box:{fillOpacity:.95,stroke:f.BLACK,lineWidth:1}},text:{text:{fill:f.BLACK,fillOpacity:.65,fontSize:12,strokeWidth:0,connectorStroke:f.STROKE,connectorStrokeOpacity:.45,connectorLineWidth:1,backgroundFill:f.STROKE,backgroundFillOpacity:.15,backgroundPadding:[2,4],startMarkerSymbol:"circle",startMarkerSize:4,endMarkerSymbol:"circle",endMarkerSize:4},badge:{fill:"#1D2129",fillOpacity:.65,strokeWidth:0,fontSize:10,textAlign:"center",textBaseline:"middle",markerFill:f.STROKE,markerFillOpacity:.25,markerStrokeOpacity:0}},lineX:{line:{stroke:f.STROKE,strokeOpacity:.45,lineWidth:1}},lineY:{line:{stroke:f.STROKE,strokeOpacity:.45,lineWidth:1}},rangeX:{range:{fill:f.STROKE,fillOpacity:.15,lineWidth:0}},rangeY:{range:{fill:f.STROKE,fillOpacity:.15,lineWidth:0}},connector:{connector:{stroke:f.STROKE,strokeOpacity:.45,lineWidth:1,connectLength1:12,endMarker:!0,endMarkerSize:6,endMarkerFill:f.STROKE,endMarkerFillOpacity:.95}},interaction:{active:{line:{line:{lineWidth:3}},interval:{rect:{stroke:f.BLACK}},area:{area:{fillOpacity:.5}}},inactive:{area:{area:{fillOpacity:.3}}},selected:{},disabled:{}},axis:{arrow:!1,gridLineDash:[0,0],gridLineWidth:.5,gridStroke:f.BLACK,gridStrokeOpacity:.05,labelAlign:"horizontal",labelFill:f.BLACK,labelFillOpacity:.65,labelFontSize:12,labelFontWeight:"lighter",labelSpacing:8,lineLineWidth:.5,lineStroke:f.BLACK,lineStrokeOpacity:.45,tickLength:4,tickLineWidth:1,tickStroke:f.BLACK,tickStrokeOpacity:.25,titleFill:f.BLACK,titleFillOpacity:.65,titleFontSize:12,titleFontWeight:"normal",titleSpacing:12,titleTransformOrigin:"center"},axisTop:{gridDirection:"positive",labelDirection:"negative",labelSpacing:4,tickDirection:"negative",titlePosition:"top",titleSpacing:0,titleTextBaseline:"middle"},axisBottom:{gridDirection:"negative",labelDirection:"positive",labelSpacing:4,tickDirection:"positive",titlePosition:"bottom",titleSpacing:10,titleTextBaseline:"bottom"},axisLeft:{gridDirection:"negative",labelAutoRotate:!1,labelDirection:"positive",labelSpacing:4,tickDirection:"positive",titlePosition:"left",titleSpacing:10,titleTextBaseline:"middle",titleTransform:"translate(50%, 0) rotate(-90)",titleTransformOrigin:"center"},axisRight:{gridDirection:"positive",labelDirection:"negative",labelSpacing:4,tickDirection:"negative",titlePosition:"right",titleSpacing:0,titleTextBaseline:"top",titleTransform:"translate(-50%, 0) rotate(-90)",titleTransformOrigin:"center"},axisLinear:{girdClosed:!0,gridConnect:"arc",gridDirection:"negative",gridType:"surround",titlePosition:"top",titleTextBaseline:"bottom"},axisRadar:{girdClosed:!0,gridStrokeOpacity:.3,gridType:"surround",label:!1,tick:!1,titlePosition:"start"},legend:{backgroundFill:"transparent",itemBackgroundFill:"transparent",itemLabelFill:f.BLACK,itemLabelFillOpacity:.65,itemLabelFontSize:12,itemLabelFontWeight:"normal",itemMarkerFillOpacity:1,itemMarkerSize:8,itemSpacing:[5,8],itemValueFill:f.BLACK,itemValueFillOpacity:.65,itemValueFontSize:12,itemValueFontWeight:"normal",navButtonFill:f.BLACK,navButtonFillOpacity:.45,navPageNumFill:f.BLACK,navPageNumFillOpacity:.45,navPageNumFontSize:12,padding:8,title:!1,titleFill:f.BLACK,titleFillOpacity:.45,titleFontSize:12,titleFontWeight:"normal",titleSpacing:4},continuousLegend:{handleHeight:12,handleLabelFill:f.BLACK,handleLabelFillOpacity:.45,handleLabelFontSize:12,handleLabelFontWeight:"normal",handleMarkerFill:f.BLACK,handleMarkerFillOpacity:.6,handleMarkerLineWidth:1,handleMarkerStroke:f.BLACK,handleMarkerStrokeOpacity:.25,handleWidth:10,labelFill:f.BLACK,labelFillOpacity:.45,labelFontSize:12,labelFontWeight:"normal"},label:{fill:f.BLACK,fillOpacity:.65,fontSize:12,fontWeight:"normal",stroke:void 0,offset:12,connectorStroke:f.BLACK,connectorStrokeOpacity:.45,connectorLineWidth:1,connectorLength:12,connectorLength2:8,connectorDistance:4},innerLabel:{fill:f.WHITE,fontSize:12,fillOpacity:.85,fontWeight:"normal",stroke:void 0,offset:0},slider:{trackSize:16,trackFill:f.STROKE,trackFillOpacity:1,selectionFill:"#5B8FF9",selectionFillOpacity:.15,handleIconSize:10,handleIconFill:"#f7f7f7",handleIconFillOpacity:1,handleIconStroke:f.BLACK,handleIconStrokeOpacity:.25,handleIconLineWidth:1,handleIconRadius:2,handleLabelFill:f.BLACK,handleLabelFillOpacity:.45,handleLabelFontSize:12,handleLabelFontWeight:"normal"},scrollbar:{},title:{titleFill:f.BLACK,titleFillOpacity:.85,titleFontSize:14,titleFontWeight:"bold",titleTextBaseline:"top",subtitleFill:f.BLACK,subtitleFillOpacity:.65,subtitleFontSize:12,subtitleFontWeight:"normal",subtitleTextBaseline:"top"}};return Object.assign({},e,t)},fx=(ux.props={},{BLACK:"#000",WHITE:"#fff",STROKE:"#888"}),hx=t=>{var e={defaultColor:"#4e79a7",defaultCategory10:"tableau10",defaultCategory20:"tableau10",defaultSize:1,elementActiveStroke:fx.BLACK,enter:{duration:300,fill:"both",delay:0},update:{duration:300,fill:"both",delay:0},exit:{duration:300,fill:"both",delay:0},viewFill:"transparent",plotFill:"transparent",mainFill:"transparent",contentFill:"transparent",line:{line:{fill:"",strokeOpacity:1,lineWidth:1,connectStroke:"#aaa"}},point:{point:{r:3,fillOpacity:.95,lineWidth:0},hollow:{r:3,strokeOpacity:.95,lineWidth:1},plus:{r:3,strokeOpacity:.95,lineWidth:3},diamond:{r:3,strokeOpacity:.95,lineWidth:1}},interval:{rect:{fillOpacity:.95},hollow:{fill:"",strokeOpacity:1,lineWidth:2}},area:{area:{fillOpacity:.85,lineWidth:0,connectFill:fx.BLACK,connectFillOpacity:.1}},polygon:{polygon:{fillOpacity:.95}},cell:{cell:{fillOpacity:.95},hollow:{fill:"",strokeOpacity:1,lineWidth:2}},rect:{rect:{fillOpacity:.95},hollow:{fill:"",strokeOpacity:1,lineWidth:2}},link:{link:{fill:"",strokeOpacity:1}},vector:{vector:{fillOpacity:1}},box:{box:{fillOpacity:.95,stroke:"#1D2129",lineWidth:1}},text:{text:{fill:"#1D2129",fontSize:10,strokeWidth:0,connectorStroke:fx.STROKE,connectorStrokeOpacity:.45,connectorLineWidth:1,backgroundFill:fx.STROKE,backgroundFillOpacity:.15,backgroundPadding:[2,4],startMarkerSymbol:"circle",startMarkerSize:4,endMarkerSymbol:"circle",endMarkerSize:4},badge:{fill:"#1D2129",fillOpacity:.65,strokeWidth:0,fontSize:10,textAlign:"center",textBaseline:"middle",markerFill:fx.STROKE,markerFillOpacity:.25,markerStrokeOpacity:0}},lineX:{line:{stroke:fx.STROKE,strokeOpacity:.45,lineWidth:1}},lineY:{line:{stroke:fx.STROKE,strokeOpacity:.45,lineWidth:1}},rangeX:{range:{fill:fx.STROKE,fillOpacity:.15,lineWidth:0}},rangeY:{range:{fill:fx.STROKE,fillOpacity:.15,lineWidth:0}},connector:{connector:{stroke:fx.STROKE,strokeOpacity:.45,lineWidth:1,connectLength1:12,endMarker:!0,endMarkerSize:6,endMarkerFill:fx.STROKE,endMarkerFillOpacity:.95}},interaction:{active:{line:{line:{lineWidth:3}},interval:{rect:{stroke:fx.BLACK}},area:{area:{fillOpacity:.5}}},inactive:{area:{area:{fillOpacity:.3}}},selected:{},disabled:{}},axis:{arrow:!1,gridLineDash:[0,0],gridLineWidth:1,gridStroke:"#ddd",gridStrokeOpacity:1,labelAlign:"horizontal",labelAutoRotate:!1,labelFill:fx.BLACK,labelFillOpacity:1,labelFontSize:10,labelFontWeight:"normal",labelSpacing:4,line:!0,lineLineWidth:1,lineStroke:"#888",lineStrokeOpacity:1,tickLength:5,tickLineWidth:1,tickStroke:fx.STROKE,tickStrokeOpacity:1,titleFill:fx.BLACK,titleFillOpacity:1,titleFontSize:11,titleFontWeight:"bold",titleSpacing:12,titleTransformOrigin:"center"},axisTop:{gridDirection:"positive",labelDirection:"negative",tickDirection:"negative",titlePosition:"top",titleSpacing:0,titleTextBaseline:"middle",labelSpacing:4},axisBottom:{gridDirection:"negative",labelDirection:"positive",labelSpacing:4,tickDirection:"positive",titlePosition:"bottom",titleSpacing:4,titleTextBaseline:"bottom"},axisLeft:{gridDirection:"negative",labelDirection:"positive",labelSpacing:4,tickDirection:"positive",titlePosition:"left",titleSpacing:4,titleTextBaseline:"middle",titleTransform:"translate(50%, 0) rotate(-90) translate(0, -50%)",titleTransformOrigin:"center"},axisRight:{gridDirection:"positive",labelDirection:"negative",labelSpacing:4,tickDirection:"negative",titlePosition:"right",titleSpacing:0,titleTextBaseline:"top",titleTransform:"translate(-50%, 0) rotate(-90)",titleTransformOrigin:"center"},axisLinear:{girdClosed:!0,gridConnect:"arc",gridDirection:"negative",gridType:"surround",titlePosition:"top",titleTextBaseline:"bottom"},axisRadar:{girdClosed:!0,gridStrokeOpacity:.3,gridType:"surround",label:!1,tick:!1,titlePosition:"start"},legend:{backgroundFill:"transparent",itemBackgroundFill:"transparent",itemLabelFill:fx.BLACK,itemLabelFillOpacity:1,itemLabelFontSize:10,itemLabelFontWeight:"normal",itemMarkerFillOpacity:1,itemMarkerSize:8,itemSpacing:[5,4],itemValueFill:fx.BLACK,itemValueFillOpacity:1,itemValueFontSize:10,itemValueFontWeight:"normal",navButtonFill:fx.BLACK,navButtonFillOpacity:.45,navButtonSize:6,navPageNumFill:fx.BLACK,navPageNumFillOpacity:.45,navPageNumFontSize:10,padding:8,title:!1,titleFill:fx.BLACK,titleFillOpacity:1,titleFontSize:11,titleFontWeight:"bold",titleSpacing:4},continuousLegend:{handleHeight:12,handleLabelFill:fx.BLACK,handleLabelFillOpacity:.45,handleLabelFontSize:10,handleLabelFontWeight:"normal",handleMarkerFill:fx.BLACK,handleMarkerFillOpacity:.6,handleMarkerLineWidth:1,handleMarkerStroke:fx.BLACK,handleMarkerStrokeOpacity:.25,handleWidth:10,labelFill:fx.BLACK,labelFillOpacity:.45,labelFontSize:10,labelFontWeight:"normal",title:!1},label:{fill:fx.BLACK,fillOpacity:.65,fontSize:10,fontWeight:"normal",stroke:void 0,offset:12,connectorStroke:fx.BLACK,connectorStrokeOpacity:.45,connectorLineWidth:1,connectorLength:12,connectorLength2:8,connectorDistance:4},innerLabel:{fill:fx.WHITE,fontSize:10,fillOpacity:.85,fontWeight:"normal",stroke:void 0,offset:0},slider:{trackSize:16,trackFill:fx.STROKE,trackFillOpacity:.05,selectionFill:"#4e79a7",selectionFillOpacity:.15,handleIconSize:10,handleIconFill:"#f7f7f7",handleIconFillOpacity:1,handleIconStroke:fx.BLACK,handleIconStrokeOpacity:.25,handleIconLineWidth:1,handleIconRadius:2,handleLabelFill:fx.BLACK,handleLabelFillOpacity:.45,handleLabelFontSize:10,handleLabelFontWeight:"normal"},scrollbar:{},title:{titleFill:fx.BLACK,titleFillOpacity:.85,titleFontSize:14,titleFontWeight:"bold",titleTextBaseline:"top",subtitleFill:fx.BLACK,subtitleFillOpacity:.65,subtitleFontSize:12,subtitleFontWeight:"normal",subtitleTextBaseline:"top"}};return Object.assign({},e,t)};function dx(t,e){var n;return(e=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0?null:[1<(n=t.slice(0,e)).length?n[0]+n.slice(2):n,+t.slice(e+1)]}hx.props={};var px,gx=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function mx(t){var e;if(e=gx.exec(t))return new yx({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]});throw new Error("invalid format: "+t)}function yx(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function vx(t,e){var n,e=dx(t,e);return e?(n=e[0],(e=e[1])<0?"0."+new Array(-e).join("0")+n:n.length>e+1?n.slice(0,e+1)+"."+n.slice(e+1):n+new Array(e-n.length+2).join("0")):t+""}mx.prototype=yx.prototype,yx.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var bx={"%":(t,e)=>(100*t).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:function(t){return 1e21<=Math.abs(t=Math.round(t))?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>vx(100*t,e),r:vx,s:function(t,e){var n,r,i=dx(t,e);return i?(n=i[0],(i=(i=i[1])-(px=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1)===(r=n.length)?n:r<i?n+new Array(i-r+1).join("0"):0<i?n.slice(0,i)+"."+n.slice(i):"0."+new Array(1-i).join("0")+dx(t,Math.max(0,e+i-1))[0]):t+""},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function xx(t){return t}var wx,Mx=Array.prototype.map,Ox=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function kx(t){var e,s,l,M=void 0===t.grouping||void 0===t.thousands?xx:(s=Mx.call(t.grouping,Number),l=t.thousands+"",function(t,e){for(var n=t.length,r=[],i=0,a=s[0],o=0;0<n&&0<a&&(e<o+a+1&&(a=Math.max(1,e-o)),r.push(t.substring(n-=a,n+a)),!((o+=a+1)>e));)a=s[i=(i+1)%s.length];return r.reverse().join(l)}),r=void 0===t.currency?"":t.currency[0]+"",i=void 0===t.currency?"":t.currency[1]+"",O=void 0===t.decimal?".":t.decimal+"",k=void 0===t.numerals?xx:(e=Mx.call(t.numerals,String),function(t){return t.replace(/[0-9]/g,function(t){return e[+t]})}),a=void 0===t.percent?"%":t.percent+"",_=void 0===t.minus?"−":t.minus+"",E=void 0===t.nan?"NaN":t.nan+"";function o(t){var c=(t=mx(t)).fill,u=t.align,f=t.sign,e=t.symbol,h=t.zero,d=t.width,p=t.comma,g=t.precision,m=t.trim,y=t.type,v=("n"===y?(p=!0,y="g"):bx[y]||(void 0===g&&(g=12),m=!0,y="g"),(h||"0"===c&&"="===u)&&(h=!0,c="0",u="="),"$"===e?r:"#"===e&&/[boxX]/.test(y)?"0"+y.toLowerCase():""),b="$"===e?i:/[%p]/.test(y)?a:"",x=bx[y],w=/[defgprs%]/.test(y);function n(t){var e,n,r,i=v,a=b;if("c"===y)a=x(t)+a,t="";else{var o=(t=+t)<0||1/t<0;if(t=isNaN(t)?E:x(Math.abs(t),g),m&&(t=function(t){t:for(var e,n=t.length,r=1,i=-1;r<n;++r)switch(t[r]){case".":i=e=r;break;case"0":0===i&&(i=r),e=r;break;default:if(!+t[r])break t;0<i&&(i=0)}return 0<i?t.slice(0,i)+t.slice(e+1):t}(t)),i=((o=o&&0==+t&&"+"!==f?!1:o)?"("===f?f:_:"-"===f||"("===f?"":f)+i,a=("s"===y?Ox[8+px/3]:"")+a+(o&&"("===f?")":""),w)for(e=-1,n=t.length;++e<n;)if((r=t.charCodeAt(e))<48||57<r){a=(46===r?O+t.slice(e+1):t.slice(e))+a,t=t.slice(0,e);break}}p&&!h&&(t=M(t,1/0));var s=i.length+t.length+a.length,l=s<d?new Array(d-s+1).join(c):"";switch(p&&h&&(t=M(l+t,l.length?d-a.length:1/0),l=""),u){case"<":t=i+t+a+l;break;case"=":t=i+l+t+a;break;case"^":t=l.slice(0,s=l.length>>1)+i+t+a+l.slice(s);break;default:t=l+i+t+a}return k(t)}return g=void 0===g?6:/[gprs]/.test(y)?Math.max(1,Math.min(21,g)):Math.max(0,Math.min(20,g)),n.toString=function(){return t+""},n}return{format:o,formatPrefix:function(t,e){var n=o(((t=mx(t)).type="f",t)),e=3*Math.max(-8,Math.min(8,Math.floor((t=e,((t=dx(Math.abs(t)))?t[1]:NaN)/3)))),r=Math.pow(10,-e),i=Ox[8+e/3];return function(t){return n(r*t)+i}}}}function _x(t,e,n){return t.querySelector(e)?ot(t).select(e):ot(t).append(n)}function Ex(t){return Array.isArray(t)?t.join(", "):""+(t||"")}function Sx(t,e){var n={display:"flex",flexDirection:"row",justifyContent:"flex-start",alignItems:"center"};if(e)return Object.assign(Object.assign({},n),e);let{flexDirection:r,justifyContent:i,alignItems:a}=n;e={top:["row","flex-start","center"],bottom:["row","flex-start","center"],left:["colunm","center","center"],right:["colunm","center","center"],center:["column","center","center"]};return t in e&&([r,i,a]=e[t]),{display:"flex",flexDirection:r,justifyContent:i,alignItems:a}}Wo=kx({thousands:",",grouping:[3],currency:["$",""]}),wx=Wo.format,Wo.formatPrefix;class Ax extends mo{get child(){var t;return null==(t=this.children)?void 0:t[0]}update(t){var e,t=(this.attr(t),t)["subOptions"];null!=(e=this.child)&&e.update(t)}}class Lx extends Ax{update(t){var e,t=t["subOptions"];null!=(e=this.child)&&e.update(t)}}function Tx(t,e){return null==(t=t.filter(t=>t.getOptions().name===e))?void 0:t[0]}function jx(t,e,n){var t=t["bbox"],{position:e="top",size:r,length:i}=e,e=["top","bottom","center"].includes(e),[t,a]=e?[t.height,t.width]:[t.width,t.height],{defaultSize:n,defaultLength:o}=n.props,r=r||n||t,n=i||o||a,[t,i]=e?[n,r]:[r,n];return{orientation:e?"horizontal":"vertical",width:t,height:i,size:r,length:n}}function Nx(t){const n=["arrow","crosshairs","grid","handle","handleLabel","indicator","label","line","tick","tip","title","trunc"];var e=t["style"],t=rt(t,["style"]);const r={};return Object.entries(t).forEach(([t,e])=>{n.includes(t)?r["show"+Qe(t)]=e:r[t]=e}),Object.assign(Object.assign({},r),e)}function Px(t){var{innerWidth:t,innerHeight:e}=t.getOptions();return[t,e]}function Cx(t){return"number"!=typeof t||Math.abs(t)<1e-15?t:parseFloat(t.toFixed(15))}function Rx(a,t,e,n,r,i,o,s){void 0===e&&void 0===i||a.update(Object.assign(Object.assign({},e&&{tickCount:e}),i&&{tickMethod:i})),e=t,t=i;var l,t=(i=a).getTicks?i.getTicks():t?([c,l]=pc(e,t=>+t),i=i.getOptions()["tickCount"],t(c,l,i)):e,c=r?t.filter(r):t;const u=t=>!(t instanceof Date)&&"object"==typeof t&&t?t:String(t),f=n||(null==(l=a.getFormatter)?void 0:l.call(a))||u,h=function(t,e){var{innerWidth:e,innerHeight:n,insetTop:r,insetBottom:i,insetLeft:a,insetRight:o}=e.getOptions(),[t,r,i]="left"===t||"right"===t?[r,i,n]:[a,o,e];const s=new i0({domain:[0,1],range:[t/i,1-r/i]});return t=>s.map(t)}(o,s),d=function(r,i){const{width:a,height:o}=i.getOptions();return t=>{var e,n;return Jc(i)?(e=i.map("bottom"===r?[t,1]:[0,t]),"bottom"===r?(n=e[0],new i0({domain:[0,a],range:[0,1]}).map(n)):"left"===r?(n=e[1],new i0({domain:[0,o],range:[0,1]}).map(n)):t):t}}(o,s);return Kc(s)||Uc(s)?c.map((t,e,n)=>{var r,i=(null==(i=a.getBandWidth)?void 0:i.call(a,t))/2||0,i=h(a.map(t)+i);return{value:Xc(s)&&"center"===o||Uc(s)&&(null==(r=a.getTicks)?void 0:r.call(a))&&["top","bottom","center","outer"].includes(o)?1-i:i,label:u(f(Cx(t),e,n)),id:String(e)}}):c.map((t,e,n)=>{var r=(null==(r=a.getBandWidth)?void 0:r.call(a,t))/2||0;return{value:d(h(a.map(t)+r)),label:u(f(Cx(t),e,n)),id:String(e)}})}function Ix(t,e,n){var r;return!(Kc(r=e)&&Uc(r)||Qc(e))&&(void 0===t?!!n.getTicks:t)}function Bx(t,e,n,r,i,a){n=function(t,e){var n=t.axis;let r=t.axisLinear;return["top","right","bottom","left"].includes(e)&&(r=t["axis"+zu(e)]),Object.assign({},n,r)}(n,i);return"center"===i?Object.assign(Object.assign(Object.assign(Object.assign({},n),{labelDirection:"right"===r?"negative":"positive"}),"center"===r?{labelTransform:"translate(50%,0)"}:null),{tickDirection:"right"===r?"negative":"positive",labelSpacing:"center"===r?0:4,titleSpacing:"vertical"===(i=a)||i===-Math.PI/2?10:0,tick:"center"!==r&&void 0}):n}var Fx,us=s=>i=>{const{labelFormatter:a,labelFilter:o=()=>!0}=i;return t=>{var[e]=t["scales"];const r=(null==(n=e.getTicks)?void 0:n.call(e))||e.getOptions().domain;var n="string"==typeof a?wx(a):a,n=Object.assign(Object.assign({},i),{labelFormatter:n,labelFilter:(t,e,n)=>o(r[e],e,r),scale:e});return s(n)(t)}};const Dx=us(t=>{const{direction:o="left",important:s={},labelFormatter:l,orientation:c,position:u,size:f,style:h={},title:d,tickCount:p,tickFilter:g,tickMethod:m,transform:y,indexBBox:v}=t,b=rt(t,["direction","important","labelFormatter","order","orientation","position","size","style","title","tickCount","tickFilter","tickMethod","transform","indexBBox"]);return({scales:[t],value:e,coordinate:n,theme:r})=>{var e=e["bbox"],i=t.getOptions()["domain"],r=Bx(0,0,r,o,u,c),r=Object.assign(Object.assign(Object.assign({},r),h),b),a=function(t,e){var[e,n]=Px(e);return t.includes("bottom")||t.includes("top")?n:e}(u,n),e=function(t,e,n,r){var{x:n,y:i,width:a,height:o}=n;if("bottom"===t)return{startPos:[n,i],endPos:[n+a,i]};if("left"===t)return{startPos:[n+a,i],endPos:[n+a,i+o]};if("right"===t)return{endPos:[n,i+o],startPos:[n,i]};if("top"===t)return{startPos:[n,i+o],endPos:[n+a,i+o]};if("center"===t){if("vertical"===e)return{startPos:[n+a,i],endPos:[n+a,i+o]};if("horizontal"===e)return{startPos:[n,i+o],endPos:[n+a,i+o]};if("number"==typeof e){var[t,s]=r.getCenter(),[l,c]=eu(r);const[u,f]=nu(r);var r=Math.min(a,o)/2,a=l*r,o=c*r,[l,c]=[t+n,s+i],[r,e]=[Math.cos(e),Math.sin(e)];return{startPos:[l+o*r,c+o*e],endPos:[l+a*r,c+a*e],gridClosed:f-u==360,gridCenter:[t+n,i+s],gridControlAngles:new Array(3).fill(0).map((t,e,n)=>(f-u)/(n.length-1)*e)}}}return{}}(u,c,e,n),i=Rx(t,i,p,l,g,m,u,n),i=v?i.map((t,e)=>{e=v.get(e);return!e||e[0]!==t.label?t:Object.assign(Object.assign({},t),{bbox:e[1]})}):i,i=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},r),{type:"linear",data:i,crossSize:f,titleText:Ex(d),labelOverlap:function(t=[],e){if(0<t.length)return t;var{labelAutoRotate:t,labelAutoHide:e,labelAutoEllipsis:n,labelAutoWrap:r}=e;const i=[];var a=(t,e)=>{e&&i.push(t)};return a({type:"rotate",optionalAngles:[0,15,30,45,60,90]},t),a({type:"ellipsis",minLength:20},n),a({type:"hide"},e),a({type:"wrap",wordWrapWidth:100,maxLines:3,recoveryWhenFail:!0},r),i}(y,r),grid:Ix(r.grid,n,t),gridLength:a,line:!0,indexBBox:v}),r.line?null:{lineOpacity:0}),e),s);return i.labelOverlap.find(t=>"hide"===t.type)&&(i.crossSize=!1),new fb({className:"axis",style:Nx(i)})}}),zx=us(t=>{const{position:o,labelFormatter:s,tickFilter:l,tickCount:c,tickMethod:u,important:f={},style:e={}}=t,h=rt(t,["order","size","position","orientation","labelFormatter","tickFilter","tickCount","tickMethod","important","style"]),{title:d,grid:p=!1}=e;return({scales:[t],value:e,coordinate:n,theme:r})=>{var e=e["bbox"],i=t.getOptions()["domain"],t=Rx(t,i,c,s,l,u,o,n),[i,a]=eu(n),e=function(t,e,n,r,i){var{x:e,y:a,width:o,height:s}=e,e=[e+o/2,a+s/2],a=Math.min(o,s)/2,[o,s]=nu(i),[l,c]=Px(i),e={center:e,radius:a,startAngle:o,endAngle:s,titleFillOpacity:0,titlePosition:"inner",line:!1,tick:!0,gridLength:(r-n)*(Math.min(l,c)/2)};return"inner"===t?(Px(i),Object.assign(Object.assign({},e),{labelAlign:"perpendicular",labelDirection:"positive",labelSpacing:4,tickDirection:"positive",gridDirection:"negative"})):Object.assign(Object.assign({},e),{labelAlign:"parallel",labelDirection:"negative",labelSpacing:4,tickDirection:"negative",gridDirection:"positive"})}(o,e,i,a,n),i=r["axis"];return new fb({style:Nx(it({},i,e,Object.assign(Object.assign({type:"arc",data:t,titleText:Ex(d),grid:p},h),f)))})}}),Wx=(Dx.props={defaultPosition:"center",defaultSize:45,defaultOrder:0},zx.props={defaultPosition:"outer",defaultOrientation:"vertical",defaultSize:45,defaultOrder:0},e=>(...t)=>Dx(Object.assign({},{crossPadding:50},e))(...t)),Gx=(Wx.props=Object.assign(Object.assign({},Dx.props),{defaultPosition:"bottom"}),e=>(...t)=>Dx(Object.assign({},{crossPadding:10},e))(...t));Gx.props=Object.assign(Object.assign({},Dx.props),{defaultPosition:"left"});const qx=a=>{const{important:o={}}=a,s=rt(a,["important"]);return t=>{var e,{theme:n,coordinate:r,value:i}=t;return Dx(Object.assign(Object.assign(Object.assign({},s),(e=a.orientation,(e%=2*Math.PI)==Math.PI/2?{titleTransform:"translate(0, 50%)"}:e>-Math.PI/2&&e<Math.PI/2?{titleTransform:"translate(50%, 0)"}:e>Math.PI/2&&e<3*Math.PI/2?{titleTransform:"translate(-50%, 0)"}:{})),{important:Object.assign(Object.assign({},function(t,e,n,r){const i=t["radar"];var[{name:t}]=r["scales"];const[a,o]=nu(n);var{axisRadar:r={}}=e;return Object.assign(Object.assign({},r),{grid:"position"===t,gridConnect:"line",gridControlAngles:new Array(i.count).fill(0).map((t,e)=>{return(o-a)/i.count*e})})}(a,n,r,i)),o)}))(t)}};function Hx(t,e,n,r,i={}){const a=(null==(e=null==(e=e["shape."+t])?void 0:e.props)?void 0:e.defaultMarker)||function(t){if(Re(t))return t[t.length-1]}(t.split("."));return()=>function(t,e){var{fill:n,stroke:r,lineWidth:i,color:a}=e,o=rt(e,["d","fill","strokeWidth","path","stroke","lineWidth","color"]);const s=Ig.get(t)||Ig.get("point");return(...t)=>{return new nt.Path({style:Object.assign(Object.assign({},o),{path:s(...t),stroke:s.style.includes("stroke")?a||r:"",fill:s.style.includes("fill")?a||n:"",lineWidth:s.style.includes("lineWidth")?i||2:0})})}}(a,i)(0,0,6)}function Vx(t,{scales:e,library:n,markState:r}){var i=Tx(e,"shape");const[a,o]=function(t,e){const n=Tx(t,"shape");var r=Tx(t,"color");const i=[];for(const[l,c]of e){var a=l.type,o=(0<(null==r?void 0:r.getOptions().domain.length)?null==r?void 0:r.getOptions().domain:c.data).map((t,e)=>{return n?n.map(t||"point"):(null==(t=null===l||void 0===l?void 0:l.style)?void 0:t.shape)||c.defaultShape||"point"});"string"==typeof a&&i.push([a,o])}if(0===i.length)return["point",["point"]];if(1===i.length)return i[0];if(!n)return i[0];const s=n.getOptions()["range"];return i.map(([t,e])=>{let n=0;for(let t=0;t<i.length;t++){var r=s[t%s.length];e[t]===r&&n++}return[n/e.length,[t,e]]}).sort((t,e)=>e[0]-t[0])[0][1]}(e,r),s=t["itemMarker"];return i&&!s?(t,e)=>Hx(a+"."+o[e],n,0,0,{color:t.color}):"function"==typeof s?s:(t,e)=>Hx(s||a+"."+o[e],n,0,0,{color:t.color})}function Yx(t,e){var{labelFormatter:n=t=>""+t}=t,r=e["scales"],e={itemMarker:Vx(t,e),itemMarkerSize:(t=Tx(t=r,"size"))?2*t.map(NaN):8,itemMarkerOpacity:function(t){if(t=Tx(t,"opacity")){const n=t.getOptions()["range"];return(t,e)=>n[e]}}(r)};const i="string"==typeof n?wx(n):n,a=Tx(r,"color");t=r.find(t=>0<t.getOptions().domain.length).getOptions().domain;return Object.assign(Object.assign({},e),{data:t.map(t=>({id:t,label:i(t),color:a.map(t)}))})}qx.props=Object.assign(Object.assign({},Dx.props),{defaultPosition:"center"});const $x=l=>{const{position:c,title:u}=l,f=rt(l,["labelFormatter","layout","order","orientation","position","size","title"]),{gridCol:h,gridRow:d}=f;return t=>{var{value:e,theme:n}=t,r=e["bbox"],{width:i,height:a}=function(t,e,n){var r;if("center"===(r=e["position"])){r=t["bbox"];const{width:i,height:a}=r;return{width:i,height:a}}const{width:i,height:a}=jx(t,e,n);return{width:i,height:a}}(e,l,$x),e=Sx(c,null==(e=null==(e=null==(e=e.scales)?void 0:e[0])?void 0:e.guide)?void 0:e.layout),[o,s]=function(t,e,n){var[r,i]=[e||100,n||100];switch(t){case"top":case"bottom":case"top-left":case"top-right":case"bottom-left":case"bottom-right":return[1,i];case"left":case"right":return[r,1];default:return[e,n]}}(c,d,h),i=Object.assign({orientation:["right","left","center"].includes(c)?"vertical":"horizontal",width:i,height:a,gridCol:null!==h&&void 0!==h?h:s,gridRow:null!==d&&void 0!==d?d:o,rowPadding:0,colPadding:8,titleText:Ex(u)},Yx(l,t)),{legend:a={}}=n,s=Nx(Object.assign({},a,i,f)),o=new Lx({style:Object.assign(Object.assign({x:r.x,y:r.y,width:r.width,height:r.height},e),{subOptions:s})});return o.appendChild(new Ib({className:"legend-category",style:s})),o}};function Ux(t,e,n){var r=e["size"],t=jx(t,e,n),r=(e=r,n=Jx.props.defaultLegendSize,Math.min(e,n));return e=r,r=(n=t).orientation,n.size=e,"horizontal"===(r=r)||0===r?n.height=e:n.width=e,n}function Kx(t,e,n,r,i){var a,e=e.thresholds,o=(a=r,t=>({value:t/a,label:String(t)}));return Object.assign(Object.assign({},t),{color:i,data:[n,...e,r].map(o)})}function Xx(t){var t=t.getOptions()["domain"],[t,e]=[t[0],N0(t)];return[t,e]}function Zx(t,e,n,r,i){const a=t["length"],o=e||(e=n||r,n=(n=i).defaultColor,i=e.getOptions(),(e=e.clone()).update(Object.assign(Object.assign({},i),{range:[nt.parseColor(n).toString()]})),e);const[s,l]=Xx(o);return Object.assign(Object.assign({},t),{data:o.getTicks().map(t=>({value:t})),color:new Array(a).fill(0).map((t,e)=>{var e=(l-s)/(a-1)*e+s,n=o.map(e);const i=r?r.map(e):1;return n.replace(/rgb[a]*\(([\d]{1,3}) *, *([\d]{1,3}) *, *([\d]{1,3})[\S\s]*\)/,(t,e,n,r)=>`rgba(${e}, ${n}, ${r}, ${i})`)})})}function Qx(t,e,n,r,i){var a=Tx(t,"color"),e=Ux(e,n,r);if(a instanceof c0){var n=a.getOptions()["range"],[r,o]=Xx(a);if(a instanceof h0||a instanceof p0)return Kx(e,a,r,o,n);{r=e;o=a;const s=[-1/0,...o.thresholds,1/0].map((t,e)=>({value:e,label:t}));return Object.assign(Object.assign({},r),{data:s,color:n,labelFilter:(t,e)=>0<e&&e<s.length-1})}}return Zx(e,a,Tx(t,"size"),Tx(t,"opacity"),i)}$x.props={defaultPosition:"top",defaultOrder:1,defaultSize:40};const Jx=c=>{const{labelFormatter:u,layout:f,position:h,title:d,style:p}=c,g=rt(c,["labelFormatter","layout","order","orientation","position","size","title","style"]);return({scales:t,value:e,theme:n})=>{var r=e["bbox"],{x:r,y:i,width:a,height:o}=r,s=Sx(h,f),{continuousLegend:l={}}=n,l=Nx(Object.assign({},l,Object.assign(Object.assign({titleText:Ex(d),titleFontSize:12,handle:!1,indicator:!1,labelAlign:"value",labelFormatter:"string"==typeof u?t=>wx(u)(t.label):u},Qx(t,e,c,Jx,n)),p),g)),t=new Ax({style:Object.assign(Object.assign({x:r,y:i,width:a,height:o},s),{subOptions:l})});return t.appendChild(new r2({style:l})),t}},tw=(Jx.props={defaultPosition:"top",defaultOrientation:"vertical",defaultOrder:1,defaultSize:60,defaultLength:300,defaultLegendSize:60},e=>(...t)=>Jx(Object.assign({},{block:!0},e))(...t)),ew=(tw.props=Object.assign(Object.assign({},Jx.props),{defaultPosition:"top",defaultOrientation:"horizontal"}),n=>t=>{var e=t["scales"],e=Tx(e,"size");return Jx(Object.assign({},{type:"size",tick:!1,data:e.getOptions().domain.map((t,e)=>({value:t,label:String(t)})),labelFilter:(t,e,n)=>0===e||e===n.length-1},n))(t)}),nw=(ew.props=Object.assign(Object.assign({},Jx.props),{defaultPosition:"top",defaultOrientation:"horizontal"}),t=>ew(Object.assign({},{block:!0},t)));function rw(t,e,n,r){switch(r){case"center":return{x:t+n/2,y:e,textAlign:"middle"};case"right":return{x:t+n,y:e,textAlign:"right"};default:return{x:t,y:e,textAlign:"left"}}}nw.props=Object.assign(Object.assign({},Jx.props),{defaultPosition:"top",defaultOrientation:"horizontal"});Fx={render(t,e){const{y:n,width:r,title:i,subtitle:a}=t,o=t.style,{spacing:s=2,align:l="left"}=o,c=rt(o,["spacing","align"]);t=at(c,"title");const u=at(c,"subtitle"),f=_x(e,".title","text").attr("className","title").call(j,Object.assign(Object.assign(Object.assign({},rw(0,n,r,l)),{fontSize:14,textBaseline:"top",text:i}),t)).node().getLocalBounds();_x(e,".sub-title","text").attr("className","sub-title").call(t=>{if(!a)return t.node().remove();t.node().attr(Object.assign(Object.assign(Object.assign({},rw(0,f.max[1]+s,r,l)),{fontSize:12,textBaseline:"top",text:a}),u))})}};const iw=class extends nt.CustomElement{constructor(t){super(t),this.descriptor=Fx}connectedCallback(){var t,e;null!=(e=(t=this.descriptor).render)&&e.call(t,this.attributes,this)}update(t={}){var e;this.attr(it({},this.attributes,t)),null!=(e=(t=this.descriptor).render)&&e.call(t,this.attributes,this)}},aw=a=>({value:t,theme:e})=>{var{x:t,y:n,width:r,height:i}=t.bbox;return new iw({style:it({},{style:e.title},Object.assign({x:t,y:n,width:r,height:i},a))})};function ow(t){return t.getBandWidth}function sw(t,e,n){if(!ow(t))return t.invert(e);var r=t["adjustedRange"],i=t.getOptions()["domain"],a=n?-1:0;const o=t.getStep();var t=n?r:r.map(t=>t+o),n=uc(t,e);return r=n+a,t=0,e=i.length-1,i[Math.min(e,Math.max(t,r))]}function lw(t,e,n){if(!e)return t.getOptions().domain;if(!ow(t))return o=Oc(e),n?([i]=o,r=t.getOptions()["range"],[r,a]=r,a=a<r?-1:1,[i,t.invert(t.map(i)+a*n)]):o;var r=t.getOptions()["domain"],i=e[0],a=r.indexOf(i);if(n){const s=a+Math.round(r.length*n);return r.slice(a,s)}var o=e[e.length-1];const s=r.indexOf(o);return r.slice(a,s+1)}function cw(t,e,n,r,i,a){const{x:o,y:s}=i;i=(t,e)=>{var[t,n]=a.invert(t);return[sw(o,t,e),sw(s,n,e)]},t=i([t,e],!0),e=i([n,r],!1);return[lw(o,[t[0],e[0]]),lw(s,[t[1],e[1]])]}function uw(t,e){var[t,n]=t;return[e.map(t),e.map(n)+((t=e).getStep?t.getStep():0)]}aw.props={defaultPosition:"top",defaultOrder:2,defaultSize:36};const fw=t=>{const{orientation:f,labelFormatter:h,style:d}=t,p=rt(t,["orientation","labelFormatter","size","style","position"]);return({scales:[n],value:t,theme:e,coordinate:r})=>{var t=t["bbox"],{x:t,y:i,width:a,height:o}=t,{slider:e={}}=e;const s=(null==(c=n.getFormatter)?void 0:c.call(n))||(t=>t.toString()),l="string"==typeof h?wx(h):h;var c="horizontal"===f;const u=Uc(r)&&c;return new Uy({className:"slider",style:Object.assign({},e,Object.assign(Object.assign({x:t,y:i,trackLength:c?a:o,orientation:f,formatter:t=>{var e=l||s,t=u?1-t:t;return e(sw(n,t,!0))}},d),p))})}},hw=(fw.props={defaultPosition:"bottom",defaultSize:24,defaultOrder:1},t=>fw(Object.assign(Object.assign({},t),{orientation:"horizontal"}))),dw=(hw.props=Object.assign(Object.assign({},fw.props),{defaultPosition:"bottom"}),t=>fw(Object.assign(Object.assign({},t),{orientation:"vertical"}))),pw=(dw.props=Object.assign(Object.assign({},fw.props),{defaultPosition:"left"}),t=>{const{orientation:s,style:l}=t,c=rt(t,["orientation","labelFormatter","style"]);return({scales:[t],value:e,theme:n})=>{var e=e["bbox"],{x:e,y:r,width:i,height:a}=e,{scrollbar:n={}}=n,{ratio:t,range:o}=t.getOptions(),i="horizontal"===s?i:a,a=i/t,[t,o]=o,t=t<o?0:1;return new Zy({className:"g2-scrollbar",style:Object.assign({},n,Object.assign(Object.assign(Object.assign(Object.assign({},l),{x:e,y:r,trackLength:i}),c),{orientation:s,value:t,contentLength:a,viewportLength:i}))})}}),gw=(pw.props={defaultPosition:"bottom",defaultSize:24,defaultOrder:1},t=>pw(Object.assign(Object.assign({},t),{orientation:"horizontal"}))),mw=(gw.props=Object.assign(Object.assign({},pw.props),{defaultPosition:"bottom"}),t=>pw(Object.assign(Object.assign({},t),{orientation:"vertical"})));mw.props=Object.assign(Object.assign({},pw.props),{defaultPosition:"left"});class yw{constructor(t){this.$value=t}static of(t){return new yw(t)}call(t,...e){return this.$value=t(this.$value,...e),this}value(){return this.$value}}function vw(t,e,n){return yw.of({}).call(bw,t).call(bw,e).call(bw,n).value()}function bw(t,e){for(var[n,r]of Object.entries(e))void 0!==r&&(t[n]=e[n]);return t}function xw(t,e){var n={};for(const i of e){var r=t.style[i];r&&(n[i]=r)}return n}const ww=["fill","stroke","fillOpacity","strokeOpacity","opacity","lineWidth"],Mw=u=>{return(t,e,n,r,i)=>{const[a]=t;var t=a.getBoundingClientRect()["height"],{transform:o="",fillOpacity:s=1,strokeOpacity:l=1,opacity:c=1}=a.style,[r,t]=Uc(r)?[[0,t],"scale(1, 0.0001)"]:[[0,0],"scale(0.0001, 1)"],t=[{transform:(o+" "+t).trimStart(),fillOpacity:0,strokeOpacity:0,opacity:0},{transform:(o+" "+t).trimStart(),fillOpacity:s,strokeOpacity:l,opacity:c,offset:.01},{transform:(o+" scale(1, 1)").trimStart(),fillOpacity:s,strokeOpacity:l,opacity:c}],o=(a.setOrigin(r),a.animate(t,vw(i,n,u)));return o.finished.then(()=>a.setOrigin(0,0)),o}},Ow=u=>{return(t,e,n,r,i)=>{const[a]=t;var t=a.getBoundingClientRect()["height"],{transform:o="",fillOpacity:s=1,strokeOpacity:l=1,opacity:c=1}=a.style,[r,t]=Uc(r)?[[0,t],"scale(1, 0.0001)"]:[[0,0],"scale(0.0001, 1)"],s=[{transform:(o+" scale(1, 1)").trimStart()},{transform:(o+" "+t).trimStart(),fillOpacity:s,strokeOpacity:l,opacity:c,offset:.99},{transform:(o+" "+t).trimStart(),fillOpacity:0,strokeOpacity:0,opacity:0}],l=(a.setOrigin(r),a.animate(s,vw(i,n,u)));return l.finished.then(()=>a.setOrigin(0,0)),l}},kw=u=>{return(t,e,n,r,i)=>{const[a]=t;var t=a.getBoundingClientRect()["height"],{transform:o="",fillOpacity:s=1,strokeOpacity:l=1,opacity:c=1}=a.style,[r,t]=Uc(r)?[[0,0],"scale(0.0001, 1)"]:[[0,t],"scale(1, 0.0001)"],t=[{transform:(o+" "+t).trimStart(),fillOpacity:0,strokeOpacity:0,opacity:0},{transform:(o+" "+t).trimStart(),fillOpacity:s,strokeOpacity:l,opacity:c,offset:.01},{transform:(o+" scale(1, 1)").trimStart(),fillOpacity:s,strokeOpacity:l,opacity:c}],o=(a.setOrigin(r),a.animate(t,vw(i,n,u)));return o.finished.then(()=>a.setOrigin(0,0)),o}},_w=u=>{return(t,e,n,r,i)=>{const[a]=t;var t=a.getBoundingClientRect()["height"],{transform:o="",fillOpacity:s=1,strokeOpacity:l=1,opacity:c=1}=a.style,[r,t]=Uc(r)?[[0,0],"scale(0.0001, 1)"]:[[0,t],"scale(1, 0.0001)"],s=[{transform:(o+" scale(1, 1)").trimStart()},{transform:(o+" "+t).trimStart(),fillOpacity:s,strokeOpacity:l,opacity:c,offset:.99},{transform:(o+" "+t).trimStart(),fillOpacity:0,strokeOpacity:0,opacity:0}],l=(a.setOrigin(r),a.animate(s,vw(i,n,u)));return l.finished.then(()=>a.setOrigin(0,0)),l}},Ew=l=>(t,e,n,r,i)=>{var[t]=t,{fillOpacity:a=1,strokeOpacity:o=1,opacity:s=1}=t.style;return t.animate([{fillOpacity:0,strokeOpacity:0,opacity:0},{fillOpacity:a,strokeOpacity:o,opacity:s}],vw(i,n,l))},Sw=(Ew.props={},l=>(t,e,n,r,i)=>{var[t]=t,{fillOpacity:a=1,strokeOpacity:o=1,opacity:s=1}=t.style;return t.animate([{fillOpacity:a,strokeOpacity:o,opacity:s},{fillOpacity:0,strokeOpacity:0,opacity:0}],vw(i,n,l))});function Aw(t){var{min:t,max:e}=t.getLocalBounds(),[t,n]=t,[e,r]=e;return[t,n,e-t,r-n]}function Lw(t,e){var[n,r,i,t]=Aw(t),a=Math.ceil(Math.sqrt(e/(t/i))),o=[],s=t/Math.ceil(e/a);let l=0,c=e;for(;0<c;){var u=Math.min(c,a),f=i/u;for(let t=0;t<u;t++){var h=n+t*f,d=r+l*s;o.push(function(t){var[t,e,n,r]=t;return`
  2. M ${t} ${e}
  3. L ${t+n} ${e}
  4. L ${t+n} ${e+r}
  5. L ${t} ${e+r}
  6. Z
  7. `}([h,d,f,s]))}c-=u,l+=1}return o}function Tw(t,e){t.__data__=e.__data__,t.className=e.className,e.parentNode.replaceChild(t,e)}function jw(t,e){return t.indexOf(e)===t.lastIndexOf(e)}function Nw(t){var e,t=nt.convertToPath(t);if(t&&(jw(e=t,"m")&&jw(e,"M")))return t}function Pw(t,e,n,r){var i,a,o,s,l,c,u,f,h,d=e["nodeName"],p=n["nodeName"],g=Nw(e),m=Nw(n);if(d===p&&"path"!==d||(void 0===g||void 0===m))return p=n,d=r,[a,o,v,s]=Aw(i=e),h=i.style.transform,l=p.style.transform,[c,y,u,f]=(Tw(p,i),Aw(p)),h=[Object.assign({transform:`${h?h+" ":""}translate(${a-c}, ${o-y}) scale(${v/u}, ${s/f})`},xw(i,ww)),Object.assign({transform:`${l?l+" ":""}translate(0, 0) scale(1, 1)`},xw(p,ww))],p.animate(h,d);{a=g;const b="path"===(o=(c=t)["nodeName"])?c:(Tw(o=new nt.Path({style:Object.assign(Object.assign({},xw(c,ww)),{d:a})}),c),o);var y=[Object.assign({path:g},xw(e,ww)),Object.assign({path:m},xw(n,ww))],v=b.animate(y,r);return v.onfinish=()=>{Gu(b,n)},b.style.transform="scale(1, 1)",b.style.transform="none",v}}Sw.props={};const Cw=g=>(t,e,n,r,i)=>{[a="pack"]=[g.split];var a="function"==typeof a?a:Lw,i=vw(i,n,g),n=t["length"],o=e["length"];if(1===n&&1===o||1<n&&1<o)return[s]=t,[c]=e,Pw(s,s,c,i);if(1===n&&1<o){var[s]=t;{var l=s,c=e,u=i,s=a;l.style.visibility="hidden";const d=s(l,c.length);return c.map((t,e)=>{return Pw(t,new nt.Path({style:Object.assign({path:d[e]},xw(l,ww))}),t,u)})}}if(1<n&&1===o){var[n]=e;{var o=t,f=n,h=i;const p=(e=a)(f,o.length);var{fillOpacity:e=1,strokeOpacity:t=1,opacity:n=1}=f.style,e=f.animate([{fillOpacity:0,strokeOpacity:0,opacity:0},{fillOpacity:0,strokeOpacity:0,opacity:0,offset:.99},{fillOpacity:e,strokeOpacity:t,opacity:n}],h);return[...o.map((t,e)=>{return Pw(t,t,new nt.Path({style:{path:p[e],fill:f.style.fill}}),h)}),e]}}return null},Rw=(Cw.props={},b=>{return nt.CSS.registerProperty({name:"waveInArcAngle",inherits:!1,initialValue:"",interpolable:!0,syntax:nt.PropertySyntax.NUMBER}),(t,e,n,r,i)=>{const[a]=t;if(!Kc(r))return Mw(b)(t,e,n,r,i);const o=r.getCenter();var{__data__:t,style:e}=a,{radius:e=0,inset:s=0,fillOpacity:l=1,strokeOpacity:c=1,opacity:u=1}=e,{points:t,y:f,y1:h}=t;const d=V1().cornerRadius(e).padAngle(s*Math.PI/180),p=Y0(r,t,[f,h]),{startAngle:g,endAngle:m}=p,y=new nt.Path({}),v=t=>{y.attr({d:d(t),transform:`translate(${o[0]}, ${o[1]})`});t=nt.convertToPath(y);return y.style.transform="",t};e=[{waveInArcAngle:g+1e-4,fillOpacity:0,strokeOpacity:0,opacity:0},{waveInArcAngle:g+1e-4,fillOpacity:l,strokeOpacity:c,opacity:u,offset:.01},{waveInArcAngle:m,fillOpacity:l,strokeOpacity:c,opacity:u}],s=a.animate(e,vw(i,n,b));return s.onframe=function(){a.style.path=v(Object.assign(Object.assign({},p),{endAngle:Number(a.style.waveInArcAngle)}))},s.onfinish=function(){a.style.path=v(Object.assign(Object.assign({},p),{endAngle:m}))},s}}),Iw=(Rw.props={},c=>{return(t,e,n,r,i)=>{const[a]=t;var{transform:t="",fillOpacity:o=1,strokeOpacity:s=1,opacity:l=1}=a.style,t=[{transform:(t+" scale(0.0001)").trimStart(),fillOpacity:0,strokeOpacity:0,opacity:0},{transform:(t+" scale(0.0001)").trimStart(),fillOpacity:o,strokeOpacity:s,opacity:l,offset:.01},{transform:(t+" scale(1)").trimStart(),fillOpacity:o,strokeOpacity:s,opacity:l}],{width:o,height:s}=a.getBoundingClientRect(),l=(a.setOrigin([o/2,s/2]),a.animate(t,vw(i,n,c)));return l.finished.then(()=>a.setOrigin(0,0)),l}}),Bw=c=>{return(t,e,n,r,i)=>{const[a]=t;var{transform:t="",fillOpacity:o=1,strokeOpacity:s=1,opacity:l=1}=a.style,o=[{transform:(t+" scale(1)").trimStart()},{transform:(t+" scale(0.0001)").trimStart(),fillOpacity:o,strokeOpacity:s,opacity:l,offset:.99},{transform:(t+" scale(0.0001)").trimStart(),fillOpacity:0,strokeOpacity:0,opacity:0}],{width:s,height:l}=a.getBoundingClientRect(),t=(a.setOrigin([s/2,l/2]),a.animate(o,vw(i,n,c)));return t.finished.then(()=>a.setOrigin(0,0)),t}},Fw=o=>(t,e,n,r,i)=>{var[t]=t,a=(null==(a=t.getTotalLength)?void 0:a.call(t))||0;return t.animate([{lineDash:[0,a]},{lineDash:[a,0]}],vw(i,n,o))},Dw=(Fw.props={},l=>(t,e,n,r,i)=>{const[a]=t;var{height:t,width:o}=a.getBoundingClientRect();const s=new nt.Path({style:{path:`M0,0L${o},0L${o},${t}L0,${t}Z`}});a.appendChild(s),a.style.clipPath=s;o=Mw(l)([s],e,n,r,i);return o.finished.then(()=>{s.remove(),a.style.clipPath=null}),o}),zw=(Dw.props={},l=>(t,e,n,r,i)=>{const[a]=t;var{height:t,width:o}=a.getBoundingClientRect();const s=new nt.Path({style:{path:`M0,0L${o},0L${o},${t}L0,${t}Z`}});a.appendChild(s),a.style.clipPath=s;o=kw(l)([s],e,n,r,i);return o.finished.then(()=>{s.remove(),a.style.clipPath=null}),o}),Ww=(zw.props={},{visibility:"visible",opacity:1,fillOpacity:1,strokeOpacity:1});function Gw(t,e,n,r){t.style[e]=n,r&&t.children.forEach(t=>Gw(t,e,n,r))}function qw(t){Gw(t,"visibility","hidden",!0)}function Hw(t){Gw(t,"visibility","visible",!0)}function Vw(t){return ot(t).selectAll("."+lt).nodes().filter(t=>!t.__removed__)}function Yw(t,e){return $w(t,e).flatMap(({container:t})=>Vw(t))}function $w(e,t){return t.filter(t=>t!==e&&t.options.parentKey===e.options.key)}function Uw(t){return ot(t).select("."+ct).node()}function Kw(t,e){var{offsetX:e,offsetY:n}=e,{min:[t,r],max:[i,a]}=t.getRenderBounds();return e<t||i<e||(n<r||a<n)?null:[e-t,n-r]}function Xw(t,e){var{offsetX:e,offsetY:n}=e,[t,r,i,a]=function(t){var t=t.getRenderBounds(),{min:[t,e],max:[n,r]}=t;return[t,e,n,r]}(t);return[Math.min(i,Math.max(t,e))-t,Math.min(a,Math.max(r,n))-r]}function Zw(t){return t=>t.__data__.color}function Qw(t){const e=t.scale["x"];return t=>{t=t.__data__.x;return e.invert(t)}}function Jw(t){t=Array.isArray(t)?t:[t];const r=new Map(t.flatMap(e=>{return Array.from(e.markState.keys()).map(t=>[e.key+","+t.key,t.data])}));return t=>{var{index:t,markKey:e,viewKey:n}=t.__data__;return r.get(n+","+e)[t]}}function t5(s,l=(t,e)=>t,c=(t,e,n)=>t.setAttribute(e,n)){const u="__states__",f="__ordinal__",i=t=>{var{[u]:e=[],[f]:n={}}=t,e=e.reduce((t,e)=>Object.assign(Object.assign({},t),s[e]),n);if(0!==Object.keys(e).length){for(var[r,i]of Object.entries(e)){a=t,o=r;var a=null!=(a=t.style[o])?a:Ww[o],o=l(i,t);c(t,r,o),r in n||(n[r]=a)}t[f]=n}},a=t=>{t[u]||(t[u]=[])};return{setState:(t,...e)=>{a(t),t[u]=[...e],i(t)},removeState:(t,...e)=>{a(t);for(const r of e){var n=t[u].indexOf(r);-1!==n&&t[u].splice(n,1)}i(t)},hasState:(t,e)=>(a(t),-1!==t[u].indexOf(e))}}function e5(t,e){var n=(Array.isArray(t)?t:[t]).flatMap(e=>e.marks.map(t=>[e.key+","+t.key,t.state])),r={};for(const i of e){const[l,c]=Array.isArray(i)?i:[i,{}];r[l]=n.reduce((t,e)=>{const[a,n={}]=e;e=void 0===(e=n[l])||"object"==typeof e&&0===Object.keys(e).length?c:n[l];for(const[r,o]of Object.entries(e)){const s=t[r];t[r]=(t,e,n,r)=>{var i=r.__data__.viewKey+","+r.__data__.markKey;return a!==i?null===s||void 0===s?void 0:s(t,e,n,r):"function"!=typeof o?o:o(t,e,n,r)}}return t},{})}return r}function n5(t,r){const i=new Map(t.map((t,e)=>[t,e])),a=r?t.map(r):t;return(t,e)=>{var n;return"function"!=typeof t?t:(n=i.get(e),t(r?r(e):e,n,a,e))}}function r5(t){var{link:e=!1,valueof:l=(t,e)=>t}=t,c=rt(t,["link","valueof","coordinate"]);if(!e)return[()=>{},()=>{}];const u=t=>t.__data__.points;return[t=>{if(!(t.length<=1)){var e=Oc(t,(t,e)=>{t=t.__data__.x,e=e.__data__.x;return t-e});for(let t=1;t<e.length;t++){var n=B1();const s=e[t-1];var r=e[t],[r,i,a,o]=((t,e)=>{var[,t,n]=t,[e,,,r]=e;return[t,e,r,n]})(u(s),u(r)),r=(n.moveTo(...r),n.lineTo(...i),n.lineTo(...a),n.lineTo(...o),n.closePath(),T0(c,t=>l(t,s))),{fill:i=s.getAttribute("fill")}=r,a=rt(r,["fill"]),o=new nt.Path({className:"element-link",style:Object.assign({d:n.toString(),fill:i,zIndex:-2},a)});null!=(r=s.link)&&r.remove(),s.parentNode.appendChild(o),s.link=o}}},t=>{var e;null!=(e=t.link)&&e.remove(),t.link=null}]}function i5(n,t,e){var r,i,a,o=t=>{var e=n.style["transform"];return e?e+" "+t:t};return Kc(e)?(a=n.__data__["points"],[a,i]=Uc(e)?V0(a):a,r=R0(a,a=e.getCenter()),i=R0(i,a),a=F0(r)+z0(r,i)/2,o(`translate(${t*Math.cos(a)}, ${t*Math.sin(a)})`)):Uc(e)?o(`translate(${t}, 0)`):o(`translate(0, ${-t})`)}function a5(t){var{background:e,scale:s,coordinate:l,valueof:c}=t,u=rt(t,["background","scale","coordinate","valueof"]);const f="element-background";if(!e)return[()=>{},()=>{}];const r=(t,e,n)=>{var r=t.invert(e),e=e+t.getBandWidth(r)/2,t=t.getStep(r)/2,r=t*n;return[e-t+r,e+t-r]},h=(t,e)=>{var n=s["x"];return ow(n)?(t=t["__data__"],t=t["x"],[n,t]=r(n,t,e),[n,t]):[0,1]},d=(t,e)=>{var n=s["y"];return ow(n)?(t=t["__data__"],t=t["y"],[n,t]=r(n,t,e),[n,t]):[0,1]},p=(t,e)=>{var n=e["padding"],[r,i]=h(t,n),[n,a]=d(t,n),t=t["__data__"],{y:t,y1:o}=t;return bg([[r,n],[i,n],[i,a],[r,a]].map(t=>l.map(t)),{y:t,y1:o},l,e)},g=(t,e)=>{var n,r,{transform:i="scale(1.2, 1.2)",transformOrigin:a="center center",stroke:o=""}=e,e=rt(e,["transform","transformOrigin","stroke"]),i=Object.assign({transform:i,transformOrigin:a,stroke:o},e),s=t.cloneNode(!0);for([n,r]of Object.entries(i))s.style[n]=r;return s};return[e=>{e.background&&e.background.remove();var t=T0(u,t=>c(t,e)),{fill:n="#CCD6EC",fillOpacity:r=.3,zIndex:i=-2,padding:a=.001,strokeWidth:o=0}=t,t=rt(t,["fill","fillOpacity","zIndex","padding","strokeWidth"]),t=Object.assign(Object.assign({},t),{fill:n,fillOpacity:r,zIndex:i,padding:a,strokeWidth:o}),n=((()=>{var{x:t,y:e}=s;return[t,e].some(ow)})()?p:g)(e,t);n.className=f,e.parentNode.appendChild(n),e.background=n},t=>{var e;null!=(e=t.background)&&e.remove(),t.background=null},t=>t.className===f]}function o5(t,e){t=t.getRootNode().defaultView.getContextService().getDomElement();null!=t&&t.style&&(t.style.cursor=e)}function s5(t,e,r){return t.find(n=>Object.entries(e).every(([t,e])=>r(n)[t]===e))}function l5(e,{elements:t,datum:a,groupKey:o=t=>t,link:n=!1,background:r=!1,delay:i=60,scale:s,coordinate:l,emitter:c,state:u={}}){const f=t(e),h=new Set(f),d=bc(f,o);t=n5(f,a);const[p,g]=r5(Object.assign({elements:f,valueof:t,link:n,coordinate:l},at(u.active,"link"))),[m,y,v]=a5(Object.assign({scale:s,coordinate:l,background:r,valueof:t},at(u.active,"background"))),{setState:b,removeState:x,hasState:w}=t5(it(u,{active:Object.assign({},(null==(n=u.active)?void 0:n.offset)&&{transform:(...t)=>{var e=u.active.offset(...t),[,t]=t;return i5(f[t],e,l)}})}),t);let M;const O=t=>{var{target:e,nativeEvent:t=!0}=t;if(h.has(e)){M&&clearTimeout(M);var n=o(e),n=d.get(n),r=new Set(n);for(const i of f)r.has(i)?w(i,"active")||b(i,"active"):(b(i,"inactive"),g(i)),i!==e&&y(i);m(e),p(n),t&&c.emit("element:highlight",{nativeEvent:t,data:{data:a(e),group:n.map(a)}})}},k=(t=!0)=>{for(const e of f)x(e,"active","inactive"),y(e),g(e);t&&c.emit("element:unhighlight",{nativeEvent:t})},_=t=>{t=t.target;r&&!v(t)||(r||h.has(t))&&(0<i?(M&&clearTimeout(M),M=setTimeout(()=>{k(),M=null},i)):k())},E=()=>{k()},S=(e.addEventListener("pointerover",O),e.addEventListener("pointerout",_),e.addEventListener("pointerleave",E),t=>{t=t.nativeEvent;t||k(!1)}),A=t=>{var e=t["nativeEvent"];!e&&(e=t.data["data"],t=s5(f,e,a))&&O({target:t,nativeEvent:!1})};return c.on("element:highlight",A),c.on("element:unhighlight",S),()=>{e.removeEventListener("pointerover",O),e.removeEventListener("pointerout",_),e.removeEventListener("pointerleave",E),c.off("element:highlight",A),c.off("element:unhighlight",S);for(const t of f)y(t),g(t)}}function c5(t){var{delay:s,createGroup:l,background:c=!1,link:u=!1}=t,f=rt(t,["delay","createGroup","background","link"]);return(t,e,n)=>{var{container:t,view:r,options:i}=t,{scale:a,coordinate:o}=r;return l5(Uw(t),Object.assign({elements:Vw,datum:Jw(r),groupKey:l?l(r):void 0,coordinate:o,scale:a,state:e5(i,[["active",c?{}:{lineWidth:"1",stroke:"#000"}],"inactive"]),background:c,link:u,delay:s,emitter:n},f))}}function u5(t){return c5(Object.assign(Object.assign({},t),{createGroup:Qw}))}function f5(t){return c5(Object.assign(Object.assign({},t),{createGroup:Zw}))}function h5(e,{elements:t,datum:h,groupKey:d=t=>t,link:p=!1,single:g=!1,coordinate:n,background:r=!1,scale:i,emitter:m,state:a={}}){const y=t(e),v=new Set(y),b=bc(y,d);t=n5(y,h);const[x,w]=r5(Object.assign({link:p,elements:y,valueof:t,coordinate:n},at(a.selected,"link"))),[M,O]=a5(Object.assign({background:r,coordinate:n,scale:i,valueof:t},at(a.selected,"background"))),{setState:k,removeState:o,hasState:_}=t5(it(a,{selected:Object.assign({},(null==(r=a.selected)?void 0:r.offset)&&{transform:(...t)=>{var e=a.selected.offset(...t),[,t]=t;return i5(y[t],e,n)}})}),t),E=(t=!0)=>{for(const e of y)o(e,"selected","unselected"),w(e),O(e);t&&m.emit("element:unselect",{nativeEvent:!0})},s=t=>{var{target:e,nativeEvent:n=!0}=t;if(!v.has(e))return E();if(g){var[r,i,a=!0]=[t,e,n];if(_(i,"selected"))E();else{var o=d(i),o=b.get(o),s=new Set(o);for(const l of y)s.has(l)?k(l,"selected"):(k(l,"unselected"),w(l)),l!==i&&O(l);x(o),M(i),a&&m.emit("element:select",Object.assign(Object.assign({},r),{nativeEvent:a,data:{data:[h(i),...o.map(h)]}}))}}else{var[r,a,o=!0]=[t,e,n];t=d(a),t=b.get(t);const c=new Set(t);if(_(a,"selected")){if(!y.some(t=>!c.has(t)&&_(t,"selected")))return E();for(const u of t)k(u,"unselected"),w(u),O(u)}else{e=t.some(t=>_(t,"selected"));for(const f of y)c.has(f)?k(f,"selected"):_(f,"selected")||k(f,"unselected");!e&&p&&x(t),M(a)}o&&m.emit("element:select",Object.assign(Object.assign({},r),{nativeEvent:o,data:{data:y.filter(t=>_(t,"selected")).map(h)}}))}},l=(e.addEventListener("click",s),t=>{var{nativeEvent:t,data:e}=t;if(!t)for(const r of g?e.data.slice(0,1):e.data){var n=s5(y,r,h);s({target:n,nativeEvent:!1})}}),c=()=>{E(!1)};return m.on("element:select",l),m.on("element:unselect",c),()=>{for(const t of y)w(t);e.removeEventListener("click",s),m.off("element:select",l),m.off("element:unselect",c)}}function d5(t){var{createGroup:s,background:l=!1,link:c=!1}=t,u=rt(t,["createGroup","background","link"]);return(t,e,n)=>{var{container:t,view:r,options:i}=t,{coordinate:a,scale:o}=r;return h5(Uw(t),Object.assign({elements:Vw,datum:Jw(r),groupKey:s?s(r):void 0,coordinate:a,scale:o,state:e5(i,[["selected",l?{}:{lineWidth:"1",stroke:"#000"}],"unselected"]),background:l,link:c,emitter:n},u))}}function p5(t){return d5(Object.assign(Object.assign({},t),{createGroup:Qw}))}function g5(t){return d5(Object.assign(Object.assign({},t),{createGroup:Zw}))}function m5(t){var{wait:k=20,leading:_,trailing:E=!1,labelFormatter:S=t=>""+t}=t,A=rt(t,["wait","leading","trailing","labelFormatter"]);return t=>{const{options:e,view:n,container:r,update:i}=t,{markState:a,scale:o,coordinate:s}=n;t=function(t,e,r){var[t]=Array.from(t.entries()).filter(([t])=>t.type===e).map(([t])=>{const n=t["encode"];return Object.fromEntries(r.map(t=>{var e=n[t];return[t,e?e.value:void 0]}))});return t}(a,"line",["x","y","series"]);if(!t)return;const{y:h,x:d,series:l=[]}=t;t=h.map((t,e)=>e);const c=Oc(t.map(t=>d[t])),u=it({},e),f=u.marks.find(t=>"line"===t.type);t=Rc(xc(t,t=>Rc(t,t=>+h[t])/Bc(t,t=>+h[t]),t=>l[t]).values());it(f,{scale:{y:{domain:[1/t,t]}}});const p=Uw(r),g=r.getElementsByClassName(lt);const m=bc(r.getElementsByClassName(ft),t=>t.__data__.key.split("-")[0]),y=new nt.Line({style:Object.assign({x1:0,y1:0,x2:0,y2:p.getAttribute("height"),stroke:"black",lineWidth:1},at(A,"rule"))}),v=new nt.Text({style:Object.assign({x:0,y:p.getAttribute("height"),text:"",fontSize:10},at(A,"label"))}),b=(y.append(v),p.appendChild(y),(t,e,n)=>{var[t]=t.invert(n),n=e.invert(t);return c[fc(c,n)]}),x=(t,e)=>{y.setAttribute("x1",t[0]),y.setAttribute("x2",t[0]),v.setAttribute("text",S(e))};let w;var M;const O=un(t=>{t=Kw(p,t);if(t){var{scale:e,coordinate:n}=w,{x:e,y:r}=e,i=b(n,e,t);x(t,i);for(const u of g){var{seriesIndex:a,key:o}=u.__data__,s=a[oc(t=>d[+t]).center(a,i)],l=[0,r.map(1)],s=[0,r.map(h[s]/h[a[0]])],[,a]=n.map(l),[,l]=n.map(s),c=a-l,s=(u.setAttribute("transform",`translate(0, ${c})`),m.get(o)||[]);for(const f of s)f.setAttribute("dy",c)}}},k,{leading:_,trailing:E});return M=[0,0],ue(this,void 0,void 0,function*(){var t=o["x"];const n=b(s,t,M);x(M,n);t=function(t){var{transform:e=[]}=t,n=e.find(t=>"normalizeY"===t.type);return n||(e.push(n={type:"normalizeY"}),t.transform=e,n)}(f);t.groupBy="color",t.basis=(t,e)=>{return e[t[oc(t=>d[+t]).center(t,n)]]};for(const e of u.marks)e.animate=!1;t=yield i(u);w=t.view}),p.addEventListener("pointerenter",O),p.addEventListener("pointermove",O),p.addEventListener("pointerleave",O),()=>{y.remove(),p.removeEventListener("pointerenter",O),p.removeEventListener("pointermove",O),p.removeEventListener("pointerleave",O)}}}function y5({wait:l=30,leading:c,trailing:u=!1}){return t=>{const{options:r,update:i,container:e}=t,a=Uw(e),o=it({},r);for(const s of o.marks)s.animate=!1;const n=un(t=>{var e,n,t=Kw(a,t);t?([t,e]=t,(n=function(t){var{coordinate:e={}}=t,{transform:n=[]}=e,r=n.find(t=>"fisheye"===t.type);return r||(n.push(r={type:"fisheye"}),e.transform=n,t.coordinate=e,r)}(o)).focusX=t,n.focusY=e,n.visual=!0,i(o)):i(r)},l,{leading:c,trailing:u});return a.addEventListener("pointerenter",n),a.addEventListener("pointermove",n),a.addEventListener("pointerleave",n),()=>{a.removeEventListener("pointerenter",n),a.removeEventListener("pointermove",n),a.removeEventListener("pointerleave",n)}}}const $=new Proxy({BEFORE_RENDER:"beforerender",AFTER_RENDER:"afterrender",BEFORE_PAINT:"beforepaint",AFTER_PAINT:"afterpaint",BEFORE_CHANGE_DATA:"beforechangedata",AFTER_CHANGE_DATA:"afterchangedata",BEFORE_CLEAR:"beforeclear",AFTER_CLEAR:"afterclear",BEFORE_DESTROY:"beforedestroy",AFTER_DESTROY:"afterdestroy",BEFORE_CHANGE_SIZE:"beforechangesize",AFTER_CHANGE_SIZE:"afterchangesize",POINTER_TAP:"pointertap",POINTER_DOWN:"pointerdown",POINTER_UP:"pointerup",POINTER_OVER:"pointerover",POINTER_OUT:"pointerout",POINTER_MOVE:"pointermove",POINTER_ENTER:"pointerenter",POINTER_LEAVE:"pointerleave",POINTER_UPOUTSIDE:"pointerupoutside",DRAG_START:"dragstart",DRAG:"drag",DRAG_END:"dragend",DRAG_ENTER:"dragenter",DRAG_LEAVE:"dragleave",DRAG_OVER:"dragover",DROP:"DROP",CLICK:"click",DBLCLICK:"dblclick"},{get(t,e){if(e in t)return t[e]},set(){return!0}});function v5(t,e){t=t.__data__;const{markKey:n,index:r,seriesIndex:i}=t;t=e.markState;const a=Array.from(t.keys()).find(t=>t.key===n);if(a)return i?i.map(t=>a.data[t]):a.data[r]}function b5(i,a,o,s=t=>!0){return t=>{var e,n,r;s(t)&&(o.emit("plot:"+i,t),r=t["target"],r)&&({className:e,markType:n}=r,"plot"!==e)&&("element"===e?(r=Object.assign(Object.assign({},t),{nativeEvent:!0,data:{data:v5(r,a)}}),o.emit("element:"+i,r),o.emit(n+":"+i,r)):o.emit(e+":"+i,t))}}function x5(){return(t,e,n)=>{const{container:r,view:i}=t,a=b5($.CLICK,i,n,t=>1===t.detail),o=b5($.DBLCLICK,i,n,t=>2===t.detail),s=b5($.POINTER_TAP,i,n),l=b5($.POINTER_DOWN,i,n),c=b5($.POINTER_UP,i,n),u=b5($.POINTER_OVER,i,n),f=b5($.POINTER_OUT,i,n),h=b5($.POINTER_MOVE,i,n),d=b5($.POINTER_ENTER,i,n),p=b5($.POINTER_LEAVE,i,n),g=b5($.POINTER_UPOUTSIDE,i,n),m=b5($.DRAG_START,i,n),y=b5($.DRAG,i,n),v=b5($.DRAG_END,i,n),b=b5($.DRAG_ENTER,i,n),x=b5($.DRAG_LEAVE,i,n),w=b5($.DRAG_OVER,i,n),M=b5($.DROP,i,n);return r.addEventListener("click",a),r.addEventListener("click",o),r.addEventListener("pointertap",s),r.addEventListener("pointerdown",l),r.addEventListener("pointerup",c),r.addEventListener("pointerover",u),r.addEventListener("pointerout",f),r.addEventListener("pointermove",h),r.addEventListener("pointerenter",d),r.addEventListener("pointerleave",p),r.addEventListener("pointerupoutside",g),r.addEventListener("dragstart",m),r.addEventListener("drag",y),r.addEventListener("dragend",v),r.addEventListener("dragenter",b),r.addEventListener("dragleave",x),r.addEventListener("dragover",w),r.addEventListener("drop",M),()=>{r.removeEventListener("click",a),r.removeEventListener("click",o),r.removeEventListener("pointertap",s),r.removeEventListener("pointerdown",l),r.removeEventListener("pointerup",c),r.removeEventListener("pointerover",u),r.removeEventListener("pointerout",f),r.removeEventListener("pointermove",h),r.removeEventListener("pointerenter",d),r.removeEventListener("pointerleave",p),r.removeEventListener("pointerupoutside",g),r.removeEventListener("dragstart",m),r.removeEventListener("drag",y),r.removeEventListener("dragend",v),r.removeEventListener("dragenter",b),r.removeEventListener("dragleave",x),r.removeEventListener("dragover",w),r.removeEventListener("drop",M)}}}function w5(t,e){return e?"string"==typeof e?document.querySelector(e):e:t.getRootNode().defaultView.getConfig().container}function M5({root:t,data:e,x:n,y:r,render:i,event:a,single:o,position:s="right-bottom",enterable:l=!1,mount:c,bounding:u}){var f,h,d=t.getRootNode().defaultView.getConfig().container,o=o?w5(t,c):t,c=u||function(t){var{min:[t,e],max:[n,r]}=t.getBounds();return{x:t,y:e,width:n-t,height:r-e}}(t),d=(u=o,t=(t=d).getBoundingClientRect(),u=u.getBoundingClientRect(),{x:t.x-u.x,y:t.y-u.y}),{tooltipElement:p=(t=o,u=n,p=r,f=s,h=l,c=c,d=d,u=new u2({className:"tooltip",style:{x:u,y:p,container:d,data:[],bounding:c,position:f,enterable:h,title:"",offset:[10,10],template:{prefixCls:"g2-"},style:{".g2-tooltip":{},".g2-tooltip-title":{overflow:"hidden","white-space":"nowrap","text-overflow":"ellipsis"}}}}),t.appendChild(u.HTMLTooltipElement),u)}=o,{items:d,title:c=""}=e;p.update(Object.assign({x:n,y:r,data:d,title:c,position:s,enterable:l},void 0!==i&&{content:i(a,{items:d,title:c})})),o.tooltipElement=p}function O5({root:t,single:e,emitter:n,nativeEvent:r=!0,mount:i}){e=(e?w5(t,i):t).tooltipElement;e&&(e.hide(),r)&&n.emit("tooltip:hide",{nativeEvent:r})}function k5(t){var e=t["tooltipElement"];e&&(e.destroy(),t.tooltipElement=void 0)}function _5(t){var e=t["value"];return Object.assign(Object.assign({},t),{value:void 0===e?"undefined":e})}function E5(t,e){var{color:t,series:n}=t,{color:e,series:r}=e,i=t=>t&&t.invert&&!(t instanceof Jp)&&!(t instanceof Up);return i(n)?n.invert(r):r&&r!==e?r:!i(t)||(n=t.invert(e),Array.isArray(n))?null:n}function S5(t){var e=t.getAttribute("fill"),n=t.getAttribute("stroke"),t=t["__data__"],{color:t=e&&"transparent"!==e?e:n}=t;return t}function A5(t,e=t=>t){t=new Map(t.map(t=>[e(t),t]));return Array.from(t.values())}function L5(n,s,l,t=n.map(t=>t.__data__)){const e=t=>t instanceof Date?+t:t;var r=A5(t.map(t=>t.title),e).filter(qu),t=t.flatMap((r,t)=>{const i=n[t],{items:e=[],title:a}=r;t=e.filter(qu);const o=void 0!==l?l:e.length<=1;return t.map(t=>{var{color:e=S5(i),name:n}=t,t=rt(t,["color","name"]),n=o?E5(s,r)||n:n||E5(s,r);return Object.assign(Object.assign({},t),{color:e,name:n||a})})}).map(_5);return Object.assign(Object.assign({},0<r.length&&{title:r.join(",")}),{items:A5(t,t=>`(${e(t.name)}, ${e(t.value)}, ${e(t.color)})`)})}function T5(t){t.ruleY&&(t.ruleY.remove(),t.ruleY=void 0)}function j5(t,e){return Array.from(t.values()).some(t=>{return null==(t=t.interaction)?void 0:t[e]})}function N5(t,e){return void 0===t?e:t}function P5(t){var{title:t,items:e}=t;return 0===e.length&&void 0===t}function C5(S,t){var{elements:e,sort:A,filter:L,scale:T,coordinate:j,crosshairs:N,render:P,groupName:C,emitter:R,wait:n=50,leading:r=!0,trailing:i=!1,startX:I=0,startY:B=0,body:F=!0,single:D=!0,position:z,enterable:W,mount:G,bounding:q,style:a={}}=t,t=rt(t,["elements","sort","filter","scale","coordinate","crosshairs","render","groupName","emitter","wait","leading","trailing","startX","startY","body","single","position","enterable","mount","bounding","style"]),e=e(S);const H=Uc(j),V=Kc(j);a=it(a,t);const{innerWidth:Y,innerHeight:Q}=j.getOptions(),$=[],U=[];for(const u of e){var o=u["__data__"],o=o["seriesX"];(o?$:U).push(u)}$.sort((t,e)=>{const n=H?0:1;var r=t=>t.getBounds().min[n];return H?r(e)-r(t):r(t)-r(e)});const J=new Map($.map(t=>{var e=t["__data__"];const n=e["seriesX"];return[t,[Oc(n.map((t,e)=>e),t=>n[+t]),n]]})),tt=at(a,"crosshairs");t=T.x;const K=null!=t&&t.getBandWidth?t.getBandWidth()/2:0,X=t=>{var[t]=j.invert(t);return t-K},et=(t,e)=>{const n=H?1:0,r=t[n];return e.filter(t=>{var[t,e]=(t=>{var{min:t,max:e}=t.getLocalBounds();return Oc([t[n],e[n]])})(t);return r>=t&&r<=e})},s=un(t=>{var e=Kw(S,t);if(e){var n=S.getRenderBounds();const g=n.min[0],m=n.min[1],y=[e[0]-I,e[1]-B];y;var n=et(y,U),r=[],i=[];for(const b of $){var[a,o]=J.get(b),a=((t,e,n)=>{var t=X(t),[r,i]=Oc([n[0],n[n.length-1]]);return t<r||i<t?null:e[(0,oc(t=>n[+t]).center)(e,t)]})(y,a,o);if(null!==a){r.push(b);o=((t,n)=>{t=t.__data__;return Object.fromEntries(Object.entries(t).filter(([t])=>t.startsWith("series")&&"series"!==t).map(([t,e])=>{e=e[n];return[Xe(t.replace("series","")),e]}))})(b,a);const{x:g,y:m}=o;a=j.map([(g||0)+K,m||0]);i.push([o,a])}}var s=Array.from(new Set(i.map(t=>t[0].x)));const v=s[Fc(s,t=>Math.abs(t-X(y)))];var s=i.filter(t=>t[0].x===v),l=[...s.map(t=>t[0]),...n.map(t=>t.__data__)],n=[...r,...n],l=L5(n,T,C,l);if(A&&l.items.sort((t,e)=>A(t)-A(e)),L&&(l.items=l.items.filter(L)),0===n.length||P5(l))Z();else{if(F&&M5({root:S,data:l,x:e[0]+g,y:e[1]+m,render:P,event:t,single:D,position:z,enterable:W,mount:G,bounding:q}),N){n=s.map(t=>t[1]);{l=S;e=n;s=Object.assign(Object.assign({},tt),{width:Y,height:Q,startX:I,startY:B,transposed:H,polar:V});var c,{height:n,width:u,startX:f,startY:h,transposed:d,polar:p}=s,s=rt(s,["height","width","startX","startY","transposed","polar"]);const x=Object.assign({lineWidth:1,stroke:"#1b1e23",strokeOpacity:.5},s),w=(s=e.map(t=>t[1]),e=e.map(t=>t[0]),qc(s)),M=qc(e),[O,k,_,E]=p?(s=f+u/2,e=h+n/2,p=Math.min(u,n)/2,c=F0(R0([M,w],[s,e])),[s,s+p*Math.cos(c),e,e+p*Math.sin(c)]):d?[f,f+u,w+h,w+h]:[M+f,M+f,h,h+n];(e=l.ruleY||(s=new nt.Line({style:Object.assign({x1:O,x2:k,y1:_,y2:E},x)}),l.appendChild(s),s)).style.x1=O,e.style.x2=k,e.style.y1=_,e.style.y2=E,l.ruleY=e}}R.emit("tooltip:show",Object.assign(Object.assign({},t),{nativeEvent:!0,data:{data:{x:sw(T.x,X(y),!0)}}}))}}},n,{leading:r,trailing:i}),Z=()=>{O5({root:S,single:D,emitter:R,mount:G}),N&&T5(S)},l=({nativeEvent:t,data:e})=>{var n,r;t||(t=e.data["x"],e=T["x"],e=e.map(t),[t,e]=j.map([e,.5]),[n,r]=S.getRenderBounds()["min"],s({offsetX:t+n,offsetY:e+r}))},c=()=>{O5({root:S,single:D,emitter:R,nativeEvent:!1,mount:G})};return R.on("tooltip:show",l),R.on("tooltip:hide",c),S.addEventListener("pointerenter",s),S.addEventListener("pointermove",s),S.addEventListener("pointerleave",Z),()=>{S.removeEventListener("pointerenter",s),S.removeEventListener("pointermove",s),S.removeEventListener("pointerleave",Z),R.off("tooltip:show",l),R.off("tooltip:hide",c),k5(S),N&&T5(S)}}function R5(a,{elements:t,scale:o,render:s,groupName:l,sort:c,filter:u,emitter:f,wait:e=50,leading:n=!0,trailing:r=!1,groupKey:h=t=>t,single:d=!0,position:p,enterable:g,datum:m,view:y,mount:v,bounding:b}){const x=t(a),w=new Set(x),M=bc(x,h),O=un(t=>{var e,n,r,i=t["target"];!w.has(i)||(e=h(i),e=1===(e=M.get(e)).length?function(n){var{title:t,items:e=[]}=t=n["__data__"],e=e.filter(qu).map(t=>{var{color:e=S5(n)}=t,t=rt(t,["color"]);return Object.assign(Object.assign({},t),{color:e})}).map(_5);return Object.assign(Object.assign({},t&&{title:t}),{items:e})}(e[0]):L5(e,o,l),c&&e.items.sort((t,e)=>c(t)-c(e)),u&&(e.items=e.items.filter(u)),P5(e))?O5({root:a,single:d,emitter:f,mount:v}):({offsetX:n,offsetY:r}=t,M5({root:a,data:e,x:n,y:r,render:s,event:t,single:d,position:p,enterable:g,mount:v,bounding:b}),f.emit("tooltip:show",Object.assign(Object.assign({},t),{nativeEvent:!0,data:{data:v5(i,y)}})))},e,{leading:n,trailing:r}),i=t=>{t=t.target;w.has(t)&&O5({root:a,single:d,emitter:f,mount:v})},k=({nativeEvent:t,data:e})=>{var n,r,i;t||(t=s5(x,e.data,m))&&({x:e,y:n,width:r,height:i}=t.getBBox(),O({target:t,offsetX:e+r/2,offsetY:n+i/2}))},_=({nativeEvent:t}={})=>{t||O5({root:a,single:d,emitter:f,nativeEvent:!1,mount:v})};return f.on("tooltip:show",k),f.on("tooltip:hide",_),a.addEventListener("pointerover",O),a.addEventListener("pointermove",O),a.addEventListener("pointerout",i),()=>{a.removeEventListener("pointerover",O),a.removeEventListener("pointermove",O),a.removeEventListener("pointerout",i),f.off("tooltip:show",k),f.off("tooltip:hide",_),k5(a)}}function I5(t){const{shared:f,crosshairs:h,series:d,item:p=()=>({}),facet:g=!1}=t,m=rt(t,["shared","crosshairs","series","name","item","facet"]);return(e,t,n)=>{var{container:r,view:i}=e;const{scale:a,markState:o,coordinate:s}=i;var l=j5(o,"seriesTooltip"),c=j5(o,"crosshairs"),r=Uw(r),l=N5(d,l);if(l&&Array.from(o.values()).some(t=>{var e;return(null==(e=t.interaction)?void 0:e.seriesTooltip)&&t.tooltip})&&!g)return C5(r,Object.assign(Object.assign({},m),{elements:Vw,scale:a,coordinate:s,crosshairs:N5(h,c),item:p,emitter:n}));if(l&&g){l=t.filter(t=>t!==e&&t.options.parentKey===e.options.key);const u=Yw(e,t),a=l[0].view.scale;t=r.getBounds(),l=t.min[0],t=t.min[1];return C5(r.parentNode.parentNode,Object.assign(Object.assign({},m),{elements:()=>u,scale:a,coordinate:s,crosshairs:N5(h,c),item:p,startX:l,startY:t,emitter:n}))}return R5(r,Object.assign(Object.assign({},m),{datum:Jw(i),elements:Vw,scale:a,coordinate:s,groupKey:f?Qw(i):void 0,item:p,emitter:n,view:i}))}}const B5="legend-category",F5="items-item",D5="legend-category-item-marker",z5="legend-category-item-label";function W5(t){return t.getElementsByClassName(D5)[0]}function G5(t){return t.getElementsByClassName(z5)[0]}function q5(t){return t.getElementsByClassName(F5)}function H5(t){return t.getElementsByClassName(B5)}function V5(t){let e=t.parentNode;for(;e&&!e.__data__;)e=e.parentNode;return e.__data__}function Y5(t,{legends:e,marker:i,label:a,datum:o,filter:r,emitter:s,channel:l,state:n={}}){const c=new Map,u=new Map,f=new Map;var{unselected:n={markerStroke:"#aaa",markerFill:"#aaa",labelFill:"#aaa"}}=n,h={unselected:at(n,"marker")},n={unselected:at(n,"label")};const{setState:d,removeState:p}=t5(h,void 0),{setState:g,removeState:m}=t5(n,void 0),y=Array.from(e(t));let v=y.map(o);const b=()=>{for(const r of y){var t=o(r),e=i(r),n=a(r);(v.includes(t)?(p(e,"unselected"),m):(d(e,"unselected"),g))(n,"unselected")}};for(const _ of y){var x=()=>{o5(t,"pointer")},w=()=>{o5(t,"default")},M=n=>ue(this,void 0,void 0,function*(){var t=o(_),e=v.indexOf(t),{nativeEvent:t=!0}=(-1===e?v.push(t):v.splice(e,1),0===v.length&&v.push(...y.map(o)),yield r(v),b(),n);t&&(v.length===y.length?s.emit("legend:reset",{nativeEvent:t}):s.emit("legend:filter",Object.assign(Object.assign({},n),{nativeEvent:t,data:{channel:l,values:v}})))});_.addEventListener("click",M),_.addEventListener("pointerenter",x),_.addEventListener("pointerout",w),c.set(_,M),u.set(_,x),f.set(_,w)}const O=n=>ue(this,void 0,void 0,function*(){var t,e=n["nativeEvent"];e||(e=n["data"],{channel:e,values:t}=e,e===l&&(v=t,yield r(v),b()))}),k=e=>ue(this,void 0,void 0,function*(){var t=e["nativeEvent"];t||(v=y.map(o),yield r(v),b())});return s.on("legend:filter",O),s.on("legend:reset",k),()=>{for(const t of y)t.removeEventListener("click",c.get(t)),t.removeEventListener("pointerenter",u.get(t)),t.removeEventListener("pointerout",f.get(t)),s.off("legend:filter",O),s.off("legend:reset",k)}}function $5(){return(t,e,r)=>{const{container:i,view:a,options:o,update:s}=t;t=H5(i);const l=(r,i)=>ue(this,void 0,void 0,function*(){var t=a["scale"];const{[r]:n}=t;t=o.marks,t=t.map(t=>{var{transform:e=[]}=t,e=[{type:"filter",[r]:i},...e];return it({},t,{transform:e,scale:{[r]:{domain:n.getOptions().domain}}})}),t=Object.assign(Object.assign({},o),{marks:t});return s(t)}),n=t.map(t=>{const{name:e,domain:n}=V5(t).scales[0];return Y5(i,{legends:q5,marker:W5,label:G5,datum:t=>{t=t.__data__,t=t.index;return n[t]},filter:t=>l(e,t),state:t.attributes.state,channel:e,emitter:r})});return()=>{n.forEach(t=>t())}}}function U5(){return(t,e,a)=>{const{container:n,view:r,options:i}=t;t=H5(n);const o=Vw(n);var s=e5(i,["active","inactive"]),l=n5(o,Jw(r));const c=[];for(const d of t){const p=t=>{var e=d.attributes["data"],t=t["__data__"],t=t["index"];return e[t].label},g=V5(d).scales[0].name,m=q5(d),y=(t=>{var{scale:{[t]:t}}=r;return t})(g),v=bc(o,t=>y.invert(t.__data__[g]));var{state:u={}}=d.attributes,{inactive:u={}}=u;const{setState:b,removeState:x}=t5(s,l);var f={inactive:at(u,"marker")},u={inactive:at(u,"label")};const{setState:w,removeState:M}=t5(f),{setState:O,removeState:k}=t5(u),_=t=>{for(const r of m){var e=W5(r),n=G5(r);(r===t||null===t?(M(e,"inactive"),k):(w(e,"inactive"),O))(n,"inactive")}},E=(t,e)=>{var n=p(e),r=new Set(v.get(n));for(const i of o)r.has(i)?b(i,"active"):b(i,"inactive");_(e);var{nativeEvent:e=!0}=t;e&&a.emit("legend:highlight",Object.assign(Object.assign({},t),{nativeEvent:e,data:{channel:g,value:n}}))},S=new Map;for(const j of m){var h=t=>{E(t,j)};j.addEventListener("pointerover",h),S.set(j,h)}const A=t=>{for(const e of o)x(e,"inactive","active");_(null);var{nativeEvent:t=!0}=t;t&&a.emit("legend:unhighlight",{nativeEvent:t})},L=t=>{var{nativeEvent:t,data:e}=t;if(!t){const{channel:n,value:r}=e;n===g&&(t=m.find(t=>p(t)===r))&&E({nativeEvent:!1},t)}},T=t=>{t=t.nativeEvent;t||A({nativeEvent:!1})};d.addEventListener("pointerleave",A),a.on("legend:highlight",L),a.on("legend:unhighlight",T);c.push(()=>{d.removeEventListener(A),a.off("legend:highlight",L),a.off("legend:unhighlight",T);for(var[t,e]of S)t.removeEventListener(e)})}return()=>c.forEach(t=>t())}}function K5(t,e){for(var[n,r]of Object.entries(e))t.style(n,r)}const X5=Eg(t=>{const e=t.attributes,{x:n,y:r,width:i,height:a,class:o,handleSize:s=10,document:l}=e,c=rt(e,["x","y","width","height","class","renders","handleSize","document"]);if(l&&void 0!==i&&void 0!==a&&void 0!==n&&void 0!==r){var u=s/2,f=(t,e,n)=>{t.handle||(t.handle=n.createElement("rect"),t.append(t.handle));n=t.handle;return n.attr(e),n},h=at(Vu(c,"handleNW","handleNE"),"handleN"),{render:d=f}=h,h=rt(h,["render"]),p=at(c,"handleE"),{render:g=f}=p,p=rt(p,["render"]),m=at(Vu(c,"handleSE","handleSW"),"handleS"),{render:y=f}=m,m=rt(m,["render"]),v=at(c,"handleW"),{render:b=f}=v,v=rt(v,["render"]),x=at(c,"handleNW"),{render:w=f}=x,x=rt(x,["render"]),M=at(c,"handleNE"),{render:O=f}=M,M=rt(M,["render"]),k=at(c,"handleSE"),{render:_=f}=k,k=rt(k,["render"]),E=at(c,"handleSW"),{render:f=f}=E,E=rt(E,["render"]);var S=i=>()=>{return new(Eg(t=>{return e=i,n=(t=t).id,r=rt(t.attributes,["x","y"]),(e=e(t,Object.assign({x:0,y:0},r),l)).id=n,void(e.style.draggable=!0);var e,n,r}))({})},t=ot(t).attr("className",o).style("x",n).style("y",r).style("draggable",!0);t.maybeAppend("selection","rect").style("draggable",!0).style("fill","transparent").call(K5,Object.assign({width:i,height:a},Vu(c,"handle"))),t.maybeAppend("handle-n",S(d)).style("x",u).style("y",-u).style("width",i-s).style("height",s).style("fill","transparent").call(K5,h),t.maybeAppend("handle-e",S(g)).style("x",i-u).style("y",u).style("width",s).style("height",a-s).style("fill","transparent").call(K5,p),t.maybeAppend("handle-s",S(y)).style("x",u).style("y",a-u).style("width",i-s).style("height",s).style("fill","transparent").call(K5,m),t.maybeAppend("handle-w",S(b)).style("x",-u).style("y",u).style("width",s).style("height",a-s).style("fill","transparent").call(K5,v),t.maybeAppend("handle-nw",S(w)).style("x",-u).style("y",-u).style("width",s).style("height",s).style("fill","transparent").call(K5,x),t.maybeAppend("handle-ne",S(O)).style("x",i-u).style("y",-u).style("width",s).style("height",s).style("fill","transparent").call(K5,M),t.maybeAppend("handle-se",S(_)).style("x",i-u).style("y",a-u).style("width",s).style("height",s).style("fill","transparent").call(K5,k),t.maybeAppend("handle-sw",S(f)).style("x",-u).style("y",a-u).style("width",s).style("height",s).style("fill","transparent").call(K5,E)}});function Z5(l,t){var{brushed:a=()=>{},brushended:e=()=>{},brushcreated:o=()=>{},extent:s=function(t){var{width:t,height:e}=t.getBBox();return[0,0,t,e]}(l),brushRegion:c=(t,e,n,r,i)=>[t,e,n,r],reverse:u=!1,fill:n="#777",fillOpacity:r="0.3",stroke:i="#fff",selectedHandles:f=["handle-n","handle-e","handle-s","handle-w","handle-nw","handle-ne","handle-se","handle-sw"]}=t,h=rt(t,["brushed","brushended","brushcreated","extent","brushRegion","reverse","fill","fillOpacity","stroke","selectedHandles"]);let d=null,p=null,g=null,m=null,y=null,v=!1;const[b,x,w,M]=s,O=(o5(l,"crosshair"),l.style.draggable=!0,(t,e)=>{if(m&&m.remove(),y&&y.remove(),d=[t,e],u)return I();B()}),I=()=>{y=new nt.Path({style:Object.assign(Object.assign({},h),{fill:n,fillOpacity:r,stroke:i,pointerEvents:"none"})}),m=new X5({style:{x:0,y:0,width:0,height:0,draggable:!0,document:l.ownerDocument},className:"mask"}),l.appendChild(y),l.appendChild(m)},B=()=>{m=new X5({style:Object.assign(Object.assign({document:l.ownerDocument,x:0,y:0},h),{fill:n,fillOpacity:r,stroke:i,draggable:!0}),className:"mask"}),l.appendChild(m)},k=(t=!0)=>{m&&m.remove(),y&&y.remove(),d=null,p=null,g=null,v=!1,m=null,y=null,e(t)},_=(t,e,n=!0)=>{var[t,e,r,i]=function(t,e,n,r,i){var[i,a,o,s]=i;return[Math.max(i,Math.min(t,n)),Math.max(a,Math.min(e,r)),Math.min(o,Math.max(t,n)),Math.min(s,Math.max(e,r))]}(t[0],t[1],e[0],e[1],s),[t,e,r,i]=c(t,e,r,i,s);return(u?D:F)(t,e,r,i),a(t,e,r,i,n),[t,e,r,i]},F=(t,e,n,r)=>{m.style.x=t,m.style.y=e,m.style.width=n-t,m.style.height=r-e},D=(t,e,n,r)=>{y.style.d=`
  8. M${b},${x}L${w},${x}L${w},${M}L${b},${M}Z
  9. M${t},${e}L${t},${r}L${n},${r}L${n},${e}Z
  10. `,m.style.x=t,m.style.y=e,m.style.width=n-t,m.style.height=r-e},E={"handle-n":{vector:[0,1,0,0],cursor:"ns-resize"},"handle-e":{vector:[0,0,1,0],cursor:"ew-resize"},"handle-s":{vector:[0,0,0,1],cursor:"ns-resize"},"handle-w":{vector:[1,0,0,0],cursor:"ew-resize"},"handle-nw":{vector:[1,1,0,0],cursor:"nwse-resize"},"handle-ne":{vector:[0,1,1,0],cursor:"nesw-resize"},"handle-se":{vector:[0,0,1,1],cursor:"nwse-resize"},"handle-sw":{vector:[1,0,0,1],cursor:"nesw-resize"}},S=t=>L(t)||A(t),A=t=>{t=t.id;return-1!==f.indexOf(t)&&new Set(Object.keys(E)).has(t)},L=t=>t===m.getElementById("selection"),T=t=>{var e=t["target"],[t,n]=Xw(l,t);m&&S(e)?S(e)&&(g=[t,n]):(O(t,n),v=!0)},j=t=>{var e,n,r,i,a,o,s=t["target"],t=Xw(l,t);if(d)return g?L(s)?(e=(t,e,n,r,i)=>t+e<r?r-e:i<t+n?i-n:t,r=(n=t)[0]-g[0],n=n[1]-g[1],r=e(r,d[0],p[0],b,w),e=e(n,d[1],p[1],x,M),n=[d[0]+r,d[1]+e],r=[p[0]+r,p[1]+e],void _(n,r)):([e,n]=[t[0]-g[0],t[1]-g[1]],r=s["id"],E[r]?([s,i,a,o]=E[r].vector,_([d[0]+e*s,d[1]+n*i],[p[0]+e*a,p[1]+n*o])):void 0):_(d,t)},N=t=>{var e,n,r,i;g?(g=null,{x:e,y:r,width:n,height:i}=m.style,d=[e,r],p=[e+n,r+i]):(p=Xw(l,t),[e,n,r,i]=_(d,p),v=!1,o(e,n,r,i,t))},P=t=>{t=t.target;m&&!S(t)&&k()},C=t=>{t=t.target;m&&S(t)&&!v?L(t)?o5(l,"move"):A(t)&&o5(l,E[t.id].cursor):o5(l,"crosshair")},R=()=>{o5(l,"default")};return l.addEventListener("dragstart",T),l.addEventListener("drag",j),l.addEventListener("dragend",N),l.addEventListener("click",P),l.addEventListener("pointermove",C),l.addEventListener("pointerleave",R),{mask:m,move(t,e,n,r,i=!0){m||O(t,e),d=[t,e],p=[n,r],_([t,e],[n,r],i)},remove(){m&&k(!1)},destroy(){m&&k(!1),o5(l,"default"),l.removeEventListener("dragstart",T),l.removeEventListener("drag",j),l.removeEventListener("dragend",N),l.removeEventListener("click",P),l.removeEventListener("pointermove",C),l.removeEventListener("pointerleave",R)}}}function Q5(e,t,n){return t.filter(t=>{return t!==e&&({interaction:t={}}=t.options,Object.values(t).find(t=>t.brushKey===n))})}function J5(t,e){var{elements:n,selectedHandles:r,siblings:i=t=>[],datum:a,brushRegion:o,extent:s,reverse:l,scale:c,coordinate:u,series:f=!1,key:d=t=>t,bboxOf:h=t=>{var{x:t,y:e,width:n,height:r}=t.style;return{x:t,y:e,width:n,height:r}},state:p={},emitter:g}=e,e=rt(e,["elements","selectedHandles","siblings","datum","brushRegion","extent","reverse","scale","coordinate","series","key","bboxOf","state","emitter"]);const m=n(t),y=i(t),v=y.flatMap(n);i=n5(m,a),n=at(e,"mask");const{setState:b,removeState:x}=t5(p,i),w=new Map,{width:M,height:O,x:k=0,y:_=0}=h(t);a=s||[0,0,M,O];const E=()=>{for(const t of[...m,...v])x(t,"active","inactive")},S=(t,e,n,r)=>{var i;for(const u of y)null!=(i=u.brush)&&i.remove();var a=new Set;for(const f of m){var{min:o,max:s}=f.getLocalBounds(),[o,l]=o,[s,c]=s;!function(t,e){var[t,n,r,i]=t,[e,a,o,s]=e;return!(r<e||o<t||i<a||s<n)}([o,l,s,c],[t,e,n,r])?b(f,"inactive"):(b(f,"active"),a.add(d(f)))}for(const h of v)a.has(d(h))?b(h,"active"):b(h,"inactive")},A=()=>{for(const t of m)x(t,"inactive");for(const e of w.values())e.remove();w.clear()},L=(t,e,n,r)=>{var i;for(const o of m){var a=w.get(o)||(a=o,i=void 0,(i=a.cloneNode()).__data__=a.__data__,a.parentNode.appendChild(i),w.set(a,i),i);a.style.clipPath=new nt.Rect({style:{x:t+k,y:e+_,width:n-t,height:r-e}}),b(o,"inactive"),b(a,"active")}},T=Z5(t,Object.assign(Object.assign({},n),{extent:a,brushRegion:o,reverse:l,selectedHandles:r,brushended:t=>{var e=f?A:E;t&&g.emit("brush:remove",{nativeEvent:!0}),e()},brushed:(t,e,n,r,i)=>{var a=cw(t,e,n,r,c,u);i&&g.emit("brush:highlight",{nativeEvent:!0,data:{selection:a}}),(f?L:S)(t,e,n,r)}})),j=({nativeEvent:t,data:e})=>{var n,r;t||(t=e["selection"],[e,t,n,r]=function(t,e,n){var{x:e,y:r}=e,[t,i]=t,t=uw(t,e),e=uw(i,r),i=[t[0],e[0]],r=[t[1],e[1]],[t,e]=n.map(i),[i,n]=n.map(r);return[t,e,i,n]}(t,c,u),T.move(e,t,n,r,!1))},N=(g.on("brush:highlight",j),()=>T.remove()),P=(g.on("brush:remove",N),T.destroy.bind(T));return T.destroy=()=>{g.off("brush:highlight",j),g.off("brush:remove",N),P()},T}function tM(t){var{facet:g,brushKey:m}=t,y=rt(t,["facet","brushKey"]);return(t,e,n)=>{var r,i,a,o,{container:s,view:l,options:c}=t,s=Uw(s),u={maskFill:"#777",maskFillOpacity:"0.3",maskStroke:"#fff",reverse:!1},f=["active",["inactive",{opacity:.5}]],{scale:h,coordinate:d}=l;if(g)return r=(o=s.getBounds()).min[0],i=o.min[1],a=o.max[0],o=o.max[1],J5(s.parentNode.parentNode,Object.assign(Object.assign({elements:()=>Yw(t,e),datum:Jw($w(t,e).map(t=>t.view)),brushRegion:(t,e,n,r)=>[t,e,n,r],extent:[r,i,a,o],state:e5($w(t,e).map(t=>t.options),f),emitter:n,scale:h,coordinate:d,selectedHandles:void 0},u),y));const p=J5(s,Object.assign(Object.assign({elements:Vw,key:t=>t.__data__.key,siblings:()=>{return Q5(t,e,m).map(t=>Uw(t.container))},datum:Jw([l,...Q5(t,e,m).map(t=>t.view)]),brushRegion:(t,e,n,r)=>[t,e,n,r],extent:void 0,state:e5([c,...Q5(t,e,m).map(t=>t.options)],f),emitter:n,scale:h,coordinate:d,selectedHandles:void 0},u),y));return s.brush=p,()=>p.destroy()}}function eM(t,e,n,r,i){var[,i,,a]=i;return[t,i,n,a]}function nM(t){return tM(Object.assign(Object.assign({},t),{brushRegion:eM,selectedHandles:["handle-e","handle-w"]}))}function rM(t,e,n,r,i){var[i,,a]=i;return[i,e,a,r]}function iM(t){return tM(Object.assign(Object.assign({},t),{brushRegion:rM,selectedHandles:["handle-n","handle-s"]}))}const aM="axis",oM="axis-hot-area";function sM(t){return t.getElementsByClassName(aM)}function lM(t){return t.getElementsByClassName("axis-line")[0]}function cM(t){return t.getElementsByClassName("axis-main-group")[0].getLocalBounds()}function uM(t,e){var{cross:n,offsetX:i}=e,e=rt(e,["cross","offsetX","offsetY"]),r=cM(t),[t]=lM(t).getLocalBounds().min;const[a,o]=r.min,[s,l]=r.max;r=2*(s-a);return{brushRegion:rM,hotZone:new nt.Rect({className:oM,style:Object.assign({x:n?a:t-r/2,width:n?r/2:r,y:o,height:l-o},e)}),extent:n?(t,e,n,r)=>[-1/0,e,1/0,r]:(t,e,n,r)=>[Math.floor(a-i),e,Math.ceil(s-i),r]}}function fM(t,e){var{offsetY:i,cross:n=!1}=e,e=rt(e,["offsetY","offsetX","cross"]),r=cM(t),[,t]=lM(t).getLocalBounds().min;const[a,o]=r.min,[s,l]=r.max;r=l-o;return{brushRegion:eM,hotZone:new nt.Rect({className:oM,style:Object.assign({x:a,width:s-a,y:n?o:t-r,height:n?r:2*r},e)}),extent:n?(t,e,n,r)=>[t,-1/0,n,1/0]:(t,e,n,r)=>[t,Math.floor(o-i),n,Math.ceil(l-i)]}}function hM(t,e){var{axes:n,elements:r,points:i,horizontal:s,datum:a,offsetY:o,offsetX:l,reverse:c=!1,state:u={},emitter:f,coordinate:h}=e,e=rt(e,["axes","elements","points","horizontal","datum","offsetY","offsetX","reverse","state","emitter","coordinate"]);const d=r(t),p=n(t),{setState:g,removeState:m}=t5(u,n5(d,a)),y=new Map;var v=at(e,"mask");const b=p.map(t=>t.attributes.scale),x=t=>2<t.length?[t[0],t[t.length-1]]:t,w=new Map,M=()=>{w.clear();for(let t=0;t<p.length;t++){var e=b[t].getOptions()["domain"];w.set(t,x(e))}},O=(M(),(t,e)=>{var n=[];for(const r of d)(t=>Array.from(y.values()).every(([n,r,i,a])=>t.some(([t,e])=>n<=t&&t<=i&&r<=e&&e<=a)))(i(r))?(g(r,"active"),n.push(r)):g(r,"inactive");w.set(t,((t,e)=>{const n=b[e],{name:r}=n.getOptions(),i=t.map(t=>{const e=t.__data__;return n.invert(e[r])});return x(lw(n,i))})(n,t)),e&&f.emit("brushAxis:highlight",{nativeEvent:!0,data:{selection:(()=>{if(!k)return Array.from(w.values());var t,e,n=[];for([t,e]of w){var r=b[t].getOptions()["name"];"x"===r?n[0]=e:n[1]=e}return n})()}})}),k=p.some(s)&&p.some(t=>!s(t)),_=[];for(let a=0;a<p.length;a++){const T=p[a];const{hotZone:j,brushRegion:N,extent:P}=(s(T)?fM:uM)(T,{offsetY:o,offsetX:l,cross:k,zIndex:999,fill:"transparent"});T.parentNode.appendChild(j);var E=Z5(j,Object.assign(Object.assign({},v),{reverse:c,brushRegion:N,brushended(t){if(y.delete(T),0===Array.from(y.entries()).length){var e=t;for(const n of d)m(n,"active","inactive");M(),e&&f.emit("brushAxis:remove",{nativeEvent:!0})}else O(a,t)},brushed(t,e,n,r,i){y.set(T,P(t,e,n,r)),O(a,i)}}));_.push(E)}const S=(t={})=>{t=t.nativeEvent;t||_.forEach(t=>t.remove())},A=(t,e,n)=>{var{height:r,width:i}=h.getOptions(),e=e.clone();return s(n)?e.update({range:[0,i]}):e.update({range:[r,0]}),e.map(t)},L=t=>{var e=t["nativeEvent"];if(!e){var n=t.data["selection"];for(let t=0;t<_.length;t++){var r,i=n[t],a=_[t],o=p[t];i?(r=b[t],a.move(...((t,e,n)=>{var[t,r]=t,t=A(t,e,n),e=A(r,e,n)+((r=e).getStep?r.getStep():0);return s(n)?[t,-1/0,e,1/0]:[-1/0,t,1/0,e]})(i,r,o),!1)):a.remove()}}};return f.on("brushAxis:remove",S),f.on("brushAxis:highlight",L),()=>{_.forEach(t=>t.destroy()),f.off("brushAxis:remove",S),f.off("brushAxis:highlight",L)}}function dM(l){return(t,e,n)=>{var{container:t,view:r,options:i}=t,{x:a,y:o}=Uw(t).getBBox(),s=r["coordinate"];return hM(t,Object.assign({elements:Vw,axes:sM,offsetY:o,offsetX:a,points:t=>t.__data__.points,horizontal:t=>{var{startPos:[t,e],endPos:[n,r]}=t.attributes;return t!==n&&e===r},datum:Jw(r),state:e5(i,["active",["inactive",{opacity:.5}]]),coordinate:s,emitter:n},l))}}function pM(t,e){var{filter:a,reset:n,brushRegion:r,extent:i,reverse:o,emitter:s,selection:l}=e,e=at(rt(e,["filter","reset","brushRegion","extent","reverse","emitter","scale","coordinate","selection","series"]),"mask"),{width:c,height:u}=t.getBBox(),i=i||[0,0,c,u];const f=function(e=300){let n=null;return t=>{t=t.timeStamp;return null!==n&&t-n<e?(n=t,!0):(n=t,!1)}}(),h=Z5(t,Object.assign(Object.assign({},e),{extent:i,brushRegion:r,reverse:o,brushcreated:function(t,e,n,r,i){i.nativeEvent=!0,a(l(t,e,n,r),i),h.remove()}}));function d(t){f(t)&&(t.nativeEvent=!0,n(t))}t.addEventListener("click",d);const p=({nativeEvent:t,data:e})=>{t||(t=e["selection"],a(t,{nativeEvent:!1}))};return s.on("brush:filter",p),()=>{h.destroy(),s.off("brush:filter",p),t.removeEventListener("click",d)}}function gM(t){var{hideX:h=!0,hideY:d=!0}=t,p=rt(t,["hideX","hideY"]);return(t,e,a)=>{const{container:n,view:r,options:o,update:s}=t;t=Uw(n);let l=!1,c=!1,u=r;var{scale:i,coordinate:f}=r;return pM(t,Object.assign(Object.assign({brushRegion:(t,e,n,r)=>[t,e,n,r],selection:(t,e,n,r)=>{var{scale:i,coordinate:a}=u;return cw(t,e,n,r,i,a)},filter:(r,i)=>ue(this,void 0,void 0,function*(){if(!c){c=!0;const[e,n]=r;var t=o["marks"],t=t.map(t=>it({axis:Object.assign(Object.assign({},h&&{x:{transform:[{type:"hide"}]}}),d&&{y:{transform:[{type:"hide"}]}})},t,{scale:{x:{domain:e},y:{domain:n}}})),t=(a.emit("brush:filter",Object.assign(Object.assign({},i),{data:{selection:[e,n]}})),Object.assign(Object.assign({},o),{marks:t,clip:!0})),t=yield s(t);u=t.view,c=!1,l=!0}}),reset:t=>{var e,n;!c&&l&&(e=r["scale"],{x:e,y:n}=e,e=e.getOptions().domain,n=n.getOptions().domain,a.emit("brush:filter",Object.assign(Object.assign({},t),{data:{selection:[e,n]}})),l=!1,u=r,s(o))},extent:void 0,emitter:a,scale:i,coordinate:f},{maskFill:"#777",maskFillOpacity:"0.3",maskStroke:"#fff",unhighlightedOpacity:.5,reverse:!1}),p))}}function mM(t){return gM(Object.assign(Object.assign({hideX:!0},t),{brushRegion:eM}))}function yM(t){return gM(Object.assign(Object.assign({hideY:!0},t),{brushRegion:rM}))}const vM="slider";function bM(t){return[t[0],t[t.length-1]]}function xM({channelDomain:E,className:S=vM,prefix:A="slider",setValue:L=(t,e)=>t.setValues(e),hasState:T=!1,wait:j=50,leading:N=!0,trailing:P=!1}){return(t,e,c)=>{const{container:n,view:r,options:u,update:f}=t;t=n.getElementsByClassName(S);if(!t.length)return()=>{};let h=!1;const{scale:i,coordinate:a}=r,{x:o,y:s}=i,l=Uc(a);const d=new Map,p=new Set;E=E||{x:o.getOptions().domain,y:s.getOptions().domain};for(const y of t){const v=y.attributes["orientation"],[b,x]=(m=v,g=void 0,g="vertical"===m?"y":"x",m="vertical"===m?"x":"y",l?[m,g]:[g,m]),w=""+A+Qe(b)+":filter",M="x"===b,O=o.getOptions()["ratio"],k=s.getOptions()["ratio"],_=t=>{var e,n;return t.data?(e=t.data["selection"],[e=bM(E.x),n=bM(E.y)]=e,M?[lw(o,e,O),lw(s,n,k)]:[lw(s,n,k),lw(o,e,O)]):(n=t.detail["value"],[function(t,e,n){var[t,r]=t;return lw(e,[sw(e,(n=n?t=>1-t:t=>t)(t),!0),sw(e,n(r),!1)])}(n,i[b],l&&"horizontal"===v),E[x]])};var g=un(l=>ue(this,void 0,void 0,function*(){var t,e,n,r,i,a,o,s;h||(h=!0,{nativeEvent:t=!0}=l,[e,s]=_(l),E[b]=e,E[x]=s,[n,r,i,a=!1]=[u,{[b]:{domain:e},[x]:{domain:s}},A,T],o=(o=n["marks"]).map(t=>it({axis:{x:{transform:[{type:"hide"}]},y:{transform:[{type:"hide"}]}}},t,{scale:r,[i]:Object.assign(Object.assign({},t[i].x&&{x:Object.assign({preserve:!0},a&&{ratio:null})}),t[i].y&&{y:Object.assign({preserve:!0},a&&{ratio:null})}),animate:!1})),n=Object.assign(Object.assign({},n),{marks:o,clip:!0,animate:!1}),t&&(o=M?e:s,s=M?s:e,c.emit(w,Object.assign(Object.assign({},l),{nativeEvent:t,data:{selection:[bM(o),bM(s)]}}))),yield f(n),h=!1)}),j,{leading:N,trailing:P}),m=t=>{var e,n=t["nativeEvent"];n||(n=t["data"],t=n["selection"],[t,e]=t,y.dispatchEvent(new nt.CustomEvent("valuechange",{data:n,nativeEvent:!1})),n=M?uw(t,o):uw(e,s),L(y,n))};c.on(w,m),y.addEventListener("valuechange",g),d.set(y,g),p.add([w,m])}return()=>{for(var[t,e]of d)t.removeEventListener("valuechange",e);for(var[n,r]of p)c.off(n,r)}}}const wM="g2-scrollbar";function MM(o={}){return(t,e,n)=>{var r,{view:i,container:a}=t;return a.getElementsByClassName(wM).length?(a=i["scale"],{x:i,y:a}=a,r={x:i.getOptions().domain,y:a.getOptions().domain},i.update({domain:i.getOptions().expectedDomain}),a.update({domain:a.getOptions().expectedDomain}),xM(Object.assign(Object.assign({},o),{channelDomain:r,className:wM,prefix:"scrollbar",hasState:!0,setValue:(t,e)=>t.setValue(e[0])}))(t,e,n)):()=>{}}}const OM={backgroundColor:"rgba(0,0,0,0.75)",color:"#fff",width:"max-content",padding:"1px 4px",fontSize:"12px",borderRadius:"2.5px",boxShadow:"0 3px 6px -4px rgba(0,0,0,0.12), 0 6px 16px 0 rgba(0,0,0,0.08), 0 9px 28px 8px rgba(0,0,0,0.05)"};function kM(t){return"text"===t.nodeName&&!!t.isOverflowing()}function _M(t){var{offsetX:h=8,offsetY:d=8}=t,r=rt(t,["offsetX","offsetY"]);return t=>{const s=t["container"],[l,c]=s.getBounds().min,u=at(r,"tip"),f=new Set,e=t=>{var e,n,r,i,a,o=t["target"];kM(o)?({offsetX:e,offsetY:n}=t,e=e+h-l,n=n+d-c,o.tip?(o.tip.style.x=e,o.tip.style.y=n):(i=o.style["text"],a=new nt.HTML({className:"poptip",style:{innerHTML:(r="div",i=i,a=Object.assign(Object.assign({},OM),u),`<${r} style="${Object.entries(a).map(([t,e])=>t.replace(/([A-Z])/g,"-$1").toLowerCase()+":"+e).join(";")}">${i}</${r}>`),x:e,y:n}}),s.appendChild(a),o.tip=a,f.add(a))):t.stopPropagation()},n=t=>{var e=t["target"];kM(e)?e.tip&&(e.tip.remove(),e.tip=null,f.delete(e.tip)):t.stopPropagation()};return s.addEventListener("pointerover",e),s.addEventListener("pointerout",n),()=>{s.removeEventListener("pointerover",e),s.removeEventListener("pointerout",n),f.forEach(t=>t.remove())}}}function EM(n){return(t,...e)=>it({},n(t,...e),t)}function SM(n){return(t,...e)=>it({},t,n(t,...e))}function AM(t,e){var n;return t?Array.isArray(t)?t:({value:n=e}=t,t=rt(t,["value"]),Object.assign(Object.assign({},t),{value:n})):e}const LM=()=>t=>{var e=t["children"];if(!Array.isArray(e))return[];const{x:o=0,y:s=0,width:l,height:c,data:u}=t;return e.map(t=>{var{data:e,x:n,y:r,width:i,height:a}=t,t=rt(t,["data","x","y","width","height"]);return Object.assign(Object.assign({},t),{data:AM(e,u),x:null!=n?n:o,y:null!=r?r:s,width:null!=i?i:l,height:null!=a?a:c})})},TM=(LM.props={},()=>e=>{var n=e["children"];if(!Array.isArray(n))return[];var{direction:t="row",ratio:r=n.map(()=>1),padding:i=0,data:a}=e,[o,s,l,c]="col"===t?["y","height","width","x"]:["x","width","height","y"];const u=r.reduce((t,e)=>t+e),f=e[s]-i*(n.length-1);var h=r.map(t=>f*(t/u)),d=[];let p=e[o]||0;for(let t=0;t<h.length;t+=1){var g=n[t],m=g["data"],g=rt(g,["data"]),m=AM(m,a);d.push(Object.assign({[o]:p,[s]:h[t],[c]:e[c]||0,[l]:e[l],data:m},g)),p+=h[t]+i}return d}),jM=(TM.props={},()=>t=>{var e=t["children"],t=rt(t,["children"]);if(!Array.isArray(e))return[];const{data:s,scale:l={},axis:c={},legend:u={},encode:f={},transform:h=[]}=t,n=rt(t,["data","scale","axis","legend","encode","transform"]);t=e.map(t=>{var{data:e,scale:n={},axis:r={},legend:i={},encode:a={},transform:o=[]}=t,t=rt(t,["data","scale","axis","legend","encode","transform"]);return Object.assign({data:AM(e,s),scale:it({},l,n),encode:it({},f,a),transform:[...h,...o],axis:!(!r||!c)&&it({},c,r),legend:!(!i||!u)&&it({},u,i)},t)});return[Object.assign(Object.assign({},n),{marks:t,type:"standardView"})]}),NM=(jM.props={},()=>t=>{var{width:e,height:n,paddingLeft:r,paddingRight:i,paddingTop:a,paddingBottom:o,padding:s,inset:l,insetLeft:c,insetTop:u,insetRight:f,insetBottom:h,margin:d,marginLeft:p,marginBottom:g,marginTop:m,marginRight:y,data:v,coordinate:b,theme:x,component:w,interaction:M,x:O,y:k,key:_,frame:E,title:S,labelTransform:A,parentKey:L,clip:T,viewStyle:j}=t,t=rt(t,["width","height","paddingLeft","paddingRight","paddingTop","paddingBottom","padding","inset","insetLeft","insetTop","insetRight","insetBottom","margin","marginLeft","marginBottom","marginTop","marginRight","data","coordinate","theme","component","interaction","x","y","key","frame","title","labelTransform","parentKey","clip","viewStyle"]);return[{type:"standardView",x:O,y:k,key:_,width:e,height:n,padding:s,paddingLeft:r,paddingRight:i,paddingTop:a,inset:l,insetLeft:c,insetTop:u,insetRight:f,insetBottom:h,paddingBottom:o,theme:x,coordinate:b,component:w,interaction:M,frame:E,title:S,labelTransform:A,margin:d,marginLeft:p,marginBottom:g,marginTop:m,marginRight:y,parentKey:L,clip:T,style:j,marks:[Object.assign(Object.assign({},t),{key:_+"-0",data:v})]}]}),PM=(NM.props={},EM(t=>{const{encode:e,data:i,scale:a,shareSize:o=!1}=t;var{x:t,y:n}=e,r=(e,t)=>{if(void 0===e||!o)return{};const n=bc(i,t=>t[e]);var t=(null==(t=null===a||void 0===a?void 0:a[t])?void 0:t.domain)||Array.from(n.keys()),r=t.map(t=>n.has(t)?n.get(t).length:1);return{domain:t,flex:r}};return{scale:{x:Object.assign(Object.assign({paddingOuter:0,paddingInner:.1,guide:void 0===t?null:{position:"top"}},void 0===t&&{paddingInner:0}),r(t,"x")),y:Object.assign(Object.assign({range:[0,1],paddingOuter:0,paddingInner:.1,guide:void 0===n?null:{position:"right"}},void 0===n&&{paddingInner:0}),r(n,"y"))}}})),CM=EM(t=>{const{data:e,scale:n}=t;var r=[t];let i,a,o;for(;r.length;){const{children:h,encode:d={},scale:n={},legend:p={}}=r.shift();var s=d["color"],l=n["color"],c=p["color"];void 0!==s&&(i=s),void 0!==l&&(a=l),void 0!==c&&(o=c),Array.isArray(h)&&r.push(...h)}var t="string"==typeof i?i:"",[u,f]=void 0!==(u=null==(u=null===n||void 0===n?void 0:n.color)?void 0:u.domain)?[u]:void 0===i?[void 0]:(u="function"==typeof i?i:t=>t[i],(u=e.map(u)).some(t=>"number"==typeof t)?[pc(u)]:[Array.from(new Set(u)),"ordinal"]);return{encode:{color:i},scale:{color:it({},a,{domain:u,type:f})},legend:{color:it({title:t},o)}}}),RM=EM(()=>({animate:{enterType:"fadeIn"}})),IM=SM(()=>({frame:!1,encode:{shape:"hollow"},style:{lineWidth:0}})),BM=SM(()=>({type:"cell"})),FM=SM(c=>{var t=c["data"];return{data:{type:"inline",value:t,transform:[{type:"custom",callback:()=>{var{data:t,encode:e}=c;const{x:n,y:r}=e,i=n?Array.from(new Set(t.map(t=>t[n]))):[],a=r?Array.from(new Set(t.map(t=>t[r]))):[];if(i.length&&a.length){var o=[];for(const s of i)for(const l of a)o.push({[n]:s,[r]:l});return o}return i.length?i.map(t=>({[n]:t})):a.length?a.map(t=>({[r]:t})):void 0}}]}}}),DM=SM((t,c=function(t){t=t.points;return W0(t)},w=function(a){return(t,e)=>{var{rowIndex:t,rowValuesLength:n,columnIndex:r,columnValuesLength:i}=t;return t!==n-1?zM(a,e):(t=e.length?void 0:null,it({title:r===i-1&&void 0,grid:t},a))}},M=function(r){return(t,e)=>{var{rowIndex:t,columnIndex:n}=t;return 0!==n?zM(r,e):(n=e.length?void 0:null,it({title:0===t&&void 0,grid:n},r))}},O={})=>{const{data:e,encode:n,children:u,scale:r,x:k=0,y:_=0,shareData:f=!1,key:E}=t,S=e["value"],{x:A,y:L}=n;t=r.color;const T=t["domain"];return{children:(t,e,n)=>{const{x:r,y:i}=e,{paddingLeft:m,paddingTop:y}=n,a=r.getOptions()["domain"],o=i.getOptions()["domain"];e=j0(t);const s=t.map(c);n=t.map(({x:t,y:e})=>[r.invert(t),i.invert(e)]);const l=n.map(([n,r])=>t=>{var{[A]:t,[L]:e}=t,t=void 0===A||t===n,e=void 0===L||e===r;return t&&e}).map(t=>S.filter(t)),v=f?Rc(l,t=>t.length):void 0,b=n.map(([t,e])=>({columnField:A,columnIndex:a.indexOf(t),columnValue:t,columnValuesLength:a.length,rowField:L,rowIndex:o.indexOf(e),rowValue:e,rowValuesLength:o.length})),x=b.map(t=>Array.isArray(u)?u:[u(t)].flat(1));return e.flatMap(c=>{const[u,f,h,d]=s[c],p=b[c],g=l[c];return x[c].map(t=>{var{scale:e,key:n,facet:r=!0,axis:i={}}=t,t=rt(t,["scale","key","facet","axis","legend"]),a=(null==(a=null==e?void 0:e.y)?void 0:a.guide)||i.y,o=(null==(o=null==e?void 0:e.x)?void 0:o.guide)||i.x,s={x:{tickCount:A?5:void 0},y:{tickCount:L?5:void 0}},r=r?g:0===g.length?[]:S,l={color:{domain:T}},o={x:WM(o,w)(p,r),y:WM(a,M)(p,r)};return Object.assign(Object.assign({key:n+"-"+c,data:r,x:u+m+k,y:f+y+_,parentKey:E,width:h,height:d,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,frame:!!r.length,dataDomain:v,scale:it(s,e,l),axis:it({},i,o),legend:!1},t),O)})})}}});function zM(t,e){return e.length?it({title:!1,tick:null,label:null},t):it({title:!1,tick:null,label:null,grid:null},t)}function WM(t,e){return"function"==typeof t?t:null===t?()=>null:e(t)}const GM=()=>t=>{return[yw.of(t).call(BM).call(CM).call(RM).call(PM).call(IM).call(FM).call(DM).value()]},qM=(GM.props={},EM(t=>({scale:{x:{guide:null,paddingOuter:0,paddingInner:.1},y:{guide:null,range:[0,1],paddingOuter:0,paddingInner:.1}}}))),HM=SM(t=>{const{data:w,children:c,x:M=0,y:O=0,key:k}=t;return{children:(t,e,n)=>{const{x:r,y:i}=e,{paddingLeft:y,paddingTop:v}=n,a=r.getOptions()["domain"],o=i.getOptions()["domain"];e=j0(t);const s=t.map(({points:t})=>W0(t)),l=t.map(({x:t,y:e})=>[r.invert(t),i.invert(e)]),b=l.map(([t,e])=>({columnField:t,columnIndex:a.indexOf(t),columnValue:t,columnValuesLength:a.length,rowField:e,rowIndex:o.indexOf(e),rowValue:e,rowValuesLength:o.length})),x=b.map(t=>Array.isArray(c)?c:[c(t)].flat(1));return e.flatMap(c=>{const[u,f,h,d]=s[c],[p,g]=l[c],m=b[c];return x[c].map(t=>{var n,r,{scale:e,key:i,encode:a,axis:o}=t,t=rt(t,["scale","key","encode","axis"]),s=null==(s=null==e?void 0:e.y)?void 0:s.guide,l=null==(l=null==e?void 0:e.x)?void 0:l.guide,l={x:("function"==typeof(r=l)?r:null===r?()=>null:(t,e)=>{var{rowIndex:t,rowValuesLength:n}=t;if(t!==n-1)return zM(r,e)})(m,w),y:("function"==typeof(n=s)?n:null===n?()=>null:(t,e)=>{t=t.columnIndex;if(0!==t)return zM(n,e)})(m,w)};return Object.assign({data:w,parentKey:k,key:i+"-"+c,x:u+y+M,y:f+v+O,width:h,height:d,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,frame:!0,scale:it({x:{facet:!1},y:{facet:!1}},e),axis:it({x:{tickCount:5},y:{tickCount:5}},o,l),legend:!1,encode:it({},a,{x:p,y:g})},t)})})}}}),VM=SM(t=>{var e=t["encode"],t=rt(t,["encode"]),{position:n=[],x:r=n,y:i=[...n].reverse()}=e,n=rt(e,["position","x","y"]),a=[];for(const o of[r].flat(1))for(const s of[i].flat(1))a.push({$x:o,$y:s});return Object.assign(Object.assign({},t),{data:a,encode:Object.assign(Object.assign({},n),{x:"$x",y:"$y"}),scale:Object.assign(Object.assign({},1===[r].flat(1).length&&{x:{paddingInner:0}}),1===[i].flat(1).length&&{y:{paddingInner:0}})})});const YM=()=>t=>{return[yw.of(t).call(BM).call(CM).call(HM).call(VM).call(RM).call(IM).call(qM).value()]},$M=EM(t=>({scale:{x:{guide:{type:"axisArc"},paddingOuter:0,paddingInner:.1},y:{guide:null,range:[0,1],paddingOuter:0,paddingInner:.1}}})),UM=EM(t=>({coordinate:{type:"polar"}})),KM=t=>{var e=t["encode"],t=rt(t,["encode"]),e=e["position"];return Object.assign(Object.assign({},t),{encode:{x:e}})};function XM(t){return t=>null}function ZM(t){var t=t["points"],[t,e,n,r]=t,i=B0(t,r),t=R0(t,r),r=z0(t,R0(e,n)),e=1/Math.sin(r/2),i=i/(1+e),a=i*Math.sqrt(2),[n,o]=n,t=D0(t)+r/2,r=i*e;return[n+r*Math.sin(t)-a/2,o+r*Math.cos(t)-a/2,a,a]}const QM=()=>t=>{return[yw.of(t).call(BM).call(KM).call(CM).call(UM).call(FM).call(DM,ZM,XM,XM,{frame:!1}).call(RM).call(IM).call($M).value()]};const JM=()=>t=>{const{children:e=[],duration:a=1e3,iterationCount:l=1,direction:c="normal",easing:o="ease-in-out-sine"}=t,u=e.length;if(!Array.isArray(e)||0===u)return[];const n=e[0]["key"],f=e.map(t=>Object.assign(Object.assign({},t),{key:n})).map(t=>{for(var e=a,n=o,r=[t];r.length;){var i=r.pop(),i=(i.animate=it({enter:{duration:e},update:{duration:e,easing:n,type:"morphing",fill:"both"},exit:{type:"fadeOut",duration:e}},i.animate||{}),i)["children"];Array.isArray(i)&&r.push(...i)}return t});return function*(){let t=0,e;for(;"infinite"===l||t<l;){n=c,a=t,o=u,s=void 0,s=[0,o],o=[1-o,1];var[n,r]="normal"===n?s:"reverse"===n?o:"alternate"===n?a%2==0?s:o:"reverse-alternate"===n?a%2==0?o:s:void 0;for(let t=n;t<r;t+=1){var i=Math.abs(t);e!==i&&(yield f[i]),e=i}t++}var a,o,s}};function tO(t,e){if(null!==t)return{type:"column",value:t,field:e}}function eO(t,e){t=tO(t,e);return Object.assign(Object.assign({},t),{inferred:!0})}function nO(t,e){if(null!==t)return{type:"column",value:t,field:e,visual:!0}}function rO(t,e){var n=[];for(const r of t)n[r]=e;return n}function R(t,e){var t=t[e];return t?({value:e,field:t=null}=t,[e,t]):[null,null]}function iO(t,...e){for(const i of e){if("string"!=typeof i)return[i,null];var[n,r]=R(t,i);if(null!==n)return[n,r]}return[null,null]}function aO(t){return!(t instanceof Date)&&"object"==typeof t}JM.props={};const oO=()=>(t,e)=>{var n=e["encode"],n=n["y1"];return void 0!==n?[t,e]:[t,it({},e,{encode:{y1:eO(rO(t,0))}})]};function sO(t,e,n){const r=n["encode"];if(null===t)return[e];n=t;const i=(Array.isArray(n)?n:[n]).map(t=>{return[t,null==(t=R(r,t))?void 0:t[0]]}).filter(([,t])=>qu(t));return Array.from(bc(e,e=>i.map(([,t])=>t[e]).join("-")).values())}function lO(t){var a,r;return Array.isArray(t)?(a=t,(i,t,e)=>(n,r)=>a.reduce((t,e)=>0!==t?t:ac(i[n][e],i[r][e]),0)):"function"==typeof t?(r=t,(e,t,n)=>gO(t=>r(e[t]))):"series"===t?fO:"value"===t?hO:"sum"===t?dO:"maxIndex"===t?pO:()=>null}function cO(t,e){for(const n of t)n.sort(e)}function uO(t,e){return(null==e?void 0:e.domain)||Array.from(new Set(t))}function fO(t,e,n){return gO(t=>n[t])}function hO(t,e,n){return gO(t=>e[t])}function dO(t,n,e){t=j0(t),t=Array.from(bc(t,t=>e[+t]).entries());const r=new Map(t.map(([t,e])=>[t,e.reduce((t,e)=>t+ +n[e])]));return gO(t=>r.get(e[t]))}function pO(t,n,e){t=j0(t),t=Array.from(bc(t,t=>e[+t]).entries());const r=new Map(t.map(([t,e])=>[t,Ic(e,t=>n[t])]));return gO(t=>r.get(e[t]))}function gO(n){return(t,e)=>ac(n(t),n(e))}oO.props={};const mO=(t={})=>{const{groupBy:L="x",orderBy:T=null,reverse:j=!1,y:N="y",y1:P="y1",series:C=!0}=t;return(t,e)=>{var{data:n,encode:r,style:i={}}=e,[a,o]=R(r,"y"),[s,l]=R(r,"y1"),[r]=C?iO(r,"series","color"):R(r,"color"),c=sO(L,t,e),n=lO(T)(n,a,r),u=(n&&cO(c,n),new Array(t.length)),f=new Array(t.length),h=new Array(t.length),d=[],p=[];for(const _ of c){j&&_.reverse();var g=s?+s[_[0]]:0,m=[],y=[];for(const E of _){var v=h[E]=+a[E]-g;v<0?y.push(E):0<=v&&m.push(E)}var b=0<m.length?m:y,x=0<y.length?y:m;let t=m.length-1,e=0;for(;0<t&&0===a[b[t]];)t--;for(;e<x.length-1&&0===a[x[e]];)e++;d.push(b[t]),p.push(x[e]);let n=g;for(const S of y.reverse()){var w=h[S];n=u[S]=(f[S]=n)+w}let r=g;for(const A of m){var M=h[A];0<M?r=u[A]=(f[A]=r)+M:u[A]=f[A]=r}}const O=new Set(d),k=new Set(p);r="y"===N?u:f,n="y"===P?u:f;return[t,it({},e,{encode:{y0:eO(a,o),y:tO(r,o),y1:tO(n,l)},style:Object.assign({first:(t,e)=>O.has(e),last:(t,e)=>k.has(e)},i)})]}};function yO(t){t=t.type;return"string"==typeof t&&["stackY","dodgeX","groupX"].includes(t)}mO.props={};const vO=a=>(t,e,n)=>{var{encode:r,transform:i=[]}=e;return i.some(yO)||({x:i,y:r}=r,void 0===i)||void 0===r?[t,e]:(i=a["series"],r=i?["x","series"]:"x",mO({groupBy:r})(t,e,n))},bO=(vO.props={},(t={})=>{const{channel:s="x"}=t;return(t,e)=>{const n=e["encode"];var r=e["tooltip"];if(Uu(r))return[t,e];r=r.title;if(void 0!==r)return[t,e];var i=Object.keys(n).filter(t=>t.startsWith(s)).filter(t=>!n[t].inferred).map(t=>R(n,t)).filter(([t])=>t).map(t=>t[0]);if(0===i.length)return[t,e];var a=[];for(const o of t)a[o]={value:i.map(t=>t[o]).join(", ")};return[t,it({},e,{tooltip:{title:a}})]}}),xO=(bO.props={},()=>(t,e)=>{var n=e["encode"],n=n["x"];return void 0!==n?[t,e]:[t,it({},e,{encode:{x:eO(rO(t,0))},scale:{x:{guide:null}}})]}),wO=(xO.props={},()=>(t,e)=>{var n=e["encode"],n=n["y"];return void 0!==n?[t,e]:[t,it({},e,{encode:{y:eO(rO(t,0))},scale:{y:{guide:null}}})]}),MO=(wO.props={},()=>(t,e)=>{var n=e["encode"],n=n["size"];return void 0!==n?[t,e]:[t,it({},e,{encode:{size:nO(rO(t,3))}})]}),OO=(MO.props={},()=>(t,e)=>{var n=e["encode"],r=n["key"],n=rt(n,["key"]);if(void 0!==r)return[t,e];const i=Object.values(n).map(({value:t})=>t);r=t.map(e=>i.filter(Array.isArray).map(t=>t[e]).join("-"));return[t,it({},e,{encode:{key:tO(r)}})]}),kO=(OO.props={},()=>(t,e)=>{var n=e["encode"],{series:r,color:i}=n;return void 0!==r||void 0===i?[t,e]:([r,i]=R(n,"color"),[t,it({},e,{encode:{series:tO(r,i)}})])}),_O=(kO.props={},()=>(t,e)=>{var n=e["data"];return!Array.isArray(n)||n.some(aO)?[t,e]:[t,it({},e,{encode:{y:tO(n)}})]}),EO=(_O.props={},()=>(t,e)=>{var n=e["data"];return!Array.isArray(n)||n.some(aO)?[t,e]:[t,it({},e,{encode:{x:tO(n)}})]}),SO=(EO.props={},()=>(t,e)=>{var n=e["encode"],r=n["y1"];return r?[t,e]:([r]=R(n,"y"),[t,it({},e,{encode:{y1:tO([...r])}})])}),AO=(SO.props={},()=>(t,e)=>{var n=e["encode"],r=n["x1"];return r?[t,e]:([r]=R(n,"x"),[t,it({},e,{encode:{x1:tO([...r])}})])}),LO=(AO.props={},t=>{const i=t["channel"];return(t,e)=>{const{encode:a,tooltip:n}=e;var r;return Uu(n)||({items:r=[]}=n,!r)||0<r.length?[t,e]:(r=(Array.isArray(i)?i:[i]).flatMap(e=>Object.keys(a).filter(t=>t.startsWith(e)).map(t=>{var{field:e,value:n,inferred:r=!1,aggregate:i}=a[t];return r?null:i&&n?{channel:t}:e?{field:e}:n?{channel:t}:null}).filter(t=>null!==t)),[t,it({},e,{tooltip:{items:r}})])}}),TO=(LO.props={},()=>(t,e)=>[t,it({scale:{x:{padding:0},y:{padding:0}}},e)]),jO=(TO.props={},()=>(t,e)=>{var{style:n={}}=e,r=rt(e,["data","style"]),{x:i,y:a}=n,n=rt(n,["x","y"]);return null==i||null==a?[t,e]:[[0],it({},r,{data:[0],cartesian:!0,encode:{x:tO([i||0]),y:tO([a||0])},scale:{x:{type:"identity",independent:!0,guide:null},y:{type:"identity",independent:!0,guide:null}},style:n})]}),NO=(jO.props={},()=>(t,e)=>{var{style:n={}}=e;return[t,it({},e,{style:Object.assign(Object.assign({},n),Object.fromEntries(Object.entries(n).filter(([,t])=>"function"==typeof t).map(([t,e])=>[t,()=>e])))})]}),PO=(NO.props={},()=>(t,e)=>{var n,r=e["data"];return!Array.isArray(r)||r.some(aO)?[t,e]:(n=(r=Array.isArray(r[0])?r:[r]).map(t=>t[0]),r=r.map(t=>t[1]),[t,it({},e,{encode:{x:tO(n),y:tO(r)}})])}),CO=(PO.props={},()=>(t,e)=>{var{style:n={}}=e,n=n["gradient"];return n?[t,it({},e,{encode:{series:nO(rO(t,void 0))}})]:[t,e]}),RO=(CO.props={},(t={})=>{const{groupBy:c="x",reverse:u=!1,orderBy:f,padding:h}=t;return rt(t,["groupBy","reverse","orderBy","padding"]),(t,e)=>{var{data:n,encode:r,scale:i}=e,i=i["series"],[a]=R(r,"y"),[r]=iO(r,"series","color"),o=uO(r,i),i=sO(c,t,e),n=lO(f)(n,a,r),s=(n&&cO(i,n),new Array(t.length));for(const l of i){u&&l.reverse();for(let t=0;t<l.length;t++)s[l[t]]=o[t]}return[t,it({},e,{scale:{series:{domain:o,paddingInner:h}},encode:{series:tO(s)}})]}}),IO=(RO.props={},t=>{const{groupBy:p=["x"],reducer:g=(t,e)=>e[t[0]],orderBy:m=null,reverse:y=!1,duration:v}=t;return(n,t)=>{const e=t["encode"];var r=(Array.isArray(p)?p:[p]).map(t=>[t,R(e,t)[0]]);if(0===r.length)return[n,t];let i=[n];for(const[,f]of r){var a=[];for(const n of i){var o=Array.from(bc(n,t=>f[t]).values());a.push(...o)}i=a}if(m){const[h]=R(e,m);h&&i.sort((t,e)=>g(t,h)-g(e,h)),y&&i.reverse()}r=(v||3e3)/i.length;const[s]=v?[rO(n,r)]:iO(e,"enterDuration",rO(n,r));var[l]=iO(e,"enterDelay",rO(n,0)),c=new Array(n.length);for(let t=0,e=0;t<i.length;t++){const n=i[t];var u=Rc(n,t=>+s[t]);for(const d of n)c[d]=+l[d]+e;e+=u}return[n,it({},t,{encode:{enterDuration:nO(s),enterDelay:nO(c)}})]}});IO.props={};const BO=(t={})=>{const{groupBy:p="x",basis:g="max"}=t;return(e,t)=>{const{encode:n,tooltip:r}=t;var i=rt(n,["x"]),a=Object.entries(i).filter(([t])=>t.startsWith("y")).map(([t])=>[t,R(n,t)[0]]),[,o]=a.find(([t])=>"y"===t),s=a.map(([t])=>[t,new Array(e.length)]),i=sO(p,e,t),l="function"==typeof(h=g)?h:{min:(t,e)=>Bc(t,t=>e[+t]),max:(t,e)=>Rc(t,t=>e[+t]),first:(t,e)=>e[t[0]],last:(t,e)=>e[t[t.length-1]],mean:(t,e)=>qc(t,t=>e[+t]),median:(t,e)=>Hc(t,t=>e[+t]),sum:(t,e)=>$c(t,t=>e[+t]),deviation:(t,e)=>dc(t,t=>e[+t])}[h]||Rc;for(const e of i){var c=l(e,o);for(const d of e)for(let t=0;t<a.length;t++){var[,u]=a[t],[,f]=s[t];f[d]=+u[d]/c}}var h=Uu(r)||(null==r?void 0:r.items)&&0!==(null==r?void 0:r.items.length);return[e,it({},t,Object.assign({encode:Object.fromEntries(s.map(([t,e])=>[t,tO(e,R(n,t)[1])]))},!h&&n.y0&&{tooltip:{items:[{channel:"y0"}]}}))]}};function FO(t,e,n){return null===t?[-.5,.5]:(t=uO(t,e),[-(e=new Yp({domain:t,range:[0,1],padding:n}).getBandWidth())/2,e/2])}function DO(t,e,n){return e*(1-t)+n*t}BO.props={};const zO=(t={})=>{const{padding:e=0,paddingX:l=e,paddingY:c=e,random:u=Math.random}=t;return(t,e)=>{var{encode:n,scale:r}=e,{x:r,y:i}=r,[a]=R(n,"x"),[n]=R(n,"y");const o=FO(a,r,l),s=FO(n,i,c);a=t.map(()=>DO(u(),...s)),r=t.map(()=>DO(u(),...o));return[t,it({scale:{x:{padding:.5},y:{padding:.5}}},e,{encode:{dy:tO(a),dx:tO(r)}})]}},WO=(zO.props={},(t={})=>{const{padding:a=0,random:o=Math.random}=t;return(t,e)=>{var{encode:n,scale:r}=e,r=r["x"],[n]=R(n,"x");const i=FO(n,r,a);n=t.map(()=>DO(o(),...i));return[t,it({scale:{x:{padding:.5}}},e,{encode:{dx:tO(n)}})]}}),GO=(WO.props={},(t={})=>{const{groupBy:g="x"}=t;return(e,t)=>{const n=t["encode"];var r=rt(n,["x"]);const i=Object.entries(r).filter(([t])=>t.startsWith("y")).map(([t])=>[t,R(n,t)[0]]);var a=i.map(([t])=>[t,new Array(e.length)]),o=sO(g,e,t),s=new Array(o.length);for(let t=0;t<o.length;t++){const e=o[t];var[l,c]=pc(e.flatMap(e=>i.map(([,t])=>+t[e])));s[t]=(l+c)/2}var u=Math.max(...s);for(let t=0;t<o.length;t++){var f=u-s[t];const e=o[t];for(const p of e)for(let t=0;t<i.length;t++){var[,h]=i[t],[,d]=a[t];d[p]=+h[p]+f}}return[e,it({},t,{encode:Object.fromEntries(a.map(([t,e])=>[t,tO(e,R(n,t)[1])]))})]}}),qO=(GO.props={},(t={})=>{const{groupBy:u="x",series:f=!0}=t;return(t,e)=>{var n=e["encode"];const[r]=R(n,"y");var[,i]=R(n,"y1"),n=(f?iO(n,"series","color"):R(n,"color"),sO(u,t,e)),a=new Array(t.length);for(const c of n){var o=c.map(t=>+r[t]);for(let n=0;n<c.length;n++){var s=c[n],l=Math.max(...o.filter((t,e)=>e!==n));a[s]=r[s]>l?l:r[s]}}return[t,it({},e,{encode:{y1:tO(a,i)}})]}});function HO(t,e){return[t[0]]}function VO(t,e){return[t[t.length-1]]}function YO(t,e){return[t[Ic(t,t=>e[t])]]}function $O(t,e){return[t[Fc(t,t=>e[t])]]}qO.props={};const UO=(t={})=>{const{groupBy:a="series",channel:o,selector:s}=t;return(t,e)=>{var n=e["encode"],t=sO(a,t,e);const[r]=R(n,o),i="function"==typeof(n=s)?n:{first:HO,last:VO,max:YO,min:$O}[n]||HO;return[t.flatMap(t=>i(t,r)),e]}},KO=(UO.props={},(t={})=>{var e=t["selector"],t=rt(t,["selector"]);return UO(Object.assign({channel:"x",selector:e},t))}),XO=(KO.props={},(t={})=>{var e=t["selector"],t=rt(t,["selector"]);return UO(Object.assign({channel:"y",selector:e},t))});function ZO(e){return t=>null===t?e:e+" of "+t}function QO(){return[(t,e)=>qc(t,t=>+e[t]),ZO("mean")]}function JO(){return[(t,e)=>Hc(t,t=>+e[t]),ZO("median")]}function tk(){return[(t,e)=>Rc(t,t=>+e[t]),ZO("max")]}function ek(){return[(t,e)=>Bc(t,t=>+e[t]),ZO("min")]}function nk(){return[(t,e)=>t.length,ZO("count")]}function rk(){return[(t,e)=>$c(t,t=>+e[t]),ZO("sum")]}function ik(){return[(t,e)=>e[t[0]],ZO("first")]}function ak(){return[(t,e)=>e[t[t.length-1]],ZO("last")]}XO.props={};const ok=(t={})=>{const i=t["groupBy"],a=rt(t,["groupBy"]);return(t,e)=>{const{data:s,encode:l}=e,c=i(t,e);if(!c)return[t,e];var t=Object.entries(a).map(([t,e])=>{const[n,r]=function(t){if("function"==typeof t)return[t,null];var e={mean:QO,max:tk,count:nk,first:ik,last:ak,sum:rk,min:ek,median:JO}[t];if(e)return e();throw new Error(`Unknown reducer: ${t}.`)}(e),[i,a]=R(l,t);e=e;var e=(o=a)||((e=e["from"])?([,e]=R(l,e),e):o),o=c.map(t=>n(t,null!==i&&void 0!==i?i:s));return[t,Object.assign(Object.assign({},(t=o,o=(null==r?void 0:r(e))||e,t=tO(t,o),Object.assign(Object.assign({},t),{constant:!1}))),{aggregate:!0})]}),n=Object.keys(l).map(t=>{const[e,n]=R(l,t);return[t,tO(c.map(t=>e[t[0]]),n)]}),r=c.map(t=>s[t[0]]);return[j0(c),it({},e,{data:r,encode:Object.fromEntries([...n,...t])})]}},sk=(ok.props={},(t={})=>{const{channels:n=["x","y"]}=t,e=rt(t,["channels"]);return ok(Object.assign(Object.assign({},e),{groupBy:(t,e)=>sO(n,t,e)}))}),lk=(sk.props={},(t={})=>sk(Object.assign(Object.assign({},t),{channels:["x","color","series"]}))),ck=(lk.props={},(t={})=>sk(Object.assign(Object.assign({},t),{channels:["y","color","series"]}))),uk=(ck.props={},(t={})=>sk(Object.assign(Object.assign({},t),{channels:["color"]})));function fk(t,e,n){var{reverse:r,slice:i,channel:a}=n,n=rt(n,["reverse","slice","channel"]),{encode:o,scale:s={}}=e,s=null==(s=s[a])?void 0:s.domain;const[l]=R(o,a);var c,n=function(t,e,n){const{by:r=t,reducer:i="max"}=e,[a]=R(n,r);if("function"==typeof i)return t=>i(t,a);if("max"===i)return t=>Rc(t,t=>+a[t]);if("min"===i)return t=>Bc(t,t=>+a[t]);if("sum"===i)return t=>$c(t,t=>+a[t]);if("median"===i)return t=>Hc(t,t=>+a[t]);if("mean"===i)return t=>qc(t,t=>+a[t]);if("first"===i)return t=>a[t[0]];if("last"===i)return t=>a[t[t.length-1]];throw new Error("Unknown reducer: "+i)}(a,n,o),o=function(t,e,n){if(!Array.isArray(n))return t;const r=new Set(n);return t.filter(t=>r.has(e[t]))}(t,l,s),n=(s=o,o=t=>l[t],(2!==(c=n).length?Oc(xc(s,c,o),([t,e],[n,r])=>ac(e,r)||ac(t,n)):Oc(bc(s,o),([t,e],[n,r])=>c(e,r)||ac(t,n))).map(([t])=>t)),s=(r&&n.reverse(),"number"==typeof i?[0,i]:i),o=i?n.slice(...s):n;return[t,it(e,{scale:{[a]:{domain:o}}})]}uk.props={};const hk=(t={})=>{const{reverse:o=!1,slice:s,channel:l,ordinal:c=!0}=t,u=rt(t,["reverse","slice","channel","ordinal"]);return(t,e)=>{if(c)return fk(t,e,Object.assign({reverse:o,slice:s,channel:l},u));{var n=Object.assign({reverse:o,slice:s,channel:l},u);var{reverse:n,channel:r}=n,i=e["encode"];const[a]=R(i,r);return i=Oc(t,t=>a[t]),n&&i.reverse(),[i,e]}}},dk=(hk.props={},(t={})=>hk(Object.assign(Object.assign({},t),{channel:"x"}))),pk=(dk.props={},(t={})=>hk(Object.assign(Object.assign({},t),{channel:"color"}))),gk=(pk.props={},(t={})=>hk(Object.assign(Object.assign({},t),{channel:"y"})));gk.props={};const mk=(t={})=>{const{field:o,channel:s="y",reducer:l="sum"}=t;return(t,e)=>{var{data:n,encode:r}=e;const[i]=R(r,"x");var a,n=o?(n=n,"string"==typeof(a=o)?n.map(t=>t[a]):n.map(a)):R(r,s)[0],r=wc(t,function(e,n){if("function"==typeof e)return t=>e(t,n);if("sum"===e)return t=>$c(t,t=>+n[t]);throw new Error("Unknown reducer: "+e)}(l,n),t=>i[t]).map(t=>t[1]);return[t,it({},e,{scale:{x:{flex:r}}})]}};function yk(t,e,n){var r=t.length;if(0===r)return[];var{innerWidth:i,innerHeight:a}=n;let l=Math.ceil(Math.sqrt(e/(a/i))),c=i/l,u=Math.ceil(e/l),o=u*c;for(;o>a;)l+=1,c=i/l,u=Math.ceil(e/l),o=u*c;const f=a-u*c,h=u<=1?0:f/(u-1),[d,p]=u<=1?[(i-r*c)/(r-1),(a-c)/2]:[0,0];return t.map((t,e)=>{var[t,n,r,i]=W0(t),a=e%l,e=Math.floor(e/l),o=a*c,s=(u-e-1)*c+f,r=c/r,i=c/i;return`translate(${o-t+d*a}, ${s-n-h*e-p}) scale(${r}, ${i})`})}mk.props={};const vk=()=>(t,e)=>[t,it({},e,{modifier:yk,axis:!1})],bk=(vk.props={},"thresholds");function xk(t){var e,[n,r]=pc(t);return Math.min(200,(n=n,r=r,e=hc(t=t),t=dc(t),e&&t?Math.ceil((r-n)*Math.cbrt(e)/(3.49*t)):1))}const wk=(t={})=>{const{groupChannels:s=["color"],binChannels:l=["x","y"]}=t,c=rt(t,["groupChannels","binChannels"]),u={};return ok(Object.assign(Object.assign(Object.assign({},Object.fromEntries(Object.entries(c).filter(([t])=>!t.startsWith(bk)))),Object.fromEntries(l.flatMap(e=>{var t=([t])=>+u[e].get(t).split(",")[1];return[[t.from=e,([t])=>+u[e].get(t).split(",")[0]],[e+"1",t]]}))),{groupBy:(t,e)=>{const n=e["encode"],i=l.map(t=>{var[t]=R(n,t);return t}),a=at(c,bk),o=t.filter(e=>i.every(t=>qu(t[e]))),r=[...s.map(t=>{var[t]=R(n,t);return t}).filter(qu).map(e=>t=>e[t]),...l.map((t,e)=>{const n=i[e];e=a[t]||xk(n),e=Cc().thresholds(e).value(t=>+n[t])(o);const r=new Map(e.flatMap(t=>{var{x0:e,x1:n}=t;const r=e+","+n;return t.map(t=>[t,r])}));return u[t]=r,t=>r.get(t)})];return Array.from(bc(o,e=>r.map(t=>t(e)).join("-")).values())}}))},Mk=(wk.props={},(t={})=>{var e=t["thresholds"];return wk(Object.assign(Object.assign({},t),{thresholdsX:e,groupChannels:["color"],binChannels:["x"]}))});function Ok(e,n,r,t){var a=e.length;if(a<=t||0===t)return e;var o,s=t=>+n[e[t]],l=t=>+r[e[t]],c=[],u=(a-2)/(t-2);let f=0,h,d;c.push(f);for(let i=0;i<t-2;i++){let t=0,e=0,n=Math.floor((i+1)*u)+1;for(var p=Math.floor((i+2)*u)+1,g=(p=Math.min(p,a))-n;n<p;n++)t+=s(n),e+=l(n);t/=g,e/=g;let r=Math.floor((i+0)*u)+1;var m=Math.floor((i+1)*u)+1,y=[s(f),l(f)];for(h=-1;r<m;r++)(o=.5*Math.abs((y[0]-t)*(s(r)-y[1])-(y[0]-l(r))*(e-y[0])))>h&&(h=o,d=r);c.push(d),f=d}return c.push(a-1),c.map(t=>e[t])}function kk(t){if("function"==typeof t)return t;if("lttb"===t)return Ok;var e={first:t=>[t[0]],last:t=>[t[t.length-1]],min:(t,e,n)=>[t[Fc(t,t=>n[t])]],max:(t,e,n)=>[t[Ic(t,t=>n[t])]],median:(t,e,n)=>{return[t[Gc(t,.5,t=>n[t])]]}};const i=e[t]||e.median;return(t,e,n,r)=>{return function(t,e){var n=t.length,r=[];let i=0;for(;i<n;)r.push(t.slice(i,i+=e));return r}(t,Math.max(1,Math.floor(t.length/r))).flatMap(t=>i(t,e,n))}}Mk.props={};const _k=(t={})=>{const{strategy:e="median",thresholds:a=2e3,groupBy:o=["series","color"]}=t,s=kk(e);return(t,e)=>{var n=e["encode"],t=sO(o,t,e);const[r]=R(n,"x"),[i]=R(n,"y");return[t.flatMap(t=>s(t,r,i,a)),e]}},Ek=(_k.props={},(s={})=>(t,e)=>{const{encode:i,data:n}=e,r=Object.entries(s).map(([t,e])=>{const[n]=R(i,t);if(!n)return null;if("function"==typeof e)return t=>e(n[t]);const r=Array.isArray(e)?e:[e];return 0===r.length?null:t=>r.includes(n[t])}).filter(qu);if(0===r.length)return[t,e];const a=t.filter(e=>r.every(t=>t(e))),o=a.map((t,e)=>e);t=Object.entries(i).map(([t,e])=>[t,Object.assign(Object.assign({},e),{value:o.map(t=>e.value[a[t]])})]);return[o,it({},e,{encode:Object.fromEntries(t),data:a.map(t=>n[t])})]});function Sk(t){var{min:t,max:e}=t;return[[t[0],t[1]],[e[0],e[1]]]}function Ak(t,e){var[t,n]=t,[e,r]=e;return t>=e[0]&&t<=r[0]&&n>=e[1]&&n<=r[1]}Ek.props={};const Lk=t=>{const r=t["priority"];return(t,e)=>{const n=[];return r&&t.sort(r),t.forEach(t=>{Hw(t);const i=t.getLocalBounds();n.some(t=>{var e=Sk(i),t=Sk(t.getLocalBounds()),[e,n]=e,[t,r]=t;return e[0]<r[0]&&n[0]>t[0]&&e[1]<r[1]&&n[1]>t[1]})?qw(t):n.push(t)}),t}};function Tk(){const n=new Map;return[t=>n.get(t),(t,e)=>n.set(t,e)]}const jk=t=>{const{maxIterations:M=10,maxError:O=.1,padding:k=1}=t;return i=>{var e=i.length;if(!(e<=1)){const[g,m]=Tk(),[y,v]=Tk();var a,o,s,l,[c,t]=Tk(),[u,n]=Tk();for(const b of i){var{min:r,max:f}=function(t){var t=t.cloneNode(!0),{min:e,max:n}=((e=t.getElementById("connector"))&&t.removeChild(e),t.getRenderBounds());return t.destroy(),{min:e,max:n}}(b);const[x,g]=r;var[r,f]=f;m(b,g),v(b,g),t(b,f-g),n(b,[x,r])}for(let t=0;t<M;t++){i.sort((t,e)=>ac(y(t),y(e)));let r=0;for(let n=0;n<e-1;n++){var h=i[n];let t=n+1,e;for(;(e=i[t])&&([[a,o],[s,l]]=[u(h),u(e)],!(a<l&&s<o));)t+=1;if(e){const g=y(h);var d=c(h),p=y(e),d=p-(g+d);d<k&&(d=(k-d)/2,r=Math.max(r,d),v(h,g-d),v(e,p+d))}}if(r<O)break}for(const w of i)w.style.y+=y(w)-g(w)}return i}};function Nk(t){t/=255;return t<=.03928?t/12.92:Math.pow((.055+t)/1.055,2.4)}function Pk(t,e,n){return.2126*Nk(t)+.7152*Nk(e)+.0722*Nk(n)}function Ck(t,e){var{r:t,g:n,b:r}=t,{r:e,g:i,b:a}=e,t=Pk(t,n,r),n=Pk(e,i,a);return(Math.max(t,n)+.05)/(Math.min(t,n)+.05)}function Rk(e,t){return t[Ic(t,t=>{return Ck(e,"object"==typeof(t=t)?t:nt.parseColor(t))})]}const Ik=t=>{const{threshold:n=4.5,palette:r=["#000","#fff"]}=t;return(t,e)=>(t.forEach(t=>{var e=t.attr("dependentElement").parsedStyle.fill;Ck(t.parsedStyle.fill,e)<n&&t.attr("fill",Rk(e,r))}),t)},Bk=t=>(t,e)=>(t.forEach(t=>{Hw(t);var e=t.attr("bounds");!function(t,e){var[t,n]=t;return!(Ak(t,e)&&Ak(n,e))}(Sk(t.getLocalBounds()),e)||qw(t)}),t);var T=1e-6,Fk=1e-12,S=Math.PI,Dk=S/2,zk=S/4,Wk=2*S,Gk=180/S,qk=S/180,Hk=Math.abs,Vk=Math.atan,Yk=Math.atan2,A=Math.cos,$k=Math.ceil,Uk=Math.exp,Kk=Math.log,Xk=Math.pow,L=Math.sin,Zk=Math.sign||function(t){return 0<t?1:t<0?-1:0},Qk=Math.sqrt,Jk=Math.tan;function t3(t){return 1<t?0:t<-1?S:Math.acos(t)}function e3(t){return 1<t?Dk:t<-1?-Dk:Math.asin(t)}function n3(){}function r3(t,e){t&&a3.hasOwnProperty(t.type)&&a3[t.type](t,e)}var i3={Feature:function(t,e){r3(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r<i;)r3(n[r].geometry,e)}},a3={Sphere:function(t,e){e.sphere()},Point:function(t,e){t=t.coordinates,e.point(t[0],t[1],t[2])},MultiPoint:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)t=n[r],e.point(t[0],t[1],t[2])},LineString:function(t,e){o3(t.coordinates,e,0)},MultiLineString:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)o3(n[r],e,0)},Polygon:function(t,e){s3(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)s3(n[r],e)},GeometryCollection:function(t,e){for(var n=t.geometries,r=-1,i=n.length;++r<i;)r3(n[r],e)}};function o3(t,e,n){var r,i=-1,a=t.length-n;for(e.lineStart();++i<a;)r=t[i],e.point(r[0],r[1],r[2]);e.lineEnd()}function s3(t,e){var n=-1,r=t.length;for(e.polygonStart();++n<r;)o3(t[n],e,1);e.polygonEnd()}function l3(t,e){t&&i3.hasOwnProperty(t.type)?i3[t.type](t,e):r3(t,e)}function c3(t){return[Yk(t[1],t[0]),e3(t[2])]}function u3(t){var e=t[0],t=t[1],n=A(t);return[n*A(e),n*L(e),L(t)]}function f3(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function h3(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function d3(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function p3(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function g3(t){var e=Qk(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function m3(n,r){function t(t,e){return t=n(t,e),r(t[0],t[1])}return n.invert&&r.invert&&(t.invert=function(t,e){return(t=r.invert(t,e))&&n.invert(t[0],t[1])}),t}function y3(t,e){return Hk(t)>S&&(t-=Math.round(t/Wk)*Wk),[t,e]}function v3(t,e,n){return(t%=Wk)?e||n?m3(x3(t),w3(e,n)):x3(t):e||n?w3(e,n):y3}function b3(n){return function(t,e){return Hk(t+=n)>S&&(t-=Math.round(t/Wk)*Wk),[t,e]}}function x3(t){var e=b3(t);return e.invert=b3(-t),e}function w3(t,e){var i=A(t),a=L(t),o=A(e),s=L(e);function n(t,e){var n=A(e),r=A(t)*n,t=L(t)*n,n=L(e),e=n*i+r*a;return[Yk(t*o-e*s,r*i-n*a),e3(e*o+t*s)]}return n.invert=function(t,e){var n=A(e),r=A(t)*n,t=L(t)*n,n=L(e),e=n*o-t*s;return[Yk(t*o+n*s,r*i+e*a),e3(e*i-r*a)]},n}function M3(t,e){(e=u3(e))[0]-=t,g3(e);t=t3(-e[1]);return((-e[2]<0?-t:t)+Wk-T)%Wk}function O3(){var r,e=[];return{point:function(t,e,n){r.push([t,e,n])},lineStart:function(){e.push(r=[])},lineEnd:n3,rejoin:function(){1<e.length&&e.push(e.pop().concat(e.shift()))},result:function(){var t=e;return e=[],r=null,t}}}function k3(t,e){return Hk(t[0]-e[0])<T&&Hk(t[1]-e[1])<T}function _3(t,e,n,r){this.x=t,this.z=e,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}function E3(t,e,n,r,a){var o,i,s=[],l=[];if(t.forEach(function(t){if(!((e=t.length-1)<=0)){var e,n,r=t[0],i=t[e];if(k3(r,i)){if(!r[2]&&!i[2]){for(a.lineStart(),o=0;o<e;++o)a.point((r=t[o])[0],r[1]);return void a.lineEnd()}i[0]+=2*T}s.push(n=new _3(r,t,null,!0)),l.push(n.o=new _3(r,null,n,!1)),s.push(n=new _3(i,t,null,!1)),l.push(n.o=new _3(i,null,n,!0))}}),s.length){for(l.sort(e),S3(s),S3(l),o=0,i=l.length;o<i;++o)l[o].e=n=!n;for(var c,u,f=s[0];;){for(var h=f,d=!0;h.v;)if((h=h.n)===f)return;c=h.z,a.lineStart();do{if(h.v=h.o.v=!0,h.e){if(d)for(o=0,i=c.length;o<i;++o)a.point((u=c[o])[0],u[1]);else r(h.x,h.n.x,1,a);h=h.n}else{if(d)for(c=h.p.z,o=c.length-1;0<=o;--o)a.point((u=c[o])[0],u[1]);else r(h.x,h.p.x,-1,a);h=h.p}}while(c=(h=h.o).z,d=!d,!h.v);a.lineEnd()}}}function S3(t){if(e=t.length){for(var e,n,r=0,i=t[0];++r<e;)i.n=n=t[r],n.p=i,i=n;i.n=n=t[0],n.p=i}}function A3(t){return Hk(t[0])<=S?t[0]:Zk(t[0])*((Hk(t[0])+S)%Wk-S)}function L3(m,y,v,b){return function(s){var l,c,u,n=y(s),f=O3(),h=y(f),d=!1,e={point:r,lineStart:i,lineEnd:a,polygonStart:function(){e.point=p,e.lineStart=o,e.lineEnd=g,c=[],l=[]},polygonEnd:function(){e.point=r,e.lineStart=i,e.lineEnd=a,c=Vc(c);var t=function(t,e){var n=A3(e),r=e[1],e=L(r),i=[L(n),-A(n),0],a=0,o=0,s=new gc;1===e?r=Dk+T:-1===e&&(r=-Dk-T);for(var l=0,c=t.length;l<c;++l)if(f=(u=t[l]).length)for(var u,f,h=u[f-1],d=A3(h),p=h[1]/2+zk,g=L(p),m=A(p),y=0;y<f;++y,d=b,g=w,m=x,h=v){var v=u[y],b=A3(v),x=v[1]/2+zk,w=L(x),x=A(x),M=b-d,O=0<=M?1:-1,k=O*M,_=S<k,E=g*w;s.add(Yk(E*O*L(k),m*x+E*A(k))),a+=_?M+O*Wk:M,_^n<=d^n<=b&&(g3(E=h3(u3(h),u3(v))),g3(k=h3(i,E)),(O=(_^0<=M?-1:1)*e3(k[2]))<r||r===O&&(E[0]||E[1]))&&(o+=_^0<=M?1:-1)}return(a<-T||a<T&&s<-Fk)^1&o}(l,b);c.length?(d||(s.polygonStart(),d=!0),E3(c,j3,t,v,s)):t&&(d||(s.polygonStart(),d=!0),s.lineStart(),v(null,null,1,s),s.lineEnd()),d&&(s.polygonEnd(),d=!1),c=l=null},sphere:function(){s.polygonStart(),s.lineStart(),v(null,null,1,s),s.lineEnd(),s.polygonEnd()}};function r(t,e){m(t,e)&&s.point(t,e)}function t(t,e){n.point(t,e)}function i(){e.point=t,n.lineStart()}function a(){e.point=r,n.lineEnd()}function p(t,e){u.push([t,e]),h.point(t,e)}function o(){h.lineStart(),u=[]}function g(){p(u[0][0],u[0][1]),h.lineEnd();var t,e,n,r,i=h.clean(),a=f.result(),o=a.length;if(u.pop(),l.push(u),u=null,o)if(1&i){if(0<(e=(n=a[0]).length-1)){for(d||(s.polygonStart(),d=!0),s.lineStart(),t=0;t<e;++t)s.point((r=n[t])[0],r[1]);s.lineEnd()}}else 1<o&&2&i&&a.push(a.pop().concat(a.shift())),c.push(a.filter(T3))}return e}}function T3(t){return 1<t.length}function j3(t,e){return((t=t.x)[0]<0?t[1]-Dk-T:Dk-t[1])-((e=e.x)[0]<0?e[1]-Dk-T:Dk-e[1])}y3.invert=y3;var N3=L3(function(){return 1},function(c){var u,f=NaN,h=NaN,d=NaN;return{lineStart:function(){c.lineStart(),u=1},point:function(t,e){var n,r,i,a,o,s=0<t?S:-S,l=Hk(t-f);Hk(l-S)<T?(c.point(f,h=0<(h+e)/2?Dk:-Dk),c.point(d,h),c.lineEnd(),c.lineStart(),c.point(s,h),c.point(t,h),u=0):d!==s&&S<=l&&(Hk(f-d)<T&&(f-=d*T),Hk(t-s)<T&&(t-=s*T),l=h,i=e,o=L((n=f)-(r=t)),h=Hk(o)>T?Vk((L(l)*(a=A(i))*L(r)-L(i)*(r=A(l))*L(n))/(r*a*o)):(l+i)/2,c.point(d,h),c.lineEnd(),c.lineStart(),c.point(s,h),u=0),c.point(f=t,h=e),d=s},lineEnd:function(){c.lineEnd(),f=h=NaN},clean:function(){return 2-u}}},function(t,e,n,r){var i;null==t?(i=n*Dk,r.point(-S,i),r.point(0,i),r.point(S,i),r.point(S,0),r.point(S,-i),r.point(0,-i),r.point(-S,-i),r.point(-S,0),r.point(-S,i)):Hk(t[0]-e[0])>T?(t=t[0]<e[0]?S:-S,i=n*t/2,r.point(-t,i),r.point(0,i),r.point(t,i)):r.point(e[0],e[1])},[-S,-Dk]);function P3(d){var g=A(d),p=6*qk,f=0<g,h=Hk(g)>T;function m(t,e){return A(t)*A(e)>g}function y(t,e,n){var r,i,a,o,s,l,c,u=[1,0,0],f=h3(u3(t),u3(e)),h=f3(f,f),d=f[0],p=h-d*d;return p?(r=h3(u,f),d3(u=p3(u,g*h/p),p3(f,-g*d/p)),(p=(f=f3(u,h=r))*f-(d=f3(h,h))*(f3(u,u)-1))<0?void 0:(d3(p=p3(h,(-f-(r=Qk(p)))/d),u),p=c3(p),n?(i=t[0],a=e[0],o=t[1],e=e[1],a<i&&(c=i,i=a,a=c),!(l=Hk((s=a-i)-S)<T)&&e<o&&(c=o,o=e,e=c),(l||s<T?l?0<o+e^p[1]<(Hk(p[0]-i)<T?o:e):o<=p[1]&&p[1]<=e:S<s^(i<=p[0]&&p[0]<=a))?(d3(c=p3(h,(-f+r)/d),u),[p,c3(c)]):void 0):p)):!n&&t}function v(t,e){var n=f?d:S-d,r=0;return t<-n?r|=1:n<t&&(r|=2),e<-n?r|=4:n<e&&(r|=8),r}return L3(m,function(a){var o,s,l,c,u;return{lineStart:function(){c=l=!1,u=1},point:function(t,e){var n,r=[t,e],i=m(t,e),t=f?i?0:v(t,e):i?v(t+(t<0?S:-S),e):0;!o&&(c=l=i)&&a.lineStart(),i===l||(n=y(o,r))&&!k3(o,n)&&!k3(r,n)||(r[2]=1),i!==l?(u=0,i?(a.lineStart(),n=y(r,o),a.point(n[0],n[1])):(n=y(o,r),a.point(n[0],n[1],2),a.lineEnd()),o=n):h&&o&&f^i&&(t&s||!(e=y(r,o,!0))||(u=0,f?(a.lineStart(),a.point(e[0][0],e[0][1]),a.point(e[1][0],e[1][1]),a.lineEnd()):(a.point(e[1][0],e[1][1]),a.lineEnd(),a.lineStart(),a.point(e[0][0],e[0][1],3)))),!i||o&&k3(o,r)||a.point(r[0],r[1]),o=r,l=i,s=t},lineEnd:function(){l&&a.lineEnd(),o=null},clean:function(){return u|(c&&l)<<1}}},function(t,e,n,r){var i=r,r=d,a=p,o=n,n=t,s=e;if(a){var l=A(r),c=L(r),u=o*a;null==n?(n=r+o*Wk,s=r-u/2):(n=M3(l,n),s=M3(l,s),(0<o?n<s:s<n)&&(n+=o*Wk));for(var f,h=n;0<o?s<h:h<s;h-=u)f=c3([l,-c*A(h),-c*L(h)]),i.point(f[0],f[1])}},f?[0,-d]:[-S,d-S])}var C3=1e9,R3=-C3;function I3(y,v,b,x){function w(t,e){return y<=t&&t<=b&&v<=e&&e<=x}function M(t,e,n,r){var i=0,a=0;if(null==t||(i=o(t,n))!==(a=o(e,n))||s(t,e)<0^0<n)for(;r.point(0===i||3===i?y:b,1<i?x:v),(i=(i+n+4)%4)!==a;);else r.point(e[0],e[1])}function o(t,e){return Hk(t[0]-y)<T?0<e?0:3:Hk(t[0]-b)<T?0<e?2:1:Hk(t[1]-v)<T?0<e?1:0:0<e?3:2}function O(t,e){return s(t.x,e.x)}function s(t,e){var n=o(t,1),r=o(e,1);return n!==r?n-r:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]}return function(r){var i,f,a,o,s,l,c,u,h,d,p,g=r,t=O3(),e={point:n,lineStart:function(){e.point=m,f&&f.push(a=[]);d=!0,h=!1,c=u=NaN},lineEnd:function(){i&&(m(o,s),l&&h&&t.rejoin(),i.push(t.result()));e.point=n,h&&g.lineEnd()},polygonStart:function(){g=t,i=[],f=[],p=!0},polygonEnd:function(){var t=function(){for(var t=0,e=0,n=f.length;e<n;++e)for(var r,i,a=f[e],o=1,s=a.length,l=a[0],c=l[0],u=l[1];o<s;++o)r=c,i=u,l=a[o],c=l[0],u=l[1],i<=x?x<u&&(u-i)*(y-r)<(c-r)*(x-i)&&++t:u<=x&&(c-r)*(x-i)<(u-i)*(y-r)&&--t;return t}(),e=p&&t,n=(i=Vc(i)).length;(e||n)&&(r.polygonStart(),e&&(r.lineStart(),M(null,null,1,r),r.lineEnd()),n&&E3(i,O,t,M,r),r.polygonEnd());g=r,i=f=a=null}};function n(t,e){w(t,e)&&g.point(t,e)}function m(t,e){var n,r,i=w(t,e);f&&a.push([t,e]),d?(o=t,s=e,d=!1,(l=i)&&(g.lineStart(),g.point(t,e))):i&&h?g.point(t,e):!function(t,e,n,r,i,a){var o=t[0],s=t[1],l=0,c=1,u=e[0]-o,f=e[1]-s,n=n-o;if(u||!(0<n)){if(n/=u,u<0){if(n<l)return;n<c&&(c=n)}else if(0<u){if(c<n)return;l<n&&(l=n)}if(n=i-o,u||!(n<0)){if(n/=u,u<0){if(c<n)return;l<n&&(l=n)}else if(0<u){if(n<l)return;n<c&&(c=n)}if(n=r-s,f||!(0<n)){if(n/=f,f<0){if(n<l)return;n<c&&(c=n)}else if(0<f){if(c<n)return;l<n&&(l=n)}if(n=a-s,f||!(n<0)){if(n/=f,f<0){if(c<n)return;l<n&&(l=n)}else if(0<f){if(n<l)return;n<c&&(c=n)}return 0<l&&(t[0]=o+l*u,t[1]=s+l*f),c<1&&(e[0]=o+c*u,e[1]=s+c*f),1}}}}}(n=[c=Math.max(R3,Math.min(C3,c)),u=Math.max(R3,Math.min(C3,u))],r=[t=Math.max(R3,Math.min(C3,t)),e=Math.max(R3,Math.min(C3,e))],y,v,b,x)?i&&(g.lineStart(),g.point(t,e),p=!1):(h||(g.lineStart(),g.point(n[0],n[1])),g.point(r[0],r[1]),i||g.lineEnd(),p=!1),c=t,u=e,h=i}return e}}function B3(t,e,n){var r=Yc(t,e-T,n).concat(e);return function(e){return r.map(function(t){return[e,t]})}}function F3(t,e,n){var r=Yc(t,e-T,n).concat(e);return function(e){return r.map(function(t){return[t,e]})}}function D3(){return g=p=10,m=90,y=360,v=2.5,e.lines=function(){return t().map(function(t){return{type:"LineString",coordinates:t}})},e.outline=function(){return{type:"Polygon",coordinates:[h(a).concat(d(l).slice(1),h(i).reverse().slice(1),d(c).reverse().slice(1))]}},e.extent=function(t){return arguments.length?e.extentMajor(t).extentMinor(t):e.extentMinor()},e.extentMajor=function(t){return arguments.length?(a=+t[0][0],i=+t[1][0],c=+t[0][1],l=+t[1][1],i<a&&(t=a,a=i,i=t),l<c&&(t=c,c=l,l=t),e.precision(v)):[[a,c],[i,l]]},e.extentMinor=function(t){return arguments.length?(r=+t[0][0],n=+t[1][0],s=+t[0][1],o=+t[1][1],n<r&&(t=r,r=n,n=t),o<s&&(t=s,s=o,o=t),e.precision(v)):[[r,s],[n,o]]},e.step=function(t){return arguments.length?e.stepMajor(t).stepMinor(t):e.stepMinor()},e.stepMajor=function(t){return arguments.length?(m=+t[0],y=+t[1],e):[m,y]},e.stepMinor=function(t){return arguments.length?(p=+t[0],g=+t[1],e):[p,g]},e.precision=function(t){return arguments.length?(v=+t,u=B3(s,o,90),f=F3(r,n,v),h=B3(c,l,90),d=F3(a,i,v),e):v},e.extentMajor([[-180,-90+T],[180,90-T]]).extentMinor([[-180,-80-T],[180,80+T]])();function e(){return{type:"MultiLineString",coordinates:t()}}function t(){return Yc($k(a/m)*m,i,m).map(h).concat(Yc($k(c/y)*y,l,y).map(d)).concat(Yc($k(r/p)*p,n,p).filter(function(t){return Hk(t%m)>T}).map(u)).concat(Yc($k(s/g)*g,o,g).filter(function(t){return Hk(t%y)>T}).map(f))}var n,r,i,a,o,s,l,c,u,f,h,d,p,g,m,y,v}var z3,W3,G3,q3,H3=t=>t,V3=new gc,Y3=new gc,$3={point:n3,lineStart:n3,lineEnd:n3,polygonStart:function(){$3.lineStart=U3,$3.lineEnd=Z3},polygonEnd:function(){$3.lineStart=$3.lineEnd=$3.point=n3,V3.add(Hk(Y3)),Y3=new gc},result:function(){var t=V3/2;return V3=new gc,t}};function U3(){$3.point=K3}function K3(t,e){$3.point=X3,z3=G3=t,W3=q3=e}function X3(t,e){Y3.add(q3*t-G3*e),G3=t,q3=e}function Z3(){X3(z3,W3)}var Q3=$3,J3=1/0,t4=J3,e4=-J3,n4=e4;var r4,i4,a4,o4,s4={point:function(t,e){t<J3&&(J3=t);e4<t&&(e4=t);e<t4&&(t4=e);n4<e&&(n4=e)},lineStart:n3,lineEnd:n3,polygonStart:n3,polygonEnd:n3,result:function(){var t=[[J3,t4],[e4,n4]];return e4=n4=-(t4=J3=1/0),t}},l4=0,c4=0,u4=0,f4=0,h4=0,d4=0,p4=0,g4=0,m4=0,y4={point:v4,lineStart:b4,lineEnd:M4,polygonStart:function(){y4.lineStart=O4,y4.lineEnd=k4},polygonEnd:function(){y4.point=v4,y4.lineStart=b4,y4.lineEnd=M4},result:function(){var t=m4?[p4/m4,g4/m4]:d4?[f4/d4,h4/d4]:u4?[l4/u4,c4/u4]:[NaN,NaN];return l4=c4=u4=f4=h4=d4=p4=g4=m4=0,t}};function v4(t,e){l4+=t,c4+=e,++u4}function b4(){y4.point=x4}function x4(t,e){y4.point=w4,v4(a4=t,o4=e)}function w4(t,e){var n=t-a4,r=e-o4,n=Qk(n*n+r*r);f4+=n*(a4+t)/2,h4+=n*(o4+e)/2,d4+=n,v4(a4=t,o4=e)}function M4(){y4.point=v4}function O4(){y4.point=_4}function k4(){E4(r4,i4)}function _4(t,e){y4.point=E4,v4(r4=a4=t,i4=o4=e)}function E4(t,e){var n=t-a4,r=e-o4,n=Qk(n*n+r*r);f4+=n*(a4+t)/2,h4+=n*(o4+e)/2,d4+=n,p4+=(n=o4*t-a4*e)*(a4+t),g4+=n*(o4+e),m4+=3*n,v4(a4=t,o4=e)}var S4=y4;function A4(t){this._context=t}A4.prototype={_radius:4.5,pointRadius:function(t){return this._radius=t,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(t,e){switch(this._point){case 0:this._context.moveTo(t,e),this._point=1;break;case 1:this._context.lineTo(t,e);break;default:this._context.moveTo(t+this._radius,e),this._context.arc(t,e,this._radius,0,Wk)}},result:n3};var L4,T4,j4,N4,P4,C4=new gc,R4={point:n3,lineStart:function(){R4.point=I4},lineEnd:function(){L4&&B4(T4,j4),R4.point=n3},polygonStart:function(){L4=!0},polygonEnd:function(){L4=null},result:function(){var t=+C4;return C4=new gc,t}};function I4(t,e){R4.point=B4,T4=N4=t,j4=P4=e}function B4(t,e){N4-=t,P4-=e,C4.add(Qk(N4*N4+P4*P4)),N4=t,P4=e}var F4=R4;let D4,z4,W4,G4;class q4{constructor(t){this._append=null==t?H4:function(t){var e=Math.floor(t);if(!(0<=e))throw new RangeError("invalid digits: "+t);if(15<e)return H4;if(e!==D4){const r=10**e;D4=e,z4=function(t){let e=1;this._+=t[0];for(var n=t.length;e<n;++e)this._+=Math.round(arguments[e]*r)/r+t[e]}}return z4}(t),this._radius=4.5,this._=""}pointRadius(t){return this._radius=+t,this}polygonStart(){this._line=0}polygonEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){0===this._line&&(this._+="Z"),this._point=NaN}point(t,e){switch(this._point){case 0:this._append`M${t},${e}`,this._point=1;break;case 1:this._append`L${t},${e}`;break;default:var n,r;this._append`M${t},${e}`,this._radius===W4&&this._append===z4||(n=this._radius,r=this._,this._="",this._append`m0,${n}a${n},${n} 0 1,1 0,${-2*n}a${n},${n} 0 1,1 0,${2*n}z`,W4=n,z4=this._append,G4=this._,this._=r),this._+=G4}}result(){var t=this._;return this._="",t.length?t:null}}function H4(t){let e=1;this._+=t[0];for(var n=t.length;e<n;++e)this._+=arguments[e]+t[e]}function V4(e,n){let r=3,i=4.5,a,o;function s(t){return t&&("function"==typeof i&&o.pointRadius(+i.apply(this,arguments)),l3(t,a(o))),o.result()}return s.area=function(t){return l3(t,a(Q3)),Q3.result()},s.measure=function(t){return l3(t,a(F4)),F4.result()},s.bounds=function(t){return l3(t,a(s4)),s4.result()},s.centroid=function(t){return l3(t,a(S4)),S4.result()},s.projection=function(t){return arguments.length?(a=null==t?(e=null,H3):(e=t).stream,s):e},s.context=function(t){return arguments.length?(o=null==t?(n=null,new q4(r)):new A4(n=t),"function"!=typeof i&&o.pointRadius(i),s):n},s.pointRadius=function(t){return arguments.length?(i="function"==typeof t?t:(o.pointRadius(+t),+t),s):i},s.digits=function(t){if(!arguments.length)return r;if(null==t)r=null;else{var e=Math.floor(t);if(!(0<=e))throw new RangeError("invalid digits: "+t);r=e}return null===n&&(o=new q4(r)),s},s.projection(e).digits(r).context(n)}function Y4(r){return function(t){var e,n=new $4;for(e in r)n[e]=r[e];return n.stream=t,n}}function $4(){}function U4(t,e,n){var r=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=r&&t.clipExtent(null),l3(n,t.stream(s4)),e(s4.result()),null!=r&&t.clipExtent(r),t}function K4(i,a,t){return U4(i,function(t){var e=a[1][0]-a[0][0],n=a[1][1]-a[0][1],r=Math.min(e/(t[1][0]-t[0][0]),n/(t[1][1]-t[0][1])),e=+a[0][0]+(e-r*(t[1][0]+t[0][0]))/2,n=+a[0][1]+(n-r*(t[1][1]+t[0][1]))/2;i.scale(150*r).translate([e,n])},t)}function X4(t,e,n){return K4(t,[[0,0],e],n)}function Z4(r,i,t){return U4(r,function(t){var e=+i,n=e/(t[1][0]-t[0][0]),e=(e-n*(t[1][0]+t[0][0]))/2,t=-n*t[0][1];r.scale(150*n).translate([e,t])},t)}function Q4(i,a,t){return U4(i,function(t){var e=+a,n=e/(t[1][1]-t[0][1]),r=-n*t[0][0],e=(e-n*(t[1][1]+t[0][1]))/2;i.scale(150*n).translate([r,e])},t)}$4.prototype={constructor:$4,point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var J4=16,t6=A(30*qk);function e6(t,e){return+e?(S=t,A=e,function(r){var n,i,a,o,s,l,c,u,f,h,d,p,g={point:t,lineStart:e,lineEnd:y,polygonStart:function(){r.polygonStart(),g.lineStart=v},polygonEnd:function(){r.polygonEnd(),g.lineStart=e}};function t(t,e){t=S(t,e),r.point(t[0],t[1])}function e(){u=NaN,g.point=m,r.lineStart()}function m(t,e){var n=u3([t,e]),e=S(t,e);L(u,f,c,h,d,p,u=e[0],f=e[1],c=t,h=n[0],d=n[1],p=n[2],J4,r),r.point(u,f)}function y(){g.point=t,r.lineEnd()}function v(){e(),g.point=b,g.lineEnd=x}function b(t,e){m(n=t,e),i=u,a=f,o=h,s=d,l=p,g.point=m}function x(){L(u,f,c,h,d,p,i,a,n,o,s,l,J4,r),g.lineEnd=y,y()}return g}):(n=t,Y4({point:function(t,e){t=n(t,e),this.stream.point(t[0],t[1])}}));var n,S,A;function L(t,e,n,r,i,a,o,s,l,c,u,f,h,d){var p,g,m,y,v,b,x,w,M,O,k=o-t,_=s-e,E=k*k+_*_;4*A<E&&h--&&(m=a+f,x=e3(m/=y=Qk((p=r+c)*p+(g=i+u)*g+m*m)),v=Hk(Hk(m)-1)<T||Hk(n-l)<T?(n+l)/2:Yk(g,p),b=(x=S(v,x))[0],x=x[1],A<(O=_*(w=b-t)-k*(M=x-e))*O/E||.3<Hk((k*w+_*M)/E-.5)||r*c+i*u+a*f<t6)&&(L(t,e,n,r,i,a,b,x,v,p/=y,g/=y,m,h,d),d.point(b,x),L(b,x,v,p,g,m,o,s,l,c,u,f,h,d))}}var n6=Y4({point:function(t,e){this.stream.point(t*qk,e*qk)}});function r6(t,n,r,i,a,e){var o,s,l,c,u,f,h,d,p,g,m,y;return e?(f=A(e),e=L(e),h=f*t,d=e*t,p=f/t,g=e/t,m=(e*r-f*n)/t,y=(e*n+f*r)/t,b.invert=function(t,e){return[i*(p*t-g*e+m),a*(y-g*t-p*e)]},b):(o=t,s=n,l=r,c=i,u=a,v.invert=function(t,e){return[(t-s)/o*c,(l-e)/o*u]},v);function v(t,e){return[s+o*(t*=c),l-o*(e*=u)]}function b(t,e){return[h*(t*=i)-d*(e*=a)+n,r-d*t-h*e]}}function i6(t){return a6(function(){return t})()}function a6(t){var e,r,n,i,a,o,s,l,c,u,f=150,h=480,d=250,p=0,g=0,m=0,y=0,v=0,b=0,x=1,w=1,M=null,O=N3,k=null,_=H3,E=.5;function S(t){return l(t[0]*qk,t[1]*qk)}function A(t){return(t=l.invert(t[0],t[1]))&&[t[0]*Gk,t[1]*Gk]}function L(){var t=r6(f,0,0,x,w,b).apply(null,e(p,g)),t=r6(f,h-t[0],d-t[1],x,w,b);return r=v3(m,y,v),s=m3(e,t),l=m3(r,s),o=e6(s,E),T()}function T(){return c=u=null,S}return S.stream=function(t){return c&&u===t?c:c=n6((n=r,Y4({point:function(t,e){t=n(t,e);return this.stream.point(t[0],t[1])}})(O(o(_(u=t))))));var n},S.preclip=function(t){return arguments.length?(O=t,M=void 0,T()):O},S.postclip=function(t){return arguments.length?(_=t,k=n=i=a=null,T()):_},S.clipAngle=function(t){return arguments.length?(O=+t?P3(M=t*qk):(M=null,N3),T()):M*Gk},S.clipExtent=function(t){return arguments.length?(_=null==t?(k=n=i=a=null,H3):I3(k=+t[0][0],n=+t[0][1],i=+t[1][0],a=+t[1][1]),T()):null==k?null:[[k,n],[i,a]]},S.scale=function(t){return arguments.length?(f=+t,L()):f},S.translate=function(t){return arguments.length?(h=+t[0],d=+t[1],L()):[h,d]},S.center=function(t){return arguments.length?(p=t[0]%360*qk,g=t[1]%360*qk,L()):[p*Gk,g*Gk]},S.rotate=function(t){return arguments.length?(m=t[0]%360*qk,y=t[1]%360*qk,v=2<t.length?t[2]%360*qk:0,L()):[m*Gk,y*Gk,v*Gk]},S.angle=function(t){return arguments.length?(b=t%360*qk,L()):b*Gk},S.reflectX=function(t){return arguments.length?(x=t?-1:1,L()):x<0},S.reflectY=function(t){return arguments.length?(w=t?-1:1,L()):w<0},S.precision=function(t){return arguments.length?(o=e6(s,E=t*t),T()):Qk(E)},S.fitExtent=function(t,e){return K4(S,t,e)},S.fitSize=function(t,e){return X4(S,t,e)},S.fitWidth=function(t,e){return Z4(S,t,e)},S.fitHeight=function(t,e){return Q4(S,t,e)},function(){return e=t.apply(this,arguments),S.invert=e.invert&&A,L()}}function o6(t){var e=0,n=S/3,r=a6(t),t=r(e,n);return t.parallels=function(t){return arguments.length?r(e=t[0]*qk,n=t[1]*qk):[e*Gk,n*Gk]},t}function s6(t,e){var n,r,i,a=L(t),o=(a+L(e))/2;return Hk(o)<T?(n=A(t),s.invert=function(t,e){return[t/n,e3(e*n)]},s):(i=Qk(r=1+a*(2*o-a))/o,l.invert=function(t,e){var e=i-e,n=Yk(t,Hk(e))*Zk(e);return e*o<0&&(n-=S*Zk(t)*Zk(e)),[n/o,e3((r-(t*t+e*e)*o*o)/(2*o))]},l);function s(t,e){return[t*n,L(e)/n]}function l(t,e){e=Qk(r-2*o*L(e))/o;return[e*L(t*=o),i-e*A(t)]}}function l6(){return o6(s6).scale(155.424).center([0,33.6442])}function c6(){return l6().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function u6(i){return function(t,e){var n=A(t),r=A(e),n=i(n*r);return n===1/0?[2,0]:[n*r*L(t),n*L(e)]}}function f6(a){return function(t,e){var n=Qk(t*t+e*e),r=a(n),i=L(r),r=A(r);return[Yk(t*i,n*r),e3(n&&e*i/n)]}}var h6=u6(function(t){return Qk(2/(1+t))});h6.invert=f6(function(t){return 2*e3(t/2)});var d6=u6(function(t){return(t=t3(t))&&t/L(t)});function p6(t,e){return[t,Kk(Jk((Dk+e)/2))]}function g6(r){var i,a,o,s=i6(r),e=s.center,l=s.scale,n=s.translate,c=s.clipExtent,u=null;function f(){var e,t=S*l(),n=s((e=v3((e=s.rotate())[0]*qk,e[1]*qk,2<e.length?e[2]*qk:0),function(t){return(t=e.invert(t[0]*qk,t[1]*qk))[0]*=Gk,t[1]*=Gk,t}([0,0])));return c(null==u?[[n[0]-t,n[1]-t],[n[0]+t,n[1]+t]]:r===p6?[[Math.max(n[0]-t,u),i],[Math.min(n[0]+t,a),o]]:[[u,Math.max(n[1]-t,i)],[a,Math.min(n[1]+t,o)]])}return s.scale=function(t){return(arguments.length?(l(t),f):l)()},s.translate=function(t){return(arguments.length?(n(t),f):n)()},s.center=function(t){return(arguments.length?(e(t),f):e)()},s.clipExtent=function(t){return arguments.length?(null==t?u=i=a=o=null:(u=+t[0][0],i=+t[0][1],a=+t[1][0],o=+t[1][1]),f()):null==u?null:[[u,i],[a,o]]},f()}function m6(t){return Jk((Dk+t)/2)}function y6(t,e){var n=A(t),i=t===e?L(t):Kk(n/A(e))/Kk(m6(e)/m6(t)),a=n*Xk(m6(t),i)/i;return i?(r.invert=function(t,e){var e=a-e,n=Zk(i)*Qk(t*t+e*e),r=Yk(t,Hk(e))*Zk(e);return e*i<0&&(r-=S*Zk(t)*Zk(e)),[r/i,2*Vk(Xk(a/n,1/i))-Dk]},r):p6;function r(t,e){0<a?e<-Dk+T&&(e=-Dk+T):Dk-T<e&&(e=Dk-T);e=a/Xk(m6(e),i);return[e*L(i*t),a-e*A(i*t)]}}function v6(t,e){return[t,e]}function b6(t,e){var n=A(t),r=t===e?L(t):(n-A(e))/(e-t),i=n/r+t;return Hk(r)<T?v6:(a.invert=function(t,e){var e=i-e,n=Yk(t,Hk(e))*Zk(e);return e*r<0&&(n-=S*Zk(t)*Zk(e)),[n/r,i-Zk(r)*Qk(t*t+e*e)]},a);function a(t,e){e=i-e,t*=r;return[e*L(t),i-e*A(t)]}}d6.invert=f6(function(t){return t}),p6.invert=function(t,e){return[t,2*Vk(Uk(e))-Dk]},v6.invert=v6;var x6=1.340264,w6=-.081106,M6=893e-6,O6=.003796,k6=Qk(3)/2;function _6(t,e){var e=e3(k6*L(e)),n=e*e,r=n*n*n;return[t*A(e)/(k6*(x6+3*w6*n+r*(7*M6+9*O6*n))),e*(x6+w6*n+r*(M6+O6*n))]}function E6(t,e){var n=A(e),r=A(t)*n;return[n*L(t)/r,L(e)/r]}function S6(t,e){var n=e*e,r=n*n;return[t*(.8707-.131979*n+r*(r*(.003971*n-.001529*r)-.013791)),e*(1.007226+n*(.015085+r*(.028874*n-.044475-.005916*r)))]}function A6(t,e){return[A(e)*L(t),L(e)]}function L6(t,e){var n=A(e),r=1+A(t)*n;return[n*L(t)/r,L(e)/r]}function T6(t,e){return[Kk(Jk((Dk+e)/2)),-t]}_6.invert=function(t,e){for(var n,r=e,i=r*r,a=i*i*i,o=0;o<12&&(a=(i=(r-=n=(r*(x6+w6*i+a*(M6+O6*i))-e)/(x6+3*w6*i+a*(7*M6+9*O6*i)))*r)*i*i,!(Hk(n)<Fk));++o);return[k6*t*(x6+3*w6*i+a*(7*M6+9*O6*i))/A(r),e3(L(r)/k6)]},E6.invert=f6(Vk),S6.invert=function(t,e){var n=e,r=25;do{var i=n*n,a=i*i}while(n-=a=(n*(1.007226+i*(.015085+a*(.028874*i-.044475-.005916*a)))-e)/(1.007226+i*(.045255+a*(.259866*i-.311325-.005916*11*a))),Hk(a)>T&&0<--r);return[t/(.8707+(i=n*n)*(i*(i*i*i*(.003971-.001529*i)-.013791)-.131979)),n]},A6.invert=f6(e3),L6.invert=f6(function(t){return 2*Vk(t)}),T6.invert=function(t,e){return[-e,2*Vk(Uk(t))-Dk]};var j6=Object.freeze({__proto__:null,geoAlbersUsa:function(){var e,n,i,a,o,r,s=c6(),l=l6().rotate([154,0]).center([-2,58.5]).parallels([55,65]),c=l6().rotate([157,0]).center([-3,19.9]).parallels([8,18]),u={point:function(t,e){r=[t,e]}};function f(t){var e=t[0],t=t[1];return r=null,i.point(e,t),r||(a.point(e,t),r)||(o.point(e,t),r)}function h(){return e=n=null,f}return f.invert=function(t){var e=s.scale(),n=s.translate(),r=(t[0]-n[0])/e,n=(t[1]-n[1])/e;return(.12<=n&&n<.234&&-.425<=r&&r<-.214?l:.166<=n&&n<.234&&-.214<=r&&r<-.115?c:s).invert(t)},f.stream=function(t){return e&&n===t?e:(r=[s.stream(n=t),l.stream(t),c.stream(t)],i=r.length,e={point:function(t,e){for(var n=-1;++n<i;)r[n].point(t,e)},sphere:function(){for(var t=-1;++t<i;)r[t].sphere()},lineStart:function(){for(var t=-1;++t<i;)r[t].lineStart()},lineEnd:function(){for(var t=-1;++t<i;)r[t].lineEnd()},polygonStart:function(){for(var t=-1;++t<i;)r[t].polygonStart()},polygonEnd:function(){for(var t=-1;++t<i;)r[t].polygonEnd()}});var r,i},f.precision=function(t){return arguments.length?(s.precision(t),l.precision(t),c.precision(t),h()):s.precision()},f.scale=function(t){return arguments.length?(s.scale(t),l.scale(.35*t),c.scale(t),f.translate(s.translate())):s.scale()},f.translate=function(t){var e,n,r;return arguments.length?(e=s.scale(),n=+t[0],r=+t[1],i=s.translate(t).clipExtent([[n-.455*e,r-.238*e],[n+.455*e,r+.238*e]]).stream(u),a=l.translate([n-.307*e,r+.201*e]).clipExtent([[n-.425*e+T,r+.12*e+T],[n-.214*e-T,r+.234*e-T]]).stream(u),o=c.translate([n-.205*e,r+.212*e]).clipExtent([[n-.214*e+T,r+.166*e+T],[n-.115*e-T,r+.234*e-T]]).stream(u),h()):s.translate()},f.fitExtent=function(t,e){return K4(f,t,e)},f.fitSize=function(t,e){return X4(f,t,e)},f.fitWidth=function(t,e){return Z4(f,t,e)},f.fitHeight=function(t,e){return Q4(f,t,e)},f.scale(1070)},geoAlbers:c6,geoAzimuthalEqualArea:function(){return i6(h6).scale(124.75).clipAngle(179.999)},geoAzimuthalEqualAreaRaw:h6,geoAzimuthalEquidistant:function(){return i6(d6).scale(79.4188).clipAngle(179.999)},geoAzimuthalEquidistantRaw:d6,geoConicConformal:function(){return o6(y6).scale(109.5).parallels([30,30])},geoConicConformalRaw:y6,geoConicEqualArea:l6,geoConicEqualAreaRaw:s6,geoConicEquidistant:function(){return o6(b6).scale(131.154).center([0,13.9389])},geoConicEquidistantRaw:b6,geoEqualEarth:function(){return i6(_6).scale(177.158)},geoEqualEarthRaw:_6,geoEquirectangular:function(){return i6(v6).scale(152.63)},geoEquirectangularRaw:v6,geoGnomonic:function(){return i6(E6).scale(144.049).clipAngle(60)},geoGnomonicRaw:E6,geoIdentity:function(){var r,i,e,n,a,o,s,l=1,c=0,u=0,f=1,h=1,d=0,p=null,g=1,m=1,y=Y4({point:function(t,e){t=x([t,e]);this.stream.point(t[0],t[1])}}),v=H3;function b(){return g=l*f,m=l*h,o=s=null,x}function x(t){var e,n=t[0]*g,t=t[1]*m;return d&&(e=t*r-n*i,n=n*r+t*i,t=e),[n+c,t+u]}return x.invert=function(t){var e,n=t[0]-c,t=t[1]-u;return d&&(e=t*r+n*i,n=n*r-t*i,t=e),[n/g,t/m]},x.stream=function(t){return o&&s===t?o:o=y(v(s=t))},x.postclip=function(t){return arguments.length?(v=t,p=e=n=a=null,b()):v},x.clipExtent=function(t){return arguments.length?(v=null==t?(p=e=n=a=null,H3):I3(p=+t[0][0],e=+t[0][1],n=+t[1][0],a=+t[1][1]),b()):null==p?null:[[p,e],[n,a]]},x.scale=function(t){return arguments.length?(l=+t,b()):l},x.translate=function(t){return arguments.length?(c=+t[0],u=+t[1],b()):[c,u]},x.angle=function(t){return arguments.length?(i=L(d=t%360*qk),r=A(d),b()):d*Gk},x.reflectX=function(t){return arguments.length?(f=t?-1:1,b()):f<0},x.reflectY=function(t){return arguments.length?(h=t?-1:1,b()):h<0},x.fitExtent=function(t,e){return K4(x,t,e)},x.fitSize=function(t,e){return X4(x,t,e)},x.fitWidth=function(t,e){return Z4(x,t,e)},x.fitHeight=function(t,e){return Q4(x,t,e)},x},geoProjection:i6,geoProjectionMutator:a6,geoMercator:function(){return g6(p6).scale(961/Wk)},geoMercatorRaw:p6,geoNaturalEarth1:function(){return i6(S6).scale(175.295)},geoNaturalEarth1Raw:S6,geoOrthographic:function(){return i6(A6).scale(249.5).clipAngle(90+T)},geoOrthographicRaw:A6,geoStereographic:function(){return i6(L6).scale(250).clipAngle(142)},geoStereographicRaw:L6,geoTransverseMercator:function(){var t=g6(T6),e=t.center,n=t.rotate;return t.center=function(t){return arguments.length?e([-t[1],t[0]]):[(t=e())[1],-t[0]]},t.rotate=function(t){return arguments.length?n([t[0],t[1],2<t.length?t[2]+90:90]):[(t=n())[0],t[1],t[2]-90]},n([0,0,90]).scale(159.155)},geoTransverseMercatorRaw:T6});function N6(t){return{type:"FeatureCollection",features:t.flatMap(t=>function(t){if(!t||!t.type)return null;var e={Point:"geometry",MultiPoint:"geometry",LineString:"geometry",MultiLineString:"geometry",Polygon:"geometry",MultiPolygon:"geometry",GeometryCollection:"geometry",Feature:"feature",FeatureCollection:"featureCollection"}[t.type];if(!e)return null;return"geometry"===e?{type:"FeatureCollection",features:[{type:"Feature",properties:{},geometry:t}]}:"feature"===e?{type:"FeatureCollection",features:[t]}:"featureCollection"===e?t:void 0}(t).features)}}function P6(t,e,n,r){var i,a,o,s,l,c,{outline:e=(e=e.filter(R6),e.find(t=>t.sphere)?{type:"Sphere"}:N6(e.filter(t=>!t.sphere).flatMap(t=>t.data.value)))}=r,{size:r="fitExtent"}=r;"fitExtent"===r?(i=t,o=e,{x:c,y:l,width:a,height:s}=c=n,i.fitExtent([[c,l],[a,s]],o)):"fitWidth"===r&&(i=t,c=e,{width:l,height:a}=l=n,[[l,c],[s,o]]=V4(i.fitWidth(l,c)).bounds(c),o=Math.ceil(o-c),c=Math.min(Math.ceil(s-l),o),s=i.scale()*(c-1)/c,[l,c]=i.translate(),c+=(a-o)/2,i.scale(s).translate([l,c]).precision(.2))}function C6(t){var e=t["data"];return Array.isArray(e)?Object.assign(Object.assign({},t),{data:{value:e}}):(e=e["type"],"graticule10"===e?Object.assign(Object.assign({},t),{data:{value:[D3()]}}):"sphere"===e?Object.assign(Object.assign({},t),{sphere:!0,data:{value:[{type:"Sphere"}]}}):t)}function R6(t){return"geoPath"===t.type}ls=()=>t=>{var{children:e,coordinate:n={}}=t;if(!Array.isArray(e))return[];const{type:r="equalEarth"}=n,h=rt(n,["type"]),d=function(t){if("function"==typeof t)return t;var e="geo"+Qe(t);if(e=j6[e])return e;throw new Error("Unknown coordinate: "+t)}(r),p=e.map(C6);let g;return[Object.assign(Object.assign({},t),{type:"view",scale:{x:{type:"identity"},y:{type:"identity"}},axis:!1,coordinate:{type:function(){return[["custom",(t,e,n,r)=>{const i=d();var a,o,s,l={x:t,y:e,width:n,height:r},c=(P6(i,p,l,h),i),l=h;for([o,s]of Object.entries(l))null!=(a=c[o])&&a.call(c,s);g=V4(i);const u=new i0({domain:[t,t+n]}),f=new i0({domain:[e,e+r]});return{transform:t=>{return t=t,(t=i(t))?([t,e]=t,[u.map(t),f.map(e)]):null;var e},untransform:t=>{return(t=t)?([t,e]=t,t=[u.invert(t),f.invert(e)],i.invert(t)):null;var e}}}]]}},children:p.flatMap(t=>{var e,n,r;return R6(t)?({style:n,tooltip:r={}}=e=t,Object.assign(Object.assign({},e),{type:"path",tooltip:Xu(r,{title:"id",items:[{channel:"color"}]}),style:Object.assign(Object.assign({},n),{d:t=>g(t)||[]})})):t})})]},ls.props={},rs=()=>t=>{var{data:e,scale:n,encode:r,style:i,animate:a,key:o,state:s}=t,t=rt(t,["type","data","scale","encode","style","animate","key","state"]);return[Object.assign(Object.assign({type:"geoView"},t),{children:[{type:"geoPath",key:o+"-0",data:{value:e},scale:n,encode:r,style:i,animate:a,state:s}]})]};rs.props={};const I6={"composition.geoView":ls,"composition.geoPath":rs};function B6(){return Object.assign({"data.fetch":wh,"data.inline":Ah,"data.sortBy":Sh,"data.sort":kh,"data.filter":Oh,"data.pick":_h,"data.rename":Eh,"data.fold":Mh,"data.slice":rd,"data.custom":Lh,"data.map":Th,"data.cluster":oh,"data.tree":sh,"data.sankey":Fu,"data.arc":Ch,"data.wordCloud":td,"data.join":nd,"data.kde":ud,"data.venn":Td,"transform.maybeZeroY1":oO,"transform.maybeZeroX":xO,"transform.maybeStackY":vO,"transform.maybeTitle":bO,"transform.maybeSeries":kO,"transform.maybeZeroPadding":TO,"transform.stackY":mO,"transform.binX":Mk,"transform.bin":wk,"transform.dodgeX":RO,"transform.jitter":zO,"transform.jitterX":WO,"transform.symmetryY":GO,"transform.diffY":qO,"transform.stackEnter":IO,"transform.normalizeY":BO,"transform.select":UO,"transform.selectX":KO,"transform.selectY":XO,"transform.groupX":lk,"transform.groupY":ck,"transform.groupColor":uk,"transform.group":sk,"transform.maybeSize":MO,"transform.maybeZeroY":wO,"transform.maybeKey":OO,"transform.sortX":dk,"transform.sortY":gk,"transform.sortColor":pk,"transform.flexX":mk,"transform.maybeTupleY":_O,"transform.maybeTupleX":EO,"transform.maybeIdentityY":SO,"transform.maybeIdentityX":AO,"transform.maybeTuple":PO,"transform.maybeVisualPosition":jO,"transform.maybeFunctionAttribute":NO,"transform.maybeGradient":CO,"transform.maybeTooltip":LO,"transform.pack":vk,"transform.sample":_k,"transform.filter":Ek,"coordinate.cartesian":As,"coordinate.polar":Ts,"coordinate.helix":js,"coordinate.transpose":Ns,"coordinate.theta":Ps,"coordinate.parallel":Is,"coordinate.fisheye":Bs,"coordinate.radial":Rs,"coordinate.radar":Fs,"encode.constant":Ds,"encode.field":Ws,"encode.transform":zs,"encode.column":Gs,"mark.interval":rc,"mark.rect":ic,"mark.line":au,"mark.point":ou,"mark.text":su,"mark.cell":lu,"mark.area":cu,"mark.link":uu,"mark.image":fu,"mark.polygon":hu,"mark.box":du,"mark.vector":pu,"mark.lineX":mu,"mark.lineY":gu,"mark.connector":yu,"mark.range":xu,"mark.rangeX":wu,"mark.rangeY":Mu,"mark.sankey":Ju,"mark.path":tf,"mark.treemap":af,"mark.pack":of,"mark.boxplot":gf,"mark.shape":mf,"mark.forceGraph":ih,"mark.gauge":J0,"mark.tree":lh,"mark.wordCloud":jd,"mark.density":t1,"mark.heatmap":e1,"palette.category10":n1,"palette.category20":r1,"scale.linear":a1,"scale.ordinal":o1,"scale.band":i1,"scale.identity":s1,"scale.point":l1,"scale.time":c1,"scale.log":u1,"scale.pow":f1,"scale.sqrt":g1,"scale.threshold":h1,"scale.quantile":d1,"scale.quantize":p1,"scale.sequential":m1,"scale.constant":y1,"shape.interval.rect":wg,"shape.interval.hollow":Mg,"shape.interval.funnel":Og,"shape.interval.pyramid":_g,"shape.rect.rect":wg,"shape.rect.hollow":Mg,"shape.cell.cell":wg,"shape.cell.hollow":Mg,"shape.line.line":Lg,"shape.line.hv":jg,"shape.line.vh":Ng,"shape.line.hvh":Pg,"shape.line.trail":Cg,"shape.line.smooth":Tg,"shape.point.bowtie":Bg,"shape.point.cross":Fg,"shape.point.diamond":Dg,"shape.point.hexagon":zg,"shape.point.hollowBowtie":Wg,"shape.point.hollowDiamond":Gg,"shape.point.hollowHexagon":qg,"shape.point.hollow":Hg,"shape.point.hollowSquare":Vg,"shape.point.hollowTriangle":Yg,"shape.point.hollowTriangleDown":$g,"shape.point.hyphen":Ug,"shape.point.line":Kg,"shape.point.plus":Xg,"shape.point.point":Zg,"shape.point.square":Qg,"shape.point.tick":Jg,"shape.point.triangle":tm,"shape.point.triangleDown":em,"shape.text.text":m2,"shape.area.area":w2,"shape.area.smooth":M2,"shape.area.hvh":O2,"shape.area.vh":k2,"shape.area.hv":_2,"shape.link.smooth":S2,"shape.link.vhv":A2,"shape.link.arc":L2,"shape.link.link":E2,"shape.image.image":T2,"shape.polygon.polygon":j2,"shape.polygon.ribbon":N2,"shape.box.box":P2,"shape.box.violin":C2,"shape.vector.vector":nm,"shape.label.label":Q2,"shape.text.badge":v2,"shape.lineX.line":R2,"shape.lineY.line":R2,"shape.shape.shape":lx,"shape.connector.connector":F2,"shape.range.range":wg,"shape.rangeX.range":wg,"shape.rangeY.range":wg,"shape.path.path":tx,"shape.path.hollow":ex,"shape.density.density":nx,"shape.heatmap.heatmap":sx,"theme.classic":cx,"theme.classicDark":ux,"theme.academy":hx,"component.axisX":Wx,"component.axisY":Gx,"component.axisRadar":qx,"component.axisLinear":Dx,"component.axisArc":zx,"component.legendCategory":$x,"component.legendContinuous":Jx,"component.legendContinuousBlock":tw,"component.legendContinuousBlockSize":nw,"component.legendContinuousSize":ew,"component.title":aw,"component.sliderX":hw,"component.sliderY":dw,"component.scrollbarX":gw,"component.scrollbarY":mw,"animation.scaleInX":Mw,"animation.scaleOutX":Ow,"animation.scaleInY":kw,"animation.scaleOutY":_w,"animation.waveIn":Rw,"animation.fadeIn":Ew,"animation.fadeOut":Sw,"animation.zoomIn":Iw,"animation.zoomOut":Bw,"animation.pathIn":Fw,"animation.morphing":Cw,"animation.growInX":Dw,"animation.growInY":zw,"interaction.elementHighlight":c5,"interaction.elementHighlightByX":u5,"interaction.elementHighlightByColor":f5,"interaction.elementSelect":d5,"interaction.elementSelectByX":p5,"interaction.elementSelectByColor":g5,"interaction.fisheye":y5,"interaction.chartIndex":m5,"interaction.tooltip":I5,"interaction.legendFilter":$5,"interaction.legendHighlight":U5,"interaction.brushHighlight":tM,"interaction.brushXHighlight":nM,"interaction.brushYHighlight":iM,"interaction.brushAxisHighlight":dM,"interaction.brushFilter":gM,"interaction.brushXFilter":mM,"interaction.brushYFilter":yM,"interaction.sliderFilter":xM,"interaction.scrollbarFilter":MM,"interaction.poptip":_M,"interaction.event":x5,"composition.spaceLayer":LM,"composition.spaceFlex":TM,"composition.mark":NM,"composition.view":jM,"composition.facetRect":GM,"composition.repeatMatrix":YM,"composition.facetCircle":QM,"composition.timingKeyframe":JM,"labelTransform.overlapHide":Lk,"labelTransform.overlapDodgeY":jk,"labelTransform.overflowHide":Bk,"labelTransform.contrastReverse":Ik},I6)}const F6=[["legendCategory",[[["color","discrete"],["opacity","discrete"],["shape","discrete"],["size","constant"]],[["color","discrete"],["opacity","constant"],["shape","discrete"],["size","constant"]],[["color","discrete"],["opacity","discrete"],["shape","constant"],["size","constant"]],[["color","discrete"],["opacity","constant"],["shape","constant"],["size","constant"]],[["color","constant"],["opacity","discrete"],["shape","discrete"],["size","constant"]],[["color","constant"],["opacity","constant"],["shape","discrete"],["size","constant"]],[["color","constant"],["opacity","discrete"],["shape","constant"],["size","constant"]],[["color","discrete"],["shape","discrete"],["size","constant"]],[["color","discrete"],["opacity","discrete"],["shape","discrete"]],[["color","discrete"],["opacity","discrete"],["size","constant"]],[["color","discrete"],["opacity","constant"],["shape","discrete"]],[["color","discrete"],["opacity","constant"],["size","constant"]],[["color","discrete"],["shape","constant"],["size","constant"]],[["color","discrete"],["opacity","discrete"],["shape","constant"]],[["color","discrete"],["opacity","constant"],["shape","constant"]],[["color","constant"],["shape","discrete"],["size","constant"]],[["color","constant"],["opacity","discrete"],["shape","discrete"]],[["color","constant"],["opacity","discrete"],["size","constant"]],[["color","constant"],["opacity","constant"],["shape","discrete"]],[["color","constant"],["opacity","discrete"],["shape","constant"]],[["color","discrete"],["shape","discrete"]],[["color","discrete"],["size","constant"]],[["color","discrete"],["opacity","discrete"]],[["color","discrete"],["opacity","constant"]],[["color","discrete"],["shape","constant"]],[["color","constant"],["shape","discrete"]],[["color","constant"],["size","constant"]],[["color","constant"],["opacity","discrete"]],[["color","discrete"]]]],["legendContinuousSize",[[["color","continuous"],["opacity","continuous"],["size","continuous"]],[["color","constant"],["opacity","continuous"],["size","continuous"]],[["color","continuous"],["size","continuous"]],[["color","constant"],["size","continuous"]],[["size","continuous"],["opacity","continuous"]],[["size","continuous"]]]],["legendContinuousBlockSize",[[["color","distribution"],["opacity","distribution"],["size","distribution"]],[["color","distribution"],["size","distribution"]]]],["legendContinuousBlock",[[["color","distribution"],["opacity","continuous"]],[["color","distribution"]]]],["legendContinuous",[[["color","continuous"],["opacity","continuous"]],[["color","continuous"]],[["opacity","continuous"]]]]];function D6(t,e,n){for(;t<e;)t+=2*Math.PI;for(;n<t;)t-=2*Math.PI;return t}function z6(t,e,n,r,i){var a=t[0],t=t[1],o=Q();return a=[a,t],(t=o)[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=a[0],t[7]=a[1],t[8]=1,t}function W6(t,e,n,r,i){var a=new i0({range:[e,e+r]}),o=new i0({range:[n,n+i]});return{transform:function(t){var e=t[0],t=t[1];return[a.map(e),o.map(t)]},untransform:function(t){var e=t[0],t=t[1];return[a.invert(e),o.invert(t)]}}}function G6(t,e,n,r,i){return(0,t[0])(e,n,r,i)}function q6(t,e,n,r,i){return t[0]}function H6(t,e,n,r,i){var a=t[0],o=t[1],s=t[2],t=t[3],l=new i0({range:[s,t]}),c=new i0({range:[a,o]}),u=1<(s=i/r)?1:s,f=1<s?1/s:1;return{transform:function(t){var e=t[0],t=t[1],e=c.map(e),t=l.map(t);return[.5*(t*Math.cos(e)*u)+.5,.5*(t*Math.sin(e)*f)+.5]},untransform:function(t){var e=t[0],t=t[1],e=2*(e-.5)/u,t=2*(t-.5)/f,n=Math.sqrt(Math.pow(e,2)+Math.pow(t,2)),t=D6(Math.atan2(t,e),a,o);return[c.invert(t),l.invert(n)]}}}function V6(t,e,n,r,i){return{transform:function(t){var e=t[0];return[t[1],e]},untransform:function(t){var e=t[0];return[t[1],e]}}}function Y6(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return Q6.apply(void 0,J6([[-1,-1]],e,!1))}function $6(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return Q6.apply(void 0,J6([[-1,1]],e,!1))}function U6(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return Q6.apply(void 0,J6([[1,-1]],e,!1))}function K6(t,e,n,r,i){var a,t=t[0],o=Q();return o=o,t=t,a=Math.sin(t),t=Math.cos(t),o[0]=t,o[1]=a,o[2]=0,o[3]=-a,o[4]=t,o[5]=0,o[6]=0,o[7]=0,o[8]=1,o}function X6(t,e,n,r,i){var a=t[0],o=t[1],s=t[2],l=(t[3]-s)/(+o/(2*Math.PI)+1),c=l/(2*Math.PI),u=new i0({range:[s,s+.99*l]}),f=new i0({range:[a,o]}),h=1<(t=i/r)?1:t,d=1<t?1/t:1;return{transform:function(t){var e=t[0],t=t[1],e=f.map(e),t=u.map(t);return[.5*(Math.cos(e)*(c*e+t)*h)+.5,.5*(Math.sin(e)*(c*e+t)*d)+.5]},untransform:function(t){var e=t[0],t=t[1],e=2*(e-.5)/h,t=2*(t-.5)/d,n=Math.sqrt(Math.pow(e,2)+Math.pow(t,2)),t=D6(Math.atan2(t,e)+Math.floor(n/l)*Math.PI*2,a,o),e=n-c*t;return[f.invert(t),u.invert(e)]}}}function Z6(t,e,n,r,i){var s=t[0],l=t[1],a=t[2],t=t[3],c=new i0({range:[a,t]});return{transform:function(t){for(var e=[],n=t.length,r=new a0({domain:new Array(n).fill(0).map(function(t,e){return e}),range:[s,l]}),i=0;i<n;i++){var a=t[i],o=r.map(i),a=c.map(a);e.push(o,a)}return e},untransform:function(t){for(var e=[],n=0;n<t.length;n+=2){var r=t[n+1];e.push(c.invert(r))}return e}}}var Q6=function(t,e,n,r,i){var a=t[0],t=t[1],o=Q();return a=[a,t],(t=o)[0]=a[0],t[1]=0,t[2]=0,t[3]=0,t[4]=a[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},J6=function(t,e,n){if(n||2===arguments.length)for(var r,i=0,a=e.length;i<a;i++)!r&&i in e||((r=r||Array.prototype.slice.call(e,0,i))[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))};function t_(t){return 1/Math.tan(t)}function e_(t,e,n,r,i){var a=t_(t[0]);return{transform:function(t){var e=t[0],t=t[1];return[e+t*a,t]},untransform:function(t){var e=t[0],t=t[1];return[e-t*a,t]}}}function n_(t,e,n,r,i){var a=t_(t[0]);return{transform:function(t){var e=t[0];return[e,t[1]+e*a]},untransform:function(t){var e=t[0];return[e,t[1]-e*a]}}}function r_(t,e,n,r,i){var a=t<e,i=(a?e-r:i-e)||i-r,r=a?-1:1;return r*i*(n+1)/(n+i/((t-e)*r))+e}function i_(t,e,n,r,i){var a=t<e,i=(a?e-r:i-e)||i-r;return i/(i*(n+1)/(t-e)-n*(a?-1:1))+e}function a_(t,e,n){return n?new i0({range:[0,1],domain:[0,e]}).map(t):t}function o_(t,e,n,r,i){var a=t[0],o=t[1],t=t[2],s=a_(a,r,void 0!==t&&t);return{transform:function(t){var e=t[0],t=t[1];return[r_(e,s,o,0,1),t]},untransform:function(t){var e=t[0],t=t[1];return[i_(e,s,o,0,1),t]}}}function s_(t,e,n,r,i){var a=t[0],o=t[1],t=t[2],s=a_(a,i,void 0!==t&&t);return{transform:function(t){return[t[0],r_(t[1],s,o,0,1)]},untransform:function(t){return[t[0],i_(t[1],s,o,0,1)]}}}function l_(t,e,n,r,i){var a=t[0],o=t[1],s=t[2],l=t[3],t=t[4],c=a_(a,r,t=void 0!==t&&t),u=a_(o,i,t);return{transform:function(t){var e=t[0],t=t[1];return[r_(e,c,s,0,1),r_(t,u,l,0,1)]},untransform:function(t){var e=t[0],t=t[1];return[i_(e,c,s,0,1),i_(t,u,l,0,1)]}}}function c_(t,e,n,r,i){var a=t[0],o=t[1],s=t[2],l=t[3],t=void 0!==(t=t[4])&&t,c=new i0({range:[0,r]}),u=new i0({range:[0,i]}),f=t?a:c.map(a),h=t?o:u.map(o);return{transform:function(t){var e=t[0],t=t[1],n=c.map(e)-f,r=u.map(t)-h,i=Math.sqrt(n*n+r*r);return s<i?[e,t]:(e=r_(i,0,l,0,s),t=Math.atan2(r,n),i=f+e*Math.cos(t),r=h+e*Math.sin(t),[c.invert(i),u.invert(r)])},untransform:function(t){var e=t[0],t=t[1],n=c.map(e)-f,r=u.map(t)-h,i=Math.sqrt(n*n+r*r);return s<i?[e,t]:(e=i_(i,0,l,0,s),t=Math.atan2(r,n),i=f+e*Math.cos(t),r=h+e*Math.sin(t),[c.invert(i),u.invert(r)])}}}var u_=function(t,e,n){if(n||2===arguments.length)for(var r,i=0,a=e.length;i<a;i++)!r&&i in e||((r=r||Array.prototype.slice.call(e,0,i))[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))},f_=(h_.prototype.update=function(t){this.options=sp({},this.options,t),this.recoordinate()},h_.prototype.clone=function(){return new h_(this.options)},h_.prototype.getOptions=function(){return this.options},h_.prototype.clear=function(){this.update({transformations:[]})},h_.prototype.getSize=function(){var t=this.options;return[t.width,t.height]},h_.prototype.getCenter=function(){var t=this.options,e=t.x,n=t.y;return[(2*e+t.width)/2,(2*n+t.height)/2]},h_.prototype.transform=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this.options.transformations;return this.update({transformations:u_(u_([],n,!0),[u_([],t,!0)],!1)}),this},h_.prototype.map=function(t){return this.output(t)},h_.prototype.invert=function(t){return this.input(t)},h_.prototype.recoordinate=function(){this.output=this.compose(),this.input=this.compose(!0)},h_.prototype.compose=function(t){for(var e=(t=void 0===t?!1:t)?u_([],this.options.transformations,!0).reverse():this.options.transformations,n=t?function(t){return t.untransform}:function(t){return t.transform},r=[],a=[],i=function(t,e){return a.push((e=void 0===e?!0:e)?(i=t,function(t){for(var e=[],n=0;n<t.length-1;n+=2){var r=[t[n],t[n+1]],r=i(r);e.push.apply(e,r)}return e}):t);var i},o=0,s=e;o<s.length;o++){var l,c,u,f,h=s[o],d=h[0],h=h.slice(1),p=this.transformers[d];p&&(l=(f=this.options).x,c=f.y,u=f.width,f=f.height,p=p(u_([],h,!0),l,c,u,f),(h=p)instanceof Float32Array||h instanceof Array?r.push(p):(r.length&&(i(this.createMatrixTransform(r,t)),r.splice(0,r.length)),i(n(p)||lp,"parallel"!==d)))}return r.length&&i(this.createMatrixTransform(r,t)),function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return t?e.reduce(function(e,n){return function(t){return n(e(t))}},t):lp}.apply(void 0,a)},h_.prototype.createMatrixTransform=function(t,e){var n,r,i,a,o,s,l,c,u,f,h,d,p=Q();return e&&t.reverse(),t.forEach(function(t){return J(p,p,t)}),e&&(e=t=p,(d=new Z(9))[0]=e[0],d[1]=e[1],d[2]=e[2],d[3]=e[3],d[4]=e[4],d[5]=e[5],d[6]=e[6],d[7]=e[7],d[8]=e[8],d=(e=d)[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],l=e[7],c=(e=e[8])*a-o*l,h=d*c+n*(u=-e*i+o*s)+r*(f=l*i-a*s))&&(t[0]=c*(h=1/h),t[1]=(-e*n+r*l)*h,t[2]=(o*n-r*a)*h,t[3]=u*h,t[4]=(e*d-r*s)*h,t[5]=(-o*d+r*i)*h,t[6]=f*h,t[7]=(-l*d+n*s)*h,t[8]=(a*d-n*i)*h),function(t){t=[t[0],t[1],1];return $t(t,t,p),[t[0],t[1]]}},h_);function h_(t){this.options={x:0,y:0,width:300,height:150,transformations:[]},this.transformers={cartesian:W6,translate:z6,custom:G6,matrix:q6,polar:H6,transpose:V6,scale:Q6,"shear.x":e_,"shear.y":n_,reflect:Y6,"reflect.x":$6,"reflect.y":U6,rotate:K6,helix:X6,parallel:Z6,fisheye:l_,"fisheye.x":o_,"fisheye.y":s_,"fisheye.circular":c_},this.update(t)}function d_(e,n){const r=t=>{return"string"!=typeof t?t:n[t=e+"."+t]||Wu("Unknown Component: "+t)};return[t=>{var e=t["type"],t=rt(t,["type"]);return r(e)(Object.assign({},t))},r]}function p_(t,e){var{coordinate:n={}}=t,t=rt(t,["coordinate"]),{type:r,transform:i=[]}=n,n=rt(n,["type","transform"]);if(!r)return Object.assign(Object.assign({},t),{coordinates:i});var[,e]=d_("coordinate",e),{transform:e=!1}=e(r).props||{};if(e)throw new Error(`Unknown coordinate: ${r}.`);return Object.assign(Object.assign({},t),{coordinates:[Object.assign({type:r},n),...i]})}function g_(t,e){return t.filter(t=>t.type===e)}function m_(t){return 0<g_(t,"polar").length}function y_(t){return g_(t,"transpose").length%2==1}function v_(t){return 0<g_(t,"theta").length}function b_(t){return 0<g_(t,"radial").length}function h(t){for(var e=t.length/6|0,n=new Array(e),r=0;r<e;)n[r]="#"+t.slice(6*r,6*++r);return n}a=h("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"),bo=h("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666"),as=h("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666"),vo=h("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928"),n=h("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2"),yo=h("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc"),Rg=h("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999"),r=h("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3"),vs=h("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"),Po=h("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab");function x_(t,e,n){(t.prototype=e.prototype=n).constructor=t}function w_(t,e){var n,r=Object.create(t.prototype);for(n in e)r[n]=e[n];return r}function M_(){}var O_=1/.7,Bl="\\s*([+-]?\\d+)\\s*",ho="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Eo="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",k_=/^#([0-9a-f]{3,8})$/,__=new RegExp(`^rgb\\(${Bl},${Bl},${Bl}\\)$`),E_=new RegExp(`^rgb\\(${Eo},${Eo},${Eo}\\)$`),S_=new RegExp(`^rgba\\(${Bl},${Bl},${Bl},${ho}\\)$`),A_=new RegExp(`^rgba\\(${Eo},${Eo},${Eo},${ho}\\)$`),L_=new RegExp(`^hsl\\(${ho},${Eo},${Eo}\\)$`),T_=new RegExp(`^hsla\\(${ho},${Eo},${Eo},${ho}\\)$`),j_={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function N_(){return this.rgb().formatHex()}function P_(){return this.rgb().formatRgb()}function C_(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=k_.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?R_(e):3===n?new D_(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?I_(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?I_(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=__.exec(t))?new D_(e[1],e[2],e[3],1):(e=E_.exec(t))?new D_(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=S_.exec(t))?I_(e[1],e[2],e[3],e[4]):(e=A_.exec(t))?I_(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=L_.exec(t))?V_(e[1],e[2]/100,e[3]/100,1):(e=T_.exec(t))?V_(e[1],e[2]/100,e[3]/100,e[4]):j_.hasOwnProperty(t)?R_(j_[t]):"transparent"===t?new D_(NaN,NaN,NaN,0):null}function R_(t){return new D_(t>>16&255,t>>8&255,255&t,1)}function I_(t,e,n,r){return new D_(t=r<=0?e=n=NaN:t,e,n,r)}function B_(t){return(t=t instanceof M_?t:C_(t))?new D_((t=t.rgb()).r,t.g,t.b,t.opacity):new D_}function F_(t,e,n,r){return 1===arguments.length?B_(t):new D_(t,e,n,null==r?1:r)}function D_(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function z_(){return"#"+H_(this.r)+H_(this.g)+H_(this.b)}function W_(){var t=G_(this.opacity);return(1===t?"rgb(":"rgba(")+q_(this.r)+`, ${q_(this.g)}, `+q_(this.b)+(1===t?")":`, ${t})`)}function G_(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function q_(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function H_(t){return((t=q_(t))<16?"0":"")+t.toString(16)}function V_(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||1<=n?t=e=NaN:e<=0&&(t=NaN),new $_(t,e,n,r)}function Y_(t){var e,n,r,i,a,o,s,l;return t instanceof $_?new $_(t.h,t.s,t.l,t.opacity):(t=t instanceof M_?t:C_(t))?t instanceof $_?t:(e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=NaN,l=((a=Math.max(e,n,r))+i)/2,(s=a-i)?(o=e===a?(n-r)/s+6*(n<r):n===a?(r-e)/s+2:(e-n)/s+4,s/=l<.5?a+i:2-a-i,o*=60):s=0<l&&l<1?0:o,new $_(o,s,l,t.opacity)):new $_}function $_(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function U_(t){return(t=(t||0)%360)<0?t+360:t}function K_(t){return Math.max(0,Math.min(1,t||0))}function X_(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}x_(M_,C_,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:N_,formatHex:N_,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Y_(this).formatHsl()},formatRgb:P_,toString:P_}),x_(D_,F_,w_(M_,{brighter(t){return t=null==t?O_:Math.pow(O_,t),new D_(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?.7:Math.pow(.7,t),new D_(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new D_(q_(this.r),q_(this.g),q_(this.b),G_(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:z_,formatHex:z_,formatHex8:function(){return"#"+H_(this.r)+H_(this.g)+H_(this.b)+H_(255*(isNaN(this.opacity)?1:this.opacity))},formatRgb:W_,toString:W_})),x_($_,function(t,e,n,r){return 1===arguments.length?Y_(t):new $_(t,e,n,null==r?1:r)},w_(M_,{brighter(t){return t=null==t?O_:Math.pow(O_,t),new $_(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?.7:Math.pow(.7,t),new $_(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,e=n+(n<.5?n:1-n)*e,n=2*n-e;return new D_(X_(240<=t?t-240:120+t,n,e),X_(t,n,e),X_(t<120?240+t:t-120,n,e),this.opacity)},clamp(){return new $_(U_(this.h),K_(this.s),K_(this.l),G_(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){var t=G_(this.opacity);return(1===t?"hsl(":"hsla(")+U_(this.h)+`, ${100*K_(this.s)}%, ${100*K_(this.l)}%`+(1===t?")":`, ${t})`)}}));const Z_=Math.PI/180,Q_=180/Math.PI;var J_=1.78277,tE=-.29227,eE=-.90649,nE=1.97294,rE=nE*eE,iE=nE*J_,aE=J_*tE- -.14861*eE;function oE(t,e,n,r){return 1===arguments.length?(i=t)instanceof sE?new sE(i.h,i.s,i.l,i.opacity):(a=(i=i instanceof D_?i:B_(i)).r/255,o=i.g/255,l=i.b/255,l=(nE*(o-(a=(aE*l+rE*a-iE*o)/(aE+rE-iE)))-tE*(o=l-a))/eE,new sE((l=(s=Math.sqrt(l*l+o*o)/(nE*a*(1-a)))?Math.atan2(l,o)*Q_-120:NaN)<0?l+360:l,s,a,i.opacity)):new sE(t,e,n,null==r?1:r);var i,a,o,s,l}function sE(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}x_(sE,oE,w_(M_,{brighter(t){return t=null==t?O_:Math.pow(O_,t),new sE(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?.7:Math.pow(.7,t),new sE(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=isNaN(this.h)?0:(this.h+120)*Z_,e=+this.l,n=isNaN(this.s)?0:this.s*e*(1-e),r=Math.cos(t),t=Math.sin(t);return new D_(255*(e+n*(-.14861*r+J_*t)),255*(e+n*(tE*r+eE*t)),255*(e+nE*r*n),this.opacity)}}));var lE=t=>()=>t;function cE(e,n){return function(t){return e+t*n}}function uE(a){return 1==(a=+a)?fE:function(t,e){return e-t?(n=t,r=e,i=a,n=Math.pow(n,i),r=Math.pow(r,i)-n,i=1/i,function(t){return Math.pow(n+t*r,i)}):lE(isNaN(t)?e:t);var n,r,i}}function fE(t,e){var n=e-t;return n?cE(t,n):lE(isNaN(t)?e:t)}!function t(e){var o=uE(e);function n(e,t){var n=o((e=F_(e)).r,(t=F_(t)).r),r=o(e.g,t.g),i=o(e.b,t.b),a=fE(e.opacity,t.opacity);return function(t){return e.r=n(t),e.g=r(t),e.b=i(t),e.opacity=a(t),e+""}}return n.gamma=t,n}(1);hE=function(s){var l=s.length-1;return function(t){var e,n=t<=0?t=0:1<=t?l-(t=1):Math.floor(t*l),r=s[n],i=s[n+1],a=0<n?s[n-1]:2*r-i,o=n<l-1?s[n+2]:2*i-r;return((1-3*(t=(t-n/l)*l)+3*(n=t*t)-(e=n*t))*a+(4-6*n+3*e)*r+(1+3*t+3*n-3*e)*i+e*o)/6}};var hE,dE=function(t){for(var e,n=t.length,r=new Array(n),i=new Array(n),a=new Array(n),o=0;o<n;++o)e=F_(t[o]),r[o]=e.r||0,i[o]=e.g||0,a[o]=e.b||0;return r=hE(r),i=hE(i),a=hE(a),e.opacity=1,function(t){return e.r=r(t),e.g=i(t),e.b=a(t),e+""}};function pE(s){return function t(o){function e(e,t){var n=s((e=oE(e)).h,(t=oE(t)).h),r=fE(e.s,t.s),i=fE(e.l,t.l),a=fE(e.opacity,t.opacity);return function(t){return e.h=n(t),e.s=r(t),e.l=i(Math.pow(t,o)),e.opacity=a(t),e+""}}return o=+o,e.gamma=t,e}(1)}pE(function(t,e){var n=e-t;return n?cE(t,180<n||n<-180?n-360*Math.round(n/360):n):lE(isNaN(t)?e:t)});var Ao=pE(fE),i=t=>dE(t[t.length-1]),so=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(h),go=i(so),ds=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(h),ss=i(ds),_o=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(h),Ro=i(_o),po=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(h),e=i(po),os=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(h),So=i(os),Lo=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(h),jo=i(Lo),o=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(h),is=i(o),To=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(h),Wo=i(To),mo=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(h),us=i(mo),ls=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(h),rs=i(ls),Bl=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(h),Eo=i(Bl),ho=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(h),gE=i(ho),mE=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(h),yE=i(mE),vE=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(h),bE=i(vE),xE=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(h),wE=i(xE),ME=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(h),OE=i(ME),kE=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(h),_E=i(kE),EE=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(h),SE=i(EE),AE=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(h),LE=i(AE),TE=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(h),jE=i(TE),NE=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(h),PE=i(NE),CE=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(h),RE=i(CE),IE=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(h),BE=i(IE),FE=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(h),DE=i(FE),zE=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(h),WE=i(zE),GE=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(h),qE=i(GE),HE=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(h),i=i(HE);var VE=Ao(oE(300,.5,0),oE(-240,.5,1)),YE=Ao(oE(-100,.75,.35),oE(80,1.5,.8)),Ao=Ao(oE(260,.75,.35),oE(80,1.5,.8)),$E=oE();var UE=F_(),KE=Math.PI/3,XE=2*Math.PI/3;function ZE(e){var n=e.length;return function(t){return e[Math.max(0,Math.min(n-1,Math.floor(t*n)))]}}var QE=ZE(h("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725")),JE=ZE(h("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),tS=ZE(h("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),eS=ZE(h("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921")),nS=Object.freeze({__proto__:null,schemeCategory10:a,schemeAccent:bo,schemeDark2:as,schemePaired:vo,schemePastel1:n,schemePastel2:yo,schemeSet1:Rg,schemeSet2:r,schemeSet3:vs,schemeTableau10:Po,interpolateBrBG:go,schemeBrBG:so,interpolatePRGn:ss,schemePRGn:ds,interpolatePiYG:Ro,schemePiYG:_o,interpolatePuOr:e,schemePuOr:po,interpolateRdBu:So,schemeRdBu:os,interpolateRdGy:jo,schemeRdGy:Lo,interpolateRdYlBu:is,schemeRdYlBu:o,interpolateRdYlGn:Wo,schemeRdYlGn:To,interpolateSpectral:us,schemeSpectral:mo,interpolateBuGn:rs,schemeBuGn:ls,interpolateBuPu:Eo,schemeBuPu:Bl,interpolateGnBu:gE,schemeGnBu:ho,interpolateOrRd:yE,schemeOrRd:mE,interpolatePuBuGn:bE,schemePuBuGn:vE,interpolatePuBu:wE,schemePuBu:xE,interpolatePuRd:OE,schemePuRd:ME,interpolateRdPu:_E,schemeRdPu:kE,interpolateYlGnBu:SE,schemeYlGnBu:EE,interpolateYlGn:LE,schemeYlGn:AE,interpolateYlOrBr:jE,schemeYlOrBr:TE,interpolateYlOrRd:PE,schemeYlOrRd:NE,interpolateBlues:RE,schemeBlues:CE,interpolateGreens:BE,schemeGreens:IE,interpolateGreys:DE,schemeGreys:FE,interpolatePurples:WE,schemePurples:zE,interpolateReds:qE,schemeReds:GE,interpolateOranges:i,schemeOranges:HE,interpolateCividis:function(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(-4.54-t*(35.34-t*(2381.73-t*(6402.7-t*(7024.72-2710.57*t)))))))+", "+Math.max(0,Math.min(255,Math.round(32.49+t*(170.73+t*(52.82-t*(131.46-t*(176.58-67.37*t)))))))+", "+Math.max(0,Math.min(255,Math.round(81.24+t*(442.36-t*(2482.43-t*(6167.24-t*(6614.94-2475.67*t)))))))+")"},interpolateCubehelixDefault:VE,interpolateRainbow:function(t){(t<0||1<t)&&(t-=Math.floor(t));var e=Math.abs(t-.5);return $E.h=360*t-100,$E.s=1.5-1.5*e,$E.l=.8-.9*e,$E+""},interpolateWarm:YE,interpolateCool:Ao,interpolateSinebow:function(t){var e;return t=(.5-t)*Math.PI,UE.r=255*(e=Math.sin(t))*e,UE.g=255*(e=Math.sin(t+KE))*e,UE.b=255*(e=Math.sin(t+XE))*e,UE+""},interpolateTurbo:function(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(34.61+t*(1172.33-t*(10793.56-t*(33300.12-t*(38394.49-14825.05*t)))))))+", "+Math.max(0,Math.min(255,Math.round(23.31+t*(557.33+t*(1225.33-t*(3574.96-t*(1073.77+707.56*t)))))))+", "+Math.max(0,Math.min(255,Math.round(27.2+t*(3211.1-t*(15327.97-t*(27814-t*(22569.18-6838.66*t)))))))+")"},interpolateViridis:QE,interpolateMagma:JE,interpolateInferno:tS,interpolatePlasma:eS});function rS(t,e,n,r,i,a){var o,s,{guide:l={}}=n,c=function(t,e,n){var{type:n,domain:r,range:i}=n;return void 0!==n?n:function(t){return gS(t,$u)}(e)?"identity":"string"==typeof i?"linear":2<(r||i||[]).length?cS(t):void 0===r?dS(e)?cS(t):pS(e)?"time":uS(t,i):dS([r])?cS(t):pS(e)?"time":uS(t,i)}(t,e,n);return"string"!=typeof c?n:(s=function(t,e,n){const r=n["ratio"];if(void 0===r||null===r)return e;if(oS({type:t}))return function(t,e,n){const r=t.map(Number),i=new i0({domain:r,range:[r[0],r[0]+(r[r.length-1]-r[0])*e]});return"time"===n?t.map(t=>new Date(i.map(t))):t.map(t=>i.map(t))}(e,r,t);return sS({type:t})?(n=e,t=r,t=Math.round(n.length*r),n.slice(0,t)):e}(c,o=function(t,e,n){var r=n["domain"];if(void 0!==r)return r;switch(t){case"linear":case"time":case"log":case"pow":case"sqrt":case"quantize":case"threshold":return fS(function(t,e){var{zero:e=!1}=e;let n=1/0,r=-1/0;for(const i of t)for(const a of i)qu(a)&&(n=Math.min(n,+a),r=Math.max(r,+a));return n===1/0?[]:e?[Math.min(0,n),r]:[n,r]}(e,n),n);case"band":case"ordinal":case"point":return hS(e);case"quantile":return function(t){return hS(t).sort()}(e);case"sequential":return fS(function(t){let e=1/0,n=-1/0;for(const r of t)for(const i of r)qu(i)&&(e=Math.min(e,+i),n=Math.max(n,+i));return e===1/0?[]:[e<0?-n:e,n]}(e),n);default:return[]}}(c,e,n),n),Object.assign(Object.assign(Object.assign({},n),function(t,e,n,r){switch(t){case"linear":case"time":case"log":case"pow":case"sqrt":return function(t){var{interpolate:e=Cp,nice:n=!1,tickCount:r=5}=t;return Object.assign(Object.assign({},t),{interpolate:e,nice:n,tickCount:r})}(n);case"band":case"point":return function(t,e,n,r){if(void 0!==r.padding||void 0!==r.paddingInner||void 0!==r.paddingOuter)return Object.assign(Object.assign({},r),{unknown:NaN});var t=function(t,e,n){return"enterDelay"===e||"enterDuration"===e?0:"band"!==t?"point"===t?.5:0:v_(n)?0:.1}(t,e,n),{paddingInner:e=t,paddingOuter:n=t}=r;return Object.assign(Object.assign({},r),{paddingInner:e,paddingOuter:n,padding:t,unknown:NaN})}(t,e,r,n);case"sequential":return function(t){const{palette:e="ylGnBu",offset:n}=t,r=Qe(e),i=nS["interpolate"+r];if(i)return{interpolator:n?t=>i(n(t)):i};throw new Error("Unknown palette: "+r)}(n);default:return n}}(c,t,n,r)),{domain:s,range:function(t,e,n,r,i,a,o){var s=r["range"];if("string"==typeof s)return s.split("-");if(void 0!==s)return s;var{rangeMin:l,rangeMax:c}=r;switch(t){case"linear":case"time":case"log":case"pow":case"sqrt":var u=lS(n,r,i,a,o),[u,f]=function(t,e){return"enterDelay"===t?[0,1e3]:"enterDuration"==t?[300,1e3]:t.startsWith("y")||t.startsWith("position")?[1,0]:"color"===t?[e[0],N0(e)]:"opacity"!==t&&"size"===t?[1,10]:[0,1]}(e,u);return[l||u,c||f];case"band":case"point":return[l||0,c||1];case"ordinal":return lS(n,r,i,a,o);case"sequential":return;case"constant":return[n[0][0]];default:return[]}}(c,t,e,n,s,i,a),expectedDomain:o,guide:l,name:t,type:c}))}function iS(t,e){var[e]=d_("scale",e),n=t["relations"],[n]=function(o){if(!o||!Array.isArray(o))return[Du,Du];let s,l;return[t=>{s=t.map.bind(t),l=null==(e=t.invert)?void 0:e.bind(t);const r=o.filter(([t])=>"function"==typeof t);var e=o.filter(([t])=>"function"!=typeof t);const i=new Map(e);if(t.map=t=>{for(var[e,n]of r)if(e(t))return n;return i.has(t)?i.get(t):s(t)},l){const n=new Map(e.map(([t,e])=>[e,t])),a=new Map(r.map(([t,e])=>[e,t]));t.invert=t=>a.has(t)?t:n.has(t)?n.get(t):l(t)}return t},t=>(null!==s&&(t.map=s),null!==l&&(t.invert=l),t)]}(n);return n(e(t))}function aS(t,n){var t=t.filter(({name:t,facet:e=!0})=>e&&t===n),e=t.flatMap(t=>t.domain),r=t.every(oS)?pc(e):t.every(sS)?Array.from(new Set(e)):null;if(null!==r)for(const i of t)i.domain=r}function oS(t){t=t.type;return"string"==typeof t&&["linear","log","pow","time"].includes(t)}function sS(t){t=t.type;return"string"==typeof t&&["band","point","ordinal"].includes(t)}function lS(t,e,n,r,i){var[i]=d_("palette",i),{defaultCategory10:r,defaultCategory20:a}=r,t=(t=t.flat(),Array.from(new Set(t)).length<=r.length?r:a),{palette:r=t,offset:a}=e;try{return i({type:r})}catch(t){e=function(t,n,r=t=>t){if(!t)return null;const e=Qe(t),i=nS["scheme"+e],a=nS["interpolate"+e];if(!i&&!a)return null;if(i){if(!i.some(Array.isArray))return i;t=i[n.length];if(t)return t}return n.map((t,e)=>a(r(e/n.length)))}(r,n,a);if(e)return e;throw new Error(`Unknown Component: ${r} `)}}function cS(t){return(t=t).startsWith("x")||t.startsWith("y")||t.startsWith("position")||t.startsWith("size")?"point":"ordinal"}function uS(t,e){return"color"!==t||e?"linear":"sequential"}function fS(t,e){var n,r;return 0===t.length?t:({domainMin:e,domainMax:n}=e,[t,r]=t,[null!=e?e:t,null!=n?n:r])}function hS(t){return Array.from(new Set(t.flat()))}function dS(t){return gS(t,t=>{t=typeof t;return"string"==t||"boolean"==t})}function pS(t){return gS(t,t=>t instanceof Date)}function gS(t,e){for(const n of t)if(n.some(e))return!0;return!1}const mS={linear:"linear",identity:"identity",log:"log",pow:"pow",sqrt:"sqrt",sequential:"sequential"},yS={threshold:"threshold",quantize:"quantize",quantile:"quantile"},vS={ordinal:"ordinal",band:"band",point:"point"},bS={constant:"constant"};function xS(t,e,n){const{component:r=[],coordinates:d=[],title:i}=e,[,p]=d_("component",n),g=t.filter(({guide:t})=>null!==t);var a,e=function(t,e,n){const[,o]=d_("component",n),s=t["coordinates"];function i(t,e,n,r){[e,t,i=[]]=[e,t,s];var i,a,e="x"===e?y_(i)?t+"Y":t+"X":"y"===e?y_(i)?t+"X":t+"Y":null;if(r&&e)return i=o(e)["props"],{defaultPosition:t,defaultSize:i,defaultOrder:a}=i,Object.assign(Object.assign({position:t,size:i,order:a,type:e},r),{scales:[n]})}return e.filter(t=>t.slider||t.scrollbar).flatMap(t=>{var{slider:e,scrollbar:n,name:r}=t;return[i("slider",r,t,e),i("scrollbar",r,t,n)]}).filter(t=>!!t)}(e,t,n);const m=[...r,...e];return i&&(t=p("title")["props"],{defaultPosition:n,defaultOrientation:e,defaultOrder:t,defaultSize:a}=t,m.push(Object.assign({type:"title",position:n,orientation:e,order:t,size:a},"string"==typeof i?{title:i}:i))),function(t,e){t=t.filter(t=>{return!!((t=t)&&t.type&&("function"==typeof t.type||({type:t,domain:n,range:r,interpolator:e}=t,n=n&&0<n.length,r=r&&0<r.length,["linear","sqrt","log","time","pow","threshold","quantize","quantile","ordinal","band","point"].includes(t)&&n&&r)||["sequential"].includes(t)&&n&&(r||e)||["constant","identity"].includes(t)&&r));var e,n,r});return[...function(t){const e=t.filter(t=>"string"!=typeof t.type||["shape","size","color","opacity"].includes(t.name)).filter(t=>!("constant"===t.type&&"size"===t.name)),n=e.filter(t=>!t.field),r=e.filter(t=>!!t.field),i=new Map(Array.from(bc(r,t=>t.field)).map(([t,e])=>[t,[...e,...n.filter(t=>"constant"===t.type)]]).concat([[void 0,n]]).filter(([,t])=>t.some(t=>"constant"!==t.type)));if(0===i.size)return[];t=Array.from(i).map(([,t])=>{var e,n,r=function(e){if(1===e.length)return[e];var n=[];for(let t=1;t<=e.length;t++)n.push(...C0(e,t));return n}(t).sort((t,e)=>e.length-t.length).map(t=>({combination:t,option:t.map(t=>{return[t.name,"string"!=typeof(t=(t=t).type)?null:t in mS?"continuous":t in vS?"discrete":t in yS?"distribution":t in bS?"constant":null]})}));const i=t=>t.sort((t,e)=>t[0].localeCompare(e[0]));for([e,n]of F6)for(const{option:a,combination:o}of r)if(n.some(t=>ln(i(t),i(a))))return[e,o];return null}).filter(qu);return t}(t),...function(t,n){return t.map(t=>{var e=t["name"];if(!(0<g_(n,"helix").length||v_(n))&&(!y_(n)||!m_(n)&&!b_(n))){if(e.startsWith("x"))return m_(n)?["axisArc",[t]]:b_(n)?["axisLinear",[t]]:[y_(n)?"axisY":"axisX",[t]];if(e.startsWith("y"))return m_(n)?["axisLinear",[t]]:b_(n)?["axisArc",[t]]:[y_(n)?"axisX":"axisY",[t]];if(e.startsWith("position")){if(0<g_(n,"radar").length)return["axisRadar",[t]];if(!m_(n))return["axisY",[t]]}}return null}).filter(qu)}(t,e)]}(g,d).forEach(([t,e])=>{var n=p(t)["props"],{defaultPosition:r,defaultOrientation:i,defaultSize:a,defaultOrder:o}=n,{guide:n,field:s}=Object.assign({},...e);for(const h of Array.isArray(n)?n:[n]){var l,c,[u,f]=function(t,e,n,r,i,a,o){var[s]=MS(o),e=[r.position||e,null!=s?s:n];if("string"==typeof t&&t.startsWith("axis"))return function(t,e,n,r,i){n=n[0].name;{var a,o;if("axisRadar"===t)return r=r.filter(t=>t.name.startsWith("position")),a=OS(n),n===r.slice(-1)[0].name||null===a?[null,null]:([o,s]=MS(i),["center",(s-o)/(r.length-1)*a+o])}{var s;if("axisY"===t&&function(t){return 0<g_(t,"parallel").length}(i))return null===(s=OS(n))?e:y_(i)?0===s?["top",null]:["center","horizontal"]:0===s?e:["center","vertical"]}if("axisLinear"===t)return[r]=MS(i),["center",r];if("axisArc"===t)return"inner"===e[0]?["inner",null]:["outer",null];if(m_(i))return["center",null];if(b_(i))return["center",null];if("axisX"===t&&function(t){return 0<g_(t,"reflect").length}(i)||"axisX"===t&&function(t){return 0<g_(t,"reflectY").length}(i))return["top",null];return e}(t,e,i,a,o);if("string"==typeof t&&t.startsWith("legend")&&m_(o)&&"center"===r.position)return["center","vertical"];return e}(t,r,i,h,e,g,d);(u||f)&&({size:l=a,order:c=o}=h,m.push(Object.assign(Object.assign({title:s},h),{position:u,orientation:f,order:c,size:l,type:t,scales:e})))}}),m}function wS(t,e,n,r,i){var[a]=d_("component",r),{scales:o=[],bbox:s}=t,t=rt(t,["scales","bbox"]),l=o.map(t=>iS(t,r)),s={bbox:s,scales:o,library:r};return a(t)({coordinate:e,library:r,markState:i,scales:l,theme:n,value:s})}function MS(t){var e,n=g_(t,"polar");return n.length?(n=n[n.length-1],{startAngle:n,endAngle:e}=Ls(n),[n,e]):(n=g_(t,"radial")).length?(e=n[n.length-1],{startAngle:t,endAngle:n}=Cs(e),[t,n]):[-Math.PI/2,Math.PI/2*3]}function OS(t){t=/position(\d*)/g.exec(t);return t?+t[1]:null}function kS(t,e,n,r,i,a){var[a]=d_("scale",a),o=t["type"];if("string"==typeof o&&o.startsWith("axis")&&["left","right","bottom","top"].includes(r)){t.transform=t.transform||[{type:"hide"}];var{labelFormatter:o,scales:s,title:l,tickCount:c,tickMethod:u,tickFilter:f}=t;const p="left"===r||"right"===r;var r=function(t,e,n){var{axis:n,["axis"+zu(e)]:e}=n;return it({},n,e,t.style)}(t,r,i),{tickLength:i=0,labelSpacing:h=0,titleSpacing:d=0}=r,r=rt(r,["tickLength","labelSpacing","titleSpacing"]),[s]=s,c=(void 0!==c&&(s.tickCount=c),void 0!==u&&(s.tickMethod=u),a(s));const g=function(t,e,n){n=_S(t,n),n=n.map(t=>{return"number"==typeof t?(e=t,Math.abs(e)<1e-15?e:parseFloat(e.toFixed(15))):t;var e}),e=e?"string"==typeof e?wx(e):e:t.getFormatter?t.getFormatter():t=>""+t;return n.map(e)}(c,o,f),m=at(r,"label"),y=g.map((n,r)=>{var t=Object.fromEntries(Object.entries(m).map(([t,e])=>[t,"function"==typeof e?e(n,r):e]));return p||(t.transform="none"),ES(n,t)});u=Rc(y,t=>t.width),a=i+h,o=(p?t.size=u+a:!function(t,e,n,r,i){var a=$c(e,t=>t.width);if(n<a)return 1;const o=t.clone(),s=(o.update({range:[0,n]}),_S(t,i)),l=s.map(t=>o.map(t)+function(t,e){if(!t.getBandWidth)return 0;t=t.getBandWidth(e)/2;return t}(o,t)),c=s.map((t,e)=>e),u=-r[0],f=n+r[1],h=(t,e)=>{e=e.width;return[t-e/2,t+e/2]};for(let t=0;t<c.length;t++){var d=l[t],[d,p]=h(d,e[t]);if(d<u||f<p)return 1;d=l[t+1];if(d){var[d]=h(d,e[t+1]);if(d<p)return 1}}return}(c,y,e,n,f)?(s=Rc(y,t=>t.height),t.size=s+a):(t.size=u+a,t.style=Object.assign(Object.assign({},t.style),{labelTransform:"rotate(90)"})),g.map((t,e)=>e));t.indexBBox=new Map(o.map(t=>[t,[g[t],y[t]]])),!1!==l&&null!=l&&(i=at(r,"title"),h=ES(Array.isArray(l)?l.join(","):l,i),p?t.size+=d+h.width:t.size+=d+h.height)}}function _S(t,e){t=t.getTicks?t.getTicks():t.getOptions().domain;return e?t.filter(e):t}function ES(t,e){t=(t=t)instanceof nt.DisplayObject?t:new nt.Text({style:{text:""+t}}),t.attr(Object.assign(Object.assign({},e),{visibility:"none"})),e=t.getBBox();return e}function SS(t,e,n,r,i,a,o){var s=bc(t,t=>t.position),{padding:t,paddingLeft:i=t,paddingRight:l=t,paddingBottom:c=t,paddingTop:t=t}=i,u={paddingBottom:c,paddingLeft:i,paddingTop:t,paddingRight:l};for(const d of r){var f="padding"+zu(D2(d)),h=u[f];if(void 0===h||"auto"===h)if(s.has(d)){const t=s.get(d);"auto"===h&&t.forEach(t=>kS(t,e,n,d,a,o));h=t.reduce((t,{size:e})=>t+e,0);u[f]=h}else u[f]=30}return u}function AS(t,I,e){var B=bc(t,t=>t.position),{paddingLeft:t,paddingRight:e,paddingTop:n,paddingBottom:F,marginLeft:r,marginTop:i,marginBottom:D,marginRight:z,innerHeight:a,innerWidth:o,height:s,width:W}=e,t=t+r,r=n+i,n=e+z,i=F+D,G={top:[t,0,o,r,"vertical",!0,ac],right:[W-n,r,n,a,"horizontal",!1,ac],bottom:[t,s-i,o,i,"vertical",!1,ac],left:[0,r,t,a,"horizontal",!0,ac],"top-left":[t,0,o,r,"vertical",!0,ac],"top-right":[t,0,o,r,"vertical",!0,ac],"bottom-left":[t,s-i,o,i,"vertical",!1,ac],"bottom-right":[t,s-i,o,i,"vertical",!1,ac],center:[t,r,o,a,"center",null,null],inner:[t,r,o,a,"center",null,null],outer:[t,r,o,a,"center",null,null]};for(const[C,t]of B.entries()){var l=G[C],[c,q]=P0(t,t=>"string"==typeof t.type&&("center"===C||!(!t.type.startsWith("axis")||!["inner","outer"].includes(C))));if(c.length){p=d=h=f=u=void 0;var u=c,f=I,h=l,d=C,[u,p]=P0(u,t=>!("string"!=typeof t.type||!t.type.startsWith("axis"))),c=(y=m=g=c=void 0,u),g=f,m=h,y=d;if("center"===y)if(!function(t){return Qc(t)&&Kc(t)}(g)){if(Kc(g)){u=void 0;d=void 0;v=void 0;b=void 0;x=void 0;w=void 0;u=c;d=m;var[v,b,x,w]=d;for(const tt of u)tt.bbox={x:v,y:b,width:x,height:w}}else if(Qc(g)){d=void 0;u=void 0;M=void 0;O=void 0;d=c;u=g;var M=m;var O=c[0].orientation;"horizontal"===O?function(e,t,n){const[r,i,a]=n,o=new Array(e.length+1).fill(0),s=t.map(o),l=s.filter((t,e)=>e%2==1).map(t=>t+i);for(let t=0;t<e.length;t++){var c=e[t];const i=l[t];var u=l[t+1]-i;c.bbox={x:r,y:i,width:a,height:u}}}(d,u,M):"vertical"===O&&function(e,t,n){const[r,i,,a]=n,o=new Array(e.length+1).fill(0),s=t.map(o),l=s.filter((t,e)=>e%2==0).map(t=>t+r);for(let t=0;t<e.length;t++){var c=e[t];const r=l[t];var u=l[t+1]-r;c.bbox={x:r,y:i,width:u,height:a}}}(d,u,M)}}else{k=void 0;O=void 0;_=void 0;E=void 0;S=void 0;A=void 0;var k=c;O=m;var[_,E,S,A]=O;for(const R of k)R.bbox={x:_,y:E,width:S,height:A},R.radar={index:k.indexOf(R),count:k.length}}else if("inner"===y){L=void 0;d=void 0;u=void 0;H=void 0;V=void 0;M=void 0;T=void 0;j=void 0;Y=void 0;$=void 0;var L=c;d=g;u=m;var[H,V,,u]=u,[M,T]=d.getCenter(),[d]=eu(d),u=u/2,j=d*u,Y=M-j,$=T-j;for(let t=0;t<L.length;t++)L[t].bbox={x:H+Y,y:V+$,width:2*j,height:2*j}}else if("outer"===y){g=void 0;d=void 0;U=void 0;K=void 0;X=void 0;Z=void 0;g=c;d=m;var[U,K,X,Z]=d;for(const et of g)et.bbox={x:U,y:K,width:X,height:Z}}J=Q=P=m=c=y=T=u=N=void 0;var N=p,u=f,T=h;if(0!==N.length){var[T,y,c,m]=T,[u]=eu(u),P=m/2*u/Math.sqrt(2),Q=T+c/2,J=y+m/2;for(let t=0;t<N.length;t++)N[t].bbox={x:Q-P,y:J-P,width:2*P,height:2*P}}}q.length&&!function(n,t){const[e,r,i,a,o,s,l]=t,[c,u,f,h,d,p,g,m]="vertical"===o?["y",r,"x",e,"height",a,"width",i]:["x",e,"y",r,"width",i,"height",a],y=(n.sort((t,e)=>null===l||void 0===l?void 0:l(t.order,e.order)),s?u+p:u);for(let t=0,e=y;t<n.length;t++){var v=n[t],b=v["size"];v.bbox={[c]:s?e-b:e,[f]:h,[d]:b,[g]:m},e+=b*(s?-1:1)}}(t,l)}}function LS(t,e,n){var{encode:r={},scale:i={},transform:a=[]}=e,e=rt(e,["encode","scale","transform"]);return[t,Object.assign(Object.assign({},e),{encode:r,scale:i,transform:a})]}function TS(t,i,a){return ue(this,void 0,void 0,function*(){var t=a["library"],e=i["data"],[t]=d_("data",t),n=function(t){if(!t)return{type:"inline",value:null};if(Array.isArray(t))return{type:"inline",value:t};var{type:e="inline"}=t,t=rt(t,["type"]);return Object.assign(Object.assign({},t),{type:e})}(e),{transform:r=[]}=n,n=yield function(t){return t.reduce((n,r)=>e=>ue(this,void 0,void 0,function*(){var t=yield n(e);return r(t)}),Du)}([rt(n,["transform"]),...r].map(t))(e);return[Array.isArray(n)?j0(n):[],Object.assign(Object.assign({},i),{data:n})]})}function jS(t,e,n){var r=e["encode"];if(!r)return[t,e];var i,a,o={};for([i,a]of Object.entries(r))if(Array.isArray(a))for(let t=0;t<a.length;t++)o[""+i+(0===t?"":t)]=a[t];else o[i]=a;return[t,Object.assign(Object.assign({},e),{encode:o})]}function NS(t,e,n){const{encode:r,data:i}=e;var a;return r?(a=T0(r,t=>{var e,n;return function(t){if("object"!=typeof t||t instanceof Date||null===t)return;t=t.type;return qu(t)}(t)?t:(e=i,{type:"function"==typeof(n=t)?"transform":"string"==typeof n&&function(t,e){return Array.isArray(t)&&t.some(t=>void 0!==t[e])}(e,n)?"field":"constant",value:t})}),[t,Object.assign(Object.assign({},e),{encode:a})]):[t,e]}function PS(t,e,n){var r=e["encode"];return r?(r=T0(r,(t,e)=>{var n=t["type"];return"constant"!==n||(n=e).startsWith("x")||n.startsWith("y")||n.startsWith("position")||"enterDelay"===n||"enterDuration"===n||"updateDelay"===n||"updateDuration"===n||"exitDelay"===n||"exitDuration"===n?t:Object.assign(Object.assign({},t),{constant:!0})}),[t,Object.assign(Object.assign({},e),{encode:r})]):[t,e]}function CS(t,e,n){const{encode:r,data:i}=e;if(!r)return[t,e];n=n.library;const a=function(t){const[n]=d_("encode",t);return(t,e)=>void 0===e||void 0===t?null:Object.assign(Object.assign({},e),{type:"column",value:n(e)(t),field:function(t){var{type:t,value:e}=t;return"field"===t&&"string"==typeof e?e:null}(e)})}(n);n=T0(r,t=>a(i,t));return[t,Object.assign(Object.assign({},e),{encode:n})]}function RS(t,e,n){var{tooltip:r={}}=e;return Uu(r)?[t,e]:Array.isArray(r)?[t,Object.assign(Object.assign({},e),{tooltip:{items:r}})]:$u(r)&&Zu(r)?[t,Object.assign(Object.assign({},e),{tooltip:r})]:[t,Object.assign(Object.assign({},e),{tooltip:{items:[r]}})]}function IS(g,t,e){const{data:m,encode:y,tooltip:n={}}=t;var r,i,a,o;return Uu(n)?[g,t]:(r=e=>{if(!e)return e;if("string"==typeof e)return g.map(t=>({name:e,value:m[t][e]}));if($u(e)){var{field:t,channel:n,color:r,name:i=t,valueFormatter:a=t=>t}=e,o="string"==typeof a?wx(a):a,s=n&&y[n],a=s&&y[n].field,l=i||a||n,c=[];for(const d of g){var u=t?m[d][t]:s?y[n].value[d]:null;c[d]={name:l,color:r,value:o(u)}}return c}if("function"!=typeof e)return e;var f=[];for(const p of g){var h=e(m[p],p,m,y);$u(h)?f[p]=h:f[p]={value:h}}return f},{title:o,items:i=[]}=n,a=rt(n,["title","items"]),o=Object.assign({title:r(o),items:Array.isArray(i)?i.map(r):[]},a),[g,Object.assign(Object.assign({},t),{tooltip:o})])}function BS(l,t,e){var n,r=t["encode"],i=rt(t,["encode"]);return r?(n=(r=Object.entries(r)).filter(([,t])=>{t=t.value;return Array.isArray(t[0])}).flatMap(([n,t])=>{var r=[[n,new Array(l.length).fill(void 0)]];const i=t["value"],a=rt(t,["value"]);for(let e=0;e<i.length;e++){var o=i[e];if(Array.isArray(o))for(let t=0;t<o.length;t++){var s=r[t]||[""+n+t,new Array(l).fill(void 0)];s[1][e]=o[t],r[t]=s}}return r.map(([t,e])=>[t,Object.assign({type:"column",value:e},a)])}),r=Object.fromEntries([...r,...n]),[l,Object.assign(Object.assign({},i),{encode:r})]):[l,t]}function FS(t,e,n){const{axis:r={},legend:i={},slider:a={},scrollbar:o={}}=e,s=(t,e)=>{return"boolean"==typeof t?t?{}:null:void 0===(t=t[e])||t?t:null};var l="object"==typeof r?Array.from(new Set(["x","y",...Object.keys(r)])):["x","y"];return it(e,{scale:Object.assign(Object.assign({},Object.fromEntries(l.map(t=>{var e=s(o,t);return[t,Object.assign({guide:s(r,t),slider:s(a,t),scrollbar:e},e&&{ratio:void 0===e.ratio?.5:e.ratio})]}))),{color:{guide:s(i,"color")},size:{guide:s(i,"size")},shape:{guide:s(i,"shape")},opacity:{guide:s(i,"opacity")}})}),[t,e]}function DS(t,e,n){var r=e["animate"];return r||void 0===r||it(e,{animate:{enter:{type:null},exit:{type:null},update:{type:null}}}),[t,e]}function zS(l,c,u){return ue(this,void 0,void 0,function*(){var[t,e]=yield function(s,l,c){return ue(this,void 0,void 0,function*(){var t=c["library"],[t]=d_("transform",t),{preInference:e=[],postInference:n=[]}=l,{transform:r=[]}=s,e=[LS,TS,jS,NS,PS,CS,BS,DS,FS,RS,...e.map(t),...r.map(t),...n.map(t),IS];let i=[],a=s;for(const o of e)[i,a]=yield o(i,a,c);return[i,a]})}(l,c,{library:u});const{encode:n,scale:h,data:r,tooltip:i}=e;if(!1===Array.isArray(r))return null;const a=c["channels"],o=wc(Object.entries(n).filter(([,t])=>qu(t)),t=>t.map(([t,e])=>Object.assign({name:t},e)),([t])=>{const e=null==(n=/([^\d]+)\d*$/.exec(t))?void 0:n[1];var n=a.find(t=>t.name===e);return null!=n&&n.independent?t:e});var s=a.filter(t=>{const{name:e,required:n}=t;if(o.find(([t])=>t===e))return!0;if(n)throw new Error(`Missing encoding for channel: ${e}.`);return!1}).flatMap(t=>{const{name:e,scale:c,scaleKey:u,range:f}=t;return o.filter(([t])=>t.startsWith(e)).map(([t,e],n)=>{var r=e.some(t=>t.visual),i=e.some(t=>t.constant),a=h[t]||{},{independent:o=!1,key:s=u||t,type:i=i?"constant":r?"identity":c}=a,r=rt(a,["independent","key","type"]),a="constant"===i,l=a?void 0:f;return{name:t,values:e,scaleKey:o||a?Symbol("independent"):s,scale:Object.assign({type:i,range:l},r)}})});return[e,Object.assign(Object.assign({},c),{index:t,channels:s,tooltip:i})]})}function WS(W,G,q,H){var V,Y;return ue(this,void 0,void 0,function*(){const[n]=d_("composition",q);var[t]=d_("interaction",q);const r=new Set(Object.keys(q).map(t=>{return null==(t=/mark\.(.*)/.exec(t))?void 0:t[1]}).filter(qu)),i=t=>{t=t.type;if("function"==typeof t){var{props:e={}}=t,{composite:e=!0}=e;if(e)return"mark"}return"string"==typeof t&&r.has(t)?"mark":t};const a=t=>"standardView"===i(t);var e=t=>{var e;return a(t)?[t]:(e=i(t),n({type:e})(t))},o=[];const s=new Map;for(var l=new Map,c=[W],u=[];c.length;){var f=c.shift();if(a(f)){var h=l.get(f),[h,d]=h?VS(h,f,q):yield qS(f,q),p=(s.set(h,f),o.push(h),d.flatMap(e).map(t=>p_(t,q)));if(c.push(...p),p.every(a)){var g=yield Promise.all(p.map(t=>HS(t,q)));aS(h=(h=g).flatMap(t=>Array.from(t.values())).flatMap(t=>t.channels.map(t=>t.scale)),"x"),aS(h,"y");for(let t=0;t<p.length;t++){var I=p[t],B=g[t];l.set(I,B)}}}else{d="mark"===i(f)?f:yield JS(f,q),h=e(d);Array.isArray(h)?c.push(...h):"function"==typeof h&&u.push(h())}}H.emitter.emit($.BEFORE_PAINT);const m=new Map,y=new Map,v=[];G.selectAll(r8(U)).data(o,t=>t.key).join(t=>t.append("g").attr("className",U).attr("id",t=>t.key).call(GS).each(function(t){YS(t,ot(this),v,q,H),m.set(t,this)}),t=>t.call(GS).each(function(t){YS(t,ot(this),v,q,H),y.set(t,this)}),t=>t.each(function(){for(const t of this.nameInteraction.values())t.destroy()}).remove());var b=t=>Array.from(t.entries()).map(([t,e])=>({view:t,container:e,options:s.get(t),update:function(h,d,p){return f=>ue(this,void 0,void 0,function*(){var t,[e,n]=yield qS(f,d),r=(YS(e,h,[],d,p),h),i=f,a=e,o=p,[s]=d_("interaction",s=d),l=(l=r.node()).nameInteraction,c=QS(i).find(([t])=>"tooltip"===t);(l=l.get("tooltip"))&&(null!=(t=l.destroy)&&t.call(l),c[1])&&(t=s(Object.assign({type:"tooltip"},c[1])),l={options:i,view:a,container:r.node(),update:t=>Promise.resolve(t)},t(l,[],o.emitter));for(const u of n)WS(u,h,d,p);return{options:f,view:e}})}(ot(e),q,H)})),x=b(m);for(const T of x){const W=T["options"];var w=new Map;T.container.nameInteraction=w;for(const j of QS(W)){var[M,O]=j;O&&(O=t(Object.assign({type:M},O))(T,x,H.emitter),w.set(M,{destroy:O}))}}var k=b(y);for(const N of k){const{options:W,container:P}=N;var _=P.nameInteraction;for(const C of QS(W)){var[E,S]=C,A=_.get(E);A&&null!=(V=A.destroy)&&V.call(A),S&&(A=t(Object.assign({type:E},S))(N,k,H.emitter),_.set(E,{destroy:A}))}}const{width:F,height:D}=W;var L=[];for(const R of u){var z=new Promise(e=>ue(this,void 0,void 0,function*(){for(const t of R)yield WS(Object.assign({width:F,height:D},t),G,q,H);e()}));L.push(z)}H.views=o,null!=(Y=H.animations)&&Y.forEach(t=>null==t?void 0:t.cancel()),H.animations=v,H.emitter.emit($.AFTER_PAINT);b=v.filter(qu).map(XS).map(t=>t.finished);return Promise.all([...b,...L])})}function GS(t){t.style("transform",t=>`translate(${t.layout.x}, ${t.layout.y})`)}function qS(e,n){return ue(this,void 0,void 0,function*(){var t=function(t){var{coordinate:e={},interaction:n={},style:r={},marks:i}=t,t=rt(t,["coordinate","interaction","style","marks"]),a=i.map(t=>t.coordinate||{}),o=i.map(t=>t.interaction||{}),s=i.map(t=>t.viewStyle||{}),a=[...a,e].reduceRight((t,e)=>it(t,e),{}),e=[n,...o].reduce((t,e)=>it(t,e),{}),n=[...s,r].reduce((t,e)=>it(t,e),{});return Object.assign(Object.assign({},t),{marks:i,coordinate:a,interaction:e,style:n})}(yield function(c,u){return ue(this,void 0,void 0,function*(){var[t,e]=d_("mark",u);const n=c["marks"];for(var r=[],i=[...n];i.length;){var[a]=i.splice(0,1),a=yield JS(a,u);const{type:s=Wu("G2Mark type is required."),key:l}=a;var{props:o={}}=e(s),{composite:o=!0}=o;if(o){const n=yield t(a)(c);o=Array.isArray(n)?n:[n];i.unshift(...o.map((t,e)=>Object.assign(Object.assign({},t),{key:l+"-"+e})))}else r.push(a)}return Object.assign(Object.assign({},c),{marks:r})})}(e,n)),t=(e.interaction=t.interaction,e.coordinate=t.coordinate,p_(t,n));return VS(yield HS(t,n),t,n)})}function HS(p,g){return ue(this,void 0,void 0,function*(){var[t]=d_("theme",g),[,e]=d_("mark",g),{theme:n,marks:r,coordinates:i=[]}=p,a=t(ZS(n)),o=new Map;for(const f of r){var s,l=f["type"],{props:l={}}=e(l),l=yield zS(f,l,g);l&&([l,s]=l,o.set(l,s))}for(const h of bc(Array.from(o.values()).flatMap(t=>t.channels),({scaleKey:t})=>t).values()){var c=h.reduce((t,{scale:e})=>it(t,e),{}),u=h[0]["values"],u=Array.from(new Set(u.map(t=>t.field).filter(qu)));const p=it({guide:{title:0===u.length?void 0:u},field:u[0]},c);u=h[0]["name"];const d=rS(u,h.flatMap(({values:t})=>t.map(t=>t.value)),p,i,a,g);h.forEach(t=>t.scale=d)}return o})}function VS(t,e,n){var[r]=d_("mark",n),[i]=d_("theme",n),[a]=d_("labelTransform",n);const{key:o,frame:s=!1,theme:l,clip:c,style:u={},labelTransform:f=[]}=e;var h,d,i=i(ZS(l)),p=Array.from(t.values()),g=Array.from(new Set(p.flatMap(t=>t.channels.map(t=>t.scale)))),g=xS(function(t,e,n){for(var[r]of n.entries())if("cell"===r.type)return t.filter(t=>"shape"!==t.name);if(1!==e.length||t.some(t=>"shape"===t.name))return t;n=e[0].defaultShape;if(!["point","line","rect","hollow"].includes(n))return t;e=(null==(e=t.find(t=>"color"===t.name))?void 0:e.field)||null,e={field:e,name:"shape",type:"constant",domain:[],range:[{point:"point",line:"hyphen",rect:"square",hollow:"hollow"}[n]]};return[...t,e]}(Array.from(g),p,t),e,n),m=function(t,e,n,r){var{width:i,height:a,x:o=0,y:s=0,inset:l=0,insetLeft:c=l,insetTop:u=l,insetBottom:f=l,insetRight:l=l,margin:h=0,marginLeft:d=h,marginBottom:p=h,marginTop:g=h,marginRight:h=h,padding:m,paddingBottom:y=m,paddingLeft:v=m,paddingRight:b=m,paddingTop:m=m}=e,x=(t,e,n)=>"auto"===t?Math.min(n,e):e,{paddingLeft:w,paddingRight:M}=SS(t,a,[0,0],["left","right"],e,n,r),v=x(v,w,1/3*(O=i-d-h)),w=x(b,M,1/3*O),{paddingTop:M,paddingBottom:O}=SS(t,b=O-v-w,[v,w],["bottom","top"],e,n,r),e=x(y,O,1/3*(t=a-p-g)),n=x(m,M,1/3*t);return{width:i,height:a,insetLeft:c,insetTop:u,insetBottom:f,insetRight:l,innerWidth:b,innerHeight:t-e-n,paddingLeft:v,paddingRight:w,paddingTop:n,paddingBottom:e,marginLeft:d,marginBottom:p,marginTop:g,marginRight:h,x:o,y:s}}(g,e,i,n),y=function(t,e,n){var[n]=d_("coordinate",n),{innerHeight:r,innerWidth:i,insetLeft:a,insetTop:o,insetRight:s,insetBottom:l,marginLeft:c,marginTop:u}=t,{coordinates:e=[]}=e,e=(e=e).find(t=>"cartesian"===t.type)?e:[...e,{type:"cartesian"}];return new f_(Object.assign(Object.assign({},t),{x:a+c,y:o+u,width:i-a-s,height:r-l-o,transformations:e.map(n).flat()}))}(m,e,n),p=s?it({mainLineWidth:1,mainStroke:"#000"},u):u,v=(AS(g,y,m),{}),b=[];for([h,d]of t.entries()){const{children:M,dataDomain:O,modifier:k,key:_}=h,{index:E,channels:S,tooltip:A}=d;var x=T0(Object.fromEntries(S.map(({name:t,scale:e})=>[t,e])),t=>iS(t,n));Object.assign(v,x);const L=function(t,e){var n={};for(const s of t){var{values:r,name:i}=s;const l=e[i];for(const c of r){var{name:a,value:o}=c;n[a]=o.map(t=>l.map(t))}}return n}(S,x),[T,j,N]=function([e,n,t]){if(t)return[e,n,t];var r=[],i=[];for(let t=0;t<e.length;t++){var a=e[t],o=n[t];o.every(([t,e])=>qu(t)&&qu(e))&&(r.push(a),i.push(o))}return[r,i]}(r(h)(E,x,L,y));var w=O||T.length;const P=k?k(j,w,m):[],C=t=>{var e;return null==(e=null==(e=A.title)?void 0:e[t])?void 0:e.value},R=e=>A.items.map(t=>t[e]);w=T.map((t,e)=>{var n=Object.assign({points:j[e],transform:P[e],index:t,markKey:_,viewKey:o},A&&{title:C(t),items:R(t)});for(const[r,i]of Object.entries(L))n[r]=i[t],N&&(n["series"+Qe(r)]=N[e].map(t=>i[t]));return N&&(n.seriesIndex=N[e]),N&&A&&(n.seriesItems=N[e].map(t=>R(t)),n.seriesTitle=N[e].map(t=>C(t))),n}),w=(d.data=w,d.index=T,null==M?void 0:M(w,x,m));b.push(...w||[])}return[{layout:m,theme:i,coordinate:y,components:g,markState:t,key:o,clip:c,scale:v,style:p,labelTransform:$S(f.map(a))},b]}function YS(Z,Q,J,tt,et){ue(this,void 0,void 0,function*(){const{components:I,theme:n,layout:t,markState:r,coordinate:i,key:e,style:B,clip:a}=Z,{width:F,height:D}=t,z=rt(t,["x","y","width","height"]),o=["view","plot","main","content"];var s=o.map((t,e)=>e);const l=o.map(t=>Hu(Object.assign({},n,B),t)),W=["a","margin","padding","inset"].map(t=>at(z,t)),c=t=>t.style("x",t=>p[t].x).style("y",t=>p[t].y).style("width",t=>p[t].width).style("height",t=>p[t].height).each(function(t){var e,n,r=ot(this),t=l[t];for([e,n]of Object.entries(t))r.style(e,n)});let u=0,f=0,h=F,d=D;const p=s.map(t=>{var{left:t=0,top:e=0,bottom:n=0,right:r=0}=W[t];return u+=t,f+=e,h-=t+r,d-=e+n,{x:u,y:f,width:h,height:d}}),g=(Q.selectAll(r8(ht)).data(s.filter(t=>qu(l[t])),t=>o[t]).join(t=>t.append("rect").attr("className",ht).style("zIndex",-2).call(c),t=>t.call(c),t=>t.remove()),function(t){let e=-1/0,n=1/0;for(var[r,i]of t){var{animate:r={}}=r,i=i["data"],{enter:r={},update:a={},exit:o={}}=r,{type:s,duration:l=300,delay:c=0}=a,{type:u,duration:f=300,delay:h=0}=r,{type:d,duration:p=300,delay:g=0}=o;for(const _ of i){var{updateType:m=s,updateDuration:y=l,updateDelay:v=c,enterType:b=u,enterDuration:x=f,enterDelay:w=h,exitDuration:M=p,exitDelay:O=g,exitType:k=d}=_;void 0!==m&&!m||(e=Math.max(e,y+v),n=Math.min(n,v)),void 0!==k&&!k||(e=Math.max(e,M+O),n=Math.min(n,O)),void 0!==b&&!b||(e=Math.max(e,x+w),n=Math.min(n,w))}}return e===-1/0?null:[n,e-n]}(r)),m=!!g&&{duration:g[1]};var y,v,b,s=Q.selectAll(r8(ut)).data(I,(t,e)=>t.type+"-"+e).join(t=>t.append("g").style("zIndex",({zIndex:t})=>t||-1).attr("className",ut).append(t=>wS(it({animate:m},t),i,n,tt,r)),t=>t.transition(function(t){var{preserve:e=!1}=t;if(!e)return e=wS(it({animate:m},t),i,n,tt,r)["attributes"],[t]=this.childNodes,t.update(e)})).transitions();J.push(...s.flat().filter(qu));const x=Q.selectAll(r8(ct)).data([t],()=>e).join(t=>t.append("rect").style("zIndex",0).style("fill","transparent").attr("className",ct).call(t8).call(n8,Array.from(r.keys())).call(i8,a),t=>t.call(n8,Array.from(r.keys())).call(t=>{if(!g)return t8(t);{const[l,c]=g;t.transition(function(t){var{x:e,y:n,width:r,height:i}=this.style,{paddingLeft:t,paddingTop:a,innerWidth:o,innerHeight:s}=t;return this.animate([{x:e,y:n,width:r,height:i},{x:t,y:a,width:o,height:s}],{delay:l,duration:c,fill:"both"})})}}).call(i8,a)).transitions();J.push(...x.flat());for([y,v]of r.entries()){var G=v["data"];const{key:e,class:q,type:A}=y;var w=Q.select("#"+e);const L=function(s,t,e,n,l){const[c]=d_("shape",n),u=s["data"],{defaultShape:f,data:r}=t,h=r.map(t=>t.points),{theme:d,coordinate:p}=e,{type:g,style:m={}}=s;return t=>{var{shape:e=f}=m,{shape:e=e,points:n,seriesIndex:r,index:i}=t,t=rt(t,["shape","points","seriesIndex","index"]),t=Object.assign(Object.assign({},t),{shape:e,mark:g,defaultShape:f,index:i});const a=r?r.map(t=>u[t]):u[i],o=r||i;r=T0(m,t=>US(t,a,o,u));return c(Object.assign(Object.assign({},r),{type:e8(s,e)}))(n,t,p,d,h,l)}}(y,v,Z,tt,et),H=(M=y,b=v,KS("enter",M,b,Z,tt)),T=(M=y,b=v,KS("update",M,b,Z,tt)),V=(M=y,b=v,KS("exit",M,b,Z,tt));var M=function(t,e,n,r){t=t.node().parentElement;return t.findAll(t=>void 0!==t.style.facet&&t.style.facet===n&&t!==e.node()).flatMap(t=>t.getElementsByClassName(r))}(Q,w,q,"element");const x=w.selectAll(r8(lt)).selectFacetAll(M).data(G,t=>t.key,t=>t.groupKey).join(t=>t.append(L).attr("className",lt).attr("markType",A).transition(function(t){return H(t,[this])}),e=>e.call(t=>{const l=t.parent(),c=function(n){const r=new Map;return t=>{var e;return r.has(t)?r.get(t):(e=n(t),r.set(t,e),e)}}(t=>{var[t,e]=t.getBounds().min;return[t,e]});e.transition(function(t,e){n=this,r=l,s=c,n.__facet__&&(i=n.parentNode.parentNode,o=r.parentNode,[i,a]=s(i),[s,o]=s(o),i=`translate(${i-s}, ${a-o})`,s=n.style.transform,a="none"===(a=s)||void 0===a?"":s,n.style.transform=(a+" "+i).trimStart(),r.append(n));var n,r,i,a,o=L(t,e),s=T(t,[this],[o]);return null===s&&(this.nodeName===o.nodeName?Gu(this,o):this.parentNode.replaceChild(o,this)),s})}),t=>t.each(function(){this.__removed__=!0}).transition(function(t){return V(t,[this])}).remove(),t=>t.append(L).attr("className",lt).attr("markType",A).transition(function(t){var e=this["__fromElements__"],t=T(t,e,[this]);return new Z0(e,null,this.parentNode).transition(t).remove(),t}),t=>t.transition(function(t){var e=new Z0([],this.__toData__,this.parentNode).append(L).attr("className",lt).attr("markType",A).nodes();return T(t,[this],e)}).remove()).transitions();J.push(...x.flat())}{var O=Z,k=Q,_=tt,E,S;const[Y]=d_("labelTransform",_),{markState:$,labelTransform:j}=O,U=k.select(r8(st)).node(),N=new Map,P=new Map,K=Array.from($.entries()).flatMap(([t,e])=>{var{labels:n=[],key:r}=t;const i=function(t,e,n,r){const[s]=d_("shape",r),l=t["data"],{data:i,defaultLabelShape:c}=e,u=i.map(t=>t.points),{theme:f,coordinate:h}=n;return t=>{const{index:e,points:n}=t,r=l[e];var{formatter:i=t=>""+t,style:a}=t,t=rt(t,["formatter","transform","style"]),t=T0(Object.assign(Object.assign({},t),a),t=>US(t,r,e,l)),{shape:a=c,text:o}=t,t=rt(t,["shape","text"]),i="string"==typeof i?wx(i):i,i=Object.assign(Object.assign({},t),{text:i(o,r,e,l)});return s(Object.assign({type:"label."+a},t))(n,i,h,f,u)}}(t,e,O,_),a=k.select("#"+r).selectAll(r8(lt)).nodes().filter(t=>!t.__removed__);return n.flatMap((e,n)=>{const r=rt(e,["transform"]);return a.flatMap(t=>{t=function(n,r,i){const{seriesIndex:t,seriesKey:a,points:o,key:e,index:s}=i.__data__,l=function(t){const e=t.cloneNode(),n=t.getAnimations(),r=(e.style.visibility="hidden",n.forEach(t=>{t=t.effect.getKeyframes();e.attr(t[t.length-1])}),t.parentNode.appendChild(e),e.getLocalBounds()),{min:i,max:a}=(e.destroy(),r);return[i,a]}(i);if(!t)return[Object.assign(Object.assign({},n),{key:e+"-"+r,bounds:l,index:s,points:o,dependentElement:i})];var c=function(t){t=t.selector;if(!t)return null;if("function"==typeof t)return t;if("first"===t)return t=>[t[0]];if("last"===t)return t=>[t[t.length-1]];throw new Error("Unknown selector: "+t)}(n),u=t.filter((t,e)=>o[e].every(qu)).map((t,e)=>Object.assign(Object.assign({},n),{key:a[e]+"-"+r,bounds:[o[e]],index:t,points:o,dependentElement:i}));return c?c(u):u}(r,n,t);return t.forEach(t=>{N.set(t,i),P.set(t,e)}),t})})}),C=ot(U).selectAll(r8(ft)).data(K,t=>t.key).join(t=>t.append(t=>N.get(t)(t)).attr("className",ft),t=>t.each(function(t){Gu(this,N.get(t)(t))}),t=>t.remove()).nodes(),X=bc(C,t=>P.get(t.__data__)),R=O["coordinate"];for([E,S]of X){var{transform:E=[]}=E;$S(E.map(Y))(S,R)}j&&j(C,R)}})}function $S(r){return(t,e)=>{for(const n of r)t=n(t,e);return t}}function US(t,e,n,r){return"function"==typeof t?t(e,n,r):"string"==typeof t&&void 0!==e[t]?e[t]:t}function KS(o,t,e,n,r){var[,i]=d_("shape",r);const[s]=d_("animation",r);r=e.defaultShape;const{theme:a,coordinate:l}=n;e=`default${Qe(o)}Animation`;const{[e]:c}=i(e8(t,r)).props,{[o]:u={}}=a,f=(null==(n=t.animate)?void 0:n[o])||{};return(t,e,n)=>{var{[o+"Type"]:t,[o+"Delay"]:r,[o+"Duration"]:i,[o+"Easing"]:a}=t,t=Object.assign({type:t||c},f);return t.type?(t=s(t)(e,n,{delay:r,duration:i,easing:a},l,u),Array.isArray(t)?t:[t]):null}}function XS(t){return t.finished.then(()=>{t.cancel()}),t}function ZS(t={}){var e;return"string"==typeof t?{type:t}:({type:e="classic"}=t,t=rt(t,["type"]),Object.assign(Object.assign({},t),{type:e}))}function QS(t){var{interaction:t={}}=t;return Object.entries(it({event:!0,tooltip:!0,sliderFilter:!0,legendFilter:!0,scrollbarFilter:!0},t))}function JS(r,i){return ue(this,void 0,void 0,function*(){var t={library:i},e=r["data"],n=rt(r,["data"]);return null==e?r:([,{data:e}]=yield TS(0,{data:e},t),Object.assign({data:e},n))})}function t8(t){t.style("x",t=>t.paddingLeft).style("y",t=>t.paddingTop).style("width",t=>t.innerWidth).style("height",t=>t.innerHeight)}function e8(t,e){t=t.type;return"string"==typeof e?t+"."+e:e}function n8(t,e){const n=t=>void 0!==t.class?""+t.class:"";0===t.nodes().length||(t.selectAll(r8(E)).data(e,t=>t.key).join(t=>t.append("g").attr("className",E).attr("id",t=>t.key).style("facet",n).style("fill","transparent").style("zIndex",t=>{return null!=(t=t.zIndex)?t:0}),t=>t.style("facet",n).style("fill","transparent").style("zIndex",t=>{return null!=(t=t.zIndex)?t:0}),t=>t.remove()),t.select(r8(st)).node())||t.append("g").attr("className",st).style("zIndex",0)}function r8(...t){return t.map(t=>"."+t).join("")}function i8(t,i){t.node()&&t.style("clipPath",t=>{var e,n,r;return i?({paddingTop:t,paddingLeft:e,innerWidth:n,innerHeight:r}=t,new nt.Rect({style:{x:e,y:t,width:n,height:r}})):null})}function a8(t){for(var t=it({},t),e=new Map([[t,null]]),n=new Map([[null,-1]]),r=[t];r.length;){var i,a,o=r.shift(),{children:s=[]}=(void 0===o.key&&(a=e.get(o),i=n.get(o),a=null===a?"0":a.key+"-"+i,o.key=a),o);if(Array.isArray(s))for(let t=0;t<s.length;t++){var l=it({},s[t]);s[t]=l,e.set(l,o),n.set(l,t),r.push(l)}}return t}function o8(t,e={},n=()=>{},r=t=>{throw t}){const{width:i=640,height:a=480,theme:o}=t,s=(o||Wu('ChartOptions.theme is required, such as `const chart = new Chart({ theme: "classic"})`.'),a8(t)),{canvas:l=(t=i,f=a,h=new _.Renderer,h.registerPlugin(new _s),new nt.Canvas({width:t,height:f,container:document.createElement("div"),renderer:h})),library:c=B6(),emitter:u=new Es}=e;var f,h;e.canvas=l,e.library=c,e.emitter=u,l.resize(i,a),u.emit($.BEFORE_RENDER);const d=ot(l.document.documentElement);return l.ready.then(()=>WS(Object.assign(Object.assign({},s),{width:i,height:a}),d,c,e)).then(()=>{l.requestAnimationFrame(()=>{u.emit($.AFTER_RENDER),null!=n&&n()})}).catch(t=>{null!=r&&r(t)}),"string"==typeof(t=l.getConfig().container)?document.getElementById(t):t}function s8(t,e={},n=!1){var r,{canvas:e,emitter:i}=e;e&&(null!=(r=(r=e).getRoot().querySelectorAll("."+U))&&r.forEach(t=>{var{nameInteraction:t=new Map}=t;0<(null==t?void 0:t.size)&&Array.from(null==t?void 0:t.values()).forEach(t=>{null!=t&&t.destroy()})}),n?e.destroy():e.destroyChildren()),i.off()}function l8(t,{name:e,key:n=e}){t.prototype[e]=function(t){return 0===arguments.length?this.attr(n):this.attr(n,t)}}function c8(t,{name:e,key:n=e}){t.prototype[e]=function(t){return 0===arguments.length?this.attr(n):Array.isArray(t)?this.attr(n,t):(t=[...this.attr(n)||[],t],this.attr(n,t))}}function u8(t,{name:e,key:r=e}){t.prototype[e]=function(t,e){var n;return 0===arguments.length?this.attr(r):1===arguments.length&&"string"!=typeof t?this.attr(r,t):((n=this.attr(r)||{})[t]=1===arguments.length||e,this.attr(r,n))}}function g(r){return t=>{for(const n of r){var e=n["type"];"value"===e?l8(t,n):"array"===e?c8(t,n):"object"===e?u8(t,n):"node"===e?function(t,{name:n,ctor:r}){t.prototype[n]=function(t){var e=this.append(r);return"mark"===n&&(e.type=t),e}}(t,n):"container"===e?function(t,{name:e,ctor:n}){t.prototype[e]=function(){return this.type=null,this.append(n)}}(t,n):"mix"===e&&function(t,{name:r}){t.prototype[r]=function(t){var e,n;return 0===arguments.length?this.attr(r):Array.isArray(t)?this.attr(r,{items:t}):$u(t)&&(void 0!==t.title||void 0!==t.items)||null===t||!1===t?this.attr(r,t):({items:n=[]}=e=this.attr(r)||{},n.push(t),e.items=n,this.attr(r,e))}}(t,n)}return t}}function f8(t){return Object.entries(t).map(([t,e])=>({type:"node",name:t,ctor:e}))}function h8(t,e){for(var n=[t];n.length;){var r=n.shift(),r=(e&&e(r),r.children||[]);for(const i of r)n.push(i)}}class d8{constructor(t={},e){this.parentNode=null,this.children=[],this.index=0,this.type=e,this.value=t}map(t=t=>t){t=t(this.value);return this.value=t,this}attr(e,n){return 1===arguments.length?this.value[e]:this.map(t=>(t[e]=n,t))}append(t){t=new t({});return t.children=[],this.push(t),t}push(t){return t.parentNode=this,t.index=this.children.length,this.children.push(t),this}remove(){var t,e=this.parentNode;return e&&(e=e["children"],t=e.findIndex(t=>t===this),e.splice(t,1)),this}getNodeByKey(e){let n=null;return h8(this,t=>{e===t.attr("key")&&(n=t)}),n}getNodesByType(e){const n=[];return h8(this,t=>{e===t.type&&n.push(t)}),n}getNodeByType(e){let n=null;return h8(this,t=>{n||e===t.type&&(n=t)}),n}call(t,...e){return t(this.map(),...e),this}getRoot(){let t=this;for(;t&&t.parentNode;)t=t.parentNode;return t}}class p8 extends d8{changeData(t){var e=this.getRoot();if(e)return this.attr("data",t),null==e?void 0:e.render()}getMark(){var t,e=null==(e=this.getRoot())?void 0:e.getView();if(e)return e=e["markState"],t=Array.from(e.keys()).find(t=>t.key===this.attr("key")),e.get(t)}getScale(){var t=null==(t=this.getRoot())?void 0:t.getView();return!t||null==t?void 0:t.scale}getScaleByChannel(t){var e=null==(e=this.getRoot())?void 0:e.getView();return!e||null==(e=null==e?void 0:e.scale)?void 0:e[t]}getGroup(){var t=this.attr("key");if(t)return this.getRoot().getContext().canvas.getRoot().getElementById(t)}}a=[{name:"encode",type:"object"},{name:"scale",type:"object"},{name:"data",type:"value"},{name:"transform",type:"array"},{name:"style",type:"object"},{name:"animate",type:"object"},{name:"coordinate",type:"object"},{name:"interaction",type:"object"},{name:"label",type:"array",key:"labels"},{name:"axis",type:"object"},{name:"legend",type:"object"},{name:"slider",type:"object"},{name:"scrollbar",type:"object"},{name:"state",type:"object"},{name:"tooltip",type:"mix"}];let g8=class extends p8{constructor(){super({})}},m8=(g8=t([g(a)],g8),class extends p8{constructor(){super({},"interval")}}),y8=(m8=t([g(a)],m8),class extends p8{constructor(){super({},"rect")}}),v8=(y8=t([g(a)],y8),class extends p8{constructor(){super({},"point")}}),b8=(v8=t([g(a)],v8),class extends p8{constructor(){super({},"area")}}),x8=(b8=t([g(a)],b8),class extends p8{constructor(){super({},"line")}}),w8=(x8=t([g(a)],x8),class extends p8{constructor(){super({},"cell")}}),M8=(w8=t([g(a)],w8),class extends p8{constructor(){super({},"vector")}}),O8=(M8=t([g(a)],M8),class extends p8{constructor(){super({},"link")}}),k8=(O8=t([g(a)],O8),class extends p8{constructor(){super({},"polygon")}});k8=t([g(a)],k8);bo=t([g(a)],class extends p8{constructor(){super({},"image")}});let _8=class extends p8{constructor(){super({},"text")}},E8=(_8=t([g(a)],_8),class extends p8{constructor(){super({},"box")}}),S8=(E8=t([g(a)],E8),class extends p8{constructor(){super({},"lineX")}}),A8=(S8=t([g(a)],S8),class extends p8{constructor(){super({},"lineY")}}),L8=(A8=t([g(a)],A8),class extends p8{constructor(){super({},"range")}}),T8=(L8=t([g(a)],L8),class extends p8{constructor(){super({},"rangeX")}}),j8=(T8=t([g(a)],T8),class extends p8{constructor(){super({},"rangeY")}}),N8=(j8=t([g(a)],j8),class extends p8{constructor(){super({},"connector")}}),P8=(N8=t([g(a)],N8),class extends p8{constructor(){super({},"shape")}}),C8=(P8=t([g(a)],P8),class extends p8{constructor(){super({},"sankey")}}),R8=(C8=t([g([...a,{name:"layout",type:"value"}])],C8),class extends p8{constructor(){super({},"treemap")}}),I8=(R8=t([g([...a,{name:"layout",type:"value"}])],R8),class extends p8{constructor(){super({},"boxplot")}}),B8=(I8=t([g(a)],I8),class extends p8{constructor(){super({},"density")}}),F8=(B8=t([g(a)],B8),class extends p8{constructor(){super({},"heatmap")}}),D8=(F8=t([g(a)],F8),class extends p8{constructor(){super({},"path")}}),z8=(D8=t([g(a)],D8),class extends p8{constructor(){super({},"pack")}}),W8=(z8=t([g([...a,{name:"layout",type:"value"}])],z8),class extends p8{constructor(){super({},"forceGraph")}}),G8=(W8=t([g([...a,{name:"layout",type:"value"}])],W8),class extends p8{constructor(){super({},"tree")}}),q8=(G8=t([g([...a,{name:"layout",type:"value"}])],G8),class extends p8{constructor(){super({},"wordCloud")}}),H8=(q8=t([g([...a,{name:"layout",type:"object"}])],q8),class extends p8{constructor(){super({},"gauge")}});H8=t([g(a)],H8);const V8={mark:g8,interval:m8,rect:y8,point:v8,area:b8,line:x8,cell:w8,vector:M8,link:O8,polygon:k8,image:bo,text:_8,box:E8,lineX:S8,lineY:A8,range:L8,rangeX:T8,rangeY:j8,connector:N8,sankey:C8,treemap:R8,boxplot:I8,density:B8,heatmap:F8,path:D8,shape:P8,pack:z8,forceGraph:W8,tree:G8,wordCloud:q8,gauge:H8};class Y8 extends d8{changeData(e){var t,n=this.getRoot();if(n)return this.attr("data",e),null!=(t=this.children)&&t.length&&this.children.forEach(t=>{t.attr("data",e)}),null==n?void 0:n.render()}getView(){var t=this.getRoot().getContext()["views"];if(null!=t&&t.length)return t.find(t=>t.key===this._key)}getScale(){var t;return null==(t=this.getView())?void 0:t.scale}getScaleByChannel(t){var e=this.getScale();if(e)return e[t]}getCoordinate(){var t;return null==(t=this.getView())?void 0:t.coordinate}getTheme(){var t;return null==(t=this.getView())?void 0:t.theme}getGroup(){var t=this._key;if(t)return this.getRoot().getContext().canvas.getRoot().getElementById(t)}show(){var t=this.getGroup();t&&!t.isVisible()&&Hw(t)}hide(){var t=this.getGroup();t&&t.isVisible()&&qw(t)}}let $8=class extends Y8{constructor(t={},e="view"){super(t,e)}},U8=($8=t([g([{type:"value",name:"data"},{type:"value",name:"coordinate"},{type:"object",name:"interaction"},{type:"object",name:"theme"},{type:"object",name:"style"},{type:"object",name:"scale"},{type:"object",name:"axis"},{type:"object",name:"legend"},...f8(V8)])],$8),class extends Y8{constructor(){super({},"spaceLayer")}}),K8=(U8=t([g([{type:"value",name:"data"},...f8(V8)])],U8),class extends Y8{constructor(){super({},"spaceFlex")}}),X8=(K8=t([g([{type:"value",name:"data"},...f8(V8)])],K8),class extends Y8{constructor(){super({},"facetRect")}}),Z8=(X8=t([g([{type:"value",name:"data"},{type:"array",name:"transform"},{type:"object",name:"scale"},{type:"object",name:"encode"},{type:"object",name:"legend"},{type:"object",name:"axis"},...f8(V8)])],X8),class extends Y8{constructor(){super({},"facetCircle")}}),Q8=(Z8=t([g([{type:"value",name:"data"},{type:"array",name:"transform"},{type:"object",name:"scale"},{type:"object",name:"encode"},{type:"object",name:"legend"},{type:"object",name:"axis"},...f8(V8)])],Z8),class extends Y8{constructor(){super({},"repeatMatrix")}}),J8=(Q8=t([g([{type:"value",name:"data"},{type:"array",name:"transform"},{type:"object",name:"scale"},{type:"object",name:"encode"},{type:"object",name:"encode"},{type:"object",name:"legend"},...f8(V8)])],Q8),class extends Y8{constructor(){super({},"timingKeyframe")}}),tA=(J8=t([g([...f8(V8)])],J8),class extends Y8{constructor(){super({},"geoView")}}),eA=(tA=t([g([{type:"value",name:"data"},{type:"value",name:"coordinate"},{type:"object",name:"interaction"},{type:"object",name:"theme"},{type:"object",name:"style"},{type:"object",name:"scale"},{type:"object",name:"legend"},...f8(V8)])],tA),class extends Y8{constructor(){super({},"geoPath")}});eA=t([g([{type:"value",name:"data"},{type:"value",name:"coordinate"},{type:"object",name:"interaction"},{type:"object",name:"theme"},{type:"object",name:"style"},{type:"object",name:"scale"},{type:"object",name:"encode"},{type:"object",name:"legend"},{type:"object",name:"state"},...f8(V8)])],eA);const nA={view:$8,spaceLayer:U8,spaceFlex:K8,facetRect:X8,facetCircle:Z8,repeatMatrix:Q8,timingKeyframe:J8,geoView:tA,geoPath:eA};for(const fA of Object.values(nA))g(f8(nA))(fA);const rA=B6();const iA=["width","height","padding","paddingLeft","paddingRight","paddingBottom","paddingTop","inset","insetLeft","insetRight","insetTop","insetBottom","margin","marginLeft","marginRight","marginTop","marginBottom","autoFit","theme","title"];function aA(t){return Object.assign(Object.assign({},t.value),{type:t.type})}function oA(t,e){var n,r=t["autoFit"];return r?(r=e,e=getComputedStyle(r),n=r.clientWidth||ef(e.width),r=r.clientHeight||ef(e.height),{width:n-(ef(e.paddingLeft)+ef(e.paddingRight)),height:r-(ef(e.paddingTop)+ef(e.paddingBottom))}):({width:n=640,height:r=480}=t,{width:n,height:r})}function sA(t){var t=function(t){if(null!==t.type)return t;var e=t.children[t.children.length-1];for(const n of iA)e.attr(n,t.attr(n));return e}(t),e=[t],n=new Map;for(n.set(t,aA(t));e.length;){const t=e.pop();var r=n.get(t),{children:i=[]}=t;for(const s of i){var a=aA(s),{children:o=[]}=r;o.push(a),e.push(s),n.set(s,a),r.children=o}}return n.get(t)}function lA(t,e,n){var t=t["type"],{type:n=n||t}=e;if("view"===n)return e;if("string"!=typeof n)return e;if(t=n,!new Set(Object.keys(V8)).has(t))return e;var r={type:"view"},i=Object.assign({},e);for(const a of iA)void 0!==i[a]&&(r[a]=i[a],delete i[a]);return Object.assign(Object.assign({},r),{children:[i]})}function cA(t){var e=t["type"],t=rt(t,["type","children"]);if("string"==typeof e)return(e=new(function(t){var e=Object.assign(Object.assign({},V8),nA)[t];if(e)return e;throw new Error(`Unknown mark: ${t}.`)}(e))).value=t,e}function uA(t,e,n){for(var r,i,a=[[null,t,lA(t,e,n)]];a.length;){var[o,s,l]=a.shift();if(s)if(l){r=s,g=void 0,g=(i=l).type,i=rt(i,["type","children"]),r.type===g||void 0===g?r.value=it(r.value,i):"string"==typeof g&&(r.type=g,r.value=i);var c=l["children"],u=s["children"];if(Array.isArray(c)&&Array.isArray(u)){var f=Math.max(c.length,u.length);for(let t=0;t<f;t++){var h=c[t],d=u[t];a.push([s,d,h])}}}else s.remove();else{v=y=m=g=p=void 0;var p=o,g=l;if(p)for(var m=[[p,g]];m.length;){const[p,b]=m.shift();var y=cA(b),v=(Array.isArray(p.children)&&p.push(y),b)["children"];if(Array.isArray(v))for(const x of v)m.push([y,x])}}}}vo=[{name:"data",type:"value"},{name:"width",type:"value"},{name:"height",type:"value"},{name:"coordinate",type:"value"},{name:"interaction",type:"object"},{name:"theme",type:"object"},{name:"title",type:"value"},{name:"transform",type:"array"},{name:"scale",type:"object"},{name:"axis",type:"object"},{name:"legend",type:"object"},{name:"style",type:"object"},{name:"labelTransform",type:"array"},...f8(V8),...(as=nA,Object.entries(as).map(([t,e])=>({type:"container",name:t,ctor:e})))];m.Chart=class extends $8{constructor(t){var t=t||{},{container:e,canvas:n,renderer:r,plugins:i}=t;super(rt(t,["container","canvas","renderer","plugins"]),"view"),this._hasBindAutoFit=!1,this._rendering=!1,this._trailing=!1,this._trailingResolve=null,this._trailingReject=null,this._previousDefinedType=null,this._onResize=nn(()=>{this.forceFit()},300),this._renderer=r||new _.Renderer,this._plugins=i||[],this._container=void 0===(t=e)?document.createElement("div"):"string"==typeof t?document.getElementById(t):t,this._emitter=new Es,this._context={library:rA,emitter:this._emitter,canvas:n}}render(){if(this._rendering)return this._addToTrailing();this._context.canvas||this._createCanvas(),this._bindAutoFit(),this._rendering=!0;var t=new Promise((t,e)=>o8(this._computedOptions(),this._context,this._createResolve(t),this._createReject(e))),[e,n,r]=function(){let n,r;return[new Promise((t,e)=>{r=t,n=e}),r,n]}();return t.then(n).catch(r).then(()=>this._renderTrailing()),e}options(t){var e;return 0===arguments.length?sA(this):(e=t["type"],e&&(this._previousDefinedType=e),uA(this,t,this._previousDefinedType),this)}getContainer(){return this._container}getContext(){return this._context}on(t,e,n){return this._emitter.on(t,e,n),this}once(t,e){return this._emitter.once(t,e),this}emit(t,...e){return this._emitter.emit(t,...e),this}off(t,e){return this._emitter.off(t,e),this}clear(){this.options();this.emit($.BEFORE_CLEAR),this._reset(),s8(0,this._context,!1),this.emit($.AFTER_CLEAR)}destroy(){var t,e;this.options();this.emit($.BEFORE_DESTROY),this._unbindAutoFit(),this._reset(),s8(0,this._context,!0),t=this._container,(e=t.parentNode)&&e.removeChild(t),this.emit($.AFTER_DESTROY)}forceFit(){this.options.autoFit=!0;var{width:t,height:e}=oA(this.options(),this._container);if(t===this._width&&e===this._height)return Promise.resolve(this);this.emit($.BEFORE_CHANGE_SIZE);t=this.render();return t.then(()=>{this.emit($.AFTER_CHANGE_SIZE)}),t}changeSize(t,e){if(t===this._width&&e===this._height)return Promise.resolve(this);this.emit($.BEFORE_CHANGE_SIZE),this.width(t),this.height(e);t=this.render();return t.then(()=>{this.emit($.AFTER_CHANGE_SIZE)}),t}_reset(){this.type="view",this.value={},this.children=[]}_renderTrailing(){this._trailing&&(this._trailing=!1,this.render().then(()=>{var t=this._trailingResolve.bind(this);this._trailingResolve=null,t(this)}).catch(t=>{var e=this._trailingReject.bind(this);this._trailingReject=null,e(t)}))}_createResolve(t){return()=>{this._rendering=!1,t(this)}}_createReject(e){return t=>{this._rendering=!1,e(t)}}_computedOptions(){var t=this.options(),{key:e="G2_CHART_KEY"}=t,{width:n,height:r}=oA(t,this._container);return this._width=n,this._height=r,this._key=e,Object.assign(Object.assign({key:this._key},t),{width:n,height:r})}_createCanvas(){var{width:t,height:e}=oA(this.options(),this._container);this._plugins.push(new _s),this._plugins.forEach(t=>this._renderer.registerPlugin(t)),this._context.canvas=new nt.Canvas({container:this._container,width:t,height:e,renderer:this._renderer})}_addToTrailing(){null!=(t=this._trailingResolve)&&t.call(this,this),this._trailing=!0;var t=new Promise((t,e)=>{this._trailingResolve=t,this._trailingReject=e});return t}_bindAutoFit(){var t=this.options()["autoFit"];this._hasBindAutoFit?t||this._unbindAutoFit():t&&(this._hasBindAutoFit=!0,window.addEventListener("resize",this._onResize))}_unbindAutoFit(){this._hasBindAutoFit&&(this._hasBindAutoFit=!1,window.removeEventListener("resize",this._onResize))}},m.Chart=t([g(vo)],m.Chart),nt.runtime.enableCSSParsing=!1,m.AREA_CLASS_NAME=ht,m.COMPONENT_CLASS_NAME=ut,m.ChartEvent=$,m.CompositionNode=Y8,m.ELEMENT_CLASS_NAME=lt,m.LABEL_CLASS_NAME=ft,m.LABEL_LAYER_CLASS_NAME=st,m.MAIN_LAYER_CLASS_NAME=E,m.MarkNode=p8,m.PLOT_CLASS_NAME=ct,m.VIEW_CLASS_NAME=U,m.createLibrary=B6,m.register=function(t,e){Object.assign(rA,{[t]:e})},m.render=o8,m.renderToMountedElement=function(t,e={},n=()=>{},r=t=>{throw t}){var{width:i=640,height:a=480}=t,t=a8(t);const{library:o=B6(),group:s=new nt.Group,emitter:l=new Es}=e;null!==s&&void 0!==s&&s.parentElement||Wu("renderToMountedElement can't render chart to unmounted group.");var c=ot(s);return e.group=s,e.library=o,(e.emitter=l).emit($.BEFORE_RENDER),WS(Object.assign(Object.assign({},t),{width:i,height:a}),c,o,e).then(()=>{s.ownerDocument.defaultView.requestAnimationFrame(()=>{l.emit($.AFTER_RENDER),null!=n&&n()})}).catch(t=>{null!=r&&r(t)}),s},Object.defineProperty(m,"__esModule",{value:!0})});