@antv/g2 5.0.13 → 5.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/dist/g2-lite.min.js +3 -3
- package/dist/g2.min.js +3 -3
- package/esm/api/utils.js +2 -2
- package/esm/api/utils.js.map +1 -1
- package/esm/composition/facetRect.js +1 -1
- package/esm/composition/facetRect.js.map +1 -1
- package/esm/interaction/tooltip.d.ts +2 -2
- package/esm/interaction/tooltip.js +40 -30
- package/esm/interaction/tooltip.js.map +1 -1
- package/esm/mark/line.js +1 -1
- package/esm/mark/line.js.map +1 -1
- package/esm/mark/utils.js +3 -3
- package/esm/mark/utils.js.map +1 -1
- package/esm/runtime/component.d.ts +1 -1
- package/esm/runtime/component.js +24 -19
- package/esm/runtime/component.js.map +1 -1
- package/esm/runtime/layout.js +6 -4
- package/esm/runtime/layout.js.map +1 -1
- package/esm/shape/area/curve.js +1 -1
- package/esm/shape/area/curve.js.map +1 -1
- package/esm/shape/line/trail.js +4 -1
- package/esm/shape/line/trail.js.map +1 -1
- package/esm/spec/mark.d.ts +1 -0
- package/esm/transform/maybeGradient.js +3 -2
- package/esm/transform/maybeGradient.js.map +1 -1
- package/esm/utils/helper.d.ts +1 -0
- package/esm/utils/helper.js +15 -1
- package/esm/utils/helper.js.map +1 -1
- package/lib/api/utils.js +2 -2
- package/lib/api/utils.js.map +1 -1
- package/lib/composition/facetRect.js +1 -1
- package/lib/composition/facetRect.js.map +1 -1
- package/lib/interaction/tooltip.d.ts +2 -2
- package/lib/interaction/tooltip.js +40 -30
- package/lib/interaction/tooltip.js.map +1 -1
- package/lib/mark/line.js +1 -1
- package/lib/mark/line.js.map +1 -1
- package/lib/mark/utils.js +3 -3
- package/lib/mark/utils.js.map +1 -1
- package/lib/runtime/component.d.ts +1 -1
- package/lib/runtime/component.js +24 -19
- package/lib/runtime/component.js.map +1 -1
- package/lib/runtime/layout.js +5 -3
- package/lib/runtime/layout.js.map +1 -1
- package/lib/shape/area/curve.js +1 -1
- package/lib/shape/area/curve.js.map +1 -1
- package/lib/shape/line/trail.js +4 -1
- package/lib/shape/line/trail.js.map +1 -1
- package/lib/spec/mark.d.ts +1 -0
- package/lib/transform/maybeGradient.js +3 -2
- package/lib/transform/maybeGradient.js.map +1 -1
- package/lib/utils/helper.d.ts +1 -0
- package/lib/utils/helper.js +16 -1
- package/lib/utils/helper.js.map +1 -1
- package/package.json +1 -1
- package/src/api/utils.ts +2 -2
- package/src/composition/facetRect.ts +1 -1
- package/src/interaction/tooltip.ts +42 -28
- package/src/mark/line.ts +1 -1
- package/src/mark/utils.ts +3 -3
- package/src/runtime/component.ts +32 -27
- package/src/runtime/layout.ts +10 -7
- package/src/shape/area/curve.ts +1 -1
- package/src/shape/line/trail.ts +3 -1
- package/src/spec/mark.ts +1 -0
- package/src/transform/maybeGradient.ts +4 -3
- package/src/utils/helper.ts +24 -1
package/dist/g2.min.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).G2={})}(this,function(p){"use strict";var m="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};function S(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,h=e[n],f=r,d=i;for(j(e,r,n),0<a(e[i],h)&&j(e,r,i);f<d;){for(j(e,f,d),f++,d--;a(e[f],h)<0;)f++;for(;0<a(e[d],h);)d--}0===a(e[r],h)?j(e,r,d):j(e,++d,i),d<=n&&(r=d+1),n<=d&&(i=d-1)}}(t,e,n||0,r||t.length-1,i||I)}function j(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){D(t,0,t.children.length,e,t)}function D(t,e,n,r,i){(i=i||q(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];F(i,t.leaf?r(o):o)}return i}function F(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 H(t){return t.maxX-t.minX+(t.maxY-t.minY)}function Y(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 q(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function $(t,e,n,r,i){for(var a,o=[e,n];o.length;)(n=o.pop())-(e=o.pop())<=r||(S(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):Y(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||Y(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=q([]),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||!Y(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=q(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=q([])).leaf=!1,i.height=r;var s=Math.ceil(a/o),l=s*Math.ceil(Math.sqrt(o));$(t,e,n,l,this.compareMinX);for(var c=e;c<=n;c+=l){var u=Math.min(c+l-1,n);$(t,c,u,s,this.compareMinY);for(var h=c;h<=u;h+=s){var f=Math.min(h+s-1,u);i.children.push(this._build(t,h,f,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=(h=t,u=l,(Math.max(u.maxX,h.maxX)-Math.min(u.minX,h.minX))*(Math.max(u.maxY,h.maxY)-Math.min(u.minY,h.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 h,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),F(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=q(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=q([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=D(t,0,c,this.toBBox),h=D(t,c,n,this.toBBox),f=(i=u,f=h,d=o=a=void 0,a=Math.max(i.minX,f.minX),o=Math.max(i.minY,f.minY),d=Math.min(i.maxX,f.maxX),i=Math.min(i.maxY,f.maxY),Math.max(0,d-a)*Math.max(0,i-o)),d=G(u)+G(h);f<s?(s=f,r=c,l=d<l?d:l):f===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=D(t,0,e,i),o=D(t,n-e,n,i),s=H(a)+H(o),l=e;l<n-e;l++){var c=t.children[l];F(a,t.leaf?i(c):c),s+=H(a)}for(var u=n-e-1;e<=u;u--){var h=t.children[u];F(o,t.leaf?i(h):h),s+=H(o)}return s},e.prototype._adjustParentBBoxes=function(t,e,n){for(var r=n;0<=r;r--)F(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 U=e,X=1e-6,K="undefined"!=typeof Float32Array?Float32Array:Array;function Z(){var t=new K(9);return K!=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 Q=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],h=n[0],f=n[1],d=n[2],p=n[3],g=n[4],m=n[5],v=n[6],y=n[7],n=n[8];return t[0]=h*r+f*o+d*c,t[1]=h*i+f*s+d*u,t[2]=h*a+f*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]=v*r+y*o+n*c,t[7]=v*i+y*s+n*u,t[8]=v*a+y*l+n*e,t};function J(){var t=new K(16);return K!=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 tt(t){var e=new K(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}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 nt(t,e,n,r,i,a,o,s,l,c,u,h,f,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]=h,t[11]=f,t[12]=d,t[13]=p,t[14]=g,t[15]=m,t}function rt(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 lt(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 ct(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],h=e[9],f=e[10],d=e[11],p=e[12],g=e[13],m=e[14],e=e[15],v=n*s-r*o,y=n*l-i*o,b=n*c-a*o,x=r*l-i*s,w=r*c-a*s,M=i*c-a*l,k=u*g-h*p,E=u*m-f*p,O=u*e-d*p,S=h*m-f*g,A=h*e-d*g,_=f*e-d*m,T=v*_-y*A+b*S+x*O-w*E+M*k;return T?(t[0]=(s*_-l*A+c*S)*(T=1/T),t[1]=(i*A-r*_-a*S)*T,t[2]=(g*M-m*w+e*x)*T,t[3]=(f*w-h*M-d*x)*T,t[4]=(l*O-o*_-c*E)*T,t[5]=(n*_-i*O+a*E)*T,t[6]=(m*b-p*M-e*y)*T,t[7]=(u*M-f*b+d*y)*T,t[8]=(o*A-s*O+c*k)*T,t[9]=(r*O-n*A-a*k)*T,t[10]=(p*w-g*b+e*v)*T,t[11]=(h*b-u*w-d*v)*T,t[12]=(s*E-o*S-l*k)*T,t[13]=(n*S-r*E+i*k)*T,t[14]=(g*y-p*x-m*v)*T,t[15]=(u*x-h*y+f*v)*T,t):null}function ut(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],h=t[10],f=t[11],d=t[12],p=t[13],g=t[14],t=t[15];return(e*o-n*a)*(h*t-f*g)-(e*s-r*a)*(u*t-f*p)+(e*l-i*a)*(u*g-h*p)+(n*s-r*o)*(c*t-f*d)-(n*l-i*o)*(c*g-h*d)+(r*l-i*s)*(c*p-u*d)}function ht(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],h=e[8],f=e[9],d=e[10],p=e[11],g=e[12],m=e[13],v=e[14],e=e[15],y=n[0],b=n[1],x=n[2],w=n[3];return t[0]=y*r+b*s+x*h+w*g,t[1]=y*i+b*l+x*f+w*m,t[2]=y*a+b*c+x*d+w*v,t[3]=y*o+b*u+x*p+w*e,y=n[4],b=n[5],x=n[6],w=n[7],t[4]=y*r+b*s+x*h+w*g,t[5]=y*i+b*l+x*f+w*m,t[6]=y*a+b*c+x*d+w*v,t[7]=y*o+b*u+x*p+w*e,y=n[8],b=n[9],x=n[10],w=n[11],t[8]=y*r+b*s+x*h+w*g,t[9]=y*i+b*l+x*f+w*m,t[10]=y*a+b*c+x*d+w*v,t[11]=y*o+b*u+x*p+w*e,y=n[12],b=n[13],x=n[14],w=n[15],t[12]=y*r+b*s+x*h+w*g,t[13]=y*i+b*l+x*f+w*m,t[14]=y*a+b*c+x*d+w*v,t[15]=y*o+b*u+x*p+w*e,t}function ft(t,e,n){var r,i,a,o,s,l,c,u,h,f,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],h=e[8],f=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]=h,t[9]=f,t[10]=d,t[11]=p,t[12]=r*g+s*m+h*n+e[12],t[13]=i*g+l*m+f*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 dt(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 pt(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],h=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+h*r,t[8]=l*n-i*r,t[9]=c*n-a*r,t[10]=u*n-o*r,t[11]=h*n-s*r,t}function gt(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],h=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-h*r,t[8]=i*r+l*n,t[9]=a*r+c*n,t[10]=o*r+u*n,t[11]=s*r+h*n,t}function mt(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 vt(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}function yt(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,h=i*s,i=i*l,a=a*l,o=e*o,s=e*s,e=e*l;return t[0]=1-(h+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+h),t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t}function bt(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function xt(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 wt(t,e){var n=new K(3),r=(xt(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,h=0;return 0<n?(h=2*Math.sqrt(1+n),t[3]=.25*h,t[0]=(u-i)/h,t[1]=(r-s)/h,t[2]=(o-l)/h):c<a&&e<a?(h=2*Math.sqrt(1+a-c-e),t[3]=(u-i)/h,t[0]=.25*h,t[1]=(o+l)/h,t[2]=(r+s)/h):e<c?(h=2*Math.sqrt(1+c-a-e),t[3]=(r-s)/h,t[0]=(o+l)/h,t[1]=.25*h,t[2]=(u+i)/h):(h=2*Math.sqrt(1+e-a-c),t[3]=(o-l)/h,t[0]=(r+s)/h,t[1]=(u+i)/h,t[2]=.25*h),t}function Mt(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,h=a*l,f=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],v=(1-(d+s))*u,y=(f+e)*u,u=(a-c)*u,f=(f-e)*p,e=(1-(h+s))*p,s=(o+l)*p,p=(a+c)*r,a=(o-l)*r,c=(1-(h+d))*r;return t[0]=v,t[1]=y,t[2]=u,t[3]=0,t[4]=f,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-(v*g+f*m+p*i),t[13]=n[1]+m-(y*g+e*m+a*i),t[14]=n[2]+i-(u*g+s*m+c*i),t[15]=1,t}function kt(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 Et(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 Ot(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 St=Ot;function At(t,e,n,r){var i,a,o,s,l=e[0],c=e[1],e=e[2],u=r[0],h=r[1],r=r[2],f=n[0],d=n[1],n=n[2];return Math.abs(l-f)<X&&Math.abs(c-d)<X&&Math.abs(e-n)<X?rt(t):(f=l-f,d=c-d,n=e-n,i=h*(n*=s=1/Math.hypot(f,d,n))-r*(d*=s),r=r*(f*=s)-u*n,u=u*d-h*f,(s=Math.hypot(i,r,u))?(i*=s=1/s,r*=s,u*=s):u=r=i=0,h=d*u-n*r,a=n*i-f*u,o=f*r-d*i,(s=Math.hypot(h,a,o))?(h*=s=1/s,a*=s,o*=s):o=a=h=0,t[0]=i,t[1]=h,t[2]=f,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]=-(h*l+a*c+o*e),t[14]=-(f*l+d*c+n*e),t[15]=1,t)}function _t(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 Tt=Object.freeze({__proto__:null,create:J,clone:tt,copy:et,fromValues:function(t,e,n,r,i,a,o,s,l,c,u,h,f,d,p,g){var m=new K(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]=h,m[12]=f,m[13]=d,m[14]=p,m[15]=g,m},set:nt,identity:rt,transpose:lt,invert:ct,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],h=e[9],f=e[10],d=e[11],p=e[12],g=e[13],m=e[14],e=e[15];return t[0]=s*(f*e-d*m)-h*(l*e-c*m)+g*(l*d-c*f),t[1]=-(r*(f*e-d*m)-h*(i*e-a*m)+g*(i*d-a*f)),t[2]=r*(l*e-c*m)-s*(i*e-a*m)+g*(i*c-a*l),t[3]=-(r*(l*d-c*f)-s*(i*d-a*f)+h*(i*c-a*l)),t[4]=-(o*(f*e-d*m)-u*(l*e-c*m)+p*(l*d-c*f)),t[5]=n*(f*e-d*m)-u*(i*e-a*m)+p*(i*d-a*f),t[6]=-(n*(l*e-c*m)-o*(i*e-a*m)+p*(i*c-a*l)),t[7]=n*(l*d-c*f)-o*(i*d-a*f)+u*(i*c-a*l),t[8]=o*(h*e-d*g)-u*(s*e-c*g)+p*(s*d-c*h),t[9]=-(n*(h*e-d*g)-u*(r*e-a*g)+p*(r*d-a*h)),t[10]=n*(s*e-c*g)-o*(r*e-a*g)+p*(r*c-a*s),t[11]=-(n*(s*d-c*h)-o*(r*d-a*h)+u*(r*c-a*s)),t[12]=-(o*(h*m-f*g)-u*(s*m-l*g)+p*(s*f-l*h)),t[13]=n*(h*m-f*g)-u*(r*m-i*g)+p*(r*f-i*h),t[14]=-(n*(s*m-l*g)-o*(r*m-i*g)+p*(r*l-i*s)),t[15]=n*(s*f-l*h)-o*(r*f-i*h)+u*(r*l-i*s),t},determinant:ut,multiply:ht,translate:ft,scale:dt,rotate:function(t,e,n,r){var i,a,o,s,l,c,u,h,f,d,p,g,m,v,y,b,x,w,M,k,E=r[0],O=r[1],r=r[2],S=Math.hypot(E,O,r);return S<X?null:(E*=S=1/S,O*=S,r*=S,S=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],h=e[6],f=e[7],d=e[8],p=e[9],g=e[10],m=e[11],y=E*O*(i=1-n)-r*S,b=O*O*i+n,x=r*O*i+E*S,w=E*r*i+O*S,M=O*r*i-E*S,k=r*r*i+n,t[0]=a*(n=E*E*i+n)+c*(v=O*E*i+r*S)+d*(r=r*E*i-O*S),t[1]=o*n+u*v+p*r,t[2]=s*n+h*v+g*r,t[3]=l*n+f*v+m*r,t[4]=a*y+c*b+d*x,t[5]=o*y+u*b+p*x,t[6]=s*y+h*b+g*x,t[7]=l*y+f*b+m*x,t[8]=a*w+c*M+d*k,t[9]=o*w+u*M+p*k,t[10]=s*w+h*M+g*k,t[11]=l*w+f*M+m*k,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)},rotateX:pt,rotateY:gt,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],h=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+h*r,t[4]=l*n-i*r,t[5]=c*n-a*r,t[6]=u*n-o*r,t[7]=h*n-s*r,t},fromTranslation:mt,fromScaling:vt,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:yt,fromQuat2:function(t,e){var n=new K(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],h=r*r+i*i+a*a+o*o;return 0<h?(n[0]=2*(s*o+u*r+l*a-c*i)/h,n[1]=2*(l*o+u*i+c*r-s*a)/h,n[2]=2*(c*o+u*a+s*i-l*r)/h):(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)),yt(t,e,n),t},getTranslation:bt,getScaling:xt,getRotation:wt,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*(h=a+a),i=i*(f=o+o),c=a*h,a=a*f,o=o*f,u=e*u,h=e*h,e=e*f,f=r[0],d=r[1],r=r[2];return t[0]=(1-(c+o))*f,t[1]=(l+e)*f,t[2]=(i-h)*f,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+h)*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:Mt,fromQuat:kt,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:Et,perspective:Et,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:Ot,ortho:St,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:At,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,h=(0<u&&(l*=u=1/Math.sqrt(u),c*=u,n*=u),s*n-r*c);return 0<(u=h*h+(r=r*l-o*n)*r+(o=o*c-s*l)*o)&&(h*=u=1/Math.sqrt(u),r*=u,o*=u),t[0]=h,t[1]=r,t[2]=o,t[3]=0,t[4]=c*o-n*r,t[5]=n*h-l*o,t[6]=l*r-c*h,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:_t,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],h=t[9],f=t[10],d=t[11],p=t[12],g=t[13],m=t[14],t=t[15],v=e[0],y=e[1],b=e[2],x=e[3],w=e[4],M=e[5],k=e[6],E=e[7],O=e[8],S=e[9],A=e[10],_=e[11],T=e[12],P=e[13],L=e[14],e=e[15];return Math.abs(n-v)<=X*Math.max(1,Math.abs(n),Math.abs(v))&&Math.abs(r-y)<=X*Math.max(1,Math.abs(r),Math.abs(y))&&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-k)<=X*Math.max(1,Math.abs(l),Math.abs(k))&&Math.abs(c-E)<=X*Math.max(1,Math.abs(c),Math.abs(E))&&Math.abs(u-O)<=X*Math.max(1,Math.abs(u),Math.abs(O))&&Math.abs(h-S)<=X*Math.max(1,Math.abs(h),Math.abs(S))&&Math.abs(f-A)<=X*Math.max(1,Math.abs(f),Math.abs(A))&&Math.abs(d-_)<=X*Math.max(1,Math.abs(d),Math.abs(_))&&Math.abs(p-T)<=X*Math.max(1,Math.abs(p),Math.abs(T))&&Math.abs(g-P)<=X*Math.max(1,Math.abs(g),Math.abs(P))&&Math.abs(m-L)<=X*Math.max(1,Math.abs(m),Math.abs(L))&&Math.abs(t-e)<=X*Math.max(1,Math.abs(t),Math.abs(e))},mul:ht,sub:_t});function v(){var t=new K(3);return K!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function Pt(t){var e=new K(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function Lt(t){var e=t[0],n=t[1],t=t[2];return Math.hypot(e,n,t)}function Ct(t,e,n){var r=new K(3);return r[0]=t,r[1]=e,r[2]=n,r}function Nt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function jt(t,e,n,r){return t[0]=e,t[1]=n,t[2]=r,t}function Rt(t,e,n){t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2]}function It(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function Bt(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}function Dt(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 Ft(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function zt(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 Wt(t,e,n,r){var i=e[0],a=e[1],e=e[2];t[0]=i+r*(n[0]-i),t[1]=a+r*(n[1]-a),t[2]=e+r*(n[2]-e)}function Gt(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 Ht(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 Yt(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 Vt=function(t,e){var n=e[0]-t[0],r=e[1]-t[1],e=e[2]-t[2];return Math.hypot(n,r,e)},qt=Lt;function $t(){var t=new K(4);return K!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function Ut(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 Xt(){var t=new K(4);return K!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function Kt(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 Zt(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 Qt(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 Jt(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}v(),$t();var te=function(t,e,n,r){var i=new K(4);return i[0]=t,i[1]=e,i[2]=n,i[3]=r,i},ee=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},ne=Zt,re=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 ie(t,e){var n=e[0],r=e[1],n=n*n+r*r;0<n&&(n=1/Math.sqrt(n)),t[0]=e[0]*n,t[1]=e[1]*n}function ae(t,e){return t[0]*e[0]+t[1]*e[1]}function oe(t,e){return t[0]===e[0]&&t[1]===e[1]}function se(t){return t.map(function(t){return Array.isArray(t)?[].concat(t):t})}v(),Ct(1,0,0),Ct(0,1,0),Xt(),Xt(),Z(),e=new K(2),K!=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 it(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 he(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 k(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 b(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 fe(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 ve(t){return me(t)&&t.every(function(t){t=t[0];return"ACLMQZ".includes(t)})}function ye(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 h=u;0<h;--h){if(97!=(32|c)||3!==h&&4!==h?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}ye(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 ke(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 Ee(t){if(ve(t))return se(t);for(var e,n,r,i,a,o,s,l=ke(t),c=y({},de),u=0;u<l.length;u+=1){l[u]=(e=l[u],n=c,s=o=f=a=h=i=r=void 0,r=e[0],i=n.x1,h=n.y1,a=n.x2,f=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],h]:"V"===r?s=["L",i,e[1]]:"S"===r?(e=2*h-f,s=["C",n.x1=2*i-a,n.y1=e].concat(o)):"T"===r?(f=2*i-n.qx,a=2*h-n.qy,s=["Q",n.qx=f,n.qy=a].concat(o)):"Q"===r&&(e=o[0],i=o[1],n.qx=e,n.qy=i),s);var h=l[u],f=h.length;c.x1=+h[f-2],c.y1=+h[f-1],c.x2=+h[f-4]||c.x1,c.y2=+h[f-3]||c.y1}return l}function Oe(t,e,n){return{x:t*Math.cos(n)-e*Math.sin(n),y:t*Math.sin(n)+e*Math.cos(n)}}function Se(t,e,n,r,i,a,o,s,l,c){var u=120*Math.PI/180,h=Math.PI/180*(+i||0),f=[],d=(c?(b=c[0],x=c[1],v=c[2],y=c[3]):(t=(g=Oe(t,e,-h)).x,e=g.y,1<(d=(p=(t-(s=(g=Oe(s,l,-h)).x))/2)*p/(n*n)+(g=(e-(l=g.y))/2)*g/(r*r))&&(n*=d=Math.sqrt(d),r*=d),d=n*n,m=r*r,v=(a=(a===o?-1:1)*Math.sqrt(Math.abs((d*m-d*g*g-m*p*p)/(d*g*g+m*p*p))))*n*g/r+(t+s)/2,y=a*-r*p/n+(e+l)/2,b=Math.asin(((e-y)/r*Math.pow(10,9)>>0)/Math.pow(10,9)),x=Math.asin(((l-y)/r*Math.pow(10,9)>>0)/Math.pow(10,9)),b=t<v?Math.PI-b:b,x=s<v?Math.PI-x:x,b<0&&(b=2*Math.PI+b),x<0&&(x=2*Math.PI+x),o&&x<b&&(b-=2*Math.PI),!o&&b<x&&(x-=2*Math.PI)),x-b),p=(Math.abs(d)>u&&(m=x,g=s,a=l,x=b+u*(o&&b<x?1:-1),f=Se(s=v+n*Math.cos(x),l=y+r*Math.sin(x),n,r,i,0,o,g,a,[x,m,v,y])),d=x-b,Math.cos(b)),u=Math.sin(b),i=Math.cos(x),o=Math.sin(x),g=Math.tan(d/4),a=4/3*n*g,m=4/3*r*g,v=[t,e],y=[t+a*u,e-m*p],b=[s+a*o,l-m*i],x=[s,l];if(y[0]=2*v[0]-y[0],y[1]=2*v[1]-y[1],c)return y.concat(b,x,f);for(var w=[],M=0,k=(f=y.concat(b,x,f)).length;M<k;M+=1)w[M]=M%2?Oe(f[M-1],f[M],h).y:Oe(f[M],f[M+1],h).x;return w}function Ae(t,e,n){var r=t[0],t=t[1];return[r+(e[0]-r)*n,t+(e[1]-t)*n]}function _e(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}function Te(t,e,n,r,i){var a=_e([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=Ae([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 Pe(t,e,n,r){var t=[t,e],e=[n,r],i=Ae(t,e,.5),e=Ae(e,i,.5),a=Ae(i,e,.5),o=Ae(e,a,.5),s=Ae(a,o,.5),t=Te(t[0],t[1],i[0],i[1],a[0]).point,i=Te(s[0],s[1],o[0],o[1],e[0]).point;return[t.x,t.y,i.x,i.y,n,r]}function Le(t,e){var n;if(void 0===e&&(e=!1),ve(n=t)&&n.every(function(t){t=t[0];return"MC".includes(t)}))return n=se(t),e?[n,[]]:n;for(var r,i=Ee(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 h=function(t,e){var n,r,i,a,o,s,l=t[0],c=t.slice(1).map(Number),u=c[0],h=c[1],f=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=h,t;case"A":return s=[f,d].concat(c),["C"].concat(Se(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=h,s=[f,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(Pe(f,d,u,h));case"Z":return f===p&&d===g?["C",f,d,p,g,p,g]:["C"].concat(Pe(f,d,p,g))}return t}(i[u],a),f=(i[u]=h,m=g=p=d=f=void 0,i),d=o,p=u;if(7<f[p].length){f[p].shift();for(var g=f[p],m=p;g.length;)d[p]="A",f.splice(m+=1,0,["C"].concat(g.splice(0,6)));f.splice(p,1)}l=i.length,"Z"===s&&c.push(u),r=(h=i[u]).length,a.x1=+h[r-2],a.y1=+h[r-1],a.x2=+h[r-4]||a.x1,a.y2=+h[r-3]||a.y1}return e?[i,c]:i}function Ce(t,e){var n=t.x,t=t.y,r=e.x,e=e.y,i=n*r+t*e,a=Math.sqrt((Math.pow(n,2)+Math.pow(t,2))*(Math.pow(r,2)+Math.pow(e,2)));return(n*e-t*r<0?-1:1)*Math.acos(i/a)}function Ne(t,e,n,r,i,I,B,a,o,s,l){var c=l.bbox,D=void 0===c||c,c=l.length,F=void 0===c||c,c=l.sampleSize,u=void 0===c?30:c,h="number"==typeof s,f=t,d=e,p=0,g=[f,d,p],m=[f,d],v={x:0,y:0},y=[{x:f,y:d}];h&&s<=0&&(v={x:f,y:d});for(var b,x,w,M,k,E,O,S,A,_,T,P,L,C,N,j,R=0;R<=u;R+=1)b=t,x=e,w=n,M=r,k=i,E=I,O=B,S=a,A=o,_=R/u,P=j=N=C=L=P=T=void 0,P=Math.abs,L=Math.sin,C=Math.cos,N=Math.sqrt,j=Math.PI,w=P(w),P=P(M),M=j/180*((k%360+360)%360),f=(T=b===S&&x===A?{x:b,y:x}:0===w||0===P?Te(b,x,S,A,_).point:(k=(b-S)/2,T=(x-A)/2,k={x:C(M)*k+L(M)*T,y:-L(M)*k+C(M)*T},1<(T=Math.pow(k.x,2)/Math.pow(w,2)+Math.pow(k.y,2)/Math.pow(P,2))&&(w*=N(T),P*=N(T)),T=(Math.pow(w,2)*Math.pow(P,2)-Math.pow(w,2)*Math.pow(k.y,2)-Math.pow(P,2)*Math.pow(k.x,2))/(Math.pow(w,2)*Math.pow(k.y,2)+Math.pow(P,2)*Math.pow(k.x,2)),E=(E!==O?1:-1)*N(T<0?0:T),N=w*k.y/P*E,T=-P*k.x/w*E,E=C(M)*N-L(M)*T+(b+S)/2,b=L(M)*N+C(M)*T+(x+A)/2,x=Ce({x:1,y:0},S={x:(k.x-N)/w,y:(k.y-T)/P}),A=Ce(S,{x:(-k.x-N)/w,y:(-k.y-T)/P}),!O&&0<A?A-=2*j:O&&A<0&&(A+=2*j),S=x+(A%=2*j)*_,N=w*C(S),k=P*L(S),{x:C(M)*N-L(M)*k+E,y:L(M)*N+C(M)*k+b})).x,d=T.y,D&&y.push({x:f,y:d}),F&&(p+=_e(m,[f,d])),m=[f,d],h&&s<=p&&s>g[2]&&(O=(p-s)/(p-g[2]),v={x:m[0]*(1-O)+g[0]*O,y:m[1]*(1-O)+g[1]*O}),g=[f,d,p];return{length:p,point:v=h&&p<=s?{x:a,y:o}:v,min:{x:Math.min.apply(null,y.map(function(t){return t.x})),y:Math.min.apply(null,y.map(function(t){return t.y}))},max:{x:Math.max.apply(null,y.map(function(t){return t.x})),y:Math.max.apply(null,y.map(function(t){return t.y}))}}}function je(t,e,n,r,i,a,o,s,l,c){var u=c.bbox,h=void 0===u||u,u=c.length,f=void 0===u||u,u=c.sampleSize,d=void 0===u?10:u,p="number"==typeof l,g=t,m=e,v=0,y=[g,m,v],b=[g,m],x={x:0,y:0},w=[{x:g,y:m}];p&&l<=0&&(x={x:g,y:m});for(var M,k,E,O,S,A,_,T,P,L,C=0;C<=d;C+=1)M=t,k=e,E=n,O=r,S=i,A=a,_=o,T=s,L=void 0,L=1-(P=C/d),g=(M={x:Math.pow(L,3)*M+3*Math.pow(L,2)*P*E+3*L*Math.pow(P,2)*S+Math.pow(P,3)*_,y:Math.pow(L,3)*k+3*Math.pow(L,2)*P*O+3*L*Math.pow(P,2)*A+Math.pow(P,3)*T}).x,m=M.y,h&&w.push({x:g,y:m}),f&&(v+=_e(b,[g,m])),b=[g,m],p&&l<=v&&l>y[2]&&(E=(v-l)/(v-y[2]),x={x:b[0]*(1-E)+y[0]*E,y:b[1]*(1-E)+y[1]*E}),y=[g,m,v];return{length:v,point:x=p&&v<=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 Re(t,e,n,r,i,a,o,s){var l=s.bbox,c=void 0===l||l,l=s.length,u=void 0===l||l,l=s.sampleSize,h=void 0===l?10:l,f="number"==typeof o,d=t,p=e,g=0,m=[d,p,g],v=[d,p],y={x:0,y:0},b=[{x:d,y:p}];f&&o<=0&&(y={x:d,y:p});for(var x,w,M,k,E,O,S,A,_=0;_<=h;_+=1)x=t,w=e,M=n,k=r,E=i,O=a,A=void 0,A=1-(S=_/h),d=(x={x:Math.pow(A,2)*x+2*A*S*M+Math.pow(S,2)*E,y:Math.pow(A,2)*w+2*A*S*k+Math.pow(S,2)*O}).x,p=x.y,c&&b.push({x:d,y:p}),u&&(g+=_e(v,[d,p])),v=[d,p],f&&o<=g&&o>m[2]&&(M=(g-o)/(g-m[2]),y={x:v[0]*(1-M)+m[0]*M,y:v[1]*(1-M)+m[1]*M}),m=[d,p,g];return{length:g,point:y=f&&g<=o?{x:i,y:a}:y,min:{x:Math.min.apply(null,b.map(function(t){return t.x})),y:Math.min.apply(null,b.map(function(t){return t.y}))},max:{x:Math.max.apply(null,b.map(function(t){return t.x})),y:Math.max.apply(null,b.map(function(t){return t.y}))}}}function Ie(t,e,n){for(var r,i,a,o=Ee(t),s="number"==typeof e,l=[],c=0,u=0,h=0,f=0,d=[],p=[],g=0,m={x:0,y:0},v=m,y=m,b=m,x=0,w=0,M=o.length;w<M;w+=1)l=(r="M"===(i=(a=o[w])[0]))?l:[c,u].concat(a.slice(1)),r?(v=m={x:h=a[1],y:f=a[2]},g=0,s&&e<.001&&(b=m)):"L"===i?(g=(r=Te(l[0],l[1],l[2],l[3],(e||0)-x)).length,m=r.min,v=r.max,y=r.point):"A"===i?(g=(r=Ne(l[0],l[1],l[2],l[3],l[4],l[5],l[6],l[7],l[8],(e||0)-x,n||{})).length,m=r.min,v=r.max,y=r.point):"C"===i?(g=(r=je(l[0],l[1],l[2],l[3],l[4],l[5],l[6],l[7],(e||0)-x,n||{})).length,m=r.min,v=r.max,y=r.point):"Q"===i?(g=(r=Re(l[0],l[1],l[2],l[3],l[4],l[5],(e||0)-x,n||{})).length,m=r.min,v=r.max,y=r.point):"Z"===i&&(g=(r=Te((l=[c,u,h,f])[0],l[1],l[2],l[3],(e||0)-x)).length,m=r.min,v=r.max,y=r.point),s&&x<e&&e<=x+g&&(b=y),p.push(v),d.push(m),x+=g,c=(r="Z"!==i?a.slice(-2):[h,f])[0],u=r[1];return{length:x,point:b=s&&x<=e?{x:c,y:u}:b,min:{x:Math.min.apply(null,d.map(function(t){return t.x})),y:Math.min.apply(null,d.map(function(t){return t.y}))},max:{x:Math.max.apply(null,p.map(function(t){return t.x})),y:Math.max.apply(null,p.map(function(t){return t.y}))}}}function Be(t){return(c=l=s=0)<=Le(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 De(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?je(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=Ae(n,i,r),i=Ae(i,a,r),a=Ae(a,e,r),o=Ae(n,i,r),i=Ae(i,a,r),r=Ae(o,i,r),[["C"].concat(n,o,r),["C"].concat(i,a,e)]):[t,t]:[t];return{s:t,ss:n,l:s}})}var Fe=function(t){return null!==t&&"function"!=typeof t&&isFinite(t.length)},ze=function(t){return"function"==typeof t},A=function(t){return null==t},We={}.toString,Ge=function(t,e){return We.call(t)==="[object "+e+"]"},He=function(t){return Array.isArray?Array.isArray(t):Ge(t,"Array")},Ye=function(t){var e=typeof t;return null!==t&&"object"==e||"function"==e};var Ve=function(t){return"object"==typeof t&&null!==t},qe=function(t){if(!Ve(t)||!Ge(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},$e=function(t){if(He(t))return t.reduce(function(t,e){return Math.max(t,e)},t[0])},Ue=function(t){if(He(t))return t.reduce(function(t,e){return Math.min(t,e)},t[0])},Xe=function(t,n,e){if(!He(t)&&!qe(t))return t;var r=e,i=t,a=function(t,e){r=n(r,t,e)};if(i)if(He(i))for(var o=0,s=i.length;o<s&&!1!==a(i[o],o);o++);else if(Ye(i))for(var l in i)if(i.hasOwnProperty(l)&&!1===a(i[l],l))break;return r},Ke=function(t){return Ge(t,"String")};var Ze=function(t,e,n){return t<e?e:n<t?n:t},Qe=function(t){return Ge(t,"Number")};function Je(t){return A(t)?"":t.toString()}var tn=function(t,e){return(t%e+e)%e},en=function(t){t=Je(t);return t.charAt(0).toLowerCase()+t.substring(1)};function nn(t){if("object"!=typeof t||null===t)return t;if(He(t))for(var e=[],n=0,r=t.length;n<r;n++)"object"==typeof t[n]&&null!=t[n]?e[n]=nn(t[n]):e[n]=t[n];else for(var i in e={},t)"object"==typeof t[i]&&null!=t[i]?e[i]=nn(t[i]):e[i]=t[i];return e}var rn=function(t){t=Je(t);return t.charAt(0).toUpperCase()+t.substring(1)},an=function(t){return Ge(t,"Boolean")},on=function(t){return void 0===t},sn=nn;function ln(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 cn(a,o){var s;if(ze(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 un=5;function hn(t,e){if(t===e)return!0;if(t&&e&&!Ke(t)&&!Ke(e)){if(Fe(t)||Fe(e)){if(t.length!==e.length)return!1;for(var n=!0,r=0;r<t.length&&(n=hn(t[r],e[r]));r++);return n}if(Ve(t)||Ve(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=hn(t[i[r]],e[i[r]]));r++);return n}}return!1}function fn(t,r){return Xe(t,function(t,e,n){return r.includes(n)||(t[n]=e),t},{})}function dn(){}var ot=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||un,n){var o;n.hasOwnProperty(a)&&(null!==(o=n[a])&&qe(o)?(qe(e[a])||(e[a]={}),r<i?t(e[a],o,r+1,i):e[a]=n[a]):He(o)?(e[a]=[],e[a]=e[a].concat(o)):void 0!==o&&(e[a]=o))}}(t,e[r]);return t},pn=hn,gn=function(t,e,n){for(var r=0,i=Ke(e)?e.split("."):e;t&&r<i.length;)t=t[i[r++]];return void 0===t||r<i.length?n:t},mn=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 vn(t,e,n){(t.prototype=e.prototype=n).constructor=t}function yn(t,e){var n,r=Object.create(t.prototype);for(n in e)r[n]=e[n];return r}function bn(){}var e="\\s*([+-]?\\d+)\\s*",n="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",r="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",xn=/^#([0-9a-f]{3,8})$/,wn=new RegExp("^rgb\\("+[e,e,e]+"\\)$"),Mn=new RegExp("^rgb\\("+[r,r,r]+"\\)$"),kn=new RegExp("^rgba\\("+[e,e,e,n]+"\\)$"),En=new RegExp("^rgba\\("+[r,r,r,n]+"\\)$"),On=new RegExp("^hsl\\("+[n,r,r]+"\\)$"),Sn=new RegExp("^hsla\\("+[n,r,r,n]+"\\)$"),An={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 Tn(){return this.rgb().formatRgb()}function Pn(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=xn.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?Ln(e):3===n?new Nn(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?Cn(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?Cn(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=wn.exec(t))?new Nn(e[1],e[2],e[3],1):(e=Mn.exec(t))?new Nn(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=kn.exec(t))?Cn(e[1],e[2],e[3],e[4]):(e=En.exec(t))?Cn(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=On.exec(t))?Bn(e[1],e[2]/100,e[3]/100,1):(e=Sn.exec(t))?Bn(e[1],e[2]/100,e[3]/100,e[4]):An.hasOwnProperty(t)?Ln(An[t]):"transparent"===t?new Nn(NaN,NaN,NaN,0):null}function Ln(t){return new Nn(t>>16&255,t>>8&255,255&t,1)}function Cn(t,e,n,r){return new Nn(t=r<=0?e=n=NaN:t,e,n,r)}function Nn(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function jn(){return"#"+In(this.r)+In(this.g)+In(this.b)}function Rn(){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 In(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function Bn(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||1<=n?t=e=NaN:e<=0&&(t=NaN),new Fn(t,e,n,r)}function Dn(t){var e,n,r,i,a,o,s,l;return t instanceof Fn?new Fn(t.h,t.s,t.l,t.opacity):(t=t instanceof bn?t:Pn(t))?t instanceof Fn?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 Fn(o,s,l,t.opacity)):new Fn}function Fn(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function zn(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 Wn(t,e,n,r){t-=n,n=e-r;return Math.sqrt(t*t+n*n)}function Gn(t,e){return Math.abs(t-e)<.001}function Hn(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 Yn(t){return(t+2*Math.PI)%(2*Math.PI)}vn(bn,Pn,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:_n,formatHex:_n,formatHsl:function(){return Dn(this).formatHsl()},formatRgb:Tn,toString:Tn}),vn(Nn,function(t,e,n,r){return 1===arguments.length?(i=(i=t)instanceof bn?i:Pn(i))?new Nn((i=i.rgb()).r,i.g,i.b,i.opacity):new Nn:new Nn(t,e,n,null==r?1:r);var i},yn(bn,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new Nn(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new Nn(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:jn,formatHex:jn,formatRgb:Rn,toString:Rn})),vn(Fn,function(t,e,n,r){return 1===arguments.length?Dn(t):new Fn(t,e,n,null==r?1:r)},yn(bn,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new Fn(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new Fn(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 Nn(zn(240<=t?t-240:120+t,n,e),zn(t,n,e),zn(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 Vn={box:function(t,e,n,r){return Hn([t,n],[e,r])},length:Wn,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?Wn(t,e,i,a):(n-t)*(n-t)+(r-e)*(r-e)<o?Wn(n,r,i,a):this.pointToLine(t,e,n,r,i,a)},pointToLine:function(t,e,n,r,i,a){n=[n-t,r-e];return oe(n,[0,0])?Math.sqrt((i-t)*(i-t)+(a-e)*(a-e)):(ie(r=[-n[1],n[0]],r),Math.abs(ae([i-t,a-e],r)))},tangentAngle:function(t,e,n,r){return Math.atan2(r-e,n-t)}};function qn(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),h=u/10,f=0;f<=c;f++){var d=f*u,p=[i.apply(void 0,t.concat([d])),i.apply(void 0,e.concat([d]))],p=Wn(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&&!(h<1e-4);g++){var m=o-h,v=o+h,y=[i.apply(void 0,t.concat([m])),i.apply(void 0,e.concat([m]))],y=Wn(l[0],l[1],y[0],y[1]);0<=m&&y<s?(o=m,s=y):(m=[i.apply(void 0,t.concat([v])),i.apply(void 0,e.concat([v]))],y=Wn(l[0],l[1],m[0],m[1]),v<=1&&y<s?(o=v,s=y):h*=.5)}return{x:i.apply(void 0,t.concat([o])),y:i.apply(void 0,e.concat([o]))}}function $n(t,e,n,r){var i=1-r;return i*i*t+2*r*i*e+r*r*n}function Un(t,e,n){n=t+n-2*e;return Gn(n,0)?[.5]:(t=(t-e)/n)<=1&&0<=t?[t]:[]}function Xn(t,e,n,r){return 2*(1-r)*(e-t)+2*r*(n-e)}function Kn(t,e,n,r,i,a,o){var s=$n(t,n,i,o),l=$n(e,r,a,o),c=Vn.pointAt(t,e,n,r,o),n=Vn.pointAt(n,r,i,a,o);return[[t,e,c.x,c.y,s,l],[s,l,n.x,n.y,i,a]]}function Zn(t,e,n,r,i,a,o){return 0===o?(Wn(t,e,n,r)+Wn(n,r,i,a)+Wn(t,e,i,a))/2:(e=(t=Kn(t,e,n,r,i,a,.5))[0],n=t[1],e.push(o-1),n.push(o-1),Zn.apply(void 0,e)+Zn.apply(void 0,n))}var Qn={box:function(t,e,n,r,i,a){var o=Un(t,n,i)[0],s=Un(e,r,a)[0],l=[t,i],c=[e,a];return void 0!==o&&l.push($n(t,n,i,o)),void 0!==s&&c.push($n(e,r,a,s)),Hn(l,c)},length:function(t,e,n,r,i,a){return Zn(t,e,n,r,i,a,3)},nearestPoint:function(t,e,n,r,i,a,o,s){return qn([t,n,i],[e,r,a],o,s,$n)},pointDistance:function(t,e,n,r,i,a,o,s){t=this.nearestPoint(t,e,n,r,i,a,o,s);return Wn(t.x,t.y,o,s)},interpolationAt:$n,pointAt:function(t,e,n,r,i,a,o){return{x:$n(t,n,i,o),y:$n(e,r,a,o)}},divide:Kn,tangentAngle:function(t,e,n,r,i,a,o){t=Xn(t,n,i,o),n=Xn(e,r,a,o);return Yn(Math.atan2(n,t))}};function Jn(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 tr(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 er(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 Gn(r,0)?Gn(n,0)||0<=(i=-e/n)&&i<=1&&t.push(i):Gn(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 nr(t,e,n,r,i,a,o,s,l){var c=Jn(t,n,i,o,l),u=Jn(e,r,a,s,l),h=Vn.pointAt(t,e,n,r,l),n=Vn.pointAt(n,r,i,a,l),r=Vn.pointAt(i,a,o,s,l),i=Vn.pointAt(h.x,h.y,n.x,n.y,l),a=Vn.pointAt(n.x,n.y,r.x,r.y,l);return[[t,e,h.x,h.y,i.x,i.y,c,u],[c,u,a.x,a.y,r.x,r.y,o,s]]}function rr(t,e,n,r,i,a,o,s,l){if(0===l){for(var c=[t,n,i,o],u=[e,r,a,s],h=0,f=c.length,d=0;d<f;d++)h+=Wn(c[d],u[d],c[(d+1)%f],u[(d+1)%f]);return h/2}t=nr(t,e,n,r,i,a,o,s,.5),e=[].concat(t[0],[l-1]),n=[].concat(t[1],[l-1]);return rr.apply(void 0,e)+rr.apply(void 0,n)}var ir={extrema:er,box:function(t,e,n,r,i,a,o,s){for(var l=[t,o],c=[e,s],u=er(t,n,i,o),h=er(e,r,a,s),f=0;f<u.length;f++)l.push(Jn(t,n,i,o,u[f]));for(var d=0;d<h.length;d++)c.push(Jn(e,r,a,s,h[d]));return Hn(l,c)},length:function(t,e,n,r,i,a,o,s){return rr(t,e,n,r,i,a,o,s,3)},nearestPoint:function(t,e,n,r,i,a,o,s,l,c,u){return qn([t,n,i,o],[e,r,a,s],l,c,Jn,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 Wn(t.x,t.y,l,c)},interpolationAt:Jn,pointAt:function(t,e,n,r,i,a,o,s,l){return{x:Jn(t,n,i,o,l),y:Jn(e,r,a,s,l)}},divide:nr,tangentAngle:function(t,e,n,r,i,a,o,s,l){t=tr(t,n,i,o,l),n=tr(e,r,a,s,l);return Yn(Math.atan2(n,t))}};function ar(t,e){t=Math.abs(t);return 0<e?t:-1*t}var or=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,h=s*s,f=Math.PI/4,d=0,p=0,g=0;g<4;g++){var d=o*Math.cos(f),p=s*Math.sin(f),m=(u-h)*Math.pow(Math.cos(f),3)/o,v=(h-u)*Math.pow(Math.sin(f),3)/s,y=d-m,b=p-v,m=l-m,v=c-v,x=Math.hypot(b,y),w=Math.hypot(v,m);f+=x*Math.asin((y*v-b*m)/(x*w))/Math.sqrt(u+h-d*d-p*p),f=Math.min(Math.PI/2,Math.max(0,f))}return{x:t+ar(d,n),y:e+ar(p,r)}};function sr(t,e,n,r,i,a){return n*Math.cos(i)*Math.cos(a)-r*Math.sin(i)*Math.sin(a)+t}function lr(t,e,n,r,i,a){return n*Math.sin(i)*Math.cos(a)+r*Math.cos(i)*Math.sin(a)+e}function cr(t,e,n){return{x:t*Math.cos(n),y:e*Math.sin(n)}}function ur(t,e,n){var r=Math.cos(n),n=Math.sin(n);return[t*r-e*n,t*n+e*r]}var hr={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],h=2*-Math.PI;h<=2*Math.PI;h+=Math.PI){var f=s+h;a<o?a<f&&f<o&&u.push(f):o<f&&f<a&&u.push(f)}for(var d=0;d<u.length;d++){var p=sr(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,v=-1/0,y=[a,o],b=2*-Math.PI;b<=2*Math.PI;b+=Math.PI){var x=g+b;a<o?a<x&&x<o&&y.push(x):o<x&&x<a&&y.push(x)}for(var w=0;w<y.length;w++){var M=lr(0,e,n,r,i,y[w]);M<m&&(m=M),v<M&&(v=M)}return{x:l,y:m,width:c-l,height:v-m}},length:function(t,e,n,r,i,a,o){},nearestPoint:function(t,e,n,r,i,a,o,s,l){var s=ur(s-t,l-e,-i),l=s[0],s=s[1],l=or(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=cr(n,r,a):o<c&&(l=cr(n,r,o)),ur(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 Wn(t.x,t.y,s,l)},pointAt:function(t,e,n,r,i,a,o,s){o=(o-a)*s+a;return{x:sr(t,0,n,r,i,o),y:lr(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 Yn(Math.atan2(i,s))}};function fr(t){for(var e=0,n=[],r=0;r<t.length-1;r++){var i=t[r],a=t[r+1],o=Wn(i[0],i[1],a[0],a[1]);n.push({from:i,to:a,length:o}),e+=o}return{segments:n,totalLength:e}}var dr,pr,gr={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 Hn(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+=Wn(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=fr(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=Vn.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=Vn.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=fr(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 mr(){}function vr(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function yr(t,e,n,r,i){if("function"!=typeof n)throw new TypeError("The listener must be a function");n=new vr(n,r||t,i),r=pr?pr+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 br(t,e){0==--t._eventsCount?t._events=new mr:delete t._events[e]}function xr(){this._events=new mr,this._eventsCount=0}r=e,dr=Object.prototype.hasOwnProperty,pr="~",Object.create&&(mr.prototype=Object.create(null),(new mr).__proto__||(pr=!1)),xr.prototype.eventNames=function(){var t,e,n=[];if(0===this._eventsCount)return n;for(e in t=this._events)dr.call(t,e)&&n.push(pr?e.slice(1):e);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(t)):n},xr.prototype.listeners=function(t){var t=pr?pr+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},xr.prototype.listenerCount=function(t){t=pr?pr+t:t,t=this._events[t];return t?t.fn?1:t.length:0},xr.prototype.emit=function(t,e,n,r,i,a){var o=pr?pr+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(f=1,s=new Array(c-1);f<c;f++)s[f-1]=arguments[f];l.fn.apply(l.context,s)}else for(var u,h=l.length,f=0;f<h;f++)switch(l[f].once&&this.removeListener(t,l[f].fn,void 0,!0),c){case 1:l[f].fn.call(l[f].context);break;case 2:l[f].fn.call(l[f].context,e);break;case 3:l[f].fn.call(l[f].context,e,n);break;case 4:l[f].fn.call(l[f].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[f].fn.apply(l[f].context,s)}return!0},xr.prototype.on=function(t,e,n){return yr(this,t,e,n,!1)},xr.prototype.once=function(t,e,n){return yr(this,t,e,n,!0)},xr.prototype.removeListener=function(t,e,n,r){t=pr?pr+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||br(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:br(this,t)}}else br(this,t);return this},xr.prototype.removeAllListeners=function(t){return t?(t=pr?pr+t:t,this._events[t]&&br(this,t)):(this._events=new mr,this._eventsCount=0),this},xr.prototype.off=xr.prototype.removeListener,xr.prototype.addListener=xr.prototype.on,xr.prefixed=pr,r.exports=xr.EventEmitter=xr;var i,g,wr,Mr,kr,Er=e.exports;function Or(){Or=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 f?e:f,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 k()}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")),h;r=u(i,e.iterator,n.arg);if("throw"===r.type)return n.method="throw",n.arg=r.arg,n.delegate=null,h;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,h):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,h)}(n,o);if(n){if(n===h)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===h)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 h={};function f(){}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=f.prototype=Object.create(e));function v(t){["next","throw","return"].forEach(function(e){a(t,e,function(t){return this._invoke(e,t)})})}function y(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:k}}function k(){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}},v(y.prototype),a(y.prototype,n,function(){return this}),o.AsyncIterator=y,o.async=function(t,e,n,r,i){void 0===i&&(i=Promise);var a=new y(s(t,e,n,r),i);return o.isGeneratorFunction(e)?a:a.next().then(function(t){return t.done?t.value:a.next()})},v(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,h):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),h},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),h}},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),h}},o}function Sr(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 Ar(s){return function(){var t=this,o=arguments;return new Promise(function(e,n){var r=s.apply(t,o);function i(t){Sr(r,e,n,i,a,"next",t)}function a(t){Sr(r,e,n,i,a,"throw",t)}i(void 0)})}}function _r(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 Tr(t,e,n){e&&_r(t.prototype,e),n&&_r(t,n),Object.defineProperty(t,"prototype",{writable:!1})}function f(){return(f=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 Pr(t,e){t.prototype=Object.create(e.prototype),Lr(t.prototype.constructor=t,e)}function Lr(t,e){return(Lr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function Cr(t,e){if(null==t)return{};for(var n,r={},i=Object.keys(t),a=0;a<i.length;a++)n=i[a],0<=e.indexOf(n)||(r[n]=t[n]);return r}function Nr(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function jr(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 Rr(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?jr(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)?jr(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=i=i||{}).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=g=g||{})[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=wr=wr||{})[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=kr=kr||{})[r.kYes=0]="kYes",r[r.kNo=1]="kNo";function Ir(t){var e=1;switch(t){case g.kPixels:case g.kDegrees:case g.kSeconds:break;case g.kMilliseconds:e=.001;break;case g.kRadians:e=180/Math.PI;break;case g.kGradians:e=.9;break;case g.kTurns:e=360}return e}function Br(t){switch(t){case g.kNumber:case g.kInteger:return"";case g.kPercentage:return"%";case g.kEms:return"em";case g.kRems:return"rem";case g.kPixels:return"px";case g.kDegrees:return"deg";case g.kRadians:return"rad";case g.kGradians:return"grad";case g.kMilliseconds:return"ms";case g.kSeconds:return"s";case g.kTurns:return"turn"}return""}var Dr,Fr,zr=[{name:"em",unit_type:g.kEms},{name:"px",unit_type:g.kPixels},{name:"deg",unit_type:g.kDegrees},{name:"rad",unit_type:g.kRadians},{name:"grad",unit_type:g.kGradians},{name:"ms",unit_type:g.kMilliseconds},{name:"s",unit_type:g.kSeconds},{name:"rem",unit_type:g.kRems},{name:"turn",unit_type:g.kTurns}],Wr=((e=Dr=Dr||{})[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 zr.find(function(t){return t.name===e}).unit_type}),n=function(){function t(){}t.isAngle=function(t){return t===g.kDegrees||t===g.kRadians||t===g.kGradians||t===g.kTurns},t.isLength=function(t){return t>=g.kEms&&t<g.kDegrees},t.isRelativeUnit=function(t){return t===g.kPercentage||t===g.kEms||t===g.kRems},t.isTime=function(t){return t===g.kSeconds||t===g.kMilliseconds};var e=t.prototype;return e.toString=function(){return this.buildCSSText(Mr.kNo,kr.kNo,"")},e.isNumericValue=function(){return this.getType()>=Dr.kUnitType&&this.getType()<=Dr.kClampType},t}(),r=function(n){function t(t){var e=n.call(this)||this;return e.colorSpace=void 0,e.colorSpace=t,e}Pr(t,n);var e=t.prototype;return e.getType=function(){return Dr.kColorType},e.to=function(t){return this},t}(n),Gr=((e=Fr=Fr||{})[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}Pr(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 Dr.kColorType},t}(n)),Hr=function(n){function t(t){var e=n.call(this)||this;return e.value=void 0,e.value=t,e}Pr(t,n);var e=t.prototype;return e.clone=function(){return new t(this.value)},e.getType=function(){return Dr.kKeywordType},e.buildCSSText=function(t,e,n){return n+this.value},t}(n);function Yr(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(Yr.Cache||Map),l}Yr.Cache=Map;function Vr(t){return t.split("").map(function(t,e){return t.toUpperCase()===t?(0!==e?"-":"")+t.toLowerCase():t}).join("")}var qr=Yr(function(t){return(t=void 0===t?"":t).replace(/-([a-z])/g,function(t){return t[1].toUpperCase()})});function $r(t){return"function"==typeof t}function Ur(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 Xr(t){switch(function(t){switch(t){case g.kNumber:case g.kInteger:return wr.kUNumber;case g.kPercentage:return wr.kUPercent;case g.kPixels:return wr.kULength;case g.kMilliseconds:case g.kSeconds:return wr.kUTime;case g.kDegrees:case g.kRadians:case g.kGradians:case g.kTurns:return wr.kUAngle;default:return wr.kUOther}}(t)){case wr.kUNumber:return g.kNumber;case wr.kULength:return g.kPixels;case wr.kUPercent:return g.kPercentage;case wr.kUTime:return g.kSeconds;case wr.kUAngle:return g.kDegrees;default:return g.kUnknown}}function Kr(t){return ai[t]||(ai[t]=new Hr(t)),ai[t]}var Zr={d:{alias:"path"},strokeDasharray:{alias:"lineDash"},strokeWidth:{alias:"lineWidth"},textAnchor:{alias:"textAlign"},src:{alias:"img"}},Qr=Yr(function(t){var t=qr(t),e=Zr[t];return(null==e?void 0:e.alias)||t}),Jr=function(i){function n(t,e){var n,r;return void 0===e&&(e=g.kNumber),(n=i.call(this)||this).unit=void 0,n.value=void 0,r="string"==typeof e?(r=e)?"number"===r?g.kNumber:"percent"===r||"%"===r?g.kPercentage:Wr(r):g.kUnknown:e,n.unit=r,n.value=t,n}Pr(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 Dr.kUnitType},t.convertTo=function(t){var e;return this.unit===t?new n(this.value,this.unit):(e=Xr(this.unit))!==Xr(t)||e===g.kUnknown?null:(e=Ir(this.unit)/Ir(t),new n(this.value*e,t))},t.buildCSSText=function(t,e,n){switch(this.unit){case g.kUnknown:break;case g.kInteger:i=Number(this.value).toFixed(0);break;case g.kNumber:case g.kPercentage:case g.kEms:case g.kRems:case g.kPixels:case g.kDegrees:case g.kRadians:case g.kGradians:case g.kMilliseconds:case g.kSeconds:case g.kTurns:var r,i,a=this.value,o=Br(this.unit);i=a<-999999||999999<a?(r=Br(this.unit),!Number.isFinite(a)||Number.isNaN(a)?Ur(a,r):a+(r||"")):""+a+o}return n+=i},n}(n),ti=new Jr(0,"px"),ei=(new Jr(1,"px"),new Jr(0,"deg")),ni=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}Pr(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),ri=function(t){var e=t.name,n=t.inherits,r=t.interpolable,i=t.initialValue,t=t.syntax;_.styleValueRegistry.registerMetadata({n:e,inh:n,int:r,d:i,syntax:t})},ii=new Hr("unset"),e=new Hr("initial"),n=new Hr("inherit"),ai={"":ii,unset:ii,initial:e,inherit:n},oi=new ni(0,0,0,0,!0),si=new ni(0,0,0,0),li=Yr(function(t,e,n,r){return new ni(t,e,n,r)},function(t,e,n,r){return"rgba("+t+","+e+","+n+","+r+")"}),ci=function(t,e){return void 0===e&&(e=g.kNumber),new Jr(t,e)},ui=new Jr(50,"%"),hi={},fi=0;var di="undefined"!=typeof window&&void 0!==window.document;function pi(t,e){var n=Number(t.parsedStyle.zIndex),r=Number(e.parsedStyle.zIndex);if(n===r){var i=t.parentNode;if(i)return(i=i.childNodes||[]).indexOf(t)-i.indexOf(e)}return n-r}function gi(t){var e,n=t;do{if(null==(e=n.parsedStyle)?void 0:e.clipPath)return n}while(null!==(n=n.parentElement));return null}function mi(t,e){if(di)return document.defaultView.getComputedStyle(t,null).getPropertyValue(e)}var vi="Method not implemented.",yi="Use document.documentElement instead.",bi={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"};function xi(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function wi(t,e,n){t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2]}function Mi(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function ki(t,e,n){t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n}function Ei(t){return void 0===t?0:360<t||t<-360?t%360:t}function Oi(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),Array.isArray(t)&&3===t.length?Pt(t):Qe(t)?Ct(t,e,n):Ct(t[0],t[1]||e,t[2]||n)}function Si(t){return t*(Math.PI/180)}function Ai(t){return t*(180/Math.PI)}function _i(t,e){return 16===e.length?(n=t,r=e,o=.5*Math.PI,s=(c=xt(v(),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 Ti(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 K(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 Pi(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=Ai(Math.atan2(n,e));return[t[6],t[7],a,o,r]}var Li=J(),Ci=J(),Ni=$t(),d=[v(),v(),v()],ji=v();function Ri(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}(Li,t)&&(et(Ci,Li),Ci[3]=0,Ci[7]=0,Ci[11]=0,Ci[15]=1,!(Math.abs(ut(Ci))<1e-8))){var t=Li[3],o=Li[7],s=Li[11],l=Li[12],c=Li[13],u=Li[14],h=Li[15];if(0!==t||0!==o||0!==s){if(Ni[0]=t,Ni[1]=o,Ni[2]=s,Ni[3]=h,!ct(Ci,Ci))return;lt(Ci,Ci),Ut(i,Ni,Ci)}else i[0]=i[1]=i[2]=0,i[3]=1;if(e[0]=l,e[1]=c,e[2]=u,t=Li,(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]=Lt(d[0]),Dt(d[0],d[0]),r[0]=Ft(d[0],d[1]),Ii(d[1],d[1],d[0],1,-r[0]),n[1]=Lt(d[1]),Dt(d[1],d[1]),r[0]/=n[1],r[1]=Ft(d[0],d[2]),Ii(d[2],d[2],d[0],1,-r[1]),r[2]=Ft(d[1],d[2]),Ii(d[2],d[2],d[1],1,-r[2]),n[2]=Lt(d[2]),Dt(d[2],d[2]),r[1]/=n[2],r[2]/=n[2],zt(ji,d[1],d[2]),Ft(d[0],ji)<0)for(var f=0;f<3;f++)n[f]*=-1,d[f][0]*=-1,d[f][1]*=-1,d[f][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 Ii(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 Bi=J();function Di(t,l){var c,u;return 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 js({}),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||[ti,ti],l.translateLocal(o[0].value,o[1].value,0)):"translatex"===s?(o=t||[ti],l.translateLocal(o[0].value,0,0)):"translatey"===s?(o=t||[ti],l.translateLocal(0,o[0].value,0)):"translatez"===s?(o=t||[ti],l.translateLocal(0,0,o[0].value)):"translate3d"===s?(o=t||[ti,ti,ti],l.translateLocal(o[0].value,o[1].value,o[2].value)):"rotate"===s?(o=t||[ei],l.rotateLocal(0,0,no(o[0]))):"rotatex"===s?(o=t||[ei],l.rotateLocal(no(o[0]),0,0)):"rotatey"===s?(o=t||[ei],l.rotateLocal(0,no(o[0]),0)):"rotatez"===s?(o=t||[ei],l.rotateLocal(0,0,no(o[0]))):"rotate3d"!==s&&("skew"===s?(o=(null==t?void 0:t.map(function(t){return t.value}))||[0,0],l.setLocalSkew(Si(o[0]),Si(o[1]))):"skewx"===s?(o=(null==t?void 0:t.map(function(t){return t.value}))||[0],l.setLocalSkew(Si(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],Si(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(nt(Bi,e,n,0,0,r,i,0,0,0,0,1,0,a+c,o+u,0,1))):"matrix3d"===s&&(nt.apply(Tt,[Bi].concat(t.map(function(t){return t.value}))),Bi[12]+=c,Bi[13]+=u,l.setLocalTransform(Bi)))})),l.getLocalTransform()}Fi={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]+\.?))/},zi="";var Fi,zi,M,Wi=function(t){return zi=t,Hi()};function Gi(t){throw new Error(zi+": "+t)}function Hi(){var t=Ji(Yi);return 0<zi.length&&Gi("Invalid input not EOF"),t}function Yi(){return Vi("linear-gradient",Fi.linearGradient,$i)||Vi("repeating-linear-gradient",Fi.repeatingLinearGradient,$i)||Vi("radial-gradient",Fi.radialGradient,Ui)||Vi("repeating-radial-gradient",Fi.repeatingRadialGradient,Ui)||Vi("conic-gradient",Fi.conicGradient,Ui)}function Vi(n,t,r){return qi(t,function(t){var e=r();return e&&!oa(Fi.comma)&&Gi("Missing comma before color stops"),{type:n,orientation:e,colorStops:Ji(ta)}})}function qi(t,e){t=oa(t);if(t)return oa(Fi.startCall)||Gi("Missing ("),e=e(t),oa(Fi.endCall)||Gi("Missing )"),e}function $i(){return aa("directional",Fi.sideOrCorner,1)||aa("angular",Fi.angleValue,1)}function Ui(){var t,e,n=Xi();return n&&((t=[]).push(n),e=zi,oa(Fi.comma))&&((n=Xi())?t.push(n):zi=e),t}function Xi(){var t,e=function(){var t=aa("shape",/^(circle)/i,0);t&&(t.style=ia()||Ki());return t}()||function(){var t=aa("shape",/^(ellipse)/i,0);t&&(t.style=na()||Ki());return t}();return e?e.at=Zi():(t=Ki())?(e=t,(t=Zi())&&(e.at=t)):(t=Qi())&&(e={type:"default-radial",at:t}),e}function Ki(){return aa("extent-keyword",Fi.extentKeywords,1)}function Zi(){var t;if(aa("position",/^at/,0))return(t=Qi())||Gi("Missing positioning value"),t}function Qi(){var t={x:na(),y:na()};if(t.x||t.y)return{type:"position",value:t}}function Ji(t){var e=t(),n=[];if(e)for(n.push(e);oa(Fi.comma);)(e=t())?n.push(e):Gi("One extra comma");return n}function ta(){var t=aa("hex",Fi.hexColor,1)||qi(Fi.rgbaColor,function(){return{type:"rgba",value:Ji(ea)}})||qi(Fi.rgbColor,function(){return{type:"rgb",value:Ji(ea)}})||aa("literal",Fi.literalColor,0);return t||Gi("Expected color definition"),t.length=na(),t}function ea(){return oa(Fi.number)[1]}function na(){return aa("%",Fi.percentageValue,1)||ra()||ia()}function ra(){return aa("position-keyword",Fi.positionKeywords,1)}function ia(){return aa("px",Fi.pixelValue,1)||aa("em",Fi.emValue,1)}function aa(t,e,n){e=oa(e);if(e)return{type:t,value:e[n]}}function oa(t){var e=/^[\n\r\t\s]+/.exec(zi),e=(e&&sa(e[0].length),t.exec(zi));return e&&sa(e[0].length),e}function sa(t){zi=zi.substring(t)}function la(t){var e;return 0===t.parsedStyle.path.totalLength&&(t.parsedStyle.path.totalLength=Ie(t.parsedStyle.path.absolutePath,void 0,y(y({},e),{bbox:!1,length:!0})).length),t.parsedStyle.path.totalLength}function ca(t,e){return t[0]===e[0]&&t[1]===e[1]}function ua(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 ha(t,e){return[e[0]+(e[0]-t[0]),e[1]+(e[1]-t[1])]}(r=M=M||{}).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 fa(t,e,n,r,i,a,o,s){var l,c,u;return e=Math.abs(e),n=Math.abs(n),r=Si(r=tn(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=da({x:1,y:0},o={x:(u.x-c)/e,y:(u.y-i)/n}),o=da(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 da=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 pa(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 h=function(t,e){var n=e[1],r=e[2],i=tn(Si(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,h=-1*Math.sin(i)*(s-c)/2+Math.cos(i)*(l-e)/2,f=u*u/(n*n)+h*h/(r*r);1<f&&(n*=Math.sqrt(f),r*=Math.sqrt(f));f=n*n*(h*h)+r*r*(u*u),f=f?Math.sqrt((n*n*(r*r)-f)/f):1;a===o&&(f*=-1);isNaN(f)&&(f=0);var d=r?f*n*h/r:0,f=n?f*-r*u/n:0,s=(s+c)/2+Math.cos(i)*d-Math.sin(i)*f,l=(l+e)/2+Math.sin(i)*d+Math.cos(i)*f,p=[(u-d)/n,(h-f)/r],u=[(-1*u-d)/n,(-1*h-f)/r],d=ya([1,0],p),h=ya(p,u);va(p,u)<=-1&&(h=Math.PI);1<=va(p,u)&&(h=0);0===o&&0<h&&(h-=2*Math.PI);1===o&&h<0&&(h+=2*Math.PI);return{cx:s,cy:l,rx:ca(t,[c,e])?0:n,ry:ca(t,[c,e])?0:r,startAngle:d,endAngle:d+h,xRotation:i,arcFlag:a,sweepFlag:o}}(n,l);u.arcParams=h}"Z"===c?(n=i,r=t[a+1]):n=[l[(y=l.length)-2],l[y-1]],r&&"Z"===r[0]&&(r=t[a],e[a])&&(e[a].prePoint=n),u.currentPoint=n,e[a]&&ca(n,e[a].currentPoint)&&(e[a].prePoint=u.prePoint);var f,d,p,g,m,v,y=r?[r[r.length-2],r[r.length-1]]:null,b=(u.nextPoint=y,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?(f=[l[1],l[2]],u.startTangent=[b[0]-f[0],b[1]-f[1]],u.endTangent=[n[0]-f[0],n[1]-f[1]]):"T"===c?(d=ha((f=e[s-1]).currentPoint,b),"Q"===f.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=ha((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=ga(u,0)).x,m=g.y,v=(c=ga(u,1,!1)).x,c=c.y,u.startTangent=[b,m],u.endTangent=[v,c]),e.push(u)}return e}function ga(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=fa({x:t.prePoint[0],y:t.prePoint[1]},i,a,o,!!s,!!r,{x:t.currentPoint[0],y:t.currentPoint[1]},e),i=fa({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 ma(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function va(t,e){return ma(t)*ma(e)?(t[0]*e[0]+t[1]*e[1])/(ma(t)*ma(e)):1}function ya(t,e){return(t[0]*e[1]<t[1]*e[0]?-1:1)*Math.acos(va(t,e))}function ba(t,e,n,r){var i=(-1+Math.sqrt(2))/3*4,a=t*i,i=e*i,o=n-t,t=n+t,s=r-e,e=r+e;return[["M",o,r],["C",o,r-i,n-a,s,n,s],["C",n+a,s,t,r-i,t,r],["C",t,r+i,n+a,e,n,e],["C",n-a,e,o,r+i,o,r],["Z"]]}function xa(t,e){void 0===e&&(e=t.getLocalTransform());var n,r,i,a,o,s,l,c,u,h,f,d=[];switch(t.nodeName){case M.LINE:var p=t.parsedStyle,d=[["M",p.x1,p.y1],["L",p.x2,p.y2]];break;case M.CIRCLE:var p=t.parsedStyle,g=p.r;d=ba(g,g,p.cx,p.cy);break;case M.ELLIPSE:var g=t.parsedStyle;d=ba(g.rx,g.ry,g.cx,g.cy);break;case M.POLYLINE:case M.POLYGON:p=t.parsedStyle.points;g=p.points,p=t.nodeName===M.POLYGON,g=g.map(function(t,e){return[0===e?"M":"L",t[0],t[1]]}),p&&g.push(["Z"]),d=g;break;case M.RECT:var m=t.parsedStyle,v=m.width,y=m.height,b=m.x,x=m.y,m=m.radius,w=m&&m.some(function(t){return 0!==t});n=v,r=y,b=b,x=x,d=(w=w&&m.map(function(t){return Ze(t,0,Math.min(Math.abs(v)/2,Math.abs(y)/2))}))?(s=(m=0<n?1:-1)+(o=0<r?1:-1)!=0?1:0,[["M",m*(i=w[0])+b,x],["L",n-m*(a=w[1])+b,x],a?["A",a,a,0,0,s,n+b,o*a+x]:null,["L",n+b,r-o*(a=w[2])+x],a?["A",a,a,0,0,s,n+b-m*a,r+x]:null,["L",b+m*(a=w[3]),r+x],a?["A",a,a,0,0,s,b,r+x-o*a]:null,["L",b,o*i+x],i?["A",i,i,0,0,s,m*i+b,x]:null,["Z"]].filter(function(t){return t})):[["M",b,x],["L",b+n,x],["L",b+n,x+r],["L",b,x+r],["Z"]];break;case M.PATH:w=t.parsedStyle.path.absolutePath;d=[].concat(w)}if(d.length)return l=d,c=e,u=(e=(e=t).parsedStyle).defX,h=void 0===u?0:u,f=void 0===(u=e.defY)?0:u,l.reduce(function(t,e){var n,r,i,a="";return"M"===e[0]||"L"===e[0]?(n=Ct(e[1]-h,e[2]-f,0),c&&Gt(n,n,c),a=""+e[0]+n[0]+","+n[1]):"Z"===e[0]?a=e[0]:"C"===e[0]?(n=Ct(e[1]-h,e[2]-f,0),r=Ct(e[3]-h,e[4]-f,0),i=Ct(e[5]-h,e[6]-f,0),c&&(Gt(n,n,c),Gt(r,r,c),Gt(i,i,c)),a=""+e[0]+n[0]+","+n[1]+","+r[0]+","+r[1]+","+i[0]+","+i[1]):"A"===e[0]?(n=Ct(e[6]-h,e[7]-f,0),c&&Gt(n,n,c),a=""+e[0]+e[1]+","+e[2]+","+e[3]+","+e[4]+","+e[5]+","+n[0]+","+n[1]):"Q"===e[0]&&(r=Ct(e[1]-h,e[2]-f,0),i=Ct(e[3]-h,e[4]-f,0),c&&(Gt(r,r,c),Gt(i,i,c)),a=""+e[0]+e[1]+","+e[2]+","+e[3]+","+e[4]+"}"),t+a},"")}function wa(t,e,n){var r=!1,i=!1,e=!!e&&!e.isNone,n=!!n&&!n.isNone;return"visiblepainted"===t||"painted"===t||"auto"===t?(r=e,i=n):"visiblefill"===t||"fill"===t?r=!0:"visiblestroke"===t||"stroke"===t?i=!0:"visible"!==t&&"all"!==t||(i=r=!0),[r,i]}var Ma=function(){function t(){this.callbacks=[]}var e=t.prototype;return e.getCallbacksNum=function(){return this.callbacks.length},e.tapPromise=function(t,e){this.callbacks.push(e)},e.promise=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return Promise.all(this.callbacks.map(function(t){return t.apply(void 0,e)}))},t}(),ka=function(){function t(){this.callbacks=[]}var e=t.prototype;return e.tapPromise=function(t,e){this.callbacks.push(e)},e.promise=function(){var t=Ar(Or().mark(function t(){var e,n,r,i=arguments;return Or().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(this.callbacks.length)return t.next=3,(r=this.callbacks)[0].apply(r,i);t.next=14;break;case 3:e=t.sent,n=0;case 5:if(n<this.callbacks.length-1)return r=this.callbacks[n],t.next=9,r(e);t.next=13;break;case 9:e=t.sent;case 10:n++,t.next=5;break;case 13:return t.abrupt("return",e);case 14:return t.abrupt("return",null);case 15:case"end":return t.stop()}},t,this)}));return function(){return t.apply(this,arguments)}}(),t}(),Ea=function(){function t(){this.callbacks=[]}var e=t.prototype;return e.tap=function(t,e){this.callbacks.push(e)},e.call=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];this.callbacks.forEach(function(t){t.apply(void 0,e)})},t}(),Oa=function(){function t(){this.callbacks=[]}var e=t.prototype;return e.tap=function(t,e){this.callbacks.push(e)},e.call=function(){if(this.callbacks.length){for(var t,e=(t=this.callbacks)[0].apply(t,arguments),n=0;n<this.callbacks.length-1;n++)e=(0,this.callbacks[n])(e);return e}return null},t}(),Sa=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],Aa=/([\"\'])[^\'\"]+\1/;function _a(t){if("function"!=typeof t)throw new TypeError(t+" is not a function");var n=Date.now(),e=16<(e=n-Ba)?0:16-e,r=Ca();return Ia[r]=t,1<Object.keys(Ia).length||setTimeout(function(){Ba=n;var e=Ia;Ia={},Object.keys(e).forEach(function(t){return e[t](Ra())})},e),r}function Ta(t){delete Ia[t]}function Pa(t){return"string"!=typeof t?_a:""===t?Na.requestAnimationFrame:Na[t+"RequestAnimationFrame"]}var La=1,Ca=function(){return La++},Na="object"==typeof self&&self.self==self?self:"object"==typeof m&&m.global==m?m:{},ja=Date.now(),Ra=function(){return Na.performance&&"function"==typeof Na.performance.now?Na.performance.now():Date.now()-ja},Ia={},Ba=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"],Pa),Da=Pa(e),Fa="string"!=typeof(n=e)?Ta:""===n?Na.cancelAnimationFrame:Na[n+"CancelAnimationFrame"]||Na[n+"CancelRequestAnimationFrame"],za=(Na.requestAnimationFrame=Da,Na.cancelAnimationFrame=Fa,/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i),Wa=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,Ga=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,Ha=/[\d.]+:(#[^\s]+|[^\)]+\))/gi;var Ya={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},Va=Yr(function(t){t="angular"===t.type?Number(t.value):Ya[t.value]||0;return ci(t,"deg")}),qa=Yr(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:ci(n,i),cy:ci(r,a)}}),$a=Yr(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!=(f=r[i-1].length)?f:{type:"%",value:"100"},1<i&&(r[0].length=null!=(f=r[0].length)?f:{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(!A(c)&&!A(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 h,f=t.map(function(t){return{offset:ci(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 Gr(Fr.LinearGradient,{angle:n?Va(n):ei,steps:f}):"radial-gradient"===e&&"shape"===(n=n||[{type:"shape",value:"circle"}])[0].type&&"circle"===n[0].value?(e=(t=qa(n[0].at)).cx,t=t.cy,n[0].style&&(h=(n=n[0].style).type,n=n.value,h="extent-keyword"===h?Kr(n):ci(n,h)),new Gr(Fr.RadialGradient,{cx:e,cy:t,size:h,steps:f})):void 0});var e=t[0];if("("===t[1]||"("===t[2])if("l"===e){var n=za.exec(t);if(n)return r=(null==(r=n[2].match(Ha))?void 0:r.map(function(t){return t.split(":")}))||[],[new Gr(Fr.LinearGradient,{angle:ci(parseFloat(n[1]),"deg"),steps:r.map(function(t){var e=t[0],t=t[1];return{offset:ci(100*Number(e),"%"),color:t}})})]}else if("r"===e){n=function(t){var t=Wa.exec(t);if(t)return t=(null==(t=t[4].match(Ha))?void 0:t.map(function(t){return t.split(":")}))||[],{cx:ci(50,"%"),cy:ci(50,"%"),steps:t.map(function(t){var e=t[0],t=t[1];return{offset:ci(100*Number(e),"%"),color:t}})};return null}(t);if(n&&!Ke(n))return[new Gr(Fr.RadialGradient,n)]}else if("p"===e){var r=t;if(r=Ga.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 Ua(t){return t&&t.image}function Xa(t){return t&&!A(t.r)&&!A(t.g)&&!A(t.b)}var Ka=Yr(function(t){var e;return Ua(t)?f({repetition:"repeat"},t):"transparent"===(t=A(t)?"":t)?si:$a(t="currentColor"===t?"black":t)||(e=[0,0,0,0],null!==(t=Pn(t))&&(e[0]=t.r||0,e[1]=t.g||0,e[2]=t.b||0,e[3]=t.opacity),li.apply(void 0,e))});function Za(t,e){if(Xa(t)&&Xa(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(Ze(e[n],0,255));return e[3]=Ze(e[3],0,1),"rgba("+e.join(",")+")"}]}function Qa(t,e){if(A(e))return ci(0,"px");if(e=(""+e).trim().toLowerCase(),isFinite(Number(e))){if(0<="px".search(t))return ci(Number(e),"px");if(0<="deg".search(t))return ci(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 ci(Number(e.replace(new RegExp("U"+t,"g"),"").replace(new RegExp(r,"g"),"*0")),t)})[0]}var Ja=Yr(function(t){return Qa(new RegExp("px","g"),t)}),to=(Yr(function(t){return Qa(new RegExp("%","g"),t)}),function(t){return Qe(t)||isFinite(Number(t))?ci(Number(t)||0,"px"):Qa(new RegExp("px|%|em|rem","g"),t)}),eo=Yr(function(t){return Qa(new RegExp("deg|rad|grad|turn","g"),t)});function no(t){var e=0;return t.unit===g.kDegrees?e=t.value:t.unit===g.kRadians?e=Ai(Number(t.value)):t.unit===g.kTurns&&(e=360*Number(t.value)),e}function ro(t,e){var n;return Array.isArray(t)?n=t.map(function(t){return Number(t)}):Ke(t)?n=t.split(" ").map(function(t){return Number(t)}):Qe(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 io(t){return Ke(t)?t.split(" ").map(function(t){return to(t)}):t.map(function(t){return to(t.toString())})}function ao(t,e,n){return 0===t.value?0:t.unit===g.kPixels?Number(t.value):t.unit===g.kPercentage&&n?(n=n.nodeName===M.GROUP?n.getLocalBounds():n.geometry.contentBounds,t.value/100*n.halfExtents[e]*2):0}var oo=function(t){return Qa(/deg|rad|grad|turn|px|%/g,t)},so=["blur","brightness","drop-shadow","contrast","grayscale","sepia","saturate","hue-rotate","invert"];function lo(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<so.indexOf(e[1])&&r.push({name:e[1],params:e[2].split(" ").map(function(t){return oo(t)||Ka(t)})}),n.lastIndex===t.length)return r}return[]}function co(t){return t.toString()}var uo=Yr(function(t){return"number"==typeof t?ci(t):/^\s*[-+]?(\d*\.)?\d+\s*$/.test(t)?ci(Number(t)):ci(0)});function ho(t,e){return[t,e,co]}function fo(n,r){return function(t,e){return[t,e,function(t){return co(Ze(t,n,r))}]}}function po(t,e){if(t.length===e.length)return[t,e,function(t){return t}]}Yr(function(t){return(Ke(t)?t.split(" "):t).map(uo)});var go=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=Ee(e)}catch(t){n=Ee(""),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=pa(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=Qn.box(c[0],c[1],l[1],l[2],l[3],l[4]);break;case"C":u=ir.box(c[0],c[1],l[1],l[2],l[3],l[4],l[5],l[6]);break;case"A":var h=o.arcParams,u=hr.box(h.cx,h.cy,h.rx,h.ry,h.xRotation,h.startAngle,h.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}),f=Ue(n),d=Ue(r),p=$e(n),g=$e(r);if(0!==i.length)for(var m=0;m<i.length;m++){var v=i[m],y=v.currentPoint;y[0]===f?f-=ua(v,e).xExtra:y[0]===p&&(p+=ua(v,e).xExtra),y[1]===d?d-=ua(v,e).yExtra:y[1]===g&&(g+=ua(v,e).yExtra)}return{x:f,y:d,width:p-f,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}}},mo=Yr(go);function vo(t,e){t=(Ke(t)?mo:go)(t);return e&&(e.parsedStyle.defX=t.rect.x,e.parsedStyle.defY=t.rect.y),t}function yo(t,e,n){var r,i,a,o,s,l,c,u,h,f=t.curve,d=e.curve,t=(f&&0!==f.length||(f=Le(t.absolutePath,!1),t.curve=f),d&&0!==d.length||(d=Le(e.absolutePath,!1),e.curve=d),[f,d]),f=Be((t=f.length!==d.length?function t(e,n,r){var i,e=De(e),n=De(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],h=[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&&h[n]&&t.l>=u[n],h[n]-=i?1:0,i?t.ss:[t.s]}).flat()});return r[0].length===r[1].length?r:t(r[0],r[1],c)}(f,d):t)[0])!==Be(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[f,(i=t[1],a=f,c=i.length-1,u=[],h=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){h+=_e(i[(n+e)%c].slice(-2),a[e%c].slice(-2))}),u[n]=h,h=0}),d[u.indexOf(Math.min.apply(null,u))]),function(t){return t}]}function bo(t,e){var n,r,i=Ke(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=gr.length(i),t=(i.forEach(function(t,e){i[e+1]&&((n=[0,0])[0]=o/s,r=Vn.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 xo(t,e){return[t.points,e.points,function(t){return t}]}var wo=null;function Mo(t){return function(e){var n=0;return t.map(function(t){return t===wo?e[n++]:t})}}function ko(t){return t}var Eo={matrix:["NNNNNN",[wo,wo,0,0,wo,wo,0,0,0,0,1,0,wo,wo,0,1],ko],matrix3d:["NNNNNNNNNNNNNNNN",ko],rotate:["A"],rotatex:["A"],rotatey:["A"],rotatez:["A"],rotate3d:["NNNA"],perspective:["L"],scale:["Nn",Mo([wo,wo,new Jr(1)]),ko],scalex:["N",Mo([wo,new Jr(1),new Jr(1)]),Mo([wo,new Jr(1)])],scaley:["N",Mo([new Jr(1),wo,new Jr(1)]),Mo([new Jr(1),wo])],scalez:["N",Mo([new Jr(1),new Jr(1),wo])],scale3d:["NNN",ko],skew:["Aa",null,ko],skewx:["A",null,Mo([wo,ei])],skewy:["A",null,Mo([ei,wo])],translate:["Tt",Mo([wo,wo,ti]),ko],translatex:["T",Mo([wo,ti,ti]),Mo([wo,ti])],translatey:["T",Mo([ti,wo,ti]),Mo([ti,wo])],translatez:["L",Mo([ti,ti,wo])],translate3d:["TTL",ko]};function Oo(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=Eo[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 h=s[u],f=l[u],d=void 0;if(void 0===(d=h?{A:function(t){return"0"===t.trim()?ei:eo(t)},N:uo,T:to,L:Ja}[f.toUpperCase()](h):{a:ei,n:c[0],t:ti}[f]))return[];c.push(d)}if(r.push({t:a,d:c}),n.lastIndex===t.length)return r}return[]}function So(t){switch(t.t){case"rotatex":return i=Si(no(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=Si(no(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=Si(no(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=Si(no(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=Si(no(t.d[0])),a=Si(no(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=Si(no(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=Si(no(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=ao(t.d[0],0,null)||0,n=ao(t.d[1],0,null)||0,0,1];case"translatex":return[1,0,0,0,0,1,0,0,0,0,1,0,e=ao(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=ao(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=ao(t.d[0],0,null)||0,1];case"translate3d":return[1,0,0,0,0,1,0,0,0,0,1,0,e=ao(t.d[0],0,null)||0,n=ao(t.d[1],0,null)||0,r=ao(t.d[2],0,null)||0,1];case"perspective":a=ao(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 Ao(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 _o(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 Ri(0===(t=t).length?[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]:t.map(So).reduce(Ao),e,n,r,i,a),[[e,n,r,a,i]]}var To=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],h=r[2],r=r[3],f=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]],h=(f[0][0]=1-2*(u*u+h*h),f[0][1]=2*(c*u-h*r),f[0][2]=2*(c*h+u*r),f[1][0]=2*(c*u+h*r),f[1][1]=1-2*(c*c+h*h),f[1][2]=2*(u*h-c*r),f[2][0]=2*(c*h-u*r),f[2][1]=2*(u*h+c*r),f[2][2]=1-2*(c*c+u*u),a=Po(a,f),[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]]);n[2]&&(h[2][1]=n[2],a=Po(a,h)),n[1]&&(h[2][1]=0,h[2][0]=n[0],a=Po(a,h)),n[0]&&(h[2][0]=0,h[1][0]=n[0],a=Po(a,h));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 Po(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 Lo(t){return t.toFixed(6).replace(".000000","")}function Co(e,n){var r,i;return e.decompositionPair!==n&&(e.decompositionPair=n,r=_o(e)),n.decompositionPair!==e&&(n.decompositionPair=e,i=_o(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=Ze(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 To(t[0],t[1],t[2],e,t[4]).map(Lo).join(",")}])}function No(t){return t.replace(/[xy]/,"")}function jo(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?ci(n):ci(n,t.unit)})})}()}var n=[],o=[],s=[];if(r.length!==i.length)var l=Co(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,h=i[c].t,f=r[c].d,d=i[c].d,p=Eo[u],g=Eo[h],m=void 0;if(Ro(u,h)){var v=Co([r[c]],[i[c]]);n.push(v[0]),o.push(v[1]),s.push(["matrix",[v[2]]])}else{if(u===h)m=u;else if(p[2]&&g[2]&&No(u)===No(h))m=No(u),f=p[2](f),d=g[2](d);else{if(!p[1]||!g[1]||jo(u)!==jo(h)){v=Co(r,i);n=[v[0]],o=[v[1]],s=[["matrix",[v[2]]]];break}m=jo(u),f=p[1](f),d=g[1](d)}for(var y=[],b=[],x=[],w=0;w<f.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=Xr(t.unit),c=t.convertTo(l),l=e.convertTo(l);return c&&l?(o=c.value,s=l.value,a=Br(t.unit)):(Jr.isLength(t.unit)||Jr.isLength(e.unit))&&(o=ao(t,i,n),s=ao(e,i,n),a="px"),[o,s,function(t){return(t=r?Math.max(t,0):t)+a}]}(f[w],d[w],t,!1,w);y[w]=M[0],b[w]=M[1],x.push(M[2])}n.push(y),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 Bo=Yr(function(t){var e;return Ke(t)?"text-anchor"===t?[ci(0,"px"),ci(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:[to(Do(e[0])),to(Do(e[1]))]):[ci(t[0]||0,"px"),ci(t[1]||0,"px")]});function Do(t){return"center"===t?"50%":"left"===t||"top"===t?"0":"right"===t||"bottom"===t?"100%":t}var r=function(){function t(){this.parser=eo,this.parserWithCSSDisabled=null,this.mixer=ho}return t.prototype.calculator=function(t,e,n,r){return no(n)},t}(),e=function(){function t(){}return t.prototype.calculator=function(t,e,n,r){return n instanceof Hr&&(n=null),_.sceneGraphService.updateDisplayObjectDependency(t,e,n,r),"clipPath"===t&&r.forEach(function(t){0===t.childNodes.length&&_.sceneGraphService.dirtifyToRoot(t)}),n},t}(),n=function(){function t(){this.parser=Ka,this.parserWithCSSDisabled=Ka,this.mixer=Za}return t.prototype.calculator=function(t,e,n,r){return n instanceof Hr?"none"===n.value?oi:si:n},t}(),Fo=function(){function t(){this.parser=lo}return t.prototype.calculator=function(t,e,n){return n instanceof Hr?[]:n},t}();function zo(t){t=t.parsedStyle.fontSize;return A(t)?null:t}function Wo(){this.parser=Bo}var Go,Ho,Yo,Vo=function(){function t(){this.parser=to,this.parserWithCSSDisabled=null,this.mixer=ho}return t.prototype.calculator=function(t,e,n,r,i){if(Qe(n))return n;if(!Jr.isRelativeUnit(n.unit))return n.value;if(n.unit===g.kPercentage)return 0;if(n.unit===g.kEms){if(r.parentNode){var a=zo(r.parentNode);if(a)return a*=n.value}return i.addUnresolveProperty(r,t),0}if(n.unit===g.kRems){if(null!=r&&null!=(a=r.ownerDocument)&&a.documentElement){a=zo(r.ownerDocument.documentElement);if(a)return a*=n.value}return i.addUnresolveProperty(r,t),0}},t}(),qo=function(){function t(){this.mixer=po}var e=t.prototype;return e.parser=function(t){t=io(Qe(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}(),$o=function(){function t(){this.mixer=po}var e=t.prototype;return e.parser=function(t){t=io(Qe(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}(),Uo=function(t){function e(){return t.apply(this,arguments)||this}return Pr(e,t),e.prototype.postProcessor=function(t,e){var n,r;switch(t.nodeName){case M.CIRCLE:case M.ELLIPSE:var i=t.parsedStyle,a=i.cx,o=i.cy,i=i.cz;A(a)||(l=a),A(o)||(c=o),A(i)||(u=i);break;case M.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 M.RECT:case M.IMAGE:case M.GROUP:case M.HTML:case M.TEXT:case M.MESH:A(t.parsedStyle.x)||(l=t.parsedStyle.x),A(t.parsedStyle.y)||(c=t.parsedStyle.y),A(t.parsedStyle.z)||(u=t.parsedStyle.z)}t.nodeName!==M.PATH&&t.nodeName!==M.POLYLINE&&t.nodeName!==M.POLYGON&&(t.parsedStyle.defX=l||0,t.parsedStyle.defY=c||0),A(l)&&A(c)&&A(u)||-1!==e.indexOf("transform")||((e=t.parsedStyle.transform)&&e.length?Di(e,t):(n=(e=t.getLocalPosition())[0],r=e[1],e=e[2],t.setLocalPosition(A(l)?n:l,A(c)?r:c,A(u)?e:u)))},e}(Vo),Xo=function(){function t(){}return t.prototype.calculator=function(t,e,n,r){n=null==(n=n=n instanceof Hr?null:n)?void 0:n.cloneNode(!0);return n&&(n.style.isMarker=!0),n},t}(),Ko=function(){function t(){this.mixer=ho,this.parser=uo,this.parserWithCSSDisabled=null}return t.prototype.calculator=function(t,e,n){return n.value},t}(),Zo=function(){function t(){this.parser=uo,this.parserWithCSSDisabled=null,this.mixer=fo(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)!==M.LINE&&e!==M.PATH&&e!==M.POLYLINE||(e=r.getPoint(n))&&(t.parsedStyle.defX=e.x,t.parsedStyle.defY=e.y,t.setLocalPosition(e.x,e.y))},t}(),a=function(){function t(){this.parser=uo,this.parserWithCSSDisabled=null,this.mixer=fo(0,1)}return t.prototype.calculator=function(t,e,n){return n.value},t}(),Qo=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){xi(this.center,t),xi(this.halfExtents,e),wi(this.min,this.center,this.halfExtents),Mi(this.max,this.center,this.halfExtents)},t.setMinMax=function(t,e){Mi(this.center,e,t),ki(this.center,this.center,.5),wi(this.halfExtents,e,t),ki(this.halfExtents,this.halfExtents,.5),xi(this.min,t),xi(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,h,f,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],h=r[1],o=r[2],l=(f=t.center)[0],g=f[1],f=f[2],c=(t=t.halfExtents)[0],(d=g-(u=t[1]))<(s=p-h)&&(s=d),(d=p+h)<(p=g+u)&&(d=p),(g=f-(h=t[2]))<(u=a-o)&&(u=g),(p=a+o)<(t=f+h)&&(p=t),e[0]=.5*((a=(g=l-c)<(a=n-i)?g:a)+(o=(o=n+i)<(f=l+c)?f: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],h=e[2],f=e[6],d=e[10],p=Math.abs(a),g=Math.abs(o),m=Math.abs(s),v=Math.abs(l),y=Math.abs(c),b=Math.abs(u),x=Math.abs(h),w=Math.abs(f),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]+h*i[0]+f*i[1]+d*i[2],r[0]=p*t[0]+g*t[1]+m*t[2],r[1]=v*t[0]+y*t[1]+b*t[2],r[2]=x*t[0]+w*t[1]+M*t[2],wi(this.min,n,r),Mi(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?xi([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?xi([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}(),Jo=function(){function t(t,e){this.distance=void 0,this.normal=void 0,this.pnVertexFlag=void 0,this.distance=t||0,this.normal=e||Ct(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 Ft(t,this.normal)-this.distance},e.normalize=function(){var t=1/qt(this.normal);Bt(this.normal,this.normal,t),this.distance*=t},e.intersectsLine=function(t,e,n){var r=this.distanceToPoint(t),r=r/(r-this.distanceToPoint(e)),i=0<=r&&r<=1;return i&&n&&Wt(n,t,e,r),i},t}(),ts=((rs=Go=Go||{})[rs.OUTSIDE=4294967295]="OUTSIDE",rs[rs.INSIDE=0]="INSIDE",rs[rs.INDETERMINATE=2147483647]="INDETERMINATE",function(){function t(t){if(this.planes=[],t)this.planes=t;else for(var e=0;e<6;e++)this.planes.push(new Jo)}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],h=t[10],f=t[11],d=t[12],p=t[13],g=t[14],t=t[15];jt(this.planes[0].normal,i-e,l-a,f-c),this.planes[0].distance=t-d,jt(this.planes[1].normal,i+e,l+a,f+c),this.planes[1].distance=t+d,jt(this.planes[2].normal,i+n,l+o,f+u),this.planes[2].distance=t+p,jt(this.planes[3].normal,i-n,l-o,f-u),this.planes[3].distance=t-p,jt(this.planes[4].normal,i-r,l-s,f-h),this.planes[4].distance=t-g,jt(this.planes[5].normal,i+r,l+s,f+h),this.planes[5].distance=t+g,this.planes.forEach(function(t){t.normalize(),t.updatePNVertexFlag()})},t}()),es=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}(),ns=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}(),rs=function(){function t(){this.parser=vo,this.parserWithCSSDisabled=vo,this.mixer=yo}var e=t.prototype;return e.calculator=function(t,e,n){return n instanceof Hr&&"unset"===n.value?{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new ns(0,0,0,0)}:n},e.postProcessor=function(t,e){var n;t.nodeName===M.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}(),is=function(){function t(){this.parser=bo,this.mixer=xo}return t.prototype.postProcessor=function(t,e){var n;t.nodeName!==M.POLYGON&&t.nodeName!==M.POLYLINE||-1!==e.indexOf("transform")||(n=(e=t.parsedStyle).defX,e=e.defY,t.setLocalPosition(n,e))},t}(),as=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=fo(0,1/0),t}return Pr(t,i),t}(Vo),os=function(){function t(){}var e=t.prototype;return e.calculator=function(t,e,n,r){return n instanceof Hr?"unset"===n.value?"":n.value:""+n},e.postProcessor=function(t){t.nodeValue=""+t.parsedStyle.text||""},t}(),ss=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}(),ls=function(){function t(){this.parser=Oo,this.parserWithCSSDisabled=Oo,this.mixer=Io}var e=t.prototype;return e.calculator=function(t,e,n,r){return n instanceof Hr?[]:n},e.postProcessor=function(t){Di(t.parsedStyle.transform,t)},t}(),cs=(Ho=Ho||{},Ho[Ho.Standard=0]="Standard",(cs=Yo=Yo||{})[cs.ADDED=0]="ADDED",cs[cs.REMOVED=1]="REMOVED",cs[cs.Z_INDEX_CHANGED=2]="Z_INDEX_CHANGED",function(){function t(){this.parser=uo}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=Yo.Z_INDEX_CHANGED)},t}()),us=function(){function t(){this.registry={},this.define(M.CIRCLE,Is),this.define(M.ELLIPSE,zs),this.define(M.RECT,rl),this.define(M.IMAGE,qs),this.define(M.LINE,Us),this.define(M.GROUP,Gs),this.define(M.PATH,Zs),this.define(M.POLYGON,Js),this.define(M.POLYLINE,el),this.define(M.TEXT,al),this.define(M.HTML,Ys)}var e=t.prototype;return e.define=function(t,e){this.registry[t]=e},e.get=function(t){return this.registry[t]},t}();var x,hs=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 es,this.page=new es,this.canvas=new es,this.viewport=new es,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(vi)},Tr(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}(),fs=function(r){function t(t,e){var n=r.call(this,null)||this;return n.type=t,n.detail=e,Object.assign(Nr(n),e),n}return Pr(t,r),t}(hs),ds=function(){function t(){this.emitter=new Er}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=an(n)&&n||Ye(n)&&n.capture,n=Ye(n)&&n.once,s=$r(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=$r(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=an(n)&&n||Ye(n)&&n.capture,i=$r(e)?void 0:e;return e=$r(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 fs(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}(),ps=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}Pr(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(vi)},t.lookupNamespaceURI=function(t){throw new Error(vi)},t.lookupPrefix=function(t){throw new Error(vi)},t.normalize=function(){throw new Error(vi)},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,h=s[c],f=o[l+c];if(f!==h)return(u=h.parentNode.childNodes).indexOf(h)<u.indexOf(f)?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)})},Tr(d,[{key:"textContent",get:function(){var t="";this.nodeName===M.TEXT&&(t+=this.style.text);for(var e=Rr(this.childNodes);!(n=e()).done;){var n=n.value;n.nodeName===M.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===M.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}(ds),gs=(ps.DOCUMENT_POSITION_DISCONNECTED=1,ps.DOCUMENT_POSITION_PRECEDING=2,ps.DOCUMENT_POSITION_FOLLOWING=4,ps.DOCUMENT_POSITION_CONTAINS=8,ps.DOCUMENT_POSITION_CONTAINED_BY=16,ps.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC=32,function(e){function t(){var t=e.call(this)||this;t.defaultView=null,t.documentElement=void 0,t.timeline=void 0,t.ownerDocument=null,t.nodeName="document";try{t.timeline=new _.AnimationTimeline(Nr(t))}catch(t){}var r={};return ol.forEach(function(t){var e=t.n,n=t.inh,t=t.d;n&&t&&(r[e]=$r(t)?t(M.GROUP):t)}),t.documentElement=new Gs({id:"g-root",style:r}),t.documentElement.ownerDocument=Nr(t),t.documentElement.parentNode=Nr(t),t.childNodes=[t.documentElement],t}Pr(t,e);var n=t.prototype;return n.createElement=function(t,e){var n;return"svg"===t?this.documentElement:((n=this.defaultView.customElements.get(t))||(console.warn("Unsupported tagName: ",t),n="tspan"===t?al:Gs),(t=new n(e)).ownerDocument=this,t)},n.createElementNS=function(t,e,n){return this.createElement(e,n)},n.cloneNode=function(t){throw new Error(vi)},n.destroy=function(){try{this.documentElement.destroyChildren(),this.timeline.destroy()}catch(t){}},n.elementsFromBBox=function(t,e,n,r){var t=this.defaultView.context.rBushRoot.search({minX:t,minY:e,maxX:n,maxY:r}),i=[];return t.forEach(function(t){var t=t.displayObject,e=t.parsedStyle.pointerEvents,e=["auto","visiblepainted","visiblefill","visiblestroke","visible"].includes(e);e&&!t.isVisible()||t.isCulled()||!t.isInteractive()||i.push(t)}),i.sort(function(t,e){return e.sortable.renderOrder-t.sortable.renderOrder}),i},n.elementFromPointSync=function(t,e){var n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,n=n.y,i=this.defaultView.getConfig(),a=i.width,i=i.height;return r<0||n<0||a<r||i<n?null:(i=(a=this.defaultView.viewport2Client({x:r,y:n})).x,a=a.y,(t=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!0,position:{x:t,y:e,viewportX:r,viewportY:n,clientX:i,clientY:a},picked:[]}).picked)&&t[0]||this.documentElement)},n.elementFromPoint=function(){var n=Ar(Or().mark(function t(e,n){var r,i,a,o,s,l;return Or().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(i=this.defaultView.canvas2Viewport({x:e,y:n}),r=i.x,i=i.y,o=this.defaultView.getConfig(),a=o.width,o=o.height,r<0||i<0||a<r||o<i)return t.abrupt("return",null);t.next=4;break;case 4:return a=this.defaultView.viewport2Client({x:r,y:i}),o=a.x,s=a.y,t.next=7,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!0,position:{x:e,y:n,viewportX:r,viewportY:i,clientX:o,clientY:s},picked:[]});case 7:return s=t.sent,l=s.picked,t.abrupt("return",l&&l[0]||this.documentElement);case 10:case"end":return t.stop()}},t,this)}));return function(t,e){return n.apply(this,arguments)}}(),n.elementsFromPointSync=function(t,e){var n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,n=n.y,i=this.defaultView.getConfig(),a=i.width,i=i.height;return r<0||n<0||a<r||i<n?[]:(i=(a=this.defaultView.viewport2Client({x:r,y:n})).x,a=a.y,(t=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!1,position:{x:t,y:e,viewportX:r,viewportY:n,clientX:i,clientY:a},picked:[]}).picked)[t.length-1]!==this.documentElement&&t.push(this.documentElement),t)},n.elementsFromPoint=function(){var n=Ar(Or().mark(function t(e,n){var r,i,a,o,s,l;return Or().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(i=this.defaultView.canvas2Viewport({x:e,y:n}),r=i.x,i=i.y,o=this.defaultView.getConfig(),a=o.width,o=o.height,r<0||i<0||a<r||o<i)return t.abrupt("return",[]);t.next=4;break;case 4:return a=this.defaultView.viewport2Client({x:r,y:i}),o=a.x,s=a.y,t.next=7,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!1,position:{x:e,y:n,viewportX:r,viewportY:i,clientX:o,clientY:s},picked:[]});case 7:return s=t.sent,(l=s.picked)[l.length-1]!==this.documentElement&&l.push(this.documentElement),t.abrupt("return",l);case 11:case"end":return t.stop()}},t,this)}));return function(t,e){return n.apply(this,arguments)}}(),n.appendChild=function(t,e){throw new Error(yi)},n.insertBefore=function(t,e){throw new Error(yi)},n.removeChild=function(t,e){throw new Error(yi)},n.replaceChild=function(t,e,n){throw new Error(yi)},n.append=function(){throw new Error(yi)},n.prepend=function(){throw new Error(yi)},n.getElementById=function(t){return this.documentElement.getElementById(t)},n.getElementsByName=function(t){return this.documentElement.getElementsByName(t)},n.getElementsByTagName=function(t){return this.documentElement.getElementsByTagName(t)},n.getElementsByClassName=function(t){return this.documentElement.getElementsByClassName(t)},n.querySelector=function(t){return this.documentElement.querySelector(t)},n.querySelectorAll=function(t){return this.documentElement.querySelectorAll(t)},n.find=function(t){return this.documentElement.find(t)},n.findAll=function(t){return this.documentElement.findAll(t)},Tr(t,[{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}}]),t}(ps)),ms=((Ms=x=x||{}).REPARENT="reparent",Ms.DESTROY="destroy",Ms.ATTR_MODIFIED="DOMAttrModified",Ms.INSERTED="DOMNodeInserted",Ms.REMOVED="removed",Ms.MOUNTED="DOMNodeInsertedIntoDocument",Ms.UNMOUNTED="DOMNodeRemovedFromDocument",Ms.BOUNDS_CHANGED="bounds-changed",Ms.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 Pr(t,c),t}(hs)),vs=(ms.ADDITION=2,ms.MODIFICATION=1,ms.REMOVAL=3,0),ys=new ms(x.INSERTED,null,"","","",0,"",""),bs=new ms(x.REMOVED,null,"","","",0,"",""),xs=new fs(x.DESTROY),ws=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=vs++,t.renderable={bounds:void 0,boundsDirty:!0,renderBounds:void 0,renderBoundsDirty:!0,dirtyRenderBounds:void 0,dirty:!1,proxyNodeName:void 0},t.cullable={strategy:Ho.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=_.enableCSSParsing?{anchor:ii,opacity:ii,fillOpacity:ii,strokeOpacity:ii,fill:ii,stroke:ii,transform:ii,transformOrigin:ii,visibility:ii,pointerEvents:ii,lineWidth:ii,lineCap:ii,lineJoin:ii,increasedLineWidthForHitTesting:ii,fontSize:ii,fontFamily:ii,fontStyle:ii,fontWeight:ii,fontVariant:ii,textAlign:ii,textBaseline:ii,textTransform:ii,zIndex:ii,filter:ii,shadowType:ii}:null,t.parsedStyle={},t.attributes={},t}Pr(t,i),t.isElement=function(t){return!!t.getAttribute};var e=t.prototype;return e.cloneNode=function(t){throw new Error(vi)},e.appendChild=function(t,e){if(t.destroyed)throw new Error("Cannot append a destroyed element.");return _.sceneGraphService.attach(t,this,e),null!=(e=this.ownerDocument)&&e.defaultView&&this.ownerDocument.defaultView.mountChildren(t),ys.relatedNode=this,t.dispatchEvent(ys),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 bs.relatedNode=this,t.dispatchEvent(bs),null!=(e=t.ownerDocument)&&e.defaultView&&t.ownerDocument.defaultView.unmountChildren(t),_.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 _.sceneGraphService.matches(t,this)},e.getElementById=function(t){return _.sceneGraphService.querySelector("#"+t,this)},e.getElementsByName=function(t){return _.sceneGraphService.querySelectorAll('[name="'+t+'"]',this)},e.getElementsByClassName=function(t){return _.sceneGraphService.querySelectorAll("."+t,this)},e.getElementsByTagName=function(t){return _.sceneGraphService.querySelectorAll(t,this)},e.querySelector=function(t){return _.sceneGraphService.querySelector(t,this)},e.querySelectorAll=function(t){return _.sceneGraphService.querySelectorAll(t,this)},e.closest=function(t){var e=this;do{if(_.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(xs),this.remove(),this.emitter.removeAllListeners(),this.destroyed=!0},e.getGeometryBounds=function(){return _.sceneGraphService.getGeometryBounds(this)},e.getRenderBounds=function(){return _.sceneGraphService.getBounds(this,!0)},e.getBounds=function(){return _.sceneGraphService.getBounds(this)},e.getLocalBounds=function(){return _.sceneGraphService.getLocalBounds(this)},e.getBoundingClientRect=function(){return _.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?_.enableCSSParsing?null:void 0:void 0===(e=this.attributes[t])&&(t=Qr(t),e=this.attributes[t],_.enableCSSParsing)&&A(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(vi)},e.getAttributeNode=function(t){throw new Error(vi)},e.getAttributeNodeNS=function(t,e){throw new Error(vi)},e.hasAttributeNS=function(t,e){throw new Error(vi)},e.removeAttributeNS=function(t,e){throw new Error(vi)},e.removeAttributeNode=function(t){throw new Error(vi)},e.setAttributeNS=function(t,e,n){throw new Error(vi)},e.setAttributeNode=function(t){throw new Error(vi)},e.setAttributeNodeNS=function(t){throw new Error(vi)},e.toggleAttribute=function(t,e){throw new Error(vi)},Tr(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}(ps),Ms=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).altKey=void 0,t.button=void 0,t.buttons=void 0,t.ctrlKey=void 0,t.metaKey=void 0,t.relatedTarget=void 0,t.shiftKey=void 0,t.client=new es,t.movement=new es,t.offset=new es,t.global=new es,t.screen=new es,t}Pr(t,i);var e=t.prototype;return e.getModifierState=function(t){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(t)},e.initMouseEvent=function(){throw new Error(vi)},Tr(t,[{key:"clientX",get:function(){return this.client.x}},{key:"clientY",get:function(){return this.client.y}},{key:"movementX",get:function(){return this.movement.x}},{key:"movementY",get:function(){return this.movement.y}},{key:"offsetX",get:function(){return this.offset.x}},{key:"offsetY",get:function(){return this.offset.y}},{key:"globalX",get:function(){return this.global.x}},{key:"globalY",get:function(){return this.global.y}},{key:"screenX",get:function(){return this.screen.x}},{key:"screenY",get:function(){return this.screen.y}}]),t}(hs),ks=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).pointerId=void 0,t.width=0,t.height=0,t.isPrimary=!1,t.pointerType=void 0,t.pressure=void 0,t.tangentialPressure=void 0,t.tiltX=void 0,t.tiltY=void 0,t.twist=void 0,t}Pr(t,i);var e=t.prototype;return e.getCoalescedEvents=function(){return"pointermove"===this.type||"mousemove"===this.type||"touchmove"===this.type?[this]:[]},e.getPredictedEvents=function(){throw new Error("getPredictedEvents is not supported!")},e.clone=function(){return this.manager.clonePointerEvent(this)},t}(Ms),Es=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).deltaMode=void 0,t.deltaX=void 0,t.deltaY=void 0,t.deltaZ=void 0,t.DOM_DELTA_LINE=0,t.DOM_DELTA_PAGE=1,t.DOM_DELTA_PIXEL=2,t}return Pr(t,i),t.prototype.clone=function(){return this.manager.cloneWheelEvent(this)},t}(Ms);function Os(t){return null!=t&&t.nodeName}var Ss,As,_s,Ts=new ms(x.ATTR_MODIFIED,null,null,null,null,ms.MODIFICATION,null,null),Ps={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:""},Ls={anchor:[0,0],fill:oi,stroke:oi,transform:[],zIndex:0,filter:[],shadowType:"outer",miterLimit:10},Cs=f({},Ls,{opacity:1,fillOpacity:1,strokeOpacity:1,visibility:"visible",pointerEvents:"auto",lineWidth:1,lineCap:"butt",lineJoin:"miter",increasedLineWidthForHitTesting:0,fillRule:"nonzero"}),Ns=[].concat(["opacity","fillOpacity","strokeOpacity","transformOrigin","visibility","pointerEvents","lineWidth","lineCap","lineJoin","increasedLineWidthForHitTesting"],["fontSize","fontFamily","fontStyle","fontWeight","fontVariant","textAlign","textBaseline","textTransform"]),js=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||M.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,_.enableCSSParsing?Ls:Cs,r.config.initialParsedStyle),_.enableCSSParsing&&Object.assign(r.attributes,Ps),r.initAttributes(r.config.style),_.globalThis.Proxy||function(){});return _.enableDataset&&(r.dataset=new t({},{get:function(t,e){e="data-"+Vr(e);return void 0!==t[e]?t[e]:r.getAttribute(e)},set:function(t,e,n){return r.setAttribute("data-"+Vr(e),n),!0}})),_.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}Pr(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=f({},this.attributes);for(n in r){var i=r[n];Os(i)&&"clipPath"!==n&&"offsetPath"!==n&&"textPath"!==n&&(r[n]=i.cloneNode(e)),t&&(r[n]=t(n,i))}var a=new this.constructor({id:this.id,name:this.name,className:this.name,interactive:this.interactive,style:r});return a.setLocalTransform(this.getLocalTransform()),e&&this.children.forEach(function(t){t.style.isMarker||(t=t.cloneNode(e),a.appendChild(t))}),a},e.initAttributes=function(t){void 0===t&&(t={});var e,n=this.renderable,r={forceUpdateGeometry:!0},i=(_.enableCSSParsing&&(r.usedAttributes=Ns),{});for(e in t)i[Qr(e)]=t[e];_.styleValueRegistry.processProperties(this,i,r),n.dirty=!0},e.setAttribute=function(t,e,n){void 0===n&&(n=!1);t=Qr(t);on(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=(_.styleValueRegistry.processProperties(this,((o={})[t]=e,o),n),r.dirty=!0,this.parsedStyle[t]);this.isConnected&&(Ts.relatedNode=this,Ts.prevValue=i,Ts.newValue=e,Ts.attrName=t,Ts.prevParsedValue=a,Ts.newParsedValue=o,this.isMutationObserved?this.dispatchEvent(Ts):(Ts.target=this).ownerDocument.defaultView.dispatchEvent(Ts,!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 ns(n,e,r-n,t-e)},e.setOrigin=function(t,e,n){return _.sceneGraphService.setOrigin(this,Oi(t,e=void 0===e?0:e,n=void 0===n?0:n)),this},e.getOrigin=function(){return _.sceneGraphService.getOrigin(this)},e.setPosition=function(t,e,n){return _.sceneGraphService.setPosition(this,Oi(t,e=void 0===e?0:e,n=void 0===n?0:n)),this},e.setLocalPosition=function(t,e,n){return _.sceneGraphService.setLocalPosition(this,Oi(t,e=void 0===e?0:e,n=void 0===n?0:n)),this},e.translate=function(t,e,n){return _.sceneGraphService.translate(this,Oi(t,e=void 0===e?0:e,n=void 0===n?0:n)),this},e.translateLocal=function(t,e,n){return _.sceneGraphService.translateLocal(this,Oi(t,e=void 0===e?0:e,n=void 0===n?0:n)),this},e.getPosition=function(){return _.sceneGraphService.getPosition(this)},e.getLocalPosition=function(){return _.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=Oi(t,e=e||t,n=n||t)),_.sceneGraphService.scaleLocal(this,t),this},e.setLocalScale=function(t,e,n){return"number"==typeof t&&(t=Oi(t,e=e||t,n=n||t)),_.sceneGraphService.setLocalScale(this,t),this},e.getLocalScale=function(){return _.sceneGraphService.getLocalScale(this)},e.getScale=function(){return _.sceneGraphService.getScale(this)},e.getEulerAngles=function(){return Ai(_i(v(),_.sceneGraphService.getWorldTransform(this))[2])},e.getLocalEulerAngles=function(){return Ai(_i(v(),_.sceneGraphService.getLocalRotation(this))[2])},e.setEulerAngles=function(t){return _.sceneGraphService.setEulerAngles(this,0,0,t),this},e.setLocalEulerAngles=function(t){return _.sceneGraphService.setLocalEulerAngles(this,0,0,t),this},e.rotateLocal=function(t,e,n){return A(e)&&A(n)?_.sceneGraphService.rotateLocal(this,0,0,t):_.sceneGraphService.rotateLocal(this,t,e,n),this},e.rotate=function(t,e,n){return A(e)&&A(n)?_.sceneGraphService.rotate(this,0,0,t):_.sceneGraphService.rotate(this,t,e,n),this},e.setRotation=function(t,e,n,r){return _.sceneGraphService.setRotation(this,t,e,n,r),this},e.setLocalRotation=function(t,e,n,r){return _.sceneGraphService.setLocalRotation(this,t,e,n,r),this},e.setLocalSkew=function(t,e){return _.sceneGraphService.setLocalSkew(this,t,e),this},e.getRotation=function(){return _.sceneGraphService.getRotation(this)},e.getLocalRotation=function(){return _.sceneGraphService.getLocalRotation(this)},e.getLocalSkew=function(){return _.sceneGraphService.getLocalSkew(this)},e.getLocalTransform=function(){return _.sceneGraphService.getLocalTransform(this)},e.getWorldTransform=function(){return _.sceneGraphService.getWorldTransform(this)},e.setLocalTransform=function(t){return _.sceneGraphService.setLocalTransform(this,t),this},e.resetLocalTransform=function(){_.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?Ye(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=bt(v(),t),n=e[0],e=e[1],r=xt(v(),t),i=r[0],r=r[1],t=wt(Xt(),t),t=_i(v(),t),a=t[0],t=t[2];return Ti(a||t,n,e,i,r)},e.getLocalMatrix=function(){return this.getMatrix(this.getLocalTransform())},e.setMatrix=function(t){var t=Pi(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=Pi(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(){_.enableCSSParsing?this.style.visibility="visible":this.forEach(function(t){t.style.visibility="visible"})},e.hide=function(){_.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},Tr(t,[{key:"interactive",get:function(){return this.isInteractive()},set:function(t){this.style.pointerEvents=t?"auto":"none"}}]),t}(ws),Rs=["style"],Is=function(n){function t(t){var t=void 0===t?{}:t,e=t.style,t=Cr(t,Rs);return n.call(this,f({type:M.CIRCLE,style:_.enableCSSParsing?f({cx:"",cy:"",r:""},e):f({},e),initialParsedStyle:{anchor:[.5,.5],transformOrigin:_.enableCSSParsing?null:[ui,ui]}},t))||this}return Pr(t,n),t}(js),Bs=["style"],Ds=function(n){function t(t){var t=void 0===t?{}:t,e=t.style,t=Cr(t,Bs),e=n.call(this,f({style:_.enableCSSParsing?f({x:"",y:""},e):f({},e)},t))||this;return e.isCustomElement=!0,e}return Pr(t,n),t}(js),Fs=["style"],zs=function(n){function t(t){var t=void 0===t?{}:t,e=t.style,t=Cr(t,Fs);return n.call(this,f({type:M.ELLIPSE,style:_.enableCSSParsing?f({cx:"",cy:"",rx:"",ry:""},e):f({},e),initialParsedStyle:{anchor:[.5,.5],transformOrigin:_.enableCSSParsing?null:[ui,ui]}},t))||this}return Pr(t,n),t}(js),Ws=["style"],Gs=function(n){function t(t){var t=void 0===t?{}:t,e=t.style,t=Cr(t,Ws);return n.call(this,f({type:M.GROUP,style:_.enableCSSParsing?f({x:"",y:"",width:"",height:""},e):f({},e)},t))||this}return Pr(t,n),t}(js),Hs=["style"],Ys=function(n){function t(t){var t=void 0===t?{}:t,e=t.style,t=Cr(t,Hs),e=n.call(this,f({type:M.HTML,style:_.enableCSSParsing?f({x:"",y:"",width:"auto",height:"auto",innerHTML:""},e):f({},e)},t))||this;return e.cullable.enable=!1,e}Pr(t,n);var e=t.prototype;return e.getDomElement=function(){return this.parsedStyle.$el},e.getBoundingClientRect=function(){return this.parsedStyle.$el.getBoundingClientRect()},e.getClientRects=function(){return[this.getBoundingClientRect()]},e.getBounds=function(){var t,e,n=this.getBoundingClientRect(),r=null==(r=this.ownerDocument)||null==(r=r.defaultView)?void 0:r.getContextService().getBoundingClientRect();return r?(t=n.left-r.left,r=n.top-r.top,(e=new Qo).setMinMax([t,r,0],[t+n.width,r+n.height,0]),e):null},e.getLocalBounds=function(){if(this.parentNode){var t,e=ct(J(),this.parentNode.getWorldTransform()),n=this.getBounds();if(!Qo.isEmpty(n))return(t=new Qo).setFromTransformedAABB(n,e),t}return this.getBounds()},t}(js),Vs=["style"],qs=function(n){function t(t){var t=void 0===t?{}:t,e=t.style,t=Cr(t,Vs);return n.call(this,f({type:M.IMAGE,style:_.enableCSSParsing?f({x:"",y:"",img:"",width:"",height:""},e):f({},e)},t))||this}return Pr(t,n),t}(js),$s=["style"],Us=function(r){function t(t){var t=void 0===t?{}:t,e=t.style,t=Cr(t,$s),e=r.call(this,f({type:M.LINE,style:f({x1:0,y1:0,x2:0,y2:0,z1:0,z2:0,isBillboard:!1},e)},t))||this,t=(e.markerStartAngle=0,e.markerEndAngle=0,e.parsedStyle),n=t.markerStart,t=t.markerEnd;return n&&Os(n)&&(e.markerStartAngle=n.getLocalEulerAngles(),e.appendChild(n)),t&&Os(t)&&(e.markerEndAngle=t.getLocalEulerAngles(),e.appendChild(t)),e.transformMarker(!0),e.transformMarker(!1),e}Pr(t,r);var e=t.prototype;return e.attributeChangedCallback=function(t,e,n,r,i){"x1"===t||"y1"===t||"x2"===t||"y2"===t||"markerStartOffset"===t||"markerEndOffset"===t?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===t?(r&&Os(r)&&(this.markerStartAngle=0,r.remove()),i&&Os(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t&&(r&&Os(r)&&(this.markerEndAngle=0,r.remove()),i)&&Os(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1))},e.transformMarker=function(t){var e,n,r,i,a,o=this.parsedStyle,s=o.markerStart,l=o.markerEnd,c=o.markerStartOffset,u=o.markerEndOffset,h=o.x1,f=o.x2,d=o.y1,p=o.y2,g=o.defX,o=o.defY,s=t?s:l;s&&Os(s)&&(l=0,t=t?(r=h-g,i=d-o,e=f-h,n=p-d,a=c||0,this.markerStartAngle):(r=f-g,i=p-o,e=h-f,n=d-p,a=u||0,this.markerEndAngle),l=Math.atan2(n,e),s.setLocalEulerAngles(180*l/Math.PI+t),s.setLocalPosition(r+Math.cos(l)*a,i+Math.sin(l)*a))},e.getPoint=function(t,e){void 0===e&&(e=!1);var n=this.parsedStyle,r=n.x1,i=n.y1,a=n.x2,o=n.y2,s=n.defX,n=n.defY,r=Vn.pointAt(r,i,a,o,t),i=r.x,a=r.y,o=Gt(v(),Ct(i-s,a-n,0),e?this.getWorldTransform():this.getLocalTransform());return new es(o[0],o[1])},e.getPointAtLength=function(t,e){return void 0===e&&(e=!1),this.getPoint(t/this.getTotalLength(),e)},e.getTotalLength=function(){var t=this.parsedStyle,e=t.x1,n=t.y1,r=t.x2,t=t.y2;return Vn.length(e,n,r,t)},t}(js),Xs=["style"],Ks={absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new ns(0,0,0,0)},Zs=function(i){function t(t){var t=void 0===t?{}:t,e=t.style,t=Cr(t,Xs),e=i.call(this,f({type:M.PATH,style:_.enableCSSParsing?f({path:"",miterLimit:""},e):f({},e),initialParsedStyle:_.enableCSSParsing?null:{miterLimit:4,path:f({},Ks)}},t))||this,t=(e.markerStartAngle=0,e.markerEndAngle=0,e.markerMidList=[],e.parsedStyle),n=t.markerStart,r=t.markerEnd,t=t.markerMid;return n&&Os(n)&&(e.markerStartAngle=n.getLocalEulerAngles(),e.appendChild(n)),t&&Os(t)&&e.placeMarkerMid(t),r&&Os(r)&&(e.markerEndAngle=r.getLocalEulerAngles(),e.appendChild(r)),e.transformMarker(!0),e.transformMarker(!1),e}Pr(t,i);var e=t.prototype;return e.attributeChangedCallback=function(t,e,n,r,i){"path"===t?(this.transformMarker(!0),this.transformMarker(!1),this.placeMarkerMid(this.parsedStyle.markerMid)):"markerStartOffset"===t||"markerEndOffset"===t?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===t?(r&&Os(r)&&(this.markerStartAngle=0,r.remove()),i&&Os(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&Os(r)&&(this.markerEndAngle=0,r.remove()),i&&Os(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1))):"markerMid"===t&&this.placeMarkerMid(i)},e.transformMarker=function(t){var e,n,r,i,a,o=this.parsedStyle,s=o.markerStart,l=o.markerEnd,c=o.markerStartOffset,u=o.markerEndOffset,h=o.defX,o=o.defY,s=t?s:l;s&&Os(s)&&(l=0,h=t?(i=(t=this.getStartTangent())[0],e=(t=t[1])[0]-h,n=t[1]-o,r=i[0]-t[0],i=i[1]-t[1],a=c||0,this.markerStartAngle):(c=(t=this.getEndTangent())[0],e=(t=t[1])[0]-h,n=t[1]-o,r=c[0]-t[0],i=c[1]-t[1],a=u||0,this.markerEndAngle),l=Math.atan2(i,r),s.setLocalEulerAngles(180*l/Math.PI+h),s.setLocalPosition(e+Math.cos(l)*a,n+Math.sin(l)*a))},e.placeMarkerMid=function(t){var e=this.parsedStyle,n=e.path.segments,r=e.defX,i=e.defY;if(this.markerMidList.forEach(function(t){t.remove()}),t&&Os(t))for(var a=1;a<n.length-1;a++){var o=n[a].currentPoint,s=o[0],o=o[1],l=1===a?t:t.cloneNode(!0);this.markerMidList.push(l),this.appendChild(l),l.setLocalPosition(s-r,o-i)}},e.getTotalLength=function(){return la(this)},e.getPointAtLength=function(t,e){void 0===e&&(e=!1);var n=this.parsedStyle,r=n.defX,i=n.defY,n=Ie(n.path.absolutePath,t,y(y({},a),{bbox:!1,length:!0})).point,t=n.x,a=n.y,n=Gt(v(),Ct(t-r,a-i,0),e?this.getWorldTransform():this.getLocalTransform());return new es(n[0],n[1])},e.getPoint=function(t,e){return void 0===e&&(e=!1),this.getPointAtLength(t*la(this),e)},e.getStartTangent=function(){var t,e,n=this.parsedStyle.path.segments,r=[];return 1<n.length&&(t=n[0].currentPoint,e=n[1].currentPoint,r=[],(n=n[1].startTangent)?r.push([t[0]-n[0],t[1]-n[1]]):r.push([e[0],e[1]]),r.push([t[0],t[1]])),r},e.getEndTangent=function(){var t,e,n=this.parsedStyle.path.segments,r=n.length,i=[];return 1<r&&(t=n[r-2].currentPoint,e=n[r-1].currentPoint,i=[],(n=n[r-1].endTangent)?i.push([e[0]-n[0],e[1]-n[1]]):i.push([t[0],t[1]]),i.push([e[0],e[1]])),i},t}(js),Qs=["style"],Js=function(i){function t(t){var t=void 0===t?{}:t,e=t.style,t=Cr(t,Qs),e=i.call(this,f({type:M.POLYGON,style:_.enableCSSParsing?f({points:"",miterLimit:"",isClosed:!0},e):f({},e),initialParsedStyle:_.enableCSSParsing?null:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!0}},t))||this,t=(e.markerStartAngle=0,e.markerEndAngle=0,e.markerMidList=[],e.parsedStyle),n=t.markerStart,r=t.markerEnd,t=t.markerMid;return n&&Os(n)&&(e.markerStartAngle=n.getLocalEulerAngles(),e.appendChild(n)),t&&Os(t)&&e.placeMarkerMid(t),r&&Os(r)&&(e.markerEndAngle=r.getLocalEulerAngles(),e.appendChild(r)),e.transformMarker(!0),e.transformMarker(!1),e}Pr(t,i);var e=t.prototype;return e.attributeChangedCallback=function(t,e,n,r,i){"points"===t?(this.transformMarker(!0),this.transformMarker(!1),this.placeMarkerMid(this.parsedStyle.markerMid)):"markerStartOffset"===t||"markerEndOffset"===t?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===t?(r&&Os(r)&&(this.markerStartAngle=0,r.remove()),i&&Os(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&Os(r)&&(this.markerEndAngle=0,r.remove()),i&&Os(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1))):"markerMid"===t&&this.placeMarkerMid(i)},e.transformMarker=function(t){var e,n,r,i,a,o=this.parsedStyle,s=o.markerStart,l=o.markerEnd,c=o.markerStartOffset,u=o.markerEndOffset,h=o.points.points,f=o.defX,o=o.defY,s=t?s:l;s&&Os(s)&&(i=h[l=0][0]-f,a=h[0][1]-o,c=t?(e=h[1][0]-h[0][0],n=h[1][1]-h[0][1],r=c||0,this.markerStartAngle):(t=h.length,n=this.parsedStyle.isClosed?(e=h[t-1][0]-h[0][0],h[t-1][1]-h[0][1]):(i=h[t-1][0]-f,a=h[t-1][1]-o,e=h[t-2][0]-h[t-1][0],h[t-2][1]-h[t-1][1]),r=u||0,this.markerEndAngle),l=Math.atan2(n,e),s.setLocalEulerAngles(180*l/Math.PI+c),s.setLocalPosition(i+Math.cos(l)*r,a+Math.sin(l)*r))},e.placeMarkerMid=function(t){var e=this.parsedStyle,n=e.points.points,r=e.defX,i=e.defY;if(this.markerMidList.forEach(function(t){t.remove()}),this.markerMidList=[],t&&Os(t))for(var a=1;a<(this.parsedStyle.isClosed?n.length:n.length-1);a++){var o=n[a][0]-r,s=n[a][1]-i,l=1===a?t:t.cloneNode(!0);this.markerMidList.push(l),this.appendChild(l),l.setLocalPosition(o,s)}},t}(js),tl=["style"],el=function(n){function t(t){var t=void 0===t?{}:t,e=t.style,t=Cr(t,tl);return n.call(this,f({type:M.POLYLINE,style:_.enableCSSParsing?f({points:"",miterLimit:"",isClosed:!1},e):f({},e),initialParsedStyle:_.enableCSSParsing?null:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!1}},t))||this}Pr(t,n);var e=t.prototype;return e.getTotalLength=function(){return this.parsedStyle.points.totalLength},e.getPointAtLength=function(t,e){return void 0===e&&(e=!1),this.getPoint(t/this.getTotalLength(),e)},e.getPoint=function(n,t){void 0===t&&(t=!1);var e=this.parsedStyle,r=e.defX,i=e.defY,e=e.points,a=e.points,e=e.segments,o=0,s=0,e=(e.forEach(function(t,e){n>=t[0]&&n<=t[1]&&(o=(n-t[0])/(t[1]-t[0]),s=e)}),Vn.pointAt(a[s][0],a[s][1],a[s+1][0],a[s+1][1],o)),a=e.x,e=e.y,a=Gt(v(),Ct(a-r,e-i,0),t?this.getWorldTransform():this.getLocalTransform());return new es(a[0],a[1])},e.getStartTangent=function(){var t=this.parsedStyle.points.points,e=[];return e.push([t[1][0],t[1][1]]),e.push([t[0][0],t[0][1]]),e},e.getEndTangent=function(){var t=this.parsedStyle.points.points,e=t.length-1,n=[];return n.push([t[e-1][0],t[e-1][1]]),n.push([t[e][0],t[e][1]]),n},t}(Js),nl=["style"],rl=function(n){function t(t){var t=void 0===t?{}:t,e=t.style,t=Cr(t,nl);return n.call(this,f({type:M.RECT,style:_.enableCSSParsing?f({x:"",y:"",width:"",height:"",radius:""},e):f({},e)},t))||this}return Pr(t,n),t}(js),il=["style"],al=function(n){function t(t){var t=void 0===t?{}:t,e=t.style,t=Cr(t,il);return n.call(this,f({type:M.TEXT,style:_.enableCSSParsing?f({x:"",y:"",text:"",fontSize:"",fontFamily:"",fontStyle:"",fontWeight:"",fontVariant:"",textAlign:"",textBaseline:"",textTransform:"",fill:"black",letterSpacing:"",lineHeight:"",miterLimit:"",wordWrap:!1,wordWrapWidth:0,leading:0,dx:"",dy:"",isBillboard:!1,sizeAttenuation:!0},e):f({fill:"black"},e),initialParsedStyle:_.enableCSSParsing?{}:{x:0,y:0,fontSize:16,fontFamily:"sans-serif",fontStyle:"normal",fontWeight:"normal",fontVariant:"normal",lineHeight:0,letterSpacing:0,textBaseline:"alphabetic",textAlign:"start",wordWrap:!1,wordWrapWidth:0,leading:0,dx:0,dy:0,isBillboard:!1,sizeAttenuation:!0}},t))||this}Pr(t,n);var e=t.prototype;return e.getComputedTextLength=function(){var t;return(null==(t=this.parsedStyle.metrics)?void 0:t.maxLineWidth)||0},e.getLineBoundingRects=function(){var t;return(null==(t=this.parsedStyle.metrics)?void 0:t.lineMetrics)||[]},e.isOverflowing=function(){return!!this.parsedStyle.isOverflowing},t}(js),ol=[{n:"display",k:["none"]},{n:"opacity",int:!0,inh:!0,d:"1",syntax:i.OPACITY_VALUE},{n:"fillOpacity",int:!0,inh:!0,d:"1",syntax:i.OPACITY_VALUE},{n:"strokeOpacity",int:!0,inh:!0,d:"1",syntax:i.OPACITY_VALUE},{n:"fill",int:!0,k:["none"],d:"none",syntax:i.PAINT},{n:"fillRule",k:["nonzero","evenodd"],d:"nonzero"},{n:"stroke",int:!0,k:["none"],d:"none",syntax:i.PAINT,l:!0},{n:"shadowType",k:["inner","outer","both"],d:"outer",l:!0},{n:"shadowColor",int:!0,syntax:i.COLOR},{n:"shadowOffsetX",int:!0,l:!0,d:"0",syntax:i.LENGTH_PERCENTAGE},{n:"shadowOffsetY",int:!0,l:!0,d:"0",syntax:i.LENGTH_PERCENTAGE},{n:"shadowBlur",int:!0,l:!0,d:"0",syntax:i.SHADOW_BLUR},{n:"lineWidth",int:!0,inh:!0,d:"1",l:!0,a:["strokeWidth"],syntax:i.LENGTH_PERCENTAGE},{n:"increasedLineWidthForHitTesting",inh:!0,d:"0",l:!0,syntax:i.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:i.LENGTH_PERCENTAGE_12},{n:"lineDashOffset",int:!0,inh:!0,d:"0",a:["strokeDashoffset"],syntax:i.LENGTH_PERCENTAGE},{n:"offsetPath",syntax:i.DEFINED_PATH},{n:"offsetDistance",int:!0,syntax:i.OFFSET_DISTANCE},{n:"dx",int:!0,l:!0,d:"0",syntax:i.LENGTH_PERCENTAGE},{n:"dy",int:!0,l:!0,d:"0",syntax:i.LENGTH_PERCENTAGE},{n:"zIndex",ind:!0,int:!0,d:"0",k:["auto"],syntax:i.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:i.FILTER},{n:"clipPath",syntax:i.DEFINED_PATH},{n:"textPath",syntax:i.DEFINED_PATH},{n:"textPathSide",k:["left","right"],d:"left"},{n:"textPathStartOffset",l:!0,d:"0",syntax:i.LENGTH_PERCENTAGE},{n:"transform",p:100,int:!0,k:["none"],d:"none",syntax:i.TRANSFORM},{n:"transformOrigin",p:100,d:function(t){return t===M.CIRCLE||t===M.ELLIPSE?"center":t===M.TEXT?"text-anchor":"left top"},l:!0,syntax:i.TRANSFORM_ORIGIN},{n:"anchor",p:99,d:function(t){return t===M.CIRCLE||t===M.ELLIPSE?"0.5 0.5":"0 0"},l:!0,syntax:i.LENGTH_PERCENTAGE_12},{n:"cx",int:!0,d:"0",syntax:i.COORDINATE},{n:"cy",int:!0,d:"0",syntax:i.COORDINATE},{n:"cz",int:!0,d:"0",syntax:i.COORDINATE},{n:"r",int:!0,l:!0,d:"0",syntax:i.LENGTH_PERCENTAGE},{n:"rx",int:!0,l:!0,d:"0",syntax:i.LENGTH_PERCENTAGE},{n:"ry",int:!0,l:!0,d:"0",syntax:i.LENGTH_PERCENTAGE},{n:"x",int:!0,d:"0",syntax:i.COORDINATE},{n:"y",int:!0,d:"0",syntax:i.COORDINATE},{n:"z",int:!0,d:"0",syntax:i.COORDINATE},{n:"width",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:i.LENGTH_PERCENTAGE},{n:"height",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:i.LENGTH_PERCENTAGE},{n:"radius",int:!0,l:!0,d:"0",syntax:i.LENGTH_PERCENTAGE_14},{n:"x1",int:!0,l:!0,syntax:i.COORDINATE},{n:"y1",int:!0,l:!0,syntax:i.COORDINATE},{n:"z1",int:!0,l:!0,syntax:i.COORDINATE},{n:"x2",int:!0,l:!0,syntax:i.COORDINATE},{n:"y2",int:!0,l:!0,syntax:i.COORDINATE},{n:"z2",int:!0,l:!0,syntax:i.COORDINATE},{n:"path",int:!0,l:!0,d:"",a:["d"],syntax:i.PATH,p:50},{n:"points",int:!0,l:!0,syntax:i.LIST_OF_POINTS,p:50},{n:"text",l:!0,d:"",syntax:i.TEXT,p:50},{n:"textTransform",l:!0,inh:!0,k:["capitalize","uppercase","lowercase","none"],d:"none",syntax:i.TEXT_TRANSFORM,p:51},{n:"font",l:!0},{n:"fontSize",int:!0,inh:!0,d:"16px",l:!0,syntax:i.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:i.LENGTH,int:!0,d:"0"},{n:"letterSpacing",l:!0,syntax:i.LENGTH,int:!0,d:"0"},{n:"miterLimit",l:!0,syntax:i.NUMBER,d:function(t){return t===M.PATH||t===M.POLYGON||t===M.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:i.MARKER},{n:"markerEnd",syntax:i.MARKER},{n:"markerMid",syntax:i.MARKER},{n:"markerStartOffset",syntax:i.LENGTH,l:!0,int:!0,d:"0"},{n:"markerEndOffset",syntax:i.LENGTH,l:!0,int:!0,d:"0"}],sl=ol.filter(function(t){return!!t.l}).map(function(t){return t.n}),ll={},cl=new WeakMap,Ms=function(){function t(){var e=this;ol.forEach(function(t){e.registerMetadata(t)})}var e=t.prototype;return e.registerMetadata=function(e){[e.n].concat(e.a||[]).forEach(function(t){ll[t]=e})},e.unregisterMetadata=function(t){delete ll[t]},e.getPropertySyntax=function(t){return _.CSSPropertySyntaxFactory[t]},e.processProperties=function(n,e,t){var r=this;if(void 0===t&&(t={skipUpdateAttribute:!1,skipParse:!1,forceUpdateGeometry:!1,usedAttributes:[]}),_.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=ll[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)}),_.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 h=0;h<sl.length;h++)if(sl[h]in e){u=!0;break}e.fill&&(n.parsedStyle.fill=Ka(e.fill)),e.stroke&&(n.parsedStyle.stroke=Ka(e.stroke)),e.shadowColor&&(n.parsedStyle.shadowColor=Ka(e.shadowColor)),e.filter&&(n.parsedStyle.filter=lo(e.filter)),A(e.radius)||(n.parsedStyle.radius=ro(e.radius,4)),A(e.lineDash)||(n.parsedStyle.lineDash=ro(e.lineDash,2)),e.points&&(n.parsedStyle.points=bo(e.points,n)),""===e.path&&(n.parsedStyle.path=f({},Ks)),e.path&&(n.parsedStyle.path=vo(e.path,n)),e.textTransform&&_.CSSPropertySyntaxFactory["<text-transform>"].calculator(null,null,{value:e.textTransform},n,null),e.clipPath&&_.CSSPropertySyntaxFactory["<defined-path>"].calculator("clipPath",o,e.clipPath,n,this),e.offsetPath&&_.CSSPropertySyntaxFactory["<defined-path>"].calculator("offsetPath",i,e.offsetPath,n,this),e.anchor&&(n.parsedStyle.anchor=ro(e.anchor,2)),e.transform&&(n.parsedStyle.transform=Oo(e.transform)),e.transformOrigin&&(n.parsedStyle.transformOrigin=Bo(e.transformOrigin)),e.markerStart&&(n.parsedStyle.markerStart=_.CSSPropertySyntaxFactory["<marker>"].calculator(null,e.markerStart,e.markerStart,null,null)),e.markerEnd&&(n.parsedStyle.markerEnd=_.CSSPropertySyntaxFactory["<marker>"].calculator(null,e.markerEnd,e.markerEnd,null,null)),e.markerMid&&(n.parsedStyle.markerMid=_.CSSPropertySyntaxFactory["<marker>"].calculator("",e.markerMid,e.markerMid,null,null)),(n.nodeName!==M.CIRCLE&&n.nodeName!==M.ELLIPSE||A(e.cx)&&A(e.cy))&&(n.nodeName!==M.RECT&&n.nodeName!==M.IMAGE&&n.nodeName!==M.GROUP&&n.nodeName!==M.HTML&&n.nodeName!==M.TEXT&&n.nodeName!==M.MESH||A(e.x)&&A(e.y)&&A(e.z))&&(n.nodeName!==M.LINE||A(e.x1)&&A(e.y1)&&A(e.z1)&&A(e.x2)&&A(e.y2)&&A(e.z2))||_.CSSPropertySyntaxFactory["<coordinate>"].postProcessor(n,s),A(e.zIndex)||_.CSSPropertySyntaxFactory["<z-index>"].postProcessor(n,s),e.path&&_.CSSPropertySyntaxFactory["<path>"].postProcessor(n,s),e.points&&_.CSSPropertySyntaxFactory["<list-of-points>"].postProcessor(n,s),A(e.offsetDistance)||_.CSSPropertySyntaxFactory["<offset-distance>"].postProcessor(n,s),e.transform&&_.CSSPropertySyntaxFactory["<transform>"].postProcessor(n,s),u&&this.updateGeometry(n)}},e.parseProperty=function(t,e,n){var r,t=ll[t],i=e;return"unset"===(e=""!==e&&!A(e)?e:"unset")||"initial"===e||"inherit"===e?i=Kr(e):t&&(r=t.k,t=(t=t.syntax)&&this.getPropertySyntax(t),r&&-1<r.indexOf(e)?i=Kr(e):t&&t.parser&&(i=t.parser(e,n))),i},e.computeProperty=function(t,e,n){var r=ll[t],i="g-root"===n.id,a=e;if(r){var o=r.syntax,s=r.inh,r=r.d;if(e instanceof Hr){var l=e.value;if("initial"===(l="unset"===l?s&&!i?"inherit":"initial":l))A(r)||(e=this.parseProperty(t,$r(r)?r(n.nodeName):r,n));else if("inherit"===l)return s=this.tryToResolveProperty(n,t,{inherited:!0}),A(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 Hr?e.value:e}return a},e.postProcessProperty=function(t,e,n){var t=ll[t];t&&t.syntax&&(t=t.syntax&&this.getPropertySyntax(t.syntax))&&t.postProcessor&&t.postProcessor(e,n)},e.addUnresolveProperty=function(t,e){var n=cl.get(t);n||(cl.set(t,[]),n=cl.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=cl.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=cl.get(e);t&&t.length&&(n={},t.forEach(function(t){n[t]=e.attributes[t]}),this.processProperties(e,n),cl.delete(e))},e.updateGeometry=function(t){var s,e,n,r,i,a,o,l,c,u,h,f,d,p,g,m=t.nodeName,v=_.geometryUpdaterFactory[m];v&&((s=t.geometry).contentBounds||(s.contentBounds=new Qo),s.renderBounds||(s.renderBounds=new Qo),e=t.parsedStyle,n=(v=v.update(e,t)).width,r=v.height,h=void 0===(h=v.depth)?0:h,u=void 0===(u=v.offsetX)?0:u,p=void 0===(p=v.offsetY)?0:p,v=void 0===(v=v.offsetZ)?0:v,h=[Math.abs(n)/2,Math.abs(r)/2,h/2],l=e.stroke,c=e.lineWidth,g=e.increasedLineWidthForHitTesting,d=e.shadowType,f=e.shadowColor,i=void 0===(i=e.filter)?[]:i,a=e.transformOrigin,o=e.anchor,m===M.TEXT?delete e.anchor:m===M.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))*h[2]+v],s.contentBounds.update(u,h),p=m===M.POLYLINE||m===M.POLYGON||m===M.PATH?Math.SQRT2:.5,l&&!l.isNone&&(h[0]+=v=((c||0)+(g||0))*p,h[1]+=v),s.renderBounds.update(u,h),f&&d&&"inner"!==d&&(l=(m=s.renderBounds).min,c=m.max,g=e.shadowBlur||0,p=e.shadowOffsetX||0,v=e.shadowOffsetY||0,u=l[0]-g+p,h=c[0]+g+p,f=l[1]-g+v,d=c[1]+g+v,l[0]=Math.min(l[0],u),c[0]=Math.max(c[0],h),l[1]=Math.min(l[1],f),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,Mi(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?ao(a[0],0,t):0),v=(m?-1:1)*(a?ao(a[1],1,t):0),g-=(p?-1:1)*(o&&o[0]||0)*s.contentBounds.halfExtents[0]*2,v-=(m?-1:1)*(o&&o[1]||0)*s.contentBounds.halfExtents[1]*2,t.setOrigin(g,v),_.sceneGraphService.dirtifyToRoot(t))},e.isPropertyInheritable=function(t){t=ll[t];return!!t&&t.inh},t}();(fl=Ss=Ss||{})[fl.ORBITING=0]="ORBITING",fl[fl.EXPLORING=1]="EXPLORING",fl[fl.TRACKING=2]="TRACKING",(fl=As=As||{})[fl.DEFAULT=0]="DEFAULT",fl[fl.ROTATIONAL=1]="ROTATIONAL",fl[fl.TRANSLATIONAL=2]="TRANSLATIONAL",fl[fl.CINEMATIC=3]="CINEMATIC",(fl=_s=_s||{})[fl.ORTHOGRAPHIC=0]="ORTHOGRAPHIC",fl[fl.PERSPECTIVE=1]="PERSPECTIVE";var ul,hl="updated",fl=function(){function t(){this.canvas=void 0,this.eventEmitter=new Er,this.matrix=J(),this.right=Ct(1,0,0),this.up=Ct(0,1,0),this.forward=Ct(0,0,1),this.position=Ct(0,0,1),this.focalPoint=Ct(0,0,0),this.distanceVector=Ct(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=J(),this.projectionMatrixInverse=J(),this.jitteredProjectionMatrix=void 0,this.view=void 0,this.enableUpdate=!0,this.type=Ss.EXPLORING,this.trackingMode=As.DEFAULT,this.projectionMode=_s.PERSPECTIVE,this.frustum=new ts,this.orthoMatrix=J()}var e=t.prototype;return e.isOrtho=function(){return this.projectionMode===_s.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===Ss.EXPLORING?this.setWorldRotation(!0):this.setWorldRotation(!1),this._getAngles(),this.type===Ss.TRACKING&&void 0!==e&&this.setTrackingMode(e),this},e.setProjectionMode=function(t){return this.projectionMode=t,this},e.setTrackingMode=function(t){if(this.type!==Ss.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 ct(J(),this.matrix)},e.getWorldTransform=function(){return this.matrix},e.jitterProjectionMatrix=function(t,e){t=mt(J(),[t,e,0]);this.jitteredProjectionMatrix=ht(J(),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===_s.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===_s.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===_s.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===_s.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===_s.ORTHOGRAPHIC?this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far):this.projectionMode===_s.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=Ct(t.x-r,t.y-n,0),e=Ft(i,this.right)/Lt(this.right),r=Ft(i,this.up)/Lt(this.up);return this.pan(-e,-r),this},e.setPerspective=function(t,e,n,r){this.projectionMode=_s.PERSPECTIVE,this.fov=n,this.near=t,this.far=e,this.aspect=r;var i,a,o,s,n=this.near*Math.tan(Si(.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,dt(this.projectionMatrix,this.projectionMatrix,Ct(1,-1,1)),ct(this.projectionMatrixInverse,this.projectionMatrix),this.triggerUpdate(),this},e.setOrthographic=function(t,e,n,r,i,a){this.projectionMode=_s.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),St(this.projectionMatrix,s,n,r,e,i,a),dt(this.projectionMatrix,this.projectionMatrix,Ct(1,-1,1)),ct(this.projectionMatrixInverse,this.projectionMatrix),this._getOrthoMatrix(),this.triggerUpdate(),this},e.setPosition=function(t,e,n){t=Oi(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=Ct(0,1,0);return this.focalPoint=Oi(t,e,n),this.trackingMode===As.CINEMATIC&&(t=(r=It(v(),this.focalPoint,this.position))[0],e=r[1],n=r[2],r=Lt(r),e=Ai(Math.asin(e/r)),r=90+Ai(Math.atan2(n,t)),gt(n=J(),n,Si(r)),pt(n,n,Si(e)),i=Gt(v(),[0,1,0],n)),ct(this.matrix,At(J(),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=v(),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=Ei(t),this.computeMatrix(),this._getAxes(),this.type===Ss.ORBITING||this.type===Ss.EXPLORING?this._getPosition():this.type===Ss.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},e.getAzimuth=function(){return this.azimuth},e.setElevation=function(t){return this.elevation=Ei(t),this.computeMatrix(),this._getAxes(),this.type===Ss.ORBITING||this.type===Ss.EXPLORING?this._getPosition():this.type===Ss.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},e.getElevation=function(){return this.elevation},e.setRoll=function(t){return this.roll=Ei(t),this.computeMatrix(),this._getAxes(),this.type===Ss.ORBITING||this.type===Ss.EXPLORING?this._getPosition():this.type===Ss.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=Kt(Xt(),[0,0,1],Si(this.roll)),e=(rt(this.matrix),Kt(Xt(),[1,0,0],Si((this.rotateWorld&&this.type!==Ss.TRACKING||this.type===Ss.TRACKING?1:-1)*this.elevation))),n=Kt(Xt(),[0,1,0],Si((this.rotateWorld&&this.type!==Ss.TRACKING||this.type===Ss.TRACKING?1:-1)*this.azimuth)),n=Zt(Xt(),n,e),n=Zt(Xt(),n,t),e=kt(J(),n);this.type===Ss.ORBITING||this.type===Ss.EXPLORING?(ft(this.matrix,this.matrix,this.focalPoint),ht(this.matrix,this.matrix,e),ft(this.matrix,this.matrix,[0,0,this.distance])):this.type===Ss.TRACKING&&(ft(this.matrix,this.matrix,this.position),ht(this.matrix,this.matrix,e))},e._setPosition=function(t,e,n){this.position=Oi(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(){Nt(this.right,Oi(Ut($t(),[1,0,0,0],this.matrix))),Nt(this.up,Oi(Ut($t(),[0,1,0,0],this.matrix))),Nt(this.forward,Oi(Ut($t(),[0,0,1,0],this.matrix))),Dt(this.right,this.right),Dt(this.up,this.up),Dt(this.forward,this.forward)},e._getAngles=function(){var t=this.distanceVector[0],e=this.distanceVector[1],n=this.distanceVector[2],r=Lt(this.distanceVector);0===r?(this.elevation=0,this.azimuth=0):this.type===Ss.TRACKING||this.rotateWorld?(this.elevation=Ai(Math.asin(e/r)),this.azimuth=Ai(Math.atan2(-t,-n))):(this.elevation=-Ai(Math.asin(e/r)),this.azimuth=-Ai(Math.atan2(-t,-n)))},e._getPosition=function(){Nt(this.position,Oi(Ut($t(),[0,0,0,1],this.matrix))),this._getDistance()},e._getFocalPoint=function(){var t,e;Ht(this.distanceVector,[0,0,-this.distance],(t=Z(),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)),Rt(this.focalPoint,this.position,this.distanceVector),this._getDistance()},e._getDistance=function(){this.distanceVector=It(v(),this.focalPoint,this.position),this.distance=Lt(this.distanceVector),this.dollyingStep=this.distance/100},e._getOrthoMatrix=function(){var t,e;this.projectionMode===_s.ORTHOGRAPHIC&&(t=this.position,e=Kt(Xt(),[0,0,1],-this.roll*Math.PI/180),Mt(this.orthoMatrix,e,Ct((this.rright-this.left)/2-t[0],(this.top-this.bottom)/2-t[1],0),Ct(this.zoom,this.zoom,1),t))},e.triggerUpdate=function(){var t;this.enableUpdate&&(t=this.getViewTransform(),t=ht(J(),this.getPerspective(),t),this.getFrustum().extractFromVPMatrix(t),this.eventEmitter.emit(hl))},e.rotate=function(t,e,n){throw new Error(vi)},e.pan=function(t,e){throw new Error(vi)},e.dolly=function(t){throw new Error(vi)},e.createLandmark=function(t,e){throw new Error(vi)},e.gotoLandmark=function(t,e){throw new Error(vi)},e.cancelLandmarkAnimation=function(){throw new Error(vi)},t}(),dl=function(){function t(){}return t.prototype.update=function(t,e){t=t.r;return{width:2*t,height:2*t}},t}(),pl=function(){function t(){}return t.prototype.update=function(t,e){return{width:2*t.rx,height:2*t.ry}},t}(),gl=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}(),ml=function(){function t(){}return t.prototype.update=function(t){t=t.path.rect;return{width:t.width,height:t.height}},t}(),vl=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}(),yl=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&&!Ke(n)&&(r||(r=n.width,t.width=r),i||(i=n.height,t.height=i)),{width:r,height:i}},t}(),bl=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&&!A(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=_.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}(),xl=function(){function t(t,e){var c=this;this.globalRuntime=void 0,this.context=void 0,this.rootTarget=void 0,this.emitter=new Er,this.cursor="default",this.mappingTable={},this.mappingState={trackingData:{}},this.eventPool=new Map,this.pickHandler=void 0,this.tmpMatrix=J(),this.tmpVec3=v(),this.onPointerDown=function(t){var e,n=c.createPointerEvent(t);c.dispatchEvent(n,"pointerdown"),"touch"===n.pointerType?c.dispatchEvent(n,"touchstart"):"mouse"!==n.pointerType&&"pen"!==n.pointerType||(e=2===n.button,c.dispatchEvent(n,e?"rightdown":"mousedown")),c.trackingData(t.pointerId).pressTargetsByButton[t.button]=n.composedPath(),c.freeEvent(n)},this.onPointerUp=function(t){var e=performance.now(),n=c.createPointerEvent(t,void 0,void 0,c.context.config.alwaysTriggerPointerEventOnCanvas?c.rootTarget:void 0),r=(c.dispatchEvent(n,"pointerup"),"touch"===n.pointerType?c.dispatchEvent(n,"touchend"):"mouse"!==n.pointerType&&"pen"!==n.pointerType||(r=2===n.button,c.dispatchEvent(n,r?"rightup":"mouseup")),c.trackingData(t.pointerId)),i=c.findMountedTarget(r.pressTargetsByButton[t.button]),a=i;if(i&&!n.composedPath().includes(i)){for(var o,s=i;s&&!n.composedPath().includes(s);)n.currentTarget=s,c.notifyTarget(n,"pointerupoutside"),"touch"===n.pointerType?c.notifyTarget(n,"touchendoutside"):"mouse"!==n.pointerType&&"pen"!==n.pointerType||(o=2===n.button,c.notifyTarget(n,o?"rightupoutside":"mouseupoutside")),ps.isNode(s)&&(s=s.parentNode);delete r.pressTargetsByButton[t.button],a=s}a&&((i=c.clonePointerEvent(n,"click")).target=a,i.path=[],r.clicksByButton[t.button]||(r.clicksByButton[t.button]={clickCount:0,target:i.target,timeStamp:e}),(a=r.clicksByButton[t.button]).target===i.target&&e-a.timeStamp<200?++a.clickCount:a.clickCount=1,a.target=i.target,a.timeStamp=e,i.detail=a.clickCount,null!=(r=n.detail)&&r.preventClick||(c.context.config.useNativeClickEvent||"mouse"!==i.pointerType&&"touch"!==i.pointerType||c.dispatchEvent(i,"click"),c.dispatchEvent(i,"pointertap")),c.freeEvent(i)),c.freeEvent(n)},this.onPointerMove=function(t){var e=c.createPointerEvent(t,void 0,void 0,c.context.config.alwaysTriggerPointerEventOnCanvas?c.rootTarget:void 0),n="mouse"===e.pointerType||"pen"===e.pointerType,r=c.trackingData(t.pointerId),i=c.findMountedTarget(r.overTargets);if(r.overTargets&&i!==e.target){var a="mousemove"===t.type?"mouseout":"pointerout",a=c.createPointerEvent(t,a,i||void 0);if(c.dispatchEvent(a,"pointerout"),n&&c.dispatchEvent(a,"mouseout"),!e.composedPath().includes(i)){var o=c.createPointerEvent(t,"pointerleave",i||void 0);for(o.eventPhase=o.AT_TARGET;o.target&&!e.composedPath().includes(o.target);)o.currentTarget=o.target,c.notifyTarget(o),n&&c.notifyTarget(o,"mouseleave"),ps.isNode(o.target)&&(o.target=o.target.parentNode);c.freeEvent(o)}c.freeEvent(a)}if(i!==e.target){for(var a="mousemove"===t.type?"mouseover":"pointerover",t=c.clonePointerEvent(e,a),s=(c.dispatchEvent(t,"pointerover"),n&&c.dispatchEvent(t,"mouseover"),i&&ps.isNode(i)&&i.parentNode);s&&s!==(ps.isNode(c.rootTarget)&&c.rootTarget.parentNode)&&s!==e.target;)s=s.parentNode;if(!s||s===(ps.isNode(c.rootTarget)&&c.rootTarget.parentNode)){var l=c.clonePointerEvent(e,"pointerenter");for(l.eventPhase=l.AT_TARGET;l.target&&l.target!==i&&l.target!==(ps.isNode(c.rootTarget)&&c.rootTarget.parentNode);)l.currentTarget=l.target,c.notifyTarget(l),n&&c.notifyTarget(l,"mouseenter"),ps.isNode(l.target)&&(l.target=l.target.parentNode);c.freeEvent(l)}c.freeEvent(t)}c.dispatchEvent(e,"pointermove"),"touch"===e.pointerType&&c.dispatchEvent(e,"touchmove"),n&&(c.dispatchEvent(e,"mousemove"),c.cursor=c.getCursor(e.target)),r.overTargets=e.composedPath(),c.freeEvent(e)},this.onPointerOut=function(t){var e=c.trackingData(t.pointerId);if(e.overTargets){var n="mouse"===t.pointerType||"pen"===t.pointerType,r=c.findMountedTarget(e.overTargets),i=c.createPointerEvent(t,"pointerout",r||void 0),a=(c.dispatchEvent(i),n&&c.dispatchEvent(i,"mouseout"),c.createPointerEvent(t,"pointerleave",r||void 0));for(a.eventPhase=a.AT_TARGET;a.target&&a.target!==(ps.isNode(c.rootTarget)&&c.rootTarget.parentNode);)a.currentTarget=a.target,c.notifyTarget(a),n&&c.notifyTarget(a,"mouseleave"),ps.isNode(a.target)&&(a.target=a.target.parentNode);e.overTargets=null,c.freeEvent(i),c.freeEvent(a)}c.cursor=null},this.onPointerOver=function(t){var e=c.trackingData(t.pointerId),t=c.createPointerEvent(t),n="mouse"===t.pointerType||"pen"===t.pointerType,r=(c.dispatchEvent(t,"pointerover"),n&&c.dispatchEvent(t,"mouseover"),"mouse"===t.pointerType&&(c.cursor=c.getCursor(t.target)),c.clonePointerEvent(t,"pointerenter"));for(r.eventPhase=r.AT_TARGET;r.target&&r.target!==(ps.isNode(c.rootTarget)&&c.rootTarget.parentNode);)r.currentTarget=r.target,c.notifyTarget(r),n&&c.notifyTarget(r,"mouseenter"),ps.isNode(r.target)&&(r.target=r.target.parentNode);e.overTargets=t.composedPath(),c.freeEvent(t),c.freeEvent(r)},this.onPointerUpOutside=function(t){var e=c.trackingData(t.pointerId),n=c.findMountedTarget(e.pressTargetsByButton[t.button]),r=c.createPointerEvent(t);if(n){for(var i=n;i;)r.currentTarget=i,c.notifyTarget(r,"pointerupoutside"),"touch"===r.pointerType||"mouse"!==r.pointerType&&"pen"!==r.pointerType||c.notifyTarget(r,2===r.button?"rightupoutside":"mouseupoutside"),ps.isNode(i)&&(i=i.parentNode);delete e.pressTargetsByButton[t.button]}c.freeEvent(r)},this.onWheel=function(t){t=c.createWheelEvent(t);c.dispatchEvent(t),c.freeEvent(t)},this.onClick=function(t){c.context.config.useNativeClickEvent&&(t=c.createPointerEvent(t),c.dispatchEvent(t),c.freeEvent(t))},this.onPointerCancel=function(t){t=c.createPointerEvent(t,void 0,void 0,c.context.config.alwaysTriggerPointerEventOnCanvas?c.rootTarget:void 0);c.dispatchEvent(t),c.freeEvent(t)},this.globalRuntime=t,this.context=e}var e=t.prototype;return e.init=function(){this.rootTarget=this.context.renderingContext.root.parentNode,this.addEventMapping("pointerdown",this.onPointerDown),this.addEventMapping("pointerup",this.onPointerUp),this.addEventMapping("pointermove",this.onPointerMove),this.addEventMapping("pointerout",this.onPointerOut),this.addEventMapping("pointerleave",this.onPointerOut),this.addEventMapping("pointercancel",this.onPointerCancel),this.addEventMapping("pointerover",this.onPointerOver),this.addEventMapping("pointerupoutside",this.onPointerUpOutside),this.addEventMapping("wheel",this.onWheel),this.addEventMapping("click",this.onClick)},e.destroy=function(){this.emitter.removeAllListeners(),this.mappingTable={},this.mappingState={},this.eventPool.clear()},e.client2Viewport=function(t){var e=this.context.contextService.getBoundingClientRect();return new es(t.x-((null==e?void 0:e.left)||0),t.y-((null==e?void 0:e.top)||0))},e.viewport2Client=function(t){var e=this.context.contextService.getBoundingClientRect();return new es(t.x+((null==e?void 0:e.left)||0),t.y+((null==e?void 0:e.top)||0))},e.viewport2Canvas=function(t){var e=t.x,t=t.y,n=this.rootTarget.defaultView.getCamera(),r=this.context.config,i=r.width,r=r.height,a=n.getPerspectiveInverse(),n=n.getWorldTransform(),n=ht(this.tmpMatrix,n,a),a=jt(this.tmpVec3,e/i*2-1,2*(1-t/r)-1,0);return Gt(a,a,n),new es(a[0],a[1])},e.canvas2Viewport=function(t){var e=this.rootTarget.defaultView.getCamera(),n=e.getPerspective(),e=e.getViewTransform(),n=ht(this.tmpMatrix,n,e),e=jt(this.tmpVec3,t.x,t.y,0),t=(Gt(this.tmpVec3,this.tmpVec3,n),this.context.config),n=t.width,t=t.height;return new es((e[0]+1)/2*n,(1-(e[1]+1)/2)*t)},e.setPickHandler=function(t){this.pickHandler=t},e.addEventMapping=function(t,e){this.mappingTable[t]||(this.mappingTable[t]=[]),this.mappingTable[t].push({fn:e,priority:0}),this.mappingTable[t].sort(function(t,e){return t.priority-e.priority})},e.mapEvent=function(t){if(this.rootTarget){var e=this.mappingTable[t.type];if(e)for(var n=0,r=e.length;n<r;n++)e[n].fn(t);else console.warn("[EventService]: Event mapping not defined for "+t.type)}},e.dispatchEvent=function(t,e,n){n?(t.eventPhase=t.AT_TARGET,n=this.rootTarget.defaultView||null,t.currentTarget=n,this.notifyListeners(t,e)):(t.propagationStopped=!1,t.propagationImmediatelyStopped=!1,this.propagate(t,e)),this.emitter.emit(e||t.type,t)},e.propagate=function(t,e){if(t.target){var n=t.composedPath();t.eventPhase=t.CAPTURING_PHASE;for(var r=n.length-1;1<=r;r--)if(t.currentTarget=n[r],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return;if(t.eventPhase=t.AT_TARGET,t.currentTarget=t.target,this.notifyTarget(t,e),!t.propagationStopped&&!t.propagationImmediatelyStopped){var i=n.indexOf(t.currentTarget);t.eventPhase=t.BUBBLING_PHASE;for(var a=i+1;a<n.length;a++)if(t.currentTarget=n[a],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return}}},e.propagationPath=function(t){var e=[t],n=this.rootTarget.defaultView||null;if(n&&n===t)e.unshift(n.document);else{for(var r=0;r<2048&&t!==this.rootTarget;r++)ps.isNode(t)&&t.parentNode&&(e.push(t.parentNode),t=t.parentNode);n&&e.push(n)}return e},e.hitTest=function(t){var e=t.viewportX,n=t.viewportY,r=this.context.config,i=r.width,r=r.height;return!(e<0||n<0||i<e||r<n)&&(this.pickHandler(t)||this.rootTarget)||null},e.isNativeEventFromCanvas=function(t){var e=this.context.contextService.getDomElement(),n=null==(n=t.nativeEvent)?void 0:n.target;if(n){if(n===e)return!0;if(e&&e.contains)return e.contains(n)}return!!t.nativeEvent.composedPath&&-1<t.nativeEvent.composedPath().indexOf(e)},e.getExistedHTML=function(t){if(t.nativeEvent.composedPath)for(var e=Rr(t.nativeEvent.composedPath());!(n=e()).done;){var n=n.value,n=_.nativeHTMLMap.get(n);if(n)return n}return null},e.pickTarget=function(t){return this.hitTest({clientX:t.clientX,clientY:t.clientY,viewportX:t.viewportX,viewportY:t.viewportY,x:t.canvasX,y:t.canvasY})},e.createPointerEvent=function(t,e,n,r){var i=this.allocateEvent(ks),t=(this.copyPointerData(t,i),this.copyMouseData(t,i),this.copyData(t,i),i.nativeEvent=t.nativeEvent,i.originalEvent=t,this.getExistedHTML(i));return i.target=null!=n?n:t||this.isNativeEventFromCanvas(i)&&this.pickTarget(i)||r,"string"==typeof e&&(i.type=e),i},e.createWheelEvent=function(t){var e=this.allocateEvent(Es),t=(this.copyWheelData(t,e),this.copyMouseData(t,e),this.copyData(t,e),e.nativeEvent=t.nativeEvent,e.originalEvent=t,this.getExistedHTML(e));return e.target=t||this.isNativeEventFromCanvas(e)&&this.pickTarget(e),e},e.trackingData=function(t){return this.mappingState.trackingData[t]||(this.mappingState.trackingData[t]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[t]},e.cloneWheelEvent=function(t){var e=this.allocateEvent(Es);return e.nativeEvent=t.nativeEvent,e.originalEvent=t.originalEvent,this.copyWheelData(t,e),this.copyMouseData(t,e),this.copyData(t,e),e.target=t.target,e.path=t.composedPath().slice(),e.type=t.type,e},e.clonePointerEvent=function(t,e){var n=this.allocateEvent(ks);return n.nativeEvent=t.nativeEvent,n.originalEvent=t.originalEvent,this.copyPointerData(t,n),this.copyMouseData(t,n),this.copyData(t,n),n.target=t.target,n.path=t.composedPath().slice(),n.type=null!=e?e:n.type,n},e.copyPointerData=function(t,e){e.pointerId=t.pointerId,e.width=t.width,e.height=t.height,e.isPrimary=t.isPrimary,e.pointerType=t.pointerType,e.pressure=t.pressure,e.tangentialPressure=t.tangentialPressure,e.tiltX=t.tiltX,e.tiltY=t.tiltY,e.twist=t.twist},e.copyMouseData=function(t,e){e.altKey=t.altKey,e.button=t.button,e.buttons=t.buttons,e.ctrlKey=t.ctrlKey,e.metaKey=t.metaKey,e.shiftKey=t.shiftKey,e.client.copyFrom(t.client),e.movement.copyFrom(t.movement),e.canvas.copyFrom(t.canvas),e.screen.copyFrom(t.screen),e.global.copyFrom(t.global),e.offset.copyFrom(t.offset)},e.copyWheelData=function(t,e){e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ},e.copyData=function(t,e){e.isTrusted=t.isTrusted,e.timeStamp=performance.now(),e.type=t.type,e.detail=t.detail,e.view=t.view,e.page.copyFrom(t.page),e.viewport.copyFrom(t.viewport)},e.allocateEvent=function(t){this.eventPool.has(t)||this.eventPool.set(t,[]);t=this.eventPool.get(t).pop()||new t(this);return t.eventPhase=t.NONE,t.currentTarget=null,t.path=[],t.target=null,t},e.freeEvent=function(t){if(t.manager!==this)throw new Error("It is illegal to free an event not managed by this EventBoundary!");var e=t.constructor;this.eventPool.has(e)||this.eventPool.set(e,[]),this.eventPool.get(e).push(t)},e.notifyTarget=function(t,e){e=null!=(n=e)?n:t.type;var n=t.eventPhase===t.CAPTURING_PHASE||t.eventPhase===t.AT_TARGET?e+"capture":e;this.notifyListeners(t,n),t.eventPhase===t.AT_TARGET&&this.notifyListeners(t,e)},e.notifyListeners=function(t,e){var n=t.currentTarget.emitter,r=n._events[e];if(r)if("fn"in r)r.once&&n.removeListener(e,r.fn,void 0,!0),r.fn.call(t.currentTarget||r.context,t);else for(var i=0;i<r.length&&!t.propagationImmediatelyStopped;i++)r[i].once&&n.removeListener(e,r[i].fn,void 0,!0),r[i].fn.call(t.currentTarget||r[i].context,t)},e.findMountedTarget=function(t){if(!t)return null;for(var e=t[t.length-1],n=t.length-2;0<=n;n--){var r=t[n];if(!(r===this.rootTarget||ps.isNode(r)&&r.parentNode===e))break;e=t[n]}return e},e.getCursor=function(t){for(var e=t;e;){var n=ws.isElement(e)&&e.getAttribute("cursor");if(n)return n;e=ps.isNode(e)&&e.parentNode}},t}(),wl=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}(),Ml=((El=ul=ul||{})[El.CAMERA_CHANGED=0]="CAMERA_CHANGED",El[El.DISPLAY_OBJECT_CHANGED=1]="DISPLAY_OBJECT_CHANGED",El[El.NONE=2]="NONE",function(){function t(t,e){this.globalRuntime=void 0,this.context=void 0,this.inited=!1,this.stats={total:0,rendered:0},this.zIndexCounter=0,this.hooks={init:new Ea,initAsync:new Ma,dirtycheck:new Oa,cull:new Oa,beginFrame:new Ea,beforeRender:new Ea,render:new Ea,afterRender:new Ea,endFrame:new Ea,destroy:new Ea,pick:new ka,pickSync:new Oa,pointerDown:new Ea,pointerUp:new Ea,pointerMove:new Ea,pointerOut:new Ea,pointerOver:new Ea,pointerWheel:new Ea,pointerCancel:new Ea,click:new Ea},this.globalRuntime=t,this.context=e}var e=t.prototype;return e.init=function(t){var e=this,n=f({},this.globalRuntime,this.context);this.context.renderingPlugins.forEach(function(t){t.apply(n,_)}),this.hooks.init.call(),0===this.hooks.initAsync.getCallbacksNum()?(this.inited=!0,t()):this.hooks.initAsync.promise().then(function(){e.inited=!0,t()})},e.getStats=function(){return this.stats},e.disableDirtyRectangleRendering=function(){return!this.context.config.renderer.getConfig().enableDirtyRectangleRendering||this.context.renderingContext.renderReasons.has(ul.CAMERA_CHANGED)},e.render=function(t,e){var n=this,r=(this.stats.total=0,this.stats.rendered=0,this.zIndexCounter=0,this.context.renderingContext);this.globalRuntime.sceneGraphService.syncHierarchy(r.root),this.globalRuntime.sceneGraphService.triggerPendingEvents(),r.renderReasons.size&&this.inited&&(this.renderDisplayObject(r.root,t,r),this.hooks.beginFrame.call(),r.renderListCurrentFrame.forEach(function(t){n.hooks.beforeRender.call(t),n.hooks.render.call(t),n.hooks.afterRender.call(t)}),this.hooks.endFrame.call(),r.renderListCurrentFrame=[],r.renderReasons.clear(),e())},e.renderDisplayObject=function(t,e,n){var r=this,i=e.renderer.getConfig(),a=i.enableDirtyCheck,i=i.enableCulling,a=(this.globalRuntime.enableCSSParsing&&this.globalRuntime.styleValueRegistry.recalc(t),a?this.hooks.dirtycheck.call(t):t),a=(a&&(i=i?this.hooks.cull.call(a,this.context.camera):a)&&(this.stats.rendered++,n.renderListCurrentFrame.push(i)),t.renderable.dirty=!1,t.sortable.renderOrder=this.zIndexCounter++,this.stats.total++,t.sortable);a.dirty&&(this.sort(t,a),a.dirty=!1,a.dirtyChildren=[],a.dirtyReason=void 0),(a.sorted||t.childNodes).forEach(function(t){r.renderDisplayObject(t,e,n)})},e.sort=function(n,r){r.sorted&&r.dirtyReason!==Yo.Z_INDEX_CHANGED?r.dirtyChildren.forEach(function(t){var e;-1===n.childNodes.indexOf(t)?0<=(e=r.sorted.indexOf(t))&&r.sorted.splice(e,1):0===r.sorted.length?r.sorted.push(t):(e=function(t,e){for(var n=0,r=t.length;n<r;){var i=n+r>>>1;pi(t[i],e)<0?n=1+i:r=i}return n}(r.sorted,t),r.sorted.splice(e,0,t))}):r.sorted=n.childNodes.slice().sort(pi)},e.destroy=function(){this.inited=!1,this.hooks.destroy.call(),this.globalRuntime.sceneGraphService.clearPendingEvents()},e.dirtify=function(){this.context.renderingContext.renderReasons.add(ul.DISPLAY_OBJECT_CHANGED)},t}()),kl=/\[\s*(.*)=(.*)\s*\]/,El=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(kl),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),!A(t))&&t.toString?t.toString():""},t}();function Ol(t){t=t.renderable;t&&(t.renderBoundsDirty=!0,t.boundsDirty=!0)}var Sl,Al=new ms(x.REPARENT,null,"","","",0,"",""),_l=function(){function t(t){var o,i,a,r,s,l,c,u,h,n,f,d,g=this;this.runtime=void 0,this.pendingEvents=[],this.boundsChangedEvent=new fs(x.BOUNDS_CHANGED),this.rotate=(o=Xt(),function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=Ct(e,n,r));var i,a,n=t.transformable;null!==t.parentNode&&t.parentNode.transformable?(Jt(r=Xt(),e[0],e[1],e[2]),i=g.getRotation(t),a=g.getRotation(t.parentNode),ee(o,a),Qt(o,o),Zt(r,o,r),Zt(n.localRotation,r,i),re(n.localRotation,n.localRotation),g.dirtifyLocal(t,n)):g.rotateLocal(t,e)}),this.rotateLocal=(i=Xt(),function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=Ct(e,n,r));n=t.transformable;Jt(i,e[0],e[1],e[2]),ne(n.localRotation,n.localRotation,i),g.dirtifyLocal(t,n)}),this.setEulerAngles=(a=Xt(),function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=Ct(e,n,r));n=t.transformable;null!==t.parentNode&&t.parentNode.transformable?(Jt(n.localRotation,e[0],e[1],e[2]),r=g.getRotation(t.parentNode),ee(a,Qt(Xt(),r)),ne(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=Ct(e,n,r));var i,a,o,s,l,c,u,h,f,d,p,n=t.transformable;Yt(e,v())||(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*(f=l*c-o*i),l=l*(h=s*i-l*u)-o*d,o=o*f-s*h,f*=s=2*a,d*=s,l*=2,o*=2,r[0]=c+(h*=s)+(p*=2),r[1]=u+f+l,r[2]=i+d+o,Rt(n.localPosition,n.localPosition,e),g.dirtifyLocal(t,n))},this.setPosition=(r=J(),s=v(),function(t,e){var n=t.transformable;s[0]=e[0],s[1]=e[1],s[2]=e[2]||0,Yt(g.getPosition(t),s)||(Nt(n.position,s),null!==t.parentNode&&t.parentNode.transformable?(e=t.parentNode.transformable,et(r,e.worldTransform),ct(r,r),Gt(n.localPosition,s,r)):Nt(n.localPosition,s),g.dirtifyLocal(t,n))}),this.setLocalPosition=(l=v(),function(t,e){var n=t.transformable;l[0]=e[0],l[1]=e[1],l[2]=e[2]||0,Yt(n.localPosition,l)||(Nt(n.localPosition,l),g.dirtifyLocal(t,n))}),this.translate=(c=v(),u=v(),h=v(),function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),Yt(e="number"==typeof e?jt(u,e,n,r):e,c)||(Rt(h,g.getPosition(t),e),g.setPosition(t,h))}),this.setRotation=function(){var o=Xt();return function(t,e,n,r,i){var a=t.transformable;"number"==typeof e&&(e=te(e,n,r,i)),null!==t.parentNode&&t.parentNode.transformable?(n=g.getRotation(t.parentNode),ee(o,n),Qt(o,o),Zt(a.localRotation,o,e),re(a.localRotation,a.localRotation),g.dirtifyLocal(t,a)):g.setLocalRotation(t,e)}},this.displayObjectDependencyMap=new WeakMap,this.calcLocalTransform=(n=J(),f=v(),d=te(0,0,0,1),function(t){var e;0!==t.localSkew[0]||0!==t.localSkew[1]?(Mt(t.localTransform,t.localRotation,t.localPosition,Ct(1,1,1),t.origin),0===t.localSkew[0]&&0===t.localSkew[1]||((e=rt(n))[4]=Math.tan(t.localSkew[0]),e[1]=Math.tan(t.localSkew[1]),ht(t.localTransform,t.localTransform,e)),e=Mt(n,d,f,t.localScale,t.origin),ht(t.localTransform,t.localTransform,e)):Mt(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,A(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=Yo.ADDED),t.transformable);e&&this.dirtifyWorld(t,e),e.frozen&&this.unfreezeParentToRoot(t),r&&t.dispatchEvent(Al)},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=Yo.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=Ct(e,n,r));n=t.transformable;Jt(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=Ct(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=Ct(e[0],e[1],e[2]||n.localScale[2]);Yt(e,n.localScale)||(Nt(n.localScale,e),this.dirtifyLocal(t,n))},e.setLocalRotation=function(t,e,n,r,i){"number"==typeof e&&(e=te(e,n,r,i));n=t.transformable;ee(n.localRotation,e),this.dirtifyLocal(t,n)},e.setLocalSkew=function(t,e,n){"number"==typeof e&&(i=e,n=n,(r=new K(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;)Ol(n),n=n.parentNode;e&&t.forEach(function(t){Ol(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 ms(x.ATTR_MODIFIED,t,n,n,e,ms.MODIFICATION,n,n)),t.isCustomElement&&t.isConnected&&t.attributeChangedCallback&&t.attributeChangedCallback(e,n,n)})})},e.getPosition=function(t){var e=t.transformable;return bt(e.position,this.getWorldTransform(t,e))},e.getRotation=function(t){var e=t.transformable;return wt(e.rotation,this.getWorldTransform(t,e))},e.getScale=function(t){var e=t.transformable;return xt(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=bt(v(),e),r=wt(Xt(),e),e=xt(v(),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 Qo.isEmpty(e)?null:((n=n||new Qo).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 Qo},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 Qo).update(t.center,t.halfExtents))}),e&&(t=gi(t))&&(t=t.parsedStyle.clipPath.getBounds(e),r?t&&(r=t.intersection(r)):r=t),(r=r||new Qo)&&(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=J(),r=(t.parentNode.transformable&&(n=ct(J(),this.getWorldTransform(t.parentNode))),this.getBounds(t));if(!Qo.isEmpty(r))return(e=new Qo).setFromTransformedAABB(r,n),e}return this.getBounds(t)},e.getBoundingClientRect=function(t){var e,n,r,i=this.getGeometryBounds(t),i=(Qo.isEmpty(i)||(r=new Qo).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 ns(e+((null==i?void 0:i.left)||0),t+((null==i?void 0:i.top)||0),n-e,r-t)):new ns((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?ht(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}(),Tl={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]},Pl=/[a-zA-Z0-9\u00C0-\u00D6\u00D8-\u00f6\u00f8-\u00ff!"#$%&'()*+,-./:;]/,Ll=new RegExp(/[!%),.:;?\]}¢°·'""†‡›℃∶、。〃〆〕〗〞﹚﹜!"%'),.:;?!]}~]/.source+"|"+/[!),.:;?\]}¢·–—'"•"、。〆〞〕〉》」︰︱︲︳﹐﹑﹒﹔﹕﹖﹘﹚﹜!),.:;?︶︸︺︼︾﹀﹂﹗]|}、]/.source+"|"+/[)\]}〕〉》」』】〙〗〟'"⦆»ヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻‐゠–〜?!‼⁇⁈⁉・、:;,。.]/.source+"|"+/[!%),.:;?\]}¢°'"†‡℃〆〈《「『〕!%),.:;?]}]/.source),Cl=new RegExp(/[$(£¥·'"〈《「『【〔〖〝﹙﹛$(.[{£¥]/.source+"|"+/[([{£¥'"‵〈《「『〔〝︴﹙﹛({︵︷︹︻︽︿﹁﹃﹏]/.source+"|"+/[([{〔〈《「『【〘〖〝'"⦅«—...‥〳〴〵]/.source+"|"+/[$([{£¥'"々〇〉》」〔$([{⦆¥₩#]/.source),Nl=function(){function t(t){var n=this;this.runtime=void 0,this.fontMetricsCache={},this.shouldBreakByKinsokuShorui=function(t,e){return!n.isBreakingSpace(e)&&!(!t||!Cl.exec(e)&&!Ll.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,{willReadFrequently:!0}),i=(e.font=t,Tl.MetricsString+Tl.BaselineSymbol),a=Math.ceil(e.measureText(i).width),o=Math.ceil(e.measureText(Tl.BaselineSymbol).width),s=Tl.HeightMultiplier*o,o=o*Tl.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,h=0,f=!1,u=0;u<o;++u){for(var d=0;d<c;d+=4)if(255!==l[h+d]){f=!0;break}if(f)break;h+=c}for(n.ascent=o-u,h=r-c,f=!1,u=s;o<u;--u){for(var p=0;p<c;p+=4)if(255!==l[h+p]){f=!0;break}if(f)break;h-=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,h=(e.textPathSide,e.textPathStartOffset,e.leading),h=void 0===h?0:h,f=function(t){for(var e=t.fontSize,n=t.fontFamily,r=t.fontStyle,i=t.fontVariant,t=t.fontWeight,e=Qe(e)&&e+"px"||"16px",a=n.split(","),o=a.length-1;0<=o;o--){var s=a[o].trim();!Aa.test(s)&&Sa.indexOf(s)<0&&(s='"'+s+'"'),a[o]=s}return r+" "+i+" "+t+" "+e+" "+a.join(",")}(e),d=this.measureFont(f,n),p=(0===d.fontSize&&(d.fontSize=r,d.ascent=r),this.runtime.offscreenCanvas.getOrCreateContext(n));p.font=f,e.isOverflowing=!1;var g=(i?this.wordWrap(t,e,n):t).split(/(?:\r\n|\r|\n)/),m=new Array(g.length),v=0;if(!u){for(var y=0;y<g.length;y++){var b=p.measureText(g[y]).width+(g[y].length-1)*c;m[y]=b,v=Math.max(v,b)}var r=v+o,x=a||d.fontSize+o,i=Math.max(x,d.fontSize+o)+(g.length-1)*(x+h),w=0;return"middle"===s?w=-i/2:"bottom"===s||"alphabetic"===s||"ideographic"===s?w=-i:"top"!==s&&"hanging"!==s||(w=0),{font:f,width:r,height:i,lines:g,lineWidths:m,lineHeight:x+=h,maxLineWidth:v,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 ns(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="",h=("ellipsis"===o?u="...":o&&"clip"!==o&&(u=o),[]),f=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),v=Array.from(t),y=0;y<v.length;y++){var b=v[y],x=t[y-1],w=t[y+1],M=g(b);if(this.isNewline(b)){if(s<=++f){e.isOverflowing=!0;break}d=0,h[f]=""}else{if(0<d&&c<d+M){if(s<=f+1){if(e.isOverflowing=!0,0<m&&m<=c){for(var k=h[f].length,E=0,O=k,S=0;S<k;S++){var A=g(h[f][S]);if(c<E+A+m){O=S;break}E+=A}h[f]=(h[f]||"").slice(0,O)+u}break}if(d=0,h[++f]="",this.isBreakingSpace(b))continue;this.canBreakInLastChar(b)||(h=this.trimToBreakable(h),d=this.sumTextWidthByCache(h[f]||"",p)),this.shouldBreakByKinsokuShorui(b,w)&&(h=this.trimByKinsokuShorui(h),d+=g(x||""))}d+=M,h[f]=(h[f]||"")+b}}return h.join("\n")},e.isBreakingSpace=function(t){return"string"==typeof t&&0<=Tl.BreakingSpaces.indexOf(t.charCodeAt(0))},e.isNewline=function(t){return"string"==typeof t&&0<=Tl.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||!Pl.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(!Pl.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}(),_={},dl=(yl=new yl,vl=new vl,($v={})[M.CIRCLE]=new dl,$v[M.ELLIPSE]=new pl,$v[M.RECT]=yl,$v[M.IMAGE]=yl,$v[M.GROUP]=yl,$v[M.LINE]=new gl,$v[M.TEXT]=new bl(_),$v[M.POLYLINE]=vl,$v[M.POLYGON]=vl,$v[M.PATH]=new ml,$v[M.HTML]=null,$v[M.MESH]=null,$v),bl=(pl=new n,yl=new Vo,(gl={})[i.PERCENTAGE]=null,gl[i.NUMBER]=new Ko,gl[i.ANGLE]=new r,gl[i.DEFINED_PATH]=new e,gl[i.PAINT]=pl,gl[i.COLOR]=pl,gl[i.FILTER]=new Fo,gl[i.LENGTH]=yl,gl[i.LENGTH_PERCENTAGE]=yl,gl[i.LENGTH_PERCENTAGE_12]=new qo,gl[i.LENGTH_PERCENTAGE_14]=new $o,gl[i.COORDINATE]=new Uo,gl[i.OFFSET_DISTANCE]=new Zo,gl[i.OPACITY_VALUE]=new a,gl[i.PATH]=new rs,gl[i.LIST_OF_POINTS]=new is,gl[i.SHADOW_BLUR]=new as,gl[i.TEXT]=new os,gl[i.TEXT_TRANSFORM]=new ss,gl[i.TRANSFORM]=new ls,gl[i.TRANSFORM_ORIGIN]=new Wo,gl[i.Z_INDEX]=new cs,gl[i.MARKER]=new Xo,gl),vl=(_.CameraContribution=fl,_.AnimationTimeline=null,_.EasingFunction=null,_.offscreenCanvas=new wl,_.nativeHTMLMap=new WeakMap,_.sceneGraphSelector=new El,_.sceneGraphService=new _l(_),_.textService=new Nl(_),_.geometryUpdaterFactory=dl,_.CSSPropertySyntaxFactory=bl,_.styleValueRegistry=new Ms,_.layoutRegistry=null,_.globalThis=function(){if("undefined"!=typeof globalThis)return globalThis;if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==m)return m;throw new Error("Unable to locate global `this`")}(),_.enableCSSParsing=!0,_.enableDataset=!1,_.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}()),ml=function(){function t(t){this.plugins=[],this.config=void 0,this.config=f({enableDirtyCheck:!0,enableCulling:!1,enableAutoRendering:!0,enableDirtyRectangleRendering:!0,enableDirtyRectangleRenderingDebug:!1},t)}var e=t.prototype;return e.registerPlugin=function(e){-1===this.plugins.findIndex(function(t){return t===e})&&this.plugins.push(e)},e.unregisterPlugin=function(e){var t=this.plugins.findIndex(function(t){return t===e});-1<t&&this.plugins.splice(t,1)},e.getPlugins=function(){return this.plugins},e.getPlugin=function(e){return this.plugins.find(function(t){return t.name===e})},e.getConfig=function(){return this.config},e.setConfig=function(t){Object.assign(this.config,t)},t}(),jl=function(){function a(t){this.strategies=void 0,this.strategies=t}return a.prototype.apply=function(t){var n=t.camera,e=t.renderingService,r=t.renderingContext,i=this.strategies;e.hooks.cull.tap(a.tag,function(e){var t;return e&&(t=e.cullable,0===i.length?t.visible=-1<r.unculledEntities.indexOf(e.entity):t.visible=i.every(function(t){return t.isVisible(n,e)}),!e.isCulled()&&e.isVisible()?e:(e.dispatchEvent(new fs(x.CULLED)),null))}),e.hooks.afterRender.tap(a.tag,function(t){t.cullable.visibilityPlaneMask=-1})},a}(),Rl=(jl.tag="Culling",function(){function n(){}return n.prototype.apply=function(t){var e=t.renderingService;e.hooks.dirtycheck.tap(n.tag,function(t){return t&&(t.renderable.dirty||e.disableDirtyRectangleRendering()?t:null)})},n}()),Il=(Rl.tag="DirtyCheck",function(){function e(){var a=this;this.autoPreventDefault=!1,this.rootPointerEvent=new ks(null),this.rootWheelEvent=new Es(null),this.context=void 0,this.onPointerMove=function(t){var e,n=null==(e=a.context.renderingContext.root)||null==(e=e.ownerDocument)?void 0:e.defaultView;if(!n.supportsTouchEvents||"touch"!==t.pointerType){for(var r=Rr(a.normalizeToPointerEvent(t,n));!(i=r()).done;){var i=i.value,i=a.bootstrapEvent(a.rootPointerEvent,i,n,t);a.context.eventService.mapEvent(i)}a.setCursor(a.context.eventService.cursor)}},this.onClick=function(t){for(var e,n=null==(e=a.context.renderingContext.root)||null==(e=e.ownerDocument)?void 0:e.defaultView,r=Rr(a.normalizeToPointerEvent(t,n));!(i=r()).done;){var i=i.value,i=a.bootstrapEvent(a.rootPointerEvent,i,n,t);a.context.eventService.mapEvent(i)}a.setCursor(a.context.eventService.cursor)}}var t=e.prototype;return t.apply=function(t){var a=this,t=(this.context=t).renderingService,o=this.context.renderingContext.root.ownerDocument.defaultView;this.context.eventService.setPickHandler(function(t){return a.context.renderingService.hooks.pickSync.call({position:t,picked:[],topmost:!0}).picked[0]||null}),t.hooks.pointerWheel.tap(e.tag,function(t){t=a.normalizeWheelEvent(t);a.context.eventService.mapEvent(t)}),t.hooks.pointerDown.tap(e.tag,function(t){if(!o.supportsTouchEvents||"touch"!==t.pointerType){var e=a.normalizeToPointerEvent(t,o);!a.autoPreventDefault||!e[0].isNormalized||!t.cancelable&&"cancelable"in t||t.preventDefault();for(var n=Rr(e);!(r=n()).done;){var r=r.value,r=a.bootstrapEvent(a.rootPointerEvent,r,o,t);a.context.eventService.mapEvent(r)}a.setCursor(a.context.eventService.cursor)}}),t.hooks.pointerUp.tap(e.tag,function(t){if(!o.supportsTouchEvents||"touch"!==t.pointerType){var e=a.context.contextService.getDomElement(),n="outside";try{n=e&&t.target&&t.target!==e&&e.contains&&!e.contains(t.target)?"outside":""}catch(t){}for(var r=Rr(a.normalizeToPointerEvent(t,o));!(i=r()).done;){var i=i.value,i=a.bootstrapEvent(a.rootPointerEvent,i,o,t);i.type+=n,a.context.eventService.mapEvent(i)}a.setCursor(a.context.eventService.cursor)}}),t.hooks.pointerMove.tap(e.tag,this.onPointerMove),t.hooks.pointerOver.tap(e.tag,this.onPointerMove),t.hooks.pointerOut.tap(e.tag,this.onPointerMove),t.hooks.click.tap(e.tag,this.onClick),t.hooks.pointerCancel.tap(e.tag,function(t){for(var e=Rr(a.normalizeToPointerEvent(t,o));!(n=e()).done;){var n=n.value,n=a.bootstrapEvent(a.rootPointerEvent,n,o,t);a.context.eventService.mapEvent(n)}a.setCursor(a.context.eventService.cursor)})},t.getViewportXY=function(t){var e,n=t.offsetX,r=t.offsetY,i=t.clientX,t=t.clientY;return t=!this.context.config.supportsCSSTransform||A(n)||A(r)?(e=(i=this.context.eventService.client2Viewport(new es(i,t))).x,i.y):(e=n,r),{x:e,y:t}},t.bootstrapEvent=function(t,e,n,r){t.view=n,t.originalEvent=null,t.nativeEvent=r,t.pointerId=e.pointerId,t.width=e.width,t.height=e.height,t.isPrimary=e.isPrimary,t.pointerType=e.pointerType,t.pressure=e.pressure,t.tangentialPressure=e.tangentialPressure,t.tiltX=e.tiltX,t.tiltY=e.tiltY,t.twist=e.twist,this.transferMouseData(t,e);n=this.getViewportXY(e),e=n.x,n=n.y,t.viewport.x=e,t.viewport.y=n,e=this.context.eventService.viewport2Canvas(t.viewport),n=e.x,e=e.y;return t.canvas.x=n,t.canvas.y=e,t.global.copyFrom(t.canvas),t.offset.copyFrom(t.canvas),t.isTrusted=r.isTrusted,"pointerleave"===t.type&&(t.type="pointerout"),t.type.startsWith("mouse")&&(t.type=t.type.replace("mouse","pointer")),t.type.startsWith("touch")&&(t.type=bi[t.type]||t.type),t},t.normalizeWheelEvent=function(t){var e=this.rootWheelEvent,n=(this.transferMouseData(e,t),e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ,this.getViewportXY(t)),r=n.x,n=n.y,r=(e.viewport.x=r,e.viewport.y=n,this.context.eventService.viewport2Canvas(e.viewport)),n=r.x,r=r.y;return e.canvas.x=n,e.canvas.y=r,e.global.copyFrom(e.canvas),e.offset.copyFrom(e.canvas),e.nativeEvent=t,e.type=t.type,e},t.transferMouseData=function(t,e){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=performance.now(),t.type=e.type,t.altKey=e.altKey,t.metaKey=e.metaKey,t.shiftKey=e.shiftKey,t.ctrlKey=e.ctrlKey,t.button=e.button,t.buttons=e.buttons,t.client.x=e.clientX,t.client.y=e.clientY,t.movement.x=e.movementX,t.movement.y=e.movementY,t.page.x=e.pageX,t.page.y=e.pageY,t.screen.x=e.screenX,t.screen.y=e.screenY,t.relatedTarget=null},t.setCursor=function(t){this.context.contextService.applyCursorStyle(t||this.context.config.cursor||"default")},t.normalizeToPointerEvent=function(t,e){var n=[];if(e.isTouchEvent(t))for(var r=0;r<t.changedTouches.length;r++){var i=t.changedTouches[r];on(i.button)&&(i.button=0),on(i.buttons)&&(i.buttons=1),on(i.isPrimary)&&(i.isPrimary=1===t.touches.length&&"touchstart"===t.type),on(i.width)&&(i.width=i.radiusX||1),on(i.height)&&(i.height=i.radiusY||1),on(i.tiltX)&&(i.tiltX=0),on(i.tiltY)&&(i.tiltY=0),on(i.pointerType)&&(i.pointerType="touch"),on(i.pointerId)&&(i.pointerId=i.identifier||0),on(i.pressure)&&(i.pressure=i.force||.5),on(i.twist)&&(i.twist=0),on(i.tangentialPressure)&&(i.tangentialPressure=0),i.isNormalized=!0,i.type=t.type,n.push(i)}else e.isMouseEvent(t)?(on((e=t).isPrimary)&&(e.isPrimary=!0),on(e.width)&&(e.width=1),on(e.height)&&(e.height=1),on(e.tiltX)&&(e.tiltX=0),on(e.tiltY)&&(e.tiltY=0),on(e.pointerType)&&(e.pointerType="mouse"),on(e.pointerId)&&(e.pointerId=1),on(e.pressure)&&(e.pressure=.5),on(e.twist)&&(e.twist=0),on(e.tangentialPressure)&&(e.tangentialPressure=0),e.isNormalized=!0,n.push(e)):n.push(t);return n},e}()),Bl=(Il.tag="Event",[M.CIRCLE,M.ELLIPSE,M.IMAGE,M.RECT,M.LINE,M.POLYLINE,M.POLYGON,M.TEXT,M.PATH,M.HTML]),Dl=function(){function t(){}var e=t.prototype;return e.isVisible=function(t,e){var n,r,i=e.cullable;return!i.enable||(n=e.getRenderBounds(),!Qo.isEmpty(n)&&(t=t.getFrustum(),r=null==(r=e.parentNode)||null==(r=r.cullable)?void 0:r.visibilityPlaneMask,i.visibilityPlaneMask=this.computeVisibilityWithPlaneMask(e,n,r||Go.INDETERMINATE,t.planes),i.visible=i.visibilityPlaneMask!==Go.OUTSIDE,i.visible))},e.computeVisibilityWithPlaneMask=function(t,e,n,r){if(n===Go.OUTSIDE||n===Go.INSIDE)return n;for(var i=Go.INSIDE,a=-1<Bl.indexOf(t.nodeName),o=0,s=r.length;o<s;++o){var l=1<<o;if(0!=(n&l)&&(!a||4!==o&&5!==o)){var c=r[o],u=c.normal,c=c.distance;if(Ft(u,e.getPositiveFarPoint(r[o]))+c<0)return Go.OUTSIDE;Ft(u,e.getNegativeFarPoint(r[o]))+c<0&&(i|=l)}}return i},t}(),Fl=function(){function c(){this.rBush=void 0,this.toSync=new Set}var t=c.prototype;return t.apply=function(t){function e(t){t.target.renderable.dirty=!0,o.dirtify()}function n(t){for(var e=t.detail.affectChildren,t=t.target,n=(e&&t.forEach(function(t){a.toSync.add(t)}),t);n;)n.renderable&&a.toSync.add(n),n=n.parentElement;o.dirtify()}function r(t){t=t.target,_.enableCSSParsing&&_.styleValueRegistry.recalc(t),_.sceneGraphService.dirtifyToRoot(t),o.dirtify()}function i(t){var e=(t=t.target).rBushNode;e.aabb&&a.rBush.remove(e.aabb),a.toSync.delete(t),_.sceneGraphService.dirtifyToRoot(t),o.dirtify()}var a=this,o=t.renderingService,s=t.renderingContext,t=t.rBushRoot,l=s.root.ownerDocument.defaultView;this.rBush=t;o.hooks.init.tap(c.tag,function(){l.addEventListener(x.MOUNTED,r),l.addEventListener(x.UNMOUNTED,i),l.addEventListener(x.ATTR_MODIFIED,e),l.addEventListener(x.BOUNDS_CHANGED,n)}),o.hooks.destroy.tap(c.tag,function(){l.removeEventListener(x.MOUNTED,r),l.removeEventListener(x.UNMOUNTED,i),l.removeEventListener(x.ATTR_MODIFIED,e),l.removeEventListener(x.BOUNDS_CHANGED,n),a.toSync.clear()}),o.hooks.endFrame.tap(c.tag,function(){a.syncRTree()})},t.syncRTree=function(){var o=this,s=[];Array.from(this.toSync).filter(function(t){return t.isConnected}).forEach(function(t){var e,n,r,i=t.rBushNode,a=(i&&i.aabb&&o.rBush.remove(i.aabb),t.getRenderBounds());a&&(e=(n=a.getMin())[0],n=n[1],r=(a=a.getMax())[0],a=a[1],i.aabb||(i.aabb={}),i.aabb.displayObject=t,i.aabb.minX=e,i.aabb.minY=n,i.aabb.maxX=r,i.aabb.maxY=a),!i.aabb||isNaN(i.aabb.maxX)||isNaN(i.aabb.maxX)||isNaN(i.aabb.minX)||isNaN(i.aabb.minY)||s.push(i.aabb)}),this.rBush.load(s),s.length=0,this.toSync.clear()},c}(),zl=(Fl.tag="Prepare",($v=Sl=Sl||{}).READY="ready",$v.BEFORE_RENDER="beforerender",$v.RERENDER="rerender",$v.AFTER_RENDER="afterrender",$v.BEFORE_DESTROY="beforedestroy",$v.AFTER_DESTROY="afterdestroy",$v.RESIZE="resize",$v.DIRTY_RECTANGLE="dirtyrectangle",$v.RENDERER_CHANGED="rendererchanged",new fs(x.MOUNTED)),Wl=new fs(x.UNMOUNTED),Gl=new fs(Sl.BEFORE_RENDER),Hl=new fs(Sl.RERENDER),Yl=new fs(Sl.AFTER_RENDER),Vl=function(E){function t(t){var e=E.call(this)||this,n=(e.document=void 0,e.customElements=void 0,e.requestAnimationFrame=void 0,e.cancelAnimationFrame=void 0,e.devicePixelRatio=void 0,e.supportsPointerEvents=void 0,e.supportsTouchEvents=void 0,e.isTouchEvent=void 0,e.isMouseEvent=void 0,e.Element=js,e.frameId=void 0,e.inited=!1,e.readyPromise=void 0,e.resolveReadyPromise=void 0,e.context={},e.document=new gs,e.document.defaultView=Nr(e),e.customElements=new us,t.container),r=t.canvas,i=t.offscreenCanvas,a=t.width,o=t.height,s=t.devicePixelRatio,l=t.renderer,c=t.background,u=t.cursor,h=t.document,f=t.requestAnimationFrame,d=t.cancelAnimationFrame,p=t.createImage,g=t.supportsPointerEvents,m=t.supportsTouchEvents,v=t.supportsCSSTransform,y=t.useNativeClickEvent,b=t.alwaysTriggerPointerEventOnCanvas,x=t.isTouchEvent,t=t.isMouseEvent,w=(w=n,M=Nr(e),w&&(w="string"==typeof w?w:w.id||fi++,hi[w]&&hi[w].destroy(),hi[w]=M),a),M=o,k=s;return r&&(k=1<=(k=s||di&&window.devicePixelRatio||1)?Math.ceil(k):1,w=a||("auto"===(a=mi(s=r,"width"))?s.offsetWidth:parseFloat(a))||r.width/k,M=o||("auto"===(a=mi(s=r,"height"))?s.offsetHeight:parseFloat(a))||r.height/k),e.devicePixelRatio=k,e.requestAnimationFrame=null!=f?f:Da.bind(_.globalThis),e.cancelAnimationFrame=null!=d?d:Fa.bind(_.globalThis),e.supportsTouchEvents=null!=m?m:"ontouchstart"in _.globalThis,e.supportsPointerEvents=null!=g?g:!!_.globalThis.PointerEvent,e.isTouchEvent=null!=x?x:function(t){return e.supportsTouchEvents&&t instanceof _.globalThis.TouchEvent},e.isMouseEvent=null!=t?t:function(t){return!_.globalThis.MouseEvent||t instanceof _.globalThis.MouseEvent&&(!e.supportsPointerEvents||!(t instanceof _.globalThis.PointerEvent))},e.initRenderingContext({container:n,canvas:r,width:w,height:M,renderer:l,offscreenCanvas:i,devicePixelRatio:k,cursor:u||"default",background:c||"transparent",createImage:p,document:h,supportsCSSTransform:v,useNativeClickEvent:y,alwaysTriggerPointerEventOnCanvas:b}),e.initDefaultCamera(w,M),e.initRenderer(l,!0),e}Pr(t,E);var e=t.prototype;return e.initRenderingContext=function(t){this.context.config=t,this.context.renderingContext={root:this.document.documentElement,renderListCurrentFrame:[],unculledEntities:[],renderReasons:new Set,force:!1,dirty:!1}},e.initDefaultCamera=function(t,e){var n=this,r=new _.CameraContribution;r.setType(Ss.EXPLORING,As.DEFAULT).setPosition(t/2,e/2,500).setFocalPoint(t/2,e/2,0).setOrthographic(t/-2,t/2,e/2,e/-2,.1,1e3),r.canvas=this,r.eventEmitter.on(hl,function(){n.context.renderingContext.renderReasons.add(ul.CAMERA_CHANGED)}),this.context.camera=r},e.getConfig=function(){return this.context.config},e.getRoot=function(){return this.document.documentElement},e.getCamera=function(){return this.context.camera},e.getContextService=function(){return this.context.contextService},e.getEventService=function(){return this.context.eventService},e.getRenderingService=function(){return this.context.renderingService},e.getRenderingContext=function(){return this.context.renderingContext},e.getStats=function(){return this.getRenderingService().getStats()},e.destroy=function(t,e){void 0===t&&(t=!0),(e=void 0===e?!1:e)||this.dispatchEvent(new fs(Sl.BEFORE_DESTROY)),this.frameId&&(this.getConfig().cancelAnimationFrame||cancelAnimationFrame)(this.frameId);var n=this.getRoot();this.unmountChildren(n),t&&(this.document.destroy(),this.getEventService().destroy()),this.getRenderingService().destroy(),this.getContextService().destroy(),t&&this.context.rBushRoot&&(this.context.rBushRoot.clear(),this.context.rBushRoot=null,this.context.renderingContext.root=null),e||this.dispatchEvent(new fs(Sl.AFTER_DESTROY))},e.changeSize=function(t,e){this.resize(t,e)},e.resize=function(t,e){var n=this.context.config,n=(n.width=t,n.height=e,this.getContextService().resize(t,e),this.context.camera),r=n.getProjectionMode();n.setPosition(t/2,e/2,500).setFocalPoint(t/2,e/2,0),r===_s.ORTHOGRAPHIC?n.setOrthographic(t/-2,t/2,e/2,e/-2,n.getNear(),n.getFar()):n.setAspect(t/e),this.dispatchEvent(new fs(Sl.RESIZE,{width:t,height:e}))},e.appendChild=function(t,e){return this.document.documentElement.appendChild(t,e)},e.insertBefore=function(t,e){return this.document.documentElement.insertBefore(t,e)},e.removeChild=function(t){return this.document.documentElement.removeChild(t)},e.removeChildren=function(){this.document.documentElement.removeChildren()},e.destroyChildren=function(){this.document.documentElement.destroyChildren()},e.render=function(){var t=this;this.dispatchEvent(Gl),this.getRenderingService().render(this.getConfig(),function(){t.dispatchEvent(Hl)}),this.dispatchEvent(Yl)},e.run=function(){var e=this;(function t(){e.render(),e.frameId=e.requestAnimationFrame(t)})()},e.initRenderer=function(t,e){var n=this;if(void 0===e&&(e=!1),!t)throw new Error("Renderer is required.");this.inited=!1,this.readyPromise=void 0,this.context.rBushRoot=new U,this.context.renderingPlugins=[],this.context.renderingPlugins.push(new Il,new Fl,new Rl,new jl([new Dl])),this.loadRendererContainerModule(t),this.context.contextService=new this.context.ContextService(f({},_,this.context)),this.context.renderingService=new Ml(_,this.context),this.context.eventService=new xl(_,this.context),this.context.eventService.init(),this.context.contextService.init?(this.context.contextService.init(),this.initRenderingService(t,e,!0)):this.context.contextService.initAsync().then(function(){n.initRenderingService(t,e)})},e.initRenderingService=function(t,e,n){var r=this;void 0===e&&(e=!1),void 0===n&&(n=!1),this.context.renderingService.init(function(){r.inited=!0,e?(n?r.requestAnimationFrame(function(){r.dispatchEvent(new fs(Sl.READY))}):r.dispatchEvent(new fs(Sl.READY)),r.readyPromise&&r.resolveReadyPromise()):r.dispatchEvent(new fs(Sl.RENDERER_CHANGED)),e||r.getRoot().forEach(function(t){t=t.renderable;t&&(t.renderBoundsDirty=!0,t.boundsDirty=!0,t.dirty=!0)}),r.mountChildren(r.getRoot()),t.getConfig().enableAutoRendering&&r.run()})},e.loadRendererContainerModule=function(t){var e=this;t.getPlugins().forEach(function(t){t.context=e.context,t.init(_)})},e.setRenderer=function(t){var e,n=this.getConfig();n.renderer!==t&&(e=n.renderer,n.renderer=t,this.destroy(!1,!0),[].concat(null==e?void 0:e.getPlugins()).reverse().forEach(function(t){t.destroy(_)}),this.initRenderer(t))},e.setCursor=function(t){this.getConfig().cursor=t,this.getContextService().applyCursorStyle(t)},e.unmountChildren=function(t){var e=this;t.childNodes.forEach(function(t){e.unmountChildren(t)}),this.inited&&(t.isMutationObserved?t.dispatchEvent(Wl):(Wl.target=t,this.dispatchEvent(Wl,!0)),t!==this.document.documentElement&&(t.ownerDocument=null),t.isConnected=!1),t.isCustomElement&&t.disconnectedCallback&&t.disconnectedCallback()},e.mountChildren=function(t){var e=this;this.inited?t.isConnected||(t.ownerDocument=this.document,t.isConnected=!0,t.isMutationObserved?t.dispatchEvent(zl):(zl.target=t,this.dispatchEvent(zl,!0))):console.warn("[g]: You are trying to call `canvas.appendChild` before canvas' initialization finished. You can either await `canvas.ready` or listen to `CanvasEvent.READY` manually.","appended child: ",t.nodeName),t.childNodes.forEach(function(t){e.mountChildren(t)}),t.isCustomElement&&t.connectedCallback&&t.connectedCallback()},e.client2Viewport=function(t){return this.getEventService().client2Viewport(t)},e.viewport2Client=function(t){return this.getEventService().viewport2Client(t)},e.viewport2Canvas=function(t){return this.getEventService().viewport2Canvas(t)},e.canvas2Viewport=function(t){return this.getEventService().canvas2Viewport(t)},e.getPointByClient=function(t,e){return this.client2Viewport({x:t,y:e})},e.getClientByPoint=function(t,e){return this.viewport2Client({x:t,y:e})},Tr(t,[{key:"ready",get:function(){var e=this;return this.readyPromise||(this.readyPromise=new Promise(function(t){e.resolveReadyPromise=function(){t(e)}}),this.inited&&this.resolveReadyPromise()),this.readyPromise}}]),t}(ds);function ql(t,e){return(ql=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}n=function(i){var t;function e(){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).landmarks=[],t.landmarkAnimationID=void 0,t}t=i,(n=e).prototype=Object.create(t.prototype),ql(n.prototype.constructor=n,t);var n=e.prototype;return n.rotate=function(t,e,n){if(this.relElevation=Ei(e),this.relAzimuth=Ei(t),this.relRoll=Ei(n),this.elevation+=this.relElevation,this.azimuth+=this.relAzimuth,this.roll+=this.relRoll,this.type===Ss.EXPLORING){e=Kt(Xt(),[1,0,0],Si((this.rotateWorld?1:-1)*this.relElevation)),t=Kt(Xt(),[0,1,0],Si((this.rotateWorld?1:-1)*this.relAzimuth)),n=Kt(Xt(),[0,0,1],Si(this.relRoll)),t=Zt(Xt(),t,e),t=Zt(Xt(),t,n),e=kt(J(),t);ft(this.matrix,this.matrix,[0,0,-this.distance]),ht(this.matrix,this.matrix,e),ft(this.matrix,this.matrix,[0,0,this.distance])}else{if(90<Math.abs(this.elevation))return this;this.computeMatrix()}return this._getAxes(),this.type===Ss.ORBITING||this.type===Ss.EXPLORING?this._getPosition():this.type===Ss.TRACKING&&this._getFocalPoint(),this._update(),this},n.pan=function(t,e){t=Oi(t,e,0),e=Pt(this.position);return Rt(e,e,Bt(v(),this.right,t[0])),Rt(e,e,Bt(v(),this.up,t[1])),this._setPosition(e),this.triggerUpdate(),this},n.dolly=function(t){var e=this.forward,n=Pt(this.position),t=(this.dollyingStep,this.distance+t*this.dollyingStep),t=Math.max(Math.min(t,this.maxDistance),this.minDistance)-this.distance;return n[0]+=t*e[0],n[1]+=t*e[1],n[2]+=t*e[2],this._setPosition(n),this.type===Ss.ORBITING||this.type===Ss.EXPLORING?this._getDistance():this.type===Ss.TRACKING&&Rt(this.focalPoint,n,this.distanceVector),this.triggerUpdate(),this},n.cancelLandmarkAnimation=function(){void 0!==this.landmarkAnimationID&&this.canvas.cancelAnimationFrame(this.landmarkAnimationID)},n.createLandmark=function(t,e){var n,e=e=void 0===e?{}:e,r=e.position,r=void 0===r?this.position:r,i=e.focalPoint,i=void 0===i?this.focalPoint:i,a=e.roll,e=e.zoom,o=new _.CameraContribution,r=(o.setType(this.type,void 0),o.setPosition(r[0],null!=(n=r[1])?n:this.position[1],null!=(n=r[2])?n:this.position[2]),o.setFocalPoint(i[0],null!=(r=i[1])?r:this.focalPoint[1],null!=(n=i[2])?n:this.focalPoint[2]),o.setRoll(null!=a?a:this.roll),o.setZoom(null!=e?e:this.zoom),{name:t,matrix:tt(o.getWorldTransform()),right:Pt(o.right),up:Pt(o.up),forward:Pt(o.forward),position:Pt(o.getPosition()),focalPoint:Pt(o.getFocalPoint()),distanceVector:Pt(o.getDistanceVector()),distance:o.getDistance(),dollyingStep:o.getDollyingStep(),azimuth:o.getAzimuth(),elevation:o.getElevation(),roll:o.getRoll(),relAzimuth:o.relAzimuth,relElevation:o.relElevation,relRoll:o.relRoll,zoom:o.getZoom()});return this.landmarks.push(r),r},n.gotoLandmark=function(e,t){var n,s,r,i,l,c,u,h,f,d,p,g,m=this,a=(void 0===t&&(t={}),Ke(e)?this.landmarks.find(function(t){return t.name===e}):e);a&&(n=void 0===(n=(t=Qe(t)?{duration:t}:t).easing)?"linear":n,r=t.duration,s=void 0===r?100:r,r=void 0===(r=t.easingFunction)?void 0:r,t=t.onfinish,i=void 0===t?void 0:t,l=.01,0===s?(this.syncFromLandmark(a),i&&i()):(this.cancelLandmarkAnimation(),c=a.position,u=a.focalPoint,h=a.zoom,f=a.roll,d=r||_.EasingFunction(n),g=function(){m.setFocalPoint(u),m.setPosition(c),m.setRoll(f),m.setZoom(h),m.computeMatrix(),m.triggerUpdate(),i&&i()},this.canvas.requestAnimationFrame(function t(e){var n,r,i,a,o,e=e-(p=void 0===p?e:p);s<e||(n=d(e/s),r=v(),i=v(),a=1,o=0,Wt(r,m.focalPoint,u,n),Wt(i,m.position,c,n),o=m.roll*(1-n)+f*n,a=m.zoom*(1-n)+h*n,m.setFocalPoint(r),m.setPosition(i),m.setRoll(o),m.setZoom(a),Vt(r,u)+Vt(i,c)<=l&&null==h&&null==f)?g():(m.computeMatrix(),m.triggerUpdate(),e<s&&(m.landmarkAnimationID=m.canvas.requestAnimationFrame(t)))})))},n.syncFromLandmark=function(t){this.matrix=et(this.matrix,t.matrix),this.right=Nt(this.right,t.right),this.up=Nt(this.up,t.up),this.forward=Nt(this.forward,t.forward),this.position=Nt(this.position,t.position),this.focalPoint=Nt(this.focalPoint,t.focalPoint),this.distanceVector=Nt(this.distanceVector,t.distanceVector),this.azimuth=t.azimuth,this.elevation=t.elevation,this.roll=t.roll,this.relAzimuth=t.relAzimuth,this.relElevation=t.relElevation,this.relRoll=t.relRoll,this.dollyingStep=t.dollyingStep,this.distance=t.distance,this.zoom=t.zoom},e}(fl);function $l(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 Ul(t,e,n){e&&$l(t.prototype,e),n&&$l(t,n),Object.defineProperty(t,"prototype",{writable:!1})}function Xl(t,e){return(Xl=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}_.CameraContribution=n;function Kl(b,e,x,n){if(!(0<=b&&b<=1&&0<=x&&x<=1))throw new Error("bezier x values must be in [0, 1] range");if(b===e&&x===n)return function(t){return t};for(var w=new(xc?Float32Array:Array)(11),t=0;t<11;++t)w[t]=Ec(.1*t,b,x);function r(t){for(var e=0,n=1;10!==n&&w[n]<=t;++n)e+=.1;var r=e+.1*((t-w[--n])/(w[n+1]-w[n])),i=Oc(r,b,x);if(.001<=i){for(var a=t,o=r,s=b,l=x,c=0;c<vc;++c){var u=Oc(o,s,l);if(0===u)return o;o-=(Ec(o,s,l)-a)/u}return o}if(0===i)return r;for(var h,f,d=t,p=e,g=e+.1,m=b,v=x,y=0;0<(h=Ec(f=p+(g-p)/2,m,v)-d)?g=f:p=f,Math.abs(h)>yc&&++y<bc;);return f}return function(t){return 0===t||1===t?t:Ec(r(t),e,n)}}function Zl(t){return Math.pow(t,2)}function Ql(t){return Math.pow(t,3)}function Jl(t){return Math.pow(t,4)}function tc(t){return Math.pow(t,5)}function ec(t){return Math.pow(t,6)}function nc(t){return 1-Math.cos(t*Math.PI/2)}function rc(t){return 1-Math.sqrt(1-t*t)}function ic(t){return t*t*(3*t-2)}function ac(t){for(var e,n=4;t<((e=Math.pow(2,--n))-1)/11;);return 1/Math.pow(4,3-n)-7.5625*Math.pow((3*e-2)/22-t,2)}function oc(t,e){var n=(e=e=void 0===e?[]:e)[0],e=void 0===(e=e[1])?.5:e,n=Ze(Number(void 0===n?1:n),1,10),e=Ze(Number(e),.1,2);return 0===t||1===t?t:-n*Math.pow(2,10*(t-1))*Math.sin((t-1-e/(2*Math.PI)*Math.asin(1/n))*(2*Math.PI)/e)}function sc(t,e,n){var r=(e=e=void 0===e?[]:e)[0],i=void 0===(i=e[1])?100:i,a=void 0===(a=e[2])?10:a,e=void 0===(e=e[3])?0:e,r=Ze(void 0===r?1:r,.1,1e3),i=Ze(i,.1,1e3),a=Ze(a,.1,1e3),e=Ze(e,.1,1e3),o=Math.sqrt(i/r),i=(a=a/(2*Math.sqrt(i*r)))<1?o*Math.sqrt(1-a*a):0,r=a<1?(a*o-e)/i:-e+o,e=n?n*t/1e3:t,e=a<1?Math.exp(-e*a*o)*(+Math.cos(i*e)+r*Math.sin(i*e)):(1+r*e)*Math.exp(-e*o);return 0===t||1===t?t:1-e}function lc(t,e){var e=e=void 0===e?[]:e,n=void 0===(n=e[0])?10:n;return("start"==e[1]?Math.ceil:Math.floor)(Ze(t,0,1)*n)/n}function cc(t,e){var n=(e=e=void 0===e?[]:e)[0],r=e[1],i=e[2],e=e[3];return Kl(n,r,i,e)(t)}function uc(r){return function(t,e,n){return 1-r(1-t,e=void 0===e?[]:e,n)}}function hc(r){return function(t,e,n){return void 0===e&&(e=[]),t<.5?r(2*t,e,n)/2:1-r(-2*t+2,e,n)/2}}function fc(r){return function(t,e,n){return void 0===e&&(e=[]),t<.5?(1-r(1-2*t,e,n))/2:(r(2*t-1,e,n)+1)/2}}function dc(t){return t}var pc=function(i){var t,e;function n(t,e,n,r){t=i.call(this,t)||this;return t.currentTime=void 0,t.timelineTime=void 0,t.currentTime=n,t.timelineTime=r,t.target=e,t.type="finish",t.bubbles=!1,t.currentTarget=e,t.defaultPrevented=!1,t.eventPhase=t.AT_TARGET,t.timeStamp=Date.now(),t.currentTime=n,t.timelineTime=r,t}return e=i,(t=n).prototype=Object.create(e.prototype),Xl(t.prototype.constructor=t,e),n}(hs),gc=0,mc=function(){function t(t,e){this.effect=void 0,this.timeline=void 0,this.id=void 0,this.currentTimePending=!1,this._idle=!0,this._paused=!1,this._finishedFlag=!0,this.oldPlayState=void 0,this._holdTime=void 0,this.readyPromise=void 0,this.finishedPromise=void 0,this.resolveReadyPromise=void 0,this.rejectReadyPromise=void 0,this.resolveFinishedPromise=void 0,this.rejectFinishedPromise=void 0,this.onfinish=void 0,this.oncancel=void 0,this.onframe=void 0,this._currentTime=0,this._startTime=void 0,this._playbackRate=1,this._totalDuration=void 0,this._inEffect=void 0,this._inTimeline=!0,this.onremove=void 0,((this.effect=t).animation=this).timeline=e,this.id=""+gc++,this._inEffect=!!this.effect.update(0),this._totalDuration=Number(null==(t=this.effect)?void 0:t.getComputedTiming().endTime),this._holdTime=0,this._paused=!1,this.oldPlayState="idle",this.updatePromises()}var e=t.prototype;return e.updatePromises=function(){var t=this.oldPlayState,e=this.pending?"pending":this.playState;return this.readyPromise&&e!==t&&("idle"===e?(this.rejectReadyPromise(),this.readyPromise=void 0):"pending"===t?this.resolveReadyPromise():"pending"===e&&(this.readyPromise=void 0)),this.finishedPromise&&e!==t&&("idle"===e?(this.rejectFinishedPromise(),this.finishedPromise=void 0):"finished"===e?this.resolveFinishedPromise():"finished"===t&&(this.finishedPromise=void 0)),this.oldPlayState=e,this.readyPromise||this.finishedPromise},e.play=function(){this.updatePromises(),this._paused=!1,(this._isFinished||this._idle)&&(this.rewind(),this._startTime=null),this._finishedFlag=!1,this._idle=!1,this.ensureAlive(),this.timeline.applyDirtiedAnimation(this),-1===this.timeline.animations.indexOf(this)&&this.timeline.animations.push(this),this.updatePromises()},e.pause=function(){this.updatePromises(),this.currentTime&&(this._holdTime=this.currentTime),this._isFinished||this._paused||this._idle?this._idle&&(this.rewind(),this._idle=!1):this.currentTimePending=!0,this._startTime=null,this._paused=!0,this.updatePromises()},e.finish=function(){this.updatePromises(),this._idle||(this.currentTime=0<this._playbackRate?this._totalDuration:0,this._startTime=this._totalDuration-this.currentTime,this.currentTimePending=!1,this.timeline.applyDirtiedAnimation(this),this.updatePromises())},e.cancel=function(){var t,e=this;this.updatePromises(),this._inEffect&&(this._inEffect=!1,this._idle=!0,this._paused=!1,this._finishedFlag=!0,this._currentTime=0,this._startTime=null,this.effect.update(null),this.timeline.applyDirtiedAnimation(this),this.updatePromises(),this.oncancel)&&(t=new pc(null,this,this.currentTime,null),setTimeout(function(){e.oncancel(t)}))},e.reverse=function(){this.updatePromises();var t=this.currentTime;this.playbackRate*=-1,this.play(),null!==t&&(this.currentTime=t),this.updatePromises()},e.updatePlaybackRate=function(t){this.playbackRate=t},e.targetAnimations=function(){var t;return(null==(t=this.effect)?void 0:t.target).getAnimations()},e.markTarget=function(){var t=this.targetAnimations();-1===t.indexOf(this)&&t.push(this)},e.unmarkTarget=function(){var t=this.targetAnimations(),e=t.indexOf(this);-1!==e&&t.splice(e,1)},e.tick=function(t,e){this._idle||this._paused||(null===this._startTime?e&&(this.startTime=t-this._currentTime/this.playbackRate):this._isFinished||this.tickCurrentTime((t-this._startTime)*this.playbackRate)),e&&(this.currentTimePending=!1,this.fireEvents(t))},e.rewind=function(){if(0<=this.playbackRate)this.currentTime=0;else{if(!(this._totalDuration<1/0))throw new Error("Unable to rewind negative playback rate animation with infinite duration");this.currentTime=this._totalDuration}},e.persist=function(){throw new Error(vi)},e.addEventListener=function(t,e,n){throw new Error(vi)},e.removeEventListener=function(t,e,n){throw new Error(vi)},e.dispatchEvent=function(t){throw new Error(vi)},e.commitStyles=function(){throw new Error(vi)},e.ensureAlive=function(){var t;this.playbackRate<0&&0===this.currentTime?this._inEffect=!(null==(t=this.effect)||!t.update(-1)):this._inEffect=!(null==(t=this.effect)||!t.update(this.currentTime)),this._inTimeline||!this._inEffect&&this._finishedFlag||(this._inTimeline=!0,this.timeline.animations.push(this))},e.tickCurrentTime=function(t,e){t!==this._currentTime&&(this._currentTime=t,this._isFinished&&!e&&(this._currentTime=0<this._playbackRate?this._totalDuration:0),this.ensureAlive())},e.fireEvents=function(t){var e,n=this;this._isFinished?this._finishedFlag||(this.onfinish&&(e=new pc(null,this,this.currentTime,t),setTimeout(function(){n.onfinish&&n.onfinish(e)})),this._finishedFlag=!0):(this.onframe&&"running"===this.playState&&(t=new pc(null,this,this.currentTime,t),this.onframe(t)),this._finishedFlag=!1)},Ul(t,[{key:"pending",get:function(){return null===this._startTime&&!this._paused&&0!==this.playbackRate||this.currentTimePending}},{key:"playState",get:function(){return this._idle?"idle":this._isFinished?"finished":this._paused?"paused":"running"}},{key:"ready",get:function(){var n=this;return this.readyPromise||(-1===this.timeline.animationsWithPromises.indexOf(this)&&this.timeline.animationsWithPromises.push(this),this.readyPromise=new Promise(function(t,e){n.resolveReadyPromise=function(){t(n)},n.rejectReadyPromise=function(){e(new Error)}}),this.pending)||this.resolveReadyPromise(),this.readyPromise}},{key:"finished",get:function(){var n=this;return this.finishedPromise||(-1===this.timeline.animationsWithPromises.indexOf(this)&&this.timeline.animationsWithPromises.push(this),this.finishedPromise=new Promise(function(t,e){n.resolveFinishedPromise=function(){t(n)},n.rejectFinishedPromise=function(){e(new Error)}}),"finished"===this.playState&&this.resolveFinishedPromise()),this.finishedPromise}},{key:"currentTime",get:function(){return this.updatePromises(),this._idle||this.currentTimePending?null:this._currentTime},set:function(t){var e;t=Number(t),isNaN(t)||(this.timeline.restart(),this._paused||null===this._startTime||(this._startTime=Number(null==(e=this.timeline)?void 0:e.currentTime)-t/this.playbackRate),this.currentTimePending=!1,this._currentTime!==t&&(this._idle&&(this._idle=!1,this._paused=!0),this.tickCurrentTime(t,!0),this.timeline.applyDirtiedAnimation(this)))}},{key:"startTime",get:function(){return this._startTime},set:function(t){null!==t&&(this.updatePromises(),t=Number(t),isNaN(t)||this._paused||this._idle||(this._startTime=t,this.tickCurrentTime((Number(this.timeline.currentTime)-this._startTime)*this.playbackRate),this.timeline.applyDirtiedAnimation(this),this.updatePromises()))}},{key:"playbackRate",get:function(){return this._playbackRate},set:function(t){var e;t!==this._playbackRate&&(this.updatePromises(),e=this.currentTime,this._playbackRate=t,this.startTime=null,"paused"!==this.playState&&"idle"!==this.playState&&(this._finishedFlag=!1,this._idle=!1,this.ensureAlive(),this.timeline.applyDirtiedAnimation(this)),null!==e&&(this.currentTime=e),this.updatePromises())}},{key:"_isFinished",get:function(){return!this._idle&&(0<this._playbackRate&&Number(this._currentTime)>=this._totalDuration||this._playbackRate<0&&Number(this._currentTime)<=0)}},{key:"totalDuration",get:function(){return this._totalDuration}},{key:"_needsTick",get:function(){return this.pending||"running"===this.playState||!this._finishedFlag}}]),t}(),vc=4,yc=1e-7,bc=10,xc="function"==typeof Float32Array,wc=function(t,e){return 1-3*e+3*t},Mc=function(t,e){return 3*e-6*t},kc=function(t){return 3*t},Ec=function(t,e,n){return((wc(e,n)*t+Mc(e,n))*t+kc(e))*t},Oc=function(t,e,n){return 3*wc(e,n)*t*t+2*Mc(e,n)*t+kc(e)},Vo=Kl(.42,0,1,1),Sc={steps:lc,"step-start":function(t){return lc(t,[1,"start"])},"step-end":function(t){return lc(t,[1,"end"])},linear:function(t){return t},"cubic-bezier":cc,ease:function(t){return cc(t,[.25,.1,.25,1])},in:Vo,out:uc(Vo),"in-out":hc(Vo),"out-in":fc(Vo),"in-quad":Zl,"out-quad":uc(Zl),"in-out-quad":hc(Zl),"out-in-quad":fc(Zl),"in-cubic":Ql,"out-cubic":uc(Ql),"in-out-cubic":hc(Ql),"out-in-cubic":fc(Ql),"in-quart":Jl,"out-quart":uc(Jl),"in-out-quart":hc(Jl),"out-in-quart":fc(Jl),"in-quint":tc,"out-quint":uc(tc),"in-out-quint":hc(tc),"out-in-quint":fc(tc),"in-expo":ec,"out-expo":uc(ec),"in-out-expo":hc(ec),"out-in-expo":fc(ec),"in-sine":nc,"out-sine":uc(nc),"in-out-sine":hc(nc),"out-in-sine":fc(nc),"in-circ":rc,"out-circ":uc(rc),"in-out-circ":hc(rc),"out-in-circ":fc(rc),"in-back":ic,"out-back":uc(ic),"in-out-back":hc(ic),"out-in-back":fc(ic),"in-bounce":ac,"out-bounce":uc(ac),"in-out-bounce":hc(ac),"out-in-bounce":fc(ac),"in-elastic":oc,"out-elastic":uc(oc),"in-out-elastic":hc(oc),"out-in-elastic":fc(oc),spring:sc,"spring-in":sc,"spring-out":uc(sc),"spring-in-out":hc(sc),"spring-out-in":fc(sc)},Ac=function(t){return("-"===(t=(t=t).replace(/([A-Z])/g,function(t){return"-"+t.toLowerCase()})).charAt(0)?t.substring(1):t).replace(/^ease-/,"").replace(/(\(|\s).+/,"").toLowerCase().trim()};function _c(n,r){return function(t){var e;return 1<=t?1:(t+=r*(e=1/n))-t%e}}var Ko="\\s*(-?\\d+\\.?\\d*|-?\\.\\d+)\\s*",Tc=new RegExp("cubic-bezier\\("+Ko+","+Ko+","+Ko+","+Ko+"\\)"),Pc=/steps\(\s*(\d+)\s*\)/,Lc=/steps\(\s*(\d+)\s*,\s*(start|middle|end)\s*\)/;function Cc(t){var e=Tc.exec(t);return e?Kl.apply(void 0,e.slice(1).map(Number)):(e=Pc.exec(t))?_c(Number(e[1]),0):(e=Lc.exec(t))?_c(Number(e[1]),{start:1,middle:.5,end:0}[e[2]]):Sc[Ac(t)]||Sc.linear}function Nc(t){return Math.abs((0!==(e=t).duration&&0!==e.iterations?("auto"===e.duration?0:Number(e.duration))*(null!=(e=e.iterations)?e:1):0)/(t.playbackRate||1));var e}var jc=0,Rc=1,Ic=2,Bc=3;function Dc(t,e,n){c=t,i=n;var r,i,a,o,s,l=null===(l=e)?jc:(r=i.endTime,l<Math.min(i.delay,r)?Rc:l>=Math.min(i.delay+c+i.endDelay,r)?Ic:Bc),c=function(t,e,n,r,i){switch(r){case Rc:return"backwards"===e||"both"===e?0:null;case Bc:return n-i;case Ic:return"forwards"===e||"both"===e?t:null;case jc:return null}}(t,n.fill,e,l,n.delay);return null===c?null:(i="auto"===n.duration?0:n.duration,r=i,t=l,e=n.iterations,o=c,s=n.iterationStart,0===r?t!==Rc&&(s+=e):s+=o/r,e=t=s,o=n.iterationStart,s=l,a=n.iterations,c=c,i=i,e=o=0!==(o=e===1/0?o%1:e%1)||s!==Ic||0===a||0===c&&0!==i?o:1,s=n.iterations,a=e,c=t,i=l===Ic&&s===1/0?1/0:1===a?Math.floor(c)-1:Math.floor(c),o=n.direction,t=i,l=e,a="normal"===(s="normal"!==(s=o)&&"reverse"!==o&&(t=t,"alternate-reverse"===o&&(t+=1),s="normal",t!==1/0)&&t%2!=0?"reverse":s)?l:1-l,n.currentIteration=i,n.progress=a,n.easingFunction(a))}function Fc(t,e,n){var a=function(t,e){for(var n={},r=0;r<t.length;r++)for(var i in t[r]){var a;zc(i)&&(a={offset:t[r].offset,computedOffset:t[r].computedOffset,easing:t[r].easing,easingFunction:Cc(t[r].easing)||e.easingFunction,value:t[r][i]},n[i]=n[i]||[],n[i].push(a))}return n}(t,e),o=function(t,e){var n,r=[];for(n in t)for(var i=t[n],a=0;a<i.length-1;a++){var o=a,s=a+1,l=i[o].computedOffset,c=i[s].computedOffset,u=l,h=c;0===a&&(u=-1/0,0===c)&&(s=o),a===i.length-2&&(h=1/0,1===l)&&(o=s),r.push({applyFrom:u,applyTo:h,startOffset:i[o].computedOffset,endOffset:i[s].computedOffset,easingFunction:i[o].easingFunction,property:n,interpolation:function(t,e,n,r){var i=ll[t];if(i&&i.syntax&&i.int){i=_.styleValueRegistry.getPropertySyntax(i.syntax);if(i){o=_.enableCSSParsing?(a=_.styleValueRegistry.parseProperty(t,e,r),o=_.styleValueRegistry.parseProperty(t,n,r),a=_.styleValueRegistry.computeProperty(t,a,r),_.styleValueRegistry.computeProperty(t,o,r)):(t=i.parserWithCSSDisabled,a=t?t(e,r):e,t?t(n,r):n);var a,o,s,t=i.mixer(a,o,r);if(t)return s=Wc.apply(void 0,t),function(t){return 0===t?e:1===t?n:s(t)}}}return Wc(!1,!0,function(t){return t?n:e})}(n,i[o].value,i[s].value,e)})}return r.sort(function(t,e){return t.startOffset-e.startOffset}),r}(a,n);return function(r,i){if(null!==i)o.filter(function(t){return i>=t.applyFrom&&i<t.applyTo}).forEach(function(t){var e=i-t.startOffset,n=t.endOffset-t.startOffset,e=0==n?0:t.easingFunction(e/n);r.setAttribute(t.property,t.interpolation(e))});else for(var t in a)zc(t)&&r.setAttribute(t,null)}}function zc(t){return"offset"!==t&&"easing"!==t&&"composite"!==t&&"computedOffset"!==t}var Wc=function(e,n,r){return function(t){t=function t(e,n,r){if("number"==typeof e&&"number"==typeof n)return e*(1-r)+n*r;if("boolean"==typeof e&&"boolean"==typeof n||"string"==typeof e&&"string"==typeof n)return r<.5?e:n;if(Array.isArray(e)&&Array.isArray(n)){for(var i=e.length,a=n.length,o=Math.max(i,a),s=[],l=0;l<o;l++)s.push(t(e[l<i?l:i-1],n[l<a?l:a-1],r));return s}throw new Error("Mismatched interpolation arguments "+e+":"+n)}(e,n,t);return!_.enableCSSParsing&&Qe(t)?t:r(t)}};var Gc=function(){function t(){this.delay=0,this.direction="normal",this.duration="auto",this._easing="linear",this.easingFunction=dc,this.endDelay=0,this.fill="auto",this.iterationStart=0,this.iterations=1,this.playbackRate=void 0,this.effect=void 0,this.composite=void 0,this.activeDuration=void 0,this.endTime=void 0,this.currentIteration=null,this.progress=null}return Ul(t,[{key:"easing",get:function(){return this._easing},set:function(t){this.easingFunction=Cc(t),this._easing=t}}]),t}();function Hc(t,i){if(null===t)return[];for(var e=(t=Array.isArray(t)?t:function(t){var e,n=[];for(e in t)if(!(e in["easing","offset","composite"]))for(var r,i=t[e],a=(i=Array.isArray(i)?i:[i]).length,o=0;o<a;o++)n[o]||(r={},"offset"in t&&(r.offset=Number(t.offset)),"easing"in t&&(r.easing=t.easing),"composite"in t&&(r.composite=t.composite),n[o]=r),void 0!==i[o]&&null!==i[o]&&(n[o][e]=i[o]);return n.sort(function(t,e){return(t.computedOffset||0)-(e.computedOffset||0)}),n}(t)).map(function(t){var e,n={};for(e in null!=i&&i.composite&&(n.composite="auto"),t){var r=t[e];if("offset"===e){if(null!==r){if(r=Number(r),!isFinite(r))throw new Error("Keyframe offsets must be numbers.");if(r<0||1<r)throw new Error("Keyframe offsets must be between 0 and 1.");n.computedOffset=r}}else if("composite"===e&&-1===["replace","add","accumulate","auto"].indexOf(r))throw new Error(r+" compositing is not supported");n[e]=r}return void 0===n.offset&&(n.offset=null),void 0===n.easing&&(n.easing=(null==i?void 0:i.easing)||"linear"),void 0===n.composite&&(n.composite="auto"),n}),n=!0,r=-1/0,a=0;a<e.length;a++){var o=e[a].offset;if(A(o))n=!1;else{if(o<r)throw new TypeError("Keyframes are not loosely sorted by offset. Sort or specify offsets.");r=o}}if(e=e.filter(function(t){return 0<=Number(t.offset)&&Number(t.offset)<=1}),!n)for(var s=e.length,l=(e[s-1].computedOffset=Number(null!=(t=e[s-1].offset)?t:1),1<s&&(e[0].computedOffset=Number(null!=(t=e[0].offset)?t:0)),0),c=Number(e[0].computedOffset),u=1;u<s;u++){var h=e[u].computedOffset;if(!A(h)&&!A(c)){for(var f=1;f<u-l;f++)e[l+f].computedOffset=c+(Number(h)-c)*f/(u-l);l=u,c=Number(h)}}return e}var Yc="backwards|forwards|both|none".split("|"),Vc="reverse|alternate|alternate-reverse".split("|");function qc(t,e){var n,r,i;return t=function(t){"number"==typeof t&&(t=isNaN(t)?{duration:"auto"}:{duration:t});return t}(null!=(r=t)?r:{duration:"auto"}),n=t,r=e,i=new Gc,r&&(i.fill="both",i.duration="auto"),"number"!=typeof n||isNaN(n)?void 0!==n&&Object.keys(n).forEach(function(t){void 0===n[t]||null===n[t]||"auto"===n[t]||!("number"!=typeof i[t]&&"duration"!==t||"number"==typeof n[t]&&!isNaN(n[t]))||"fill"===t&&-1===Yc.indexOf(n[t])||"direction"===t&&-1===Vc.indexOf(n[t])||(i[t]=n[t])}):i.duration=n,i}var $c=function(){function t(t,e,n){var r=this,t=(this.composite="replace",this.iterationComposite="replace",this.target=void 0,this.animation=void 0,this.timing=void 0,this.computedTiming=void 0,this.normalizedKeyframes=void 0,this.timeFraction=void 0,this.interpolations=void 0,this.target=t,this.timing=qc(n,!1),(this.timing.effect=this).timing.activeDuration=Nc(this.timing),this.timing.endTime=Math.max(0,this.timing.delay+this.timing.activeDuration+this.timing.endDelay),this.normalizedKeyframes=Hc(e,this.timing),this.interpolations=Fc(this.normalizedKeyframes,this.timing,this.target),_.globalThis.Proxy);this.computedTiming=t?new t(this.timing,{get:function(t,e){return"duration"===e?"auto"===t.duration?0:t.duration:"fill"===e?"auto"===t.fill?"none":t.fill:"localTime"===e?r.animation&&r.animation.currentTime||null:"currentIteration"===e?r.animation&&"running"===r.animation.playState?t.currentIteration||0:null:"progress"===e?r.animation&&"running"===r.animation.playState?t.progress||0:null:t[e]},set:function(){return!0}}):this.timing}var e=t.prototype;return e.applyInterpolations=function(){this.interpolations(this.target,Number(this.timeFraction))},e.update=function(t){return null!==t&&(this.timeFraction=Dc(this.timing.activeDuration,t,this.timing),null!==this.timeFraction)},e.getKeyframes=function(){return this.normalizedKeyframes},e.setKeyframes=function(t){this.normalizedKeyframes=Hc(t)},e.getComputedTiming=function(){return this.computedTiming},e.getTiming=function(){return this.timing},e.updateTiming=function(e){var n=this;Object.keys(e||{}).forEach(function(t){n.timing[t]=e[t]})},t}();function Uc(t,e){return Number(t.id)-Number(e.id)}r=function(){function t(t){var n=this;this.document=void 0,this.animations=[],this.ticking=!1,this.timelineTicking=!1,this.hasRestartedThisFrame=!1,this.animationsWithPromises=[],this.inTick=!1,this.pendingEffects=[],this.currentTime=null,this.rafId=0,this.rafCallbacks=[],this.frameId=void 0,this.webAnimationsNextTick=function(t){n.currentTime=t,n.discardAnimations(),0===n.animations.length?n.timelineTicking=!1:n.requestAnimationFrame(n.webAnimationsNextTick)},this.processRafCallbacks=function(e){var t=n.rafCallbacks;n.rafCallbacks=[],e<Number(n.currentTime)&&(e=Number(n.currentTime)),n.animations.sort(Uc),n.animations=n.tick(e,!0,n.animations)[0],t.forEach(function(t){t[1](e)}),n.applyPendingEffects()},this.document=t}var e=t.prototype;return e.getAnimations=function(){return this.discardAnimations(),this.animations.slice()},e.isTicking=function(){return this.inTick},e.play=function(t,e,n){t=new $c(t,e,n),e=new mc(t,this);return this.animations.push(e),this.restartWebAnimationsNextTick(),e.updatePromises(),e.play(),e.updatePromises(),e},e.applyDirtiedAnimation=function(t){var e=this;this.inTick||(t.markTarget(),(t=t.targetAnimations()).sort(Uc),this.tick(Number(this.currentTime),!1,t.slice())[1].forEach(function(t){t=e.animations.indexOf(t);-1!==t&&e.animations.splice(t,1)}),this.applyPendingEffects())},e.restart=function(){return this.ticking||(this.ticking=!0,this.requestAnimationFrame(function(){}),this.hasRestartedThisFrame=!0),this.hasRestartedThisFrame},e.destroy=function(){this.document.defaultView.cancelAnimationFrame(this.frameId)},e.applyPendingEffects=function(){this.pendingEffects.forEach(function(t){null!=t&&t.applyInterpolations()}),this.pendingEffects=[]},e.updateAnimationsPromises=function(){this.animationsWithPromises=this.animationsWithPromises.filter(function(t){return t.updatePromises()})},e.discardAnimations=function(){this.updateAnimationsPromises(),this.animations=this.animations.filter(function(t){return"finished"!==t.playState&&"idle"!==t.playState})},e.restartWebAnimationsNextTick=function(){this.timelineTicking||(this.timelineTicking=!0,this.requestAnimationFrame(this.webAnimationsNextTick))},e.rAF=function(t){var e=this.rafId++;return 0===this.rafCallbacks.length&&(this.frameId=this.document.defaultView.requestAnimationFrame(this.processRafCallbacks)),this.rafCallbacks.push([e,t]),e},e.requestAnimationFrame=function(e){var n=this;return this.rAF(function(t){n.updateAnimationsPromises(),e(t),n.updateAnimationsPromises()})},e.tick=function(n,r,t){var i=this,a=(this.inTick=!0,this.hasRestartedThisFrame=!1,this.currentTime=n,this.ticking=!1,[]),o=[],s=[],l=[];return t.forEach(function(t){t.tick(n,r),t._inEffect?(o.push(t.effect),t.markTarget()):(a.push(t.effect),t.unmarkTarget()),t._needsTick&&(i.ticking=!0);var e=t._inEffect||t._needsTick;((t._inTimeline=e)?s:l).push(t)}),(t=this.pendingEffects).push.apply(t,a),(t=this.pendingEffects).push.apply(t,o),this.ticking&&this.requestAnimationFrame(function(){}),this.inTick=!1,[s,l]},t}();_.EasingFunction=Cc,_.AnimationTimeline=r;const Xc="main-layer",Kc="label-layer",Zc="element",Qc="view",Jc="plot",tu="component",eu="label",nu="area";function ru(t,e){return(ru=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function iu(t,e){e=e.r;t.arc(e,e,e,0,2*Math.PI,!1)}function au(t,e){var n,r,i=e.rx,e=e.ry;t.ellipse?t.ellipse(i,e,i,e,0,0,2*Math.PI,!1):(n=e<i?i:e,r=e<i?1:i/e,e=e<i?e/i:1,t.save(),t.scale(r,e),t.arc(0,0,n,0,2*Math.PI))}function ou(t,e){var n,r,i=e.x1,a=e.y1,o=e.x2,s=e.y2,l=e.defX,l=void 0===l?0:l,c=e.defY,c=void 0===c?0:c,u=e.markerStart,h=e.markerEnd,f=e.markerStartOffset,e=e.markerEndOffset,d=0,p=0,g=0,m=0,v=0;u&&Os(u)&&f&&(n=o-i,r=s-a,v=Math.atan2(r,n),d=Math.cos(v)*(f||0),p=Math.sin(v)*(f||0)),h&&Os(h)&&e&&(n=i-o,r=a-s,v=Math.atan2(r,n),g=Math.cos(v)*(e||0),m=Math.sin(v)*(e||0)),t.moveTo(i-l+d,a-c+p),t.lineTo(o-l+g,s-c+m)}function su(t,e){var n,r,i=e.defX,a=void 0===i?0:i,i=e.defY,o=void 0===i?0:i,i=e.markerStart,s=e.markerEnd,l=e.markerStartOffset,c=e.markerEndOffset,e=e.path,u=e.absolutePath,h=e.segments,f=0,d=0,p=0,g=0,e=0;i&&Os(i)&&l&&(r=(i=i.parentNode.getStartTangent())[0],i=i[1],n=r[0]-i[0],r=r[1]-i[1],e=Math.atan2(r,n),f=Math.cos(e)*(l||0),d=Math.sin(e)*(l||0)),s&&Os(s)&&c&&(l=(i=s.parentNode.getEndTangent())[0],s=i[1],n=l[0]-s[0],r=l[1]-s[1],e=Math.atan2(r,n),p=Math.cos(e)*(c||0),g=Math.sin(e)*(c||0));for(var m=0;m<u.length;m++){var v=u[m],y=v[0],b=u[m+1],x=0===m&&(0!==f||0!==d),w=(m===u.length-1||b&&("M"===b[0]||"Z"===b[0]))&&0!==p&&0!==g;switch(y){case"M":x?(t.moveTo(v[1]-a+f,v[2]-o+d),t.lineTo(v[1]-a,v[2]-o)):t.moveTo(v[1]-a,v[2]-o);break;case"L":w?t.lineTo(v[1]-a+p,v[2]-o+g):t.lineTo(v[1]-a,v[2]-o);break;case"Q":t.quadraticCurveTo(v[1]-a,v[2]-o,v[3]-a,v[4]-o),w&&t.lineTo(v[3]-a+p,v[4]-o+g);break;case"C":t.bezierCurveTo(v[1]-a,v[2]-o,v[3]-a,v[4]-o,v[5]-a,v[6]-o),w&&t.lineTo(v[5]-a+p,v[6]-o+g);break;case"A":var M,k,E=h[m].arcParams,O=E.cx,S=E.cy,A=E.rx,_=E.ry,T=E.startAngle,P=E.endAngle,L=E.xRotation,E=E.sweepFlag;t.ellipse?t.ellipse(O-a,S-o,A,_,L,T,P,!!(1-E)):(M=_<A?A:_,k=_<A?1:A/_,_=_<A?_/A:1,t.translate(O-a,S-o),t.rotate(L),t.scale(k,_),t.arc(0,0,M,T,P,!!(1-E)),t.scale(1/k,1/_),t.rotate(-L),t.translate(-(O-a),-(S-o))),w&&t.lineTo(v[6]-a+p,v[7]-o+g);break;case"Z":t.closePath()}}}function lu(t,e){var n,r,i=e.defX,a=void 0===i?0:i,i=e.defY,o=void 0===i?0:i,i=e.markerStart,s=e.markerEnd,l=e.markerStartOffset,c=e.markerEndOffset,u=e.points.points,h=u.length,e=u[0][0]-a,f=u[0][1]-o,d=u[h-1][0]-a,p=u[h-1][1]-o,g=0,m=0,v=0,y=0,b=0;i&&Os(i)&&l&&(n=u[1][0]-u[0][0],r=u[1][1]-u[0][1],b=Math.atan2(r,n),g=Math.cos(b)*(l||0),m=Math.sin(b)*(l||0)),s&&Os(s)&&c&&(n=u[h-1][0]-u[0][0],r=u[h-1][1]-u[0][1],b=Math.atan2(r,n),v=Math.cos(b)*(c||0),y=Math.sin(b)*(c||0)),t.moveTo(e+(g||v),f+(m||y));for(var x=1;x<h-1;x++){var w=u[x];t.lineTo(w[0]-a,w[1]-o)}t.lineTo(d,p)}function cu(t,e){var n,r,i=e.defX,a=void 0===i?0:i,i=e.defY,o=void 0===i?0:i,i=e.markerStart,s=e.markerEnd,l=e.markerStartOffset,c=e.markerEndOffset,u=e.points.points,h=u.length,e=u[0][0]-a,f=u[0][1]-o,d=u[h-1][0]-a,p=u[h-1][1]-o,g=0,m=0,v=0,y=0,b=0;i&&Os(i)&&l&&(n=u[1][0]-u[0][0],r=u[1][1]-u[0][1],b=Math.atan2(r,n),g=Math.cos(b)*(l||0),m=Math.sin(b)*(l||0)),s&&Os(s)&&c&&(n=u[h-2][0]-u[h-1][0],r=u[h-2][1]-u[h-1][1],b=Math.atan2(r,n),v=Math.cos(b)*(c||0),y=Math.sin(b)*(c||0)),t.moveTo(e+g,f+m);for(var x=1;x<h-1;x++){var w=u[x];t.lineTo(w[0]-a,w[1]-o)}t.lineTo(d+v,p+y)}function uu(t,e){var n,r,i,a,o=e.radius,s=e.width,e=e.height,l=s,c=e;o&&o.some(function(t){return 0!==t})?(n=(s=0<s?1:-1)+(e=0<e?1:-1)==0,r=(o=o.map(function(t){return Ze(t,0,Math.min(Math.abs(l)/2,Math.abs(c)/2))}))[0],i=o[1],a=o[2],o=o[3],t.moveTo(s*r,0),t.lineTo(l-s*i,0),0!==i&&t.arc(l-s*i,e*i,i,-e*Math.PI/2,0<s?0:Math.PI,n),t.lineTo(l,c-e*a),0!==a&&t.arc(l-s*a,c-e*a,a,0<s?0:Math.PI,0<e?Math.PI/2:1.5*Math.PI,n),t.lineTo(s*o,c),0!==o&&t.arc(s*o,c-e*o,o,0<e?Math.PI/2:-Math.PI/2,0<s?Math.PI:0,n),t.lineTo(0,e*r),0!==r&&t.arc(s*r,e*r,r,0<s?Math.PI:0,0<e?1.5*Math.PI:Math.PI/2,n)):t.rect(0,0,l,c)}var hu=function(i){var t;function e(){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).name="canvas-path-generator",t}t=i,(n=e).prototype=Object.create(t.prototype),ru(n.prototype.constructor=n,t);var n=e.prototype;return n.init=function(){(t={})[M.CIRCLE]=iu,t[M.ELLIPSE]=au,t[M.RECT]=uu,t[M.LINE]=ou,t[M.POLYLINE]=cu,t[M.POLYGON]=lu,t[M.PATH]=su,t[M.TEXT]=void 0,t[M.GROUP]=void 0,t[M.IMAGE]=void 0,t[M.HTML]=void 0,t[M.MESH]=void 0;var t;this.context.pathGeneratorFactory=t},n.destroy=function(){delete this.context.pathGeneratorFactory},e}(vl);function fu(){fu=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 f?e:f,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 k()}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")),h;r=u(i,e.iterator,n.arg);if("throw"===r.type)return n.method="throw",n.arg=r.arg,n.delegate=null,h;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,h):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,h)}(n,o);if(n){if(n===h)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===h)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 h={};function f(){}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=f.prototype=Object.create(e));function v(t){["next","throw","return"].forEach(function(e){a(t,e,function(t){return this._invoke(e,t)})})}function y(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:k}}function k(){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}},v(y.prototype),a(y.prototype,n,function(){return this}),o.AsyncIterator=y,o.async=function(t,e,n,r,i){void 0===i&&(i=Promise);var a=new y(s(t,e,n,r),i);return o.isGeneratorFunction(e)?a:a.next().then(function(t){return t.done?t.value:a.next()})},v(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,h):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),h},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),h}},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),h}},o}function du(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 pu(t,e){return(pu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function gu(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 mu(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?gu(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)?gu(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.")}var vu=v(),yu=v(),bu=v(),xu=J(),wu=function(){function o(){var o=this;this.context=void 0,this.runtime=void 0,this.isHit=function(t,e,n,r){var i=o.context.pointInPathPickerFactory[t.nodeName];if(i){var n=ct(xu,n),e=Gt(yu,jt(bu,e[0],e[1],0),n),n=t.getGeometryBounds().halfExtents,a=t.parsedStyle.anchor;if(e[0]+=(a&&a[0]||0)*n[0]*2,e[1]+=(a&&a[1]||0)*n[1]*2,i(t,new es(e[0],e[1]),r,o.isPointInPath,o.context,o.runtime))return!0}return!1},this.isPointInPath=function(t,e){var n=o.runtime.offscreenCanvas.getOrCreateContext(o.context.config.offscreenCanvas),r=o.context.pathGeneratorFactory[t.nodeName];return r&&(n.beginPath(),r(n,t.parsedStyle),n.closePath()),n.isPointInPath(e.x,e.y)}}var t=o.prototype;return t.apply=function(t,e){var n=this,r=t.renderingService,i=t.renderingContext,a=(this.context=t,this.runtime=e,null==(t=i.root)?void 0:t.ownerDocument);r.hooks.pick.tapPromise(o.tag,function(){s=fu().mark(function t(e){return fu().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",n.pick(a,e));case 1:case"end":return t.stop()}},t)});var s,e=function(){var t=this,o=arguments;return new Promise(function(e,n){var r=s.apply(t,o);function i(t){du(r,e,n,i,a,"next",t)}function a(t){du(r,e,n,i,a,"throw",t)}i(void 0)})};return function(t){return e.apply(this,arguments)}}()),r.hooks.pickSync.tap(o.tag,function(t){return n.pick(a,t)})},t.pick=function(t,e){for(var n=e.topmost,r=e.position,i=r.x,r=r.y,a=jt(vu,i,r,0),o=[],s=mu(t.elementsFromBBox(a[0],a[1],a[0],a[1]));!(l=s()).done;){var l=l.value,c=l.getWorldTransform();if(this.isHit(l,a,c,!1)){c=gi(l);if(c){c=c.parsedStyle.clipPath;if(this.isHit(c,a,c.getWorldTransform(),!0)){if(n)return e.picked=[l],e;o.push(l)}}else{if(n)return e.picked=[l],e;o.push(l)}}}return e.picked=o,e},o}();function Mu(t,e,n,r){t-=n,n=e-r;return Math.sqrt(t*t+n*n)}function ku(t,e){return Math.abs(t-e)<.001}function Eu(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 Ou(t){return(t+2*Math.PI)%(2*Math.PI)}wu.tag="CanvasPicker";var Su={box:function(t,e,n,r){return Eu([t,n],[e,r])},length:Mu,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?Mu(t,e,i,a):(n-t)*(n-t)+(r-e)*(r-e)<o?Mu(n,r,i,a):this.pointToLine(t,e,n,r,i,a)},pointToLine:function(t,e,n,r,i,a){n=[n-t,r-e];return oe(n,[0,0])?Math.sqrt((i-t)*(i-t)+(a-e)*(a-e)):(ie(r=[-n[1],n[0]],r),Math.abs(ae([i-t,a-e],r)))},tangentAngle:function(t,e,n,r){return Math.atan2(r-e,n-t)}};function Au(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),h=u/10,f=0;f<=c;f++){var d=f*u,p=[i.apply(void 0,t.concat([d])),i.apply(void 0,e.concat([d]))],p=Mu(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&&!(h<1e-4);g++){var m=o-h,v=o+h,y=[i.apply(void 0,t.concat([m])),i.apply(void 0,e.concat([m]))],y=Mu(l[0],l[1],y[0],y[1]);0<=m&&y<s?(o=m,s=y):(m=[i.apply(void 0,t.concat([v])),i.apply(void 0,e.concat([v]))],y=Mu(l[0],l[1],m[0],m[1]),v<=1&&y<s?(o=v,s=y):h*=.5)}return{x:i.apply(void 0,t.concat([o])),y:i.apply(void 0,e.concat([o]))}}function _u(t,e,n,r){var i=1-r;return i*i*t+2*r*i*e+r*r*n}function Tu(t,e,n){n=t+n-2*e;return ku(n,0)?[.5]:(t=(t-e)/n)<=1&&0<=t?[t]:[]}function Pu(t,e,n,r){return 2*(1-r)*(e-t)+2*r*(n-e)}function Lu(t,e,n,r,i,a,o){var s=_u(t,n,i,o),l=_u(e,r,a,o),c=Su.pointAt(t,e,n,r,o),n=Su.pointAt(n,r,i,a,o);return[[t,e,c.x,c.y,s,l],[s,l,n.x,n.y,i,a]]}function Cu(t,e,n,r,i,a,o){return 0===o?(Mu(t,e,n,r)+Mu(n,r,i,a)+Mu(t,e,i,a))/2:(e=(t=Lu(t,e,n,r,i,a,.5))[0],n=t[1],e.push(o-1),n.push(o-1),Cu.apply(void 0,e)+Cu.apply(void 0,n))}var Nu={box:function(t,e,n,r,i,a){var o=Tu(t,n,i)[0],s=Tu(e,r,a)[0],l=[t,i],c=[e,a];return void 0!==o&&l.push(_u(t,n,i,o)),void 0!==s&&c.push(_u(e,r,a,s)),Eu(l,c)},length:function(t,e,n,r,i,a){return Cu(t,e,n,r,i,a,3)},nearestPoint:function(t,e,n,r,i,a,o,s){return Au([t,n,i],[e,r,a],o,s,_u)},pointDistance:function(t,e,n,r,i,a,o,s){t=this.nearestPoint(t,e,n,r,i,a,o,s);return Mu(t.x,t.y,o,s)},interpolationAt:_u,pointAt:function(t,e,n,r,i,a,o){return{x:_u(t,n,i,o),y:_u(e,r,a,o)}},divide:Lu,tangentAngle:function(t,e,n,r,i,a,o){t=Pu(t,n,i,o),n=Pu(e,r,a,o);return Ou(Math.atan2(n,t))}};function ju(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 Ru(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 Iu(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 ku(r,0)?ku(n,0)||0<=(i=-e/n)&&i<=1&&t.push(i):ku(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 Bu(t,e,n,r,i,a,o,s,l){var c=ju(t,n,i,o,l),u=ju(e,r,a,s,l),h=Su.pointAt(t,e,n,r,l),n=Su.pointAt(n,r,i,a,l),r=Su.pointAt(i,a,o,s,l),i=Su.pointAt(h.x,h.y,n.x,n.y,l),a=Su.pointAt(n.x,n.y,r.x,r.y,l);return[[t,e,h.x,h.y,i.x,i.y,c,u],[c,u,a.x,a.y,r.x,r.y,o,s]]}function Du(t,e,n,r,i,a,o,s,l){if(0===l){for(var c=[t,n,i,o],u=[e,r,a,s],h=0,f=c.length,d=0;d<f;d++)h+=Mu(c[d],u[d],c[(d+1)%f],u[(d+1)%f]);return h/2}t=Bu(t,e,n,r,i,a,o,s,.5),e=[].concat(t[0],[l-1]),n=[].concat(t[1],[l-1]);return Du.apply(void 0,e)+Du.apply(void 0,n)}var Fu={extrema:Iu,box:function(t,e,n,r,i,a,o,s){for(var l=[t,o],c=[e,s],u=Iu(t,n,i,o),h=Iu(e,r,a,s),f=0;f<u.length;f++)l.push(ju(t,n,i,o,u[f]));for(var d=0;d<h.length;d++)c.push(ju(e,r,a,s,h[d]));return Eu(l,c)},length:function(t,e,n,r,i,a,o,s){return Du(t,e,n,r,i,a,o,s,3)},nearestPoint:function(t,e,n,r,i,a,o,s,l,c,u){return Au([t,n,i,o],[e,r,a,s],l,c,ju,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 Mu(t.x,t.y,l,c)},interpolationAt:ju,pointAt:function(t,e,n,r,i,a,o,s,l){return{x:ju(t,n,i,o,l),y:ju(e,r,a,s,l)}},divide:Bu,tangentAngle:function(t,e,n,r,i,a,o,s,l){t=Ru(t,n,i,o,l),n=Ru(e,r,a,s,l);return Ou(Math.atan2(n,t))}};function zu(t,e,n,r){t-=n,n=e-r;return Math.sqrt(t*t+n*n)}function Wu(t,e,n,r,i,a){return t<=i&&i<=t+n&&e<=a&&a<=e+r}function Gu(t,e,n,r,i,a,o,s){var l=(Math.atan2(s-e,o-t)+2*Math.PI)%(2*Math.PI),t={x:t+n*Math.cos(l),y:e+n*Math.sin(l)};return zu(t.x,t.y,o,s)<=a/2}function Hu(t,e,n,r,i,a,o){var s=Math.min(t,n),l=Math.max(t,n),c=Math.min(e,r),u=Math.max(e,r),h=i/2;return s-h<=a&&a<=l+h&&c-h<=o&&o<=u+h&&Su.pointToLine(t,e,n,r,a,o)<=i/2}function Yu(t,e,n,r,i){var a=t.length;if(!(a<2)){for(var o=0;o<a-1;o++)if(Hu(t[o][0],t[o][1],t[o+1][0],t[o+1][1],e,n,r))return!0;if(i){var i=t[0],s=t[a-1];if(Hu(i[0],i[1],s[0],s[1],e,n,r))return!0}}return!1}var Vu=1e-6;function qu(t){return Math.abs(t)<Vu?0:t<0?-1:1}function $u(t,e,n){var r=!1,i=t.length;if(i<=2)return!1;for(var a,o,s,l=0;l<i;l++){var c=t[l],u=t[(l+1)%i];if(o=u,((s=[e,n])[0]-(a=c)[0])*(o[1]-a[1])==(o[0]-a[0])*(s[1]-a[1])&&Math.min(a[0],o[0])<=s[0]&&s[0]<=Math.max(a[0],o[0])&&Math.min(a[1],o[1])<=s[1]&&s[1]<=Math.max(a[1],o[1]))return!0;0<qu(c[1]-n)!=0<qu(u[1]-n)&&qu(e-(n-c[1])*(c[0]-u[0])/(c[1]-u[1])-c[0])<0&&(r=!r)}return r}function Uu(t,e,n){for(var r=!1,i=0;i<t.length&&!(r=$u(t[i],e,n));i++);return r}function Xu(t,e,n){var t=t.parsedStyle,r=t.r,i=t.fill,a=t.stroke,o=t.lineWidth,s=t.increasedLineWidthForHitTesting,t=t.pointerEvents,o=((o||0)+(s||0))/2,s=zu(r,r,e.x,e.y),e=wa(t,i,a),t=e[0],i=e[1];return t&&i||n?s<=r+o:t?s<=r:!!i&&r-o<=s&&s<=r+o}function Ku(t,e,n,r){return t/(n*n)+e/(r*r)}function Zu(t,e,n){var t=t.parsedStyle,r=t.rx,i=t.ry,a=t.fill,o=t.stroke,s=t.lineWidth,l=t.increasedLineWidthForHitTesting,t=t.pointerEvents,c=e.x,e=e.y,t=wa(t,a,o),a=t[0],o=t[1],t=((s||0)+(l||0))/2,s=(c-r)*(c-r),l=(e-i)*(e-i);return a&&o||n?Ku(s,l,r+t,i+t)<=1:a?Ku(s,l,r,i)<=1:!!o&&1<=Ku(s,l,r-t,i-t)&&Ku(s,l,r+t,i+t)<=1}function Qu(t,e,n){var t=t.parsedStyle,r=t.x1,i=t.y1,a=t.x2,o=t.y2,s=t.lineWidth,l=t.increasedLineWidthForHitTesting,c=t.defX,u=t.defY;return!(!wa(t.pointerEvents,t.fill,t.stroke)[1]&&!n||!s)&&Hu(r,i,a,o,(s||0)+(l||0),e.x+(void 0===c?0:c),e.y+(void 0===u?0:u))}function Ju(t,e,n,r,i,a){var o=t.parsedStyle,s=o.lineWidth,l=o.increasedLineWidthForHitTesting,c=o.stroke,u=o.fill,h=o.defX,h=void 0===h?0:h,f=o.defY,f=void 0===f?0:f,d=o.path,o=o.pointerEvents,p=d.segments,g=d.hasArc,m=d.polylines,d=d.polygons,o=wa(o,(null==d?void 0:d.length)&&u,c),u=o[0],c=o[1],o=la(t),v=!1;return u||n?g?r(t,e):Uu(d,e.x+h,e.y+f)||Uu(m,e.x+h,e.y+f):c||n?function(t,e,n,r,i){for(var a=!1,o=e/2,s=0;s<t.length;s++){var l=t[s],c=l.currentPoint,u=l.params,h=l.prePoint,f=l.box;if(!f||Wu(f.x-o,f.y-o,f.width+e,f.height+e,n,r))switch(l.command){case"L":case"Z":if(a=Hu(h[0],h[1],c[0],c[1],e,n,r))return!0;break;case"Q":if(a=Nu.pointDistance(h[0],h[1],u[1],u[2],u[3],u[4],n,r)<=e/2)return!0;break;case"C":if(a=Fu.pointDistance(h[0],h[1],u[1],u[2],u[3],u[4],u[5],u[6],n,r,i)<=e/2)return!0;break;case"A":l.cubicParams||(l.cubicParams=Se(h[0],h[1],u[1],u[2],u[3],u[4],u[5],u[6],u[7],void 0));for(var d=l.cubicParams,p=h,g=0;g<d.length;g+=6){var m=Fu.pointDistance(p[0],p[1],d[g],d[g+1],d[g+2],d[g+3],d[g+4],d[g+5],n,r,i),p=[d[g+4],d[g+5]];if(a=m<=e/2)return!0}}}return a}(p,(s||0)+(l||0),e.x+h,e.y+f,o):v}function th(t,e,n){var t=t.parsedStyle,r=t.stroke,i=t.fill,a=t.lineWidth,o=t.increasedLineWidthForHitTesting,s=t.points,l=t.defX,l=void 0===l?0:l,c=t.defY,c=void 0===c?0:c,t=wa(t.pointerEvents,i,r),i=t[0],r=!1;return r=(r=t[1]||n?Yu(s.points,(a||0)+(o||0),e.x+l,e.y+c,!0):r)||!i&&!n?r:$u(s.points,e.x+l,e.y+c)}function eh(t,e,n){var t=t.parsedStyle,r=t.lineWidth,i=t.increasedLineWidthForHitTesting,a=t.points,o=t.defX,s=t.defY;return!(!wa(t.pointerEvents,t.fill,t.stroke)[1]&&!n||!r)&&Yu(a.points,(r||0)+(i||0),e.x+(void 0===o?0:o),e.y+(void 0===s?0:s),!1)}function nh(t,e,n,r,i){var a,o,s,l,c,u,h,f,d,p=t.parsedStyle,g=p.radius,m=p.fill,v=p.stroke,y=p.lineWidth,b=p.increasedLineWidthForHitTesting,x=p.width,w=p.height,p=wa(p.pointerEvents,m,v),m=p[0],v=p[1],p=(y||0)+(b||0);return g&&g.some(function(t){return 0!==t})?(y=!1,(v||n)&&(h=b=0,l=x,u=w,g=g.map(function(t){return Ze(t,0,Math.min(Math.abs(x)/2,Math.abs(w)/2))}),d=p,a=e.x,o=e.y,f=g[0],s=g[1],c=g[2],g=g[3],y=Hu(b+f,h,b+l-s,h,d,a,o)||Hu(b+l,h+s,b+l,h+u-c,d,a,o)||Hu(b+l-c,h+u,b+g,h+u,d,a,o)||Hu(b,h+u-g,b,h+f,d,a,o)||Gu(b+l-s,h+s,s,Math.PI,Math.PI,d,a,o)||Gu(b+l-c,h+u-c,c,0,Math.PI,d,a,o)||Gu(b+g,h+u-g,g,Math.PI,Math.PI,d,a,o)||Gu(b+f,h+f,f,Math.PI,Math.PI,d,a,o)),y||!m&&!n?y:r(t,e)):(s=p/2,m&&v||n?Wu(0-s,0-s,x+s,w+s,e.x,e.y):m?Wu(0,0,x,w,e.x,e.y):!!v&&(c=l=0,u=x,g=w,b=p,h=e.x,f=e.y,Wu(l-(d=b/2),c-d,u,b,h,f)||Wu(l+u-d,c-d,b,g,h,f)||Wu(l+d,c+g-d,u,b,h,f)||Wu(l-d,c+d,b,g,h,f)))}function rh(t,e,n,r,i,a){var o,s=t.parsedStyle,l=s.pointerEvents,c=s.width,s=s.height;return"non-transparent-pixel"!==l||(l=i.config.offscreenCanvas,o=a.offscreenCanvas.getOrCreateCanvas(l),a=a.offscreenCanvas.getOrCreateContext(l,{willReadFrequently:!0}),o.width=c,o.height=s,i.defaultStyleRendererFactory[M.IMAGE].render(a,t.parsedStyle,t,void 0,void 0,void 0),a.getImageData(e.x,e.y,1,1).data.every(function(t){return 0!==t}))}var ih=function(i){var t;function e(){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).name="canvas-picker",t}t=i,(n=e).prototype=Object.create(t.prototype),pu(n.prototype.constructor=n,t);var n=e.prototype;return n.init=function(){(t={})[M.CIRCLE]=Xu,t[M.ELLIPSE]=Zu,t[M.RECT]=nh,t[M.LINE]=Qu,t[M.POLYLINE]=eh,t[M.POLYGON]=th,t[M.PATH]=Ju,t[M.TEXT]=function(){return!0},t[M.GROUP]=null,t[M.IMAGE]=rh,t[M.HTML]=null,t[M.MESH]=null;var t;this.context.pointInPathPickerFactory=t,this.addRenderingPlugin(new wu)},n.destroy=function(){delete this.context.pointInPathPickerFactory,this.removeAllRenderingPlugins()},e}(vl);function ah(){return(ah=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 oh(t,e){return(oh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var sh=function(){function r(t){this.canvasRendererPluginOptions=void 0,this.context=void 0,this.pathGeneratorFactory=void 0,this.rBush=void 0,this.removedRBushNodeAABBs=[],this.renderQueue=[],this.restoreStack=[],this.clearFullScreen=!1,this.vpMatrix=J(),this.dprMatrix=J(),this.tmpMat4=J(),this.vec3a=v(),this.vec3b=v(),this.vec3c=v(),this.vec3d=v(),this.canvasRendererPluginOptions=t}var t=r.prototype;return t.apply=function(t,c){function i(t){(t=t.target.rBushNode).aabb&&h.removedRBushNodeAABBs.push(t.aabb)}function a(t){(t=t.target.rBushNode).aabb&&h.removedRBushNodeAABBs.push(t.aabb)}function u(t,e){t.isVisible()&&!t.isCulled()&&(h.renderDisplayObject(t,e,h.context,h.restoreStack,c),h.saveDirtyAABB(t)),(t.sortable.sorted||t.childNodes).forEach(function(t){u(t,e)})}var h=this,f=(this.context=t).config,d=t.camera,l=t.renderingService,p=t.renderingContext,e=t.rBushRoot,n=t.pathGeneratorFactory,g=(this.rBush=e,this.pathGeneratorFactory=n,t.contextService),m=p.root.ownerDocument.defaultView;l.hooks.init.tap(r.tag,function(){m.addEventListener(x.UNMOUNTED,i),m.addEventListener(x.CULLED,a);var t=g.getDPR(),e=f.width,n=f.height,r=g.getContext();h.clearRect(r,0,0,e*t,n*t,f.background)}),l.hooks.destroy.tap(r.tag,function(){m.removeEventListener(x.UNMOUNTED,i),m.removeEventListener(x.CULLED,a)}),l.hooks.beginFrame.tap(r.tag,function(){var t=g.getContext(),e=g.getDPR(),n=f.width,r=f.height,i=h.canvasRendererPluginOptions,a=i.dirtyObjectNumThreshold,i=i.dirtyObjectRatioThreshold,o=l.getStats(),s=o.total,o=o.rendered,s=o/s;h.clearFullScreen=l.disableDirtyRectangleRendering()||a<o&&i<s,t&&(t.resetTransform?t.resetTransform():t.setTransform(1,0,0,1,0,0),h.clearFullScreen)&&h.clearRect(t,0,0,n*e,r*e,f.background)});l.hooks.endFrame.tap(r.tag,function(){var e=g.getContext(),t=g.getDPR();if(vt(h.dprMatrix,[t,t,1]),ht(h.vpMatrix,h.dprMatrix,d.getOrthoMatrix()),h.clearFullScreen)u(p.root,e);else{t=h.safeMergeAABB.apply(h,[h.mergeDirtyAABBs(h.renderQueue)].concat(h.removedRBushNodeAABBs.map(function(t){var e=t.minX,n=t.minY,r=t.maxX,t=t.maxY,i=new Qo;return i.setMinMax([e,n,0],[r,t,0]),i})));if(h.removedRBushNodeAABBs=[],Qo.isEmpty(t))return void(h.renderQueue=[]);var n=h.convertAABB2Rect(t),r=n.x,i=n.y,a=n.width,n=n.height,o=Gt(h.vec3a,[r,i,0],h.vpMatrix),s=Gt(h.vec3b,[r+a,i,0],h.vpMatrix),l=Gt(h.vec3c,[r,i+n,0],h.vpMatrix),r=Gt(h.vec3d,[r+a,i+n,0],h.vpMatrix),a=Math.min(o[0],s[0],r[0],l[0]),i=Math.min(o[1],s[1],r[1],l[1]),n=Math.max(o[0],s[0],r[0],l[0]),o=Math.max(o[1],s[1],r[1],l[1]),s=Math.floor(a),r=Math.floor(i),l=Math.ceil(n-a),n=Math.ceil(o-i);e.save(),h.clearRect(e,s,r,l,n,f.background),e.beginPath(),e.rect(s,r,l,n),e.clip(),e.setTransform(h.vpMatrix[0],h.vpMatrix[1],h.vpMatrix[4],h.vpMatrix[5],h.vpMatrix[12],h.vpMatrix[13]),f.renderer.getConfig().enableDirtyRectangleRenderingDebug&&m.dispatchEvent(new fs(Sl.DIRTY_RECTANGLE,{dirtyRect:{x:s,y:r,width:l,height:n}})),h.searchDirtyObjects(t).sort(function(t,e){return t.sortable.renderOrder-e.sortable.renderOrder}).forEach(function(t){t&&t.isVisible()&&!t.isCulled()&&h.renderDisplayObject(t,e,h.context,h.restoreStack,c)}),e.restore(),h.renderQueue.forEach(function(t){h.saveDirtyAABB(t)}),h.renderQueue=[]}h.restoreStack.forEach(function(){e.restore()}),h.restoreStack=[]}),l.hooks.render.tap(r.tag,function(t){h.clearFullScreen||h.renderQueue.push(t)})},t.clearRect=function(t,e,n,r,i,a){t.clearRect(e,n,r,i),a&&(t.fillStyle=a,t.fillRect(e,n,r,i))},t.renderDisplayObject=function(t,e,n,r,i){var a,o=t.nodeName,s=r[r.length-1],s=(!s||t.compareDocumentPosition(s)&Node.DOCUMENT_POSITION_CONTAINS||(e.restore(),r.pop()),this.context.styleRendererFactory[o]),o=this.pathGeneratorFactory[o],l=t.parsedStyle.clipPath;l&&(this.applyWorldTransform(e,l),a=this.pathGeneratorFactory[l.nodeName])&&(e.save(),r.push(t),e.beginPath(),a(e,l.parsedStyle),e.closePath(),e.clip()),s&&(this.applyWorldTransform(e,t),e.save(),this.applyAttributesToContext(e,t)),o&&(e.beginPath(),o(e,t.parsedStyle),t.nodeName!==M.LINE)&&t.nodeName!==M.PATH&&t.nodeName!==M.POLYLINE&&e.closePath(),s&&(s.render(e,t.parsedStyle,t,n,this,i),e.restore()),t.renderable.dirty=!1},t.convertAABB2Rect=function(t){var e=t.getMin(),t=t.getMax(),n=Math.floor(e[0]),e=Math.floor(e[1]);return{x:n,y:e,width:Math.ceil(t[0])-n,height:Math.ceil(t[1])-e}},t.mergeDirtyAABBs=function(t){var n=new Qo;return t.forEach(function(t){var e=t.getRenderBounds(),e=(n.add(e),t.renderable.dirtyRenderBounds);e&&n.add(e)}),n},t.searchDirtyObjects=function(t){var e=t.getMin(),n=e[0],e=e[1],t=t.getMax(),r=t[0],t=t[1];return this.rBush.search({minX:n,minY:e,maxX:r,maxY:t}).map(function(t){return t.displayObject})},t.saveDirtyAABB=function(t){var e=t.renderable,t=(e.dirtyRenderBounds||(e.dirtyRenderBounds=new Qo),t.getRenderBounds());t&&e.dirtyRenderBounds.update(t.center,t.halfExtents)},t.applyAttributesToContext=function(t,e){var n=e.parsedStyle,r=n.stroke,i=n.fill,a=n.opacity,o=n.lineDash,n=n.lineDashOffset;o&&t.setLineDash(o),A(n)||(t.lineDashOffset=n),A(a)||(t.globalAlpha*=a),A(r)||Array.isArray(r)||r.isNone||(t.strokeStyle=e.attributes.stroke),A(i)||Array.isArray(i)||i.isNone||(t.fillStyle=e.attributes.fill)},t.applyWorldTransform=function(t,e,n){var r=0,i=0,a=(e.parsedStyle||{}).anchor,o=a&&a[0]||0,a=a&&a[1]||0;0===o&&0===a||(r=-o*((o=e.geometry.contentBounds)&&2*o.halfExtents[0]||0),i=-a*(o&&2*o.halfExtents[1]||0)),n?(et(this.tmpMat4,e.getLocalTransform()),this.vec3a[0]=r,this.vec3a[1]=i,this.vec3a[2]=0,ft(this.tmpMat4,this.tmpMat4,this.vec3a),ht(this.tmpMat4,n,this.tmpMat4)):(et(this.tmpMat4,e.getWorldTransform()),this.vec3a[0]=r,this.vec3a[1]=i,this.vec3a[2]=0,ft(this.tmpMat4,this.tmpMat4,this.vec3a)),ht(this.tmpMat4,this.vpMatrix,this.tmpMat4),t.setTransform(this.tmpMat4[0],this.tmpMat4[1],this.tmpMat4[4],this.tmpMat4[5],this.tmpMat4[12],this.tmpMat4[13])},t.safeMergeAABB=function(){for(var e=new Qo,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return n.forEach(function(t){e.add(t)}),e},r}(),lh=(sh.tag="CanvasRenderer",function(){function t(t){this.imagePool=void 0,this.imagePool=t}var e=t.prototype;return e.render=function(t,e,n,r,i,a){var o=e.fill,s=e.fillRule,l=e.opacity,c=e.fillOpacity,u=e.stroke,h=e.strokeOpacity,f=e.lineWidth,d=e.lineCap,p=e.lineJoin,g=e.shadowType,m=e.shadowColor,v=e.shadowBlur,y=e.filter,e=e.miterLimit,b=!A(o)&&!o.isNone,x=!A(u)&&!u.isNone&&0<f,w=0===o.alpha,y=!(!y||!y.length),m=!A(m)&&0<v,v=n.nodeName,g="inner"===g,v=x&&m&&(v===M.PATH||v===M.LINE||v===M.POLYLINE||w||g);b&&(t.globalAlpha=l*c,v||ch(n,t,m),this.fill(t,n,o,s,r,i,a),v||this.clearShadowAndFilter(t,y,m)),x&&(t.globalAlpha=l*h,t.lineWidth=f,A(e)||(t.miterLimit=e),A(d)||(t.lineCap=d),A(p)||(t.lineJoin=p),v&&(g&&(t.globalCompositeOperation="source-atop"),ch(n,t,!0),g)&&(this.stroke(t,n,u,r,i,a),t.globalCompositeOperation="source-over",this.clearShadowAndFilter(t,y,!0)),this.stroke(t,n,u,r,i,a))},e.clearShadowAndFilter=function(t,e,n){n&&(t.shadowColor="transparent",t.shadowBlur=0),e&&(n=t.filter,!A(n))&&-1<n.indexOf("drop-shadow")&&(t.filter=n.replace(/drop-shadow\([^)]*\)/,"").trim()||"none")},e.fill=function(e,n,t,r,i,a,o){var s=this;Array.isArray(t)?t.forEach(function(t){e.fillStyle=s.getColor(t,n,e),r?e.fill(r):e.fill()}):(Ua(t)&&(e.fillStyle=this.getPattern(t,n,e,i,a,o)),r?e.fill(r):e.fill())},e.stroke=function(e,n,t,r,i,a){var o=this;Array.isArray(t)?t.forEach(function(t){e.strokeStyle=o.getColor(t,n,e),e.stroke()}):(Ua(t)&&(e.strokeStyle=this.getPattern(t,n,e,r,i,a)),e.stroke())},e.getPattern=function(t,e,n,r,i,a){var o,s,l,c,u,h,f;return"rect"===t.image.nodeName&&(o=(s=t.image.parsedStyle).width,s=s.height,l=r.contextService.getDPR(),c=r.config.offscreenCanvas,(u=a.offscreenCanvas.getOrCreateCanvas(c)).width=o*l,u.height=s*l,h=a.offscreenCanvas.getOrCreateContext(c),f=[],t.image.forEach(function(t){i.renderDisplayObject(t,h,r,f,a)}),f.forEach(function(){h.restore()})),this.imagePool.getOrCreatePatternSync(t,n,u,l,function(){e.renderable.dirty=!0,r.renderingService.dirtify()})},e.getColor=function(t,e,n){var r;return t.type!==Fr.LinearGradient&&t.type!==Fr.RadialGradient||(r=(e=e.getGeometryBounds())&&2*e.halfExtents[0]||1,e=e&&2*e.halfExtents[1]||1,r=this.imagePool.getOrCreateGradient(ah({type:t.type},t.value,{width:r,height:e}),n)),r},t}());function ch(t,e,n){var r=t.parsedStyle,i=r.filter,a=r.shadowColor,o=r.shadowBlur,s=r.shadowOffsetX,r=r.shadowOffsetY;i&&i.length&&(e.filter=t.style.filter),n&&(e.shadowColor=a.toString(),e.shadowBlur=o||0,e.shadowOffsetX=s||0,e.shadowOffsetY=r||0)}var uh=function(){function t(t){this.imagePool=void 0,this.imagePool=t}return t.prototype.render=function(t,e,n){var r=e.width,i=e.height,a=e.img,o=e.shadowColor,e=e.shadowBlur,a=Ke(a)?this.imagePool.getImageSync(a):(r=r||a.width,i=i||a.height,a);if(a){ch(n,t,!A(o)&&0<e);try{t.drawImage(a,0,0,r,i)}catch(t){}}},t}(),hh=function(){function t(){}var e=t.prototype;return e.render=function(t,e,n){var r=e.lineWidth,i=e.textAlign,a=e.textBaseline,o=e.lineJoin,s=e.miterLimit,l=e.letterSpacing,c=e.stroke,u=e.fill,h=e.fillOpacity,f=e.strokeOpacity,d=e.opacity,p=e.metrics,g=e.dx,m=e.dy,v=e.shadowColor,e=e.shadowBlur,y=p.font,b=p.lines,x=p.height,w=p.lineHeight,M=p.lineMetrics,p=(t.font=y,t.lineWidth=r,t.textAlign="middle"===i?"center":i,a),k=(_.enableCSSParsing||"alphabetic"!==p||(p="bottom"),t.lineJoin=o,A(s)||(t.miterLimit=s),0),E=("middle"===a?k=-x/2-w/2:"bottom"===a||"alphabetic"===a||"ideographic"===a?k=-x:"top"!==a&&"hanging"!==a||(k=-w),g||0),y=(k+=m||0,1===b.length&&("bottom"===p?(p="middle",k-=.5*x):"top"===p&&(p="middle",k+=.5*x)),t.textBaseline=p,!A(v)&&0<e);ch(n,t,y);for(var O=0;O<b.length;O++){var S=r/2+E;k+=w,A(c)||c.isNone||!r||this.drawLetterSpacing(t,b[O],M[O],i,S,k,l,h,f,d,!0),A(u)||this.drawLetterSpacing(t,b[O],M[O],i,S,k,l,h,f,d)}},e.drawLetterSpacing=function(t,e,n,r,i,a,o,s,l,c,u){if(void 0===u&&(u=!1),0===o)u?this.strokeText(t,e,i,a,l):this.fillText(t,e,i,a,s,c);else{for(var h=t.textAlign,f=(t.textAlign="left",i),d=("center"===r||"middle"===r?f=i-n.width/2:"right"!==r&&"end"!==r||(f=i-n.width),Array.from(e)),p=t.measureText(e).width,g=0;g<d.length;++g){var m=d[g];u?this.strokeText(t,m,f,a,l):this.fillText(t,m,f,a,s,c),f+=p-(m=t.measureText(e.substring(g+1)).width)+o,p=m}t.textAlign=h}},e.fillText=function(t,e,n,r,i,a){var o,s=!A(i)&&1!==i;s&&(o=t.globalAlpha,t.globalAlpha=i*a),t.fillText(e,n,r),s&&(t.globalAlpha=o)},e.strokeText=function(t,e,n,r,i){var a,o=!A(i)&&1!==i;o&&(a=t.globalAlpha,t.globalAlpha=i),t.strokeText(e,n,r),o&&(t.globalAlpha=a)},t}(),fh=function(n){var t;function e(t){var e;return void 0===t&&(t={}),(e=n.call(this)||this).options=void 0,e.name="canvas-renderer",e.options=t,e}t=n,(r=e).prototype=Object.create(t.prototype),oh(r.prototype.constructor=r,t);var r=e.prototype;return r.init=function(){var t,e=ah({dirtyObjectNumThreshold:500,dirtyObjectRatioThreshold:.8},this.options),n=this.context.imagePool,r=new lh(n),n=((t={})[M.CIRCLE]=r,t[M.ELLIPSE]=r,t[M.RECT]=r,t[M.IMAGE]=new uh(n),t[M.TEXT]=new hh,t[M.LINE]=r,t[M.POLYLINE]=r,t[M.POLYGON]=r,t[M.PATH]=r,t[M.GROUP]=void 0,t[M.HTML]=void 0,t[M.MESH]=void 0,t);this.context.defaultStyleRendererFactory=n,this.context.styleRendererFactory=n,this.addRenderingPlugin(new sh(e))},r.destroy=function(){this.removeAllRenderingPlugins(),delete this.context.defaultStyleRendererFactory,delete this.context.styleRendererFactory},e}(vl);function dh(t,e){return(dh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var ph=function(){function g(){this.context=void 0}return g.prototype.apply=function(t,r){function i(t){e.hooks.pointerWheel.call(t)}function a(t){e.hooks.click.call(t)}var o=this,e=t.renderingService,n=t.renderingContext,s=t.config,l=(this.context=t,n.root.ownerDocument.defaultView),c=function(t){e.hooks.pointerMove.call(t)},u=function(t){e.hooks.pointerUp.call(t)},h=function(t){e.hooks.pointerDown.call(t)},f=function(t){e.hooks.pointerOver.call(t)},d=function(t){e.hooks.pointerOut.call(t)},p=function(t){e.hooks.pointerCancel.call(t)};e.hooks.init.tap(g.tag,function(){var t,e,n=o.context.contextService.getDomElement();r.globalThis.navigator.msPointerEnabled?(n.style.msContentZooming="none",n.style.msTouchAction="none"):l.supportsPointerEvents&&(n.style.touchAction="none"),l.supportsPointerEvents?(t=n,r.globalThis.document.addEventListener("pointermove",c,!0),t.addEventListener("pointerdown",h,!0),t.addEventListener("pointerleave",d,!0),t.addEventListener("pointerover",f,!0),r.globalThis.addEventListener("pointerup",u,!0),r.globalThis.addEventListener("pointercancel",p,!0)):(t=n,r.globalThis.document.addEventListener("mousemove",c,!0),t.addEventListener("mousedown",h,!0),t.addEventListener("mouseout",d,!0),t.addEventListener("mouseover",f,!0),r.globalThis.addEventListener("mouseup",u,!0)),l.supportsTouchEvents&&((e=n).addEventListener("touchstart",h,!0),e.addEventListener("touchend",u,!0),e.addEventListener("touchmove",c,!0),e.addEventListener("touchcancel",p,!0)),s.useNativeClickEvent&&n.addEventListener("click",a,!0),n.addEventListener("wheel",i,{passive:!0,capture:!0})}),e.hooks.destroy.tap(g.tag,function(){var t,e,n=o.context.contextService.getDomElement();r.globalThis.navigator.msPointerEnabled?(n.style.msContentZooming="",n.style.msTouchAction=""):l.supportsPointerEvents&&(n.style.touchAction=""),l.supportsPointerEvents?(t=n,r.globalThis.document.removeEventListener("pointermove",c,!0),t.removeEventListener("pointerdown",h,!0),t.removeEventListener("pointerleave",d,!0),t.removeEventListener("pointerover",f,!0),r.globalThis.removeEventListener("pointerup",u,!0)):(t=n,r.globalThis.document.removeEventListener("mousemove",c,!0),t.removeEventListener("mousedown",h,!0),t.removeEventListener("mouseout",d,!0),t.removeEventListener("mouseover",f,!0),r.globalThis.removeEventListener("mouseup",u,!0)),l.supportsTouchEvents&&((e=n).removeEventListener("touchstart",h,!0),e.removeEventListener("touchend",u,!0),e.removeEventListener("touchmove",c,!0),e.removeEventListener("touchcancel",p,!0)),s.useNativeClickEvent&&n.removeEventListener("click",a,!0),n.removeEventListener("wheel",i,!0)})},g}(),gh=(ph.tag="DOMInteraction",function(i){var t;function e(){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).name="dom-interaction",t}t=i,(n=e).prototype=Object.create(t.prototype),dh(n.prototype.constructor=n,t);var n=e.prototype;return n.init=function(){this.addRenderingPlugin(new ph)},n.destroy=function(){this.removeAllRenderingPlugins()},e}(vl));function mh(t,e){return(mh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var vh=function(){function f(){this.context=void 0,this.$camera=void 0}var t=f.prototype;return t.joinTransformMatrix=function(t){return"matrix("+[t[0],t[1],t[4],t[5],t[12],t[13]].join(",")+")"},t.apply=function(t){function i(t,e){e.style.transform=s.joinTransformMatrix(t.getWorldTransform())}function e(t){var e,n,r=t.target;r.nodeName===M.HTML&&(s.$camera||(s.$camera=s.createCamera(l)),e=s.getOrCreateEl(r),s.$camera.appendChild(e),n=r.ownerDocument.documentElement.attributes,Object.keys(n).forEach(function(t){e.style[t]=n[t]}),Object.keys(r.attributes).forEach(function(t){s.updateAttribute(t,r)}),i(r,e),_.nativeHTMLMap.set(e,r))}function n(t){(t=t.target).nodeName===M.HTML&&s.$camera&&(t=s.getOrCreateEl(t))&&(t.remove(),_.nativeHTMLMap.delete(t))}function r(t){var e=t.target;e.nodeName===M.HTML&&(t=t.attrName,s.updateAttribute(t,e))}function a(t){var e;(t=t.target).nodeName===M.HTML&&(e=s.getOrCreateEl(t),i(t,e))}function o(){var t,e;s.$camera&&(t=(e=s.context.config).width,e=e.height,s.$camera.style.width=(t||0)+"px",s.$camera.style.height=(e||0)+"px")}var s=this,l=t.camera,c=t.renderingContext,u=t.renderingService,h=(this.context=t,c.root.ownerDocument.defaultView);u.hooks.init.tap(f.tag,function(){h.addEventListener(Sl.RESIZE,o),h.addEventListener(x.MOUNTED,e),h.addEventListener(x.UNMOUNTED,n),h.addEventListener(x.ATTR_MODIFIED,r),h.addEventListener(x.BOUNDS_CHANGED,a)}),u.hooks.endFrame.tap(f.tag,function(){s.$camera&&c.renderReasons.has(ul.CAMERA_CHANGED)&&(s.$camera.style.transform=s.joinTransformMatrix(l.getOrthoMatrix()))}),u.hooks.destroy.tap(f.tag,function(){s.$camera&&s.$camera.remove(),h.removeEventListener(Sl.RESIZE,o),h.removeEventListener(x.MOUNTED,e),h.removeEventListener(x.UNMOUNTED,n),h.removeEventListener(x.ATTR_MODIFIED,r),h.removeEventListener(x.BOUNDS_CHANGED,a)})},t.getId=function(t){return t.id||"g-html-"+t.entity},t.createCamera=function(t){var e,n,r=this.context.config,i=r.document,a=r.width,r=r.height,o=this.context.contextService.getDomElement(),s=o.parentNode;return s?((n=s.querySelector("#"+(e="g-canvas-camera")))||((n=i=(i||document).createElement("div")).id=e,i.style.position="absolute",i.style.left=(o.offsetLeft||0)+"px",i.style.top=(o.offsetTop||0)+"px",i.style.transformOrigin="left top",i.style.transform=this.joinTransformMatrix(t.getOrthoMatrix()),i.style.overflow="hidden",i.style.pointerEvents="none",i.style.width=(a||0)+"px",i.style.height=(r||0)+"px",s.appendChild(i)),n):null},t.getOrCreateEl=function(t){var e=this.context.config.document,n=this.getId(t),r=this.$camera.querySelector("#"+n);return r||(r=(e||document).createElement("div"),(t.parsedStyle.$el=r).id=n,t.name&&r.setAttribute("name",t.name),t.className&&(r.className=t.className),r.style.position="absolute",r.style.left="0px",r.style.top="0px",r.style["will-change"]="transform",r.style.transform=this.joinTransformMatrix(t.getWorldTransform())),r},t.updateAttribute=function(t,e){var n=this.getOrCreateEl(e);switch(t){case"innerHTML":var r=e.parsedStyle.innerHTML;Ke(r)?n.innerHTML=r:(n.innerHTML="",n.appendChild(r));break;case"transformOrigin":var r=e.parsedStyle.transformOrigin;n.style["transform-origin"]=r[0].value+" "+r[1].value;break;case"width":_.enableCSSParsing?(r=e.computedStyleMap().get("width"),n.style.width=r.toString()):(r=e.parsedStyle.width,n.style.width=Qe(r)?r+"px":r.toString());break;case"height":_.enableCSSParsing?(r=e.computedStyleMap().get("height"),n.style.height=r.toString()):(r=e.parsedStyle.height,n.style.height=Qe(r)?r+"px":r.toString());break;case"zIndex":r=e.parsedStyle.zIndex;n.style["z-index"]=""+r;break;case"visibility":r=e.parsedStyle.visibility;n.style.visibility=r;break;case"pointerEvents":r=e.parsedStyle.pointerEvents;n.style.pointerEvents=r;break;case"opacity":r=e.parsedStyle.opacity;n.style.opacity=""+r;break;case"fill":var r=e.parsedStyle.fill,i="";Xa(r)?i=r.isNone?"transparent":e.getAttribute("fill"):Array.isArray(r)?i=e.getAttribute("fill"):Ua(r),n.style.background=i;break;case"stroke":r=e.parsedStyle.stroke,i="";Xa(r)?i=r.isNone?"transparent":e.getAttribute("stroke"):Array.isArray(r)?i=e.getAttribute("stroke"):Ua(r),n.style["border-color"]=i,n.style["border-style"]="solid";break;case"lineWidth":r=e.parsedStyle.lineWidth;n.style["border-width"]=(r||0)+"px";break;case"lineDash":n.style["border-style"]="dashed";break;case"filter":i=e.style.filter;n.style.filter=i}},f}(),yh=(vh.tag="HTMLRendering",function(i){var t;function e(){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).name="html-renderer",t}t=i,(n=e).prototype=Object.create(t.prototype),mh(n.prototype.constructor=n,t);var n=e.prototype;return n.init=function(){this.addRenderingPlugin(new vh)},n.destroy=function(){this.removeAllRenderingPlugins()},e}(vl));function bh(t,e){return(bh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var xh="undefined"!=typeof Float32Array?Float32Array:Array;Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var wh=function(){function t(t){this.canvasConfig=void 0,this.imageCache={},this.gradientCache={},this.patternCache={},this.canvasConfig=t}var e=t.prototype;return e.getImageSync=function(t,e){return this.imageCache[t]?e&&e():this.getOrCreateImage(t).then(function(){e&&e()}),this.imageCache[t]},e.getOrCreateImage=function(r){var i,a=this;return this.imageCache[r]?Promise.resolve(this.imageCache[r]):(i=this.canvasConfig.createImage,new Promise(function(t,e){var n;i?n=i(r):di&&(n=new window.Image),n&&(n.onload=function(){a.imageCache[r]=n,t(n)},n.onerror=function(t){e(t)},n.crossOrigin="Anonymous",n.src=r)}))},e.getOrCreatePatternSync=function(t,e,n,r,i){var a,o,s,l,c=this.generatePatternKey(t);return c&&this.patternCache[c]?this.patternCache[c]:(l=t.image,s=t.repetition,t=t.transform,a=!1,Ke(l)?o=this.getImageSync(l,i):n?(o=n,a=!0):o=l,(i=o&&e.createPattern(o,s))&&(e=t?Di(Oo(t)):(n=new xh(16),xh!=Float32Array&&(n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[11]=0,n[12]=0,n[13]=0,n[14]=0),n[0]=1,n[5]=1,n[10]=1,n[15]=1,(l=n)[0]=1,l[1]=0,l[2]=0,l[3]=0,l[4]=0,l[5]=1,l[6]=0,l[7]=0,l[8]=0,l[9]=0,l[10]=1,l[11]=0,l[12]=0,l[13]=0,l[14]=0,l[15]=1,l),a&&(s=o=e,n=(t=[1/r,1/r,1])[0],l=t[1],t=t[2],o[0]=s[0]*n,o[1]=s[1]*n,o[2]=s[2]*n,o[3]=s[3]*n,o[4]=s[4]*l,o[5]=s[5]*l,o[6]=s[6]*l,o[7]=s[7]*l,o[8]=s[8]*t,o[9]=s[9]*t,o[10]=s[10]*t,o[11]=s[11]*t,o[12]=s[12],o[13]=s[13],o[14]=s[14],o[15]=s[15]),i.setTransform({a:e[0],b:e[1],c:e[4],d:e[5],e:e[12],f:e[13]})),c&&i&&(this.patternCache[c]=i),i)},e.getOrCreateGradient=function(t,e){var r,n,i,a,o,s=this.generateGradientKey(t),l=t.type,c=t.steps,u=t.width,h=t.height,f=t.angle,d=t.cx,p=t.cy,t=t.size;return this.gradientCache[s]||(r=null,l===Fr.LinearGradient?(n=u,i=h,f=Si((f=f).value),a=0+n/2,o=0+i/2,n=Math.abs(n*Math.cos(f))+Math.abs(i*Math.sin(f)),i={x1:a-Math.cos(f)*n/2,y1:o-Math.sin(f)*n/2,x2:a+Math.cos(f)*n/2,y2:o+Math.sin(f)*n/2},r=e.createLinearGradient(i.x1,i.y1,i.x2,i.y2)):l===Fr.RadialGradient&&(a=u,o=h,f=p,n=t,l=(i=d).value,u=f.value,i.unit===g.kPercentage&&(l=i.value/100*a),f.unit===g.kPercentage&&(u=f.value/100*o),i=Math.max(_e([0,0],[l,u]),_e([0,o],[l,u]),_e([a,o],[l,u]),_e([a,0],[l,u])),n&&(n instanceof Jr?i=n.value:n instanceof Hr&&("closest-side"===n.value?i=Math.min(l,a-l,u,o-u):"farthest-side"===n.value?i=Math.max(l,a-l,u,o-u):"closest-corner"===n.value&&(i=Math.min(_e([0,0],[l,u]),_e([0,o],[l,u]),_e([a,o],[l,u]),_e([a,0],[l,u]))))),r=e.createRadialGradient(p=(h={x:l,y:u,r:i}).x,t=h.y,0,p,t,h.r)),r&&(c.forEach(function(t){var e,n=t.offset,t=t.color;n.unit===g.kPercentage&&null!=(e=r)&&e.addColorStop(n.value/100,t.toString())}),this.gradientCache[s]=r)),this.gradientCache[s]},e.generateGradientKey=function(t){var e=t.type,n=t.width,r=t.height,i=t.steps,a=t.angle,o=t.cx,s=t.cy,t=t.size;return"gradient-"+e+"-"+((null==a?void 0:a.toString())||0)+"-"+((null==o?void 0:o.toString())||0)+"-"+((null==s?void 0:s.toString())||0)+"-"+((null==t?void 0:t.toString())||0)+"-"+n+"-"+r+"-"+i.map(function(t){return""+t.offset+t.color}).join("-")},e.generatePatternKey=function(t){var e=t.image,t=t.repetition;return Ke(e)?"pattern-"+e+"-"+t:"rect"===e.nodeName?"pattern-"+e.entity+"-"+t:void 0},t}(),Mh=function(){function s(){}return s.prototype.apply=function(t){function e(t){var e=t.target,t=e.nodeName,n=e.attributes;t===M.IMAGE&&(t=n.img,Ke(t))&&a.getImageSync(t,function(){e.renderable.dirty=!0,r.dirtify()})}function n(t){var e=t.target,n=t.attrName,t=t.newValue;e.nodeName===M.IMAGE&&"img"===n&&Ke(t)&&a.getOrCreateImage(t).then(function(){e.renderable.dirty=!0,r.dirtify()})}var r=t.renderingService,i=t.renderingContext,a=t.imagePool,o=i.root.ownerDocument.defaultView;r.hooks.init.tap(s.tag,function(){o.addEventListener(x.MOUNTED,e),o.addEventListener(x.ATTR_MODIFIED,n)}),r.hooks.destroy.tap(s.tag,function(){o.removeEventListener(x.MOUNTED,e),o.removeEventListener(x.ATTR_MODIFIED,n)})},s}(),kh=(Mh.tag="LoadImage",function(i){var t;function e(){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).name="image-loader",t}t=i,(n=e).prototype=Object.create(t.prototype),bh(n.prototype.constructor=n,t);var n=e.prototype;return n.init=function(){this.context.imagePool=new wh(this.context.config),this.addRenderingPlugin(new Mh)},n.destroy=function(){this.removeAllRenderingPlugins()},e}(vl));function Eh(){Eh=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 f?e:f,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 k()}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")),h;r=u(i,e.iterator,n.arg);if("throw"===r.type)return n.method="throw",n.arg=r.arg,n.delegate=null,h;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,h):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,h)}(n,o);if(n){if(n===h)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===h)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 h={};function f(){}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=f.prototype=Object.create(e));function v(t){["next","throw","return"].forEach(function(e){a(t,e,function(t){return this._invoke(e,t)})})}function y(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:k}}function k(){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}},v(y.prototype),a(y.prototype,n,function(){return this}),o.AsyncIterator=y,o.async=function(t,e,n,r,i){void 0===i&&(i=Promise);var a=new y(s(t,e,n,r),i);return o.isGeneratorFunction(e)?a:a.next().then(function(t){return t.done?t.value:a.next()})},v(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,h):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),h},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),h}},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),h}},o}function Oh(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 Sh(t,e){t.prototype=Object.create(e.prototype),Ah(t.prototype.constructor=t,e)}function Ah(t,e){return(Ah=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var _h=function(){function t(t){this.$container=void 0,this.$canvas=void 0,this.dpr=void 0,this.context=void 0,this.canvasConfig=void 0,this.renderingContext=void 0,this.renderingContext=t.renderingContext,this.canvasConfig=t.config}var e=t.prototype;return e.init=function(){var t=this.canvasConfig,e=t.container,t=t.canvas;t?(this.$canvas=t,e&&t.parentElement!==e&&e.appendChild(t),this.$container=t.parentElement,this.canvasConfig.container=this.$container):e&&(this.$container=Ke(e)?document.getElementById(e):e,this.$container)&&(t=document.createElement("canvas"),this.$container.appendChild(t),this.$container.style.position||(this.$container.style.position="relative"),this.$canvas=t),this.context=this.$canvas.getContext("2d"),this.resize(this.canvasConfig.width,this.canvasConfig.height)},e.getContext=function(){return this.context},e.getDomElement=function(){return this.$canvas},e.getDPR=function(){return this.dpr},e.getBoundingClientRect=function(){if(this.$canvas.getBoundingClientRect)return this.$canvas.getBoundingClientRect()},e.destroy=function(){this.$container&&this.$canvas&&this.$canvas.parentNode&&this.$container.removeChild(this.$canvas)},e.resize=function(t,e){var n=1<=(n=this.canvasConfig.devicePixelRatio||di&&window.devicePixelRatio||1)?Math.ceil(n):1;this.dpr=n,this.$canvas&&(this.$canvas.width=this.dpr*t,this.$canvas.height=this.dpr*e,n=this.$canvas,t=t,e=e,di)&&n.style&&(n.style.width=t+"px",n.style.height=e+"px"),this.renderingContext.renderReasons.add(ul.CAMERA_CHANGED)},e.applyCursorStyle=function(t){this.$container&&this.$container.style&&(this.$container.style.cursor=t)},e.toDataURL=function(){s=Eh().mark(function t(e){var n,r;return Eh().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n=(r=e=void 0===e?{}:e).type,r=r.encoderOptions,t.abrupt("return",this.context.canvas.toDataURL(n,r));case 3:case"end":return t.stop()}},t,this)});var s,e=function(){var t=this,o=arguments;return new Promise(function(e,n){var r=s.apply(t,o);function i(t){Oh(r,e,n,i,a,"next",t)}function a(t){Oh(r,e,n,i,a,"throw",t)}i(void 0)})};return function(t){return e.apply(this,arguments)}}(),t}(),Th=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).name="canvas-context-register",t}Sh(t,i);var e=t.prototype;return e.init=function(){this.context.ContextService=_h},e.destroy=function(){delete this.context.ContextService},t}(vl),Ph=function(e){function t(t){t=e.call(this,t)||this;return t.registerPlugin(new Th),t.registerPlugin(new kh),t.registerPlugin(new hu),t.registerPlugin(new fh),t.registerPlugin(new gh),t.registerPlugin(new ih),t.registerPlugin(new yh),t}return Sh(t,e),t}(ml);function Lh(){Lh=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 f?e:f,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 k()}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")),h;r=u(i,e.iterator,n.arg);if("throw"===r.type)return n.method="throw",n.arg=r.arg,n.delegate=null,h;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,h):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,h)}(n,o);if(n){if(n===h)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===h)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 h={};function f(){}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=f.prototype=Object.create(e));function v(t){["next","throw","return"].forEach(function(e){a(t,e,function(t){return this._invoke(e,t)})})}function y(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:k}}function k(){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}},v(y.prototype),a(y.prototype,n,function(){return this}),o.AsyncIterator=y,o.async=function(t,e,n,r,i){void 0===i&&(i=Promise);var a=new y(s(t,e,n,r),i);return o.isGeneratorFunction(e)?a:a.next().then(function(t){return t.done?t.value:a.next()})},v(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,h):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),h},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),h}},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),h}},o}function Ch(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 Nh(){return(Nh=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 jh(t,e){return(jh=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var Rh=function(){function i(t){this.dragndropPluginOptions=void 0,this.dragndropPluginOptions=t}return i.prototype.apply=function(t){function e(t){var a,o,l,c,u,e,h=t.target,f=h===g,d=f&&p.dragndropPluginOptions.isDocumentDraggable?g:h.closest&&h.closest("[draggable=true]");d&&(a=!1,o=t.timeStamp,l=[t.clientX,t.clientY],c=null,u=[t.clientX,t.clientY],e=function(){s=Lh().mark(function t(e){var n,r,i;return Lh().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(a)t.next=8;else{if(n=e.timeStamp-o,r=_e([e.clientX,e.clientY],l),n<=p.dragndropPluginOptions.dragstartTimeThreshold||r<=p.dragndropPluginOptions.dragstartDistanceThreshold)return t.abrupt("return");t.next=5}break;case 5:e.type="dragstart",d.dispatchEvent(e),a=!0;case 8:if(e.type="drag",e.dx=e.clientX-u[0],e.dy=e.clientY-u[1],d.dispatchEvent(e),u=[e.clientX,e.clientY],f){t.next=21;break}return n="pointer"===p.dragndropPluginOptions.overlap?[e.canvasX,e.canvasY]:h.getBounds().center,t.next=17,g.elementsFromPoint(n[0],n[1]);case 17:r=t.sent,i=r[r.indexOf(h)+1],i=(null==i?void 0:i.closest("[droppable=true]"))||(p.dragndropPluginOptions.isDocumentDroppable?g:null),c!==i&&(c&&(e.type="dragleave",(e.target=c).dispatchEvent(e)),i&&(e.type="dragenter",(e.target=i).dispatchEvent(e)),c=i)&&(e.type="dragover",(e.target=c).dispatchEvent(e));case 21:case"end":return t.stop()}},t)});var s,e=function(){var t=this,o=arguments;return new Promise(function(e,n){var r=s.apply(t,o);function i(t){Ch(r,e,n,i,a,"next",t)}function a(t){Ch(r,e,n,i,a,"throw",t)}i(void 0)})};return function(t){return e.apply(this,arguments)}}(),r.addEventListener("pointermove",e),h.addEventListener("pointerup",t=function(t){a&&(t.detail={preventClick:!0},t=t.clone(),c&&(t.type="drop",(t.target=c).dispatchEvent(t)),t.type="dragend",d.dispatchEvent(t),a=!1),r.removeEventListener("pointermove",e)},{once:!0}),h.addEventListener("pointerupoutside",t,{once:!0}))}var p=this,n=t.renderingService,g=t.renderingContext.root.ownerDocument,r=g.defaultView;n.hooks.init.tap(i.tag,function(){r.addEventListener("pointerdown",e)}),n.hooks.destroy.tap(i.tag,function(){r.removeEventListener("pointerdown",e)})},i}(),Ih=(Rh.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),jh(r.prototype.constructor=r,t);var r=e.prototype;return r.init=function(){this.addRenderingPlugin(new Rh(Nh({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}(vl)),Bh=(Dh.prototype.on=function(t,e,n){return this._events[t]||(this._events[t]=[]),this._events[t].push({callback:e,once:!!n}),this},Dh.prototype.once=function(t,e){return this.on(t,e,!0)},Dh.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)},Dh.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},Dh.prototype.getEvents=function(){return this._events},Dh);function Dh(){this._events={}}const Fh=()=>[["cartesian"]],zh=(Fh.props={},(t={})=>{var e={startAngle:-Math.PI/2,endAngle:3*Math.PI/2,innerRadius:0,outerRadius:1};return Object.assign(Object.assign({},e),t)}),Wh=t=>{var{startAngle:t,endAngle:e,innerRadius:n,outerRadius:r}=zh(t);return[["translate",0,.5],["reflect.y"],["translate",0,-.5],["polar",t,e,n,r]]},Gh=(Wh.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]]),Hh=(Gh.props={},()=>[["transpose"],["translate",.5,.5],["reflect.x"],["translate",-.5,-.5]]),Yh=(Hh.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[...Hh(),...Wh({startAngle:e,endAngle:t,innerRadius:n,outerRadius:r})]}),Vh=(Yh.props={},(t={})=>{var e={startAngle:-Math.PI/2,endAngle:3*Math.PI/2,innerRadius:0,outerRadius:1};return Object.assign(Object.assign({},e),t)}),qh=t=>{var{startAngle:t,endAngle:e,innerRadius:n,outerRadius:r}=Vh(t);return[["transpose"],["translate",.5,.5],["reflect"],["translate",-.5,-.5],...Wh({startAngle:t,endAngle:e,innerRadius:n,outerRadius:r})]},$h=(qh.props={},()=>[["parallel",0,1,0,1]]),Uh=($h.props={},({focusX:t=0,focusY:e=0,distortionX:n=2,distortionY:r=2,visual:i=!1})=>[["fisheye",t,e,n,r,i]]),Xh=(Uh.props={transform:!0},t=>{var{startAngle:t=-Math.PI/2,endAngle:e=3*Math.PI/2,innerRadius:n=0,outerRadius:r=1}=t;return[...$h(),...Wh({startAngle:t,endAngle:e,innerRadius:n,outerRadius:r})]}),Kh=(Xh.props={},({value:e})=>t=>t.map(()=>e)),Zh=(Kh.props={},({value:e})=>t=>t.map(e)),Qh=(Zh.props={},({value:e})=>t=>t.map(t=>t[e])),Jh=(Qh.props={},({value:t})=>()=>t);function tf(t,e){return t.parent===e.parent?1:2}function ef(t,e){return t+e.x}function nf(t,e){return Math.max(t,e.y)}function rf(){var s=tf,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(ef,0)/e.length,t.y=1+n.reduce(nf,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 af(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 of(t,e){t instanceof Map?(t=[void 0,t],void 0===e&&(e=lf)):void 0===e&&(e=sf);for(var n,r,i,a,o,t=new hf(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 hf(i[a])),r.parent=n,r.depth=n.depth+1;return t.eachBefore(uf)}function sf(t){return t.children}function lf(t){return Array.isArray(t)?t[1]:null}function cf(t){void 0!==t.data.value&&(t.value=t.data.value),t.data=t.data.data}function uf(t){for(var e=0;t.height=e,(t=t.parent)&&t.height<++e;);}function hf(t){this.data=t,this.depth=this.height=0,this.parent=null}function ff(t){return null==t?null:df(t)}function df(t){if("function"!=typeof t)throw new Error;return t}function pf(){return 0}function gf(t){return function(){return t}}Jh.props={},hf.prototype=of.prototype={constructor:hf,count:function(){return this.eachAfter(af)},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 of(this).eachBefore(cf)},[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 mf=4294967296;function vf(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&&bf(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 wf(t[0],t[1]);case 3:return Mf(t[0],t[1],t[2])}}(o=function(t,e){var n,r;if(xf(e,t))return[e];for(n=0;n<t.length;++n)if(yf(e,t[n])&&xf(wf(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(yf(wf(t[n],t[r]),e)&&yf(wf(t[n],e),t[r])&&yf(wf(t[r],e),t[n])&&xf(Mf(t[n],t[r],e),t))return[t[n],t[r],e];throw new Error}(o,n)),i=0);return r}function yf(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 bf(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 xf(t,e){for(var n=0;n<e.length;++n)if(!bf(t,e[n]))return;return 1}function wf(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 Mf(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,h=i-o,f=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*h-c*f,g=(h*o-f*a)/(2*e)-r,s=(f*d-h*p)/e,l=(u*a-c*o)/(2*e)-i,n=(c*p-u*d)/e,f=s*s+n*n-1,h=2*(t+g*s+l*n),a=g*g+l*l-t*t,o=-(1e-6<Math.abs(f)?(h+Math.sqrt(h*h-4*f*a))/(2*f):a/h);return{x:r+g+s*o,y:i+l+n*o,r:o}}function kf(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 Ef(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 Of(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 Sf(t){this._=t,this.next=null,this.previous=null}function Af(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,h,f,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;kf(r,d,i=t[2]),d=new Sf(d),r=new Sf(r),i=new Sf(i),((d.next=i.previous=r).next=d.previous=i).next=r.previous=d;t:for(l=3;l<a;++l){kf(d._,r._,i=t[l]),i=new Sf(i),c=r.next,u=d.previous,h=r._.r,f=d._.r;do{if(h<=f){if(Ef(c._,i._)){r=c,(d.next=r).previous=d,--l;continue t}h+=c._.r,c=c.next}else{if(Ef(u._,i._)){((d=u).next=r).previous=d,--l;continue t}f+=u._.r,u=u.previous}}while(c!==u.next);for(i.previous=d,i.next=r,d.next=r.previous=r=i,o=Of(d);(i=i.next)!==r;)(s=Of(i))<o&&(d=i,o=s);r=d.next}for(d=[r._],i=r;(i=i.next)!==r;)d.push(i._);for(i=vf(d,e),l=0;l<a;++l)(d=t[l]).x-=i.x,d.y-=i.y;return i.r}function _f(t){return Math.sqrt(t.value)}function Tf(){var n=null,r=1,i=1,a=pf;function e(t){var e=function(){let t=1;return()=>(t=(1664525*t+1013904223)%mf)/mf}();return t.x=r/2,t.y=i/2,n?t.eachBefore(Pf(n)).eachAfter(Lf(a,.5,e)).eachBefore(Cf(1)):t.eachBefore(Pf(_f)).eachAfter(Lf(pf,1,e)).eachAfter(Lf(a,t.r/Math.min(r,i),e)).eachBefore(Cf(Math.min(r,i)/(2*t.r))),t}return e.radius=function(t){return arguments.length?(n=ff(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:gf(+t),e):a},e}function Pf(e){return function(t){t.children||(t.r=Math.max(0,+e(t)||0))}}function Lf(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=Af(e,l),a)for(n=0;n<i;++n)e[n].r-=a;t.r=r+a}}}function Cf(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 Nf(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 jf(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 Rf={depth:-1},If={},Bf={};function Df(t){return t.id}function Ff(t){return t.parentId}function zf(){var m,v=Df,y=Ff;function e(n){var e,t,r,i,a,o,s,l,c=Array.from(n),u=v,h=y,f=new Map;if(null!=m){const p=c.map((t,e)=>{t=m(t,e,n),e=(t=""+t).length;return"/"===(t=Gf(t,e-1)&&!Gf(t,e-2)?t.slice(0,-1):t)[0]?t:"/"+t}),g=p.map(Wf);var d=new Set(p).add("");for(const r of g)d.has(r)||(d.add(r),p.push(r),g.push(Wf(r)),c.push(Bf));u=(t,e)=>p[e],h=(t,e)=>g[e]}for(r=0,e=c.length;r<e;++r)t=c[r],o=c[r]=new hf(t),null!=(s=u(t,r,n))&&(s+="")&&(l=o.id=s,f.set(l,f.has(l)?If:o)),null!=(s=h(t,r,n))&&(s+="")&&(o.parent=s);for(r=0;r<e;++r)if(s=(o=c[r]).parent){if(!(a=f.get(s)))throw new Error("missing: "+s);if(a===If)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===Bf&&1===i.children.length;)i=i.children[0],--e;for(let t=c.length-1;0<=t&&(o=c[t]).data===Bf;--t)o.data=null}if(i.parent=Rf,i.eachBefore(function(t){t.depth=t.parent.depth+1,--e}).eachBefore(uf),i.parent=null,0<e)throw new Error("cycle");return i}return e.id=function(t){return arguments.length?(v=ff(t),e):v},e.parentId=function(t){return arguments.length?(y=ff(t),e):y},e.path=function(t){return arguments.length?(m=ff(t),e):m},e}function Wf(t){let e=t.length;if(e<2)return"";for(;1<--e&&!Gf(t,e););return t.slice(0,e)}function Gf(e,n){if("/"===e[n]){let t=0;for(;0<n&&"\\"===e[--n];)++t;if(0==(1&t))return 1}}function Hf(t,e){return t.parent===e.parent?1:2}function Yf(t){var e=t.children;return e?e[0]:t.t}function Vf(t){var e=t.children;return e?e[e.length-1]:t.t}function qf(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 $f(){var f=Hf,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 qf(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 qf(r[i],i)),n.parent=e;return(t.parent=new qf(null,0)).children=[t],t}(t);return s.eachAfter(h),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:f(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 h(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+f(t._,r._),t.m=t.z-e):t.z=e}else r&&(t.z=r.z+f(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,h=s.m;o=Vf(o),i=Yf(i),o&&i;)s=Yf(s),(a=Vf(a)).a=t,0<(r=o.z+u-i.z-l+f(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,h+=s.m,c+=a.m;o&&!Vf(a)&&(a.t=o,a.m+=u-c),i&&!Yf(s)&&(s.t=i,s.m+=l-h,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?(f=t,e):f},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 Uf(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}qf.prototype=Object.create(hf.prototype);e=(1+Math.sqrt(5))/2;function Xf(t,e,n,r,i,a){for(var o,s,l,c,u,h,f,d,p,g,m,v=[],y=e.children,b=0,x=0,w=y.length,M=e.value;b<w;){for(l=i-n,c=a-r;!(u=y[x++].value)&&x<w;);for(m=(h=f=u)*u*(g=Math.max(c/l,l/c)/(M*t)),p=Math.max(f/m,m/h);x<w;++x){if(u+=s=y[x].value,s<h&&(h=s),f<s&&(f=s),m=u*u*g,p<(d=Math.max(f/m,m/h))){u-=s;break}p=d}v.push(o={value:u,dice:l<c,children:y.slice(b,x)}),o.dice?jf(o,n,r,i,M?r+=c*u/M:a):Uf(o,n,r,M?n+=l*u/M:i,a),M-=u,b=x}return v}var Kf=function e(a){function t(t,e,n,r,i){Xf(a,t,e,n,r,i)}return t.ratio=function(t){return e(1<(t=+t)?t:1)},t}(e);function Zf(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,h=n-1;for(;u<h;){var f=u+h>>>1;m[f]<c?u=1+f:h=f}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 Qf(t,e,n,r,i){(1&t.depth?Uf:jf)(t,e,n,r,i)}var Jf=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,h=a.length,f=t.value;++u<h;){for(s=(o=a[u]).children,l=o.value=0,c=s.length;l<c;++l)o.value+=s[l].value;o.dice?jf(o,e,n,r,f?n+=(i-n)*o.value/f:i):Uf(o,e,n,f?e+=(r-e)*o.value/f:r,i),f-=o.value}else t._squarify=a=Xf(d,t,e,n,r,i),a.ratio=d}return t.ratio=function(t){return e(1<(t=+t)?t:1)},t}(e);function td(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 ed(t={}){return[...td(t),{name:"title",scale:"identity"}]}function nd(){return[{type:"maybeTitle",channel:"color"},{type:"maybeTooltip",channel:["x","y"]}]}function rd(){return[{type:"maybeTitle",channel:"x"},{type:"maybeTooltip",channel:["y"]}]}function id(t={}){return td(t)}function ad(){return[{type:"maybeKey"}]}function od(t,e){return t.getBandWidth(t.invert(e))}function sd(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:h=r,bandOffsetY:f=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?od(l,a[e]):0;var r=p?od(c,o[e]):0,e=g&&s?(od(u,s[e])/2+ +s[e])*n:0,[t,i]=t;return[t+h*n+e,i+f*r]}:t=>t}function ld(t){return parseFloat(t)/100}function cd(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?ld(e)*o:+e,"string"==typeof t?ld(t)*s:+t]]})]}function ud(e){return"function"==typeof e?e:t=>t[e]}function hd(t,e){return Array.from(t,ud(e))}function fd(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=hd(t,e),o=hd(t,n),s=hd(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 dd(t,e){return t.getBandWidth(t.invert(e))}const pd=()=>(t,e,n,i)=>{const{x:a,y:o,y1:s,series:l,size:r}=n,c=e.x,u=e.series,[h]=i.getSize(),f=r?r.map(t=>+t/h):null,d=r?(t,e,n)=>{t+=e/2,e=f[n];return[t-e/2,t+e/2]}:(t,e,n)=>[t,t+e];return[t,Array.from(t,t=>{var e=dd(c,a[t]),n=e*(u?dd(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))})]};pd.props={defaultShape:"rect",defaultLabelShape:"label",composite:!1,channels:[...ed({shapes:["rect","hollow","funnel","pyramid"]}),{name:"x",scale:"band",required:!0},{name:"y",required:!0},{name:"series",scale:"band"},{name:"size"}],preInference:[...ad(),{type:"maybeZeroY1"},{type:"maybeZeroX"}],postInference:[...rd()],interaction:{shareTooltip:!0}};const gd=()=>(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 md(t,e){return null==t||null==e?NaN:t<e?-1:e<t?1:e<=t?0:NaN}function vd(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=md,o=(t,e)=>md(n(t),e),(t,e)=>n(t)-e):(a=n===md||n===function(t,e){return null==t||null==e?NaN:e<t?-1:t<e?1:t<=e?0:NaN}?n:yd,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 yd(){return 0}function bd(t){return null===t?NaN:+t}gd.props={defaultShape:"rect",defaultLabelShape:"label",composite:!1,channels:[...ed({shapes:["rect","hollow"]}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...ad(),{type:"maybeZeroY1"}],postInference:[...rd()],interaction:{shareTooltip:!0}};pl=vd(md);const xd=pl.right,wd=pl.left,Md=vd(bd).center;function kd(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 Ed(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 Od(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 Sd{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 Ad 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(_d(this,t))}has(t){return super.has(_d(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 _d({_intern:t,_key:e},n){e=e(n);return t.has(e)?t.get(e):n}function Td(t){return t}function Pd(t,...e){return jd(t,Td,Td,e)}function Ld(t,...e){return jd(t,Array.from,Td,e)}function Cd(t,e,...n){return jd(t,Td,e,n)}function Nd(t,e,...n){return jd(t,Array.from,e,n)}function jd(t,u,h,f){return function t(e,n){if(n>=f.length)return h(e);var r=new Ad,i=f[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 Rd(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=Bd(r[t],r[e]);if(n)return n}})):(n=e.map(n),t.sort((t,e)=>Bd(n[t],n[e]))),r=e,Array.from(t,t=>r[t])):e.sort(Id(n))}function Id(r=md){if(r===md)return Bd;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 Bd(t,e){return(null==t||!(t<=t))-(null==e||!(e<=e))||(t<e?-1:e<t?1:0)}var Dd=Array.prototype.slice;function Fd(t){return()=>t}const zd=Math.sqrt(50),Wd=Math.sqrt(10),Gd=Math.sqrt(2);function Hd(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>=zd?10:r>=Wd?5:r>=Gd?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?Hd(t,e,2*n):[a,o,s]}function Yd(t,e,n){return Hd(t=+t,e=+e,n=+n)[2]}function Vd(t){return Math.max(1,Math.ceil(Math.log(kd(t))/Math.LN2)+1)}function qd(){var v=Td,y=Od,b=Vd;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]=v(t[a],a,t);var o=y(i),s=o[0],l=o[1],c=b(i,s,l);if(!Array.isArray(c)){var o=l,u=+c;if(y===Od&&([s,l]=function(t,e,n){let r;for(;;){var i=Yd(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?Hd(e,t,n):Hd(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=Yd(s,l,u)),c[c.length-1]>=l)if(l<=o&&y===Od){const n=Yd(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 h=c.length,f=0,d=h;c[f]<=s;)++f;for(;c[d-1]>l;)--d;(f||d<h)&&(c=c.slice(f,d),h=d-f);var p,g,m=new Array(h+1);for(a=0;a<=h;++a)(p=m[a]=[]).x0=0<a?c[a-1]:s,p.x1=a<h?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(h,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(h,g+(c[g]<=e))].push(t[a]))}else for(a=0;a<r;++a)null!=(e=i[a])&&s<=e&&e<=l&&m[xd(c,e,0,h)].push(t[a]);return m}return e.value=function(t){return arguments.length?(v="function"==typeof t?t:Fd(t),e):v},e.domain=function(t){return arguments.length?(y="function"==typeof t?t:Fd([t[0],t[1]]),e):y},e.thresholds=function(t){return arguments.length?(b="function"==typeof t?t:Fd(Array.isArray(t)?Dd.call(t):t),e):b},e}function $d(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 Ud(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 Xd(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 Kd(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 Zd(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?Bd:Id(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),Zd(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,h=n[r];let t=i,e=a;for(Qd(n,i,r),0<o(n[a],h)&&Qd(n,i,a);t<e;){for(Qd(n,t,e),++t,--e;o(n[t],h)<0;)++t;for(;0<o(n[e],h);)--e}0===o(n[i],h)?Qd(n,i,e):Qd(n,++e,a),e<=r&&(i=e+1),r<=e&&(a=e-1)}return n}function Qd(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function Jd(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?Xd(t):1<=e?$d(t):(n=(n-1)*e,(r=$d(Zd(t,e=Math.floor(n)).subarray(0,e+1)))+(Xd(t.subarray(e+1))-r)*(n-e))}function tp(n,t,r=bd){var i,e,a;if(!isNaN(t=+t))return i=Float64Array.from(n,(t,e)=>bd(r(n[e],e,n))),t<=0?Kd(i):1<=t?Ud(i):(e=Uint32Array.from(n,(t,e)=>e),a=i.length-1,Zd(e,t=Math.floor(a*t),0,a,(t,e)=>Bd(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<md(a,t):0===md(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 ep(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 np(t,e){return Jd(t,.5,e)}function rp(t){return Array.from(function*(t){for(const e of t)yield*e}(t))}function ip(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 ap(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 op(t){t=t.getOptions().transformations;return t.map(([t])=>t).filter(t=>"transpose"===t).length%2!=0}function sp(t){t=t.getOptions().transformations;return t.some(([t])=>"polar"===t)}function lp(t){t=t.getOptions().transformations;return t.some(([t])=>"reflect"===t)&&t.some(([t])=>t.startsWith("transpose"))}function cp(t){t=t.getOptions().transformations;return t.some(([t])=>"helix"===t)}function up(t){t=t.getOptions().transformations;return t.some(([t])=>"parallel"===t)}function hp(t){t=t.getOptions().transformations;return t.some(([t])=>"fisheye"===t)}function fp(t){return cp(t)||sp(t)}function dp(t){var t=t.getOptions()["transformations"],[,,,t,e]=t.find(t=>"polar"===t[0]);return[+t,+e]}function pp(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 gp=(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(Pd(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]},mp=(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})]},vp=()=>(t,e,n,r)=>{return(up(r)?mp:gp)(t,e,n,r)};vp.props={defaultShape:"line",defaultLabelShape:"label",composite:!1,channels:[...ed({shapes:["line","smooth"]}),{name:"x"},{name:"y"},{name:"position",independent:!0},{name:"size"},{name:"series",scale:"identity"}],preInference:[...ad(),{type:"maybeSeries"},{type:"maybeGradient"}],postInference:[...rd(),{type:"maybeTitle",channel:"color"},{type:"maybeTooltip",channel:["position"]}],interaction:{shareTooltip:!0,seriesTooltip:!0,crosshairs:!0}};const yp=g=>(t,e,n,o)=>{const{x:r,y:i,x1:a,y1:s,size:l,dx:c,dy:u}=n,[h,f]=o.getSize(),d=sd(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/h,r=r/f,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))])]};yp.props={defaultShape:"hollow",defaultLabelShape:"label",composite:!1,channels:[...ed({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:[...ad(),{type:"maybeZeroY"},{type:"maybeZeroX"}],postInference:[{type:"maybeSize"},...nd()]};const bp=s=>{var{cartesian:t=!1}=s;return t?cd:(t,e,n,r)=>{const{x:i,y:a}=n,o=sd(e,n,s);return[t,Array.from(t,t=>{var e=[+i[t],+a[t]];return[r.map(o(e,t))]})]}};bp.props={defaultShape:"text",defaultLabelShape:"label",composite:!1,channels:[...ed({shapes:["text","badge"]}),{name:"x",required:!0},{name:"y",required:!0},{name:"text",scale:"identity"},{name:"fontSize"},{name:"rotate"}],preInference:[...ad(),{type:"maybeTuple"},{type:"maybeVisualPosition"}],postInference:[...nd()]};const xp=()=>(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))})]};xp.props={defaultShape:"cell",defaultLabelShape:"label",composite:!1,channels:[...ed({shapes:["cell","hollow"]}),{name:"x",required:!0,scale:"band"},{name:"y",required:!0,scale:"band"}],preInference:[...ad(),{type:"maybeZeroX"},{type:"maybeZeroY"},{type:"maybeZeroPadding"}],postInference:[...nd()]};const wp=()=>(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(Pd(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,h=((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]+h]),r[n+t]=a.map([+o[i]+u,+l[i]+h])}return r}),t]};wp.props={defaultShape:"area",defaultLabelShape:"label",composite:!1,channels:[...ed({shapes:["area","smooth","hvh","hv","vh"]}),{name:"x",required:!0},{name:"y",required:!0},{name:"size"},{name:"series",scale:"identity"}],preInference:[...ad(),{type:"maybeSeries"},{type:"maybeZeroY1"},{type:"maybeZeroPadding"}],postInference:[...rd()],interaction:{shareTooltip:!0,seriesTooltip:!0,crosshairs:!0}};const Mp=c=>(t,e,n,r)=>{const{x:i,y:a,x1:o=i,y1:s=a}=n,l=sd(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]};Mp.props={defaultShape:"link",defaultLabelShape:"label",composite:!1,channels:[...ed({shapes:["link","arc","vhv","smooth"]}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...ad(),{type:"maybeIdentityY"},{type:"maybeIdentityX"}],postInference:[...nd()]};const kp=s=>{var t=s["cartesian"];return t?cd:(t,e,n,r)=>{const{x:i,y:a}=n,o=sd(e,n,s);return[t,Array.from(t,t=>{var e=[+i[t],+a[t]];return[r.map(o(e,t))]})]}};kp.props={defaultShape:"image",defaultLabelShape:"label",composite:!1,channels:[...ed({shapes:["image"]}),{name:"x",required:!0},{name:"y",required:!0},{name:"src",scale:"identity"},{name:"size"}],preInference:[...ad(),{type:"maybeTuple"},{type:"maybeVisualPosition"}],postInference:[...nd()]};const Ep=()=>(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]};Ep.props={defaultShape:"polygon",defaultLabelShape:"label",composite:!1,channels:[...ed({shapes:["polygon","ribbon"]}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...ad()],postInference:[...nd()]};const Op=()=>(t,e,n,s)=>{const{x:l,y:c,y1:u,y2:h,y3:f,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],+h[t],+f[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))})]},Sp=(Op.props={defaultShape:"box",defaultLabelShape:"label",composite:!1,channels:[...ed({shapes:["box"]}),{name:"x",scale:"band",required:!0},{name:"y",required:!0},{name:"series",scale:"band"}],preInference:[...ad(),{type:"maybeZeroX"}],postInference:[...rd()],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]});Sp.props={defaultShape:"vector",defaultLabelShape:"label",composite:!1,channels:[...ed({shapes:["vector"]}),{name:"x",required:!0},{name:"y",required:!0},{name:"rotate",required:!0,scale:"identity"},{name:"size",required:!0}],preInference:[...ad()],postInference:[...nd()]};const Ap=()=>(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))})]};Ap.props={defaultShape:"line",defaultLabelShape:"label",composite:!1,channels:[...id({shapes:["line"]}),{name:"y",required:!0}],preInference:[...ad(),{type:"maybeTupleY"}],postInference:[]};const _p=()=>(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))})]};_p.props={defaultShape:"line",defaultLabelShape:"label",composite:!1,channels:[...id({shapes:["line"]}),{name:"x",required:!0}],preInference:[...ad(),{type:"maybeTupleX"}],postInference:[]};const Tp=(...t)=>Mp(...t);function Pp(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 Lp(t={}){const{extendX:r=!1,extendY:s=!1}=t;return(t,e,n,i)=>{const a=Pp("x",r,n,e.x),o=Pp("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))})]}}Tp.props={defaultShape:"connector",defaultLabelShape:"label",composite:!1,channels:[...id({shapes:["connector"]}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...ad()],postInference:[]};const Cp=()=>Lp();Cp.props={defaultShape:"range",defaultLabelShape:"label",composite:!1,channels:[...id({shapes:["range"]}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...ad()],postInference:[]};const Np=()=>Lp({extendY:!0});Np.props={defaultShape:"range",defaultLabelShape:"label",composite:!1,channels:[...id({shapes:["range"]}),{name:"x",required:!0}],preInference:[...ad()],postInference:[]};const jp=()=>Lp({extendX:!0});function Rp(t){return t.target.depth}function Ip(t,e){return t.sourceLinks.length?t.depth:e-1}function Bp(t){return function(){return t}}function Dp(t,e){return zp(t.source,e.source)||t.index-e.index}function Fp(t,e){return zp(t.target,e.target)||t.index-e.index}function zp(t,e){return t.y0-e.y0}function Wp(t){return t.value}function Gp(t){return t.index}function Hp(t){return t.nodes}function Yp(t){return t.links}function Vp(t,e){t=t.get(e);if(t)return t;throw new Error("missing: "+e)}function qp({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 $p(){let x=0,w=0,M=1,k=1,E=24,O=8,S,A=Gp,_=Ip,T,P,L,C=Hp,N=Yp,j=6;function e(e){e={nodes:C(e),links:N(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=>[A(t),t]));if(t.forEach((t,e)=>{t.index=e;let{source:n,target:r}=t;"object"!=typeof n&&(n=t.source=Vp(g,n)),"object"!=typeof r&&(r=t.target=Vp(g,r)),n.sourceLinks.push(t),r.targetLinks.push(t)}),null!=L)for(var{sourceLinks:n,targetLinks:r}of i)n.sort(L),r.sort(L)}t=e.nodes;for(const m of t)m.value=void 0===m.fixedValue?Math.max(ap(m.sourceLinks,Wp),ap(m.targetLinks,Wp)):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(T){var s,l=Math.max($d(a,t=>t.depth)+1,0);for(let t=0;t<a.length;t++)(s=a[t]).depth=T.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($d(t,t=>t.depth)+1,0),n=(M-x-E)/(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(_.call(null,a,e))));a.layer=i,a.x0=x+i*n,a.x1=a.x0+E,r[i]?r[i].push(a):r[i]=[a]}if(P)for(const o of r)o.sort(P);return r}(e),t=(S=Math.min(O,(k-w)/($d(u,t=>t.length)-1)),u),h=Xd(t,t=>(k-w-(t.length-1)*S)/ap(t,Wp));for(const v of t){let e=w;for(const y of v){y.y0=e,y.y1=e+y.value*h,e=y.y1+S;for(const b of y.sourceLinks)b.width=b.value*h}e=(k-e+S)/(v.length+1);for(let t=0;t<v.length;++t){var f=v[t];f.y0+=e*(t+1),f.y1+=e*(t+1)}!function(t){if(void 0===L)for(var{sourceLinks:e,targetLinks:n}of t)e.sort(Fp),n.sort(Dp)}(v)}for(let t=0;t<j;++t){var d=Math.pow(.99,t),p=Math.max(1-d,(t+1)/j);!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)*S/2;for(var{source:r,width:i}of e.targetLinks){if(r===t)break;n+=i+S}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===P&&o.sort(zp),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)*S/2;for(var{target:r,width:i}of t.sourceLinks){if(r===e)break;n+=i+S}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===P&&o.sort(zp),o.length&&R(o,i)}}(u,d,p)}return qp(e),e}function R(t,e){var n=t.length>>1,r=t[n];a(t,r.y0-S,n-1,e),i(t,r.y1+S,1+n,e),a(t,k,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+S}}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-S}}function I({sourceLinks:t,targetLinks:e}){if(void 0===L){for(const{source:{sourceLinks:t}}of e)t.sort(Fp);for(const{target:{targetLinks:e}}of t)e.sort(Dp)}}return e.update=function(t){return qp(t),t},e.nodeId=function(t){return arguments.length?(A="function"==typeof t?t:Bp(t),e):A},e.nodeAlign=function(t){return arguments.length?(_="function"==typeof t?t:Bp(t),e):_},e.nodeDepth=function(t){return arguments.length?(T=t,e):T},e.nodeSort=function(t){return arguments.length?(P=t,e):P},e.nodeWidth=function(t){return arguments.length?(E=+t,e):E},e.nodePadding=function(t){return arguments.length?(O=S=+t,e):O},e.nodes=function(t){return arguments.length?(C="function"==typeof t?t:Bp(t),e):C},e.links=function(t){return arguments.length?(N="function"==typeof t?t:Bp(t),e):N},e.linkSort=function(t){return arguments.length?(L=t,e):L},e.size=function(t){return arguments.length?(x=w=0,M=+t[0],k=+t[1],e):[M-x,k-w]},e.extent=function(t){return arguments.length?(x=+t[0][0],M=+t[1][0],w=+t[0][1],k=+t[1][1],e):[[x,w],[M,k]]},e.iterations=function(t){return arguments.length?(j=+t,e):j},e}jp.props={defaultShape:"range",defaultLabelShape:"label",composite:!1,channels:[...id({shapes:["range"]}),{name:"y",required:!0}],preInference:[...ad()],postInference:[]};const Up={nodeAlign:"justify",nodeWidth:.008,nodePadding:.03,nodes:t=>t.nodes,links:t=>t.links,nodeSort:void 0,linkSort:void 0,iterations:6},Xp={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?Xd(t.sourceLinks,Rp)-1:0},justify:Ip};const Kp=h=>t=>{var{nodeId:e,nodeSort:n,nodeAlign:r,nodeWidth:i,nodePadding:a,nodeDepth:o,nodes:s,links:l,linkSort:c,iterations:u}=Object.assign({},Up,h),l=$p().nodeSort(n).linkSort(c).links(l).nodes(s).nodeWidth(i).nodePadding(a).nodeDepth(o).nodeAlign("string"==(c=typeof(n=r))?Xp[n]||Ip:"function"==c?n:Ip).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 Zp(t){return t}function Qp(t){return t.reduce((n,r)=>(t,...e)=>r(n(t,...e),...e),Zp)}function Jp(t){return t.replace(/( |^)[a-z]/g,t=>t.toUpperCase())}function t0(t=""){throw new Error(t)}function e0(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 n0(t){return null!=t&&!Number.isNaN(t)}function at(t,e){return r0(t,e)||{}}function r0(t,n){t=Object.entries(t||{}).filter(([t])=>t.startsWith(n)).map(([t,e])=>[en(t.replace(n,"").trim()),e]).filter(([t])=>!!t);return 0===t.length?null:Object.fromEntries(t)}function i0(t,...n){return Object.fromEntries(Object.entries(t).filter(([e])=>n.every(t=>!e.startsWith(t))))}function a0(t,e){return void 0===t?null:"number"==typeof t?t:(t=+t.replace("%",""),Number.isNaN(t)?null:t/100*e)}function o0(t){return!("object"!=typeof t||t instanceof Date||null===t||Array.isArray(t))}function s0(t){return null===t||!1===t}function l0(t,e,n={},r=!1){return s0(t)||Array.isArray(t)&&r?t:(r=at(t,e),ot(n,r))}function c0(t,e={}){return!s0(t)&&!Array.isArray(t)&&u0(t)?ot(e,t):t}function u0(t){var e;return 0===Object.keys(t).length||({title:t,items:e}=t,void 0!==t)||void 0!==e}function h0(t,e){return"object"==typeof t?at(t,e):t}Kp.props={};const f0={nodeId:t=>t.key,nodeWidth:.02,nodePadding:.02},d0={type:"polygon",axis:!1,legend:!1,encode:{shape:"polygon",x:"x",y:"y"},scale:{x:{type:"identity"},y:{type:"identity"}},style:{stroke:"#000"}},p0={type:"polygon",axis:!1,legend:!1,encode:{shape:"ribbon",x:"x",y:"y"},style:{fillOpacity:.5,stroke:void 0}},g0={textAlign:t=>t.x[0]<.5?"start":"end",position:t=>t.x[0]<.5?"right":"left",fontSize:10},m0=t=>{var{data:t,encode:e={},scale:n,style:r={},layout:i={},nodeLabels:a=[],linkLabels:o=[],animate:s={},tooltip:l={}}=t,{links:t,nodes:c}=fd(t,e),u=at(e,"node"),e=at(e,"link"),{key:h=t=>t.key,color:f=h}=u,{links:i,nodes:t}=Kp(Object.assign(Object.assign(Object.assign({},f0),{nodeId:ud(h)}),i))({links:t,nodes:c});const d=at(r,"label"),{text:p=h,spacing:g=5}=d,m=it(d,["text","spacing"]),v=ud(h);c=l0(l,"node",{title:v,items:[{field:"value"}]},!0),h=l0(l,"link",{title:"",items:[t=>({name:"source",value:v(t.source)}),t=>({name:"target",value:v(t.target)})]});return[ot({},d0,{data:t,encode:Object.assign(Object.assign({},u),{color:f}),scale:n,style:at(r,"node"),labels:[Object.assign(Object.assign(Object.assign({},g0),{text:p,dx:t=>t.x[0]<.5?g:-g}),m),...a],tooltip:c,animate:h0(s,"node"),axis:!1}),ot({},p0,{data:i,encode:e,labels:o,style:Object.assign({fill:e.color?void 0:"#aaa",strokeWidth:0},at(r,"link")),tooltip:h,animate:h0(s,"link")})]},v0=(m0.props={},t=>(t,e,n,r)=>[t,t.map(()=>[[0,0]])]);function y0(t,e,n){const r=n["value"];var o,i,a,s,l,c,u,h,f,d,n=function(t,e){var n={treemapBinary:Zf,treemapDice:jf,treemapSlice:Uf,treemapSliceDice:Qf,treemapSquarify:Kf,treemapResquarify:Jf};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?zf().path(p):zf():of)(t));function g(t){return t.x0=t.y0=0,t.x1=a,t.y1=s,t.eachBefore(m),l=[0],i&&t.eachBefore(Nf),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-=h(t)-e)<n&&(n=i=(n+i)/2),(a-=f(t)-e)<r&&(r=a=(r+a)/2),o(t,n,r,i,a))}return r?p.sum(t=>e.ignoreParentValue&&t.children?0:ud(r)(t)).sort(e.sort):p.count(),o=Kf,i=!1,s=a=1,l=[0],d=f=h=u=c=pf,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=df(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:gf(+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:gf(+t),g):u},g.paddingRight=function(t){return arguments.length?(h="function"==typeof t?t:gf(+t),g):h},g.paddingBottom=function(t){return arguments.length?(f="function"==typeof t?t:gf(+t),g):f},g.paddingLeft=function(t){return arguments.length?(d="function"==typeof t?t:gf(+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)}v0.props={defaultShape:"path",defaultLabelShape:"label",composite:!1,channels:[...ed({shapes:["path","hollow"]}),{name:"d",scale:"identity"}],preInference:[...ad()],postInference:[]};const b0={fontSize:10,text:t=>t.data.name,position:"inside",fill:"#000",textOverflow:"clip",wordWrap:!0,maxLines:1,wordWrapWidth:t=>t.x1-t.x0},x0={title:t=>t.data.name,items:[{field:"value"}]},w0=(t,e)=>{var{width:e,height:n}=e,{data:r,encode:i={},scale:a,style:o={},layout:s={},labels:l=[],tooltip:c={}}=t,t=it(t,["data","encode","scale","style","layout","labels","tooltip"]),r=y0(r,ot({},(r=e,u=n,{tile:"treemapSquarify",ratio:.5*(1+Math.sqrt(5)),size:[r,u],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}),s),i),u=at(o,"label");return ot({},{type:"rect",axis:!1,encode:{x:"x",y:"y",color:t=>t.data.parent.name},scale:{x:{domain:[0,e],range:[0,1]},y:{domain:[0,n],range:[0,1]}},style:{stroke:"#fff"}},Object.assign(Object.assign({data:r,encode:i,scale:a,style:o,labels:[Object.assign(Object.assign({},b0),u),...l]},t),{tooltip:c0(c,x0),axis:!1}))},M0=(w0.props={},{text:"",position:"inside",textOverflow:"clip",wordWrap:!0,maxLines:1,wordWrapWidth:t=>2*t.r}),k0={title:t=>t.data.name,items:[{field:"value"}]},E0=(t,e)=>{var{width:e,height:n}=e,{data:r,encode:i={},scale:a={},style:o={},layout:s={},labels:l=[],tooltip:c={}}=t,t=it(t,["data","encode","scale","style","layout","labels","tooltip"]),u={type:"point",axis:!1,legend:!1,scale:{x:{domain:[0,e]},y:{domain:[0,n]},size:{type:"identity"}},encode:{x:"x",y:"y",size:"r",shape:"point"},style:{fill:i.color?void 0:t=>0===t.height?"#ddd":"#fff",stroke:i.color?void 0:t=>0===t.height?"":"#000"}},r=((t,e,n)=>{const r=n["value"];n=(He(t)?zf().path(e.path):of)(t);return r?n.sum(t=>ud(r)(t)).sort(e.sort):n.count(),Tf().size(e.size).padding(e.padding)(n),n.descendants()})(r,ot({},{size:[e,n],padding:0,sort:(t,e)=>e.value-t.value},s),ot({},u.encode,i)),e=at(o,"label");return ot({},u,Object.assign(Object.assign({data:r,encode:i,scale:a,style:o,labels:[Object.assign(Object.assign({},M0),e),...l]},t),{tooltip:c0(c,k0),axis:!1}))};function O0(t,e){return Xd(t,t=>e[t])}function S0(t,e){return $d(t,t=>e[t])}function A0(t,e){const n=2.5*_0(t,e)-1.5*P0(t,e);return Xd(t,t=>e[t]>=n?e[t]:NaN)}function _0(t,e){return Jd(t,.25,t=>e[t])}function T0(t,e){return Jd(t,.5,t=>e[t])}function P0(t,e){return Jd(t,.75,t=>e[t])}function L0(t,e){const n=2.5*P0(t,e)-1.5*_0(t,e);return $d(t,t=>e[t]<=n?e[t]:NaN)}function C0(){return(t,e)=>{var n=e["encode"],{y:n,x:r}=n;const i=n["value"],a=r["value"];return[Array.from(Pd(t,t=>a[+t]).values()).flatMap(t=>{const e=A0(t,i),n=L0(t,i);return t.filter(t=>i[t]<e||i[t]>n)}),e]}}E0.props={};const N0=t=>{var e,{data:n,encode:r,style:i={},tooltip:a={},animate:o}=t,t=it(t,["data","encode","style","tooltip","transform","animate"]),{point:s=!0}=i,i=it(i,["point"]),l=r["y"],l={y:l,y1:l,y2:l,y3:l,y4:l},c={y1:_0,y2:T0,y3:P0},u=l0(a,"box",{items:[{channel:"y",name:"min"},{channel:"y1",name:"q1"},{channel:"y2",name:"q2"},{channel:"y3",name:"q3"},{channel:"y4",name:"max"}]},!0),a=l0(a,"point",{title:{channel:"x"},items:[{name:"outlier",channel:"y"}]});return s?(s=at(i,"box"),e=at(i,"point"),[Object.assign({type:"box",data:n,transform:[Object.assign(Object.assign({type:"groupX",y:A0},c),{y4:L0})],encode:Object.assign(Object.assign({},r),l),style:s,tooltip:u,animate:h0(o,"box")},t),{type:"point",data:n,transform:[{type:C0}],encode:r,style:Object.assign({},e),tooltip:a,animate:h0(o,"point")}]):Object.assign({type:"box",data:n,transform:[Object.assign(Object.assign({type:"groupX",y:O0},c),{y4:S0})],encode:Object.assign(Object.assign({},r),l),style:i,tooltip:u},t)},j0=(N0.props={},s=>{var t=s["cartesian"];return t?cd:(t,e,n,r)=>{const{x:i,y:a}=n,o=sd(e,n,s);return[t,Array.from(t,t=>{var e=[+i[t],+a[t]];return[r.map(o(e,t))]})]}});function R0(t,e,n,r){if(!isNaN(e)&&!isNaN(n)){var i,a,o,s,l,c,u,h,f,d=t._root,p={data:r},g=t._x0,m=t._y0,v=t._x1,y=t._y1;if(d){for(;d.length;)if((c=e>=(a=(g+v)/2))?g=a:v=a,(u=n>=(o=(m+y)/2))?m=o:y=o,!(d=(i=d)[h=u<<1|c]))return i[h]=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[h]=p:t._root=p;else{for(;i=i?i[h]=new Array(4):t._root=new Array(4),(c=e>=(a=(g+v)/2))?g=a:v=a,(u=n>=(o=(m+y)/2))?m=o:y=o,(h=u<<1|c)==(f=(o<=l)<<1|a<=s););i[f]=d,i[h]=p}}else t._root=p}return t}function I0(t,e,n,r,i){this.node=t,this.x0=e,this.y0=n,this.x1=r,this.y1=i}function B0(t){return t[0]}function D0(t){return t[1]}function F0(t,e,n){e=new z0(null==e?B0:e,null==n?D0:n,NaN,NaN,NaN,NaN);return null==t?e:e.addAll(t)}function z0(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 W0(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}j0.props={defaultShape:"shape",defaultLabelShape:"label",composite:!1,channels:[{name:"x",required:!0},{name:"y",required:!0}],preInference:[...ad(),{type:"maybeTuple"},{type:"maybeVisualPosition"},{type:"maybeFunctionAttribute"}]};Fo=F0.prototype=z0.prototype;function G0(t){return function(){return t}}function H0(t){return 1e-6*(t()-.5)}function Y0(t){return t.index}function V0(t,e){t=t.get(e);if(t)return t;throw new Error("node not found: "+e)}function q0(c){var u,h,a,o,f,d,s=Y0,n=function(t){return 1/Math.min(o[t.source.index],o[t.target.index])},r=G0(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||H0(d),o=i.y+i.vy-r.y-r.vy||H0(d),a*=s=((s=Math.sqrt(a*a+o*o))-h[l])/s*t*u[l],o*=s,i.vx-=a*(s=f[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=V0(r,t.source)),"object"!=typeof t.target&&(t.target=V0(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,f=new Array(n);i<n;++i)t=c[i],f[i]=o[t.source.index]/(o[t.source.index]+o[t.target.index]);u=new Array(n),l(),h=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)h[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:G0(+t),l(),e):n},e.distance=function(t){return arguments.length?(r="function"==typeof t?t:G0(+t),g(),e):r},e}Fo.copy=function(){var t,e,n=new z0(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]=W0(e));else n._root=W0(r);return n},Fo.add=function(t){var e=+this._x.call(null,t),n=+this._y.call(null,t);return R0(this.cover(e,n),e,n,t)},Fo.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)R0(this,i[u],a[u],t[u]);return this},Fo.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},Fo.data=function(){var e=[];return this.visit(function(t){if(!t.length)for(;e.push(t.data),t=t.next;);}),e},Fo.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]]},Fo.find=function(t,e,n){var r,i,a,o,s,l,c,u,h=this._x0,f=this._y0,d=this._x1,p=this._y1,g=[],m=this._root;for(m&&g.push(new I0(m,h,f,d,p)),null==n?n=1/0:(h=t-n,f=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)<h||(i=r.y1)<f||(m.length?(g.push(new I0(m[3],a=(s+o)/2,c=(l+i)/2,o,i),new I0(m[2],s,c,a,i),new I0(m[1],a,l,o,c),new I0(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&&(h=t-(c=Math.sqrt(n=l)),f=e-c,d=t+c,p=e+c,u=m.data));return u},Fo.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,h,f=this._root,d=this._x0,p=this._y0,g=this._x1,m=this._y1;if(f){if(f.length)for(;;){if((l=a>=(s=(d+g)/2))?d=s:g=s,(c=o>=(s=(p+m)/2))?p=s:m=s,!(f=(e=f)[u=c<<1|l]))return this;if(!f.length)break;(e[u+1&3]||e[u+2&3]||e[u+3&3])&&(n=e,h=u)}for(;f.data!==t;)if(!(f=(r=f).next))return this;(i=f.next)&&delete f.next,r?i?r.next=i:delete r.next:e?(i?e[u]=i:delete e[u],(f=e[0]||e[1]||e[2]||e[3])&&f===(e[3]||e[2]||e[1]||e[0])&&!f.length&&(n?n[h]=f:this._root=f)):this._root=i}}return this},Fo.removeAll=function(t){for(var e=0,n=t.length;e<n;++e)this.remove(t[e]);return this},Fo.root=function(){return this._root},Fo.size=function(){var e=0;return this.visit(function(t){if(!t.length)for(;++e,t=t.next;);}),e},Fo.visit=function(t){var e,n,r,i,a,o,s,l=[],c=this._root;for(c&&l.push(new I0(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 I0(e,o,s,i,a)),(e=c[2])&&l.push(new I0(e,n,s,o,a)),(e=c[1])&&l.push(new I0(e,o,r,i,s)),e=c[0])&&l.push(new I0(e,n,r,o,s));return this},Fo.visitAfter=function(t){var e,n=[],r=[];for(this._root&&n.push(new I0(this._root,this._x0,this._y0,this._x1,this._y1));e=n.pop();){var i,a,o,s,l,c,u,h=e.node;h.length&&(a=e.x0,o=e.y0,c=(a+(s=e.x1))/2,u=(o+(l=e.y1))/2,(i=h[0])&&n.push(new I0(i,a,o,c,u)),(i=h[1])&&n.push(new I0(i,c,o,s,u)),(i=h[2])&&n.push(new I0(i,a,u,c,l)),i=h[3])&&n.push(new I0(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},Fo.x=function(t){return arguments.length?(this._x=t,this):this._x},Fo.y=function(t){return arguments.length?(this._y=t,this):this._y};var $0={value:()=>{}};function U0(){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 X0(r)}function X0(t){this._=t}function K0(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=$0,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=n&&t.push({name:e,value:n}),t}X0.prototype=U0.prototype={constructor:X0,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]=K0(i[n],t.name,e);else if(null==e)for(n in i)i[n]=K0(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 X0(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 Z0,Q0,J0=0,tg=0,eg=0,ng=1e3,rg=0,ig=0,ag=0,og="object"==typeof performance&&performance.now?performance:Date,sg="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function lg(){return ig||(sg(cg),ig=og.now()+ag)}function cg(){ig=0}function ug(){this._call=this._time=this._next=null}function hg(t,e,n){var r=new ug;return r.restart(t,e,n),r}function fg(){ig=(rg=og.now())+ag,J0=tg=0;try{lg(),++J0;for(var t,e=Z0;e;)0<=(t=ig-e._time)&&e._call.call(void 0,t),e=e._next;--J0}finally{for(var n,r,i=Z0,a=1/(J0=0);i;)i=i._call?(a>i._time&&(a=i._time),(n=i)._next):(r=i._next,i._next=null,n?n._next=r:Z0=r);Q0=n,pg(a),ig=0}}function dg(){var t=og.now(),e=t-rg;ng<e&&(ag-=e,rg=t)}function pg(t){J0||(tg=tg&&clearTimeout(tg),24<t-ig?(t<1/0&&(tg=setTimeout(fg,t-og.now()-ag)),eg=eg&&clearInterval(eg)):(eg||(rg=og.now(),eg=setInterval(dg,ng)),J0=1,sg(fg)))}ug.prototype=hg.prototype={constructor:ug,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?lg():+n)+(null==e?0:+e),this._next||Q0===this||(Q0?Q0._next=this:Z0=this,Q0=this),this._call=t,this._time=n,pg()},stop:function(){this._call&&(this._call=null,this._time=1/0,pg())}};const gg=4294967296;function mg(t){return t.x}function vg(t){return t.y}var yg=10,bg=Math.PI*(3-Math.sqrt(5));function xg(l){var a,o=1,e=.001,s=1-Math.pow(e,1/300),c=0,u=.6,h=new Map,t=hg(i),n=U0("tick","end"),r=function(){let t=1;return()=>(t=(1664525*t+1013904223)%gg)/gg}();function i(){f(),n.call("tick",a),o<e&&(t.stop(),n.call("end",a))}function f(t){var e,n,r=l.length;void 0===t&&(t=1);for(var i=0;i<t;++i)for(o+=(c-o)*s,h.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=yg*Math.sqrt(.5+r),e=r*bg,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:f,restart:function(){return t.restart(i),a},stop:function(){return t.stop(),a},nodes:function(t){return arguments.length?(l=t,d(),h.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,h.forEach(p),a):r},force:function(t,e){return 1<arguments.length?(null==e?h.delete(t):h.set(t,p(e)),a):h.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)}}}const wg={joint:!0},Mg={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}},kg={type:"point",axis:!1,legend:!1,encode:{x:"x",y:"y",size:5,color:"group",shape:"point"},scale:{color:{type:"ordinal"}},style:{stroke:"#fff"}},Eg={text:""};function Og(t,e,n){var i,l,c,u,h,r,f,d,p,{nodes:t,links:a}=t,{joint:e,nodeStrength:o,linkStrength:s}=e,{linkKey:n=t=>t.id}=n,I=(r=G0(-30),d=(f=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:G0(+t),B(),g):r},g.distanceMin=function(t){return arguments.length?(f=t*t,g):Math.sqrt(f)},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=F0(i,mg,vg).visitAfter(D);for(u=t,e=0;e<n;++e)l=i[e],r.visit(F)}function B(){if(i){var t,e,n=i.length;for(h=new Array(n),t=0;t<n;++t)e=i[t],h[e.index]=+r(e,t,i)}}function D(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+=h[e.data.index],e=e.next;);t.value=o}function F(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=H0(c))*i),0===a&&(s+=(a=H0(c))*a),s<f&&(s=Math.sqrt(f*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=H0(c))*i),0===a&&(s+=(a=H0(c))*a),s<f)&&(s=Math.sqrt(f*s));t.data!==l&&(o=h[t.data.index]*u/s,l.vx+=i*o,l.vy+=a*o),t=t.next;);}var m,v,y,b,x,w,M,k,E,O,S,A,_,T,n=q0(a).id(ud(n)),P=("function"==typeof o&&I.strength(o),"function"==typeof s&&n.strength(s),xg(t).force("link",n).force("charge",I));function L(t){for(var e,n=0,r=v.length;n<r;++n)(e=v[n]).vy+=(b[n]-e.y)*y[n]*t}function C(){if(v){var t,e=v.length;for(y=new Array(e),b=new Array(e),t=0;t<e;++t)y[t]=isNaN(b[t]=+m(v[t],t,v))?0:+x(v[t],t,v)}}function N(t){for(var e,n=0,r=M.length;n<r;++n)(e=M[n]).vx+=(E[n]-e.x)*k[n]*t}function j(){if(M){var t,e=M.length;for(k=new Array(e),E=new Array(e),t=0;t<e;++t)k[t]=isNaN(E[t]=+w(M[t],t,M))?0:+O(M[t],t,M)}}function R(){for(var t,e=_.length,n=0,r=0,i=0;i<e;++i)n+=(t=_[i]).x,r+=t.y;for(n=(n/e-S)*T,r=(r/e-A)*T,i=0;i<e;++i)(t=_[i]).x-=n,t.y-=r}e?P.force("center",(T=1,null==S&&(S=0),null==A&&(A=0),R.initialize=function(t){_=t},R.x=function(t){return arguments.length?(S=+t,R):S},R.y=function(t){return arguments.length?(A=+t,R):A},R.strength=function(t){return arguments.length?(T=+t,R):T},R)):P.force("x",(O=G0(.1),"function"!=typeof w&&(w=G0(null==w?0:+w)),N.initialize=function(t){M=t,j()},N.strength=function(t){return arguments.length?(O="function"==typeof t?t:G0(+t),j(),N):O},N.x=function(t){return arguments.length?(w="function"==typeof t?t:G0(+t),j(),N):w},N)).force("y",(x=G0(.1),"function"!=typeof m&&(m=G0(null==m?0:+m)),L.initialize=function(t){v=t,C()},L.strength=function(t){return arguments.length?(x="function"==typeof t?t:G0(+t),C(),L):x},L.y=function(t){return arguments.length?(m="function"==typeof t?t:G0(+t),C(),L):m},L)),P.stop();var z=Math.ceil(Math.log(P.alphaMin())/Math.log(1-P.alphaDecay()));for(let t=0;t<z;t++)P.tick();return{nodesData:t,linksData:a}}const Sg=t=>{var{data:t,encode:e={},scale:n,style:r={},layout:i={},nodeLabels:a=[],linkLabels:o=[],animate:s={},tooltip:l={}}=t;const{nodeKey:c=t=>t.id,linkKey:u=t=>t.id}=e,h=it(e,["nodeKey","linkKey"]);var e=Object.assign({nodeKey:c,linkKey:u},h),f=at(e,"node"),d=at(e,"link"),{links:t,nodes:p}=fd(t,e),{nodesData:t,linksData:p}=Og({links:t,nodes:p},ot({},wg,i),e),i=l0(l,"link",{items:[t=>({name:"source",value:ud(u)(t.source)}),t=>({name:"target",value:ud(u)(t.target)})]}),e=l0(l,"node",{items:[t=>({name:"key",value:ud(c)(t)})]},!0);return[ot({},Mg,{data:p,encode:d,labels:o,style:at(r,"link"),tooltip:i,animate:h0(s,"link")}),ot({},kg,{data:t,encode:Object.assign({},f),scale:n,style:at(r,"node"),tooltip:e,labels:[Object.assign(Object.assign({},Eg),at(r,"label")),...a],animate:h0(s,"link")})]},Ag=(Sg.props={},h=>u=>t=>{const{field:e="value",nodeSize:n,separation:r,sortBy:i,as:a=["x","y"]}=u,[o,s]=a;var t=of(t,t=>t.children).sum(t=>t[e]).sort(i),l=h();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}}),_g=t=>Ag(rf)(t),Tg=(_g.props={},t=>Ag($f)(t)),Pg=(Tg.props={},{sortBy:(t,e)=>e.value-t.value}),Lg={axis:!1,legend:!1,type:"point",encode:{x:"x",y:"y",size:2,shape:"point"}},Cg={type:"link",encode:{x:"x",y:"y",shape:"smooth"}},Ng={text:"",fontSize:10},jg=t=>{var{data:t,encode:e={},scale:n={},style:r={},layout:i={},nodeLabels:a=[],linkLabels:o=[],animate:s={},tooltip:l={}}=t,c=null==e?void 0:e.value,{nodes:i,edges:c}=Tg(Object.assign(Object.assign(Object.assign({},Pg),i),{field:c}))(t),t=l0(l,"node",{title:"name",items:["value"]},!0),l=l0(l,"link",{title:"",items:[t=>({name:"source",value:t.source.name}),t=>({name:"target",value:t.target.name})]});return[ot({},Cg,{data:c,encode:at(e,"link"),scale:at(n,"link"),labels:o,style:Object.assign({stroke:"#999"},at(r,"link")),tooltip:l,animate:h0(s,"link")}),ot({},Lg,{data:i,scale:at(n,"node"),encode:at(e,"node"),labels:[Object.assign(Object.assign({},Ng),at(r,"label")),...a],style:Object.assign({},at(r,"node")),tooltip:t,animate:h0(s,"node")})]};jg.props={};var Rg={},Ig={},Bg=34,Dg=10,Fg=13;function zg(t){return new Function("d","return {"+t.map(function(t,e){return JSON.stringify(t)+": d["+e+'] || ""'}).join(",")+"}")}function Wg(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 Gg(t,e){var t=t+"",n=t.length;return n<e?new Array(e-n+1).join(0)+t:t}function Hg(t){var e,n=t.getUTCHours(),r=t.getUTCMinutes(),i=t.getUTCSeconds(),a=t.getUTCMilliseconds();return isNaN(t)?"Invalid Date":((e=t.getUTCFullYear())<0?"-"+Gg(-e,6):9999<e?"+"+Gg(e,6):Gg(e,4))+"-"+Gg(t.getUTCMonth()+1,2)+"-"+Gg(t.getUTCDate(),2)+(a?"T"+Gg(n,2)+":"+Gg(r,2)+":"+Gg(i,2)+"."+Gg(a,3)+"Z":i?"T"+Gg(n,2)+":"+Gg(r,2)+":"+Gg(i,2)+"Z":r||n?"T"+Gg(n,2)+":"+Gg(r,2)+"Z":"")}function Yg(r){var e=new RegExp('["'+r+"\n\r]"),h=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 Ig;if(l)return l=!1,Rg;var t,e,n=a;if(r.charCodeAt(n)===Bg){for(;a++<i&&r.charCodeAt(a)!==Bg||r.charCodeAt(++a)===Bg;);return(t=a)>=i?s=!0:(e=r.charCodeAt(a++))===Dg?l=!0:e===Fg&&(l=!0,r.charCodeAt(a)===Dg)&&++a,r.slice(n+1,t-1).replace(/""/g,'"')}for(;a<i;){if((e=r.charCodeAt(t=a++))===Dg)l=!0;else if(e===Fg)l=!0,r.charCodeAt(a)===Dg&&++a;else if(e!==h)continue;return r.slice(n,t)}return s=!0,r.slice(n,i)}for(r.charCodeAt(i-1)===Dg&&--i,r.charCodeAt(i-1)===Fg&&--i;(e=c())!==Ig;){for(var u=[];e!==Rg&&e!==Ig;)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?Hg(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=zg(n=t),function(t,e){return r(i(t),e,n)}):zg(t)})).columns=s||[],t},parseRows:n,format:function(t,e){return[(e=null==e?Wg(t):e).map(o).join(r)].concat(i(t,e)).join("\n")},formatBody:function(t,e){return i(t,e=null==e?Wg(t):e).join("\n")},formatRows:function(t){return t.map(a).join("\n")},formatRow:a,formatValue:o}}function Vg(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;qg&&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 qg=new Date("2019-01-01T00:00").getHours()||new Date("2019-07-01T00:00").getHours(),$g=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(),Yg(i).parse(t,a?Vg:Zp);if("json"===r)return yield e.json();throw new Error(`Unknown format: ${r}.`)})};$g.props={};const Ug=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}};Ug.props={};const Xg=t=>{const{callback:e=function(t){return null!=t&&!Number.isNaN(t)}}=t;return t=>t.filter(e)},Kg=(Xg.props={},t=>{const e=t["callback"];return t=>Array.isArray(t)?[...t].sort(e):t});Kg.props={};const Zg=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})};Zg.props={};const Qg=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};Qg.props={};const Jg=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))}},t1=(Jg.props={},t=>{const e=t["value"];return()=>e}),e1=(t1.props={},t=>{const{callback:e=Zp}=t;return t=>e(t)}),n1=(e1.props={},t=>{const{callback:e=Zp}=t;return t=>Array.isArray(t)?t.map(e):t});n1.props={};var r1=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 i1={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 a1(t){const{y:c,thickness:u,weight:h,marginRatio:f,id:d,source:p,target:g,sourceWeight:m,targetWeight:v,sortBy:y}=Object.assign(Object.assign({},i1),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=v(t)});const i=Pd(r,t=>t.source),a=Pd(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=ap(e,t=>t.sourceWeight)+ap(n,t=>t.targetWeight)})}if(r=e,(n="function"==typeof y?y:r1[y])&&r.sort(n),!(n=(r=e).length))throw t0("Invalid nodes: it's empty!");if(h){const o=f/(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-f),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(!h)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=Pd(e,t=>t.source),l=Pd(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 o1=e=>t=>a1(e)(t),s1=(o1.props={},Math.PI/180),l1=64,c1=2048;function u1(t){return t.text}function h1(){return"serif"}function f1(){return"normal"}function d1(t){return t.value}function p1(){return 90*~~(2*Math.random())}function g1(){return 1}function m1(){}function v1(t,o,r,s){if(!o.sprite){var l=t.context,c=t.ratio;l.clearRect(0,0,(l1<<5)/c,c1/c);let i=0,a=0,n=0;var u,h,f,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*s1),f=Math.cos(o.rotate*s1),u=t*f,h=t*d,f=e*f,d=e*d,t=Math.max(Math.abs(u+d),Math.abs(u-d))+31>>5<<5,e=~~Math.max(Math.abs(h+f),Math.abs(h-f))):t=t+31>>5<<5,e>n&&(n=e),i+t>=l1<<5&&(i=0,a+=n,n=0),a+e>=c1)break;l.translate((i+(t>>1))/c,(a+(e>>1))/c),o.rotate&&l.rotate(o.rotate*s1),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,(l1<<5)/c,c1/c).data,g=[];0<=--s;)if((o=r[s]).hasText){var m=o.width,v=m>>5;let n=o.y1-o.y0;for(let t=0;t<n*v;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 y=v*e+(t>>5),b=p[(a+e)*(l1<<5)+(i+t)<<2]?1<<31-t%32:0;g[y]|=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)*v)}}}function y1(t){const e=t[0]/t[1];return function(t){return[e*(t*=.1)*Math.cos(t),t*Math.sin(t)]}}function b1(t){var e=[];let n=-1;for(;++n<t;)e[n]=0;return e}function x1(){return document.createElement("canvas")}function w1(t){return"function"==typeof t?t:function(){return t}}const M1={archimedean:y1,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 k1(){let b=[256,256],r=u1,i=h1,p=d1,g=f1,m=p1,v=g1,x=y1,w=Math.random,y=m1,M=[],k=null,E=1/0;const O=f1,S=x1,A={};return A.start=function(){const[a,o]=b,s=((t=S()).width=t.height=1,e=Math.sqrt(t.getContext("2d").getImageData(0,0,1,1).data.length>>2),t.width=(l1<<5)/e,t.height=c1/e,(t=t.getContext("2d")).fillStyle=t.strokeStyle="red",t.textAlign="center",{context:t,ratio:e}),l=A.board||b1((b[0]>>5)*b[1]),c=M.length,u=[],h=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=O.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=v.call(this,t,e,n),t}).sort(function(t,e){return e.size-t.size});var t,e;let f=-1,d=A.board?[{x:0,y:0},{x:a,y:o}]:void 0;function n(){for(var t,e,n,r=Date.now();Date.now()-r<E&&++f<c;){var i=h[f];i.x=a*(w()+.5)>>1,i.y=o*(w()+.5)>>1,v1(s,i,h,f),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,h;for(;(l=o(c+=s))&&(u=~~l[0],h=~~l[1],!(Math.min(Math.abs(u),Math.abs(h))>=a));)if(t.x=n+u,t.y=r+h,!(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 f=t.sprite,d=t.width>>5,p=b[0]>>5,g=t.x-(d<<4),m=127&g,v=32-m,y=t.y1-t.y0;let n,r=(t.y+t.y0)*p+(g>>5);for(let e=0;e<y;e++){for(let t=n=0;t<=d;t++)i[r+t]|=n<<v|(t<d?(n=f[e*d+t])>>>m:0);r+=p}return delete t.sprite,1}return}(l,i,d)&&(y.call(null,"word",{cloud:A,word:i}),u.push(i),d?A.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)}A._tags=u,A._bounds=d,f>=c&&(A.stop(),y.call(null,"end",{cloud:A,words:u,bounds:d}))}return k&&clearInterval(k),k=setInterval(n,0),n(),A},A.stop=function(){return k&&(clearInterval(k),k=null),A},A.createMask=t=>{var e=document.createElement("canvas"),[n,r]=b;if(n&&r){var i=n>>5,a=b1((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}A.board=a,A.hasImage=!0}},A.timeInterval=function(t){E=null==t?1/0:t},A.words=function(t){M=t},A.size=function(t=[]){b=[+t[0],+t[1]]},A.text=function(t){r=w1(t)},A.font=function(t){i=w1(t)},A.fontWeight=function(t){g=w1(t)},A.rotate=function(t){m=w1(t)},A.spiral=function(t){x=M1[t]||t},A.fontSize=function(t){p=w1(t)},A.padding=function(t){v=w1(t)},A.random=function(t){w=w1(t)},A.on=function(t){y=w1(t)},A}const E1={size:[500,500],fontSize:[14,28]};function O1(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 S1=f=>h=>ue(void 0,void 0,void 0,function*(){var i,a,t=Object.assign({},E1,f),e=k1(),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=h.map(t=>t.value),n=t,t=[Xd(e),$d(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",O1,e.createMask),e.words([...h]),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=it(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 A1(e){return"string"==typeof e?t=>t[e]:e}S1.props={};const _1=t=>{const{join:e,on:n,select:i=[],as:a=i,unknown:o=NaN}=t;var[t,r]=n;const s=A1(r),l=A1(t),c=Cd(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),{}))})},T1=(_1.props={},t=>{const{start:e,end:n}=t;return t=>t.slice(e,n)});T1.props={};var P1,L1,C1,N1,yl={exports:{}},qo={exports:{}};function j1(t){return 1-Math.abs(t)}P1=($o=qo).exports,$o.exports.isNumber=function(t){return"number"==typeof t},$o.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},$o.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},$o.exports.findMinMulti=function(t){for(var e=P1.findMin(t[0]),n=1;n<t.length;n++)e=Math.min(e,P1.findMin(t[n]));return e},$o.exports.findMaxMulti=function(t){for(var e=P1.findMax(t[0]),n=1;n<t.length;n++)e=Math.max(e,P1.findMax(t[n]));return e},$o.exports.inside=function(t,e,n){return t<=n&&n<=e},Uo=yl,L1=Math.log(2),C1=Uo.exports,N1=qo.exports,Uo.exports.getUnifiedMinMax=function(t,e){return C1.getUnifiedMinMaxMulti([t],e)},Uo.exports.getUnifiedMinMaxMulti=function(t,e){var n=!1,r=!1,i=N1.isNumber((e=e||{}).width)?e.width:2,a=N1.isNumber(e.size)?e.size:50,o=N1.isNumber(e.min)?e.min:(n=!0,N1.findMinMulti(t)),e=N1.isNumber(e.max)?e.max:(r=!0,N1.findMaxMulti(t)),t=(e-o)/(a-1);return n&&(o-=2*i*t),r&&(e+=2*i*t),{min:o,max:e}},Uo.exports.create=function(t,e){if(!t||0===t.length)return[];var n=N1.isNumber((e=e||{}).size)?e.size:50,o=N1.isNumber(e.width)?e.width:2,e=C1.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}(j1,o),h=u[o],f=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=h/(h-i-a),0<r&&(d+=i*(r-1)*f),a=Math.max(0,t-o+1),N1.inside(0,c.length-1,a)&&(c[a].y+=i*f),N1.inside(0,c.length-1,e+1)&&(c[e+1].y-=2*i*f),N1.inside(0,c.length-1,n+1)&&(c[n+1].y+=i*f))}),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},Uo.exports.getExpectedValueFromPdf=function(t){var e;if(t&&0!==t.length)return e=0,t.forEach(function(t){e+=t.x*t.y}),e},Uo.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}},Uo.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/L1,Math.pow(2,n)};var R1=yl.exports;const I1=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(Pd(t,e=>n.map(t=>e[t]).join("-")).values()).map(t=>{var e=R1.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})})}};I1.props={};var B1={exports:{}};function D1(t){for(var e=new Array(t),n=0;n<t;++n)e[n]=0;return e}function F1(t,e){for(var n=0,r=0;r<t.length;++r)n+=t[r]*e[r];return n}function z1(t){return Math.sqrt(F1(t,t))}function W1(t,e,n){for(var r=0;r<e.length;++r)t[r]=e[r]*n}function G1(t,e,n,r,i){for(var a=0;a<t.length;++a)t[a]=e*n[a]+r*i[a]}function H1(i,a,o,s,l,c,u){var h=o.fx,f=F1(o.fxprime,a),d=h,t=h,p=f,e=0;function n(t,e,n){for(var r=0;r<16;++r)if(l=(t+e)/2,G1(s.x,1,o.x,l,a),d=s.fx=i(s.x,s.fxprime),p=F1(s.fxprime,a),h+c*l*f<d||n<=d)e=l;else{if(Math.abs(p)<=-u*f)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(G1(s.x,1,o.x,l,a),d=s.fx=i(s.x,s.fxprime),p=F1(s.fxprime,a),h+c*l*f<d||r&&t<=d)return n(e,l,t);if(Math.abs(p)<=-u*f)return l;if(0<=p)return n(l,e,d);t=d,e=l,l*=2}return l}(Zo=Zo=B1.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},Zo.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,h=void 0!==n.psi?n.psi:-.5,f=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 v(t){for(var e=0;e<t.length;e++)p[d][e]=t[e];p[d].fx=t.fx}for(var y=function(t,e){return t.fx-e.fx},b=e.slice(),x=e.slice(),w=e.slice(),M=e.slice(),k=0;k<i;++k){for(p.sort(y),n.history&&((O=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:O})),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 E=b[g]=0;E<d;++E)b[g]+=p[E][g];b[g]/=d}var O=p[d];if(G1(x,1+c,b,-c,O),x.fx=t(x),x.fx<p[0].fx)G1(M,1+u,b,-u,O),M.fx=t(M),M.fx<x.fx?v(M):v(x);else if(x.fx>=p[d-1].fx){var S=!1;if(x.fx>O.fx?(G1(w,1+h,b,-h,O),w.fx=t(w),w.fx<O.fx?v(w):S=!0):(G1(w,1-h*c,b,h*c,O),w.fx=t(w),w.fx<x.fx?v(w):S=!0),S){if(1<=f)break;for(g=1;g<p.length;++g)G1(p[g],1-f,p[0],f,p[g]),p[g].fx=t(p[g])}}else v(x)}return p.sort(y),{fx:p[0].fx,x:p[0]}},Zo.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),W1(r=a.fxprime.slice(),a.fxprime,-1);for(var c=0;c<i;++c){var u;if(l=H1(t,r,a,o,l),n.history&&n.history.push({x:a.x.slice(),fx:a.fx,fxprime:a.fxprime.slice(),alpha:l}),l?(G1(s,1,o.fxprime,-1,a.fxprime),u=F1(a.fxprime,a.fxprime),u=Math.max(0,F1(s,o.fxprime)/u),G1(r,u,r,-1,o.fxprime),u=a,a=o,o=u):W1(r,a.fxprime,-1),z1(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},Zo.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()}),G1(a.x,1,a.x,-i,a.fxprime),!(z1(a.fxprime)<=1e-5));++o);return a},Zo.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,h=[];{var f;n.history&&(f=t,t=function(t,e){return h.push(t.slice()),f(t,e)})}i.fx=t(i.x,i.fxprime);for(var d=0;d<o&&(W1(l,i.fxprime,-1),s=H1(t,l,i,a,s,c,u),n.history&&(n.history.push({x:i.x.slice(),fx:i.fx,fxprime:i.fxprime.slice(),functionCalls:h,learnRate:s,alpha:s}),h=[]),r=i,i=a,a=r,!(0===s||z1(i.fxprime)<1e-5));++d);return i},Zo.zeros=D1,Zo.zerosM=function(t,e){return D1(t).map(function(){return D1(e)})},Zo.norm2=z1,Zo.weightedSum=G1,Zo.scale=W1;const Y1=1e-10;function V1(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=X1(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($1(e,n[t])>n[t].radius+Y1)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 h=n[l],f=(s+=(i.x+h.x)*(h.y-i.y),{x:(h.x+i.x)/2,y:(h.y+i.y)/2});let r=null;for(let n=0;n<h.parentIndex.length;++n)if(-1<i.parentIndex.indexOf(h.parentIndex[n])){var d=a[h.parentIndex[n]],p=Math.atan2(h.x-d.x,h.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=$1(f,{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:h,p2:i})}null!==r&&(c.push(r),o+=q1(r.circle.radius,r.width),i=h)}}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($1(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-Y1,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 q1(t,e){return t*t*Math.acos(1-e/t)-(t-e)*Math.sqrt(e*(2*t-e))}function $1(t,e){return Math.sqrt((t.x-e.x)*(t.x-e.x)+(t.y-e.y)*(t.y-e.y))}function U1(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),q1(t,t-(n*n-e*e+t*t)/(2*n))+q1(e,r))}function X1(t,e){var n,r,i=$1(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 K1(t,e){(e=e||{}).maxIterations=e.maxIterations||500;var n=e.initialLayout||J1;const i=e.lossFunction||tm,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=B1.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 Z1=1e-10;function Q1(e,n,r){return Math.min(e,n)*Math.min(e,n)*Math.PI<=r+Z1?Math.abs(e-n):B1.exports.bisect(function(t){return U1(e,n,t)-r},0,e+n)}function J1(t,e){let n=function(r,t){const i=t&&t.lossFunction?t.lossFunction:tm,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+Z1>=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 h(t,e){return e.size-t.size}u.sort(h);const f={};function d(t){return t.set in f}function p(t,e){a[e].x=t.x,a[e].y=t.y,f[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(h),0===m.length)throw"ERROR: missing pairwise overlap information";var v=[];for(let e=0;e<m.length;++e){var y=a[m[e].set],b=Q1(s.radius,y.radius,m[e].size);v.push({x:y.x+b,y:y.y}),v.push({x:y.x-b,y:y.y}),v.push({y:y.y+b,x:y.x}),v.push({y:y.y-b,x:y.x});for(let t=e+1;t<m.length;++t){var x=a[m[t].set],w=Q1(s.radius,x.radius,m[t].size),M=X1({x:y.x,y:y.y,radius:b},{x:x.x,y:x.y,radius:w});for(let t=0;t<M.length;++t)v.push(M[t])}}let e=1e50,n=v[0];for(let t=0;t<v.length;++t){a[g].x=v[t].x,a[g].y=v[t].y;var k=i(a,r);k<e&&(e=k,n=v[t])}p(n,g)}return a}(t,e);var r=e.lossFunction||tm;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=B1.exports.zerosM(a.length,a.length),l=B1.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=Q1(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=v;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],h=i[2*t+1],f=o[n][t],d=s[n][t],p=(u-l)*(u-l)+(h-c)*(h-c),g=Math.sqrt(p),p=p-f*f;0<d&&g<=f||d<0&&f<=g||(e+=2*p*p,a[2*n]+=4*p*(l-u),a[2*n+1]+=4*p*(c-h),a[2*t]+=4*p*(u-l),a[2*t+1]+=4*p*(h-c))}}return e}}const v=s.constraints,c=B1.exports.norm2(m.map(B1.exports.norm2))/m.length;m=m.map(function(t){return t.map(function(t){return t/c})});let u,h;for(a=0;a<n;++a){var f=B1.exports.zeros(2*m.length).map(Math.random);h=B1.exports.conjugateGradient(l,f,e),(!u||h.fx<u.fx)&&(u=h)}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)B1.exports.scale(e.history[a].x,c);return p}(t,e),t)+1e-8<r(n,t)?e:n}function tm(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]],U1(o.radius,a.radius,$1(o,a))):V1(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 em(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 nm=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=K1(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=em(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),h=(e-(o.max-o.min)*u)/2,f=(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+h+(p.x-o.min)*u,y:r+f+(p.y-s.min)*u}}return d}(i,t,e,o);let n=function(t){var e={},n=(V1(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}})})}};nm.props={};const rm=(l,c)=>ue(void 0,void 0,void 0,function*(){var{width:t,height:e}=c,{data:n,encode:r={},scale:i,style:a={},layout:o={}}=l,s=it(l,["data","encode","scale","style","layout"]),n=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),o=yield S1(Object.assign(Object.assign({},{size:[t,e]}),o))(n);return ot({},{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"}},Object.assign(Object.assign({data:o,encode:r,scale:i,style:a},s),{axis:!1}))});function im(t,...e){return e.reduce((e,n)=>t=>e(n(t)),t)}function am(e,n){return n-e?t=>(t-e)/(n-e):t=>.5}function om(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}rm.props={};const sm=Math.sqrt(50),lm=Math.sqrt(10),cm=Math.sqrt(2);function um(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>=sm?10:n>=lm?5:n>=cm?2:1)*10**t:-(10**-t)/(n>=sm?10:n>=lm?5:n>=cm?2:1)}function hm(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>=sm?r*=10:n>=lm?r*=5:n>=cm&&(r*=2),e<t?-r:r}const fm=(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=um(a,o,n))?(a=Math.floor(a/s)*s,o=Math.ceil(o/s)*s,s=um(a,o,n)):s<0&&(a=Math.ceil(a*s)/s,o=Math.floor(o*s)/s,s=um(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},dm=36e5,pm=864e5,gm=7*pm;pm,pm;function mm(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=mm(1,t=>t,(t,e=1)=>{t.setTime(+t+e)},t=>t.getTime()),rs=mm(1e3,t=>{t.setMilliseconds(0)},(t,e=1)=>{t.setTime(+t+1e3*e)},t=>t.getSeconds()),is=mm(6e4,t=>{t.setSeconds(0,0)},(t,e=1)=>{t.setTime(+t+6e4*e)},t=>t.getMinutes()),as=mm(dm,t=>{t.setMinutes(0,0,0)},(t,e=1)=>{t.setTime(+t+dm*e)},t=>t.getHours()),os=mm(pm,t=>{t.setHours(0,0,0,0)},(t,e=1)=>{t.setTime(+t+pm*e)},t=>t.getDate()-1);const vm=mm(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());ss=mm(gm,t=>{t.setDate(t.getDate()-t.getDay()%7),t.setHours(0,0,0,0)},(t,e=1)=>{t.setTime(+t+gm*e)},t=>{var e=vm.floor(t),t=new Date(+t);return Math.floor((+t-+e)/gm)}),ls=mm(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 ym={millisecond:a,second:rs,minute:is,hour:as,day:os,week:ss,month:vm,year:ls};cs=mm(1,t=>t,(t,e=1)=>{t.setTime(+t+e)},t=>t.getTime()),Xo=mm(1e3,t=>{t.setUTCMilliseconds(0)},(t,e=1)=>{t.setTime(+t+1e3*e)},t=>t.getUTCSeconds()),gl=mm(6e4,t=>{t.setUTCSeconds(0,0)},(t,e=1)=>{t.setTime(+t+6e4*e)},t=>t.getUTCMinutes()),wl=mm(dm,t=>{t.setUTCMinutes(0,0,0)},(t,e=1)=>{t.setTime(+t+dm*e)},t=>t.getUTCHours()),El=mm(pm,t=>{t.setUTCHours(0,0,0,0)},(t,e=1)=>{t.setTime(+t+pm*e)},t=>t.getUTCDate()-1);const bm=mm(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());_l=mm(gm,t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7)%7),t.setUTCHours(0,0,0,0)},(t,e=1)=>{t.setTime(+t+gm*e)},t=>{var e=bm.floor(t),t=new Date(+t);return Math.floor((+t-+e)/gm)}),Nl=mm(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 xm={millisecond:cs,second:Xo,minute:gl,hour:wl,day:El,week:_l,month:bm,year:Nl};function wm(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?xm:ym;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=om(i,l,0,c,s);let h;return h=u===c?[a,hm(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(hm(t,e,n),1)]}const Mm=(t,e,n,r,i)=>{var a=e<t,o=a?e:t,t=a?t:e,[e,n]=wm(o,t,n,r,i),r=[e.floor(o,n),e.ceil(t,n)];return a?r.reverse():r};function km(t){return null!==t&&"function"!=typeof t&&isFinite(t.length)}function Em(t){return Am(t,"Function")}function Om(t){return null==t}var Sm={}.toString,Am=function(t,e){return Sm.call(t)==="[object "+e+"]"},_m=function(t){return Array.isArray?Array.isArray(t):Am(t,"Array")};var Tm=function(t){if("object"!=typeof(e=t)||null===e||!Am(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},Pm=function(t){return Am(t,"Number")},Lm=Object.values?function(t){return Object.values(t)}:function(n){var t,r=[],e=n,i=function(t,e){Em(n)&&"prototype"===e||r.push(t)};if(e)if(_m(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},Cm=5;function Nm(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||Cm,n){var o;n.hasOwnProperty(a)&&(null!==(o=n[a])&&Tm(o)?(Tm(e[a])||(e[a]={}),r<i?t(e[a],o,r+1,i):e[a]=n[a]):_m(o)?(e[a]=[],e[a]=e[a].concat(o)):void 0!==o&&(e[a]=o))}}(t,e[r]);return t}function jm(t){return t}var Rm,Im=function(t,e){if(!km(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 Bm(t){return Om(t)?0:(km(t)?t:Object.keys(t)).length}function Dm(t){return null!=t&&!Number.isNaN(t)}!function(a,o){var s;if(Em(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(Rm=Rm||document.createElement("canvas").getContext("2d")).font=[a,e,i,n+"px",r].join(" "),Rm.measureText(Am(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],Lm(e=void 0===e?{}:e)).join("")});const Fm=e=>t=>-e(-t),zm=(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?Fm(t):t},Wm=(e,t)=>{var n=e===Math.E?Math.exp:t=>e**t;return t?Fm(n):n},Gm=(t,e,n,r)=>{var i=t<0,a=zm(r,i),r=Wm(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 Hm(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 Pm(t)?Math.round(t):t}):i;this.output=im(a,r,e,t)},t.prototype.invert=void 0}}var Ym,dl={exports:{}},bl={exports:{}},Vm=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))},qm=Array.prototype.concat,$m=Array.prototype.slice,Um=bl.exports=function(t){for(var e=[],n=0,r=t.length;n<r;n++){var i=t[n];Vm(i)?e=qm.call(e,$m.call(i)):e.push(i)}return e},Xm=(Um.wrap=function(t){return function(){return t(Um(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]}),Km=bl.exports,Zm=Object.hasOwnProperty,Qm=Object.create(null);for(Ym in Xm)Zm.call(Xm,Ym)&&(Qm[Xm[Ym]]=Ym);var Jm=dl.exports={to:{},get:{}};function tv(t,e,n){return Math.min(Math.max(e,t),n)}function ev(t){t=Math.round(t).toString(16).toUpperCase();return t.length<2?"0"+t:t}Jm.get=function(t){var e,n;switch(t.substring(0,3).toLowerCase()){case"hsl":e=Jm.get.hsl(t),n="hsl";break;case"hwb":e=Jm.get.hwb(t),n="hwb";break;default:e=Jm.get.rgb(t),n="rgb"}return e?{model:n,value:e}:null},Jm.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]:Zm.call(Xm,e[1])?((i=Xm[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]=tv(i[n],0,255);return i[3]=tv(i[3],0,1),i},Jm.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,tv(parseFloat(t[2]),0,100),tv(parseFloat(t[3]),0,100),tv(isNaN(e)?1:e,0,1)]):null},Jm.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,tv(parseFloat(t[2]),0,100),tv(parseFloat(t[3]),0,100),tv(isNaN(e)?1:e,0,1)]):null},Jm.to.hex=function(){var t=Km(arguments);return"#"+ev(t[0])+ev(t[1])+ev(t[2])+(t[3]<1?ev(Math.round(255*t[3])):"")},Jm.to.rgb=function(){var t=Km(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]+")"},Jm.to.rgb.percent=function(){var t=Km(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]+")"},Jm.to.hsl=function(){var t=Km(arguments);return t.length<4||1===t[3]?"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)":"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+t[3]+")"},Jm.to.hwb=function(){var t=Km(arguments),e="";return 4<=t.length&&1!==t[3]&&(e=", "+t[3]),"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+e+")"},Jm.to.keyword=function(t){return Qm[t.slice(0,3)]};var nv=dl.exports;function rv(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 iv(t){var e,n,r,t=nv.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*rv(n=2*r-(r=r<.5?r*(1+n):r+n-r*n),r,e+1/3),255*rv(n,r,e),255*rv(n,r,e-1/3),t]):null):null}const av=(e,n)=>t=>e*(1-t)+n*t,ov=(t,e)=>{if("number"==typeof t&&"number"==typeof e)return av(t,e);if("string"!=typeof t||"string"!=typeof e)return()=>t;{var n=t,r=e;const l=iv(n),c=iv(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})`}}},sv=(t,e)=>{const n=av(t,e);return t=>Math.round(n(t))};function lv({map:t,initKey:e},n){e=e(n);return t.has(e)?t.get(e):n}function cv(t){return"object"==typeof t?t.valueOf():t}class uv extends Map{constructor(t){if(super(),this.map=new Map,this.initKey=cv,null!==t)for(var[e,n]of t)this.set(e,n)}get(t){return super.get(lv({map:this.map,initKey:this.initKey},t))}has(t){return super.has(lv({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 hv{constructor(t){this.options=Nm({},this.getDefaultOptions()),this.update(t)}getOptions(){return this.options}update(t={}){this.options=Nm({},this.options,t),this.rescale(t)}rescale(t){}}const fv=Symbol("defaultUnknown");function dv(e,n,r){for(let t=0;t<n.length;t+=1)e.has(n[t])||e.set(r(n[t]),t)}function pv(t){var{value:t,from:e,to:n,mapper:r,notFoundReturn:i}=t;let a=r.get(t);if(void 0===a){if(i!==fv)return i;a=e.push(t)-1,r.set(t,a)}return n[a%n.length]}function gv(t){return t instanceof Date?t=>""+t:"object"==typeof t?t=>JSON.stringify(t):t=>t}class mv extends hv{getDefaultOptions(){return{domain:[],range:[],unknown:fv}}constructor(t){super(t)}map(t){return 0===this.domainIndexMap.size&&dv(this.domainIndexMap,this.getDomain(),this.domainKey),pv({value:this.domainKey(t),mapper:this.domainIndexMap,from:this.getDomain(),to:this.getRange(),notFoundReturn:this.options.unknown})}invert(t){return 0===this.rangeIndexMap.size&&dv(this.rangeIndexMap,this.getRange(),this.rangeKey),pv({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=gv(e),this.rangeKey=gv(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 mv(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 vv(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,h=u/(2/l*r+1-1/l*i);const f=h*i/l;h-=l*f;const d=function(t){const e=Math.min(...t);return t.map(t=>t/e)}(c),p=h/d.reduce((t,e)=>t+e);var c=new uv(e.map((t,e)=>{e=d[e]*p;return[t,o?Math.floor(e):e]})),g=new uv(e.map((t,e)=>{e=d[e]*p+f;return[t,o?Math.floor(e):e]})),h=Array.from(g.values()).reduce((t,e)=>t+e),t=t+(u-(h-h/l*i))*s;let m=o?Math.round(t):t;var v=new Array(l);for(let t=0;t<l;t+=1){v[t]=(y=m,Math.round(1e12*y)/1e12);var y=e[t];m+=g.get(y)}return{valueBandWidth:c,valueStep:g,adjustedRange:v}}class yv extends mv{getDefaultOptions(){return{domain:[],range:[0,1],align:.5,round:!1,paddingInner:0,paddingOuter:0,padding:0,unknown:fv,flex:[]}}constructor(t){super(t)}clone(){return new yv(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 vv(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 bv=(t,e,n)=>{let r,i,a=t,o=e;if(a===o&&0<n)return[a];let s=um(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 xv extends hv{getDefaultOptions(){return{range:[0],domain:[0,1],unknown:void 0,tickCount:5,tickMethod:bv}}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 Pm(e)&&Pm(r)?t(e,r,n):[]}clone(){return new xv(this.options)}}function wv(t){return Math.abs(t)<1e-15?t:parseFloat(t.toFixed(15))}const Mv=[1,5,2,2.5,4,3],kv=100*Number.EPSILON;const Ev=(n,r,t=5,i=!0,a=Mv,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,h,f,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 v=a[t],y=(h=v,f=a,d=m,p=void 0,p=Bm(f),1-Im(f,h)/(p-1)-d+1);if(o[0]*y+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]*y+o[1]+o[2]*b+o[3]<g.score)break;var x=(r-n)/(e+1)/m/v;let t=Math.ceil(Math.log10(x));for(;t<1/0;){var w=m*v*10**t,M=(E=r,M=w*(e-1),(E-=n)<M?1-((M-E)/2)**2/(.1*E)**2:1);if(o[0]*y+o[1]*M+o[2]*b+o[3]<g.score)break;var k=Math.floor(r/w)*m-(e-1)*m,E=Math.ceil(n/w)*m;if(k<=E){var O=E-k;for(let t=0;t<=O;t+=1){var S=(k+t)*(w/m),A=S+w*(e-1),_=w,T=function(t,e,n,r,i,a){var o=Bm(e),e=Im(e,t);let s=0;return t=(r%a+a)%a,1-e/(o-1)-n+(s=(t<kv||a-t<kv)&&r<=0&&0<=i?1:s)}(v,a,m,S,A,_),P=1-.5*((r-A)**2+(n-S)**2)/(.1*(r-n))**2,L=(l=e,L=n,l=(l-1)/(A-(C=S)),c=((c=s)-1)/(Math.max(A,r)-Math.min(L,C)),2-Math.max(l/c,c/l)),C=o[0]*T+o[1]*P+o[2]*L+ +o[3];g.score<C&&(!i||S<=n&&r<=A)&&(g.lmin=S,g.lmax=A,g.lstep=_,g.score=C)}}t+=1}e+=1}}m+=1}var t=wv(g.lmax),e=wv(g.lmin),N=wv(g.lstep),j=Math.floor((t=(t-e)/N,Math.round(1e12*t)/1e12))+1,R=new Array(j);R[0]=wv(e);for(let t=1;t<j;t+=1)R[t]=wv(R[t-1]+N);return R};class Ov extends hv{getDefaultOptions(){return{domain:[0,1],range:[0,1],tickCount:5,unknown:void 0,tickMethod:Ev}}map(t){return Dm(t)?t:this.options.unknown}invert(t){return this.map(t)}clone(){return new Ov(this.options)}getTicks(){var{domain:t,tickCount:e,tickMethod:n}=this.options,[t,r]=t;return Pm(t)&&Pm(r)?n(t,r,e):[]}}const Sv=(t,e,n)=>{var[t,r]=t,[e,i]=e;let a,o;return im(o=t<r?(a=am(t,r),n(e,i)):(a=am(r,t),n(i,e)),a)},Av=(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]=am(s[t],s[t+1]),o[t]=e(l[t],l[t+1]);return t=>{var e=om(r,t,1,i)-1,n=a[e];return im(o[e],n)(t)}},_v=(t,e,n,r)=>{return(2<Math.min(t.length,e.length)?Av:Sv)(t,e,r?sv:n)};class Tv extends hv{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,interpolate:av,tickCount:5}}map(t){return Dm(t)?this.output(t):this.options.unknown}invert(t){return Dm(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 fm}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 jm}composeOutput(t,e){var{domain:n,range:r,round:i,interpolate:a}=this.options,n=_v(n.map(t),r,a,i);this.output=im(n,e,t)}composeInput(t,e,n){var{domain:r,range:i}=this.options,i=_v(i,r.map(t),av);this.input=im(e,n,i)}}class Pv extends Tv{getDefaultOptions(){return{domain:[0,1],range:[0,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolate:ov,tickMethod:bv,tickCount:5}}chooseTransforms(){return[jm,jm]}clone(){return new Pv(this.options)}}class Lv extends yv{getDefaultOptions(){return{domain:[],range:[0,1],align:.5,round:!1,padding:0,unknown:fv,paddingInner:1,paddingOuter:0}}constructor(t){super(t)}getPaddingInner(){return 1}clone(){return new Lv(this.options)}update(t){super.update(t)}getPaddingOuter(){return this.options.padding}}const Cv=t=>t<0?-Math.sqrt(-t):Math.sqrt(t);class Nv extends Tv{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,exponent:2,interpolate:ov,tickMethod:bv,tickCount:5}}constructor(t){super(t)}chooseTransforms(){var t,e,n,r=this.options["exponent"];return 1===r?[jm,jm]:(t=.5===r?Cv:(e=r,t=>t<0?-((-t)**e):t**e),n=r,[t,t=>t<0?-((-t)**(1/n)):t**(1/n)])}clone(){return new Nv(this.options)}}class jv extends Nv{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,interpolate:ov,tickMethod:bv,tickCount:5,exponent:.5}}constructor(t){super(t)}update(t){super.update(t)}clone(){return new jv(this.options)}}class Rv extends hv{getDefaultOptions(){return{domain:[.5],range:[0,1]}}constructor(t){super(t)}map(t){return Dm(t)?(t=om(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 Rv(this.options)}rescale(){var{domain:t,range:e}=this.options;this.n=Math.min(t.length,e.length-1),this.thresholds=t}}const Iv=(t,e,n,r=10)=>{var i=t<0,a=Wm(r,i),o=zm(r,i),s=e<t,l=s?e:t,c=s?t:e;let u=o(l),h=o(c),f=[];if(!(r%1)&&h-u<n){if(u=Math.floor(u),h=Math.ceil(h),i)for(;u<=h;u+=1){var d=a(u);for(let t=r-1;1<=t;--t){var p=d*t;if(c<p)break;l<=p&&f.push(p)}}else for(;u<=h;u+=1){var g=a(u);for(let t=1;t<r;t+=1){var m=g*t;if(c<m)break;l<=m&&f.push(m)}}2*f.length<n&&(f=bv(l,c,n))}else{t=-1===n?h-u:Math.min(h-u,n);f=bv(u,h,t).map(a)}return s?f.reverse():f};class Bv extends Tv{getDefaultOptions(){return{domain:[1,10],range:[0,1],base:10,interpolate:ov,tickMethod:Iv,tickCount:5}}chooseNice(){return Gm}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[zm(t,e),Wm(t,e)]}clone(){return new Bv(this.options)}}class Dv extends Rv{getDefaultOptions(){return{domain:[0,1],range:[.5],nice:!1,tickCount:5,tickMethod:Ev}}constructor(t){super(t)}nice(){var t,e,n=this.options["nice"];n&&([n,t,e]=this.getTickMethodOptions(),this.options.domain=fm(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 Dv(this.options)}}function Fv(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 zv extends Rv{getDefaultOptions(){return{domain:[],range:[],tickCount:5,unknown:void 0,tickMethod:Ev}}constructor(t){super(t)}rescale(){var{domain:t,range:e}=this.options;this.n=e.length-1,this.thresholds=Fv(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 zv(this.options)}getTicks(){var{tickCount:t,domain:e,tickMethod:n}=this.options,r=e.length-1;return n(e[0],e[r],t)}}var Wv=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,Gv=/\[([^]*?)\]/gm;function Hv(t,e){for(var n=[],r=0,i=t.length;r<i;r++)n.push(t[r].substr(0,e));return n}function Yv(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 Vv(t,e){for(void 0===e&&(e=2),t=String(t);t.length<e;)t="0"+t;return t}var qv,Ms=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],$v=["January","February","March","April","May","June","July","August","September","October","November","December"],ds=Hv($v,3),Uv=Yv({},{dayNamesShort:Hv(Ms,3),dayNames:Ms,monthNamesShort:ds,monthNames:$v,amPm:["am","pm"],DoFn:function(t){return t+["th","st","nd","rd"][3<t%10?0:(t-t%10!=10?1:0)*t%10]}}),Xv={D:function(t){return String(t.getDate())},DD:function(t){return Vv(t.getDate())},Do:function(t,e){return e.DoFn(t.getDate())},d:function(t){return String(t.getDay())},dd:function(t){return Vv(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 Vv(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 Vv(String(t.getFullYear()),4).substr(2)},YYYY:function(t){return Vv(t.getFullYear(),4)},h:function(t){return String(t.getHours()%12||12)},hh:function(t){return Vv(t.getHours()%12||12)},H:function(t){return String(t.getHours())},HH:function(t){return Vv(t.getHours())},m:function(t){return String(t.getMinutes())},mm:function(t){return Vv(t.getMinutes())},s:function(t){return String(t.getSeconds())},ss:function(t){return Vv(t.getSeconds())},S:function(t){return String(Math.round(t.getMilliseconds()/100))},SS:function(t){return Vv(Math.round(t.getMilliseconds()/10),2)},SSS:function(t){return Vv(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?"-":"+")+Vv(100*Math.floor(Math.abs(t)/60)+Math.abs(t)%60,4)},Z:function(t){t=t.getTimezoneOffset();return(0<t?"-":"+")+Vv(Math.floor(Math.abs(t)/60),2)+":"+Vv(Math.abs(t)%60,2)}},Kv={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 Zv=(t,e,n,r,i)=>{var a=e<t,o=a?e:t,t=a?t:e,[e,n]=wm(o,t,n,r,i),r=e.range(o,new Date(+t+1),n,!0);return a?r.reverse():r};function Qv(t){var e=t.getTimezoneOffset(),t=new Date(t);return t.setMinutes(t.getMinutes()+e,t.getSeconds(),t.getMilliseconds()),t}class Jv extends Tv{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:Zv,interpolate:av,mask:void 0,utc:!1}}chooseTransforms(){return[t=>+t,t=>new Date(t)]}chooseNice(){return Mm}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?xm:ym,s=t?Qv:jm;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=Kv.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=Kv[t]||t).replace(Gv,function(t,e){return r.push(e),"@@@"}),Yv(Yv({},Uv),n));return(t=t.replace(Wv,function(t){return Xv[t](e,i)})).replace(/@@@/g,function(){return r.shift()})}}clone(){return new Jv(this.options)}}var ty;let ey=qv=class extends Pv{getDefaultOptions(){return{domain:[0,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolator:jm,tickMethod:bv,tickCount:5}}constructor(t){super(t)}clone(){return new qv(this.options)}};ey=qv=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}([Hm(function(t){return[t(0),t(1)]},t=>{var[t,e]=t;return im(av(0,1),am(t,e))})],ey);let ny=ty=class extends Pv{getDefaultOptions(){return{domain:[0,.5,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolator:jm,tickMethod:bv,tickCount:5}}constructor(t){super(t)}clone(){return new ty(this.options)}};function ry(r,i){return Object.entries(r).reduce((t,[e,n])=>(t[e]=i(n,e,r),t),{})}function iy(t){return t.map((t,e)=>e)}function ay(t){return t[t.length-1]}function oy(t,e){const n=[[],[]];return t.forEach(t=>{n[e(t)?0:1].push(t)}),n}function sy(n,t=n.length){if(1===t)return n.map(t=>[t]);const r=[];for(let e=0;e<n.length;e++)sy(n.slice(e+1),t-1).forEach(t=>{r.push([n[e],...t])});return r}function ly([t,e],[n,r]){return[t-n,e-r]}function cy([t,e],[n,r]){return[t+n,e+r]}function uy([t,e],[n,r]){return Math.sqrt(Math.pow(t-n,2)+Math.pow(e-r,2))}function hy([t,e]){return Math.atan2(e,t)}function fy([t,e]){return hy([t,e])+Math.PI/2}function dy(t,e){t=hy(t),e=hy(e);return t<e?e-t:2*Math.PI-(t-e)}function py(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 gy([t,e],[n,r]){return[(t+n)/2,(e+r)/2]}function C(t,e){for(var[n,r]of Object.entries(e))t.style(n,r)}function my(t,e,n,r,i){e=hy(ly(r,e))+Math.PI,n=hy(ly(r,n))+Math.PI;t.arc(r[0],r[1],i,e,n,n-e<0)}function vy(e,t,n,r="y",i="between"){const a="y"===r||!0===r?n:t;var n="y"===r||!0===r?90:0,t=iy(a),[r,o]=Od(t,t=>a[t]);const s=new Pv({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 yy(t){var[t,e,n,r]=t;return[r,t,e,n]}function by(t,e,n){var[e,r,,i]=op(t)?yy(e):e,[n,a]=n,t=t.getCenter(),o=fy(ly(e,t)),r=fy(ly(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:uy(i,t),outerRadius:uy(e,t)}}function xy(t){var{colorAttribute:t,opacityAttribute:t=t}=t;return t+"Opacity"}function wy(t,e){return sp(t)?(e=e["transform"],`translate(${(t=t.getCenter())[0]}, ${t[1]}) `+(e||"")):""}function My(t){var e,n,r;return 1===t.length?t[0]:([[t,e],[n,r]]=t,[(t+n)/2,(e+r)/2])}function st(t){return new ky([t],null,t,t.ownerDocument)}ny=ty=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}([Hm(function(t){return[t(0),t(.5),t(1)]},t=>{const[e,n,r]=t,i=im(av(0,.5),am(e,n)),a=im(av(.5,1),am(n,r));return t=>(e>r?t<n?a:i:t<n?i:a)(t)})],ny);class ky{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 ky(t,null,this._elements[0],this._document)}selectFacetAll(t){t="string"==typeof t?this._parent.querySelectorAll(t):t;return new ky(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 ky([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 ky(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 ky(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 ky([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])),h=Pd(this._elements,t=>r(t.__data__));for(let t=0;t<e.length;t++){var f=e[t],d=n(f,t),p=r(f,t);if(c.has(d)){var g=c.get(d);g.__data__=f,g.__facet__=!1,a.push(g),o.delete(g),c.delete(d)}else if(u.has(d)){g=u.get(d);g.__data__=f,g.__facet__=!0,a.push(g),u.delete(d)}else if(h.has(d)){const Pd=h.get(d);s.push([f,Pd]);for(const m of Pd)o.delete(m);h.delete(d)}else c.has(p)?((d=c.get(p)).__toData__?d.__toData__.push(f):d.__toData__=[f],l.add(d),o.delete(d)):i.push(f)}var t=[new ky([],i,this._parent,this._document),new ky(a,null,this._parent,this._document),new ky(o,null,this._parent,this._document),new ky([],s,this._parent,this._document),new ky(l,null,this._parent,this._document)];return new ky(this._elements,null,this._parent,this._document,t)}merge(t){var e=[...this._elements,...t._elements],t=[...this._transitions,...t._transitions];return new ky(e,null,this._parent,this._document,void 0,t)}createElement(t){var e;return this._document?this._document.createElement(t,{}):(e=ky.registry[t])?new e:t0("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 ky([],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}}ky.registry={g:Gs,rect:rl,circle:Is,path:Zs,text:al,ellipse:zs,image:qs,line:Us,polygon:Js,polyline:el,html:Ys};const Ey={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"]}}},Oy={style:{shape:(t,e)=>{const l=t["radius"],c=it(t,["shape","radius"]);var t=at(c,"pointer"),n=at(c,"pin");const u=t["shape"],h=it(t,["shape"]),f=n["shape"],d=it(n,["shape"]),{coordinate:p,theme:g}=e;return(t,e)=>{var t=t.map(t=>p.invert(t)),[n,r,i]=function(t,e){var[,...t]=(t=t.getOptions()["transformations"]).find(t=>t[0]===e);return t}(p,"polar");const a=p.clone();var o=e["color"],n=qh({startAngle:n,endAngle:r,innerRadius:i,outerRadius:l});n.push(["cartesian"]),a.update({transformations:n});const s=t.map(t=>a.map(t));var[r,i]=My(s),[n,t]=p.getCenter(),r=Object.assign(Object.assign({x1:r,y1:i,x2:n,y2:t,stroke:o},h),c),i=Object.assign(Object.assign({cx:n,cy:t,stroke:o},d),c),n=st(new Gs);return s0(u)||("function"==typeof u?n.append(()=>u(s,e,a,g)):n.append("line").call(C,r).node()),s0(f)||("function"==typeof f?n.append(()=>f(s,e,a,g)):n.append("circle").call(C,i).node()),n.node()}},lineWidth:4,pointerLineCap:"round",pinR:10,pinFill:"#fff",radius:.6}},Sy={type:"text",style:{x:"50%",y:"60%",textAlign:"center",textBaseline:"middle",fontSize:20,fontWeight:800,fill:"#888"}};const Ay=t=>{var n,{data:e={},scale:r={},style:i={},animate:a={}}=t,t=it(t,["data","scale","style","animate","transform"]),{targetData:e,totalData:r,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,r),c=at(i,"text"),u=(n=["pointer","pin"],Object.fromEntries(Object.entries(i).filter(([e])=>n.find(t=>e.startsWith(t)))));return[ot({},Ey,Object.assign({type:"interval",transform:[{type:"stackY"}],data:r,scale:l,style:at(i,"arc"),animate:"object"==typeof a?at(a,"arc"):a},t)),ot({},Ey,Oy,Object.assign({type:"point",data:e,scale:l,style:u,animate:"object"==typeof a?at(a,"indicator"):a},t)),ot({},Sy,{style:Object.assign({text:([r,{target:i,total:e}]=[c,{target:o,total:s}],(r=r.content)?r(i,e):i.toString())},c),animate:"object"==typeof a?at(a,"text"):a})]},_y=(Ay.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,h=t.series;e=Array.from(i,n=>{var t=u.getBandWidth(u.invert(+o[n])),e=t*(h?h.getBandWidth(h.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]});_y.props={defaultShape:"density",defaultLabelShape:"label",composite:!1,channels:[...ed({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:[...ad(),{type:"maybeZeroY1"},{type:"maybeZeroX"}],postInference:[...rd()],interaction:{shareTooltip:!0}};const Ty=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]})]]};Ty.props={defaultShape:"heatmap",defaultLabelShape:"label",composite:!1,channels:[...ed({shapes:["heatmap"]}),{name:"x",required:!0},{name:"y",required:!0},{name:"color",scale:"identity",required:!0},{name:"size"}],preInference:[...ad(),{type:"maybeZeroY"},{type:"maybeZeroX"}],postInference:[...nd()]};const Py=()=>["#5B8FF9","#5AD8A6","#5D7092","#F6BD16","#6F5EF9","#6DC8EC","#945FB9","#FF9845","#1E9493","#FF99C3"],Ly=(Py.props={},()=>["#5B8FF9","#CDDDFD","#5AD8A6","#CDF3E4","#5D7092","#CED4DE","#F6BD16","#FCEBB9","#6F5EF9","#D3CEFD","#6DC8EC","#D3EEF9","#945FB9","#DECFEA","#FF9845","#FFE0C7","#1E9493","#BBDEDE","#FF99C3","#FFE0ED"]),Cy=(Ly.props={},t=>new yv(t)),Ny=(Cy.props={},t=>new Pv(t)),jy=(Ny.props={},t=>new mv(t)),Ry=(jy.props={},t=>new Ov(t)),Iy=(Ry.props={},t=>new Lv(t)),By=(Iy.props={},t=>new Jv(t)),Dy=(By.props={},t=>new Bv(t)),Fy=(Dy.props={},t=>new Nv(t)),zy=(Fy.props={},t=>new Rv(t)),Wy=(zy.props={},t=>new zv(t)),Gy=(Wy.props={},t=>new Dv(t)),Hy=(Gy.props={},t=>new jv(t)),Yy=(Hy.props={},t=>new ey(t)),Vy=(Yy.props={},t=>new xv(t));function qy(t){return function(){return t}}Vy.props={};const $y=Math.abs,Uy=Math.atan2,Xy=Math.cos,Ky=Math.max,Zy=Math.min,Qy=Math.sin,Jy=Math.sqrt,tb=1e-12,eb=Math.PI,nb=eb/2,rb=2*eb;function ib(t){return 1<=t?nb:t<=-1?-nb:Math.asin(t)}const ab=Math.PI,ob=2*ab,sb=1e-6,lb=ob-sb;function cb(n){this._+=n[0];for(let t=1,e=n.length;t<e;++t)this._+=arguments[t]+n[t]}class ub{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=null==t?cb:function(t){var e=Math.floor(t);if(!(0<=e))throw new Error("invalid digits: "+t);if(15<e)return cb;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,h=s-t,f=l-e,d=h*h+f*f;null===this._x1?this._append`M${this._x1=t},${this._y1=e}`:d>sb&&(Math.abs(f*c-u*h)>sb&&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((ab-Math.acos((o+d-r)/(2*l*a)))/2))/a,r=o/l,Math.abs(d-1)>sb&&this._append`L${t+d*h},${e+d*f}`,this._append`A${i},${i},0,0,${+(h*s<f*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,h=a?r-i:i-r;null===this._x1?this._append`M${l},${c}`:(Math.abs(this._x1-l)>sb||Math.abs(this._y1-c)>sb)&&this._append`L${l},${c}`,n&&((h=h<0?h%ob+ob:h)>lb?this._append`A${n},${n},0,1,${u},${t-o},${e-s}A${n},${n},0,1,${u},${this._x1=l},${this._y1=c}`:h>sb&&this._append`A${n},${n},0,${+(h>=ab)},${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 hb(){return new ub}function fb(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 ub(r)}function db(t){return t.innerRadius}function pb(t){return t.outerRadius}function gb(t){return t.startAngle}function mb(t){return t.endAngle}function vb(t){return t&&t.padAngle}function yb(t,e,n,r,i,a,o){var s=t-n,l=e-r,o=(o?a:-a)/Jy(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,h=n-t,f=u*u+h*h,a=i-a,s=s*n-e*t,n=(h<0?-1:1)*Jy(Ky(0,a*a*f-s*s)),e=(s*h-u*n)/f,t=(-s*u-h*n)/f,d=(s*h+u*n)/f,s=(-s*u+h*n)/f,u=e-r,h=t-c,n=d-r,f=s-c;return n*n+f*f<u*u+h*h&&(e=d,t=s),{cx:e,cy:t,x01:-l,y01:-o,x11:e*(i/a-1),y11:t*(i/a-1)}}function bb(){var _=db,T=pb,P=qy(0),L=null,C=gb,N=mb,j=vb,R=null,I=fb(e);function e(){var t,e,n,r,i,a,o,s,l,c,u,h,f,d,p,g,m,v,y,b,x,w,M=+_.apply(this,arguments),k=+T.apply(this,arguments),E=C.apply(this,arguments)-nb,O=N.apply(this,arguments)-nb,S=$y(O-E),A=E<O;if(R=R||(t=I()),k<M&&(e=k,k=M,M=e),k>tb?S>rb-tb?(R.moveTo(k*Xy(E),k*Qy(E)),R.arc(0,0,k,E,O,!A),M>tb&&(R.moveTo(M*Xy(O),M*Qy(O)),R.arc(0,0,M,O,E,A))):(r=e=E,i=n=O,o=a=S,f=(u=j.apply(this,arguments)/2)>tb&&(L?+L.apply(this,arguments):Jy(M*M+k*k)),w=x=s=Zy($y(k-M)/2,+P.apply(this,arguments)),f>tb&&(h=ib(f/M*Qy(u)),f=ib(f/k*Qy(u)),(a-=2*h)>tb?(r+=h*=A?1:-1,i-=h):(a=0,r=i=(E+O)/2),(o-=2*f)>tb?(e+=f*=A?1:-1,n-=f):(o=0,e=n=(E+O)/2)),u=k*Xy(e),h=k*Qy(e),f=M*Xy(i),E=M*Qy(i),s>tb&&(d=k*Xy(n),p=k*Qy(n),g=M*Xy(r),m=M*Qy(r),S<eb)&&((O=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<tb))return[t+(l=(o*(e-a)-s*(t-i))/l)*n,e+l*r]}(u,h,g,m,d,p,f,E))?(S=u-O[0],y=h-O[1],b=d-O[0],v=p-O[1],y=1/Qy((1<(S=(S*b+y*v)/(Jy(S*S+y*y)*Jy(b*b+v*v)))?0:S<-1?eb:Math.acos(S))/2),b=Jy(O[0]*O[0]+O[1]*O[1]),x=Zy(s,(M-b)/(y-1)),w=Zy(s,(k-b)/(1+y))):x=w=0),o>tb?w>tb?(l=yb(g,m,u,h,k,w,A),c=yb(d,p,f,E,k,w,A),R.moveTo(l.cx+l.x01,l.cy+l.y01),w<s?R.arc(l.cx,l.cy,w,Uy(l.y01,l.x01),Uy(c.y01,c.x01),!A):(R.arc(l.cx,l.cy,w,Uy(l.y01,l.x01),Uy(l.y11,l.x11),!A),R.arc(0,0,k,Uy(l.cy+l.y11,l.cx+l.x11),Uy(c.cy+c.y11,c.cx+c.x11),!A),R.arc(c.cx,c.cy,w,Uy(c.y11,c.x11),Uy(c.y01,c.x01),!A))):(R.moveTo(u,h),R.arc(0,0,k,e,n,!A)):R.moveTo(u,h),M>tb&&a>tb?x>tb?(l=yb(f,E,d,p,M,-x,A),c=yb(u,h,g,m,M,-x,A),R.lineTo(l.cx+l.x01,l.cy+l.y01),x<s?R.arc(l.cx,l.cy,x,Uy(l.y01,l.x01),Uy(c.y01,c.x01),!A):(R.arc(l.cx,l.cy,x,Uy(l.y01,l.x01),Uy(l.y11,l.x11),!A),R.arc(0,0,M,Uy(l.cy+l.y11,l.cx+l.x11),Uy(c.cy+c.y11,c.cx+c.x11),A),R.arc(c.cx,c.cy,x,Uy(c.y11,c.x11),Uy(c.y01,c.x01),!A))):R.arc(0,0,M,i,r,A):R.lineTo(f,E)):R.moveTo(0,0),R.closePath(),t)return R=null,t+""||null}return e.centroid=function(){var t=(+_.apply(this,arguments)+ +T.apply(this,arguments))/2,e=(+C.apply(this,arguments)+ +N.apply(this,arguments))/2-eb/2;return[Xy(e)*t,Qy(e)*t]},e.innerRadius=function(t){return arguments.length?(_="function"==typeof t?t:qy(+t),e):_},e.outerRadius=function(t){return arguments.length?(T="function"==typeof t?t:qy(+t),e):T},e.cornerRadius=function(t){return arguments.length?(P="function"==typeof t?t:qy(+t),e):P},e.padRadius=function(t){return arguments.length?(L=null==t?null:"function"==typeof t?t:qy(+t),e):L},e.startAngle=function(t){return arguments.length?(C="function"==typeof t?t:qy(+t),e):C},e.endAngle=function(t){return arguments.length?(N="function"==typeof t?t:qy(+t),e):N},e.padAngle=function(t){return arguments.length?(j="function"==typeof t?t:qy(+t),e):j},e.context=function(t){return arguments.length?(R=null==t?null:t,e):R},e}function xb(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function wb(t){this._context=t}function Mb(t){return new wb(t)}function kb(t){return t[0]}function Eb(t){return t[1]}function Ob(o,s){var l=qy(!0),c=null,u=Mb,h=null,f=fb(e);function e(t){var e,n,r,i=(t=xb(t)).length,a=!1;for(null==c&&(h=u(r=f())),e=0;e<=i;++e)!(e<i&&l(n=t[e],e,t))===a&&((a=!a)?h.lineStart():h.lineEnd()),a&&h.point(+o(n,e,t),+s(n,e,t));if(r)return h=null,r+""||null}return o="function"==typeof o?o:void 0===o?kb:qy(o),s="function"==typeof s?s:void 0===s?Eb:qy(s),e.x=function(t){return arguments.length?(o="function"==typeof t?t:qy(+t),e):o},e.y=function(t){return arguments.length?(s="function"==typeof t?t:qy(+t),e):s},e.defined=function(t){return arguments.length?(l="function"==typeof t?t:qy(!!t),e):l},e.curve=function(t){return arguments.length?(u=t,null!=c&&(h=u(c)),e):u},e.context=function(t){return arguments.length?(null==t?c=h=null:h=u(c=t),e):c},e}function Sb(u,h,f){var d=null,p=qy(!0),g=null,m=Mb,v=null,y=fb(e);function e(t){var e,n,r,i,a,o=(t=xb(t)).length,s=!1,l=new Array(o),c=new Array(o);for(null==g&&(v=m(a=y())),e=0;e<=o;++e){if(!(e<o&&p(i=t[e],e,t))===s)if(s=!s)n=e,v.areaStart(),v.lineStart();else{for(v.lineEnd(),v.lineStart(),r=e-1;n<=r;--r)v.point(l[r],c[r]);v.lineEnd(),v.areaEnd()}s&&(l[e]=+u(i,e,t),c[e]=+h(i,e,t),v.point(d?+d(i,e,t):l[e],f?+f(i,e,t):c[e]))}if(a)return v=null,a+""||null}function t(){return Ob().defined(p).curve(m).context(g)}return u="function"==typeof u?u:void 0===u?kb:qy(+u),h="function"==typeof h?h:qy(void 0===h?0:+h),f="function"==typeof f?f:void 0===f?Eb:qy(+f),e.x=function(t){return arguments.length?(u="function"==typeof t?t:qy(+t),d=null,e):u},e.x0=function(t){return arguments.length?(u="function"==typeof t?t:qy(+t),e):u},e.x1=function(t){return arguments.length?(d=null==t?null:"function"==typeof t?t:qy(+t),e):d},e.y=function(t){return arguments.length?(h="function"==typeof t?t:qy(+t),f=null,e):h},e.y0=function(t){return arguments.length?(h="function"==typeof t?t:qy(+t),e):h},e.y1=function(t){return arguments.length?(f=null==t?null:"function"==typeof t?t:qy(+t),e):f},e.lineX0=e.lineY0=function(){return t().x(u).y(h)},e.lineY1=function(){return t().x(u).y(f)},e.lineX1=function(){return t().x(d).y(h)},e.defined=function(t){return arguments.length?(p="function"==typeof t?t:qy(!!t),e):p},e.curve=function(t){return arguments.length?(m=t,null!=g&&(v=m(g)),e):m},e.context=function(t){return arguments.length?(null==t?g=v=null:v=m(g=t),e):g},e}hb.prototype=ub.prototype,wb.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 Ab=Tb(Mb);function _b(t){this._curve=t}function Tb(e){function t(t){return new _b(e(t))}return t._curve=e,t}function Pb(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(Tb(t)):e()._curve},t}function Lb(){}function Cb(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 Nb(t,e){this._context=t,this._k=(1-e)/6}function jb(t,e){this._context=t,this._k=(1-e)/6}function Rb(t,e,n){var r,i,a=t._x1,o=t._y1,s=t._x2,l=t._y2;t._l01_a>tb&&(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>tb&&(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 Ib(t,e){this._context=t,this._alpha=e}_b.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))}},Nb.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:Cb(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:Cb(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 Nb(t,n)}return t.tension=function(t){return e(+t)},t}(0),jb.prototype={areaStart:Lb,areaEnd:Lb,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:Cb(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 jb(t,n)}return t.tension=function(t){return e(+t)},t}(0),Ib.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:Rb(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 Bb=function e(n){function t(t){return n?new Ib(t,n):new Nb(t,0)}return t.alpha=function(t){return e(+t)},t}(.5);function Db(t,e){this._context=t,this._alpha=e}Db.prototype={areaStart:Lb,areaEnd:Lb,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:Rb(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 Fb=function e(n){function t(t){return n?new Db(t,n):new jb(t,0)}return t.alpha=function(t){return e(+t)},t}(.5);function zb(t){this._context=t}function Wb(t){return new zb(t)}function Gb(t,e){this._context=t,this._t=e}function Hb(t){return new Gb(t,.5)}function Yb(t){return new Gb(t,0)}function Vb(t){return new Gb(t,1)}function qb(t,e,n){return Math.max(e,Math.min(t,n))}function $b(t,e,n,r,i={}){var{inset:a=0,radius:o=0,insetLeft:s=a,insetTop:l=a,insetRight:c=a,insetBottom:u=a,radiusBottomLeft:h=o,radiusBottomRight:f=o,radiusTopLeft:d=o,radiusTopRight:p=o,minWidth:g=-1/0,maxWidth:m=1/0}=i,i=it(i,["inset","radius","insetLeft","insetTop","insetRight","insetBottom","radiusBottomLeft","radiusBottomRight","radiusTopLeft","radiusTopRight","minWidth","maxWidth"]);if(!sp(r)&&!cp(r)){var v=!!op(r),[y,,b]=v?yy(e):e;const[E,M]=y;var[b,y]=ly(b,y),x=(0<b?E:E+b)+s,w=(0<y?M:M+y)+l,b=Math.abs(b)-(s+c),s=Math.abs(y)-(l+u),c=v?b:qb(b,g,m),y=v?qb(s,g,m):s,l=x-(c-b)/2,u=w-(y-s)/2;return st(t.createElement("rect",{})).style("x",l).style("y",u).style("width",c).style("height",y).style("radius",[d,p,f,h]).call(C,i).node()}const{y:M,y1:k}=n;v=r.getCenter(),g=by(r,e,[M,k]),m=bb().cornerRadius(o).padAngle(a*Math.PI/180);return st(t.createElement("path",{})).style("path",m(g)).style("transform",`translate(${v[0]}, ${v[1]})`).style("radius",o).style("inset",a).call(C,i).node()}zb.prototype={areaStart:Lb,areaEnd:Lb,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))}},Gb.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 Ub=(O,t)=>{const{colorAttribute:S,first:A=!0,last:_=!0}=O,T=it(O,["colorAttribute","opacityAttribute","first","last"]),{coordinate:P,document:L}=t;return(t,e,n)=>{var{color:r,radius:i=0}=n,n=it(n,["color","radius"]),a=n.lineWidth||1,{stroke:o,radius:i=i,radiusTopLeft:s=i,radiusTopRight:l=i,radiusBottomRight:c=i,radiusBottomLeft:u=i,innerRadius:h=0,innerRadiusTopLeft:f=h,innerRadiusTopRight:d=h,innerRadiusBottomRight:p=h,innerRadiusBottomLeft:h=h,lineWidth:a="stroke"===S||o?a:0,inset:g=0,insetLeft:m=g,insetRight:v=g,insetBottom:y=g,insetTop:b=g,minWidth:x,maxWidth:w}=T,M=it(T,["stroke","radius","radiusTopLeft","radiusTopRight","radiusBottomRight","radiusBottomLeft","innerRadius","innerRadiusTopLeft","innerRadiusTopRight","innerRadiusBottomRight","innerRadiusBottomLeft","lineWidth","inset","insetLeft","insetRight","insetBottom","insetTop","minWidth","maxWidth"]),{color:r=r,opacity:k}=e;const E=[A?s:f,A?l:d,_?c:p,_?u:h];s=["radiusTopLeft","radiusTopRight","radiusBottomRight","radiusBottomLeft"],op(P)&&s.push(s.shift()),f=Object.assign(Object.assign({radius:i},Object.fromEntries(s.map((t,e)=>[t,E[e]]))),{inset:g,insetLeft:m,insetRight:v,insetBottom:y,insetTop:b,minWidth:x,maxWidth:w});return st($b(L,t,e,P,f)).call(C,n).style("fill","transparent").style(S,r).style(xy(O),k).style("lineWidth",a).style("stroke",void 0===o?r:o).call(C,M).node()}},Xb=(Ub.props={defaultEnterAnimation:"scaleInY",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},(t,e)=>Ub(Object.assign({colorAttribute:"fill"},t),e)),Kb=(Xb.props=Object.assign(Object.assign({},Ub.props),{defaultMarker:"square"}),(t,e)=>Ub(Object.assign({colorAttribute:"stroke"},t),e));Kb.props=Object.assign(Object.assign({},Ub.props),{defaultMarker:"hollowSquare"});const Zb=(t,e)=>{const{adjustPoints:s=function(t,e,n){var[t,r,i,a]=t;if(op(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,l=it(t,["adjustPoints"]),{coordinate:c,document:u}=e;return(t,e,n,r)=>{var i=e["index"],a=n["color"],n=it(n,["color"]),r=r[i+1],i=s(t,r,c),[t,r,i,o]=!!op(c)?yy(i):i,{color:e=a,opacity:a}=e,t=Ob().curve(Wb)([t,r,i,o]);return st(u.createElement("path",{})).call(C,n).style("path",t).style("fill",e).style("fillOpacity",a).call(C,l).node()}};function Qb(t,e,n){var[t,r,i,a]=t;if(op(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]}Zb.props={defaultMarker:"square"};const Jb=(t,e)=>Zb(Object.assign({adjustPoints:Qb},t),e);function t2(t){const e="function"==typeof t?t:t.render;return class extends Ds{connectedCallback(){this.draw()}attributeChangedCallback(){this.draw()}draw(){e(this)}}}Jb.props={defaultMarker:"square"};const e2=t2(t=>{var{d1:e,d2:n,style1:r,style2:i}=t.attributes;const a=t.ownerDocument;st(t).maybeAppend("line",()=>a.createElement("path",{})).style("d",e).call(C,r),st(t).maybeAppend("line1",()=>a.createElement("path",{})).style("d",n).call(C,i)});const n2=(t,e)=>{const{curve:u,gradient:h=!1,gradientColor:f="between",defined:d=t=>!Number.isNaN(t)&&null!=t,connect:p=!1}=t,g=it(t,["curve","gradient","gradientColor","defined","connect"]),{coordinate:m,document:v}=e;return(t,e,n)=>{var{color:r,lineWidth:i}=n,n=it(n,["color","lineWidth"]),{color:r=r,size:i=i,seriesColor:a,seriesX:o,seriesY:s}=e,a=h&&a?vy(a,o,s,h,f):r,o=wy(m,e),s=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},n),a&&{stroke:a}),i&&{lineWidth:i}),o&&{transform:o}),g);let l;if(sp(m)){const c=m.getCenter();l=n=>Pb(Ob().curve(Ab)).angle((t,e)=>fy(ly(n[e],c))).radius((t,e)=>uy(n[e],c)).defined(([t,e])=>d(t)&&d(e)).curve(u)(n)}else l=Ob().x(t=>t[0]).y(t=>t[1]).defined(([t,e])=>d(t)&&d(e)).curve(u);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,d),n=at(s,"connect"),a=!!e.length;return(!a||p&&!Object.keys(n).length?st(v.createElement("path",{})).style("d",l(r)||[]).call(C,s):a&&!p?st(v.createElement("path",{})).style("d",l(t)).call(C,s):st(new e2).style("style1",Object.assign(Object.assign({},s),n)).style("style2",s).style("d1",e.map(l).join(",")).style("d2",l(t))).node()}},r2=(n2.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},(n,r)=>{const i=r["coordinate"];return(...t)=>{var e=sp(i)?Wb:Mb;return n2(Object.assign({curve:e},n),r)(...t)}}),i2=(r2.props=Object.assign(Object.assign({},n2.props),{defaultMarker:"line"}),(t,n)=>{const{alpha:r=.5}=t,i=it(t,["alpha"]),a=n["coordinate"];return(...t)=>{var e=sp(a)?Fb:Bb;return n2(Object.assign({curve:e.alpha(r)},i),n)(...t)}}),a2=(i2.props=Object.assign(Object.assign({},n2.props),{defaultMarker:"smooth"}),(t,e)=>n2(Object.assign({curve:Vb},t),e)),o2=(a2.props=Object.assign(Object.assign({},n2.props),{defaultMarker:"hv"}),(t,e)=>n2(Object.assign({curve:Yb},t),e)),s2=(o2.props=Object.assign(Object.assign({},n2.props),{defaultMarker:"vh"}),(t,e)=>n2(Object.assign({curve:Hb},t),e));s2.props=Object.assign(Object.assign({},n2.props),{defaultMarker:"hvh"});const l2=(b,t)=>{const x=t["document"];return(e,t,n)=>{var r,i,a,o,s,l,c,u,h,{seriesSize:f,color:t}=t,d=n["color"],n=it(n,["color"]),p=hb();for(let t=0;t<e.length-1;t++){var g=e[t],m=e[t+1],v=f[t],y=f[t+1];r=p,v=v,y=y,s=a=i=h=u=c=l=s=o=i=a=i=void 0,i=(s=hy(ly(m=m,g=g)))+Math.PI/2,a=[v/2*Math.cos(i),v/2*Math.sin(i)],i=[y/2*Math.cos(i),y/2*Math.sin(i)],o=[y/2*Math.cos(s),y/2*Math.sin(s)],s=[v/2*Math.cos(s),v/2*Math.sin(s)],l=cy(g,a),c=cy(m,i),u=cy(c,o),h=ly(o=cy(m,o),i),m=ly(m,i),i=ly(g,a),a=ly(i,s),g=ly(g,s),s=ly(l,s),r.moveTo(...l),r.lineTo(...c),r.arcTo(...u,...o,y/2),r.arcTo(...h,...m,y/2),r.lineTo(...i),r.arcTo(...a,...g,v/2),r.arcTo(...s,...l,v/2),r.closePath()}return st(x.createElement("path",{})).call(C,n).style("fill",t||d).style("d",p.toString()).call(C,b).node()}};l2.props=Object.assign(Object.assign({},n2.props),{defaultMarker:"line"});fl=(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"]],fl.style=["fill"],n=fl.bind(void 0),n.style=["stroke","lineWidth"],hs=(t,e,n)=>[["M",t-n,e-n],["L",t+n,e-n],["L",t+n,e+n],["L",t-n,e+n],["Z"]],hs.style=["fill"],Vo=hs.bind(void 0),Vo.style=["fill"],Ko=hs.bind(void 0),Ko.style=["stroke","lineWidth"],r=(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"]]},r.style=["fill"],ml=r.bind(void 0),ml.style=["stroke","lineWidth"],vl=(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"]]},vl.style=["fill"],e=vl.bind(void 0),e.style=["stroke","lineWidth"],pl=(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"]]},pl.style=["fill"],Fo=pl.bind(void 0),Fo.style=["stroke","lineWidth"],$o=(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"]]},$o.style=["fill"],qo=$o.bind(void 0),qo.style=["stroke","lineWidth"],Uo=(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"]]},Uo.style=["fill"],yl=Uo.bind(void 0),yl.style=["stroke","lineWidth"],Zo=(t,e,n)=>[["M",t,e+n],["L",t,e-n]],Zo.style=["stroke","lineWidth"],a=(t,e,n)=>[["M",t-n,e-n],["L",t+n,e+n],["M",t+n,e-n],["L",t-n,e+n]],a.style=["stroke","lineWidth"],rs=(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]],rs.style=["stroke","lineWidth"],is=(t,e,n)=>[["M",t-n,e],["L",t+n,e],["M",t,e-n],["L",t,e+n]],is.style=["stroke","lineWidth"],as=(t,e,n)=>[["M",t-n,e],["L",t+n,e]],as.style=["stroke","lineWidth"],os=(t,e,n)=>[["M",t-n,e],["L",t+n,e]],os.style=["stroke","lineWidth"],ss=os.bind(void 0),ss.style=["stroke","lineWidth"],ls=(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]],ls.style=["stroke","lineWidth"],cs=(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]],cs.style=["stroke","lineWidth"],Xo=(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]],Xo.style=["stroke","lineWidth"],gl=(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]],gl.style=["stroke","lineWidth"],wl=(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]];wl.style=["stroke","lineWidth"];const c2=new Map([["bowtie",Uo],["cross",a],["dash",ss],["diamond",r],["dot",os],["hexagon",$o],["hollowBowtie",yl],["hollowDiamond",ml],["hollowHexagon",qo],["hollowPoint",n],["hollowSquare",Ko],["hollowTriangle",e],["hollowTriangleDown",Fo],["hv",cs],["hvh",gl],["hyphen",as],["line",Zo],["plus",is],["point",fl],["rect",Vo],["smooth",ls],["square",hs],["tick",rs],["triangleDown",pl],["triangle",vl],["vh",Xo],["vhv",wl]]);const o=(c,t)=>{const{colorAttribute:u,symbol:e,mode:h="auto"}=c,f=it(c,["colorAttribute","symbol","mode"]),d=c2.get(e)||c2.get("point"),{coordinate:p,document:g}=t;return(t,e,n)=>{var{lineWidth:r,color:i}=n,r=f.stroke?r||1:r,{color:i=i,transform:a,opacity:o}=e,[s,l]=My(t),t=function(t,e,n,r){var i;if(1!==e.length)return n=n["size"],"fixed"!==t&&("normal"===t||hp(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,p)||f.r||n.r;return st(g.createElement("path",{})).call(C,n).style("fill","transparent").style("d",d(s,l,t)).style("lineWidth",r).style("transform",a).style("stroke",i).style(xy(c),o).style(u,i).call(C,f).node()}},u2=(o.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},(t,e)=>o(Object.assign({colorAttribute:"fill",symbol:"bowtie"},t),e)),h2=(u2.props=Object.assign({defaultMarker:"bowtie"},o.props),(t,e)=>o(Object.assign({colorAttribute:"stroke",symbol:"cross"},t),e)),f2=(h2.props=Object.assign({defaultMarker:"cross"},o.props),(t,e)=>o(Object.assign({colorAttribute:"fill",symbol:"diamond"},t),e)),d2=(f2.props=Object.assign({defaultMarker:"diamond"},o.props),(t,e)=>o(Object.assign({colorAttribute:"fill",symbol:"hexagon"},t),e)),p2=(d2.props=Object.assign({defaultMarker:"hexagon"},o.props),(t,e)=>o(Object.assign({colorAttribute:"stroke",symbol:"bowtie"},t),e)),g2=(p2.props=Object.assign({defaultMarker:"hollowBowtie"},o.props),(t,e)=>o(Object.assign({colorAttribute:"stroke",symbol:"diamond"},t),e)),m2=(g2.props=Object.assign({defaultMarker:"hollowDiamond"},o.props),(t,e)=>o(Object.assign({colorAttribute:"stroke",symbol:"hexagon"},t),e)),v2=(m2.props=Object.assign({defaultMarker:"hollowHexagon"},o.props),(t,e)=>o(Object.assign({colorAttribute:"stroke",symbol:"point"},t),e)),y2=(v2.props=Object.assign({defaultMarker:"hollowPoint"},o.props),(t,e)=>o(Object.assign({colorAttribute:"stroke",symbol:"square"},t),e)),b2=(y2.props=Object.assign({defaultMarker:"hollowSquare"},o.props),(t,e)=>o(Object.assign({colorAttribute:"stroke",symbol:"triangle"},t),e)),x2=(b2.props=Object.assign({defaultMarker:"hollowTriangle"},o.props),(t,e)=>o(Object.assign({colorAttribute:"stroke",symbol:"triangle-down"},t),e)),w2=(x2.props=Object.assign({defaultMarker:"hollowTriangleDown"},o.props),(t,e)=>o(Object.assign({colorAttribute:"stroke",symbol:"hyphen"},t),e)),M2=(w2.props=Object.assign({defaultMarker:"hyphen"},o.props),(t,e)=>o(Object.assign({colorAttribute:"stroke",symbol:"line"},t),e)),k2=(M2.props=Object.assign({defaultMarker:"line"},o.props),(t,e)=>o(Object.assign({colorAttribute:"stroke",symbol:"plus"},t),e)),E2=(k2.props=Object.assign({defaultMarker:"plus"},o.props),(t,e)=>o(Object.assign({colorAttribute:"fill",symbol:"point"},t),e)),O2=(E2.props=Object.assign({defaultMarker:"point"},o.props),(t,e)=>o(Object.assign({colorAttribute:"fill",symbol:"square"},t),e)),S2=(O2.props=Object.assign({defaultMarker:"square"},o.props),(t,e)=>o(Object.assign({colorAttribute:"stroke",symbol:"tick"},t),e)),A2=(S2.props=Object.assign({defaultMarker:"tick"},o.props),(t,e)=>o(Object.assign({colorAttribute:"fill",symbol:"triangle"},t),e)),_2=(A2.props=Object.assign({defaultMarker:"triangle"},o.props),(t,e)=>o(Object.assign({colorAttribute:"fill",symbol:"triangle-down"},t),e)),T2=(_2.props=Object.assign({defaultMarker:"triangleDown"},o.props),(t,e)=>{const{arrow:u=!0,arrowSize:h="40%"}=t,f=it(t,["arrow","arrowSize"]),d=e["document"];return(t,e,n)=>{var r,i,a,o,s=n["defaultColor"],n=it(n,["defaultColor"]),{color:e=s,transform:s}=e,[t,l]=t,c=hb();return c.moveTo(...t),c.lineTo(...l),u&&([a,o]=(t=t,r=l,i="string"==typeof(i=(i={arrowSize:h})["arrowSize"])?+parseFloat(i)/100*uy(t,r):i,a=Math.PI/6,t=Math.atan2(r[1]-t[1],r[0]-t[0]),o=Math.PI/2-t-a,t-=a,[[r[0]-i*Math.sin(o),r[1]-i*Math.cos(o)],[r[0]-i*Math.cos(t),r[1]-i*Math.sin(t)]]),c.moveTo(...l),c.lineTo(...a),c.moveTo(...l),c.lineTo(...o)),st(d.createElement("path",{})).call(C,n).style("d",c.toString()).style("stroke",e).style("transform",s).call(C,f).node()}});function P2(t){C2(t,!0)}function L2(t){C2(t,!1)}function C2(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)})}T2.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};ce(R2,N2=Gs);var N2,j2=R2;function R2(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=N2.apply(this,b([],k(t),!1))||this;return n.addEventListener(x.INSERTED,function(){L2(n)}),n}function I2(t){t=t.appendChild(new j2({class:"offscreen"}));return L2(t),t}ce(F2,B2=al),Object.defineProperty(F2.prototype,"offscreenGroup",{get:function(){return this._offscreen||(this._offscreen=I2(this)),this._offscreen},enumerable:!1,configurable:!0}),F2.prototype.disconnectedCallback=function(){var t;null!=(t=this._offscreen)&&t.destroy()};var B2,D2=F2;function F2(t){var e=(t=void 0===t?{}:t).style,t=it(t,["style"]);return B2.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 z2(t){return t*Math.PI/180}function W2(t){return Number((180*t/Math.PI).toPrecision(5))}Object.defineProperty(H2.prototype,"bottom",{get:function(){return this.y+this.height},enumerable:!1,configurable:!0}),Object.defineProperty(H2.prototype,"left",{get:function(){return this.x},enumerable:!1,configurable:!0}),Object.defineProperty(H2.prototype,"right",{get:function(){return this.x+this.width},enumerable:!1,configurable:!0}),Object.defineProperty(H2.prototype,"top",{get:function(){return this.y},enumerable:!1,configurable:!0}),H2.fromRect=function(t){return new H2(t.x,t.y,t.width,t.height)},H2.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 G2=H2;function H2(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 Y2(t,e){return ze(t)?t.apply(void 0,b([],k(e),!1)):t}function V2(t,e){function r(t){return"".concat(e,"-").concat(t)}return t=Object.fromEntries(Object.entries(t).map(function(t){var t=k(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 q2(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r+=1)U2(t,e[r]);return t}var $2,U2=function(r,i,a,o){void 0===a&&(a=0),void 0===o&&(o=5),Object.entries(i).forEach(function(t){var t=k(t,2),e=t[0],t=t[1],n=r;Object.prototype.hasOwnProperty.call(i,e)&&(t?qe(t)?(qe(r[e])||(n[e]={}),a<o?U2(r[e],t,a+1,o):n[e]=i[e]):He(t)?(n[e]=[],n[e]=n[e].concat(t)):n[e]=t:n[e]=t)})},X2=function(t){return void 0!==t&&null!=t&&!Number.isNaN(t)},K2=cn(function(t,e){var n=Ke(t)?t:t.style.text.toString(),e=e||Z2(t),t=e.fontSize,r=e.fontFamily,i=e.fontWeight,a=e.fontStyle,e=e.fontVariant;return($2=$2||document.createElement("canvas").getContext("2d")).font=[a,e,i,"".concat(t,"px"),r].join(" "),$2.measureText(n).width},function(t,e){return[Ke(t)?t:t.style.text.toString(),Object.values(e||Z2(t)).join()].join("")}),Z2=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 Q2(t){return"text"===t.nodeName?t:"g"===t.nodeName&&1===t.children.length&&"text"===t.children[0].nodeName?t.children[0]:null}function J2(t,e){t=Q2(t);t&&t.attr(e)}function tx(t,e,n){J2(t,{wordWrap:!0,wordWrapWidth:e,maxLines:1,textOverflow:n=void 0===n?"...":n})}function ex(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 nx(t){return"function"==typeof t?t():Ke(t)||Qe(t)?new D2({style:{text:String(t)}}):t}function rx(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 ix(t,e,n,r,i){return(r=void 0===r?!0:r)&&t===e||i&&t===n||e<t&&t<n}var ax=function(e,n){return function(t){return e*(1-t)+n*t}};function ox(e,t){var i,a,o,s,n,r,l;return"number"==typeof e&&"number"==typeof t?ax(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]=ox(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=k(t,2),e=t[0],t=t[1];e in n?r[e]=ox(n[e],t):l[e]=t}),function(n){return Object.entries(r).forEach(function(t){var t=k(t,2),e=t[0],t=t[1];return l[e]=t(n)}),l}):function(t){return e}}function sx(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=k([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 G2(e,n,r-e,i-n)}function lx(n,t,e){function r(t){var e=k(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,h=u?e?[1,0]:[-1,0]:e?[0,1]:[0,-1],f=(s=k([0,0],2))[0],d=s[1],e=sx(o=t.map(function(t){var e=t.width,t=t.height,n=k([f,d],2),r=n[0],n=n[1],i=k([f+e*h[0],d+t*h[1]],2);return f=i[0],d=i[1],new G2(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 sx(s=o.map(function(t){var e=t.x,n=t.y,t=G2.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=G2.fromRect(t);return t.x=u?e:e+r(t),t.y=u?n+r(t):n,t}).map(function(t){var e,t=G2.fromRect(t);return t.x+=null!=(e=n.x)?e:0,t.y+=null!=(e=n.y)?e:0,t})}function cx(t,e,n){return[]}function ux(t,e){return[t[0]*e,t[1]*e]}function hx(t,e){return[t[0]+e[0],t[1]+e[1]]}function fx(t,e){return[t[0]-e[0],t[1]-e[1]]}function dx(t,e){return[Math.min(t[0],e[0]),Math.min(t[1],e[1])]}function px(t,e){return[Math.max(t[0],e[0]),Math.max(t[1],e[1])]}function gx(t,e){return Math.sqrt(Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2))}function mx(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 vx(t,e){e=Math.pow(10,e);return~~(t*e)/e}function yx(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 bx(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=k(r,2))[0],l=r[1];for(var c=0,u=t.length;c<u;c+=1)s=dx(s,x=t[c]),l=px(l,x)}for(var c=0,h=t.length;c<h;c+=1){var f,d,p,g,m,v,y,b,x=t[c];0!==c||n?c!==h-1||n?(f=t[[c?c-1:h-1,c-1][n?0:1]],v=[0,0],v=ux(v=fx(d=t[n?(c+1)%h:c+1],f),e),0!==(m=(p=gx(x,f))+(g=gx(x,d)))&&(p/=m,g/=m),m=ux(v,-p),v=ux(v,g),y=hx(x,m),b=dx(b=hx(x,v),px(d,x)),b=px(b,dx(d,x)),y=dx(y=hx(x,m=ux(m=fx(b,x),-p/g)),px(f,x)),b=hx(x,v=ux(v=fx(x,y=px(y,dx(f,x))),g/p)),o&&(y=dx(y=px(y,s),l),b=dx(b=px(b,s),l)),a.push(i),a.push(y),i=b):(y=x,a.push(i),a.push(y)):i=x}return n&&a.push(a.shift()),a}(r,.4,e,n),u=r.length,h=[],i=0;i<u-1;i+=1)o=c[2*i],s=c[2*i+1],h.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=k(r,1)[0],h.push(["C",o[0],o[1],s[0],s[1],l[0],l[1]])),h}var xx=["$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 wx(t){var e,n,r={};for(e in t)n=e,xx.includes(n)&&(r[e]=t[e]);return r}function Mx(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)}E.prototype.selectAll=function(t){return new E("string"==typeof t?this._parent.querySelectorAll(t):t,null,this._elements[0],this._document)},E.prototype.selectFacetAll=function(t){t="string"==typeof t?this._parent.querySelectorAll(t):t;return new E(this._elements,null,this._parent,this._document,void 0,void 0,t)},E.prototype.select=function(t){t="string"==typeof t?this._parent.querySelectorAll(t)[0]||null:t;return new E([t],null,t,this._document)},E.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=k(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 E(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 E(r,null,r[0],this._document)},E.prototype.maybeAppend=function(t,e){e=fe(this,kx,"m",Ex).call(this,"#"===t[0]?t:"#".concat(t),e);return e.attr("id",t),e},E.prototype.maybeAppendByClassName=function(t,e){t=t.toString(),e=fe(this,kx,"m",Ex).call(this,"."===t[0]?t:".".concat(t),e);return e.attr("className",t),e},E.prototype.maybeAppendByName=function(t,e){e=fe(this,kx,"m",Ex).call(this,'[name="'.concat(t,'"]'),e);return e.attr("name",t),e},E.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]})),h=new Map(this._facetElements.map(function(t,e){return[n(t.__data__,e),t]})),f=Pd(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(h.has(g))(x=h.get(g)).__data__=p,x.__facet__=!0,o.push(x),h.delete(g);else if(f.has(g)){var v=f.get(g);l.push([p,v]);try{r=void 0;for(var y=he(v),b=y.next();!b.done;b=y.next()){var x=b.value;s.delete(x)}}catch(t){r={error:t}}finally{try{b&&!b.done&&(i=y.return)&&i.call(y)}finally{if(r)throw r.error}}f.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 E([],a,this._parent,this._document),new E(o,null,this._parent,this._document),new E(s,null,this._parent,this._document),new E([],l,this._parent,this._document),new E(c,null,this._parent,this._document)];return new E(this._elements,null,this._parent,this._document,w)},E.prototype.merge=function(t){var e=b(b([],k(this._elements),!1),k(t._elements),!1),t=b(b([],k(this._transitions),!1),k(t._transitions),!1);return new E(e,null,this._parent,this._document,void 0,t)},E.prototype.createElement=function(t){if(this._document)return this._document.createElement(t,{});var e=E.registry[t];if(e)return new e;throw e="Unknown node type: ".concat(t),new Error(e)},E.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)},E.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 E([],null,this._parent,this._document,void 0,this._transitions)},E.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},E.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))})},E.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))})},E.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=k(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))})})},E.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))})},E.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))})},E.prototype.transition=function(n){var r=this._transitions;return this.each(function(t,e){r[e]=n.call(this,t,e)})},E.prototype.on=function(t,e){return this.each(function(){this.addEventListener(t,e)}),this},E.prototype.call=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return t.call.apply(t,b([this._parent,this],k(e),!1)),this},E.prototype.node=function(){return this._elements[0]},E.prototype.nodes=function(){return this._elements},E.prototype.transitions=function(){return this._transitions.filter(function(t){return!!t})},E.prototype.parent=function(){return this._parent},kx=new WeakSet,Ex=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 E([t],null,this._parent,this._document)},E.registry={g:Gs,rect:rl,circle:Is,path:Zs,text:D2,ellipse:zs,image:qs,line:Us,polygon:Js,polyline:el,html:Ys};var kx,Ex,Ox=E;function E(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=[]),kx.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 Ox([t],null,t,t.ownerDocument)}function Sx(t,e,n){return t.querySelector(e)?w(t).select(e):w(t).append(n)}function Ax(t){if(Qe(t))return[t,t,t,t];if(He(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 _x(t){var t=t.getLocalBounds(),t=k([t.min,t.max],2),e=k(t[0],2),n=e[0],e=e[1],t=k(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 Tx(t){return t.toString().charAt(0).toUpperCase()+t.toString().slice(1)}function Px(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 O(t,r,i){void 0===i&&(i=!1);var a={};return Object.entries(t).forEach(function(t){var e,t=k(t,2),n=t[0],t=t[1];"className"!==n&&"class"!==n&&(n.startsWith("show")&&Px(n,"show").startsWith(r)!==i?n===(e=r,"".concat("show").concat(Tx(e)))?a[n]=t:a[n.replace(new RegExp(Tx(r)),"")]=t:n.startsWith("show")||n.startsWith(r)===i||"filter"===(e=Px(n,r))&&"function"==typeof t||(a[e]=t))}),a}function Lx(t,r){return Object.entries(t).reduce(function(t,e){var e=k(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(Tx(n))]=e,t},{})}function Cx(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=k(t,2),e=t[0],t=t[1];n.includes(e)||(-1!==r.indexOf(e)?a[e]=t:i[e]=t)}),[i,a]}function Nx(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=k([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(Rx,jx=Ds),Object.defineProperty(Rx.prototype,"offscreenGroup",{get:function(){return this._offscreen||(this._offscreen=I2(this)),this._offscreen},enumerable:!1,configurable:!0}),Object.defineProperty(Rx.prototype,"defaultOptions",{get:function(){return this._defaultOptions},enumerable:!1,configurable:!0}),Rx.prototype.connectedCallback=function(){this.render(this.attributes,this),this.bindEvents(this.attributes,this),this.initialized=!0},Rx.prototype.disconnectedCallback=function(){var t;null!=(t=this._offscreen)&&t.destroy()},Rx.prototype.attributeChangedCallback=function(t){"visibility"===t&&!function(){C2(this,"hidden"!==this.attributes.visibility)}.call(this)},Rx.prototype.update=function(t,e){return this.attr(q2({},this.attributes,t=void 0===t?{}:t)),null==(t=this.render)?void 0:t.call(this,this.attributes,this,e)},Rx.prototype.clear=function(){this.removeChildren()},Rx.prototype.bindEvents=function(t,e){};var jx,El=Rx;function Rx(t,e){t=jx.call(this,q2({},{style:e=void 0===e?{}:e},t))||this;return t.initialized=!1,t._defaultOptions=e,t}function Ix(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 Bx(t,e,n){return[["M",t,e+n],["L",t,e-n]]}function Dx(t,e,n){return[["M",t-n,e],["L",t+n,e]]}_l=Ix,Nl=Dx;function Fx(t){n="default",Ye(e=t)&&e instanceof Image?n="image":ze(e)?n="symbol":Ke(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(Gx,zx=El),Gx.prototype.render=function(t,e){var r=t.symbol,n=t.size,i=void 0===n?16:n,a=it(t,["symbol","size"]),o=Fx(r);rx(!!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=ze(r)?r:Gx.getSymbol(r),t.styles(y({path:null==n?void 0:n(0,0,e)},a)))})})},Gx.MARKER_SYMBOL_MAP=new Map,Gx.registerSymbol=function(t,e){Gx.MARKER_SYMBOL_MAP.set(t,e)},Gx.getSymbol=function(t){return Gx.MARKER_SYMBOL_MAP.get(t)};var zx,Wx=Gx;function Gx(){return null!==zx&&zx.apply(this,arguments)||this}Wx.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]]}),Wx.registerSymbol("hyphen",function(t,e,n){return[["M",t-n,e],["L",t+n,e]]}),Wx.registerSymbol("line",Bx),Wx.registerSymbol("plus",function(t,e,n){return[["M",t-n,e],["L",t+n,e],["M",t,e-n],["L",t,e+n]]}),Wx.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]]}),Wx.registerSymbol("circle",Ix),Wx.registerSymbol("point",_l),Wx.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"]]}),Wx.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"]]}),Wx.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"]]}),Wx.registerSymbol("diamond",function(t,e,n){return[["M",t-n,e],["L",t,e-n],["L",t+n,e],["L",t,e+n],["Z"]]}),Wx.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"]]}),Wx.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"]]}),Wx.registerSymbol("line",Bx),Wx.registerSymbol("dot",Dx),Wx.registerSymbol("dash",Nl),Wx.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]]}),Wx.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]]}),Wx.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]]}),Wx.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]]}),Wx.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(Vx,Hx=js),Vx.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()})},Vx.prototype.update=function(t){this.attr(q2({},this.attributes,t)),this.render()},Vx.prototype.clear=function(){this.removeChildren()};var Hx,Yx=Vx;function Vx(t){var e=this,n=t.style,t=it(t,["style"]);return(e=Hx.call(this,ot({},{type:"column"},y({style:n},t)))||this).columnsGroup=new Gs({name:"columns"}),e.appendChild(e.columnsGroup),e.render(),e}ce(Ux,qx=js),Ux.prototype.render=function(){var t=this.attributes,e=t.lines,t=t.areas;e&&this.renderLines(e),t&&this.renderAreas(t)},Ux.prototype.clear=function(){this.linesGroup.removeChildren(),this.areasGroup.removeChildren()},Ux.prototype.update=function(t){this.attr(q2({},this.attributes,t)),this.render()},Ux.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()})},Ux.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 qx,$x=Ux;function Ux(t){var e=this,n=t.style,t=it(t,["style"]);return(e=qx.call(this,ot({},{type:"lines"},y({style:n},t)))||this).linesGroup=e.appendChild(new Gs),e.areasGroup=e.appendChild(new Gs),e.render(),e}function Xx(t,e){var n=(e=void 0===e?!1:e)?t.length-1:0,t=t.map(function(t,e){return b([e===n?"M":"L"],k(t),!1)});return e?t.reverse():t}function Kx(t,e){if(void 0===e&&(e=!1),t.length<=2)return Xx(t);for(var n=[],r=t.length,i=0;i<r;i+=1){var a=e?t[r-i-1]:t[i];pn(a,n.slice(-2))||n.push.apply(n,b([],k(a),!1))}var o=bx(n,!1);return e?o.unshift(b(["M"],k(t[r-1]),!1)):o.unshift(b(["M"],k(t[0]),!1)),o}function Zx(t,e,n){t=sn(t);return t.push(["L",e,n],["L",0,n],["Z"]),t}function Qx(t){return 0===t.length?[0,0]:[Ue(function(t,e){if(He(t)){for(var n,r=1/0,i=0;i<t.length;i++){var a=t[i],o=ze(e)?e(a):a[e];o<r&&(n=a,r=o)}return n}}(t,function(t){return Ue(t)||0})),$e(function(t,e){if(He(t)){for(var n,r=-1/0,i=0;i<t.length;i++){var a=t[i],o=ze(e)?e(a):a[e];r<o&&(n=a,r=o)}return n}}(t,function(t){return $e(t)||0}))]}function Jx(t){for(var e=sn(t),n=e[0].length,t=k([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(nw,tw=El),Object.defineProperty(nw.prototype,"rawData",{get:function(){var t=this.attributes.data;return t&&0!==(null==t?void 0:t.length)?(t=sn(t),Qe(t[0])?[t]:t):[[]]},enumerable:!1,configurable:!0}),Object.defineProperty(nw.prototype,"data",{get:function(){return this.attributes.isStack?Jx(this.rawData):this.rawData},enumerable:!1,configurable:!0}),Object.defineProperty(nw.prototype,"scales",{get:function(){return this.createScales(this.data)},enumerable:!1,configurable:!0}),Object.defineProperty(nw.prototype,"baseline",{get:function(){var t=this.scales.y,e=k(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(nw.prototype,"containerShape",{get:function(){var t=this.attributes;return{width:t.width,height:t.height}},enumerable:!1,configurable:!0}),Object.defineProperty(nw.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,h,f,d,p=O(this.attributes,"area"),g=O(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=k(s.getOptions().range||[0,0],2))[0],c=u[1],l<c&&(u=k([l,c],2),c=u[0],l=u[1]),a=e.map(function(t){return t.map(function(t,e){return[o.map(e),Ze(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=Kx(o),l=void 0,l=0===i?Zx(s,e,n):(a=Kx(t[i-1],!0),o=o[0],a[0][0]="L",b(b(b([],k(s),!1),k(a),!1),[b(["M"],k(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=Xx(t[i]),s=void 0,s=0===i?Zx(o,e,n):((a=Xx(t[i-1],!0))[0][0]="L",b(b(b([],k(o),!1),k(a),!1),[["Z"]],!1));r.push(s)}return r})(a,t,e):(h=i,f=t,d=e,a.map(function(t){return Zx((h?Kx:Xx)(t),f,d)}))),{lines:a.map(function(t,e){return y({stroke:n.getColor(e),path:(i?Kx:Xx)(t)},g)}),areas:u.map(function(t,e){return y({path:t,fill:n.getColor(e)},p)})})},enumerable:!1,configurable:!0}),Object.defineProperty(nw.prototype,"columnsStyle",{get:function(){var i=this,a=O(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=Jx(s));var e=this.createScales(s),l=e.x,c=e.y,e=k(Qx(s),2),n=e[0],e=e[1],u=new Pv({domain:[0,e-(0<n?0:n)],range:[0,t]}),h=l.getBandWidth(),f=this.rawData;return{columns:s.map(function(t,r){return t.map(function(t,e){var n=h/s.length;return y(y({fill:i.getColor(r)},a),o?{x:l.map(e),y:c.map(t),width:h,height:u.map(f[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}),nw.prototype.render=function(t,e){this.container=Sx(e,".container","rect").attr("className","container").node();var n=t.type,r="spark".concat(n),i="line"===n?this.linesStyle:this.columnsStyle;this.spark=Sx(e,".".concat(r),function(){return new("line"===n?$x:Yx)({className:r,style:i})}).styles(i).node()},nw.prototype.getColor=function(t){var e=this.attributes.color;return He(e)?e[t%e.length]:ze(e)?e.call(null,t):e},nw.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=k(Qx(t),2),c=l[0],l=l[1],c=new Pv({domain:[null!=(e=i[0])?e:c,null!=(e=i[1])?e:l],range:[o,0]});return"line"===r?{type:r,x:new Pv({domain:[0,t[0].length-1],range:[0,s]}),y:c}:{type:r,x:new yv({domain:t[0].map(function(t,e){return e}),range:[0,s],paddingInner:a?n:0}),y:c}},nw.tag="sparkline";var tw,ew=nw;function nw(t){return tw.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 rw(n){var e,r;return n?(e=["enter","update","exit"],r=Object.fromEntries(Object.entries(n).filter(function(t){t=k(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 iw(t,e){t?t.finished.then(e):e()}function aw(t,e){"update"in t?t.update(e):t.attr(e)}function ow(t,e,n){return 0===e.length?null:n?t.animate(e,n):(aw(t,{style:e.slice(-1)[0]}),null)}function sw(r,t,e){var i={},a={};return Object.entries(t).forEach(function(t){var e,t=k(t,2),n=t[0],t=t[1];A(t)||(e=r.style[n]||r.parsedStyle[n]||0)!==t&&(i[n]=e,a[n]=t)}),e?ow(r,[i,a],y({fill:"both"},e)):(aw(r,a),null)}function lw(t,e){return t.style.opacity||(t.style.opacity=1),sw(t,{opacity:0},e)}var cw,uw={fill:"#fff",lineWidth:1,radius:2,size:10,stroke:"#bfbfbf",strokeOpacity:1,zIndex:0},hw={fill:"#000",fillOpacity:.45,fontSize:12,textAlign:"center",textBaseline:"middle",zIndex:1},fw={orientation:"horizontal",showLabel:!0,type:"start"},dw=V2({foreground:"foreground",handle:"handle",selection:"selection",sparkline:"sparkline",sparklineGroup:"sparkline-group",track:"track"},"slider"),pw=V2({labelGroup:"label-group",label:"label",iconGroup:"icon-group",icon:"icon",iconRect:"icon-rect",iconLine:"icon-line"},"handle"),gw=(ce(mw,cw=El),mw.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=it(t,["size","radius","orientation"]),a=2.4*n,r=w(e).maybeAppendByClassName(pw.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(pw.iconLine,"-1"),"line").styles(y({x1:o,x2:o,y1:l,y2:c},t)),r.maybeAppendByClassName("".concat(pw.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)},mw);function mw(){return null!==cw&&cw.apply(this,arguments)||this}ce(bw,vw=El),bw.prototype.renderLabel=function(t){var e=this,n=this.attributes.showLabel,r=k(Cx(O(this.attributes,"label"),[]),2),i=r[0],r=r[1],t=w(t).maybeAppendByClassName(pw.labelGroup,"g").styles(r),r=y(y({},hw),i),a=r.text,o=it(r,["text"]);rx(!!n,t,function(t){e.label=t.maybeAppendByClassName(pw.label,"text").styles(y(y({},o),{text:"".concat(a)})),e.label.on("mousedown",function(t){t.stopPropagation()}),e.label.on("touchstart",function(t){t.stopPropagation()})})},bw.prototype.renderIcon=function(t){var e=this.attributes.orientation,n=y(y({orientation:e},uw),O(this.attributes,"icon")),e=this.attributes.iconShape,r=void 0===e?function(){return new gw({style:n})}:e;w(t).maybeAppendByClassName(pw.iconGroup,"g").selectAll(pw.icon.class).data([r]).join(function(t){return t.append(r).attr("className",pw.icon.name)},function(t){return t.update(n)},function(t){return t.remove()})},bw.prototype.render=function(t,e){this.renderIcon(e),this.renderLabel(e)};var vw,yw=bw;function bw(t){return vw.call(this,t,fw)||this}ce(Mw,xw=El),Object.defineProperty(Mw.prototype,"values",{get:function(){return this.attributes.values},set:function(t){this.attributes.values=this.clampValues(t)},enumerable:!1,configurable:!0}),Object.defineProperty(Mw.prototype,"sparklineStyle",{get:function(){var t;return"horizontal"!==this.attributes.orientation?null:(t=O(this.attributes,"sparkline"),y(y({zIndex:0},this.availableSpace),t))},enumerable:!1,configurable:!0}),Object.defineProperty(Mw.prototype,"shape",{get:function(){var t=this.attributes,e=t.trackLength,t=t.trackSize,t=k(this.getOrientVal([[e,t],[t,e]]),2);return{width:t[0],height:t[1]}},enumerable:!1,configurable:!0}),Object.defineProperty(Mw.prototype,"availableSpace",{get:function(){var t=k(Ax(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}),Mw.prototype.getValues=function(){return this.values},Mw.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;sw(this.selectionShape.node(),this.selectionStyle,t),this.updateHandlesPosition(t)},Mw.prototype.updateHandlesPosition=function(t){this.attributes.showHandle&&(sw(this.startHandle,this.getHandleStyle("start"),t),sw(this.endHandle,this.getHandleStyle("end"),t))},Mw.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)},Mw.prototype.renderTrack=function(t){var e=this.attributes.brushable,n=O(this.attributes,"track");this.trackShape=w(t).maybeAppendByClassName(dw.track,"rect").styles(y(y({cursor:e?"crosshair":"default"},this.shape),n))},Mw.prototype.renderSparkline=function(t){var n=this;rx("horizontal"===this.attributes.orientation,w(t).maybeAppendByClassName(dw.sparklineGroup,"g"),function(t){var e=n.sparklineStyle;t.maybeAppendByClassName(dw.sparkline,function(){return new ew({style:e})}).update(e)})},Object.defineProperty(Mw.prototype,"selectionStyle",{get:function(){var t=O(this.attributes,"selection");return y(y({},t),this.calcMask())},enumerable:!1,configurable:!0}),Mw.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(dw.handle.class).data(n,function(t){return t.type}).join(function(t){return t.append(function(t){t=t.type;return new yw({style:e.getHandleStyle(t)})}).each(function(t){var e=t.type,t=(this.attr("class","".concat(dw.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()})},Mw.prototype.renderSelection=function(t){this.foregroundGroup=w(t).maybeAppendByClassName(dw.foreground,"g"),this.selectionShape=this.foregroundGroup.maybeAppendByClassName(dw.selection,"rect").styles(this.selectionStyle),this.renderHandles()},Mw.prototype.render=function(t,e){this.renderTrack(e),this.renderSparkline(e),this.renderSelection(e)},Mw.prototype.clampValues=function(t,e){void 0===e&&(e=4);var n=k(this.range,2),r=n[0],n=n[1],i=k(this.getValues().map(function(t){return vx(t,e)}),2),a=i[0],i=i[1],t=k((t||[a,i]).map(function(t){return vx(t,e)}),2),o=t[0],t=t[1],s=(t<o&&(o=(s=k([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]},Mw.prototype.calcMask=function(t){var t=k(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}])},Mw.prototype.calcHandlePosition=function(t){var e=this.availableSpace,n=e.x,r=e.y,i=e.width,e=e.height,a=k(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])}},Mw.prototype.calcHandleText=function(t){var e,n,r,i,a,o,s,l,c=this.attributes,u=c.orientation,h=c.formatter,c=c.autoFitLabel,f=O(this.attributes,"handle"),d=O(f,"label"),f=f.spacing,p=this.getHandleSize(),g=this.clampValues(),h=h("start"===t?g[0]:g[1]),g=new D2({style:y(y({},d),{text:h})}),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=f+p)+m/2,g="start"===t?0<r-s-m?-l:l:m<e-r-a-s?l:-l):(l=f+p,c="start"===t?d<i-p?-l:l:d<n-i-o-p?l:-l),{x:g,y:c,text:h}):(e=f+p+("horizontal"===u?m/2:0),(r={text:h})["horizontal"===u?"x":"y"]="start"===t?-e:e,r)},Mw.prototype.getHandleLabelStyle=function(t){var e;return this.attributes.showLabel?(e=O(this.attributes,"handleLabel"),y(y({},e),this.calcHandleText(t))):{}},Mw.prototype.getHandleIconStyle=function(){var t=this.attributes.handleIconShape,e=O(this.attributes,"handleIcon"),n=this.getOrientVal(["ew-resize","ns-resize"]),r=this.getHandleSize();return y({cursor:n,shape:t,size:r},e)},Mw.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({},Lx(this.getHandleIconStyle(),"icon")),Lx(y(y({},this.getHandleLabelStyle(t)),i),"label")),r),{orientation:e,showLabel:n,type:t,zIndex:3})},Mw.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)},Mw.prototype.getOrientVal=function(t){var t=k(t,2),e=t[0],t=t[1];return"horizontal"===this.attributes.orientation?e:t},Mw.prototype.setValuesOffset=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=!1);var r=k(this.getValues(),2),t=[r[0]+t,r[1]+e].sort();n?this.setValues(t):this.innerSetValues(t,!0)},Mw.prototype.getRatio=function(t){var e=this.availableSpace,n=e.width,e=e.height;return t/this.getOrientVal([n,e])},Mw.prototype.dispatchCustomEvent=function(t,e,n){var r=this;t.on(e,function(t){t.stopPropagation(),r.dispatchEvent(new fs(n,{detail:t}))})},Mw.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"))},Mw.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))},Mw.tag="slider";var xw,ww=Mw;function Mw(t){var a=xw.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]},Lx(fw,"handle")),Lx(uw,"handleIcon")),Lx(hw,"handleLabel")))||this;return a.range=[0,1],a.onDragStart=function(i){return function(t){t.stopPropagation(),a.target=i,a.prevPos=a.getOrientVal(ex(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(ex(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 fs("valuechange",{detail:{oldValue:t,value:a.getValues()}});a.dispatchEvent(t)},a.selectionStartPos=0,a.selectionWidth=0,a.prevPos=0,a.target="",a}ce(Ow,kw=El),Object.defineProperty(Ow.prototype,"padding",{get:function(){return Ax(this.attributes.padding)},enumerable:!1,configurable:!0}),Object.defineProperty(Ow.prototype,"value",{get:function(){var t=this.attributes.value,e=k(this.range,2),n=e[0],e=e[1];return Ze(t,n,e)},enumerable:!1,configurable:!0}),Object.defineProperty(Ow.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(Ow.prototype,"availableSpace",{get:function(){var t=this.attributes.trackSize,e=this.trackLength,n=k(this.padding,4),r=n[0],i=n[1],a=n[2],n=n[3],t=k(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(Ow.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(Ow.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}),Ow.prototype.getValues=function(t){void 0===t&&(t=this.value);var e=this.attributes,e=e.viewportLength/e.contentLength,n=k(this.range,2),r=n[0],t=t*(n[1]-r-e);return[t,t+e]},Ow.prototype.getValue=function(){return this.value},Ow.prototype.renderSlider=function(t){var e=this.attributes,n=e.orientation,r=e.trackSize,i=e.padding,e=e.slidable,a=O(this.attributes,"track"),o=O(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()},Lx(a,"track")),Lx(o,"selection"));this.slider=w(t).maybeAppendByClassName("scrollbar",function(){return new ww({style:s})}).update(s).node()},Ow.prototype.render=function(t,e){this.renderSlider(e)},Ow.prototype.setValue=function(t,e){void 0===e&&(e=!1);var n=this.attributes.value,r=k(this.range,2),i=r[0],r=r[1];this.slider.setValues(this.getValues(Ze(t,i,r)),e),this.onValueChange(n)},Ow.prototype.bindEvents=function(){var e=this;this.slider.addEventListener("trackClick",function(t){t.stopPropagation(),e.onTrackClick(t.detail)}),this.onHover()},Ow.prototype.getOrientVal=function(t){return"horizontal"===this.attributes.orientation?t[0]:t[1]},Ow.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)},Ow.tag="scrollbar";var kw,Ew=Ow;function Ow(t){var a=kw.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 fs("scroll",t={detail:{oldValue:t,value:e}})),a.dispatchEvent(new fs("valuechange",t)))},a.onTrackClick=function(t){var e,n,r,i;a.attributes.slidable&&(r=(e=k(a.getLocalPosition(),2))[0],e=e[1],n=(i=k(a.padding,4))[0],i=i[3],r=a.getOrientVal([r+i,e+n]),i=(a.getOrientVal(ex(t))-r)/a.trackLength,a.setValue(i,!0))},a.onThumbMouseenter=function(t){a.dispatchEvent(new fs("thumbMouseenter",{detail:t.detail}))},a.onTrackMouseenter=function(t){a.dispatchEvent(new fs("trackMouseenter",{detail:t.detail}))},a.onThumbMouseleave=function(t){a.dispatchEvent(new fs("thumbMouseleave",{detail:t.detail}))},a.onTrackMouseleave=function(t){a.dispatchEvent(new fs("trackMouseleave",{detail:t.detail}))},a}var Sw={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 Zs({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:[]},Aw=(ot({},Sw,{style:{type:"arc"}}),ot({},Sw,{style:{}}),V2({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")),_w=V2({lineGroup:"line-group",line:"line",regionGroup:"region-group",region:"region"},"grid");function Tw(t){return t.reduce(function(t,e,n){return t.push(b([0===n?"M":"L"],k(e),!1)),t},[])}function Pw(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)?Tw(r):e?(i=gx(r[0],e),a=n?0:1,r.reduce(function(t,e,n){return 0===n?t.push(b(["M"],k(e),!1)):t.push(b(["A",i,i,0,0,a],k(e),!1)),t},[])):[]):Tw(t)}function Lw(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=k([Pw(t,n),Pw(e.slice().reverse(),n,!0)],2),l=n[0],c=n[1],n=k([t[0],e.slice(-1)[0]],2),t=n[0],e=n[1];if("line"===a||"surround"===i)return r([b(["L"],k(e),!1)],[b(["L"],k(t),!1)]);if(o)return a=(n=k([gx(e,o),gx(t,o)],2))[0],i=n[1],r([b(["A",a,a,0,0,1],k(e),!1),b(["L"],k(e),!1)],[b(["A",i,i,0,0,0],k(t),!1),b(["L"],k(t),!1)]);throw new Error("Arc grid need to specified center")}function Cw(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=k([e[l].points,e[l+1].points],2),c=Lw(c[0],c[1],n);s.push({path:c,fill:o[l%o.length]})}return t.selectAll(_w.region.class).data(s,function(t,e){return e}).join(function(t){return t.append("path").each(function(t,e){t=Y2(t,[t,e,s]);this.attr(t)}).attr("className",_w.region.name)},function(t){return t.transition(function(t,e){return sw(this,Y2(t,[t,e,s]),r.update)})},function(t){return t.transition(function(){var t=this,e=lw(this,r.exit);return iw(e,function(){return t.remove()}),e})}).transitions()}ce(Rw,Nw=El),Rw.prototype.render=function(t,e){t.type,t.center,t.areaFill,t.closed;var n,r,i,a,o=it(t,["type","center","areaFill","closed"]),s=(s=void 0===(s=t.data)?[]:s,t.closed?s.map(function(t){var e=t.points,n=k(e,1)[0];return y(y({},t),{points:b(b([],k(e),!1),[n],!1)})}):s),l=w(e).maybeAppendByClassName(_w.lineGroup,"g"),e=w(e).maybeAppendByClassName(_w.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:Pw(t.points,n)}}),l.selectAll(_w.line.class).data(a,function(t){return t.id}).join(function(t){return t.append("path").each(function(t,e){t=Y2(wx(y({path:t.path},r)),[t,e,a]);this.attr(y({class:_w.line.name,stroke:"#D9D9D9",lineWidth:1,lineDash:[4,4]},t))})},function(t){return t.transition(function(t,e){return sw(this,Y2(wx(y({path:t.path},r)),[t,e,a]),i.update)})},function(t){return t.transition(function(){var t=this,e=lw(this,i.exit);return iw(e,function(){return t.remove()}),e})}).transitions()),l=Cw(e,s,t);return b(b([],k(o),!1),k(l),!1)};var Nw,jw=Rw;function Rw(){return null!==Nw&&Nw.apply(this,arguments)||this}function Iw(t,e){return Object.fromEntries(Object.entries(t).map(function(t){t=k(t,2);return[t[0],Y2(t[1],e)]}))}function Bw(t,e){return e&&ze(e)?t.filter(e):t}var Dw=cn(function(t,e){var n=e.startAngle;return(e.endAngle-n)*t+n},function(t,e){return[t,e.startAngle,e.endAngle].join()}),Fw=cn(function(t,e){var n,r,i;return"linear"===e.type?(r=(n=k(e.startPos,2))[0],n=n[1],i=k(e.endPos,2),mx([(r=k([i[0]-r,i[1]-n],2))[0],r[1]])):(i=z2(Dw(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,b(b([],k(a),!1),k(r),!1)):(a=n.startAngle,r=n.endAngle,i=n.center,n=n.radius,b(b([a,r],k(i),!1),[n],!1));return"arc"===e.type&&a.push(t),a.join()});function zw(t,e,n){t=Fw(t,n);return n=t,"positive"!==e?[n[1],-n[0]]:[-n[1],n[0]]}function Ww(t,e){return zw(t,e.labelDirection,e)}var Gw=cn(function(t,e){var n=k(e.startPos,2),r=n[0],n=n[1],e=k(e.endPos,2),e=k([e[0]-r,e[1]-n],2);return[r+e[0]*t,n+e[1]*t]},function(t,e){return b(b([t],k(e.startPos),!1),k(e.endPos),!1).join()}),Hw=cn(function(t,e){var n=e.radius,r=k(e.center,2),i=r[0],r=r[1],t=z2(Dw(t,e));return[i+n*Math.cos(t),r+n*Math.sin(t)]},function(t,e){return b([t,e.startAngle,e.endAngle,e.radius],k(e.center),!1).join()});function Yw(t,e){return("linear"===e.type?Gw:Hw)(t,e)}function Vw(t){return 0===Fw(0,t)[1]}function qw(t){return 0===Fw(0,t)[0]}function $w(t,e){return e-t==360}function Uw(t,e,n,r,i){function a(t){return[n+i*Math.cos(t),r+i*Math.sin(t)]}var o=e-t,s=k([i,i],2),l=s[0],s=s[1],c=k([z2(t),z2(e)],2),u=c[0],c=c[1],h=k(a(u),2),f=h[0],h=h[1],d=k(a(c),2),p=d[0],d=d[1];return $w(t,e)?[["M",f,h],["A",l,s,0,1,0,(c=k(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(f,",").concat(h,",A").concat(l,",").concat(s,",0,").concat(u,",").concat(c,",").concat(p,",").concat(d))}function Xw(t,e,n,s){var l=e.startAngle,c=e.endAngle,u=e.center,h=e.radius;return t.selectAll(Aw.line.class).data([{path:Uw.apply(void 0,b(b([l,c],k(u),!1),[h],!1))}],function(t,e){return e}).join(function(t){return t.append("path").attr("className",Aw.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=b(b([o,e],k(n),!1),[i],!1),e=b(b([l,c],k(u),!1),[h],!1),(n=s.update)?(i=void 0===(i=n.duration)?0:i,r=ox(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=gn(a.attributes,"__keyframe_data__");a.style.path=Uw.apply(void 0,b([],k(t),!1))},o.onfinish=i),o}).styles(e)},function(t){return t.remove()}).styles(n).transitions()}function Kw(t){var t=k(t,2),e=k(t[0],2),n=e[0],e=e[1],t=k(t[1],2);return{x1:n,y1:e,x2:t[0],y2:t[1]}}function Zw(e,t,n,r){function i(t){return e.selectAll(Aw.line.class).data(t,function(t,e){return e}).join(function(t){return t.append("line").attr("className",function(t){return"".concat(Aw.line.name," ").concat(t.className)}).styles(n).transition(function(t){return sw(this,Kw(t.line),!1)})},function(t){return t.styles(n).transition(function(t){return sw(this,Kw(t.line),r.update)})},function(t){return t.remove()}).transitions()}var a,o,s,l=t.showTrunc,c=t.startPos,u=t.endPos,h=t.truncRange,f=t.lineExtension,d=k([c,u],2),p=k(d[0],2),g=p[0],p=p[1],d=k(d[1],2),m=d[0],d=d[1],u=k(f?(c=k([c=c,u=u,f=void 0===(f=f)?[0,0]:f],3),f=(u=k(c[0],2))[0],u=u[1],v=(a=k(c[1],2))[0],a=a[1],y=(c=k(c[2],2))[0],c=c[1],f=(v=k([v-f,a-u],2))[0],a=v[1],u=Math.sqrt(Math.pow(f,2)+Math.pow(a,2)),y=(v=k([-y/u,c/u],2))[0],c=v[1],[y*f,y*a,c*f,c*a]):new Array(4).fill(0),4),v=u[0],y=u[1],f=u[2],c=u[3];return l&&h?(u=(a=k(h,2))[0],l=a[1],o=(u=k([g+(h=m-g)*u,p+(s=d-p)*u],2))[0],u=u[1],s=(h=k([g+h*l,p+s*l],2))[0],l=h[1],h=i([{line:[[g+v,p+y],[o,u]],className:Aw.lineFirst.name},{line:[[s,l],[m+f,d+c]],className:Aw.lineSecond.name}]),t.truncRange,t.truncShape,t.lineExtension,h):i([{line:[[g+v,p+y],[m+f,d+c]],className:Aw.line.name}])}function Qw(t,e,n){var r,i,a,o,s,l=e.type,c=O(e,"line"),n=("linear"===l?Zw:Xw)(t,e,yx(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(Aw.lineSecond.class):t.select(Aw.line.class),!r||!a||"arc"===e.type&&$w(e.startAngle,e.endAngle)?(i=l.node())&&(i.style.markerEnd=void 0):((t=nx(a)).attr(c),Mx(t,s,!0),l.style("markerEnd",t).style("markerEndOffset",-o)),n}function Jw(t){var e=t.type,n=t.gridCenter;return"linear"===e?n:n||t.center}function tM(t,i){var a=i.gridLength;return t.map(function(t,e){var t=t.value,n=k(Yw(t,i),2),r=n[0],n=n[1],t=k(ux(zw(t,i.gridDirection,i),a),2);return{id:e,points:[[r,n],[r+t[0],n+t[1]]]}})}function eM(t,e,n,r){var i=O(n,"grid"),a=i.type,o=i.areaFill,s=Jw(n),l=Bw(e,n.gridFilter),e=("segment"===a?tM:function(t,o){var s,l,c=o.gridControlAngles,e=Jw(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=k(e,2),s=e[0],l=e[1],t.map(function(t,e){var t=k(Yw(t.value,o),2),n=t[0],t=t[1],n=k([n-s,t-l],2),r=n[0],i=n[1],a=[];return c.forEach(function(t){var t=z2(t),t=k([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:ze(o)?l.map(function(t,e){return Y2(o,[t,e,l])}):o,animate:r,data:e});return t.selectAll(Aw.grid.class).data([1]).join(function(t){return t.append(function(){return new jw({style:c})}).attr("className",Aw.grid.name)},function(t){return t.transition(function(){return this.update(c)})},function(t){return t.remove()}).transitions()}Object.defineProperty(rM.prototype,"left",{get:function(){return this.x1},enumerable:!1,configurable:!0}),Object.defineProperty(rM.prototype,"top",{get:function(){return this.y1},enumerable:!1,configurable:!0}),Object.defineProperty(rM.prototype,"right",{get:function(){return this.x2},enumerable:!1,configurable:!0}),Object.defineProperty(rM.prototype,"bottom",{get:function(){return this.y2},enumerable:!1,configurable:!0}),Object.defineProperty(rM.prototype,"width",{get:function(){return this.defined("x2")&&this.defined("x1")?this.x2-this.x1:void 0},enumerable:!1,configurable:!0}),Object.defineProperty(rM.prototype,"height",{get:function(){return this.defined("y2")&&this.defined("y1")?this.y2-this.y1:void 0},enumerable:!1,configurable:!0}),rM.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]]},rM.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},rM.prototype.defined=function(t){return this[t]!==Number.MAX_VALUE&&this[t]!==-Number.MAX_VALUE};var nM=rM;function rM(t,e,n,r){this.set(t,e,n,r)}function iM(t,e){var n=t.getEulerAngles()||0,r=(t.setEulerAngles(0),t.getLocalBounds()),i=k(r.min,2),a=i[0],i=i[1],r=k(r.max,2),o=r[0],r=r[1],s=aM(t),l=s.width,s=s.height,c=0,u=0,h=a,f=i,d=Q2(t),o=(d&&(s-=1.5,"center"===(p=d.style.textAlign)?h=(a+o)/2:"right"!==p&&"end"!==p||(h=o),"middle"===(p=d.style.textBaseline)?f=(i+r)/2:"bottom"===p&&(f=r)),k(Ax(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 nM((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(z2(n),h,f)}function aM(t){return t.__bbox__||t.getBBox()}function oM(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 sM(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 lM(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,h=0;do{var f=[t[h],t[(h+1)%n]];if(i=c,l=s=o=a=void 0,a=sM((r=f)[0],r[1],i[0]),o=sM(r[0],r[1],i[1]),s=sM(i[0],i[1],r[0]),l=sM(i[0],i[1],r[1]),a!==o&&s!==l||0===a&&oM(r,i[0])||0===o&&oM(r,i[1])||0===s&&oM(i,r[0])||!(0!==l||!oM(i,r[1]))){if(0===sM(f[0],e,f[1]))return oM(f,e);u++}}while(0!==(h=(h+1)%n));return!!(1&u)}function cM(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=iM(e,n);return r=o,a.every(function(t){return lM(r,t)})}function uM(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=k(e=c,4))[0],r=e[1],i=e[2],e=e[3],a=(t=k(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 hM(t,e,l){function n(t,e){if(t){var n,r,i=Ax(l),t=iM(t,i).flat(1),a=iM(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=he(e),s=o.next();!s.done;s=o.next())if(uM(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,h,f,d,p,g,m=e.crossPadding,v=new Set,y=null,b=(m=m,f=(e=e).type,d=e.labelDirection,!!(p=e.crossSize)&&("arc"===f?(f=e.center,h=e.radius,u=(f=k(f,2))[0],f=f[1],a=-h-(d="negative"===d?0:p),h=h+d,o=(d=k(Ax(m),4))[0],s=d[1],c=d[2],d=d[3],new nM(u+a-d,f+a-o,u+h+s,f+h+c)):(a=(d=k(e.startPos,2))[0],o=d[1],s=(u=k(e.endPos,2))[0],f=u[1],c=(h=k(qw(e)?[-m,0,m,0]:[0,m,0,-m],4))[0],d=h[1],u=h[2],m=h[3],h=ux(Ww(0,e),p),(e=new nM(a,o,s,f)).x1+=m,e.y1+=c,e.x2+=d+h[0],e.y2+=u+h[1],e)));try{for(var x=he(t),w=x.next();!w.done;w=x.next()){var M=w.value;g=M,b&&!cM(b,g)?v.add(M):!y||n(y,M)?y=M:(v.add(y),v.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(v)}function fM(t,e){return void 0===e&&(e={}),A(t)?0:"number"==typeof t?t:Math.floor(K2(t,e))}var dM=function(t,e){var e=e.seq,n=void 0===e?2:e;return t.filter(function(t,e){return!(e%n&&(L2(t),1))})};var pM=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,h=dM,f=function(t){return t.forEach(r.show),t},d=2,p=t.slice(),g=t.slice(),m=Math.min.apply(Math,b([1],k(t.map(function(t){return aM(t).width})),!1));for("linear"===n.type&&(Vw(n)||qw(n))&&(s=_x(t[0]).left,l=_x(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()),f(p);d<t.length&&hM((u?b(b([u],k(g),!1),[c],!1):b([c],k(g),!1)).filter(X2),n,null==e?void 0:e.margin).length;)(u&&!c&&d%2==0||u&&c)&&p.splice(0,1).forEach(r.hide),g=h(f(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=he(s),h=u.next();!h.done;h=u.next())if(i(h.value),hM(t,n,l).length<1)return}catch(t){a={error:t}}finally{try{h&&!h.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=Z2(r.getTextShape(t[0])),c=fM(s,e),u=a?fM(a,e):c,s=fM(o,e),h=(!A(s)&&s!==1/0||(s=Math.max.apply(null,t.map(function(t){return aM(t).width}))),t.slice()),f=((a=k(l,4))[0],a[1],a[2],a[3],s);u+c<f;f-=c){var d=function(e){if(h.forEach(function(t){r.ellipsis(r.getTextShape(t),e,i)}),(h=hM(t,n,l)).length<1)return{value:void 0}}(f);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,h=void 0===(e=e.margin)?[0,0,0,0]:e,e=t.map(function(t){return t.attr("maxLines")||1}),f=Math.min.apply(Math,b([],k(e),!1)),d=(o=(a=n).type,s=a.labelDirection,"linear"===o&&Vw(a)?"negative"===s?"bottom":"top":"middle");if(!(c<f)){for(var p=f;p<=c;p++)if(i(p),hM(t,n,h).length<1)return;u&&i(e)}}]]);function gM(r,i,a){var t=i.labelOverlap,t=void 0===t?[]:t;t.length&&t.forEach(function(t){var e=t.type,n=pM.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 mM(t){for(var e=t;e<0;)e+=360;return Math.round(e%360)}var vM=cn(function(t,e){var t=k(t,2),n=t[0],t=t[1],e=k(e,2),r=e[0],e=e[1],n=k([n*r+t*e,n*e-t*r],2),e=n[0],t=n[1];return Math.atan2(t,e)},function(t,e){return b(b([],k(t),!1),k(e),!1).join()});function yM(t,e,n){var r,i=n.labelAlign;return(null==(r=e.style.transform)?void 0:r.includes("rotate"))?e.getLocalEulerAngles():(r=0,e=Ww(t.value,n),t=Fw(t.value,n),"horizontal"===i?0:(r="perpendicular"===i?vM([1,0],e):vM([t[0]<0?-1:1,0],t),ix(n=((n=W2(r))+360)%180,-90,90)||(n+=180),n))}function bM(t,e,n){var r=n.type,i=n.labelAlign,t=Ww(t,n),n=mM(e),e=mM(W2(vM([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?(ix(n,0,90,!1,!0)||ix(n,0,90)||ix(n,270,360))&&(a="start"):90===e?ix(n,0,90,!1,!0)?a="start":(ix(n,90,180)||ix(n,270,360))&&(a="end"):270===e?ix(n,0,90,!1,!0)?a="end":(ix(n,90,180)||ix(n,270,360))&&(a="start"):180===e&&(90===n?a="start":(ix(n,0,90)||ix(n,270,360))&&(a="end")):a="center":"parallel"===i?o=ix(e,0,180,!0)?"top":"bottom":"horizontal"===i?ix(e,90,270,!1)?a="end":(ix(e,270,360,!1)||ix(e,0,90))&&(a="start"):"perpendicular"===i&&(a=ix(e,90,270)?"end":"start"),{textAlign:a,textBaseline:o}}function xM(t,e,n){var r=n.showTick,i=n.tickLength,a=n.tickDirection,o=n.labelDirection,s=n.labelSpacing,l=e.indexOf(t),s=Y2(s,[t,l,e]),o=k([Ww(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=k(hx(ux(o[0],s+(1===o[1]?Y2(r?i:0,[t,l,e]):0)),Yw(t.value,n)),2);return{x:a[0],y:a[1]}}function wM(t,e){"text"===t.nodeName&&t.attr(e)}function MM(r){gM(this.node().childNodes,r,{hide:L2,show:P2,rotate:function(t,e){var n;e=+e,n=r,(t=t).setLocalEulerAngles(e),e=bM(t.__data__.value,e,n),(n=t.querySelector(Aw.labelItem.class))&&wM(n,e)},ellipsis:function(t,e,n){void 0===e&&(e=1/0),t&&tx(t,e,n)},wrap:function(t,e,n){var r;t&&J2(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 kM(t,e,n,r,i){var a,o,s,l,c,u=n.indexOf(e),h=w(t).append((a=e,o=u,s=n,c=(l=i).labelFormatter,ze(c)?function(){return nx(Y2(c,[a,o,s,Ww(a.value,l)]))}:function(){return nx(a.label||"")})).attr("className",Aw.labelItem.name).node(),r=k(Cx(Iw(r,[e,u,n])),2),u=r[0],n=r[1],r=n.transform,n=it(n,["transform"]),f=(Nx(t,r),yM(e,t,i));return t.setLocalEulerAngles(+f),wM(h,y(y({},bM(e.value,f,i)),u)),Nx(t,r),t.attr(n),h}function EM(n,f,d,p){var t=Bw(f,d.labelFilter),g=O(d,"label");return n.selectAll(Aw.label.class).data(t,function(t,e){return e}).join(function(t){return t.append("g").attr("className",Aw.label.name).transition(function(t){return kM(this,t,f,g,d),this.attr(xM(t,f,d)),this.__bbox__=t.bbox,null}).call(function(){return MM.call(n,d)})},function(t){return t.transition(function(t){var e,n,r,i,a,o,s,l=this.querySelector(Aw.labelItem.class),c=kM(this,t,f,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=k((s=function(t){var e,n;return"circle"===t.nodeName?(n=(e=k(t.getLocalPosition(),2))[0],e=e[1],[n-(n=t.attr("r")),e-n]):t.getLocalPosition()})(e),2))[0],u=u[1],s=k(s(n),2),s=(o=k([(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})),iw(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})),h),[o,s]):(h(),[null]));function h(){"destroy"===r?e.destroy():"hide"===r&&L2(e),n.isVisible()&&P2(n)}l=sw(this,xM(t,f,d),p.update);return this.__bbox__=t.bbox,b(b([],k(u),!1),[l],!1)}).call(function(t){var e,t=gn(t,"_transitions").flat().filter(X2);e=function(){return MM.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=lw(this,p.exit);return iw(e,function(){return w(t).remove()}),e})}).transitions()}function OM(t,e){return zw(t,e.tickDirection,e)}var SM=cn(function(t,e){t=k(t,2);return[[0,0],[t[0]*e,t[1]*e]]},function(t,e){return b(b([],k(t),!1),[e],!1).join()});function AM(t,e,n,r,i,a,o){var s=OM(t.value,a),a=(c=t,u=e,h=n,l=s,a=(a=a).tickLength,l=k(SM(l,Y2(a,[c,u,h])),2),a=k(l[0],2),c=a[0],u=a[1],h=k(l[1],2),{x1:c,x2:h[0],y1:u,y2:h[1]}),l=a.x1,c=a.x2,u=a.y1,h=a.y2,a=k(Cx(Iw(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:h},o)),i.attr(t),r.styles(o)}function _M(t,e,n,r,i,a){o=w(this),s=t,l=e,c=n,h=(u=r).tickFormatter,f=OM(s.value,u),u="line",ze(h)&&(u=function(){return Y2(h,[s,l,c,f])});AM(t,e,n,o.append(u).attr("className",Aw.tickItem.name),this,r,i);var o,s,l,c,u,h,f,e=k(Yw(t.value,r),2);return sw(this,{x:e[0],y:e[1]},a)}var TM=V2({text:"text"},"title");function PM(t){return/\S+-\S+/g.test(t)?t.split("-").map(function(t){return t[0]}):2<t.length?[t[0]]:t.split("")}function LM(r,t){t=Object.entries(t).reduce(function(t,e){var e=k(e,2),n=e[0],e=e[1];return r.node().attr(n)||(t[n]=e),t},{});r.styles(t)}ce(jM,CM=El),jM.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(TM.text.class);if(!a)return new G2(0,0,+r,+i);var a=a.getBBox(),o=a.width,s=a.height,a=k(Ax(n),4),l=a[0],c=a[1],u=a[2],h=a[3],n=k([0,0,+r,+i],4),f=n[0],d=n[1],p=n[2],g=n[3],a=PM(e);if(a.includes("i"))return new G2(f,d,p,g);a.forEach(function(t,e){var n;"t"===t&&(n=k(0===e?[s+u,+i-s-u]:[0,+i],2),d=n[0],g=n[1]),"r"===t&&(n=k([+r-o-h],1),p=n[0]),"b"===t&&(n=k([+i-s-l],1),g=n[0]),"l"===t&&(n=k(0===e?[o+c,+r-o-c]:[0,+r],2),f=n[0],p=n[1])});n=k(Ax(t),4),e=n[0],a=n[1],t=n[2],n=n[3],a=k([n+a,e+t],2),t=a[0],a=a[1];return new G2(f+n,d+e,p-t,g-a)},jM.prototype.getBBox=function(){return this.title?this.title.getBBox():new G2(0,0,0,0)},jM.prototype.render=function(t,e){var n,r,i,a,o,s,l=this,c=(t.width,t.height,t.position,t.spacing,it(t,["width","height","position","spacing"])),u=k(Cx(c),1)[0],h=(h=(t=t).width,r=t.height,t=t.position,i=k([+h/2,+r/2],2),a=(i=k([+i[0],+i[1],"center","middle"],4))[0],o=i[1],s=i[2],i=i[3],(t=PM(t)).includes("l")&&(a=(n=k([0,"start"],2))[0],s=n[1]),t.includes("r")&&(a=(n=k([+h,"end"],2))[0],s=n[1]),t.includes("t")&&(o=(h=k([0,"top"],2))[0],i=h[1]),t.includes("b")&&(o=(n=k([+r,"bottom"],2))[0],i=n[1]),{x:a,y:o,textAlign:s,textBaseline:i}),f=h.x,d=h.y,p=h.textAlign,g=h.textBaseline;rx(!!c.text,w(e),function(t){l.title=t.maybeAppendByClassName(TM.text,"text").styles(u).call(LM,{x:f,y:d,textAlign:p,textBaseline:g}).node()})};var CM,NM=jM;function jM(t){return CM.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 RM(t,e,n,r,i){var a,o,s,l,c,u,h,f,d=k(Cx(O(r,"title")),2),p=d[0],d=d[1],g=d.transform,g=void 0===g?"":g,d=it(d,["transform"]),m=(t.styles(p),e.styles(d),Nx(t.node(),g),p=w(n._offscreen||n.querySelector(Aw.mainGroup.class)),d=e,r=void 0===(r=(n=r).titlePosition)?"lb":r,a=n.titleSpacing,o=PM(r),p=p.node().getLocalBounds(),s=(l=k(p.min,2))[0],l=l[1],c=(p=k(p.halfExtents,2))[0],p=p[1],u=(d=k(d.node().getLocalBounds().halfExtents,2))[0],d=d[1],l=(s=k([s+c,l+p],2))[0],s=s[1],v=(a=k(Ax(a),4))[0],h=a[1],f=a[2],a=a[3],["start","end"].includes(r)&&"linear"===n.type?(m=n.startPos,n=n.endPos,n=(r=k("start"===r?[m,n]:[n,m],2))[0],m=(r=k(ux(mx([-(m=r[1])[0]+n[0],-m[1]+n[1]]),v),2))[0],r=r[1],{x:n[0]+m,y:n[1]+r}):(o.includes("t")&&(s-=p+d+v),o.includes("r")&&(l+=c+u+h),o.includes("l")&&(l-=c+u+a),o.includes("b")&&(s+=p+d+f),{x:l,y:s})),n=m.x,r=m.y,v=sw(e.node(),{x:n,y:r},i);return Nx(t.node(),g),v}function IM(e,t,o,s){var n=e.showLine,r=e.showTick,i=e.showLabel,n=rx(n,t.maybeAppendByClassName(Aw.lineGroup,"g"),function(t){return Qw(t,e,s)})||[],r=rx(r,t.maybeAppendByClassName(Aw.tickGroup,"g"),function(t){return t=t,r=s,i=Bw(o,(n=e).tickFilter),a=O(n,"tick"),t.selectAll(Aw.tick.class).data(i,function(t){return t.id||t.label}).join(function(t){return t.append("g").attr("className",Aw.tick.name).transition(function(t,e){return _M.call(this,t,e,i,n,a,!1)})},function(t){return t.transition(function(t,e){return this.removeChildren(),_M.call(this,t,e,i,n,a,r.update)})},function(t){return t.transition(function(){var t=this,e=lw(this,r.exit);return iw(e,function(){return t.remove()}),e})}).transitions();var n,r,i,a})||[],i=rx(i,t.maybeAppendByClassName(Aw.labelGroup,"g"),function(t){return EM(t,o,e,s)})||[];return b(b(b([],k(n),!1),k(r),!1),k(i),!1).filter(function(t){return!!t})}ce(FM,BM=El),FM.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,h=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])}),f=rw(void 0===e?i:e),r=rx(l,w(t).maybeAppendByClassName(Aw.gridGroup,"g"),function(t){return eM(t,h,o,f)})||[],c=w(t).maybeAppendByClassName(Aw.mainGroup,"g"),i=(n&&(!this.initialized&&f.enter||this.initialized&&f.update)&&IM(o,w(this.offscreenGroup),h,rw(!1)),IM(o,w(c.node()),h,f)),e=rx(a,w(t).maybeAppendByClassName(Aw.titleGroup,"g"),function(t){return e=t,n=s,i=f,a=(r=o).titleText,e.selectAll(Aw.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 nx(a)}).attr("className",Aw.title.name).transition(function(){return RM(w(this),e,n,r,i.enter)})},function(t){return t.transition(function(){return RM(w(this),e,n,r,i.update)})},function(t){return t.remove()}).transitions();var e,n,r,i,a})||[];return b(b(b([],k(r),!1),k(i),!1),k(e),!1).flat().filter(function(t){return!!t})};var BM,DM=FM;function FM(t){return BM.call(this,t,Sw)||this}var zM,WM=V2({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"),GM=(ce(HM,zM=El),Object.defineProperty(HM.prototype,"defaultPage",{get:function(){var t=this.attributes.defaultPage;return Ze(t,0,Math.max(this.pageViews.length-1,0))},enumerable:!1,configurable:!0}),Object.defineProperty(HM.prototype,"pageViews",{get:function(){return this.playWindow.children},enumerable:!1,configurable:!0}),Object.defineProperty(HM.prototype,"controllerShape",{get:function(){return 1<this.totalPages?{width:55,height:0}:{width:0,height:0}},enumerable:!1,configurable:!0}),Object.defineProperty(HM.prototype,"pageShape",{get:function(){var n,t=this.pageViews,t=k((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,b([],k(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}),HM.prototype.getContainer=function(){return this.playWindow},Object.defineProperty(HM.prototype,"totalPages",{get:function(){return this.pageViews.length},enumerable:!1,configurable:!0}),Object.defineProperty(HM.prototype,"currPage",{get:function(){return this.innerCurrPage},enumerable:!1,configurable:!0}),HM.prototype.getBBox=function(){var t=zM.prototype.getBBox.call(this),e=t.x,t=t.y,n=this.controllerShape,r=this.pageShape,i=r.pageWidth,r=r.pageHeight;return new G2(e,t,i+n.width,r)},HM.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=k(this.getFollowingPageDiff(t),2),o=i[0],r=i[1],this.playState="running",i=ow(a,[{transform:"translate(0, 0)"},{transform:"translate(".concat(-o,", ").concat(-r,")")}],n);return iw(i,function(){e.innerCurrPage=t,e.playState="idle",e.setVisiblePages([t]),e.updatePageInfo()}),i},HM.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:Ze(n-1,0,e),this.goTo(t))},HM.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:Ze(n+1,0,e),this.goTo(t))},HM.prototype.renderClipPath=function(t){var e=this.pageShape,n=e.pageWidth,e=e.pageHeight;n&&e?(this.clipPath=t.maybeAppendByClassName(WM.clipPath,"rect").styles({width:n,height:e}),this.contentGroup.attr("clipPath",this.clipPath.node())):this.contentGroup.style.clipPath=void 0},HM.prototype.setVisiblePages=function(n){this.playWindow.children.forEach(function(t,e){(n.includes(e)?P2:L2)(t)})},HM.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,k("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=k(i.offset,3),o=k(a[0],2),s=o[0],c=o[1],l=k(a[1],2),r=l[0],o=l[1],l=k(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)},HM.prototype.updatePageInfo=function(){var t,e=this.currPage,n=this.pageViews,r=this.attributes.formatter;n.length<2||(null!=(t=this.pageInfoGroup.querySelector(WM.pageInfo.class))&&t.attr("text",r(e+1,n.length)),this.adjustControllerLayout())},HM.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])},HM.prototype.prepareFollowingPage=function(t){var e,n=this.currPage,r=this.pageViews;this.setVisiblePages([t,n]),t!==n&&(e=(n=k(this.getFollowingPageDiff(t),2))[0],n=n[1],r[t].setLocalPosition(e,n))},HM.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(WM.controller,"g");C2(t.node(),u),u&&(u=O(this.attributes,"button"),e=O(this.attributes,"pageNum"),i=(u=k(Cx(u),2))[0],u=u[1],n=i.size,r=it(i,["size"]),i=!t.select(WM.prevBtnGroup.class).node(),a=t.maybeAppendByClassName(WM.prevBtnGroup,"g").styles(u),this.prevBtnGroup=a.node(),a=a.maybeAppendByClassName(WM.prevBtn,"path"),u=t.maybeAppendByClassName(WM.nextBtnGroup,"g").styles(u),this.nextBtnGroup=u.node(),[a,u.maybeAppendByClassName(WM.nextBtn,"path")].forEach(function(t){t.styles(y(y({},r),{transformOrigin:"center"})),Mx(t.node(),n,!0)}),a=t.maybeAppendByClassName(WM.pageInfoGroup,"g"),this.pageInfoGroup=a.node(),a.maybeAppendByClassName(WM.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()}))},HM.prototype.render=function(t,e){e=w(e);this.renderClipPath(e),this.renderController(e),this.setVisiblePages([this.defaultPage]),this.goTo(this.defaultPage)},HM.prototype.bindEvents=function(){var t=this,e=ln(function(){return t.render(t.attributes,t)},50);this.playWindow.addEventListener(x.INSERTED,e),this.playWindow.addEventListener(x.REMOVED,e)},HM);function HM(t){var e,n,t=zM.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 Gs({class:WM.contentGroup.name})),t.playWindow=t.contentGroup.appendChild(new Gs({class:WM.playWindow.name})),t.innerCurrPage=t.defaultPage,t}function YM(t,e,n){return"horizontal"===(t=void 0===t?"horizontal":t)?e:n}Wx.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"]]}),Wx.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]]}),Wx.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 VM=V2({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(UM,qM=El),Object.defineProperty(UM.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(UM.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(UM.prototype,"span",{get:function(){var t,e=this.attributes.span;return e?(t=(e=k(Ax(e),2))[0],e=e[1],[t/(e=t+(t=this.showValue?e:0)),t/e]):[1,1]},enumerable:!1,configurable:!0}),Object.defineProperty(UM.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=k(this.spacing,2),s=o[0],o=o[1];return t&&(t=t-e-s-o,e=k(this.span,2),a=(e=k([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(UM.prototype,"spacing",{get:function(){var t,e=this.attributes.spacing;return e?(t=(e=k(Ax(e),2))[0],e=e[1],this.showValue?[t,e]:[t,0]):[0,0]},enumerable:!1,configurable:!0}),Object.defineProperty(UM.prototype,"layout",{get:function(){var t=this.shape,e=t.markerWidth,n=t.labelWidth,r=t.valueWidth,i=t.width,t=t.height,a=k(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(UM.prototype,"scaleSize",{get:function(){var t=(t=(t=this.markerGroup.node()).querySelector(VM.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}),UM.prototype.renderMarker=function(t){var e=this,n=this.attributes.marker,r=O(this.attributes,"marker");this.markerGroup=t.maybeAppendByClassName(VM.markerGroup,"g").style("zIndex",0),rx(!!n,this.markerGroup,function(){e.markerGroup.maybeAppendByClassName(VM.marker,n).styles(r),e.markerGroup.node().scale(1/e.markerGroup.node().getScale()[0]),Mx(e.markerGroup.node(),e.scaleSize,!0)})},UM.prototype.renderLabel=function(t){var e=O(this.attributes,"label"),n=e.text,e=it(e,["text"]);this.labelGroup=t.maybeAppendByClassName(VM.labelGroup,"g").style("zIndex",0),this.labelGroup.maybeAppendByClassName(VM.label,function(){return nx(n)}).styles(e)},UM.prototype.renderValue=function(t){var e=this,n=O(this.attributes,"value"),r=n.text,i=it(n,["text"]);this.valueGroup=t.maybeAppendByClassName(VM.valueGroup,"g").style("zIndex",0),rx(this.showValue,this.valueGroup,function(){e.valueGroup.maybeAppendByClassName(VM.value,function(){return nx(r)}).styles(i)})},UM.prototype.renderBackground=function(t){var e=this.shape,n=e.width,e=e.height,r=O(this.attributes,"background");this.background=t.maybeAppendByClassName(VM.backgroundGroup,"g").style("zIndex",-1),this.background.maybeAppendByClassName(VM.background,"rect").styles(y({width:n,height:e},r))},UM.prototype.adjustLayout=function(){var t=this.layout,e=t.labelWidth,n=t.valueWidth,r=t.height,t=k(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}),tx(this.labelGroup.select(VM.label.class).node(),Math.ceil(e)),this.showValue&&(this.valueGroup.styles({x:t,y:r}),tx(this.valueGroup.select(VM.value.class).node(),Math.ceil(n)))},UM.prototype.render=function(t,e){e=w(e);this.renderMarker(e),this.renderLabel(e),this.renderValue(e),this.renderBackground(e),this.adjustLayout()};var qM,$M=UM;function UM(t){return qM.call(this,t,{span:[1,1],marker:function(){return new Is({style:{r:6}})},markerSize:10,labelFill:"#646464",valueFill:"#646464",labelFontSize:12,valueFontSize:12,labelTextBaseline:"middle",valueTextBaseline:"middle"})||this}function XM(t,e,n){return void 0===n&&(n=!0),t?e(t):n}var KM,ZM=V2({page:"item-page",navigator:"navigator",item:"item"},"items"),QM=(ce(JM,KM=El),Object.defineProperty(JM.prototype,"pageViews",{get:function(){return this.navigator.getContainer()},enumerable:!1,configurable:!0}),Object.defineProperty(JM.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(JM.prototype,"renderData",{get:function(){var t=this.attributes,a=t.data,o=t.layout,s=O(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=k(t,2);return[t[0],Y2(t[1],[e,n,a])]})))}})},enumerable:!1,configurable:!0}),JM.prototype.getGridLayout=function(){var u=this,t=this.attributes,h=t.orientation,f=t.width,d=t.rowPadding,p=t.colPadding,g=k(this.navigatorShape,1)[0],t=k(this.grid,2),m=t[0],v=t[1],y=v*m,b=0;return this.pageViews.children.map(function(t,e){var n,r=Math.floor(e/y),i=e%y,a=u.ifHorizontal(v,m),a=[Math.floor(i/a),i%a],a=("vertical"===h&&a.reverse(),k(a,2)),o=a[0],a=a[1],s=(f-g-(v-1)*p)/v,t=t.getBBox().height,l=k([0,0],2),c=l[0],l=l[1];return b="horizontal"===h?(c=(n=k([b,o*(t+d)],2))[0],l=n[1],a===v-1?0:b+s+p):(c=(n=k([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}})},JM.prototype.getFlexLayout=function(){var t=this.attributes,e=t.width,n=t.height,a=t.rowPadding,o=t.colPadding,t=k(this.navigatorShape,1)[0],r=k(this.grid,2),s=r[0],l=r[1],r=k([e-t,n],2),c=r[0],u=r[1],e=k([0,0,0,0,0,0,0,0],8),h=e[0],f=e[1],d=e[2],p=e[3],g=e[4],m=e[5],v=e[6],y=e[7];return this.pageViews.children.map(function(t,e){var t=t.getBBox(),n=t.width,t=t.height,r=0===v?0:o,i=v+r+n;return i<=c&&XM(g,function(t){return t<l})?(r=k([v+r,y,i],3),h=r[0],f=r[1],v=r[2]):(i=k([m+1,0,0,y+t+a],4),m=i[0],g=i[1],v=i[2],(y=i[3])+a+t<=u&&XM(m,function(t){return t<s})?(r=k([v,y,n],3),h=r[0],f=r[1],v=r[2]):(i=k([0,0,n,0,d+1,0,0,0],8),h=i[0],f=i[1],v=i[2],y=i[3],d=i[4],p=i[5],m=i[6],g=i[7])),{width:n,height:t,x:h,y:f,page:d,index:e,pageIndex:p++,row:m,col:g++}})},Object.defineProperty(JM.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}),JM.prototype.ifHorizontal=function(t,e){return YM(this.attributes.orientation,t,e)},JM.prototype.flattenPage=function(e){e.querySelectorAll(ZM.item.class).forEach(function(t){e.appendChild(t)}),e.querySelectorAll(ZM.page.class).forEach(function(t){e.removeChild(t).destroy()})},JM.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(ZM.item.class).data(this.renderData,function(t){return t.id}).join(function(t){return t.append(function(t){t=t.style;return new $M({style:t})}).attr("className",ZM.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()})},JM.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=k(this.navigatorShape,2),i=r[0],r=r[1];this.navigator.update("grid"===e?{pageWidth:t-i,pageHeight:n-r}:{})},JM.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=k(t,2);return{page:t[0],layouts:t[1]}}),u=b([],k(this.navigator.getContainer().children),!1);t.forEach(function(t){var t=t.layouts,c=e.pageViews.appendChild(new Gs({className:ZM.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=Ke(t="__layout__")?t.split("."):t).forEach(function(t,e){e<i.length-1?(Ye(r[t])||(r[t]=Qe(i[e+1])?[]:{}),r=r[t]):r[t]=n}),o.update({x:e,y:a,width:s,height:l})})}),this.relayoutNavigator()},JM.prototype.renderNavigator=function(t){var e=this.attributes.orientation,n=O(this.attributes,"nav"),r=q2({orientation:e},n),i=this;return t.selectAll(ZM.navigator.class).data(["nav"]).join(function(t){return t.append(function(){return new GM({style:r})}).attr("className",ZM.navigator.name).each(function(){i.navigator=this})},function(t){return t.each(function(){this.update(r)})},function(t){return t.remove()}),this.navigator},JM.prototype.getBBox=function(){return this.navigator.getBBox()},JM.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())},JM.prototype.dispatchCustomEvent=function(t,e){t=new fs(t,{detail:e});this.dispatchEvent(t)},JM);function JM(t){t=KM.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:dn,mouseenter:dn,mouseleave:dn})||this;return t.navigatorShape=[0,0],t}var tk,ek=V2({markerGroup:"marker-group",marker:"marker",labelGroup:"label-group",label:"label"},"handle"),nk={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},rk=(ce(ik,tk=El),ik.prototype.render=function(t,e){var n=w(e).maybeAppendByClassName(ek.markerGroup,"g"),n=(this.renderMarker(n),w(e).maybeAppendByClassName(ek.labelGroup,"g"));this.renderLabel(n)},ik.prototype.renderMarker=function(t){var r=this,e=this.attributes,n=e.orientation,e=e.markerSymbol,i=void 0===e?YM(n,"horizontalHandle","verticalHandle"):e;rx(!!i,t,function(t){var e=O(r.attributes,"marker"),n=y({symbol:i},e);r.marker=t.maybeAppendByClassName(ek.marker,function(){return new Wx({style:n})}).update(n)})},ik.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;rx(n,t,function(t){var e=O(s.attributes,"label"),n=e.text,e=it(e,["text"]),r=(null==(r=t.select(ek.marker.class))?void 0:r.node().getBBox())||{},i=r.width,r=r.height,r=k(YM(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(ek.label,"text").styles(y(y({},e),{x:i,y:a,text:u(n).toString(),textAlign:o,textBaseline:r}))})},ik);function ik(t){return tk.call(this,t,nk)||this}var ak,bl={showTitle:!0,padding:0,orientation:"horizontal",backgroundFill:"transparent",titleText:"",titleSpacing:4,titlePosition:"top-left",titleFill:"#2C3542",titleFontWeight:"bold",titleFontFamily:"sans-serif",titleFontSize:12},ok=q2({},bl,{}),sk=q2({},bl,Lx(nk,"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"}),lk=V2({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"),ck=(ce(uk,ak=El),uk.prototype.renderTitle=function(t,e,n){var r=this.attributes,i=r.showTitle,r=r.titleText,a=k(Cx(O(this.attributes,"title")),2),o=a[0],a=a[1],s=(this.titleGroup=t.maybeAppendByClassName(lk.titleGroup,"g").styles(a),y(y({width:e,height:n},o),{text:i?r:""}));this.title=this.titleGroup.maybeAppendByClassName(lk.title,function(){return new NM({style:s})}).update(s)},uk.prototype.renderItems=function(t,e){var n=e.x,r=e.y,i=e.width,e=e.height,a=k(Cx(O(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(lk.itemsGroup,"g").styles(y({x:n,y:r},a)),this);this.itemsGroup.selectAll(lk.items.class).data(["items"]).join(function(t){return t.append(function(){return new QM({style:s})}).attr("className",lk.items.name).each(function(){l.items=w(this)})},function(t){return t.update(s)},function(t){return t.remove()})},uk.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(uk.prototype,"availableSpace",{get:function(){var t=this.attributes,e=t.showTitle,n=t.width,t=t.height;return e?this.title.node().getAvailableSpace():new G2(0,0,n,t)},enumerable:!1,configurable:!0}),uk.prototype.getBBox=function(){var t,e,n,r,i,a,o,s,l,c,u=null==(u=this.title)?void 0:u.node(),h=null==(h=this.items)?void 0:h.node();return u&&h?(h=h,t=(r=(u=u).attributes).position,e=r.spacing,n=r.inset,r=r.text,u=u.getBBox(),i=h.getBBox(),t=PM(t),e=(r=k(Ax(r?e:0),4))[0],a=r[1],o=r[2],r=r[3],s=(n=k(Ax(n),4))[0],l=n[1],c=n[2],n=n[3],a=(r=k([r+a,e+o],2))[0],e=r[1],r=(o=k([n+l,s+c],2))[0],n=o[1],"l"===t[0]?new G2(u.x,u.y,i.width+u.width+a+r,Math.max(i.height+n,u.height)):"t"===t[0]?new G2(u.x,u.y,Math.max(i.width+r,u.width),i.height+u.height+e+n):(s=(l=k([h.attributes.width||i.width,h.attributes.height||i.height],2))[0],c=l[1],new G2(i.x,i.y,s+u.width+a+r,c+u.height+e+n))):ak.prototype.getBBox.call(this)},uk.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()},uk);function uk(t){return ak.call(this,t,ok)||this}var hk,fk={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},dk=V2({background:"background",labelGroup:"label-group",label:"label"},"indicator"),pk=(ce(gk,hk=El),gk.prototype.renderBackground=function(){var t,e,n,r,i,a,o;this.label&&(t=(i=this.attributes).position,o=(i=k(Ax(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=O(this.attributes,"background"),this.background=w(this.group).maybeAppendByClassName(dk.background,"path").styles(y(y({},o),{path:a})),this.group.appendChild(this.label.node()))},gk.prototype.renderLabel=function(){var t=this.attributes,e=t.formatter,n=t.labelText,t=k(Cx(O(this.attributes,"label")),2),r=t[0],t=t[1],r=(r.text,it(r,["text"]));this.label=w(this.group).maybeAppendByClassName(dk.labelGroup,"g").styles(t),n&&this.label.maybeAppendByClassName(dk.label,function(){return nx(e(n))}).style("text",e(n).toString()).selectAll("text").styles(r)},gk.prototype.adjustLayout=function(){var t=k(this.point,2),e=t[0],t=t[1];this.group.attr("x",-e).attr("y",-t)},gk.prototype.getPath=function(n,t){var r=this,t=k(t,2),e=k(t[0],2),i=e[0],e=e[1],t=k(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=k(t,2),e=t[0],t=t[1];return e===o[n]?r.createCorner(t):[b(["M"],k(t[0]),!1),b(["L"],k(t[1]),!1)]});return a.push([["Z"]]),a.flat().filter(function(t,e,n){return 0===e||"M"!==t[0]})},gk.prototype.createCorner=function(t,e){void 0===e&&(e=10);var n=function(t,e){var n=(t=k(t,2))[0],t=t[1],r=(e=k(e,2))[0],e=e[1];return n!==r&&t===e}.apply(void 0,b([],k(t),!1)),t=k(t,2),r=k(t[0],2),i=r[0],r=r[1],t=k(t[1],2),a=t[0],t=t[1],a=k(n?[a-i,[i,a]]:[t-r,[r,t]],2),t=a[0],a=k(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=k([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]])},gk.prototype.bindEvents=function(){this.label.on(x.BOUNDS_CHANGED,this.renderBackground)},gk.prototype.render=function(){this.renderLabel(),this.renderBackground(),this.adjustLayout()},gk);function gk(t){t=hk.call(this,t,fk)||this;return t.point=[0,0],t.group=t.appendChild(new Gs({})),t.isMutationObserved=!0,t}function mk(t,e){var t=k(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 vk=V2({trackGroup:"background-group",track:"background",selectionGroup:"ribbon-group",selection:"ribbon",clipPath:"clip-path"},"ribbon");function yk(t){var e=t.orientation,n=t.size,t=t.length;return YM(e,[t,n],[n,t])}function bk(t){var e=t.type,t=k(yk(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 xk(t){var i,a,o,e=t.orientation,r=t.color,n=t.block,t=t.partition,s=(l=ze(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 Ka(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(YM(e,"0","270"),")")):""}function wk(t,e){var n,r,i,a=O(e,"selection"),o=xk(e),t=t.maybeAppendByClassName(vk.selection,"path").styles(y({path:bk(e),fill:o},a)),a=t.maybeAppendByClassName(vk.clipPath,"path").styles({path:(a=(o=e).orientation,(e=o.range)?(r=(o=k(yk(o),2))[0],o=o[1],n=(e=k(e,2))[0],e=e[1],i=YM(a,n*r,0),n=YM(a,0,n*o),r=YM(a,e*r,r),[["M",i,n],["L",i,i=YM(a,o,e*o)],["L",r,i],["L",r,n],["Z"]]):[])}).node();t.style("clip-path",a)}ce(Ek,Mk=El),Ek.prototype.render=function(t,e){var n,r,i=w(e).maybeAppendByClassName(vk.trackGroup,"g");i=i,r=O(n=t,"track"),i.maybeAppendByClassName(vk.track,"path").styles(y({path:bk(n)},r)),wk(w(e).maybeAppendByClassName(vk.selectionGroup,"g"),t)};var Mk,kk=Ek;function Ek(t){return Mk.call(this,t,{type:"color",orientation:"horizontal",size:30,range:[0,1],length:200,block:!1,partition:[],color:["#fff","#000"],trackFill:"#e5e5e5"})||this}var Ok,Sk,Ak,_k,Tk=cn(function(t){return{min:Math.min.apply(Math,b([],k(t.map(function(t){return t.value})),!1)),max:Math.max.apply(Math,b([],k(t.map(function(t){return t.value})),!1))}},function(t){return t.map(function(t){return t.id})}),Pk=(ce(s,Ok=El),Object.defineProperty(s.prototype,"handleOffsetRatio",{get:function(){return this.ifHorizontal(.5,.5)},enumerable:!1,configurable:!0}),s.prototype.getBBox=function(){var t=this.attributes,e=t.width,t=t.height;return new G2(0,0,e,t)},s.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(lk.contentGroup,"g").styles({x:i,y:r}),i=(rx(!!t,e.maybeAppendByClassName(lk.labelGroup,"g").styles({zIndex:1}),function(t){n.renderLabel(t)}),e.maybeAppendByClassName(lk.ribbonGroup,"g").styles({zIndex:0}));this.handlesGroup=e.maybeAppendByClassName(lk.handlesGroup,"g").styles({zIndex:2}),this.renderHandles(),this.renderRibbon(i),this.renderIndicator(e),this.adjustLabel(),this.adjustHandles()},Object.defineProperty(s.prototype,"range",{get:function(){var t=this.attributes.data;return Tk(t)},enumerable:!1,configurable:!0}),Object.defineProperty(s.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(s.prototype,"ribbonRange",{get:function(){var t=k(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(s.prototype,"selection",{get:function(){var t=this.range,e=t.min,t=t.max,n=this.attributes.defaultValue,e=k(void 0===n?[e,t]:n,2);return[e[0],e[1]]},enumerable:!1,configurable:!0}),s.prototype.ifHorizontal=function(t,e){return YM(this.attributes.orientation,"function"==typeof t?t():t,"function"==typeof e?e():e)},s.prototype.renderTitle=function(t){var e=this.attributes,n=e.showTitle,r=e.titleText,i=e.width,e=e.height,a=O(this.attributes,"title"),o=y(y({},a),{width:i,height:e,text:r}),s=this;t.selectAll(lk.title.class).data(n?[r]:[]).join(function(t){return t.append(function(){return new NM({style:o})}).attr("className",lk.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(s.prototype,"availableSpace",{get:function(){var t,e;return this.title?this.title.getAvailableSpace():(t=(e=this.attributes).width,e=e.height,new G2(0,0,t,e))},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"labelFixedSpacing",{get:function(){return this.attributes.showTick?5:0},enumerable:!1,configurable:!0}),Object.defineProperty(s.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(s.prototype,"labelBBox",{get:function(){var t,e;return this.attributes.showLabel?(this.cacheLabelBBox||(t=(e=(null==(e=this.label.querySelector(Aw.labelGroup.class))?void 0:e.children.slice(-1)[0]).getBBox()).width,e=e.height,this.cacheLabelBBox=new G2(0,0,t,e)),this.cacheLabelBBox):new G2(0,0,0,0)},enumerable:!1,configurable:!0}),Object.defineProperty(s.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(s.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=k(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=k(this.ifHorizontal([n,l],[l,n]),2),s=o[0],e=o[1],i=["top","left"].includes(c)?a:0,r=k(this.ifHorizontal([t/2,i],[i,t/2]),2),l=r[0],n=r[1];return new G2(l,n,s,e)},enumerable:!1,configurable:!0}),Object.defineProperty(s.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}),s.prototype.renderRibbon=function(t){var e=this.attributes,n=e.data,r=e.type,i=e.orientation,a=e.color,e=e.block,o=O(this.attributes,"ribbon"),s=this.range,l=s.min,c=s.max,s=this.ribbonBBox,u=s.x,s=s.y,h=this.ribbonShape,f=h.length,h=h.size,d=q2({x:u,y:s,length:f,size:h,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(lk.ribbon,function(){return new kk({style:d})}).update(d)},s.prototype.getHandleClassName=function(t){return"".concat(lk.prefix("".concat(t,"-handle")))},s.prototype.renderHandles=function(){var t=this.attributes,e=t.showHandle,t=t.orientation,n=O(this.attributes,"handle"),r=k(this.selection,2),i=r[0],r=r[1],a=y(y({},n),{orientation:t}),t=n.shape,o="basic"===(void 0===t?"slider":t)?rk:yw,s=this;this.handlesGroup.selectAll(lk.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 o({style:a})}).attr("className",function(t){t=t.type;return"".concat(lk.handle," ").concat(s.getHandleClassName(t))}).each(function(t){var e=t.type,t=t.value,t=(this.update({labelText:t}),"".concat(e,"Handle"));(s[t]=this).addEventListener("pointerdown",s.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");s[t]=void 0}).remove()})},s.prototype.adjustHandles=function(){var t=k(this.selection,2),e=t[0],t=t[1];this.setHandlePosition("start",e),this.setHandlePosition("end",t)},Object.defineProperty(s.prototype,"handleBBox",{get:function(){if(!this.cacheHandleBBox){if(!this.attributes.showHandle)return new G2(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=k([Math.max(e,r),Math.max(t,n)],2),r=e[0],t=e[1];this.cacheHandleBBox=new G2(0,0,r,t)}return this.cacheHandleBBox},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"handleShape",{get:function(){var t=this.handleBBox,e=t.width,t=t.height,n=k(this.ifHorizontal([t,e],[e,t]),2);return{width:e,height:t,size:n[0],length:n[1]}},enumerable:!1,configurable:!0}),s.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=k(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})},s.prototype.renderIndicator=function(t){var e=O(this.attributes,"indicator");this.indicator=t.maybeAppendByClassName(lk.indicator,function(){return new pk({})}).update(e)},Object.defineProperty(s.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=k([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(s.prototype,"labelStyle",{get:function(){var t=k(["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}),s.prototype.renderLabel=function(t){var e=this.attributes,n=e.showTick,n=void 0!==n&&n,r=e.labelFilter,e=e.labelFormatter,i=O(this.attributes,"tick"),a=O(this.attributes,"label"),o=a.align,n=q2(y({showLine:!1,showGrid:!1,showTick:n,type:"linear",startPos:[0,0],endPos:[0,0],tickDirection:"negative",labelTransform:"rotate(0)"},this.labelStyle),Lx(i,"tick"),Lx(a,"label"),{data:this.labelData}),i={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)===o&&(!r||r(t,t.index,n.filter(function(t){return t.type===o})))},labelFormatter:e},s=y(y({},n),i);this.label=t.maybeAppendByClassName(lk.label,function(){return new DM({style:s})}).node(),this.label.update(s,!1)},Object.defineProperty(s.prototype,"labelAxisStyle",{get:function(){var t=this.attributes,e=t.showTick,n=t.labelDirection,r=t.labelSpacing,t=t.tickLength,i=this.ribbonShape.size,a=this.labelPosition,o=this.labelFixedSpacing,s=k([0,0,0],3),l=s[0],s=(s[1],s[2]),t=null!=t?t:i;return e?(s=t,"positive"===n?"right"===a?s=l=t:"bottom"===a&&(l=s):"negative"!==n||"top"!==a&&"left"!==a||(l=i)):"positive"===n&&"right"!==a&&"bottom"===a&&(l=i+o),{offset:l,spacing:r,tickLength:s}},enumerable:!1,configurable:!0}),s.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=k(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))},s.prototype.bindEvents=function(){this.ribbon.on("pointerdown",this.onDragStart("ribbon")),this.ribbon.on("pointermove",this.onHovering),this.addEventListener("pointerout",this.hideIndicator)},s.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=Ze(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}),P2(this.indicator.node())):this.hideIndicator()},s.prototype.hideIndicator=function(){L2(this.indicator.node())},s.prototype.updateMouse=function(){this.attributes.slidable&&(this.style.cursor="grabbing")},s.prototype.setSelection=function(t,e){this.updateSelection(t,e)},s.prototype.updateSelection=function(t,e,n){void 0===n&&(n=!1);var r,i,a,o,s,l=k(this.selection,2),c=l[0],l=l[1],t=k([t,e],2),e=t[0],t=t[1],n=(n&&(e+=c,t+=l),this.range),c=n.min,l=n.max,u=k((n=[c,l],c=[e,t],l=this.selection,void 0===r&&(r=4),i=(n=k(n,2))[0],n=n[1],a=(c=k(c,2))[0],c=c[1],o=(l=k(l,2))[0],l=l[1],c=(a=k([a,c],2))[0],s=(a=a[1])-c,a<c&&(c=(u=k([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]:[vx(c,r),vx(a,r)]),2),e=u[0],t=u[1];this.update({defaultValue:[e,t]}),this.dispatchSelection()},Object.defineProperty(s.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 on(t)?vx(.01*(e-n),0):t},enumerable:!1,configurable:!0}),s.prototype.getTickValue=function(t){var e=this.attributes,n=e.data,e=e.block,r=this.range.min;return e?mk(n.map(function(t){return t.value}),t).tick:(e=this.step,r+Math.round((t-r)/e)*e)},s.prototype.getValueByCanvasPoint=function(t,e){var n=this.range,r=n.min,n=n.max,i=k(this.ribbon.node().getPosition(),2),a=i[0],i=i[1],a=this.ifHorizontal(a,i),i=this.ifHorizontal.apply(this,b([],k(ex(t)),!1));return Ze(this.getOffset(i-a,!0),r,n)},s.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)},s.prototype.dispatchSelection=function(){var t=new fs("valuechange",{detail:{value:this.selection}});this.dispatchEvent(t)},s.prototype.dispatchIndicated=function(t,e){t=new fs("indicate",{detail:{value:t,range:e}});this.dispatchEvent(t)},s);function s(t){var a=Ok.call(this,t,sk)||this;return a.eventToOffsetScale=new Pv({}),a.innerRibbonScale=new Pv({}),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=mk(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(),k(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 Lk(t){Sk||(Sk=document.createElement("table"),_k=document.createElement("tr"),Ak=/^\s*<(\w+|!)[^>]*>/,_k={tr:document.createElement("tbody"),tbody:Sk,thead:Sk,tfoot:Sk,td:_k,th:_k,"*":document.createElement("div")});var e=Ak.test(t)&&RegExp.$1,e=(e&&e in _k||(e="*"),_k[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 Ck(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 Nk={overflow:"hidden","white-space":"nowrap","text-overflow":"ellipsis"};ce(Dk,jk=El),Object.defineProperty(Dk.prototype,"HTMLTooltipElement",{get:function(){return this.element},enumerable:!1,configurable:!0}),Dk.prototype.getContainer=function(){return this.element},Object.defineProperty(Dk.prototype,"position",{set:function(t){var t=k(t,2),e=t[0],t=t[1];this.attributes.x=e,this.attributes.y=t,this.updatePosition()},enumerable:!1,configurable:!0}),Object.defineProperty(Dk.prototype,"elementSize",{get:function(){return{width:this.element.offsetWidth,height:this.element.offsetHeight}},enumerable:!1,configurable:!0}),Object.defineProperty(Dk.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=it(t,["name","color","index"]),r=y({name:r,color:i,index:null!=a?a:e},t);return Lk((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}),Dk.prototype.render=function(t,e){this.renderHTMLTooltipElement(),this.updatePosition()},Dk.prototype.destroy=function(){var t;null!=(t=this.element)&&t.remove(),jk.prototype.destroy.call(this)},Dk.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"},Dk.prototype.hide=function(){this.element.style.visibility="hidden"},Dk.prototype.initShape=function(){var t=this.attributes.template;this.element=Lk(t.container),this.id&&this.element.setAttribute("id",this.id)},Dk.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))},Dk.prototype.renderHTMLTooltipElement=function(){var r,t=this.attributes,e=t.template,n=t.title,i=t.enterable,a=t.style,t=t.content,o=Ck(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,b([],k(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=k(t,2),e=t[0],n=t[1];b([r],k(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(":"),";")},""))})})},Dk.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=k(l,2),n=e[0],e=e[1],t=k(a[t],2),r=t[0],t=t[1];l=[n+(o/2+i[0])*r,e+(s/2+i[1])*t]}),l},Dk.prototype.setOffsetPosition=function(t){var t=k(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")},Dk.prototype.updatePosition=function(){this.setOffsetPosition(this.autoPosition(this.getRelativeOffsetFromCursor()))},Dk.prototype.autoPosition=function(t){var e,n,r,i,a,o,s,t=k(t,2),l=t[0],t=t[1],c=this.attributes,u=c.x,h=c.y,f=c.bounding,c=c.position;return f?(e=(n=this.element).offsetWidth,n=n.offsetHeight,h=(u=k([+u+l,+h+t],2))[0],u=u[1],r={left:"right",right:"left",top:"bottom",bottom:"top"},s=f.x,i=f.y,a={left:h<s,right:s+f.width<h+e,top:u<i,bottom:i+f.height<u+n},o=[],c.split("-").forEach(function(t){o.push(a[t]?r[t]:t)}),s=o.join("-"),this.getRelativeOffsetFromCursor(s)):[l,t]},Dk.tag="tooltip",t([(void 0===(Rk=100)&&(Rk=0),void 0===(Ik=!0)&&(Ik=!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,Ik&&i.apply(t,e),r=window.setTimeout(function(){i.apply(t,e),r=null},Rk))})})],Dk.prototype,"updatePosition",null);var jk,Rk,Ik,Bk=Dk;function Dk(t){var e=this,n=null==(n=null==(n=t.style)?void 0:n.template)?void 0:n.prefixCls,r=Ck(n);return(e=jk.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=Ck(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},Nk),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)"},Nk),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(zk,Fk=Gs),Object.defineProperty(zk.prototype,"margin",{get:function(){return this.$margin},set:function(t){this.$margin=Ax(t)},enumerable:!1,configurable:!0}),Object.defineProperty(zk.prototype,"padding",{get:function(){return this.$padding},set:function(t){this.$padding=Ax(t)},enumerable:!1,configurable:!0}),zk.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=k(this.$margin,4),a=i[0],o=i[1],s=i[2],i=i[3];return new G2(e-i,n-a,r+i+o,t+a+s)},zk.prototype.appendChild=function(t,e){return t.isMutationObserved=!0,Fk.prototype.appendChild.call(this,t,e),t},zk.prototype.getAvailableSpace=function(){var t=this.attributes,e=t.width,t=t.height,n=k(this.$padding,4),r=n[0],i=n[1],a=n[2],n=n[3],o=k(this.$margin,4),s=o[0],o=o[3];return new G2(n+o,r+s,e-n-i,t-r-a)},zk.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:lx,grid:cx})?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){}},zk.prototype.bindEvents=function(){var e=this;this.layoutEvents.forEach(function(t){e.addEventListener(t,function(t){t.target.isMutationObserved=!0,e.layout()})})},zk.prototype.attributeChangedCallback=function(t,e,n){"margin"===t?this.margin=n:"padding"===t&&(this.padding=n),this.layout()};var Fk,dl=zk;function zk(t){var e=Fk.call(this,t)||this,t=(e.layoutEvents=[x.BOUNDS_CHANGED,x.INSERTED,x.REMOVED],e.$margin=Ax(0),e.$padding=Ax(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 Wk(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 Ob()([[0,0],[s,l]]);s=[[t-a,i-o]].concat(e.length?e:[[0,0]]);const c=[n[0]-a,n[1]-o],[u,h]=s;return l=c,t=u,i=h,e=uy(l,t),t=uy(t,i),i=uy(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])),Ob()(s)}const Gk=t2(t=>{var e,n,r,i,a=t.attributes,{labelTransform:o,labelTransformOrigin:s,x:l,y:c,x0:u=l,y0:h=c,background:f,connector:d,startMarker:p,endMarker:g,coordCenter:m}=a,a=it(a,["class","transform","rotate","labelTransform","labelTransformOrigin","x","y","x0","y0","background","connector","startMarker","endMarker","coordCenter"]);[l,c,u,h].some(t=>!Qe(t))||(e=(n=at(a,"background"))["padding"],n=it(n,["padding"]),{points:r=[]}=i=at(a,"connector"),i=it(i,["points"]),u=[[+u,+h],[+l,+c]],h=st(t).maybeAppend("text","text").style("zIndex",0).call(C,Object.assign({textBaseline:"middle",transform:o,transformOrigin:s},a)).node(),l=Wk(st(t).maybeAppend("background","rect").style("zIndex",-1).call(C,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}}(h,e)).call(C,f?n:{}).node(),u,r,m),c=p&&new Wx({id:"startMarker",style:Object.assign({x:0,y:0},at(a,"startMarker"))}),o=g&&new Wx({id:"endMarker",style:Object.assign({x:0,y:0},at(a,"endMarker"))}),st(t).maybeAppend("connector","path").style("zIndex",0).style("path",l).style("markerStart",c).style("markerEnd",o).call(C,d?i:{}))}),Hk=(s,t)=>{const l=t["coordinate"];return(t,e,n)=>{var{color:e,text:r="",fontSize:i,rotate:a=0,transform:o=""}=e,r={text:String(r),stroke:e,fill:e,fontSize:i},[[e,i]]=t;return st(new Gk).style("x",e).style("y",i).call(C,n).style("transform",o+`rotate(${+a})`).style("coordCenter",l.getCenter()).call(C,r).call(C,s).node()}};Hk.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Yk=t2(t=>{var e=it(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])]}(st(t).maybeAppend("marker",()=>new Wx({})).call(t=>t.node().update(Object.assign({symbol:r},n))).node());st(t).maybeAppend("text","text").style("x",i).style("y",a).call(C,e)}),Vk=(t,e)=>{const i=it(t,[]);return(t,e,n)=>{var r=n["color"],n=it(n,["color"]),{color:e=r,text:r=""}=e,r={text:String(r),stroke:e,fill:e},[[e,t]]=t;return st(new Yk).call(C,n).style("x",e).style("y",t).call(C,r).call(C,i).node()}};Vk.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const qk=t2(t=>{var{areaPath:e,connectPath:n,areaStyle:r,connectStyle:i}=t.attributes;const a=t.ownerDocument;st(t).maybeAppend("connect-path",()=>a.createElement("path",{})).style("d",n).call(C,i),st(t).maybeAppend("area-path",()=>a.createElement("path",{})).style("d",e).call(C,r)}),$k=(t,e)=>{const{curve:c,gradient:l=!1,defined:u=t=>!Number.isNaN(t)&&null!=t,connect:h=!1}=t,f=it(t,["curve","gradient","defined","connect"]),{coordinate:d,document:p}=e;return(t,e,n)=>{var r=n["color"],{color:r=r,seriesColor:i,seriesX:a,seriesY:o}=e,e=wy(d,e),i=l&&i?vy(i,a,o,l):r;const s=Object.assign(Object.assign(Object.assign(Object.assign({},n),{stroke:i,fill:i}),e&&{transform:e}),f);var[a,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,h=e[t],f=e[t+l];[...h,...f].some(t=>!n(t))?o=!0:(r.push(h),i.push(f),o&&s&&(o=!1,[c,u]=s,a.push([c,h,u,f])),s=[h,f])}return[r.concat(i),a]}(t,u),r=at(s,"connect"),n=!!o.length,i=t=>st(p.createElement("path",{})).style("d",t).call(C,s).node();return sp(d)?(e=t=>{const n=d.getCenter(),r=t.slice(0,t.length/2),i=t.slice(t.length/2);return t=Sb().curve(Ab),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 Pb(a())},delete t.lineX0,t.lineEndAngle=function(){return Pb(o())},delete t.lineX1,t.lineInnerRadius=function(){return Pb(s())},delete t.lineY0,t.lineOuterRadius=function(){return Pb(l())},delete t.lineY1,t.curve=function(t){return arguments.length?e(Tb(t)):e()._curve},t.angle((t,e)=>fy(ly(r[e],n))).outerRadius((t,e)=>uy(r[e],n)).innerRadius((t,e)=>uy(i[e],n)).defined((t,e)=>[...r[e],...i[e]].every(u)).curve(c)(i);var e,a,o,s,l},!n||h&&!Object.keys(r).length?i(e(a)):n&&!h?i(e(t)):st(new qk).style("areaStyle",s).style("connectStyle",Object.assign(Object.assign({},r),f)).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(op(d)?Sb().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(u)):Sb().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(u))).curve(c)(n)},!n||h&&!Object.keys(r).length?i(e(a)):n&&!h?i(e(t)):st(new qk).style("areaStyle",s).style("connectStyle",Object.assign(Object.assign({},r),f)).style("areaPath",e(t)).style("connectPath",o.map(e).join("")).node())}},Uk=($k.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},(n,r)=>{const i=r["coordinate"];return(...t)=>{var e=sp(i)?Wb:Mb;return $k(Object.assign({curve:e},n),r)(...t)}}),Xk=(Uk.props=Object.assign(Object.assign({},$k.props),{defaultMarker:"square"}),(t,n)=>{const{alpha:r=.5}=t,i=it(t,["alpha"]),a=n["coordinate"];return(...t)=>{var e=sp(a)?Fb:Bb;return $k(Object.assign({curve:e.alpha(r)},i),n)(...t)}}),Kk=(Xk.props=Object.assign(Object.assign({},$k.props),{defaultMarker:"smooth"}),(e,n)=>(...t)=>$k(Object.assign({curve:Hb},e),n)(...t)),Zk=(Kk.props=Object.assign(Object.assign({},$k.props),{defaultMarker:"hvh"}),(e,n)=>(...t)=>$k(Object.assign({curve:Yb},e),n)(...t)),Qk=(Zk.props=Object.assign(Object.assign({},$k.props),{defaultMarker:"vh"}),(e,n)=>(...t)=>$k(Object.assign({curve:Vb},e),n)(...t)),Jk=(Qk.props=Object.assign(Object.assign({},$k.props),{defaultMarker:"hv"}),(e,n)=>{const{arrow:r=!1}=e;return(...t)=>T2(Object.assign(Object.assign({},e),{arrow:r}),n)(...t)}),tE=(Jk.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},(t,e)=>{const o=it(t,[]),s=e["document"];return(t,e,n)=>{var r=n["color"],n=it(n,["color"]),{color:e=r,transform:r}=e,[t,i]=t,a=hb();return a.moveTo(t[0],t[1]),a.bezierCurveTo(t[0]/2+i[0]/2,t[1],t[0]/2+i[0]/2,i[1],i[0],i[1]),st(s.createElement("path",{})).call(C,n).style("d",a.toString()).style("stroke",e).style("transform",r).call(C,o).node()}});tE.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const eE=(t,e)=>{const{cornerRatio:u=1/3}=t,h=it(t,["cornerRatio"]),{coordinate:f,document:d}=e;return(t,e,n)=>{var r,i,a,o,s=n["defaultColor"],n=it(n,["defaultColor"]),{color:e=s,transform:s}=e,[t,l]=t,c=(t=t,l=l,r=f,i=u,o=hb(),sp(r)?(a=uy(t,c=r.getCenter()),a=(uy(l,c)-a)*i+a,o.moveTo(t[0],t[1]),my(o,t,l,c,a)):op(r)?(o.moveTo(t[0],t[1]),o.lineTo(t[0]+(l[0]-t[0])*i,t[1]),o.lineTo(t[0]+(l[0]-t[0])*i,l[1])):(o.moveTo(t[0],t[1]),o.lineTo(t[0],t[1]+(l[1]-t[1])*i),o.lineTo(l[0],t[1]+(l[1]-t[1])*i)),o.lineTo(l[0],l[1]),o);return st(d.createElement("path",{})).call(C,n).style("d",c.toString()).style("stroke",e).style("transform",s).call(C,h).node()}},nE=(eE.props={defaultMarker:"vhv",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},(t,e)=>{const s=it(t,[]),{coordinate:l,document:c}=e;return(t,e,n)=>{var r,i=n["color"],n=it(n,["color"]),{color:e=i,transform:i}=e,[t,a]=t,o=hb();return o.moveTo(t[0],t[1]),sp(l)?(r=l.getCenter(),o.quadraticCurveTo(r[0],r[1],a[0],a[1])):my(o,t,a,gy(t,a),uy(t,a)/2),st(c.createElement("path",{})).call(C,n).style("d",o.toString()).style("stroke",e).style("transform",i).call(C,s).node()}}),rE=(nE.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},(u,t)=>{const{coordinate:h,document:f}=t;return(t,e,n)=>{var r=n["color"],n=it(n,["color"]),{color:e=r,src:r="",size:i=32,transform:a=""}=e,{width:o=i,height:i=i}=u,[[t,s]]=t,[l,c]=h.getSize(),o="string"==typeof o?ld(o)*l:o,i="string"==typeof i?ld(i)*c:i,l=t-Number(o)/2,c=s-Number(i)/2;return st(f.createElement("image",{})).call(C,n).style("x",l).style("y",c).style("img",r).style("stroke",e).style("transform",a).call(C,u).style("width",o).style("height",i).node()}});rE.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const iE=(i,t)=>{const{coordinate:a,document:o}=t;return(t,e,n)=>{var r=n["color"],n=it(n,["color"]),{color:e=r,transform:r}=e,t=function(i,t){const a=hb();if(sp(t)){const o=t.getCenter();t=[...i,i[0]];const s=t.map(t=>uy(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?my(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,a);return st(o.createElement("path",{})).call(C,n).style("d",t.toString()).style("stroke",e).style("fill",e).style("transform",r).call(C,i).node()}};iE.props={defaultMarker:"square",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const aE=(t,e)=>{const a=it(t,[]),{coordinate:o,document:s}=e;return(t,e,n)=>{var r=n["color"],n=it(n,["color"]),{color:e=r,transform:i}=e,t=function(t,e){var n,[t,r,i,a]=t,o=hb();return sp(e)?(n=uy(e=e.getCenter(),t),o.moveTo(t[0],t[1]),o.quadraticCurveTo(e[0],e[1],i[0],i[1]),my(o,i,a,e,n),o.quadraticCurveTo(e[0],e[1],r[0],r[1]),my(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,o);return st(s.createElement("path",{})).call(C,n).style("d",t.toString()).style("fill",e||r).style("stroke",e||r).style("transform",i).call(C,a).node()}};aE.props={defaultMarker:"square",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const oE=(m,t)=>{const{coordinate:v,document:y}=t;return(t,e,n)=>{var r,i,a,o,s,l,c,u,h,{color:e,transform:f}=e,{color:d,fill:p=d,stroke:d=d}=n,n=it(n,["color","fill","stroke"]),g=(t=t,r=v,h=hb(),sp(r)?([i,a]=r=r.getCenter(),o=hy(ly(t[0],r)),s=hy(ly(t[1],r)),g=uy(r,t[2]),l=uy(r,t[3]),c=uy(r,t[8]),u=uy(r,t[10]),r=uy(r,t[11]),h.moveTo(...t[0]),h.arc(i,a,g,o,s),h.arc(i,a,g,s,o,!0),h.moveTo(...t[2]),h.lineTo(...t[3]),h.moveTo(...t[4]),h.arc(i,a,l,o,s),h.lineTo(...t[6]),h.arc(i,a,u,s,o,!0),h.closePath(),h.moveTo(...t[8]),h.arc(i,a,c,o,s),h.arc(i,a,c,s,o,!0),h.moveTo(...t[10]),h.lineTo(...t[11]),h.moveTo(...t[12]),h.arc(i,a,r,o,s),h.arc(i,a,r,s,o,!0)):(h.moveTo(...t[0]),h.lineTo(...t[1]),h.moveTo(...t[2]),h.lineTo(...t[3]),h.moveTo(...t[4]),h.lineTo(...t[5]),h.lineTo(...t[6]),h.lineTo(...t[7]),h.closePath(),h.moveTo(...t[8]),h.lineTo(...t[9]),h.moveTo(...t[10]),h.lineTo(...t[11]),h.moveTo(...t[12]),h.lineTo(...t[13])),h);return st(y.createElement("path",{})).call(C,n).style("d",g.toString()).style("stroke",d).style("fill",e||p).style("transform",f).call(C,m).node()}};oE.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const sE=(m,t)=>{const{coordinate:v,document:y}=t;return(t,e,n)=>{var r,i,a,o,s,l,c,u,h,{color:e,transform:f}=e,{color:d,fill:p=d,stroke:d=d}=n,n=it(n,["color","fill","stroke"]),g=(t=t,r=v,i=4,h=hb(),sp(r)?([a,o]=r=r.getCenter(),s=uy(r,t[3]),l=uy(r,t[8]),g=uy(r,t[10]),c=(r=hy(ly(t[2],r)))-(u=Math.asin(i/l)),r+=u,h.moveTo(...t[2]),h.lineTo(...t[3]),h.moveTo(Math.cos(c)*s+a,Math.sin(c)*s+o),h.arc(a,o,s,c,r),h.lineTo(Math.cos(r)*g+a,Math.sin(r)*g+o),h.arc(a,o,g,r,c,!0),h.lineTo(Math.cos(c)*s+a,Math.sin(c)*s+o),h.closePath(),h.moveTo(...t[10]),h.lineTo(...t[11]),u=(c+r)/2,h.moveTo(Math.cos(u)*(l+i/2)+a,Math.sin(u)*(l+i/2)+o),h.arc(Math.cos(u)*l+a,Math.sin(u)*l+o,i/2,u,2*Math.PI+u)):(h.moveTo(...t[2]),h.lineTo(...t[3]),h.lineTo(t[3][0]-i,t[3][1]),h.lineTo(t[10][0]-i,t[10][1]),h.lineTo(t[10][0]+i,t[10][1]),h.lineTo(t[3][0]+i,t[3][1]),h.lineTo(...t[3]),h.closePath(),h.moveTo(...t[10]),h.lineTo(...t[11]),h.moveTo(t[3][0]+i/2,t[8][1]),h.arc(t[3][0],t[8][1],i/2,0,2*Math.PI)),h.closePath(),h);return st(y.createElement("path",{})).call(C,n).style("d",g.toString()).style("stroke",d).style("fill",e||p).style("transform",f).call(C,m).node()}};sE.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const lE=(t,e)=>{const{arrow:u,arrowSize:h=4}=t,f=it(t,["arrow","arrowSize"]),{coordinate:d,document:p}=e;return(t,e,n)=>{var r,i,a,{color:o,lineWidth:s}=n,n=it(n,["color","lineWidth"]),{color:o=o,size:s=s}=e,l=u?(l=p,r=h,i=Object.assign({fill:f.stroke||o,stroke:f.stroke||o},at(f,"arrow")),l.createElement("path",{style:Object.assign({path:`M ${r},${r} L -${r},0 L ${r},-${r} L 0,0 Z`,anchor:"0.5 0.5",transformOrigin:"center"},i)})):null,t=(r=t,sp(i=d)?(i=i.getCenter(),bb()({startAngle:0,endAngle:2*Math.PI,outerRadius:uy(r[0],i),innerRadius:uy(r[1],i)})):Ob().x(t=>t[0]).y(t=>t[1])(r)),c=(c=d,e=e.transform,sp(c)?([c,a]=c.getCenter(),`translate(${c}, ${a}) `+(e||"")):e);return st(p.createElement("path",{})).call(C,n).style("d",t).style("stroke",o).style("lineWidth",s).style("transform",c).style("markerEnd",l).call(C,f).node()}};function cE(t,e,n){return[["M",t,e],["L",t+2*n,e-n],["L",t+2*n,e+n],["Z"]]}lE.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const uE=t2(t=>{var e=t.attributes,{points:n,endMarker:r=!0}=e,e=it(e,["points","class","endMarker","direction"]),i=at(e,"endMarker"),n=(n=n,Ob().x(t=>t[0]).y(t=>t[1])(n));st(t).maybeAppend("connector","path").style("path",n).style("markerEnd",r?new Wx({className:"marker",style:Object.assign(Object.assign({},i),{symbol:cE})}):null).call(C,e)});const hE=(t,e)=>{const{offset:o=0,connectLength1:s}=t,l=it(t,["offset","connectLength1"]),c=e["coordinate"];return(t,e,n)=>{var{color:r,connectLength1:i=s}=n,n=it(n,["color","connectLength1"]),{color:e,transform:a}=e,t=function(t,e,n,r=0){var[[e,i],[a,o]]=e;if(op(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]]}(c,t,o,i);return st(new uE).call(C,n).style("points",t).style("stroke",e||r).style("transform",a).call(C,l).node()}};function fE(t){return t.replace(/-(\w)/g,function(t,e){return e.toUpperCase()})}function dE(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=a0(a.x,c),i=a0(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 pE(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:h}=by(e,i,[t,n]),f="inside"===r?(u+h)/2:h;e=mE(f,a,o),t=(()=>{var[t,e]=i,n=l+.5*(c-l),[n,t]="inside"===r?gE(s,f,n):gy(t,e);return{x:n,y:t}})();return Object.assign(Object.assign({},t),{textAlign:"inside"===r?"center":"start",textBaseline:"middle",rotate:e})}function gE(t,e,n){return[t[0]+Math.sin(e)*n,t[1]-Math.cos(e)*n]}function mE(t,e,n){return e?(e=n?0:Math.sin(t)<0?90:-90,t/Math.PI*180+e):0}function vE(t,e,n,r){var{y:n,y1:i,autoRotate:a,rotateToAlignArc:o,radius:s=.5,offset:l=0}=n,e=by(r,e,[n,i]),{startAngle:n,endAngle:i}=e,r=r.getCenter(),n=(n+i)/2,i={textAlign:"center",textBaseline:"middle",rotate:mE(n,a,o)},{innerRadius:a,outerRadius:o}=e,[e,r]=gE(r,n,a+(o-a)*s+l);return Object.assign({x:e,y:r},i)}function yE(t,e,n){var n=n["bounds"],[n]=n;return{x:n[0],y:n[1]}}function bE(t,e,n,r){var i=n["bounds"];return 1===i.length?yE(0,0,n):(lp(r)?pE:fp(r)?vE:dE)(t,e,n,r)}function xE(t,e,n){var{innerRadius:n,outerRadius:t}=by(n,t,[e.y,e.y1]);return n+(t-n)}function wE(t,e,n){var{startAngle:n,endAngle:t}=by(n,t,[e.y,e.y1]);return(n+t)/2}function ME(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,h=r.getCenter(),f=wE(e,n,r),d=0<Math.sin(f)?1:-1,i=mE(f,i,a),a={textAlign:0<d||lp(r)?"start":"end",textBaseline:"middle",rotate:i},i=xE(e,n,r),[[e,n],[r,h],[f,i]]=function(t,e,n,r,i){var[n,a]=gE(t,e,n),[t,r]=gE(t,e,r);return[[n,a],[t,r],[t+(0<Math.sin(e)?1:-1)*i,r]]}(h,f,i,i+(s?l:o),s?c:0),l=s?+u*d:0,o=f+l,c={connector:s,connectorPoints:[[r-o,h-i],[f-o,i-i]]};return Object.assign(Object.assign({x0:e,y0:n,x:f+l,y:i},a),c)}hE.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};var kE=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=Ud(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=hy(ly(l(e+1),s))/Math.PI*180;return{x:i[0],y:i[1],transform:`rotate(${l})`,textAlign:"center",textBaseline:"middle"}},bottom:bE,bottomLeft:bE,bottomRight:bE,inside:bE,left:bE,outside:function(t,e,n,r){var i=n["bounds"];return 1===i.length?yE(0,0,n):(lp(r)?pE:fp(r)?ME:dE)(t,e,n,r)},right:bE,spider:function(t,e,n,r){var i,a,o,s,l,c;return fp(r)?({connectorLength:c,connectorLength2:i,connectorDistance:a}=n,o=it(ME(0,e,n,r),[]),s=r.getCenter(),l=xE(e,n,r),e=wE(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 fp(r)?({connectorLength:o,connectorLength2:i,connectorDistance:a}=n,{x0:n,y0:s}=e=it(ME(0,e,n,r),[]),l=r.getCenter(),r=function(t){if(fp(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=fy([n-l[0],s-l[1]]),n=0<Math.sin(o)?1:-1,[s,l]=gE(l,o,r),e.x=s+(i+a)*n,e.y=l,e):{}},top:bE,topLeft:bE,topRight:bE});function EE(t,e,n,r,i){var a=e["position"],a=(o=n,void 0!==(a=a)?a:fp(o)?"inside":op(o)?"right":"top"),o=r["inside"===a?"innerLabel":"label"],r=Object.assign({},o,e),e=kE[fE(a)];if(e)return Object.assign(Object.assign({},o),e(a,t,r,n,i));throw new Error("Unknown position: "+a)}const OE=(s,t)=>{const{coordinate:l,theme:c}=t;return(t,e)=>{var{text:n,transform:r="",transformOrigin:i}=e,a=it(e,["text","x","y","transform","transformOrigin"]),t=EE(t,e,l,c,s),{rotate:e=0,transform:o=""}=t,t=it(t,["rotate","transform"]);return st(new Gk).call(C,t).style("text",""+n).style("labelTransform",(o+` rotate(${+e}) `+r).trim()).style("labelTransformOrigin",i).style("coordCenter",l.getCenter()).call(C,a).node()}},SE=(OE.props={defaultMarker:"point"},(t,e)=>{const o=t["colorAttribute"],s=it(t,["arrow","colorAttribute"]),{coordinate:l,document:c}=e;return(t,e,n)=>{var r=n["color"],n=it(n,["color","stroke"]),{d:e,color:r=r}=e,[i,a]=l.getSize();return st(c.createElement("path",{})).call(C,n).style("d","function"==typeof e?e({width:i,height:a}):e).style(o,r).call(C,s).node()}}),AE=(SE.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},(t,e)=>SE(Object.assign({colorAttribute:"fill"},t),e)),_E=(AE.props={defaultMarker:"hvh",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},(t,e)=>SE(Object.assign({fill:"none",colorAttribute:"stroke"},t),e)),TE=(_E.props={defaultMarker:"hvh",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},(s,t)=>{const l=t["document"];return(t,e,n)=>{var r=e["transform"],i=n["color"],n=it(n,["color"]),{color:e=i}=e,[t,...a]=t;const o=hb();return o.moveTo(...t),a.forEach(([t,e])=>{o.lineTo(t,e)}),o.closePath(),st(l.createElement("path",{})).call(C,n).style("d",o.toString()).style("stroke",e||i).style("fill",e||i).style("fillOpacity",.4).style("transform",r).call(C,s).node()}});function PE(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 LE(t,e,n){t=t?t():document.createElement("canvas");return t.width=e,t.height=n,t}TE.props={defaultMarker:"square",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},PE(3);const CE=function(n,r,t=16){const i=PE(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=LE(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 NE(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=LE(o,t,e).getContext("2d"),l=function(t,e){const n=(e=LE(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,h=r,f=i,d=o,p=(n=a)["blur"];let t=f.length;for(;t--;){var{x:g,y:m,value:v,radius:y}=f[t],v=Math.min(v,h),g=g-y,m=m-y,y=CE(y,1-p,d);c.globalAlpha=Math.max((v-u)/(h-u),.001),c.drawImage(y,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 h=c[t],f=4*h;f&&(h=o||Math.max(0,Math.min(s,Math.max(a,h))),c[t-3]=r[f],c[t-2]=r[1+f],c[t-1]=r[2+f],c[t]=l?r[3+f]:h)}return i}(s,t,e,l,a),i=LE(o,t,e).getContext("2d");return i.putImageData(r,0,0),i}const jE=(t,e)=>{const{gradient:u,opacity:h,maxOpacity:f,minOpacity:d,blur:p,useGradientOpacity:g}=t,m=it(t,["gradient","opacity","maxOpacity","minOpacity","blur","useGradientOpacity"]),{coordinate:v,createCanvas:y,document:b}=e;return(t,e,n)=>{var r,i,e=e["transform"],[a,o]=v.getSize(),s=t.map(t=>({x:t[0],y:t[1],value:t[2],radius:t[3]})),l=Xd(t,t=>t[2]),t=$d(t,t=>t[2]),c={gradient:u,opacity:h,minOpacity:d,maxOpacity:f,blur:p,useGradientOpacity:g},l=a&&o?NE(a,o,l,t,s,(r=c,i=t=>void 0===t,Object.keys(r).reduce((t,e)=>{var n=r[e];return i(n,e)||(t[e]=n),t},{})),y):{canvas:null};return st(b.createElement("image",{})).call(C,n).style("x",0).style("y",0).style("width",a).style("height",o).style("src",l.canvas).style("transform",e).call(C,m).node()}},RE=(jE.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},t=>{const n=t["render"],r=it(t,["render"]);return t=>{var[[t,e]]=t;return n(Object.assign(Object.assign({},r),{x:t,y:e}))}}),l=(RE.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},{BLACK:"#000",WHITE:"#fff",STROKE:"#416180"}),IE=t=>{var e={defaultColor:"#5B8FF9",defaultCategory10:"category10",defaultCategory20:"category20",defaultSize:1,elementActiveStroke:l.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:l.BLACK,lineWidth:1}},text:{text:{fill:"#1D2129",fontSize:12,strokeWidth:0,connectorStroke:l.STROKE,connectorStrokeOpacity:.45,connectorLineWidth:1,backgroundFill:l.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:l.STROKE,markerFillOpacity:.25,markerStrokeOpacity:0}},lineX:{line:{stroke:l.STROKE,strokeOpacity:.45,lineWidth:1}},lineY:{line:{stroke:l.STROKE,strokeOpacity:.45,lineWidth:1}},rangeX:{range:{fill:l.STROKE,fillOpacity:.15,lineWidth:0}},rangeY:{range:{fill:l.STROKE,fillOpacity:.15,lineWidth:0}},connector:{connector:{stroke:l.STROKE,strokeOpacity:.45,lineWidth:1,connectLength1:12,endMarker:!0,endMarkerSize:6,endMarkerFill:l.STROKE,endMarkerFillOpacity:.95}},interaction:{active:{line:{line:{lineWidth:3}},interval:{rect:{stroke:l.BLACK}},area:{area:{fillOpacity:.5}}},inactive:{area:{area:{fillOpacity:.3}}},selected:{},disabled:{}},axis:{arrow:!1,gridLineDash:[0,0],gridLineWidth:.5,gridStroke:l.BLACK,gridStrokeOpacity:.05,labelAlign:"horizontal",labelFill:l.BLACK,labelFillOpacity:.65,labelFontSize:12,labelFontWeight:"lighter",labelSpacing:8,line:!1,lineLineWidth:.5,lineStroke:l.BLACK,lineStrokeOpacity:.45,tickLength:4,tickLineWidth:1,tickStroke:l.BLACK,tickStrokeOpacity:.25,titleFill:l.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},axisArc:{title:!1,titlePosition:"inner",line:!1,tick:!0,labelSpacing:4},axisRadar:{girdClosed:!0,gridStrokeOpacity:.3,gridType:"surround",label:!1,tick:!1,titlePosition:"start"},legendCategory:{backgroundFill:"transparent",itemBackgroundFill:"transparent",itemLabelFill:l.BLACK,itemLabelFillOpacity:.65,itemLabelFontSize:12,itemLabelFontWeight:"lighter",itemMarkerFillOpacity:1,itemMarkerSize:8,itemSpacing:[5,8],itemValueFill:l.BLACK,itemValueFillOpacity:.65,itemValueFontSize:12,itemValueFontWeight:"lighter",navButtonFill:l.BLACK,navButtonFillOpacity:.65,navPageNumFill:l.BLACK,navPageNumFillOpacity:.45,navPageNumFontSize:12,padding:8,title:!0,titleFill:l.BLACK,titleFillOpacity:.65,titleFontSize:12,titleFontWeight:"normal",titleSpacing:4,tickStroke:l.BLACK,tickStrokeOpacity:.25,rowPadding:0,colPadding:8},legendContinuous:{handleHeight:12,handleLabelFill:l.BLACK,handleLabelFillOpacity:.45,handleLabelFontSize:12,handleLabelFontWeight:"normal",handleMarkerFill:l.BLACK,handleMarkerFillOpacity:.6,handleMarkerLineWidth:1,handleMarkerStroke:l.BLACK,handleMarkerStrokeOpacity:.25,handleWidth:10,labelFill:l.BLACK,labelFillOpacity:.45,labelFontSize:12,labelFontWeight:"lighter",labelSpacing:3,tick:!0,tickLength:12,ribbonSize:12,ribbonFill:"#aaa",handle:!0,handleLabel:!1,handleShape:"slider",handleIconSize:12/1.8,indicator:!1,titleFontSize:12,titleSpacing:4,titleFontWeight:"normal",titleFillOpacity:.65,tickStroke:l.BLACK,tickStrokeOpacity:.25},label:{fill:l.BLACK,fillOpacity:.65,fontSize:12,fontWeight:"normal",stroke:void 0,offset:12,connectorStroke:l.BLACK,connectorStrokeOpacity:.45,connectorLineWidth:1,connectorLength:12,connectorLength2:8,connectorDistance:4},innerLabel:{fill:l.WHITE,fontSize:12,fillOpacity:.85,fontWeight:"normal",stroke:void 0,offset:0},slider:{trackSize:16,trackFill:l.STROKE,trackFillOpacity:1,selectionFill:"#5B8FF9",selectionFillOpacity:.15,handleIconSize:10,handleIconFill:"#f7f7f7",handleIconFillOpacity:1,handleIconStroke:l.BLACK,handleIconStrokeOpacity:.25,handleIconLineWidth:1,handleIconRadius:2,handleLabelFill:l.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:l.BLACK,titleFillOpacity:.85,titleFontSize:14,titleFontWeight:"bold",titleTextBaseline:"top",subtitleFill:l.BLACK,subtitleFillOpacity:.65,subtitleFontSize:12,subtitleFontWeight:"normal",subtitleTextBaseline:"top"}};return Object.assign({},e,t)},c=(IE.props={},{BLACK:"#fff",WHITE:"#000",STROKE:"#416180"}),BE=t=>{var e={defaultColor:"#5B8FF9",defaultCategory10:"category10",defaultCategory20:"category20",defaultSize:1,elementActiveStroke:c.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:c.BLACK,lineWidth:1}},text:{text:{fill:c.BLACK,fillOpacity:.65,fontSize:12,strokeWidth:0,connectorStroke:c.STROKE,connectorStrokeOpacity:.45,connectorLineWidth:1,backgroundFill:c.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:c.STROKE,markerFillOpacity:.25,markerStrokeOpacity:0}},lineX:{line:{stroke:c.STROKE,strokeOpacity:.45,lineWidth:1}},lineY:{line:{stroke:c.STROKE,strokeOpacity:.45,lineWidth:1}},rangeX:{range:{fill:c.STROKE,fillOpacity:.15,lineWidth:0}},rangeY:{range:{fill:c.STROKE,fillOpacity:.15,lineWidth:0}},connector:{connector:{stroke:c.STROKE,strokeOpacity:.45,lineWidth:1,connectLength1:12,endMarker:!0,endMarkerSize:6,endMarkerFill:c.STROKE,endMarkerFillOpacity:.95}},interaction:{active:{line:{line:{lineWidth:3}},interval:{rect:{stroke:c.BLACK}},area:{area:{fillOpacity:.5}}},inactive:{area:{area:{fillOpacity:.3}}},selected:{},disabled:{}},axis:{arrow:!1,gridLineDash:[0,0],gridLineWidth:.5,gridStroke:c.BLACK,gridStrokeOpacity:.05,labelAlign:"horizontal",labelFill:c.BLACK,labelFillOpacity:.65,labelFontSize:12,labelFontWeight:"lighter",labelSpacing:8,lineLineWidth:.5,lineStroke:c.BLACK,lineStrokeOpacity:.45,tickLength:4,tickLineWidth:1,tickStroke:c.BLACK,tickStrokeOpacity:.25,titleFill:c.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"},axisArc:{title:!1,titlePosition:"inner",line:!1,tick:!0,labelSpacing:4},legendCategory:{backgroundFill:"transparent",itemBackgroundFill:"transparent",itemLabelFill:c.BLACK,itemLabelFillOpacity:.65,itemLabelFontSize:12,itemLabelFontWeight:"lighter",itemMarkerFillOpacity:1,itemMarkerSize:8,itemSpacing:[5,8],itemValueFill:c.BLACK,itemValueFillOpacity:.65,itemValueFontSize:12,itemValueFontWeight:"lighter",navButtonFill:c.BLACK,navButtonFillOpacity:.45,navPageNumFill:c.BLACK,navPageNumFillOpacity:.45,navPageNumFontSize:12,padding:8,title:!0,titleFill:c.BLACK,titleFillOpacity:.65,titleFontSize:12,titleFontWeight:"normal",titleSpacing:4,tickStroke:c.BLACK,tickStrokeOpacity:.25,rowPadding:0,colPadding:8},legendContinuous:{handleHeight:12,handleLabelFill:c.BLACK,handleLabelFillOpacity:.45,handleLabelFontSize:12,handleLabelFontWeight:"normal",handleMarkerFill:c.BLACK,handleMarkerFillOpacity:.6,handleMarkerLineWidth:1,handleMarkerStroke:c.BLACK,handleMarkerStrokeOpacity:.25,handleWidth:10,labelFill:c.BLACK,labelFillOpacity:.45,labelFontSize:12,labelFontWeight:"lighter",labelSpacing:3,tick:!0,tickLength:12,ribbonSize:12,ribbonFill:"#aaa",handle:!0,handleLabel:!1,handleShape:"slider",handleIconSize:12/1.8,indicator:!1,titleFontSize:12,titleSpacing:4,titleFontWeight:"normal",titleFillOpacity:.65,tickStroke:c.BLACK,tickStrokeOpacity:.25},label:{fill:c.BLACK,fillOpacity:.65,fontSize:12,fontWeight:"normal",stroke:void 0,offset:12,connectorStroke:c.BLACK,connectorStrokeOpacity:.45,connectorLineWidth:1,connectorLength:12,connectorLength2:8,connectorDistance:4},innerLabel:{fill:c.WHITE,fontSize:12,fillOpacity:.85,fontWeight:"normal",stroke:void 0,offset:0},slider:{trackSize:16,trackFill:c.STROKE,trackFillOpacity:1,selectionFill:"#5B8FF9",selectionFillOpacity:.15,handleIconSize:10,handleIconFill:"#f7f7f7",handleIconFillOpacity:1,handleIconStroke:c.BLACK,handleIconStrokeOpacity:.25,handleIconLineWidth:1,handleIconRadius:2,handleLabelFill:c.BLACK,handleLabelFillOpacity:.45,handleLabelFontSize:12,handleLabelFontWeight:"normal"},scrollbar:{},title:{titleFill:c.BLACK,titleFillOpacity:.85,titleFontSize:14,titleFontWeight:"bold",titleTextBaseline:"top",subtitleFill:c.BLACK,subtitleFillOpacity:.65,subtitleFontSize:12,subtitleFontWeight:"normal",subtitleTextBaseline:"top"}};return Object.assign({},e,t)},DE=(BE.props={},{BLACK:"#000",WHITE:"#fff",STROKE:"#888"}),FE=t=>{var e={defaultColor:"#4e79a7",defaultCategory10:"tableau10",defaultCategory20:"tableau10",defaultSize:1,elementActiveStroke:DE.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:DE.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:DE.STROKE,connectorStrokeOpacity:.45,connectorLineWidth:1,backgroundFill:DE.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:DE.STROKE,markerFillOpacity:.25,markerStrokeOpacity:0}},lineX:{line:{stroke:DE.STROKE,strokeOpacity:.45,lineWidth:1}},lineY:{line:{stroke:DE.STROKE,strokeOpacity:.45,lineWidth:1}},rangeX:{range:{fill:DE.STROKE,fillOpacity:.15,lineWidth:0}},rangeY:{range:{fill:DE.STROKE,fillOpacity:.15,lineWidth:0}},connector:{connector:{stroke:DE.STROKE,strokeOpacity:.45,lineWidth:1,connectLength1:12,endMarker:!0,endMarkerSize:6,endMarkerFill:DE.STROKE,endMarkerFillOpacity:.95}},interaction:{active:{line:{line:{lineWidth:3}},interval:{rect:{stroke:DE.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:DE.BLACK,labelFillOpacity:1,labelFontSize:10,labelFontWeight:"normal",labelSpacing:4,line:!0,lineLineWidth:1,lineStroke:"#888",lineStrokeOpacity:1,tickLength:5,tickLineWidth:1,tickStroke:DE.STROKE,tickStrokeOpacity:1,titleFill:DE.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"},axisArc:{title:!1,titlePosition:"inner",line:!1,tick:!0,labelSpacing:4},axisRadar:{girdClosed:!0,gridStrokeOpacity:.3,gridType:"surround",label:!1,tick:!1,titlePosition:"start"},legendCategory:{backgroundFill:"transparent",itemBackgroundFill:"transparent",itemLabelFill:DE.BLACK,itemLabelFillOpacity:1,itemLabelFontSize:10,itemLabelFontWeight:"normal",itemMarkerFillOpacity:1,itemMarkerSize:8,itemSpacing:[5,4],itemValueFill:DE.BLACK,itemValueFillOpacity:1,itemValueFontSize:10,itemValueFontWeight:"normal",navButtonFill:DE.BLACK,navButtonFillOpacity:.45,navButtonSize:6,navPageNumFill:DE.BLACK,navPageNumFillOpacity:.45,navPageNumFontSize:10,padding:8,title:!0,titleFill:DE.BLACK,titleFillOpacity:1,titleFontSize:11,titleFontWeight:"bold",titleSpacing:4,rowPadding:0,colPadding:8},legendContinuous:{handleHeight:12,handleLabelFill:DE.BLACK,handleLabelFillOpacity:.45,handleLabelFontSize:10,handleLabelFontWeight:"normal",handleMarkerFill:DE.BLACK,handleMarkerFillOpacity:.6,handleMarkerLineWidth:1,handleMarkerStroke:DE.BLACK,handleMarkerStrokeOpacity:.25,handleWidth:10,labelFill:DE.BLACK,labelFillOpacity:.45,labelFontSize:10,labelFontWeight:"normal",title:!0,titleSpacing:4,ribbonFill:"#aaa",handle:!0,handleLabel:!1,handleShape:"slider",handleIconSize:12/1.8,indicator:!1,titleFontWeight:"bold"},label:{fill:DE.BLACK,fillOpacity:.65,fontSize:10,fontWeight:"normal",stroke:void 0,offset:12,connectorStroke:DE.BLACK,connectorStrokeOpacity:.45,connectorLineWidth:1,connectorLength:12,connectorLength2:8,connectorDistance:4},innerLabel:{fill:DE.WHITE,fontSize:10,fillOpacity:.85,fontWeight:"normal",stroke:void 0,offset:0},slider:{trackSize:16,trackFill:DE.STROKE,trackFillOpacity:.05,selectionFill:"#4e79a7",selectionFillOpacity:.15,handleIconSize:10,handleIconFill:"#f7f7f7",handleIconFillOpacity:1,handleIconStroke:DE.BLACK,handleIconStrokeOpacity:.25,handleIconLineWidth:1,handleIconRadius:2,handleLabelFill:DE.BLACK,handleLabelFillOpacity:.45,handleLabelFontSize:10,handleLabelFontWeight:"normal"},scrollbar:{},title:{titleFill:DE.BLACK,titleFillOpacity:.85,titleFontSize:14,titleFontWeight:"bold",titleTextBaseline:"top",subtitleFill:DE.BLACK,subtitleFillOpacity:.65,subtitleFontSize:12,subtitleFontWeight:"normal",subtitleTextBaseline:"top"}};return Object.assign({},e,t)};function zE(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)]}FE.props={};var WE,GE=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function HE(t){var e;if(e=GE.exec(t))return new YE({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 YE(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 VE(t,e){var n,e=zE(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+""}HE.prototype=YE.prototype,YE.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 qE={"%":(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)=>VE(100*t,e),r:VE,s:function(t,e){var n,r,i=zE(t,e);return i?(n=i[0],(i=(i=i[1])-(WE=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")+zE(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 $E(t){return t}var UE,XE=Array.prototype.map,KE=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function ZE(t){var e,s,l,M=void 0===t.grouping||void 0===t.thousands?$E:(s=XE.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]+"",k=void 0===t.decimal?".":t.decimal+"",E=void 0===t.numerals?$E:(e=XE.call(t.numerals,String),function(t){return t.replace(/[0-9]/g,function(t){return e[+t]})}),a=void 0===t.percent?"%":t.percent+"",O=void 0===t.minus?"−":t.minus+"",S=void 0===t.nan?"NaN":t.nan+"";function o(t){var c=(t=HE(t)).fill,u=t.align,h=t.sign,e=t.symbol,f=t.zero,d=t.width,p=t.comma,g=t.precision,m=t.trim,v=t.type,y=("n"===v?(p=!0,v="g"):qE[v]||(void 0===g&&(g=12),m=!0,v="g"),(f||"0"===c&&"="===u)&&(f=!0,c="0",u="="),"$"===e?r:"#"===e&&/[boxX]/.test(v)?"0"+v.toLowerCase():""),b="$"===e?i:/[%p]/.test(v)?a:"",x=qE[v],w=/[defgprs%]/.test(v);function n(t){var e,n,r,i=y,a=b;if("c"===v)a=x(t)+a,t="";else{var o=(t=+t)<0||1/t<0;if(t=isNaN(t)?S: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&&"+"!==h?!1:o)?"("===h?h:O:"-"===h||"("===h?"":h)+i,a=("s"===v?KE[8+WE/3]:"")+a+(o&&"("===h?")":""),w)for(e=-1,n=t.length;++e<n;)if((r=t.charCodeAt(e))<48||57<r){a=(46===r?k+t.slice(e+1):t.slice(e))+a,t=t.slice(0,e);break}}p&&!f&&(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&&f&&(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 E(t)}return g=void 0===g?6:/[gprs]/.test(v)?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=HE(t)).type="f",t)),e=3*Math.max(-8,Math.min(8,Math.floor((t=e,((t=zE(Math.abs(t)))?t[1]:NaN)/3)))),r=Math.pow(10,-e),i=KE[8+e/3];return function(t){return n(r*t)+i}}}}function QE(t,e,n){return t.querySelector(e)?st(t).select(e):st(t).append(n)}function JE(t){return Array.isArray(t)?t.join(", "):""+(t||"")}function tO(t,e){let{flexDirection:n,justifyContent:r,alignItems:i}={flexDirection:"row",justifyContent:"flex-start",alignItems:"center"};var a={top:["row","flex-start","center"],bottom:["row","flex-start","center"],left:["column","center","center"],right:["column","center","center"],center:["column","center","center"]};return t in a&&([n,r,i]=a[t]),Object.assign({display:"flex",flexDirection:n,justifyContent:r,alignItems:i},e)}Ms=ZE({thousands:",",grouping:[3],currency:["$",""]}),UE=Ms.format,Ms.formatPrefix;class eO extends dl{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 nO extends eO{update(t){var e,t=t["subOptions"];null!=(e=this.child)&&e.update(t)}}function rO(t,e){return null==(t=t.filter(t=>t.getOptions().name===e))?void 0:t[0]}function iO(t,e,n){var t=t["bbox"],{position:e="top",size:r,length:i,crossPadding:a=0}=e,e=["top","bottom","center"].includes(e),[t,o]=e?[t.height,t.width]:[t.width,t.height],{defaultSize:n,defaultLength:s}=n.props,r=(r||n||t)-2*a,n=i||s||o,[t,a]=e?[n,r]:[r,n];return{orientation:e?"horizontal":"vertical",width:t,height:a,size:r,length:n}}function aO(t){const n=["arrow","crosshairs","grid","handle","handleLabel","indicator","label","line","tick","tip","title","trunc"];var e=t["style"],t=it(t,["style"]);const r={};return Object.entries(t).forEach(([t,e])=>{n.includes(t)?r["show"+rn(t)]=e:r[t]=e}),Object.assign(Object.assign({},r),e)}function oO(t){var{innerWidth:t,innerHeight:e}=t.getOptions();return[t,e]}function sO(t){return"number"!=typeof t||Math.abs(t)<1e-15?t:parseFloat(t.toFixed(15))}function lO(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]=Od(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),h=n||(null==(l=a.getFormatter)?void 0:l.call(a))||u,f=function(t,e){if(sp(e))return t=>t;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 Pv({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 hp(i)?(e=i.map("bottom"===r?[t,1]:[0,t]),"bottom"===r?(n=e[0],new Pv({domain:[0,a],range:[0,1]}).map(n)):"left"===r?(n=e[1],new Pv({domain:[0,o],range:[0,1]}).map(n)):t):t}}(o,s);return sp(s)||op(s)?c.map((t,e,n)=>{var r,i=(null==(i=a.getBandWidth)?void 0:i.call(a,t))/2||0,i=f(a.map(t)+i);return{value:lp(s)&&"center"===o||op(s)&&(null==(r=a.getTicks)?void 0:r.call(a))&&["top","bottom","center","outer"].includes(o)?1-i:i,label:u(h(sO(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(f(a.map(t)+r)),label:u(h(sO(t),e,n)),id:String(e)}})}function cO(t,e,n){var r;return!(sp(r=e)&&op(r)||up(e))&&(void 0===t?!!n.getTicks:t)}function uO(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"+Jp(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 hO,ds=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?UE(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 fO=ds(t=>{const{direction:o="left",important:s={},labelFormatter:l,orientation:c,position:u,size:h,style:f={},title:d,tickCount:p,tickFilter:g,tickMethod:m,transform:v,indexBBox:y}=t,b=it(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=uO(0,0,r,o,u,c),r=Object.assign(Object.assign(Object.assign({},r),f),b),a=function(t,e){var[e,n]=oO(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]=dp(r);const[u,h]=pp(r);var a=Math.min(a,o)/2,{insetLeft:o,insetTop:r}=r.getOptions(),l=l*a,c=c*a,[a,t]=[t+n-o,s+i-r],[n,o]=[Math.cos(e),Math.sin(e)];return{startPos:[a+c*n,t+c*o],endPos:[a+l*n,t+l*o],gridClosed:h-u==360,gridCenter:[a,t],gridControlAngles:new Array(3).fill(0).map((t,e,n)=>(h-u)/(n.length-1)*e)}}}return{}}(u,c,e,n),i=lO(t,i,p,l,g,m,u,n),i=y?i.map((t,e)=>{e=y.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:h,titleText:JE(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}(v,r),grid:cO(r.grid,n,t),gridLength:a,line:!0,indexBBox:y}),r.line?null:{lineOpacity:0}),e),s);return i.labelOverlap.find(t=>"hide"===t.type)&&(i.crossSize=!1),new DM({className:"axis",style:aO(i)})}}),dO=ds(t=>{const{position:o,labelFormatter:s,tickFilter:l,tickCount:c,tickMethod:u,important:h={},indexBBox:f,title:d,grid:p=!1}=t,g=it(t,["order","size","position","orientation","labelFormatter","tickFilter","tickCount","tickMethod","important","style","indexBBox","title","grid"]);return({scales:[t],value:e,coordinate:n,theme:r})=>{var e=e["bbox"],i=t.getOptions()["domain"],t=lO(t,i,c,s,l,u,o,n),i=f?t.map((t,e)=>{e=f.get(e);return!e||e[0]!==t.label?t:Object.assign(Object.assign({},t),{bbox:e[1]})}):t,[t,a]=dp(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]=pp(i),[l,c]=oO(i),a={center:e,radius:a,startAngle:o,endAngle:s,gridLength:(r-n)*(Math.min(l,c)/2)};return"inner"===t?({insetLeft:o,insetTop:s}=i.getOptions(),Object.assign(Object.assign({},a),{center:[e[0]-o,e[1]-s],labelAlign:"perpendicular",labelDirection:"positive",tickDirection:"positive",gridDirection:"negative"})):Object.assign(Object.assign({},a),{labelAlign:"parallel",labelDirection:"negative",tickDirection:"negative",gridDirection:"positive"})}(o,e,t,a,n),{axis:t,axisArc:a={}}=r,n=aO(ot({},t,a,e,Object.assign(Object.assign({type:"arc",data:i,titleText:JE(d),grid:p},g),h)));return new DM({style:fn(n,["transform"])})}}),pO=(fO.props={defaultPosition:"center",defaultSize:45,defaultOrder:0},dO.props={defaultPosition:"outer",defaultOrientation:"vertical",defaultSize:45,defaultOrder:0},e=>(...t)=>fO(Object.assign({},{crossPadding:50},e))(...t)),gO=(pO.props=Object.assign(Object.assign({},fO.props),{defaultPosition:"bottom"}),e=>(...t)=>fO(Object.assign({},{crossPadding:10},e))(...t));gO.props=Object.assign(Object.assign({},fO.props),{defaultPosition:"left"});const mO=a=>{const{important:o={}}=a,s=it(a,["important"]);return t=>{var e,{theme:n,coordinate:r,scales:i}=t;return fO(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[t]=r,r=t.getOptions().name;const[a,o]=pp(n);var{axisRadar:t={}}=e;return Object.assign(Object.assign({},t),{grid:"position"===r,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 vO(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(Fe(t))return t[t.length-1]}(t.split("."));return()=>function(t,e){var{fill:n,stroke:r,lineWidth:i,color:a}=e,o=it(e,["d","fill","strokeWidth","path","stroke","lineWidth","color"]);const s=c2.get(t)||c2.get("point");return(...t)=>{return new Zs({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 yO(t,{scales:e,library:n,markState:r}){const[i,a]=function(t,e){var n=rO(t,"shape"),r=rO(t,"color");const i=n?n.clone():null,a=[];for(const[c,u]of e){var o=c.type,s=(0<(null==r?void 0:r.getOptions().domain.length)?null==r?void 0:r.getOptions().domain:u.data).map((t,e)=>{return i?i.map(t||"point"):(null==(t=null===c||void 0===c?void 0:c.style)?void 0:t.shape)||u.defaultShape||"point"});"string"==typeof o&&a.push([o,s])}if(0===a.length)return["point",["point"]];if(1===a.length)return a[0];if(!n)return a[0];const l=n.getOptions()["range"];return a.map(([t,e])=>{let n=0;for(let t=0;t<a.length;t++){var r=l[t%l.length];e[t]===r&&n++}return[n/e.length,[t,e]]}).sort((t,e)=>e[0]-t[0])[0][1]}(e,r),o=(t,e)=>vO(t,n,0,0,{color:e}),s=t=>i+"."+a[t],l=t["itemMarker"];return rO(e,"shape")&&!l?(t,e)=>o(s(e),t.color):"function"==typeof l?(t,e)=>{e=l(t.id,e);return"string"==typeof e?o(e,t.color):e}:(t,e)=>o(l||s(e),t.color)}function bO(t,e){var{labelFormatter:n=t=>""+t}=t,{scales:r,theme:i}=e,i={itemMarker:yO(t,e),itemMarkerSize:(t=r,e=i.legendCategory.itemMarkerSize,(t=rO(t,"size"))?2*t.map(NaN):e),itemMarkerOpacity:function(t){if(t=rO(t,"opacity")){const n=t.getOptions()["range"];return(t,e)=>n[e]}}(r)};const a="string"==typeof n?UE(n):n,o=rO(r,"color");t=r.find(t=>0<t.getOptions().domain.length).getOptions().domain;return Object.assign(Object.assign({},i),{data:t.map(t=>({id:t,label:a(t),color:o.map(t)}))})}mO.props=Object.assign(Object.assign({},fO.props),{defaultPosition:"center"});const xO=o=>{const{layout:s,position:l,title:c,cols:u}=o,h=it(o,["labelFormatter","layout","order","orientation","position","size","title","cols","itemMarker"]),f=h["gridRow"];return t=>{var{value:e,theme:n}=t,r=e["bbox"],{width:e,height:i}=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}=iO(t,e,n);return{width:i,height:a}}(e,o,xO),a=tO(l,s),e=Object.assign(Object.assign(Object.assign(Object.assign({orientation:["right","left","center"].includes(l)?"vertical":"horizontal",width:e,height:i,layout:void 0!==u?"grid":"flex"},void 0!==u&&{gridCol:u}),void 0!==f&&{gridRow:f}),{titleText:JE(c)}),bO(o,t)),{legendCategory:i={}}=n,t=aO(Object.assign({},i,e,h)),n=new nO({style:Object.assign(Object.assign({x:r.x,y:r.y,width:r.width,height:r.height},a),{subOptions:t})});return n.appendChild(new ck({className:"legend-category",style:t})),n}};function wO(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 MO(t){var t=t.getOptions()["domain"],[t,e]=[t[0],ay(t)];return[t,e]}function kO(t,e,n,r,i,a){const o=t["length"];var i=i.color?a.legendContinuous.ribbonFill||"black":a.defaultColor;const s=e||(a=i,i=(e=n||r).getOptions(),(e=e.clone()).update(Object.assign(Object.assign({},i),{range:[Ka(a).toString()]})),e),[l,c]=MO(s);return Object.assign(Object.assign({},t),{data:s.getTicks().map(t=>({value:t})),color:new Array(o).fill(0).map((t,e)=>{var e=(c-l)/(o-1)*e+l,n=s.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 EO(t,e,n,r,i,a){var o=rO(t,"color"),n=function(t,e,n){var{size:r,crossPadding:i=0}=e,t=iO(t,e,n);return e=r-2*i,r=(n=t).orientation,n.size=e,"horizontal"===(r=r)||0===r?n.height=e:n.width=e,n}(n,r,i);if(o instanceof Rv){var r=o.getOptions()["range"],[i,s]=MO(o);if(o instanceof Dv||o instanceof zv)return wO(n,o,i,s,r);{i=n;s=o;const l=[-1/0,...s.thresholds,1/0].map((t,e)=>({value:e,label:t}));return Object.assign(Object.assign({},i),{data:l,color:r,labelFilter:(t,e)=>0<e&&e<l.length-1})}}return kO(n,o,rO(t,"size"),rO(t,"opacity"),e,a)}xO.props={defaultPosition:"top",defaultOrder:1,defaultSize:40,defaultPadding:[20,10],defaultCrossPadding:[5,10]};const OO=u=>{const{labelFormatter:h,layout:f,position:d,title:p,style:g}=u,m=it(u,["labelFormatter","layout","order","orientation","position","size","title","style","crossPadding","padding"]);return({scales:t,value:e,theme:n,scale:r})=>{var i=e["bbox"],{x:i,y:a,width:o,height:s}=i,l=tO(d,f),{legendContinuous:c={}}=n,c=aO(Object.assign({},c,Object.assign(Object.assign({titleText:JE(p),labelAlign:"value",labelFormatter:"string"==typeof h?t=>UE(h)(t.label):h},EO(t,r,e,u,OO,n)),g),m)),t=new eO({style:Object.assign(Object.assign({x:i,y:a,width:o,height:s},l),{subOptions:c})});return t.appendChild(new Pk({style:c})),t}},SO=(OO.props={defaultPosition:"top",defaultOrientation:"vertical",defaultOrder:1,defaultSize:60,defaultLength:200,defaultLegendSize:60,defaultPadding:[20,10],defaultCrossPadding:[5,10]},e=>(...t)=>OO(Object.assign({},{block:!0},e))(...t)),AO=(SO.props=Object.assign(Object.assign({},OO.props),{defaultPosition:"top",defaultOrientation:"horizontal"}),n=>t=>{var e=t["scales"],e=rO(e,"size");return OO(Object.assign({},{type:"size",data:e.getTicks().map((t,e)=>({value:t,label:String(t)}))},n))(t)}),_O=(AO.props=Object.assign(Object.assign({},OO.props),{defaultPosition:"top",defaultOrientation:"horizontal"}),t=>AO(Object.assign({},{block:!0},t)));function TO(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"}}}_O.props=Object.assign(Object.assign({},OO.props),{defaultPosition:"top",defaultOrientation:"horizontal"});hO={render(t,e){const{y:n,width:r,title:i,subtitle:a}=t,o=t.style,{spacing:s=2,align:l="left"}=o,c=it(o,["spacing","align"]);t=at(c,"title");const u=at(c,"subtitle"),h=QE(e,".title","text").attr("className","title").call(C,Object.assign(Object.assign(Object.assign({},TO(0,n,r,l)),{fontSize:14,textBaseline:"top",text:i}),t)).node().getLocalBounds();QE(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({},TO(0,h.max[1]+s,r,l)),{fontSize:12,textBaseline:"top",text:a}),u))})}};const PO=class extends Ds{constructor(t){super(t),this.descriptor=hO}connectedCallback(){var t,e;null!=(e=(t=this.descriptor).render)&&e.call(t,this.attributes,this)}update(t={}){var e;this.attr(ot({},this.attributes,t)),null!=(e=(t=this.descriptor).render)&&e.call(t,this.attributes,this)}},LO=a=>({value:t,theme:e})=>{var{x:t,y:n,width:r,height:i}=t.bbox;return new PO({style:ot({},{style:e.title},Object.assign({x:t,y:n,width:r,height:i},a))})};function CO(t){return t.getBandWidth}function NO(t,e,n){if(!CO(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=wd(t,e);return r=n+a,t=0,e=i.length-1,i[Math.min(e,Math.max(t,r))]}function jO(t,e,n){if(!e)return t.getOptions().domain;if(!CO(t))return o=Rd(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 RO(t,e,n,r,i,a){const{x:o,y:s}=i;i=(t,e)=>{var[t,n]=a.invert(t);return[NO(o,t,e),NO(s,n,e)]},t=i([t,e],!0),e=i([n,r],!1);return[jO(o,[t[0],e[0]]),jO(s,[t[1],e[1]])]}function IO(t,e){var[t,n]=t;return[e.map(t),e.map(n)+((t=e).getStep?t.getStep():0)]}LO.props={defaultPosition:"top",defaultOrder:2,defaultSize:36};const BO=t=>{const{orientation:h,labelFormatter:f,style:d}=t,p=it(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 f?UE(f):f;var c="horizontal"===h;const u=op(r)&&c;return new ww({className:"slider",style:Object.assign({},e,Object.assign(Object.assign({x:t,y:i,trackLength:c?a:o,orientation:h,formatter:t=>{var e=l||s,t=u?1-t:t;return e(NO(n,t,!0))}},d),p))})}},DO=(BO.props={defaultPosition:"bottom",defaultSize:24,defaultOrder:1},t=>BO(Object.assign(Object.assign({},t),{orientation:"horizontal"}))),FO=(DO.props=Object.assign(Object.assign({},BO.props),{defaultPosition:"bottom"}),t=>BO(Object.assign(Object.assign({},t),{orientation:"vertical"}))),zO=(FO.props=Object.assign(Object.assign({},BO.props),{defaultPosition:"left"}),t=>{const{orientation:s,style:l}=t,c=it(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 Ew({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}))})}}),WO=(zO.props={defaultPosition:"bottom",defaultSize:24,defaultOrder:1},t=>zO(Object.assign(Object.assign({},t),{orientation:"horizontal"}))),GO=(WO.props=Object.assign(Object.assign({},zO.props),{defaultPosition:"bottom"}),t=>zO(Object.assign(Object.assign({},t),{orientation:"vertical"}))),HO=(GO.props=Object.assign(Object.assign({},zO.props),{defaultPosition:"left"}),t=>()=>new Gs),YO=(HO.props={},(c,t)=>{const u=t["coordinate"];return(t,e,n)=>{const[r]=t;var t=r.getBoundingClientRect()["height"],{transform:i="",fillOpacity:a=1,strokeOpacity:o=1,opacity:s=1}=r.style,[t,l]=op(u)?[[0,t],"scale(1, 0.0001)"]:[[0,0],"scale(0.0001, 1)"],l=[{transform:(i+" "+l).trimStart(),fillOpacity:0,strokeOpacity:0,opacity:0},{transform:(i+" "+l).trimStart(),fillOpacity:a,strokeOpacity:o,opacity:s,offset:.01},{transform:(i+" scale(1, 1)").trimStart(),fillOpacity:a,strokeOpacity:o,opacity:s}],i=(r.setOrigin(t),r.animate(l,Object.assign(Object.assign({},n),c)));return i.finished.then(()=>r.setOrigin(0,0)),i}}),VO=(c,t)=>{const u=t["coordinate"];return(t,e,n)=>{const[r]=t;var t=r.getBoundingClientRect()["height"],{transform:i="",fillOpacity:a=1,strokeOpacity:o=1,opacity:s=1}=r.style,[t,l]=op(u)?[[0,t],"scale(1, 0.0001)"]:[[0,0],"scale(0.0001, 1)"],a=[{transform:(i+" scale(1, 1)").trimStart()},{transform:(i+" "+l).trimStart(),fillOpacity:a,strokeOpacity:o,opacity:s,offset:.99},{transform:(i+" "+l).trimStart(),fillOpacity:0,strokeOpacity:0,opacity:0}],o=(r.setOrigin(t),r.animate(a,Object.assign(Object.assign({},n),c)));return o.finished.then(()=>r.setOrigin(0,0)),o}},qO=(c,t)=>{const u=t["coordinate"];return(t,e,n)=>{const[r]=t;var t=r.getBoundingClientRect()["height"],{transform:i="",fillOpacity:a=1,strokeOpacity:o=1,opacity:s=1}=r.style,[t,l]=op(u)?[[0,0],"scale(0.0001, 1)"]:[[0,t],"scale(1, 0.0001)"],l=[{transform:(i+" "+l).trimStart(),fillOpacity:0,strokeOpacity:0,opacity:0},{transform:(i+" "+l).trimStart(),fillOpacity:a,strokeOpacity:o,opacity:s,offset:.01},{transform:(i+" scale(1, 1)").trimStart(),fillOpacity:a,strokeOpacity:o,opacity:s}],i=(r.setOrigin(t),r.animate(l,Object.assign(Object.assign({},n),c)));return i.finished.then(()=>r.setOrigin(0,0)),i}},$O=(c,t)=>{const u=t["coordinate"];return(t,e,n)=>{const[r]=t;var t=r.getBoundingClientRect()["height"],{transform:i="",fillOpacity:a=1,strokeOpacity:o=1,opacity:s=1}=r.style,[t,l]=op(u)?[[0,0],"scale(0.0001, 1)"]:[[0,t],"scale(1, 0.0001)"],a=[{transform:(i+" scale(1, 1)").trimStart()},{transform:(i+" "+l).trimStart(),fillOpacity:a,strokeOpacity:o,opacity:s,offset:.99},{transform:(i+" "+l).trimStart(),fillOpacity:0,strokeOpacity:0,opacity:0}],o=(r.setOrigin(t),r.animate(a,Object.assign(Object.assign({},n),c)));return o.finished.then(()=>r.setOrigin(0,0)),o}},UO=o=>(t,e,n)=>{var[t]=t,{fillOpacity:r=1,strokeOpacity:i=1,opacity:a=1}=t.style;return t.animate([{fillOpacity:0,strokeOpacity:0,opacity:0},{fillOpacity:r,strokeOpacity:i,opacity:a}],Object.assign(Object.assign({},n),o))},XO=(UO.props={},o=>(t,e,n)=>{var[t]=t,{fillOpacity:r=1,strokeOpacity:i=1,opacity:a=1}=t.style;return t.animate([{fillOpacity:r,strokeOpacity:i,opacity:a},{fillOpacity:0,strokeOpacity:0,opacity:0}],Object.assign(Object.assign({},n),o))});function KO(t,e){var n={};for(const i of e){var r=t.style[i];r&&(n[i]=r)}return n}XO.props={};const ZO=["fill","stroke","fillOpacity","strokeOpacity","opacity","lineWidth"];function QO(t){var{min:t,max:e}=t.getLocalBounds(),[t,n]=t,[e,r]=e;return[t,n,e-t,r-n]}function JO(t,e){var[n,r,i,t]=QO(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),h=i/u;for(let t=0;t<u;t++){var f=n+t*h,d=r+l*s;o.push(function(t){var[t,e,n,r]=t;return`
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).G2={})}(this,function(w){"use strict";var E="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},S=function(t,e){return(S=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 t(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}S(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var m=function(){return(m=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 it(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 e(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 X(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 R(r,i){var a,o,s,l={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},c={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function t(n){return function(t){var e=[n,t];if(a)throw new TypeError("Generator is already executing.");for(;l=c&&e[c=0]?0:l;)try{if(a=1,o&&(s=2&e[0]?o.return:e[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,e[1])).done)return s;switch(o=0,(e=s?[2&e[0],s.value]:e)[0]){case 0:case 1:s=e;break;case 4:return l.label++,{value:e[1],done:!1};case 5:l.label++,o=e[1],e=[0];continue;case 7:e=l.ops.pop(),l.trys.pop();continue;default:if(!(s=0<(s=l.trys).length&&s[s.length-1])&&(6===e[0]||2===e[0])){l=0;continue}if(3===e[0]&&(!s||e[1]>s[0]&&e[1]<s[3]))l.label=e[1];else if(6===e[0]&&l.label<s[1])l.label=s[1],s=e;else{if(!(s&&l.label<s[2])){s[2]&&l.ops.pop(),l.trys.pop();continue}l.label=s[2],l.ops.push(e)}}e=i.call(r,l)}catch(t){e=[6,t],o=0}finally{a=s=0}if(5&e[0])throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}}}function I(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 j(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 M(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 B(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 D,F,n={exports:{}};function z(){}function W(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function G(t,e,n,r,i){if("function"!=typeof n)throw new TypeError("The listener must be a function");n=new W(n,r||t,i),r=F?F+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 H(t,e){0==--t._eventsCount?t._events=new z:delete t._events[e]}function Y(){this._events=new z,this._eventsCount=0}sn=n,D=Object.prototype.hasOwnProperty,F="~",Object.create&&(z.prototype=Object.create(null),(new z).__proto__||(F=!1)),Y.prototype.eventNames=function(){var t,e,n=[];if(0===this._eventsCount)return n;for(e in t=this._events)D.call(t,e)&&n.push(F?e.slice(1):e);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(t)):n},Y.prototype.listeners=function(t){var t=F?F+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},Y.prototype.listenerCount=function(t){t=F?F+t:t,t=this._events[t];return t?t.fn?1:t.length:0},Y.prototype.emit=function(t,e,n,r,i,a){var o=F?F+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(f=1,s=new Array(c-1);f<c;f++)s[f-1]=arguments[f];l.fn.apply(l.context,s)}else for(var u,h=l.length,f=0;f<h;f++)switch(l[f].once&&this.removeListener(t,l[f].fn,void 0,!0),c){case 1:l[f].fn.call(l[f].context);break;case 2:l[f].fn.call(l[f].context,e);break;case 3:l[f].fn.call(l[f].context,e,n);break;case 4:l[f].fn.call(l[f].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[f].fn.apply(l[f].context,s)}return!0},Y.prototype.on=function(t,e,n){return G(this,t,e,n,!1)},Y.prototype.once=function(t,e,n){return G(this,t,e,n,!0)},Y.prototype.removeListener=function(t,e,n,r){t=F?F+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||H(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:H(this,t)}}else H(this,t);return this},Y.prototype.removeAllListeners=function(t){return t?(t=F?F+t:t,this._events[t]&&H(this,t)):(this._events=new z,this._eventsCount=0),this},Y.prototype.off=Y.prototype.removeListener,Y.prototype.addListener=Y.prototype.on,Y.prefixed=F,sn.exports=Y.EventEmitter=Y;var V=n.exports,q=1e-6,$="undefined"!=typeof Float32Array?Float32Array:Array;function U(){var t=new $(9);return $!=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 K=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],h=n[0],f=n[1],d=n[2],p=n[3],g=n[4],y=n[5],m=n[6],v=n[7],n=n[8];return t[0]=h*r+f*o+d*c,t[1]=h*i+f*s+d*u,t[2]=h*a+f*l+d*e,t[3]=p*r+g*o+y*c,t[4]=p*i+g*s+y*u,t[5]=p*a+g*l+y*e,t[6]=m*r+v*o+n*c,t[7]=m*i+v*s+n*u,t[8]=m*a+v*l+n*e,t};function Z(){var t=new $(16);return $!=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 Q(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 J(t,e,n,r,i,a,o,s,l,c,u,h,f,d,p,g,y){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]=h,t[11]=f,t[12]=d,t[13]=p,t[14]=g,t[15]=y,t}function tt(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 et(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 nt(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],h=e[9],f=e[10],d=e[11],p=e[12],g=e[13],y=e[14],e=e[15],m=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-h*p,k=u*y-f*p,E=u*e-d*p,S=h*y-f*g,A=h*e-d*g,_=f*e-d*y,T=m*_-v*A+b*S+x*E-w*k+M*O;return T?(t[0]=(s*_-l*A+c*S)*(T=1/T),t[1]=(i*A-r*_-a*S)*T,t[2]=(g*M-y*w+e*x)*T,t[3]=(f*w-h*M-d*x)*T,t[4]=(l*E-o*_-c*k)*T,t[5]=(n*_-i*E+a*k)*T,t[6]=(y*b-p*M-e*v)*T,t[7]=(u*M-f*b+d*v)*T,t[8]=(o*A-s*E+c*O)*T,t[9]=(r*E-n*A-a*O)*T,t[10]=(p*w-g*b+e*m)*T,t[11]=(h*b-u*w-d*m)*T,t[12]=(s*k-o*S-l*O)*T,t[13]=(n*S-r*k+i*O)*T,t[14]=(g*v-p*x-y*m)*T,t[15]=(u*x-h*v+f*m)*T,t):null}function rt(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],h=t[10],f=t[11],d=t[12],p=t[13],g=t[14],t=t[15];return(e*o-n*a)*(h*t-f*g)-(e*s-r*a)*(u*t-f*p)+(e*l-i*a)*(u*g-h*p)+(n*s-r*o)*(c*t-f*d)-(n*l-i*o)*(c*g-h*d)+(r*l-i*s)*(c*p-u*d)}function lt(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],h=e[8],f=e[9],d=e[10],p=e[11],g=e[12],y=e[13],m=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*h+w*g,t[1]=v*i+b*l+x*f+w*y,t[2]=v*a+b*c+x*d+w*m,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*h+w*g,t[5]=v*i+b*l+x*f+w*y,t[6]=v*a+b*c+x*d+w*m,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*h+w*g,t[9]=v*i+b*l+x*f+w*y,t[10]=v*a+b*c+x*d+w*m,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*h+w*g,t[13]=v*i+b*l+x*f+w*y,t[14]=v*a+b*c+x*d+w*m,t[15]=v*o+b*u+x*p+w*e,t}function ct(t,e,n){var r,i,a,o,s,l,c,u,h,f,d,p,g=n[0],y=n[1],n=n[2];return e===t?(t[12]=e[0]*g+e[4]*y+e[8]*n+e[12],t[13]=e[1]*g+e[5]*y+e[9]*n+e[13],t[14]=e[2]*g+e[6]*y+e[10]*n+e[14],t[15]=e[3]*g+e[7]*y+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],h=e[8],f=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]=h,t[9]=f,t[10]=d,t[11]=p,t[12]=r*g+s*y+h*n+e[12],t[13]=i*g+l*y+f*n+e[13],t[14]=a*g+c*y+d*n+e[14],t[15]=o*g+u*y+p*n+e[15]),t}function ut(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 ht(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],h=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+h*r,t[8]=l*n-i*r,t[9]=c*n-a*r,t[10]=u*n-o*r,t[11]=h*n-s*r,t}function ft(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],h=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-h*r,t[8]=i*r+l*n,t[9]=a*r+c*n,t[10]=o*r+u*n,t[11]=s*r+h*n,t}function dt(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 pt(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}function gt(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,h=i*s,i=i*l,a=a*l,o=e*o,s=e*s,e=e*l;return t[0]=1-(h+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+h),t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t}function yt(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function mt(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 vt(t,e){var n=new $(3),r=(mt(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,h=0;return 0<n?(h=2*Math.sqrt(1+n),t[3]=.25*h,t[0]=(u-i)/h,t[1]=(r-s)/h,t[2]=(o-l)/h):c<a&&e<a?(h=2*Math.sqrt(1+a-c-e),t[3]=(u-i)/h,t[0]=.25*h,t[1]=(o+l)/h,t[2]=(r+s)/h):e<c?(h=2*Math.sqrt(1+c-a-e),t[3]=(r-s)/h,t[0]=(o+l)/h,t[1]=.25*h,t[2]=(u+i)/h):(h=2*Math.sqrt(1+e-a-c),t[3]=(o-l)/h,t[0]=(r+s)/h,t[1]=(u+i)/h,t[2]=.25*h),t}function bt(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,h=a*l,f=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],y=i[1],i=i[2],m=(1-(d+s))*u,v=(f+e)*u,u=(a-c)*u,f=(f-e)*p,e=(1-(h+s))*p,s=(o+l)*p,p=(a+c)*r,a=(o-l)*r,c=(1-(h+d))*r;return t[0]=m,t[1]=v,t[2]=u,t[3]=0,t[4]=f,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-(m*g+f*y+p*i),t[13]=n[1]+y-(v*g+e*y+a*i),t[14]=n[2]+i-(u*g+s*y+c*i),t[15]=1,t}function xt(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 wt(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 Mt(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 Ot=Mt;function kt(t,e,n,r){var i,a,o,s,l=e[0],c=e[1],e=e[2],u=r[0],h=r[1],r=r[2],f=n[0],d=n[1],n=n[2];return Math.abs(l-f)<q&&Math.abs(c-d)<q&&Math.abs(e-n)<q?tt(t):(f=l-f,d=c-d,n=e-n,i=h*(n*=s=1/Math.hypot(f,d,n))-r*(d*=s),r=r*(f*=s)-u*n,u=u*d-h*f,(s=Math.hypot(i,r,u))?(i*=s=1/s,r*=s,u*=s):u=r=i=0,h=d*u-n*r,a=n*i-f*u,o=f*r-d*i,(s=Math.hypot(h,a,o))?(h*=s=1/s,a*=s,o*=s):o=a=h=0,t[0]=i,t[1]=h,t[2]=f,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]=-(h*l+a*c+o*e),t[14]=-(f*l+d*c+n*e),t[15]=1,t)}function Et(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 St=Object.freeze({__proto__:null,create:Z,clone:function(t){var e=new $(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:Q,fromValues:function(t,e,n,r,i,a,o,s,l,c,u,h,f,d,p,g){var y=new $(16);return y[0]=t,y[1]=e,y[2]=n,y[3]=r,y[4]=i,y[5]=a,y[6]=o,y[7]=s,y[8]=l,y[9]=c,y[10]=u,y[11]=h,y[12]=f,y[13]=d,y[14]=p,y[15]=g,y},set:J,identity:tt,transpose:et,invert:nt,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],h=e[9],f=e[10],d=e[11],p=e[12],g=e[13],y=e[14],e=e[15];return t[0]=s*(f*e-d*y)-h*(l*e-c*y)+g*(l*d-c*f),t[1]=-(r*(f*e-d*y)-h*(i*e-a*y)+g*(i*d-a*f)),t[2]=r*(l*e-c*y)-s*(i*e-a*y)+g*(i*c-a*l),t[3]=-(r*(l*d-c*f)-s*(i*d-a*f)+h*(i*c-a*l)),t[4]=-(o*(f*e-d*y)-u*(l*e-c*y)+p*(l*d-c*f)),t[5]=n*(f*e-d*y)-u*(i*e-a*y)+p*(i*d-a*f),t[6]=-(n*(l*e-c*y)-o*(i*e-a*y)+p*(i*c-a*l)),t[7]=n*(l*d-c*f)-o*(i*d-a*f)+u*(i*c-a*l),t[8]=o*(h*e-d*g)-u*(s*e-c*g)+p*(s*d-c*h),t[9]=-(n*(h*e-d*g)-u*(r*e-a*g)+p*(r*d-a*h)),t[10]=n*(s*e-c*g)-o*(r*e-a*g)+p*(r*c-a*s),t[11]=-(n*(s*d-c*h)-o*(r*d-a*h)+u*(r*c-a*s)),t[12]=-(o*(h*y-f*g)-u*(s*y-l*g)+p*(s*f-l*h)),t[13]=n*(h*y-f*g)-u*(r*y-i*g)+p*(r*f-i*h),t[14]=-(n*(s*y-l*g)-o*(r*y-i*g)+p*(r*l-i*s)),t[15]=n*(s*f-l*h)-o*(r*f-i*h)+u*(r*l-i*s),t},determinant:rt,multiply:lt,translate:ct,scale:ut,rotate:function(t,e,n,r){var i,a,o,s,l,c,u,h,f,d,p,g,y,m,v,b,x,w,M,O,k=r[0],E=r[1],r=r[2],S=Math.hypot(k,E,r);return S<q?null:(k*=S=1/S,E*=S,r*=S,S=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],h=e[6],f=e[7],d=e[8],p=e[9],g=e[10],y=e[11],v=k*E*(i=1-n)-r*S,b=E*E*i+n,x=r*E*i+k*S,w=k*r*i+E*S,M=E*r*i-k*S,O=r*r*i+n,t[0]=a*(n=k*k*i+n)+c*(m=E*k*i+r*S)+d*(r=r*k*i-E*S),t[1]=o*n+u*m+p*r,t[2]=s*n+h*m+g*r,t[3]=l*n+f*m+y*r,t[4]=a*v+c*b+d*x,t[5]=o*v+u*b+p*x,t[6]=s*v+h*b+g*x,t[7]=l*v+f*b+y*x,t[8]=a*w+c*M+d*O,t[9]=o*w+u*M+p*O,t[10]=s*w+h*M+g*O,t[11]=l*w+f*M+y*O,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)},rotateX:ht,rotateY:ft,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],h=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+h*r,t[4]=l*n-i*r,t[5]=c*n-a*r,t[6]=u*n-o*r,t[7]=h*n-s*r,t},fromTranslation:dt,fromScaling:pt,fromRotation:function(t,e,n){var r,i=n[0],a=n[1],n=n[2],o=Math.hypot(i,a,n);return o<q?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:gt,fromQuat2:function(t,e){var n=new $(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],h=r*r+i*i+a*a+o*o;return 0<h?(n[0]=2*(s*o+u*r+l*a-c*i)/h,n[1]=2*(l*o+u*i+c*r-s*a)/h,n[2]=2*(c*o+u*a+s*i-l*r)/h):(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)),gt(t,e,n),t},getTranslation:yt,getScaling:mt,getRotation:vt,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*(h=a+a),i=i*(f=o+o),c=a*h,a=a*f,o=o*f,u=e*u,h=e*h,e=e*f,f=r[0],d=r[1],r=r[2];return t[0]=(1-(c+o))*f,t[1]=(l+e)*f,t[2]=(i-h)*f,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+h)*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:bt,fromQuat:xt,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:wt,perspective:wt,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:Mt,ortho:Ot,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:kt,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,h=(0<u&&(l*=u=1/Math.sqrt(u),c*=u,n*=u),s*n-r*c);return 0<(u=h*h+(r=r*l-o*n)*r+(o=o*c-s*l)*o)&&(h*=u=1/Math.sqrt(u),r*=u,o*=u),t[0]=h,t[1]=r,t[2]=o,t[3]=0,t[4]=c*o-n*r,t[5]=n*h-l*o,t[6]=l*r-c*h,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:Et,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],h=t[9],f=t[10],d=t[11],p=t[12],g=t[13],y=t[14],t=t[15],m=e[0],v=e[1],b=e[2],x=e[3],w=e[4],M=e[5],O=e[6],k=e[7],E=e[8],S=e[9],A=e[10],_=e[11],T=e[12],P=e[13],L=e[14],e=e[15];return Math.abs(n-m)<=q*Math.max(1,Math.abs(n),Math.abs(m))&&Math.abs(r-v)<=q*Math.max(1,Math.abs(r),Math.abs(v))&&Math.abs(i-b)<=q*Math.max(1,Math.abs(i),Math.abs(b))&&Math.abs(a-x)<=q*Math.max(1,Math.abs(a),Math.abs(x))&&Math.abs(o-w)<=q*Math.max(1,Math.abs(o),Math.abs(w))&&Math.abs(s-M)<=q*Math.max(1,Math.abs(s),Math.abs(M))&&Math.abs(l-O)<=q*Math.max(1,Math.abs(l),Math.abs(O))&&Math.abs(c-k)<=q*Math.max(1,Math.abs(c),Math.abs(k))&&Math.abs(u-E)<=q*Math.max(1,Math.abs(u),Math.abs(E))&&Math.abs(h-S)<=q*Math.max(1,Math.abs(h),Math.abs(S))&&Math.abs(f-A)<=q*Math.max(1,Math.abs(f),Math.abs(A))&&Math.abs(d-_)<=q*Math.max(1,Math.abs(d),Math.abs(_))&&Math.abs(p-T)<=q*Math.max(1,Math.abs(p),Math.abs(T))&&Math.abs(g-P)<=q*Math.max(1,Math.abs(g),Math.abs(P))&&Math.abs(y-L)<=q*Math.max(1,Math.abs(y),Math.abs(L))&&Math.abs(t-e)<=q*Math.max(1,Math.abs(t),Math.abs(e))},mul:lt,sub:Et});function At(){var t=new $(3);return $!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function _t(t){var e=t[0],n=t[1],t=t[2];return Math.hypot(e,n,t)}function Tt(t,e,n){var r=new $(3);return r[0]=t,r[1]=e,r[2]=n,r}function Pt(t,e){t[0]=e[0],t[1]=e[1],t[2]=e[2]}function Lt(t,e,n,r){return t[0]=e,t[1]=n,t[2]=r,t}function Ct(t,e,n){t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2]}function Nt(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function jt(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 Rt(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function It(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 Bt(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 Dt(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 Ft(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)<=q*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(r-a)<=q*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(t-e)<=q*Math.max(1,Math.abs(t),Math.abs(e))}var zt=_t;function Wt(){var t=new $(4);return $!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function Gt(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 Ht(){var t=new $(4);return $!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function Yt(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 Vt(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 qt(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 $t(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}At(),Wt();var Ut=function(t,e,n,r){var i=new $(4);return i[0]=t,i[1]=e,i[2]=n,i[3]=r,i},Xt=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},Kt=Vt,Zt=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 Qt(t){return t.map(function(t){return Array.isArray(t)?[].concat(t):t})}At(),Tt(1,0,0),Tt(0,1,0),Ht(),Ht(),U(),sn=new $(2),$!=Float32Array&&(sn[0]=0,sn[1]=0);var Jt={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null};var te={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function ee(t){return Array.isArray(t)&&t.every(function(t){var e=t[0].toLowerCase();return te[e]===t.length-1&&"achlmqstvz".includes(e)})}function ne(t){return ee(t)&&t.every(function(t){t=t[0];return t===t.toUpperCase()})}function re(t){return ne(t)&&t.every(function(t){t=t[0];return"ACLMQZ".includes(t)})}function ie(t){for(var e=t.pathValue[t.segmentStart],n=e.toLowerCase(),r=t.data;r.length>=te[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,te[n]))),te[n]););}function ae(t){return 48<=t&&t<=57}function oe(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 se(t){var e,n,r,i,a,o=t.max,s=t.pathValue,l=t.index,c=s.charCodeAt(l),u=te[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,oe(t),t.data=[],u)for(;;){for(var h=u;0<h;--h){if(97!=(32|c)||3!==h&&4!==h?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(ae(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&&ae(n))return t.err="[path-util]: Invalid path value at index "+a+', "'+i[a]+'" illegal number';for(;o<r&&ae(i.charCodeAt(o));)o+=1,s=!0;n=i.charCodeAt(o)}if(46===n){for(c=!0,o+=1;ae(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&&ae(i.charCodeAt(o))))return t.err="[path-util]: Invalid path value at index "+o+', "'+i[o]+'" invalid integer exponent';for(;o<r&&ae(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),oe(t),t.index<o&&44===s.charCodeAt(t.index)&&(t.index+=1,oe(t))}if(t.index>=t.max)break;if(!(48<=(e=s.charCodeAt(t.index))&&e<=57||43===e||45===e||46===e))break}ie(t)}else t.err='[path-util]: Invalid path value "'+s[l]+'" is not a path command'}var le=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 ce(t){var o,s,l,c;return ne(t)?Qt(t):(t=function(t){if(ee(t))return Qt(t);var e=new le(t);for(oe(e);e.index<e.max&&!e.err.length;)se(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 ue(t){if(re(t))return Qt(t);for(var e,n,r,i,a,o,s,l=ce(t),c=m({},Jt),u=0;u<l.length;u+=1){l[u]=(e=l[u],n=c,s=o=f=a=h=i=r=void 0,r=e[0],i=n.x1,h=n.y1,a=n.x2,f=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],h]:"V"===r?s=["L",i,e[1]]:"S"===r?(e=2*h-f,s=["C",n.x1=2*i-a,n.y1=e].concat(o)):"T"===r?(f=2*i-n.qx,a=2*h-n.qy,s=["Q",n.qx=f,n.qy=a].concat(o)):"Q"===r&&(e=o[0],i=o[1],n.qx=e,n.qy=i),s);var h=l[u],f=h.length;c.x1=+h[f-2],c.y1=+h[f-1],c.x2=+h[f-4]||c.x1,c.y2=+h[f-3]||c.y1}return l}function he(t,e,n){return{x:t*Math.cos(n)-e*Math.sin(n),y:t*Math.sin(n)+e*Math.cos(n)}}function fe(t,e,n,r,i,a,o,s,l,c){var u=120*Math.PI/180,h=Math.PI/180*(+i||0),f=[],d=(c?(b=c[0],x=c[1],m=c[2],v=c[3]):(t=(g=he(t,e,-h)).x,e=g.y,1<(d=(p=(t-(s=(g=he(s,l,-h)).x))/2)*p/(n*n)+(g=(e-(l=g.y))/2)*g/(r*r))&&(n*=d=Math.sqrt(d),r*=d),d=n*n,y=r*r,m=(a=(a===o?-1:1)*Math.sqrt(Math.abs((d*y-d*g*g-y*p*p)/(d*g*g+y*p*p))))*n*g/r+(t+s)/2,v=a*-r*p/n+(e+l)/2,b=Math.asin(((e-v)/r*Math.pow(10,9)>>0)/Math.pow(10,9)),x=Math.asin(((l-v)/r*Math.pow(10,9)>>0)/Math.pow(10,9)),b=t<m?Math.PI-b:b,x=s<m?Math.PI-x:x,b<0&&(b=2*Math.PI+b),x<0&&(x=2*Math.PI+x),o&&x<b&&(b-=2*Math.PI),!o&&b<x&&(x-=2*Math.PI)),x-b),p=(Math.abs(d)>u&&(y=x,g=s,a=l,x=b+u*(o&&b<x?1:-1),f=fe(s=m+n*Math.cos(x),l=v+r*Math.sin(x),n,r,i,0,o,g,a,[x,y,m,v])),d=x-b,Math.cos(b)),u=Math.sin(b),i=Math.cos(x),o=Math.sin(x),g=Math.tan(d/4),a=4/3*n*g,y=4/3*r*g,m=[t,e],v=[t+a*u,e-y*p],b=[s+a*o,l-y*i],x=[s,l];if(v[0]=2*m[0]-v[0],v[1]=2*m[1]-v[1],c)return v.concat(b,x,f);for(var w=[],M=0,O=(f=v.concat(b,x,f)).length;M<O;M+=1)w[M]=M%2?he(f[M-1],f[M],h).y:he(f[M],f[M+1],h).x;return w}function de(t,e,n){var r=t[0],t=t[1];return[r+(e[0]-r)*n,t+(e[1]-t)*n]}function pe(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}function ge(t,e,n,r,i){var a=pe([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=de([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 ye(t,e,n,r){var t=[t,e],e=[n,r],i=de(t,e,.5),e=de(e,i,.5),a=de(i,e,.5),o=de(e,a,.5),s=de(a,o,.5),t=ge(t[0],t[1],i[0],i[1],a[0]).point,i=ge(s[0],s[1],o[0],o[1],e[0]).point;return[t.x,t.y,i.x,i.y,n,r]}function me(t,e){var n;if(void 0===e&&(e=!1),re(n=t)&&n.every(function(t){t=t[0];return"MC".includes(t)}))return n=Qt(t),e?[n,[]]:n;for(var r,i=ue(t),a=m({},Jt),o=[],s="",l=i.length,c=[],u=0;u<l;u+=1){i[u]&&(s=i[u][0]),o[u]=s;var h=function(t,e){var n,r,i,a,o,s,l=t[0],c=t.slice(1).map(Number),u=c[0],h=c[1],f=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=h,t;case"A":return s=[f,d].concat(c),["C"].concat(fe(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=h,s=[f,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(ye(f,d,u,h));case"Z":return f===p&&d===g?["C",f,d,p,g,p,g]:["C"].concat(ye(f,d,p,g))}return t}(i[u],a),f=(i[u]=h,y=g=p=d=f=void 0,i),d=o,p=u;if(7<f[p].length){f[p].shift();for(var g=f[p],y=p;g.length;)d[p]="A",f.splice(y+=1,0,["C"].concat(g.splice(0,6)));f.splice(p,1)}l=i.length,"Z"===s&&c.push(u),r=(h=i[u]).length,a.x1=+h[r-2],a.y1=+h[r-1],a.x2=+h[r-4]||a.x1,a.y2=+h[r-3]||a.y1}return e?[i,c]:i}function ve(t,e){var n=t.x,t=t.y,r=e.x,e=e.y,i=n*r+t*e,a=Math.sqrt((Math.pow(n,2)+Math.pow(t,2))*(Math.pow(r,2)+Math.pow(e,2)));return(n*e-t*r<0?-1:1)*Math.acos(i/a)}function be(t,e,n,r,i,I,B,a,o,s,l){var c=l.bbox,D=void 0===c||c,c=l.length,F=void 0===c||c,c=l.sampleSize,u=void 0===c?30:c,h="number"==typeof s,f=t,d=e,p=0,g=[f,d,p],y=[f,d],m={x:0,y:0},v=[{x:f,y:d}];h&&s<=0&&(m={x:f,y:d});for(var b,x,w,M,O,k,E,S,A,_,T,P,L,C,N,j,R=0;R<=u;R+=1)b=t,x=e,w=n,M=r,O=i,k=I,E=B,S=a,A=o,_=R/u,P=j=N=C=L=P=T=void 0,P=Math.abs,L=Math.sin,C=Math.cos,N=Math.sqrt,j=Math.PI,w=P(w),P=P(M),M=j/180*((O%360+360)%360),f=(T=b===S&&x===A?{x:b,y:x}:0===w||0===P?ge(b,x,S,A,_).point:(O=(b-S)/2,T=(x-A)/2,O={x:C(M)*O+L(M)*T,y:-L(M)*O+C(M)*T},1<(T=Math.pow(O.x,2)/Math.pow(w,2)+Math.pow(O.y,2)/Math.pow(P,2))&&(w*=N(T),P*=N(T)),T=(Math.pow(w,2)*Math.pow(P,2)-Math.pow(w,2)*Math.pow(O.y,2)-Math.pow(P,2)*Math.pow(O.x,2))/(Math.pow(w,2)*Math.pow(O.y,2)+Math.pow(P,2)*Math.pow(O.x,2)),k=(k!==E?1:-1)*N(T<0?0:T),N=w*O.y/P*k,T=-P*O.x/w*k,k=C(M)*N-L(M)*T+(b+S)/2,b=L(M)*N+C(M)*T+(x+A)/2,x=ve({x:1,y:0},S={x:(O.x-N)/w,y:(O.y-T)/P}),A=ve(S,{x:(-O.x-N)/w,y:(-O.y-T)/P}),!E&&0<A?A-=2*j:E&&A<0&&(A+=2*j),S=x+(A%=2*j)*_,N=w*C(S),O=P*L(S),{x:C(M)*N-L(M)*O+k,y:L(M)*N+C(M)*O+b})).x,d=T.y,D&&v.push({x:f,y:d}),F&&(p+=pe(y,[f,d])),y=[f,d],h&&s<=p&&s>g[2]&&(E=(p-s)/(p-g[2]),m={x:y[0]*(1-E)+g[0]*E,y:y[1]*(1-E)+g[1]*E}),g=[f,d,p];return{length:p,point:m=h&&p<=s?{x:a,y:o}:m,min:{x:Math.min.apply(null,v.map(function(t){return t.x})),y:Math.min.apply(null,v.map(function(t){return t.y}))},max:{x:Math.max.apply(null,v.map(function(t){return t.x})),y:Math.max.apply(null,v.map(function(t){return t.y}))}}}function xe(t,e,n,r,i,a,o,s,l,c){var u=c.bbox,h=void 0===u||u,u=c.length,f=void 0===u||u,u=c.sampleSize,d=void 0===u?10:u,p="number"==typeof l,g=t,y=e,m=0,v=[g,y,m],b=[g,y],x={x:0,y:0},w=[{x:g,y:y}];p&&l<=0&&(x={x:g,y:y});for(var M,O,k,E,S,A,_,T,P,L,C=0;C<=d;C+=1)M=t,O=e,k=n,E=r,S=i,A=a,_=o,T=s,L=void 0,L=1-(P=C/d),g=(M={x:Math.pow(L,3)*M+3*Math.pow(L,2)*P*k+3*L*Math.pow(P,2)*S+Math.pow(P,3)*_,y:Math.pow(L,3)*O+3*Math.pow(L,2)*P*E+3*L*Math.pow(P,2)*A+Math.pow(P,3)*T}).x,y=M.y,h&&w.push({x:g,y:y}),f&&(m+=pe(b,[g,y])),b=[g,y],p&&l<=m&&l>v[2]&&(k=(m-l)/(m-v[2]),x={x:b[0]*(1-k)+v[0]*k,y:b[1]*(1-k)+v[1]*k}),v=[g,y,m];return{length:m,point:x=p&&m<=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 we(t,e,n,r,i,a,o,s){var l=s.bbox,c=void 0===l||l,l=s.length,u=void 0===l||l,l=s.sampleSize,h=void 0===l?10:l,f="number"==typeof o,d=t,p=e,g=0,y=[d,p,g],m=[d,p],v={x:0,y:0},b=[{x:d,y:p}];f&&o<=0&&(v={x:d,y:p});for(var x,w,M,O,k,E,S,A,_=0;_<=h;_+=1)x=t,w=e,M=n,O=r,k=i,E=a,A=void 0,A=1-(S=_/h),d=(x={x:Math.pow(A,2)*x+2*A*S*M+Math.pow(S,2)*k,y:Math.pow(A,2)*w+2*A*S*O+Math.pow(S,2)*E}).x,p=x.y,c&&b.push({x:d,y:p}),u&&(g+=pe(m,[d,p])),m=[d,p],f&&o<=g&&o>y[2]&&(M=(g-o)/(g-y[2]),v={x:m[0]*(1-M)+y[0]*M,y:m[1]*(1-M)+y[1]*M}),y=[d,p,g];return{length:g,point:v=f&&g<=o?{x:i,y:a}:v,min:{x:Math.min.apply(null,b.map(function(t){return t.x})),y:Math.min.apply(null,b.map(function(t){return t.y}))},max:{x:Math.max.apply(null,b.map(function(t){return t.x})),y:Math.max.apply(null,b.map(function(t){return t.y}))}}}function Me(t,e,n){for(var r,i,a,o=ue(t),s="number"==typeof e,l=[],c=0,u=0,h=0,f=0,d=[],p=[],g=0,y={x:0,y:0},m=y,v=y,b=y,x=0,w=0,M=o.length;w<M;w+=1)l=(r="M"===(i=(a=o[w])[0]))?l:[c,u].concat(a.slice(1)),r?(m=y={x:h=a[1],y:f=a[2]},g=0,s&&e<.001&&(b=y)):"L"===i?(g=(r=ge(l[0],l[1],l[2],l[3],(e||0)-x)).length,y=r.min,m=r.max,v=r.point):"A"===i?(g=(r=be(l[0],l[1],l[2],l[3],l[4],l[5],l[6],l[7],l[8],(e||0)-x,n||{})).length,y=r.min,m=r.max,v=r.point):"C"===i?(g=(r=xe(l[0],l[1],l[2],l[3],l[4],l[5],l[6],l[7],(e||0)-x,n||{})).length,y=r.min,m=r.max,v=r.point):"Q"===i?(g=(r=we(l[0],l[1],l[2],l[3],l[4],l[5],(e||0)-x,n||{})).length,y=r.min,m=r.max,v=r.point):"Z"===i&&(g=(r=ge((l=[c,u,h,f])[0],l[1],l[2],l[3],(e||0)-x)).length,y=r.min,m=r.max,v=r.point),s&&x<e&&e<=x+g&&(b=v),p.push(m),d.push(y),x+=g,c=(r="Z"!==i?a.slice(-2):[h,f])[0],u=r[1];return{length:x,point:b=s&&x<=e?{x:c,y:u}:b,min:{x:Math.min.apply(null,d.map(function(t){return t.x})),y:Math.min.apply(null,d.map(function(t){return t.y}))},max:{x:Math.max.apply(null,p.map(function(t){return t.x})),y:Math.max.apply(null,p.map(function(t){return t.y}))}}}function Oe(t){return(c=l=s=0)<=me(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 ke(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?xe(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=de(n,i,r),i=de(i,a,r),a=de(a,e,r),o=de(n,i,r),i=de(i,a,r),r=de(o,i,r),[["C"].concat(n,o,r),["C"].concat(i,a,e)]):[t,t]:[t];return{s:t,ss:n,l:s}})}var Ee=function(t){return null!==t&&"function"!=typeof t&&isFinite(t.length)},Se=function(t){return"function"==typeof t},A=function(t){return null==t},Ae={}.toString,_e=function(t,e){return Ae.call(t)==="[object "+e+"]"},Te=function(t){return Array.isArray?Array.isArray(t):_e(t,"Array")},Pe=function(t){var e=typeof t;return null!==t&&"object"==e||"function"==e};var Le=function(t){return"object"==typeof t&&null!==t},Ce=function(t){if(!Le(t)||!_e(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},Ne=function(t){if(Te(t))return t.reduce(function(t,e){return Math.max(t,e)},t[0])},je=function(t){if(Te(t))return t.reduce(function(t,e){return Math.min(t,e)},t[0])},Re=function(t,n,e){if(!Te(t)&&!Ce(t))return t;var r=e,i=t,a=function(t,e){r=n(r,t,e)};if(i)if(Te(i))for(var o=0,s=i.length;o<s&&!1!==a(i[o],o);o++);else if(Pe(i))for(var l in i)if(i.hasOwnProperty(l)&&!1===a(i[l],l))break;return r},Ie=function(t){return _e(t,"String")};var Be=function(t,e,n){return t<e?e:n<t?n:t},De=function(t){return _e(t,"Number")};function Fe(t,e,n){return void 0===n&&(n=1e-5),Math.abs(t-e)<n}function ze(t){return A(t)?"":t.toString()}var We=function(t,e){return(t%e+e)%e},Ge=function(t){t=ze(t);return t.charAt(0).toLowerCase()+t.substring(1)};function He(t){if("object"!=typeof t||null===t)return t;if(Te(t))for(var e=[],n=0,r=t.length;n<r;n++)"object"==typeof t[n]&&null!=t[n]?e[n]=He(t[n]):e[n]=t[n];else for(var i in e={},t)"object"==typeof t[i]&&null!=t[i]?e[i]=He(t[i]):e[i]=t[i];return e}var Ye=function(t){t=ze(t);return t.charAt(0).toUpperCase()+t.substring(1)},Ve=function(t){return _e(t,"Boolean")},qe=function(t){return void 0===t},$e=He;function Ue(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 Xe(a,o){var s;if(Se(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 Ke=5;function Ze(t,e){if(t===e)return!0;if(t&&e&&!Ie(t)&&!Ie(e)){if(Ee(t)||Ee(e)){if(t.length!==e.length)return!1;for(var n=!0,r=0;r<t.length&&(n=Ze(t[r],e[r]));r++);return n}if(Le(t)||Le(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=Ze(t[i[r]],e[i[r]]));r++);return n}}return!1}function Qe(t,r){return Re(t,function(t,e,n){return r.includes(n)||(t[n]=e),t},{})}function Je(){}var ot=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||Ke,n){var o;n.hasOwnProperty(a)&&(null!==(o=n[a])&&Ce(o)?(Ce(e[a])||(e[a]={}),r<i?t(e[a],o,r+1,i):e[a]=n[a]):Te(o)?(e[a]=[],e[a]=e[a].concat(o)):void 0!==o&&(e[a]=o))}}(t,e[r]);return t},tn=Ze,en=function(t,e,n){for(var r=0,i=Ie(e)?e.split("."):e;t&&r<i.length;)t=t[i[r++]];return void 0===t||r<i.length?n:t},nn=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 rn(t,e,n){(t.prototype=e.prototype=n).constructor=t}function an(t,e){var n,r=Object.create(t.prototype);for(n in e)r[n]=e[n];return r}function on(){}var n="\\s*([+-]?\\d+)\\s*",sn="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",ln="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",cn=/^#([0-9a-f]{3,8})$/,un=new RegExp("^rgb\\("+[n,n,n]+"\\)$"),hn=new RegExp("^rgb\\("+[ln,ln,ln]+"\\)$"),fn=new RegExp("^rgba\\("+[n,n,n,sn]+"\\)$"),dn=new RegExp("^rgba\\("+[ln,ln,ln,sn]+"\\)$"),pn=new RegExp("^hsl\\("+[sn,ln,ln]+"\\)$"),gn=new RegExp("^hsla\\("+[sn,ln,ln,sn]+"\\)$"),yn={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 vn(){return this.rgb().formatRgb()}function bn(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=cn.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?xn(e):3===n?new Mn(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?wn(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?wn(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=un.exec(t))?new Mn(e[1],e[2],e[3],1):(e=hn.exec(t))?new Mn(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=fn.exec(t))?wn(e[1],e[2],e[3],e[4]):(e=dn.exec(t))?wn(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=pn.exec(t))?Sn(e[1],e[2]/100,e[3]/100,1):(e=gn.exec(t))?Sn(e[1],e[2]/100,e[3]/100,e[4]):yn.hasOwnProperty(t)?xn(yn[t]):"transparent"===t?new Mn(NaN,NaN,NaN,0):null}function xn(t){return new Mn(t>>16&255,t>>8&255,255&t,1)}function wn(t,e,n,r){return new Mn(t=r<=0?e=n=NaN:t,e,n,r)}function Mn(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function On(){return"#"+En(this.r)+En(this.g)+En(this.b)}function kn(){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 En(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function Sn(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||1<=n?t=e=NaN:e<=0&&(t=NaN),new _n(t,e,n,r)}function An(t){var e,n,r,i,a,o,s,l;return t instanceof _n?new _n(t.h,t.s,t.l,t.opacity):(t=t instanceof on?t:bn(t))?t instanceof _n?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 _n(o,s,l,t.opacity)):new _n}function _n(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function Tn(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 Pn(t,e,n,r){t-=n,n=e-r;return Math.sqrt(t*t+n*n)}function Ln(t,e){var n=Math.min.apply(Math,M([],j(t),!1)),r=Math.min.apply(Math,M([],j(e),!1));return{x:n,y:r,width:Math.max.apply(Math,M([],j(t),!1))-n,height:Math.max.apply(Math,M([],j(e),!1))-r}}function Cn(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],h=2*-Math.PI;h<=2*Math.PI;h+=Math.PI){var f=s+h;a<o?a<f&&f<o&&u.push(f):o<f&&f<a&&u.push(f)}for(var d,p,g,h=0;h<u.length;h++){d=t,y=r,p=i,g=u[h];var y=n*Math.cos(p)*Math.cos(g)-y*Math.sin(p)*Math.sin(g)+d;y<l&&(l=y),c<y&&(c=y)}for(var m=Math.atan(r/(n*Math.tan(i))),v=1/0,b=-1/0,x=[a,o],h=2*-Math.PI;h<=2*Math.PI;h+=Math.PI){var w=m+h;a<o?a<w&&w<o&&x.push(w):o<w&&w<a&&x.push(w)}for(var M,O,k,h=0;h<x.length;h++){M=e,E=r,O=i,k=x[h];var E=n*Math.sin(O)*Math.cos(k)+E*Math.cos(O)*Math.sin(k)+M;E<v&&(v=E),b<E&&(b=E)}return{x:l,y:v,width:c-l,height:b-v}}function Nn(t,e,n,r){return Pn(t,e,n,r)}function jn(t,e,n,r,i){return{x:(1-i)*t+i*n,y:(1-i)*e+i*r}}function Rn(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]))}function In(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 Bn(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 Fe(r,0)?Fe(n,0)||0<=(i=-e/n)&&i<=1&&t.push(i):Fe(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 Dn(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 Pn(t.x,t.y,l,c)}function Fn(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+=Pn(i[0],i[1],a[0],a[1])}return n}function zn(t,e,n,r){var i=1-r;return i*i*t+2*r*i*e+r*r*n}function Wn(t,e,n){n=t+n-2*e;return Fe(n,0)?[.5]:(t=(t-e)/n)<=1&&0<=t?[t]:[]}rn(on,bn,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:mn,formatHex:mn,formatHsl:function(){return An(this).formatHsl()},formatRgb:vn,toString:vn}),rn(Mn,function(t,e,n,r){return 1===arguments.length?(i=(i=t)instanceof on?i:bn(i))?new Mn((i=i.rgb()).r,i.g,i.b,i.opacity):new Mn:new Mn(t,e,n,null==r?1:r);var i},an(on,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new Mn(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new Mn(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:On,formatHex:On,formatRgb:kn,toString:kn})),rn(_n,function(t,e,n,r){return 1===arguments.length?An(t):new _n(t,e,n,null==r?1:r)},an(on,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new _n(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new _n(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 Mn(Tn(240<=t?t-240:120+t,n,e),Tn(t,n,e),Tn(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+")")}}));function Gn(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,h=e[n],f=r,d=i;for(Hn(e,r,n),0<a(e[i],h)&&Hn(e,r,i);f<d;){for(Hn(e,f,d),f++,d--;a(e[f],h)<0;)f++;for(;0<a(e[d],h);)d--}0===a(e[r],h)?Hn(e,r,d):Hn(e,++d,i),d<=n&&(r=d+1),n<=d&&(i=d-1)}}(t,e,n||0,r||t.length-1,i||Yn)}function Hn(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function Yn(t,e){return t<e?-1:e<t?1:0}function Vn(t,e){qn(t,0,t.children.length,e,t)}function qn(t,e,n,r,i){(i=i||tr(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];$n(i,t.leaf?r(o):o)}return i}function $n(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 Un(t,e){return t.minX-e.minX}function Xn(t,e){return t.minY-e.minY}function Kn(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function Zn(t){return t.maxX-t.minX+(t.maxY-t.minY)}function Qn(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function Jn(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function tr(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function er(t,e,n,r,i){for(var a,o=[e,n];o.length;)(n=o.pop())-(e=o.pop())<=r||(Gn(t,a=e+Math.ceil((n-e)/r/2)*r,e,n,i),o.push(e,a,a,n))}(n=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,[])},n.prototype.search=function(t){var e=this.data,n=[];if(Jn(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;Jn(t,s)&&(e.leaf?n.push(o):Qn(t,s)?this._all(o,n):i.push(o))}e=i.pop()}return n},n.prototype.collides=function(t){var e=this.data;if(Jn(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(Jn(t,a)){if(e.leaf||Qn(t,a))return!0;n.push(i)}}e=n.pop()}return!1},n.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},n.prototype.insert=function(t){return t&&this._insert(t,this.data.height-1),this},n.prototype.clear=function(){return this.data=tr([]),this},n.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||!Qn(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},n.prototype.toBBox=function(t){return t},n.prototype.compareMinX=function(t,e){return t.minX-e.minX},n.prototype.compareMinY=function(t,e){return t.minY-e.minY},n.prototype.toJSON=function(){return this.data},n.prototype.fromJSON=function(t){return this.data=t,this},n.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},n.prototype._build=function(t,e,n,r){var i,a=n-e+1,o=this._maxEntries;if(a<=o)Vn(i=tr(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=tr([])).leaf=!1,i.height=r;var s=Math.ceil(a/o),l=s*Math.ceil(Math.sqrt(o));er(t,e,n,l,this.compareMinX);for(var c=e;c<=n;c+=l){var u=Math.min(c+l-1,n);er(t,c,u,s,this.compareMinY);for(var h=c;h<=u;h+=s){var f=Math.min(h+s-1,u);i.children.push(this._build(t,h,f,r-1))}}Vn(i,this.toBBox)}return i},n.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=Kn(l),u=(h=t,u=l,(Math.max(u.maxX,h.maxX)-Math.min(u.minX,h.minX))*(Math.max(u.maxY,h.maxY)-Math.min(u.minY,h.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 h,u;return e},n.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),$n(i,n);0<=e&&r[e].children.length>this._maxEntries;)this._split(r,e),e--;this._adjustParentBBoxes(n,r,e)},n.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=tr(n.children.splice(i,n.children.length-i));r.height=n.height,r.leaf=n.leaf,Vn(n,this.toBBox),Vn(r,this.toBBox),e?t[e-1].children.push(r):this._splitRoot(n,r)},n.prototype._splitRoot=function(t,e){this.data=tr([t,e]),this.data.height=t.height+1,this.data.leaf=!1,Vn(this.data,this.toBBox)},n.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=qn(t,0,c,this.toBBox),h=qn(t,c,n,this.toBBox),f=(i=u,f=h,d=o=a=void 0,a=Math.max(i.minX,f.minX),o=Math.max(i.minY,f.minY),d=Math.min(i.maxX,f.maxX),i=Math.min(i.maxY,f.maxY),Math.max(0,d-a)*Math.max(0,i-o)),d=Kn(u)+Kn(h);f<s?(s=f,r=c,l=d<l?d:l):f===s&&d<l&&(l=d,r=c)}return r||n-e},n.prototype._chooseSplitAxis=function(t,e,n){var r=t.leaf?this.compareMinX:Un,i=t.leaf?this.compareMinY:Xn;this._allDistMargin(t,e,n,r)<this._allDistMargin(t,e,n,i)&&t.children.sort(r)},n.prototype._allDistMargin=function(t,e,n,r){t.children.sort(r);for(var i=this.toBBox,a=qn(t,0,e,i),o=qn(t,n-e,n,i),s=Zn(a)+Zn(o),l=e;l<n-e;l++){var c=t.children[l];$n(a,t.leaf?i(c):c),s+=Zn(a)}for(var u=n-e-1;e<=u;u--){var h=t.children[u];$n(o,t.leaf?i(h):h),s+=Zn(o)}return s},n.prototype._adjustParentBBoxes=function(t,e,n){for(var r=n;0<=r;r--)$n(e[r],t)},n.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():Vn(t[e],this.toBBox)};var nr=n,ln=(rr.prototype.addRenderingPlugin=function(t){this.plugins.push(t),this.context.renderingPlugins.push(t)},rr.prototype.removeAllRenderingPlugins=function(){var e=this;this.plugins.forEach(function(t){t=e.context.renderingPlugins.indexOf(t);0<=t&&e.context.renderingPlugins.splice(t,1)})},rr);function rr(){this.plugins=[]}ir.prototype.registerPlugin=function(e){-1===this.plugins.findIndex(function(t){return t===e})&&this.plugins.push(e)},ir.prototype.unregisterPlugin=function(e){var t=this.plugins.findIndex(function(t){return t===e});-1<t&&this.plugins.splice(t,1)},ir.prototype.getPlugins=function(){return this.plugins},ir.prototype.getPlugin=function(e){return this.plugins.find(function(t){return t.name===e})},ir.prototype.getConfig=function(){return this.config},ir.prototype.setConfig=function(t){Object.assign(this.config,t)};sn=ir;function ir(t){this.plugins=[],this.config=m({enableDirtyCheck:!0,enableCulling:!1,enableAutoRendering:!0,enableDirtyRectangleRendering:!0,enableDirtyRectangleRenderingDebug:!1},t)}function ar(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function or(t,e,n){t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2]}function sr(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function lr(t,e,n){t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n}function cr(t){return void 0===t?0:360<t||t<-360?t%360:t}function ur(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 $(3))[0]=r[0],i[1]=r[1],i[2]=r[2],i):De(t)?Tt(t,e,n):Tt(t[0],t[1]||e,t[2]||n)}function hr(t){return t*(Math.PI/180)}function fr(t){return t*(180/Math.PI)}function dr(t,e){return 16===e.length?(n=t,r=e,o=.5*Math.PI,s=(c=j(mt(At(),r),3))[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 pr(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 $(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 gr(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=fr(Math.atan2(n,e));return[t[6],t[7],a,o,r]}var yr=Z(),mr=Z(),vr=Wt(),d=[At(),At(),At()],br=At();function xr(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}(yr,t)&&(Q(mr,yr),mr[3]=0,mr[7]=0,mr[11]=0,mr[15]=1,!(Math.abs(rt(mr))<1e-8))){var t=yr[3],o=yr[7],s=yr[11],l=yr[12],c=yr[13],u=yr[14],h=yr[15];if(0!==t||0!==o||0!==s){if(vr[0]=t,vr[1]=o,vr[2]=s,vr[3]=h,!nt(mr,mr))return;et(mr,mr),Gt(i,vr,mr)}else i[0]=i[1]=i[2]=0,i[3]=1;if(e[0]=l,e[1]=c,e[2]=u,t=yr,(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]=_t(d[0]),jt(d[0],d[0]),r[0]=Rt(d[0],d[1]),wr(d[1],d[1],d[0],1,-r[0]),n[1]=_t(d[1]),jt(d[1],d[1]),r[0]/=n[1],r[1]=Rt(d[0],d[2]),wr(d[2],d[2],d[0],1,-r[1]),r[2]=Rt(d[1],d[2]),wr(d[2],d[2],d[1],1,-r[2]),n[2]=_t(d[2]),jt(d[2],d[2]),r[1]/=n[2],r[2]/=n[2],It(br,d[1],d[2]),Rt(d[0],br)<0)for(var f=0;f<3;f++)n[f]*=-1,d[f][0]*=-1,d[f][1]*=-1,d[f][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 wr(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}Or.isEmpty=function(t){return!t||0===t.halfExtents[0]&&0===t.halfExtents[1]&&0===t.halfExtents[2]},Or.prototype.update=function(t,e){ar(this.center,t),ar(this.halfExtents,e),or(this.min,this.center,this.halfExtents),sr(this.max,this.center,this.halfExtents)},Or.prototype.setMinMax=function(t,e){sr(this.center,e,t),lr(this.center,this.center,.5),or(this.halfExtents,e,t),lr(this.halfExtents,this.halfExtents,.5),ar(this.min,t),ar(this.max,e)},Or.prototype.getMin=function(){return this.min},Or.prototype.getMax=function(){return this.max},Or.prototype.add=function(t){var e,n,r,i,a,o,s,l,c,u,h,f,d,p,g;Or.isEmpty(t)||(Or.isEmpty(this)?this.setMinMax(t.getMin(),t.getMax()):(n=(e=this.center)[0],p=e[1],a=e[2],i=(r=this.halfExtents)[0],h=r[1],o=r[2],l=(f=t.center)[0],g=f[1],f=f[2],c=(t=t.halfExtents)[0],(d=g-(u=t[1]))<(s=p-h)&&(s=d),(d=p+h)<(p=g+u)&&(d=p),(g=f-(h=t[2]))<(u=a-o)&&(u=g),(p=a+o)<(t=f+h)&&(p=t),e[0]=.5*((a=(g=l-c)<(a=n-i)?g:a)+(o=(o=n+i)<(f=l+c)?f: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))},Or.prototype.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],h=e[2],f=e[6],d=e[10],p=Math.abs(a),g=Math.abs(o),y=Math.abs(s),m=Math.abs(l),v=Math.abs(c),b=Math.abs(u),x=Math.abs(h),w=Math.abs(f),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]+h*i[0]+f*i[1]+d*i[2],r[0]=p*t[0]+g*t[1]+y*t[2],r[1]=m*t[0]+v*t[1]+b*t[2],r[2]=x*t[0]+w*t[1]+M*t[2],or(this.min,n,r),sr(this.max,n,r)},Or.prototype.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]},Or.prototype.intersection=function(t){var e,n,r,i;return this.intersects(t)?(e=new Or,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},Or.prototype.getNegativeFarPoint=function(t){return 273===t.pnVertexFlag?ar([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]]},Or.prototype.getPositiveFarPoint=function(t){return 273===t.pnVertexFlag?ar([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]]};var Mr=Or;function Or(){this.center=[0,0,0],this.halfExtents=[0,0,0],this.min=[0,0,0],this.max=[0,0,0]}Sr.prototype.updatePNVertexFlag=function(){this.pnVertexFlag=(Number(0<=this.normal[0])<<8)+(Number(0<=this.normal[1])<<4)+Number(0<=this.normal[2])},Sr.prototype.distanceToPoint=function(t){return Rt(t,this.normal)-this.distance},Sr.prototype.normalize=function(){var t,e,n,r=1/zt(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},Sr.prototype.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};var kr,Er=Sr;function Sr(t,e){this.distance=t||0,this.normal=e||Tt(0,1,0),this.updatePNVertexFlag()}(n=kr=kr||{})[n.OUTSIDE=4294967295]="OUTSIDE",n[n.INSIDE=0]="INSIDE",n[n.INDETERMINATE=2147483647]="INDETERMINATE";_r.prototype.extractFromVPMatrix=function(t){var t=j(t,16),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],h=t[10],f=t[11],d=t[12],p=t[13],g=t[14],t=t[15];Lt(this.planes[0].normal,i-e,l-a,f-c),this.planes[0].distance=t-d,Lt(this.planes[1].normal,i+e,l+a,f+c),this.planes[1].distance=t+d,Lt(this.planes[2].normal,i+n,l+o,f+u),this.planes[2].distance=t+p,Lt(this.planes[3].normal,i-n,l-o,f-u),this.planes[3].distance=t-p,Lt(this.planes[4].normal,i-r,l-s,f-h),this.planes[4].distance=t-g,Lt(this.planes[5].normal,i+r,l+s,f+h),this.planes[5].distance=t+g,this.planes.forEach(function(t){t.normalize(),t.updatePNVertexFlag()})};var Ar=_r;function _r(t){if(this.planes=[],t)this.planes=t;else for(var e=0;e<6;e++)this.planes.push(new Er)}Pr.prototype.clone=function(){return new Pr(this.x,this.y)},Pr.prototype.copyFrom=function(t){this.x=t.x,this.y=t.y};var Tr=Pr;function Pr(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.x=0,this.y=0,this.x=t,this.y=e}Cr.prototype.toJSON=function(){};var Lr=Cr;function Cr(t,e,n,r){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}var Nr,jr,Rr,Ir="Method not implemented.",Br="Use document.documentElement instead.";(n=Nr=Nr||{})[n.ORBITING=0]="ORBITING",n[n.EXPLORING=1]="EXPLORING",n[n.TRACKING=2]="TRACKING",(n=jr=jr||{})[n.DEFAULT=0]="DEFAULT",n[n.ROTATIONAL=1]="ROTATIONAL",n[n.TRANSLATIONAL=2]="TRANSLATIONAL",n[n.CINEMATIC=3]="CINEMATIC",(n=Rr=Rr||{})[n.ORTHOGRAPHIC=0]="ORTHOGRAPHIC",n[n.PERSPECTIVE=1]="PERSPECTIVE";var g,Dr,Fr,zr,Wr="updated",n=(r.prototype.isOrtho=function(){return this.projectionMode===Rr.ORTHOGRAPHIC},r.prototype.getProjectionMode=function(){return this.projectionMode},r.prototype.getPerspective=function(){return this.jitteredProjectionMatrix||this.projectionMatrix},r.prototype.getPerspectiveInverse=function(){return this.projectionMatrixInverse},r.prototype.getFrustum=function(){return this.frustum},r.prototype.getPosition=function(){return this.position},r.prototype.getFocalPoint=function(){return this.focalPoint},r.prototype.getDollyingStep=function(){return this.dollyingStep},r.prototype.getNear=function(){return this.near},r.prototype.getFar=function(){return this.far},r.prototype.getZoom=function(){return this.zoom},r.prototype.getOrthoMatrix=function(){return this.orthoMatrix},r.prototype.getView=function(){return this.view},r.prototype.setEnableUpdate=function(t){this.enableUpdate=t},r.prototype.setType=function(t,e){return this.type=t,this.type===Nr.EXPLORING?this.setWorldRotation(!0):this.setWorldRotation(!1),this._getAngles(),this.type===Nr.TRACKING&&void 0!==e&&this.setTrackingMode(e),this},r.prototype.setProjectionMode=function(t){return this.projectionMode=t,this},r.prototype.setTrackingMode=function(t){if(this.type!==Nr.TRACKING)throw new Error("Impossible to set a tracking mode if the camera is not of tracking type");return this.trackingMode=t,this},r.prototype.setWorldRotation=function(t){return this.rotateWorld=t,this._getAngles(),this},r.prototype.getViewTransform=function(){return nt(Z(),this.matrix)},r.prototype.getWorldTransform=function(){return this.matrix},r.prototype.jitterProjectionMatrix=function(t,e){t=dt(Z(),[t,e,0]);this.jitteredProjectionMatrix=lt(Z(),t,this.projectionMatrix)},r.prototype.clearJitterProjectionMatrix=function(){this.jitteredProjectionMatrix=void 0},r.prototype.setMatrix=function(t){return this.matrix=t,this._update(),this},r.prototype.setFov=function(t){return this.setPerspective(this.near,this.far,t,this.aspect),this},r.prototype.setAspect=function(t){return this.setPerspective(this.near,this.far,this.fov,t),this},r.prototype.setNear=function(t){return this.projectionMode===Rr.PERSPECTIVE?this.setPerspective(t,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,t,this.far),this},r.prototype.setFar=function(t){return this.projectionMode===Rr.PERSPECTIVE?this.setPerspective(this.near,t,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,t),this},r.prototype.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===Rr.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},r.prototype.clearViewOffset=function(){return void 0!==this.view&&(this.view.enabled=!1),this.projectionMode===Rr.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},r.prototype.setZoom=function(t){return this.zoom=t,this.projectionMode===Rr.ORTHOGRAPHIC?this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far):this.projectionMode===Rr.PERSPECTIVE&&this.setPerspective(this.near,this.far,this.fov,this.aspect),this},r.prototype.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=Tt(t.x-r,t.y-n,0),e=Rt(i,this.right)/_t(this.right),r=Rt(i,this.up)/_t(this.up);return this.pan(-e,-r),this},r.prototype.setPerspective=function(t,e,n,r){this.projectionMode=Rr.PERSPECTIVE,this.fov=n,this.near=t,this.far=e,this.aspect=r;var i,a,o,s,n=this.near*Math.tan(hr(.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,ut(this.projectionMatrix,this.projectionMatrix,Tt(1,-1,1)),nt(this.projectionMatrixInverse,this.projectionMatrix),this.triggerUpdate(),this},r.prototype.setOrthographic=function(t,e,n,r,i,a){this.projectionMode=Rr.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),Ot(this.projectionMatrix,s,n,r,e,i,a),ut(this.projectionMatrix,this.projectionMatrix,Tt(1,-1,1)),nt(this.projectionMatrixInverse,this.projectionMatrix),this._getOrthoMatrix(),this.triggerUpdate(),this},r.prototype.setPosition=function(t,e,n){t=ur(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},r.prototype.setFocalPoint=function(t,e,n){void 0===e&&(e=this.focalPoint[1]),void 0===n&&(n=this.focalPoint[2]);var r,i=Tt(0,1,0);return this.focalPoint=ur(t,e,n),this.trackingMode===jr.CINEMATIC&&(t=(r=Nt(At(),this.focalPoint,this.position))[0],e=r[1],n=r[2],r=_t(r),e=fr(Math.asin(e/r)),r=90+fr(Math.atan2(n,t)),ft(n=Z(),n,hr(r)),ht(n,n,hr(e)),i=Bt(At(),[0,1,0],n)),nt(this.matrix,kt(Z(),this.position,this.focalPoint,i)),this._getAxes(),this._getDistance(),this._getAngles(),this.triggerUpdate(),this},r.prototype.getDistance=function(){return this.distance},r.prototype.getDistanceVector=function(){return this.distanceVector},r.prototype.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=At(),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},r.prototype.setMaxDistance=function(t){return this.maxDistance=t,this},r.prototype.setMinDistance=function(t){return this.minDistance=t,this},r.prototype.setAzimuth=function(t){return this.azimuth=cr(t),this.computeMatrix(),this._getAxes(),this.type===Nr.ORBITING||this.type===Nr.EXPLORING?this._getPosition():this.type===Nr.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},r.prototype.getAzimuth=function(){return this.azimuth},r.prototype.setElevation=function(t){return this.elevation=cr(t),this.computeMatrix(),this._getAxes(),this.type===Nr.ORBITING||this.type===Nr.EXPLORING?this._getPosition():this.type===Nr.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},r.prototype.getElevation=function(){return this.elevation},r.prototype.setRoll=function(t){return this.roll=cr(t),this.computeMatrix(),this._getAxes(),this.type===Nr.ORBITING||this.type===Nr.EXPLORING?this._getPosition():this.type===Nr.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},r.prototype.getRoll=function(){return this.roll},r.prototype._update=function(){this._getAxes(),this._getPosition(),this._getDistance(),this._getAngles(),this._getOrthoMatrix(),this.triggerUpdate()},r.prototype.computeMatrix=function(){var t=Yt(Ht(),[0,0,1],hr(this.roll)),e=(tt(this.matrix),Yt(Ht(),[1,0,0],hr((this.rotateWorld&&this.type!==Nr.TRACKING||this.type===Nr.TRACKING?1:-1)*this.elevation))),n=Yt(Ht(),[0,1,0],hr((this.rotateWorld&&this.type!==Nr.TRACKING||this.type===Nr.TRACKING?1:-1)*this.azimuth)),n=Vt(Ht(),n,e),n=Vt(Ht(),n,t),e=xt(Z(),n);this.type===Nr.ORBITING||this.type===Nr.EXPLORING?(ct(this.matrix,this.matrix,this.focalPoint),lt(this.matrix,this.matrix,e),ct(this.matrix,this.matrix,[0,0,this.distance])):this.type===Nr.TRACKING&&(ct(this.matrix,this.matrix,this.position),lt(this.matrix,this.matrix,e))},r.prototype._setPosition=function(t,e,n){this.position=ur(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()},r.prototype._getAxes=function(){Pt(this.right,ur(Gt(Wt(),[1,0,0,0],this.matrix))),Pt(this.up,ur(Gt(Wt(),[0,1,0,0],this.matrix))),Pt(this.forward,ur(Gt(Wt(),[0,0,1,0],this.matrix))),jt(this.right,this.right),jt(this.up,this.up),jt(this.forward,this.forward)},r.prototype._getAngles=function(){var t=this.distanceVector[0],e=this.distanceVector[1],n=this.distanceVector[2],r=_t(this.distanceVector);0===r?(this.elevation=0,this.azimuth=0):this.type===Nr.TRACKING||this.rotateWorld?(this.elevation=fr(Math.asin(e/r)),this.azimuth=fr(Math.atan2(-t,-n))):(this.elevation=-fr(Math.asin(e/r)),this.azimuth=-fr(Math.atan2(-t,-n)))},r.prototype._getPosition=function(){Pt(this.position,ur(Gt(Wt(),[0,0,0,1],this.matrix))),this._getDistance()},r.prototype._getFocalPoint=function(){var t,e;Dt(this.distanceVector,[0,0,-this.distance],(t=U(),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)),Ct(this.focalPoint,this.position,this.distanceVector),this._getDistance()},r.prototype._getDistance=function(){this.distanceVector=Nt(At(),this.focalPoint,this.position),this.distance=_t(this.distanceVector),this.dollyingStep=this.distance/100},r.prototype._getOrthoMatrix=function(){var t,e;this.projectionMode===Rr.ORTHOGRAPHIC&&(t=this.position,e=Yt(Ht(),[0,0,1],-this.roll*Math.PI/180),bt(this.orthoMatrix,e,Tt((this.rright-this.left)/2-t[0],(this.top-this.bottom)/2-t[1],0),Tt(this.zoom,this.zoom,1),t))},r.prototype.triggerUpdate=function(){var t;this.enableUpdate&&(t=this.getViewTransform(),t=lt(Z(),this.getPerspective(),t),this.getFrustum().extractFromVPMatrix(t),this.eventEmitter.emit(Wr))},r.prototype.rotate=function(t,e,n){throw new Error(Ir)},r.prototype.pan=function(t,e){throw new Error(Ir)},r.prototype.dolly=function(t){throw new Error(Ir)},r.prototype.createLandmark=function(t,e){throw new Error(Ir)},r.prototype.gotoLandmark=function(t,e){throw new Error(Ir)},r.prototype.cancelLandmarkAnimation=function(){throw new Error(Ir)},r);function r(){this.eventEmitter=new V,this.matrix=Z(),this.right=Tt(1,0,0),this.up=Tt(0,1,0),this.forward=Tt(0,0,1),this.position=Tt(0,0,1),this.focalPoint=Tt(0,0,0),this.distanceVector=Tt(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.projectionMatrix=Z(),this.projectionMatrixInverse=Z(),this.jitteredProjectionMatrix=void 0,this.enableUpdate=!0,this.type=Nr.EXPLORING,this.trackingMode=jr.DEFAULT,this.projectionMode=Rr.PERSPECTIVE,this.frustum=new Ar,this.orthoMatrix=Z()}function Gr(a,o){if("function"!=typeof a||null!=o&&"function"!=typeof o)throw new TypeError("Expected a function");function s(){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),s.cache=i.set(r,n)||i,n)}return s.cache=new(Gr.Cache||Map),s}Gr.Cache=Map,(i=g=g||{})[i.kUnknown=0]="kUnknown",i[i.kNumber=1]="kNumber",i[i.kPercentage=2]="kPercentage",i[i.kEms=3]="kEms",i[i.kPixels=4]="kPixels",i[i.kRems=5]="kRems",i[i.kDegrees=6]="kDegrees",i[i.kRadians=7]="kRadians",i[i.kGradians=8]="kGradians",i[i.kTurns=9]="kTurns",i[i.kMilliseconds=10]="kMilliseconds",i[i.kSeconds=11]="kSeconds",i[i.kInteger=12]="kInteger",(i=Dr=Dr||{})[i.kUNumber=0]="kUNumber",i[i.kUPercent=1]="kUPercent",i[i.kULength=2]="kULength",i[i.kUAngle=3]="kUAngle",i[i.kUTime=4]="kUTime",i[i.kUOther=5]="kUOther",(i=Fr=Fr||{})[i.kYes=0]="kYes",i[i.kNo=1]="kNo",(i=zr=zr||{})[i.kYes=0]="kYes",i[i.kNo=1]="kNo";function Hr(t){var e=1;switch(t){case g.kPixels:case g.kDegrees:case g.kSeconds:break;case g.kMilliseconds:e=.001;break;case g.kRadians:e=180/Math.PI;break;case g.kGradians:e=.9;break;case g.kTurns:e=360}return e}function Yr(t){switch(t){case g.kNumber:case g.kInteger:return"";case g.kPercentage:return"%";case g.kEms:return"em";case g.kRems:return"rem";case g.kPixels:return"px";case g.kDegrees:return"deg";case g.kRadians:return"rad";case g.kGradians:return"grad";case g.kMilliseconds:return"ms";case g.kSeconds:return"s";case g.kTurns:return"turn"}return""}var Vr,qr=[{name:"em",unit_type:g.kEms},{name:"px",unit_type:g.kPixels},{name:"deg",unit_type:g.kDegrees},{name:"rad",unit_type:g.kRadians},{name:"grad",unit_type:g.kGradians},{name:"ms",unit_type:g.kMilliseconds},{name:"s",unit_type:g.kSeconds},{name:"rem",unit_type:g.kRems},{name:"turn",unit_type:g.kTurns}],$r=((i=Vr=Vr||{})[i.kUnknownType=0]="kUnknownType",i[i.kUnparsedType=1]="kUnparsedType",i[i.kKeywordType=2]="kKeywordType",i[i.kUnitType=3]="kUnitType",i[i.kSumType=4]="kSumType",i[i.kProductType=5]="kProductType",i[i.kNegateType=6]="kNegateType",i[i.kInvertType=7]="kInvertType",i[i.kMinType=8]="kMinType",i[i.kMaxType=9]="kMaxType",i[i.kClampType=10]="kClampType",i[i.kTransformType=11]="kTransformType",i[i.kPositionType=12]="kPositionType",i[i.kURLImageType=13]="kURLImageType",i[i.kColorType=14]="kColorType",i[i.kUnsupportedColorType=15]="kUnsupportedColorType",function(e){return qr.find(function(t){return t.name===e}).unit_type}),i=(Ur.isAngle=function(t){return t===g.kDegrees||t===g.kRadians||t===g.kGradians||t===g.kTurns},Ur.isLength=function(t){return t>=g.kEms&&t<g.kDegrees},Ur.isRelativeUnit=function(t){return t===g.kPercentage||t===g.kEms||t===g.kRems},Ur.isTime=function(t){return t===g.kSeconds||t===g.kMilliseconds},Ur.prototype.toString=function(){return this.buildCSSText(Fr.kNo,zr.kNo,"")},Ur.prototype.isNumericValue=function(){return this.getType()>=Vr.kUnitType&&this.getType()<=Vr.kClampType},Ur);function Ur(){}t(Qr,Xr=i),Qr.prototype.getType=function(){return Vr.kColorType},Qr.prototype.to=function(t){return this};var Xr,Kr,Zr=Qr;function Qr(t){var e=Xr.call(this)||this;return e.colorSpace=t,e}(ki=Kr=Kr||{})[ki.Constant=0]="Constant",ki[ki.LinearGradient=1]="LinearGradient",ki[ki.RadialGradient=2]="RadialGradient";t(ei,Jr=i),ei.prototype.clone=function(){return new ei(this.type,this.value)},ei.prototype.buildCSSText=function(t,e,n){return n},ei.prototype.getType=function(){return Vr.kColorType};var Jr,ti=ei;function ei(t,e){var n=Jr.call(this)||this;return n.type=t,n.value=e,n}t(ii,ni=i),ii.prototype.clone=function(){return new ii(this.value)},ii.prototype.getType=function(){return Vr.kKeywordType},ii.prototype.buildCSSText=function(t,e,n){return n+this.value};var ni,ri=ii;function ii(t){var e=ni.call(this)||this;return e.value=t,e}function ai(t){return t.split("").map(function(t,e){return t.toUpperCase()===t?"".concat(0!==e?"-":"").concat(t.toLowerCase()):t}).join("")}var oi=Gr(function(t){return(t=void 0===t?"":t).replace(/-([a-z])/g,function(t){return t[1].toUpperCase()})});function si(t){return"function"==typeof t}function li(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 ci(t){switch(function(t){switch(t){case g.kNumber:case g.kInteger:return Dr.kUNumber;case g.kPercentage:return Dr.kUPercent;case g.kPixels:return Dr.kULength;case g.kMilliseconds:case g.kSeconds:return Dr.kUTime;case g.kDegrees:case g.kRadians:case g.kGradians:case g.kTurns:return Dr.kUAngle;default:return Dr.kUOther}}(t)){case Dr.kUNumber:return g.kNumber;case Dr.kULength:return g.kPixels;case Dr.kUPercent:return g.kPercentage;case Dr.kUTime:return g.kSeconds;case Dr.kUAngle:return g.kDegrees;default:return g.kUnknown}}var ui,hi={d:{alias:"path"},strokeDasharray:{alias:"lineDash"},strokeWidth:{alias:"lineWidth"},textAnchor:{alias:"textAlign"},src:{alias:"img"}},fi=Gr(function(t){var t=oi(t),e=hi[t];return(null==e?void 0:e.alias)||t}),di=(t(pi,ui=i),pi.prototype.clone=function(){return new pi(this.value,this.unit)},pi.prototype.equals=function(t){return this.value===t.value&&this.unit===t.unit},pi.prototype.getType=function(){return Vr.kUnitType},pi.prototype.convertTo=function(t){var e;return this.unit===t?new pi(this.value,this.unit):(e=ci(this.unit))!==ci(t)||e===g.kUnknown?null:(e=Hr(this.unit)/Hr(t),new pi(this.value*e,t))},pi.prototype.buildCSSText=function(t,e,n){switch(this.unit){case g.kUnknown:break;case g.kInteger:i=Number(this.value).toFixed(0);break;case g.kNumber:case g.kPercentage:case g.kEms:case g.kRems:case g.kPixels:case g.kDegrees:case g.kRadians:case g.kGradians:case g.kMilliseconds:case g.kSeconds:case g.kTurns:var r,i,a=this.value,o=Yr(this.unit);i=a<-999999||999999<a?(r=Yr(this.unit),!Number.isFinite(a)||Number.isNaN(a)?li(a,r):a+(r||"")):"".concat(a).concat(o)}return n+=i},pi);function pi(t,e){void 0===e&&(e=g.kNumber);var n=ui.call(this)||this,r="string"==typeof e?(r=e)?"number"===r?g.kNumber:"percent"===r||"%"===r?g.kPercentage:$r(r):g.kUnknown:e;return n.unit=r,n.value=t,n}var gi,yi=new di(0,"px"),mi=(new di(1,"px"),new di(0,"deg")),vi=(t(bi,gi=Zr),bi.prototype.clone=function(){return new bi(this.r,this.g,this.b,this.alpha)},bi.prototype.buildCSSText=function(t,e,n){return n+"rgba(".concat(this.r,",").concat(this.g,",").concat(this.b,",").concat(this.alpha,")")},bi);function bi(t,e,n,r,i){void 0===r&&(r=1),void 0===i&&(i=!1);var a=gi.call(this,"rgb")||this;return a.r=t,a.g=e,a.b=n,a.alpha=r,a.isNone=i,a}function xi(t){return Ei[t]||(Ei[t]=new ri(t)),Ei[t]}var wi,Mi,O,a,Oi=new ri("unset"),ki=new ri("initial"),i=new ri("inherit"),Ei={"":Oi,unset:Oi,initial:ki,inherit:i},Si=new vi(0,0,0,0,!0),Ai=new vi(0,0,0,0),_i=Gr(function(t,e,n,r){return new vi(t,e,n,r)},function(t,e,n,r){return"rgba(".concat(t,",").concat(e,",").concat(n,",").concat(r,")")}),Ti=function(t,e){return void 0===e&&(e=g.kNumber),new di(t,e)},Pi=new di(50,"%"),Li=(wi=wi||{},wi[wi.Standard=0]="Standard",(Zr=Mi=Mi||{})[Zr.ADDED=0]="ADDED",Zr[Zr.REMOVED=1]="REMOVED",{absolutePath:[],hasArc:!(Zr[Zr.Z_INDEX_CHANGED=2]="Z_INDEX_CHANGED"),segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new Lr(0,0,0,0)});(ki=O=O||{}).GROUP="g",ki.CIRCLE="circle",ki.ELLIPSE="ellipse",ki.IMAGE="image",ki.RECT="rect",ki.LINE="line",ki.POLYLINE="polyline",ki.POLYGON="polygon",ki.TEXT="text",ki.PATH="path",ki.HTML="html",ki.MESH="mesh",(i=a=a||{}).COORDINATE="<coordinate>",i.COLOR="<color>",i.PAINT="<paint>",i.NUMBER="<number>",i.ANGLE="<angle>",i.OPACITY_VALUE="<opacity-value>",i.SHADOW_BLUR="<shadow-blur>",i.LENGTH="<length>",i.PERCENTAGE="<percentage>",i.LENGTH_PERCENTAGE="<length> | <percentage>",i.LENGTH_PERCENTAGE_12="[<length> | <percentage>]{1,2}",i.LENGTH_PERCENTAGE_14="[<length> | <percentage>]{1,4}",i.LIST_OF_POINTS="<list-of-points>",i.PATH="<path>",i.FILTER="<filter>",i.Z_INDEX="<z-index>",i.OFFSET_DISTANCE="<offset-distance>",i.DEFINED_PATH="<defined-path>",i.MARKER="<marker>",i.TRANSFORM="<transform>",i.TRANSFORM_ORIGIN="<transform-origin>",i.TEXT="<text>",i.TEXT_TRANSFORM="<text-transform>";Ci={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]+\.?))/},Ni="";var Ci,Ni,ji=function(t){return Ni=t,Ii()};function Ri(t){throw new Error(Ni+": "+t)}function Ii(){var t=qi(Bi);return 0<Ni.length&&Ri("Invalid input not EOF"),t}function Bi(){return Di("linear-gradient",Ci.linearGradient,zi)||Di("repeating-linear-gradient",Ci.repeatingLinearGradient,zi)||Di("radial-gradient",Ci.radialGradient,Wi)||Di("repeating-radial-gradient",Ci.repeatingRadialGradient,Wi)||Di("conic-gradient",Ci.conicGradient,Wi)}function Di(n,t,r){return Fi(t,function(t){var e=r();return e&&!Ji(Ci.comma)&&Ri("Missing comma before color stops"),{type:n,orientation:e,colorStops:qi($i)}})}function Fi(t,e){t=Ji(t);if(t)return Ji(Ci.startCall)||Ri("Missing ("),e=e(t),Ji(Ci.endCall)||Ri("Missing )"),e}function zi(){return Qi("directional",Ci.sideOrCorner,1)||Qi("angular",Ci.angleValue,1)}function Wi(){var t,e,n=Gi();return n&&((t=[]).push(n),e=Ni,Ji(Ci.comma))&&((n=Gi())?t.push(n):Ni=e),t}function Gi(){var t,e=function(){var t=Qi("shape",/^(circle)/i,0);t&&(t.style=Zi()||Hi());return t}()||function(){var t=Qi("shape",/^(ellipse)/i,0);t&&(t.style=Xi()||Hi());return t}();return e?e.at=Yi():(t=Hi())?(e=t,(t=Yi())&&(e.at=t)):(t=Vi())&&(e={type:"default-radial",at:t}),e}function Hi(){return Qi("extent-keyword",Ci.extentKeywords,1)}function Yi(){var t;if(Qi("position",/^at/,0))return(t=Vi())||Ri("Missing positioning value"),t}function Vi(){var t={x:Xi(),y:Xi()};if(t.x||t.y)return{type:"position",value:t}}function qi(t){var e=t(),n=[];if(e)for(n.push(e);Ji(Ci.comma);)(e=t())?n.push(e):Ri("One extra comma");return n}function $i(){var t=Qi("hex",Ci.hexColor,1)||Fi(Ci.rgbaColor,function(){return{type:"rgba",value:qi(Ui)}})||Fi(Ci.rgbColor,function(){return{type:"rgb",value:qi(Ui)}})||Qi("literal",Ci.literalColor,0);return t||Ri("Expected color definition"),t.length=Xi(),t}function Ui(){return Ji(Ci.number)[1]}function Xi(){return Qi("%",Ci.percentageValue,1)||Ki()||Zi()}function Ki(){return Qi("position-keyword",Ci.positionKeywords,1)}function Zi(){return Qi("px",Ci.pixelValue,1)||Qi("em",Ci.emValue,1)}function Qi(t,e,n){e=Ji(e);if(e)return{type:t,value:e[n]}}function Ji(t){var e=/^[\n\r\t\s]+/.exec(Ni),e=(e&&ta(e[0].length),t.exec(Ni));return e&&ta(e[0].length),e}function ta(t){Ni=Ni.substring(t)}var ea=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,na=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,ra=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,ia=/[\d.]+:(#[^\s]+|[^\)]+\))/gi;var aa={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},oa=Gr(function(t){t="angular"===t.type?Number(t.value):aa[t.value]||0;return Ti(t,"deg")}),sa=Gr(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:Ti(n,i),cy:Ti(r,a)}}),la=Gr(function(t){if(-1<t.indexOf("linear")||-1<t.indexOf("radial"))return ji(t).map(function(t){for(var e,n=t.type,r=t.orientation,t=t.colorStops,i=t,a=i.length,o=(i[a-1].length=null!=(d=i[a-1].length)?d:{type:"%",value:"100"},1<a&&(i[0].length=null!=(d=i[0].length)?d:{type:"%",value:"0"}),0),s=Number(i[0].length.value),l=1;l<a;l++){var c=null==(e=i[l].length)?void 0:e.value;if(!A(c)&&!A(s)){for(var u=1;u<l-o;u++)i[o+u].length={type:"%",value:"".concat(s+(Number(c)-s)*u/(l-o))};o=l,s=Number(c)}}var h,f,d=t.map(function(t){return{offset:Ti(Number(t.length.value),"%"),color:(e=(t=t).type,t=t.value,"hex"===e?"#".concat(t):"literal"===e?t:("rgb"===e?"rgb(":"rgba(").concat(t.join(","),")"))};var e});return"linear-gradient"===n?new ti(Kr.LinearGradient,{angle:r?oa(r):mi,steps:d}):"radial-gradient"===n&&"shape"===(r=r||[{type:"shape",value:"circle"}])[0].type&&"circle"===r[0].value?(n=(t=sa(r[0].at)).cx,t=t.cy,f=void 0,r[0].style&&(h=(r=r[0].style).type,r=r.value,f="extent-keyword"===h?xi(r):Ti(r,h)),new ti(Kr.RadialGradient,{cx:n,cy:t,size:f,steps:d})):void 0});var e=t[0];if("("===t[1]||"("===t[2])if("l"===e){var n=ea.exec(t);if(n)return r=(null==(r=n[2].match(ia))?void 0:r.map(function(t){return t.split(":")}))||[],[new ti(Kr.LinearGradient,{angle:Ti(parseFloat(n[1]),"deg"),steps:r.map(function(t){var t=j(t,2),e=t[0],t=t[1];return{offset:Ti(100*Number(e),"%"),color:t}})})]}else if("r"===e){n=function(t){var t=na.exec(t);if(t)return t=(null==(t=t[4].match(ia))?void 0:t.map(function(t){return t.split(":")}))||[],{cx:Ti(50,"%"),cy:Ti(50,"%"),steps:t.map(function(t){var t=j(t,2),e=t[0],t=t[1];return{offset:Ti(100*Number(e),"%"),color:t}})};return null}(t);if(n&&!Ie(n))return[new ti(Kr.RadialGradient,n)]}else if("p"===e){var r=t;if(r=ra.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 ca(t){return t&&t.image}function ua(t){return t&&!A(t.r)&&!A(t.g)&&!A(t.b)}var ha=Gr(function(t){var e;return ca(t)?m({repetition:"repeat"},t):"transparent"===(t=A(t)?"":t)?Ai:la(t="currentColor"===t?"black":t)||(e=[0,0,0,0],null!==(t=bn(t))&&(e[0]=t.r||0,e[1]=t.g||0,e[2]=t.b||0,e[3]=t.opacity),_i.apply(void 0,M([],j(e),!1)))});function fa(t,e){if(ua(t)&&ua(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(Be(e[n],0,255));return e[3]=Be(e[3],0,1),"rgba(".concat(e.join(","),")")}]}function da(t,e){if(A(e))return Ti(0,"px");if(e="".concat(e).trim().toLowerCase(),isFinite(Number(e))){if(0<="px".search(t))return Ti(Number(e),"px");if(0<="deg".search(t))return Ti(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 Ti(Number(e.replace(new RegExp("U"+t,"g"),"").replace(new RegExp(r,"g"),"*0")),t)})[0]}var pa=Gr(function(t){return da(new RegExp("px","g"),t)}),ga=(Gr(function(t){return da(new RegExp("%","g"),t)}),function(t){return De(t)||isFinite(Number(t))?Ti(Number(t)||0,"px"):da(new RegExp("px|%|em|rem","g"),t)}),ya=Gr(function(t){return da(new RegExp("deg|rad|grad|turn","g"),t)});function ma(t){var e=0;return t.unit===g.kDegrees?e=t.value:t.unit===g.kRadians?e=fr(Number(t.value)):t.unit===g.kTurns&&(e=360*Number(t.value)),e}function va(t,e){var n;return Array.isArray(t)?n=t.map(function(t){return Number(t)}):Ie(t)?n=t.split(" ").map(function(t){return Number(t)}):De(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 ba(t){return Ie(t)?t.split(" ").map(function(t){return ga(t)}):t.map(function(t){return ga(t.toString())})}function xa(t,e,n){return 0===t.value?0:t.unit===g.kPixels?Number(t.value):t.unit===g.kPercentage&&n?(n=n.nodeName===O.GROUP?n.getLocalBounds():n.geometry.contentBounds,t.value/100*n.halfExtents[e]*2):0}var wa=["blur","brightness","drop-shadow","contrast","grayscale","sepia","saturate","hue-rotate","invert"];function Ma(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<wa.indexOf(e[1])&&r.push({name:e[1],params:e[2].split(" ").map(function(t){return da(/deg|rad|grad|turn|px|%/g,t)||ha(t)})}),n.lastIndex===t.length)return r}return[]}function Oa(t){return t.toString()}var ka=Gr(function(t){return"number"==typeof t?Ti(t):/^\s*[-+]?(\d*\.)?\d+\s*$/.test(t)?Ti(Number(t)):Ti(0)});function Ea(t,e){return[t,e,Oa]}function Sa(n,r){return function(t,e){return[t,e,function(t){return Oa(Be(t,n,r))}]}}function Aa(t,e){if(t.length===e.length)return[t,e,function(t){return t}]}function _a(t){var e;return 0===t.parsedStyle.path.totalLength&&(t.parsedStyle.path.totalLength=Me(t.parsedStyle.path.absolutePath,void 0,m(m({},e),{bbox:!1,length:!0})).length),t.parsedStyle.path.totalLength}function Ta(t,e){return t[0]===e[0]&&t[1]===e[1]}function Pa(t,e){for(var n,r,i,a,o,s,l,c,u,h=[],f=[],d=[],p=0;p<t.length;p++){var g=(k=t[p]).currentPoint,y=k.params,m=k.prePoint,v=void 0;switch(k.command){case"Q":b=m[0],n=m[1],r=y[1],i=y[2],a=y[3],o=y[4],u=c=l=s=void 0,s=Wn(b,r,a)[0],l=Wn(n,i,o)[0],c=[b,a],u=[n,o],void 0!==s&&c.push(zn(b,r,a,s)),void 0!==l&&u.push(zn(n,i,o,l)),v=Ln(c,u);break;case"C":v=function(t,e,n,r,i,a,o,s){for(var l=[t,o],c=[e,s],u=Bn(t,n,i,o),h=Bn(e,r,a,s),f=0;f<u.length;f++)l.push(In(t,n,i,o,u[f]));for(f=0;f<h.length;f++)c.push(In(e,r,a,s,h[f]));return Ln(l,c)}(m[0],m[1],y[1],y[2],y[3],y[4],y[5],y[6]);break;case"A":var b=k.arcParams,v=Cn(b.cx,b.cy,b.rx,b.ry,b.xRotation,b.startAngle,b.endAngle);break;default:h.push(g[0]),f.push(g[1])}v&&(k.box=v,h.push(v.x,v.x+v.width),f.push(v.y,v.y+v.height)),e&&("L"===k.command||"M"===k.command)&&k.prePoint&&k.nextPoint&&d.push(k)}var h=h.filter(function(t){return!Number.isNaN(t)&&t!==1/0&&t!==-1/0}),f=f.filter(function(t){return!Number.isNaN(t)&&t!==1/0&&t!==-1/0}),x=je(h),w=je(f),M=Ne(h),O=Ne(f);if(0!==d.length)for(p=0;p<d.length;p++){var k;(g=(k=d[p]).currentPoint)[0]===x?x-=La(k,e).xExtra:g[0]===M&&(M+=La(k,e).xExtra),g[1]===w?w-=La(k,e).yExtra:g[1]===O&&(O+=La(k,e).yExtra)}return{x:x,y:w,width:M-x,height:O-w}}function La(t,e){var n=t.prePoint,r=t.currentPoint,t=t.nextPoint,i=Math.pow(r[0]-n[0],2)+Math.pow(r[1]-n[1],2),a=Math.pow(r[0]-t[0],2)+Math.pow(r[1]-t[1],2),n=Math.pow(n[0]-t[0],2)+Math.pow(n[1]-t[1],2),n=Math.acos((i+a-n)/(2*Math.sqrt(i)*Math.sqrt(a)));return!n||0===Math.sin(n)||Fe(n,0)?{xExtra:0,yExtra:0}:(i=Math.abs(Math.atan2(t[1]-r[1],t[0]-r[0])),a=Math.abs(Math.atan2(t[0]-r[0],t[1]-r[1])),i=i>Math.PI/2?Math.PI-i:i,a=a>Math.PI/2?Math.PI-a:a,{xExtra:Math.cos(n/2-i)*(e/2*(1/Math.sin(n/2)))-e/2||0,yExtra:Math.cos(a-n/2)*(e/2*(1/Math.sin(n/2)))-e/2||0})}function Ca(t,e){return[e[0]+(e[0]-t[0]),e[1]+(e[1]-t[1])]}Gr(function(t){return(Ie(t)?t.split(" "):t).map(ka)});function Na(t,e,n,r,i,a,o,s){var l,c,u;return e=Math.abs(e),n=Math.abs(n),r=hr(r=We(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=ja({x:1,y:0},o={x:(u.x-c)/e,y:(u.y-i)/n}),o=ja(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 ja=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 Ra(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 h=function(t,e){var n=e[1],r=e[2],i=We(hr(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,h=-1*Math.sin(i)*(s-c)/2+Math.cos(i)*(l-e)/2,f=u*u/(n*n)+h*h/(r*r);1<f&&(n*=Math.sqrt(f),r*=Math.sqrt(f));f=n*n*(h*h)+r*r*(u*u),f=f?Math.sqrt((n*n*(r*r)-f)/f):1;a===o&&(f*=-1);isNaN(f)&&(f=0);var d=r?f*n*h/r:0,f=n?f*-r*u/n:0,s=(s+c)/2+Math.cos(i)*d-Math.sin(i)*f,l=(l+e)/2+Math.sin(i)*d+Math.cos(i)*f,p=[(u-d)/n,(h-f)/r],u=[(-1*u-d)/n,(-1*h-f)/r],d=Fa([1,0],p),h=Fa(p,u);Da(p,u)<=-1&&(h=Math.PI);1<=Da(p,u)&&(h=0);0===o&&0<h&&(h-=2*Math.PI);1===o&&h<0&&(h+=2*Math.PI);return{cx:s,cy:l,rx:Ta(t,[c,e])?0:n,ry:Ta(t,[c,e])?0:r,startAngle:d,endAngle:d+h,xRotation:i,arcFlag:a,sweepFlag:o}}(n,l);u.arcParams=h}"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]&&Ta(n,e[a].currentPoint)&&(e[a].prePoint=u.prePoint);var f,d,p,g,y,m,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?(f=[l[1],l[2]],u.startTangent=[b[0]-f[0],b[1]-f[1]],u.endTangent=[n[0]-f[0],n[1]-f[1]]):"T"===c?(f=Ca((d=e[s-1]).currentPoint,b),"Q"===d.command?(u.command="Q",u.startTangent=[b[0]-f[0],b[1]-f[1]],u.endTangent=[n[0]-f[0],n[1]-f[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?(p=[l[1],l[2]],g=[l[3],l[4]],u.startTangent=[b[0]-p[0],b[1]-p[1]],u.endTangent=[n[0]-g[0],n[1]-g[1]],0===u.startTangent[0]&&0===u.startTangent[1]&&(u.startTangent=[p[0]-g[0],p[1]-g[1]]),0===u.endTangent[0]&&0===u.endTangent[1]&&(u.endTangent=[g[0]-p[0],g[1]-p[1]])):"S"===c?(p=Ca((d=e[s-1]).currentPoint,b),g=[l[1],l[2]],"C"===d.command?(u.command="C",u.startTangent=[b[0]-p[0],b[1]-p[1]]):(u.command="SQ",u.startTangent=[b[0]-g[0],b[1]-g[1]]),u.endTangent=[n[0]-g[0],n[1]-g[1]]):"A"===c&&(c=(b=Ia(u,0)).x,b=b.y,y=(m=Ia(u,1,!1)).x,m=m.y,u.startTangent=[c,b],u.endTangent=[y,m]),e.push(u)}return e}function Ia(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=Na({x:t.prePoint[0],y:t.prePoint[1]},i,a,o,!!s,!!r,{x:t.currentPoint[0],y:t.currentPoint[1]},e),i=Na({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 Ba(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function Da(t,e){return Ba(t)*Ba(e)?(t[0]*e[0]+t[1]*e[1])/(Ba(t)*Ba(e)):1}function Fa(t,e){return(t[0]*e[1]<t[1]*e[0]?-1:1)*Math.acos(Da(t,e))}function za(t,e,n,r){var i=(-1+Math.sqrt(2))/3*4,a=t*i,i=e*i,o=n-t,t=n+t,s=r-e,e=r+e;return[["M",o,r],["C",o,r-i,n-a,s,n,s],["C",n+a,s,t,r-i,t,r],["C",t,r+i,n+a,e,n,e],["C",n-a,e,o,r+i,o,r],["Z"]]}function Wa(t,e){void 0===e&&(e=t.getLocalTransform());var n,r,i,a,o,s,l,c,u,h,f,d=[];switch(t.nodeName){case O.LINE:var p=t.parsedStyle,d=[["M",p.x1,p.y1],["L",p.x2,p.y2]];break;case O.CIRCLE:var p=t.parsedStyle,g=p.r;d=za(g,g,p.cx,p.cy);break;case O.ELLIPSE:var g=t.parsedStyle;d=za(g.rx,g.ry,g.cx,g.cy);break;case O.POLYLINE:case O.POLYGON:p=t.parsedStyle.points;g=p.points,p=t.nodeName===O.POLYGON,g=g.map(function(t,e){return[0===e?"M":"L",t[0],t[1]]}),p&&g.push(["Z"]),d=g;break;case O.RECT:var y=t.parsedStyle,m=y.width,v=y.height,b=y.x,x=y.y,y=y.radius,w=y&&y.some(function(t){return 0!==t});n=m,r=v,b=b,x=x,d=(w=w&&y.map(function(t){return Be(t,0,Math.min(Math.abs(m)/2,Math.abs(v)/2))}))?(s=(y=0<n?1:-1)+(o=0<r?1:-1)!=0?1:0,[["M",y*(i=(w=j(w,4))[0])+b,x],["L",n-y*(a=w[1])+b,x],a?["A",a,a,0,0,s,n+b,o*a+x]:null,["L",n+b,r-o*(a=w[2])+x],a?["A",a,a,0,0,s,n+b-y*a,r+x]:null,["L",b+y*(a=w[3]),r+x],a?["A",a,a,0,0,s,b,r+x-o*a]:null,["L",b,o*i+x],i?["A",i,i,0,0,s,y*i+b,x]:null,["Z"]].filter(function(t){return t})):[["M",b,x],["L",b+n,x],["L",b+n,x+r],["L",b,x+r],["Z"]];break;case O.PATH:d=M([],j(t.parsedStyle.path.absolutePath),!1)}if(d.length)return l=d,c=e,u=(e=(e=t).parsedStyle).defX,h=void 0===u?0:u,f=void 0===(u=e.defY)?0:u,l.reduce(function(t,e){var n,r,i,a="";return"M"===e[0]||"L"===e[0]?(n=Tt(e[1]-h,e[2]-f,0),c&&Bt(n,n,c),a="".concat(e[0]).concat(n[0],",").concat(n[1])):"Z"===e[0]?a=e[0]:"C"===e[0]?(r=Tt(e[1]-h,e[2]-f,0),i=Tt(e[3]-h,e[4]-f,0),n=Tt(e[5]-h,e[6]-f,0),c&&(Bt(r,r,c),Bt(i,i,c),Bt(n,n,c)),a="".concat(e[0]).concat(r[0],",").concat(r[1],",").concat(i[0],",").concat(i[1],",").concat(n[0],",").concat(n[1])):"A"===e[0]?(n=Tt(e[6]-h,e[7]-f,0),c&&Bt(n,n,c),a="".concat(e[0]).concat(e[1],",").concat(e[2],",").concat(e[3],",").concat(e[4],",").concat(e[5],",").concat(n[0],",").concat(n[1])):"Q"===e[0]&&(r=Tt(e[1]-h,e[2]-f,0),i=Tt(e[3]-h,e[4]-f,0),c&&(Bt(r,r,c),Bt(i,i,c)),a="".concat(e[0]).concat(e[1],",").concat(e[2],",").concat(e[3],",").concat(e[4],"}")),t+a},"")}function Ga(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=ue(e)}catch(t){n=ue(""),console.error("[g]: Invalid SVG Path definition: ".concat(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=(r=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)).polygons,r=r.polylines,i=Ra(n),a=(l=Pa(i,0)).x,o=l.y,s=l.width,l=l.height;return{absolutePath:n,hasArc:e,segments:i,polygons:t,polylines:r,totalLength:0,rect:{x:Number.isFinite(a)?a:0,y:Number.isFinite(o)?o:0,width:Number.isFinite(s)?s:0,height:Number.isFinite(l)?l:0}}}var Ha=Gr(Ga);function Ya(t,e){t=(Ie(t)?Ha:Ga)(t);return e&&(e.parsedStyle.defX=t.rect.x,e.parsedStyle.defY=t.rect.y),t}function Va(t,e,n){var r,i,a,o,s,l,c,u,h,f=t.curve,d=e.curve,t=(f&&0!==f.length||(f=me(t.absolutePath,!1),t.curve=f),d&&0!==d.length||(d=me(e.absolutePath,!1),e.curve=d),[f,d]),f=Oe((t=f.length!==d.length?function t(e,n,r){var i,e=ke(e),n=ke(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],h=[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&&h[n]&&t.l>=u[n],h[n]-=i?1:0,i?t.ss:[t.s]}).flat()});return r[0].length===r[1].length?r:t(r[0],r[1],c)}(f,d):t)[0])!==Oe(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))}))):Qt(t[0]);return[f,(i=t[1],a=f,c=i.length-1,u=[],h=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){h+=pe(i[(n+e)%c].slice(-2),a[e%c].slice(-2))}),u[n]=h,h=0}),d[u.indexOf(Math.min.apply(null,u))]),function(t){return t}]}function qa(t,e){var n,r,i=Ie(t)?t.split(" ").map(function(t){var t=j(t.split(","),2),e=t[0],t=t[1];return[Number(e),Number(t)]}):t,a=[],o=0,s=Fn(i),t=(i.forEach(function(t,e){i[e+1]&&((n=[0,0])[0]=o/s,r=Nn(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,M([],j(i.map(function(t){return t[0]})),!1))),l=Math.min.apply(Math,M([],j(i.map(function(t){return t[1]})),!1));return e&&(e.parsedStyle.defX=t,e.parsedStyle.defY=l),{points:i,totalLength:s,segments:a}}function $a(t,e){return[t.points,e.points,function(t){return t}]}var Ua=null;function Xa(t){return function(e){var n=0;return t.map(function(t){return t===Ua?e[n++]:t})}}function Ka(t){return t}var Za={matrix:["NNNNNN",[Ua,Ua,0,0,Ua,Ua,0,0,0,0,1,0,Ua,Ua,0,1],Ka],matrix3d:["NNNNNNNNNNNNNNNN",Ka],rotate:["A"],rotatex:["A"],rotatey:["A"],rotatez:["A"],rotate3d:["NNNA"],perspective:["L"],scale:["Nn",Xa([Ua,Ua,new di(1)]),Ka],scalex:["N",Xa([Ua,new di(1),new di(1)]),Xa([Ua,new di(1)])],scaley:["N",Xa([new di(1),Ua,new di(1)]),Xa([new di(1),Ua])],scalez:["N",Xa([new di(1),new di(1),Ua])],scale3d:["NNN",Ka],skew:["Aa",null,Ka],skewx:["A",null,Xa([Ua,mi])],skewy:["A",null,Xa([mi,Ua])],translate:["Tt",Xa([Ua,Ua,yi]),Ka],translatex:["T",Xa([Ua,yi,yi]),Xa([Ua,yi])],translatey:["T",Xa([yi,Ua,yi]),Xa([yi,Ua])],translatez:["L",Xa([yi,yi,Ua])],translate3d:["TTL",Ka]};function Qa(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=Za[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 h=s[u],f=l[u],d=void 0;if(void 0===(d=h?{A:function(t){return"0"===t.trim()?mi:ya(t)},N:ka,T:ga,L:pa}[f.toUpperCase()](h):{a:mi,n:c[0],t:yi}[f]))return[];c.push(d)}if(r.push({t:a,d:c}),n.lastIndex===t.length)return r}return[]}function Ja(t){switch(t.t){case"rotatex":return i=hr(ma(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=hr(ma(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=hr(ma(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=hr(ma(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=hr(ma(t.d[0])),a=hr(ma(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=hr(ma(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=hr(ma(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=xa(t.d[0],0,null)||0,n=xa(t.d[1],0,null)||0,0,1];case"translatex":return[1,0,0,0,0,1,0,0,0,0,1,0,e=xa(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=xa(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=xa(t.d[0],0,null)||0,1];case"translate3d":return[1,0,0,0,0,1,0,0,0,0,1,0,e=xa(t.d[0],0,null)||0,n=xa(t.d[1],0,null)||0,r=xa(t.d[2],0,null)||0,1];case"perspective":a=xa(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 to(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 eo(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 xr(0===(t=t).length?[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]:t.map(Ja).reduce(to),e,n,r,i,a),[[e,n,r,a,i]]}var no=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(o=0;o<3;o++)for(var s=0;s<3;s++)a[3][o]+=t[s]*a[s][o];var l=r[0],c=r[1],u=r[2],r=r[3],h=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]],u=(h[0][0]=1-2*(c*c+u*u),h[0][1]=2*(l*c-u*r),h[0][2]=2*(l*u+c*r),h[1][0]=2*(l*c+u*r),h[1][1]=1-2*(l*l+u*u),h[1][2]=2*(c*u-l*r),h[2][0]=2*(l*u-c*r),h[2][1]=2*(c*u+l*r),h[2][2]=1-2*(l*l+c*c),a=ro(a,h),[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]]);for(n[2]&&(u[2][1]=n[2],a=ro(a,u)),n[1]&&(u[2][1]=0,u[2][0]=n[0],a=ro(a,u)),n[0]&&(u[2][0]=0,u[1][0]=n[0],a=ro(a,u)),o=0;o<3;o++)for(s=0;s<3;s++)a[o][s]*=e[o];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 ro(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 io(t){return t.toFixed(6).replace(".000000","")}function ao(e,n){var r,i;return e.decompositionPair!==n&&(e.decompositionPair=n,r=eo(e)),n.decompositionPair!==e&&(n.decompositionPair=e,i=eo(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=Be(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 no(t[0],t[1],t[2],e,t[4]).map(io).join(",")}])}function oo(t){return t.replace(/[xy]/,"")}function so(t){return t.replace(/(x|y|z|3d)?$/,"3d")}var lo=function(t,e){return"perspective"===t&&"perspective"===e||("matrix"===t||"matrix3d"===t)&&("matrix"===e||"matrix3d"===e)};function co(r,i,t){var e=!1;if(!r.length||!i.length){r.length||(e=!0,r=i,i=[]);for(var n=0;n<r.length;n++)!function(t){var t=r[t],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?Ti(n):Ti(n,t.unit)})})}(n)}var a=[],o=[],s=[];if(r.length!==i.length)a=[(g=ao(r,i))[0]],o=[g[1]],s=[["matrix",[g[2]]]];else for(n=0;n<r.length;n++){var l=r[n].t,c=i[n].t,u=r[n].d,h=i[n].d,f=Za[l],d=Za[c],p=void 0;if(lo(l,c)){var g=ao([r[n]],[i[n]]);a.push(g[0]),o.push(g[1]),s.push(["matrix",[g[2]]])}else{if(l===c)p=l;else if(f[2]&&d[2]&&oo(l)===oo(c))p=oo(l),u=f[2](u),h=d[2](h);else{if(!f[1]||!d[1]||so(l)!==so(c)){a=[(g=ao(r,i))[0]],o=[g[1]],s=[["matrix",[g[2]]]];break}p=so(l),u=f[1](u),h=d[1](h)}for(var y=[],m=[],v=[],b=0;b<u.length;b++){g=function(t,e,n,r,i){void 0===i&&(i=0);var a="",o=t.value||0,s=e.value||0,l=ci(t.unit),c=t.convertTo(l),l=e.convertTo(l);return c&&l?(o=c.value,s=l.value,a=Yr(t.unit)):(di.isLength(t.unit)||di.isLength(e.unit))&&(o=xa(t,i,n),s=xa(e,i,n),a="px"),[o,s,function(t){return(t=r?Math.max(t,0):t)+a}]}(u[b],h[b],t,!1,b);y[b]=g[0],m[b]=g[1],v.push(g[2])}a.push(y),o.push(m),s.push([p,v])}}return e&&(e=a,a=o,o=e),[a,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 uo=Gr(function(t){var e;return Ie(t)?"text-anchor"===t?[Ti(0,"px"),Ti(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:[ga(ho(e[0])),ga(ho(e[1]))]):[Ti(t[0]||0,"px"),Ti(t[1]||0,"px")]});function ho(t){return"center"===t?"50%":"left"===t||"top"===t?"0":"right"===t||"bottom"===t?"100%":t}var fo=[{n:"display",k:["none"]},{n:"opacity",int:!0,inh:!0,d:"1",syntax:a.OPACITY_VALUE},{n:"fillOpacity",int:!0,inh:!0,d:"1",syntax:a.OPACITY_VALUE},{n:"strokeOpacity",int:!0,inh:!0,d:"1",syntax:a.OPACITY_VALUE},{n:"fill",int:!0,k:["none"],d:"none",syntax:a.PAINT},{n:"fillRule",k:["nonzero","evenodd"],d:"nonzero"},{n:"stroke",int:!0,k:["none"],d:"none",syntax:a.PAINT,l:!0},{n:"shadowType",k:["inner","outer","both"],d:"outer",l:!0},{n:"shadowColor",int:!0,syntax:a.COLOR},{n:"shadowOffsetX",int:!0,l:!0,d:"0",syntax:a.LENGTH_PERCENTAGE},{n:"shadowOffsetY",int:!0,l:!0,d:"0",syntax:a.LENGTH_PERCENTAGE},{n:"shadowBlur",int:!0,l:!0,d:"0",syntax:a.SHADOW_BLUR},{n:"lineWidth",int:!0,inh:!0,d:"1",l:!0,a:["strokeWidth"],syntax:a.LENGTH_PERCENTAGE},{n:"increasedLineWidthForHitTesting",inh:!0,d:"0",l:!0,syntax:a.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:a.LENGTH_PERCENTAGE_12},{n:"lineDashOffset",int:!0,inh:!0,d:"0",a:["strokeDashoffset"],syntax:a.LENGTH_PERCENTAGE},{n:"offsetPath",syntax:a.DEFINED_PATH},{n:"offsetDistance",int:!0,syntax:a.OFFSET_DISTANCE},{n:"dx",int:!0,l:!0,d:"0",syntax:a.LENGTH_PERCENTAGE},{n:"dy",int:!0,l:!0,d:"0",syntax:a.LENGTH_PERCENTAGE},{n:"zIndex",ind:!0,int:!0,d:"0",k:["auto"],syntax:a.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:a.FILTER},{n:"clipPath",syntax:a.DEFINED_PATH},{n:"textPath",syntax:a.DEFINED_PATH},{n:"textPathSide",k:["left","right"],d:"left"},{n:"textPathStartOffset",l:!0,d:"0",syntax:a.LENGTH_PERCENTAGE},{n:"transform",p:100,int:!0,k:["none"],d:"none",syntax:a.TRANSFORM},{n:"transformOrigin",p:100,d:function(t){return t===O.CIRCLE||t===O.ELLIPSE?"center":t===O.TEXT?"text-anchor":"left top"},l:!0,syntax:a.TRANSFORM_ORIGIN},{n:"anchor",p:99,d:function(t){return t===O.CIRCLE||t===O.ELLIPSE?"0.5 0.5":"0 0"},l:!0,syntax:a.LENGTH_PERCENTAGE_12},{n:"cx",int:!0,d:"0",syntax:a.COORDINATE},{n:"cy",int:!0,d:"0",syntax:a.COORDINATE},{n:"cz",int:!0,d:"0",syntax:a.COORDINATE},{n:"r",int:!0,l:!0,d:"0",syntax:a.LENGTH_PERCENTAGE},{n:"rx",int:!0,l:!0,d:"0",syntax:a.LENGTH_PERCENTAGE},{n:"ry",int:!0,l:!0,d:"0",syntax:a.LENGTH_PERCENTAGE},{n:"x",int:!0,d:"0",syntax:a.COORDINATE},{n:"y",int:!0,d:"0",syntax:a.COORDINATE},{n:"z",int:!0,d:"0",syntax:a.COORDINATE},{n:"width",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:a.LENGTH_PERCENTAGE},{n:"height",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:a.LENGTH_PERCENTAGE},{n:"radius",int:!0,l:!0,d:"0",syntax:a.LENGTH_PERCENTAGE_14},{n:"x1",int:!0,l:!0,syntax:a.COORDINATE},{n:"y1",int:!0,l:!0,syntax:a.COORDINATE},{n:"z1",int:!0,l:!0,syntax:a.COORDINATE},{n:"x2",int:!0,l:!0,syntax:a.COORDINATE},{n:"y2",int:!0,l:!0,syntax:a.COORDINATE},{n:"z2",int:!0,l:!0,syntax:a.COORDINATE},{n:"path",int:!0,l:!0,d:"",a:["d"],syntax:a.PATH,p:50},{n:"points",int:!0,l:!0,syntax:a.LIST_OF_POINTS,p:50},{n:"text",l:!0,d:"",syntax:a.TEXT,p:50},{n:"textTransform",l:!0,inh:!0,k:["capitalize","uppercase","lowercase","none"],d:"none",syntax:a.TEXT_TRANSFORM,p:51},{n:"font",l:!0},{n:"fontSize",int:!0,inh:!0,d:"16px",l:!0,syntax:a.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:a.LENGTH,int:!0,d:"0"},{n:"letterSpacing",l:!0,syntax:a.LENGTH,int:!0,d:"0"},{n:"miterLimit",l:!0,syntax:a.NUMBER,d:function(t){return t===O.PATH||t===O.POLYGON||t===O.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:a.MARKER},{n:"markerEnd",syntax:a.MARKER},{n:"markerMid",syntax:a.MARKER},{n:"markerStartOffset",syntax:a.LENGTH,l:!0,int:!0,d:"0"},{n:"markerEndOffset",syntax:a.LENGTH,l:!0,int:!0,d:"0"}],po=fo.filter(function(t){return!!t.l}).map(function(t){return t.n}),go={},yo=new WeakMap,Zr=(mo.prototype.registerMetadata=function(e){M([e.n],j(e.a||[]),!1).forEach(function(t){go[t]=e})},mo.prototype.unregisterMetadata=function(t){delete go[t]},mo.prototype.getPropertySyntax=function(t){return this.runtime.CSSPropertySyntaxFactory[t]},mo.prototype.processProperties=function(n,e,t){var r=this;if(void 0===t&&(t={skipUpdateAttribute:!1,skipParse:!1,forceUpdateGeometry:!1,usedAttributes:[]}),this.runtime.enableCSSParsing){var i=t.skipUpdateAttribute,a=t.skipParse,o=t.forceUpdateGeometry,s=t.usedAttributes,l=o,c=Object.keys(e);c.forEach(function(t){i||(n.attributes[t]=e[t]),!l&&null!=(t=go[t])&&t.l&&(l=!0)}),a||c.forEach(function(t){n.computedStyle[t]=r.parseProperty(t,n.attributes[t],n)}),(c=null!=s&&s.length?Array.from(new Set(c.concat(s))):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)}),this.runtime.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 o=Object.keys(e),a=n.parsedStyle.clipPath,s=n.parsedStyle.offsetPath,u=(n.parsedStyle=Object.assign(n.parsedStyle,e),!!t.forceUpdateGeometry);if(!u)for(var h=0;h<po.length;h++)if(po[h]in e){u=!0;break}e.fill&&(n.parsedStyle.fill=ha(e.fill)),e.stroke&&(n.parsedStyle.stroke=ha(e.stroke)),e.shadowColor&&(n.parsedStyle.shadowColor=ha(e.shadowColor)),e.filter&&(n.parsedStyle.filter=Ma(e.filter)),A(e.radius)||(n.parsedStyle.radius=va(e.radius,4)),A(e.lineDash)||(n.parsedStyle.lineDash=va(e.lineDash,2)),e.points&&(n.parsedStyle.points=qa(e.points,n)),""===e.path&&(n.parsedStyle.path=m({},Li)),e.path&&(n.parsedStyle.path=Ya(e.path,n)),e.textTransform&&this.runtime.CSSPropertySyntaxFactory["<text-transform>"].calculator(null,null,{value:e.textTransform},n,null),e.clipPath&&this.runtime.CSSPropertySyntaxFactory["<defined-path>"].calculator("clipPath",a,e.clipPath,n,this.runtime),e.offsetPath&&this.runtime.CSSPropertySyntaxFactory["<defined-path>"].calculator("offsetPath",s,e.offsetPath,n,this.runtime),e.anchor&&(n.parsedStyle.anchor=va(e.anchor,2)),e.transform&&(n.parsedStyle.transform=Qa(e.transform)),e.transformOrigin&&(n.parsedStyle.transformOrigin=uo(e.transformOrigin)),e.markerStart&&(n.parsedStyle.markerStart=this.runtime.CSSPropertySyntaxFactory["<marker>"].calculator(null,e.markerStart,e.markerStart,null,null)),e.markerEnd&&(n.parsedStyle.markerEnd=this.runtime.CSSPropertySyntaxFactory["<marker>"].calculator(null,e.markerEnd,e.markerEnd,null,null)),e.markerMid&&(n.parsedStyle.markerMid=this.runtime.CSSPropertySyntaxFactory["<marker>"].calculator("",e.markerMid,e.markerMid,null,null)),(n.nodeName!==O.CIRCLE&&n.nodeName!==O.ELLIPSE||A(e.cx)&&A(e.cy))&&(n.nodeName!==O.RECT&&n.nodeName!==O.IMAGE&&n.nodeName!==O.GROUP&&n.nodeName!==O.HTML&&n.nodeName!==O.TEXT&&n.nodeName!==O.MESH||A(e.x)&&A(e.y)&&A(e.z))&&(n.nodeName!==O.LINE||A(e.x1)&&A(e.y1)&&A(e.z1)&&A(e.x2)&&A(e.y2)&&A(e.z2))||this.runtime.CSSPropertySyntaxFactory["<coordinate>"].postProcessor(n,o),A(e.zIndex)||this.runtime.CSSPropertySyntaxFactory["<z-index>"].postProcessor(n,o),e.path&&this.runtime.CSSPropertySyntaxFactory["<path>"].postProcessor(n,o),e.points&&this.runtime.CSSPropertySyntaxFactory["<list-of-points>"].postProcessor(n,o),A(e.offsetDistance)||this.runtime.CSSPropertySyntaxFactory["<offset-distance>"].postProcessor(n,o),e.transform&&this.runtime.CSSPropertySyntaxFactory["<transform>"].postProcessor(n,o),u&&this.updateGeometry(n)}},mo.prototype.parseProperty=function(t,e,n){var r,t=go[t],i=e;return"unset"===(e=""!==e&&!A(e)?e:"unset")||"initial"===e||"inherit"===e?i=xi(e):t&&(r=t.k,t=(t=t.syntax)&&this.getPropertySyntax(t),r&&-1<r.indexOf(e)?i=xi(e):t&&t.parser&&(i=t.parser(e,n))),i},mo.prototype.computeProperty=function(t,e,n){var r=go[t],i="g-root"===n.id,a=e;if(r){var o=r.syntax,s=r.inh,r=r.d;if(e instanceof ri){var l=e.value;if("initial"===(l="unset"===l?s&&!i?"inherit":"initial":l))A(r)||(e=this.parseProperty(t,si(r)?r(n.nodeName):r,n));else if("inherit"===l)return s=this.tryToResolveProperty(n,t,{inherited:!0}),A(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.runtime)):e instanceof ri?e.value:e}return a},mo.prototype.postProcessProperty=function(t,e,n){var t=go[t];t&&t.syntax&&(t=t.syntax&&this.getPropertySyntax(t.syntax))&&t.postProcessor&&t.postProcessor(e,n)},mo.prototype.addUnresolveProperty=function(t,e){var n=yo.get(t);n||(yo.set(t,[]),n=yo.get(t)),-1===n.indexOf(e)&&n.push(e)},mo.prototype.tryToResolveProperty=function(t,e,n){var n=(n=void 0===n?{}:n).inherited;if(n&&(t.parentElement&&function(t,e){t=yo.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},mo.prototype.recalc=function(e){var n,t=yo.get(e);t&&t.length&&(n={},t.forEach(function(t){n[t]=e.attributes[t]}),this.processProperties(e,n),yo.delete(e))},mo.prototype.updateGeometry=function(t){var s,e,n,r,i,a,o,l,c,u,h,f,d,p,g,y=t.nodeName,m=this.runtime.geometryUpdaterFactory[y];m&&((s=t.geometry).contentBounds||(s.contentBounds=new Mr),s.renderBounds||(s.renderBounds=new Mr),e=t.parsedStyle,n=(m=m.update(e,t)).width,r=m.height,h=void 0===(h=m.depth)?0:h,u=void 0===(u=m.offsetX)?0:u,p=void 0===(p=m.offsetY)?0:p,m=void 0===(m=m.offsetZ)?0:m,h=[Math.abs(n)/2,Math.abs(r)/2,h/2],l=e.stroke,c=e.lineWidth,g=e.increasedLineWidthForHitTesting,d=e.shadowType,f=e.shadowColor,i=void 0===(i=e.filter)?[]:i,a=e.transformOrigin,o=e.anchor,y===O.TEXT?delete e.anchor:y===O.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))*h[2]+m],s.contentBounds.update(u,h),p=y===O.POLYLINE||y===O.POLYGON||y===O.PATH?Math.SQRT2:.5,l&&!l.isNone&&(h[0]+=m=((c||0)+(g||0))*p,h[1]+=m),s.renderBounds.update(u,h),f&&d&&"inner"!==d&&(l=(y=s.renderBounds).min,c=y.max,g=e.shadowBlur||0,p=e.shadowOffsetX||0,m=e.shadowOffsetY||0,u=l[0]-g+p,h=c[0]+g+p,f=l[1]-g+m,d=c[1]+g+m,l[0]=Math.min(l[0],u),c[0]=Math.max(c[0],h),l[1]=Math.min(l[1],f),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,sr(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,y=r<0,g=((p=n<0)?-1:1)*(a?xa(a[0],0,t):0),m=(y?-1:1)*(a?xa(a[1],1,t):0),g-=(p?-1:1)*(o&&o[0]||0)*s.contentBounds.halfExtents[0]*2,m-=(y?-1:1)*(o&&o[1]||0)*s.contentBounds.halfExtents[1]*2,t.setOrigin(g,m),this.runtime.sceneGraphService.dirtifyToRoot(t))},mo.prototype.isPropertyInheritable=function(t){t=go[t];return!!t&&t.inh},mo);function mo(t){var e=this;this.runtime=t,fo.forEach(function(t){e.registerMetadata(t)})}vo.prototype.calculator=function(t,e,n,r){return ma(n)};ki=vo;function vo(){this.parser=ya,this.parserWithCSSDisabled=null,this.mixer=Ea}bo.prototype.calculator=function(t,e,n,r,i){return n instanceof ri&&(n=null),i.sceneGraphService.updateDisplayObjectDependency(t,e,n,r),"clipPath"===t&&r.forEach(function(t){0===t.childNodes.length&&i.sceneGraphService.dirtifyToRoot(t)}),n};i=bo;function bo(){}wo.prototype.calculator=function(t,e,n,r){return n instanceof ri?"none"===n.value?Si:Ai:n};var xo=wo;function wo(){this.parser=ha,this.parserWithCSSDisabled=ha,this.mixer=fa}Oo.prototype.calculator=function(t,e,n){return n instanceof ri?[]:n};var Mo=Oo;function Oo(){this.parser=Ma}function ko(t){t=t.parsedStyle.fontSize;return A(t)?null:t}So.prototype.calculator=function(t,e,n,r,i){var a,o;return De(n)?n:di.isRelativeUnit(n.unit)?(i=i.styleValueRegistry,n.unit===g.kPercentage?0:n.unit===g.kEms?r.parentNode&&(o=ko(r.parentNode))?o*n.value:(i.addUnresolveProperty(r,t),0):n.unit===g.kRems?null!=(a=null==r?void 0:r.ownerDocument)&&a.documentElement&&(o=ko(r.ownerDocument.documentElement))?o*n.value:(i.addUnresolveProperty(r,t),0):void 0):n.value};var Eo=So;function So(){this.parser=ga,this.parserWithCSSDisabled=null,this.mixer=Ea}_o.prototype.parser=function(t){t=ba(De(t)?[t]:t),t=1===t.length?[t[0],t[0]]:[t[0],t[1]];return t},_o.prototype.calculator=function(t,e,n){return n.map(function(t){return t.value})};var Ao=_o;function _o(){this.mixer=Aa}Po.prototype.parser=function(t){t=ba(De(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},Po.prototype.calculator=function(t,e,n){return n.map(function(t){return t.value})};var To=Po;function Po(){this.mixer=Aa}var Lo=Z();function Co(t,l){var c,u;return t&&t.length&&(c=l.parsedStyle.defX||0,u=l.parsedStyle.defY||0,l.resetLocalTransform(),l.setLocalPosition(c,u),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?l.translateLocal((e=t||[yi,yi])[0].value,e[1].value,0):"translatex"===s?l.translateLocal((e=t||[yi])[0].value,0,0):"translatey"===s?l.translateLocal(0,(e=t||[yi])[0].value,0):"translatez"===s?l.translateLocal(0,0,(e=t||[yi])[0].value):"translate3d"===s?l.translateLocal((e=t||[yi,yi,yi])[0].value,e[1].value,e[2].value):"rotate"===s?l.rotateLocal(0,0,ma((t||[mi])[0])):"rotatex"===s?l.rotateLocal(ma((t||[mi])[0]),0,0):"rotatey"===s?l.rotateLocal(0,ma((t||[mi])[0]),0):"rotatez"===s?l.rotateLocal(0,0,ma((t||[mi])[0])):"rotate3d"!==s&&("skew"===s?(n=(null==t?void 0:t.map(function(t){return t.value}))||[0,0],l.setLocalSkew(hr(n[0]),hr(n[1]))):"skewx"===s?(n=(null==t?void 0:t.map(function(t){return t.value}))||[0],l.setLocalSkew(hr(n[0]),l.getLocalSkew()[1])):"skewy"===s?(n=(null==t?void 0:t.map(function(t){return t.value}))||[0],l.setLocalSkew(l.getLocalSkew()[0],hr(n[0]))):"matrix"===s?(e=(o=j(t.map(function(t){return t.value}),6))[0],n=o[1],r=o[2],i=o[3],a=o[4],o=o[5],l.setLocalTransform(J(Lo,e,n,0,0,r,i,0,0,0,0,1,0,a+c,o+u,0,1))):"matrix3d"===s&&(J.apply(St,M([Lo],j(t.map(function(t){return t.value})),!1)),Lo[12]+=c,Lo[13]+=u,l.setLocalTransform(Lo)))})),l.getLocalTransform()}t(Ro,No=Eo),Ro.prototype.postProcessor=function(t,e){var n,r;switch(t.nodeName){case O.CIRCLE:case O.ELLIPSE:var i=t.parsedStyle,a=i.cx,o=i.cy,i=i.cz;A(a)||(l=a),A(o)||(c=o),A(i)||(u=i);break;case O.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 O.RECT:case O.IMAGE:case O.GROUP:case O.HTML:case O.TEXT:case O.MESH:A(t.parsedStyle.x)||(l=t.parsedStyle.x),A(t.parsedStyle.y)||(c=t.parsedStyle.y),A(t.parsedStyle.z)||(u=t.parsedStyle.z)}t.nodeName!==O.PATH&&t.nodeName!==O.POLYLINE&&t.nodeName!==O.POLYGON&&(t.parsedStyle.defX=l||0,t.parsedStyle.defY=c||0),A(l)&&A(c)&&A(u)||-1!==e.indexOf("transform")||((e=t.parsedStyle.transform)&&e.length?Co(e,t):(n=(e=j(t.getLocalPosition(),3))[0],r=e[1],e=e[2],t.setLocalPosition(A(l)?n:l,A(c)?r:c,A(u)?e:u)))};var No,jo=Ro;function Ro(){return null!==No&&No.apply(this,arguments)||this}Bo.prototype.calculator=function(t,e,n,r){n=null==(n=n instanceof ri?null:n)?void 0:n.cloneNode(!0);return n&&(n.style.isMarker=!0),n};var Io=Bo;function Bo(){}Fo.prototype.calculator=function(t,e,n){return n.value};var Do=Fo;function Fo(){this.mixer=Ea,this.parser=ka,this.parserWithCSSDisabled=null}Wo.prototype.calculator=function(t,e,n){return n.value},Wo.prototype.postProcessor=function(t){var e,n=t.parsedStyle,r=n.offsetPath,n=n.offsetDistance;!r||(e=r.nodeName)!==O.LINE&&e!==O.PATH&&e!==O.POLYLINE||(e=r.getPoint(n))&&(t.parsedStyle.defX=e.x,t.parsedStyle.defY=e.y,t.setLocalPosition(e.x,e.y))};var zo=Wo;function Wo(){this.parser=ka,this.parserWithCSSDisabled=null,this.mixer=Sa(0,1)}Ho.prototype.calculator=function(t,e,n){return n.value};var Go=Ho;function Ho(){this.parser=ka,this.parserWithCSSDisabled=null,this.mixer=Sa(0,1)}Vo.prototype.calculator=function(t,e,n){return n instanceof ri&&"unset"===n.value?{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new Lr(0,0,0,0)}:n},Vo.prototype.postProcessor=function(t,e){var n;t.nodeName===O.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))};var Yo=Vo;function Vo(){this.parser=Ya,this.parserWithCSSDisabled=Ya,this.mixer=Va}$o.prototype.postProcessor=function(t,e){var n;t.nodeName!==O.POLYGON&&t.nodeName!==O.POLYLINE||-1!==e.indexOf("transform")||(n=(e=t.parsedStyle).defX,e=e.defY,t.setLocalPosition(n,e))};var qo=$o;function $o(){this.parser=qa,this.mixer=$a}t(Ko,Uo=Eo);var Uo,Xo=Ko;function Ko(){var t=null!==Uo&&Uo.apply(this,arguments)||this;return t.mixer=Sa(0,1/0),t}Qo.prototype.calculator=function(t,e,n,r){return n instanceof ri?"unset"===n.value?"":n.value:"".concat(n)},Qo.prototype.postProcessor=function(t){t.nodeValue="".concat(t.parsedStyle.text)||""};var Zo=Qo;function Qo(){}ts.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};var Jo=ts;function ts(){}var es={},ns=0;var rs="undefined"!=typeof window&&void 0!==window.document;function is(t,e){var n=Number(t.parsedStyle.zIndex),r=Number(e.parsedStyle.zIndex);if(n===r){var i=t.parentNode;if(i)return(i=i.childNodes||[]).indexOf(t)-i.indexOf(e)}return n-r}function as(t){var e,n=t;do{if(null==(e=n.parsedStyle)?void 0:e.clipPath)return n}while(null!==(n=n.parentElement));return null}function os(t,e){if(rs)return document.defaultView.getComputedStyle(t,null).getPropertyValue(e)}var ss={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"};function ls(t,e,n){var r=!1,i=!1,e=!!e&&!e.isNone,n=!!n&&!n.isNone;return"visiblepainted"===t||"painted"===t||"auto"===t?(r=e,i=n):"visiblefill"===t||"fill"===t?r=!0:"visiblestroke"===t||"stroke"===t?i=!0:"visible"!==t&&"all"!==t||(i=r=!0),[r,i]}function cs(t){if("function"!=typeof t)throw new TypeError(t+" is not a function");var n=Date.now(),e=16<(e=n-vs)?0:16-e,r=ds();return ms[r]=t,1<Object.keys(ms).length||setTimeout(function(){vs=n;var e=ms;ms={},Object.keys(e).forEach(function(t){return e[t](ys())})},e),r}function us(t){delete ms[t]}function hs(t){return"string"!=typeof t?cs:""===t?ps.requestAnimationFrame:ps[t+"RequestAnimationFrame"]}var fs=1,ds=function(){return fs++},ps="object"==typeof self&&self.self==self?self:"object"==typeof E&&E.global==E?E:{},gs=Date.now(),ys=function(){return ps.performance&&"function"==typeof ps.performance.now?ps.performance.now():Date.now()-gs},ms={},vs=Date.now(),bs=function(t,e){for(var n=0;void 0!==t[n];){if(e(t[n]))return t[n];n+=1}}(["","webkit","moz","ms","o"],hs),xs=hs(bs),ws="string"!=typeof(bs=bs)?us:""===bs?ps.cancelAnimationFrame:ps[bs+"CancelAnimationFrame"]||ps[bs+"CancelRequestAnimationFrame"],Ms=(ps.requestAnimationFrame=xs,ps.cancelAnimationFrame=ws,Os.prototype.getCallbacksNum=function(){return this.callbacks.length},Os.prototype.tapPromise=function(t,e){this.callbacks.push(e)},Os.prototype.promise=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Promise.all(this.callbacks.map(function(t){return t.apply(void 0,M([],j(e),!1))}))},Os);function Os(){this.callbacks=[]}Es.prototype.tapPromise=function(t,e){this.callbacks.push(e)},Es.prototype.promise=function(){for(var i=[],t=0;t<arguments.length;t++)i[t]=arguments[t];return X(this,void 0,void 0,function(){var e,n,r;return R(this,function(t){switch(t.label){case 0:return this.callbacks.length?[4,(r=this.callbacks)[0].apply(r,M([],j(i),!1))]:[3,6];case 1:e=t.sent(),n=0,t.label=2;case 2:return n<this.callbacks.length-1?[4,(0,this.callbacks[n])(e)]:[3,5];case 3:e=t.sent(),t.label=4;case 4:return n++,[3,2];case 5:return[2,e];case 6:return[2,null]}})})};var ks=Es;function Es(){this.callbacks=[]}As.prototype.tap=function(t,e){this.callbacks.push(e)},As.prototype.call=function(){var e=arguments;this.callbacks.forEach(function(t){t.apply(void 0,e)})};var Ss=As;function As(){this.callbacks=[]}Ts.prototype.tap=function(t,e){this.callbacks.push(e)},Ts.prototype.call=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];if(this.callbacks.length){for(var r=(t=this.callbacks)[0].apply(t,M([],j(e),!1)),i=0;i<this.callbacks.length-1;i++)r=(0,this.callbacks[i])(r);return r}return null};var _s=Ts;function Ts(){this.callbacks=[]}var Ps=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],Ls=/([\"\'])[^\'\"]+\1/;Cs.prototype.calculator=function(t,e,n,r){return n instanceof ri?[]:n},Cs.prototype.postProcessor=function(t){Co(t.parsedStyle.transform,t)};bs=Cs;function Cs(){this.parser=Qa,this.parserWithCSSDisabled=Qa,this.mixer=co}var Ns=function(){this.parser=uo},js=(Rs.prototype.calculator=function(t,e,n,r){return n.value},Rs.prototype.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=Mi.Z_INDEX_CHANGED)},Rs);function Rs(){this.parser=ka}Bs.prototype.update=function(t,e){t=t.r;return{width:2*t,height:2*t}};var Is=Bs;function Bs(){}Fs.prototype.update=function(t,e){return{width:2*t.rx,height:2*t.ry}};var Ds=Fs;function Fs(){}Ws.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}};var zs=Ws;function Ws(){}Hs.prototype.update=function(t){t=t.path.rect;return{width:t.width,height:t.height}};var Gs=Hs;function Hs(){}Vs.prototype.update=function(t){var t=t.points.points,e=Math.min.apply(Math,M([],j(t.map(function(t){return t[0]})),!1)),n=Math.max.apply(Math,M([],j(t.map(function(t){return t[0]})),!1)),r=Math.min.apply(Math,M([],j(t.map(function(t){return t[1]})),!1));return{width:n-e,height:Math.max.apply(Math,M([],j(t.map(function(t){return t[1]})),!1))-r}};var Ys=Vs;function Vs(){}$s.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&&!Ie(n)&&(r||(r=n.width,t.width=r),i||(i=n.height,t.height=i)),{width:r,height:i}};var qs=$s;function $s(){}Xs.prototype.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&&!A(t)},Xs.prototype.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==(u=null==(u=null==e?void 0:e.ownerDocument)?void 0: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=this.globalRuntime.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})};var Us=Xs;function Xs(t){this.globalRuntime=t}Object.defineProperty(Zs.prototype,"name",{get:function(){return this.type},enumerable:!1,configurable:!0}),Object.defineProperty(Zs.prototype,"layerX",{get:function(){return this.layer.x},enumerable:!1,configurable:!0}),Object.defineProperty(Zs.prototype,"layerY",{get:function(){return this.layer.y},enumerable:!1,configurable:!0}),Object.defineProperty(Zs.prototype,"pageX",{get:function(){return this.page.x},enumerable:!1,configurable:!0}),Object.defineProperty(Zs.prototype,"pageY",{get:function(){return this.page.y},enumerable:!1,configurable:!0}),Object.defineProperty(Zs.prototype,"x",{get:function(){return this.canvas.x},enumerable:!1,configurable:!0}),Object.defineProperty(Zs.prototype,"y",{get:function(){return this.canvas.y},enumerable:!1,configurable:!0}),Object.defineProperty(Zs.prototype,"canvasX",{get:function(){return this.canvas.x},enumerable:!1,configurable:!0}),Object.defineProperty(Zs.prototype,"canvasY",{get:function(){return this.canvas.y},enumerable:!1,configurable:!0}),Object.defineProperty(Zs.prototype,"viewportX",{get:function(){return this.viewport.x},enumerable:!1,configurable:!0}),Object.defineProperty(Zs.prototype,"viewportY",{get:function(){return this.viewport.y},enumerable:!1,configurable:!0}),Zs.prototype.composedPath=function(){return!this.manager||this.path&&this.path[0]===this.target||(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path},Object.defineProperty(Zs.prototype,"propagationPath",{get:function(){return this.composedPath()},enumerable:!1,configurable:!0}),Zs.prototype.preventDefault=function(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0},Zs.prototype.stopImmediatePropagation=function(){this.propagationImmediatelyStopped=!0},Zs.prototype.stopPropagation=function(){this.propagationStopped=!0},Zs.prototype.initEvent=function(){},Zs.prototype.initUIEvent=function(){},Zs.prototype.clone=function(){throw new Error(Ir)};var Ks=Zs;function Zs(t){this.eventPhase=Zs.prototype.NONE,this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.defaultPrevented=!1,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new Tr,this.page=new Tr,this.canvas=new Tr,this.viewport=new Tr,this.composed=!1,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=t}t(tl,Qs=Ks),Object.defineProperty(tl.prototype,"clientX",{get:function(){return this.client.x},enumerable:!1,configurable:!0}),Object.defineProperty(tl.prototype,"clientY",{get:function(){return this.client.y},enumerable:!1,configurable:!0}),Object.defineProperty(tl.prototype,"movementX",{get:function(){return this.movement.x},enumerable:!1,configurable:!0}),Object.defineProperty(tl.prototype,"movementY",{get:function(){return this.movement.y},enumerable:!1,configurable:!0}),Object.defineProperty(tl.prototype,"offsetX",{get:function(){return this.offset.x},enumerable:!1,configurable:!0}),Object.defineProperty(tl.prototype,"offsetY",{get:function(){return this.offset.y},enumerable:!1,configurable:!0}),Object.defineProperty(tl.prototype,"globalX",{get:function(){return this.global.x},enumerable:!1,configurable:!0}),Object.defineProperty(tl.prototype,"globalY",{get:function(){return this.global.y},enumerable:!1,configurable:!0}),Object.defineProperty(tl.prototype,"screenX",{get:function(){return this.screen.x},enumerable:!1,configurable:!0}),Object.defineProperty(tl.prototype,"screenY",{get:function(){return this.screen.y},enumerable:!1,configurable:!0}),tl.prototype.getModifierState=function(t){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(t)},tl.prototype.initMouseEvent=function(){throw new Error(Ir)};var Qs,Js=tl;function tl(){var t=null!==Qs&&Qs.apply(this,arguments)||this;return t.client=new Tr,t.movement=new Tr,t.offset=new Tr,t.global=new Tr,t.screen=new Tr,t}t(rl,el=Js),rl.prototype.getCoalescedEvents=function(){return"pointermove"===this.type||"mousemove"===this.type||"touchmove"===this.type?[this]:[]},rl.prototype.getPredictedEvents=function(){throw new Error("getPredictedEvents is not supported!")},rl.prototype.clone=function(){return this.manager.clonePointerEvent(this)};var el,nl=rl;function rl(){var t=null!==el&&el.apply(this,arguments)||this;return t.width=0,t.height=0,t.isPrimary=!1,t}t(ol,il=Js),ol.prototype.clone=function(){return this.manager.cloneWheelEvent(this)};var il,al=ol;function ol(){return null!==il&&il.apply(this,arguments)||this}t(cl,sl=Ks);var sl,ll=cl;function cl(t,e){var n=sl.call(this,null)||this;return n.type=t,n.detail=e,Object.assign(n,e),n}ul.prototype.on=function(t,e,n){return this.addEventListener(t,e,n),this},ul.prototype.addEventListener=function(t,e,n){var r,i,a,o=Ve(n)&&n||Pe(n)&&n.capture,n=Pe(n)&&n.once,s=si(e)?void 0:e,l=!1,c="";return-1<t.indexOf(":")&&(i=(r=j(t.split(":"),2))[0],t=r[1],c=i,l=!0),t=o?"".concat(t,"capture"):t,e=si(e)?e:e.handleEvent,l&&(a=e,e=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];(null==(t=e[0].target)?void 0:t.name)===c&&a.apply(void 0,M([],j(e),!1))}),n?this.emitter.once(t,e,s):this.emitter.on(t,e,s),this},ul.prototype.off=function(t,e,n){return t?this.removeEventListener(t,e,n):this.removeAllEventListeners(),this},ul.prototype.removeAllEventListeners=function(){this.emitter.removeAllListeners()},ul.prototype.removeEventListener=function(t,e,n){var n=Ve(n)&&n||Pe(n)&&n.capture,r=si(e)?void 0:e;return t=n?"".concat(t,"capture"):t,e=si(e)?e:null==e?void 0:e.handleEvent,this.emitter.off(t,e,r),this},ul.prototype.emit=function(t,e){this.dispatchEvent(new ll(t,e))},ul.prototype.dispatchEvent=function(t,e){var n;if(void 0===e&&(e=!1),!t.type)throw new Error("DisplayObject cannot propagate events outside of the Federated Events API");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};Js=ul;function ul(){this.emitter=new V}t(p,hl=Js),p.isNode=function(t){return!!t.childNodes},Object.defineProperty(p.prototype,"textContent",{get:function(){var e,t,n="";this.nodeName===O.TEXT&&(n+=this.style.text);try{for(var r=I(this.childNodes),i=r.next();!i.done;i=r.next()){var a=i.value;a.nodeName===O.TEXT?n+=a.nodeValue:n+=a.textContent}}catch(t){e={error:t}}finally{try{i&&!i.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}return n},set:function(t){var e=this;this.childNodes.slice().forEach(function(t){e.removeChild(t)}),this.nodeName===O.TEXT&&(this.style.text="".concat(t))},enumerable:!1,configurable:!0}),p.prototype.getRootNode=function(t){return void 0===t&&(t={}),this.parentNode?this.parentNode.getRootNode(t):t.composed&&this.host?this.host.getRootNode(t):this},p.prototype.hasChildNodes=function(){return 0<this.childNodes.length},p.prototype.isDefaultNamespace=function(t){throw new Error(Ir)},p.prototype.lookupNamespaceURI=function(t){throw new Error(Ir)},p.prototype.lookupPrefix=function(t){throw new Error(Ir)},p.prototype.normalize=function(){throw new Error(Ir)},p.prototype.isEqualNode=function(t){return this===t},p.prototype.isSameNode=function(t){return this.isEqualNode(t)},Object.defineProperty(p.prototype,"parent",{get:function(){return this.parentNode},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"parentElement",{get:function(){return null},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"nextSibling",{get:function(){return null},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"previousSibling",{get:function(){return null},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"firstChild",{get:function(){return 0<this.childNodes.length?this.childNodes[0]:null},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"lastChild",{get:function(){return 0<this.childNodes.length?this.childNodes[this.childNodes.length-1]:null},enumerable:!1,configurable:!0}),p.prototype.compareDocumentPosition=function(t){var e;if(t===this)return 0;for(var n=t,r=this,i=[n],a=[r];null!=(e=n.parentNode)?e:r.parentNode;)n=n.parentNode?(i.push(n.parentNode),n.parentNode):n,r=r.parentNode?(a.push(r.parentNode),r.parentNode):r;if(n!==r)return p.DOCUMENT_POSITION_DISCONNECTED|p.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC|p.DOCUMENT_POSITION_PRECEDING;var o=a.length<i.length?i:a,s=o===i?a:i;if(o[o.length-s.length]===s[0])return o===i?p.DOCUMENT_POSITION_CONTAINED_BY|p.DOCUMENT_POSITION_FOLLOWING:p.DOCUMENT_POSITION_CONTAINS|p.DOCUMENT_POSITION_PRECEDING;for(var l=o.length-s.length,c=s.length-1;0<=c;c--){var u,h=s[c],f=o[l+c];if(f!==h)return(u=h.parentNode.childNodes).indexOf(h)<u.indexOf(f)?s===i?p.DOCUMENT_POSITION_PRECEDING:p.DOCUMENT_POSITION_FOLLOWING:o===i?p.DOCUMENT_POSITION_PRECEDING:p.DOCUMENT_POSITION_FOLLOWING}return p.DOCUMENT_POSITION_FOLLOWING},p.prototype.contain=function(t){return this.contains(t)},p.prototype.contains=function(t){for(var e=t;e&&this!==e;)e=e.parentNode;return!!e},p.prototype.getAncestor=function(t){for(var e=this;0<t&&e;)e=e.parentNode,t--;return e},p.prototype.forEach=function(e,t){void 0===t&&(t=!1),e(this)||(t?this.childNodes.slice():this.childNodes).forEach(function(t){t.forEach(e)})},p.DOCUMENT_POSITION_DISCONNECTED=1,p.DOCUMENT_POSITION_PRECEDING=2,p.DOCUMENT_POSITION_FOLLOWING=4,p.DOCUMENT_POSITION_CONTAINS=8,p.DOCUMENT_POSITION_CONTAINED_BY=16,p.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC=32;var hl,fl=p;function p(){var t=null!==hl&&hl.apply(this,arguments)||this;return t.shadow=!1,t.ownerDocument=null,t.isConnected=!1,t.baseURI="",t.childNodes=[],t.nodeType=0,t.nodeName="",t.nodeValue=null,t.parentNode=null,t}pl.prototype.init=function(){this.rootTarget=this.context.renderingContext.root.parentNode,this.addEventMapping("pointerdown",this.onPointerDown),this.addEventMapping("pointerup",this.onPointerUp),this.addEventMapping("pointermove",this.onPointerMove),this.addEventMapping("pointerout",this.onPointerOut),this.addEventMapping("pointerleave",this.onPointerOut),this.addEventMapping("pointercancel",this.onPointerCancel),this.addEventMapping("pointerover",this.onPointerOver),this.addEventMapping("pointerupoutside",this.onPointerUpOutside),this.addEventMapping("wheel",this.onWheel),this.addEventMapping("click",this.onClick)},pl.prototype.destroy=function(){this.emitter.removeAllListeners(),this.mappingTable={},this.mappingState={},this.eventPool.clear()},pl.prototype.client2Viewport=function(t){var e=this.context.contextService.getBoundingClientRect();return new Tr(t.x-((null==e?void 0:e.left)||0),t.y-((null==e?void 0:e.top)||0))},pl.prototype.viewport2Client=function(t){var e=this.context.contextService.getBoundingClientRect();return new Tr(t.x+((null==e?void 0:e.left)||0),t.y+((null==e?void 0:e.top)||0))},pl.prototype.viewport2Canvas=function(t){var e=t.x,t=t.y,n=this.rootTarget.defaultView.getCamera(),r=this.context.config,i=r.width,r=r.height,a=n.getPerspectiveInverse(),n=n.getWorldTransform(),n=lt(this.tmpMatrix,n,a),a=Lt(this.tmpVec3,e/i*2-1,2*(1-t/r)-1,0);return Bt(a,a,n),new Tr(a[0],a[1])},pl.prototype.canvas2Viewport=function(t){var e=this.rootTarget.defaultView.getCamera(),n=e.getPerspective(),e=e.getViewTransform(),n=lt(this.tmpMatrix,n,e),e=Lt(this.tmpVec3,t.x,t.y,0),t=(Bt(this.tmpVec3,this.tmpVec3,n),this.context.config),n=t.width,t=t.height;return new Tr((e[0]+1)/2*n,(1-(e[1]+1)/2)*t)},pl.prototype.setPickHandler=function(t){this.pickHandler=t},pl.prototype.addEventMapping=function(t,e){this.mappingTable[t]||(this.mappingTable[t]=[]),this.mappingTable[t].push({fn:e,priority:0}),this.mappingTable[t].sort(function(t,e){return t.priority-e.priority})},pl.prototype.mapEvent=function(t){if(this.rootTarget){var e=this.mappingTable[t.type];if(e)for(var n=0,r=e.length;n<r;n++)e[n].fn(t);else console.warn("[EventService]: Event mapping not defined for ".concat(t.type))}},pl.prototype.dispatchEvent=function(t,e,n){n?(t.eventPhase=t.AT_TARGET,n=this.rootTarget.defaultView||null,t.currentTarget=n,this.notifyListeners(t,e)):(t.propagationStopped=!1,t.propagationImmediatelyStopped=!1,this.propagate(t,e)),this.emitter.emit(e||t.type,t)},pl.prototype.propagate=function(t,e){if(t.target){var n=t.composedPath();t.eventPhase=t.CAPTURING_PHASE;for(var r=n.length-1;1<=r;r--)if(t.currentTarget=n[r],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return;if(t.eventPhase=t.AT_TARGET,t.currentTarget=t.target,this.notifyTarget(t,e),!t.propagationStopped&&!t.propagationImmediatelyStopped){var i=n.indexOf(t.currentTarget);t.eventPhase=t.BUBBLING_PHASE;for(r=i+1;r<n.length;r++)if(t.currentTarget=n[r],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return}}},pl.prototype.propagationPath=function(t){var e=[t],n=this.rootTarget.defaultView||null;if(n&&n===t)e.unshift(n.document);else{for(var r=0;r<2048&&t!==this.rootTarget;r++)fl.isNode(t)&&t.parentNode&&(e.push(t.parentNode),t=t.parentNode);n&&e.push(n)}return e},pl.prototype.hitTest=function(t){var e=t.viewportX,n=t.viewportY,r=this.context.config,i=r.width,r=r.height;return!(e<0||n<0||i<e||r<n)&&(this.pickHandler(t)||this.rootTarget)||null},pl.prototype.isNativeEventFromCanvas=function(t){var e=this.context.contextService.getDomElement(),n=null==(n=t.nativeEvent)?void 0:n.target;if(n){if(n===e)return!0;if(e&&e.contains)return e.contains(n)}return!!t.nativeEvent.composedPath&&-1<t.nativeEvent.composedPath().indexOf(e)},pl.prototype.getExistedHTML=function(t){var e,n;if(t.nativeEvent.composedPath)try{for(var r=I(t.nativeEvent.composedPath()),i=r.next();!i.done;i=r.next()){var a=i.value,o=this.globalRuntime.nativeHTMLMap.get(a);if(o)return o}}catch(t){e={error:t}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}return null},pl.prototype.pickTarget=function(t){return this.hitTest({clientX:t.clientX,clientY:t.clientY,viewportX:t.viewportX,viewportY:t.viewportY,x:t.canvasX,y:t.canvasY})},pl.prototype.createPointerEvent=function(t,e,n,r){var i=this.allocateEvent(nl),t=(this.copyPointerData(t,i),this.copyMouseData(t,i),this.copyData(t,i),i.nativeEvent=t.nativeEvent,i.originalEvent=t,this.getExistedHTML(i));return i.target=null!=n?n:t||this.isNativeEventFromCanvas(i)&&this.pickTarget(i)||r,"string"==typeof e&&(i.type=e),i},pl.prototype.createWheelEvent=function(t){var e=this.allocateEvent(al),t=(this.copyWheelData(t,e),this.copyMouseData(t,e),this.copyData(t,e),e.nativeEvent=t.nativeEvent,e.originalEvent=t,this.getExistedHTML(e));return e.target=t||this.isNativeEventFromCanvas(e)&&this.pickTarget(e),e},pl.prototype.trackingData=function(t){return this.mappingState.trackingData[t]||(this.mappingState.trackingData[t]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[t]},pl.prototype.cloneWheelEvent=function(t){var e=this.allocateEvent(al);return e.nativeEvent=t.nativeEvent,e.originalEvent=t.originalEvent,this.copyWheelData(t,e),this.copyMouseData(t,e),this.copyData(t,e),e.target=t.target,e.path=t.composedPath().slice(),e.type=t.type,e},pl.prototype.clonePointerEvent=function(t,e){var n=this.allocateEvent(nl);return n.nativeEvent=t.nativeEvent,n.originalEvent=t.originalEvent,this.copyPointerData(t,n),this.copyMouseData(t,n),this.copyData(t,n),n.target=t.target,n.path=t.composedPath().slice(),n.type=null!=e?e:n.type,n},pl.prototype.copyPointerData=function(t,e){e.pointerId=t.pointerId,e.width=t.width,e.height=t.height,e.isPrimary=t.isPrimary,e.pointerType=t.pointerType,e.pressure=t.pressure,e.tangentialPressure=t.tangentialPressure,e.tiltX=t.tiltX,e.tiltY=t.tiltY,e.twist=t.twist},pl.prototype.copyMouseData=function(t,e){e.altKey=t.altKey,e.button=t.button,e.buttons=t.buttons,e.ctrlKey=t.ctrlKey,e.metaKey=t.metaKey,e.shiftKey=t.shiftKey,e.client.copyFrom(t.client),e.movement.copyFrom(t.movement),e.canvas.copyFrom(t.canvas),e.screen.copyFrom(t.screen),e.global.copyFrom(t.global),e.offset.copyFrom(t.offset)},pl.prototype.copyWheelData=function(t,e){e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ},pl.prototype.copyData=function(t,e){e.isTrusted=t.isTrusted,e.timeStamp=performance.now(),e.type=t.type,e.detail=t.detail,e.view=t.view,e.page.copyFrom(t.page),e.viewport.copyFrom(t.viewport)},pl.prototype.allocateEvent=function(t){this.eventPool.has(t)||this.eventPool.set(t,[]);t=this.eventPool.get(t).pop()||new t(this);return t.eventPhase=t.NONE,t.currentTarget=null,t.path=[],t.target=null,t},pl.prototype.freeEvent=function(t){if(t.manager!==this)throw new Error("It is illegal to free an event not managed by this EventBoundary!");var e=t.constructor;this.eventPool.has(e)||this.eventPool.set(e,[]),this.eventPool.get(e).push(t)},pl.prototype.notifyTarget=function(t,e){e=null!=e?e:t.type;var n=t.eventPhase===t.CAPTURING_PHASE||t.eventPhase===t.AT_TARGET?"".concat(e,"capture"):e;this.notifyListeners(t,n),t.eventPhase===t.AT_TARGET&&this.notifyListeners(t,e)},pl.prototype.notifyListeners=function(t,e){var n=t.currentTarget.emitter,r=n._events[e];if(r)if("fn"in r)r.once&&n.removeListener(e,r.fn,void 0,!0),r.fn.call(t.currentTarget||r.context,t);else for(var i=0;i<r.length&&!t.propagationImmediatelyStopped;i++)r[i].once&&n.removeListener(e,r[i].fn,void 0,!0),r[i].fn.call(t.currentTarget||r[i].context,t)},pl.prototype.findMountedTarget=function(t){if(!t)return null;for(var e=t[t.length-1],n=t.length-2;0<=n;n--){var r=t[n];if(!(r===this.rootTarget||fl.isNode(r)&&r.parentNode===e))break;e=t[n]}return e},pl.prototype.getCursor=function(t){for(var e=t;e;){var n=!!e.getAttribute&&e.getAttribute("cursor");if(n)return n;e=fl.isNode(e)&&e.parentNode}};var dl=pl;function pl(t,e){var c=this;this.globalRuntime=t,this.context=e,this.emitter=new V,this.cursor="default",this.mappingTable={},this.mappingState={trackingData:{}},this.eventPool=new Map,this.tmpMatrix=Z(),this.tmpVec3=At(),this.onPointerDown=function(t){var e,n=c.createPointerEvent(t);c.dispatchEvent(n,"pointerdown"),"touch"===n.pointerType?c.dispatchEvent(n,"touchstart"):"mouse"!==n.pointerType&&"pen"!==n.pointerType||(e=2===n.button,c.dispatchEvent(n,e?"rightdown":"mousedown")),c.trackingData(t.pointerId).pressTargetsByButton[t.button]=n.composedPath(),c.freeEvent(n)},this.onPointerUp=function(t){var e=performance.now(),n=c.createPointerEvent(t,void 0,void 0,c.context.config.alwaysTriggerPointerEventOnCanvas?c.rootTarget:void 0),r=(c.dispatchEvent(n,"pointerup"),"touch"===n.pointerType?c.dispatchEvent(n,"touchend"):"mouse"!==n.pointerType&&"pen"!==n.pointerType||(o=2===n.button,c.dispatchEvent(n,o?"rightup":"mouseup")),c.trackingData(t.pointerId)),i=c.findMountedTarget(r.pressTargetsByButton[t.button]),a=i;if(i&&!n.composedPath().includes(i)){for(var o,s=i;s&&!n.composedPath().includes(s);)n.currentTarget=s,c.notifyTarget(n,"pointerupoutside"),"touch"===n.pointerType?c.notifyTarget(n,"touchendoutside"):"mouse"!==n.pointerType&&"pen"!==n.pointerType||(o=2===n.button,c.notifyTarget(n,o?"rightupoutside":"mouseupoutside")),fl.isNode(s)&&(s=s.parentNode);delete r.pressTargetsByButton[t.button],a=s}a&&((i=c.clonePointerEvent(n,"click")).target=a,i.path=[],r.clicksByButton[t.button]||(r.clicksByButton[t.button]={clickCount:0,target:i.target,timeStamp:e}),(a=r.clicksByButton[t.button]).target===i.target&&e-a.timeStamp<200?++a.clickCount:a.clickCount=1,a.target=i.target,a.timeStamp=e,i.detail=a.clickCount,null!=(r=n.detail)&&r.preventClick||(c.context.config.useNativeClickEvent||"mouse"!==i.pointerType&&"touch"!==i.pointerType||c.dispatchEvent(i,"click"),c.dispatchEvent(i,"pointertap")),c.freeEvent(i)),c.freeEvent(n)},this.onPointerMove=function(t){var e=c.createPointerEvent(t,void 0,void 0,c.context.config.alwaysTriggerPointerEventOnCanvas?c.rootTarget:void 0),n="mouse"===e.pointerType||"pen"===e.pointerType,r=c.trackingData(t.pointerId),i=c.findMountedTarget(r.overTargets);if(r.overTargets&&i!==e.target){var a="mousemove"===t.type?"mouseout":"pointerout",a=c.createPointerEvent(t,a,i||void 0);if(c.dispatchEvent(a,"pointerout"),n&&c.dispatchEvent(a,"mouseout"),!e.composedPath().includes(i)){var o=c.createPointerEvent(t,"pointerleave",i||void 0);for(o.eventPhase=o.AT_TARGET;o.target&&!e.composedPath().includes(o.target);)o.currentTarget=o.target,c.notifyTarget(o),n&&c.notifyTarget(o,"mouseleave"),fl.isNode(o.target)&&(o.target=o.target.parentNode);c.freeEvent(o)}c.freeEvent(a)}if(i!==e.target){for(var a="mousemove"===t.type?"mouseover":"pointerover",t=c.clonePointerEvent(e,a),s=(c.dispatchEvent(t,"pointerover"),n&&c.dispatchEvent(t,"mouseover"),i&&fl.isNode(i)&&i.parentNode);s&&s!==(fl.isNode(c.rootTarget)&&c.rootTarget.parentNode)&&s!==e.target;)s=s.parentNode;if(!s||s===(fl.isNode(c.rootTarget)&&c.rootTarget.parentNode)){var l=c.clonePointerEvent(e,"pointerenter");for(l.eventPhase=l.AT_TARGET;l.target&&l.target!==i&&l.target!==(fl.isNode(c.rootTarget)&&c.rootTarget.parentNode);)l.currentTarget=l.target,c.notifyTarget(l),n&&c.notifyTarget(l,"mouseenter"),fl.isNode(l.target)&&(l.target=l.target.parentNode);c.freeEvent(l)}c.freeEvent(t)}c.dispatchEvent(e,"pointermove"),"touch"===e.pointerType&&c.dispatchEvent(e,"touchmove"),n&&(c.dispatchEvent(e,"mousemove"),c.cursor=c.getCursor(e.target)),r.overTargets=e.composedPath(),c.freeEvent(e)},this.onPointerOut=function(t){var e=c.trackingData(t.pointerId);if(e.overTargets){var n="mouse"===t.pointerType||"pen"===t.pointerType,r=c.findMountedTarget(e.overTargets),i=c.createPointerEvent(t,"pointerout",r||void 0),a=(c.dispatchEvent(i),n&&c.dispatchEvent(i,"mouseout"),c.createPointerEvent(t,"pointerleave",r||void 0));for(a.eventPhase=a.AT_TARGET;a.target&&a.target!==(fl.isNode(c.rootTarget)&&c.rootTarget.parentNode);)a.currentTarget=a.target,c.notifyTarget(a),n&&c.notifyTarget(a,"mouseleave"),fl.isNode(a.target)&&(a.target=a.target.parentNode);e.overTargets=null,c.freeEvent(i),c.freeEvent(a)}c.cursor=null},this.onPointerOver=function(t){var e=c.trackingData(t.pointerId),t=c.createPointerEvent(t),n="mouse"===t.pointerType||"pen"===t.pointerType,r=(c.dispatchEvent(t,"pointerover"),n&&c.dispatchEvent(t,"mouseover"),"mouse"===t.pointerType&&(c.cursor=c.getCursor(t.target)),c.clonePointerEvent(t,"pointerenter"));for(r.eventPhase=r.AT_TARGET;r.target&&r.target!==(fl.isNode(c.rootTarget)&&c.rootTarget.parentNode);)r.currentTarget=r.target,c.notifyTarget(r),n&&c.notifyTarget(r,"mouseenter"),fl.isNode(r.target)&&(r.target=r.target.parentNode);e.overTargets=t.composedPath(),c.freeEvent(t),c.freeEvent(r)},this.onPointerUpOutside=function(t){var e=c.trackingData(t.pointerId),n=c.findMountedTarget(e.pressTargetsByButton[t.button]),r=c.createPointerEvent(t);if(n){for(var i=n;i;)r.currentTarget=i,c.notifyTarget(r,"pointerupoutside"),"touch"===r.pointerType||"mouse"!==r.pointerType&&"pen"!==r.pointerType||c.notifyTarget(r,2===r.button?"rightupoutside":"mouseupoutside"),fl.isNode(i)&&(i=i.parentNode);delete e.pressTargetsByButton[t.button]}c.freeEvent(r)},this.onWheel=function(t){t=c.createWheelEvent(t);c.dispatchEvent(t),c.freeEvent(t)},this.onClick=function(t){c.context.config.useNativeClickEvent&&(t=c.createPointerEvent(t),c.dispatchEvent(t),c.freeEvent(t))},this.onPointerCancel=function(t){t=c.createPointerEvent(t,void 0,void 0,c.context.config.alwaysTriggerPointerEventOnCanvas?c.rootTarget:void 0);c.dispatchEvent(t),c.freeEvent(t)}}yl.prototype.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},yl.prototype.getOrCreateContext=function(t,e){return this.context||this.getOrCreateCanvas(t,e),this.context};var gl,o=yl;function yl(){}(xl=gl=gl||{})[xl.CAMERA_CHANGED=0]="CAMERA_CHANGED",xl[xl.DISPLAY_OBJECT_CHANGED=1]="DISPLAY_OBJECT_CHANGED",xl[xl.NONE=2]="NONE";vl.prototype.init=function(t){var e=this,n=m(m({},this.globalRuntime),this.context);this.context.renderingPlugins.forEach(function(t){t.apply(n,e.globalRuntime)}),this.hooks.init.call(),0===this.hooks.initAsync.getCallbacksNum()?(this.inited=!0,t()):this.hooks.initAsync.promise().then(function(){e.inited=!0,t()})},vl.prototype.getStats=function(){return this.stats},vl.prototype.disableDirtyRectangleRendering=function(){return!this.context.config.renderer.getConfig().enableDirtyRectangleRendering||this.context.renderingContext.renderReasons.has(gl.CAMERA_CHANGED)},vl.prototype.render=function(t,e){var n=this,r=(this.stats.total=0,this.stats.rendered=0,this.zIndexCounter=0,this.context.renderingContext);this.globalRuntime.sceneGraphService.syncHierarchy(r.root),this.globalRuntime.sceneGraphService.triggerPendingEvents(),r.renderReasons.size&&this.inited&&(this.renderDisplayObject(r.root,t,r),this.hooks.beginFrame.call(),r.renderListCurrentFrame.forEach(function(t){n.hooks.beforeRender.call(t),n.hooks.render.call(t),n.hooks.afterRender.call(t)}),this.hooks.endFrame.call(),r.renderListCurrentFrame=[],r.renderReasons.clear(),e())},vl.prototype.renderDisplayObject=function(t,e,n){var r=this,i=e.renderer.getConfig(),a=i.enableDirtyCheck,i=i.enableCulling,a=(this.globalRuntime.enableCSSParsing&&this.globalRuntime.styleValueRegistry.recalc(t),a?this.hooks.dirtycheck.call(t):t),a=(a&&(i=i?this.hooks.cull.call(a,this.context.camera):a)&&(this.stats.rendered++,n.renderListCurrentFrame.push(i)),t.renderable.dirty=!1,t.sortable.renderOrder=this.zIndexCounter++,this.stats.total++,t.sortable);a.dirty&&(this.sort(t,a),a.dirty=!1,a.dirtyChildren=[],a.dirtyReason=void 0),(a.sorted||t.childNodes).forEach(function(t){r.renderDisplayObject(t,e,n)})},vl.prototype.sort=function(n,r){r.sorted&&r.dirtyReason!==Mi.Z_INDEX_CHANGED?r.dirtyChildren.forEach(function(t){var e;-1===n.childNodes.indexOf(t)?0<=(e=r.sorted.indexOf(t))&&r.sorted.splice(e,1):0===r.sorted.length?r.sorted.push(t):(e=function(t,e){for(var n=0,r=t.length;n<r;){var i=n+r>>>1;is(t[i],e)<0?n=1+i:r=i}return n}(r.sorted,t),r.sorted.splice(e,0,t))}):r.sorted=n.childNodes.slice().sort(is)},vl.prototype.destroy=function(){this.inited=!1,this.hooks.destroy.call(),this.globalRuntime.sceneGraphService.clearPendingEvents()},vl.prototype.dirtify=function(){this.context.renderingContext.renderReasons.add(gl.DISPLAY_OBJECT_CHANGED)};var ml=vl;function vl(t,e){this.globalRuntime=t,this.context=e,this.inited=!1,this.stats={total:0,rendered:0},this.zIndexCounter=0,this.hooks={init:new Ss,initAsync:new Ms,dirtycheck:new _s,cull:new _s,beginFrame:new Ss,beforeRender:new Ss,render:new Ss,afterRender:new Ss,endFrame:new Ss,destroy:new Ss,pick:new ks,pickSync:new _s,pointerDown:new Ss,pointerUp:new Ss,pointerMove:new Ss,pointerOut:new Ss,pointerOver:new Ss,pointerWheel:new Ss,pointerCancel:new Ss,click:new Ss}}var bl=/\[\s*(.*)=(.*)\s*\]/,xl=(wl.prototype.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})},wl.prototype.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})},wl.prototype.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},wl.prototype.getIdOrClassname=function(t){return t.substring(1)},wl.prototype.getAttribute=function(t){var t=t.match(bl),e="",n="";return t&&2<t.length&&(e=t[1].replace(/"/g,""),n=t[2].replace(/"/g,"")),{name:e,value:n}},wl.prototype.attributeToString=function(t,e){return t.getAttribute&&(t=t.getAttribute(e),!A(t))&&t.toString?t.toString():""},wl);function wl(){}t(kl,Ml=Ks),kl.ADDITION=2,kl.MODIFICATION=1,kl.REMOVAL=3;var Ml,v,Ol=kl;function kl(t,e,n,r,i,a,o,s){var l=Ml.call(this,null)||this;return 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}function El(t){t=t.renderable;t&&(t.renderBoundsDirty=!0,t.boundsDirty=!0)}(Ks=v=v||{}).REPARENT="reparent",Ks.DESTROY="destroy",Ks.ATTR_MODIFIED="DOMAttrModified",Ks.INSERTED="DOMNodeInserted",Ks.REMOVED="removed",Ks.MOUNTED="DOMNodeInsertedIntoDocument",Ks.UNMOUNTED="DOMNodeRemovedFromDocument",Ks.BOUNDS_CHANGED="bounds-changed",Ks.CULLED="culled";var Sl=new Ol(v.REPARENT,null,"","","",0,"",""),Ks=(s.prototype.matches=function(t,e){return this.runtime.sceneGraphSelector.is(t,e)},s.prototype.querySelector=function(t,e){return this.runtime.sceneGraphSelector.selectOne(t,e)},s.prototype.querySelectorAll=function(t,e){return this.runtime.sceneGraphSelector.selectAll(t,e)},s.prototype.attach=function(t,e,n){var r=!1,n=(t.parentNode&&(r=t.parentNode!==e,this.detach(t)),t.parentNode=e,A(n)?t.parentNode.childNodes.push(t):t.parentNode.childNodes.splice(n,0,t),e.sortable),e=((null!=(e=null==n?void 0:n.sorted)&&e.length||null!=(e=t.style)&&e.zIndex)&&(-1===n.dirtyChildren.indexOf(t)&&n.dirtyChildren.push(t),n.dirty=!0,n.dirtyReason=Mi.ADDED),t.transformable);e&&this.dirtifyWorld(t,e),e.frozen&&this.unfreezeParentToRoot(t),r&&t.dispatchEvent(Sl)},s.prototype.detach=function(t){var e,n,r;t.parentNode&&(e=t.transformable,(null!=(r=null==(n=t.parentNode.sortable)?void 0:n.sorted)&&r.length||null!=(r=t.style)&&r.zIndex)&&(-1===n.dirtyChildren.indexOf(t)&&n.dirtyChildren.push(t),n.dirty=!0,n.dirtyReason=Mi.REMOVED),-1<(r=t.parentNode.childNodes.indexOf(t))&&t.parentNode.childNodes.splice(r,1),e&&this.dirtifyWorld(t,e),t.parentNode=null)},s.prototype.getOrigin=function(t){return t.transformable.origin},s.prototype.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))},s.prototype.setLocalEulerAngles=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=Tt(e,n,r));n=t.transformable;$t(n.localRotation,e[0],e[1],e[2]),this.dirtifyLocal(t,n)},s.prototype.scaleLocal=function(t,e){var n,r,i=t.transformable;n=i.localScale,r=i.localScale,e=Tt(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)},s.prototype.setLocalScale=function(t,e){var n=t.transformable,e=Tt(e[0],e[1],e[2]||n.localScale[2]);Ft(e,n.localScale)||(Pt(n.localScale,e),this.dirtifyLocal(t,n))},s.prototype.setLocalRotation=function(t,e,n,r,i){"number"==typeof e&&(e=Ut(e,n,r,i));n=t.transformable;Xt(n.localRotation,e),this.dirtifyLocal(t,n)},s.prototype.setLocalSkew=function(t,e,n){"number"==typeof e&&(i=e,n=n,(r=new $(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)},s.prototype.dirtifyLocal=function(t,e){e.localDirtyFlag||(e.localDirtyFlag=!0,e.dirtyFlag)||this.dirtifyWorld(t,e)},s.prototype.dirtifyWorld=function(t,e){e.dirtyFlag||this.unfreezeParentToRoot(t),this.dirtifyWorldInternal(t,e),this.dirtifyToRoot(t,!0)},s.prototype.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 t=j(t,2),e=t[0],n=t[1];n.affectChildren?e.forEach(function(t){r(t,n)}):r(e,n)}),this.clearPendingEvents(),i.clear()},s.prototype.clearPendingEvents=function(){this.pendingEvents=[]},s.prototype.dirtifyToRoot=function(t,e){void 0===e&&(e=!1);var n=t;for(n.renderable&&(n.renderable.dirty=!0);n;)El(n),n=n.parentNode;e&&t.forEach(function(t){El(t)}),this.informDependentDisplayObjects(t),this.pendingEvents.push([t,{affectChildren:e}])},s.prototype.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))},s.prototype.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 Ol(v.ATTR_MODIFIED,t,n,n,e,Ol.MODIFICATION,n,n)),t.isCustomElement&&t.isConnected&&t.attributeChangedCallback&&t.attributeChangedCallback(e,n,n)})})},s.prototype.getPosition=function(t){var e=t.transformable;return yt(e.position,this.getWorldTransform(t,e))},s.prototype.getRotation=function(t){var e=t.transformable;return vt(e.rotation,this.getWorldTransform(t,e))},s.prototype.getScale=function(t){var e=t.transformable;return mt(e.scaling,this.getWorldTransform(t,e))},s.prototype.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},s.prototype.getLocalPosition=function(t){return t.transformable.localPosition},s.prototype.getLocalRotation=function(t){return t.transformable.localRotation},s.prototype.getLocalScale=function(t){return t.transformable.localScale},s.prototype.getLocalSkew=function(t){return t.transformable.localSkew},s.prototype.getLocalTransform=function(t){t=t.transformable;return t.localDirtyFlag&&(this.calcLocalTransform(t),t.localDirtyFlag=!1),t.localTransform},s.prototype.setLocalTransform=function(t,e){var n=yt(At(),e),r=vt(Ht(),e),e=mt(At(),e);this.setLocalScale(t,e),this.setLocalPosition(t,n),this.setLocalRotation(t,r)},s.prototype.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])},s.prototype.getTransformedGeometryBounds=function(t,e,n){e=this.getGeometryBounds(t,e=void 0===e?!1:e);return Mr.isEmpty(e)?null:((n=n||new Mr).setFromTransformedAABB(e,this.getWorldTransform(t)),n)},s.prototype.getGeometryBounds=function(t,e){t=t.geometry;return((e=void 0===e?!1:e)?t.renderBounds:t.contentBounds||null)||new Mr},s.prototype.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 Mr).update(t.center,t.halfExtents))}),e&&(t=as(t))&&(t=t.parsedStyle.clipPath.getBounds(e),r?t&&(r=t.intersection(r)):r=t),(r=r||new Mr)&&(e?a.renderBounds=r:a.bounds=r),e?a.renderBoundsDirty=!1:a.boundsDirty=!1,r):a.bounds},s.prototype.getLocalBounds=function(t){if(t.parentNode){var e,n=Z(),r=(t.parentNode.transformable&&(n=nt(Z(),this.getWorldTransform(t.parentNode))),this.getBounds(t));if(!Mr.isEmpty(r))return(e=new Mr).setFromTransformedAABB(r,n),e}return this.getBounds(t)},s.prototype.getBoundingClientRect=function(t){var e,n,r,i=this.getGeometryBounds(t),i=(Mr.isEmpty(i)||(r=new Mr).setFromTransformedAABB(i,this.getWorldTransform(t)),null==(t=null==(i=t.ownerDocument)?void 0:i.defaultView)?void 0:t.getContextService().getBoundingClientRect());return r?(e=(t=j(r.getMin(),2))[0],t=t[1],n=(r=j(r.getMax(),2))[0],r=r[1],new Lr(e+((null==i?void 0:i.left)||0),t+((null==i?void 0:i.top)||0),n-e,r-t)):new Lr((null==i?void 0:i.left)||0,(null==i?void 0:i.top)||0,0,0)},s.prototype.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)},s.prototype.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])}},s.prototype.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?lt(e.worldTransform,n.worldTransform,e.localTransform):Q(e.worldTransform,e.localTransform),e.dirtyFlag=!1)},s.prototype.unfreezeParentToRoot=function(t){for(var e=t.parentNode;e;){var n=e.transformable;n&&(n.frozen=!1),e=e.parentNode}},s);function s(t){var o,i,a,r,s,l,c,u,h,n,f,d,g=this;this.runtime=t,this.pendingEvents=[],this.boundsChangedEvent=new ll(v.BOUNDS_CHANGED),this.rotate=(o=Ht(),function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=Tt(e,n,r));var i,a,n=t.transformable;null!==t.parentNode&&t.parentNode.transformable?($t(r=Ht(),e[0],e[1],e[2]),i=g.getRotation(t),a=g.getRotation(t.parentNode),Xt(o,a),qt(o,o),Vt(r,o,r),Vt(n.localRotation,r,i),Zt(n.localRotation,n.localRotation),g.dirtifyLocal(t,n)):g.rotateLocal(t,e)}),this.rotateLocal=(i=Ht(),function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=Tt(e,n,r));n=t.transformable;$t(i,e[0],e[1],e[2]),Kt(n.localRotation,n.localRotation,i),g.dirtifyLocal(t,n)}),this.setEulerAngles=(a=Ht(),function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=Tt(e,n,r));n=t.transformable;null!==t.parentNode&&t.parentNode.transformable?($t(n.localRotation,e[0],e[1],e[2]),r=g.getRotation(t.parentNode),Xt(a,qt(Ht(),r)),Kt(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=Tt(e,n,r));var i,a,o,s,l,c,u,h,f,d,p,n=t.transformable;Ft(e,At())||(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*(f=l*c-o*i),l=l*(h=s*i-l*u)-o*d,o=o*f-s*h,f*=s=2*a,d*=s,l*=2,o*=2,r[0]=c+(h*=s)+(p*=2),r[1]=u+f+l,r[2]=i+d+o,Ct(n.localPosition,n.localPosition,e),g.dirtifyLocal(t,n))},this.setPosition=(r=Z(),s=At(),function(t,e){var n=t.transformable;s[0]=e[0],s[1]=e[1],s[2]=e[2]||0,Ft(g.getPosition(t),s)||(Pt(n.position,s),null!==t.parentNode&&t.parentNode.transformable?(e=t.parentNode.transformable,Q(r,e.worldTransform),nt(r,r),Bt(n.localPosition,s,r)):Pt(n.localPosition,s),g.dirtifyLocal(t,n))}),this.setLocalPosition=(l=At(),function(t,e){var n=t.transformable;l[0]=e[0],l[1]=e[1],l[2]=e[2]||0,Ft(n.localPosition,l)||(Pt(n.localPosition,l),g.dirtifyLocal(t,n))}),this.translate=(c=At(),u=At(),h=At(),function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),Ft(e="number"==typeof e?Lt(u,e,n,r):e,c)||(Ct(h,g.getPosition(t),e),g.setPosition(t,h))}),this.setRotation=function(){var o=Ht();return function(t,e,n,r,i){var a=t.transformable;"number"==typeof e&&(e=Ut(e,n,r,i)),null!==t.parentNode&&t.parentNode.transformable?(n=g.getRotation(t.parentNode),Xt(o,n),qt(o,o),Vt(a.localRotation,o,e),Zt(a.localRotation,a.localRotation),g.dirtifyLocal(t,a)):g.setLocalRotation(t,e)}},this.displayObjectDependencyMap=new WeakMap,this.calcLocalTransform=(n=Z(),f=At(),d=Ut(0,0,0,1),function(t){var e;0!==t.localSkew[0]||0!==t.localSkew[1]?(bt(t.localTransform,t.localRotation,t.localPosition,Tt(1,1,1),t.origin),0===t.localSkew[0]&&0===t.localSkew[1]||((e=tt(n))[4]=Math.tan(t.localSkew[0]),e[1]=Math.tan(t.localSkew[1]),lt(t.localTransform,t.localTransform,e)),e=bt(n,d,f,t.localScale,t.origin),lt(t.localTransform,t.localTransform,e)):bt(t.localTransform,t.localRotation,t.localPosition,t.localScale,t.origin)})}var Al={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]},_l=/[a-zA-Z0-9\u00C0-\u00D6\u00D8-\u00f6\u00f8-\u00ff!"#$%&'()*+,-./:;]/,Tl=new RegExp("".concat(/[!%),.:;?\]}¢°·'""†‡›℃∶、。〃〆〕〗〞﹚﹜!"%'),.:;?!]}~]/.source,"|").concat(/[!),.:;?\]}¢·–—'"•"、。〆〞〕〉》」︰︱︲︳﹐﹑﹒﹔﹕﹖﹘﹚﹜!),.:;?︶︸︺︼︾﹀﹂﹗]|}、]/.source,"|").concat(/[)\]}〕〉》」』】〙〗〟'"⦆»ヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻‐゠–〜?!‼⁇⁈⁉・、:;,。.]/.source,"|").concat(/[!%),.:;?\]}¢°'"†‡℃〆〈《「『〕!%),.:;?]}]/.source)),Pl=new RegExp("".concat(/[$(£¥·'"〈《「『【〔〖〝﹙﹛$(.[{£¥]/.source,"|").concat(/[([{£¥'"‵〈《「『〔〝︴﹙﹛({︵︷︹︻︽︿﹁﹃﹏]/.source,"|").concat(/[([{〔〈《「『【〘〖〝'"⦅«—...‥〳〴〵]/.source,"|").concat(/[$([{£¥'"々〇〉》」〔$([{⦆¥₩#]/.source)),Ll=(Cl.prototype.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,{willReadFrequently:!0}),i=(e.font=t,Al.MetricsString+Al.BaselineSymbol),a=Math.ceil(e.measureText(i).width),o=Math.ceil(e.measureText(Al.BaselineSymbol).width),s=Al.HeightMultiplier*o,o=o*Al.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,h=0,f=!1,u=0;u<o;++u){for(var d=0;d<c;d+=4)if(255!==l[h+d]){f=!0;break}if(f)break;h+=c}for(n.ascent=o-u,h=r-c,f=!1,u=s;o<u;--u){for(d=0;d<c;d+=4)if(255!==l[h+d]){f=!0;break}if(f)break;h-=c}return n.descent=u-o,n.fontSize=n.ascent+n.descent,this.fontMetricsCache[t]=n},Cl.prototype.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,h=(e.textPathSide,e.textPathStartOffset,e.leading),h=void 0===h?0:h,f=function(t){for(var e=t.fontSize,n=t.fontFamily,r=t.fontStyle,i=t.fontVariant,t=t.fontWeight,e=De(e)&&"".concat(e,"px")||"16px",a=n.split(","),o=a.length-1;0<=o;o--){var s=a[o].trim();!Ls.test(s)&&Ps.indexOf(s)<0&&(s='"'.concat(s,'"')),a[o]=s}return"".concat(r," ").concat(i," ").concat(t," ").concat(e," ").concat(a.join(","))}(e),d=this.measureFont(f,n),p=(0===d.fontSize&&(d.fontSize=r,d.ascent=r),this.runtime.offscreenCanvas.getOrCreateContext(n));p.font=f,e.isOverflowing=!1;var g=(i?this.wordWrap(t,e,n):t).split(/(?:\r\n|\r|\n)/),y=new Array(g.length),m=0;if(!u){for(M=0;M<g.length;M++){var v=p.measureText(g[M]).width+(g[M].length-1)*c;y[M]=v,m=Math.max(m,v)}var b=m+o,x=a||d.fontSize+o,r=Math.max(x,d.fontSize+o)+(g.length-1)*(x+h),w=0;return"middle"===s?w=-r/2:"bottom"===s||"alphabetic"===s||"ideographic"===s?w=-r:"top"!==s&&"hanging"!==s||(w=0),{font:f,width:b,height:r,lines:g,lineWidths:y,lineHeight:x+=h,maxLineWidth:m,fontProperties:d,lineMetrics:y.map(function(t,e){var n=0;return"center"===l||"middle"===l?n-=t/2:"right"!==l&&"end"!==l||(n-=t),new Lr(n-o/2,w+e*x,t+o,x)})}}u.getTotalLength();for(var M=0;M<g.length;M++)var b=p.measureText(g[M]).width+(g[M].length-1)*c},Cl.prototype.setGraphemeOnPath=function(){},Cl.prototype.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="",h=("ellipsis"===o?u="...":o&&"clip"!==o&&(u=o),[]),f=0,d=0,p={},g=function(t){return r.getFromCache(t,a,p,l)},y=Array.from(u).reduce(function(t,e){return t+g(e)},0),m=Array.from(t),v=0;v<m.length;v++){var b=m[v],x=t[v-1],w=t[v+1],M=g(b);if(this.isNewline(b)){if(s<=++f){e.isOverflowing=!0;break}d=0,h[f]=""}else{if(0<d&&c<d+M){if(s<=f+1){if(e.isOverflowing=!0,0<y&&y<=c){for(var O=h[f].length,k=0,E=O,S=0;S<O;S++){var A=g(h[f][S]);if(c<k+A+y){E=S;break}k+=A}h[f]=(h[f]||"").slice(0,E)+u}break}if(d=0,h[++f]="",this.isBreakingSpace(b))continue;this.canBreakInLastChar(b)||(h=this.trimToBreakable(h),d=this.sumTextWidthByCache(h[f]||"",p)),this.shouldBreakByKinsokuShorui(b,w)&&(h=this.trimByKinsokuShorui(h),d+=g(x||""))}d+=M,h[f]=(h[f]||"")+b}}return h.join("\n")},Cl.prototype.isBreakingSpace=function(t){return"string"==typeof t&&0<=Al.BreakingSpaces.indexOf(t.charCodeAt(0))},Cl.prototype.isNewline=function(t){return"string"==typeof t&&0<=Al.Newlines.indexOf(t.charCodeAt(0))},Cl.prototype.trimToBreakable=function(t){var e,t=M([],j(t),!1),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},Cl.prototype.canBreakInLastChar=function(t){return!t||!_l.test(t)},Cl.prototype.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)},Cl.prototype.findBreakableIndex=function(t){for(var e=t.length-1;0<=e;e--)if(!_l.test(t[e]))return e;return-1},Cl.prototype.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},Cl);function Cl(t){var n=this;this.runtime=t,this.fontMetricsCache={},this.shouldBreakByKinsokuShorui=function(t,e){return!n.isBreakingSpace(e)&&!(!t||!Pl.exec(e)&&!Tl.exec(t))},this.trimByKinsokuShorui=function(t){var e,n=M([],j(t),!1),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}}var Nl,_={},Is=(qs=new qs,Ys=new Ys,(ad={})[O.CIRCLE]=new Is,ad[O.ELLIPSE]=new Ds,ad[O.RECT]=qs,ad[O.IMAGE]=qs,ad[O.GROUP]=qs,ad[O.LINE]=new zs,ad[O.TEXT]=new Us(_),ad[O.POLYLINE]=Ys,ad[O.POLYGON]=Ys,ad[O.PATH]=new Gs,ad[O.HTML]=null,ad[O.MESH]=null,ad),Us=(Ds=new xo,qs=new Eo,(zs={})[a.PERCENTAGE]=null,zs[a.NUMBER]=new Do,zs[a.ANGLE]=new ki,zs[a.DEFINED_PATH]=new i,zs[a.PAINT]=Ds,zs[a.COLOR]=Ds,zs[a.FILTER]=new Mo,zs[a.LENGTH]=qs,zs[a.LENGTH_PERCENTAGE]=qs,zs[a.LENGTH_PERCENTAGE_12]=new Ao,zs[a.LENGTH_PERCENTAGE_14]=new To,zs[a.COORDINATE]=new jo,zs[a.OFFSET_DISTANCE]=new zo,zs[a.OPACITY_VALUE]=new Go,zs[a.PATH]=new Yo,zs[a.LIST_OF_POINTS]=new qo,zs[a.SHADOW_BLUR]=new Xo,zs[a.TEXT]=new Zo,zs[a.TEXT_TRANSFORM]=new Jo,zs[a.TRANSFORM]=new bs,zs[a.TRANSFORM_ORIGIN]=new Ns,zs[a.Z_INDEX]=new js,zs[a.MARKER]=new Io,zs),jl=(_.CameraContribution=n,_.AnimationTimeline=null,_.EasingFunction=null,_.offscreenCanvas=new o,_.nativeHTMLMap=new WeakMap,_.sceneGraphSelector=new xl,_.sceneGraphService=new Ks(_),_.textService=new Ll(_),_.geometryUpdaterFactory=Is,_.CSSPropertySyntaxFactory=Us,_.styleValueRegistry=new Zr(_),_.layoutRegistry=null,_.globalThis=function(){if("undefined"!=typeof globalThis)return globalThis;if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==E)return E;throw new Error("Unable to locate global `this`")}(),_.enableCSSParsing=!0,_.enableDataset=!1,_.enableStyleSyntax=!0,0),Rl=new Ol(v.INSERTED,null,"","","",0,"",""),Il=new Ol(v.REMOVED,null,"","","",0,"",""),Bl=new ll(v.DESTROY),Ys=(t(l,Nl=fl),Object.defineProperty(l.prototype,"className",{get:function(){return this.getAttribute("class")||""},set:function(t){this.setAttribute("class",t)},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"classList",{get:function(){return this.className.split(" ").filter(function(t){return""!==t})},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"tagName",{get:function(){return this.nodeName},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"children",{get:function(){return this.childNodes},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"childElementCount",{get:function(){return this.childNodes.length},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"firstElementChild",{get:function(){return this.firstChild},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"lastElementChild",{get:function(){return this.lastChild},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"parentElement",{get:function(){return this.parentNode},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"nextSibling",{get:function(){var t;return this.parentNode&&(t=this.parentNode.childNodes.indexOf(this),this.parentNode.childNodes[t+1])||null},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"previousSibling",{get:function(){var t;return this.parentNode&&(t=this.parentNode.childNodes.indexOf(this),this.parentNode.childNodes[t-1])||null},enumerable:!1,configurable:!0}),l.prototype.cloneNode=function(t){throw new Error(Ir)},l.prototype.appendChild=function(t,e){if(t.destroyed)throw new Error("Cannot append a destroyed element.");return _.sceneGraphService.attach(t,this,e),null!=(e=this.ownerDocument)&&e.defaultView&&this.ownerDocument.defaultView.mountChildren(t),Rl.relatedNode=this,t.dispatchEvent(Rl),t},l.prototype.insertBefore=function(t,e){return e?(e=this.childNodes.indexOf(e),this.appendChild(t,e-1)):this.appendChild(t),t},l.prototype.replaceChild=function(t,e){var n=this.childNodes.indexOf(e);return this.removeChild(e),this.appendChild(t,n),e},l.prototype.removeChild=function(t){var e;return Il.relatedNode=this,t.dispatchEvent(Il),null!=(e=t.ownerDocument)&&e.defaultView&&t.ownerDocument.defaultView.unmountChildren(t),_.sceneGraphService.detach(t),t},l.prototype.removeChildren=function(){for(var t=this.childNodes.length-1;0<=t;t--){var e=this.childNodes[t];this.removeChild(e)}},l.prototype.destroyChildren=function(){for(var t=this.childNodes.length-1;0<=t;t--){var e=this.childNodes[t];e.childNodes.length&&e.destroyChildren(),e.destroy()}},l.prototype.matches=function(t){return _.sceneGraphService.matches(t,this)},l.prototype.getElementById=function(t){return _.sceneGraphService.querySelector("#".concat(t),this)},l.prototype.getElementsByName=function(t){return _.sceneGraphService.querySelectorAll('[name="'.concat(t,'"]'),this)},l.prototype.getElementsByClassName=function(t){return _.sceneGraphService.querySelectorAll(".".concat(t),this)},l.prototype.getElementsByTagName=function(t){return _.sceneGraphService.querySelectorAll(t,this)},l.prototype.querySelector=function(t){return _.sceneGraphService.querySelector(t,this)},l.prototype.querySelectorAll=function(t){return _.sceneGraphService.querySelectorAll(t,this)},l.prototype.closest=function(t){var e=this;do{if(_.sceneGraphService.matches(t,e))return e}while(null!==(e=e.parentElement));return null},l.prototype.find=function(e){var n=this,r=null;return this.forEach(function(t){return!(t===n||!e(t)||(r=t,0))}),r},l.prototype.findAll=function(e){var n=this,r=[];return this.forEach(function(t){t!==n&&e(t)&&r.push(t)}),r},l.prototype.after=function(){for(var r,i=this,t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.parentNode&&(r=this.parentNode.childNodes.indexOf(this),t.forEach(function(t,e){var n;return null==(n=i.parentNode)?void 0:n.appendChild(t,r+e+1)}))},l.prototype.before=function(){for(var t,e,n,r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];this.parentNode&&(t=this.parentNode.childNodes.indexOf(this),e=(n=j(r))[0],n=n.slice(1),this.parentNode.appendChild(e,t),e.after.apply(e,M([],j(n),!1)))},l.prototype.replaceWith=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.after.apply(this,M([],j(t),!1)),this.remove()},l.prototype.append=function(){for(var e=this,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];t.forEach(function(t){return e.appendChild(t)})},l.prototype.prepend=function(){for(var n=this,t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];t.forEach(function(t,e){return n.appendChild(t,e)})},l.prototype.replaceChildren=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(;this.childNodes.length&&this.firstChild;)this.removeChild(this.firstChild);this.append.apply(this,M([],j(t),!1))},l.prototype.remove=function(){return this.parentNode?this.parentNode.removeChild(this):this},l.prototype.destroy=function(){this.dispatchEvent(Bl),this.remove(),this.emitter.removeAllListeners(),this.destroyed=!0},l.prototype.getGeometryBounds=function(){return _.sceneGraphService.getGeometryBounds(this)},l.prototype.getRenderBounds=function(){return _.sceneGraphService.getBounds(this,!0)},l.prototype.getBounds=function(){return _.sceneGraphService.getBounds(this)},l.prototype.getLocalBounds=function(){return _.sceneGraphService.getLocalBounds(this)},l.prototype.getBoundingClientRect=function(){return _.sceneGraphService.getBoundingClientRect(this)},l.prototype.getClientRects=function(){return[this.getBoundingClientRect()]},l.prototype.computedStyleMap=function(){return new Map(Object.entries(this.computedStyle))},l.prototype.getAttributeNames=function(){return Object.keys(this.attributes)},l.prototype.getAttribute=function(t){var e;return"symbol"==typeof t?_.enableCSSParsing?null:void 0:void 0===(e=this.attributes[t])&&(t=fi(t),e=this.attributes[t],_.enableCSSParsing)&&A(e)?null:e},l.prototype.hasAttribute=function(t){return this.getAttributeNames().includes(t)},l.prototype.hasAttributes=function(){return!!this.getAttributeNames().length},l.prototype.removeAttribute=function(t){this.setAttribute(t,null),delete this.attributes[t]},l.prototype.setAttribute=function(t,e,n){this.attributes[t]=e},l.prototype.getAttributeNS=function(t,e){throw new Error(Ir)},l.prototype.getAttributeNode=function(t){throw new Error(Ir)},l.prototype.getAttributeNodeNS=function(t,e){throw new Error(Ir)},l.prototype.hasAttributeNS=function(t,e){throw new Error(Ir)},l.prototype.removeAttributeNS=function(t,e){throw new Error(Ir)},l.prototype.removeAttributeNode=function(t){throw new Error(Ir)},l.prototype.setAttributeNS=function(t,e,n){throw new Error(Ir)},l.prototype.setAttributeNode=function(t){throw new Error(Ir)},l.prototype.setAttributeNodeNS=function(t){throw new Error(Ir)},l.prototype.toggleAttribute=function(t,e){throw new Error(Ir)},l);function l(){var t=null!==Nl&&Nl.apply(this,arguments)||this;return t.entity=jl++,t.renderable={bounds:void 0,boundsDirty:!0,renderBounds:void 0,renderBoundsDirty:!0,dirtyRenderBounds:void 0,dirty:!1,proxyNodeName:void 0},t.cullable={strategy:wi.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.namespaceURI="g",t.scrollLeft=0,t.scrollTop=0,t.clientTop=0,t.clientLeft=0,t.destroyed=!1,t.style={},t.computedStyle=_.enableCSSParsing?{anchor:Oi,opacity:Oi,fillOpacity:Oi,strokeOpacity:Oi,fill:Oi,stroke:Oi,transform:Oi,transformOrigin:Oi,visibility:Oi,pointerEvents:Oi,lineWidth:Oi,lineCap:Oi,lineJoin:Oi,increasedLineWidthForHitTesting:Oi,fontSize:Oi,fontFamily:Oi,fontStyle:Oi,fontWeight:Oi,fontVariant:Oi,textAlign:Oi,textBaseline:Oi,textTransform:Oi,zIndex:Oi,filter:Oi,shadowType:Oi}:null,t.parsedStyle={},t.attributes={},t}function Dl(t){return null!=t&&t.nodeName}var Fl,zl=new Ol(v.ATTR_MODIFIED,null,null,null,null,Ol.MODIFICATION,null,null),Wl={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:""},Gl={anchor:[0,0],fill:Si,stroke:Si,transform:[],zIndex:0,filter:[],shadowType:"outer",miterLimit:10},Hl=m(m({},Gl),{opacity:1,fillOpacity:1,strokeOpacity:1,visibility:"visible",pointerEvents:"auto",lineWidth:1,lineCap:"butt",lineJoin:"miter",increasedLineWidthForHitTesting:0,fillRule:"nonzero"}),Yl=M(M([],j(["opacity","fillOpacity","strokeOpacity","transformOrigin","visibility","pointerEvents","lineWidth","lineCap","lineJoin","increasedLineWidthForHitTesting"]),!1),["fontSize","fontFamily","fontStyle","fontWeight","fontVariant","textAlign","textBaseline","textTransform"],!1),Vl=(t(c,Fl=Ys),c.prototype.destroy=function(){Fl.prototype.destroy.call(this),this.getAnimations().forEach(function(t){t.cancel()})},c.prototype.cloneNode=function(e,t){var n,r=m({},this.attributes);for(n in r){var i=r[n];Dl(i)&&"clipPath"!==n&&"offsetPath"!==n&&"textPath"!==n&&(r[n]=i.cloneNode(e)),t&&(r[n]=t(n,i))}var a=new this.constructor({id:this.id,name:this.name,className:this.name,interactive:this.interactive,style:r});return a.setLocalTransform(this.getLocalTransform()),e&&this.children.forEach(function(t){t.style.isMarker||(t=t.cloneNode(e),a.appendChild(t))}),a},c.prototype.initAttributes=function(t){void 0===t&&(t={});var e,n=this.renderable,r={forceUpdateGeometry:!0},i=(_.enableCSSParsing&&(r.usedAttributes=Yl),{});for(e in t)i[fi(e)]=t[e];_.styleValueRegistry.processProperties(this,i,r),n.dirty=!0},c.prototype.setAttribute=function(t,e,n){void 0===n&&(n=!1);t=fi(t);qe(e)||!n&&e===this.attributes[t]||(this.internalSetAttribute(t,e),Fl.prototype.setAttribute.call(this,t,e))},c.prototype.internalSetAttribute=function(t,e,n){void 0===n&&(n={});var r=this.renderable,i=this.attributes[t],a=this.parsedStyle[t],o=(_.styleValueRegistry.processProperties(this,((o={})[t]=e,o),n),r.dirty=!0,this.parsedStyle[t]);this.isConnected&&(zl.relatedNode=this,zl.prevValue=i,zl.newValue=e,zl.attrName=t,zl.prevParsedValue=a,zl.newParsedValue=o,this.isMutationObserved?this.dispatchEvent(zl):(zl.target=this).ownerDocument.defaultView.dispatchEvent(zl,!0)),(this.isCustomElement&&this.isConnected||!this.isCustomElement)&&this.attributeChangedCallback&&this.attributeChangedCallback(t,i,e,a,o)},c.prototype.getBBox=function(){var t=this.getBounds(),e=j(t.getMin(),2),n=e[0],e=e[1],t=j(t.getMax(),2),r=t[0],t=t[1];return new Lr(n,e,r-n,t-e)},c.prototype.setOrigin=function(t,e,n){return _.sceneGraphService.setOrigin(this,ur(t,e=void 0===e?0:e,n=void 0===n?0:n)),this},c.prototype.getOrigin=function(){return _.sceneGraphService.getOrigin(this)},c.prototype.setPosition=function(t,e,n){return _.sceneGraphService.setPosition(this,ur(t,e=void 0===e?0:e,n=void 0===n?0:n)),this},c.prototype.setLocalPosition=function(t,e,n){return _.sceneGraphService.setLocalPosition(this,ur(t,e=void 0===e?0:e,n=void 0===n?0:n)),this},c.prototype.translate=function(t,e,n){return _.sceneGraphService.translate(this,ur(t,e=void 0===e?0:e,n=void 0===n?0:n)),this},c.prototype.translateLocal=function(t,e,n){return _.sceneGraphService.translateLocal(this,ur(t,e=void 0===e?0:e,n=void 0===n?0:n)),this},c.prototype.getPosition=function(){return _.sceneGraphService.getPosition(this)},c.prototype.getLocalPosition=function(){return _.sceneGraphService.getLocalPosition(this)},c.prototype.scale=function(t,e,n){return this.scaleLocal(t,e,n)},c.prototype.scaleLocal=function(t,e,n){return"number"==typeof t&&(t=ur(t,e=e||t,n=n||t)),_.sceneGraphService.scaleLocal(this,t),this},c.prototype.setLocalScale=function(t,e,n){return"number"==typeof t&&(t=ur(t,e=e||t,n=n||t)),_.sceneGraphService.setLocalScale(this,t),this},c.prototype.getLocalScale=function(){return _.sceneGraphService.getLocalScale(this)},c.prototype.getScale=function(){return _.sceneGraphService.getScale(this)},c.prototype.getEulerAngles=function(){return fr(j(dr(At(),_.sceneGraphService.getWorldTransform(this)),3)[2])},c.prototype.getLocalEulerAngles=function(){return fr(j(dr(At(),_.sceneGraphService.getLocalRotation(this)),3)[2])},c.prototype.setEulerAngles=function(t){return _.sceneGraphService.setEulerAngles(this,0,0,t),this},c.prototype.setLocalEulerAngles=function(t){return _.sceneGraphService.setLocalEulerAngles(this,0,0,t),this},c.prototype.rotateLocal=function(t,e,n){return A(e)&&A(n)?_.sceneGraphService.rotateLocal(this,0,0,t):_.sceneGraphService.rotateLocal(this,t,e,n),this},c.prototype.rotate=function(t,e,n){return A(e)&&A(n)?_.sceneGraphService.rotate(this,0,0,t):_.sceneGraphService.rotate(this,t,e,n),this},c.prototype.setRotation=function(t,e,n,r){return _.sceneGraphService.setRotation(this,t,e,n,r),this},c.prototype.setLocalRotation=function(t,e,n,r){return _.sceneGraphService.setLocalRotation(this,t,e,n,r),this},c.prototype.setLocalSkew=function(t,e){return _.sceneGraphService.setLocalSkew(this,t,e),this},c.prototype.getRotation=function(){return _.sceneGraphService.getRotation(this)},c.prototype.getLocalRotation=function(){return _.sceneGraphService.getLocalRotation(this)},c.prototype.getLocalSkew=function(){return _.sceneGraphService.getLocalSkew(this)},c.prototype.getLocalTransform=function(){return _.sceneGraphService.getLocalTransform(this)},c.prototype.getWorldTransform=function(){return _.sceneGraphService.getWorldTransform(this)},c.prototype.setLocalTransform=function(t){return _.sceneGraphService.setLocalTransform(this,t),this},c.prototype.resetLocalTransform=function(){_.sceneGraphService.resetLocalTransform(this)},c.prototype.getAnimations=function(){return this.activeAnimations},c.prototype.animate=function(t,e){var n=null==(n=this.ownerDocument)?void 0:n.timeline;return n?n.play(this,t,e):null},c.prototype.isVisible=function(){var t;return"visible"===(null==(t=this.parsedStyle)?void 0:t.visibility)},Object.defineProperty(c.prototype,"interactive",{get:function(){return this.isInteractive()},set:function(t){this.style.pointerEvents=t?"auto":"none"},enumerable:!1,configurable:!0}),c.prototype.isInteractive=function(){var t;return"none"!==(null==(t=this.parsedStyle)?void 0:t.pointerEvents)},c.prototype.isCulled=function(){return!(!this.cullable||!this.cullable.enable||this.cullable.visible)},c.prototype.toFront=function(){return this.parentNode&&(this.style.zIndex=Math.max.apply(Math,M([],j(this.parentNode.children.map(function(t){return Number(t.style.zIndex)})),!1))+1),this},c.prototype.toBack=function(){return this.parentNode&&(this.style.zIndex=Math.min.apply(Math,M([],j(this.parentNode.children.map(function(t){return Number(t.style.zIndex)})),!1))-1),this},c.prototype.getConfig=function(){return this.config},c.prototype.attr=function(){for(var e=this,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=j(t,2),i=r[0],r=r[1];return i?Pe(i)?(Object.keys(i).forEach(function(t){e.setAttribute(t,i[t])}),this):2===t.length?(this.setAttribute(i,r),this):this.attributes[i]:this.attributes},c.prototype.getMatrix=function(t){var t=t||this.getWorldTransform(),e=j(yt(At(),t),2),n=e[0],e=e[1],r=j(mt(At(),t),2),i=r[0],r=r[1],t=vt(Ht(),t),t=j(dr(At(),t),3),a=t[0],t=t[2];return pr(a||t,n,e,i,r)},c.prototype.getLocalMatrix=function(){return this.getMatrix(this.getLocalTransform())},c.prototype.setMatrix=function(t){var t=j(gr(t),5),e=t[0],n=t[1],r=t[2],i=t[3],t=t[4];this.setEulerAngles(t).setPosition(e,n).setLocalScale(r,i)},c.prototype.setLocalMatrix=function(t){var t=j(gr(t),5),e=t[0],n=t[1],r=t[2],i=t[3],t=t[4];this.setLocalEulerAngles(t).setLocalPosition(e,n).setLocalScale(r,i)},c.prototype.show=function(){_.enableCSSParsing?this.style.visibility="visible":this.forEach(function(t){t.style.visibility="visible"})},c.prototype.hide=function(){_.enableCSSParsing?this.style.visibility="hidden":this.forEach(function(t){t.style.visibility="hidden"})},c.prototype.getCount=function(){return this.childElementCount},c.prototype.getParent=function(){return this.parentElement},c.prototype.getChildren=function(){return this.children},c.prototype.getFirst=function(){return this.firstElementChild},c.prototype.getLast=function(){return this.lastElementChild},c.prototype.getChildByIndex=function(t){return this.children[t]||null},c.prototype.add=function(t,e){return this.appendChild(t,e)},c.prototype.setClip=function(t){this.style.clipPath=t},c.prototype.set=function(t,e){this.config[t]=e},c.prototype.get=function(t){return this.config[t]},c.prototype.moveTo=function(t,e,n){return this.setPosition(t,e=void 0===e?0:e,n=void 0===n?0:n),this},c.prototype.move=function(t,e,n){return this.setPosition(t,e=void 0===e?0:e,n=void 0===n?0:n),this},c.prototype.setZIndex=function(t){return this.style.zIndex=t,this},c);function c(t){var r=this,t=((r=Fl.call(this)||this).isCustomElement=!1,r.isMutationObserved=!1,r.activeAnimations=[],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||O.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,_.enableCSSParsing?Gl:Hl,r.config.initialParsedStyle),_.enableCSSParsing&&Object.assign(r.attributes,Wl),r.initAttributes(r.config.style),_.globalThis.Proxy||function(){});return _.enableDataset&&(r.dataset=new t({},{get:function(t,e){e="".concat("data-").concat(ai(e));return void 0!==t[e]?t[e]:r.getAttribute(e)},set:function(t,e,n){return r.setAttribute("".concat("data-").concat(ai(e)),n),!0}})),_.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}var ql,$l=function(t){var e=t.name,n=t.inherits,r=t.interpolable,i=t.initialValue,t=t.syntax;_.styleValueRegistry.registerMetadata({n:e,inh:n,int:r,d:i,syntax:t})},Ul=(t(Xl,ql=Vl),Xl);function Xl(t){var e=(t=void 0===t?{}:t).style,t=it(t,["style"]);return ql.call(this,m({type:O.CIRCLE,style:_.enableCSSParsing?m({cx:"",cy:"",r:""},e):m({},e),initialParsedStyle:{anchor:[.5,.5],transformOrigin:_.enableCSSParsing?null:[Pi,Pi]}},t))||this}t(Ql,Kl=Vl);var Kl,Zl=Ql;function Ql(t){var e=this,n=(t=void 0===t?{}:t).style,t=it(t,["style"]);return(e=Kl.call(this,m({style:_.enableCSSParsing?m({x:"",y:""},n):m({},n)},t))||this).isCustomElement=!0,e}t(ec,Jl=Vl);var Jl,tc=ec;function ec(t){var e=(t=void 0===t?{}:t).style,t=it(t,["style"]);return Jl.call(this,m({type:O.ELLIPSE,style:_.enableCSSParsing?m({cx:"",cy:"",rx:"",ry:""},e):m({},e),initialParsedStyle:{anchor:[.5,.5],transformOrigin:_.enableCSSParsing?null:[Pi,Pi]}},t))||this}t(ic,nc=Vl);var nc,rc=ic;function ic(t){var e=(t=void 0===t?{}:t).style,t=it(t,["style"]);return nc.call(this,m({type:O.GROUP,style:_.enableCSSParsing?m({x:"",y:"",width:"",height:""},e):m({},e)},t))||this}t(sc,ac=Vl),sc.prototype.getDomElement=function(){return this.parsedStyle.$el},sc.prototype.getBoundingClientRect=function(){return this.parsedStyle.$el.getBoundingClientRect()},sc.prototype.getClientRects=function(){return[this.getBoundingClientRect()]},sc.prototype.getBounds=function(){var t,e,n=this.getBoundingClientRect(),r=null==(r=null==(r=this.ownerDocument)?void 0:r.defaultView)?void 0:r.getContextService().getBoundingClientRect();return r?(t=n.left-r.left,r=n.top-r.top,(e=new Mr).setMinMax([t,r,0],[t+n.width,r+n.height,0]),e):null},sc.prototype.getLocalBounds=function(){if(this.parentNode){var t,e=nt(Z(),this.parentNode.getWorldTransform()),n=this.getBounds();if(!Mr.isEmpty(n))return(t=new Mr).setFromTransformedAABB(n,e),t}return this.getBounds()};var ac,oc=sc;function sc(t){var e=this,n=(t=void 0===t?{}:t).style,t=it(t,["style"]);return(e=ac.call(this,m({type:O.HTML,style:_.enableCSSParsing?m({x:"",y:"",width:"auto",height:"auto",innerHTML:""},n):m({},n)},t))||this).cullable.enable=!1,e}t(uc,lc=Vl);var lc,cc=uc;function uc(t){var e=(t=void 0===t?{}:t).style,t=it(t,["style"]);return lc.call(this,m({type:O.IMAGE,style:_.enableCSSParsing?m({x:"",y:"",img:"",width:"",height:""},e):m({},e)},t))||this}t(dc,hc=Vl),dc.prototype.attributeChangedCallback=function(t,e,n,r,i){"x1"===t||"y1"===t||"x2"===t||"y2"===t||"markerStartOffset"===t||"markerEndOffset"===t?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===t?(r&&Dl(r)&&(this.markerStartAngle=0,r.remove()),i&&Dl(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t&&(r&&Dl(r)&&(this.markerEndAngle=0,r.remove()),i)&&Dl(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1))},dc.prototype.transformMarker=function(t){var e,n,r,i,a,o=this.parsedStyle,s=o.markerStart,l=o.markerEnd,c=o.markerStartOffset,u=o.markerEndOffset,h=o.x1,f=o.x2,d=o.y1,p=o.y2,g=o.defX,o=o.defY,s=t?s:l;s&&Dl(s)&&(l=0,t=t?(r=h-g,i=d-o,e=f-h,n=p-d,a=c||0,this.markerStartAngle):(r=f-g,i=p-o,e=h-f,n=d-p,a=u||0,this.markerEndAngle),l=Math.atan2(n,e),s.setLocalEulerAngles(180*l/Math.PI+t),s.setLocalPosition(r+Math.cos(l)*a,i+Math.sin(l)*a))},dc.prototype.getPoint=function(t,e){void 0===e&&(e=!1);var n=this.parsedStyle,r=n.x1,i=n.y1,a=n.x2,o=n.y2,s=n.defX,n=n.defY,r=jn(r,i,a,o,t),i=r.x,a=r.y,o=Bt(At(),Tt(i-s,a-n,0),e?this.getWorldTransform():this.getLocalTransform());return new Tr(o[0],o[1])},dc.prototype.getPointAtLength=function(t,e){return void 0===e&&(e=!1),this.getPoint(t/this.getTotalLength(),e)},dc.prototype.getTotalLength=function(){var t=this.parsedStyle;return Nn(t.x1,t.y1,t.x2,t.y2)};var hc,fc=dc;function dc(t){var e=this,n=(t=void 0===t?{}:t).style,t=it(t,["style"]),n=((e=hc.call(this,m({type:O.LINE,style:m({x1:0,y1:0,x2:0,y2:0,z1:0,z2:0,isBillboard:!1},n)},t))||this).markerStartAngle=0,e.markerEndAngle=0,e.parsedStyle),t=n.markerStart,n=n.markerEnd;return t&&Dl(t)&&(e.markerStartAngle=t.getLocalEulerAngles(),e.appendChild(t)),n&&Dl(n)&&(e.markerEndAngle=n.getLocalEulerAngles(),e.appendChild(n)),e.transformMarker(!0),e.transformMarker(!1),e}t(yc,pc=Vl),yc.prototype.attributeChangedCallback=function(t,e,n,r,i){"path"===t?(this.transformMarker(!0),this.transformMarker(!1),this.placeMarkerMid(this.parsedStyle.markerMid)):"markerStartOffset"===t||"markerEndOffset"===t?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===t?(r&&Dl(r)&&(this.markerStartAngle=0,r.remove()),i&&Dl(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&Dl(r)&&(this.markerEndAngle=0,r.remove()),i&&Dl(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1))):"markerMid"===t&&this.placeMarkerMid(i)},yc.prototype.transformMarker=function(t){var e,n,r,i,a,o,s,l=this.parsedStyle,c=l.markerStart,u=l.markerEnd,h=l.markerStartOffset,f=l.markerEndOffset,d=l.defX,l=l.defY,c=t?c:u;c&&Dl(c)&&(u=0,h=t?(o=(t=j(this.getStartTangent(),2))[0],e=(s=t[1])[0]-d,n=s[1]-l,r=o[0]-s[0],i=o[1]-s[1],a=h||0,this.markerStartAngle):(o=(t=j(this.getEndTangent(),2))[0],e=(s=t[1])[0]-d,n=s[1]-l,r=o[0]-s[0],i=o[1]-s[1],a=f||0,this.markerEndAngle),u=Math.atan2(i,r),c.setLocalEulerAngles(180*u/Math.PI+h),c.setLocalPosition(e+Math.cos(u)*a,n+Math.sin(u)*a))},yc.prototype.placeMarkerMid=function(t){var e=this.parsedStyle,n=e.path.segments,r=e.defX,i=e.defY;if(this.markerMidList.forEach(function(t){t.remove()}),t&&Dl(t))for(var a=1;a<n.length-1;a++){var o=j(n[a].currentPoint,2),s=o[0],o=o[1],l=1===a?t:t.cloneNode(!0);this.markerMidList.push(l),this.appendChild(l),l.setLocalPosition(s-r,o-i)}},yc.prototype.getTotalLength=function(){return _a(this)},yc.prototype.getPointAtLength=function(t,e){void 0===e&&(e=!1);var n=this.parsedStyle,r=n.defX,i=n.defY,n=Me(n.path.absolutePath,t,m(m({},a),{bbox:!1,length:!0})).point,t=n.x,a=n.y,n=Bt(At(),Tt(t-r,a-i,0),e?this.getWorldTransform():this.getLocalTransform());return new Tr(n[0],n[1])},yc.prototype.getPoint=function(t,e){return void 0===e&&(e=!1),this.getPointAtLength(t*_a(this),e)},yc.prototype.getStartTangent=function(){var t,e,n=this.parsedStyle.path.segments,r=[];return 1<n.length&&(t=n[0].currentPoint,e=n[1].currentPoint,r=[],(n=n[1].startTangent)?r.push([t[0]-n[0],t[1]-n[1]]):r.push([e[0],e[1]]),r.push([t[0],t[1]])),r},yc.prototype.getEndTangent=function(){var t,e,n=this.parsedStyle.path.segments,r=n.length,i=[];return 1<r&&(t=n[r-2].currentPoint,e=n[r-1].currentPoint,i=[],(n=n[r-1].endTangent)?i.push([e[0]-n[0],e[1]-n[1]]):i.push([t[0],t[1]]),i.push([e[0],e[1]])),i};var pc,gc=yc;function yc(t){var e=this,n=(t=void 0===t?{}:t).style,t=it(t,["style"]),n=((e=pc.call(this,m({type:O.PATH,style:_.enableCSSParsing?m({path:"",miterLimit:""},n):m({},n),initialParsedStyle:_.enableCSSParsing?null:{miterLimit:4,path:m({},Li)}},t))||this).markerStartAngle=0,e.markerEndAngle=0,e.markerMidList=[],e.parsedStyle),t=n.markerStart,r=n.markerEnd,n=n.markerMid;return t&&Dl(t)&&(e.markerStartAngle=t.getLocalEulerAngles(),e.appendChild(t)),n&&Dl(n)&&e.placeMarkerMid(n),r&&Dl(r)&&(e.markerEndAngle=r.getLocalEulerAngles(),e.appendChild(r)),e.transformMarker(!0),e.transformMarker(!1),e}t(bc,mc=Vl),bc.prototype.attributeChangedCallback=function(t,e,n,r,i){"points"===t?(this.transformMarker(!0),this.transformMarker(!1),this.placeMarkerMid(this.parsedStyle.markerMid)):"markerStartOffset"===t||"markerEndOffset"===t?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===t?(r&&Dl(r)&&(this.markerStartAngle=0,r.remove()),i&&Dl(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&Dl(r)&&(this.markerEndAngle=0,r.remove()),i&&Dl(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1))):"markerMid"===t&&this.placeMarkerMid(i)},bc.prototype.transformMarker=function(t){var e,n,r,i,a,o=this.parsedStyle,s=o.markerStart,l=o.markerEnd,c=o.markerStartOffset,u=o.markerEndOffset,h=o.points.points,f=o.defX,o=o.defY,s=t?s:l;s&&Dl(s)&&(i=h[l=0][0]-f,a=h[0][1]-o,c=t?(e=h[1][0]-h[0][0],n=h[1][1]-h[0][1],r=c||0,this.markerStartAngle):(t=h.length,n=this.parsedStyle.isClosed?(e=h[t-1][0]-h[0][0],h[t-1][1]-h[0][1]):(i=h[t-1][0]-f,a=h[t-1][1]-o,e=h[t-2][0]-h[t-1][0],h[t-2][1]-h[t-1][1]),r=u||0,this.markerEndAngle),l=Math.atan2(n,e),s.setLocalEulerAngles(180*l/Math.PI+c),s.setLocalPosition(i+Math.cos(l)*r,a+Math.sin(l)*r))},bc.prototype.placeMarkerMid=function(t){var e=this.parsedStyle,n=e.points.points,r=e.defX,i=e.defY;if(this.markerMidList.forEach(function(t){t.remove()}),this.markerMidList=[],t&&Dl(t))for(var a=1;a<(this.parsedStyle.isClosed?n.length:n.length-1);a++){var o=n[a][0]-r,s=n[a][1]-i,l=1===a?t:t.cloneNode(!0);this.markerMidList.push(l),this.appendChild(l),l.setLocalPosition(o,s)}};var mc,vc=bc;function bc(t){var e=this,n=(t=void 0===t?{}:t).style,t=it(t,["style"]),n=((e=mc.call(this,m({type:O.POLYGON,style:_.enableCSSParsing?m({points:"",miterLimit:"",isClosed:!0},n):m({},n),initialParsedStyle:_.enableCSSParsing?null:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!0}},t))||this).markerStartAngle=0,e.markerEndAngle=0,e.markerMidList=[],e.parsedStyle),t=n.markerStart,r=n.markerEnd,n=n.markerMid;return t&&Dl(t)&&(e.markerStartAngle=t.getLocalEulerAngles(),e.appendChild(t)),n&&Dl(n)&&e.placeMarkerMid(n),r&&Dl(r)&&(e.markerEndAngle=r.getLocalEulerAngles(),e.appendChild(r)),e.transformMarker(!0),e.transformMarker(!1),e}t(Mc,xc=vc),Mc.prototype.getTotalLength=function(){return this.parsedStyle.points.totalLength},Mc.prototype.getPointAtLength=function(t,e){return void 0===e&&(e=!1),this.getPoint(t/this.getTotalLength(),e)},Mc.prototype.getPoint=function(n,t){void 0===t&&(t=!1);var e=this.parsedStyle,r=e.defX,i=e.defY,e=e.points,a=e.points,e=e.segments,o=0,s=0,e=(e.forEach(function(t,e){n>=t[0]&&n<=t[1]&&(o=(n-t[0])/(t[1]-t[0]),s=e)}),jn(a[s][0],a[s][1],a[s+1][0],a[s+1][1],o)),a=e.x,e=e.y,a=Bt(At(),Tt(a-r,e-i,0),t?this.getWorldTransform():this.getLocalTransform());return new Tr(a[0],a[1])},Mc.prototype.getStartTangent=function(){var t=this.parsedStyle.points.points,e=[];return e.push([t[1][0],t[1][1]]),e.push([t[0][0],t[0][1]]),e},Mc.prototype.getEndTangent=function(){var t=this.parsedStyle.points.points,e=t.length-1,n=[];return n.push([t[e-1][0],t[e-1][1]]),n.push([t[e][0],t[e][1]]),n};var xc,wc=Mc;function Mc(t){var e=(t=void 0===t?{}:t).style,t=it(t,["style"]);return xc.call(this,m({type:O.POLYLINE,style:_.enableCSSParsing?m({points:"",miterLimit:"",isClosed:!1},e):m({},e),initialParsedStyle:_.enableCSSParsing?null:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!1}},t))||this}t(Ec,Oc=Vl);var Oc,kc=Ec;function Ec(t){var e=(t=void 0===t?{}:t).style,t=it(t,["style"]);return Oc.call(this,m({type:O.RECT,style:_.enableCSSParsing?m({x:"",y:"",width:"",height:"",radius:""},e):m({},e)},t))||this}t(_c,Sc=Vl),_c.prototype.getComputedTextLength=function(){var t;return(null==(t=this.parsedStyle.metrics)?void 0:t.maxLineWidth)||0},_c.prototype.getLineBoundingRects=function(){var t;return(null==(t=this.parsedStyle.metrics)?void 0:t.lineMetrics)||[]},_c.prototype.isOverflowing=function(){return!!this.parsedStyle.isOverflowing};var Sc,Ac=_c;function _c(t){var e=(t=void 0===t?{}:t).style,t=it(t,["style"]);return Sc.call(this,m({type:O.TEXT,style:_.enableCSSParsing?m({x:"",y:"",text:"",fontSize:"",fontFamily:"",fontStyle:"",fontWeight:"",fontVariant:"",textAlign:"",textBaseline:"",textTransform:"",fill:"black",letterSpacing:"",lineHeight:"",miterLimit:"",wordWrap:!1,wordWrapWidth:0,leading:0,dx:"",dy:"",isBillboard:!1,sizeAttenuation:!0},e):m({fill:"black"},e),initialParsedStyle:_.enableCSSParsing?{}:{x:0,y:0,fontSize:16,fontFamily:"sans-serif",fontStyle:"normal",fontWeight:"normal",fontVariant:"normal",lineHeight:0,letterSpacing:0,textBaseline:"alphabetic",textAlign:"start",wordWrap:!1,wordWrapWidth:0,leading:0,dx:0,dy:0,isBillboard:!1,sizeAttenuation:!0}},t))||this}Pc.prototype.define=function(t,e){this.registry[t]=e},Pc.prototype.get=function(t){return this.registry[t]};var Tc=Pc;function Pc(){this.registry={},this.define(O.CIRCLE,Ul),this.define(O.ELLIPSE,tc),this.define(O.RECT,kc),this.define(O.IMAGE,cc),this.define(O.LINE,fc),this.define(O.GROUP,rc),this.define(O.PATH,gc),this.define(O.POLYGON,vc),this.define(O.POLYLINE,wc),this.define(O.TEXT,Ac),this.define(O.HTML,oc)}t(Nc,Lc=fl),Object.defineProperty(Nc.prototype,"children",{get:function(){return this.childNodes},enumerable:!1,configurable:!0}),Object.defineProperty(Nc.prototype,"childElementCount",{get:function(){return this.childNodes.length},enumerable:!1,configurable:!0}),Object.defineProperty(Nc.prototype,"firstElementChild",{get:function(){return this.firstChild},enumerable:!1,configurable:!0}),Object.defineProperty(Nc.prototype,"lastElementChild",{get:function(){return this.lastChild},enumerable:!1,configurable:!0}),Nc.prototype.createElement=function(t,e){var n;return"svg"===t?this.documentElement:((n=this.defaultView.customElements.get(t))||(console.warn("Unsupported tagName: ",t),n="tspan"===t?Ac:rc),(t=new n(e)).ownerDocument=this,t)},Nc.prototype.createElementNS=function(t,e,n){return this.createElement(e,n)},Nc.prototype.cloneNode=function(t){throw new Error(Ir)},Nc.prototype.destroy=function(){try{this.documentElement.destroyChildren(),this.timeline.destroy()}catch(t){}},Nc.prototype.elementsFromBBox=function(t,e,n,r){var t=this.defaultView.context.rBushRoot.search({minX:t,minY:e,maxX:n,maxY:r}),i=[];return t.forEach(function(t){var t=t.displayObject,e=t.parsedStyle.pointerEvents,e=["auto","visiblepainted","visiblefill","visiblestroke","visible"].includes(e);e&&!t.isVisible()||t.isCulled()||!t.isInteractive()||i.push(t)}),i.sort(function(t,e){return e.sortable.renderOrder-t.sortable.renderOrder}),i},Nc.prototype.elementFromPointSync=function(t,e){var n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,n=n.y,i=this.defaultView.getConfig(),a=i.width,i=i.height;return r<0||n<0||a<r||i<n?null:(i=(a=this.defaultView.viewport2Client({x:r,y:n})).x,a=a.y,(t=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!0,position:{x:t,y:e,viewportX:r,viewportY:n,clientX:i,clientY:a},picked:[]}).picked)&&t[0]||this.documentElement)},Nc.prototype.elementFromPoint=function(a,o){return X(this,void 0,void 0,function(){var e,n,r,i;return R(this,function(t){switch(t.label){case 0:return(e=this.defaultView.canvas2Viewport({x:a,y:o}),i=e.x,e=e.y,n=this.defaultView.getConfig(),r=n.width,n=n.height,i<0||e<0||r<i||n<e)?[2,null]:(r=this.defaultView.viewport2Client({x:i,y:e}),n=r.x,r=r.y,[4,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!0,position:{x:a,y:o,viewportX:i,viewportY:e,clientX:n,clientY:r},picked:[]})]);case 1:return[2,(i=t.sent().picked)&&i[0]||this.documentElement]}})})},Nc.prototype.elementsFromPointSync=function(t,e){var n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,n=n.y,i=this.defaultView.getConfig(),a=i.width,i=i.height;return r<0||n<0||a<r||i<n?[]:(i=(a=this.defaultView.viewport2Client({x:r,y:n})).x,a=a.y,(t=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!1,position:{x:t,y:e,viewportX:r,viewportY:n,clientX:i,clientY:a},picked:[]}).picked)[t.length-1]!==this.documentElement&&t.push(this.documentElement),t)},Nc.prototype.elementsFromPoint=function(a,o){return X(this,void 0,void 0,function(){var e,n,r,i;return R(this,function(t){switch(t.label){case 0:return(e=this.defaultView.canvas2Viewport({x:a,y:o}),i=e.x,e=e.y,n=this.defaultView.getConfig(),r=n.width,n=n.height,i<0||e<0||r<i||n<e)?[2,[]]:(r=this.defaultView.viewport2Client({x:i,y:e}),n=r.x,r=r.y,[4,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!1,position:{x:a,y:o,viewportX:i,viewportY:e,clientX:n,clientY:r},picked:[]})]);case 1:return(i=t.sent().picked)[i.length-1]!==this.documentElement&&i.push(this.documentElement),[2,i]}})})},Nc.prototype.appendChild=function(t,e){throw new Error(Br)},Nc.prototype.insertBefore=function(t,e){throw new Error(Br)},Nc.prototype.removeChild=function(t,e){throw new Error(Br)},Nc.prototype.replaceChild=function(t,e,n){throw new Error(Br)},Nc.prototype.append=function(){throw new Error(Br)},Nc.prototype.prepend=function(){throw new Error(Br)},Nc.prototype.getElementById=function(t){return this.documentElement.getElementById(t)},Nc.prototype.getElementsByName=function(t){return this.documentElement.getElementsByName(t)},Nc.prototype.getElementsByTagName=function(t){return this.documentElement.getElementsByTagName(t)},Nc.prototype.getElementsByClassName=function(t){return this.documentElement.getElementsByClassName(t)},Nc.prototype.querySelector=function(t){return this.documentElement.querySelector(t)},Nc.prototype.querySelectorAll=function(t){return this.documentElement.querySelectorAll(t)},Nc.prototype.find=function(t){return this.documentElement.find(t)},Nc.prototype.findAll=function(t){return this.documentElement.findAll(t)};var Lc,Cc=Nc;function Nc(){var t=Lc.call(this)||this;t.defaultView=null,t.ownerDocument=null,t.nodeName="document";try{t.timeline=new _.AnimationTimeline(t)}catch(t){}var r={};return fo.forEach(function(t){var e=t.n,n=t.inh,t=t.d;n&&t&&(r[e]=si(t)?t(O.GROUP):t)}),t.documentElement=new rc({id:"g-root",style:r}),((t.documentElement.ownerDocument=t).documentElement.parentNode=t).childNodes=[t.documentElement],t}Rc.prototype.apply=function(t){var n=t.camera,e=t.renderingService,r=t.renderingContext,i=this.strategies;e.hooks.cull.tap(Rc.tag,function(e){var t;return e&&(t=e.cullable,0===i.length?t.visible=-1<r.unculledEntities.indexOf(e.entity):t.visible=i.every(function(t){return t.isVisible(n,e)}),!e.isCulled()&&e.isVisible()?e:(e.dispatchEvent(new ll(v.CULLED)),null))}),e.hooks.afterRender.tap(Rc.tag,function(t){t.cullable.visibilityPlaneMask=-1})},Rc.tag="Culling";var jc=Rc;function Rc(t){this.strategies=t}Bc.prototype.apply=function(t){var e=t.renderingService;e.hooks.dirtycheck.tap(Bc.tag,function(t){return t&&(t.renderable.dirty||e.disableDirtyRectangleRendering()?t:null)})},Bc.tag="DirtyCheck";var Ic=Bc;function Bc(){}Fc.prototype.apply=function(t){var c=this,t=(this.context=t).renderingService,u=this.context.renderingContext.root.ownerDocument.defaultView;this.context.eventService.setPickHandler(function(t){return c.context.renderingService.hooks.pickSync.call({position:t,picked:[],topmost:!0}).picked[0]||null}),t.hooks.pointerWheel.tap(Fc.tag,function(t){t=c.normalizeWheelEvent(t);c.context.eventService.mapEvent(t)}),t.hooks.pointerDown.tap(Fc.tag,function(t){var e,n;if(!u.supportsTouchEvents||"touch"!==t.pointerType){var r=c.normalizeToPointerEvent(t,u);!c.autoPreventDefault||!r[0].isNormalized||!t.cancelable&&"cancelable"in t||t.preventDefault();try{for(var i=I(r),a=i.next();!a.done;a=i.next()){var o=a.value,s=c.bootstrapEvent(c.rootPointerEvent,o,u,t);c.context.eventService.mapEvent(s)}}catch(t){e={error:t}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}c.setCursor(c.context.eventService.cursor)}}),t.hooks.pointerUp.tap(Fc.tag,function(t){var e,n;if(!u.supportsTouchEvents||"touch"!==t.pointerType){var r=c.context.contextService.getDomElement(),i="outside";try{i=r&&t.target&&t.target!==r&&r.contains&&!r.contains(t.target)?"outside":""}catch(t){}r=c.normalizeToPointerEvent(t,u);try{for(var a=I(r),o=a.next();!o.done;o=a.next()){var s=o.value,l=c.bootstrapEvent(c.rootPointerEvent,s,u,t);l.type+=i,c.context.eventService.mapEvent(l)}}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=a.return)&&n.call(a)}finally{if(e)throw e.error}}c.setCursor(c.context.eventService.cursor)}}),t.hooks.pointerMove.tap(Fc.tag,this.onPointerMove),t.hooks.pointerOver.tap(Fc.tag,this.onPointerMove),t.hooks.pointerOut.tap(Fc.tag,this.onPointerMove),t.hooks.click.tap(Fc.tag,this.onClick),t.hooks.pointerCancel.tap(Fc.tag,function(t){var e,n,r=c.normalizeToPointerEvent(t,u);try{for(var i=I(r),a=i.next();!a.done;a=i.next()){var o=a.value,s=c.bootstrapEvent(c.rootPointerEvent,o,u,t);c.context.eventService.mapEvent(s)}}catch(t){e={error:t}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}c.setCursor(c.context.eventService.cursor)})},Fc.prototype.getViewportXY=function(t){var e,n=t.offsetX,r=t.offsetY,i=t.clientX,t=t.clientY;return t=!this.context.config.supportsCSSTransform||A(n)||A(r)?(e=(i=this.context.eventService.client2Viewport(new Tr(i,t))).x,i.y):(e=n,r),{x:e,y:t}},Fc.prototype.bootstrapEvent=function(t,e,n,r){t.view=n,t.originalEvent=null,t.nativeEvent=r,t.pointerId=e.pointerId,t.width=e.width,t.height=e.height,t.isPrimary=e.isPrimary,t.pointerType=e.pointerType,t.pressure=e.pressure,t.tangentialPressure=e.tangentialPressure,t.tiltX=e.tiltX,t.tiltY=e.tiltY,t.twist=e.twist,this.transferMouseData(t,e);var e=(n=this.getViewportXY(e)).x,n=n.y,n=(t.viewport.x=e,t.viewport.y=n,(e=this.context.eventService.viewport2Canvas(t.viewport)).x),e=e.y;return t.canvas.x=n,t.canvas.y=e,t.global.copyFrom(t.canvas),t.offset.copyFrom(t.canvas),t.isTrusted=r.isTrusted,"pointerleave"===t.type&&(t.type="pointerout"),t.type.startsWith("mouse")&&(t.type=t.type.replace("mouse","pointer")),t.type.startsWith("touch")&&(t.type=ss[t.type]||t.type),t},Fc.prototype.normalizeWheelEvent=function(t){var e=this.rootWheelEvent,n=(this.transferMouseData(e,t),e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ,(r=this.getViewportXY(t)).x),r=r.y,r=(e.viewport.x=n,e.viewport.y=r,(n=this.context.eventService.viewport2Canvas(e.viewport)).x),n=n.y;return e.canvas.x=r,e.canvas.y=n,e.global.copyFrom(e.canvas),e.offset.copyFrom(e.canvas),e.nativeEvent=t,e.type=t.type,e},Fc.prototype.transferMouseData=function(t,e){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=performance.now(),t.type=e.type,t.altKey=e.altKey,t.metaKey=e.metaKey,t.shiftKey=e.shiftKey,t.ctrlKey=e.ctrlKey,t.button=e.button,t.buttons=e.buttons,t.client.x=e.clientX,t.client.y=e.clientY,t.movement.x=e.movementX,t.movement.y=e.movementY,t.page.x=e.pageX,t.page.y=e.pageY,t.screen.x=e.screenX,t.screen.y=e.screenY,t.relatedTarget=null},Fc.prototype.setCursor=function(t){this.context.contextService.applyCursorStyle(t||this.context.config.cursor||"default")},Fc.prototype.normalizeToPointerEvent=function(t,e){var n=[];if(e.isTouchEvent(t))for(var r=0;r<t.changedTouches.length;r++){var i=t.changedTouches[r];qe(i.button)&&(i.button=0),qe(i.buttons)&&(i.buttons=1),qe(i.isPrimary)&&(i.isPrimary=1===t.touches.length&&"touchstart"===t.type),qe(i.width)&&(i.width=i.radiusX||1),qe(i.height)&&(i.height=i.radiusY||1),qe(i.tiltX)&&(i.tiltX=0),qe(i.tiltY)&&(i.tiltY=0),qe(i.pointerType)&&(i.pointerType="touch"),qe(i.pointerId)&&(i.pointerId=i.identifier||0),qe(i.pressure)&&(i.pressure=i.force||.5),qe(i.twist)&&(i.twist=0),qe(i.tangentialPressure)&&(i.tangentialPressure=0),i.isNormalized=!0,i.type=t.type,n.push(i)}else e.isMouseEvent(t)?(qe((e=t).isPrimary)&&(e.isPrimary=!0),qe(e.width)&&(e.width=1),qe(e.height)&&(e.height=1),qe(e.tiltX)&&(e.tiltX=0),qe(e.tiltY)&&(e.tiltY=0),qe(e.pointerType)&&(e.pointerType="mouse"),qe(e.pointerId)&&(e.pointerId=1),qe(e.pressure)&&(e.pressure=.5),qe(e.twist)&&(e.twist=0),qe(e.tangentialPressure)&&(e.tangentialPressure=0),e.isNormalized=!0,n.push(e)):n.push(t);return n},Fc.tag="Event";var Dc=Fc;function Fc(){var c=this;this.autoPreventDefault=!1,this.rootPointerEvent=new nl(null),this.rootWheelEvent=new al(null),this.onPointerMove=function(t){var e,n,r=null==(i=null==(i=c.context.renderingContext.root)?void 0:i.ownerDocument)?void 0:i.defaultView;if(!r.supportsTouchEvents||"touch"!==t.pointerType){var i=c.normalizeToPointerEvent(t,r);try{for(var a=I(i),o=a.next();!o.done;o=a.next()){var s=o.value,l=c.bootstrapEvent(c.rootPointerEvent,s,r,t);c.context.eventService.mapEvent(l)}}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=a.return)&&n.call(a)}finally{if(e)throw e.error}}c.setCursor(c.context.eventService.cursor)}},this.onClick=function(t){var e,n,r=null==(i=null==(i=c.context.renderingContext.root)?void 0:i.ownerDocument)?void 0:i.defaultView,i=c.normalizeToPointerEvent(t,r);try{for(var a=I(i),o=a.next();!o.done;o=a.next()){var s=o.value,l=c.bootstrapEvent(c.rootPointerEvent,s,r,t);c.context.eventService.mapEvent(l)}}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=a.return)&&n.call(a)}finally{if(e)throw e.error}}c.setCursor(c.context.eventService.cursor)}}var zc=[O.CIRCLE,O.ELLIPSE,O.IMAGE,O.RECT,O.LINE,O.POLYLINE,O.POLYGON,O.TEXT,O.PATH,O.HTML],Wc=(Gc.prototype.isVisible=function(t,e){var n,r,i=e.cullable;return!i.enable||(n=e.getRenderBounds(),!Mr.isEmpty(n)&&(t=t.getFrustum(),r=null==(r=null==(r=e.parentNode)?void 0:r.cullable)?void 0:r.visibilityPlaneMask,i.visibilityPlaneMask=this.computeVisibilityWithPlaneMask(e,n,r||kr.INDETERMINATE,t.planes),i.visible=i.visibilityPlaneMask!==kr.OUTSIDE,i.visible))},Gc.prototype.computeVisibilityWithPlaneMask=function(t,e,n,r){if(n===kr.OUTSIDE||n===kr.INSIDE)return n;for(var i=kr.INSIDE,a=-1<zc.indexOf(t.nodeName),o=0,s=r.length;o<s;++o){var l=1<<o;if(0!=(n&l)&&(!a||4!==o&&5!==o)){var c=r[o],u=c.normal,c=c.distance;if(Rt(u,e.getPositiveFarPoint(r[o]))+c<0)return kr.OUTSIDE;Rt(u,e.getNegativeFarPoint(r[o]))+c<0&&(i|=l)}}return i},Gc);function Gc(){}Vc.prototype.apply=function(t){function e(t){t.target.renderable.dirty=!0,o.dirtify()}function n(t){for(var e=t.detail.affectChildren,t=t.target,n=(e&&t.forEach(function(t){a.toSync.add(t)}),t);n;)n.renderable&&a.toSync.add(n),n=n.parentElement;o.dirtify()}function r(t){t=t.target,_.enableCSSParsing&&_.styleValueRegistry.recalc(t),_.sceneGraphService.dirtifyToRoot(t),o.dirtify()}function i(t){var e=(t=t.target).rBushNode;e.aabb&&a.rBush.remove(e.aabb),a.toSync.delete(t),_.sceneGraphService.dirtifyToRoot(t),o.dirtify()}var a=this,o=t.renderingService,s=t.renderingContext,t=t.rBushRoot,l=s.root.ownerDocument.defaultView;this.rBush=t;o.hooks.init.tap(Vc.tag,function(){l.addEventListener(v.MOUNTED,r),l.addEventListener(v.UNMOUNTED,i),l.addEventListener(v.ATTR_MODIFIED,e),l.addEventListener(v.BOUNDS_CHANGED,n)}),o.hooks.destroy.tap(Vc.tag,function(){l.removeEventListener(v.MOUNTED,r),l.removeEventListener(v.UNMOUNTED,i),l.removeEventListener(v.ATTR_MODIFIED,e),l.removeEventListener(v.BOUNDS_CHANGED,n),a.toSync.clear()}),o.hooks.endFrame.tap(Vc.tag,function(){a.syncRTree()})},Vc.prototype.syncRTree=function(){var o=this,s=[];Array.from(this.toSync).filter(function(t){return t.isConnected}).forEach(function(t){var e,n,r,i=t.rBushNode,a=(i&&i.aabb&&o.rBush.remove(i.aabb),t.getRenderBounds());a&&(e=(n=j(a.getMin(),2))[0],n=n[1],r=(a=j(a.getMax(),2))[0],a=a[1],i.aabb||(i.aabb={}),i.aabb.displayObject=t,i.aabb.minX=e,i.aabb.minY=n,i.aabb.maxX=r,i.aabb.maxY=a),!i.aabb||isNaN(i.aabb.maxX)||isNaN(i.aabb.maxX)||isNaN(i.aabb.minX)||isNaN(i.aabb.minY)||s.push(i.aabb)}),this.rBush.load(s),s.length=0,this.toSync.clear()},Vc.tag="Prepare";var Hc,Yc=Vc;function Vc(){this.toSync=new Set}(Gs=Hc=Hc||{}).READY="ready",Gs.BEFORE_RENDER="beforerender",Gs.RERENDER="rerender",Gs.AFTER_RENDER="afterrender",Gs.BEFORE_DESTROY="beforedestroy",Gs.AFTER_DESTROY="afterdestroy",Gs.RESIZE="resize",Gs.DIRTY_RECTANGLE="dirtyrectangle",Gs.RENDERER_CHANGED="rendererchanged";var qc,$c=new ll(v.MOUNTED),Uc=new ll(v.UNMOUNTED),Xc=new ll(Hc.BEFORE_RENDER),Kc=new ll(Hc.RERENDER),Zc=new ll(Hc.AFTER_RENDER),Qc=(t(Jc,qc=Js),Jc.prototype.initRenderingContext=function(t){this.context.config=t,this.context.renderingContext={root:this.document.documentElement,renderListCurrentFrame:[],unculledEntities:[],renderReasons:new Set,force:!1,dirty:!1}},Jc.prototype.initDefaultCamera=function(t,e){var n=this,r=new _.CameraContribution;r.setType(Nr.EXPLORING,jr.DEFAULT).setPosition(t/2,e/2,500).setFocalPoint(t/2,e/2,0).setOrthographic(t/-2,t/2,e/2,e/-2,.1,1e3),r.canvas=this,r.eventEmitter.on(Wr,function(){n.context.renderingContext.renderReasons.add(gl.CAMERA_CHANGED)}),this.context.camera=r},Jc.prototype.getConfig=function(){return this.context.config},Jc.prototype.getRoot=function(){return this.document.documentElement},Jc.prototype.getCamera=function(){return this.context.camera},Jc.prototype.getContextService=function(){return this.context.contextService},Jc.prototype.getEventService=function(){return this.context.eventService},Jc.prototype.getRenderingService=function(){return this.context.renderingService},Jc.prototype.getRenderingContext=function(){return this.context.renderingContext},Jc.prototype.getStats=function(){return this.getRenderingService().getStats()},Object.defineProperty(Jc.prototype,"ready",{get:function(){var e=this;return this.readyPromise||(this.readyPromise=new Promise(function(t){e.resolveReadyPromise=function(){t(e)}}),this.inited&&this.resolveReadyPromise()),this.readyPromise},enumerable:!1,configurable:!0}),Jc.prototype.destroy=function(t,e){void 0===t&&(t=!0),(e=void 0===e?!1:e)||this.dispatchEvent(new ll(Hc.BEFORE_DESTROY)),this.frameId&&(this.getConfig().cancelAnimationFrame||cancelAnimationFrame)(this.frameId);var n=this.getRoot();this.unmountChildren(n),t&&(this.document.destroy(),this.getEventService().destroy()),this.getRenderingService().destroy(),this.getContextService().destroy(),t&&this.context.rBushRoot&&(this.context.rBushRoot.clear(),this.context.rBushRoot=null,this.context.renderingContext.root=null),e||this.dispatchEvent(new ll(Hc.AFTER_DESTROY))},Jc.prototype.changeSize=function(t,e){this.resize(t,e)},Jc.prototype.resize=function(t,e){var n=this.context.config,n=(n.width=t,n.height=e,this.getContextService().resize(t,e),this.context.camera),r=n.getProjectionMode();n.setPosition(t/2,e/2,500).setFocalPoint(t/2,e/2,0),r===Rr.ORTHOGRAPHIC?n.setOrthographic(t/-2,t/2,e/2,e/-2,n.getNear(),n.getFar()):n.setAspect(t/e),this.dispatchEvent(new ll(Hc.RESIZE,{width:t,height:e}))},Jc.prototype.appendChild=function(t,e){return this.document.documentElement.appendChild(t,e)},Jc.prototype.insertBefore=function(t,e){return this.document.documentElement.insertBefore(t,e)},Jc.prototype.removeChild=function(t){return this.document.documentElement.removeChild(t)},Jc.prototype.removeChildren=function(){this.document.documentElement.removeChildren()},Jc.prototype.destroyChildren=function(){this.document.documentElement.destroyChildren()},Jc.prototype.render=function(){var t=this;this.dispatchEvent(Xc),this.getRenderingService().render(this.getConfig(),function(){t.dispatchEvent(Kc)}),this.dispatchEvent(Zc)},Jc.prototype.run=function(){function t(){e.render(),e.frameId=e.requestAnimationFrame(t)}var e=this;t()},Jc.prototype.initRenderer=function(t,e){var n=this;if(void 0===e&&(e=!1),!t)throw new Error("Renderer is required.");this.inited=!1,this.readyPromise=void 0,this.context.rBushRoot=new nr,this.context.renderingPlugins=[],this.context.renderingPlugins.push(new Dc,new Yc,new Ic,new jc([new Wc])),this.loadRendererContainerModule(t),this.context.contextService=new this.context.ContextService(m(m({},_),this.context)),this.context.renderingService=new ml(_,this.context),this.context.eventService=new dl(_,this.context),this.context.eventService.init(),this.context.contextService.init?(this.context.contextService.init(),this.initRenderingService(t,e,!0)):this.context.contextService.initAsync().then(function(){n.initRenderingService(t,e)})},Jc.prototype.initRenderingService=function(t,e,n){var r=this;void 0===e&&(e=!1),void 0===n&&(n=!1),this.context.renderingService.init(function(){r.inited=!0,e?(n?r.requestAnimationFrame(function(){r.dispatchEvent(new ll(Hc.READY))}):r.dispatchEvent(new ll(Hc.READY)),r.readyPromise&&r.resolveReadyPromise()):r.dispatchEvent(new ll(Hc.RENDERER_CHANGED)),e||r.getRoot().forEach(function(t){t=t.renderable;t&&(t.renderBoundsDirty=!0,t.boundsDirty=!0,t.dirty=!0)}),r.mountChildren(r.getRoot()),t.getConfig().enableAutoRendering&&r.run()})},Jc.prototype.loadRendererContainerModule=function(t){var e=this;t.getPlugins().forEach(function(t){t.context=e.context,t.init(_)})},Jc.prototype.setRenderer=function(t){var e,n=this.getConfig();n.renderer!==t&&(e=n.renderer,n.renderer=t,this.destroy(!1,!0),M([],j(null==e?void 0:e.getPlugins()),!1).reverse().forEach(function(t){t.destroy(_)}),this.initRenderer(t))},Jc.prototype.setCursor=function(t){this.getConfig().cursor=t,this.getContextService().applyCursorStyle(t)},Jc.prototype.unmountChildren=function(t){var e=this;t.childNodes.forEach(function(t){e.unmountChildren(t)}),this.inited&&(t.isMutationObserved?t.dispatchEvent(Uc):(Uc.target=t,this.dispatchEvent(Uc,!0)),t!==this.document.documentElement&&(t.ownerDocument=null),t.isConnected=!1),t.isCustomElement&&t.disconnectedCallback&&t.disconnectedCallback()},Jc.prototype.mountChildren=function(t){var e=this;this.inited?t.isConnected||(t.ownerDocument=this.document,t.isConnected=!0,t.isMutationObserved?t.dispatchEvent($c):($c.target=t,this.dispatchEvent($c,!0))):console.warn("[g]: You are trying to call `canvas.appendChild` before canvas' initialization finished. You can either await `canvas.ready` or listen to `CanvasEvent.READY` manually.","appended child: ",t.nodeName),t.childNodes.forEach(function(t){e.mountChildren(t)}),t.isCustomElement&&t.connectedCallback&&t.connectedCallback()},Jc.prototype.client2Viewport=function(t){return this.getEventService().client2Viewport(t)},Jc.prototype.viewport2Client=function(t){return this.getEventService().viewport2Client(t)},Jc.prototype.viewport2Canvas=function(t){return this.getEventService().viewport2Canvas(t)},Jc.prototype.canvas2Viewport=function(t){return this.getEventService().canvas2Viewport(t)},Jc.prototype.getPointByClient=function(t,e){return this.client2Viewport({x:t,y:e})},Jc.prototype.getClientByPoint=function(t,e){return this.viewport2Client({x:t,y:e})},Jc);function Jc(t){var e=qc.call(this)||this,n=(e.Element=Vl,e.inited=!1,e.context={},e.document=new Cc,(e.document.defaultView=e).customElements=new Tc,t.container),r=t.canvas,i=t.offscreenCanvas,a=t.width,o=t.height,s=t.devicePixelRatio,l=t.renderer,c=t.background,u=t.cursor,h=t.document,f=t.requestAnimationFrame,d=t.cancelAnimationFrame,p=t.createImage,g=t.supportsPointerEvents,y=t.supportsTouchEvents,m=t.supportsCSSTransform,v=t.useNativeClickEvent,b=t.alwaysTriggerPointerEventOnCanvas,x=t.isTouchEvent,t=t.isMouseEvent,w=(M=e,(w=n)&&(w="string"==typeof w?w:w.id||ns++,es[w]&&es[w].destroy(),es[w]=M),a),M=o,O=s;return r&&(O=1<=(O=s||rs&&window.devicePixelRatio||1)?Math.ceil(O):1,w=a||("auto"===(a=os(s=r,"width"))?s.offsetWidth:parseFloat(a))||r.width/O,M=o||("auto"===(a=os(s=r,"height"))?s.offsetHeight:parseFloat(a))||r.height/O),e.devicePixelRatio=O,e.requestAnimationFrame=null!=f?f:xs.bind(_.globalThis),e.cancelAnimationFrame=null!=d?d:ws.bind(_.globalThis),e.supportsTouchEvents=null!=y?y:"ontouchstart"in _.globalThis,e.supportsPointerEvents=null!=g?g:!!_.globalThis.PointerEvent,e.isTouchEvent=null!=x?x:function(t){return e.supportsTouchEvents&&t instanceof _.globalThis.TouchEvent},e.isMouseEvent=null!=t?t:function(t){return!_.globalThis.MouseEvent||t instanceof _.globalThis.MouseEvent&&(!e.supportsPointerEvents||!(t instanceof _.globalThis.PointerEvent))},e.initRenderingContext({container:n,canvas:r,width:w,height:M,renderer:l,offscreenCanvas:i,devicePixelRatio:O,cursor:u||"default",background:c||"transparent",createImage:p,document:h,supportsCSSTransform:m,useNativeClickEvent:v,alwaysTriggerPointerEventOnCanvas:b}),e.initDefaultCamera(w,M),e.initRenderer(l,!0),e}const tu="main-layer",eu="label-layer",nu="element",ru="view",iu="plot",au="component",ou="label",su="area";function lu(t,e){e=e.r;t.arc(e,e,e,0,2*Math.PI,!1)}function cu(t,e){var n,r,i=e.rx,e=e.ry;t.ellipse?t.ellipse(i,e,i,e,0,0,2*Math.PI,!1):(n=e<i?i:e,r=e<i?1:i/e,e=e<i?e/i:1,t.save(),t.scale(r,e),t.arc(0,0,n,0,2*Math.PI))}function uu(t,e){var n,r,i=e.x1,a=e.y1,o=e.x2,s=e.y2,l=e.defX,l=void 0===l?0:l,c=e.defY,c=void 0===c?0:c,u=e.markerStart,h=e.markerEnd,f=e.markerStartOffset,e=e.markerEndOffset,d=0,p=0,g=0,y=0,m=0;u&&Dl(u)&&f&&(n=o-i,r=s-a,m=Math.atan2(r,n),d=Math.cos(m)*(f||0),p=Math.sin(m)*(f||0)),h&&Dl(h)&&e&&(n=i-o,r=a-s,m=Math.atan2(r,n),g=Math.cos(m)*(e||0),y=Math.sin(m)*(e||0)),t.moveTo(i-l+d,a-c+p),t.lineTo(o-l+g,s-c+y)}function hu(t,e){var n,r,i,a,o=e.defX,s=void 0===o?0:o,o=e.defY,l=void 0===o?0:o,o=e.markerStart,c=e.markerEnd,u=e.markerStartOffset,h=e.markerEndOffset,e=e.path,f=e.absolutePath,d=e.segments,p=0,g=0,y=0,m=0,e=0;o&&Dl(o)&&u&&(i=(o=j(o.parentNode.getStartTangent(),2))[0],a=o[1],n=i[0]-a[0],r=i[1]-a[1],e=Math.atan2(r,n),p=Math.cos(e)*(u||0),g=Math.sin(e)*(u||0)),c&&Dl(c)&&h&&(i=(o=j(c.parentNode.getEndTangent(),2))[0],a=o[1],n=i[0]-a[0],r=i[1]-a[1],e=Math.atan2(r,n),y=Math.cos(e)*(h||0),m=Math.sin(e)*(h||0));for(var v=0;v<f.length;v++){var b=f[v],x=b[0],w=f[v+1],M=0===v&&(0!==p||0!==g),O=(v===f.length-1||w&&("M"===w[0]||"Z"===w[0]))&&0!==y&&0!==m;switch(x){case"M":M?(t.moveTo(b[1]-s+p,b[2]-l+g),t.lineTo(b[1]-s,b[2]-l)):t.moveTo(b[1]-s,b[2]-l);break;case"L":O?t.lineTo(b[1]-s+y,b[2]-l+m):t.lineTo(b[1]-s,b[2]-l);break;case"Q":t.quadraticCurveTo(b[1]-s,b[2]-l,b[3]-s,b[4]-l),O&&t.lineTo(b[3]-s+y,b[4]-l+m);break;case"C":t.bezierCurveTo(b[1]-s,b[2]-l,b[3]-s,b[4]-l,b[5]-s,b[6]-l),O&&t.lineTo(b[5]-s+y,b[6]-l+m);break;case"A":var k,E,S=d[v].arcParams,A=S.cx,_=S.cy,T=S.rx,P=S.ry,L=S.startAngle,C=S.endAngle,N=S.xRotation,S=S.sweepFlag;t.ellipse?t.ellipse(A-s,_-l,T,P,N,L,C,!!(1-S)):(k=P<T?T:P,E=P<T?1:T/P,P=P<T?P/T:1,t.translate(A-s,_-l),t.rotate(N),t.scale(E,P),t.arc(0,0,k,L,C,!!(1-S)),t.scale(1/E,1/P),t.rotate(-N),t.translate(-(A-s),-(_-l))),O&&t.lineTo(b[6]-s+y,b[7]-l+m);break;case"Z":t.closePath()}}}function fu(t,e){var n,r,i=e.defX,a=void 0===i?0:i,i=e.defY,o=void 0===i?0:i,i=e.markerStart,s=e.markerEnd,l=e.markerStartOffset,c=e.markerEndOffset,u=e.points.points,h=u.length,e=u[0][0]-a,f=u[0][1]-o,d=u[h-1][0]-a,p=u[h-1][1]-o,g=0,y=0,m=0,v=0,b=0;i&&Dl(i)&&l&&(n=u[1][0]-u[0][0],r=u[1][1]-u[0][1],b=Math.atan2(r,n),g=Math.cos(b)*(l||0),y=Math.sin(b)*(l||0)),s&&Dl(s)&&c&&(n=u[h-1][0]-u[0][0],r=u[h-1][1]-u[0][1],b=Math.atan2(r,n),m=Math.cos(b)*(c||0),v=Math.sin(b)*(c||0)),t.moveTo(e+(g||m),f+(y||v));for(var x=1;x<h-1;x++){var w=u[x];t.lineTo(w[0]-a,w[1]-o)}t.lineTo(d,p)}function du(t,e){var n,r,i=e.defX,a=void 0===i?0:i,i=e.defY,o=void 0===i?0:i,i=e.markerStart,s=e.markerEnd,l=e.markerStartOffset,c=e.markerEndOffset,u=e.points.points,h=u.length,e=u[0][0]-a,f=u[0][1]-o,d=u[h-1][0]-a,p=u[h-1][1]-o,g=0,y=0,m=0,v=0,b=0;i&&Dl(i)&&l&&(n=u[1][0]-u[0][0],r=u[1][1]-u[0][1],b=Math.atan2(r,n),g=Math.cos(b)*(l||0),y=Math.sin(b)*(l||0)),s&&Dl(s)&&c&&(n=u[h-2][0]-u[h-1][0],r=u[h-2][1]-u[h-1][1],b=Math.atan2(r,n),m=Math.cos(b)*(c||0),v=Math.sin(b)*(c||0)),t.moveTo(e+g,f+y);for(var x=1;x<h-1;x++){var w=u[x];t.lineTo(w[0]-a,w[1]-o)}t.lineTo(d+m,p+v)}function pu(t,e){var n,r,i,a,o=e.radius,s=e.width,e=e.height,l=s,c=e;o&&o.some(function(t){return 0!==t})?(n=(s=0<s?1:-1)+(e=0<e?1:-1)==0,r=(o=j(o.map(function(t){return Be(t,0,Math.min(Math.abs(l)/2,Math.abs(c)/2))}),4))[0],i=o[1],a=o[2],o=o[3],t.moveTo(s*r,0),t.lineTo(l-s*i,0),0!==i&&t.arc(l-s*i,e*i,i,-e*Math.PI/2,0<s?0:Math.PI,n),t.lineTo(l,c-e*a),0!==a&&t.arc(l-s*a,c-e*a,a,0<s?0:Math.PI,0<e?Math.PI/2:1.5*Math.PI,n),t.lineTo(s*o,c),0!==o&&t.arc(s*o,c-e*o,o,0<e?Math.PI/2:-Math.PI/2,0<s?Math.PI:0,n),t.lineTo(0,e*r),0!==r&&t.arc(s*r,e*r,r,0<s?Math.PI:0,0<e?1.5*Math.PI:Math.PI/2,n)):t.rect(0,0,l,c)}t(mu,gu=ln),mu.prototype.init=function(){(t={})[O.CIRCLE]=lu,t[O.ELLIPSE]=cu,t[O.RECT]=pu,t[O.LINE]=uu,t[O.POLYLINE]=du,t[O.POLYGON]=fu,t[O.PATH]=hu,t[O.TEXT]=void 0,t[O.GROUP]=void 0,t[O.IMAGE]=void 0,t[O.HTML]=void 0,t[O.MESH]=void 0;var t;this.context.pathGeneratorFactory=t},mu.prototype.destroy=function(){delete this.context.pathGeneratorFactory};var gu,yu=mu;function mu(){var t=null!==gu&&gu.apply(this,arguments)||this;return t.name="canvas-path-generator",t}var vu=At(),bu=At(),xu=At(),wu=Z(),Mu=(Ou.prototype.apply=function(t,e){var n=this,r=t.renderingService,i=t.renderingContext,a=(this.context=t,this.runtime=e,null==(t=i.root)?void 0:t.ownerDocument);r.hooks.pick.tapPromise(Ou.tag,function(e){return X(n,void 0,void 0,function(){return R(this,function(t){return[2,this.pick(a,e)]})})}),r.hooks.pickSync.tap(Ou.tag,function(t){return n.pick(a,t)})},Ou.prototype.pick=function(t,e){var n,r,i=e.topmost,a=(o=e.position).x,o=o.y,s=Lt(vu,a,o,0),a=t.elementsFromBBox(s[0],s[1],s[0],s[1]),l=[];try{for(var c=I(a),u=c.next();!u.done;u=c.next()){var h=u.value,f=h.getWorldTransform();if(this.isHit(h,s,f,!1)){var d=as(h);if(d){var p=d.parsedStyle.clipPath;if(this.isHit(p,s,p.getWorldTransform(),!0)){if(i)return e.picked=[h],e;l.push(h)}}else{if(i)return e.picked=[h],e;l.push(h)}}}}catch(t){n={error:t}}finally{try{u&&!u.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}return e.picked=l,e},Ou.tag="CanvasPicker",Ou);function Ou(){var o=this;this.isHit=function(t,e,n,r){var i=o.context.pointInPathPickerFactory[t.nodeName];if(i){var n=nt(wu,n),e=Bt(bu,Lt(xu,e[0],e[1],0),n),n=t.getGeometryBounds().halfExtents,a=t.parsedStyle.anchor;if(e[0]+=(a&&a[0]||0)*n[0]*2,e[1]+=(a&&a[1]||0)*n[1]*2,i(t,new Tr(e[0],e[1]),r,o.isPointInPath,o.context,o.runtime))return!0}return!1},this.isPointInPath=function(t,e){var n=o.runtime.offscreenCanvas.getOrCreateContext(o.context.config.offscreenCanvas),r=o.context.pathGeneratorFactory[t.nodeName];return r&&(n.beginPath(),r(n,t.parsedStyle),n.closePath()),n.isPointInPath(e.x,e.y)}}function ku(t,e,n){var t=t.parsedStyle,r=t.r,i=t.fill,a=t.stroke,o=t.lineWidth,s=t.increasedLineWidthForHitTesting,t=t.pointerEvents,o=((o||0)+(s||0))/2,s=Pn(r,r,e.x,e.y),e=j(ls(t,i,a),2),t=e[0],i=e[1];return t&&i||n?s<=r+o:t?s<=r:!!i&&r-o<=s&&s<=r+o}function Eu(t,e,n,r){return t/(n*n)+e/(r*r)}function Su(t,e,n){var t=t.parsedStyle,r=t.rx,i=t.ry,a=t.fill,o=t.stroke,s=t.lineWidth,l=t.increasedLineWidthForHitTesting,t=t.pointerEvents,c=e.x,e=e.y,t=j(ls(t,a,o),2),a=t[0],o=t[1],t=((s||0)+(l||0))/2,s=(c-r)*(c-r),l=(e-i)*(e-i);return a&&o||n?Eu(s,l,r+t,i+t)<=1:a?Eu(s,l,r,i)<=1:!!o&&1<=Eu(s,l,r-t,i-t)&&Eu(s,l,r+t,i+t)<=1}function Au(t,e,n,r,i,a){return t<=i&&i<=t+n&&e<=a&&a<=e+r}function _u(t,e,n,r,i,a,o,s){var l=(Math.atan2(s-e,o-t)+2*Math.PI)%(2*Math.PI),t={x:t+n*Math.cos(l),y:e+n*Math.sin(l)};return Pn(t.x,t.y,o,s)<=a/2}function Tu(t,e,n,r,i,a,o){var s=Math.min(t,n),l=Math.max(t,n),c=Math.min(e,r),u=Math.max(e,r),h=i/2;return s-h<=a&&a<=l+h&&c-h<=o&&o<=u+h&&Rn(t,e,n,r,a,o)<=i/2}function Pu(t,e,n,r,i){var a=t.length;if(!(a<2)){for(var o=0;o<a-1;o++)if(Tu(t[o][0],t[o][1],t[o+1][0],t[o+1][1],e,n,r))return!0;if(i){var i=t[0],s=t[a-1];if(Tu(i[0],i[1],s[0],s[1],e,n,r))return!0}}return!1}var Lu=1e-6;function Cu(t){return Math.abs(t)<Lu?0:t<0?-1:1}function Nu(t,e,n){var r=!1,i=t.length;if(i<=2)return!1;for(var a,o,s,l=0;l<i;l++){var c=t[l],u=t[(l+1)%i];if(o=u,((s=[e,n])[0]-(a=c)[0])*(o[1]-a[1])==(o[0]-a[0])*(s[1]-a[1])&&Math.min(a[0],o[0])<=s[0]&&s[0]<=Math.max(a[0],o[0])&&Math.min(a[1],o[1])<=s[1]&&s[1]<=Math.max(a[1],o[1]))return!0;0<Cu(c[1]-n)!=0<Cu(u[1]-n)&&Cu(e-(n-c[1])*(c[0]-u[0])/(c[1]-u[1])-c[0])<0&&(r=!r)}return r}function ju(t,e,n){for(var r=!1,i=0;i<t.length&&!(r=Nu(t[i],e,n));i++);return r}function Ru(t,e,n){var t=t.parsedStyle,r=t.x1,i=t.y1,a=t.x2,o=t.y2,s=t.lineWidth,l=t.increasedLineWidthForHitTesting,c=t.defX,c=void 0===c?0:c,u=t.defY,u=void 0===u?0:u;return!(!j(ls(t.pointerEvents,t.fill,t.stroke),2)[1]&&!n||!s)&&Tu(r,i,a,o,(s||0)+(l||0),e.x+c,e.y+u)}function Iu(t,e,n,r,i){for(var a=!1,o=e/2,s=0;s<t.length;s++){var l=t[s],c=l.currentPoint,u=l.params,h=l.prePoint,f=l.box;if(!f||Au(f.x-o,f.y-o,f.width+e,f.height+e,n,r))switch(l.command){case"L":case"Z":if(a=Tu(h[0],h[1],c[0],c[1],e,n,r))return!0;break;case"Q":if(a=function(t,e,n,r,i,a,o,s){return Pn((t=this.nearestPoint(t,e,n,r,i,a,o,s)).x,t.y,o,s)}(h[0],h[1],u[1],u[2],u[3],u[4],n,r)<=e/2)return!0;break;case"C":if(a=Dn(h[0],h[1],u[1],u[2],u[3],u[4],u[5],u[6],n,r,i)<=e/2)return!0;break;case"A":l.cubicParams||(l.cubicParams=fe(h[0],h[1],u[1],u[2],u[3],u[4],u[5],u[6],u[7],void 0));for(var d=l.cubicParams,p=h,g=0;g<d.length;g+=6){var y=Dn(p[0],p[1],d[g],d[g+1],d[g+2],d[g+3],d[g+4],d[g+5],n,r,i),p=[d[g+4],d[g+5]];if(a=y<=e/2)return!0}}}return a}function Bu(t,e,n,r,i,a){var o=t.parsedStyle,s=o.lineWidth,l=o.increasedLineWidthForHitTesting,c=o.stroke,u=o.fill,h=o.defX,h=void 0===h?0:h,f=o.defY,f=void 0===f?0:f,d=o.path,o=o.pointerEvents,p=d.segments,g=d.hasArc,y=d.polylines,d=d.polygons,o=j(ls(o,(null==d?void 0:d.length)&&u,c),2),u=o[0],c=o[1],o=_a(t),m=!1;return u||n?g?r(t,e):ju(d,e.x+h,e.y+f)||ju(y,e.x+h,e.y+f):c||n?Iu(p,(s||0)+(l||0),e.x+h,e.y+f,o):m}function Du(t,e,n){var t=t.parsedStyle,r=t.stroke,i=t.fill,a=t.lineWidth,o=t.increasedLineWidthForHitTesting,s=t.points,l=t.defX,l=void 0===l?0:l,c=t.defY,c=void 0===c?0:c,t=j(ls(t.pointerEvents,i,r),2),i=t[0],r=!1;return r=(r=t[1]||n?Pu(s.points,(a||0)+(o||0),e.x+l,e.y+c,!0):r)||!i&&!n?r:Nu(s.points,e.x+l,e.y+c)}function Fu(t,e,n){var t=t.parsedStyle,r=t.lineWidth,i=t.increasedLineWidthForHitTesting,a=t.points,o=t.defX,o=void 0===o?0:o,s=t.defY,s=void 0===s?0:s;return!(!j(ls(t.pointerEvents,t.fill,t.stroke),2)[1]&&!n||!r)&&Pu(a.points,(r||0)+(i||0),e.x+o,e.y+s,!1)}function zu(t,e,n,r,i){var a,o,s,l,c,u,h,f,d,p=t.parsedStyle,g=p.radius,y=p.fill,m=p.stroke,v=p.lineWidth,b=p.increasedLineWidthForHitTesting,x=p.width,w=p.height,p=j(ls(p.pointerEvents,y,m),2),y=p[0],m=p[1],p=(v||0)+(b||0);return g&&g.some(function(t){return 0!==t})?(v=!1,(m||n)&&(h=b=0,l=x,u=w,g=g.map(function(t){return Be(t,0,Math.min(Math.abs(x)/2,Math.abs(w)/2))}),d=p,a=e.x,o=e.y,g=j(g,4),f=g[0],s=g[1],c=g[2],g=g[3],v=Tu(b+f,h,b+l-s,h,d,a,o)||Tu(b+l,h+s,b+l,h+u-c,d,a,o)||Tu(b+l-c,h+u,b+g,h+u,d,a,o)||Tu(b,h+u-g,b,h+f,d,a,o)||_u(b+l-s,h+s,s,Math.PI,Math.PI,d,a,o)||_u(b+l-c,h+u-c,c,0,Math.PI,d,a,o)||_u(b+g,h+u-g,g,Math.PI,Math.PI,d,a,o)||_u(b+f,h+f,f,Math.PI,Math.PI,d,a,o)),v||!y&&!n?v:r(t,e)):(s=p/2,y&&m||n?Au(0-s,0-s,x+s,w+s,e.x,e.y):y?Au(0,0,x,w,e.x,e.y):!!m&&(c=l=0,u=x,g=w,b=p,h=e.x,f=e.y,Au(l-(d=b/2),c-d,u,b,h,f)||Au(l+u-d,c-d,b,g,h,f)||Au(l+d,c+g-d,u,b,h,f)||Au(l-d,c+d,b,g,h,f)))}function Wu(t,e,n,r,i,a){var o,s=t.parsedStyle,l=s.pointerEvents,c=s.width,s=s.height;return"non-transparent-pixel"!==l||(l=i.config.offscreenCanvas,o=a.offscreenCanvas.getOrCreateCanvas(l),a=a.offscreenCanvas.getOrCreateContext(l,{willReadFrequently:!0}),o.width=c,o.height=s,i.defaultStyleRendererFactory[O.IMAGE].render(a,t.parsedStyle,t,void 0,void 0,void 0),a.getImageData(e.x,e.y,1,1).data.every(function(t){return 0!==t}))}t(Yu,Gu=ln),Yu.prototype.init=function(){(t={})[O.CIRCLE]=ku,t[O.ELLIPSE]=Su,t[O.RECT]=zu,t[O.LINE]=Ru,t[O.POLYLINE]=Fu,t[O.POLYGON]=Du,t[O.PATH]=Bu,t[O.TEXT]=function(){return!0},t[O.GROUP]=null,t[O.IMAGE]=Wu,t[O.HTML]=null,t[O.MESH]=null;var t;this.context.pointInPathPickerFactory=t,this.addRenderingPlugin(new Mu)},Yu.prototype.destroy=function(){delete this.context.pointInPathPickerFactory,this.removeAllRenderingPlugins()};var Gu,Hu=Yu;function Yu(){var t=null!==Gu&&Gu.apply(this,arguments)||this;return t.name="canvas-picker",t}qu.prototype.apply=function(t,c){function i(t){(t=t.target.rBushNode).aabb&&u.removedRBushNodeAABBs.push(t.aabb)}function a(t){(t=t.target.rBushNode).aabb&&u.removedRBushNodeAABBs.push(t.aabb)}var u=this,h=(this.context=t).config,f=t.camera,l=t.renderingService,d=t.renderingContext,e=t.rBushRoot,n=t.pathGeneratorFactory,p=(this.rBush=e,this.pathGeneratorFactory=n,t.contextService),g=d.root.ownerDocument.defaultView,y=(l.hooks.init.tap(qu.tag,function(){g.addEventListener(v.UNMOUNTED,i),g.addEventListener(v.CULLED,a);var t=p.getDPR(),e=h.width,n=h.height,r=p.getContext();u.clearRect(r,0,0,e*t,n*t,h.background)}),l.hooks.destroy.tap(qu.tag,function(){g.removeEventListener(v.UNMOUNTED,i),g.removeEventListener(v.CULLED,a)}),l.hooks.beginFrame.tap(qu.tag,function(){var t=p.getContext(),e=p.getDPR(),n=h.width,r=h.height,i=(a=u.canvasRendererPluginOptions).dirtyObjectNumThreshold,a=a.dirtyObjectRatioThreshold,o=(s=l.getStats()).total,s=s.rendered,o=s/o;u.clearFullScreen=l.disableDirtyRectangleRendering()||i<s&&a<o,t&&(t.resetTransform?t.resetTransform():t.setTransform(1,0,0,1,0,0),u.clearFullScreen)&&u.clearRect(t,0,0,n*e,r*e,h.background)}),function(t,e){t.isVisible()&&!t.isCulled()&&(u.renderDisplayObject(t,e,u.context,u.restoreStack,c),u.saveDirtyAABB(t)),(t.sortable.sorted||t.childNodes).forEach(function(t){y(t,e)})});l.hooks.endFrame.tap(qu.tag,function(){var e=p.getContext(),t=p.getDPR();if(pt(u.dprMatrix,[t,t,1]),lt(u.vpMatrix,u.dprMatrix,f.getOrthoMatrix()),u.clearFullScreen)y(d.root,e);else{t=u.safeMergeAABB.apply(u,M([u.mergeDirtyAABBs(u.renderQueue)],j(u.removedRBushNodeAABBs.map(function(t){var e=t.minX,n=t.minY,r=t.maxX,t=t.maxY,i=new Mr;return i.setMinMax([e,n,0],[r,t,0]),i})),!1));if(u.removedRBushNodeAABBs=[],Mr.isEmpty(t))return void(u.renderQueue=[]);var n=u.convertAABB2Rect(t),r=n.x,i=n.y,a=n.width,n=n.height,o=Bt(u.vec3a,[r,i,0],u.vpMatrix),s=Bt(u.vec3b,[r+a,i,0],u.vpMatrix),l=Bt(u.vec3c,[r,i+n,0],u.vpMatrix),r=Bt(u.vec3d,[r+a,i+n,0],u.vpMatrix),a=Math.min(o[0],s[0],r[0],l[0]),i=Math.min(o[1],s[1],r[1],l[1]),n=Math.max(o[0],s[0],r[0],l[0]),o=Math.max(o[1],s[1],r[1],l[1]),s=Math.floor(a),r=Math.floor(i),l=Math.ceil(n-a),n=Math.ceil(o-i);e.save(),u.clearRect(e,s,r,l,n,h.background),e.beginPath(),e.rect(s,r,l,n),e.clip(),e.setTransform(u.vpMatrix[0],u.vpMatrix[1],u.vpMatrix[4],u.vpMatrix[5],u.vpMatrix[12],u.vpMatrix[13]),h.renderer.getConfig().enableDirtyRectangleRenderingDebug&&g.dispatchEvent(new ll(Hc.DIRTY_RECTANGLE,{dirtyRect:{x:s,y:r,width:l,height:n}})),u.searchDirtyObjects(t).sort(function(t,e){return t.sortable.renderOrder-e.sortable.renderOrder}).forEach(function(t){t&&t.isVisible()&&!t.isCulled()&&u.renderDisplayObject(t,e,u.context,u.restoreStack,c)}),e.restore(),u.renderQueue.forEach(function(t){u.saveDirtyAABB(t)}),u.renderQueue=[]}u.restoreStack.forEach(function(){e.restore()}),u.restoreStack=[]}),l.hooks.render.tap(qu.tag,function(t){u.clearFullScreen||u.renderQueue.push(t)})},qu.prototype.clearRect=function(t,e,n,r,i,a){t.clearRect(e,n,r,i),a&&(t.fillStyle=a,t.fillRect(e,n,r,i))},qu.prototype.renderDisplayObject=function(t,e,n,r,i){var a,o=t.nodeName,s=r[r.length-1],s=(!s||t.compareDocumentPosition(s)&Node.DOCUMENT_POSITION_CONTAINS||(e.restore(),r.pop()),this.context.styleRendererFactory[o]),o=this.pathGeneratorFactory[o],l=t.parsedStyle.clipPath;l&&(this.applyWorldTransform(e,l),a=this.pathGeneratorFactory[l.nodeName])&&(e.save(),r.push(t),e.beginPath(),a(e,l.parsedStyle),e.closePath(),e.clip()),s&&(this.applyWorldTransform(e,t),e.save(),this.applyAttributesToContext(e,t)),o&&(e.beginPath(),o(e,t.parsedStyle),t.nodeName!==O.LINE)&&t.nodeName!==O.PATH&&t.nodeName!==O.POLYLINE&&e.closePath(),s&&(s.render(e,t.parsedStyle,t,n,this,i),e.restore()),t.renderable.dirty=!1},qu.prototype.convertAABB2Rect=function(t){var e=t.getMin(),t=t.getMax(),n=Math.floor(e[0]),e=Math.floor(e[1]);return{x:n,y:e,width:Math.ceil(t[0])-n,height:Math.ceil(t[1])-e}},qu.prototype.mergeDirtyAABBs=function(t){var n=new Mr;return t.forEach(function(t){var e=t.getRenderBounds(),e=(n.add(e),t.renderable.dirtyRenderBounds);e&&n.add(e)}),n},qu.prototype.searchDirtyObjects=function(t){var e=(n=j(t.getMin(),2))[0],n=n[1],r=(t=j(t.getMax(),2))[0],t=t[1];return this.rBush.search({minX:e,minY:n,maxX:r,maxY:t}).map(function(t){return t.displayObject})},qu.prototype.saveDirtyAABB=function(t){var e=t.renderable,t=(e.dirtyRenderBounds||(e.dirtyRenderBounds=new Mr),t.getRenderBounds());t&&e.dirtyRenderBounds.update(t.center,t.halfExtents)},qu.prototype.applyAttributesToContext=function(t,e){var n=(o=e.parsedStyle).stroke,r=o.fill,i=o.opacity,a=o.lineDash,o=o.lineDashOffset;a&&t.setLineDash(a),A(o)||(t.lineDashOffset=o),A(i)||(t.globalAlpha*=i),A(n)||Array.isArray(n)||n.isNone||(t.strokeStyle=e.attributes.stroke),A(r)||Array.isArray(r)||r.isNone||(t.fillStyle=e.attributes.fill)},qu.prototype.applyWorldTransform=function(t,e,n){var r=0,i=0,a=(e.parsedStyle||{}).anchor,o=a&&a[0]||0,a=a&&a[1]||0;0===o&&0===a||(r=-o*((o=e.geometry.contentBounds)&&2*o.halfExtents[0]||0),i=-a*(o&&2*o.halfExtents[1]||0)),n?(Q(this.tmpMat4,e.getLocalTransform()),this.vec3a[0]=r,this.vec3a[1]=i,this.vec3a[2]=0,ct(this.tmpMat4,this.tmpMat4,this.vec3a),lt(this.tmpMat4,n,this.tmpMat4)):(Q(this.tmpMat4,e.getWorldTransform()),this.vec3a[0]=r,this.vec3a[1]=i,this.vec3a[2]=0,ct(this.tmpMat4,this.tmpMat4,this.vec3a)),lt(this.tmpMat4,this.vpMatrix,this.tmpMat4),t.setTransform(this.tmpMat4[0],this.tmpMat4[1],this.tmpMat4[4],this.tmpMat4[5],this.tmpMat4[12],this.tmpMat4[13])},qu.prototype.safeMergeAABB=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=new Mr;return t.forEach(function(t){n.add(t)}),n},qu.tag="CanvasRenderer";var Vu=qu;function qu(t){this.canvasRendererPluginOptions=t,this.removedRBushNodeAABBs=[],this.renderQueue=[],this.restoreStack=[],this.clearFullScreen=!1,this.vpMatrix=Z(),this.dprMatrix=Z(),this.tmpMat4=Z(),this.vec3a=At(),this.vec3b=At(),this.vec3c=At(),this.vec3d=At()}Uu.prototype.render=function(t,e,n,r,i,a){var o=e.fill,s=e.fillRule,l=e.opacity,c=e.fillOpacity,u=e.stroke,h=e.strokeOpacity,f=e.lineWidth,d=e.lineCap,p=e.lineJoin,g=e.shadowType,y=e.shadowColor,m=e.shadowBlur,v=e.filter,e=e.miterLimit,b=!A(o)&&!o.isNone,x=!A(u)&&!u.isNone&&0<f,w=0===o.alpha,v=!(!v||!v.length),y=!A(y)&&0<m,m=n.nodeName,g="inner"===g,m=x&&y&&(m===O.PATH||m===O.LINE||m===O.POLYLINE||w||g);b&&(t.globalAlpha=l*c,m||Xu(n,t,y),this.fill(t,n,o,s,r,i,a),m||this.clearShadowAndFilter(t,v,y)),x&&(t.globalAlpha=l*h,t.lineWidth=f,A(e)||(t.miterLimit=e),A(d)||(t.lineCap=d),A(p)||(t.lineJoin=p),m&&(g&&(t.globalCompositeOperation="source-atop"),Xu(n,t,!0),g)&&(this.stroke(t,n,u,r,i,a),t.globalCompositeOperation="source-over",this.clearShadowAndFilter(t,v,!0)),this.stroke(t,n,u,r,i,a))},Uu.prototype.clearShadowAndFilter=function(t,e,n){n&&(t.shadowColor="transparent",t.shadowBlur=0),e&&(n=t.filter,!A(n))&&-1<n.indexOf("drop-shadow")&&(t.filter=n.replace(/drop-shadow\([^)]*\)/,"").trim()||"none")},Uu.prototype.fill=function(e,n,t,r,i,a,o){var s=this;Array.isArray(t)?t.forEach(function(t){e.fillStyle=s.getColor(t,n,e),r?e.fill(r):e.fill()}):(ca(t)&&(e.fillStyle=this.getPattern(t,n,e,i,a,o)),r?e.fill(r):e.fill())},Uu.prototype.stroke=function(e,n,t,r,i,a){var o=this;Array.isArray(t)?t.forEach(function(t){e.strokeStyle=o.getColor(t,n,e),e.stroke()}):(ca(t)&&(e.strokeStyle=this.getPattern(t,n,e,r,i,a)),e.stroke())},Uu.prototype.getPattern=function(t,e,n,r,i,a){var o,s,l,c,u,h,f;return"rect"===t.image.nodeName&&(o=(s=t.image.parsedStyle).width,s=s.height,l=r.contextService.getDPR(),c=r.config.offscreenCanvas,(u=a.offscreenCanvas.getOrCreateCanvas(c)).width=o*l,u.height=s*l,h=a.offscreenCanvas.getOrCreateContext(c),f=[],t.image.forEach(function(t){i.renderDisplayObject(t,h,r,f,a)}),f.forEach(function(){h.restore()})),this.imagePool.getOrCreatePatternSync(t,n,u,l,function(){e.renderable.dirty=!0,r.renderingService.dirtify()})},Uu.prototype.getColor=function(t,e,n){var r;return t.type!==Kr.LinearGradient&&t.type!==Kr.RadialGradient||(r=(e=e.getGeometryBounds())&&2*e.halfExtents[0]||1,e=e&&2*e.halfExtents[1]||1,r=this.imagePool.getOrCreateGradient(m(m({type:t.type},t.value),{width:r,height:e}),n)),r};var $u=Uu;function Uu(t){this.imagePool=t}function Xu(t,e,n){var r=t.parsedStyle,i=r.filter,a=r.shadowColor,o=r.shadowBlur,s=r.shadowOffsetX,r=r.shadowOffsetY;i&&i.length&&(e.filter=t.style.filter),n&&(e.shadowColor=a.toString(),e.shadowBlur=o||0,e.shadowOffsetX=s||0,e.shadowOffsetY=r||0)}Zu.prototype.render=function(t,e,n){var r=e.width,i=e.height,a=e.img,o=e.shadowColor,e=e.shadowBlur,a=Ie(a)?this.imagePool.getImageSync(a):(r=r||a.width,i=i||a.height,a);if(a){Xu(n,t,!A(o)&&0<e);try{t.drawImage(a,0,0,r,i)}catch(t){}}};var Ku=Zu;function Zu(t){this.imagePool=t}oh.prototype.render=function(t,e,n){var r=e.lineWidth,i=e.textAlign,a=e.textBaseline,o=e.lineJoin,s=e.miterLimit,l=e.letterSpacing,c=e.stroke,u=e.fill,h=e.fillOpacity,f=e.strokeOpacity,d=e.opacity,p=e.metrics,g=e.dx,y=e.dy,m=e.shadowColor,e=e.shadowBlur,v=p.font,b=p.lines,x=p.height,w=p.lineHeight,M=p.lineMetrics,p=(t.font=v,t.lineWidth=r,t.textAlign="middle"===i?"center":i,a),O=(_.enableCSSParsing||"alphabetic"!==p||(p="bottom"),t.lineJoin=o,A(s)||(t.miterLimit=s),0),k=("middle"===a?O=-x/2-w/2:"bottom"===a||"alphabetic"===a||"ideographic"===a?O=-x:"top"!==a&&"hanging"!==a||(O=-w),g||0),v=(O+=y||0,1===b.length&&("bottom"===p?(p="middle",O-=.5*x):"top"===p&&(p="middle",O+=.5*x)),t.textBaseline=p,!A(m)&&0<e);Xu(n,t,v);for(var E=0;E<b.length;E++){var S=r/2+k;O+=w,A(c)||c.isNone||!r||this.drawLetterSpacing(t,b[E],M[E],i,S,O,l,h,f,d,!0),A(u)||this.drawLetterSpacing(t,b[E],M[E],i,S,O,l,h,f,d)}},oh.prototype.drawLetterSpacing=function(t,e,n,r,i,a,o,s,l,c,u){if(void 0===u&&(u=!1),0===o)u?this.strokeText(t,e,i,a,l):this.fillText(t,e,i,a,s,c);else{for(var h=t.textAlign,f=(t.textAlign="left",i),d=("center"===r||"middle"===r?f=i-n.width/2:"right"!==r&&"end"!==r||(f=i-n.width),Array.from(e)),p=t.measureText(e).width,g=0;g<d.length;++g){var y=d[g];u?this.strokeText(t,y,f,a,l):this.fillText(t,y,f,a,s,c),f+=p-(y=t.measureText(e.substring(g+1)).width)+o,p=y}t.textAlign=h}},oh.prototype.fillText=function(t,e,n,r,i,a){var o,s=!A(i)&&1!==i;s&&(o=t.globalAlpha,t.globalAlpha=i*a),t.fillText(e,n,r),s&&(t.globalAlpha=o)},oh.prototype.strokeText=function(t,e,n,r,i){var a,o=!A(i)&&1!==i;o&&(a=t.globalAlpha,t.globalAlpha=i),t.strokeText(e,n,r),o&&(t.globalAlpha=a)};var Qu,Ju,th,eh,nh,rh,ih,ah=oh;function oh(){}function sh(){return null!==Qu&&Qu.apply(this,arguments)||this}function lh(){return null!==Ju&&Ju.apply(this,arguments)||this}function ch(){return null!==th&&th.apply(this,arguments)||this}function uh(){return null!==eh&&eh.apply(this,arguments)||this}function hh(){return null!==nh&&nh.apply(this,arguments)||this}function fh(){return null!==rh&&rh.apply(this,arguments)||this}function dh(){return null!==ih&&ih.apply(this,arguments)||this}t(sh,Qu=$u),t(lh,Ju=$u),t(ch,th=$u),t(uh,eh=$u),t(hh,nh=$u),t(fh,rh=$u),t(dh,ih=$u);t(yh,ph=ln),yh.prototype.init=function(){var t,e=m({dirtyObjectNumThreshold:500,dirtyObjectRatioThreshold:.8},this.options),n=this.context.imagePool,r=new $u(n),n=((t={})[O.CIRCLE]=r,t[O.ELLIPSE]=r,t[O.RECT]=r,t[O.IMAGE]=new Ku(n),t[O.TEXT]=new ah,t[O.LINE]=r,t[O.POLYLINE]=r,t[O.POLYGON]=r,t[O.PATH]=r,t[O.GROUP]=void 0,t[O.HTML]=void 0,t[O.MESH]=void 0,t);this.context.defaultStyleRendererFactory=n,this.context.styleRendererFactory=n,this.addRenderingPlugin(new Vu(e))},yh.prototype.destroy=function(){this.removeAllRenderingPlugins(),delete this.context.defaultStyleRendererFactory,delete this.context.styleRendererFactory};var ph,gh=yh;function yh(t){void 0===t&&(t={});var e=ph.call(this)||this;return e.options=t,e.name="canvas-renderer",e}vh.prototype.apply=function(t,r){function i(t){e.hooks.pointerWheel.call(t)}function a(t){e.hooks.click.call(t)}var o=this,e=t.renderingService,n=t.renderingContext,s=t.config,l=(this.context=t,n.root.ownerDocument.defaultView),c=function(t){e.hooks.pointerMove.call(t)},u=function(t){e.hooks.pointerUp.call(t)},h=function(t){e.hooks.pointerDown.call(t)},f=function(t){e.hooks.pointerOver.call(t)},d=function(t){e.hooks.pointerOut.call(t)},p=function(t){e.hooks.pointerCancel.call(t)};e.hooks.init.tap(vh.tag,function(){var t,e,n=o.context.contextService.getDomElement();r.globalThis.navigator.msPointerEnabled?(n.style.msContentZooming="none",n.style.msTouchAction="none"):l.supportsPointerEvents&&(n.style.touchAction="none"),l.supportsPointerEvents?(t=n,r.globalThis.document.addEventListener("pointermove",c,!0),t.addEventListener("pointerdown",h,!0),t.addEventListener("pointerleave",d,!0),t.addEventListener("pointerover",f,!0),r.globalThis.addEventListener("pointerup",u,!0),r.globalThis.addEventListener("pointercancel",p,!0)):(t=n,r.globalThis.document.addEventListener("mousemove",c,!0),t.addEventListener("mousedown",h,!0),t.addEventListener("mouseout",d,!0),t.addEventListener("mouseover",f,!0),r.globalThis.addEventListener("mouseup",u,!0)),l.supportsTouchEvents&&((e=n).addEventListener("touchstart",h,!0),e.addEventListener("touchend",u,!0),e.addEventListener("touchmove",c,!0),e.addEventListener("touchcancel",p,!0)),s.useNativeClickEvent&&n.addEventListener("click",a,!0),n.addEventListener("wheel",i,{passive:!0,capture:!0})}),e.hooks.destroy.tap(vh.tag,function(){var t,e,n=o.context.contextService.getDomElement();r.globalThis.navigator.msPointerEnabled?(n.style.msContentZooming="",n.style.msTouchAction=""):l.supportsPointerEvents&&(n.style.touchAction=""),l.supportsPointerEvents?(t=n,r.globalThis.document.removeEventListener("pointermove",c,!0),t.removeEventListener("pointerdown",h,!0),t.removeEventListener("pointerleave",d,!0),t.removeEventListener("pointerover",f,!0),r.globalThis.removeEventListener("pointerup",u,!0)):(t=n,r.globalThis.document.removeEventListener("mousemove",c,!0),t.removeEventListener("mousedown",h,!0),t.removeEventListener("mouseout",d,!0),t.removeEventListener("mouseover",f,!0),r.globalThis.removeEventListener("mouseup",u,!0)),l.supportsTouchEvents&&((e=n).removeEventListener("touchstart",h,!0),e.removeEventListener("touchend",u,!0),e.removeEventListener("touchmove",c,!0),e.removeEventListener("touchcancel",p,!0)),s.useNativeClickEvent&&n.removeEventListener("click",a,!0),n.removeEventListener("wheel",i,!0)})},vh.tag="DOMInteraction";var mh=vh;function vh(){}t(wh,bh=ln),wh.prototype.init=function(){this.addRenderingPlugin(new mh)},wh.prototype.destroy=function(){this.removeAllRenderingPlugins()};var bh,xh=wh;function wh(){var t=null!==bh&&bh.apply(this,arguments)||this;return t.name="dom-interaction",t}Oh.prototype.joinTransformMatrix=function(t){return"matrix(".concat([t[0],t[1],t[4],t[5],t[12],t[13]].join(","),")")},Oh.prototype.apply=function(t){function i(t,e){e.style.transform=s.joinTransformMatrix(t.getWorldTransform())}function e(t){var e,n,r=t.target;r.nodeName===O.HTML&&(s.$camera||(s.$camera=s.createCamera(l)),e=s.getOrCreateEl(r),s.$camera.appendChild(e),n=r.ownerDocument.documentElement.attributes,Object.keys(n).forEach(function(t){e.style[t]=n[t]}),Object.keys(r.attributes).forEach(function(t){s.updateAttribute(t,r)}),i(r,e),_.nativeHTMLMap.set(e,r))}function n(t){(t=t.target).nodeName===O.HTML&&s.$camera&&(t=s.getOrCreateEl(t))&&(t.remove(),_.nativeHTMLMap.delete(t))}function r(t){var e=t.target;e.nodeName===O.HTML&&(t=t.attrName,s.updateAttribute(t,e))}function a(t){var e;(t=t.target).nodeName===O.HTML&&(e=s.getOrCreateEl(t),i(t,e))}function o(){var t,e;s.$camera&&(t=(e=s.context.config).width,e=e.height,s.$camera.style.width="".concat(t||0,"px"),s.$camera.style.height="".concat(e||0,"px"))}var s=this,l=t.camera,c=t.renderingContext,u=t.renderingService,h=(this.context=t,c.root.ownerDocument.defaultView);u.hooks.init.tap(Oh.tag,function(){h.addEventListener(Hc.RESIZE,o),h.addEventListener(v.MOUNTED,e),h.addEventListener(v.UNMOUNTED,n),h.addEventListener(v.ATTR_MODIFIED,r),h.addEventListener(v.BOUNDS_CHANGED,a)}),u.hooks.endFrame.tap(Oh.tag,function(){s.$camera&&c.renderReasons.has(gl.CAMERA_CHANGED)&&(s.$camera.style.transform=s.joinTransformMatrix(l.getOrthoMatrix()))}),u.hooks.destroy.tap(Oh.tag,function(){s.$camera&&s.$camera.remove(),h.removeEventListener(Hc.RESIZE,o),h.removeEventListener(v.MOUNTED,e),h.removeEventListener(v.UNMOUNTED,n),h.removeEventListener(v.ATTR_MODIFIED,r),h.removeEventListener(v.BOUNDS_CHANGED,a)})},Oh.prototype.getId=function(t){return t.id||"g-html-"+t.entity},Oh.prototype.createCamera=function(t){var e,n,r=(a=this.context.config).document,i=a.width,a=a.height,o=this.context.contextService.getDomElement(),s=o.parentNode;return s?((n=s.querySelector("#"+(e="g-canvas-camera")))||((n=r=(r||document).createElement("div")).id=e,r.style.position="absolute",r.style.left="".concat(o.offsetLeft||0,"px"),r.style.top="".concat(o.offsetTop||0,"px"),r.style.transformOrigin="left top",r.style.transform=this.joinTransformMatrix(t.getOrthoMatrix()),r.style.overflow="hidden",r.style.pointerEvents="none",r.style.width="".concat(i||0,"px"),r.style.height="".concat(a||0,"px"),s.appendChild(r)),n):null},Oh.prototype.getOrCreateEl=function(t){var e=this.context.config.document,n=this.getId(t),r=this.$camera.querySelector("#"+n);return r||(r=(e||document).createElement("div"),(t.parsedStyle.$el=r).id=n,t.name&&r.setAttribute("name",t.name),t.className&&(r.className=t.className),r.style.position="absolute",r.style.left="0px",r.style.top="0px",r.style["will-change"]="transform",r.style.transform=this.joinTransformMatrix(t.getWorldTransform())),r},Oh.prototype.updateAttribute=function(t,e){var n=this.getOrCreateEl(e);switch(t){case"innerHTML":var r=e.parsedStyle.innerHTML;Ie(r)?n.innerHTML=r:(n.innerHTML="",n.appendChild(r));break;case"transformOrigin":r=e.parsedStyle.transformOrigin;n.style["transform-origin"]="".concat(r[0].value," ").concat(r[1].value);break;case"width":_.enableCSSParsing?(i=e.computedStyleMap().get("width"),n.style.width=i.toString()):(i=e.parsedStyle.width,n.style.width=De(i)?"".concat(i,"px"):i.toString());break;case"height":_.enableCSSParsing?(a=e.computedStyleMap().get("height"),n.style.height=a.toString()):(a=e.parsedStyle.height,n.style.height=De(a)?"".concat(a,"px"):a.toString());break;case"zIndex":r=e.parsedStyle.zIndex;n.style["z-index"]="".concat(r);break;case"visibility":var i=e.parsedStyle.visibility;n.style.visibility=i;break;case"pointerEvents":var a=e.parsedStyle.pointerEvents;n.style.pointerEvents=a;break;case"opacity":r=e.parsedStyle.opacity;n.style.opacity="".concat(r);break;case"fill":i=e.parsedStyle.fill,a="";ua(i)?a=i.isNone?"transparent":e.getAttribute("fill"):Array.isArray(i)?a=e.getAttribute("fill"):ca(i),n.style.background=a;break;case"stroke":r=e.parsedStyle.stroke,i="";ua(r)?i=r.isNone?"transparent":e.getAttribute("stroke"):Array.isArray(r)?i=e.getAttribute("stroke"):ca(r),n.style["border-color"]=i,n.style["border-style"]="solid";break;case"lineWidth":a=e.parsedStyle.lineWidth;n.style["border-width"]="".concat(a||0,"px");break;case"lineDash":n.style["border-style"]="dashed";break;case"filter":r=e.style.filter;n.style.filter=r}},Oh.tag="HTMLRendering";var Mh=Oh;function Oh(){}t(Sh,kh=ln),Sh.prototype.init=function(){this.addRenderingPlugin(new Mh)},Sh.prototype.destroy=function(){this.removeAllRenderingPlugins()};var kh,Eh=Sh;function Sh(){var t=null!==kh&&kh.apply(this,arguments)||this;return t.name="html-renderer",t}_h.prototype.getImageSync=function(t,e){return this.imageCache[t]?e&&e():this.getOrCreateImage(t).then(function(){e&&e()}),this.imageCache[t]},_h.prototype.getOrCreateImage=function(r){var i,a=this;return this.imageCache[r]?Promise.resolve(this.imageCache[r]):(i=this.canvasConfig.createImage,new Promise(function(t,e){var n;i?n=i(r):rs&&(n=new window.Image),n&&(n.onload=function(){a.imageCache[r]=n,t(n)},n.onerror=function(t){e(t)},n.crossOrigin="Anonymous",n.src=r)}))},_h.prototype.getOrCreatePatternSync=function(t,e,n,r,i){var a,o,s,l,c=this.generatePatternKey(t);return c&&this.patternCache[c]?this.patternCache[c]:(a=t.image,o=t.repetition,t=t.transform,l=!1,Ie(a)?s=this.getImageSync(a,i):n?(s=n,l=!0):s=a,(i=s&&e.createPattern(s,o))&&(n=void 0,n=t?Co(Qa(t),new Vl({})):tt(Z()),l&&ut(n,n,[1/r,1/r,1]),i.setTransform({a:n[0],b:n[1],c:n[4],d:n[5],e:n[12],f:n[13]})),c&&i&&(this.patternCache[c]=i),i)},_h.prototype.getOrCreateGradient=function(t,e){var n,r,i,a,o,s=this.generateGradientKey(t),l=t.type,c=t.steps,u=t.width,h=t.height,f=t.angle,d=t.cx,p=t.cy,t=t.size;return this.gradientCache[s]||(n=null,l===Kr.LinearGradient?(r=u,i=h,f=hr((f=f).value),a=0+r/2,o=0+i/2,r=Math.abs(r*Math.cos(f))+Math.abs(i*Math.sin(f)),i={x1:a-Math.cos(f)*r/2,y1:o-Math.sin(f)*r/2,x2:a+Math.cos(f)*r/2,y2:o+Math.sin(f)*r/2},n=e.createLinearGradient(i.x1,i.y1,i.x2,i.y2)):l===Kr.RadialGradient&&(a=u,o=h,f=p,r=t,l=(i=d).value,u=f.value,i.unit===g.kPercentage&&(l=i.value/100*a),f.unit===g.kPercentage&&(u=f.value/100*o),i=Math.max(pe([0,0],[l,u]),pe([0,o],[l,u]),pe([a,o],[l,u]),pe([a,0],[l,u])),r&&(r instanceof di?i=r.value:r instanceof ri&&("closest-side"===r.value?i=Math.min(l,a-l,u,o-u):"farthest-side"===r.value?i=Math.max(l,a-l,u,o-u):"closest-corner"===r.value&&(i=Math.min(pe([0,0],[l,u]),pe([0,o],[l,u]),pe([a,o],[l,u]),pe([a,0],[l,u]))))),n=e.createRadialGradient(p=(h={x:l,y:u,r:i}).x,t=h.y,0,p,t,h.r)),n&&(c.forEach(function(t){var e=t.offset,t=t.color;e.unit===g.kPercentage&&null!=n&&n.addColorStop(e.value/100,t.toString())}),this.gradientCache[s]=n)),this.gradientCache[s]},_h.prototype.generateGradientKey=function(t){var e=t.type,n=t.width,r=t.height,i=t.steps,a=t.angle,o=t.cx,s=t.cy,t=t.size;return"gradient-".concat(e,"-").concat((null==a?void 0:a.toString())||0,"-").concat((null==o?void 0:o.toString())||0,"-").concat((null==s?void 0:s.toString())||0,"-").concat((null==t?void 0:t.toString())||0,"-").concat(n,"-").concat(r,"-").concat(i.map(function(t){var e=t.offset,t=t.color;return"".concat(e).concat(t)}).join("-"))},_h.prototype.generatePatternKey=function(t){var e=t.image,t=t.repetition;return Ie(e)?"pattern-".concat(e,"-").concat(t):"rect"===e.nodeName?"pattern-".concat(e.entity,"-").concat(t):void 0};var Ah=_h;function _h(t){this.canvasConfig=t,this.imageCache={},this.gradientCache={},this.patternCache={}}Ph.prototype.apply=function(t){function e(t){var e=t.target,t=e.nodeName,n=e.attributes;t===O.IMAGE&&(t=n.img,Ie(t))&&a.getImageSync(t,function(){e.renderable.dirty=!0,r.dirtify()})}function n(t){var e=t.target,n=t.attrName,t=t.newValue;e.nodeName===O.IMAGE&&"img"===n&&Ie(t)&&a.getOrCreateImage(t).then(function(){e.renderable.dirty=!0,r.dirtify()})}var r=t.renderingService,i=t.renderingContext,a=t.imagePool,o=i.root.ownerDocument.defaultView;r.hooks.init.tap(Ph.tag,function(){o.addEventListener(v.MOUNTED,e),o.addEventListener(v.ATTR_MODIFIED,n)}),r.hooks.destroy.tap(Ph.tag,function(){o.removeEventListener(v.MOUNTED,e),o.removeEventListener(v.ATTR_MODIFIED,n)})},Ph.tag="LoadImage";var Th=Ph;function Ph(){}t(Nh,Lh=ln),Nh.prototype.init=function(){this.context.imagePool=new Ah(this.context.config),this.addRenderingPlugin(new Th)},Nh.prototype.destroy=function(){this.removeAllRenderingPlugins()};var Lh,Ch=Nh;function Nh(){var t=null!==Lh&&Lh.apply(this,arguments)||this;return t.name="image-loader",t}Rh.prototype.init=function(){var t=this.canvasConfig,e=t.container,t=t.canvas;t?(this.$canvas=t,e&&t.parentElement!==e&&e.appendChild(t),this.$container=t.parentElement,this.canvasConfig.container=this.$container):e&&(this.$container=Ie(e)?document.getElementById(e):e,this.$container)&&(t=document.createElement("canvas"),this.$container.appendChild(t),this.$container.style.position||(this.$container.style.position="relative"),this.$canvas=t),this.context=this.$canvas.getContext("2d"),this.resize(this.canvasConfig.width,this.canvasConfig.height)},Rh.prototype.getContext=function(){return this.context},Rh.prototype.getDomElement=function(){return this.$canvas},Rh.prototype.getDPR=function(){return this.dpr},Rh.prototype.getBoundingClientRect=function(){if(this.$canvas.getBoundingClientRect)return this.$canvas.getBoundingClientRect()},Rh.prototype.destroy=function(){this.$container&&this.$canvas&&this.$canvas.parentNode&&this.$container.removeChild(this.$canvas)},Rh.prototype.resize=function(t,e){var n=1<=(n=this.canvasConfig.devicePixelRatio||rs&&window.devicePixelRatio||1)?Math.ceil(n):1;this.dpr=n,this.$canvas&&(this.$canvas.width=this.dpr*t,this.$canvas.height=this.dpr*e,n=this.$canvas,t=t,e=e,rs)&&n.style&&(n.style.width=t+"px",n.style.height=e+"px"),this.renderingContext.renderReasons.add(gl.CAMERA_CHANGED)},Rh.prototype.applyCursorStyle=function(t){this.$container&&this.$container.style&&(this.$container.style.cursor=t)},Rh.prototype.toDataURL=function(r){return void 0===r&&(r={}),X(this,void 0,void 0,function(){var e,n;return R(this,function(t){return e=r.type,n=r.encoderOptions,[2,this.context.canvas.toDataURL(e,n)]})})};var jh=Rh;function Rh(t){this.renderingContext=t.renderingContext,this.canvasConfig=t.config}t(Dh,Ih=ln),Dh.prototype.init=function(){this.context.ContextService=jh},Dh.prototype.destroy=function(){delete this.context.ContextService};var Ih,Bh=Dh;function Dh(){var t=null!==Ih&&Ih.apply(this,arguments)||this;return t.name="canvas-context-register",t}t(Wh,Fh=sn);var Fh,zh=Wh;function Wh(t){t=Fh.call(this,t)||this;return t.registerPlugin(new Bh),t.registerPlugin(new Ch),t.registerPlugin(new yu),t.registerPlugin(new gh),t.registerPlugin(new xh),t.registerPlugin(new Hu),t.registerPlugin(new Eh),t}Hh.prototype.apply=function(t){function e(t){var a,o,s,l,c,e,u=t.target,h=u===d,f=h&&n.dragndropPluginOptions.isDocumentDraggable?d:u.closest&&u.closest("[draggable=true]");f&&(a=!1,o=t.timeStamp,s=[t.clientX,t.clientY],l=null,c=[t.clientX,t.clientY],i.addEventListener("pointermove",e=function(i){return X(n,void 0,void 0,function(){var e,n,r;return R(this,function(t){switch(t.label){case 0:if(!a){if(e=i.timeStamp-o,n=pe([i.clientX,i.clientY],s),e<=this.dragndropPluginOptions.dragstartTimeThreshold||n<=this.dragndropPluginOptions.dragstartDistanceThreshold)return[2];i.type="dragstart",f.dispatchEvent(i),a=!0}return(i.type="drag",i.dx=i.clientX-c[0],i.dy=i.clientY-c[1],f.dispatchEvent(i),c=[i.clientX,i.clientY],h)?[3,2]:(e="pointer"===this.dragndropPluginOptions.overlap?[i.canvasX,i.canvasY]:u.getBounds().center,[4,d.elementsFromPoint(e[0],e[1])]);case 1:n=t.sent(),r=n[n.indexOf(u)+1],r=(null==r?void 0:r.closest("[droppable=true]"))||(this.dragndropPluginOptions.isDocumentDroppable?d:null),l!==r&&(l&&(i.type="dragleave",(i.target=l).dispatchEvent(i)),r&&(i.type="dragenter",(i.target=r).dispatchEvent(i)),l=r)&&(i.type="dragover",(i.target=l).dispatchEvent(i)),t.label=2;case 2:return[2]}})})}),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",f.dispatchEvent(t),a=!1),i.removeEventListener("pointermove",e)},{once:!0}),u.addEventListener("pointerupoutside",t,{once:!0}))}var n=this,r=t.renderingService,d=t.renderingContext.root.ownerDocument,i=d.defaultView;r.hooks.init.tap(Hh.tag,function(){i.addEventListener("pointerdown",e)}),r.hooks.destroy.tap(Hh.tag,function(){i.removeEventListener("pointerdown",e)})},Hh.tag="Dragndrop";var Gh=Hh;function Hh(t){this.dragndropPluginOptions=t}t(qh,Yh=ln),qh.prototype.init=function(){this.addRenderingPlugin(new Gh(m({overlap:"pointer",isDocumentDraggable:!1,isDocumentDroppable:!1,dragstartDistanceThreshold:0,dragstartTimeThreshold:0},this.options)))},qh.prototype.destroy=function(){this.removeAllRenderingPlugins()},qh.prototype.setOptions=function(t){Object.assign(this.plugins[0].dragndropPluginOptions,t)};var Yh,Vh=qh;function qh(t){void 0===t&&(t={});var e=Yh.call(this)||this;return e.options=t,e.name="dragndrop",e}Uh.prototype.on=function(t,e,n){return this._events[t]||(this._events[t]=[]),this._events[t].push({callback:e,once:!!n}),this},Uh.prototype.once=function(t,e){return this.on(t,e,!0)},Uh.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)},Uh.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},Uh.prototype.getEvents=function(){return this._events};var $h=Uh;function Uh(){this._events={}}const Xh=()=>[["cartesian"]],Kh=(Xh.props={},(t={})=>{var e={startAngle:-Math.PI/2,endAngle:3*Math.PI/2,innerRadius:0,outerRadius:1};return Object.assign(Object.assign({},e),t)}),Zh=t=>{var{startAngle:t,endAngle:e,innerRadius:n,outerRadius:r}=Kh(t);return[["translate",0,.5],["reflect.y"],["translate",0,-.5],["polar",t,e,n,r]]},Qh=(Zh.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]]),Jh=(Qh.props={},()=>[["transpose"],["translate",.5,.5],["reflect.x"],["translate",-.5,-.5]]),tf=(Jh.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[...Jh(),...Zh({startAngle:e,endAngle:t,innerRadius:n,outerRadius:r})]}),ef=(tf.props={},(t={})=>{var e={startAngle:-Math.PI/2,endAngle:3*Math.PI/2,innerRadius:0,outerRadius:1};return Object.assign(Object.assign({},e),t)}),nf=t=>{var{startAngle:t,endAngle:e,innerRadius:n,outerRadius:r}=ef(t);return[["transpose"],["translate",.5,.5],["reflect"],["translate",-.5,-.5],...Zh({startAngle:t,endAngle:e,innerRadius:n,outerRadius:r})]},rf=(nf.props={},()=>[["parallel",0,1,0,1]]),af=(rf.props={},({focusX:t=0,focusY:e=0,distortionX:n=2,distortionY:r=2,visual:i=!1})=>[["fisheye",t,e,n,r,i]]),of=(af.props={transform:!0},t=>{var{startAngle:t=-Math.PI/2,endAngle:e=3*Math.PI/2,innerRadius:n=0,outerRadius:r=1}=t;return[...rf(),...Zh({startAngle:t,endAngle:e,innerRadius:n,outerRadius:r})]}),sf=(of.props={},({value:e})=>t=>t.map(()=>e)),lf=(sf.props={},({value:e})=>t=>t.map(e)),cf=(lf.props={},({value:e})=>t=>t.map(t=>t[e])),uf=(cf.props={},({value:t})=>()=>t);function hf(t,e){return t.parent===e.parent?1:2}function ff(t,e){return t+e.x}function df(t,e){return Math.max(t,e.y)}function pf(){var s=hf,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(ff,0)/e.length,t.y=1+n.reduce(df,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 gf(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 yf(t,e){t instanceof Map?(t=[void 0,t],void 0===e&&(e=vf)):void 0===e&&(e=mf);for(var n,r,i,a,o,t=new wf(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 wf(i[a])),r.parent=n,r.depth=n.depth+1;return t.eachBefore(xf)}function mf(t){return t.children}function vf(t){return Array.isArray(t)?t[1]:null}function bf(t){void 0!==t.data.value&&(t.value=t.data.value),t.data=t.data.data}function xf(t){for(var e=0;t.height=e,(t=t.parent)&&t.height<++e;);}function wf(t){this.data=t,this.depth=this.height=0,this.parent=null}function Mf(t){return null==t?null:Of(t)}function Of(t){if("function"!=typeof t)throw new Error;return t}function kf(){return 0}function Ef(t){return function(){return t}}uf.props={},wf.prototype=yf.prototype={constructor:wf,count:function(){return this.eachAfter(gf)},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 yf(this).eachBefore(bf)},[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 Sf=4294967296;function Af(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&&Tf(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 Lf(t[0],t[1]);case 3:return Cf(t[0],t[1],t[2])}}(o=function(t,e){var n,r;if(Pf(e,t))return[e];for(n=0;n<t.length;++n)if(_f(e,t[n])&&Pf(Lf(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(_f(Lf(t[n],t[r]),e)&&_f(Lf(t[n],e),t[r])&&_f(Lf(t[r],e),t[n])&&Pf(Cf(t[n],t[r],e),t))return[t[n],t[r],e];throw new Error}(o,n)),i=0);return r}function _f(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 Tf(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 Pf(t,e){for(var n=0;n<e.length;++n)if(!Tf(t,e[n]))return;return 1}function Lf(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 Cf(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,h=i-o,f=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*h-c*f,g=(h*o-f*a)/(2*e)-r,s=(f*d-h*p)/e,l=(u*a-c*o)/(2*e)-i,n=(c*p-u*d)/e,f=s*s+n*n-1,h=2*(t+g*s+l*n),a=g*g+l*l-t*t,o=-(1e-6<Math.abs(f)?(h+Math.sqrt(h*h-4*f*a))/(2*f):a/h);return{x:r+g+s*o,y:i+l+n*o,r:o}}function Nf(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 jf(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 Rf(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 If(t){this._=t,this.next=null,this.previous=null}function Bf(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,h,f,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;Nf(r,d,i=t[2]),d=new If(d),r=new If(r),i=new If(i),((d.next=i.previous=r).next=d.previous=i).next=r.previous=d;t:for(l=3;l<a;++l){Nf(d._,r._,i=t[l]),i=new If(i),c=r.next,u=d.previous,h=r._.r,f=d._.r;do{if(h<=f){if(jf(c._,i._)){r=c,(d.next=r).previous=d,--l;continue t}h+=c._.r,c=c.next}else{if(jf(u._,i._)){((d=u).next=r).previous=d,--l;continue t}f+=u._.r,u=u.previous}}while(c!==u.next);for(i.previous=d,i.next=r,d.next=r.previous=r=i,o=Rf(d);(i=i.next)!==r;)(s=Rf(i))<o&&(d=i,o=s);r=d.next}for(d=[r._],i=r;(i=i.next)!==r;)d.push(i._);for(i=Af(d,e),l=0;l<a;++l)(d=t[l]).x-=i.x,d.y-=i.y;return i.r}function Df(t){return Math.sqrt(t.value)}function Ff(){var n=null,r=1,i=1,a=kf;function e(t){var e=function(){let t=1;return()=>(t=(1664525*t+1013904223)%Sf)/Sf}();return t.x=r/2,t.y=i/2,n?t.eachBefore(zf(n)).eachAfter(Wf(a,.5,e)).eachBefore(Gf(1)):t.eachBefore(zf(Df)).eachAfter(Wf(kf,1,e)).eachAfter(Wf(a,t.r/Math.min(r,i),e)).eachBefore(Gf(Math.min(r,i)/(2*t.r))),t}return e.radius=function(t){return arguments.length?(n=Mf(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:Ef(+t),e):a},e}function zf(e){return function(t){t.children||(t.r=Math.max(0,+e(t)||0))}}function Wf(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=Bf(e,l),a)for(n=0;n<i;++n)e[n].r-=a;t.r=r+a}}}function Gf(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 Hf(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 Yf(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 Vf={depth:-1},qf={},$f={};function Uf(t){return t.id}function Xf(t){return t.parentId}function Kf(){var y,m=Uf,v=Xf;function e(n){var e,t,r,i,a,o,s,l,c=Array.from(n),u=m,h=v,f=new Map;if(null!=y){const p=c.map((t,e)=>{t=y(t,e,n),e=(t=""+t).length;return"/"===(t=Qf(t,e-1)&&!Qf(t,e-2)?t.slice(0,-1):t)[0]?t:"/"+t}),g=p.map(Zf);var d=new Set(p).add("");for(const r of g)d.has(r)||(d.add(r),p.push(r),g.push(Zf(r)),c.push($f));u=(t,e)=>p[e],h=(t,e)=>g[e]}for(r=0,e=c.length;r<e;++r)t=c[r],o=c[r]=new wf(t),null!=(s=u(t,r,n))&&(s+="")&&(l=o.id=s,f.set(l,f.has(l)?qf:o)),null!=(s=h(t,r,n))&&(s+="")&&(o.parent=s);for(r=0;r<e;++r)if(s=(o=c[r]).parent){if(!(a=f.get(s)))throw new Error("missing: "+s);if(a===qf)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!=y){for(;i.data===$f&&1===i.children.length;)i=i.children[0],--e;for(let t=c.length-1;0<=t&&(o=c[t]).data===$f;--t)o.data=null}if(i.parent=Vf,i.eachBefore(function(t){t.depth=t.parent.depth+1,--e}).eachBefore(xf),i.parent=null,0<e)throw new Error("cycle");return i}return e.id=function(t){return arguments.length?(m=Mf(t),e):m},e.parentId=function(t){return arguments.length?(v=Mf(t),e):v},e.path=function(t){return arguments.length?(y=Mf(t),e):y},e}function Zf(t){let e=t.length;if(e<2)return"";for(;1<--e&&!Qf(t,e););return t.slice(0,e)}function Qf(e,n){if("/"===e[n]){let t=0;for(;0<n&&"\\"===e[--n];)++t;if(0==(1&t))return 1}}function Jf(t,e){return t.parent===e.parent?1:2}function td(t){var e=t.children;return e?e[0]:t.t}function ed(t){var e=t.children;return e?e[e.length-1]:t.t}function nd(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 rd(){var f=Jf,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 nd(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 nd(r[i],i)),n.parent=e;return(t.parent=new nd(null,0)).children=[t],t}(t);return s.eachAfter(h),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:f(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 h(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+f(t._,r._),t.m=t.z-e):t.z=e}else r&&(t.z=r.z+f(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,h=s.m;o=ed(o),i=td(i),o&&i;)s=td(s),(a=ed(a)).a=t,0<(r=o.z+u-i.z-l+f(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,h+=s.m,c+=a.m;o&&!ed(a)&&(a.t=o,a.m+=u-c),i&&!td(s)&&(s.t=i,s.m+=l-h,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?(f=t,e):f},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 id(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}nd.prototype=Object.create(wf.prototype);var ad=(1+Math.sqrt(5))/2;function od(t,e,n,r,i,a){for(var o,s,l,c,u,h,f,d,p,g,y,m=[],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(y=(h=f=u)*u*(g=Math.max(c/l,l/c)/(M*t)),p=Math.max(f/y,y/h);x<w;++x){if(u+=s=v[x].value,s<h&&(h=s),f<s&&(f=s),y=u*u*g,p<(d=Math.max(f/y,y/h))){u-=s;break}p=d}m.push(o={value:u,dice:l<c,children:v.slice(b,x)}),o.dice?Yf(o,n,r,i,M?r+=c*u/M:a):id(o,n,r,M?n+=l*u/M:i,a),M-=u,b=x}return m}var sd=function e(a){function t(t,e,n,r,i){od(a,t,e,n,r,i)}return t.ratio=function(t){return e(1<(t=+t)?t:1)},t}(ad);function ld(t,e,n,r,i){var a,o,g=t.children,s=g.length,y=new Array(s+1);for(y[0]=o=a=0;a<s;++a)y[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=y[e],c=r/2+l,u=e+1,h=n-1;for(;u<h;){var f=u+h>>>1;y[f]<c?u=1+f:h=f}c-y[u-1]<y[u]-c&&e+1<u&&--u;var l=y[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 cd(t,e,n,r,i){(1&t.depth?id:Yf)(t,e,n,r,i)}var ud=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,h=a.length,f=t.value;++u<h;){for(s=(o=a[u]).children,l=o.value=0,c=s.length;l<c;++l)o.value+=s[l].value;o.dice?Yf(o,e,n,r,f?n+=(i-n)*o.value/f:i):id(o,e,n,f?e+=(r-e)*o.value/f:r,i),f-=o.value}else t._squarify=a=od(d,t,e,n,r,i),a.ratio=d}return t.ratio=function(t){return e(1<(t=+t)?t:1)},t}(ad);function hd(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 fd(t={}){return[...hd(t),{name:"title",scale:"identity"}]}function dd(){return[{type:"maybeTitle",channel:"color"},{type:"maybeTooltip",channel:["x","y"]}]}function pd(){return[{type:"maybeTitle",channel:"x"},{type:"maybeTooltip",channel:["y"]}]}function gd(t={}){return hd(t)}function yd(){return[{type:"maybeKey"}]}function md(t,e){return t.getBandWidth(t.invert(e))}function vd(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:h=r,bandOffsetY:f=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?md(l,a[e]):0;var r=p?md(c,o[e]):0,e=g&&s?(md(u,s[e])/2+ +s[e])*n:0,[t,i]=t;return[t+h*n+e,i+f*r]}:t=>t}function bd(t){return parseFloat(t)/100}function xd(t,e,n,r){const{x:i,y:a}=n,{innerWidth:o,innerHeight:s}=r.getOptions();return[t,Array.from(t,t=>{var e=i[t],t=a[t];return[["string"==typeof e?bd(e)*o:+e,"string"==typeof t?bd(t)*s:+t]]})]}function wd(e){return"function"==typeof e?e:t=>t[e]}function Md(t,e){return Array.from(t,wd(e))}function Od(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=Md(t,e),o=Md(t,n),s=Md(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 kd(t,e){return t.getBandWidth(t.invert(e))}const Ed=()=>(t,e,n,i)=>{const{x:a,y:o,y1:s,series:l,size:r}=n,c=e.x,u=e.series,[h]=i.getSize(),f=r?r.map(t=>+t/h):null,d=r?(t,e,n)=>{t+=e/2,e=f[n];return[t-e/2,t+e/2]}:(t,e,n)=>[t,t+e];return[t,Array.from(t,t=>{var e=kd(c,a[t]),n=e*(u?kd(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))})]};Ed.props={defaultShape:"rect",defaultLabelShape:"label",composite:!1,channels:[...fd({shapes:["rect","hollow","funnel","pyramid"]}),{name:"x",scale:"band",required:!0},{name:"y",required:!0},{name:"series",scale:"band"},{name:"size"}],preInference:[...yd(),{type:"maybeZeroY1"},{type:"maybeZeroX"}],postInference:[...pd()],interaction:{shareTooltip:!0}};const Sd=()=>(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 Ad(t,e){return null==t||null==e?NaN:t<e?-1:e<t?1:e<=t?0:NaN}function _d(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=Ad,o=(t,e)=>Ad(n(t),e),(t,e)=>n(t)-e):(a=n===Ad||n===function(t,e){return null==t||null==e?NaN:e<t?-1:t<e?1:t<=e?0:NaN}?n:Td,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 Td(){return 0}function Pd(t){return null===t?NaN:+t}Sd.props={defaultShape:"rect",defaultLabelShape:"label",composite:!1,channels:[...fd({shapes:["rect","hollow"]}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...yd(),{type:"maybeZeroY1"}],postInference:[...pd()],interaction:{shareTooltip:!0}};xo=_d(Ad);const Ld=xo.right,Cd=xo.left,Nd=_d(Pd).center;function jd(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 Rd(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 Id(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 Bd{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 Dd 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(Fd(this,t))}has(t){return super.has(Fd(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 Fd({_intern:t,_key:e},n){e=e(n);return t.has(e)?t.get(e):n}function zd(t){return t}function Wd(t,...e){return Vd(t,zd,zd,e)}function Gd(t,...e){return Vd(t,Array.from,zd,e)}function Hd(t,e,...n){return Vd(t,zd,e,n)}function Yd(t,e,...n){return Vd(t,Array.from,e,n)}function Vd(t,u,h,f){return function t(e,n){if(n>=f.length)return h(e);var r=new Dd,i=f[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 qd(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=Ud(r[t],r[e]);if(n)return n}})):(n=e.map(n),t.sort((t,e)=>Ud(n[t],n[e]))),r=e,Array.from(t,t=>r[t])):e.sort($d(n))}function $d(r=Ad){if(r===Ad)return Ud;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 Ud(t,e){return(null==t||!(t<=t))-(null==e||!(e<=e))||(t<e?-1:e<t?1:0)}var Xd=Array.prototype.slice;function Kd(t){return()=>t}const Zd=Math.sqrt(50),Qd=Math.sqrt(10),Jd=Math.sqrt(2);function tp(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>=Zd?10:r>=Qd?5:r>=Jd?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?tp(t,e,2*n):[a,o,s]}function ep(t,e,n){return tp(t=+t,e=+e,n=+n)[2]}function np(t){return Math.max(1,Math.ceil(Math.log(jd(t))/Math.LN2)+1)}function rp(){var m=zd,v=Id,b=np;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]=m(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===Id&&([s,l]=function(t,e,n){let r;for(;;){var i=ep(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?tp(e,t,n):tp(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=ep(s,l,u)),c[c.length-1]>=l)if(l<=o&&v===Id){const n=ep(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 h=c.length,f=0,d=h;c[f]<=s;)++f;for(;c[d-1]>l;)--d;(f||d<h)&&(c=c.slice(f,d),h=d-f);var p,g,y=new Array(h+1);for(a=0;a<=h;++a)(p=y[a]=[]).x0=0<a?c[a-1]:s,p.x1=a<h?c[a]:l;if(isFinite(n)){if(0<n)for(a=0;a<r;++a)null!=(e=i[a])&&s<=e&&e<=l&&y[Math.min(h,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),y[Math.min(h,g+(c[g]<=e))].push(t[a]))}else for(a=0;a<r;++a)null!=(e=i[a])&&s<=e&&e<=l&&y[Ld(c,e,0,h)].push(t[a]);return y}return e.value=function(t){return arguments.length?(m="function"==typeof t?t:Kd(t),e):m},e.domain=function(t){return arguments.length?(v="function"==typeof t?t:Kd([t[0],t[1]]),e):v},e.thresholds=function(t){return arguments.length?(b="function"==typeof t?t:Kd(Array.isArray(t)?Xd.call(t):t),e):b},e}function ip(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 ap(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 op(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 sp(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 lp(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?Ud:$d(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),lp(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,h=n[r];let t=i,e=a;for(cp(n,i,r),0<o(n[a],h)&&cp(n,i,a);t<e;){for(cp(n,t,e),++t,--e;o(n[t],h)<0;)++t;for(;0<o(n[e],h);)--e}0===o(n[i],h)?cp(n,i,e):cp(n,++e,a),e<=r&&(i=e+1),r<=e&&(a=e-1)}return n}function cp(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function up(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?op(t):1<=e?ip(t):(n=(n-1)*e,(r=ip(lp(t,e=Math.floor(n)).subarray(0,e+1)))+(op(t.subarray(e+1))-r)*(n-e))}function hp(n,t,r=Pd){var i,e,a;if(!isNaN(t=+t))return i=Float64Array.from(n,(t,e)=>Pd(r(n[e],e,n))),t<=0?sp(i):1<=t?ap(i):(e=Uint32Array.from(n,(t,e)=>e),a=i.length-1,lp(e,t=Math.floor(a*t),0,a,(t,e)=>Ud(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<Ad(a,t):0===Ad(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 fp(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 dp(t,e){return up(t,.5,e)}function pp(t){return Array.from(function*(t){for(const e of t)yield*e}(t))}function gp(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 yp(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 mp(t){t=t.getOptions().transformations;return t.map(([t])=>t).filter(t=>"transpose"===t).length%2!=0}function vp(t){t=t.getOptions().transformations;return t.some(([t])=>"polar"===t)}function bp(t){t=t.getOptions().transformations;return t.some(([t])=>"reflect"===t)&&t.some(([t])=>t.startsWith("transpose"))}function xp(t){t=t.getOptions().transformations;return t.some(([t])=>"helix"===t)}function wp(t){t=t.getOptions().transformations;return t.some(([t])=>"parallel"===t)}function Mp(t){t=t.getOptions().transformations;return t.some(([t])=>"fisheye"===t)}function Op(t){return xp(t)||vp(t)}function kp(t){var t=t.getOptions()["transformations"],[,,,t,e]=t.find(t=>"polar"===t[0]);return[+t,+e]}function Ep(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 Sp=(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(Wd(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]},Ap=(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})]},_p=()=>(t,e,n,r)=>{return(wp(r)?Ap:Sp)(t,e,n,r)};_p.props={defaultShape:"line",defaultLabelShape:"label",composite:!1,channels:[...fd({shapes:["line","smooth"]}),{name:"x"},{name:"y"},{name:"position",independent:!0},{name:"size"},{name:"series",scale:"identity"}],preInference:[...yd(),{type:"maybeGradient"},{type:"maybeSeries"}],postInference:[...pd(),{type:"maybeTitle",channel:"color"},{type:"maybeTooltip",channel:["position"]}],interaction:{shareTooltip:!0,seriesTooltip:!0,crosshairs:!0}};const Tp=g=>(t,e,n,o)=>{const{x:r,y:i,x1:a,y1:s,size:l,dx:c,dy:u}=n,[h,f]=o.getSize(),d=vd(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/h,r=r/f,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))])]};Tp.props={defaultShape:"hollow",defaultLabelShape:"label",composite:!1,channels:[...fd({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:[...yd(),{type:"maybeZeroY"},{type:"maybeZeroX"}],postInference:[{type:"maybeSize"},...dd()]};const Pp=s=>{var{cartesian:t=!1}=s;return t?xd:(t,e,n,r)=>{const{x:i,y:a}=n,o=vd(e,n,s);return[t,Array.from(t,t=>{var e=[+i[t],+a[t]];return[r.map(o(e,t))]})]}};Pp.props={defaultShape:"text",defaultLabelShape:"label",composite:!1,channels:[...fd({shapes:["text","badge"]}),{name:"x",required:!0},{name:"y",required:!0},{name:"text",scale:"identity"},{name:"fontSize"},{name:"rotate"}],preInference:[...yd(),{type:"maybeTuple"},{type:"maybeVisualPosition"}],postInference:[...dd()]};const Lp=()=>(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))})]};Lp.props={defaultShape:"cell",defaultLabelShape:"label",composite:!1,channels:[...fd({shapes:["cell","hollow"]}),{name:"x",required:!0,scale:"band"},{name:"y",required:!0,scale:"band"}],preInference:[...yd(),{type:"maybeZeroX"},{type:"maybeZeroY"},{type:"maybeZeroPadding"}],postInference:[...dd()]};const Cp=()=>(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(Wd(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,h=((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]+h]),r[n+t]=a.map([+o[i]+u,+l[i]+h])}return r}),t]};Cp.props={defaultShape:"area",defaultLabelShape:"label",composite:!1,channels:[...fd({shapes:["area","smooth","hvh","hv","vh"]}),{name:"x",required:!0},{name:"y",required:!0},{name:"size"},{name:"series",scale:"identity"}],preInference:[...yd(),{type:"maybeSeries"},{type:"maybeZeroY1"},{type:"maybeZeroPadding"}],postInference:[...pd()],interaction:{shareTooltip:!0,seriesTooltip:!0,crosshairs:!0}};const Np=c=>(t,e,n,r)=>{const{x:i,y:a,x1:o=i,y1:s=a}=n,l=vd(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]};Np.props={defaultShape:"link",defaultLabelShape:"label",composite:!1,channels:[...fd({shapes:["link","arc","vhv","smooth"]}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...yd(),{type:"maybeIdentityY"},{type:"maybeIdentityX"}],postInference:[...dd()]};const jp=s=>{var t=s["cartesian"];return t?xd:(t,e,n,r)=>{const{x:i,y:a}=n,o=vd(e,n,s);return[t,Array.from(t,t=>{var e=[+i[t],+a[t]];return[r.map(o(e,t))]})]}};jp.props={defaultShape:"image",defaultLabelShape:"label",composite:!1,channels:[...fd({shapes:["image"]}),{name:"x",required:!0},{name:"y",required:!0},{name:"src",scale:"identity"},{name:"size"}],preInference:[...yd(),{type:"maybeTuple"},{type:"maybeVisualPosition"}],postInference:[...dd()]};const Rp=()=>(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]};Rp.props={defaultShape:"polygon",defaultLabelShape:"label",composite:!1,channels:[...fd({shapes:["polygon","ribbon"]}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...yd()],postInference:[...dd()]};const Ip=()=>(t,e,n,s)=>{const{x:l,y:c,y1:u,y2:h,y3:f,y4:d,series:p}=n,g=e.x,y=e.series;return[t,Array.from(t,t=>{var e=g.getBandWidth(g.invert(+l[t])),n=e*(y?y.getBandWidth(y.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],+h[t],+f[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))})]},Bp=(Ip.props={defaultShape:"box",defaultLabelShape:"label",composite:!1,channels:[...fd({shapes:["box"]}),{name:"x",scale:"band",required:!0},{name:"y",required:!0},{name:"series",scale:"band"}],preInference:[...yd(),{type:"maybeZeroX"}],postInference:[...pd()],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]});Bp.props={defaultShape:"vector",defaultLabelShape:"label",composite:!1,channels:[...fd({shapes:["vector"]}),{name:"x",required:!0},{name:"y",required:!0},{name:"rotate",required:!0,scale:"identity"},{name:"size",required:!0}],preInference:[...yd()],postInference:[...dd()]};const Dp=()=>(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))})]};Dp.props={defaultShape:"line",defaultLabelShape:"label",composite:!1,channels:[...gd({shapes:["line"]}),{name:"y",required:!0}],preInference:[...yd(),{type:"maybeTupleY"}],postInference:[]};const Fp=()=>(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))})]};Fp.props={defaultShape:"line",defaultLabelShape:"label",composite:!1,channels:[...gd({shapes:["line"]}),{name:"x",required:!0}],preInference:[...yd(),{type:"maybeTupleX"}],postInference:[]};const zp=(...t)=>Np(...t);function Wp(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 Gp(t={}){const{extendX:r=!1,extendY:s=!1}=t;return(t,e,n,i)=>{const a=Wp("x",r,n,e.x),o=Wp("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))})]}}zp.props={defaultShape:"connector",defaultLabelShape:"label",composite:!1,channels:[...gd({shapes:["connector"]}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...yd()],postInference:[]};const Hp=()=>Gp();Hp.props={defaultShape:"range",defaultLabelShape:"label",composite:!1,channels:[...gd({shapes:["range"]}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...yd()],postInference:[]};const Yp=()=>Gp({extendY:!0});Yp.props={defaultShape:"range",defaultLabelShape:"label",composite:!1,channels:[...gd({shapes:["range"]}),{name:"x",required:!0}],preInference:[...yd()],postInference:[]};const Vp=()=>Gp({extendX:!0});function qp(t){return t.target.depth}function $p(t,e){return t.sourceLinks.length?t.depth:e-1}function Up(t){return function(){return t}}function Xp(t,e){return Zp(t.source,e.source)||t.index-e.index}function Kp(t,e){return Zp(t.target,e.target)||t.index-e.index}function Zp(t,e){return t.y0-e.y0}function Qp(t){return t.value}function Jp(t){return t.index}function t0(t){return t.nodes}function e0(t){return t.links}function n0(t,e){t=t.get(e);if(t)return t;throw new Error("missing: "+e)}function r0({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 i0(){let x=0,w=0,M=1,O=1,k=24,E=8,S,A=Jp,_=$p,T,P,L,C=t0,N=e0,j=6;function e(e){e={nodes:C(e),links:N(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=>[A(t),t]));if(t.forEach((t,e)=>{t.index=e;let{source:n,target:r}=t;"object"!=typeof n&&(n=t.source=n0(g,n)),"object"!=typeof r&&(r=t.target=n0(g,r)),n.sourceLinks.push(t),r.targetLinks.push(t)}),null!=L)for(var{sourceLinks:n,targetLinks:r}of i)n.sort(L),r.sort(L)}t=e.nodes;for(const y of t)y.value=void 0===y.fixedValue?Math.max(yp(y.sourceLinks,Qp),yp(y.targetLinks,Qp)):y.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(T){var s,l=Math.max(ip(a,t=>t.depth)+1,0);for(let t=0;t<a.length;t++)(s=a[t]).depth=T.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(ip(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(_.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(P)for(const o of r)o.sort(P);return r}(e),t=(S=Math.min(E,(O-w)/(ip(u,t=>t.length)-1)),u),h=op(t,t=>(O-w-(t.length-1)*S)/yp(t,Qp));for(const m of t){let e=w;for(const v of m){v.y0=e,v.y1=e+v.value*h,e=v.y1+S;for(const b of v.sourceLinks)b.width=b.value*h}e=(O-e+S)/(m.length+1);for(let t=0;t<m.length;++t){var f=m[t];f.y0+=e*(t+1),f.y1+=e*(t+1)}!function(t){if(void 0===L)for(var{sourceLinks:e,targetLinks:n}of t)e.sort(Kp),n.sort(Xp)}(m)}for(let t=0;t<j;++t){var d=Math.pow(.99,t),p=Math.max(1-d,(t+1)/j);!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)*S/2;for(var{source:r,width:i}of e.targetLinks){if(r===t)break;n+=i+S}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===P&&o.sort(Zp),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)*S/2;for(var{target:r,width:i}of t.sourceLinks){if(r===e)break;n+=i+S}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===P&&o.sort(Zp),o.length&&R(o,i)}}(u,d,p)}return r0(e),e}function R(t,e){var n=t.length>>1,r=t[n];a(t,r.y0-S,n-1,e),i(t,r.y1+S,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+S}}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-S}}function I({sourceLinks:t,targetLinks:e}){if(void 0===L){for(const{source:{sourceLinks:t}}of e)t.sort(Kp);for(const{target:{targetLinks:e}}of t)e.sort(Xp)}}return e.update=function(t){return r0(t),t},e.nodeId=function(t){return arguments.length?(A="function"==typeof t?t:Up(t),e):A},e.nodeAlign=function(t){return arguments.length?(_="function"==typeof t?t:Up(t),e):_},e.nodeDepth=function(t){return arguments.length?(T=t,e):T},e.nodeSort=function(t){return arguments.length?(P=t,e):P},e.nodeWidth=function(t){return arguments.length?(k=+t,e):k},e.nodePadding=function(t){return arguments.length?(E=S=+t,e):E},e.nodes=function(t){return arguments.length?(C="function"==typeof t?t:Up(t),e):C},e.links=function(t){return arguments.length?(N="function"==typeof t?t:Up(t),e):N},e.linkSort=function(t){return arguments.length?(L=t,e):L},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?(j=+t,e):j},e}Vp.props={defaultShape:"range",defaultLabelShape:"label",composite:!1,channels:[...gd({shapes:["range"]}),{name:"y",required:!0}],preInference:[...yd()],postInference:[]};const a0={nodeAlign:"justify",nodeWidth:.008,nodePadding:.03,nodes:t=>t.nodes,links:t=>t.links,nodeSort:void 0,linkSort:void 0,iterations:6},o0={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?op(t.sourceLinks,qp)-1:0},justify:$p};const s0=h=>t=>{var{nodeId:e,nodeSort:n,nodeAlign:r,nodeWidth:i,nodePadding:a,nodeDepth:o,nodes:s,links:l,linkSort:c,iterations:u}=Object.assign({},a0,h),l=i0().nodeSort(n).linkSort(c).links(l).nodes(s).nodeWidth(i).nodePadding(a).nodeDepth(o).nodeAlign("string"==(c=typeof(n=r))?o0[n]||$p:"function"==c?n:$p).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 l0(t){return t}function c0(t){return t.reduce((n,r)=>(t,...e)=>r(n(t,...e),...e),l0)}function u0(t){return t.replace(/( |^)[a-z]/g,t=>t.toUpperCase())}function h0(t=""){throw new Error(t)}function f0(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 d0(t){return null!=t&&!Number.isNaN(t)}function at(t,e){return p0(t,e)||{}}function p0(t,n){t=Object.entries(t||{}).filter(([t])=>t.startsWith(n)).map(([t,e])=>[Ge(t.replace(n,"").trim()),e]).filter(([t])=>!!t);return 0===t.length?null:Object.fromEntries(t)}function g0(t,...n){return Object.fromEntries(Object.entries(t).filter(([e])=>n.every(t=>!e.startsWith(t))))}function y0(t,e){return void 0===t?null:"number"==typeof t?t:(t=+t.replace("%",""),Number.isNaN(t)?null:t/100*e)}function m0(t){return!("object"!=typeof t||t instanceof Date||null===t||Array.isArray(t))}function v0(t){return null===t||!1===t}function b0(t,e,n={},r=!1){return v0(t)||Array.isArray(t)&&r?t:(r=at(t,e),ot(n,r))}function x0(t,e={}){return!v0(t)&&!Array.isArray(t)&&w0(t)?ot(e,t):t}function w0(t){var e;return 0===Object.keys(t).length||({title:t,items:e}=t,void 0!==t)||void 0!==e}function M0(t,e){return"object"==typeof t?at(t,e):t}s0.props={};const O0={nodeId:t=>t.key,nodeWidth:.02,nodePadding:.02},k0={type:"polygon",axis:!1,legend:!1,encode:{shape:"polygon",x:"x",y:"y"},scale:{x:{type:"identity"},y:{type:"identity"}},style:{stroke:"#000"}},E0={type:"polygon",axis:!1,legend:!1,encode:{shape:"ribbon",x:"x",y:"y"},style:{fillOpacity:.5,stroke:void 0}},S0={textAlign:t=>t.x[0]<.5?"start":"end",position:t=>t.x[0]<.5?"right":"left",fontSize:10},A0=t=>{var{data:t,encode:e={},scale:n,style:r={},layout:i={},nodeLabels:a=[],linkLabels:o=[],animate:s={},tooltip:l={}}=t,{links:t,nodes:c}=Od(t,e),u=at(e,"node"),e=at(e,"link"),{key:h=t=>t.key,color:f=h}=u,{links:i,nodes:t}=s0(Object.assign(Object.assign(Object.assign({},O0),{nodeId:wd(h)}),i))({links:t,nodes:c});const d=at(r,"label"),{text:p=h,spacing:g=5}=d,y=it(d,["text","spacing"]),m=wd(h);c=b0(l,"node",{title:m,items:[{field:"value"}]},!0),h=b0(l,"link",{title:"",items:[t=>({name:"source",value:m(t.source)}),t=>({name:"target",value:m(t.target)})]});return[ot({},k0,{data:t,encode:Object.assign(Object.assign({},u),{color:f}),scale:n,style:at(r,"node"),labels:[Object.assign(Object.assign(Object.assign({},S0),{text:p,dx:t=>t.x[0]<.5?g:-g}),y),...a],tooltip:c,animate:M0(s,"node"),axis:!1}),ot({},E0,{data:i,encode:e,labels:o,style:Object.assign({fill:e.color?void 0:"#aaa",strokeWidth:0},at(r,"link")),tooltip:h,animate:M0(s,"link")})]},_0=(A0.props={},t=>(t,e,n,r)=>[t,t.map(()=>[[0,0]])]);function T0(t,e,n){const r=n["value"];var o,i,a,s,l,c,u,h,f,d,n=function(t,e){var n={treemapBinary:ld,treemapDice:Yf,treemapSlice:id,treemapSliceDice:cd,treemapSquarify:sd,treemapResquarify:ud};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?Kf().path(p):Kf():yf)(t));function g(t){return t.x0=t.y0=0,t.x1=a,t.y1=s,t.eachBefore(y),l=[0],i&&t.eachBefore(Hf),t}function y(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-=h(t)-e)<n&&(n=i=(n+i)/2),(a-=f(t)-e)<r&&(r=a=(r+a)/2),o(t,n,r,i,a))}return r?p.sum(t=>e.ignoreParentValue&&t.children?0:wd(r)(t)).sort(e.sort):p.count(),o=sd,i=!1,s=a=1,l=[0],d=f=h=u=c=kf,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=Of(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:Ef(+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:Ef(+t),g):u},g.paddingRight=function(t){return arguments.length?(h="function"==typeof t?t:Ef(+t),g):h},g.paddingBottom=function(t){return arguments.length?(f="function"==typeof t?t:Ef(+t),g):f},g.paddingLeft=function(t){return arguments.length?(d="function"==typeof t?t:Ef(+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)}_0.props={defaultShape:"path",defaultLabelShape:"label",composite:!1,channels:[...fd({shapes:["path","hollow"]}),{name:"d",scale:"identity"}],preInference:[...yd()],postInference:[]};const P0={fontSize:10,text:t=>t.data.name,position:"inside",fill:"#000",textOverflow:"clip",wordWrap:!0,maxLines:1,wordWrapWidth:t=>t.x1-t.x0},L0={title:t=>t.data.name,items:[{field:"value"}]},C0=(t,e)=>{var{width:e,height:n}=e,{data:r,encode:i={},scale:a,style:o={},layout:s={},labels:l=[],tooltip:c={}}=t,t=it(t,["data","encode","scale","style","layout","labels","tooltip"]),r=T0(r,ot({},(r=e,u=n,{tile:"treemapSquarify",ratio:.5*(1+Math.sqrt(5)),size:[r,u],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}),s),i),u=at(o,"label");return ot({},{type:"rect",axis:!1,encode:{x:"x",y:"y",color:t=>t.data.parent.name},scale:{x:{domain:[0,e],range:[0,1]},y:{domain:[0,n],range:[0,1]}},style:{stroke:"#fff"}},Object.assign(Object.assign({data:r,encode:i,scale:a,style:o,labels:[Object.assign(Object.assign({},P0),u),...l]},t),{tooltip:x0(c,L0),axis:!1}))},N0=(C0.props={},{text:"",position:"inside",textOverflow:"clip",wordWrap:!0,maxLines:1,wordWrapWidth:t=>2*t.r}),j0={title:t=>t.data.name,items:[{field:"value"}]},R0=(t,e)=>{var{width:e,height:n}=e,{data:r,encode:i={},scale:a={},style:o={},layout:s={},labels:l=[],tooltip:c={}}=t,t=it(t,["data","encode","scale","style","layout","labels","tooltip"]),u={type:"point",axis:!1,legend:!1,scale:{x:{domain:[0,e]},y:{domain:[0,n]},size:{type:"identity"}},encode:{x:"x",y:"y",size:"r",shape:"point"},style:{fill:i.color?void 0:t=>0===t.height?"#ddd":"#fff",stroke:i.color?void 0:t=>0===t.height?"":"#000"}},r=((t,e,n)=>{const r=n["value"];n=(Te(t)?Kf().path(e.path):yf)(t);return r?n.sum(t=>wd(r)(t)).sort(e.sort):n.count(),Ff().size(e.size).padding(e.padding)(n),n.descendants()})(r,ot({},{size:[e,n],padding:0,sort:(t,e)=>e.value-t.value},s),ot({},u.encode,i)),e=at(o,"label");return ot({},u,Object.assign(Object.assign({data:r,encode:i,scale:a,style:o,labels:[Object.assign(Object.assign({},N0),e),...l]},t),{tooltip:x0(c,j0),axis:!1}))};function I0(t,e){return op(t,t=>e[t])}function B0(t,e){return ip(t,t=>e[t])}function D0(t,e){const n=2.5*F0(t,e)-1.5*W0(t,e);return op(t,t=>e[t]>=n?e[t]:NaN)}function F0(t,e){return up(t,.25,t=>e[t])}function z0(t,e){return up(t,.5,t=>e[t])}function W0(t,e){return up(t,.75,t=>e[t])}function G0(t,e){const n=2.5*W0(t,e)-1.5*F0(t,e);return ip(t,t=>e[t]<=n?e[t]:NaN)}function H0(){return(t,e)=>{var n=e["encode"],{y:n,x:r}=n;const i=n["value"],a=r["value"];return[Array.from(Wd(t,t=>a[+t]).values()).flatMap(t=>{const e=D0(t,i),n=G0(t,i);return t.filter(t=>i[t]<e||i[t]>n)}),e]}}R0.props={};const Y0=t=>{var e,{data:n,encode:r,style:i={},tooltip:a={},animate:o}=t,t=it(t,["data","encode","style","tooltip","transform","animate"]),{point:s=!0}=i,i=it(i,["point"]),l=r["y"],l={y:l,y1:l,y2:l,y3:l,y4:l},c={y1:F0,y2:z0,y3:W0},u=b0(a,"box",{items:[{channel:"y",name:"min"},{channel:"y1",name:"q1"},{channel:"y2",name:"q2"},{channel:"y3",name:"q3"},{channel:"y4",name:"max"}]},!0),a=b0(a,"point",{title:{channel:"x"},items:[{name:"outlier",channel:"y"}]});return s?(s=at(i,"box"),e=at(i,"point"),[Object.assign({type:"box",data:n,transform:[Object.assign(Object.assign({type:"groupX",y:D0},c),{y4:G0})],encode:Object.assign(Object.assign({},r),l),style:s,tooltip:u,animate:M0(o,"box")},t),{type:"point",data:n,transform:[{type:H0}],encode:r,style:Object.assign({},e),tooltip:a,animate:M0(o,"point")}]):Object.assign({type:"box",data:n,transform:[Object.assign(Object.assign({type:"groupX",y:I0},c),{y4:B0})],encode:Object.assign(Object.assign({},r),l),style:i,tooltip:u},t)},V0=(Y0.props={},s=>{var t=s["cartesian"];return t?xd:(t,e,n,r)=>{const{x:i,y:a}=n,o=vd(e,n,s);return[t,Array.from(t,t=>{var e=[+i[t],+a[t]];return[r.map(o(e,t))]})]}});function q0(t,e,n,r){if(!isNaN(e)&&!isNaN(n)){var i,a,o,s,l,c,u,h,f,d=t._root,p={data:r},g=t._x0,y=t._y0,m=t._x1,v=t._y1;if(d){for(;d.length;)if((c=e>=(a=(g+m)/2))?g=a:m=a,(u=n>=(o=(y+v)/2))?y=o:v=o,!(d=(i=d)[h=u<<1|c]))return i[h]=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[h]=p:t._root=p;else{for(;i=i?i[h]=new Array(4):t._root=new Array(4),(c=e>=(a=(g+m)/2))?g=a:m=a,(u=n>=(o=(y+v)/2))?y=o:v=o,(h=u<<1|c)==(f=(o<=l)<<1|a<=s););i[f]=d,i[h]=p}}else t._root=p}return t}function $0(t,e,n,r,i){this.node=t,this.x0=e,this.y0=n,this.x1=r,this.y1=i}function U0(t){return t[0]}function X0(t){return t[1]}function K0(t,e,n){e=new Z0(null==e?U0:e,null==n?X0:n,NaN,NaN,NaN,NaN);return null==t?e:e.addAll(t)}function Z0(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 Q0(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}V0.props={defaultShape:"shape",defaultLabelShape:"label",composite:!1,channels:[{name:"x",required:!0},{name:"y",required:!0}],preInference:[...yd(),{type:"maybeTuple"},{type:"maybeVisualPosition"},{type:"maybeFunctionAttribute"}]};Eo=K0.prototype=Z0.prototype;function J0(t){return function(){return t}}function tg(t){return 1e-6*(t()-.5)}function eg(t){return t.index}function ng(t,e){t=t.get(e);if(t)return t;throw new Error("node not found: "+e)}function rg(c){var u,h,a,o,f,d,s=eg,n=function(t){return 1/Math.min(o[t.source.index],o[t.target.index])},r=J0(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||tg(d),o=i.y+i.vy-r.y-r.vy||tg(d),a*=s=((s=Math.sqrt(a*a+o*o))-h[l])/s*t*u[l],o*=s,i.vx-=a*(s=f[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=ng(r,t.source)),"object"!=typeof t.target&&(t.target=ng(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,f=new Array(n);i<n;++i)t=c[i],f[i]=o[t.source.index]/(o[t.source.index]+o[t.target.index]);u=new Array(n),l(),h=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)h[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:J0(+t),l(),e):n},e.distance=function(t){return arguments.length?(r="function"==typeof t?t:J0(+t),g(),e):r},e}Eo.copy=function(){var t,e,n=new Z0(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]=Q0(e));else n._root=Q0(r);return n},Eo.add=function(t){var e=+this._x.call(null,t),n=+this._y.call(null,t);return q0(this.cover(e,n),e,n,t)},Eo.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)q0(this,i[u],a[u],t[u]);return this},Eo.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},Eo.data=function(){var e=[];return this.visit(function(t){if(!t.length)for(;e.push(t.data),t=t.next;);}),e},Eo.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]]},Eo.find=function(t,e,n){var r,i,a,o,s,l,c,u,h=this._x0,f=this._y0,d=this._x1,p=this._y1,g=[],y=this._root;for(y&&g.push(new $0(y,h,f,d,p)),null==n?n=1/0:(h=t-n,f=e-n,d=t+n,p=e+n,n*=n);r=g.pop();)!(y=r.node)||(s=r.x0)>d||(l=r.y0)>p||(o=r.x1)<h||(i=r.y1)<f||(y.length?(g.push(new $0(y[3],a=(s+o)/2,c=(l+i)/2,o,i),new $0(y[2],s,c,a,i),new $0(y[1],a,l,o,c),new $0(y[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,y.data))*o+(s=e-+this._y.call(null,y.data))*s)<n&&(h=t-(c=Math.sqrt(n=l)),f=e-c,d=t+c,p=e+c,u=y.data));return u},Eo.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,h,f=this._root,d=this._x0,p=this._y0,g=this._x1,y=this._y1;if(f){if(f.length)for(;;){if((l=a>=(s=(d+g)/2))?d=s:g=s,(c=o>=(s=(p+y)/2))?p=s:y=s,!(f=(e=f)[u=c<<1|l]))return this;if(!f.length)break;(e[u+1&3]||e[u+2&3]||e[u+3&3])&&(n=e,h=u)}for(;f.data!==t;)if(!(f=(r=f).next))return this;(i=f.next)&&delete f.next,r?i?r.next=i:delete r.next:e?(i?e[u]=i:delete e[u],(f=e[0]||e[1]||e[2]||e[3])&&f===(e[3]||e[2]||e[1]||e[0])&&!f.length&&(n?n[h]=f:this._root=f)):this._root=i}}return this},Eo.removeAll=function(t){for(var e=0,n=t.length;e<n;++e)this.remove(t[e]);return this},Eo.root=function(){return this._root},Eo.size=function(){var e=0;return this.visit(function(t){if(!t.length)for(;++e,t=t.next;);}),e},Eo.visit=function(t){var e,n,r,i,a,o,s,l=[],c=this._root;for(c&&l.push(new $0(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 $0(e,o,s,i,a)),(e=c[2])&&l.push(new $0(e,n,s,o,a)),(e=c[1])&&l.push(new $0(e,o,r,i,s)),e=c[0])&&l.push(new $0(e,n,r,o,s));return this},Eo.visitAfter=function(t){var e,n=[],r=[];for(this._root&&n.push(new $0(this._root,this._x0,this._y0,this._x1,this._y1));e=n.pop();){var i,a,o,s,l,c,u,h=e.node;h.length&&(a=e.x0,o=e.y0,c=(a+(s=e.x1))/2,u=(o+(l=e.y1))/2,(i=h[0])&&n.push(new $0(i,a,o,c,u)),(i=h[1])&&n.push(new $0(i,c,o,s,u)),(i=h[2])&&n.push(new $0(i,a,u,c,l)),i=h[3])&&n.push(new $0(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},Eo.x=function(t){return arguments.length?(this._x=t,this):this._x},Eo.y=function(t){return arguments.length?(this._y=t,this):this._y};var ig={value:()=>{}};function ag(){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 og(r)}function og(t){this._=t}function sg(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=ig,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=n&&t.push({name:e,value:n}),t}og.prototype=ag.prototype={constructor:og,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]=sg(i[n],t.name,e);else if(null==e)for(n in i)i[n]=sg(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 og(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 lg,cg,ug=0,hg=0,fg=0,dg=1e3,pg=0,gg=0,yg=0,mg="object"==typeof performance&&performance.now?performance:Date,vg="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function bg(){return gg||(vg(xg),gg=mg.now()+yg)}function xg(){gg=0}function wg(){this._call=this._time=this._next=null}function Mg(t,e,n){var r=new wg;return r.restart(t,e,n),r}function Og(){gg=(pg=mg.now())+yg,ug=hg=0;try{bg(),++ug;for(var t,e=lg;e;)0<=(t=gg-e._time)&&e._call.call(void 0,t),e=e._next;--ug}finally{for(var n,r,i=lg,a=1/(ug=0);i;)i=i._call?(a>i._time&&(a=i._time),(n=i)._next):(r=i._next,i._next=null,n?n._next=r:lg=r);cg=n,Eg(a),gg=0}}function kg(){var t=mg.now(),e=t-pg;dg<e&&(yg-=e,pg=t)}function Eg(t){ug||(hg=hg&&clearTimeout(hg),24<t-gg?(t<1/0&&(hg=setTimeout(Og,t-mg.now()-yg)),fg=fg&&clearInterval(fg)):(fg||(pg=mg.now(),fg=setInterval(kg,dg)),ug=1,vg(Og)))}wg.prototype=Mg.prototype={constructor:wg,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?bg():+n)+(null==e?0:+e),this._next||cg===this||(cg?cg._next=this:lg=this,cg=this),this._call=t,this._time=n,Eg()},stop:function(){this._call&&(this._call=null,this._time=1/0,Eg())}};const Sg=4294967296;function Ag(t){return t.x}function _g(t){return t.y}var Tg=10,Pg=Math.PI*(3-Math.sqrt(5));function Lg(l){var a,o=1,e=.001,s=1-Math.pow(e,1/300),c=0,u=.6,h=new Map,t=Mg(i),n=ag("tick","end"),r=function(){let t=1;return()=>(t=(1664525*t+1013904223)%Sg)/Sg}();function i(){f(),n.call("tick",a),o<e&&(t.stop(),n.call("end",a))}function f(t){var e,n,r=l.length;void 0===t&&(t=1);for(var i=0;i<t;++i)for(o+=(c-o)*s,h.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=Tg*Math.sqrt(.5+r),e=r*Pg,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:f,restart:function(){return t.restart(i),a},stop:function(){return t.stop(),a},nodes:function(t){return arguments.length?(l=t,d(),h.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,h.forEach(p),a):r},force:function(t,e){return 1<arguments.length?(null==e?h.delete(t):h.set(t,p(e)),a):h.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)}}}const Cg={joint:!0},Ng={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}},jg={type:"point",axis:!1,legend:!1,encode:{x:"x",y:"y",size:5,color:"group",shape:"point"},scale:{color:{type:"ordinal"}},style:{stroke:"#fff"}},Rg={text:""};function Ig(t,e,n){var i,l,c,u,h,r,f,d,p,{nodes:t,links:a}=t,{joint:e,nodeStrength:o,linkStrength:s}=e,{linkKey:n=t=>t.id}=n,I=(r=J0(-30),d=(f=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:J0(+t),B(),g):r},g.distanceMin=function(t){return arguments.length?(f=t*t,g):Math.sqrt(f)},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=K0(i,Ag,_g).visitAfter(D);for(u=t,e=0;e<n;++e)l=i[e],r.visit(F)}function B(){if(i){var t,e,n=i.length;for(h=new Array(n),t=0;t<n;++t)e=i[t],h[e.index]=+r(e,t,i)}}function D(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+=h[e.data.index],e=e.next;);t.value=o}function F(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=tg(c))*i),0===a&&(s+=(a=tg(c))*a),s<f&&(s=Math.sqrt(f*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=tg(c))*i),0===a&&(s+=(a=tg(c))*a),s<f)&&(s=Math.sqrt(f*s));t.data!==l&&(o=h[t.data.index]*u/s,l.vx+=i*o,l.vy+=a*o),t=t.next;);}var y,m,v,b,x,w,M,O,k,E,S,A,_,T,n=rg(a).id(wd(n)),P=("function"==typeof o&&I.strength(o),"function"==typeof s&&n.strength(s),Lg(t).force("link",n).force("charge",I));function L(t){for(var e,n=0,r=m.length;n<r;++n)(e=m[n]).vy+=(b[n]-e.y)*v[n]*t}function C(){if(m){var t,e=m.length;for(v=new Array(e),b=new Array(e),t=0;t<e;++t)v[t]=isNaN(b[t]=+y(m[t],t,m))?0:+x(m[t],t,m)}}function N(t){for(var e,n=0,r=M.length;n<r;++n)(e=M[n]).vx+=(k[n]-e.x)*O[n]*t}function j(){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:+E(M[t],t,M)}}function R(){for(var t,e=_.length,n=0,r=0,i=0;i<e;++i)n+=(t=_[i]).x,r+=t.y;for(n=(n/e-S)*T,r=(r/e-A)*T,i=0;i<e;++i)(t=_[i]).x-=n,t.y-=r}e?P.force("center",(T=1,null==S&&(S=0),null==A&&(A=0),R.initialize=function(t){_=t},R.x=function(t){return arguments.length?(S=+t,R):S},R.y=function(t){return arguments.length?(A=+t,R):A},R.strength=function(t){return arguments.length?(T=+t,R):T},R)):P.force("x",(E=J0(.1),"function"!=typeof w&&(w=J0(null==w?0:+w)),N.initialize=function(t){M=t,j()},N.strength=function(t){return arguments.length?(E="function"==typeof t?t:J0(+t),j(),N):E},N.x=function(t){return arguments.length?(w="function"==typeof t?t:J0(+t),j(),N):w},N)).force("y",(x=J0(.1),"function"!=typeof y&&(y=J0(null==y?0:+y)),L.initialize=function(t){m=t,C()},L.strength=function(t){return arguments.length?(x="function"==typeof t?t:J0(+t),C(),L):x},L.y=function(t){return arguments.length?(y="function"==typeof t?t:J0(+t),C(),L):y},L)),P.stop();var z=Math.ceil(Math.log(P.alphaMin())/Math.log(1-P.alphaDecay()));for(let t=0;t<z;t++)P.tick();return{nodesData:t,linksData:a}}const Bg=t=>{var{data:t,encode:e={},scale:n,style:r={},layout:i={},nodeLabels:a=[],linkLabels:o=[],animate:s={},tooltip:l={}}=t;const{nodeKey:c=t=>t.id,linkKey:u=t=>t.id}=e,h=it(e,["nodeKey","linkKey"]);var e=Object.assign({nodeKey:c,linkKey:u},h),f=at(e,"node"),d=at(e,"link"),{links:t,nodes:p}=Od(t,e),{nodesData:t,linksData:p}=Ig({links:t,nodes:p},ot({},Cg,i),e),i=b0(l,"link",{items:[t=>({name:"source",value:wd(u)(t.source)}),t=>({name:"target",value:wd(u)(t.target)})]}),e=b0(l,"node",{items:[t=>({name:"key",value:wd(c)(t)})]},!0);return[ot({},Ng,{data:p,encode:d,labels:o,style:at(r,"link"),tooltip:i,animate:M0(s,"link")}),ot({},jg,{data:t,encode:Object.assign({},f),scale:n,style:at(r,"node"),tooltip:e,labels:[Object.assign(Object.assign({},Rg),at(r,"label")),...a],animate:M0(s,"link")})]},Dg=(Bg.props={},h=>u=>t=>{const{field:e="value",nodeSize:n,separation:r,sortBy:i,as:a=["x","y"]}=u,[o,s]=a;var t=yf(t,t=>t.children).sum(t=>t[e]).sort(i),l=h();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}}),Fg=t=>Dg(pf)(t),zg=(Fg.props={},t=>Dg(rd)(t)),Wg=(zg.props={},{sortBy:(t,e)=>e.value-t.value}),Gg={axis:!1,legend:!1,type:"point",encode:{x:"x",y:"y",size:2,shape:"point"}},Hg={type:"link",encode:{x:"x",y:"y",shape:"smooth"}},Yg={text:"",fontSize:10},Vg=t=>{var{data:t,encode:e={},scale:n={},style:r={},layout:i={},nodeLabels:a=[],linkLabels:o=[],animate:s={},tooltip:l={}}=t,c=null==e?void 0:e.value,{nodes:i,edges:c}=zg(Object.assign(Object.assign(Object.assign({},Wg),i),{field:c}))(t),t=b0(l,"node",{title:"name",items:["value"]},!0),l=b0(l,"link",{title:"",items:[t=>({name:"source",value:t.source.name}),t=>({name:"target",value:t.target.name})]});return[ot({},Hg,{data:c,encode:at(e,"link"),scale:at(n,"link"),labels:o,style:Object.assign({stroke:"#999"},at(r,"link")),tooltip:l,animate:M0(s,"link")}),ot({},Gg,{data:i,scale:at(n,"node"),encode:at(e,"node"),labels:[Object.assign(Object.assign({},Yg),at(r,"label")),...a],style:Object.assign({},at(r,"node")),tooltip:t,animate:M0(s,"node")})]};Vg.props={};var qg={},$g={},Ug=34,Xg=10,Kg=13;function Zg(t){return new Function("d","return {"+t.map(function(t,e){return JSON.stringify(t)+": d["+e+'] || ""'}).join(",")+"}")}function Qg(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 Jg(t,e){var t=t+"",n=t.length;return n<e?new Array(e-n+1).join(0)+t:t}function t1(t){var e,n=t.getUTCHours(),r=t.getUTCMinutes(),i=t.getUTCSeconds(),a=t.getUTCMilliseconds();return isNaN(t)?"Invalid Date":((e=t.getUTCFullYear())<0?"-"+Jg(-e,6):9999<e?"+"+Jg(e,6):Jg(e,4))+"-"+Jg(t.getUTCMonth()+1,2)+"-"+Jg(t.getUTCDate(),2)+(a?"T"+Jg(n,2)+":"+Jg(r,2)+":"+Jg(i,2)+"."+Jg(a,3)+"Z":i?"T"+Jg(n,2)+":"+Jg(r,2)+":"+Jg(i,2)+"Z":r||n?"T"+Jg(n,2)+":"+Jg(r,2)+"Z":"")}function e1(r){var e=new RegExp('["'+r+"\n\r]"),h=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 $g;if(l)return l=!1,qg;var t,e,n=a;if(r.charCodeAt(n)===Ug){for(;a++<i&&r.charCodeAt(a)!==Ug||r.charCodeAt(++a)===Ug;);return(t=a)>=i?s=!0:(e=r.charCodeAt(a++))===Xg?l=!0:e===Kg&&(l=!0,r.charCodeAt(a)===Xg)&&++a,r.slice(n+1,t-1).replace(/""/g,'"')}for(;a<i;){if((e=r.charCodeAt(t=a++))===Xg)l=!0;else if(e===Kg)l=!0,r.charCodeAt(a)===Xg&&++a;else if(e!==h)continue;return r.slice(n,t)}return s=!0,r.slice(n,i)}for(r.charCodeAt(i-1)===Xg&&--i,r.charCodeAt(i-1)===Kg&&--i;(e=c())!==$g;){for(var u=[];e!==qg&&e!==$g;)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?t1(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=Zg(n=t),function(t,e){return r(i(t),e,n)}):Zg(t)})).columns=s||[],t},parseRows:n,format:function(t,e){return[(e=null==e?Qg(t):e).map(o).join(r)].concat(i(t,e)).join("\n")},formatBody:function(t,e){return i(t,e=null==e?Qg(t):e).join("\n")},formatRows:function(t){return t.map(a).join("\n")},formatRow:a,formatValue:o}}function n1(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;r1&&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 r1=new Date("2019-01-01T00:00").getHours()||new Date("2019-07-01T00:00").getHours(),i1=t=>{const{value:n,format:r=n.split(".").pop(),delimiter:i=",",autoType:a=!0}=t;return()=>X(void 0,void 0,void 0,function*(){var t,e=yield fetch(n);if("csv"===r)return t=yield e.text(),e1(i).parse(t,a?n1:l0);if("json"===r)return yield e.json();throw new Error(`Unknown format: ${r}.`)})};i1.props={};const a1=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}};a1.props={};const o1=t=>{const{callback:e=function(t){return null!=t&&!Number.isNaN(t)}}=t;return t=>t.filter(e)},s1=(o1.props={},t=>{const e=t["callback"];return t=>Array.isArray(t)?[...t].sort(e):t});s1.props={};const l1=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})};l1.props={};const c1=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};c1.props={};const u1=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))}},h1=(u1.props={},t=>{const e=t["value"];return()=>e}),f1=(h1.props={},t=>{const{callback:e=l0}=t;return t=>e(t)}),d1=(f1.props={},t=>{const{callback:e=l0}=t;return t=>Array.isArray(t)?t.map(e):t});d1.props={};var p1=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 g1={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 y1(t){const{y:c,thickness:u,weight:h,marginRatio:f,id:d,source:p,target:g,sourceWeight:y,targetWeight:m,sortBy:v}=Object.assign(Object.assign({},g1),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=y(t),t.targetWeight=m(t)});const i=Wd(r,t=>t.source),a=Wd(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=yp(e,t=>t.sourceWeight)+yp(n,t=>t.targetWeight)})}if(r=e,(n="function"==typeof v?v:p1[v])&&r.sort(n),!(n=(r=e).length))throw h0("Invalid nodes: it's empty!");if(h){const o=f/(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-f),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(!h)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=Wd(e,t=>t.source),l=Wd(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 m1=e=>t=>y1(e)(t),v1=(m1.props={},Math.PI/180),b1=64,x1=2048;function w1(t){return t.text}function M1(){return"serif"}function O1(){return"normal"}function k1(t){return t.value}function E1(){return 90*~~(2*Math.random())}function S1(){return 1}function A1(){}function _1(t,o,r,s){if(!o.sprite){var l=t.context,c=t.ratio;l.clearRect(0,0,(b1<<5)/c,x1/c);let i=0,a=0,n=0;var u,h,f,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*v1),f=Math.cos(o.rotate*v1),u=t*f,h=t*d,f=e*f,d=e*d,t=Math.max(Math.abs(u+d),Math.abs(u-d))+31>>5<<5,e=~~Math.max(Math.abs(h+f),Math.abs(h-f))):t=t+31>>5<<5,e>n&&(n=e),i+t>=b1<<5&&(i=0,a+=n,n=0),a+e>=x1)break;l.translate((i+(t>>1))/c,(a+(e>>1))/c),o.rotate&&l.rotate(o.rotate*v1),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,(b1<<5)/c,x1/c).data,g=[];0<=--s;)if((o=r[s]).hasText){var y=o.width,m=y>>5;let n=o.y1-o.y0;for(let t=0;t<n*m;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<y;t++){var v=m*e+(t>>5),b=p[(a+e)*(b1<<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)*m)}}}function T1(t){const e=t[0]/t[1];return function(t){return[e*(t*=.1)*Math.cos(t),t*Math.sin(t)]}}function P1(t){var e=[];let n=-1;for(;++n<t;)e[n]=0;return e}function L1(){return document.createElement("canvas")}function C1(t){return"function"==typeof t?t:function(){return t}}const N1={archimedean:T1,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 j1(){let b=[256,256],r=w1,i=M1,p=k1,g=O1,y=E1,m=S1,x=T1,w=Math.random,v=A1,M=[],O=null,k=1/0;const E=O1,S=L1,A={};return A.start=function(){const[a,o]=b,s=((t=S()).width=t.height=1,e=Math.sqrt(t.getContext("2d").getImageData(0,0,1,1).data.length>>2),t.width=(b1<<5)/e,t.height=x1/e,(t=t.getContext("2d")).fillStyle=t.strokeStyle="red",t.textAlign="center",{context:t,ratio:e}),l=A.board||P1((b[0]>>5)*b[1]),c=M.length,u=[],h=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=E.call(this,t,e,n),t.weight=g.call(this,t,e,n),t.rotate=y.call(this,t,e,n),t.size=~~p.call(this,t,e,n),t.padding=m.call(this,t,e,n),t}).sort(function(t,e){return e.size-t.size});var t,e;let f=-1,d=A.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&&++f<c;){var i=h[f];i.x=a*(w()+.5)>>1,i.y=o*(w()+.5)>>1,_1(s,i,h,f),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,h;for(;(l=o(c+=s))&&(u=~~l[0],h=~~l[1],!(Math.min(Math.abs(u),Math.abs(h))>=a));)if(t.x=n+u,t.y=r+h,!(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 f=t.sprite,d=t.width>>5,p=b[0]>>5,g=t.x-(d<<4),y=127&g,m=32-y,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<<m|(t<d?(n=f[e*d+t])>>>y:0);r+=p}return delete t.sprite,1}return}(l,i,d)&&(v.call(null,"word",{cloud:A,word:i}),u.push(i),d?A.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)}A._tags=u,A._bounds=d,f>=c&&(A.stop(),v.call(null,"end",{cloud:A,words:u,bounds:d}))}return O&&clearInterval(O),O=setInterval(n,0),n(),A},A.stop=function(){return O&&(clearInterval(O),O=null),A},A.createMask=t=>{var e=document.createElement("canvas"),[n,r]=b;if(n&&r){var i=n>>5,a=P1((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}A.board=a,A.hasImage=!0}},A.timeInterval=function(t){k=null==t?1/0:t},A.words=function(t){M=t},A.size=function(t=[]){b=[+t[0],+t[1]]},A.text=function(t){r=C1(t)},A.font=function(t){i=C1(t)},A.fontWeight=function(t){g=C1(t)},A.rotate=function(t){y=C1(t)},A.spiral=function(t){x=N1[t]||t},A.fontSize=function(t){p=C1(t)},A.padding=function(t){m=C1(t)},A.random=function(t){w=C1(t)},A.on=function(t){v=C1(t)},A}const R1={size:[500,500],fontSize:[14,28]};function I1(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 B1=f=>h=>X(void 0,void 0,void 0,function*(){var i,a,t=Object.assign({},R1,f),e=j1(),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 X(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=h.map(t=>t.value),n=t,t=[op(e),ip(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",I1,e.createMask),e.words([...h]),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=it(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 D1(e){return"string"==typeof e?t=>t[e]:e}B1.props={};const F1=t=>{const{join:e,on:n,select:i=[],as:a=i,unknown:o=NaN}=t;var[t,r]=n;const s=D1(r),l=D1(t),c=Hd(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),{}))})},z1=(F1.props={},t=>{const{start:e,end:n}=t;return t=>t.slice(e,n)});z1.props={};var W1,G1,H1,Y1,Do={exports:{}},ki={exports:{}};function V1(t){return 1-Math.abs(t)}W1=(i=ki).exports,i.exports.isNumber=function(t){return"number"==typeof t},i.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},i.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},i.exports.findMinMulti=function(t){for(var e=W1.findMin(t[0]),n=1;n<t.length;n++)e=Math.min(e,W1.findMin(t[n]));return e},i.exports.findMaxMulti=function(t){for(var e=W1.findMax(t[0]),n=1;n<t.length;n++)e=Math.max(e,W1.findMax(t[n]));return e},i.exports.inside=function(t,e,n){return t<=n&&n<=e},Ds=Do,G1=Math.log(2),H1=Ds.exports,Y1=ki.exports,Ds.exports.getUnifiedMinMax=function(t,e){return H1.getUnifiedMinMaxMulti([t],e)},Ds.exports.getUnifiedMinMaxMulti=function(t,e){var n=!1,r=!1,i=Y1.isNumber((e=e||{}).width)?e.width:2,a=Y1.isNumber(e.size)?e.size:50,o=Y1.isNumber(e.min)?e.min:(n=!0,Y1.findMinMulti(t)),e=Y1.isNumber(e.max)?e.max:(r=!0,Y1.findMaxMulti(t)),t=(e-o)/(a-1);return n&&(o-=2*i*t),r&&(e+=2*i*t),{min:o,max:e}},Ds.exports.create=function(t,e){if(!t||0===t.length)return[];var n=Y1.isNumber((e=e||{}).size)?e.size:50,o=Y1.isNumber(e.width)?e.width:2,e=H1.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}(V1,o),h=u[o],f=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=h/(h-i-a),0<r&&(d+=i*(r-1)*f),a=Math.max(0,t-o+1),Y1.inside(0,c.length-1,a)&&(c[a].y+=i*f),Y1.inside(0,c.length-1,e+1)&&(c[e+1].y-=2*i*f),Y1.inside(0,c.length-1,n+1)&&(c[n+1].y+=i*f))}),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},Ds.exports.getExpectedValueFromPdf=function(t){var e;if(t&&0!==t.length)return e=0,t.forEach(function(t){e+=t.x*t.y}),e},Ds.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}},Ds.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/G1,Math.pow(2,n)};var q1=Do.exports;const $1=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(Wd(t,e=>n.map(t=>e[t]).join("-")).values()).map(t=>{var e=q1.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})})}};$1.props={};var U1={exports:{}};function X1(t){for(var e=new Array(t),n=0;n<t;++n)e[n]=0;return e}function K1(t,e){for(var n=0,r=0;r<t.length;++r)n+=t[r]*e[r];return n}function Z1(t){return Math.sqrt(K1(t,t))}function Q1(t,e,n){for(var r=0;r<e.length;++r)t[r]=e[r]*n}function J1(t,e,n,r,i){for(var a=0;a<t.length;++a)t[a]=e*n[a]+r*i[a]}function ty(i,a,o,s,l,c,u){var h=o.fx,f=K1(o.fxprime,a),d=h,t=h,p=f,e=0;function n(t,e,n){for(var r=0;r<16;++r)if(l=(t+e)/2,J1(s.x,1,o.x,l,a),d=s.fx=i(s.x,s.fxprime),p=K1(s.fxprime,a),h+c*l*f<d||n<=d)e=l;else{if(Math.abs(p)<=-u*f)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(J1(s.x,1,o.x,l,a),d=s.fx=i(s.x,s.fxprime),p=K1(s.fxprime,a),h+c*l*f<d||r&&t<=d)return n(e,l,t);if(Math.abs(p)<=-u*f)return l;if(0<=p)return n(l,e,d);t=d,e=l,l*=2}return l}(Mo=Mo=U1.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},Mo.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,h=void 0!==n.psi?n.psi:-.5,f=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 y=e.slice();y[g]=y[g]?y[g]*a:o,p[g+1]=y,p[g+1].fx=t(y),p[g+1].id=g+1}function m(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&&((E=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:E})),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 E=p[d];if(J1(x,1+c,b,-c,E),x.fx=t(x),x.fx<p[0].fx)J1(M,1+u,b,-u,E),M.fx=t(M),M.fx<x.fx?m(M):m(x);else if(x.fx>=p[d-1].fx){var S=!1;if(x.fx>E.fx?(J1(w,1+h,b,-h,E),w.fx=t(w),w.fx<E.fx?m(w):S=!0):(J1(w,1-h*c,b,h*c,E),w.fx=t(w),w.fx<x.fx?m(w):S=!0),S){if(1<=f)break;for(g=1;g<p.length;++g)J1(p[g],1-f,p[0],f,p[g]),p[g].fx=t(p[g])}}else m(x)}return p.sort(v),{fx:p[0].fx,x:p[0]}},Mo.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),Q1(r=a.fxprime.slice(),a.fxprime,-1);for(var c=0;c<i;++c){var u;if(l=ty(t,r,a,o,l),n.history&&n.history.push({x:a.x.slice(),fx:a.fx,fxprime:a.fxprime.slice(),alpha:l}),l?(J1(s,1,o.fxprime,-1,a.fxprime),u=K1(a.fxprime,a.fxprime),u=Math.max(0,K1(s,o.fxprime)/u),J1(r,u,r,-1,o.fxprime),u=a,a=o,o=u):Q1(r,a.fxprime,-1),Z1(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},Mo.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()}),J1(a.x,1,a.x,-i,a.fxprime),!(Z1(a.fxprime)<=1e-5));++o);return a},Mo.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,h=[];{var f;n.history&&(f=t,t=function(t,e){return h.push(t.slice()),f(t,e)})}i.fx=t(i.x,i.fxprime);for(var d=0;d<o&&(Q1(l,i.fxprime,-1),s=ty(t,l,i,a,s,c,u),n.history&&(n.history.push({x:i.x.slice(),fx:i.fx,fxprime:i.fxprime.slice(),functionCalls:h,learnRate:s,alpha:s}),h=[]),r=i,i=a,a=r,!(0===s||Z1(i.fxprime)<1e-5));++d);return i},Mo.zeros=X1,Mo.zerosM=function(t,e){return X1(t).map(function(){return X1(e)})},Mo.norm2=Z1,Mo.weightedSum=J1,Mo.scale=Q1;const ey=1e-10;function ny(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=oy(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(iy(e,n[t])>n[t].radius+ey)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 h=n[l],f=(s+=(i.x+h.x)*(h.y-i.y),{x:(h.x+i.x)/2,y:(h.y+i.y)/2});let r=null;for(let n=0;n<h.parentIndex.length;++n)if(-1<i.parentIndex.indexOf(h.parentIndex[n])){var d=a[h.parentIndex[n]],p=Math.atan2(h.x-d.x,h.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=iy(f,{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:h,p2:i})}null!==r&&(c.push(r),o+=ry(r.circle.radius,r.width),i=h)}}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(iy(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-ey,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 ry(t,e){return t*t*Math.acos(1-e/t)-(t-e)*Math.sqrt(e*(2*t-e))}function iy(t,e){return Math.sqrt((t.x-e.x)*(t.x-e.x)+(t.y-e.y)*(t.y-e.y))}function ay(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),ry(t,t-(n*n-e*e+t*t)/(2*n))+ry(e,r))}function oy(t,e){var n,r,i=iy(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 sy(t,e){(e=e||{}).maxIterations=e.maxIterations||500;var n=e.initialLayout||uy;const i=e.lossFunction||hy,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=U1.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 ly=1e-10;function cy(e,n,r){return Math.min(e,n)*Math.min(e,n)*Math.PI<=r+ly?Math.abs(e-n):U1.exports.bisect(function(t){return ay(e,n,t)-r},0,e+n)}function uy(t,e){let n=function(r,t){const i=t&&t.lossFunction?t.lossFunction:hy,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+ly>=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 h(t,e){return e.size-t.size}u.sort(h);const f={};function d(t){return t.set in f}function p(t,e){a[e].x=t.x,a[e].y=t.y,f[e]=!0}p({x:0,y:0},u[0].set);for(let t=1;t<u.length;++t){var g=u[t].set,y=o[g].filter(d);if(s=a[g],y.sort(h),0===y.length)throw"ERROR: missing pairwise overlap information";var m=[];for(let e=0;e<y.length;++e){var v=a[y[e].set],b=cy(s.radius,v.radius,y[e].size);m.push({x:v.x+b,y:v.y}),m.push({x:v.x-b,y:v.y}),m.push({y:v.y+b,x:v.x}),m.push({y:v.y-b,x:v.x});for(let t=e+1;t<y.length;++t){var x=a[y[t].set],w=cy(s.radius,x.radius,y[t].size),M=oy({x:v.x,y:v.y,radius:b},{x:x.x,y:x.y,radius:w});for(let t=0;t<M.length;++t)m.push(M[t])}}let e=1e50,n=m[0];for(let t=0;t<m.length;++t){a[g].x=m[t].x,a[g].y=m[t].y;var O=i(a,r);O<e&&(e=O,n=m[t])}p(n,g)}return a}(t,e);var r=e.lossFunction||hy;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=U1.exports.zerosM(a.length,a.length),l=U1.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=cy(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 y=s.distances;function l(t,r){{var i=t,a=r,o=y,s=m;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],h=i[2*t+1],f=o[n][t],d=s[n][t],p=(u-l)*(u-l)+(h-c)*(h-c),g=Math.sqrt(p),p=p-f*f;0<d&&g<=f||d<0&&f<=g||(e+=2*p*p,a[2*n]+=4*p*(l-u),a[2*n+1]+=4*p*(c-h),a[2*t]+=4*p*(u-l),a[2*t+1]+=4*p*(h-c))}}return e}}const m=s.constraints,c=U1.exports.norm2(y.map(U1.exports.norm2))/y.length;y=y.map(function(t){return t.map(function(t){return t/c})});let u,h;for(a=0;a<n;++a){var f=U1.exports.zeros(2*y.length).map(Math.random);h=U1.exports.conjugateGradient(l,f,e),(!u||h.fx<u.fx)&&(u=h)}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)U1.exports.scale(e.history[a].x,c);return p}(t,e),t)+1e-8<r(n,t)?e:n}function hy(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]],ay(o.radius,a.radius,iy(o,a))):ny(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 fy(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 dy=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=sy(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=fy(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),h=(e-(o.max-o.min)*u)/2,f=(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+h+(p.x-o.min)*u,y:r+f+(p.y-s.min)*u}}return d}(i,t,e,o);let n=function(t){var e={},n=(ny(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}})})}};dy.props={};const py=(l,c)=>X(void 0,void 0,void 0,function*(){var{width:t,height:e}=c,{data:n,encode:r={},scale:i,style:a={},layout:o={}}=l,s=it(l,["data","encode","scale","style","layout"]),n=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),o=yield B1(Object.assign(Object.assign({},{size:[t,e]}),o))(n);return ot({},{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"}},Object.assign(Object.assign({data:o,encode:r,scale:i,style:a},s),{axis:!1}))});function gy(t,...e){return e.reduce((e,n)=>t=>e(n(t)),t)}function yy(e,n){return n-e?t=>(t-e)/(n-e):t=>.5}function my(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}py.props={};const vy=Math.sqrt(50),by=Math.sqrt(10),xy=Math.sqrt(2);function wy(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>=vy?10:n>=by?5:n>=xy?2:1)*10**t:-(10**-t)/(n>=vy?10:n>=by?5:n>=xy?2:1)}function My(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>=vy?r*=10:n>=by?r*=5:n>=xy&&(r*=2),e<t?-r:r}const Oy=(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=wy(a,o,n))?(a=Math.floor(a/s)*s,o=Math.ceil(o/s)*s,s=wy(a,o,n)):s<0&&(a=Math.ceil(a*s)/s,o=Math.floor(o*s)/s,s=wy(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},ky=36e5,Ey=864e5,Sy=7*Ey;Ey,Ey;function Ay(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}}qs=Ay(1,t=>t,(t,e=1)=>{t.setTime(+t+e)},t=>t.getTime()),Ao=Ay(1e3,t=>{t.setMilliseconds(0)},(t,e=1)=>{t.setTime(+t+1e3*e)},t=>t.getSeconds()),To=Ay(6e4,t=>{t.setSeconds(0,0)},(t,e=1)=>{t.setTime(+t+6e4*e)},t=>t.getMinutes()),jo=Ay(ky,t=>{t.setMinutes(0,0,0)},(t,e=1)=>{t.setTime(+t+ky*e)},t=>t.getHours()),zo=Ay(Ey,t=>{t.setHours(0,0,0,0)},(t,e=1)=>{t.setTime(+t+Ey*e)},t=>t.getDate()-1);const _y=Ay(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());Go=Ay(Sy,t=>{t.setDate(t.getDate()-t.getDay()%7),t.setHours(0,0,0,0)},(t,e=1)=>{t.setTime(+t+Sy*e)},t=>{var e=_y.floor(t),t=new Date(+t);return Math.floor((+t-+e)/Sy)}),Yo=Ay(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 Ty={millisecond:qs,second:Ao,minute:To,hour:jo,day:zo,week:Go,month:_y,year:Yo};qo=Ay(1,t=>t,(t,e=1)=>{t.setTime(+t+e)},t=>t.getTime()),Xo=Ay(1e3,t=>{t.setUTCMilliseconds(0)},(t,e=1)=>{t.setTime(+t+1e3*e)},t=>t.getUTCSeconds()),Zo=Ay(6e4,t=>{t.setUTCSeconds(0,0)},(t,e=1)=>{t.setTime(+t+6e4*e)},t=>t.getUTCMinutes()),Jo=Ay(ky,t=>{t.setUTCMinutes(0,0,0)},(t,e=1)=>{t.setTime(+t+ky*e)},t=>t.getUTCHours()),bs=Ay(Ey,t=>{t.setUTCHours(0,0,0,0)},(t,e=1)=>{t.setTime(+t+Ey*e)},t=>t.getUTCDate()-1);const Py=Ay(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());Ns=Ay(Sy,t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7)%7),t.setUTCHours(0,0,0,0)},(t,e=1)=>{t.setTime(+t+Sy*e)},t=>{var e=Py.floor(t),t=new Date(+t);return Math.floor((+t-+e)/Sy)}),js=Ay(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 Ly={millisecond:qo,second:Xo,minute:Zo,hour:Jo,day:bs,week:Ns,month:Py,year:js};function Cy(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?Ly:Ty;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=my(i,l,0,c,s);let h;return h=u===c?[a,My(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(My(t,e,n),1)]}const Ny=(t,e,n,r,i)=>{var a=e<t,o=a?e:t,t=a?t:e,[e,n]=Cy(o,t,n,r,i),r=[e.floor(o,n),e.ceil(t,n)];return a?r.reverse():r};function jy(t){return null!==t&&"function"!=typeof t&&isFinite(t.length)}function Ry(t){return Dy(t,"Function")}function Iy(t){return null==t}var By={}.toString,Dy=function(t,e){return By.call(t)==="[object "+e+"]"},Fy=function(t){return Array.isArray?Array.isArray(t):Dy(t,"Array")};var zy=function(t){if("object"!=typeof(e=t)||null===e||!Dy(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},Wy=function(t){return Dy(t,"Number")},Gy=Object.values?function(t){return Object.values(t)}:function(n){var t,r=[],e=n,i=function(t,e){Ry(n)&&"prototype"===e||r.push(t)};if(e)if(Fy(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},Hy=5;function Yy(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||Hy,n){var o;n.hasOwnProperty(a)&&(null!==(o=n[a])&&zy(o)?(zy(e[a])||(e[a]={}),r<i?t(e[a],o,r+1,i):e[a]=n[a]):Fy(o)?(e[a]=[],e[a]=e[a].concat(o)):void 0!==o&&(e[a]=o))}}(t,e[r]);return t}function Vy(t){return t}var qy,$y=function(t,e){if(!jy(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 Uy(t){return Iy(t)?0:(jy(t)?t:Object.keys(t)).length}function Xy(t){return null!=t&&!Number.isNaN(t)}!function(a,o){var s;if(Ry(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(qy=qy||document.createElement("canvas").getContext("2d")).font=[a,e,i,n+"px",r].join(" "),qy.measureText(Dy(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],Gy(e=void 0===e?{}:e)).join("")});const Ky=e=>t=>-e(-t),Zy=(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?Ky(t):t},Qy=(e,t)=>{var n=e===Math.E?Math.exp:t=>e**t;return t?Ky(n):n},Jy=(t,e,n,r)=>{var i=t<0,a=Zy(r,i),r=Qy(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 tm(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 Wy(t)?Math.round(t):t}):i;this.output=gy(a,r,e,t)},t.prototype.invert=void 0}}var em,Io={exports:{}},zs={exports:{}},nm=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))},rm=Array.prototype.concat,im=Array.prototype.slice,am=zs.exports=function(t){for(var e=[],n=0,r=t.length;n<r;n++){var i=t[n];nm(i)?e=rm.call(e,im.call(i)):e.push(i)}return e},om=(am.wrap=function(t){return function(){return t(am(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]}),sm=zs.exports,lm=Object.hasOwnProperty,cm=Object.create(null);for(em in om)lm.call(om,em)&&(cm[om[em]]=em);var um=Io.exports={to:{},get:{}};function hm(t,e,n){return Math.min(Math.max(e,t),n)}function fm(t){t=Math.round(t).toString(16).toUpperCase();return t.length<2?"0"+t:t}um.get=function(t){var e,n;switch(t.substring(0,3).toLowerCase()){case"hsl":e=um.get.hsl(t),n="hsl";break;case"hwb":e=um.get.hwb(t),n="hwb";break;default:e=um.get.rgb(t),n="rgb"}return e?{model:n,value:e}:null},um.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]:lm.call(om,e[1])?((i=om[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]=hm(i[n],0,255);return i[3]=hm(i[3],0,1),i},um.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,hm(parseFloat(t[2]),0,100),hm(parseFloat(t[3]),0,100),hm(isNaN(e)?1:e,0,1)]):null},um.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,hm(parseFloat(t[2]),0,100),hm(parseFloat(t[3]),0,100),hm(isNaN(e)?1:e,0,1)]):null},um.to.hex=function(){var t=sm(arguments);return"#"+fm(t[0])+fm(t[1])+fm(t[2])+(t[3]<1?fm(Math.round(255*t[3])):"")},um.to.rgb=function(){var t=sm(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]+")"},um.to.rgb.percent=function(){var t=sm(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]+")"},um.to.hsl=function(){var t=sm(arguments);return t.length<4||1===t[3]?"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)":"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+t[3]+")"},um.to.hwb=function(){var t=sm(arguments),e="";return 4<=t.length&&1!==t[3]&&(e=", "+t[3]),"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+e+")"},um.to.keyword=function(t){return cm[t.slice(0,3)]};var dm=Io.exports;function pm(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 gm(t){var e,n,r,t=dm.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*pm(n=2*r-(r=r<.5?r*(1+n):r+n-r*n),r,e+1/3),255*pm(n,r,e),255*pm(n,r,e-1/3),t]):null):null}const ym=(e,n)=>t=>e*(1-t)+n*t,mm=(t,e)=>{if("number"==typeof t&&"number"==typeof e)return ym(t,e);if("string"!=typeof t||"string"!=typeof e)return()=>t;{var n=t,r=e;const l=gm(n),c=gm(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})`}}},vm=(t,e)=>{const n=ym(t,e);return t=>Math.round(n(t))};function bm({map:t,initKey:e},n){e=e(n);return t.has(e)?t.get(e):n}function xm(t){return"object"==typeof t?t.valueOf():t}class wm extends Map{constructor(t){if(super(),this.map=new Map,this.initKey=xm,null!==t)for(var[e,n]of t)this.set(e,n)}get(t){return super.get(bm({map:this.map,initKey:this.initKey},t))}has(t){return super.has(bm({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 Mm{constructor(t){this.options=Yy({},this.getDefaultOptions()),this.update(t)}getOptions(){return this.options}update(t={}){this.options=Yy({},this.options,t),this.rescale(t)}rescale(t){}}const Om=Symbol("defaultUnknown");function km(e,n,r){for(let t=0;t<n.length;t+=1)e.has(n[t])||e.set(r(n[t]),t)}function Em(t){var{value:t,from:e,to:n,mapper:r,notFoundReturn:i}=t;let a=r.get(t);if(void 0===a){if(i!==Om)return i;a=e.push(t)-1,r.set(t,a)}return n[a%n.length]}function Sm(t){return t instanceof Date?t=>""+t:"object"==typeof t?t=>JSON.stringify(t):t=>t}class Am extends Mm{getDefaultOptions(){return{domain:[],range:[],unknown:Om}}constructor(t){super(t)}map(t){return 0===this.domainIndexMap.size&&km(this.domainIndexMap,this.getDomain(),this.domainKey),Em({value:this.domainKey(t),mapper:this.domainIndexMap,from:this.getDomain(),to:this.getRange(),notFoundReturn:this.options.unknown})}invert(t){return 0===this.rangeIndexMap.size&&km(this.rangeIndexMap,this.getRange(),this.rangeKey),Em({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=Sm(e),this.rangeKey=Sm(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 Am(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 _m(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,h=u/(2/l*r+1-1/l*i);const f=h*i/l;h-=l*f;const d=function(t){const e=Math.min(...t);return t.map(t=>t/e)}(c),p=h/d.reduce((t,e)=>t+e);var c=new wm(e.map((t,e)=>{e=d[e]*p;return[t,o?Math.floor(e):e]})),g=new wm(e.map((t,e)=>{e=d[e]*p+f;return[t,o?Math.floor(e):e]})),h=Array.from(g.values()).reduce((t,e)=>t+e),t=t+(u-(h-h/l*i))*s;let y=o?Math.round(t):t;var m=new Array(l);for(let t=0;t<l;t+=1){m[t]=(v=y,Math.round(1e12*v)/1e12);var v=e[t];y+=g.get(v)}return{valueBandWidth:c,valueStep:g,adjustedRange:m}}class Tm extends Am{getDefaultOptions(){return{domain:[],range:[0,1],align:.5,round:!1,paddingInner:0,paddingOuter:0,padding:0,unknown:Om,flex:[]}}constructor(t){super(t)}clone(){return new Tm(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 _m(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 Pm=(t,e,n)=>{let r,i,a=t,o=e;if(a===o&&0<n)return[a];let s=wy(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 Lm extends Mm{getDefaultOptions(){return{range:[0],domain:[0,1],unknown:void 0,tickCount:5,tickMethod:Pm}}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 Wy(e)&&Wy(r)?t(e,r,n):[]}clone(){return new Lm(this.options)}}function Cm(t){return Math.abs(t)<1e-15?t:parseFloat(t.toFixed(15))}const Nm=[1,5,2,2.5,4,3],jm=100*Number.EPSILON;const Rm=(n,r,t=5,i=!0,a=Nm,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,h,f,d,p,g={score:-2,lmin:0,lmax:0,lstep:0};let y=1;for(;y<1/0;){for(let t=0;t<a.length;t+=1){var m=a[t],v=(h=m,f=a,d=y,p=void 0,p=Uy(f),1-$y(f,h)/(p-1)-d+1);if(o[0]*v+o[1]+o[2]+o[3]<g.score){y=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)/y/m;let t=Math.ceil(Math.log10(x));for(;t<1/0;){var w=y*m*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)*y-(e-1)*y,k=Math.ceil(n/w)*y;if(O<=k){var E=k-O;for(let t=0;t<=E;t+=1){var S=(O+t)*(w/y),A=S+w*(e-1),_=w,T=function(t,e,n,r,i,a){var o=Uy(e),e=$y(e,t);let s=0;return t=(r%a+a)%a,1-e/(o-1)-n+(s=(t<jm||a-t<jm)&&r<=0&&0<=i?1:s)}(m,a,y,S,A,_),P=1-.5*((r-A)**2+(n-S)**2)/(.1*(r-n))**2,L=(l=e,L=n,l=(l-1)/(A-(C=S)),c=((c=s)-1)/(Math.max(A,r)-Math.min(L,C)),2-Math.max(l/c,c/l)),C=o[0]*T+o[1]*P+o[2]*L+ +o[3];g.score<C&&(!i||S<=n&&r<=A)&&(g.lmin=S,g.lmax=A,g.lstep=_,g.score=C)}}t+=1}e+=1}}y+=1}var t=Cm(g.lmax),e=Cm(g.lmin),N=Cm(g.lstep),j=Math.floor((t=(t-e)/N,Math.round(1e12*t)/1e12))+1,R=new Array(j);R[0]=Cm(e);for(let t=1;t<j;t+=1)R[t]=Cm(R[t-1]+N);return R};class Im extends Mm{getDefaultOptions(){return{domain:[0,1],range:[0,1],tickCount:5,unknown:void 0,tickMethod:Rm}}map(t){return Xy(t)?t:this.options.unknown}invert(t){return this.map(t)}clone(){return new Im(this.options)}getTicks(){var{domain:t,tickCount:e,tickMethod:n}=this.options,[t,r]=t;return Wy(t)&&Wy(r)?n(t,r,e):[]}}const Bm=(t,e,n)=>{var[t,r]=t,[e,i]=e;let a,o;return gy(o=t<r?(a=yy(t,r),n(e,i)):(a=yy(r,t),n(i,e)),a)},Dm=(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]=yy(s[t],s[t+1]),o[t]=e(l[t],l[t+1]);return t=>{var e=my(r,t,1,i)-1,n=a[e];return gy(o[e],n)(t)}},Fm=(t,e,n,r)=>{return(2<Math.min(t.length,e.length)?Dm:Bm)(t,e,r?vm:n)};class zm extends Mm{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,interpolate:ym,tickCount:5}}map(t){return Xy(t)?this.output(t):this.options.unknown}invert(t){return Xy(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 Oy}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 Vy}composeOutput(t,e){var{domain:n,range:r,round:i,interpolate:a}=this.options,n=Fm(n.map(t),r,a,i);this.output=gy(n,e,t)}composeInput(t,e,n){var{domain:r,range:i}=this.options,i=Fm(i,r.map(t),ym);this.input=gy(e,n,i)}}class Wm extends zm{getDefaultOptions(){return{domain:[0,1],range:[0,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolate:mm,tickMethod:Pm,tickCount:5}}chooseTransforms(){return[Vy,Vy]}clone(){return new Wm(this.options)}}class Gm extends Tm{getDefaultOptions(){return{domain:[],range:[0,1],align:.5,round:!1,padding:0,unknown:Om,paddingInner:1,paddingOuter:0}}constructor(t){super(t)}getPaddingInner(){return 1}clone(){return new Gm(this.options)}update(t){super.update(t)}getPaddingOuter(){return this.options.padding}}const Hm=t=>t<0?-Math.sqrt(-t):Math.sqrt(t);class Ym extends zm{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,exponent:2,interpolate:mm,tickMethod:Pm,tickCount:5}}constructor(t){super(t)}chooseTransforms(){var t,e,n,r=this.options["exponent"];return 1===r?[Vy,Vy]:(t=.5===r?Hm:(e=r,t=>t<0?-((-t)**e):t**e),n=r,[t,t=>t<0?-((-t)**(1/n)):t**(1/n)])}clone(){return new Ym(this.options)}}class Vm extends Ym{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,interpolate:mm,tickMethod:Pm,tickCount:5,exponent:.5}}constructor(t){super(t)}update(t){super.update(t)}clone(){return new Vm(this.options)}}class qm extends Mm{getDefaultOptions(){return{domain:[.5],range:[0,1]}}constructor(t){super(t)}map(t){return Xy(t)?(t=my(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 qm(this.options)}rescale(){var{domain:t,range:e}=this.options;this.n=Math.min(t.length,e.length-1),this.thresholds=t}}const $m=(t,e,n,r=10)=>{var i=t<0,a=Qy(r,i),o=Zy(r,i),s=e<t,l=s?e:t,c=s?t:e;let u=o(l),h=o(c),f=[];if(!(r%1)&&h-u<n){if(u=Math.floor(u),h=Math.ceil(h),i)for(;u<=h;u+=1){var d=a(u);for(let t=r-1;1<=t;--t){var p=d*t;if(c<p)break;l<=p&&f.push(p)}}else for(;u<=h;u+=1){var g=a(u);for(let t=1;t<r;t+=1){var y=g*t;if(c<y)break;l<=y&&f.push(y)}}2*f.length<n&&(f=Pm(l,c,n))}else{t=-1===n?h-u:Math.min(h-u,n);f=Pm(u,h,t).map(a)}return s?f.reverse():f};class Um extends zm{getDefaultOptions(){return{domain:[1,10],range:[0,1],base:10,interpolate:mm,tickMethod:$m,tickCount:5}}chooseNice(){return Jy}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[Zy(t,e),Qy(t,e)]}clone(){return new Um(this.options)}}class Xm extends qm{getDefaultOptions(){return{domain:[0,1],range:[.5],nice:!1,tickCount:5,tickMethod:Rm}}constructor(t){super(t)}nice(){var t,e,n=this.options["nice"];n&&([n,t,e]=this.getTickMethodOptions(),this.options.domain=Oy(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 Xm(this.options)}}function Km(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 Zm extends qm{getDefaultOptions(){return{domain:[],range:[],tickCount:5,unknown:void 0,tickMethod:Rm}}constructor(t){super(t)}rescale(){var{domain:t,range:e}=this.options;this.n=e.length-1,this.thresholds=Km(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 Zm(this.options)}getTicks(){var{tickCount:t,domain:e,tickMethod:n}=this.options,r=e.length-1;return n(e[0],e[r],t)}}var Qm=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,Jm=/\[([^]*?)\]/gm;function tv(t,e){for(var n=[],r=0,i=t.length;r<i;r++)n.push(t[r].substr(0,e));return n}function ev(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 nv(t,e){for(void 0===e&&(e=2),t=String(t);t.length<e;)t="0"+t;return t}var rv,n=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],o=["January","February","March","April","May","June","July","August","September","October","November","December"],xl=tv(o,3),iv=ev({},{dayNamesShort:tv(n,3),dayNames:n,monthNamesShort:xl,monthNames:o,amPm:["am","pm"],DoFn:function(t){return t+["th","st","nd","rd"][3<t%10?0:(t-t%10!=10?1:0)*t%10]}}),av={D:function(t){return String(t.getDate())},DD:function(t){return nv(t.getDate())},Do:function(t,e){return e.DoFn(t.getDate())},d:function(t){return String(t.getDay())},dd:function(t){return nv(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 nv(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 nv(String(t.getFullYear()),4).substr(2)},YYYY:function(t){return nv(t.getFullYear(),4)},h:function(t){return String(t.getHours()%12||12)},hh:function(t){return nv(t.getHours()%12||12)},H:function(t){return String(t.getHours())},HH:function(t){return nv(t.getHours())},m:function(t){return String(t.getMinutes())},mm:function(t){return nv(t.getMinutes())},s:function(t){return String(t.getSeconds())},ss:function(t){return nv(t.getSeconds())},S:function(t){return String(Math.round(t.getMilliseconds()/100))},SS:function(t){return nv(Math.round(t.getMilliseconds()/10),2)},SSS:function(t){return nv(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?"-":"+")+nv(100*Math.floor(Math.abs(t)/60)+Math.abs(t)%60,4)},Z:function(t){t=t.getTimezoneOffset();return(0<t?"-":"+")+nv(Math.floor(Math.abs(t)/60),2)+":"+nv(Math.abs(t)%60,2)}},ov={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 sv=(t,e,n,r,i)=>{var a=e<t,o=a?e:t,t=a?t:e,[e,n]=Cy(o,t,n,r,i),r=e.range(o,new Date(+t+1),n,!0);return a?r.reverse():r};function lv(t){var e=t.getTimezoneOffset(),t=new Date(t);return t.setMinutes(t.getMinutes()+e,t.getSeconds(),t.getMilliseconds()),t}class cv extends zm{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:sv,interpolate:ym,mask:void 0,utc:!1}}chooseTransforms(){return[t=>+t,t=>new Date(t)]}chooseNice(){return Ny}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?Ly:Ty,s=t?lv:Vy;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=ov.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=ov[t]||t).replace(Jm,function(t,e){return r.push(e),"@@@"}),ev(ev({},iv),n));return(t=t.replace(Qm,function(t){return av[t](e,i)})).replace(/@@@/g,function(){return r.shift()})}}clone(){return new cv(this.options)}}var uv;let hv=rv=class extends Wm{getDefaultOptions(){return{domain:[0,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolator:Vy,tickMethod:Pm,tickCount:5}}constructor(t){super(t)}clone(){return new rv(this.options)}};hv=rv=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}([tm(function(t){return[t(0),t(1)]},t=>{var[t,e]=t;return gy(ym(0,1),yy(t,e))})],hv);let fv=uv=class extends Wm{getDefaultOptions(){return{domain:[0,.5,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolator:Vy,tickMethod:Pm,tickCount:5}}constructor(t){super(t)}clone(){return new uv(this.options)}};function dv(r,i){return Object.entries(r).reduce((t,[e,n])=>(t[e]=i(n,e,r),t),{})}function pv(t){return t.map((t,e)=>e)}function gv(t){return t[t.length-1]}function yv(t,e){const n=[[],[]];return t.forEach(t=>{n[e(t)?0:1].push(t)}),n}function mv(n,t=n.length){if(1===t)return n.map(t=>[t]);const r=[];for(let e=0;e<n.length;e++)mv(n.slice(e+1),t-1).forEach(t=>{r.push([n[e],...t])});return r}function vv([t,e],[n,r]){return[t-n,e-r]}function bv([t,e],[n,r]){return[t+n,e+r]}function xv([t,e],[n,r]){return Math.sqrt(Math.pow(t-n,2)+Math.pow(e-r,2))}function wv([t,e]){return Math.atan2(e,t)}function Mv([t,e]){return wv([t,e])+Math.PI/2}function Ov(t,e){t=wv(t),e=wv(e);return t<e?e-t:2*Math.PI-(t-e)}function kv(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 Ev([t,e],[n,r]){return[(t+n)/2,(e+r)/2]}function C(t,e){for(var[n,r]of Object.entries(e))t.style(n,r)}function Sv(t,e,n,r,i){e=wv(vv(r,e))+Math.PI,n=wv(vv(r,n))+Math.PI;t.arc(r[0],r[1],i,e,n,n-e<0)}function Av(e,t,n,r="y",i="between"){const a="y"===r||!0===r?n:t;var n="y"===r||!0===r?90:0,t=pv(a),[r,o]=Id(t,t=>a[t]);const s=new Wm({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 _v(t){var[t,e,n,r]=t;return[r,t,e,n]}function Tv(t,e,n){var[e,r,,i]=mp(t)?_v(e):e,[n,a]=n,t=t.getCenter(),o=Mv(vv(e,t)),r=Mv(vv(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:xv(i,t),outerRadius:xv(e,t)}}function Pv(t){var{colorAttribute:t,opacityAttribute:t=t}=t;return t+"Opacity"}function Lv(t,e){return vp(t)?(e=e["transform"],`translate(${(t=t.getCenter())[0]}, ${t[1]}) `+(e||"")):""}function Cv(t){var e,n,r;return 1===t.length?t[0]:([[t,e],[n,r]]=t,[(t+n)/2,(e+r)/2])}function st(t){return new Nv([t],null,t,t.ownerDocument)}fv=uv=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}([tm(function(t){return[t(0),t(.5),t(1)]},t=>{const[e,n,r]=t,i=gy(ym(0,.5),yy(e,n)),a=gy(ym(.5,1),yy(n,r));return t=>(e>r?t<n?a:i:t<n?i:a)(t)})],fv);class Nv{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 Nv(t,null,this._elements[0],this._document)}selectFacetAll(t){t="string"==typeof t?this._parent.querySelectorAll(t):t;return new Nv(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 Nv([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 Nv(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 Nv(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 Nv([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])),h=Wd(this._elements,t=>r(t.__data__));for(let t=0;t<e.length;t++){var f=e[t],d=n(f,t),p=r(f,t);if(c.has(d)){var g=c.get(d);g.__data__=f,g.__facet__=!1,a.push(g),o.delete(g),c.delete(d)}else if(u.has(d)){g=u.get(d);g.__data__=f,g.__facet__=!0,a.push(g),u.delete(d)}else if(h.has(d)){const Wd=h.get(d);s.push([f,Wd]);for(const y of Wd)o.delete(y);h.delete(d)}else c.has(p)?((d=c.get(p)).__toData__?d.__toData__.push(f):d.__toData__=[f],l.add(d),o.delete(d)):i.push(f)}var t=[new Nv([],i,this._parent,this._document),new Nv(a,null,this._parent,this._document),new Nv(o,null,this._parent,this._document),new Nv([],s,this._parent,this._document),new Nv(l,null,this._parent,this._document)];return new Nv(this._elements,null,this._parent,this._document,t)}merge(t){var e=[...this._elements,...t._elements],t=[...this._transitions,...t._transitions];return new Nv(e,null,this._parent,this._document,void 0,t)}createElement(t){var e;return this._document?this._document.createElement(t,{}):(e=Nv.registry[t])?new e:h0("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 Nv([],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}}Nv.registry={g:rc,rect:kc,circle:Ul,path:gc,text:Ac,ellipse:tc,image:cc,line:fc,polygon:vc,polyline:wc,html:oc};const jv={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"]}}},Rv={style:{shape:(t,e)=>{const l=t["radius"],c=it(t,["shape","radius"]);var t=at(c,"pointer"),n=at(c,"pin");const u=t["shape"],h=it(t,["shape"]),f=n["shape"],d=it(n,["shape"]),{coordinate:p,theme:g}=e;return(t,e)=>{var t=t.map(t=>p.invert(t)),[n,r,i]=function(t,e){var[,...t]=(t=t.getOptions()["transformations"]).find(t=>t[0]===e);return t}(p,"polar");const a=p.clone();var o=e["color"],n=nf({startAngle:n,endAngle:r,innerRadius:i,outerRadius:l});n.push(["cartesian"]),a.update({transformations:n});const s=t.map(t=>a.map(t));var[r,i]=Cv(s),[n,t]=p.getCenter(),r=Object.assign(Object.assign({x1:r,y1:i,x2:n,y2:t,stroke:o},h),c),i=Object.assign(Object.assign({cx:n,cy:t,stroke:o},d),c),n=st(new rc);return v0(u)||("function"==typeof u?n.append(()=>u(s,e,a,g)):n.append("line").call(C,r).node()),v0(f)||("function"==typeof f?n.append(()=>f(s,e,a,g)):n.append("circle").call(C,i).node()),n.node()}},lineWidth:4,pointerLineCap:"round",pinR:10,pinFill:"#fff",radius:.6}},Iv={type:"text",style:{x:"50%",y:"60%",textAlign:"center",textBaseline:"middle",fontSize:20,fontWeight:800,fill:"#888"}};const Bv=t=>{var n,{data:e={},scale:r={},style:i={},animate:a={}}=t,t=it(t,["data","scale","style","animate","transform"]),{targetData:e,totalData:r,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,r),c=at(i,"text"),u=(n=["pointer","pin"],Object.fromEntries(Object.entries(i).filter(([e])=>n.find(t=>e.startsWith(t)))));return[ot({},jv,Object.assign({type:"interval",transform:[{type:"stackY"}],data:r,scale:l,style:at(i,"arc"),animate:"object"==typeof a?at(a,"arc"):a},t)),ot({},jv,Rv,Object.assign({type:"point",data:e,scale:l,style:u,animate:"object"==typeof a?at(a,"indicator"):a},t)),ot({},Iv,{style:Object.assign({text:([r,{target:i,total:e}]=[c,{target:o,total:s}],(r=r.content)?r(i,e):i.toString())},c),animate:"object"==typeof a?at(a,"text"):a})]},Dv=(Bv.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,h=t.series;e=Array.from(i,n=>{var t=u.getBandWidth(u.invert(+o[n])),e=t*(h?h.getBandWidth(h.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]});Dv.props={defaultShape:"density",defaultLabelShape:"label",composite:!1,channels:[...fd({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:[...yd(),{type:"maybeZeroY1"},{type:"maybeZeroX"}],postInference:[...pd()],interaction:{shareTooltip:!0}};const Fv=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]})]]};Fv.props={defaultShape:"heatmap",defaultLabelShape:"label",composite:!1,channels:[...fd({shapes:["heatmap"]}),{name:"x",required:!0},{name:"y",required:!0},{name:"color",scale:"identity",required:!0},{name:"size"}],preInference:[...yd(),{type:"maybeZeroY"},{type:"maybeZeroX"}],postInference:[...dd()]};const zv=()=>["#5B8FF9","#5AD8A6","#5D7092","#F6BD16","#6F5EF9","#6DC8EC","#945FB9","#FF9845","#1E9493","#FF99C3"],Wv=(zv.props={},()=>["#5B8FF9","#CDDDFD","#5AD8A6","#CDF3E4","#5D7092","#CED4DE","#F6BD16","#FCEBB9","#6F5EF9","#D3CEFD","#6DC8EC","#D3EEF9","#945FB9","#DECFEA","#FF9845","#FFE0C7","#1E9493","#BBDEDE","#FF99C3","#FFE0ED"]),Gv=(Wv.props={},t=>new Tm(t)),Hv=(Gv.props={},t=>new Wm(t)),Yv=(Hv.props={},t=>new Am(t)),Vv=(Yv.props={},t=>new Im(t)),qv=(Vv.props={},t=>new Gm(t)),$v=(qv.props={},t=>new cv(t)),Uv=($v.props={},t=>new Um(t)),Xv=(Uv.props={},t=>new Ym(t)),Kv=(Xv.props={},t=>new qm(t)),Zv=(Kv.props={},t=>new Zm(t)),Qv=(Zv.props={},t=>new Xm(t)),Jv=(Qv.props={},t=>new Vm(t)),tb=(Jv.props={},t=>new hv(t)),eb=(tb.props={},t=>new Lm(t));function nb(t){return function(){return t}}eb.props={};const rb=Math.abs,ib=Math.atan2,ab=Math.cos,ob=Math.max,sb=Math.min,lb=Math.sin,cb=Math.sqrt,ub=1e-12,hb=Math.PI,fb=hb/2,db=2*hb;function pb(t){return 1<=t?fb:t<=-1?-fb:Math.asin(t)}const gb=Math.PI,yb=2*gb,mb=1e-6,vb=yb-mb;function bb(n){this._+=n[0];for(let t=1,e=n.length;t<e;++t)this._+=arguments[t]+n[t]}class xb{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=null==t?bb:function(t){var e=Math.floor(t);if(!(0<=e))throw new Error("invalid digits: "+t);if(15<e)return bb;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,h=s-t,f=l-e,d=h*h+f*f;null===this._x1?this._append`M${this._x1=t},${this._y1=e}`:d>mb&&(Math.abs(f*c-u*h)>mb&&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((gb-Math.acos((o+d-r)/(2*l*a)))/2))/a,r=o/l,Math.abs(d-1)>mb&&this._append`L${t+d*h},${e+d*f}`,this._append`A${i},${i},0,0,${+(h*s<f*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,h=a?r-i:i-r;null===this._x1?this._append`M${l},${c}`:(Math.abs(this._x1-l)>mb||Math.abs(this._y1-c)>mb)&&this._append`L${l},${c}`,n&&((h=h<0?h%yb+yb:h)>vb?this._append`A${n},${n},0,1,${u},${t-o},${e-s}A${n},${n},0,1,${u},${this._x1=l},${this._y1=c}`:h>mb&&this._append`A${n},${n},0,${+(h>=gb)},${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 wb(){return new xb}function Mb(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 xb(r)}function Ob(t){return t.innerRadius}function kb(t){return t.outerRadius}function Eb(t){return t.startAngle}function Sb(t){return t.endAngle}function Ab(t){return t&&t.padAngle}function _b(t,e,n,r,i,a,o){var s=t-n,l=e-r,o=(o?a:-a)/cb(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,h=n-t,f=u*u+h*h,a=i-a,s=s*n-e*t,n=(h<0?-1:1)*cb(ob(0,a*a*f-s*s)),e=(s*h-u*n)/f,t=(-s*u-h*n)/f,d=(s*h+u*n)/f,s=(-s*u+h*n)/f,u=e-r,h=t-c,n=d-r,f=s-c;return n*n+f*f<u*u+h*h&&(e=d,t=s),{cx:e,cy:t,x01:-l,y01:-o,x11:e*(i/a-1),y11:t*(i/a-1)}}function Tb(){var _=Ob,T=kb,P=nb(0),L=null,C=Eb,N=Sb,j=Ab,R=null,I=Mb(e);function e(){var t,e,n,r,i,a,o,s,l,c,u,h,f,d,p,g,y,m,v,b,x,w,M=+_.apply(this,arguments),O=+T.apply(this,arguments),k=C.apply(this,arguments)-fb,E=N.apply(this,arguments)-fb,S=rb(E-k),A=k<E;if(R=R||(t=I()),O<M&&(e=O,O=M,M=e),O>ub?S>db-ub?(R.moveTo(O*ab(k),O*lb(k)),R.arc(0,0,O,k,E,!A),M>ub&&(R.moveTo(M*ab(E),M*lb(E)),R.arc(0,0,M,E,k,A))):(r=e=k,i=n=E,o=a=S,f=(u=j.apply(this,arguments)/2)>ub&&(L?+L.apply(this,arguments):cb(M*M+O*O)),w=x=s=sb(rb(O-M)/2,+P.apply(this,arguments)),f>ub&&(h=pb(f/M*lb(u)),f=pb(f/O*lb(u)),(a-=2*h)>ub?(r+=h*=A?1:-1,i-=h):(a=0,r=i=(k+E)/2),(o-=2*f)>ub?(e+=f*=A?1:-1,n-=f):(o=0,e=n=(k+E)/2)),u=O*ab(e),h=O*lb(e),f=M*ab(i),k=M*lb(i),s>ub&&(d=O*ab(n),p=O*lb(n),g=M*ab(r),y=M*lb(r),S<hb)&&((E=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<ub))return[t+(l=(o*(e-a)-s*(t-i))/l)*n,e+l*r]}(u,h,g,y,d,p,f,k))?(S=u-E[0],v=h-E[1],b=d-E[0],m=p-E[1],v=1/lb((1<(S=(S*b+v*m)/(cb(S*S+v*v)*cb(b*b+m*m)))?0:S<-1?hb:Math.acos(S))/2),b=cb(E[0]*E[0]+E[1]*E[1]),x=sb(s,(M-b)/(v-1)),w=sb(s,(O-b)/(1+v))):x=w=0),o>ub?w>ub?(l=_b(g,y,u,h,O,w,A),c=_b(d,p,f,k,O,w,A),R.moveTo(l.cx+l.x01,l.cy+l.y01),w<s?R.arc(l.cx,l.cy,w,ib(l.y01,l.x01),ib(c.y01,c.x01),!A):(R.arc(l.cx,l.cy,w,ib(l.y01,l.x01),ib(l.y11,l.x11),!A),R.arc(0,0,O,ib(l.cy+l.y11,l.cx+l.x11),ib(c.cy+c.y11,c.cx+c.x11),!A),R.arc(c.cx,c.cy,w,ib(c.y11,c.x11),ib(c.y01,c.x01),!A))):(R.moveTo(u,h),R.arc(0,0,O,e,n,!A)):R.moveTo(u,h),M>ub&&a>ub?x>ub?(l=_b(f,k,d,p,M,-x,A),c=_b(u,h,g,y,M,-x,A),R.lineTo(l.cx+l.x01,l.cy+l.y01),x<s?R.arc(l.cx,l.cy,x,ib(l.y01,l.x01),ib(c.y01,c.x01),!A):(R.arc(l.cx,l.cy,x,ib(l.y01,l.x01),ib(l.y11,l.x11),!A),R.arc(0,0,M,ib(l.cy+l.y11,l.cx+l.x11),ib(c.cy+c.y11,c.cx+c.x11),A),R.arc(c.cx,c.cy,x,ib(c.y11,c.x11),ib(c.y01,c.x01),!A))):R.arc(0,0,M,i,r,A):R.lineTo(f,k)):R.moveTo(0,0),R.closePath(),t)return R=null,t+""||null}return e.centroid=function(){var t=(+_.apply(this,arguments)+ +T.apply(this,arguments))/2,e=(+C.apply(this,arguments)+ +N.apply(this,arguments))/2-hb/2;return[ab(e)*t,lb(e)*t]},e.innerRadius=function(t){return arguments.length?(_="function"==typeof t?t:nb(+t),e):_},e.outerRadius=function(t){return arguments.length?(T="function"==typeof t?t:nb(+t),e):T},e.cornerRadius=function(t){return arguments.length?(P="function"==typeof t?t:nb(+t),e):P},e.padRadius=function(t){return arguments.length?(L=null==t?null:"function"==typeof t?t:nb(+t),e):L},e.startAngle=function(t){return arguments.length?(C="function"==typeof t?t:nb(+t),e):C},e.endAngle=function(t){return arguments.length?(N="function"==typeof t?t:nb(+t),e):N},e.padAngle=function(t){return arguments.length?(j="function"==typeof t?t:nb(+t),e):j},e.context=function(t){return arguments.length?(R=null==t?null:t,e):R},e}function Pb(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function Lb(t){this._context=t}function Cb(t){return new Lb(t)}function Nb(t){return t[0]}function jb(t){return t[1]}function Rb(o,s){var l=nb(!0),c=null,u=Cb,h=null,f=Mb(e);function e(t){var e,n,r,i=(t=Pb(t)).length,a=!1;for(null==c&&(h=u(r=f())),e=0;e<=i;++e)!(e<i&&l(n=t[e],e,t))===a&&((a=!a)?h.lineStart():h.lineEnd()),a&&h.point(+o(n,e,t),+s(n,e,t));if(r)return h=null,r+""||null}return o="function"==typeof o?o:void 0===o?Nb:nb(o),s="function"==typeof s?s:void 0===s?jb:nb(s),e.x=function(t){return arguments.length?(o="function"==typeof t?t:nb(+t),e):o},e.y=function(t){return arguments.length?(s="function"==typeof t?t:nb(+t),e):s},e.defined=function(t){return arguments.length?(l="function"==typeof t?t:nb(!!t),e):l},e.curve=function(t){return arguments.length?(u=t,null!=c&&(h=u(c)),e):u},e.context=function(t){return arguments.length?(null==t?c=h=null:h=u(c=t),e):c},e}function Ib(u,h,f){var d=null,p=nb(!0),g=null,y=Cb,m=null,v=Mb(e);function e(t){var e,n,r,i,a,o=(t=Pb(t)).length,s=!1,l=new Array(o),c=new Array(o);for(null==g&&(m=y(a=v())),e=0;e<=o;++e){if(!(e<o&&p(i=t[e],e,t))===s)if(s=!s)n=e,m.areaStart(),m.lineStart();else{for(m.lineEnd(),m.lineStart(),r=e-1;n<=r;--r)m.point(l[r],c[r]);m.lineEnd(),m.areaEnd()}s&&(l[e]=+u(i,e,t),c[e]=+h(i,e,t),m.point(d?+d(i,e,t):l[e],f?+f(i,e,t):c[e]))}if(a)return m=null,a+""||null}function t(){return Rb().defined(p).curve(y).context(g)}return u="function"==typeof u?u:void 0===u?Nb:nb(+u),h="function"==typeof h?h:nb(void 0===h?0:+h),f="function"==typeof f?f:void 0===f?jb:nb(+f),e.x=function(t){return arguments.length?(u="function"==typeof t?t:nb(+t),d=null,e):u},e.x0=function(t){return arguments.length?(u="function"==typeof t?t:nb(+t),e):u},e.x1=function(t){return arguments.length?(d=null==t?null:"function"==typeof t?t:nb(+t),e):d},e.y=function(t){return arguments.length?(h="function"==typeof t?t:nb(+t),f=null,e):h},e.y0=function(t){return arguments.length?(h="function"==typeof t?t:nb(+t),e):h},e.y1=function(t){return arguments.length?(f=null==t?null:"function"==typeof t?t:nb(+t),e):f},e.lineX0=e.lineY0=function(){return t().x(u).y(h)},e.lineY1=function(){return t().x(u).y(f)},e.lineX1=function(){return t().x(d).y(h)},e.defined=function(t){return arguments.length?(p="function"==typeof t?t:nb(!!t),e):p},e.curve=function(t){return arguments.length?(y=t,null!=g&&(m=y(g)),e):y},e.context=function(t){return arguments.length?(null==t?g=m=null:m=y(g=t),e):g},e}wb.prototype=xb.prototype,Lb.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 Bb=Fb(Cb);function Db(t){this._curve=t}function Fb(e){function t(t){return new Db(e(t))}return t._curve=e,t}function zb(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(Fb(t)):e()._curve},t}function Wb(){}function Gb(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 Hb(t,e){this._context=t,this._k=(1-e)/6}function Yb(t,e){this._context=t,this._k=(1-e)/6}function Vb(t,e,n){var r,i,a=t._x1,o=t._y1,s=t._x2,l=t._y2;t._l01_a>ub&&(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>ub&&(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 qb(t,e){this._context=t,this._alpha=e}Db.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))}},Hb.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:Gb(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:Gb(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 Hb(t,n)}return t.tension=function(t){return e(+t)},t}(0),Yb.prototype={areaStart:Wb,areaEnd:Wb,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:Gb(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 Yb(t,n)}return t.tension=function(t){return e(+t)},t}(0),qb.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:Vb(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 $b=function e(n){function t(t){return n?new qb(t,n):new Hb(t,0)}return t.alpha=function(t){return e(+t)},t}(.5);function Ub(t,e){this._context=t,this._alpha=e}Ub.prototype={areaStart:Wb,areaEnd:Wb,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:Vb(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 Xb=function e(n){function t(t){return n?new Ub(t,n):new Yb(t,0)}return t.alpha=function(t){return e(+t)},t}(.5);function Kb(t){this._context=t}function Zb(t){return new Kb(t)}function Qb(t,e){this._context=t,this._t=e}function Jb(t){return new Qb(t,.5)}function t2(t){return new Qb(t,0)}function e2(t){return new Qb(t,1)}function n2(t,e,n){return Math.max(e,Math.min(t,n))}function r2(t,e,n,r,i={}){var{inset:a=0,radius:o=0,insetLeft:s=a,insetTop:l=a,insetRight:c=a,insetBottom:u=a,radiusBottomLeft:h=o,radiusBottomRight:f=o,radiusTopLeft:d=o,radiusTopRight:p=o,minWidth:g=-1/0,maxWidth:y=1/0}=i,i=it(i,["inset","radius","insetLeft","insetTop","insetRight","insetBottom","radiusBottomLeft","radiusBottomRight","radiusTopLeft","radiusTopRight","minWidth","maxWidth"]);if(!vp(r)&&!xp(r)){var m=!!mp(r),[v,,b]=m?_v(e):e;const[k,M]=v;var[b,v]=vv(b,v),x=(0<b?k:k+b)+s,w=(0<v?M:M+v)+l,b=Math.abs(b)-(s+c),s=Math.abs(v)-(l+u),c=m?b:n2(b,g,y),v=m?n2(s,g,y):s,l=x-(c-b)/2,u=w-(v-s)/2;return st(t.createElement("rect",{})).style("x",l).style("y",u).style("width",c).style("height",v).style("radius",[d,p,f,h]).call(C,i).node()}const{y:M,y1:O}=n;m=r.getCenter(),g=Tv(r,e,[M,O]),y=Tb().cornerRadius(o).padAngle(a*Math.PI/180);return st(t.createElement("path",{})).style("path",y(g)).style("transform",`translate(${m[0]}, ${m[1]})`).style("radius",o).style("inset",a).call(C,i).node()}Kb.prototype={areaStart:Wb,areaEnd:Wb,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))}},Qb.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 i2=(E,t)=>{const{colorAttribute:S,first:A=!0,last:_=!0}=E,T=it(E,["colorAttribute","opacityAttribute","first","last"]),{coordinate:P,document:L}=t;return(t,e,n)=>{var{color:r,radius:i=0}=n,n=it(n,["color","radius"]),a=n.lineWidth||1,{stroke:o,radius:i=i,radiusTopLeft:s=i,radiusTopRight:l=i,radiusBottomRight:c=i,radiusBottomLeft:u=i,innerRadius:h=0,innerRadiusTopLeft:f=h,innerRadiusTopRight:d=h,innerRadiusBottomRight:p=h,innerRadiusBottomLeft:h=h,lineWidth:a="stroke"===S||o?a:0,inset:g=0,insetLeft:y=g,insetRight:m=g,insetBottom:v=g,insetTop:b=g,minWidth:x,maxWidth:w}=T,M=it(T,["stroke","radius","radiusTopLeft","radiusTopRight","radiusBottomRight","radiusBottomLeft","innerRadius","innerRadiusTopLeft","innerRadiusTopRight","innerRadiusBottomRight","innerRadiusBottomLeft","lineWidth","inset","insetLeft","insetRight","insetBottom","insetTop","minWidth","maxWidth"]),{color:r=r,opacity:O}=e;const k=[A?s:f,A?l:d,_?c:p,_?u:h];s=["radiusTopLeft","radiusTopRight","radiusBottomRight","radiusBottomLeft"],mp(P)&&s.push(s.shift()),f=Object.assign(Object.assign({radius:i},Object.fromEntries(s.map((t,e)=>[t,k[e]]))),{inset:g,insetLeft:y,insetRight:m,insetBottom:v,insetTop:b,minWidth:x,maxWidth:w});return st(r2(L,t,e,P,f)).call(C,n).style("fill","transparent").style(S,r).style(Pv(E),O).style("lineWidth",a).style("stroke",void 0===o?r:o).call(C,M).node()}},a2=(i2.props={defaultEnterAnimation:"scaleInY",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},(t,e)=>i2(Object.assign({colorAttribute:"fill"},t),e)),o2=(a2.props=Object.assign(Object.assign({},i2.props),{defaultMarker:"square"}),(t,e)=>i2(Object.assign({colorAttribute:"stroke"},t),e));o2.props=Object.assign(Object.assign({},i2.props),{defaultMarker:"hollowSquare"});const s2=(t,e)=>{const{adjustPoints:s=function(t,e,n){var[t,r,i,a]=t;if(mp(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,l=it(t,["adjustPoints"]),{coordinate:c,document:u}=e;return(t,e,n,r)=>{var i=e["index"],a=n["color"],n=it(n,["color"]),r=r[i+1],i=s(t,r,c),[t,r,i,o]=!!mp(c)?_v(i):i,{color:e=a,opacity:a}=e,t=Rb().curve(Zb)([t,r,i,o]);return st(u.createElement("path",{})).call(C,n).style("path",t).style("fill",e).style("fillOpacity",a).call(C,l).node()}};function l2(t,e,n){var[t,r,i,a]=t;if(mp(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]}s2.props={defaultMarker:"square"};const c2=(t,e)=>s2(Object.assign({adjustPoints:l2},t),e);function u2(t){const e="function"==typeof t?t:t.render;return class extends Zl{connectedCallback(){this.draw()}attributeChangedCallback(){this.draw()}draw(){e(this)}}}c2.props={defaultMarker:"square"};const h2=u2(t=>{var{d1:e,d2:n,style1:r,style2:i}=t.attributes;const a=t.ownerDocument;st(t).maybeAppend("line",()=>a.createElement("path",{})).style("d",e).call(C,r),st(t).maybeAppend("line1",()=>a.createElement("path",{})).style("d",n).call(C,i)});const f2=(t,e)=>{const{curve:u,gradient:h=!1,gradientColor:f="between",defined:d=t=>!Number.isNaN(t)&&null!=t,connect:p=!1}=t,g=it(t,["curve","gradient","gradientColor","defined","connect"]),{coordinate:y,document:m}=e;return(t,e,n)=>{var{color:r,lineWidth:i}=n,n=it(n,["color","lineWidth"]),{color:r=r,size:i=i,seriesColor:a,seriesX:o,seriesY:s}=e,a=h&&a?Av(a,o,s,h,f):r,o=Lv(y,e),s=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},n),a&&{stroke:a}),i&&{lineWidth:i}),o&&{transform:o}),g);let l;if(vp(y)){const c=y.getCenter();l=n=>zb(Rb().curve(Bb)).angle((t,e)=>Mv(vv(n[e],c))).radius((t,e)=>xv(n[e],c)).defined(([t,e])=>d(t)&&d(e)).curve(u)(n)}else l=Rb().x(t=>t[0]).y(t=>t[1]).defined(([t,e])=>d(t)&&d(e)).curve(u);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,d),n=at(s,"connect"),a=!!e.length;return(!a||p&&!Object.keys(n).length?st(m.createElement("path",{})).style("d",l(r)||[]).call(C,s):a&&!p?st(m.createElement("path",{})).style("d",l(t)).call(C,s):st(new h2).style("style1",Object.assign(Object.assign({},s),n)).style("style2",s).style("d1",e.map(l).join(",")).style("d2",l(t))).node()}},d2=(f2.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},(n,r)=>{const i=r["coordinate"];return(...t)=>{var e=vp(i)?Zb:Cb;return f2(Object.assign({curve:e},n),r)(...t)}}),p2=(d2.props=Object.assign(Object.assign({},f2.props),{defaultMarker:"line"}),(t,n)=>{const{alpha:r=.5}=t,i=it(t,["alpha"]),a=n["coordinate"];return(...t)=>{var e=vp(a)?Xb:$b;return f2(Object.assign({curve:e.alpha(r)},i),n)(...t)}}),g2=(p2.props=Object.assign(Object.assign({},f2.props),{defaultMarker:"smooth"}),(t,e)=>f2(Object.assign({curve:e2},t),e)),y2=(g2.props=Object.assign(Object.assign({},f2.props),{defaultMarker:"hv"}),(t,e)=>f2(Object.assign({curve:t2},t),e)),m2=(y2.props=Object.assign(Object.assign({},f2.props),{defaultMarker:"vh"}),(t,e)=>f2(Object.assign({curve:Jb},t),e));m2.props=Object.assign(Object.assign({},f2.props),{defaultMarker:"hvh"});const v2=(b,t)=>{const x=t["document"];return(e,t,n)=>{var r,i,a,o,s,l,c,u,h,{seriesSize:f,color:t}=t,d=n["color"],n=it(n,["color"]),p=wb();for(let t=0;t<e.length-1;t++){var g=e[t],y=e[t+1],m=f[t],v=f[t+1];[...g,...y].every(d0)&&(r=p,m=m,v=v,s=a=i=h=u=c=l=s=o=i=a=i=void 0,i=(s=wv(vv(y=y,g=g)))+Math.PI/2,a=[m/2*Math.cos(i),m/2*Math.sin(i)],i=[v/2*Math.cos(i),v/2*Math.sin(i)],o=[v/2*Math.cos(s),v/2*Math.sin(s)],s=[m/2*Math.cos(s),m/2*Math.sin(s)],l=bv(g,a),c=bv(y,i),u=bv(c,o),h=vv(o=bv(y,o),i),y=vv(y,i),i=vv(g,a),a=vv(i,s),g=vv(g,s),s=vv(l,s),r.moveTo(...l),r.lineTo(...c),r.arcTo(...u,...o,v/2),r.arcTo(...h,...y,v/2),r.lineTo(...i),r.arcTo(...a,...g,m/2),r.arcTo(...s,...l,m/2),r.closePath())}return st(x.createElement("path",{})).call(C,n).style("fill",t||d).style("d",p.toString()).call(C,b).node()}};v2.props=Object.assign(Object.assign({},f2.props),{defaultMarker:"line"});Ks=(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"]],Ks.style=["fill"],Ll=Ks.bind(void 0),Ll.style=["stroke","lineWidth"],Is=(t,e,n)=>[["M",t-n,e-n],["L",t+n,e-n],["L",t+n,e+n],["L",t-n,e+n],["Z"]],Is.style=["fill"],Us=Is.bind(void 0),Us.style=["fill"],Zr=Is.bind(void 0),Zr.style=["stroke","lineWidth"],Ys=(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"]]},Ys.style=["fill"],Gs=Ys.bind(void 0),Gs.style=["stroke","lineWidth"],Js=(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"]]},Js.style=["fill"],sn=Js.bind(void 0),sn.style=["stroke","lineWidth"],ln=(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"]]},ln.style=["fill"],ad=ln.bind(void 0),ad.style=["stroke","lineWidth"],xo=(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"]]},xo.style=["fill"],Eo=xo.bind(void 0),Eo.style=["stroke","lineWidth"],i=(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"]]},i.style=["fill"],ki=i.bind(void 0),ki.style=["stroke","lineWidth"],Ds=(t,e,n)=>[["M",t,e+n],["L",t,e-n]],Ds.style=["stroke","lineWidth"],Do=(t,e,n)=>[["M",t-n,e-n],["L",t+n,e+n],["M",t+n,e-n],["L",t-n,e+n]],Do.style=["stroke","lineWidth"],Mo=(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]],Mo.style=["stroke","lineWidth"],qs=(t,e,n)=>[["M",t-n,e],["L",t+n,e],["M",t,e-n],["L",t,e+n]],qs.style=["stroke","lineWidth"],Ao=(t,e,n)=>[["M",t-n,e],["L",t+n,e]],Ao.style=["stroke","lineWidth"],To=(t,e,n)=>[["M",t-n,e],["L",t+n,e]],To.style=["stroke","lineWidth"],jo=To.bind(void 0),jo.style=["stroke","lineWidth"],zo=(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]],zo.style=["stroke","lineWidth"],Go=(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]],Go.style=["stroke","lineWidth"],Yo=(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]],Yo.style=["stroke","lineWidth"],qo=(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]],qo.style=["stroke","lineWidth"],Xo=(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]];Xo.style=["stroke","lineWidth"];const b2=new Map([["bowtie",i],["cross",Do],["dash",jo],["diamond",Ys],["dot",To],["hexagon",xo],["hollowBowtie",ki],["hollowDiamond",Gs],["hollowHexagon",Eo],["hollowPoint",Ll],["hollowSquare",Zr],["hollowTriangle",sn],["hollowTriangleDown",ad],["hv",Go],["hvh",qo],["hyphen",Ao],["line",Ds],["plus",qs],["point",Ks],["rect",Us],["smooth",zo],["square",Is],["tick",Mo],["triangleDown",ln],["triangle",Js],["vh",Yo],["vhv",Xo]]);const u=(c,t)=>{const{colorAttribute:u,symbol:e,mode:h="auto"}=c,f=it(c,["colorAttribute","symbol","mode"]),d=b2.get(e)||b2.get("point"),{coordinate:p,document:g}=t;return(t,e,n)=>{var{lineWidth:r,color:i}=n,r=f.stroke?r||1:r,{color:i=i,transform:a,opacity:o}=e,[s,l]=Cv(t),t=function(t,e,n,r){var i;if(1!==e.length)return n=n["size"],"fixed"!==t&&("normal"===t||Mp(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,p)||f.r||n.r;return st(g.createElement("path",{})).call(C,n).style("fill","transparent").style("d",d(s,l,t)).style("lineWidth",r).style("transform",a).style("stroke",i).style(Pv(c),o).style(u,i).call(C,f).node()}},x2=(u.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},(t,e)=>u(Object.assign({colorAttribute:"fill",symbol:"bowtie"},t),e)),w2=(x2.props=Object.assign({defaultMarker:"bowtie"},u.props),(t,e)=>u(Object.assign({colorAttribute:"stroke",symbol:"cross"},t),e)),M2=(w2.props=Object.assign({defaultMarker:"cross"},u.props),(t,e)=>u(Object.assign({colorAttribute:"fill",symbol:"diamond"},t),e)),O2=(M2.props=Object.assign({defaultMarker:"diamond"},u.props),(t,e)=>u(Object.assign({colorAttribute:"fill",symbol:"hexagon"},t),e)),k2=(O2.props=Object.assign({defaultMarker:"hexagon"},u.props),(t,e)=>u(Object.assign({colorAttribute:"stroke",symbol:"bowtie"},t),e)),E2=(k2.props=Object.assign({defaultMarker:"hollowBowtie"},u.props),(t,e)=>u(Object.assign({colorAttribute:"stroke",symbol:"diamond"},t),e)),S2=(E2.props=Object.assign({defaultMarker:"hollowDiamond"},u.props),(t,e)=>u(Object.assign({colorAttribute:"stroke",symbol:"hexagon"},t),e)),A2=(S2.props=Object.assign({defaultMarker:"hollowHexagon"},u.props),(t,e)=>u(Object.assign({colorAttribute:"stroke",symbol:"point"},t),e)),_2=(A2.props=Object.assign({defaultMarker:"hollowPoint"},u.props),(t,e)=>u(Object.assign({colorAttribute:"stroke",symbol:"square"},t),e)),T2=(_2.props=Object.assign({defaultMarker:"hollowSquare"},u.props),(t,e)=>u(Object.assign({colorAttribute:"stroke",symbol:"triangle"},t),e)),P2=(T2.props=Object.assign({defaultMarker:"hollowTriangle"},u.props),(t,e)=>u(Object.assign({colorAttribute:"stroke",symbol:"triangle-down"},t),e)),L2=(P2.props=Object.assign({defaultMarker:"hollowTriangleDown"},u.props),(t,e)=>u(Object.assign({colorAttribute:"stroke",symbol:"hyphen"},t),e)),C2=(L2.props=Object.assign({defaultMarker:"hyphen"},u.props),(t,e)=>u(Object.assign({colorAttribute:"stroke",symbol:"line"},t),e)),N2=(C2.props=Object.assign({defaultMarker:"line"},u.props),(t,e)=>u(Object.assign({colorAttribute:"stroke",symbol:"plus"},t),e)),j2=(N2.props=Object.assign({defaultMarker:"plus"},u.props),(t,e)=>u(Object.assign({colorAttribute:"fill",symbol:"point"},t),e)),R2=(j2.props=Object.assign({defaultMarker:"point"},u.props),(t,e)=>u(Object.assign({colorAttribute:"fill",symbol:"square"},t),e)),I2=(R2.props=Object.assign({defaultMarker:"square"},u.props),(t,e)=>u(Object.assign({colorAttribute:"stroke",symbol:"tick"},t),e)),B2=(I2.props=Object.assign({defaultMarker:"tick"},u.props),(t,e)=>u(Object.assign({colorAttribute:"fill",symbol:"triangle"},t),e)),D2=(B2.props=Object.assign({defaultMarker:"triangle"},u.props),(t,e)=>u(Object.assign({colorAttribute:"fill",symbol:"triangle-down"},t),e)),F2=(D2.props=Object.assign({defaultMarker:"triangleDown"},u.props),(t,e)=>{const{arrow:u=!0,arrowSize:h="40%"}=t,f=it(t,["arrow","arrowSize"]),d=e["document"];return(t,e,n)=>{var r,i,a,o,s=n["defaultColor"],n=it(n,["defaultColor"]),{color:e=s,transform:s}=e,[t,l]=t,c=wb();return c.moveTo(...t),c.lineTo(...l),u&&([a,o]=(t=t,r=l,i="string"==typeof(i=(i={arrowSize:h})["arrowSize"])?+parseFloat(i)/100*xv(t,r):i,a=Math.PI/6,t=Math.atan2(r[1]-t[1],r[0]-t[0]),o=Math.PI/2-t-a,t-=a,[[r[0]-i*Math.sin(o),r[1]-i*Math.cos(o)],[r[0]-i*Math.cos(t),r[1]-i*Math.sin(t)]]),c.moveTo(...l),c.lineTo(...a),c.moveTo(...l),c.lineTo(...o)),st(d.createElement("path",{})).call(C,n).style("d",c.toString()).style("stroke",e).style("transform",s).call(C,f).node()}});function z2(t){G2(t,!0)}function W2(t){G2(t,!1)}function G2(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)})}F2.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};t(V2,H2=rc);var H2,Y2=V2;function V2(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=H2.apply(this,M([],j(t),!1))||this;return n.addEventListener(v.INSERTED,function(){W2(n)}),n}function q2(t){t=t.appendChild(new Y2({class:"offscreen"}));return W2(t),t}t(X2,$2=Ac),Object.defineProperty(X2.prototype,"offscreenGroup",{get:function(){return this._offscreen||(this._offscreen=q2(this)),this._offscreen},enumerable:!1,configurable:!0}),X2.prototype.disconnectedCallback=function(){var t;null!=(t=this._offscreen)&&t.destroy()};var $2,U2=X2;function X2(t){var e=(t=void 0===t?{}:t).style,t=it(t,["style"]);return $2.call(this,m({style:m({text:"",fill:"black",fontFamily:"sans-serif",fontSize:16,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",lineWidth:1,textAlign:"start",textBaseline:"middle"},e)},t))||this}function K2(t){return t*Math.PI/180}function Z2(t){return Number((180*t/Math.PI).toPrecision(5))}Object.defineProperty(J2.prototype,"bottom",{get:function(){return this.y+this.height},enumerable:!1,configurable:!0}),Object.defineProperty(J2.prototype,"left",{get:function(){return this.x},enumerable:!1,configurable:!0}),Object.defineProperty(J2.prototype,"right",{get:function(){return this.x+this.width},enumerable:!1,configurable:!0}),Object.defineProperty(J2.prototype,"top",{get:function(){return this.y},enumerable:!1,configurable:!0}),J2.fromRect=function(t){return new J2(t.x,t.y,t.width,t.height)},J2.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 Q2=J2;function J2(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 tx(t,e){return Se(t)?t.apply(void 0,M([],j(e),!1)):t}function ex(t,e){function r(t){return"".concat(e,"-").concat(t)}return t=Object.fromEntries(Object.entries(t).map(function(t){var t=j(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 nx(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r+=1)ix(t,e[r]);return t}var rx,ix=function(r,i,a,o){void 0===a&&(a=0),void 0===o&&(o=5),Object.entries(i).forEach(function(t){var t=j(t,2),e=t[0],t=t[1],n=r;Object.prototype.hasOwnProperty.call(i,e)&&(t?Ce(t)?(Ce(r[e])||(n[e]={}),a<o?ix(r[e],t,a+1,o):n[e]=i[e]):Te(t)?(n[e]=[],n[e]=n[e].concat(t)):n[e]=t:n[e]=t)})},ax=function(t){return void 0!==t&&null!=t&&!Number.isNaN(t)},ox=Xe(function(t,e){var n=Ie(t)?t:t.style.text.toString(),e=e||sx(t),t=e.fontSize,r=e.fontFamily,i=e.fontWeight,a=e.fontStyle,e=e.fontVariant;return(rx=rx||document.createElement("canvas").getContext("2d")).font=[a,e,i,"".concat(t,"px"),r].join(" "),rx.measureText(n).width},function(t,e){return[Ie(t)?t:t.style.text.toString(),Object.values(e||sx(t)).join()].join("")}),sx=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 lx(t){return"text"===t.nodeName?t:"g"===t.nodeName&&1===t.children.length&&"text"===t.children[0].nodeName?t.children[0]:null}function cx(t,e){t=lx(t);t&&t.attr(e)}function ux(t,e,n){cx(t,{wordWrap:!0,wordWrapWidth:e,maxLines:1,textOverflow:n=void 0===n?"...":n})}function hx(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 fx(t){return"function"==typeof t?t():Ie(t)||De(t)?new U2({style:{text:String(t)}}):t}function dx(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 px(t,e,n,r,i){return(r=void 0===r?!0:r)&&t===e||i&&t===n||e<t&&t<n}var gx=function(e,n){return function(t){return e*(1-t)+n*t}};function yx(e,t){var i,a,o,s,n,r,l;return"number"==typeof e&&"number"==typeof t?gx(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]=yx(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=j(t,2),e=t[0],t=t[1];e in n?r[e]=yx(n[e],t):l[e]=t}),function(n){return Object.entries(r).forEach(function(t){var t=j(t,2),e=t[0],t=t[1];return l[e]=t(n)}),l}):function(t){return e}}function mx(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=j([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 Q2(e,n,r-e,i-n)}function vx(n,t,e){function r(t){var e=j(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,h=u?e?[1,0]:[-1,0]:e?[0,1]:[0,-1],f=(s=j([0,0],2))[0],d=s[1],e=mx(o=t.map(function(t){var e=t.width,t=t.height,n=j([f,d],2),r=n[0],n=n[1],i=j([f+e*h[0],d+t*h[1]],2);return f=i[0],d=i[1],new Q2(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 mx(s=o.map(function(t){var e=t.x,n=t.y,t=Q2.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=Q2.fromRect(t);return t.x=u?e:e+r(t),t.y=u?n+r(t):n,t}).map(function(t){var e,t=Q2.fromRect(t);return t.x+=null!=(e=n.x)?e:0,t.y+=null!=(e=n.y)?e:0,t})}function bx(t,e,n){return[]}function xx(t,e){return[t[0]*e,t[1]*e]}function wx(t,e){return[t[0]+e[0],t[1]+e[1]]}function Mx(t,e){return[t[0]-e[0],t[1]-e[1]]}function Ox(t,e){return[Math.min(t[0],e[0]),Math.min(t[1],e[1])]}function kx(t,e){return[Math.max(t[0],e[0]),Math.max(t[1],e[1])]}function Ex(t,e){return Math.sqrt(Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2))}function Sx(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 Ax(t,e){e=Math.pow(10,e);return~~(t*e)/e}function _x(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 Tx(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=j(r,2))[0],l=r[1];for(var c=0,u=t.length;c<u;c+=1)s=Ox(s,x=t[c]),l=kx(l,x)}for(var c=0,h=t.length;c<h;c+=1){var f,d,p,g,y,m,v,b,x=t[c];0!==c||n?c!==h-1||n?(f=t[[c?c-1:h-1,c-1][n?0:1]],m=[0,0],m=xx(m=Mx(d=t[n?(c+1)%h:c+1],f),e),0!==(y=(p=Ex(x,f))+(g=Ex(x,d)))&&(p/=y,g/=y),y=xx(m,-p),m=xx(m,g),v=wx(x,y),b=Ox(b=wx(x,m),kx(d,x)),b=kx(b,Ox(d,x)),v=Ox(v=wx(x,y=xx(y=Mx(b,x),-p/g)),kx(f,x)),b=wx(x,m=xx(m=Mx(x,v=kx(v,Ox(f,x))),g/p)),o&&(v=Ox(v=kx(v,s),l),b=Ox(b=kx(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,h=[],i=0;i<u-1;i+=1)o=c[2*i],s=c[2*i+1],h.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=j(r,1)[0],h.push(["C",o[0],o[1],s[0],s[1],l[0],l[1]])),h}var Px=["$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 Lx(t){var e,n,r={};for(e in t)n=e,Px.includes(n)&&(r[e]=t[e]);return r}function Cx(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)}k.prototype.selectAll=function(t){return new k("string"==typeof t?this._parent.querySelectorAll(t):t,null,this._elements[0],this._document)},k.prototype.selectFacetAll=function(t){t="string"==typeof t?this._parent.querySelectorAll(t):t;return new k(this._elements,null,this._parent,this._document,void 0,void 0,t)},k.prototype.select=function(t){t="string"==typeof t?this._parent.querySelectorAll(t)[0]||null:t;return new k([t],null,t,this._document)},k.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=j(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 k(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 k(r,null,r[0],this._document)},k.prototype.maybeAppend=function(t,e){e=B(this,Nx,"m",jx).call(this,"#"===t[0]?t:"#".concat(t),e);return e.attr("id",t),e},k.prototype.maybeAppendByClassName=function(t,e){t=t.toString(),e=B(this,Nx,"m",jx).call(this,"."===t[0]?t:".".concat(t),e);return e.attr("className",t),e},k.prototype.maybeAppendByName=function(t,e){e=B(this,Nx,"m",jx).call(this,'[name="'.concat(t,'"]'),e);return e.attr("name",t),e},k.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]})),h=new Map(this._facetElements.map(function(t,e){return[n(t.__data__,e),t]})),f=Wd(this._elements,function(t){return e(t.__data__)}),d=0;d<t.length;d++){var p=t[d],g=n(p,d),y=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(h.has(g))(x=h.get(g)).__data__=p,x.__facet__=!0,o.push(x),h.delete(g);else if(f.has(g)){var m=f.get(g);l.push([p,m]);try{r=void 0;for(var v=I(m),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}}f.delete(g)}else u.has(y)?((x=u.get(y)).__toData__?x.__toData__.push(p):x.__toData__=[p],c.add(x),s.delete(x)):a.push(p)}var w=[new k([],a,this._parent,this._document),new k(o,null,this._parent,this._document),new k(s,null,this._parent,this._document),new k([],l,this._parent,this._document),new k(c,null,this._parent,this._document)];return new k(this._elements,null,this._parent,this._document,w)},k.prototype.merge=function(t){var e=M(M([],j(this._elements),!1),j(t._elements),!1),t=M(M([],j(this._transitions),!1),j(t._transitions),!1);return new k(e,null,this._parent,this._document,void 0,t)},k.prototype.createElement=function(t){if(this._document)return this._document.createElement(t,{});var e=k.registry[t];if(e)return new e;throw e="Unknown node type: ".concat(t),new Error(e)},k.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)},k.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 k([],null,this._parent,this._document,void 0,this._transitions)},k.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},k.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))})},k.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))})},k.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=j(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))})})},k.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))})},k.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))})},k.prototype.transition=function(n){var r=this._transitions;return this.each(function(t,e){r[e]=n.call(this,t,e)})},k.prototype.on=function(t,e){return this.each(function(){this.addEventListener(t,e)}),this},k.prototype.call=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return t.call.apply(t,M([this._parent,this],j(e),!1)),this},k.prototype.node=function(){return this._elements[0]},k.prototype.nodes=function(){return this._elements},k.prototype.transitions=function(){return this._transitions.filter(function(t){return!!t})},k.prototype.parent=function(){return this._parent},Nx=new WeakSet,jx=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 k([t],null,this._parent,this._document)},k.registry={g:rc,rect:kc,circle:Ul,path:gc,text:U2,ellipse:tc,image:cc,line:fc,polygon:vc,polyline:wc,html:oc};var Nx,jx,Rx=k;function k(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=[]),Nx.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 b(t){return new Rx([t],null,t,t.ownerDocument)}function Ix(t,e,n){return t.querySelector(e)?b(t).select(e):b(t).append(n)}function Bx(t){if(De(t))return[t,t,t,t];if(Te(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 Dx(t){var t=t.getLocalBounds(),t=j([t.min,t.max],2),e=j(t[0],2),n=e[0],e=e[1],t=j(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 Fx(t){return t.toString().charAt(0).toUpperCase()+t.toString().slice(1)}function zx(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 x(t,r,i){void 0===i&&(i=!1);var a={};return Object.entries(t).forEach(function(t){var e,t=j(t,2),n=t[0],t=t[1];"className"!==n&&"class"!==n&&(n.startsWith("show")&&zx(n,"show").startsWith(r)!==i?n===(e=r,"".concat("show").concat(Fx(e)))?a[n]=t:a[n.replace(new RegExp(Fx(r)),"")]=t:n.startsWith("show")||n.startsWith(r)===i||"filter"===(e=zx(n,r))&&"function"==typeof t||(a[e]=t))}),a}function Wx(t,r){return Object.entries(t).reduce(function(t,e){var e=j(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(Fx(n))]=e,t},{})}function Gx(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=j(t,2),e=t[0],t=t[1];n.includes(e)||(-1!==r.indexOf(e)?a[e]=t:i[e]=t)}),[i,a]}function Hx(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=j([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){}}t(Vx,Yx=Zl),Object.defineProperty(Vx.prototype,"offscreenGroup",{get:function(){return this._offscreen||(this._offscreen=q2(this)),this._offscreen},enumerable:!1,configurable:!0}),Object.defineProperty(Vx.prototype,"defaultOptions",{get:function(){return this._defaultOptions},enumerable:!1,configurable:!0}),Vx.prototype.connectedCallback=function(){this.render(this.attributes,this),this.bindEvents(this.attributes,this),this.initialized=!0},Vx.prototype.disconnectedCallback=function(){var t;null!=(t=this._offscreen)&&t.destroy()},Vx.prototype.attributeChangedCallback=function(t){"visibility"===t&&!function(){G2(this,"hidden"!==this.attributes.visibility)}.call(this)},Vx.prototype.update=function(t,e){return this.attr(nx({},this.attributes,t=void 0===t?{}:t)),null==(t=this.render)?void 0:t.call(this,this.attributes,this,e)},Vx.prototype.clear=function(){this.removeChildren()},Vx.prototype.bindEvents=function(t,e){};var Yx,Zo=Vx;function Vx(t,e){t=Yx.call(this,nx({},{style:e=void 0===e?{}:e},t))||this;return t.initialized=!1,t._defaultOptions=e,t}function qx(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 $x(t,e,n){return[["M",t,e+n],["L",t,e-n]]}function Ux(t,e,n){return[["M",t-n,e],["L",t+n,e]]}Jo=qx,bs=Ux;function Xx(t){n="default",Pe(e=t)&&e instanceof Image?n="image":Se(e)?n="symbol":Ie(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}t(Qx,Kx=Zo),Qx.prototype.render=function(t,e){var r=t.symbol,n=t.size,i=void 0===n?16:n,a=it(t,["symbol","size"]),o=Xx(r);dx(!!o,b(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=Se(r)?r:Qx.getSymbol(r),t.styles(m({path:null==n?void 0:n(0,0,e)},a)))})})},Qx.MARKER_SYMBOL_MAP=new Map,Qx.registerSymbol=function(t,e){Qx.MARKER_SYMBOL_MAP.set(t,e)},Qx.getSymbol=function(t){return Qx.MARKER_SYMBOL_MAP.get(t)};var Kx,Zx=Qx;function Qx(){return null!==Kx&&Kx.apply(this,arguments)||this}Zx.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]]}),Zx.registerSymbol("hyphen",function(t,e,n){return[["M",t-n,e],["L",t+n,e]]}),Zx.registerSymbol("line",$x),Zx.registerSymbol("plus",function(t,e,n){return[["M",t-n,e],["L",t+n,e],["M",t,e-n],["L",t,e+n]]}),Zx.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]]}),Zx.registerSymbol("circle",qx),Zx.registerSymbol("point",Jo),Zx.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"]]}),Zx.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"]]}),Zx.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"]]}),Zx.registerSymbol("diamond",function(t,e,n){return[["M",t-n,e],["L",t,e-n],["L",t+n,e],["L",t,e+n],["Z"]]}),Zx.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"]]}),Zx.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"]]}),Zx.registerSymbol("line",$x),Zx.registerSymbol("dot",Ux),Zx.registerSymbol("dash",bs),Zx.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]]}),Zx.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]]}),Zx.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]]}),Zx.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]]}),Zx.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]]});t(ew,Jx=Vl),ew.prototype.render=function(){var t=this.attributes.columns;b(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()})},ew.prototype.update=function(t){this.attr(nx({},this.attributes,t)),this.render()},ew.prototype.clear=function(){this.removeChildren()};var Jx,tw=ew;function ew(t){var e=this,n=t.style,t=it(t,["style"]);return(e=Jx.call(this,ot({},{type:"column"},m({style:n},t)))||this).columnsGroup=new rc({name:"columns"}),e.appendChild(e.columnsGroup),e.render(),e}t(iw,nw=Vl),iw.prototype.render=function(){var t=this.attributes,e=t.lines,t=t.areas;e&&this.renderLines(e),t&&this.renderAreas(t)},iw.prototype.clear=function(){this.linesGroup.removeChildren(),this.areasGroup.removeChildren()},iw.prototype.update=function(t){this.attr(nx({},this.attributes,t)),this.render()},iw.prototype.renderLines=function(t){b(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()})},iw.prototype.renderAreas=function(t){b(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 nw,rw=iw;function iw(t){var e=this,n=t.style,t=it(t,["style"]);return(e=nw.call(this,ot({},{type:"lines"},m({style:n},t)))||this).linesGroup=e.appendChild(new rc),e.areasGroup=e.appendChild(new rc),e.render(),e}function aw(t,e){var n=(e=void 0===e?!1:e)?t.length-1:0,t=t.map(function(t,e){return M([e===n?"M":"L"],j(t),!1)});return e?t.reverse():t}function ow(t,e){if(void 0===e&&(e=!1),t.length<=2)return aw(t);for(var n=[],r=t.length,i=0;i<r;i+=1){var a=e?t[r-i-1]:t[i];tn(a,n.slice(-2))||n.push.apply(n,M([],j(a),!1))}var o=Tx(n,!1);return e?o.unshift(M(["M"],j(t[r-1]),!1)):o.unshift(M(["M"],j(t[0]),!1)),o}function sw(t,e,n){t=$e(t);return t.push(["L",e,n],["L",0,n],["Z"]),t}function lw(t){return 0===t.length?[0,0]:[je(function(t,e){if(Te(t)){for(var n,r=1/0,i=0;i<t.length;i++){var a=t[i],o=Se(e)?e(a):a[e];o<r&&(n=a,r=o)}return n}}(t,function(t){return je(t)||0})),Ne(function(t,e){if(Te(t)){for(var n,r=-1/0,i=0;i<t.length;i++){var a=t[i],o=Se(e)?e(a):a[e];r<o&&(n=a,r=o)}return n}}(t,function(t){return Ne(t)||0}))]}function cw(t){for(var e=$e(t),n=e[0].length,t=j([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}t(fw,uw=Zo),Object.defineProperty(fw.prototype,"rawData",{get:function(){var t=this.attributes.data;return t&&0!==(null==t?void 0:t.length)?(t=$e(t),De(t[0])?[t]:t):[[]]},enumerable:!1,configurable:!0}),Object.defineProperty(fw.prototype,"data",{get:function(){return this.attributes.isStack?cw(this.rawData):this.rawData},enumerable:!1,configurable:!0}),Object.defineProperty(fw.prototype,"scales",{get:function(){return this.createScales(this.data)},enumerable:!1,configurable:!0}),Object.defineProperty(fw.prototype,"baseline",{get:function(){var t=this.scales.y,e=j(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(fw.prototype,"containerShape",{get:function(){var t=this.attributes;return{width:t.width,height:t.height}},enumerable:!1,configurable:!0}),Object.defineProperty(fw.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,h,f,d,p=x(this.attributes,"area"),g=x(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=j(s.getOptions().range||[0,0],2))[0],c=u[1],l<c&&(u=j([l,c],2),c=u[0],l=u[1]),a=e.map(function(t){return t.map(function(t,e){return[o.map(e),Be(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=ow(o),l=void 0,l=0===i?sw(s,e,n):(a=ow(t[i-1],!0),o=o[0],a[0][0]="L",M(M(M([],j(s),!1),j(a),!1),[M(["M"],j(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=aw(t[i]),s=void 0,s=0===i?sw(o,e,n):((a=aw(t[i-1],!0))[0][0]="L",M(M(M([],j(o),!1),j(a),!1),[["Z"]],!1));r.push(s)}return r})(a,t,e):(h=i,f=t,d=e,a.map(function(t){return sw((h?ow:aw)(t),f,d)}))),{lines:a.map(function(t,e){return m({stroke:n.getColor(e),path:(i?ow:aw)(t)},g)}),areas:u.map(function(t,e){return m({path:t,fill:n.getColor(e)},p)})})},enumerable:!1,configurable:!0}),Object.defineProperty(fw.prototype,"columnsStyle",{get:function(){var i=this,a=x(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=cw(s));var e=this.createScales(s),l=e.x,c=e.y,e=j(lw(s),2),n=e[0],e=e[1],u=new Wm({domain:[0,e-(0<n?0:n)],range:[0,t]}),h=l.getBandWidth(),f=this.rawData;return{columns:s.map(function(t,r){return t.map(function(t,e){var n=h/s.length;return m(m({fill:i.getColor(r)},a),o?{x:l.map(e),y:c.map(t),width:h,height:u.map(f[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}),fw.prototype.render=function(t,e){this.container=Ix(e,".container","rect").attr("className","container").node();var n=t.type,r="spark".concat(n),i="line"===n?this.linesStyle:this.columnsStyle;this.spark=Ix(e,".".concat(r),function(){return new("line"===n?rw:tw)({className:r,style:i})}).styles(i).node()},fw.prototype.getColor=function(t){var e=this.attributes.color;return Te(e)?e[t%e.length]:Se(e)?e.call(null,t):e},fw.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=j(lw(t),2),c=l[0],l=l[1],c=new Wm({domain:[null!=(e=i[0])?e:c,null!=(e=i[1])?e:l],range:[o,0]});return"line"===r?{type:r,x:new Wm({domain:[0,t[0].length-1],range:[0,s]}),y:c}:{type:r,x:new Tm({domain:t[0].map(function(t,e){return e}),range:[0,s],paddingInner:a?n:0}),y:c}},fw.tag="sparkline";var uw,hw=fw;function fw(t){return uw.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 dw(n){var e,r;return n?(e=["enter","update","exit"],r=Object.fromEntries(Object.entries(n).filter(function(t){t=j(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,m(m({},n[t]),r)]:[t,r]}))):{enter:!1,update:!1,exit:!1}}function pw(t,e){t?t.finished.then(e):e()}function gw(t,e){"update"in t?t.update(e):t.attr(e)}function yw(t,e,n){return 0===e.length?null:n?t.animate(e,n):(gw(t,{style:e.slice(-1)[0]}),null)}function mw(r,t,e){var i={},a={};return Object.entries(t).forEach(function(t){var e,t=j(t,2),n=t[0],t=t[1];A(t)||(e=r.style[n]||r.parsedStyle[n]||0)!==t&&(i[n]=e,a[n]=t)}),e?yw(r,[i,a],m({fill:"both"},e)):(gw(r,a),null)}function vw(t,e){return t.style.opacity||(t.style.opacity=1),mw(t,{opacity:0},e)}var bw,xw={fill:"#fff",lineWidth:1,radius:2,size:10,stroke:"#bfbfbf",strokeOpacity:1,zIndex:0},ww={fill:"#000",fillOpacity:.45,fontSize:12,textAlign:"center",textBaseline:"middle",zIndex:1},Mw={orientation:"horizontal",showLabel:!0,type:"start"},Ow=ex({foreground:"foreground",handle:"handle",selection:"selection",sparkline:"sparkline",sparklineGroup:"sparkline-group",track:"track"},"slider"),kw=ex({labelGroup:"label-group",label:"label",iconGroup:"icon-group",icon:"icon",iconRect:"icon-rect",iconLine:"icon-line"},"handle"),Ew=(t(Sw,bw=Zo),Sw.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=it(t,["size","radius","orientation"]),a=2.4*n,r=b(e).maybeAppendByClassName(kw.iconRect,"rect").styles(m(m({},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(kw.iconLine,"-1"),"line").styles(m({x1:o,x2:o,y1:l,y2:c},t)),r.maybeAppendByClassName("".concat(kw.iconLine,"-2"),"line").styles(m({x1:s,x2:s,y1:l,y2:c},t)),r.node().setOrigin(n/2,a/2),"vertical"===i?e.setLocalEulerAngles(90):e.setLocalEulerAngles(0)},Sw);function Sw(){return null!==bw&&bw.apply(this,arguments)||this}t(Tw,Aw=Zo),Tw.prototype.renderLabel=function(t){var e=this,n=this.attributes.showLabel,r=j(Gx(x(this.attributes,"label"),[]),2),i=r[0],r=r[1],t=b(t).maybeAppendByClassName(kw.labelGroup,"g").styles(r),r=m(m({},ww),i),a=r.text,o=it(r,["text"]);dx(!!n,t,function(t){e.label=t.maybeAppendByClassName(kw.label,"text").styles(m(m({},o),{text:"".concat(a)})),e.label.on("mousedown",function(t){t.stopPropagation()}),e.label.on("touchstart",function(t){t.stopPropagation()})})},Tw.prototype.renderIcon=function(t){var e=this.attributes.orientation,n=m(m({orientation:e},xw),x(this.attributes,"icon")),e=this.attributes.iconShape,r=void 0===e?function(){return new Ew({style:n})}:e;b(t).maybeAppendByClassName(kw.iconGroup,"g").selectAll(kw.icon.class).data([r]).join(function(t){return t.append(r).attr("className",kw.icon.name)},function(t){return t.update(n)},function(t){return t.remove()})},Tw.prototype.render=function(t,e){this.renderIcon(e),this.renderLabel(e)};var Aw,_w=Tw;function Tw(t){return Aw.call(this,t,Mw)||this}t(Cw,Pw=Zo),Object.defineProperty(Cw.prototype,"values",{get:function(){return this.attributes.values},set:function(t){this.attributes.values=this.clampValues(t)},enumerable:!1,configurable:!0}),Object.defineProperty(Cw.prototype,"sparklineStyle",{get:function(){var t;return"horizontal"!==this.attributes.orientation?null:(t=x(this.attributes,"sparkline"),m(m({zIndex:0},this.availableSpace),t))},enumerable:!1,configurable:!0}),Object.defineProperty(Cw.prototype,"shape",{get:function(){var t=this.attributes,e=t.trackLength,t=t.trackSize,t=j(this.getOrientVal([[e,t],[t,e]]),2);return{width:t[0],height:t[1]}},enumerable:!1,configurable:!0}),Object.defineProperty(Cw.prototype,"availableSpace",{get:function(){var t=j(Bx(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}),Cw.prototype.getValues=function(){return this.values},Cw.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;mw(this.selectionShape.node(),this.selectionStyle,t),this.updateHandlesPosition(t)},Cw.prototype.updateHandlesPosition=function(t){this.attributes.showHandle&&(mw(this.startHandle,this.getHandleStyle("start"),t),mw(this.endHandle,this.getHandleStyle("end"),t))},Cw.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)},Cw.prototype.renderTrack=function(t){var e=this.attributes.brushable,n=x(this.attributes,"track");this.trackShape=b(t).maybeAppendByClassName(Ow.track,"rect").styles(m(m({cursor:e?"crosshair":"default"},this.shape),n))},Cw.prototype.renderSparkline=function(t){var n=this;dx("horizontal"===this.attributes.orientation,b(t).maybeAppendByClassName(Ow.sparklineGroup,"g"),function(t){var e=n.sparklineStyle;t.maybeAppendByClassName(Ow.sparkline,function(){return new hw({style:e})}).update(e)})},Object.defineProperty(Cw.prototype,"selectionStyle",{get:function(){var t=x(this.attributes,"selection");return m(m({},t),this.calcMask())},enumerable:!1,configurable:!0}),Cw.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(Ow.handle.class).data(n,function(t){return t.type}).join(function(t){return t.append(function(t){t=t.type;return new _w({style:e.getHandleStyle(t)})}).each(function(t){var e=t.type,t=(this.attr("class","".concat(Ow.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()})},Cw.prototype.renderSelection=function(t){this.foregroundGroup=b(t).maybeAppendByClassName(Ow.foreground,"g"),this.selectionShape=this.foregroundGroup.maybeAppendByClassName(Ow.selection,"rect").styles(this.selectionStyle),this.renderHandles()},Cw.prototype.render=function(t,e){this.renderTrack(e),this.renderSparkline(e),this.renderSelection(e)},Cw.prototype.clampValues=function(t,e){void 0===e&&(e=4);var n=j(this.range,2),r=n[0],n=n[1],i=j(this.getValues().map(function(t){return Ax(t,e)}),2),a=i[0],i=i[1],t=j((t||[a,i]).map(function(t){return Ax(t,e)}),2),o=t[0],t=t[1],s=(t<o&&(o=(s=j([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]},Cw.prototype.calcMask=function(t){var t=j(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}])},Cw.prototype.calcHandlePosition=function(t){var e=this.availableSpace,n=e.x,r=e.y,i=e.width,e=e.height,a=j(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])}},Cw.prototype.calcHandleText=function(t){var e,n,r,i,a,o,s,l,c=this.attributes,u=c.orientation,h=c.formatter,c=c.autoFitLabel,f=x(this.attributes,"handle"),d=x(f,"label"),f=f.spacing,p=this.getHandleSize(),g=this.clampValues(),h=h("start"===t?g[0]:g[1]),g=new U2({style:m(m({},d),{text:h})}),d=g.getBBox(),y=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=f+p)+y/2,g="start"===t?0<r-s-y?-l:l:y<e-r-a-s?l:-l):(l=f+p,c="start"===t?d<i-p?-l:l:d<n-i-o-p?l:-l),{x:g,y:c,text:h}):(e=f+p+("horizontal"===u?y/2:0),(r={text:h})["horizontal"===u?"x":"y"]="start"===t?-e:e,r)},Cw.prototype.getHandleLabelStyle=function(t){var e;return this.attributes.showLabel?(e=x(this.attributes,"handleLabel"),m(m({},e),this.calcHandleText(t))):{}},Cw.prototype.getHandleIconStyle=function(){var t=this.attributes.handleIconShape,e=x(this.attributes,"handleIcon"),n=this.getOrientVal(["ew-resize","ns-resize"]),r=this.getHandleSize();return m({cursor:n,shape:t,size:r},e)},Cw.prototype.getHandleStyle=function(t){var e=this.attributes,n=e.showLabel,e=e.orientation,r=this.calcHandlePosition(t),i=this.calcHandleText(t);return m(m(m(m({},Wx(this.getHandleIconStyle(),"icon")),Wx(m(m({},this.getHandleLabelStyle(t)),i),"label")),r),{orientation:e,showLabel:n,type:t,zIndex:3})},Cw.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)},Cw.prototype.getOrientVal=function(t){var t=j(t,2),e=t[0],t=t[1];return"horizontal"===this.attributes.orientation?e:t},Cw.prototype.setValuesOffset=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=!1);var r=j(this.getValues(),2),t=[r[0]+t,r[1]+e].sort();n?this.setValues(t):this.innerSetValues(t,!0)},Cw.prototype.getRatio=function(t){var e=this.availableSpace,n=e.width,e=e.height;return t/this.getOrientVal([n,e])},Cw.prototype.dispatchCustomEvent=function(t,e,n){var r=this;t.on(e,function(t){t.stopPropagation(),r.dispatchEvent(new ll(n,{detail:t}))})},Cw.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"))},Cw.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))},Cw.tag="slider";var Pw,Lw=Cw;function Cw(t){var a=Pw.call(this,t,m(m(m({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]},Wx(Mw,"handle")),Wx(xw,"handleIcon")),Wx(ww,"handleLabel")))||this;return a.range=[0,1],a.onDragStart=function(i){return function(t){t.stopPropagation(),a.target=i,a.prevPos=a.getOrientVal(hx(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(hx(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 ll("valuechange",{detail:{oldValue:t,value:a.getValues()}});a.dispatchEvent(t)},a.selectionStartPos=0,a.selectionWidth=0,a.prevPos=0,a.target="",a}t(Rw,Nw=Zo),Object.defineProperty(Rw.prototype,"padding",{get:function(){return Bx(this.attributes.padding)},enumerable:!1,configurable:!0}),Object.defineProperty(Rw.prototype,"value",{get:function(){var t=this.attributes.value,e=j(this.range,2),n=e[0],e=e[1];return Be(t,n,e)},enumerable:!1,configurable:!0}),Object.defineProperty(Rw.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(Rw.prototype,"availableSpace",{get:function(){var t=this.attributes.trackSize,e=this.trackLength,n=j(this.padding,4),r=n[0],i=n[1],a=n[2],n=n[3],t=j(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(Rw.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(Rw.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}),Rw.prototype.getValues=function(t){void 0===t&&(t=this.value);var e=this.attributes,e=e.viewportLength/e.contentLength,n=j(this.range,2),r=n[0],t=t*(n[1]-r-e);return[t,t+e]},Rw.prototype.getValue=function(){return this.value},Rw.prototype.renderSlider=function(t){var e=this.attributes,n=e.orientation,r=e.trackSize,i=e.padding,e=e.slidable,a=x(this.attributes,"track"),o=x(this.attributes,"thumb"),s=m(m({brushable:!1,orientation:n,padding:i,selectionRadius:this.thumbRadius,showHandle:!1,slidable:e,trackLength:this.trackLength,trackRadius:this.trackRadius,trackSize:r,values:this.getValues()},Wx(a,"track")),Wx(o,"selection"));this.slider=b(t).maybeAppendByClassName("scrollbar",function(){return new Lw({style:s})}).update(s).node()},Rw.prototype.render=function(t,e){this.renderSlider(e)},Rw.prototype.setValue=function(t,e){void 0===e&&(e=!1);var n=this.attributes.value,r=j(this.range,2),i=r[0],r=r[1];this.slider.setValues(this.getValues(Be(t,i,r)),e),this.onValueChange(n)},Rw.prototype.bindEvents=function(){var e=this;this.slider.addEventListener("trackClick",function(t){t.stopPropagation(),e.onTrackClick(t.detail)}),this.onHover()},Rw.prototype.getOrientVal=function(t){return"horizontal"===this.attributes.orientation?t[0]:t[1]},Rw.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)},Rw.tag="scrollbar";var Nw,jw=Rw;function Rw(t){var a=Nw.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 ll("scroll",t={detail:{oldValue:t,value:e}})),a.dispatchEvent(new ll("valuechange",t)))},a.onTrackClick=function(t){var e,n,r,i;a.attributes.slidable&&(r=(e=j(a.getLocalPosition(),2))[0],e=e[1],n=(i=j(a.padding,4))[0],i=i[3],r=a.getOrientVal([r+i,e+n]),i=(a.getOrientVal(hx(t))-r)/a.trackLength,a.setValue(i,!0))},a.onThumbMouseenter=function(t){a.dispatchEvent(new ll("thumbMouseenter",{detail:t.detail}))},a.onTrackMouseenter=function(t){a.dispatchEvent(new ll("trackMouseenter",{detail:t.detail}))},a.onThumbMouseleave=function(t){a.dispatchEvent(new ll("thumbMouseleave",{detail:t.detail}))},a.onTrackMouseleave=function(t){a.dispatchEvent(new ll("trackMouseleave",{detail:t.detail}))},a}var Iw={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 gc({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:[]},Bw=(ot({},Iw,{style:{type:"arc"}}),ot({},Iw,{style:{}}),ex({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")),Dw=ex({lineGroup:"line-group",line:"line",regionGroup:"region-group",region:"region"},"grid");function Fw(t){return t.reduce(function(t,e,n){return t.push(M([0===n?"M":"L"],j(e),!1)),t},[])}function zw(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)?Fw(r):e?(i=Ex(r[0],e),a=n?0:1,r.reduce(function(t,e,n){return 0===n?t.push(M(["M"],j(e),!1)):t.push(M(["A",i,i,0,0,a],j(e),!1)),t},[])):[]):Fw(t)}function Ww(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=j([zw(t,n),zw(e.slice().reverse(),n,!0)],2),l=n[0],c=n[1],n=j([t[0],e.slice(-1)[0]],2),t=n[0],e=n[1];if("line"===a||"surround"===i)return r([M(["L"],j(e),!1)],[M(["L"],j(t),!1)]);if(o)return a=(n=j([Ex(e,o),Ex(t,o)],2))[0],i=n[1],r([M(["A",a,a,0,0,1],j(e),!1),M(["L"],j(e),!1)],[M(["A",i,i,0,0,0],j(t),!1),M(["L"],j(t),!1)]);throw new Error("Arc grid need to specified center")}function Gw(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=j([e[l].points,e[l+1].points],2),c=Ww(c[0],c[1],n);s.push({path:c,fill:o[l%o.length]})}return t.selectAll(Dw.region.class).data(s,function(t,e){return e}).join(function(t){return t.append("path").each(function(t,e){t=tx(t,[t,e,s]);this.attr(t)}).attr("className",Dw.region.name)},function(t){return t.transition(function(t,e){return mw(this,tx(t,[t,e,s]),r.update)})},function(t){return t.transition(function(){var t=this,e=vw(this,r.exit);return pw(e,function(){return t.remove()}),e})}).transitions()}t(Vw,Hw=Zo),Vw.prototype.render=function(t,e){t.type,t.center,t.areaFill,t.closed;var n,r,i,a,o=it(t,["type","center","areaFill","closed"]),s=(s=void 0===(s=t.data)?[]:s,t.closed?s.map(function(t){var e=t.points,n=j(e,1)[0];return m(m({},t),{points:M(M([],j(e),!1),[n],!1)})}):s),l=b(e).maybeAppendByClassName(Dw.lineGroup,"g"),e=b(e).maybeAppendByClassName(Dw.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:zw(t.points,n)}}),l.selectAll(Dw.line.class).data(a,function(t){return t.id}).join(function(t){return t.append("path").each(function(t,e){t=tx(Lx(m({path:t.path},r)),[t,e,a]);this.attr(m({class:Dw.line.name,stroke:"#D9D9D9",lineWidth:1,lineDash:[4,4]},t))})},function(t){return t.transition(function(t,e){return mw(this,tx(Lx(m({path:t.path},r)),[t,e,a]),i.update)})},function(t){return t.transition(function(){var t=this,e=vw(this,i.exit);return pw(e,function(){return t.remove()}),e})}).transitions()),l=Gw(e,s,t);return M(M([],j(o),!1),j(l),!1)};var Hw,Yw=Vw;function Vw(){return null!==Hw&&Hw.apply(this,arguments)||this}function qw(t,e){return Object.fromEntries(Object.entries(t).map(function(t){t=j(t,2);return[t[0],tx(t[1],e)]}))}function $w(t,e){return e&&Se(e)?t.filter(e):t}var Uw=Xe(function(t,e){var n=e.startAngle;return(e.endAngle-n)*t+n},function(t,e){return[t,e.startAngle,e.endAngle].join()}),Xw=Xe(function(t,e){var n,r,i;return"linear"===e.type?(r=(n=j(e.startPos,2))[0],n=n[1],i=j(e.endPos,2),Sx([(r=j([i[0]-r,i[1]-n],2))[0],r[1]])):(i=K2(Uw(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,M(M([],j(a),!1),j(r),!1)):(a=n.startAngle,r=n.endAngle,i=n.center,n=n.radius,M(M([a,r],j(i),!1),[n],!1));return"arc"===e.type&&a.push(t),a.join()});function Kw(t,e,n){t=Xw(t,n);return n=t,"positive"!==e?[n[1],-n[0]]:[-n[1],n[0]]}function Zw(t,e){return Kw(t,e.labelDirection,e)}var Qw=Xe(function(t,e){var n=j(e.startPos,2),r=n[0],n=n[1],e=j(e.endPos,2),e=j([e[0]-r,e[1]-n],2);return[r+e[0]*t,n+e[1]*t]},function(t,e){return M(M([t],j(e.startPos),!1),j(e.endPos),!1).join()}),Jw=Xe(function(t,e){var n=e.radius,r=j(e.center,2),i=r[0],r=r[1],t=K2(Uw(t,e));return[i+n*Math.cos(t),r+n*Math.sin(t)]},function(t,e){return M([t,e.startAngle,e.endAngle,e.radius],j(e.center),!1).join()});function tM(t,e){return("linear"===e.type?Qw:Jw)(t,e)}function eM(t){return 0===Xw(0,t)[1]}function nM(t){return 0===Xw(0,t)[0]}function rM(t,e){return e-t==360}function iM(t,e,n,r,i){function a(t){return[n+i*Math.cos(t),r+i*Math.sin(t)]}var o=e-t,s=j([i,i],2),l=s[0],s=s[1],c=j([K2(t),K2(e)],2),u=c[0],c=c[1],h=j(a(u),2),f=h[0],h=h[1],d=j(a(c),2),p=d[0],d=d[1];return rM(t,e)?[["M",f,h],["A",l,s,0,1,0,(c=j(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(f,",").concat(h,",A").concat(l,",").concat(s,",0,").concat(u,",").concat(c,",").concat(p,",").concat(d))}function aM(t,e,n,s){var l=e.startAngle,c=e.endAngle,u=e.center,h=e.radius;return t.selectAll(Bw.line.class).data([{path:iM.apply(void 0,M(M([l,c],j(u),!1),[h],!1))}],function(t,e){return e}).join(function(t){return t.append("path").attr("className",Bw.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=M(M([o,e],j(n),!1),[i],!1),e=M(M([l,c],j(u),!1),[h],!1),(n=s.update)?(i=void 0===(i=n.duration)?0:i,r=yx(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,m({fill:"both"},n))):(t.attr("__keyframe_data__",e),null));return o&&(o.onframe=i=function(){var t=en(a.attributes,"__keyframe_data__");a.style.path=iM.apply(void 0,M([],j(t),!1))},o.onfinish=i),o}).styles(e)},function(t){return t.remove()}).styles(n).transitions()}function oM(t){var t=j(t,2),e=j(t[0],2),n=e[0],e=e[1],t=j(t[1],2);return{x1:n,y1:e,x2:t[0],y2:t[1]}}function sM(e,t,n,r){function i(t){return e.selectAll(Bw.line.class).data(t,function(t,e){return e}).join(function(t){return t.append("line").attr("className",function(t){return"".concat(Bw.line.name," ").concat(t.className)}).styles(n).transition(function(t){return mw(this,oM(t.line),!1)})},function(t){return t.styles(n).transition(function(t){return mw(this,oM(t.line),r.update)})},function(t){return t.remove()}).transitions()}var a,o,s,l=t.showTrunc,c=t.startPos,u=t.endPos,h=t.truncRange,f=t.lineExtension,d=j([c,u],2),p=j(d[0],2),g=p[0],p=p[1],d=j(d[1],2),y=d[0],d=d[1],u=j(f?(c=j([c=c,u=u,f=void 0===(f=f)?[0,0]:f],3),f=(u=j(c[0],2))[0],u=u[1],m=(a=j(c[1],2))[0],a=a[1],v=(c=j(c[2],2))[0],c=c[1],f=(m=j([m-f,a-u],2))[0],a=m[1],u=Math.sqrt(Math.pow(f,2)+Math.pow(a,2)),v=(m=j([-v/u,c/u],2))[0],c=m[1],[v*f,v*a,c*f,c*a]):new Array(4).fill(0),4),m=u[0],v=u[1],f=u[2],c=u[3];return l&&h?(u=(a=j(h,2))[0],l=a[1],o=(u=j([g+(h=y-g)*u,p+(s=d-p)*u],2))[0],u=u[1],s=(h=j([g+h*l,p+s*l],2))[0],l=h[1],h=i([{line:[[g+m,p+v],[o,u]],className:Bw.lineFirst.name},{line:[[s,l],[y+f,d+c]],className:Bw.lineSecond.name}]),t.truncRange,t.truncShape,t.lineExtension,h):i([{line:[[g+m,p+v],[y+f,d+c]],className:Bw.line.name}])}function lM(t,e,n){var r,i,a,o,s,l=e.type,c=x(e,"line"),n=("linear"===l?sM:aM)(t,e,_x(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(Bw.lineSecond.class):t.select(Bw.line.class),!r||!a||"arc"===e.type&&rM(e.startAngle,e.endAngle)?(i=l.node())&&(i.style.markerEnd=void 0):((t=fx(a)).attr(c),Cx(t,s,!0),l.style("markerEnd",t).style("markerEndOffset",-o)),n}function cM(t){var e=t.type,n=t.gridCenter;return"linear"===e?n:n||t.center}function uM(t,i){var a=i.gridLength;return t.map(function(t,e){var t=t.value,n=j(tM(t,i),2),r=n[0],n=n[1],t=j(xx(Kw(t,i.gridDirection,i),a),2);return{id:e,points:[[r,n],[r+t[0],n+t[1]]]}})}function hM(t,e,n,r){var i=x(n,"grid"),a=i.type,o=i.areaFill,s=cM(n),l=$w(e,n.gridFilter),e=("segment"===a?uM:function(t,o){var s,l,c=o.gridControlAngles,e=cM(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=j(e,2),s=e[0],l=e[1],t.map(function(t,e){var t=j(tM(t.value,o),2),n=t[0],t=t[1],n=j([n-s,t-l],2),r=n[0],i=n[1],a=[];return c.forEach(function(t){var t=K2(t),t=j([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=m(m({},i),{center:s,areaFill:Se(o)?l.map(function(t,e){return tx(o,[t,e,l])}):o,animate:r,data:e});return t.selectAll(Bw.grid.class).data([1]).join(function(t){return t.append(function(){return new Yw({style:c})}).attr("className",Bw.grid.name)},function(t){return t.transition(function(){return this.update(c)})},function(t){return t.remove()}).transitions()}Object.defineProperty(dM.prototype,"left",{get:function(){return this.x1},enumerable:!1,configurable:!0}),Object.defineProperty(dM.prototype,"top",{get:function(){return this.y1},enumerable:!1,configurable:!0}),Object.defineProperty(dM.prototype,"right",{get:function(){return this.x2},enumerable:!1,configurable:!0}),Object.defineProperty(dM.prototype,"bottom",{get:function(){return this.y2},enumerable:!1,configurable:!0}),Object.defineProperty(dM.prototype,"width",{get:function(){return this.defined("x2")&&this.defined("x1")?this.x2-this.x1:void 0},enumerable:!1,configurable:!0}),Object.defineProperty(dM.prototype,"height",{get:function(){return this.defined("y2")&&this.defined("y1")?this.y2-this.y1:void 0},enumerable:!1,configurable:!0}),dM.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]]},dM.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},dM.prototype.defined=function(t){return this[t]!==Number.MAX_VALUE&&this[t]!==-Number.MAX_VALUE};var fM=dM;function dM(t,e,n,r){this.set(t,e,n,r)}function pM(t,e){var n=t.getEulerAngles()||0,r=(t.setEulerAngles(0),t.getLocalBounds()),i=j(r.min,2),a=i[0],i=i[1],r=j(r.max,2),o=r[0],r=r[1],s=gM(t),l=s.width,s=s.height,c=0,u=0,h=a,f=i,d=lx(t),o=(d&&(s-=1.5,"center"===(p=d.style.textAlign)?h=(a+o)/2:"right"!==p&&"end"!==p||(h=o),"middle"===(p=d.style.textBaseline)?f=(i+r)/2:"bottom"===p&&(f=r)),j(Bx(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 fM((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(K2(n),h,f)}function gM(t){return t.__bbox__||t.getBBox()}function yM(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 mM(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 vM(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,h=0;do{var f=[t[h],t[(h+1)%n]];if(i=c,l=s=o=a=void 0,a=mM((r=f)[0],r[1],i[0]),o=mM(r[0],r[1],i[1]),s=mM(i[0],i[1],r[0]),l=mM(i[0],i[1],r[1]),a!==o&&s!==l||0===a&&yM(r,i[0])||0===o&&yM(r,i[1])||0===s&&yM(i,r[0])||!(0!==l||!yM(i,r[1]))){if(0===mM(f[0],e,f[1]))return yM(f,e);u++}}while(0!==(h=(h+1)%n));return!!(1&u)}function bM(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=pM(e,n);return r=o,a.every(function(t){return vM(r,t)})}function xM(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=j(e=c,4))[0],r=e[1],i=e[2],e=e[3],a=(t=j(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 wM(t,e,l){function n(t,e){if(t){var n,r,i=Bx(l),t=pM(t,i).flat(1),a=pM(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=I(e),s=o.next();!s.done;s=o.next())if(xM(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,h,f,d,p,g,y=e.crossPadding,m=new Set,v=null,b=(y=y,f=(e=e).type,d=e.labelDirection,!!(p=e.crossSize)&&("arc"===f?(f=e.center,h=e.radius,u=(f=j(f,2))[0],f=f[1],a=-h-(d="negative"===d?0:p),h=h+d,o=(d=j(Bx(y),4))[0],s=d[1],c=d[2],d=d[3],new fM(u+a-d,f+a-o,u+h+s,f+h+c)):(a=(d=j(e.startPos,2))[0],o=d[1],s=(u=j(e.endPos,2))[0],f=u[1],c=(h=j(nM(e)?[-y,0,y,0]:[0,y,0,-y],4))[0],d=h[1],u=h[2],y=h[3],h=xx(Zw(0,e),p),(e=new fM(a,o,s,f)).x1+=y,e.y1+=c,e.x2+=d+h[0],e.y2+=u+h[1],e)));try{for(var x=I(t),w=x.next();!w.done;w=x.next()){var M=w.value;g=M,b&&!bM(b,g)?m.add(M):!v||n(v,M)?v=M:(m.add(v),m.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(m)}function MM(t,e){return void 0===e&&(e={}),A(t)?0:"number"==typeof t?t:Math.floor(ox(t,e))}var OM=function(t,e){var e=e.seq,n=void 0===e?2:e;return t.filter(function(t,e){return!(e%n&&(W2(t),1))})};var kM=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,h=OM,f=function(t){return t.forEach(r.show),t},d=2,p=t.slice(),g=t.slice(),y=Math.min.apply(Math,M([1],j(t.map(function(t){return gM(t).width})),!1));for("linear"===n.type&&(eM(n)||nM(n))&&(s=Dx(t[0]).left,l=Dx(t[i-1]).right,l=Math.abs(l-s)||1,d=Math.max(Math.floor(i*y/l),d)),a&&(c=p.splice(0,1)[0]),o&&(u=p.splice(-1,1)[0],p.reverse()),f(p);d<t.length&&wM((u?M(M([u],j(g),!1),[c],!1):M([c],j(g),!1)).filter(ax),n,null==e?void 0:e.margin).length;)(u&&!c&&d%2==0||u&&c)&&p.splice(0,1).forEach(r.hide),g=h(f(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=I(s),h=u.next();!h.done;h=u.next())if(i(h.value),wM(t,n,l).length<1)return}catch(t){a={error:t}}finally{try{h&&!h.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=sx(r.getTextShape(t[0])),c=MM(s,e),u=a?MM(a,e):c,s=MM(o,e),h=(!A(s)&&s!==1/0||(s=Math.max.apply(null,t.map(function(t){return gM(t).width}))),t.slice()),f=((a=j(l,4))[0],a[1],a[2],a[3],s);u+c<f;f-=c){var d=function(e){if(h.forEach(function(t){r.ellipsis(r.getTextShape(t),e,i)}),(h=wM(t,n,l)).length<1)return{value:void 0}}(f);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,h=void 0===(e=e.margin)?[0,0,0,0]:e,e=t.map(function(t){return t.attr("maxLines")||1}),f=Math.min.apply(Math,M([],j(e),!1)),d=(o=(a=n).type,s=a.labelDirection,"linear"===o&&eM(a)?"negative"===s?"bottom":"top":"middle");if(!(c<f)){for(var p=f;p<=c;p++)if(i(p),wM(t,n,h).length<1)return;u&&i(e)}}]]);function EM(r,i,a){var t=i.labelOverlap,t=void 0===t?[]:t;t.length&&t.forEach(function(t){var e=t.type,n=kM.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 SM(t){for(var e=t;e<0;)e+=360;return Math.round(e%360)}var AM=Xe(function(t,e){var t=j(t,2),n=t[0],t=t[1],e=j(e,2),r=e[0],e=e[1],n=j([n*r+t*e,n*e-t*r],2),e=n[0],t=n[1];return Math.atan2(t,e)},function(t,e){return M(M([],j(t),!1),j(e),!1).join()});function _M(t,e,n){var r,i=n.labelAlign;return(null==(r=e.style.transform)?void 0:r.includes("rotate"))?e.getLocalEulerAngles():(r=0,e=Zw(t.value,n),t=Xw(t.value,n),"horizontal"===i?0:(r="perpendicular"===i?AM([1,0],e):AM([t[0]<0?-1:1,0],t),px(n=((n=Z2(r))+360)%180,-90,90)||(n+=180),n))}function TM(t,e,n){var r=n.type,i=n.labelAlign,t=Zw(t,n),n=SM(e),e=SM(Z2(AM([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?(px(n,0,90,!1,!0)||px(n,0,90)||px(n,270,360))&&(a="start"):90===e?px(n,0,90,!1,!0)?a="start":(px(n,90,180)||px(n,270,360))&&(a="end"):270===e?px(n,0,90,!1,!0)?a="end":(px(n,90,180)||px(n,270,360))&&(a="start"):180===e&&(90===n?a="start":(px(n,0,90)||px(n,270,360))&&(a="end")):a="center":"parallel"===i?o=px(e,0,180,!0)?"top":"bottom":"horizontal"===i?px(e,90,270,!1)?a="end":(px(e,270,360,!1)||px(e,0,90))&&(a="start"):"perpendicular"===i&&(a=px(e,90,270)?"end":"start"),{textAlign:a,textBaseline:o}}function PM(t,e,n){var r=n.showTick,i=n.tickLength,a=n.tickDirection,o=n.labelDirection,s=n.labelSpacing,l=e.indexOf(t),s=tx(s,[t,l,e]),o=j([Zw(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=j(wx(xx(o[0],s+(1===o[1]?tx(r?i:0,[t,l,e]):0)),tM(t.value,n)),2);return{x:a[0],y:a[1]}}function LM(t,e){"text"===t.nodeName&&t.attr(e)}function CM(r){EM(this.node().childNodes,r,{hide:W2,show:z2,rotate:function(t,e){var n;e=+e,n=r,(t=t).setLocalEulerAngles(e),e=TM(t.__data__.value,e,n),(n=t.querySelector(Bw.labelItem.class))&&LM(n,e)},ellipsis:function(t,e,n){void 0===e&&(e=1/0),t&&ux(t,e,n)},wrap:function(t,e,n){var r;t&&cx(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 NM(t,e,n,r,i){var a,o,s,l,c,u=n.indexOf(e),h=b(t).append((a=e,o=u,s=n,c=(l=i).labelFormatter,Se(c)?function(){return fx(tx(c,[a,o,s,Zw(a.value,l)]))}:function(){return fx(a.label||"")})).attr("className",Bw.labelItem.name).node(),r=j(Gx(qw(r,[e,u,n])),2),u=r[0],n=r[1],r=n.transform,n=it(n,["transform"]),f=(Hx(t,r),_M(e,t,i));return t.setLocalEulerAngles(+f),LM(h,m(m({},TM(e.value,f,i)),u)),Hx(t,r),t.attr(n),h}function jM(n,f,d,p){var t=$w(f,d.labelFilter),g=x(d,"label");return n.selectAll(Bw.label.class).data(t,function(t,e){return e}).join(function(t){return t.append("g").attr("className",Bw.label.name).transition(function(t){return NM(this,t,f,g,d),this.attr(PM(t,f,d)),this.__bbox__=t.bbox,null}).call(function(){return CM.call(n,d)})},function(t){return t.transition(function(t){var e,n,r,i,a,o,s,l=this.querySelector(Bw.labelItem.class),c=NM(this,t,f,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=j((s=function(t){var e,n;return"circle"===t.nodeName?(n=(e=j(t.getLocalPosition(),2))[0],e=e[1],[n-(n=t.attr("r")),e-n]):t.getLocalPosition()})(e),2))[0],u=u[1],s=j(s(n),2),s=(o=j([(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,")")}],m(m({fill:"both"},l),{duration:i+a+c})),pw(s=n.animate([{opacity:0,transform:"translate(".concat(-s,", ").concat(-u,")"),offset:.01},{opacity:1,transform:"translate(0, 0)"}],m(m({fill:"both"},l),{duration:a+c,delay:i+a-c})),h),[o,s]):(h(),[null]));function h(){"destroy"===r?e.destroy():"hide"===r&&W2(e),n.isVisible()&&z2(n)}l=mw(this,PM(t,f,d),p.update);return this.__bbox__=t.bbox,M(M([],j(u),!1),[l],!1)}).call(function(t){var e,t=en(t,"_transitions").flat().filter(ax);e=function(){return CM.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=vw(this,p.exit);return pw(e,function(){return b(t).remove()}),e})}).transitions()}function RM(t,e){return Kw(t,e.tickDirection,e)}var IM=Xe(function(t,e){t=j(t,2);return[[0,0],[t[0]*e,t[1]*e]]},function(t,e){return M(M([],j(t),!1),[e],!1).join()});function BM(t,e,n,r,i,a,o){var s=RM(t.value,a),a=(c=t,u=e,h=n,l=s,a=(a=a).tickLength,l=j(IM(l,tx(a,[c,u,h])),2),a=j(l[0],2),c=a[0],u=a[1],h=j(l[1],2),{x1:c,x2:h[0],y1:u,y2:h[1]}),l=a.x1,c=a.x2,u=a.y1,h=a.y2,a=j(Gx(qw(o,[t,e,n,s])),2),o=a[0],t=a[1];"line"===r.node().nodeName&&r.styles(m({x1:l,x2:c,y1:u,y2:h},o)),i.attr(t),r.styles(o)}function DM(t,e,n,r,i,a){o=b(this),s=t,l=e,c=n,h=(u=r).tickFormatter,f=RM(s.value,u),u="line",Se(h)&&(u=function(){return tx(h,[s,l,c,f])});BM(t,e,n,o.append(u).attr("className",Bw.tickItem.name),this,r,i);var o,s,l,c,u,h,f,e=j(tM(t.value,r),2);return mw(this,{x:e[0],y:e[1]},a)}var FM=ex({text:"text"},"title");function zM(t){return/\S+-\S+/g.test(t)?t.split("-").map(function(t){return t[0]}):2<t.length?[t[0]]:t.split("")}function WM(r,t){t=Object.entries(t).reduce(function(t,e){var e=j(e,2),n=e[0],e=e[1];return r.node().attr(n)||(t[n]=e),t},{});r.styles(t)}t(YM,GM=Zo),YM.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(FM.text.class);if(!a)return new Q2(0,0,+r,+i);var a=a.getBBox(),o=a.width,s=a.height,a=j(Bx(n),4),l=a[0],c=a[1],u=a[2],h=a[3],n=j([0,0,+r,+i],4),f=n[0],d=n[1],p=n[2],g=n[3],a=zM(e);if(a.includes("i"))return new Q2(f,d,p,g);a.forEach(function(t,e){var n;"t"===t&&(n=j(0===e?[s+u,+i-s-u]:[0,+i],2),d=n[0],g=n[1]),"r"===t&&(n=j([+r-o-h],1),p=n[0]),"b"===t&&(n=j([+i-s-l],1),g=n[0]),"l"===t&&(n=j(0===e?[o+c,+r-o-c]:[0,+r],2),f=n[0],p=n[1])});n=j(Bx(t),4),e=n[0],a=n[1],t=n[2],n=n[3],a=j([n+a,e+t],2),t=a[0],a=a[1];return new Q2(f+n,d+e,p-t,g-a)},YM.prototype.getBBox=function(){return this.title?this.title.getBBox():new Q2(0,0,0,0)},YM.prototype.render=function(t,e){var n,r,i,a,o,s,l=this,c=(t.width,t.height,t.position,t.spacing,it(t,["width","height","position","spacing"])),u=j(Gx(c),1)[0],h=(h=(t=t).width,r=t.height,t=t.position,i=j([+h/2,+r/2],2),a=(i=j([+i[0],+i[1],"center","middle"],4))[0],o=i[1],s=i[2],i=i[3],(t=zM(t)).includes("l")&&(a=(n=j([0,"start"],2))[0],s=n[1]),t.includes("r")&&(a=(n=j([+h,"end"],2))[0],s=n[1]),t.includes("t")&&(o=(h=j([0,"top"],2))[0],i=h[1]),t.includes("b")&&(o=(n=j([+r,"bottom"],2))[0],i=n[1]),{x:a,y:o,textAlign:s,textBaseline:i}),f=h.x,d=h.y,p=h.textAlign,g=h.textBaseline;dx(!!c.text,b(e),function(t){l.title=t.maybeAppendByClassName(FM.text,"text").styles(u).call(WM,{x:f,y:d,textAlign:p,textBaseline:g}).node()})};var GM,HM=YM;function YM(t){return GM.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 VM(t,e,n,r,i){var a,o,s,l,c,u,h,f,d=j(Gx(x(r,"title")),2),p=d[0],d=d[1],g=d.transform,g=void 0===g?"":g,d=it(d,["transform"]),y=(t.styles(p),e.styles(d),Hx(t.node(),g),p=b(n._offscreen||n.querySelector(Bw.mainGroup.class)),d=e,r=void 0===(r=(n=r).titlePosition)?"lb":r,a=n.titleSpacing,o=zM(r),p=p.node().getLocalBounds(),s=(l=j(p.min,2))[0],l=l[1],c=(p=j(p.halfExtents,2))[0],p=p[1],u=(d=j(d.node().getLocalBounds().halfExtents,2))[0],d=d[1],l=(s=j([s+c,l+p],2))[0],s=s[1],m=(a=j(Bx(a),4))[0],h=a[1],f=a[2],a=a[3],["start","end"].includes(r)&&"linear"===n.type?(y=n.startPos,n=n.endPos,n=(r=j("start"===r?[y,n]:[n,y],2))[0],y=(r=j(xx(Sx([-(y=r[1])[0]+n[0],-y[1]+n[1]]),m),2))[0],r=r[1],{x:n[0]+y,y:n[1]+r}):(o.includes("t")&&(s-=p+d+m),o.includes("r")&&(l+=c+u+h),o.includes("l")&&(l-=c+u+a),o.includes("b")&&(s+=p+d+f),{x:l,y:s})),n=y.x,r=y.y,m=mw(e.node(),{x:n,y:r},i);return Hx(t.node(),g),m}function qM(e,t,o,s){var n=e.showLine,r=e.showTick,i=e.showLabel,n=dx(n,t.maybeAppendByClassName(Bw.lineGroup,"g"),function(t){return lM(t,e,s)})||[],r=dx(r,t.maybeAppendByClassName(Bw.tickGroup,"g"),function(t){return t=t,r=s,i=$w(o,(n=e).tickFilter),a=x(n,"tick"),t.selectAll(Bw.tick.class).data(i,function(t){return t.id||t.label}).join(function(t){return t.append("g").attr("className",Bw.tick.name).transition(function(t,e){return DM.call(this,t,e,i,n,a,!1)})},function(t){return t.transition(function(t,e){return this.removeChildren(),DM.call(this,t,e,i,n,a,r.update)})},function(t){return t.transition(function(){var t=this,e=vw(this,r.exit);return pw(e,function(){return t.remove()}),e})}).transitions();var n,r,i,a})||[],i=dx(i,t.maybeAppendByClassName(Bw.labelGroup,"g"),function(t){return jM(t,o,e,s)})||[];return M(M(M([],j(n),!1),j(r),!1),j(i),!1).filter(function(t){return!!t})}t(XM,$M=Zo),XM.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,h=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])}),f=dw(void 0===e?i:e),r=dx(l,b(t).maybeAppendByClassName(Bw.gridGroup,"g"),function(t){return hM(t,h,o,f)})||[],c=b(t).maybeAppendByClassName(Bw.mainGroup,"g"),i=(n&&(!this.initialized&&f.enter||this.initialized&&f.update)&&qM(o,b(this.offscreenGroup),h,dw(!1)),qM(o,b(c.node()),h,f)),e=dx(a,b(t).maybeAppendByClassName(Bw.titleGroup,"g"),function(t){return e=t,n=s,i=f,a=(r=o).titleText,e.selectAll(Bw.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 fx(a)}).attr("className",Bw.title.name).transition(function(){return VM(b(this),e,n,r,i.enter)})},function(t){return t.transition(function(){return VM(b(this),e,n,r,i.update)})},function(t){return t.remove()}).transitions();var e,n,r,i,a})||[];return M(M(M([],j(r),!1),j(i),!1),j(e),!1).flat().filter(function(t){return!!t})};var $M,UM=XM;function XM(t){return $M.call(this,t,Iw)||this}var KM,ZM=ex({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"),QM=(t(JM,KM=Zo),Object.defineProperty(JM.prototype,"defaultPage",{get:function(){var t=this.attributes.defaultPage;return Be(t,0,Math.max(this.pageViews.length-1,0))},enumerable:!1,configurable:!0}),Object.defineProperty(JM.prototype,"pageViews",{get:function(){return this.playWindow.children},enumerable:!1,configurable:!0}),Object.defineProperty(JM.prototype,"controllerShape",{get:function(){return 1<this.totalPages?{width:55,height:0}:{width:0,height:0}},enumerable:!1,configurable:!0}),Object.defineProperty(JM.prototype,"pageShape",{get:function(){var n,t=this.pageViews,t=j((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,M([],j(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}),JM.prototype.getContainer=function(){return this.playWindow},Object.defineProperty(JM.prototype,"totalPages",{get:function(){return this.pageViews.length},enumerable:!1,configurable:!0}),Object.defineProperty(JM.prototype,"currPage",{get:function(){return this.innerCurrPage},enumerable:!1,configurable:!0}),JM.prototype.getBBox=function(){var t=KM.prototype.getBBox.call(this),e=t.x,t=t.y,n=this.controllerShape,r=this.pageShape,i=r.pageWidth,r=r.pageHeight;return new Q2(e,t,i+n.width,r)},JM.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=j(this.getFollowingPageDiff(t),2),o=i[0],r=i[1],this.playState="running",i=yw(a,[{transform:"translate(0, 0)"},{transform:"translate(".concat(-o,", ").concat(-r,")")}],n);return pw(i,function(){e.innerCurrPage=t,e.playState="idle",e.setVisiblePages([t]),e.updatePageInfo()}),i},JM.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:Be(n-1,0,e),this.goTo(t))},JM.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:Be(n+1,0,e),this.goTo(t))},JM.prototype.renderClipPath=function(t){var e=this.pageShape,n=e.pageWidth,e=e.pageHeight;n&&e?(this.clipPath=t.maybeAppendByClassName(ZM.clipPath,"rect").styles({width:n,height:e}),this.contentGroup.attr("clipPath",this.clipPath.node())):this.contentGroup.style.clipPath=void 0},JM.prototype.setVisiblePages=function(n){this.playWindow.children.forEach(function(t,e){(n.includes(e)?z2:W2)(t)})},JM.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,j("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=j(i.offset,3),o=j(a[0],2),s=o[0],c=o[1],l=j(a[1],2),r=l[0],o=l[1],l=j(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)},JM.prototype.updatePageInfo=function(){var t,e=this.currPage,n=this.pageViews,r=this.attributes.formatter;n.length<2||(null!=(t=this.pageInfoGroup.querySelector(ZM.pageInfo.class))&&t.attr("text",r(e+1,n.length)),this.adjustControllerLayout())},JM.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])},JM.prototype.prepareFollowingPage=function(t){var e,n=this.currPage,r=this.pageViews;this.setVisiblePages([t,n]),t!==n&&(e=(n=j(this.getFollowingPageDiff(t),2))[0],n=n[1],r[t].setLocalPosition(e,n))},JM.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(ZM.controller,"g");G2(t.node(),u),u&&(u=x(this.attributes,"button"),e=x(this.attributes,"pageNum"),i=(u=j(Gx(u),2))[0],u=u[1],n=i.size,r=it(i,["size"]),i=!t.select(ZM.prevBtnGroup.class).node(),a=t.maybeAppendByClassName(ZM.prevBtnGroup,"g").styles(u),this.prevBtnGroup=a.node(),a=a.maybeAppendByClassName(ZM.prevBtn,"path"),u=t.maybeAppendByClassName(ZM.nextBtnGroup,"g").styles(u),this.nextBtnGroup=u.node(),[a,u.maybeAppendByClassName(ZM.nextBtn,"path")].forEach(function(t){t.styles(m(m({},r),{transformOrigin:"center"})),Cx(t.node(),n,!0)}),a=t.maybeAppendByClassName(ZM.pageInfoGroup,"g"),this.pageInfoGroup=a.node(),a.maybeAppendByClassName(ZM.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()}))},JM.prototype.render=function(t,e){e=b(e);this.renderClipPath(e),this.renderController(e),this.setVisiblePages([this.defaultPage]),this.goTo(this.defaultPage)},JM.prototype.bindEvents=function(){var t=this,e=Ue(function(){return t.render(t.attributes,t)},50);this.playWindow.addEventListener(v.INSERTED,e),this.playWindow.addEventListener(v.REMOVED,e)},JM);function JM(t){var e,n,t=KM.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 rc({class:ZM.contentGroup.name})),t.playWindow=t.contentGroup.appendChild(new rc({class:ZM.playWindow.name})),t.innerCurrPage=t.defaultPage,t}function t5(t,e,n){return"horizontal"===(t=void 0===t?"horizontal":t)?e:n}Zx.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"]]}),Zx.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]]}),Zx.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 e5=ex({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");t(i5,n5=Zo),Object.defineProperty(i5.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(i5.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(i5.prototype,"span",{get:function(){var t,e=this.attributes.span;return e?(t=(e=j(Bx(e),2))[0],e=e[1],[t/(e=t+(t=this.showValue?e:0)),t/e]):[1,1]},enumerable:!1,configurable:!0}),Object.defineProperty(i5.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=j(this.spacing,2),s=o[0],o=o[1];return t&&(t=t-e-s-o,e=j(this.span,2),a=(e=j([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(i5.prototype,"spacing",{get:function(){var t,e=this.attributes.spacing;return e?(t=(e=j(Bx(e),2))[0],e=e[1],this.showValue?[t,e]:[t,0]):[0,0]},enumerable:!1,configurable:!0}),Object.defineProperty(i5.prototype,"layout",{get:function(){var t=this.shape,e=t.markerWidth,n=t.labelWidth,r=t.valueWidth,i=t.width,t=t.height,a=j(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(i5.prototype,"scaleSize",{get:function(){var t=(t=(t=this.markerGroup.node()).querySelector(e5.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}),i5.prototype.renderMarker=function(t){var e=this,n=this.attributes.marker,r=x(this.attributes,"marker");this.markerGroup=t.maybeAppendByClassName(e5.markerGroup,"g").style("zIndex",0),dx(!!n,this.markerGroup,function(){e.markerGroup.maybeAppendByClassName(e5.marker,n).styles(r),e.markerGroup.node().scale(1/e.markerGroup.node().getScale()[0]),Cx(e.markerGroup.node(),e.scaleSize,!0)})},i5.prototype.renderLabel=function(t){var e=x(this.attributes,"label"),n=e.text,e=it(e,["text"]);this.labelGroup=t.maybeAppendByClassName(e5.labelGroup,"g").style("zIndex",0),this.labelGroup.maybeAppendByClassName(e5.label,function(){return fx(n)}).styles(e)},i5.prototype.renderValue=function(t){var e=this,n=x(this.attributes,"value"),r=n.text,i=it(n,["text"]);this.valueGroup=t.maybeAppendByClassName(e5.valueGroup,"g").style("zIndex",0),dx(this.showValue,this.valueGroup,function(){e.valueGroup.maybeAppendByClassName(e5.value,function(){return fx(r)}).styles(i)})},i5.prototype.renderBackground=function(t){var e=this.shape,n=e.width,e=e.height,r=x(this.attributes,"background");this.background=t.maybeAppendByClassName(e5.backgroundGroup,"g").style("zIndex",-1),this.background.maybeAppendByClassName(e5.background,"rect").styles(m({width:n,height:e},r))},i5.prototype.adjustLayout=function(){var t=this.layout,e=t.labelWidth,n=t.valueWidth,r=t.height,t=j(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}),ux(this.labelGroup.select(e5.label.class).node(),Math.ceil(e)),this.showValue&&(this.valueGroup.styles({x:t,y:r}),ux(this.valueGroup.select(e5.value.class).node(),Math.ceil(n)))},i5.prototype.render=function(t,e){e=b(e);this.renderMarker(e),this.renderLabel(e),this.renderValue(e),this.renderBackground(e),this.adjustLayout()};var n5,r5=i5;function i5(t){return n5.call(this,t,{span:[1,1],marker:function(){return new Ul({style:{r:6}})},markerSize:10,labelFill:"#646464",valueFill:"#646464",labelFontSize:12,valueFontSize:12,labelTextBaseline:"middle",valueTextBaseline:"middle"})||this}function a5(t,e,n){return void 0===n&&(n=!0),t?e(t):n}var o5,s5=ex({page:"item-page",navigator:"navigator",item:"item"},"items"),l5=(t(c5,o5=Zo),Object.defineProperty(c5.prototype,"pageViews",{get:function(){return this.navigator.getContainer()},enumerable:!1,configurable:!0}),Object.defineProperty(c5.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(c5.prototype,"renderData",{get:function(){var t=this.attributes,a=t.data,o=t.layout,s=x(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:m({layout:o,labelText:r,valueText:i},Object.fromEntries(Object.entries(s).map(function(t){t=j(t,2);return[t[0],tx(t[1],[e,n,a])]})))}})},enumerable:!1,configurable:!0}),c5.prototype.getGridLayout=function(){var u=this,t=this.attributes,h=t.orientation,f=t.width,d=t.rowPadding,p=t.colPadding,g=j(this.navigatorShape,1)[0],t=j(this.grid,2),y=t[0],m=t[1],v=m*y,b=0;return this.pageViews.children.map(function(t,e){var n,r=Math.floor(e/v),i=e%v,a=u.ifHorizontal(m,y),a=[Math.floor(i/a),i%a],a=("vertical"===h&&a.reverse(),j(a,2)),o=a[0],a=a[1],s=(f-g-(m-1)*p)/m,t=t.getBBox().height,l=j([0,0],2),c=l[0],l=l[1];return b="horizontal"===h?(c=(n=j([b,o*(t+d)],2))[0],l=n[1],a===m-1?0:b+s+p):(c=(n=j([a*(s+p),b],2))[0],l=n[1],o===y-1?0:b+t+d),{page:r,index:e,row:o,col:a,pageIndex:i,width:s,height:t,x:c,y:l}})},c5.prototype.getFlexLayout=function(){var t=this.attributes,e=t.width,n=t.height,a=t.rowPadding,o=t.colPadding,t=j(this.navigatorShape,1)[0],r=j(this.grid,2),s=r[0],l=r[1],r=j([e-t,n],2),c=r[0],u=r[1],e=j([0,0,0,0,0,0,0,0],8),h=e[0],f=e[1],d=e[2],p=e[3],g=e[4],y=e[5],m=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===m?0:o,i=m+r+n;return i<=c&&a5(g,function(t){return t<l})?(r=j([m+r,v,i],3),h=r[0],f=r[1],m=r[2]):(i=j([y+1,0,0,v+t+a],4),y=i[0],g=i[1],m=i[2],(v=i[3])+a+t<=u&&a5(y,function(t){return t<s})?(r=j([m,v,n],3),h=r[0],f=r[1],m=r[2]):(i=j([0,0,n,0,d+1,0,0,0],8),h=i[0],f=i[1],m=i[2],v=i[3],d=i[4],p=i[5],y=i[6],g=i[7])),{width:n,height:t,x:h,y:f,page:d,index:e,pageIndex:p++,row:y,col:g++}})},Object.defineProperty(c5.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}),c5.prototype.ifHorizontal=function(t,e){return t5(this.attributes.orientation,t,e)},c5.prototype.flattenPage=function(e){e.querySelectorAll(s5.item.class).forEach(function(t){e.appendChild(t)}),e.querySelectorAll(s5.page.class).forEach(function(t){e.removeChild(t).destroy()})},c5.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));b(t).selectAll(s5.item.class).data(this.renderData,function(t){return t.id}).join(function(t){return t.append(function(t){t=t.style;return new r5({style:t})}).attr("className",s5.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()})},c5.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=j(this.navigatorShape,2),i=r[0],r=r[1];this.navigator.update("grid"===e?{pageWidth:t-i,pageHeight:n-r}:{})},c5.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=j(t,2);return{page:t[0],layouts:t[1]}}),u=M([],j(this.navigator.getContainer().children),!1);t.forEach(function(t){var t=t.layouts,c=e.pageViews.appendChild(new rc({className:s5.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=Ie(t="__layout__")?t.split("."):t).forEach(function(t,e){e<i.length-1?(Pe(r[t])||(r[t]=De(i[e+1])?[]:{}),r=r[t]):r[t]=n}),o.update({x:e,y:a,width:s,height:l})})}),this.relayoutNavigator()},c5.prototype.renderNavigator=function(t){var e=this.attributes.orientation,n=x(this.attributes,"nav"),r=nx({orientation:e},n),i=this;return t.selectAll(s5.navigator.class).data(["nav"]).join(function(t){return t.append(function(){return new QM({style:r})}).attr("className",s5.navigator.name).each(function(){i.navigator=this})},function(t){return t.each(function(){this.update(r)})},function(t){return t.remove()}),this.navigator},c5.prototype.getBBox=function(){return this.navigator.getBBox()},c5.prototype.render=function(t,e){var n=this.attributes.data;n&&0!==n.length&&(n=this.renderNavigator(b(e)),this.renderItems(n.getContainer()),this.adjustLayout())},c5.prototype.dispatchCustomEvent=function(t,e){t=new ll(t,{detail:e});this.dispatchEvent(t)},c5);function c5(t){t=o5.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:Je,mouseenter:Je,mouseleave:Je})||this;return t.navigatorShape=[0,0],t}var u5,h5=ex({markerGroup:"marker-group",marker:"marker",labelGroup:"label-group",label:"label"},"handle"),f5={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},d5=(t(p5,u5=Zo),p5.prototype.render=function(t,e){var n=b(e).maybeAppendByClassName(h5.markerGroup,"g"),n=(this.renderMarker(n),b(e).maybeAppendByClassName(h5.labelGroup,"g"));this.renderLabel(n)},p5.prototype.renderMarker=function(t){var r=this,e=this.attributes,n=e.orientation,e=e.markerSymbol,i=void 0===e?t5(n,"horizontalHandle","verticalHandle"):e;dx(!!i,t,function(t){var e=x(r.attributes,"marker"),n=m({symbol:i},e);r.marker=t.maybeAppendByClassName(h5.marker,function(){return new Zx({style:n})}).update(n)})},p5.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;dx(n,t,function(t){var e=x(s.attributes,"label"),n=e.text,e=it(e,["text"]),r=(null==(r=t.select(h5.marker.class))?void 0:r.node().getBBox())||{},i=r.width,r=r.height,r=j(t5(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(h5.label,"text").styles(m(m({},e),{x:i,y:a,text:u(n).toString(),textAlign:o,textBaseline:r}))})},p5);function p5(t){return u5.call(this,t,f5)||this}var g5,Ns={showTitle:!0,padding:0,orientation:"horizontal",backgroundFill:"transparent",titleText:"",titleSpacing:4,titlePosition:"top-left",titleFill:"#2C3542",titleFontWeight:"bold",titleFontFamily:"sans-serif",titleFontSize:12},y5=nx({},Ns,{}),m5=nx({},Ns,Wx(f5,"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"}),v5=ex({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"),b5=(t(x5,g5=Zo),x5.prototype.renderTitle=function(t,e,n){var r=this.attributes,i=r.showTitle,r=r.titleText,a=j(Gx(x(this.attributes,"title")),2),o=a[0],a=a[1],s=(this.titleGroup=t.maybeAppendByClassName(v5.titleGroup,"g").styles(a),m(m({width:e,height:n},o),{text:i?r:""}));this.title=this.titleGroup.maybeAppendByClassName(v5.title,function(){return new HM({style:s})}).update(s)},x5.prototype.renderItems=function(t,e){var n=e.x,r=e.y,i=e.width,e=e.height,a=j(Gx(x(this.attributes,"title",!0)),2),o=a[0],a=a[1],s=m(m({},o),{width:i,height:e,x:0,y:0}),l=(this.itemsGroup=t.maybeAppendByClassName(v5.itemsGroup,"g").styles(m({x:n,y:r},a)),this);this.itemsGroup.selectAll(v5.items.class).data(["items"]).join(function(t){return t.append(function(){return new l5({style:s})}).attr("className",v5.items.name).each(function(){l.items=b(this)})},function(t){return t.update(s)},function(t){return t.remove()})},x5.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(x5.prototype,"availableSpace",{get:function(){var t=this.attributes,e=t.showTitle,n=t.width,t=t.height;return e?this.title.node().getAvailableSpace():new Q2(0,0,n,t)},enumerable:!1,configurable:!0}),x5.prototype.getBBox=function(){var t,e,n,r,i,a,o,s,l,c,u=null==(u=this.title)?void 0:u.node(),h=null==(h=this.items)?void 0:h.node();return u&&h?(h=h,t=(r=(u=u).attributes).position,e=r.spacing,n=r.inset,r=r.text,u=u.getBBox(),i=h.getBBox(),t=zM(t),e=(r=j(Bx(r?e:0),4))[0],a=r[1],o=r[2],r=r[3],s=(n=j(Bx(n),4))[0],l=n[1],c=n[2],n=n[3],a=(r=j([r+a,e+o],2))[0],e=r[1],r=(o=j([n+l,s+c],2))[0],n=o[1],"l"===t[0]?new Q2(u.x,u.y,i.width+u.width+a+r,Math.max(i.height+n,u.height)):"t"===t[0]?new Q2(u.x,u.y,Math.max(i.width+r,u.width),i.height+u.height+e+n):(s=(l=j([h.attributes.width||i.width,h.attributes.height||i.height],2))[0],c=l[1],new Q2(i.x,i.y,s+u.width+a+r,c+u.height+e+n))):g5.prototype.getBBox.call(this)},x5.prototype.render=function(t,e){var n=t.width,t=t.height,e=b(e);this.renderTitle(e,n,t),this.renderItems(e,this.availableSpace),this.adjustLayout()},x5);function x5(t){return g5.call(this,t,y5)||this}var w5,M5={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},O5=ex({background:"background",labelGroup:"label-group",label:"label"},"indicator"),k5=(t(E5,w5=Zo),E5.prototype.renderBackground=function(){var t,e,n,r,i,a,o;this.label&&(t=(i=this.attributes).position,o=(i=j(Bx(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=x(this.attributes,"background"),this.background=b(this.group).maybeAppendByClassName(O5.background,"path").styles(m(m({},o),{path:a})),this.group.appendChild(this.label.node()))},E5.prototype.renderLabel=function(){var t=this.attributes,e=t.formatter,n=t.labelText,t=j(Gx(x(this.attributes,"label")),2),r=t[0],t=t[1],r=(r.text,it(r,["text"]));this.label=b(this.group).maybeAppendByClassName(O5.labelGroup,"g").styles(t),n&&this.label.maybeAppendByClassName(O5.label,function(){return fx(e(n))}).style("text",e(n).toString()).selectAll("text").styles(r)},E5.prototype.adjustLayout=function(){var t=j(this.point,2),e=t[0],t=t[1];this.group.attr("x",-e).attr("y",-t)},E5.prototype.getPath=function(n,t){var r=this,t=j(t,2),e=j(t[0],2),i=e[0],e=e[1],t=j(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=j(t,2),e=t[0],t=t[1];return e===o[n]?r.createCorner(t):[M(["M"],j(t[0]),!1),M(["L"],j(t[1]),!1)]});return a.push([["Z"]]),a.flat().filter(function(t,e,n){return 0===e||"M"!==t[0]})},E5.prototype.createCorner=function(t,e){void 0===e&&(e=10);var n=function(t,e){var n=(t=j(t,2))[0],t=t[1],r=(e=j(e,2))[0],e=e[1];return n!==r&&t===e}.apply(void 0,M([],j(t),!1)),t=j(t,2),r=j(t[0],2),i=r[0],r=r[1],t=j(t[1],2),a=t[0],t=t[1],a=j(n?[a-i,[i,a]]:[t-r,[r,t]],2),t=a[0],a=j(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=j([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]])},E5.prototype.bindEvents=function(){this.label.on(v.BOUNDS_CHANGED,this.renderBackground)},E5.prototype.render=function(){this.renderLabel(),this.renderBackground(),this.adjustLayout()},E5);function E5(t){t=w5.call(this,t,M5)||this;return t.point=[0,0],t.group=t.appendChild(new rc({})),t.isMutationObserved=!0,t}function S5(t,e){var t=j(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 A5=ex({trackGroup:"background-group",track:"background",selectionGroup:"ribbon-group",selection:"ribbon",clipPath:"clip-path"},"ribbon");function _5(t){var e=t.orientation,n=t.size,t=t.length;return t5(e,[t,n],[n,t])}function T5(t){var e=t.type,t=j(_5(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 P5(t){var i,a,o,e=t.orientation,r=t.color,n=t.block,t=t.partition,s=(l=Se(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 ha(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(t5(e,"0","270"),")")):""}function L5(t,e){var n,r,i,a=x(e,"selection"),o=P5(e),t=t.maybeAppendByClassName(A5.selection,"path").styles(m({path:T5(e),fill:o},a)),a=t.maybeAppendByClassName(A5.clipPath,"path").styles({path:(a=(o=e).orientation,(e=o.range)?(r=(o=j(_5(o),2))[0],o=o[1],n=(e=j(e,2))[0],e=e[1],i=t5(a,n*r,0),n=t5(a,0,n*o),r=t5(a,e*r,r),[["M",i,n],["L",i,i=t5(a,o,e*o)],["L",r,i],["L",r,n],["Z"]]):[])}).node();t.style("clip-path",a)}t(j5,C5=Zo),j5.prototype.render=function(t,e){var n,r,i=b(e).maybeAppendByClassName(A5.trackGroup,"g");i=i,r=x(n=t,"track"),i.maybeAppendByClassName(A5.track,"path").styles(m({path:T5(n)},r)),L5(b(e).maybeAppendByClassName(A5.selectionGroup,"g"),t)};var C5,N5=j5;function j5(t){return C5.call(this,t,{type:"color",orientation:"horizontal",size:30,range:[0,1],length:200,block:!1,partition:[],color:["#fff","#000"],trackFill:"#e5e5e5"})||this}var R5,I5,B5,D5,F5=Xe(function(t){return{min:Math.min.apply(Math,M([],j(t.map(function(t){return t.value})),!1)),max:Math.max.apply(Math,M([],j(t.map(function(t){return t.value})),!1))}},function(t){return t.map(function(t){return t.id})}),z5=(t(h,R5=Zo),Object.defineProperty(h.prototype,"handleOffsetRatio",{get:function(){return this.ifHorizontal(.5,.5)},enumerable:!1,configurable:!0}),h.prototype.getBBox=function(){var t=this.attributes,e=t.width,t=t.height;return new Q2(0,0,e,t)},h.prototype.render=function(t,e){var n=this,t=t.showLabel,r=(this.renderTitle(b(e)),this.availableSpace),i=r.x,r=r.y,e=b(e).maybeAppendByClassName(v5.contentGroup,"g").styles({x:i,y:r}),i=(dx(!!t,e.maybeAppendByClassName(v5.labelGroup,"g").styles({zIndex:1}),function(t){n.renderLabel(t)}),e.maybeAppendByClassName(v5.ribbonGroup,"g").styles({zIndex:0}));this.handlesGroup=e.maybeAppendByClassName(v5.handlesGroup,"g").styles({zIndex:2}),this.renderHandles(),this.renderRibbon(i),this.renderIndicator(e),this.adjustLabel(),this.adjustHandles()},Object.defineProperty(h.prototype,"range",{get:function(){var t=this.attributes.data;return F5(t)},enumerable:!1,configurable:!0}),Object.defineProperty(h.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(h.prototype,"ribbonRange",{get:function(){var t=j(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(h.prototype,"selection",{get:function(){var t=this.range,e=t.min,t=t.max,n=this.attributes.defaultValue,e=j(void 0===n?[e,t]:n,2);return[e[0],e[1]]},enumerable:!1,configurable:!0}),h.prototype.ifHorizontal=function(t,e){return t5(this.attributes.orientation,"function"==typeof t?t():t,"function"==typeof e?e():e)},h.prototype.renderTitle=function(t){var e=this.attributes,n=e.showTitle,r=e.titleText,i=e.width,e=e.height,a=x(this.attributes,"title"),o=m(m({},a),{width:i,height:e,text:r}),s=this;t.selectAll(v5.title.class).data(n?[r]:[]).join(function(t){return t.append(function(){return new HM({style:o})}).attr("className",v5.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(h.prototype,"availableSpace",{get:function(){var t,e;return this.title?this.title.getAvailableSpace():(t=(e=this.attributes).width,e=e.height,new Q2(0,0,t,e))},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"labelFixedSpacing",{get:function(){return this.attributes.showTick?5:0},enumerable:!1,configurable:!0}),Object.defineProperty(h.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(h.prototype,"labelBBox",{get:function(){var t,e;return this.attributes.showLabel?(this.cacheLabelBBox||(t=(e=(null==(e=this.label.querySelector(Bw.labelGroup.class))?void 0:e.children.slice(-1)[0]).getBBox()).width,e=e.height,this.cacheLabelBBox=new Q2(0,0,t,e)),this.cacheLabelBBox):new Q2(0,0,0,0)},enumerable:!1,configurable:!0}),Object.defineProperty(h.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(h.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=j(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=j(this.ifHorizontal([n,l],[l,n]),2),s=o[0],e=o[1],i=["top","left"].includes(c)?a:0,r=j(this.ifHorizontal([t/2,i],[i,t/2]),2),l=r[0],n=r[1];return new Q2(l,n,s,e)},enumerable:!1,configurable:!0}),Object.defineProperty(h.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}),h.prototype.renderRibbon=function(t){var e=this.attributes,n=e.data,r=e.type,i=e.orientation,a=e.color,e=e.block,o=x(this.attributes,"ribbon"),s=this.range,l=s.min,c=s.max,s=this.ribbonBBox,u=s.x,s=s.y,h=this.ribbonShape,f=h.length,h=h.size,d=nx({x:u,y:s,length:f,size:h,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(v5.ribbon,function(){return new N5({style:d})}).update(d)},h.prototype.getHandleClassName=function(t){return"".concat(v5.prefix("".concat(t,"-handle")))},h.prototype.renderHandles=function(){var t=this.attributes,e=t.showHandle,t=t.orientation,n=x(this.attributes,"handle"),r=j(this.selection,2),i=r[0],r=r[1],a=m(m({},n),{orientation:t}),t=n.shape,o="basic"===(void 0===t?"slider":t)?d5:_w,s=this;this.handlesGroup.selectAll(v5.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 o({style:a})}).attr("className",function(t){t=t.type;return"".concat(v5.handle," ").concat(s.getHandleClassName(t))}).each(function(t){var e=t.type,t=t.value,t=(this.update({labelText:t}),"".concat(e,"Handle"));(s[t]=this).addEventListener("pointerdown",s.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");s[t]=void 0}).remove()})},h.prototype.adjustHandles=function(){var t=j(this.selection,2),e=t[0],t=t[1];this.setHandlePosition("start",e),this.setHandlePosition("end",t)},Object.defineProperty(h.prototype,"handleBBox",{get:function(){if(!this.cacheHandleBBox){if(!this.attributes.showHandle)return new Q2(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=j([Math.max(e,r),Math.max(t,n)],2),r=e[0],t=e[1];this.cacheHandleBBox=new Q2(0,0,r,t)}return this.cacheHandleBBox},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"handleShape",{get:function(){var t=this.handleBBox,e=t.width,t=t.height,n=j(this.ifHorizontal([t,e],[e,t]),2);return{width:e,height:t,size:n[0],length:n[1]}},enumerable:!1,configurable:!0}),h.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=j(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})},h.prototype.renderIndicator=function(t){var e=x(this.attributes,"indicator");this.indicator=t.maybeAppendByClassName(v5.indicator,function(){return new k5({})}).update(e)},Object.defineProperty(h.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(m(m({},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=j([e.value,i.value],2))[0])+(r=r[1]))/2,t.push(m(m({},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(h.prototype,"labelStyle",{get:function(){var t=j(["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}),h.prototype.renderLabel=function(t){var e=this.attributes,n=e.showTick,n=void 0!==n&&n,r=e.labelFilter,e=e.labelFormatter,i=x(this.attributes,"tick"),a=x(this.attributes,"label"),o=a.align,n=nx(m({showLine:!1,showGrid:!1,showTick:n,type:"linear",startPos:[0,0],endPos:[0,0],tickDirection:"negative",labelTransform:"rotate(0)"},this.labelStyle),Wx(i,"tick"),Wx(a,"label"),{data:this.labelData}),i={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)===o&&(!r||r(t,t.index,n.filter(function(t){return t.type===o})))},labelFormatter:e},s=m(m({},n),i);this.label=t.maybeAppendByClassName(v5.label,function(){return new UM({style:s})}).node(),this.label.update(s,!1)},Object.defineProperty(h.prototype,"labelAxisStyle",{get:function(){var t=this.attributes,e=t.showTick,n=t.labelDirection,r=t.labelSpacing,t=t.tickLength,i=this.ribbonShape.size,a=this.labelPosition,o=this.labelFixedSpacing,s=j([0,0,0],3),l=s[0],s=(s[1],s[2]),t=null!=t?t:i;return e?(s=t,"positive"===n?"right"===a?s=l=t:"bottom"===a&&(l=s):"negative"!==n||"top"!==a&&"left"!==a||(l=i)):"positive"===n&&"right"!==a&&"bottom"===a&&(l=i+o),{offset:l,spacing:r,tickLength:s}},enumerable:!1,configurable:!0}),h.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=j(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))},h.prototype.bindEvents=function(){this.ribbon.on("pointerdown",this.onDragStart("ribbon")),this.ribbon.on("pointermove",this.onHovering),this.addEventListener("pointerout",this.hideIndicator)},h.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=Be(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}),z2(this.indicator.node())):this.hideIndicator()},h.prototype.hideIndicator=function(){W2(this.indicator.node())},h.prototype.updateMouse=function(){this.attributes.slidable&&(this.style.cursor="grabbing")},h.prototype.setSelection=function(t,e){this.updateSelection(t,e)},h.prototype.updateSelection=function(t,e,n){void 0===n&&(n=!1);var r,i,a,o,s,l=j(this.selection,2),c=l[0],l=l[1],t=j([t,e],2),e=t[0],t=t[1],n=(n&&(e+=c,t+=l),this.range),c=n.min,l=n.max,u=j((n=[c,l],c=[e,t],l=this.selection,void 0===r&&(r=4),i=(n=j(n,2))[0],n=n[1],a=(c=j(c,2))[0],c=c[1],o=(l=j(l,2))[0],l=l[1],c=(a=j([a,c],2))[0],s=(a=a[1])-c,a<c&&(c=(u=j([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]:[Ax(c,r),Ax(a,r)]),2),e=u[0],t=u[1];this.update({defaultValue:[e,t]}),this.dispatchSelection()},Object.defineProperty(h.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 qe(t)?Ax(.01*(e-n),0):t},enumerable:!1,configurable:!0}),h.prototype.getTickValue=function(t){var e=this.attributes,n=e.data,e=e.block,r=this.range.min;return e?S5(n.map(function(t){return t.value}),t).tick:(e=this.step,r+Math.round((t-r)/e)*e)},h.prototype.getValueByCanvasPoint=function(t,e){var n=this.range,r=n.min,n=n.max,i=j(this.ribbon.node().getPosition(),2),a=i[0],i=i[1],a=this.ifHorizontal(a,i),i=this.ifHorizontal.apply(this,M([],j(hx(t)),!1));return Be(this.getOffset(i-a,!0),r,n)},h.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)},h.prototype.dispatchSelection=function(){var t=new ll("valuechange",{detail:{value:this.selection}});this.dispatchEvent(t)},h.prototype.dispatchIndicated=function(t,e){t=new ll("indicate",{detail:{value:t,range:e}});this.dispatchEvent(t)},h);function h(t){var a=R5.call(this,t,m5)||this;return a.eventToOffsetScale=new Wm({}),a.innerRibbonScale=new Wm({}),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=S5(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(),j(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 W5(t){I5||(I5=document.createElement("table"),D5=document.createElement("tr"),B5=/^\s*<(\w+|!)[^>]*>/,D5={tr:document.createElement("tbody"),tbody:I5,thead:I5,tfoot:I5,td:D5,th:D5,"*":document.createElement("div")});var e=B5.test(t)&&RegExp.$1,e=(e&&e in D5||(e="*"),D5[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 G5(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 H5={overflow:"hidden","white-space":"nowrap","text-overflow":"ellipsis"};t(U5,Y5=Zo),Object.defineProperty(U5.prototype,"HTMLTooltipElement",{get:function(){return this.element},enumerable:!1,configurable:!0}),U5.prototype.getContainer=function(){return this.element},Object.defineProperty(U5.prototype,"position",{set:function(t){var t=j(t,2),e=t[0],t=t[1];this.attributes.x=e,this.attributes.y=t,this.updatePosition()},enumerable:!1,configurable:!0}),Object.defineProperty(U5.prototype,"elementSize",{get:function(){return{width:this.element.offsetWidth,height:this.element.offsetHeight}},enumerable:!1,configurable:!0}),Object.defineProperty(U5.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=it(t,["name","color","index"]),r=m({name:r,color:i,index:null!=a?a:e},t);return W5((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}),U5.prototype.render=function(t,e){this.renderHTMLTooltipElement(),this.updatePosition()},U5.prototype.destroy=function(){var t;null!=(t=this.element)&&t.remove(),Y5.prototype.destroy.call(this)},U5.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"},U5.prototype.hide=function(){this.element.style.visibility="hidden"},U5.prototype.initShape=function(){var t=this.attributes.template;this.element=W5(t.container),this.id&&this.element.setAttribute("id",this.id)},U5.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))},U5.prototype.renderHTMLTooltipElement=function(){var r,t=this.attributes,e=t.template,n=t.title,i=t.enterable,a=t.style,t=t.content,o=G5(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,M([],j(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=j(t,2),e=t[0],n=t[1];M([r],j(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(":"),";")},""))})})},U5.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=j(l,2),n=e[0],e=e[1],t=j(a[t],2),r=t[0],t=t[1];l=[n+(o/2+i[0])*r,e+(s/2+i[1])*t]}),l},U5.prototype.setOffsetPosition=function(t){var t=j(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")},U5.prototype.updatePosition=function(){this.setOffsetPosition(this.autoPosition(this.getRelativeOffsetFromCursor()))},U5.prototype.autoPosition=function(t){var e,n,r,i,a,o,s,t=j(t,2),l=t[0],t=t[1],c=this.attributes,u=c.x,h=c.y,f=c.bounding,c=c.position;return f?(e=(n=this.element).offsetWidth,n=n.offsetHeight,h=(u=j([+u+l,+h+t],2))[0],u=u[1],r={left:"right",right:"left",top:"bottom",bottom:"top"},s=f.x,i=f.y,a={left:h<s,right:s+f.width<h+e,top:u<i,bottom:i+f.height<u+n},o=[],c.split("-").forEach(function(t){o.push(a[t]?r[t]:t)}),s=o.join("-"),this.getRelativeOffsetFromCursor(s)):[l,t]},U5.tag="tooltip",e([(void 0===(V5=100)&&(V5=0),void 0===(q5=!0)&&(q5=!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,q5&&i.apply(t,e),r=window.setTimeout(function(){i.apply(t,e),r=null},V5))})})],U5.prototype,"updatePosition",null);var Y5,V5,q5,$5=U5;function U5(t){var e=this,n=null==(n=null==(n=t.style)?void 0:n.template)?void 0:n.prefixCls,r=G5(n);return(e=Y5.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=G5(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)]=m({flex:1},H5),r[".".concat(t.VALUE)]=m({display:"inline-block",float:"right",flex:1,"text-align":"right","min-width":"28px","margin-left":"30px",color:"rgba(0, 0, 0, 0.85)"},H5),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}t(K5,X5=rc),Object.defineProperty(K5.prototype,"margin",{get:function(){return this.$margin},set:function(t){this.$margin=Bx(t)},enumerable:!1,configurable:!0}),Object.defineProperty(K5.prototype,"padding",{get:function(){return this.$padding},set:function(t){this.$padding=Bx(t)},enumerable:!1,configurable:!0}),K5.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=j(this.$margin,4),a=i[0],o=i[1],s=i[2],i=i[3];return new Q2(e-i,n-a,r+i+o,t+a+s)},K5.prototype.appendChild=function(t,e){return t.isMutationObserved=!0,X5.prototype.appendChild.call(this,t,e),t},K5.prototype.getAvailableSpace=function(){var t=this.attributes,e=t.width,t=t.height,n=j(this.$padding,4),r=n[0],i=n[1],a=n[2],n=n[3],o=j(this.$margin,4),s=o[0],o=o[3];return new Q2(n+o,r+s,e-n-i,t-r-a)},K5.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:vx,grid:bx})?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){}},K5.prototype.bindEvents=function(){var e=this;this.layoutEvents.forEach(function(t){e.addEventListener(t,function(t){t.target.isMutationObserved=!0,e.layout()})})},K5.prototype.attributeChangedCallback=function(t,e,n){"margin"===t?this.margin=n:"padding"===t&&(this.padding=n),this.layout()};var X5,js=K5;function K5(t){var e=X5.call(this,t)||this,t=(e.layoutEvents=[v.BOUNDS_CHANGED,v.INSERTED,v.REMOVED],e.$margin=Bx(0),e.$padding=Bx(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 Z5(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 Rb()([[0,0],[s,l]]);s=[[t-a,i-o]].concat(e.length?e:[[0,0]]);const c=[n[0]-a,n[1]-o],[u,h]=s;return l=c,t=u,i=h,e=xv(l,t),t=xv(t,i),i=xv(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])),Rb()(s)}const Q5=u2(t=>{var e,n,r,i,a=t.attributes,{labelTransform:o,labelTransformOrigin:s,x:l,y:c,x0:u=l,y0:h=c,background:f,connector:d,startMarker:p,endMarker:g,coordCenter:y}=a,a=it(a,["class","transform","rotate","labelTransform","labelTransformOrigin","x","y","x0","y0","background","connector","startMarker","endMarker","coordCenter"]);[l,c,u,h].some(t=>!De(t))||(e=(n=at(a,"background"))["padding"],n=it(n,["padding"]),{points:r=[]}=i=at(a,"connector"),i=it(i,["points"]),u=[[+u,+h],[+l,+c]],h=st(t).maybeAppend("text","text").style("zIndex",0).call(C,Object.assign({textBaseline:"middle",transform:o,transformOrigin:s},a)).node(),l=Z5(st(t).maybeAppend("background","rect").style("zIndex",-1).call(C,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}}(h,e)).call(C,f?n:{}).node(),u,r,y),c=p&&new Zx({id:"startMarker",style:Object.assign({x:0,y:0},at(a,"startMarker"))}),o=g&&new Zx({id:"endMarker",style:Object.assign({x:0,y:0},at(a,"endMarker"))}),st(t).maybeAppend("connector","path").style("zIndex",0).style("path",l).style("markerStart",c).style("markerEnd",o).call(C,d?i:{}))}),J5=(s,t)=>{const l=t["coordinate"];return(t,e,n)=>{var{color:e,text:r="",fontSize:i,rotate:a=0,transform:o=""}=e,r={text:String(r),stroke:e,fill:e,fontSize:i},[[e,i]]=t;return st(new Q5).style("x",e).style("y",i).call(C,n).style("transform",o+`rotate(${+a})`).style("coordCenter",l.getCenter()).call(C,r).call(C,s).node()}};J5.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const tO=u2(t=>{var e=it(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])]}(st(t).maybeAppend("marker",()=>new Zx({})).call(t=>t.node().update(Object.assign({symbol:r},n))).node());st(t).maybeAppend("text","text").style("x",i).style("y",a).call(C,e)}),eO=(t,e)=>{const i=it(t,[]);return(t,e,n)=>{var r=n["color"],n=it(n,["color"]),{color:e=r,text:r=""}=e,r={text:String(r),stroke:e,fill:e},[[e,t]]=t;return st(new tO).call(C,n).style("x",e).style("y",t).call(C,r).call(C,i).node()}};eO.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const nO=u2(t=>{var{areaPath:e,connectPath:n,areaStyle:r,connectStyle:i}=t.attributes;const a=t.ownerDocument;st(t).maybeAppend("connect-path",()=>a.createElement("path",{})).style("d",n).call(C,i),st(t).maybeAppend("area-path",()=>a.createElement("path",{})).style("d",e).call(C,r)}),rO=(t,e)=>{const{curve:c,gradient:l=!1,defined:u=t=>!Number.isNaN(t)&&null!=t,connect:h=!1}=t,f=it(t,["curve","gradient","defined","connect"]),{coordinate:d,document:p}=e;return(t,e,n)=>{var r=n["color"],{color:r=r,seriesColor:i,seriesX:a,seriesY:o}=e,e=Lv(d,e),i=l&&i?Av(i,a,o,l):r;const s=Object.assign(Object.assign(Object.assign(Object.assign({},n),{stroke:i,fill:i}),e&&{transform:e}),f);var[a,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,h=e[t],f=e[t+l];[...h,...f].some(t=>!n(t))?o=!0:(r.push(h),i.push(f),o&&s&&(o=!1,[c,u]=s,a.push([c,h,u,f])),s=[h,f])}return[r.concat(i),a]}(t,u),r=at(s,"connect"),n=!!o.length,i=t=>st(p.createElement("path",{})).style("d",t||"").call(C,s).node();return vp(d)?(e=t=>{const n=d.getCenter(),r=t.slice(0,t.length/2),i=t.slice(t.length/2);return t=Ib().curve(Bb),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 zb(a())},delete t.lineX0,t.lineEndAngle=function(){return zb(o())},delete t.lineX1,t.lineInnerRadius=function(){return zb(s())},delete t.lineY0,t.lineOuterRadius=function(){return zb(l())},delete t.lineY1,t.curve=function(t){return arguments.length?e(Fb(t)):e()._curve},t.angle((t,e)=>Mv(vv(r[e],n))).outerRadius((t,e)=>xv(r[e],n)).innerRadius((t,e)=>xv(i[e],n)).defined((t,e)=>[...r[e],...i[e]].every(u)).curve(c)(i);var e,a,o,s,l},!n||h&&!Object.keys(r).length?i(e(a)):n&&!h?i(e(t)):st(new nO).style("areaStyle",s).style("connectStyle",Object.assign(Object.assign({},r),f)).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(mp(d)?Ib().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(u)):Ib().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(u))).curve(c)(n)},!n||h&&!Object.keys(r).length?i(e(a)):n&&!h?i(e(t)):st(new nO).style("areaStyle",s).style("connectStyle",Object.assign(Object.assign({},r),f)).style("areaPath",e(t)).style("connectPath",o.map(e).join("")).node())}},iO=(rO.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},(n,r)=>{const i=r["coordinate"];return(...t)=>{var e=vp(i)?Zb:Cb;return rO(Object.assign({curve:e},n),r)(...t)}}),aO=(iO.props=Object.assign(Object.assign({},rO.props),{defaultMarker:"square"}),(t,n)=>{const{alpha:r=.5}=t,i=it(t,["alpha"]),a=n["coordinate"];return(...t)=>{var e=vp(a)?Xb:$b;return rO(Object.assign({curve:e.alpha(r)},i),n)(...t)}}),oO=(aO.props=Object.assign(Object.assign({},rO.props),{defaultMarker:"smooth"}),(e,n)=>(...t)=>rO(Object.assign({curve:Jb},e),n)(...t)),sO=(oO.props=Object.assign(Object.assign({},rO.props),{defaultMarker:"hvh"}),(e,n)=>(...t)=>rO(Object.assign({curve:t2},e),n)(...t)),lO=(sO.props=Object.assign(Object.assign({},rO.props),{defaultMarker:"vh"}),(e,n)=>(...t)=>rO(Object.assign({curve:e2},e),n)(...t)),cO=(lO.props=Object.assign(Object.assign({},rO.props),{defaultMarker:"hv"}),(e,n)=>{const{arrow:r=!1}=e;return(...t)=>F2(Object.assign(Object.assign({},e),{arrow:r}),n)(...t)}),uO=(cO.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},(t,e)=>{const o=it(t,[]),s=e["document"];return(t,e,n)=>{var r=n["color"],n=it(n,["color"]),{color:e=r,transform:r}=e,[t,i]=t,a=wb();return a.moveTo(t[0],t[1]),a.bezierCurveTo(t[0]/2+i[0]/2,t[1],t[0]/2+i[0]/2,i[1],i[0],i[1]),st(s.createElement("path",{})).call(C,n).style("d",a.toString()).style("stroke",e).style("transform",r).call(C,o).node()}});uO.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const hO=(t,e)=>{const{cornerRatio:u=1/3}=t,h=it(t,["cornerRatio"]),{coordinate:f,document:d}=e;return(t,e,n)=>{var r,i,a,o,s=n["defaultColor"],n=it(n,["defaultColor"]),{color:e=s,transform:s}=e,[t,l]=t,c=(t=t,l=l,r=f,i=u,o=wb(),vp(r)?(a=xv(t,c=r.getCenter()),a=(xv(l,c)-a)*i+a,o.moveTo(t[0],t[1]),Sv(o,t,l,c,a)):mp(r)?(o.moveTo(t[0],t[1]),o.lineTo(t[0]+(l[0]-t[0])*i,t[1]),o.lineTo(t[0]+(l[0]-t[0])*i,l[1])):(o.moveTo(t[0],t[1]),o.lineTo(t[0],t[1]+(l[1]-t[1])*i),o.lineTo(l[0],t[1]+(l[1]-t[1])*i)),o.lineTo(l[0],l[1]),o);return st(d.createElement("path",{})).call(C,n).style("d",c.toString()).style("stroke",e).style("transform",s).call(C,h).node()}},fO=(hO.props={defaultMarker:"vhv",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},(t,e)=>{const s=it(t,[]),{coordinate:l,document:c}=e;return(t,e,n)=>{var r,i=n["color"],n=it(n,["color"]),{color:e=i,transform:i}=e,[t,a]=t,o=wb();return o.moveTo(t[0],t[1]),vp(l)?(r=l.getCenter(),o.quadraticCurveTo(r[0],r[1],a[0],a[1])):Sv(o,t,a,Ev(t,a),xv(t,a)/2),st(c.createElement("path",{})).call(C,n).style("d",o.toString()).style("stroke",e).style("transform",i).call(C,s).node()}}),dO=(fO.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},(u,t)=>{const{coordinate:h,document:f}=t;return(t,e,n)=>{var r=n["color"],n=it(n,["color"]),{color:e=r,src:r="",size:i=32,transform:a=""}=e,{width:o=i,height:i=i}=u,[[t,s]]=t,[l,c]=h.getSize(),o="string"==typeof o?bd(o)*l:o,i="string"==typeof i?bd(i)*c:i,l=t-Number(o)/2,c=s-Number(i)/2;return st(f.createElement("image",{})).call(C,n).style("x",l).style("y",c).style("img",r).style("stroke",e).style("transform",a).call(C,u).style("width",o).style("height",i).node()}});dO.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const pO=(i,t)=>{const{coordinate:a,document:o}=t;return(t,e,n)=>{var r=n["color"],n=it(n,["color"]),{color:e=r,transform:r}=e,t=function(i,t){const a=wb();if(vp(t)){const o=t.getCenter();t=[...i,i[0]];const s=t.map(t=>xv(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?Sv(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,a);return st(o.createElement("path",{})).call(C,n).style("d",t.toString()).style("stroke",e).style("fill",e).style("transform",r).call(C,i).node()}};pO.props={defaultMarker:"square",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const gO=(t,e)=>{const a=it(t,[]),{coordinate:o,document:s}=e;return(t,e,n)=>{var r=n["color"],n=it(n,["color"]),{color:e=r,transform:i}=e,t=function(t,e){var n,[t,r,i,a]=t,o=wb();return vp(e)?(n=xv(e=e.getCenter(),t),o.moveTo(t[0],t[1]),o.quadraticCurveTo(e[0],e[1],i[0],i[1]),Sv(o,i,a,e,n),o.quadraticCurveTo(e[0],e[1],r[0],r[1]),Sv(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,o);return st(s.createElement("path",{})).call(C,n).style("d",t.toString()).style("fill",e||r).style("stroke",e||r).style("transform",i).call(C,a).node()}};gO.props={defaultMarker:"square",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const yO=(y,t)=>{const{coordinate:m,document:v}=t;return(t,e,n)=>{var r,i,a,o,s,l,c,u,h,{color:e,transform:f}=e,{color:d,fill:p=d,stroke:d=d}=n,n=it(n,["color","fill","stroke"]),g=(t=t,r=m,h=wb(),vp(r)?([i,a]=r=r.getCenter(),o=wv(vv(t[0],r)),s=wv(vv(t[1],r)),g=xv(r,t[2]),l=xv(r,t[3]),c=xv(r,t[8]),u=xv(r,t[10]),r=xv(r,t[11]),h.moveTo(...t[0]),h.arc(i,a,g,o,s),h.arc(i,a,g,s,o,!0),h.moveTo(...t[2]),h.lineTo(...t[3]),h.moveTo(...t[4]),h.arc(i,a,l,o,s),h.lineTo(...t[6]),h.arc(i,a,u,s,o,!0),h.closePath(),h.moveTo(...t[8]),h.arc(i,a,c,o,s),h.arc(i,a,c,s,o,!0),h.moveTo(...t[10]),h.lineTo(...t[11]),h.moveTo(...t[12]),h.arc(i,a,r,o,s),h.arc(i,a,r,s,o,!0)):(h.moveTo(...t[0]),h.lineTo(...t[1]),h.moveTo(...t[2]),h.lineTo(...t[3]),h.moveTo(...t[4]),h.lineTo(...t[5]),h.lineTo(...t[6]),h.lineTo(...t[7]),h.closePath(),h.moveTo(...t[8]),h.lineTo(...t[9]),h.moveTo(...t[10]),h.lineTo(...t[11]),h.moveTo(...t[12]),h.lineTo(...t[13])),h);return st(v.createElement("path",{})).call(C,n).style("d",g.toString()).style("stroke",d).style("fill",e||p).style("transform",f).call(C,y).node()}};yO.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const mO=(y,t)=>{const{coordinate:m,document:v}=t;return(t,e,n)=>{var r,i,a,o,s,l,c,u,h,{color:e,transform:f}=e,{color:d,fill:p=d,stroke:d=d}=n,n=it(n,["color","fill","stroke"]),g=(t=t,r=m,i=4,h=wb(),vp(r)?([a,o]=r=r.getCenter(),s=xv(r,t[3]),l=xv(r,t[8]),g=xv(r,t[10]),c=(r=wv(vv(t[2],r)))-(u=Math.asin(i/l)),r+=u,h.moveTo(...t[2]),h.lineTo(...t[3]),h.moveTo(Math.cos(c)*s+a,Math.sin(c)*s+o),h.arc(a,o,s,c,r),h.lineTo(Math.cos(r)*g+a,Math.sin(r)*g+o),h.arc(a,o,g,r,c,!0),h.lineTo(Math.cos(c)*s+a,Math.sin(c)*s+o),h.closePath(),h.moveTo(...t[10]),h.lineTo(...t[11]),u=(c+r)/2,h.moveTo(Math.cos(u)*(l+i/2)+a,Math.sin(u)*(l+i/2)+o),h.arc(Math.cos(u)*l+a,Math.sin(u)*l+o,i/2,u,2*Math.PI+u)):(h.moveTo(...t[2]),h.lineTo(...t[3]),h.lineTo(t[3][0]-i,t[3][1]),h.lineTo(t[10][0]-i,t[10][1]),h.lineTo(t[10][0]+i,t[10][1]),h.lineTo(t[3][0]+i,t[3][1]),h.lineTo(...t[3]),h.closePath(),h.moveTo(...t[10]),h.lineTo(...t[11]),h.moveTo(t[3][0]+i/2,t[8][1]),h.arc(t[3][0],t[8][1],i/2,0,2*Math.PI)),h.closePath(),h);return st(v.createElement("path",{})).call(C,n).style("d",g.toString()).style("stroke",d).style("fill",e||p).style("transform",f).call(C,y).node()}};mO.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const vO=(t,e)=>{const{arrow:u,arrowSize:h=4}=t,f=it(t,["arrow","arrowSize"]),{coordinate:d,document:p}=e;return(t,e,n)=>{var r,i,a,{color:o,lineWidth:s}=n,n=it(n,["color","lineWidth"]),{color:o=o,size:s=s}=e,l=u?(l=p,r=h,i=Object.assign({fill:f.stroke||o,stroke:f.stroke||o},at(f,"arrow")),l.createElement("path",{style:Object.assign({path:`M ${r},${r} L -${r},0 L ${r},-${r} L 0,0 Z`,anchor:"0.5 0.5",transformOrigin:"center"},i)})):null,t=(r=t,vp(i=d)?(i=i.getCenter(),Tb()({startAngle:0,endAngle:2*Math.PI,outerRadius:xv(r[0],i),innerRadius:xv(r[1],i)})):Rb().x(t=>t[0]).y(t=>t[1])(r)),c=(c=d,e=e.transform,vp(c)?([c,a]=c.getCenter(),`translate(${c}, ${a}) `+(e||"")):e);return st(p.createElement("path",{})).call(C,n).style("d",t).style("stroke",o).style("lineWidth",s).style("transform",c).style("markerEnd",l).call(C,f).node()}};function bO(t,e,n){return[["M",t,e],["L",t+2*n,e-n],["L",t+2*n,e+n],["Z"]]}vO.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const xO=u2(t=>{var e=t.attributes,{points:n,endMarker:r=!0}=e,e=it(e,["points","class","endMarker","direction"]),i=at(e,"endMarker"),n=(n=n,Rb().x(t=>t[0]).y(t=>t[1])(n));st(t).maybeAppend("connector","path").style("path",n).style("markerEnd",r?new Zx({className:"marker",style:Object.assign(Object.assign({},i),{symbol:bO})}):null).call(C,e)});const wO=(t,e)=>{const{offset:o=0,connectLength1:s}=t,l=it(t,["offset","connectLength1"]),c=e["coordinate"];return(t,e,n)=>{var{color:r,connectLength1:i=s}=n,n=it(n,["color","connectLength1"]),{color:e,transform:a}=e,t=function(t,e,n,r=0){var[[e,i],[a,o]]=e;if(mp(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]]}(c,t,o,i);return st(new xO).call(C,n).style("points",t).style("stroke",e||r).style("transform",a).call(C,l).node()}};function MO(t){return t.replace(/-(\w)/g,function(t,e){return e.toUpperCase()})}function OO(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=y0(a.x,c),i=y0(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 kO(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:h}=Tv(e,i,[t,n]),f="inside"===r?(u+h)/2:h;e=SO(f,a,o),t=(()=>{var[t,e]=i,n=l+.5*(c-l),[n,t]="inside"===r?EO(s,f,n):Ev(t,e);return{x:n,y:t}})();return Object.assign(Object.assign({},t),{textAlign:"inside"===r?"center":"start",textBaseline:"middle",rotate:e})}function EO(t,e,n){return[t[0]+Math.sin(e)*n,t[1]-Math.cos(e)*n]}function SO(t,e,n){return e?(e=n?0:Math.sin(t)<0?90:-90,t/Math.PI*180+e):0}function AO(t,e,n,r){var{y:n,y1:i,autoRotate:a,rotateToAlignArc:o,radius:s=.5,offset:l=0}=n,e=Tv(r,e,[n,i]),{startAngle:n,endAngle:i}=e,r=r.getCenter(),n=(n+i)/2,i={textAlign:"center",textBaseline:"middle",rotate:SO(n,a,o)},{innerRadius:a,outerRadius:o}=e,[e,r]=EO(r,n,a+(o-a)*s+l);return Object.assign({x:e,y:r},i)}function _O(t,e,n){var n=n["bounds"],[n]=n;return{x:n[0],y:n[1]}}function TO(t,e,n,r){var i=n["bounds"];return 1===i.length?_O(0,0,n):(bp(r)?kO:Op(r)?AO:OO)(t,e,n,r)}function PO(t,e,n){var{innerRadius:n,outerRadius:t}=Tv(n,t,[e.y,e.y1]);return n+(t-n)}function LO(t,e,n){var{startAngle:n,endAngle:t}=Tv(n,t,[e.y,e.y1]);return(n+t)/2}function CO(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,h=r.getCenter(),f=LO(e,n,r),d=0<Math.sin(f)?1:-1,i=SO(f,i,a),a={textAlign:0<d||bp(r)?"start":"end",textBaseline:"middle",rotate:i},i=PO(e,n,r),[[e,n],[r,h],[f,i]]=function(t,e,n,r,i){var[n,a]=EO(t,e,n),[t,r]=EO(t,e,r);return[[n,a],[t,r],[t+(0<Math.sin(e)?1:-1)*i,r]]}(h,f,i,i+(s?l:o),s?c:0),l=s?+u*d:0,o=f+l,c={connector:s,connectorPoints:[[r-o,h-i],[f-o,i-i]]};return Object.assign(Object.assign({x0:e,y0:n,x:f+l,y:i},a),c)}wO.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};var NO=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=ap(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=wv(vv(l(e+1),s))/Math.PI*180;return{x:i[0],y:i[1],transform:`rotate(${l})`,textAlign:"center",textBaseline:"middle"}},bottom:TO,bottomLeft:TO,bottomRight:TO,inside:TO,left:TO,outside:function(t,e,n,r){var i=n["bounds"];return 1===i.length?_O(0,0,n):(bp(r)?kO:Op(r)?CO:OO)(t,e,n,r)},right:TO,spider:function(t,e,n,r){var i,a,o,s,l,c;return Op(r)?({connectorLength:c,connectorLength2:i,connectorDistance:a}=n,o=it(CO(0,e,n,r),[]),s=r.getCenter(),l=PO(e,n,r),e=LO(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 Op(r)?({connectorLength:o,connectorLength2:i,connectorDistance:a}=n,{x0:n,y0:s}=e=it(CO(0,e,n,r),[]),l=r.getCenter(),r=function(t){if(Op(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=Mv([n-l[0],s-l[1]]),n=0<Math.sin(o)?1:-1,[s,l]=EO(l,o,r),e.x=s+(i+a)*n,e.y=l,e):{}},top:TO,topLeft:TO,topRight:TO});function jO(t,e,n,r,i){var a=e["position"],a=(o=n,void 0!==(a=a)?a:Op(o)?"inside":mp(o)?"right":"top"),o=r["inside"===a?"innerLabel":"label"],r=Object.assign({},o,e),e=NO[MO(a)];if(e)return Object.assign(Object.assign({},o),e(a,t,r,n,i));throw new Error("Unknown position: "+a)}const RO=(s,t)=>{const{coordinate:l,theme:c}=t;return(t,e)=>{var{text:n,transform:r="",transformOrigin:i}=e,a=it(e,["text","x","y","transform","transformOrigin"]),t=jO(t,e,l,c,s),{rotate:e=0,transform:o=""}=t,t=it(t,["rotate","transform"]);return st(new Q5).call(C,t).style("text",""+n).style("labelTransform",(o+` rotate(${+e}) `+r).trim()).style("labelTransformOrigin",i).style("coordCenter",l.getCenter()).call(C,a).node()}},IO=(RO.props={defaultMarker:"point"},(t,e)=>{const o=t["colorAttribute"],s=it(t,["arrow","colorAttribute"]),{coordinate:l,document:c}=e;return(t,e,n)=>{var r=n["color"],n=it(n,["color","stroke"]),{d:e,color:r=r}=e,[i,a]=l.getSize();return st(c.createElement("path",{})).call(C,n).style("d","function"==typeof e?e({width:i,height:a}):e).style(o,r).call(C,s).node()}}),BO=(IO.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},(t,e)=>IO(Object.assign({colorAttribute:"fill"},t),e)),DO=(BO.props={defaultMarker:"hvh",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},(t,e)=>IO(Object.assign({fill:"none",colorAttribute:"stroke"},t),e)),FO=(DO.props={defaultMarker:"hvh",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},(s,t)=>{const l=t["document"];return(t,e,n)=>{var r=e["transform"],i=n["color"],n=it(n,["color"]),{color:e=i}=e,[t,...a]=t;const o=wb();return o.moveTo(...t),a.forEach(([t,e])=>{o.lineTo(t,e)}),o.closePath(),st(l.createElement("path",{})).call(C,n).style("d",o.toString()).style("stroke",e||i).style("fill",e||i).style("fillOpacity",.4).style("transform",r).call(C,s).node()}});function zO(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 WO(t,e,n){t=t?t():document.createElement("canvas");return t.width=e,t.height=n,t}FO.props={defaultMarker:"square",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},zO(3);const GO=function(n,r,t=16){const i=zO(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=WO(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 HO(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=WO(o,t,e).getContext("2d"),l=function(t,e){const n=(e=WO(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,h=r,f=i,d=o,p=(n=a)["blur"];let t=f.length;for(;t--;){var{x:g,y,value:m,radius:v}=f[t],m=Math.min(m,h),g=g-v,y=y-v,v=GO(v,1-p,d);c.globalAlpha=Math.max((m-u)/(h-u),.001),c.drawImage(v,g,y)}}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 h=c[t],f=4*h;f&&(h=o||Math.max(0,Math.min(s,Math.max(a,h))),c[t-3]=r[f],c[t-2]=r[1+f],c[t-1]=r[2+f],c[t]=l?r[3+f]:h)}return i}(s,t,e,l,a),i=WO(o,t,e).getContext("2d");return i.putImageData(r,0,0),i}const YO=(t,e)=>{const{gradient:u,opacity:h,maxOpacity:f,minOpacity:d,blur:p,useGradientOpacity:g}=t,y=it(t,["gradient","opacity","maxOpacity","minOpacity","blur","useGradientOpacity"]),{coordinate:m,createCanvas:v,document:b}=e;return(t,e,n)=>{var r,i,e=e["transform"],[a,o]=m.getSize(),s=t.map(t=>({x:t[0],y:t[1],value:t[2],radius:t[3]})),l=op(t,t=>t[2]),t=ip(t,t=>t[2]),c={gradient:u,opacity:h,minOpacity:d,maxOpacity:f,blur:p,useGradientOpacity:g},l=a&&o?HO(a,o,l,t,s,(r=c,i=t=>void 0===t,Object.keys(r).reduce((t,e)=>{var n=r[e];return i(n,e)||(t[e]=n),t},{})),v):{canvas:null};return st(b.createElement("image",{})).call(C,n).style("x",0).style("y",0).style("width",a).style("height",o).style("src",l.canvas).style("transform",e).call(C,y).node()}},VO=(YO.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},t=>{const n=t["render"],r=it(t,["render"]);return t=>{var[[t,e]]=t;return n(Object.assign(Object.assign({},r),{x:t,y:e}))}}),qO=(VO.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},{BLACK:"#000",WHITE:"#fff",STROKE:"#416180"}),$O=t=>{var e={defaultColor:"#5B8FF9",defaultCategory10:"category10",defaultCategory20:"category20",defaultSize:1,elementActiveStroke:qO.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:qO.BLACK,lineWidth:1}},text:{text:{fill:"#1D2129",fontSize:12,strokeWidth:0,connectorStroke:qO.STROKE,connectorStrokeOpacity:.45,connectorLineWidth:1,backgroundFill:qO.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:qO.STROKE,markerFillOpacity:.25,markerStrokeOpacity:0}},lineX:{line:{stroke:qO.STROKE,strokeOpacity:.45,lineWidth:1}},lineY:{line:{stroke:qO.STROKE,strokeOpacity:.45,lineWidth:1}},rangeX:{range:{fill:qO.STROKE,fillOpacity:.15,lineWidth:0}},rangeY:{range:{fill:qO.STROKE,fillOpacity:.15,lineWidth:0}},connector:{connector:{stroke:qO.STROKE,strokeOpacity:.45,lineWidth:1,connectLength1:12,endMarker:!0,endMarkerSize:6,endMarkerFill:qO.STROKE,endMarkerFillOpacity:.95}},interaction:{active:{line:{line:{lineWidth:3}},interval:{rect:{stroke:qO.BLACK}},area:{area:{fillOpacity:.5}}},inactive:{area:{area:{fillOpacity:.3}}},selected:{},disabled:{}},axis:{arrow:!1,gridLineDash:[0,0],gridLineWidth:.5,gridStroke:qO.BLACK,gridStrokeOpacity:.05,labelAlign:"horizontal",labelFill:qO.BLACK,labelFillOpacity:.65,labelFontSize:12,labelFontWeight:"lighter",labelSpacing:8,line:!1,lineLineWidth:.5,lineStroke:qO.BLACK,lineStrokeOpacity:.45,tickLength:4,tickLineWidth:1,tickStroke:qO.BLACK,tickStrokeOpacity:.25,titleFill:qO.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},axisArc:{title:!1,titlePosition:"inner",line:!1,tick:!0,labelSpacing:4},axisRadar:{girdClosed:!0,gridStrokeOpacity:.3,gridType:"surround",label:!1,tick:!1,titlePosition:"start"},legendCategory:{backgroundFill:"transparent",itemBackgroundFill:"transparent",itemLabelFill:qO.BLACK,itemLabelFillOpacity:.65,itemLabelFontSize:12,itemLabelFontWeight:"lighter",itemMarkerFillOpacity:1,itemMarkerSize:8,itemSpacing:[5,8],itemValueFill:qO.BLACK,itemValueFillOpacity:.65,itemValueFontSize:12,itemValueFontWeight:"lighter",navButtonFill:qO.BLACK,navButtonFillOpacity:.65,navPageNumFill:qO.BLACK,navPageNumFillOpacity:.45,navPageNumFontSize:12,padding:8,title:!0,titleFill:qO.BLACK,titleFillOpacity:.65,titleFontSize:12,titleFontWeight:"normal",titleSpacing:4,tickStroke:qO.BLACK,tickStrokeOpacity:.25,rowPadding:0,colPadding:8},legendContinuous:{handleHeight:12,handleLabelFill:qO.BLACK,handleLabelFillOpacity:.45,handleLabelFontSize:12,handleLabelFontWeight:"normal",handleMarkerFill:qO.BLACK,handleMarkerFillOpacity:.6,handleMarkerLineWidth:1,handleMarkerStroke:qO.BLACK,handleMarkerStrokeOpacity:.25,handleWidth:10,labelFill:qO.BLACK,labelFillOpacity:.45,labelFontSize:12,labelFontWeight:"lighter",labelSpacing:3,tick:!0,tickLength:12,ribbonSize:12,ribbonFill:"#aaa",handle:!0,handleLabel:!1,handleShape:"slider",handleIconSize:12/1.8,indicator:!1,titleFontSize:12,titleSpacing:4,titleFontWeight:"normal",titleFillOpacity:.65,tickStroke:qO.BLACK,tickStrokeOpacity:.25},label:{fill:qO.BLACK,fillOpacity:.65,fontSize:12,fontWeight:"normal",stroke:void 0,offset:12,connectorStroke:qO.BLACK,connectorStrokeOpacity:.45,connectorLineWidth:1,connectorLength:12,connectorLength2:8,connectorDistance:4},innerLabel:{fill:qO.WHITE,fontSize:12,fillOpacity:.85,fontWeight:"normal",stroke:void 0,offset:0},slider:{trackSize:16,trackFill:qO.STROKE,trackFillOpacity:1,selectionFill:"#5B8FF9",selectionFillOpacity:.15,handleIconSize:10,handleIconFill:"#f7f7f7",handleIconFillOpacity:1,handleIconStroke:qO.BLACK,handleIconStrokeOpacity:.25,handleIconLineWidth:1,handleIconRadius:2,handleLabelFill:qO.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:qO.BLACK,titleFillOpacity:.85,titleFontSize:14,titleFontWeight:"bold",titleTextBaseline:"top",subtitleFill:qO.BLACK,subtitleFillOpacity:.65,subtitleFontSize:12,subtitleFontWeight:"normal",subtitleTextBaseline:"top"}};return Object.assign({},e,t)},UO=($O.props={},{BLACK:"#fff",WHITE:"#000",STROKE:"#416180"}),XO=t=>{var e={defaultColor:"#5B8FF9",defaultCategory10:"category10",defaultCategory20:"category20",defaultSize:1,elementActiveStroke:UO.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:UO.BLACK,lineWidth:1}},text:{text:{fill:UO.BLACK,fillOpacity:.65,fontSize:12,strokeWidth:0,connectorStroke:UO.STROKE,connectorStrokeOpacity:.45,connectorLineWidth:1,backgroundFill:UO.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:UO.STROKE,markerFillOpacity:.25,markerStrokeOpacity:0}},lineX:{line:{stroke:UO.STROKE,strokeOpacity:.45,lineWidth:1}},lineY:{line:{stroke:UO.STROKE,strokeOpacity:.45,lineWidth:1}},rangeX:{range:{fill:UO.STROKE,fillOpacity:.15,lineWidth:0}},rangeY:{range:{fill:UO.STROKE,fillOpacity:.15,lineWidth:0}},connector:{connector:{stroke:UO.STROKE,strokeOpacity:.45,lineWidth:1,connectLength1:12,endMarker:!0,endMarkerSize:6,endMarkerFill:UO.STROKE,endMarkerFillOpacity:.95}},interaction:{active:{line:{line:{lineWidth:3}},interval:{rect:{stroke:UO.BLACK}},area:{area:{fillOpacity:.5}}},inactive:{area:{area:{fillOpacity:.3}}},selected:{},disabled:{}},axis:{arrow:!1,gridLineDash:[0,0],gridLineWidth:.5,gridStroke:UO.BLACK,gridStrokeOpacity:.05,labelAlign:"horizontal",labelFill:UO.BLACK,labelFillOpacity:.65,labelFontSize:12,labelFontWeight:"lighter",labelSpacing:8,lineLineWidth:.5,lineStroke:UO.BLACK,lineStrokeOpacity:.45,tickLength:4,tickLineWidth:1,tickStroke:UO.BLACK,tickStrokeOpacity:.25,titleFill:UO.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"},axisArc:{title:!1,titlePosition:"inner",line:!1,tick:!0,labelSpacing:4},legendCategory:{backgroundFill:"transparent",itemBackgroundFill:"transparent",itemLabelFill:UO.BLACK,itemLabelFillOpacity:.65,itemLabelFontSize:12,itemLabelFontWeight:"lighter",itemMarkerFillOpacity:1,itemMarkerSize:8,itemSpacing:[5,8],itemValueFill:UO.BLACK,itemValueFillOpacity:.65,itemValueFontSize:12,itemValueFontWeight:"lighter",navButtonFill:UO.BLACK,navButtonFillOpacity:.45,navPageNumFill:UO.BLACK,navPageNumFillOpacity:.45,navPageNumFontSize:12,padding:8,title:!0,titleFill:UO.BLACK,titleFillOpacity:.65,titleFontSize:12,titleFontWeight:"normal",titleSpacing:4,tickStroke:UO.BLACK,tickStrokeOpacity:.25,rowPadding:0,colPadding:8},legendContinuous:{handleHeight:12,handleLabelFill:UO.BLACK,handleLabelFillOpacity:.45,handleLabelFontSize:12,handleLabelFontWeight:"normal",handleMarkerFill:UO.BLACK,handleMarkerFillOpacity:.6,handleMarkerLineWidth:1,handleMarkerStroke:UO.BLACK,handleMarkerStrokeOpacity:.25,handleWidth:10,labelFill:UO.BLACK,labelFillOpacity:.45,labelFontSize:12,labelFontWeight:"lighter",labelSpacing:3,tick:!0,tickLength:12,ribbonSize:12,ribbonFill:"#aaa",handle:!0,handleLabel:!1,handleShape:"slider",handleIconSize:12/1.8,indicator:!1,titleFontSize:12,titleSpacing:4,titleFontWeight:"normal",titleFillOpacity:.65,tickStroke:UO.BLACK,tickStrokeOpacity:.25},label:{fill:UO.BLACK,fillOpacity:.65,fontSize:12,fontWeight:"normal",stroke:void 0,offset:12,connectorStroke:UO.BLACK,connectorStrokeOpacity:.45,connectorLineWidth:1,connectorLength:12,connectorLength2:8,connectorDistance:4},innerLabel:{fill:UO.WHITE,fontSize:12,fillOpacity:.85,fontWeight:"normal",stroke:void 0,offset:0},slider:{trackSize:16,trackFill:UO.STROKE,trackFillOpacity:1,selectionFill:"#5B8FF9",selectionFillOpacity:.15,handleIconSize:10,handleIconFill:"#f7f7f7",handleIconFillOpacity:1,handleIconStroke:UO.BLACK,handleIconStrokeOpacity:.25,handleIconLineWidth:1,handleIconRadius:2,handleLabelFill:UO.BLACK,handleLabelFillOpacity:.45,handleLabelFontSize:12,handleLabelFontWeight:"normal"},scrollbar:{},title:{titleFill:UO.BLACK,titleFillOpacity:.85,titleFontSize:14,titleFontWeight:"bold",titleTextBaseline:"top",subtitleFill:UO.BLACK,subtitleFillOpacity:.65,subtitleFontSize:12,subtitleFontWeight:"normal",subtitleTextBaseline:"top"}};return Object.assign({},e,t)},KO=(XO.props={},{BLACK:"#000",WHITE:"#fff",STROKE:"#888"}),ZO=t=>{var e={defaultColor:"#4e79a7",defaultCategory10:"tableau10",defaultCategory20:"tableau10",defaultSize:1,elementActiveStroke:KO.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:KO.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:KO.STROKE,connectorStrokeOpacity:.45,connectorLineWidth:1,backgroundFill:KO.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:KO.STROKE,markerFillOpacity:.25,markerStrokeOpacity:0}},lineX:{line:{stroke:KO.STROKE,strokeOpacity:.45,lineWidth:1}},lineY:{line:{stroke:KO.STROKE,strokeOpacity:.45,lineWidth:1}},rangeX:{range:{fill:KO.STROKE,fillOpacity:.15,lineWidth:0}},rangeY:{range:{fill:KO.STROKE,fillOpacity:.15,lineWidth:0}},connector:{connector:{stroke:KO.STROKE,strokeOpacity:.45,lineWidth:1,connectLength1:12,endMarker:!0,endMarkerSize:6,endMarkerFill:KO.STROKE,endMarkerFillOpacity:.95}},interaction:{active:{line:{line:{lineWidth:3}},interval:{rect:{stroke:KO.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:KO.BLACK,labelFillOpacity:1,labelFontSize:10,labelFontWeight:"normal",labelSpacing:4,line:!0,lineLineWidth:1,lineStroke:"#888",lineStrokeOpacity:1,tickLength:5,tickLineWidth:1,tickStroke:KO.STROKE,tickStrokeOpacity:1,titleFill:KO.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"},axisArc:{title:!1,titlePosition:"inner",line:!1,tick:!0,labelSpacing:4},axisRadar:{girdClosed:!0,gridStrokeOpacity:.3,gridType:"surround",label:!1,tick:!1,titlePosition:"start"},legendCategory:{backgroundFill:"transparent",itemBackgroundFill:"transparent",itemLabelFill:KO.BLACK,itemLabelFillOpacity:1,itemLabelFontSize:10,itemLabelFontWeight:"normal",itemMarkerFillOpacity:1,itemMarkerSize:8,itemSpacing:[5,4],itemValueFill:KO.BLACK,itemValueFillOpacity:1,itemValueFontSize:10,itemValueFontWeight:"normal",navButtonFill:KO.BLACK,navButtonFillOpacity:.45,navButtonSize:6,navPageNumFill:KO.BLACK,navPageNumFillOpacity:.45,navPageNumFontSize:10,padding:8,title:!0,titleFill:KO.BLACK,titleFillOpacity:1,titleFontSize:11,titleFontWeight:"bold",titleSpacing:4,rowPadding:0,colPadding:8},legendContinuous:{handleHeight:12,handleLabelFill:KO.BLACK,handleLabelFillOpacity:.45,handleLabelFontSize:10,handleLabelFontWeight:"normal",handleMarkerFill:KO.BLACK,handleMarkerFillOpacity:.6,handleMarkerLineWidth:1,handleMarkerStroke:KO.BLACK,handleMarkerStrokeOpacity:.25,handleWidth:10,labelFill:KO.BLACK,labelFillOpacity:.45,labelFontSize:10,labelFontWeight:"normal",title:!0,titleSpacing:4,ribbonFill:"#aaa",handle:!0,handleLabel:!1,handleShape:"slider",handleIconSize:12/1.8,indicator:!1,titleFontWeight:"bold"},label:{fill:KO.BLACK,fillOpacity:.65,fontSize:10,fontWeight:"normal",stroke:void 0,offset:12,connectorStroke:KO.BLACK,connectorStrokeOpacity:.45,connectorLineWidth:1,connectorLength:12,connectorLength2:8,connectorDistance:4},innerLabel:{fill:KO.WHITE,fontSize:10,fillOpacity:.85,fontWeight:"normal",stroke:void 0,offset:0},slider:{trackSize:16,trackFill:KO.STROKE,trackFillOpacity:.05,selectionFill:"#4e79a7",selectionFillOpacity:.15,handleIconSize:10,handleIconFill:"#f7f7f7",handleIconFillOpacity:1,handleIconStroke:KO.BLACK,handleIconStrokeOpacity:.25,handleIconLineWidth:1,handleIconRadius:2,handleLabelFill:KO.BLACK,handleLabelFillOpacity:.45,handleLabelFontSize:10,handleLabelFontWeight:"normal"},scrollbar:{},title:{titleFill:KO.BLACK,titleFillOpacity:.85,titleFontSize:14,titleFontWeight:"bold",titleTextBaseline:"top",subtitleFill:KO.BLACK,subtitleFillOpacity:.65,subtitleFontSize:12,subtitleFontWeight:"normal",subtitleTextBaseline:"top"}};return Object.assign({},e,t)};function QO(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)]}ZO.props={};var JO,tk=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function ek(t){var e;if(e=tk.exec(t))return new nk({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 nk(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 rk(t,e){var n,e=QO(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+""}ek.prototype=nk.prototype,nk.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 ik={"%":(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)=>rk(100*t,e),r:rk,s:function(t,e){var n,r,i=QO(t,e);return i?(n=i[0],(i=(i=i[1])-(JO=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")+QO(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 ak(t){return t}var ok,sk=Array.prototype.map,lk=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function ck(t){var e,s,l,M=void 0===t.grouping||void 0===t.thousands?ak:(s=sk.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?ak:(e=sk.call(t.numerals,String),function(t){return t.replace(/[0-9]/g,function(t){return e[+t]})}),a=void 0===t.percent?"%":t.percent+"",E=void 0===t.minus?"−":t.minus+"",S=void 0===t.nan?"NaN":t.nan+"";function o(t){var c=(t=ek(t)).fill,u=t.align,h=t.sign,e=t.symbol,f=t.zero,d=t.width,p=t.comma,g=t.precision,y=t.trim,m=t.type,v=("n"===m?(p=!0,m="g"):ik[m]||(void 0===g&&(g=12),y=!0,m="g"),(f||"0"===c&&"="===u)&&(f=!0,c="0",u="="),"$"===e?r:"#"===e&&/[boxX]/.test(m)?"0"+m.toLowerCase():""),b="$"===e?i:/[%p]/.test(m)?a:"",x=ik[m],w=/[defgprs%]/.test(m);function n(t){var e,n,r,i=v,a=b;if("c"===m)a=x(t)+a,t="";else{var o=(t=+t)<0||1/t<0;if(t=isNaN(t)?S:x(Math.abs(t),g),y&&(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&&"+"!==h?!1:o)?"("===h?h:E:"-"===h||"("===h?"":h)+i,a=("s"===m?lk[8+JO/3]:"")+a+(o&&"("===h?")":""),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&&!f&&(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&&f&&(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(m)?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=ek(t)).type="f",t)),e=3*Math.max(-8,Math.min(8,Math.floor((t=e,((t=QO(Math.abs(t)))?t[1]:NaN)/3)))),r=Math.pow(10,-e),i=lk[8+e/3];return function(t){return n(r*t)+i}}}}function uk(t,e,n){return t.querySelector(e)?st(t).select(e):st(t).append(n)}function hk(t){return Array.isArray(t)?t.join(", "):""+(t||"")}function fk(t,e){let{flexDirection:n,justifyContent:r,alignItems:i}={flexDirection:"row",justifyContent:"flex-start",alignItems:"center"};var a={top:["row","flex-start","center"],bottom:["row","flex-start","center"],left:["column","center","center"],right:["column","center","center"],center:["column","center","center"]};return t in a&&([n,r,i]=a[t]),Object.assign({display:"flex",flexDirection:n,justifyContent:r,alignItems:i},e)}zs=ck({thousands:",",grouping:[3],currency:["$",""]}),ok=zs.format,zs.formatPrefix;class dk extends js{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 pk extends dk{update(t){var e,t=t["subOptions"];null!=(e=this.child)&&e.update(t)}}function gk(t,e){return null==(t=t.filter(t=>t.getOptions().name===e))?void 0:t[0]}function yk(t,e,n){var t=t["bbox"],{position:e="top",size:r,length:i,crossPadding:a=0}=e,e=["top","bottom","center"].includes(e),[t,o]=e?[t.height,t.width]:[t.width,t.height],{defaultSize:n,defaultLength:s}=n.props,r=(r||n||t)-2*a,n=i||s||o,[t,a]=e?[n,r]:[r,n];return{orientation:e?"horizontal":"vertical",width:t,height:a,size:r,length:n}}function mk(t){const n=["arrow","crosshairs","grid","handle","handleLabel","indicator","label","line","tick","tip","title","trunc"];var e=t["style"],t=it(t,["style"]);const r={};return Object.entries(t).forEach(([t,e])=>{n.includes(t)?r["show"+Ye(t)]=e:r[t]=e}),Object.assign(Object.assign({},r),e)}function vk(t){var{innerWidth:t,innerHeight:e}=t.getOptions();return[t,e]}function bk(t){return"number"!=typeof t||Math.abs(t)<1e-15?t:parseFloat(t.toFixed(15))}function xk(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]=Id(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),h=n||(null==(l=a.getFormatter)?void 0:l.call(a))||u,f=function(t,e){if(vp(e))return t=>t;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 Wm({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 Mp(i)?(e=i.map("bottom"===r?[t,1]:[0,t]),"bottom"===r?(n=e[0],new Wm({domain:[0,a],range:[0,1]}).map(n)):"left"===r?(n=e[1],new Wm({domain:[0,o],range:[0,1]}).map(n)):t):t}}(o,s);return vp(s)||mp(s)?c.map((t,e,n)=>{var r,i=(null==(i=a.getBandWidth)?void 0:i.call(a,t))/2||0,i=f(a.map(t)+i);return{value:bp(s)&&"center"===o||mp(s)&&(null==(r=a.getTicks)?void 0:r.call(a))&&["top","bottom","center","outer"].includes(o)?1-i:i,label:u(h(bk(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(f(a.map(t)+r)),label:u(h(bk(t),e,n)),id:String(e)}})}function wk(t,e,n){var r;return!(vp(r=e)&&mp(r)||wp(e))&&(void 0===t?!!n.getTicks:t)}function Mk(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"+u0(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 Ok,Io=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?ok(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 kk=Io(t=>{const{direction:o="left",important:s={},labelFormatter:l,orientation:c,position:u,size:h,style:f={},title:d,tickCount:p,tickFilter:g,tickMethod:y,transform:m,indexBBox:v}=t,b=it(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=Mk(0,0,r,o,u,c),r=Object.assign(Object.assign(Object.assign({},r),f),b),a=function(t,e){var[e,n]=vk(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]=kp(r);const[u,h]=Ep(r);var a=Math.min(a,o)/2,{insetLeft:o,insetTop:r}=r.getOptions(),l=l*a,c=c*a,[a,t]=[t+n-o,s+i-r],[n,o]=[Math.cos(e),Math.sin(e)];return{startPos:[a+c*n,t+c*o],endPos:[a+l*n,t+l*o],gridClosed:h-u==360,gridCenter:[a,t],gridControlAngles:new Array(3).fill(0).map((t,e,n)=>(h-u)/(n.length-1)*e)}}}return{}}(u,c,e,n),i=xk(t,i,p,l,g,y,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:h,titleText:hk(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}(m,r),grid:wk(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 UM({className:"axis",style:mk(i)})}}),Ek=Io(t=>{const{position:o,labelFormatter:s,tickFilter:l,tickCount:c,tickMethod:u,important:h={},indexBBox:f,title:d,grid:p=!1}=t,g=it(t,["order","size","position","orientation","labelFormatter","tickFilter","tickCount","tickMethod","important","style","indexBBox","title","grid"]);return({scales:[t],value:e,coordinate:n,theme:r})=>{var e=e["bbox"],i=t.getOptions()["domain"],t=xk(t,i,c,s,l,u,o,n),i=f?t.map((t,e)=>{e=f.get(e);return!e||e[0]!==t.label?t:Object.assign(Object.assign({},t),{bbox:e[1]})}):t,[t,a]=kp(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]=Ep(i),[l,c]=vk(i),a={center:e,radius:a,startAngle:o,endAngle:s,gridLength:(r-n)*(Math.min(l,c)/2)};return"inner"===t?({insetLeft:o,insetTop:s}=i.getOptions(),Object.assign(Object.assign({},a),{center:[e[0]-o,e[1]-s],labelAlign:"perpendicular",labelDirection:"positive",tickDirection:"positive",gridDirection:"negative"})):Object.assign(Object.assign({},a),{labelAlign:"parallel",labelDirection:"negative",tickDirection:"negative",gridDirection:"positive"})}(o,e,t,a,n),{axis:t,axisArc:a={}}=r,n=mk(ot({},t,a,e,Object.assign(Object.assign({type:"arc",data:i,titleText:hk(d),grid:p},g),h)));return new UM({style:Qe(n,["transform"])})}}),Sk=(kk.props={defaultPosition:"center",defaultSize:45,defaultOrder:0},Ek.props={defaultPosition:"outer",defaultOrientation:"vertical",defaultSize:45,defaultOrder:0},e=>(...t)=>kk(Object.assign({},{crossPadding:50},e))(...t)),Ak=(Sk.props=Object.assign(Object.assign({},kk.props),{defaultPosition:"bottom"}),e=>(...t)=>kk(Object.assign({},{crossPadding:10},e))(...t));Ak.props=Object.assign(Object.assign({},kk.props),{defaultPosition:"left"});const _k=a=>{const{important:o={}}=a,s=it(a,["important"]);return t=>{var e,{theme:n,coordinate:r,scales:i}=t;return kk(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[t]=r,r=t.getOptions().name;const[a,o]=Ep(n);var{axisRadar:t={}}=e;return Object.assign(Object.assign({},t),{grid:"position"===r,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 Tk(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(Ee(t))return t[t.length-1]}(t.split("."));return()=>function(t,e){var{fill:n,stroke:r,lineWidth:i,color:a}=e,o=it(e,["d","fill","strokeWidth","path","stroke","lineWidth","color"]);const s=b2.get(t)||b2.get("point");return(...t)=>{return new gc({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 Pk(t,{scales:e,library:n,markState:r}){const[i,a]=function(t,e){var n=gk(t,"shape"),r=gk(t,"color");const i=n?n.clone():null,a=[];for(const[c,u]of e){var o=c.type,s=(0<(null==r?void 0:r.getOptions().domain.length)?null==r?void 0:r.getOptions().domain:u.data).map((t,e)=>{return i?i.map(t||"point"):(null==(t=null===c||void 0===c?void 0:c.style)?void 0:t.shape)||u.defaultShape||"point"});"string"==typeof o&&a.push([o,s])}if(0===a.length)return["point",["point"]];if(1===a.length)return a[0];if(!n)return a[0];const l=n.getOptions()["range"];return a.map(([t,e])=>{let n=0;for(let t=0;t<a.length;t++){var r=l[t%l.length];e[t]===r&&n++}return[n/e.length,[t,e]]}).sort((t,e)=>e[0]-t[0])[0][1]}(e,r),o=(t,e)=>Tk(t,n,0,0,{color:e}),s=t=>i+"."+a[t],l=t["itemMarker"];return gk(e,"shape")&&!l?(t,e)=>o(s(e),t.color):"function"==typeof l?(t,e)=>{e=l(t.id,e);return"string"==typeof e?o(e,t.color):e}:(t,e)=>o(l||s(e),t.color)}function Lk(t,e){var{labelFormatter:n=t=>""+t}=t,{scales:r,theme:i}=e,i={itemMarker:Pk(t,e),itemMarkerSize:(t=r,e=i.legendCategory.itemMarkerSize,(t=gk(t,"size"))?2*t.map(NaN):e),itemMarkerOpacity:function(t){if(t=gk(t,"opacity")){const n=t.getOptions()["range"];return(t,e)=>n[e]}}(r)};const a="string"==typeof n?ok(n):n,o=gk(r,"color");t=r.find(t=>0<t.getOptions().domain.length).getOptions().domain;return Object.assign(Object.assign({},i),{data:t.map(t=>({id:t,label:a(t),color:o.map(t)}))})}_k.props=Object.assign(Object.assign({},kk.props),{defaultPosition:"center"});const Ck=o=>{const{layout:s,position:l,title:c,cols:u}=o,h=it(o,["labelFormatter","layout","order","orientation","position","size","title","cols","itemMarker"]),f=h["gridRow"];return t=>{var{value:e,theme:n}=t,r=e["bbox"],{width:e,height:i}=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}=yk(t,e,n);return{width:i,height:a}}(e,o,Ck),a=fk(l,s),e=Object.assign(Object.assign(Object.assign(Object.assign({orientation:["right","left","center"].includes(l)?"vertical":"horizontal",width:e,height:i,layout:void 0!==u?"grid":"flex"},void 0!==u&&{gridCol:u}),void 0!==f&&{gridRow:f}),{titleText:hk(c)}),Lk(o,t)),{legendCategory:i={}}=n,t=mk(Object.assign({},i,e,h)),n=new pk({style:Object.assign(Object.assign({x:r.x,y:r.y,width:r.width,height:r.height},a),{subOptions:t})});return n.appendChild(new b5({className:"legend-category",style:t})),n}};function Nk(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 jk(t){var t=t.getOptions()["domain"],[t,e]=[t[0],gv(t)];return[t,e]}function Rk(t,e,n,r,i,a){const o=t["length"];var i=i.color?a.legendContinuous.ribbonFill||"black":a.defaultColor;const s=e||(a=i,i=(e=n||r).getOptions(),(e=e.clone()).update(Object.assign(Object.assign({},i),{range:[ha(a).toString()]})),e),[l,c]=jk(s);return Object.assign(Object.assign({},t),{data:s.getTicks().map(t=>({value:t})),color:new Array(o).fill(0).map((t,e)=>{var e=(c-l)/(o-1)*e+l,n=s.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 Ik(t,e,n,r,i,a){var o=gk(t,"color"),n=function(t,e,n){var{size:r,crossPadding:i=0}=e,t=yk(t,e,n);return e=r-2*i,r=(n=t).orientation,n.size=e,"horizontal"===(r=r)||0===r?n.height=e:n.width=e,n}(n,r,i);if(o instanceof qm){var r=o.getOptions()["range"],[i,s]=jk(o);if(o instanceof Xm||o instanceof Zm)return Nk(n,o,i,s,r);{i=n;s=o;const l=[-1/0,...s.thresholds,1/0].map((t,e)=>({value:e,label:t}));return Object.assign(Object.assign({},i),{data:l,color:r,labelFilter:(t,e)=>0<e&&e<l.length-1})}}return Rk(n,o,gk(t,"size"),gk(t,"opacity"),e,a)}Ck.props={defaultPosition:"top",defaultOrder:1,defaultSize:40,defaultPadding:[20,10],defaultCrossPadding:[5,10]};const Bk=u=>{const{labelFormatter:h,layout:f,position:d,title:p,style:g}=u,y=it(u,["labelFormatter","layout","order","orientation","position","size","title","style","crossPadding","padding"]);return({scales:t,value:e,theme:n,scale:r})=>{var i=e["bbox"],{x:i,y:a,width:o,height:s}=i,l=fk(d,f),{legendContinuous:c={}}=n,c=mk(Object.assign({},c,Object.assign(Object.assign({titleText:hk(p),labelAlign:"value",labelFormatter:"string"==typeof h?t=>ok(h)(t.label):h},Ik(t,r,e,u,Bk,n)),g),y)),t=new dk({style:Object.assign(Object.assign({x:i,y:a,width:o,height:s},l),{subOptions:c})});return t.appendChild(new z5({style:c})),t}},Dk=(Bk.props={defaultPosition:"top",defaultOrientation:"vertical",defaultOrder:1,defaultSize:60,defaultLength:200,defaultLegendSize:60,defaultPadding:[20,10],defaultCrossPadding:[5,10]},e=>(...t)=>Bk(Object.assign({},{block:!0},e))(...t)),Fk=(Dk.props=Object.assign(Object.assign({},Bk.props),{defaultPosition:"top",defaultOrientation:"horizontal"}),n=>t=>{var e=t["scales"],e=gk(e,"size");return Bk(Object.assign({},{type:"size",data:e.getTicks().map((t,e)=>({value:t,label:String(t)}))},n))(t)}),zk=(Fk.props=Object.assign(Object.assign({},Bk.props),{defaultPosition:"top",defaultOrientation:"horizontal"}),t=>Fk(Object.assign({},{block:!0},t)));function Wk(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"}}}zk.props=Object.assign(Object.assign({},Bk.props),{defaultPosition:"top",defaultOrientation:"horizontal"});Ok={render(t,e){const{y:n,width:r,title:i,subtitle:a}=t,o=t.style,{spacing:s=2,align:l="left"}=o,c=it(o,["spacing","align"]);t=at(c,"title");const u=at(c,"subtitle"),h=uk(e,".title","text").attr("className","title").call(C,Object.assign(Object.assign(Object.assign({},Wk(0,n,r,l)),{fontSize:14,textBaseline:"top",text:i}),t)).node().getLocalBounds();uk(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({},Wk(0,h.max[1]+s,r,l)),{fontSize:12,textBaseline:"top",text:a}),u))})}};const Gk=class extends Zl{constructor(t){super(t),this.descriptor=Ok}connectedCallback(){var t,e;null!=(e=(t=this.descriptor).render)&&e.call(t,this.attributes,this)}update(t={}){var e;this.attr(ot({},this.attributes,t)),null!=(e=(t=this.descriptor).render)&&e.call(t,this.attributes,this)}},Hk=a=>({value:t,theme:e})=>{var{x:t,y:n,width:r,height:i}=t.bbox;return new Gk({style:ot({},{style:e.title},Object.assign({x:t,y:n,width:r,height:i},a))})};function Yk(t){return t.getBandWidth}function Vk(t,e,n){if(!Yk(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=Cd(t,e);return r=n+a,t=0,e=i.length-1,i[Math.min(e,Math.max(t,r))]}function qk(t,e,n){if(!e)return t.getOptions().domain;if(!Yk(t))return o=qd(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 $k(t,e,n,r,i,a){const{x:o,y:s}=i;i=(t,e)=>{var[t,n]=a.invert(t);return[Vk(o,t,e),Vk(s,n,e)]},t=i([t,e],!0),e=i([n,r],!1);return[qk(o,[t[0],e[0]]),qk(s,[t[1],e[1]])]}function Uk(t,e){var[t,n]=t;return[e.map(t),e.map(n)+((t=e).getStep?t.getStep():0)]}Hk.props={defaultPosition:"top",defaultOrder:2,defaultSize:36};const Xk=t=>{const{orientation:h,labelFormatter:f,style:d}=t,p=it(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 f?ok(f):f;var c="horizontal"===h;const u=mp(r)&&c;return new Lw({className:"slider",style:Object.assign({},e,Object.assign(Object.assign({x:t,y:i,trackLength:c?a:o,orientation:h,formatter:t=>{var e=l||s,t=u?1-t:t;return e(Vk(n,t,!0))}},d),p))})}},Kk=(Xk.props={defaultPosition:"bottom",defaultSize:24,defaultOrder:1},t=>Xk(Object.assign(Object.assign({},t),{orientation:"horizontal"}))),Zk=(Kk.props=Object.assign(Object.assign({},Xk.props),{defaultPosition:"bottom"}),t=>Xk(Object.assign(Object.assign({},t),{orientation:"vertical"}))),Qk=(Zk.props=Object.assign(Object.assign({},Xk.props),{defaultPosition:"left"}),t=>{const{orientation:s,style:l}=t,c=it(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 jw({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}))})}}),Jk=(Qk.props={defaultPosition:"bottom",defaultSize:24,defaultOrder:1},t=>Qk(Object.assign(Object.assign({},t),{orientation:"horizontal"}))),tE=(Jk.props=Object.assign(Object.assign({},Qk.props),{defaultPosition:"bottom"}),t=>Qk(Object.assign(Object.assign({},t),{orientation:"vertical"}))),eE=(tE.props=Object.assign(Object.assign({},Qk.props),{defaultPosition:"left"}),t=>()=>new rc),nE=(eE.props={},(c,t)=>{const u=t["coordinate"];return(t,e,n)=>{const[r]=t;var t=r.getBoundingClientRect()["height"],{transform:i="",fillOpacity:a=1,strokeOpacity:o=1,opacity:s=1}=r.style,[t,l]=mp(u)?[[0,t],"scale(1, 0.0001)"]:[[0,0],"scale(0.0001, 1)"],l=[{transform:(i+" "+l).trimStart(),fillOpacity:0,strokeOpacity:0,opacity:0},{transform:(i+" "+l).trimStart(),fillOpacity:a,strokeOpacity:o,opacity:s,offset:.01},{transform:(i+" scale(1, 1)").trimStart(),fillOpacity:a,strokeOpacity:o,opacity:s}],i=(r.setOrigin(t),r.animate(l,Object.assign(Object.assign({},n),c)));return i.finished.then(()=>r.setOrigin(0,0)),i}}),rE=(c,t)=>{const u=t["coordinate"];return(t,e,n)=>{const[r]=t;var t=r.getBoundingClientRect()["height"],{transform:i="",fillOpacity:a=1,strokeOpacity:o=1,opacity:s=1}=r.style,[t,l]=mp(u)?[[0,t],"scale(1, 0.0001)"]:[[0,0],"scale(0.0001, 1)"],a=[{transform:(i+" scale(1, 1)").trimStart()},{transform:(i+" "+l).trimStart(),fillOpacity:a,strokeOpacity:o,opacity:s,offset:.99},{transform:(i+" "+l).trimStart(),fillOpacity:0,strokeOpacity:0,opacity:0}],o=(r.setOrigin(t),r.animate(a,Object.assign(Object.assign({},n),c)));return o.finished.then(()=>r.setOrigin(0,0)),o}},iE=(c,t)=>{const u=t["coordinate"];return(t,e,n)=>{const[r]=t;var t=r.getBoundingClientRect()["height"],{transform:i="",fillOpacity:a=1,strokeOpacity:o=1,opacity:s=1}=r.style,[t,l]=mp(u)?[[0,0],"scale(0.0001, 1)"]:[[0,t],"scale(1, 0.0001)"],l=[{transform:(i+" "+l).trimStart(),fillOpacity:0,strokeOpacity:0,opacity:0},{transform:(i+" "+l).trimStart(),fillOpacity:a,strokeOpacity:o,opacity:s,offset:.01},{transform:(i+" scale(1, 1)").trimStart(),fillOpacity:a,strokeOpacity:o,opacity:s}],i=(r.setOrigin(t),r.animate(l,Object.assign(Object.assign({},n),c)));return i.finished.then(()=>r.setOrigin(0,0)),i}},aE=(c,t)=>{const u=t["coordinate"];return(t,e,n)=>{const[r]=t;var t=r.getBoundingClientRect()["height"],{transform:i="",fillOpacity:a=1,strokeOpacity:o=1,opacity:s=1}=r.style,[t,l]=mp(u)?[[0,0],"scale(0.0001, 1)"]:[[0,t],"scale(1, 0.0001)"],a=[{transform:(i+" scale(1, 1)").trimStart()},{transform:(i+" "+l).trimStart(),fillOpacity:a,strokeOpacity:o,opacity:s,offset:.99},{transform:(i+" "+l).trimStart(),fillOpacity:0,strokeOpacity:0,opacity:0}],o=(r.setOrigin(t),r.animate(a,Object.assign(Object.assign({},n),c)));return o.finished.then(()=>r.setOrigin(0,0)),o}},oE=o=>(t,e,n)=>{var[t]=t,{fillOpacity:r=1,strokeOpacity:i=1,opacity:a=1}=t.style;return t.animate([{fillOpacity:0,strokeOpacity:0,opacity:0},{fillOpacity:r,strokeOpacity:i,opacity:a}],Object.assign(Object.assign({},n),o))},sE=(oE.props={},o=>(t,e,n)=>{var[t]=t,{fillOpacity:r=1,strokeOpacity:i=1,opacity:a=1}=t.style;return t.animate([{fillOpacity:r,strokeOpacity:i,opacity:a},{fillOpacity:0,strokeOpacity:0,opacity:0}],Object.assign(Object.assign({},n),o))});function lE(t,e){var n={};for(const i of e){var r=t.style[i];r&&(n[i]=r)}return n}sE.props={};const cE=["fill","stroke","fillOpacity","strokeOpacity","opacity","lineWidth"];function uE(t){var{min:t,max:e}=t.getLocalBounds(),[t,n]=t,[e,r]=e;return[t,n,e-t,r-n]}function hE(t,e){var[n,r,i,t]=uE(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),h=i/u;for(let t=0;t<u;t++){var f=n+t*h,d=r+l*s;o.push(function(t){var[t,e,n,r]=t;return`
|
|
2
2
|
M ${t} ${e}
|
|
3
3
|
L ${t+n} ${e}
|
|
4
4
|
L ${t+n} ${e+r}
|
|
5
5
|
L ${t} ${e+r}
|
|
6
6
|
Z
|
|
7
|
-
`}([f,d,h,s]))}c-=u,l+=1}return o}function t5(t,e){t.__data__=e.__data__,t.className=e.className,e.parentNode.replaceChild(t,e)}function e5(t,e){return t.indexOf(e)===t.lastIndexOf(e)}function n5(t){var e,t=xa(t);if(t&&(e5(e=t,"m")&&e5(e,"M")))return t}function r5(t,e,n,r){var i,a,o,s,l,c,u,h,f,d=e["nodeName"],p=n["nodeName"],g=n5(e),m=n5(n);if(d===p&&"path"!==d||(void 0===g||void 0===m))return p=n,d=r,[a,o,y,s]=QO(i=e),f=i.style.transform,l=p.style.transform,[c,v,u,h]=(t5(p,i),QO(p)),f=[Object.assign({transform:`${f?f+" ":""}translate(${a-c}, ${o-v}) scale(${y/u}, ${s/h})`},KO(i,ZO)),Object.assign({transform:`${l?l+" ":""}translate(0, 0) scale(1, 1)`},KO(p,ZO))],p.animate(f,d);{a=g;const b="path"===(o=(c=t)["nodeName"])?c:(t5(o=new Zs({style:Object.assign(Object.assign({},KO(c,ZO)),{d:a})}),c),o);var v=[Object.assign({path:g},KO(e,ZO)),Object.assign({path:m},KO(n,ZO))],y=b.animate(v,r);return y.onfinish=()=>{e0(b,n)},b.style.transform="scale(1, 1)",b.style.transform="none",y}}const i5=p=>(t,e,n)=>{[r="pack"]=[p.split];var r="function"==typeof r?r:JO,n=Object.assign(Object.assign({},n),p),i=t["length"],a=e["length"];if(1===i&&1===a||1<i&&1<a)return[o]=t,[l]=e,r5(o,o,l,n);if(1===i&&1<a){var[o]=t;{var s=o,l=e,c=n,o=r;s.style.visibility="hidden";const f=o(s,l.length);return l.map((t,e)=>{return r5(t,new Zs({style:Object.assign({path:f[e]},KO(s,ZO))}),t,c)})}}if(1<i&&1===a){var[i]=e;{var a=t,u=i,h=n;const d=(e=r)(u,a.length);var{fillOpacity:e=1,strokeOpacity:t=1,opacity:i=1}=u.style,e=u.animate([{fillOpacity:0,strokeOpacity:0,opacity:0},{fillOpacity:0,strokeOpacity:0,opacity:0,offset:.99},{fillOpacity:e,strokeOpacity:t,opacity:i}],h);return[...a.map((t,e)=>{return r5(t,t,new Zs({style:{path:d[e],fill:u.style.fill}}),h)}),e]}}return null},a5=(i5.props={},(v,y)=>{const b=(ri({name:"waveInArcAngle",inherits:!1,initialValue:"",interpolable:!0,syntax:i.NUMBER}),y)["coordinate"];return(t,e,n)=>{const[r]=t;if(!sp(b))return YO(v,y)(t,e,n);const i=b.getCenter();var{__data__:t,style:e}=r,{radius:e=0,inset:a=0,fillOpacity:o=1,strokeOpacity:s=1,opacity:l=1}=e,{points:t,y:c,y1:u}=t;const h=bb().cornerRadius(e).padAngle(a*Math.PI/180),f=by(b,t,[c,u]),{startAngle:d,endAngle:p}=f,g=new Zs({}),m=t=>{g.attr({d:h(t),transform:`translate(${i[0]}, ${i[1]})`});t=xa(g);return g.style.transform="",t};e=[{waveInArcAngle:d+1e-4,fillOpacity:0,strokeOpacity:0,opacity:0},{waveInArcAngle:d+1e-4,fillOpacity:o,strokeOpacity:s,opacity:l,offset:.01},{waveInArcAngle:p,fillOpacity:o,strokeOpacity:s,opacity:l}],a=r.animate(e,Object.assign(Object.assign({},n),v));return a.onframe=function(){r.style.path=m(Object.assign(Object.assign({},f),{endAngle:Number(r.style.waveInArcAngle)}))},a.onfinish=function(){r.style.path=m(Object.assign(Object.assign({},f),{endAngle:p}))},a}}),o5=(a5.props={},s=>{return(t,e,n)=>{const[r]=t;var{transform:t="",fillOpacity:i=1,strokeOpacity:a=1,opacity:o=1}=r.style,t=[{transform:(t+" scale(0.0001)").trimStart(),fillOpacity:0,strokeOpacity:0,opacity:0},{transform:(t+" scale(0.0001)").trimStart(),fillOpacity:i,strokeOpacity:a,opacity:o,offset:.01},{transform:(t+" scale(1)").trimStart(),fillOpacity:i,strokeOpacity:a,opacity:o}],{width:i,height:a}=r.getBoundingClientRect(),o=(r.setOrigin([i/2,a/2]),r.animate(t,Object.assign(Object.assign({},n),s)));return o.finished.then(()=>r.setOrigin(0,0)),o}}),s5=s=>{return(t,e,n)=>{const[r]=t;var{transform:t="",fillOpacity:i=1,strokeOpacity:a=1,opacity:o=1}=r.style,i=[{transform:(t+" scale(1)").trimStart()},{transform:(t+" scale(0.0001)").trimStart(),fillOpacity:i,strokeOpacity:a,opacity:o,offset:.99},{transform:(t+" scale(0.0001)").trimStart(),fillOpacity:0,strokeOpacity:0,opacity:0}],{width:a,height:o}=r.getBoundingClientRect(),t=(r.setOrigin([a/2,o/2]),r.animate(i,Object.assign(Object.assign({},n),s)));return t.finished.then(()=>r.setOrigin(0,0)),t}},l5=i=>(t,e,n)=>{var[t]=t,r=(null==(r=t.getTotalLength)?void 0:r.call(t))||0;return t.animate([{lineDash:[0,r]},{lineDash:[r,0]}],Object.assign(Object.assign({},n),i))},c5=(l5.props={},(o,s)=>(t,e,n)=>{const[r]=t;var{height:t,width:i}=r.getBoundingClientRect();const a=new Zs({style:{path:`M0,0L${i},0L${i},${t}L0,${t}Z`}});r.appendChild(a),r.style.clipPath=a;i=YO(o,s)([a],e,n);return i.finished.then(()=>{a.remove(),r.style.clipPath=null}),i}),u5=(c5.props={},(o,s)=>(t,e,n)=>{const[r]=t;var{height:t,width:i}=r.getBoundingClientRect();const a=new Zs({style:{path:`M0,0L${i},0L${i},${t}L0,${t}Z`}});r.appendChild(a),r.style.clipPath=a;i=qO(o,s)([a],e,n);return i.finished.then(()=>{a.remove(),r.style.clipPath=null}),i}),h5=(u5.props={},{visibility:"visible",opacity:1,fillOpacity:1,strokeOpacity:1});function f5(t,e,n,r){t.style[e]=n,r&&t.children.forEach(t=>f5(t,e,n,r))}function d5(t){f5(t,"visibility","hidden",!0)}function p5(t){f5(t,"visibility","visible",!0)}function g5(t){return st(t).selectAll("."+Zc).nodes().filter(t=>!t.__removed__)}function m5(t,e){return v5(t,e).flatMap(({container:t})=>g5(t))}function v5(e,t){return t.filter(t=>t!==e&&t.options.parentKey===e.options.key)}function y5(t){return st(t).select("."+Jc).node()}function b5(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 x5(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 w5(t){return t=>t.__data__.color}function M5(t){const e=t.scale["x"];return t=>{t=t.__data__.x;return e.invert(t)}}function k5(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 E5(s,l=(t,e)=>t,c=(t,e,n)=>t.setAttribute(e,n)){const u="__states__",h="__ordinal__",i=t=>{var{[u]:e=[],[h]: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:h5[o],o=l(i,t);c(t,r,o),r in n||(n[r]=a)}t[h]=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 O5(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 S5(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 A5(t){var{link:e=!1,valueof:l=(t,e)=>t}=t,c=it(t,["link","valueof","coordinate"]);if(!e)return[()=>{},()=>{}];const u=t=>t.__data__.points;return[t=>{if(!(t.length<=1)){var e=Rd(t,(t,e)=>{t=t.__data__.x,e=e.__data__.x;return t-e});for(let t=1;t<e.length;t++){var n=hb();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(),ry(c,t=>l(t,s))),{fill:i=s.getAttribute("fill")}=r,a=it(r,["fill"]),o=new Zs({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 _5(n,t,e){var r,i,a,o=t=>{var e=n.style["transform"];return e?e+" "+t:t};return sp(e)?(a=n.__data__["points"],[a,i]=op(e)?yy(a):a,r=ly(a,a=e.getCenter()),i=ly(i,a),a=hy(r)+dy(r,i)/2,o(`translate(${t*Math.cos(a)}, ${t*Math.sin(a)})`)):op(e)?o(`translate(${t}, 0)`):o(`translate(0, ${-t})`)}function T5(t){var{document:o,background:e,scale:s,coordinate:l,valueof:c}=t,u=it(t,["document","background","scale","coordinate","valueof"]);const h="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]},f=(t,e)=>{var n=s["x"];return CO(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 CO(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]=f(t,n),[n,a]=d(t,n),n=[[r,n],[i,n],[i,a],[r,a]].map(t=>l.map(t)),i=t["__data__"],{y:r,y1:a}=i;return $b(o,n,{y:r,y1:a},l,e)},g=(t,e)=>{var n,r,{transform:i="scale(1.2, 1.2)",transformOrigin:a="center center",stroke:o=""}=e,e=it(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=ry(u,t=>c(t,e)),{fill:n="#CCD6EC",fillOpacity:r=.3,zIndex:i=-2,padding:a=.001,strokeWidth:o=0}=t,t=it(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(CO)})()?p:g)(e,t);n.className=h,e.parentNode.appendChild(n),e.background=n},t=>{var e;null!=(e=t.background)&&e.remove(),t.background=null},t=>t.className===h]}function P5(t,e){t=t.getRootNode().defaultView.getContextService().getDomElement();null!=t&&t.style&&(t.style.cursor=e)}function L5(t,e,r){return t.find(n=>Object.entries(e).every(([t,e])=>r(n)[t]===e))}function C5(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 h=t(e),f=new Set(h),d=Pd(h,o);t=S5(h,a);const[p,g]=A5(Object.assign({elements:h,valueof:t,link:n,coordinate:l},at(u.active,"link"))),[m,v,y]=T5(Object.assign({document:e.ownerDocument,scale:s,coordinate:l,background:r,valueof:t},at(u.active,"background"))),{setState:b,removeState:x,hasState:w}=E5(ot(u,{active:Object.assign({},(null==(n=u.active)?void 0:n.offset)&&{transform:(...t)=>{var e=u.active.offset(...t),[,t]=t;return _5(h[t],e,l)}})}),t);let M;const k=t=>{var{target:e,nativeEvent:t=!0}=t;if(f.has(e)){M&&clearTimeout(M);var n=o(e),n=d.get(n),r=new Set(n);for(const i of h)r.has(i)?w(i,"active")||b(i,"active"):(b(i,"inactive"),g(i)),i!==e&&v(i);m(e),p(n),t&&c.emit("element:highlight",{nativeEvent:t,data:{data:a(e),group:n.map(a)}})}},E=(t=!0)=>{for(const e of h)x(e,"active","inactive"),v(e),g(e);t&&c.emit("element:unhighlight",{nativeEvent:t})},O=t=>{t=t.target;r&&!y(t)||(r||f.has(t))&&(0<i?(M&&clearTimeout(M),M=setTimeout(()=>{E(),M=null},i)):E())},S=()=>{E()},A=(e.addEventListener("pointerover",k),e.addEventListener("pointerout",O),e.addEventListener("pointerleave",S),t=>{t=t.nativeEvent;t||E(!1)}),_=t=>{var e=t["nativeEvent"];!e&&(e=t.data["data"],t=L5(h,e,a))&&k({target:t,nativeEvent:!1})};return c.on("element:highlight",_),c.on("element:unhighlight",A),()=>{e.removeEventListener("pointerover",k),e.removeEventListener("pointerout",O),e.removeEventListener("pointerleave",S),c.off("element:highlight",_),c.off("element:unhighlight",A);for(const t of h)v(t),g(t)}}function N5(t){var{delay:s,createGroup:l,background:c=!1,link:u=!1}=t,h=it(t,["delay","createGroup","background","link"]);return(t,e,n)=>{var{container:t,view:r,options:i}=t,{scale:a,coordinate:o}=r;return C5(y5(t),Object.assign({elements:g5,datum:k5(r),groupKey:l?l(r):void 0,coordinate:o,scale:a,state:O5(i,[["active",c?{}:{lineWidth:"1",stroke:"#000"}],"inactive"]),background:c,link:u,delay:s,emitter:n},h))}}function j5(t){return N5(Object.assign(Object.assign({},t),{createGroup:M5}))}function R5(t){return N5(Object.assign(Object.assign({},t),{createGroup:w5}))}function I5(e,{elements:t,datum:f,groupKey:d=t=>t,link:p=!1,single:g=!1,coordinate:n,background:r=!1,scale:i,emitter:m,state:a={}}){const v=t(e),y=new Set(v),b=Pd(v,d);t=S5(v,f);const[x,w]=A5(Object.assign({link:p,elements:v,valueof:t,coordinate:n},at(a.selected,"link"))),[M,k]=T5(Object.assign({document:e.ownerDocument,background:r,coordinate:n,scale:i,valueof:t},at(a.selected,"background"))),{setState:E,removeState:o,hasState:O}=E5(ot(a,{selected:Object.assign({},(null==(r=a.selected)?void 0:r.offset)&&{transform:(...t)=>{var e=a.selected.offset(...t),[,t]=t;return _5(v[t],e,n)}})}),t),S=(t=!0)=>{for(const e of v)o(e,"selected","unselected"),w(e),k(e);t&&m.emit("element:unselect",{nativeEvent:!0})},s=t=>{var{target:e,nativeEvent:n=!0}=t;if(!y.has(e))return S();if(g){var[r,i,a=!0]=[t,e,n];if(O(i,"selected"))S();else{var o=d(i),o=b.get(o),s=new Set(o);for(const l of v)s.has(l)?E(l,"selected"):(E(l,"unselected"),w(l)),l!==i&&k(l);x(o),M(i),a&&m.emit("element:select",Object.assign(Object.assign({},r),{nativeEvent:a,data:{data:[f(i),...o.map(f)]}}))}}else{var[r,a,o=!0]=[t,e,n];t=d(a),t=b.get(t);const c=new Set(t);if(O(a,"selected")){if(!v.some(t=>!c.has(t)&&O(t,"selected")))return S();for(const u of t)E(u,"unselected"),w(u),k(u)}else{e=t.some(t=>O(t,"selected"));for(const h of v)c.has(h)?E(h,"selected"):O(h,"selected")||E(h,"unselected");!e&&p&&x(t),M(a)}o&&m.emit("element:select",Object.assign(Object.assign({},r),{nativeEvent:o,data:{data:v.filter(t=>O(t,"selected")).map(f)}}))}},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=L5(v,r,f);s({target:n,nativeEvent:!1})}}),c=()=>{S(!1)};return m.on("element:select",l),m.on("element:unselect",c),()=>{for(const t of v)w(t);e.removeEventListener("click",s),m.off("element:select",l),m.off("element:unselect",c)}}function B5(t){var{createGroup:s,background:l=!1,link:c=!1}=t,u=it(t,["createGroup","background","link"]);return(t,e,n)=>{var{container:t,view:r,options:i}=t,{coordinate:a,scale:o}=r;return I5(y5(t),Object.assign({elements:g5,datum:k5(r),groupKey:s?s(r):void 0,coordinate:a,scale:o,state:O5(i,[["selected",l?{}:{lineWidth:"1",stroke:"#000"}],"unselected"]),background:l,link:c,emitter:n},u))}}function D5(t){return B5(Object.assign(Object.assign({},t),{createGroup:M5}))}function F5(t){return B5(Object.assign(Object.assign({},t),{createGroup:w5}))}function z5(t){var{wait:E=20,leading:O,trailing:S=!1,labelFormatter:A=t=>""+t}=t,_=it(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:f,x:d,series:l=[]}=t;t=f.map((t,e)=>e);const c=Rd(t.map(t=>d[t])),u=ot({},e),h=u.marks.find(t=>"line"===t.type);t=$d(Cd(t,t=>$d(t,t=>+f[t])/Xd(t,t=>+f[t]),t=>l[t]).values());ot(h,{scale:{y:{domain:[1/t,t]}}});const p=y5(r),g=r.getElementsByClassName(Zc);const m=Pd(r.getElementsByClassName(eu),t=>t.__data__.key.split("-")[0]),v=new Us({style:Object.assign({x1:0,y1:0,x2:0,y2:p.getAttribute("height"),stroke:"black",lineWidth:1},at(_,"rule"))}),y=new al({style:Object.assign({x:0,y:p.getAttribute("height"),text:"",fontSize:10},at(_,"label"))}),b=(v.append(y),p.appendChild(v),(t,e,n)=>{var[t]=t.invert(n),n=e.invert(t);return c[Md(c,n)]}),x=(t,e)=>{v.setAttribute("x1",t[0]),v.setAttribute("x2",t[0]),y.setAttribute("text",A(e))};let w;var M;const k=mn(t=>{t=b5(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[vd(t=>d[+t]).center(a,i)],l=[0,r.map(1)],s=[0,r.map(f[s]/f[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 h of s)h.setAttribute("dy",c)}}},E,{leading:O,trailing:S});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)}(h);t.groupBy="color",t.basis=(t,e)=>{return e[t[vd(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",k),p.addEventListener("pointermove",k),p.addEventListener("pointerleave",k),()=>{v.remove(),p.removeEventListener("pointerenter",k),p.removeEventListener("pointermove",k),p.removeEventListener("pointerleave",k)}}}function W5({wait:l=30,leading:c,trailing:u=!1}){return t=>{const{options:r,update:i,container:e}=t,a=y5(e),o=ot({},r);for(const s of o.marks)s.animate=!1;const n=mn(t=>{var e,n,t=b5(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 G5=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 H5(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 Y5(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:H5(r,a)}}),o.emit("element:"+i,r),o.emit(n+":"+i,r)):o.emit(e+":"+i,t))}}function V5(){return(t,e,n)=>{const{container:r,view:i}=t,a=Y5(G5.CLICK,i,n,t=>1===t.detail),o=Y5(G5.DBLCLICK,i,n,t=>2===t.detail),s=Y5(G5.POINTER_TAP,i,n),l=Y5(G5.POINTER_DOWN,i,n),c=Y5(G5.POINTER_UP,i,n),u=Y5(G5.POINTER_OVER,i,n),h=Y5(G5.POINTER_OUT,i,n),f=Y5(G5.POINTER_MOVE,i,n),d=Y5(G5.POINTER_ENTER,i,n),p=Y5(G5.POINTER_LEAVE,i,n),g=Y5(G5.POINTER_UPOUTSIDE,i,n),m=Y5(G5.DRAG_START,i,n),v=Y5(G5.DRAG,i,n),y=Y5(G5.DRAG_END,i,n),b=Y5(G5.DRAG_ENTER,i,n),x=Y5(G5.DRAG_LEAVE,i,n),w=Y5(G5.DRAG_OVER,i,n),M=Y5(G5.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",h),r.addEventListener("pointermove",f),r.addEventListener("pointerenter",d),r.addEventListener("pointerleave",p),r.addEventListener("pointerupoutside",g),r.addEventListener("dragstart",m),r.addEventListener("drag",v),r.addEventListener("dragend",y),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",h),r.removeEventListener("pointermove",f),r.removeEventListener("pointerenter",d),r.removeEventListener("pointerleave",p),r.removeEventListener("pointerupoutside",g),r.removeEventListener("dragstart",m),r.removeEventListener("drag",v),r.removeEventListener("dragend",y),r.removeEventListener("dragenter",b),r.removeEventListener("dragleave",x),r.removeEventListener("dragover",w),r.removeEventListener("drop",M)}}}function q5(t,e){return e?"string"==typeof e?document.querySelector(e):e:t.getRootNode().defaultView.getConfig().container}function $5({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 h,f,d=t.getRootNode().defaultView.getConfig().container,o=o?q5(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,h=s,f=l,c=c,d=d,u=new Bk({className:"tooltip",style:{x:u,y:p,container:d,data:[],bounding:c,position:h,enterable:f,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 U5({root:t,single:e,emitter:n,nativeEvent:r=!0,mount:i}){e=(e?q5(t,i):t).tooltipElement;e&&(e.hide(),r)&&n.emit("tooltip:hide",{nativeEvent:r})}function X5(t){var e=t["tooltipElement"];e&&(e.destroy(),t.tooltipElement=void 0)}function K5(t){var e=t["value"];return Object.assign(Object.assign({},t),{value:void 0===e?"undefined":e})}function Z5(t,e){var{color:t,series:n}=t,{color:e,series:r}=e,i=t=>t&&t.invert&&!(t instanceof Ov)&&!(t instanceof xv);return i(n)?n.invert(r):r&&r!==e?r:!i(t)||(n=t.invert(e),Array.isArray(n))?null:n}function Q5(t){var e=t.getAttribute("fill"),n=t.getAttribute("stroke"),t=t["__data__"],{color:t=e&&"transparent"!==e?e:n}=t;return t}function J5(t,e=t=>t){t=new Map(t.map(t=>[e(t),t]));return Array.from(t.values())}function tS(n,s,l,t=n.map(t=>t.__data__)){const e=t=>t instanceof Date?+t:t;var r=J5(t.map(t=>t.title),e).filter(n0),t=t.flatMap((r,t)=>{const i=n[t],{items:e=[],title:a}=r;t=e.filter(n0);const o=void 0!==l?l:e.length<=1;return t.map(t=>{var{color:e=Q5(i),name:n}=t,t=it(t,["color","name"]),n=o?Z5(s,r)||n:n||Z5(s,r);return Object.assign(Object.assign({},t),{color:e,name:n||a})})}).map(K5);return Object.assign(Object.assign({},0<r.length&&{title:r.join(",")}),{items:J5(t,t=>`(${e(t.name)}, ${e(t.value)}, ${e(t.color)})`)})}function eS(t,e,n){var{plotWidth:r,plotHeight:i,mainWidth:a,mainHeight:o,startX:s,startY:l,transposed:c,polar:u,insetLeft:h,insetTop:f}=n,n=it(n,["plotWidth","plotHeight","mainWidth","mainHeight","startX","startY","transposed","polar","insetLeft","insetTop"]);const d=Object.assign({lineWidth:1,stroke:"#1b1e23",strokeOpacity:.5},n);n=e.map(t=>t[1]),e=e.map(t=>t[0]);const p=ep(n),g=ep(e);const[m,v,y,b]=u?(n=Math.min(a,o)/2,a=hy(ly([g,p],[u=s+h+a/2,h=l+f+o/2])),[u,u+n*Math.cos(a),h,h+n*Math.sin(a)]):c?[s,s+r,p+l,p+l]:[g+s,g+s,l,l+i];0<e.length&&((o=t.ruleY||(f=new Us({style:Object.assign({x1:m,x2:v,y1:y,y2:b},d)}),t.appendChild(f),f)).style.x1=m,o.style.x2=v,o.style.y1=y,o.style.y2=b,t.ruleY=o)}function nS(t){t.ruleY&&(t.ruleY.remove(),t.ruleY=void 0)}function rS(t,e){return Array.from(t.values()).some(t=>{return null==(t=t.interaction)?void 0:t[e]})}function iS(t,e){return void 0===t?e:t}function aS(t){var{title:t,items:e}=t;return 0===e.length&&void 0===t}function oS(p,t){var{elements:e,sort:g,filter:m,scale:v,coordinate:y,crosshairs:b,render:x,groupName:w,emitter:M,wait:n=50,leading:r=!0,trailing:i=!1,startX:k=0,startY:E=0,body:O=!0,single:S=!0,position:A,enterable:_,mount:T,bounding:P,style:a={}}=t,t=it(t,["elements","sort","filter","scale","coordinate","crosshairs","render","groupName","emitter","wait","leading","trailing","startX","startY","body","single","position","enterable","mount","bounding","style"]),e=e(p);const L=op(y),C=sp(y);a=ot(a,t);const{innerWidth:N,innerHeight:F,width:z,height:W,insetLeft:G,insetTop:H}=y.getOptions(),j=[],R=[];for(const u of e){var o=u["__data__"],o=o["seriesX"];(o?j:R).push(u)}j.sort((t,e)=>{const n=L?0:1;var r=t=>t.getBounds().min[n];return L?r(e)-r(t):r(t)-r(e)});const Y=new Map(j.map(t=>{var e=t["__data__"];const n=e["seriesX"];return[t,[Rd(n.map((t,e)=>e),t=>n[+t]),n]]})),V=at(a,"crosshairs");t=v.x;const I=null!=t&&t.getBandWidth?t.getBandWidth()/2:0,B=t=>{var[t]=y.invert(t);return t-I},q=(t,e)=>{const n=L?1:0,r=t[n];return e.filter(t=>{var[t,e]=(t=>{var{min:t,max:e}=t.getLocalBounds();return Rd([t[n],e[n]])})(t);return r>=t&&r<=e})},s=mn(t=>{var e=b5(p,t);if(e){var n=p.getRenderBounds();const c=n.min[0],u=n.min[1],h=[e[0]-k,e[1]-E];h;var n=q(h,R),r=[],i=[];for(const d of j){var[a,o]=Y.get(d),a=((t,e,n)=>{var t=B(t),[r,i]=Rd([n[0],n[n.length-1]]);return t<r||i<t?null:e[(0,vd(t=>n[+t]).center)(e,t)]})(h,a,o);if(null!==a){r.push(d);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[en(t.replace("series","")),e]}))})(d,a);const{x:c,y:u}=o;a=y.map([(c||0)+I,u||0]);i.push([o,a])}}var s=Array.from(new Set(i.map(t=>t[0].x)));const f=s[Kd(s,t=>Math.abs(t-B(h)))];var s=i.filter(t=>t[0].x===f),l=[...s.map(t=>t[0]),...n.map(t=>t.__data__)],n=[...r,...n],l=tS(n,v,w,l);g&&l.items.sort((t,e)=>g(t)-g(e)),m&&(l.items=l.items.filter(m)),0===n.length||aS(l)?D():(O&&$5({root:p,data:l,x:e[0]+c,y:e[1]+u,render:x,event:t,single:S,position:A,enterable:_,mount:T,bounding:P}),b&&(n=s.map(t=>t[1]),eS(p,n,Object.assign(Object.assign({},V),{plotWidth:N,plotHeight:F,mainWidth:z,mainHeight:W,insetLeft:G,insetTop:H,startX:k,startY:E,transposed:L,polar:C}))),M.emit("tooltip:show",Object.assign(Object.assign({},t),{nativeEvent:!0,data:{data:{x:NO(v.x,B(h),!0)}}})))}},n,{leading:r,trailing:i}),D=()=>{U5({root:p,single:S,emitter:M,mount:T}),b&&nS(p)},l=({nativeEvent:t,data:e})=>{var n,r;t||(t=e.data["x"],e=v["x"],e=e.map(t),[t,e]=y.map([e,.5]),[n,r]=p.getRenderBounds()["min"],s({offsetX:t+n,offsetY:e+r}))},c=()=>{U5({root:p,single:S,emitter:M,nativeEvent:!1,mount:T})};return M.on("tooltip:show",l),M.on("tooltip:hide",c),p.addEventListener("pointerenter",s),p.addEventListener("pointermove",s),p.addEventListener("pointerleave",D),()=>{p.removeEventListener("pointerenter",s),p.removeEventListener("pointermove",s),p.removeEventListener("pointerleave",D),M.off("tooltip:show",l),M.off("tooltip:hide",c),X5(p),b&&nS(p)}}function sS(a,{elements:t,scale:o,render:s,groupName:l,sort:c,filter:u,emitter:h,wait:e=50,leading:n=!0,trailing:r=!1,groupKey:f=t=>t,single:d=!0,position:p,enterable:g,datum:m,view:v,mount:y,bounding:b}){const x=t(a),w=new Set(x),M=Pd(x,f),k=mn(t=>{var e,n,r,i=t["target"];!w.has(i)||(e=f(i),e=1===(e=M.get(e)).length?function(n){var{title:t,items:e=[]}=t=n["__data__"],e=e.filter(n0).map(t=>{var{color:e=Q5(n)}=t,t=it(t,["color"]);return Object.assign(Object.assign({},t),{color:e})}).map(K5);return Object.assign(Object.assign({},t&&{title:t}),{items:e})}(e[0]):tS(e,o,l),c&&e.items.sort((t,e)=>c(t)-c(e)),u&&(e.items=e.items.filter(u)),aS(e))?U5({root:a,single:d,emitter:h,mount:y}):({offsetX:n,offsetY:r}=t,$5({root:a,data:e,x:n,y:r,render:s,event:t,single:d,position:p,enterable:g,mount:y,bounding:b}),h.emit("tooltip:show",Object.assign(Object.assign({},t),{nativeEvent:!0,data:{data:H5(i,v)}})))},e,{leading:n,trailing:r}),i=t=>{t=t.target;w.has(t)&&U5({root:a,single:d,emitter:h,mount:y})},E=({nativeEvent:t,data:e})=>{var n,r,i;t||(t=L5(x,e.data,m))&&({x:e,y:n,width:r,height:i}=t.getBBox(),k({target:t,offsetX:e+r/2,offsetY:n+i/2}))},O=({nativeEvent:t}={})=>{t||U5({root:a,single:d,emitter:h,nativeEvent:!1,mount:y})};return h.on("tooltip:show",E),h.on("tooltip:hide",O),a.addEventListener("pointerover",k),a.addEventListener("pointermove",k),a.addEventListener("pointerout",i),()=>{a.removeEventListener("pointerover",k),a.removeEventListener("pointermove",k),a.removeEventListener("pointerout",i),h.off("tooltip:show",E),h.off("tooltip:hide",O),X5(a)}}function lS(t){const{shared:h,crosshairs:f,series:d,item:p=()=>({}),facet:g=!1}=t,m=it(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=rS(o,"seriesTooltip"),c=rS(o,"crosshairs"),r=y5(r),l=iS(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 oS(r,Object.assign(Object.assign({},m),{elements:g5,scale:a,coordinate:s,crosshairs:iS(f,c),item:p,emitter:n}));if(l&&g){l=t.filter(t=>t!==e&&t.options.parentKey===e.options.key);const u=m5(e,t),a=l[0].view.scale;t=r.getBounds(),l=t.min[0],t=t.min[1];return oS(r.parentNode.parentNode,Object.assign(Object.assign({},m),{elements:()=>u,scale:a,coordinate:s,crosshairs:iS(f,c),item:p,startX:l,startY:t,emitter:n}))}return sS(r,Object.assign(Object.assign({},m),{datum:k5(i),elements:g5,scale:a,coordinate:s,groupKey:h?M5(i):void 0,item:p,emitter:n,view:i}))}}const cS="legend-category",uS="items-item",hS="legend-category-item-marker",fS="legend-category-item-label";function dS(t){return t.getElementsByClassName(hS)[0]}function pS(t){return t.getElementsByClassName(fS)[0]}function gS(t){return t.getElementsByClassName(uS)}function mS(t){return t.getElementsByClassName(cS)}function vS(t){let e=t.parentNode;for(;e&&!e.__data__;)e=e.parentNode;return e.__data__}function yS(t,{legends:e,marker:i,label:a,datum:o,filter:r,emitter:s,channel:l,state:n={}}){const c=new Map,u=new Map,h=new Map;var{unselected:n={markerStroke:"#aaa",markerFill:"#aaa",labelFill:"#aaa"}}=n,f={unselected:at(n,"marker")},n={unselected:at(n,"label")};const{setState:d,removeState:p}=E5(f,void 0),{setState:g,removeState:m}=E5(n,void 0),v=Array.from(e(t));let y=v.map(o);const b=()=>{for(const r of v){var t=o(r),e=i(r),n=a(r);(y.includes(t)?(p(e,"unselected"),m):(d(e,"unselected"),g))(n,"unselected")}};for(const O of v){var x=()=>{P5(t,"pointer")},w=()=>{P5(t,"default")},M=n=>ue(this,void 0,void 0,function*(){var t=o(O),e=y.indexOf(t),{nativeEvent:t=!0}=(-1===e?y.push(t):y.splice(e,1),0===y.length&&y.push(...v.map(o)),yield r(y),b(),n);t&&(y.length===v.length?s.emit("legend:reset",{nativeEvent:t}):s.emit("legend:filter",Object.assign(Object.assign({},n),{nativeEvent:t,data:{channel:l,values:y}})))});O.addEventListener("click",M),O.addEventListener("pointerenter",x),O.addEventListener("pointerout",w),c.set(O,M),u.set(O,x),h.set(O,w)}const k=n=>ue(this,void 0,void 0,function*(){var t,e=n["nativeEvent"];e||(e=n["data"],{channel:e,values:t}=e,e===l&&(y=t,yield r(y),b()))}),E=e=>ue(this,void 0,void 0,function*(){var t=e["nativeEvent"];t||(y=v.map(o),yield r(y),b())});return s.on("legend:filter",k),s.on("legend:reset",E),()=>{for(const t of v)t.removeEventListener("click",c.get(t)),t.removeEventListener("pointerenter",u.get(t)),t.removeEventListener("pointerout",h.get(t)),s.off("legend:filter",k),s.off("legend:reset",E)}}function bS(){return(t,e,r)=>{const{container:i,view:a,options:o,update:s}=t;t=mS(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 e;return"legends"===t.type?t:({transform:e=[]}=t,e=[{type:"filter",[r]:i},...e],ot({},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}=vS(t).scales[0];return yS(i,{legends:gS,marker:dS,label:pS,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 xS(){return(t,e,a)=>{const{container:n,view:r,options:i}=t;t=mS(n);const o=g5(n);var s=O5(i,["active","inactive"]),l=S5(o,k5(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=vS(d).scales[0].name,m=gS(d),v=(t=>{var{scale:{[t]:t}}=r;return t})(g),y=Pd(o,t=>v.invert(t.__data__[g]));var{state:u={}}=d.attributes,{inactive:u={}}=u;const{setState:b,removeState:x}=E5(s,l);var h={inactive:at(u,"marker")},u={inactive:at(u,"label")};const{setState:w,removeState:M}=E5(h),{setState:k,removeState:E}=E5(u),O=t=>{for(const r of m){var e=dS(r),n=pS(r);(r===t||null===t?(M(e,"inactive"),E):(w(e,"inactive"),k))(n,"inactive")}},S=(t,e)=>{var n=p(e),r=new Set(y.get(n));for(const i of o)r.has(i)?b(i,"active"):b(i,"inactive");O(e);var{nativeEvent:e=!0}=t;e&&a.emit("legend:highlight",Object.assign(Object.assign({},t),{nativeEvent:e,data:{channel:g,value:n}}))},A=new Map;for(const L of m){var f=t=>{S(t,L)};L.addEventListener("pointerover",f),A.set(L,f)}const _=t=>{for(const e of o)x(e,"inactive","active");O(null);var{nativeEvent:t=!0}=t;t&&a.emit("legend:unhighlight",{nativeEvent:t})},T=t=>{var{nativeEvent:t,data:e}=t;if(!t){const{channel:n,value:r}=e;n===g&&(t=m.find(t=>p(t)===r))&&S({nativeEvent:!1},t)}},P=t=>{t=t.nativeEvent;t||_({nativeEvent:!1})};d.addEventListener("pointerleave",_),a.on("legend:highlight",T),a.on("legend:unhighlight",P);c.push(()=>{d.removeEventListener(_),a.off("legend:highlight",T),a.off("legend:unhighlight",P);for(var[t,e]of A)t.removeEventListener(e)})}return()=>c.forEach(t=>t())}}function wS(t,e){for(var[n,r]of Object.entries(e))t.style(n,r)}const MS=t2(t=>{const e=t.attributes,{x:n,y:r,width:i,height:a,class:o,handleSize:s=10,document:l}=e,c=it(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,h=(t,e,n)=>{t.handle||(t.handle=n.createElement("rect"),t.append(t.handle));n=t.handle;return n.attr(e),n},f=at(i0(c,"handleNW","handleNE"),"handleN"),{render:d=h}=f,f=it(f,["render"]),p=at(c,"handleE"),{render:g=h}=p,p=it(p,["render"]),m=at(i0(c,"handleSE","handleSW"),"handleS"),{render:v=h}=m,m=it(m,["render"]),y=at(c,"handleW"),{render:b=h}=y,y=it(y,["render"]),x=at(c,"handleNW"),{render:w=h}=x,x=it(x,["render"]),M=at(c,"handleNE"),{render:k=h}=M,M=it(M,["render"]),E=at(c,"handleSE"),{render:O=h}=E,E=it(E,["render"]),S=at(c,"handleSW"),{render:h=h}=S,S=it(S,["render"]);var A=i=>()=>{return new(t2(t=>{return e=i,n=(t=t).id,r=it(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=st(t).attr("className",o).style("x",n).style("y",r).style("draggable",!0);t.maybeAppend("selection","rect").style("draggable",!0).style("fill","transparent").call(wS,Object.assign({width:i,height:a},i0(c,"handle"))),t.maybeAppend("handle-n",A(d)).style("x",u).style("y",-u).style("width",i-s).style("height",s).style("fill","transparent").call(wS,f),t.maybeAppend("handle-e",A(g)).style("x",i-u).style("y",u).style("width",s).style("height",a-s).style("fill","transparent").call(wS,p),t.maybeAppend("handle-s",A(v)).style("x",u).style("y",a-u).style("width",i-s).style("height",s).style("fill","transparent").call(wS,m),t.maybeAppend("handle-w",A(b)).style("x",-u).style("y",u).style("width",s).style("height",a-s).style("fill","transparent").call(wS,y),t.maybeAppend("handle-nw",A(w)).style("x",-u).style("y",-u).style("width",s).style("height",s).style("fill","transparent").call(wS,x),t.maybeAppend("handle-ne",A(k)).style("x",i-u).style("y",-u).style("width",s).style("height",s).style("fill","transparent").call(wS,M),t.maybeAppend("handle-se",A(O)).style("x",i-u).style("y",a-u).style("width",s).style("height",s).style("fill","transparent").call(wS,E),t.maybeAppend("handle-sw",A(h)).style("x",-u).style("y",a-u).style("width",s).style("height",s).style("fill","transparent").call(wS,S)}});function kS(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:h=["handle-n","handle-e","handle-s","handle-w","handle-nw","handle-ne","handle-se","handle-sw"]}=t,f=it(t,["brushed","brushended","brushcreated","extent","brushRegion","reverse","fill","fillOpacity","stroke","selectedHandles"]);let d=null,p=null,g=null,m=null,v=null,y=!1;const[b,x,w,M]=s,k=(P5(l,"crosshair"),l.style.draggable=!0,(t,e)=>{if(m&&m.remove(),v&&v.remove(),d=[t,e],u)return I();B()}),I=()=>{v=new Zs({style:Object.assign(Object.assign({},f),{fill:n,fillOpacity:r,stroke:i,pointerEvents:"none"})}),m=new MS({style:{x:0,y:0,width:0,height:0,draggable:!0,document:l.ownerDocument},className:"mask"}),l.appendChild(v),l.appendChild(m)},B=()=>{m=new MS({style:Object.assign(Object.assign({document:l.ownerDocument,x:0,y:0},f),{fill:n,fillOpacity:r,stroke:i,draggable:!0}),className:"mask"}),l.appendChild(m)},E=(t=!0)=>{m&&m.remove(),v&&v.remove(),d=null,p=null,g=null,y=!1,m=null,v=null,e(t)},O=(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?F:D)(t,e,r,i),a(t,e,r,i,n),[t,e,r,i]},D=(t,e,n,r)=>{m.style.x=t,m.style.y=e,m.style.width=n-t,m.style.height=r-e},F=(t,e,n,r)=>{v.style.d=`
|
|
7
|
+
`}([f,d,h,s]))}c-=u,l+=1}return o}function fE(t,e){t.__data__=e.__data__,t.className=e.className,e.parentNode.replaceChild(t,e)}function dE(t,e){return t.indexOf(e)===t.lastIndexOf(e)}function pE(t){var e,t=Wa(t);if(t&&(dE(e=t,"m")&&dE(e,"M")))return t}function gE(t,e,n,r){var i,a,o,s,l,c,u,h,f,d=e["nodeName"],p=n["nodeName"],g=pE(e),y=pE(n);if(d===p&&"path"!==d||(void 0===g||void 0===y))return p=n,d=r,[a,o,v,s]=uE(i=e),f=i.style.transform,l=p.style.transform,[c,m,u,h]=(fE(p,i),uE(p)),f=[Object.assign({transform:`${f?f+" ":""}translate(${a-c}, ${o-m}) scale(${v/u}, ${s/h})`},lE(i,cE)),Object.assign({transform:`${l?l+" ":""}translate(0, 0) scale(1, 1)`},lE(p,cE))],p.animate(f,d);{a=g;const b="path"===(o=(c=t)["nodeName"])?c:(fE(o=new gc({style:Object.assign(Object.assign({},lE(c,cE)),{d:a})}),c),o);var m=[Object.assign({path:g},lE(e,cE)),Object.assign({path:y},lE(n,cE))],v=b.animate(m,r);return v.onfinish=()=>{f0(b,n)},b.style.transform="scale(1, 1)",b.style.transform="none",v}}const yE=p=>(t,e,n)=>{[r="pack"]=[p.split];var r="function"==typeof r?r:hE,n=Object.assign(Object.assign({},n),p),i=t["length"],a=e["length"];if(1===i&&1===a||1<i&&1<a)return[o]=t,[l]=e,gE(o,o,l,n);if(1===i&&1<a){var[o]=t;{var s=o,l=e,c=n,o=r;s.style.visibility="hidden";const f=o(s,l.length);return l.map((t,e)=>{return gE(t,new gc({style:Object.assign({path:f[e]},lE(s,cE))}),t,c)})}}if(1<i&&1===a){var[i]=e;{var a=t,u=i,h=n;const d=(e=r)(u,a.length);var{fillOpacity:e=1,strokeOpacity:t=1,opacity:i=1}=u.style,e=u.animate([{fillOpacity:0,strokeOpacity:0,opacity:0},{fillOpacity:0,strokeOpacity:0,opacity:0,offset:.99},{fillOpacity:e,strokeOpacity:t,opacity:i}],h);return[...a.map((t,e)=>{return gE(t,t,new gc({style:{path:d[e],fill:u.style.fill}}),h)}),e]}}return null},mE=(yE.props={},(m,v)=>{const b=($l({name:"waveInArcAngle",inherits:!1,initialValue:"",interpolable:!0,syntax:a.NUMBER}),v)["coordinate"];return(t,e,n)=>{const[r]=t;if(!vp(b))return nE(m,v)(t,e,n);const i=b.getCenter();var{__data__:t,style:e}=r,{radius:e=0,inset:a=0,fillOpacity:o=1,strokeOpacity:s=1,opacity:l=1}=e,{points:t,y:c,y1:u}=t;const h=Tb().cornerRadius(e).padAngle(a*Math.PI/180),f=Tv(b,t,[c,u]),{startAngle:d,endAngle:p}=f,g=new gc({}),y=t=>{g.attr({d:h(t),transform:`translate(${i[0]}, ${i[1]})`});t=Wa(g);return g.style.transform="",t};e=[{waveInArcAngle:d+1e-4,fillOpacity:0,strokeOpacity:0,opacity:0},{waveInArcAngle:d+1e-4,fillOpacity:o,strokeOpacity:s,opacity:l,offset:.01},{waveInArcAngle:p,fillOpacity:o,strokeOpacity:s,opacity:l}],a=r.animate(e,Object.assign(Object.assign({},n),m));return a.onframe=function(){r.style.path=y(Object.assign(Object.assign({},f),{endAngle:Number(r.style.waveInArcAngle)}))},a.onfinish=function(){r.style.path=y(Object.assign(Object.assign({},f),{endAngle:p}))},a}}),vE=(mE.props={},s=>{return(t,e,n)=>{const[r]=t;var{transform:t="",fillOpacity:i=1,strokeOpacity:a=1,opacity:o=1}=r.style,t=[{transform:(t+" scale(0.0001)").trimStart(),fillOpacity:0,strokeOpacity:0,opacity:0},{transform:(t+" scale(0.0001)").trimStart(),fillOpacity:i,strokeOpacity:a,opacity:o,offset:.01},{transform:(t+" scale(1)").trimStart(),fillOpacity:i,strokeOpacity:a,opacity:o}],{width:i,height:a}=r.getBoundingClientRect(),o=(r.setOrigin([i/2,a/2]),r.animate(t,Object.assign(Object.assign({},n),s)));return o.finished.then(()=>r.setOrigin(0,0)),o}}),bE=s=>{return(t,e,n)=>{const[r]=t;var{transform:t="",fillOpacity:i=1,strokeOpacity:a=1,opacity:o=1}=r.style,i=[{transform:(t+" scale(1)").trimStart()},{transform:(t+" scale(0.0001)").trimStart(),fillOpacity:i,strokeOpacity:a,opacity:o,offset:.99},{transform:(t+" scale(0.0001)").trimStart(),fillOpacity:0,strokeOpacity:0,opacity:0}],{width:a,height:o}=r.getBoundingClientRect(),t=(r.setOrigin([a/2,o/2]),r.animate(i,Object.assign(Object.assign({},n),s)));return t.finished.then(()=>r.setOrigin(0,0)),t}},xE=i=>(t,e,n)=>{var[t]=t,r=(null==(r=t.getTotalLength)?void 0:r.call(t))||0;return t.animate([{lineDash:[0,r]},{lineDash:[r,0]}],Object.assign(Object.assign({},n),i))},wE=(xE.props={},(o,s)=>(t,e,n)=>{const[r]=t;var{height:t,width:i}=r.getBoundingClientRect();const a=new gc({style:{path:`M0,0L${i},0L${i},${t}L0,${t}Z`}});r.appendChild(a),r.style.clipPath=a;i=nE(o,s)([a],e,n);return i.finished.then(()=>{a.remove(),r.style.clipPath=null}),i}),ME=(wE.props={},(o,s)=>(t,e,n)=>{const[r]=t;var{height:t,width:i}=r.getBoundingClientRect();const a=new gc({style:{path:`M0,0L${i},0L${i},${t}L0,${t}Z`}});r.appendChild(a),r.style.clipPath=a;i=iE(o,s)([a],e,n);return i.finished.then(()=>{a.remove(),r.style.clipPath=null}),i}),OE=(ME.props={},{visibility:"visible",opacity:1,fillOpacity:1,strokeOpacity:1});function kE(t,e,n,r){t.style[e]=n,r&&t.children.forEach(t=>kE(t,e,n,r))}function EE(t){kE(t,"visibility","hidden",!0)}function SE(t){kE(t,"visibility","visible",!0)}function AE(t){return st(t).selectAll("."+nu).nodes().filter(t=>!t.__removed__)}function _E(t,e){return TE(t,e).flatMap(({container:t})=>AE(t))}function TE(e,t){return t.filter(t=>t!==e&&t.options.parentKey===e.options.key)}function PE(t){return st(t).select("."+iu).node()}function LE(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 CE(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 NE(t){return t=>t.__data__.color}function jE(t){const e=t.scale["x"];return t=>{t=t.__data__.x;return e.invert(t)}}function RE(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 IE(s,l=(t,e)=>t,c=(t,e,n)=>t.setAttribute(e,n)){const u="__states__",h="__ordinal__",i=t=>{var{[u]:e=[],[h]: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:OE[o],o=l(i,t);c(t,r,o),r in n||(n[r]=a)}t[h]=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 BE(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 DE(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 FE(t){var{link:e=!1,valueof:l=(t,e)=>t}=t,c=it(t,["link","valueof","coordinate"]);if(!e)return[()=>{},()=>{}];const u=t=>t.__data__.points;return[t=>{if(!(t.length<=1)){var e=qd(t,(t,e)=>{t=t.__data__.x,e=e.__data__.x;return t-e});for(let t=1;t<e.length;t++){var n=wb();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(),dv(c,t=>l(t,s))),{fill:i=s.getAttribute("fill")}=r,a=it(r,["fill"]),o=new gc({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 zE(n,t,e){var r,i,a,o=t=>{var e=n.style["transform"];return e?e+" "+t:t};return vp(e)?(a=n.__data__["points"],[a,i]=mp(e)?_v(a):a,r=vv(a,a=e.getCenter()),i=vv(i,a),a=wv(r)+Ov(r,i)/2,o(`translate(${t*Math.cos(a)}, ${t*Math.sin(a)})`)):mp(e)?o(`translate(${t}, 0)`):o(`translate(0, ${-t})`)}function WE(t){var{document:o,background:e,scale:s,coordinate:l,valueof:c}=t,u=it(t,["document","background","scale","coordinate","valueof"]);const h="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]},f=(t,e)=>{var n=s["x"];return Yk(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 Yk(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]=f(t,n),[n,a]=d(t,n),n=[[r,n],[i,n],[i,a],[r,a]].map(t=>l.map(t)),i=t["__data__"],{y:r,y1:a}=i;return r2(o,n,{y:r,y1:a},l,e)},g=(t,e)=>{var n,r,{transform:i="scale(1.2, 1.2)",transformOrigin:a="center center",stroke:o=""}=e,e=it(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=dv(u,t=>c(t,e)),{fill:n="#CCD6EC",fillOpacity:r=.3,zIndex:i=-2,padding:a=.001,strokeWidth:o=0}=t,t=it(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(Yk)})()?p:g)(e,t);n.className=h,e.parentNode.appendChild(n),e.background=n},t=>{var e;null!=(e=t.background)&&e.remove(),t.background=null},t=>t.className===h]}function GE(t,e){t=t.getRootNode().defaultView.getContextService().getDomElement();null!=t&&t.style&&(t.style.cursor=e)}function HE(t,e,r){return t.find(n=>Object.entries(e).every(([t,e])=>r(n)[t]===e))}function YE(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 h=t(e),f=new Set(h),d=Wd(h,o);t=DE(h,a);const[p,g]=FE(Object.assign({elements:h,valueof:t,link:n,coordinate:l},at(u.active,"link"))),[y,m,v]=WE(Object.assign({document:e.ownerDocument,scale:s,coordinate:l,background:r,valueof:t},at(u.active,"background"))),{setState:b,removeState:x,hasState:w}=IE(ot(u,{active:Object.assign({},(null==(n=u.active)?void 0:n.offset)&&{transform:(...t)=>{var e=u.active.offset(...t),[,t]=t;return zE(h[t],e,l)}})}),t);let M;const O=t=>{var{target:e,nativeEvent:t=!0}=t;if(f.has(e)){M&&clearTimeout(M);var n=o(e),n=d.get(n),r=new Set(n);for(const i of h)r.has(i)?w(i,"active")||b(i,"active"):(b(i,"inactive"),g(i)),i!==e&&m(i);y(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 h)x(e,"active","inactive"),m(e),g(e);t&&c.emit("element:unhighlight",{nativeEvent:t})},E=t=>{t=t.target;r&&!v(t)||(r||f.has(t))&&(0<i?(M&&clearTimeout(M),M=setTimeout(()=>{k(),M=null},i)):k())},S=()=>{k()},A=(e.addEventListener("pointerover",O),e.addEventListener("pointerout",E),e.addEventListener("pointerleave",S),t=>{t=t.nativeEvent;t||k(!1)}),_=t=>{var e=t["nativeEvent"];!e&&(e=t.data["data"],t=HE(h,e,a))&&O({target:t,nativeEvent:!1})};return c.on("element:highlight",_),c.on("element:unhighlight",A),()=>{e.removeEventListener("pointerover",O),e.removeEventListener("pointerout",E),e.removeEventListener("pointerleave",S),c.off("element:highlight",_),c.off("element:unhighlight",A);for(const t of h)m(t),g(t)}}function VE(t){var{delay:s,createGroup:l,background:c=!1,link:u=!1}=t,h=it(t,["delay","createGroup","background","link"]);return(t,e,n)=>{var{container:t,view:r,options:i}=t,{scale:a,coordinate:o}=r;return YE(PE(t),Object.assign({elements:AE,datum:RE(r),groupKey:l?l(r):void 0,coordinate:o,scale:a,state:BE(i,[["active",c?{}:{lineWidth:"1",stroke:"#000"}],"inactive"]),background:c,link:u,delay:s,emitter:n},h))}}function qE(t){return VE(Object.assign(Object.assign({},t),{createGroup:jE}))}function $E(t){return VE(Object.assign(Object.assign({},t),{createGroup:NE}))}function UE(e,{elements:t,datum:f,groupKey:d=t=>t,link:p=!1,single:g=!1,coordinate:n,background:r=!1,scale:i,emitter:y,state:a={}}){const m=t(e),v=new Set(m),b=Wd(m,d);t=DE(m,f);const[x,w]=FE(Object.assign({link:p,elements:m,valueof:t,coordinate:n},at(a.selected,"link"))),[M,O]=WE(Object.assign({document:e.ownerDocument,background:r,coordinate:n,scale:i,valueof:t},at(a.selected,"background"))),{setState:k,removeState:o,hasState:E}=IE(ot(a,{selected:Object.assign({},(null==(r=a.selected)?void 0:r.offset)&&{transform:(...t)=>{var e=a.selected.offset(...t),[,t]=t;return zE(m[t],e,n)}})}),t),S=(t=!0)=>{for(const e of m)o(e,"selected","unselected"),w(e),O(e);t&&y.emit("element:unselect",{nativeEvent:!0})},s=t=>{var{target:e,nativeEvent:n=!0}=t;if(!v.has(e))return S();if(g){var[r,i,a=!0]=[t,e,n];if(E(i,"selected"))S();else{var o=d(i),o=b.get(o),s=new Set(o);for(const l of m)s.has(l)?k(l,"selected"):(k(l,"unselected"),w(l)),l!==i&&O(l);x(o),M(i),a&&y.emit("element:select",Object.assign(Object.assign({},r),{nativeEvent:a,data:{data:[f(i),...o.map(f)]}}))}}else{var[r,a,o=!0]=[t,e,n];t=d(a),t=b.get(t);const c=new Set(t);if(E(a,"selected")){if(!m.some(t=>!c.has(t)&&E(t,"selected")))return S();for(const u of t)k(u,"unselected"),w(u),O(u)}else{e=t.some(t=>E(t,"selected"));for(const h of m)c.has(h)?k(h,"selected"):E(h,"selected")||k(h,"unselected");!e&&p&&x(t),M(a)}o&&y.emit("element:select",Object.assign(Object.assign({},r),{nativeEvent:o,data:{data:m.filter(t=>E(t,"selected")).map(f)}}))}},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=HE(m,r,f);s({target:n,nativeEvent:!1})}}),c=()=>{S(!1)};return y.on("element:select",l),y.on("element:unselect",c),()=>{for(const t of m)w(t);e.removeEventListener("click",s),y.off("element:select",l),y.off("element:unselect",c)}}function XE(t){var{createGroup:s,background:l=!1,link:c=!1}=t,u=it(t,["createGroup","background","link"]);return(t,e,n)=>{var{container:t,view:r,options:i}=t,{coordinate:a,scale:o}=r;return UE(PE(t),Object.assign({elements:AE,datum:RE(r),groupKey:s?s(r):void 0,coordinate:a,scale:o,state:BE(i,[["selected",l?{}:{lineWidth:"1",stroke:"#000"}],"unselected"]),background:l,link:c,emitter:n},u))}}function KE(t){return XE(Object.assign(Object.assign({},t),{createGroup:jE}))}function ZE(t){return XE(Object.assign(Object.assign({},t),{createGroup:NE}))}function QE(t){var{wait:k=20,leading:E,trailing:S=!1,labelFormatter:A=t=>""+t}=t,_=it(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:f,x:d,series:l=[]}=t;t=f.map((t,e)=>e);const c=qd(t.map(t=>d[t])),u=ot({},e),h=u.marks.find(t=>"line"===t.type);t=ip(Hd(t,t=>ip(t,t=>+f[t])/op(t,t=>+f[t]),t=>l[t]).values());ot(h,{scale:{y:{domain:[1/t,t]}}});const p=PE(r),g=r.getElementsByClassName(nu);const y=Wd(r.getElementsByClassName(ou),t=>t.__data__.key.split("-")[0]),m=new fc({style:Object.assign({x1:0,y1:0,x2:0,y2:p.getAttribute("height"),stroke:"black",lineWidth:1},at(_,"rule"))}),v=new Ac({style:Object.assign({x:0,y:p.getAttribute("height"),text:"",fontSize:10},at(_,"label"))}),b=(m.append(v),p.appendChild(m),(t,e,n)=>{var[t]=t.invert(n),n=e.invert(t);return c[Nd(c,n)]}),x=(t,e)=>{m.setAttribute("x1",t[0]),m.setAttribute("x2",t[0]),v.setAttribute("text",A(e))};let w;var M;const O=nn(t=>{t=LE(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[_d(t=>d[+t]).center(a,i)],l=[0,r.map(1)],s=[0,r.map(f[s]/f[a[0]])],[,a]=n.map(l),[,l]=n.map(s),c=a-l,s=(u.setAttribute("transform",`translate(0, ${c})`),y.get(o)||[]);for(const h of s)h.setAttribute("dy",c)}}},k,{leading:E,trailing:S});return M=[0,0],X(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)}(h);t.groupBy="color",t.basis=(t,e)=>{return e[t[_d(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),()=>{m.remove(),p.removeEventListener("pointerenter",O),p.removeEventListener("pointermove",O),p.removeEventListener("pointerleave",O)}}}function JE({wait:l=30,leading:c,trailing:u=!1}){return t=>{const{options:r,update:i,container:e}=t,a=PE(e),o=ot({},r);for(const s of o.marks)s.animate=!1;const n=nn(t=>{var e,n,t=LE(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 tS=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 eS(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 nS(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:eS(r,a)}}),o.emit("element:"+i,r),o.emit(n+":"+i,r)):o.emit(e+":"+i,t))}}function rS(){return(t,e,n)=>{const{container:r,view:i}=t,a=nS(tS.CLICK,i,n,t=>1===t.detail),o=nS(tS.DBLCLICK,i,n,t=>2===t.detail),s=nS(tS.POINTER_TAP,i,n),l=nS(tS.POINTER_DOWN,i,n),c=nS(tS.POINTER_UP,i,n),u=nS(tS.POINTER_OVER,i,n),h=nS(tS.POINTER_OUT,i,n),f=nS(tS.POINTER_MOVE,i,n),d=nS(tS.POINTER_ENTER,i,n),p=nS(tS.POINTER_LEAVE,i,n),g=nS(tS.POINTER_UPOUTSIDE,i,n),y=nS(tS.DRAG_START,i,n),m=nS(tS.DRAG,i,n),v=nS(tS.DRAG_END,i,n),b=nS(tS.DRAG_ENTER,i,n),x=nS(tS.DRAG_LEAVE,i,n),w=nS(tS.DRAG_OVER,i,n),M=nS(tS.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",h),r.addEventListener("pointermove",f),r.addEventListener("pointerenter",d),r.addEventListener("pointerleave",p),r.addEventListener("pointerupoutside",g),r.addEventListener("dragstart",y),r.addEventListener("drag",m),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",h),r.removeEventListener("pointermove",f),r.removeEventListener("pointerenter",d),r.removeEventListener("pointerleave",p),r.removeEventListener("pointerupoutside",g),r.removeEventListener("dragstart",y),r.removeEventListener("drag",m),r.removeEventListener("dragend",v),r.removeEventListener("dragenter",b),r.removeEventListener("dragleave",x),r.removeEventListener("dragover",w),r.removeEventListener("drop",M)}}}function iS(t,e){return e?"string"==typeof e?document.querySelector(e):e:t.getRootNode().defaultView.getConfig().container}function aS({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 h,f,d=t.getRootNode().defaultView.getConfig().container,o=o?iS(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,h=s,f=l,c=c,d=d,u=new $5({className:"tooltip",style:{x:u,y:p,container:d,data:[],bounding:c,position:h,enterable:f,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 oS({root:t,single:e,emitter:n,nativeEvent:r=!0,mount:i}){r&&n.emit("tooltip:hide",{nativeEvent:r});n=(e?iS(t,i):t).tooltipElement;n&&n.hide()}function sS(t){var e=t["tooltipElement"];e&&(e.destroy(),t.tooltipElement=void 0)}function lS(t){var e=t["value"];return Object.assign(Object.assign({},t),{value:void 0===e?"undefined":e})}function cS(t,e){var{color:t,series:n}=t,{color:e,series:r}=e,i=t=>t&&t.invert&&!(t instanceof Im)&&!(t instanceof Lm);return i(n)?n.invert(r):r&&r!==e?r:!i(t)||(n=t.invert(e),Array.isArray(n))?null:n}function uS(t){var e=t.getAttribute("fill"),n=t.getAttribute("stroke"),t=t["__data__"],{color:t=e&&"transparent"!==e?e:n}=t;return t}function hS(t,e=t=>t){t=new Map(t.map(t=>[e(t),t]));return Array.from(t.values())}function fS(n,s,l,t=n.map(t=>t.__data__)){const e=t=>t instanceof Date?+t:t;var r=hS(t.map(t=>t.title),e).filter(d0),t=t.flatMap((r,t)=>{const i=n[t],{items:e=[],title:a}=r;t=e.filter(d0);const o=void 0!==l?l:e.length<=1;return t.map(t=>{var{color:e=uS(i),name:n}=t,t=it(t,["color","name"]),n=o?cS(s,r)||n:n||cS(s,r);return Object.assign(Object.assign({},t),{color:e,name:n||a})})}).map(lS);return Object.assign(Object.assign({},0<r.length&&{title:r.join(",")}),{items:hS(t,t=>`(${e(t.name)}, ${e(t.value)}, ${e(t.color)})`)})}function dS(t,e,n){var{plotWidth:r,plotHeight:i,mainWidth:a,mainHeight:o,startX:s,startY:l,transposed:c,polar:u,insetLeft:h,insetTop:f}=n,n=it(n,["plotWidth","plotHeight","mainWidth","mainHeight","startX","startY","transposed","polar","insetLeft","insetTop"]);const d=Object.assign({lineWidth:1,stroke:"#1b1e23",strokeOpacity:.5},n);n=e.map(t=>t[1]),e=e.map(t=>t[0]);const p=fp(n),g=fp(e);const[y,m,v,b]=u?(n=Math.min(a,o)/2,a=wv(vv([g,p],[u=s+h+a/2,h=l+f+o/2])),[u,u+n*Math.cos(a),h,h+n*Math.sin(a)]):c?[s,s+r,p+l,p+l]:[g+s,g+s,l,l+i];0<e.length&&((o=t.ruleY||(f=new fc({style:Object.assign({x1:y,x2:m,y1:v,y2:b},d)}),t.appendChild(f),f)).style.x1=y,o.style.x2=m,o.style.y1=v,o.style.y2=b,t.ruleY=o)}function pS(t){t.ruleY&&(t.ruleY.remove(),t.ruleY=void 0)}function gS(t,e){return Array.from(t.values()).some(t=>{return null==(t=t.interaction)?void 0:t[e]})}function yS(t,e){return void 0===t?e:t}function mS(t){var{title:t,items:e}=t;return 0===e.length&&void 0===t}function vS(p,t){var{elements:e,sort:g,filter:y,scale:m,coordinate:v,crosshairs:b,render:x,groupName:w,emitter:M,wait:n=50,leading:r=!0,trailing:i=!1,startX:O=0,startY:k=0,body:E=!0,single:S=!0,position:A,enterable:_,mount:T,bounding:P,disableNative:a=!1,style:o={}}=t,t=it(t,["elements","sort","filter","scale","coordinate","crosshairs","render","groupName","emitter","wait","leading","trailing","startX","startY","body","single","position","enterable","mount","bounding","disableNative","style"]),e=e(p);const L=mp(v),C=vp(v);o=ot(o,t);const{innerWidth:D,innerHeight:F,width:z,height:W,insetLeft:G,insetTop:H}=v.getOptions(),N=[],j=[];for(const h of e){var s=h["__data__"],s=s["seriesX"];(s?N:j).push(h)}N.sort((t,e)=>{const n=L?0:1;var r=t=>t.getBounds().min[n];return L?r(e)-r(t):r(t)-r(e)});const Y=new Map(N.map(t=>{var e=t["__data__"];const n=e["seriesX"];return[t,[qd(n.map((t,e)=>e),t=>n[+t]),n]]})),V=at(o,"crosshairs");t=m.x;const R=null!=t&&t.getBandWidth?t.getBandWidth()/2:0,I=t=>{var[t]=v.invert(t);return t-R},q=(t,e)=>{const n=L?1:0,r=t[n];return e.filter(t=>{var[t,e]=(t=>{var{min:t,max:e}=t.getLocalBounds();return qd([t[n],e[n]])})(t);return r>=t&&r<=e})},l=nn(t=>{var e=LE(p,t);if(e){var n=p.getRenderBounds();const c=n.min[0],u=n.min[1],h=[e[0]-O,e[1]-k];h;var n=q(h,j),r=[],i=[];for(const d of N){var[a,o]=Y.get(d),a=((t,e,n)=>{var t=I(t),[r,i]=qd([n[0],n[n.length-1]]);return t<r||i<t?null:e[(0,_d(t=>n[+t]).center)(e,t)]})(h,a,o);if(null!==a){r.push(d);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[Ge(t.replace("series","")),e]}))})(d,a);const{x:c,y:u}=o;a=v.map([(c||0)+R,u||0]);i.push([o,a])}}var s=Array.from(new Set(i.map(t=>t[0].x)));const f=s[sp(s,t=>Math.abs(t-I(h)))];var s=i.filter(t=>t[0].x===f),l=[...s.map(t=>t[0]),...n.map(t=>t.__data__)],n=[...r,...n],l=fS(n,m,w,l);g&&l.items.sort((t,e)=>g(t)-g(e)),y&&(l.items=l.items.filter(y)),0===n.length||mS(l)?B():(E&&aS({root:p,data:l,x:e[0]+c,y:e[1]+u,render:x,event:t,single:S,position:A,enterable:_,mount:T,bounding:P}),b&&(n=s.map(t=>t[1]),dS(p,n,Object.assign(Object.assign({},V),{plotWidth:D,plotHeight:F,mainWidth:z,mainHeight:W,insetLeft:G,insetTop:H,startX:O,startY:k,transposed:L,polar:C}))),M.emit("tooltip:show",Object.assign(Object.assign({},t),{nativeEvent:!0,data:{data:{x:Vk(m.x,I(h),!0)}}})))}},n,{leading:r,trailing:i}),B=()=>{oS({root:p,single:S,emitter:M,mount:T}),b&&pS(p)},c=({nativeEvent:t,data:e})=>{var n,r;t||(t=e.data["x"],e=m["x"],e=e.map(t),[t,e]=v.map([e,.5]),[n,r]=p.getRenderBounds()["min"],l({offsetX:t+n,offsetY:e+r}))},u=()=>{oS({root:p,single:S,emitter:M,nativeEvent:!1,mount:T})};return M.on("tooltip:show",c),M.on("tooltip:hide",u),a||(p.addEventListener("pointerenter",l),p.addEventListener("pointermove",l),p.addEventListener("pointerleave",B)),()=>{a||(p.removeEventListener("pointerenter",l),p.removeEventListener("pointermove",l),p.removeEventListener("pointerleave",B)),M.off("tooltip:show",c),M.off("tooltip:hide",u),sS(p),b&&pS(p)}}function bS(a,{elements:t,scale:o,render:s,groupName:l,sort:c,filter:u,emitter:h,wait:e=50,leading:n=!0,trailing:r=!1,groupKey:f=t=>t,single:d=!0,position:p,enterable:g,datum:y,view:m,mount:v,bounding:b,body:x=!0,disableNative:i=!1}){const w=t(a),M=new Set(w),O=Wd(w,f),k=nn(t=>{var e,n,r,i=t["target"];!M.has(i)||(e=f(i),e=1===(e=O.get(e)).length?function(n){var{title:t,items:e=[]}=t=n["__data__"],e=e.filter(d0).map(t=>{var{color:e=uS(n)}=t,t=it(t,["color"]);return Object.assign(Object.assign({},t),{color:e})}).map(lS);return Object.assign(Object.assign({},t&&{title:t}),{items:e})}(e[0]):fS(e,o,l),c&&e.items.sort((t,e)=>c(t)-c(e)),u&&(e.items=e.items.filter(u)),mS(e))?oS({root:a,single:d,emitter:h,mount:v}):({offsetX:n,offsetY:r}=t,x&&aS({root:a,data:e,x:n,y:r,render:s,event:t,single:d,position:p,enterable:g,mount:v,bounding:b}),h.emit("tooltip:show",Object.assign(Object.assign({},t),{nativeEvent:!0,data:{data:eS(i,m)}})))},e,{leading:n,trailing:r}),E=t=>{t=t.target;M.has(t)&&oS({root:a,single:d,emitter:h,mount:v})},S=({nativeEvent:t,data:e})=>{var n,r,i;t||(t=HE(w,e.data,y))&&({x:e,y:n,width:r,height:i}=t.getBBox(),k({target:t,offsetX:e+r/2,offsetY:n+i/2}))},A=({nativeEvent:t}={})=>{t||oS({root:a,single:d,emitter:h,nativeEvent:!1,mount:v})};return h.on("tooltip:show",S),h.on("tooltip:hide",A),i||(a.addEventListener("pointerover",k),a.addEventListener("pointermove",k),a.addEventListener("pointerout",E)),()=>{i||(a.removeEventListener("pointerover",k),a.removeEventListener("pointermove",k),a.removeEventListener("pointerout",E)),h.off("tooltip:show",S),h.off("tooltip:hide",A),sS(a)}}function xS(t){const{shared:h,crosshairs:f,series:d,item:p=()=>({}),facet:g=!1}=t,y=it(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=gS(o,"seriesTooltip"),c=gS(o,"crosshairs"),r=PE(r),l=yS(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 vS(r,Object.assign(Object.assign({},y),{elements:AE,scale:a,coordinate:s,crosshairs:yS(f,c),item:p,emitter:n}));if(l&&g){l=t.filter(t=>t!==e&&t.options.parentKey===e.options.key);const u=_E(e,t),a=l[0].view.scale;t=r.getBounds(),l=t.min[0],t=t.min[1];return vS(r.parentNode.parentNode,Object.assign(Object.assign({},y),{elements:()=>u,scale:a,coordinate:s,crosshairs:yS(f,c),item:p,startX:l,startY:t,emitter:n}))}return bS(r,Object.assign(Object.assign({},y),{datum:RE(i),elements:AE,scale:a,coordinate:s,groupKey:h?jE(i):void 0,item:p,emitter:n,view:i}))}}const wS="legend-category",MS="items-item",OS="legend-category-item-marker",kS="legend-category-item-label";function ES(t){return t.getElementsByClassName(OS)[0]}function SS(t){return t.getElementsByClassName(kS)[0]}function AS(t){return t.getElementsByClassName(MS)}function _S(t){return t.getElementsByClassName(wS)}function TS(t){let e=t.parentNode;for(;e&&!e.__data__;)e=e.parentNode;return e.__data__}function PS(t,{legends:e,marker:i,label:a,datum:o,filter:r,emitter:s,channel:l,state:n={}}){const c=new Map,u=new Map,h=new Map;var{unselected:n={markerStroke:"#aaa",markerFill:"#aaa",labelFill:"#aaa"}}=n,f={unselected:at(n,"marker")},n={unselected:at(n,"label")};const{setState:d,removeState:p}=IE(f,void 0),{setState:g,removeState:y}=IE(n,void 0),m=Array.from(e(t));let v=m.map(o);const b=()=>{for(const r of m){var t=o(r),e=i(r),n=a(r);(v.includes(t)?(p(e,"unselected"),y):(d(e,"unselected"),g))(n,"unselected")}};for(const E of m){var x=()=>{GE(t,"pointer")},w=()=>{GE(t,"default")},M=n=>X(this,void 0,void 0,function*(){var t=o(E),e=v.indexOf(t),{nativeEvent:t=!0}=(-1===e?v.push(t):v.splice(e,1),0===v.length&&v.push(...m.map(o)),yield r(v),b(),n);t&&(v.length===m.length?s.emit("legend:reset",{nativeEvent:t}):s.emit("legend:filter",Object.assign(Object.assign({},n),{nativeEvent:t,data:{channel:l,values:v}})))});E.addEventListener("click",M),E.addEventListener("pointerenter",x),E.addEventListener("pointerout",w),c.set(E,M),u.set(E,x),h.set(E,w)}const O=n=>X(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=>X(this,void 0,void 0,function*(){var t=e["nativeEvent"];t||(v=m.map(o),yield r(v),b())});return s.on("legend:filter",O),s.on("legend:reset",k),()=>{for(const t of m)t.removeEventListener("click",c.get(t)),t.removeEventListener("pointerenter",u.get(t)),t.removeEventListener("pointerout",h.get(t)),s.off("legend:filter",O),s.off("legend:reset",k)}}function LS(){return(t,e,r)=>{const{container:i,view:a,options:o,update:s}=t;t=_S(i);const l=(r,i)=>X(this,void 0,void 0,function*(){var t=a["scale"];const{[r]:n}=t;t=o.marks,t=t.map(t=>{var e;return"legends"===t.type?t:({transform:e=[]}=t,e=[{type:"filter",[r]:i},...e],ot({},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}=TS(t).scales[0];return PS(i,{legends:AS,marker:ES,label:SS,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 CS(){return(t,e,a)=>{const{container:n,view:r,options:i}=t;t=_S(n);const o=AE(n);var s=BE(i,["active","inactive"]),l=DE(o,RE(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=TS(d).scales[0].name,y=AS(d),m=(t=>{var{scale:{[t]:t}}=r;return t})(g),v=Wd(o,t=>m.invert(t.__data__[g]));var{state:u={}}=d.attributes,{inactive:u={}}=u;const{setState:b,removeState:x}=IE(s,l);var h={inactive:at(u,"marker")},u={inactive:at(u,"label")};const{setState:w,removeState:M}=IE(h),{setState:O,removeState:k}=IE(u),E=t=>{for(const r of y){var e=ES(r),n=SS(r);(r===t||null===t?(M(e,"inactive"),k):(w(e,"inactive"),O))(n,"inactive")}},S=(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(e);var{nativeEvent:e=!0}=t;e&&a.emit("legend:highlight",Object.assign(Object.assign({},t),{nativeEvent:e,data:{channel:g,value:n}}))},A=new Map;for(const L of y){var f=t=>{S(t,L)};L.addEventListener("pointerover",f),A.set(L,f)}const _=t=>{for(const e of o)x(e,"inactive","active");E(null);var{nativeEvent:t=!0}=t;t&&a.emit("legend:unhighlight",{nativeEvent:t})},T=t=>{var{nativeEvent:t,data:e}=t;if(!t){const{channel:n,value:r}=e;n===g&&(t=y.find(t=>p(t)===r))&&S({nativeEvent:!1},t)}},P=t=>{t=t.nativeEvent;t||_({nativeEvent:!1})};d.addEventListener("pointerleave",_),a.on("legend:highlight",T),a.on("legend:unhighlight",P);c.push(()=>{d.removeEventListener(_),a.off("legend:highlight",T),a.off("legend:unhighlight",P);for(var[t,e]of A)t.removeEventListener(e)})}return()=>c.forEach(t=>t())}}function NS(t,e){for(var[n,r]of Object.entries(e))t.style(n,r)}const jS=u2(t=>{const e=t.attributes,{x:n,y:r,width:i,height:a,class:o,handleSize:s=10,document:l}=e,c=it(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,h=(t,e,n)=>{t.handle||(t.handle=n.createElement("rect"),t.append(t.handle));n=t.handle;return n.attr(e),n},f=at(g0(c,"handleNW","handleNE"),"handleN"),{render:d=h}=f,f=it(f,["render"]),p=at(c,"handleE"),{render:g=h}=p,p=it(p,["render"]),y=at(g0(c,"handleSE","handleSW"),"handleS"),{render:m=h}=y,y=it(y,["render"]),v=at(c,"handleW"),{render:b=h}=v,v=it(v,["render"]),x=at(c,"handleNW"),{render:w=h}=x,x=it(x,["render"]),M=at(c,"handleNE"),{render:O=h}=M,M=it(M,["render"]),k=at(c,"handleSE"),{render:E=h}=k,k=it(k,["render"]),S=at(c,"handleSW"),{render:h=h}=S,S=it(S,["render"]);var A=i=>()=>{return new(u2(t=>{return e=i,n=(t=t).id,r=it(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=st(t).attr("className",o).style("x",n).style("y",r).style("draggable",!0);t.maybeAppend("selection","rect").style("draggable",!0).style("fill","transparent").call(NS,Object.assign({width:i,height:a},g0(c,"handle"))),t.maybeAppend("handle-n",A(d)).style("x",u).style("y",-u).style("width",i-s).style("height",s).style("fill","transparent").call(NS,f),t.maybeAppend("handle-e",A(g)).style("x",i-u).style("y",u).style("width",s).style("height",a-s).style("fill","transparent").call(NS,p),t.maybeAppend("handle-s",A(m)).style("x",u).style("y",a-u).style("width",i-s).style("height",s).style("fill","transparent").call(NS,y),t.maybeAppend("handle-w",A(b)).style("x",-u).style("y",u).style("width",s).style("height",a-s).style("fill","transparent").call(NS,v),t.maybeAppend("handle-nw",A(w)).style("x",-u).style("y",-u).style("width",s).style("height",s).style("fill","transparent").call(NS,x),t.maybeAppend("handle-ne",A(O)).style("x",i-u).style("y",-u).style("width",s).style("height",s).style("fill","transparent").call(NS,M),t.maybeAppend("handle-se",A(E)).style("x",i-u).style("y",a-u).style("width",s).style("height",s).style("fill","transparent").call(NS,k),t.maybeAppend("handle-sw",A(h)).style("x",-u).style("y",a-u).style("width",s).style("height",s).style("fill","transparent").call(NS,S)}});function RS(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:h=["handle-n","handle-e","handle-s","handle-w","handle-nw","handle-ne","handle-se","handle-sw"]}=t,f=it(t,["brushed","brushended","brushcreated","extent","brushRegion","reverse","fill","fillOpacity","stroke","selectedHandles"]);let d=null,p=null,g=null,y=null,m=null,v=!1;const[b,x,w,M]=s,O=(GE(l,"crosshair"),l.style.draggable=!0,(t,e)=>{if(y&&y.remove(),m&&m.remove(),d=[t,e],u)return I();B()}),I=()=>{m=new gc({style:Object.assign(Object.assign({},f),{fill:n,fillOpacity:r,stroke:i,pointerEvents:"none"})}),y=new jS({style:{x:0,y:0,width:0,height:0,draggable:!0,document:l.ownerDocument},className:"mask"}),l.appendChild(m),l.appendChild(y)},B=()=>{y=new jS({style:Object.assign(Object.assign({document:l.ownerDocument,x:0,y:0},f),{fill:n,fillOpacity:r,stroke:i,draggable:!0}),className:"mask"}),l.appendChild(y)},k=(t=!0)=>{y&&y.remove(),m&&m.remove(),d=null,p=null,g=null,v=!1,y=null,m=null,e(t)},E=(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?F:D)(t,e,r,i),a(t,e,r,i,n),[t,e,r,i]},D=(t,e,n,r)=>{y.style.x=t,y.style.y=e,y.style.width=n-t,y.style.height=r-e},F=(t,e,n,r)=>{m.style.d=`
|
|
8
8
|
M${b},${x}L${w},${x}L${w},${M}L${b},${M}Z
|
|
9
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},S={"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"}},A=t=>T(t)||_(t),_=t=>{t=t.id;return-1!==h.indexOf(t)&&new Set(Object.keys(S)).has(t)},T=t=>t===m.getElementById("selection"),P=t=>{var e=t["target"],[t,n]=x5(l,t);m&&A(e)?A(e)&&(g=[t,n]):(k(t,n),y=!0)},L=t=>{var e,n,r,i,a,o,s=t["target"],t=x5(l,t);if(d)return g?T(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 O(n,r)):([e,n]=[t[0]-g[0],t[1]-g[1]],r=s["id"],S[r]?([s,i,a,o]=S[r].vector,O([d[0]+e*s,d[1]+n*i],[p[0]+e*a,p[1]+n*o])):void 0):O(d,t)},C=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=x5(l,t),[e,n,r,i]=O(d,p),y=!1,o(e,n,r,i,t))},N=t=>{t=t.target;m&&!A(t)&&E()},j=t=>{t=t.target;m&&A(t)&&!y?T(t)?P5(l,"move"):_(t)&&P5(l,S[t.id].cursor):P5(l,"crosshair")},R=()=>{P5(l,"default")};return l.addEventListener("dragstart",P),l.addEventListener("drag",L),l.addEventListener("dragend",C),l.addEventListener("click",N),l.addEventListener("pointermove",j),l.addEventListener("pointerleave",R),{mask:m,move(t,e,n,r,i=!0){m||k(t,e),d=[t,e],p=[n,r],O([t,e],[n,r],i)},remove(t=!0){m&&E(t)},destroy(){m&&E(!1),P5(l,"default"),l.removeEventListener("dragstart",P),l.removeEventListener("drag",L),l.removeEventListener("dragend",C),l.removeEventListener("click",N),l.removeEventListener("pointermove",j),l.removeEventListener("pointerleave",R)}}}function ES(e,t,n){return t.filter(t=>{return t!==e&&({interaction:t={}}=t.options,Object.values(t).find(t=>t.brushKey===n))})}function OS(t,e){var{elements:n,selectedHandles:r,siblings:i=t=>[],datum:a,brushRegion:o,extent:s,reverse:l,scale:c,coordinate:u,series:h=!1,key:d=t=>t,bboxOf:f=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=it(e,["elements","selectedHandles","siblings","datum","brushRegion","extent","reverse","scale","coordinate","series","key","bboxOf","state","emitter"]);const m=n(t),v=i(t),y=v.flatMap(n);i=S5(m,a),n=at(e,"mask");const{setState:b,removeState:x}=E5(p,i),w=new Map,{width:M,height:k,x:E=0,y:O=0}=f(t);a=s||[0,0,M,k];const S=()=>{for(const t of[...m,...y])x(t,"active","inactive")},A=(t,e,n,r)=>{var i;for(const u of v)null!=(i=u.brush)&&i.remove();var a=new Set;for(const h of m){var{min:o,max:s}=h.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(h,"inactive"):(b(h,"active"),a.add(d(h)))}for(const f of y)a.has(d(f))?b(f,"active"):b(f,"inactive")},_=()=>{for(const t of m)x(t,"inactive");for(const e of w.values())e.remove();w.clear()},T=(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 rl({style:{x:t+E,y:e+O,width:n-t,height:r-e}}),b(o,"inactive"),b(a,"active")}},P=kS(t,Object.assign(Object.assign({},n),{extent:a,brushRegion:o,reverse:l,selectedHandles:r,brushended:t=>{var e=h?_:S;t&&g.emit("brush:remove",{nativeEvent:!0}),e()},brushed:(t,e,n,r,i)=>{var a=RO(t,e,n,r,c,u);i&&g.emit("brush:highlight",{nativeEvent:!0,data:{selection:a}}),(h?T:A)(t,e,n,r)}})),L=({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=IO(t,e),e=IO(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),P.move(e,t,n,r,!1))},C=(g.on("brush:highlight",L),({nativeEvent:t}={})=>{t||P.remove(!1)}),N=(g.on("brush:remove",C),P.destroy.bind(P));return P.destroy=()=>{g.off("brush:highlight",L),g.off("brush:remove",C),N()},P}function SS(t){var{facet:g,brushKey:m}=t,v=it(t,["facet","brushKey"]);return(t,e,n)=>{var r,i,a,o,{container:s,view:l,options:c}=t,s=y5(s),u={maskFill:"#777",maskFillOpacity:"0.3",maskStroke:"#fff",reverse:!1},h=["active",["inactive",{opacity:.5}]],{scale:f,coordinate:d}=l;if(g)return r=(o=s.getBounds()).min[0],i=o.min[1],a=o.max[0],o=o.max[1],OS(s.parentNode.parentNode,Object.assign(Object.assign({elements:()=>m5(t,e),datum:k5(v5(t,e).map(t=>t.view)),brushRegion:(t,e,n,r)=>[t,e,n,r],extent:[r,i,a,o],state:O5(v5(t,e).map(t=>t.options),h),emitter:n,scale:f,coordinate:d,selectedHandles:void 0},u),v));const p=OS(s,Object.assign(Object.assign({elements:g5,key:t=>t.__data__.key,siblings:()=>{return ES(t,e,m).map(t=>y5(t.container))},datum:k5([l,...ES(t,e,m).map(t=>t.view)]),brushRegion:(t,e,n,r)=>[t,e,n,r],extent:void 0,state:O5([c,...ES(t,e,m).map(t=>t.options)],h),emitter:n,scale:f,coordinate:d,selectedHandles:void 0},u),v));return s.brush=p,()=>p.destroy()}}function AS(t,e,n,r,i){var[,i,,a]=i;return[t,i,n,a]}function _S(t){return SS(Object.assign(Object.assign({},t),{brushRegion:AS,selectedHandles:["handle-e","handle-w"]}))}function TS(t,e,n,r,i){var[i,,a]=i;return[i,e,a,r]}function PS(t){return SS(Object.assign(Object.assign({},t),{brushRegion:TS,selectedHandles:["handle-n","handle-s"]}))}const LS="axis",CS="axis-hot-area";function NS(t){return t.getElementsByClassName(LS)}function jS(t){return t.getElementsByClassName("axis-line")[0]}function RS(t){return t.getElementsByClassName("axis-main-group")[0].getLocalBounds()}function IS(t,e){var{cross:n,offsetX:i}=e,e=it(e,["cross","offsetX","offsetY"]),r=RS(t),[t]=jS(t).getLocalBounds().min;const[a,o]=r.min,[s,l]=r.max;r=2*(s-a);return{brushRegion:TS,hotZone:new rl({className:CS,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 BS(t,e){var{offsetY:i,cross:n=!1}=e,e=it(e,["offsetY","offsetX","cross"]),r=RS(t),[,t]=jS(t).getLocalBounds().min;const[a,o]=r.min,[s,l]=r.max;r=l-o;return{brushRegion:AS,hotZone:new rl({className:CS,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 DS(t,e){var{axes:n,elements:r,points:i,horizontal:s,datum:a,offsetY:o,offsetX:l,reverse:c=!1,state:u={},emitter:h,coordinate:f}=e,e=it(e,["axes","elements","points","horizontal","datum","offsetY","offsetX","reverse","state","emitter","coordinate"]);const d=r(t),p=n(t),{setState:g,removeState:m}=E5(u,S5(d,a)),v=new Map;var y=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))}},k=(M(),(t,e)=>{var n=[];for(const r of d)(t=>Array.from(v.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(jO(n,i))})(n,t)),e&&h.emit("brushAxis:highlight",{nativeEvent:!0,data:{selection:(()=>{if(!E)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})()}})}),E=p.some(s)&&p.some(t=>!s(t)),O=[];for(let a=0;a<p.length;a++){const P=p[a];const{hotZone:L,brushRegion:C,extent:N}=(s(P)?BS:IS)(P,{offsetY:o,offsetX:l,cross:E,zIndex:999,fill:"transparent"});P.parentNode.appendChild(L);var S=kS(L,Object.assign(Object.assign({},y),{reverse:c,brushRegion:C,brushended(t){if(v.delete(P),0===Array.from(v.entries()).length){var e=t;for(const n of d)m(n,"active","inactive");M(),e&&h.emit("brushAxis:remove",{nativeEvent:!0})}else k(a,t)},brushed(t,e,n,r,i){v.set(P,N(t,e,n,r)),k(a,i)}}));O.push(S)}const A=(t={})=>{t=t.nativeEvent;t||O.forEach(t=>t.remove(!1))},_=(t,e,n)=>{var{height:r,width:i}=f.getOptions(),e=e.clone();return s(n)?e.update({range:[0,i]}):e.update({range:[r,0]}),e.map(t)},T=t=>{var e=t["nativeEvent"];if(!e){var n=t.data["selection"];for(let t=0;t<O.length;t++){var r,i=n[t],a=O[t],o=p[t];i?(r=b[t],a.move(...((t,e,n)=>{var[t,r]=t,t=_(t,e,n),e=_(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(!1)}}};return h.on("brushAxis:remove",A),h.on("brushAxis:highlight",T),()=>{O.forEach(t=>t.destroy()),h.off("brushAxis:remove",A),h.off("brushAxis:highlight",T)}}function FS(l){return(t,e,n)=>{var{container:t,view:r,options:i}=t,{x:a,y:o}=y5(t).getBBox(),s=r["coordinate"];return DS(t,Object.assign({elements:g5,axes:NS,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:k5(r),state:O5(i,["active",["inactive",{opacity:.5}]]),coordinate:s,emitter:n},l))}}function zS(t,e){var{filter:a,reset:n,brushRegion:r,extent:i,reverse:o,emitter:s,selection:l}=e,e=at(it(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 h=function(e=300){let n=null;return t=>{t=t.timeStamp;return null!==n&&t-n<e?(n=t,!0):(n=t,!1)}}(),f=kS(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),f.remove()}}));function d(t){h(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),()=>{f.destroy(),s.off("brush:filter",p),t.removeEventListener("click",d)}}function WS(t){var{hideX:f=!0,hideY:d=!0}=t,p=it(t,["hideX","hideY"]);return(t,e,a)=>{const{container:n,view:r,options:o,update:s}=t;t=y5(n);let l=!1,c=!1,u=r;var{scale:i,coordinate:h}=r;return zS(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 RO(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=>ot({axis:Object.assign(Object.assign({},f&&{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:h},{maskFill:"#777",maskFillOpacity:"0.3",maskStroke:"#fff",unhighlightedOpacity:.5,reverse:!1}),p))}}function GS(t){return WS(Object.assign(Object.assign({hideX:!0},t),{brushRegion:AS}))}function HS(t){return WS(Object.assign(Object.assign({hideY:!0},t),{brushRegion:TS}))}const YS="slider";function VS(t){return[t[0],t[t.length-1]]}function qS({channelDomain:S,className:A=YS,prefix:_="slider",setValue:T=(t,e)=>t.setValues(e),hasState:P=!1,wait:L=50,leading:C=!0,trailing:N=!1}){return(t,e,c)=>{const{container:n,view:r,options:u,update:h}=t;t=n.getElementsByClassName(A);if(!t.length)return()=>{};let f=!1;const{scale:i,coordinate:a}=r,{x:o,y:s}=i,l=op(a);const d=new Map,p=new Set;S=S||{x:o.getOptions().domain,y:s.getOptions().domain};for(const v of t){const y=v.attributes["orientation"],[b,x]=(m=y,g=void 0,g="vertical"===m?"y":"x",m="vertical"===m?"x":"y",l?[m,g]:[g,m]),w=""+_+rn(b)+":filter",M="x"===b,k=o.getOptions()["ratio"],E=s.getOptions()["ratio"],O=t=>{var e,n;return t.data?(e=t.data["selection"],[e=VS(S.x),n=VS(S.y)]=e,M?[jO(o,e,k),jO(s,n,E)]:[jO(s,n,E),jO(o,e,k)]):(n=t.detail["value"],[function(t,e,n){var[t,r]=t;return jO(e,[NO(e,(n=n?t=>1-t:t=>t)(t),!0),NO(e,n(r),!1)])}(n,i[b],l&&"horizontal"===y),S[x]])};var g=mn(l=>ue(this,void 0,void 0,function*(){var t,e,n,r,i,a,o,s;f||(f=!0,{nativeEvent:t=!0}=l,[e,s]=O(l),S[b]=e,S[x]=s,[n,r,i,a=!1]=[u,{[b]:{domain:e},[x]:{domain:s}},_,P],o=(o=n["marks"]).map(t=>ot({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:[VS(o),VS(s)]}}))),yield h(n),f=!1)}),L,{leading:C,trailing:N}),m=t=>{var e,n=t["nativeEvent"];n||(n=t["data"],t=n["selection"],[t,e]=t,v.dispatchEvent(new fs("valuechange",{data:n,nativeEvent:!1})),n=M?IO(t,o):IO(e,s),T(v,n))};c.on(w,m),v.addEventListener("valuechange",g),d.set(v,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 $S="g2-scrollbar";function US(o={}){return(t,e,n)=>{var r,{view:i,container:a}=t;return a.getElementsByClassName($S).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}),qS(Object.assign(Object.assign({},o),{channelDomain:r,className:$S,prefix:"scrollbar",hasState:!0,setValue:(t,e)=>t.setValue(e[0])}))(t,e,n)):()=>{}}}const XS={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 KS(t){return"text"===t.nodeName&&!!t.isOverflowing()}function ZS(t){var{offsetX:f=8,offsetY:d=8}=t,r=it(t,["offsetX","offsetY"]);return t=>{const s=t["container"],[l,c]=s.getBounds().min,u=at(r,"tip"),h=new Set,e=t=>{var e,n,r,i,a,o=t["target"];KS(o)?({offsetX:e,offsetY:n}=t,e=e+f-l,n=n+d-c,o.tip?(o.tip.style.x=e,o.tip.style.y=n):(i=o.style["text"],a=new Ys({className:"poptip",style:{innerHTML:(r="div",i=i,a=Object.assign(Object.assign({},XS),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,h.add(a))):t.stopPropagation()},n=t=>{var e=t["target"];KS(e)?e.tip&&(e.tip.remove(),e.tip=null,h.delete(e.tip)):t.stopPropagation()};return s.addEventListener("pointerover",e),s.addEventListener("pointerout",n),()=>{s.removeEventListener("pointerover",e),s.removeEventListener("pointerout",n),h.forEach(t=>t.remove())}}}function QS(n){return(t,...e)=>ot({},n(t,...e),t)}function JS(n){return(t,...e)=>ot({},t,n(t,...e))}function t3(t,e){var n;return t?Array.isArray(t)?t:({value:n=e}=t,t=it(t,["value"]),Object.assign(Object.assign({},t),{value:n})):e}const e3=()=>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=it(t,["data","x","y","width","height"]);return Object.assign(Object.assign({},t),{data:t3(e,u),x:null!=n?n:o,y:null!=r?r:s,width:null!=i?i:l,height:null!=a?a:c})})},n3=(e3.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),h=e[s]-i*(n.length-1);var f=r.map(t=>h*(t/u)),d=[];let p=e[o]||0;for(let t=0;t<f.length;t+=1){var g=n[t],m=g["data"],g=it(g,["data"]),m=t3(m,a);d.push(Object.assign({[o]:p,[s]:f[t],[c]:e[c]||0,[l]:e[l],data:m},g)),p+=f[t]+i}return d}),r3=(n3.props={},()=>t=>{var e=t["children"],t=it(t,["children"]);if(!Array.isArray(e))return[];const{data:s,scale:l={},axis:c={},legend:u={},encode:h={},transform:f=[]}=t,n=it(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=it(t,["data","scale","axis","legend","encode","transform"]);return Object.assign({data:t3(e,s),scale:ot({},l,n),encode:ot({},h,a),transform:[...f,...o],axis:!(!r||!c)&&ot({},c,r),legend:!(!i||!u)&&ot({},u,i)},t)});return[Object.assign(Object.assign({},n),{marks:t,type:"standardView"})]}),i3=(r3.props={},({static:C=!1}={})=>t=>{var{width:e,height:n,paddingLeft:r,paddingRight:i,paddingTop:a,paddingBottom:o,padding:s,inset:l,insetLeft:c,insetTop:u,insetRight:h,insetBottom:f,margin:d,marginLeft:p,marginBottom:g,marginTop:m,marginRight:v,data:y,coordinate:b,theme:x,component:w,interaction:M,x:k,y:E,key:O,frame:S,labelTransform:A,parentKey:_,clip:T,viewStyle:P,title:L}=t,t=it(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","labelTransform","parentKey","clip","viewStyle","title"]);return[Object.assign(Object.assign({type:"standardView",x:k,y:E,key:O,width:e,height:n,padding:s,paddingLeft:r,paddingRight:i,paddingTop:a,inset:l,insetLeft:c,insetTop:u,insetRight:h,insetBottom:f,paddingBottom:o,theme:x,coordinate:b,component:w,interaction:M,frame:S,labelTransform:A,margin:d,marginLeft:p,marginBottom:g,marginTop:m,marginRight:v,parentKey:_,clip:T,style:P},!C&&{title:L}),{marks:[Object.assign(Object.assign(Object.assign({},t),{key:O+"-0",data:y}),C&&{title:L})]})]});i3.props={};class a3{constructor(t){this.$value=t}static of(t){return new a3(t)}call(t,...e){return this.$value=t(this.$value,...e),this}value(){return this.$value}}const o3=QS(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=Pd(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"))}}}),s3=QS(t=>{const{data:e,scale:n}=t;var r=[t];let i,a,o;for(;r.length;){const{children:f,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(f)&&r.push(...f)}var t="string"==typeof i?i:"",[u,h]=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)?[Od(u)]:[Array.from(new Set(u)),"ordinal"]);return{encode:{color:i},scale:{color:ot({},a,{domain:u,type:h})},legend:{color:ot({title:t},o)}}}),l3=QS(()=>({animate:{enterType:"fadeIn"}})),c3=JS(()=>({frame:!1,encode:{shape:"hollow"},style:{lineWidth:0}})),u3=JS(()=>({type:"cell"})),h3=JS(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}}]}}}),f3=JS((t,c=function(t){t=t.points;return py(t)},w=function(a){return(t,e)=>{var{rowIndex:t,rowValuesLength:n,columnIndex:r,columnValuesLength:i}=t;return t!==n-1?d3(a,e):(t=e.length?void 0:null,ot({title:r===i-1&&void 0,grid:t},a))}},M=function(r){return(t,e)=>{var{rowIndex:t,columnIndex:n}=t;return 0!==n?d3(r,e):(n=e.length?void 0:null,ot({title:0===t&&void 0,grid:n},r))}},k={})=>{const{data:e,encode:n,children:u,scale:r,x:E=0,y:O=0,shareData:h=!1,key:S}=t,A=e["value"],{x:_,y:T}=n;t=r.color;const P=t["domain"];return{children:(t,e,n)=>{const{x:r,y:i}=e,{paddingLeft:m,paddingTop:v}=n,a=r.getOptions()["domain"],o=i.getOptions()["domain"];e=iy(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{[_]:t,[T]:e}=t,t=void 0===_||t===n,e=void 0===T||e===r;return t&&e}).map(t=>A.filter(t)),y=h?$d(l,t=>t.length):void 0,b=n.map(([t,e])=>({columnField:_,columnIndex:a.indexOf(t),columnValue:t,columnValuesLength:a.length,rowField:T,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,h,f,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=it(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:_?5:void 0},y:{tickCount:T?5:void 0}},r=r?g:0===g.length?[]:A,l={color:{domain:P}},o={x:p3(o,w)(p,r),y:p3(a,M)(p,r)};return Object.assign(Object.assign({key:n+"-"+c,data:r,x:u+m+E,y:h+v+O,parentKey:S,width:f,height:d,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,frame:!!r.length,dataDomain:y,scale:ot(s,e,l),axis:ot({},i,o),legend:!1},t),k)})})}}});function d3(t,e){return e.length?ot({title:!1,tick:null,label:null},t):ot({title:!1,tick:null,label:null,grid:null},t)}function p3(t,e){return"function"==typeof t?t:null===t?()=>null:e(t)}const g3=()=>t=>{return[a3.of(t).call(u3).call(s3).call(l3).call(o3).call(c3).call(h3).call(f3).value()]},m3=(g3.props={},QS(t=>({scale:{x:{guide:null,paddingOuter:0,paddingInner:.1},y:{guide:null,range:[0,1],paddingOuter:0,paddingInner:.1}}}))),v3=JS(t=>{const{data:w,children:c,x:M=0,y:k=0,key:E}=t;return{children:(t,e,n)=>{const{x:r,y:i}=e,{paddingLeft:v,paddingTop:y}=n,a=r.getOptions()["domain"],o=i.getOptions()["domain"];e=iy(t);const s=t.map(({points:t})=>py(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,h,f,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=it(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 d3(r,e)})(m,w),y:("function"==typeof(n=s)?n:null===n?()=>null:(t,e)=>{t=t.columnIndex;if(0!==t)return d3(n,e)})(m,w)};return Object.assign({data:w,parentKey:E,key:i+"-"+c,x:u+v+M,y:h+y+k,width:f,height:d,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,frame:!0,scale:ot({x:{facet:!1},y:{facet:!1}},e),axis:ot({x:{tickCount:5},y:{tickCount:5}},o,l),legend:!1,encode:ot({},a,{x:p,y:g})},t)})})}}}),y3=JS(t=>{var e=t["encode"],t=it(t,["encode"]),{position:n=[],x:r=n,y:i=[...n].reverse()}=e,n=it(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 b3=()=>t=>{return[a3.of(t).call(u3).call(s3).call(v3).call(y3).call(l3).call(c3).call(m3).value()]},x3=QS(t=>({scale:{x:{guide:{type:"axisArc"},paddingOuter:0,paddingInner:.1},y:{guide:null,range:[0,1],paddingOuter:0,paddingInner:.1}}})),w3=QS(t=>({coordinate:{type:"polar"}})),M3=t=>{var e=t["encode"],t=it(t,["encode"]),e=e["position"];return Object.assign(Object.assign({},t),{encode:{x:e}})};function k3(t){return t=>null}function E3(t){var t=t["points"],[t,e,n,r]=t,i=uy(t,r),t=ly(t,r),r=dy(t,ly(e,n)),e=1/Math.sin(r/2),i=i/(1+e),a=i*Math.sqrt(2),[n,o]=n,t=fy(t)+r/2,r=i*e;return[n+r*Math.sin(t)-a/2,o+r*Math.cos(t)-a/2,a,a]}const O3=()=>t=>{return[a3.of(t).call(u3).call(M3).call(s3).call(w3).call(h3).call(f3,E3,k3,k3,{frame:!1}).call(l3).call(c3).call(x3).value()]};const S3=()=>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"],h=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=ot({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 h[i]),e=i}t++}var a,o,s}};function A3(t,e){if(null!==t)return{type:"column",value:t,field:e}}function _3(t,e){t=A3(t,e);return Object.assign(Object.assign({},t),{inferred:!0})}function T3(t,e){if(null!==t)return{type:"column",value:t,field:e,visual:!0}}function P3(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 L3(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 C3(t){return!(t instanceof Date)&&"object"==typeof t}S3.props={};const N3=()=>(t,e)=>{var n=e["encode"],n=n["y1"];return void 0!==n?[t,e]:[t,ot({},e,{encode:{y1:_3(P3(t,0))}})]};function j3(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])=>n0(t));return Array.from(Pd(e,e=>i.map(([,t])=>t[e]).join("-")).values())}function R3(t){var a,r;return Array.isArray(t)?(a=t,(i,t,e)=>(n,r)=>a.reduce((t,e)=>0!==t?t:md(i[n][e],i[r][e]),0)):"function"==typeof t?(r=t,(e,t,n)=>G3(t=>r(e[t]))):"series"===t?D3:"value"===t?F3:"sum"===t?z3:"maxIndex"===t?W3:()=>null}function I3(t,e){for(const n of t)n.sort(e)}function B3(t,e){return(null==e?void 0:e.domain)||Array.from(new Set(t))}function D3(t,e,n){return G3(t=>n[t])}function F3(t,e,n){return G3(t=>e[t])}function z3(t,n,e){t=iy(t),t=Array.from(Pd(t,t=>e[+t]).entries());const r=new Map(t.map(([t,e])=>[t,e.reduce((t,e)=>t+ +n[e])]));return G3(t=>r.get(e[t]))}function W3(t,n,e){t=iy(t),t=Array.from(Pd(t,t=>e[+t]).entries());const r=new Map(t.map(([t,e])=>[t,Ud(e,t=>n[t])]));return G3(t=>r.get(e[t]))}function G3(n){return(t,e)=>md(n(t),n(e))}N3.props={};const H3=(t={})=>{const{groupBy:T="x",orderBy:P=null,reverse:L=!1,y:C="y",y1:N="y1",series:j=!0}=t;return(t,e)=>{var{data:n,encode:r,style:i={}}=e,[a,o]=R(r,"y"),[s,l]=R(r,"y1"),[r]=j?L3(r,"series","color"):R(r,"color"),c=j3(T,t,e),n=R3(P)(n,a,r),u=(n&&I3(c,n),new Array(t.length)),h=new Array(t.length),f=new Array(t.length),d=[],p=[];for(const O of c){L&&O.reverse();var g=s?+s[O[0]]:0,m=[],v=[];for(const S of O){var y=f[S]=+a[S]-g;y<0?v.push(S):0<=y&&m.push(S)}var b=0<m.length?m:v,x=0<v.length?v: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 A of v.reverse()){var w=f[A];n=u[A]=(h[A]=n)+w}let r=g;for(const _ of m){var M=f[_];0<M?r=u[_]=(h[_]=r)+M:u[_]=h[_]=r}}const k=new Set(d),E=new Set(p);r="y"===C?u:h,n="y"===N?u:h;return[t,ot({},e,{encode:{y0:_3(a,o),y:A3(r,o),y1:A3(n,l)},style:Object.assign({first:(t,e)=>k.has(e),last:(t,e)=>E.has(e)},i)})]}};function Y3(t){t=t.type;return"string"==typeof t&&["stackY","dodgeX","groupX"].includes(t)}H3.props={};const V3=a=>(t,e,n)=>{var{encode:r,transform:i=[]}=e;return i.some(Y3)||({x:i,y:r}=r,void 0===i)||void 0===r?[t,e]:(i=a["series"],r=i?["x","series"]:"x",H3({groupBy:r})(t,e,n))},q3=(V3.props={},(t={})=>{const{channel:s="x"}=t;return(t,e)=>{const n=e["encode"];var r=e["tooltip"];if(s0(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,ot({},e,{tooltip:{title:a}})]}}),$3=(q3.props={},()=>(t,e)=>{var n=e["encode"],n=n["x"];return void 0!==n?[t,e]:[t,ot({},e,{encode:{x:_3(P3(t,0))},scale:{x:{guide:null}}})]}),U3=($3.props={},()=>(t,e)=>{var n=e["encode"],n=n["y"];return void 0!==n?[t,e]:[t,ot({},e,{encode:{y:_3(P3(t,0))},scale:{y:{guide:null}}})]}),X3=(U3.props={},()=>(t,e)=>{var n=e["encode"],n=n["size"];return void 0!==n?[t,e]:[t,ot({},e,{encode:{size:T3(P3(t,3))}})]}),K3=(X3.props={},()=>(t,e)=>{var n=e["encode"],r=n["key"],n=it(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,ot({},e,{encode:{key:A3(r)}})]}),Z3=(K3.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,ot({},e,{encode:{series:A3(r,i)}})])}),Q3=(Z3.props={},()=>(t,e)=>{var n=e["data"];return!Array.isArray(n)||n.some(C3)?[t,e]:[t,ot({},e,{encode:{y:A3(n)}})]}),J3=(Q3.props={},()=>(t,e)=>{var n=e["data"];return!Array.isArray(n)||n.some(C3)?[t,e]:[t,ot({},e,{encode:{x:A3(n)}})]}),tA=(J3.props={},()=>(t,e)=>{var n=e["encode"],r=n["y1"];return r?[t,e]:([r]=R(n,"y"),[t,ot({},e,{encode:{y1:A3([...r])}})])}),eA=(tA.props={},()=>(t,e)=>{var n=e["encode"],r=n["x1"];return r?[t,e]:([r]=R(n,"x"),[t,ot({},e,{encode:{x1:A3([...r])}})])}),nA=(eA.props={},t=>{const i=t["channel"];return(t,e)=>{const{encode:a,tooltip:n}=e;var r;return s0(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,ot({},e,{tooltip:{items:r}})])}}),rA=(nA.props={},()=>(t,e)=>[t,ot({scale:{x:{padding:0},y:{padding:0}}},e)]),iA=(rA.props={},()=>(t,e)=>{var{style:n={}}=e,r=it(e,["data","style"]),{x:i,y:a}=n,n=it(n,["x","y"]);return null==i||null==a?[t,e]:[[0],ot({},r,{data:[0],cartesian:!0,encode:{x:A3([i||0]),y:A3([a||0])},scale:{x:{type:"identity",independent:!0,guide:null},y:{type:"identity",independent:!0,guide:null}},style:n})]}),aA=(iA.props={},()=>(t,e)=>{var{style:n={}}=e;return[t,ot({},e,{style:Object.assign(Object.assign({},n),Object.fromEntries(Object.entries(n).filter(([,t])=>"function"==typeof t).map(([t,e])=>[t,()=>e])))})]}),oA=(aA.props={},()=>(t,e)=>{var n,r=e["data"];return!Array.isArray(r)||r.some(C3)?[t,e]:(n=(r=Array.isArray(r[0])?r:[r]).map(t=>t[0]),r=r.map(t=>t[1]),[t,ot({},e,{encode:{x:A3(n),y:A3(r)}})])}),sA=(oA.props={},()=>(t,e)=>{var{style:n={}}=e,n=n["gradient"];return n?[t,ot({},e,{encode:{series:T3(P3(t,void 0))}})]:[t,e]}),lA=(sA.props={},(t={})=>{const{groupBy:c="x",reverse:u=!1,orderBy:h,padding:f}=t;return it(t,["groupBy","reverse","orderBy","padding"]),(t,e)=>{var{data:n,encode:r,scale:i}=e,i=i["series"],[a]=R(r,"y"),[r]=L3(r,"series","color"),o=B3(r,i),i=j3(c,t,e),n=R3(h)(n,a,r),s=(n&&I3(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,ot({},e,{scale:{series:{domain:o,paddingInner:f}},encode:{series:A3(s)}})]}}),cA=(lA.props={},t=>{const{groupBy:p=["x"],reducer:g=(t,e)=>e[t[0]],orderBy:m=null,reverse:v=!1,duration:y}=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[,h]of r){var a=[];for(const n of i){var o=Array.from(Pd(n,t=>h[t]).values());a.push(...o)}i=a}if(m){const[f]=R(e,m);f&&i.sort((t,e)=>g(t,f)-g(e,f)),v&&i.reverse()}r=(y||3e3)/i.length;const[s]=y?[P3(n,r)]:L3(e,"enterDuration",P3(n,r));var[l]=L3(e,"enterDelay",P3(n,0)),c=new Array(n.length);for(let t=0,e=0;t<i.length;t++){const n=i[t];var u=$d(n,t=>+s[t]);for(const d of n)c[d]=+l[d]+e;e+=u}return[n,ot({},t,{encode:{enterDuration:T3(s),enterDelay:T3(c)}})]}});cA.props={};const uA=(t={})=>{const{groupBy:p="x",basis:g="max"}=t;return(e,t)=>{const{encode:n,tooltip:r}=t;var i=it(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=j3(p,e,t),l="function"==typeof(f=g)?f:{min:(t,e)=>Xd(t,t=>e[+t]),max:(t,e)=>$d(t,t=>e[+t]),first:(t,e)=>e[t[0]],last:(t,e)=>e[t[t.length-1]],mean:(t,e)=>ep(t,t=>e[+t]),median:(t,e)=>np(t,t=>e[+t]),sum:(t,e)=>ap(t,t=>e[+t]),deviation:(t,e)=>Ed(t,t=>e[+t])}[f]||$d;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],[,h]=s[t];h[d]=+u[d]/c}}var f=s0(r)||(null==r?void 0:r.items)&&0!==(null==r?void 0:r.items.length);return[e,ot({},t,Object.assign({encode:Object.fromEntries(s.map(([t,e])=>[t,A3(e,R(n,t)[1])]))},!f&&n.y0&&{tooltip:{items:[{channel:"y0"}]}}))]}};function hA(t,e,n){return null===t?[-.5,.5]:(t=B3(t,e),[-(e=new yv({domain:t,range:[0,1],padding:n}).getBandWidth())/2,e/2])}function fA(t,e,n){return e*(1-t)+n*t}uA.props={};const dA=(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=hA(a,r,l),s=hA(n,i,c);a=t.map(()=>fA(u(),...s)),r=t.map(()=>fA(u(),...o));return[t,ot({scale:{x:{padding:.5},y:{padding:.5}}},e,{encode:{dy:A3(a),dx:A3(r)}})]}},pA=(dA.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=hA(n,r,a);n=t.map(()=>fA(o(),...i));return[t,ot({scale:{x:{padding:.5}}},e,{encode:{dx:A3(n)}})]}}),gA=(pA.props={},(t={})=>{const{groupBy:g="x"}=t;return(e,t)=>{const n=t["encode"];var r=it(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=j3(g,e,t),s=new Array(o.length);for(let t=0;t<o.length;t++){const e=o[t];var[l,c]=Od(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 h=u-s[t];const e=o[t];for(const p of e)for(let t=0;t<i.length;t++){var[,f]=i[t],[,d]=a[t];d[p]=+f[p]+h}}return[e,ot({},t,{encode:Object.fromEntries(a.map(([t,e])=>[t,A3(e,R(n,t)[1])]))})]}}),mA=(gA.props={},(t={})=>{const{groupBy:u="x",series:h=!0}=t;return(t,e)=>{var n=e["encode"];const[r]=R(n,"y");var[,i]=R(n,"y1"),n=(h?L3(n,"series","color"):R(n,"color"),j3(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,ot({},e,{encode:{y1:A3(a,i)}})]}});function vA(t,e){return[t[0]]}function yA(t,e){return[t[t.length-1]]}function bA(t,e){return[t[Ud(t,t=>e[t])]]}function xA(t,e){return[t[Kd(t,t=>e[t])]]}mA.props={};const wA=(t={})=>{const{groupBy:a="series",channel:o,selector:s}=t;return(t,e)=>{var n=e["encode"],t=j3(a,t,e);const[r]=R(n,o),i="function"==typeof(n=s)?n:{first:vA,last:yA,max:bA,min:xA}[n]||vA;return[t.flatMap(t=>i(t,r)),e]}},MA=(wA.props={},(t={})=>{var e=t["selector"],t=it(t,["selector"]);return wA(Object.assign({channel:"x",selector:e},t))}),kA=(MA.props={},(t={})=>{var e=t["selector"],t=it(t,["selector"]);return wA(Object.assign({channel:"y",selector:e},t))});function EA(e){return t=>null===t?e:e+" of "+t}function OA(){return[(t,e)=>ep(t,t=>+e[t]),EA("mean")]}function SA(){return[(t,e)=>np(t,t=>+e[t]),EA("median")]}function AA(){return[(t,e)=>$d(t,t=>+e[t]),EA("max")]}function _A(){return[(t,e)=>Xd(t,t=>+e[t]),EA("min")]}function TA(){return[(t,e)=>t.length,EA("count")]}function PA(){return[(t,e)=>ap(t,t=>+e[t]),EA("sum")]}function LA(){return[(t,e)=>e[t[0]],EA("first")]}function CA(){return[(t,e)=>e[t[t.length-1]],EA("last")]}kA.props={};const NA=(t={})=>{const i=t["groupBy"],a=it(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:OA,max:AA,count:TA,first:LA,last:CA,sum:PA,min:_A,median:SA}[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=A3(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,A3(c.map(t=>e[t[0]]),n)]}),r=c.map(t=>s[t[0]]);return[iy(c),ot({},e,{data:r,encode:Object.fromEntries([...n,...t])})]}},jA=(NA.props={},(t={})=>{const{channels:n=["x","y"]}=t,e=it(t,["channels"]);return NA(Object.assign(Object.assign({},e),{groupBy:(t,e)=>j3(n,t,e)}))}),RA=(jA.props={},(t={})=>jA(Object.assign(Object.assign({},t),{channels:["x","color","series"]}))),IA=(RA.props={},(t={})=>jA(Object.assign(Object.assign({},t),{channels:["y","color","series"]}))),BA=(IA.props={},(t={})=>jA(Object.assign(Object.assign({},t),{channels:["color"]})));function DA(t,e,n){var{reverse:r,slice:i,channel:a}=n,n=it(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=>$d(t,t=>+a[t]);if("min"===i)return t=>Xd(t,t=>+a[t]);if("sum"===i)return t=>ap(t,t=>+a[t]);if("median"===i)return t=>np(t,t=>+a[t]);if("mean"===i)return t=>ep(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?Rd(Cd(s,c,o),([t,e],[n,r])=>md(e,r)||md(t,n)):Rd(Pd(s,o),([t,e],[n,r])=>c(e,r)||md(t,n))).map(([t])=>t)),s=(r&&n.reverse(),"number"==typeof i?[0,i]:i),o=i?n.slice(...s):n;return[t,ot(e,{scale:{[a]:{domain:o}}})]}BA.props={};const FA=(t={})=>{const{reverse:o=!1,slice:s,channel:l,ordinal:c=!0}=t,u=it(t,["reverse","slice","channel","ordinal"]);return(t,e)=>{if(c)return DA(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=Rd(t,t=>a[t]),n&&i.reverse(),[i,e]}}},zA=(FA.props={},(t={})=>FA(Object.assign(Object.assign({},t),{channel:"x"}))),WA=(zA.props={},(t={})=>FA(Object.assign(Object.assign({},t),{channel:"color"}))),GA=(WA.props={},(t={})=>FA(Object.assign(Object.assign({},t),{channel:"y"})));GA.props={};const HA=(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=Nd(t,function(e,n){if("function"==typeof e)return t=>e(t,n);if("sum"===e)return t=>ap(t,t=>+n[t]);throw new Error("Unknown reducer: "+e)}(l,n),t=>i[t]).map(t=>t[1]);return[t,ot({},e,{scale:{x:{flex:r}}})]}};function YA(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 h=a-u*c,f=u<=1?0:h/(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]=py(t),a=e%l,e=Math.floor(e/l),o=a*c,s=(u-e-1)*c+h,r=c/r,i=c/i;return`translate(${o-t+d*a}, ${s-n-f*e-p}) scale(${r}, ${i})`})}HA.props={};const VA=()=>(t,e)=>[t,ot({},e,{modifier:YA,axis:!1})],qA=(VA.props={},"thresholds");function $A(t){var e,[n,r]=Od(t);return Math.min(200,(n=n,r=r,e=kd(t=t),t=Ed(t),e&&t?Math.ceil((r-n)*Math.cbrt(e)/(3.49*t)):1))}const UA=(t={})=>{const{groupChannels:s=["color"],binChannels:l=["x","y"]}=t,c=it(t,["groupChannels","binChannels"]),u={};return NA(Object.assign(Object.assign(Object.assign({},Object.fromEntries(Object.entries(c).filter(([t])=>!t.startsWith(qA)))),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,qA),o=t.filter(e=>i.every(t=>n0(t[e]))),r=[...s.map(t=>{var[t]=R(n,t);return t}).filter(n0).map(e=>t=>e[t]),...l.map((t,e)=>{const n=i[e];e=a[t]||$A(n),e=qd().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(Pd(o,e=>r.map(t=>t(e)).join("-")).values())}}))},XA=(UA.props={},(t={})=>{var e=t["thresholds"];return UA(Object.assign(Object.assign({},t),{thresholdsX:e,groupChannels:["color"],binChannels:["x"]}))});function KA(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 h=0,f,d;c.push(h);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,v=[s(h),l(h)];for(f=-1;r<m;r++)(o=.5*Math.abs((v[0]-t)*(s(r)-v[1])-(v[0]-l(r))*(e-v[0])))>f&&(f=o,d=r);c.push(d),h=d}return c.push(a-1),c.map(t=>e[t])}function ZA(t){if("function"==typeof t)return t;if("lttb"===t)return KA;var e={first:t=>[t[0]],last:t=>[t[t.length-1]],min:(t,e,n)=>[t[Kd(t,t=>n[t])]],max:(t,e,n)=>[t[Ud(t,t=>n[t])]],median:(t,e,n)=>{return[t[tp(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))}}XA.props={};const QA=(t={})=>{const{strategy:e="median",thresholds:a=2e3,groupBy:o=["series","color"]}=t,s=ZA(e);return(t,e)=>{var n=e["encode"],t=j3(o,t,e);const[r]=R(n,"x"),[i]=R(n,"y");return[t.flatMap(t=>s(t,r,i,a)),e]}},JA=(QA.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(n0);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,ot({},e,{encode:Object.fromEntries(t),data:a.map(t=>n[t])})]});function t_(t){var{min:t,max:e}=t;return[[t[0],t[1]],[e[0],e[1]]]}function e_(t,e){var[t,n]=t,[e,r]=e;return t>=e[0]&&t<=r[0]&&n>=e[1]&&n<=r[1]}JA.props={};const n_=t=>{const n=t["priority"];return t=>{const e=[];return n&&t.sort(n),t.forEach(t=>{p5(t);const i=t.getLocalBounds();e.some(t=>{var e=t_(i),t=t_(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]})?d5(t):e.push(t)}),t}};function r_(){const n=new Map;return[t=>n.get(t),(t,e)=>n.set(t,e)]}const i_=t=>{const{maxIterations:M=10,maxError:k=.1,padding:E=1}=t;return i=>{var e=i.length;if(!(e<=1)){const[g,m]=r_(),[v,y]=r_();var a,o,s,l,[c,t]=r_(),[u,n]=r_();for(const b of i){var{min:r,max:h}=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,h]=h;m(b,g),y(b,g),t(b,h-g),n(b,[x,r])}for(let t=0;t<M;t++){i.sort((t,e)=>md(v(t),v(e)));let r=0;for(let n=0;n<e-1;n++){var f=i[n];let t=n+1,e;for(;(e=i[t])&&([[a,o],[s,l]]=[u(f),u(e)],!(a<l&&s<o));)t+=1;if(e){const g=v(f);var d=c(f),p=v(e),d=p-(g+d);d<E&&(d=(E-d)/2,r=Math.max(r,d),y(f,g-d),y(e,p+d))}}if(r<k)break}for(const w of i)w.style.y+=v(w)-g(w)}return i}};function a_(t){t/=255;return t<=.03928?t/12.92:Math.pow((.055+t)/1.055,2.4)}function o_(t,e,n){return.2126*a_(t)+.7152*a_(e)+.0722*a_(n)}function s_(t,e){var{r:t,g:n,b:r}=t,{r:e,g:i,b:a}=e,t=o_(t,n,r),n=o_(e,i,a);return(Math.max(t,n)+.05)/(Math.min(t,n)+.05)}function l_(e,t){return t[Ud(t,t=>{return s_(e,"object"==typeof(t=t)?t:Ka(t))})]}const c_=t=>{const{threshold:n=4.5,palette:r=["#000","#fff"]}=t;return t=>(t.forEach(t=>{var e=t.attr("dependentElement").parsedStyle.fill;s_(t.parsedStyle.fill,e)<n&&t.attr("fill",l_(e,r))}),t)},u_=()=>t=>(t.forEach(t=>{p5(t);var e=t.attr("bounds");!function(t,e){var[t,n]=t;return!(e_(t,e)&&e_(n,e))}(t_(t.getLocalBounds()),e)||d5(t)}),t);var P=1e-6,h_=1e-12,T=Math.PI,f_=T/2,d_=T/4,p_=2*T,g_=180/T,m_=T/180,v_=Math.abs,y_=Math.atan,b_=Math.atan2,L=Math.cos,x_=Math.ceil,w_=Math.exp,M_=Math.log,k_=Math.pow,N=Math.sin,E_=Math.sign||function(t){return 0<t?1:t<0?-1:0},O_=Math.sqrt,S_=Math.tan;function A_(t){return 1<t?0:t<-1?T:Math.acos(t)}function __(t){return 1<t?f_:t<-1?-f_:Math.asin(t)}function T_(){}function P_(t,e){t&&C_.hasOwnProperty(t.type)&&C_[t.type](t,e)}var L_={Feature:function(t,e){P_(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r<i;)P_(n[r].geometry,e)}},C_={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){N_(t.coordinates,e,0)},MultiLineString:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)N_(n[r],e,0)},Polygon:function(t,e){j_(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)j_(n[r],e)},GeometryCollection:function(t,e){for(var n=t.geometries,r=-1,i=n.length;++r<i;)P_(n[r],e)}};function N_(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 j_(t,e){var n=-1,r=t.length;for(e.polygonStart();++n<r;)N_(t[n],e,1);e.polygonEnd()}function R_(t,e){t&&L_.hasOwnProperty(t.type)?L_[t.type](t,e):P_(t,e)}function I_(t){return[b_(t[1],t[0]),__(t[2])]}function B_(t){var e=t[0],t=t[1],n=L(t);return[n*L(e),n*N(e),N(t)]}function D_(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function F_(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 z_(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function W_(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function G_(t){var e=O_(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function H_(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 Y_(t,e){return v_(t)>T&&(t-=Math.round(t/p_)*p_),[t,e]}function V_(t,e,n){return(t%=p_)?e||n?H_($_(t),U_(e,n)):$_(t):e||n?U_(e,n):Y_}function q_(n){return function(t,e){return v_(t+=n)>T&&(t-=Math.round(t/p_)*p_),[t,e]}}function $_(t){var e=q_(t);return e.invert=q_(-t),e}function U_(t,e){var i=L(t),a=N(t),o=L(e),s=N(e);function n(t,e){var n=L(e),r=L(t)*n,t=N(t)*n,n=N(e),e=n*i+r*a;return[b_(t*o-e*s,r*i-n*a),__(e*o+t*s)]}return n.invert=function(t,e){var n=L(e),r=L(t)*n,t=N(t)*n,n=N(e),e=n*o-t*s;return[b_(t*o+n*s,r*i+e*a),__(e*i-r*a)]},n}function X_(t,e){(e=B_(e))[0]-=t,G_(e);t=A_(-e[1]);return((-e[2]<0?-t:t)+p_-P)%p_}function K_(){var r,e=[];return{point:function(t,e,n){r.push([t,e,n])},lineStart:function(){e.push(r=[])},lineEnd:T_,rejoin:function(){1<e.length&&e.push(e.pop().concat(e.shift()))},result:function(){var t=e;return e=[],r=null,t}}}function Z_(t,e){return v_(t[0]-e[0])<P&&v_(t[1]-e[1])<P}function Q_(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 J_(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(Z_(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*P}s.push(n=new Q_(r,t,null,!0)),l.push(n.o=new Q_(r,null,n,!1)),s.push(n=new Q_(i,t,null,!1)),l.push(n.o=new Q_(i,null,n,!0))}}),s.length){for(l.sort(e),t4(s),t4(l),o=0,i=l.length;o<i;++o)l[o].e=n=!n;for(var c,u,h=s[0];;){for(var f=h,d=!0;f.v;)if((f=f.n)===h)return;c=f.z,a.lineStart();do{if(f.v=f.o.v=!0,f.e){if(d)for(o=0,i=c.length;o<i;++o)a.point((u=c[o])[0],u[1]);else r(f.x,f.n.x,1,a);f=f.n}else{if(d)for(c=f.p.z,o=c.length-1;0<=o;--o)a.point((u=c[o])[0],u[1]);else r(f.x,f.p.x,-1,a);f=f.p}}while(c=(f=f.o).z,d=!d,!f.v);a.lineEnd()}}}function t4(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 e4(t){return v_(t[0])<=T?t[0]:E_(t[0])*((v_(t[0])+T)%p_-T)}function n4(m,v,y,b){return function(s){var l,c,u,n=v(s),h=K_(),f=v(h),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=rp(c);var t=function(t,e){var n=e4(e),r=e[1],e=N(r),i=[N(n),-L(n),0],a=0,o=0,s=new Sd;1===e?r=f_+P:-1===e&&(r=-f_-P);for(var l=0,c=t.length;l<c;++l)if(h=(u=t[l]).length)for(var u,h,f=u[h-1],d=e4(f),p=f[1]/2+d_,g=N(p),m=L(p),v=0;v<h;++v,d=b,g=w,m=x,f=y){var y=u[v],b=e4(y),x=y[1]/2+d_,w=N(x),x=L(x),M=b-d,k=0<=M?1:-1,E=k*M,O=T<E,S=g*w;s.add(b_(S*k*N(E),m*x+S*L(E))),a+=O?M+k*p_:M,O^n<=d^n<=b&&(G_(S=F_(B_(f),B_(y))),G_(E=F_(i,S)),(k=(O^0<=M?-1:1)*__(E[2]))<r||r===k&&(S[0]||S[1]))&&(o+=O^0<=M?1:-1)}return(a<-P||a<P&&s<-h_)^1&o}(l,b);c.length?(d||(s.polygonStart(),d=!0),J_(c,i4,t,y,s)):t&&(d||(s.polygonStart(),d=!0),s.lineStart(),y(null,null,1,s),s.lineEnd()),d&&(s.polygonEnd(),d=!1),c=l=null},sphere:function(){s.polygonStart(),s.lineStart(),y(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]),f.point(t,e)}function o(){f.lineStart(),u=[]}function g(){p(u[0][0],u[0][1]),f.lineEnd();var t,e,n,r,i=f.clean(),a=h.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(r4))}return e}}function r4(t){return 1<t.length}function i4(t,e){return((t=t.x)[0]<0?t[1]-f_-P:f_-t[1])-((e=e.x)[0]<0?e[1]-f_-P:f_-e[1])}Y_.invert=Y_;var a4=n4(function(){return 1},function(c){var u,h=NaN,f=NaN,d=NaN;return{lineStart:function(){c.lineStart(),u=1},point:function(t,e){var n,r,i,a,o,s=0<t?T:-T,l=v_(t-h);v_(l-T)<P?(c.point(h,f=0<(f+e)/2?f_:-f_),c.point(d,f),c.lineEnd(),c.lineStart(),c.point(s,f),c.point(t,f),u=0):d!==s&&T<=l&&(v_(h-d)<P&&(h-=d*P),v_(t-s)<P&&(t-=s*P),l=f,i=e,o=N((n=h)-(r=t)),f=v_(o)>P?y_((N(l)*(a=L(i))*N(r)-N(i)*(r=L(l))*N(n))/(r*a*o)):(l+i)/2,c.point(d,f),c.lineEnd(),c.lineStart(),c.point(s,f),u=0),c.point(h=t,f=e),d=s},lineEnd:function(){c.lineEnd(),h=f=NaN},clean:function(){return 2-u}}},function(t,e,n,r){var i;null==t?(i=n*f_,r.point(-T,i),r.point(0,i),r.point(T,i),r.point(T,0),r.point(T,-i),r.point(0,-i),r.point(-T,-i),r.point(-T,0),r.point(-T,i)):v_(t[0]-e[0])>P?(t=t[0]<e[0]?T:-T,i=n*t/2,r.point(-t,i),r.point(0,i),r.point(t,i)):r.point(e[0],e[1])},[-T,-f_]);function o4(d){var g=L(d),p=6*m_,h=0<g,f=v_(g)>P;function m(t,e){return L(t)*L(e)>g}function v(t,e,n){var r,i,a,o,s,l,c,u=[1,0,0],h=F_(B_(t),B_(e)),f=D_(h,h),d=h[0],p=f-d*d;return p?(r=F_(u,h),z_(u=W_(u,g*f/p),W_(h,-g*d/p)),(p=(h=D_(u,f=r))*h-(d=D_(f,f))*(D_(u,u)-1))<0?void 0:(z_(p=W_(f,(-h-(r=O_(p)))/d),u),p=I_(p),n?(i=t[0],a=e[0],o=t[1],e=e[1],a<i&&(c=i,i=a,a=c),!(l=v_((s=a-i)-T)<P)&&e<o&&(c=o,o=e,e=c),(l||s<P?l?0<o+e^p[1]<(v_(p[0]-i)<P?o:e):o<=p[1]&&p[1]<=e:T<s^(i<=p[0]&&p[0]<=a))?(z_(c=W_(f,(-h+r)/d),u),[p,I_(c)]):void 0):p)):!n&&t}function y(t,e){var n=h?d:T-d,r=0;return t<-n?r|=1:n<t&&(r|=2),e<-n?r|=4:n<e&&(r|=8),r}return n4(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=h?i?0:y(t,e):i?y(t+(t<0?T:-T),e):0;!o&&(c=l=i)&&a.lineStart(),i===l||(n=v(o,r))&&!Z_(o,n)&&!Z_(r,n)||(r[2]=1),i!==l?(u=0,i?(a.lineStart(),n=v(r,o),a.point(n[0],n[1])):(n=v(o,r),a.point(n[0],n[1],2),a.lineEnd()),o=n):f&&o&&h^i&&(t&s||!(e=v(r,o,!0))||(u=0,h?(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&&Z_(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=L(r),c=N(r),u=o*a;null==n?(n=r+o*p_,s=r-u/2):(n=X_(l,n),s=X_(l,s),(0<o?n<s:s<n)&&(n+=o*p_));for(var h,f=n;0<o?s<f:f<s;f-=u)h=I_([l,-c*L(f),-c*N(f)]),i.point(h[0],h[1])}},h?[0,-d]:[-T,d-T])}var s4=1e9,l4=-s4;function c4(v,y,b,x){function w(t,e){return v<=t&&t<=b&&y<=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?v:b,1<i?x:y),(i=(i+n+4)%4)!==a;);else r.point(e[0],e[1])}function o(t,e){return v_(t[0]-v)<P?0<e?0:3:v_(t[0]-b)<P?0<e?2:1:v_(t[1]-y)<P?0<e?1:0:0<e?3:2}function k(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,h,a,o,s,l,c,u,f,d,p,g=r,t=K_(),e={point:n,lineStart:function(){e.point=m,h&&h.push(a=[]);d=!0,f=!1,c=u=NaN},lineEnd:function(){i&&(m(o,s),l&&f&&t.rejoin(),i.push(t.result()));e.point=n,f&&g.lineEnd()},polygonStart:function(){g=t,i=[],h=[],p=!0},polygonEnd:function(){var t=function(){for(var t=0,e=0,n=h.length;e<n;++e)for(var r,i,a=h[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)*(v-r)<(c-r)*(x-i)&&++t:u<=x&&(c-r)*(x-i)<(u-i)*(v-r)&&--t;return t}(),e=p&&t,n=(i=rp(i)).length;(e||n)&&(r.polygonStart(),e&&(r.lineStart(),M(null,null,1,r),r.lineEnd()),n&&J_(i,k,t,M,r),r.polygonEnd());g=r,i=h=a=null}};function n(t,e){w(t,e)&&g.point(t,e)}function m(t,e){var n,r,i=w(t,e);h&&a.push([t,e]),d?(o=t,s=e,d=!1,(l=i)&&(g.lineStart(),g.point(t,e))):i&&f?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,h=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,h||!(0<n)){if(n/=h,h<0){if(n<l)return;n<c&&(c=n)}else if(0<h){if(c<n)return;l<n&&(l=n)}if(n=a-s,h||!(n<0)){if(n/=h,h<0){if(c<n)return;l<n&&(l=n)}else if(0<h){if(n<l)return;n<c&&(c=n)}return 0<l&&(t[0]=o+l*u,t[1]=s+l*h),c<1&&(e[0]=o+c*u,e[1]=s+c*h),1}}}}}(n=[c=Math.max(l4,Math.min(s4,c)),u=Math.max(l4,Math.min(s4,u))],r=[t=Math.max(l4,Math.min(s4,t)),e=Math.max(l4,Math.min(s4,e))],v,y,b,x)?i&&(g.lineStart(),g.point(t,e),p=!1):(f||(g.lineStart(),g.point(n[0],n[1])),g.point(r[0],r[1]),i||g.lineEnd(),p=!1),c=t,u=e,f=i}return e}}function u4(t,e,n){var r=ip(t,e-P,n).concat(e);return function(e){return r.map(function(t){return[e,t]})}}function h4(t,e,n){var r=ip(t,e-P,n).concat(e);return function(e){return r.map(function(t){return[t,e]})}}function f4(){return g=p=10,m=90,v=360,y=2.5,e.lines=function(){return t().map(function(t){return{type:"LineString",coordinates:t}})},e.outline=function(){return{type:"Polygon",coordinates:[f(a).concat(d(l).slice(1),f(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(y)):[[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(y)):[[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],v=+t[1],e):[m,v]},e.stepMinor=function(t){return arguments.length?(p=+t[0],g=+t[1],e):[p,g]},e.precision=function(t){return arguments.length?(y=+t,u=u4(s,o,90),h=h4(r,n,y),f=u4(c,l,90),d=h4(a,i,y),e):y},e.extentMajor([[-180,-90+P],[180,90-P]]).extentMinor([[-180,-80-P],[180,80+P]])();function e(){return{type:"MultiLineString",coordinates:t()}}function t(){return ip(x_(a/m)*m,i,m).map(f).concat(ip(x_(c/v)*v,l,v).map(d)).concat(ip(x_(r/p)*p,n,p).filter(function(t){return v_(t%m)>P}).map(u)).concat(ip(x_(s/g)*g,o,g).filter(function(t){return v_(t%v)>P}).map(h))}var n,r,i,a,o,s,l,c,u,h,f,d,p,g,m,v,y}var d4,p4,g4,m4,v4=t=>t,y4=new Sd,b4=new Sd,x4={point:T_,lineStart:T_,lineEnd:T_,polygonStart:function(){x4.lineStart=w4,x4.lineEnd=E4},polygonEnd:function(){x4.lineStart=x4.lineEnd=x4.point=T_,y4.add(v_(b4)),b4=new Sd},result:function(){var t=y4/2;return y4=new Sd,t}};function w4(){x4.point=M4}function M4(t,e){x4.point=k4,d4=g4=t,p4=m4=e}function k4(t,e){b4.add(m4*t-g4*e),g4=t,m4=e}function E4(){k4(d4,p4)}var O4=x4,S4=1/0,A4=S4,_4=-S4,T4=_4;var P4,L4,C4,N4,j4={point:function(t,e){t<S4&&(S4=t);_4<t&&(_4=t);e<A4&&(A4=e);T4<e&&(T4=e)},lineStart:T_,lineEnd:T_,polygonStart:T_,polygonEnd:T_,result:function(){var t=[[S4,A4],[_4,T4]];return _4=T4=-(A4=S4=1/0),t}},R4=0,I4=0,B4=0,D4=0,F4=0,z4=0,W4=0,G4=0,H4=0,Y4={point:V4,lineStart:q4,lineEnd:X4,polygonStart:function(){Y4.lineStart=K4,Y4.lineEnd=Z4},polygonEnd:function(){Y4.point=V4,Y4.lineStart=q4,Y4.lineEnd=X4},result:function(){var t=H4?[W4/H4,G4/H4]:z4?[D4/z4,F4/z4]:B4?[R4/B4,I4/B4]:[NaN,NaN];return R4=I4=B4=D4=F4=z4=W4=G4=H4=0,t}};function V4(t,e){R4+=t,I4+=e,++B4}function q4(){Y4.point=$4}function $4(t,e){Y4.point=U4,V4(C4=t,N4=e)}function U4(t,e){var n=t-C4,r=e-N4,n=O_(n*n+r*r);D4+=n*(C4+t)/2,F4+=n*(N4+e)/2,z4+=n,V4(C4=t,N4=e)}function X4(){Y4.point=V4}function K4(){Y4.point=Q4}function Z4(){J4(P4,L4)}function Q4(t,e){Y4.point=J4,V4(P4=C4=t,L4=N4=e)}function J4(t,e){var n=t-C4,r=e-N4,n=O_(n*n+r*r);D4+=n*(C4+t)/2,F4+=n*(N4+e)/2,z4+=n,W4+=(n=N4*t-C4*e)*(C4+t),G4+=n*(N4+e),H4+=3*n,V4(C4=t,N4=e)}var tT=Y4;function eT(t){this._context=t}eT.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,p_)}},result:T_};var nT,rT,iT,aT,oT,sT=new Sd,lT={point:T_,lineStart:function(){lT.point=cT},lineEnd:function(){nT&&uT(rT,iT),lT.point=T_},polygonStart:function(){nT=!0},polygonEnd:function(){nT=null},result:function(){var t=+sT;return sT=new Sd,t}};function cT(t,e){lT.point=uT,rT=aT=t,iT=oT=e}function uT(t,e){aT-=t,oT-=e,sT.add(O_(aT*aT+oT*oT)),aT=t,oT=e}var hT=lT;let fT,dT,pT,gT;class mT{constructor(t){this._append=null==t?vT:function(t){var e=Math.floor(t);if(!(0<=e))throw new RangeError("invalid digits: "+t);if(15<e)return vT;if(e!==fT){const r=10**e;fT=e,dT=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 dT}(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===pT&&this._append===dT||(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`,pT=n,dT=this._append,gT=this._,this._=r),this._+=gT}}result(){var t=this._;return this._="",t.length?t:null}}function vT(t){let e=1;this._+=t[0];for(var n=t.length;e<n;++e)this._+=arguments[e]+t[e]}function yT(e,n){let r=3,i=4.5,a,o;function s(t){return t&&("function"==typeof i&&o.pointRadius(+i.apply(this,arguments)),R_(t,a(o))),o.result()}return s.area=function(t){return R_(t,a(O4)),O4.result()},s.measure=function(t){return R_(t,a(hT)),hT.result()},s.bounds=function(t){return R_(t,a(j4)),j4.result()},s.centroid=function(t){return R_(t,a(tT)),tT.result()},s.projection=function(t){return arguments.length?(a=null==t?(e=null,v4):(e=t).stream,s):e},s.context=function(t){return arguments.length?(o=null==t?(n=null,new mT(r)):new eT(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 mT(r)),s},s.projection(e).digits(r).context(n)}function bT(r){return function(t){var e,n=new xT;for(e in r)n[e]=r[e];return n.stream=t,n}}function xT(){}function wT(t,e,n){var r=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=r&&t.clipExtent(null),R_(n,t.stream(j4)),e(j4.result()),null!=r&&t.clipExtent(r),t}function MT(i,a,t){return wT(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 kT(t,e,n){return MT(t,[[0,0],e],n)}function ET(r,i,t){return wT(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 OT(i,a,t){return wT(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)}xT.prototype={constructor:xT,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 ST=16,AT=L(30*m_);function _T(t,e){return+e?(A=t,_=e,function(r){var n,i,a,o,s,l,c,u,h,f,d,p,g={point:t,lineStart:e,lineEnd:v,polygonStart:function(){r.polygonStart(),g.lineStart=y},polygonEnd:function(){r.polygonEnd(),g.lineStart=e}};function t(t,e){t=A(t,e),r.point(t[0],t[1])}function e(){u=NaN,g.point=m,r.lineStart()}function m(t,e){var n=B_([t,e]),e=A(t,e);T(u,h,c,f,d,p,u=e[0],h=e[1],c=t,f=n[0],d=n[1],p=n[2],ST,r),r.point(u,h)}function v(){g.point=t,r.lineEnd()}function y(){e(),g.point=b,g.lineEnd=x}function b(t,e){m(n=t,e),i=u,a=h,o=f,s=d,l=p,g.point=m}function x(){T(u,h,c,f,d,p,i,a,n,o,s,l,ST,r),g.lineEnd=v,v()}return g}):(n=t,bT({point:function(t,e){t=n(t,e),this.stream.point(t[0],t[1])}}));var n,A,_;function T(t,e,n,r,i,a,o,s,l,c,u,h,f,d){var p,g,m,v,y,b,x,w,M,k,E=o-t,O=s-e,S=E*E+O*O;4*_<S&&f--&&(m=a+h,x=__(m/=v=O_((p=r+c)*p+(g=i+u)*g+m*m)),y=v_(v_(m)-1)<P||v_(n-l)<P?(n+l)/2:b_(g,p),b=(x=A(y,x))[0],x=x[1],_<(k=O*(w=b-t)-E*(M=x-e))*k/S||.3<v_((E*w+O*M)/S-.5)||r*c+i*u+a*h<AT)&&(T(t,e,n,r,i,a,b,x,y,p/=v,g/=v,m,f,d),d.point(b,x),T(b,x,y,p,g,m,o,s,l,c,u,h,f,d))}}var TT=bT({point:function(t,e){this.stream.point(t*m_,e*m_)}});function PT(t,n,r,i,a,e){var o,s,l,c,u,h,f,d,p,g,m,v;return e?(h=L(e),e=N(e),f=h*t,d=e*t,p=h/t,g=e/t,m=(e*r-h*n)/t,v=(e*n+h*r)/t,b.invert=function(t,e){return[i*(p*t-g*e+m),a*(v-g*t-p*e)]},b):(o=t,s=n,l=r,c=i,u=a,y.invert=function(t,e){return[(t-s)/o*c,(l-e)/o*u]},y);function y(t,e){return[s+o*(t*=c),l-o*(e*=u)]}function b(t,e){return[f*(t*=i)-d*(e*=a)+n,r-d*t-f*e]}}function LT(t){return CT(function(){return t})()}function CT(t){var e,r,n,i,a,o,s,l,c,u,h=150,f=480,d=250,p=0,g=0,m=0,v=0,y=0,b=0,x=1,w=1,M=null,k=a4,E=null,O=v4,S=.5;function A(t){return l(t[0]*m_,t[1]*m_)}function _(t){return(t=l.invert(t[0],t[1]))&&[t[0]*g_,t[1]*g_]}function T(){var t=PT(h,0,0,x,w,b).apply(null,e(p,g)),t=PT(h,f-t[0],d-t[1],x,w,b);return r=V_(m,v,y),s=H_(e,t),l=H_(r,s),o=_T(s,S),P()}function P(){return c=u=null,A}return A.stream=function(t){return c&&u===t?c:c=TT((n=r,bT({point:function(t,e){t=n(t,e);return this.stream.point(t[0],t[1])}})(k(o(O(u=t))))));var n},A.preclip=function(t){return arguments.length?(k=t,M=void 0,P()):k},A.postclip=function(t){return arguments.length?(O=t,E=n=i=a=null,P()):O},A.clipAngle=function(t){return arguments.length?(k=+t?o4(M=t*m_):(M=null,a4),P()):M*g_},A.clipExtent=function(t){return arguments.length?(O=null==t?(E=n=i=a=null,v4):c4(E=+t[0][0],n=+t[0][1],i=+t[1][0],a=+t[1][1]),P()):null==E?null:[[E,n],[i,a]]},A.scale=function(t){return arguments.length?(h=+t,T()):h},A.translate=function(t){return arguments.length?(f=+t[0],d=+t[1],T()):[f,d]},A.center=function(t){return arguments.length?(p=t[0]%360*m_,g=t[1]%360*m_,T()):[p*g_,g*g_]},A.rotate=function(t){return arguments.length?(m=t[0]%360*m_,v=t[1]%360*m_,y=2<t.length?t[2]%360*m_:0,T()):[m*g_,v*g_,y*g_]},A.angle=function(t){return arguments.length?(b=t%360*m_,T()):b*g_},A.reflectX=function(t){return arguments.length?(x=t?-1:1,T()):x<0},A.reflectY=function(t){return arguments.length?(w=t?-1:1,T()):w<0},A.precision=function(t){return arguments.length?(o=_T(s,S=t*t),P()):O_(S)},A.fitExtent=function(t,e){return MT(A,t,e)},A.fitSize=function(t,e){return kT(A,t,e)},A.fitWidth=function(t,e){return ET(A,t,e)},A.fitHeight=function(t,e){return OT(A,t,e)},function(){return e=t.apply(this,arguments),A.invert=e.invert&&_,T()}}function NT(t){var e=0,n=T/3,r=CT(t),t=r(e,n);return t.parallels=function(t){return arguments.length?r(e=t[0]*m_,n=t[1]*m_):[e*g_,n*g_]},t}function jT(t,e){var n,r,i,a=N(t),o=(a+N(e))/2;return v_(o)<P?(n=L(t),s.invert=function(t,e){return[t/n,__(e*n)]},s):(i=O_(r=1+a*(2*o-a))/o,l.invert=function(t,e){var e=i-e,n=b_(t,v_(e))*E_(e);return e*o<0&&(n-=T*E_(t)*E_(e)),[n/o,__((r-(t*t+e*e)*o*o)/(2*o))]},l);function s(t,e){return[t*n,N(e)/n]}function l(t,e){e=O_(r-2*o*N(e))/o;return[e*N(t*=o),i-e*L(t)]}}function RT(){return NT(jT).scale(155.424).center([0,33.6442])}function IT(){return RT().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function BT(i){return function(t,e){var n=L(t),r=L(e),n=i(n*r);return n===1/0?[2,0]:[n*r*N(t),n*N(e)]}}function DT(a){return function(t,e){var n=O_(t*t+e*e),r=a(n),i=N(r),r=L(r);return[b_(t*i,n*r),__(n&&e*i/n)]}}var FT=BT(function(t){return O_(2/(1+t))});FT.invert=DT(function(t){return 2*__(t/2)});var zT=BT(function(t){return(t=A_(t))&&t/N(t)});function WT(t,e){return[t,M_(S_((f_+e)/2))]}function GT(r){var i,a,o,s=LT(r),e=s.center,l=s.scale,n=s.translate,c=s.clipExtent,u=null;function h(){var e,t=T*l(),n=s((e=V_((e=s.rotate())[0]*m_,e[1]*m_,2<e.length?e[2]*m_:0),function(t){return(t=e.invert(t[0]*m_,t[1]*m_))[0]*=g_,t[1]*=g_,t}([0,0])));return c(null==u?[[n[0]-t,n[1]-t],[n[0]+t,n[1]+t]]:r===WT?[[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),h):l)()},s.translate=function(t){return(arguments.length?(n(t),h):n)()},s.center=function(t){return(arguments.length?(e(t),h):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]),h()):null==u?null:[[u,i],[a,o]]},h()}function HT(t){return S_((f_+t)/2)}function YT(t,e){var n=L(t),i=t===e?N(t):M_(n/L(e))/M_(HT(e)/HT(t)),a=n*k_(HT(t),i)/i;return i?(r.invert=function(t,e){var e=a-e,n=E_(i)*O_(t*t+e*e),r=b_(t,v_(e))*E_(e);return e*i<0&&(r-=T*E_(t)*E_(e)),[r/i,2*y_(k_(a/n,1/i))-f_]},r):WT;function r(t,e){0<a?e<-f_+P&&(e=-f_+P):f_-P<e&&(e=f_-P);e=a/k_(HT(e),i);return[e*N(i*t),a-e*L(i*t)]}}function VT(t,e){return[t,e]}function qT(t,e){var n=L(t),r=t===e?N(t):(n-L(e))/(e-t),i=n/r+t;return v_(r)<P?VT:(a.invert=function(t,e){var e=i-e,n=b_(t,v_(e))*E_(e);return e*r<0&&(n-=T*E_(t)*E_(e)),[n/r,i-E_(r)*O_(t*t+e*e)]},a);function a(t,e){e=i-e,t*=r;return[e*N(t),i-e*L(t)]}}zT.invert=DT(function(t){return t}),WT.invert=function(t,e){return[t,2*y_(w_(e))-f_]},VT.invert=VT;var $T=1.340264,UT=-.081106,XT=893e-6,KT=.003796,ZT=O_(3)/2;function QT(t,e){var e=__(ZT*N(e)),n=e*e,r=n*n*n;return[t*L(e)/(ZT*($T+3*UT*n+r*(7*XT+9*KT*n))),e*($T+UT*n+r*(XT+KT*n))]}function JT(t,e){var n=L(e),r=L(t)*n;return[n*N(t)/r,N(e)/r]}function t6(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 e6(t,e){return[L(e)*N(t),N(e)]}function n6(t,e){var n=L(e),r=1+L(t)*n;return[n*N(t)/r,N(e)/r]}function r6(t,e){return[M_(S_((f_+e)/2)),-t]}QT.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*($T+UT*i+a*(XT+KT*i))-e)/($T+3*UT*i+a*(7*XT+9*KT*i)))*r)*i*i,!(v_(n)<h_));++o);return[ZT*t*($T+3*UT*i+a*(7*XT+9*KT*i))/L(r),__(N(r)/ZT)]},JT.invert=DT(y_),t6.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))),v_(a)>P&&0<--r);return[t/(.8707+(i=n*n)*(i*(i*i*i*(.003971-.001529*i)-.013791)-.131979)),n]},e6.invert=DT(__),n6.invert=DT(function(t){return 2*y_(t)}),r6.invert=function(t,e){return[-e,2*y_(w_(t))-f_]};var i6=Object.freeze({__proto__:null,geoAlbersUsa:function(){var e,n,i,a,o,r,s=IT(),l=RT().rotate([154,0]).center([-2,58.5]).parallels([55,65]),c=RT().rotate([157,0]).center([-3,19.9]).parallels([8,18]),u={point:function(t,e){r=[t,e]}};function h(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 f(){return e=n=null,h}return h.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)},h.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},h.precision=function(t){return arguments.length?(s.precision(t),l.precision(t),c.precision(t),f()):s.precision()},h.scale=function(t){return arguments.length?(s.scale(t),l.scale(.35*t),c.scale(t),h.translate(s.translate())):s.scale()},h.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+P,r+.12*e+P],[n-.214*e-P,r+.234*e-P]]).stream(u),o=c.translate([n-.205*e,r+.212*e]).clipExtent([[n-.214*e+P,r+.166*e+P],[n-.115*e-P,r+.234*e-P]]).stream(u),f()):s.translate()},h.fitExtent=function(t,e){return MT(h,t,e)},h.fitSize=function(t,e){return kT(h,t,e)},h.fitWidth=function(t,e){return ET(h,t,e)},h.fitHeight=function(t,e){return OT(h,t,e)},h.scale(1070)},geoAlbers:IT,geoAzimuthalEqualArea:function(){return LT(FT).scale(124.75).clipAngle(179.999)},geoAzimuthalEqualAreaRaw:FT,geoAzimuthalEquidistant:function(){return LT(zT).scale(79.4188).clipAngle(179.999)},geoAzimuthalEquidistantRaw:zT,geoConicConformal:function(){return NT(YT).scale(109.5).parallels([30,30])},geoConicConformalRaw:YT,geoConicEqualArea:RT,geoConicEqualAreaRaw:jT,geoConicEquidistant:function(){return NT(qT).scale(131.154).center([0,13.9389])},geoConicEquidistantRaw:qT,geoEqualEarth:function(){return LT(QT).scale(177.158)},geoEqualEarthRaw:QT,geoEquirectangular:function(){return LT(VT).scale(152.63)},geoEquirectangularRaw:VT,geoGnomonic:function(){return LT(JT).scale(144.049).clipAngle(60)},geoGnomonicRaw:JT,geoIdentity:function(){var r,i,e,n,a,o,s,l=1,c=0,u=0,h=1,f=1,d=0,p=null,g=1,m=1,v=bT({point:function(t,e){t=x([t,e]);this.stream.point(t[0],t[1])}}),y=v4;function b(){return g=l*h,m=l*f,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=v(y(s=t))},x.postclip=function(t){return arguments.length?(y=t,p=e=n=a=null,b()):y},x.clipExtent=function(t){return arguments.length?(y=null==t?(p=e=n=a=null,v4):c4(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=N(d=t%360*m_),r=L(d),b()):d*g_},x.reflectX=function(t){return arguments.length?(h=t?-1:1,b()):h<0},x.reflectY=function(t){return arguments.length?(f=t?-1:1,b()):f<0},x.fitExtent=function(t,e){return MT(x,t,e)},x.fitSize=function(t,e){return kT(x,t,e)},x.fitWidth=function(t,e){return ET(x,t,e)},x.fitHeight=function(t,e){return OT(x,t,e)},x},geoProjection:LT,geoProjectionMutator:CT,geoMercator:function(){return GT(WT).scale(961/p_)},geoMercatorRaw:WT,geoNaturalEarth1:function(){return LT(t6).scale(175.295)},geoNaturalEarth1Raw:t6,geoOrthographic:function(){return LT(e6).scale(249.5).clipAngle(90+P)},geoOrthographicRaw:e6,geoStereographic:function(){return LT(n6).scale(250).clipAngle(142)},geoStereographicRaw:n6,geoTransverseMercator:function(){var t=GT(r6),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:r6});function a6(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 o6(t,e,n,r){var i,a,o,s,l,c,{outline:e=(e=e.filter(l6),e.find(t=>t.sphere)?{type:"Sphere"}:a6(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]]=yT(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 s6(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:[f4()]}}):"sphere"===e?Object.assign(Object.assign({},t),{sphere:!0,data:{value:[{type:"Sphere"}]}}):t)}function l6(t){return"geoPath"===t.type}$v=()=>t=>{var{children:e,coordinate:n={}}=t;if(!Array.isArray(e))return[];const{type:r="equalEarth"}=n,f=it(n,["type"]),d=function(t){if("function"==typeof t)return t;var e="geo"+rn(t);if(e=i6[e])return e;throw new Error("Unknown coordinate: "+t)}(r),p=e.map(s6);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=(o6(i,p,l,f),i),l=f;for([o,s]of Object.entries(l))null!=(a=c[o])&&a.call(c,s);g=yT(i);const u=new Pv({domain:[t,t+n]}),h=new Pv({domain:[e,e+r]});return{transform:t=>{return t=t,(t=i(t))?([t,e]=t,[u.map(t),h.map(e)]):null;var e},untransform:t=>{return(t=t)?([t,e]=t,t=[u.invert(t),h.invert(e)],i.invert(t)):null;var e}}}]]}},children:p.flatMap(t=>{var e,n,r;return l6(t)?({style:n,tooltip:r={}}=e=t,Object.assign(Object.assign({},e),{type:"path",tooltip:c0(r,{title:"id",items:[{channel:"color"}]}),style:Object.assign(Object.assign({},n),{d:t=>g(t)||[]})})):t})})]},$v.props={},Uo=()=>t=>{var{data:e,scale:n,encode:r,style:i,animate:a,key:o,state:s}=t,t=it(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}]})]};Uo.props={};const c6={"composition.geoView":$v,"composition.geoPath":Uo};function u6(){return Object.assign({"data.fetch":$g,"data.inline":t1,"data.sortBy":Jg,"data.sort":Kg,"data.filter":Xg,"data.pick":Zg,"data.rename":Qg,"data.fold":Ug,"data.slice":T1,"data.custom":e1,"data.map":n1,"data.cluster":_g,"data.tree":Tg,"data.sankey":Kp,"data.arc":o1,"data.wordCloud":S1,"data.join":_1,"data.kde":I1,"data.venn":nm,"transform.maybeZeroY1":N3,"transform.maybeZeroX":$3,"transform.maybeStackY":V3,"transform.maybeTitle":q3,"transform.maybeSeries":Z3,"transform.maybeZeroPadding":rA,"transform.stackY":H3,"transform.binX":XA,"transform.bin":UA,"transform.dodgeX":lA,"transform.jitter":dA,"transform.jitterX":pA,"transform.symmetryY":gA,"transform.diffY":mA,"transform.stackEnter":cA,"transform.normalizeY":uA,"transform.select":wA,"transform.selectX":MA,"transform.selectY":kA,"transform.groupX":RA,"transform.groupY":IA,"transform.groupColor":BA,"transform.group":jA,"transform.maybeSize":X3,"transform.maybeZeroY":U3,"transform.maybeKey":K3,"transform.sortX":zA,"transform.sortY":GA,"transform.sortColor":WA,"transform.flexX":HA,"transform.maybeTupleY":Q3,"transform.maybeTupleX":J3,"transform.maybeIdentityY":tA,"transform.maybeIdentityX":eA,"transform.maybeTuple":oA,"transform.maybeVisualPosition":iA,"transform.maybeFunctionAttribute":aA,"transform.maybeGradient":sA,"transform.maybeTooltip":nA,"transform.pack":VA,"transform.sample":QA,"transform.filter":JA,"coordinate.cartesian":Fh,"coordinate.polar":Wh,"coordinate.helix":Gh,"coordinate.transpose":Hh,"coordinate.theta":Yh,"coordinate.parallel":$h,"coordinate.fisheye":Uh,"coordinate.radial":qh,"coordinate.radar":Xh,"encode.constant":Kh,"encode.field":Qh,"encode.transform":Zh,"encode.column":Jh,"mark.interval":pd,"mark.rect":gd,"mark.line":vp,"mark.point":yp,"mark.text":bp,"mark.cell":xp,"mark.area":wp,"mark.link":Mp,"mark.image":kp,"mark.polygon":Ep,"mark.box":Op,"mark.vector":Sp,"mark.lineX":_p,"mark.lineY":Ap,"mark.connector":Tp,"mark.range":Cp,"mark.rangeX":Np,"mark.rangeY":jp,"mark.sankey":m0,"mark.path":v0,"mark.treemap":w0,"mark.pack":E0,"mark.boxplot":N0,"mark.shape":j0,"mark.forceGraph":Sg,"mark.gauge":Ay,"mark.tree":jg,"mark.wordCloud":rm,"mark.density":_y,"mark.heatmap":Ty,"palette.category10":Py,"palette.category20":Ly,"scale.linear":Ny,"scale.ordinal":jy,"scale.band":Cy,"scale.identity":Ry,"scale.point":Iy,"scale.time":By,"scale.log":Dy,"scale.pow":Fy,"scale.sqrt":Hy,"scale.threshold":zy,"scale.quantile":Wy,"scale.quantize":Gy,"scale.sequential":Yy,"scale.constant":Vy,"shape.interval.rect":Xb,"shape.interval.hollow":Kb,"shape.interval.funnel":Zb,"shape.interval.pyramid":Jb,"shape.rect.rect":Xb,"shape.rect.hollow":Kb,"shape.cell.cell":Xb,"shape.cell.hollow":Kb,"shape.line.line":r2,"shape.line.hv":a2,"shape.line.vh":o2,"shape.line.hvh":s2,"shape.line.trail":l2,"shape.line.smooth":i2,"shape.point.bowtie":u2,"shape.point.cross":h2,"shape.point.diamond":f2,"shape.point.hexagon":d2,"shape.point.hollowBowtie":p2,"shape.point.hollowDiamond":g2,"shape.point.hollowHexagon":m2,"shape.point.hollow":v2,"shape.point.hollowSquare":y2,"shape.point.hollowTriangle":b2,"shape.point.hollowTriangleDown":x2,"shape.point.hyphen":w2,"shape.point.line":M2,"shape.point.plus":k2,"shape.point.point":E2,"shape.point.square":O2,"shape.point.tick":S2,"shape.point.triangle":A2,"shape.point.triangleDown":_2,"shape.text.text":Hk,"shape.area.area":Uk,"shape.area.smooth":Xk,"shape.area.hvh":Kk,"shape.area.vh":Zk,"shape.area.hv":Qk,"shape.link.smooth":tE,"shape.link.vhv":eE,"shape.link.arc":nE,"shape.link.link":Jk,"shape.image.image":rE,"shape.polygon.polygon":iE,"shape.polygon.ribbon":aE,"shape.box.box":oE,"shape.box.violin":sE,"shape.vector.vector":T2,"shape.label.label":OE,"shape.text.badge":Vk,"shape.lineX.line":lE,"shape.lineY.line":lE,"shape.shape.shape":RE,"shape.connector.connector":hE,"shape.range.range":Xb,"shape.rangeX.range":Xb,"shape.rangeY.range":Xb,"shape.path.path":AE,"shape.path.hollow":_E,"shape.density.density":TE,"shape.heatmap.heatmap":jE,"theme.classic":IE,"theme.classicDark":BE,"theme.academy":FE,"component.axisX":pO,"component.axisY":gO,"component.axisRadar":mO,"component.axisLinear":fO,"component.axisArc":dO,"component.legendCategory":xO,"component.legendContinuous":OO,"component.legendContinuousBlock":SO,"component.legendContinuousBlockSize":_O,"component.legendContinuousSize":AO,"component.legends":HO,"component.title":LO,"component.sliderX":DO,"component.sliderY":FO,"component.scrollbarX":WO,"component.scrollbarY":GO,"animation.scaleInX":YO,"animation.scaleOutX":VO,"animation.scaleInY":qO,"animation.scaleOutY":$O,"animation.waveIn":a5,"animation.fadeIn":UO,"animation.fadeOut":XO,"animation.zoomIn":o5,"animation.zoomOut":s5,"animation.pathIn":l5,"animation.morphing":i5,"animation.growInX":c5,"animation.growInY":u5,"interaction.elementHighlight":N5,"interaction.elementHighlightByX":j5,"interaction.elementHighlightByColor":R5,"interaction.elementSelect":B5,"interaction.elementSelectByX":D5,"interaction.elementSelectByColor":F5,"interaction.fisheye":W5,"interaction.chartIndex":z5,"interaction.tooltip":lS,"interaction.legendFilter":bS,"interaction.legendHighlight":xS,"interaction.brushHighlight":SS,"interaction.brushXHighlight":_S,"interaction.brushYHighlight":PS,"interaction.brushAxisHighlight":FS,"interaction.brushFilter":WS,"interaction.brushXFilter":GS,"interaction.brushYFilter":HS,"interaction.sliderFilter":qS,"interaction.scrollbarFilter":US,"interaction.poptip":ZS,"interaction.event":V5,"composition.spaceLayer":e3,"composition.spaceFlex":n3,"composition.mark":i3,"composition.view":r3,"composition.facetRect":g3,"composition.repeatMatrix":b3,"composition.facetCircle":O3,"composition.timingKeyframe":S3,"labelTransform.overlapHide":n_,"labelTransform.overlapDodgeY":i_,"labelTransform.overflowHide":u_,"labelTransform.contrastReverse":c_},c6)}const h6=[["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 f6(t,e,n){for(;t<e;)t+=2*Math.PI;for(;n<t;)t-=2*Math.PI;return t}function d6(t,e,n,r,i){var a=t[0],t=t[1],o=Z();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 p6(t,e,n,r,i){var a=new Pv({range:[e,e+r]}),o=new Pv({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 m6(t,e,n,r,i){return t[0]}function v6(t,e,n,r,i){var a=t[0],o=t[1],s=t[2],t=t[3],l=new Pv({range:[s,t]}),c=new Pv({range:[a,o]}),u=1<(s=i/r)?1:s,h=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)*h)+.5]},untransform:function(t){var e=t[0],t=t[1],e=2*(e-.5)/u,t=2*(t-.5)/h,n=Math.sqrt(Math.pow(e,2)+Math.pow(t,2)),t=f6(Math.atan2(t,e),a,o);return[c.invert(t),l.invert(n)]}}}function y6(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 b6(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return O6.apply(void 0,S6([[-1,-1]],e,!1))}function x6(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return O6.apply(void 0,S6([[-1,1]],e,!1))}function w6(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return O6.apply(void 0,S6([[1,-1]],e,!1))}function M6(t,e,n,r,i){var a,t=t[0],o=Z();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 k6(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 Pv({range:[s,s+.99*l]}),h=new Pv({range:[a,o]}),f=1<(t=i/r)?1:t,d=1<t?1/t:1;return{transform:function(t){var e=t[0],t=t[1],e=h.map(e),t=u.map(t);return[.5*(Math.cos(e)*(c*e+t)*f)+.5,.5*(Math.sin(e)*(c*e+t)*d)+.5]},untransform:function(t){var e=t[0],t=t[1],e=2*(e-.5)/f,t=2*(t-.5)/d,n=Math.sqrt(Math.pow(e,2)+Math.pow(t,2)),t=f6(Math.atan2(t,e)+Math.floor(n/l)*Math.PI*2,a,o),e=n-c*t;return[h.invert(t),u.invert(e)]}}}function E6(t,e,n,r,i){var s=t[0],l=t[1],a=t[2],t=t[3],c=new Pv({range:[a,t]});return{transform:function(t){for(var e=[],n=t.length,r=new Lv({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 O6=function(t,e,n,r,i){var a=t[0],t=t[1],o=Z();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},S6=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 A6(t){return 1/Math.tan(t)}function _6(t,e,n,r,i){var a=A6(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 T6(t,e,n,r,i){var a=A6(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 P6(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 L6(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 C6(t,e,n){return n?new Pv({range:[0,1],domain:[0,e]}).map(t):t}function N6(t,e,n,r,i){var a=t[0],o=t[1],t=t[2],s=C6(a,r,void 0!==t&&t);return{transform:function(t){var e=t[0],t=t[1];return[P6(e,s,o,0,1),t]},untransform:function(t){var e=t[0],t=t[1];return[L6(e,s,o,0,1),t]}}}function j6(t,e,n,r,i){var a=t[0],o=t[1],t=t[2],s=C6(a,i,void 0!==t&&t);return{transform:function(t){return[t[0],P6(t[1],s,o,0,1)]},untransform:function(t){return[t[0],L6(t[1],s,o,0,1)]}}}function R6(t,e,n,r,i){var a=t[0],o=t[1],s=t[2],l=t[3],t=t[4],c=C6(a,r,t=void 0!==t&&t),u=C6(o,i,t);return{transform:function(t){var e=t[0],t=t[1];return[P6(e,c,s,0,1),P6(t,u,l,0,1)]},untransform:function(t){var e=t[0],t=t[1];return[L6(e,c,s,0,1),L6(t,u,l,0,1)]}}}function I6(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 Pv({range:[0,r]}),u=new Pv({range:[0,i]}),h=t?a:c.map(a),f=t?o:u.map(o);return{transform:function(t){var e=t[0],t=t[1],n=c.map(e)-h,r=u.map(t)-f,i=Math.sqrt(n*n+r*r);return s<i?[e,t]:(e=P6(i,0,l,0,s),t=Math.atan2(r,n),i=h+e*Math.cos(t),r=f+e*Math.sin(t),[c.invert(i),u.invert(r)])},untransform:function(t){var e=t[0],t=t[1],n=c.map(e)-h,r=u.map(t)-f,i=Math.sqrt(n*n+r*r);return s<i?[e,t]:(e=L6(i,0,l,0,s),t=Math.atan2(r,n),i=h+e*Math.cos(t),r=f+e*Math.sin(t),[c.invert(i),u.invert(r)])}}}var B6=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))},D6=(F6.prototype.update=function(t){this.options=Nm({},this.options,t),this.recoordinate()},F6.prototype.clone=function(){return new F6(this.options)},F6.prototype.getOptions=function(){return this.options},F6.prototype.clear=function(){this.update({transformations:[]})},F6.prototype.getSize=function(){var t=this.options;return[t.width,t.height]},F6.prototype.getCenter=function(){var t=this.options,e=t.x,n=t.y;return[(2*e+t.width)/2,(2*n+t.height)/2]},F6.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:B6(B6([],n,!0),[B6([],t,!0)],!1)}),this},F6.prototype.map=function(t){return this.output(t)},F6.prototype.invert=function(t){return this.input(t)},F6.prototype.recoordinate=function(){this.output=this.compose(),this.input=this.compose(!0)},F6.prototype.compose=function(t){for(var e=(t=void 0===t?!1:t)?B6([],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,h,f=s[o],d=f[0],f=f.slice(1),p=this.transformers[d];p&&(l=(h=this.options).x,c=h.y,u=h.width,h=h.height,p=p(B6([],f,!0),l,c,u,h),(f=p)instanceof Float32Array||f instanceof Array?r.push(p):(r.length&&(i(this.createMatrixTransform(r,t)),r.splice(0,r.length)),i(n(p)||jm,"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):jm}.apply(void 0,a)},F6.prototype.createMatrixTransform=function(t,e){var n,r,i,a,o,s,l,c,u,h,f,d,p=Z();return e&&t.reverse(),t.forEach(function(t){return Q(p,p,t)}),e&&(e=t=p,(d=new K(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,f=d*c+n*(u=-e*i+o*s)+r*(h=l*i-a*s))&&(t[0]=c*(f=1/f),t[1]=(-e*n+r*l)*f,t[2]=(o*n-r*a)*f,t[3]=u*f,t[4]=(e*d-r*s)*f,t[5]=(-o*d+r*i)*f,t[6]=h*f,t[7]=(-l*d+n*s)*f,t[8]=(a*d-n*i)*f),function(t){t=[t[0],t[1],1];return Ht(t,t,p),[t[0],t[1]]}},F6);function F6(t){this.options={x:0,y:0,width:300,height:150,transformations:[]},this.transformers={cartesian:p6,translate:d6,custom:g6,matrix:m6,polar:v6,transpose:y6,scale:O6,"shear.x":_6,"shear.y":T6,reflect:b6,"reflect.x":x6,"reflect.y":w6,rotate:M6,helix:k6,parallel:E6,fisheye:R6,"fisheye.x":N6,"fisheye.y":j6,"fisheye.circular":I6},this.update(t)}function z6(e,n){const r=t=>{return"string"!=typeof t?t:n[t=e+"."+t]||t0("Unknown Component: "+t)};return[(t,e)=>{var n=t["type"],t=it(t,["type"]);return r(n)(t,e)},r]}function W6(t){var{canvas:t,group:e}=t;return e?e.ownerDocument:t.document}function G6(t,e){var{coordinate:n={}}=t,t=it(t,["coordinate"]),{type:r,transform:i=[]}=n,n=it(n,["type","transform"]);if(!r)return Object.assign(Object.assign({},t),{coordinates:i});var[,e]=z6("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 H6(t,e){return t.filter(t=>t.type===e)}function Y6(t){return 0<H6(t,"polar").length}function V6(t){return H6(t,"transpose").length%2==1}function q6(t){return 0<H6(t,"theta").length}function $6(t){return 0<H6(t,"radial").length}function u(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=u("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"),ss=u("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666"),r=u("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666"),os=u("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928"),$o=u("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2"),yl=u("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc"),ml=u("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999"),qo=u("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3"),n=u("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"),Ko=u("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab");function U6(t,e,n){(t.prototype=e.prototype=n).constructor=t}function X6(t,e){var n,r=Object.create(t.prototype);for(n in e)r[n]=e[n];return r}function K6(){}var Z6=1/.7,e="\\s*([+-]?\\d+)\\s*",Fo="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",cs="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Q6=/^#([0-9a-f]{3,8})$/,J6=new RegExp(`^rgb\\(${e},${e},${e}\\)$`),tP=new RegExp(`^rgb\\(${cs},${cs},${cs}\\)$`),eP=new RegExp(`^rgba\\(${e},${e},${e},${Fo}\\)$`),nP=new RegExp(`^rgba\\(${cs},${cs},${cs},${Fo}\\)$`),rP=new RegExp(`^hsl\\(${Fo},${cs},${cs}\\)$`),iP=new RegExp(`^hsla\\(${Fo},${cs},${cs},${Fo}\\)$`),aP={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 oP(){return this.rgb().formatHex()}function sP(){return this.rgb().formatRgb()}function lP(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=Q6.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?cP(e):3===n?new dP(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?uP(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?uP(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=J6.exec(t))?new dP(e[1],e[2],e[3],1):(e=tP.exec(t))?new dP(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=eP.exec(t))?uP(e[1],e[2],e[3],e[4]):(e=nP.exec(t))?uP(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=rP.exec(t))?bP(e[1],e[2]/100,e[3]/100,1):(e=iP.exec(t))?bP(e[1],e[2]/100,e[3]/100,e[4]):aP.hasOwnProperty(t)?cP(aP[t]):"transparent"===t?new dP(NaN,NaN,NaN,0):null}function cP(t){return new dP(t>>16&255,t>>8&255,255&t,1)}function uP(t,e,n,r){return new dP(t=r<=0?e=n=NaN:t,e,n,r)}function hP(t){return(t=t instanceof K6?t:lP(t))?new dP((t=t.rgb()).r,t.g,t.b,t.opacity):new dP}function fP(t,e,n,r){return 1===arguments.length?hP(t):new dP(t,e,n,null==r?1:r)}function dP(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function pP(){return"#"+yP(this.r)+yP(this.g)+yP(this.b)}function gP(){var t=mP(this.opacity);return(1===t?"rgb(":"rgba(")+vP(this.r)+`, ${vP(this.g)}, `+vP(this.b)+(1===t?")":`, ${t})`)}function mP(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function vP(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function yP(t){return((t=vP(t))<16?"0":"")+t.toString(16)}function bP(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||1<=n?t=e=NaN:e<=0&&(t=NaN),new wP(t,e,n,r)}function xP(t){var e,n,r,i,a,o,s,l;return t instanceof wP?new wP(t.h,t.s,t.l,t.opacity):(t=t instanceof K6?t:lP(t))?t instanceof wP?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 wP(o,s,l,t.opacity)):new wP}function wP(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function MP(t){return(t=(t||0)%360)<0?t+360:t}function kP(t){return Math.max(0,Math.min(1,t||0))}function EP(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}U6(K6,lP,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:oP,formatHex:oP,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return xP(this).formatHsl()},formatRgb:sP,toString:sP}),U6(dP,fP,X6(K6,{brighter(t){return t=null==t?Z6:Math.pow(Z6,t),new dP(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?.7:Math.pow(.7,t),new dP(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new dP(vP(this.r),vP(this.g),vP(this.b),mP(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:pP,formatHex:pP,formatHex8:function(){return"#"+yP(this.r)+yP(this.g)+yP(this.b)+yP(255*(isNaN(this.opacity)?1:this.opacity))},formatRgb:gP,toString:gP})),U6(wP,function(t,e,n,r){return 1===arguments.length?xP(t):new wP(t,e,n,null==r?1:r)},X6(K6,{brighter(t){return t=null==t?Z6:Math.pow(Z6,t),new wP(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?.7:Math.pow(.7,t),new wP(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 dP(EP(240<=t?t-240:120+t,n,e),EP(t,n,e),EP(t<120?240+t:t-120,n,e),this.opacity)},clamp(){return new wP(MP(this.h),kP(this.s),kP(this.l),mP(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=mP(this.opacity);return(1===t?"hsl(":"hsla(")+MP(this.h)+`, ${100*kP(this.s)}%, ${100*kP(this.l)}%`+(1===t?")":`, ${t})`)}}));const OP=Math.PI/180,SP=180/Math.PI;var AP=1.78277,_P=-.29227,TP=-.90649,PP=1.97294,LP=PP*TP,CP=PP*AP,NP=AP*_P- -.14861*TP;function jP(t,e,n,r){return 1===arguments.length?(i=t)instanceof RP?new RP(i.h,i.s,i.l,i.opacity):(a=(i=i instanceof dP?i:hP(i)).r/255,o=i.g/255,l=i.b/255,l=(PP*(o-(a=(NP*l+LP*a-CP*o)/(NP+LP-CP)))-_P*(o=l-a))/TP,new RP((l=(s=Math.sqrt(l*l+o*o)/(PP*a*(1-a)))?Math.atan2(l,o)*SP-120:NaN)<0?l+360:l,s,a,i.opacity)):new RP(t,e,n,null==r?1:r);var i,a,o,s,l}function RP(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}U6(RP,jP,X6(K6,{brighter(t){return t=null==t?Z6:Math.pow(Z6,t),new RP(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?.7:Math.pow(.7,t),new RP(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=isNaN(this.h)?0:(this.h+120)*OP,e=+this.l,n=isNaN(this.s)?0:this.s*e*(1-e),r=Math.cos(t),t=Math.sin(t);return new dP(255*(e+n*(-.14861*r+AP*t)),255*(e+n*(_P*r+TP*t)),255*(e+PP*r*n),this.opacity)}}));var IP=t=>()=>t;function BP(e,n){return function(t){return e+t*n}}function DP(a){return 1==(a=+a)?FP: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)}):IP(isNaN(t)?e:t);var n,r,i}}function FP(t,e){var n=e-t;return n?BP(t,n):IP(isNaN(t)?e:t)}!function t(e){var o=DP(e);function n(e,t){var n=o((e=fP(e)).r,(t=fP(t)).r),r=o(e.g,t.g),i=o(e.b,t.b),a=FP(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);zP=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 zP,WP=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=fP(t[o]),r[o]=e.r||0,i[o]=e.g||0,a[o]=e.b||0;return r=zP(r),i=zP(i),a=zP(a),e.opacity=1,function(t){return e.r=r(t),e.g=i(t),e.b=a(t),e+""}};function GP(s){return function t(o){function e(e,t){var n=s((e=jP(e)).h,(t=jP(t)).h),r=FP(e.s,t.s),i=FP(e.l,t.l),a=FP(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)}GP(function(t,e){var n=e-t;return n?BP(t,180<n||n<-180?n-360*Math.round(n/360):n):IP(isNaN(t)?e:t)});var gl=GP(FP),as=t=>WP(t[t.length-1]),Zo=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(u),is=as(Zo),fl=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(u),Vo=as(fl),ls=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(u),hs=as(ls),rs=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(u),pl=as(rs),vl=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(u),Xo=as(vl),wl=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(u),_l=as(wl),Nl=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(u),bl=as(Nl),El=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(u),Ms=as(El),dl=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(u),ds=as(dl),$v=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(u),Uo=as($v),e=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(u),cs=as(e),Fo=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(u),HP=as(Fo),YP=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(u),VP=as(YP),qP=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(u),$P=as(qP),UP=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(u),XP=as(UP),KP=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(u),ZP=as(KP),QP=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(u),JP=as(QP),tL=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(u),eL=as(tL),nL=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(u),rL=as(nL),iL=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(u),aL=as(iL),oL=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(u),sL=as(oL),lL=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(u),cL=as(lL),uL=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(u),hL=as(uL),fL=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(u),dL=as(fL),pL=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(u),gL=as(pL),mL=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(u),vL=as(mL),yL=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(u),as=as(yL);var bL=gl(jP(300,.5,0),jP(-240,.5,1)),xL=gl(jP(-100,.75,.35),jP(80,1.5,.8)),gl=gl(jP(260,.75,.35),jP(80,1.5,.8)),wL=jP();var ML=fP(),kL=Math.PI/3,EL=2*Math.PI/3;function OL(e){var n=e.length;return function(t){return e[Math.max(0,Math.min(n-1,Math.floor(t*n)))]}}var SL=OL(u("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725")),AL=OL(u("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),_L=OL(u("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),TL=OL(u("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921")),PL=Object.freeze({__proto__:null,schemeCategory10:a,schemeAccent:ss,schemeDark2:r,schemePaired:os,schemePastel1:$o,schemePastel2:yl,schemeSet1:ml,schemeSet2:qo,schemeSet3:n,schemeTableau10:Ko,interpolateBrBG:is,schemeBrBG:Zo,interpolatePRGn:Vo,schemePRGn:fl,interpolatePiYG:hs,schemePiYG:ls,interpolatePuOr:pl,schemePuOr:rs,interpolateRdBu:Xo,schemeRdBu:vl,interpolateRdGy:_l,schemeRdGy:wl,interpolateRdYlBu:bl,schemeRdYlBu:Nl,interpolateRdYlGn:Ms,schemeRdYlGn:El,interpolateSpectral:ds,schemeSpectral:dl,interpolateBuGn:Uo,schemeBuGn:$v,interpolateBuPu:cs,schemeBuPu:e,interpolateGnBu:HP,schemeGnBu:Fo,interpolateOrRd:VP,schemeOrRd:YP,interpolatePuBuGn:$P,schemePuBuGn:qP,interpolatePuBu:XP,schemePuBu:UP,interpolatePuRd:ZP,schemePuRd:KP,interpolateRdPu:JP,schemeRdPu:QP,interpolateYlGnBu:eL,schemeYlGnBu:tL,interpolateYlGn:rL,schemeYlGn:nL,interpolateYlOrBr:aL,schemeYlOrBr:iL,interpolateYlOrRd:sL,schemeYlOrRd:oL,interpolateBlues:cL,schemeBlues:lL,interpolateGreens:hL,schemeGreens:uL,interpolateGreys:dL,schemeGreys:fL,interpolatePurples:gL,schemePurples:pL,interpolateReds:vL,schemeReds:mL,interpolateOranges:as,schemeOranges:yL,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:bL,interpolateRainbow:function(t){(t<0||1<t)&&(t-=Math.floor(t));var e=Math.abs(t-.5);return wL.h=360*t-100,wL.s=1.5-1.5*e,wL.l=.8-.9*e,wL+""},interpolateWarm:xL,interpolateCool:gl,interpolateSinebow:function(t){var e;return t=(.5-t)*Math.PI,ML.r=255*(e=Math.sin(t))*e,ML.g=255*(e=Math.sin(t+kL))*e,ML.b=255*(e=Math.sin(t+EL))*e,ML+""},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:SL,interpolateMagma:AL,interpolateInferno:_L,interpolatePlasma:TL});function LL(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 YL(t,o0)}(e)?"identity":"string"==typeof i?"linear":2<(r||i||[]).length?DL(t):void 0===r?GL(e)?DL(t):HL(e)?"time":FL(t,i):GL([r])?DL(t):HL(e)?"time":FL(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(RL({type:t}))return function(t,e,n){const r=t.map(Number),i=new Pv({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 IL({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 zL(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)n0(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 WL(e);case"quantile":return function(t){return WL(t).sort()}(e);case"sequential":return zL(function(t){let e=1/0,n=-1/0;for(const r of t)for(const i of r)n0(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=ov,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:q6(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=rn(e),i=PL["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=BL(n,r,i,a,o),[u,h]=function(t,e){return"enterDelay"===t?[0,1e3]:"enterDuration"==t?[300,1e3]:t.startsWith("y")||t.startsWith("position")?[1,0]:"color"===t?[e[0],ay(e)]:"opacity"!==t&&"size"===t?[1,10]:[0,1]}(e,u);return[l||u,c||h];case"band":case"point":return[l||0,c||1];case"ordinal":return BL(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 CL(t,e){var{components:e=[]}=e,n=["scale","encode","axis","legend","data","transform"],r=Array.from(new Set(t.flatMap(t=>t.channels.map(t=>t.scale)))),i=new Map(r.map(t=>[t.name,t]));for(const l of e)for(const c of function(t){const{channels:e=[],type:n,scale:r={}}=t,i=["shape","color","opacity","size"];return 0!==e.length?e:"axisX"===n?["x"]:"axisY"===n?["y"]:"legends"===n?Object.keys(r).filter(t=>i.includes(t)):[]}(l)){var a=i.get(c),o=(null==(o=l.scale)?void 0:o[c])||{},{independent:s=!1}=o;a&&!s?(s=a["guide"],a.guide=ot({},"boolean"==typeof s?{}:s,l),Object.assign(a,o)):(s=Object.assign(Object.assign({},o),{expectedDomain:o.domain,name:c,guide:fn(l,n)}),r.push(s))}return r}function NL(t,e){var[e]=z6("scale",e),n=t["relations"],[n]=function(o){if(!o||!Array.isArray(o))return[Zp,Zp];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 jL(t,n){var t=t.filter(({name:t,facet:e=!0})=>e&&t===n),e=t.flatMap(t=>t.domain),r=t.every(RL)?Od(e):t.every(IL)?Array.from(new Set(e)):null;if(null!==r)for(const i of t)i.domain=r}function RL(t){t=t.type;return"string"==typeof t&&["linear","log","pow","time"].includes(t)}function IL(t){t=t.type;return"string"==typeof t&&["band","point","ordinal"].includes(t)}function BL(t,e,n,r,i){var[i]=z6("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=rn(t),i=PL["scheme"+e],a=PL["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 DL(t){return(t=t).startsWith("x")||t.startsWith("y")||t.startsWith("position")||t.startsWith("size")?"point":"ordinal"}function FL(t,e){return"color"!==t||e?"linear":"sequential"}function zL(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 WL(t){return Array.from(new Set(t.flat()))}function GL(t){return YL(t,t=>{t=typeof t;return"string"==t||"boolean"==t})}function HL(t){return YL(t,t=>t instanceof Date)}function YL(t,e){for(const n of t)if(n.some(e))return!0;return!1}const VL={linear:"linear",identity:"identity",log:"log",pow:"pow",sqrt:"sqrt",sequential:"sequential"},qL={threshold:"threshold",quantize:"quantize",quantile:"quantile"},$L={ordinal:"ordinal",band:"band",point:"point"},UL={constant:"constant"};function XL(t,e,n){const{coordinates:b=[],title:r}=e,[,x]=z6("component",n),w=t.filter(({guide:t})=>null!==t),M=[];var i,e=function(t,e,n){const[,o]=z6("component",n),s=t["coordinates"];function i(t,e,n,r){[e,t,i=[]]=[e,t,s];var i,a,e="x"===e?V6(i)?t+"Y":t+"X":"y"===e?V6(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);return M.push(...e),r&&(t=x("title")["props"],{defaultPosition:n,defaultOrientation:e,defaultOrder:t,defaultSize:i}=t,M.push(Object.assign({type:"title",position:n,orientation:e,order:t,size:i},"string"==typeof r?{title:r}:r))),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 n=["shape","size","color","opacity"],e=t.filter(({type:t,name:e})=>"string"==typeof t&&n.includes(e)&&!("constant"===t&&"size"===e)),r=e.filter(({type:t})=>"constant"===t),i=e.filter(({type:t})=>"constant"!==t),a=Ld(i,t=>t.field||Symbol("independent")).map(([t,e])=>[t,[...e,...r]]).filter(([,t])=>t.some(t=>"constant"!==t.type)),o=new Map(a);if(0===o.size)return[];const s=t=>t.sort(([t],[e])=>t.localeCompare(e)),l=Array.from(o).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(...sy(e,t));return n}(t).sort((t,e)=>e.length-t.length).map(t=>({combination:t,option:t.map(t=>[t.name,function(t){t=t.type;return"string"!=typeof t?null:t in VL?"continuous":t in $L?"discrete":t in qL?"distribution":t in UL?"constant":null}(t)])}));for([e,n]of h6)for(const{option:i,combination:a}of r)if(n.some(t=>pn(s(t),s(i))))return[e,a];return null}).filter(n0);return l}(t),...function(t,n){return t.map(t=>{var e=t["name"];if(!(0<H6(n,"helix").length||q6(n))&&(!V6(n)||!Y6(n)&&!$6(n))){if(e.startsWith("x"))return Y6(n)?["axisArc",[t]]:$6(n)?["axisLinear",[t]]:[V6(n)?"axisY":"axisX",[t]];if(e.startsWith("y"))return Y6(n)?["axisLinear",[t]]:$6(n)?["axisArc",[t]]:[V6(n)?"axisX":"axisY",[t]];if(e.startsWith("position")){if(0<H6(n,"radar").length)return["axisRadar",[t]];if(!Y6(n))return["axisY",[t]]}}return null}).filter(n0)}(t,e)]}(w,b).forEach(([t,e])=>{var n=x(t)["props"],{defaultPosition:r,defaultOrientation:i,defaultSize:a,defaultOrder:o,defaultLength:s,defaultPadding:l=[0,0],defaultCrossPadding:c=[0,0]}=n,{guide:n,field:u}=ot({},...e);for(const y of Array.isArray(n)?n:[n]){var h,f,d,p,g,[m,v]=function(t,e,n,r,i,a,o){var[s]=QL(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=JL(n),n===r.slice(-1)[0].name||null===a?[null,null]:([o,s]=QL(i),["center",(s-o)/(r.length-1)*a+o])}{var s;if("axisY"===t&&function(t){return 0<H6(t,"parallel").length}(i))return null===(s=JL(n))?e:V6(i)?0===s?["top",null]:["center","horizontal"]:0===s?e:["center","vertical"]}if("axisLinear"===t)return[r]=QL(i),["center",r];if("axisArc"===t)return"inner"===e[0]?["inner",null]:["outer",null];if(Y6(i))return["center",null];if($6(i))return["center",null];if("axisX"===t&&function(t){return 0<H6(t,"reflect").length}(i)||"axisX"===t&&function(t){return 0<H6(t,"reflectY").length}(i))return["top",null];return e}(t,e,i,a,o);if("string"==typeof t&&t.startsWith("legend")&&Y6(o)&&"center"===r.position)return["center","vertical"];return e}(t,r,i,y,e,w,b);(m||v)&&(p=(g="left"===m||"right"===m)?l[1]:l[0],g=g?c[1]:c[0],{size:h=a,order:f=o,length:d=s,padding:p=p,crossPadding:g=g}=y,M.push(Object.assign(Object.assign({title:u},y),{length:d,position:m,orientation:v,padding:p,order:f,crossPadding:g,size:h,type:t,scales:e})))}}),M}function KL(t,e,n,r,i){var[a]=z6("component",r),{scaleInstances:o,scale:s,bbox:l}=t,l={bbox:l,library:r};return a(it(t,["scaleInstances","scale","bbox"]))({coordinate:e,library:r,markState:i,scales:o,theme:n,value:l,scale:s})}function ZL(t,o){const r=["left","right","bottom","top"];return Ld(t,({type:t,position:e,group:n})=>r.includes(e)?void 0===n?t.startsWith("legend")?"legend-"+e:Symbol("independent"):"independent"===n?Symbol("independent"):n:Symbol("independent")).flatMap(([,t],e)=>{if(1===t.length)return t[0];if(void 0!==o){var n=t.filter(t=>void 0!==t.length).map(t=>t.length),r=ap(n);if(o<r)return t.forEach(t=>t.group=Symbol("independent")),t;const a=(o-r)/(t.length-n.length);t.forEach(t=>{void 0===t.length&&(t.length=a)})}var r=$d(t,t=>t.size),n=$d(t,t=>t.order),i=$d(t,t=>t.crossPadding);return{type:"group",size:r,order:n,position:t[0].position,children:t,crossPadding:i}})}function QL(t){var e,n=H6(t,"polar");return n.length?(n=n[n.length-1],{startAngle:n,endAngle:e}=zh(n),[n,e]):(n=H6(t,"radial")).length?(e=n[n.length-1],{startAngle:t,endAngle:n}=Vh(e),[t,n]):[-Math.PI/2,Math.PI/2*3]}function JL(t){t=/position(\d*)/g.exec(t);return t?+t[1]:null}function t8(t,e,n,r,i,a){var o=t["type"];if(["left","right","bottom","top"].includes(r)&&"string"==typeof o){const s=o;return(s.startsWith("axis")?n8:s.startsWith("group")?e8:s.startsWith("legendContinuous")?r8:"legendCategory"===s?i8:()=>{})(t,e,n,r,i,a)}}function e8(t,e,n,r,i,a){var o=t["children"];const s=$d(o,t=>t.crossPadding),l=(o.forEach(t=>t.crossPadding=s),o.forEach(t=>t8(t,e,n,r,i,a)),$d(o,t=>t.size));t.size=l,o.forEach(t=>t.size=l)}function n8(t,e,n,r,i,a){t.transform=t.transform||[{type:"hide"}];var o,s="left"===r||"right"===r,r=l8(t,r,i),{tickLength:i=0,labelSpacing:l=0,titleSpacing:c=0}=r,r=it(r,["tickLength","labelSpacing","titleSpacing"]),a=a8(t,a),u=o8(t,a,s,r),e=(u&&(o=$d(u,t=>t.width),i=i+l,s?t.size=o+i:(l=t["tickFilter"],!function(t,e,n,r,i){var a=ap(e,t=>t.width);if(n<a)return 1;const o=t.clone(),s=(o.update({range:[0,n]}),c8(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],h=n+r[1],f=(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]=f(d,e[t]);if(d<u||h<p)return 1;d=l[t+1];if(d){var[d]=f(d,e[t+1]);if(d<p)return 1}}return}(a,u,e,n,l)?(a=$d(u,t=>t.height),t.size=a+i):(t.size=o+i,t.style=Object.assign(Object.assign({},t.style),{labelTransform:"rotate(90)"})))),s8(t,r));e&&(t.size+=s?c+e.width:c+e.height)}function r8(t,e,n,r,i,a){i=i.legendContinuous;var i=ot({},i,t.style),{labelSpacing:o=0,titleSpacing:s=0}=i,i=it(i,["labelSpacing","titleSpacing"]),r="left"===r||"right"===r,l=at(i,"ribbon")["size"],c=at(i,"handleIcon")["size"],l=Math.max(l,2.4*c),c=(t.size=l,a8(t,a)),l=o8(t,c,r,i);if(l){const u=r?"width":"height";a=$d(l,t=>t[u]);t.size+=a+o}var c=s8(t,i),{crossPadding:l=0}=(c&&(r?t.size=Math.max(t.size,c.width):t.size+=s+c.height),t);t.size+=2*l}function i8(o,t,e,s,n,r){n=n.legendCategory;const i=ot({},n,o.style),{itemSpacing:a,itemMarkerSize:l,titleSpacing:c,rowPadding:u,colPadding:h}=i,f=it(i,["itemSpacing","itemMarkerSize","titleSpacing","rowPadding","colPadding"]),{cols:d,length:p}=o,g=void 0===p?t:p;n="left"===s||"right"===s;const m=s8(o,f);t=a8(o,r);const v=o8(o,t,n,f,"itemLabel"),y=Math.max(v[0].height,l)+u,b=(t,e=0)=>l+t+a[0]+e;if(n){let t=-1/0,e=0,n=1,r=0,i=-1/0,a=-1/0;var x,s=m?m.height:0,w=g-s;for({width:x}of v){var M=b(x);t=Math.max(t,M),e+y>w?(n++,i=Math.max(i,r),a=Math.max(a,e),r=1,e=y):(e+=y,r++)}n<=1&&(i=r,a=e),o.size=t*n,o.length=a+s,ot(o,{cols:n,gridRow:i})}else if("number"==typeof d)r=Math.ceil(v.length/d),t=$d(v,t=>b(t.width))*d,o.size=y*r,o.length=Math.min(t,g);else{let t=1,e=0,n=-1/0;for(var{width:k}of v){k=b(k,h);e+k>g?(n=Math.max(n,e),e=k,t++):e+=k}1===t&&(n=e),o.size=y*t,o.length=n}m&&(n?o.size=Math.max(o.size,m.width):o.size+=c+m.height);var{crossPadding:s=0}=o;o.size+=2*s}function a8(t,e){var[e]=z6("scale",e),{scales:t,tickCount:n,tickMethod:r}=t,t=t.find(t=>"constant"!==t.type&&"identity"!==t.type);return void 0!==n&&(t.tickCount=n),void 0!==r&&(t.tickMethod=r),e(t)}function o8(t,e,i,n,r="label"){var{labelFormatter:a,tickFilter:o,label:s=!0}=t;if(!s)return null;const l=function(t,e,n){n=c8(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?UE(e):e:t.getFormatter?t.getFormatter():t=>""+t;return n.map(e)}(e,a,o),c=at(n,r),u=l.map((n,r)=>{var t=Object.fromEntries(Object.entries(c).map(([t,e])=>[t,"function"==typeof e?e(n,r):e]));return i||(t.transform="none"),u8(n,t)});s=l.map((t,e)=>e);return t.indexBBox=new Map(s.map(t=>[t,[l[t],u[t]]])),u}function s8(t,e){var n=t=>!1===t||null===t,t=t["title"],r=e["title"];return n(t)||n(r)||void 0===t?null:(n=at(e,"title"),u8(Array.isArray(t)?t.join(","):t,n))}function l8(t,e,n){var{axis:n,["axis"+Jp(e)]:e}=n;return ot({},n,e,t.style)}function c8(t,e){t=t.getTicks?t.getTicks():t.getOptions().domain;return e?t.filter(e):t}function u8(t,e){t=(t=t)instanceof js?t:new al({style:{text:""+t}}),t.attr(Object.assign(Object.assign({},e),{visibility:"none"})),e=t.getBBox();return e}function h8(t,o,e,n){var{width:r,height:i,x:a=0,y:s=0,inset:l=0,insetLeft:c=l,insetTop:u=l,insetBottom:h=l,insetRight:l=l,margin:f=0,marginLeft:d=f,marginBottom:p=f,marginTop:g=f,marginRight:f=f,padding:m,paddingBottom:v=m,paddingLeft:y=m,paddingRight:b=m,paddingTop:m=m}=function(t,e,n,r){var i=e["coordinates"];if(!Y6(i))return e;i=t.filter(t=>"string"==typeof t.type&&t.type.startsWith("axis"));if(0===i.length)return e;const a=i.map(t=>{return l8(t,"axisArc"===t.type?"arc":"linear",n)}),o=$d(a,t=>{return null!=(t=t.labelSpacing)?t:0}),s=i.flatMap((t,e)=>{e=a[e];return o8(t,a8(t,r),!1,e)}),l=$d(s,t=>t.height)+o,c=i.flatMap((t,e)=>{return s8(t,a[e])}).filter(t=>null!==t),u=0===c.length?0:$d(c,t=>t.height),{inset:h=l,insetLeft:f=h,insetBottom:d=h,insetTop:p=h+u,insetRight:g=h}=e;return Object.assign(Object.assign({},e),{insetLeft:f,insetBottom:d,insetTop:p,insetRight:g})}(t,o,e,n);var x=(t,e,n,r,i)=>{var a=o["marks"];return 0===a.length||0<t-r-i-.25*t?[r,i]:(a=.75*t/2,["auto"===e?a:r,"auto"===n?a:i])},w=t=>"auto"!==t&&null!=t?t:30,M=w(m),w=w(v),{paddingLeft:M,paddingRight:w}=f8(t,i-M-w,[M,w],["left","right"],o,e,n),k=r-d-f,[y,b]=x(k,y,b,M,w),M=k-y-b,{paddingTop:w,paddingBottom:k}=f8(t,M,[y,b],["bottom","top"],o,e,n),t=i-p-g,[e,n]=x(t,v,m,k,w);return{width:r,height:i,insetLeft:c,insetTop:u,insetBottom:h,insetRight:l,innerWidth:M,innerHeight:t-e-n,paddingLeft:y,paddingRight:b,paddingTop:n,paddingBottom:e,marginLeft:d,marginBottom:p,marginTop:g,marginRight:f,x:a,y:s}}function f8(t,e,n,r,i,a,o){var s=Pd(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 p of r){var h="padding"+Jp(fE(p)),f=u[h];if(void 0===f||"auto"===f)if(s.has(p)){const t=s.get(p);var d=ZL(t,e),f=("auto"===f&&d.forEach(t=>t8(t,e,n,p,a,o)),d.reduce((t,{size:e})=>t+e,0));u[h]=f}else u[h]=30}return u}function d8(t,I,e){var B=Pd(t,t=>t.position),{paddingLeft:t,paddingRight:e,paddingTop:n,paddingBottom:D,marginLeft:r,marginTop:i,marginBottom:F,marginRight:z,innerHeight:a,innerWidth:o,insetBottom:W,insetLeft:s,insetRight:G,insetTop:l,height:c,width:H}=e,t=t+r,r=n+i,n=e+z,i=D+F,e=[t+s,r+l,o-s-G,a-l-W,"center",null,null],Y={top:[t,0,o,r,"vertical",!0,md],right:[H-n,r,n,a,"horizontal",!1,md],bottom:[t,c-i,o,i,"vertical",!1,md],left:[0,r,t,a,"horizontal",!0,md],"top-left":[t,0,o,r,"vertical",!0,md],"top-right":[t,0,o,r,"vertical",!0,md],"bottom-left":[t,c-i,o,i,"vertical",!1,md],"bottom-right":[t,c-i,o,i,"vertical",!1,md],center:e,inner:e,outer:e};for(const[j,t]of B.entries()){var u=Y[j],[h,V]=oy(t,t=>"string"==typeof t.type&&("center"===j||!(!t.type.startsWith("axis")||!["inner","outer"].includes(j))));if(h.length){m=g=p=d=f=void 0;var f=h,d=I,p=u,g=j,[f,m]=oy(f,t=>!("string"!=typeof t.type||!t.type.startsWith("axis"))),h=(b=y=v=h=void 0,f),v=d,y=p,b=g;if("center"===b)if(!function(t){return up(t)&&sp(t)}(v)){if(sp(v)){f=void 0;g=void 0;x=void 0;w=void 0;M=void 0;k=void 0;f=h;g=y;var[x,w,M,k]=g;for(const it of f)it.bbox={x:x,y:w,width:M,height:k}}else if(up(v)){g=void 0;f=void 0;E=void 0;O=void 0;g=h;f=v;var E=y;var O=h[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}}}(g,f,E):"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}}}(g,f,E)}}else{S=void 0;O=void 0;A=void 0;_=void 0;q=void 0;$=void 0;var S=h;O=y;var[A,_,q,$]=O;for(const R of S)R.bbox={x:A,y:_,width:q,height:$},R.radar={index:S.indexOf(R),count:S.length}}else if("inner"===b){T=void 0;g=void 0;f=void 0;U=void 0;X=void 0;E=void 0;P=void 0;L=void 0;K=void 0;Z=void 0;var T=h;g=v;f=y;var[U,X,,f]=f,[E,P]=g.getCenter(),[g]=dp(g),f=f/2,L=g*f,K=E-L,Z=P-L;for(let t=0;t<T.length;t++)T[t].bbox={x:U+K,y:X+Z,width:2*L,height:2*L}}else if("outer"===b){v=void 0;g=void 0;Q=void 0;J=void 0;tt=void 0;et=void 0;v=h;g=y;var[Q,J,tt,et]=g;for(const at of v)at.bbox={x:Q,y:J,width:tt,height:et}}rt=nt=N=y=h=b=P=f=C=void 0;var C=m,f=d,P=p;if(0!==C.length){var[P,b,h,y]=P,[f]=dp(f),N=y/2*f/Math.sqrt(2),nt=P+h/2,rt=b+y/2;for(let t=0;t<C.length;t++)C[t].bbox={x:nt-N,y:rt-N,width:2*N,height:2*N}}}V.length&&!function(n,t){const[e,r,i,a,o,s,l]=t,[c,u,h,f,d,p,g,m]="vertical"===o?["y",r,"x",e,"height",a,"width",i]:["x",e,"y",r,"width",i,"height",a],v=(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=v;t<n.length;t++){var y=n[t],{crossPadding:b=0}=y,x=y["size"];y.bbox={[c]:s?e-x+b:e+b,[h]:f,[d]:x-2*b,[g]:m},e+=x*(s?-1:1)}t=n.filter(t=>"group"===t.type);for(const A of t){const{bbox:_,children:T}=A;var w=_[g];const P=w/T.length;var M=T.reduce((t,e)=>{e=null==(e=e.layout)?void 0:e.justifyContent;return e||t},"flex-start"),k=T.map((t,e)=>{var{length:t=P,padding:n=0}=t;return t+(e===T.length-1?0:n)}),E=ap(k),w=w-E,E="flex-start"===M?0:"center"===M?w/2:w;for(let t=0,e=_[h]+E;t<T.length;t++){var O=T[t],{padding:S=0}=O,S=t===T.length-1?0:S;O.bbox={[d]:_[d],[c]:_[c],[h]:e,[g]:k[t]-S},ot(O,{layout:{justifyContent:M}}),e+=k[t]}}}(t,u)}}function p8(t,e,n){var{encode:r={},scale:i={},transform:a=[]}=e,e=it(e,["encode","scale","transform"]);return[t,Object.assign(Object.assign({},e),{encode:r,scale:i,transform:a})]}function g8(t,i,a){return ue(this,void 0,void 0,function*(){var t=a["library"],e=i["data"],[t]=z6("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=it(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)}),Zp)}([it(n,["transform"]),...r].map(t))(e);return[Array.isArray(n)?iy(n):[],Object.assign(Object.assign({},i),{data:n})]})}function m8(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 v8(t,e,n){const{encode:r,data:i}=e;var a;return r?(a=ry(r,t=>{var e,n;return function(t){if("object"!=typeof t||t instanceof Date||null===t)return;t=t.type;return n0(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 y8(t,e,n){var r=e["encode"];return r?(r=ry(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 b8(t,e,n){const{encode:r,data:i}=e;if(!r)return[t,e];n=n.library;const a=function(t){const[n]=z6("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=ry(r,t=>a(i,t));return[t,Object.assign(Object.assign({},e),{encode:n})]}function x8(t,e,n){var{tooltip:r={}}=e;return s0(r)?[t,e]:Array.isArray(r)?[t,Object.assign(Object.assign({},e),{tooltip:{items:r}})]:o0(r)&&u0(r)?[t,Object.assign(Object.assign({},e),{tooltip:r})]:[t,Object.assign(Object.assign({},e),{tooltip:{items:[r]}})]}function w8(g,t,e){const{data:m,encode:v,tooltip:n={}}=t;var r,i,a,o;return s0(n)?[g,t]:(r=e=>{if(!e)return e;if("string"==typeof e)return g.map(t=>({name:e,value:m[t][e]}));if(o0(e)){var{field:t,channel:n,color:r,name:i=t,valueFormatter:a=t=>t}=e,o="string"==typeof a?UE(a):a,s=n&&v[n],a=s&&v[n].field,l=i||a||n,c=[];for(const d of g){var u=t?m[d][t]:s?v[n].value[d]:null;c[d]={name:l,color:r,value:o(u)}}return c}if("function"!=typeof e)return e;var h=[];for(const p of g){var f=e(m[p],p,m,v);o0(f)?h[p]=f:h[p]={value:f}}return h},{title:o,items:i=[]}=n,a=it(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 M8(l,t,e){var n,r=t["encode"],i=it(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=it(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 k8(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 ot(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 E8(t,e,n){var r=e["animate"];return r||void 0===r||ot(e,{animate:{enter:{type:null},exit:{type:null},update:{type:null}}}),[t,e]}function O8(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]=z6("transform",t),{preInference:e=[],postInference:n=[]}=l,{transform:r=[]}=s,e=[p8,g8,m8,v8,y8,b8,M8,E8,k8,x8,...e.map(t),...r.map(t),...n.map(t),w8];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:f,data:r,tooltip:i}=e;if(!1===Array.isArray(r))return null;const a=c["channels"],o=Nd(Object.entries(n).filter(([,t])=>n0(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:h}=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=f[t]||{},{independent:o=!1,key:s=u||t,type:i=i?"constant":r?"identity":c}=a,r=it(a,["independent","key","type"]),a="constant"===i,l=a?void 0:h;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 S8(H,Y,V,q){var $,U;return ue(this,void 0,void 0,function*(){const[n]=z6("composition",V);var[t]=z6("interaction",V);const I=new Set(Object.keys(V).map(t=>{return null==(t=/mark\.(.*)/.exec(t))?void 0:t[1]}).filter(n0)),r=new Set(Object.keys(V).map(t=>{return null==(t=/component\.(.*)/.exec(t))?void 0:t[1]}).filter(n0)),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&&(I.has(t)||r.has(t))?"mark":t};const a=t=>"standardView"===i(t),B=t=>{t=t.type;return"string"==typeof t&&!!r.has(t)};var e=t=>{var e;return a(t)?[t]:(e=i(t),n({type:e,static:B(t)})(t))},o=[];const s=new Map;for(var l=new Map,c=[H],u=[];c.length;){var h=c.shift();if(a(h)){var f=l.get(h),[f,d]=f?P8(f,h,V):yield _8(h,V),p=(s.set(f,h),o.push(f),d.flatMap(e).map(t=>G6(t,V)));if(c.push(...p),p.every(a)){var g=yield Promise.all(p.map(t=>T8(t,V)));jL(f=(f=g).flatMap(t=>Array.from(t.values())).flatMap(t=>t.channels.map(t=>t.scale)),"x"),jL(f,"y");for(let t=0;t<p.length;t++){var D=p[t],F=g[t];l.set(D,F)}}}else{d="mark"===i(h)?h:yield D8(h,V),f=e(d);Array.isArray(f)?c.push(...f):"function"==typeof f&&u.push(f())}}q.emitter.emit(G5.BEFORE_PAINT);const m=new Map,v=new Map,y=[];Y.selectAll(G8(Qc)).data(o,t=>t.key).join(t=>t.append("g").attr("className",Qc).attr("id",t=>t.key).call(A8).each(function(t){L8(t,st(this),y,V,q),m.set(t,this)}),t=>t.call(A8).each(function(t){L8(t,st(this),y,V,q),v.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(f,d,p){return h=>ue(this,void 0,void 0,function*(){var t,[e,n]=yield _8(h,d),r=(L8(e,f,[],d,p),f),i=h,a=e,o=p,[s]=z6("interaction",s=d),l=(l=r.node()).nameInteraction,c=B8(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)S8(u,f,d,p);return{options:h,view:e}})}(st(e),V,q)})),x=b(m);for(const P of x){const H=P["options"];var w=new Map;P.container.nameInteraction=w;for(const L of B8(H)){var[M,k]=L;k&&(k=t(Object.assign({type:M},k))(P,x,q.emitter),w.set(M,{destroy:k}))}}var E=b(v);for(const C of E){const{options:H,container:N}=C;var O=N.nameInteraction;for(const j of B8(H)){var[S,A]=j,_=O.get(S);_&&null!=($=_.destroy)&&$.call(_),A&&(_=t(Object.assign({type:S},A))(C,E,q.emitter),O.set(S,{destroy:_}))}}const{width:z,height:W}=H;var T=[];for(const R of u){var G=new Promise(e=>ue(this,void 0,void 0,function*(){for(const t of R)yield S8(Object.assign({width:z,height:W},t),Y,V,q);e()}));T.push(G)}q.views=o,null!=(U=q.animations)&&U.forEach(t=>null==t?void 0:t.cancel()),q.animations=y,q.emitter.emit(G5.AFTER_PAINT);b=y.filter(n0).map(R8).map(t=>t.finished);return Promise.all([...b,...T])})}function A8(t){t.style("transform",t=>`translate(${t.layout.x}, ${t.layout.y})`)}function _8(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=it(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)=>ot(t,e),{}),e=[n,...o].reduce((t,e)=>ot(t,e),{}),n=[...s,r].reduce((t,e)=>ot(t,e),{});return Object.assign(Object.assign({},t),{marks:i,coordinate:a,interaction:e,style:n})}(yield function(p,g){return ue(this,void 0,void 0,function*(){var[t,e]=z6("mark",g),n=new Set(Object.keys(g).map(t=>{return null==(t=/component\.(.*)/.exec(t))?void 0:t[1]}).filter(n0));const r=p["marks"];for(var i=[],a=[],o=[...r],{width:s,height:l}=function(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:h=u,insetRight:f=u,insetTop:d=u,insetBottom:u=u}=t,p=t=>"auto"===t?30:t;return{width:e-p(r)-p(i)-s-l-h-f,height:t-p(a)-p(n)-c-o-d-u}}(p),c={options:p,width:s,height:l};o.length;){var[u]=o.splice(0,1),u=yield D8(u,g);const{type:f=t0("G2Mark type is required."),key:d}=u;if(n.has(f))a.push(u);else{var{props:h={}}=e(f),{composite:h=!0}=h;if(h){const r=yield t(u,c);h=Array.isArray(r)?r:[r];o.unshift(...h.map((t,e)=>Object.assign(Object.assign({},t),{key:d+"-"+e})))}else i.push(u)}}return Object.assign(Object.assign({},p),{marks:i,components:a})})}(e,n)),t=(e.interaction=t.interaction,e.coordinate=t.coordinate,G6(t,n));return P8(yield T8(t,n),t,n)})}function T8(p,g){return ue(this,void 0,void 0,function*(){var[t]=z6("theme",g),[,e]=z6("mark",g),{theme:n,marks:r,coordinates:i=[]}=p,a=t(I8(n)),o=new Map;for(const h of r){var s,l=h["type"],{props:l={}}=e(l),l=yield O8(h,l,g);l&&([l,s]=l,o.set(l,s))}for(const f of Pd(Array.from(o.values()).flatMap(t=>t.channels),({scaleKey:t})=>t).values()){var c=f.reduce((t,{scale:e})=>ot(t,e),{}),u=f[0]["values"],u=Array.from(new Set(u.map(t=>t.field).filter(n0)));const p=ot({guide:{title:0===u.length?void 0:u},field:u[0]},c);u=f[0]["name"];const d=LL(u,f.flatMap(({values:t})=>t.map(t=>t.value)),p,i,a,g);f.forEach(t=>t.scale=d)}return o})}function P8(t,e,n){var[r]=z6("mark",n),[i]=z6("theme",n),[a]=z6("labelTransform",n);const{key:o,frame:s=!1,theme:I,clip:B,style:l={},labelTransform:D=[]}=e;var i=i(I8(I)),c=Array.from(t.values());const u=CL(c,e);var c=XL(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(u),c,t),e,n),h=h8(c,e,i,n),f=function(t,e,n){var[n]=z6("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 D6(Object.assign(Object.assign({},t),{x:a+c,y:o+u,width:i-a-s,height:r-l-o,transformations:e.map(n).flat()}))}(h,e,n),e=s?ot({mainLineWidth:1,mainStroke:"#000"},l):l,d=(d8(ZL(c),f,h),{});for(const x of c){var{scales:F=[]}=x;const u=[];for(const w of F){var z=w["name"],p=NL(w,n);u.push(p),d[z]=p}x.scaleInstances=u}var g,m,v=[];for([g,m]of t.entries()){const{children:M,dataDomain:k,modifier:E,key:O}=g,{index:S,channels:A,tooltip:_}=m;var y=ry(Object.fromEntries(A.map(({name:t,scale:e})=>[t,e])),t=>NL(t,n));Object.assign(d,y);const T=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}(A,y),[P,L,C]=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])=>n0(t)&&n0(e))&&(r.push(a),i.push(o))}return[r,i]}(r(g)(S,y,T,f));var b=k||P.length;const N=E?E(L,b,h):[],j=t=>{var e;return null==(e=null==(e=_.title)?void 0:e[t])?void 0:e.value},R=e=>_.items.map(t=>t[e]);b=P.map((t,e)=>{var n=Object.assign({points:L[e],transform:N[e],index:t,markKey:O,viewKey:o},_&&{title:j(t),items:R(t)});for(const[r,i]of Object.entries(T))n[r]=i[t],C&&(n["series"+rn(r)]=C[e].map(t=>i[t]));return C&&(n.seriesIndex=C[e]),C&&_&&(n.seriesItems=C[e].map(t=>R(t)),n.seriesTitle=C[e].map(t=>j(t))),n}),b=(m.data=b,m.index=P,null==M?void 0:M(b,y,h));v.push(...b||[])}return[{layout:h,theme:i,coordinate:f,markState:t,key:o,clip:B,scale:d,style:e,components:c,labelTransform:Qp(D.map(a))},v]}function L8(J,tt,et,nt,rt){ue(this,void 0,void 0,function*(){const{components:I,theme:n,layout:t,markState:r,coordinate:i,key:e,style:B,clip:a,scale:o}=J,{width:D,height:F}=t,z=it(t,["x","y","width","height"]),s=["view","plot","main","content"];var l=s.map((t,e)=>e);const c=s.map(t=>r0(Object.assign({},n,B),t)),W=["a","margin","padding","inset"].map(t=>at(z,t)),u=t=>t.style("x",t=>g[t].x).style("y",t=>g[t].y).style("width",t=>g[t].width).style("height",t=>g[t].height).each(function(t){var e,n,r=st(this),t=c[t];for([e,n]of Object.entries(t))r.style(e,n)});let h=0,f=0,d=D,p=F;const g=l.map(t=>{var{left:t=0,top:e=0,bottom:n=0,right:r=0}=W[t];return h+=t,f+=e,d-=t+r,p-=e+n,{x:h,y:f,width:d,height:p}}),m=(tt.selectAll(G8(nu)).data(l.filter(t=>n0(c[t])),t=>s[t]).join(t=>t.append("rect").attr("className",nu).style("zIndex",-2).call(u),t=>t.call(u),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:h=300,delay:f=0}=r,{type:d,duration:p=300,delay:g=0}=o;for(const O of i){var{updateType:m=s,updateDuration:v=l,updateDelay:y=c,enterType:b=u,enterDuration:x=h,enterDelay:w=f,exitDuration:M=p,exitDelay:k=g,exitType:E=d}=O;void 0!==m&&!m||(e=Math.max(e,v+y),n=Math.min(n,y)),void 0!==E&&!E||(e=Math.max(e,M+k),n=Math.min(n,k)),void 0!==b&&!b||(e=Math.max(e,x+w),n=Math.min(n,w))}}return e===-1/0?null:[n,e-n]}(r)),v=!!m&&{duration:m[1]};var y,b,x,l=tt.selectAll(G8(tu)).data(I,(t,e)=>t.type+"-"+e).join(t=>t.append("g").style("zIndex",({zIndex:t})=>t||-1).attr("className",tu).append(t=>KL(ot({animate:v,scale:o},t),i,n,nt,r)),t=>t.transition(function(t){var{preserve:e=!1}=t;if(!e)return e=KL(ot({animate:v,scale:o},t),i,n,nt,r)["attributes"],[t]=this.childNodes,t.update(e)})).transitions();et.push(...l.flat().filter(n0));const w=tt.selectAll(G8(Jc)).data([t],()=>e).join(t=>t.append("rect").style("zIndex",0).style("fill","transparent").attr("className",Jc).call(F8).call(W8,Array.from(r.keys())).call(H8,a),t=>t.call(W8,Array.from(r.keys())).call(t=>{if(!m)return F8(t);{const[l,c]=m;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(H8,a)).transitions();et.push(...w.flat());for([y,b]of r.entries()){var G=b["data"];const{key:e,class:V,type:_}=y;var M=tt.select("#"+e);const T=function(s,t,e,n,r){const[l]=z6("shape",n),c=s["data"],{defaultShape:u,data:i}=t,h=i.map(t=>t.points),{theme:f,coordinate:a}=e,{type:d,style:p={}}=s,g=Object.assign(Object.assign({},r),{document:W6(r),coordinate:a,theme:f});return t=>{var{shape:e=u}=p,{shape:e=e,points:n,seriesIndex:r,index:i}=t,t=it(t,["shape","points","seriesIndex","index"]),t=Object.assign(Object.assign({},t),{index:i});const a=r?r.map(t=>c[t]):c[i],o=r||i;r=ry(p,t=>C8(t,a,o,c)),i=Object.assign(Object.assign({},r),{type:z8(s,e)});return l(i,g)(n,t,N8(f,d,e,u),h)}}(y,b,J,nt,rt),q=(k=y,x=b,j8("enter",k,x,J,nt)),P=(k=y,x=b,j8("update",k,x,J,nt)),$=(k=y,x=b,j8("exit",k,x,J,nt));var k=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))}(tt,M,V,"element");const w=M.selectAll(G8(Zc)).selectFacetAll(k).data(G,t=>t.key,t=>t.groupKey).join(t=>t.append(T).attr("className",Zc).attr("markType",_).transition(function(t){return q(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=T(t,e),s=P(t,[this],[o]);return null===s&&(this.nodeName===o.nodeName?e0(this,o):this.parentNode.replaceChild(o,this)),s})}),t=>t.each(function(){this.__removed__=!0}).transition(function(t){return $(t,[this])}).remove(),t=>t.append(T).attr("className",Zc).attr("markType",_).transition(function(t){var e=this["__fromElements__"],t=P(t,e,[this]);return new ky(e,null,this.parentNode).transition(t).remove(),t}),t=>t.transition(function(t){var e=new ky([],this.__toData__,this.parentNode).append(T).attr("className",Zc).attr("markType",_).nodes();return P(t,[this],e)}).remove()).transitions();et.push(...w.flat())}{var E=J,O=tt,S=nt,H=rt,A,Y;const[U]=z6("labelTransform",S),{markState:X,labelTransform:L}=E,K=O.select(G8(Kc)).node(),C=new Map,N=new Map,Z=Array.from(X.entries()).flatMap(([t,e])=>{var{labels:n=[],key:r}=t;const i=function(t,e,n,r,i){const[s]=z6("shape",r),l=t["data"],{data:a,defaultLabelShape:c}=e,u=a.map(t=>t.points),{theme:h,coordinate:o}=n,f=Object.assign(Object.assign({},i),{document:W6(i),theme:h,coordinate:o});return t=>{const{index:e,points:n}=t,r=l[e];var{formatter:i=t=>""+t,style:a}=t,t=it(t,["formatter","transform","style"]),t=ry(Object.assign(Object.assign({},t),a),t=>C8(t,r,e,l)),{shape:a=c,text:o}=t,t=it(t,["shape","text"]),i="string"==typeof i?UE(i):i,i=Object.assign(Object.assign({},t),{text:i(o,r,e,l)}),o=Object.assign({type:"label."+a},t);return s(o,f)(n,i,N8(h,"label",a,"label"),u)}}(t,e,E,S,H),a=O.select("#"+r).selectAll(G8(Zc)).nodes().filter(t=>!t.__removed__);return n.flatMap((e,n)=>{const r=it(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.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=>{C.set(t,i),N.set(t,e)}),t})})}),j=st(K).selectAll(G8(eu)).data(Z,t=>t.key).join(t=>t.append(t=>C.get(t)(t)).attr("className",eu),t=>t.each(function(t){e0(this,C.get(t)(t))}),t=>t.remove()).nodes(),Q=Pd(j,t=>N.get(t.__data__)),R=E["coordinate"];for([A,Y]of Q){var{transform:A=[]}=A;Qp(A.map(U))(Y,R)}L&&L(j,R)}})}function C8(t,e,n,r){return"function"==typeof t?t(e,n,r):"string"==typeof t&&void 0!==e[t]?e[t]:t}function N8(t,e,n,r){var i;if("string"==typeof e)return i=t["defaultColor"],e=(t=t[e]||{})[n]||t[r],Object.assign({color:i},e)}function j8(o,t,e,n,r){var[,i]=z6("shape",r);const[s]=z6("animation",r);var r=e["defaultShape"],{theme:e,coordinate:n}=n,a=`default${rn(o)}Animation`;const{[a]:l}=i(z8(t,r)).props,{[o]:c={}}=e,u=(null==(i=t.animate)?void 0:i[o])||{},h={coordinate:n};return(t,e,n)=>{var{[o+"Type"]:t,[o+"Delay"]:r,[o+"Duration"]:i,[o+"Easing"]:a}=t,t=Object.assign({type:t||l},u);return t.type?(r={delay:r,duration:i,easing:a},i=s(t,h)(e,n,ot(c,r)),Array.isArray(i)?i:[i]):null}}function R8(t){return t.finished.then(()=>{t.cancel()}),t}function I8(t={}){var e;return"string"==typeof t?{type:t}:({type:e="classic"}=t,t=it(t,["type"]),Object.assign(Object.assign({},t),{type:e}))}function B8(t){var{interaction:t={}}=t;return Object.entries(ot({event:!0,tooltip:!0,sliderFilter:!0,legendFilter:!0,scrollbarFilter:!0},t))}function D8(r,i){return ue(this,void 0,void 0,function*(){var t={library:i},e=r["data"],n=it(r,["data"]);return null==e?r:([,{data:e}]=yield g8(0,{data:e},t),Object.assign({data:e},n))})}function F8(t){t.style("x",t=>t.paddingLeft).style("y",t=>t.paddingTop).style("width",t=>t.innerWidth).style("height",t=>t.innerHeight)}function z8(t,e){t=t.type;return"string"==typeof e?t+"."+e:e}function W8(t,e){const n=t=>void 0!==t.class?""+t.class:"";0===t.nodes().length||(t.selectAll(G8(Xc)).data(e,t=>t.key).join(t=>t.append("g").attr("className",Xc).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(G8(Kc)).node())||t.append("g").attr("className",Kc).style("zIndex",0)}function G8(...t){return t.map(t=>"."+t).join("")}function H8(t,i){t.node()&&t.style("clipPath",t=>{var e,n,r;return i?({paddingTop:t,paddingLeft:e,innerWidth:n,innerHeight:r}=t,new rl({style:{x:e,y:t,width:n,height:r}})):null})}function Y8(t){for(var t=ot({},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=ot({},s[t]);s[t]=l,e.set(l,o),n.set(l,t),r.push(l)}}return t}function V8(t,e={},n=()=>{},r=t=>{throw t}){const{width:i=640,height:a=480,theme:o}=t,s=(o||t0('ChartOptions.theme is required, such as `const chart = new Chart({ theme: "classic"})`.'),Y8(t)),{canvas:l=(t=i,h=a,f=new Ph,f.registerPlugin(new Ih),new Vl({width:t,height:h,container:document.createElement("div"),renderer:f})),library:c=u6(),emitter:u=new Bh}=e;var h,f;e.canvas=l,e.library=c,e.emitter=u,l.resize(i,a),u.emit(G5.BEFORE_RENDER);const d=st(l.document.documentElement);return l.ready.then(()=>S8(Object.assign(Object.assign({},s),{width:i,height:a}),d,c,e)).then(()=>{l.requestAnimationFrame(()=>{u.emit(G5.AFTER_RENDER),null!=n&&n()})}).catch(t=>{null!=r&&r(t)}),"string"==typeof(t=l.getConfig().container)?document.getElementById(t):t}function q8(t,e={},n=!1){var r,{canvas:e,emitter:i}=e;e&&(null!=(r=(r=e).getRoot().querySelectorAll("."+Qc))&&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 $8(t,{name:e,key:n=e}){t.prototype[e]=function(t){return 0===arguments.length?this.attr(n):this.attr(n,t)}}function U8(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 X8(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 h(r){return t=>{for(const n of r){var e=n["type"];"value"===e?$8(t,n):"array"===e?U8(t,n):"object"===e?X8(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}):o0(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 K8(t){return Object.entries(t).map(([t,e])=>({type:"node",name:t,ctor:e}))}function Z8(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 Q8{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 Z8(this,t=>{e===t.attr("key")&&(n=t)}),n}getNodesByType(e){const n=[];return Z8(this,t=>{e===t.type&&n.push(t)}),n}getNodeByType(e){let n=null;return Z8(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 J8 extends Q8{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"}],ss=[{name:"scale",type:"object"},{name:"transform",type:"array"},{name:"style",type:"object"},{name:"state",type:"object"}],r=ss;let tC=class extends J8{constructor(){super({})}},eC=(tC=t([h(a)],tC),class extends J8{constructor(){super({},"interval")}}),nC=(eC=t([h(a)],eC),class extends J8{constructor(){super({},"rect")}}),rC=(nC=t([h(a)],nC),class extends J8{constructor(){super({},"point")}}),iC=(rC=t([h(a)],rC),class extends J8{constructor(){super({},"area")}}),aC=(iC=t([h(a)],iC),class extends J8{constructor(){super({},"line")}}),oC=(aC=t([h(a)],aC),class extends J8{constructor(){super({},"cell")}}),sC=(oC=t([h(a)],oC),class extends J8{constructor(){super({},"vector")}}),lC=(sC=t([h(a)],sC),class extends J8{constructor(){super({},"link")}}),cC=(lC=t([h(a)],lC),class extends J8{constructor(){super({},"polygon")}});cC=t([h(a)],cC);os=t([h(a)],class extends J8{constructor(){super({},"image")}});let uC=class extends J8{constructor(){super({},"text")}},hC=(uC=t([h(a)],uC),class extends J8{constructor(){super({},"box")}}),fC=(hC=t([h(a)],hC),class extends J8{constructor(){super({},"lineX")}}),dC=(fC=t([h(a)],fC),class extends J8{constructor(){super({},"lineY")}}),pC=(dC=t([h(a)],dC),class extends J8{constructor(){super({},"range")}}),gC=(pC=t([h(a)],pC),class extends J8{constructor(){super({},"rangeX")}}),mC=(gC=t([h(a)],gC),class extends J8{constructor(){super({},"rangeY")}}),vC=(mC=t([h(a)],mC),class extends J8{constructor(){super({},"connector")}}),yC=(vC=t([h(a)],vC),class extends J8{constructor(){super({},"shape")}}),bC=(yC=t([h(a)],yC),class extends J8{constructor(){super({},"sankey")}}),xC=(bC=t([h([...a,{name:"layout",type:"value"}])],bC),class extends J8{constructor(){super({},"treemap")}}),wC=(xC=t([h([...a,{name:"layout",type:"value"}])],xC),class extends J8{constructor(){super({},"boxplot")}}),MC=(wC=t([h(a)],wC),class extends J8{constructor(){super({},"density")}}),kC=(MC=t([h(a)],MC),class extends J8{constructor(){super({},"heatmap")}}),EC=(kC=t([h(a)],kC),class extends J8{constructor(){super({},"path")}}),OC=(EC=t([h(a)],EC),class extends J8{constructor(){super({},"pack")}}),SC=(OC=t([h([...a,{name:"layout",type:"value"}])],OC),class extends J8{constructor(){super({},"forceGraph")}}),AC=(SC=t([h([...a,{name:"layout",type:"value"}])],SC),class extends J8{constructor(){super({},"tree")}}),_C=(AC=t([h([...a,{name:"layout",type:"value"}])],AC),class extends J8{constructor(){super({},"wordCloud")}}),TC=(_C=t([h([...a,{name:"layout",type:"object"}])],_C),class extends J8{constructor(){super({},"gauge")}}),PC=(TC=t([h(a)],TC),class extends J8{constructor(){super({},"axisX")}}),LC=(PC=t([h(ss)],PC),class extends J8{constructor(){super({},"axisY")}}),CC=(LC=t([h(ss)],LC),class extends J8{constructor(){super({},"legends")}});CC=t([h(r)],CC);const NC={mark:tC,interval:eC,rect:nC,point:rC,area:iC,line:aC,cell:oC,vector:sC,link:lC,polygon:cC,image:os,text:uC,box:hC,lineX:fC,lineY:dC,range:pC,rangeX:gC,rangeY:mC,connector:vC,sankey:bC,treemap:xC,boxplot:wC,density:MC,heatmap:kC,path:EC,shape:yC,pack:OC,forceGraph:SC,tree:AC,wordCloud:_C,gauge:TC,axisX:PC,axisY:LC,legends:CC};class jC extends Q8{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()&&p5(t)}hide(){var t=this.getGroup();t&&t.isVisible()&&d5(t)}}let RC=class extends jC{constructor(t={},e="view"){super(t,e)}},IC=(RC=t([h([{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"},...K8(NC)])],RC),class extends jC{constructor(){super({},"spaceLayer")}}),BC=(IC=t([h([{type:"value",name:"data"},...K8(NC)])],IC),class extends jC{constructor(){super({},"spaceFlex")}}),DC=(BC=t([h([{type:"value",name:"data"},...K8(NC)])],BC),class extends jC{constructor(){super({},"facetRect")}}),FC=(DC=t([h([{type:"value",name:"data"},{type:"array",name:"transform"},{type:"object",name:"scale"},{type:"object",name:"encode"},{type:"object",name:"legend"},{type:"object",name:"axis"},...K8(NC)])],DC),class extends jC{constructor(){super({},"facetCircle")}}),zC=(FC=t([h([{type:"value",name:"data"},{type:"array",name:"transform"},{type:"object",name:"scale"},{type:"object",name:"encode"},{type:"object",name:"legend"},{type:"object",name:"axis"},...K8(NC)])],FC),class extends jC{constructor(){super({},"repeatMatrix")}}),WC=(zC=t([h([{type:"value",name:"data"},{type:"array",name:"transform"},{type:"object",name:"scale"},{type:"object",name:"encode"},{type:"object",name:"encode"},{type:"object",name:"legend"},...K8(NC)])],zC),class extends jC{constructor(){super({},"timingKeyframe")}}),GC=(WC=t([h([...K8(NC)])],WC),class extends jC{constructor(){super({},"geoView")}}),HC=(GC=t([h([{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"},...K8(NC)])],GC),class extends jC{constructor(){super({},"geoPath")}});HC=t([h([{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"},...K8(NC)])],HC);const YC={view:RC,spaceLayer:IC,spaceFlex:BC,facetRect:DC,facetCircle:FC,repeatMatrix:zC,timingKeyframe:WC,geoView:GC,geoPath:HC};for(const t7 of Object.values(YC))h(K8(YC))(t7);const VC=u6();const qC=t=>t?parseInt(t):0;const $C=["width","height","padding","paddingLeft","paddingRight","paddingBottom","paddingTop","inset","insetLeft","insetRight","insetTop","insetBottom","margin","marginLeft","marginRight","marginTop","marginBottom","autoFit","theme","title"];function UC(t){return Object.assign(Object.assign({},t.value),{type:t.type})}function XC(t,e){var n,r=t["autoFit"];return r?(r=e,e=getComputedStyle(r),n=r.clientWidth||qC(e.width),r=r.clientHeight||qC(e.height),{width:n-(qC(e.paddingLeft)+qC(e.paddingRight)),height:r-(qC(e.paddingTop)+qC(e.paddingBottom))}):({width:n=640,height:r=480}=t,{width:n,height:r})}function KC(t){var t=function(t){if(null!==t.type)return t;var e=t.children[t.children.length-1];for(const n of $C)e.attr(n,t.attr(n));return e}(t),e=[t],n=new Map;for(n.set(t,UC(t));e.length;){const t=e.pop();var r=n.get(t),{children:i=[]}=t;for(const s of i){var a=UC(s),{children:o=[]}=r;o.push(a),e.push(s),n.set(s,a),r.children=o}}return n.get(t)}function ZC(t,e,n){var t=t["type"],{type:n=n||t}=e;if("view"===n)return e;if("function"!=typeof(t=n)&&!new Set(Object.keys(NC)).has(t))return e;var r={type:"view"},i=Object.assign({},e);for(const a of $C)void 0!==i[a]&&(r[a]=i[a],delete i[a]);return Object.assign(Object.assign({},r),{children:[i]})}function QC(t){var e=t["type"],t=it(t,["type","children"]),n=new(function(t){if("function"==typeof t)return NC.mark;var e=Object.assign(Object.assign({},NC),YC)[t];if(e)return e;throw new Error(`Unknown mark: ${t}.`)}(e));return n.value=t,n.type=e,n}function JC(t,e,n){for(var r,i,a=[[null,t,ZC(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=it(i,["type","children"]),r.type===g||void 0===g?r.value=ot(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 h=Math.max(c.length,u.length);for(let t=0;t<h;t++){var f=c[t],d=u[t];a.push([s,d,f])}}}else s.remove();else{y=v=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 v=QC(b),y=(Array.isArray(p.children)&&p.push(v),b)["children"];if(Array.isArray(y))for(const x of y)m.push([v,x])}}}}yl=[{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"},...K8(NC),...($o=YC,Object.entries($o).map(([t,e])=>({type:"container",name:t,ctor:e})))];p.Chart=class extends RC{constructor(t){var t=t||{},{container:e,canvas:n,renderer:r,plugins:i}=t;super(it(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=ln(()=>{this.forceFit()},300),this._renderer=r||new Ph,this._plugins=i||[],this._container=void 0===(t=e)?document.createElement("div"):"string"==typeof t?document.getElementById(t):t,this._emitter=new Bh,this._context={library:VC,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)=>V8(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?KC(this):(e=t["type"],e&&(this._previousDefinedType=e),JC(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(G5.BEFORE_CLEAR),this._reset(),q8(0,this._context,!1),this.emit(G5.AFTER_CLEAR)}destroy(){var t,e;this.options();this.emit(G5.BEFORE_DESTROY),this._unbindAutoFit(),this._reset(),q8(0,this._context,!0),t=this._container,(e=t.parentNode)&&e.removeChild(t),this.emit(G5.AFTER_DESTROY)}forceFit(){this.options.autoFit=!0;var{width:t,height:e}=XC(this.options(),this._container);if(t===this._width&&e===this._height)return Promise.resolve(this);this.emit(G5.BEFORE_CHANGE_SIZE);t=this.render();return t.then(()=>{this.emit(G5.AFTER_CHANGE_SIZE)}),t}changeSize(t,e){if(t===this._width&&e===this._height)return Promise.resolve(this);this.emit(G5.BEFORE_CHANGE_SIZE),this.width(t),this.height(e);t=this.render();return t.then(()=>{this.emit(G5.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}=XC(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}=XC(this.options(),this._container);this._plugins.push(new Ih),this._plugins.forEach(t=>this._renderer.registerPlugin(t)),this._context.canvas=new Vl({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))}},p.Chart=t([h(yl)],p.Chart),_.enableCSSParsing=!1,p.AREA_CLASS_NAME=nu,p.COMPONENT_CLASS_NAME=tu,p.ChartEvent=G5,p.CompositionNode=jC,p.ELEMENT_CLASS_NAME=Zc,p.LABEL_CLASS_NAME=eu,p.LABEL_LAYER_CLASS_NAME=Kc,p.MAIN_LAYER_CLASS_NAME=Xc,p.MarkNode=J8,p.PLOT_CLASS_NAME=Jc,p.VIEW_CLASS_NAME=Qc,p.createLibrary=u6,p.register=function(t,e){Object.assign(VC,{[t]:e})},p.render=V8,p.renderToMountedElement=function(t,e={},n=()=>{},r=t=>{throw t}){var{width:i=640,height:a=480}=t,t=Y8(t);const{library:o=u6(),group:s=new Gs,emitter:l=new Bh}=e;null!==s&&void 0!==s&&s.parentElement||t0("renderToMountedElement can't render chart to unmounted group.");var c=st(s);return e.group=s,e.library=o,(e.emitter=l).emit(G5.BEFORE_RENDER),S8(Object.assign(Object.assign({},t),{width:i,height:a}),c,o,e).then(()=>{s.ownerDocument.defaultView.requestAnimationFrame(()=>{l.emit(G5.AFTER_RENDER),null!=n&&n()})}).catch(t=>{null!=r&&r(t)}),s},Object.defineProperty(p,"__esModule",{value:!0})});
|
|
10
|
+
`,y.style.x=t,y.style.y=e,y.style.width=n-t,y.style.height=r-e},S={"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"}},A=t=>T(t)||_(t),_=t=>{t=t.id;return-1!==h.indexOf(t)&&new Set(Object.keys(S)).has(t)},T=t=>t===y.getElementById("selection"),P=t=>{var e=t["target"],[t,n]=CE(l,t);y&&A(e)?A(e)&&(g=[t,n]):(O(t,n),v=!0)},L=t=>{var e,n,r,i,a,o,s=t["target"],t=CE(l,t);if(d)return g?T(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 E(n,r)):([e,n]=[t[0]-g[0],t[1]-g[1]],r=s["id"],S[r]?([s,i,a,o]=S[r].vector,E([d[0]+e*s,d[1]+n*i],[p[0]+e*a,p[1]+n*o])):void 0):E(d,t)},C=t=>{var e,n,r,i;g?(g=null,{x:e,y:r,width:n,height:i}=y.style,d=[e,r],p=[e+n,r+i]):(p=CE(l,t),[e,n,r,i]=E(d,p),v=!1,o(e,n,r,i,t))},N=t=>{t=t.target;y&&!A(t)&&k()},j=t=>{t=t.target;y&&A(t)&&!v?T(t)?GE(l,"move"):_(t)&&GE(l,S[t.id].cursor):GE(l,"crosshair")},R=()=>{GE(l,"default")};return l.addEventListener("dragstart",P),l.addEventListener("drag",L),l.addEventListener("dragend",C),l.addEventListener("click",N),l.addEventListener("pointermove",j),l.addEventListener("pointerleave",R),{mask:y,move(t,e,n,r,i=!0){y||O(t,e),d=[t,e],p=[n,r],E([t,e],[n,r],i)},remove(t=!0){y&&k(t)},destroy(){y&&k(!1),GE(l,"default"),l.removeEventListener("dragstart",P),l.removeEventListener("drag",L),l.removeEventListener("dragend",C),l.removeEventListener("click",N),l.removeEventListener("pointermove",j),l.removeEventListener("pointerleave",R)}}}function IS(e,t,n){return t.filter(t=>{return t!==e&&({interaction:t={}}=t.options,Object.values(t).find(t=>t.brushKey===n))})}function BS(t,e){var{elements:n,selectedHandles:r,siblings:i=t=>[],datum:a,brushRegion:o,extent:s,reverse:l,scale:c,coordinate:u,series:h=!1,key:d=t=>t,bboxOf:f=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=it(e,["elements","selectedHandles","siblings","datum","brushRegion","extent","reverse","scale","coordinate","series","key","bboxOf","state","emitter"]);const y=n(t),m=i(t),v=m.flatMap(n);i=DE(y,a),n=at(e,"mask");const{setState:b,removeState:x}=IE(p,i),w=new Map,{width:M,height:O,x:k=0,y:E=0}=f(t);a=s||[0,0,M,O];const S=()=>{for(const t of[...y,...v])x(t,"active","inactive")},A=(t,e,n,r)=>{var i;for(const u of m)null!=(i=u.brush)&&i.remove();var a=new Set;for(const h of y){var{min:o,max:s}=h.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(h,"inactive"):(b(h,"active"),a.add(d(h)))}for(const f of v)a.has(d(f))?b(f,"active"):b(f,"inactive")},_=()=>{for(const t of y)x(t,"inactive");for(const e of w.values())e.remove();w.clear()},T=(t,e,n,r)=>{var i;for(const o of y){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 kc({style:{x:t+k,y:e+E,width:n-t,height:r-e}}),b(o,"inactive"),b(a,"active")}},P=RS(t,Object.assign(Object.assign({},n),{extent:a,brushRegion:o,reverse:l,selectedHandles:r,brushended:t=>{var e=h?_:S;t&&g.emit("brush:remove",{nativeEvent:!0}),e()},brushed:(t,e,n,r,i)=>{var a=$k(t,e,n,r,c,u);i&&g.emit("brush:highlight",{nativeEvent:!0,data:{selection:a}}),(h?T:A)(t,e,n,r)}})),L=({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=Uk(t,e),e=Uk(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),P.move(e,t,n,r,!1))},C=(g.on("brush:highlight",L),({nativeEvent:t}={})=>{t||P.remove(!1)}),N=(g.on("brush:remove",C),P.destroy.bind(P));return P.destroy=()=>{g.off("brush:highlight",L),g.off("brush:remove",C),N()},P}function DS(t){var{facet:g,brushKey:y}=t,m=it(t,["facet","brushKey"]);return(t,e,n)=>{var r,i,a,o,{container:s,view:l,options:c}=t,s=PE(s),u={maskFill:"#777",maskFillOpacity:"0.3",maskStroke:"#fff",reverse:!1},h=["active",["inactive",{opacity:.5}]],{scale:f,coordinate:d}=l;if(g)return r=(o=s.getBounds()).min[0],i=o.min[1],a=o.max[0],o=o.max[1],BS(s.parentNode.parentNode,Object.assign(Object.assign({elements:()=>_E(t,e),datum:RE(TE(t,e).map(t=>t.view)),brushRegion:(t,e,n,r)=>[t,e,n,r],extent:[r,i,a,o],state:BE(TE(t,e).map(t=>t.options),h),emitter:n,scale:f,coordinate:d,selectedHandles:void 0},u),m));const p=BS(s,Object.assign(Object.assign({elements:AE,key:t=>t.__data__.key,siblings:()=>{return IS(t,e,y).map(t=>PE(t.container))},datum:RE([l,...IS(t,e,y).map(t=>t.view)]),brushRegion:(t,e,n,r)=>[t,e,n,r],extent:void 0,state:BE([c,...IS(t,e,y).map(t=>t.options)],h),emitter:n,scale:f,coordinate:d,selectedHandles:void 0},u),m));return s.brush=p,()=>p.destroy()}}function FS(t,e,n,r,i){var[,i,,a]=i;return[t,i,n,a]}function zS(t){return DS(Object.assign(Object.assign({},t),{brushRegion:FS,selectedHandles:["handle-e","handle-w"]}))}function WS(t,e,n,r,i){var[i,,a]=i;return[i,e,a,r]}function GS(t){return DS(Object.assign(Object.assign({},t),{brushRegion:WS,selectedHandles:["handle-n","handle-s"]}))}const HS="axis",YS="axis-hot-area";function VS(t){return t.getElementsByClassName(HS)}function qS(t){return t.getElementsByClassName("axis-line")[0]}function $S(t){return t.getElementsByClassName("axis-main-group")[0].getLocalBounds()}function US(t,e){var{cross:n,offsetX:i}=e,e=it(e,["cross","offsetX","offsetY"]),r=$S(t),[t]=qS(t).getLocalBounds().min;const[a,o]=r.min,[s,l]=r.max;r=2*(s-a);return{brushRegion:WS,hotZone:new kc({className:YS,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 XS(t,e){var{offsetY:i,cross:n=!1}=e,e=it(e,["offsetY","offsetX","cross"]),r=$S(t),[,t]=qS(t).getLocalBounds().min;const[a,o]=r.min,[s,l]=r.max;r=l-o;return{brushRegion:FS,hotZone:new kc({className:YS,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 KS(t,e){var{axes:n,elements:r,points:i,horizontal:s,datum:a,offsetY:o,offsetX:l,reverse:c=!1,state:u={},emitter:h,coordinate:f}=e,e=it(e,["axes","elements","points","horizontal","datum","offsetY","offsetX","reverse","state","emitter","coordinate"]);const d=r(t),p=n(t),{setState:g,removeState:y}=IE(u,DE(d,a)),m=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(m.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(qk(n,i))})(n,t)),e&&h.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)),E=[];for(let a=0;a<p.length;a++){const P=p[a];const{hotZone:L,brushRegion:C,extent:N}=(s(P)?XS:US)(P,{offsetY:o,offsetX:l,cross:k,zIndex:999,fill:"transparent"});P.parentNode.appendChild(L);var S=RS(L,Object.assign(Object.assign({},v),{reverse:c,brushRegion:C,brushended(t){if(m.delete(P),0===Array.from(m.entries()).length){var e=t;for(const n of d)y(n,"active","inactive");M(),e&&h.emit("brushAxis:remove",{nativeEvent:!0})}else O(a,t)},brushed(t,e,n,r,i){m.set(P,N(t,e,n,r)),O(a,i)}}));E.push(S)}const A=(t={})=>{t=t.nativeEvent;t||E.forEach(t=>t.remove(!1))},_=(t,e,n)=>{var{height:r,width:i}=f.getOptions(),e=e.clone();return s(n)?e.update({range:[0,i]}):e.update({range:[r,0]}),e.map(t)},T=t=>{var e=t["nativeEvent"];if(!e){var n=t.data["selection"];for(let t=0;t<E.length;t++){var r,i=n[t],a=E[t],o=p[t];i?(r=b[t],a.move(...((t,e,n)=>{var[t,r]=t,t=_(t,e,n),e=_(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(!1)}}};return h.on("brushAxis:remove",A),h.on("brushAxis:highlight",T),()=>{E.forEach(t=>t.destroy()),h.off("brushAxis:remove",A),h.off("brushAxis:highlight",T)}}function ZS(l){return(t,e,n)=>{var{container:t,view:r,options:i}=t,{x:a,y:o}=PE(t).getBBox(),s=r["coordinate"];return KS(t,Object.assign({elements:AE,axes:VS,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:RE(r),state:BE(i,["active",["inactive",{opacity:.5}]]),coordinate:s,emitter:n},l))}}function QS(t,e){var{filter:a,reset:n,brushRegion:r,extent:i,reverse:o,emitter:s,selection:l}=e,e=at(it(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 h=function(e=300){let n=null;return t=>{t=t.timeStamp;return null!==n&&t-n<e?(n=t,!0):(n=t,!1)}}(),f=RS(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),f.remove()}}));function d(t){h(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),()=>{f.destroy(),s.off("brush:filter",p),t.removeEventListener("click",d)}}function JS(t){var{hideX:f=!0,hideY:d=!0}=t,p=it(t,["hideX","hideY"]);return(t,e,a)=>{const{container:n,view:r,options:o,update:s}=t;t=PE(n);let l=!1,c=!1,u=r;var{scale:i,coordinate:h}=r;return QS(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 $k(t,e,n,r,i,a)},filter:(r,i)=>X(this,void 0,void 0,function*(){if(!c){c=!0;const[e,n]=r;var t=o["marks"],t=t.map(t=>ot({axis:Object.assign(Object.assign({},f&&{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:h},{maskFill:"#777",maskFillOpacity:"0.3",maskStroke:"#fff",unhighlightedOpacity:.5,reverse:!1}),p))}}function t3(t){return JS(Object.assign(Object.assign({hideX:!0},t),{brushRegion:FS}))}function e3(t){return JS(Object.assign(Object.assign({hideY:!0},t),{brushRegion:WS}))}const n3="slider";function r3(t){return[t[0],t[t.length-1]]}function i3({channelDomain:S,className:A=n3,prefix:_="slider",setValue:T=(t,e)=>t.setValues(e),hasState:P=!1,wait:L=50,leading:C=!0,trailing:N=!1}){return(t,e,c)=>{const{container:n,view:r,options:u,update:h}=t;t=n.getElementsByClassName(A);if(!t.length)return()=>{};let f=!1;const{scale:i,coordinate:a}=r,{x:o,y:s}=i,l=mp(a);const d=new Map,p=new Set;S=S||{x:o.getOptions().domain,y:s.getOptions().domain};for(const m of t){const v=m.attributes["orientation"],[b,x]=(y=v,g=void 0,g="vertical"===y?"y":"x",y="vertical"===y?"x":"y",l?[y,g]:[g,y]),w=""+_+Ye(b)+":filter",M="x"===b,O=o.getOptions()["ratio"],k=s.getOptions()["ratio"],E=t=>{var e,n;return t.data?(e=t.data["selection"],[e=r3(S.x),n=r3(S.y)]=e,M?[qk(o,e,O),qk(s,n,k)]:[qk(s,n,k),qk(o,e,O)]):(n=t.detail["value"],[function(t,e,n){var[t,r]=t;return qk(e,[Vk(e,(n=n?t=>1-t:t=>t)(t),!0),Vk(e,n(r),!1)])}(n,i[b],l&&"horizontal"===v),S[x]])};var g=nn(l=>X(this,void 0,void 0,function*(){var t,e,n,r,i,a,o,s;f||(f=!0,{nativeEvent:t=!0}=l,[e,s]=E(l),S[b]=e,S[x]=s,[n,r,i,a=!1]=[u,{[b]:{domain:e},[x]:{domain:s}},_,P],o=(o=n["marks"]).map(t=>ot({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:[r3(o),r3(s)]}}))),yield h(n),f=!1)}),L,{leading:C,trailing:N}),y=t=>{var e,n=t["nativeEvent"];n||(n=t["data"],t=n["selection"],[t,e]=t,m.dispatchEvent(new ll("valuechange",{data:n,nativeEvent:!1})),n=M?Uk(t,o):Uk(e,s),T(m,n))};c.on(w,y),m.addEventListener("valuechange",g),d.set(m,g),p.add([w,y])}return()=>{for(var[t,e]of d)t.removeEventListener("valuechange",e);for(var[n,r]of p)c.off(n,r)}}}const a3="g2-scrollbar";function o3(o={}){return(t,e,n)=>{var r,{view:i,container:a}=t;return a.getElementsByClassName(a3).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}),i3(Object.assign(Object.assign({},o),{channelDomain:r,className:a3,prefix:"scrollbar",hasState:!0,setValue:(t,e)=>t.setValue(e[0])}))(t,e,n)):()=>{}}}const s3={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 l3(t){return"text"===t.nodeName&&!!t.isOverflowing()}function c3(t){var{offsetX:f=8,offsetY:d=8}=t,r=it(t,["offsetX","offsetY"]);return t=>{const s=t["container"],[l,c]=s.getBounds().min,u=at(r,"tip"),h=new Set,e=t=>{var e,n,r,i,a,o=t["target"];l3(o)?({offsetX:e,offsetY:n}=t,e=e+f-l,n=n+d-c,o.tip?(o.tip.style.x=e,o.tip.style.y=n):(i=o.style["text"],a=new oc({className:"poptip",style:{innerHTML:(r="div",i=i,a=Object.assign(Object.assign({},s3),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,h.add(a))):t.stopPropagation()},n=t=>{var e=t["target"];l3(e)?e.tip&&(e.tip.remove(),e.tip=null,h.delete(e.tip)):t.stopPropagation()};return s.addEventListener("pointerover",e),s.addEventListener("pointerout",n),()=>{s.removeEventListener("pointerover",e),s.removeEventListener("pointerout",n),h.forEach(t=>t.remove())}}}function u3(n){return(t,...e)=>ot({},n(t,...e),t)}function h3(n){return(t,...e)=>ot({},t,n(t,...e))}function f3(t,e){var n;return t?Array.isArray(t)?t:({value:n=e}=t,t=it(t,["value"]),Object.assign(Object.assign({},t),{value:n})):e}const d3=()=>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=it(t,["data","x","y","width","height"]);return Object.assign(Object.assign({},t),{data:f3(e,u),x:null!=n?n:o,y:null!=r?r:s,width:null!=i?i:l,height:null!=a?a:c})})},p3=(d3.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),h=e[s]-i*(n.length-1);var f=r.map(t=>h*(t/u)),d=[];let p=e[o]||0;for(let t=0;t<f.length;t+=1){var g=n[t],y=g["data"],g=it(g,["data"]),y=f3(y,a);d.push(Object.assign({[o]:p,[s]:f[t],[c]:e[c]||0,[l]:e[l],data:y},g)),p+=f[t]+i}return d}),g3=(p3.props={},()=>t=>{var e=t["children"],t=it(t,["children"]);if(!Array.isArray(e))return[];const{data:s,scale:l={},axis:c={},legend:u={},encode:h={},transform:f=[]}=t,n=it(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=it(t,["data","scale","axis","legend","encode","transform"]);return Object.assign({data:f3(e,s),scale:ot({},l,n),encode:ot({},h,a),transform:[...f,...o],axis:!(!r||!c)&&ot({},c,r),legend:!(!i||!u)&&ot({},u,i)},t)});return[Object.assign(Object.assign({},n),{marks:t,type:"standardView"})]}),y3=(g3.props={},({static:C=!1}={})=>t=>{var{width:e,height:n,paddingLeft:r,paddingRight:i,paddingTop:a,paddingBottom:o,padding:s,inset:l,insetLeft:c,insetTop:u,insetRight:h,insetBottom:f,margin:d,marginLeft:p,marginBottom:g,marginTop:y,marginRight:m,data:v,coordinate:b,theme:x,component:w,interaction:M,x:O,y:k,key:E,frame:S,labelTransform:A,parentKey:_,clip:T,viewStyle:P,title:L}=t,t=it(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","labelTransform","parentKey","clip","viewStyle","title"]);return[Object.assign(Object.assign({type:"standardView",x:O,y:k,key:E,width:e,height:n,padding:s,paddingLeft:r,paddingRight:i,paddingTop:a,inset:l,insetLeft:c,insetTop:u,insetRight:h,insetBottom:f,paddingBottom:o,theme:x,coordinate:b,component:w,interaction:M,frame:S,labelTransform:A,margin:d,marginLeft:p,marginBottom:g,marginTop:y,marginRight:m,parentKey:_,clip:T,style:P},!C&&{title:L}),{marks:[Object.assign(Object.assign(Object.assign({},t),{key:E+"-0",data:v}),C&&{title:L})]})]});y3.props={};class m3{constructor(t){this.$value=t}static of(t){return new m3(t)}call(t,...e){return this.$value=t(this.$value,...e),this}value(){return this.$value}}const v3=u3(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=Wd(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"))}}}),b3=u3(t=>{const{data:e,scale:n}=t;var r=[t];let i,a,o;for(;r.length;){const{children:f,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(f)&&r.push(...f)}var t="string"==typeof i?i:"",[u,h]=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)?[Id(u)]:[Array.from(new Set(u)),"ordinal"]);return{encode:{color:i},scale:{color:ot({},a,{domain:u,type:h})},legend:{color:ot({title:t},o)}}}),x3=u3(()=>({animate:{enterType:"fadeIn"}})),w3=h3(()=>({frame:!1,encode:{shape:"hollow"},style:{lineWidth:0}})),M3=h3(()=>({type:"cell"})),O3=h3(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}}]}}}),k3=h3((t,c=function(t){t=t.points;return kv(t)},w=function(a){return(t,e)=>{var{rowIndex:t,rowValuesLength:n,columnIndex:r,columnValuesLength:i}=t;return t!==n-1?E3(a,e):(t=e.length?void 0:null,ot({title:r===i-1&&void 0,grid:t},a))}},M=function(r){return(t,e)=>{var{rowIndex:t,columnIndex:n}=t;return 0!==n?E3(r,e):(n=e.length?void 0:null,ot({title:0===t&&void 0,grid:n},r))}},O={})=>{const{data:e,encode:n,children:u,scale:r,x:k=0,y:E=0,shareData:h=!1,key:S}=t,A=e["value"],{x:_,y:T}=n;t=r.color;const P=t["domain"];return{children:(t,e,n)=>{const{x:r,y:i}=e,{paddingLeft:y,paddingTop:m}=n,a=r.getOptions()["domain"],o=i.getOptions()["domain"];e=pv(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{[_]:t,[T]:e}=t,t=void 0===_||t===n,e=void 0===T||e===r;return t&&e}).map(t=>A.filter(t)),v=h?ip(l,t=>t.length):void 0,b=n.map(([t,e])=>({columnField:_,columnIndex:a.indexOf(t),columnValue:t,columnValuesLength:a.length,rowField:T,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,h,f,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=it(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:_?5:void 0},y:{tickCount:T?5:void 0}},r=r?g:0===g.length?[]:A,l={color:{domain:P}},o={x:S3(o,w)(p,r),y:S3(a,M)(p,r)};return Object.assign(Object.assign({key:n+"-"+c,data:r,x:u+y+k,y:h+m+E,parentKey:S,width:f,height:d,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,frame:!!r.length,dataDomain:v,scale:ot(s,e,l),axis:ot({},i,o),legend:!1},t),O)})})}}});function E3(t,e){return e.length?ot({title:!1,tick:null,label:null},t):ot({title:!1,tick:null,label:null,grid:null},t)}function S3(t,e){return"function"==typeof t?t:null===t||!1===t?()=>null:e(t)}const A3=()=>t=>{return[m3.of(t).call(M3).call(b3).call(x3).call(v3).call(w3).call(O3).call(k3).value()]},_3=(A3.props={},u3(t=>({scale:{x:{guide:null,paddingOuter:0,paddingInner:.1},y:{guide:null,range:[0,1],paddingOuter:0,paddingInner:.1}}}))),T3=h3(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:m,paddingTop:v}=n,a=r.getOptions()["domain"],o=i.getOptions()["domain"];e=pv(t);const s=t.map(({points:t})=>kv(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,h,f,d]=s[c],[p,g]=l[c],y=b[c];return x[c].map(t=>{var n,r,{scale:e,key:i,encode:a,axis:o}=t,t=it(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 E3(r,e)})(y,w),y:("function"==typeof(n=s)?n:null===n?()=>null:(t,e)=>{t=t.columnIndex;if(0!==t)return E3(n,e)})(y,w)};return Object.assign({data:w,parentKey:k,key:i+"-"+c,x:u+m+M,y:h+v+O,width:f,height:d,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,frame:!0,scale:ot({x:{facet:!1},y:{facet:!1}},e),axis:ot({x:{tickCount:5},y:{tickCount:5}},o,l),legend:!1,encode:ot({},a,{x:p,y:g})},t)})})}}}),P3=h3(t=>{var e=t["encode"],t=it(t,["encode"]),{position:n=[],x:r=n,y:i=[...n].reverse()}=e,n=it(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 L3=()=>t=>{return[m3.of(t).call(M3).call(b3).call(T3).call(P3).call(x3).call(w3).call(_3).value()]},C3=u3(t=>({scale:{x:{guide:{type:"axisArc"},paddingOuter:0,paddingInner:.1},y:{guide:null,range:[0,1],paddingOuter:0,paddingInner:.1}}})),N3=u3(t=>({coordinate:{type:"polar"}})),j3=t=>{var e=t["encode"],t=it(t,["encode"]),e=e["position"];return Object.assign(Object.assign({},t),{encode:{x:e}})};function R3(t){return t=>null}function I3(t){var t=t["points"],[t,e,n,r]=t,i=xv(t,r),t=vv(t,r),r=Ov(t,vv(e,n)),e=1/Math.sin(r/2),i=i/(1+e),a=i*Math.sqrt(2),[n,o]=n,t=Mv(t)+r/2,r=i*e;return[n+r*Math.sin(t)-a/2,o+r*Math.cos(t)-a/2,a,a]}const B3=()=>t=>{return[m3.of(t).call(M3).call(j3).call(b3).call(N3).call(O3).call(k3,I3,R3,R3,{frame:!1}).call(x3).call(w3).call(C3).value()]};const D3=()=>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"],h=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=ot({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 h[i]),e=i}t++}var a,o,s}};function F3(t,e){if(null!==t)return{type:"column",value:t,field:e}}function z3(t,e){t=F3(t,e);return Object.assign(Object.assign({},t),{inferred:!0})}function W3(t,e){if(null!==t)return{type:"column",value:t,field:e,visual:!0}}function G3(t,e){var n=[];for(const r of t)n[r]=e;return n}function H3(t,e){var t=t[e];return t?({value:e,field:t=null}=t,[e,t]):[null,null]}function Y3(t,...e){for(const i of e){if("string"!=typeof i)return[i,null];var[n,r]=H3(t,i);if(null!==n)return[n,r]}return[null,null]}function V3(t){return!(t instanceof Date)&&"object"==typeof t}D3.props={};const q3=()=>(t,e)=>{var n=e["encode"],n=n["y1"];return void 0!==n?[t,e]:[t,ot({},e,{encode:{y1:z3(G3(t,0))}})]};function $3(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=H3(r,t))?void 0:t[0]]}).filter(([,t])=>d0(t));return Array.from(Wd(e,e=>i.map(([,t])=>t[e]).join("-")).values())}function U3(t){var a,r;return Array.isArray(t)?(a=t,(i,t,e)=>(n,r)=>a.reduce((t,e)=>0!==t?t:Ad(i[n][e],i[r][e]),0)):"function"==typeof t?(r=t,(e,t,n)=>e4(t=>r(e[t]))):"series"===t?Z3:"value"===t?Q3:"sum"===t?J3:"maxIndex"===t?t4:()=>null}function X3(t,e){for(const n of t)n.sort(e)}function K3(t,e){return(null==e?void 0:e.domain)||Array.from(new Set(t))}function Z3(t,e,n){return e4(t=>n[t])}function Q3(t,e,n){return e4(t=>e[t])}function J3(t,n,e){t=pv(t),t=Array.from(Wd(t,t=>e[+t]).entries());const r=new Map(t.map(([t,e])=>[t,e.reduce((t,e)=>t+ +n[e])]));return e4(t=>r.get(e[t]))}function t4(t,n,e){t=pv(t),t=Array.from(Wd(t,t=>e[+t]).entries());const r=new Map(t.map(([t,e])=>[t,ap(e,t=>n[t])]));return e4(t=>r.get(e[t]))}function e4(n){return(t,e)=>Ad(n(t),n(e))}q3.props={};const n4=(t={})=>{const{groupBy:T="x",orderBy:P=null,reverse:L=!1,y:C="y",y1:N="y1",series:j=!0}=t;return(t,e)=>{var{data:n,encode:r,style:i={}}=e,[a,o]=H3(r,"y"),[s,l]=H3(r,"y1"),[r]=j?Y3(r,"series","color"):H3(r,"color"),c=$3(T,t,e),n=U3(P)(n,a,r),u=(n&&X3(c,n),new Array(t.length)),h=new Array(t.length),f=new Array(t.length),d=[],p=[];for(const E of c){L&&E.reverse();var g=s?+s[E[0]]:0,y=[],m=[];for(const S of E){var v=f[S]=+a[S]-g;v<0?m.push(S):0<=v&&y.push(S)}var b=0<y.length?y:m,x=0<m.length?m:y;let t=y.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 A of m.reverse()){var w=f[A];n=u[A]=(h[A]=n)+w}let r=g;for(const _ of y){var M=f[_];0<M?r=u[_]=(h[_]=r)+M:u[_]=h[_]=r}}const O=new Set(d),k=new Set(p);r="y"===C?u:h,n="y"===N?u:h;return[t,ot({},e,{encode:{y0:z3(a,o),y:F3(r,o),y1:F3(n,l)},style:Object.assign({first:(t,e)=>O.has(e),last:(t,e)=>k.has(e)},i)})]}};function r4(t){t=t.type;return"string"==typeof t&&["stackY","dodgeX","groupX"].includes(t)}n4.props={};const i4=a=>(t,e,n)=>{var{encode:r,transform:i=[]}=e;return i.some(r4)||({x:i,y:r}=r,void 0===i)||void 0===r?[t,e]:(i=a["series"],r=i?["x","series"]:"x",n4({groupBy:r})(t,e,n))},a4=(i4.props={},(t={})=>{const{channel:s="x"}=t;return(t,e)=>{const n=e["encode"];var r=e["tooltip"];if(v0(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=>H3(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,ot({},e,{tooltip:{title:a}})]}}),o4=(a4.props={},()=>(t,e)=>{var n=e["encode"],n=n["x"];return void 0!==n?[t,e]:[t,ot({},e,{encode:{x:z3(G3(t,0))},scale:{x:{guide:null}}})]}),s4=(o4.props={},()=>(t,e)=>{var n=e["encode"],n=n["y"];return void 0!==n?[t,e]:[t,ot({},e,{encode:{y:z3(G3(t,0))},scale:{y:{guide:null}}})]}),l4=(s4.props={},()=>(t,e)=>{var n=e["encode"],n=n["size"];return void 0!==n?[t,e]:[t,ot({},e,{encode:{size:W3(G3(t,3))}})]}),c4=(l4.props={},()=>(t,e)=>{var n=e["encode"],r=n["key"],n=it(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,ot({},e,{encode:{key:F3(r)}})]}),u4=(c4.props={},()=>(t,e)=>{var n=e["encode"],{series:r,color:i}=n;return void 0!==r||void 0===i?[t,e]:([r,i]=H3(n,"color"),[t,ot({},e,{encode:{series:F3(r,i)}})])}),h4=(u4.props={},()=>(t,e)=>{var n=e["data"];return!Array.isArray(n)||n.some(V3)?[t,e]:[t,ot({},e,{encode:{y:F3(n)}})]}),f4=(h4.props={},()=>(t,e)=>{var n=e["data"];return!Array.isArray(n)||n.some(V3)?[t,e]:[t,ot({},e,{encode:{x:F3(n)}})]}),d4=(f4.props={},()=>(t,e)=>{var n=e["encode"],r=n["y1"];return r?[t,e]:([r]=H3(n,"y"),[t,ot({},e,{encode:{y1:F3([...r])}})])}),p4=(d4.props={},()=>(t,e)=>{var n=e["encode"],r=n["x1"];return r?[t,e]:([r]=H3(n,"x"),[t,ot({},e,{encode:{x1:F3([...r])}})])}),g4=(p4.props={},t=>{const i=t["channel"];return(t,e)=>{const{encode:a,tooltip:n}=e;var r;return v0(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,ot({},e,{tooltip:{items:r}})])}}),y4=(g4.props={},()=>(t,e)=>[t,ot({scale:{x:{padding:0},y:{padding:0}}},e)]),m4=(y4.props={},()=>(t,e)=>{var{style:n={}}=e,r=it(e,["data","style"]),{x:i,y:a}=n,n=it(n,["x","y"]);return null==i||null==a?[t,e]:[[0],ot({},r,{data:[0],cartesian:!0,encode:{x:F3([i||0]),y:F3([a||0])},scale:{x:{type:"identity",independent:!0,guide:null},y:{type:"identity",independent:!0,guide:null}},style:n})]}),v4=(m4.props={},()=>(t,e)=>{var{style:n={}}=e;return[t,ot({},e,{style:Object.assign(Object.assign({},n),Object.fromEntries(Object.entries(n).filter(([,t])=>"function"==typeof t).map(([t,e])=>[t,()=>e])))})]}),b4=(v4.props={},()=>(t,e)=>{var n,r=e["data"];return!Array.isArray(r)||r.some(V3)?[t,e]:(n=(r=Array.isArray(r[0])?r:[r]).map(t=>t[0]),r=r.map(t=>t[1]),[t,ot({},e,{encode:{x:F3(n),y:F3(r)}})])}),x4=(b4.props={},()=>(t,e)=>{var{style:n={},encode:r}=e,r=r["series"],n=n["gradient"];return!n||r?[t,e]:[t,ot({},e,{encode:{series:W3(G3(t,void 0))}})]}),w4=(x4.props={},(t={})=>{const{groupBy:c="x",reverse:u=!1,orderBy:h,padding:f}=t;return it(t,["groupBy","reverse","orderBy","padding"]),(t,e)=>{var{data:n,encode:r,scale:i}=e,i=i["series"],[a]=H3(r,"y"),[r]=Y3(r,"series","color"),o=K3(r,i),i=$3(c,t,e),n=U3(h)(n,a,r),s=(n&&X3(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,ot({},e,{scale:{series:{domain:o,paddingInner:f}},encode:{series:F3(s)}})]}}),M4=(w4.props={},t=>{const{groupBy:p=["x"],reducer:g=(t,e)=>e[t[0]],orderBy:y=null,reverse:m=!1,duration:v}=t;return(n,t)=>{const e=t["encode"];var r=(Array.isArray(p)?p:[p]).map(t=>[t,H3(e,t)[0]]);if(0===r.length)return[n,t];let i=[n];for(const[,h]of r){var a=[];for(const n of i){var o=Array.from(Wd(n,t=>h[t]).values());a.push(...o)}i=a}if(y){const[f]=H3(e,y);f&&i.sort((t,e)=>g(t,f)-g(e,f)),m&&i.reverse()}r=(v||3e3)/i.length;const[s]=v?[G3(n,r)]:Y3(e,"enterDuration",G3(n,r));var[l]=Y3(e,"enterDelay",G3(n,0)),c=new Array(n.length);for(let t=0,e=0;t<i.length;t++){const n=i[t];var u=ip(n,t=>+s[t]);for(const d of n)c[d]=+l[d]+e;e+=u}return[n,ot({},t,{encode:{enterDuration:W3(s),enterDelay:W3(c)}})]}});M4.props={};const O4=(t={})=>{const{groupBy:p="x",basis:g="max"}=t;return(e,t)=>{const{encode:n,tooltip:r}=t;var i=it(n,["x"]),a=Object.entries(i).filter(([t])=>t.startsWith("y")).map(([t])=>[t,H3(n,t)[0]]),[,o]=a.find(([t])=>"y"===t),s=a.map(([t])=>[t,new Array(e.length)]),i=$3(p,e,t),l="function"==typeof(f=g)?f:{min:(t,e)=>op(t,t=>e[+t]),max:(t,e)=>ip(t,t=>e[+t]),first:(t,e)=>e[t[0]],last:(t,e)=>e[t[t.length-1]],mean:(t,e)=>fp(t,t=>e[+t]),median:(t,e)=>dp(t,t=>e[+t]),sum:(t,e)=>yp(t,t=>e[+t]),deviation:(t,e)=>Rd(t,t=>e[+t])}[f]||ip;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],[,h]=s[t];h[d]=+u[d]/c}}var f=v0(r)||(null==r?void 0:r.items)&&0!==(null==r?void 0:r.items.length);return[e,ot({},t,Object.assign({encode:Object.fromEntries(s.map(([t,e])=>[t,F3(e,H3(n,t)[1])]))},!f&&n.y0&&{tooltip:{items:[{channel:"y0"}]}}))]}};function k4(t,e,n){return null===t?[-.5,.5]:(t=K3(t,e),[-(e=new Tm({domain:t,range:[0,1],padding:n}).getBandWidth())/2,e/2])}function E4(t,e,n){return e*(1-t)+n*t}O4.props={};const S4=(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]=H3(n,"x"),[n]=H3(n,"y");const o=k4(a,r,l),s=k4(n,i,c);a=t.map(()=>E4(u(),...s)),r=t.map(()=>E4(u(),...o));return[t,ot({scale:{x:{padding:.5},y:{padding:.5}}},e,{encode:{dy:F3(a),dx:F3(r)}})]}},A4=(S4.props={},(t={})=>{const{padding:a=0,random:o=Math.random}=t;return(t,e)=>{var{encode:n,scale:r}=e,r=r["x"],[n]=H3(n,"x");const i=k4(n,r,a);n=t.map(()=>E4(o(),...i));return[t,ot({scale:{x:{padding:.5}}},e,{encode:{dx:F3(n)}})]}}),_4=(A4.props={},(t={})=>{const{groupBy:g="x"}=t;return(e,t)=>{const n=t["encode"];var r=it(n,["x"]);const i=Object.entries(r).filter(([t])=>t.startsWith("y")).map(([t])=>[t,H3(n,t)[0]]);var a=i.map(([t])=>[t,new Array(e.length)]),o=$3(g,e,t),s=new Array(o.length);for(let t=0;t<o.length;t++){const e=o[t];var[l,c]=Id(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 h=u-s[t];const e=o[t];for(const p of e)for(let t=0;t<i.length;t++){var[,f]=i[t],[,d]=a[t];d[p]=+f[p]+h}}return[e,ot({},t,{encode:Object.fromEntries(a.map(([t,e])=>[t,F3(e,H3(n,t)[1])]))})]}}),T4=(_4.props={},(t={})=>{const{groupBy:u="x",series:h=!0}=t;return(t,e)=>{var n=e["encode"];const[r]=H3(n,"y");var[,i]=H3(n,"y1"),n=(h?Y3(n,"series","color"):H3(n,"color"),$3(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,ot({},e,{encode:{y1:F3(a,i)}})]}});function P4(t,e){return[t[0]]}function L4(t,e){return[t[t.length-1]]}function C4(t,e){return[t[ap(t,t=>e[t])]]}function N4(t,e){return[t[sp(t,t=>e[t])]]}T4.props={};const j4=(t={})=>{const{groupBy:a="series",channel:o,selector:s}=t;return(t,e)=>{var n=e["encode"],t=$3(a,t,e);const[r]=H3(n,o),i="function"==typeof(n=s)?n:{first:P4,last:L4,max:C4,min:N4}[n]||P4;return[t.flatMap(t=>i(t,r)),e]}},R4=(j4.props={},(t={})=>{var e=t["selector"],t=it(t,["selector"]);return j4(Object.assign({channel:"x",selector:e},t))}),I4=(R4.props={},(t={})=>{var e=t["selector"],t=it(t,["selector"]);return j4(Object.assign({channel:"y",selector:e},t))});function B4(e){return t=>null===t?e:e+" of "+t}function D4(){return[(t,e)=>fp(t,t=>+e[t]),B4("mean")]}function F4(){return[(t,e)=>dp(t,t=>+e[t]),B4("median")]}function z4(){return[(t,e)=>ip(t,t=>+e[t]),B4("max")]}function W4(){return[(t,e)=>op(t,t=>+e[t]),B4("min")]}function G4(){return[(t,e)=>t.length,B4("count")]}function H4(){return[(t,e)=>yp(t,t=>+e[t]),B4("sum")]}function Y4(){return[(t,e)=>e[t[0]],B4("first")]}function V4(){return[(t,e)=>e[t[t.length-1]],B4("last")]}I4.props={};const q4=(t={})=>{const i=t["groupBy"],a=it(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:D4,max:z4,count:G4,first:Y4,last:V4,sum:H4,min:W4,median:F4}[t];if(e)return e();throw new Error(`Unknown reducer: ${t}.`)}(e),[i,a]=H3(l,t);e=e;var e=(o=a)||((e=e["from"])?([,e]=H3(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=F3(t,o),Object.assign(Object.assign({},t),{constant:!1}))),{aggregate:!0})]}),n=Object.keys(l).map(t=>{const[e,n]=H3(l,t);return[t,F3(c.map(t=>e[t[0]]),n)]}),r=c.map(t=>s[t[0]]);return[pv(c),ot({},e,{data:r,encode:Object.fromEntries([...n,...t])})]}},$4=(q4.props={},(t={})=>{const{channels:n=["x","y"]}=t,e=it(t,["channels"]);return q4(Object.assign(Object.assign({},e),{groupBy:(t,e)=>$3(n,t,e)}))}),U4=($4.props={},(t={})=>$4(Object.assign(Object.assign({},t),{channels:["x","color","series"]}))),X4=(U4.props={},(t={})=>$4(Object.assign(Object.assign({},t),{channels:["y","color","series"]}))),K4=(X4.props={},(t={})=>$4(Object.assign(Object.assign({},t),{channels:["color"]})));function Z4(t,e,n){var{reverse:r,slice:i,channel:a}=n,n=it(n,["reverse","slice","channel"]),{encode:o,scale:s={}}=e,s=null==(s=s[a])?void 0:s.domain;const[l]=H3(o,a);var c,n=function(t,e,n){const{by:r=t,reducer:i="max"}=e,[a]=H3(n,r);if("function"==typeof i)return t=>i(t,a);if("max"===i)return t=>ip(t,t=>+a[t]);if("min"===i)return t=>op(t,t=>+a[t]);if("sum"===i)return t=>yp(t,t=>+a[t]);if("median"===i)return t=>dp(t,t=>+a[t]);if("mean"===i)return t=>fp(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?qd(Hd(s,c,o),([t,e],[n,r])=>Ad(e,r)||Ad(t,n)):qd(Wd(s,o),([t,e],[n,r])=>c(e,r)||Ad(t,n))).map(([t])=>t)),s=(r&&n.reverse(),"number"==typeof i?[0,i]:i),o=i?n.slice(...s):n;return[t,ot(e,{scale:{[a]:{domain:o}}})]}K4.props={};const Q4=(t={})=>{const{reverse:o=!1,slice:s,channel:l,ordinal:c=!0}=t,u=it(t,["reverse","slice","channel","ordinal"]);return(t,e)=>{if(c)return Z4(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]=H3(i,r);return i=qd(t,t=>a[t]),n&&i.reverse(),[i,e]}}},J4=(Q4.props={},(t={})=>Q4(Object.assign(Object.assign({},t),{channel:"x"}))),tA=(J4.props={},(t={})=>Q4(Object.assign(Object.assign({},t),{channel:"color"}))),eA=(tA.props={},(t={})=>Q4(Object.assign(Object.assign({},t),{channel:"y"})));eA.props={};const nA=(t={})=>{const{field:o,channel:s="y",reducer:l="sum"}=t;return(t,e)=>{var{data:n,encode:r}=e;const[i]=H3(r,"x");var a,n=o?(n=n,"string"==typeof(a=o)?n.map(t=>t[a]):n.map(a)):H3(r,s)[0],r=Yd(t,function(e,n){if("function"==typeof e)return t=>e(t,n);if("sum"===e)return t=>yp(t,t=>+n[t]);throw new Error("Unknown reducer: "+e)}(l,n),t=>i[t]).map(t=>t[1]);return[t,ot({},e,{scale:{x:{flex:r}}})]}};function rA(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 h=a-u*c,f=u<=1?0:h/(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]=kv(t),a=e%l,e=Math.floor(e/l),o=a*c,s=(u-e-1)*c+h,r=c/r,i=c/i;return`translate(${o-t+d*a}, ${s-n-f*e-p}) scale(${r}, ${i})`})}nA.props={};const iA=()=>(t,e)=>[t,ot({},e,{modifier:rA,axis:!1})],aA=(iA.props={},"thresholds");function oA(t){var e,[n,r]=Id(t);return Math.min(200,(n=n,r=r,e=jd(t=t),t=Rd(t),e&&t?Math.ceil((r-n)*Math.cbrt(e)/(3.49*t)):1))}const sA=(t={})=>{const{groupChannels:s=["color"],binChannels:l=["x","y"]}=t,c=it(t,["groupChannels","binChannels"]),u={};return q4(Object.assign(Object.assign(Object.assign({},Object.fromEntries(Object.entries(c).filter(([t])=>!t.startsWith(aA)))),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]=H3(n,t);return t}),a=at(c,aA),o=t.filter(e=>i.every(t=>d0(t[e]))),r=[...s.map(t=>{var[t]=H3(n,t);return t}).filter(d0).map(e=>t=>e[t]),...l.map((t,e)=>{const n=i[e];e=a[t]||oA(n),e=rp().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(Wd(o,e=>r.map(t=>t(e)).join("-")).values())}}))},lA=(sA.props={},(t={})=>{var e=t["thresholds"];return sA(Object.assign(Object.assign({},t),{thresholdsX:e,groupChannels:["color"],binChannels:["x"]}))});function cA(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 h=0,f,d;c.push(h);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 y=Math.floor((i+1)*u)+1,m=[s(h),l(h)];for(f=-1;r<y;r++)(o=.5*Math.abs((m[0]-t)*(s(r)-m[1])-(m[0]-l(r))*(e-m[0])))>f&&(f=o,d=r);c.push(d),h=d}return c.push(a-1),c.map(t=>e[t])}function uA(t){if("function"==typeof t)return t;if("lttb"===t)return cA;var e={first:t=>[t[0]],last:t=>[t[t.length-1]],min:(t,e,n)=>[t[sp(t,t=>n[t])]],max:(t,e,n)=>[t[ap(t,t=>n[t])]],median:(t,e,n)=>{return[t[hp(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))}}lA.props={};const hA=(t={})=>{const{strategy:e="median",thresholds:a=2e3,groupBy:o=["series","color"]}=t,s=uA(e);return(t,e)=>{var n=e["encode"],t=$3(o,t,e);const[r]=H3(n,"x"),[i]=H3(n,"y");return[t.flatMap(t=>s(t,r,i,a)),e]}},fA=(hA.props={},(s={})=>(t,e)=>{const{encode:i,data:n}=e,r=Object.entries(s).map(([t,e])=>{const[n]=H3(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(d0);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,ot({},e,{encode:Object.fromEntries(t),data:a.map(t=>n[t])})]});function dA(t){var{min:t,max:e}=t;return[[t[0],t[1]],[e[0],e[1]]]}function pA(t,e){var[t,n]=t,[e,r]=e;return t>=e[0]&&t<=r[0]&&n>=e[1]&&n<=r[1]}fA.props={};const gA=t=>{const n=t["priority"];return t=>{const e=[];return n&&t.sort(n),t.forEach(t=>{SE(t);const i=t.getLocalBounds();e.some(t=>{var e=dA(i),t=dA(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]})?EE(t):e.push(t)}),t}};function yA(){const n=new Map;return[t=>n.get(t),(t,e)=>n.set(t,e)]}const mA=t=>{const{maxIterations:M=10,maxError:O=.1,padding:k=1}=t;return i=>{var e=i.length;if(!(e<=1)){const[g,y]=yA(),[m,v]=yA();var a,o,s,l,[c,t]=yA(),[u,n]=yA();for(const b of i){var{min:r,max:h}=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,h]=h;y(b,g),v(b,g),t(b,h-g),n(b,[x,r])}for(let t=0;t<M;t++){i.sort((t,e)=>Ad(m(t),m(e)));let r=0;for(let n=0;n<e-1;n++){var f=i[n];let t=n+1,e;for(;(e=i[t])&&([[a,o],[s,l]]=[u(f),u(e)],!(a<l&&s<o));)t+=1;if(e){const g=m(f);var d=c(f),p=m(e),d=p-(g+d);d<k&&(d=(k-d)/2,r=Math.max(r,d),v(f,g-d),v(e,p+d))}}if(r<O)break}for(const w of i)w.style.y+=m(w)-g(w)}return i}};function vA(t){t/=255;return t<=.03928?t/12.92:Math.pow((.055+t)/1.055,2.4)}function bA(t,e,n){return.2126*vA(t)+.7152*vA(e)+.0722*vA(n)}function xA(t,e){var{r:t,g:n,b:r}=t,{r:e,g:i,b:a}=e,t=bA(t,n,r),n=bA(e,i,a);return(Math.max(t,n)+.05)/(Math.min(t,n)+.05)}function wA(e,t){return t[ap(t,t=>{return xA(e,"object"==typeof(t=t)?t:ha(t))})]}const MA=t=>{const{threshold:n=4.5,palette:r=["#000","#fff"]}=t;return t=>(t.forEach(t=>{var e=t.attr("dependentElement").parsedStyle.fill;xA(t.parsedStyle.fill,e)<n&&t.attr("fill",wA(e,r))}),t)},OA=()=>t=>(t.forEach(t=>{SE(t);var e=t.attr("bounds");!function(t,e){var[t,n]=t;return!(pA(t,e)&&pA(n,e))}(dA(t.getLocalBounds()),e)||EE(t)}),t);var P=1e-6,kA=1e-12,T=Math.PI,EA=T/2,SA=T/4,AA=2*T,_A=180/T,TA=T/180,PA=Math.abs,LA=Math.atan,CA=Math.atan2,L=Math.cos,NA=Math.ceil,jA=Math.exp,RA=Math.log,IA=Math.pow,N=Math.sin,BA=Math.sign||function(t){return 0<t?1:t<0?-1:0},DA=Math.sqrt,FA=Math.tan;function zA(t){return 1<t?0:t<-1?T:Math.acos(t)}function WA(t){return 1<t?EA:t<-1?-EA:Math.asin(t)}function GA(){}function HA(t,e){t&&VA.hasOwnProperty(t.type)&&VA[t.type](t,e)}var YA={Feature:function(t,e){HA(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r<i;)HA(n[r].geometry,e)}},VA={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){qA(t.coordinates,e,0)},MultiLineString:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)qA(n[r],e,0)},Polygon:function(t,e){$A(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)$A(n[r],e)},GeometryCollection:function(t,e){for(var n=t.geometries,r=-1,i=n.length;++r<i;)HA(n[r],e)}};function qA(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 $A(t,e){var n=-1,r=t.length;for(e.polygonStart();++n<r;)qA(t[n],e,1);e.polygonEnd()}function UA(t,e){t&&YA.hasOwnProperty(t.type)?YA[t.type](t,e):HA(t,e)}function XA(t){return[CA(t[1],t[0]),WA(t[2])]}function KA(t){var e=t[0],t=t[1],n=L(t);return[n*L(e),n*N(e),N(t)]}function ZA(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function QA(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 JA(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function t6(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function e6(t){var e=DA(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function n6(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 r6(t,e){return PA(t)>T&&(t-=Math.round(t/AA)*AA),[t,e]}function i6(t,e,n){return(t%=AA)?e||n?n6(o6(t),s6(e,n)):o6(t):e||n?s6(e,n):r6}function a6(n){return function(t,e){return PA(t+=n)>T&&(t-=Math.round(t/AA)*AA),[t,e]}}function o6(t){var e=a6(t);return e.invert=a6(-t),e}function s6(t,e){var i=L(t),a=N(t),o=L(e),s=N(e);function n(t,e){var n=L(e),r=L(t)*n,t=N(t)*n,n=N(e),e=n*i+r*a;return[CA(t*o-e*s,r*i-n*a),WA(e*o+t*s)]}return n.invert=function(t,e){var n=L(e),r=L(t)*n,t=N(t)*n,n=N(e),e=n*o-t*s;return[CA(t*o+n*s,r*i+e*a),WA(e*i-r*a)]},n}function l6(t,e){(e=KA(e))[0]-=t,e6(e);t=zA(-e[1]);return((-e[2]<0?-t:t)+AA-P)%AA}function c6(){var r,e=[];return{point:function(t,e,n){r.push([t,e,n])},lineStart:function(){e.push(r=[])},lineEnd:GA,rejoin:function(){1<e.length&&e.push(e.pop().concat(e.shift()))},result:function(){var t=e;return e=[],r=null,t}}}function u6(t,e){return PA(t[0]-e[0])<P&&PA(t[1]-e[1])<P}function h6(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 f6(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(u6(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*P}s.push(n=new h6(r,t,null,!0)),l.push(n.o=new h6(r,null,n,!1)),s.push(n=new h6(i,t,null,!1)),l.push(n.o=new h6(i,null,n,!0))}}),s.length){for(l.sort(e),d6(s),d6(l),o=0,i=l.length;o<i;++o)l[o].e=n=!n;for(var c,u,h=s[0];;){for(var f=h,d=!0;f.v;)if((f=f.n)===h)return;c=f.z,a.lineStart();do{if(f.v=f.o.v=!0,f.e){if(d)for(o=0,i=c.length;o<i;++o)a.point((u=c[o])[0],u[1]);else r(f.x,f.n.x,1,a);f=f.n}else{if(d)for(c=f.p.z,o=c.length-1;0<=o;--o)a.point((u=c[o])[0],u[1]);else r(f.x,f.p.x,-1,a);f=f.p}}while(c=(f=f.o).z,d=!d,!f.v);a.lineEnd()}}}function d6(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 p6(t){return PA(t[0])<=T?t[0]:BA(t[0])*((PA(t[0])+T)%AA-T)}function g6(y,m,v,b){return function(s){var l,c,u,n=m(s),h=c6(),f=m(h),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=pp(c);var t=function(t,e){var n=p6(e),r=e[1],e=N(r),i=[N(n),-L(n),0],a=0,o=0,s=new Bd;1===e?r=EA+P:-1===e&&(r=-EA-P);for(var l=0,c=t.length;l<c;++l)if(h=(u=t[l]).length)for(var u,h,f=u[h-1],d=p6(f),p=f[1]/2+SA,g=N(p),y=L(p),m=0;m<h;++m,d=b,g=w,y=x,f=v){var v=u[m],b=p6(v),x=v[1]/2+SA,w=N(x),x=L(x),M=b-d,O=0<=M?1:-1,k=O*M,E=T<k,S=g*w;s.add(CA(S*O*N(k),y*x+S*L(k))),a+=E?M+O*AA:M,E^n<=d^n<=b&&(e6(S=QA(KA(f),KA(v))),e6(k=QA(i,S)),(O=(E^0<=M?-1:1)*WA(k[2]))<r||r===O&&(S[0]||S[1]))&&(o+=E^0<=M?1:-1)}return(a<-P||a<P&&s<-kA)^1&o}(l,b);c.length?(d||(s.polygonStart(),d=!0),f6(c,m6,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){y(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]),f.point(t,e)}function o(){f.lineStart(),u=[]}function g(){p(u[0][0],u[0][1]),f.lineEnd();var t,e,n,r,i=f.clean(),a=h.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(y6))}return e}}function y6(t){return 1<t.length}function m6(t,e){return((t=t.x)[0]<0?t[1]-EA-P:EA-t[1])-((e=e.x)[0]<0?e[1]-EA-P:EA-e[1])}r6.invert=r6;var v6=g6(function(){return 1},function(c){var u,h=NaN,f=NaN,d=NaN;return{lineStart:function(){c.lineStart(),u=1},point:function(t,e){var n,r,i,a,o,s=0<t?T:-T,l=PA(t-h);PA(l-T)<P?(c.point(h,f=0<(f+e)/2?EA:-EA),c.point(d,f),c.lineEnd(),c.lineStart(),c.point(s,f),c.point(t,f),u=0):d!==s&&T<=l&&(PA(h-d)<P&&(h-=d*P),PA(t-s)<P&&(t-=s*P),l=f,i=e,o=N((n=h)-(r=t)),f=PA(o)>P?LA((N(l)*(a=L(i))*N(r)-N(i)*(r=L(l))*N(n))/(r*a*o)):(l+i)/2,c.point(d,f),c.lineEnd(),c.lineStart(),c.point(s,f),u=0),c.point(h=t,f=e),d=s},lineEnd:function(){c.lineEnd(),h=f=NaN},clean:function(){return 2-u}}},function(t,e,n,r){var i;null==t?(i=n*EA,r.point(-T,i),r.point(0,i),r.point(T,i),r.point(T,0),r.point(T,-i),r.point(0,-i),r.point(-T,-i),r.point(-T,0),r.point(-T,i)):PA(t[0]-e[0])>P?(t=t[0]<e[0]?T:-T,i=n*t/2,r.point(-t,i),r.point(0,i),r.point(t,i)):r.point(e[0],e[1])},[-T,-EA]);function b6(d){var g=L(d),p=6*TA,h=0<g,f=PA(g)>P;function y(t,e){return L(t)*L(e)>g}function m(t,e,n){var r,i,a,o,s,l,c,u=[1,0,0],h=QA(KA(t),KA(e)),f=ZA(h,h),d=h[0],p=f-d*d;return p?(r=QA(u,h),JA(u=t6(u,g*f/p),t6(h,-g*d/p)),(p=(h=ZA(u,f=r))*h-(d=ZA(f,f))*(ZA(u,u)-1))<0?void 0:(JA(p=t6(f,(-h-(r=DA(p)))/d),u),p=XA(p),n?(i=t[0],a=e[0],o=t[1],e=e[1],a<i&&(c=i,i=a,a=c),!(l=PA((s=a-i)-T)<P)&&e<o&&(c=o,o=e,e=c),(l||s<P?l?0<o+e^p[1]<(PA(p[0]-i)<P?o:e):o<=p[1]&&p[1]<=e:T<s^(i<=p[0]&&p[0]<=a))?(JA(c=t6(f,(-h+r)/d),u),[p,XA(c)]):void 0):p)):!n&&t}function v(t,e){var n=h?d:T-d,r=0;return t<-n?r|=1:n<t&&(r|=2),e<-n?r|=4:n<e&&(r|=8),r}return g6(y,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=y(t,e),t=h?i?0:v(t,e):i?v(t+(t<0?T:-T),e):0;!o&&(c=l=i)&&a.lineStart(),i===l||(n=m(o,r))&&!u6(o,n)&&!u6(r,n)||(r[2]=1),i!==l?(u=0,i?(a.lineStart(),n=m(r,o),a.point(n[0],n[1])):(n=m(o,r),a.point(n[0],n[1],2),a.lineEnd()),o=n):f&&o&&h^i&&(t&s||!(e=m(r,o,!0))||(u=0,h?(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&&u6(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=L(r),c=N(r),u=o*a;null==n?(n=r+o*AA,s=r-u/2):(n=l6(l,n),s=l6(l,s),(0<o?n<s:s<n)&&(n+=o*AA));for(var h,f=n;0<o?s<f:f<s;f-=u)h=XA([l,-c*L(f),-c*N(f)]),i.point(h[0],h[1])}},h?[0,-d]:[-T,d-T])}var x6=1e9,w6=-x6;function M6(m,v,b,x){function w(t,e){return m<=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?m:b,1<i?x:v),(i=(i+n+4)%4)!==a;);else r.point(e[0],e[1])}function o(t,e){return PA(t[0]-m)<P?0<e?0:3:PA(t[0]-b)<P?0<e?2:1:PA(t[1]-v)<P?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,h,a,o,s,l,c,u,f,d,p,g=r,t=c6(),e={point:n,lineStart:function(){e.point=y,h&&h.push(a=[]);d=!0,f=!1,c=u=NaN},lineEnd:function(){i&&(y(o,s),l&&f&&t.rejoin(),i.push(t.result()));e.point=n,f&&g.lineEnd()},polygonStart:function(){g=t,i=[],h=[],p=!0},polygonEnd:function(){var t=function(){for(var t=0,e=0,n=h.length;e<n;++e)for(var r,i,a=h[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)*(m-r)<(c-r)*(x-i)&&++t:u<=x&&(c-r)*(x-i)<(u-i)*(m-r)&&--t;return t}(),e=p&&t,n=(i=pp(i)).length;(e||n)&&(r.polygonStart(),e&&(r.lineStart(),M(null,null,1,r),r.lineEnd()),n&&f6(i,O,t,M,r),r.polygonEnd());g=r,i=h=a=null}};function n(t,e){w(t,e)&&g.point(t,e)}function y(t,e){var n,r,i=w(t,e);h&&a.push([t,e]),d?(o=t,s=e,d=!1,(l=i)&&(g.lineStart(),g.point(t,e))):i&&f?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,h=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,h||!(0<n)){if(n/=h,h<0){if(n<l)return;n<c&&(c=n)}else if(0<h){if(c<n)return;l<n&&(l=n)}if(n=a-s,h||!(n<0)){if(n/=h,h<0){if(c<n)return;l<n&&(l=n)}else if(0<h){if(n<l)return;n<c&&(c=n)}return 0<l&&(t[0]=o+l*u,t[1]=s+l*h),c<1&&(e[0]=o+c*u,e[1]=s+c*h),1}}}}}(n=[c=Math.max(w6,Math.min(x6,c)),u=Math.max(w6,Math.min(x6,u))],r=[t=Math.max(w6,Math.min(x6,t)),e=Math.max(w6,Math.min(x6,e))],m,v,b,x)?i&&(g.lineStart(),g.point(t,e),p=!1):(f||(g.lineStart(),g.point(n[0],n[1])),g.point(r[0],r[1]),i||g.lineEnd(),p=!1),c=t,u=e,f=i}return e}}function O6(t,e,n){var r=gp(t,e-P,n).concat(e);return function(e){return r.map(function(t){return[e,t]})}}function k6(t,e,n){var r=gp(t,e-P,n).concat(e);return function(e){return r.map(function(t){return[t,e]})}}function E6(){return g=p=10,y=90,m=360,v=2.5,e.lines=function(){return t().map(function(t){return{type:"LineString",coordinates:t}})},e.outline=function(){return{type:"Polygon",coordinates:[f(a).concat(d(l).slice(1),f(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?(y=+t[0],m=+t[1],e):[y,m]},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=O6(s,o,90),h=k6(r,n,v),f=O6(c,l,90),d=k6(a,i,v),e):v},e.extentMajor([[-180,-90+P],[180,90-P]]).extentMinor([[-180,-80-P],[180,80+P]])();function e(){return{type:"MultiLineString",coordinates:t()}}function t(){return gp(NA(a/y)*y,i,y).map(f).concat(gp(NA(c/m)*m,l,m).map(d)).concat(gp(NA(r/p)*p,n,p).filter(function(t){return PA(t%y)>P}).map(u)).concat(gp(NA(s/g)*g,o,g).filter(function(t){return PA(t%m)>P}).map(h))}var n,r,i,a,o,s,l,c,u,h,f,d,p,g,y,m,v}var S6,A6,_6,T6,P6=t=>t,L6=new Bd,C6=new Bd,N6={point:GA,lineStart:GA,lineEnd:GA,polygonStart:function(){N6.lineStart=j6,N6.lineEnd=B6},polygonEnd:function(){N6.lineStart=N6.lineEnd=N6.point=GA,L6.add(PA(C6)),C6=new Bd},result:function(){var t=L6/2;return L6=new Bd,t}};function j6(){N6.point=R6}function R6(t,e){N6.point=I6,S6=_6=t,A6=T6=e}function I6(t,e){C6.add(T6*t-_6*e),_6=t,T6=e}function B6(){I6(S6,A6)}var D6=N6,F6=1/0,z6=F6,W6=-F6,G6=W6;var H6,Y6,V6,q6,$6={point:function(t,e){t<F6&&(F6=t);W6<t&&(W6=t);e<z6&&(z6=e);G6<e&&(G6=e)},lineStart:GA,lineEnd:GA,polygonStart:GA,polygonEnd:GA,result:function(){var t=[[F6,z6],[W6,G6]];return W6=G6=-(z6=F6=1/0),t}},U6=0,X6=0,K6=0,Z6=0,Q6=0,J6=0,t_=0,e_=0,n_=0,r_={point:i_,lineStart:a_,lineEnd:l_,polygonStart:function(){r_.lineStart=c_,r_.lineEnd=u_},polygonEnd:function(){r_.point=i_,r_.lineStart=a_,r_.lineEnd=l_},result:function(){var t=n_?[t_/n_,e_/n_]:J6?[Z6/J6,Q6/J6]:K6?[U6/K6,X6/K6]:[NaN,NaN];return U6=X6=K6=Z6=Q6=J6=t_=e_=n_=0,t}};function i_(t,e){U6+=t,X6+=e,++K6}function a_(){r_.point=o_}function o_(t,e){r_.point=s_,i_(V6=t,q6=e)}function s_(t,e){var n=t-V6,r=e-q6,n=DA(n*n+r*r);Z6+=n*(V6+t)/2,Q6+=n*(q6+e)/2,J6+=n,i_(V6=t,q6=e)}function l_(){r_.point=i_}function c_(){r_.point=h_}function u_(){f_(H6,Y6)}function h_(t,e){r_.point=f_,i_(H6=V6=t,Y6=q6=e)}function f_(t,e){var n=t-V6,r=e-q6,n=DA(n*n+r*r);Z6+=n*(V6+t)/2,Q6+=n*(q6+e)/2,J6+=n,t_+=(n=q6*t-V6*e)*(V6+t),e_+=n*(q6+e),n_+=3*n,i_(V6=t,q6=e)}var d_=r_;function p_(t){this._context=t}p_.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,AA)}},result:GA};var g_,y_,m_,v_,b_,x_=new Bd,w_={point:GA,lineStart:function(){w_.point=M_},lineEnd:function(){g_&&O_(y_,m_),w_.point=GA},polygonStart:function(){g_=!0},polygonEnd:function(){g_=null},result:function(){var t=+x_;return x_=new Bd,t}};function M_(t,e){w_.point=O_,y_=v_=t,m_=b_=e}function O_(t,e){v_-=t,b_-=e,x_.add(DA(v_*v_+b_*b_)),v_=t,b_=e}var k_=w_;let E_,S_,A_,__;class T_{constructor(t){this._append=null==t?P_:function(t){var e=Math.floor(t);if(!(0<=e))throw new RangeError("invalid digits: "+t);if(15<e)return P_;if(e!==E_){const r=10**e;E_=e,S_=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 S_}(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===A_&&this._append===S_||(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`,A_=n,S_=this._append,__=this._,this._=r),this._+=__}}result(){var t=this._;return this._="",t.length?t:null}}function P_(t){let e=1;this._+=t[0];for(var n=t.length;e<n;++e)this._+=arguments[e]+t[e]}function L_(e,n){let r=3,i=4.5,a,o;function s(t){return t&&("function"==typeof i&&o.pointRadius(+i.apply(this,arguments)),UA(t,a(o))),o.result()}return s.area=function(t){return UA(t,a(D6)),D6.result()},s.measure=function(t){return UA(t,a(k_)),k_.result()},s.bounds=function(t){return UA(t,a($6)),$6.result()},s.centroid=function(t){return UA(t,a(d_)),d_.result()},s.projection=function(t){return arguments.length?(a=null==t?(e=null,P6):(e=t).stream,s):e},s.context=function(t){return arguments.length?(o=null==t?(n=null,new T_(r)):new p_(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 T_(r)),s},s.projection(e).digits(r).context(n)}function C_(r){return function(t){var e,n=new N_;for(e in r)n[e]=r[e];return n.stream=t,n}}function N_(){}function j_(t,e,n){var r=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=r&&t.clipExtent(null),UA(n,t.stream($6)),e($6.result()),null!=r&&t.clipExtent(r),t}function R_(i,a,t){return j_(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 I_(t,e,n){return R_(t,[[0,0],e],n)}function B_(r,i,t){return j_(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 D_(i,a,t){return j_(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)}N_.prototype={constructor:N_,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 F_=16,z_=L(30*TA);function W_(t,e){return+e?(A=t,_=e,function(r){var n,i,a,o,s,l,c,u,h,f,d,p,g={point:t,lineStart:e,lineEnd:m,polygonStart:function(){r.polygonStart(),g.lineStart=v},polygonEnd:function(){r.polygonEnd(),g.lineStart=e}};function t(t,e){t=A(t,e),r.point(t[0],t[1])}function e(){u=NaN,g.point=y,r.lineStart()}function y(t,e){var n=KA([t,e]),e=A(t,e);T(u,h,c,f,d,p,u=e[0],h=e[1],c=t,f=n[0],d=n[1],p=n[2],F_,r),r.point(u,h)}function m(){g.point=t,r.lineEnd()}function v(){e(),g.point=b,g.lineEnd=x}function b(t,e){y(n=t,e),i=u,a=h,o=f,s=d,l=p,g.point=y}function x(){T(u,h,c,f,d,p,i,a,n,o,s,l,F_,r),g.lineEnd=m,m()}return g}):(n=t,C_({point:function(t,e){t=n(t,e),this.stream.point(t[0],t[1])}}));var n,A,_;function T(t,e,n,r,i,a,o,s,l,c,u,h,f,d){var p,g,y,m,v,b,x,w,M,O,k=o-t,E=s-e,S=k*k+E*E;4*_<S&&f--&&(y=a+h,x=WA(y/=m=DA((p=r+c)*p+(g=i+u)*g+y*y)),v=PA(PA(y)-1)<P||PA(n-l)<P?(n+l)/2:CA(g,p),b=(x=A(v,x))[0],x=x[1],_<(O=E*(w=b-t)-k*(M=x-e))*O/S||.3<PA((k*w+E*M)/S-.5)||r*c+i*u+a*h<z_)&&(T(t,e,n,r,i,a,b,x,v,p/=m,g/=m,y,f,d),d.point(b,x),T(b,x,v,p,g,y,o,s,l,c,u,h,f,d))}}var G_=C_({point:function(t,e){this.stream.point(t*TA,e*TA)}});function H_(t,n,r,i,a,e){var o,s,l,c,u,h,f,d,p,g,y,m;return e?(h=L(e),e=N(e),f=h*t,d=e*t,p=h/t,g=e/t,y=(e*r-h*n)/t,m=(e*n+h*r)/t,b.invert=function(t,e){return[i*(p*t-g*e+y),a*(m-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[f*(t*=i)-d*(e*=a)+n,r-d*t-f*e]}}function Y_(t){return V_(function(){return t})()}function V_(t){var e,r,n,i,a,o,s,l,c,u,h=150,f=480,d=250,p=0,g=0,y=0,m=0,v=0,b=0,x=1,w=1,M=null,O=v6,k=null,E=P6,S=.5;function A(t){return l(t[0]*TA,t[1]*TA)}function _(t){return(t=l.invert(t[0],t[1]))&&[t[0]*_A,t[1]*_A]}function T(){var t=H_(h,0,0,x,w,b).apply(null,e(p,g)),t=H_(h,f-t[0],d-t[1],x,w,b);return r=i6(y,m,v),s=n6(e,t),l=n6(r,s),o=W_(s,S),P()}function P(){return c=u=null,A}return A.stream=function(t){return c&&u===t?c:c=G_((n=r,C_({point:function(t,e){t=n(t,e);return this.stream.point(t[0],t[1])}})(O(o(E(u=t))))));var n},A.preclip=function(t){return arguments.length?(O=t,M=void 0,P()):O},A.postclip=function(t){return arguments.length?(E=t,k=n=i=a=null,P()):E},A.clipAngle=function(t){return arguments.length?(O=+t?b6(M=t*TA):(M=null,v6),P()):M*_A},A.clipExtent=function(t){return arguments.length?(E=null==t?(k=n=i=a=null,P6):M6(k=+t[0][0],n=+t[0][1],i=+t[1][0],a=+t[1][1]),P()):null==k?null:[[k,n],[i,a]]},A.scale=function(t){return arguments.length?(h=+t,T()):h},A.translate=function(t){return arguments.length?(f=+t[0],d=+t[1],T()):[f,d]},A.center=function(t){return arguments.length?(p=t[0]%360*TA,g=t[1]%360*TA,T()):[p*_A,g*_A]},A.rotate=function(t){return arguments.length?(y=t[0]%360*TA,m=t[1]%360*TA,v=2<t.length?t[2]%360*TA:0,T()):[y*_A,m*_A,v*_A]},A.angle=function(t){return arguments.length?(b=t%360*TA,T()):b*_A},A.reflectX=function(t){return arguments.length?(x=t?-1:1,T()):x<0},A.reflectY=function(t){return arguments.length?(w=t?-1:1,T()):w<0},A.precision=function(t){return arguments.length?(o=W_(s,S=t*t),P()):DA(S)},A.fitExtent=function(t,e){return R_(A,t,e)},A.fitSize=function(t,e){return I_(A,t,e)},A.fitWidth=function(t,e){return B_(A,t,e)},A.fitHeight=function(t,e){return D_(A,t,e)},function(){return e=t.apply(this,arguments),A.invert=e.invert&&_,T()}}function q_(t){var e=0,n=T/3,r=V_(t),t=r(e,n);return t.parallels=function(t){return arguments.length?r(e=t[0]*TA,n=t[1]*TA):[e*_A,n*_A]},t}function $_(t,e){var n,r,i,a=N(t),o=(a+N(e))/2;return PA(o)<P?(n=L(t),s.invert=function(t,e){return[t/n,WA(e*n)]},s):(i=DA(r=1+a*(2*o-a))/o,l.invert=function(t,e){var e=i-e,n=CA(t,PA(e))*BA(e);return e*o<0&&(n-=T*BA(t)*BA(e)),[n/o,WA((r-(t*t+e*e)*o*o)/(2*o))]},l);function s(t,e){return[t*n,N(e)/n]}function l(t,e){e=DA(r-2*o*N(e))/o;return[e*N(t*=o),i-e*L(t)]}}function U_(){return q_($_).scale(155.424).center([0,33.6442])}function X_(){return U_().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function K_(i){return function(t,e){var n=L(t),r=L(e),n=i(n*r);return n===1/0?[2,0]:[n*r*N(t),n*N(e)]}}function Z_(a){return function(t,e){var n=DA(t*t+e*e),r=a(n),i=N(r),r=L(r);return[CA(t*i,n*r),WA(n&&e*i/n)]}}var Q_=K_(function(t){return DA(2/(1+t))});Q_.invert=Z_(function(t){return 2*WA(t/2)});var J_=K_(function(t){return(t=zA(t))&&t/N(t)});function tT(t,e){return[t,RA(FA((EA+e)/2))]}function eT(r){var i,a,o,s=Y_(r),e=s.center,l=s.scale,n=s.translate,c=s.clipExtent,u=null;function h(){var e,t=T*l(),n=s((e=i6((e=s.rotate())[0]*TA,e[1]*TA,2<e.length?e[2]*TA:0),function(t){return(t=e.invert(t[0]*TA,t[1]*TA))[0]*=_A,t[1]*=_A,t}([0,0])));return c(null==u?[[n[0]-t,n[1]-t],[n[0]+t,n[1]+t]]:r===tT?[[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),h):l)()},s.translate=function(t){return(arguments.length?(n(t),h):n)()},s.center=function(t){return(arguments.length?(e(t),h):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]),h()):null==u?null:[[u,i],[a,o]]},h()}function nT(t){return FA((EA+t)/2)}function rT(t,e){var n=L(t),i=t===e?N(t):RA(n/L(e))/RA(nT(e)/nT(t)),a=n*IA(nT(t),i)/i;return i?(r.invert=function(t,e){var e=a-e,n=BA(i)*DA(t*t+e*e),r=CA(t,PA(e))*BA(e);return e*i<0&&(r-=T*BA(t)*BA(e)),[r/i,2*LA(IA(a/n,1/i))-EA]},r):tT;function r(t,e){0<a?e<-EA+P&&(e=-EA+P):EA-P<e&&(e=EA-P);e=a/IA(nT(e),i);return[e*N(i*t),a-e*L(i*t)]}}function iT(t,e){return[t,e]}function aT(t,e){var n=L(t),r=t===e?N(t):(n-L(e))/(e-t),i=n/r+t;return PA(r)<P?iT:(a.invert=function(t,e){var e=i-e,n=CA(t,PA(e))*BA(e);return e*r<0&&(n-=T*BA(t)*BA(e)),[n/r,i-BA(r)*DA(t*t+e*e)]},a);function a(t,e){e=i-e,t*=r;return[e*N(t),i-e*L(t)]}}J_.invert=Z_(function(t){return t}),tT.invert=function(t,e){return[t,2*LA(jA(e))-EA]},iT.invert=iT;var oT=1.340264,sT=-.081106,lT=893e-6,cT=.003796,uT=DA(3)/2;function hT(t,e){var e=WA(uT*N(e)),n=e*e,r=n*n*n;return[t*L(e)/(uT*(oT+3*sT*n+r*(7*lT+9*cT*n))),e*(oT+sT*n+r*(lT+cT*n))]}function fT(t,e){var n=L(e),r=L(t)*n;return[n*N(t)/r,N(e)/r]}function dT(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 pT(t,e){return[L(e)*N(t),N(e)]}function gT(t,e){var n=L(e),r=1+L(t)*n;return[n*N(t)/r,N(e)/r]}function yT(t,e){return[RA(FA((EA+e)/2)),-t]}hT.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*(oT+sT*i+a*(lT+cT*i))-e)/(oT+3*sT*i+a*(7*lT+9*cT*i)))*r)*i*i,!(PA(n)<kA));++o);return[uT*t*(oT+3*sT*i+a*(7*lT+9*cT*i))/L(r),WA(N(r)/uT)]},fT.invert=Z_(LA),dT.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))),PA(a)>P&&0<--r);return[t/(.8707+(i=n*n)*(i*(i*i*i*(.003971-.001529*i)-.013791)-.131979)),n]},pT.invert=Z_(WA),gT.invert=Z_(function(t){return 2*LA(t)}),yT.invert=function(t,e){return[-e,2*LA(jA(t))-EA]};var mT=Object.freeze({__proto__:null,geoAlbersUsa:function(){var e,n,i,a,o,r,s=X_(),l=U_().rotate([154,0]).center([-2,58.5]).parallels([55,65]),c=U_().rotate([157,0]).center([-3,19.9]).parallels([8,18]),u={point:function(t,e){r=[t,e]}};function h(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 f(){return e=n=null,h}return h.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)},h.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},h.precision=function(t){return arguments.length?(s.precision(t),l.precision(t),c.precision(t),f()):s.precision()},h.scale=function(t){return arguments.length?(s.scale(t),l.scale(.35*t),c.scale(t),h.translate(s.translate())):s.scale()},h.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+P,r+.12*e+P],[n-.214*e-P,r+.234*e-P]]).stream(u),o=c.translate([n-.205*e,r+.212*e]).clipExtent([[n-.214*e+P,r+.166*e+P],[n-.115*e-P,r+.234*e-P]]).stream(u),f()):s.translate()},h.fitExtent=function(t,e){return R_(h,t,e)},h.fitSize=function(t,e){return I_(h,t,e)},h.fitWidth=function(t,e){return B_(h,t,e)},h.fitHeight=function(t,e){return D_(h,t,e)},h.scale(1070)},geoAlbers:X_,geoAzimuthalEqualArea:function(){return Y_(Q_).scale(124.75).clipAngle(179.999)},geoAzimuthalEqualAreaRaw:Q_,geoAzimuthalEquidistant:function(){return Y_(J_).scale(79.4188).clipAngle(179.999)},geoAzimuthalEquidistantRaw:J_,geoConicConformal:function(){return q_(rT).scale(109.5).parallels([30,30])},geoConicConformalRaw:rT,geoConicEqualArea:U_,geoConicEqualAreaRaw:$_,geoConicEquidistant:function(){return q_(aT).scale(131.154).center([0,13.9389])},geoConicEquidistantRaw:aT,geoEqualEarth:function(){return Y_(hT).scale(177.158)},geoEqualEarthRaw:hT,geoEquirectangular:function(){return Y_(iT).scale(152.63)},geoEquirectangularRaw:iT,geoGnomonic:function(){return Y_(fT).scale(144.049).clipAngle(60)},geoGnomonicRaw:fT,geoIdentity:function(){var r,i,e,n,a,o,s,l=1,c=0,u=0,h=1,f=1,d=0,p=null,g=1,y=1,m=C_({point:function(t,e){t=x([t,e]);this.stream.point(t[0],t[1])}}),v=P6;function b(){return g=l*h,y=l*f,o=s=null,x}function x(t){var e,n=t[0]*g,t=t[1]*y;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/y]},x.stream=function(t){return o&&s===t?o:o=m(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,P6):M6(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=N(d=t%360*TA),r=L(d),b()):d*_A},x.reflectX=function(t){return arguments.length?(h=t?-1:1,b()):h<0},x.reflectY=function(t){return arguments.length?(f=t?-1:1,b()):f<0},x.fitExtent=function(t,e){return R_(x,t,e)},x.fitSize=function(t,e){return I_(x,t,e)},x.fitWidth=function(t,e){return B_(x,t,e)},x.fitHeight=function(t,e){return D_(x,t,e)},x},geoProjection:Y_,geoProjectionMutator:V_,geoMercator:function(){return eT(tT).scale(961/AA)},geoMercatorRaw:tT,geoNaturalEarth1:function(){return Y_(dT).scale(175.295)},geoNaturalEarth1Raw:dT,geoOrthographic:function(){return Y_(pT).scale(249.5).clipAngle(90+P)},geoOrthographicRaw:pT,geoStereographic:function(){return Y_(gT).scale(250).clipAngle(142)},geoStereographicRaw:gT,geoTransverseMercator:function(){var t=eT(yT),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:yT});function vT(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 bT(t,e,n,r){var i,a,o,s,l,c,{outline:e=(e=e.filter(wT),e.find(t=>t.sphere)?{type:"Sphere"}:vT(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]]=L_(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 xT(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:[E6()]}}):"sphere"===e?Object.assign(Object.assign({},t),{sphere:!0,data:{value:[{type:"Sphere"}]}}):t)}function wT(t){return"geoPath"===t.type}n=()=>t=>{var{children:e,coordinate:n={}}=t;if(!Array.isArray(e))return[];const{type:r="equalEarth"}=n,f=it(n,["type"]),d=function(t){if("function"==typeof t)return t;var e="geo"+Ye(t);if(e=mT[e])return e;throw new Error("Unknown coordinate: "+t)}(r),p=e.map(xT);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=(bT(i,p,l,f),i),l=f;for([o,s]of Object.entries(l))null!=(a=c[o])&&a.call(c,s);g=L_(i);const u=new Wm({domain:[t,t+n]}),h=new Wm({domain:[e,e+r]});return{transform:t=>{return t=t,(t=i(t))?([t,e]=t,[u.map(t),h.map(e)]):null;var e},untransform:t=>{return(t=t)?([t,e]=t,t=[u.invert(t),h.invert(e)],i.invert(t)):null;var e}}}]]}},children:p.flatMap(t=>{var e,n,r;return wT(t)?({style:n,tooltip:r={}}=e=t,Object.assign(Object.assign({},e),{type:"path",tooltip:x0(r,{title:"id",items:[{channel:"color"}]}),style:Object.assign(Object.assign({},n),{d:t=>g(t)||[]})})):t})})]},n.props={},xl=()=>t=>{var{data:e,scale:n,encode:r,style:i,animate:a,key:o,state:s}=t,t=it(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}]})]};xl.props={};const MT={"composition.geoView":n,"composition.geoPath":xl};function OT(){return Object.assign({"data.fetch":i1,"data.inline":h1,"data.sortBy":u1,"data.sort":s1,"data.filter":o1,"data.pick":l1,"data.rename":c1,"data.fold":a1,"data.slice":z1,"data.custom":f1,"data.map":d1,"data.cluster":Fg,"data.tree":zg,"data.sankey":s0,"data.arc":m1,"data.wordCloud":B1,"data.join":F1,"data.kde":$1,"data.venn":dy,"transform.maybeZeroY1":q3,"transform.maybeZeroX":o4,"transform.maybeStackY":i4,"transform.maybeTitle":a4,"transform.maybeSeries":u4,"transform.maybeZeroPadding":y4,"transform.stackY":n4,"transform.binX":lA,"transform.bin":sA,"transform.dodgeX":w4,"transform.jitter":S4,"transform.jitterX":A4,"transform.symmetryY":_4,"transform.diffY":T4,"transform.stackEnter":M4,"transform.normalizeY":O4,"transform.select":j4,"transform.selectX":R4,"transform.selectY":I4,"transform.groupX":U4,"transform.groupY":X4,"transform.groupColor":K4,"transform.group":$4,"transform.maybeSize":l4,"transform.maybeZeroY":s4,"transform.maybeKey":c4,"transform.sortX":J4,"transform.sortY":eA,"transform.sortColor":tA,"transform.flexX":nA,"transform.maybeTupleY":h4,"transform.maybeTupleX":f4,"transform.maybeIdentityY":d4,"transform.maybeIdentityX":p4,"transform.maybeTuple":b4,"transform.maybeVisualPosition":m4,"transform.maybeFunctionAttribute":v4,"transform.maybeGradient":x4,"transform.maybeTooltip":g4,"transform.pack":iA,"transform.sample":hA,"transform.filter":fA,"coordinate.cartesian":Xh,"coordinate.polar":Zh,"coordinate.helix":Qh,"coordinate.transpose":Jh,"coordinate.theta":tf,"coordinate.parallel":rf,"coordinate.fisheye":af,"coordinate.radial":nf,"coordinate.radar":of,"encode.constant":sf,"encode.field":cf,"encode.transform":lf,"encode.column":uf,"mark.interval":Ed,"mark.rect":Sd,"mark.line":_p,"mark.point":Tp,"mark.text":Pp,"mark.cell":Lp,"mark.area":Cp,"mark.link":Np,"mark.image":jp,"mark.polygon":Rp,"mark.box":Ip,"mark.vector":Bp,"mark.lineX":Fp,"mark.lineY":Dp,"mark.connector":zp,"mark.range":Hp,"mark.rangeX":Yp,"mark.rangeY":Vp,"mark.sankey":A0,"mark.path":_0,"mark.treemap":C0,"mark.pack":R0,"mark.boxplot":Y0,"mark.shape":V0,"mark.forceGraph":Bg,"mark.gauge":Bv,"mark.tree":Vg,"mark.wordCloud":py,"mark.density":Dv,"mark.heatmap":Fv,"palette.category10":zv,"palette.category20":Wv,"scale.linear":Hv,"scale.ordinal":Yv,"scale.band":Gv,"scale.identity":Vv,"scale.point":qv,"scale.time":$v,"scale.log":Uv,"scale.pow":Xv,"scale.sqrt":Jv,"scale.threshold":Kv,"scale.quantile":Zv,"scale.quantize":Qv,"scale.sequential":tb,"scale.constant":eb,"shape.interval.rect":a2,"shape.interval.hollow":o2,"shape.interval.funnel":s2,"shape.interval.pyramid":c2,"shape.rect.rect":a2,"shape.rect.hollow":o2,"shape.cell.cell":a2,"shape.cell.hollow":o2,"shape.line.line":d2,"shape.line.hv":g2,"shape.line.vh":y2,"shape.line.hvh":m2,"shape.line.trail":v2,"shape.line.smooth":p2,"shape.point.bowtie":x2,"shape.point.cross":w2,"shape.point.diamond":M2,"shape.point.hexagon":O2,"shape.point.hollowBowtie":k2,"shape.point.hollowDiamond":E2,"shape.point.hollowHexagon":S2,"shape.point.hollow":A2,"shape.point.hollowSquare":_2,"shape.point.hollowTriangle":T2,"shape.point.hollowTriangleDown":P2,"shape.point.hyphen":L2,"shape.point.line":C2,"shape.point.plus":N2,"shape.point.point":j2,"shape.point.square":R2,"shape.point.tick":I2,"shape.point.triangle":B2,"shape.point.triangleDown":D2,"shape.text.text":J5,"shape.area.area":iO,"shape.area.smooth":aO,"shape.area.hvh":oO,"shape.area.vh":sO,"shape.area.hv":lO,"shape.link.smooth":uO,"shape.link.vhv":hO,"shape.link.arc":fO,"shape.link.link":cO,"shape.image.image":dO,"shape.polygon.polygon":pO,"shape.polygon.ribbon":gO,"shape.box.box":yO,"shape.box.violin":mO,"shape.vector.vector":F2,"shape.label.label":RO,"shape.text.badge":eO,"shape.lineX.line":vO,"shape.lineY.line":vO,"shape.shape.shape":VO,"shape.connector.connector":wO,"shape.range.range":a2,"shape.rangeX.range":a2,"shape.rangeY.range":a2,"shape.path.path":BO,"shape.path.hollow":DO,"shape.density.density":FO,"shape.heatmap.heatmap":YO,"theme.classic":$O,"theme.classicDark":XO,"theme.academy":ZO,"component.axisX":Sk,"component.axisY":Ak,"component.axisRadar":_k,"component.axisLinear":kk,"component.axisArc":Ek,"component.legendCategory":Ck,"component.legendContinuous":Bk,"component.legendContinuousBlock":Dk,"component.legendContinuousBlockSize":zk,"component.legendContinuousSize":Fk,"component.legends":eE,"component.title":Hk,"component.sliderX":Kk,"component.sliderY":Zk,"component.scrollbarX":Jk,"component.scrollbarY":tE,"animation.scaleInX":nE,"animation.scaleOutX":rE,"animation.scaleInY":iE,"animation.scaleOutY":aE,"animation.waveIn":mE,"animation.fadeIn":oE,"animation.fadeOut":sE,"animation.zoomIn":vE,"animation.zoomOut":bE,"animation.pathIn":xE,"animation.morphing":yE,"animation.growInX":wE,"animation.growInY":ME,"interaction.elementHighlight":VE,"interaction.elementHighlightByX":qE,"interaction.elementHighlightByColor":$E,"interaction.elementSelect":XE,"interaction.elementSelectByX":KE,"interaction.elementSelectByColor":ZE,"interaction.fisheye":JE,"interaction.chartIndex":QE,"interaction.tooltip":xS,"interaction.legendFilter":LS,"interaction.legendHighlight":CS,"interaction.brushHighlight":DS,"interaction.brushXHighlight":zS,"interaction.brushYHighlight":GS,"interaction.brushAxisHighlight":ZS,"interaction.brushFilter":JS,"interaction.brushXFilter":t3,"interaction.brushYFilter":e3,"interaction.sliderFilter":i3,"interaction.scrollbarFilter":o3,"interaction.poptip":c3,"interaction.event":rS,"composition.spaceLayer":d3,"composition.spaceFlex":p3,"composition.mark":y3,"composition.view":g3,"composition.facetRect":A3,"composition.repeatMatrix":L3,"composition.facetCircle":B3,"composition.timingKeyframe":D3,"labelTransform.overlapHide":gA,"labelTransform.overlapDodgeY":mA,"labelTransform.overflowHide":OA,"labelTransform.contrastReverse":MA},MT)}const kT=[["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 ET(t,e,n){for(;t<e;)t+=2*Math.PI;for(;n<t;)t-=2*Math.PI;return t}function ST(t,e,n,r,i){var a=t[0],t=t[1],o=U();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 AT(t,e,n,r,i){var a=new Wm({range:[e,e+r]}),o=new Wm({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 _T(t,e,n,r,i){return(0,t[0])(e,n,r,i)}function TT(t,e,n,r,i){return t[0]}function PT(t,e,n,r,i){var a=t[0],o=t[1],s=t[2],t=t[3],l=new Wm({range:[s,t]}),c=new Wm({range:[a,o]}),u=1<(s=i/r)?1:s,h=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)*h)+.5]},untransform:function(t){var e=t[0],t=t[1],e=2*(e-.5)/u,t=2*(t-.5)/h,n=Math.sqrt(Math.pow(e,2)+Math.pow(t,2)),t=ET(Math.atan2(t,e),a,o);return[c.invert(t),l.invert(n)]}}}function LT(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 CT(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return DT.apply(void 0,FT([[-1,-1]],e,!1))}function NT(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return DT.apply(void 0,FT([[-1,1]],e,!1))}function jT(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return DT.apply(void 0,FT([[1,-1]],e,!1))}function RT(t,e,n,r,i){var a,t=t[0],o=U();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 IT(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 Wm({range:[s,s+.99*l]}),h=new Wm({range:[a,o]}),f=1<(t=i/r)?1:t,d=1<t?1/t:1;return{transform:function(t){var e=t[0],t=t[1],e=h.map(e),t=u.map(t);return[.5*(Math.cos(e)*(c*e+t)*f)+.5,.5*(Math.sin(e)*(c*e+t)*d)+.5]},untransform:function(t){var e=t[0],t=t[1],e=2*(e-.5)/f,t=2*(t-.5)/d,n=Math.sqrt(Math.pow(e,2)+Math.pow(t,2)),t=ET(Math.atan2(t,e)+Math.floor(n/l)*Math.PI*2,a,o),e=n-c*t;return[h.invert(t),u.invert(e)]}}}function BT(t,e,n,r,i){var s=t[0],l=t[1],a=t[2],t=t[3],c=new Wm({range:[a,t]});return{transform:function(t){for(var e=[],n=t.length,r=new Gm({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 DT=function(t,e,n,r,i){var a=t[0],t=t[1],o=U();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},FT=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 zT(t){return 1/Math.tan(t)}function WT(t,e,n,r,i){var a=zT(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 GT(t,e,n,r,i){var a=zT(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 HT(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 YT(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 VT(t,e,n){return n?new Wm({range:[0,1],domain:[0,e]}).map(t):t}function qT(t,e,n,r,i){var a=t[0],o=t[1],t=t[2],s=VT(a,r,void 0!==t&&t);return{transform:function(t){var e=t[0],t=t[1];return[HT(e,s,o,0,1),t]},untransform:function(t){var e=t[0],t=t[1];return[YT(e,s,o,0,1),t]}}}function $T(t,e,n,r,i){var a=t[0],o=t[1],t=t[2],s=VT(a,i,void 0!==t&&t);return{transform:function(t){return[t[0],HT(t[1],s,o,0,1)]},untransform:function(t){return[t[0],YT(t[1],s,o,0,1)]}}}function UT(t,e,n,r,i){var a=t[0],o=t[1],s=t[2],l=t[3],t=t[4],c=VT(a,r,t=void 0!==t&&t),u=VT(o,i,t);return{transform:function(t){var e=t[0],t=t[1];return[HT(e,c,s,0,1),HT(t,u,l,0,1)]},untransform:function(t){var e=t[0],t=t[1];return[YT(e,c,s,0,1),YT(t,u,l,0,1)]}}}function XT(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 Wm({range:[0,r]}),u=new Wm({range:[0,i]}),h=t?a:c.map(a),f=t?o:u.map(o);return{transform:function(t){var e=t[0],t=t[1],n=c.map(e)-h,r=u.map(t)-f,i=Math.sqrt(n*n+r*r);return s<i?[e,t]:(e=HT(i,0,l,0,s),t=Math.atan2(r,n),i=h+e*Math.cos(t),r=f+e*Math.sin(t),[c.invert(i),u.invert(r)])},untransform:function(t){var e=t[0],t=t[1],n=c.map(e)-h,r=u.map(t)-f,i=Math.sqrt(n*n+r*r);return s<i?[e,t]:(e=YT(i,0,l,0,s),t=Math.atan2(r,n),i=h+e*Math.cos(t),r=f+e*Math.sin(t),[c.invert(i),u.invert(r)])}}}var KT=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))},ZT=(QT.prototype.update=function(t){this.options=Yy({},this.options,t),this.recoordinate()},QT.prototype.clone=function(){return new QT(this.options)},QT.prototype.getOptions=function(){return this.options},QT.prototype.clear=function(){this.update({transformations:[]})},QT.prototype.getSize=function(){var t=this.options;return[t.width,t.height]},QT.prototype.getCenter=function(){var t=this.options,e=t.x,n=t.y;return[(2*e+t.width)/2,(2*n+t.height)/2]},QT.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:KT(KT([],n,!0),[KT([],t,!0)],!1)}),this},QT.prototype.map=function(t){return this.output(t)},QT.prototype.invert=function(t){return this.input(t)},QT.prototype.recoordinate=function(){this.output=this.compose(),this.input=this.compose(!0)},QT.prototype.compose=function(t){for(var e=(t=void 0===t?!1:t)?KT([],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,h,f=s[o],d=f[0],f=f.slice(1),p=this.transformers[d];p&&(l=(h=this.options).x,c=h.y,u=h.width,h=h.height,p=p(KT([],f,!0),l,c,u,h),(f=p)instanceof Float32Array||f instanceof Array?r.push(p):(r.length&&(i(this.createMatrixTransform(r,t)),r.splice(0,r.length)),i(n(p)||Vy,"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):Vy}.apply(void 0,a)},QT.prototype.createMatrixTransform=function(t,e){var n,r,i,a,o,s,l,c,u,h,f,d,p=U();return e&&t.reverse(),t.forEach(function(t){return K(p,p,t)}),e&&(e=t=p,(d=new $(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,f=d*c+n*(u=-e*i+o*s)+r*(h=l*i-a*s))&&(t[0]=c*(f=1/f),t[1]=(-e*n+r*l)*f,t[2]=(o*n-r*a)*f,t[3]=u*f,t[4]=(e*d-r*s)*f,t[5]=(-o*d+r*i)*f,t[6]=h*f,t[7]=(-l*d+n*s)*f,t[8]=(a*d-n*i)*f),function(t){t=[t[0],t[1],1];return Dt(t,t,p),[t[0],t[1]]}},QT);function QT(t){this.options={x:0,y:0,width:300,height:150,transformations:[]},this.transformers={cartesian:AT,translate:ST,custom:_T,matrix:TT,polar:PT,transpose:LT,scale:DT,"shear.x":WT,"shear.y":GT,reflect:CT,"reflect.x":NT,"reflect.y":jT,rotate:RT,helix:IT,parallel:BT,fisheye:UT,"fisheye.x":qT,"fisheye.y":$T,"fisheye.circular":XT},this.update(t)}function JT(e,n){const r=t=>{return"string"!=typeof t?t:n[t=e+"."+t]||h0("Unknown Component: "+t)};return[(t,e)=>{var n=t["type"],t=it(t,["type"]);return r(n)(t,e)},r]}function t8(t){var{canvas:t,group:e}=t;return e?e.ownerDocument:t.document}function e8(t,e){var{coordinate:n={}}=t,t=it(t,["coordinate"]),{type:r,transform:i=[]}=n,n=it(n,["type","transform"]);if(!r)return Object.assign(Object.assign({},t),{coordinates:i});var[,e]=JT("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 n8(t,e){return t.filter(t=>t.type===e)}function r8(t){return 0<n8(t,"polar").length}function i8(t){return n8(t,"transpose").length%2==1}function a8(t){return 0<n8(t,"theta").length}function o8(t){return 0<n8(t,"radial").length}function f(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}o=f("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"),i=f("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666"),Do=f("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666"),jo=f("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928"),Ys=f("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2"),To=f("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc"),xo=f("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999"),ki=f("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3"),Gs=f("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"),Eo=f("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab");function s8(t,e,n){(t.prototype=e.prototype=n).constructor=t}function l8(t,e){var n,r=Object.create(t.prototype);for(n in e)r[n]=e[n];return r}function c8(){}var u8=1/.7,Ll="\\s*([+-]?\\d+)\\s*",Zr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",sn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",h8=/^#([0-9a-f]{3,8})$/,f8=new RegExp(`^rgb\\(${Ll},${Ll},${Ll}\\)$`),d8=new RegExp(`^rgb\\(${sn},${sn},${sn}\\)$`),p8=new RegExp(`^rgba\\(${Ll},${Ll},${Ll},${Zr}\\)$`),g8=new RegExp(`^rgba\\(${sn},${sn},${sn},${Zr}\\)$`),y8=new RegExp(`^hsl\\(${Zr},${sn},${sn}\\)$`),m8=new RegExp(`^hsla\\(${Zr},${sn},${sn},${Zr}\\)$`),v8={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 b8(){return this.rgb().formatHex()}function x8(){return this.rgb().formatRgb()}function w8(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=h8.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?M8(e):3===n?new S8(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?O8(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?O8(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=f8.exec(t))?new S8(e[1],e[2],e[3],1):(e=d8.exec(t))?new S8(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=p8.exec(t))?O8(e[1],e[2],e[3],e[4]):(e=g8.exec(t))?O8(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=y8.exec(t))?C8(e[1],e[2]/100,e[3]/100,1):(e=m8.exec(t))?C8(e[1],e[2]/100,e[3]/100,e[4]):v8.hasOwnProperty(t)?M8(v8[t]):"transparent"===t?new S8(NaN,NaN,NaN,0):null}function M8(t){return new S8(t>>16&255,t>>8&255,255&t,1)}function O8(t,e,n,r){return new S8(t=r<=0?e=n=NaN:t,e,n,r)}function k8(t){return(t=t instanceof c8?t:w8(t))?new S8((t=t.rgb()).r,t.g,t.b,t.opacity):new S8}function E8(t,e,n,r){return 1===arguments.length?k8(t):new S8(t,e,n,null==r?1:r)}function S8(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function A8(){return"#"+L8(this.r)+L8(this.g)+L8(this.b)}function _8(){var t=T8(this.opacity);return(1===t?"rgb(":"rgba(")+P8(this.r)+`, ${P8(this.g)}, `+P8(this.b)+(1===t?")":`, ${t})`)}function T8(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function P8(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function L8(t){return((t=P8(t))<16?"0":"")+t.toString(16)}function C8(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||1<=n?t=e=NaN:e<=0&&(t=NaN),new j8(t,e,n,r)}function N8(t){var e,n,r,i,a,o,s,l;return t instanceof j8?new j8(t.h,t.s,t.l,t.opacity):(t=t instanceof c8?t:w8(t))?t instanceof j8?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 j8(o,s,l,t.opacity)):new j8}function j8(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function R8(t){return(t=(t||0)%360)<0?t+360:t}function I8(t){return Math.max(0,Math.min(1,t||0))}function B8(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}s8(c8,w8,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:b8,formatHex:b8,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return N8(this).formatHsl()},formatRgb:x8,toString:x8}),s8(S8,E8,l8(c8,{brighter(t){return t=null==t?u8:Math.pow(u8,t),new S8(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?.7:Math.pow(.7,t),new S8(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new S8(P8(this.r),P8(this.g),P8(this.b),T8(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:A8,formatHex:A8,formatHex8:function(){return"#"+L8(this.r)+L8(this.g)+L8(this.b)+L8(255*(isNaN(this.opacity)?1:this.opacity))},formatRgb:_8,toString:_8})),s8(j8,function(t,e,n,r){return 1===arguments.length?N8(t):new j8(t,e,n,null==r?1:r)},l8(c8,{brighter(t){return t=null==t?u8:Math.pow(u8,t),new j8(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?.7:Math.pow(.7,t),new j8(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 S8(B8(240<=t?t-240:120+t,n,e),B8(t,n,e),B8(t<120?240+t:t-120,n,e),this.opacity)},clamp(){return new j8(R8(this.h),I8(this.s),I8(this.l),T8(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=T8(this.opacity);return(1===t?"hsl(":"hsla(")+R8(this.h)+`, ${100*I8(this.s)}%, ${100*I8(this.l)}%`+(1===t?")":`, ${t})`)}}));const D8=Math.PI/180,F8=180/Math.PI;var z8=1.78277,W8=-.29227,G8=-.90649,H8=1.97294,Y8=H8*G8,V8=H8*z8,q8=z8*W8- -.14861*G8;function $8(t,e,n,r){return 1===arguments.length?(i=t)instanceof U8?new U8(i.h,i.s,i.l,i.opacity):(a=(i=i instanceof S8?i:k8(i)).r/255,o=i.g/255,l=i.b/255,l=(H8*(o-(a=(q8*l+Y8*a-V8*o)/(q8+Y8-V8)))-W8*(o=l-a))/G8,new U8((l=(s=Math.sqrt(l*l+o*o)/(H8*a*(1-a)))?Math.atan2(l,o)*F8-120:NaN)<0?l+360:l,s,a,i.opacity)):new U8(t,e,n,null==r?1:r);var i,a,o,s,l}function U8(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}s8(U8,$8,l8(c8,{brighter(t){return t=null==t?u8:Math.pow(u8,t),new U8(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?.7:Math.pow(.7,t),new U8(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=isNaN(this.h)?0:(this.h+120)*D8,e=+this.l,n=isNaN(this.s)?0:this.s*e*(1-e),r=Math.cos(t),t=Math.sin(t);return new S8(255*(e+n*(-.14861*r+z8*t)),255*(e+n*(W8*r+G8*t)),255*(e+H8*r*n),this.opacity)}}));var X8=t=>()=>t;function K8(e,n){return function(t){return e+t*n}}function Z8(a){return 1==(a=+a)?Q8: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)}):X8(isNaN(t)?e:t);var n,r,i}}function Q8(t,e){var n=e-t;return n?K8(t,n):X8(isNaN(t)?e:t)}!function t(e){var o=Z8(e);function n(e,t){var n=o((e=E8(e)).r,(t=E8(t)).r),r=o(e.g,t.g),i=o(e.b,t.b),a=Q8(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);J8=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 J8,tP=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=E8(t[o]),r[o]=e.r||0,i[o]=e.g||0,a[o]=e.b||0;return r=J8(r),i=J8(i),a=J8(a),e.opacity=1,function(t){return e.r=r(t),e.g=i(t),e.b=a(t),e+""}};function eP(s){return function t(o){function e(e,t){var n=s((e=$8(e)).h,(t=$8(t)).h),r=Q8(e.s,t.s),i=Q8(e.l,t.l),a=Q8(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)}eP(function(t,e){var n=e-t;return n?K8(t,180<n||n<-180?n-360*Math.round(n/360):n):X8(isNaN(t)?e:t)});var ad=eP(Q8),Go=t=>tP(t[t.length-1]),qo=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(f),Ao=Go(qo),Ds=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(f),qs=Go(Ds),Ks=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(f),Us=Go(Ks),zo=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(f),Is=Go(zo),Mo=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(f),ln=Go(Mo),Js=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(f),Yo=Go(Js),Xo=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(f),Jo=Go(Xo),bs=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(f),Ns=Go(bs),Zo=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(f),zs=Go(Zo),js=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(f),Io=Go(js),n=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(f),xl=Go(n),Ll=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(f),sn=Go(Ll),Zr=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(f),nP=Go(Zr),rP=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(f),iP=Go(rP),aP=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(f),oP=Go(aP),sP=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(f),lP=Go(sP),cP=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(f),uP=Go(cP),hP=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(f),fP=Go(hP),dP=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(f),pP=Go(dP),gP=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(f),yP=Go(gP),mP=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(f),vP=Go(mP),bP=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(f),xP=Go(bP),wP=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(f),MP=Go(wP),OP=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(f),kP=Go(OP),EP=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(f),SP=Go(EP),AP=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(f),_P=Go(AP),TP=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(f),Go=Go(TP);var PP=ad($8(300,.5,0),$8(-240,.5,1)),LP=ad($8(-100,.75,.35),$8(80,1.5,.8)),ad=ad($8(260,.75,.35),$8(80,1.5,.8)),CP=$8();var NP=E8(),jP=Math.PI/3,RP=2*Math.PI/3;function IP(e){var n=e.length;return function(t){return e[Math.max(0,Math.min(n-1,Math.floor(t*n)))]}}var BP=IP(f("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725")),DP=IP(f("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),FP=IP(f("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),zP=IP(f("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921")),WP=Object.freeze({__proto__:null,schemeCategory10:o,schemeAccent:i,schemeDark2:Do,schemePaired:jo,schemePastel1:Ys,schemePastel2:To,schemeSet1:xo,schemeSet2:ki,schemeSet3:Gs,schemeTableau10:Eo,interpolateBrBG:Ao,schemeBrBG:qo,interpolatePRGn:qs,schemePRGn:Ds,interpolatePiYG:Us,schemePiYG:Ks,interpolatePuOr:Is,schemePuOr:zo,interpolateRdBu:ln,schemeRdBu:Mo,interpolateRdGy:Yo,schemeRdGy:Js,interpolateRdYlBu:Jo,schemeRdYlBu:Xo,interpolateRdYlGn:Ns,schemeRdYlGn:bs,interpolateSpectral:zs,schemeSpectral:Zo,interpolateBuGn:Io,schemeBuGn:js,interpolateBuPu:xl,schemeBuPu:n,interpolateGnBu:sn,schemeGnBu:Ll,interpolateOrRd:nP,schemeOrRd:Zr,interpolatePuBuGn:iP,schemePuBuGn:rP,interpolatePuBu:oP,schemePuBu:aP,interpolatePuRd:lP,schemePuRd:sP,interpolateRdPu:uP,schemeRdPu:cP,interpolateYlGnBu:fP,schemeYlGnBu:hP,interpolateYlGn:pP,schemeYlGn:dP,interpolateYlOrBr:yP,schemeYlOrBr:gP,interpolateYlOrRd:vP,schemeYlOrRd:mP,interpolateBlues:xP,schemeBlues:bP,interpolateGreens:MP,schemeGreens:wP,interpolateGreys:kP,schemeGreys:OP,interpolatePurples:SP,schemePurples:EP,interpolateReds:_P,schemeReds:AP,interpolateOranges:Go,schemeOranges:TP,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:PP,interpolateRainbow:function(t){(t<0||1<t)&&(t-=Math.floor(t));var e=Math.abs(t-.5);return CP.h=360*t-100,CP.s=1.5-1.5*e,CP.l=.8-.9*e,CP+""},interpolateWarm:LP,interpolateCool:ad,interpolateSinebow:function(t){var e;return t=(.5-t)*Math.PI,NP.r=255*(e=Math.sin(t))*e,NP.g=255*(e=Math.sin(t+jP))*e,NP.b=255*(e=Math.sin(t+RP))*e,NP+""},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:BP,interpolateMagma:DP,interpolateInferno:FP,interpolatePlasma:zP});function GP(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 eL(t,m0)}(e)?"identity":"string"==typeof i?"linear":2<(r||i||[]).length?XP(t):void 0===r?JP(e)?XP(t):tL(e)?"time":KP(t,i):JP([r])?XP(t):tL(e)?"time":KP(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(qP({type:t}))return function(t,e,n){const r=t.map(Number),i=new Wm({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 $P({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 ZP(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)d0(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 QP(e);case"quantile":return function(t){return QP(t).sort()}(e);case"sequential":return ZP(function(t){let e=1/0,n=-1/0;for(const r of t)for(const i of r)d0(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=mm,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:a8(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=Ye(e),i=WP["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=UP(n,r,i,a,o),[u,h]=function(t,e){return"enterDelay"===t?[0,1e3]:"enterDuration"==t?[300,1e3]:t.startsWith("y")||t.startsWith("position")?[1,0]:"color"===t?[e[0],gv(e)]:"opacity"!==t&&"size"===t?[1,10]:[0,1]}(e,u);return[l||u,c||h];case"band":case"point":return[l||0,c||1];case"ordinal":return UP(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 HP(t,e){var{components:e=[]}=e,n=["scale","encode","axis","legend","data","transform"],r=Array.from(new Set(t.flatMap(t=>t.channels.map(t=>t.scale)))),i=new Map(r.map(t=>[t.name,t]));for(const l of e)for(const c of function(t){const{channels:e=[],type:n,scale:r={}}=t,i=["shape","color","opacity","size"];return 0!==e.length?e:"axisX"===n?["x"]:"axisY"===n?["y"]:"legends"===n?Object.keys(r).filter(t=>i.includes(t)):[]}(l)){var a=i.get(c),o=(null==(o=l.scale)?void 0:o[c])||{},{independent:s=!1}=o;a&&!s?(s=a["guide"],a.guide=ot({},"boolean"==typeof s?{}:s,l),Object.assign(a,o)):(s=Object.assign(Object.assign({},o),{expectedDomain:o.domain,name:c,guide:Qe(l,n)}),r.push(s))}return r}function YP(t,e){var[e]=JT("scale",e),n=t["relations"],[n]=function(o){if(!o||!Array.isArray(o))return[l0,l0];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 VP(t,n){var t=t.filter(({name:t,facet:e=!0})=>e&&t===n),e=t.flatMap(t=>t.domain),r=t.every(qP)?Id(e):t.every($P)?Array.from(new Set(e)):null;if(null!==r)for(const i of t)i.domain=r}function qP(t){t=t.type;return"string"==typeof t&&["linear","log","pow","time"].includes(t)}function $P(t){t=t.type;return"string"==typeof t&&["band","point","ordinal"].includes(t)}function UP(t,e,n,r,i){var[i]=JT("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=Ye(t),i=WP["scheme"+e],a=WP["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 XP(t){return(t=t).startsWith("x")||t.startsWith("y")||t.startsWith("position")||t.startsWith("size")?"point":"ordinal"}function KP(t,e){return"color"!==t||e?"linear":"sequential"}function ZP(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 QP(t){return Array.from(new Set(t.flat()))}function JP(t){return eL(t,t=>{t=typeof t;return"string"==t||"boolean"==t})}function tL(t){return eL(t,t=>t instanceof Date)}function eL(t,e){for(const n of t)if(n.some(e))return!0;return!1}const nL={linear:"linear",identity:"identity",log:"log",pow:"pow",sqrt:"sqrt",sequential:"sequential"},rL={threshold:"threshold",quantize:"quantize",quantile:"quantile"},iL={ordinal:"ordinal",band:"band",point:"point"},aL={constant:"constant"};function oL(t,e,n){const{coordinates:b=[],title:r}=e,[,x]=JT("component",n),w=t.filter(({guide:t})=>null!==t),M=[];var i,e=function(t,e,n){const[,o]=JT("component",n),s=t["coordinates"];function i(t,e,n,r){[e,t,i=[]]=[e,t,s];var i,a,e="x"===e?i8(i)?t+"Y":t+"X":"y"===e?i8(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);return M.push(...e),r&&(t=x("title")["props"],{defaultPosition:n,defaultOrientation:e,defaultOrder:t,defaultSize:i}=t,M.push(Object.assign({type:"title",position:n,orientation:e,order:t,size:i},"string"==typeof r?{title:r}:r))),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 n=["shape","size","color","opacity"],e=t.filter(({type:t,name:e})=>"string"==typeof t&&n.includes(e)&&!("constant"===t&&"size"===e)),r=e.filter(({type:t})=>"constant"===t),i=e.filter(({type:t})=>"constant"!==t),a=Gd(i,t=>t.field||Symbol("independent")).map(([t,e])=>[t,[...e,...r]]).filter(([,t])=>t.some(t=>"constant"!==t.type)),o=new Map(a);if(0===o.size)return[];const s=t=>t.sort(([t],[e])=>t.localeCompare(e)),l=Array.from(o).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(...mv(e,t));return n}(t).sort((t,e)=>e.length-t.length).map(t=>({combination:t,option:t.map(t=>[t.name,function(t){t=t.type;return"string"!=typeof t?null:t in nL?"continuous":t in iL?"discrete":t in rL?"distribution":t in aL?"constant":null}(t)])}));for([e,n]of kT)for(const{option:i,combination:a}of r)if(n.some(t=>tn(s(t),s(i))))return[e,a];return null}).filter(d0);return l}(t),...function(t,n){return t.map(t=>{var e=t["name"];if(!(0<n8(n,"helix").length||a8(n))&&(!i8(n)||!r8(n)&&!o8(n))){if(e.startsWith("x"))return r8(n)?["axisArc",[t]]:o8(n)?["axisLinear",[t]]:[i8(n)?"axisY":"axisX",[t]];if(e.startsWith("y"))return r8(n)?["axisLinear",[t]]:o8(n)?["axisArc",[t]]:[i8(n)?"axisX":"axisY",[t]];if(e.startsWith("position")){if(0<n8(n,"radar").length)return["axisRadar",[t]];if(!r8(n))return["axisY",[t]]}}return null}).filter(d0)}(t,e)]}(w,b).forEach(([t,e])=>{var n=x(t)["props"],{defaultPosition:r,defaultOrientation:i,defaultSize:a,defaultOrder:o,defaultLength:s,defaultPadding:l=[0,0],defaultCrossPadding:c=[0,0]}=n,{guide:n,field:u}=ot({},...e);for(const v of Array.isArray(n)?n:[n]){var h,f,d,p,g,[y,m]=function(t,e,n,r,i,a,o){var[s]=cL(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=uL(n),n===r.slice(-1)[0].name||null===a?[null,null]:([o,s]=cL(i),["center",(s-o)/(r.length-1)*a+o])}{var s;if("axisY"===t&&function(t){return 0<n8(t,"parallel").length}(i))return null===(s=uL(n))?e:i8(i)?0===s?["top",null]:["center","horizontal"]:0===s?e:["center","vertical"]}if("axisLinear"===t)return[r]=cL(i),["center",r];if("axisArc"===t)return"inner"===e[0]?["inner",null]:["outer",null];if(r8(i))return["center",null];if(o8(i))return["center",null];if("axisX"===t&&function(t){return 0<n8(t,"reflect").length}(i)||"axisX"===t&&function(t){return 0<n8(t,"reflectY").length}(i))return["top",null];return e}(t,e,i,a,o);if("string"==typeof t&&t.startsWith("legend")&&r8(o)&&"center"===r.position)return["center","vertical"];return e}(t,r,i,v,e,w,b);(y||m)&&(p=(g="left"===y||"right"===y)?l[1]:l[0],g=g?c[1]:c[0],{size:h=a,order:f=o,length:d=s,padding:p=p,crossPadding:g=g}=v,M.push(Object.assign(Object.assign({title:u},v),{length:d,position:y,orientation:m,padding:p,order:f,crossPadding:g,size:h,type:t,scales:e})))}}),M}function sL(t,e,n,r,i){var[a]=JT("component",r),{scaleInstances:o,scale:s,bbox:l}=t,l={bbox:l,library:r};return a(it(t,["scaleInstances","scale","bbox"]))({coordinate:e,library:r,markState:i,scales:o,theme:n,value:l,scale:s})}function lL(t,o){const r=["left","right","bottom","top"];return Gd(t,({type:t,position:e,group:n})=>r.includes(e)?void 0===n?t.startsWith("legend")?"legend-"+e:Symbol("independent"):"independent"===n?Symbol("independent"):n:Symbol("independent")).flatMap(([,t],e)=>{if(1===t.length)return t[0];if(void 0!==o){var n=t.filter(t=>void 0!==t.length).map(t=>t.length),r=yp(n);if(o<r)return t.forEach(t=>t.group=Symbol("independent")),t;const a=(o-r)/(t.length-n.length);t.forEach(t=>{void 0===t.length&&(t.length=a)})}var r=ip(t,t=>t.size),n=ip(t,t=>t.order),i=ip(t,t=>t.crossPadding);return{type:"group",size:r,order:n,position:t[0].position,children:t,crossPadding:i}})}function cL(t){var e,n=n8(t,"polar");return n.length?(n=n[n.length-1],{startAngle:n,endAngle:e}=Kh(n),[n,e]):(n=n8(t,"radial")).length?(e=n[n.length-1],{startAngle:t,endAngle:n}=ef(e),[t,n]):[-Math.PI/2,Math.PI/2*3]}function uL(t){t=/position(\d*)/g.exec(t);return t?+t[1]:null}function hL(t,e,n,r,i,a){var o=t["type"];if(["left","right","bottom","top"].includes(r)&&"string"==typeof o){const s=o;return(s.startsWith("axis")?dL:s.startsWith("group")?fL:s.startsWith("legendContinuous")?pL:"legendCategory"===s?gL:()=>{})(t,e,n,r,i,a)}}function fL(t,e,n,r,i,a){var o=t["children"];const s=ip(o,t=>t.crossPadding),l=(o.forEach(t=>t.crossPadding=s),o.forEach(t=>hL(t,e,n,r,i,a)),ip(o,t=>t.size));t.size=l,o.forEach(t=>t.size=l)}function dL(t,e,n,r,i,a){t.transform=t.transform||[{type:"hide"}];var o="left"===r||"right"===r;const s=bL(t,r,i);var{tickLength:r=0,labelSpacing:i=0,titleSpacing:l=0}=s,c=it(s,["tickLength","labelSpacing","titleSpacing"]),a=yL(t,a),u=mL(t,a,c);if(u){var h=ip(u,t=>t.width),f=ip(u,t=>t.height),r=r+i;if(o)t.size=h+r;else{const{tickFilter:d,style:s={}}=t;i=s["labelTransform"];!function(t,e,n,r,i){var a=yp(e,t=>t.width);if(n<a)return 1;const o=t.clone(),s=(o.update({range:[0,n]}),xL(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],h=n+r[1],f=(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]=f(d,e[t]);if(d<u||h<p)return 1;d=l[t+1];if(d){var[d]=f(d,e[t+1]);if(d<p)return 1}}return}(a,u,e,n,d)||i?t.size=f+r:(t.style=Object.assign(Object.assign({},s),{labelTransform:"rotate(90)"}),t.size=h+r)}}a=vL(t,c);a&&(t.size+=o?l+a.width:l+a.height)}function pL(t,e,n,r,i,a){i=i.legendContinuous;var i=ot({},i,t.style),{labelSpacing:o=0,titleSpacing:s=0}=i,i=it(i,["labelSpacing","titleSpacing"]),r="left"===r||"right"===r,l=at(i,"ribbon")["size"],c=at(i,"handleIcon")["size"],l=Math.max(l,2.4*c),c=(t.size=l,yL(t,a)),l=mL(t,c,i);if(l){const u=r?"width":"height";a=ip(l,t=>t[u]);t.size+=a+o}var c=vL(t,i),{crossPadding:l=0}=(c&&(r?t.size=Math.max(t.size,c.width):t.size+=s+c.height),t);t.size+=2*l}function gL(o,t,e,s,n,r){n=n.legendCategory;const i=ot({},n,o.style),{itemSpacing:a,itemMarkerSize:l,titleSpacing:c,rowPadding:u,colPadding:h}=i,f=it(i,["itemSpacing","itemMarkerSize","titleSpacing","rowPadding","colPadding"]),{cols:d,length:p}=o,g=void 0===p?t:p;n="left"===s||"right"===s;const y=vL(o,f);t=yL(o,r);const m=mL(o,t,f,"itemLabel"),v=Math.max(m[0].height,l)+u,b=(t,e=0)=>l+t+a[0]+e;if(n){let t=-1/0,e=0,n=1,r=0,i=-1/0,a=-1/0;var x,s=y?y.height:0,w=g-s;for({width:x}of m){var M=b(x);t=Math.max(t,M),e+v>w?(n++,i=Math.max(i,r),a=Math.max(a,e),r=1,e=v):(e+=v,r++)}n<=1&&(i=r,a=e),o.size=t*n,o.length=a+s,ot(o,{cols:n,gridRow:i})}else if("number"==typeof d)r=Math.ceil(m.length/d),t=ip(m,t=>b(t.width))*d,o.size=v*r,o.length=Math.min(t,g);else{let t=1,e=0,n=-1/0;for(var{width:O}of m){O=b(O,h);e+O>g?(n=Math.max(n,e),e=O,t++):e+=O}1===t&&(n=e),o.size=v*t,o.length=n}y&&(n?o.size=Math.max(o.size,y.width):o.size+=c+y.height);var{crossPadding:s=0}=o;o.size+=2*s}function yL(t,e){var[e]=JT("scale",e),{scales:t,tickCount:n,tickMethod:r}=t,t=t.find(t=>"constant"!==t.type&&"identity"!==t.type);return void 0!==n&&(t.tickCount=n),void 0!==r&&(t.tickMethod=r),e(t)}function mL(t,e,n,r="label"){var{labelFormatter:i,tickFilter:a,label:o=!0}=t;if(!o)return null;const s=function(t,e,n){n=xL(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?ok(e):e:t.getFormatter?t.getFormatter():t=>""+t;return n.map(e)}(e,i,a),l=at(n,r),c=s.map((n,r)=>Object.fromEntries(Object.entries(l).map(([t,e])=>[t,"function"==typeof e?e(n,r):e]))),u=s.map((t,e)=>{return wL(t,c[e])});return c.some(t=>t.transform)||(o=s.map((t,e)=>e),t.indexBBox=new Map(o.map(t=>[t,[s[t],u[t]]]))),u}function vL(t,e){var n=t=>!1===t||null===t,t=t["title"],r=e["title"];return n(t)||n(r)||void 0===t?null:(n=at(e,"title"),wL(Array.isArray(t)?t.join(","):t,n))}function bL(t,e,n){var{axis:n,["axis"+u0(e)]:e}=n;return ot({},n,e,t.style)}function xL(t,e){t=t.getTicks?t.getTicks():t.getOptions().domain;return e?t.filter(e):t}function wL(t,e){t=(t=t)instanceof Vl?t:new Ac({style:{text:""+t}}),t.attr(Object.assign(Object.assign({},e),{visibility:"none"})),e=t.getBBox();return e}function ML(t,o,e,n){var{width:r,height:i,x:a=0,y:s=0,inset:l=0,insetLeft:c=l,insetTop:u=l,insetBottom:h=l,insetRight:l=l,margin:f=0,marginLeft:d=f,marginBottom:p=f,marginTop:g=f,marginRight:f=f,padding:y,paddingBottom:m=y,paddingLeft:v=y,paddingRight:b=y,paddingTop:y=y}=function(t,e,n,r){var i=e["coordinates"];if(!r8(i))return e;i=t.filter(t=>"string"==typeof t.type&&t.type.startsWith("axis"));if(0===i.length)return e;const a=i.map(t=>{return bL(t,"axisArc"===t.type?"arc":"linear",n)}),o=ip(a,t=>{return null!=(t=t.labelSpacing)?t:0}),s=i.flatMap((t,e)=>{e=a[e];return mL(t,yL(t,r),e)}).filter(d0),l=ip(s,t=>t.height)+o,c=i.flatMap((t,e)=>{return vL(t,a[e])}).filter(t=>null!==t),u=0===c.length?0:ip(c,t=>t.height),{inset:h=l,insetLeft:f=h,insetBottom:d=h,insetTop:p=h+u,insetRight:g=h}=e;return Object.assign(Object.assign({},e),{insetLeft:f,insetBottom:d,insetTop:p,insetRight:g})}(t,o,e,n);var x=(t,e,n,r,i)=>{var a=o["marks"];return 0===a.length||0<t-r-i-.25*t?[r,i]:(a=.75*t/2,["auto"===e?a:r,"auto"===n?a:i])},w=t=>"auto"!==t&&null!=t?t:30,M=w(y),w=w(m),{paddingLeft:M,paddingRight:w}=OL(t,i-M-w,[M,w],["left","right"],o,e,n),O=r-d-f,[v,b]=x(O,v,b,M,w),M=O-v-b,{paddingTop:w,paddingBottom:O}=OL(t,M,[v,b],["bottom","top"],o,e,n),t=i-p-g,[e,n]=x(t,m,y,O,w);return{width:r,height:i,insetLeft:c,insetTop:u,insetBottom:h,insetRight:l,innerWidth:M,innerHeight:t-e-n,paddingLeft:v,paddingRight:b,paddingTop:n,paddingBottom:e,marginLeft:d,marginBottom:p,marginTop:g,marginRight:f,x:a,y:s}}function OL(t,e,n,r,i,a,o){var s=Wd(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 p of r){var h="padding"+u0(MO(p)),f=u[h];if(void 0===f||"auto"===f)if(s.has(p)){const t=s.get(p);var d=lL(t,e),f=("auto"===f&&d.forEach(t=>hL(t,e,n,p,a,o)),d.reduce((t,{size:e})=>t+e,0));u[h]=f}else u[h]=30}return u}function kL(t,I,e){var B=Wd(t,t=>t.position),{paddingLeft:t,paddingRight:e,paddingTop:n,paddingBottom:D,marginLeft:r,marginTop:i,marginBottom:F,marginRight:z,innerHeight:a,innerWidth:o,insetBottom:W,insetLeft:s,insetRight:G,insetTop:l,height:c,width:H}=e,t=t+r,r=n+i,n=e+z,i=D+F,e=[t+s,r+l,o-s-G,a-l-W,"center",null,null],Y={top:[t,0,o,r,"vertical",!0,Ad],right:[H-n,r,n,a,"horizontal",!1,Ad],bottom:[t,c-i,o,i,"vertical",!1,Ad],left:[0,r,t,a,"horizontal",!0,Ad],"top-left":[t,0,o,r,"vertical",!0,Ad],"top-right":[t,0,o,r,"vertical",!0,Ad],"bottom-left":[t,c-i,o,i,"vertical",!1,Ad],"bottom-right":[t,c-i,o,i,"vertical",!1,Ad],center:e,inner:e,outer:e};for(const[j,t]of B.entries()){var u=Y[j],[h,V]=yv(t,t=>"string"==typeof t.type&&("center"===j||!(!t.type.startsWith("axis")||!["inner","outer"].includes(j))));if(h.length){y=g=p=d=f=void 0;var f=h,d=I,p=u,g=j,[f,y]=yv(f,t=>!("string"!=typeof t.type||!t.type.startsWith("axis"))),h=(b=v=m=h=void 0,f),m=d,v=p,b=g;if("center"===b)if(!function(t){return wp(t)&&vp(t)}(m)){if(vp(m)){f=void 0;g=void 0;x=void 0;w=void 0;M=void 0;O=void 0;f=h;g=v;var[x,w,M,O]=g;for(const it of f)it.bbox={x:x,y:w,width:M,height:O}}else if(wp(m)){g=void 0;f=void 0;k=void 0;E=void 0;g=h;f=m;var k=v;var E=h[0].orientation;"horizontal"===E?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}}}(g,f,k):"vertical"===E&&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}}}(g,f,k)}}else{S=void 0;E=void 0;A=void 0;_=void 0;q=void 0;$=void 0;var S=h;E=v;var[A,_,q,$]=E;for(const R of S)R.bbox={x:A,y:_,width:q,height:$},R.radar={index:S.indexOf(R),count:S.length}}else if("inner"===b){T=void 0;g=void 0;f=void 0;U=void 0;X=void 0;k=void 0;P=void 0;L=void 0;K=void 0;Z=void 0;var T=h;g=m;f=v;var[U,X,,f]=f,[k,P]=g.getCenter(),[g]=kp(g),f=f/2,L=g*f,K=k-L,Z=P-L;for(let t=0;t<T.length;t++)T[t].bbox={x:U+K,y:X+Z,width:2*L,height:2*L}}else if("outer"===b){m=void 0;g=void 0;Q=void 0;J=void 0;tt=void 0;et=void 0;m=h;g=v;var[Q,J,tt,et]=g;for(const at of m)at.bbox={x:Q,y:J,width:tt,height:et}}rt=nt=N=v=h=b=P=f=C=void 0;var C=y,f=d,P=p;if(0!==C.length){var[P,b,h,v]=P,[f]=kp(f),N=v/2*f/Math.sqrt(2),nt=P+h/2,rt=b+v/2;for(let t=0;t<C.length;t++)C[t].bbox={x:nt-N,y:rt-N,width:2*N,height:2*N}}}V.length&&!function(n,t){const[e,r,i,a,o,s,l]=t,[c,u,h,f,d,p,g,y]="vertical"===o?["y",r,"x",e,"height",a,"width",i]:["x",e,"y",r,"width",i,"height",a],m=(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=m;t<n.length;t++){var v=n[t],{crossPadding:b=0}=v,x=v["size"];v.bbox={[c]:s?e-x+b:e+b,[h]:f,[d]:x-2*b,[g]:y},e+=x*(s?-1:1)}t=n.filter(t=>"group"===t.type);for(const A of t){const{bbox:_,children:T}=A;var w=_[g];const P=w/T.length;var M=T.reduce((t,e)=>{e=null==(e=e.layout)?void 0:e.justifyContent;return e||t},"flex-start"),O=T.map((t,e)=>{var{length:t=P,padding:n=0}=t;return t+(e===T.length-1?0:n)}),k=yp(O),w=w-k,k="flex-start"===M?0:"center"===M?w/2:w;for(let t=0,e=_[h]+k;t<T.length;t++){var E=T[t],{padding:S=0}=E,S=t===T.length-1?0:S;E.bbox={[d]:_[d],[c]:_[c],[h]:e,[g]:O[t]-S},ot(E,{layout:{justifyContent:M}}),e+=O[t]}}}(t,u)}}function EL(t,e,n){var{encode:r={},scale:i={},transform:a=[]}=e,e=it(e,["encode","scale","transform"]);return[t,Object.assign(Object.assign({},e),{encode:r,scale:i,transform:a})]}function SL(t,i,a){return X(this,void 0,void 0,function*(){var t=a["library"],e=i["data"],[t]=JT("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=it(t,["type"]);return Object.assign(Object.assign({},t),{type:e})}(e),{transform:r=[]}=n,n=yield function(t){return t.reduce((n,r)=>e=>X(this,void 0,void 0,function*(){var t=yield n(e);return r(t)}),l0)}([it(n,["transform"]),...r].map(t))(e);return[Array.isArray(n)?pv(n):[],Object.assign(Object.assign({},i),{data:n})]})}function AL(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 _L(t,e,n){const{encode:r,data:i}=e;var a;return r?(a=dv(r,t=>{var e,n;return function(t){if("object"!=typeof t||t instanceof Date||null===t)return;t=t.type;return d0(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 TL(t,e,n){var r=e["encode"];return r?(r=dv(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 PL(t,e,n){const{encode:r,data:i}=e;if(!r)return[t,e];n=n.library;const a=function(t){const[n]=JT("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=dv(r,t=>a(i,t));return[t,Object.assign(Object.assign({},e),{encode:n})]}function LL(t,e,n){var{tooltip:r={}}=e;return v0(r)?[t,e]:Array.isArray(r)?[t,Object.assign(Object.assign({},e),{tooltip:{items:r}})]:m0(r)&&w0(r)?[t,Object.assign(Object.assign({},e),{tooltip:r})]:[t,Object.assign(Object.assign({},e),{tooltip:{items:[r]}})]}function CL(g,t,e){const{data:y,encode:m,tooltip:n={}}=t;var r,i,a,o;return v0(n)?[g,t]:(r=e=>{if(!e)return e;if("string"==typeof e)return g.map(t=>({name:e,value:y[t][e]}));if(m0(e)){var{field:t,channel:n,color:r,name:i=t,valueFormatter:a=t=>t}=e,o="string"==typeof a?ok(a):a,s=n&&m[n],a=s&&m[n].field,l=i||a||n,c=[];for(const d of g){var u=t?y[d][t]:s?m[n].value[d]:null;c[d]={name:l,color:r,value:o(u)}}return c}if("function"!=typeof e)return e;var h=[];for(const p of g){var f=e(y[p],p,y,m);m0(f)?h[p]=f:h[p]={value:f}}return h},{title:o,items:i=[]}=n,a=it(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 NL(l,t,e){var n,r=t["encode"],i=it(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=it(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 jL(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 ot(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 RL(t,e,n){var r=e["animate"];return r||void 0===r||ot(e,{animate:{enter:{type:null},exit:{type:null},update:{type:null}}}),[t,e]}function IL(l,c,u){return X(this,void 0,void 0,function*(){var[t,e]=yield function(s,l,c){return X(this,void 0,void 0,function*(){var t=c["library"],[t]=JT("transform",t),{preInference:e=[],postInference:n=[]}=l,{transform:r=[]}=s,e=[EL,SL,AL,_L,TL,PL,NL,RL,jL,LL,...e.map(t),...r.map(t),...n.map(t),CL];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:f,data:r,tooltip:i}=e;if(!1===Array.isArray(r))return null;const a=c["channels"],o=Yd(Object.entries(n).filter(([,t])=>d0(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:h}=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=f[t]||{},{independent:o=!1,key:s=u||t,type:i=i?"constant":r?"identity":c}=a,r=it(a,["independent","key","type"]),a="constant"===i,l=a?void 0:h;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 BL(H,Y,V,q){var $,U;return X(this,void 0,void 0,function*(){const[n]=JT("composition",V);var[t]=JT("interaction",V);const I=new Set(Object.keys(V).map(t=>{return null==(t=/mark\.(.*)/.exec(t))?void 0:t[1]}).filter(d0)),r=new Set(Object.keys(V).map(t=>{return null==(t=/component\.(.*)/.exec(t))?void 0:t[1]}).filter(d0)),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&&(I.has(t)||r.has(t))?"mark":t};const a=t=>"standardView"===i(t),B=t=>{t=t.type;return"string"==typeof t&&!!r.has(t)};var e=t=>{var e;return a(t)?[t]:(e=i(t),n({type:e,static:B(t)})(t))},o=[];const s=new Map;for(var l=new Map,c=[H],u=[];c.length;){var h=c.shift();if(a(h)){var f=l.get(h),[f,d]=f?WL(f,h,V):yield FL(h,V),p=(s.set(f,h),o.push(f),d.flatMap(e).map(t=>e8(t,V)));if(c.push(...p),p.every(a)){var g=yield Promise.all(p.map(t=>zL(t,V)));VP(f=(f=g).flatMap(t=>Array.from(t.values())).flatMap(t=>t.channels.map(t=>t.scale)),"x"),VP(f,"y");for(let t=0;t<p.length;t++){var D=p[t],F=g[t];l.set(D,F)}}}else{d="mark"===i(h)?h:yield XL(h,V),f=e(d);Array.isArray(f)?c.push(...f):"function"==typeof f&&u.push(f())}}q.emitter.emit(tS.BEFORE_PAINT);const y=new Map,m=new Map,v=[];Y.selectAll(JL(ru)).data(o,t=>t.key).join(t=>t.append("g").attr("className",ru).attr("id",t=>t.key).call(DL).each(function(t){GL(t,st(this),v,V,q),y.set(t,this)}),t=>t.call(DL).each(function(t){GL(t,st(this),v,V,q),m.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(f,d,p){return h=>X(this,void 0,void 0,function*(){var t,[e,n]=yield FL(h,d),r=(GL(e,f,[],d,p),f),i=h,a=e,o=p,[s]=JT("interaction",s=d),l=(l=r.node()).nameInteraction,c=UL(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)BL(u,f,d,p);return{options:h,view:e}})}(st(e),V,q)})),x=b(y);for(const P of x){const H=P["options"];var w=new Map;P.container.nameInteraction=w;for(const L of UL(H)){var[M,O]=L;O&&(O=t(Object.assign({type:M},O))(P,x,q.emitter),w.set(M,{destroy:O}))}}var k=b(m);for(const C of k){const{options:H,container:N}=C;var E=N.nameInteraction;for(const j of UL(H)){var[S,A]=j,_=E.get(S);_&&null!=($=_.destroy)&&$.call(_),A&&(_=t(Object.assign({type:S},A))(C,k,q.emitter),E.set(S,{destroy:_}))}}const{width:z,height:W}=H;var T=[];for(const R of u){var G=new Promise(e=>X(this,void 0,void 0,function*(){for(const t of R)yield BL(Object.assign({width:z,height:W},t),Y,V,q);e()}));T.push(G)}q.views=o,null!=(U=q.animations)&&U.forEach(t=>null==t?void 0:t.cancel()),q.animations=v,q.emitter.emit(tS.AFTER_PAINT);b=v.filter(d0).map(qL).map(t=>t.finished);return Promise.all([...b,...T])})}function DL(t){t.style("transform",t=>`translate(${t.layout.x}, ${t.layout.y})`)}function FL(e,n){return X(this,void 0,void 0,function*(){var t=function(t){var{coordinate:e={},interaction:n={},style:r={},marks:i}=t,t=it(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)=>ot(t,e),{}),e=[n,...o].reduce((t,e)=>ot(t,e),{}),n=[...s,r].reduce((t,e)=>ot(t,e),{});return Object.assign(Object.assign({},t),{marks:i,coordinate:a,interaction:e,style:n})}(yield function(p,g){return X(this,void 0,void 0,function*(){var[t,e]=JT("mark",g),n=new Set(Object.keys(g).map(t=>{return null==(t=/component\.(.*)/.exec(t))?void 0:t[1]}).filter(d0));const r=p["marks"];for(var i=[],a=[],o=[...r],{width:s,height:l}=function(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:h=u,insetRight:f=u,insetTop:d=u,insetBottom:u=u}=t,p=t=>"auto"===t?30:t;return{width:e-p(r)-p(i)-s-l-h-f,height:t-p(a)-p(n)-c-o-d-u}}(p),c={options:p,width:s,height:l};o.length;){var[u]=o.splice(0,1),u=yield XL(u,g);const{type:f=h0("G2Mark type is required."),key:d}=u;if(n.has(f))a.push(u);else{var{props:h={}}=e(f),{composite:h=!0}=h;if(h){const r=yield t(u,c);h=Array.isArray(r)?r:[r];o.unshift(...h.map((t,e)=>Object.assign(Object.assign({},t),{key:d+"-"+e})))}else i.push(u)}}return Object.assign(Object.assign({},p),{marks:i,components:a})})}(e,n)),t=(e.interaction=t.interaction,e.coordinate=t.coordinate,e8(t,n));return WL(yield zL(t,n),t,n)})}function zL(p,g){return X(this,void 0,void 0,function*(){var[t]=JT("theme",g),[,e]=JT("mark",g),{theme:n,marks:r,coordinates:i=[]}=p,a=t($L(n)),o=new Map;for(const h of r){var s,l=h["type"],{props:l={}}=e(l),l=yield IL(h,l,g);l&&([l,s]=l,o.set(l,s))}for(const f of Wd(Array.from(o.values()).flatMap(t=>t.channels),({scaleKey:t})=>t).values()){var c=f.reduce((t,{scale:e})=>ot(t,e),{}),u=f[0]["values"],u=Array.from(new Set(u.map(t=>t.field).filter(d0)));const p=ot({guide:{title:0===u.length?void 0:u},field:u[0]},c);u=f[0]["name"];const d=GP(u,f.flatMap(({values:t})=>t.map(t=>t.value)),p,i,a,g);f.forEach(t=>t.scale=d)}return o})}function WL(t,e,n){var[r]=JT("mark",n),[i]=JT("theme",n),[a]=JT("labelTransform",n);const{key:o,frame:s=!1,theme:I,clip:B,style:l={},labelTransform:D=[]}=e;var i=i($L(I)),c=Array.from(t.values());const u=HP(c,e);var c=oL(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(u),c,t),e,n),h=ML(c,e,i,n),f=function(t,e,n){var[n]=JT("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 ZT(Object.assign(Object.assign({},t),{x:a+c,y:o+u,width:i-a-s,height:r-l-o,transformations:e.map(n).flat()}))}(h,e,n),e=s?ot({mainLineWidth:1,mainStroke:"#000"},l):l,d=(kL(lL(c),f,h),{});for(const x of c){var{scales:F=[]}=x;const u=[];for(const w of F){var z=w["name"],p=YP(w,n);u.push(p),d[z]=p}x.scaleInstances=u}var g,y,m=[];for([g,y]of t.entries()){const{children:M,dataDomain:O,modifier:k,key:E}=g,{index:S,channels:A,tooltip:_}=y;var v=dv(Object.fromEntries(A.map(({name:t,scale:e})=>[t,e])),t=>YP(t,n));Object.assign(d,v);const T=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}(A,v),[P,L,C]=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])=>d0(t)&&d0(e))&&(r.push(a),i.push(o))}return[r,i]}(r(g)(S,v,T,f));var b=O||P.length;const N=k?k(L,b,h):[],j=t=>{var e;return null==(e=null==(e=_.title)?void 0:e[t])?void 0:e.value},R=e=>_.items.map(t=>t[e]);b=P.map((t,e)=>{var n=Object.assign({points:L[e],transform:N[e],index:t,markKey:E,viewKey:o},_&&{title:j(t),items:R(t)});for(const[r,i]of Object.entries(T))n[r]=i[t],C&&(n["series"+Ye(r)]=C[e].map(t=>i[t]));return C&&(n.seriesIndex=C[e]),C&&_&&(n.seriesItems=C[e].map(t=>R(t)),n.seriesTitle=C[e].map(t=>j(t))),n}),b=(y.data=b,y.index=P,null==M?void 0:M(b,v,h));m.push(...b||[])}return[{layout:h,theme:i,coordinate:f,markState:t,key:o,clip:B,scale:d,style:e,components:c,labelTransform:c0(D.map(a))},m]}function GL(J,tt,et,nt,rt){X(this,void 0,void 0,function*(){const{components:I,theme:n,layout:t,markState:r,coordinate:i,key:e,style:B,clip:a,scale:o}=J,{width:D,height:F}=t,z=it(t,["x","y","width","height"]),s=["view","plot","main","content"];var l=s.map((t,e)=>e);const c=s.map(t=>p0(Object.assign({},n,B),t)),W=["a","margin","padding","inset"].map(t=>at(z,t)),u=t=>t.style("x",t=>g[t].x).style("y",t=>g[t].y).style("width",t=>g[t].width).style("height",t=>g[t].height).each(function(t){var e,n,r=st(this),t=c[t];for([e,n]of Object.entries(t))r.style(e,n)});let h=0,f=0,d=D,p=F;const g=l.map(t=>{var{left:t=0,top:e=0,bottom:n=0,right:r=0}=W[t];return h+=t,f+=e,d-=t+r,p-=e+n,{x:h,y:f,width:d,height:p}}),y=(tt.selectAll(JL(su)).data(l.filter(t=>d0(c[t])),t=>s[t]).join(t=>t.append("rect").attr("className",su).style("zIndex",-2).call(u),t=>t.call(u),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:h=300,delay:f=0}=r,{type:d,duration:p=300,delay:g=0}=o;for(const E of i){var{updateType:y=s,updateDuration:m=l,updateDelay:v=c,enterType:b=u,enterDuration:x=h,enterDelay:w=f,exitDuration:M=p,exitDelay:O=g,exitType:k=d}=E;void 0!==y&&!y||(e=Math.max(e,m+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=!!y&&{duration:y[1]};var v,b,x,l=tt.selectAll(JL(au)).data(I,(t,e)=>t.type+"-"+e).join(t=>t.append("g").style("zIndex",({zIndex:t})=>t||-1).attr("className",au).append(t=>sL(ot({animate:m,scale:o},t),i,n,nt,r)),t=>t.transition(function(t){var{preserve:e=!1}=t;if(!e)return e=sL(ot({animate:m,scale:o},t),i,n,nt,r)["attributes"],[t]=this.childNodes,t.update(e)})).transitions();et.push(...l.flat().filter(d0));const w=tt.selectAll(JL(iu)).data([t],()=>e).join(t=>t.append("rect").style("zIndex",0).style("fill","transparent").attr("className",iu).call(KL).call(QL,Array.from(r.keys())).call(tC,a),t=>t.call(QL,Array.from(r.keys())).call(t=>{if(!y)return KL(t);{const[l,c]=y;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(tC,a)).transitions();et.push(...w.flat());for([v,b]of r.entries()){var G=b["data"];const{key:e,class:V,type:_}=v;var M=tt.select("#"+e);const T=function(s,t,e,n,r){const[l]=JT("shape",n),c=s["data"],{defaultShape:u,data:i}=t,h=i.map(t=>t.points),{theme:f,coordinate:a}=e,{type:d,style:p={}}=s,g=Object.assign(Object.assign({},r),{document:t8(r),coordinate:a,theme:f});return t=>{var{shape:e=u}=p,{shape:e=e,points:n,seriesIndex:r,index:i}=t,t=it(t,["shape","points","seriesIndex","index"]),t=Object.assign(Object.assign({},t),{index:i});const a=r?r.map(t=>c[t]):c[i],o=r||i;r=dv(p,t=>HL(t,a,o,c)),i=Object.assign(Object.assign({},r),{type:ZL(s,e)});return l(i,g)(n,t,YL(f,d,e,u),h)}}(v,b,J,nt,rt),q=(O=v,x=b,VL("enter",O,x,J,nt)),P=(O=v,x=b,VL("update",O,x,J,nt)),$=(O=v,x=b,VL("exit",O,x,J,nt));var O=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))}(tt,M,V,"element");const w=M.selectAll(JL(nu)).selectFacetAll(O).data(G,t=>t.key,t=>t.groupKey).join(t=>t.append(T).attr("className",nu).attr("markType",_).transition(function(t){return q(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=T(t,e),s=P(t,[this],[o]);return null===s&&(this.nodeName===o.nodeName?f0(this,o):this.parentNode.replaceChild(o,this)),s})}),t=>t.each(function(){this.__removed__=!0}).transition(function(t){return $(t,[this])}).remove(),t=>t.append(T).attr("className",nu).attr("markType",_).transition(function(t){var e=this["__fromElements__"],t=P(t,e,[this]);return new Nv(e,null,this.parentNode).transition(t).remove(),t}),t=>t.transition(function(t){var e=new Nv([],this.__toData__,this.parentNode).append(T).attr("className",nu).attr("markType",_).nodes();return P(t,[this],e)}).remove()).transitions();et.push(...w.flat())}{var k=J,E=tt,S=nt,H=rt,A,Y;const[U]=JT("labelTransform",S),{markState:X,labelTransform:L}=k,K=E.select(JL(eu)).node(),C=new Map,N=new Map,Z=Array.from(X.entries()).flatMap(([t,e])=>{var{labels:n=[],key:r}=t;const i=function(t,e,n,r,i){const[s]=JT("shape",r),l=t["data"],{data:a,defaultLabelShape:c}=e,u=a.map(t=>t.points),{theme:h,coordinate:o}=n,f=Object.assign(Object.assign({},i),{document:t8(i),theme:h,coordinate:o});return t=>{const{index:e,points:n}=t,r=l[e];var{formatter:i=t=>""+t,style:a}=t,t=it(t,["formatter","transform","style"]),t=dv(Object.assign(Object.assign({},t),a),t=>HL(t,r,e,l)),{shape:a=c,text:o}=t,t=it(t,["shape","text"]),i="string"==typeof i?ok(i):i,i=Object.assign(Object.assign({},t),{text:i(o,r,e,l)}),o=Object.assign({type:"label."+a},t);return s(o,f)(n,i,YL(h,"label",a,"label"),u)}}(t,e,k,S,H),a=E.select("#"+r).selectAll(JL(nu)).nodes().filter(t=>!t.__removed__);return n.flatMap((e,n)=>{const r=it(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.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=>{C.set(t,i),N.set(t,e)}),t})})}),j=st(K).selectAll(JL(ou)).data(Z,t=>t.key).join(t=>t.append(t=>C.get(t)(t)).attr("className",ou),t=>t.each(function(t){f0(this,C.get(t)(t))}),t=>t.remove()).nodes(),Q=Wd(j,t=>N.get(t.__data__)),R=k["coordinate"];for([A,Y]of Q){var{transform:A=[]}=A;c0(A.map(U))(Y,R)}L&&L(j,R)}})}function HL(t,e,n,r){return"function"==typeof t?t(e,n,r):"string"==typeof t&&void 0!==e[t]?e[t]:t}function YL(t,e,n,r){var i;if("string"==typeof e)return i=t["defaultColor"],e=(t=t[e]||{})[n]||t[r],Object.assign({color:i},e)}function VL(o,t,e,n,r){var[,i]=JT("shape",r);const[s]=JT("animation",r);var r=e["defaultShape"],{theme:e,coordinate:n}=n,a=`default${Ye(o)}Animation`;const{[a]:l}=i(ZL(t,r)).props,{[o]:c={}}=e,u=(null==(i=t.animate)?void 0:i[o])||{},h={coordinate:n};return(t,e,n)=>{var{[o+"Type"]:t,[o+"Delay"]:r,[o+"Duration"]:i,[o+"Easing"]:a}=t,t=Object.assign({type:t||l},u);return t.type?(r={delay:r,duration:i,easing:a},i=s(t,h)(e,n,ot(c,r)),Array.isArray(i)?i:[i]):null}}function qL(t){return t.finished.then(()=>{t.cancel()}),t}function $L(t={}){var e;return"string"==typeof t?{type:t}:({type:e="classic"}=t,t=it(t,["type"]),Object.assign(Object.assign({},t),{type:e}))}function UL(t){var{interaction:t={}}=t;return Object.entries(ot({event:!0,tooltip:!0,sliderFilter:!0,legendFilter:!0,scrollbarFilter:!0},t))}function XL(r,i){return X(this,void 0,void 0,function*(){var t={library:i},e=r["data"],n=it(r,["data"]);return null==e?r:([,{data:e}]=yield SL(0,{data:e},t),Object.assign({data:e},n))})}function KL(t){t.style("x",t=>t.paddingLeft).style("y",t=>t.paddingTop).style("width",t=>t.innerWidth).style("height",t=>t.innerHeight)}function ZL(t,e){t=t.type;return"string"==typeof e?t+"."+e:e}function QL(t,e){const n=t=>void 0!==t.class?""+t.class:"";0===t.nodes().length||(t.selectAll(JL(tu)).data(e,t=>t.key).join(t=>t.append("g").attr("className",tu).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(JL(eu)).node())||t.append("g").attr("className",eu).style("zIndex",0)}function JL(...t){return t.map(t=>"."+t).join("")}function tC(t,i){t.node()&&t.style("clipPath",t=>{var e,n,r;return i?({paddingTop:t,paddingLeft:e,innerWidth:n,innerHeight:r}=t,new kc({style:{x:e,y:t,width:n,height:r}})):null})}function eC(t){for(var t=ot({},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=ot({},s[t]);s[t]=l,e.set(l,o),n.set(l,t),r.push(l)}}return t}function nC(t,e={},n=()=>{},r=t=>{throw t}){const{width:i=640,height:a=480,theme:o}=t,s=(o||h0('ChartOptions.theme is required, such as `const chart = new Chart({ theme: "classic"})`.'),eC(t)),{canvas:l=(t=i,h=a,f=new zh,f.registerPlugin(new Vh),new Qc({width:t,height:h,container:document.createElement("div"),renderer:f})),library:c=OT(),emitter:u=new $h}=e;var h,f;e.canvas=l,e.library=c,e.emitter=u,l.resize(i,a),u.emit(tS.BEFORE_RENDER);const d=st(l.document.documentElement);return l.ready.then(()=>BL(Object.assign(Object.assign({},s),{width:i,height:a}),d,c,e)).then(()=>{l.requestAnimationFrame(()=>{u.emit(tS.AFTER_RENDER),null!=n&&n()})}).catch(t=>{null!=r&&r(t)}),"string"==typeof(t=l.getConfig().container)?document.getElementById(t):t}function rC(t,e={},n=!1){var r,{canvas:e,emitter:i}=e;e&&(null!=(r=(r=e).getRoot().querySelectorAll("."+ru))&&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 iC(t,{name:e,key:n=e}){t.prototype[e]=function(t){return 0===arguments.length?this.attr(n):this.attr(n,t)}}function aC(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 oC(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 y(r){return t=>{for(const n of r){var e=n["type"];"value"===e?iC(t,n):"array"===e?aC(t,n):"object"===e?oC(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}):m0(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 sC(t){return Object.entries(t).map(([t,e])=>({type:"node",name:t,ctor:e}))}function lC(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 cC{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 lC(this,t=>{e===t.attr("key")&&(n=t)}),n}getNodesByType(e){const n=[];return lC(this,t=>{e===t.type&&n.push(t)}),n}getNodeByType(e){let n=null;return lC(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 uC extends cC{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)}}o=[{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"}],i=[{name:"scale",type:"object"},{name:"transform",type:"array"},{name:"style",type:"object"},{name:"state",type:"object"}],Do=i;let hC=class extends uC{constructor(){super({})}},fC=(hC=e([y(o)],hC),class extends uC{constructor(){super({},"interval")}}),dC=(fC=e([y(o)],fC),class extends uC{constructor(){super({},"rect")}}),pC=(dC=e([y(o)],dC),class extends uC{constructor(){super({},"point")}}),gC=(pC=e([y(o)],pC),class extends uC{constructor(){super({},"area")}}),yC=(gC=e([y(o)],gC),class extends uC{constructor(){super({},"line")}}),mC=(yC=e([y(o)],yC),class extends uC{constructor(){super({},"cell")}}),vC=(mC=e([y(o)],mC),class extends uC{constructor(){super({},"vector")}}),bC=(vC=e([y(o)],vC),class extends uC{constructor(){super({},"link")}}),xC=(bC=e([y(o)],bC),class extends uC{constructor(){super({},"polygon")}});xC=e([y(o)],xC);jo=e([y(o)],class extends uC{constructor(){super({},"image")}});let wC=class extends uC{constructor(){super({},"text")}},MC=(wC=e([y(o)],wC),class extends uC{constructor(){super({},"box")}}),OC=(MC=e([y(o)],MC),class extends uC{constructor(){super({},"lineX")}}),kC=(OC=e([y(o)],OC),class extends uC{constructor(){super({},"lineY")}}),EC=(kC=e([y(o)],kC),class extends uC{constructor(){super({},"range")}}),SC=(EC=e([y(o)],EC),class extends uC{constructor(){super({},"rangeX")}}),AC=(SC=e([y(o)],SC),class extends uC{constructor(){super({},"rangeY")}}),_C=(AC=e([y(o)],AC),class extends uC{constructor(){super({},"connector")}}),TC=(_C=e([y(o)],_C),class extends uC{constructor(){super({},"shape")}}),PC=(TC=e([y(o)],TC),class extends uC{constructor(){super({},"sankey")}}),LC=(PC=e([y([...o,{name:"layout",type:"value"}])],PC),class extends uC{constructor(){super({},"treemap")}}),CC=(LC=e([y([...o,{name:"layout",type:"value"}])],LC),class extends uC{constructor(){super({},"boxplot")}}),NC=(CC=e([y(o)],CC),class extends uC{constructor(){super({},"density")}}),jC=(NC=e([y(o)],NC),class extends uC{constructor(){super({},"heatmap")}}),RC=(jC=e([y(o)],jC),class extends uC{constructor(){super({},"path")}}),IC=(RC=e([y(o)],RC),class extends uC{constructor(){super({},"pack")}}),BC=(IC=e([y([...o,{name:"layout",type:"value"}])],IC),class extends uC{constructor(){super({},"forceGraph")}}),DC=(BC=e([y([...o,{name:"layout",type:"value"}])],BC),class extends uC{constructor(){super({},"tree")}}),FC=(DC=e([y([...o,{name:"layout",type:"value"}])],DC),class extends uC{constructor(){super({},"wordCloud")}}),zC=(FC=e([y([...o,{name:"layout",type:"object"}])],FC),class extends uC{constructor(){super({},"gauge")}}),WC=(zC=e([y(o)],zC),class extends uC{constructor(){super({},"axisX")}}),GC=(WC=e([y(i)],WC),class extends uC{constructor(){super({},"axisY")}}),HC=(GC=e([y(i)],GC),class extends uC{constructor(){super({},"legends")}});HC=e([y(Do)],HC);const YC={mark:hC,interval:fC,rect:dC,point:pC,area:gC,line:yC,cell:mC,vector:vC,link:bC,polygon:xC,image:jo,text:wC,box:MC,lineX:OC,lineY:kC,range:EC,rangeX:SC,rangeY:AC,connector:_C,sankey:PC,treemap:LC,boxplot:CC,density:NC,heatmap:jC,path:RC,shape:TC,pack:IC,forceGraph:BC,tree:DC,wordCloud:FC,gauge:zC,axisX:WC,axisY:GC,legends:HC};class VC extends cC{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()&&SE(t)}hide(){var t=this.getGroup();t&&t.isVisible()&&EE(t)}}let qC=class extends VC{constructor(t={},e="view"){super(t,e)}},$C=(qC=e([y([{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"},...sC(YC)])],qC),class extends VC{constructor(){super({},"spaceLayer")}}),UC=($C=e([y([{type:"value",name:"data"},...sC(YC)])],$C),class extends VC{constructor(){super({},"spaceFlex")}}),XC=(UC=e([y([{type:"value",name:"data"},...sC(YC)])],UC),class extends VC{constructor(){super({},"facetRect")}}),KC=(XC=e([y([{type:"value",name:"data"},{type:"array",name:"transform"},{type:"object",name:"scale"},{type:"object",name:"encode"},{type:"object",name:"legend"},{type:"object",name:"axis"},...sC(YC)])],XC),class extends VC{constructor(){super({},"facetCircle")}}),ZC=(KC=e([y([{type:"value",name:"data"},{type:"array",name:"transform"},{type:"object",name:"scale"},{type:"object",name:"encode"},{type:"object",name:"legend"},{type:"object",name:"axis"},...sC(YC)])],KC),class extends VC{constructor(){super({},"repeatMatrix")}}),QC=(ZC=e([y([{type:"value",name:"data"},{type:"array",name:"transform"},{type:"object",name:"scale"},{type:"object",name:"encode"},{type:"object",name:"encode"},{type:"object",name:"legend"},...sC(YC)])],ZC),class extends VC{constructor(){super({},"timingKeyframe")}}),JC=(QC=e([y([...sC(YC)])],QC),class extends VC{constructor(){super({},"geoView")}}),t7=(JC=e([y([{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"},...sC(YC)])],JC),class extends VC{constructor(){super({},"geoPath")}});t7=e([y([{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"},...sC(YC)])],t7);const e7={view:qC,spaceLayer:$C,spaceFlex:UC,facetRect:XC,facetCircle:KC,repeatMatrix:ZC,timingKeyframe:QC,geoView:JC,geoPath:t7};for(const f7 of Object.values(e7))y(sC(e7))(f7);const n7=OT();const r7=t=>t?parseInt(t):0;const i7=["width","height","padding","paddingLeft","paddingRight","paddingBottom","paddingTop","inset","insetLeft","insetRight","insetTop","insetBottom","margin","marginLeft","marginRight","marginTop","marginBottom","autoFit","theme","title"];function a7(t){return Object.assign(Object.assign({},t.value),{type:t.type})}function o7(t,e){var n,r=t["autoFit"];return r?(r=e,e=getComputedStyle(r),n=r.clientWidth||r7(e.width),r=r.clientHeight||r7(e.height),{width:n-(r7(e.paddingLeft)+r7(e.paddingRight)),height:r-(r7(e.paddingTop)+r7(e.paddingBottom))}):({width:n=640,height:r=480}=t,{width:n,height:r})}function s7(t){var t=function(t){if(null!==t.type)return t;var e=t.children[t.children.length-1];for(const n of i7)e.attr(n,t.attr(n));return e}(t),e=[t],n=new Map;for(n.set(t,a7(t));e.length;){const t=e.pop();var r=n.get(t),{children:i=[]}=t;for(const s of i){var a=a7(s),{children:o=[]}=r;o.push(a),e.push(s),n.set(s,a),r.children=o}}return n.get(t)}function l7(t,e,n){var t=t["type"],{type:n=n||t}=e;if("view"===n)return e;if("function"!=typeof(t=n)&&!new Set(Object.keys(YC)).has(t))return e;var r={type:"view"},i=Object.assign({},e);for(const a of i7)void 0!==i[a]&&(r[a]=i[a],delete i[a]);return Object.assign(Object.assign({},r),{children:[i]})}function c7(t){var e=t["type"],t=it(t,["type","children"]),n=new(function(t){if("function"==typeof t)return YC.mark;var e=Object.assign(Object.assign({},YC),e7)[t];if(e)return e;throw new Error(`Unknown mark: ${t}.`)}(e));return n.value=t,n.type=e,n}function u7(t,e){var n=e["type"],e=it(e,["type","children"]);t.type===n||void 0===n?function t(e,n,r=5,i=0){if(!(r<=i))for(const o of Object.keys(n)){var a=n[o];Ce(a)&&Ce(e[o])?t(e[o],a,r,i+1):e[o]=a}}(t.value,e):"string"==typeof n&&(t.type=n,t.value=e)}function h7(t,e,n){for(var r=[[null,t,l7(t,e,n)]];r.length;){var[i,a,o]=r.shift();if(a)if(o){u7(a,o);var s=o["children"],l=a["children"];if(Array.isArray(s)&&Array.isArray(l)){var c=Math.max(s.length,l.length);for(let t=0;t<c;t++){var u=s[t],h=l[t];r.push([a,h,u])}}}else a.remove();else{y=g=p=d=f=void 0;var f=i,d=o;if(f)for(var p=[[f,d]];p.length;){const[f,m]=p.shift();var g=c7(m),y=(Array.isArray(f.children)&&f.push(g),m)["children"];if(Array.isArray(y))for(const v of y)p.push([g,v])}}}}To=[{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"},...sC(YC),...(Ys=e7,Object.entries(Ys).map(([t,e])=>({type:"container",name:t,ctor:e})))];w.Chart=class extends qC{constructor(t){var t=t||{},{container:e,canvas:n,renderer:r,plugins:i}=t;super(it(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=Ue(()=>{this.forceFit()},300),this._renderer=r||new zh,this._plugins=i||[],this._container=void 0===(t=e)?document.createElement("div"):"string"==typeof t?document.getElementById(t):t,this._emitter=new $h,this._context={library:n7,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)=>nC(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?s7(this):(e=t["type"],e&&(this._previousDefinedType=e),h7(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(tS.BEFORE_CLEAR),this._reset(),rC(0,this._context,!1),this.emit(tS.AFTER_CLEAR)}destroy(){var t,e;this.options();this.emit(tS.BEFORE_DESTROY),this._unbindAutoFit(),this._reset(),rC(0,this._context,!0),t=this._container,(e=t.parentNode)&&e.removeChild(t),this.emit(tS.AFTER_DESTROY)}forceFit(){this.options.autoFit=!0;var{width:t,height:e}=o7(this.options(),this._container);if(t===this._width&&e===this._height)return Promise.resolve(this);this.emit(tS.BEFORE_CHANGE_SIZE);t=this.render();return t.then(()=>{this.emit(tS.AFTER_CHANGE_SIZE)}),t}changeSize(t,e){if(t===this._width&&e===this._height)return Promise.resolve(this);this.emit(tS.BEFORE_CHANGE_SIZE),this.width(t),this.height(e);t=this.render();return t.then(()=>{this.emit(tS.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}=o7(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}=o7(this.options(),this._container);this._plugins.push(new Vh),this._plugins.forEach(t=>this._renderer.registerPlugin(t)),this._context.canvas=new Qc({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))}},w.Chart=e([y(To)],w.Chart),_.enableCSSParsing=!1,w.AREA_CLASS_NAME=su,w.COMPONENT_CLASS_NAME=au,w.ChartEvent=tS,w.CompositionNode=VC,w.ELEMENT_CLASS_NAME=nu,w.LABEL_CLASS_NAME=ou,w.LABEL_LAYER_CLASS_NAME=eu,w.MAIN_LAYER_CLASS_NAME=tu,w.MarkNode=uC,w.PLOT_CLASS_NAME=iu,w.VIEW_CLASS_NAME=ru,w.createLibrary=OT,w.register=function(t,e){Object.assign(n7,{[t]:e})},w.render=nC,w.renderToMountedElement=function(t,e={},n=()=>{},r=t=>{throw t}){var{width:i=640,height:a=480}=t,t=eC(t);const{library:o=OT(),group:s=new rc,emitter:l=new $h}=e;null!==s&&void 0!==s&&s.parentElement||h0("renderToMountedElement can't render chart to unmounted group.");var c=st(s);return e.group=s,e.library=o,(e.emitter=l).emit(tS.BEFORE_RENDER),BL(Object.assign(Object.assign({},t),{width:i,height:a}),c,o,e).then(()=>{s.ownerDocument.defaultView.requestAnimationFrame(()=>{l.emit(tS.AFTER_RENDER),null!=n&&n()})}).catch(t=>{null!=r&&r(t)}),s},Object.defineProperty(w,"__esModule",{value:!0})});
|