|
|
(self.webpackChunk=self.webpackChunk||[]).push([[8545],{88831:function(t,e,n){"use strict";n.d(e,{kJ:function(){return LO},RN:function(){return BO}});var r={};n.r(r),n.d(r,{add:function(){return Ot},adjoint:function(){return Y},clone:function(){return _},copy:function(){return Z},create:function(){return F},decompose:function(){return ft},determinant:function(){return q},equals:function(){return Lt},exactEquals:function(){return Dt},frob:function(){return Ct},fromQuat:function(){return vt},fromQuat2:function(){return ct},fromRotation:function(){return it},fromRotationTranslation:function(){return lt},fromRotationTranslationScale:function(){return pt},fromRotationTranslationScaleOrigin:function(){return gt},fromScaling:function(){return rt},fromTranslation:function(){return nt},fromValues:function(){return G},fromXRotation:function(){return ot},fromYRotation:function(){return at},fromZRotation:function(){return st},frustum:function(){return mt},getRotation:function(){return dt},getScaling:function(){return ht},getTranslation:function(){return ut},identity:function(){return W},invert:function(){return U},lookAt:function(){return St},mul:function(){return It},multiply:function(){return X},multiplyScalar:function(){return Pt},multiplyScalarAndAdd:function(){return Rt},ortho:function(){return kt},orthoNO:function(){return wt},orthoZO:function(){return Mt},perspective:function(){return bt},perspectiveFromFieldOfView:function(){return Et},perspectiveNO:function(){return yt},perspectiveZO:function(){return xt},rotate:function(){return J},rotateX:function(){return $},rotateY:function(){return tt},rotateZ:function(){return et},scale:function(){return Q},set:function(){return V},str:function(){return Nt},sub:function(){return Bt},subtract:function(){return Tt},targetTo:function(){return At},translate:function(){return K},transpose:function(){return H}});var i={};n.r(i),n.d(i,{circle:function(){return qg},diamond:function(){return Kg},rect:function(){return Jg},simple:function(){return tv},triangle:function(){return Xg},triangleRect:function(){return $g},vee:function(){return Qg}});var o=n(33885),a=n(67732),s=n(83652),l=n(94480),c=n(22214),u=n(42403),h=n(42978),d=n(37271),f=1e-6,p="undefined"!=typeof Float32Array?Float32Array:Array;Math.random;Math.PI,Math.PI;function g(){var t=new p(3);return p!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function v(t){var e=new p(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function m(t){var e=t[0],n=t[1],r=t[2];return Math.sqrt(e*e+n*n+r*r)}function y(t,e,n){var r=new p(3);return r[0]=t,r[1]=e,r[2]=n,r}function b(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function x(t,e,n,r){return t[0]=e,t[1]=n,t[2]=r,t}function E(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function w(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function k(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t[2]=e[2]*n[2],t}function M(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}function S(t,e){var n=e[0],r=e[1],i=e[2],o=n*n+r*r+i*i;return o>0&&(o=1/Math.sqrt(o)),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o,t}function A(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function N(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[0],s=n[1],l=n[2];return t[0]=i*l-o*s,t[1]=o*a-r*l,t[2]=r*s-i*a,t}function C(t,e,n,r){var i=e[0],o=e[1],a=e[2];return t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t[2]=a+r*(n[2]-a),t}function O(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[3]*r+n[7]*i+n[11]*o+n[15];return a=a||1,t[0]=(n[0]*r+n[4]*i+n[8]*o+n[12])/a,t[1]=(n[1]*r+n[5]*i+n[9]*o+n[13])/a,t[2]=(n[2]*r+n[6]*i+n[10]*o+n[14])/a,t}function T(t,e,n){var r=n[0],i=n[1],o=n[2],a=n[3],s=e[0],l=e[1],c=e[2],u=i*c-o*l,h=o*s-r*c,d=r*l-i*s;return u+=u,h+=h,d+=d,t[0]=s+a*u+i*d-o*h,t[1]=l+a*h+o*u-r*d,t[2]=c+a*d+r*h-i*u,t}function P(t,e){var n=t[0],r=t[1],i=t[2],o=e[0],a=e[1],s=e[2];return Math.abs(n-o)<=f*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(r-a)<=f*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(i-s)<=f*Math.max(1,Math.abs(i),Math.abs(s))}var R,D=w,L=function(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2];return Math.sqrt(n*n+r*r+i*i)},I=m;R=g();function B(){var t=new p(4);return p!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function j(t,e,n,r){var i=new p(4);return i[0]=t,i[1]=e,i[2]=n,i[3]=r,i}function z(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3];return t[0]=n[0]*r+n[4]*i+n[8]*o+n[12]*a,t[1]=n[1]*r+n[5]*i+n[9]*o+n[13]*a,t[2]=n[2]*r+n[6]*i+n[10]*o+n[14]*a,t[3]=n[3]*r+n[7]*i+n[11]*o+n[15]*a,t}!function(){var t=B()}();function F(){var t=new p(16);return p!=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 _(t){var e=new p(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 Z(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 G(t,e,n,r,i,o,a,s,l,c,u,h,d,f,g,v){var m=new p(16);return m[0]=t,m[1]=e,m[2]=n,m[3]=r,m[4]=i,m[5]=o,m[6]=a,m[7]=s,m[8]=l,m[9]=c,m[10]=u,m[11]=h,m[12]=d,m[13]=f,m[14]=g,m[15]=v,m}function V(t,e,n,r,i,o,a,s,l,c,u,h,d,f,p,g,v){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o,t[5]=a,t[6]=s,t[7]=l,t[8]=c,t[9]=u,t[10]=h,t[11]=d,t[12]=f,t[13]=p,t[14]=g,t[15]=v,t}function W(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 H(t,e){if(t===e){var n=e[1],r=e[2],i=e[3],o=e[6],a=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]=o,t[11]=e[14],t[12]=i,t[13]=a,t[14]=s}else 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];return t}function U(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],l=e[6],c=e[7],u=e[8],h=e[9],d=e[10],f=e[11],p=e[12],g=e[13],v=e[14],m=e[15],y=n*s-r*a,b=n*l-i*a,x=n*c-o*a,E=r*l-i*s,w=r*c-o*s,k=i*c-o*l,M=u*g-h*p,S=u*v-d*p,A=u*m-f*p,N=h*v-d*g,C=h*m-f*g,O=d*m-f*v,T=y*O-b*C+x*N+E*A-w*S+k*M;return T?(T=1/T,t[0]=(s*O-l*C+c*N)*T,t[1]=(i*C-r*O-o*N)*T,t[2]=(g*k-v*w+m*E)*T,t[3]=(d*w-h*k-f*E)*T,t[4]=(l*A-a*O-c*S)*T,t[5]=(n*O-i*A+o*S)*T,t[6]=(v*x-p*k-m*b)*T,t[7]=(u*k-d*x+f*b)*T,t[8]=(a*C-s*A+c*M)*T,t[9]=(r*A-n*C-o*M)*T,t[10]=(p*w-g*x+m*y)*T,t[11]=(h*x-u*w-f*y)*T,t[12]=(s*S-a*N-l*M)*T,t[13]=(n*N-r*S+i*M)*T,t[14]=(g*b-p*E-v*y)*T,t[15]=(u*E-h*b+d*y)*T,t):null}function Y(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],l=e[6],c=e[7],u=e[8],h=e[9],d=e[10],f=e[11],p=e[12],g=e[13],v=e[14],m=e[15],y=n*s-r*a,b=n*l-i*a,x=n*c-o*a,E=r*l-i*s,w=r*c-o*s,k=i*c-o*l,M=u*g-h*p,S=u*v-d*p,A=u*m-f*p,N=h*v-d*g,C=h*m-f*g,O=d*m-f*v;return t[0]=s*O-l*C+c*N,t[1]=i*C-r*O-o*N,t[2]=g*k-v*w+m*E,t[3]=d*w-h*k-f*E,t[4]=l*A-a*O-c*S,t[5]=n*O-i*A+o*S,t[6]=v*x-p*k-m*b,t[7]=u*k-d*x+f*b,t[8]=a*C-s*A+c*M,t[9]=r*A-n*C-o*M,t[10]=p*w-g*x+m*y,t[11]=h*x-u*w-f*y,t[12]=s*S-a*N-l*M,t[13]=n*N-r*S+i*M,t[14]=g*b-p*E-v*y,t[15]=u*E-h*b+d*y,t}function q(t){var e=t[0],n=t[1],r=t[2],i=t[3],o=t[4],a=t[5],s=t[6],l=t[7],c=t[8],u=t[9],h=t[10],d=t[11],f=t[12],p=t[13],g=t[14],v=e*a-n*o,m=e*s-r*o,y=n*s-r*a,b=c*p-u*f,x=c*g-h*f,E=u*g-h*p;return l*(e*E-n*x+r*b)-i*(o*E-a*x+s*b)+t[15]*(c*y-u*m+h*v)-d*(f*y-p*m+g*v)}function X(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],l=e[5],c=e[6],u=e[7],h=e[8],d=e[9],f=e[10],p=e[11],g=e[12],v=e[13],m=e[14],y=e[15],b=n[0],x=n[1],E=n[2],w=n[3];return t[0]=b*r+x*s+E*h+w*g,t[1]=b*i+x*l+E*d+w*v,t[2]=b*o+x*c+E*f+w*m,t[3]=b*a+x*u+E*p+w*y,b=n[4],x=n[5],E=n[6],w=n[7],t[4]=b*r+x*s+E*h+w*g,t[5]=b*i+x*l+E*d+w*v,t[6]=b*o+x*c+E*f+w*m,t[7]=b*a+x*u+E*p+w*y,b=n[8],x=n[9],E=n[10],w=n[11],t[8]=b*r+x*s+E*h+w*g,t[9]=b*i+x*l+E*d+w*v,t[10]=b*o+x*c+E*f+w*m,t[11]=b*a+x*u+E*p+w*y,b=n[12],x=n[13],E=n[14],w=n[15],t[12]=b*r+x*s+E*h+w*g,t[13]=b*i+x*l+E*d+w*v,t[14]=b*o+x*c+E*f+w*m,t[15]=b*a+x*u+E*p+w*y,t}function K(t,e,n){var r,i,o,a,s,l,c,u,h,d,f,p,g=n[0],v=n[1],m=n[2];return e===t?(t[12]=e[0]*g+e[4]*v+e[8]*m+e[12],t[13]=e[1]*g+e[5]*v+e[9]*m+e[13],t[14]=e[2]*g+e[6]*v+e[10]*m+e[14],t[15]=e[3]*g+e[7]*v+e[11]*m+e[15]):(r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],l=e[5],c=e[6],u=e[7],h=e[8],d=e[9],f=e[10],p=e[11],t[0]=r,t[1]=i,t[2]=o,t[3]=a,t[4]=s,t[5]=l,t[6]=c,t[7]=u,t[8]=h,t[9]=d,t[10]=f,t[11]=p,t[12]=r*g+s*v+h*m+e[12],t[13]=i*g+l*v+d*m+e[13],t[14]=o*g+c*v+f*m+e[14],t[15]=a*g+u*v+p*m+e[15]),t}function Q(t,e,n){var r=n[0],i=n[1],o=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]*o,t[9]=e[9]*o,t[10]=e[10]*o,t[11]=e[11]*o,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function J(t,e,n,r){var i,o,a,s,l,c,u,h,d,p,g,v,m,y,b,x,E,w,k,M,S,A,N,C,O=r[0],T=r[1],P=r[2],R=Math.sqrt(O*O+T*T+P*P);return R<f?null:(O*=R=1/R,T*=R,P*=R,i=Math.sin(n),a=1-(o=Math.cos(n)),s=e[0],l=e[1],c=e[2],u=e[3],h=e[4],d=e[5],p=e[6],g=e[7],v=e[8],m=e[9],y=e[10],b=e[11],x=O*O*a+o,E=T*O*a+P*i,w=P*O*a-T*i,k=O*T*a-P*i,M=T*T*a+o,S=P*T*a+O*i,A=O*P*a+T*i,N=T*P*a-O*i,C=P*P*a+o,t[0]=s*x+h*E+v*w,t[1]=l*x+d*E+m*w,t[2]=c*x+p*E+y*w,t[3]=u*x+g*E+b*w,t[4]=s*k+h*M+v*S,t[5]=l*k+d*M+m*S,t[6]=c*k+p*M+y*S,t[7]=u*k+g*M+b*S,t[8]=s*A+h*N+v*C,t[9]=l*A+d*N+m*C,t[10]=c*A+p*N+y*C,t[11]=u*A+g*N+b*C,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)}function $(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[4],a=e[5],s=e[6],l=e[7],c=e[8],u=e[9],h=e[10],d=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]=o*i+c*r,t[5]=a*i+u*r,t[6]=s*i+h*r,t[7]=l*i+d*r,t[8]=c*i-o*r,t[9]=u*i-a*r,t[10]=h*i-s*r,t[11]=d*i-l*r,t}function tt(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[0],a=e[1],s=e[2],l=e[3],c=e[8],u=e[9],h=e[10],d=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]=o*i-c*r,t[1]=a*i-u*r,t[2]=s*i-h*r,t[3]=l*i-d*r,t[8]=o*r+c*i,t[9]=a*r+u*i,t[10]=s*r+h*i,t[11]=l*r+d*i,t}function et(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[0],a=e[1],s=e[2],l=e[3],c=e[4],u=e[5],h=e[6],d=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]=o*i+c*r,t[1]=a*i+u*r,t[2]=s*i+h*r,t[3]=l*i+d*r,t[4]=c*i-o*r,t[5]=u*i-a*r,t[6]=h*i-s*r,t[7]=d*i-l*r,t}function nt(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 rt(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 it(t,e,n){var r,i,o,a=n[0],s=n[1],l=n[2],c=Math.sqrt(a*a+s*s+l*l);return c<f?null:(a*=c=1/c,s*=c,l*=c,r=Math.sin(e),o=1-(i=Math.cos(e)),t[0]=a*a*o+i,t[1]=s*a*o+l*r,t[2]=l*a*o-s*r,t[3]=0,t[4]=a*s*o-l*r,t[5]=s*s*o+i,t[6]=l*s*o+a*r,t[7]=0,t[8]=a*l*o+s*r,t[9]=s*l*o-a*r,t[10]=l*l*o+i,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)}function ot(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=r,t[6]=n,t[7]=0,t[8]=0,t[9]=-n,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function at(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,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]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function st(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=0,t[3]=0,t[4]=-n,t[5]=r,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,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=r+r,l=i+i,c=o+o,u=r*s,h=r*l,d=r*c,f=i*l,p=i*c,g=o*c,v=a*s,m=a*l,y=a*c;return t[0]=1-(f+g),t[1]=h+y,t[2]=d-m,t[3]=0,t[4]=h-y,t[5]=1-(u+g),t[6]=p+v,t[7]=0,t[8]=d+m,t[9]=p-v,t[10]=1-(u+f),t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t}function ct(t,e){var n=new p(3),r=-e[0],i=-e[1],o=-e[2],a=e[3],s=e[4],l=e[5],c=e[6],u=e[7],h=r*r+i*i+o*o+a*a;return h>0?(n[0]=2*(s*a+u*r+l*o-c*i)/h,n[1]=2*(l*a+u*i+c*r-s*o)/h,n[2]=2*(c*a+u*o+s*i-l*r)/h):(n[0]=2*(s*a+u*r+l*o-c*i),n[1]=2*(l*a+u*i+c*r-s*o),n[2]=2*(c*a+u*o+s*i-l*r)),lt(t,e,n),t}function ut(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function ht(t,e){var n=e[0],r=e[1],i=e[2],o=e[4],a=e[5],s=e[6],l=e[8],c=e[9],u=e[10];return t[0]=Math.sqrt(n*n+r*r+i*i),t[1]=Math.sqrt(o*o+a*a+s*s),t[2]=Math.sqrt(l*l+c*c+u*u),t}function dt(t,e){var n=new p(3);ht(n,e);var r=1/n[0],i=1/n[1],o=1/n[2],a=e[0]*r,s=e[1]*i,l=e[2]*o,c=e[4]*r,u=e[5]*i,h=e[6]*o,d=e[8]*r,f=e[9]*i,g=e[10]*o,v=a+u+g,m=0;return v>0?(m=2*Math.sqrt(v+1),t[3]=.25*m,t[0]=(h-f)/m,t[1]=(d-l)/m,t[2]=(s-c)/m):a>u&&a>g?(m=2*Math.sqrt(1+a-u-g),t[3]=(h-f)/m,t[0]=.25*m,t[1]=(s+c)/m,t[2]=(d+l)/m):u>g?(m=2*Math.sqrt(1+u-a-g),t[3]=(d-l)/m,t[0]=(s+c)/m,t[1]=.25*m,t[2]=(h+f)/m):(m=2*Math.sqrt(1+g-a-u),t[3]=(s-c)/m,t[0]=(d+l)/m,t[1]=(h+f)/m,t[2]=.25*m),t}function ft(t,e,n,r){e[0]=r[12],e[1]=r[13],e[2]=r[14];var i=r[0],o=r[1],a=r[2],s=r[4],l=r[5],c=r[6],u=r[8],h=r[9],d=r[10];n[0]=Math.sqrt(i*i+o*o+a*a),n[1]=Math.sqrt(s*s+l*l+c*c),n[2]=Math.sqrt(u*u+h*h+d*d);var f=1/n[0],p=1/n[1],g=1/n[2],v=i*f,m=o*p,y=a*g,b=s*f,x=l*p,E=c*g,w=u*f,k=h*p,M=d*g,S=v+x+M,A=0;return S>0?(A=2*Math.sqrt(S+1),t[3]=.25*A,t[0]=(E-k)/A,t[1]=(w-y)/A,t[2]=(m-b)/A):v>x&&v>M?(A=2*Math.sqrt(1+v-x-M),t[3]=(E-k)/A,t[0]=.25*A,t[1]=(m+b)/A,t[2]=(w+y)/A):x>M?(A=2*Math.sqrt(1+x-v-M),t[3]=(w-y)/A,t[0]=(m+b)/A,t[1]=.25*A,t[2]=(E+k)/A):(A=2*Math.sqrt(1+M-v-x),t[3]=(m-b)/A,t[0]=(w+y)/A,t[1]=(E+k)/A,t[2]=.25*A),t}function pt(t,e,n,r){var i=e[0],o=e[1],a=e[2],s=e[3],l=i+i,c=o+o,u=a+a,h=i*l,d=i*c,f=i*u,p=o*c,g=o*u,v=a*u,m=s*l,y=s*c,b=s*u,x=r[0],E=r[1],w=r[2];return t[0]=(1-(p+v))*x,t[1]=(d+b)*x,t[2]=(f-y)*x,t[3]=0,t[4]=(d-b)*E,t[5]=(1-(h+v))*E,t[6]=(g+m)*E,t[7]=0,t[8]=(f+y)*w,t[9]=(g-m)*w,t[10]=(1-(h+p))*w,t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t}function gt(t,e,n,r,i){var o=e[0],a=e[1],s=e[2],l=e[3],c=o+o,u=a+a,h=s+s,d=o*c,f=o*u,p=o*h,g=a*u,v=a*h,m=s*h,y=l*c,b=l*u,x=l*h,E=r[0],w=r[1],k=r[2],M=i[0],S=i[1],A=i[2],N=(1-(g+m))*E,C=(f+x)*E,O=(p-b)*E,T=(f-x)*w,P=(1-(d+m))*w,R=(v+y)*w,D=(p+b)*k,L=(v-y)*k,I=(1-(d+g))*k;return t[0]=N,t[1]=C,t[2]=O,t[3]=0,t[4]=T,t[5]=P,t[6]=R,t[7]=0,t[8]=D,t[9]=L,t[10]=I,t[11]=0,t[12]=n[0]+M-(N*M+T*S+D*A),t[13]=n[1]+S-(C*M+P*S+L*A),t[14]=n[2]+A-(O*M+R*S+I*A),t[15]=1,t}function vt(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n+n,s=r+r,l=i+i,c=n*a,u=r*a,h=r*s,d=i*a,f=i*s,p=i*l,g=o*a,v=o*s,m=o*l;return t[0]=1-h-p,t[1]=u+m,t[2]=d-v,t[3]=0,t[4]=u-m,t[5]=1-c-p,t[6]=f+g,t[7]=0,t[8]=d+v,t[9]=f-g,t[10]=1-c-h,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function mt(t,e,n,r,i,o,a){var s=1/(n-e),l=1/(i-r),c=1/(o-a);return t[0]=2*o*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*o*l,t[6]=0,t[7]=0,t[8]=(n+e)*s,t[9]=(i+r)*l,t[10]=(a+o)*c,t[11]=-1,t[12]=0,t[13]=0,t[14]=a*o*2*c,t[15]=0,t}function yt(t,e,n,r,i){var o=1/Math.tan(e/2);if(t[0]=o/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,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){var a=1/(r-i);t[10]=(i+r)*a,t[14]=2*i*r*a}else t[10]=-1,t[14]=-2*r;return t}var bt=yt;function xt(t,e,n,r,i){var o=1/Math.tan(e/2);if(t[0]=o/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,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){var a=1/(r-i);t[10]=i*a,t[14]=i*r*a}else t[10]=-1,t[14]=-r;return t}function Et(t,e,n,r){var i=Math.tan(e.upDegrees*Math.PI/180),o=Math.tan(e.downDegrees*Math.PI/180),a=Math.tan(e.leftDegrees*Math.PI/180),s=Math.tan(e.rightDegrees*Math.PI/180),l=2/(a+s),c=2/(i+o);return t[0]=l,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=c,t[6]=0,t[7]=0,t[8]=-(a-s)*l*.5,t[9]=(i-o)*c*.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}function wt(t,e,n,r,i,o,a){var s=1/(e-n),l=1/(r-i),c=1/(o-a);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]=(a+o)*c,t[15]=1,t}var kt=wt;function Mt(t,e,n,r,i,o,a){var s=1/(e-n),l=1/(r-i),c=1/(o-a);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]=c,t[11]=0,t[12]=(e+n)*s,t[13]=(i+r)*l,t[14]=o*c,t[15]=1,t}function St(t,e,n,r){var i,o,a,s,l,c,u,h,d,p,g=e[0],v=e[1],m=e[2],y=r[0],b=r[1],x=r[2],E=n[0],w=n[1],k=n[2];return Math.abs(g-E)<f&&Math.abs(v-w)<f&&Math.abs(m-k)<f?W(t):(u=g-E,h=v-w,d=m-k,i=b*(d*=p=1/Math.sqrt(u*u+h*h+d*d))-x*(h*=p),o=x*(u*=p)-y*d,a=y*h-b*u,(p=Math.sqrt(i*i+o*o+a*a))?(i*=p=1/p,o*=p,a*=p):(i=0,o=0,a=0),s=h*a-d*o,l=d*i-u*a,c=u*o-h*i,(p=Math.sqrt(s*s+l*l+c*c))?(s*=p=1/p,l*=p,c*=p):(s=0,l=0,c=0),t[0]=i,t[1]=s,t[2]=u,t[3]=0,t[4]=o,t[5]=l,t[6]=h,t[7]=0,t[8]=a,t[9]=c,t[10]=d,t[11]=0,t[12]=-(i*g+o*v+a*m),t[13]=-(s*g+l*v+c*m),t[14]=-(u*g+h*v+d*m),t[15]=1,t)}function At(t,e,n,r){var i=e[0],o=e[1],a=e[2],s=r[0],l=r[1],c=r[2],u=i-n[0],h=o-n[1],d=a-n[2],f=u*u+h*h+d*d;f>0&&(u*=f=1/Math.sqrt(f),h*=f,d*=f);var p=l*d-c*h,g=c*u-s*d,v=s*h-l*u;return(f=p*p+g*g+v*v)>0&&(p*=f=1/Math.sqrt(f),g*=f,v*=f),t[0]=p,t[1]=g,t[2]=v,t[3]=0,t[4]=h*v-d*g,t[5]=d*p-u*v,t[6]=u*g-h*p,t[7]=0,t[8]=u,t[9]=h,t[10]=d,t[11]=0,t[12]=i,t[13]=o,t[14]=a,t[15]=1,t}function Nt(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]+")"}function Ct(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]+t[3]*t[3]+t[4]*t[4]+t[5]*t[5]+t[6]*t[6]+t[7]*t[7]+t[8]*t[8]+t[9]*t[9]+t[10]*t[10]+t[11]*t[11]+t[12]*t[12]+t[13]*t[13]+t[14]*t[14]+t[15]*t[15])}function Ot(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}function Tt(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}function Pt(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}function Rt(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}function Dt(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]}function Lt(t,e){var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],l=t[6],c=t[7],u=t[8],h=t[9],d=t[10],p=t[11],g=t[12],v=t[13],m=t[14],y=t[15],b=e[0],x=e[1],E=e[2],w=e[3],k=e[4],M=e[5],S=e[6],A=e[7],N=e[8],C=e[9],O=e[10],T=e[11],P=e[12],R=e[13],D=e[14],L=e[15];return Math.abs(n-b)<=f*Math.max(1,Math.abs(n),Math.abs(b))&&Math.abs(r-x)<=f*Math.max(1,Math.abs(r),Math.abs(x))&&Math.abs(i-E)<=f*Math.max(1,Math.abs(i),Math.abs(E))&&Math.abs(o-w)<=f*Math.max(1,Math.abs(o),Math.abs(w))&&Math.abs(a-k)<=f*Math.max(1,Math.abs(a),Math.abs(k))&&Math.abs(s-M)<=f*Math.max(1,Math.abs(s),Math.abs(M))&&Math.abs(l-S)<=f*Math.max(1,Math.abs(l),Math.abs(S))&&Math.abs(c-A)<=f*Math.max(1,Math.abs(c),Math.abs(A))&&Math.abs(u-N)<=f*Math.max(1,Math.abs(u),Math.abs(N))&&Math.abs(h-C)<=f*Math.max(1,Math.abs(h),Math.abs(C))&&Math.abs(d-O)<=f*Math.max(1,Math.abs(d),Math.abs(O))&&Math.abs(p-T)<=f*Math.max(1,Math.abs(p),Math.abs(T))&&Math.abs(g-P)<=f*Math.max(1,Math.abs(g),Math.abs(P))&&Math.abs(v-R)<=f*Math.max(1,Math.abs(v),Math.abs(R))&&Math.abs(m-D)<=f*Math.max(1,Math.abs(m),Math.abs(D))&&Math.abs(y-L)<=f*Math.max(1,Math.abs(y),Math.abs(L))}var It=X,Bt=Tt;function jt(){var t=new p(9);return p!=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}function zt(){var t=new p(4);return p!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function Ft(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 _t(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=n[0],l=n[1],c=n[2],u=n[3];return t[0]=r*u+a*s+i*c-o*l,t[1]=i*u+a*l+o*s-r*c,t[2]=o*u+a*c+r*l-i*s,t[3]=a*u-r*s-i*l-o*c,t}function Zt(t,e,n,r){var i,o,a,s,l,c=e[0],u=e[1],h=e[2],d=e[3],p=n[0],g=n[1],v=n[2],m=n[3];return(o=c*p+u*g+h*v+d*m)<0&&(o=-o,p=-p,g=-g,v=-v,m=-m),1-o>f?(i=Math.acos(o),a=Math.sin(i),s=Math.sin((1-r)*i)/a,l=Math.sin(r*i)/a):(s=1-r,l=r),t[0]=s*c+l*p,t[1]=s*u+l*g,t[2]=s*h+l*v,t[3]=s*d+l*m,t}function Gt(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n*n+r*r+i*i+o*o,s=a?1/a:0;return t[0]=-n*s,t[1]=-r*s,t[2]=-i*s,t[3]=o*s,t}function Vt(t,e,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"zyx",o=Math.PI/360;e*=o,r*=o,n*=o;var a=Math.sin(e),s=Math.cos(e),l=Math.sin(n),c=Math.cos(n),u=Math.sin(r),h=Math.cos(r);switch(i){case"xyz":t[0]=a*c*h+s*l*u,t[1]=s*l*h-a*c*u,t[2]=s*c*u+a*l*h,t[3]=s*c*h-a*l*u;break;case"xzy":t[0]=a*c*h-s*l*u,t[1]=s*l*h-a*c*u,t[2]=s*c*u+a*l*h,t[3]=s*c*h+a*l*u;break;case"yxz":t[0]=a*c*h+s*l*u,t[1]=s*l*h-a*c*u,t[2]=s*c*u-a*l*h,t[3]=s*c*h+a*l*u;break;case"yzx":t[0]=a*c*h+s*l*u,t[1]=s*l*h+a*c*u,t[2]=s*c*u-a*l*h,t[3]=s*c*h-a*l*u;break;case"zxy":t[0]=a*c*h-s*l*u,t[1]=s*l*h+a*c*u,t[2]=s*c*u+a*l*h,t[3]=s*c*h-a*l*u;break;case"zyx":t[0]=a*c*h-s*l*u,t[1]=s*l*h+a*c*u,t[2]=s*c*u-a*l*h,t[3]=s*c*h+a*l*u;break;default:throw new Error("Unknown angle order "+i)}return t}var Wt=j,Ht=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},Ut=function(t,e,n,r,i){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t},Yt=_t,qt=function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n*n+r*r+i*i+o*o;return a>0&&(a=1/Math.sqrt(a)),t[0]=n*a,t[1]=r*a,t[2]=i*a,t[3]=o*a,t};var Xt,Kt,Qt,Jt,$t,te;Xt=g(),Kt=y(1,0,0),Qt=y(0,1,0),Jt=zt(),$t=zt(),te=jt();function ee(){var t=new p(2);return p!=Float32Array&&(t[0]=0,t[1]=0),t}function ne(t,e){return t[0]=e[0],t[1]=e[1],t}function re(t,e,n){return t[0]=e,t[1]=n,t}!function(){var t=ee()}();function ie(t){return"number"==typeof t}function oe(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}function ae(t){return null==t}function se(t){return"string"==typeof t}var le=function(t,e,n){return t<e?e:t>n?n:t},ce=n(80813),ue={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function he(t){return Array.isArray(t)&&t.every((function(t){var e=t[0].toLowerCase();return ue[e]===t.length-1&&"achlmqstvz".includes(e)}))}function de(t){return he(t)&&t.every((function(t){var e=t[0];return e===e.toUpperCase()}))}function fe(t){return de(t)&&t.every((function(t){var e=t[0];return"ACLMQZ".includes(e)}))}var pe={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null};function ge(t){for(var e=t.pathValue[t.segmentStart],n=e.toLowerCase(),r=t.data;r.length>=ue[n]&&("m"===n&&r.length>2?(t.segments.push([e].concat(r.splice(0,2))),n="l",e="m"===e?"l":"L"):t.segments.push([e].concat(r.splice(0,ue[n]))),ue[n]););}function ve(t){var e=t.index,n=t.pathValue,r=n.charCodeAt(e);return 48===r?(t.param=0,void(t.index+=1)):49===r?(t.param=1,void(t.index+=1)):void(t.err='[path-util]: invalid Arc flag "'.concat(n[e],'", expecting 0 or 1 at index ').concat(e))}function me(t){return t>=48&&t<=57||43===t||45===t||46===t}function ye(t){return t>=48&&t<=57}function be(t){var e,n=t.max,r=t.pathValue,i=t.index,o=i,a=!1,s=!1,l=!1,c=!1;if(o>=n)t.err="[path-util]: Invalid path value at index ".concat(o,', "pathValue" is missing param');else if(43!==(e=r.charCodeAt(o))&&45!==e||(o+=1,e=r.charCodeAt(o)),ye(e)||46===e){if(46!==e){if(a=48===e,o+=1,e=r.charCodeAt(o),a&&o<n&&e&&ye(e))return void(t.err="[path-util]: Invalid path value at index ".concat(i,', "').concat(r[i],'" illegal number'));for(;o<n&&ye(r.charCodeAt(o));)o+=1,s=!0;e=r.charCodeAt(o)}if(46===e){for(c=!0,o+=1;ye(r.charCodeAt(o));)o+=1,l=!0;e=r.charCodeAt(o)}if(101===e||69===e){if(c&&!s&&!l)return void(t.err="[path-util]: Invalid path value at index ".concat(o,', "').concat(r[o],'" invalid float exponent'));if(o+=1,43!==(e=r.charCodeAt(o))&&45!==e||(o+=1),!(o<n&&ye(r.charCodeAt(o))))return void(t.err="[path-util]: Invalid path value at index ".concat(o,', "').concat(r[o],'" invalid integer exponent'));for(;o<n&&ye(r.charCodeAt(o));)o+=1}t.index=o,t.param=+t.pathValue.slice(i,o)}else t.err="[path-util]: Invalid path value at index ".concat(o,', "').concat(r[o],'" is not a number')}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||e>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].includes(e));)t.index+=1}function Ee(t){var e=t.max,n=t.pathValue,r=t.index,i=n.charCodeAt(r),o=ue[n[r].toLowerCase()];if(t.segmentStart=r,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!0;default:return!1}}(i))if(t.index+=1,xe(t),t.data=[],o){for(;;){for(var a=o;a>0;a-=1){if(97!=(32|i)||3!==a&&4!==a?be(t):ve(t),t.err.length)return;t.data.push(t.param),xe(t),t.index<e&&44===n.charCodeAt(t.index)&&(t.index+=1,xe(t))}if(t.index>=t.max)break;if(!me(n.charCodeAt(t.index)))break}ge(t)}else ge(t);else t.err='[path-util]: Invalid path value "'.concat(n[r],'" is not a path command')}var we=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){if(de(t))return[].concat(t);var e=function(t){if(he(t))return[].concat(t);var e=new we(t);for(xe(e);e.index<e.max&&!e.err.length;)Ee(e);return e.err?e.err:e.segments}(t),n=0,r=0,i=0,o=0;return e.map((function(t){var e,a=t.slice(1).map(Number),s=t[0],l=s.toUpperCase();if("M"===s)return n=a[0],r=a[1],i=n,o=r,["M",n,r];if(s!==l)switch(l){case"A":e=[l,a[0],a[1],a[2],a[3],a[4],a[5]+n,a[6]+r];break;case"V":e=[l,a[0]+r];break;case"H":e=[l,a[0]+n];break;default:var c=a.map((function(t,e){return t+(e%2?r:n)}));e=[l].concat(c)}else e=[l].concat(a);var u=e.length;switch(l){case"Z":n=i,r=o;break;case"H":n=e[1];break;case"V":r=e[1];break;default:n=e[u-2],r=e[u-1],"M"===l&&(i=n,o=r)}return e}))}function Me(t,e){var n=t[0],r=e.x1,i=e.y1,o=e.x2,a=e.y2,s=t.slice(1).map(Number),l=t;if("TQ".includes(n)||(e.qx=null,e.qy=null),"H"===n)l=["L",t[1],i];else if("V"===n)l=["L",r,t[1]];else if("S"===n){var c=2*r-o,u=2*i-a;e.x1=c,e.y1=u,l=["C",c,u].concat(s)}else if("T"===n){var h=2*r-e.qx,d=2*i-e.qy;e.qx=h,e.qy=d,l=["Q",h,d].concat(s)}else if("Q"===n){var f=s[0],p=s[1];e.qx=f,e.qy=p}return l}function Se(t){if(fe(t))return[].concat(t);for(var e=ke(t),n=(0,ce.pi)({},pe),r=0;r<e.length;r+=1){e[r]=Me(e[r],n);var i=e[r],o=i.length;n.x1=+i[o-2],n.y1=+i[o-1],n.x2=+i[o-4]||n.x1,n.y2=+i[o-3]||n.y1}return e}function Ae(t,e,n){var r=t[0],i=t[1];return[r+(e[0]-r)*n,i+(e[1]-i)*n]}function Ne(t,e,n,r,i){var o=oe([t,e],[n,r]),a={x:0,y:0};if("number"==typeof i)if(i<=0)a={x:t,y:e};else if(i>=o)a={x:n,y:r};else{var s=Ae([t,e],[n,r],i/o);a={x:s[0],y:s[1]}}return{length:o,point:a,min:{x:Math.min(t,n),y:Math.min(e,r)},max:{x:Math.max(t,n),y:Math.max(e,r)}}}function Ce(t,e){var n=t.x,r=t.y,i=e.x,o=e.y,a=n*i+r*o,s=Math.sqrt((Math.pow(n,2)+Math.pow(r,2))*(Math.pow(i,2)+Math.pow(o,2)));return(n*o-r*i<0?-1:1)*Math.acos(a/s)}function Oe(t,e,n,r,i,o,a,s,l,c){var u=Math.abs,h=Math.sin,d=Math.cos,f=Math.sqrt,p=Math.PI,g=u(n),v=u(r),m=(i%360+360)%360*(p/180);if(t===s&&e===l)return{x:t,y:e};if(0===g||0===v)return Ne(t,e,s,l,c).point;var y=(t-s)/2,b=(e-l)/2,x={x:d(m)*y+h(m)*b,y:-h(m)*y+d(m)*b},E=Math.pow(x.x,2)/Math.pow(g,2)+Math.pow(x.y,2)/Math.pow(v,2);E>1&&(g*=f(E),v*=f(E));var w=(Math.pow(g,2)*Math.pow(v,2)-Math.pow(g,2)*Math.pow(x.y,2)-Math.pow(v,2)*Math.pow(x.x,2))/(Math.pow(g,2)*Math.pow(x.y,2)+Math.pow(v,2)*Math.pow(x.x,2)),k=(o!==a?1:-1)*f(w=w<0?0:w),M=k*(g*x.y/v),S=k*(-v*x.x/g),A=d(m)*M-h(m)*S+(t+s)/2,N=h(m)*M+d(m)*S+(e+l)/2,C={x:(x.x-M)/g,y:(x.y-S)/v},O=Ce({x:1,y:0},C),T=Ce(C,{x:(-x.x-M)/g,y:(-x.y-S)/v});!a&&T>0?T-=2*p:a&&T<0&&(T+=2*p);var P=O+(T%=2*p)*c,R=g*d(P),D=v*h(P);return{x:d(m)*R-h(m)*D+A,y:h(m)*R+d(m)*D+N}}function Te(t,e,n,r,i,o,a,s,l,c,u){var h,d=u.bbox,f=void 0===d||d,p=u.length,g=void 0===p||p,v=u.sampleSize,m=void 0===v?30:v,y="number"==typeof c,b=t,x=e,E=0,w=[b,x,E],k=[b,x],M={x:0,y:0},S=[{x:b,y:x}];y&&c<=0&&(M={x:b,y:x});for(var A=0;A<=m;A+=1){if(b=(h=Oe(t,e,n,r,i,o,a,s,l,A/m)).x,x=h.y,f&&S.push({x:b,y:x}),g&&(E+=oe(k,[b,x])),k=[b,x],y&&E>=c&&c>w[2]){var N=(E-c)/(E-w[2]);M={x:k[0]*(1-N)+w[0]*N,y:k[1]*(1-N)+w[1]*N}}w=[b,x,E]}return y&&c>=E&&(M={x:s,y:l}),{length:E,point:M,min:{x:Math.min.apply(null,S.map((function(t){return t.x}))),y:Math.min.apply(null,S.map((function(t){return t.y})))},max:{x:Math.max.apply(null,S.map((function(t){return t.x}))),y:Math.max.apply(null,S.map((function(t){return t.y})))}}}function Pe(t,e,n,r,i,o,a,s,l){var c=1-l;return{x:Math.pow(c,3)*t+3*Math.pow(c,2)*l*n+3*c*Math.pow(l,2)*i+Math.pow(l,3)*a,y:Math.pow(c,3)*e+3*Math.pow(c,2)*l*r+3*c*Math.pow(l,2)*o+Math.pow(l,3)*s}}function Re(t,e,n,r,i,o,a,s,l,c){var u,h=c.bbox,d=void 0===h||h,f=c.length,p=void 0===f||f,g=c.sampleSize,v=void 0===g?10:g,m="number"==typeof l,y=t,b=e,x=0,E=[y,b,x],w=[y,b],k={x:0,y:0},M=[{x:y,y:b}];m&&l<=0&&(k={x:y,y:b});for(var S=0;S<=v;S+=1){if(y=(u=Pe(t,e,n,r,i,o,a,s,S/v)).x,b=u.y,d&&M.push({x:y,y:b}),p&&(x+=oe(w,[y,b])),w=[y,b],m&&x>=l&&l>E[2]){var A=(x-l)/(x-E[2]);k={x:w[0]*(1-A)+E[0]*A,y:w[1]*(1-A)+E[1]*A}}E=[y,b,x]}return m&&l>=x&&(k={x:a,y:s}),{length:x,point:k,min:{x:Math.min.apply(null,M.map((function(t){return t.x}))),y:Math.min.apply(null,M.map((function(t){return t.y})))},max:{x:Math.max.apply(null,M.map((function(t){return t.x}))),y:Math.max.apply(null,M.map((function(t){return t.y})))}}}function De(t,e,n,r,i,o,a){var s=1-a;return{x:Math.pow(s,2)*t+2*s*a*n+Math.pow(a,2)*i,y:Math.pow(s,2)*e+2*s*a*r+Math.pow(a,2)*o}}function Le(t,e,n,r,i,o,a,s){var l,c=s.bbox,u=void 0===c||c,h=s.length,d=void 0===h||h,f=s.sampleSize,p=void 0===f?10:f,g="number"==typeof a,v=t,m=e,y=0,b=[v,m,y],x=[v,m],E={x:0,y:0},w=[{x:v,y:m}];g&&a<=0&&(E={x:v,y:m});for(var k=0;k<=p;k+=1){if(v=(l=De(t,e,n,r,i,o,k/p)).x,m=l.y,u&&w.push({x:v,y:m}),d&&(y+=oe(x,[v,m])),x=[v,m],g&&y>=a&&a>b[2]){var M=(y-a)/(y-b[2]);E={x:x[0]*(1-M)+b[0]*M,y:x[1]*(1-M)+b[1]*M}}b=[v,m,y]}return g&&a>=y&&(E={x:i,y:o}),{length:y,point:E,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 Ie(t,e,n){for(var r,i,o,a,s,l,c,u,h,d=Se(t),f="number"==typeof e,p=[],g=0,v=0,m=0,y=0,b=[],x=[],E=0,w={x:0,y:0},k=w,M=w,S=w,A=0,N=0,C=d.length;N<C;N+=1)p=(c="M"===(u=(h=d[N])[0]))?p:[g,v].concat(h.slice(1)),c?(k=w={x:m=h[1],y:y=h[2]},E=0,f&&e<.001&&(S=w)):"L"===u?(E=(r=Ne(p[0],p[1],p[2],p[3],(e||0)-A)).length,w=r.min,k=r.max,M=r.point):"A"===u?(E=(i=Te(p[0],p[1],p[2],p[3],p[4],p[5],p[6],p[7],p[8],(e||0)-A,n||{})).length,w=i.min,k=i.max,M=i.point):"C"===u?(E=(o=Re(p[0],p[1],p[2],p[3],p[4],p[5],p[6],p[7],(e||0)-A,n||{})).length,w=o.min,k=o.max,M=o.point):"Q"===u?(E=(a=Le(p[0],p[1],p[2],p[3],p[4],p[5],(e||0)-A,n||{})).length,w=a.min,k=a.max,M=a.point):"Z"===u&&(E=(s=Ne((p=[g,v,m,y])[0],p[1],p[2],p[3],(e||0)-A)).length,w=s.min,k=s.max,M=s.point),f&&A<e&&A+E>=e&&(S=M),x.push(k),b.push(w),A+=E,g=(l="Z"!==u?h.slice(-2):[m,y])[0],v=l[1];return f&&e>=A&&(S={x:g,y:v}),{length:A,point:S,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,x.map((function(t){return t.x}))),y:Math.max.apply(null,x.map((function(t){return t.y})))}}}function Be(t){return Array.isArray(t)}var je=function(t){if(Be(t))return t.reduce((function(t,e){return Math.min(t,e)}),t[0])};function ze(t){if(!Array.isArray(t))return-1/0;var e=t.length;if(!e)return-1/0;for(var n=t[0],r=1;r<e;r++)n=Math.max(n,t[r]);return n}function Fe(t,e,n){return void 0===n&&(n=1e-5),t===e||Math.abs(t-e)<n}var _e=function(t,e){return(t%e+e)%e};function Ze(t,e,n){if(t[n].length>7){t[n].shift();for(var r=t[n],i=n;r.length;)e[n]="A",t.splice(i+=1,0,["C"].concat(r.splice(0,6)));t.splice(n,1)}}function Ge(t,e,n){return{x:t*Math.cos(n)-e*Math.sin(n),y:t*Math.sin(n)+e*Math.cos(n)}}function Ve(t,e,n,r,i,o,a,s,l,c){var u,h,d,f,p,g=t,v=e,m=n,y=r,b=s,x=l,E=120*Math.PI/180,w=Math.PI/180*(+i||0),k=[];if(c)h=c[0],d=c[1],f=c[2],p=c[3];else{g=(u=Ge(g,v,-w)).x,v=u.y;var M=(g-(b=(u=Ge(b,x,-w)).x))/2,S=(v-(x=u.y))/2,A=M*M/(m*m)+S*S/(y*y);A>1&&(m*=A=Math.sqrt(A),y*=A);var N=m*m,C=y*y,O=(o===a?-1:1)*Math.sqrt(Math.abs((N*C-N*S*S-C*M*M)/(N*S*S+C*M*M)));f=O*m*S/y+(g+b)/2,p=O*-y*M/m+(v+x)/2,h=Math.asin(((v-p)/y*Math.pow(10,9)>>0)/Math.pow(10,9)),d=Math.asin(((x-p)/y*Math.pow(10,9)>>0)/Math.pow(10,9)),h=g<f?Math.PI-h:h,d=b<f?Math.PI-d:d,h<0&&(h=2*Math.PI+h),d<0&&(d=2*Math.PI+d),a&&h>d&&(h-=2*Math.PI),!a&&d>h&&(d-=2*Math.PI)}var T=d-h;if(Math.abs(T)>E){var P=d,R=b,D=x;d=h+E*(a&&d>h?1:-1),k=Ve(b=f+m*Math.cos(d),x=p+y*Math.sin(d),m,y,i,0,a,R,D,[d,P,f,p])}T=d-h;var L=Math.cos(h),I=Math.sin(h),B=Math.cos(d),j=Math.sin(d),z=Math.tan(T/4),F=4/3*m*z,_=4/3*y*z,Z=[g,v],G=[g+F*I,v-_*L],V=[b+F*j,x-_*B],W=[b,x];if(G[0]=2*Z[0]-G[0],G[1]=2*Z[1]-G[1],c)return G.concat(V,W,k);for(var H=[],U=0,Y=(k=G.concat(V,W,k)).length;U<Y;U+=1)H[U]=U%2?Ge(k[U-1],k[U],w).y:Ge(k[U],k[U+1],w).x;return H}var We=function(t,e,n,r){var i=Ae([t,e],[n,r],.5);return(0,ce.ev)((0,ce.ev)([],i,!0),[n,r,n,r],!1)};function He(t,e){var n,r,i,o,a,s,l,c,u,h=t[0],d=t.slice(1).map(Number),f=d[0],p=d[1],g=e.x1,v=e.y1,m=e.x,y=e.y;switch("TQ".includes(h)||(e.qx=null,e.qy=null),h){case"M":return e.x=f,e.y=p,t;case"A":return n=[g,v].concat(d),["C"].concat(Ve(n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7],n[8],n[9]));case"Q":return e.qx=f,e.qy=p,n=[g,v].concat(d),["C"].concat((r=n[0],i=n[1],o=n[2],a=n[3],s=n[4],l=n[5],[(c=1/3)*r+(u=2/3)*o,c*i+u*a,c*s+u*o,c*l+u*a,s,l]));case"L":return["C"].concat(We(g,v,f,p));case"Z":return g===m&&v===y?["C",g,v,m,y,m,y]:["C"].concat(We(g,v,m,y))}return t}function Ue(t,e){if(void 0===e&&(e=!1),function(t){return fe(t)&&t.every((function(t){var e=t[0];return"MC".includes(e)}))}(t)){var n=[].concat(t);return e?[n,[]]:n}for(var r,i,o=Se(t),a=(0,ce.pi)({},pe),s=[],l="",c=o.length,u=[],h=0;h<c;h+=1){o[h]&&(l=o[h][0]),s[h]=l;var d=He(o[h],a);o[h]=d,Ze(o,s,h),c=o.length,"Z"===l&&u.push(h),i=(r=o[h]).length,a.x1=+r[i-2],a.y1=+r[i-1],a.x2=+r[i-4]||a.x1,a.y2=+r[i-3]||a.y1}return e?[o,u]:o}function Ye(t){return t.map((function(t,e,n){var r=e&&n[e-1].slice(-2).concat(t.slice(1)),i=e?Re(r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],{bbox:!1}).length:0;return{s:t,ss:e?i?function(t,e){void 0===e&&(e=.5);var n=t.slice(0,2),r=t.slice(2,4),i=t.slice(4,6),o=t.slice(6,8),a=Ae(n,r,e),s=Ae(r,i,e),l=Ae(i,o,e),c=Ae(a,s,e),u=Ae(s,l,e),h=Ae(c,u,e);return[["C"].concat(a,c,h),["C"].concat(u,l,o)]}(r):[t,t]:[t],l:i}}))}function qe(t,e,n,r){if(void 0===r&&(r=0),r>50)return console.warn("Maximum recursion depth reached in equalizeSegments"),[t,e];var i=Ye(t),o=Ye(e),a=i.length,s=o.length,l=i.filter((function(t){return t.l})).length,c=o.filter((function(t){return t.l})).length,u=i.filter((function(t){return t.l})).reduce((function(t,e){return t+e.l}),0)/l||0,h=o.filter((function(t){return t.l})).reduce((function(t,e){return t+e.l}),0)/c||0,d=n||Math.max(a,s),f=[u,h],p=[d-a,d-s],g=0,v=[i,o].map((function(t,e){return t.l===d?t.map((function(t){return t.s})):t.map((function(t,n){return g=n&&p[e]&&t.l>=f[e],p[e]-=g?1:0,g?t.ss:[t.s]})).flat()}));return v[0].length===v[1].length?v:qe(v[0],v[1],d,r+1)}function Xe(t){return function(t){var e=0,n=0,r=0;return Ue(t).map((function(t){var i;if("M"===t[0])return e=t[1],n=t[2],0;var o=t.slice(1),a=o[0],s=o[1],l=o[2],c=o[3],u=o[4],h=o[5];return r=function(t,e,n,r,i,o,a,s){return 3*((s-e)*(n+i)-(a-t)*(r+o)+r*(t-i)-n*(e-o)+s*(i+t/3)-a*(o+e/3))/20}(e,n,a,s,l,c,u,h),i=t.slice(-2),e=i[0],n=i[1],r})).reduce((function(t,e){return t+e}),0)}(t)>=0}function Ke(t,e){var n=t.length-1,r=[],i=0,o=function(t){var e=t.length,n=e-1;return t.map((function(r,i){return t.map((function(r,o){var a,s=i+o;return 0===o||t[s]&&"M"===t[s][0]?(a=t[s],["M"].concat(a.slice(-2))):(s>=e&&(s-=n),t[s])}))}))}(t);return o.forEach((function(o,a){t.slice(1).forEach((function(r,o){i+=oe(t[(a+o)%n].slice(-2),e[o%n].slice(-2))})),r[a]=i,i=0})),o[r.indexOf(Math.min.apply(null,r))]}var Qe=function(t){return void 0===t},Je={}.toString,$e=function(t,e){return Je.call(t)==="[object "+e+"]"},tn=function(t){return $e(t,"Boolean")};function en(t){return"function"==typeof t}var nn=function(t){var e=typeof t;return null!==t&&"object"===e||"function"===e};function rn(t,e,n){return Ie(t,e,(0,ce.pi)((0,ce.pi)({},n),{bbox:!1,length:!0})).point}var on=n(20068),an=n(58289);function sn(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=(0,an.Z)(t)););return t}function ln(){return ln="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=sn(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}},ln.apply(null,arguments)}function cn(t,e,n,r){var i=ln((0,an.Z)(1&r?t.prototype:t),e,n);return 2&r&&"function"==typeof i?function(t){return i.apply(n,t)}:i}function un(t,e,n,r){var i=t-n,o=e-r;return Math.sqrt(i*i+o*o)}function hn(t,e){var n=Math.min.apply(Math,(0,l.Z)(t)),r=Math.min.apply(Math,(0,l.Z)(e));return{x:n,y:r,width:Math.max.apply(Math,(0,l.Z)(t))-n,height:Math.max.apply(Math,(0,l.Z)(e))-r}}function dn(t,e,n,r,i,o){return n*Math.cos(i)*Math.cos(o)-r*Math.sin(i)*Math.sin(o)+t}function fn(t,e,n,r,i,o){return n*Math.sin(i)*Math.cos(o)+r*Math.cos(i)*Math.sin(o)+e}function pn(t,e,n,r,i,o,a){for(var s=function(t,e,n){return Math.atan(-e/t*Math.tan(n))}(n,r,i),l=1/0,c=-1/0,u=[o,a],h=2*-Math.PI;h<=2*Math.PI;h+=Math.PI){var d=s+h;o<a?o<d&&d<a&&u.push(d):a<d&&d<o&&u.push(d)}for(var f=0;f<u.length;f++){var p=dn(t,0,n,r,i,u[f]);p<l&&(l=p),p>c&&(c=p)}for(var g=function(t,e,n){return Math.atan(e/(t*Math.tan(n)))}(n,r,i),v=1/0,m=-1/0,y=[o,a],b=2*-Math.PI;b<=2*Math.PI;b+=Math.PI){var x=g+b;o<a?o<x&&x<a&&y.push(x):a<x&&x<o&&y.push(x)}for(var E=0;E<y.length;E++){var w=fn(0,e,n,r,i,y[E]);w<v&&(v=w),w>m&&(m=w)}return{x:l,y:v,width:c-l,height:m-v}}function gn(t,e,n,r,i,o){var a=-1,s=1/0,c=[n,r],u=20;o&&o>200&&(u=o/10);for(var h=1/u,d=h/10,f=0;f<=u;f++){var p=f*h,g=[i.apply(void 0,(0,l.Z)(t.concat([p]))),i.apply(void 0,(0,l.Z)(e.concat([p])))],v=un(c[0],c[1],g[0],g[1]);v<s&&(a=p,s=v)}if(0===a)return{x:t[0],y:e[0]};if(1===a){var m=t.length;return{x:t[m-1],y:e[m-1]}}s=1/0;for(var y=0;y<32&&!(d<1e-4);y++){var b=a-d,x=a+d,E=[i.apply(void 0,(0,l.Z)(t.concat([b]))),i.apply(void 0,(0,l.Z)(e.concat([b])))],w=un(c[0],c[1],E[0],E[1]);if(b>=0&&w<s)a=b,s=w;else{var k=[i.apply(void 0,(0,l.Z)(t.concat([x]))),i.apply(void 0,(0,l.Z)(e.concat([x])))],M=un(c[0],c[1],k[0],k[1]);x<=1&&M<s?(a=x,s=M):d*=.5}}return{x:i.apply(void 0,(0,l.Z)(t.concat([a]))),y:i.apply(void 0,(0,l.Z)(e.concat([a])))}}function vn(t,e,n,r){return un(t,e,n,r)}function mn(t,e,n,r,i){return{x:(1-i)*t+i*n,y:(1-i)*e+i*r}}function yn(t,e,n,r,i,o){var a=[n-t,r-e];if(function(t,e){return t[0]===e[0]&&t[1]===e[1]}(a,[0,0]))return Math.sqrt((i-t)*(i-t)+(o-e)*(o-e));var s=[-a[1],a[0]];!function(t,e){var n=e[0],r=e[1],i=n*n+r*r;i>0&&(i=1/Math.sqrt(i)),t[0]=e[0]*i,t[1]=e[1]*i}(s,s);var l=[i-t,o-e];return Math.abs(function(t,e){return t[0]*e[0]+t[1]*e[1]}(l,s))}function bn(t,e,n,r,i){var o=1-i;return o*o*o*t+3*e*i*o*o+3*n*i*i*o+r*i*i*i}function xn(t,e,n,r){var i,o,a,s=-3*t+9*e-9*n+3*r,l=6*t-12*e+6*n,c=3*e-3*t,u=[];if(Fe(s,0))Fe(l,0)||(i=-c/l)>=0&&i<=1&&u.push(i);else{var h=l*l-4*s*c;Fe(h,0)?u.push(-l/(2*s)):h>0&&(o=(-l-(a=Math.sqrt(h)))/(2*s),(i=(-l+a)/(2*s))>=0&&i<=1&&u.push(i),o>=0&&o<=1&&u.push(o))}return u}function En(t,e,n,r,i,o,a,s){for(var l=[t,a],c=[e,s],u=xn(t,n,i,a),h=xn(e,r,o,s),d=0;d<u.length;d++)l.push(bn(t,n,i,a,u[d]));for(var f=0;f<h.length;f++)c.push(bn(e,r,o,s,h[f]));return hn(l,c)}function wn(t,e,n,r,i,o,a,s,l,c,u){var h=function(t,e,n,r,i,o,a,s,l,c,u){return gn([t,n,i,a],[e,r,o,s],l,c,bn,u)}(t,e,n,r,i,o,a,s,l,c,u);return un(h.x,h.y,l,c)}function kn(t){if(t.length<2)return 0;for(var e=0,n=0;n<t.length-1;n++){var r=t[n],i=t[n+1];e+=un(r[0],r[1],i[0],i[1])}return e}function Mn(t,e,n,r){var i=1-r;return i*i*t+2*r*i*e+r*r*n}function Sn(t,e,n){var r=t+n-2*e;if(Fe(r,0))return[.5];var i=(t-e)/r;return i<=1&&i>=0?[i]:[]}function An(t,e,n,r,i,o){var a=Sn(t,n,i)[0],s=Sn(e,r,o)[0],l=[t,i],c=[e,o];return void 0!==a&&l.push(Mn(t,n,i,a)),void 0!==s&&c.push(Mn(e,r,o,s)),hn(l,c)}function Nn(t,e,n,r,i,o,a,s){var l=function(t,e,n,r,i,o,a,s){return gn([t,n,i],[e,r,o],a,s,Mn)}(t,e,n,r,i,o,a,s);return un(l.x,l.y,a,s)}var Cn=n(75044),On=n(3202),Tn=n(19251),Pn=n(75931),Rn=("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self&&self,{exports:{}});Rn.exports=function(){function t(t,n,i,o,a){e(t,n,i||0,o||t.length-1,a||r)}function e(t,r,i,o,a){for(;o>i;){if(o-i>600){var s=o-i+1,l=r-i+1,c=Math.log(s),u=.5*Math.exp(2*c/3),h=.5*Math.sqrt(c*u*(s-u)/s)*(l-s/2<0?-1:1);e(t,r,Math.max(i,Math.floor(r-l*u/s+h)),Math.min(o,Math.floor(r+(s-l)*u/s+h)),a)}var d=t[r],f=i,p=o;for(n(t,i,r),a(t[o],d)>0&&n(t,i,o);f<p;){for(n(t,f,p),f++,p--;a(t[f],d)<0;)f++;for(;a(t[p],d)>0;)p--}0===a(t[i],d)?n(t,i,p):n(t,++p,o),p<=r&&(i=p+1),r<=p&&(o=p-1)}}function n(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function r(t,e){return t<e?-1:t>e?1:0}var i=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()};function o(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}function a(t,e){s(t,0,t.children.length,e,t)}function s(t,e,n,r,i){i||(i=m(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(var o=e;o<n;o++){var a=t.children[o];l(i,t.leaf?r(a):a)}return i}function l(t,e){return 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),t}function c(t,e){return t.minX-e.minX}function u(t,e){return t.minY-e.minY}function h(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function d(t){return t.maxX-t.minX+(t.maxY-t.minY)}function f(t,e){return(Math.max(e.maxX,t.maxX)-Math.min(e.minX,t.minX))*(Math.max(e.maxY,t.maxY)-Math.min(e.minY,t.minY))}function p(t,e){var n=Math.max(t.minX,e.minX),r=Math.max(t.minY,e.minY),i=Math.min(t.maxX,e.maxX),o=Math.min(t.maxY,e.maxY);return Math.max(0,i-n)*Math.max(0,o-r)}function g(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 m(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function y(e,n,r,i,o){for(var a=[n,r];a.length;)if(!((r=a.pop())-(n=a.pop())<=i)){var s=n+Math.ceil((r-n)/i/2)*i;t(e,s,n,r,o),a.push(n,s,s,r)}}return i.prototype.all=function(){return this._all(this.data,[])},i.prototype.search=function(t){var e=this.data,n=[];if(!v(t,e))return n;for(var r=this.toBBox,i=[];e;){for(var o=0;o<e.children.length;o++){var a=e.children[o],s=e.leaf?r(a):a;v(t,s)&&(e.leaf?n.push(a):g(t,s)?this._all(a,n):i.push(a))}e=i.pop()}return n},i.prototype.collides=function(t){var e=this.data;if(!v(t,e))return!1;for(var n=[];e;){for(var r=0;r<e.children.length;r++){var i=e.children[r],o=e.leaf?this.toBBox(i):i;if(v(t,o)){if(e.leaf||g(t,o))return!0;n.push(i)}}e=n.pop()}return!1},i.prototype.load=function(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(var e=0;e<t.length;e++)this.insert(t[e]);return this}var n=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===n.height)this._splitRoot(this.data,n);else{if(this.data.height<n.height){var r=this.data;this.data=n,n=r}this._insert(n,this.data.height-n.height-1,!0)}else this.data=n;return this},i.prototype.insert=function(t){return t&&this._insert(t,this.data.height-1),this},i.prototype.clear=function(){return this.data=m([]),this},i.prototype.remove=function(t,e){if(!t)return this;for(var n,r,i,a=this.data,s=this.toBBox(t),l=[],c=[];a||l.length;){if(a||(a=l.pop(),r=l[l.length-1],n=c.pop(),i=!0),a.leaf){var u=o(t,a.children,e);if(-1!==u)return a.children.splice(u,1),l.push(a),this._condense(l),this}i||a.leaf||!g(a,s)?r?(n++,a=r.children[n],i=!1):a=null:(l.push(a),c.push(n),n=0,r=a,a=a.children[0])}return this},i.prototype.toBBox=function(t){return t},i.prototype.compareMinX=function(t,e){return t.minX-e.minX},i.prototype.compareMinY=function(t,e){return t.minY-e.minY},i.prototype.toJSON=function(){return this.data},i.prototype.fromJSON=function(t){return this.data=t,this},i.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},i.prototype._build=function(t,e,n,r){var i,o=n-e+1,s=this._maxEntries;if(o<=s)return a(i=m(t.slice(e,n+1)),this.toBBox),i;r||(r=Math.ceil(Math.log(o)/Math.log(s)),s=Math.ceil(o/Math.pow(s,r-1))),(i=m([])).leaf=!1,i.height=r;var l=Math.ceil(o/s),c=l*Math.ceil(Math.sqrt(s));y(t,e,n,c,this.compareMinX);for(var u=e;u<=n;u+=c){var h=Math.min(u+c-1,n);y(t,u,h,l,this.compareMinY);for(var d=u;d<=h;d+=l){var f=Math.min(d+l-1,h);i.children.push(this._build(t,d,f,r-1))}}return a(i,this.toBBox),i},i.prototype._chooseSubtree=function(t,e,n,r){for(;r.push(e),!e.leaf&&r.length-1!==n;){for(var i=1/0,o=1/0,a=void 0,s=0;s<e.children.length;s++){var l=e.children[s],c=h(l),u=f(t,l)-c;u<o?(o=u,i=c<i?c:i,a=l):u===o&&c<i&&(i=c,a=l)}e=a||e.children[0]}return e},i.prototype._insert=function(t,e,n){var r=n?t:this.toBBox(t),i=[],o=this._chooseSubtree(r,this.data,e,i);for(o.children.push(t),l(o,r);e>=0&&i[e].children.length>this._maxEntries;)this._split(i,e),e--;this._adjustParentBBoxes(r,i,e)},i.prototype._split=function(t,e){var n=t[e],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);var o=this._chooseSplitIndex(n,i,r),s=m(n.children.splice(o,n.children.length-o));s.height=n.height,s.leaf=n.leaf,a(n,this.toBBox),a(s,this.toBBox),e?t[e-1].children.push(s):this._splitRoot(n,s)},i.prototype._splitRoot=function(t,e){this.data=m([t,e]),this.data.height=t.height+1,this.data.leaf=!1,a(this.data,this.toBBox)},i.prototype._chooseSplitIndex=function(t,e,n){for(var r,i=1/0,o=1/0,a=e;a<=n-e;a++){var l=s(t,0,a,this.toBBox),c=s(t,a,n,this.toBBox),u=p(l,c),d=h(l)+h(c);u<i?(i=u,r=a,o=d<o?d:o):u===i&&d<o&&(o=d,r=a)}return r||n-e},i.prototype._chooseSplitAxis=function(t,e,n){var r=t.leaf?this.compareMinX:c,i=t.leaf?this.compareMinY:u;this._allDistMargin(t,e,n,r)<this._allDistMargin(t,e,n,i)&&t.children.sort(r)},i.prototype._allDistMargin=function(t,e,n,r){t.children.sort(r);for(var i=this.toBBox,o=s(t,0,e,i),a=s(t,n-e,n,i),c=d(o)+d(a),u=e;u<n-e;u++){var h=t.children[u];l(o,t.leaf?i(h):h),c+=d(o)}for(var f=n-e-1;f>=e;f--){var p=t.children[f];l(a,t.leaf?i(p):p),c+=d(a)}return c},i.prototype._adjustParentBBoxes=function(t,e,n){for(var r=n;r>=0;r--)l(e[r],t)},i.prototype._condense=function(t){for(var e=t.length-1,n=void 0;e>=0;e--)0===t[e].children.length?e>0?(n=t[e-1].children).splice(n.indexOf(t[e]),1):this.clear():a(t[e],this.toBBox)},i}();var Dn=Rn.exports,Ln=function(t){return t.GROUP="g",t.FRAGMENT="fragment",t.CIRCLE="circle",t.ELLIPSE="ellipse",t.IMAGE="image",t.RECT="rect",t.LINE="line",t.POLYLINE="polyline",t.POLYGON="polygon",t.TEXT="text",t.PATH="path",t.HTML="html",t.MESH="mesh",t}({}),In=function(t){return t[t.ZERO=0]="ZERO",t[t.NEGATIVE_ONE=1]="NEGATIVE_ONE",t}({}),Bn=function(){return(0,s.Z)((function t(){(0,a.Z)(this,t),this.plugins=[]}),[{key:"addRenderingPlugin",value:function(t){this.plugins.push(t),this.context.renderingPlugins.push(t)}},{key:"removeAllRenderingPlugins",value:function(){var t=this;this.plugins.forEach((function(e){var n=t.context.renderingPlugins.indexOf(e);n>=0&&t.context.renderingPlugins.splice(n,1)}))}}])}(),jn=function(){return(0,s.Z)((function t(e){(0,a.Z)(this,t),this.clipSpaceNearZ=In.NEGATIVE_ONE,this.plugins=[],this.config=(0,o.Z)({enableDirtyCheck:!0,enableCulling:!1,enableAutoRendering:!0,enableDirtyRectangleRendering:!0,enableDirtyRectangleRenderingDebug:!1,enableSizeAttenuation:!0,enableRenderingOptimization:!1},e)}),[{key:"registerPlugin",value:function(t){-1===this.plugins.findIndex((function(e){return e===t}))&&this.plugins.push(t)}},{key:"unregisterPlugin",value:function(t){var e=this.plugins.findIndex((function(e){return e===t}));e>-1&&this.plugins.splice(e,1)}},{key:"getPlugins",value:function(){return this.plugins}},{key:"getPlugin",value:function(t){return this.plugins.find((function(e){return e.name===t}))}},{key:"getConfig",value:function(){return this.config}},{key:"setConfig",value:function(t){Object.assign(this.config,t)}}])}(),zn=E,Fn=b,_n=function(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t[2]=Math.max(e[2],n[2]),t},Zn=function(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t[2]=Math.min(e[2],n[2]),t},Gn=M,Vn=D,Wn=function(){function t(){(0,a.Z)(this,t),this.center=[0,0,0],this.halfExtents=[0,0,0],this.min=[0,0,0],this.max=[0,0,0]}return(0,s.Z)(t,[{key:"update",value:function(t,e){Fn(this.center,t),Fn(this.halfExtents,e),Vn(this.min,this.center,this.halfExtents),zn(this.max,this.center,this.halfExtents)}},{key:"setMinMax",value:function(t,e){zn(this.center,e,t),Gn(this.center,this.center,.5),Vn(this.halfExtents,e,t),Gn(this.halfExtents,this.halfExtents,.5),Fn(this.min,t),Fn(this.max,e)}},{key:"getMin",value:function(){return this.min}},{key:"getMax",value:function(){return this.max}},{key:"add",value:function(e){if(!t.isEmpty(e))if(t.isEmpty(this))this.setMinMax(e.getMin(),e.getMax());else{var n=this.center,r=n[0],i=n[1],o=n[2],a=this.halfExtents,s=a[0],l=a[1],c=a[2],u=r-s,h=r+s,d=i-l,f=i+l,p=o-c,g=o+c,v=e.center,m=v[0],y=v[1],b=v[2],x=e.halfExtents,E=x[0],w=x[1],k=x[2],M=m-E,S=m+E,A=y-w,N=y+w,C=b-k,O=b+k;M<u&&(u=M),S>h&&(h=S),A<d&&(d=A),N>f&&(f=N),C<p&&(p=C),O>g&&(g=O),n[0]=.5*(u+h),n[1]=.5*(d+f),n[2]=.5*(p+g),a[0]=.5*(h-u),a[1]=.5*(f-d),a[2]=.5*(g-p),this.min[0]=u,this.min[1]=d,this.min[2]=p,this.max[0]=h,this.max[1]=f,this.max[2]=g}}},{key:"setFromTransformedAABB",value:function(t,e){var n=this.center,r=this.halfExtents,i=t.center,o=t.halfExtents,a=e[0],s=e[4],l=e[8],c=e[1],u=e[5],h=e[9],d=e[2],f=e[6],p=e[10],g=Math.abs(a),v=Math.abs(s),m=Math.abs(l),y=Math.abs(c),b=Math.abs(u),x=Math.abs(h),E=Math.abs(d),w=Math.abs(f),k=Math.abs(p);n[0]=e[12]+a*i[0]+s*i[1]+l*i[2],n[1]=e[13]+c*i[0]+u*i[1]+h*i[2],n[2]=e[14]+d*i[0]+f*i[1]+p*i[2],r[0]=g*o[0]+v*o[1]+m*o[2],r[1]=y*o[0]+b*o[1]+x*o[2],r[2]=E*o[0]+w*o[1]+k*o[2],Vn(this.min,n,r),zn(this.max,n,r)}},{key:"intersects",value:function(t){var e=this.getMax(),n=this.getMin(),r=t.getMax(),i=t.getMin();return n[0]<=r[0]&&e[0]>=i[0]&&n[1]<=r[1]&&e[1]>=i[1]&&n[2]<=r[2]&&e[2]>=i[2]}},{key:"intersection",value:function(e){if(!this.intersects(e))return null;var n=new t,r=_n([0,0,0],this.getMin(),e.getMin()),i=Zn([0,0,0],this.getMax(),e.getMax());return n.setMinMax(r,i),n}},{key:"getNegativeFarPoint",value:function(t){return 273===t.pnVertexFlag?Fn([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]]}},{key:"getPositiveFarPoint",value:function(t){return 273===t.pnVertexFlag?Fn([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]]}}],[{key:"isEmpty",value:function(t){return!t||0===t.halfExtents[0]&&0===t.halfExtents[1]&&0===t.halfExtents[2]}}])}(),Hn=function(){return(0,s.Z)((function t(e,n){(0,a.Z)(this,t),this.distance=e||0,this.normal=n||y(0,1,0),this.updatePNVertexFlag()}),[{key:"updatePNVertexFlag",value:function(){this.pnVertexFlag=(Number(this.normal[0]>=0)<<8)+(Number(this.normal[1]>=0)<<4)+Number(this.normal[2]>=0)}},{key:"distanceToPoint",value:function(t){return A(t,this.normal)-this.distance}},{key:"normalize",value:function(){var t=1/I(this.normal);M(this.normal,this.normal,t),this.distance*=t}},{key:"intersectsLine",value:function(t,e,n){var r=this.distanceToPoint(t),i=r/(r-this.distanceToPoint(e)),o=i>=0&&i<=1;return o&&n&&C(n,t,e,i),o}}])}(),Un=function(t){return t[t.OUTSIDE=4294967295]="OUTSIDE",t[t.INSIDE=0]="INSIDE",t[t.INDETERMINATE=2147483647]="INDETERMINATE",t}({}),Yn=function(){return(0,s.Z)((function t(e){if((0,a.Z)(this,t),this.planes=[],e)this.planes=e;else for(var n=0;n<6;n++)this.planes.push(new Hn)}),[{key:"extractFromVPMatrix",value:function(t){var e=(0,h.Z)(t,16),n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],l=e[6],c=e[7],u=e[8],d=e[9],f=e[10],p=e[11],g=e[12],v=e[13],m=e[14],y=e[15];x(this.planes[0].normal,o-n,c-a,p-u),this.planes[0].distance=y-g,x(this.planes[1].normal,o+n,c+a,p+u),this.planes[1].distance=y+g,x(this.planes[2].normal,o+r,c+s,p+d),this.planes[2].distance=y+v,x(this.planes[3].normal,o-r,c-s,p-d),this.planes[3].distance=y-v,x(this.planes[4].normal,o-i,c-l,p-f),this.planes[4].distance=y-m,x(this.planes[5].normal,o+i,c+l,p+f),this.planes[5].distance=y+m,this.planes.forEach((function(t){t.normalize(),t.updatePNVertexFlag()}))}}])}(),qn=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;(0,a.Z)(this,t),this.x=0,this.y=0,this.x=e,this.y=n}return(0,s.Z)(t,[{key:"clone",value:function(){return new t(this.x,this.y)}},{key:"copyFrom",value:function(t){this.x=t.x,this.y=t.y}}])}(),Xn=function(){function t(e,n,r,i){(0,a.Z)(this,t),this.x=e,this.y=n,this.width=r,this.height=i,this.left=e,this.right=e+r,this.top=n,this.bottom=n+i}return(0,s.Z)(t,[{key:"toJSON",value:function(){}}],[{key:"fromRect",value:function(e){return new t(e.x,e.y,e.width,e.height)}},{key:"applyTransform",value:function(e,n){var r=j(e.x,e.y,0,1),i=j(e.x+e.width,e.y,0,1),o=j(e.x,e.y+e.height,0,1),a=j(e.x+e.width,e.y+e.height,0,1),s=B(),l=B(),c=B(),u=B();z(s,r,n),z(l,i,n),z(c,o,n),z(u,a,n);var h=Math.min(s[0],l[0],c[0],u[0]),d=Math.min(s[1],l[1],c[1],u[1]),f=Math.max(s[0],l[0],c[0],u[0]),p=Math.max(s[1],l[1],c[1],u[1]);return t.fromRect({x:h,y:d,width:f-h,height:p-d})}}])}(),Kn="Method not implemented.",Qn="Use document.documentElement instead.";function Jn(t){return void 0===t?0:t>360||t<-360?t%360:t}var $n=g();function tr(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];return Array.isArray(t)&&3===t.length?r?v(t):b($n,t):ie(t)?r?y(t,e,n):x($n,t,e,n):r?y(t[0],t[1]||e,t[2]||n):x($n,t[0],t[1]||e,t[2]||n)}var er=Math.PI/180;function nr(t){return t*er}var rr=180/Math.PI;function ir(t){return t*rr}var or=Math.PI/2;function ar(t,e){return 16===e.length?function(t,e){var n,r,i=ht(g(),e),o=(0,h.Z)(i,3),a=o[0],s=o[1],l=o[2],c=Math.asin(-e[2]/a);return c<or?c>-or?(n=Math.atan2(e[6]/s,e[10]/l),r=Math.atan2(e[1]/a,e[0]/a)):(r=0,n=-Math.atan2(e[4]/s,e[5]/s)):(r=0,n=Math.atan2(e[4]/s,e[5]/s)),t[0]=n,t[1]=c,t[2]=r,t}(t,e):function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=r*r,s=i*i,l=o*o,c=n*n+a+s+l,u=n*o-r*i;return u>.499995*c?(t[0]=or,t[1]=2*Math.atan2(r,n),t[2]=0):u<-.499995*c?(t[0]=-or,t[1]=2*Math.atan2(r,n),t[2]=0):(t[0]=Math.asin(2*(n*i-o*r)),t[1]=Math.atan2(2*(n*o+r*i),1-2*(s+l)),t[2]=Math.atan2(2*(n*r+i*o),1-2*(a+s))),t}(t,e)}function sr(t,e,n,r,i){var o,a,s,l,c,u,h,d,f,g,v=Math.cos(t),m=Math.sin(t);return o=r*v,a=i*m,s=0,l=-r*m,c=i*v,u=0,h=e,d=n,f=1,(g=new p(9))[0]=o,g[1]=a,g[2]=s,g[3]=l,g[4]=c,g[5]=u,g[6]=h,g[7]=d,g[8]=f,g}function lr(t){var e=t[0],n=t[1],r=t[3],i=t[4],o=Math.sqrt(e*e+n*n),a=Math.sqrt(r*r+i*i);if(e*i-n*r<0&&(e<i?o=-o:a=-a),o){var s=1/o;e*=s,n*=s}if(a){var l=1/a;r*=l,i*=l}var c=ir(Math.atan2(n,e));return[t[6],t[7],o,a,c]}var cr=F(),ur=F(),hr=B(),dr=[g(),g(),g()],fr=g();function pr(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 gr=function(t){return t[t.ORBITING=0]="ORBITING",t[t.EXPLORING=1]="EXPLORING",t[t.TRACKING=2]="TRACKING",t}({}),vr=function(t){return t[t.DEFAULT=0]="DEFAULT",t[t.ROTATIONAL=1]="ROTATIONAL",t[t.TRANSLATIONAL=2]="TRANSLATIONAL",t[t.CINEMATIC=3]="CINEMATIC",t}({}),mr=function(t){return t[t.ORTHOGRAPHIC=0]="ORTHOGRAPHIC",t[t.PERSPECTIVE=1]="PERSPECTIVE",t}({}),yr="updated",br=2e-4,xr=function(){return(0,s.Z)((function t(){(0,a.Z)(this,t),this.clipSpaceNearZ=In.NEGATIVE_ONE,this.eventEmitter=new d,this.matrix=F(),this.right=y(1,0,0),this.up=y(0,1,0),this.forward=y(0,0,1),this.position=y(0,0,1),this.focalPoint=y(0,0,0),this.distanceVector=y(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=F(),this.projectionMatrixInverse=F(),this.jitteredProjectionMatrix=void 0,this.enableUpdate=!0,this.type=gr.EXPLORING,this.trackingMode=vr.DEFAULT,this.projectionMode=mr.PERSPECTIVE,this.frustum=new Yn,this.orthoMatrix=F()}),[{key:"isOrtho",value:function(){return this.projectionMode===mr.ORTHOGRAPHIC}},{key:"getProjectionMode",value:function(){return this.projectionMode}},{key:"getPerspective",value:function(){return this.jitteredProjectionMatrix||this.projectionMatrix}},{key:"getPerspectiveInverse",value:function(){return this.projectionMatrixInverse}},{key:"getFrustum",value:function(){return this.frustum}},{key:"getPosition",value:function(){return this.position}},{key:"getFocalPoint",value:function(){return this.focalPoint}},{key:"getDollyingStep",value:function(){return this.dollyingStep}},{key:"getNear",value:function(){return this.near}},{key:"getFar",value:function(){return this.far}},{key:"getZoom",value:function(){return this.zoom}},{key:"getOrthoMatrix",value:function(){return this.orthoMatrix}},{key:"getView",value:function(){return this.view}},{key:"setEnableUpdate",value:function(t){this.enableUpdate=t}},{key:"setType",value:function(t,e){return this.type=t,this.type===gr.EXPLORING?this.setWorldRotation(!0):this.setWorldRotation(!1),this._getAngles(),this.type===gr.TRACKING&&void 0!==e&&this.setTrackingMode(e),this}},{key:"setProjectionMode",value:function(t){return this.projectionMode=t,this}},{key:"setTrackingMode",value:function(t){if(this.type!==gr.TRACKING)throw new Error("Impossible to set a tracking mode if the camera is not of tracking type");return this.trackingMode=t,this}},{key:"setWorldRotation",value:function(t){return this.rotateWorld=t,this._getAngles(),this}},{key:"getViewTransform",value:function(){return U(F(),this.matrix)}},{key:"getWorldTransform",value:function(){return this.matrix}},{key:"jitterProjectionMatrix",value:function(t,e){var n=nt(F(),[t,e,0]);this.jitteredProjectionMatrix=X(F(),n,this.projectionMatrix)}},{key:"clearJitterProjectionMatrix",value:function(){this.jitteredProjectionMatrix=void 0}},{key:"setMatrix",value:function(t){return this.matrix=t,this._update(),this}},{key:"setProjectionMatrix",value:function(t){this.projectionMatrix=t}},{key:"setFov",value:function(t){return this.setPerspective(this.near,this.far,t,this.aspect),this}},{key:"setAspect",value:function(t){return this.setPerspective(this.near,this.far,this.fov,t),this}},{key:"setNear",value:function(t){return this.projectionMode===mr.PERSPECTIVE?this.setPerspective(t,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,t,this.far),this}},{key:"setFar",value:function(t){return this.projectionMode===mr.PERSPECTIVE?this.setPerspective(this.near,t,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,t),this}},{key:"setViewOffset",value:function(t,e,n,r,i,o){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=o,this.projectionMode===mr.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}},{key:"clearViewOffset",value:function(){return void 0!==this.view&&(this.view.enabled=!1),this.projectionMode===mr.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}},{key:"setZoom",value:function(t){return this.zoom=t,this.projectionMode===mr.ORTHOGRAPHIC?this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far):this.projectionMode===mr.PERSPECTIVE&&this.setPerspective(this.near,this.far,this.fov,this.aspect),this}},{key:"setZoomByViewportPoint",value:function(t,e){var n=this.canvas.viewport2Canvas({x:e[0],y:e[1]}),r=n.x,i=n.y,o=this.roll;this.rotate(0,0,-o),this.setPosition(r,i),this.setFocalPoint(r,i),this.setZoom(t),this.rotate(0,0,o);var a=this.canvas.viewport2Canvas({x:e[0],y:e[1]}),s=y(a.x-r,a.y-i,0),l=A(s,this.right)/m(this.right),c=A(s,this.up)/m(this.up),u=this.getPosition(),d=(0,h.Z)(u,2),f=d[0],p=d[1],g=this.getFocalPoint(),v=(0,h.Z)(g,2),b=v[0],x=v[1];return this.setPosition(f-l,p-c),this.setFocalPoint(b-l,x-c),this}},{key:"setPerspective",value:function(t,e,n,r){var i;this.projectionMode=mr.PERSPECTIVE,this.fov=n,this.near=t,this.far=e,this.aspect=r;var o=this.near*Math.tan(nr(.5*this.fov))/this.zoom,a=2*o,s=this.aspect*a,l=-.5*s;if(null!==(i=this.view)&&void 0!==i&&i.enabled){var c=this.view.fullWidth,u=this.view.fullHeight;l+=this.view.offsetX*s/c,o-=this.view.offsetY*a/u,s*=this.view.width/c,a*=this.view.height/u}return function(t,e,n,r,i,o,a){var s,l,c=arguments.length>7&&void 0!==arguments[7]&&arguments[7],u=2*o,h=n-e,d=r-i,f=u/h,p=u/d,g=(n+e)/h,v=(r+i)/d,m=a-o,y=a*o;c?(s=-a/m,l=-y/m):(s=-(a+o)/m,l=-2*y/m),t[0]=f,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=p,t[6]=0,t[7]=0,t[8]=g,t[9]=v,t[10]=s,t[11]=-1,t[12]=0,t[13]=0,t[14]=l,t[15]=0}(this.projectionMatrix,l,l+s,o-a,o,t,this.far,this.clipSpaceNearZ===In.ZERO),U(this.projectionMatrixInverse,this.projectionMatrix),this.triggerUpdate(),this}},{key:"setOrthographic",value:function(t,e,n,r,i,o){var a;this.projectionMode=mr.ORTHOGRAPHIC,this.rright=e,this.left=t,this.top=n,this.bottom=r,this.near=i,this.far=o;var s=(this.rright-this.left)/(2*this.zoom),l=(this.top-this.bottom)/(2*this.zoom),c=(this.rright+this.left)/2,u=(this.top+this.bottom)/2,h=c-s,d=c+s,f=u+l,p=u-l;if(null!==(a=this.view)&&void 0!==a&&a.enabled){var g=(this.rright-this.left)/this.view.fullWidth/this.zoom,v=(this.top-this.bottom)/this.view.fullHeight/this.zoom;d=(h+=g*this.view.offsetX)+g*this.view.width,p=(f-=v*this.view.offsetY)-v*this.view.height}return this.clipSpaceNearZ===In.NEGATIVE_ONE?kt(this.projectionMatrix,h,d,f,p,i,o):Mt(this.projectionMatrix,h,d,f,p,i,o),U(this.projectionMatrixInverse,this.projectionMatrix),this._getOrthoMatrix(),this.triggerUpdate(),this}},{key:"setPosition",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.position[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.position[2],r=tr(t,e,n);return this._setPosition(r),this.setFocalPoint(this.focalPoint),this.triggerUpdate(),this}},{key:"setFocalPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.focalPoint[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.focalPoint[2],r=y(0,1,0);if(this.focalPoint=tr(t,e,n),this.trackingMode===vr.CINEMATIC){var i=w(g(),this.focalPoint,this.position);t=i[0],e=i[1],n=i[2];var o=m(i),a=ir(Math.asin(e/o)),s=90+ir(Math.atan2(n,t)),l=F();tt(l,l,nr(s)),$(l,l,nr(a)),r=O(g(),[0,1,0],l)}return U(this.matrix,St(F(),this.position,this.focalPoint,r)),this._getAxes(),this._getDistance(),this._getAngles(),this.triggerUpdate(),this}},{key:"getDistance",value:function(){return this.distance}},{key:"getDistanceVector",value:function(){return this.distanceVector}},{key:"setDistance",value:function(t){if(this.distance===t||t<0)return this;this.distance=t,this.distance<br&&(this.distance=br),this.dollyingStep=this.distance/100;var e=g();t=this.distance;var n=this.forward,r=this.focalPoint;return 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}},{key:"setMaxDistance",value:function(t){return this.maxDistance=t,this}},{key:"setMinDistance",value:function(t){return this.minDistance=t,this}},{key:"setAzimuth",value:function(t){return this.azimuth=Jn(t),this.computeMatrix(),this._getAxes(),this.type===gr.ORBITING||this.type===gr.EXPLORING?this._getPosition():this.type===gr.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this}},{key:"getAzimuth",value:function(){return this.azimuth}},{key:"setElevation",value:function(t){return this.elevation=Jn(t),this.computeMatrix(),this._getAxes(),this.type===gr.ORBITING||this.type===gr.EXPLORING?this._getPosition():this.type===gr.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this}},{key:"getElevation",value:function(){return this.elevation}},{key:"setRoll",value:function(t){return this.roll=Jn(t),this.computeMatrix(),this._getAxes(),this.type===gr.ORBITING||this.type===gr.EXPLORING?this._getPosition():this.type===gr.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this}},{key:"getRoll",value:function(){return this.roll}},{key:"_update",value:function(){this._getAxes(),this._getPosition(),this._getDistance(),this._getAngles(),this._getOrthoMatrix(),this.triggerUpdate()}},{key:"computeMatrix",value:function(){var t=Ft(zt(),[0,0,1],nr(this.roll));W(this.matrix);var e=Ft(zt(),[1,0,0],nr((this.rotateWorld&&this.type!==gr.TRACKING||this.type===gr.TRACKING?1:-1)*this.elevation)),n=Ft(zt(),[0,1,0],nr((this.rotateWorld&&this.type!==gr.TRACKING||this.type===gr.TRACKING?1:-1)*this.azimuth)),r=_t(zt(),n,e);r=_t(zt(),r,t);var i=vt(F(),r);this.type===gr.ORBITING||this.type===gr.EXPLORING?(K(this.matrix,this.matrix,this.focalPoint),X(this.matrix,this.matrix,i),K(this.matrix,this.matrix,[0,0,this.distance])):this.type===gr.TRACKING&&(K(this.matrix,this.matrix,this.position),X(this.matrix,this.matrix,i))}},{key:"_setPosition",value:function(t,e,n){this.position=tr(t,e,n);var r=this.matrix;r[12]=this.position[0],r[13]=this.position[1],r[14]=this.position[2],r[15]=1,this._getOrthoMatrix()}},{key:"_getAxes",value:function(){b(this.right,tr(z(B(),[1,0,0,0],this.matrix))),b(this.up,tr(z(B(),[0,1,0,0],this.matrix))),b(this.forward,tr(z(B(),[0,0,1,0],this.matrix))),S(this.right,this.right),S(this.up,this.up),S(this.forward,this.forward)}},{key:"_getAngles",value:function(){var t=this.distanceVector[0],e=this.distanceVector[1],n=this.distanceVector[2],r=m(this.distanceVector);if(0===r)return this.elevation=0,void(this.azimuth=0);this.type===gr.TRACKING||this.rotateWorld?(this.elevation=ir(Math.asin(e/r)),this.azimuth=ir(Math.atan2(-t,-n))):(this.elevation=-ir(Math.asin(e/r)),this.azimuth=-ir(Math.atan2(-t,-n)))}},{key:"_getPosition",value:function(){b(this.position,tr(z(B(),[0,0,0,1],this.matrix))),this._getDistance()}},{key:"_getFocalPoint",value:function(){!function(t,e,n){var r=e[0],i=e[1],o=e[2];t[0]=r*n[0]+i*n[3]+o*n[6],t[1]=r*n[1]+i*n[4]+o*n[7],t[2]=r*n[2]+i*n[5]+o*n[8]}(this.distanceVector,[0,0,-this.distance],function(t,e){return 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}(jt(),this.matrix)),E(this.focalPoint,this.position,this.distanceVector),this._getDistance()}},{key:"_getDistance",value:function(){this.distanceVector=w(g(),this.focalPoint,this.position),this.distance=m(this.distanceVector),this.dollyingStep=this.distance/100}},{key:"_getOrthoMatrix",value:function(){if(this.projectionMode===mr.ORTHOGRAPHIC){var t=this.position,e=Ft(zt(),[0,0,1],-this.roll*Math.PI/180);gt(this.orthoMatrix,e,y((this.rright-this.left)/2-t[0],(this.top-this.bottom)/2-t[1],0),y(this.zoom,this.zoom,1),t)}}},{key:"triggerUpdate",value:function(){if(this.enableUpdate){var t=this.getViewTransform(),e=X(F(),this.getPerspective(),t);this.getFrustum().extractFromVPMatrix(e),this.eventEmitter.emit(yr)}}},{key:"rotate",value:function(t,e,n){throw new Error(Kn)}},{key:"pan",value:function(t,e){throw new Error(Kn)}},{key:"dolly",value:function(t){throw new Error(Kn)}},{key:"createLandmark",value:function(t,e){throw new Error(Kn)}},{key:"gotoLandmark",value:function(t,e){throw new Error(Kn)}},{key:"cancelLandmarkAnimation",value:function(){throw new Error(Kn)}}])}(),Er=function(t){return t[t.Standard=0]="Standard",t}({}),wr=function(t){return t[t.ADDED=0]="ADDED",t[t.REMOVED=1]="REMOVED",t[t.Z_INDEX_CHANGED=2]="Z_INDEX_CHANGED",t}({}),kr=g(),Mr=F(),Sr=zt();function Ar(t){if(t.localDirtyFlag){if(0!==t.localSkew[0]||0!==t.localSkew[1]){gt(t.localTransform,t.localRotation,t.localPosition,y(1,1,1),t.origin),0===t.localSkew[0]&&0===t.localSkew[1]||(W(Mr),Mr[4]=Math.tan(t.localSkew[0]),Mr[1]=Math.tan(t.localSkew[1]),X(t.localTransform,t.localTransform,Mr));var e=gt(Mr,Ut(Sr,0,0,0,1),x(kr,1,1,1),t.localScale,t.origin);X(t.localTransform,t.localTransform,e)}else{var n=t.localTransform,r=t.localPosition,i=t.localRotation,o=t.localScale,a=t.origin,s=0!==r[0]||0!==r[1]||0!==r[2],l=1!==i[3]||0!==i[0]||0!==i[1]||0!==i[2],c=1!==o[0]||1!==o[1]||1!==o[2],u=0!==a[0]||0!==a[1]||0!==a[2];l||c||u?gt(n,i,r,o,a):s?nt(n,r):W(n)}t.localDirtyFlag=!1}}var Nr={absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new Xn(0,0,0,0)},Cr=function(t){return t.COORDINATE="<coordinate>",t.COLOR="<color>",t.PAINT="<paint>",t.NUMBER="<number>",t.ANGLE="<angle>",t.OPACITY_VALUE="<opacity-value>",t.SHADOW_BLUR="<shadow-blur>",t.LENGTH="<length>",t.PERCENTAGE="<percentage>",t.LENGTH_PERCENTAGE="<length> | <percentage>",t.LENGTH_PERCENTAGE_12="[<length> | <percentage>]{1,2}",t.LENGTH_PERCENTAGE_14="[<length> | <percentage>]{1,4}",t.LIST_OF_POINTS="<list-of-points>",t.PATH="<path>",t.FILTER="<filter>",t.Z_INDEX="<z-index>",t.OFFSET_DISTANCE="<offset-distance>",t.DEFINED_PATH="<defined-path>",t.MARKER="<marker>",t.TRANSFORM="<transform>",t.TRANSFORM_ORIGIN="<transform-origin>",t.TEXT="<text>",t.TEXT_TRANSFORM="<text-transform>",t}({});function Or(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function Tr(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function Pr(){}var Rr=.7,Dr=1/Rr,Lr="\\s*([+-]?\\d+)\\s*",Ir="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Br="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",jr=/^#([0-9a-f]{3,8})$/,zr=new RegExp(`^rgb\\(${Lr},${Lr},${Lr}\\)$`),Fr=new RegExp(`^rgb\\(${Br},${Br},${Br}\\)$`),_r=new RegExp(`^rgba\\(${Lr},${Lr},${Lr},${Ir}\\)$`),Zr=new RegExp(`^rgba\\(${Br},${Br},${Br},${Ir}\\)$`),Gr=new RegExp(`^hsl\\(${Ir},${Br},${Br}\\)$`),Vr=new RegExp(`^hsla\\(${Ir},${Br},${Br},${Ir}\\)$`),Wr={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 Hr(){return this.rgb().formatHex()}function Ur(){return this.rgb().formatRgb()}function Yr(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=jr.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?qr(e):3===n?new Qr(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?Xr(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?Xr(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=zr.exec(t))?new Qr(e[1],e[2],e[3],1):(e=Fr.exec(t))?new Qr(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=_r.exec(t))?Xr(e[1],e[2],e[3],e[4]):(e=Zr.exec(t))?Xr(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=Gr.exec(t))?ri(e[1],e[2]/100,e[3]/100,1):(e=Vr.exec(t))?ri(e[1],e[2]/100,e[3]/100,e[4]):Wr.hasOwnProperty(t)?qr(Wr[t]):"transparent"===t?new Qr(NaN,NaN,NaN,0):null}function qr(t){return new Qr(t>>16&255,t>>8&255,255&t,1)}function Xr(t,e,n,r){return r<=0&&(t=e=n=NaN),new Qr(t,e,n,r)}function Kr(t){return t instanceof Pr||(t=Yr(t)),t?new Qr((t=t.rgb()).r,t.g,t.b,t.opacity):new Qr}function Qr(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function Jr(){return`#${ni(this.r)}${ni(this.g)}${ni(this.b)}`}function $r(){const t=ti(this.opacity);return`${1===t?"rgb(":"rgba("}${ei(this.r)}, ${ei(this.g)}, ${ei(this.b)}${1===t?")":`, ${t})`}`}function ti(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function ei(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function ni(t){return((t=ei(t))<16?"0":"")+t.toString(16)}function ri(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new oi(t,e,n,r)}function ii(t){if(t instanceof oi)return new oi(t.h,t.s,t.l,t.opacity);if(t instanceof Pr||(t=Yr(t)),!t)return new oi;if(t instanceof oi)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),a=NaN,s=o-i,l=(o+i)/2;return s?(a=e===o?(n-r)/s+6*(n<r):n===o?(r-e)/s+2:(e-n)/s+4,s/=l<.5?o+i:2-o-i,a*=60):s=l>0&&l<1?0:a,new oi(a,s,l,t.opacity)}function oi(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function ai(t){return(t=(t||0)%360)<0?t+360:t}function si(t){return Math.max(0,Math.min(1,t||0))}function li(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 ci(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var n=function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];var a=e?e.apply(this,i):i[0],s=n.cache;if(s.has(a))return s.get(a);var l=t.apply(this,i);return n.cache=s.set(a,l)||s,l};return n.cache=new(ci.Cache||Map),ci.cacheList.push(n.cache),n}Or(Pr,Yr,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:Hr,formatHex:Hr,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return ii(this).formatHsl()},formatRgb:Ur,toString:Ur}),Or(Qr,(function(t,e,n,r){return 1===arguments.length?Kr(t):new Qr(t,e,n,null==r?1:r)}),Tr(Pr,{brighter(t){return t=null==t?Dr:Math.pow(Dr,t),new Qr(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?Rr:Math.pow(Rr,t),new Qr(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Qr(ei(this.r),ei(this.g),ei(this.b),ti(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:Jr,formatHex:Jr,formatHex8:function(){return`#${ni(this.r)}${ni(this.g)}${ni(this.b)}${ni(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:$r,toString:$r})),Or(oi,(function(t,e,n,r){return 1===arguments.length?ii(t):new oi(t,e,n,null==r?1:r)}),Tr(Pr,{brighter(t){return t=null==t?Dr:Math.pow(Dr,t),new oi(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?Rr:Math.pow(Rr,t),new oi(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,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new Qr(li(t>=240?t-240:t+120,i,r),li(t,i,r),li(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new oi(ai(this.h),si(this.s),si(this.l),ti(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(){const t=ti(this.opacity);return`${1===t?"hsl(":"hsla("}${ai(this.h)}, ${100*si(this.s)}%, ${100*si(this.l)}%${1===t?")":`, ${t})`}`}})),ci.Cache=Map,ci.cacheList=[],ci.clearCache=function(){ci.cacheList.forEach((function(t){return t.clear()}))};var ui=function(t){return t[t.kUnknown=0]="kUnknown",t[t.kNumber=1]="kNumber",t[t.kPercentage=2]="kPercentage",t[t.kEms=3]="kEms",t[t.kPixels=4]="kPixels",t[t.kRems=5]="kRems",t[t.kDegrees=6]="kDegrees",t[t.kRadians=7]="kRadians",t[t.kGradians=8]="kGradians",t[t.kTurns=9]="kTurns",t[t.kMilliseconds=10]="kMilliseconds",t[t.kSeconds=11]="kSeconds",t[t.kInteger=12]="kInteger",t}({}),hi=function(t){return t[t.kUNumber=0]="kUNumber",t[t.kUPercent=1]="kUPercent",t[t.kULength=2]="kULength",t[t.kUAngle=3]="kUAngle",t[t.kUTime=4]="kUTime",t[t.kUOther=5]="kUOther",t}({}),di=function(t){return t[t.kYes=0]="kYes",t[t.kNo=1]="kNo",t}({}),fi=function(t){return t[t.kYes=0]="kYes",t[t.kNo=1]="kNo",t}({}),pi=[{name:"em",unit_type:ui.kEms},{name:"px",unit_type:ui.kPixels},{name:"deg",unit_type:ui.kDegrees},{name:"rad",unit_type:ui.kRadians},{name:"grad",unit_type:ui.kGradians},{name:"ms",unit_type:ui.kMilliseconds},{name:"s",unit_type:ui.kSeconds},{name:"rem",unit_type:ui.kRems},{name:"turn",unit_type:ui.kTurns}],gi=function(t){return t[t.kUnknownType=0]="kUnknownType",t[t.kUnparsedType=1]="kUnparsedType",t[t.kKeywordType=2]="kKeywordType",t[t.kUnitType=3]="kUnitType",t[t.kSumType=4]="kSumType",t[t.kProductType=5]="kProductType",t[t.kNegateType=6]="kNegateType",t[t.kInvertType=7]="kInvertType",t[t.kMinType=8]="kMinType",t[t.kMaxType=9]="kMaxType",t[t.kClampType=10]="kClampType",t[t.kTransformType=11]="kTransformType",t[t.kPositionType=12]="kPositionType",t[t.kURLImageType=13]="kURLImageType",t[t.kColorType=14]="kColorType",t[t.kUnsupportedColorType=15]="kUnsupportedColorType",t}({}),vi=function(t){return t?"number"===t?ui.kNumber:"percent"===t||"%"===t?ui.kPercentage:function(t){return pi.find((function(e){return e.name===t})).unit_type}(t):ui.kUnknown},mi=function(t){var e=1;switch(t){case ui.kPixels:case ui.kDegrees:case ui.kSeconds:break;case ui.kMilliseconds:e=.001;break;case ui.kRadians:e=180/Math.PI;break;case ui.kGradians:e=.9;break;case ui.kTurns:e=360}return e},yi=function(t){switch(t){case ui.kNumber:case ui.kInteger:return"";case ui.kPercentage:return"%";case ui.kEms:return"em";case ui.kRems:return"rem";case ui.kPixels:return"px";case ui.kDegrees:return"deg";case ui.kRadians:return"rad";case ui.kGradians:return"grad";case ui.kMilliseconds:return"ms";case ui.kSeconds:return"s";case ui.kTurns:return"turn"}return""},bi=function(){return(0,s.Z)((function t(){(0,a.Z)(this,t)}),[{key:"toString",value:function(){return this.buildCSSText(di.kNo,fi.kNo,"")}},{key:"isNumericValue",value:function(){return this.getType()>=gi.kUnitType&&this.getType()<=gi.kClampType}}],[{key:"isAngle",value:function(t){return t===ui.kDegrees||t===ui.kRadians||t===ui.kGradians||t===ui.kTurns}},{key:"isLength",value:function(t){return t>=ui.kEms&&t<ui.kDegrees}},{key:"isRelativeUnit",value:function(t){return t===ui.kPercentage||t===ui.kEms||t===ui.kRems}},{key:"isTime",value:function(t){return t===ui.kSeconds||t===ui.kMilliseconds}}])}(),xi=function(t){function e(t){var n;return(0,a.Z)(this,e),(n=(0,c.Z)(this,e)).colorSpace=t,n}return(0,u.Z)(e,t),(0,s.Z)(e,[{key:"getType",value:function(){return gi.kColorType}},{key:"to",value:function(t){return this}}])}(bi),Ei=function(t){return t[t.Constant=0]="Constant",t[t.LinearGradient=1]="LinearGradient",t[t.RadialGradient=2]="RadialGradient",t}({}),wi=function(t){function e(t,n){var r;return(0,a.Z)(this,e),(r=(0,c.Z)(this,e)).type=t,r.value=n,r}return(0,u.Z)(e,t),(0,s.Z)(e,[{key:"clone",value:function(){return new e(this.type,this.value)}},{key:"buildCSSText",value:function(t,e,n){return n}},{key:"getType",value:function(){return gi.kColorType}}])}(bi),ki=function(t){function e(t){var n;return(0,a.Z)(this,e),(n=(0,c.Z)(this,e)).value=t,n}return(0,u.Z)(e,t),(0,s.Z)(e,[{key:"clone",value:function(){return new e(this.value)}},{key:"getType",value:function(){return gi.kKeywordType}},{key:"buildCSSText",value:function(t,e,n){return n+this.value}}])}(bi),Mi=function(t){return function(t){switch(t){case hi.kUNumber:return ui.kNumber;case hi.kULength:return ui.kPixels;case hi.kUPercent:return ui.kPercentage;case hi.kUTime:return ui.kSeconds;case hi.kUAngle:return ui.kDegrees;default:return ui.kUnknown}}(function(t){switch(t){case ui.kNumber:case ui.kInteger:return hi.kUNumber;case ui.kPercentage:return hi.kUPercent;case ui.kPixels:return hi.kULength;case ui.kMilliseconds:case ui.kSeconds:return hi.kUTime;case ui.kDegrees:case ui.kRadians:case ui.kGradians:case ui.kTurns:return hi.kUAngle;default:return hi.kUOther}}(t))},Si=function(t){function e(t){var n,r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ui.kNumber;return(0,a.Z)(this,e),n=(0,c.Z)(this,e),r="string"==typeof i?vi(i):i,n.unit=r,n.value=t,n}return(0,u.Z)(e,t),(0,s.Z)(e,[{key:"clone",value:function(){return new e(this.value,this.unit)}},{key:"equals",value:function(t){var e=t;return this.value===e.value&&this.unit===e.unit}},{key:"getType",value:function(){return gi.kUnitType}},{key:"convertTo",value:function(t){if(this.unit===t)return new e(this.value,this.unit);var n=Mi(this.unit);if(n!==Mi(t)||n===ui.kUnknown)return null;var r=mi(this.unit)/mi(t);return new e(this.value*r,t)}},{key:"buildCSSText",value:function(t,e,n){var r;switch(this.unit){case ui.kUnknown:break;case ui.kInteger:r=Number(this.value).toFixed(0);break;case ui.kNumber:case ui.kPercentage:case ui.kEms:case ui.kRems:case ui.kPixels:case ui.kDegrees:case ui.kRadians:case ui.kGradians:case ui.kMilliseconds:case ui.kSeconds:case ui.kTurns:var i=this.value,o=yi(this.unit);if(i<-999999||i>999999){var a=yi(this.unit);r=!Number.isFinite(i)||Number.isNaN(i)?function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return(Number.isFinite(t)?"NaN":t>0?"infinity":"-infinity")+e}(i,a):i+(a||"")}else r="".concat(i).concat(o)}return n+=r}}])}(bi),Ai=new Si(0,"px");new Si(1,"px");var Ni=new Si(0,"deg"),Ci=function(t){function e(t,n,r){var i,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,s=arguments.length>4&&void 0!==arguments[4]&&arguments[4];return(0,a.Z)(this,e),(i=(0,c.Z)(this,e,["rgb"])).r=t,i.g=n,i.b=r,i.alpha=o,i.isNone=s,i}return(0,u.Z)(e,t),(0,s.Z)(e,[{key:"clone",value:function(){return new e(this.r,this.g,this.b,this.alpha)}},{key:"buildCSSText",value:function(t,e,n){return"".concat(n,"rgba(").concat(this.r,",").concat(this.g,",").concat(this.b,",").concat(this.alpha,")")}}])}(xi),Oi=new ki("unset"),Ti={"":Oi,unset:Oi,initial:new ki("initial"),inherit:new ki("inherit")},Pi=new Ci(0,0,0,0,!0),Ri=new Ci(0,0,0,0),Di=ci((function(t,e,n,r){return new Ci(t,e,n,r)}),(function(t,e,n,r){return"rgba(".concat(t,",").concat(e,",").concat(n,",").concat(r,")")})),Li=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ui.kNumber;return new Si(t,e)};function Ii(t){var e=t.type,n=t.value;return"hex"===e?"#".concat(n):"literal"===e?n:"rgb"===e?"rgb(".concat(n.join(","),")"):"rgba(".concat(n.join(","),")")}new Si(50,"%");var Bi=function(){var t=/^(linear\-gradient)/i,e=/^(repeating\-linear\-gradient)/i,n=/^(radial\-gradient)/i,r=/^(repeating\-radial\-gradient)/i,i=/^(conic\-gradient)/i,o=/^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|left|right|top|bottom)/i,a=/^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,s=/^(left|center|right|top|bottom)/i,l=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,c=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,u=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,h=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,d=/^\(/,f=/^\)/,p=/^,/,g=/^\#([0-9a-fA-F]+)/,v=/^([a-zA-Z]+)/,m=/^rgb/i,y=/^rgba/i,b=/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/,x="";function E(t){throw new Error("".concat(x,": ").concat(t))}function w(){var t=R(k);return x.length>0&&E("Invalid input not EOF"),t}function k(){return M("linear-gradient",t,A)||M("repeating-linear-gradient",e,A)||M("radial-gradient",n,N)||M("repeating-radial-gradient",r,N)||M("conic-gradient",i,N)}function M(t,e,n){return S(e,(function(e){var r=n();return r&&(z(p)||E("Missing comma before color stops")),{type:t,orientation:r,colorStops:R(D)}}))}function S(t,e){var n=z(t);if(n){z(d)||E("Missing (");var r=e(n);return z(f)||E("Missing )"),r}}function A(){return j("directional",o,1)||j("angular",h,1)}function N(){var t,e,n=C();return n&&((t=[]).push(n),e=x,z(p)&&((n=C())?t.push(n):x=e)),t}function C(){var t=function(){var t=j("shape",/^(circle)/i,0);t&&(t.style=B()||O());return t}()||function(){var t=j("shape",/^(ellipse)/i,0);t&&(t.style=I()||O());return t}();if(t)t.at=T();else{var e=O();if(e){t=e;var n=T();n&&(t.at=n)}else{var r=P();r&&(t={type:"default-radial",at:r})}}return t}function O(){return j("extent-keyword",a,1)}function T(){if(j("position",/^at/,0)){var t=P();return t||E("Missing positioning value"),t}}function P(){var t={x:I(),y:I()};if(t.x||t.y)return{type:"position",value:t}}function R(t){var e=t(),n=[];if(e)for(n.push(e);z(p);)(e=t())?n.push(e):E("One extra comma");return n}function D(){var t=j("hex",g,1)||S(y,(function(){return{type:"rgba",value:R(L)}}))||S(m,(function(){return{type:"rgb",value:R(L)}}))||j("literal",v,0);return t||E("Expected color definition"),t.length=I(),t}function L(){return z(b)[1]}function I(){return j("%",c,1)||j("position-keyword",s,1)||B()}function B(){return j("px",l,1)||j("em",u,1)}function j(t,e,n){var r=z(e);if(r)return{type:t,value:r[n]}}function z(t){var e=/^[\n\r\t\s]+/.exec(x);e&&F(e[0].length);var n=t.exec(x);return n&&F(n[0].length),n}function F(t){x=x.substring(t)}return function(t){return x=t,w()}}();var ji=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,zi=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,Fi=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,_i=/[\d.]+:(#[^\s]+|[^\)]+\))/gi;var Zi={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},Gi=ci((function(t){var e;return e="angular"===t.type?Number(t.value):Zi[t.value]||0,Li(e,"deg")})),Vi=ci((function(t){var e=50,n=50,r="%",i="%";if("position"===(null==t?void 0:t.type)){var o=t.value,a=o.x,s=o.y;"position-keyword"===(null==a?void 0:a.type)&&("left"===a.value?e=0:"center"===a.value?e=50:"right"===a.value?e=100:"top"===a.value?n=0:"bottom"===a.value&&(n=100)),"position-keyword"===(null==s?void 0:s.type)&&("left"===s.value?e=0:"center"===s.value?n=50:"right"===s.value?e=100:"top"===s.value?n=0:"bottom"===s.value&&(n=100)),"px"!==(null==a?void 0:a.type)&&"%"!==(null==a?void 0:a.type)&&"em"!==(null==a?void 0:a.type)||(r=null==a?void 0:a.type,e=Number(a.value)),"px"!==(null==s?void 0:s.type)&&"%"!==(null==s?void 0:s.type)&&"em"!==(null==s?void 0:s.type)||(i=null==s?void 0:s.type,n=Number(s.value))}return{cx:Li(e,r),cy:Li(n,i)}})),Wi=ci((function(t){if(t.indexOf("linear")>-1||t.indexOf("radial")>-1)return Bi(t).map((function(t){var e=t.type,n=t.orientation,r=t.colorStops;!function(t){var e,n,r=t.length;t[r-1].length=null!==(e=t[r-1].length)&&void 0!==e?e:{type:"%",value:"100"},r>1&&(t[0].length=null!==(n=t[0].length)&&void 0!==n?n:{type:"%",value:"0"});for(var i=0,o=Number(t[0].length.value),a=1;a<r;a++){var s,l=null===(s=t[a].length)||void 0===s?void 0:s.value;if(!ae(l)&&!ae(o)){for(var c=1;c<a-i;c++)t[i+c].length={type:"%",value:"".concat(o+(Number(l)-o)*c/(a-i))};i=a,o=Number(l)}}}(r);var i,o=r.map((function(t){return{offset:Li(Number(t.length.value),"%"),color:Ii(t)}}));if("linear-gradient"===e)return new wi(Ei.LinearGradient,{angle:n?Gi(n):Ni,steps:o});if("radial-gradient"===e&&(n||(n=[{type:"shape",value:"circle"}]),"shape"===n[0].type&&"circle"===n[0].value)){var a,s=Vi(n[0].at),l=s.cx,c=s.cy;if(n[0].style){var u=n[0].style,h=u.type,d=u.value;"extent-keyword"===h?(Ti[i=d]||(Ti[i]=new ki(i)),a=Ti[i]):a=Li(d,h)}return new wi(Ei.RadialGradient,{cx:l,cy:c,size:a,steps:o})}}));var e=t[0];if("("===t[1]||"("===t[2])if("l"===e){var n=ji.exec(t);if(n){var r,i=(null===(r=n[2].match(_i))||void 0===r?void 0:r.map((function(t){return t.split(":")})))||[];return[new wi(Ei.LinearGradient,{angle:Li(parseFloat(n[1]),"deg"),steps:i.map((function(t){var e=(0,h.Z)(t,2),n=e[0],r=e[1];return{offset:Li(100*Number(n),"%"),color:r}}))})]}}else if("r"===e){var o=function(t){var e=zi.exec(t);if(e){var n,r=(null===(n=e[4].match(_i))||void 0===n?void 0:n.map((function(t){return t.split(":")})))||[];return{cx:Li(50,"%"),cy:Li(50,"%"),steps:r.map((function(t){var e=(0,h.Z)(t,2),n=e[0],r=e[1];return{offset:Li(100*Number(n),"%"),color:r}}))}}return null}(t);if(o){if(!se(o))return[new wi(Ei.RadialGradient,o)];t=o}}else if("p"===e)return function(t){var e=Fi.exec(t);if(e){var n=e[1],r=e[2];switch(n){case"a":n="repeat";break;case"x":n="repeat-x";break;case"y":n="repeat-y";break;default:n="no-repeat"}return{image:r,repetition:n}}return null}(t)}));function Hi(t){return t&&!!t.image}function Ui(t){return t&&!ae(t.r)&&!ae(t.g)&&!ae(t.b)}var Yi=ci((function(t){if(Hi(t))return(0,o.Z)({repetition:"repeat"},t);if(ae(t)&&(t=""),"transparent"===t)return Ri;if("currentColor"===t)t="black";else if("none"===t)return Pi;var e=Wi(t);if(e)return e;var n=Yr(t),r=[0,0,0,0];return null!==n&&(r[0]=n.r||0,r[1]=n.g||0,r[2]=n.b||0,r[3]=n.opacity),Di.apply(void 0,r)}));function qi(t,e){if(Ui(t)&&Ui(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(le(e[n],0,255));return e[3]=le(e[3],0,1),"rgba(".concat(e.join(","),")")}]}function Xi(t,e){if(ae(e))return Li(0,"px");if(e="".concat(e).trim().toLowerCase(),isFinite(Number(e))){if("px".search(t)>=0)return Li(Number(e),"px");if("deg".search(t)>=0)return Li(Number(e),"deg")}var n=[];e=e.replace(t,(function(t){return n.push(t),"U".concat(t)}));var r="U(".concat(t.source,")");return n.map((function(t){return Li(Number(e.replace(new RegExp("U".concat(t),"g"),"").replace(new RegExp(r,"g"),"*0")),t)}))[0]}var Ki=function(t){return Xi(new RegExp("px","g"),t)},Qi=ci(Ki);ci((function(t){return Xi(new RegExp("%","g"),t)}));var Ji=function(t){return ie(t)||isFinite(Number(t))?Li(Number(t)||0,"px"):Xi(new RegExp("px|%|em|rem","g"),t)},$i=ci(Ji),to=function(t){return Xi(new RegExp("deg|rad|grad|turn","g"),t)},eo=ci(to);function no(t,e,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,o="",a=t.value||0,s=e.value||0,l=Mi(t.unit),c=t.convertTo(l),u=e.convertTo(l);return c&&u?(a=c.value,s=u.value,o=yi(t.unit)):(Si.isLength(t.unit)||Si.isLength(e.unit))&&(a=oo(t,i,n),s=oo(e,i,n),o="px"),[a,s,function(t){return r&&(t=Math.max(t,0)),t+o}]}function ro(t){var e=0;return t.unit===ui.kDegrees?e=t.value:t.unit===ui.kRadians?e=ir(Number(t.value)):t.unit===ui.kTurns?e=360*Number(t.value):t.value&&(e=t.value),e}function io(t,e){var n;return Array.isArray(t)?n=t.map((function(t){return Number(t)})):se(t)?n=t.split(" ").map((function(t){return Number(t)})):ie(t)&&(n=[t]),2===e?1===n.length?[n[0],n[0]]:[n[0],n[1]]:4===e?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]]:"even"===e&&n.length%2==1?[].concat((0,l.Z)(n),(0,l.Z)(n)):n}function oo(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(t.unit===ui.kPixels)return Number(t.value);if(t.unit===ui.kPercentage&&n){var i=n.nodeName===Ln.GROUP?n.getLocalBounds():n.getGeometryBounds();return(r?i.min[e]:0)+t.value/100*i.halfExtents[e]*2}return 0}var ao=function(t){return Xi(/deg|rad|grad|turn|px|%/g,t)},so=["blur","brightness","drop-shadow","contrast","grayscale","sepia","saturate","hue-rotate","invert"];function lo(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";if("none"===(t=t.toLowerCase().trim()))return[];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,so.indexOf(e[1])>-1&&r.push({name:e[1],params:e[2].split(" ").map((function(t){return ao(t)||Yi(t)}))}),n.lastIndex===t.length)return r}return[]}function co(t){return t.toString()}var uo=function(t){return"number"==typeof t?Li(t):/^\s*[-+]?(\d*\.)?\d+\s*$/.test(t)?Li(Number(t)):Li(0)},ho=ci(uo);function fo(t,e){return[t,e,co]}function po(t,e){return function(n,r){return[n,r,function(n){return co(le(n,t,e))}]}}function go(t,e){if(t.length===e.length)return[t,e,function(t){return t}]}function vo(t){var e;return 0===t.parsedStyle.d.totalLength&&(t.parsedStyle.d.totalLength=Ie(t.parsedStyle.d.absolutePath,void 0,(0,ce.pi)((0,ce.pi)({},e),{bbox:!1,length:!0})).length),t.parsedStyle.d.totalLength}function mo(t){return 0===t.parsedStyle.points.totalLength&&(t.parsedStyle.points.totalLength=kn(t.parsedStyle.points.points)),t.parsedStyle.points.totalLength}function yo(t,e){return t[0]===e[0]&&t[1]===e[1]}function bo(t,e){var n=t.prePoint,r=t.currentPoint,i=t.nextPoint,o=Math.pow(r[0]-n[0],2)+Math.pow(r[1]-n[1],2),a=Math.pow(r[0]-i[0],2)+Math.pow(r[1]-i[1],2),s=Math.pow(n[0]-i[0],2)+Math.pow(n[1]-i[1],2),l=Math.acos((o+a-s)/(2*Math.sqrt(o)*Math.sqrt(a)));if(!l||0===Math.sin(l)||Fe(l,0))return{xExtra:0,yExtra:0};var c=Math.abs(Math.atan2(i[1]-r[1],i[0]-r[0])),u=Math.abs(Math.atan2(i[0]-r[0],i[1]-r[1]));return c=c>Math.PI/2?Math.PI-c:c,u=u>Math.PI/2?Math.PI-u:u,{xExtra:Math.cos(l/2-c)*(e/2*(1/Math.sin(l/2)))-e/2||0,yExtra:Math.cos(u-l/2)*(e/2*(1/Math.sin(l/2)))-e/2||0}}function xo(t,e){return[e[0]+(e[0]-t[0]),e[1]+(e[1]-t[1])]}ci((function(t){return se(t)?t.split(" ").map(ho):t.map(ho)}));var Eo=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)},wo=function(t,e,n,r,i,o,a,s){e=Math.abs(e),n=Math.abs(n);var l=nr(r=_e(r,360));if(t.x===a.x&&t.y===a.y)return{x:t.x,y:t.y,ellipticalArcAngle:0};if(0===e||0===n)return{x:0,y:0,ellipticalArcAngle:0};var c=(t.x-a.x)/2,u=(t.y-a.y)/2,h={x:Math.cos(l)*c+Math.sin(l)*u,y:-Math.sin(l)*c+Math.cos(l)*u},d=Math.pow(h.x,2)/Math.pow(e,2)+Math.pow(h.y,2)/Math.pow(n,2);d>1&&(e*=Math.sqrt(d),n*=Math.sqrt(d));var f=(Math.pow(e,2)*Math.pow(n,2)-Math.pow(e,2)*Math.pow(h.y,2)-Math.pow(n,2)*Math.pow(h.x,2))/(Math.pow(e,2)*Math.pow(h.y,2)+Math.pow(n,2)*Math.pow(h.x,2));f=f<0?0:f;var p=(i!==o?1:-1)*Math.sqrt(f),g=p*(e*h.y/n),v=p*(-n*h.x/e),m={x:Math.cos(l)*g-Math.sin(l)*v+(t.x+a.x)/2,y:Math.sin(l)*g+Math.cos(l)*v+(t.y+a.y)/2},y={x:(h.x-g)/e,y:(h.y-v)/n},b=Eo({x:1,y:0},y),x=Eo(y,{x:(-h.x-g)/e,y:(-h.y-v)/n});!o&&x>0?x-=2*Math.PI:o&&x<0&&(x+=2*Math.PI);var E=b+(x%=2*Math.PI)*s,w=e*Math.cos(E),k=n*Math.sin(E);return{x:Math.cos(l)*w-Math.sin(l)*k+m.x,y:Math.sin(l)*w+Math.cos(l)*k+m.y,ellipticalArcStartAngle:b,ellipticalArcEndAngle:b+x,ellipticalArcAngle:E,ellipticalArcCenter:m,resultantRx:e,resultantRy:n}};function ko(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=t.arcParams,i=r.rx,o=void 0===i?0:i,a=r.ry,s=void 0===a?0:a,l=r.xRotation,c=r.arcFlag,u=r.sweepFlag,h=wo({x:t.prePoint[0],y:t.prePoint[1]},o,s,l,!!c,!!u,{x:t.currentPoint[0],y:t.currentPoint[1]},e),d=wo({x:t.prePoint[0],y:t.prePoint[1]},o,s,l,!!c,!!u,{x:t.currentPoint[0],y:t.currentPoint[1]},n?e+.005:e-.005),f=d.x-h.x,p=d.y-h.y,g=Math.sqrt(f*f+p*p);return{x:-f/g,y:-p/g}}function Mo(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function So(t,e){return Mo(t)*Mo(e)?(t[0]*e[0]+t[1]*e[1])/(Mo(t)*Mo(e)):1}function Ao(t,e){return(t[0]*e[1]<t[1]*e[0]?-1:1)*Math.acos(So(t,e))}function No(t,e){var n=e[1],r=e[2],i=_e(nr(e[3]),2*Math.PI),o=e[4],a=e[5],s=t[0],l=t[1],c=e[6],u=e[7],h=Math.cos(i)*(s-c)/2+Math.sin(i)*(l-u)/2,d=-1*Math.sin(i)*(s-c)/2+Math.cos(i)*(l-u)/2,f=h*h/(n*n)+d*d/(r*r);f>1&&(n*=Math.sqrt(f),r*=Math.sqrt(f));var p=n*n*(d*d)+r*r*(h*h),g=p?Math.sqrt((n*n*(r*r)-p)/p):1;o===a&&(g*=-1),isNaN(g)&&(g=0);var v=r?g*n*d/r:0,m=n?g*-r*h/n:0,y=(s+c)/2+Math.cos(i)*v-Math.sin(i)*m,b=(l+u)/2+Math.sin(i)*v+Math.cos(i)*m,x=[(h-v)/n,(d-m)/r],E=[(-1*h-v)/n,(-1*d-m)/r],w=Ao([1,0],x),k=Ao(x,E);return So(x,E)<=-1&&(k=Math.PI),So(x,E)>=1&&(k=0),0===a&&k>0&&(k-=2*Math.PI),1===a&&k<0&&(k+=2*Math.PI),{cx:y,cy:b,rx:yo(t,[c,u])?0:n,ry:yo(t,[c,u])?0:r,startAngle:w,endAngle:w+k,xRotation:i,arcFlag:o,sweepFlag:a}}var Co=function(t){if(""===t||Array.isArray(t)&&0===t.length)return{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:{x:0,y:0,width:0,height:0}};var e;try{e=Se(t)}catch(n){e=Se(""),console.error("[g]: Invalid SVG Path definition: ".concat(t))}!function(t){for(var e=0;e<t.length;e++){var n=t[e-1],r=t[e];if("M"===r[0]&&n){var i=n[0],o=[r[1],r[2]],a=void 0;"L"===i||"M"===i?a=[n[1],n[2]]:"C"!==i&&"A"!==i&&"Q"!==i||(a=[n[n.length-2],n[n.length-1]]),a&&yo(o,a)&&(t.splice(e,1),e--)}}}(e);var n=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}(e),r=function(t){for(var e=[],n=[],r=[],i=0;i<t.length;i++){var o=t[i],a=o[0];"M"===a?(r.length&&(n.push(r),r=[]),r.push([o[1],o[2]])):"Z"===a?r.length&&(e.push(r),r=[]):r.push([o[1],o[2]])}return r.length>0&&n.push(r),{polygons:e,polylines:n}}(e),i=r.polygons,o=r.polylines,a=function(t){for(var e=[],n=null,r=null,i=null,o=0,a=t.length,s=0;s<a;s++){var l=t[s];r=t[s+1];var 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]],o=s;break;case"A":var h=No(n,l);u.arcParams=h}if("Z"===c)n=i,r=t[o+1];else{var d=l.length;n=[l[d-2],l[d-1]]}r&&"Z"===r[0]&&(r=t[o],e[o]&&(e[o].prePoint=n)),u.currentPoint=n,e[o]&&yo(n,e[o].currentPoint)&&(e[o].prePoint=u.prePoint);var f=r?[r[r.length-2],r[r.length-1]]:null;u.nextPoint=f;var p=u.prePoint;if(["L","H","V"].includes(c))u.startTangent=[p[0]-n[0],p[1]-n[1]],u.endTangent=[n[0]-p[0],n[1]-p[1]];else if("Q"===c){var g=[l[1],l[2]];u.startTangent=[p[0]-g[0],p[1]-g[1]],u.endTangent=[n[0]-g[0],n[1]-g[1]]}else if("T"===c){var v=e[s-1],m=xo(v.currentPoint,p);"Q"===v.command?(u.command="Q",u.startTangent=[p[0]-m[0],p[1]-m[1]],u.endTangent=[n[0]-m[0],n[1]-m[1]]):(u.command="TL",u.startTangent=[p[0]-n[0],p[1]-n[1]],u.endTangent=[n[0]-p[0],n[1]-p[1]])}else if("C"===c){var y=[l[1],l[2]],b=[l[3],l[4]];u.startTangent=[p[0]-y[0],p[1]-y[1]],u.endTangent=[n[0]-b[0],n[1]-b[1]],0===u.startTangent[0]&&0===u.startTangent[1]&&(u.startTangent=[y[0]-b[0],y[1]-b[1]]),0===u.endTangent[0]&&0===u.endTangent[1]&&(u.endTangent=[b[0]-y[0],b[1]-y[1]])}else if("S"===c){var x=e[s-1],E=xo(x.currentPoint,p),w=[l[1],l[2]];"C"===x.command?(u.command="C",u.startTangent=[p[0]-E[0],p[1]-E[1]],u.endTangent=[n[0]-w[0],n[1]-w[1]]):(u.command="SQ",u.startTangent=[p[0]-w[0],p[1]-w[1]],u.endTangent=[n[0]-w[0],n[1]-w[1]])}else if("A"===c){var k=ko(u,0),M=k.x,S=k.y,A=ko(u,1,!1),N=A.x,C=A.y;u.startTangent=[M,S],u.endTangent=[N,C]}e.push(u)}return e}(e),s=function(t,e){for(var n=[],r=[],i=[],o=0;o<t.length;o++){var a=t[o],s=a.currentPoint,l=a.params,c=a.prePoint,u=void 0;switch(a.command){case"Q":u=An(c[0],c[1],l[1],l[2],l[3],l[4]);break;case"C":u=En(c[0],c[1],l[1],l[2],l[3],l[4],l[5],l[6]);break;case"A":var h=a.arcParams;u=pn(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&&(a.box=u,n.push(u.x,u.x+u.width),r.push(u.y,u.y+u.height)),e&&("L"===a.command||"M"===a.command)&&a.prePoint&&a.nextPoint&&i.push(a)}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}));var d=je(n),f=je(r),p=ze(n),g=ze(r);if(0===i.length)return{x:d,y:f,width:p-d,height:g-f};for(var v=0;v<i.length;v++){var m=i[v],y=m.currentPoint;y[0]===d?d-=bo(m,e).xExtra:y[0]===p&&(p+=bo(m,e).xExtra),y[1]===f?f-=bo(m,e).yExtra:y[1]===g&&(g+=bo(m,e).yExtra)}return{x:d,y:f,width:p-d,height:g-f}}(a,0),l=s.x,c=s.y,u=s.width,h=s.height;return{absolutePath:e,hasArc:n,segments:a,polygons:i,polylines:o,totalLength:0,rect:{x:Number.isFinite(l)?l:0,y:Number.isFinite(c)?c:0,width:Number.isFinite(u)?u:0,height:Number.isFinite(h)?h:0}}},Oo=ci(Co);function To(t){return se(t)?Oo(t):Co(t)}function Po(t,e,n){var r=t.curve,i=e.curve;r&&0!==r.length||(r=Ue(t.absolutePath,!1),t.curve=r),i&&0!==i.length||(i=Ue(e.absolutePath,!1),e.curve=i);var o=[r,i];r.length!==i.length&&(o=qe(r,i));var a,s,l=Xe(o[0])!==Xe(o[1])?(a=o[0],s=a.slice(1).map((function(t,e,n){return e?n[e-1].slice(-2).concat(t.slice(1)):a[0].slice(1).concat(t.slice(1))})).map((function(t){return t.map((function(e,n){return t[t.length-n-2*(1-n%2)]}))})).reverse(),[["M"].concat(s[0].slice(0,2))].concat(s.map((function(t){return["C"].concat(t.slice(2))})))):o[0].map((function(t){return Array.isArray(t)?[].concat(t):t}));return[l,Ke(o[1],l),function(t){return t}]}function Ro(t,e){var n;return n=se(t)?t.split(" ").map((function(t){var e=t.split(","),n=(0,h.Z)(e,2),r=n[0],i=n[1];return[Number(r),Number(i)]})):t,{points:n,totalLength:0,segments:[]}}function Do(t,e){return[t.points,e.points,function(t){return t}]}var Lo=null,Io=/\s*(\w+)\(([^)]*)\)/g;function Bo(t){return function(e){var n=0;return t.map((function(t){return t===Lo?e[n++]:t}))}}function jo(t){return t}var zo={matrix:["NNNNNN",[Lo,Lo,0,0,Lo,Lo,0,0,0,0,1,0,Lo,Lo,0,1],jo],matrix3d:["NNNNNNNNNNNNNNNN",jo],rotate:["A"],rotateX:["A"],rotateY:["A"],rotateZ:["A"],rotate3d:["NNNA"],perspective:["L"],scale:["Nn",Bo([Lo,Lo,new Si(1)]),jo],scaleX:["N",Bo([Lo,new Si(1),new Si(1)]),Bo([Lo,new Si(1)])],scaleY:["N",Bo([new Si(1),Lo,new Si(1)]),Bo([new Si(1),Lo])],scaleZ:["N",Bo([new Si(1),new Si(1),Lo])],scale3d:["NNN",jo],skew:["Aa",null,jo],skewX:["A",null,Bo([Lo,Ni])],skewY:["A",null,Bo([Ni,Lo])],translate:["Tt",Bo([Lo,Lo,Ai]),jo],translateX:["T",Bo([Lo,Ai,Ai]),Bo([Lo,Ai])],translateY:["T",Bo([Ai,Lo,Ai]),Bo([Ai,Lo])],translateZ:["L",Bo([Ai,Ai,Lo])],translate3d:["TTL",jo]};function Fo(t){for(var e=[],n=t.length,r=0;r<n;r++){var i=t[r],o=i[0],a=i.slice(1);if("translate"===o||"skew"===o?1===a.length&&a.push(0):"scale"===o&&1===a.length&&a.push(a[0]),!zo[o])return[];var s=a.map((function(t){return Li(t)}));e.push({t:o,d:s})}return e}function _o(t){if(Array.isArray(t))return Fo(t);if("none"===(t=(t||"none").trim()))return[];var e,n=[],r=0;for(Io.lastIndex=0;e=Io.exec(t);){if(e.index!==r)return[];r=e.index+e[0].length;var i=e[1],o=zo[i];if(!o)return[];var a=e[2].split(","),s=o[0];if(s.length<a.length)return[];for(var l=[],c=0;c<s.length;c++){var u=a[c],h=s[c],d=void 0;if(void 0===(d=u?{A:function(t){return"0"===t.trim()?Ni:eo(t)},N:ho,T:$i,L:Qi}[h.toUpperCase()](u):{a:Ni,n:l[0],t:Ai}[h]))return[];l.push(d)}if(n.push({t:i,d:l}),Io.lastIndex===t.length)return n}return[]}function Zo(t){if(Array.isArray(t))return Fo(t);if("none"===(t=(t||"none").trim()))return[];var e,n=[],r=0;for(Io.lastIndex=0;e=Io.exec(t);){if(e.index!==r)return[];r=e.index+e[0].length;var i=e[1],o=zo[i];if(!o)return[];var a=e[2].split(","),s=o[0];if(s.length<a.length)return[];for(var l=[],c=0;c<s.length;c++){var u=a[c],h=s[c],d=void 0;if(void 0===(d=u?{A:function(t){return"0"===t.trim()?Ni:to(t)},N:uo,T:Ji,L:Ki}[h.toUpperCase()](u):{a:Ni,n:l[0],t:Ai}[h]))return[];l.push(d)}if(n.push({t:i,d:l}),Io.lastIndex===t.length)return n}return[]}function Go(t){var e,n,r,i;switch(t.t){case"rotateX":return i=nr(ro(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=nr(ro(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=nr(ro(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":e=t.d[0].value,n=t.d[1].value,r=t.d[2].value,i=nr(ro(t.d[3]));var o=e*e+n*n+r*r;if(0===o)e=1,n=0,r=0;else if(1!==o){var a=Math.sqrt(o);e/=a,n/=a,r/=a}var s=Math.sin(i/2),l=s*Math.cos(i/2),c=s*s;return[1-2*(n*n+r*r)*c,2*(e*n*c+r*l),2*(e*r*c-n*l),0,2*(e*n*c-r*l),1-2*(e*e+r*r)*c,2*(n*r*c+e*l),0,2*(e*r*c+n*l),2*(n*r*c-e*l),1-2*(e*e+n*n)*c,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":var u=nr(ro(t.d[0])),h=nr(ro(t.d[1]));return[1,Math.tan(h),0,0,Math.tan(u),1,0,0,0,0,1,0,0,0,0,1];case"skewX":return i=nr(ro(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=nr(ro(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=oo(t.d[0],0,null)||0,n=oo(t.d[1],0,null)||0,0,1];case"translateX":return[1,0,0,0,0,1,0,0,0,0,1,0,e=oo(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=oo(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=oo(t.d[0],0,null)||0,1];case"translate3d":return[1,0,0,0,0,1,0,0,0,0,1,0,e=oo(t.d[0],0,null)||0,n=oo(t.d[1],0,null)||0,r=oo(t.d[2],0,null)||0,1];case"perspective":var d=oo(t.d[0],0,null)||0;return[1,0,0,0,0,1,0,0,0,0,1,d?-1/d: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 Vo(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 Wo(t){var e=[0,0,0],n=[1,1,1],r=[0,0,0],i=[0,0,0,1],o=[0,0,0,1];return function(t,e,n,r,i,o){if(!function(t,e){var n=e[15];if(0===n)return!1;for(var r=1/n,i=0;i<16;i++)t[i]=e[i]*r;return!0}(cr,t))return!1;if(Z(ur,cr),ur[3]=0,ur[7]=0,ur[11]=0,ur[15]=1,Math.abs(q(ur))<1e-8)return!1;var a,s,l=cr[3],c=cr[7],u=cr[11],h=cr[12],d=cr[13],f=cr[14],p=cr[15];if(0!==l||0!==c||0!==u){if(hr[0]=l,hr[1]=c,hr[2]=u,hr[3]=p,!U(ur,ur))return!1;H(ur,ur),z(i,hr,ur)}else i[0]=i[1]=i[2]=0,i[3]=1;if(e[0]=h,e[1]=d,e[2]=f,s=cr,(a=dr)[0][0]=s[0],a[0][1]=s[1],a[0][2]=s[2],a[1][0]=s[4],a[1][1]=s[5],a[1][2]=s[6],a[2][0]=s[8],a[2][1]=s[9],a[2][2]=s[10],n[0]=m(dr[0]),S(dr[0],dr[0]),r[0]=A(dr[0],dr[1]),pr(dr[1],dr[1],dr[0],1,-r[0]),n[1]=m(dr[1]),S(dr[1],dr[1]),r[0]/=n[1],r[1]=A(dr[0],dr[2]),pr(dr[2],dr[2],dr[0],1,-r[1]),r[2]=A(dr[1],dr[2]),pr(dr[2],dr[2],dr[1],1,-r[2]),n[2]=m(dr[2]),S(dr[2],dr[2]),r[1]/=n[2],r[2]/=n[2],N(fr,dr[1],dr[2]),A(dr[0],fr)<0)for(var g=0;g<3;g++)n[g]*=-1,dr[g][0]*=-1,dr[g][1]*=-1,dr[g][2]*=-1;o[0]=.5*Math.sqrt(Math.max(1+dr[0][0]-dr[1][1]-dr[2][2],0)),o[1]=.5*Math.sqrt(Math.max(1-dr[0][0]+dr[1][1]-dr[2][2],0)),o[2]=.5*Math.sqrt(Math.max(1-dr[0][0]-dr[1][1]+dr[2][2],0)),o[3]=.5*Math.sqrt(Math.max(1+dr[0][0]+dr[1][1]+dr[2][2],0)),dr[2][1]>dr[1][2]&&(o[0]=-o[0]),dr[0][2]>dr[2][0]&&(o[1]=-o[1]),dr[1][0]>dr[0][1]&&(o[2]=-o[2])}(function(t){return 0===t.length?[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]:t.map(Go).reduce(Vo)}(t),e,n,r,i,o),[[e,n,r,o,i]]}var Ho=function(){function t(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 o=0;o<4;o++)n[r][i]+=e[r][o]*t[o][i];return n}return function(e,n,r,i,o){for(var a=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]],s=0;s<4;s++)a[s][3]=o[s];for(var l=0;l<3;l++)for(var c=0;c<3;c++)a[3][l]+=e[c]*a[c][l];var u=i[0],h=i[1],d=i[2],f=i[3],p=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];p[0][0]=1-2*(h*h+d*d),p[0][1]=2*(u*h-d*f),p[0][2]=2*(u*d+h*f),p[1][0]=2*(u*h+d*f),p[1][1]=1-2*(u*u+d*d),p[1][2]=2*(h*d-u*f),p[2][0]=2*(u*d-h*f),p[2][1]=2*(h*d+u*f),p[2][2]=1-2*(u*u+h*h),a=t(a,p);var g=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];r[2]&&(g[2][1]=r[2],a=t(a,g)),r[1]&&(g[2][1]=0,g[2][0]=r[0],a=t(a,g)),r[0]&&(g[2][0]=0,g[1][0]=r[0],a=t(a,g));for(var v=0;v<3;v++)for(var m=0;m<3;m++)a[v][m]*=n[v];return function(t){return 0===t[0][2]&&0===t[0][3]&&0===t[1][2]&&0===t[1][3]&&0===t[2][0]&&0===t[2][1]&&1===t[2][2]&&0===t[2][3]&&0===t[3][2]&&1===t[3][3]}(a)?[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 Uo(t){return t.toFixed(6).replace(".000000","")}function Yo(t,e){var n,r;return t.decompositionPair!==e&&(t.decompositionPair=e,n=Wo(t)),e.decompositionPair!==t&&(e.decompositionPair=t,r=Wo(e)),null===n[0]||null===r[0]?[[!1],[!0],function(n){return n?e[0].d:t[0].d}]:(n[0].push(0),r[0].push(1),[n,r,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);r=le(r,-1,1);var i=[];if(1===r)i=t;else for(var o=Math.acos(r),a=1*Math.sin(n*o)/Math.sqrt(1-r*r),s=0;s<4;s++)i.push(t[s]*(Math.cos(n*o)-r*a)+e[s]*a);return i}(n[0][3],r[0][3],t[5]);return Ho(t[0],t[1],t[2],e,t[4]).map(Uo).join(",")}])}function qo(t){return t.replace(/[XY]/,"")}function Xo(t){return t.replace(/(X|Y|Z|3d)?$/,"3d")}function Ko(t,e,n){var r=!1;if(!t.length||!e.length){t.length||(r=!0,t=e,e=[]);for(var i=function(){var n=t[o],r=n.t,i=n.d,a="scale"===r.substring(0,5)?1:0;e.push({t:r,d:i.map((function(t){return"number"==typeof t?Li(a):Li(a,t.unit)}))})},o=0;o<t.length;o++)i()}var a,s,l=[],c=[],u=[];if(t.length!==e.length){var h=Yo(t,e);l=[h[0]],c=[h[1]],u=[["matrix",[h[2]]]]}else for(var d=0;d<t.length;d++){var f=t[d].t,p=e[d].t,g=t[d].d,v=e[d].d,m=zo[f],y=zo[p],b=void 0;if(s=p,"perspective"===(a=f)&&"perspective"===s||!("matrix"!==a&&"matrix3d"!==a||"matrix"!==s&&"matrix3d"!==s)){var x=Yo([t[d]],[e[d]]);l.push(x[0]),c.push(x[1]),u.push(["matrix",[x[2]]])}else{if(f===p)b=f;else if(m[2]&&y[2]&&qo(f)===qo(p))b=qo(f),g=m[2](g),v=y[2](v);else{if(!m[1]||!y[1]||Xo(f)!==Xo(p)){var E=Yo(t,e);l=[E[0]],c=[E[1]],u=[["matrix",[E[2]]]];break}b=Xo(f),g=m[1](g),v=y[1](v)}for(var w=[],k=[],M=[],S=0;S<g.length;S++){var A=no(g[S],v[S],n,!1,S);w[S]=A[0],k[S]=A[1],M.push(A[2])}l.push(w),c.push(k),u.push([b,M])}}if(r){var N=l;l=c,c=N}return[l,c,function(t){return t.map((function(t,e){var n=t.map((function(t,n){return u[e][1][n](t)})).join(",");return"matrix"===u[e][0]&&16===n.split(",").length&&(u[e][0]="matrix3d"),"matrix3d"===u[e][0]&&6===n.split(",").length&&(u[e][0]="matrix"),"".concat(u[e][0],"(").concat(n,")")})).join(" ")}]}var Qo=ci((function(t){if(se(t)){if("text-anchor"===t)return[Li(0,"px"),Li(0,"px")];var e=t.split(" ");return 1===e.length&&("top"===e[0]||"bottom"===e[0]?(e[1]=e[0],e[0]="center"):e[1]="center"),2!==e.length?null:[$i(Jo(e[0])),$i(Jo(e[1]))]}return[Li(t[0]||0,"px"),Li(t[1]||0,"px")]}));function Jo(t){return"center"===t?"50%":"left"===t||"top"===t?"0%":"right"===t||"bottom"===t?"100%":t}var $o=[{n:"display",k:["none"]},{n:"opacity",int:!0,inh:!0,d:"1",syntax:Cr.OPACITY_VALUE},{n:"fillOpacity",int:!0,inh:!0,d:"1",syntax:Cr.OPACITY_VALUE},{n:"strokeOpacity",int:!0,inh:!0,d:"1",syntax:Cr.OPACITY_VALUE},{n:"fill",int:!0,k:["none"],d:"none",syntax:Cr.PAINT},{n:"fillRule",k:["nonzero","evenodd"],d:"nonzero"},{n:"stroke",int:!0,k:["none"],d:"none",syntax:Cr.PAINT,l:!0},{n:"shadowType",k:["inner","outer","both"],d:"outer",l:!0},{n:"shadowColor",int:!0,syntax:Cr.COLOR},{n:"shadowOffsetX",int:!0,l:!0,d:"0",syntax:Cr.LENGTH_PERCENTAGE},{n:"shadowOffsetY",int:!0,l:!0,d:"0",syntax:Cr.LENGTH_PERCENTAGE},{n:"shadowBlur",int:!0,l:!0,d:"0",syntax:Cr.SHADOW_BLUR},{n:"lineWidth",int:!0,inh:!0,d:"1",l:!0,a:["strokeWidth"],syntax:Cr.LENGTH_PERCENTAGE},{n:"increasedLineWidthForHitTesting",inh:!0,d:"0",l:!0,syntax:Cr.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:Cr.LENGTH_PERCENTAGE_12},{n:"lineDashOffset",int:!0,inh:!0,d:"0",a:["strokeDashoffset"],syntax:Cr.LENGTH_PERCENTAGE},{n:"offsetPath",syntax:Cr.DEFINED_PATH},{n:"offsetDistance",int:!0,syntax:Cr.OFFSET_DISTANCE},{n:"dx",int:!0,l:!0,d:"0",syntax:Cr.LENGTH_PERCENTAGE},{n:"dy",int:!0,l:!0,d:"0",syntax:Cr.LENGTH_PERCENTAGE},{n:"zIndex",ind:!0,int:!0,d:"0",k:["auto"],syntax:Cr.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:Cr.FILTER},{n:"clipPath",syntax:Cr.DEFINED_PATH},{n:"textPath",syntax:Cr.DEFINED_PATH},{n:"textPathSide",k:["left","right"],d:"left"},{n:"textPathStartOffset",l:!0,d:"0",syntax:Cr.LENGTH_PERCENTAGE},{n:"transform",p:100,int:!0,k:["none"],d:"none",syntax:Cr.TRANSFORM},{n:"transformOrigin",p:100,d:"0 0",l:!0,syntax:Cr.TRANSFORM_ORIGIN},{n:"cx",int:!0,l:!0,d:"0",syntax:Cr.COORDINATE},{n:"cy",int:!0,l:!0,d:"0",syntax:Cr.COORDINATE},{n:"cz",int:!0,l:!0,d:"0",syntax:Cr.COORDINATE},{n:"r",int:!0,l:!0,d:"0",syntax:Cr.LENGTH_PERCENTAGE},{n:"rx",int:!0,l:!0,d:"0",syntax:Cr.LENGTH_PERCENTAGE},{n:"ry",int:!0,l:!0,d:"0",syntax:Cr.LENGTH_PERCENTAGE},{n:"x",int:!0,l:!0,d:"0",syntax:Cr.COORDINATE},{n:"y",int:!0,l:!0,d:"0",syntax:Cr.COORDINATE},{n:"z",int:!0,l:!0,d:"0",syntax:Cr.COORDINATE},{n:"width",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:Cr.LENGTH_PERCENTAGE},{n:"height",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:Cr.LENGTH_PERCENTAGE},{n:"radius",int:!0,l:!0,d:"0",syntax:Cr.LENGTH_PERCENTAGE_14},{n:"x1",int:!0,l:!0,syntax:Cr.COORDINATE},{n:"y1",int:!0,l:!0,syntax:Cr.COORDINATE},{n:"z1",int:!0,l:!0,syntax:Cr.COORDINATE},{n:"x2",int:!0,l:!0,syntax:Cr.COORDINATE},{n:"y2",int:!0,l:!0,syntax:Cr.COORDINATE},{n:"z2",int:!0,l:!0,syntax:Cr.COORDINATE},{n:"d",int:!0,l:!0,d:"",syntax:Cr.PATH,p:50},{n:"points",int:!0,l:!0,syntax:Cr.LIST_OF_POINTS,p:50},{n:"text",l:!0,d:"",syntax:Cr.TEXT,p:50},{n:"textTransform",l:!0,inh:!0,k:["capitalize","uppercase","lowercase","none"],d:"none",syntax:Cr.TEXT_TRANSFORM,p:51},{n:"font",l:!0},{n:"fontSize",int:!0,inh:!0,d:"16px",l:!0,syntax:Cr.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:Cr.LENGTH,int:!0,d:"0"},{n:"letterSpacing",l:!0,syntax:Cr.LENGTH,int:!0,d:"0"},{n:"miterLimit",l:!0,syntax:Cr.NUMBER,d:function(t){return t===Ln.PATH||t===Ln.POLYGON||t===Ln.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:Cr.MARKER},{n:"markerEnd",syntax:Cr.MARKER},{n:"markerMid",syntax:Cr.MARKER},{n:"markerStartOffset",syntax:Cr.LENGTH,l:!0,int:!0,d:"0"},{n:"markerEndOffset",syntax:Cr.LENGTH,l:!0,int:!0,d:"0"}],ta=new Set($o.filter((function(t){return!!t.l})).map((function(t){return t.n}))),ea={},na=function(){return(0,s.Z)((function t(e){var n=this;(0,a.Z)(this,t),this.runtime=e,$o.forEach((function(t){n.registerMetadata(t)}))}),[{key:"registerMetadata",value:function(t){[t.n].concat((0,l.Z)(t.a||[])).forEach((function(e){ea[e]=t}))}},{key:"getPropertySyntax",value:function(t){return this.runtime.CSSPropertySyntaxFactory[t]}},{key:"processProperties",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{skipUpdateAttribute:!1,skipParse:!1,forceUpdateGeometry:!1,usedAttributes:[],memoize:!0};Object.assign(t.attributes,e);var r=t.parsedStyle.clipPath,i=t.parsedStyle.offsetPath;ra(t,e);var a=!!n.forceUpdateGeometry;if(!a)for(var s in e)if(ta.has(s)){a=!0;break}var l=ia(t);l.has("fill")&&e.fill&&(t.parsedStyle.fill=Yi(e.fill)),l.has("stroke")&&e.stroke&&(t.parsedStyle.stroke=Yi(e.stroke)),l.has("shadowColor")&&e.shadowColor&&(t.parsedStyle.shadowColor=Yi(e.shadowColor)),l.has("filter")&&e.filter&&(t.parsedStyle.filter=lo(e.filter)),l.has("radius")&&!ae(e.radius)&&(t.parsedStyle.radius=io(e.radius,4)),l.has("lineDash")&&!ae(e.lineDash)&&(t.parsedStyle.lineDash=io(e.lineDash,"even")),l.has("points")&&e.points&&(t.parsedStyle.points=Ro(e.points)),l.has("d")&&""===e.d&&(t.parsedStyle.d=(0,o.Z)({},Nr)),l.has("d")&&e.d&&(t.parsedStyle.d=To(e.d)),l.has("textTransform")&&e.textTransform&&this.runtime.CSSPropertySyntaxFactory[Cr.TEXT_TRANSFORM].calculator(null,null,{value:e.textTransform},t,null),l.has("clipPath")&&!Qe(e.clipPath)&&this.runtime.CSSPropertySyntaxFactory[Cr.DEFINED_PATH].calculator("clipPath",r,e.clipPath,t,this.runtime),l.has("offsetPath")&&e.offsetPath&&this.runtime.CSSPropertySyntaxFactory[Cr.DEFINED_PATH].calculator("offsetPath",i,e.offsetPath,t,this.runtime),l.has("transform")&&e.transform&&(t.parsedStyle.transform=_o(e.transform)),l.has("transformOrigin")&&e.transformOrigin&&(t.parsedStyle.transformOrigin=Qo(e.transformOrigin)),l.has("markerStart")&&e.markerStart&&(t.parsedStyle.markerStart=this.runtime.CSSPropertySyntaxFactory[Cr.MARKER].calculator(null,e.markerStart,e.markerStart,null,null)),l.has("markerEnd")&&e.markerEnd&&(t.parsedStyle.markerEnd=this.runtime.CSSPropertySyntaxFactory[Cr.MARKER].calculator(null,e.markerEnd,e.markerEnd,null,null)),l.has("markerMid")&&e.markerMid&&(t.parsedStyle.markerMid=this.runtime.CSSPropertySyntaxFactory[Cr.MARKER].calculator("",e.markerMid,e.markerMid,null,null)),l.has("zIndex")&&!ae(e.zIndex)&&this.runtime.CSSPropertySyntaxFactory[Cr.Z_INDEX].postProcessor(t),l.has("offsetDistance")&&!ae(e.offsetDistance)&&this.runtime.CSSPropertySyntaxFactory[Cr.OFFSET_DISTANCE].postProcessor(t),l.has("transform")&&e.transform&&this.runtime.CSSPropertySyntaxFactory[Cr.TRANSFORM].postProcessor(t),l.has("transformOrigin")&&e.transformOrigin&&this.runtime.CSSPropertySyntaxFactory[Cr.TRANSFORM_ORIGIN].postProcessor(t),a&&(t.geometry.dirty=!0,t.dirty(!0,!0),n.forceUpdateGeometry||this.runtime.sceneGraphService.dirtyToRoot(t))}},{key:"updateGeometry",value:function(t){var e=t.nodeName,n=this.runtime.geometryUpdaterFactory[e];if(n){var r=t.geometry;r.contentBounds||(r.contentBounds=new Wn),r.renderBounds||(r.renderBounds=new Wn);var i=t.parsedStyle,o=n.update(i,t),a=o.cx,s=void 0===a?0:a,l=o.cy,c=void 0===l?0:l,u=o.cz,h=void 0===u?0:u,d=o.hwidth,f=void 0===d?0:d,p=o.hheight,g=void 0===p?0:p,v=o.hdepth,m=void 0===v?0:v,y=[Math.abs(f),Math.abs(g),m],b=i.stroke,x=i.lineWidth,w=void 0===x?1:x,k=i.increasedLineWidthForHitTesting,M=void 0===k?0:k,S=i.shadowType,A=void 0===S?"outer":S,N=i.shadowColor,C=i.filter,O=void 0===C?[]:C,T=i.transformOrigin,P=[s,c,h];r.contentBounds.update(P,y);var R=e===Ln.POLYLINE||e===Ln.POLYGON||e===Ln.PATH?Math.SQRT2:.5;if(b&&!b.isNone){var D=((w||0)+(M||0))*R;y[0]+=D,y[1]+=D}if(r.renderBounds.update(P,y),N&&A&&"inner"!==A){var L=r.renderBounds,I=L.min,B=L.max,j=i.shadowBlur||0,z=i.shadowOffsetX||0,F=i.shadowOffsetY||0,_=I[0]-j+z,Z=B[0]+j+z,G=I[1]-j+F,V=B[1]+j+F;I[0]=Math.min(I[0],_),B[0]=Math.max(B[0],Z),I[1]=Math.min(I[1],G),B[1]=Math.max(B[1],V),r.renderBounds.setMinMax(I,B)}O.forEach((function(t){var e=t.name,n=t.params;if("blur"===e){var i=n[0].value;r.renderBounds.update(r.renderBounds.center,E(r.renderBounds.halfExtents,r.renderBounds.halfExtents,[i,i,0]))}else if("drop-shadow"===e){var o=n[0].value,a=n[1].value,s=n[2].value,l=r.renderBounds,c=l.min,u=l.max,h=c[0]-s+o,d=u[0]+s+o,f=c[1]-s+a,p=u[1]+s+a;c[0]=Math.min(c[0],h),u[0]=Math.max(u[0],d),c[1]=Math.min(c[1],f),u[1]=Math.max(u[1],p),r.renderBounds.setMinMax(c,u)}})),t.geometry.dirty=!1;var W=g<0,H=(f<0?-1:1)*(T?oo(T[0],0,t,!0):0),U=(W?-1:1)*(T?oo(T[1],1,t,!0):0);(H||U)&&t.setOrigin(H,U)}}},{key:"updateSizeAttenuation",value:function(t,e){t.style.isSizeAttenuation?(t.style.rawLineWidth||(t.style.rawLineWidth=t.style.lineWidth),t.style.lineWidth=(t.style.rawLineWidth||1)/e,t.nodeName===Ln.CIRCLE&&(t.style.rawR||(t.style.rawR=t.style.r),t.style.r=(t.style.rawR||1)/e)):(t.style.rawLineWidth&&(t.style.lineWidth=t.style.rawLineWidth,delete t.style.rawLineWidth),t.nodeName===Ln.CIRCLE&&t.style.rawR&&(t.style.r=t.style.rawR,delete t.style.rawR))}}])}();function ra(t,e){var n=ia(t);for(var r in e)n.has(r)&&(t.parsedStyle[r]=e[r])}function ia(t){return t.constructor.PARSED_STYLE_LIST}var oa=function(){return(0,s.Z)((function t(){(0,a.Z)(this,t),this.mixer=fo}),[{key:"calculator",value:function(t,e,n,r){return ro(n)}}])}(),aa=function(){return(0,s.Z)((function t(){(0,a.Z)(this,t)}),[{key:"calculator",value:function(t,e,n,r,i){return n instanceof ki&&(n=null),i.sceneGraphService.updateDisplayObjectDependency(t,e,n,r),"clipPath"===t&&r.forEach((function(t){0===t.childNodes.length&&i.sceneGraphService.dirtyToRoot(t)})),n}}])}(),sa=function(){return(0,s.Z)((function t(){(0,a.Z)(this,t),this.parser=Yi,this.mixer=qi}),[{key:"calculator",value:function(t,e,n,r){return n instanceof ki?"none"===n.value?Pi:Ri:n}}])}(),la=function(){return(0,s.Z)((function t(){(0,a.Z)(this,t)}),[{key:"calculator",value:function(t,e,n){return n instanceof ki?[]:n}}])}();function ca(t){var e=t.parsedStyle.fontSize;return ae(e)?null:e}var ua=function(){return(0,s.Z)((function t(){(0,a.Z)(this,t),this.mixer=fo}),[{key:"calculator",value:function(t,e,n,r,i){if(ie(n))return n;if(!Si.isRelativeUnit(n.unit))return n.value;if(n.unit===ui.kPercentage)return 0;if(n.unit===ui.kEms){if(r.parentNode){var o=ca(r.parentNode);if(o)return o*=n.value}return 0}if(n.unit===ui.kRems){var a;if(null!=r&&null!==(a=r.ownerDocument)&&void 0!==a&&a.documentElement){var s=ca(r.ownerDocument.documentElement);if(s)return s*=n.value}return 0}}}])}(),ha=function(){return(0,s.Z)((function t(){(0,a.Z)(this,t),this.mixer=go}),[{key:"calculator",value:function(t,e,n){return n.map((function(t){return t.value}))}}])}(),da=function(){return(0,s.Z)((function t(){(0,a.Z)(this,t),this.mixer=go}),[{key:"calculator",value:function(t,e,n){return n.map((function(t){return t.value}))}}])}(),fa=function(){return(0,s.Z)((function t(){(0,a.Z)(this,t)}),[{key:"calculator",value:function(t,e,n,r){var i;n instanceof ki&&(n=null);var o=null===(i=n)||void 0===i?void 0:i.cloneNode(!0);return o&&(o.style.isMarker=!0),o}}])}(),pa=function(){return(0,s.Z)((function t(){(0,a.Z)(this,t),this.mixer=fo}),[{key:"calculator",value:function(t,e,n){return n.value}}])}(),ga=function(){return(0,s.Z)((function t(){(0,a.Z)(this,t),this.mixer=po(0,1)}),[{key:"calculator",value:function(t,e,n){return n.value}},{key:"postProcessor",value:function(t){var e=t.parsedStyle,n=e.offsetPath,r=e.offsetDistance;if(n){var i=n.nodeName;if(i===Ln.LINE||i===Ln.PATH||i===Ln.POLYLINE){var o=n.getPoint(r);o&&t.setLocalPosition(o.x,o.y)}}}}])}(),va=function(){return(0,s.Z)((function t(){(0,a.Z)(this,t),this.mixer=po(0,1)}),[{key:"calculator",value:function(t,e,n){return n.value}}])}(),ma=function(){return(0,s.Z)((function t(){(0,a.Z)(this,t),this.parser=To,this.mixer=Po}),[{key:"calculator",value:function(t,e,n){return n instanceof ki&&"unset"===n.value?{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new Xn(0,0,0,0)}:n}}])}(),ya=(0,s.Z)((function t(){(0,a.Z)(this,t),this.mixer=Do})),ba=function(t){function e(){var t;(0,a.Z)(this,e);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=(0,c.Z)(this,e,[].concat(r))).mixer=po(0,1/0),t}return(0,u.Z)(e,t),(0,s.Z)(e)}(ua),xa=function(){return(0,s.Z)((function t(){(0,a.Z)(this,t)}),[{key:"calculator",value:function(t,e,n,r){return n instanceof ki?"unset"===n.value?"":n.value:"".concat(n)}},{key:"postProcessor",value:function(t){t.nodeValue="".concat(t.parsedStyle.text)||""}}])}(),Ea=function(){return(0,s.Z)((function t(){(0,a.Z)(this,t)}),[{key:"calculator",value:function(t,e,n,r){var i=r.getAttribute("text");if(i){var o=i;"capitalize"===n.value?o=i.charAt(0).toUpperCase()+i.slice(1):"lowercase"===n.value?o=i.toLowerCase():"uppercase"===n.value&&(o=i.toUpperCase()),r.parsedStyle.text=o}return n.value}}])}(),wa=new WeakMap;var ka="undefined"!=typeof window&&void 0!==window.document;function Ma(t){return!!t.getAttribute}function Sa(t,e){var n=Number(t.parsedStyle.zIndex||0),r=Number(e.parsedStyle.zIndex||0);if(n===r){var i=t.parentNode;if(i){var o=i.childNodes||[];return o.indexOf(t)-o.indexOf(e)}}return n-r}function Aa(t){var e=t;do{var n;if(null===(n=e.parsedStyle)||void 0===n?void 0:n.clipPath)return e;e=e.parentElement}while(null!==e);return null}function Na(t,e){if(ka)return document.defaultView.getComputedStyle(t,null).getPropertyValue(e)}var Ca={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"},Oa="object"==typeof performance&&performance.now?performance:Date;function Ta(t){return t.nodeName===Ln.FRAGMENT||t.getRootNode().nodeName===Ln.FRAGMENT}function Pa(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"auto",e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,r=!1,i=!1,o=!!e&&!e.isNone,a=!!n&&!n.isNone;return"visiblepainted"===t||"painted"===t||"auto"===t?(r=o,i=a):"visiblefill"===t||"fill"===t?r=!0:"visiblestroke"===t||"stroke"===t?i=!0:"visible"!==t&&"all"!==t||(r=!0,i=!0),[r,i]}var Ra=1,Da="object"==typeof self&&self.self===self?self:"object"==typeof n.g&&n.g.global===n.g?n.g:{},La=Date.now(),Ia={},Ba=Date.now(),ja=function(t){if("function"!=typeof t)throw new TypeError("".concat(t," is not a function"));var e=Date.now(),n=e-Ba,r=n>16?0:16-n,i=Ra++;return Ia[i]=t,Object.keys(Ia).length>1||setTimeout((function(){Ba=e;var t=Ia;Ia={},Object.keys(t).forEach((function(e){return t[e](Da.performance&&"function"==typeof Da.performance.now?Da.performance.now():Date.now()-La)}))}),r),i},za=function(t){delete Ia[t]},Fa=function(t){return"string"!=typeof t?ja:""===t?Da.requestAnimationFrame:Da["".concat(t,"RequestAnimationFrame")]},_a=function(t,e){for(var n=0;void 0!==t[n];){if(e(t[n]))return t[n];n+=1}}(["","webkit","moz","ms","o"],(function(t){return!!Fa(t)})),Za=Fa(_a),Ga=function(t){return"string"!=typeof t?za:""===t?Da.cancelAnimationFrame:Da["".concat(t,"CancelAnimationFrame")]||Da["".concat(t,"CancelRequestAnimationFrame")]}(_a);Da.requestAnimationFrame=Za,Da.cancelAnimationFrame=Ga;var Va=function(){return(0,s.Z)((function t(){(0,a.Z)(this,t),this.callbacks=[]}),[{key:"getCallbacksNum",value:function(){return this.callbacks.length}},{key:"tapPromise",value:function(t,e){this.callbacks.push(e)}},{key:"promise",value: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)})))}}])}(),Wa=function(){return(0,s.Z)((function t(){(0,a.Z)(this,t),this.callbacks=[]}),[{key:"tapPromise",value:function(t,e){this.callbacks.push(e)}},{key:"promise",value:(t=(0,On.Z)((0,Cn.Z)().mark((function t(){var e,n,r,i,o=arguments;return(0,Cn.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.callbacks.length){t.next=6;break}return t.next=1,(e=this.callbacks)[0].apply(e,o);case 1:n=t.sent,r=0;case 2:if(!(r<this.callbacks.length-1)){t.next=5;break}return i=this.callbacks[r],t.next=3,i(n);case 3:n=t.sent;case 4:r++,t.next=2;break;case 5:return t.abrupt("return",n);case 6:return t.abrupt("return",null);case 7:case"end":return t.stop()}}),t,this)}))),function(){return t.apply(this,arguments)})}]);var t}(),Ha=function(){return(0,s.Z)((function t(){(0,a.Z)(this,t),this.callbacks=[]}),[{key:"tap",value:function(t,e){this.callbacks.push(e)}},{key:"call",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var r=arguments;this.callbacks.forEach((function(t){t.apply(void 0,r)}))}}])}(),Ua=function(){return(0,s.Z)((function t(){(0,a.Z)(this,t),this.callbacks=[]}),[{key:"tap",value:function(t,e){this.callbacks.push(e)}},{key:"call",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];if(this.callbacks.length){for(var r=arguments,i=this.callbacks[0].apply(void 0,r),o=0;o<this.callbacks.length-1;o++){var a=this.callbacks[o];i=a(i)}return i}return null}}])}(),Ya=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],qa=/([\"\'])[^\'\"]+\1/;function Xa(t){var e=t.fontSize,n=void 0===e?16:e,r=t.fontFamily,i=void 0===r?"sans-serif":r,o=t.fontStyle,a=void 0===o?"normal":o,s=t.fontVariant,l=void 0===s?"normal":s,c=t.fontWeight;return{fontSize:n,fontFamily:i,fontStyle:a,fontVariant:l,fontWeight:void 0===c?"normal":c}}var Ka=ci((function(t){for(var e=Xa(t),n=e.fontSize,r=e.fontFamily,i=e.fontStyle,o=e.fontVariant,a=e.fontWeight,s=ie(n)&&"".concat(n,"px")||"16px",l=r.split(","),c=l.length-1;c>=0;c--){var u=l[c].trim();!qa.test(u)&&Ya.indexOf(u)<0&&(u='"'.concat(u,'"')),l[c]=u}return"".concat(i," ").concat(o," ").concat(a," ").concat(s," ").concat(l.join(","))}),(function(t){var e=Xa(t),n=e.fontSize,r=e.fontFamily,i=e.fontStyle,o=e.fontVariant,a=e.fontWeight;return"".concat(i,"_").concat(o,"_").concat(a,"_").concat(n,"_").concat(r)})),Qa=function(t){return Math.max(t,1e-6)};function Ja(t,e,n){return W(t),t[4]=Math.tan(e),t[1]=Math.tan(n),t}var $a=F(),ts=F(),es={scale:function(t){rt($a,[t[0].value,t[1].value,1].map((function(t){return Qa(t)})))},scaleX:function(t){rt($a,[t[0].value,1,1].map((function(t){return Qa(t)})))},scaleY:function(t){rt($a,[1,t[0].value,1].map((function(t){return Qa(t)})))},scaleZ:function(t){rt($a,[1,1,t[0].value].map((function(t){return Qa(t)})))},scale3d:function(t){rt($a,[t[0].value,t[1].value,t[2].value].map((function(t){return Qa(t)})))},translate:function(t){nt($a,[t[0].value,t[1].value,0])},translateX:function(t){nt($a,[t[0].value,0,0])},translateY:function(t){nt($a,[0,t[0].value,0])},translateZ:function(t){nt($a,[0,0,t[0].value])},translate3d:function(t){nt($a,[t[0].value,t[1].value,t[2].value])},rotate:function(t){st($a,nr(ro(t[0])))},rotateX:function(t){ot($a,nr(ro(t[0])))},rotateY:function(t){at($a,nr(ro(t[0])))},rotateZ:function(t){st($a,nr(ro(t[0])))},rotate3d:function(t){it($a,nr(ro(t[3])),[t[0].value,t[1].value,t[2].value])},skew:function(t){Ja($a,nr(t[0].value),nr(t[1].value))},skewX:function(t){Ja($a,nr(t[0].value),0)},skewY:function(t){Ja($a,0,nr(t[0].value))},matrix:function(t){V($a,t[0].value,t[1].value,0,0,t[2].value,t[3].value,0,0,0,0,1,0,t[4].value,t[5].value,0,1)},matrix3d:function(t){V.apply(r,[$a].concat((0,l.Z)(t.map((function(t){return t.value})))))}},ns=y(1,1,1),rs=g(),is={translate:function(t,e){ll.sceneGraphService.setLocalScale(t,ns,!1),ll.sceneGraphService.setLocalEulerAngles(t,rs,void 0,void 0,!1),ll.sceneGraphService.setLocalPosition(t,[e[0].value,e[1].value,0],!1),ll.sceneGraphService.dirtyLocalTransform(t,t.transformable)}};function os(t,e){if(t.length){if(1===t.length&&is[t[0].t])return void is[t[0].t](e,t[0].d);for(var n=W(ts),r=0;r<t.length;r++){var i=t[r],o=i.t,a=i.d,s=es[o];s&&(s(a),It(n,n,$a))}e.setLocalTransform(n)}else e.resetLocalTransform();return e.getLocalTransform()}var as=function(){return(0,s.Z)((function t(){(0,a.Z)(this,t),this.parser=Zo,this.mixer=Ko}),[{key:"calculator",value:function(t,e,n,r){return n instanceof ki?[]:n}},{key:"postProcessor",value:function(t){os(t.parsedStyle.transform,t)}}])}(),ss=function(){return(0,s.Z)((function t(){(0,a.Z)(this,t)}),[{key:"postProcessor",value:function(t){var e=t.parsedStyle.transformOrigin;e[0].unit===ui.kPixels&&e[1].unit===ui.kPixels?t.setOrigin(e[0].value,e[1].value):t.getGeometryBounds()}}])}(),ls=function(){return(0,s.Z)((function t(){(0,a.Z)(this,t)}),[{key:"calculator",value:function(t,e,n,r){return n.value}},{key:"postProcessor",value:function(t){if(t.parentNode){var e=t.parentNode,n=e.renderable,r=e.sortable;n&&e.dirty(),r&&(r.dirty=!0,r.dirtyReason=wr.Z_INDEX_CHANGED)}}}])}(),cs=function(){return(0,s.Z)((function t(){(0,a.Z)(this,t)}),[{key:"update",value:function(t,e){var n=t.cx,r=void 0===n?0:n,i=t.cy,o=void 0===i?0:i,a=t.r,s=void 0===a?0:a;return{cx:r,cy:o,hwidth:s,hheight:s}}}])}(),us=function(){return(0,s.Z)((function t(){(0,a.Z)(this,t)}),[{key:"update",value:function(t,e){var n=t.cx,r=void 0===n?0:n,i=t.cy,o=void 0===i?0:i,a=t.rx,s=void 0===a?0:a,l=t.ry;return{cx:r,cy:o,hwidth:s,hheight:void 0===l?0:l}}}])}(),hs=function(){return(0,s.Z)((function t(){(0,a.Z)(this,t)}),[{key:"update",value:function(t){var e=t.x1,n=t.y1,r=t.x2,i=t.y2,o=Math.min(e,r),a=Math.max(e,r),s=Math.min(n,i),l=(a-o)/2,c=(Math.max(n,i)-s)/2;return{cx:o+l,cy:s+c,hwidth:l,hheight:c}}}])}(),ds=function(){return(0,s.Z)((function t(){(0,a.Z)(this,t)}),[{key:"update",value:function(t){var e=t.d.rect,n=e.x,r=e.y,i=e.width/2,o=e.height/2;return{cx:n+i,cy:r+o,hwidth:i,hheight:o}}}])}(),fs=function(){return(0,s.Z)((function t(){(0,a.Z)(this,t)}),[{key:"update",value:function(t){if(t.points&&Be(t.points.points)){var e=t.points.points,n=Math.min.apply(Math,(0,l.Z)(e.map((function(t){return t[0]})))),r=Math.max.apply(Math,(0,l.Z)(e.map((function(t){return t[0]})))),i=Math.min.apply(Math,(0,l.Z)(e.map((function(t){return t[1]})))),o=Math.max.apply(Math,(0,l.Z)(e.map((function(t){return t[1]})))),a=(r-n)/2,s=(o-i)/2;return{cx:n+a,cy:i+s,hwidth:a,hheight:s}}return{cx:0,cy:0,hwidth:0,hheight:0}}}])}(),ps=function(){return(0,s.Z)((function t(){(0,a.Z)(this,t)}),[{key:"update",value:function(t,e){var n=t.x,r=void 0===n?0:n,i=t.y,o=void 0===i?0:i,a=t.src,s=t.width,l=void 0===s?0:s,c=t.height,u=l,h=void 0===c?0:c;return a&&!se(a)&&(u||(u=a.width,t.width=u),h||(h=a.height,t.height=h)),{cx:r+u/2,cy:o+h/2,hwidth:u/2,hheight:h/2}}}])}(),gs=function(){return(0,s.Z)((function t(e){(0,a.Z)(this,t),this.globalRuntime=e}),[{key:"isReadyToMeasure",value:function(t,e){return t.text}},{key:"update",value:function(t,e){var n,r=t.text,i=t.textAlign,o=void 0===i?"start":i,a=t.lineWidth,s=void 0===a?1:a,l=t.textBaseline,c=void 0===l?"alphabetic":l,u=t.dx,h=void 0===u?0:u,d=t.dy,f=void 0===d?0:d,p=t.x,g=void 0===p?0:p,v=t.y,m=void 0===v?0:v;if(!this.isReadyToMeasure(t,e))return t.metrics={font:"",width:0,height:0,lines:[],lineWidths:[],lineHeight:0,maxLineWidth:0,fontProperties:{ascent:0,descent:0,fontSize:0},lineMetrics:[]},{hwidth:0,hheight:0,cx:0,cy:0};var y=((null==e||null===(n=e.ownerDocument)||void 0===n||null===(n=n.defaultView)||void 0===n?void 0:n.getConfig())||{}).offscreenCanvas,b=this.globalRuntime.textService.measureText(r,t,y);t.metrics=b;var x=b.width/2,E=b.height/2,w=g+x;"center"===o||"middle"===o?w+=s/2-x:"right"!==o&&"end"!==o||(w+=s-2*x);var k=m-E;return"middle"===c?k+=E:"top"===c||"hanging"===c?k+=2*E:"alphabetic"===c||"bottom"!==c&&"ideographic"!==c||(k+=0),h&&(w+=h),f&&(k+=f),{cx:w,cy:k,hwidth:x,hheight:E}}}])}(),vs=function(){return(0,s.Z)((function t(){(0,a.Z)(this,t)}),[{key:"update",value:function(t,e){return{cx:0,cy:0,hwidth:0,hheight:0}}}])}(),ms=function(){return(0,s.Z)((function t(){(0,a.Z)(this,t)}),[{key:"update",value:function(t,e){var n=t.x,r=void 0===n?0:n,i=t.y,o=void 0===i?0:i,a=t.width,s=void 0===a?0:a,l=t.height,c=void 0===l?0:l;return{cx:r+s/2,cy:o+c/2,hwidth:s/2,hheight:c/2}}}])}();var ys=function(){return(0,s.Z)((function t(e){(0,a.Z)(this,t),this.eventPhase=t.prototype.NONE,this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.defaultPrevented=!1,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new qn,this.page=new qn,this.canvas=new qn,this.viewport=new qn,this.composed=!1,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=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:"composedPath",value:function(){return!this.manager||this.path&&this.path[0]===this.target||(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path}},{key:"propagationPath",get:function(){return this.composedPath()}},{key:"preventDefault",value:function(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0}},{key:"stopImmediatePropagation",value:function(){this.propagationImmediatelyStopped=!0}},{key:"stopPropagation",value:function(){this.propagationStopped=!0}},{key:"initEvent",value:function(){}},{key:"initUIEvent",value:function(){}},{key:"clone",value:function(){throw new Error(Kn)}}])}(),bs=function(t){function e(){var t;(0,a.Z)(this,e);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=(0,c.Z)(this,e,[].concat(r))).client=new qn,t.movement=new qn,t.offset=new qn,t.global=new qn,t.screen=new qn,t}return(0,u.Z)(e,t),(0,s.Z)(e,[{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}},{key:"getModifierState",value:function(t){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(t)}},{key:"initMouseEvent",value:function(){throw new Error(Kn)}}])}(ys),xs=function(t){function e(){var t;(0,a.Z)(this,e);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=(0,c.Z)(this,e,[].concat(r))).width=0,t.height=0,t.isPrimary=!1,t}return(0,u.Z)(e,t),(0,s.Z)(e,[{key:"getCoalescedEvents",value:function(){return"pointermove"===this.type||"mousemove"===this.type||"touchmove"===this.type?[this]:[]}},{key:"getPredictedEvents",value:function(){throw new Error("getPredictedEvents is not supported!")}},{key:"clone",value:function(){return this.manager.clonePointerEvent(this)}}])}(bs),Es=function(t){function e(){return(0,a.Z)(this,e),(0,c.Z)(this,e,arguments)}return(0,u.Z)(e,t),(0,s.Z)(e,[{key:"clone",value:function(){return this.manager.cloneWheelEvent(this)}}])}(bs),ws=function(t){function e(t,n){var r;return(0,a.Z)(this,e),(r=(0,c.Z)(this,e,[null])).type=t,r.detail=n,Object.assign(r,n),r}return(0,u.Z)(e,t),(0,s.Z)(e)}(ys),ks=function(){return(0,s.Z)((function t(){(0,a.Z)(this,t),this.emitter=new d}),[{key:"on",value:function(t,e,n){return this.addEventListener(t,e,n),this}},{key:"addEventListener",value:function(t,e,n){var r=!1,i=!1;if(tn(n))r=n;else if(n){var o=n.capture;r=void 0!==o&&o;var a=n.once;i=void 0!==a&&a}r&&(t+="capture"),e=en(e)?e:e.handleEvent;var s=en(e)?void 0:e;return i?this.emitter.once(t,e,s):this.emitter.on(t,e,s),this}},{key:"off",value:function(t,e,n){return t?this.removeEventListener(t,e,n):this.removeAllEventListeners(),this}},{key:"removeAllEventListeners",value:function(){var t;null===(t=this.emitter)||void 0===t||t.removeAllListeners()}},{key:"removeEventListener",value:function(t,e,n){var r;if(!this.emitter)return this;(tn(n)?n:null==n?void 0:n.capture)&&(t+="capture"),e=en(e)?e:null===(r=e)||void 0===r?void 0:r.handleEvent;var i=en(e)?void 0:e;return this.emitter.off(t,e,i),this}},{key:"emit",value:function(t,e){this.dispatchEvent(new ws(t,e))}},{key:"dispatchEventToSelf",value:function(t){t.target||(t.target=this),t.currentTarget=this,this.emitter.emit(t.type,t)}},{key:"dispatchEvent",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2?arguments[2]:void 0;if(r)return this.dispatchEventToSelf(t),!0;if(this.document)e=this;else if(this.defaultView)e=this.defaultView;else{var i;e=null===(i=this.ownerDocument)||void 0===i?void 0:i.defaultView}if(e){if(t.manager=e.getEventService(),!t.manager)return!1;t.defaultPrevented=!1,t.path?t.path.length=0:t.page=[],n||(t.target=this),t.manager.dispatchEvent(t,t.type,n)}else this.dispatchEventToSelf(t);return!t.defaultPrevented}}])}(),Ms=function(t){function e(){var t;(0,a.Z)(this,e);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=(0,c.Z)(this,e,[].concat(r))).shadow=!1,t.ownerDocument=null,t.isConnected=!1,t.baseURI="",t.childNodes=[],t.nodeType=0,t.nodeName="",t.nodeValue=null,t.parentNode=null,t.destroyed=!1,t}return(0,u.Z)(e,t),(0,s.Z)(e,[{key:"textContent",get:function(){var t="";this.nodeName===Ln.TEXT&&(t+=this.style.text);var e,n=(0,Tn.Z)(this.childNodes);try{for(n.s();!(e=n.n()).done;){var r=e.value;r.nodeName===Ln.TEXT?t+=r.nodeValue:t+=r.textContent}}catch(t){n.e(t)}finally{n.f()}return t},set:function(t){var e=this;this.childNodes.slice().forEach((function(t){e.removeChild(t)})),this.nodeName===Ln.TEXT&&(this.style.text="".concat(t))}},{key:"getRootNode",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.parentNode?this.parentNode.getRootNode(t):t.composed&&this.host?this.host.getRootNode(t):this}},{key:"hasChildNodes",value:function(){return this.childNodes.length>0}},{key:"isDefaultNamespace",value:function(t){throw new Error(Kn)}},{key:"lookupNamespaceURI",value:function(t){throw new Error(Kn)}},{key:"lookupPrefix",value:function(t){throw new Error(Kn)}},{key:"normalize",value:function(){throw new Error(Kn)}},{key:"isEqualNode",value:function(t){return this===t}},{key:"isSameNode",value:function(t){return this.isEqualNode(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 this.childNodes.length>0?this.childNodes[0]:null}},{key:"lastChild",get:function(){return this.childNodes.length>0?this.childNodes[this.childNodes.length-1]:null}},{key:"compareDocumentPosition",value:function(t){if(t===this)return 0;for(var n=t,r=this,i=[n],o=[r];null!==(a=n.parentNode)&&void 0!==a?a:r.parentNode;){var a;n=n.parentNode?(i.push(n.parentNode),n.parentNode):n,r=r.parentNode?(o.push(r.parentNode),r.parentNode):r}if(n!==r)return e.DOCUMENT_POSITION_DISCONNECTED|e.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC|e.DOCUMENT_POSITION_PRECEDING;var s=i.length>o.length?i:o,l=s===i?o:i;if(s[s.length-l.length]===l[0])return s===i?e.DOCUMENT_POSITION_CONTAINED_BY|e.DOCUMENT_POSITION_FOLLOWING:e.DOCUMENT_POSITION_CONTAINS|e.DOCUMENT_POSITION_PRECEDING;for(var c=s.length-l.length,u=l.length-1;u>=0;u--){var h=l[u],d=s[c+u];if(d!==h){var f=h.parentNode.childNodes;return f.indexOf(h)<f.indexOf(d)?l===i?e.DOCUMENT_POSITION_PRECEDING:e.DOCUMENT_POSITION_FOLLOWING:s===i?e.DOCUMENT_POSITION_PRECEDING:e.DOCUMENT_POSITION_FOLLOWING}}return e.DOCUMENT_POSITION_FOLLOWING}},{key:"contain",value:function(t){return this.contains(t)}},{key:"contains",value:function(t){for(var e=t;e&&this!==e;)e=e.parentNode;return!!e}},{key:"getAncestor",value:function(t){for(var e=this;t>0&&e;)e=e.parentNode,t--;return e}},{key:"forEach",value:function(t){for(var e=[this];e.length>0;){var n=e.pop();if(!1===t(n))break;for(var r=n.childNodes.length-1;r>=0;r--)e.push(n.childNodes[r])}}}],[{key:"isNode",value:function(t){return!!t.childNodes}}])}(ks);Ms.DOCUMENT_POSITION_DISCONNECTED=1,Ms.DOCUMENT_POSITION_PRECEDING=2,Ms.DOCUMENT_POSITION_FOLLOWING=4,Ms.DOCUMENT_POSITION_CONTAINS=8,Ms.DOCUMENT_POSITION_CONTAINED_BY=16,Ms.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC=32;var Ss=function(){return(0,s.Z)((function t(e,n){var r=this;(0,a.Z)(this,t),this.nativeHTMLMap=new WeakMap,this.cursor="default",this.mappingTable={},this.mappingState={trackingData:{}},this.eventPool=new Map,this.tmpMatrix=F(),this.tmpVec3=g(),this.onPointerDown=function(t){var e=r.createPointerEvent(t);if(r.dispatchEvent(e,"pointerdown"),"touch"===e.pointerType)r.dispatchEvent(e,"touchstart");else if("mouse"===e.pointerType||"pen"===e.pointerType){var n=2===e.button;r.dispatchEvent(e,n?"rightdown":"mousedown")}r.trackingData(t.pointerId).pressTargetsByButton[t.button]=e.composedPath(),r.freeEvent(e)},this.onPointerUp=function(t){var e=Oa.now(),n=r.createPointerEvent(t,void 0,void 0,r.context.config.alwaysTriggerPointerEventOnCanvas?r.rootTarget:void 0);if(r.dispatchEvent(n,"pointerup"),"touch"===n.pointerType)r.dispatchEvent(n,"touchend");else if("mouse"===n.pointerType||"pen"===n.pointerType){var i=2===n.button;r.dispatchEvent(n,i?"rightup":"mouseup")}var o=r.trackingData(t.pointerId),a=r.findMountedTarget(o.pressTargetsByButton[t.button]),s=a;if(a&&!n.composedPath().includes(a)){for(var l=a;l&&!n.composedPath().includes(l);){if(n.currentTarget=l,r.notifyTarget(n,"pointerupoutside"),"touch"===n.pointerType)r.notifyTarget(n,"touchendoutside");else if("mouse"===n.pointerType||"pen"===n.pointerType){var c=2===n.button;r.notifyTarget(n,c?"rightupoutside":"mouseupoutside")}Ms.isNode(l)&&(l=l.parentNode)}delete o.pressTargetsByButton[t.button],s=l}if(s){var u,h=r.clonePointerEvent(n,"click");h.target=s,h.path=[],o.clicksByButton[t.button]||(o.clicksByButton[t.button]={clickCount:0,target:h.target,timeStamp:e});var d=r.context.renderingContext.root.ownerDocument.defaultView,f=o.clicksByButton[t.button];f.target===h.target&&e-f.timeStamp<d.getConfig().dblClickSpeed?++f.clickCount:f.clickCount=1,f.target=h.target,f.timeStamp=e,h.detail=f.clickCount,null!==(u=n.detail)&&void 0!==u&&u.preventClick||(r.context.config.useNativeClickEvent||"mouse"!==h.pointerType&&"touch"!==h.pointerType||r.dispatchEvent(h,"click"),r.dispatchEvent(h,"pointertap")),r.freeEvent(h)}r.freeEvent(n)},this.onPointerMove=function(t){var e=r.createPointerEvent(t,void 0,void 0,r.context.config.alwaysTriggerPointerEventOnCanvas?r.rootTarget:void 0),n="mouse"===e.pointerType||"pen"===e.pointerType,i=r.trackingData(t.pointerId),o=r.findMountedTarget(i.overTargets);if(i.overTargets&&o!==e.target){var a="mousemove"===t.type?"mouseout":"pointerout",s=r.createPointerEvent(t,a,o||void 0);if(r.dispatchEvent(s,"pointerout"),n&&r.dispatchEvent(s,"mouseout"),!e.composedPath().includes(o)){var l=r.createPointerEvent(t,"pointerleave",o||void 0);for(l.eventPhase=l.AT_TARGET;l.target&&!e.composedPath().includes(l.target);)l.currentTarget=l.target,r.notifyTarget(l),n&&r.notifyTarget(l,"mouseleave"),Ms.isNode(l.target)&&(l.target=l.target.parentNode);r.freeEvent(l)}r.freeEvent(s)}if(o!==e.target){var c="mousemove"===t.type?"mouseover":"pointerover",u=r.clonePointerEvent(e,c);r.dispatchEvent(u,"pointerover"),n&&r.dispatchEvent(u,"mouseover");for(var h=o&&Ms.isNode(o)&&o.parentNode;h&&h!==(Ms.isNode(r.rootTarget)&&r.rootTarget.parentNode)&&h!==e.target;)h=h.parentNode;if(!h||h===(Ms.isNode(r.rootTarget)&&r.rootTarget.parentNode)){var d=r.clonePointerEvent(e,"pointerenter");for(d.eventPhase=d.AT_TARGET;d.target&&d.target!==o&&d.target!==(Ms.isNode(r.rootTarget)&&r.rootTarget.parentNode);)d.currentTarget=d.target,r.notifyTarget(d),n&&r.notifyTarget(d,"mouseenter"),Ms.isNode(d.target)&&(d.target=d.target.parentNode);r.freeEvent(d)}r.freeEvent(u)}r.dispatchEvent(e,"pointermove"),"touch"===e.pointerType&&r.dispatchEvent(e,"touchmove"),n&&(r.dispatchEvent(e,"mousemove"),r.cursor=r.getCursor(e.target)),i.overTargets=e.composedPath(),r.freeEvent(e)},this.onPointerOut=function(t){var e=r.trackingData(t.pointerId);if(e.overTargets){var n="mouse"===t.pointerType||"pen"===t.pointerType,i=r.findMountedTarget(e.overTargets),o=r.createPointerEvent(t,"pointerout",i||void 0);r.dispatchEvent(o),n&&r.dispatchEvent(o,"mouseout");var a=r.createPointerEvent(t,"pointerleave",i||void 0);for(a.eventPhase=a.AT_TARGET;a.target&&a.target!==(Ms.isNode(r.rootTarget)&&r.rootTarget.parentNode);)a.currentTarget=a.target,r.notifyTarget(a),n&&r.notifyTarget(a,"mouseleave"),Ms.isNode(a.target)&&(a.target=a.target.parentNode);e.overTargets=null,r.freeEvent(o),r.freeEvent(a)}r.cursor=null},this.onPointerOver=function(t){var e=r.trackingData(t.pointerId),n=r.createPointerEvent(t),i="mouse"===n.pointerType||"pen"===n.pointerType;r.dispatchEvent(n,"pointerover"),i&&r.dispatchEvent(n,"mouseover"),"mouse"===n.pointerType&&(r.cursor=r.getCursor(n.target));var o=r.clonePointerEvent(n,"pointerenter");for(o.eventPhase=o.AT_TARGET;o.target&&o.target!==(Ms.isNode(r.rootTarget)&&r.rootTarget.parentNode);)o.currentTarget=o.target,r.notifyTarget(o),i&&r.notifyTarget(o,"mouseenter"),Ms.isNode(o.target)&&(o.target=o.target.parentNode);e.overTargets=n.composedPath(),r.freeEvent(n),r.freeEvent(o)},this.onPointerUpOutside=function(t){var e=r.trackingData(t.pointerId),n=r.findMountedTarget(e.pressTargetsByButton[t.button]),i=r.createPointerEvent(t);if(n){for(var o=n;o;)i.currentTarget=o,r.notifyTarget(i,"pointerupoutside"),"touch"===i.pointerType||"mouse"!==i.pointerType&&"pen"!==i.pointerType||r.notifyTarget(i,2===i.button?"rightupoutside":"mouseupoutside"),Ms.isNode(o)&&(o=o.parentNode);delete e.pressTargetsByButton[t.button]}r.freeEvent(i)},this.onWheel=function(t){var e=r.createWheelEvent(t);r.dispatchEvent(e),r.freeEvent(e)},this.onClick=function(t){if(r.context.config.useNativeClickEvent){var e=r.createPointerEvent(t);r.dispatchEvent(e),r.freeEvent(e)}},this.onPointerCancel=function(t){var e=r.createPointerEvent(t,void 0,void 0,r.context.config.alwaysTriggerPointerEventOnCanvas?r.rootTarget:void 0);r.dispatchEvent(e),r.freeEvent(e)},this.globalRuntime=e,this.context=n}),[{key:"init",value: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)}},{key:"destroy",value:function(){this.mappingTable={},this.mappingState={},this.eventPool.clear()}},{key:"getScale",value:function(){var t=this.context.contextService.getBoundingClientRect(),e=1,n=1,r=this.context.contextService.getDomElement();if(r&&t){var i=r.offsetWidth,o=r.offsetHeight;i&&o&&(e=t.width/i,n=t.height/o)}return{scaleX:e,scaleY:n,bbox:t}}},{key:"client2Viewport",value:function(t){var e=this.getScale(),n=e.scaleX,r=e.scaleY,i=e.bbox;return new qn((t.x-((null==i?void 0:i.left)||0))/n,(t.y-((null==i?void 0:i.top)||0))/r)}},{key:"viewport2Client",value:function(t){var e=this.getScale(),n=e.scaleX,r=e.scaleY,i=e.bbox;return new qn((t.x+((null==i?void 0:i.left)||0))*n,(t.y+((null==i?void 0:i.top)||0))*r)}},{key:"viewport2Canvas",value:function(t){var e=t.x,n=t.y,r=this.rootTarget.defaultView.getCamera(),i=this.context.config,o=i.width,a=i.height,s=r.getPerspectiveInverse(),l=r.getWorldTransform(),c=X(this.tmpMatrix,l,s),u=x(this.tmpVec3,e/o*2-1,2*(1-n/a)-1,0);return O(u,u,c),new qn(u[0],u[1])}},{key:"canvas2Viewport",value:function(t){var e=this.rootTarget.defaultView.getCamera(),n=e.getPerspective(),r=e.getViewTransform(),i=X(this.tmpMatrix,n,r),o=x(this.tmpVec3,t.x,t.y,0);O(this.tmpVec3,this.tmpVec3,i);var a=this.context.config,s=a.width,l=a.height;return new qn((o[0]+1)/2*s,(1-(o[1]+1)/2)*l)}},{key:"setPickHandler",value:function(t){this.pickHandler=t}},{key:"addEventMapping",value: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}))}},{key:"mapEvent",value: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))}}},{key:"dispatchEvent",value:function(t,e,n){if(n){t.eventPhase=t.AT_TARGET;var r=this.rootTarget.defaultView||null;t.currentTarget=r,this.notifyListeners(t,e)}else t.propagationStopped=!1,t.propagationImmediatelyStopped=!1,this.propagate(t,e)}},{key:"propagate",value:function(t,e){if(t.target){var n=t.composedPath();t.eventPhase=t.CAPTURING_PHASE;for(var r=n.length-1;r>=1;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 o=i+1;o<n.length;o++)if(t.currentTarget=n[o],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return}}}},{key:"propagationPath",value:function(t){var e=[t],n=this.rootTarget.defaultView||null;if(n&&n===t)return e.unshift(n.document),e;for(var r=0;r<2048&&t!==this.rootTarget;r++)Ms.isNode(t)&&t.parentNode&&(e.push(t.parentNode),t=t.parentNode);return n&&e.push(n),e}},{key:"hitTest",value:function(t){var e=t.viewportX,n=t.viewportY,r=this.context.config,i=r.width,o=r.height,a=r.disableHitTesting;return e<0||n<0||e>i||n>o?null:!a&&this.pickHandler(t)||this.rootTarget||null}},{key:"isNativeEventFromCanvas",value:function(t,e){var n,r=null==e?void 0:e.target;if(null!==(n=r)&&void 0!==n&&n.shadowRoot&&(r=e.composedPath()[0]),r){if(r===t)return!0;if(t&&t.contains)return t.contains(r)}return!(null==e||!e.composedPath)&&e.composedPath().indexOf(t)>-1}},{key:"getExistedHTML",value:function(t){if(t.nativeEvent.composedPath)for(var e=0,n=t.nativeEvent.composedPath();e<n.length;e++){var r=n[e],i=this.nativeHTMLMap.get(r);if(i)return i}return null}},{key:"pickTarget",value:function(t){return this.hitTest({clientX:t.clientX,clientY:t.clientY,viewportX:t.viewportX,viewportY:t.viewportY,x:t.canvasX,y:t.canvasY})}},{key:"createPointerEvent",value:function(t,e,n,r){var i=this.allocateEvent(xs);this.copyPointerData(t,i),this.copyMouseData(t,i),this.copyData(t,i),i.nativeEvent=t.nativeEvent,i.originalEvent=t;var o=this.getExistedHTML(i),a=this.context.contextService.getDomElement();return i.target=null!=n?n:o||this.isNativeEventFromCanvas(a,i.nativeEvent)&&this.pickTarget(i)||r,"string"==typeof e&&(i.type=e),i}},{key:"createWheelEvent",value:function(t){var e=this.allocateEvent(Es);this.copyWheelData(t,e),this.copyMouseData(t,e),this.copyData(t,e),e.nativeEvent=t.nativeEvent,e.originalEvent=t;var n=this.getExistedHTML(e),r=this.context.contextService.getDomElement();return e.target=n||this.isNativeEventFromCanvas(r,e.nativeEvent)&&this.pickTarget(e),e}},{key:"trackingData",value:function(t){return this.mappingState.trackingData[t]||(this.mappingState.trackingData[t]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[t]}},{key:"cloneWheelEvent",value: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}},{key:"clonePointerEvent",value:function(t,e){var n=this.allocateEvent(xs);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}},{key:"copyPointerData",value: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}},{key:"copyMouseData",value: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)}},{key:"copyWheelData",value:function(t,e){e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ}},{key:"copyData",value:function(t,e){e.isTrusted=t.isTrusted,e.timeStamp=Oa.now(),e.type=t.type,e.detail=t.detail,e.view=t.view,e.page.copyFrom(t.page),e.viewport.copyFrom(t.viewport)}},{key:"allocateEvent",value:function(t){this.eventPool.has(t)||this.eventPool.set(t,[]);var e=this.eventPool.get(t).pop()||new t(this);return e.eventPhase=e.NONE,e.currentTarget=null,e.path=[],e.target=null,e}},{key:"freeEvent",value: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)}},{key:"notifyTarget",value: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)}},{key:"notifyListeners",value: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)}},{key:"findMountedTarget",value:function(t){if(!t)return null;for(var e=t[t.length-1],n=t.length-2;n>=0;n--){var r=t[n];if(!(r===this.rootTarget||Ms.isNode(r)&&r.parentNode===e))break;e=t[n]}return e}},{key:"getCursor",value:function(t){for(var e=t;e;){var n=Ma(e)&&e.getAttribute("cursor");if(n)return n;e=Ms.isNode(e)&&e.parentNode}}}])}(),As=function(){return(0,s.Z)((function t(){(0,a.Z)(this,t)}),[{key:"getOrCreateCanvas",value:function(t,e){if(this.canvas)return this.canvas;if(t||ll.offscreenCanvas)this.canvas=t||ll.offscreenCanvas,this.context=this.canvas.getContext("2d",(0,o.Z)({willReadFrequently:!0},e));else try{this.canvas=new window.OffscreenCanvas(0,0),this.context=this.canvas.getContext("2d",(0,o.Z)({willReadFrequently:!0},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",(0,o.Z)({willReadFrequently:!0},e))}return this.canvas.width=10,this.canvas.height=10,this.canvas}},{key:"getOrCreateContext",value:function(t,e){return this.context||this.getOrCreateCanvas(t,e),this.context}}],[{key:"createCanvas",value:function(){try{return new window.OffscreenCanvas(0,0)}catch(t){}try{return document.createElement("canvas")}catch(t){}return null}}])}(),Ns=function(t){return t[t.CAMERA_CHANGED=0]="CAMERA_CHANGED",t[t.DISPLAY_OBJECT_CHANGED=1]="DISPLAY_OBJECT_CHANGED",t[t.NONE=2]="NONE",t}({}),Cs=function(){return(0,s.Z)((function t(e,n){(0,a.Z)(this,t),this.inited=!1,this.stats={total:0,rendered:0},this.zIndexCounter=0,this.hooks={init:new Ha,initAsync:new Va,dirtycheck:new Ua,cull:new Ua,beginFrame:new Ha,beforeRender:new Ha,render:new Ha,afterRender:new Ha,endFrame:new Ha,destroy:new Ha,pick:new Wa,pickSync:new Ua,pointerDown:new Ha,pointerUp:new Ha,pointerMove:new Ha,pointerOut:new Ha,pointerOver:new Ha,pointerWheel:new Ha,pointerCancel:new Ha,click:new Ha},this.globalRuntime=e,this.context=n}),[{key:"init",value:function(t){var e=this,n=(0,o.Z)((0,o.Z)({},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()})).catch((function(t){}))}},{key:"getStats",value:function(){return this.stats}},{key:"disableDirtyRectangleRendering",value:function(){return!this.context.config.renderer.getConfig().enableDirtyRectangleRendering||this.context.renderingContext.renderReasons.has(Ns.CAMERA_CHANGED)}},{key:"render",value:function(t,e,n){var r=this;this.stats.total=0,this.stats.rendered=0,this.zIndexCounter=0;var i=this.context.renderingContext;if(this.globalRuntime.sceneGraphService.syncHierarchy(i.root),this.globalRuntime.sceneGraphService.triggerPendingEvents(),i.renderReasons.size&&this.inited){i.dirtyRectangleRenderingDisabled=this.disableDirtyRectangleRendering();var o=1===i.renderReasons.size&&i.renderReasons.has(Ns.CAMERA_CHANGED),a=!t.disableRenderHooks||!o;a&&this.renderDisplayObject(i.root,t,i),this.hooks.beginFrame.call(e),a&&i.renderListCurrentFrame.forEach((function(t){r.hooks.beforeRender.call(t),r.hooks.render.call(t),r.hooks.afterRender.call(t)})),this.hooks.endFrame.call(e),i.renderListCurrentFrame=[],i.renderReasons.clear(),n()}}},{key:"renderDisplayObject",value:function(t,e,n){var r=this,i=e.renderer.getConfig(),o=i.enableDirtyCheck,a=i.enableCulling;for(var s,l,c,u,h,d=[t];d.length>0;){var f,p=d.pop();l=void 0,c=void 0,u=void 0,h=void 0,l=(s=p).renderable,c=s.sortable,u=o?l.dirty||n.dirtyRectangleRenderingDisabled?s:null:s,h=null,u&&(h=a?r.hooks.cull.call(u,r.context.camera):u)&&(r.stats.rendered+=1,n.renderListCurrentFrame.push(h)),s.dirty(!1),c.renderOrder=r.zIndexCounter,r.zIndexCounter+=1,r.stats.total+=1,c.dirty&&(r.sort(s,c),c.dirty=!1,c.dirtyChildren=[],c.dirtyReason=void 0);for(var g=(null===(f=p.sortable)||void 0===f||null===(f=f.sorted)||void 0===f?void 0:f.length)>0?p.sortable.sorted:p.childNodes,v=g.length-1;v>=0;v--)d.push(g[v])}}},{key:"sort",value:function(t,e){var n,r;(null==e||null===(n=e.sorted)||void 0===n?void 0:n.length)>0&&e.dirtyReason!==wr.Z_INDEX_CHANGED?e.dirtyChildren.forEach((function(n){var r=e.sorted.indexOf(n);if(r>-1&&e.sorted.splice(r,1),t.childNodes.indexOf(n)>-1)if(0===e.sorted.length)e.sorted.push(n);else{var i=function(t,e){for(var n=0,r=t.length;n<r;){var i=n+r>>>1;Sa(t[i],e)<0?n=i+1:r=i}return n}(e.sorted,n);e.sorted.splice(i,0,n)}})):e.sorted=t.childNodes.slice().sort(Sa),(null===(r=e.sorted)||void 0===r?void 0:r.length)>0&&0===t.childNodes.filter((function(t){return t.parsedStyle.zIndex})).length&&(e.sorted=[])}},{key:"destroy",value:function(){this.inited=!1,this.hooks.destroy.call(),this.globalRuntime.sceneGraphService.clearPendingEvents()}},{key:"dirtify",value:function(){this.context.renderingContext.renderReasons.add(Ns.DISPLAY_OBJECT_CHANGED)}}])}(),Os=/\[\s*(.*)=(.*)\s*\]/,Ts=function(){return(0,s.Z)((function t(){(0,a.Z)(this,t)}),[{key:"selectOne",value:function(t,e){var n=this;if(t.startsWith("."))return e.find((function(e){return((null==e?void 0:e.classList)||[]).indexOf(n.getIdOrClassname(t))>-1}));if(t.startsWith("#"))return e.find((function(e){return e.id===n.getIdOrClassname(t)}));if(t.startsWith("[")){var r=this.getAttribute(t),i=r.name,o=r.value;return i?e.find((function(t){return e!==t&&("name"===i?t.name===o:n.attributeToString(t,i)===o)})):null}return e.find((function(n){return e!==n&&n.nodeName===t}))}},{key:"selectAll",value:function(t,e){var n=this;if(t.startsWith("."))return e.findAll((function(r){return e!==r&&((null==r?void 0:r.classList)||[]).indexOf(n.getIdOrClassname(t))>-1}));if(t.startsWith("#"))return e.findAll((function(r){return e!==r&&r.id===n.getIdOrClassname(t)}));if(t.startsWith("[")){var r=this.getAttribute(t),i=r.name,o=r.value;return i?e.findAll((function(t){return e!==t&&("name"===i?t.name===o:n.attributeToString(t,i)===o)})):[]}return e.findAll((function(n){return e!==n&&n.nodeName===t}))}},{key:"is",value:function(t,e){if(t.startsWith("."))return e.className===this.getIdOrClassname(t);if(t.startsWith("#"))return e.id===this.getIdOrClassname(t);if(t.startsWith("[")){var n=this.getAttribute(t),r=n.name,i=n.value;return"name"===r?e.name===i:this.attributeToString(e,r)===i}return e.nodeName===t}},{key:"getIdOrClassname",value:function(t){return t.substring(1)}},{key:"getAttribute",value:function(t){var e=t.match(Os),n="",r="";return e&&e.length>2&&(n=e[1].replace(/"/g,""),r=e[2].replace(/"/g,"")),{name:n,value:r}}},{key:"attributeToString",value:function(t,e){if(!t.getAttribute)return"";var n=t.getAttribute(e);return ae(n)?"":n.toString?n.toString():""}}])}(),Ps=function(t){return t.ATTR_MODIFIED="DOMAttrModified",t.INSERTED="DOMNodeInserted",t.MOUNTED="DOMNodeInsertedIntoDocument",t.REMOVED="removed",t.UNMOUNTED="DOMNodeRemovedFromDocument",t.REPARENT="reparent",t.DESTROY="destroy",t.BOUNDS_CHANGED="bounds-changed",t.CULLED="culled",t}({}),Rs=function(t){function e(t,n,r,i,o,s,l,u){var h;return(0,a.Z)(this,e),(h=(0,c.Z)(this,e,[null])).relatedNode=n,h.prevValue=r,h.newValue=i,h.attrName=o,h.attrChange=s,h.prevParsedValue=l,h.newParsedValue=u,h.type=t,h}return(0,u.Z)(e,t),(0,s.Z)(e)}(ys);Rs.ADDITION=2,Rs.MODIFICATION=1,Rs.REMOVAL=3;var Ds,Ls,Is,Bs=new Rs(Ps.REPARENT,null,"","","",0,"",""),js=ee(),zs=g(),Fs=y(1,1,1),_s=F(),Zs=ee(),Gs=g(),Vs=F(),Ws=zt(),Hs=g(),Us=zt(),Ys=g(),qs=g(),Xs=g(),Ks=F(),Qs=zt(),Js=zt(),$s=zt(),tl={affectChildren:!0},el=function(){return(0,s.Z)((function t(e){(0,a.Z)(this,t),this.pendingEvents=new Map,this.boundsChangedEvent=new ws(Ps.BOUNDS_CHANGED),this.displayObjectDependencyMap=new WeakMap,this.runtime=e}),[{key:"matches",value:function(t,e){return this.runtime.sceneGraphSelector.is(t,e)}},{key:"querySelector",value:function(t,e){return this.runtime.sceneGraphSelector.selectOne(t,e)}},{key:"querySelectorAll",value:function(t,e){return this.runtime.sceneGraphSelector.selectAll(t,e)}},{key:"attach",value:function(t,e,n){var r,i=!1;t.parentNode&&(i=t.parentNode!==e,this.detach(t));var o=t.nodeName===Ln.FRAGMENT,a=Ta(e);t.parentNode=e;var s=o?t.childNodes:[t];ie(n)?s.forEach((function(t){e.childNodes.splice(n,0,t),t.parentNode=e})):s.forEach((function(t){e.childNodes.push(t),t.parentNode=e}));var l=e.sortable;if((null!=l&&null!==(r=l.sorted)&&void 0!==r&&r.length||l.dirty||t.parsedStyle.zIndex)&&(-1===l.dirtyChildren.indexOf(t)&&l.dirtyChildren.push(t),l.dirty=!0,l.dirtyReason=wr.ADDED),!a){if(o)this.dirtifyFragment(t);else{var c=t.transformable;c&&this.dirtyWorldTransform(t,c)}if(i){var u,h=!0===(null===(u=e.ownerDocument)||void 0===u||null===(u=u.defaultView)||void 0===u||null===(u=u.getConfig())||void 0===u||null===(u=u.future)||void 0===u?void 0:u.experimentalCancelEventPropagation);t.dispatchEvent(Bs,h,h)}}}},{key:"detach",value:function(t){var e,n;if(t.parentNode){var r=t.transformable,i=t.parentNode.sortable;(null!=i&&null!==(e=i.sorted)&&void 0!==e&&e.length||null!==(n=t.style)&&void 0!==n&&n.zIndex)&&(-1===i.dirtyChildren.indexOf(t)&&i.dirtyChildren.push(t),i.dirty=!0,i.dirtyReason=wr.REMOVED);var o=t.parentNode.childNodes.indexOf(t);o>-1&&t.parentNode.childNodes.splice(o,1),r&&this.dirtyWorldTransform(t,r),t.parentNode=null}}},{key:"getLocalPosition",value:function(t){return t.transformable.localPosition}},{key:"getLocalRotation",value:function(t){return t.transformable.localRotation}},{key:"getLocalScale",value:function(t){return t.transformable.localScale}},{key:"getLocalSkew",value:function(t){return t.transformable.localSkew}},{key:"getLocalTransform",value:function(t){var e=t.transformable;return Ar(e),e.localTransform}},{key:"setLocalPosition",value:function(t,e){var n,r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=t.transformable;qs[0]=e[0],qs[1]=e[1],qs[2]=null!==(n=e[2])&&void 0!==n?n:0,P(i.localPosition,qs)||(b(i.localPosition,qs),r&&this.dirtyLocalTransform(t,i))}},{key:"translateLocal",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;"number"==typeof e&&(e=y(e,n,r));var i=t.transformable;P(e,zs)||(T(e,e,i.localRotation),E(i.localPosition,i.localPosition,e),this.dirtyLocalTransform(t,i))}},{key:"setLocalRotation",value:function(t,e,n,r,i){var o=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];"number"==typeof e&&(e=Ut(Ws,e,n,r,i));var a=t.transformable;Ht(a.localRotation,e),o&&this.dirtyLocalTransform(t,a)}},{key:"rotateLocal",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;"number"==typeof e&&(e=y(e,n,r));var i=t.transformable;Vt(Js,e[0],e[1],e[2]),Yt(i.localRotation,i.localRotation,Js),this.dirtyLocalTransform(t,i)}},{key:"setLocalScale",value:function(t,e){var n,r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=t.transformable;x(Gs,e[0],e[1],null!==(n=e[2])&&void 0!==n?n:i.localScale[2]),P(Gs,i.localScale)||(b(i.localScale,Gs),r&&this.dirtyLocalTransform(t,i))}},{key:"scaleLocal",value:function(t,e){var n,r=t.transformable;k(r.localScale,r.localScale,x(Gs,e[0],e[1],null!==(n=e[2])&&void 0!==n?n:1)),this.dirtyLocalTransform(t,r)}},{key:"setLocalSkew",value:function(t,e,n){var r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];"number"==typeof e&&(e=re(Zs,e,n));var i=t.transformable;ne(i.localSkew,e),r&&this.dirtyLocalTransform(t,i)}},{key:"setLocalEulerAngles",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];"number"==typeof e&&(e=y(e,n,r));var o=t.transformable;Vt(o.localRotation,e[0],e[1],e[2]),i&&this.dirtyLocalTransform(t,o)}},{key:"setLocalTransform",value:function(t,e){var n=ut(Hs,e),r=dt(Us,e),i=ht(Ys,e);this.setLocalScale(t,i,!1),this.setLocalPosition(t,n,!1),this.setLocalRotation(t,r,void 0,void 0,void 0,!1),this.dirtyLocalTransform(t,t.transformable)}},{key:"resetLocalTransform",value:function(t){this.setLocalScale(t,Fs,!1),this.setLocalPosition(t,zs,!1),this.setLocalEulerAngles(t,zs,void 0,void 0,!1),this.setLocalSkew(t,js,void 0,!1),this.dirtyLocalTransform(t,t.transformable)}},{key:"getPosition",value:function(t){var e=t.transformable;return ut(e.position,this.getWorldTransform(t,e))}},{key:"getRotation",value:function(t){var e=t.transformable;return dt(e.rotation,this.getWorldTransform(t,e))}},{key:"getScale",value:function(t){var e=t.transformable;return ht(e.scaling,this.getWorldTransform(t,e))}},{key:"getOrigin",value:function(t){return t.getGeometryBounds(),t.transformable.origin}},{key:"getWorldTransform",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.transformable;return e.localDirtyFlag||e.dirtyFlag?(t.parentNode&&t.parentNode.transformable&&this.getWorldTransform(t.parentNode),this.internalUpdateTransform(t),e.worldTransform):e.worldTransform}},{key:"setPosition",value:function(t,e){var n,r=t.transformable;if(Xs[0]=e[0],Xs[1]=e[1],Xs[2]=null!==(n=e[2])&&void 0!==n?n:0,!P(this.getPosition(t),Xs)){if(b(r.position,Xs),null!==t.parentNode&&t.parentNode.transformable){var i=t.parentNode.transformable;Z(Ks,i.worldTransform),U(Ks,Ks),O(r.localPosition,Xs,Ks)}else b(r.localPosition,Xs);this.dirtyLocalTransform(t,r)}}},{key:"translate",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;"number"==typeof e&&(e=x(Gs,e,n,r)),P(e,zs)||(E(Gs,this.getPosition(t),e),this.setPosition(t,Gs))}},{key:"setRotation",value:function(t,e,n,r,i){var o=t.transformable;if("number"==typeof e&&(e=Wt(e,n,r,i)),null!==t.parentNode&&t.parentNode.transformable){var a=this.getRotation(t.parentNode);Ht(Ws,a),Gt(Ws,Ws),_t(o.localRotation,Ws,e),qt(o.localRotation,o.localRotation),this.dirtyLocalTransform(t,o)}else this.setLocalRotation(t,e)}},{key:"rotate",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;"number"==typeof e&&(e=y(e,n,r));var i=t.transformable;if(null!==t.parentNode&&t.parentNode.transformable){var o=Ws;Vt(o,e[0],e[1],e[2]);var a=this.getRotation(t),s=this.getRotation(t.parentNode);Ht($s,s),Gt($s,$s),_t(o,$s,o),_t(i.localRotation,o,a),qt(i.localRotation,i.localRotation),this.dirtyLocalTransform(t,i)}else this.rotateLocal(t,e)}},{key:"setOrigin",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;"number"==typeof e&&(e=[e,n,r]);var i=t.transformable;if(e[0]!==i.origin[0]||e[1]!==i.origin[1]||e[2]!==i.origin[2]){var o=i.origin;o[0]=e[0],o[1]=e[1],o[2]=e[2]||0,this.dirtyLocalTransform(t,i)}}},{key:"setEulerAngles",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;"number"==typeof e&&(e=y(e,n,r));var i=t.transformable;if(null!==t.parentNode&&t.parentNode.transformable){Vt(i.localRotation,e[0],e[1],e[2]);var o=this.getRotation(t.parentNode);Ht(Qs,Gt(Ws,o)),Yt(i.localRotation,i.localRotation,Qs),this.dirtyLocalTransform(t,i)}else this.setLocalEulerAngles(t,e)}},{key:"getTransformedGeometryBounds",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2?arguments[2]:void 0,r=this.getGeometryBounds(t,e);if(!Wn.isEmpty(r)){var i=n||new Wn;return i.setFromTransformedAABB(r,this.getWorldTransform(t)),i}return null}},{key:"getGeometryBounds",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=t,r=n.geometry;r.dirty&&ll.styleValueRegistry.updateGeometry(t);var i=e?r.renderBounds:r.contentBounds||null;return i||new Wn}},{key:"getBounds",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=t,i=r.renderable;if(!i.boundsDirty&&!n&&i.bounds)return i.bounds;if(!i.renderBoundsDirty&&n&&i.renderBounds)return i.renderBounds;var o=n?i.renderBounds:i.bounds,a=this.getTransformedGeometryBounds(t,n,o),s=t.childNodes;if(s.forEach((function(t){var r=e.getBounds(t,n);r&&(a?a.add(r):(a=o||new Wn).update(r.center,r.halfExtents))})),a||(a=new Wn),n){var l=Aa(t);if(l){var c=l.parsedStyle.clipPath.getBounds(n);a?c&&(a=c.intersection(a)):a.update(c.center,c.halfExtents)}}return n?(i.renderBounds=a,i.renderBoundsDirty=!1):(i.bounds=a,i.boundsDirty=!1),a}},{key:"getLocalBounds",value:function(t){if(t.parentNode){var e=_s;t.parentNode.transformable&&(e=U(Vs,this.getWorldTransform(t.parentNode)));var n=this.getBounds(t);if(!Wn.isEmpty(n)){var r=new Wn;return r.setFromTransformedAABB(n,e),r}}return this.getBounds(t)}},{key:"getBoundingClientRect",value:function(t){var e,n,r=this.getGeometryBounds(t);Wn.isEmpty(r)||(n=new Wn).setFromTransformedAABB(r,this.getWorldTransform(t));var i=null===(e=t.ownerDocument)||void 0===e||null===(e=e.defaultView)||void 0===e?void 0:e.getContextService().getBoundingClientRect();if(n){var o=n.getMin(),a=(0,h.Z)(o,2),s=a[0],l=a[1],c=n.getMax(),u=(0,h.Z)(c,2),d=u[0],f=u[1];return new Xn(s+((null==i?void 0:i.left)||0),l+((null==i?void 0:i.top)||0),d-s,f-l)}return new Xn((null==i?void 0:i.left)||0,(null==i?void 0:i.top)||0,0,0)}},{key:"internalUpdateTransform",value:function(t){var e,n=null===(e=t.parentNode)||void 0===e?void 0:e.transformable;Ar(t.transformable),function(t,e){t.dirtyFlag&&(e?X(t.worldTransform,e.worldTransform,t.localTransform):Z(t.worldTransform,t.localTransform),t.dirtyFlag=!1)}(t.transformable,n)}},{key:"internalUpdateElement",value:function(t,e){var n,r,i,o,a,s,l=!0===(null===(n=t.ownerDocument)||void 0===n||null===(n=n.defaultView)||void 0===n||null===(n=n.getConfig())||void 0===n||null===(n=n.future)||void 0===n?void 0:n.experimentalAttributeUpdateOptimization),c=e[e.length-1],u=(null==c?void 0:c.transformDirty)||(null===(r=t.transformable)||void 0===r?void 0:r.localDirtyFlag);t.transformable&&((a=t.transformable).dirtyFlag||(a.dirtyFlag=u));(this.internalUpdateTransform(t),u)&&(null===(s=t.dirty)||void 0===s||s.call(t,!0,!0));var h=(null===(i=t.renderable)||void 0===i?void 0:i.boundsDirty)||(null===(o=t.renderable)||void 0===o?void 0:o.renderBoundsDirty);if((u||h)&&!1===(null==c?void 0:c.shapeUpdated)&&l)for(var d=e.length-1;d>=0;){var f,p,g=e[d];if(g.shapeUpdated)break;null===(f=(p=g.node).dirty)||void 0===f||f.call(p,!0,!0),g.shapeUpdated=!0,d-=1}return u}},{key:"syncHierarchy",value:function(t){for(var e,n,r=[t],i=t.parentNode?[{node:t.parentNode,transformDirty:(null===(e=t.parentNode.transformable)||void 0===e?void 0:e.localDirtyFlag)||(null===(n=t.parentNode.transformable)||void 0===n?void 0:n.dirtyFlag),shapeUpdated:!1}]:[];r.length>0;){for(var o=r.pop(),a=i[i.length-1];i.length>0&&o.parentNode!==a.node;)a=i.pop();var s=this.internalUpdateElement(o,i);if(o.childNodes.length>0){for(var l=o.childNodes.length-1;l>=0;l--)r.push(o.childNodes[l]);i.push({node:o,transformDirty:s,shapeUpdated:!1})}}}},{key:"dirtyLocalTransform",value:function(t,e){Ta(t)||e.localDirtyFlag||(e.localDirtyFlag=!0,e.dirtyFlag||this.dirtyWorldTransform(t,e))}},{key:"dirtyWorldTransform",value:function(t,e){this.dirtifyWorldInternal(t,e),this.dirtyToRoot(t,!0)}},{key:"dirtifyWorldInternal",value:function(t,e){var n,r=this,i=!0===(null===(n=t.ownerDocument)||void 0===n||null===(n=n.defaultView)||void 0===n||null===(n=n.getConfig())||void 0===n||null===(n=n.future)||void 0===n?void 0:n.experimentalAttributeUpdateOptimization);e.dirtyFlag||(e.dirtyFlag=!0,t.dirty(!0,!0),i||t.childNodes.forEach((function(t){var e=t.transformable;r.dirtifyWorldInternal(t,e)})))}},{key:"dirtyToRoot",value:function(t){for(var e,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=t,i=!0===(null===(e=t.ownerDocument)||void 0===e||null===(e=e.defaultView)||void 0===e||null===(e=e.getConfig())||void 0===e||null===(e=e.future)||void 0===e?void 0:e.experimentalAttributeUpdateOptimization);r;){var o,a;if(null===(o=(a=r).dirty)||void 0===o||o.call(a,!0,!0),i)break;r=r.parentNode}n&&t.forEach((function(t){var e;null===(e=t.dirty)||void 0===e||e.call(t,!0,!0)})),this.informDependentDisplayObjects(t),this.pendingEvents.set(t,n)}},{key:"dirtifyFragment",value:function(t){var e,n,r=t.transformable;r&&(r.dirtyFlag=!0,r.localDirtyFlag=!0),null===(e=(n=t).dirty)||void 0===e||e.call(n,!0,!0);for(var i=t.childNodes.length,o=0;o<i;o++)this.dirtifyFragment(t.childNodes[o]);t.nodeName===Ln.FRAGMENT&&this.pendingEvents.set(t,!1)}},{key:"triggerPendingEvents",value:function(){var t,e,n=this,r=new Set,i=function(e,i){if(e.isConnected&&!r.has(e)&&e.nodeName!==Ln.FRAGMENT){if(n.boundsChangedEvent.detail=i,n.boundsChangedEvent.target=e,e.isMutationObserved)e.dispatchEvent(n.boundsChangedEvent);else{var o;if(void 0===t)t=!0===(null===(o=e.ownerDocument.defaultView)||void 0===o||null===(o=o.getConfig())||void 0===o||null===(o=o.future)||void 0===o?void 0:o.experimentalCancelEventPropagation);e.ownerDocument.defaultView.dispatchEvent(n.boundsChangedEvent,!0,t)}r.add(e)}};this.pendingEvents.forEach((function(t,n){if(n.nodeName!==Ln.FRAGMENT){var r;if(void 0===e)e=!0===(null===(r=n.ownerDocument)||void 0===r||null===(r=r.defaultView)||void 0===r||null===(r=r.getConfig())||void 0===r||null===(r=r.future)||void 0===r?void 0:r.experimentalAttributeUpdateOptimization);tl.affectChildren=t,e?i(n,tl):t?n.forEach((function(t){i(t,tl)})):i(n,tl)}})),r.clear(),this.clearPendingEvents()}},{key:"clearPendingEvents",value:function(){this.pendingEvents.clear()}},{key:"updateDisplayObjectDependency",value:function(t,e,n,r){if(e&&e!==n){var i=this.displayObjectDependencyMap.get(e);if(i&&i[t]){var o=i[t].indexOf(r);i[t].splice(o,1)}}if(n){var a=this.displayObjectDependencyMap.get(n);a||(this.displayObjectDependencyMap.set(n,{}),a=this.displayObjectDependencyMap.get(n)),a[t]||(a[t]=[]),a[t].push(r)}}},{key:"informDependentDisplayObjects",value:function(t){var e,n=this,r=this.displayObjectDependencyMap.get(t);if(r){var i=null===(e=t.ownerDocument)||void 0===e||null===(e=e.defaultView)||void 0===e||null===(e=e.getConfig())||void 0===e||null===(e=e.future)||void 0===e?void 0:e.experimentalCancelEventPropagation;Object.keys(r).forEach((function(t){r[t].forEach((function(e){n.dirtyToRoot(e,!0),e.dispatchEvent(new Rs(Ps.ATTR_MODIFIED,e,n,n,t,Rs.MODIFICATION,n,n),i,i),e.isCustomElement&&e.isConnected&&e.attributeChangedCallback&&e.attributeChangedCallback(t,n,n)}))}))}}}])}(),nl=function(){return(0,s.Z)((function t(e){if((0,a.Z)(this,t),e<=0)throw new Error("LRU capacity must be a positive number.");this.capacity=e,this.cache=new Map}),[{key:"get",value:function(t){if(this.cache.has(t)){var e=this.cache.get(t);return this.cache.delete(t),this.cache.set(t,e),e}}},{key:"put",value:function(t,e){if(this.cache.has(t)&&this.cache.delete(t),this.cache.set(t,e),this.cache.size>this.capacity){var n=this.cache.keys().next().value;this.cache.delete(n)}}},{key:"len",value:function(){return this.cache.size}},{key:"clear",value:function(){this.cache.clear()}}])}(),rl={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]},il=/[a-zA-Z0-9\u00C0-\u00D6\u00D8-\u00f6\u00f8-\u00ff!"#$%&'()*+,-./:;]/,ol=new RegExp("".concat(/[!%),.:;?\]}¢°·'""†‡›℃∶、。〃〆〕〗〞﹚﹜!"%'),.:;?!]}~]/.source,"|").concat(/[!),.:;?\]}¢·–—'"•"、。〆〞〕〉》」︰︱︲︳﹐﹑﹒﹔﹕﹖﹘﹚﹜!),.:;?︶︸︺︼︾﹀﹂﹗]|}、]/.source,"|").concat(/[)\]}〕〉》」』】〙〗〟'"⦆»ヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻‐゠–〜?!‼⁇⁈⁉・、:;,。.]/.source,"|").concat(/[!%),.:;?\]}¢°'"†‡℃〆〈《「『〕!%),.:;?]}]/.source)),al=new RegExp("".concat(/[$(£¥·'"〈《「『【〔〖〝﹙﹛$(.[{£¥]/.source,"|").concat(/[([{£¥'"‵〈《「『〔〝︴﹙﹛({︵︷︹︻︽︿﹁﹃﹏]/.source,"|").concat(/[([{〔〈《「『【〘〖〝'"⦅«—...‥〳〴〵]/.source,"|").concat(/[$([{£¥'"々〇〉》」〔$([{⦆¥₩#]/.source)),sl=function(){return(0,s.Z)((function t(e){var n=this;(0,a.Z)(this,t),this.fontMetricsCache={},this.shouldBreakByKinsokuShorui=function(t,e){return!n.isBreakingSpace(e)&&!(!t||!al.exec(e)&&!ol.exec(t))},this.trimByKinsokuShorui=function(t){var e=(0,l.Z)(t),n=e[e.length-2];if(!n)return t;var r=n[n.length-1];return e[e.length-2]=n.slice(0,-1),e[e.length-1]=r+e[e.length-1],e},this.runtime=e,this.charWidthCache=new nl(100)}),[{key:"measureFont",value:function(t,e){if(this.fontMetricsCache[t])return this.fontMetricsCache[t];var n={ascent:0,descent:0,fontSize:0},r=this.runtime.offscreenCanvasCreator.getOrCreateCanvas(e),i=this.runtime.offscreenCanvasCreator.getOrCreateContext(e,{willReadFrequently:!0});i.font=t;var o=rl.MetricsString+rl.BaselineSymbol,a=Math.ceil(i.measureText(o).width),s=Math.ceil(i.measureText(rl.BaselineSymbol).width),l=rl.HeightMultiplier*s;s=s*rl.BaselineMultiplier|0,r.width=a,r.height=l,i.fillStyle="#f00",i.fillRect(0,0,a,l),i.font=t,i.textBaseline="alphabetic",i.fillStyle="#000",i.fillText(o,0,s);var c=i.getImageData(0,0,a||1,l||1).data,u=c.length,h=4*a,d=0,f=0,p=!1;for(d=0;d<s;++d){for(var g=0;g<h;g+=4)if(255!==c[f+g]){p=!0;break}if(p)break;f+=h}for(n.ascent=s-d,f=u-h,p=!1,d=l;d>s;--d){for(var v=0;v<h;v+=4)if(255!==c[f+v]){p=!0;break}if(p)break;f-=h}return n.descent=d-s,n.fontSize=n.ascent+n.descent,this.fontMetricsCache[t]=n,n}},{key:"measureText",value:function(t,e,n){var r=e.fontSize,i=void 0===r?16:r,o=e.wordWrap,a=void 0!==o&&o,s=e.lineHeight,l=e.lineWidth,c=void 0===l?1:l,u=e.textBaseline,h=void 0===u?"alphabetic":u,d=e.textAlign,f=void 0===d?"start":d,p=e.letterSpacing,g=void 0===p?0:p,v=e.textPath;e.textPathSide,e.textPathStartOffset;var m=e.leading,y=void 0===m?0:m,b=Ka(e),x=this.measureFont(b,n);0===x.fontSize&&(x.fontSize=i,x.ascent=i);var E=this.runtime.offscreenCanvasCreator.getOrCreateContext(n);E.font=b,e.isOverflowing=!1;var w=(a?this.wordWrap(t,e,n):t).split(/(?:\r\n|\r|\n)/),k=new Array(w.length),M=0;if(!v){for(var S=0;S<w.length;S++){var A=E.measureText(w[S]).width+(w[S].length-1)*g;k[S]=A,M=Math.max(M,A)}var N=M+c,C=s||x.fontSize+c,O=Math.max(C,x.fontSize+c)+(w.length-1)*(C+y),T=0;return"middle"===h?T=-O/2:"bottom"===h||"alphabetic"===h||"ideographic"===h?T=-O:"top"!==h&&"hanging"!==h||(T=0),{font:b,width:N,height:O,lines:w,lineWidths:k,lineHeight:C+=y,maxLineWidth:M,fontProperties:x,lineMetrics:k.map((function(t,e){var n=0;return"center"===f||"middle"===f?n-=t/2:"right"!==f&&"end"!==f||(n-=t),new Xn(n-c/2,T+e*C,t+c,C)}))}}v.getTotalLength();for(var P=0;P<w.length;P++)E.measureText(w[P]).width,w[P].length}},{key:"wordWrap",value:function(t,e,n){var r=this,i=Array.from(t);if(0===i.length)return"";var o=this,a=e.wordWrapWidth,s=void 0===a?0:a,l=e.letterSpacing,c=void 0===l?0:l,u=e.maxLines,h=void 0===u?1/0:u,d=e.textOverflow,f=this.runtime.offscreenCanvasCreator.getOrCreateContext(n),p=s+c,g="";"ellipsis"===d?g="...":d&&"clip"!==d&&(g=d);var v=[""],m=0,y=0,b=-1,x=Ka(e),E=this.charWidthCache.get(x);E||(E=new nl(500),this.charWidthCache.put(x,E));var w=function(t){return r.getFromCache(t,c,E,f)},k=w(g);function M(t,e,n,r){for(;w(t)<r&&e<i.length-1&&!o.isNewline(i[e+1]);)t+=i[e+=1];for(;w(t)>r&&e>=n;)e-=1,t=t.slice(0,-1);return{lineTxt:t,txtLastCharIndex:e}}function S(t,e){if(!(k<=0||k>p))if(v[t]){var n=M(v[t],e,b+1,p-k);v[t]=n.lineTxt+g}else v[t]=g}for(var A=0;A<i.length;A++){var N=i[A],C=i[A-1],O=i[A+1],T=w(N);if(this.isNewline(N)){if(m+1>=h){A<i.length-1&&S(m,A-1),e.isOverflowing=!0;break}b=A-1,y=0,v[m+=1]=""}else{if(T>p){S(m,A-1),e.isOverflowing=!0;break}if(y>0&&y+T>p){var P=M(v[m],A-1,b+1,p);if(P.txtLastCharIndex!==A-1){if(v[m]=P.lineTxt,P.txtLastCharIndex===i.length-1)break;A=P.txtLastCharIndex+1,N=i[A],C=i[A-1],O=i[A+1],T=w(N)}if(m+1>=h){S(m,A-1),e.isOverflowing=!0;break}if(b=A-1,y=0,v[m+=1]="",this.isBreakingSpace(N))continue;this.canBreakInLastChar(N)||(v=this.trimToBreakable(v),y=this.sumTextWidthByCache(v[m]||"",w)),this.shouldBreakByKinsokuShorui(N,O)&&(v=this.trimByKinsokuShorui(v),y+=w(C||""))}y+=T,v[m]+=N}}return v.join("\n")}},{key:"isBreakingSpace",value:function(t){return"string"==typeof t&&rl.BreakingSpaces.indexOf(t.charCodeAt(0))>=0}},{key:"isNewline",value:function(t){return"string"==typeof t&&rl.Newlines.indexOf(t.charCodeAt(0))>=0}},{key:"trimToBreakable",value:function(t){var e=(0,l.Z)(t),n=e[e.length-2],r=this.findBreakableIndex(n);if(-1===r||!n)return e;var i=n.slice(r,r+1),o=r+1,a=r+(this.isBreakingSpace(i)?0:1);return e[e.length-1]+=n.slice(o,n.length),e[e.length-2]=n.slice(0,a),e}},{key:"canBreakInLastChar",value:function(t){return!t||!il.test(t)}},{key:"sumTextWidthByCache",value:function(t,e){return t.split("").reduce((function(t,n){return t+e(n)}),0)}},{key:"findBreakableIndex",value:function(t){for(var e=t.length-1;e>=0;e--)if(!il.test(t[e]))return e;return-1}},{key:"getFromCache",value:function(t,e,n,r){var i=n.get(t);if("number"!=typeof i){var o=t.length*e;i=r.measureText(t).width+o,n.put(t,i)}return i}},{key:"clearCache",value:function(){this.fontMetricsCache={},this.charWidthCache.clear()}}])}(),ll={},cl=(Ls=new ps,Is=new fs,Ds={},(0,on.Z)((0,on.Z)((0,on.Z)((0,on.Z)((0,on.Z)((0,on.Z)((0,on.Z)((0,on.Z)((0,on.Z)((0,on.Z)(Ds,Ln.FRAGMENT,null),Ln.CIRCLE,new cs),Ln.ELLIPSE,new us),Ln.RECT,Ls),Ln.IMAGE,Ls),Ln.GROUP,new vs),Ln.LINE,new hs),Ln.TEXT,new gs(ll)),Ln.POLYLINE,Is),Ln.POLYGON,Is),(0,on.Z)((0,on.Z)((0,on.Z)(Ds,Ln.PATH,new ds),Ln.HTML,new ms),Ln.MESH,null)),ul=function(t){var e=new sa,n=new ua;return t={},(0,on.Z)((0,on.Z)((0,on.Z)((0,on.Z)((0,on.Z)((0,on.Z)((0,on.Z)((0,on.Z)((0,on.Z)((0,on.Z)(t,Cr.PERCENTAGE,null),Cr.NUMBER,new pa),Cr.ANGLE,new oa),Cr.DEFINED_PATH,new aa),Cr.PAINT,e),Cr.COLOR,e),Cr.FILTER,new la),Cr.LENGTH,n),Cr.LENGTH_PERCENTAGE,n),Cr.LENGTH_PERCENTAGE_12,new ha),(0,on.Z)((0,on.Z)((0,on.Z)((0,on.Z)((0,on.Z)((0,on.Z)((0,on.Z)((0,on.Z)((0,on.Z)((0,on.Z)(t,Cr.LENGTH_PERCENTAGE_14,new da),Cr.COORDINATE,new ua),Cr.OFFSET_DISTANCE,new ga),Cr.OPACITY_VALUE,new va),Cr.PATH,new ma),Cr.LIST_OF_POINTS,new ya),Cr.SHADOW_BLUR,new ba),Cr.TEXT,new xa),Cr.TEXT_TRANSFORM,new Ea),Cr.TRANSFORM,new as),(0,on.Z)((0,on.Z)((0,on.Z)(t,Cr.TRANSFORM_ORIGIN,new ss),Cr.Z_INDEX,new ls),Cr.MARKER,new fa)}();ll.CameraContribution=xr,ll.AnimationTimeline=null,ll.EasingFunction=null,ll.offscreenCanvasCreator=new As,ll.sceneGraphSelector=new Ts,ll.sceneGraphService=new el(ll),ll.textService=new sl(ll),ll.geometryUpdaterFactory=cl,ll.CSSPropertySyntaxFactory=ul,ll.styleValueRegistry=new na(ll),ll.layoutRegistry=null,ll.globalThis="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==n.g?n.g:{},ll.enableStyleSyntax=!0,ll.enableSizeAttenuation=!1;var hl=0;var dl=new Rs(Ps.INSERTED,null,"","","",0,"",""),fl=new Rs(Ps.REMOVED,null,"","","",0,"",""),pl=new ws(Ps.DESTROY),gl=function(t){function e(){var t;(0,a.Z)(this,e);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=(0,c.Z)(this,e,[].concat(r))).entity=hl++,t.transformable={dirtyFlag:!1,localDirtyFlag:!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.renderable={bounds:void 0,boundsDirty:!0,renderBounds:void 0,renderBoundsDirty:!0,dirtyRenderBounds:void 0,dirty:!1},t.geometry={contentBounds:void 0,renderBounds:void 0,dirty:!0},t.cullable={strategy:Er.Standard,visibilityPlaneMask:-1,visible:!0,enable:!0},t.sortable={dirty:!1,sorted:void 0,renderOrder:0,dirtyChildren:[],dirtyReason:void 0},t.rBushNode={aabb:void 0},t.namespaceURI="g",t.scrollLeft=0,t.scrollTop=0,t.clientTop=0,t.clientLeft=0,t.style={},t.computedStyle={},t.parsedStyle={},t.attributes={},t}return(0,u.Z)(e,t),(0,s.Z)(e,[{key:"dirty",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.renderable.dirty=t,e&&(this.renderable.boundsDirty=t,this.renderable.renderBoundsDirty=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(){if(this.parentNode){var t=this.parentNode.childNodes.indexOf(this);return this.parentNode.childNodes[t+1]||null}return null}},{key:"previousSibling",get:function(){if(this.parentNode){var t=this.parentNode.childNodes.indexOf(this);return this.parentNode.childNodes[t-1]||null}return null}},{key:"cloneNode",value:function(t){throw new Error(Kn)}},{key:"appendChild",value:function(t,e){var n;if(t.destroyed)throw new Error("Cannot append a destroyed element.");return ll.sceneGraphService.attach(t,this,e),null!==(n=this.ownerDocument)&&void 0!==n&&n.defaultView&&(Ta(this)||t.nodeName!==Ln.FRAGMENT?this.ownerDocument.defaultView.mountChildren(t):this.ownerDocument.defaultView.mountFragment(t)),this.isMutationObserved&&(dl.relatedNode=this,t.dispatchEvent(dl)),t}},{key:"insertBefore",value:function(t,e){if(e){t.parentElement&&t.parentElement.removeChild(t);var n=this.childNodes.indexOf(e);-1===n?this.appendChild(t):this.appendChild(t,n)}else this.appendChild(t);return t}},{key:"replaceChild",value:function(t,e){var n=this.childNodes.indexOf(e);return this.removeChild(e),this.appendChild(t,n),e}},{key:"removeChild",value:function(t){var e,n,r=!0===(null===(e=this.ownerDocument)||void 0===e||null===(e=e.defaultView)||void 0===e||null===(e=e.getConfig().future)||void 0===e?void 0:e.experimentalCancelEventPropagation);return fl.relatedNode=this,t.dispatchEvent(fl,r,r),null!==(n=t.ownerDocument)&&void 0!==n&&n.defaultView&&t.ownerDocument.defaultView.unmountChildren(t),ll.sceneGraphService.detach(t),t}},{key:"removeChildren",value:function(){for(var t=this.childNodes.length-1;t>=0;t--){var e=this.childNodes[t];this.removeChild(e)}}},{key:"destroyChildren",value:function(){for(var t=this.childNodes.length-1;t>=0;t--){var e=this.childNodes[t];e.childNodes.length>0&&e.destroyChildren(),e.destroy()}}},{key:"matches",value:function(t){return ll.sceneGraphService.matches(t,this)}},{key:"getElementById",value:function(t){return ll.sceneGraphService.querySelector("#".concat(t),this)}},{key:"getElementsByName",value:function(t){return ll.sceneGraphService.querySelectorAll('[name="'.concat(t,'"]'),this)}},{key:"getElementsByClassName",value:function(t){return ll.sceneGraphService.querySelectorAll(".".concat(t),this)}},{key:"getElementsByTagName",value:function(t){return ll.sceneGraphService.querySelectorAll(t,this)}},{key:"querySelector",value:function(t){return ll.sceneGraphService.querySelector(t,this)}},{key:"querySelectorAll",value:function(t){return ll.sceneGraphService.querySelectorAll(t,this)}},{key:"closest",value:function(t){var e=this;do{if(ll.sceneGraphService.matches(t,e))return e;e=e.parentElement}while(null!==e);return null}},{key:"find",value:function(t){var e=this,n=null;return this.forEach((function(r){return r===e||!t(r)||(n=r,!1)})),n}},{key:"findAll",value:function(t){var e=this,n=[];return this.forEach((function(r){r!==e&&t(r)&&n.push(r)})),n}},{key:"after",value:function(){var t=this;if(this.parentNode){for(var e=this.parentNode.childNodes.indexOf(this),n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];r.forEach((function(n,r){var i;return null===(i=t.parentNode)||void 0===i?void 0:i.appendChild(n,e+r+1)}))}}},{key:"before",value:function(){if(this.parentNode){for(var t,e=this.parentNode.childNodes.indexOf(this),n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];var o=r[0],a=r.slice(1);this.parentNode.appendChild(o,e),(t=o).after.apply(t,(0,l.Z)(a))}}},{key:"replaceWith",value:function(){this.after.apply(this,arguments),this.remove()}},{key:"append",value:function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];n.forEach((function(e){return t.appendChild(e)}))}},{key:"prepend",value:function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];n.forEach((function(e,n){return t.appendChild(e,n)}))}},{key:"replaceChildren",value:function(){for(;this.childNodes.length&&this.firstChild;)this.removeChild(this.firstChild);this.append.apply(this,arguments)}},{key:"remove",value:function(){return this.parentNode?this.parentNode.removeChild(this):this}},{key:"destroy",value:function(){var t,e=!0===(null===(t=this.ownerDocument)||void 0===t||null===(t=t.defaultView)||void 0===t||null===(t=t.getConfig().future)||void 0===t?void 0:t.experimentalCancelEventPropagation);this.destroyChildren(),this.dispatchEvent(pl,e,e),this.remove(),this.emitter.removeAllListeners(),this.destroyed=!0}},{key:"getGeometryBounds",value:function(){return ll.sceneGraphService.getGeometryBounds(this)}},{key:"getRenderBounds",value:function(){return ll.sceneGraphService.getBounds(this,!0)}},{key:"getBounds",value:function(){return ll.sceneGraphService.getBounds(this)}},{key:"getLocalBounds",value:function(){return ll.sceneGraphService.getLocalBounds(this)}},{key:"getBoundingClientRect",value:function(){return ll.sceneGraphService.getBoundingClientRect(this)}},{key:"getClientRects",value:function(){return[this.getBoundingClientRect()]}},{key:"computedStyleMap",value:function(){return new Map(Object.entries(this.computedStyle))}},{key:"getAttributeNames",value:function(){return Object.keys(this.attributes)}},{key:"getAttribute",value:function(t){if("symbol"!=typeof t){var e=this.attributes[t];return e}}},{key:"hasAttribute",value:function(t){return this.getAttributeNames().includes(t)}},{key:"hasAttributes",value:function(){return!!this.getAttributeNames().length}},{key:"removeAttribute",value:function(t){this.setAttribute(t,null),delete this.attributes[t]}},{key:"setAttribute",value:function(t,e,n,r){this.attributes[t]=e}},{key:"getAttributeNS",value:function(t,e){throw new Error(Kn)}},{key:"getAttributeNode",value:function(t){throw new Error(Kn)}},{key:"getAttributeNodeNS",value:function(t,e){throw new Error(Kn)}},{key:"hasAttributeNS",value:function(t,e){throw new Error(Kn)}},{key:"removeAttributeNS",value:function(t,e){throw new Error(Kn)}},{key:"removeAttributeNode",value:function(t){throw new Error(Kn)}},{key:"setAttributeNS",value:function(t,e,n){throw new Error(Kn)}},{key:"setAttributeNode",value:function(t){throw new Error(Kn)}},{key:"setAttributeNodeNS",value:function(t){throw new Error(Kn)}},{key:"toggleAttribute",value:function(t,e){throw new Error(Kn)}}])}(Ms);function vl(t){return!(null==t||!t.nodeName)}var ml=ll.globalThis.Proxy?ll.globalThis.Proxy:function(){},yl=new Rs(Ps.ATTR_MODIFIED,null,null,null,null,Rs.MODIFICATION,null,null),bl=g(),xl=zt(),El=function(t){function e(t){var n;return(0,a.Z)(this,e),(n=(0,c.Z)(this,e)).isCustomElement=!1,n.isMutationObserved=!1,n.activeAnimations=[],n.config=t,n.id=t.id||"",n.name=t.name||"",(t.className||t.class)&&(n.className=t.className||t.class),n.nodeName=t.type||Ln.GROUP,t.initialParsedStyle&&Object.assign(n.parsedStyle,t.initialParsedStyle),n.initAttributes(t.style),ll.enableStyleSyntax&&(n.style=new ml({setProperty:function(t,e){n.setAttribute(t,e)},getPropertyValue:function(t){return n.getAttribute(t)},removeProperty:function(t){n.removeAttribute(t)},item:function(){return""}},{get:function(t,e){return void 0!==t[e]?t[e]:n.getAttribute(e)},set:function(t,e,r){return n.setAttribute(e,r),!0}})),n}return(0,u.Z)(e,t),(0,s.Z)(e,[{key:"destroy",value:function(){cn(e,"destroy",this,3)([]),this.getAnimations().forEach((function(t){t.cancel()}))}},{key:"cloneNode",value:function(t,e){var n=(0,o.Z)({},this.attributes);for(var r in n){var i=n[r];vl(i)&&"clipPath"!==r&&"offsetPath"!==r&&"textPath"!==r&&(n[r]=i.cloneNode(t)),e&&(n[r]=e(r,i))}var a=new this.constructor((0,o.Z)((0,o.Z)({},this.config),{},{style:n}));return a.setLocalTransform(this.getLocalTransform()),t&&this.children.forEach((function(e){if(!e.style.isMarker){var n=e.cloneNode(t);a.appendChild(n)}})),a}},{key:"initAttributes",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e={forceUpdateGeometry:!0};ll.styleValueRegistry.processProperties(this,t,e),this.dirty()}},{key:"setAttribute",value:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];Qe(n)||(r||n!==this.attributes[t])&&(this.internalSetAttribute(t,n,{memoize:i}),cn(e,"setAttribute",this,3)([t,n]))}},{key:"internalSetAttribute",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.attributes[t],i=this.parsedStyle[t];ll.styleValueRegistry.processProperties(this,(0,on.Z)({},t,e),n),this.dirty();var o,a,s=this.parsedStyle[t];if(this.isConnected)if(yl.relatedNode=this,yl.prevValue=r,yl.newValue=e,yl.attrName=t,yl.prevParsedValue=i,yl.newParsedValue=s,this.isMutationObserved)this.dispatchEvent(yl);else{var l,c=!0===(null===(l=this.ownerDocument.defaultView.getConfig().future)||void 0===l?void 0:l.experimentalCancelEventPropagation);yl.target=this,this.ownerDocument.defaultView.dispatchEvent(yl,!0,c)}(this.isCustomElement&&this.isConnected||!this.isCustomElement)&&(null===(o=(a=this).attributeChangedCallback)||void 0===o||o.call(a,t,r,e,i,s))}},{key:"getBBox",value:function(){var t=this.getBounds(),e=t.getMin(),n=(0,h.Z)(e,2),r=n[0],i=n[1],o=t.getMax(),a=(0,h.Z)(o,2),s=a[0],l=a[1];return new Xn(r,i,s-r,l-i)}},{key:"setOrigin",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return ll.sceneGraphService.setOrigin(this,tr(t,e,n,!1)),this}},{key:"getOrigin",value:function(){return ll.sceneGraphService.getOrigin(this)}},{key:"setPosition",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return ll.sceneGraphService.setPosition(this,tr(t,e,n,!1)),this}},{key:"setLocalPosition",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return ll.sceneGraphService.setLocalPosition(this,tr(t,e,n,!1)),this}},{key:"translate",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return ll.sceneGraphService.translate(this,tr(t,e,n,!1)),this}},{key:"translateLocal",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return ll.sceneGraphService.translateLocal(this,tr(t,e,n,!1)),this}},{key:"getPosition",value:function(){return ll.sceneGraphService.getPosition(this)}},{key:"getLocalPosition",value:function(){return ll.sceneGraphService.getLocalPosition(this)}},{key:"scale",value:function(t,e,n){return this.scaleLocal(t,e,n)}},{key:"scaleLocal",value:function(t,e,n){return"number"==typeof t&&(t=tr(t,e=e||t,n=n||t,!1)),ll.sceneGraphService.scaleLocal(this,t),this}},{key:"setLocalScale",value:function(t,e,n){return"number"==typeof t&&(t=tr(t,e=e||t,n=n||t,!1)),ll.sceneGraphService.setLocalScale(this,t),this}},{key:"getLocalScale",value:function(){return ll.sceneGraphService.getLocalScale(this)}},{key:"getScale",value:function(){return ll.sceneGraphService.getScale(this)}},{key:"getEulerAngles",value:function(){var t=ar(bl,ll.sceneGraphService.getWorldTransform(this));return ir((0,h.Z)(t,3)[2])}},{key:"getLocalEulerAngles",value:function(){var t=ar(bl,ll.sceneGraphService.getLocalRotation(this));return ir((0,h.Z)(t,3)[2])}},{key:"setEulerAngles",value:function(t){return ll.sceneGraphService.setEulerAngles(this,0,0,t),this}},{key:"setLocalEulerAngles",value:function(t){return ll.sceneGraphService.setLocalEulerAngles(this,0,0,t),this}},{key:"rotateLocal",value:function(t,e,n){return ae(e)&&ae(n)?ll.sceneGraphService.rotateLocal(this,0,0,t):ll.sceneGraphService.rotateLocal(this,t,e,n),this}},{key:"rotate",value:function(t,e,n){return ae(e)&&ae(n)?ll.sceneGraphService.rotate(this,0,0,t):ll.sceneGraphService.rotate(this,t,e,n),this}},{key:"setRotation",value:function(t,e,n,r){return ll.sceneGraphService.setRotation(this,t,e,n,r),this}},{key:"setLocalRotation",value:function(t,e,n,r){return ll.sceneGraphService.setLocalRotation(this,t,e,n,r),this}},{key:"setLocalSkew",value:function(t,e){return ll.sceneGraphService.setLocalSkew(this,t,e),this}},{key:"getRotation",value:function(){return ll.sceneGraphService.getRotation(this)}},{key:"getLocalRotation",value:function(){return ll.sceneGraphService.getLocalRotation(this)}},{key:"getLocalSkew",value:function(){return ll.sceneGraphService.getLocalSkew(this)}},{key:"getLocalTransform",value:function(){return ll.sceneGraphService.getLocalTransform(this)}},{key:"getWorldTransform",value:function(){return ll.sceneGraphService.getWorldTransform(this)}},{key:"setLocalTransform",value:function(t){return ll.sceneGraphService.setLocalTransform(this,t),this}},{key:"resetLocalTransform",value:function(){ll.sceneGraphService.resetLocalTransform(this)}},{key:"getAnimations",value:function(){return this.activeAnimations}},{key:"animate",value:function(t,e){var n,r=null===(n=this.ownerDocument)||void 0===n?void 0:n.timeline;return r?r.play(this,t,e):null}},{key:"isVisible",value:function(){var t;return"hidden"!==(null===(t=this.parsedStyle)||void 0===t?void 0:t.visibility)}},{key:"interactive",get:function(){return this.isInteractive()},set:function(t){this.style.pointerEvents=t?"auto":"none"}},{key:"isInteractive",value:function(){var t;return"none"!==(null===(t=this.parsedStyle)||void 0===t?void 0:t.pointerEvents)}},{key:"isCulled",value:function(){return!(!this.cullable||!this.cullable.enable||this.cullable.visible)}},{key:"toFront",value:function(){return this.parentNode&&(this.style.zIndex=Math.max.apply(Math,(0,l.Z)(this.parentNode.children.map((function(t){return Number(t.style.zIndex)}))))+1),this}},{key:"toBack",value:function(){return this.parentNode&&(this.style.zIndex=Math.min.apply(Math,(0,l.Z)(this.parentNode.children.map((function(t){return Number(t.style.zIndex)}))))-1),this}},{key:"getConfig",value:function(){return this.config}},{key:"attr",value:function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];var i=n[0],o=n[1];return i?nn(i)?(Object.keys(i).forEach((function(e){t.setAttribute(e,i[e])})),this):2===n.length?(this.setAttribute(i,o),this):this.attributes[i]:this.attributes}},{key:"getMatrix",value:function(t){var e=t||this.getWorldTransform(),n=ut(bl,e),r=(0,h.Z)(n,2),i=r[0],o=r[1],a=ht(bl,e),s=(0,h.Z)(a,2),l=s[0],c=s[1],u=dt(xl,e),d=ar(bl,u),f=(0,h.Z)(d,3),p=f[0],g=f[2];return sr(p||g,i,o,l,c)}},{key:"getLocalMatrix",value:function(){return this.getMatrix(this.getLocalTransform())}},{key:"setMatrix",value:function(t){var e=lr(t),n=(0,h.Z)(e,5),r=n[0],i=n[1],o=n[2],a=n[3],s=n[4];this.setEulerAngles(s).setPosition(r,i).setLocalScale(o,a)}},{key:"setLocalMatrix",value:function(t){var e=lr(t),n=(0,h.Z)(e,5),r=n[0],i=n[1],o=n[2],a=n[3],s=n[4];this.setLocalEulerAngles(s).setLocalPosition(r,i).setLocalScale(o,a)}},{key:"show",value:function(){this.forEach((function(t){t.style.visibility="visible"}))}},{key:"hide",value:function(){this.forEach((function(t){t.style.visibility="hidden"}))}},{key:"getCount",value:function(){return this.childElementCount}},{key:"getParent",value:function(){return this.parentElement}},{key:"getChildren",value:function(){return this.children}},{key:"getFirst",value:function(){return this.firstElementChild}},{key:"getLast",value:function(){return this.lastElementChild}},{key:"getChildByIndex",value:function(t){return this.children[t]||null}},{key:"add",value:function(t,e){return this.appendChild(t,e)}},{key:"set",value:function(t,e){this.config[t]=e}},{key:"get",value:function(t){return this.config[t]}},{key:"moveTo",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return this.setPosition(t,e,n),this}},{key:"move",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return this.setPosition(t,e,n),this}},{key:"setZIndex",value:function(t){return this.style.zIndex=t,this}}])}(gl);El.PARSED_STYLE_LIST=new Set(["class","className","clipPath","cursor","display","draggable","droppable","fill","fillOpacity","fillRule","filter","increasedLineWidthForHitTesting","lineCap","lineDash","lineDashOffset","lineJoin","lineWidth","miterLimit","hitArea","offsetDistance","offsetPath","offsetX","offsetY","opacity","pointerEvents","shadowColor","shadowType","shadowBlur","shadowOffsetX","shadowOffsetY","stroke","strokeOpacity","strokeWidth","strokeLinecap","strokeLineJoin","strokeDasharray","strokeDashoffset","transform","transformOrigin","textTransform","visibility","zIndex"]);var wl=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,a.Z)(this,e),(0,c.Z)(this,e,[(0,o.Z)({type:Ln.CIRCLE},t)])}return(0,u.Z)(e,t),(0,s.Z)(e)}(El);wl.PARSED_STYLE_LIST=new Set([].concat((0,l.Z)(El.PARSED_STYLE_LIST),["cx","cy","cz","r","isBillboard","isSizeAttenuation"]));var kl=["style"],Ml=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.style,i=(0,Pn.Z)(n,kl);return(0,a.Z)(this,e),(t=(0,c.Z)(this,e,[(0,o.Z)({style:r},i)])).isCustomElement=!0,t}return(0,u.Z)(e,t),(0,s.Z)(e)}(El);Ml.PARSED_STYLE_LIST=new Set(["class","className","clipPath","cursor","draggable","droppable","opacity","pointerEvents","transform","transformOrigin","zIndex","visibility"]);var Sl=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,a.Z)(this,e),(0,c.Z)(this,e,[(0,o.Z)({type:Ln.ELLIPSE},t)])}return(0,u.Z)(e,t),(0,s.Z)(e)}(El);Sl.PARSED_STYLE_LIST=new Set([].concat((0,l.Z)(El.PARSED_STYLE_LIST),["cx","cy","cz","rx","ry","isBillboard","isSizeAttenuation"])),(function(t){function e(){return(0,a.Z)(this,e),(0,c.Z)(this,e,[{type:Ln.FRAGMENT}])}return(0,u.Z)(e,t),(0,s.Z)(e)}(El)).PARSED_STYLE_LIST=new Set(["class","className"]);var Al=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,a.Z)(this,e),(0,c.Z)(this,e,[(0,o.Z)({type:Ln.GROUP},t)])}return(0,u.Z)(e,t),(0,s.Z)(e)}(El);Al.PARSED_STYLE_LIST=new Set(["class","className","clipPath","cursor","draggable","droppable","opacity","pointerEvents","transform","transformOrigin","zIndex","visibility"]);var Nl=["style"],Cl=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.style,i=(0,Pn.Z)(n,Nl);return(0,a.Z)(this,e),(t=(0,c.Z)(this,e,[(0,o.Z)({type:Ln.HTML,style:r},i)])).cullable.enable=!1,t}return(0,u.Z)(e,t),(0,s.Z)(e,[{key:"getDomElement",value:function(){return this.parsedStyle.$el}},{key:"getClientRects",value:function(){return[this.getBoundingClientRect()]}},{key:"getLocalBounds",value:function(){if(this.parentNode){var t=U(F(),this.parentNode.getWorldTransform()),e=this.getBounds();if(!Wn.isEmpty(e)){var n=new Wn;return n.setFromTransformedAABB(e,t),n}}return this.getBounds()}}])}(El);Cl.PARSED_STYLE_LIST=new Set([].concat((0,l.Z)(El.PARSED_STYLE_LIST),["x","y","$el","innerHTML","width","height"]));var Ol=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,a.Z)(this,e),(0,c.Z)(this,e,[(0,o.Z)({type:Ln.IMAGE},t)])}return(0,u.Z)(e,t),(0,s.Z)(e)}(El);Ol.PARSED_STYLE_LIST=new Set([].concat((0,l.Z)(El.PARSED_STYLE_LIST),["x","y","z","src","width","height","isBillboard","billboardRotation","isSizeAttenuation","keepAspectRatio"]));var Tl=["style"],Pl=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.style,i=(0,Pn.Z)(n,Tl);(0,a.Z)(this,e),(t=(0,c.Z)(this,e,[(0,o.Z)({type:Ln.LINE,style:(0,o.Z)({x1:0,y1:0,x2:0,y2:0,z1:0,z2:0},r)},i)])).markerStartAngle=0,t.markerEndAngle=0;var s=t.parsedStyle,l=s.markerStart,u=s.markerEnd;return l&&vl(l)&&(t.markerStartAngle=l.getLocalEulerAngles(),t.appendChild(l)),u&&vl(u)&&(t.markerEndAngle=u.getLocalEulerAngles(),t.appendChild(u)),t.transformMarker(!0),t.transformMarker(!1),t}return(0,u.Z)(e,t),(0,s.Z)(e,[{key:"attributeChangedCallback",value: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&&vl(r)&&(this.markerStartAngle=0,r.remove()),i&&vl(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t&&(r&&vl(r)&&(this.markerEndAngle=0,r.remove()),i&&vl(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1)))}},{key:"transformMarker",value:function(t){var e=this.parsedStyle,n=e.markerStart,r=e.markerEnd,i=e.markerStartOffset,o=e.markerEndOffset,a=e.x1,s=e.x2,l=e.y1,c=e.y2,u=t?n:r;if(u&&vl(u)){var h,d,f,p,g,v,m;t?(p=a,g=l,d=s-a,f=c-l,v=i||0,m=this.markerStartAngle):(p=s,g=c,d=a-s,f=l-c,v=o||0,m=this.markerEndAngle),h=Math.atan2(f,d),u.setLocalEulerAngles(180*h/Math.PI+m),u.setLocalPosition(p+Math.cos(h)*v,g+Math.sin(h)*v)}}},{key:"getPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.parsedStyle,r=n.x1,i=n.y1,o=n.x2,a=n.y2,s=mn(r,i,o,a,t),l=s.x,c=s.y,u=O(g(),y(l,c,0),e?this.getWorldTransform():this.getLocalTransform());return new qn(u[0],u[1])}},{key:"getPointAtLength",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.getPoint(t/this.getTotalLength(),e)}},{key:"getTotalLength",value:function(){var t=this.parsedStyle;return vn(t.x1,t.y1,t.x2,t.y2)}}])}(El);Pl.PARSED_STYLE_LIST=new Set([].concat((0,l.Z)(El.PARSED_STYLE_LIST),["x1","y1","x2","y2","z1","z2","isBillboard","isSizeAttenuation","markerStart","markerEnd","markerStartOffset","markerEndOffset"]));var Rl=["style"],Dl=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.style,i=(0,Pn.Z)(n,Rl);(0,a.Z)(this,e),(t=(0,c.Z)(this,e,[(0,o.Z)({type:Ln.PATH,style:r,initialParsedStyle:{miterLimit:4,d:(0,o.Z)({},Nr)}},i)])).markerStartAngle=0,t.markerEndAngle=0,t.markerMidList=[];var s=t.parsedStyle,l=s.markerStart,u=s.markerEnd,h=s.markerMid;return l&&vl(l)&&(t.markerStartAngle=l.getLocalEulerAngles(),t.appendChild(l)),h&&vl(h)&&t.placeMarkerMid(h),u&&vl(u)&&(t.markerEndAngle=u.getLocalEulerAngles(),t.appendChild(u)),t.transformMarker(!0),t.transformMarker(!1),t}return(0,u.Z)(e,t),(0,s.Z)(e,[{key:"attributeChangedCallback",value:function(t,e,n,r,i){"d"===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&&vl(r)&&(this.markerStartAngle=0,r.remove()),i&&vl(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&vl(r)&&(this.markerEndAngle=0,r.remove()),i&&vl(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1))):"markerMid"===t&&this.placeMarkerMid(i)}},{key:"transformMarker",value:function(t){var e=this.parsedStyle,n=e.markerStart,r=e.markerEnd,i=e.markerStartOffset,o=e.markerEndOffset,a=t?n:r;if(a&&vl(a)){var s,l,c,u,d,f,p;if(t){var g=this.getStartTangent(),v=(0,h.Z)(g,2),m=v[0],y=v[1];u=y[0],d=y[1],l=m[0]-y[0],c=m[1]-y[1],f=i||0,p=this.markerStartAngle}else{var b=this.getEndTangent(),x=(0,h.Z)(b,2),E=x[0],w=x[1];u=w[0],d=w[1],l=E[0]-w[0],c=E[1]-w[1],f=o||0,p=this.markerEndAngle}s=Math.atan2(c,l),a.setLocalEulerAngles(180*s/Math.PI+p),a.setLocalPosition(u+Math.cos(s)*f,d+Math.sin(s)*f)}}},{key:"placeMarkerMid",value:function(t){var e=this.parsedStyle.d.segments;if(this.markerMidList.forEach((function(t){t.remove()})),t&&vl(t))for(var n=1;n<e.length-1;n++){var r=(0,h.Z)(e[n].currentPoint,2),i=r[0],o=r[1],a=1===n?t:t.cloneNode(!0);this.markerMidList.push(a),this.appendChild(a),a.setLocalPosition(i,o)}}},{key:"getTotalLength",value:function(){return vo(this)}},{key:"getPointAtLength",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.parsedStyle.d.absolutePath,r=rn(n,t),i=r.x,o=r.y,a=O(g(),y(i,o,0),e?this.getWorldTransform():this.getLocalTransform());return new qn(a[0],a[1])}},{key:"getPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.getPointAtLength(t*vo(this),e)}},{key:"getStartTangent",value:function(){var t=this.parsedStyle.d.segments,e=[];if(t.length>1){var n=t[0].currentPoint,r=t[1].currentPoint,i=t[1].startTangent;e=[],i?(e.push([n[0]-i[0],n[1]-i[1]]),e.push([n[0],n[1]])):(e.push([r[0],r[1]]),e.push([n[0],n[1]]))}return e}},{key:"getEndTangent",value:function(){var t=this.parsedStyle.d.segments,e=t.length,n=[];if(e>1){var r=t[e-2].currentPoint,i=t[e-1].currentPoint,o=t[e-1].endTangent;n=[],o?(n.push([i[0]-o[0],i[1]-o[1]]),n.push([i[0],i[1]])):(n.push([r[0],r[1]]),n.push([i[0],i[1]]))}return n}}])}(El);Dl.PARSED_STYLE_LIST=new Set([].concat((0,l.Z)(El.PARSED_STYLE_LIST),["d","markerStart","markerMid","markerEnd","markerStartOffset","markerEndOffset","isBillboard","isSizeAttenuation"]));var Ll=["style"],Il=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.style,i=(0,Pn.Z)(n,Ll);(0,a.Z)(this,e),(t=(0,c.Z)(this,e,[(0,o.Z)({type:Ln.POLYGON,style:r,initialParsedStyle:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!0}},i)])).markerStartAngle=0,t.markerEndAngle=0,t.markerMidList=[];var s=t.parsedStyle,l=s.markerStart,u=s.markerEnd,h=s.markerMid;return l&&vl(l)&&(t.markerStartAngle=l.getLocalEulerAngles(),t.appendChild(l)),h&&vl(h)&&t.placeMarkerMid(h),u&&vl(u)&&(t.markerEndAngle=u.getLocalEulerAngles(),t.appendChild(u)),t.transformMarker(!0),t.transformMarker(!1),t}return(0,u.Z)(e,t),(0,s.Z)(e,[{key:"attributeChangedCallback",value: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&&vl(r)&&(this.markerStartAngle=0,r.remove()),i&&vl(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&vl(r)&&(this.markerEndAngle=0,r.remove()),i&&vl(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1))):"markerMid"===t&&this.placeMarkerMid(i)}},{key:"transformMarker",value:function(t){var e=this.parsedStyle,n=e.markerStart,r=e.markerEnd,i=e.markerStartOffset,o=e.markerEndOffset,a=(e.points||{}).points,s=t?n:r;if(s&&vl(s)&&a){var l,c,u,h,d,f,p;if(h=a[0][0],d=a[0][1],t)c=a[1][0]-a[0][0],u=a[1][1]-a[0][1],f=i||0,p=this.markerStartAngle;else{var g=a.length;this.parsedStyle.isClosed?(c=a[g-1][0]-a[0][0],u=a[g-1][1]-a[0][1]):(h=a[g-1][0],d=a[g-1][1],c=a[g-2][0]-a[g-1][0],u=a[g-2][1]-a[g-1][1]),f=o||0,p=this.markerEndAngle}l=Math.atan2(u,c),s.setLocalEulerAngles(180*l/Math.PI+p),s.setLocalPosition(h+Math.cos(l)*f,d+Math.sin(l)*f)}}},{key:"placeMarkerMid",value:function(t){var e=(this.parsedStyle.points||{}).points;if(this.markerMidList.forEach((function(t){t.remove()})),this.markerMidList=[],t&&vl(t)&&e)for(var n=1;n<(this.parsedStyle.isClosed?e.length:e.length-1);n++){var r=e[n][0],i=e[n][1],o=1===n?t:t.cloneNode(!0);this.markerMidList.push(o),this.appendChild(o),o.setLocalPosition(r,i)}}}])}(El);Il.PARSED_STYLE_LIST=new Set([].concat((0,l.Z)(El.PARSED_STYLE_LIST),["points","markerStart","markerMid","markerEnd","markerStartOffset","markerEndOffset","isClosed","isBillboard","isSizeAttenuation"]));var Bl=["style"],jl=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.style,r=(0,Pn.Z)(t,Bl);return(0,a.Z)(this,e),(0,c.Z)(this,e,[(0,o.Z)({type:Ln.POLYLINE,style:n,initialParsedStyle:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!1}},r)])}return(0,u.Z)(e,t),(0,s.Z)(e,[{key:"getTotalLength",value:function(){return mo(this)}},{key:"getPointAtLength",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.getPoint(t/this.getTotalLength(),e)}},{key:"getPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.parsedStyle.points.points;if(0===this.parsedStyle.points.segments.length){var r,i,o=[],a=0,s=this.getTotalLength();n.forEach((function(t,e){n[e+1]&&((r=[0,0])[0]=a/s,i=vn(t[0],t[1],n[e+1][0],n[e+1][1]),a+=i,r[1]=a/s,o.push(r))})),this.parsedStyle.points.segments=o}var l=0,c=0;this.parsedStyle.points.segments.forEach((function(e,n){t>=e[0]&&t<=e[1]&&(l=(t-e[0])/(e[1]-e[0]),c=n)}));var u=mn(n[c][0],n[c][1],n[c+1][0],n[c+1][1],l),h=u.x,d=u.y,f=O(g(),y(h,d,0),e?this.getWorldTransform():this.getLocalTransform());return new qn(f[0],f[1])}},{key:"getStartTangent",value: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}},{key:"getEndTangent",value: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}}])}(Il);jl.PARSED_STYLE_LIST=new Set([].concat((0,l.Z)(Il.PARSED_STYLE_LIST),["points","markerStart","markerMid","markerEnd","markerStartOffset","markerEndOffset","isBillboard"]));var zl=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,a.Z)(this,e),(0,c.Z)(this,e,[(0,o.Z)({type:Ln.RECT},t)])}return(0,u.Z)(e,t),(0,s.Z)(e)}(El);zl.PARSED_STYLE_LIST=new Set([].concat((0,l.Z)(El.PARSED_STYLE_LIST),["x","y","z","width","height","isBillboard","isSizeAttenuation","radius"]));var Fl=["style"],_l=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.style,r=(0,Pn.Z)(t,Fl);return(0,a.Z)(this,e),(0,c.Z)(this,e,[(0,o.Z)({type:Ln.TEXT,style:(0,o.Z)({fill:"black"},n)},r)])}return(0,u.Z)(e,t),(0,s.Z)(e,[{key:"getComputedTextLength",value:function(){var t;return this.getGeometryBounds(),(null===(t=this.parsedStyle.metrics)||void 0===t?void 0:t.maxLineWidth)||0}},{key:"getLineBoundingRects",value:function(){var t;return this.getGeometryBounds(),(null===(t=this.parsedStyle.metrics)||void 0===t?void 0:t.lineMetrics)||[]}},{key:"isOverflowing",value:function(){return this.getGeometryBounds(),!!this.parsedStyle.isOverflowing}}])}(El);_l.PARSED_STYLE_LIST=new Set([].concat((0,l.Z)(El.PARSED_STYLE_LIST),["x","y","z","isBillboard","billboardRotation","isSizeAttenuation","text","textAlign","textBaseline","fontStyle","fontSize","fontFamily","fontWeight","fontVariant","lineHeight","letterSpacing","leading","wordWrap","wordWrapWidth","maxLines","textOverflow","isOverflowing","textPath","textDecorationLine","textDecorationColor","textDecorationStyle","textPathSide","textPathStartOffset","metrics","dx","dy"]));var Zl=function(){return(0,s.Z)((function t(){(0,a.Z)(this,t),this.registry={},this.define(Ln.CIRCLE,wl),this.define(Ln.ELLIPSE,Sl),this.define(Ln.RECT,zl),this.define(Ln.IMAGE,Ol),this.define(Ln.LINE,Pl),this.define(Ln.GROUP,Al),this.define(Ln.PATH,Dl),this.define(Ln.POLYGON,Il),this.define(Ln.POLYLINE,jl),this.define(Ln.TEXT,_l),this.define(Ln.HTML,Cl)}),[{key:"define",value:function(t,e){this.registry[t]=e}},{key:"get",value:function(t){return this.registry[t]}}])}(),Gl=function(t){function e(){var t;(0,a.Z)(this,e),(t=(0,c.Z)(this,e)).defaultView=null,t.ownerDocument=null,t.nodeName="document";try{t.timeline=new ll.AnimationTimeline(t)}catch(t){}var n={};return $o.forEach((function(t){var e=t.n,r=t.inh,i=t.d;r&&i&&(n[e]=en(i)?i(Ln.GROUP):i)})),t.documentElement=new Al({id:"g-root",style:n}),t.documentElement.ownerDocument=t,t.documentElement.parentNode=t,t.childNodes=[t.documentElement],t}return(0,u.Z)(e,t),(0,s.Z)(e,[{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:"createElement",value:function(t,e){if("svg"===t)return this.documentElement;var n=this.defaultView.customElements.get(t);n||(console.warn("Unsupported tagName: ",t),n="tspan"===t?_l:Al);var r=new n(e);return r.ownerDocument=this,r}},{key:"createElementNS",value:function(t,e,n){return this.createElement(e,n)}},{key:"cloneNode",value:function(t){throw new Error(Kn)}},{key:"destroy",value:function(){try{this.documentElement.destroyChildren(),this.timeline.destroy()}catch(t){}}},{key:"elementsFromBBox",value:function(t,e,n,r){var i=this.defaultView.context.rBushRoot.search({minX:t,minY:e,maxX:n,maxY:r}),o=[];return i.forEach((function(t){var e=t.displayObject,n=e.parsedStyle.pointerEvents,r=["auto","visiblepainted","visiblefill","visiblestroke","visible"].includes(void 0===n?"auto":n);(!r||r&&e.isVisible())&&!e.isCulled()&&e.isInteractive()&&o.push(e)})),o.sort((function(t,e){return e.sortable.renderOrder-t.sortable.renderOrder})),o}},{key:"elementFromPointSync",value:function(t,e){var n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,i=n.y,o=this.defaultView.getConfig(),a=o.width,s=o.height;if(r<0||i<0||r>a||i>s)return null;var l=this.defaultView.viewport2Client({x:r,y:i}),c=l.x,u=l.y,h=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!0,position:{x:t,y:e,viewportX:r,viewportY:i,clientX:c,clientY:u},picked:[]}).picked;return h&&h[0]||this.documentElement}},{key:"elementFromPoint",value:(r=(0,On.Z)((0,Cn.Z)().mark((function t(e,n){var r,i,o,a,s,l,c,u,h,d,f;return(0,Cn.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=this.defaultView.canvas2Viewport({x:e,y:n}),i=r.x,o=r.y,a=this.defaultView.getConfig(),s=a.width,l=a.height,!(i<0||o<0||i>s||o>l)){t.next=1;break}return t.abrupt("return",null);case 1:return c=this.defaultView.viewport2Client({x:i,y:o}),u=c.x,h=c.y,t.next=2,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!0,position:{x:e,y:n,viewportX:i,viewportY:o,clientX:u,clientY:h},picked:[]});case 2:return d=t.sent,f=d.picked,t.abrupt("return",f&&f[0]||this.documentElement);case 3:case"end":return t.stop()}}),t,this)}))),function(t,e){return r.apply(this,arguments)})},{key:"elementsFromPointSync",value:function(t,e){var n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,i=n.y,o=this.defaultView.getConfig(),a=o.width,s=o.height;if(r<0||i<0||r>a||i>s)return[];var l=this.defaultView.viewport2Client({x:r,y:i}),c=l.x,u=l.y,h=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!1,position:{x:t,y:e,viewportX:r,viewportY:i,clientX:c,clientY:u},picked:[]}).picked;return h[h.length-1]!==this.documentElement&&h.push(this.documentElement),h}},{key:"elementsFromPoint",value:(n=(0,On.Z)((0,Cn.Z)().mark((function t(e,n){var r,i,o,a,s,l,c,u,h,d,f;return(0,Cn.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=this.defaultView.canvas2Viewport({x:e,y:n}),i=r.x,o=r.y,a=this.defaultView.getConfig(),s=a.width,l=a.height,!(i<0||o<0||i>s||o>l)){t.next=1;break}return t.abrupt("return",[]);case 1:return c=this.defaultView.viewport2Client({x:i,y:o}),u=c.x,h=c.y,t.next=2,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!1,position:{x:e,y:n,viewportX:i,viewportY:o,clientX:u,clientY:h},picked:[]});case 2:return d=t.sent,(f=d.picked)[f.length-1]!==this.documentElement&&f.push(this.documentElement),t.abrupt("return",f);case 3:case"end":return t.stop()}}),t,this)}))),function(t,e){return n.apply(this,arguments)})},{key:"appendChild",value:function(t,e){throw new Error(Qn)}},{key:"insertBefore",value:function(t,e){throw new Error(Qn)}},{key:"removeChild",value:function(t,e){throw new Error(Qn)}},{key:"replaceChild",value:function(t,e,n){throw new Error(Qn)}},{key:"append",value:function(){throw new Error(Qn)}},{key:"prepend",value:function(){throw new Error(Qn)}},{key:"getElementById",value:function(t){return this.documentElement.getElementById(t)}},{key:"getElementsByName",value:function(t){return this.documentElement.getElementsByName(t)}},{key:"getElementsByTagName",value:function(t){return this.documentElement.getElementsByTagName(t)}},{key:"getElementsByClassName",value:function(t){return this.documentElement.getElementsByClassName(t)}},{key:"querySelector",value:function(t){return this.documentElement.querySelector(t)}},{key:"querySelectorAll",value:function(t){return this.documentElement.querySelectorAll(t)}},{key:"find",value:function(t){return this.documentElement.find(t)}},{key:"findAll",value:function(t){return this.documentElement.findAll(t)}}]);var n,r}(Ms),Vl=function(){function t(e){(0,a.Z)(this,t),this.strategies=e}return(0,s.Z)(t,[{key:"apply",value:function(e){var n=e.config,r=e.camera,i=e.renderingService,o=e.renderingContext,a=this.strategies;i.hooks.cull.tap(t.tag,(function(t){if(t){var e,i=t.cullable;if(0===a.length?i.visible=o.unculledEntities.indexOf(t.entity)>-1:i.visible=a.every((function(e){return e.isVisible(r,t)})),!t.isCulled()&&t.isVisible())return t;var s=!0===(null===(e=n.future)||void 0===e?void 0:e.experimentalCancelEventPropagation);return t.dispatchEvent(new ws(Ps.CULLED),s,s),null}return t})),i.hooks.afterRender.tap(t.tag,(function(t){t.cullable.visibilityPlaneMask=-1}))}}])}();Vl.tag="Culling";var Wl=function(){function t(){var e=this;(0,a.Z)(this,t),this.autoPreventDefault=!1,this.rootPointerEvent=new xs(null),this.rootWheelEvent=new Es(null),this.onPointerMove=function(t){var n,r=null===(n=e.context.renderingContext.root)||void 0===n||null===(n=n.ownerDocument)||void 0===n?void 0:n.defaultView;if(!r.supportsTouchEvents||"touch"!==t.pointerType){var i,o=e.normalizeToPointerEvent(t,r),a=(0,Tn.Z)(o);try{for(a.s();!(i=a.n()).done;){var s=i.value,l=e.bootstrapEvent(e.rootPointerEvent,s,r,t);e.context.eventService.mapEvent(l)}}catch(t){a.e(t)}finally{a.f()}e.setCursor(e.context.eventService.cursor)}},this.onClick=function(t){var n,r,i=null===(n=e.context.renderingContext.root)||void 0===n||null===(n=n.ownerDocument)||void 0===n?void 0:n.defaultView,o=e.normalizeToPointerEvent(t,i),a=(0,Tn.Z)(o);try{for(a.s();!(r=a.n()).done;){var s=r.value,l=e.bootstrapEvent(e.rootPointerEvent,s,i,t);e.context.eventService.mapEvent(l)}}catch(t){a.e(t)}finally{a.f()}e.setCursor(e.context.eventService.cursor)}}return(0,s.Z)(t,[{key:"apply",value:function(e){var n=this;this.context=e;var r=e.renderingService,i=this.context.renderingContext.root.ownerDocument.defaultView;this.context.eventService.setPickHandler((function(t){return n.context.renderingService.hooks.pickSync.call({position:t,picked:[],topmost:!0}).picked[0]||null})),r.hooks.pointerWheel.tap(t.tag,(function(t){var e=n.normalizeWheelEvent(t);n.context.eventService.mapEvent(e)})),r.hooks.pointerDown.tap(t.tag,(function(t){if(!i.supportsTouchEvents||"touch"!==t.pointerType){var e=n.normalizeToPointerEvent(t,i);if(n.autoPreventDefault&&e[0].isNormalized)(t.cancelable||!("cancelable"in t))&&t.preventDefault();var r,o=(0,Tn.Z)(e);try{for(o.s();!(r=o.n()).done;){var a=r.value,s=n.bootstrapEvent(n.rootPointerEvent,a,i,t);n.context.eventService.mapEvent(s)}}catch(t){o.e(t)}finally{o.f()}n.setCursor(n.context.eventService.cursor)}})),r.hooks.pointerUp.tap(t.tag,(function(t){if(!i.supportsTouchEvents||"touch"!==t.pointerType){var e,r=n.context.contextService.getDomElement(),o=n.context.eventService.isNativeEventFromCanvas(r,t)?"":"outside",a=n.normalizeToPointerEvent(t,i),s=(0,Tn.Z)(a);try{for(s.s();!(e=s.n()).done;){var l=e.value,c=n.bootstrapEvent(n.rootPointerEvent,l,i,t);c.type+=o,n.context.eventService.mapEvent(c)}}catch(t){s.e(t)}finally{s.f()}n.setCursor(n.context.eventService.cursor)}})),r.hooks.pointerMove.tap(t.tag,this.onPointerMove),r.hooks.pointerOver.tap(t.tag,this.onPointerMove),r.hooks.pointerOut.tap(t.tag,this.onPointerMove),r.hooks.click.tap(t.tag,this.onClick),r.hooks.pointerCancel.tap(t.tag,(function(t){var e,r=n.normalizeToPointerEvent(t,i),o=(0,Tn.Z)(r);try{for(o.s();!(e=o.n()).done;){var a=e.value,s=n.bootstrapEvent(n.rootPointerEvent,a,i,t);n.context.eventService.mapEvent(s)}}catch(t){o.e(t)}finally{o.f()}n.setCursor(n.context.eventService.cursor)}))}},{key:"bootstrapEvent",value: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 i=this.context.eventService.client2Viewport({x:e.clientX,y:e.clientY}),o=i.x,a=i.y;t.viewport.x=o,t.viewport.y=a;var s=this.context.eventService.viewport2Canvas(t.viewport),l=s.x,c=s.y;return t.canvas.x=l,t.canvas.y=c,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=Ca[t.type]||t.type),t}},{key:"normalizeWheelEvent",value:function(t){var e=this.rootWheelEvent;this.transferMouseData(e,t),e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ;var n=this.context.eventService.client2Viewport({x:t.clientX,y:t.clientY}),r=n.x,i=n.y;e.viewport.x=r,e.viewport.y=i;var o=this.context.eventService.viewport2Canvas(e.viewport),a=o.x,s=o.y;return e.canvas.x=a,e.canvas.y=s,e.global.copyFrom(e.canvas),e.offset.copyFrom(e.canvas),e.nativeEvent=t,e.type=t.type,e}},{key:"transferMouseData",value:function(t,e){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=Oa.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}},{key:"setCursor",value:function(t){this.context.contextService.applyCursorStyle(t||this.context.config.cursor||"default")}},{key:"normalizeToPointerEvent",value: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 if(e.isMouseEvent(t)){var o=t;Qe(o.isPrimary)&&(o.isPrimary=!0),Qe(o.width)&&(o.width=1),Qe(o.height)&&(o.height=1),Qe(o.tiltX)&&(o.tiltX=0),Qe(o.tiltY)&&(o.tiltY=0),Qe(o.pointerType)&&(o.pointerType="mouse"),Qe(o.pointerId)&&(o.pointerId=1),Qe(o.pressure)&&(o.pressure=.5),Qe(o.twist)&&(o.twist=0),Qe(o.tangentialPressure)&&(o.tangentialPressure=0),o.isNormalized=!0,n.push(o)}else n.push(t);return n}}])}();Wl.tag="Event";var Hl=[Ln.CIRCLE,Ln.ELLIPSE,Ln.IMAGE,Ln.RECT,Ln.LINE,Ln.POLYLINE,Ln.POLYGON,Ln.TEXT,Ln.PATH,Ln.HTML],Ul=function(){return(0,s.Z)((function t(){(0,a.Z)(this,t)}),[{key:"isVisible",value:function(t,e){var n,r=e.cullable;if(!r.enable)return!0;var i=e.getRenderBounds();if(Wn.isEmpty(i))return!1;var o=t.getFrustum(),a=null===(n=e.parentNode)||void 0===n||null===(n=n.cullable)||void 0===n?void 0:n.visibilityPlaneMask;return r.visibilityPlaneMask=this.computeVisibilityWithPlaneMask(e,i,a||Un.INDETERMINATE,o.planes),r.visible=r.visibilityPlaneMask!==Un.OUTSIDE,r.visible}},{key:"computeVisibilityWithPlaneMask",value:function(t,e,n,r){if(n===Un.OUTSIDE||n===Un.INSIDE)return n;for(var i=Un.INSIDE,o=Hl.indexOf(t.nodeName)>-1,a=0,s=r.length;a<s;++a){var l=1<<a;if(0!=(n&l)&&(!o||4!==a&&5!==a)){var c=r[a],u=c.normal,h=c.distance;if(A(u,e.getPositiveFarPoint(r[a]))+h<0)return Un.OUTSIDE;A(u,e.getNegativeFarPoint(r[a]))+h<0&&(i|=l)}}return i}}])}(),Yl=function(){function t(){(0,a.Z)(this,t),this.syncTasks=new Map,this.isFirstTimeRendering=!0,this.syncing=!1,this.isFirstTimeRenderingFinished=!1}return(0,s.Z)(t,[{key:"apply",value:function(e){var n,r,i=this,o=e.config,a=e.renderingService,s=e.renderingContext,l=e.rBushRoot,c=s.root.ownerDocument.defaultView;this.rBush=l;var u=function(t){a.dirtify()},h=function(t){i.syncTasks.set(t.target,t.detail.affectChildren),a.dirtify()},d=function(t){var e=t.target;ll.enableSizeAttenuation&&ll.styleValueRegistry.updateSizeAttenuation(e,c.getCamera().getZoom())},f=function(t){var e=t.target,n=e.rBushNode;null!=n&&n.aabb&&i.rBush.remove(n.aabb),i.syncTasks.delete(e),ll.sceneGraphService.dirtyToRoot(e),a.dirtify()};a.hooks.init.tap(t.tag,(function(){c.addEventListener(Ps.MOUNTED,d),c.addEventListener(Ps.UNMOUNTED,f),c.addEventListener(Ps.ATTR_MODIFIED,u),c.addEventListener(Ps.BOUNDS_CHANGED,h)})),a.hooks.destroy.tap(t.tag,(function(){c.removeEventListener(Ps.MOUNTED,d),c.removeEventListener(Ps.UNMOUNTED,f),c.removeEventListener(Ps.ATTR_MODIFIED,u),c.removeEventListener(Ps.BOUNDS_CHANGED,h),i.syncTasks.clear()}));var p=null!==(n=ll.globalThis.requestIdleCallback)&&void 0!==n?n:Za.bind(ll.globalThis),g=!0===(null===(r=o.future)||void 0===r?void 0:r.experimentalRICSyncRTree);a.hooks.endFrame.tap(t.tag,(function(){i.isFirstTimeRendering?(i.isFirstTimeRendering=!1,i.syncing=!0,p((function(){i.syncRTree(!0),i.isFirstTimeRenderingFinished=!0}))):g&&ll.globalThis.requestIdleCallback&&ll.globalThis.cancelIdleCallback?(ll.globalThis.cancelIdleCallback(i.ricSyncRTreeId),i.ricSyncRTreeId=ll.globalThis.requestIdleCallback((function(){return i.syncRTree()}))):i.syncRTree()}))}},{key:"syncNode",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(t.isConnected){var n=t.rBushNode;n.aabb&&this.rBush.remove(n.aabb);var r=t.getRenderBounds();if(r){var i=t.renderable;e&&(i.dirtyRenderBounds||(i.dirtyRenderBounds=new Wn),i.dirtyRenderBounds.update(r.center,r.halfExtents));var o=r.getMin(),a=(0,h.Z)(o,2),s=a[0],l=a[1],c=r.getMax(),u=(0,h.Z)(c,2),d=u[0],f=u[1];n.aabb||(n.aabb={}),n.aabb.displayObject=t,n.aabb.minX=s,n.aabb.minY=l,n.aabb.maxX=d,n.aabb.maxY=f}return n.aabb&&!(isNaN(n.aabb.maxX)||isNaN(n.aabb.maxX)||isNaN(n.aabb.minX)||isNaN(n.aabb.minY))?n.aabb:void 0}}},{key:"syncRTree",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(e||!this.syncing&&0!==this.syncTasks.size){this.syncing=!0;var n=[],r=new Set,i=function(i){if(!r.has(i)&&i.renderable){var o=t.syncNode(i,e);o&&(n.push(o),r.add(i))}};this.syncTasks.forEach((function(t,e){t&&e.forEach(i);for(var n=e;n;)i(n),n=n.parentElement})),this.rBush.load(n),n.length=0,this.syncing=!1}}}])}();Yl.tag="Prepare";var ql=function(t){return t.READY="ready",t.BEFORE_RENDER="beforerender",t.RERENDER="rerender",t.AFTER_RENDER="afterrender",t.BEFORE_DESTROY="beforedestroy",t.AFTER_DESTROY="afterdestroy",t.RESIZE="resize",t.DIRTY_RECTANGLE="dirtyrectangle",t.RENDERER_CHANGED="rendererchanged",t}({}),Xl=new ws(Ps.MOUNTED),Kl=new ws(Ps.UNMOUNTED),Ql=new ws(ql.BEFORE_RENDER),Jl=new ws(ql.RERENDER),$l=new ws(ql.AFTER_RENDER),tc=function(t){function e(t){var n;(0,a.Z)(this,e),(n=(0,c.Z)(this,e)).Element=El,n.inited=!1,n.context={};var r=t.container,i=t.canvas,s=t.renderer,l=t.width,u=t.height,h=t.background,d=t.cursor,f=t.supportsMutipleCanvasesInOneContainer,p=t.cleanUpOnDestroy,g=void 0===p||p,v=t.offscreenCanvas,m=t.devicePixelRatio,y=t.requestAnimationFrame,b=t.cancelAnimationFrame,x=t.createImage,E=t.supportsTouchEvents,w=t.supportsPointerEvents,k=t.isTouchEvent,M=t.isMouseEvent,S=t.dblClickSpeed,A=l,N=u,C=m||ka&&window.devicePixelRatio||1;return C=C>=1?Math.ceil(C):1,i&&(A=l||function(t){var e=Na(t,"width");return"auto"===e?t.offsetWidth:parseFloat(e)}(i)||i.width/C,N=u||function(t){var e=Na(t,"height");return"auto"===e?t.offsetHeight:parseFloat(e)}(i)||i.height/C),n.customElements=new Zl,n.devicePixelRatio=C,n.requestAnimationFrame=null!=y?y:Za.bind(ll.globalThis),n.cancelAnimationFrame=null!=b?b:Ga.bind(ll.globalThis),n.createImage=null!=x?x:function(){return new window.Image},n.supportsTouchEvents=null!=E?E:"ontouchstart"in ll.globalThis,n.supportsPointerEvents=null!=w?w:!!ll.globalThis.PointerEvent,n.isTouchEvent=null!=k?k:function(t){return n.supportsTouchEvents&&t instanceof ll.globalThis.TouchEvent},n.isMouseEvent=null!=M?M:function(t){return!ll.globalThis.MouseEvent||t instanceof ll.globalThis.MouseEvent&&(!n.supportsPointerEvents||!(t instanceof ll.globalThis.PointerEvent))},v&&(ll.offscreenCanvas=v),n.document=new Gl,n.document.defaultView=n,f||function(t,e,n){if(t){var r="string"==typeof t?document.getElementById(t):t;wa.has(r)&&wa.get(r).destroy(n),wa.set(r,e)}}(r,n,g),n.initRenderingContext((0,o.Z)((0,o.Z)({},t),{},{width:A,height:N,background:null!=h?h:"transparent",cursor:null!=d?d:"default",cleanUpOnDestroy:g,devicePixelRatio:C,requestAnimationFrame:n.requestAnimationFrame,cancelAnimationFrame:n.cancelAnimationFrame,createImage:n.createImage,supportsTouchEvents:n.supportsTouchEvents,supportsPointerEvents:n.supportsPointerEvents,isTouchEvent:n.isTouchEvent,isMouseEvent:n.isMouseEvent,dblClickSpeed:null!=S?S:200})),n.initDefaultCamera(A,N,s.clipSpaceNearZ),n.initRenderer(s,!0),n}return(0,u.Z)(e,t),(0,s.Z)(e,[{key:"initRenderingContext",value:function(t){this.context.config=t,this.context.renderingContext={root:this.document.documentElement,unculledEntities:[],renderListCurrentFrame:[],renderReasons:new Set,force:!1,dirty:!1}}},{key:"initDefaultCamera",value:function(t,e,n){var r=this,i=new ll.CameraContribution;i.clipSpaceNearZ=n,i.setType(gr.EXPLORING,vr.DEFAULT).setPosition(t/2,e/2,500).setFocalPoint(t/2,e/2,0).setOrthographic(t/-2,t/2,e/2,e/-2,.1,1e3),i.canvas=this,i.eventEmitter.on(yr,(function(){r.context.renderingContext.renderReasons.add(Ns.CAMERA_CHANGED),ll.enableSizeAttenuation&&r.getConfig().renderer.getConfig().enableSizeAttenuation&&r.updateSizeAttenuation()})),this.context.camera=i}},{key:"updateSizeAttenuation",value:function(){var t=this.getCamera().getZoom();this.document.documentElement.forEach((function(e){ll.styleValueRegistry.updateSizeAttenuation(e,t)}))}},{key:"getConfig",value:function(){return this.context.config}},{key:"getRoot",value:function(){return this.document.documentElement}},{key:"getCamera",value:function(){return this.context.camera}},{key:"getContextService",value:function(){return this.context.contextService}},{key:"getEventService",value:function(){return this.context.eventService}},{key:"getRenderingService",value:function(){return this.context.renderingService}},{key:"getRenderingContext",value:function(){return this.context.renderingContext}},{key:"getStats",value:function(){return this.getRenderingService().getStats()}},{key:"ready",get:function(){var t=this;return this.readyPromise||(this.readyPromise=new Promise((function(e){t.resolveReadyPromise=function(){e(t)}})),this.inited&&this.resolveReadyPromise()),this.readyPromise}},{key:"destroy",value:function(){var t,e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],n=arguments.length>1?arguments[1]:void 0;ci.clearCache();var r=!0===(null===(t=this.getConfig().future)||void 0===t?void 0:t.experimentalCancelEventPropagation);n||this.dispatchEvent(new ws(ql.BEFORE_DESTROY),r,r),this.frameId&&this.cancelAnimationFrame(this.frameId);var i=this.getRoot();e&&(this.unmountChildren(i),this.document.destroy(),this.getEventService().destroy()),this.getRenderingService().destroy(),this.getContextService().destroy(),this.context.rBushRoot&&this.context.rBushRoot.clear(),n||this.dispatchEvent(new ws(ql.AFTER_DESTROY),r,r);var o=function(t){t.currentTarget=null,t.manager=null,t.target=null,t.relatedNode=null};o(Xl),o(Kl),o(Ql),o(Jl),o($l),o(yl),o(dl),o(fl),o(pl),ll.textService.clearCache()}},{key:"changeSize",value:function(t,e){this.resize(t,e)}},{key:"resize",value:function(t,e){var n,r=this.context.config;r.width=t,r.height=e,this.getContextService().resize(t,e);var i=this.context.camera,o=i.getProjectionMode();i.setPosition(t/2,e/2,500).setFocalPoint(t/2,e/2,0),o===mr.ORTHOGRAPHIC?i.setOrthographic(t/-2,t/2,e/2,e/-2,i.getNear(),i.getFar()):i.setAspect(t/e);var a=!0===(null===(n=r.future)||void 0===n?void 0:n.experimentalCancelEventPropagation);this.dispatchEvent(new ws(ql.RESIZE,{width:t,height:e}),a,a)}},{key:"appendChild",value:function(t,e){return this.document.documentElement.appendChild(t,e)}},{key:"insertBefore",value:function(t,e){return this.document.documentElement.insertBefore(t,e)}},{key:"removeChild",value:function(t){return this.document.documentElement.removeChild(t)}},{key:"removeChildren",value:function(){this.document.documentElement.removeChildren()}},{key:"destroyChildren",value:function(){this.document.documentElement.destroyChildren()}},{key:"render",value:function(t){var e,n=this;t&&(Ql.detail=t,$l.detail=t);var r=!0===(null===(e=this.getConfig().future)||void 0===e?void 0:e.experimentalCancelEventPropagation);this.dispatchEvent(Ql,r,r),this.getRenderingService().render(this.getConfig(),t,(function(){n.dispatchEvent(Jl,r,r)})),this.dispatchEvent($l,r,r)}},{key:"run",value:function(){var t=this,e=function(n,r){t.render(r),t.frameId=t.requestAnimationFrame(e)};e()}},{key:"initRenderer",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!t)throw new Error("Renderer is required.");this.inited=!1,this.readyPromise=void 0,this.context.rBushRoot=new Dn,this.context.renderingPlugins=[],this.context.renderingPlugins.push(new Wl,new Yl,new Vl([new Ul])),this.loadRendererContainerModule(t),this.context.contextService=new this.context.ContextService((0,o.Z)((0,o.Z)({},ll),this.context)),this.context.renderingService=new Cs(ll,this.context),this.context.eventService=new Ss(ll,this.context),this.context.eventService.init(),this.context.contextService.init?(this.context.contextService.init(),this.initRenderingService(t,n,!0)):this.context.contextService.initAsync().then((function(){e.initRenderingService(t,n)})).catch((function(t){console.error(t)}))}},{key:"initRenderingService",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.context.renderingService.init((function(){var i;e.inited=!0;var o=!0===(null===(i=e.getConfig().future)||void 0===i?void 0:i.experimentalCancelEventPropagation);n?r?e.requestAnimationFrame((function(){e.dispatchEvent(new ws(ql.READY),o,o)})):e.dispatchEvent(new ws(ql.READY),o,o):e.dispatchEvent(new ws(ql.RENDERER_CHANGED),o,o),e.readyPromise&&e.resolveReadyPromise(),n||e.getRoot().forEach((function(t){var e,n;null===(e=(n=t).dirty)||void 0===e||e.call(n,!0,!0)})),e.mountChildren(e.getRoot()),t.getConfig().enableAutoRendering&&e.run()}))}},{key:"loadRendererContainerModule",value:function(t){var e=this;t.getPlugins().forEach((function(t){t.context=e.context,t.init(ll)}))}},{key:"setRenderer",value:function(t){var e=this.getConfig();if(e.renderer!==t){var n=e.renderer;e.renderer=t,this.destroy(!1,!0),(0,l.Z)((null==n?void 0:n.getPlugins())||[]).reverse().forEach((function(t){t.destroy(ll)})),this.initRenderer(t)}}},{key:"setCursor",value:function(t){this.getConfig().cursor=t,this.getContextService().applyCursorStyle(t)}},{key:"unmountChildren",value:function(t){var e=this;if(t.childNodes.forEach((function(t){e.unmountChildren(t)})),this.inited){if(t.isMutationObserved)t.dispatchEvent(Kl);else{var n,r=!0===(null===(n=this.getConfig().future)||void 0===n?void 0:n.experimentalCancelEventPropagation);Kl.target=t,this.dispatchEvent(Kl,!0,r)}t!==this.document.documentElement&&(t.ownerDocument=null),t.isConnected=!1}t.isCustomElement&&t.disconnectedCallback&&t.disconnectedCallback()}},{key:"mountChildren",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ta(t);if(this.inited){if(!t.isConnected&&(t.ownerDocument=this.document,t.isConnected=!0,!n))if(t.isMutationObserved)t.dispatchEvent(Xl);else{var r,i=!0===(null===(r=this.getConfig().future)||void 0===r?void 0:r.experimentalCancelEventPropagation);Xl.target=t,this.dispatchEvent(Xl,!0,i)}}else 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,n)})),t.isCustomElement&&t.connectedCallback&&t.connectedCallback()}},{key:"mountFragment",value:function(t){this.mountChildren(t,!1)}},{key:"client2Viewport",value:function(t){return this.getEventService().client2Viewport(t)}},{key:"viewport2Client",value:function(t){return this.getEventService().viewport2Client(t)}},{key:"viewport2Canvas",value:function(t){return this.getEventService().viewport2Canvas(t)}},{key:"canvas2Viewport",value:function(t){return this.getEventService().canvas2Viewport(t)}},{key:"getPointByClient",value:function(t,e){return this.client2Viewport({x:t,y:e})}},{key:"getClientByPoint",value:function(t,e){return this.viewport2Client({x:t,y:e})}}])}(ks),ec=function(t){function e(){var t;(0,a.Z)(this,e);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=(0,c.Z)(this,e,[].concat(r))).landmarks=[],t}return(0,u.Z)(e,t),(0,s.Z)(e,[{key:"rotate",value:function(t,e,n){if(this.relElevation=Jn(e),this.relAzimuth=Jn(t),this.relRoll=Jn(n),this.elevation+=this.relElevation,this.azimuth+=this.relAzimuth,this.roll+=this.relRoll,this.type===gr.EXPLORING){var r=Ft(zt(),[1,0,0],nr((this.rotateWorld?1:-1)*this.relElevation)),i=Ft(zt(),[0,1,0],nr((this.rotateWorld?1:-1)*this.relAzimuth)),o=Ft(zt(),[0,0,1],nr(this.relRoll)),a=_t(zt(),i,r);a=_t(zt(),a,o);var s=vt(F(),a);K(this.matrix,this.matrix,[0,0,-this.distance]),X(this.matrix,this.matrix,s),K(this.matrix,this.matrix,[0,0,this.distance])}else{if(Math.abs(this.elevation)>90)return this;this.computeMatrix()}return this._getAxes(),this.type===gr.ORBITING||this.type===gr.EXPLORING?this._getPosition():this.type===gr.TRACKING&&this._getFocalPoint(),this._update(),this}},{key:"pan",value:function(t,e){var n=tr(t,e,0),r=v(this.position);return E(r,r,M(g(),this.right,n[0])),E(r,r,M(g(),this.up,n[1])),this._setPosition(r),this.triggerUpdate(),this}},{key:"dolly",value:function(t){var e=this.forward,n=v(this.position),r=this.dollyingStep,i=this.distance+t*this.dollyingStep;return r=Math.max(Math.min(i,this.maxDistance),this.minDistance)-this.distance,n[0]+=r*e[0],n[1]+=r*e[1],n[2]+=r*e[2],this._setPosition(n),this.type===gr.ORBITING||this.type===gr.EXPLORING?this._getDistance():this.type===gr.TRACKING&&E(this.focalPoint,n,this.distanceVector),this.triggerUpdate(),this}},{key:"cancelLandmarkAnimation",value:function(){void 0!==this.landmarkAnimationID&&this.canvas.cancelAnimationFrame(this.landmarkAnimationID)}},{key:"createLandmark",value:function(t){var e,n,r,i,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=o.position,s=void 0===a?this.position:a,l=o.focalPoint,c=void 0===l?this.focalPoint:l,u=o.roll,h=o.zoom,d=new ll.CameraContribution;d.setType(this.type,void 0),d.setPosition(s[0],null!==(e=s[1])&&void 0!==e?e:this.position[1],null!==(n=s[2])&&void 0!==n?n:this.position[2]),d.setFocalPoint(c[0],null!==(r=c[1])&&void 0!==r?r:this.focalPoint[1],null!==(i=c[2])&&void 0!==i?i:this.focalPoint[2]),d.setRoll(null!=u?u:this.roll),d.setZoom(null!=h?h:this.zoom);var f={name:t,matrix:_(d.getWorldTransform()),right:v(d.right),up:v(d.up),forward:v(d.forward),position:v(d.getPosition()),focalPoint:v(d.getFocalPoint()),distanceVector:v(d.getDistanceVector()),distance:d.getDistance(),dollyingStep:d.getDollyingStep(),azimuth:d.getAzimuth(),elevation:d.getElevation(),roll:d.getRoll(),relAzimuth:d.relAzimuth,relElevation:d.relElevation,relRoll:d.relRoll,zoom:d.getZoom()};return this.landmarks.push(f),f}},{key:"gotoLandmark",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=se(t)?this.landmarks.find((function(e){return e.name===t})):t;if(r){var i=ie(n)?{duration:n}:n,o=i.easing,a=void 0===o?"linear":o,s=i.duration,l=void 0===s?100:s,c=i.easingFunction,u=void 0===c?void 0:c,h=i.onfinish,d=void 0===h?void 0:h,f=i.onframe,p=void 0===f?void 0:f,v=.01;this.cancelLandmarkAnimation();var m,y=r.position,b=r.focalPoint,x=r.zoom,E=r.roll,w=u||ll.EasingFunction(a),k=function(){e.setFocalPoint(b),e.setPosition(y),e.setRoll(E),e.setZoom(x),e.computeMatrix(),e.triggerUpdate(),null==d||d()};if(0===l)return k();var M=function(t){void 0===m&&(m=t);var n=t-m;if(n>=l)k();else{var r,i,o=w(n/l),a=g(),s=g();if(C(a,e.focalPoint,b,o),C(s,e.position,y,o),i=e.roll*(1-o)+E*o,r=e.zoom*(1-o)+x*o,e.setFocalPoint(a),e.setPosition(s),e.setRoll(i),e.setZoom(r),L(a,b)+L(s,y)<=v&&void 0===x&&void 0===E)return k();e.computeMatrix(),e.triggerUpdate(),n<l&&(null==p||p(o),e.landmarkAnimationID=e.canvas.requestAnimationFrame(M))}};this.canvas.requestAnimationFrame(M)}}}])}(xr);ll.CameraContribution=ec;new WeakMap;var nc=function(t){function e(t,n,r,i){var o;return(0,a.Z)(this,e),(o=(0,c.Z)(this,e,[t])).currentTime=r,o.timelineTime=i,o.target=n,o.type="finish",o.bubbles=!1,o.currentTarget=n,o.defaultPrevented=!1,o.eventPhase=o.AT_TARGET,o.timeStamp=Date.now(),o.currentTime=r,o.timelineTime=i,o}return(0,u.Z)(e,t),(0,s.Z)(e)}(ys),rc=0,ic=function(){return(0,s.Z)((function t(e,n){var r;(0,a.Z)(this,t),this.currentTimePending=!1,this._idle=!0,this._paused=!1,this._finishedFlag=!0,this._currentTime=0,this._playbackRate=1,this._inTimeline=!0,this.effect=e,e.animation=this,this.timeline=n,this.id="".concat(rc++),this._inEffect=!!this.effect.update(0),this._totalDuration=Number(null===(r=this.effect)||void 0===r?void 0:r.getComputedTiming().endTime),this._holdTime=0,this._paused=!1,this.oldPlayState="idle",this.updatePromises()}),[{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 t=this;return this.readyPromise||(-1===this.timeline.animationsWithPromises.indexOf(this)&&this.timeline.animationsWithPromises.push(this),this.readyPromise=new Promise((function(e,n){t.resolveReadyPromise=function(){e(t)},t.rejectReadyPromise=function(){n(new Error)}})),this.pending||this.resolveReadyPromise()),this.readyPromise}},{key:"finished",get:function(){var t=this;return this.finishedPromise||(-1===this.timeline.animationsWithPromises.indexOf(this)&&this.timeline.animationsWithPromises.push(this),this.finishedPromise=new Promise((function(e,n){t.resolveFinishedPromise=function(){e(t)},t.rejectFinishedPromise=function(){n(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){if(t=Number(t),!isNaN(t)){var e;if(this.timeline.restart(),!this._paused&&null!==this._startTime)this._startTime=Number(null===(e=this.timeline)||void 0===e?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){if(null!==t){if(this.updatePromises(),t=Number(t),isNaN(t))return;if(this._paused||this._idle)return;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){if(t!==this._playbackRate){this.updatePromises();var 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&&(this._playbackRate>0&&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}},{key:"updatePromises",value:function(){var t;if(null!==(t=this.effect.target)&&void 0!==t&&t.destroyed)return this.readyPromise=void 0,this.finishedPromise=void 0,!1;var e=this.oldPlayState,n=this.pending?"pending":this.playState;return this.readyPromise&&n!==e&&("idle"===n?(this.rejectReadyPromise(),this.readyPromise=void 0):"pending"===e?this.resolveReadyPromise():"pending"===n&&(this.readyPromise=void 0)),this.finishedPromise&&n!==e&&("idle"===n?(this.rejectFinishedPromise(),this.finishedPromise=void 0):"finished"===n?this.resolveFinishedPromise():"finished"===e&&(this.finishedPromise=void 0)),this.oldPlayState=n,this.readyPromise||this.finishedPromise}},{key:"play",value: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()}},{key:"pause",value: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()}},{key:"finish",value:function(){this.updatePromises(),this._idle||(this.currentTime=this._playbackRate>0?this._totalDuration:0,this._startTime=this._totalDuration-this.currentTime,this.currentTimePending=!1,this.timeline.applyDirtiedAnimation(this),this.updatePromises())}},{key:"cancel",value:function(){var t=this;if(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)){var e=new nc(null,this,this.currentTime,null);setTimeout((function(){t.oncancel(e)}))}}},{key:"reverse",value:function(){this.updatePromises();var t=this.currentTime;this.playbackRate*=-1,this.play(),null!==t&&(this.currentTime=t),this.updatePromises()}},{key:"updatePlaybackRate",value:function(t){this.playbackRate=t}},{key:"targetAnimations",value:function(){var t;return(null===(t=this.effect)||void 0===t?void 0:t.target).getAnimations()}},{key:"markTarget",value:function(){var t=this.targetAnimations();-1===t.indexOf(this)&&t.push(this)}},{key:"unmarkTarget",value:function(){var t=this.targetAnimations(),e=t.indexOf(this);-1!==e&&t.splice(e,1)}},{key:"tick",value: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))}},{key:"rewind",value:function(){if(this.playbackRate>=0)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}}},{key:"persist",value:function(){throw new Error(Kn)}},{key:"addEventListener",value:function(t,e,n){throw new Error(Kn)}},{key:"removeEventListener",value:function(t,e,n){throw new Error(Kn)}},{key:"dispatchEvent",value:function(t){throw new Error(Kn)}},{key:"commitStyles",value:function(){throw new Error(Kn)}},{key:"ensureAlive",value:function(){var t,e;this.playbackRate<0&&0===this.currentTime?this._inEffect=!(null===(t=this.effect)||void 0===t||!t.update(-1)):this._inEffect=!(null===(e=this.effect)||void 0===e||!e.update(this.currentTime));this._inTimeline||!this._inEffect&&this._finishedFlag||(this._inTimeline=!0,this.timeline.animations.push(this))}},{key:"tickCurrentTime",value:function(t,e){t!==this._currentTime&&(this._currentTime=t,this._isFinished&&!e&&(this._currentTime=this._playbackRate>0?this._totalDuration:0),this.ensureAlive())}},{key:"fireEvents",value:function(t){var e=this;if(this._isFinished){if(!this._finishedFlag){if(this.onfinish){var n=new nc(null,this,this.currentTime,t);setTimeout((function(){e.onfinish&&e.onfinish(n)}))}this._finishedFlag=!0}}else{if(this.onframe&&"running"===this.playState){var r=new nc(null,this,this.currentTime,t);this.onframe(r)}this._finishedFlag=!1}}}])}(),oc=.1,ac="function"==typeof Float32Array,sc=function(t,e){return 1-3*e+3*t},lc=function(t,e){return 3*e-6*t},cc=function(t){return 3*t},uc=function(t,e,n){return((sc(e,n)*t+lc(e,n))*t+cc(e))*t},hc=function(t,e,n){return 3*sc(e,n)*t*t+2*lc(e,n)*t+cc(e)},dc=function(t,e,n,r){if(!(t>=0&&t<=1&&n>=0&&n<=1))throw new Error("bezier x values must be in [0, 1] range");if(t===e&&n===r)return function(t){return t};for(var i=ac?new Float32Array(11):new Array(11),o=0;o<11;++o)i[o]=uc(o*oc,t,n);var a=function(e){for(var r=0,o=1;10!==o&&i[o]<=e;++o)r+=oc;--o;var a=r+(e-i[o])/(i[o+1]-i[o])*oc,s=hc(a,t,n);return s>=.001?function(t,e,n,r){for(var i=0;i<4;++i){var o=hc(e,n,r);if(0===o)return e;e-=(uc(e,n,r)-t)/o}return e}(e,a,t,n):0===s?a:function(t,e,n,r,i){var o,a,s=0;do{(o=uc(a=e+(n-e)/2,r,i)-t)>0?n=a:e=a}while(Math.abs(o)>1e-7&&++s<10);return a}(e,r,r+oc,t,n)};return function(t){return 0===t||1===t?t:uc(a(t),e,r)}},fc=function(t){return Math.pow(t,2)},pc=function(t){return Math.pow(t,3)},gc=function(t){return Math.pow(t,4)},vc=function(t){return Math.pow(t,5)},mc=function(t){return Math.pow(t,6)},yc=function(t){return 1-Math.cos(t*Math.PI/2)},bc=function(t){return 1-Math.sqrt(1-t*t)},xc=function(t){return t*t*(3*t-2)},Ec=function(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)},wc=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=(0,h.Z)(e,2),r=n[0],i=void 0===r?1:r,o=n[1],a=void 0===o?.5:o,s=le(Number(i),1,10),l=le(Number(a),.1,2);return 0===t||1===t?t:-s*Math.pow(2,10*(t-1))*Math.sin((t-1-l/(2*Math.PI)*Math.asin(1/s))*(2*Math.PI)/l)},kc=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2?arguments[2]:void 0,r=(0,h.Z)(e,4),i=r[0],o=void 0===i?1:i,a=r[1],s=void 0===a?100:a,l=r[2],c=void 0===l?10:l,u=r[3],d=void 0===u?0:u;o=le(o,.1,1e3),s=le(s,.1,1e3),c=le(c,.1,1e3),d=le(d,.1,1e3);var f=Math.sqrt(s/o),p=c/(2*Math.sqrt(s*o)),g=p<1?f*Math.sqrt(1-p*p):0,v=1,m=p<1?(p*f-d)/g:-d+f,y=n?n*t/1e3:t;return y=p<1?Math.exp(-y*p*f)*(v*Math.cos(g*y)+m*Math.sin(g*y)):(v+m*y)*Math.exp(-y*f),0===t||1===t?t:1-y},Mc=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=e,r=(0,h.Z)(n,2),i=r[0],o=void 0===i?10:i,a=r[1],s="start"===a?Math.ceil:Math.floor;return s(le(t,0,1)*o)/o},Sc=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=(0,h.Z)(e,4),r=n[0],i=n[1],o=n[2],a=n[3];return dc(r,i,o,a)(t)},Ac=dc(.42,0,1,1),Nc=function(t){return function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0;return 1-t(1-e,n,r)}},Cc=function(t){return function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0;return e<.5?t(2*e,n,r)/2:1-t(-2*e+2,n,r)/2}},Oc=function(t){return function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0;return e<.5?(1-t(1-2*e,n,r))/2:(t(2*e-1,n,r)+1)/2}},Tc={steps:Mc,"step-start":function(t){return Mc(t,[1,"start"])},"step-end":function(t){return Mc(t,[1,"end"])},linear:function(t){return t},"cubic-bezier":Sc,ease:function(t){return Sc(t,[.25,.1,.25,1])},in:Ac,out:Nc(Ac),"in-out":Cc(Ac),"out-in":Oc(Ac),"in-quad":fc,"out-quad":Nc(fc),"in-out-quad":Cc(fc),"out-in-quad":Oc(fc),"in-cubic":pc,"out-cubic":Nc(pc),"in-out-cubic":Cc(pc),"out-in-cubic":Oc(pc),"in-quart":gc,"out-quart":Nc(gc),"in-out-quart":Cc(gc),"out-in-quart":Oc(gc),"in-quint":vc,"out-quint":Nc(vc),"in-out-quint":Cc(vc),"out-in-quint":Oc(vc),"in-expo":mc,"out-expo":Nc(mc),"in-out-expo":Cc(mc),"out-in-expo":Oc(mc),"in-sine":yc,"out-sine":Nc(yc),"in-out-sine":Cc(yc),"out-in-sine":Oc(yc),"in-circ":bc,"out-circ":Nc(bc),"in-out-circ":Cc(bc),"out-in-circ":Oc(bc),"in-back":xc,"out-back":Nc(xc),"in-out-back":Cc(xc),"out-in-back":Oc(xc),"in-bounce":Ec,"out-bounce":Nc(Ec),"in-out-bounce":Cc(Ec),"out-in-bounce":Oc(Ec),"in-elastic":wc,"out-elastic":Nc(wc),"in-out-elastic":Cc(wc),"out-in-elastic":Oc(wc),spring:kc,"spring-in":kc,"spring-out":Nc(kc),"spring-in-out":Cc(kc),"spring-out-in":Oc(kc)},Pc=function(t){return t};function Rc(t,e){return function(n){if(n>=1)return 1;var r=1/t;return(n+=e*r)-n%r}}var Dc="\\s*(-?\\d+\\.?\\d*|-?\\.\\d+)\\s*",Lc=new RegExp("cubic-bezier\\(".concat(Dc,",").concat(Dc,",").concat(Dc,",").concat(Dc,"\\)")),Ic=/steps\(\s*(\d+)\s*\)/,Bc=/steps\(\s*(\d+)\s*,\s*(start|middle|end)\s*\)/;function jc(t){var e=Lc.exec(t);if(e)return dc.apply(void 0,(0,l.Z)(e.slice(1).map(Number)));var n=Ic.exec(t);if(n)return Rc(Number(n[1]),0);var r=Bc.exec(t);return r?Rc(Number(r[1]),{start:1,middle:.5,end:0}[r[2]]):Tc[function(t){return function(t){return"-"===(t=t.replace(/([A-Z])/g,(function(t){return"-".concat(t.toLowerCase())}))).charAt(0)?t.substring(1):t}(t).replace(/^ease-/,"").replace(/(\(|\s).+/,"").toLowerCase().trim()}(t)]||Tc.linear}function zc(t){return Math.abs(function(t){var e;if(0===t.duration||0===t.iterations)return 0;return("auto"===t.duration?0:Number(t.duration))*(null!==(e=t.iterations)&&void 0!==e?e:1)}(t)/(t.playbackRate||1))}function Fc(t,e,n){var r=function(t,e,n){if(null===e)return 0;var r=n.endTime;return e<Math.min(n.delay,r)?1:e>=Math.min(n.delay+t+n.endDelay,r)?2:3}(t,e,n),i=function(t,e,n,r,i){switch(r){case 1:return"backwards"===e||"both"===e?0:null;case 3:return n-i;case 2:return"forwards"===e||"both"===e?t:null;case 0:return null}}(t,n.fill,e,r,n.delay);if(null===i)return null;var o="auto"===n.duration?0:n.duration,a=function(t,e,n,r,i){var o=i;return 0===t?1!==e&&(o+=n):o+=r/t,o}(o,r,n.iterations,i,n.iterationStart),s=function(t,e,n,r,i,o){var a=t===1/0?e%1:t%1;return 0!==a||2!==n||0===r||0===i&&0!==o||(a=1),a}(a,n.iterationStart,r,n.iterations,i,o),l=function(t,e,n,r){return 2===t&&e===1/0?1/0:1===n?Math.floor(r)-1:Math.floor(r)}(r,n.iterations,s,a),c=function(t,e,n){var r=t;if("normal"!==t&&"reverse"!==t){var i=e;"alternate-reverse"===t&&(i+=1),r="normal",i!==1/0&&i%2!=0&&(r="reverse")}return"normal"===r?n:1-n}(n.direction,l,s);return n.currentIteration=l,n.progress=c,n.easingFunction(c)}function _c(t,e,n){var r=function(t,e){for(var n={},r=0;r<t.length;r++)for(var i in t[r])if(Zc(i)){var o={offset:t[r].offset,computedOffset:t[r].computedOffset,easing:t[r].easing,easingFunction:jc(t[r].easing)||e.easingFunction,value:t[r][i]};n[i]=n[i]||[],n[i].push(o)}return n}(t,e),i=function(t,e){var n=[];for(var r in t)for(var i=t[r],o=0;o<i.length-1;o++){var a=o,s=o+1,l=i[a].computedOffset,c=i[s].computedOffset,u=l,h=c;0===o&&(u=-1/0,0===c&&(s=a)),o===i.length-2&&(h=1/0,1===l&&(a=s)),n.push({applyFrom:u,applyTo:h,startOffset:i[a].computedOffset,endOffset:i[s].computedOffset,easingFunction:i[a].easingFunction,property:r,interpolation:Vc(r,i[a].value,i[s].value,e)})}return n.sort((function(t,e){return t.startOffset-e.startOffset})),n}(r,n);return function(t,e){if(null!==e)i.filter((function(t){return e>=t.applyFrom&&e<t.applyTo})).forEach((function(n){var r=e-n.startOffset,i=n.endOffset-n.startOffset,o=0===i?0:r/i;t.setAttribute(n.property,n.interpolation(o),!1,!1)}));else for(var n in r)Zc(n)&&t.setAttribute(n,null)}}function Zc(t){return"offset"!==t&&"easing"!==t&&"composite"!==t&&"computedOffset"!==t}var Gc=function(t,e,n){return function(r){var i=Wc(t,e,r);return ie(i)?i:n(i)}};function Vc(t,e,n,r){var i=ea[t];if(i&&i.syntax&&i.int){var o=ll.styleValueRegistry.getPropertySyntax(i.syntax);if(o){var a=o.parser,s=a?a(e,r):e,c=a?a(n,r):n,u=o.mixer(s,c,r);if(u){var h=Gc.apply(void 0,(0,l.Z)(u));return function(t){return 0===t?e:1===t?n:h(t)}}}}return Gc(!1,!0,(function(t){return t?n:e}))}function Wc(t,e,n){if("number"==typeof t&&"number"==typeof e)return t*(1-n)+e*n;if("boolean"==typeof t&&"boolean"==typeof e||"string"==typeof t&&"string"==typeof e)return n<.5?t:e;if(Array.isArray(t)&&Array.isArray(e)){for(var r=t.length,i=e.length,o=Math.max(r,i),a=[],s=0;s<o;s++)a.push(Wc(t[s<r?s:r-1],e[s<i?s:i-1],n));return a}throw new Error("Mismatched interpolation arguments ".concat(t,":").concat(e))}var Hc=function(){return(0,s.Z)((function t(){(0,a.Z)(this,t),this.delay=0,this.direction="normal",this.duration="auto",this._easing="linear",this.easingFunction=Pc,this.endDelay=0,this.fill="auto",this.iterationStart=0,this.iterations=1,this.currentIteration=null,this.progress=null}),[{key:"easing",get:function(){return this._easing},set:function(t){this.easingFunction=jc(t),this._easing=t}}])}();function Uc(t,e){if(null===t)return[];Array.isArray(t)||(t=function(t){var e=[];for(var n in t)if(!(n in["easing","offset","composite"])){var r=t[n];Array.isArray(r)||(r=[r]);for(var i=r.length,o=0;o<i;o++){if(!e[o]){var a={};"offset"in t&&(a.offset=Number(t.offset)),"easing"in t&&(a.easing=t.easing),"composite"in t&&(a.composite=t.composite),e[o]=a}void 0!==r[o]&&null!==r[o]&&(e[o][n]=r[o])}}return e.sort((function(t,e){return(t.computedOffset||0)-(e.computedOffset||0)})),e}(t));for(var n=t.map((function(t){var n={};for(var r in null!=e&&e.composite&&(n.composite="auto"),t){var i=t[r];if("offset"===r){if(null!==i){if(i=Number(i),!isFinite(i))throw new Error("Keyframe offsets must be numbers.");if(i<0||i>1)throw new Error("Keyframe offsets must be between 0 and 1.");n.computedOffset=i}}else if("composite"===r&&-1===["replace","add","accumulate","auto"].indexOf(i))throw new Error("".concat(i," compositing is not supported"));n[r]=i}return void 0===n.offset&&(n.offset=null),void 0===n.easing&&(n.easing=(null==e?void 0:e.easing)||"linear"),void 0===n.composite&&(n.composite="auto"),n})),r=!0,i=-1/0,o=0;o<n.length;o++){var a=n[o].offset;if(ae(a))r=!1;else{if(a<i)throw new TypeError("Keyframes are not loosely sorted by offset. Sort or specify offsets.");i=a}}return n=n.filter((function(t){return Number(t.offset)>=0&&Number(t.offset)<=1})),r||function(){var t,e,r=n.length;n[r-1].computedOffset=Number(null!==(t=n[r-1].offset)&&void 0!==t?t:1),r>1&&(n[0].computedOffset=Number(null!==(e=n[0].offset)&&void 0!==e?e:0));for(var i=0,o=Number(n[0].computedOffset),a=1;a<r;a++){var s=n[a].computedOffset;if(!ae(s)&&!ae(o)){for(var l=1;l<a-i;l++)n[i+l].computedOffset=o+(Number(s)-o)*l/(a-i);i=a,o=Number(s)}}}(),n}var Yc="backwards|forwards|both|none".split("|"),qc="reverse|alternate|alternate-reverse".split("|");function Xc(t,e){return function(t,e){var n=new Hc;return e&&(n.fill="both",n.duration="auto"),"number"!=typeof t||isNaN(t)?void 0!==t&&Object.keys(t).forEach((function(e){if(void 0!==t[e]&&null!==t[e]&&"auto"!==t[e]){if(("number"==typeof n[e]||"duration"===e)&&("number"!=typeof t[e]||isNaN(t[e])))return;if("fill"===e&&-1===Yc.indexOf(t[e]))return;if("direction"===e&&-1===qc.indexOf(t[e]))return;n[e]=t[e]}})):n.duration=t,n}(t=function(t){"number"==typeof t&&(t=isNaN(t)?{duration:"auto"}:{duration:t});return t}(null!=t?t:{duration:"auto"}),e)}var Kc=function(){return(0,s.Z)((function t(e,n,r){var i=this;(0,a.Z)(this,t),this.composite="replace",this.iterationComposite="replace",this.target=e,this.timing=Xc(r,!1),this.timing.effect=this,this.timing.activeDuration=zc(this.timing),this.timing.endTime=Math.max(0,this.timing.delay+this.timing.activeDuration+this.timing.endDelay),this.normalizedKeyframes=Uc(n,this.timing),this.interpolations=_c(this.normalizedKeyframes,this.timing,this.target);var o=ll.globalThis.Proxy;this.computedTiming=o?new o(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?i.animation&&i.animation.currentTime||null:"currentIteration"===e?i.animation&&"running"===i.animation.playState?t.currentIteration||0:null:"progress"===e?i.animation&&"running"===i.animation.playState?t.progress||0:null:t[e]},set:function(){return!0}}):this.timing}),[{key:"applyInterpolations",value:function(){this.interpolations(this.target,Number(this.timeFraction))}},{key:"update",value:function(t){return null!==t&&(this.timeFraction=Fc(this.timing.activeDuration,t,this.timing),null!==this.timeFraction)}},{key:"getKeyframes",value:function(){return this.normalizedKeyframes}},{key:"setKeyframes",value:function(t){this.normalizedKeyframes=Uc(t)}},{key:"getComputedTiming",value:function(){return this.computedTiming}},{key:"getTiming",value:function(){return this.timing}},{key:"updateTiming",value:function(t){var e=this;Object.keys(t||{}).forEach((function(n){e.timing[n]=t[n]}))}}])}();function Qc(t,e){return Number(t.id)-Number(e.id)}var Jc=function(){return(0,s.Z)((function t(e){var n=this;(0,a.Z)(this,t),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.webAnimationsNextTick=function(t){n.currentTime=t,n.discardAnimations(),0===n.animations.length?n.timelineTicking=!1:n.requestAnimationFrame(n.webAnimationsNextTick)},this.processRafCallbacks=function(t){var e=n.rafCallbacks;n.rafCallbacks=[],t<Number(n.currentTime)&&(t=Number(n.currentTime)),n.animations.sort(Qc),n.animations=n.tick(t,!0,n.animations)[0],e.forEach((function(e){e[1](t)})),n.applyPendingEffects()},this.document=e}),[{key:"getAnimations",value:function(){return this.discardAnimations(),this.animations.slice()}},{key:"isTicking",value:function(){return this.inTick}},{key:"play",value:function(t,e,n){var r=new Kc(t,e,n),i=new ic(r,this);return this.animations.push(i),this.restartWebAnimationsNextTick(),i.updatePromises(),i.play(),i.updatePromises(),i}},{key:"applyDirtiedAnimation",value:function(t){var e=this;if(!this.inTick){t.markTarget();var n=t.targetAnimations();n.sort(Qc),this.tick(Number(this.currentTime),!1,n.slice())[1].forEach((function(t){var n=e.animations.indexOf(t);-1!==n&&e.animations.splice(n,1)})),this.applyPendingEffects()}}},{key:"restart",value:function(){return this.ticking||(this.ticking=!0,this.requestAnimationFrame((function(){})),this.hasRestartedThisFrame=!0),this.hasRestartedThisFrame}},{key:"destroy",value:function(){this.document.defaultView.cancelAnimationFrame(this.frameId)}},{key:"applyPendingEffects",value:function(){this.pendingEffects.forEach((function(t){null==t||t.applyInterpolations()})),this.pendingEffects=[]}},{key:"updateAnimationsPromises",value:function(){this.animationsWithPromises=this.animationsWithPromises.filter((function(t){return t.updatePromises()}))}},{key:"discardAnimations",value:function(){this.updateAnimationsPromises(),this.animations=this.animations.filter((function(t){return"finished"!==t.playState&&"idle"!==t.playState}))}},{key:"restartWebAnimationsNextTick",value:function(){this.timelineTicking||(this.timelineTicking=!0,this.requestAnimationFrame(this.webAnimationsNextTick))}},{key:"rAF",value: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}},{key:"requestAnimationFrame",value:function(t){var e=this;return this.rAF((function(n){e.updateAnimationsPromises(),t(n),e.updateAnimationsPromises()}))}},{key:"tick",value:function(t,e,n){var r,i,o=this;this.inTick=!0,this.hasRestartedThisFrame=!1,this.currentTime=t,this.ticking=!1;var a=[],s=[],l=[],c=[];return n.forEach((function(n){n.tick(t,e),n._inEffect?(s.push(n.effect),n.markTarget()):(a.push(n.effect),n.unmarkTarget()),n._needsTick&&(o.ticking=!0);var r=n._inEffect||n._needsTick;n._inTimeline=r,r?l.push(n):c.push(n)})),(r=this.pendingEffects).push.apply(r,a),(i=this.pendingEffects).push.apply(i,s),this.ticking&&this.requestAnimationFrame((function(){})),this.inTick=!1,[l,c]}}])}();ll.EasingFunction=jc,ll.AnimationTimeline=Jc;var $c=function(t){return ae(t)?"":t.toString()},tu=function(t){var e=$c(t);return e.charAt(0).toUpperCase()+e.substring(1)},eu=function(t){return"object"==typeof t&&null!==t},nu=function(t){return null!==t&&"function"!=typeof t&&isFinite(t.length)},ru=function(t,e){if(t===e)return!0;if(!t||!e)return!1;if(se(t)||se(e))return!1;if(nu(t)||nu(e)){if(t.length!==e.length)return!1;for(var n=!0,r=0;r<t.length&&(n=ru(t[r],e[r]));r++);return n}if(eu(t)||eu(e)){var i=Object.keys(t),o=Object.keys(e);if(i.length!==o.length)return!1;for(n=!0,r=0;r<i.length&&(n=ru(t[i[r]],e[i[r]]));r++);return n}return!1},iu=ru;const ou={duration:500},au={duration:1e3,easing:"cubic-bezier(0.250, 0.460, 0.450, 0.940)",iterations:1,fill:"both"};var su,lu,cu,uu,hu,du,fu,pu,gu,vu;!function(t){t.NodeAdded="NodeAdded",t.NodeUpdated="NodeUpdated",t.NodeRemoved="NodeRemoved",t.EdgeAdded="EdgeAdded",t.EdgeUpdated="EdgeUpdated",t.EdgeRemoved="EdgeRemoved",t.ComboAdded="ComboAdded",t.ComboUpdated="ComboUpdated",t.ComboRemoved="ComboRemoved"}(su||(su={})),function(t){t.DRAW="draw",t.COLLAPSE="collapse",t.EXPAND="expand",t.TRANSFORM="transform"}(lu||(lu={})),function(t){t.CLICK="canvas:click",t.DBLCLICK="canvas:dblclick",t.POINTER_OVER="canvas:pointerover",t.POINTER_LEAVE="canvas:pointerleave",t.POINTER_ENTER="canvas:pointerenter",t.POINTER_MOVE="canvas:pointermove",t.POINTER_OUT="canvas:pointerout",t.POINTER_DOWN="canvas:pointerdown",t.POINTER_UP="canvas:pointerup",t.CONTEXT_MENU="canvas:contextmenu",t.DRAG_START="canvas:dragstart",t.DRAG="canvas:drag",t.DRAG_END="canvas:dragend",t.DRAG_ENTER="canvas:dragenter",t.DRAG_OVER="canvas:dragover",t.DRAG_LEAVE="canvas:dragleave",t.DROP="canvas:drop",t.WHEEL="canvas:wheel"}(cu||(cu={})),function(t){t.CLICK="combo:click",t.DBLCLICK="combo:dblclick",t.POINTER_OVER="combo:pointerover",t.POINTER_LEAVE="combo:pointerleave",t.POINTER_ENTER="combo:pointerenter",t.POINTER_MOVE="combo:pointermove",t.POINTER_OUT="combo:pointerout",t.POINTER_DOWN="combo:pointerdown",t.POINTER_UP="combo:pointerup",t.CONTEXT_MENU="combo:contextmenu",t.DRAG_START="combo:dragstart",t.DRAG="combo:drag",t.DRAG_END="combo:dragend",t.DRAG_ENTER="combo:dragenter",t.DRAG_OVER="combo:dragover",t.DRAG_LEAVE="combo:dragleave",t.DROP="combo:drop"}(uu||(uu={})),function(t){t.CLICK="click",t.DBLCLICK="dblclick",t.POINTER_OVER="pointerover",t.POINTER_LEAVE="pointerleave",t.POINTER_ENTER="pointerenter",t.POINTER_MOVE="pointermove",t.POINTER_OUT="pointerout",t.POINTER_DOWN="pointerdown",t.POINTER_UP="pointerup",t.CONTEXT_MENU="contextmenu",t.DRAG_START="dragstart",t.DRAG="drag",t.DRAG_END="dragend",t.DRAG_ENTER="dragenter",t.DRAG_OVER="dragover",t.DRAG_LEAVE="dragleave",t.DROP="drop",t.KEY_DOWN="keydown",t.KEY_UP="keyup",t.WHEEL="wheel",t.PINCH="pinch"}(hu||(hu={})),function(t){t.KEY_DOWN="keydown",t.KEY_UP="keyup"}(du||(du={})),function(t){t.CLICK="edge:click",t.DBLCLICK="edge:dblclick",t.POINTER_OVER="edge:pointerover",t.POINTER_LEAVE="edge:pointerleave",t.POINTER_ENTER="edge:pointerenter",t.POINTER_MOVE="edge:pointermove",t.POINTER_OUT="edge:pointerout",t.POINTER_DOWN="edge:pointerdown",t.POINTER_UP="edge:pointerup",t.CONTEXT_MENU="edge:contextmenu",t.DRAG_ENTER="edge:dragenter",t.DRAG_OVER="edge:dragover",t.DRAG_LEAVE="edge:dragleave",t.DROP="edge:drop"}(fu||(fu={})),function(t){t.BEFORE_CANVAS_INIT="beforecanvasinit",t.AFTER_CANVAS_INIT="aftercanvasinit",t.BEFORE_SIZE_CHANGE="beforesizechange",t.AFTER_SIZE_CHANGE="aftersizechange",t.BEFORE_ELEMENT_CREATE="beforeelementcreate",t.AFTER_ELEMENT_CREATE="afterelementcreate",t.BEFORE_ELEMENT_UPDATE="beforeelementupdate",t.AFTER_ELEMENT_UPDATE="afterelementupdate",t.BEFORE_ELEMENT_DESTROY="beforeelementdestroy",t.AFTER_ELEMENT_DESTROY="afterelementdestroy",t.BEFORE_ELEMENT_TRANSLATE="beforeelementtranslate",t.AFTER_ELEMENT_TRANSLATE="afterelementtranslate",t.BEFORE_DRAW="beforedraw",t.AFTER_DRAW="afterdraw",t.BEFORE_RENDER="beforerender",t.AFTER_RENDER="afterrender",t.BEFORE_ANIMATE="beforeanimate",t.AFTER_ANIMATE="afteranimate",t.BEFORE_LAYOUT="beforelayout",t.AFTER_LAYOUT="afterlayout",t.BEFORE_STAGE_LAYOUT="beforestagelayout",t.AFTER_STAGE_LAYOUT="afterstagelayout",t.BEFORE_TRANSFORM="beforetransform",t.AFTER_TRANSFORM="aftertransform",t.BATCH_START="batchstart",t.BATCH_END="batchend",t.BEFORE_DESTROY="beforedestroy",t.AFTER_DESTROY="afterdestroy",t.BEFORE_RENDERER_CHANGE="beforerendererchange",t.AFTER_RENDERER_CHANGE="afterrendererchange"}(pu||(pu={})),function(t){t.UNDO="undo",t.REDO="redo",t.CANCEL="cancel",t.ADD="add",t.CLEAR="clear",t.CHANGE="change"}(gu||(gu={})),function(t){t.CLICK="node:click",t.DBLCLICK="node:dblclick",t.POINTER_OVER="node:pointerover",t.POINTER_LEAVE="node:pointerleave",t.POINTER_ENTER="node:pointerenter",t.POINTER_MOVE="node:pointermove",t.POINTER_OUT="node:pointerout",t.POINTER_DOWN="node:pointerdown",t.POINTER_UP="node:pointerup",t.CONTEXT_MENU="node:contextmenu",t.DRAG_START="node:dragstart",t.DRAG="node:drag",t.DRAG_END="node:dragend",t.DRAG_ENTER="node:dragenter",t.DRAG_OVER="node:dragover",t.DRAG_LEAVE="node:dragleave",t.DROP="node:drop"}(vu||(vu={}));const mu="combo",yu="tree";var bu;!function(t){t.NODE="node",t.EDGE="edge",t.COMBO="combo",t.THEME="theme",t.PALETTE="palette",t.LAYOUT="layout",t.BEHAVIOR="behavior",t.PLUGIN="plugin",t.ANIMATION="animation",t.TRANSFORM="transform",t.SHAPE="shape"}(bu||(bu={}));const xu={animation:{},behavior:{},combo:{},edge:{},layout:{},node:{},palette:{},theme:{},plugin:{},transform:{},shape:{}};function Eu(t,e){var n;const r=null===(n=xu[t])||void 0===n?void 0:n[e];if(r)return r}function wu(t){return`[G6 v5.0.50] ${t}`}const ku={mute:!1,debug:t=>{!ku.mute&&console.debug(wu(t))},info:t=>{!ku.mute&&console.info(wu(t))},warn:t=>{!ku.mute&&console.warn(wu(t))},error:t=>{!ku.mute&&console.error(wu(t))}};function Mu(t){const{theme:e}=t;if(!e)return{};const n=Eu(bu.THEME,e);return n||(ku.warn(`The theme of ${e} is not registered.`),{})}function Su(t,e){if(Array.isArray(t)&&0===t.length)return null;const n=Array.isArray(t)?t[0]:t,r=Array.isArray(t)?t.slice(1):e||[];return new Proxy(n,{get(t,e){return"function"!=typeof t[e]||["onframe","onfinish"].includes(e)?"finished"===e?Promise.all([n.finished,...r.map((t=>t.finished))]):Reflect.get(t,e):(...n)=>{t[e](...n),r.forEach((t=>{var r;return null===(r=t[e])||void 0===r?void 0:r.call(t,...n)}))}},set(t,e,n){return["onframe","onfinish"].includes(e)||r.forEach((t=>{t[e]=n})),Reflect.set(t,e,n)}})}function Au(t){const e=t.reduce(((t,e)=>(Object.entries(e).forEach((([e,n])=>{void 0===t[e]?t[e]=[n]:t[e].push(n)})),t)),{});Object.entries(e).forEach((([n,r])=>{(r.length!==t.length||r.some((t=>ae(t)))||r.every((t=>!["sourceNode","targetNode","childrenNode"].includes(n)&&iu(t,r[0]))))&&delete e[n]}));const n=Object.entries(e).reduce(((t,[e,n])=>(n.forEach(((n,r)=>{t[r]?t[r][e]=n:t[r]={[e]:n}})),t)),[]);return 0!==t.length&&0===n.length&&n.push({_:0},{_:0}),n}function Nu(t){switch(t){case"opacity":return 1;case"x":case"y":case"z":case"zIndex":return 0;case"visibility":return"visible";case"collapsed":return!1;case"states":return[];default:return}}function Cu(t,e){const{animation:n}=t;if(!1===n||!1===e)return!1;const r=Object.assign({},ou);return nn(n)&&Object.assign(r,n),nn(e)&&Object.assign(r,e),r}function Ou(t,e,n,r){var i,o;const{animation:a}=t;if(!1===a||!1===r)return[];const s=null===(i=null==t?void 0:t[e])||void 0===i?void 0:i.animation;if(!1===s)return[];const l=null==s?void 0:s[n];if(!1===l)return[];const c=null===(o=Mu(t)[e])||void 0===o?void 0:o.animation,u=(t=[])=>function(t){if("string"==typeof t){return Eu(bu.ANIMATION,t)||(ku.warn(`The animation of ${t} is not registered.`),[])}return t}(t).map((t=>Object.assign(Object.assign(Object.assign(Object.assign({},au),nn(a)&&a),t),nn(r)&&r)));if(l)return u(l);if(!c)return[];const h=c[n];return!1===h?[]:u(h)}function Tu(t,e,n,r=[]){if(!r&&0===t&&0===e&&0===n)return null;if(Array.isArray(r)){let i=-1;const o=[];for(let a=0;a<r.length;a++){const s=r[a];if("translate"===s[0]){if(s[1]===t&&s[2]===e)return null;i=a,o.push(["translate",t,e])}else if("translate3d"===s[0]){if(s[1]===t&&s[2]===e&&s[3]===n)return null;i=a,o.push(["translate3d",t,e,null!=n?n:0])}else o.push(s)}return-1===i&&o.splice(0,0,ie(n)?["translate3d",t,e,null!=n?n:0]:["translate",t,e]),0===o.length?null:o}const i=r?r.replace(/translate(3d)?\([^)]*\)/g,""):"";return 0===n?`translate(${t}, ${e})${i}`:`translate3d(${t}, ${e}, ${n})${i}`}var Pu=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};const Ru=(t,e,n)=>{if(!n.length)return null;const[r,i]=e;let o;const a=n.map((e=>{var{fields:n,shape:a,states:s}=e,l=Pu(e,["fields","shape","states"]);const c=(e=>{var n;if(e){const o=t.getShape(e);if(!o)return null;const a=`get${tu(e)}Style`,s=(null===(n=null==t?void 0:t[a])||void 0===n?void 0:n.bind(t))||(t=>t);return{shape:o,fromStyle:(null==s?void 0:s(r))||{},toStyle:(null==s?void 0:s(i))||{}}}return{shape:t,fromStyle:r,toStyle:i}})(a);if(!c)return null;const{shape:u,fromStyle:h,toStyle:d}=c,f=[{},{}];if(n.forEach((t=>{var e,n;Object.assign(f[0],{[t]:null!==(e=h[t])&&void 0!==e?e:Nu(t)}),Object.assign(f[1],{[t]:null!==(n=d[t])&&void 0!==n?n:Nu(t)})})),f.some((t=>Object.keys(t).some((t=>["x","y","z"].includes(t)))))){const{x:t=0,y:e=0,z:n,transform:r=""}=u.attributes||{};f.forEach((i=>{var o,a,s;i.transform=Tu(null!==(o=i.x)&&void 0!==o?o:t,null!==(a=i.y)&&void 0!==a?a:e,null!==(s=i.z)&&void 0!==s?s:n,r)}))}const p=u.animate(Au(f),l);return void 0===a&&(o=p),p})).filter(Boolean),s=o||(null==a?void 0:a[0]);return s?Su(s,a.filter((t=>t!=t))):null},Du=[{fields:["x","y"]}],Lu=Du,Iu=[{fields:["sourceNode","targetNode"]}],Bu=Iu,ju=[{fields:["childrenNode","x","y"]}],zu=ju;var Fu=Object.prototype.hasOwnProperty;var _u=function(t,e){if(!e||!Be(t))return{};for(var n,r={},i=en(e)?e:function(t){return t[e]},o=0;o<t.length;o++){var a=t[o];n=i(a),Fu.call(r,n)?r[n].push(a):r[n]=[a]}return r},Zu=function(t,e,n){var r,i,o,a,s=0;n||(n={});var l=function(){s=!1===n.leading?0:Date.now(),r=null,a=t.apply(i,o),r||(i=o=null)},c=function(){var c=Date.now();s||!1!==n.leading||(s=c);var u=e-(c-s);return i=this,o=arguments,u<=0||u>e?(r&&(clearTimeout(r),r=null),s=c,a=t.apply(i,o),r||(i=o=null)):r||!1===n.trailing||(r=setTimeout(l,u)),a};return c.cancel=function(){clearTimeout(r),s=0,r=i=o=null},c},Gu=function(t){if("object"!=typeof t||null===t)return t;var e;if(Be(t)){e=[];for(var n=0,r=t.length;n<r;n++)"object"==typeof t[n]&&null!=t[n]?e[n]=Gu(t[n]):e[n]=t[n]}else for(var i in e={},t)"object"==typeof t[i]&&null!=t[i]?e[i]=Gu(t[i]):e[i]=t[i];return e},Vu=Gu;function Wu(t){return t instanceof Float32Array||!(!Array.isArray(t)||2!==t.length&&3!==t.length)&&t.every((t=>"number"==typeof t))}function Hu(t,e,n){return t>=e&&t<=n}function Uu(t=0){if(Array.isArray(t)){const[e=0,n=e,r=e,i=n]=t;return[e,n,r,i]}return[t,t,t,t]}function Yu(t=0){const e=Uu(t);return e[0]+e[2]}function qu(t){return t.max[0]-t.min[0]}function Xu(t){return t.max[1]-t.min[1]}function Ku(t){return[qu(t),Xu(t)]}function Qu(t,e){const n=Wu(t)?Ju(t):t.getShape("key").getBounds();return e?$u(n,e):n}function Ju(t){const[e,n,r=0]=t,i=new Wn;return i.setMinMax([e,n,r],[e,n,r]),i}function $u(t,e){const[n,r,i,o]=Uu(e),[a,s,l]=t.min,[c,u,h]=t.max,d=new Wn;return d.setMinMax([a-o,s-n,l],[c+r,u+i,h]),d}function th(t){if(0===t.length)return new Wn;if(1===t.length)return t[0];const e=new Wn;e.setMinMax(t[0].min,t[0].max);for(let n=1;n<t.length;n++){const r=t[n];e.setMinMax([Math.min(e.min[0],r.min[0]),Math.min(e.min[1],r.min[1]),Math.min(e.min[2],r.min[2])],[Math.max(e.max[0],r.max[0]),Math.max(e.max[1],r.max[1]),Math.max(e.max[2],r.max[2])])}return e}function eh(t,e){return Hu(t[0],e.min[0],e.max[0])&&Hu(t[1],e.min[1],e.max[1])}function nh(t,e,n=!1){const{min:[r,i],max:[o,a]}=e,s=(t[1]===i||t[1]===a)&&(n||Hu(t[0],r,o)),l=(t[0]===r||t[0]===o)&&(n||Hu(t[1],i,a));return s||l}function rh(t,e){const{center:n}=e;return t[0]===n[0]&&t[1]===n[1]}function ih(t,e){const[n,r]=t,[i,o]=e.min,[a,s]=e.max,l=n-i,c=a-n,u=r-o,h=s-r,d=Math.min(l,c,u,h);return d===l?"left":d===c?"right":d===u?"top":d===h?"bottom":"left"}function oh(t,e){const n=Vu(t);if(eh(t,e)){switch(ih(t,e)){case"left":n[0]=e.min[0];break;case"right":n[0]=e.max[0];break;case"top":n[1]=e.min[1];break;case"bottom":n[1]=e.max[1]}}else{const[r,i]=t,[o,a]=e.min,[s,l]=e.max;n[0]=Hu(r,o,s)?r:r<o?o:s,n[1]=Hu(i,a,l)?i:i<a?a:l}return n}var ah=function(t,e){return t===e},sh=function(){function t(t,e){void 0===e&&(e=null),this.value=t,this.next=e}return t.prototype.toString=function(t){return t?t(this.value):"".concat(this.value)},t}(),lh=function(){function t(t){void 0===t&&(t=ah),this.head=null,this.tail=null,this.compare=t}return t.prototype.prepend=function(t){var e=new sh(t,this.head);return this.head=e,this.tail||(this.tail=e),this},t.prototype.append=function(t){var e=new sh(t);return this.head?(this.tail.next=e,this.tail=e,this):(this.head=e,this.tail=e,this)},t.prototype.delete=function(t){if(!this.head)return null;for(var e=null;this.head&&this.compare(this.head.value,t);)e=this.head,this.head=this.head.next;var n=this.head;if(null!==n)for(;n.next;)this.compare(n.next.value,t)?(e=n.next,n.next=n.next.next):n=n.next;return this.compare(this.tail.value,t)&&(this.tail=n),e},t.prototype.find=function(t){var e=t.value,n=void 0===e?void 0:e,r=t.callback,i=void 0===r?void 0:r;if(!this.head)return null;for(var o=this.head;o;){if(i&&i(o.value))return o;if(void 0!==n&&this.compare(o.value,n))return o;o=o.next}return null},t.prototype.deleteTail=function(){var t=this.tail;if(this.head===this.tail)return this.head=null,this.tail=null,t;for(var e=this.head;e.next;)e.next.next?e=e.next:e.next=null;return this.tail=e,t},t.prototype.deleteHead=function(){if(!this.head)return null;var t=this.head;return this.head.next?this.head=this.head.next:(this.head=null,this.tail=null),t},t.prototype.fromArray=function(t){var e=this;return t.forEach((function(t){return e.append(t)})),this},t.prototype.toArray=function(){for(var t=[],e=this.head;e;)t.push(e),e=e.next;return t},t.prototype.reverse=function(){for(var t=this.head,e=null,n=null;t;)n=t.next,t.next=e,e=t,t=n;this.tail=this.head,this.head=e},t.prototype.toString=function(t){return void 0===t&&(t=void 0),this.toArray().map((function(e){return e.toString(t)})).toString()},t}(),ch=lh,uh=(function(){function t(){this.linkedList=new ch}t.prototype.isEmpty=function(){return!this.linkedList.head},t.prototype.peek=function(){return this.linkedList.head?this.linkedList.head.value:null},t.prototype.enqueue=function(t){this.linkedList.append(t)},t.prototype.dequeue=function(){var t=this.linkedList.deleteHead();return t?t.value:null},t.prototype.toString=function(t){return this.linkedList.toString(t)}}(),function(t,e,n){void 0===e&&(e=[]);var r=e.filter((function(e){return e.source===t||e.target===t}));if("target"===n){return r.filter((function(e){return e.source===t})).map((function(t){return t.target}))}if("source"===n){return r.filter((function(e){return e.target===t})).map((function(t){return t.source}))}return r.map((function(e){return e.source===t?e.target:e.source}))}),hh=function(t,e){return e.filter((function(e){return e.source===t||e.target===t}))};var dh=function(t){var e={},n=t.nodes,r=void 0===n?[]:n,i=t.edges,o=void 0===i?[]:i;return r.forEach((function(t){e[t.id]={degree:0,inDegree:0,outDegree:0}})),o.forEach((function(t){e[t.source].degree++,e[t.source].outDegree++,e[t.target].degree++,e[t.target].inDegree++})),e},fh=dh;var ph={}.toString,gh=function(t,e){return ph.call(t)==="[object "+e+"]"},vh=function(t){return gh(t,"Function")},mh=function(t){return Array.isArray?Array.isArray(t):gh(t,"Array")};var yh=function(t,e){var n,r;if(t)if(mh(t))for(var i=0,o=t.length;i<o&&!1!==e(t[i],i);i++);else if(r=typeof(n=t),null!==n&&"object"===r||"function"===r)for(var a in t)if(t.hasOwnProperty(a)&&!1===e(t[a],a))break};Object.keys;var bh=Array.prototype,xh=(bh.splice,bh.indexOf,Array.prototype.splice,function(t){return gh(t,"String")});Object.prototype.hasOwnProperty;var Eh=function(t){return gh(t,"Number")},wh=(Number.isInteger&&Number.isInteger,Math.PI,Math.PI,Object.values?function(t){return Object.values(t)}:function(t){var e=[];return yh(t,(function(n,r){vh(t)&&"prototype"===r||e.push(n)})),e});Object.prototype;var kh=function(t){if("object"!=typeof t||null===t)return t;var e;if(mh(t)){e=[];for(var n=0,r=t.length;n<r;n++)"object"==typeof t[n]&&null!=t[n]?e[n]=kh(t[n]):e[n]=t[n]}else for(var i in e={},t)"object"==typeof t[i]&&null!=t[i]?e[i]=kh(t[i]):e[i]=t[i];return e},Mh=kh;Object.prototype.hasOwnProperty;Object.prototype.hasOwnProperty,function(t,e){if(!vh(t))throw new TypeError("Expected a function");var n=function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];var o=e?e.apply(this,r):r[0],a=n.cache;if(a.has(o))return a.get(o);var s=t.apply(this,r);return a.set(o,s),s};n.cache=new Map}((function(t,e){void 0===e&&(e={});var n=e.fontSize,r=e.fontFamily,i=e.fontWeight,o=e.fontStyle,a=e.fontVariant;return Sh||(Sh=document.createElement("canvas").getContext("2d")),Sh.font=[o,a,i,n+"px",r].join(" "),Sh.measureText(xh(t)?t:"").width}),(function(t,e){return void 0===e&&(e={}),(0,ce.pr)([t],wh(e)).join("")})),function(){function t(){this.map={}}t.prototype.has=function(t){return void 0!==this.map[t]},t.prototype.get=function(t,e){var n=this.map[t];return void 0===n?e:n},t.prototype.set=function(t,e){this.map[t]=e},t.prototype.clear=function(){this.map={}},t.prototype.delete=function(t){delete this.map[t]},t.prototype.size=function(){return Object.keys(this.map).length}}();var Sh,Ah=function(t,e,n,r){var i=t.nodes,o=void 0===i?[]:i,a=t.edges,s=void 0===a?[]:a,l=[],c={},u={},h={};o.forEach((function(t,n){var r=t.id;l.push(r),u[r]=1/0,r===e&&(u[r]=0)}));for(var d=o.length,f=function(t){var e=function(t,e,n){for(var r,i=1/0,o=0;o<e.length;o++){var a=e[o].id;!n[a]&&t[a]<=i&&(i=t[a],r=e[o])}return r}(u,o,c),i=e.id;if(c[i]=!0,u[i]===1/0)return"continue";var a=[];a=n?function(t,e){return e.filter((function(e){return e.source===t}))}(i,s):hh(i,s),a.forEach((function(t){var n=t.target,o=t.source,a=n===i?o:n,s=r&&t[r]?t[r]:1;u[a]>u[e.id]+s?(u[a]=u[e.id]+s,h[a]=[e.id]):u[a]===u[e.id]+s&&h[a].push(e.id)}))},p=0;p<d;p++)f();h[e]=[e];var g={};for(var v in u)u[v]!==1/0&&Nh(e,v,h,g);var m={};for(var v in g)m[v]=g[v][0];return{length:u,path:m,allPath:g}};function Nh(t,e,n,r){if(t===e)return[t];if(r[e])return r[e];for(var i=[],o=0,a=n[e];o<a.length;o++){var s=Nh(t,a[o],n,r);if(!s)return;for(var l=0,c=s;l<c.length;l++){var u=c[l];mh(u)?i.push((0,ce.ev)((0,ce.ev)([],u,!0),[e],!1)):i.push([u,e])}}return r[e]=i,r[e]}var Ch,Oh=function(t,e,n,r,i){var o=Ah(t,e,r,i),a=o.length,s=o.path,l=o.allPath;return{length:a[n],path:s[n],allPath:l[n]}};!function(){function t(t){this.arr=t}t.prototype.getArr=function(){return this.arr||[]},t.prototype.add=function(e){var n,r=e.arr;if(!(null===(n=this.arr)||void 0===n?void 0:n.length))return new t(r);if(!(null==r?void 0:r.length))return new t(this.arr);if(this.arr.length===r.length){var i=[];for(var o in this.arr)i[o]=this.arr[o]+r[o];return new t(i)}},t.prototype.subtract=function(e){var n,r=e.arr;if(!(null===(n=this.arr)||void 0===n?void 0:n.length))return new t(r);if(!(null==r?void 0:r.length))return new t(this.arr);if(this.arr.length===r.length){var i=[];for(var o in this.arr)i[o]=this.arr[o]-r[o];return new t(i)}},t.prototype.avg=function(e){var n=[];if(0!==e)for(var r in this.arr)n[r]=this.arr[r]/e;return new t(n)},t.prototype.negate=function(){var e=[];for(var n in this.arr)e[n]=-this.arr[n];return new t(e)},t.prototype.squareEuclideanDistance=function(t){var e,n=t.arr;if(!(null===(e=this.arr)||void 0===e?void 0:e.length)||!(null==n?void 0:n.length))return 0;if(this.arr.length===n.length){var r=0;for(var i in this.arr)r+=Math.pow(this.arr[i]-t.arr[i],2);return r}},t.prototype.euclideanDistance=function(t){var e,n=t.arr;if(!(null===(e=this.arr)||void 0===e?void 0:e.length)||!(null==n?void 0:n.length))return 0;if(this.arr.length===n.length){var r=0;for(var i in this.arr)r+=Math.pow(this.arr[i]-t.arr[i],2);return Math.sqrt(r)}console.error("The two vectors are unequal in length.")},t.prototype.normalize=function(){var e=[],n=Mh(this.arr);n.sort((function(t,e){return t-e}));var r=n[n.length-1],i=n[0];for(var o in this.arr)e[o]=(this.arr[o]-i)/(r-i);return new t(e)},t.prototype.norm2=function(){var t;if(!(null===(t=this.arr)||void 0===t?void 0:t.length))return 0;var e=0;for(var n in this.arr)e+=Math.pow(this.arr[n],2);return Math.sqrt(e)},t.prototype.dot=function(t){var e,n=t.arr;if(!(null===(e=this.arr)||void 0===e?void 0:e.length)||!(null==n?void 0:n.length))return 0;if(this.arr.length===n.length){var r=0;for(var i in this.arr)r+=this.arr[i]*t.arr[i];return r}console.error("The two vectors are unequal in length.")},t.prototype.equal=function(t){var e,n=t.arr;if((null===(e=this.arr)||void 0===e?void 0:e.length)!==(null==n?void 0:n.length))return!1;for(var r in this.arr)if(this.arr[r]!==n[r])return!1;return!0}}();!function(t){t.EuclideanDistance="euclideanDistance"}(Ch||(Ch={}));!function(){function t(t){this.count=t.length,this.parent={};for(var e=0,n=t;e<n.length;e++){var r=n[e];this.parent[r]=r}}t.prototype.find=function(t){for(;this.parent[t]!==t;)t=this.parent[t];return t},t.prototype.union=function(t,e){var n=this.find(t),r=this.find(e);n!==r&&(n<r?(this.parent[e]!==e&&this.union(this.parent[e],t),this.parent[e]=this.parent[t]):(this.parent[t]!==t&&this.union(this.parent[t],e),this.parent[t]=this.parent[e]))},t.prototype.connected=function(t,e){return this.find(t)===this.find(e)}}();var Th=function(t,e){return t-e},Ph=(function(){function t(t){void 0===t&&(t=Th),this.compareFn=t,this.list=[]}t.prototype.getLeft=function(t){return 2*t+1},t.prototype.getRight=function(t){return 2*t+2},t.prototype.getParent=function(t){return 0===t?null:Math.floor((t-1)/2)},t.prototype.isEmpty=function(){return this.list.length<=0},t.prototype.top=function(){return this.isEmpty()?void 0:this.list[0]},t.prototype.delMin=function(){var t=this.top(),e=this.list.pop();return this.list.length>0&&(this.list[0]=e,this.moveDown(0)),t},t.prototype.insert=function(t){if(null!==t){this.list.push(t);var e=this.list.length-1;return this.moveUp(e),!0}return!1},t.prototype.moveUp=function(t){for(var e=this.getParent(t);t&&t>0&&this.compareFn(this.list[e],this.list[t])>0;){var n=this.list[e];this.list[e]=this.list[t],this.list[t]=n,t=e,e=this.getParent(t)}},t.prototype.moveDown=function(t){var e,n=t,r=this.getLeft(t),i=this.getRight(t),o=this.list.length;null!==r&&r<o&&this.compareFn(this.list[n],this.list[r])>0?n=r:null!==i&&i<o&&this.compareFn(this.list[n],this.list[i])>0&&(n=i),t!==n&&(e=[this.list[n],this.list[t]],this.list[t]=e[0],this.list[n]=e[1],this.moveDown(n))}}(),function(t,e,n){"number"!=typeof e&&(e=1e-6),"number"!=typeof n&&(n=.85);for(var r,i=1,o=0,a=1e3,s=t.nodes,l=void 0===s?[]:s,c=t.edges,u=void 0===c?[]:c,h=l.length,d={},f={},p=0;p<h;++p){d[v=(E=l[p]).id]=1/h,f[v]=1/h}for(var g=fh(t);a>0&&i>e;){o=0;for(p=0;p<h;++p){var v=(E=l[p]).id;if(r=0,0===g[E.id].inDegree)d[v]=0;else{for(var m=uh(v,u,"source"),y=0;y<m.length;++y){var b=m[y],x=g[b].outDegree;x>0&&(r+=f[b]/x)}d[v]=n*r,o+=d[v]}}o=(1-o)/h,i=0;for(p=0;p<h;++p){var E;r=d[v=(E=l[p]).id]+o,i+=Math.abs(r-f[v]),f[v]=r}a-=1}return f}),Rh="-1",Dh=function(t,e,n,r){void 0===t&&(t=-1),void 0===e&&(e=-1),void 0===n&&(n=-1),void 0===r&&(r="-1"),this.id=t,this.from=e,this.to=n,this.label=r},Lh=function(){function t(t,e){void 0===t&&(t=-1),void 0===e&&(e=Rh),this.id=t,this.label=e,this.edges=[],this.edgeMap={}}return t.prototype.addEdge=function(t){this.edges.push(t),this.edgeMap[t.id]=t},t}(),Ih=function(){function t(t,e,n){void 0===t&&(t=-1),void 0===e&&(e=!0),void 0===n&&(n=!1),this.id=t,this.edgeIdAutoIncrease=e,this.edges=[],this.nodes=[],this.nodeMap={},this.edgeMap={},this.nodeLabelMap={},this.edgeLabelMap={},this.counter=0,this.directed=n}return t.prototype.getNodeNum=function(){return this.nodes.length},t.prototype.addNode=function(t,e){if(!this.nodeMap[t]){var n=new Lh(t,e);this.nodes.push(n),this.nodeMap[t]=n,this.nodeLabelMap[e]||(this.nodeLabelMap[e]=[]),this.nodeLabelMap[e].push(t)}},t.prototype.addEdge=function(t,e,n,r){if((this.edgeIdAutoIncrease||void 0===t)&&(t=this.counter++),!(this.nodeMap[e]&&this.nodeMap[n]&&this.nodeMap[n].edgeMap[t])){var i=new Dh(t,e,n,r);if(this.edges.push(i),this.edgeMap[t]=i,this.nodeMap[e].addEdge(i),this.edgeLabelMap[r]||(this.edgeLabelMap[r]=[]),this.edgeLabelMap[r].push(i),!this.directed){var o=new Dh(t,n,e,r);this.nodeMap[n].addEdge(o),this.edgeLabelMap[r].push(o)}}},t}(),Bh=function(){function t(t,e,n,r,i){this.fromNode=t,this.toNode=e,this.nodeEdgeNodeLabel={nodeLabel1:n||Rh,edgeLabel:r||"-1",nodeLabel2:i||Rh}}return t.prototype.equalTo=function(t){return this.fromNode===t.formNode&&this.toNode===t.toNode&&this.nodeEdgeNodeLabel===t.nodeEdgeNodeLabel},t.prototype.notEqualTo=function(t){return!this.equalTo(t)},t}(),jh=function(){function t(){this.rmpath=[],this.dfsEdgeList=[]}return t.prototype.equalTo=function(t){var e=this.dfsEdgeList.length;if(e!==t.length)return!1;for(var n=0;n<e;n++)if(this.dfsEdgeList[n]!==t[n])return!1;return!0},t.prototype.notEqualTo=function(t){return!this.equalTo(t)},t.prototype.pushBack=function(t,e,n,r,i){return this.dfsEdgeList.push(new Bh(t,e,n,r,i)),this.dfsEdgeList},t.prototype.toGraph=function(t,e){void 0===t&&(t=-1),void 0===e&&(e=!1);var n=new Ih(t,!0,e);return this.dfsEdgeList.forEach((function(t){var e=t.fromNode,r=t.toNode,i=t.nodeEdgeNodeLabel,o=i.nodeLabel1,a=i.edgeLabel,s=i.nodeLabel2;o!==Rh&&n.addNode(e,o),s!==Rh&&n.addNode(r,s),o!==Rh&&s!==o&&n.addEdge(void 0,e,r,a)})),n},t.prototype.buildRmpath=function(){this.rmpath=[];for(var t=void 0,e=this.dfsEdgeList.length-1;e>=0;e--){var n=this.dfsEdgeList[e],r=n.fromNode,i=n.toNode;r<i&&(void 0===t||i===t)&&(this.rmpath.push(e),t=r)}return this.rmpath},t.prototype.getNodeNum=function(){var t={};return this.dfsEdgeList.forEach((function(e){t[e.fromNode]||(t[e.fromNode]=!0),t[e.toNode]||(t[e.toNode]=!0)})),Object.keys(t).length},t}(),zh=function(){function t(t){if(this.his={},this.nodesUsed={},this.edgesUsed={},this.edges=[],t){for(;t;){var e=t.edge;this.edges.push(e),this.nodesUsed[e.from]=1,this.nodesUsed[e.to]=1,this.edgesUsed[e.id]=1,t=t.preNode}this.edges=this.edges.reverse()}}return t.prototype.hasNode=function(t){return 1===this.nodesUsed[t.id]},t.prototype.hasEdge=function(t){return 1===this.edgesUsed[t.id]},t}();(function(){function t(t){var e=t.graphs,n=t.minSupport,r=void 0===n?2:n,i=t.minNodeNum,o=void 0===i?1:i,a=t.maxNodeNum,s=void 0===a?4:a,l=t.top,c=void 0===l?10:l,u=t.directed,h=void 0!==u&&u,d=t.verbose,f=void 0!==d&&d;this.graphs=e,this.dfsCode=new jh,this.support=0,this.frequentSize1Subgraphs=[],this.frequentSubgraphs=[],this.minSupport=r,this.top=c,this.directed=h,this.counter=0,this.maxNodeNum=s,this.minNodeNum=o,this.verbose=f,this.maxNodeNum<this.minNodeNum&&(this.maxNodeNum=this.minNodeNum),this.reportDF=[]}t.prototype.findForwardRootEdges=function(t,e){var n=this,r=[],i=t.nodeMap;return e.edges.forEach((function(t){(n.directed||e.label<=i[t.to].label)&&r.push(t)})),r},t.prototype.findBackwardEdge=function(t,e,n,r){if(!this.directed&&e===n)return null;for(var i=t.nodeMap,o=i[n.to].edges,a=o.length,s=0;s<a;s++){var l=o[s];if(!r.hasEdge(l)&&l.to===e.from)if(this.directed){if(i[e.from].label<i[n.to].label||i[e.from].label===i[n.to].label&&e.label<=l.label)return l}else if(e.label<l.label||e.label===l.label&&i[e.to].label<=i[n.to].label)return l}return null},t.prototype.findForwardPureEdges=function(t,e,n,r){for(var i=[],o=e.to,a=t.nodeMap[o].edges,s=a.length,l=0;l<s;l++){var c=a[l],u=t.nodeMap[c.to];n<=u.label&&!r.hasNode(u)&&i.push(c)}return i},t.prototype.findForwardRmpathEdges=function(t,e,n,r){for(var i=[],o=t.nodeMap,a=o[e.to].label,s=o[e.from].edges,l=s.length,c=0;c<l;c++){var u=s[c],h=o[u.to].label;e.to===u.to||n>h||r.hasNode(o[u.to])||(e.label<u.label||e.label===u.label&&a<=h)&&i.push(u)}return i},t.prototype.getSupport=function(t){var e={};return t.forEach((function(t){e[t.graphId]||(e[t.graphId]=!0)})),Object.keys(e).length},t.prototype.findMinLabel=function(t){var e=void 0;return Object.keys(t).forEach((function(n){var r=t[n],i=r.nodeLabel1,o=r.edgeLabel,a=r.nodeLabel2;e?(i<e.nodeLabel1||i===e.nodeLabel1&&o<e.edgeLabel||i===e.nodeLabel1&&o===e.edgeLabel&&a<e.nodeLabel2)&&(e={nodeLabel1:i,edgeLabel:o,nodeLabel2:a}):e={nodeLabel1:i,edgeLabel:o,nodeLabel2:a}})),e},t.prototype.isMin=function(){var t=this,e=this.dfsCode;if(this.verbose&&console.log("isMin checking",e),1===e.dfsEdgeList.length)return!0;var n=this.directed,r=e.toGraph(-1,n),i=r.nodeMap,o=new jh,a={};r.nodes.forEach((function(e){t.findForwardRootEdges(r,e).forEach((function(t){var n=i[t.to],o="".concat(e.label,"-").concat(t.label,"-").concat(n.label);a[o]||(a[o]={projected:[],nodeLabel1:e.label,edgeLabel:t.label,nodeLabel2:n.label});var s={graphId:r.id,edge:t,preNode:null};a[o].projected.push(s)}))}));var s=this.findMinLabel(a);if(s){o.dfsEdgeList.push(new Bh(0,1,s.nodeLabel1,s.edgeLabel,s.nodeLabel2));var l="".concat(s.nodeLabel1,"-").concat(s.edgeLabel,"-").concat(s.nodeLabel2);return function a(s){for(var l=o.buildRmpath(),c=o.dfsEdgeList[0].nodeEdgeNodeLabel.nodeLabel1,u=o.dfsEdgeList[l[0]].toNode,h={},d=!1,f=0,p=n?-1:0,g=function(e){if(d)return"break";s.forEach((function(n){var i=new zh(n),a=t.findBackwardEdge(r,i.edges[l[e]],i.edges[l[0]],i);a&&(h[a.label]||(h[a.label]={projected:[],edgeLabel:a.label}),h[a.label].projected.push({graphId:r.id,edge:h,preNode:n}),f=o.dfsEdgeList[l[e]].fromNode,d=!0)}))},v=l.length-1;v>p;v--){if("break"===g(v))break}if(d){var m=t.findMinLabel(h);o.dfsEdgeList.push(new Bh(u,f,Rh,m.edgeLabel,Rh));var y=o.dfsEdgeList.length-1;return t.dfsCode.dfsEdgeList[y]===o.dfsEdgeList[y]&&a(h[m.edgeLabel].projected)}var b={};d=!1;var x=0;s.forEach((function(e){var n=new zh(e),o=t.findForwardPureEdges(r,n.edges[l[0]],c,n);o.length>0&&(d=!0,x=u,o.forEach((function(t){var n="".concat(t.label,"-").concat(i[t.to].label);b[n]||(b[n]={projected:[],edgeLabel:t.label,nodeLabel2:i[t.to].label}),b[n].projected.push({graphId:r.id,edge:t,preNode:e})})))}));var E=l.length,w=function(e){if(d)return"break";var n=l[e];s.forEach((function(e){var a=new zh(e),s=t.findForwardRmpathEdges(r,a.edges[n],c,a);s.length>0&&(d=!0,x=o.dfsEdgeList[n].fromNode,s.forEach((function(t){var n="".concat(t.label,"-").concat(i[t.to].label);b[n]||(b[n]={projected:[],edgeLabel:t.label,nodeLabel2:i[t.to].label}),b[n].projected.push({graphId:r.id,edge:t,preNode:e})})))}))};for(v=0;v<E;v++){if("break"===w(v))break}if(!d)return!0;var k=t.findMinLabel(b);o.dfsEdgeList.push(new Bh(x,u+1,Rh,k.edgeLabel,k.nodeLabel2));var M=o.dfsEdgeList.length-1;return e.dfsEdgeList[M]===o.dfsEdgeList[M]&&a(b["".concat(k.edgeLabel,"-").concat(k.nodeLabel2)].projected)}(a[l].projected)}},t.prototype.report=function(){if(!(this.dfsCode.getNodeNum()<this.minNodeNum)){this.counter++;var t=this.dfsCode.toGraph(this.counter,this.directed);this.frequentSubgraphs.push(Mh(t))}},t.prototype.subGraphMining=function(t){var e=this;if(!(this.getSupport(t)<this.minSupport)&&this.isMin()){this.report();var n=this.dfsCode.getNodeNum(),r=this.dfsCode.buildRmpath(),i=this.dfsCode.dfsEdgeList[r[0]].toNode,o=this.dfsCode.dfsEdgeList[0].nodeEdgeNodeLabel.nodeLabel1,a={},s={};t.forEach((function(t){for(var l=e.graphs[t.graphId],c=l.nodeMap,u=new zh(t),h=r.length-1;h>=0;h--){var d=e.findBackwardEdge(l,u.edges[r[h]],u.edges[r[0]],u);if(d){var f="".concat(e.dfsCode.dfsEdgeList[r[h]].fromNode,"-").concat(d.label);s[f]||(s[f]={projected:[],toNodeId:e.dfsCode.dfsEdgeList[r[h]].fromNode,edgeLabel:d.label}),s[f].projected.push({graphId:t.graphId,edge:d,preNode:t})}}if(!(n>=e.maxNodeNum)){e.findForwardPureEdges(l,u.edges[r[0]],o,u).forEach((function(e){var n="".concat(i,"-").concat(e.label,"-").concat(c[e.to].label);a[n]||(a[n]={projected:[],fromNodeId:i,edgeLabel:e.label,nodeLabel2:c[e.to].label}),a[n].projected.push({graphId:t.graphId,edge:e,preNode:t})}));var p=function(n){e.findForwardRmpathEdges(l,u.edges[r[n]],o,u).forEach((function(i){var o="".concat(e.dfsCode.dfsEdgeList[r[n]].fromNode,"-").concat(i.label,"-").concat(c[i.to].label);a[o]||(a[o]={projected:[],fromNodeId:e.dfsCode.dfsEdgeList[r[n]].fromNode,edgeLabel:i.label,nodeLabel2:c[i.to].label}),a[o].projected.push({graphId:t.graphId,edge:i,preNode:t})}))};for(h=0;h<r.length;h++)p(h)}})),Object.keys(s).forEach((function(t){var n=s[t],r=n.toNodeId,o=n.edgeLabel;e.dfsCode.dfsEdgeList.push(new Bh(i,r,"-1",o,"-1")),e.subGraphMining(s[t].projected),e.dfsCode.dfsEdgeList.pop()})),Object.keys(a).forEach((function(t){var n=a[t],r=n.fromNodeId,o=n.edgeLabel,s=n.nodeLabel2;e.dfsCode.dfsEdgeList.push(new Bh(r,i+1,Rh,o,s)),e.subGraphMining(a[t].projected),e.dfsCode.dfsEdgeList.pop()}))}},t.prototype.generate1EdgeFrequentSubGraphs=function(){var t=this.graphs,e=this.directed,n=this.minSupport,r=this.frequentSize1Subgraphs,i={},o={},a={},s={};return Object.keys(t).forEach((function(n){var r=t[n],l=r.nodeMap;r.nodes.forEach((function(t,r){var c=t.label,u="".concat(n,"-").concat(c);if(!a[u]){var h=i[c]||0;h++,i[c]=h}a[u]={graphKey:n,label:c},t.edges.forEach((function(t){var r=c,i=l[t.to].label;if(!e&&r>i){var a=i;i=r,r=a}var u=t.label,h="".concat(n,"-").concat(r,"-").concat(u,"-").concat(i),d="".concat(r,"-").concat(u,"-").concat(i);if(!o[d]){var f=o[d]||0;f++,o[d]=f}s[h]={graphId:n,nodeLabel1:r,edgeLabel:u,nodeLabel2:i}}))}))})),Object.keys(i).forEach((function(t){if(!(i[t]<n)){var e={nodes:[],edges:[]};e.nodes.push({id:"0",label:t}),r.push(e)}})),r},t.prototype.run=function(){var t=this;if(this.frequentSize1Subgraphs=this.generate1EdgeFrequentSubGraphs(),!(this.maxNodeNum<2)){var e=this.graphs,n=(this.directed,{});Object.keys(e).forEach((function(r){var i=e[r],o=i.nodeMap;i.nodes.forEach((function(e){t.findForwardRootEdges(i,e).forEach((function(t){var i=o[t.to],a="".concat(e.label,"-").concat(t.label,"-").concat(i.label);n[a]||(n[a]={projected:[],nodeLabel1:e.label,edgeLabel:t.label,nodeLabel2:i.label});var s={graphId:r,edge:t,preNode:null};n[a].projected.push(s)}))}))})),Object.keys(n).forEach((function(e){var r=n[e],i=r.projected,o=r.nodeLabel1,a=r.edgeLabel,s=r.nodeLabel2;t.dfsCode.dfsEdgeList.push(new Bh(0,1,o,a,s)),t.subGraphMining(i),t.dfsCode.dfsEdgeList.pop()}))}}})(),function(){function t(t){void 0===t&&(t=10),this.linkedList=new ch,this.maxStep=t}Object.defineProperty(t.prototype,"length",{get:function(){return this.linkedList.toArray().length},enumerable:!1,configurable:!0}),t.prototype.isEmpty=function(){return!this.linkedList.head},t.prototype.isMaxStack=function(){return this.toArray().length>=this.maxStep},t.prototype.peek=function(){return this.isEmpty()?null:this.linkedList.head.value},t.prototype.push=function(t){this.linkedList.prepend(t),this.length>this.maxStep&&this.linkedList.deleteTail()},t.prototype.pop=function(){var t=this.linkedList.deleteHead();return t?t.value:null},t.prototype.toArray=function(){return this.linkedList.toArray().map((function(t){return t.value}))},t.prototype.clear=function(){for(;!this.isEmpty();)this.pop()}}();function Fh(t){if(void 0!==t.id)return t.id;if(void 0!==t.source&&void 0!==t.target)return`${t.source}-${t.target}`;throw new Error(wu("The datum does not have available id."))}function _h(t){return t.combo}function Zh(t,e){const n={nodes:(t.nodes||[]).map(Fh),edges:(t.edges||[]).map(Fh),combos:(t.combos||[]).map(Fh)};return e?Object.values(n).flat():n}const Gh=(t,e,n)=>{var r;switch(n.type){case"degree":{const i=new Map;return null===(r=t.nodes)||void 0===r||r.forEach((t=>{const r=e(Fh(t),n.direction).length;i.set(Fh(t),r)})),i}case"betweenness":return Wh(t,n.directed,n.weightPropertyName);case"closeness":return Hh(t,n.directed,n.weightPropertyName);case"eigenvector":return Yh(t,n.directed);case"pagerank":return Uh(t,n.epsilon,n.linkProb);default:return Vh(t)}},Vh=t=>{var e;const n=new Map;return null===(e=t.nodes)||void 0===e||e.forEach((t=>{n.set(Fh(t),0)})),n},Wh=(t,e,n)=>{const r=Vh(t),{nodes:i=[]}=t;return i.forEach((o=>{i.forEach((i=>{if(o!==i){const{allPath:a}=Oh(t,Fh(o),Fh(i),e,n),s=a.length;a.flat().forEach((t=>{t!==Fh(o)&&t!==Fh(i)&&r.set(t,r.get(t)+1/s)}))}}))})),r},Hh=(t,e,n)=>{const r=new Map,{nodes:i=[]}=t;return i.forEach((o=>{const a=i.reduce(((r,i)=>{if(o!==i){const{length:a}=Oh(t,Fh(o),Fh(i),e,n);r+=a}return r}),0);r.set(Fh(o),1/a)})),r},Uh=(t,e,n)=>{var r;const i=new Map,o=Ph(t,e,n);return null===(r=t.nodes)||void 0===r||r.forEach((t=>{i.set(Fh(t),o[Fh(t)])})),i},Yh=(t,e)=>{const{nodes:n=[]}=t,r=qh(t,e),i=Xh(r,n.length),o=new Map;return n.forEach(((t,e)=>{o.set(Fh(t),i[e])})),o},qh=(t,e)=>{const{nodes:n=[],edges:r=[]}=t,i=Array(n.length).fill(null).map((()=>Array(n.length).fill(0)));return r.forEach((({source:t,target:r})=>{const o=n.findIndex((e=>Fh(e)===t)),a=n.findIndex((t=>Fh(t)===r));e?i[o][a]=1:(i[o][a]=1,i[a][o]=1)})),i},Xh=(t,e,n=100,r=1e-6)=>{let i=Array(e).fill(1),o=1/0;for(let a=0;a<n&&o>r;a++){const n=Array(e).fill(0);for(let r=0;r<e;r++)for(let o=0;o<e;o++)n[r]+=t[r][o]*i[o];const r=Math.sqrt(n.reduce(((t,e)=>t+e*e),0));for(let t=0;t<e;t++)n[t]/=r;o=Math.sqrt(n.reduce(((t,e,n)=>t+(e-i[n])*e),0)),i=n}return i};function Kh(t,e,n,r=iu){const i=new Map(t.map((t=>[n(t),t]))),o=new Map(e.map((t=>[n(t),t]))),a=new Set(i.keys()),s=new Set(o.keys()),l=[],c=[],u=[],h=[];return s.forEach((t=>{a.has(t)?r(i.get(t),o.get(t))?h.push(o.get(t)):c.push(o.get(t)):l.push(o.get(t))})),a.forEach((t=>{s.has(t)||u.push(i.get(t))})),{enter:l,exit:u,keep:h,update:c}}function Qh(t,e,n){t.forEach((t=>{(t=>{n&&!n(t)||(t.style.visibility=e)})(t)}))}class Jh{constructor(t){this.extensions=[],this.extensionMap={},this.context=t}setExtensions(t){const e=function(t,e,n){const r={},i=t=>(t in r||(r[t]=0),`${e}-${t}-${r[t]++}`);return n.map((e=>"string"==typeof e?{type:e,key:i(e)}:"function"==typeof e?e.call(t):e.key?e:Object.assign(Object.assign({},e),{key:i(e.type)})))}(this.context.graph,this.category,t),{enter:n,update:r,exit:i,keep:o}=Kh(this.extensions,e,(t=>t.key));this.createExtensions(n),this.updateExtensions([...r,...o]),this.destroyExtensions(i),this.extensions=e}createExtension(t){const{category:e}=this,{key:n,type:r}=t,i=Eu(e,r);if(!i)return ku.warn(`The extension ${r} of ${e} is not registered.`);const o=new i(this.context,t);o.initialized=!0,this.extensionMap[n]=o}createExtensions(t){t.forEach((t=>this.createExtension(t)))}updateExtension(t){const{key:e}=t,n=this.extensionMap[e];n&&n.update(t)}updateExtensions(t){t.forEach((t=>this.updateExtension(t)))}destroyExtension(t){const e=this.extensionMap[t];e&&(e.initialized&&!e.destroyed&&e.destroy(),delete this.extensionMap[t])}destroyExtensions(t){t.forEach((({key:t})=>this.destroyExtension(t)))}destroy(){this.destroyExtensions(this.extensions),this.context={},this.extensions=[],this.extensionMap={}}}class $h{constructor(t,e){this.events=[],this.initialized=!1,this.destroyed=!1,this.context=t,this.options=e}update(t){this.options=Object.assign(this.options,t)}destroy(){this.context={},this.options={},this.destroyed=!0}}class td extends $h{}class ed extends td{constructor(t,e){super(t,Object.assign({},ed.defaultOptions,e)),this.isOverlapping=(t,e)=>e.some((e=>t.intersects(e))),this.occupiedBounds=[],this.detectLabelCollision=t=>{const e=this.context.viewport,n={show:[],hide:[]};return this.occupiedBounds=[],t.forEach((t=>{const r=t.getShape("label").getRenderBounds();e.isInViewport(r,!0)&&!this.isOverlapping(r,this.occupiedBounds)?(n.show.push(t),this.occupiedBounds.push($u(r,this.options.padding))):n.hide.push(t)})),n},this.hideLabelIfExceedViewport=(t,e)=>{const{exit:n}=Kh(t,e,(t=>t.id));null==n||n.forEach(this.hideLabel)},this.nodeCentralities=new Map,this.sortNodesByCentrality=(t,e)=>{const{model:n}=this.context,r=n.getData(),i=n.getRelatedEdgesData.bind(n);return t.map((t=>(this.nodeCentralities.has(t.id)||(this.nodeCentralities=Gh(r,i,e)),{node:t,centrality:this.nodeCentralities.get(t.id)}))).sort(((t,e)=>e.centrality-t.centrality)).map((t=>t.node))},this.sortLabelElementsInView=t=>{const{sort:e,sortNode:n,sortCombo:r,sortEdge:i}=this.options,{model:o}=this.context;if(en(e))return t.sort(((t,n)=>e(o.getElementDataById(t.id),o.getElementDataById(n.id))));const{node:a=[],edge:s=[],combo:l=[]}=_u(t,(t=>t.type)),c=en(r)?l.sort(((t,e)=>r(...o.getComboData([t.id,e.id])))):l,u=en(n)?a.sort(((t,e)=>n(...o.getNodeData([t.id,e.id])))):this.sortNodesByCentrality(a,n),h=en(i)?s.sort(((t,e)=>i(...o.getEdgeData([t.id,e.id])))):s;return[...c,...u,...h]},this.labelElementsInView=[],this.isFirstRender=!0,this.onToggleVisibility=t=>{var e;if("zIndex"===(null===(e=t.data)||void 0===e?void 0:e.stage))return;if(!this.validate(t))return void(this.hiddenElements.size>0&&(this.hiddenElements.forEach(this.showLabel),this.hiddenElements.clear()));const n=this.isFirstRender?this.getLabelElements():this.getLabelElementsInView();this.hideLabelIfExceedViewport(this.labelElementsInView,n),this.labelElementsInView=n;const r=this.sortLabelElementsInView(this.labelElementsInView),{show:i,hide:o}=this.detectLabelCollision(r);for(let t=i.length-1;t>=0;t--)this.showLabel(i[t]);o.forEach(this.hideLabel)},this.hiddenElements=new Map,this.hideLabel=t=>{const e=t.getShape("label");e&&Qh(e,"hidden"),this.hiddenElements.set(t.id,t)},this.showLabel=t=>{const e=t.getShape("label");e&&Qh(e,"visible"),t.toFront(),this.hiddenElements.delete(t.id)},this.onTransform=Zu(this.onToggleVisibility,this.options.throttle,{leading:!0}),this.enableToggle=!0,this.toggle=t=>{this.enableToggle&&this.onToggleVisibility(t)},this.onBeforeRender=()=>{this.enableToggle=!1},this.onAfterRender=t=>{this.onToggleVisibility(t),this.enableToggle=!0},this.bindEvents()}update(t){this.unbindEvents(),super.update(t),this.bindEvents(),this.onToggleVisibility({})}getLabelElements(){const{elementMap:t}=this.context.element,e=[];for(const n in t){const r=t[n];r.isVisible()&&r.getShape("label")&&e.push(r)}return e}getLabelElementsInView(){const t=this.context.viewport;return this.getLabelElements().filter((e=>t.isInViewport(e.getShape("key").getRenderBounds())))}bindEvents(){const{graph:t}=this.context;t.on(pu.BEFORE_RENDER,this.onBeforeRender),t.on(pu.AFTER_RENDER,this.onAfterRender),t.on(pu.AFTER_DRAW,this.toggle),t.on(pu.AFTER_LAYOUT,this.toggle),t.on(pu.AFTER_TRANSFORM,this.onTransform)}unbindEvents(){const{graph:t}=this.context;t.off(pu.BEFORE_RENDER,this.onBeforeRender),t.off(pu.AFTER_RENDER,this.onAfterRender),t.off(pu.AFTER_DRAW,this.toggle),t.off(pu.AFTER_LAYOUT,this.toggle),t.off(pu.AFTER_TRANSFORM,this.onTransform)}validate(t){if(this.destroyed)return!1;const{enable:e}=this.options;return en(e)?e(t):!!e}destroy(){this.unbindEvents(),super.destroy()}}ed.defaultOptions={enable:!0,throttle:100,padding:0,sortNode:{type:"degree"}};var nd=function(t){if(!eu(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};function rd(t,e){if(Object.hasOwn)return Object.hasOwn(t,e);if(null==t)throw new TypeError("Cannot convert undefined or null to object");return Object.prototype.hasOwnProperty.call(Object(t),e)}function id(t,e,n,r){for(var i in n=n||0,r=r||5,e)if(rd(e,i)){var o=e[i];null!==o&&nd(o)?(nd(t[i])||(t[i]={}),n<r?id(t[i],o,n+1,r):t[i]=e[i]):Be(o)?(t[i]=[],t[i]=t[i].concat(o)):void 0!==o&&(t[i]=o)}}var od=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)id(t,e[r]);return t};const ad=[0,0,0];function sd(t,e){return t.map(((t,n)=>t+e[n]))}function ld(t,e){return t.map(((t,n)=>t-e[n]))}function cd(t,e){return"number"==typeof e?t.map((t=>t*e)):t.map(((t,n)=>t*e[n]))}function ud(t,e){return"number"==typeof e?t.map((t=>t/e)):t.map(((t,n)=>t/e[n]))}function hd(t,e){return t.map((t=>t*e))}function dd(t,e){return Math.sqrt(t.reduce(((t,n,r)=>t+Math.pow(n-e[r]||0,2)),0))}function fd(t,e){return t.reduce(((t,n,r)=>t+Math.abs(n-e[r])),0)}function pd(t){const e=t.reduce(((t,e)=>t+Math.pow(e,2)),0);return t.map((t=>t/Math.sqrt(e)))}function gd(t,e,n=!1){const r=t[0]*e[1]-t[1]*e[0];let i=Math.acos(cd(t,e).reduce(((t,e)=>t+e),0)/(dd(t,ad)*dd(e,ad)));return n&&r<0&&(i=2*Math.PI-i),i}function vd(t,e=!0){return e?[-t[1],t[0]]:[t[1],-t[0]]}function md(t,e){return t.map((t=>t%e))}function yd(t){return[t[0],t[1]]}function bd(t){return function(t){return 2===t.length}(t)?[t[0],t[1],0]:t}function xd(t){const[e,n]=t;return e||n?Math.atan2(n,e):0}function Ed(t,e){const[n,r]=t;if(e%360==0)return[n,r];const i=e*Math.PI/180,o=Math.cos(i),a=Math.sin(i);return[n*o-r*a,n*a+r*o]}function wd(t,e){const[n,r]=t,[i,o]=e;return function(t,e){const n=bd(t),r=bd(e);return[n[1]*r[2]-n[2]*r[1],n[2]*r[0]-n[0]*r[2],n[0]*r[1]-n[1]*r[0]]}(ld(n,r),ld(i,o)).every((t=>0===t))}function kd(t,e,n=!1){if(wd(t,e))return;const[r,i]=t,[o,a]=e,s=((r[0]-o[0])*(o[1]-a[1])-(r[1]-o[1])*(o[0]-a[0]))/((r[0]-i[0])*(o[1]-a[1])-(r[1]-i[1])*(o[0]-a[0])),l=a[0]-o[0]?(r[0]-o[0]+s*(i[0]-r[0]))/(a[0]-o[0]):(r[1]-o[1]+s*(i[1]-r[1]))/(a[1]-o[1]);return n||Hu(s,0,1)&&Hu(l,0,1)?[r[0]+s*(i[0]-r[0]),r[1]+s*(i[1]-r[1])]:void 0}function Md(t){if(Array.isArray(t))return Hu(t[0],0,1)&&Hu(t[1],0,1)?t:[.5,.5];const e=t.split("-");return[e.includes("left")?0:e.includes("right")?1:.5,e.includes("top")?0:e.includes("bottom")?1:.5]}function Sd(t){const{x:e=0,y:n=0,z:r=0}=t.style||{};return[+e,+n,+r]}function Ad(t){const{x:e,y:n,z:r}=t.style||{};return void 0!==e||void 0!==n||void 0!==r}function Nd(t,e){const[n,r]=e,{min:i,max:o}=t;return[i[0]+n*(o[0]-i[0]),i[1]+r*(o[1]-i[1])]}function Cd(t,e="center"){return Nd(t,Md(e))}function Od(t){var e;return[t.x,t.y,null!==(e=t.z)&&void 0!==e?e:0]}function Td(t){var e;return{x:t[0],y:t[1],z:null!==(e=t[2])&&void 0!==e?e:0}}function Pd(t,e=0){return t.map((t=>parseFloat(t.toFixed(e))))}function Rd(t,e,n,r=!1){if(iu(t,e))return t;const i=pd(r?ld(t,e):ld(e,t)),o=[i[0]*n,i[1]*n];return sd(yd(t),o)}function Dd(t,e){return t[1]===e[1]}function Ld(t,e,n){return wd([t,e],[e,n])}function Id(t,e){return[2*e[0]-t[0],2*e[1]-t[1]]}function Bd(t,e,n,r=!0,i=!1){for(let o=0;o<n.length;o++){let a=n[o],s=n[(o+1)%n.length];r&&(a=sd(e,a),s=sd(e,s));const l=kd([e,i?Id(t,e):t],[a,s]);if(l)return{point:l,line:[a,s]}}return{point:e,line:void 0}}function jd(t,e,n=!1){const r=e.center,i=ld(n?Id(t,r):t,e.center),o=Math.atan2(i[1],i[0]);if(isNaN(o))return r;const a=qu(e)/2,s=Xu(e)/2;return[r[0]+a*Math.cos(o),r[1]+s*Math.sin(o)]}function zd(t,e){let n=1/0,r=[[0,0],[0,0]];return e.forEach((e=>{const i=function(t,e){const n=Fd(t,e);return dd(t,n)}(t,e);i<n&&(n=i,r=e)})),r}function Fd(t,e){const[n,r]=e[0],[i,o]=e[1],[a,s]=t,l=i-n,c=o-r;if(0===l&&0===c)return[n,r];let u=((a-n)*l+(s-r)*c)/(l*l+c*c);u>1?u=1:u<0&&(u=0);return[n+u*l,r+u*c]}function _d(t,e=!0){const n=function(t){return ud(t.reduce(((t,e)=>sd(t,e)),[0,0]),t.length)}(t);return t.sort((([t,r],[i,o])=>{const a=Math.atan2(r-n[1],t-n[0]),s=Math.atan2(o-n[1],i-n[0]);return e?s-a:a-s}))}function Zd(t,e){return[t,[t[0],e[1]],e,[e[0],t[1]]]}class Gd{constructor(t,e,n){if(this.phase=e,this.pointerByTouch=[],this.initialDistance=null,this.emitter=t,Gd.instance)return Gd.callbacks[this.phase].push(n),Gd.instance;this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.bindEvents(),Gd.instance=this,Gd.callbacks[this.phase].push(n)}bindEvents(){const{emitter:t}=this;t.on(hu.POINTER_DOWN,this.onPointerDown),t.on(hu.POINTER_MOVE,this.onPointerMove),t.on(hu.POINTER_UP,this.onPointerUp)}updatePointerPosition(t,e,n){const r=this.pointerByTouch.findIndex((e=>e.pointerId===t));r>=0&&(this.pointerByTouch[r]={x:e,y:n,pointerId:t})}onPointerDown(t){const{x:e,y:n}=t.client||{};if(void 0!==e&&void 0!==n&&(this.pointerByTouch.push({x:e,y:n,pointerId:t.pointerId}),"touch"===t.pointerType&&2===this.pointerByTouch.length)){Gd.isPinching=!0;const e=this.pointerByTouch[0].x-this.pointerByTouch[1].x,n=this.pointerByTouch[0].y-this.pointerByTouch[1].y;this.initialDistance=Math.sqrt(e*e+n*n),Gd.callbacks.pinchstart.forEach((e=>e(t,{scale:0})))}}onPointerMove(t){if(2!==this.pointerByTouch.length||null===this.initialDistance)return;const{x:e,y:n}=t.client||{};if(void 0===e||void 0===n)return;this.updatePointerPosition(t.pointerId,e,n);const r=this.pointerByTouch[0].x-this.pointerByTouch[1].x,i=this.pointerByTouch[0].y-this.pointerByTouch[1].y,o=Math.sqrt(r*r+i*i)/this.initialDistance;Gd.callbacks.pinchmove.forEach((e=>e(t,{scale:5*(o-1)})))}onPointerUp(t){var e;Gd.callbacks.pinchend.forEach((e=>e(t,{scale:0}))),Gd.isPinching=!1,this.initialDistance=null,this.pointerByTouch=[],null===(e=Gd.instance)||void 0===e||e.tryDestroy()}destroy(){this.emitter.off(hu.POINTER_DOWN,this.onPointerDown),this.emitter.off(hu.POINTER_MOVE,this.onPointerMove),this.emitter.off(hu.POINTER_UP,this.onPointerUp),Gd.instance=null}off(t,e){const n=Gd.callbacks[t].indexOf(e);n>-1&&Gd.callbacks[t].splice(n,1),this.tryDestroy()}tryDestroy(){Object.values(Gd.callbacks).every((t=>0===t.length))&&this.destroy()}}Gd.isPinching=!1,Gd.instance=null,Gd.callbacks={pinchstart:[],pinchmove:[],pinchend:[]};const Vd=t=>t.map((t=>se(t)?t.toLocaleLowerCase():t));class Wd{constructor(t){this.map=new Map,this.boundHandlePinch=()=>{},this.recordKey=new Set,this.onKeyDown=t=>{(null==t?void 0:t.key)&&(this.recordKey.add(t.key),this.trigger(t))},this.onKeyUp=t=>{(null==t?void 0:t.key)&&this.recordKey.delete(t.key)},this.onWheel=t=>{this.triggerExtendKey(hu.WHEEL,t)},this.onDrag=t=>{this.triggerExtendKey(hu.DRAG,t)},this.handlePinch=(t,e)=>{this.triggerExtendKey(hu.PINCH,Object.assign(Object.assign({},t),e))},this.onFocus=()=>{this.recordKey.clear()},this.emitter=t,this.bindEvents()}bind(t,e){0!==t.length&&(t.includes(hu.PINCH)&&!this.pinchHandler&&(this.boundHandlePinch=this.handlePinch.bind(this),this.pinchHandler=new Gd(this.emitter,"pinchmove",this.boundHandlePinch)),this.map.set(t,e))}unbind(t,e){this.map.forEach(((n,r)=>{iu(r,t)&&(e&&e!==n||this.map.delete(r))}))}unbindAll(){this.map.clear()}match(t){const e=Vd(Array.from(this.recordKey)).sort(),n=Vd(t).sort();return iu(e,n)}bindEvents(){var t;const{emitter:e}=this;e.on(hu.KEY_DOWN,this.onKeyDown),e.on(hu.KEY_UP,this.onKeyUp),e.on(hu.WHEEL,this.onWheel),e.on(hu.DRAG,this.onDrag),null===(t=globalThis.addEventListener)||void 0===t||t.call(globalThis,"focus",this.onFocus)}trigger(t){this.map.forEach(((e,n)=>{this.match(n)&&e(t)}))}triggerExtendKey(t,e){this.map.forEach(((n,r)=>{r.includes(t)&&iu(Array.from(this.recordKey),r.filter((e=>e!==t)))&&n(e)}))}destroy(){var t,e;this.unbindAll(),this.emitter.off(hu.KEY_DOWN,this.onKeyDown),this.emitter.off(hu.KEY_UP,this.onKeyUp),this.emitter.off(hu.WHEEL,this.onWheel),this.emitter.off(hu.DRAG,this.onDrag),null===(t=this.pinchHandler)||void 0===t||t.off("pinchmove",this.boundHandlePinch),null===(e=globalThis.removeEventListener)||void 0===e||e.call(globalThis,"blur",this.onFocus)}}class Hd extends td{constructor(t,e){super(t,od({},Hd.defaultOptions,e)),this.shortcut=new Wd(t.graph),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.clearStates=this.clearStates.bind(this),this.bindEvents()}onPointerDown(t){if(!this.validate(t)||!this.isKeydown()||this.startPoint)return;const{canvas:e,graph:n}=this.context,r=Object.assign({},this.options.style);this.options.style.lineWidth&&(r.lineWidth=+this.options.style.lineWidth/n.getZoom()),this.rectShape=new zl({id:"g6-brush-select",style:r}),e.appendChild(this.rectShape),this.startPoint=[t.canvas.x,t.canvas.y]}onPointerMove(t){var e;if(!this.startPoint)return;const{immediately:n,mode:r}=this.options;this.endPoint=Ud(t,this.context.graph),null===(e=this.rectShape)||void 0===e||e.attr({x:Math.min(this.endPoint[0],this.startPoint[0]),y:Math.min(this.endPoint[1],this.startPoint[1]),width:Math.abs(this.endPoint[0]-this.startPoint[0]),height:Math.abs(this.endPoint[1]-this.startPoint[1])}),n&&"default"===r&&this.updateElementsStates(Zd(this.startPoint,this.endPoint))}onPointerUp(t){this.startPoint&&(this.endPoint?(this.endPoint=Ud(t,this.context.graph),this.updateElementsStates(Zd(this.startPoint,this.endPoint)),this.clearBrush()):this.clearBrush())}clearStates(){this.endPoint||this.clearElementsStates()}clearElementsStates(){const{graph:t}=this.context,e=Object.values(t.getData()).reduce(((t,e)=>Object.assign({},t,e.reduce(((t,e)=>{var n;const r=null===(n=e.states||[])||void 0===n?void 0:n.filter((t=>t!==this.options.state));return t[Fh(e)]=r,t}),{}))),{});t.setElementState(e,this.options.animation)}updateElementsStates(t){const{graph:e}=this.context,{enableElements:n,state:r,mode:i,onSelect:o}=this.options,a=this.selector(e,t,n);let s={};switch(i){case"union":a.forEach((t=>{s[t]=[...e.getElementState(t),r]}));break;case"diff":a.forEach((t=>{const n=e.getElementState(t);s[t]=n.includes(r)?n.filter((t=>t!==r)):[...n,r]}));break;case"intersect":a.forEach((t=>{const n=e.getElementState(t);s[t]=n.includes(r)?[r]:[]}));break;default:a.forEach((t=>{s[t]=[r]}))}en(o)&&(s=o(s)),e.setElementState(s,this.options.animation)}selector(t,e,n){if(!n||0===n.length)return[];const r=[],i=t.getData();if(n.forEach((n=>{i[`${n}s`].forEach((n=>{const i=Fh(n);"hidden"!==t.getElementVisibility(i)&&function(t,e,n,r){const i=t[0],o=t[1];let a=!1;void 0===n&&(n=0),void 0===r&&(r=e.length);const s=r-n;for(let t=0,r=s-1;t<s;r=t++){const s=e[t+n][0],l=e[t+n][1],c=e[r+n][0],u=e[r+n][1];l>o!=u>o&&i<(c-s)*(o-l)/(u-l)+s&&(a=!a)}return a}(t.getElementPosition(i),e)&&r.push(i)}))})),n.includes("edge")){const t=i.edges;null==t||t.forEach((t=>{const{source:e,target:n}=t;r.includes(e)&&r.includes(n)&&r.push(Fh(t))}))}return r}clearBrush(){var t;null===(t=this.rectShape)||void 0===t||t.remove(),this.rectShape=void 0,this.startPoint=void 0,this.endPoint=void 0}isKeydown(){const{trigger:t}=this.options,e=Array.isArray(t)?t:[t];return this.shortcut.match(e.filter((t=>"drag"!==t)))}validate(t){if(this.destroyed)return!1;const{enable:e}=this.options;return en(e)?e(t):!!e}bindEvents(){const{graph:t}=this.context;t.on(hu.POINTER_DOWN,this.onPointerDown),t.on(hu.POINTER_MOVE,this.onPointerMove),t.on(hu.POINTER_UP,this.onPointerUp),t.on(cu.CLICK,this.clearStates)}unbindEvents(){const{graph:t}=this.context;t.off(hu.POINTER_DOWN,this.onPointerDown),t.off(hu.POINTER_MOVE,this.onPointerMove),t.off(hu.POINTER_UP,this.onPointerUp),t.off(cu.CLICK,this.clearStates)}update(t){this.unbindEvents(),this.options=od(this.options,t),this.bindEvents()}destroy(){this.unbindEvents(),super.destroy()}}Hd.defaultOptions={animation:!1,enable:!0,enableElements:["node","combo","edge"],immediately:!1,mode:"default",state:"selected",trigger:["shift"],style:{width:0,height:0,lineWidth:1,fill:"#1677FF",stroke:"#1677FF",fillOpacity:.1,zIndex:2,pointerEvents:"none"}};const Ud=(t,e)=>{if(!("node"!==t.targetType&&"combo"!==t.targetType||t.nativeEvent.target instanceof HTMLCanvasElement)){const[n,r]=e.getCanvasByClient([t.client.x,t.client.y]);return[n,r]}return[t.canvas.x,t.canvas.y]},Yd=.8,qd=["node","edge","combo"];function Xd(t,e,n,r,i=0){"TB"===r&&e(t,i);const o=n(t);if(o)for(const t of o)Xd(t,e,n,r,i+1);"BT"===r&&e(t,i)}function Kd(t,e,n,r,i="both"){if("combo"===e||"node"===e)return Qd(t,n,r,i);const o=t.getEdgeData(n);if(!o)return[];const a=Qd(t,o.source,r-1,i),s=Qd(t,o.target,r-1,i);return Array.from(new Set([...a,...s,n]))}function Qd(t,e,n,r="both"){const i=new Set,o=new Set,a=new Set;return function(t,e,n){const r=[[t,0]];for(;r.length;){const[t,i]=r.shift();e(t,i);const o=n(t);if(o)for(const t of o)r.push([t,i+1])}}(e,((e,i)=>{i>n||(a.add(e),t.getRelatedEdgesData(e,r).forEach((t=>{const e=Fh(t);!o.has(e)&&i<n&&(a.add(e),o.add(e))})))}),(e=>t.getRelatedEdgesData(e,r).map((t=>t.source===e?t.target:t.source)).filter((t=>!i.has(t)&&(i.add(t),!0))))),Array.from(a)}function Jd(t){return t.states||[]}var $d=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(t){o(t)}}function s(t){try{l(r.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}))};class tf extends td{constructor(t,e){super(t,Object.assign({},tf.defaultOptions,e)),this.onClickSelect=t=>$d(this,void 0,void 0,(function*(){var e,n;this.validate(t)&&(yield this.updateState(t),null===(n=(e=this.options).onClick)||void 0===n||n.call(e,t))})),this.onClickCanvas=t=>$d(this,void 0,void 0,(function*(){var e,n;this.validate(t)&&(yield this.clearState(),null===(n=(e=this.options).onClick)||void 0===n||n.call(e,t))})),this.shortcut=new Wd(t.graph),this.bindEvents()}bindEvents(){const{graph:t}=this.context;this.unbindEvents(),qd.forEach((e=>{t.on(`${e}:${hu.CLICK}`,this.onClickSelect)})),t.on(cu.CLICK,this.onClickCanvas)}get isMultipleSelect(){const{multiple:t,trigger:e}=this.options;return t&&this.shortcut.match(e)}getNeighborIds(t){const{target:e,targetType:n}=t,{graph:r}=this.context,{degree:i}=this.options;return Kd(r,n,e.id,"function"==typeof i?i(t):i).filter((t=>t!==e.id))}updateState(t){return $d(this,void 0,void 0,(function*(){const{state:e,unselectedState:n,neighborState:r,animation:i}=this.options;if(!e&&!r&&!n)return;const{target:o}=t,{graph:a}=this.context,s=Jd(a.getElementData(o.id)).includes(e)?"unselect":"select",l={},c=this.isMultipleSelect,u=[o.id],h=this.getNeighborIds(t);if(c)if(Object.assign(l,this.getDataStates()),"select"===s){const t=(t,e)=>{t.forEach((t=>{const r=new Set(a.getElementState(t));r.add(e),r.delete(n),l[t]=Array.from(r)}))};t(u,e),t(h,r),n&&Object.keys(l).forEach((t=>{const i=l[t];i.includes(e)||i.includes(r)||i.includes(n)||l[t].push(n)}))}else{const t=l[o.id];l[o.id]=t.filter((t=>t!==e&&t!==r)),t.includes(n)||l[o.id].push(n),h.forEach((t=>{l[t]=l[t].filter((t=>t!==r)),l[t].includes(e)||l[t].push(n)}))}else if("select"===s){Object.assign(l,this.getClearStates(!!n));const t=(t,e)=>{t.forEach((t=>{l[t]||(l[t]=a.getElementState(t)),l[t].push(e)}))};t(u,e),t(h,r),n&&Object.keys(l).forEach((t=>{u.includes(t)||h.includes(t)||l[t].push(n)}))}else Object.assign(l,this.getClearStates());yield a.setElementState(l,i)}))}getDataStates(){const{graph:t}=this.context,{nodes:e,edges:n,combos:r}=t.getData(),i={};return[...e,...n,...r].forEach((t=>{i[Fh(t)]=Jd(t)})),i}getClearStates(t=!1){const{graph:e}=this.context,{state:n,unselectedState:r,neighborState:i}=this.options,o=new Set([n,r,i]),{nodes:a,edges:s,combos:l}=e.getData(),c={};return[...a,...s,...l].forEach((e=>{const n=Jd(e),r=n.filter((t=>!o.has(t)));(t||r.length!==n.length)&&(c[Fh(e)]=r)})),c}clearState(){return $d(this,void 0,void 0,(function*(){const{graph:t}=this.context;yield t.setElementState(this.getClearStates(),this.options.animation)}))}validate(t){if(this.destroyed)return!1;const{enable:e}=this.options;return en(e)?e(t):!!e}unbindEvents(){const{graph:t}=this.context;qd.forEach((e=>{t.off(`${e}:${hu.CLICK}`,this.onClickSelect)})),t.off(cu.CLICK,this.onClickCanvas)}destroy(){this.unbindEvents(),super.destroy()}}function ef(t){var e;return!!(null===(e=t.style)||void 0===e?void 0:e.collapsed)}tf.defaultOptions={animation:!0,enable:!0,multiple:!1,trigger:["shift"],state:"selected",neighborState:"selected",unselectedState:void 0,degree:0};var nf=function(t,e,n){for(var r=0,i=se(e)?e.split("."):e;t&&r<i.length;)t=t[i[r++]];return void 0===t||r<i.length?n:t},rf=function(t,e,n){var r=t,i=se(e)?e.split("."):e;return i.forEach((function(t,e){e<i.length-1?(nn(r[t])||(r[t]=ie(i[e+1])?[]:{}),r=r[t]):r[t]=n})),t},of=function(t){var e=$c(t);return e.charAt(0).toLowerCase()+e.substring(1)};function af(t,e){if(!t.startsWith(e))return!1;const n=t[e.length];return n>="A"&&n<="Z"}function sf(t,e){return`${e}${tu(t)}`}function lf(t,e,n=!0){if(!e)return t;if(!af(t,e))return t;const r=t.slice(e.length);return n?of(r):r}function cf(t,e){const n=Object.entries(t).reduce(((t,[n,r])=>("className"===n||"class"===n||af(n,e)&&Object.assign(t,{[lf(n,e)]:r}),t)),{});if("opacity"in t){const r=sf("opacity",e),i=t.opacity;if(r in t){const e=t[r];Object.assign(n,{opacity:i*e})}else Object.assign(n,{opacity:i})}return n}function uf(t,e){const n=e.length;return Object.keys(t).reduce(((r,i)=>{if(i.startsWith(e)){r[i.slice(n)]=t[i]}return r}),{})}function hf(t,e){const n="string"==typeof e?[e]:e,r={};return Object.keys(t).forEach((e=>{n.find((t=>e.startsWith(t)))||(r[e]=t[e])})),r}function df(t=0){if("number"==typeof t)return[t,t,t];const[e,n=e,r=e]=t;return[e,n,r]}var ff=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};function pf(t,e){const{datum:n,graph:r}=e;return"function"==typeof t?t.call(r,n):Object.fromEntries(Object.entries(t).map((([t,e])=>"function"==typeof e?[t,e.call(r,n)]:[t,e])))}function gf(t,e){const n=(null==t?void 0:t.style)||{},r=(null==e?void 0:e.style)||{};for(const t in n)t in r||(r[t]=n[t]);return Object.assign({},t,e,{style:r})}function vf(t){if(t)return"string"==typeof t||"function"==typeof t||Array.isArray(t)?{type:"group",field:t=>t.id,color:t,invert:!1}:t}function mf(t){const e="string"==typeof t?Eu("palette",t):t;if("function"!=typeof e)return e}function yf(t,e){let n=2*t;return"string"==typeof e?n=t*Number(e.replace("%",""))/100:"number"==typeof e&&(n=e),isNaN(n)&&(n=2*t),n}function bf(t,e,n=1,r=!1){const i=r?n:1;return yf((t.max[0]-t.min[0])*i,e)}var xf={}.toString,Ef=function(t){return xf.call(t).replace(/^\[object /,"").replace(/]$/,"")},wf=Object.prototype,kf=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||wf)},Mf=Object.prototype.hasOwnProperty;var Sf=function(t){if(ae(t))return!0;if(nu(t))return!t.length;var e=Ef(t);if("Map"===e||"Set"===e)return!t.size;if(kf(t))return!Object.keys(t).length;for(var n in t)if(Mf.call(t,n))return!1;return!0};class Af extends Ml{constructor(t){Cf(t.style),super(t),this.shapeMap={},this.animateMap={},this.render(this.attributes,this),this.setVisibility(),this.bindEvents()}get parsedAttributes(){return this.attributes}upsert(t,e,n,r,i){var o,a,s,l,c,u,h,d;const f=this.shapeMap[t];if(!1===n)return void(f&&(null===(o=null==i?void 0:i.beforeDestroy)||void 0===o||o.call(i,f),r.removeChild(f),delete this.shapeMap[t],null===(a=null==i?void 0:i.afterDestroy)||void 0===a||a.call(i,f)));const p="string"==typeof e?Eu(bu.SHAPE,e):e;if(!p)throw new Error(wu(`Shape ${e} not found`));if(!f||f.destroyed||!(f instanceof p)){f&&(null===(s=null==i?void 0:i.beforeDestroy)||void 0===s||s.call(i,f),null==f||f.destroy(),null===(l=null==i?void 0:i.afterDestroy)||void 0===l||l.call(i,f)),null===(c=null==i?void 0:i.beforeCreate)||void 0===c||c.call(i);const e=new p({className:t,style:n});return r.appendChild(e),this.shapeMap[t]=e,null===(u=null==i?void 0:i.afterCreate)||void 0===u||u.call(i,e),e}return null===(h=null==i?void 0:i.beforeUpdate)||void 0===h||h.call(i,f),Iv(f,n),null===(d=null==i?void 0:i.afterUpdate)||void 0===d||d.call(i,f),f}update(t={}){const e=Object.assign({},this.attributes,t);Cf(e),function(t,e){const{zIndex:n,transform:r,transformOrigin:i,visibility:o,cursor:a,clipPath:s,component:l}=e,c=xv(e,["zIndex","transform","transformOrigin","visibility","cursor","clipPath","component"]);Object.assign(t.attributes,c),r&&t.setAttribute("transform",r);ie(n)&&t.setAttribute("zIndex",n);i&&t.setAttribute("transformOrigin",i);o&&t.setAttribute("visibility",o);a&&t.setAttribute("cursor",a);s&&t.setAttribute("clipPath",s);l&&t.setAttribute("component",l)}(this,e),this.render(e,this),this.setVisibility()}bindEvents(){}getGraphicStyle(t){return function(t){const{x:e,y:n,z:r,class:i,className:o,transform:a,transformOrigin:s,zIndex:l,visibility:c}=t;return ff(t,["x","y","z","class","className","transform","transformOrigin","zIndex","visibility"])}(t)}get compositeShapes(){return[["badges","badge-"],["ports","port-"]]}animate(t,e){if(0===t.length)return null;const n=[];if(void 0!==t[0].x||void 0!==t[0].y||void 0!==t[0].z){const{x:e=0,y:n=0,z:r=0}=this.attributes;t.forEach((t=>{const{x:i=e,y:o=n,z:a=r}=t;Object.assign(t,{transform:a?[["translate3d",i,o,a]]:[["translate",i,o]]})}))}const r=super.animate(t,e);if(r&&(Nf(this,r),n.push(r)),Array.isArray(t)&&t.length>0){const r=["transform","transformOrigin","x","y","z","zIndex"];if(Object.keys(t[0]).some((t=>!r.includes(t)))){Object.entries(this.shapeMap).forEach((([r,i])=>{const o=this[`get${tu(r)}Style`];if(en(o)){const r=t.map((t=>o.call(this,Object.assign(Object.assign({},this.attributes),t)))),a=i.animate(Au(r),e);a&&(Nf(i,a),n.push(a))}}));const r=(r,i)=>{if(!Sf(r)){const o=this[`get${tu(i)}Style`];if(en(o)){const i=t.map((t=>o.call(this,Object.assign(Object.assign({},this.attributes),t))));Object.entries(i[0]).map((([t])=>{const o=i.map((e=>e[t])),a=r[t];if(a){const t=a.animate(Au(o),e);t&&(Nf(a,t),n.push(t))}}))}}};this.compositeShapes.forEach((([t,e])=>{const n=uf(this.shapeMap,e);r(n,t)}))}}return Su(n)}getShape(t){return this.shapeMap[t]}setVisibility(){const{visibility:t}=this.attributes;Qh(this,t)}destroy(){this.shapeMap={},this.animateMap={},super.destroy()}}function Nf(t,e){null==e||e.finished.then((()=>{const n=t.activeAnimations.findIndex((t=>t===e));n>-1&&t.activeAnimations.splice(n,1)}))}function Cf(t){if(!t)return{};if("x"in t||"y"in t||"z"in t){const{x:e=0,y:n=0,z:r,transform:i}=t,o=Tu(e,n,r,i);o&&(t.transform=o)}return t}var Of=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};class Tf extends Af{constructor(t){super(gf({style:Tf.defaultStyleProps},t))}isTextStyle(t){return af(t,"label")}isBackgroundStyle(t){return af(t,"background")}getTextStyle(t){const e=this.getGraphicStyle(t),{padding:n}=e;return hf(Of(e,["padding"]),"background")}getBackgroundStyle(t){if(!1===t.background)return!1;const e=this.getGraphicStyle(t),{wordWrap:n,wordWrapWidth:r,padding:i}=e,o=cf(e,"background"),{min:[a,s],center:[l,c],halfExtents:[u,h]}=this.shapeMap.text.getGeometryBounds(),[d,f,p,g]=Uu(i),v=2*u+g+f,{width:m,height:y}=o;m&&y?Object.assign(o,{x:l-Number(m)/2,y:c-Number(y)/2}):Object.assign(o,{x:a-g,y:s-d,width:n?Math.min(v,r+g+f):v,height:2*h+d+p});const{radius:b}=o;if("string"==typeof b&&b.endsWith("%")){const t=Number(b.replace("%",""))/100;o.radius=Math.min(+o.width,+o.height)*t}return o}render(t=this.parsedAttributes,e=this){this.upsert("text",_l,this.getTextStyle(t),e),this.upsert("background",zl,this.getBackgroundStyle(t),e)}getGeometryBounds(){return(this.getShape("background")||this.getShape("text")).getGeometryBounds()}}Tf.defaultStyleProps={padding:0,fontSize:12,fontFamily:"system-ui, sans-serif",wordWrap:!0,maxLines:1,wordWrapWidth:128,textOverflow:"...",textBaseline:"middle",backgroundOpacity:.75,backgroundZIndex:-1,backgroundLineWidth:0};class Pf extends Af{constructor(t){super(gf({style:Pf.defaultStyleProps},t))}getBadgeStyle(t){return this.getGraphicStyle(t)}render(t=this.parsedAttributes,e=this){this.upsert("label",Tf,this.getBadgeStyle(t),e)}getGeometryBounds(){const t=this.getShape("label");return(t.getShape("background")||t.getShape("text")).getGeometryBounds()}}Pf.defaultStyleProps={padding:[2,4,2,4],fontSize:10,wordWrap:!1,backgroundRadius:"50%",backgroundOpacity:1};const Rf={M:["x","y"],m:["dx","dy"],H:["x"],h:["dx"],V:["y"],v:["dy"],L:["x","y"],l:["dx","dy"],Z:[],z:[],C:["x1","y1","x2","y2","x","y"],c:["dx1","dy1","dx2","dy2","dx","dy"],S:["x2","y2","x","y"],s:["dx2","dy2","dx","dy"],Q:["x1","y1","x","y"],q:["dx1","dy1","dx","dy"],T:["x","y"],t:["dx","dy"],A:["rx","ry","rotation","large-arc","sweep","x","y"],a:["rx","ry","rotation","large-arc","sweep","dx","dy"]};function Df(t){const e=[],n="string"==typeof t?function(t){const e=t.replace(/[\n\r]/g,"").replace(/-/g," -").replace(/(\d*\.)(\d+)(?=\.)/g,"$1$2 ").trim().split(/\s*,|\s+/),n=[];let r="",i={};for(;e.length>0;){let t=e.shift();t in Rf?r=t:e.unshift(t),i={type:r},Rf[r].forEach((n=>{t=e.shift(),i[n]=t})),"M"===r?r="L":"m"===r&&(r="l");const[o,...a]=Object.values(i);n.push([o,...a.map(Number)])}return n}(t):t;return n.forEach((t=>{const n=t[0];if("Z"!==n)if("A"!==n)for(let n=1;n<t.length;n+=2)e.push([t[n],t[n+1],0]);else{const n=t.length;e.push([t[n-2],t[n-1],0])}else e.push(e[0])})),e}const Lf=t=>{if(t.length<2)return[["M",0,0],["L",0,0]];const e=t[0],n=t[1],r=t[t.length-1],i=t[t.length-2];t.unshift(i,r),t.push(e,n);const o=[["M",r[0],r[1]]];for(let e=1;e<t.length-2;e+=1){const[n,r]=t[e-1],[i,a]=t[e],[s,l]=t[e+1],[c,u]=e!==t.length-2?t[e+2]:[s,l],h=i+(s-n)/6,d=a+(l-r)/6,f=s-(c-i)/6,p=l-(u-a)/6;o.push(["C",h,d,f,p,s,l])}return o};var If=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};class Bf extends Af{constructor(t){super(gf({style:Bf.defaultStyleProps},t))}getLabelStyle(t){if(!t.label||!t.d||0===t.d.length)return!1;const e=cf(this.getGraphicStyle(t),"label"),{maxWidth:n,offsetX:r,offsetY:i,autoRotate:o,placement:a,closeToPath:s}=e,l=If(e,["maxWidth","offsetX","offsetY","autoRotate","placement","closeToPath"]),c=this.shapeMap.key,u=null==c?void 0:c.getRenderBounds();return Object.assign(function(t,e,n,r,i,o,a){const[s,l]=Cd(t,e),c={textAlign:"left"===e?"right":"right"===e?"left":"center",textBaseline:"top"===e?"bottom":"bottom"===e?"top":"middle",transform:[["translate",s+n,l+r]]};if("center"===e||!i)return c;const u=Df(o);if(!u||u.length<=3)return c;const h=u.map(((t,e)=>{const n=t,r=u[(e+1)%u.length];return iu(n,r)?null:[n,r]})).filter(Boolean),d=zd([s,l],h),f=Fd([s,l],d);if(f&&d&&(c.transform=[["translate",f[0]+n,f[1]+r]],a)){const t=Math.atan((d[0][1]-d[1][1])/(d[0][0]-d[1][0]));c.transform.push(["rotate",t/Math.PI*180]),c.textAlign="center","right"!==e&&"left"!==e||(c.textBaseline=t>0?"right"===e?"bottom":"top":"right"===e?"top":"bottom")}return c}(u,a,r,i,s,t.d,o),{wordWrapWidth:bf(u,n)},l)}getKeyStyle(t){return this.getGraphicStyle(t)}render(t,e){this.upsert("key",Dl,this.getKeyStyle(t),e),this.upsert("label",Tf,this.getLabelStyle(t),e)}}Bf.defaultStyleProps={label:!0,labelPlacement:"bottom",labelCloseToPath:!0,labelAutoRotate:!0,labelOffsetX:0,labelOffsetY:0};class jf extends Ol{constructor(t){super(t),this.onMounted=()=>{this.handleRadius()},this.onAttrModified=()=>{this.handleRadius()},Ff=this,this.isMutationObserved=!0,this.addEventListener(Ps.MOUNTED,this.onMounted),this.addEventListener(Ps.ATTR_MODIFIED,this.onAttrModified)}handleRadius(){const{radius:t,clipPath:e,width:n=0,height:r=0}=this.attributes;if(t&&n&&r){const[i,o]=this.getBounds().min,a={x:i,y:o,radius:t,width:n,height:r};if(e)Object.assign(this.parsedStyle.clipPath.style,a);else{const t=new zl({style:a});this.style.clipPath=t}}else e&&(this.style.clipPath=null)}}const zf=new WeakMap;let Ff=null;const _f=t=>{if(Ff&&function(t){const e=[];let n=t.parentNode;for(;n;)e.push(n),n=n.parentNode;return e}(Ff).includes(t)){const e=zf.get(t);e?e.includes(Ff)||e.push(Ff):zf.set(t,[Ff])}},Zf=t=>{const e=zf.get(t);e&&e.forEach((t=>t.handleRadius()))};class Gf extends Af{constructor(t){super(t)}isImage(){const{src:t}=this.attributes;return!!t}getIconStyle(t=this.attributes){const{width:e=0,height:n=0}=t,r=this.getGraphicStyle(t);return this.isImage()?Object.assign({x:-e/2,y:-n/2},r):Object.assign({textBaseline:"middle",textAlign:"center"},r)}render(t=this.attributes,e=this){this.upsert("icon",this.isImage()?jf:_l,this.getIconStyle(t),e)}}class Vf extends Af{get context(){return this.config.context}get parsedAttributes(){return this.attributes}onframe(){}animate(t,e){const n=super.animate(t,e);return n&&(n.onframe=()=>this.onframe(),n.finished.then((()=>this.onframe()))),n}}var Wf=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};class Hf extends Vf{constructor(t){super(gf({style:Hf.defaultStyleProps},t)),this.type="node"}getSize(t=this.attributes){const{size:e}=t;return df(e)}getKeyStyle(t){const e=this.getGraphicStyle(t);return Object.assign(hf(e,["label","halo","icon","badge","port"]))}getLabelStyle(t){if(!1===t.label||!t.labelText)return!1;const e=cf(this.getGraphicStyle(t),"label"),{placement:n,maxWidth:r,offsetX:i,offsetY:o}=e,a=Wf(e,["placement","maxWidth","offsetX","offsetY"]),s=this.getShape("key").getLocalBounds();return Object.assign(Dv(s,n,i,o),{wordWrapWidth:bf(s,r)},a)}getHaloStyle(t){if(!1===t.halo)return!1;const e=this.getKeyStyle(t),{fill:n}=e,r=Wf(e,["fill"]),i=cf(this.getGraphicStyle(t),"halo");return Object.assign(Object.assign(Object.assign({},r),{stroke:n}),i)}getIconStyle(t){if(!1===t.icon||!t.iconText&&!t.iconSrc)return!1;const e=cf(this.getGraphicStyle(t),"icon");return Object.assign(function(t,e){const n=df(t);let r={};return e.text&&!e.fontSize&&(r={fontSize:.5*Math.min(...n)}),!e.src||e.width&&e.height||(r={width:.5*n[0],height:.5*n[1]}),r}(t.size,e),e)}getBadgesStyle(t){var e;const n=uf(this.shapeMap,"badge-"),r={};if(Object.keys(n).forEach((t=>{r[t]=!1})),!1===t.badge||!(null===(e=t.badges)||void 0===e?void 0:e.length))return r;const{badges:i=[],badgePalette:o,opacity:a=1}=t,s=Wf(t,["badges","badgePalette","opacity"]),l=mf(o),c=cf(this.getGraphicStyle(s),"badge");return i.forEach(((t,e)=>{r[e]=Object.assign(Object.assign({backgroundFill:l?l[e%(null==l?void 0:l.length)]:void 0,opacity:a},c),this.getBadgeStyle(t))})),r}getBadgeStyle(t){const e=this.getShape("key"),{placement:n="top",offsetX:r,offsetY:i}=t,o=Wf(t,["placement","offsetX","offsetY"]),a=Dv(e.getLocalBounds(),n,r,i,!0);return Object.assign(Object.assign({},a),o)}getPortsStyle(t){var e;const n=this.getPorts(),r={};if(Object.keys(n).forEach((t=>{r[t]=!1})),!1===t.port||!(null===(e=t.ports)||void 0===e?void 0:e.length))return r;const i=cf(this.getGraphicStyle(t),"port"),{ports:o=[]}=t;return o.forEach(((e,n)=>{const o=e.key||n,a=Object.assign(Object.assign({},i),e);if(Nv(a))r[o]=!1;else{const[n,i]=this.getPortXY(t,e);r[o]=Object.assign({transform:[["translate",n,i]]},a)}})),r}getPortXY(t,e){const{placement:n="left"}=e,r=this.getShape("key");return Sv(function(t,e){if(!t)return e.getLocalBounds();const n=t.canvas.getLayer(),r=e.cloneNode();Qh(r,"hidden"),n.appendChild(r);const i=r.getLocalBounds();return r.destroy(),i}(this.context,r),n)}getPorts(){return uf(this.shapeMap,"port-")}getCenter(){return this.getShape("key").getBounds().center}getIntersectPoint(t,e=!1){return function(t,e,n=!1){return Bd(t,Cd(e,"center"),[Cd(e,"left-top"),Cd(e,"right-top"),Cd(e,"right-bottom"),Cd(e,"left-bottom")],!1,n).point}(t,this.getShape("key").getBounds(),e)}drawHaloShape(t,e){const n=this.getHaloStyle(t),r=this.getShape("key");this.upsert("halo",r.constructor,n,e)}drawIconShape(t,e){const n=this.getIconStyle(t);this.upsert("icon",Gf,n,e),_f(this)}drawBadgeShapes(t,e){const n=this.getBadgesStyle(t);Object.keys(n).forEach((t=>{const r=n[t];this.upsert(`badge-${t}`,Pf,r,e)}))}drawPortShapes(t,e){const n=this.getPortsStyle(t);Object.keys(n).forEach((t=>{const r=n[t],i=`port-${t}`;this.upsert(i,wl,r,e)}))}drawLabelShape(t,e){const n=this.getLabelStyle(t);this.upsert("label",Tf,n,e)}_drawKeyShape(t,e){return this.drawKeyShape(t,e)}render(t=this.parsedAttributes,e=this){this._drawKeyShape(t,e),this.getShape("key")&&(this.drawHaloShape(t,e),this.drawIconShape(t,e),this.drawBadgeShapes(t,e),this.drawLabelShape(t,e),this.drawPortShapes(t,e))}update(t){super.update(t),t&&("x"in t||"y"in t||"z"in t)&&Zf(this)}onframe(){this.drawBadgeShapes(this.parsedAttributes,this),this.drawLabelShape(this.parsedAttributes,this)}}Hf.defaultStyleProps={x:0,y:0,size:32,droppable:!0,draggable:!0,port:!0,ports:[],portZIndex:2,portLinkToCenter:!1,badge:!0,badges:[],badgeZIndex:3,halo:!1,haloDroppable:!1,haloLineDash:0,haloLineWidth:12,haloStrokeOpacity:.25,haloPointerEvents:"none",haloZIndex:-1,icon:!0,iconZIndex:1,label:!0,labelIsBillboard:!0,labelMaxWidth:"200%",labelPlacement:"bottom",labelWordWrap:!1,labelZIndex:0};class Uf extends Hf{constructor(t){super(gf({style:Uf.defaultStyleProps},t))}drawKeyShape(t,e){return this.upsert("key",wl,this.getKeyStyle(t),e)}getKeyStyle(t){const e=super.getKeyStyle(t);return Object.assign(Object.assign({},e),{r:Math.min(...this.getSize(t))/2})}getIconStyle(t){const e=super.getIconStyle(t),{r:n}=this.getShape("key").attributes,r=2*n*Yd;return!!e&&Object.assign({width:r,height:r},e)}getIntersectPoint(t,e=!1){return jd(t,this.getShape("key").getBounds(),e)}}Uf.defaultStyleProps={size:32};class Yf extends Hf{constructor(t){super(t)}get parsedAttributes(){return this.attributes}drawKeyShape(t,e){return this.upsert("key",Il,this.getKeyStyle(t),e)}getKeyStyle(t){const e=super.getKeyStyle(t);return Object.assign(Object.assign({},e),{points:this.getPoints(t)})}getIntersectPoint(t,e=!1){var n,r;const{points:i}=this.getShape("key").attributes;return Bd(t,[+((null===(n=this.attributes)||void 0===n?void 0:n.x)||0),+((null===(r=this.attributes)||void 0===r?void 0:r.y)||0)],i,!0,e).point}}var qf=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};class Xf extends Uf{constructor(t){super(gf({style:Xf.defaultStyleProps},t))}parseOuterR(){const{size:t}=this.parsedAttributes;return Math.min(...df(t))/2}parseInnerR(){const{innerR:t}=this.parsedAttributes;return se(t)?parseInt(t)/100*this.parseOuterR():t}drawDonutShape(t,e){const{donuts:n}=t;if(!(null==n?void 0:n.length))return;const r=n.map((t=>ie(t)?{value:t}:t)),i=cf(this.getGraphicStyle(t),"donut"),o=mf(t.donutPalette);if(!o)return;const a=r.reduce(((t,e)=>{var n;return t+(null!==(n=e.value)&&void 0!==n?n:0)}),0),s=this.parseOuterR(),l=this.parseInnerR();let c=0;r.forEach(((t,n)=>{const{value:u=0,color:h=o[n%o.length]}=t,d=qf(t,["value","color"]),f=360*(0===a?1/r.length:u/a);this.upsert(`round${n}`,Dl,Object.assign(Object.assign(Object.assign({},i),{d:Qf(s,l,c,c+f),fill:h}),d),e),c+=f}))}render(t,e=this){super.render(t,e),this.drawDonutShape(t,e)}}Xf.defaultStyleProps={innerR:"50%",donuts:[],donutPalette:"tableau"};const Kf=(t,e,n,r)=>[t+Math.sin(r)*n,e-Math.cos(r)*n],Qf=(t=0,e=0,n,r)=>{const[i,o]=[0,0];return Math.abs(n-r)%360<1e-6?((t,e,n,r)=>r<=0||n<=r?[["M",t-n,e],["A",n,n,0,1,1,t+n,e],["A",n,n,0,1,1,t-n,e],["Z"]]:[["M",t-n,e],["A",n,n,0,1,1,t+n,e],["A",n,n,0,1,1,t-n,e],["Z"],["M",t+r,e],["A",r,r,0,1,0,t-r,e],["A",r,r,0,1,0,t+r,e],["Z"]])(i,o,t,e):((t,e,n,r,i,o)=>{const[a,s]=[i/360*2*Math.PI,o/360*2*Math.PI],l=[Kf(t,e,r,a),Kf(t,e,n,a),Kf(t,e,n,s),Kf(t,e,r,s)],c=s-a>Math.PI?1:0;return[["M",l[0][0],l[0][1]],["L",l[1][0],l[1][1]],["A",n,n,0,c,1,l[2][0],l[2][1]],["L",l[3][0],l[3][1]],["A",r,r,0,c,0,l[0][0],l[0][1]],["Z"]]})(i,o,t,e,n,r)};class Jf extends Hf{constructor(t){super(gf({style:Jf.defaultStyleProps},t))}drawKeyShape(t,e){return this.upsert("key",Sl,this.getKeyStyle(t),e)}getKeyStyle(t){const e=super.getKeyStyle(t),[n,r]=this.getSize(t);return Object.assign(Object.assign({},e),{rx:n/2,ry:r/2})}getIconStyle(t){const e=super.getIconStyle(t),{rx:n,ry:r}=this.getShape("key").attributes,i=2*Math.min(+n,+r)*Yd;return!!e&&Object.assign({width:i,height:i},e)}getIntersectPoint(t,e=!1){return jd(t,this.getShape("key").getBounds(),e)}}Jf.defaultStyleProps={size:[45,35]};function $f(t,e){var n=e.cx,r=void 0===n?0:n,i=e.cy,o=void 0===i?0:i,a=e.r;t.arc(r,o,a,0,2*Math.PI,!1)}function tp(t,e){var n=e.cx,r=void 0===n?0:n,i=e.cy,o=void 0===i?0:i,a=e.rx,s=e.ry;if(t.ellipse)t.ellipse(r,o,a,s,0,0,2*Math.PI,!1);else{var l=a>s?a:s,c=a>s?1:a/s,u=a>s?s/a:1;t.save(),t.scale(c,u),t.arc(r,o,l,0,2*Math.PI)}}function ep(t,e){var n,r,i=e.x1,o=e.y1,a=e.x2,s=e.y2,l=e.markerStart,c=e.markerEnd,u=e.markerStartOffset,h=e.markerEndOffset,d=0,f=0,p=0,g=0,v=0;l&&vl(l)&&u&&(n=a-i,r=s-o,v=Math.atan2(r,n),d=Math.cos(v)*(u||0),f=Math.sin(v)*(u||0)),c&&vl(c)&&h&&(n=i-a,r=o-s,v=Math.atan2(r,n),p=Math.cos(v)*(h||0),g=Math.sin(v)*(h||0)),t.moveTo(i+d,o+f),t.lineTo(a+p,s+g)}function np(t,e){var n,r,i=e.markerStart,o=e.markerEnd,a=e.markerStartOffset,s=e.markerEndOffset,l=e.d,c=l.absolutePath,u=l.segments,d=0,f=0,p=0,g=0,v=0;if(i&&vl(i)&&a){var m=i.parentNode.getStartTangent(),y=(0,h.Z)(m,2),b=y[0],x=y[1];n=b[0]-x[0],r=b[1]-x[1],v=Math.atan2(r,n),d=Math.cos(v)*(a||0),f=Math.sin(v)*(a||0)}if(o&&vl(o)&&s){var E=o.parentNode.getEndTangent(),w=(0,h.Z)(E,2),k=w[0],M=w[1];n=k[0]-M[0],r=k[1]-M[1],v=Math.atan2(r,n),p=Math.cos(v)*(s||0),g=Math.sin(v)*(s||0)}for(var S=0;S<c.length;S++){var A=c[S],N=A[0],C=c[S+1],O=0===S&&(0!==d||0!==f),T=(S===c.length-1||C&&("M"===C[0]||"Z"===C[0]))&&0!==p&&0!==g,P=O?[d,f]:[0,0],R=(0,h.Z)(P,2),D=R[0],L=R[1],I=T?[p,g]:[0,0],B=(0,h.Z)(I,2),j=B[0],z=B[1];switch(N){case"M":t.moveTo(A[1]+D,A[2]+L);break;case"L":t.lineTo(A[1]+j,A[2]+z);break;case"Q":t.quadraticCurveTo(A[1],A[2],A[3]+j,A[4]+z);break;case"C":t.bezierCurveTo(A[1],A[2],A[3],A[4],A[5]+j,A[6]+z);break;case"A":var F=u[S].arcParams,_=F.cx,Z=F.cy,G=F.rx,V=F.ry,W=F.startAngle,H=F.endAngle,U=F.xRotation,Y=F.sweepFlag;if(t.ellipse)t.ellipse(_,Z,G,V,U,W,H,!!(1-Y));else{var q=G>V?G:V,X=G>V?1:G/V,K=G>V?V/G:1;t.translate(_,Z),t.rotate(U),t.scale(X,K),t.arc(0,0,q,W,H,!!(1-Y)),t.scale(1/X,1/K),t.rotate(-U),t.translate(-_,-Z)}T&&t.lineTo(A[6]+p,A[7]+g);break;case"Z":t.closePath()}}}function rp(t,e){var n,r,i=e.markerStart,o=e.markerEnd,a=e.markerStartOffset,s=e.markerEndOffset,l=e.points.points,c=l.length,u=l[0][0],h=l[0][1],d=l[c-1][0],f=l[c-1][1],p=0,g=0,v=0,m=0,y=0;i&&vl(i)&&a&&(n=l[1][0]-l[0][0],r=l[1][1]-l[0][1],y=Math.atan2(r,n),p=Math.cos(y)*(a||0),g=Math.sin(y)*(a||0)),o&&vl(o)&&s&&(n=l[c-1][0]-l[0][0],r=l[c-1][1]-l[0][1],y=Math.atan2(r,n),v=Math.cos(y)*(s||0),m=Math.sin(y)*(s||0)),t.moveTo(u+(p||v),h+(g||m));for(var b=1;b<c-1;b++){var x=l[b];t.lineTo(x[0],x[1])}t.lineTo(d,f)}function ip(t,e){var n,r,i=e.markerStart,o=e.markerEnd,a=e.markerStartOffset,s=e.markerEndOffset,l=e.points.points,c=l.length,u=l[0][0],h=l[0][1],d=l[c-1][0],f=l[c-1][1],p=0,g=0,v=0,m=0,y=0;i&&vl(i)&&a&&(n=l[1][0]-l[0][0],r=l[1][1]-l[0][1],y=Math.atan2(r,n),p=Math.cos(y)*(a||0),g=Math.sin(y)*(a||0)),o&&vl(o)&&s&&(n=l[c-2][0]-l[c-1][0],r=l[c-2][1]-l[c-1][1],y=Math.atan2(r,n),v=Math.cos(y)*(s||0),m=Math.sin(y)*(s||0)),t.moveTo(u+p,h+g);for(var b=1;b<c-1;b++){var x=l[b];t.lineTo(x[0],x[1])}t.lineTo(d+v,f+m)}function op(t,e){var n=e.x,r=void 0===n?0:n,i=e.y,o=void 0===i?0:i,a=e.radius,s=e.width,l=e.height,c=s,u=l;if(a&&a.some((function(t){return 0!==t}))){var d=s>0?1:-1,f=l>0?1:-1,p=d+f===0,g=a.map((function(t){return le(t,0,Math.min(Math.abs(c)/2,Math.abs(u)/2))})),v=(0,h.Z)(g,4),m=v[0],y=v[1],b=v[2],x=v[3];t.moveTo(d*m+r,o),t.lineTo(c-d*y+r,o),0!==y&&t.arc(c-d*y+r,f*y+o,y,-f*Math.PI/2,d>0?0:Math.PI,p),t.lineTo(c+r,u-f*b+o),0!==b&&t.arc(c-d*b+r,u-f*b+o,b,d>0?0:Math.PI,f>0?Math.PI/2:1.5*Math.PI,p),t.lineTo(d*x+r,u+o),0!==x&&t.arc(d*x+r,u-f*x+o,x,f>0?Math.PI/2:-Math.PI/2,d>0?Math.PI:0,p),t.lineTo(r,f*m+o),0!==m&&t.arc(d*m+r,f*m+o,m,d>0?Math.PI:0,f>0?1.5*Math.PI:Math.PI/2,p)}else t.rect(r,o,c,u)}var ap=function(t){function e(){var t;(0,a.Z)(this,e);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=(0,c.Z)(this,e,[].concat(r))).name="canvas-path-generator",t}return(0,u.Z)(e,t),(0,s.Z)(e,[{key:"init",value:function(){var t,e=(t={},(0,on.Z)((0,on.Z)((0,on.Z)((0,on.Z)((0,on.Z)((0,on.Z)((0,on.Z)((0,on.Z)((0,on.Z)((0,on.Z)(t,Ln.CIRCLE,$f),Ln.ELLIPSE,tp),Ln.RECT,op),Ln.LINE,ep),Ln.POLYLINE,ip),Ln.POLYGON,rp),Ln.PATH,np),Ln.TEXT,void 0),Ln.GROUP,void 0),Ln.IMAGE,void 0),(0,on.Z)((0,on.Z)((0,on.Z)(t,Ln.HTML,void 0),Ln.MESH,void 0),Ln.FRAGMENT,void 0));this.context.pathGeneratorFactory=e}},{key:"destroy",value:function(){delete this.context.pathGeneratorFactory}}])}(Bn),sp=g(),lp=g(),cp=g(),up=F(),hp=function(){function t(){var e=this;(0,a.Z)(this,t),this.isHit=function(t,n,r,i){var o=e.context.pointInPathPickerFactory[t.nodeName];if(o){var a=U(up,r),s=O(lp,x(cp,n[0],n[1],0),a);if(o(t,new qn(s[0],s[1]),i,e.isPointInPath,e.context,e.runtime))return!0}return!1},this.isPointInPath=function(t,n){var r=e.runtime.offscreenCanvasCreator.getOrCreateContext(e.context.config.offscreenCanvas),i=e.context.pathGeneratorFactory[t.nodeName];return i&&(r.beginPath(),i(r,t.parsedStyle),r.closePath()),r.isPointInPath(n.x,n.y)}}return(0,s.Z)(t,[{key:"apply",value:function(e,n){var r,i=this,o=e.renderingService,a=e.renderingContext;this.context=e,this.runtime=n;var s=null===(r=a.root)||void 0===r?void 0:r.ownerDocument;o.hooks.pick.tapPromise(t.tag,function(){var t=(0,On.Z)((0,Cn.Z)().mark((function t(e){return(0,Cn.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",i.pick(s,e));case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),o.hooks.pickSync.tap(t.tag,(function(t){return i.pick(s,t)}))}},{key:"pick",value:function(t,e){var n,r=e.topmost,i=e.position,o=i.x,a=i.y,s=x(sp,o,a,0),l=t.elementsFromBBox(s[0],s[1],s[0],s[1]),c=[],u=(0,Tn.Z)(l);try{for(u.s();!(n=u.n()).done;){var h=n.value,d=h.getWorldTransform();if(this.isHit(h,s,d,!1)){var f=Aa(h);if(f){var p=f.parsedStyle.clipPath;if(this.isHit(p,s,p.getWorldTransform(),!0)){if(r)return e.picked=[h],e;c.push(h)}}else{if(r)return e.picked=[h],e;c.push(h)}}}}catch(t){u.e(t)}finally{u.f()}return e.picked=c,e}}])}();function dp(t,e,n){var r=t.parsedStyle,i=r.cx,o=void 0===i?0:i,a=r.cy,s=void 0===a?0:a,l=r.r,c=r.fill,u=r.stroke,d=r.lineWidth,f=void 0===d?1:d,p=r.increasedLineWidthForHitTesting,g=void 0===p?0:p,v=r.pointerEvents,m=void 0===v?"auto":v,y=(f+g)/2,b=un(o,s,e.x,e.y),x=Pa(m,c,u),E=(0,h.Z)(x,2),w=E[0],k=E[1];return w&&k||n?b<=l+y:w?b<=l:!!k&&(b>=l-y&&b<=l+y)}function fp(t,e,n,r){return t/(n*n)+e/(r*r)}function pp(t,e,n){var r=t.parsedStyle,i=r.cx,o=void 0===i?0:i,a=r.cy,s=void 0===a?0:a,l=r.rx,c=r.ry,u=r.fill,d=r.stroke,f=r.lineWidth,p=void 0===f?1:f,g=r.increasedLineWidthForHitTesting,v=void 0===g?0:g,m=r.pointerEvents,y=void 0===m?"auto":m,b=e.x,x=e.y,E=Pa(y,u,d),w=(0,h.Z)(E,2),k=w[0],M=w[1],S=(p+v)/2,A=(b-o)*(b-o),N=(x-s)*(x-s);return k&&M||n?fp(A,N,l+S,c+S)<=1:k?fp(A,N,l,c)<=1:!!M&&(fp(A,N,l-S,c-S)>=1&&fp(A,N,l+S,c+S)<=1)}function gp(t,e,n,r,i,o){return i>=t&&i<=t+n&&o>=e&&o<=e+r}function vp(t,e,n,r,i,o,a,s){var l=(Math.atan2(s-e,a-t)+2*Math.PI)%(2*Math.PI),c={x:t+n*Math.cos(l),y:e+n*Math.sin(l)};return un(c.x,c.y,a,s)<=o/2}function mp(t,e,n,r,i,o,a){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 o>=s-h&&o<=l+h&&a>=c-h&&a<=u+h&&yn(t,e,n,r,o,a)<=i/2}function yp(t,e,n,r,i){var o=t.length;if(o<2)return!1;for(var a=0;a<o-1;a++){if(mp(t[a][0],t[a][1],t[a+1][0],t[a+1][1],e,n,r))return!0}if(i){var s=t[0],l=t[o-1];if(mp(s[0],s[1],l[0],l[1],e,n,r))return!0}return!1}hp.tag="CanvasPicker";function bp(t){return Math.abs(t)<1e-6?0:t<0?-1:1}function xp(t,e,n){return(n[0]-t[0])*(e[1]-t[1])==(e[0]-t[0])*(n[1]-t[1])&&Math.min(t[0],e[0])<=n[0]&&n[0]<=Math.max(t[0],e[0])&&Math.min(t[1],e[1])<=n[1]&&n[1]<=Math.max(t[1],e[1])}function Ep(t,e,n){var r=!1,i=t.length;if(i<=2)return!1;for(var o=0;o<i;o++){var a=t[o],s=t[(o+1)%i];if(xp(a,s,[e,n]))return!0;bp(a[1]-n)>0!=bp(s[1]-n)>0&&bp(e-(n-a[1])*(a[0]-s[0])/(a[1]-s[1])-a[0])<0&&(r=!r)}return r}function wp(t,e,n){for(var r=!1,i=0;i<t.length;i++){if(r=Ep(t[i],e,n))break}return r}function kp(t,e,n){var r=t.parsedStyle,i=r.x1,o=r.y1,a=r.x2,s=r.y2,l=r.lineWidth,c=void 0===l?1:l,u=r.increasedLineWidthForHitTesting,d=void 0===u?0:u,f=r.pointerEvents,p=Pa(void 0===f?"auto":f,r.fill,r.stroke);return!(!(0,h.Z)(p,2)[1]&&!n||!c)&&mp(i,o,a,s,c+d,e.x,e.y)}function Mp(t,e,n,r,i,o){var a=t.parsedStyle,s=a.lineWidth,l=void 0===s?1:s,c=a.increasedLineWidthForHitTesting,u=void 0===c?0:c,d=a.stroke,f=a.fill,p=a.d,g=a.pointerEvents,v=void 0===g?"auto":g,m=p.segments,y=p.hasArc,b=p.polylines,x=p.polygons,E=Pa(v,(null==x?void 0:x.length)&&f,d),w=(0,h.Z)(E,2),k=w[0],M=w[1],S=vo(t),A=!1;return k||n?A=y?r(t,e):wp(x,e.x,e.y)||wp(b,e.x,e.y):((M||n)&&(A=function(t,e,n,r,i){for(var o=!1,a=e/2,s=0;s<t.length;s++){var l=t[s],c=l.currentPoint,u=l.params,h=l.prePoint,d=l.box;if(!d||gp(d.x-a,d.y-a,d.width+e,d.height+e,n,r))switch(l.command){case"L":case"Z":if(o=mp(h[0],h[1],c[0],c[1],e,n,r))return!0;break;case"Q":if(o=Nn(h[0],h[1],u[1],u[2],u[3],u[4],n,r)<=e/2)return!0;break;case"C":if(o=wn(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=Ve(h[0],h[1],u[1],u[2],u[3],u[4],u[5],u[6],u[7],void 0));for(var f=l.cubicParams,p=h,g=0;g<f.length;g+=6){var v=wn(p[0],p[1],f[g],f[g+1],f[g+2],f[g+3],f[g+4],f[g+5],n,r,i);if(p=[f[g+4],f[g+5]],o=v<=e/2)return!0}}}return o}(m,l+u,e.x,e.y,S)),A)}function Sp(t,e,n){var r=t.parsedStyle,i=r.stroke,o=r.fill,a=r.lineWidth,s=void 0===a?1:a,l=r.increasedLineWidthForHitTesting,c=void 0===l?0:l,u=r.points,d=r.pointerEvents,f=Pa(void 0===d?"auto":d,o,i),p=(0,h.Z)(f,2),g=p[0],v=!1;return(p[1]||n)&&(v=yp(u.points,s+c,e.x,e.y,!0)),v||!g&&!n||(v=Ep(u.points,e.x,e.y)),v}function Ap(t,e,n){var r=t.parsedStyle,i=r.lineWidth,o=void 0===i?1:i,a=r.increasedLineWidthForHitTesting,s=void 0===a?0:a,l=r.points,c=r.pointerEvents,u=Pa(void 0===c?"auto":c,r.fill,r.stroke);return!(!(0,h.Z)(u,2)[1]&&!n||!o)&&yp(l.points,o+s,e.x,e.y,!1)}function Np(t,e,n,r,i){var o=t.parsedStyle,a=o.radius,s=o.fill,l=o.stroke,c=o.lineWidth,u=void 0===c?1:c,d=o.increasedLineWidthForHitTesting,f=void 0===d?0:d,p=o.x,g=void 0===p?0:p,v=o.y,m=void 0===v?0:v,y=o.width,b=o.height,x=o.pointerEvents,E=Pa(void 0===x?"auto":x,s,l),w=(0,h.Z)(E,2),k=w[0],M=w[1],S=u+f;if(a&&a.some((function(t){return 0!==t}))){var A=!1;return(M||n)&&(A=function(t,e,n,r,i,o,a,s){var l=(0,h.Z)(i,4),c=l[0],u=l[1],d=l[2],f=l[3];return mp(t+c,e,t+n-u,e,o,a,s)||mp(t+n,e+u,t+n,e+r-d,o,a,s)||mp(t+n-d,e+r,t+f,e+r,o,a,s)||mp(t,e+r-f,t,e+c,o,a,s)||vp(t+n-u,e+u,u,Math.PI,Math.PI,o,a,s)||vp(t+n-d,e+r-d,d,0,Math.PI,o,a,s)||vp(t+f,e+r-f,f,Math.PI,Math.PI,o,a,s)||vp(t+c,e+c,c,Math.PI,Math.PI,o,a,s)}(g,m,y,b,a.map((function(t){return le(t,0,Math.min(Math.abs(y)/2,Math.abs(b)/2))})),S,e.x,e.y)),A||!k&&!n||(A=r(t,e)),A}var N=S/2;return k&&M||n?gp(g-N,m-N,y+N,b+N,e.x,e.y):k?gp(g,m,y,b,e.x,e.y):!!M&&function(t,e,n,r,i,o,a){var s=i/2;return gp(t-s,e-s,n,i,o,a)||gp(t+n-s,e-s,i,r,o,a)||gp(t+s,e+r-s,n,i,o,a)||gp(t-s,e+s,i,r,o,a)}(g,m,y,b,S,e.x,e.y)}function Cp(t,e,n,r,i,a){var s=t.parsedStyle,l=s.pointerEvents,c=void 0===l?"auto":l,u=s.x,h=void 0===u?0:u,d=s.y,f=void 0===d?0:d,p=s.width,g=s.height;if("non-transparent-pixel"===c){var v=i.config.offscreenCanvas,m=a.offscreenCanvasCreator.getOrCreateCanvas(v),y=a.offscreenCanvasCreator.getOrCreateContext(v,{willReadFrequently:!0});return m.width=p,m.height=g,i.defaultStyleRendererFactory[Ln.IMAGE].render(y,(0,o.Z)((0,o.Z)({},t.parsedStyle),{},{x:0,y:0}),t,void 0,void 0,void 0),y.getImageData(e.x-h,e.y-f,1,1).data.every((function(t){return 0!==t}))}return!0}function Op(t,e,n,r){var i=t.getGeometryBounds();return e.x>=i.min[0]&&e.y>=i.min[1]&&e.x<=i.max[0]&&e.y<=i.max[1]}var Tp=function(t){function e(){var t;(0,a.Z)(this,e);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=(0,c.Z)(this,e,[].concat(r))).name="canvas-picker",t}return(0,u.Z)(e,t),(0,s.Z)(e,[{key:"init",value:function(){var t,e=(t={},(0,on.Z)((0,on.Z)((0,on.Z)((0,on.Z)((0,on.Z)((0,on.Z)((0,on.Z)((0,on.Z)((0,on.Z)((0,on.Z)(t,Ln.CIRCLE,dp),Ln.ELLIPSE,pp),Ln.RECT,Np),Ln.LINE,kp),Ln.POLYLINE,Ap),Ln.POLYGON,Sp),Ln.PATH,Mp),Ln.TEXT,Op),Ln.GROUP,null),Ln.IMAGE,Cp),(0,on.Z)((0,on.Z)(t,Ln.HTML,null),Ln.MESH,null));this.context.pointInPathPickerFactory=e,this.addRenderingPlugin(new hp)}},{key:"destroy",value:function(){delete this.context.pointInPathPickerFactory,this.removeAllRenderingPlugins()}}])}(Bn);function Pp(t,e){if(!{}.hasOwnProperty.call(t,e))throw new TypeError("attempted to use private field on non-instance");return t}var Rp=0;function Dp(t){return"__private_"+Rp+++"_"+t}var Lp=function(){return(0,s.Z)((function t(){(0,a.Z)(this,t),this.cacheStore=new Map}),[{key:"onRefAdded",value:function(t){}},{key:"has",value:function(t){return this.cacheStore.has(t)}},{key:"put",value:function(t,e,n){return!this.cacheStore.has(t)&&(this.cacheStore.set(t,{value:e,counter:new Set([n.entity])}),this.onRefAdded(n),!0)}},{key:"get",value:function(t,e){var n=this.cacheStore.get(t);return n?(n.counter.has(e.entity)||(n.counter.add(e.entity),this.onRefAdded(e)),n.value):null}},{key:"update",value:function(t,e,n){var r=this.cacheStore.get(t);return!!r&&(r.value=(0,o.Z)((0,o.Z)({},r.value),e),r.counter.has(n.entity)||(r.counter.add(n.entity),this.onRefAdded(n)),!0)}},{key:"release",value:function(t,e){var n=this.cacheStore.get(t);return!!n&&(n.counter.delete(e.entity),n.counter.size<=0&&this.cacheStore.delete(t),!0)}},{key:"releaseRef",value:function(t){var e=this;Array.from(this.cacheStore.keys()).forEach((function(n){e.release(n,t)}))}},{key:"getSize",value:function(){return this.cacheStore.size}},{key:"clear",value:function(){this.cacheStore.clear()}}])}(),Ip=[],Bp=[],jp=function(){function t(){(0,a.Z)(this,t)}return(0,s.Z)(t,null,[{key:"stop",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t.api;t.rafId&&(e.cancelAnimationFrame(t.rafId),t.rafId=null)}},{key:"executeTask",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t.api;Ip.length<=0&&Bp.length<=0||(Bp.forEach((function(t){return t()})),Bp=Ip.splice(0,t.TASK_NUM_PER_FRAME),t.rafId=e.requestAnimationFrame((function(){t.executeTask(e)})))}},{key:"sliceImage",value:function(e,n,r,i){for(var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:t.api,s=e.naturalWidth||e.width,l=e.naturalHeight||e.height,c=n-o,u=r-o,h=Math.ceil(s/c),d=Math.ceil(l/u),f={tileSize:[n,r],gridSize:[d,h],tiles:Array(d).fill(null).map((function(){return Array(h).fill(null)}))},p=function(t){for(var o=function(o){Ip.push((function(){var h=o*c,d=t*u,p=[Math.min(n,s-h),Math.min(r,l-d)],g=p[0],v=p[1],m=a.createCanvas();m.width=n,m.height=r,m.getContext("2d").drawImage(e,h,d,g,v,0,0,g,v),f.tiles[t][o]={x:h,y:d,tileX:o,tileY:t,data:m},i()}))},d=0;d<h;d++)o(d)},g=0;g<d;g++)p(g);return t.stop(),t.executeTask(),f}}])}();jp.TASK_NUM_PER_FRAME=10;var zp=new Lp;zp.onRefAdded=function(t){var e=this;t.addEventListener(Ps.DESTROY,(function(){e.releaseRef(t)}),{once:!0})};var Fp=function(){return(0,s.Z)((function t(e,n){(0,a.Z)(this,t),this.gradientCache={},this.patternCache={},this.context=e,this.runtime=n}),[{key:"getImageSync",value:function(t,e,n){var r=se(t)?t:t.src;if(zp.has(r)){var i=zp.get(r,e);if(i.img.complete)return null==n||n(i),i}return this.getOrCreateImage(t,e).then((function(t){null==n||n(t)})).catch((function(t){console.error(t)})),null}},{key:"getOrCreateImage",value:function(t,e){var n=this,r=se(t)?t:t.src;if(!se(t)&&!zp.has(r)){var i={img:t,size:[t.naturalWidth||t.width,t.naturalHeight||t.height],tileSize:_p(t)};zp.put(r,i,e)}if(zp.has(r)){var o=zp.get(r,e);return o.img.complete?Promise.resolve(o):new Promise((function(t,e){o.img.addEventListener("load",(function(){o.size=[o.img.naturalWidth||o.img.width,o.img.naturalHeight||o.img.height],o.tileSize=_p(o.img),t(o)})),o.img.addEventListener("error",(function(t){e(t)}))}))}return new Promise((function(t,i){var o=n.context.config.createImage();if(o){var a={img:o,size:[0,0],tileSize:_p(o)};zp.put(r,a,e),o.onload=function(){a.size=[o.naturalWidth||o.width,o.naturalHeight||o.height],a.tileSize=_p(a.img),t(a)},o.onerror=function(t){i(t)},o.crossOrigin="Anonymous",o.src=r}}))}},{key:"createDownSampledImage",value:(e=(0,On.Z)((0,Cn.Z)().mark((function t(e,n){var r,i,a,s,l,c,u,d,f,p,g,v,m,y;return(0,Cn.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=1,this.getOrCreateImage(e,n);case 1:if(void 0===(r=t.sent).downSamplingRate){t.next=2;break}return t.abrupt("return",r);case 2:if(i=this.context.config.enableLargeImageOptimization,s=(a="boolean"==typeof i?{}:i).maxDownSampledImageSize,l=void 0===s?2048:s,c=a.downSamplingRateThreshold,u=void 0===c?.5:c,d=this.runtime.globalThis.createImageBitmap,f=(0,h.Z)(r.size,2),p=f[0],g=f[1],v=r.img,m=Math.min((l+l)/(p+g),Math.max(.01,Math.min(u,.5))),y=(0,o.Z)((0,o.Z)({},r),{},{downSamplingRate:m}),zp.update(r.img.src,y,n),!d){t.next=7;break}return t.prev=3,t.next=4,d(r.img,{resizeWidth:p*m,resizeHeight:g*m});case 4:v=t.sent,t.next=6;break;case 5:t.prev=5,t.catch(3),m=1;case 6:t.next=8;break;case 7:m=1;case 8:return y=(0,o.Z)((0,o.Z)({},this.getImageSync(e,n)),{},{downSampled:v,downSamplingRate:m}),zp.update(r.img.src,y,n),t.abrupt("return",y);case 9:case"end":return t.stop()}}),t,this,[[3,5]])}))),function(t,n){return e.apply(this,arguments)})},{key:"createImageTiles",value:(t=(0,On.Z)((0,Cn.Z)().mark((function t(e,n,r,i){var a,s,l,c,u;return(0,Cn.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=1,this.getOrCreateImage(e,i);case 1:return a=t.sent,s=i.ownerDocument.defaultView,l=s.requestAnimationFrame,c=s.cancelAnimationFrame,jp.api={requestAnimationFrame:l,cancelAnimationFrame:c,createCanvas:function(){return As.createCanvas()}},u=(0,o.Z)((0,o.Z)({},a),jp.sliceImage(a.img,a.tileSize[0],a.tileSize[0],r)),zp.update(a.img.src,u,i),t.abrupt("return",u);case 2:case"end":return t.stop()}}),t,this)}))),function(e,n,r,i){return t.apply(this,arguments)})},{key:"releaseImage",value:function(t,e){zp.release(se(t)?t:t.src,e)}},{key:"releaseImageRef",value:function(t){zp.releaseRef(t)}},{key:"getOrCreatePatternSync",value:function(t,e,n,r,i,o,a){var s=this.generatePatternKey(e);if(s&&this.patternCache[s])return this.patternCache[s];var l,c=e.image,u=e.repetition,h=e.transform,d=!1;if(se(c)){var f=this.getImageSync(c,t,a);l=null==f?void 0:f.img}else r?(l=r,d=!0):l=c;var p,g=l&&n.createPattern(l,u);g&&(p=h?os(_o(h),new El({})):W(F()),d&&Q(p,p,[1/i,1/i,1]),g.setTransform({a:p[0],b:p[1],c:p[4],d:p[5],e:p[12]+o[0],f:p[13]+o[1]}));return s&&g&&(this.patternCache[s]=g),g}},{key:"getOrCreateGradient",value:function(t,e){var n=this.generateGradientKey(t),r=t.type,i=t.steps,o=t.min,a=t.width,s=t.height,l=t.angle,c=t.cx,u=t.cy,h=t.size;if(this.gradientCache[n])return this.gradientCache[n];var d=null;if(r===Ei.LinearGradient){var f=function(t,e,n,r){var i=nr(r.value),o=0+e/2,a=0+n/2,s=Math.abs(e*Math.cos(i))+Math.abs(n*Math.sin(i));return{x1:t[0]+o-Math.cos(i)*s/2,y1:t[1]+a-Math.sin(i)*s/2,x2:t[0]+o+Math.cos(i)*s/2,y2:t[1]+a+Math.sin(i)*s/2}}(o,a,s,l),p=f.x1,g=f.y1,v=f.x2,m=f.y2;d=e.createLinearGradient(p,g,v,m)}else if(r===Ei.RadialGradient){var y=function(t,e,n,r,i,o){var a=r.value,s=i.value;r.unit===ui.kPercentage&&(a=r.value/100*e),i.unit===ui.kPercentage&&(s=i.value/100*n);var l=Math.max(oe([0,0],[a,s]),oe([0,n],[a,s]),oe([e,n],[a,s]),oe([e,0],[a,s]));return o&&(o instanceof Si?l=o.value:o instanceof ki&&("closest-side"===o.value?l=Math.min(a,e-a,s,n-s):"farthest-side"===o.value?l=Math.max(a,e-a,s,n-s):"closest-corner"===o.value&&(l=Math.min(oe([0,0],[a,s]),oe([0,n],[a,s]),oe([e,n],[a,s]),oe([e,0],[a,s]))))),{x:a+t[0],y:s+t[1],r:l}}(o,a,s,c,u,h),b=y.x,x=y.y,E=y.r;d=e.createRadialGradient(b,x,0,b,x,E)}return d&&(i.forEach((function(t){var e,n=t.offset,r=t.color;n.unit===ui.kPercentage&&(null===(e=d)||void 0===e||e.addColorStop(n.value/100,r.toString()))})),this.gradientCache[n]=d),this.gradientCache[n]}},{key:"generateGradientKey",value:function(t){var e=t.type,n=t.min,r=t.width,i=t.height,o=t.steps,a=t.angle,s=t.cx,l=t.cy,c=t.size;return"gradient-".concat(e,"-").concat((null==a?void 0:a.toString())||0,"-").concat((null==s?void 0:s.toString())||0,"-").concat((null==l?void 0:l.toString())||0,"-").concat((null==c?void 0:c.toString())||0,"-").concat(n[0],"-").concat(n[1],"-").concat(r,"-").concat(i,"-").concat(o.map((function(t){var e=t.offset,n=t.color;return"".concat(e).concat(n)})).join("-"))}},{key:"generatePatternKey",value:function(t){var e=t.image,n=t.repetition;return se(e)?"pattern-".concat(e,"-").concat(n):"rect"===e.nodeName?"pattern-".concat(e.entity,"-").concat(n):void 0}}]);var t,e}();function _p(t){if(!t.complete)return[0,0];var e=t.naturalWidth||t.width,n=t.naturalHeight||t.height,r=256;return[256,512].forEach((function(t){Math.ceil(n/t)*Math.ceil(e/t)<1e3&&(r=t)})),[r,r]}Fp.isSupportTile=!!As.createCanvas();var Zp=function(){function t(){(0,a.Z)(this,t)}return(0,s.Z)(t,[{key:"apply",value:function(e){var n=e.renderingService,r=e.renderingContext,i=e.imagePool,o=r.root.ownerDocument.defaultView,a=function(t,e,n){var r=t.parsedStyle,i=r.width,o=r.height;i&&!o?t.setAttribute("height",n/e*i):!i&&o&&t.setAttribute("width",e/n*o)},s=function(t){var e=t.target,r=e.nodeName,o=e.attributes;if(r===Ln.IMAGE){var s=o.src,l=o.keepAspectRatio;i.getImageSync(s,e,(function(t){var r=t.img,i=r.width,o=r.height;l&&a(e,i,o),e.renderable.dirty=!0,n.dirtify()}))}},l=function(t){var e=t.target,r=t.attrName,o=t.prevValue,s=t.newValue;e.nodeName===Ln.IMAGE&&"src"===r&&(o!==s&&i.releaseImage(o,e),se(s)&&i.getOrCreateImage(s,e).then((function(t){var r=t.img,i=r.width,o=r.height;e.attributes.keepAspectRatio&&a(e,i,o),e.renderable.dirty=!0,n.dirtify()})).catch((function(){})))};n.hooks.init.tap(t.tag,(function(){o.addEventListener(Ps.MOUNTED,s),o.addEventListener(Ps.ATTR_MODIFIED,l)})),n.hooks.destroy.tap(t.tag,(function(){o.removeEventListener(Ps.MOUNTED,s),o.removeEventListener(Ps.ATTR_MODIFIED,l)}))}}])}();Zp.tag="LoadImage";var Gp=function(t){function e(){var t;(0,a.Z)(this,e);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=(0,c.Z)(this,e,[].concat(r))).name="image-loader",t}return(0,u.Z)(e,t),(0,s.Z)(e,[{key:"init",value:function(t){this.context.imagePool=new Fp(this.context,t),this.addRenderingPlugin(new Zp)}},{key:"destroy",value:function(){this.removeAllRenderingPlugins()}}])}(Bn),Vp=Dp("renderState"),Wp=function(){function t(e){(0,a.Z)(this,t),this.removedRBushNodeAABBs=[],this.renderQueue=[],Object.defineProperty(this,Vp,{writable:!0,value:{restoreStack:[],prevObject:null,currentContext:new Map}}),this.clearFullScreenLastFrame=!1,this.clearFullScreen=!1,this.vpMatrix=F(),this.dprMatrix=F(),this.tmpMat4=F(),this.vec3a=g(),this.vec3b=g(),this.vec3c=g(),this.vec3d=g(),this.canvasRendererPluginOptions=e}return(0,s.Z)(t,[{key:"apply",value:function(e,n){var r=this;this.context=e;var i=this.context,o=i.config,a=i.camera,s=i.renderingService,c=i.renderingContext,u=i.rBushRoot,h=i.pathGeneratorFactory,d=o.renderer.getConfig().enableRenderingOptimization;o.renderer.getConfig().enableDirtyCheck=!1,o.renderer.getConfig().enableDirtyRectangleRendering=!1,this.rBush=u,this.pathGeneratorFactory=h;var f=e.contextService,p=c.root.ownerDocument.defaultView,g=function(t){var e=t.target.rBushNode;null!=e&&e.aabb&&r.removedRBushNodeAABBs.push(e.aabb)},v=function(t){var e=t.target.rBushNode;e.aabb&&r.removedRBushNodeAABBs.push(e.aabb)};s.hooks.init.tap(t.tag,(function(){p.addEventListener(Ps.UNMOUNTED,g),p.addEventListener(Ps.CULLED,v);var t=f.getDPR(),e=o.width,n=o.height,i=f.getContext();r.clearRect(i,0,0,e*t,n*t,o.background)})),s.hooks.destroy.tap(t.tag,(function(){p.removeEventListener(Ps.UNMOUNTED,g),p.removeEventListener(Ps.CULLED,v),r.renderQueue=[],r.removedRBushNodeAABBs=[],Pp(r,Vp)[Vp]={restoreStack:[],prevObject:null,currentContext:null}}));var m=function(t,e){for(var i=[t];i.length>0;){var o,a=i.pop();a.isVisible()&&!a.isCulled()&&(d?r.renderDisplayObjectOptimized(a,e,r.context,Pp(r,Vp)[Vp],n):r.renderDisplayObject(a,e,r.context,Pp(r,Vp)[Vp],n));for(var s=(null===(o=a.sortable)||void 0===o||null===(o=o.sorted)||void 0===o?void 0:o.length)>0?a.sortable.sorted:a.childNodes,l=s.length-1;l>=0;l--)i.push(s[l])}};s.hooks.endFrame.tap(t.tag,(function(){if(function(){var t,e=f.getContext(),n=f.getDPR(),i=o.width,a=o.height,l=r.canvasRendererPluginOptions,c=l.dirtyObjectNumThreshold,u=l.dirtyObjectRatioThreshold,h=s.getStats(),d=h.total,g=h.rendered,v=g/d;r.clearFullScreen=r.clearFullScreenLastFrame||!(null!==(t=p.context.renderingPlugins[1])&&void 0!==t&&t.isFirstTimeRenderingFinished)||s.disableDirtyRectangleRendering()||g>c&&v>u,e&&("function"==typeof e.resetTransform?e.resetTransform():e.setTransform(1,0,0,1,0,0),r.clearFullScreen&&r.clearRect(e,0,0,i*n,a*n,o.background))}(),0!==c.root.childNodes.length){d=o.renderer.getConfig().enableRenderingOptimization,Pp(r,Vp)[Vp]={restoreStack:[],prevObject:null,currentContext:Pp(r,Vp)[Vp].currentContext},Pp(r,Vp)[Vp].currentContext.clear(),r.clearFullScreenLastFrame=!1;var t=f.getContext(),e=f.getDPR();if(rt(r.dprMatrix,[e,e,1]),X(r.vpMatrix,r.dprMatrix,a.getOrthoMatrix()),r.clearFullScreen)d?(t.save(),m(c.root,t),t.restore()):m(c.root,t),r.removedRBushNodeAABBs=[];else{var i=r.safeMergeAABB.apply(r,[r.mergeDirtyAABBs(r.renderQueue)].concat((0,l.Z)(r.removedRBushNodeAABBs.map((function(t){var e=t.minX,n=t.minY,r=t.maxX,i=t.maxY,o=new Wn;return o.setMinMax([e,n,0],[r,i,0]),o})))));if(r.removedRBushNodeAABBs=[],Wn.isEmpty(i))return void(r.renderQueue=[]);var u=r.convertAABB2Rect(i),h=u.x,g=u.y,v=u.width,y=u.height,b=O(r.vec3a,[h,g,0],r.vpMatrix),x=O(r.vec3b,[h+v,g,0],r.vpMatrix),E=O(r.vec3c,[h,g+y,0],r.vpMatrix),w=O(r.vec3d,[h+v,g+y,0],r.vpMatrix),k=Math.min(b[0],x[0],w[0],E[0]),M=Math.min(b[1],x[1],w[1],E[1]),S=Math.max(b[0],x[0],w[0],E[0]),A=Math.max(b[1],x[1],w[1],E[1]),N=Math.floor(k),C=Math.floor(M),T=Math.ceil(S-k),P=Math.ceil(A-M);t.save(),r.clearRect(t,N,C,T,P,o.background),t.beginPath(),t.rect(N,C,T,P),t.clip(),t.setTransform(r.vpMatrix[0],r.vpMatrix[1],r.vpMatrix[4],r.vpMatrix[5],r.vpMatrix[12],r.vpMatrix[13]),o.renderer.getConfig().enableDirtyRectangleRenderingDebug&&p.dispatchEvent(new ws(ql.DIRTY_RECTANGLE,{dirtyRect:{x:N,y:C,width:T,height:P}})),r.searchDirtyObjects(i).sort((function(t,e){return t.sortable.renderOrder-e.sortable.renderOrder})).forEach((function(e){e&&e.isVisible()&&!e.isCulled()&&r.renderDisplayObject(e,t,r.context,Pp(r,Vp)[Vp],n)})),t.restore(),r.renderQueue.forEach((function(t){r.saveDirtyAABB(t)})),r.renderQueue=[]}Pp(r,Vp)[Vp].restoreStack.forEach((function(){t.restore()})),Pp(r,Vp)[Vp].restoreStack=[]}else r.clearFullScreenLastFrame=!0})),s.hooks.render.tap(t.tag,(function(t){r.clearFullScreen||r.renderQueue.push(t)}))}},{key:"clearRect",value:function(t,e,n,r,i,o){t.clearRect(e,n,r,i),o&&(t.fillStyle=o,t.fillRect(e,n,r,i))}},{key:"renderDisplayObjectOptimized",value:function(t,e,n,r,i){var o=t.nodeName,a=!1,s=this.context.styleRendererFactory[o],l=this.pathGeneratorFactory[o],c=t.parsedStyle.clipPath;if(c){(!r.prevObject||!Dt(c.getWorldTransform(),r.prevObject.getWorldTransform()))&&(this.applyWorldTransform(e,c),r.prevObject=null);var u=this.pathGeneratorFactory[c.nodeName];u&&(e.save(),a=!0,e.beginPath(),u(e,c.parsedStyle),e.closePath(),e.clip())}if(s){(!r.prevObject||!Dt(t.getWorldTransform(),r.prevObject.getWorldTransform()))&&this.applyWorldTransform(e,t);var h=!r.prevObject;if(!h){var d=r.prevObject.nodeName;h=o===Ln.TEXT?d!==Ln.TEXT:o===Ln.IMAGE?d!==Ln.IMAGE:d===Ln.TEXT||d===Ln.IMAGE}s.applyStyleToContext(e,t,h,r),r.prevObject=t}l&&(e.beginPath(),l(e,t.parsedStyle),o!==Ln.LINE&&o!==Ln.PATH&&o!==Ln.POLYLINE&&e.closePath()),s&&s.drawToContext(e,t,Pp(this,Vp)[Vp],this,i),a&&e.restore(),t.dirty(!1)}},{key:"renderDisplayObject",value:function(t,e,n,r,i){var o=t.nodeName,a=r.restoreStack[r.restoreStack.length-1];!a||t.compareDocumentPosition(a)&Ms.DOCUMENT_POSITION_CONTAINS||(e.restore(),r.restoreStack.pop());var s=this.context.styleRendererFactory[o],l=this.pathGeneratorFactory[o],c=t.parsedStyle.clipPath;if(c){this.applyWorldTransform(e,c);var u=this.pathGeneratorFactory[c.nodeName];u&&(e.save(),r.restoreStack.push(t),e.beginPath(),u(e,c.parsedStyle),e.closePath(),e.clip())}s&&(this.applyWorldTransform(e,t),e.save(),this.applyAttributesToContext(e,t)),l&&(e.beginPath(),l(e,t.parsedStyle),o!==Ln.LINE&&o!==Ln.PATH&&o!==Ln.POLYLINE&&e.closePath()),s&&(s.render(e,t.parsedStyle,t,n,this,i),e.restore()),t.dirty(!1)}},{key:"applyAttributesToContext",value:function(t,e){var n=e.parsedStyle,r=n.stroke,i=n.fill,o=n.opacity,a=n.lineDash,s=n.lineDashOffset;a&&t.setLineDash(a),ae(s)||(t.lineDashOffset=s),ae(o)||(t.globalAlpha*=o),ae(r)||Array.isArray(r)||r.isNone||(t.strokeStyle=e.attributes.stroke),ae(i)||Array.isArray(i)||i.isNone||(t.fillStyle=e.attributes.fill)}},{key:"convertAABB2Rect",value:function(t){var e=t.getMin(),n=t.getMax(),r=Math.floor(e[0]),i=Math.floor(e[1]);return{x:r,y:i,width:Math.ceil(n[0])-r,height:Math.ceil(n[1])-i}}},{key:"mergeDirtyAABBs",value:function(t){var e=new Wn;return t.forEach((function(t){var n=t.getRenderBounds();e.add(n);var r=t.renderable.dirtyRenderBounds;r&&e.add(r)})),e}},{key:"searchDirtyObjects",value:function(t){var e=t.getMin(),n=(0,h.Z)(e,2),r=n[0],i=n[1],o=t.getMax(),a=(0,h.Z)(o,2),s=a[0],l=a[1];return this.rBush.search({minX:r,minY:i,maxX:s,maxY:l}).map((function(t){return t.displayObject}))}},{key:"saveDirtyAABB",value:function(t){var e=t.renderable;e.dirtyRenderBounds||(e.dirtyRenderBounds=new Wn);var n=t.getRenderBounds();n&&e.dirtyRenderBounds.update(n.center,n.halfExtents)}},{key:"applyWorldTransform",value:function(t,e,n){n?(Z(this.tmpMat4,e.getLocalTransform()),X(this.tmpMat4,n,this.tmpMat4),X(this.tmpMat4,this.vpMatrix,this.tmpMat4)):(Z(this.tmpMat4,e.getWorldTransform()),X(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])}},{key:"safeMergeAABB",value:function(){for(var t=new Wn,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return n.forEach((function(e){t.add(e)})),t}}])}();function Hp(t,e,n,r,i,o,a){var s,l;if("rect"===t.image.nodeName){var c=t.image.parsedStyle,u=c.width,h=c.height;l=r.contextService.getDPR();var d=r.config.offscreenCanvas;(s=o.offscreenCanvasCreator.getOrCreateCanvas(d)).width=u*l,s.height=h*l;var f=o.offscreenCanvasCreator.getOrCreateContext(d),p={restoreStack:[],prevObject:null,currentContext:new Map};t.image.forEach((function(t){i.renderDisplayObject(t,f,r,p,o)})),p.restoreStack.forEach((function(){f.restore()}))}return a.getOrCreatePatternSync(e,t,n,s,l,e.getGeometryBounds().min,(function(){e.dirty(),r.renderingService.dirtify()}))}function Up(t,e,n,r){var i;if(t.type===Ei.LinearGradient||t.type===Ei.RadialGradient){var a=e.getGeometryBounds(),s=a&&2*a.halfExtents[0]||1,l=a&&2*a.halfExtents[1]||1,c=a&&a.min||[0,0];i=r.getOrCreateGradient((0,o.Z)((0,o.Z)({type:t.type},t.value),{},{min:c,width:s,height:l}),n)}return i}Wp.tag="CanvasRenderer";var Yp=["shadowBlur","shadowOffsetX","shadowOffsetY"],qp=["lineCap","lineJoin","miterLimit"],Xp={globalAlpha:1,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"#000",filter:"none",globalCompositeOperation:"source-over",strokeStyle:"#000",strokeOpacity:1,lineWidth:1,lineDash:[],lineDashOffset:0,lineCap:"butt",lineJoin:"miter",miterLimit:10,fillStyle:"#000",fillOpacity:1},Kp={};function Qp(t,e,n,r){var i=r.has(e)?r.get(e):Xp[e];return i!==n&&("lineDash"===e?t.setLineDash(n):t[e]=n,r.set(e,n)),i}var Jp=function(){return(0,s.Z)((function t(e){(0,a.Z)(this,t),this.imagePool=e}),[{key:"applyAttributesToContext",value:function(t,e){}},{key:"render",value:function(t,e,n,r,i,o){}},{key:"applyCommonStyleToContext",value:function(t,e,n,r){var i=n?Kp:r.prevObject.parsedStyle,o=e.parsedStyle;(n||o.opacity!==i.opacity)&&Qp(t,"globalAlpha",ae(o.opacity)?Xp.globalAlpha:o.opacity,r.currentContext),(n||o.blend!==i.blend)&&Qp(t,"globalCompositeOperation",ae(o.blend)?Xp.globalCompositeOperation:o.blend,r.currentContext)}},{key:"applyStrokeFillStyleToContext",value:function(t,e,n,r){var i=n?Kp:r.prevObject.parsedStyle,o=e.parsedStyle,a=o.lineWidth,s=void 0===a?Xp.lineWidth:a,l=o.fill&&!o.fill.isNone;if(o.stroke&&!o.stroke.isNone&&s>0){if(n||e.attributes.stroke!==r.prevObject.attributes.stroke)Qp(t,"strokeStyle",ae(o.stroke)||Array.isArray(o.stroke)||o.stroke.isNone?Xp.strokeStyle:e.attributes.stroke,r.currentContext);(n||o.lineWidth!==i.lineWidth)&&Qp(t,"lineWidth",ae(o.lineWidth)?Xp.lineWidth:o.lineWidth,r.currentContext),(n||o.lineDash!==i.lineDash)&&Qp(t,"lineDash",o.lineDash||Xp.lineDash,r.currentContext),(n||o.lineDashOffset!==i.lineDashOffset)&&Qp(t,"lineDashOffset",ae(o.lineDashOffset)?Xp.lineDashOffset:o.lineDashOffset,r.currentContext);for(var c=0;c<qp.length;c++){var u=qp[c];(n||o[u]!==i[u])&&Qp(t,u,ae(o[u])?Xp[u]:o[u],r.currentContext)}}l&&(n||e.attributes.fill!==r.prevObject.attributes.fill)&&Qp(t,"fillStyle",ae(o.fill)||Array.isArray(o.fill)||o.fill.isNone?Xp.fillStyle:e.attributes.fill,r.currentContext)}},{key:"applyStyleToContext",value:function(t,e,n,r){var i=e.nodeName;this.applyCommonStyleToContext(t,e,n,r),i===Ln.IMAGE||this.applyStrokeFillStyleToContext(t,e,n,r)}},{key:"applyShadowAndFilterStyleToContext",value:function(t,e,n,r){var i=e.parsedStyle;if(n){Qp(t,"shadowColor",i.shadowColor.toString(),r.currentContext);for(var o=0;o<Yp.length;o++){var a=Yp[o];Qp(t,a,i[a]||Xp[a],r.currentContext)}}i.filter&&i.filter.length&&Qp(t,"filter",e.attributes.filter,r.currentContext)}},{key:"clearShadowAndFilterStyleForContext",value:function(t,e,n,r){var i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(e){Qp(t,"shadowColor",Xp.shadowColor,r.currentContext);for(var o=0;o<Yp.length;o++){var a=Yp[o];Qp(t,a,Xp[a],r.currentContext)}}if(n)if(e&&i){var s=t.filter;!ae(s)&&s.indexOf("drop-shadow")>-1&&Qp(t,"filter",s.replace(/drop-shadow\([^)]*\)/,"").trim()||Xp.filter,r.currentContext)}else Qp(t,"filter",Xp.filter,r.currentContext)}},{key:"fillToContext",value:function(t,e,n,r,i){var o=this,a=e.parsedStyle,s=a.fill,l=a.fillRule,c=null;if(Array.isArray(s)&&s.length>0)s.forEach((function(r){var i=Qp(t,"fillStyle",Up(r,e,t,o.imagePool),n.currentContext);c=null!=c?c:i,l?t.fill(l):t.fill()}));else{if(Hi(s)){var u=Hp(s,e,t,e.ownerDocument.defaultView.context,r,i,this.imagePool);u&&(t.fillStyle=u,c=!0)}l?t.fill(l):t.fill()}null!==c&&Qp(t,"fillStyle",c,n.currentContext)}},{key:"strokeToContext",value:function(t,e,n,r,i){var o=this,a=e.parsedStyle.stroke,s=null;if(Array.isArray(a)&&a.length>0)a.forEach((function(r){var i=Qp(t,"strokeStyle",Up(r,e,t,o.imagePool),n.currentContext);s=null!=s?s:i,t.stroke()}));else{if(Hi(a)){var l=Hp(a,e,t,e.ownerDocument.defaultView.context,r,i,this.imagePool);if(l){var c=Qp(t,"strokeStyle",l,n.currentContext);s=null!=s?s:c}}t.stroke()}null!==s&&Qp(t,"strokeStyle",s,n.currentContext)}},{key:"drawToContext",value:function(t,e,n,r,i){var o,a=e.nodeName,s=e.parsedStyle,l=s.opacity,c=void 0===l?Xp.globalAlpha:l,u=s.fillOpacity,h=void 0===u?Xp.fillOpacity:u,d=s.strokeOpacity,f=void 0===d?Xp.strokeOpacity:d,p=s.lineWidth,g=void 0===p?Xp.lineWidth:p,v=s.fill&&!s.fill.isNone,m=s.stroke&&!s.stroke.isNone&&g>0;if(v||m){var y=!ae(s.shadowColor)&&s.shadowBlur>0,b="inner"===s.shadowType,x=0===(null===(o=s.fill)||void 0===o?void 0:o.alpha),E=!(!s.filter||!s.filter.length),w=y&&m&&(a===Ln.PATH||a===Ln.LINE||a===Ln.POLYLINE||x||b),k=null;if(v)w||this.applyShadowAndFilterStyleToContext(t,e,y,n),k=Qp(t,"globalAlpha",c*h,n.currentContext),this.fillToContext(t,e,n,r,i),w||this.clearShadowAndFilterStyleForContext(t,y,E,n);if(m){var M=!1,S=Qp(t,"globalAlpha",c*f,n.currentContext);if(k=v?k:S,w&&(this.applyShadowAndFilterStyleToContext(t,e,y,n),M=!0,b)){var A=t.globalCompositeOperation;t.globalCompositeOperation="source-atop",this.strokeToContext(t,e,n,r,i),t.globalCompositeOperation=A,this.clearShadowAndFilterStyleForContext(t,y,E,n,!0)}this.strokeToContext(t,e,n,r,i),M&&this.clearShadowAndFilterStyleForContext(t,y,E,n)}null!==k&&Qp(t,"globalAlpha",k,n.currentContext)}}}])}(),$p=function(t){function e(){return(0,a.Z)(this,e),(0,c.Z)(this,e,arguments)}return(0,u.Z)(e,t),(0,s.Z)(e,[{key:"render",value:function(t,e,n,r,i,o){var a=e.fill,s=e.fillRule,l=e.opacity,c=void 0===l?1:l,u=e.fillOpacity,h=void 0===u?1:u,d=e.stroke,f=e.strokeOpacity,p=void 0===f?1:f,g=e.lineWidth,v=void 0===g?1:g,m=e.lineCap,y=e.lineJoin,b=e.shadowType,x=e.shadowColor,E=e.shadowBlur,w=e.filter,k=e.miterLimit,M=a&&!a.isNone,S=d&&!d.isNone&&v>0,A=0===(null==a?void 0:a.alpha),N=!(!w||!w.length),C=!ae(x)&&E>0,O=n.nodeName,T="inner"===b,P=S&&C&&(O===Ln.PATH||O===Ln.LINE||O===Ln.POLYLINE||A||T);M&&(t.globalAlpha=c*h,P||tg(n,t,C),eg(t,n,a,s,r,i,o,this.imagePool),P||this.clearShadowAndFilter(t,N,C)),S&&(t.globalAlpha=c*p,t.lineWidth=v,ae(k)||(t.miterLimit=k),ae(m)||(t.lineCap=m),ae(y)||(t.lineJoin=y),P&&(T&&(t.globalCompositeOperation="source-atop"),tg(n,t,!0),T&&(ng(t,n,d,r,i,o,this.imagePool),t.globalCompositeOperation=Xp.globalCompositeOperation,this.clearShadowAndFilter(t,N,!0))),ng(t,n,d,r,i,o,this.imagePool))}},{key:"clearShadowAndFilter",value:function(t,e,n){if(n&&(t.shadowColor="transparent",t.shadowBlur=0),e){var r=t.filter;!ae(r)&&r.indexOf("drop-shadow")>-1&&(t.filter=r.replace(/drop-shadow\([^)]*\)/,"").trim()||"none")}}}])}(Jp);function tg(t,e,n){var r=t.parsedStyle,i=r.filter,o=r.shadowColor,a=r.shadowBlur,s=r.shadowOffsetX,l=r.shadowOffsetY;i&&i.length&&(e.filter=t.style.filter),n&&(e.shadowColor=o.toString(),e.shadowBlur=a||0,e.shadowOffsetX=s||0,e.shadowOffsetY=l||0)}function eg(t,e,n,r,i,o,a,s){var l=arguments.length>8&&void 0!==arguments[8]&&arguments[8];Array.isArray(n)?n.forEach((function(n){t.fillStyle=Up(n,e,t,s),l||(r?t.fill(r):t.fill())})):(Hi(n)&&(t.fillStyle=Hp(n,e,t,i,o,a,s)),l||(r?t.fill(r):t.fill()))}function ng(t,e,n,r,i,o,a){var s=arguments.length>7&&void 0!==arguments[7]&&arguments[7];Array.isArray(n)?n.forEach((function(n){t.strokeStyle=Up(n,e,t,a),s||t.stroke()})):(Hi(n)&&(t.strokeStyle=Hp(n,e,t,r,i,o,a)),s||t.stroke())}var rg=function(t){function e(){return(0,a.Z)(this,e),(0,c.Z)(this,e,arguments)}return(0,u.Z)(e,t),(0,s.Z)(e,[{key:"renderDownSampled",value:function(t,e,n,r){var i=r.src,o=r.imageCache;o.downSampled?t.drawImage(o.downSampled,Math.floor(r.drawRect[0]),Math.floor(r.drawRect[1]),Math.ceil(r.drawRect[2]),Math.ceil(r.drawRect[3])):this.imagePool.createDownSampledImage(i,n).then((function(){n.ownerDocument&&(n.dirty(),n.ownerDocument.defaultView.context.renderingService.dirtify())})).catch((function(t){console.error(t)}))}},{key:"renderTile",value:function(t,e,n,r){var i=r.src,o=r.imageCache,a=r.imageRect,s=r.drawRect,l=o.size,c=t.getTransform(),u=c.a,h=c.b,d=c.c,f=c.d,p=c.e,g=c.f;if(t.resetTransform(),null!=o&&o.gridSize){for(var v=[l[0]/a[2],l[1]/a[3]],m=[o.tileSize[0]/v[0],o.tileSize[1]/v[1]],y=[Math.floor((s[0]-a[0])/m[0]),Math.ceil((s[0]+s[2]-a[0])/m[0])],b=y[0],x=y[1],E=[Math.floor((s[1]-a[1])/m[1]),Math.ceil((s[1]+s[3]-a[1])/m[1])],w=E[1],k=E[0];k<=w;k++)for(var M=b;M<=x;M++){var S=o.tiles[k][M];if(S){var A=[Math.floor(a[0]+S.tileX*m[0]),Math.floor(a[1]+S.tileY*m[1]),Math.ceil(m[0]),Math.ceil(m[1])];t.drawImage(S.data,A[0],A[1],A[2],A[3])}}t.setTransform(u,h,d,f,p,g)}else this.imagePool.createImageTiles(i,[],(function(){n.ownerDocument&&(n.dirty(),n.ownerDocument.defaultView.context.renderingService.dirtify())}),n).catch((function(t){console.error(t)}))}},{key:"render",value:function(t,n,r){var i=n.x,o=void 0===i?0:i,a=n.y,s=void 0===a?0:a,l=n.width,c=n.height,u=n.src,d=n.shadowColor,f=n.shadowBlur,p=this.imagePool.getImageSync(u,r),v=null==p?void 0:p.img,m=l,y=c;if(v){var b,x,E,w,k,M,S,A,N,C,T,P,R,D,L,I;m||(m=v.width),y||(y=v.height),tg(r,t,!ae(d)&&f>0);try{var B=r.ownerDocument.defaultView.getContextService().getDomElement(),j=B.width,z=B.height,F=t.getTransform(),_=F.a,Z=F.b,V=function(t,e){var n=O(g(),[t[0],t[1],0],e),r=O(g(),[t[0]+t[2],t[1],0],e),i=O(g(),[t[0],t[1]+t[3],0],e),o=O(g(),[t[0]+t[2],t[1]+t[3],0],e);return[Math.min(n[0],r[0],i[0],o[0]),Math.min(n[1],r[1],i[1],o[1]),Math.max(n[0],r[0],i[0],o[0])-Math.min(n[0],r[0],i[0],o[0]),Math.max(n[1],r[1],i[1],o[1])-Math.min(n[1],r[1],i[1],o[1])]}([o,s,m,y],G(_,F.c,0,0,Z,F.d,0,0,0,0,1,0,F.e,F.f,0,1)),W=(b=[0,0,j,z],x=V,E=(0,h.Z)(b,4),w=E[0],k=E[1],M=E[2],S=E[3],A=(0,h.Z)(x,4),N=A[0],C=A[1],T=A[2],P=A[3],R=Math.max(w,N),D=Math.max(k,C),L=Math.min(w+M,N+T),I=Math.min(k+S,C+P),L<=R||I<=D?null:[R,D,L-R,I-D]);if(!W)return;if(!r.ownerDocument.defaultView.getConfig().enableLargeImageOptimization)return void e.renderFull(t,n,r,{image:v,drawRect:[o,s,m,y]});if(V[2]/p.size[0]<(p.downSamplingRate||.5))return void this.renderDownSampled(t,n,r,{src:u,imageCache:p,drawRect:[o,s,m,y]});if(!Fp.isSupportTile)return void e.renderFull(t,n,r,{image:v,drawRect:[o,s,m,y]});this.renderTile(t,n,r,{src:u,imageCache:p,imageRect:V,drawRect:W})}catch(t){}}}},{key:"drawToContext",value:function(t,e,n,r,i){this.render(t,e.parsedStyle,e)}}],[{key:"renderFull",value:function(t,e,n,r){t.drawImage(r.image,Math.floor(r.drawRect[0]),Math.floor(r.drawRect[1]),Math.ceil(r.drawRect[2]),Math.ceil(r.drawRect[3]))}}])}($p),ig=function(t){function e(){return(0,a.Z)(this,e),(0,c.Z)(this,e,arguments)}return(0,u.Z)(e,t),(0,s.Z)(e,[{key:"render",value:function(t,e,n,r,i,o){n.getBounds();var a=e.lineWidth,s=void 0===a?1:a,l=e.textAlign,c=void 0===l?"start":l,u=e.textBaseline,h=void 0===u?"alphabetic":u,d=e.lineJoin,f=void 0===d?"miter":d,p=e.miterLimit,g=void 0===p?10:p,v=e.letterSpacing,m=void 0===v?0:v,y=e.stroke,b=e.fill,x=e.fillRule,E=e.fillOpacity,w=void 0===E?1:E,k=e.strokeOpacity,M=void 0===k?1:k,S=e.opacity,A=void 0===S?1:S,N=e.metrics,C=e.x,O=void 0===C?0:C,T=e.y,P=void 0===T?0:T,R=e.dx,D=e.dy,L=e.shadowColor,I=e.shadowBlur,B=N.font,j=N.lines,z=N.height,F=N.lineHeight,_=N.lineMetrics;t.font=B,t.lineWidth=s,t.textAlign="middle"===c?"center":c;var Z=h;"alphabetic"===Z&&(Z="bottom"),t.lineJoin=f,ae(g)||(t.miterLimit=g);var G=P;"middle"===h?G+=-z/2-F/2:"bottom"===h||"alphabetic"===h||"ideographic"===h?G+=-z:"top"!==h&&"hanging"!==h||(G+=-F);var V=O+(R||0);G+=D||0,1===j.length&&("bottom"===Z?(Z="middle",G-=.5*z):"top"===Z&&(Z="middle",G+=.5*z)),t.textBaseline=Z,tg(n,t,!ae(L)&&I>0);for(var W=0;W<j.length;W++){var H=s/2+V;G+=F,ae(y)||y.isNone||!s||this.drawLetterSpacing(t,n,j[W],_[W],c,H,G,m,b,x,w,y,M,A,!0,r,i,o),ae(b)||this.drawLetterSpacing(t,n,j[W],_[W],c,H,G,m,b,x,w,y,M,A,!1,r,i,o)}}},{key:"drawLetterSpacing",value:function(t,e,n,r,i,o,a,s,l,c,u,h,d,f,p,g,v,m){if(0!==s){var y=t.textAlign;t.textAlign="left";var b=o;"center"===i||"middle"===i?b=o-r.width/2:"right"!==i&&"end"!==i||(b=o-r.width);for(var x=Array.from(n),E=t.measureText(n).width,w=0,k=0;k<x.length;++k){var M=x[k];p?this.strokeText(t,e,M,b,a,h,d,g,v,m):this.fillText(t,e,M,b,a,l,c,u,f,g,v,m),b+=E-(w=t.measureText(n.substring(k+1)).width)+s,E=w}t.textAlign=y}else p?this.strokeText(t,e,n,o,a,h,d,g,v,m):this.fillText(t,e,n,o,a,l,c,u,f,g,v,m)}},{key:"fillText",value:function(t,e,n,r,i,o,a,s,l,c,u,h){var d;eg(t,e,o,a,c,u,h,this.imagePool,!0);var f=!ae(s)&&1!==s;f&&(d=t.globalAlpha,t.globalAlpha=s*l),t.fillText(n,r,i),f&&(t.globalAlpha=d)}},{key:"strokeText",value:function(t,e,n,r,i,o,a,s,l,c){var u;ng(t,e,o,s,l,c,this.imagePool,!0);var h=!ae(a)&&1!==a;h&&(u=t.globalAlpha,t.globalAlpha=a),t.strokeText(n,r,i),h&&(t.globalAlpha=u)}},{key:"drawToContext",value:function(t,e,n,r,i){this.render(t,e.parsedStyle,e,e.ownerDocument.defaultView.context,r,i)}}])}($p),og=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,a.Z)(this,e),(t=(0,c.Z)(this,e)).name="canvas-renderer",t.options=n,t}return(0,u.Z)(e,t),(0,s.Z)(e,[{key:"init",value:function(){var t,e=(0,o.Z)({dirtyObjectNumThreshold:500,dirtyObjectRatioThreshold:.8},this.options),n=this.context.imagePool,r=new $p(n),i=(t={},(0,on.Z)((0,on.Z)((0,on.Z)((0,on.Z)((0,on.Z)((0,on.Z)((0,on.Z)((0,on.Z)((0,on.Z)((0,on.Z)(t,Ln.CIRCLE,r),Ln.ELLIPSE,r),Ln.RECT,r),Ln.IMAGE,new rg(n)),Ln.TEXT,new ig(n)),Ln.LINE,r),Ln.POLYLINE,r),Ln.POLYGON,r),Ln.PATH,r),Ln.GROUP,void 0),(0,on.Z)((0,on.Z)((0,on.Z)(t,Ln.HTML,void 0),Ln.MESH,void 0),Ln.FRAGMENT,void 0));this.context.defaultStyleRendererFactory=i,this.context.styleRendererFactory=i,this.addRenderingPlugin(new Wp(e))}},{key:"destroy",value:function(){this.removeAllRenderingPlugins(),delete this.context.defaultStyleRendererFactory,delete this.context.styleRendererFactory}}])}(Bn),ag=function(){function t(){(0,a.Z)(this,t)}return(0,s.Z)(t,[{key:"apply",value:function(e,n){var r=this,i=e.renderingService,o=e.renderingContext,a=e.config;this.context=e;var s=o.root.ownerDocument.defaultView,l=function(t){i.hooks.pointerMove.call(t)},c=function(t){i.hooks.pointerUp.call(t)},u=function(t){i.hooks.pointerDown.call(t)},h=function(t){i.hooks.pointerOver.call(t)},d=function(t){i.hooks.pointerOut.call(t)},f=function(t){i.hooks.pointerCancel.call(t)},p=function(t){i.hooks.pointerWheel.call(t)},g=function(t){i.hooks.click.call(t)};i.hooks.init.tap(t.tag,(function(){var t=r.context.contextService.getDomElement();n.globalThis.navigator.msPointerEnabled?(t.style.msContentZooming="none",t.style.msTouchAction="none"):s.supportsPointerEvents&&(t.style.touchAction="none"),s.supportsPointerEvents?function(t){n.globalThis.document.addEventListener("pointermove",l,!0),t.addEventListener("pointerdown",u,!0),t.addEventListener("pointerleave",d,!0),t.addEventListener("pointerover",h,!0),n.globalThis.addEventListener("pointerup",c,!0),n.globalThis.addEventListener("pointercancel",f,!0)}(t):function(t){n.globalThis.document.addEventListener("mousemove",l,!0),t.addEventListener("mousedown",u,!0),t.addEventListener("mouseout",d,!0),t.addEventListener("mouseover",h,!0),n.globalThis.addEventListener("mouseup",c,!0)}(t),s.supportsTouchEvents&&function(t){t.addEventListener("touchstart",u,!0),t.addEventListener("touchend",c,!0),t.addEventListener("touchmove",l,!0),t.addEventListener("touchcancel",f,!0)}(t),a.useNativeClickEvent&&t.addEventListener("click",g,!0),t.addEventListener("wheel",p,{passive:!0,capture:!0})})),i.hooks.destroy.tap(t.tag,(function(){var t=r.context.contextService.getDomElement();n.globalThis.navigator.msPointerEnabled?(t.style.msContentZooming="",t.style.msTouchAction=""):s.supportsPointerEvents&&(t.style.touchAction=""),s.supportsPointerEvents?function(t){n.globalThis.document.removeEventListener("pointermove",l,!0),t.removeEventListener("pointerdown",u,!0),t.removeEventListener("pointerleave",d,!0),t.removeEventListener("pointerover",h,!0),n.globalThis.removeEventListener("pointerup",c,!0),n.globalThis.removeEventListener("pointercancel",f,!0)}(t):function(t){n.globalThis.document.removeEventListener("mousemove",l,!0),t.removeEventListener("mousedown",u,!0),t.removeEventListener("mouseout",d,!0),t.removeEventListener("mouseover",h,!0),n.globalThis.removeEventListener("mouseup",c,!0)}(t),s.supportsTouchEvents&&function(t){t.removeEventListener("touchstart",u,!0),t.removeEventListener("touchend",c,!0),t.removeEventListener("touchmove",l,!0),t.removeEventListener("touchcancel",f,!0)}(t),a.useNativeClickEvent&&t.removeEventListener("click",g,!0),t.removeEventListener("wheel",p,!0)}))}}])}();ag.tag="DOMInteraction";var sg=function(t){function e(){var t;(0,a.Z)(this,e);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=(0,c.Z)(this,e,[].concat(r))).name="dom-interaction",t}return(0,u.Z)(e,t),(0,s.Z)(e,[{key:"init",value:function(){this.addRenderingPlugin(new ag)}},{key:"destroy",value:function(){this.removeAllRenderingPlugins()}}])}(Bn),lg=function(){function t(){(0,a.Z)(this,t),this.displayObjectHTMLElementMap=new WeakMap}return(0,s.Z)(t,[{key:"joinTransformMatrix",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];return"matrix(".concat([t[0],t[1],t[4],t[5],t[12]+e[0],t[13]+e[1]].join(","),")")}},{key:"apply",value:function(e,n){var r=this,i=e.camera,o=e.renderingContext,a=e.renderingService;this.context=e;var s=o.root.ownerDocument.defaultView,l=s.context.eventService.nativeHTMLMap,c=function(t,e){e.style.transform=r.joinTransformMatrix(t.getWorldTransform(),t.getOrigin())},u=function(t){var e=t.target;if(e.nodeName===Ln.HTML){r.$camera||(r.$camera=r.createCamera(i));var n=r.getOrCreateEl(e);r.$camera.appendChild(n),Object.keys(e.attributes).forEach((function(t){r.updateAttribute(t,e)})),c(e,n),l.set(n,e)}},h=function(t){var e=t.target;if(e.nodeName===Ln.HTML&&r.$camera){var n=r.getOrCreateEl(e);n&&(n.remove(),l.delete(n))}},d=function(t){var e=t.target;if(e.nodeName===Ln.HTML){var n=t.attrName;r.updateAttribute(n,e)}},f=function(t){var e=t.target;(e.nodeName===Ln.FRAGMENT?e.childNodes:[e]).forEach((function(t){if(t.nodeName===Ln.HTML){var e=r.getOrCreateEl(t);c(t,e)}}))},p=function(){if(r.$camera){var t=r.context.config,e=t.width,n=t.height;r.$camera.parentElement.style.width="".concat(e||0,"px"),r.$camera.parentElement.style.height="".concat(n||0,"px")}};a.hooks.init.tap(t.tag,(function(){s.addEventListener(ql.RESIZE,p),s.addEventListener(Ps.MOUNTED,u),s.addEventListener(Ps.UNMOUNTED,h),s.addEventListener(Ps.ATTR_MODIFIED,d),s.addEventListener(Ps.BOUNDS_CHANGED,f)})),a.hooks.endFrame.tap(t.tag,(function(){r.$camera&&o.renderReasons.has(Ns.CAMERA_CHANGED)&&(r.$camera.style.transform=r.joinTransformMatrix(i.getOrthoMatrix()))})),a.hooks.destroy.tap(t.tag,(function(){r.$camera&&r.$camera.remove(),s.removeEventListener(ql.RESIZE,p),s.removeEventListener(Ps.MOUNTED,u),s.removeEventListener(Ps.UNMOUNTED,h),s.removeEventListener(Ps.ATTR_MODIFIED,d),s.removeEventListener(Ps.BOUNDS_CHANGED,f)}))}},{key:"createCamera",value:function(t){var e=this.context.config,n=e.document,r=e.width,i=e.height,o=this.context.contextService.getDomElement(),a=o.parentNode;if(a){var s="g-canvas-camera",l=a.querySelector("#".concat(s));if(!l){var c=(n||document).createElement("div");c.style.overflow="hidden",c.style.pointerEvents="none",c.style.position="absolute",c.style.left="0px",c.style.top="0px",c.style.width="".concat(r||0,"px"),c.style.height="".concat(i||0,"px");var u=(n||document).createElement("div");l=u,u.id=s,u.style.position="absolute",u.style.left="".concat(o.offsetLeft||0,"px"),u.style.top="".concat(o.offsetTop||0,"px"),u.style.transformOrigin="left top",u.style.transform=this.joinTransformMatrix(t.getOrthoMatrix()),u.style.pointerEvents="none",u.style.width="100%",u.style.height="100%",c.appendChild(u),a.appendChild(c)}return l}return null}},{key:"getOrCreateEl",value:function(t){var e=this.context.config.document,n=this.displayObjectHTMLElementMap.get(t);return n||(n=(e||document).createElement("div"),t.parsedStyle.$el=n,this.displayObjectHTMLElementMap.set(t,n),t.id&&(n.id=t.id),t.name&&n.setAttribute("name",t.name),t.className&&(n.className=t.className),n.style.position="absolute",n.style["will-change"]="transform",n.style.transform=this.joinTransformMatrix(t.getWorldTransform(),t.getOrigin())),n}},{key:"updateAttribute",value:function(t,e){var n=this.getOrCreateEl(e);switch(t){case"innerHTML":var r=e.parsedStyle.innerHTML;se(r)?n.innerHTML=r:(n.innerHTML="",n.appendChild(r));break;case"x":n.style.left="".concat(e.parsedStyle.x,"px");break;case"y":n.style.top="".concat(e.parsedStyle.y,"px");break;case"transformOrigin":var i=e.parsedStyle.transformOrigin;n.style["transform-origin"]="".concat(i[0].buildCSSText(null,null,"")," ").concat(i[1].buildCSSText(null,null,""));break;case"width":var o=e.parsedStyle.width;n.style.width=ie(o)?"".concat(o,"px"):o.toString();break;case"height":var a=e.parsedStyle.height;n.style.height=ie(a)?"".concat(a,"px"):a.toString();break;case"zIndex":var s=e.parsedStyle.zIndex;n.style["z-index"]="".concat(s);break;case"visibility":var l=e.parsedStyle.visibility;n.style.visibility=l;break;case"pointerEvents":var c=e.parsedStyle.pointerEvents,u=void 0===c?"auto":c;n.style.pointerEvents=u;break;case"opacity":var h=e.parsedStyle.opacity;n.style.opacity="".concat(h);break;case"fill":var d=e.parsedStyle.fill,f="";Ui(d)?f=d.isNone?"transparent":e.getAttribute("fill"):Array.isArray(d)?f=e.getAttribute("fill"):Hi(d),n.style.background=f;break;case"stroke":var p=e.parsedStyle.stroke,g="";Ui(p)?g=p.isNone?"transparent":e.getAttribute("stroke"):Array.isArray(p)?g=e.getAttribute("stroke"):Hi(p),n.style["border-color"]=g,n.style["border-style"]="solid";break;case"lineWidth":var v=e.parsedStyle.lineWidth;n.style["border-width"]="".concat(v||0,"px");break;case"lineDash":n.style["border-style"]="dashed";break;case"filter":var m=e.style.filter;n.style.filter=m;break;default:ae(e.style[t])||""===e.style[t]||(n.style[t]=e.style[t])}}}])}();lg.tag="HTMLRendering";var cg=function(t){function e(){var t;(0,a.Z)(this,e);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=(0,c.Z)(this,e,[].concat(r))).name="html-renderer",t}return(0,u.Z)(e,t),(0,s.Z)(e,[{key:"init",value:function(){this.addRenderingPlugin(new lg)}},{key:"destroy",value:function(){this.removeAllRenderingPlugins()}}])}(Bn),ug=function(){return(0,s.Z)((function t(e){(0,a.Z)(this,t),this.renderingContext=e.renderingContext,this.canvasConfig=e.config}),[{key:"init",value:function(){var t=this.canvasConfig,e=t.container,n=t.canvas;if(n)this.$canvas=n,e&&n.parentElement!==e&&e.appendChild(n),this.$container=n.parentElement,this.canvasConfig.container=this.$container;else if(e&&(this.$container=se(e)?document.getElementById(e):e,this.$container)){var r=document.createElement("canvas");this.$container.appendChild(r),this.$container.style.position||(this.$container.style.position="relative"),this.$canvas=r}this.context=this.$canvas.getContext("2d"),this.resize(this.canvasConfig.width,this.canvasConfig.height)}},{key:"getContext",value:function(){return this.context}},{key:"getDomElement",value:function(){return this.$canvas}},{key:"getDPR",value:function(){return this.dpr}},{key:"getBoundingClientRect",value:function(){if(this.$canvas.getBoundingClientRect)return this.$canvas.getBoundingClientRect()}},{key:"destroy",value:function(){this.$container&&this.$canvas&&this.$canvas.parentNode&&this.$container.removeChild(this.$canvas)}},{key:"resize",value:function(t,e){var n=this.canvasConfig.devicePixelRatio;this.dpr=n,this.$canvas&&(this.$canvas.width=this.dpr*t,this.$canvas.height=this.dpr*e,function(t,e,n){ka&&t.style&&(t.style.width=e+"px",t.style.height=n+"px")}(this.$canvas,t,e)),this.renderingContext.renderReasons.add(Ns.CAMERA_CHANGED)}},{key:"applyCursorStyle",value:function(t){this.$container&&this.$container.style&&(this.$container.style.cursor=t)}},{key:"toDataURL",value:(t=(0,On.Z)((0,Cn.Z)().mark((function t(){var e,n,r,i=arguments;return(0,Cn.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=i.length>0&&void 0!==i[0]?i[0]:{},n=e.type,r=e.encoderOptions,t.abrupt("return",this.context.canvas.toDataURL(n,r));case 1:case"end":return t.stop()}}),t,this)}))),function(){return t.apply(this,arguments)})}]);var t}(),hg=function(t){function e(){var t;(0,a.Z)(this,e);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=(0,c.Z)(this,e,[].concat(r))).name="canvas-context-register",t}return(0,u.Z)(e,t),(0,s.Z)(e,[{key:"init",value:function(){this.context.ContextService=ug}},{key:"destroy",value:function(){delete this.context.ContextService}}])}(Bn),dg=function(t){function e(t){var n;return(0,a.Z)(this,e),(n=(0,c.Z)(this,e,[t])).registerPlugin(new hg),n.registerPlugin(new Gp),n.registerPlugin(new ap),n.registerPlugin(new og),n.registerPlugin(new sg),n.registerPlugin(new Tp),n.registerPlugin(new cg),n}return(0,u.Z)(e,t),(0,s.Z)(e)}(jn);var fg=function(t,e){if(t)if(Be(t))for(var n=0,r=t.length;n<r&&!1!==e(t[n],n);n++);else if(nn(t))for(var i in t)if(t.hasOwnProperty(i)&&!1===e(t[i],i))break},pg=Object.prototype.hasOwnProperty,gg=function(t,e){if(null===t||!nd(t))return{};var n={};return fg(e,(function(e){pg.call(t,e)&&(n[e]=t[e])})),n},vg=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};class mg extends Hf{constructor(t){super(Object.assign(Object.assign({},t),{style:Object.assign({},mg.defaultStyleProps,t.style)})),this.rootPointerEvent=new xs(null),this.forwardEvents=t=>{const e=this.context.canvas,n=e.context.renderingContext.root.ownerDocument.defaultView;this.normalizeToPointerEvent(t,n).forEach((r=>{const i=this.bootstrapEvent(this.rootPointerEvent,r,n,t);rf(e.context.eventService,"mappingTable.pointerupoutside",[]),e.context.eventService.mapEvent(i)}))}}get eventService(){return this.context.canvas.context.eventService}get events(){return[hu.CLICK,hu.POINTER_DOWN,hu.POINTER_MOVE,hu.POINTER_UP,hu.POINTER_OVER,hu.POINTER_LEAVE]}getDomElement(){return this.getShape("key").getDomElement()}render(t=this.parsedAttributes,e=this){this.drawKeyShape(t,e),this.drawPortShapes(t,e)}getKeyStyle(t){const e=gg(t,["dx","dy","innerHTML","pointerEvents","cursor"]),{dx:n=0,dy:r=0}=e,i=vg(e,["dx","dy"]),[o,a]=this.getSize(t);return Object.assign(Object.assign({x:n,y:r},i),{width:o,height:a})}drawKeyShape(t,e){const n=this.getKeyStyle(t),{x:r,y:i,width:o=0,height:a=0}=n,s=this.upsert("key-container",zl,{x:r,y:i,width:o,height:a,opacity:0},e);return this.upsert("key",Cl,n,s)}connectedCallback(){if(!(this.context.canvas.getRenderer("main")instanceof dg))return;const t=this.getDomElement();this.events.forEach((e=>{t.addEventListener(e,this.forwardEvents)}))}attributeChangedCallback(t,e,n){"zIndex"===t&&e!==n&&(this.getDomElement().style.zIndex=n)}destroy(){const t=this.getDomElement();this.events.forEach((e=>{t.removeEventListener(e,this.forwardEvents)})),super.destroy()}normalizeToPointerEvent(t,e){const n=[];if(e.isTouchEvent(t))for(let e=0;e<t.changedTouches.length;e++){const r=t.changedTouches[e];Qe(r.button)&&(r.button=0),Qe(r.buttons)&&(r.buttons=1),Qe(r.isPrimary)&&(r.isPrimary=1===t.touches.length&&"touchstart"===t.type),Qe(r.width)&&(r.width=r.radiusX||1),Qe(r.height)&&(r.height=r.radiusY||1),Qe(r.tiltX)&&(r.tiltX=0),Qe(r.tiltY)&&(r.tiltY=0),Qe(r.pointerType)&&(r.pointerType="touch"),Qe(r.pointerId)&&(r.pointerId=r.identifier||0),Qe(r.pressure)&&(r.pressure=r.force||.5),Qe(r.twist)&&(r.twist=0),Qe(r.tangentialPressure)&&(r.tangentialPressure=0),r.isNormalized=!0,r.type=t.type,n.push(r)}else if(e.isMouseEvent(t)){const e=t;Qe(e.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)}else n.push(t);return n}transferMouseData(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}bootstrapEvent(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);const{x:i,y:o}=this.getViewportXY(e);t.viewport.x=i,t.viewport.y=o;const[a,s]=this.context.canvas.getCanvasByViewport([i,o]);return t.canvas.x=a,t.canvas.y=s,t.global.copyFrom(t.canvas),t.offset.copyFrom(t.canvas),t.isTrusted=r.isTrusted,"pointerleave"===t.type&&(t.type="pointerout"),t}getViewportXY(t){let e,n;const{offsetX:r,offsetY:i,clientX:o,clientY:a}=t;if(ae(r)||ae(i)){const t=this.eventService.client2Viewport({x:o,y:a});e=t.x,n=t.y}else e=r,n=i;return{x:e,y:n}}onframe(){super.onframe();const{opacity:t}=this.attributes;this.getDomElement().style.opacity=`${t}`}}mg.defaultStyleProps={size:[160,80],halo:!1,icon:!1,label:!1,pointerEvents:"auto"};var yg=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};class bg extends Hf{constructor(t){super(gf({style:bg.defaultStyleProps},t))}getKeyStyle(t){const[e,n]=this.getSize(t),r=super.getKeyStyle(t),{fillOpacity:i,opacity:o=i}=r,a=yg(r,["fillOpacity","opacity"]);return Object.assign(Object.assign({opacity:o},a),{width:e,height:n,x:-e/2,y:-n/2})}getBounds(){return this.getShape("key").getBounds()}getHaloStyle(t){if(!1===t.halo)return!1;const e=this.getShape("key").attributes,{fill:n,stroke:r}=e,i=(yg(e,["fill","stroke"]),cf(this.getGraphicStyle(t),"halo")),o=Number(i.lineWidth),[a,s]=sd(this.getSize(t),[o,o]),{lineWidth:l}=i,c={fill:"transparent",lineWidth:l/2,width:a-l/2,height:s-l/2,x:-(a-l/2)/2,y:-(s-l/2)/2};return Object.assign(Object.assign({},i),c)}getIconStyle(t){const e=super.getIconStyle(t),[n,r]=this.getSize(t);return!!e&&Object.assign({width:n*Yd,height:r*Yd},e)}drawKeyShape(t,e){const n=this.upsert("key",jf,this.getKeyStyle(t),e);return _f(this),n}drawHaloShape(t,e){this.upsert("halo",zl,this.getHaloStyle(t),e)}update(t){super.update(t),t&&("x"in t||"y"in t||"z"in t)&&Zf(this)}}bg.defaultStyleProps={size:32};class xg extends Yf{constructor(t){super(gf({style:xg.defaultStyleProps},t))}getPoints(t){const{direction:e}=t,[n,r]=this.getSize(t);return function(t,e,n){const r=e/2,i=t/2,o={up:[[-i,r],[i,r],[0,-r]],left:[[-i,0],[i,r],[i,-r]],right:[[-i,r],[-i,-r],[i,0]],down:[[-i,-r],[i,-r],[0,r]]};return o[n]||o.up}(n,r,e)}getPortXY(t,e){const{direction:n}=t,{placement:r="top"}=e,i=this.getShape("key").getLocalBounds(),[o,a]=this.getSize(t),s=function(t,e,n){const r=e/2,i=t/2,o={};"down"===n?(o.bottom=o.default=[0,r],o.right=[i,-r],o.left=[-i,-r]):"left"===n?(o.top=[i,-r],o.bottom=[i,r],o.left=o.default=[-i,0]):"right"===n?(o.top=[-i,-r],o.bottom=[-i,r],o.right=o.default=[i,0]):(o.left=[-i,r],o.top=o.default=[0,-r],o.right=[i,r]);return o}(o,a,n);return Sv(i,r,s,!1)}getIconStyle(t){const{icon:e,iconText:n,iconSrc:r,direction:i}=t;if(!1===e||Sf(n||r))return!1;const o=cf(this.getGraphicStyle(t),"icon"),a=this.getShape("key").getLocalBounds(),[s,l]=function(t,e){const{center:n}=t,[r,i]=Ku(t);return["up"===e||"down"===e?n[0]:"right"===e?n[0]-r/6:n[0]+r/6,"left"===e||"right"===e?n[1]:"down"===e?n[1]-i/6:n[1]+i/6]}(a,i),c=2*function(t,e){let[n,r]=Ku(t);return[n,r]="up"===e||"down"===e?[n,r]:[r,n],(Math.pow(r,2)-Math.pow(Math.sqrt(Math.pow(n/2,2)+Math.pow(r,2))-n/2,2))/(2*r)}(a,i)*Yd;return Object.assign({x:s,y:l,width:c,height:c},o)}}xg.defaultStyleProps={size:40,direction:"up"};var Eg=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};class wg extends Hf{constructor(t){super(gf({style:wg.defaultStyleProps},t)),this.type="combo",this.updateComboPosition(this.parsedAttributes)}getKeySize(t){const{collapsed:e,childrenNode:n=[]}=t;return 0===n.length?this.getEmptyKeySize(t):e?this.getCollapsedKeySize(t):this.getExpandedKeySize(t)}getEmptyKeySize(t){const{padding:e,collapsedSize:n}=t,[r,i,o,a]=Uu(e);return sd(df(n),[a+i,r+o,0])}getCollapsedKeySize(t){return df(t.collapsedSize)}getExpandedKeySize(t){const e=this.getContentBBox(t);return[qu(e),Xu(e),0]}getContentBBox(t){const{childrenNode:e=[],padding:n}=t,r=e.map((t=>this.context.element.getElement(t))).filter(Boolean);if(0===r.length){const e=new Wn,{x:n=0,y:r=0,size:i}=t,[o,a]=df(i);return e.setMinMax([n-o/2,r-a/2,0],[n+o/2,r+a/2,0]),e}const i=th(r.map((t=>t.getBounds())));return n?$u(i,n):i}drawCollapsedMarkerShape(t,e){const n=this.getCollapsedMarkerStyle(t);this.upsert("collapsed-marker",Gf,n,e),_f(this)}getCollapsedMarkerStyle(t){if(!t.collapsed||!t.collapsedMarker)return!1;const e=cf(this.getGraphicStyle(t),"collapsedMarker"),{type:n}=e,r=Eg(e,["type"]),i=this.getShape("key"),[o,a]=Cd(i.getLocalBounds(),"center"),s=Object.assign(Object.assign({},r),{x:o,y:a});if(n){const e=this.getCollapsedMarkerText(n,t);Object.assign(s,{text:e})}return s}getCollapsedMarkerText(t,e){const{childrenData:n=[]}=e,{model:r}=this.context;return"descendant-count"===t?r.getDescendantsData(this.id).length.toString():"child-count"===t?n.length.toString():"node-count"===t?r.getDescendantsData(this.id).filter((t=>"node"===r.getElementType(Fh(t)))).length.toString():en(t)?t(n):""}getComboPosition(t){const{x:e=0,y:n=0,collapsed:r,childrenData:i=[]}=t;if(0===i.length)return[+e,+n,0];if(r){const{model:t}=this.context,r=t.getDescendantsData(this.id).filter((e=>!t.isCombo(Fh(e))));if(r.length>0&&r.some(Ad)){return ud(r.reduce(((t,e)=>sd(t,Sd(e))),[0,0,0]),r.length)}return[+e,+n,0]}return this.getContentBBox(t).center}getComboStyle(t){const[e,n]=this.getComboPosition(t);return{x:e,y:n,transform:[["translate",e,n]]}}updateComboPosition(t){const e=this.getComboStyle(t);Object.assign(this.style,e);const{x:n,y:r}=e;this.context.model.syncNodeLikeDatum({id:this.id,style:{x:n,y:r}}),Zf(this)}render(t,e=this){super.render(t,e),this.drawCollapsedMarkerShape(t,e)}update(t={}){super.update(t),this.updateComboPosition(this.parsedAttributes)}onframe(){super.onframe(),this.attributes.collapsed||this.updateComboPosition(this.parsedAttributes),this.drawKeyShape(this.parsedAttributes,this)}animate(t,e){const n=super.animate(this.attributes.collapsed?t:t.map((t=>{var{x:e,y:n,z:r,transform:i}=t;return Eg(t,["x","y","z","transform"])})),e);return n?new Proxy(n,{set:(t,e,n)=>("currentTime"===e&&Promise.resolve().then((()=>this.onframe())),Reflect.set(t,e,n))}):n}}wg.defaultStyleProps={childrenNode:[],droppable:!0,draggable:!0,collapsed:!1,collapsedSize:32,collapsedMarker:!0,collapsedMarkerZIndex:1,collapsedMarkerFontSize:12,collapsedMarkerTextAlign:"center",collapsedMarkerTextBaseline:"middle",collapsedMarkerType:"child-count"};var kg=function(t,e){if(!nu(t))return t;for(var n=[],r=0;r<t.length;r++){var i=t[r];e(i,r)&&n.push(i)}return n},Mg=function(t,e){return!!nu(t)&&t.indexOf(e)>-1},Sg=function(t,e){return void 0===e&&(e=[]),kg(t,(function(t){return!Mg(e,t)}))};const Ag={padding:10};function Ng(t,e,n,r,i,o){const{padding:a}=Object.assign(Ag,o),s=Qu(n,a),l=Qu(r,a),c=[t,...i,e];let u=null;const h=[];for(let t=0,e=c.length;t<e-1;t++){const n=t+1,r=c[t],i=c[n],o=Dd(d=r,f=i)||function(t,e){return t[0]===e[0]}(d,f);let p=null;if(0===t)if(n===e-1)if(s.intersects(l))p=Bg(r,i,s,l);else if(rh(r,s)||rh(i,l))o||(p=Ig(r,i,s,l));else{const t=oh(r,s),e=oh(i,l);p=Rg(t,e,Tg(t,e)),p.points.unshift(t),p.points.push(e)}else eh(i,s)?p=Bg(r,i,s,Qu(i,a),u):o||(p=Dg(r,i,s));else n===e-1?eh(r,l)?p=Bg(r,i,Qu(r,a),l,u):o||(p=Lg(r,i,l,u)):o||(p=Rg(r,i,u));p?(h.push(...p.points),u=p.direction):u=Tg(r,i),n<e-1&&h.push(i)}var d,f;return h.map(yd)}const Cg={N:"S",S:"N",W:"E",E:"W"},Og={N:-Math.PI/2,S:Math.PI/2,E:0,W:Math.PI};function Tg(t,e){const[n,r]=t,[i,o]=e;return n===i?r>o?"N":"S":r===o?n>i?"W":"E":null}function Pg(t,e){return"N"===e||"S"===e?Xu(t):qu(t)}function Rg(t,e,n){const r=[t[0],e[1]],i=[e[0],t[1]],o=Tg(t,r),a=Tg(t,i),s=o===n||o!==(n?Cg[n]:null)&&a!==n?r:i;return{points:[s],direction:Tg(s,e)}}function Dg(t,e,n){if(rh(t,n)){const r=jg(t,e,n);return{points:[r],direction:Tg(r,e)}}{const r=oh(t,n),i=["left","right"].includes(ih(t,n))?[e[0],r[1]]:[r[0],e[1]];return{points:[i],direction:Tg(i,e)}}}function Lg(t,e,n,r){const i=rh(e,n)?e:oh(e,n),o=[[i[0],t[1]],[t[0],i[1]]],a=o.filter((t=>function(t,e){return!eh(t,e)}(t,n)&&!nh(t,n,!0))),s=a.filter((e=>Tg(e,t)!==r));if(s.length>0){const n=s.find((e=>Tg(t,e)===r))||s[0];return{points:[n],direction:Tg(n,e)}}{const i=Rd(e,Sg(o,a)[0],Pg(n,r)/2);return{points:[jg(i,t,n),i],direction:Tg(i,e)}}}function Ig(t,e,n,r){let i=Dg(t,e,n);const o=bd(i.points[0]);if(eh(o,r)){i=Dg(e,t,r);const a=bd(i.points[0]);if(eh(a,n)){const s=Rd(t,o,Pg(n,Tg(t,o))/2),l=Rd(e,a,Pg(r,Tg(e,a))/2),c=[(s[0]+l[0])/2,(s[1]+l[1])/2],u=Dg(t,c,n),h=Lg(c,e,r,u.direction);i.points=[u.points[0],h.points[0]],i.direction=h.direction}}return i}function Bg(t,e,n,r,i){const o=.01,a=th([n,r]),s=dd(e,a.center)>dd(t,a.center),[l,c]=s?[e,t]:[t,e],u=Xu(a)+qu(a);let h;if(i){const t=[l[0]+u*Math.cos(Og[i]),l[1]+u*Math.sin(Og[i])];h=Rd(oh(t,a),t,o)}else h=Rd(oh(l,a),l,-.01);let d=jg(h,c,a),f=[Pd(h,2),Pd(d,2)];if(iu(Pd(h),Pd(d))){const t=gd(ld(h,l),[1,0,0])+Math.PI/2;d=[c[0]+u*Math.cos(t),c[1]+u*Math.sin(t),0],d=Pd(Rd(oh(d,a),c,-.01),2);f=[h,jg(h,d,a),d]}return{points:s?f.reverse():f,direction:Tg(s?h:d,e)}}function jg(t,e,n){let r=[t[0],e[1]];return eh(r,n)&&(r=[e[0],t[1]]),r}function zg(t,e,n,r,i){let o="number"==typeof e?e:.5;"start"===e&&(o=0),"end"===e&&(o=.99);const a=Od(t.getPoint(o)),s=Od(t.getPoint(o+.01));let l="start"===e?"left":"end"===e?"right":"center";if(Dd(a,s)||!n){const[e,n]=Fg(t,o,r,i);return{transform:[["translate",e,n]],textAlign:l}}let c=Math.atan2(s[1]-a[1],s[0]-a[0]);s[0]<a[0]&&(l="center"===l?l:"left"===l?"right":"left",r*=-1,c+=Math.PI);const[u,h]=Fg(t,o,r,i,c);return{textAlign:l,transform:[["translate",u,h],["rotate",c/Math.PI*180]]}}function Fg(t,e,n,r,i){const[o,a]=Od(t.getPoint(e));let s=n,l=r;return i&&(s=n*Math.cos(i)-r*Math.sin(i),l=n*Math.sin(i)+r*Math.cos(i)),[o+s,a+l]}function _g(t,e,n,r){if(iu(t,e))return t;const i=ld(e,t),o=[t[0]+n*i[0],t[1]+n*i[1]],a=pd(vd(i,!1));return o[0]+=r*a[0],o[1]+=r*a[1],o}function Zg(t,e,n){return[["M",t[0],t[1]],["C",n[0][0],n[0][1],n[1][0],n[1][1],e[0],e[1]]]}function Gg(t,e=0,n=!1){const r=t.length-1,i=t[0],o=t[r],a=t.slice(1,r),s=[["M",i[0],i[1]]];return a.forEach(((t,n)=>{const r=a[n-1]||i,l=a[n+1]||o;if(!Ld(r,t,l)&&e){const[n,i]=function(t,e,n,r){const i=fd(t,e),o=fd(n,e),a=Math.min(r,Math.min(i,o)/2),s=[e[0]-a/i*(e[0]-t[0]),e[1]-a/i*(e[1]-t[1])],l=[e[0]-a/o*(e[0]-n[0]),e[1]-a/o*(e[1]-n[1])];return[s,l]}(r,t,l,e);s.push(["L",n[0],n[1]],["Q",t[0],t[1],i[0],i[1]],["L",i[0],i[1]])}else s.push(["L",t[0],t[1]])})),s.push(["L",o[0],o[1]]),n&&s.push(["Z"]),s}function Vg(t,e,n,r,i){const o=Qu(t),a=t.getCenter();let s=r&&Cv(r),l=i&&Cv(i);if(!s||!l){const r=(t=>{const e=Math.PI/2,n=Xu(t)/2,r=qu(t)/2,i=Math.atan2(n,r)/2,o=Math.atan2(r,n)/2;return{top:[-e-o,-e+o],"top-right":[-e+o,-i],"right-top":[-e+o,-i],right:[-i,i],"bottom-right":[i,e-o],"right-bottom":[i,e-o],bottom:[e-o,e+o],"bottom-left":[e+o,Math.PI-i],"left-bottom":[e+o,Math.PI-i],left:[Math.PI-i,Math.PI+i],"top-left":[Math.PI+i,-e-o],"left-top":[Math.PI+i,-e-o]}})(o),i=r[e][0],c=r[e][1],[u,h]=Ku(o),d=Math.max(u,h),f=sd(a,[d*Math.cos(i),d*Math.sin(i),0]),p=sd(a,[d*Math.cos(c),d*Math.sin(c),0]);s=Rv(t,f),l=Rv(t,p),n||([s,l]=[l,s])}return[s,l]}function Wg(t,e,n,r,i,o){const a=t.getPorts()[i||o],s=t.getPorts()[o||i];let[l,c]=Vg(t,e,n,a,s);const u=function(t,e,n,r){const i=t.getCenter();if(iu(e,n)){const t=ld(e,i),o=[r*Math.sign(t[0])||r/2,r*Math.sign(t[1])||-r/2,0];return[sd(e,o),sd(n,cd(o,[1,-1,1]))]}return[Rd(i,e,dd(i,e)+r),Rd(i,n,dd(i,n)+r)]}(t,l,c,r);return a&&(l=Pv(a,u[0])),s&&(c=Pv(s,u.at(-1))),Zg(l,c,u)}function Hg(t,e,n,r,i,o,a){const s=Av(t),l=s[o||a],c=s[a||o];let[u,h]=Vg(t,n,r,l,c);const d=function(t,e,n,r){const i=[],o=Qu(t);if(iu(e,n)){switch(ih(e,o)){case"left":i.push([e[0]-r,e[1]]),i.push([e[0]-r,e[1]+r]),i.push([e[0],e[1]+r]);break;case"right":i.push([e[0]+r,e[1]]),i.push([e[0]+r,e[1]+r]),i.push([e[0],e[1]+r]);break;case"top":i.push([e[0],e[1]-r]),i.push([e[0]+r,e[1]-r]),i.push([e[0]+r,e[1]]);break;case"bottom":i.push([e[0],e[1]+r]),i.push([e[0]+r,e[1]+r]),i.push([e[0]+r,e[1]])}}else{const t=ih(e,o),a=ih(n,o);if(t===a){let o,a;switch(t){case"left":o=Math.min(e[0],n[0])-r,i.push([o,e[1]]),i.push([o,n[1]]);break;case"right":o=Math.max(e[0],n[0])+r,i.push([o,e[1]]),i.push([o,n[1]]);break;case"top":a=Math.min(e[1],n[1])-r,i.push([e[0],a]),i.push([n[0],a]);break;case"bottom":a=Math.max(e[1],n[1])+r,i.push([e[0],a]),i.push([n[0],a])}}else{const s=(t,e)=>({left:[e[0]-r,e[1]],right:[e[0]+r,e[1]],top:[e[0],e[1]-r],bottom:[e[0],e[1]+r]}[t]),l=s(t,e),c=s(a,n),u=jg(l,c,o);i.push(l,u,c)}}return i}(t,u,h,i);return l&&(u=Pv(l,d[0])),c&&(h=Pv(c,d.at(-1))),Gg([u,...d,h],e)}function Ug(t,e){const n=new Set,r=new Set,i=new Set;return t.forEach((o=>{e(o).forEach((e=>{n.add(e),t.includes(e.source)&&t.includes(e.target)?r.add(e):i.add(e)}))})),{edges:Array.from(n),internal:Array.from(r),external:Array.from(i)}}function Yg(t,e){const n=[];let r=t;for(;r;){n.push(r);const t=e(Fh(r));if(!t)break;r=t}if(n.some((t=>{var e;return null===(e=t.style)||void 0===e?void 0:e.collapsed}))){const t=n.reverse().findIndex(ef);return n[t]||n.at(-1)}return t}const qg=(t,e)=>{const n=Math.max(t,e)/2;return[["M",-t/2,0],["A",n,n,0,1,0,2*n-t/2,0],["A",n,n,0,1,0,-t/2,0],["Z"]]},Xg=(t,e)=>[["M",-t/2,0],["L",t/2,-e/2],["L",t/2,e/2],["Z"]],Kg=(t,e)=>[["M",-t/2,0],["L",0,-e/2],["L",t/2,0],["L",0,e/2],["Z"]],Qg=(t,e)=>[["M",-t/2,0],["L",t/2,-e/2],["L",4*t/5-t/2,0],["L",t/2,e/2],["Z"]],Jg=(t,e)=>[["M",-t/2,-e/2],["L",t/2,-e/2],["L",t/2,e/2],["L",-t/2,e/2],["Z"]],$g=(t,e)=>{const n=t/2,r=t/7,i=t-r;return[["M",-n,0],["L",0,-e/2],["L",0,e/2],["Z"],["M",i-n,-e/2],["L",i+r-n,-e/2],["L",i+r-n,e/2],["L",i-n,e/2],["Z"]]},tv=(t,e)=>[["M",t/2,-e/2],["L",-t/2,0],["L",t/2,0],["L",-t/2,0],["L",t/2,e/2]];var ev=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};class nv extends Vf{constructor(t){super(gf({style:nv.defaultStyleProps},t)),this.type="edge"}get sourceNode(){const{sourceNode:t}=this.parsedAttributes;return this.context.element.getElement(t)}get targetNode(){const{targetNode:t}=this.parsedAttributes;return this.context.element.getElement(t)}getKeyStyle(t){const e=this.getGraphicStyle(t),{loop:n}=e,r=ev(e,["loop"]),{sourceNode:i,targetNode:o}=this;var a,s;const l={d:n&&(s=o,(a=i)&&s&&a===s)?this.getLoopPath(t):this.getKeyPath(t)};return Dl.PARSED_STYLE_LIST.forEach((t=>{t in r&&(l[t]=r[t])})),l}getLoopPath(t){const{sourcePort:e,targetPort:n}=t,r=this.sourceNode,i=Qu(r),o=Math.max(qu(i),Xu(i)),{placement:a,clockwise:s,dist:l=o}=cf(this.getGraphicStyle(t),"loop");return Wg(r,a,s,l,e,n)}getEndpoints(t,e=!0,n=[]){const{sourcePort:r,targetPort:i}=t,{sourceNode:o,targetNode:a}=this,[s,l]=function(t,e,n,r){const i=Ov(t,e,n,r),o=Ov(e,t,r,n);return[i,o]}(o,a,r,i);if(!e){return[s?Cv(s):o.getCenter(),l?Cv(l):a.getCenter()]}const c="function"==typeof n?n():n;return[Tv(s||o,c[0]||l||a),Tv(l||a,c[c.length-1]||s||o)]}getHaloStyle(t){if(!1===t.halo)return!1;const e=this.getKeyStyle(t),n=cf(this.getGraphicStyle(t),"halo");return Object.assign(Object.assign({},e),n)}getLabelStyle(t){if(!1===t.label||!t.labelText)return!1;const e=cf(this.getGraphicStyle(t),"label"),{placement:n,offsetX:r,offsetY:i,autoRotate:o,maxWidth:a}=e,s=ev(e,["placement","offsetX","offsetY","autoRotate","maxWidth"]),l=zg(this.shapeMap.key,n,o,r,i),c=this.shapeMap.key.getLocalBounds(),u=function(t,e,n=1){return yf(dd(t[0],t[1])*n,e)}([c.min,c.max],a);return Object.assign({wordWrapWidth:u},l,s)}getBadgeStyle(t){if(!1===t.badge||!t.badgeText)return!1;const e=cf(t,"badge"),{offsetX:n,offsetY:r,placement:i}=e,o=ev(e,["offsetX","offsetY","placement"]);return Object.assign(o,function(t,e,n,r,i){var o,a;const s=2*(null===(o=t.badge)||void 0===o?void 0:o.getGeometryBounds().halfExtents[0])||0,l=2*(null===(a=t.label)||void 0===a?void 0:a.getGeometryBounds().halfExtents[0])||0;return zg(t.key,n,!0,(l?(l/2+s/2)*("suffix"===e?1:-1):0)+r,i)}(this.shapeMap,i,t.labelPlacement,n,r))}drawArrow(t,e){var n;const r="start"===e,i=t["start"===e?"startArrow":"endArrow"],o=this.shapeMap.key;if(i){const e=this.getArrowStyle(t,r),[n,i,a]=r?["markerStart","markerStartOffset","startArrowOffset"]:["markerEnd","markerEndOffset","endArrowOffset"],s=o.parsedStyle[n];if(s)s.attr(e);else{const t=new(e.src?Ol:Dl)({style:e});o.style[n]=t}o.style[i]=t[a]||e.width/2+ +e.lineWidth}else{const t=r?"markerStart":"markerEnd";null===(n=o.style[t])||void 0===n||n.destroy(),o.style[t]=null}}getArrowStyle(t,e){const n=this.getShape("key").attributes,r=e?"startArrow":"endArrow",o=cf(this.getGraphicStyle(t),r),{size:a,type:s}=o,l=ev(o,["size","type"]),[c,u]=df(function(t,e){return e||(t<4?10:4===t?12:2.5*t)}(n.lineWidth,a)),h=(en(s)?s:i[s]||Xg)(c,u);return Object.assign(gg(n,["stroke","strokeOpacity","fillOpacity"]),{width:c,height:u},Object.assign({},h&&{d:h,fill:"simple"===s?"":n.stroke}),l)}drawLabelShape(t,e){const n=this.getLabelStyle(t);this.upsert("label",Tf,n,e)}drawHaloShape(t,e){const n=this.getHaloStyle(t);this.upsert("halo",Dl,n,e)}drawBadgeShape(t,e){const n=this.getBadgeStyle(t);this.upsert("badge",Pf,n,e)}drawSourceArrow(t){this.drawArrow(t,"start")}drawTargetArrow(t){this.drawArrow(t,"end")}drawKeyShape(t,e){const n=this.getKeyStyle(t);return this.upsert("key",Dl,n,e)}render(t=this.parsedAttributes,e=this){this.drawKeyShape(t,e),this.getShape("key")&&(this.drawSourceArrow(t),this.drawTargetArrow(t),this.drawLabelShape(t,e),this.drawHaloShape(t,e),this.drawBadgeShape(t,e))}onframe(){this.drawKeyShape(this.parsedAttributes,this),this.drawSourceArrow(this.parsedAttributes),this.drawTargetArrow(this.parsedAttributes),this.drawHaloShape(this.parsedAttributes,this),this.drawLabelShape(this.parsedAttributes,this),this.drawBadgeShape(this.parsedAttributes,this)}animate(t,e){const n=super.animate(t,e);return n?new Proxy(n,{set:(t,e,n)=>("currentTime"===e&&Promise.resolve().then((()=>this.onframe())),Reflect.set(t,e,n))}):n}}nv.defaultStyleProps={badge:!0,badgeOffsetX:0,badgeOffsetY:0,badgePlacement:"suffix",isBillboard:!0,label:!0,labelAutoRotate:!0,labelIsBillboard:!0,labelMaxWidth:"80%",labelOffsetX:4,labelOffsetY:0,labelPlacement:"center",labelTextBaseline:"middle",labelWordWrap:!1,halo:!1,haloDroppable:!1,haloLineDash:0,haloLineWidth:12,haloPointerEvents:"none",haloStrokeOpacity:.25,haloZIndex:-1,loop:!0,startArrow:!1,startArrowLineDash:0,startArrowLineJoin:"round",startArrowLineWidth:1,startArrowTransformOrigin:"center",startArrowType:"vee",endArrow:!1,endArrowLineDash:0,endArrowLineJoin:"round",endArrowLineWidth:1,endArrowTransformOrigin:"center",endArrowType:"vee",loopPlacement:"top",loopClockwise:!0};class rv extends nv{constructor(t){super(gf({style:rv.defaultStyleProps},t))}getKeyPath(t){const[e,n]=this.getEndpoints(t),{controlPoints:r,curvePosition:i,curveOffset:o}=t,a=this.getControlPoints(e,n,function(t){return ie(t)?[t,1-t]:t}(i),function(t){return ie(t)?[t,-t]:t}(o),r);return Zg(e,n,a)}getControlPoints(t,e,n,r,i){return 2===(null==i?void 0:i.length)?i:[_g(t,e,n[0],r[0]),_g(t,e,n[1],r[1])]}}rv.defaultStyleProps={curvePosition:.5,curveOffset:20};class iv extends rv{constructor(t){super(gf({style:iv.defaultStyleProps},t))}getControlPoints(t,e,n,r){const i=e[0]-t[0];return[[t[0]+i*n[0]+r[0],t[1]],[e[0]-i*n[1]+r[1],e[1]]]}}iv.defaultStyleProps={curvePosition:[.5,.5],curveOffset:[0,0]};class ov extends rv{constructor(t){super(gf({style:ov.defaultStyleProps},t))}get ref(){return this.context.model.getRootsData()[0]}getEndpoints(t){if(this.sourceNode.id===this.ref.id)return super.getEndpoints(t);const e=Sd(this.ref);return[this.sourceNode.getIntersectPoint(e,!0),this.targetNode.getIntersectPoint(e)]}toRadialCoordinate(t){const e=Sd(this.ref);return[dd(t,e),xd(ld(t,e))]}getControlPoints(t,e,n,r){const[i,o]=this.toRadialCoordinate(t),[a]=this.toRadialCoordinate(e),s=a-i;return[[t[0]+(s*n[0]+r[0])*Math.cos(o),t[1]+(s*n[0]+r[0])*Math.sin(o)],[e[0]-(s*n[1]-r[0])*Math.cos(o),e[1]-(s*n[1]-r[0])*Math.sin(o)]]}}ov.defaultStyleProps={curvePosition:.5,curveOffset:20};class av extends rv{constructor(t){super(gf({style:av.defaultStyleProps},t))}getControlPoints(t,e,n,r){const i=e[1]-t[1];return[[t[0],t[1]+i*n[0]+r[0]],[e[0],e[1]-i*n[1]+r[1]]]}}av.defaultStyleProps={curvePosition:[.5,.5],curveOffset:[0,0]};class sv extends nv{constructor(t){super(gf({style:sv.defaultStyleProps},t))}getKeyPath(t){const[e,n]=this.getEndpoints(t);return[["M",e[0],e[1]],["L",n[0],n[1]]]}}sv.defaultStyleProps={};const lv={enableObstacleAvoidance:!1,offset:10,maxAllowedDirectionChange:Math.PI/2,maximumLoops:3e3,gridSize:5,startDirections:["top","right","bottom","left"],endDirections:["top","right","bottom","left"],directionMap:{right:{stepX:1,stepY:0},left:{stepX:-1,stepY:0},bottom:{stepX:0,stepY:1},top:{stepX:0,stepY:-1}},penalties:{0:0,90:0},distFunc:fd},cv=t=>`${Math.round(t[0])}|||${Math.round(t[1])}`;function uv(t,e){const n=t=>Math.round(t/e);return ie(t)?n(t):t.map(n)}function hv(t,e){const n=e[0]-t[0],r=e[1]-t[1];return n||r?Math.atan2(r,n):0}function dv(t,e,n,r){const i=hv(t,e),o=n[cv(t)];return function(t,e){const n=Math.abs(t-e);return n>Math.PI?2*Math.PI-n:n}(hv(o||r,t),i)}function fv(t,e,n){return Math.min(...e.map((e=>n(t,e))))}const pv=(t,e,n,r)=>{if(!e)return[t];const{directionMap:i,offset:o}=r,a=$u(e.getRenderBounds(),o),s=Object.keys(i).reduce(((e,r)=>{if(n.includes(r)){const n=i[r],[o,s]=Ku(a),l=[t[0]+n.stepX*o,t[1]+n.stepY*s],c=function(t){const{min:[e,n],max:[r,i]}=t,o=[e,i],a=[r,i],s=[r,n],l=[e,n];return[[o,a],[a,s],[s,l],[l,o]]}(a);for(let n=0;n<c.length;n++){const r=kd([t,l],c[n]);r&&nh(r,a)&&e.push(r)}}return e}),[]);return eh(t,a)||s.push(t),s.map((t=>uv(t,r.gridSize)))},gv=(t,e,n,r,i,o,a)=>{const s=[];let l=[o[0]===r[0]?r[0]:t[0]*a,o[1]===r[1]?r[1]:t[1]*a];s.unshift(l);let c=t,u=e[cv(c)];for(;u;){const t=u,r=c;dv(t,r,e,n)&&(l=[t[0]===r[0]?l[0]:t[0]*a,t[1]===r[1]?l[1]:t[1]*a],s.unshift(l)),u=e[cv(t)],c=t}const h=i.map((t=>[t[0]*a,t[1]*a])),d=function(t,e,n){let r=t[0],i=n(t[0],e);for(let o=0;o<t.length;o++){const a=t[o],s=n(a,e);s<i&&(r=a,i=s)}return r}(h,l,fd);return s.unshift(d),s};function vv(t,e,n,r){const i=yd(t.getCenter()),o=yd(e.getCenter()),a=Object.assign(lv,r),{gridSize:s}=a,l=((t,e)=>{const{offset:n,gridSize:r}=e,i={};return t.forEach((t=>{if(!t||t.destroyed||!t.isVisible())return;const e=$u(t.getRenderBounds(),n);for(let t=uv(e.min[0],r);t<=uv(e.max[0],r);t+=1)for(let n=uv(e.min[1],r);n<=uv(e.max[1],r);n+=1)i[`${t}|||${n}`]=!0})),i})(a.enableObstacleAvoidance?n:[t,e],a),c=uv(i,s),u=uv(o,s),h=pv(i,t,a.startDirections,a),d=pv(o,e,a.endDirections,a);h.forEach((t=>delete l[cv(t)])),d.forEach((t=>delete l[cv(t)]));const f={},p={},g={},v={},m={},y=new mv;for(let t=0;t<h.length;t++){const e=h[t],n=cv(e);f[n]=e,v[n]=0,m[n]=fv(e,d,a.distFunc),y.add({id:n,value:m[n]})}const b=d.map((t=>cv(t)));let x,E=a.maximumLoops,w=1/0;for(const[t,e]of Object.entries(f))m[t]<=w&&(w=m[t],x=e);for(;Object.keys(f).length>0&&E>0;){const t=y.minId(!1);if(!t)break;x=f[t];const e=cv(x);if(b.includes(e))return gv(x,g,c,o,h,u,s);delete f[e],y.remove(e),p[e]=!0;for(const t of Object.values(a.directionMap)){const n=sd(x,[t.stepX,t.stepY]),r=cv(n);if(p[r])continue;const i=dv(x,n,g,c);if(i>a.maxAllowedDirectionChange)continue;if(l[r])continue;f[r]||(f[r]=n);const o=a.penalties[i],u=a.distFunc(x,n)+(isNaN(o)?s:o),h=v[e]+u,b=v[r];b&&h>=b||(g[r]=x,v[r]=h,m[r]=h+fv(n,d,a.distFunc),y.add({id:r,value:m[r]}))}E-=1}return[]}class mv{constructor(){this.arr=[],this.map={},this.arr=[],this.map={}}_innerAdd(t,e){let n=0,r=e-1;for(;r-n>1;){const e=Math.floor((n+r)/2);if(this.arr[e].value>t.value)r=e;else{if(!(this.arr[e].value<t.value))return this.arr.splice(e,0,t),void(this.map[t.id]=!0);n=e}}this.arr.splice(r,0,t),this.map[t.id]=!0}add(t){delete this.map[t.id];const e=this.arr.length;if(!e||this.arr[e-1].value<t.value)return this.arr.push(t),void(this.map[t.id]=!0);this._innerAdd(t,e)}remove(t){this.map[t]&&delete this.map[t]}_clearAndGetMinId(){let t;for(let e=this.arr.length-1;e>=0;e--)this.map[this.arr[e].id]?t=this.arr[e].id:this.arr.splice(e,1);return t}_findFirstId(){for(;this.arr.length;){const t=this.arr.shift();if(this.map[t.id])return t.id}}minId(t){return t?this._clearAndGetMinId():this._findFirstId()}}class yv extends nv{constructor(t){super(gf({style:yv.defaultStyleProps},t))}getControlPoints(t){const{router:e}=t,{sourceNode:n,targetNode:r}=this,[i,o]=this.getEndpoints(t,!1);let a=[];if(e)if("shortest-path"===e.type){a=vv(n,r,this.context.element.getNodes(),e),a.length||(a=Ng(i,o,n,r,t.controlPoints,{padding:e.offset}))}else"orth"===e.type&&(a=Ng(i,o,n,r,t.controlPoints,e));else a=t.controlPoints;return a}getPoints(t){const e=this.getControlPoints(t),[n,r]=this.getEndpoints(t,!0,e);return[n,...e,r]}getKeyPath(t){return Gg(this.getPoints(t),t.radius)}getLoopPath(t){const{sourcePort:e,targetPort:n,radius:r}=t,i=this.sourceNode,o=Qu(i),a=Math.max(qu(o),Xu(o))/4,{placement:s,clockwise:l,dist:c=a}=cf(this.getGraphicStyle(t),"loop");return Hg(i,r,s,l,c,e,n)}}yv.defaultStyleProps={radius:0,controlPoints:[],router:!1};class bv extends nv{constructor(t){super(gf({style:bv.defaultStyleProps},t))}getKeyPath(t){const{curvePosition:e,curveOffset:n}=t,[r,i]=this.getEndpoints(t);return function(t,e,n){return[["M",t[0],t[1]],["Q",n[0],n[1],e[0],e[1]]]}(r,i,t.controlPoint||_g(r,i,e,n))}}bv.defaultStyleProps={curvePosition:.5,curveOffset:30};var xv=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};function Ev(t){return t instanceof Hf&&"node"===t.type}function wv(t){return t instanceof nv}function kv(t){return t instanceof wg}const Mv={top:[.5,0],right:[1,.5],bottom:[.5,1],left:[0,.5],"left-top":[0,0],"top-left":[0,0],"left-bottom":[0,1],"bottom-left":[0,1],"right-top":[1,0],"top-right":[1,0],"right-bottom":[1,1],"bottom-right":[1,1],default:[.5,.5]};function Sv(t,e,n=Mv,r=!0){const i=[.5,.5],o=se(e)?nf(n,e.toLocaleLowerCase(),i):e;if(!r&&se(e))return o;const[a,s]=o||i;return[t.min[0]+qu(t)*a,t.min[1]+Xu(t)*s]}function Av(t){if(!t)return{};const e=t.getPorts();return(t.attributes.ports||[]).forEach(((n,r)=>{var i;const{key:o,placement:a}=n;Nv(n)&&(e[i=o||r]||(e[i]=Cd(t.getShape("key").getBounds(),a)))})),e}function Nv(t){const{r:e}=t;return!e||0===Number(e)}function Cv(t){return Wu(t)?t:t.getPosition()}function Ov(t,e,n,r){const i=Av(t);if(n)return i[n];const o=Object.values(i);if(0===o.length)return;const a=o.map((t=>Cv(t))),s=function(t,e){const n=Av(t);if(e)return[Cv(n[e])];const r=Object.values(n);return r.length>0?r.map((t=>Cv(t))):[t.getCenter()]}(e,r),[l]=function(t,e){let n=1/0,r=[t[0],e[0]];return t.forEach((t=>{e.forEach((e=>{const i=dd(t,e);i<n&&(n=i,r=[t,e])}))})),r}(a,s);return o.find((t=>Cv(t)===l))}function Tv(t,e){return kv(t)||Ev(t)?Rv(t,e):Pv(t,e)}function Pv(t,e){if(!t||!e)return[0,0,0];if(Wu(t))return t;if(t.attributes.linkToCenter)return t.getPosition();return jd(Wu(e)?e:Ev(e)?e.getCenter():e.getPosition(),t.getBounds())}function Rv(t,e){if(!t||!e)return[0,0,0];const n=Wu(e)?e:Ev(e)?e.getCenter():e.getPosition();return t.getIntersectPoint(n)||t.getCenter()}function Dv(t,e="bottom",n=0,r=0,i=!1){const o=e.split("-"),[a,s]=Cd(t,e),[l,c]=i?["bottom","top"]:["top","bottom"];return{transform:[["translate",a+n,s+r]],textBaseline:o.includes("top")?c:o.includes("bottom")?l:"middle",textAlign:o.includes("left")?"right":o.includes("right")?"left":"center"}}function Lv(t){return"hidden"!==nf(t,["style","visibility"])}function Iv(t,e){"update"in t?t.update(e):t.attr(e)}function Bv(t){return nf(t,"__to_be_destroyed__",!1)}var jv=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(t){o(t)}}function s(t){try{l(r.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}))};class zv extends td{constructor(t,e){super(t,Object.assign({},zv.defaultOptions,e)),this.onCollapseExpand=t=>jv(this,void 0,void 0,(function*(){if(!this.validate(t))return;const{target:e}=t;if(!(Ev(n=e)||wv(n)||kv(n)))return;var n;const r=e.id,{model:i,graph:o}=this.context,a=i.getElementDataById(r);if(!a)return!1;const{onCollapse:s,onExpand:l,animation:c,align:u}=this.options;ef(a)?(yield o.expandElement(r,{animation:c,align:u}),null==l||l(r)):(yield o.collapseElement(r,{animation:c,align:u}),null==s||s(r))})),this.bindEvents()}update(t){this.unbindEvents(),super.update(t),this.bindEvents()}bindEvents(){const{graph:t}=this.context,{trigger:e}=this.options;t.on(`node:${e}`,this.onCollapseExpand),t.on(`combo:${e}`,this.onCollapseExpand)}unbindEvents(){const{graph:t}=this.context,{trigger:e}=this.options;t.off(`node:${e}`,this.onCollapseExpand),t.off(`combo:${e}`,this.onCollapseExpand)}validate(t){if(this.destroyed)return!1;const{enable:e}=this.options;return en(e)?e(t):!!e}destroy(){this.unbindEvents(),super.destroy()}}zv.defaultOptions={enable:!0,animation:!0,trigger:hu.DBLCLICK,align:!0};var Fv={},_v=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(t){o(t)}}function s(t){try{l(r.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}))};const Zv="g6-create-edge-assist-node-id";class Gv extends td{constructor(t,e){super(t,Object.assign({},Gv.defaultOptions,e)),this.drop=t=>_v(this,void 0,void 0,(function*(){const{targetType:e}=t;["combo","node"].includes(e)&&this.source?yield this.handleCreateEdge(t):yield this.cancelEdge()})),this.handleCreateEdge=t=>_v(this,void 0,void 0,(function*(){var e,n,r;if(!this.validate(t))return;const{graph:i,canvas:o,batch:a,element:s}=this.context,{style:l}=this.options;if(this.source)return this.createEdge(t),void(yield this.cancelEdge());a.startBatch(),o.setCursor("crosshair"),this.source=this.getSelectedNodeIDs([t.target.id])[0];const c=i.getElementData(this.source);i.addNodeData([{id:Zv,style:{visibility:"hidden",ports:[{key:"port-1",placement:[.5,.5]}],x:null===(e=c.style)||void 0===e?void 0:e.x,y:null===(n=c.style)||void 0===n?void 0:n.y}}]),i.addEdgeData([{id:"g6-create-edge-assist-edge-id",source:this.source,target:Zv,style:Object.assign({pointerEvents:"none"},l)}]),yield null===(r=s.draw({animation:!1}))||void 0===r?void 0:r.finished})),this.updateAssistEdge=t=>_v(this,void 0,void 0,(function*(){var e;if(!this.source)return;const{model:n,element:r}=this.context;n.translateNodeTo(Zv,[t.canvas.x,t.canvas.y]),yield null===(e=r.draw({animation:!1,silence:!0}))||void 0===e?void 0:e.finished})),this.createEdge=t=>{var e,n;const{graph:r}=this.context,{style:i,onFinish:o,onCreate:a}=this.options;if(void 0===(null===(e=t.target)||void 0===e?void 0:e.id)||void 0===this.source)return;const s=null===(n=this.getSelectedNodeIDs([t.target.id]))||void 0===n?void 0:n[0];var l;const c=a({id:`${this.source}-${s}-${Fv[l=l||"g"]?Fv[l]+=1:Fv[l]=1,l+Fv[l]}`,source:this.source,target:s,style:i});c&&(r.addEdgeData([c]),o(c))},this.cancelEdge=()=>_v(this,void 0,void 0,(function*(){var t;if(!this.source)return;const{graph:e,element:n,batch:r}=this.context;e.removeNodeData([Zv]),this.source=void 0,yield null===(t=n.draw({animation:!1}))||void 0===t?void 0:t.finished,r.endBatch()})),this.bindEvents()}update(t){super.update(t),this.bindEvents()}bindEvents(){const{graph:t}=this.context,{trigger:e}=this.options;this.unbindEvents(),"click"===e?(t.on(vu.CLICK,this.handleCreateEdge),t.on(uu.CLICK,this.handleCreateEdge),t.on(cu.CLICK,this.cancelEdge),t.on(fu.CLICK,this.cancelEdge)):(t.on(vu.DRAG_START,this.handleCreateEdge),t.on(uu.DRAG_START,this.handleCreateEdge),t.on(hu.POINTER_UP,this.drop)),t.on(hu.POINTER_MOVE,this.updateAssistEdge)}getSelectedNodeIDs(t){return Array.from(new Set(this.context.graph.getElementDataByState("node",this.options.state).map((t=>t.id)).concat(t)))}validate(t){if(this.destroyed)return!1;const{enable:e}=this.options;return en(e)?e(t):!!e}unbindEvents(){const{graph:t}=this.context;t.off(vu.CLICK,this.handleCreateEdge),t.off(uu.CLICK,this.handleCreateEdge),t.off(cu.CLICK,this.cancelEdge),t.off(fu.CLICK,this.cancelEdge),t.off(vu.DRAG_START,this.handleCreateEdge),t.off(uu.DRAG_START,this.handleCreateEdge),t.off(hu.POINTER_UP,this.drop),t.off(hu.POINTER_MOVE,this.updateAssistEdge)}destroy(){this.unbindEvents(),super.destroy()}}Gv.defaultOptions={animation:!0,enable:!0,style:{},trigger:"drag",onCreate:t=>t,onFinish:()=>{}};var Vv=function(t,e,n){var r;return function(){var i=this,o=arguments,a=function(){r=null,n||t.apply(i,o)},s=n&&!r;clearTimeout(r),r=setTimeout(a,e),s&&t.apply(i,o)}},Wv=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(t){o(t)}}function s(t){try{l(r.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}))};class Hv extends td{constructor(t,e){super(t,Object.assign({},Hv.defaultOptions,e)),this.isDragging=!1,this.onDragStart=t=>{this.validate(t)&&(this.isDragging=!0,this.context.canvas.setCursor("grabbing"))},this.onDrag=t=>{var e,n,r,i;if(!this.isDragging||Gd.isPinching)return;const o=null!==(n=null===(e=t.movement)||void 0===e?void 0:e.x)&&void 0!==n?n:t.dx,a=null!==(i=null===(r=t.movement)||void 0===r?void 0:r.y)&&void 0!==i?i:t.dy;0!=(o|a)&&this.translate([o,a],!1)},this.onDragEnd=()=>{var t,e;this.isDragging=!1,this.context.canvas.setCursor(this.defaultCursor),null===(e=(t=this.options).onFinish)||void 0===e||e.call(t)},this.invokeOnFinish=Vv((()=>{var t,e;null===(e=(t=this.options).onFinish)||void 0===e||e.call(t)}),300),this.shortcut=new Wd(t.graph),this.bindEvents(),this.defaultCursor=this.context.canvas.getConfig().cursor||"default"}update(t){this.unbindEvents(),super.update(t),this.bindEvents()}bindEvents(){const{trigger:t}=this.options;if(nn(t)){const{up:e=[],down:n=[],left:r=[],right:i=[]}=t;this.shortcut.bind(e,(t=>this.onTranslate([0,1],t))),this.shortcut.bind(n,(t=>this.onTranslate([0,-1],t))),this.shortcut.bind(r,(t=>this.onTranslate([1,0],t))),this.shortcut.bind(i,(t=>this.onTranslate([-1,0],t)))}else{const{graph:t}=this.context;t.on(hu.DRAG_START,this.onDragStart),t.on(hu.DRAG,this.onDrag),t.on(hu.DRAG_END,this.onDragEnd)}}onTranslate(t,e){return Wv(this,void 0,void 0,(function*(){if(!this.validate(e))return;const{sensitivity:n}=this.options,r=-1*n;yield this.translate(cd(t,r),this.options.animation),this.invokeOnFinish()}))}translate(t,e){return Wv(this,void 0,void 0,(function*(){t=this.clampByDirection(t),t=this.clampByRange(t),t=this.clampByRotation(t),yield this.context.graph.translateBy(t,e)}))}clampByRotation([t,e]){return Ed([t,e],this.context.graph.getRotation())}clampByDirection([t,e]){const{direction:n}=this.options;return"x"===n?e=0:"y"===n&&(t=0),[t,e]}clampByRange([t,e]){const{viewport:n,canvas:r}=this.context,[i,o]=r.getSize(),[a,s,l,c]=Uu(this.options.range),u=[o*a,i*s,o*l,i*c],h=$u(Ju(n.getCanvasCenter()),u),d=ld(n.getViewportCenter(),[t,e,0]);if(!eh(d,h)){const{min:[n,r],max:[i,o]}=h;(d[0]<n&&t>0||d[0]>i&&t<0)&&(t=0),(d[1]<r&&e>0||d[1]>o&&e<0)&&(e=0)}return[t,e]}validate(t){if(this.destroyed)return!1;const{enable:e}=this.options;return"function"==typeof e?e(t):!!e}unbindEvents(){this.shortcut.unbindAll();const{graph:t}=this.context;t.off(hu.DRAG_START,this.onDragStart),t.off(hu.DRAG,this.onDrag),t.off(hu.DRAG_END,this.onDragEnd)}destroy(){this.shortcut.destroy(),this.unbindEvents(),this.context.canvas.setCursor(this.defaultCursor),super.destroy()}}Hv.defaultOptions={enable:t=>!("targetType"in t)||"canvas"===t.targetType,sensitivity:10,direction:"both",range:1/0};var Uv=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(t){o(t)}}function s(t){try{l(r.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}))};class Yv extends td{constructor(t,e){super(t,Object.assign({},Yv.defaultOptions,e)),this.enable=!1,this.enableElements=["node","combo"],this.target=[],this.shadowOrigin=[0,0],this.hiddenEdges=[],this.isDragging=!1,this.onDrop=t=>Uv(this,void 0,void 0,(function*(){var e;if("link"!==this.options.dropEffect)return;const{model:n,element:r}=this.context,i=t.target.id;this.target.forEach((t=>{const e=n.getParentData(t,mu);e&&Fh(e)===i&&n.refreshComboData(i),n.setParent(t,i,mu)})),yield null===(e=null==r?void 0:r.draw({animation:!0}))||void 0===e?void 0:e.finished})),this.setCursor=t=>{if(this.isDragging)return;const{type:e}=t,{canvas:n}=this.context,{cursor:r}=this.options;e===hu.POINTER_ENTER?n.setCursor((null==r?void 0:r.grab)||"grab"):n.setCursor((null==r?void 0:r.default)||"default")},this.onDragStart=this.onDragStart.bind(this),this.onDrag=this.onDrag.bind(this),this.onDragEnd=this.onDragEnd.bind(this),this.onDrop=this.onDrop.bind(this),this.bindEvents()}update(t){this.unbindEvents(),super.update(t),this.bindEvents()}bindEvents(){const{graph:t,canvas:e}=this.context,n=e.getLayer().getContextService().$canvas;n&&(n.addEventListener("blur",this.onDragEnd),n.addEventListener("contextmenu",this.onDragEnd)),this.enableElements.forEach((e=>{t.on(`${e}:${hu.DRAG_START}`,this.onDragStart),t.on(`${e}:${hu.DRAG}`,this.onDrag),t.on(`${e}:${hu.DRAG_END}`,this.onDragEnd),t.on(`${e}:${hu.POINTER_ENTER}`,this.setCursor),t.on(`${e}:${hu.POINTER_LEAVE}`,this.setCursor)})),["link"].includes(this.options.dropEffect)&&(t.on(uu.DROP,this.onDrop),t.on(cu.DROP,this.onDrop))}getSelectedNodeIDs(t){return Array.from(new Set(this.context.graph.getElementDataByState("node",this.options.state).map((t=>t.id)).concat(t)))}getDelta(t){const e=this.context.graph.getZoom();return ud([t.dx,t.dy],e)}onDragStart(t){var e;if(this.enable=this.validate(t),!this.enable)return;const{batch:n,canvas:r,graph:i}=this.context;r.setCursor((null===(e=this.options.cursor)||void 0===e?void 0:e.grabbing)||"grabbing"),this.isDragging=!0,n.startBatch();const o=t.target.id;i.getElementState(o).includes(this.options.state)?this.target=this.getSelectedNodeIDs([o]):this.target=[o],this.hideEdge(),this.context.graph.frontElement(this.target),this.options.shadow&&this.createShadow(this.target)}onDrag(t){if(!this.enable)return;const e=this.getDelta(t);this.options.shadow?this.moveShadow(e):this.moveElement(this.target,e)}onDragEnd(){var t,e,n;if(!this.enable)return;if(this.enable=!1,this.options.shadow){if(!this.shadow)return;this.shadow.style.visibility="hidden";const{x:t=0,y:e=0}=this.shadow.attributes,[n,r]=ld([+t,+e],this.shadowOrigin);this.moveElement(this.target,[n,r])}this.showEdges(),null===(e=(t=this.options).onFinish)||void 0===e||e.call(t,this.target);const{batch:r,canvas:i}=this.context;r.endBatch(),i.setCursor((null===(n=this.options.cursor)||void 0===n?void 0:n.grab)||"grab"),this.isDragging=!1,this.target=[]}validate(t){if(this.destroyed||Bv(t.target)||this.context.graph.isCollapsingExpanding)return!1;const{enable:e}=this.options;return en(e)?e(t):!!e}clampByRotation([t,e]){return Ed([t,e],this.context.graph.getRotation())}moveElement(t,e){return Uv(this,void 0,void 0,(function*(){const{graph:n,model:r}=this.context,{dropEffect:i}=this.options;"move"===i&&t.forEach((t=>r.refreshComboData(t))),n.translateElementBy(Object.fromEntries(t.map((t=>[t,this.clampByRotation(e)]))),!1)}))}moveShadow(t){if(!this.shadow)return;const{x:e=0,y:n=0}=this.shadow.attributes,[r,i]=t;this.shadow.attr({x:+e+r,y:+n+i})}createShadow(t){const e=cf(this.options,"shadow"),n=th(t.map((t=>this.context.element.getElement(t).getBounds()))),[r,i]=n.min;this.shadowOrigin=[r,i];const[o,a]=Ku(n),s={width:o,height:a,x:r,y:i};this.shadow?this.shadow.attr(Object.assign(Object.assign(Object.assign({},e),s),{visibility:"visible"})):(this.shadow=new zl({style:Object.assign(Object.assign(Object.assign({$layer:"transient"},e),s),{pointerEvents:"none"})}),this.context.canvas.appendChild(this.shadow))}showEdges(){this.options.shadow||0===this.hiddenEdges.length||(this.context.graph.showElement(this.hiddenEdges),this.hiddenEdges=[])}hideEdge(){const{hideEdge:t,shadow:e}=this.options;if("none"===t||e)return;const{graph:n}=this.context;this.hiddenEdges="all"===t?n.getEdgeData().map(Fh):Array.from(new Set(this.target.map((e=>n.getRelatedEdgesData(e,t).map(Fh))).flat())),n.hideElement(this.hiddenEdges)}unbindEvents(){const{graph:t,canvas:e}=this.context,n=e.getLayer().getContextService().$canvas;n&&(n.removeEventListener("blur",this.onDragEnd),n.removeEventListener("contextmenu",this.onDragEnd)),this.enableElements.forEach((e=>{t.off(`${e}:${hu.DRAG_START}`,this.onDragStart),t.off(`${e}:${hu.DRAG}`,this.onDrag),t.off(`${e}:${hu.DRAG_END}`,this.onDragEnd),t.off(`${e}:${hu.POINTER_ENTER}`,this.setCursor),t.off(`${e}:${hu.POINTER_LEAVE}`,this.setCursor)})),t.off(`combo:${hu.DROP}`,this.onDrop),t.off(`canvas:${hu.DROP}`,this.onDrop)}destroy(){var t;this.unbindEvents(),null===(t=this.shadow)||void 0===t||t.destroy(),super.destroy()}}Yv.defaultOptions={animation:!0,enable:t=>["node","combo"].includes(t.targetType),dropEffect:"move",state:"selected",hideEdge:"none",shadow:!1,shadowZIndex:100,shadowFill:"#F3F9FF",shadowFillOpacity:.5,shadowStroke:"#1890FF",shadowStrokeOpacity:.9,shadowLineDash:[5,5],cursor:{default:"default",grab:"grab",grabbing:"grabbing"}};var qv=function(){function t(){this._events={}}return t.prototype.on=function(t,e,n){return this._events[t]||(this._events[t]=[]),this._events[t].push({callback:e,once:!!n}),this},t.prototype.once=function(t,e){return this.on(t,e,!0)},t.prototype.emit=function(t){for(var e=this,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var i=this._events[t]||[],o=this._events["*"]||[],a=function(r){for(var i=r.length,o=0;o<i;o++)if(r[o]){var a=r[o],s=a.callback;a.once&&(r.splice(o,1),0===r.length&&delete e._events[t],i--,o--),s.apply(e,n)}};a(i),a(o)},t.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},t.prototype.getEvents=function(){return this._events},t}(),Xv=qv;function Kv(t,e,n,r){for(;t.length;){const i=t.shift();if(n(i))return!0;e.add(i.id),r(i.id).forEach((n=>{e.has(n.id)||(e.add(n.id),t.push(n))}))}return!1}function Qv(t,e,n,r){if(n(t))return!0;e.add(t.id);for(const i of r(t.id))if(!e.has(i.id)&&Qv(i,e,n,r))return!0;return!1}const Jv=()=>!0;class $v{graph;nodeFilter;edgeFilter;cacheEnabled;inEdgesMap=new Map;outEdgesMap=new Map;bothEdgesMap=new Map;allNodesMap=new Map;allEdgesMap=new Map;constructor(t){this.graph=t.graph;const e=t.nodeFilter||Jv,n=t.edgeFilter||Jv;this.nodeFilter=e,this.edgeFilter=t=>{const{source:r,target:i}=this.graph.getEdgeDetail(t.id);return!(!e(r)||!e(i))&&n(t,r,i)},"auto"===t.cache?(this.cacheEnabled=!0,this.startAutoCache()):"manual"===t.cache?this.cacheEnabled=!0:this.cacheEnabled=!1}clearCache=()=>{this.inEdgesMap.clear(),this.outEdgesMap.clear(),this.bothEdgesMap.clear(),this.allNodesMap.clear(),this.allEdgesMap.clear()};refreshCache=()=>{this.clearCache(),this.updateCache(this.graph.getAllNodes().map((t=>t.id)))};updateCache=t=>{const e=new Set;t.forEach((t=>{const n=this.bothEdgesMap.get(t);if(n&&n.forEach((t=>e.add(t.id))),this.hasNode(t)){const n=this.graph.getRelatedEdges(t,"in").filter(this.edgeFilter),r=this.graph.getRelatedEdges(t,"out").filter(this.edgeFilter),i=Array.from(new Set([...n,...r]));i.forEach((t=>e.add(t.id))),this.inEdgesMap.set(t,n),this.outEdgesMap.set(t,r),this.bothEdgesMap.set(t,i),this.allNodesMap.set(t,this.graph.getNode(t))}else this.inEdgesMap.delete(t),this.outEdgesMap.delete(t),this.bothEdgesMap.delete(t),this.allNodesMap.delete(t)})),e.forEach((t=>{this.hasEdge(t)?this.allEdgesMap.set(t,this.graph.getEdge(t)):this.allEdgesMap.delete(t)}))};startAutoCache(){this.refreshCache(),this.graph.on("changed",this.handleGraphChanged)}stopAutoCache(){this.graph.off("changed",this.handleGraphChanged)}handleGraphChanged=t=>{const e=new Set;t.changes.forEach((n=>{switch(n.type){case"NodeAdded":case"NodeRemoved":e.add(n.value.id);break;case"NodeDataUpdated":e.add(n.id);break;case"EdgeAdded":case"EdgeRemoved":e.add(n.value.source),e.add(n.value.target);break;case"EdgeUpdated":"source"!==n.propertyName&&"target"!==n.propertyName||(e.add(n.oldValue),e.add(n.newValue));break;case"EdgeDataUpdated":if(t.graph.hasEdge(n.id)){const r=t.graph.getEdge(n.id);e.add(r.source),e.add(r.target)}}})),this.updateCache(e)};checkNodeExistence(t){this.getNode(t)}hasNode(t){if(!this.graph.hasNode(t))return!1;const e=this.graph.getNode(t);return this.nodeFilter(e)}areNeighbors(t,e){return this.checkNodeExistence(t),this.getNeighbors(e).some((e=>e.id===t))}getNode(t){const e=this.graph.getNode(t);if(!this.nodeFilter(e))throw new Error("Node not found for id: "+t);return e}getRelatedEdges(t,e){if(this.checkNodeExistence(t),this.cacheEnabled)return"in"===e?this.inEdgesMap.get(t):"out"===e?this.outEdgesMap.get(t):this.bothEdgesMap.get(t);return this.graph.getRelatedEdges(t,e).filter(this.edgeFilter)}getDegree(t,e){return this.getRelatedEdges(t,e).length}getSuccessors(t){const e=this.getRelatedEdges(t,"out").map((t=>this.getNode(t.target)));return Array.from(new Set(e))}getPredecessors(t){const e=this.getRelatedEdges(t,"in").map((t=>this.getNode(t.source)));return Array.from(new Set(e))}getNeighbors(t){const e=this.getPredecessors(t),n=this.getSuccessors(t);return Array.from(new Set([...e,...n]))}hasEdge(t){if(!this.graph.hasEdge(t))return!1;const e=this.graph.getEdge(t);return this.edgeFilter(e)}getEdge(t){const e=this.graph.getEdge(t);if(!this.edgeFilter(e))throw new Error("Edge not found for id: "+t);return e}getEdgeDetail(t){const e=this.getEdge(t);return{edge:e,source:this.getNode(e.source),target:this.getNode(e.target)}}hasTreeStructure(t){return this.graph.hasTreeStructure(t)}getRoots(t){return this.graph.getRoots(t).filter(this.nodeFilter)}getChildren(t,e){return this.checkNodeExistence(t),this.graph.getChildren(t,e).filter(this.nodeFilter)}getParent(t,e){this.checkNodeExistence(t);const n=this.graph.getParent(t,e);return n&&this.nodeFilter(n)?n:null}getAllNodes(){return this.cacheEnabled?Array.from(this.allNodesMap.values()):this.graph.getAllNodes().filter(this.nodeFilter)}getAllEdges(){return this.cacheEnabled?Array.from(this.allEdgesMap.values()):this.graph.getAllEdges().filter(this.edgeFilter)}bfs(t,e,n="out"){const r={in:this.getPredecessors.bind(this),out:this.getSuccessors.bind(this),both:this.getNeighbors.bind(this)}[n];Kv([this.getNode(t)],new Set,e,r)}dfs(t,e,n="out"){const r={in:this.getPredecessors.bind(this),out:this.getSuccessors.bind(this),both:this.getNeighbors.bind(this)}[n];Qv(this.getNode(t),new Set,e,r)}}class tm extends Xv{nodeMap=new Map;edgeMap=new Map;inEdgesMap=new Map;outEdgesMap=new Map;bothEdgesMap=new Map;treeIndices=new Map;changes=[];batchCount=0;onChanged=()=>{};constructor(t){super(),t&&(t.nodes&&this.addNodes(t.nodes),t.edges&&this.addEdges(t.edges),t.tree&&this.addTree(t.tree),t.onChanged&&(this.onChanged=t.onChanged))}batch=t=>{this.batchCount+=1,t(),this.batchCount-=1,this.batchCount||this.commit()};commit(){const t=this.changes;this.changes=[];const e={graph:this,changes:t};this.emit("changed",e),this.onChanged(e)}reduceChanges(t){let e=[];return t.forEach((t=>{switch(t.type){case"NodeRemoved":{let n=!1;e=e.filter((e=>{if("NodeAdded"===e.type){const r=e.value.id===t.value.id;return r&&(n=!0),!r}return"NodeDataUpdated"===e.type?e.id!==t.value.id:"TreeStructureChanged"!==e.type||e.nodeId!==t.value.id})),n||e.push(t);break}case"EdgeRemoved":{let n=!1;e=e.filter((e=>{if("EdgeAdded"===e.type){const r=e.value.id===t.value.id;return r&&(n=!0),!r}return"EdgeDataUpdated"!==e.type&&"EdgeUpdated"!==e.type||e.id!==t.value.id})),n||e.push(t);break}case"NodeDataUpdated":case"EdgeDataUpdated":case"EdgeUpdated":{const n=e.findIndex((e=>e.type===t.type&&e.id===t.id&&(void 0===t.propertyName||e.propertyName===t.propertyName))),r=e[n];r?void 0!==t.propertyName?r.newValue=t.newValue:(e.splice(n,1),e.push(t)):e.push(t);break}case"TreeStructureDetached":e=e.filter((e=>"TreeStructureAttached"===e.type?e.treeKey!==t.treeKey:"TreeStructureChanged"!==e.type||e.treeKey!==t.treeKey)),e.push(t);break;case"TreeStructureChanged":{const n=e.find((e=>"TreeStructureChanged"===e.type&&e.treeKey===t.treeKey&&e.nodeId===t.nodeId));n?n.newParentId=t.newParentId:e.push(t);break}default:e.push(t)}})),e}checkNodeExistence(t){this.getNode(t)}hasNode(t){return this.nodeMap.has(t)}areNeighbors(t,e){return this.getNeighbors(e).some((e=>e.id===t))}getNode(t){const e=this.nodeMap.get(t);if(!e)throw new Error("Node not found for id: "+t);return e}getRelatedEdges(t,e){if(this.checkNodeExistence(t),"in"===e){const e=this.inEdgesMap.get(t);return Array.from(e)}if("out"===e){const e=this.outEdgesMap.get(t);return Array.from(e)}{const e=this.bothEdgesMap.get(t);return Array.from(e)}}getDegree(t,e){return this.getRelatedEdges(t,e).length}getSuccessors(t){const e=this.getRelatedEdges(t,"out").map((t=>this.getNode(t.target)));return Array.from(new Set(e))}getPredecessors(t){const e=this.getRelatedEdges(t,"in").map((t=>this.getNode(t.source)));return Array.from(new Set(e))}getNeighbors(t){const e=this.getPredecessors(t),n=this.getSuccessors(t);return Array.from(new Set([...e,...n]))}doAddNode(t){if(this.hasNode(t.id))throw new Error("Node already exists: "+t.id);this.nodeMap.set(t.id,t),this.inEdgesMap.set(t.id,new Set),this.outEdgesMap.set(t.id,new Set),this.bothEdgesMap.set(t.id,new Set),this.treeIndices.forEach((e=>{e.childrenMap.set(t.id,new Set)})),this.changes.push({type:"NodeAdded",value:t})}addNodes(t){this.batch((()=>{for(const e of t)this.doAddNode(e)}))}addNode(t){this.addNodes([t])}doRemoveNode(t){const e=this.getNode(t);this.bothEdgesMap.get(t)?.forEach((t=>this.doRemoveEdge(t.id))),this.nodeMap.delete(t),this.treeIndices.forEach((n=>{n.childrenMap.get(t)?.forEach((t=>{n.parentMap.delete(t.id)}));const r=n.parentMap.get(t);r&&n.childrenMap.get(r.id)?.delete(e),n.parentMap.delete(t),n.childrenMap.delete(t)})),this.bothEdgesMap.delete(t),this.inEdgesMap.delete(t),this.outEdgesMap.delete(t),this.changes.push({type:"NodeRemoved",value:e})}removeNodes(t){this.batch((()=>{t.forEach((t=>this.doRemoveNode(t)))}))}removeNode(t){this.removeNodes([t])}updateNodeDataProperty(t,e,n){const r=this.getNode(t);this.batch((()=>{const i=r.data[e],o=n;r.data[e]=o,this.changes.push({type:"NodeDataUpdated",id:t,propertyName:e,oldValue:i,newValue:o})}))}mergeNodeData(t,e){this.batch((()=>{Object.entries(e).forEach((([e,n])=>{this.updateNodeDataProperty(t,e,n)}))}))}updateNodeData(...t){const e=t[0],n=this.getNode(e);if("string"==typeof t[1])return void this.updateNodeDataProperty(e,t[1],t[2]);let r;if("function"==typeof t[1]){const e=t[1];r=e(n.data)}else"object"==typeof t[1]&&(r=t[1]);this.batch((()=>{const t=n.data,i=r;n.data=r,this.changes.push({type:"NodeDataUpdated",id:e,oldValue:t,newValue:i})}))}checkEdgeExistence(t){if(!this.hasEdge(t))throw new Error("Edge not found for id: "+t)}hasEdge(t){return this.edgeMap.has(t)}getEdge(t){return this.checkEdgeExistence(t),this.edgeMap.get(t)}getEdgeDetail(t){const e=this.getEdge(t);return{edge:e,source:this.getNode(e.source),target:this.getNode(e.target)}}doAddEdge(t){if(this.hasEdge(t.id))throw new Error("Edge already exists: "+t.id);this.checkNodeExistence(t.source),this.checkNodeExistence(t.target),this.edgeMap.set(t.id,t);const e=this.inEdgesMap.get(t.target),n=this.outEdgesMap.get(t.source),r=this.bothEdgesMap.get(t.source),i=this.bothEdgesMap.get(t.target);e.add(t),n.add(t),r.add(t),i.add(t),this.changes.push({type:"EdgeAdded",value:t})}addEdges(t){this.batch((()=>{for(const e of t)this.doAddEdge(e)}))}addEdge(t){this.addEdges([t])}doRemoveEdge(t){const e=this.getEdge(t),n=this.outEdgesMap.get(e.source),r=this.inEdgesMap.get(e.target),i=this.bothEdgesMap.get(e.source),o=this.bothEdgesMap.get(e.target);n.delete(e),r.delete(e),i.delete(e),o.delete(e),this.edgeMap.delete(t),this.changes.push({type:"EdgeRemoved",value:e})}removeEdges(t){this.batch((()=>{t.forEach((t=>this.doRemoveEdge(t)))}))}removeEdge(t){this.removeEdges([t])}updateEdgeSource(t,e){const n=this.getEdge(t);this.checkNodeExistence(e);const r=n.source,i=e;this.outEdgesMap.get(r).delete(n),this.bothEdgesMap.get(r).delete(n),this.outEdgesMap.get(i).add(n),this.bothEdgesMap.get(i).add(n),n.source=e,this.batch((()=>{this.changes.push({type:"EdgeUpdated",id:t,propertyName:"source",oldValue:r,newValue:i})}))}updateEdgeTarget(t,e){const n=this.getEdge(t);this.checkNodeExistence(e);const r=n.target,i=e;this.inEdgesMap.get(r).delete(n),this.bothEdgesMap.get(r).delete(n),this.inEdgesMap.get(i).add(n),this.bothEdgesMap.get(i).add(n),n.target=e,this.batch((()=>{this.changes.push({type:"EdgeUpdated",id:t,propertyName:"target",oldValue:r,newValue:i})}))}updateEdgeDataProperty(t,e,n){const r=this.getEdge(t);this.batch((()=>{const i=r.data[e],o=n;r.data[e]=o,this.changes.push({type:"EdgeDataUpdated",id:t,propertyName:e,oldValue:i,newValue:o})}))}updateEdgeData(...t){const e=t[0],n=this.getEdge(e);if("string"==typeof t[1])return void this.updateEdgeDataProperty(e,t[1],t[2]);let r;if("function"==typeof t[1]){const e=t[1];r=e(n.data)}else"object"==typeof t[1]&&(r=t[1]);this.batch((()=>{const t=n.data,i=r;n.data=r,this.changes.push({type:"EdgeDataUpdated",id:e,oldValue:t,newValue:i})}))}mergeEdgeData(t,e){this.batch((()=>{Object.entries(e).forEach((([e,n])=>{this.updateEdgeDataProperty(t,e,n)}))}))}checkTreeExistence(t){if(!this.hasTreeStructure(t))throw new Error("Tree structure not found for treeKey: "+t)}hasTreeStructure(t){return this.treeIndices.has(t)}attachTreeStructure(t){this.treeIndices.has(t)||(this.treeIndices.set(t,{parentMap:new Map,childrenMap:new Map}),this.batch((()=>{this.changes.push({type:"TreeStructureAttached",treeKey:t})})))}detachTreeStructure(t){this.checkTreeExistence(t),this.treeIndices.delete(t),this.batch((()=>{this.changes.push({type:"TreeStructureDetached",treeKey:t})}))}addTree(t,e){this.batch((()=>{this.attachTreeStructure(e);const n=[],r=Array.isArray(t)?t:[t];for(;r.length;){const t=r.shift();n.push(t),t.children&&r.push(...t.children)}this.addNodes(n),n.forEach((t=>{t.children?.forEach((n=>{this.setParent(n.id,t.id,e)}))}))}))}getRoots(t){return this.checkTreeExistence(t),this.getAllNodes().filter((e=>!this.getParent(e.id,t)))}getChildren(t,e){this.checkNodeExistence(t),this.checkTreeExistence(e);const n=this.treeIndices.get(e).childrenMap.get(t);return Array.from(n||[])}getParent(t,e){this.checkNodeExistence(t),this.checkTreeExistence(e);return this.treeIndices.get(e).parentMap.get(t)||null}getAncestors(t,e){const n=[];let r,i=this.getNode(t);for(;r=this.getParent(i.id,e);)n.push(r),i=r;return n}setParent(t,e,n){this.checkTreeExistence(n);const r=this.treeIndices.get(n);if(!r)return;const i=this.getNode(t),o=r.parentMap.get(t);if(o?.id===e)return;if(null==e)return o&&r.childrenMap.get(o.id)?.delete(i),void r.parentMap.delete(t);const a=this.getNode(e);r.parentMap.set(t,a),o&&r.childrenMap.get(o.id)?.delete(i);let s=r.childrenMap.get(a.id);s||(s=new Set,r.childrenMap.set(a.id,s)),s.add(i),this.batch((()=>{this.changes.push({type:"TreeStructureChanged",treeKey:n,nodeId:t,oldParentId:o?.id,newParentId:a.id})}))}dfsTree(t,e,n){return Qv(this.getNode(t),new Set,e,(t=>this.getChildren(t,n)))}bfsTree(t,e,n){return Kv([this.getNode(t)],new Set,e,(t=>this.getChildren(t,n)))}getAllNodes(){return Array.from(this.nodeMap.values())}getAllEdges(){return Array.from(this.edgeMap.values())}bfs(t,e,n="out"){const r={in:this.getPredecessors.bind(this),out:this.getSuccessors.bind(this),both:this.getNeighbors.bind(this)}[n];return Kv([this.getNode(t)],new Set,e,r)}dfs(t,e,n="out"){const r={in:this.getPredecessors.bind(this),out:this.getSuccessors.bind(this),both:this.getNeighbors.bind(this)}[n];return Qv(this.getNode(t),new Set,e,r)}clone(){const t=this.getAllNodes().map((t=>({...t,data:{...t.data}}))),e=this.getAllEdges().map((t=>({...t,data:{...t.data}}))),n=new tm({nodes:t,edges:e});return this.treeIndices.forEach((({parentMap:t,childrenMap:e},r)=>{const i=new Map;t.forEach(((t,e)=>{i.set(e,n.getNode(t.id))}));const o=new Map;e.forEach(((t,e)=>{o.set(e,new Set(Array.from(t).map((t=>n.getNode(t.id)))))})),n.treeIndices.set(r,{parentMap:i,childrenMap:o})})),n}toJSON(){return JSON.stringify({nodes:this.getAllNodes(),edges:this.getAllEdges()})}createView(t){return new $v({graph:this,...t})}}class em{constructor(t,e){this.context=t,this.options=e||{}}}var nm=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(t){o(t)}}function s(t){try{l(r.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}))},rm=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};function im(t){const{nodes:e,edges:n}=t,r={nodes:[],edges:[],combos:[]};return e.forEach((t=>{const e=t.data._isCombo?r.combos:r.nodes,{x:n,y:i,z:o=0}=t.data;null==e||e.push({id:t.id,style:{x:n,y:i,z:o}})})),n.forEach((t=>{const{id:e,source:n,target:i,data:{points:o=[],controlPoints:a=o.slice(1,o.length-1)}}=t;r.edges.push({id:e,source:n,target:i,style:Object.assign({},(null==a?void 0:a.length)?{controlPoints:a.map(Od)}:{})})})),r}function om(t,e,...n){if(e in t)return t[e](...n);if("instance"in t){const r=t.instance;if(e in r)return r[e](...n)}return null}function am(t,e){if(e in t)return t[e];if("instance"in t){const n=t.instance;if(e in n)return n[e]}return null}var sm=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(t){o(t)}}function s(t){try{l(r.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}))};var lm=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(t){o(t)}}function s(t){try{l(r.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}))};class cm extends td{constructor(t,e){super(t,Object.assign({},cm.defaultOptions,e)),this.isZoomEvent=t=>Boolean(t.data&&"scale"in t.data),this.relatedEdgeToUpdate=new Set,this.zoom=this.context.graph.getZoom(),this.fixElementSize=t=>lm(this,void 0,void 0,(function*(){if(!this.validate(t))return;const{graph:e}=this.context,{state:n,nodeFilter:r,edgeFilter:i,comboFilter:o}=this.options,a=(n?e.getElementDataByState("node",n):e.getNodeData()).filter(r),s=(n?e.getElementDataByState("edge",n):e.getEdgeData()).filter(i),l=(n?e.getElementDataByState("combo",n):e.getComboData()).filter(o),c=this.isZoomEvent(t)?this.zoom=Math.max(.01,Math.min(t.data.scale,10)):this.zoom,u=[...a,...l];u.length>0&&u.forEach((t=>this.fixNodeLike(t,c))),this.updateRelatedEdges(),s.length>0&&s.forEach((t=>this.fixEdge(t,c)))})),this.cachedStyles=new Map,this.getOriginalFieldValue=(t,e,n)=>{var r;const i=this.cachedStyles.get(t)||[],o=(null===(r=i.find((t=>t.shape===e)))||void 0===r?void 0:r.style)||{};return n in o||(o[n]=e.attributes[n],this.cachedStyles.set(t,[...i.filter((t=>t.shape!==e)),{shape:e,style:o}])),o[n]},this.scaleEntireElement=(t,e,n)=>{e.setLocalScale(1/n);const r=this.cachedStyles.get(t)||[];r.push({shape:e}),this.cachedStyles.set(t,r)},this.scaleSpecificShapes=(t,e,n)=>{const r=function(t){const e=[],n=t=>{(null==t?void 0:t.children.length)&&t.children.forEach((t=>{e.push(t),n(t)}))};return n(t),e}(t);(Array.isArray(n)?n:[n]).forEach((n=>{const{shape:i,fields:o}=n,a="function"==typeof i?i(r):t.getShape(i);a&&(o?o.forEach((n=>{const r=this.getOriginalFieldValue(t.id,a,n);ie(r)&&(a.style[n]=r/e)})):this.scaleEntireElement(t.id,a,e))}))},this.skipIfExceedViewport=t=>{const{viewport:e}=this.context;return!(null==e?void 0:e.isInViewport(t.getRenderBounds(),!1,30))},this.fixNodeLike=(t,e)=>{const n=Fh(t),{element:r,model:i}=this.context,o=r.getElement(n);if(!o||this.skipIfExceedViewport(o))return;i.getRelatedEdgesData(n).forEach((t=>this.relatedEdgeToUpdate.add(Fh(t))));const a=this.options[o.type];a?this.scaleSpecificShapes(o,e,a):this.scaleEntireElement(n,o,e)},this.fixEdge=(t,e)=>{const n=Fh(t),r=this.context.element.getElement(n);if(!r||this.skipIfExceedViewport(r))return;const i=this.options.edge;if(!i)return r.style.transformOrigin="center",void this.scaleEntireElement(n,r,e);this.scaleSpecificShapes(r,e,i)},this.updateRelatedEdges=()=>{const{element:t}=this.context;this.relatedEdgeToUpdate.size>0&&this.relatedEdgeToUpdate.forEach((e=>{const n=t.getElement(e);null==n||n.update({})})),this.relatedEdgeToUpdate.clear()},this.resetTransform=t=>lm(this,void 0,void 0,(function*(){var e;(null===(e=t.data)||void 0===e?void 0:e.firstRender)||(this.options.reset?this.restoreCachedStyles():this.fixElementSize({data:{scale:this.zoom}}))})),this.bindEvents()}restoreCachedStyles(){if(this.cachedStyles.size>0){this.cachedStyles.forEach((t=>{t.forEach((({shape:t,style:e})=>{if(Sf(e))t.setLocalScale(1);else{if(this.options.state)return;Object.entries(e).forEach((([e,n])=>t.style[e]=n))}}))}));const{graph:t,element:e}=this.context,n=Object.keys(Object.fromEntries(this.cachedStyles)).filter((e=>e&&"node"===t.getElementType(e)));if(n.length>0){const r=new Set;n.forEach((e=>{t.getRelatedEdgesData(e).forEach((t=>r.add(Fh(t))))})),r.forEach((t=>{const n=null==e?void 0:e.getElement(t);null==n||n.update({})}))}}}bindEvents(){const{graph:t}=this.context;t.on(pu.AFTER_DRAW,this.resetTransform),t.on(pu.AFTER_TRANSFORM,this.fixElementSize)}unbindEvents(){const{graph:t}=this.context;t.off(pu.AFTER_DRAW,this.resetTransform),t.off(pu.AFTER_TRANSFORM,this.fixElementSize)}validate(t){if(this.destroyed)return!1;const{enable:e}=this.options;return en(e)?e(t):!!e}destroy(){this.unbindEvents(),super.destroy()}}cm.defaultOptions={enable:t=>t.data.scale<1,nodeFilter:()=>!0,edgeFilter:()=>!0,comboFilter:()=>!0,edge:[{shape:"key",fields:["lineWidth"]},{shape:"halo",fields:["lineWidth"]},{shape:"label"}],reset:!1};var um=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(t){o(t)}}function s(t){try{l(r.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}))};class hm extends td{constructor(t,e){super(t,Object.assign({},hm.defaultOptions,e)),this.focus=t=>um(this,void 0,void 0,(function*(){if(!this.validate(t))return;const{graph:e}=this.context;yield e.focusElement(t.target.id,this.options.animation)})),this.bindEvents()}bindEvents(){const{graph:t}=this.context;this.unbindEvents(),qd.forEach((e=>{t.on(`${e}:${hu.CLICK}`,this.focus)}))}validate(t){if(this.destroyed)return!1;const{enable:e}=this.options;return en(e)?e(t):!!e}unbindEvents(){const{graph:t}=this.context;qd.forEach((e=>{t.off(`${e}:${hu.CLICK}`,this.focus)}))}destroy(){this.unbindEvents(),super.destroy()}}hm.defaultOptions={animation:{easing:"ease-in",duration:500},enable:!0};class dm extends td{constructor(t,e){super(t,Object.assign({},dm.defaultOptions,e)),this.isFrozen=!1,this.toggleFrozen=t=>{this.isFrozen="dragstart"===t.type},this.hoverElement=t=>{if(!this.validate(t))return;const e=t.type===hu.POINTER_ENTER;this.updateElementsState(t,e);const{onHover:n,onHoverEnd:r}=this.options;e?null==n||n(t):null==r||r(t)},this.updateElementsState=(t,e)=>{if(!this.options.state&&!this.options.inactiveState)return;const{graph:n}=this.context,{state:r,animation:i,inactiveState:o}=this.options,a=this.getActiveIds(t),s={};if(r&&Object.assign(s,this.getElementsState(a,r,e)),o){const t=Zh(n.getData(),!0).filter((t=>!a.includes(t)));Object.assign(s,this.getElementsState(t,o,e))}n.setElementState(s,i)},this.getElementsState=(t,e,n)=>{const{graph:r}=this.context,i={};return t.forEach((t=>{const o=r.getElementState(t);i[t]=n?o.includes(e)?o:[...o,e]:o.filter((t=>t!==e))})),i},this.bindEvents()}bindEvents(){const{graph:t}=this.context;this.unbindEvents(),qd.forEach((e=>{t.on(`${e}:${hu.POINTER_ENTER}`,this.hoverElement),t.on(`${e}:${hu.POINTER_LEAVE}`,this.hoverElement)}));const e=this.context.canvas.document;e.addEventListener(`${hu.DRAG_START}`,this.toggleFrozen),e.addEventListener(`${hu.DRAG_END}`,this.toggleFrozen)}getActiveIds(t){const{graph:e}=this.context,{degree:n,direction:r}=this.options,i=t.target.id;return n?Kd(e,t.targetType,i,"function"==typeof n?n(t):n,r):[i]}validate(t){if(this.destroyed||this.isFrozen||Bv(t.target)||this.context.graph.isCollapsingExpanding)return!1;const{enable:e}=this.options;return en(e)?e(t):!!e}unbindEvents(){const{graph:t}=this.context;qd.forEach((e=>{t.off(`${e}:${hu.POINTER_ENTER}`,this.hoverElement),t.off(`${e}:${hu.POINTER_LEAVE}`,this.hoverElement)}));const e=this.context.canvas.document;e.removeEventListener(`${hu.DRAG_START}`,this.toggleFrozen),e.removeEventListener(`${hu.DRAG_END}`,this.toggleFrozen)}destroy(){this.unbindEvents(),super.destroy()}}dm.defaultOptions={animation:!1,enable:!0,degree:0,direction:"both",state:"active",inactiveState:void 0};class fm extends td{constructor(t,e){super(t,Object.assign({},fm.defaultOptions,e)),this.hiddenShapes=[],this.isVisible=!0,this.setElementsVisibility=(t,e,n)=>{t.filter(Boolean).forEach((t=>{"hidden"!==e||t.isVisible()?"visible"===e&&this.hiddenShapes.includes(t)?this.hiddenShapes.splice(this.hiddenShapes.indexOf(t),1):Qh(t,e,n):this.hiddenShapes.push(t)}))},this.filterShapes=(t,e)=>{if(en(e))return n=>!e(t,n);const n=null==e?void 0:e[t];return t=>!t.className||!(null==n?void 0:n.includes(t.className))},this.hideShapes=t=>{if(!this.validate(t)||!this.isVisible)return;const{element:e}=this.context,{shapes:n={}}=this.options;this.setElementsVisibility(e.getNodes(),"hidden",this.filterShapes("node",n)),this.setElementsVisibility(e.getEdges(),"hidden",this.filterShapes("edge",n)),this.setElementsVisibility(e.getCombos(),"hidden",this.filterShapes("combo",n)),this.isVisible=!1},this.showShapes=Vv((t=>{if(!this.validate(t)||this.isVisible)return;const{element:e}=this.context;this.setElementsVisibility(e.getNodes(),"visible"),this.setElementsVisibility(e.getEdges(),"visible"),this.setElementsVisibility(e.getCombos(),"visible"),this.isVisible=!0}),this.options.debounce),this.bindEvents()}bindEvents(){const{graph:t}=this.context;t.on(pu.BEFORE_TRANSFORM,this.hideShapes),t.on(pu.AFTER_TRANSFORM,this.showShapes)}unbindEvents(){const{graph:t}=this.context;t.off(pu.BEFORE_TRANSFORM,this.hideShapes),t.off(pu.AFTER_TRANSFORM,this.showShapes)}validate(t){if(this.destroyed)return!1;const{enable:e}=this.options;return en(e)?e(t):!!e}update(t){this.unbindEvents(),super.update(t),this.bindEvents()}destroy(){this.unbindEvents(),super.destroy()}}fm.defaultOptions={enable:!0,debounce:200,shapes:t=>"node"===t};var pm=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(t){o(t)}}function s(t){try{l(r.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}))};class gm extends td{constructor(t,e){super(t,Object.assign({},gm.defaultOptions,e)),this.onWheel=t=>pm(this,void 0,void 0,(function*(){this.options.preventDefault&&t.preventDefault();const e=t.deltaX,n=t.deltaY;yield this.scroll([-e,-n],t)})),this.shortcut=new Wd(t.graph),this.bindEvents()}update(t){super.update(t),this.bindEvents()}bindEvents(){var t,e;const{trigger:n}=this.options;if(this.shortcut.unbindAll(),nn(n)){null===(t=this.graphDom)||void 0===t||t.removeEventListener(hu.WHEEL,this.onWheel);const{up:e=[],down:r=[],left:i=[],right:o=[]}=n;this.shortcut.bind(e,(t=>this.scroll([0,-10],t))),this.shortcut.bind(r,(t=>this.scroll([0,10],t))),this.shortcut.bind(i,(t=>this.scroll([-10,0],t))),this.shortcut.bind(o,(t=>this.scroll([10,0],t)))}else null===(e=this.graphDom)||void 0===e||e.addEventListener(hu.WHEEL,this.onWheel,{passive:!1})}get graphDom(){return this.context.graph.getCanvas().getContextService().getDomElement()}formatDisplacement(t){const{sensitivity:e}=this.options;return t=cd(t,e),t=this.clampByDirection(t),t=this.clampByRange(t)}clampByDirection([t,e]){const{direction:n}=this.options;return"x"===n?e=0:"y"===n&&(t=0),[t,e]}clampByRange([t,e]){const{viewport:n,canvas:r}=this.context,[i,o]=r.getSize(),[a,s,l,c]=Uu(this.options.range),u=[o*a,i*s,o*l,i*c],h=$u(Ju(n.getCanvasCenter()),u),d=ld(n.getViewportCenter(),[t,e,0]);if(!eh(d,h)){const{min:[n,r],max:[i,o]}=h;(d[0]<n&&t>0||d[0]>i&&t<0)&&(t=0),(d[1]<r&&e>0||d[1]>o&&e<0)&&(e=0)}return[t,e]}scroll(t,e){return pm(this,void 0,void 0,(function*(){if(!this.validate(e))return;const{onFinish:n}=this.options,r=this.context.graph,i=this.formatDisplacement(t);yield r.translateBy(i,!1),null==n||n()}))}validate(t){if(this.destroyed)return!1;const{enable:e}=this.options;return en(e)?e(t):!!e}destroy(){var t;this.shortcut.destroy(),null===(t=this.graphDom)||void 0===t||t.removeEventListener(hu.WHEEL,this.onWheel),super.destroy()}}gm.defaultOptions={enable:!0,sensitivity:1,preventDefault:!0,range:1/0};var vm=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(t){o(t)}}function s(t){try{l(r.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}))};class mm extends td{constructor(t,e){super(t,Object.assign({},mm.defaultOptions,e)),this.zoom=(t,e,n)=>vm(this,void 0,void 0,(function*(){if(!this.validate(e))return;const{graph:r}=this.context;let i=this.options.origin;!i&&"viewport"in e&&(i=Od(e.viewport));const{sensitivity:o,onFinish:a}=this.options,s=1+le(t,-50,50)*o/100,l=r.getZoom();yield r.zoomTo(l*s,n,i),null==a||a()})),this.onReset=()=>vm(this,void 0,void 0,(function*(){yield this.context.graph.zoomTo(1,this.options.animation)})),this.preventDefault=t=>{this.options.preventDefault&&t.preventDefault()},this.shortcut=new Wd(t.graph),this.bindEvents()}update(t){super.update(t),this.bindEvents()}bindEvents(){const{trigger:t}=this.options;if(this.shortcut.unbindAll(),Array.isArray(t))if(t.includes(hu.PINCH))this.shortcut.bind([hu.PINCH],(t=>{this.zoom(t.scale,t,!1)}));else{const e=this.context.canvas.getContainer();null==e||e.addEventListener(hu.WHEEL,this.preventDefault),this.shortcut.bind([...t,hu.WHEEL],(t=>{const{deltaX:e,deltaY:n}=t;this.zoom(-(null!=n?n:e),t,!1)}))}if("object"==typeof t){const{zoomIn:e=[],zoomOut:n=[],reset:r=[]}=t;this.shortcut.bind(e,(t=>this.zoom(10,t,this.options.animation))),this.shortcut.bind(n,(t=>this.zoom(-10,t,this.options.animation))),this.shortcut.bind(r,this.onReset)}}validate(t){if(this.destroyed)return!1;const{enable:e}=this.options;return en(e)?e(t):!!e}destroy(){var t;this.shortcut.destroy(),null===(t=this.context.canvas.getContainer())||void 0===t||t.removeEventListener(hu.WHEEL,this.preventDefault),super.destroy()}}mm.defaultOptions={animation:{duration:200},enable:!0,sensitivity:1,trigger:[],preventDefault:!0};var ym=n(13722);const bm=(t,e)=>{if("next"!==t&&"prev"!==t)return e},xm=t=>{t.prev.next=t.next,t.next.prev=t.prev,delete t.next,delete t.prev};class Em{constructor(){const t={};t.prev=t,t.next=t.prev,this.shortcut=t}dequeue(){const t=this.shortcut,e=t.prev;if(e&&e!==t)return xm(e),e}enqueue(t){const e=this.shortcut;t.prev&&t.next&&xm(t),t.next=e.next,e.next.prev=t,e.next=t,t.prev=e}toString(){const t=[],e=this.shortcut;let n=e.prev;for(;n!==e;)t.push(JSON.stringify(n,bm)),n=null==n?void 0:n.prev;return`[${t.join(", ")}]`}}class wm extends Em{}const km=()=>1,Mm=(t,e,n)=>{let r=[];const i=e[e.length-1],o=e[0];let a;for(;t.getAllNodes().length;){for(;a=o.dequeue();)Sm(t,e,n,a);for(;a=i.dequeue();)Sm(t,e,n,a);if(t.getAllNodes().length)for(let i=e.length-2;i>0;--i)if(a=e[i].dequeue(),a){r=r.concat(Sm(t,e,n,a,!0));break}}return r},Sm=(t,e,n,r,i)=>{var o,a;const s=[];return t.hasNode(r.v)&&(null===(o=t.getRelatedEdges(r.v,"in"))||void 0===o||o.forEach((r=>{const o=r.data.weight,a=t.getNode(r.source);i&&s.push({v:r.source,w:r.target,in:0,out:0}),void 0===a.data.out&&(a.data.out=0),a.data.out-=o,Nm(e,n,Object.assign({v:a.id},a.data))})),null===(a=t.getRelatedEdges(r.v,"out"))||void 0===a||a.forEach((r=>{const i=r.data.weight,o=r.target,a=t.getNode(o);void 0===a.data.in&&(a.data.in=0),a.data.in-=i,Nm(e,n,Object.assign({v:a.id},a.data))})),t.removeNode(r.v)),i?s:void 0},Am=(t,e)=>{const n=new tm;let r=0,i=0;t.getAllNodes().forEach((t=>{n.addNode({id:t.id,data:{v:t.id,in:0,out:0}})})),t.getAllEdges().forEach((t=>{const o=n.getRelatedEdges(t.source,"out").find((e=>e.target===t.target)),a=(null==e?void 0:e(t))||1;o?n.updateEdgeData(null==o?void 0:o.id,Object.assign(Object.assign({},o.data),{weight:o.data.weight+a})):n.addEdge({id:t.id,source:t.source,target:t.target,data:{weight:a}}),i=Math.max(i,n.getNode(t.source).data.out+=a),r=Math.max(r,n.getNode(t.target).data.in+=a)}));const o=[],a=i+r+3;for(let t=0;t<a;t++)o.push(new wm);const s=r+1;return n.getAllNodes().forEach((t=>{Nm(o,s,Object.assign({v:t.id},n.getNode(t.id).data))})),{buckets:o,zeroIdx:s,graph:n}},Nm=(t,e,n)=>{n.out?n.in?t[n.out-n.in+e].enqueue(n):t[t.length-1].enqueue(n):t[0].enqueue(n)},Cm=(t,e)=>{const n="greedy"===e?((t,e)=>{var n;if(t.getAllNodes().length<=1)return[];const r=Am(t,e||km);return null===(n=Mm(r.graph,r.buckets,r.zeroIdx).map((e=>t.getRelatedEdges(e.v,"out").filter((({target:t})=>t===e.w)))))||void 0===n?void 0:n.flat()})(t,(t=>t.data.weight||1)):Om(t);null==n||n.forEach((e=>{const n=e.data;t.removeEdge(e.id),n.forwardName=e.data.name,n.reversed=!0,t.addEdge({id:e.id,source:e.target,target:e.source,data:Object.assign({},n)})}))},Om=t=>{const e=[],n={},r={},i=o=>{r[o]||(r[o]=!0,n[o]=!0,t.getRelatedEdges(o,"out").forEach((t=>{n[t.target]?e.push(t):i(t.target)})),delete n[o])};return t.getAllNodes().forEach((t=>i(t.id))),e},Tm=(t,e,n,r)=>{let i;do{i=`${r}${Math.random()}`}while(t.hasNode(i));return n.dummy=e,t.addNode({id:i,data:n}),i},Pm=t=>{const e=new tm;return t.getAllNodes().forEach((n=>{t.getChildren(n.id).length||e.addNode(Object.assign({},n))})),t.getAllEdges().forEach((t=>{e.addEdge(t)})),e},Rm=(t,e)=>null==t?void 0:t.reduce(((t,n,r)=>(t[n]=e[r],t)),{}),Dm=(t,e)=>{const n=Number(t.x),r=Number(t.y),i=Number(e.x)-n,o=Number(e.y)-r;let a,s,l=Number(t.width)/2,c=Number(t.height)/2;return i||o?(Math.abs(o)*l>Math.abs(i)*c?(o<0&&(c=-c),a=c*i/o,s=c):(i<0&&(l=-l),a=l,s=l*o/i),{x:n+a,y:r+s}):{x:0,y:0}},Lm=t=>{const e=[],n=Bm(t)+1;for(let t=0;t<n;t++)e.push([]);t.getAllNodes().forEach((t=>{const n=t.data.rank;void 0!==n&&e[n]&&e[n].push(t.id)}));for(let r=0;r<n;r++)e[r]=e[r].sort(((e,n)=>{return r=t.getNode(e).data.order,i=t.getNode(n).data.order,Number(r)-Number(i);var r,i}));return e},Im=(t,e,n,r)=>{const i={width:0,height:0};return ie(n)&&ie(r)&&(i.rank=n,i.order=r),Tm(t,"border",i,e)},Bm=t=>{let e;return t.getAllNodes().forEach((t=>{const n=t.data.rank;void 0!==n&&(void 0===e||n>e)&&(e=n)})),e||(e=0),e},jm=(t,e)=>t.reduce(((t,n)=>e(t)>e(n)?n:t)),zm=(t,e,n,r,i,o)=>{r.includes(e.id)||(r.push(e.id),n||o.push(e.id),i(e.id).forEach((e=>zm(t,e,n,r,i,o))),n&&o.push(e.id))},Fm=(t,e,n,r)=>{const i=Array.isArray(e)?e:[e],o=e=>r?t.getSuccessors(e):t.getNeighbors(e),a=[],s=[];return i.forEach((e=>{if(!t.hasNode(e.id))throw new Error(`Graph does not have node: ${e}`);zm(t,e,"post"===n,s,o,a)})),a},_m=(t,e,n,r,i,o)=>{const a={rank:o,borderType:e,width:0,height:0},s=i.data[e][o-1],l=Tm(t,"border",a,n);i.data[e][o]=l,t.setParent(l,r),s&&t.addEdge({id:`e${Math.random()}`,source:s,target:l,data:{weight:1}})},Zm=t=>{t.getAllNodes().forEach((t=>{Gm(t)})),t.getAllEdges().forEach((t=>{Gm(t)}))},Gm=t=>{const e=t.data.width;t.data.width=t.data.height,t.data.height=e},Vm=t=>{t.getAllNodes().forEach((t=>{Wm(t.data)})),t.getAllEdges().forEach((t=>{var e;null===(e=t.data.points)||void 0===e||e.forEach((t=>Wm(t))),t.data.hasOwnProperty("y")&&Wm(t.data)}))},Wm=t=>{(null==t?void 0:t.y)&&(t.y=-t.y)},Hm=t=>{t.getAllNodes().forEach((t=>{Um(t.data)})),t.getAllEdges().forEach((t=>{var e;null===(e=t.data.points)||void 0===e||e.forEach((t=>Um(t))),t.data.hasOwnProperty("x")&&Um(t.data)}))},Um=t=>{const e=t.x;t.x=t.y,t.y=e},Ym=(t,e,n,r,i,o,a)=>{const s=t.getChildren(a);if(!(null==s?void 0:s.length))return void(a!==e&&t.addEdge({id:`e${Math.random()}`,source:e,target:a,data:{weight:0,minlen:n}}));const l=Im(t,"_bt"),c=Im(t,"_bb"),u=t.getNode(a);t.setParent(l,a),u.data.borderTop=l,t.setParent(c,a),u.data.borderBottom=c,null==s||s.forEach((s=>{Ym(t,e,n,r,i,o,s.id);const u=s.data.borderTop?s.data.borderTop:s.id,h=s.data.borderBottom?s.data.borderBottom:s.id,d=s.data.borderTop?r:2*r,f=u!==h?1:i-o[a]+1;t.addEdge({id:`e${Math.random()}`,source:l,target:u,data:{minlen:f,weight:d,nestingEdge:!0}}),t.addEdge({id:`e${Math.random()}`,source:h,target:c,data:{minlen:f,weight:d,nestingEdge:!0}})})),t.getParent(a)||t.addEdge({id:`e${Math.random()}`,source:e,target:l,data:{weight:0,minlen:i+o[a]}})},qm=t=>{const e={},n=(r,i)=>{const o=t.getChildren(r);null==o||o.forEach((t=>n(t.id,i+1))),e[r]=i};return t.getRoots().forEach((t=>n(t.id,1))),e},Xm=t=>{let e=0;return t.getAllEdges().forEach((t=>{e+=t.data.weight})),e},Km="edge-label",Qm=(t,e,n)=>{let r=e.source,i=t.getNode(r).data.rank;const o=e.target,a=t.getNode(o).data.rank,s=e.data.labelRank;if(a===i+1)return;let l,c,u;for(t.removeEdge(e.id),u=0,++i;i<a;++u,++i)e.data.points=[],c={originalEdge:e,width:0,height:0,rank:i},l=Tm(t,"edge",c,"_d"),i===s&&(c.width=e.data.width,c.height=e.data.height,c.dummy=Km,c.labelpos=e.data.labelpos),t.addEdge({id:`e${Math.random()}`,source:r,target:l,data:{weight:e.data.weight}}),0===u&&n.push(l),r=l;t.addEdge({id:`e${Math.random()}`,source:r,target:o,data:{weight:e.data.weight}})},Jm=t=>{let e;for(;t.hasNode(e=`_root${Math.random()}`););return e},$m=(t,e,n)=>{const r=Rm(n,n.map(((t,e)=>e))),i=e.map((e=>{const n=t.getRelatedEdges(e,"out").map((t=>({pos:r[t.target]||0,weight:t.data.weight})));return null==n?void 0:n.sort(((t,e)=>t.pos-e.pos))})),o=i.flat().filter((t=>void 0!==t));let a=1;for(;a<n.length;)a<<=1;const s=2*a-1;a-=1;const l=Array(s).fill(0,0,s);let c=0;return null==o||o.forEach((t=>{if(t){let e=t.pos+a;l[e]+=t.weight;let n=0;for(;e>0;)e%2&&(n+=l[e+1]),e=e-1>>1,l[e]+=t.weight;c+=t.weight*n}})),c},ty=(t,e)=>{let n=0;for(let r=1;r<(null==e?void 0:e.length);r+=1)n+=$m(t,e[r-1],e[r]);return n},ey=t=>{const e={},n=t.getAllNodes(),r=n.map((t=>{var e;return null!==(e=t.data.rank)&&void 0!==e?e:-1/0})),i=Math.max(...r),o=[];for(let t=0;t<i+1;t++)o.push([]);const a=n.sort(((e,n)=>t.getNode(e.id).data.rank-t.getNode(n.id).data.rank)),s=a.filter((e=>void 0!==t.getNode(e.id).data.fixorder)).sort(((e,n)=>t.getNode(e.id).data.fixorder-t.getNode(n.id).data.fixorder));return null==s||s.forEach((n=>{isNaN(t.getNode(n.id).data.rank)||o[t.getNode(n.id).data.rank].push(n.id),e[n.id]=!0})),null==a||a.forEach((n=>t.dfsTree(n.id,(t=>{if(e.hasOwnProperty(t.id))return!0;e[t.id]=!0,isNaN(t.data.rank)||o[t.data.rank].push(t.id)})))),o},ny=t=>{var e,n;const r=[];for(;null==t?void 0:t.length;){const i=t.pop();r.push(i),null===(e=i.in.reverse())||void 0===e||e.forEach((t=>{return(e=i,t=>{t.merged||(void 0===t.barycenter||void 0===e.barycenter||t.barycenter>=e.barycenter)&&ry(e,t)})(t);var e})),null===(n=i.out)||void 0===n||n.forEach((e=>{return(n=i,e=>{e.in.push(n),0==--e.indegree&&t.push(e)})(e);var n}))}const i=r.filter((t=>!t.merged)),o=["vs","i","barycenter","weight"];return i.map((t=>{const e={};return null==o||o.forEach((n=>{void 0!==t[n]&&(e[n]=t[n])})),e}))},ry=(t,e)=>{var n;let r=0,i=0;t.weight&&(r+=t.barycenter*t.weight,i+=t.weight),e.weight&&(r+=e.barycenter*e.weight,i+=e.weight),t.vs=null===(n=e.vs)||void 0===n?void 0:n.concat(t.vs),t.barycenter=r/i,t.weight=i,t.i=Math.min(e.i,t.i),e.merged=!0};var iy=(t,e)=>{var n,r,i;const o={};null==t||t.forEach(((t,e)=>{o[t.v]={i:e,indegree:0,in:[],out:[],vs:[t.v]};const n=o[t.v];void 0!==t.barycenter&&(n.barycenter=t.barycenter,n.weight=t.weight)})),null===(n=e.getAllEdges())||void 0===n||n.forEach((t=>{const e=o[t.source],n=o[t.target];void 0!==e&&void 0!==n&&(n.indegree++,e.out.push(o[t.target]))}));const a=null===(i=(r=Object.values(o)).filter)||void 0===i?void 0:i.call(r,(t=>!t.indegree));return ny(a)};const oy=(t,e,n)=>{let r,i=n;for(;e.length&&(r=e[e.length-1]).i<=i;)e.pop(),null==t||t.push(r.vs),i++;return i},ay=(t,e)=>(n,r)=>{if(void 0!==n.fixorder&&void 0!==r.fixorder)return n.fixorder-r.fixorder;if(n.barycenter<r.barycenter)return-1;if(n.barycenter>r.barycenter)return 1;if(e&&void 0!==n.order&&void 0!==r.order){if(n.order<r.order)return-1;if(n.order>r.order)return 1}return t?r.i-n.i:n.i-r.i},sy=(t,e,n,r,i,o)=>{var a,s,l,c;let u=t.getChildren(e).map((t=>t.id));const h=t.getNode(e),d=h?h.data.borderLeft:void 0,f=h?h.data.borderRight:void 0,p={};d&&(u=null==u?void 0:u.filter((t=>t!==d&&t!==f)));const g=((t,e)=>e.map((e=>{const n=t.getRelatedEdges(e,"in");if(!(null==n?void 0:n.length))return{v:e};const r={sum:0,weight:0};return null==n||n.forEach((e=>{const n=t.getNode(e.source);r.sum+=e.data.weight*n.data.order,r.weight+=e.data.weight})),{v:e,barycenter:r.sum/r.weight,weight:r.weight}})))(t,u||[]);null==g||g.forEach((e=>{var i;if(null===(i=t.getChildren(e.v))||void 0===i?void 0:i.length){const i=sy(t,e.v,n,r,o);p[e.v]=i,i.hasOwnProperty("barycenter")&&cy(e,i)}}));const v=iy(g,n);ly(v,p),null===(a=v.filter((t=>t.vs.length>0)))||void 0===a||a.forEach((e=>{const n=t.getNode(e.vs[0]);n&&(e.fixorder=n.data.fixorder,e.order=n.data.order)}));const m=((t,e,n,r)=>{const i=((t,e)=>{const n={lhs:[],rhs:[]};return null==t||t.forEach((t=>{e(t)?n.lhs.push(t):n.rhs.push(t)})),n})(t,(t=>{const e=t.hasOwnProperty("fixorder")&&!isNaN(t.fixorder);return r?!e&&t.hasOwnProperty("barycenter"):e||t.hasOwnProperty("barycenter")})),o=i.lhs,a=i.rhs.sort(((t,e)=>-t.i- -e.i)),s=[];let l=0,c=0,u=0;null==o||o.sort(ay(!!e,!!n)),u=oy(s,a,u),null==o||o.forEach((t=>{var e;u+=null===(e=t.vs)||void 0===e?void 0:e.length,s.push(t.vs),l+=t.barycenter*t.weight,c+=t.weight,u=oy(s,a,u)}));const h={vs:s.flat()};return c&&(h.barycenter=l/c,h.weight=c),h})(v,r,i,o);if(d&&(m.vs=[d,m.vs,f].flat(),null===(s=t.getPredecessors(d))||void 0===s?void 0:s.length)){const e=t.getNode((null===(l=t.getPredecessors(d))||void 0===l?void 0:l[0].id)||""),n=t.getNode((null===(c=t.getPredecessors(f))||void 0===c?void 0:c[0].id)||"");m.hasOwnProperty("barycenter")||(m.barycenter=0,m.weight=0),m.barycenter=(m.barycenter*m.weight+e.data.order+n.data.order)/(m.weight+2),m.weight+=2}return m},ly=(t,e)=>{null==t||t.forEach((t=>{var n;const r=null===(n=t.vs)||void 0===n?void 0:n.map((t=>e[t]?e[t].vs:t));t.vs=r.flat()}))},cy=(t,e)=>{void 0!==t.barycenter?(t.barycenter=(t.barycenter*t.weight+e.barycenter*e.weight)/(t.weight+e.weight),t.weight+=e.weight):(t.barycenter=e.barycenter,t.weight=e.weight)},uy=(t,e,n)=>e.map((e=>((t,e,n)=>{const r=Jm(t),i=new tm({tree:[{id:r,children:[],data:{}}]});return t.getAllNodes().forEach((o=>{const a=t.getParent(o.id);(o.data.rank===e||o.data.minRank<=e&&e<=o.data.maxRank)&&(i.hasNode(o.id)||i.addNode(Object.assign({},o)),(null==a?void 0:a.id)&&!i.hasNode(null==a?void 0:a.id)&&i.addNode(Object.assign({},a)),i.setParent(o.id,(null==a?void 0:a.id)||r),t.getRelatedEdges(o.id,n).forEach((e=>{const n=e.source===o.id?e.target:e.source;i.hasNode(n)||i.addNode(Object.assign({},t.getNode(n)));const r=i.getRelatedEdges(n,"out").find((({target:t})=>t===o.id)),a=void 0!==r?r.data.weight:0;r?i.updateEdgeData(r.id,Object.assign(Object.assign({},r.data),{weight:e.data.weight+a})):i.addEdge({id:e.id,source:n,target:o.id,data:{weight:e.data.weight+a}})})),o.data.hasOwnProperty("minRank")&&i.updateNodeData(o.id,Object.assign(Object.assign({},o.data),{borderLeft:o.data.borderLeft[e],borderRight:o.data.borderRight[e]})))})),i})(t,e,n))),hy=(t,e,n,r)=>{const i=new tm;null==t||t.forEach((t=>{var o;const a=t.getRoots()[0].id,s=sy(t,a,i,e,n,r);for(let e=0;e<(null===(o=s.vs)||void 0===o?void 0:o.length);e++){const n=t.getNode(s.vs[e]);n&&(n.data.order=e)}((t,e,n)=>{const r={};let i;null==n||n.forEach((n=>{let o,a,s=t.getParent(n);for(;s;){if(o=t.getParent(s.id),o?(a=r[o.id],r[o.id]=s.id):(a=i,i=s.id),a&&a!==s.id)return e.hasNode(a)||e.addNode({id:a,data:{}}),e.hasNode(s.id)||e.addNode({id:s.id,data:{}}),void(e.hasEdge(`e${a}-${s.id}`)||e.addEdge({id:`e${a}-${s.id}`,source:a,target:s.id,data:{}}));s=o}}))})(t,i,s.vs)}))},dy=(t,e)=>{null==e||e.forEach((e=>{null==e||e.forEach(((e,n)=>{t.getNode(e).data.order=n}))}))},fy=(t,e)=>{const n=(t=>{const e={};let n=0;const r=i=>{const o=n;t.getChildren(i).forEach((t=>r(t.id))),e[i]={low:o,lim:n++}};return t.getRoots().forEach((t=>r(t.id))),e})(t);e.forEach((e=>{var r,i;let o=e,a=t.getNode(o);const s=a.data.originalEdge;if(!s)return;const l=((t,e,n,r)=>{var i,o;const a=[],s=[],l=Math.min(e[n].low,e[r].low),c=Math.max(e[n].lim,e[r].lim);let u,h;u=n;do{u=null===(i=t.getParent(u))||void 0===i?void 0:i.id,a.push(u)}while(u&&(e[u].low>l||c>e[u].lim));for(h=u,u=r;u&&u!==h;)s.push(u),u=null===(o=t.getParent(u))||void 0===o?void 0:o.id;return{lca:h,path:a.concat(s.reverse())}})(t,n,s.source,s.target),c=l.path,u=l.lca;let h=0,d=c[h],f=!0;for(;o!==s.target;){if(a=t.getNode(o),f){for(;d!==u&&(null===(r=t.getNode(d))||void 0===r?void 0:r.data.maxRank)<a.data.rank;)h++,d=c[h];d===u&&(f=!1)}if(!f){for(;h<c.length-1&&(null===(i=t.getNode(c[h+1]))||void 0===i?void 0:i.data.minRank)<=a.data.rank;)h++;d=c[h]}t.hasNode(d)&&t.setParent(o,d),o=t.getSuccessors(o)[0].id}}))},py=(t,e)=>{const n={},r=(e,r)=>{let i=0,o=0;const a=e.length,s=null==r?void 0:r[(null==r?void 0:r.length)-1];return null==r||r.forEach(((e,l)=>{var c;const u=vy(t,e),h=u?t.getNode(u.id).data.order:a;(u||e===s)&&(null===(c=r.slice(o,l+1))||void 0===c||c.forEach((e=>{var r;null===(r=t.getPredecessors(e))||void 0===r||r.forEach((r=>{var o;const a=t.getNode(r.id),s=a.data.order;!(s<i||h<s)||a.data.dummy&&(null===(o=t.getNode(e))||void 0===o?void 0:o.data.dummy)||my(n,r.id,e)}))})),o=l+1,i=h)})),r};return(null==e?void 0:e.length)&&e.reduce(r),n},gy=(t,e)=>{const n={};function r(e,r){const i=function(t){return JSON.stringify(t.slice(1))}(e);r.get(i)||(!function(e,r,i,o,a){var s,l;let c;for(let u=r;u<i;u++)c=e[u],(null===(s=t.getNode(c))||void 0===s?void 0:s.data.dummy)&&(null===(l=t.getPredecessors(c))||void 0===l||l.forEach((e=>{const r=t.getNode(e.id);r.data.dummy&&(r.data.order<o||r.data.order>a)&&my(n,e.id,c)})))}(...e),r.set(i,!0))}const i=(e,n)=>{let i,o=-1,a=0;const s=new Map;return null==n||n.forEach(((l,c)=>{var u;if("border"===(null===(u=t.getNode(l))||void 0===u?void 0:u.data.dummy)){const e=t.getPredecessors(l)||[];e.length&&(i=t.getNode(e[0].id).data.order,r([n,a,c,o,i],s),a=c,o=i)}r([n,a,n.length,i,e.length],s)})),n};return(null==e?void 0:e.length)&&e.reduce(i),n},vy=(t,e)=>{var n,r;if(null===(n=t.getNode(e))||void 0===n?void 0:n.data.dummy)return null===(r=t.getPredecessors(e))||void 0===r?void 0:r.find((e=>t.getNode(e.id).data.dummy))},my=(t,e,n)=>{let r=e,i=n;if(r>i){const t=r;r=i,i=t}let o=t[r];o||(t[r]=o={}),o[i]=!0},yy=(t,e,n)=>{let r=e,i=n;if(r>n){r=n,i=e}return!!t[r]},by=(t,e,n,r)=>{const i={},o={},a={};return null==e||e.forEach((t=>{null==t||t.forEach(((t,e)=>{i[t]=t,o[t]=t,a[t]=e}))})),null==e||e.forEach((t=>{let e=-1;null==t||t.forEach((t=>{let s=r(t).map((t=>t.id));if(s.length){s=s.sort(((t,e)=>a[t]-a[e]));const r=(s.length-1)/2;for(let l=Math.floor(r),c=Math.ceil(r);l<=c;++l){const r=s[l];o[t]===t&&e<a[r]&&!yy(n,t,r)&&(o[r]=t,o[t]=i[t]=i[r],e=a[r])}}}))})),{root:i,align:o}},xy=(t,e,n,r,i,o,a)=>{var s;const l={},c=Ey(t,e,n,i,o,a),u=a?"borderLeft":"borderRight",h=(t,e)=>{let n=c.getAllNodes(),r=n.pop();const i={};for(;r;)i[r.id]?t(r.id):(i[r.id]=!0,n.push(r),n=n.concat(e(r.id))),r=n.pop()};return h((t=>{l[t]=(c.getRelatedEdges(t,"in")||[]).reduce(((t,e)=>Math.max(t,(l[e.source]||0)+e.data.weight)),0)}),c.getPredecessors.bind(c)),h((e=>{const n=(c.getRelatedEdges(e,"out")||[]).reduce(((t,e)=>Math.min(t,(l[e.target]||0)-e.data.weight)),Number.POSITIVE_INFINITY),r=t.getNode(e);n!==Number.POSITIVE_INFINITY&&r.data.borderType!==u&&(l[e]=Math.max(l[e],n))}),c.getSuccessors.bind(c)),null===(s=Object.values(r))||void 0===s||s.forEach((t=>{l[t]=l[n[t]]})),l},Ey=(t,e,n,r,i,o)=>{const a=new tm,s=Sy(r,i,o);return null==e||e.forEach((e=>{let r;null==e||e.forEach((e=>{const i=n[e];if(a.hasNode(i)||a.addNode({id:i,data:{}}),r){const o=n[r],l=a.getRelatedEdges(o,"out").find((t=>t.target===i));l?a.updateEdgeData(l.id,Object.assign(Object.assign({},l.data),{weight:Math.max(s(t,e,r),l.data.weight||0)})):a.addEdge({id:`e${Math.random()}`,source:o,target:i,data:{weight:Math.max(s(t,e,r),0)}})}r=e}))})),a},wy=(t,e)=>jm(Object.values(e),(e=>{var n;let r=Number.NEGATIVE_INFINITY,i=Number.POSITIVE_INFINITY;return null===(n=Object.keys(e))||void 0===n||n.forEach((n=>{const o=e[n],a=Ay(t,n)/2;r=Math.max(o+a,r),i=Math.min(o-a,i)})),r-i}));function ky(t,e){const n=Object.values(e),r=Math.min(...n),i=Math.max(...n);["u","d"].forEach((n=>{["l","r"].forEach((o=>{const a=n+o,s=t[a];let l;if(s===e)return;const c=Object.values(s);l="l"===o?r-Math.min(...c):i-Math.max(...c),l&&(t[a]={},Object.keys(s).forEach((e=>{t[a][e]=s[e]+l})))}))}))}const My=(t,e)=>{const n={};return Object.keys(t.ul).forEach((r=>{if(e)n[r]=t[e.toLowerCase()][r];else{const e=Object.values(t).map((t=>t[r]));n[r]=(e[0]+e[1])/2}})),n},Sy=(t,e,n)=>(r,i,o)=>{const a=r.getNode(i),s=r.getNode(o);let l=0,c=0;if(l+=a.data.width/2,a.data.hasOwnProperty("labelpos"))switch((a.data.labelpos||"").toLowerCase()){case"l":c=-a.data.width/2;break;case"r":c=a.data.width/2}if(c&&(l+=n?c:-c),c=0,l+=(a.data.dummy?e:t)/2,l+=(s.data.dummy?e:t)/2,l+=s.data.width/2,s.data.labelpos)switch((s.data.labelpos||"").toLowerCase()){case"l":c=s.data.width/2;break;case"r":c=-s.data.width/2}return c&&(l+=n?c:-c),c=0,l},Ay=(t,e)=>t.getNode(e).data.width||0,Ny=(t,e)=>{var n;const r=Pm(t);((t,e)=>{const{ranksep:n=0}=e||{},r=Lm(t);let i=0;null==r||r.forEach((e=>{const r=e.map((e=>t.getNode(e).data.height)),o=Math.max(...r,0);null==e||e.forEach((e=>{t.getNode(e).data.y=i+o/2})),i+=o+n}))})(r,e);const i=((t,e)=>{const{align:n,nodesep:r=0,edgesep:i=0}=e||{},o=Lm(t),a=Object.assign(py(t,o),gy(t,o)),s={};let l=[];["u","d"].forEach((e=>{l="u"===e?o:Object.values(o).reverse(),["l","r"].forEach((n=>{"r"===n&&(l=l.map((t=>Object.values(t).reverse())));const o=("u"===e?t.getPredecessors:t.getSuccessors).bind(t),c=by(0,l,a,o),u=xy(t,l,c.root,c.align,r,i,"r"===n);"r"===n&&Object.keys(u).forEach((t=>u[t]=-u[t])),s[e+n]=u}))}));const c=wy(t,s);return c&&ky(s,c),My(s,n)})(r,e);null===(n=Object.keys(i))||void 0===n||n.forEach((t=>{r.getNode(t).data.x=i[t]}))},Cy=t=>{const e={},n=r=>{var i;const o=t.getNode(r);if(!o)return 0;if(e[r])return o.data.rank;let a;return e[r]=!0,null===(i=t.getRelatedEdges(r,"out"))||void 0===i||i.forEach((t=>{const e=n(t.target)-t.data.minlen;e&&(void 0===a||e<a)&&(a=e)})),a||(a=0),o.data.rank=a,a};t.getAllNodes().filter((e=>0===t.getRelatedEdges(e.id,"in").length)).forEach((t=>n(t.id)))},Oy=(t,e)=>t.getNode(e.target).data.rank-t.getNode(e.source).data.rank-e.data.minlen,Ty=(t,e)=>{const n=r=>{e.getRelatedEdges(r,"both").forEach((i=>{const o=i.source,a=r===o?i.target:o;t.hasNode(a)||Oy(e,i)||(t.addNode({id:a,data:{}}),t.addEdge({id:i.id,source:r,target:a,data:{}}),n(a))}))};return t.getAllNodes().forEach((t=>n(t.id))),t.getAllNodes().length},Py=(t,e)=>{const n=r=>{var i;null===(i=e.getRelatedEdges(r,"both"))||void 0===i||i.forEach((i=>{const o=i.source,a=r===o?i.target:o;t.hasNode(a)||void 0===e.getNode(a).data.layer&&Oy(e,i)||(t.addNode({id:a,data:{}}),t.addEdge({id:i.id,source:r,target:a,data:{}}),n(a))}))};return t.getAllNodes().forEach((t=>n(t.id))),t.getAllNodes().length},Ry=(t,e)=>jm(e.getAllEdges(),(n=>t.hasNode(n.source)!==t.hasNode(n.target)?Oy(e,n):1/0)),Dy=(t,e,n)=>{t.getAllNodes().forEach((t=>{const r=e.getNode(t.id);r.data.rank||(r.data.rank=0),r.data.rank+=n}))},Ly=t=>{const e=(t=>{const e=new tm;return t.getAllNodes().forEach((t=>{e.addNode(Object.assign({},t))})),t.getAllEdges().forEach((t=>{const n=e.getRelatedEdges(t.source,"out").find((e=>e.target===t.target));n?e.updateEdgeData(null==n?void 0:n.id,Object.assign(Object.assign({},n.data),{weight:n.data.weight+t.data.weight||0,minlen:Math.max(n.data.minlen,t.data.minlen||1)})):e.addEdge({id:t.id,source:t.source,target:t.target,data:{weight:t.data.weight||0,minlen:t.data.minlen||1}})})),e})(t);Cy(e);const n=(t=>{const e=new tm({tree:[]}),n=t.getAllNodes()[0],r=t.getAllNodes().length;let i,o;for(e.addNode(n);Ty(e,t)<r;)i=Ry(e,t),o=e.hasNode(i.source)?Oy(t,i):-Oy(t,i),Dy(e,t,o);return e})(e);let r,i;for(zy(n),Iy(n,e);r=_y(n);)i=Zy(n,e,r),Gy(n,e,r,i)},Iy=(t,e)=>{let n=Fm(t,t.getAllNodes(),"post",!1);n=n.slice(0,(null==n?void 0:n.length)-1),n.forEach((n=>{By(t,e,n)}))},By=(t,e,n)=>{const r=t.getNode(n).data.parent;t.getRelatedEdges(n,"both").find((t=>t.target===r||t.source===r)).data.cutvalue=jy(t,e,n)},jy=(t,e,n)=>{const r=t.getNode(n).data.parent;let i=!0,o=e.getRelatedEdges(n,"out").find((t=>t.target===r)),a=0;return o||(i=!1,o=e.getRelatedEdges(r,"out").find((t=>t.target===n))),a=o.data.weight,e.getRelatedEdges(n,"both").forEach((e=>{const o=e.source===n,s=o?e.target:e.source;if(s!==r){const r=o===i,l=e.data.weight;if(a+=r?l:-l,Wy(t,n,s)){const e=t.getRelatedEdges(n,"both").find((t=>t.source===s||t.target===s)).data.cutvalue;a+=r?-e:e}}})),a},zy=(t,e=t.getAllNodes()[0].id)=>{Fy(t,{},1,e)},Fy=(t,e,n,r,i)=>{var o;const a=n;let s=n;const l=t.getNode(r);return e[r]=!0,null===(o=t.getNeighbors(r))||void 0===o||o.forEach((n=>{e[n.id]||(s=Fy(t,e,s,n.id,r))})),l.data.low=a,l.data.lim=s++,i?l.data.parent=i:delete l.data.parent,s},_y=t=>t.getAllEdges().find((t=>t.data.cutvalue<0)),Zy=(t,e,n)=>{let r=n.source,i=n.target;e.getRelatedEdges(r,"out").find((t=>t.target===i))||(r=n.target,i=n.source);const o=t.getNode(r),a=t.getNode(i);let s=o,l=!1;o.data.lim>a.data.lim&&(s=a,l=!0);const c=e.getAllEdges().filter((e=>l===Hy(t.getNode(e.source),s)&&l!==Hy(t.getNode(e.target),s)));return jm(c,(t=>Oy(e,t)))},Gy=(t,e,n,r)=>{const i=t.getRelatedEdges(n.source,"both").find((t=>t.source===n.target||t.target===n.target));i&&t.removeEdge(i.id),t.addEdge({id:`e${Math.random()}`,source:r.source,target:r.target,data:{}}),zy(t),Iy(t,e),Vy(t,e)},Vy=(t,e)=>{const n=t.getAllNodes().find((t=>!t.data.parent));let r=Fm(t,n,"pre",!1);r=r.slice(1),r.forEach((n=>{const r=t.getNode(n).data.parent;let i=e.getRelatedEdges(n,"out").find((t=>t.target===r)),o=!1;!i&&e.hasNode(r)&&(i=e.getRelatedEdges(r,"out").find((t=>t.target===n)),o=!0),e.getNode(n).data.rank=(e.hasNode(r)&&e.getNode(r).data.rank||0)+(o?null==i?void 0:i.data.minlen:-(null==i?void 0:i.data.minlen))}))},Wy=(t,e,n)=>t.getRelatedEdges(e,"both").find((t=>t.source===n||t.target===n)),Hy=(t,e)=>e.data.low<=t.data.lim&&t.data.lim<=e.data.lim,Uy=Cy,Yy=t=>{(t=>{const e={};let n;const r=i=>{var o;const a=t.getNode(i);if(!a)return 0;if(e[i])return a.data.rank;let s;return e[i]=!0,null===(o=t.getRelatedEdges(i,"out"))||void 0===o||o.forEach((t=>{const e=r(t.target)-t.data.minlen;e&&(void 0===s||e<s)&&(s=e)})),s||(s=0),(void 0===n||s<n)&&(n=s),a.data.rank=s,s};t.getAllNodes().filter((e=>0===t.getRelatedEdges(e.id,"in").length)).forEach((t=>{t&&r(t.id)})),void 0===n&&(n=0);const i={},o=(e,n)=>{var r;const a=t.getNode(e),s=isNaN(a.data.layer)?n:a.data.layer;(void 0===a.data.rank||a.data.rank<s)&&(a.data.rank=s),i[e]||(i[e]=!0,null===(r=t.getRelatedEdges(e,"out"))||void 0===r||r.forEach((t=>{o(t.target,s+t.data.minlen)})))};t.getAllNodes().forEach((t=>{const e=t.data;e&&(isNaN(e.layer)?e.rank-=n:o(t.id,e.layer))}))})(t),(t=>{const e=new tm({tree:[]}),n=t.getAllNodes()[0],r=t.getAllNodes().length;let i,o;for(e.addNode(n);Py(e,t)<r;)i=Ry(e,t),o=e.hasNode(i.source)?Oy(t,i):-Oy(t,i),Dy(e,t,o)})(t)},qy=t=>{Ly(t)},Xy=(t,e)=>{const{acyclicer:n,ranker:r,rankdir:i="tb",nodeOrder:o,keepNodeOrder:a,align:s,nodesep:l=50,edgesep:c=20,ranksep:u=50}=e;fb(t),Cm(t,n);const{nestingRoot:h,nodeRankFactor:d}=(t=>{const e=Tm(t,"root",{},"_root"),n=qm(t);let r=Math.max(...Object.values(n));Math.abs(r)===1/0&&(r=1);const i=r-1,o=2*i+1;t.getAllEdges().forEach((t=>{t.data.minlen*=o}));const a=Xm(t)+1;return t.getRoots().forEach((r=>{Ym(t,e,o,a,i,n,r.id)})),{nestingRoot:e,nodeRankFactor:o}})(t);((t,e)=>{switch(e){case"network-simplex":qy(t);break;case"tight-tree":default:Yy(t);break;case"longest-path":Uy(t)}})(Pm(t),r),ob(t),((t,e=0)=>{const n=t.getAllNodes(),r=n.filter((t=>void 0!==t.data.rank)).map((t=>t.data.rank)),i=Math.min(...r),o=[];n.forEach((t=>{const e=(t.data.rank||0)-i;o[e]||(o[e]=[]),o[e].push(t.id)}));let a=0;for(let n=0;n<o.length;n++){const r=o[n];void 0===r?n%e!=0&&(a-=1):a&&(null==r||r.forEach((e=>{const n=t.getNode(e);n&&(n.data.rank=n.data.rank||0,n.data.rank+=a)})))}})(t,d),((t,e)=>{e&&t.removeNode(e),t.getAllEdges().forEach((e=>{e.data.nestingEdge&&t.removeEdge(e.id)}))})(t,h),(t=>{const e=t.getAllNodes().filter((t=>void 0!==t.data.rank)).map((t=>t.data.rank)),n=Math.min(...e);t.getAllNodes().forEach((t=>{t.data.hasOwnProperty("rank")&&n!==1/0&&(t.data.rank-=n)}))})(t),ab(t),sb(t);const f=[];((t,e)=>{t.getAllEdges().forEach((n=>Qm(t,n,e)))})(t,f),fy(t,f),(t=>{const e=n=>{const r=t.getChildren(n),i=t.getNode(n);if((null==r?void 0:r.length)&&r.forEach((t=>e(t.id))),i.data.hasOwnProperty("minRank")){i.data.borderLeft=[],i.data.borderRight=[];for(let e=i.data.minRank,r=i.data.maxRank+1;e<r;e+=1)_m(t,"borderLeft","_bl",n,i,e),_m(t,"borderRight","_br",n,i,e)}};t.getRoots().forEach((t=>e(t.id)))})(t),a&&((t,e)=>{const n=t.getAllNodes().filter((e=>{var n;return!(null===(n=t.getChildren(e.id))||void 0===n?void 0:n.length)})),r=n.map((t=>t.data.rank)),i=Math.max(...r),o=[];for(let t=0;t<i+1;t++)o[t]=[];null==e||e.forEach((e=>{const n=t.getNode(e);n&&!n.data.dummy&&(isNaN(n.data.rank)||(n.data.fixorder=o[n.data.rank].length,o[n.data.rank].push(e)))}))})(t,o),((t,e)=>{const n=Bm(t),r=[],i=[];for(let t=1;t<n+1;t++)r.push(t);for(let t=n-1;t>-1;t--)i.push(t);const o=uy(t,r,"in"),a=uy(t,i,"out");let s=ey(t);dy(t,s);let l,c=Number.POSITIVE_INFINITY;for(let n=0,r=0;r<4;++n,++r){hy(n%2?o:a,n%4>=2,!1,e),s=Lm(t);const i=ty(t,s);i<c&&(r=0,l=Vu(s),c=i)}s=ey(t),dy(t,s);for(let n=0,r=0;r<4;++n,++r){hy(n%2?o:a,n%4>=2,!0,e),s=Lm(t);const i=ty(t,s);i<c&&(r=0,l=Vu(s),c=i)}dy(t,l)})(t,a),pb(t),((t,e)=>{const n=e.toLowerCase();"lr"!==n&&"rl"!==n||Zm(t)})(t,i),Ny(t,{align:s,nodesep:l,edgesep:c,ranksep:u}),gb(t),db(t),((t,e)=>{e.forEach((e=>{let n=t.getNode(e);const{data:r}=n,i=r.originalEdge;let o;i&&t.addEdge(i);let a=e;for(;n.data.dummy;)o=t.getSuccessors(a)[0],t.removeNode(a),i.data.points.push({x:n.data.x,y:n.data.y}),n.data.dummy===Km&&(i.data.x=n.data.x,i.data.y=n.data.y,i.data.width=n.data.width,i.data.height=n.data.height),a=o.id,n=t.getNode(a)}))})(t,f),ub(t),((t,e)=>{const n=e.toLowerCase();"bt"!==n&&"rl"!==n||Vm(t),"lr"!==n&&"rl"!==n||(Hm(t),Zm(t))})(t,i);const{width:p,height:g}=lb(t);return cb(t),hb(t),(t=>{t.getAllEdges().forEach((e=>{const n=e.data;if(n.reversed){t.removeEdge(e.id);const r=n.forwardName;delete n.reversed,delete n.forwardName,t.addEdge({id:e.id,source:e.target,target:e.source,data:Object.assign(Object.assign({},n),{forwardName:r})})}}))})(t),{width:p,height:g}},Ky=(t,e)=>{t.getAllNodes().forEach((n=>{const r=t.getNode(n.id);if(e.hasNode(n.id)){const t=e.getNode(n.id);r.data.fixorder=t.data._order,delete t.data._order}else delete r.data.fixorder}))},Qy=(t,e)=>{t.getAllNodes().forEach((n=>{var r;const i=t.getNode(n.id);if(i){const t=e.getNode(n.id);i.data.x=t.data.x,i.data.y=t.data.y,i.data._order=t.data.order,i.data._rank=t.data.rank,(null===(r=e.getChildren(n.id))||void 0===r?void 0:r.length)&&(i.data.width=t.data.width,i.data.height=t.data.height)}})),t.getAllEdges().forEach((n=>{const r=t.getEdge(n.id),i=e.getEdge(n.id);r.data.points=i?i.data.points:[],i&&i.data.hasOwnProperty("x")&&(r.data.x=i.data.x,r.data.y=i.data.y)}))},Jy=["width","height","layer","fixorder"],$y={width:0,height:0},tb=["minlen","weight","width","height","labeloffset"],eb={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},nb=["labelpos"],rb=t=>{const e=new tm({tree:[]});return t.getAllNodes().forEach((n=>{const r=mb(t.getNode(n.id).data),i=Object.assign(Object.assign({},$y),r),o=vb(i,Jy);e.hasNode(n.id)||e.addNode({id:n.id,data:Object.assign({},o)});const a=t.hasTreeStructure("combo")?t.getParent(n.id,"combo"):t.getParent(n.id);ae(a)||(e.hasNode(a.id)||e.addNode(Object.assign({},a)),e.setParent(n.id,a.id))})),t.getAllEdges().forEach((n=>{const r=mb(t.getEdge(n.id).data),i={};null==nb||nb.forEach((t=>{void 0!==r[t]&&(i[t]=r[t])})),e.addEdge({id:n.id,source:n.source,target:n.target,data:Object.assign({},eb,vb(r,tb),i)})})),e},ib=(t,e)=>{const{ranksep:n=0,rankdir:r}=e;return t.getAllNodes().forEach((t=>{isNaN(t.data.layer)||t.data.layer||(t.data.layer=0)})),t.getAllEdges().forEach((t=>{var e;t.data.minlen*=2,"c"!==(null===(e=t.data.labelpos)||void 0===e?void 0:e.toLowerCase())&&("TB"===r||"BT"===r?t.data.width+=t.data.labeloffset:t.data.height+=t.data.labeloffset)})),n/2},ob=t=>{t.getAllEdges().forEach((e=>{if(e.data.width&&e.data.height){const n=t.getNode(e.source),r={e:e,rank:(t.getNode(e.target).data.rank-n.data.rank)/2+n.data.rank};Tm(t,"edge-proxy",r,"_ep")}}))},ab=t=>{let e=0;return t.getAllNodes().forEach((n=>{var r,i;n.data.borderTop&&(n.data.minRank=null===(r=t.getNode(n.data.borderTop))||void 0===r?void 0:r.data.rank,n.data.maxRank=null===(i=t.getNode(n.data.borderBottom))||void 0===i?void 0:i.data.rank,e=Math.max(e,n.data.maxRank||-1/0))})),e},sb=t=>{t.getAllNodes().forEach((e=>{"edge-proxy"===e.data.dummy&&(t.getEdge(e.data.e.id).data.labelRank=e.data.rank,t.removeNode(e.id))}))},lb=(t,e)=>{let n,r,i=0,o=0;const{marginx:a=0,marginy:s=0}=e||{},l=t=>{if(!t.data)return;const e=t.data.x,a=t.data.y,s=t.data.width,l=t.data.height;isNaN(e)||isNaN(s)||(void 0===n&&(n=e-s/2),n=Math.min(n,e-s/2),i=Math.max(i,e+s/2)),isNaN(a)||isNaN(l)||(void 0===r&&(r=a-l/2),r=Math.min(r,a-l/2),o=Math.max(o,a+l/2))};return t.getAllNodes().forEach((t=>{l(t)})),t.getAllEdges().forEach((t=>{(null==t?void 0:t.data.hasOwnProperty("x"))&&l(t)})),n-=a,r-=s,t.getAllNodes().forEach((t=>{t.data.x-=n,t.data.y-=r})),t.getAllEdges().forEach((t=>{var e;null===(e=t.data.points)||void 0===e||e.forEach((t=>{t.x-=n,t.y-=r})),t.data.hasOwnProperty("x")&&(t.data.x-=n),t.data.hasOwnProperty("y")&&(t.data.y-=r)})),{width:i-n+a,height:o-r+s}},cb=t=>{t.getAllEdges().forEach((e=>{const n=t.getNode(e.source),r=t.getNode(e.target);let i,o;e.data.points?(i=e.data.points[0],o=e.data.points[e.data.points.length-1]):(e.data.points=[],i={x:r.data.x,y:r.data.y},o={x:n.data.x,y:n.data.y}),e.data.points.unshift(Dm(n.data,i)),e.data.points.push(Dm(r.data,o))}))},ub=t=>{t.getAllEdges().forEach((t=>{if(t.data.hasOwnProperty("x"))switch("l"!==t.data.labelpos&&"r"!==t.data.labelpos||(t.data.width-=t.data.labeloffset),t.data.labelpos){case"l":t.data.x-=t.data.width/2+t.data.labeloffset;break;case"r":t.data.x+=t.data.width/2+t.data.labeloffset}}))},hb=t=>{t.getAllEdges().forEach((t=>{var e;t.data.reversed&&(null===(e=t.data.points)||void 0===e||e.reverse())}))},db=t=>{t.getAllNodes().forEach((e=>{var n,r,i;if(null===(n=t.getChildren(e.id))||void 0===n?void 0:n.length){const n=t.getNode(e.id),o=t.getNode(n.data.borderTop),a=t.getNode(n.data.borderBottom),s=t.getNode(n.data.borderLeft[(null===(r=n.data.borderLeft)||void 0===r?void 0:r.length)-1]),l=t.getNode(n.data.borderRight[(null===(i=n.data.borderRight)||void 0===i?void 0:i.length)-1]);n.data.width=Math.abs((null==l?void 0:l.data.x)-(null==s?void 0:s.data.x))||10,n.data.height=Math.abs((null==a?void 0:a.data.y)-(null==o?void 0:o.data.y))||10,n.data.x=((null==s?void 0:s.data.x)||0)+n.data.width/2,n.data.y=((null==o?void 0:o.data.y)||0)+n.data.height/2}})),t.getAllNodes().forEach((e=>{"border"===e.data.dummy&&t.removeNode(e.id)}))},fb=t=>{t.getAllEdges().forEach((e=>{if(e.source===e.target){const n=t.getNode(e.source);n.data.selfEdges||(n.data.selfEdges=[]),n.data.selfEdges.push(e),t.removeEdge(e.id)}}))},pb=t=>{const e=Lm(t);null==e||e.forEach((e=>{let n=0;null==e||e.forEach(((e,r)=>{var i;const o=t.getNode(e);o.data.order=r+n,null===(i=o.data.selfEdges)||void 0===i||i.forEach((e=>{Tm(t,"selfedge",{width:e.data.width,height:e.data.height,rank:o.data.rank,order:r+ ++n,e:e},"_se")})),delete o.data.selfEdges}))}))},gb=t=>{t.getAllNodes().forEach((e=>{const n=t.getNode(e.id);if("selfedge"===n.data.dummy){const r=t.getNode(n.data.e.source),i=r.data.x+r.data.width/2,o=r.data.y,a=n.data.x-i,s=r.data.height/2;t.hasEdge(n.data.e.id)?t.updateEdgeData(n.data.e.id,n.data.e.data):t.addEdge({id:n.data.e.id,source:n.data.e.source,target:n.data.e.target,data:n.data.e.data}),t.removeNode(e.id),n.data.e.data.points=[{x:i+2*a/3,y:o-s},{x:i+5*a/6,y:o-s},{y:o,x:i+a},{x:i+5*a/6,y:o+s},{x:i+2*a/3,y:o+s}],n.data.e.data.x=n.data.x,n.data.e.data.y=n.data.y}}))},vb=(t,e)=>{const n={};return null==e||e.forEach((e=>{void 0!==t[e]&&(n[e]=+t[e])})),n},mb=(t={})=>{const e={};return Object.keys(t).forEach((n=>{e[n.toLowerCase()]=t[n]})),e};function yb(t){if(!t)return[0,0,0];if(ie(t))return[t,t,t];if(0===t.length)return[0,0,0];const[e,n=e,r=e]=t;return[e,n,r]}function bb(t,e){let n;return n=en(e)?e:ie(e)?()=>e:()=>t,n}function xb(t,e,n=!0){return e||0===e?en(e)?e:ie(e)?()=>e:Array.isArray(e)?()=>n?Math.max(...e)||t:e:nn(e)&&e.width&&e.height?()=>n?Math.max(e.width,e.height)||t:[e.width,e.height]:()=>t:e=>{const{size:r}=e.data||{};return r?Array.isArray(r)?n?Math.max(...r)||t:r:nn(r)&&r.width&&r.height?n?Math.max(r.width,r.height)||t:[r.width,r.height]:r:t}}const Eb=(t,e,n=10)=>{let r;const i="function"==typeof e?e:()=>e||0;r=t?Array.isArray(t)?e=>t:en(t)?t:e=>t:t=>{var e,r,i;if(null===(e=t.data)||void 0===e?void 0:e.bboxSize)return null===(r=t.data)||void 0===r?void 0:r.bboxSize;if(null===(i=t.data)||void 0===i?void 0:i.size){const e=t.data.size;return Array.isArray(e)?e:nn(e)?[e.width,e.height]:e}return n};return t=>{const e=r(t),n=i(t);return Math.max(...yb(e))+n}},wb=t=>{if(null===t)return t;if(t instanceof Date)return new Date(t.getTime());if(t instanceof Array){const e=[];return t.forEach((t=>{e.push(t)})),e.map((t=>wb(t)))}if("object"==typeof t){const e={};return Object.keys(t).forEach((n=>{e[n]=wb(t[n])})),e}return t},kb=(t,e)=>{const n=wb(t);return n.data=n.data||{},e&&(ie(n.data.x)||(n.data.x=Math.random()*e[0]),ie(n.data.y)||(n.data.y=Math.random()*e[1])),n},Mb={rankdir:"TB",nodesep:50,ranksep:50,edgeLabelSpace:!0,ranker:"tight-tree",controlPoints:!1,radial:!1,focusNode:null};const Sb=(t,e,n,r,i,o,a)=>{let s=(null==t?void 0:t.slice(1,t.length-1))||[];if(e&&n){let{x:t,y:l}=e.data,{x:c,y:u}=n.data;if(i&&(t=e.data.y,l=e.data.x,c=n.data.y,u=n.data.x),u!==l&&t!==c){const h=r.indexOf(l),d=r[h+1];if(d){const t=s[0],e=i?{x:(l+d)/2,y:(null==t?void 0:t.y)||c}:{x:(null==t?void 0:t.x)||c,y:(l+d)/2};t&&!o(t,e)||s.unshift(e)}const f=r.indexOf(u),p=Math.abs(f-h);if(1===p)s=a(s,e.data,n.data),s.length||s.push(i?{x:(l+u)/2,y:t}:{x:t,y:(l+u)/2});else if(p>1){const e=r[f-1];if(e){const n=s[s.length-1],r=i?{x:(u+e)/2,y:(null==n?void 0:n.y)||c}:{x:(null==n?void 0:n.x)||t,y:(u+e)/2};n&&!o(n,r)||s.push(r)}}}}return s},Ab=(t,e,n)=>{const r=t.getAllNodes(),i=t.getAllEdges();if(!(null==r?void 0:r.length)){return{nodes:[],edges:i}}if(1===r.length){e&&t.mergeNodeData(r[0].id,{x:n[0],y:n[1]});return{nodes:[Object.assign(Object.assign({},r[0]),{data:Object.assign(Object.assign({},r[0].data),{x:n[0],y:n[1]})})],edges:i}}},Nb={radius:null,startRadius:null,endRadius:null,startAngle:0,endAngle:2*Math.PI,clockwise:!0,divisions:1,ordering:null,angleRatio:1};const Cb=(t,e,n=!1)=>{const r=[kb(e[0])],i={},o=e.length;i[e[0].id]=!0;let a=0;return e.forEach(((s,l)=>{if(0!==l)if(l!==o-1&&t.getDegree(s.id,"both")===t.getDegree(e[l+1].id,"both")&&!t.areNeighbors(r[a].id,s.id)||i[s.id]){const l=n?t.getSuccessors(r[a].id):t.getNeighbors(r[a].id);let c=!1;for(let e=0;e<l.length;e++){const n=l[e];if(t.getDegree(n.id)===t.getDegree(s.id)&&!i[n.id]){r.push(kb(n)),i[n.id]=!0,c=!0;break}}let u=0;for(;!c&&(i[e[u].id]||(r.push(kb(e[u])),i[e[u].id]=!0,c=!0),u++,u!==o););}else r.push(kb(s)),i[s.id]=!0,a++})),r};const Ob=(t,e,n)=>{let r=t,i=e,o=n;return r||"undefined"==typeof window||(r=window.innerWidth),i||"undefined"==typeof window||(i=window.innerHeight),o||(o=[r/2,i/2]),[r,i,o]},Tb=Array.isArray,Pb={nodeSize:30,nodeSpacing:10,preventOverlap:!1,sweep:void 0,equidistant:!1,startAngle:1.5*Math.PI,clockwise:!0,maxLevelDiff:void 0,sortBy:"degree"};class Rb{constructor(t={}){this.options=t,this.id="concentric",this.options=Object.assign(Object.assign({},Pb),t)}execute(t,e){return(0,ce.mG)(this,void 0,void 0,(function*(){return this.genericConcentricLayout(!1,t,e)}))}assign(t,e){return(0,ce.mG)(this,void 0,void 0,(function*(){yield this.genericConcentricLayout(!0,t,e)}))}genericConcentricLayout(t,e,n){return(0,ce.mG)(this,void 0,void 0,(function*(){const r=Object.assign(Object.assign({},this.options),n),{center:i,width:o,height:a,sortBy:s,maxLevelDiff:l,sweep:c,clockwise:u,equidistant:h,preventOverlap:d,startAngle:f=1.5*Math.PI,nodeSize:p,nodeSpacing:g}=r,v=e.getAllNodes(),m=e.getAllEdges(),y=o||"undefined"==typeof window?o:window.innerWidth,b=a||"undefined"==typeof window?a:window.innerHeight,x=i||[y/2,b/2];if(!(null==v?void 0:v.length)||1===v.length)return Ab(e,t,x);const E=[];let w,k=0;Tb(p)?w=Math.max(p[0],p[1]):en(p)?(w=-1/0,v.forEach((t=>{const e=Math.max(...yb(p(t)));e>w&&(w=e)}))):w=p,Tb(g)?k=Math.max(g[0],g[1]):ie(g)&&(k=g),v.forEach((t=>{const e=kb(t);E.push(e);let n=w;const{data:r}=e;Tb(r.size)?n=Math.max(r.size[0],r.size[1]):ie(r.size)?n=r.size:nn(r.size)&&(n=Math.max(r.size.width,r.size.height)),w=Math.max(w,n),en(g)&&(k=Math.max(g(t),k))}));const M={};E.forEach(((t,e)=>{M[t.id]=e}));let S=s;se(S)&&void 0!==E[0].data[S]||(S="degree"),"degree"===S?E.sort(((t,n)=>e.getDegree(n.id,"both")-e.getDegree(t.id,"both"))):E.sort(((t,e)=>e.data[S]-t.data[S]));const A=E[0],N=(l||("degree"===S?e.getDegree(A.id,"both"):A.data[S]))/4,C=[{nodes:[]}];let O=C[0];E.forEach((t=>{if(O.nodes.length>0){const n="degree"===S?Math.abs(e.getDegree(O.nodes[0].id,"both")-e.getDegree(t.id,"both")):Math.abs(O.nodes[0].data[S]-t.data[S]);N&&n>=N&&(O={nodes:[]},C.push(O))}O.nodes.push(t)}));let T=w+k;if(!d){const t=C.length>0&&C[0].nodes.length>1,e=(Math.min(y,b)/2-T)/(C.length+(t?1:0));T=Math.min(T,e)}let P=0;if(C.forEach((t=>{const e=void 0===c?2*Math.PI-2*Math.PI/t.nodes.length:c;if(t.dTheta=e/Math.max(1,t.nodes.length-1),t.nodes.length>1&&d){const e=Math.cos(t.dTheta)-Math.cos(0),n=Math.sin(t.dTheta)-Math.sin(0),r=Math.sqrt(T*T/(e*e+n*n));P=Math.max(r,P)}t.r=P,P+=T})),h){let t=0,e=0;for(let n=0;n<C.length;n++){const r=(C[n].r||0)-e;t=Math.max(t,r)}e=0,C.forEach(((n,r)=>{0===r&&(e=n.r||0),n.r=e,e+=t}))}C.forEach((t=>{const e=t.dTheta||0,n=t.r||0;t.nodes.forEach(((t,r)=>{const i=f+(u?1:-1)*e*r;t.data.x=x[0]+n*Math.cos(i),t.data.y=x[1]+n*Math.sin(i)}))})),t&&E.forEach((t=>e.mergeNodeData(t.id,{x:t.data.x,y:t.data.y})));return{nodes:E,edges:m}}))}}var Db=n(14301),Lb=n(7695);const Ib=.1;function Bb(t,e,n,r,i=2){const o=e/n,a=t.getAllNodes(),s=a.map(((t,e)=>{const{nodeStrength:n,x:r,y:i,z:a,size:s}=t.data;return{x:r,y:i,z:a,size:s,index:e,id:t.id,vx:0,vy:0,vz:0,weight:o*n}})),l=(2===i?(0,Db.Z)(s,(t=>t.x),(t=>t.y)):(0,Lb.Z)(s,(t=>t.x),(t=>t.y),(t=>t.z))).visitAfter(jb),c=new Map;return s.forEach((t=>{c.set(t.id,t),function(t,e,n){e.visit(((e,r,i,o,a)=>((t,e,n,r,i,o,a)=>{var s;if((null===(s=t.data)||void 0===s?void 0:s.id)===o.id)return;const l=[n,r,i][a-1],c=o.x-t.x||Ib,u=o.y-t.y||Ib,h=o.z-t.z||Ib,d=[c,u,h],f=l-e;let p=0;for(let t=0;t<a;t++)p+=d[t]*d[t];const g=Math.sqrt(p)*p;if(f*f*.81<p){const e=t.weight/g;return o.vx+=c*e,o.vy+=u*e,o.vz+=h*e,!0}if(t.length)return!1;if(t.data!==o){const e=t.data.weight/g;o.vx+=c*e,o.vy+=u*e,o.vz+=h*e}})(e,r,i,o,a,t,n)))}(t,l,i)})),s.map(((t,e)=>{const{id:n,data:i}=a[e],{mass:o=1}=i;r[n]={x:t.vx/o,y:t.vy/o,z:t.vz/o}})),r}function jb(t){let e=0,n=0,r=0,i=0,o=0;const a=t.length;if(a){for(let s=0;s<a;s++){const a=t[s];a&&a.weight&&(e+=a.weight,n+=a.x*a.weight,r+=a.y*a.weight,i+=a.z*a.weight,o+=a.size*a.weight)}t.x=n/e,t.y=r/e,t.z=i/e,t.size=o/e,t.weight=e}else{const e=t;t.x=e.data.x,t.y=e.data.y,t.z=e.data.z,t.size=e.data.size,t.weight=e.data.weight}}const zb={dimensions:2,maxIteration:500,gravity:10,factor:1,edgeStrength:50,nodeStrength:1e3,coulombDisScale:.005,damping:.9,maxSpeed:200,minMovement:.4,interval:.02,linkDistance:200,clusterNodeStrength:20,preventOverlap:!0,distanceThresholdMode:"mean"};class Fb{constructor(t={}){this.options=t,this.id="force",this.timeInterval=0,this.judgingDistance=0,this.running=!1,this.options=Object.assign(Object.assign({},zb),t)}execute(t,e){return(0,ce.mG)(this,void 0,void 0,(function*(){return this.genericForceLayout(!1,t,e)}))}assign(t,e){return(0,ce.mG)(this,void 0,void 0,(function*(){yield this.genericForceLayout(!0,t,e)}))}stop(){this.timeInterval&&"undefined"!=typeof window&&window.clearInterval(this.timeInterval),this.running=!1}tick(t=this.options.maxIteration||1){if(this.lastResult)return this.lastResult;for(let e=0;(this.judgingDistance>this.lastOptions.minMovement||e<1)&&e<t;e++)this.runOneStep(this.lastCalcGraph,this.lastGraph,e,this.lastVelMap,this.lastOptions),this.updatePosition(this.lastGraph,this.lastCalcGraph,this.lastVelMap,this.lastOptions);const e={nodes:this.lastLayoutNodes,edges:this.lastLayoutEdges};return this.lastAssign&&e.nodes.forEach((t=>this.lastGraph.mergeNodeData(t.id,{x:t.data.x,y:t.data.y,z:3===this.options.dimensions?t.data.z:void 0}))),e}genericForceLayout(t,e,n){return(0,ce.mG)(this,void 0,void 0,(function*(){const r=Object.assign(Object.assign({},this.options),n),i=e.getAllNodes(),o=e.getAllEdges(),a=this.formatOptions(r,e),{dimensions:s,width:l,height:c,nodeSize:u,getMass:h,nodeStrength:d,edgeStrength:f,linkDistance:p}=a,g=i.map(((t,e)=>Object.assign(Object.assign({},t),{data:Object.assign(Object.assign({},t.data),{x:ie(t.data.x)?t.data.x:Math.random()*l,y:ie(t.data.y)?t.data.y:Math.random()*c,z:ie(t.data.z)?t.data.z:Math.random()*Math.sqrt(l*c),size:u(t)||30,mass:h(t),nodeStrength:d(t)})}))),v=o.map((t=>Object.assign(Object.assign({},t),{data:Object.assign(Object.assign({},t.data),{edgeStrength:f(t),linkDistance:p(t,e.getNode(t.source),e.getNode(t.target))})})));if(!(null==i?void 0:i.length))return this.lastResult={nodes:[],edges:o},{nodes:[],edges:o};const m={};i.forEach(((t,e)=>{m[t.id]={x:0,y:0,z:0}}));const y=new tm({nodes:g,edges:v});this.formatCentripetal(a,y);const{maxIteration:b,minMovement:x,onTick:E}=a;if(this.lastLayoutNodes=g,this.lastLayoutEdges=v,this.lastAssign=t,this.lastGraph=e,this.lastCalcGraph=y,this.lastOptions=a,this.lastVelMap=m,"undefined"==typeof window)return;let w=0;return new Promise((n=>{this.timeInterval=window.setInterval((()=>{i&&this.running||n({nodes:Wb(e,g),edges:o}),this.runOneStep(y,e,w,m,a),this.updatePosition(e,y,m,a),t&&g.forEach((t=>e.mergeNodeData(t.id,{x:t.data.x,y:t.data.y,z:3===s?t.data.z:void 0}))),null==E||E({nodes:Wb(e,g),edges:o}),w++,(w>=b||this.judgingDistance<x)&&(window.clearInterval(this.timeInterval),n({nodes:Wb(e,g),edges:o}))}),0),this.running=!0}))}))}formatOptions(t,e){const n=Object.assign({},t),{width:r,height:i,getMass:o}=t;n.width=r||"undefined"==typeof window?r:window.innerWidth,n.height=i||"undefined"==typeof window?i:window.innerHeight,t.center||(n.center=[n.width/2,n.height/2]),o||(n.getMass=t=>{let n=1;ie(null==t?void 0:t.data.mass)&&(n=null==t?void 0:t.data.mass);const r=e.getDegree(t.id,"both");return!r||r<5?n:5*r*n}),n.nodeSize=Eb(t.nodeSize,t.nodeSpacing);const a=t.linkDistance?bb(1,t.linkDistance):t=>1+n.nodeSize(e.getNode(t.source))+n.nodeSize(e.getNode(t.target));return n.linkDistance=a,n.nodeStrength=bb(1,t.nodeStrength),n.edgeStrength=bb(1,t.edgeStrength),n}formatCentripetal(t,e){const{dimensions:n,centripetalOptions:r,center:i,clusterNodeStrength:o,leafCluster:a,clustering:s,nodeClusterBy:l}=t,c=e.getAllNodes(),u=r||{leaf:2,single:2,others:1,center:t=>({x:i[0],y:i[1],z:3===n?i[2]:void 0})};let h,d;if("function"!=typeof o&&(t.clusterNodeStrength=t=>o),a&&l&&(h=_b(e,l),d=Array.from(new Set(null==c?void 0:c.map((t=>t.data[l]))))||[],t.centripetalOptions=Object.assign(u,{single:100,leaf:e=>{const{siblingLeaves:n,sameTypeLeaves:r}=h[e.id]||{};return(null==r?void 0:r.length)===(null==n?void 0:n.length)||1===(null==d?void 0:d.length)?1:t.clusterNodeStrength(e)},others:1,center:t=>{const n=e.getDegree(t.id,"both");if(!n)return{x:100,y:100,z:0};let r;if(1===n){const{sameTypeLeaves:e=[]}=h[t.id]||{};1===e.length?r=void 0:e.length>1&&(r=Vb(e))}else r=void 0;return{x:null==r?void 0:r.x,y:null==r?void 0:r.y,z:null==r?void 0:r.z}}})),s&&l){h||(h=_b(e,l)),d||(d=Array.from(new Set(c.map((t=>t.data[l]))))),d=d.filter((t=>void 0!==t));const n={};d.forEach((t=>{const r=c.filter((e=>e.data[l]===t)).map((t=>e.getNode(t.id)));n[t]=Vb(r)})),t.centripetalOptions=Object.assign(u,{single:e=>t.clusterNodeStrength(e),leaf:e=>t.clusterNodeStrength(e),others:e=>t.clusterNodeStrength(e),center:t=>{const e=n[t.data[l]];return{x:null==e?void 0:e.x,y:null==e?void 0:e.y,z:null==e?void 0:e.z}}})}const{leaf:f,single:p,others:g}=t.centripetalOptions||{};f&&"function"!=typeof f&&(t.centripetalOptions.leaf=()=>f),p&&"function"!=typeof p&&(t.centripetalOptions.single=()=>p),g&&"function"!=typeof g&&(t.centripetalOptions.others=()=>g)}runOneStep(t,e,n,r,i){const o={},a=t.getAllNodes(),s=t.getAllEdges();if(!(null==a?void 0:a.length))return;const{monitor:l}=i;if(this.calRepulsive(t,o,i),s&&this.calAttractive(t,o,i),this.calGravity(t,e,o,i),this.updateVelocity(t,o,r,i),l){l({energy:this.calTotalEnergy(o,a),nodes:e.getAllNodes(),edges:e.getAllEdges(),iterations:n})}}calTotalEnergy(t,e){if(!(null==e?void 0:e.length))return 0;let n=0;return e.forEach(((e,r)=>{const i=t[e.id].x,o=t[e.id].y,a=3===this.options.dimensions?t[e.id].z:0,s=i*i+o*o+a*a,{mass:l=1}=e.data;n+=l*s*.5})),n}calRepulsive(t,e,n){const{dimensions:r,factor:i,coulombDisScale:o}=n;Bb(t,i,o*o,e,r)}calAttractive(t,e,n){const{dimensions:r,nodeSize:i}=n;t.getAllEdges().forEach(((n,o)=>{const{source:a,target:s}=n,l=t.getNode(a),c=t.getNode(s);if(!l||!c)return;let u=c.data.x-l.data.x,h=c.data.y-l.data.y,d=3===r?c.data.z-l.data.z:0;u||h||(u=.01*Math.random(),h=.01*Math.random(),3!==r||d||(d=.01*Math.random()));const f=Math.sqrt(u*u+h*h+d*d);if(f<i(l)+i(c))return;const p=u/f,g=h/f,v=d/f,{linkDistance:m=200,edgeStrength:y=200}=n.data||{},b=(m-f)*y,x=1/(l.data.mass||1),E=1/(c.data.mass||1),w=p*b,k=g*b,M=v*b;e[a].x-=w*x,e[a].y-=k*x,e[a].z-=M*x,e[s].x+=w*E,e[s].y+=k*E,e[s].z+=M*E}))}calGravity(t,e,n,r){const{getCenter:i}=r,o=t.getAllNodes(),a=e.getAllNodes(),s=e.getAllEdges(),{width:l,height:c,center:u,gravity:h,centripetalOptions:d}=r;o&&o.forEach((r=>{const{id:o,data:f}=r,{mass:p,x:g,y:v,z:m}=f,y=e.getNode(o);let b=0,x=0,E=0,w=h;const k=t.getDegree(o,"in"),M=t.getDegree(o,"out"),S=t.getDegree(o,"both"),A=null==i?void 0:i(y,S);if(A){const[t,e,n]=A;b=g-t,x=v-e,w=n}else b=g-u[0],x=v-u[1],E=m-u[2];if(w&&(n[o].x-=w*b/p,n[o].y-=w*x/p,n[o].z-=w*E/p),d){const{leaf:t,single:e,others:r,center:i}=d,{x:u,y:h,z:f,centerStrength:b}=(null==i?void 0:i(y,a,s,l,c))||{x:0,y:0,z:0,centerStrength:0};if(!ie(u)||!ie(h))return;const x=(g-u)/p,E=(v-h)/p,w=(m-f)/p;if(b&&(n[o].x-=b*x,n[o].y-=b*E,n[o].z-=b*w),0===S){const t=e(y);if(!t)return;return n[o].x-=t*x,n[o].y-=t*E,void(n[o].z-=t*w)}if(0===k||0===M){const e=t(y,a,s);if(!e)return;return n[o].x-=e*x,n[o].y-=e*E,void(n[o].z-=e*w)}const A=r(y);if(!A)return;n[o].x-=A*x,n[o].y-=A*E,n[o].z-=A*w}}))}updateVelocity(t,e,n,r){const{damping:i,maxSpeed:o,interval:a,dimensions:s}=r,l=t.getAllNodes();(null==l?void 0:l.length)&&l.forEach((t=>{const{id:r}=t;let l=(n[r].x+e[r].x*a)*i||.01,c=(n[r].y+e[r].y*a)*i||.01,u=3===s?(n[r].z+e[r].z*a)*i||.01:0;const h=Math.sqrt(l*l+c*c+u*u);if(h>o){const t=o/h;l*=t,c*=t,u*=t}n[r]={x:l,y:c,z:u}}))}updatePosition(t,e,n,r){const{distanceThresholdMode:i,interval:o,dimensions:a}=r,s=e.getAllNodes();if(!(null==s?void 0:s.length))return void(this.judgingDistance=0);let l=0;"max"===i?this.judgingDistance=-1/0:"min"===i&&(this.judgingDistance=1/0),s.forEach((r=>{const{id:s}=r,c=t.getNode(s);if(ie(c.data.fx)&&ie(c.data.fy))return void e.mergeNodeData(s,{x:c.data.fx,y:c.data.fy,z:3===a?c.data.fz:void 0});const u=n[s].x*o,h=n[s].y*o,d=3===a?n[s].z*o:0;e.mergeNodeData(s,{x:r.data.x+u,y:r.data.y+h,z:r.data.z+d});const f=Math.sqrt(u*u+h*h+d*d);switch(i){case"max":this.judgingDistance<f&&(this.judgingDistance=f);break;case"min":this.judgingDistance>f&&(this.judgingDistance=f);break;default:l+=f}})),i&&"mean"!==i||(this.judgingDistance=l/s.length)}}const _b=(t,e)=>{const n=t.getAllNodes();if(!(null==n?void 0:n.length))return{};const r={};return n.forEach(((n,i)=>{1===t.getDegree(n.id,"both")&&(r[n.id]=Zb(t,"leaf",n,e))})),r},Zb=(t,e,n,r)=>{const i=t.getDegree(n.id,"in"),o=t.getDegree(n.id,"out");let a=n,s=[];0===i?(a=t.getSuccessors(n.id)[0],s=t.getNeighbors(a.id)):0===o&&(a=t.getPredecessors(n.id)[0],s=t.getNeighbors(a.id)),s=s.filter((e=>0===t.getDegree(e.id,"in")||0===t.getDegree(e.id,"out")));return{coreNode:a,siblingLeaves:s,sameTypeLeaves:Gb(t,e,r,n,s)}},Gb=(t,e,n,r,i)=>{const o=r.data[n]||"";let a=(null==i?void 0:i.filter((t=>t.data[n]===o)))||[];return"leaf"===e&&(a=a.filter((e=>0===t.getDegree(e.id,"in")||0===t.getDegree(e.id,"out")))),a},Vb=t=>{const e={x:0,y:0};t.forEach((t=>{const{x:n,y:r}=t.data;e.x+=n||0,e.y+=r||0}));const n=t.length||1;return{x:e.x/n,y:e.y/n}},Wb=(t,e)=>e.map((e=>{const{id:n,data:r}=e,i=t.getNode(n);return Object.assign(Object.assign({},i),{data:Object.assign(Object.assign({},i.data),{x:r.x,y:r.y,z:r.z})})}));var Hb=n(99982),Ub=(Hb.XA,Hb.a_,Hb.yQ,Hb.Hs,Hb.Ec,Hb.dx,Hb.LU,Hb.Rm,Hb.y3),Yb=(Hb.qK,Hb.pb,Hb.j,Hb.sO,Hb.BZ,Hb.EK,Hb.Db,Hb.Fx,Hb.tU,Hb.Ym,Hb.rs,Hb.QR,Hb.TB,Hb.oH,Hb.Sc);Hb.BN,Hb.it,Hb.$r,Hb.QM,Hb.AV,Hb.y3,Hb.y3,Hb.GH,Hb.SO,Hb.uZ,Hb.yU,Hb.F1,Hb.re;const qb=t=>{const e=[],n=t.length;for(let r=0;r<n;r+=1){e[r]=[];for(let i=0;i<n;i+=1)r===i?e[r][i]=0:0!==t[r][i]&&t[r][i]?e[r][i]=t[r][i]:e[r][i]=1/0}for(let t=0;t<n;t+=1)for(let r=0;r<n;r+=1)for(let i=0;i<n;i+=1)e[r][i]>e[r][t]+e[t][i]&&(e[r][i]=e[r][t]+e[t][i]);return e},Xb=(t,e)=>{const{nodes:n,edges:r}=t,i=[],o={};if(!n)throw new Error("invalid nodes data!");return n&&n.forEach(((t,e)=>{o[t.id]=e;i.push([])})),null==r||r.forEach((t=>{const{source:n,target:r}=t,a=o[n],s=o[r];void 0!==a&&void 0!==s&&(i[a][s]=1,e||(i[s][a]=1))})),i},Kb=(t,e)=>Math.sqrt((t.x-e.x)*(t.x-e.x)+(t.y-e.y)*(t.y-e.y)),Qb=(t,e,n,r="TB",i,o={})=>{if(!(null==e?void 0:e.length))return;const{stopBranchFn:a,stopAllFn:s}=o;for(let l=0;l<e.length;l++){const c=e[l];if(t.hasNode(c.id)&&!(null==a?void 0:a(c))){if(null==s?void 0:s(c))return;"TB"===r&&n(c),Qb(t,t.getChildren(c.id,i),n,r,i,o),"TB"!==r&&n(c)}}},Jb={center:[0,0],linkDistance:50};class $b{constructor(t={}){this.options=t,this.id="mds",this.options=Object.assign(Object.assign({},Jb),t)}execute(t,e){return(0,ce.mG)(this,void 0,void 0,(function*(){return this.genericMDSLayout(!1,t,e)}))}assign(t,e){return(0,ce.mG)(this,void 0,void 0,(function*(){yield this.genericMDSLayout(!0,t,e)}))}genericMDSLayout(t,e,n){return(0,ce.mG)(this,void 0,void 0,(function*(){const r=Object.assign(Object.assign({},this.options),n),{center:i=[0,0],linkDistance:o=50}=r,a=e.getAllNodes(),s=e.getAllEdges();if(!(null==a?void 0:a.length)||1===a.length)return Ab(e,t,i);const l=Xb({nodes:a,edges:s},!1),c=qb(l);tx(c);const u=((t,e)=>{const n=[];return t.forEach((t=>{const r=[];t.forEach((t=>{r.push(t*e)})),n.push(r)})),n})(c,o),h=ex(u),d=[];h.forEach(((t,e)=>{const n=kb(a[e]);n.data.x=t[0]+i[0],n.data.y=t[1]+i[1],d.push(n)})),t&&d.forEach((t=>e.mergeNodeData(t.id,{x:t.data.x,y:t.data.y})));return{nodes:d,edges:s}}))}}const tx=t=>{let e=-999999;t.forEach((t=>{t.forEach((t=>{t!==1/0&&e<t&&(e=t)}))})),t.forEach(((n,r)=>{n.forEach(((n,i)=>{n===1/0&&(t[r][i]=e)}))}))},ex=t=>{const e=Ub.mul(Ub.pow(t,2),-.5),n=e.mean("row"),r=e.mean("column"),i=e.mean();e.add(i).subRowVector(n).subColumnVector(r);const o=new Yb(e),a=Ub.sqrt(o.diagonalMatrix).diagonal();return o.leftSingularVectors.toJSON().map((t=>Ub.mul([t],[a]).toJSON()[0].splice(0,2)))};function nx(t){return!!t.tick&&!!t.stop}const rx={gForce:!0,force2:!0,d3force:!0,fruchterman:!0,forceAtlas2:!0,force:!0,"graphin-force":!0},ix={center:[0,0],comboPadding:10,treeKey:"combo"};function ox(t,e,n,r){var i;return(0,ce.mG)(this,void 0,void 0,(function*(){return nx(t)?(t.execute(e,n),t.stop(),t.tick(null!==(i=n.iterations)&&void 0!==i?i:300)):r?yield t.assign(e,n):yield t.execute(e,n)}))}function ax(t){return function(){return t}}function sx(t){return 1e-6*(t()-.5)}function lx(t){return t.index}function cx(t,e){var n=t.get(e);if(!n)throw new Error("node not found: "+e);return n}function ux(t){var e,n,r,i,o,a,s=lx,l=function(t){return 1/Math.min(i[t.source.index],i[t.target.index])},c=ax(30),u=1;function h(r){for(var i=0,s=t.length;i<u;++i)for(var l,c,h,d,f,p,g,v=0;v<s;++v)c=(l=t[v]).source,d=(h=l.target).x+h.vx-c.x-c.vx||sx(a),f=h.y+h.vy-c.y-c.vy||sx(a),d*=p=((p=Math.sqrt(d*d+f*f))-n[v])/p*r*e[v],f*=p,h.vx-=d*(g=o[v]),h.vy-=f*g,c.vx+=d*(g=1-g),c.vy+=f*g}function d(){if(r){var a,l,c=r.length,u=t.length,h=new Map(r.map(((t,e)=>[s(t,e,r),t])));for(a=0,i=new Array(c);a<u;++a)(l=t[a]).index=a,"object"!=typeof l.source&&(l.source=cx(h,l.source)),"object"!=typeof l.target&&(l.target=cx(h,l.target)),i[l.source.index]=(i[l.source.index]||0)+1,i[l.target.index]=(i[l.target.index]||0)+1;for(a=0,o=new Array(u);a<u;++a)l=t[a],o[a]=i[l.source.index]/(i[l.source.index]+i[l.target.index]);e=new Array(u),f(),n=new Array(u),p()}}function f(){if(r)for(var n=0,i=t.length;n<i;++n)e[n]=+l(t[n],n,t)}function p(){if(r)for(var e=0,i=t.length;e<i;++e)n[e]=+c(t[e],e,t)}return null==t&&(t=[]),h.initialize=function(t,e){r=t,a=e,d()},h.links=function(e){return arguments.length?(t=e,d(),h):t},h.id=function(t){return arguments.length?(s=t,h):s},h.iterations=function(t){return arguments.length?(u=+t,h):u},h.strength=function(t){return arguments.length?(l="function"==typeof t?t:ax(+t),f(),h):l},h.distance=function(t){return arguments.length?(c="function"==typeof t?t:ax(+t),p(),h):c},h}var hx=n(75354),dx=n(83833);const fx=4294967296;function px(t){return t.x}function gx(t){return t.y}var vx=Math.PI*(3-Math.sqrt(5));function mx(t){var e,n=1,r=.001,i=1-Math.pow(r,1/300),o=0,a=.6,s=new Map,l=(0,dx.HT)(h),c=(0,hx.Z)("tick","end"),u=function(){let t=1;return()=>(t=(1664525*t+1013904223)%fx)/fx}();function h(){d(),c.call("tick",e),n<r&&(l.stop(),c.call("end",e))}function d(r){var l,c,u=t.length;void 0===r&&(r=1);for(var h=0;h<r;++h)for(n+=(o-n)*i,s.forEach((function(t){t(n)})),l=0;l<u;++l)null==(c=t[l]).fx?c.x+=c.vx*=a:(c.x=c.fx,c.vx=0),null==c.fy?c.y+=c.vy*=a:(c.y=c.fy,c.vy=0);return e}function f(){for(var e,n=0,r=t.length;n<r;++n){if((e=t[n]).index=n,null!=e.fx&&(e.x=e.fx),null!=e.fy&&(e.y=e.fy),isNaN(e.x)||isNaN(e.y)){var i=10*Math.sqrt(.5+n),o=n*vx;e.x=i*Math.cos(o),e.y=i*Math.sin(o)}(isNaN(e.vx)||isNaN(e.vy))&&(e.vx=e.vy=0)}}function p(e){return e.initialize&&e.initialize(t,u),e}return null==t&&(t=[]),f(),e={tick:d,restart:function(){return l.restart(h),e},stop:function(){return l.stop(),e},nodes:function(n){return arguments.length?(t=n,f(),s.forEach(p),e):t},alpha:function(t){return arguments.length?(n=+t,e):n},alphaMin:function(t){return arguments.length?(r=+t,e):r},alphaDecay:function(t){return arguments.length?(i=+t,e):+i},alphaTarget:function(t){return arguments.length?(o=+t,e):o},velocityDecay:function(t){return arguments.length?(a=1-t,e):1-a},randomSource:function(t){return arguments.length?(u=t,s.forEach(p),e):u},force:function(t,n){return arguments.length>1?(null==n?s.delete(t):s.set(t,p(n)),e):s.get(t)},find:function(e,n,r){var i,o,a,s,l,c=0,u=t.length;for(null==r?r=1/0:r*=r,c=0;c<u;++c)(a=(i=e-(s=t[c]).x)*i+(o=n-s.y)*o)<r&&(l=s,r=a);return l},on:function(t,n){return arguments.length>1?(c.on(t,n),e):c.on(t)}}}function yx(){var t,e,n,r,i,o=ax(-30),a=1,s=1/0,l=.81;function c(n){var i,o=t.length,a=(0,Db.Z)(t,px,gx).visitAfter(h);for(r=n,i=0;i<o;++i)e=t[i],a.visit(d)}function u(){if(t){var e,n,r=t.length;for(i=new Array(r),e=0;e<r;++e)n=t[e],i[n.index]=+o(n,e,t)}}function h(t){var e,n,r,o,a,s=0,l=0;if(t.length){for(r=o=a=0;a<4;++a)(e=t[a])&&(n=Math.abs(e.value))&&(s+=e.value,l+=n,r+=n*e.x,o+=n*e.y);t.x=r/l,t.y=o/l}else{(e=t).x=e.data.x,e.y=e.data.y;do{s+=i[e.data.index]}while(e=e.next)}t.value=s}function d(t,o,c,u){if(!t.value)return!0;var h=t.x-e.x,d=t.y-e.y,f=u-o,p=h*h+d*d;if(f*f/l<p)return p<s&&(0===h&&(p+=(h=sx(n))*h),0===d&&(p+=(d=sx(n))*d),p<a&&(p=Math.sqrt(a*p)),e.vx+=h*t.value*r/p,e.vy+=d*t.value*r/p),!0;if(!(t.length||p>=s)){(t.data!==e||t.next)&&(0===h&&(p+=(h=sx(n))*h),0===d&&(p+=(d=sx(n))*d),p<a&&(p=Math.sqrt(a*p)));do{t.data!==e&&(f=i[t.data.index]*r/p,e.vx+=h*f,e.vy+=d*f)}while(t=t.next)}}return c.initialize=function(e,r){t=e,n=r,u()},c.strength=function(t){return arguments.length?(o="function"==typeof t?t:ax(+t),u(),c):o},c.distanceMin=function(t){return arguments.length?(a=t*t,c):Math.sqrt(a)},c.distanceMax=function(t){return arguments.length?(s=t*t,c):Math.sqrt(s)},c.theta=function(t){return arguments.length?(l=t*t,c):Math.sqrt(l)},c}function bx(t,e){var n,r=1;function i(){var i,o,a=n.length,s=0,l=0;for(i=0;i<a;++i)s+=(o=n[i]).x,l+=o.y;for(s=(s/a-t)*r,l=(l/a-e)*r,i=0;i<a;++i)(o=n[i]).x-=s,o.y-=l}return null==t&&(t=0),null==e&&(e=0),i.initialize=function(t){n=t},i.x=function(e){return arguments.length?(t=+e,i):t},i.y=function(t){return arguments.length?(e=+t,i):e},i.strength=function(t){return arguments.length?(r=+t,i):r},i}function xx(t){return t.x+t.vx}function Ex(t){return t.y+t.vy}function wx(t){var e,n,r,i=1,o=1;function a(){for(var t,a,l,c,u,h,d,f=e.length,p=0;p<o;++p)for(a=(0,Db.Z)(e,xx,Ex).visitAfter(s),t=0;t<f;++t)l=e[t],h=n[l.index],d=h*h,c=l.x+l.vx,u=l.y+l.vy,a.visit(g);function g(t,e,n,o,a){var s=t.data,f=t.r,p=h+f;if(!s)return e>c+p||o<c-p||n>u+p||a<u-p;if(s.index>l.index){var g=c-s.x-s.vx,v=u-s.y-s.vy,m=g*g+v*v;m<p*p&&(0===g&&(m+=(g=sx(r))*g),0===v&&(m+=(v=sx(r))*v),m=(p-(m=Math.sqrt(m)))/m*i,l.vx+=(g*=m)*(p=(f*=f)/(d+f)),l.vy+=(v*=m)*p,s.vx-=g*(p=1-p),s.vy-=v*p)}}}function s(t){if(t.data)return t.r=n[t.data.index];for(var e=t.r=0;e<4;++e)t[e]&&t[e].r>t.r&&(t.r=t[e].r)}function l(){if(e){var r,i,o=e.length;for(n=new Array(o),r=0;r<o;++r)i=e[r],n[i.index]=+t(i,r,e)}}return"function"!=typeof t&&(t=ax(null==t?1:+t)),a.initialize=function(t,n){e=t,r=n,l()},a.iterations=function(t){return arguments.length?(o=+t,a):o},a.strength=function(t){return arguments.length?(i=+t,a):i},a.radius=function(e){return arguments.length?(t="function"==typeof e?e:ax(+e),l(),a):t},a}function kx(t,e,n){var r,i,o,a=ax(.1);function s(t){for(var a=0,s=r.length;a<s;++a){var l=r[a],c=l.x-e||1e-6,u=l.y-n||1e-6,h=Math.sqrt(c*c+u*u),d=(o[a]-h)*i[a]*t/h;l.vx+=c*d,l.vy+=u*d}}function l(){if(r){var e,n=r.length;for(i=new Array(n),o=new Array(n),e=0;e<n;++e)o[e]=+t(r[e],e,r),i[e]=isNaN(o[e])?0:+a(r[e],e,r)}}return"function"!=typeof t&&(t=ax(+t)),null==e&&(e=0),null==n&&(n=0),s.initialize=function(t){r=t,l()},s.strength=function(t){return arguments.length?(a="function"==typeof t?t:ax(+t),l(),s):a},s.radius=function(e){return arguments.length?(t="function"==typeof e?e:ax(+e),l(),s):t},s.x=function(t){return arguments.length?(e=+t,s):e},s.y=function(t){return arguments.length?(n=+t,s):n},s}function Mx(t){var e,n,r,i=ax(.1);function o(t){for(var i,o=0,a=e.length;o<a;++o)(i=e[o]).vx+=(r[o]-i.x)*n[o]*t}function a(){if(e){var o,a=e.length;for(n=new Array(a),r=new Array(a),o=0;o<a;++o)n[o]=isNaN(r[o]=+t(e[o],o,e))?0:+i(e[o],o,e)}}return"function"!=typeof t&&(t=ax(null==t?0:+t)),o.initialize=function(t){e=t,a()},o.strength=function(t){return arguments.length?(i="function"==typeof t?t:ax(+t),a(),o):i},o.x=function(e){return arguments.length?(t="function"==typeof e?e:ax(+e),a(),o):t},o}function Sx(t){var e,n,r,i=ax(.1);function o(t){for(var i,o=0,a=e.length;o<a;++o)(i=e[o]).vy+=(r[o]-i.y)*n[o]*t}function a(){if(e){var o,a=e.length;for(n=new Array(a),r=new Array(a),o=0;o<a;++o)n[o]=isNaN(r[o]=+t(e[o],o,e))?0:+i(e[o],o,e)}}return"function"!=typeof t&&(t=ax(null==t?0:+t)),o.initialize=function(t){e=t,a()},o.strength=function(t){return arguments.length?(i="function"==typeof t?t:ax(+t),a(),o):i},o.y=function(e){return arguments.length?(t="function"==typeof e?e:ax(+e),a(),o):t},o}const Ax=(t,e)=>e.reduce(((e,[n,r])=>e[n]&&void 0!==r?e[n].call(t,r):e),t);var Nx=n(92546),Cx=n.n(Nx);class Ox{constructor(t){this.id="dagre",this.options={},Object.assign(this.options,Ox.defaultOptions,t)}execute(t,e){return(0,ce.mG)(this,void 0,void 0,(function*(){return this.genericDagreLayout(!1,t,Object.assign(Object.assign({},this.options),e))}))}assign(t,e){return(0,ce.mG)(this,void 0,void 0,(function*(){yield this.genericDagreLayout(!0,t,Object.assign(Object.assign({},this.options),e))}))}genericDagreLayout(t,e,n){return(0,ce.mG)(this,void 0,void 0,(function*(){const{nodeSize:r}=n,i=new Nx.graphlib.Graph;i.setGraph(n),i.setDefaultEdgeLabel((()=>({})));[...e.getAllNodes(),...e.getAllEdges()].some((({id:t})=>ie(t)))&&console.error("Dagre layout only support string id, it will convert number to string."),e.getAllNodes().forEach((t=>{const{id:e}=t,n=Object.assign({},t.data);if(void 0!==r){const[e,i]=yb(en(r)?r(t):r);Object.assign(n,{width:e,height:i})}i.setNode(e.toString(),n)})),e.getAllEdges().forEach((({id:t,source:e,target:n})=>{i.setEdge(e.toString(),n.toString(),{id:t})})),Cx().layout(i);const o={nodes:[],edges:[]};return i.nodes().forEach((n=>{const r=i.node(n);o.nodes.push({id:n,data:r}),t&&e.mergeNodeData(n,r)})),i.edges().forEach((n=>{const r=i.edge(n),{id:a}=r,s=(0,ce._T)(r,["id"]),{v:l,w:c}=n;o.edges.push({id:a,source:l,target:c,data:s}),t&&e.mergeEdgeData(a,s)})),o}))}}Ox.defaultOptions={};class Tx{constructor(t){this.id=t.id||0,this.rx=t.rx,this.ry=t.ry,this.fx=0,this.fy=0,this.mass=t.mass,this.degree=t.degree,this.g=t.g||0}distanceTo(t){const e=this.rx-t.rx,n=this.ry-t.ry;return Math.hypot(e,n)}setPos(t,e){this.rx=t,this.ry=e}resetForce(){this.fx=0,this.fy=0}addForce(t){const e=t.rx-this.rx,n=t.ry-this.ry;let r=Math.hypot(e,n);r=r<1e-4?1e-4:r;const i=this.g*(this.degree+1)*(t.degree+1)/r;this.fx+=i*e/r,this.fy+=i*n/r}in(t){return t.contains(this.rx,this.ry)}add(t){const e=this.mass+t.mass,n=(this.rx*this.mass+t.rx*t.mass)/e,r=(this.ry*this.mass+t.ry*t.mass)/e,i=this.degree+t.degree;return new Tx({rx:n,ry:r,mass:e,degree:i})}}class Px{constructor(t){this.xmid=t.xmid,this.ymid=t.ymid,this.length=t.length,this.massCenter=t.massCenter||[0,0],this.mass=t.mass||1}getLength(){return this.length}contains(t,e){const n=this.length/2;return t<=this.xmid+n&&t>=this.xmid-n&&e<=this.ymid+n&&e>=this.ymid-n}NW(){const t=this.xmid-this.length/4,e=this.ymid+this.length/4,n=this.length/2;return new Px({xmid:t,ymid:e,length:n})}NE(){const t=this.xmid+this.length/4,e=this.ymid+this.length/4,n=this.length/2;return new Px({xmid:t,ymid:e,length:n})}SW(){const t=this.xmid-this.length/4,e=this.ymid-this.length/4,n=this.length/2;return new Px({xmid:t,ymid:e,length:n})}SE(){const t=this.xmid+this.length/4,e=this.ymid-this.length/4,n=this.length/2;return new Px({xmid:t,ymid:e,length:n})}}class Rx{constructor(t){this.body=null,this.quad=null,this.NW=null,this.NE=null,this.SW=null,this.SE=null,this.theta=.5,null!=t&&(this.quad=t)}insert(t){null!=this.body?this._isExternal()?(this.quad&&(this.NW=new Rx(this.quad.NW()),this.NE=new Rx(this.quad.NE()),this.SW=new Rx(this.quad.SW()),this.SE=new Rx(this.quad.SE())),this._putBody(this.body),this._putBody(t),this.body=this.body.add(t)):(this.body=this.body.add(t),this._putBody(t)):this.body=t}_putBody(t){this.quad&&(t.in(this.quad.NW())&&this.NW?this.NW.insert(t):t.in(this.quad.NE())&&this.NE?this.NE.insert(t):t.in(this.quad.SW())&&this.SW?this.SW.insert(t):t.in(this.quad.SE())&&this.SE&&this.SE.insert(t))}_isExternal(){return null==this.NW&&null==this.NE&&null==this.SW&&null==this.SE}updateForce(t){if(null!=this.body&&t!==this.body)if(this._isExternal())t.addForce(this.body);else{(this.quad?this.quad.getLength():0)/this.body.distanceTo(t)<this.theta?t.addForce(this.body):(this.NW&&this.NW.updateForce(t),this.NE&&this.NE.updateForce(t),this.SW&&this.SW.updateForce(t),this.SE&&this.SE.updateForce(t))}}}const Dx={center:[0,0],width:300,height:300,kr:5,kg:1,mode:"normal",preventOverlap:!1,dissuadeHubs:!1,maxIteration:0,ks:.1,ksmax:10,tao:.1};const Lx={maxIteration:1e3,gravity:10,speed:5,clustering:!1,clusterGravity:10,width:300,height:300,nodeClusterBy:"cluster"};const Ix={begin:[0,0],preventOverlap:!0,preventOverlapPadding:10,condense:!1,rows:void 0,cols:void 0,position:void 0,sortBy:"degree",nodeSize:30,width:300,height:300};const Bx=(t,e)=>{let n;const r=t.rows||5,i=t.cols||5;if(null==e)n=Math.min(r,i);else{Math.min(r,i)===t.rows?t.rows=e:t.cols=e}return n},jx=(t,e)=>{let n;const r=t.rows||5,i=t.cols||5;if(null==e)n=Math.max(r,i);else{Math.max(r,i)===t.rows?t.rows=e:t.cols=e}return n},zx=(t,e)=>t[`c-${e.row}-${e.col}`]||!1,Fx=(t,e)=>t[`c-${e.row}-${e.col}`]=!0,_x=(t,e)=>{const n=t.cols||5;e.col++,e.col>=n&&(e.col=0,e.row++)},Zx=(t,e,n,r,i,o,a,s)=>{let l,c;const u=i[t.id];if(u)l=u.col*n+n/2+e[0],c=u.row*r+r/2+e[1];else{for(;zx(s,a);)_x(o,a);l=a.col*n+n/2+e[0],c=a.row*r+r/2+e[1],Fx(s,a),_x(o,a)}t.data.x=l,t.data.y=c},Gx={iterations:10,height:10,width:10,speed:100,gravity:10,k:5},Vx=(t,e,n,r,i,o)=>{e.forEach(((a,s)=>{n[s]={x:0,y:0},e.forEach(((e,l)=>{if(s===l)return;if(i[s]!==i[l])return;let c=a.x-e.x,u=a.y-e.y,h=Math.sqrt(c*c+u*u);if(0===h){h=1;const t=s>l?1:-1;c=.01*t,u=.01*t}if(h<o(t[s])/2+o(t[l])/2){const t=r*r/h;n[s].x+=c/h*t,n[s].y+=u/h*t}}))}))},Wx=(t,e,n,r,i,o,a,s)=>{const l=o||a/10;return r&&e.forEach(((e,n)=>{const r=t[n].x-t[i].x,o=t[n].y-t[i].y,a=Math.sqrt(r*r+o*o);let s=o/a,l=-r/a;const c=Math.sqrt(e.x*e.x+e.y*e.y);let u=Math.acos((s*e.x+l*e.y)/c);u>Math.PI/2&&(u-=Math.PI/2,s*=-1,l*=-1);const h=Math.cos(u)*c;e.x=s*h,e.y=l*h})),t.forEach(((o,a)=>{if(a===i)return;const c=Math.sqrt(e[a].x*e[a].x+e[a].y*e[a].y);if(c>0&&a!==i){const u=Math.min(l*(n/800),c);if(o.x+=e[a].x/c*u,o.y+=e[a].y/c*u,r){let e=o.x-t[i].x,n=o.y-t[i].y;const r=Math.sqrt(e*e+n*n);e=e/r*s[a],n=n/r*s[a],o.x=t[i].x+e,o.y=t[i].y+n}}})),t},Hx={maxIteration:1e3,focusNode:null,unitRadius:null,linkDistance:50,preventOverlap:!1,strictRadial:!0,maxPreventOverlapIteration:200,sortStrength:10};const Ux=(t,e,n,r,i,o,a)=>{if(!t)return[];const s=[];if(e){const l={};e.forEach(((e,c)=>{const u=[];e.forEach(((e,s)=>{var h,d;if(c===s)u.push(0);else if(r[c]===r[s])if("data"===o)u.push(e*(Math.abs(c-s)*a)/(r[c]/i));else if(o){let n,f;if(l[t[c].id])n=l[t[c].id];else{const e=("id"===o?t[c].id:null===(h=t[c].data)||void 0===h?void 0:h[o])||0;n=se(e)?e.charCodeAt(0):e,l[t[c].id]=n}if(l[t[s].id])f=l[t[s].id];else{const e=("id"===o?t[s].id:null===(d=t[s].data)||void 0===d?void 0:d[o])||0;f=se(e)?e.charCodeAt(0):e,l[t[s].id]=f}u.push(e*(Math.abs(n-f)*a)/(r[c]/i))}else u.push(e*n/(r[c]/i));else{const t=(n+i)/2;u.push(e*t)}})),s.push(u)}))}return s},Yx=t=>{const e=t.length,n=t[0].length,r=[];for(let i=0;i<e;i++){const e=[];for(let r=0;r<n;r++)0!==t[i][r]?e.push(1/(t[i][r]*t[i][r])):e.push(0);r.push(e)}return r},qx=(t,e)=>{let n=-1;return t.forEach(((t,r)=>{t.id===e&&(n=r)})),Math.max(n,0)},Xx=(t,e,n)=>{const r=t.length;for(let i=0;i<r;i++)if(t[e][i]===1/0){t[e][i]=n,t[i][e]=n;for(let o=0;o<r;o++)t[i][o]!==1/0&&t[e][o]===1/0&&(t[e][o]=n+t[i][o],t[o][e]=n+t[i][o])}for(let n=0;n<r;n++)if(n!==e)for(let i=0;i<r;i++)if(t[n][i]===1/0){let r=Math.abs(t[e][n]-t[e][i]);r=0===r?1:r,t[n][i]=r}},Kx=(t,e)=>{let n=0;for(let r=0;r<t[e].length;r++)t[e][r]!==1/0&&(n=t[e][r]>n?t[e][r]:n);return n},Qx={center:[0,0],width:300,height:300};function Jx(t){var e,n,r,i=t||1;function o(t,o){++e>i&&(r=n,a(1),++e),n[t]=o}function a(t){e=0,n=Object.create(null),t||(r=Object.create(null))}return a(),{clear:a,has:function(t){return void 0!==n[t]||void 0!==r[t]},get:function(t){var e=n[t];return void 0!==e?e:void 0!==(e=r[t])?(o(t,e),e):void 0},set:function(t,e){void 0!==n[t]?n[t]=e:o(t,e)}}}var $x=new Map;function tE(t,e,n){void 0===n&&(n=128);return function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];var o=e?e.apply(this,r):r[0];$x.has(t)||$x.set(t,Jx(n));var a=$x.get(t);if(a.has(o))return a.get(o);var s=t.apply(this,r);return a.set(o,s),s}}var eE=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(t){o(t)}}function s(t){try{l(r.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}))};class nE extends em{constructor(){super(...arguments),this.id="fishbone"}getRoot(){const t=this.context.model.getRootsData();if(!(Sf(t)||t.length>2))return t[0]}formatSize(t){const e="function"==typeof t?t:()=>t;return t=>df(e(t))}doLayout(t,e){const{hGap:n,getRibSep:r,vGap:i,nodeSize:o,height:a}=e,{model:s}=this.context,l=this.formatSize(o);let c=l(t)[0]+r(t);const u=(t,e=0)=>{var r;return e+=n*((t.children||[]).length+1),null===(r=t.children)||void 0===r||r.forEach((t=>{var n;null===(n=s.getNodeLikeDatum(t).children)||void 0===n||n.forEach((t=>{const n=s.getNodeLikeDatum(t);e=u(n,e)}))})),e},h=t=>{if(1===t.depth)return c;const e=s.getParentData(t.id,"tree");if(oE(t)){const r=s.getParentData(e.id,"tree"),o=p(t)-p(r);return h(e)+o*n/i}{const n=(e.children||[]).indexOf(t.id),r=s.getNodeData((e.children||[]).slice(n));return d(e)-r.reduce(((t,e)=>t+u(e)),0)-l(e)[0]/2}},d=tE((t=>{if(iE(t))return l(t)[0]/2;const e=s.getParentData(t.id,"tree");if(oE(t))return h(t)+u(t)+l(t)[0]/2;{const r=p(t)-p(e),o=n/i;return h(t)+r*o}}),(t=>t.id)),f=t=>p(s.getParentData(t,"tree")),p=tE((t=>{if(iE(t))return a/2;if(oE(t)){const e=s.getParentData(t.id,"tree"),n=e.children.indexOf(t.id);if(0===n)return f(e.id)+i;const r=s.getNodeLikeDatum(e.children[n-1]);if(Sf(r.children))return p(r)+i;const o=s.getDescendantsData(r.id);return Math.max(...o.map((t=>oE(t)?f(t.id):p(t))))+i}{if(Sf(t.children))return f(t.id)+i;const e=s.getNodeLikeDatum(t.children.slice(-1)[0]);if(Sf(e.children))return p(e)+i;const n=s.getDescendantsData(t.id).slice(-1)[0];return(oE(n)?f(n.id):p(n))+i}}),(t=>t.id));let g=0;const v={nodes:[],edges:[]},m=t=>{var e;null===(e=t.children)||void 0===e||e.forEach((t=>m(s.getNodeLikeDatum(t))));const n=p(t),i=d(t);if(v.nodes.push({id:t.id,x:i,y:n}),iE(t))return;const o=s.getRelatedEdgesData(t.id,"in")[0],a=[h(t),oE(t)?n:f(t.id)];v.edges.push({id:Fh(o),controlPoints:[a],relatedNodeId:t.id}),g=Math.max(g,i+r(t)),1===t.depth&&(c=g)};return m(t),v}placeAlterative(t,e){const n=(e.children||[]).filter(((t,e)=>e%2!=0));if(0===n.length)return t;const{model:r}=this.context,i=t.nodes.find((t=>t.id===e.id)).y,o=t=>{const e=r.getAncestorsData(t,"tree");if(Sf(e))return!1;const i=1===e.length?t:e[e.length-2].id;return n.includes(i)};t.nodes.forEach((t=>{o(t.id)&&(t.y=2*i-t.y)})),t.edges.forEach((t=>{o(t.relatedNodeId)&&(t.controlPoints=t.controlPoints.map((t=>[t[0],2*i-t[1]])))}))}rightToLeft(t,e){return t.nodes.forEach((t=>t.x=e.width-t.x)),t.edges.forEach((t=>{t.controlPoints=t.controlPoints.map((t=>[e.width-t[0],t[1]]))})),t}execute(t,e){return eE(this,void 0,void 0,(function*(){const n=Object.assign(Object.assign(Object.assign({},nE.defaultOptions),this.options),e),{direction:r,nodeSize:i}=n,o=this.getRoot();if(!o)return t;const a=this.formatSize(i);n.vGap||(n.vGap=Math.max(...(t.nodes||[]).map((t=>a(t)[1])))),n.hGap||(n.hGap=Math.max(...(t.nodes||[]).map((t=>a(t)[0]))));let s=this.doLayout(o,n);this.placeAlterative(s,o),"RL"===r&&(s=this.rightToLeft(s,n));const{model:l}=this.context,c=[],u=[];return s.nodes.forEach((t=>{const{id:e,x:n,y:r}=t,i=l.getNodeLikeDatum(e);c.push(rE(i,{x:n,y:r}))})),s.edges.forEach((t=>{const{id:e,controlPoints:n}=t,r=l.getEdgeDatum(e);u.push(rE(r,{controlPoints:n}))})),{nodes:c,edges:u}}))}}nE.defaultOptions={direction:"RL",getRibSep:()=>60};const rE=(t,e)=>Object.assign(Object.assign({},t),{style:Object.assign(Object.assign({},t.style||{}),e)}),iE=t=>0===t.depth,oE=t=>(t.depth||(t.depth=0))%2==0;var aE=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(t){o(t)}}function s(t){try{l(r.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}))};class sE extends em{constructor(){super(...arguments),this.id="snake"}formatSize(t,e){const n="function"==typeof e?e:()=>e;return t.reduce(((t,e)=>{const[r,i]=df(n(e))||[0,0];return[Math.max(t[0],r),Math.max(t[1],i)]}),[0,0])}validate(t){const{nodes:e=[],edges:n=[]}=t,r={},i={},o={};e.forEach((t=>{r[t.id]=0,i[t.id]=0,o[t.id]=[]})),n.forEach((t=>{r[t.target]++,i[t.source]++,o[t.source].push(t.target)}));const a=new Set,s=t=>{a.has(t)||(a.add(t),o[t].forEach(s))};if(s(e[0].id),a.size!==e.length)return!1;const l=e.filter((t=>0===r[t.id])),c=e.filter((t=>0===i[t.id]));if(1!==l.length||1!==c.length)return!1;return e.filter((t=>1===r[t.id]&&1===i[t.id])).length===e.length-2}execute(t,e){return aE(this,void 0,void 0,(function*(){var n;if(!this.validate(t))return t;const{nodeSize:r,padding:i,sortBy:o,cols:a,colGap:s,rowGap:l,clockwise:c,width:u,height:h}=Object.assign({},sE.defaultOptions,this.options,e),[d,f,p,g]=Uu(i),v=this.formatSize(t.nodes||[],r),m=Math.ceil((t.nodes||[]).length/a);let y=s||(u-g-f-a*v[0])/(a-1),b=l||(h-d-p-m*v[1])/(m-1);(b===1/0||b<0)&&(b=0),(y===1/0||y<0)&&(y=0);const x=o?null===(n=t.nodes)||void 0===n?void 0:n.sort(o):function(t){const{nodes:e=[],edges:n=[]}=t,r={},i={};e.forEach((t=>{r[t.id]=0,i[t.id]=[]})),n.forEach((t=>{r[t.target]++,i[t.source].push(t.target)}));const o=[],a=[];e.forEach((t=>{0===r[t.id]&&o.push(t.id)}));for(;o.length>0;){const t=o.shift(),n=e.find((e=>e.id===t));a.push(n),i[t].forEach((t=>{r[t]--,0===r[t]&&o.push(t)}))}return a}(t),E=(x||[]).map(((t,e)=>{const n=Math.floor(e/a),r=e%a,i=g+(c?n%2==0?r:a-1-r:n%2==0?a-1-r:r)*(v[0]+y)+v[0]/2,o=d+n*(v[1]+b)+v[1]/2;return{id:t.id,style:{x:i,y:o}}}));return{nodes:E}}))}}sE.defaultOptions={padding:0,cols:5,clockwise:!0};var lE=function(t,e,n){if(!Be(t)&&!nd(t))return t;var r=n;return fg(t,(function(t,n){r=e(r,t,n)})),r},cE=function(t,e){return lE(t,(function(t,n,r){return e.includes(r)||(t[r]=n),t}),{})};class uE extends $h{}function hE(t,e=!0,n){const r=document.createElement("div");return r.setAttribute("class",`g6-${t}`),Object.assign(r.style,{position:"absolute",display:"block"}),e&&Object.assign(r.style,{position:"unset",gridArea:"1 / 1 / 2 / 2",inset:"0px",height:"100%",width:"100%",overflow:"hidden",pointerEvents:"none"}),n&&Object.assign(r.style,n),r}function dE(t,e="div",n={},r="",i=document.body){const o=document.getElementById(t);o&&o.remove();const a=document.createElement(e);return a.innerHTML=r,a.id=t,Object.assign(a.style,n),i.appendChild(a),a}var fE,pE,gE=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(t){o(t)}}function s(t){try{l(r.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}))};class vE extends uE{constructor(t,e){super(t,Object.assign({},vE.defaultOptions,e)),this.$element=hE("background");this.context.canvas.getContainer().prepend(this.$element),this.update(e)}update(t){const e=Object.create(null,{update:{get:()=>super.update}});return gE(this,void 0,void 0,(function*(){e.update.call(this,t),Object.assign(this.$element.style,cE(this.options,["key","type"]))}))}destroy(){super.destroy(),this.$element.remove()}}function mE(t,e,n,r,i,o){const a=n-t,s=r-e;let l=i-t,c=o-e,u=l*a+c*s,h=0;u<=0?h=0:(l=a-l,c=s-c,u=l*a+c*s,h=u<=0?0:u*u/(a*a+s*s));const d=l*l+c*c-h;return d<0?0:d}function yE(t,e,n,r){return(t-n)*(t-n)+(e-r)*(e-r)}function bE(t,e,n,r,i){return yE(t,e,n,r)<i*i}function xE(t){const e=Math.min(t.x1,t.x2),n=Math.max(t.x1,t.x2),r=Math.min(t.y1,t.y2),i=Math.max(t.y1,t.y2);return{x:e,y:r,x2:n,y2:i,width:n-e,height:i-r}}vE.defaultOptions={transition:"background 0.5s",backgroundSize:"cover",zIndex:"-1"};class EE{constructor(t,e,n,r){this.x1=t,this.y1=e,this.x2=n,this.y2=r}equals(t){return this.x1===t.x1&&this.y1===t.y1&&this.x2===t.x2&&this.y2===t.y2}draw(t){t.moveTo(this.x1,this.y1),t.lineTo(this.x2,this.y2)}toString(){return`Line(from=(${this.x1},${this.y1}),to=(${this.x2},${this.y2}))`}static from(t){return new EE(t.x1,t.y1,t.x2,t.y2)}cuts(t,e){if(this.y1===this.y2)return!1;if(e<this.y1&&e<=this.y2||e>this.y1&&e>=this.y2)return!1;if(t>this.x1&&t>=this.x2)return!1;if(t<this.x1&&t<=this.x2)return!0;return t<=this.x1+(e-this.y1)*(this.x2-this.x1)/(this.y2-this.y1)}distSquare(t,e){return mE(this.x1,this.y1,this.x2,this.y2,t,e)}ptClose(t,e,n){if(this.x1<this.x2){if(t<this.x1-n||t>this.x2+n)return!1}else if(t<this.x2-n||t>this.x1+n)return!1;if(this.y1<this.y2){if(e<this.y1-n||e>this.y2+n)return!1}else if(e<this.y2-n||e>this.y1+n)return!1;return!0}}!function(t){t[t.POINT=1]="POINT",t[t.PARALLEL=2]="PARALLEL",t[t.COINCIDENT=3]="COINCIDENT",t[t.NONE=4]="NONE"}(fE||(fE={}));class wE{constructor(t,e=0,n=0){this.state=t,this.x=e,this.y=n}}function kE(t,e){const n=(e.x2-e.x1)*(t.y1-e.y1)-(e.y2-e.y1)*(t.x1-e.x1),r=(t.x2-t.x1)*(t.y1-e.y1)-(t.y2-t.y1)*(t.x1-e.x1),i=(e.y2-e.y1)*(t.x2-t.x1)-(e.x2-e.x1)*(t.y2-t.y1);if(i){const e=n/i,o=r/i;return 0<=e&&e<=1&&0<=o&&o<=1?new wE(fE.POINT,t.x1+e*(t.x2-t.x1),t.y1+e*(t.y2-t.y1)):new wE(fE.NONE)}return new wE(0===n||0===r?fE.COINCIDENT:fE.PARALLEL)}function ME(t,e){const n=(e.x2-e.x1)*(t.y1-e.y1)-(e.y2-e.y1)*(t.x1-e.x1),r=(t.x2-t.x1)*(t.y1-e.y1)-(t.y2-t.y1)*(t.x1-e.x1),i=(e.y2-e.y1)*(t.x2-t.x1)-(e.x2-e.x1)*(t.y2-t.y1);if(i){const t=n/i,e=r/i;if(0<=t&&t<=1&&0<=e&&e<=1)return t}return Number.POSITIVE_INFINITY}function SE(t,e,n){const r=new Set;return t.width<=0?(r.add(pE.LEFT),r.add(pE.RIGHT)):e<t.x?r.add(pE.LEFT):e>t.x+t.width&&r.add(pE.RIGHT),t.height<=0?(r.add(pE.TOP),r.add(pE.BOTTOM)):n<t.y?r.add(pE.TOP):n>t.y+t.height&&r.add(pE.BOTTOM),r}function AE(t,e){let n=e.x1,r=e.y1;const i=e.x2,o=e.y2,a=Array.from(SE(t,i,o));if(0===a.length)return!0;let s=SE(t,n,r);for(;0!==s.size;){for(const t of a)if(s.has(t))return!1;if(s.has(pE.RIGHT)||s.has(pE.LEFT)){let e=t.x;s.has(pE.RIGHT)&&(e+=t.width),r+=(e-n)*(o-r)/(i-n),n=e}else{let e=t.y;s.has(pE.BOTTOM)&&(e+=t.height),n+=(e-r)*(i-n)/(o-r),r=e}s=SE(t,n,r)}return!0}function NE(t,e){let n=Number.POSITIVE_INFINITY,r=0;function i(t,i,o,a){let s=ME(e,new EE(t,i,o,a));s=Math.abs(s-.5),s>=0&&s<=1&&(r++,s<n&&(n=s))}return i(t.x,t.y,t.x2,t.y),i(t.x,t.y,t.x,t.y2),r>1?n:(i(t.x,t.y2,t.x2,t.y2),r>1?n:(i(t.x2,t.y,t.x2,t.y2),0===r?-1:n))}function CE(t,e){let n=0;const r=kE(t,new EE(e.x,e.y,e.x2,e.y));n+=r.state===fE.POINT?1:0;const i=kE(t,new EE(e.x,e.y,e.x,e.y2));n+=i.state===fE.POINT?1:0;const o=kE(t,new EE(e.x,e.y2,e.x2,e.y2));n+=o.state===fE.POINT?1:0;const a=kE(t,new EE(e.x2,e.y,e.x2,e.y2));return n+=a.state===fE.POINT?1:0,{top:r,left:i,bottom:o,right:a,count:n}}!function(t){t[t.LEFT=0]="LEFT",t[t.TOP=1]="TOP",t[t.RIGHT=2]="RIGHT",t[t.BOTTOM=3]="BOTTOM"}(pE||(pE={}));class OE{constructor(t,e,n,r){this.x=t,this.y=e,this.width=n,this.height=r}get x2(){return this.x+this.width}get y2(){return this.y+this.height}get cx(){return this.x+this.width/2}get cy(){return this.y+this.height/2}get radius(){return Math.max(this.width,this.height)/2}static from(t){return new OE(t.x,t.y,t.width,t.height)}equals(t){return this.x===t.x&&this.y===t.y&&this.width===t.width&&this.height===t.height}clone(){return new OE(this.x,this.y,this.width,this.height)}add(t){const e=Math.min(this.x,t.x),n=Math.min(this.y,t.y),r=Math.max(this.x2,t.x+t.width),i=Math.max(this.y2,t.y+t.height);this.x=e,this.y=n,this.width=r-e,this.height=i-n}addPoint(t){const e=Math.min(this.x,t.x),n=Math.min(this.y,t.y),r=Math.max(this.x2,t.x),i=Math.max(this.y2,t.y);this.x=e,this.y=n,this.width=r-e,this.height=i-n}toString(){return`Rectangle[x=${this.x}, y=${this.y}, w=${this.width}, h=${this.height}]`}draw(t){t.rect(this.x,this.y,this.width,this.height)}containsPt(t,e){return t>=this.x&&t<=this.x2&&e>=this.y&&e<=this.y2}get area(){return this.width*this.height}intersects(t){return!(this.area<=0||t.width<=0||t.height<=0)&&(t.x+t.width>this.x&&t.y+t.height>this.y&&t.x<this.x2&&t.y<this.y2)}distSquare(t,e){if(this.containsPt(t,e))return 0;const n=SE(this,t,e);return n.has(pE.TOP)?n.has(pE.LEFT)?yE(t,e,this.x,this.y):n.has(pE.RIGHT)?yE(t,e,this.x2,this.y):(this.y-e)*(this.y-e):n.has(pE.BOTTOM)?n.has(pE.LEFT)?yE(t,e,this.x,this.y2):n.has(pE.RIGHT)?yE(t,e,this.x2,this.y2):(e-this.y2)*(e-this.y2):n.has(pE.LEFT)?(this.x-t)*(this.x-t):n.has(pE.RIGHT)?(t-this.x2)*(t-this.x2):0}}class TE{constructor(t,e,n){this.cx=t,this.cy=e,this.radius=n}get x(){return this.cx-this.radius}get x2(){return this.cx+this.radius}get width(){return 2*this.radius}get y(){return this.cy-this.radius}get y2(){return this.cy+this.radius}get height(){return 2*this.radius}static from(t){return new TE(t.cx,t.cy,t.radius)}containsPt(t,e){return yE(this.cx,this.cy,t,e)<this.radius*this.radius}distSquare(t,e){const n=yE(this.cx,this.cy,t,e);if(n<this.radius*this.radius)return 0;const r=Math.sqrt(n)-this.radius;return r*r}draw(t){t.ellipse(this.cx,this.cy,this.radius,this.radius,0,0,2*Math.PI)}}class PE{constructor(t,e=0,n=0,r=0,i=0,o=10,a=10,s=new Float32Array(Math.max(0,o*a)).fill(0)){this.pixelGroup=t,this.i=e,this.j=n,this.pixelX=r,this.pixelY=i,this.width=o,this.height=a,this.area=s}createSub(t,e){return new PE(this.pixelGroup,t.x,t.y,e.x,e.y,t.width,t.height)}static fromPixelRegion(t,e){return new PE(e,0,0,t.x,t.y,Math.ceil(t.width/e),Math.ceil(t.height/e))}copy(t,e){return new PE(this.pixelGroup,this.scaleX(e.x),this.scaleY(e.y),e.x,e.y,t.width,t.height,t.area)}boundX(t){return t<this.i?this.i:t>=this.width?this.width-1:t}boundY(t){return t<this.j?this.j:t>=this.height?this.height-1:t}scaleX(t){return this.boundX(Math.floor((t-this.pixelX)/this.pixelGroup))}scaleY(t){return this.boundY(Math.floor((t-this.pixelY)/this.pixelGroup))}scale(t){const e=this.scaleX(t.x),n=this.scaleY(t.y),r=this.boundX(Math.ceil((t.x+t.width-this.pixelX)/this.pixelGroup)),i=this.boundY(Math.ceil((t.y+t.height-this.pixelY)/this.pixelGroup));return new OE(e,n,r-e,i-n)}invertScaleX(t){return Math.round(t*this.pixelGroup+this.pixelX)}invertScaleY(t){return Math.round(t*this.pixelGroup+this.pixelY)}addPadding(t,e){const n=Math.ceil(e/this.pixelGroup),r=this.boundX(t.x-n),i=this.boundY(t.y-n),o=this.boundX(t.x2+n),a=this.boundY(t.y2+n);return new OE(r,i,o-r,a-i)}get(t,e){return t<0||e<0||t>=this.width||e>=this.height?Number.NaN:this.area[t+e*this.width]}inc(t,e,n){t<0||e<0||t>=this.width||e>=this.height||(this.area[t+e*this.width]+=n)}set(t,e,n){t<0||e<0||t>=this.width||e>=this.height||(this.area[t+e*this.width]=n)}incArea(t,e){if(t.width<=0||t.height<=0||0===e)return;const n=this.width,r=t.width,i=Math.max(0,t.i),o=Math.max(0,t.j),a=Math.min(t.i+t.width,n),s=Math.min(t.j+t.height,this.height);if(!(s<=0||a<=0||i>=n||s>=this.height))for(let l=o;l<s;l++){const o=(l-t.j)*r,s=l*n;for(let n=i;n<a;n++){const r=t.area[n-t.i+o];0!==r&&(this.area[n+s]+=e*r)}}}fill(t){this.area.fill(t)}fillArea(t,e){const n=t.x+t.y*this.width;for(let r=0;r<t.height;r++){const i=n+r*this.width;this.area.fill(e,i,i+t.width)}}fillHorizontalLine(t,e,n,r){const i=t+e*this.width;this.area.fill(r,i,i+n)}fillVerticalLine(t,e,n,r){const i=t+e*this.width;for(let t=0;t<n;t++)this.area[i+t*this.width]=r}clear(){this.area.fill(0)}toString(){let t="";for(let e=0;e<this.height;e++){const n=e*this.width;for(let e=0;e<this.width;e++){t+=this.area[n+e].toFixed(1).padStart(6),t+=" "}t+="\n"}return t}draw(t,e=!0){if(this.width<=0||this.height<=0)return;t.save(),e&&t.translate(this.pixelX,this.pixelY);const n=this.area.reduce(((t,e)=>Math.min(t,e)),Number.POSITIVE_INFINITY),r=this.area.reduce(((t,e)=>Math.max(t,e)),Number.NEGATIVE_INFINITY),i=t=>(t-n)/(r-n);t.scale(this.pixelGroup,this.pixelGroup);for(let e=0;e<this.width;e++)for(let n=0;n<this.height;n++){const r=this.area[e+n*this.width];t.fillStyle=`rgba(0, 0, 0, ${i(r)})`,t.fillRect(e,n,1,1)}t.restore()}drawThreshold(t,e,n=!0){if(!(this.width<=0||this.height<=0)){t.save(),n&&t.translate(this.pixelX,this.pixelY),t.scale(this.pixelGroup,this.pixelGroup);for(let n=0;n<this.width;n++)for(let r=0;r<this.height;r++){const i=this.area[n+r*this.width];t.fillStyle=i>e?"black":"white",t.fillRect(n,r,1,1)}t.restore()}}}function RE(t,e){const n=t=>({x:t.x-e,y:t.y-e,width:t.width+2*e,height:t.height+2*e});return Array.isArray(t)?t.map(n):n(t)}function DE(t,e,n){return LE(Object.assign(xE(t),{distSquare:(e,n)=>mE(t.x1,t.y1,t.x2,t.y2,e,n)}),e,n)}function LE(t,e,n){const r=RE(t,n),i=e.scale(r),o=e.createSub(i,r);return function(t,e,n,r){const i=n*n;for(let o=0;o<t.height;o++)for(let a=0;a<t.width;a++){const s=r(e.invertScaleX(t.i+a),e.invertScaleY(t.j+o));if(0!==s){if(s<i){const e=n-Math.sqrt(s);t.set(a,o,e*e)}}else t.set(a,o,i)}}(o,e,n,((e,n)=>t.distSquare(e,n))),o}function IE(t,e){return{x:t,y:e}}function BE(t,e,n,r){if(0===t.length)return[];const i=function(t){if(t.length<2)return t;let e=0,n=0;return t.forEach((t=>{e+=t.cx,n+=t.cy})),e/=t.length,n/=t.length,t.map((t=>{const r=e-t.cx,i=n-t.cy;return[t,r*r+i*i]})).sort(((t,e)=>t[1]-e[1])).map((t=>t[0]))}(t);return i.map(((t,o)=>{const a=i.slice(0,o);return function(t,e,n,r,i){const o=IE(e.cx,e.cy),a=function(t,e,n){let r=Number.POSITIVE_INFINITY;return e.reduce(((e,i)=>{const o=yE(t.x,t.y,i.cx,i.cy);if(o>r)return e;const a=new EE(t.x,t.y,i.cx,i.cy),s=function(t,e){return t.reduce(((t,n)=>AE(n,e)&&function(t,e){function n(t,n,r,i){let o=ME(e,new EE(t,n,r,i));return o=Math.abs(o-.5),o>=0&&o<=1?1:0}let r=n(t.x,t.y,t.x2,t.y);return r+=n(t.x,t.y,t.x,t.y2),r>1||(r+=n(t.x,t.y2,t.x2,t.y2),r>1||(r+=n(t.x2,t.y,t.x2,t.y2),r>0))}(n,e)?t+1:t),0)}(n,a);return o*(s+1)*(s+1)<r&&(e=i,r=o*(s+1)*(s+1)),e}),null)}(o,n,t);if(null==a)return[];const s=function(t,e,n,r){const i=[],o=[];o.push(t);let a=!0;for(let t=0;t<n&&a;t++)for(a=!1;!a&&o.length>0;){const t=o.pop(),n=FE(e,t),s=n?CE(t,n):null;if(!n||!s||2!==s.count){a||i.push(t);continue}let l=r,c=_E(n,l,s,!0),u=zE(c,o)||zE(c,i),h=jE(c,e);for(;!u&&h&&l>=1;)l/=1.5,c=_E(n,l,s,!0),u=zE(c,o)||zE(c,i),h=jE(c,e);if(!c||u||h||(o.push(new EE(t.x1,t.y1,c.x,c.y)),o.push(new EE(c.x,c.y,t.x2,t.y2)),a=!0),a)continue;l=r,c=_E(n,l,s,!1);let d=zE(c,o)||zE(c,i);for(h=jE(c,e);!d&&h&&l>=1;)l/=1.5,c=_E(n,l,s,!1),d=zE(c,o)||zE(c,i),h=jE(c,e);c&&!d&&(o.push(new EE(t.x1,t.y1,c.x,c.y)),o.push(new EE(c.x,c.y,t.x2,t.y2)),a=!0),a||i.push(t)}for(;o.length>0;)i.push(o.pop());return i}(new EE(o.x,o.y,a.cx,a.cy),t,r,i);return function(t,e){const n=[];for(;t.length>0;){const r=t.pop();if(0===t.length){n.push(r);break}const i=t.pop(),o=new EE(r.x1,r.y1,i.x2,i.y2);FE(e,o)?(n.push(r),t.push(i)):t.push(o)}return n}(s,t)}(e,t,a,n,r)})).flat()}function jE(t,e){return e.some((e=>e.containsPt(t.x,t.y)))}function zE(t,e){return e.some((e=>!!bE(e.x1,e.y1,t.x,t.y,.001)||!!bE(e.x2,e.y2,t.x,t.y,.001)))}function FE(t,e){let n=Number.POSITIVE_INFINITY,r=null;for(const i of t){if(!AE(i,e))continue;const t=NE(i,e);t>=0&&t<n&&(r=i,n=t)}return r}function _E(t,e,n,r){const i=n.top,o=n.left,a=n.bottom,s=n.right;if(r){if(o.state===fE.POINT){if(i.state===fE.POINT)return IE(t.x-e,t.y-e);if(a.state===fE.POINT)return IE(t.x-e,t.y2+e);const n=t.width*t.height;return t.width*(.5*(o.y-t.y+(s.y-t.y)))<.5*n?o.y>s.y?IE(t.x-e,t.y-e):IE(t.x2+e,t.y-e):o.y<s.y?IE(t.x-e,t.y2+e):IE(t.x2+e,t.y2+e)}if(s.state===fE.POINT){if(i.state===fE.POINT)return IE(t.x2+e,t.y-e);if(a.state===fE.POINT)return IE(t.x2+e,t.y2+e)}const n=t.height*t.width;return t.height*(.5*(i.x-t.x+(s.x-t.x)))<.5*n?i.x>a.x?IE(t.x-e,t.y-e):IE(t.x-e,t.y2+e):i.x<a.x?IE(t.x2+e,t.y-e):IE(t.x2+e,t.y2+e)}if(o.state===fE.POINT){if(i.state===fE.POINT)return IE(t.x2+e,t.y2+e);if(a.state===fE.POINT)return IE(t.x2+e,t.y-e);const n=t.height*t.width;return t.width*(.5*(o.y-t.y+(s.y-t.y)))<.5*n?o.y>s.y?IE(t.x2+e,t.y2+e):IE(t.x-e,t.y2+e):o.y<s.y?IE(t.x2+e,t.y-e):IE(t.x-e,t.y-e)}if(s.state===fE.POINT){if(i.state===fE.POINT)return IE(t.x-e,t.y2+e);if(a.state===fE.POINT)return IE(t.x-e,t.y-e)}const l=t.height*t.width;return t.height*(.5*(i.x-t.x+(s.x-t.x)))<.5*l?i.x>a.x?IE(t.x2+e,t.y2+e):IE(t.x2+e,t.y-e):i.x<a.x?IE(t.x-e,t.y2+e):IE(t.x-e,t.y-e)}function ZE(t,e,n,r){if(!(t.closed?n<t.length:n<t.length-1))return!1;const i=t.get(e),o=t.get(n+1);for(let a=e+1;a<=n;a++){const e=t.get(a);if(mE(i.x,i.y,o.x,o.y,e.x,e.y)>r)return!1}return!0}function GE(t,e){switch(t){case-2:return(((3-e)*e-3)*e+1)/6;case-1:return((3*e-6)*e*e+4)/6;case 0:return(((-3*e+3)*e+3)*e+1)/6;case 1:return e*e*e/6;default:throw new Error("unknown error")}}class VE{constructor(t=[],e=!0){this.points=t,this.closed=e}get(t){const e=t,n=this.points.length;return t<0?this.closed?this.get(t+n):this.points[0]:t>=n?this.closed?this.get(t-n):this.points[n-1]:this.points[e]}get length(){return this.points.length}toString(t=1/0){const e=this.points;if(0===e.length)return"";const n="function"==typeof t?t:function(t){if(!Number.isFinite(t))return t=>t;if(0===t)return Math.round;const e=Math.pow(10,t);return t=>Math.round(t*e)/e}(t);let r="M";for(const t of e)r+=`${n(t.x)},${n(t.y)} L`;return r=r.slice(0,-1),this.closed&&(r+=" Z"),r}draw(t){const e=this.points;if(0!==e.length){t.beginPath(),t.moveTo(e[0].x,e[0].y);for(const n of e)t.lineTo(n.x,n.y);this.closed&&t.closePath()}}sample(t){return function(t=8){return e=>{let n=t,r=e.length;if(n>1)for(r=Math.floor(e.length/n);r<3&&n>1;)n-=1,r=Math.floor(e.length/n);const i=[];for(let t=0,o=0;o<r;o++,t+=n)i.push(e.get(t));return new VE(i)}}(t)(this)}simplify(t){return function(t=0){return e=>{if(t<0||e.length<3)return e;const n=[];let r=0;const i=t*t;for(;r<e.length;){let t=r+1;for(;ZE(e,r,t,i);)t++;n.push(e.get(r)),r=t}return new VE(n)}}(t)(this)}bSplines(t){return function(t=6){function e(t,e,n){let r=0,i=0;for(let o=-2;o<=1;o++){const a=t.get(e+o),s=GE(o,n);r+=s*a.x,i+=s*a.y}return{x:r,y:i}}return n=>{if(n.length<3)return n;const r=[],i=n.closed,o=n.length+3-1+(i?0:2);r.push(e(n,2-(i?0:2),0));for(let a=2-(i?0:2);a<o;a++)for(let i=1;i<=t;i++)r.push(e(n,a,i/t));return new VE(r)}}(t)(this)}apply(t){return t(this)}containsElements(t){const e=function(t){if(0===t.length)return null;const e=t[0],n=new OE(e.x,e.y,0,0);for(const e of t)n.addPoint(e);return n}(this.points);return!!e&&t.every((t=>e.containsPt(t.cx,t.cy)&&this.withinArea(t.cx,t.cy)))}withinArea(t,e){if(0===this.length)return!1;let n=0;const r=this.points[0],i=new EE(r.x,r.y,r.x,r.y);for(let r=1;r<this.points.length;r++){const o=this.points[r];i.x1=i.x2,i.y1=i.y2,i.x2=o.x,i.y2=o.y,i.cuts(t,e)&&n++}return i.x1=i.x2,i.y1=i.y2,i.x2=r.x,i.y2=r.y,i.cuts(t,e)&&n++,n%2==1}}class WE{constructor(t=0){this.count=0,this.arr=[],this.set=new Set,this.arr.length=t}add(t){this.set.add(`${t.x}x${t.y}`),this.arr[this.count++]=t}contains(t){return this.set.has(`${t.x}x${t.y}`)}isFirst(t){if(0===this.count)return!1;const e=this.arr[0];return null!=e&&e.x===t.x&&e.y===t.y}path(){return new VE(this.arr.slice(0,this.count))}clear(){this.set.clear(),this.count=0}get(t){return this.arr[t]}get length(){return this.count}}function HE(t,e){const n=2*(Math.floor(t.width)+Math.floor(t.height)),r=new WE(n);function i(n,r,i,o){const a=t.get(n,r);return Number.isNaN(a)?Number.NaN:a>e?i+o:i}function o(t,e){let n=0;return n=i(t,e,n,1),n=i(t+1,e,n,2),n=i(t,e+1,n,4),n=i(t+1,e+1,n,8),Number.isNaN(n)?-1:n}let a=1;function s(e,n){let i=e,s=n,l=t.invertScaleX(i),c=t.invertScaleY(s);for(let e=0;e<t.width*t.height;e++){const e={x:l,y:c};if(r.contains(e)){if(r.isFirst(e))return!0}else r.add(e);const n=o(i,s);switch(n){case-1:return!0;case 0:case 3:case 2:case 7:a=2;break;case 12:case 14:case 4:a=3;break;case 6:a=0===a?3:2;break;case 1:case 13:case 5:a=0;break;case 9:a=2===a?0:1;break;case 10:case 8:case 11:a=1;break;default:return console.warn("Marching squares invalid state: "+n),!0}switch(a){case 0:s--,c-=t.pixelGroup;break;case 1:s++,c+=t.pixelGroup;break;case 3:i--,l-=t.pixelGroup;break;case 2:i++,l+=t.pixelGroup;break;default:return console.warn("Marching squares invalid state: "+n),!0}}return!0}for(let n=0;n<t.width;n++)for(let i=0;i<t.height;i++){if(t.get(n,i)<=e)continue;const a=o(n,i);if(!(a<0||15===a)&&s(n,i))return r.path()}return null}const UE={maxRoutingIterations:100,maxMarchingIterations:20,pixelGroup:4,edgeR0:10,edgeR1:20,nodeR0:15,nodeR1:50,morphBuffer:10,threshold:1,memberInfluenceFactor:1,edgeInfluenceFactor:1,nonMemberInfluenceFactor:-.8,virtualEdges:!0};function YE(t){return null!=t&&"number"==typeof t.radius}function qE(t,e){if(YE(t)!==YE(e))return!1;if(YE(t)){const n=e;return t.cx===n.cx&&t.cy===n.cy&&t.radius===n.radius}const n=e;return t.x===n.x&&t.y===n.y&&t.width===n.width&&t.height===n.height}var XE;!function(t){t[t.MEMBERS=0]="MEMBERS",t[t.NON_MEMBERS=1]="NON_MEMBERS",t[t.EDGES=2]="EDGES"}(XE||(XE={}));class KE{constructor(t={}){this.dirty=new Set,this.members=[],this.nonMembers=[],this.virtualEdges=[],this.edges=[],this.activeRegion=new OE(0,0,0,0),this.potentialArea=new PE(1,0,0,0,0,0,0),this.o=Object.assign({},UE,t)}pushMember(...t){if(0!==t.length){this.dirty.add(XE.MEMBERS);for(const e of t)this.members.push({raw:e,obj:YE(e)?TE.from(e):OE.from(e),area:null})}}removeMember(t){const e=this.members.findIndex((e=>qE(e.raw,t)));return!(e<0)&&(this.members.splice(e,1),this.dirty.add(XE.MEMBERS),!0)}removeNonMember(t){const e=this.nonMembers.findIndex((e=>qE(e.raw,t)));return!(e<0)&&(this.nonMembers.splice(e,1),this.dirty.add(XE.NON_MEMBERS),!0)}removeEdge(t){const e=this.edges.findIndex((e=>e.obj.equals(t)));return!(e<0)&&(this.edges.splice(e,1),this.dirty.add(XE.NON_MEMBERS),!0)}pushNonMember(...t){if(0!==t.length){this.dirty.add(XE.NON_MEMBERS);for(const e of t)this.nonMembers.push({raw:e,obj:YE(e)?TE.from(e):OE.from(e),area:null})}}pushEdge(...t){if(0!==t.length){this.dirty.add(XE.EDGES);for(const e of t)this.edges.push({raw:e,obj:EE.from(e),area:null})}}update(){const t=this.dirty.has(XE.MEMBERS),e=this.dirty.has(XE.NON_MEMBERS);let n=this.dirty.has(XE.EDGES);this.dirty.clear();const r=this.members.map((t=>t.obj));if(this.o.virtualEdges&&(t||e)){const t=BE(r,this.nonMembers.map((t=>t.obj)),this.o.maxRoutingIterations,this.o.morphBuffer),e=new Map(this.virtualEdges.map((t=>[t.obj.toString(),t.area])));this.virtualEdges=t.map((t=>{var n;return{raw:t,obj:t,area:null!==(n=e.get(t.toString()))&&void 0!==n?n:null}})),n=!0}let i=!1;if(t||n){const t=function(t,e){if(0===t.length)return new OE(0,0,0,0);const n=OE.from(t[0]);for(const e of t)n.add(e);for(const t of e)n.add(xE(t));return n}(r,this.virtualEdges.concat(this.edges).map((t=>t.obj))),e=Math.max(this.o.edgeR1,this.o.nodeR1)+this.o.morphBuffer,n=OE.from(RE(t,e));n.equals(this.activeRegion)||(i=!0,this.activeRegion=n)}if(i){const t=Math.ceil(this.activeRegion.width/this.o.pixelGroup),e=Math.ceil(this.activeRegion.height/this.o.pixelGroup);this.activeRegion.x!==this.potentialArea.pixelX||this.activeRegion.y!==this.potentialArea.pixelY?(this.potentialArea=PE.fromPixelRegion(this.activeRegion,this.o.pixelGroup),this.members.forEach((t=>t.area=null)),this.nonMembers.forEach((t=>t.area=null)),this.edges.forEach((t=>t.area=null)),this.virtualEdges.forEach((t=>t.area=null))):t===this.potentialArea.width&&e===this.potentialArea.height||(this.potentialArea=PE.fromPixelRegion(this.activeRegion,this.o.pixelGroup))}const o=new Map,a=t=>{if(t.area){const e=`${t.obj.width}x${t.obj.height}x${t.obj instanceof OE?"R":"C"}`;o.set(e,t.area)}},s=t=>{if(t.area)return;const e=`${t.obj.width}x${t.obj.height}x${t.obj instanceof OE?"R":"C"}`;if(o.has(e)){const n=o.get(e);return void(t.area=this.potentialArea.copy(n,{x:t.obj.x-this.o.nodeR1,y:t.obj.y-this.o.nodeR1}))}const n=t.obj instanceof OE?function(t,e,n){const r=e.scale(t),i=e.addPadding(r,n),o=e.createSub(i,{x:t.x-n,y:t.y-n}),a=r.x-i.x,s=r.y-i.y,l=i.x2-r.x2,c=i.y2-r.y2,u=i.width-a-l,h=i.height-s-c,d=n*n;o.fillArea({x:a,y:s,width:u+1,height:h+1},d);const f=[0],p=Math.max(s,a,l,c);{const i=e.invertScaleX(r.x+r.width/2);for(let o=1;o<p;o++){const a=e.invertScaleY(r.y-o),s=t.distSquare(i,a);if(!(s<d))break;{const t=n-Math.sqrt(s);f.push(t*t)}}}const g=[],v=Math.max(a,l),m=Math.max(s,l);for(let i=1;i<v;i++){const o=e.invertScaleX(r.x-i),a=[];for(let i=1;i<m;i++){const s=e.invertScaleY(r.y-i),l=t.distSquare(o,s);if(l<d){const t=n-Math.sqrt(l);a.push(t*t)}else a.push(0)}g.push(a)}for(let t=1;t<Math.min(s,f.length);t++){const e=f[t];o.fillHorizontalLine(a,s-t,u+1,e)}for(let t=1;t<Math.min(c,f.length);t++){const e=f[t];o.fillHorizontalLine(a,s+h+t,u+1,e)}for(let t=1;t<Math.min(a,f.length);t++){const e=f[t];o.fillVerticalLine(a-t,s,h+1,e)}for(let t=1;t<Math.min(c,f.length);t++){const e=f[t];o.fillVerticalLine(a+u+t,s,h+1,e)}for(let t=1;t<a;t++){const e=g[t-1],n=a-t;for(let t=1;t<s;t++)o.set(n,s-t,e[t-1]);for(let t=1;t<c;t++)o.set(n,s+h+t,e[t-1])}for(let t=1;t<l;t++){const e=g[t-1],n=a+u+t;for(let t=1;t<s;t++)o.set(n,s-t,e[t-1]);for(let t=1;t<c;t++)o.set(n,s+h+t,e[t-1])}return o}(t.obj,this.potentialArea,this.o.nodeR1):LE(t.obj,this.potentialArea,this.o.nodeR1);t.area=n,o.set(e,n)};this.members.forEach(a),this.nonMembers.forEach(a),this.members.forEach(s),this.nonMembers.forEach((t=>{this.activeRegion.intersects(t.obj)?s(t):t.area=null})),this.edges.forEach((t=>{t.area||(t.area=DE(t.obj,this.potentialArea,this.o.edgeR1))})),this.virtualEdges.forEach((t=>{t.area||(t.area=DE(t.obj,this.potentialArea,this.o.edgeR1))}))}drawMembers(t){for(const e of this.members)e.obj.draw(t)}drawNonMembers(t){for(const e of this.nonMembers)e.obj.draw(t)}drawEdges(t){for(const e of this.edges)e.obj.draw(t)}drawPotentialArea(t,e=!0){this.potentialArea.draw(t,e)}compute(){if(0===this.members.length)return new VE([]);this.dirty.size>0&&this.update();const{o:t,potentialArea:e}=this,n=this.members.map((t=>t.area)),r=this.virtualEdges.concat(this.edges).map((t=>t.area)),i=this.nonMembers.filter((t=>null!=t.area)).map((t=>t.area)),o=this.members.map((t=>t.obj));return function(t,e,n,r,i,o={}){const a=Object.assign({},UE,o);let s=a.threshold,l=a.memberInfluenceFactor,c=a.edgeInfluenceFactor,u=a.nonMemberInfluenceFactor;const h=(a.nodeR0-a.nodeR1)*(a.nodeR0-a.nodeR1),d=(a.edgeR0-a.edgeR1)*(a.edgeR0-a.edgeR1);for(let o=0;o<a.maxMarchingIterations;o++){if(t.clear(),0!==l){const n=l/h;for(const r of e)t.incArea(r,n)}if(0!==c){const e=c/d;for(const r of n)t.incArea(r,e)}if(0!==u){const e=u/h;for(const n of r)t.incArea(n,e)}const f=HE(t,s);if(f&&i(f))return f;if(s*=.95,o<=.5*a.maxMarchingIterations)l*=1.2,c*=1.2;else{if(!(0!==u&&r.length>0))break;u*=.8}}return new VE([])}(e,n,r,i,(t=>t.containsElements(o)),t)}}var QE=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};class JE extends uE{constructor(t,e){super(t,od({},JE.defaultOptions,e)),this.members=new Map,this.avoidMembers=new Map,this.bubbleSetOptions={},this.drawBubbleSets=()=>{const{style:t,bubbleSetOptions:e}=this.parseOptions();iu(this.bubbleSetOptions,e)||this.init(),this.bubbleSetOptions=Object.assign({},e);const n=Object.assign(Object.assign({},t),{d:this.getPath()});this.shape?this.shape.update(n):(this.shape=new Bf({style:n}),this.context.canvas.appendChild(this.shape))},this.updateBubbleSetsPath=t=>{if(!this.shape)return;const e=Fh(t.data);[...this.options.members,...this.options.avoidMembers].includes(e)&&this.shape.update(Object.assign(Object.assign({},this.parseOptions().style),{d:this.getPath(e)}))},this.getPath=t=>{const{graph:e}=this.context,n=this.options.members,r=[...this.members.keys()],i=this.options.avoidMembers,o=[...this.avoidMembers.keys()];if(!t&&iu(n,r)&&iu(i,o))return this.path;const{enter:a=[],exit:s=[]}=Kh(r,n,(t=>t)),{enter:l=[],exit:c=[]}=Kh(o,i,(t=>t));t&&(s.push(t),a.push(t));const u=(t,n,r)=>{t.forEach((t=>{const i=r?this.members:this.avoidMembers,o=r?"pushMember":"pushNonMember",a=r?"removeMember":"removeNonMember";if(n){let n;"edge"===e.getElementType(t)?([n]=tw(e,t),this.bubbleSets.pushEdge(n)):([n]=$E(e,t),this.bubbleSets[o](n)),i.set(t,n)}else{const n=i.get(t);n&&("edge"===e.getElementType(t)?this.bubbleSets.removeEdge(n):this.bubbleSets[a](n),i.delete(t))}}))};u(s,!1,!0),u(a,!0,!0),u(c,!1,!1),u(l,!0,!1);const h=this.bubbleSets.compute().sample(8).simplify(0).bSplines().simplify(0);return this.path=Lf(h.points.map(Od)),this.path},this.bindEvents(),this.bubbleSets=new KE(this.options)}bindEvents(){this.context.graph.on(pu.AFTER_RENDER,this.drawBubbleSets),this.context.graph.on(pu.AFTER_ELEMENT_UPDATE,this.updateBubbleSetsPath)}init(){this.bubbleSets=new KE(this.options),this.members=new Map,this.avoidMembers=new Map}parseOptions(){const t=this.options,{type:e,key:n,members:r,avoidMembers:i}=t,o=QE(t,["type","key","members","avoidMembers"]),a=Object.keys(o).reduce(((t,e)=>(e in UE?t.bubbleSetOptions[e]=o[e]:t.style[e]=o[e],t)),{style:{},bubbleSetOptions:{}});return Object.assign({type:e,key:n,members:r,avoidMembers:i},a)}addMember(t){const e=Array.isArray(t)?t:[t];e.some((t=>this.options.avoidMembers.includes(t)))&&(this.options.avoidMembers=this.options.avoidMembers.filter((t=>!e.includes(t)))),this.options.members=[...new Set([...this.options.members,...e])],this.drawBubbleSets()}removeMember(t){const e=Array.isArray(t)?t:[t];this.options.members=this.options.members.filter((t=>!e.includes(t))),this.drawBubbleSets()}updateMember(t){this.options.members=en(t)?t(this.options.members):t,this.drawBubbleSets()}getMember(){return this.options.members}addAvoidMember(t){const e=Array.isArray(t)?t:[t];e.some((t=>this.options.members.includes(t)))&&(this.options.members=this.options.members.filter((t=>!e.includes(t)))),this.options.avoidMembers=[...new Set([...this.options.avoidMembers,...e])],this.drawBubbleSets()}removeAvoidMember(t){const e=Array.isArray(t)?t:[t];this.options.avoidMembers.some((t=>e.includes(t)))&&(this.options.avoidMembers=this.options.avoidMembers.filter((t=>!e.includes(t))),this.drawBubbleSets())}updateAvoidMember(t){this.options.avoidMembers=Array.isArray(t)?t:[t],this.drawBubbleSets()}getAvoidMember(){return this.options.avoidMembers}destroy(){this.context.graph.off(pu.AFTER_RENDER,this.drawBubbleSets),this.context.graph.off(pu.AFTER_ELEMENT_UPDATE,this.updateBubbleSetsPath),this.shape.destroy(),super.destroy()}}JE.defaultOptions=Object.assign({members:[],avoidMembers:[],fill:"lightblue",fillOpacity:.2,stroke:"blue",strokeOpacity:.2},UE);const $E=(t,e)=>(Array.isArray(e)?e:[e]).map((e=>{const n=t.getElementRenderBounds(e);return new OE(n.min[0],n.min[1],qu(n),Xu(n))})),tw=(t,e)=>(Array.isArray(e)?e:[e]).map((e=>{const n=t.getEdgeData(e),r=t.getElementPosition(n.source),i=t.getElementPosition(n.target);return EE.from({x1:r[0],y1:r[1],x2:i[0],y2:i[1]})}));var ew=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(t){o(t)}}function s(t){try{l(r.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}))};class nw extends uE{constructor(t,e){super(t,Object.assign({},nw.defaultOptions,e)),this.targetElement=null,this.onTriggerEvent=t=>{var e;null===(e=t.preventDefault)||void 0===e||e.call(t),this.show(t)},this.onMenuItemClick=t=>{const{onClick:e,trigger:n}=this.options;if(t.target instanceof HTMLElement&&t.target.className.includes("g6-contextmenu-li")){const n=t.target.getAttribute("value");null==e||e(n,t.target,this.targetElement),this.hide()}"click"!==n&&this.hide()},this.initElement(),this.update(e)}initElement(){this.$element=hE("contextmenu",!1,{zIndex:"99"});const{className:t}=this.options;t&&this.$element.classList.add(t);this.context.canvas.getContainer().appendChild(this.$element),dE("g6-contextmenu-css","style",{},"\n .g6-contextmenu {\n font-size: 12px;\n background-color: rgba(255, 255, 255, 0.96);\n border-radius: 4px;\n overflow: hidden;\n box-shadow: rgba(0, 0, 0, 0.12) 0px 6px 12px 0px;\n transition: visibility 0.2s cubic-bezier(0.23, 1, 0.32, 1) 0s, left 0.4s cubic-bezier(0.23, 1, 0.32, 1) 0s, top 0.4s cubic-bezier(0.23, 1, 0.32, 1) 0s;\n }\n\n .g6-contextmenu-ul {\n max-width: 256px;\n min-width: 96px;\n list-style: none;\n padding: 0;\n margin: 0;\n }\n\n .g6-contextmenu-li {\n padding: 8px 12px;\n cursor: pointer;\n user-select: none;\n }\n\n .g6-contextmenu-li:hover {\n background-color: #f5f5f5;\n cursor: pointer;\n }\n",document.head)}show(t){return ew(this,void 0,void 0,(function*(){const{enable:e,offset:n}=this.options;if("function"==typeof e&&!e(t)||!e)return void this.hide();const r=yield this.getDOMContent(t);r instanceof HTMLElement?(this.$element.innerHTML="",this.$element.appendChild(r)):this.$element.innerHTML=r;const i=this.context.graph.getCanvas().getContainer().getBoundingClientRect();this.$element.style.left=`${t.client.x-i.left+n[0]}px`,this.$element.style.top=`${t.client.y-i.top+n[1]}px`,this.$element.style.display="block",this.targetElement=t.target}))}hide(){this.$element.style.display="none",this.targetElement=null}update(t){this.unbindEvents(),super.update(t),this.bindEvents()}destroy(){this.unbindEvents(),super.destroy(),this.$element.remove()}getDOMContent(t){return ew(this,void 0,void 0,(function*(){const{getContent:e,getItems:n}=this.options;return n?`\n <ul class="g6-contextmenu-ul">\n ${(yield n(t)).map((t=>`<li class="g6-contextmenu-li" value="${t.value}">${t.name}</li>`)).join("")}\n </ul>\n `:yield e(t)}))}bindEvents(){const{graph:t}=this.context,{trigger:e}=this.options;t.on(`canvas:${e}`,this.onTriggerEvent),t.on(`node:${e}`,this.onTriggerEvent),t.on(`edge:${e}`,this.onTriggerEvent),t.on(`combo:${e}`,this.onTriggerEvent),document.addEventListener("click",this.onMenuItemClick)}unbindEvents(){const{graph:t}=this.context,{trigger:e}=this.options;t.off(`canvas:${e}`,this.onTriggerEvent),t.off(`node:${e}`,this.onTriggerEvent),t.off(`edge:${e}`,this.onTriggerEvent),t.off(`combo:${e}`,this.onTriggerEvent),document.removeEventListener("click",this.onMenuItemClick)}}nw.defaultOptions={trigger:"contextmenu",offset:[4,4],loadingContent:'<div class="g6-contextmenu-loading">Loading...</div>',getContent:()=>"It is a empty context menu.",enable:()=>!0};class rw extends uE{constructor(t,e){super(t,Object.assign({},rw.defaultOptions,e)),this.edgeBundles={},this.edgePoints={},this.onBundle=()=>{const{model:t,element:e}=this.context,n=t.getEdgeData();this.divideEdges(this.options.divisions);const{cycles:r,iterRate:i,divRate:o}=this.options;let{lambda:a,divisions:s,iterations:l}=this.options;for(let t=0;t<r;t++){for(let t=0;t<l;t++){const t={};n.forEach((e=>{var n;if(e.source===e.target)return;const r=Fh(e);t[r]=this.getEdgeForces(e,s,a);for(let e=0;e<s+1;e++)(n=this.edgePoints)[r]||(n[r]=[]),this.edgePoints[r][e]=sd(this.edgePoints[r][e],t[r][e])}))}a/=2,s*=o,l*=i,this.divideEdges(s)}n.forEach((t=>{const n=Fh(t),r=e.getElement(n);null==r||r.update({d:Gg(this.edgePoints[n])})}))},this.bindEvents()}get nodeMap(){const t=this.context.model.getNodeData();return Object.fromEntries(t.map((t=>[Fh(t),yd(Sd(t))])))}divideEdges(t){this.context.model.getEdgeData().forEach((e=>{var n;const r=Fh(e);(n=this.edgePoints)[r]||(n[r]=[]);const i=this.nodeMap[e.source],o=this.nodeMap[e.target];if(1===t)this.edgePoints[r].push(i),this.edgePoints[r].push(ud(sd(i,o),2)),this.edgePoints[r].push(o);else{const e=(0===this.edgePoints[r].length?dd(i,o):uw(this.edgePoints[r]))/(t+1);let n=e;const a=[i];for(let t=1;t<this.edgePoints[r].length;t++){const i=this.edgePoints[r][t-1],o=this.edgePoints[r][t];let s=dd(o,i);for(;s>n;){const t=n/s,r=sd(i,cd(ld(o,i),t));a.push(r),s-=n,n=e}n-=s}a.push(o),this.edgePoints[r]=a}}))}getVectorPosition(t){const e=this.nodeMap[t.source],n=this.nodeMap[t.target],[r,i]=ld(n,e);return{source:e,target:n,vx:r,vy:i,length:dd(e,n)}}measureEdgeCompatibility(t,e){const n=this.getVectorPosition(t),r=this.getVectorPosition(e);return iw(n,r)*ow(n,r)*aw(n,r)*cw(n,r)}getEdgeBundles(){const t={},e=this.options.bundleThreshold,n=this.context.model.getEdgeData();return n.forEach(((r,i)=>{n.forEach(((n,o)=>{var a,s;if(o<=i)return;this.measureEdgeCompatibility(r,n)>=e&&(t[a=Fh(r)]||(t[a]=[]),t[Fh(r)].push(n),t[s=Fh(n)]||(t[s]=[]),t[Fh(n)].push(r))}))})),t}getSpringForce(t,e){const{pre:n,cur:r,next:i}=t;return cd(ld(sd(n,i),cd(r,2)),e)}getElectrostaticForce(t,e){Sf(this.edgeBundles)&&(this.edgeBundles=this.getEdgeBundles());const n=this.edgeBundles[Fh(e)];let r=[0,0];return null==n||n.forEach((n=>{const i=this.edgePoints[Fh(n)][t],o=this.edgePoints[Fh(e)][t],a=ld(i,o),s=dd(i,o);r=sd(r,cd(a,1/s))})),r}getEdgeForces(t,e,n){const r=this.nodeMap[t.source],i=this.nodeMap[t.target],o=this.options.K/(dd(r,i)*(e+1)),a=[[0,0]],s=Fh(t);for(let r=1;r<e;r++){const e=this.getSpringForce({pre:this.edgePoints[s][r-1],cur:this.edgePoints[s][r],next:this.edgePoints[s][r+1]||[0,0]},o),i=this.getElectrostaticForce(r,t);a.push(cd(sd(e,i),n))}return a.push([0,0]),a}bindEvents(){const{graph:t}=this.context;t.on(pu.AFTER_RENDER,this.onBundle)}unbindEvents(){const{graph:t}=this.context;t.off(pu.AFTER_RENDER,this.onBundle)}destroy(){this.unbindEvents(),super.destroy()}}rw.defaultOptions={K:.1,lambda:.1,divisions:1,divRate:2,cycles:6,iterations:90,iterRate:2/3,bundleThreshold:.6};const iw=(t,e)=>Math.abs(function(t,e){return t.reduce(((t,n,r)=>t+n*e[r]),0)}([t.vx,t.vy],[e.vx,e.vy])/(t.length*e.length)),ow=(t,e)=>{const n=(t.length+e.length)/2;return 2/(n/Math.min(t.length,e.length)+Math.max(t.length,e.length)/n)},aw=(t,e)=>{const n=(t.length+e.length)/2;return n/(n+dd(ud(sd(t.source,t.target),2),ud(sd(e.source,e.target),2)))},sw=(t,e)=>{if(e.source[0]===e.target[0])return[e.source[0],t[1]];if(e.source[1]===e.target[1])return[t[0],e.source[1]];const n=(e.source[1]-e.target[1])/(e.source[0]-e.target[0]),r=(n*n*e.source[0]+n*(t[1]-e.source[1])+t[0])/(n*n+1);return[r,n*(r-e.source[0])+e.source[1]]},lw=(t,e)=>{const n=sw(e.source,t),r=sw(e.target,t),i=ud(sd(n,r),2),o=ud(sd(t.source,t.target),2);return 0===dd(n,r)?0:Math.max(0,1-2*dd(o,i)/dd(n,r))},cw=(t,e)=>Math.min(lw(t,e),lw(e,t)),uw=t=>{let e=0;for(let n=1;n<t.length;n++)e+=dd(t[n],t[n-1]);return e},hw={fill:"#fff",fillOpacity:1,lineWidth:1,stroke:"#000",strokeOpacity:.8,zIndex:-1/0};class dw extends uE{constructor(t,e){super(t,Object.assign({},dw.defaultOptions,e)),this.shapes=new Map,this.r=this.options.r,this.onEdgeFilter=t=>{if("drag"===this.options.trigger&&this.isLensOn)return;const e=Od(t.canvas);this.renderLens(e),this.renderFocusElements()},this.renderLens=t=>{const e=Object.assign({},hw,this.options.style);this.isLensOn||(this.lens=new Uf({style:e}),this.canvas.appendChild(this.lens)),Object.assign(e,Td(t),{size:2*this.r}),this.lens.update(e)},this.getFilterData=()=>{const{filter:t}=this.options,{model:e}=this.context,n=e.getData();if(!t)return n;const{nodes:r,edges:i,combos:o}=n;return{nodes:r.filter((e=>t(Fh(e),"node"))),edges:i.filter((e=>t(Fh(e),"edge"))),combos:o.filter((e=>t(Fh(e),"combo")))}},this.getFocusElements=t=>{const{nodes:e,edges:n}=this.getFilterData(),r=e.filter((e=>dd(Sd(e),t)<this.r)),i=r.map((t=>Fh(t)));return{nodes:r,edges:n.filter((t=>{const{source:e,target:n}=t,r=i.includes(e),o=i.includes(n);switch(this.options.nodeType){case"both":return r&&o;case"either":return r!==o;case"source":return r&&!o;case"target":return!r&&o;default:return!1}}))}},this.renderFocusElements=()=>{const{element:t,graph:e}=this.context;if(!this.isLensOn)return;const n=this.lens.getCenter(),{nodes:r,edges:i}=this.getFocusElements(n),o=new Set,a=n=>{const r=Fh(n);o.add(r);const i=t.getElement(r);if(!i)return;const a=this.shapes.get(r)||i.cloneNode();a.setPosition(i.getPosition()),a.id=i.id,this.shapes.has(r)?Object.entries(i.attributes).forEach((([t,e])=>{a.style[t]!==e&&(a.style[t]=e)})):(this.canvas.appendChild(a),this.shapes.set(r,a));const s=e.getElementType(r),l=this.getElementStyle(s,n);a.update(l)};r.forEach(a),i.forEach(a),this.shapes.forEach(((t,e)=>{o.has(e)||(t.destroy(),this.shapes.delete(e))}))},this.scaleRByWheel=t=>{var e;this.options.preventDefault&&t.preventDefault();const{clientX:n,clientY:r,deltaX:i,deltaY:o}=t,{graph:a,canvas:s}=this.context,l=a.getCanvasByClient([n,r]),c=null===(e=this.lens)||void 0===e?void 0:e.getCenter();if(!this.isLensOn||dd(l,c)>this.r)return;const{maxR:u,minR:h}=this.options,d=i+o>0?1/.95:.95,f=Math.min(...s.getSize())/2;this.r=Math.max(h||0,Math.min(u||f,this.r*d)),this.renderLens(c),this.renderFocusElements()},this.isLensDragging=!1,this.onDragStart=t=>{var e;const n=Od(t.canvas),r=null===(e=this.lens)||void 0===e?void 0:e.getCenter();!this.isLensOn||dd(n,r)>this.r||(this.isLensDragging=!0)},this.onDrag=t=>{if(!this.isLensDragging)return;const e=Od(t.canvas);this.renderLens(e),this.renderFocusElements()},this.onDragEnd=()=>{this.isLensDragging=!1},this.bindEvents()}get canvas(){return this.context.canvas.getLayer("transient")}get isLensOn(){return this.lens&&!this.lens.destroyed}getElementStyle(t,e){const n="node"===t?this.options.nodeStyle:this.options.edgeStyle;return"function"==typeof n?n(e):n}get graphDom(){return this.context.graph.getCanvas().getContextService().getDomElement()}bindEvents(){var t;const{graph:e}=this.context,{trigger:n,scaleRBy:r}=this.options,i=e.getCanvas().getLayer();["click","drag"].includes(n)&&i.addEventListener(hu.CLICK,this.onEdgeFilter),"pointermove"===n?i.addEventListener(hu.POINTER_MOVE,this.onEdgeFilter):"drag"===n&&(i.addEventListener(hu.DRAG_START,this.onDragStart),i.addEventListener(hu.DRAG,this.onDrag),i.addEventListener(hu.DRAG_END,this.onDragEnd)),"wheel"===r&&(null===(t=this.graphDom)||void 0===t||t.addEventListener(hu.WHEEL,this.scaleRByWheel,{passive:!1}))}unbindEvents(){var t;const{graph:e}=this.context,{trigger:n,scaleRBy:r}=this.options,i=e.getCanvas().getLayer();["click","drag"].includes(n)&&i.removeEventListener(hu.CLICK,this.onEdgeFilter),"pointermove"===n?i.removeEventListener(hu.POINTER_MOVE,this.onEdgeFilter):"drag"===n&&(i.removeEventListener(hu.DRAG_START,this.onDragStart),i.removeEventListener(hu.DRAG,this.onDrag),i.removeEventListener(hu.DRAG_END,this.onDragEnd)),"wheel"===r&&(null===(t=this.graphDom)||void 0===t||t.removeEventListener(hu.WHEEL,this.scaleRByWheel))}update(t){var e;this.unbindEvents(),super.update(t),this.r=null!==(e=t.r)&&void 0!==e?e:this.r,this.bindEvents()}destroy(){this.unbindEvents(),this.isLensOn&&this.lens.destroy(),this.shapes.forEach(((t,e)=>{t.destroy(),this.shapes.delete(e)})),super.destroy()}}dw.defaultOptions={trigger:"pointermove",r:60,nodeType:"both",filter:()=>!0,style:{lineWidth:2},nodeStyle:{label:!1},edgeStyle:{label:!0},scaleRBy:"wheel",preventDefault:!0};const fw={fill:"#ccc",fillOpacity:.1,lineWidth:2,stroke:"#000",strokeOpacity:.8,labelFontSize:12};class pw extends uE{constructor(t,e){super(t,Object.assign({},pw.defaultOptions,e)),this.r=this.options.r,this.d=this.options.d,this.onCreateFisheye=t=>{if("drag"===this.options.trigger&&this.isLensOn)return;const e=Od(t.canvas);this.onMagnify(e)},this.onMagnify=t=>{t.some(isNaN)||(this.renderLens(t),this.renderFocusElements())},this.renderLens=t=>{const e=Object.assign({},fw,this.options.style);this.isLensOn||(this.lens=new Uf({style:e}),this.canvas.appendChild(this.lens)),Object.assign(e,Td(t),{size:2*this.r,label:this.options.showDPercent,labelText:this.getDPercent()}),this.lens.update(e)},this.getDPercent=()=>{const{minD:t,maxD:e}=this.options;return`${Math.round((this.d-t)/(e-t)*100)}%`},this.prevMagnifiedStyleMap=new Map,this.prevOriginStyleMap=new Map,this.renderFocusElements=()=>{if(!this.isLensOn)return;const{graph:t}=this.context,e=this.lens.getCenter(),n=(this.d+1)*this.r,r=new Map,i=new Map;t.getNodeData().forEach((o=>{const a=Sd(o),s=dd(a,e);if(s>this.r)return;const l=n*s/(this.d*s+this.r),[c,u]=a,[h,d]=e,f=[h+l*((c-h)/s),d+l*((u-d)/s)],p=Fh(o),g=this.getNodeStyle(o),v=gg(t.getElementRenderStyle(p),Object.keys(g));r.set(p,Object.assign(Object.assign({},Td(f)),g)),i.set(p,Object.assign(Object.assign({},Td(a)),v))})),this.updateStyle(r,i)},this.getNodeStyle=t=>{const{nodeStyle:e}=this.options;return"function"==typeof e?e(t):e},this.updateStyle=(t,e)=>{const{graph:n,element:r}=this.context,{enter:i,exit:o,keep:a}=Kh(Array.from(this.prevMagnifiedStyleMap.keys()),Array.from(t.keys()),(t=>t)),s=new Set,l=(t,e)=>{const i=r.getElement(t);null==i||i.update(e),n.getRelatedEdgesData(t).forEach((t=>{s.add(Fh(t))}))};[...i,...a].forEach((e=>{l(e,t.get(e))})),o.forEach((t=>{l(t,this.prevOriginStyleMap.get(t)),this.prevOriginStyleMap.delete(t)})),s.forEach((t=>{const e=r.getElement(t);null==e||e.update({})})),this.prevMagnifiedStyleMap=t,e.forEach(((t,e)=>{this.prevOriginStyleMap.has(e)||this.prevOriginStyleMap.set(e,t)}))},this.isWheelValid=t=>{if(this.options.preventDefault&&t.preventDefault(),!this.isLensOn)return!1;const{clientX:e,clientY:n}=t;return!(dd(this.context.graph.getCanvasByClient([e,n]),this.lens.getCenter())>this.r)},this.scaleR=t=>{const{maxR:e,minR:n}=this.options,r=t?1/.95:.95,i=Math.min(...this.context.canvas.getSize())/2;this.r=Math.max(n||0,Math.min(e||i,this.r*r))},this.scaleD=t=>{const{maxD:e,minD:n}=this.options,r=t?this.d+.1:this.d-.1;this.d=Math.max(n,Math.min(e,r))},this.scaleRByWheel=t=>{if(!this.isWheelValid(t))return;const{deltaX:e,deltaY:n}=t;this.scaleR(e+n>0);const r=this.lens.getCenter();this.onMagnify(r)},this.scaleDByWheel=t=>{if(!this.isWheelValid(t))return;const{deltaX:e,deltaY:n}=t;this.scaleD(e+n>0);const r=this.lens.getCenter();this.onMagnify(r)},this.isDragValid=t=>{if(this.options.preventDefault&&t.preventDefault(),!this.isLensOn)return!1;return!(dd(Od(t.canvas),this.lens.getCenter())>this.r)},this.isLensDragging=!1,this.onDragStart=t=>{this.isDragValid(t)&&(this.isLensDragging=!0)},this.onDrag=t=>{if(!this.isLensDragging)return;const e=Od(t.canvas);this.onMagnify(e)},this.onDragEnd=()=>{this.isLensDragging=!1},this.scaleRByDrag=t=>{if(!this.isLensDragging)return;const{dx:e,dy:n}=t;this.scaleR(e-n>0);const r=this.lens.getCenter();this.onMagnify(r)},this.scaleDByDrag=t=>{if(!this.isLensDragging)return;const{dx:e,dy:n}=t;this.scaleD(e-n>0);const r=this.lens.getCenter();this.onMagnify(r)},this.bindEvents()}get canvas(){return this.context.canvas.getLayer("transient")}get isLensOn(){return this.lens&&!this.lens.destroyed}get graphDom(){return this.context.graph.getCanvas().getContextService().getDomElement()}bindEvents(){var t;const{graph:e}=this.context,{trigger:n,scaleRBy:r,scaleDBy:i}=this.options,o=e.getCanvas().getLayer();if(["click","drag"].includes(n)&&o.addEventListener(hu.CLICK,this.onCreateFisheye),"pointermove"===n&&o.addEventListener(hu.POINTER_MOVE,this.onCreateFisheye),"drag"===n||"drag"===r||"drag"===i){o.addEventListener(hu.DRAG_START,this.onDragStart),o.addEventListener(hu.DRAG_END,this.onDragEnd);const t="drag"===n?this.onDrag:"drag"===r?this.scaleRByDrag:this.scaleDByDrag;o.addEventListener(hu.DRAG,t)}if("wheel"===r||"wheel"===i){const e="wheel"===r?this.scaleRByWheel:this.scaleDByWheel;null===(t=this.graphDom)||void 0===t||t.addEventListener(hu.WHEEL,e,{passive:!1})}}unbindEvents(){var t;const{graph:e}=this.context,{trigger:n,scaleRBy:r,scaleDBy:i}=this.options,o=e.getCanvas().getLayer();if(["click","drag"].includes(n)&&o.removeEventListener(hu.CLICK,this.onCreateFisheye),"pointermove"===n&&o.removeEventListener(hu.POINTER_MOVE,this.onCreateFisheye),"drag"===n||"drag"===r||"drag"===i){o.removeEventListener(hu.DRAG_START,this.onDragStart),o.removeEventListener(hu.DRAG_END,this.onDragEnd);const t="drag"===n?this.onDrag:"drag"===r?this.scaleRByDrag:this.scaleDByDrag;o.removeEventListener(hu.DRAG,t)}if("wheel"===r||"wheel"===i){const e="wheel"===r?this.scaleRByWheel:this.scaleDByWheel;null===(t=this.graphDom)||void 0===t||t.removeEventListener(hu.WHEEL,e)}}update(t){var e,n;this.unbindEvents(),super.update(t),this.r=null!==(e=t.r)&&void 0!==e?e:this.r,this.d=null!==(n=t.d)&&void 0!==n?n:this.d,this.bindEvents()}destroy(){var t;this.unbindEvents(),this.isLensOn&&(null===(t=this.lens)||void 0===t||t.destroy()),this.prevMagnifiedStyleMap.clear(),this.prevOriginStyleMap.clear(),super.destroy()}}pw.defaultOptions={trigger:"pointermove",r:120,d:1.5,maxD:5,minD:0,showDPercent:!0,style:{},nodeStyle:{label:!0},preventDefault:!0};class gw extends uE{constructor(t,e){super(t,Object.assign({},gw.defaultOptions,e)),this.$el=this.context.canvas.getContainer(),this.graphSize=[0,0],this.onFullscreenChange=()=>{var t,e,n,r;const i=!!document.fullscreenElement;this.options.autoFit&&this.setGraphSize(i),i?null===(e=(t=this.options).onEnter)||void 0===e||e.call(t):null===(r=(n=this.options).onExit)||void 0===r||r.call(n)},this.shortcut=new Wd(t.graph),this.bindEvents(),this.style=document.createElement("style"),document.head.appendChild(this.style),this.style.innerHTML="\n :not(:root):fullscreen::backdrop {\n background: transparent;\n }\n "}bindEvents(){this.unbindEvents(),this.shortcut.unbindAll();const{request:t=[],exit:e=[]}=this.options.trigger;this.shortcut.bind(t,this.request),this.shortcut.bind(e,this.exit);["webkitfullscreenchange","mozfullscreenchange","fullscreenchange","MSFullscreenChange"].forEach((t=>{document.addEventListener(t,this.onFullscreenChange,!1)}))}unbindEvents(){this.shortcut.unbindAll();["webkitfullscreenchange","mozfullscreenchange","fullscreenchange","MSFullscreenChange"].forEach((t=>{document.removeEventListener(t,this.onFullscreenChange,!1)}))}setGraphSize(t=!0){var e,n;let r,i;t?(r=(null===(e=globalThis.screen)||void 0===e?void 0:e.width)||0,i=(null===(n=globalThis.screen)||void 0===n?void 0:n.height)||0,this.graphSize=this.context.graph.getSize()):[r,i]=this.graphSize,this.context.graph.setSize(r,i),this.context.graph.render()}request(){!document.fullscreenElement&&(document.fullscreenEnabled||Reflect.get(document,"webkitFullscreenEnabled")||Reflect.get(document,"mozFullscreenEnabled")||Reflect.get(document,"msFullscreenEnabled"))&&this.$el.requestFullscreen().catch((t=>{ku.warn(`Error attempting to enable full-screen: ${t.message} (${t.name})`)}))}exit(){document.fullscreenElement&&document.exitFullscreen()}update(t){this.unbindEvents(),super.update(t),this.bindEvents()}destroy(){this.exit(),this.style.remove(),super.destroy()}}gw.defaultOptions={trigger:{},autoFit:!0};class vw extends uE{constructor(t,e){super(t,Object.assign({},vw.defaultOptions,e)),this.$element=hE("grid-line",!0),this.offset=[0,0],this.currentScale=1,this.followZoom=t=>{const{data:{scale:e,origin:n}}=t;if(!e||void 0===n&&void 0===this.context.viewport)return;const r=this.currentScale;this.currentScale=e;const i=e/r,o=cd(n||this.context.graph.getCanvasCenter(),1-i),a=this.baseSize*e,s=sd(md(cd(this.offset,i),a),o);this.$element.style.backgroundSize=`${a}px ${a}px`,this.$element.style.backgroundPosition=`${s[0]}px ${s[1]}px`,this.offset=md(s,a)},this.followTranslate=t=>{if(!this.options.follow)return;const{data:{translate:e}}=t;e&&this.updateOffset(e)},this.onTransform=t=>{const e=this.parseFollow(this.options.follow);e.zoom&&this.followZoom(t),e.translate&&this.followTranslate(t)};this.context.canvas.getContainer().prepend(this.$element),this.baseSize=this.options.size,this.updateStyle(),this.bindEvents()}update(t){super.update(t),void 0!==t.size&&(this.baseSize=t.size),this.updateStyle()}bindEvents(){const{graph:t}=this.context;t.on(pu.AFTER_TRANSFORM,this.onTransform)}updateStyle(){const{stroke:t,lineWidth:e,border:n,borderLineWidth:r,borderStroke:i,borderStyle:o}=this.options,a=this.baseSize*this.currentScale;Object.assign(this.$element.style,{border:n?`${r}px ${o} ${i}`:"none",backgroundImage:`linear-gradient(${t} ${e}px, transparent ${e}px), linear-gradient(90deg, ${t} ${e}px, transparent ${e}px)`,backgroundSize:`${a}px ${a}px`,backgroundRepeat:"repeat"})}updateOffset(t){const e=this.baseSize*this.currentScale;this.offset=md(sd(this.offset,t),e),this.$element.style.backgroundPosition=`${this.offset[0]}px ${this.offset[1]}px`}parseFollow(t){var e,n;return tn(t)?{translate:t,zoom:t}:{translate:null!==(e=null==t?void 0:t.translate)&&void 0!==e&&e,zoom:null!==(n=null==t?void 0:t.zoom)&&void 0!==n&&n}}destroy(){this.context.graph.off(pu.AFTER_TRANSFORM,this.onTransform),this.$element.remove(),super.destroy()}}function mw(t){const e={Added:new Map,Updated:new Map,Removed:new Map};return t.forEach((t=>{const{type:n,value:r}=t,i=Fh(r);if("NodeAdded"===n||"EdgeAdded"===n||"ComboAdded"===n)e.Added.set(i,t);else if("NodeUpdated"===n||"EdgeUpdated"===n||"ComboUpdated"===n)if(e.Added.has(i))e.Added.set(i,{type:n.replace("Updated","Added"),value:r});else if(e.Updated.has(i)){const{original:t}=e.Updated.get(i);e.Updated.set(i,{type:n,value:r,original:t})}else e.Removed.has(i)||e.Updated.set(i,t);else"NodeRemoved"!==n&&"EdgeRemoved"!==n&&"ComboRemoved"!==n||(e.Added.has(i)?e.Added.delete(i):e.Updated.has(i)?(e.Updated.delete(i),e.Removed.set(i,t)):e.Removed.set(i,t))})),[...Array.from(e.Added.values()),...Array.from(e.Updated.values()),...Array.from(e.Removed.values())]}function yw(t){const{NodeAdded:e=[],NodeUpdated:n=[],NodeRemoved:r=[],EdgeAdded:i=[],EdgeUpdated:o=[],EdgeRemoved:a=[],ComboAdded:s=[],ComboUpdated:l=[],ComboRemoved:c=[]}=_u(t,(t=>t.type));return{add:{nodes:e,edges:i,combos:s},update:{nodes:n,edges:o,combos:l},remove:{nodes:r,edges:a,combos:c}}}function bw(t,e){for(const n in t)nn(t[n])&&!Array.isArray(t[n])&&null!==t[n]?(e[n]||(e[n]={}),bw(t[n],e[n])):void 0===e[n]&&(e[n]=Nu(n))}function xw(t,e=!1,n){const r={animation:e,current:{add:{},update:{},remove:{}},original:{add:{},update:{},remove:{}}},{add:i,update:o,remove:a}=yw(mw(t));return["nodes","edges","combos"].forEach((t=>{o[t]&&o[t].forEach((e=>{var i,o;const a=Object.assign({},e.value);let s=Object.assign({},e.original);if(n){const t=n.graph.getElementType(Fh(e.original)),r="edge"===t?"stroke":"fill",i=n.element.getElementComputedStyle(t,e.original);s=Object.assign(Object.assign({},e.original),{style:Object.assign({[r]:i[r]},e.original.style)})}bw(a,s),(i=r.current.update)[t]||(i[t]=[]),r.current.update[t].push(a),(o=r.original.update)[t]||(o[t]=[]),r.original.update[t].push(s)})),i[t]&&i[t].forEach((e=>{var n,i;const o=Object.assign({},e.value);(n=r.current.add)[t]||(n[t]=[]),r.current.add[t].push(o),(i=r.original.remove)[t]||(i[t]=[]),r.original.remove[t].push(o)})),a[t]&&a[t].forEach((e=>{var n,i;const o=Object.assign({},e.value);(n=r.current.remove)[t]||(n[t]=[]),r.current.remove[t].push(o),(i=r.original.add)[t]||(i[t]=[]),r.original.add[t].push(o)}))})),r}vw.defaultOptions={border:!0,borderLineWidth:1,borderStroke:"#eee",borderStyle:"solid",lineWidth:1,size:20,stroke:"#eee"};class Ew extends uE{constructor(t,e){super(t,Object.assign({},Ew.defaultOptions,e)),this.batchChanges=null,this.batchAnimation=!1,this.undoStack=[],this.redoStack=[],this.freezed=!1,this.executeCommand=(t,e=!0)=>{var n,r,i;this.freezed=!0,null===(r=(n=this.options).executeCommand)||void 0===r||r.call(n,t);const o=e?t.original:t.current;this.context.graph.addData(o.add),this.context.graph.updateData(o.update),this.context.graph.removeData(Zh(o.remove,!1)),null===(i=this.context.element)||void 0===i||i.draw({silence:!0,animation:t.animation}),this.freezed=!1},this.addCommand=t=>{var e;if(!this.freezed){if(t.type===pu.AFTER_DRAW){const{dataChanges:n=[],animation:r=!0}=t.data;if(null===(e=this.context.batch)||void 0===e?void 0:e.isBatching){if(!this.batchChanges)return;return this.batchChanges.push(n),void(this.batchAnimation&&(this.batchAnimation=r))}this.batchChanges=[n],this.batchAnimation=r}this.undoStackPush(xw(this.batchChanges.flat(),this.batchAnimation,this.context)),this.notify(gu.ADD,this.undoStack[this.undoStack.length-1])}},this.initBatchCommand=t=>{const{initiate:e}=t.data;if(this.batchAnimation=!1,e)this.batchChanges=[];else{this.undoStack.pop()||(this.batchChanges=null)}},this.emitter=new Xv;const{graph:n}=this.context;n.on(pu.AFTER_DRAW,this.addCommand),n.on(pu.BATCH_START,this.initBatchCommand),n.on(pu.BATCH_END,this.addCommand)}canUndo(){return this.undoStack.length>0}canRedo(){return this.redoStack.length>0}undo(){var t,e,n,r;const i=this.undoStack.pop();if(i){this.executeCommand(i);if(!1===(null===(e=(t=this.options).beforeAddCommand)||void 0===e?void 0:e.call(t,i,!1)))return;this.redoStack.push(i),null===(r=(n=this.options).afterAddCommand)||void 0===r||r.call(n,i,!1),this.notify(gu.UNDO,i)}return this}redo(){const t=this.redoStack.pop();return t&&(this.executeCommand(t,!1),this.undoStackPush(t),this.notify(gu.REDO,t)),this}undoAndCancel(){const t=this.undoStack.pop();return t&&(this.executeCommand(t,!1),this.redoStack=[],this.notify(gu.CANCEL,t)),this}undoStackPush(t){var e,n,r,i;const{stackSize:o}=this.options;0!==o&&this.undoStack.length>=o&&this.undoStack.shift();!1!==(null===(n=(e=this.options).beforeAddCommand)||void 0===n?void 0:n.call(e,t,!0))&&(this.undoStack.push(t),null===(i=(r=this.options).afterAddCommand)||void 0===i||i.call(r,t,!0))}clear(){this.undoStack=[],this.redoStack=[],this.batchChanges=null,this.batchAnimation=!1,this.notify(gu.CLEAR,null)}notify(t,e){this.emitter.emit(t,{cmd:e}),this.emitter.emit(gu.CHANGE,{cmd:e})}on(t,e){this.emitter.on(t,e)}destroy(){const{graph:t}=this.context;t.off(pu.AFTER_DRAW,this.addCommand),t.off(pu.BATCH_START,this.initBatchCommand),t.off(pu.BATCH_END,this.addCommand),this.emitter.off(),super.destroy(),this.undoStack=[],this.redoStack=[]}}Ew.defaultOptions={stackSize:0};const ww={toXy(t,e){if(!e)return[...t];const n=e[0].slice(1),r=e[1].slice(1);return t.map((t=>[t[n],t[r]]))},fromXy(t,e){if(!e)return[...t];const n=e[0].slice(1),r=e[1].slice(1);return t.map((([t,e])=>({[n]:t,[r]:e})))}};class kw{constructor(t,e){this._cells=[],this._cellSize=e,this._reverseCellSize=1/e;for(const e of t){const t=this.coordToCellNum(e[0]),n=this.coordToCellNum(e[1]);this._cells[t]||(this._cells[t]=[]),this._cells[t][n]||(this._cells[t][n]=[]),this._cells[t][n].push(e)}}cellPoints(t,e){var n;return(null===(n=this._cells[t])||void 0===n?void 0:n[e])||[]}rangePoints(t){const e=this.coordToCellNum(t[0]),n=this.coordToCellNum(t[1]),r=this.coordToCellNum(t[2]),i=this.coordToCellNum(t[3]),o=[];for(let t=e;t<=r;t++)for(let e=n;e<=i;e++){const n=this.cellPoints(t,e);for(const t of n)o.push(t)}return o}removePoint(t){const e=this.coordToCellNum(t[0]),n=this.coordToCellNum(t[1]),r=this._cells[e][n],i=r.findIndex((([e,n])=>e===t[0]&&n===t[1]));return i>-1&&r.splice(i,1),r}trunc(t){return Math.trunc(t)}coordToCellNum(t){return this.trunc(t*this._reverseCellSize)}extendBbox(t,e){return[t[0]-e*this._cellSize,t[1]-e*this._cellSize,t[2]+e*this._cellSize,t[3]+e*this._cellSize]}}const Mw=+(Math.pow(2,27)+1);function Sw(t,e,n){const r=t*e,i=Mw*t,o=i-(i-t),a=t-o,s=Mw*e,l=s-(s-e),c=e-l,u=a*c-(r-o*l-a*l-o*c);return n?(n[0]=u,n[1]=r,n):[u,r]}function Aw(t,e,n){const r=t+e,i=r-t,o=e-i,a=t-(r-i);return n?(n[0]=a+o,n[1]=r,n):[a+o,r]}function Nw(t,e){const n=t.length;if(1===n){const n=Sw(t[0],e);return n[0]?n:[n[1]]}const r=new Array(2*n),i=[.1,.1],o=[.1,.1];let a=0;Sw(t[0],e,i),i[0]&&(r[a++]=i[0]);for(let s=1;s<n;++s){Sw(t[s],e,o);Aw(i[1],o[0],i),i[0]&&(r[a++]=i[0]);const n=o[1],l=i[1],c=n+l,u=l-(c-n);i[1]=c,u&&(r[a++]=u)}return i[1]&&(r[a++]=i[1]),0===a&&(r[a++]=0),r.length=a,r}function Cw(t,e){const n=0|t.length,r=0|e.length;if(1===n&&1===r)return function(t,e){const n=t+e,r=n-t,i=t-(n-r)+(e-r);return i?[i,n]:[n]}(t[0],-e[0]);const i=new Array(n+r);let o=0,a=0,s=0;const l=Math.abs;let c,u,h=t[a],d=l(h),f=-e[s],p=l(f);d<p?(u=h,a+=1,a<n&&(h=t[a],d=l(h))):(u=f,s+=1,s<r&&(f=-e[s],p=l(f))),a<n&&d<p||s>=r?(c=h,a+=1,a<n&&(h=t[a],d=l(h))):(c=f,s+=1,s<r&&(f=-e[s],p=l(f)));let g,v,m,y,b,x=c+u,E=x-c,w=u-E,k=w,M=x;for(;a<n&&s<r;)d<p?(c=h,a+=1,a<n&&(h=t[a],d=l(h))):(c=f,s+=1,s<r&&(f=-e[s],p=l(f))),u=k,x=c+u,E=x-c,w=u-E,w&&(i[o++]=w),g=M+x,v=g-M,m=g-v,y=x-v,b=M-m,k=b+y,M=g;for(;a<n;)c=h,u=k,x=c+u,E=x-c,w=u-E,w&&(i[o++]=w),g=M+x,v=g-M,m=g-v,y=x-v,b=M-m,k=b+y,M=g,a+=1,a<n&&(h=t[a]);for(;s<r;)c=f,u=k,x=c+u,E=x-c,w=u-E,w&&(i[o++]=w),g=M+x,v=g-M,m=g-v,y=x-v,b=M-m,k=b+y,M=g,s+=1,s<r&&(f=-e[s]);return k&&(i[o++]=k),M&&(i[o++]=M),o||(i[o++]=0),i.length=o,i}function Ow(t,e){const n=0|t.length,r=0|e.length;if(1===n&&1===r)return function(t,e){const n=t+e,r=n-t,i=t-(n-r)+(e-r);return i?[i,n]:[n]}(t[0],e[0]);const i=new Array(n+r);let o=0,a=0,s=0;const l=Math.abs;let c,u,h=t[a],d=l(h),f=e[s],p=l(f);d<p?(u=h,a+=1,a<n&&(h=t[a],d=l(h))):(u=f,s+=1,s<r&&(f=e[s],p=l(f))),a<n&&d<p||s>=r?(c=h,a+=1,a<n&&(h=t[a],d=l(h))):(c=f,s+=1,s<r&&(f=e[s],p=l(f)));let g,v,m,y,b,x=c+u,E=x-c,w=u-E,k=w,M=x;for(;a<n&&s<r;)d<p?(c=h,a+=1,a<n&&(h=t[a],d=l(h))):(c=f,s+=1,s<r&&(f=e[s],p=l(f))),u=k,x=c+u,E=x-c,w=u-E,w&&(i[o++]=w),g=M+x,v=g-M,m=g-v,y=x-v,b=M-m,k=b+y,M=g;for(;a<n;)c=h,u=k,x=c+u,E=x-c,w=u-E,w&&(i[o++]=w),g=M+x,v=g-M,m=g-v,y=x-v,b=M-m,k=b+y,M=g,a+=1,a<n&&(h=t[a]);for(;s<r;)c=f,u=k,x=c+u,E=x-c,w=u-E,w&&(i[o++]=w),g=M+x,v=g-M,m=g-v,y=x-v,b=M-m,k=b+y,M=g,s+=1,s<r&&(f=e[s]);return k&&(i[o++]=k),M&&(i[o++]=M),o||(i[o++]=0),i.length=o,i}function Tw(t,e,n,r){return function(n,i,o){const a=t(t(e(i[1],o[0]),e(-o[1],i[0])),t(e(n[1],i[0]),e(-i[1],n[0]))),s=t(e(n[1],o[0]),e(-o[1],n[0])),l=r(a,s);return l[l.length-1]}}function Pw(t,e,n,r){return function(i,o,a,s){const l=t(t(n(t(e(a[1],s[0]),e(-s[1],a[0])),o[2]),t(n(t(e(o[1],s[0]),e(-s[1],o[0])),-a[2]),n(t(e(o[1],a[0]),e(-a[1],o[0])),s[2]))),t(n(t(e(o[1],s[0]),e(-s[1],o[0])),i[2]),t(n(t(e(i[1],s[0]),e(-s[1],i[0])),-o[2]),n(t(e(i[1],o[0]),e(-o[1],i[0])),s[2])))),c=t(t(n(t(e(a[1],s[0]),e(-s[1],a[0])),i[2]),t(n(t(e(i[1],s[0]),e(-s[1],i[0])),-a[2]),n(t(e(i[1],a[0]),e(-a[1],i[0])),s[2]))),t(n(t(e(o[1],a[0]),e(-a[1],o[0])),i[2]),t(n(t(e(i[1],a[0]),e(-a[1],i[0])),-o[2]),n(t(e(i[1],o[0]),e(-o[1],i[0])),a[2])))),u=r(l,c);return u[u.length-1]}}function Rw(t,e,n,r){return function(i,o,a,s,l){const c=t(t(t(n(t(n(t(e(s[1],l[0]),e(-l[1],s[0])),a[2]),t(n(t(e(a[1],l[0]),e(-l[1],a[0])),-s[2]),n(t(e(a[1],s[0]),e(-s[1],a[0])),l[2]))),o[3]),t(n(t(n(t(e(s[1],l[0]),e(-l[1],s[0])),o[2]),t(n(t(e(o[1],l[0]),e(-l[1],o[0])),-s[2]),n(t(e(o[1],s[0]),e(-s[1],o[0])),l[2]))),-a[3]),n(t(n(t(e(a[1],l[0]),e(-l[1],a[0])),o[2]),t(n(t(e(o[1],l[0]),e(-l[1],o[0])),-a[2]),n(t(e(o[1],a[0]),e(-a[1],o[0])),l[2]))),s[3]))),t(n(t(n(t(e(a[1],s[0]),e(-s[1],a[0])),o[2]),t(n(t(e(o[1],s[0]),e(-s[1],o[0])),-a[2]),n(t(e(o[1],a[0]),e(-a[1],o[0])),s[2]))),-l[3]),t(n(t(n(t(e(s[1],l[0]),e(-l[1],s[0])),o[2]),t(n(t(e(o[1],l[0]),e(-l[1],o[0])),-s[2]),n(t(e(o[1],s[0]),e(-s[1],o[0])),l[2]))),i[3]),n(t(n(t(e(s[1],l[0]),e(-l[1],s[0])),i[2]),t(n(t(e(i[1],l[0]),e(-l[1],i[0])),-s[2]),n(t(e(i[1],s[0]),e(-s[1],i[0])),l[2]))),-o[3])))),t(t(n(t(n(t(e(o[1],l[0]),e(-l[1],o[0])),i[2]),t(n(t(e(i[1],l[0]),e(-l[1],i[0])),-o[2]),n(t(e(i[1],o[0]),e(-o[1],i[0])),l[2]))),s[3]),t(n(t(n(t(e(o[1],s[0]),e(-s[1],o[0])),i[2]),t(n(t(e(i[1],s[0]),e(-s[1],i[0])),-o[2]),n(t(e(i[1],o[0]),e(-o[1],i[0])),s[2]))),-l[3]),n(t(n(t(e(a[1],s[0]),e(-s[1],a[0])),o[2]),t(n(t(e(o[1],s[0]),e(-s[1],o[0])),-a[2]),n(t(e(o[1],a[0]),e(-a[1],o[0])),s[2]))),i[3]))),t(n(t(n(t(e(a[1],s[0]),e(-s[1],a[0])),i[2]),t(n(t(e(i[1],s[0]),e(-s[1],i[0])),-a[2]),n(t(e(i[1],a[0]),e(-a[1],i[0])),s[2]))),-o[3]),t(n(t(n(t(e(o[1],s[0]),e(-s[1],o[0])),i[2]),t(n(t(e(i[1],s[0]),e(-s[1],i[0])),-o[2]),n(t(e(i[1],o[0]),e(-o[1],i[0])),s[2]))),a[3]),n(t(n(t(e(o[1],a[0]),e(-a[1],o[0])),i[2]),t(n(t(e(i[1],a[0]),e(-a[1],i[0])),-o[2]),n(t(e(i[1],o[0]),e(-o[1],i[0])),a[2]))),-s[3]))))),u=t(t(t(n(t(n(t(e(s[1],l[0]),e(-l[1],s[0])),a[2]),t(n(t(e(a[1],l[0]),e(-l[1],a[0])),-s[2]),n(t(e(a[1],s[0]),e(-s[1],a[0])),l[2]))),i[3]),n(t(n(t(e(s[1],l[0]),e(-l[1],s[0])),i[2]),t(n(t(e(i[1],l[0]),e(-l[1],i[0])),-s[2]),n(t(e(i[1],s[0]),e(-s[1],i[0])),l[2]))),-a[3])),t(n(t(n(t(e(a[1],l[0]),e(-l[1],a[0])),i[2]),t(n(t(e(i[1],l[0]),e(-l[1],i[0])),-a[2]),n(t(e(i[1],a[0]),e(-a[1],i[0])),l[2]))),s[3]),n(t(n(t(e(a[1],s[0]),e(-s[1],a[0])),i[2]),t(n(t(e(i[1],s[0]),e(-s[1],i[0])),-a[2]),n(t(e(i[1],a[0]),e(-a[1],i[0])),s[2]))),-l[3]))),t(t(n(t(n(t(e(a[1],l[0]),e(-l[1],a[0])),o[2]),t(n(t(e(o[1],l[0]),e(-l[1],o[0])),-a[2]),n(t(e(o[1],a[0]),e(-a[1],o[0])),l[2]))),i[3]),n(t(n(t(e(a[1],l[0]),e(-l[1],a[0])),i[2]),t(n(t(e(i[1],l[0]),e(-l[1],i[0])),-a[2]),n(t(e(i[1],a[0]),e(-a[1],i[0])),l[2]))),-o[3])),t(n(t(n(t(e(o[1],l[0]),e(-l[1],o[0])),i[2]),t(n(t(e(i[1],l[0]),e(-l[1],i[0])),-o[2]),n(t(e(i[1],o[0]),e(-o[1],i[0])),l[2]))),a[3]),n(t(n(t(e(o[1],a[0]),e(-a[1],o[0])),i[2]),t(n(t(e(i[1],a[0]),e(-a[1],i[0])),-o[2]),n(t(e(i[1],o[0]),e(-o[1],i[0])),a[2]))),-l[3])))),h=r(c,u);return h[h.length-1]}}function Dw(t){return(3===t?Tw:4===t?Pw:Rw)(Ow,Sw,Nw,Cw)}const Lw=Dw(3),Iw=Dw(4),Bw=[function(){return 0},function(){return 0},function(t,e){return e[0]-t[0]},function(t,e,n){const r=(t[1]-n[1])*(e[0]-n[0]),i=(t[0]-n[0])*(e[1]-n[1]),o=r-i;let a;if(r>0){if(i<=0)return o;a=r+i}else{if(!(r<0))return o;if(i>=0)return o;a=-(r+i)}const s=33306690738754716e-32*a;return o>=s||o<=-s?o:Lw(t,e,n)},function(t,e,n,r){const i=t[0]-r[0],o=e[0]-r[0],a=n[0]-r[0],s=t[1]-r[1],l=e[1]-r[1],c=n[1]-r[1],u=t[2]-r[2],h=e[2]-r[2],d=n[2]-r[2],f=o*c,p=a*l,g=a*s,v=i*c,m=i*l,y=o*s,b=u*(f-p)+h*(g-v)+d*(m-y),x=7771561172376103e-31*((Math.abs(f)+Math.abs(p))*Math.abs(u)+(Math.abs(g)+Math.abs(v))*Math.abs(h)+(Math.abs(m)+Math.abs(y))*Math.abs(d));return b>x||-b>x?b:Iw(t,e,n,r)}];function jw(t){let e=Bw[t.length];return e||(e=Bw[t.length]=Dw(t.length)),e.apply(void 0,...t)}var zw=function(){for(;Bw.length<=5;)Bw.push(Dw(Bw.length));const t=function(t,e,n,r,i,o,a){return function(...e){switch(e.length){case 0:case 1:return 0;case 2:return r(e[0],e[1]);case 3:return i(e[0],e[1],e[2]);case 4:return o(e[0],e[1],e[2],e[3]);case 5:return a(e[0],e[1],e[2],e[3],e[4])}return t(e)}}(void 0,jw,...Bw);for(let e=0;e<=5;++e)t[e]=Bw[e];return t}();const Fw=zw[3];function _w(t,e,n,r){const i=zw(t,n,r),o=zw(e,n,r);if(i>0&&o>0||i<0&&o<0)return!1;const a=zw(n,t,e),s=zw(r,t,e);return!(a>0&&s>0||a<0&&s<0)&&(0!==i||0!==o||0!==a||0!==s||function(t,e,n,r){for(let i=0;i<2;++i){const o=t[i],a=e[i],[s,l]=[Math.min(o,a),Math.max(o,a)],c=n[i],u=r[i],[h,d]=[Math.min(c,u),Math.max(c,u)];if(d<s||l<h)return!1}return!0}(t,e,n,r))}function Zw(t,e){return Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)}function Gw(t,e,n){const r=[e[0]-t[0],e[1]-t[1]],i=[n[0]-t[0],n[1]-t[1]],o=Zw(t,e),a=Zw(t,n);return(r[0]*i[0]+r[1]*i[1])/Math.sqrt(o*a)}function Vw(t,e){for(let n=0;n<e.length-1;n++){const r=[e[n],e[n+1]];if(!(t[0][0]===r[0][0]&&t[0][1]===r[0][1]||t[0][0]===r[1][0]&&t[0][1]===r[1][1])&&_w(t[0],t[1],r[0],r[1]))return!0}return!1}function Ww(t){return[Math.min(t[0][0],t[1][0]),Math.min(t[0][1],t[1][1]),Math.max(t[0][0],t[1][0]),Math.max(t[0][1],t[1][1])]}function Hw(t,e,n){let r,i,o=null,a=qw,s=qw;for(let l=0;l<e.length;l++)r=Gw(t[0],t[1],e[l]),i=Gw(t[1],t[0],e[l]),r>a&&i>s&&!Vw([t[0],e[l]],n)&&!Vw([t[1],e[l]],n)&&(a=r,s=i,o=e[l]);return o}function Uw(t,e,n,r,i){let o=!1;for(let a=0;a<t.length-1;a++){const s=[t[a],t[a+1]],l=s[0][0]+","+s[0][1]+","+s[1][0]+","+s[1][1];if(Zw(s[0],s[1])<e||i.has(l))continue;let c,u,h,d=0,f=Ww(s);do{f=r.extendBbox(f,d),c=f[2]-f[0],u=f[3]-f[1],h=Hw(s,r.rangePoints(f),t),d++}while(null===h&&(n[0]>c||n[1]>u));c>=n[0]&&u>=n[1]&&i.add(l),null!==h&&(t.splice(a+1,0,h),r.removePoint(h),o=!0)}return o?Uw(t,e,n,r,i):t}function Yw(t,e,n){const r=e||20,i=function(t){const e=[t[0]];let n=t[0];for(let r=1;r<t.length;r++){const i=t[r];n[0]===i[0]&&n[1]===i[1]||e.push(i),n=i}return e}(function(t){return t.sort((function(t,e){return t[0]-e[0]||t[1]-e[1]}))}(ww.toXy(t,n)));if(i.length<4){const t=i.concat([i[0]]);return n?ww.fromXy(t,n):t}const o=function(t){let e=1/0,n=1/0,r=-1/0,i=-1/0;for(let o=t.length-1;o>=0;o--)t[o][0]<e&&(e=t[o][0]),t[o][1]<n&&(n=t[o][1]),t[o][0]>r&&(r=t[o][0]),t[o][1]>i&&(i=t[o][1]);return[r-e,i-n]}(i),a=[o[0]*Xw,o[1]*Xw],s=function(t){const e=t.length;if(e<3){const n=new Array(e);for(let t=0;t<e;++t)n[t]=t;return 2===e&&t[0][0]===t[1][0]&&t[0][1]===t[1][1]?[0]:n}const n=new Array(e);for(let t=0;t<e;++t)n[t]=t;n.sort(((e,n)=>t[e][0]-t[n][0]||t[e][1]-t[n][1]));const r=[n[0],n[1]],i=[n[0],n[1]];for(let o=2;o<e;++o){const e=n[o],a=t[e];let s=r.length;for(;s>1&&Fw(t[r[s-2]],t[r[s-1]],a)<=0;)s-=1,r.pop();for(r.push(e),s=i.length;s>1&&Fw(t[i[s-2]],t[i[s-1]],a)>=0;)s-=1,i.pop();i.push(e)}const o=new Array(i.length+r.length-2);let a=0;for(let t=0,e=r.length;t<e;++t)o[a++]=r[t];for(let t=i.length-2;t>0;--t)o[a++]=i[t];return o}(i).reverse().map((t=>i[t]));s.push(s[0]);const l=i.filter((function(t){return s.indexOf(t)<0})),c=Math.ceil(1/(i.length/(o[0]*o[1]))),u=Uw(s,Math.pow(r,2),a,function(t,e){return new kw(t,e)}(l,c),new Set);return n?ww.fromXy(u,n):u}const qw=Math.cos(90/(180/Math.PI)),Xw=.6;const Kw=(t,e,n)=>{if("sharp"===n)return[["M",t[0]-e,t[1]-e],["L",t[0]+e,t[1]-e],["L",t[0]+e,t[1]+e],["L",t[0]-e,t[1]+e],["Z"]];const r=[e,e,0,0,0];return[["M",t[0],t[1]-e],["A",...r,t[0],t[1]+e],["A",...r,t[0],t[1]-e]]},Qw=(t,e,n)=>{const r=[e,e,0,0,0],i="sharp"===n?sd(t[0],hd(pd(ld(t[0],t[1])),e)):t[0],o="sharp"===n?sd(t[1],hd(pd(ld(t[1],t[0])),e)):t[1],a=hd(pd(vd(ld(i,o),!1)),e),s=hd(a,-1),l=sd(i,a),c=sd(o,a),u=sd(o,s),h=sd(i,s);return"sharp"===n?[["M",l[0],l[1]],["L",c[0],c[1]],["L",u[0],u[1]],["L",h[0],h[1]],["Z"]]:[["M",l[0],l[1]],["L",c[0],c[1]],["A",...r,u[0],u[1]],["L",h[0],h[1]],["A",...r,l[0],l[1]]]},Jw=(t,e)=>{const n=_d(t).map(((n,r)=>{const i=(r-2+t.length)%t.length,o=(r-1+t.length)%t.length,a=(r+1)%t.length,s=t[i],l=t[o],c=t[a],u=ld(s,l),h=ld(l,n),d=ld(n,c),f=(t,e)=>gd(t,e,!0)<Math.PI,p=f(u,h),g=f(h,d),v=t=>hd(pd(vd(t,!1)),e),m=v(h);return[{p:yd(sd(l,p?v(u):m)),concave:p&&l},{p:yd(sd(n,g?v(d):m)),concave:g&&n}]})),r=[e,e,0,0,0],i=n.findIndex(((t,e)=>!(n[(e-1+n.length)%n.length][0].concave||n[(e-1+n.length)%n.length][1].concave||t[0].concave||t[0].concave||t[1].concave))),o=n.slice(i).concat(n.slice(0,i));let a=[];return o.flatMap(((t,e)=>{const i=[],s=o[n.length-1];return 0===e&&i.push(["M",...s[1].p]),t[0].concave?a.push(t[0].p,t[1].p):i.push(["A",...r,...t[0].p]),t[1].concave?a.unshift(t[1].p):i.push(["L",...t[1].p]),3===a.length&&(i.pop(),i.push(["C",...a.flat()]),a=[]),i}))},$w=(t,e)=>{const n=_d(t).map(((e,n)=>({p:e,v:pd(ld(t[(n+1)%t.length],e))})));return n.forEach(((r,i)=>{const o=i>0?i-1:t.length-1,a=n[o].v,s=pd(sd(a,hd(r.v,gd(a,r.v,!0)<Math.PI?1:-1)));r.p=sd(r.p,hd(s,e))})),Lf(n.map((t=>t.p)))},tk=(t,e)=>{const n=t.map(((n,r)=>{const i=t[0===r?t.length-1:r-1],o=bd(hd(pd(vd(ld(i,n),!1)),e));return[sd(i,o),sd(n,o)]})),r=n.flat();return r.map(((t,e)=>{if(e%2==0)return null;return kd([r[(e-1)%r.length],r[e%r.length]],[r[(e+1)%r.length],r[(e+2)%r.length]],!0)})).filter(Boolean).map(((t,e)=>[0===e?"M":"L",t[0],t[1]])).concat([["Z"]])};var ek=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};class nk extends uE{constructor(t,e){super(t,Object.assign({},nk.defaultOptions,e)),this.hullMemberIds=[],this.drawHull=()=>{if(this.shape){const t=!iu(this.optionsCache,this.options);this.shape.update(this.getHullStyle(t))}else this.shape=new Bf({style:this.getHullStyle()}),this.context.canvas.appendChild(this.shape);this.optionsCache=Object.assign({},this.options)},this.updateHullPath=t=>{this.shape&&this.options.members.includes(Fh(t.data))&&this.shape.update({d:this.getHullPath(!0)})},this.getHullPath=(t=!1)=>{const{graph:e}=this.context,n=this.getMember();if(0===n.length)return"";const r=n.map((t=>e.getNodeData(t))),i=Yw(r.map(Sd),this.options.concavity).slice(1).reverse(),o=i.flatMap((t=>r.filter((e=>iu(Sd(e),t))).map(Fh)));return iu(o,this.hullMemberIds)&&!t||(this.hullMemberIds=o,this.path=function(t,e,n){if(1===t.length)return Kw(t[0],e,n);if(2===t.length)return Qw(t,e,n);if(3===t.length){const[r,i,o]=_d(t);if(Ld(r,i,o))return Qw([r,o],e,n)}switch(n){case"smooth":return $w(t,e);case"sharp":return tk(t,e);default:return Jw(t,e)}}(i,this.getPadding(),this.options.corner)),this.path},this.bindEvents()}bindEvents(){this.context.graph.on(pu.AFTER_RENDER,this.drawHull),this.context.graph.on(pu.AFTER_ELEMENT_UPDATE,this.updateHullPath)}unbindEvents(){this.context.graph.off(pu.AFTER_RENDER,this.drawHull),this.context.graph.off(pu.AFTER_ELEMENT_UPDATE,this.updateHullPath)}getHullStyle(t){const e=this.options,{members:n,padding:r,corner:i}=e,o=ek(e,["members","padding","corner"]);return Object.assign(Object.assign({},o),{d:this.getHullPath(t)})}getPadding(){const{graph:t}=this.context,e=this.hullMemberIds.reduce(((e,n)=>{const{halfExtents:r}=t.getElementRenderBounds(n),i=Math.max(r[0],r[1]);return Math.max(e,i)}),0);return e+this.options.padding}addMember(t){const e=Array.isArray(t)?t:[t];this.options.members=[...new Set([...this.options.members,...e])],this.shape.update({d:this.getHullPath()})}removeMember(t){const e=Array.isArray(t)?t:[t];this.options.members=this.options.members.filter((t=>!e.includes(t))),e.some((t=>this.hullMemberIds.includes(t)))&&this.shape.update({d:this.getHullPath()})}updateMember(t){this.options.members=en(t)?t(this.options.members):t,this.shape.update(this.getHullStyle(!0))}getMember(){return this.options.members}destroy(){this.unbindEvents(),this.shape.destroy(),this.hullMemberIds=[],super.destroy()}}function rk(t,e){e(t),t.children&&t.children.forEach((function(t){t&&rk(t,e)}))}function ik(t){ak(t,!0)}function ok(t){ak(t,!1)}function ak(t,e){var n=e?"visible":"hidden";rk(t,(function(t){t.attr("visibility",n)}))}nk.defaultOptions={members:[],padding:10,corner:"rounded",concavity:1/0,fill:"lightblue",fillOpacity:.2,labelOpacity:1,stroke:"blue",strokeOpacity:.2};var sk=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=5),Object.entries(e).forEach((function(i){var o=(0,ce.CR)(i,2),a=o[0],s=o[1],l=t;Object.prototype.hasOwnProperty.call(e,a)&&(s?nd(s)?(nd(t[a])||(l[a]={}),n<r?sk(t[a],s,n+1,r):l[a]=e[a]):Be(s)?(l[a]=[],l[a]=l[a].concat(s)):l[a]=s:l[a]=s)}))},lk=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)sk(t,e[r]);return t},ck=function(t){function e(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=t.apply(this,(0,ce.ev)([],(0,ce.CR)(e),!1))||this;return r.isMutationObserved=!0,r.addEventListener(Ps.INSERTED,(function(){ok(r)})),r}return(0,ce.ZT)(e,t),e}(Al);function uk(t){var e=t.appendChild(new ck({class:"offscreen"}));return ok(e),e}function hk(){ak(this,"hidden"!==this.attributes.visibility)}var dk=function(t){function e(e,n){void 0===n&&(n={});var r=t.call(this,lk({},{style:n},e))||this;return r.initialized=!1,r._defaultOptions=n,r}return(0,ce.ZT)(e,t),Object.defineProperty(e.prototype,"offscreenGroup",{get:function(){return this._offscreen||(this._offscreen=uk(this)),this._offscreen},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"defaultOptions",{get:function(){return this._defaultOptions},enumerable:!1,configurable:!0}),e.prototype.connectedCallback=function(){this.render(this.attributes,this),this.bindEvents(this.attributes,this),this.initialized=!0},e.prototype.disconnectedCallback=function(){var t;null===(t=this._offscreen)||void 0===t||t.destroy()},e.prototype.attributeChangedCallback=function(t){"visibility"===t&&hk.call(this)},e.prototype.update=function(t,e){var n;return this.attr(lk({},this.attributes,t||{})),null===(n=this.render)||void 0===n?void 0:n.call(this,this.attributes,this,e)},e.prototype.clear=function(){this.removeChildren()},e.prototype.bindEvents=function(t,e){},e.prototype.getSubShapeStyle=function(t){t.x,t.y,t.transform,t.transformOrigin,t.class,t.className,t.zIndex;return(0,ce._T)(t,["x","y","transform","transformOrigin","class","className","zIndex"])},e}(Ml);function fk(t){return t.toString().charAt(0).toUpperCase()+t.toString().slice(1)}function pk(t,e,n){var r;void 0===n&&(n=!0);var i=e||(null===(r=t.match(/^([a-z][a-z0-9]+)/))||void 0===r?void 0:r[0])||"",o=t.replace(new RegExp("^(".concat(i,")")),"");return n?function(t){return t.toString().charAt(0).toLowerCase()+t.toString().slice(1)}(o):o}var gk=function(t,e){if(!(null==t?void 0:t.startsWith(e)))return!1;var n=t[e.length];return n>="A"&&n<="Z"};function vk(t,e,n){void 0===n&&(n=!1);var r={};return Object.entries(t).forEach((function(t){var i=(0,ce.CR)(t,2),o=i[0],a=i[1];if("className"===o||"class"===o);else if(gk(o,"show")&&gk(pk(o,"show"),e)!==n)o===function(t,e){return"".concat(e).concat(fk(t))}(e,"show")?r[o]=a:r[o.replace(new RegExp(fk(e)),"")]=a;else if(!gk(o,"show")&&gk(o,e)!==n){var s=pk(o,e);"filter"===s&&"function"==typeof a||(r[s]=a)}})),r}function mk(t,e){return Object.entries(t).reduce((function(t,n){var r=(0,ce.CR)(n,2),i=r[0],o=r[1];return i.startsWith("show")?t["show".concat(e).concat(i.slice(4))]=o:t["".concat(e).concat(fk(i))]=o,t}),{})}function yk(t,e){void 0===e&&(e=["x","y","class","className"]);var n=["transform","transformOrigin","anchor","visibility","pointerEvents","zIndex","cursor","clipPath","clipPathTargets","offsetPath","offsetPathTargets","offsetDistance","draggable","droppable"],r={},i={};return Object.entries(t).forEach((function(t){var o=(0,ce.CR)(t,2),a=o[0],s=o[1];e.includes(a)||(-1!==n.indexOf(a)?i[a]=s:r[a]=s)})),[r,i]}var bk=function(t){if(!Be(t))return[];for(var e=[],n=0;n<t.length;n++)e=e.concat(t[n]);return e},xk=function(t){function e(e){void 0===e&&(e={});var n=e.style,r=(0,ce._T)(e,["style"]);return t.call(this,(0,ce.pi)({style:(0,ce.pi)({text:"",fill:"black",fontFamily:"sans-serif",fontSize:16,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",lineWidth:1,textAlign:"start",textBaseline:"middle"},n)},r))||this}return(0,ce.ZT)(e,t),Object.defineProperty(e.prototype,"offscreenGroup",{get:function(){return this._offscreen||(this._offscreen=uk(this)),this._offscreen},enumerable:!1,configurable:!0}),e.prototype.disconnectedCallback=function(){var t;null===(t=this._offscreen)||void 0===t||t.destroy()},e}(_l);var Ek=function(){function t(t,n,r,i,o,a,s){void 0===t&&(t=null),void 0===n&&(n=null),void 0===r&&(r=null),void 0===i&&(i=null),void 0===o&&(o=[null,null,null,null,null]),void 0===a&&(a=[]),void 0===s&&(s=[]),e.add(this),this._elements=Array.from(t),this._data=n,this._parent=r,this._document=i,this._enter=o[0],this._update=o[1],this._exit=o[2],this._merge=o[3],this._split=o[4],this._transitions=a,this._facetElements=s}var e,n,r;return t.prototype.selectAll=function(t){var e="string"==typeof t?this._parent.querySelectorAll(t):t;return new n(e,null,this._elements[0],this._document)},t.prototype.selectFacetAll=function(t){var e="string"==typeof t?this._parent.querySelectorAll(t):t;return new n(this._elements,null,this._parent,this._document,void 0,void 0,e)},t.prototype.select=function(t){var e="string"==typeof t?this._parent.querySelectorAll(t)[0]||null:t;return new n([e],null,e,this._document)},t.prototype.append=function(t){var e=this,r="function"==typeof t?t:function(){return e.createElement(t)},i=[];if(null!==this._data){for(var o=0;o<this._data.length;o++){var a=this._data[o],s=(0,ce.CR)(Array.isArray(a)?a:[a,null],2),l=s[0],c=s[1];(h=r(l,o)).__data__=l,null!==c&&(h.__fromElements__=c),this._parent.appendChild(h),i.push(h)}return new n(i,null,this._parent,this._document)}for(o=0;o<this._elements.length;o++){var u=this._elements[o],h=r(l=u.__data__,o);u.appendChild(h),i.push(h)}return new n(i,null,i[0],this._document)},t.prototype.maybeAppend=function(t,n){var i=(0,ce.Q_)(this,e,"m",r).call(this,"#"===t[0]?t:"#".concat(t),n);return i.attr("id",t),i},t.prototype.maybeAppendByClassName=function(t,n){var i=t.toString(),o=(0,ce.Q_)(this,e,"m",r).call(this,"."===i[0]?i:".".concat(i),n);return o.attr("className",i),o},t.prototype.maybeAppendByName=function(t,n){var i=(0,ce.Q_)(this,e,"m",r).call(this,'[name="'.concat(t,'"]'),n);return i.attr("name",t),i},t.prototype.data=function(t,e,r){var i,o;void 0===e&&(e=function(t){return t}),void 0===r&&(r=function(){return null});for(var a,s,l,c=[],u=[],h=new Set(this._elements),d=[],f=new Set,p=new Map(this._elements.map((function(t,n){return[e(t.__data__,n),t]}))),g=new Map(this._facetElements.map((function(t,n){return[e(t.__data__,n),t]}))),v=(a=this._elements,s=function(t){return r(t.__data__)},l=new Map,a.forEach((function(t){var e=s(t);l.has(e)||l.set(e,[]),l.get(e).push(t)})),l),m=0;m<t.length;m++){var y=t[m],b=e(y,m),x=r(y,m);if(p.has(b))(M=p.get(b)).__data__=y,M.__facet__=!1,u.push(M),h.delete(M),p.delete(b);else if(g.has(b)){(M=g.get(b)).__data__=y,M.__facet__=!0,u.push(M),g.delete(b)}else if(v.has(b)){var E=v.get(b);d.push([y,E]);try{for(var w=(i=void 0,(0,ce.XA)(E)),k=w.next();!k.done;k=w.next()){var M=k.value;h.delete(M)}}catch(t){i={error:t}}finally{try{k&&!k.done&&(o=w.return)&&o.call(w)}finally{if(i)throw i.error}}v.delete(b)}else if(p.has(x)){(M=p.get(x)).__toData__?M.__toData__.push(y):M.__toData__=[y],f.add(M),h.delete(M)}else c.push(y)}var S=[new n([],c,this._parent,this._document),new n(u,null,this._parent,this._document),new n(h,null,this._parent,this._document),new n([],d,this._parent,this._document),new n(f,null,this._parent,this._document)];return new n(this._elements,null,this._parent,this._document,S)},t.prototype.merge=function(t){var e=(0,ce.ev)((0,ce.ev)([],(0,ce.CR)(this._elements),!1),(0,ce.CR)(t._elements),!1),r=(0,ce.ev)((0,ce.ev)([],(0,ce.CR)(this._transitions),!1),(0,ce.CR)(t._transitions),!1);return new n(e,null,this._parent,this._document,void 0,r)},t.prototype.createElement=function(t){if(this._document)return this._document.createElement(t,{});var e=n.registry[t];return e?new e:function(t){throw new Error(t)}("Unknown node type: ".concat(t))},t.prototype.join=function(t,e,n,r,i){void 0===t&&(t=function(t){return t}),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()});var o=t(this._enter),a=e(this._update),s=n(this._exit),l=r(this._merge),c=i(this._split);return a.merge(o).merge(s).merge(l).merge(c)},t.prototype.remove=function(){for(var t=function(t){var n=e._elements[t],r=e._transitions[t];r?r.then((function(){return n.remove()})):n.remove()},e=this,r=0;r<this._elements.length;r++)t(r);return new n([],null,this._parent,this._document,void 0,this._transitions)},t.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},t.prototype.attr=function(t,e){var n="function"!=typeof e?function(){return e}:e;return this.each((function(r,i){void 0!==e&&(this[t]=n.call(this,r,i))}))},t.prototype.style=function(t,e,n){void 0===n&&(n=!0);var r="function"==typeof e&&n?e:function(){return e};return this.each((function(n,i){void 0!==e&&(this.style[t]=r.call(this,n,i))}))},t.prototype.styles=function(t,e){return void 0===t&&(t={}),void 0===e&&(e=!0),this.each((function(n,r){var i=this;Object.entries(t).forEach((function(t){var o=(0,ce.CR)(t,2),a=o[0],s=o[1],l="function"==typeof s&&e?s:function(){return s};void 0!==s&&i.attr(a,l.call(i,n,r))}))}))},t.prototype.update=function(t,e){void 0===e&&(e=!0);var n="function"==typeof t&&e?t:function(){return t};return this.each((function(e,r){t&&this.update&&this.update(n.call(this,e,r))}))},t.prototype.maybeUpdate=function(t,e){void 0===e&&(e=!0);var n="function"==typeof t&&e?t:function(){return t};return this.each((function(e,r){t&&this.update&&this.update(n.call(this,e,r))}))},t.prototype.transition=function(t){this._transitions;var e=new Array(this._elements.length);return this.each((function(n,r){e[r]=t.call(this,n,r)})),this._transitions=bk(e),this},t.prototype.on=function(t,e){return this.each((function(){this.addEventListener(t,e)})),this},t.prototype.call=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return t.call.apply(t,(0,ce.ev)([this._parent,this],(0,ce.CR)(e),!1)),this},t.prototype.node=function(){return this._elements[0]},t.prototype.nodes=function(){return this._elements},t.prototype.transitions=function(){return this._transitions.filter((function(t){return!!t}))},t.prototype.parent=function(){return this._parent},n=t,e=new WeakSet,r=function(t,e){var r=this._elements[0],i=r.querySelector(t);if(i)return new n([i],null,this._parent,this._document);var o="string"==typeof e?this.createElement(e):e();return r.appendChild(o),new n([o],null,this._parent,this._document)},t.registry={g:Al,rect:zl,circle:wl,path:Dl,text:xk,ellipse:Sl,image:Ol,line:Pl,polygon:Il,polyline:jl,html:Cl},t}();function wk(t){return new Ek([t],null,t,t.ownerDocument)}var kk=function(){function t(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}return Object.defineProperty(t.prototype,"bottom",{get:function(){return this.y+this.height},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"left",{get:function(){return this.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){return this.x+this.width},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"top",{get:function(){return this.y},enumerable:!1,configurable:!0}),t.fromRect=function(e){return new t(e.x,e.y,e.width,e.height)},t.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}},t.prototype.isPointIn=function(t,e){return t>=this.left&&t<=this.right&&e>=this.top&&e<=this.bottom},t}();var Mk=function(t,e){var n=function(t){return"".concat(e,"-").concat(t)},r=Object.fromEntries(Object.entries(t).map((function(t){var e=(0,ce.CR)(t,2),r=e[0],i=e[1],o=n(i);return[r,{name:o,class:".".concat(o),id:"#".concat(o),toString:function(){return o}}]})));return Object.assign(r,{prefix:n}),r};function Sk(t){return/\S+-\S+/g.test(t)?t.split("-").map((function(t){return t[0]})):t.length>2?[t[0]]:t.split("")}function Ak(t){if(ie(t))return[t,t,t,t];if(Be(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 Nk(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)}var Ck=Mk({text:"text"},"title");function Ok(t,e){var n=Object.entries(e).reduce((function(e,n){var r=(0,ce.CR)(n,2),i=r[0],o=r[1];return t.node().attr(i)||(e[i]=o),e}),{});t.styles(n)}var Tk=function(t){function e(e){return t.call(this,e,{text:"",width:0,height:0,fill:"#4a505a",fontWeight:"bold",fontSize:12,fontFamily:"sans-serif",inset:0,spacing:0,position:"top-left"})||this}return(0,ce.ZT)(e,t),e.prototype.getAvailableSpace=function(){var t=this.attributes,e=t.width,n=t.height,r=t.position,i=t.spacing,o=t.inset,a=this.querySelector(Ck.text.class);if(!a)return new kk(0,0,+e,+n);var s=a.getBBox(),l=s.width,c=s.height,u=(0,ce.CR)(Ak(i),4),h=u[0],d=u[1],f=u[2],p=u[3],g=(0,ce.CR)([0,0,+e,+n],4),v=g[0],m=g[1],y=g[2],b=g[3],x=Sk(r);if(x.includes("i"))return new kk(v,m,y,b);x.forEach((function(t,r){var i,o,a,s;"t"===t&&(i=(0,ce.CR)(0===r?[c+f,+n-c-f]:[0,+n],2),m=i[0],b=i[1]),"r"===t&&(o=(0,ce.CR)([+e-l-p],1),y=o[0]),"b"===t&&(a=(0,ce.CR)([+n-c-h],1),b=a[0]),"l"===t&&(s=(0,ce.CR)(0===r?[l+d,+e-l-d]:[0,+e],2),v=s[0],y=s[1])}));var E=(0,ce.CR)(Ak(o),4),w=E[0],k=E[1],M=E[2],S=E[3],A=(0,ce.CR)([S+k,w+M],2),N=A[0],C=A[1];return new kk(v+S,m+w,y-N,b-C)},e.prototype.getBBox=function(){return this.title?this.title.getBBox():new kk(0,0,0,0)},e.prototype.render=function(t,e){var n=this,r=(t.width,t.height,t.position,t.spacing,(0,ce._T)(t,["width","height","position","spacing"])),i=(0,ce.CR)(yk(r),1)[0],o=function(t){var e,n,r,i,o=t,a=o.width,s=o.height,l=o.position,c=(0,ce.CR)([+a/2,+s/2],2),u=c[0],h=c[1],d=(0,ce.CR)([+u,+h,"center","middle"],4),f=d[0],p=d[1],g=d[2],v=d[3],m=Sk(l);return m.includes("l")&&(f=(e=(0,ce.CR)([0,"start"],2))[0],g=e[1]),m.includes("r")&&(f=(n=(0,ce.CR)([+a,"end"],2))[0],g=n[1]),m.includes("t")&&(p=(r=(0,ce.CR)([0,"top"],2))[0],v=r[1]),m.includes("b")&&(p=(i=(0,ce.CR)([+s,"bottom"],2))[0],v=i[1]),{x:f,y:p,textAlign:g,textBaseline:v}}(t),a=o.x,s=o.y,l=o.textAlign,c=o.textBaseline;Nk(!!r.text,wk(e),(function(t){n.title=t.maybeAppendByClassName(Ck.text,"text").styles(i).call(Ok,{x:a,y:s,textAlign:l,textBaseline:c}).node()}))},e}(dk),Pk=function(){};function Rk(t,e){return en(t)?t.apply(void 0,(0,ce.ev)([],(0,ce.CR)(e),!1)):t}function Dk(t){if(!t)return{enter:!1,update:!1,exit:!1};var e=["enter","update","exit"],n=Object.fromEntries(Object.entries(t).filter((function(t){var n=(0,ce.CR)(t,1)[0];return!e.includes(n)})));return Object.fromEntries(e.map((function(e){return function(t){return"boolean"!=typeof t&&"enter"in t&&"update"in t&&"exit"in t}(t)?!1===t[e]?[e,!1]:[e,(0,ce.pi)((0,ce.pi)({},t[e]),n)]:[e,n]})))}function Lk(t,e){t?t.finished.then(e):e()}function Ik(t,e){"update"in t?t.update(e):t.attr(e)}function Bk(t,e,n){return 0===e.length?null:n?t.animate(e,n):(Ik(t,{style:e.slice(-1)[0]}),null)}function jk(t,e,n){var r={},i={};return Object.entries(e).forEach((function(e){var n=(0,ce.CR)(e,2),o=n[0],a=n[1];if(!ae(a)){var s=t.style[o]||t.parsedStyle[o]||0;s!==a&&(r[o]=s,i[o]=a)}})),n?Bk(t,[r,i],(0,ce.pi)({fill:"both"},n)):(Ik(t,i),null)}function zk(t,e,n){void 0===n&&(n=!1);var r=t.getBBox(),i=r.width,o=r.height,a=e/Math.max(i,o);return n&&(t.style.transform="scale(".concat(a,")")),a}var Fk=function(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"]]},_k=Fk,Zk=function(t,e,n){return[["M",t,e+n],["L",t,e-n]]},Gk=function(t,e,n){return[["M",t-n,e],["L",t+n,e]]},Vk=Gk;var Wk=function(t,e,n){return[["M",t-n,e-n],["L",t+n,e],["L",t-n,e+n],["Z"]]},Hk=Mk({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"),Uk=function(t){function e(e){var n=t.call(this,e,{x:0,y:0,animate:{easing:"linear",duration:200,fill:"both"},buttonCursor:"pointer",buttonFill:"black",buttonD:Wk(0,0,6),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 n.playState="idle",n.contentGroup=n.appendChild(new Al({class:Hk.contentGroup.name})),n.playWindow=n.contentGroup.appendChild(new Al({class:Hk.playWindow.name})),n.innerCurrPage=n.defaultPage,n}return(0,ce.ZT)(e,t),Object.defineProperty(e.prototype,"defaultPage",{get:function(){var t=this.attributes.defaultPage;return le(t,0,Math.max(this.pageViews.length-1,0))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pageViews",{get:function(){return this.playWindow.children},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"controllerShape",{get:function(){return this.totalPages>1?{width:55,height:0}:{width:0,height:0}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pageShape",{get:function(){var t=this.pageViews,e=(0,ce.CR)(function(t){var e;return(null===(e=t[0])||void 0===e?void 0:e.map((function(e,n){return t.map((function(t){return t[n]}))})))||[]}(t.map((function(t){var e=t.getBBox();return[e.width,e.height]}))).map((function(t){return Math.max.apply(Math,(0,ce.ev)([],(0,ce.CR)(t),!1))})),2),n=e[0],r=e[1],i=this.attributes,o=i.pageWidth,a=void 0===o?n:o,s=i.pageHeight;return{pageWidth:a,pageHeight:void 0===s?r:s}},enumerable:!1,configurable:!0}),e.prototype.getContainer=function(){return this.playWindow},Object.defineProperty(e.prototype,"totalPages",{get:function(){return this.pageViews.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currPage",{get:function(){return this.innerCurrPage},enumerable:!1,configurable:!0}),e.prototype.getBBox=function(){var e=t.prototype.getBBox.call(this),n=e.x,r=e.y,i=this.controllerShape,o=this.pageShape,a=o.pageWidth,s=o.pageHeight;return new kk(n,r,a+i.width,s)},e.prototype.goTo=function(t){var e=this,n=this.attributes.animate,r=this,i=r.currPage,o=r.playState,a=r.playWindow,s=r.pageViews;if("idle"!==o||t<0||s.length<=0||t>=s.length)return null;s[i].setLocalPosition(0,0),this.prepareFollowingPage(t);var l=(0,ce.CR)(this.getFollowingPageDiff(t),2),c=l[0],u=l[1];this.playState="running";var h=Bk(a,[{transform:"translate(0, 0)"},{transform:"translate(".concat(-c,", ").concat(-u,")")}],n);return Lk(h,(function(){e.innerCurrPage=t,e.playState="idle",e.setVisiblePages([t]),e.updatePageInfo()})),h},e.prototype.prev=function(){var t=this.attributes.loop,e=this.pageViews.length,n=this.currPage;if(!t&&n<=0)return null;var r=t?(n-1+e)%e:le(n-1,0,e);return this.goTo(r)},e.prototype.next=function(){var t=this.attributes.loop,e=this.pageViews.length,n=this.currPage;if(!t&&n>=e-1)return null;var r=t?(n+1)%e:le(n+1,0,e);return this.goTo(r)},e.prototype.renderClipPath=function(t){var e=this.pageShape,n=e.pageWidth,r=e.pageHeight;n&&r?(this.clipPath=t.maybeAppendByClassName(Hk.clipPath,"rect").styles({width:n,height:r}),this.contentGroup.attr("clipPath",this.clipPath.node())):this.contentGroup.style.clipPath=void 0},e.prototype.setVisiblePages=function(t){this.playWindow.children.forEach((function(e,n){t.includes(n)?ik(e):ok(e)}))},e.prototype.adjustControllerLayout=function(){var t=this,e=t.prevBtnGroup,n=t.nextBtnGroup,r=t.pageInfoGroup,i=this.attributes,o=i.orientation,a=i.controllerPadding,s=r.getBBox(),l=s.width,c=(s.height,(0,ce.CR)("horizontal"===o?[-180,0]:[-90,90],2)),u=c[0],h=c[1];e.setLocalEulerAngles(u),n.setLocalEulerAngles(h);var d=e.getBBox(),f=d.width,p=d.height,g=n.getBBox(),v=g.width,m=g.height,y=Math.max(f,l,v),b="horizontal"===o?{offset:[[0,0],[f/2+a,0],[f+l+2*a,0]],textAlign:"start"}:{offset:[[y/2,-p-a],[y/2,0],[y/2,m+a]],textAlign:"center"},x=(0,ce.CR)(b.offset,3),E=(0,ce.CR)(x[0],2),w=E[0],k=E[1],M=(0,ce.CR)(x[1],2),S=M[0],A=M[1],N=(0,ce.CR)(x[2],2),C=N[0],O=N[1],T=b.textAlign,P=r.querySelector("text");P&&(P.style.textAlign=T),e.setLocalPosition(w,k),r.setLocalPosition(S,A),n.setLocalPosition(C,O)},e.prototype.updatePageInfo=function(){var t,e=this,n=e.currPage,r=e.pageViews,i=e.attributes.formatter;r.length<2||(null===(t=this.pageInfoGroup.querySelector(Hk.pageInfo.class))||void 0===t||t.attr("text",i(n+1,r.length)),this.adjustControllerLayout())},e.prototype.getFollowingPageDiff=function(t){var e=this.currPage;if(e===t)return[0,0];var n=this.attributes.orientation,r=this.pageShape,i=r.pageWidth,o=r.pageHeight,a=t<e?-1:1;return"horizontal"===n?[a*i,0]:[0,a*o]},e.prototype.prepareFollowingPage=function(t){var e=this.currPage,n=this.pageViews;if(this.setVisiblePages([t,e]),t!==e){var r=(0,ce.CR)(this.getFollowingPageDiff(t),2),i=r[0],o=r[1];n[t].setLocalPosition(i,o)}},e.prototype.renderController=function(t){var e=this,n=this.attributes.controllerSpacing,r=this.pageShape,i=r.pageWidth,o=r.pageHeight,a=this.pageViews.length>=2,s=t.maybeAppendByClassName(Hk.controller,"g");if(ak(s.node(),a),a){var l=vk(this.attributes,"button"),c=vk(this.attributes,"pageNum"),u=(0,ce.CR)(yk(l),2),h=u[0],d=u[1],f=h.size,p=(0,ce._T)(h,["size"]),g=!s.select(Hk.prevBtnGroup.class).node(),v=s.maybeAppendByClassName(Hk.prevBtnGroup,"g").styles(d);this.prevBtnGroup=v.node();var m=v.maybeAppendByClassName(Hk.prevBtn,"path"),y=s.maybeAppendByClassName(Hk.nextBtnGroup,"g").styles(d);this.nextBtnGroup=y.node(),[m,y.maybeAppendByClassName(Hk.nextBtn,"path")].forEach((function(t){t.styles((0,ce.pi)((0,ce.pi)({},p),{transformOrigin:"center"})),zk(t.node(),f,!0)}));var b=s.maybeAppendByClassName(Hk.pageInfoGroup,"g");this.pageInfoGroup=b.node(),b.maybeAppendByClassName(Hk.pageInfo,"text").styles(c),this.updatePageInfo(),s.node().setLocalPosition(i+n,o/2),g&&(this.prevBtnGroup.addEventListener("click",(function(){e.prev()})),this.nextBtnGroup.addEventListener("click",(function(){e.next()})))}},e.prototype.render=function(t,e){var n=t.x,r=void 0===n?0:n,i=t.y,o=void 0===i?0:i;this.attr("transform","translate(".concat(r,", ").concat(o,")"));var a=wk(e);this.renderClipPath(a),this.renderController(a),this.setVisiblePages([this.defaultPage]),this.goTo(this.defaultPage)},e.prototype.bindEvents=function(){var t=this,e=Vv((function(){return t.render(t.attributes,t)}),50);this.playWindow.addEventListener(Ps.INSERTED,e),this.playWindow.addEventListener(Ps.REMOVED,e)},e}(dk);function Yk(t){var e=function(t){var e="default";if(nn(t)&&t instanceof Image)e="image";else if(en(t))e="symbol";else if(se(t)){var n=new RegExp("data:(image|text)");e=t.match(n)?"base64":/^(https?:\/\/(([a-zA-Z0-9]+-?)+[a-zA-Z0-9]+\.)+[a-zA-Z]+)(:\d+)?(\/.*)?(\?.*)?(#.*)?$/.test(t)?"url":"symbol"}return e}(t);return["base64","url","image"].includes(e)?"image":t&&"symbol"===e?"path":null}var qk=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,ce.ZT)(e,t),e.prototype.render=function(t,n){var r=t.x,i=void 0===r?0:r,o=t.y,a=void 0===o?0:o,s=this.getSubShapeStyle(t),l=s.symbol,c=s.size,u=void 0===c?16:c,h=(0,ce._T)(s,["symbol","size"]),d=Yk(l);Nk(!!d,wk(n),(function(t){t.maybeAppendByClassName("marker",d).attr("className","marker ".concat(d,"-marker")).call((function(t){if("image"===d){var n=2*u;t.styles({img:l,width:n,height:n,x:i-u,y:a-u})}else{n=u/2;var r=en(l)?l:e.getSymbol(l);t.styles((0,ce.pi)({d:null==r?void 0:r(i,a,n)},h))}}))}))},e.MARKER_SYMBOL_MAP=new Map,e.registerSymbol=function(t,n){e.MARKER_SYMBOL_MAP.set(t,n)},e.getSymbol=function(t){return e.MARKER_SYMBOL_MAP.get(t)},e.getSymbols=function(){return Array.from(e.MARKER_SYMBOL_MAP.keys())},e}(dk);qk.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]]})),qk.registerSymbol("hyphen",(function(t,e,n){return[["M",t-n,e],["L",t+n,e]]})),qk.registerSymbol("line",Zk),qk.registerSymbol("plus",(function(t,e,n){return[["M",t-n,e],["L",t+n,e],["M",t,e-n],["L",t,e+n]]})),qk.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]]})),qk.registerSymbol("circle",Fk),qk.registerSymbol("point",_k),qk.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"]]})),qk.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"]]})),qk.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"]]})),qk.registerSymbol("diamond",(function(t,e,n){return[["M",t-n,e],["L",t,e-n],["L",t+n,e],["L",t,e+n],["Z"]]})),qk.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"]]})),qk.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"]]})),qk.registerSymbol("line",Zk),qk.registerSymbol("dot",Gk),qk.registerSymbol("dash",Vk),qk.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]]})),qk.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]]})),qk.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]]})),qk.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]]})),qk.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]]})),qk.registerSymbol("focus",(function(t,e,n){var r=.2*n,i=.7*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"],["M",t-i,e],["L",t-r,e],["M",t+r,e],["L",t+i,e],["M",t,e-i],["L",t,e-r],["M",t,e+r],["L",t,e+i]]}));qk.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"]]})),qk.registerSymbol("verticalHandle",(function(t,e,n){var r=1.4*n,i=n/2,o=n/6,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+o],["L",t+r-2,e+o],["M",a,e-o],["L",t+r-2,e-o]]})),qk.registerSymbol("horizontalHandle",(function(t,e,n){var r=1.4*n,i=n/2,o=n/6,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-o,a],["L",t-o,e+r-2],["M",t+o,a],["L",t+o,e+r-2]]}));var Xk,Kk;function Qk(t,e,n){return void 0===t&&(t="horizontal"),"horizontal"===t?e:n}function Jk(t){var e=t.getLocalBounds(),n=e.min,r=e.max,i=(0,ce.CR)([n,r],2),o=(0,ce.CR)(i[0],2),a=o[0],s=o[1],l=(0,ce.CR)(i[1],2),c=l[0],u=l[1];return{x:a,y:s,width:c-a,height:u-s,left:a,bottom:u,top:s,right:c}}function $k(t,e){var n=(0,ce.CR)(t,2),r=n[0],i=n[1],o=(0,ce.CR)(e,2),a=o[0],s=o[1];return r!==a&&i===s}function tM(t){return"function"==typeof t?t():se(t)||ie(t)?new xk({style:{text:String(t)}}):t}var eM,nM=tE((function(t,e){var n=e.fontSize,r=e.fontFamily,i=e.fontWeight,o=e.fontStyle,a=e.fontVariant;return Kk?Kk(t,n):(Xk||(Xk=ll.offscreenCanvasCreator.getOrCreateContext(void 0)),Xk.font=[o,a,i,"".concat(n,"px"),r].join(" "),Xk.measureText(t).width)}),(function(t,e){return[t,Object.values(e||rM(t)).join()].join("")}),4096),rM=function(t){var e=t.style.fontFamily||"sans-serif",n=t.style.fontWeight||"normal",r=t.style.fontStyle||"normal",i=t.style.fontVariant,o=t.style.fontSize;return{fontSize:o="object"==typeof o?o.value:o,fontFamily:e,fontWeight:n,fontStyle:r,fontVariant:i}};function iM(t){return"text"===t.nodeName?t:"g"===t.nodeName&&1===t.children.length&&"text"===t.children[0].nodeName?t.children[0]:null}function oM(t,e){var n=iM(t);n&&n.attr(e)}function aM(t,e,n){void 0===n&&(n="..."),oM(t,{wordWrap:!0,wordWrapWidth:e,maxLines:1,textOverflow:n})}function sM(t,e){for(var n in e)e.hasOwnProperty(n)&&"constructor"!==n&&void 0!==e[n]&&(t[n]=e[n])}var lM="component-poptip",cM="component-poptip-arrow",uM="component-poptip-text",hM=((eM={})[".".concat(lM)]={visibility:"visible",position:"absolute","background-color":"rgba(0, 0, 0)","box-shadow":"0px 0px 10px #aeaeae","border-radius":"3px",color:"#fff",opacity:.8,"font-size":"12px",padding:"4px 6px",display:"flex","justify-content":"center","align-items":"center","z-index":8,transition:"visibility 50ms"},eM[".".concat(uM)]={"text-align":"center"},eM[".".concat(lM,"[data-position='top']")]={transform:"translate(-50%, -100%)"},eM[".".concat(lM,"[data-position='left']")]={transform:"translate(-100%, -50%)"},eM[".".concat(lM,"[data-position='right']")]={transform:"translate(0, -50%)"},eM[".".concat(lM,"[data-position='bottom']")]={transform:"translate(-50%, 0)"},eM[".".concat(lM,"[data-position='top-left']")]={transform:"translate(0,-100%)"},eM[".".concat(lM,"[data-position='top-right']")]={transform:"translate(-100%,-100%)"},eM[".".concat(lM,"[data-position='left-top']")]={transform:"translate(-100%, 0)"},eM[".".concat(lM,"[data-position='left-bottom']")]={transform:"translate(-100%, -100%)"},eM[".".concat(lM,"[data-position='right-top']")]={transform:"translate(0, 0)"},eM[".".concat(lM,"[data-position='right-bottom']")]={transform:"translate(0, -100%)"},eM[".".concat(lM,"[data-position='bottom-left']")]={transform:"translate(0, 0)"},eM[".".concat(lM,"[data-position='bottom-right']")]={transform:"translate(-100%, 0)"},eM[".".concat(cM)]={width:"4px",height:"4px",transform:"rotate(45deg)","background-color":"rgba(0, 0, 0)",position:"absolute","z-index":-1},eM[".".concat(lM,"[data-position='top']")]={transform:"translate(-50%, calc(-100% - 5px))"},eM["[data-position='top'] .".concat(cM)]={bottom:"-2px"},eM[".".concat(lM,"[data-position='left']")]={transform:"translate(calc(-100% - 5px), -50%)"},eM["[data-position='left'] .".concat(cM)]={right:"-2px"},eM[".".concat(lM,"[data-position='right']")]={transform:"translate(5px, -50%)"},eM["[data-position='right'] .".concat(cM)]={left:"-2px"},eM[".".concat(lM,"[data-position='bottom']")]={transform:"translate(-50%, 5px)"},eM["[data-position='bottom'] .".concat(cM)]={top:"-2px"},eM[".".concat(lM,"[data-position='top-left']")]={transform:"translate(0, calc(-100% - 5px))"},eM["[data-position='top-left'] .".concat(cM)]={left:"10px",bottom:"-2px"},eM[".".concat(lM,"[data-position='top-right']")]={transform:"translate(-100%, calc(-100% - 5px))"},eM["[data-position='top-right'] .".concat(cM)]={right:"10px",bottom:"-2px"},eM[".".concat(lM,"[data-position='left-top']")]={transform:"translate(calc(-100% - 5px), 0)"},eM["[data-position='left-top'] .".concat(cM)]={right:"-2px",top:"8px"},eM[".".concat(lM,"[data-position='left-bottom']")]={transform:"translate(calc(-100% - 5px), -100%)"},eM["[data-position='left-bottom'] .".concat(cM)]={right:"-2px",bottom:"8px"},eM[".".concat(lM,"[data-position='right-top']")]={transform:"translate(5px, 0)"},eM["[data-position='right-top'] .".concat(cM)]={left:"-2px",top:"8px"},eM[".".concat(lM,"[data-position='right-bottom']")]={transform:"translate(5px, -100%)"},eM["[data-position='right-bottom'] .".concat(cM)]={left:"-2px",bottom:"8px"},eM[".".concat(lM,"[data-position='bottom-left']")]={transform:"translate(0, 5px)"},eM["[data-position='bottom-left'] .".concat(cM)]={top:"-2px",left:"8px"},eM[".".concat(lM,"[data-position='bottom-right']")]={transform:"translate(-100%, 5px)"},eM["[data-position='bottom-right'] .".concat(cM)]={top:"-2px",right:"8px"},eM),dM=void 0;function fM(t){var e=t&&document.getElementById(t);return e||((e=document.createElement("div")).setAttribute("id",t),document.body.appendChild(e)),e}function pM(t){var e,n,r=(e=fM,function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return n||(n=e.apply(dM,t)),n})(t);return r}var gM=function(t){function e(n){var r=t.call(this,od({style:{id:"component-poptip"}},e.defaultOptions,n))||this;return r.visibility="visible",r.map=new Map,r.domStyles="",r.initShape(),r.render(r.attributes,r),r}return(0,ce.ZT)(e,t),Object.defineProperty(e.prototype,"visible",{get:function(){return"visible"===this.visibility},enumerable:!1,configurable:!0}),e.prototype.render=function(t,e){this.visibility=this.style.visibility,this.updatePoptipElement()},e.prototype.update=function(t){this.attr(od({},this.style,t)),this.render(this.attributes,this)},e.prototype.bind=function(t,e){var n=this;if(t){var r=this.style.text,i=function(i){var o=t,a=n.style,s=r;if(e){var l="function"==typeof e?e.call(null,i):e,c=l.html,u=l.target,h=(0,ce._T)(l,["html","target"]);a=function(t,e,n,r){return e&&sM(t,e),n&&sM(t,n),r&&sM(t,r),t}({},n.style,h),(u||!1===u)&&(o=u),"string"==typeof c&&(s=c)}var d=a.position,f=a.arrowPointAtCenter,p=a.follow,g=a.offset;if(o){var v=i,m=v.clientX,y=v.clientY,b=(0,ce.CR)(function(t,e,n,r,i,o){if(void 0===i&&(i=!1),void 0===o&&(o=!1),o)return[t,e];var a=n.getBoundingClientRect(),s=a.x,l=a.y,c=a.width,u=a.height;switch(r){case"top":return i?[s+c/2,l]:[t,l];case"left":return i?[s,l+u/2]:[s,e];case"bottom":return i?[s+c/2,l+u]:[t,l+u];case"right":return i?[s+c,l+u/2]:[s+c,e];case"top-right":case"right-top":return[s+c,l];case"left-bottom":case"bottom-left":return[s,l+u];case"right-bottom":case"bottom-right":return[s+c,l+u];default:return[s,l]}}(m,y,o,d,f,p),2),x=b[0],E=b[1];n.showTip(x,E,{text:s,position:d,offset:g})}else n.hideTip()},o=function(){n.hideTip()};t.addEventListener("mousemove",i),t.addEventListener("mouseleave",o),this.map.set(t,[i,o])}},e.prototype.unbind=function(t){if(this.map.has(t)){var e=(0,ce.CR)(this.map.get(t)||[],2),n=e[0],r=e[1];n&&t.removeEventListener("mousemove",n),r&&t.removeEventListener("mouseleave",r),this.map.delete(t)}},e.prototype.clear=function(){this.container.innerHTML=""},e.prototype.destroy=function(){var e,n=this;(0,ce.ev)([],(0,ce.CR)(this.map.keys()),!1).forEach((function(t){return n.unbind(t)})),null===(e=this.container)||void 0===e||e.remove(),t.prototype.destroy.call(this)},e.prototype.showTip=function(t,e,n){var r=nf(n,"text");if((!r||"string"==typeof r)&&(this.applyStyles(),t&&e&&n)){var i=n.offset,o=n.position;if(o&&this.container.setAttribute("data-position",o),this.setOffsetPosition(t,e,i),"string"==typeof r){var a=this.container.querySelector(".".concat(uM));a&&(a.innerHTML=r)}this.visibility="visible",this.container.style.visibility="visible"}},e.prototype.hideTip=function(){this.visibility="hidden",this.container.style.visibility="hidden"},e.prototype.getContainer=function(){return this.container},e.prototype.getClassName=function(){var t=this.style.containerClassName;return"".concat(lM).concat(t?" ".concat(t):"")},e.prototype.initShape=function(){var t=this,e=this.style.id;this.container=pM(e),this.container.className=this.getClassName(),this.container.addEventListener("mousemove",(function(){return t.showTip()})),this.container.addEventListener("mouseleave",(function(){return t.hideTip()}))},e.prototype.updatePoptipElement=function(){var t=this.container;this.clear();var e=this.style,n=e.id,r=e.template,i=e.text;this.container.setAttribute("id",n),this.container.className=this.getClassName();var o,a='<span class="'.concat(cM,'"></span>');t.innerHTML=a,se(r)?t.innerHTML+=r:r&&((o=r)instanceof Element||o instanceof Document)&&t.appendChild(r),i&&(t.getElementsByClassName(uM)[0].textContent=i),this.applyStyles(),this.container.style.visibility=this.visibility},e.prototype.applyStyles=function(){var t=lk({},hM,this.style.domStyles),e=Object.entries(t).reduce((function(t,e){var n=(0,ce.CR)(e,2),r=n[0],i=n[1],o=Object.entries(i).reduce((function(t,e){var n=(0,ce.CR)(e,2),r=n[0],i=n[1];return"".concat(t).concat(r,": ").concat(i,";")}),"");return"".concat(t).concat(r,"{").concat(o,"}")}),"");if(this.domStyles!==e){this.domStyles=e;var n=this.container.querySelector("style");n&&this.container.removeChild(n),(n=document.createElement("style")).innerHTML=e,this.container.appendChild(n)}},e.prototype.setOffsetPosition=function(t,e,n){void 0===n&&(n=this.style.offset);var r=(0,ce.CR)(n,2),i=r[0],o=void 0===i?0:i,a=r[1],s=void 0===a?0:a;this.container.style.left="".concat(t+o,"px"),this.container.style.top="".concat(e+s,"px")},e.tag="poptip",e.defaultOptions={style:{x:0,y:0,width:0,height:0,target:null,visibility:"hidden",text:"",position:"top",follow:!1,offset:[0,0],domStyles:hM,template:'<div class="'.concat(uM,'"></div>')}},e}(dk),vM=Mk({layout:"flex",markerGroup:"marker-group",marker:"marker",labelGroup:"label-group",label:"label",valueGroup:"value-group",focusGroup:"focus-group",focus:"focus",value:"value",backgroundGroup:"background-group",background:"background"},"legend-category-item"),mM={offset:[0,20],domStyles:{".component-poptip":{opacity:"1",padding:"8px 12px",background:"#fff",boxShadow:"0 2px 8px rgba(0, 0, 0, 0.15)"},".component-poptip-arrow":{display:"none"},".component-poptip-text":{color:"#000",lineHeight:"20px"}}};var yM=function(t){function e(e){return t.call(this,e,{span:[1,1],marker:function(){return new wl({style:{r:6}})},markerSize:10,labelFill:"#646464",valueFill:"#646464",labelFontSize:12,valueFontSize:12,labelTextBaseline:"middle",valueTextBaseline:"middle"})||this}return(0,ce.ZT)(e,t),Object.defineProperty(e.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(e.prototype,"actualSpace",{get:function(){var t=this.labelGroup,e=this.valueGroup,n=this.attributes,r=n.markerSize,i=n.focus,o=n.focusMarkerSize,a=t.node().getBBox(),s=a.width,l=a.height,c=e.node().getBBox(),u=c.width,h=c.height;return{markerWidth:r,labelWidth:s,valueWidth:u,focusWidth:i?null!=o?o:12:0,height:Math.max(r,l,h)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"span",{get:function(){var t=this.attributes.span;if(!t)return[1,1];var e=(0,ce.CR)(Ak(t),2),n=e[0],r=e[1],i=this.showValue?r:0,o=n+i;return[n/o,i/o]},enumerable:!1,configurable:!0}),e.prototype.setAttribute=function(e,n){t.prototype.setAttribute.call(this,e,n)},Object.defineProperty(e.prototype,"shape",{get:function(){var t,e=this.attributes,n=e.markerSize,r=e.width,i=this.actualSpace,o=i.markerWidth,a=i.focusWidth,s=i.height,l=this.actualSpace,c=l.labelWidth,u=l.valueWidth,h=(0,ce.CR)(this.spacing,3),d=h[0],f=h[1],p=h[2];if(r){var g=r-n-d-f-a-p,v=(0,ce.CR)(this.span,2),m=v[0],y=v[1];c=(t=(0,ce.CR)([m*g,y*g],2))[0],u=t[1]}return{width:o+c+u+d+f+a+p,height:s,markerWidth:o,labelWidth:c,valueWidth:u,focusWidth:a}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"spacing",{get:function(){var t=this.attributes,e=t.spacing,n=t.focus;if(!e)return[0,0,0];var r=(0,ce.CR)(Ak(e),3),i=r[0],o=r[1],a=r[2];return[i,this.showValue?o:0,n?a:0]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"layout",{get:function(){var t=this.shape,e=t.markerWidth,n=t.labelWidth,r=t.valueWidth,i=t.focusWidth,o=t.width,a=t.height,s=(0,ce.CR)(this.spacing,3),l=s[0],c=s[1];return{height:a,width:o,markerWidth:e,labelWidth:n,valueWidth:r,focusWidth:i,position:[e/2,e+l,e+n+l+c,e+n+r+l+c+s[2]+i/2]}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"scaleSize",{get:function(){var t=function(t){var e=t.querySelector(vM.marker.class);return e?e.style:{}}(this.markerGroup.node()),e=this.attributes,n=e.markerSize,r=e.markerStrokeWidth,i=void 0===r?t.strokeWidth:r,o=e.markerLineWidth,a=void 0===o?t.lineWidth:o,s=e.markerStroke,l=void 0===s?t.stroke:s,c=+(i||a||(l?1:0))*Math.sqrt(2),u=this.markerGroup.node().getBBox(),h=u.width,d=u.height;return(1-c/Math.max(h,d))*n},enumerable:!1,configurable:!0}),e.prototype.renderMarker=function(t){var e=this,n=this.attributes.marker,r=vk(this.attributes,"marker");this.markerGroup=t.maybeAppendByClassName(vM.markerGroup,"g").style("zIndex",0),Nk(!!n,this.markerGroup,(function(){var t,i=e.markerGroup.node(),o=null===(t=i.childNodes)||void 0===t?void 0:t[0],a="string"==typeof n?new qk({style:{symbol:n},className:vM.marker.name}):n();o?a.nodeName===o.nodeName?o instanceof qk?o.update((0,ce.pi)((0,ce.pi)({},r),{symbol:n})):(!function(t,e){var n,r,i=e.attributes;try{for(var o=(0,ce.XA)(Object.entries(i)),a=o.next();!a.done;a=o.next()){var s=(0,ce.CR)(a.value,2),l=s[0],c=s[1];"id"!==l&&"className"!==l&&t.attr(l,c)}}catch(t){n={error:t}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}}(o,a),wk(o).styles(r)):(o.remove(),wk(a).attr("className",vM.marker.name).styles(r),i.appendChild(a)):(a instanceof qk||wk(a).attr("className",vM.marker.name).styles(r),i.appendChild(a)),e.markerGroup.node().scale(1/e.markerGroup.node().getScale()[0]);var s=zk(e.markerGroup.node(),e.scaleSize,!0);e.markerGroup.node().style._transform="scale(".concat(s,")")}))},e.prototype.renderLabel=function(t){var e=vk(this.attributes,"label"),n=e.text,r=(0,ce._T)(e,["text"]);this.labelGroup=t.maybeAppendByClassName(vM.labelGroup,"g").style("zIndex",0),this.labelGroup.maybeAppendByClassName(vM.label,(function(){return tM(n)})).styles(r)},e.prototype.renderValue=function(t){var e=this,n=vk(this.attributes,"value"),r=n.text,i=(0,ce._T)(n,["text"]);this.valueGroup=t.maybeAppendByClassName(vM.valueGroup,"g").style("zIndex",0),Nk(this.showValue,this.valueGroup,(function(){e.valueGroup.maybeAppendByClassName(vM.value,(function(){return tM(r)})).styles(i)}))},e.prototype.createPoptip=function(){var t=this.attributes.poptip||{},e=(t.render,(0,ce._T)(t,["render"])),n=new gM({style:lk(mM,e)});return this.poptipGroup=n,n},e.prototype.bindPoptip=function(t){var e=this,n=this.attributes.poptip;n&&(this.poptipGroup||this.createPoptip()).bind(t,(function(){var t=e.attributes,r=t.labelText,i=t.valueText,o=t.markerFill,a="string"==typeof r?r:null==r?void 0:r.attr("text"),s="string"==typeof i?i:null==i?void 0:i.attr("text");if("function"==typeof n.render)return{html:n.render({label:a,value:s,color:o})};var l="";return"string"!=typeof a&&"number"!=typeof a||(l+='<div class="component-poptip-label">'.concat(a,"</div>")),"string"!=typeof s&&"number"!=typeof s||(l+='<div class="component-poptip-value">'.concat(s,"</div>")),{html:l}}))},e.prototype.renderFocus=function(t){var e=this,n=this.attributes,r=n.focus,i={x:0,y:0,size:n.focusMarkerSize,opacity:.6,symbol:"focus",stroke:"#aaaaaa",lineWidth:1};Qe(r)||(this.focusGroup=t.maybeAppendByClassName(vM.focusGroup,"g").style("zIndex",0),Nk(r,this.focusGroup,(function(){var n=new qk({style:(0,ce.pi)((0,ce.pi)({},i),{symbol:"focus"})}),r=new wl({style:{r:i.size/2,fill:"transparent"}}),o=e.focusGroup.node();o.appendChild(r),o.appendChild(n),n.update({opacity:0}),t.node().addEventListener("pointerenter",(function(){n.update({opacity:1})})),t.node().addEventListener("pointerleave",(function(){n.update({opacity:0})}))})))},e.prototype.renderPoptip=function(t){var e=this;this.attributes.poptip&&[t.maybeAppendByClassName(vM.value,"g").node(),t.maybeAppendByClassName(vM.label,"g").node()].forEach((function(t){t&&e.bindPoptip(t)}))},e.prototype.renderBackground=function(t){var e=this.shape,n=e.width,r=e.height,i=vk(this.attributes,"background");this.background=t.maybeAppendByClassName(vM.backgroundGroup,"g").style("zIndex",-1),this.background.maybeAppendByClassName(vM.background,"rect").styles((0,ce.pi)({width:n,height:r},i))},e.prototype.adjustLayout=function(){var t=this.layout,e=t.labelWidth,n=t.valueWidth,r=t.height,i=(0,ce.CR)(t.position,4),o=i[0],a=i[1],s=i[2],l=i[3],c=r/2;this.markerGroup.styles({transform:"translate(".concat(o,", ").concat(c,")").concat(this.markerGroup.node().style._transform)}),this.labelGroup.styles({transform:"translate(".concat(a,", ").concat(c,")")}),this.focusGroup&&this.focusGroup.styles({transform:"translate(".concat(l,", ").concat(c,")")}),aM(this.labelGroup.select(vM.label.class).node(),Math.ceil(e)),this.showValue&&(this.valueGroup.styles({transform:"translate(".concat(s,", ").concat(c,")")}),aM(this.valueGroup.select(vM.value.class).node(),Math.ceil(n)))},e.prototype.render=function(t,e){var n=wk(e),r=t.x,i=void 0===r?0:r,o=t.y,a=void 0===o?0:o;n.styles({transform:"translate(".concat(i,", ").concat(a,")")}),this.renderMarker(n),this.renderLabel(n),this.renderValue(n),this.renderBackground(n),this.renderPoptip(n),this.renderFocus(n),this.adjustLayout()},e}(dk),bM=Mk({page:"item-page",navigator:"navigator",item:"item"},"items"),xM=function(t,e,n){return void 0===n&&(n=!0),t?e(t):n},EM=function(t){function e(e){var n=t.call(this,e,{data:[],gridRow:1/0,gridCol:void 0,padding:0,width:1e3,height:100,rowPadding:0,colPadding:0,layout:"flex",orientation:"horizontal",click:Pk,mouseenter:Pk,mouseleave:Pk})||this;return n.navigatorShape=[0,0],n}return(0,ce.ZT)(e,t),Object.defineProperty(e.prototype,"pageViews",{get:function(){return this.navigator.getContainer()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"grid",{get:function(){var t=this.attributes,e=t.gridRow,n=t.gridCol,r=t.data;if(!e&&!n)throw new Error("gridRow and gridCol can not be set null at the same time");return e&&n?[e,n]:e?[e,r.length]:[r.length,n]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"renderData",{get:function(){var t=this.attributes,e=t.data,n=t.layout,r=t.poptip,i=t.focus,o=t.focusMarkerSize,a=vk(this.attributes,"item"),s=e.map((function(t,s){var l=t.id,c=void 0===l?s:l,u=t.label,h=t.value;return{id:"".concat(c),index:s,style:(0,ce.pi)({layout:n,labelText:u,valueText:h,poptip:r,focus:i,focusMarkerSize:o},Object.fromEntries(Object.entries(a).map((function(n){var r=(0,ce.CR)(n,2);return[r[0],Rk(r[1],[t,s,e])]}))))}}));return s},enumerable:!1,configurable:!0}),e.prototype.getGridLayout=function(){var t=this,e=this.attributes,n=e.orientation,r=e.width,i=e.rowPadding,o=e.colPadding,a=(0,ce.CR)(this.navigatorShape,1)[0],s=(0,ce.CR)(this.grid,2),l=s[0],c=s[1],u=c*l,h=0;return this.pageViews.children.map((function(e,s){var d,f,p=Math.floor(s/u),g=s%u,v=t.ifHorizontal(c,l),m=[Math.floor(g/v),g%v];"vertical"===n&&m.reverse();var y=(0,ce.CR)(m,2),b=y[0],x=y[1],E=(r-a-(c-1)*o)/c,w=e.getBBox().height,k=(0,ce.CR)([0,0],2),M=k[0],S=k[1];return"horizontal"===n?(M=(d=(0,ce.CR)([h,b*(w+i)],2))[0],S=d[1],h=x===c-1?0:h+E+o):(M=(f=(0,ce.CR)([x*(E+o),h],2))[0],S=f[1],h=b===l-1?0:h+w+i),{page:p,index:s,row:b,col:x,pageIndex:g,width:E,height:w,x:M,y:S}}))},e.prototype.getFlexLayout=function(){var t=this.attributes,e=t.width,n=t.height,r=t.rowPadding,i=t.colPadding,o=(0,ce.CR)(this.navigatorShape,1)[0],a=(0,ce.CR)(this.grid,2),s=a[0],l=a[1],c=(0,ce.CR)([e-o,n],2),u=c[0],h=c[1],d=(0,ce.CR)([0,0,0,0,0,0,0,0],8),f=d[0],p=d[1],g=d[2],v=d[3],m=d[4],y=d[5],b=d[6],x=d[7];return this.pageViews.children.map((function(t,e){var n,o,a,c,d=t.getBBox(),E=d.width,w=d.height,k=0===b?0:i,M=b+k+E;return M<=u&&xM(m,(function(t){return t<l}))?(n=(0,ce.CR)([b+k,x,M],3),f=n[0],p=n[1],b=n[2],{width:E,height:w,x:f,y:p,page:g,index:e,pageIndex:v++,row:y,col:m++}):(o=(0,ce.CR)([y+1,0,0,x+w+r],4),y=o[0],m=o[1],b=o[2],(x=o[3])+w<=h&&xM(y,(function(t){return t<s}))?(a=(0,ce.CR)([b,x,E],3),f=a[0],p=a[1],b=a[2],{width:E,height:w,x:f,y:p,page:g,index:e,pageIndex:v++,row:y,col:m++}):(c=(0,ce.CR)([0,0,E,0,g+1,0,0,0],8),f=c[0],p=c[1],b=c[2],x=c[3],g=c[4],v=c[5],y=c[6],m=c[7],{width:E,height:w,x:f,y:p,page:g,index:e,pageIndex:v++,row:y,col:m++}))}))},Object.defineProperty(e.prototype,"itemsLayout",{get:function(){this.navigatorShape=[0,0];var t="grid"===this.attributes.layout?this.getGridLayout:this.getFlexLayout,e=t.call(this);return e.slice(-1)[0].page>0?(this.navigatorShape=[55,0],t.call(this)):e},enumerable:!1,configurable:!0}),e.prototype.ifHorizontal=function(t,e){return Qk(this.attributes.orientation,t,e)},e.prototype.flattenPage=function(t){t.querySelectorAll(bM.item.class).forEach((function(e){t.appendChild(e)})),t.querySelectorAll(bM.page.class).forEach((function(e){t.removeChild(e).destroy()}))},e.prototype.renderItems=function(t){var e=this.attributes,n=e.click,r=e.mouseenter,i=e.mouseleave;this.flattenPage(t);var o=this.dispatchCustomEvent.bind(this);wk(t).selectAll(bM.item.class).data(this.renderData,(function(t){return t.id})).join((function(t){return t.append((function(t){var e=t.style;return new yM({style:e})})).attr("className",bM.item.name).on("click",(function(){null==n||n(this),o("itemClick",{item:this})})).on("pointerenter",(function(){null==r||r(this),o("itemMouseenter",{item:this})})).on("pointerleave",(function(){null==i||i(this),o("itemMouseleave",{item:this})}))}),(function(t){return t.each((function(t){var e=t.style;this.update(e)}))}),(function(t){return t.remove()}))},e.prototype.relayoutNavigator=function(){var t,e=this.attributes,n=e.layout,r=e.width,i=(null===(t=this.pageViews.children[0])||void 0===t?void 0:t.getBBox().height)||0,o=(0,ce.CR)(this.navigatorShape,2),a=o[0],s=o[1];this.navigator.update("grid"===n?{pageWidth:r-a,pageHeight:i-s}:{})},e.prototype.adjustLayout=function(){var t,e,n=this,r=Object.entries((t=this.itemsLayout,e="page",t.reduce((function(t,n){return(t[n[e]]=t[n[e]]||[]).push(n),t}),{}))).map((function(t){var e=(0,ce.CR)(t,2);return{page:e[0],layouts:e[1]}})),i=(0,ce.ev)([],(0,ce.CR)(this.navigator.getContainer().children),!1);r.forEach((function(t){var e=t.layouts,r=n.pageViews.appendChild(new Al({className:bM.page.name}));e.forEach((function(t){var e=t.x,n=t.y,o=t.index,a=t.width,s=t.height,l=i[o];r.appendChild(l),rf(l,"__layout__",t),l.update({x:e,y:n,width:a,height:s})}))})),this.relayoutNavigator()},e.prototype.renderNavigator=function(t){var e=this.attributes.orientation,n=vk(this.attributes,"nav"),r=lk({orientation:e},n),i=this;return t.selectAll(bM.navigator.class).data(["nav"]).join((function(t){return t.append((function(){return new Uk({style:r})})).attr("className",bM.navigator.name).each((function(){i.navigator=this}))}),(function(t){return t.each((function(){this.update(r)}))}),(function(t){return t.remove()})),this.navigator},e.prototype.getBBox=function(){return this.navigator.getBBox()},e.prototype.render=function(t,e){var n=this.attributes.data;if(n&&0!==n.length){var r=this.renderNavigator(wk(e));this.renderItems(r.getContainer()),this.adjustLayout()}},e.prototype.dispatchCustomEvent=function(t,e){var n=new ws(t,{detail:e});this.dispatchEvent(n)},e}(dk),wM=Mk({markerGroup:"marker-group",marker:"marker",labelGroup:"label-group",label:"label"},"handle"),kM={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},MM=(function(t){function e(e){return t.call(this,e,kM)||this}(0,ce.ZT)(e,t),e.prototype.render=function(t,e){var n=wk(e).maybeAppendByClassName(wM.markerGroup,"g");this.renderMarker(n);var r=wk(e).maybeAppendByClassName(wM.labelGroup,"g");this.renderLabel(r)},e.prototype.renderMarker=function(t){var e=this,n=this.attributes,r=n.orientation,i=n.markerSymbol,o=void 0===i?Qk(r,"horizontalHandle","verticalHandle"):i;Nk(!!o,t,(function(t){var n=vk(e.attributes,"marker"),r=(0,ce.pi)({symbol:o},n);e.marker=t.maybeAppendByClassName(wM.marker,(function(){return new qk({style:r})})).update(r)}))},e.prototype.renderLabel=function(t){var e=this,n=this.attributes,r=n.showLabel,i=n.orientation,o=n.spacing,a=void 0===o?0:o,s=n.formatter;Nk(r,t,(function(t){var n,r=vk(e.attributes,"label"),o=r.text,l=(0,ce._T)(r,["text"]),c=(null===(n=t.select(wM.marker.class))||void 0===n?void 0:n.node().getBBox())||{},u=c.width,h=void 0===u?0:u,d=c.height,f=void 0===d?0:d,p=(0,ce.CR)(Qk(i,[0,f+a,"center","top"],[h+a,0,"start","middle"]),4),g=p[0],v=p[1],m=p[2],y=p[3];t.maybeAppendByClassName(wM.label,"text").styles((0,ce.pi)((0,ce.pi)({},l),{x:g,y:v,text:s(o).toString(),textAlign:m,textBaseline:y}))}))}}(dk),{showTitle:!0,padding:0,orientation:"horizontal",backgroundFill:"transparent",titleText:"",titleSpacing:4,titlePosition:"top-left",titleFill:"#2C3542",titleFontWeight:"bold",titleFontFamily:"sans-serif",titleFontSize:12}),SM=lk({},MM,{}),AM=(lk({},MM,mk(kM,"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"}),Mk({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")),NM=function(t){function e(e){return t.call(this,e,SM)||this}return(0,ce.ZT)(e,t),e.prototype.renderTitle=function(t,e,n){var r=this.attributes,i=r.showTitle,o=r.titleText,a=vk(this.attributes,"title"),s=(0,ce.CR)(yk(a),2),l=s[0],c=s[1];this.titleGroup=t.maybeAppendByClassName(AM.titleGroup,"g").styles(c);var u=(0,ce.pi)((0,ce.pi)({width:e,height:n},l),{text:i?o:""});this.title=this.titleGroup.maybeAppendByClassName(AM.title,(function(){return new Tk({style:u})})).update(u)},e.prototype.renderItems=function(t,e){var n=e.x,r=e.y,i=e.width,o=e.height,a=vk(this.attributes,"title",!0),s=(0,ce.CR)(yk(a),2),l=s[0],c=s[1],u=(0,ce.pi)((0,ce.pi)({},l),{width:i,height:o,x:0,y:0});this.itemsGroup=t.maybeAppendByClassName(AM.itemsGroup,"g").styles((0,ce.pi)((0,ce.pi)({},c),{transform:"translate(".concat(n,", ").concat(r,")")}));var h=this;this.itemsGroup.selectAll(AM.items.class).data(["items"]).join((function(t){return t.append((function(){return new EM({style:u})})).attr("className",AM.items.name).each((function(){h.items=wk(this)}))}),(function(t){return t.update(u)}),(function(t){return t.remove()}))},e.prototype.adjustLayout=function(){if(this.attributes.showTitle){var t=this.title.node().getAvailableSpace(),e=t.x,n=t.y;this.itemsGroup.node().style.transform="translate(".concat(e,", ").concat(n,")")}},Object.defineProperty(e.prototype,"availableSpace",{get:function(){var t=this.attributes,e=t.showTitle,n=t.width,r=t.height;return e?this.title.node().getAvailableSpace():new kk(0,0,n,r)},enumerable:!1,configurable:!0}),e.prototype.getBBox=function(){var e,n,r=null===(e=this.title)||void 0===e?void 0:e.node(),i=null===(n=this.items)||void 0===n?void 0:n.node();return r&&i?function(t,e){var n=t.attributes,r=n.position,i=n.spacing,o=n.inset,a=n.text,s=t.getBBox(),l=e.getBBox(),c=Sk(r),u=(0,ce.CR)(Ak(a?i:0),4),h=u[0],d=u[1],f=u[2],p=u[3],g=(0,ce.CR)(Ak(o),4),v=g[0],m=g[1],y=g[2],b=g[3],x=(0,ce.CR)([p+d,h+f],2),E=x[0],w=x[1],k=(0,ce.CR)([b+m,v+y],2),M=k[0],S=k[1];if("l"===c[0])return new kk(s.x,s.y,l.width+s.width+E+M,Math.max(l.height+S,s.height));if("t"===c[0])return new kk(s.x,s.y,Math.max(l.width+M,s.width),l.height+s.height+w+S);var A=(0,ce.CR)([e.attributes.width||l.width,e.attributes.height||l.height],2),N=A[0],C=A[1];return new kk(l.x,l.y,N+s.width+E+M,C+s.height+w+S)}(r,i):t.prototype.getBBox.call(this)},e.prototype.render=function(t,e){var n=this.attributes,r=n.width,i=n.height,o=n.x,a=void 0===o?0:o,s=n.y,l=void 0===s?0:s,c=wk(e);e.style.transform="translate(".concat(a,", ").concat(l,")"),this.renderTitle(c,r,i),this.renderItems(c,this.availableSpace),this.adjustLayout()},e}(dk);function CM(t){const{width:e,height:n,renderer:r}=t,i=function(t){var e;const{container:n,className:r,graphCanvas:i}=t;if(n)return"string"==typeof n?document.getElementById(n):n;const o=hE(r,!1),{width:a,height:s,containerStyle:l}=t,[c,u]=function(t){const{width:e,height:n,placement:r,graphCanvas:i}=t,[o,a]=i.getSize(),[s,l]=Md(r);return[s*(o-e),l*(a-n)]}(t);return Object.assign(o.style,Object.assign({position:"absolute",left:c+"px",top:u+"px",width:a+"px",height:s+"px"},l)),null===(e=i.getContainer())||void 0===e||e.appendChild(o),o}(t);return[i,new tc({width:e,height:n,container:i,renderer:r||new dg})]}var OM=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};class TM extends uE{constructor(t,e){super(t,Object.assign({},TM.defaultOptions,e)),this.typePrefix="__data__",this.draw=!1,this.fieldMap={node:new Map,edge:new Map,combo:new Map},this.selectedItems=[],this.bindEvents=()=>{const{graph:t}=this.context;t.on(pu.AFTER_DRAW,this.createElement)},this.changeState=(t,e)=>{const{graph:n}=this.context,{typePrefix:r}=this,i=nf(t,[r,"id"]),o=nf(t,[r,"style","labelText"]),[a]=i.split("__"),s=this.fieldMap[a].get(o)||[];n.setElementState(Object.fromEntries(null==s?void 0:s.map((t=>[t,e]))))},this.click=t=>{if("hover"===this.options.trigger)return;const e=nf(t,[this.typePrefix,"id"]);this.selectedItems.includes(e)?(this.selectedItems=this.selectedItems.filter((t=>t!==e)),this.changeState(t,[])):(this.selectedItems.push(e),this.changeState(t,"selected"))},this.mouseleave=t=>{"click"!==this.options.trigger&&(this.selectedItems=[],this.changeState(t,[]))},this.mouseenter=t=>{if("click"===this.options.trigger)return;const e=nf(t,[this.typePrefix,"id"]);this.selectedItems.includes(e)?this.selectedItems=this.selectedItems.filter((t=>t!==e)):(this.selectedItems.push(e),this.changeState(t,"active"))},this.setFieldMap=(t,e,n)=>{if(!t)return;const r=this.fieldMap[n];if(r)if(r.has(t)){const n=r.get(t);n&&(n.push(e),r.set(t,n))}else r.set(t,[e])},this.getEvents=()=>({mouseenter:this.mouseenter,mouseleave:this.mouseleave,click:this.click}),this.getMarkerData=(t,e)=>{if(!t)return[];const{model:n,element:r}=this.context,{nodes:i,edges:o,combos:a}=n.getData(),s={},l=e=>en(t)?t(e):t,c={node:"circle",edge:"line",combo:"rect"},u={circle:"circle",ellipse:"circle",image:"bowtie",rect:"square",star:"cross",triangle:"triangle",diamond:"diamond",cubic:"dot",line:"hyphen",polyline:"hyphen",quadratic:"hv","cubic-horizontal":"hyphen","cubic-vertical":"line"},h=(t,e)=>{t.forEach((t=>{const{id:n}=t,i=nf(t,["data",l(t)]),o=(null==r?void 0:r.getElementType(e,t))||"circle",a=((t,e)=>null==r?void 0:r.getElementComputedStyle(t,e))(e,t),h=("edge"===e?null==a?void 0:a.stroke:null==a?void 0:a.fill)||"#1783ff";n&&i&&i.replace(/\s+/g,"")&&(this.setFieldMap(i,n,e),s[i]||(s[i]={id:`${e}__${n}`,label:i,marker:u[o]||c[e],elementType:e,lineWidth:1,stroke:h,fill:h}))}))};switch(e){case"node":h(i,"node");break;case"edge":h(o,"edge");break;case"combo":h(a,"combo");break;default:return[]}return Object.values(s)},this.createElement=()=>{if(this.draw)return void this.updateElement();const t=this.options,{width:e,height:n,nodeField:r,edgeField:i,comboField:o,trigger:a,position:s,container:l,containerStyle:c,className:u}=t,h=OM(t,["width","height","nodeField","edgeField","comboField","trigger","position","container","containerStyle","className"]),d=this.getMarkerData(r,"node"),f=this.getMarkerData(i,"edge"),p=this.getMarkerData(o,"combo"),g=[...d,...p,...f],v=Object.assign({width:e,height:n,data:g,itemMarkerLineWidth:({lineWidth:t})=>t,itemMarker:({marker:t})=>t,itemMarkerStroke:({stroke:t})=>t,itemMarkerFill:({fill:t})=>t,gridCol:d.length},h,this.getEvents()),m=new NM({className:"legend",style:v});this.category=m;this.upsertCanvas().appendChild(m),this.draw=!0},this.bindEvents()}update(t){super.update(t),this.clear(),this.createElement()}clear(){var t,e;null===(t=this.canvas)||void 0===t||t.destroy(),null===(e=this.container)||void 0===e||e.remove(),this.canvas=void 0,this.container=void 0,this.draw=!1}updateElement(){this.category&&this.category.update({itemMarkerOpacity:({id:t})=>!this.selectedItems.length||this.selectedItems.includes(t)?1:.5,itemLabelOpacity:({id:t})=>!this.selectedItems.length||this.selectedItems.includes(t)?1:.5})}upsertCanvas(){if(this.canvas)return this.canvas;const t=this.context.canvas,[e,n]=t.getSize(),{width:r=e,height:i=n,position:o,container:a,containerStyle:s,className:l}=this.options,[c,u]=CM({width:r,height:i,graphCanvas:t,container:a,containerStyle:s,placement:o,className:"legend"});return this.container=c,l&&c.classList.add(l),this.canvas=u,this.canvas}destroy(){this.clear(),this.context.graph.off(pu.AFTER_DRAW,this.createElement),super.destroy()}}TM.defaultOptions={position:"bottom",trigger:"hover",orientation:"horizontal",layout:"flex",itemSpacing:4,rowPadding:10,colPadding:10,itemMarkerSize:16,itemLabelFontSize:16,width:240,height:160};class PM extends uE{constructor(t,e){super(t,Object.assign({},PM.defaultOptions,e)),this.onDraw=t=>{var e;(null===(e=null==t?void 0:t.data)||void 0===e?void 0:e.render)||this.onRender()},this.landmarkMap=new Map,this.mask=null,this.isMaskDragging=!1,this.onMaskDragStart=t=>{this.mask&&(this.isMaskDragging=!0,this.mask.setPointerCapture(t.pointerId),this.mask.addEventListener("pointermove",this.onMaskDrag),this.mask.addEventListener("pointerup",this.onMaskDragEnd),this.mask.addEventListener("pointercancel",this.onMaskDragEnd))},this.onMaskDrag=t=>{if(!this.mask||!this.isMaskDragging)return;const{size:[e,n]}=this.options,{movementX:r,movementY:i}=t,{left:o,top:a,width:s,height:l}=this.mask.style,[,,c,u]=this.maskBBox;let h=parseInt(o)+r,d=parseInt(a)+i,f=parseInt(s),p=parseInt(l);h<0&&(h=0),d<0&&(d=0),h+f>e&&(h=DM(e-f,0)),d+p>n&&(d=DM(n-p,0)),f<c&&(r>0?(h=DM(h-r,0),f=RM(f+r,e)):r<0&&(f=RM(f-r,e))),p<u&&(i>0?(d=DM(d-i,0),p=RM(p+i,n)):i<0&&(p=RM(p-i,n))),Object.assign(this.mask.style,{left:h+"px",top:d+"px",width:f+"px",height:p+"px"});const g=parseInt(o)-h,v=parseInt(a)-d;if(0===g&&0===v)return;const m=this.context.canvas.getCamera().getZoom()/this.canvas.getCamera().getZoom();this.context.graph.translateBy([g*m,v*m],!1)},this.onMaskDragEnd=t=>{this.mask&&(this.isMaskDragging=!1,this.mask.releasePointerCapture(t.pointerId),this.mask.removeEventListener("pointermove",this.onMaskDrag),this.mask.removeEventListener("pointerup",this.onMaskDragEnd),this.mask.removeEventListener("pointercancel",this.onMaskDragEnd))},this.onTransform=Zu((()=>{this.isMaskDragging||(this.updateMask(),this.setCamera())}),32,{leading:!0}),this.setOnRender(),this.bindEvents()}update(t){this.unbindEvents(),super.update(t),"delay"in t&&this.setOnRender(),this.bindEvents()}setOnRender(){this.onRender=Vv((()=>{this.renderMinimap(),this.renderMask()}),this.options.delay)}bindEvents(){const{graph:t}=this.context;t.on(pu.AFTER_DRAW,this.onDraw),t.on(pu.AFTER_RENDER,this.onRender),t.on(pu.AFTER_ANIMATE,this.onRender),t.on(pu.AFTER_TRANSFORM,this.onTransform)}unbindEvents(){const{graph:t}=this.context;t.off(pu.AFTER_DRAW,this.onDraw),t.off(pu.AFTER_RENDER,this.onRender),t.off(pu.AFTER_ANIMATE,this.onRender),t.off(pu.AFTER_TRANSFORM,this.onTransform)}renderMinimap(){const t=this.getElements(),e=this.initCanvas();this.setShapes(e,t)}getElements(){const{filter:t}=this.options,{model:e,element:n}=this.context,r=e.getData(),i={nodes:r.nodes.filter((t=>null==n?void 0:n.getElement(Fh(t)))),edges:r.edges.filter((t=>{const e=null==n?void 0:n.getElement(Fh(t));return e&&Lv(e)})),combos:r.combos.filter((t=>null==n?void 0:n.getElement(Fh(t))))};if(!t)return i;const{nodes:o,edges:a,combos:s}=i;return{nodes:o.filter((e=>t(Fh(e),"node"))),edges:a.filter((e=>t(Fh(e),"edge"))),combos:s.filter((e=>t(Fh(e),"combo")))}}setShapes(t,e){const{nodes:n,edges:r,combos:i}=e,{shape:o}=this.options,{element:a}=this.context,s=(e,n)=>{const r=Fh(e),i=null==a?void 0:a.getElement(r);if(!i)return;const s=i.getShape("key");let l;if("string"==typeof o){const t=o;l=i.getShape(t).cloneNode()}else{const t=o(r,n,i);l=t===i?t.cloneNode(!0):t}l.setPosition(s.getPosition()),i.style.zIndex&&(l.style.zIndex=i.style.zIndex),l.id=i.id,t.appendChild(l)};t.removeChildren(),r.forEach((t=>s(t,"edge"))),i.forEach((t=>s(t,"combo"))),n.forEach((t=>s(t,"node")))}initCanvas(){const{renderer:t,size:[e,n]}=this.options;if(this.canvas){const{width:r,height:i}=this.canvas.getConfig();e===r&&n===i||this.canvas.resize(e,n),t&&this.canvas.setRenderer(t)}else{const{className:r,position:i,container:o,containerStyle:a}=this.options,[s,l]=CM({renderer:t,width:e,height:n,placement:i,className:"minimap",container:o,containerStyle:a,graphCanvas:this.context.canvas});r&&s.classList.add(r),this.container=s,this.canvas=l}return this.setCamera(),this.canvas}createLandmark(t,e,n){const r=`${t.join(",")}-${e.join(",")}-${n}`;if(this.landmarkMap.has(r))return this.landmarkMap.get(r);const i=this.canvas.getCamera().createLandmark(r,{position:t,focalPoint:e,zoom:n});return this.landmarkMap.set(r,i),i}setCamera(){var t;const{canvas:e}=this.context,n=null===(t=this.canvas)||void 0===t?void 0:t.getCamera();if(!n)return;const{size:[r,i],padding:o}=this.options,[a,s,l,c]=Uu(o),{min:u,max:h,center:d}=e.getBounds("elements"),f=(r-c-s)/(h[0]-u[0]),p=(i-a-l)/(h[1]-u[1]),g=Math.min(f,p),v=this.createLandmark(d,d,g);n.gotoLandmark(v,0)}get maskBBox(){const{canvas:t}=this.context,e=t.getSize(),n=t.getCanvasByViewport([0,0]),r=t.getCanvasByViewport(e),i=this.canvas.canvas2Viewport(Td(n)),o=this.canvas.canvas2Viewport(Td(r)),a=o.x-i.x,s=o.y-i.y;return[i.x,i.y,a,s]}calculateMaskBBox(){const{size:[t,e]}=this.options;let[n,r,i,o]=this.maskBBox;return n<0&&(i=RM(i+n,t),n=0),r<0&&(o=RM(o+r,e),r=0),n+i>t&&(i=DM(t-n,0)),r+o>e&&(o=DM(e-r,0)),[RM(n,t),RM(r,e),DM(i,0),DM(o,0)]}renderMask(){const{maskStyle:t}=this.options;this.mask||(this.mask=document.createElement("div"),this.mask.addEventListener("pointerdown",this.onMaskDragStart),this.mask.draggable=!0,this.mask.addEventListener("dragstart",(t=>t.preventDefault&&t.preventDefault()))),this.container.appendChild(this.mask),Object.assign(this.mask.style,Object.assign(Object.assign({},t),{cursor:"move",position:"absolute",pointerEvents:"auto"})),this.updateMask()}updateMask(){if(!this.mask)return;const[t,e,n,r]=this.calculateMaskBBox();Object.assign(this.mask.style,{top:e+"px",left:t+"px",width:n+"px",height:r+"px"})}destroy(){var t,e,n;this.unbindEvents(),null===(t=this.canvas)||void 0===t||t.destroy(),null===(e=this.mask)||void 0===e||e.remove(),null===(n=this.container)||void 0===n||n.remove(),super.destroy()}}PM.defaultOptions={size:[240,160],shape:"key",padding:10,position:"right-bottom",maskStyle:{border:"1px solid #ddd",background:"rgba(0, 0, 0, 0.1)"},containerStyle:{border:"1px solid #ddd",background:"#fff"},delay:128};const RM=(t,e)=>Math.min(t,e),DM=(t,e)=>Math.max(t,e);var LM=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(t){o(t)}}function s(t){try{l(r.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}))};const IM={x1:0,y1:0,x2:0,y2:0,visibility:"hidden"};class BM extends uE{constructor(t,e){super(t,Object.assign({},BM.defaultOptions,e)),this.initSnapline=()=>{const t=this.context.canvas.getLayer("transient");this.horizontalLine||(this.horizontalLine=t.appendChild(new Pl({style:Object.assign(Object.assign({},IM),this.options.horizontalLineStyle)}))),this.verticalLine||(this.verticalLine=t.appendChild(new Pl({style:Object.assign(Object.assign({},IM),this.options.verticalLineStyle)})))},this.isHorizontalSticking=!1,this.isVerticalSticking=!1,this.enableStick=!0,this.autoSnapToLine=(t,e,n)=>LM(this,void 0,void 0,(function*(){const{verticalX:r,horizontalY:i}=n,{tolerance:o}=this.options,{min:[a,s],max:[l,c],center:[u,h]}=e;let d=0,f=0;null!==r&&(jM(l,r)<o&&(d=r-l),jM(a,r)<o&&(d=r-a),jM(u,r)<o&&(d=r-u),0!==d&&(this.isVerticalSticking=!0)),null!==i&&(jM(c,i)<o&&(f=i-c),jM(s,i)<o&&(f=i-s),jM(h,i)<o&&(f=i-h),0!==f&&(this.isHorizontalSticking=!0)),0===d&&0===f||(yield this.context.graph.translateElementBy({[t]:[d,f]},!1))})),this.enableSnap=t=>{const{target:e}=t,n=.5;if(this.isHorizontalSticking||this.isVerticalSticking){const[r,i]=this.getDelta(t);if(this.isHorizontalSticking&&this.isVerticalSticking&&Math.abs(r)<=n&&Math.abs(i)<=n)return this.context.graph.translateElementBy({[e.id]:[-r,-i]},!1),!1;if(this.isHorizontalSticking&&Math.abs(i)<=n)return this.context.graph.translateElementBy({[e.id]:[0,-i]},!1),!1;if(this.isVerticalSticking&&Math.abs(r)<=n)return this.context.graph.translateElementBy({[e.id]:[-r,0]},!1),!1;this.isHorizontalSticking=!1,this.isVerticalSticking=!1,this.enableStick=!1,setTimeout((()=>{this.enableStick=!0}),200)}return this.enableStick},this.calcSnaplineMetadata=(t,e)=>{const{tolerance:n,shape:r}=this.options,{min:[i,o],max:[a,s],center:[l,c]}=e;let u=null,h=null,d=null,f=null,p=null,g=null;return this.getNodes().some((e=>{if(iu(t.id,e.id))return!1;const v=zM(e,r).getRenderBounds(),{min:[m,y],max:[b,x],center:[E,w]}=v;return null===u&&(jM(E,l)<n?u=E:jM(m,i)<n||jM(m,a)<n?u=m:(jM(b,a)<n||jM(b,i)<n)&&(u=b),null!==u&&(h=Math.min(y,o),d=Math.max(x,s))),null===f&&(jM(w,c)<n?f=w:jM(y,o)<n||jM(y,s)<n?f=y:(jM(x,s)<n||jM(x,o)<n)&&(f=x),null!==f&&(p=Math.min(m,i),g=Math.max(b,a))),null!==u&&null!==f})),{verticalX:u,verticalMinY:h,verticalMaxY:d,horizontalY:f,horizontalMinX:p,horizontalMaxX:g}},this.onDragStart=()=>{this.initSnapline()},this.onDrag=t=>LM(this,void 0,void 0,(function*(){const{target:e}=t;if(this.options.autoSnap){if(!this.enableSnap(t))return}const n=zM(e,this.options.shape).getRenderBounds(),r=this.calcSnaplineMetadata(e,n);this.hideSnapline(),null===r.verticalX&&null===r.horizontalY||this.updateSnapline(r),this.options.autoSnap&&(yield this.autoSnapToLine(e.id,n,r))})),this.onDragEnd=()=>{this.hideSnapline()},this.bindEvents()}getNodes(){var t;const{filter:e}=this.options,n=((null===(t=this.context.element)||void 0===t?void 0:t.getNodes())||[]).filter((t=>{var e;return Lv(t)&&(null===(e=this.context.viewport)||void 0===e?void 0:e.isInViewport(t.getRenderBounds()))}));return e?n.filter((t=>e(t))):n}hideSnapline(){this.horizontalLine.style.visibility="hidden",this.verticalLine.style.visibility="hidden"}getLineWidth(t){const{lineWidth:e}=this.options[`${t}LineStyle`];return+(e||IM.lineWidth||1)/this.context.graph.getZoom()}updateSnapline(t){const{verticalX:e,verticalMinY:n,verticalMaxY:r,horizontalY:i,horizontalMinX:o,horizontalMaxX:a}=t,[s,l]=this.context.canvas.getSize(),{offset:c}=this.options;null!==i?Object.assign(this.horizontalLine.style,{x1:c===1/0?0:o-c,y1:i,x2:c===1/0?s:a+c,y2:i,visibility:"visible",lineWidth:this.getLineWidth("horizontal")}):this.horizontalLine.style.visibility="hidden",null!==e?Object.assign(this.verticalLine.style,{x1:e,y1:c===1/0?0:n-c,x2:e,y2:c===1/0?l:r+c,visibility:"visible",lineWidth:this.getLineWidth("vertical")}):this.verticalLine.style.visibility="hidden"}getDelta(t){const e=this.context.graph.getZoom();return ud([t.dx,t.dy],e)}bindEvents(){return LM(this,void 0,void 0,(function*(){const{graph:t}=this.context;t.on(vu.DRAG_START,this.onDragStart),t.on(vu.DRAG,this.onDrag),t.on(vu.DRAG_END,this.onDragEnd)}))}unbindEvents(){const{graph:t}=this.context;t.off(vu.DRAG_START,this.onDragStart),t.off(vu.DRAG,this.onDrag),t.off(vu.DRAG_END,this.onDragEnd)}destroyElements(){var t,e;null===(t=this.horizontalLine)||void 0===t||t.destroy(),null===(e=this.verticalLine)||void 0===e||e.destroy()}destroy(){this.destroyElements(),this.unbindEvents(),super.destroy()}}BM.defaultOptions={tolerance:5,offset:20,autoSnap:!0,shape:"key",verticalLineStyle:{stroke:"#1783FF"},horizontalLineStyle:{stroke:"#1783FF"},filter:()=>!0};const jM=(t,e)=>Math.abs(t-e),zM=(t,e)=>"function"==typeof e?e(t):t.getShape(e);function FM(t,e){var n={YYYY:t.getFullYear(),MM:t.getMonth()+1,DD:t.getDate(),HH:t.getHours(),mm:t.getMinutes(),ss:t.getSeconds()},r=e;return Object.keys(n).forEach((function(t){var e=n[t];r=r.replace(t,"YYYY"===t?"".concat(e):"".concat(e).padStart(2,"0"))})),r}var _M={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 Dl({style:{d:[["M",10,10],["L",-10,0],["L",10,-10],["L",0,0],["L",10,10],["Z"]],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",labelOverlap:[]},ZM=(od({},_M,{style:{type:"arc"}}),od({},_M,{style:{}}),Mk({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"));function GM(t,e){return[t[0]*e,t[1]*e]}function VM(t,e){return[t[0]+e[0],t[1]+e[1]]}function WM(t,e){return[t[0]-e[0],t[1]-e[1]]}function HM(t,e){return[Math.min(t[0],e[0]),Math.min(t[1],e[1])]}function UM(t,e){return[Math.max(t[0],e[0]),Math.max(t[1],e[1])]}function YM(t,e){return Math.sqrt(Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2))}function qM(t){if(0===t[0]&&0===t[1])return[0,0];var e=Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2));return[t[0]/e,t[1]/e]}function XM(t){return t*Math.PI/180}function KM(t){return Number((180*t/Math.PI).toPrecision(5))}function QM(t,e){return t.style.opacity||(t.style.opacity=1),jk(t,{opacity:0},e)}var JM=["$el","cx","cy","d","dx","dy","fill","fillOpacity","filter","fontFamily","fontSize","fontStyle","fontVariant","fontWeight","height","img","increasedLineWidthForHitTesting","innerHTML","isBillboard","billboardRotation","isSizeAttenuation","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 $M(t){return JM.includes(t)}function tS(t){var e={};for(var n in t)$M(n)&&(e[n]=t[n]);return e}var eS=Mk({lineGroup:"line-group",line:"line",regionGroup:"region-group",region:"region"},"grid");function nS(t){return t.reduce((function(t,e,n){return t.push((0,ce.ev)([0===n?"M":"L"],(0,ce.CR)(e),!1)),t}),[])}function rS(t,e,n){return"surround"===e.type?function(t,e,n){var r=e.connect,i=void 0===r?"line":r,o=e.center;if("line"===i)return nS(t);if(!o)return[];var a=YM(t[0],o),s=n?0:1;return t.reduce((function(t,e,n){return 0===n?t.push((0,ce.ev)(["M"],(0,ce.CR)(e),!1)):t.push((0,ce.ev)(["A",a,a,0,0,s],(0,ce.CR)(e),!1)),t}),[])}(t,e,n):nS(t)}function iS(t,e,n){var r=n.type,i=n.connect,o=n.center,a=n.closed?[["Z"]]:[],s=(0,ce.CR)([rS(t,n),rS(e.slice().reverse(),n,!0)],2),l=s[0],c=s[1],u=(0,ce.CR)([t[0],e.slice(-1)[0]],2),h=u[0],d=u[1],f=function(t,e){return[l,t,c,e,a].flat()};if("line"===i||"surround"===r)return f([(0,ce.ev)(["L"],(0,ce.CR)(d),!1)],[(0,ce.ev)(["L"],(0,ce.CR)(h),!1)]);if(!o)throw new Error("Arc grid need to specified center");var p=(0,ce.CR)([YM(d,o),YM(h,o)],2),g=p[0],v=p[1];return f([(0,ce.ev)(["A",g,g,0,0,1],(0,ce.CR)(d),!1),(0,ce.ev)(["L"],(0,ce.CR)(d),!1)],[(0,ce.ev)(["A",v,v,0,0,0],(0,ce.CR)(h),!1),(0,ce.ev)(["L"],(0,ce.CR)(h),!1)])}var oS=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,ce.ZT)(e,t),e.prototype.render=function(t,e){t.type,t.center,t.areaFill,t.closed;var n=(0,ce._T)(t,["type","center","areaFill","closed"]),r=function(t){var e=t.data,n=void 0===e?[]:e;return t.closed?n.map((function(t){var e=t.points,n=(0,ce.CR)(e,1)[0];return(0,ce.pi)((0,ce.pi)({},t),{points:(0,ce.ev)((0,ce.ev)([],(0,ce.CR)(e),!1),[n],!1)})})):n}(t),i=wk(e).maybeAppendByClassName(eS.lineGroup,"g"),o=wk(e).maybeAppendByClassName(eS.regionGroup,"g"),a=function(t,e,n,r){var i=n.animate,o=n.isBillboard,a=e.map((function(t,e){return{id:t.id||"grid-line-".concat(e),d:rS(t.points,n)}}));return t.selectAll(eS.line.class).data(a,(function(t){return t.id})).join((function(t){return t.append("path").each((function(t,e){var n=Rk(tS((0,ce.pi)({d:t.d},r)),[t,e,a]);this.attr((0,ce.pi)({class:eS.line.name,stroke:"#D9D9D9",lineWidth:1,lineDash:[4,4],isBillboard:o},n))}))}),(function(t){return t.transition((function(t,e){return jk(this,Rk(tS((0,ce.pi)({d:t.d},r)),[t,e,a]),i.update)}))}),(function(t){return t.transition((function(){var t=this,e=QM(this,i.exit);return Lk(e,(function(){return t.remove()})),e}))})).transitions()}(i,r,t,n),s=function(t,e,n){var r=n.animate,i=n.connect,o=n.areaFill;if(e.length<2||!o||!i)return[];for(var a=Array.isArray(o)?o:[o,"transparent"],s=function(t){return a[t%a.length]},l=[],c=0;c<e.length-1;c++){var u=(0,ce.CR)([e[c].points,e[c+1].points],2),h=iS(u[0],u[1],n);l.push({d:h,fill:s(c)})}return t.selectAll(eS.region.class).data(l,(function(t,e){return e})).join((function(t){return t.append("path").each((function(t,e){var n=Rk(t,[t,e,l]);this.attr(n)})).attr("className",eS.region.name)}),(function(t){return t.transition((function(t,e){return jk(this,Rk(t,[t,e,l]),r.update)}))}),(function(t){return t.transition((function(){var t=this,e=QM(this,r.exit);return Lk(e,(function(){return t.remove()})),e}))})).transitions()}(o,r,t);return(0,ce.ev)((0,ce.ev)([],(0,ce.CR)(a),!1),(0,ce.CR)(s),!1)},e}(dk);function aS(t,e){return"number"==typeof t&&"number"==typeof e?function(t,e){return function(n){return t*(1-n)+e*n}}(t,e):Array.isArray(t)&&Array.isArray(e)?function(t,e){var n=e?e.length:0,r=t?Math.min(n,t.length):0;return function(i){var o=new Array(r),a=new Array(n),s=0;for(s=0;s<r;++s)o[s]=aS(t[s],e[s]);for(;s<n;++s)a[s]=e[s];for(s=0;s<r;++s)a[s]=o[s](i);return a}}(t,e):"object"==typeof t&&"object"==typeof e?function(t,e){void 0===t&&(t={}),void 0===e&&(e={});var n={},r={};return Object.entries(e).forEach((function(e){var i=(0,ce.CR)(e,2),o=i[0],a=i[1];o in t?n[o]=aS(t[o],a):r[o]=a})),function(t){return Object.entries(n).forEach((function(e){var n=(0,ce.CR)(e,2),i=n[0],o=n[1];return r[i]=o(t)})),r}}(t,e):function(e){return t}}function sS(t,e){var n={},r=Array.isArray(e)?e:[e];for(var i in t)r.includes(i)||(n[i]=t[i]);return n}function lS(t,e){return Object.fromEntries(Object.entries(t).map((function(t){var n=(0,ce.CR)(t,2);return[n[0],Rk(n[1],e)]})))}function cS(t,e){return e&&en(e)?t.filter(e):t}function uS(t,e){var n=e.startAngle;return(e.endAngle-n)*t+n}function hS(t,e){if("linear"===e.type){var n=(0,ce.CR)(e.startPos,2),r=n[0],i=n[1],o=(0,ce.CR)(e.endPos,2),a=o[0],s=o[1],l=(0,ce.CR)([a-r,s-i],2);return qM([l[0],l[1]])}var c=XM(uS(t,e));return[-Math.sin(c),Math.cos(c)]}function dS(t,e,n){return function(t,e){return e?[t[1],-t[0]]:[-t[1],t[0]]}(hS(t,n),"positive"!==e)}function fS(t,e){return dS(t,e.labelDirection,e)}function pS(t,e){return"linear"===e.type?function(t,e){var n=(0,ce.CR)(e.startPos,2),r=n[0],i=n[1],o=(0,ce.CR)(e.endPos,2),a=o[0],s=o[1],l=(0,ce.CR)([a-r,s-i],2);return[r+l[0]*t,i+l[1]*t]}(t,e):function(t,e){var n=e.radius,r=(0,ce.CR)(e.center,2),i=r[0],o=r[1],a=XM(uS(t,e));return[i+n*Math.cos(a),o+n*Math.sin(a)]}(t,e)}function gS(t){return 0===hS(0,t)[1]}function vS(t){return 0===hS(0,t)[0]}function mS(t,e){return e-t==360}function yS(t,e,n,r,i){var o=e-t,a=(0,ce.CR)([i,i],2),s=a[0],l=a[1],c=(0,ce.CR)([XM(t),XM(e)],2),u=c[0],h=c[1],d=function(t){return[n+i*Math.cos(t),r+i*Math.sin(t)]},f=(0,ce.CR)(d(u),2),p=f[0],g=f[1],v=(0,ce.CR)(d(h),2),m=v[0],y=v[1];if(mS(t,e)){var b=(h+u)/2,x=(0,ce.CR)(d(b),2);return[["M",p,g],["A",s,l,0,1,0,x[0],x[1]],["A",s,l,0,1,0,m,y]]}var E=o>180?1:0,w=t>e?0:1;return"M".concat(p,",").concat(g,",A").concat(s,",").concat(l,",0,").concat(E,",").concat(w,",").concat(m,",").concat(y)}function bS(t,e,n,r){var i=e.startAngle,o=e.endAngle,a=e.center,s=e.radius;return t.selectAll(ZM.line.class).data([{d:yS.apply(void 0,(0,ce.ev)((0,ce.ev)([i,o],(0,ce.CR)(a),!1),[s],!1))}],(function(t,e){return e})).join((function(t){return t.append("path").attr("className",ZM.line.name).styles(e).styles({d:function(t){return t.d}})}),(function(t){return t.transition((function(){var t=this,e=function(t,e,n,r){if(!r)return t.attr("__keyframe_data__",n),null;var i=r.duration,o=void 0===i?0:i,a=aS(e,n),s=Math.ceil(+o/16),l=new Array(s).fill(0).map((function(t,e,n){return{__keyframe_data__:a(e/(n.length-1))}}));return t.animate(l,(0,ce.pi)({fill:"both"},r))}(this,function(t){var e=t.attributes,n=e.startAngle,r=e.endAngle,i=e.center,o=e.radius;return(0,ce.ev)((0,ce.ev)([n,r],(0,ce.CR)(i),!1),[o],!1)}(this),(0,ce.ev)((0,ce.ev)([i,o],(0,ce.CR)(a),!1),[s],!1),r.update);if(e){var n=function(){var e=nf(t.attributes,"__keyframe_data__");t.style.d=yS.apply(void 0,(0,ce.ev)([],(0,ce.CR)(e),!1))};e.onframe=n,e.onfinish=n}return e})).styles(e)}),(function(t){return t.remove()})).styles(n).transitions()}function xS(t){var e=(0,ce.CR)(t,2),n=(0,ce.CR)(e[0],2),r=n[0],i=n[1],o=(0,ce.CR)(e[1],2);return{x1:r,y1:i,x2:o[0],y2:o[1]}}function ES(t,e,n,r){var i=e.showTrunc,o=e.startPos,a=e.endPos,s=e.truncRange,l=e.lineExtension,c=(0,ce.CR)([o,a],2),u=(0,ce.CR)(c[0],2),h=u[0],d=u[1],f=(0,ce.CR)(c[1],2),p=f[0],g=f[1],v=(0,ce.CR)(l?function(t,e,n){void 0===n&&(n=[0,0]);var r=(0,ce.CR)([t,e,n],3),i=(0,ce.CR)(r[0],2),o=i[0],a=i[1],s=(0,ce.CR)(r[1],2),l=s[0],c=s[1],u=(0,ce.CR)(r[2],2),h=u[0],d=u[1],f=(0,ce.CR)([l-o,c-a],2),p=f[0],g=f[1],v=Math.sqrt(Math.pow(p,2)+Math.pow(g,2)),m=(0,ce.CR)([-h/v,d/v],2),y=m[0],b=m[1];return[y*p,y*g,b*p,b*g]}(o,a,l):new Array(4).fill(0),4),m=v[0],y=v[1],b=v[2],x=v[3],E=function(e){return t.selectAll(ZM.line.class).data(e,(function(t,e){return e})).join((function(t){return t.append("line").attr("className",(function(t){return"".concat(ZM.line.name," ").concat(t.className)})).styles(n).transition((function(t){return jk(this,xS(t.line),!1)}))}),(function(t){return t.styles(n).transition((function(t){return jk(this,xS(t.line),r.update)}))}),(function(t){return t.remove()})).transitions()};if(!i||!s)return E([{line:[[h+m,d+y],[p+b,g+x]],className:ZM.line.name}]);var w=(0,ce.CR)(s,2),k=w[0],M=w[1],S=p-h,A=g-d,N=(0,ce.CR)([h+S*k,d+A*k],2),C=N[0],O=N[1],T=(0,ce.CR)([h+S*M,d+A*M],2),P=T[0],R=T[1],D=E([{line:[[h+m,d+y],[C,O]],className:ZM.lineFirst.name},{line:[[P,R],[p+b,g+x]],className:ZM.lineSecond.name}]);return function(t,e){e.truncRange,e.truncShape,e.lineExtension}(0,e),D}function wS(t,e,n){var r,i=e.type,o=vk(e,"line");return r="linear"===i?ES(t,e,sS(o,"arrow"),n):bS(t,e,sS(o,"arrow"),n),function(t,e,n,r){var i,o=n.showArrow,a=n.showTrunc,s=n.lineArrow,l=n.lineArrowOffset,c=n.lineArrowSize;if(i="arc"===e?t.select(ZM.line.class):a?t.select(ZM.lineSecond.class):t.select(ZM.line.class),!o||!s||"arc"===n.type&&mS(n.startAngle,n.endAngle)){var u=i.node();u&&(u.style.markerEnd=void 0)}else{var h=tM(s);h.attr(r),zk(h,c,!0),i.style("markerEnd",h).style("markerEndOffset",-l)}}(t,i,e,o),r}function kS(t){var e=t.type,n=t.gridCenter;return"linear"===e?n:n||t.center}function MS(t,e){var n=e.gridLength;return t.map((function(t,r){var i=t.value,o=(0,ce.CR)(pS(i,e),2),a=o[0],s=o[1],l=(0,ce.CR)(GM(function(t,e){return dS(t,e.gridDirection,e)}(i,e),n),2);return{id:r,points:[[a,s],[a+l[0],s+l[1]]]}}))}function SS(t,e,n,r){var i=vk(n,"grid"),o=i.type,a=i.areaFill,s=kS(n),l=cS(e,n.gridFilter),c="segment"===o?MS(l,n):function(t,e){var n=e.gridControlAngles,r=kS(e);if(!r)throw new Error("grid center is not provide");if(t.length<2)throw new Error("Invalid grid data");if(!n||0===n.length)throw new Error("Invalid gridControlAngles");var i=(0,ce.CR)(r,2),o=i[0],a=i[1];return t.map((function(t,r){var i=t.value,s=(0,ce.CR)(pS(i,e),2),l=s[0],c=s[1],u=(0,ce.CR)([l-o,c-a],2),h=u[0],d=u[1],f=[];return n.forEach((function(t){var e=XM(t),n=(0,ce.CR)([Math.cos(e),Math.sin(e)],2),r=n[0],i=n[1],s=h*r-d*i+o,l=h*i+d*r+a;f.push([s,l])})),{points:f,id:r}}))}(l,n),u=(0,ce.pi)((0,ce.pi)({},i),{center:s,areaFill:en(a)?l.map((function(t,e){return Rk(a,[t,e,l])})):a,animate:r,data:c});return t.selectAll(ZM.grid.class).data([1]).join((function(t){return t.append((function(){return new oS({style:u})})).attr("className",ZM.grid.name)}),(function(t){return t.transition((function(){return this.update(u)}))}),(function(t){return t.remove()})).transitions()}function AS(t,e,n,r,i){return void 0===r&&(r=!0),void 0===i&&(i=!1),!!(r&&t===e||i&&t===n)||t>e&&t<n}function NS(t,e){if(e)try{var n=e.replace(/translate\(([+-]*[\d]+[%]*),[ ]*([+-]*[\d]+[%]*)\)/g,(function(e,n,r){return"translate(".concat(function(t,e,n){var r=t.getBBox(),i=r.width,o=r.height,a=(0,ce.CR)([e,n].map((function(t,e){var n;return t.includes("%")?parseFloat((null===(n=t.match(/[+-]?([0-9]*[.])?[0-9]+/))||void 0===n?void 0:n[0])||"0")/100*(0===e?i:o):t})),2);return[a[0],a[1]]}(t,n,r),")")}));t.attr("transform",n)}catch(t){}}var CS=function(){function t(t,e,n,r){this.set(t,e,n,r)}return Object.defineProperty(t.prototype,"left",{get:function(){return this.x1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"top",{get:function(){return this.y1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){return this.x2},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bottom",{get:function(){return this.y2},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this.defined("x2")&&this.defined("x1")?this.x2-this.x1:void 0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.defined("y2")&&this.defined("y1")?this.y2-this.y1:void 0},enumerable:!1,configurable:!0}),t.prototype.rotatedPoints=function(t,e,n){var r=this,i=r.x1,o=r.y1,a=r.x2,s=r.y2,l=Math.cos(t),c=Math.sin(t),u=e-e*l+n*c,h=n-e*c-n*l;return[[l*i-c*s+u,c*i+l*s+h],[l*a-c*s+u,c*a+l*s+h],[l*i-c*o+u,c*i+l*o+h],[l*a-c*o+u,c*a+l*o+h]]},t.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},t.prototype.defined=function(t){return this[t]!==Number.MAX_VALUE&&this[t]!==-Number.MAX_VALUE},t}();function OS(t,e){var n=t.getEulerAngles()||0;t.setEulerAngles(0);var r=t.getBounds(),i=(0,ce.CR)(r.min,2),o=i[0],a=i[1],s=(0,ce.CR)(r.max,2),l=s[0],c=s[1],u=t.getBBox(),h=u.width,d=u.height,f=0,p=0,g=o,v=a,m=iM(t);if(m){d-=1.5;var y=m.style.textAlign,b=m.style.textBaseline;"center"===y?g=(o+l)/2:"right"!==y&&"end"!==y||(g=l),"middle"===b?v=(a+c)/2:"bottom"===b&&(v=c)}var x=(0,ce.CR)(Ak(e),4),E=x[0],w=void 0===E?0:E,k=x[1],M=void 0===k?0:k,S=x[2],A=void 0===S?w:S,N=x[3],C=new CS((f+=o)-(void 0===N?M:N),(p+=a)-w,f+h+M,p+d+A);return t.setEulerAngles(n),C.rotatedPoints(XM(n),g,v)}function TS(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 PS(t,e,n){var r=(e[1]-t[1])*(n[0]-e[0])-(e[0]-t[0])*(n[1]-e[1]);return 0===r?0:r<0?2:1}function RS(t,e){return e.every((function(e){return function(t,e){var n=t.length;if(n<3)return!1;var r,i,o,a,s,l,c=[e,[9999,e[1]]],u=0,h=0;do{var d=[t[h],t[(h+1)%n]];if(i=c,o=void 0,a=void 0,s=void 0,l=void 0,o=PS((r=d)[0],r[1],i[0]),a=PS(r[0],r[1],i[1]),s=PS(i[0],i[1],r[0]),l=PS(i[0],i[1],r[1]),o!==a&&s!==l||0===o&&TS(r,i[0])||0===a&&TS(r,i[1])||0===s&&TS(i,r[0])||0===l&&TS(i,r[1])){if(0===PS(d[0],e,d[1]))return TS(d,e);u++}h=(h+1)%n}while(0!==h);return!!(1&u)}(t,e)}))}function DS(t,e){var n=(0,ce.CR)(t,4),r=n[0],i=n[1],o=n[2],a=n[3],s=(0,ce.CR)(e,4),l=s[0],c=s[1],u=o-r,h=a-i,d=s[2]-l,f=s[3]-c,p=u*f-d*h;if(0===p)return!1;var g=p>0,v=r-l,m=i-c,y=u*m-h*v;if(y<0===g)return!1;var b=d*m-f*v;return b<0!==g&&(y>p!==g&&b>p!==g)}function LS(t,e){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 DS(e,t)}))}function IS(t,e,n){var r,i,o=e.crossPadding,a=new Set,s=null,l=function(t,e){var n=t.type,r=t.labelDirection,i=t.crossSize;if(!i)return!1;if("arc"===n){var o=t.center,a=t.radius,s=(0,ce.CR)(o,2),l=s[0],c=s[1],u="negative"===r?0:i,h=-a-u,d=a+u,f=(0,ce.CR)(Ak(e),4),p=f[0],g=f[1],v=f[2],m=f[3];return new CS(l+h-m,c+h-p,l+d+g,c+d+v)}var y=(0,ce.CR)(t.startPos,2),b=y[0],x=y[1],E=(0,ce.CR)(t.endPos,2),w=E[0],k=E[1],M=(0,ce.CR)(vS(t)?[-e,0,e,0]:[0,e,0,-e],4),S=M[0],A=M[1],N=M[2],C=M[3],O=GM(fS(0,t),i),T=new CS(b,x,w,k);return T.x1+=C,T.y1+=S,T.x2+=A+O[0],T.y2+=N+O[1],T}(e,o),c=function(t){return!l||function(t,e,n){var r=t.x1,i=t.x2,o=t.y1,a=t.y2;return RS([[r,o],[i,o],[i,a],[r,a]],OS(e,n))}(l,t)},u=function(t,e){return!t||!t.firstChild||!function(t,e,n){var r,i,o=OS(t,n).flat(1),a=OS(e,n).flat(1),s=[[o[0],o[1],o[2],o[3]],[o[0],o[1],o[4],o[5]],[o[4],o[5],o[6],o[7]],[o[2],o[3],o[6],o[7]]];try{for(var l=(0,ce.XA)(s),c=l.next();!c.done;c=l.next())if(LS(a,c.value))return!0}catch(t){r={error:t}}finally{try{c&&!c.done&&(i=l.return)&&i.call(l)}finally{if(r)throw r.error}}return!1}(t.firstChild,e.firstChild,Ak(n))};try{for(var h=(0,ce.XA)(t),d=h.next();!d.done;d=h.next()){var f=d.value;c(f)?!s||u(s,f)?s=f:(a.add(s),a.add(f)):a.add(f)}}catch(t){r={error:t}}finally{try{d&&!d.done&&(i=h.return)&&i.call(h)}finally{if(r)throw r.error}}return Array.from(a)}function BS(t,e){return void 0===e&&(e={}),ae(t)?0:"number"==typeof t?t:Math.floor(nM(t,e))}var jS=function(t){return void 0!==t&&null!=t&&!Number.isNaN(t)},zS=function(t,e){var n=e.seq,r=void 0===n?2:n;return t.filter((function(t,e){return!(e%r)||(ok(t),!1)}))};var FS=new Map([["hide",function(t,e,n,r){var i=t.length,o=e.keepHeader,a=e.keepTail;if(!(i<=1||2===i&&o&&a)){var s,l,c,u=zS,h=function(t){return t.forEach(r.show),t},d=2,f=t.slice(),p=t.slice(),g=Math.min.apply(Math,(0,ce.ev)([1],(0,ce.CR)(t.map((function(t){return t.getBBox().width}))),!1));if("linear"===n.type&&(gS(n)||vS(n))){var v=Jk(t[0]).left,m=Jk(t[i-1]).right,y=Math.abs(m-v)||1;d=Math.max(Math.floor(i*g/y),d)}for(o&&(s=f.splice(0,1)[0]),a&&(l=f.splice(-1,1)[0],f.reverse()),h(f);d<t.length&&IS((c=l?(0,ce.ev)((0,ce.ev)([l],(0,ce.CR)(p),!1),[s],!1):(0,ce.ev)([s],(0,ce.CR)(p),!1),c.filter(jS)),n,null==e?void 0:e.margin).length;){if(l&&!s&&d%2==0)f.splice(0,1).forEach(r.hide);else if(l&&s){f.splice(0,1).forEach(r.hide)}p=u(h(f),{seq:d}),d++}}}],["rotate",function(t,e,n,r){var i,o,a=e.optionalAngles,s=void 0===a?[0,45,90]:a,l=e.margin,c=e.recoverWhenFailed,u=void 0===c||c,h=t.map((function(t){return t.getLocalEulerAngles()})),d=function(e){return t.forEach((function(t,n){var i=Array.isArray(e)?e[n]:e;r.rotate(t,+i)}))};try{for(var f=(0,ce.XA)(s),p=f.next();!p.done;p=f.next()){if(d(p.value),IS(t,n,l).length<1)return}}catch(t){i={error:t}}finally{try{p&&!p.done&&(o=f.return)&&o.call(f)}finally{if(i)throw i.error}}u&&d(h)}],["ellipsis",function(t,e,n,r){if(!(t.length<=0)){var i=e.suffix,o=void 0===i?"...":i,a=e.minLength,s=e.maxLength,l=void 0===s?1/0:s,c=e.step,u=void 0===c?" ":c,h=e.margin,d=void 0===h?[0,0,0,0]:h,f=rM(r.getTextShape(t[0])),p=BS(u,f),g=a?BS(a,f):p,v=BS(l,f);(ae(v)||v===1/0)&&(v=Math.max.apply(null,t.map((function(t){return t.getBBox().width}))));for(var m=t.slice(),y=(0,ce.CR)(d,4),b=(y[0],y[1],y[2],y[3],function(e){if(m.forEach((function(t){r.ellipsis(r.getTextShape(t),e,o)})),(m=IS(t,n,d)).length<1)return{value:void 0}}),x=v;x>g+p;x-=p){var E=b(x);if("object"==typeof E)return E.value}}}],["wrap",function(t,e,n,r,i){var o,a=e.maxLines,s=void 0===a?3:a,l=e.recoverWhenFailed,c=void 0===l||l,u=e.margin,h=void 0===u?[0,0,0,0]:u,d=Rk(null!==(o=e.wordWrapWidth)&&void 0!==o?o:50,[i]),f=t.map((function(t){return t.attr("maxLines")||1})),p=Math.min.apply(Math,(0,ce.ev)([],(0,ce.CR)(f),!1)),g=function(){return IS(t,n,h).length<1},v=function(t){var e=t.type,n=t.labelDirection;return"linear"===e&&gS(t)?"negative"===n?"bottom":"top":"middle"}(n),m=function(e){return t.forEach((function(t,n){var i=Array.isArray(e)?e[n]:e;r.wrap(t,d,i,v)}))};if(!(p>s)){if("linear"===n.type&&gS(n)){if(m(s),g())return}else for(var y=p;y<=s;y++)if(m(y),g())return;c&&m(f)}}]]);function _S(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=function(t){return"positive"===t?-1:1};return t.reduce((function(t,e){return t*n(e)}),1)}function ZS(t){for(var e=t;e<0;)e+=360;return Math.round(e%360)}function GS(t,e){var n=(0,ce.CR)(t,2),r=n[0],i=n[1],o=(0,ce.CR)(e,2),a=o[0],s=o[1],l=(0,ce.CR)([r*a+i*s,r*s-i*a],2),c=l[0],u=l[1];return Math.atan2(u,c)}function VS(t,e,n){var r,i=n.labelAlign;if(null===(r=e.style.transform)||void 0===r?void 0:r.includes("rotate"))return e.getLocalEulerAngles();var o=fS(t.value,n),a=hS(t.value,n);return"horizontal"===i?0:function(t){var e=(t+360)%180;return AS(e,-90,90)||(e+=180),e}(KM("perpendicular"===i?GS([1,0],o):GS([a[0]<0?-1:1,0],a)))}function WS(t,e,n){var r=n.type,i=n.labelAlign,o=fS(t,n),a=ZS(e),s=ZS(KM(GS([1,0],o))),l="center",c="middle";return"linear"===r?[90,270].includes(s)&&0===a?(l="center",c=1===o[1]?"top":"bottom"):s%180||![90,270].includes(a)?0===s?(AS(a,0,90,!1,!0)||AS(a,0,90)||AS(a,270,360))&&(l="start"):90===s?AS(a,0,90,!1,!0)?l="start":(AS(a,90,180)||AS(a,270,360))&&(l="end"):270===s?AS(a,0,90,!1,!0)?l="end":(AS(a,90,180)||AS(a,270,360))&&(l="start"):180===s&&(90===a?l="start":(AS(a,0,90)||AS(a,270,360))&&(l="end")):l="center":"parallel"===i?c=AS(s,0,180,!0)?"top":"bottom":"horizontal"===i?AS(s,90,270,!1)?l="end":(AS(s,270,360,!1)||AS(s,0,90))&&(l="start"):"perpendicular"===i&&(l=AS(s,90,270)?"end":"start"),{textAlign:l,textBaseline:c}}function HS(t,e,n){var r=n.showTick,i=n.tickLength,o=n.tickDirection,a=n.labelDirection,s=n.labelSpacing,l=e.indexOf(t),c=Rk(s,[t,l,e]),u=(0,ce.CR)([fS(t.value,n),_S(a,o)],2),h=u[0],d=1===u[1]?Rk(r?i:0,[t,l,e]):0,f=(0,ce.CR)(VM(GM(h,c+d),pS(t.value,n)),2);return{x:f[0],y:f[1]}}function US(t,e,n,r){var i=r.labelRender,o=(nf(r,"endPos.0",400)-nf(r,"startPos.0",0))/n.length,a=en(i)?Rk(i,[t,e,n,fS(t.value,r)]):t.label||"",s=function(t){var e=(new DOMParser).parseFromString(t,"text/html").body.firstElementChild;if(console.log(null==e?void 0:e.getClientRects(),11),!e)return 0;var n=e.getAttribute("style")||"",r=Object.fromEntries(n.split(";").map((function(t){return t.trim()})).filter((function(t){return t.includes(":")})).map((function(t){var e=(0,ce.CR)(t.split(":").map((function(t){return t.trim()})),2),n=e[0],r=e[1];return[n.toLowerCase(),r]}))),i=function(t){if(!t)return 0;var e=t.match(/([\d.]+)px/);return e?parseFloat(e[1]):0};if(r.height)return i(r.height);var o,a=i(r["font-size"])||16,s=r["line-height"];o=s&&"normal"!==s?s.endsWith("px")?i(s):/^[\d.]+$/.test(s)?parseFloat(s)*a:a:1.2*a;var l=i(r["padding-top"]),c=i(r["padding-bottom"]);r.padding&&(1===(u=r.padding.split(/\s+/).map(i)).length||2===u.length?(l=u[0],c=u[0]):(3===u.length||4===u.length)&&(l=u[0],c=u[2]));var u,h=i(r["border-top-width"]),d=i(r["border-bottom-width"]);if(r.border){var f=r.border.match(/([\d.]+)px/);f&&(h=parseFloat(f[1]),d=parseFloat(f[1]))}return r["border-width"]&&(1===(u=r["border-width"].split(/\s+/).map(i)).length||2===u.length?(h=u[0],d=u[0]):(3===u.length||4===u.length)&&(h=u[0],d=u[2])),o+l+c+h+d}(a)||30;return function(){return e={width:o,height:s},"function"==typeof(t=a)?t():se(t)||ie(t)?new Cl({style:(0,ce.pi)((0,ce.pi)({},e),{innerHTML:String(t)})}):t;var t,e}}function YS(t,e){["text","html"].includes(t.nodeName)&&t.attr(e)}function qS(t,e){!function(t,e,n,r){var i=e.labelOverlap,o=void 0===i?[]:i;o.length&&o.forEach((function(i){var o=i.type,a=FS.get(o);(function(t,e,n){return!(e.labelOverlap.length<1)&&("hide"===n?!function(t){for(var e=t;e;){if("offscreen"===e.className)return!0;e=e.parent}return!1}(t[0]):"rotate"===n?!t.some((function(t){var e;return!!(null===(e=t.attr("transform"))||void 0===e?void 0:e.includes("rotate"))})):"ellipsis"!==n&&"wrap"!==n||t.filter((function(t){return t.querySelector("text")})).length>=1)})(t,e,o)&&(null==a||a(t,i,e,r,n))}))}(this.node().childNodes,t,e,{hide:ok,show:ik,rotate:function(e,n){!function(t,e,n){e.setLocalEulerAngles(t);var r=WS(e.__data__.value,t,n),i=e.querySelector(ZM.labelItem.class);i&&YS(i,r)}(+n,e,t)},ellipsis:function(t,e,n){t&&aM(t,e||1/0,n)},wrap:function(t,e,n){var r,i;t&&(void 0===(r=n)&&(r=2),void 0===i&&(i="top"),oM(t,{wordWrap:!0,wordWrapWidth:e,maxLines:r,textBaseline:i}))},getTextShape:function(t){return t.querySelector("text")}})}function XS(t,e,n,r,i){var o=n.indexOf(e),a=i.labelRender,s=wk(t).append(a?US(e,o,n,i):function(t,e,n,r){var i=r.labelFormatter;return en(i)?function(){return tM(Rk(i,[t,e,n,fS(t.value,r)]))}:function(){return tM(t.label||"")}}(e,o,n,i)).attr("className",ZM.labelItem.name).node(),l=(0,ce.CR)(yk(lS(r,[e,o,n])),2),c=l[0],u=l[1],h=u.transform,d=(0,ce._T)(u,["transform"]);NS(s,h);var f=VS(e,s,i);return s.getLocalEulerAngles()||s.setLocalEulerAngles(f),YS(s,(0,ce.pi)((0,ce.pi)({},WS(e.value,f,i)),c)),t.attr(d),s}function KS(t,e,n,r,i){var o,a,s,l=cS(e,n.labelFilter),c=vk(n,"label"),u=t.selectAll(ZM.label.class).data(l,(function(t,e){return e})).join((function(t){return t.append("g").attr("className",ZM.label.name).transition((function(t){XS(this,t,e,c,n);var r=HS(t,e,n),i=r.x,o=r.y;return this.style.transform="translate(".concat(i,", ").concat(o,")"),null}))}),(function(t){return t.transition((function(t){var i=function(t,e,n,r){if(void 0===r&&(r="destroy"),function(t,e){return"text"===t.nodeName&&"text"===e.nodeName&&t.attributes.text===e.attributes.text}(t,e))return t.remove(),[null];var i=function(){"destroy"===r?t.destroy():"hide"===r&&ok(t),e.isVisible()&&ik(e)};if(!n)return i(),[null];var o=n.duration,a=void 0===o?0:o,s=n.delay,l=void 0===s?0:s,c=Math.ceil(+a/2),u=+a/4,h=(0,ce.CR)(t.getGeometryBounds().center,2),d=h[0],f=h[1],p=(0,ce.CR)(e.getGeometryBounds().center,2),g=p[0],v=p[1],m=(0,ce.CR)([(d+g)/2-d,(f+v)/2-f],2),y=m[0],b=m[1],x=t.style.opacity,E=void 0===x?1:x,w=e.style.opacity,k=void 0===w?1:w,M=t.style.transform||"",S=e.style.transform||"",A=t.animate([{opacity:E,transform:"translate(0, 0) ".concat(M)},{opacity:0,transform:"translate(".concat(y,", ").concat(b,") ").concat(M)}],(0,ce.pi)((0,ce.pi)({fill:"both"},n),{duration:l+c+u})),N=e.animate([{opacity:0,transform:"translate(".concat(-y,", ").concat(-b,") ").concat(S),offset:.01},{opacity:k,transform:"translate(0, 0) ".concat(S)}],(0,ce.pi)((0,ce.pi)({fill:"both"},n),{duration:c+u,delay:l+c-u}));return Lk(N,i),[A,N]}(this.querySelector(ZM.labelItem.class),XS(this,t,e,c,n),r.update),o=HS(t,e,n),a=o.x,s=o.y,l=jk(this,{transform:"translate(".concat(a,", ").concat(s,")")},r.update);return(0,ce.ev)((0,ce.ev)([],(0,ce.CR)(i),!1),[l],!1)}))}),(function(t){return o=t,t.transition((function(){var t=this,e=QM(this.childNodes[0],r.exit);return Lk(e,(function(){return wk(t).remove()})),e})),o})).transitions();return s=function(){qS.call(t,n,i)},0===(a=u).length?s():Promise.all(a.map((function(t){return null==t?void 0:t.finished}))).then(s),u}function QS(t,e){return dS(t,e.tickDirection,e)}function JS(t,e,n,r,i){var o=i.tickLength,a=(0,ce.CR)(function(t,e){var n=(0,ce.CR)(t,2);return[[0,0],[n[0]*e,n[1]*e]]}(r,Rk(o,[t,e,n])),2),s=(0,ce.CR)(a[0],2),l=s[0],c=s[1],u=(0,ce.CR)(a[1],2);return{x1:l,x2:u[0],y1:c,y2:u[1]}}function $S(t,e,n,r,i,o){var a=function(t,e,n,r,i){var o=i.tickFormatter,a=QS(e.value,i),s="line";return en(o)&&(s=function(){return Rk(o,[e,n,r,a])}),t.append(s).attr("className",ZM.tickItem.name)}(wk(this),t,e,n,r);!function(t,e,n,r,i,o,a){var s=QS(t.value,o),l=JS(t,e,n,s,o),c=l.x1,u=l.x2,h=l.y1,d=l.y2,f=(0,ce.CR)(yk(lS(a,[t,e,n,s])),2),p=f[0],g=f[1];"line"===r.node().nodeName&&r.styles((0,ce.pi)({x1:c,x2:u,y1:h,y2:d},p)),i.attr(g),r.styles(p)}(t,e,n,a,this,r,i);var s=(0,ce.CR)(pS(t.value,r),2),l=s[0],c=s[1];return jk(this,{transform:"translate(".concat(l,", ").concat(c,")")},o)}function tA(t,e,n,r,i){var o=vk(r,"title"),a=(0,ce.CR)(yk(o),2),s=a[0],l=a[1],c=l.transform,u=l.transformOrigin,h=(0,ce._T)(l,["transform","transformOrigin"]);e.styles(h);var d=c||function(t,e,n){var r=2*t.getGeometryBounds().halfExtents[1];if("vertical"===e){if("left"===n)return"rotate(-90) translate(0, ".concat(r/2,")");if("right"===n)return"rotate(-90) translate(0, -".concat(r/2,")")}return""}(t.node(),s.direction,s.position);t.styles((0,ce.pi)((0,ce.pi)({},s),{transformOrigin:u})),NS(t.node(),d);var f=function(t,e,n){var r=n.titlePosition,i=void 0===r?"lb":r,o=n.titleSpacing,a=Sk(i),s=t.node().getLocalBounds(),l=(0,ce.CR)(s.min,2),c=l[0],u=l[1],h=(0,ce.CR)(s.halfExtents,2),d=h[0],f=h[1],p=(0,ce.CR)(e.node().getLocalBounds().halfExtents,2),g=p[0],v=p[1],m=(0,ce.CR)([c+d,u+f],2),y=m[0],b=m[1],x=(0,ce.CR)(Ak(o),4),E=x[0],w=x[1],k=x[2],M=x[3];if(["start","end"].includes(i)&&"linear"===n.type){var S=n.startPos,A=n.endPos,N=(0,ce.CR)("start"===i?[S,A]:[A,S],2),C=N[0],O=N[1],T=qM([-O[0]+C[0],-O[1]+C[1]]),P=(0,ce.CR)(GM(T,E),2),R=P[0],D=P[1];return{x:C[0]+R,y:C[1]+D}}return a.includes("t")&&(b-=f+v+E),a.includes("r")&&(y+=d+g+w),a.includes("l")&&(y-=d+g+M),a.includes("b")&&(b+=f+v+k),{x:y,y:b}}(wk(n._offscreen||n.querySelector(ZM.mainGroup.class)),e,r),p=f.x,g=f.y;return jk(e.node(),{transform:"translate(".concat(p,", ").concat(g,")")},i)}function eA(t,e,n,r){var i=t.showLine,o=t.showTick,a=t.showLabel,s=Nk(i,e.maybeAppendByClassName(ZM.lineGroup,"g"),(function(e){return wS(e,t,r)}))||[],l=Nk(o,e.maybeAppendByClassName(ZM.tickGroup,"g"),(function(e){return function(t,e,n,r){var i=cS(e,n.tickFilter),o=vk(n,"tick");return t.selectAll(ZM.tick.class).data(i,(function(t){return t.id||t.label})).join((function(t){return t.append("g").attr("className",ZM.tick.name).transition((function(t,e){return $S.call(this,t,e,i,n,o,!1)}))}),(function(t){return t.transition((function(t,e){return this.removeChildren(),$S.call(this,t,e,i,n,o,r.update)}))}),(function(t){return t.transition((function(){var t=this,e=QM(this.childNodes[0],r.exit);return Lk(e,(function(){return t.remove()})),e}))})).transitions()}(e,n,t,r)}))||[],c=Nk(a,e.maybeAppendByClassName(ZM.labelGroup,"g"),(function(i){return KS(i,n,t,r,e.node())}))||[];return(0,ce.ev)((0,ce.ev)((0,ce.ev)([],(0,ce.CR)(s),!1),(0,ce.CR)(l),!1),(0,ce.CR)(c),!1).filter((function(t){return!!t}))}var nA=function(t){function e(e){return t.call(this,e,_M)||this}return(0,ce.ZT)(e,t),e.prototype.render=function(t,e,n){var r=this,i=t.titleText,o=t.data,a=t.animate,s=t.showTitle,l=t.showGrid,c=t.dataThreshold,u=t.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}(o,c).filter((function(t){var e=t.value;return!(u&&e>u[0]&&e<u[1])})),d=Dk(void 0===n?a:n),f=Nk(l,wk(e).maybeAppendByClassName(ZM.gridGroup,"g"),(function(e){return SS(e,h,t,d)}))||[],p=wk(e).maybeAppendByClassName(ZM.mainGroup,"g");i&&(!this.initialized&&d.enter||this.initialized&&d.update)&&eA(t,wk(this.offscreenGroup),h,Dk(!1));var g=eA(t,wk(p.node()),h,d),v=Nk(s,wk(e).maybeAppendByClassName(ZM.titleGroup,"g"),(function(e){return function(t,e,n,r){var i=n.titleText;return t.selectAll(ZM.title.class).data([{title:i}].filter((function(t){return!!t.title})),(function(t,e){return t.title})).join((function(o){return o.append((function(){return tM(i)})).attr("className",ZM.title.name).transition((function(){return tA(wk(this),t,e,n,r.enter)}))}),(function(i){return i.transition((function(){return tA(wk(this),t,e,n,r.update)}))}),(function(t){return t.remove()})).transitions()}(e,r,t,d)}))||[];return(0,ce.ev)((0,ce.ev)((0,ce.ev)([],(0,ce.CR)(f),!1),(0,ce.CR)(g),!1),(0,ce.CR)(v),!1).flat().filter((function(t){return!!t}))},e}(dk);function rA(t){var e=t.canvas,n=t.touches,r=t.offsetX,i=t.offsetY;if(e)return[e.x,e.y];if(n){var o=n[0];return[o.clientX,o.clientY]}return r&&i?[r,i]:[0,0]}function iA(t,e){return+t.toPrecision(e)}var oA=function(t){return t};class aA{constructor(t){this.options=od({},this.getDefaultOptions()),this.update(t)}getOptions(){return this.options}update(t={}){this.options=od({},this.options,t),this.rescale(t)}rescale(t){}}function sA(t,e){return e-t?n=>(n-t)/(e-t):t=>.5}function lA(t,...e){return e.reduce(((t,e)=>n=>t(e(n))),t)}var cA=n(75196),uA=n.n(cA);function hA(t,e,n){let r=n;return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}function dA(t){const e=uA().get(t);if(!e)return null;const{model:n,value:r}=e;return"rgb"===n?r:"hsl"===n?function(t){const e=t[0]/360,n=t[1]/100,r=t[2]/100,i=t[3];if(0===n)return[255*r,255*r,255*r,i];const o=r<.5?r*(1+n):r+n-r*n,a=2*r-o;return[255*hA(a,o,e+1/3),255*hA(a,o,e),255*hA(a,o,e-1/3),i]}(r):null}const fA=(t,e)=>n=>t*(1-n)+e*n,pA=(t,e)=>"number"==typeof t&&"number"==typeof e?fA(t,e):"string"==typeof t&&"string"==typeof e?((t,e)=>{const n=dA(t),r=dA(e);return null===n||null===r?n?()=>t:()=>e:t=>{const e=new Array(4);for(let i=0;i<4;i+=1){const o=n[i],a=r[i];e[i]=o*(1-t)+a*t}const[i,o,a,s]=e;return`rgba(${Math.round(i)}, ${Math.round(o)}, ${Math.round(a)}, ${s})`}})(t,e):()=>t,gA=(t,e)=>{const n=fA(t,e);return t=>Math.round(n(t))};function vA(t){return!(Qe(t)||(e=t,null===e)||Number.isNaN(t));var e}const mA=Math.sqrt(50),yA=Math.sqrt(10),bA=Math.sqrt(2);function xA(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log(r)/Math.LN10),o=r/10**i;return i>=0?(o>=mA?10:o>=yA?5:o>=bA?2:1)*10**i:-(10**-i)/(o>=mA?10:o>=yA?5:o>=bA?2:1)}const EA=(t,e,n=5)=>{const r=[t,e];let i,o=0,a=r.length-1,s=r[o],l=r[a];return l<s&&([s,l]=[l,s],[o,a]=[a,o]),i=xA(s,l,n),i>0?(s=Math.floor(s/i)*i,l=Math.ceil(l/i)*i,i=xA(s,l,n)):i<0&&(s=Math.ceil(s*i)/i,l=Math.floor(l*i)/i,i=xA(s,l,n)),i>0?(r[o]=Math.floor(s/i)*i,r[a]=Math.ceil(l/i)*i):i<0&&(r[o]=Math.ceil(s*i)/i,r[a]=Math.floor(l*i)/i),r};const wA=(t,e,n)=>{const[r,i]=t,[o,a]=e;let s,l;return r<i?(s=sA(r,i),l=n(o,a)):(s=sA(i,r),l=n(a,o)),lA(l,s)},kA=(t,e,n)=>{const r=Math.min(t.length,e.length)-1,i=new Array(r),o=new Array(r),a=t[0]>t[r],s=a?[...t].reverse():t,l=a?[...e].reverse():e;for(let t=0;t<r;t+=1)i[t]=sA(s[t],s[t+1]),o[t]=n(l[t],l[t+1]);return e=>{const n=function(t,e,n,r,i){let o=n||0,a=r||t.length;const s=i||(t=>t);for(;o<a;){const n=Math.floor((o+a)/2);s(t[n])>e?a=n:o=n+1}return o}(t,e,1,r)-1,a=i[n];return lA(o[n],a)(e)}},MA=(t,e,n,r)=>(Math.min(t.length,e.length)>2?kA:wA)(t,e,r?gA:n);class SA extends aA{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,interpolate:fA,tickCount:5}}map(t){return vA(t)?this.output(t):this.options.unknown}invert(t){return vA(t)?this.input(t):this.options.unknown}nice(){if(!this.options.nice)return;const[t,e,n,...r]=this.getTickMethodOptions();this.options.domain=this.chooseNice()(t,e,n,...r)}getTicks(){const{tickMethod:t}=this.options,[e,n,r,...i]=this.getTickMethodOptions();return t(e,n,r,...i)}getTickMethodOptions(){const{domain:t,tickCount:e}=this.options;return[t[0],t[t.length-1],e]}chooseNice(){return EA}rescale(){this.nice();const[t,e]=this.chooseTransforms();this.composeOutput(t,this.chooseClamp(t)),this.composeInput(t,e,this.chooseClamp(e))}chooseClamp(t){const{clamp:e,range:n}=this.options,r=this.options.domain.map(t),i=Math.min(r.length,n.length);return e?function(t,e){const n=e<t?e:t,r=t>e?t:e;return t=>Math.min(Math.max(n,t),r)}(r[0],r[i-1]):oA}composeOutput(t,e){const{domain:n,range:r,round:i,interpolate:o}=this.options,a=MA(n.map(t),r,o,i);this.output=lA(a,e,t)}composeInput(t,e,n){const{domain:r,range:i}=this.options,o=MA(i,r.map(t),fA);this.input=lA(e,n,o)}}const AA=(t,e,n)=>{let r,i,o=t,a=e;if(o===a&&n>0)return[o];let s=xA(o,a,n);if(0===s||!Number.isFinite(s))return[];if(s>0){o=Math.ceil(o/s),a=Math.floor(a/s),i=new Array(r=Math.ceil(a-o+1));for(let t=0;t<r;t+=1)i[t]=(o+t)*s}else{s=-s,o=Math.ceil(o*s),a=Math.floor(a*s),i=new Array(r=Math.ceil(a-o+1));for(let t=0;t<r;t+=1)i[t]=(o+t)/s}return i};class NA extends SA{getDefaultOptions(){return{domain:[0,1],range:[0,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolate:pA,tickMethod:AA,tickCount:5}}chooseTransforms(){return[oA,oA]}clone(){return new NA(this.options)}}function CA({map:t,initKey:e},n){const r=e(n);return t.has(r)?t.get(r):n}function OA(t){return"object"==typeof t?t.valueOf():t}class TA extends Map{constructor(t){if(super(),this.map=new Map,this.initKey=OA,null!==t)for(const[e,n]of t)this.set(e,n)}get(t){return super.get(CA({map:this.map,initKey:this.initKey},t))}has(t){return super.has(CA({map:this.map,initKey:this.initKey},t))}set(t,e){return super.set(function({map:t,initKey:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}({map:this.map,initKey:this.initKey},t),e)}delete(t){return super.delete(function({map:t,initKey:e},n){const r=e(n);return t.has(r)&&(n=t.get(r),t.delete(r)),n}({map:this.map,initKey:this.initKey},t))}}const PA=Symbol("defaultUnknown");function RA(t,e,n){for(let r=0;r<e.length;r+=1)t.has(e[r])||t.set(n(e[r]),r)}function DA(t){const{value:e,from:n,to:r,mapper:i,notFoundReturn:o}=t;let a=i.get(e);if(void 0===a){if(o!==PA)return o;a=n.push(e)-1,i.set(e,a)}return r[a%r.length]}function LA(t){return t instanceof Date?t=>`${t}`:"object"==typeof t?t=>JSON.stringify(t):t=>t}class IA extends aA{getDefaultOptions(){return{domain:[],range:[],unknown:PA}}constructor(t){super(t)}map(t){return 0===this.domainIndexMap.size&&RA(this.domainIndexMap,this.getDomain(),this.domainKey),DA({value:this.domainKey(t),mapper:this.domainIndexMap,from:this.getDomain(),to:this.getRange(),notFoundReturn:this.options.unknown})}invert(t){return 0===this.rangeIndexMap.size&&RA(this.rangeIndexMap,this.getRange(),this.rangeKey),DA({value:this.rangeKey(t),mapper:this.rangeIndexMap,from:this.getRange(),to:this.getDomain(),notFoundReturn:this.options.unknown})}rescale(t){const[e]=this.options.domain,[n]=this.options.range;if(this.domainKey=LA(e),this.rangeKey=LA(n),!this.rangeIndexMap)return this.rangeIndexMap=new Map,void(this.domainIndexMap=new Map);t&&!t.range||this.rangeIndexMap.clear(),(!t||t.domain||t.compare)&&(this.domainIndexMap.clear(),this.sortedDomain=void 0)}clone(){return new IA(this.options)}getRange(){return this.options.range}getDomain(){if(this.sortedDomain)return this.sortedDomain;const{domain:t,compare:e}=this.options;return this.sortedDomain=e?[...t].sort(e):t,this.sortedDomain}}function BA(t){return Math.round(1e12*t)/1e12}function jA(t){const{domain:e,range:n,paddingOuter:r,paddingInner:i,flex:o,round:a,align:s}=t,l=e.length,c=function(t,e){const n=e-t.length;return n>0?[...t,...new Array(n).fill(1)]:n<0?t.slice(0,e):t}(o,l),[u,h]=n,d=h-u,f=d/(2/l*r+1-1/l*i),p=f*i/l,g=f-l*p,v=function(t){const e=Math.min(...t);return t.map((t=>t/e))}(c),m=g/v.reduce(((t,e)=>t+e)),y=new TA(e.map(((t,e)=>{const n=v[e]*m;return[t,a?Math.floor(n):n]}))),b=new TA(e.map(((t,e)=>{const n=v[e]*m+p;return[t,a?Math.floor(n):n]}))),x=Array.from(b.values()).reduce(((t,e)=>t+e)),E=u+(d-(x-x/l*i))*s;let w=a?Math.round(E):E;const k=new Array(l);for(let t=0;t<l;t+=1){k[t]=BA(w);const n=e[t];w+=b.get(n)}return{valueBandWidth:y,valueStep:b,adjustedRange:k}}class zA extends IA{getDefaultOptions(){return{domain:[],range:[0,1],align:.5,round:!1,paddingInner:0,paddingOuter:0,padding:0,unknown:PA,flex:[]}}constructor(t){super(t)}clone(){return new zA(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(){const{padding:t,paddingInner:e}=this.options;return t>0?t:e}getPaddingOuter(){const{padding:t,paddingOuter:e}=this.options;return t>0?t:e}rescale(){super.rescale();const{align:t,domain:e,range:n,round:r,flex:i}=this.options,{adjustedRange:o,valueBandWidth:a,valueStep:s}=function(t){var e;const{domain:n}=t,r=n.length;if(0===r)return{valueBandWidth:void 0,valueStep:void 0,adjustedRange:[]};if(null===(e=t.flex)||void 0===e?void 0:e.length)return jA(t);const{range:i,paddingOuter:o,paddingInner:a,round:s,align:l}=t;let c,u,h=i[0];const d=i[1]-h,f=2*o,p=r-a;c=d/Math.max(1,f+p),s&&(c=Math.floor(c)),h+=(d-c*(r-a))*l,u=c*(1-a),s&&(h=Math.round(h),u=Math.round(u));const g=new Array(r).fill(0).map(((t,e)=>h+e*c));return{valueStep:c,valueBandWidth:u,adjustedRange:g}}({align:t,range:n,round:r,flex:i,paddingInner:this.getPaddingInner(),paddingOuter:this.getPaddingOuter(),domain:e});this.valueStep=s,this.valueBandWidth=a,this.adjustedRange=o}}var FA=function(t){function e(e){var n=this,r=e.style,i=(0,ce._T)(e,["style"]);return(n=t.call(this,od({},{type:"column"},(0,ce.pi)({style:r},i)))||this).columnsGroup=new Al({name:"columns"}),n.appendChild(n.columnsGroup),n.render(),n}return(0,ce.ZT)(e,t),e.prototype.render=function(){var t=this.attributes,e=t.columns,n=t.x,r=t.y;this.columnsGroup.style.transform="translate(".concat(n,", ").concat(r,")"),wk(this.columnsGroup).selectAll(".column").data(e.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()}))},e.prototype.update=function(t){this.attr(lk({},this.attributes,t)),this.render()},e.prototype.clear=function(){this.removeChildren()},e}(El),_A=function(t){function e(e){var n=this,r=e.style,i=(0,ce._T)(e,["style"]);return(n=t.call(this,od({},{type:"lines"},(0,ce.pi)({style:r},i)))||this).linesGroup=n.appendChild(new Al),n.areasGroup=n.appendChild(new Al),n.render(),n}return(0,ce.ZT)(e,t),e.prototype.render=function(){var t=this.attributes,e=t.lines,n=t.areas,r=t.x,i=t.y;this.style.transform="translate(".concat(r,", ").concat(i,")"),e&&this.renderLines(e),n&&this.renderAreas(n)},e.prototype.clear=function(){this.linesGroup.removeChildren(),this.areasGroup.removeChildren()},e.prototype.update=function(t){this.attr(lk({},this.attributes,t)),this.render()},e.prototype.renderLines=function(t){wk(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()}))},e.prototype.renderAreas=function(t){wk(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()}))},e}(El);function ZA(t,e,n){void 0===e&&(e=!1),void 0===n&&(n=[[0,0],[1,1]]);for(var r=!!e,i=[],o=0,a=t.length;o<a;o+=2)i.push([t[o],t[o+1]]);var s,l,c,u=function(t,e,n,r){var i,o,a,s,l,c,u=[],h=!!r,d=[1/0,1/0],f=[-1/0,-1/0];if(h){d=(i=(0,ce.CR)(r,2))[0],f=i[1];for(var p=0,g=t.length;p<g;p+=1)d=HM(d,m=t[p]),f=UM(f,m)}p=0;for(var v=t.length;p<v;p+=1){var m=t[p];if(0!==p||n)if(p!==v-1||n){o=t[[p?p-1:v-1,p-1][n?0:1]];var y=[0,0];y=GM(y=WM(a=t[n?(p+1)%v:p+1],o),e);var b=YM(m,o),x=YM(m,a),E=b+x;0!==E&&(b/=E,x/=E);var w=GM(y,-b),k=GM(y,x);l=VM(m,w),s=HM(s=VM(m,k),UM(a,m)),s=UM(s,HM(a,m)),l=HM(l=VM(m,w=GM(w=WM(s,m),-b/x)),UM(o,m)),s=VM(m,k=GM(k=WM(m,l=UM(l,HM(o,m))),x/b)),h&&(l=HM(l=UM(l,d),f),s=HM(s=UM(s,d),f)),u.push(c),u.push(l),c=s}else l=m,u.push(c),u.push(l);else c=m}return n&&u.push(u.shift()),u}(i,.4,r,n),h=i.length,d=[];for(o=0;o<h-1;o+=1)s=u[2*o],l=u[2*o+1],c=i[o+1],d.push(["C",s[0],s[1],l[0],l[1],c[0],c[1]]);return r&&(s=u[h],l=u[h+1],c=(0,ce.CR)(i,1)[0],d.push(["C",s[0],s[1],l[0],l[1],c[0],c[1]])),d}function GA(t,e){void 0===e&&(e=!1);var n=e?t.length-1:0,r=t.map((function(t,e){return(0,ce.ev)([e===n?"M":"L"],(0,ce.CR)(t),!1)}));return e?r.reverse():r}function VA(t,e){if(void 0===e&&(e=!1),t.length<=2)return GA(t);for(var n=[],r=t.length,i=0;i<r;i+=1){var o=e?t[r-i-1]:t[i];iu(o,n.slice(-2))||n.push.apply(n,(0,ce.ev)([],(0,ce.CR)(o),!1))}var a=ZA(n,!1);return e?a.unshift((0,ce.ev)(["M"],(0,ce.CR)(t[r-1]),!1)):a.unshift((0,ce.ev)(["M"],(0,ce.CR)(t[0]),!1)),a}function WA(t,e,n){var r=Vu(t);return r.push(["L",e,n],["L",0,n],["Z"]),r}var HA=function(t,e){if(Be(t)){for(var n,r=1/0,i=0;i<t.length;i++){var o=t[i],a=en(e)?e(o):o[e];a<r&&(n=o,r=a)}return n}},UA=function(t,e){if(Be(t)){for(var n,r=-1/0,i=0;i<t.length;i++){var o=t[i],a=en(e)?e(o):o[e];a>r&&(n=o,r=a)}return n}};function YA(t){return 0===t.length?[0,0]:[je(HA(t,(function(t){return je(t)||0}))),ze(UA(t,(function(t){return ze(t)||0})))]}function qA(t){for(var e=Vu(t),n=e[0].length,r=(0,ce.CR)([Array(n).fill(0),Array(n).fill(0)],2),i=r[0],o=r[1],a=0;a<e.length;a+=1)for(var s=e[a],l=0;l<n;l+=1)s[l]>=0?(s[l]+=i[l],i[l]=s[l]):(s[l]+=o[l],o[l]=s[l]);return e}var XA=function(t){function e(e){return t.call(this,e,{type:"line",x:0,y:0,width:200,height:20,isStack:!1,color:["#83daad","#edbf45","#d2cef9","#e290b3","#6f63f4"],smooth:!0,lineLineWidth:1,areaOpacity:0,isGroup:!1,columnLineWidth:1,columnStroke:"#fff",scale:1,spacing:0})||this}return(0,ce.ZT)(e,t),Object.defineProperty(e.prototype,"rawData",{get:function(){var t=this.attributes.data;if(!t||0===(null==t?void 0:t.length))return[[]];var e=Vu(t);return ie(e[0])?[e]:e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"data",{get:function(){return this.attributes.isStack?qA(this.rawData):this.rawData},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"scales",{get:function(){return this.createScales(this.data)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"baseline",{get:function(){var t=this.scales.y,e=(0,ce.CR)(t.getOptions().domain||[0,0],2),n=e[0],r=e[1];return r<0?t.map(r):t.map(n<0?0:n)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"containerShape",{get:function(){var t=this.attributes;return{width:t.width,height:t.height}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"linesStyle",{get:function(){var t=this,e=this.attributes,n=e.type,r=e.isStack,i=e.smooth;if("line"!==n)throw new Error("linesStyle can only be used in line type");var o=vk(this.attributes,"area"),a=vk(this.attributes,"line"),s=this.containerShape.width,l=this.data;if(0===l[0].length)return{lines:[],areas:[]};var c=this.scales,u=function(t,e){var n,r=e.x,i=e.y,o=(0,ce.CR)(i.getOptions().range||[0,0],2),a=o[0],s=o[1];return s>a&&(n=(0,ce.CR)([a,s],2),s=n[0],a=n[1]),t.map((function(t){return t.map((function(t,e){return[r.map(e),le(i.map(t),s,a)]}))}))}(l,{type:"line",x:c.x,y:c.y}),h=[];if(o){var d=this.baseline;h=r?i?function(t,e,n){for(var r=[],i=t.length-1;i>=0;i-=1){var o=t[i],a=VA(o),s=void 0;if(0===i)s=WA(a,e,n);else{var l=VA(t[i-1],!0),c=o[0];l[0][0]="L",s=(0,ce.ev)((0,ce.ev)((0,ce.ev)([],(0,ce.CR)(a),!1),(0,ce.CR)(l),!1),[(0,ce.ev)(["M"],(0,ce.CR)(c),!1),["Z"]],!1)}r.push(s)}return r}(u,s,d):function(t,e,n){for(var r=[],i=t.length-1;i>=0;i-=1){var o=GA(t[i]),a=void 0;if(0===i)a=WA(o,e,n);else{var s=GA(t[i-1],!0);s[0][0]="L",a=(0,ce.ev)((0,ce.ev)((0,ce.ev)([],(0,ce.CR)(o),!1),(0,ce.CR)(s),!1),[["Z"]],!1)}r.push(a)}return r}(u,s,d):function(t,e,n,r){return t.map((function(t){return WA(e?VA(t):GA(t),n,r)}))}(u,i,s,d)}return{lines:u.map((function(e,n){return(0,ce.pi)({stroke:t.getColor(n),d:i?VA(e):GA(e)},a)})),areas:h.map((function(e,n){return(0,ce.pi)({d:e,fill:t.getColor(n)},o)}))}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"columnsStyle",{get:function(){var t=this,e=vk(this.attributes,"column"),n=this.attributes,r=n.isStack,i=n.type,o=n.scale;if("column"!==i)throw new Error("columnsStyle can only be used in column type");var a=this.containerShape.height,s=this.rawData;if(!s)return{columns:[]};r&&(s=qA(s));var l=this.createScales(s),c=l.x,u=l.y,h=(0,ce.CR)(YA(s),2),d=h[0],f=h[1],p=new NA({domain:[0,f-(d>0?0:d)],range:[0,a*o]}),g=c.getBandWidth(),v=this.rawData;return{columns:s.map((function(n,i){return n.map((function(n,o){var a=g/s.length;return(0,ce.pi)((0,ce.pi)({fill:t.getColor(i)},e),r?{x:c.map(o),y:u.map(n),width:g,height:p.map(v[i][o])}:{x:c.map(o)+a*i,y:n>=0?u.map(n):u.map(0),width:a,height:p.map(Math.abs(n))})}))}))}},enumerable:!1,configurable:!0}),e.prototype.render=function(t,e){var n,r,i;(n=e,r=".container",i="rect",n.querySelector(r)?wk(n).select(r):wk(n).append(i)).attr("className","container").node();var o=t.type,a=t.x,s=t.y,l="spark".concat(o),c=(0,ce.pi)({x:a,y:s},"line"===o?this.linesStyle:this.columnsStyle);wk(e).selectAll(".spark").data([o]).join((function(t){return t.append((function(t){return"line"===t?new _A({className:l,style:c}):new FA({className:l,style:c})})).attr("className","spark ".concat(l))}),(function(t){return t.update(c)}),(function(t){return t.remove()}))},e.prototype.getColor=function(t){var e=this.attributes.color;return Be(e)?e[t%e.length]:en(e)?e.call(null,t):e},e.prototype.createScales=function(t){var e,n,r=this.attributes,i=r.type,o=r.scale,a=r.range,s=void 0===a?[]:a,l=r.spacing,c=this.containerShape,u=c.width,h=c.height,d=(0,ce.CR)(YA(t),2),f=d[0],p=d[1],g=new NA({domain:[null!==(e=s[0])&&void 0!==e?e:f,null!==(n=s[1])&&void 0!==n?n:p],range:[h,h*(1-o)]});return"line"===i?{type:i,x:new NA({domain:[0,t[0].length-1],range:[0,u]}),y:g}:{type:i,x:new zA({domain:t[0].map((function(t,e){return e})),range:[0,u],paddingInner:l,paddingOuter:l/2,align:.5}),y:g}},e.tag="sparkline",e}(dk),KA={fill:"#fff",lineWidth:1,radius:2,size:10,stroke:"#bfbfbf",strokeOpacity:1,zIndex:0},QA={fill:"#000",fillOpacity:.45,fontSize:12,textAlign:"center",textBaseline:"middle",zIndex:1},JA={x:0,y:0,orientation:"horizontal",showLabel:!0,type:"start"},$A=Mk({foreground:"foreground",handle:"handle",selection:"selection",sparkline:"sparkline",sparklineGroup:"sparkline-group",track:"track",brushArea:"brush-area"},"slider"),tN=Mk({labelGroup:"label-group",label:"label",iconGroup:"icon-group",icon:"icon",iconRect:"icon-rect",iconLine:"icon-line"},"handle"),eN=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,ce.ZT)(e,t),e.prototype.render=function(t,e){var n=t.x,r=t.y,i=t.size,o=void 0===i?10:i,a=t.radius,s=void 0===a?o/4:a,l=t.orientation,c=(0,ce._T)(t,["x","y","size","radius","orientation"]),u=o,h=2.4*u,d=wk(e).maybeAppendByClassName(tN.iconRect,"rect").styles((0,ce.pi)((0,ce.pi)({},c),{width:u,height:h,radius:s,x:n-u/2,y:r-h/2,transformOrigin:"center"})),f=n+1/3*u-u/2,p=n+2/3*u-u/2,g=r+1/4*h-h/2,v=r+3/4*h-h/2;d.maybeAppendByClassName("".concat(tN.iconLine,"-1"),"line").styles((0,ce.pi)({x1:f,x2:f,y1:g,y2:v},c)),d.maybeAppendByClassName("".concat(tN.iconLine,"-2"),"line").styles((0,ce.pi)({x1:p,x2:p,y1:g,y2:v},c)),"vertical"===l&&(d.node().style.transform="rotate(90)")},e}(dk),nN=function(t){function e(e){return t.call(this,e,JA)||this}return(0,ce.ZT)(e,t),e.prototype.renderLabel=function(t){var e=this,n=this.attributes,r=n.x,i=n.y,o=n.showLabel,a=vk(this.attributes,"label"),s=a.x,l=void 0===s?0:s,c=a.y,u=void 0===c?0:c,h=a.transform,d=a.transformOrigin,f=(0,ce._T)(a,["x","y","transform","transformOrigin"]),p=(0,ce.CR)(yk(f,[]),2),g=p[0],v=p[1],m=wk(t).maybeAppendByClassName(tN.labelGroup,"g").styles(v),y=(0,ce.pi)((0,ce.pi)({},QA),g),b=y.text,x=(0,ce._T)(y,["text"]);Nk(!!o,m,(function(t){e.label=t.maybeAppendByClassName(tN.label,"text").styles((0,ce.pi)((0,ce.pi)({},x),{x:r+l,y:i+u,transform:h,transformOrigin:d,text:"".concat(b)})),e.label.on("mousedown",(function(t){t.stopPropagation()})),e.label.on("touchstart",(function(t){t.stopPropagation()}))}))},e.prototype.renderIcon=function(t){var e=this.attributes,n=e.x,r=e.y,i=e.orientation,o=e.type,a=(0,ce.pi)((0,ce.pi)({x:n,y:r,orientation:i},KA),vk(this.attributes,"icon")),s=this.attributes.iconShape,l=void 0===s?function(){return new eN({style:a})}:s;wk(t).maybeAppendByClassName(tN.iconGroup,"g").selectAll(tN.icon.class).data([l]).join((function(t){return t.append("string"==typeof l?l:function(){return l(o)}).attr("className",tN.icon.name)}),(function(t){return t.update(a)}),(function(t){return t.remove()}))},e.prototype.render=function(t,e){this.renderIcon(e),this.renderLabel(e)},e}(dk),rN=function(t){function e(e){var n=t.call(this,e,(0,ce.pi)((0,ce.pi)((0,ce.pi)({x:0,y:0,animate:{duration:100,fill:"both"},brushable:!0,formatter:function(t){return t.toString()},handleSpacing:2,orientation:"horizontal",padding:0,autoFitLabel:!0,scrollable:!0,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],type:"range",selectionType:"select",handleIconOffset:0},mk(JA,"handle")),mk(KA,"handleIcon")),mk(QA,"handleLabel")))||this;return n.range=[0,1],n.onDragStart=function(t){return function(e){e.stopPropagation(),n.target=t,n.prevPos=n.getOrientVal(rA(e));var r=n.availableSpace,i=r.x,o=r.y,a=n.getBBox(),s=a.x,l=a.y;n.selectionStartPos=n.getRatio(n.prevPos-n.getOrientVal([i,o])-n.getOrientVal([+s,+l])),n.selectionWidth=0,document.addEventListener("pointermove",n.onDragging),document.addEventListener("pointerup",n.onDragEnd)}},n.onDragging=function(t){var e=n.attributes,r=e.slidable,i=e.brushable,o=e.type;t.stopPropagation();var a=n.getOrientVal(rA(t)),s=a-n.prevPos;if(s){var l=n.getRatio(s);switch(n.target){case"start":r&&n.setValuesOffset(l);break;case"end":r&&n.setValuesOffset(0,l);break;case"selection":r&&n.setValuesOffset(l,l);break;case"track":if(!i)return;n.selectionWidth+=l,"range"===o?n.innerSetValues([n.selectionStartPos,n.selectionStartPos+n.selectionWidth].sort(),!0):n.innerSetValues([0,n.selectionStartPos+n.selectionWidth],!0)}n.prevPos=a}},n.onDragEnd=function(){document.removeEventListener("pointermove",n.onDragging),document.removeEventListener("pointermove",n.onDragging),document.removeEventListener("pointerup",n.onDragEnd),n.target="",n.updateHandlesPosition(!1)},n.onValueChange=function(t){var e=n.attributes,r=e.onChange,i=e.type,o="range"===i?t:t[1],a="range"===i?n.getValues():n.getValues()[1],s=new ws("valuechange",{detail:{oldValue:o,value:a}});n.dispatchEvent(s),null==r||r(a)},n.selectionStartPos=0,n.selectionWidth=0,n.prevPos=0,n.target="",n}return(0,ce.ZT)(e,t),Object.defineProperty(e.prototype,"values",{get:function(){return this.attributes.values},set:function(t){this.attributes.values=this.clampValues(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sparklineStyle",{get:function(){if("horizontal"!==this.attributes.orientation)return null;var t=vk(this.attributes,"sparkline");return(0,ce.pi)((0,ce.pi)({zIndex:0},this.availableSpace),t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"shape",{get:function(){var t=this.attributes,e=t.trackLength,n=t.trackSize,r=(0,ce.CR)(this.getOrientVal([[e,n],[n,e]]),2);return{width:r[0],height:r[1]}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"availableSpace",{get:function(){var t=this.attributes,e=(t.x,t.y,t.padding),n=(0,ce.CR)(Ak(e),4),r=n[0],i=n[1],o=n[2],a=n[3],s=this.shape;return{x:a,y:r,width:s.width-(a+i),height:s.height-(r+o)}},enumerable:!1,configurable:!0}),e.prototype.getValues=function(){return this.values},e.prototype.setValues=function(t,e){void 0===t&&(t=[0,0]),void 0===e&&(e=!1),this.attributes.values=t;var n=!1!==e&&this.attributes.animate;this.updateSelectionArea(n),this.updateHandlesPosition(n)},e.prototype.updateSelectionArea=function(t){var e=this.calcSelectionArea();this.foregroundGroup.selectAll($A.selection.class).each((function(n,r){jk(this,e[r],t)}))},e.prototype.updateHandlesPosition=function(t){this.attributes.showHandle&&(this.startHandle&&jk(this.startHandle,this.getHandleStyle("start"),t),this.endHandle&&jk(this.endHandle,this.getHandleStyle("end"),t))},e.prototype.innerSetValues=function(t,e){void 0===t&&(t=[0,0]),void 0===e&&(e=!1);var n=this.values,r=this.clampValues(t);this.attributes.values=r,this.setValues(r),e&&this.onValueChange(n)},e.prototype.renderTrack=function(t){var e=this.attributes,n=e.x,r=e.y,i=vk(this.attributes,"track");this.trackShape=wk(t).maybeAppendByClassName($A.track,"rect").styles((0,ce.pi)((0,ce.pi)({x:n,y:r},this.shape),i))},e.prototype.renderBrushArea=function(t){var e=this.attributes,n=e.x,r=e.y,i=e.brushable;this.brushArea=wk(t).maybeAppendByClassName($A.brushArea,"rect").styles((0,ce.pi)({x:n,y:r,fill:"transparent",cursor:i?"crosshair":"default"},this.shape))},e.prototype.renderSparkline=function(t){var e=this,n=this.attributes,r=n.x,i=n.y;Nk("horizontal"===n.orientation,wk(t).maybeAppendByClassName($A.sparklineGroup,"g"),(function(t){var n=(0,ce.pi)((0,ce.pi)({},e.sparklineStyle),{x:r,y:i});t.maybeAppendByClassName($A.sparkline,(function(){return new XA({style:n})})).update(n)}))},e.prototype.renderHandles=function(){var t,e=this,n=this.attributes,r=n.showHandle,i=n.type,o=r?"range"===i?["start","end"]:["end"]:[],a=this;null===(t=this.foregroundGroup)||void 0===t||t.selectAll($A.handle.class).data(o.map((function(t){return{type:t}})),(function(t){return t.type})).join((function(t){return t.append((function(t){var n=t.type;return new nN({style:e.getHandleStyle(n)})})).each((function(t){var e=t.type;this.attr("class","".concat($A.handle.name," ").concat(e,"-handle"));var n="".concat(e,"Handle");a[n]=this,this.addEventListener("pointerdown",a.onDragStart(e))}))}),(function(t){return t.each((function(t){var e=t.type;this.update(a.getHandleStyle(e))}))}),(function(t){return t.each((function(t){var e=t.type,n="".concat(e,"Handle");a[n]=void 0})).remove()}))},e.prototype.renderSelection=function(t){var e=this.attributes,n=e.x,r=e.y,i=e.type,o=e.selectionType;this.foregroundGroup=wk(t).maybeAppendByClassName($A.foreground,"g");var a=vk(this.attributes,"selection"),s=function(t){return t.style("visibility",(function(t){return t.show?"visible":"hidden"})).style("cursor",(function(t){return"select"===o?"grab":"invert"===o?"crosshair":"default"})).styles((0,ce.pi)((0,ce.pi)({},a),{transform:"translate(".concat(n,", ").concat(r,")")}))},l=this;this.foregroundGroup.selectAll($A.selection.class).data("value"===i?[]:this.calcSelectionArea().map((function(t,e){return{style:(0,ce.pi)({},t),index:e,show:"select"===o?1===e:1!==e}})),(function(t){return t.index})).join((function(t){return t.append("rect").attr("className",$A.selection.name).call(s).each((function(t,e){var n=this;1===e?(l.selectionShape=wk(this),this.on("pointerdown",(function(t){n.attr("cursor","grabbing"),l.onDragStart("selection")(t)})),l.dispatchCustomEvent(this,"pointerenter","selectionMouseenter"),l.dispatchCustomEvent(this,"pointerleave","selectionMouseleave"),l.dispatchCustomEvent(this,"click","selectionClick"),this.addEventListener("pointerdown",(function(){n.attr("cursor","grabbing")})),this.addEventListener("pointerup",(function(){n.attr("cursor","pointer")})),this.addEventListener("pointerover",(function(){n.attr("cursor","pointer")}))):this.on("pointerdown",l.onDragStart("track"))}))}),(function(t){return t.call(s)}),(function(t){return t.remove()})),this.updateSelectionArea(!1),this.renderHandles()},e.prototype.render=function(t,e){this.renderTrack(e),this.renderSparkline(e),this.renderBrushArea(e),this.renderSelection(e)},e.prototype.clampValues=function(t,e){var n;void 0===e&&(e=4);var r=(0,ce.CR)(this.range,2),i=r[0],o=r[1],a=(0,ce.CR)(this.getValues().map((function(t){return iA(t,e)})),2),s=a[0],l=a[1],c=Array.isArray(t)?t:[s,null!=t?t:l],u=(0,ce.CR)((c||[s,l]).map((function(t){return iA(t,e)})),2),h=u[0],d=u[1];if("value"===this.attributes.type)return[0,le(d,i,o)];h>d&&(h=(n=(0,ce.CR)([d,h],2))[0],d=n[1]);var f=d-h;return f>o-i?[i,o]:h<i?s===i&&l===d?[i,d]:[i,f+i]:d>o?l===o&&s===h?[h,o]:[o-f,o]:[h,d]},e.prototype.calcSelectionArea=function(t){var e=(0,ce.CR)(this.clampValues(t),2),n=e[0],r=e[1],i=this.availableSpace,o=i.x,a=i.y,s=i.width,l=i.height;return this.getOrientVal([[{y:a,height:l,x:o,width:n*s},{y:a,height:l,x:n*s+o,width:(r-n)*s},{y:a,height:l,x:r*s,width:(1-r)*s}],[{x:o,width:s,y:a,height:n*l},{x:o,width:s,y:n*l+a,height:(r-n)*l},{x:o,width:s,y:r*l,height:(1-r)*l}]])},e.prototype.calcHandlePosition=function(t){var e=this.attributes.handleIconOffset,n=this.availableSpace,r=n.x,i=n.y,o=n.width,a=n.height,s=(0,ce.CR)(this.clampValues(),2),l=s[0],c=s[1],u="start"===t?-e:e,h=("start"===t?l:c)*this.getOrientVal([o,a])+u;return{x:r+this.getOrientVal([h,o/2]),y:i+this.getOrientVal([a/2,h])}},e.prototype.inferTextStyle=function(t){return"horizontal"===this.attributes.orientation?{}:"start"===t?{transformOrigin:"left center",transform:"rotate(90)",textAlign:"start"}:"end"===t?{transformOrigin:"right center",transform:"rotate(90)",textAlign:"end"}:{}},e.prototype.calcHandleText=function(t){var e,n=this.attributes,r=n.type,i=n.orientation,o=n.formatter,a=n.autoFitLabel,s=vk(this.attributes,"handle"),l=vk(s,"label"),c=s.spacing,u=this.getHandleSize(),h=this.clampValues(),d=o("start"===t?h[0]:h[1]),f=new xk({style:(0,ce.pi)((0,ce.pi)((0,ce.pi)({},l),this.inferTextStyle(t)),{text:d})}),p=f.getBBox(),g=p.width,v=p.height;if(f.destroy(),!a){if("value"===r)return{text:d,x:0,y:-v-c};var m=c+u+("horizontal"===i?g/2:0);return(e={text:d})["horizontal"===i?"x":"y"]="start"===t?-m:m,e}var y=0,b=0,x=this.availableSpace,E=x.width,w=x.height,k=this.calcSelectionArea()[1],M=k.x,S=k.y,A=k.width,N=k.height,C=c+u;if("horizontal"===i){var O=C+g/2;if("start"===t)y=M-C-g>0?-O:O;else y=E-M-A-C>g?O:-O}else{var T=v+C;b="start"===t?S-u>v?-T:C:w-(S+N)-u>v?T:-C}return{x:y,y:b,text:d}},e.prototype.getHandleLabelStyle=function(t){var e=vk(this.attributes,"handleLabel");return(0,ce.pi)((0,ce.pi)((0,ce.pi)({},e),this.calcHandleText(t)),this.inferTextStyle(t))},e.prototype.getHandleIconStyle=function(){var t=this.attributes.handleIconShape,e=vk(this.attributes,"handleIcon"),n=this.getOrientVal(["ew-resize","ns-resize"]),r=this.getHandleSize();return(0,ce.pi)({cursor:n,shape:t,size:r},e)},e.prototype.getHandleStyle=function(t){var e=this.attributes,n=e.x,r=e.y,i=e.showLabel,o=e.showLabelOnInteraction,a=e.orientation,s=this.calcHandlePosition(t),l=s.x,c=s.y,u=this.calcHandleText(t),h=i;return!i&&o&&(h=!!this.target),(0,ce.pi)((0,ce.pi)((0,ce.pi)({},mk(this.getHandleIconStyle(),"icon")),mk((0,ce.pi)((0,ce.pi)({},this.getHandleLabelStyle(t)),u),"label")),{transform:"translate(".concat(l+n,", ").concat(c+r,")"),orientation:a,showLabel:h,type:t,zIndex:3})},e.prototype.getHandleSize=function(){var t=this.attributes,e=t.handleIconSize,n=t.width,r=t.height;return e||Math.floor((this.getOrientVal([+r,+n])+4)/2.4)},e.prototype.getOrientVal=function(t){var e=(0,ce.CR)(t,2),n=e[0],r=e[1];return"horizontal"===this.attributes.orientation?n:r},e.prototype.setValuesOffset=function(t,e){void 0===e&&(e=0);var n=this.attributes.type,r=(0,ce.CR)(this.getValues(),2),i=[r[0]+("range"===n?t:0),r[1]+e].sort();this.innerSetValues(i,!0)},e.prototype.getRatio=function(t){var e=this.availableSpace,n=e.width,r=e.height;return t/this.getOrientVal([n,r])},e.prototype.dispatchCustomEvent=function(t,e,n){var r=this;t.on(e,(function(t){t.stopPropagation(),r.dispatchEvent(new ws(n,{detail:t}))}))},e.prototype.bindEvents=function(){this.addEventListener("wheel",this.onScroll);var t=this.brushArea;this.dispatchCustomEvent(t,"click","trackClick"),this.dispatchCustomEvent(t,"pointerenter","trackMouseenter"),this.dispatchCustomEvent(t,"pointerleave","trackMouseleave"),t.on("pointerdown",this.onDragStart("track"))},e.prototype.onScroll=function(t){if(this.attributes.scrollable){var e=t.deltaX,n=t.deltaY||e,r=this.getRatio(n);this.setValuesOffset(r,r)}},e.tag="slider",e}(dk),iN={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",radius:0,zIndex:999},oN=Mk({background:"background",labelGroup:"label-group",label:"label"},"indicator"),aN=function(t){function e(e){var n=t.call(this,e,iN)||this;return n.point=[0,0],n.group=n.appendChild(new Al({})),n.isMutationObserved=!0,n}return(0,ce.ZT)(e,t),e.prototype.renderBackground=function(){if(this.label){var t=this.attributes,e=t.position,n=t.padding,r=(0,ce.CR)(Ak(n),4),i=r[0],o=r[1],a=r[2],s=r[3],l=this.label.node().getLocalBounds(),c=l.min,u=l.max,h=new kk(c[0]-s,c[1]-i,u[0]+o-c[0]+s,u[1]+a-c[1]+i),d=this.getPath(e,h),f=vk(this.attributes,"background");this.background=wk(this.group).maybeAppendByClassName(oN.background,"path").styles((0,ce.pi)((0,ce.pi)({},f),{d:d})),this.group.appendChild(this.label.node())}},e.prototype.renderLabel=function(){var t=this.attributes,e=t.formatter,n=t.labelText,r=vk(this.attributes,"label"),i=(0,ce.CR)(yk(r),2),o=i[0],a=i[1],s=(o.text,(0,ce._T)(o,["text"]));(this.label=wk(this.group).maybeAppendByClassName(oN.labelGroup,"g").styles(a),n)&&this.label.maybeAppendByClassName(oN.label,(function(){return tM(e(n))})).style("text",e(n).toString()).selectAll("text").styles(s)},e.prototype.adjustLayout=function(){var t=(0,ce.CR)(this.point,2),e=t[0],n=t[1],r=this.attributes,i=r.x,o=r.y;this.group.attr("transform","translate(".concat(i-e,", ").concat(o-n,")"))},e.prototype.getPath=function(t,e){var n=this.attributes.radius,r=e.x,i=e.y,o=e.width,a=e.height,s=[["M",r+n,i],["L",r+o-n,i],["A",n,n,0,0,1,r+o,i+n],["L",r+o,i+a-n],["A",n,n,0,0,1,r+o-n,i+a],["L",r+n,i+a],["A",n,n,0,0,1,r,i+a-n],["L",r,i+n],["A",n,n,0,0,1,r+n,i],["Z"]],l={top:4,right:6,bottom:0,left:2}[t],c=this.createCorner([s[l].slice(-2),s[l+1].slice(-2)]);return s.splice.apply(s,(0,ce.ev)([l+1,1],(0,ce.CR)(c),!1)),s[0][0]="M",s},e.prototype.createCorner=function(t,e){void 0===e&&(e=10);var n=$k.apply(void 0,(0,ce.ev)([],(0,ce.CR)(t),!1)),r=(0,ce.CR)(t,2),i=(0,ce.CR)(r[0],2),o=i[0],a=i[1],s=(0,ce.CR)(r[1],2),l=s[0],c=s[1],u=(0,ce.CR)(n?[l-o,[o,l]]:[c-a,[a,c]],2),h=u[0],d=(0,ce.CR)(u[1],2),f=d[0],p=d[1],g=h/2,v=e*(h/Math.abs(h)),m=v/2,y=v*Math.sqrt(3)/2*.8,b=(0,ce.CR)([f,f+g-m,f+g,f+g+m,p],5),x=b[0],E=b[1],w=b[2],k=b[3],M=b[4];return n?(this.point=[w,a-y],[["L",x,a],["L",E,a],["L",w,a-y],["L",k,a],["L",M,a]]):(this.point=[o+y,w],[["L",o,x],["L",o,E],["L",o+y,w],["L",o,k],["L",o,M]])},e.prototype.applyVisibility=function(){"hidden"===this.attributes.visibility?ok(this):ik(this)},e.prototype.bindEvents=function(){this.label.on(Ps.BOUNDS_CHANGED,this.renderBackground)},e.prototype.render=function(){this.renderLabel(),this.renderBackground(),this.adjustLayout(),this.applyVisibility()},e}(dk),sN=function(t){function e(n){var r=t.call(this,lk({},e.defaultOptions,n))||this;return r.hoverColor="#f5f5f5",r.selectedColor="#e6f7ff",r.background=r.appendChild(new zl({})),r.label=r.background.appendChild(new Al({})),r}return(0,ce.ZT)(e,t),Object.defineProperty(e.prototype,"padding",{get:function(){return Ak(this.style.padding)},enumerable:!1,configurable:!0}),e.prototype.renderLabel=function(){var t=this.style,e=t.label,n=t.value,r=vk(this.attributes,"label");wk(this.label).maybeAppend(".label",(function(){return tM(e)})).attr("className","label").styles(r),this.label.attr("__data__",n)},e.prototype.renderBackground=function(){var t=this.label.getBBox(),e=(0,ce.CR)(this.padding,4),n=e[0],r=e[1],i=e[2],o=e[3],a=t.width,s=t.height,l=a+o+r,c=s+n+i,u=vk(this.attributes,"background"),h=this.style,d=h.width,f=void 0===d?0:d,p=h.height,g=void 0===p?0:p,v=h.selected;this.background.attr((0,ce.pi)((0,ce.pi)({},u),{width:Math.max(l,f),height:Math.max(c,g),fill:v?this.selectedColor:"#fff"})),this.label.attr({transform:"translate(".concat(o,", ").concat((c-s)/2,")")})},e.prototype.render=function(){this.renderLabel(),this.renderBackground()},e.prototype.bindEvents=function(){var t=this;this.addEventListener("pointerenter",(function(){t.style.selected||t.background.attr("fill",t.hoverColor)})),this.addEventListener("pointerleave",(function(){t.style.selected||t.background.attr("fill",t.style.backgroundFill)}));var e=this;this.addEventListener("click",(function(){var n=t.style,r=n.label,i=n.value,o=n.onClick;null==o||o(i,{label:r,value:i},e)}))},e.defaultOptions={style:{value:"",label:"",cursor:"pointer"}},e}(dk),lN=function(t){function e(n){var r,i,o=t.call(this,lk({},e.defaultOptions,n))||this;o.currentValue=null===(r=e.defaultOptions.style)||void 0===r?void 0:r.defaultValue,o.isPointerInSelect=!1,o.select=o.appendChild(new zl({className:"select",style:{cursor:"pointer",width:0,height:0}})),o.dropdown=o.appendChild(new zl({className:"dropdown"}));var a=o.style.defaultValue;return a&&(null===(i=o.style.options)||void 0===i?void 0:i.some((function(t){return t.value===a})))&&(o.currentValue=a),o}return(0,ce.ZT)(e,t),e.prototype.setValue=function(t){this.currentValue=t,this.render()},e.prototype.getValue=function(){return this.currentValue},Object.defineProperty(e.prototype,"dropdownPadding",{get:function(){return Ak(this.style.dropdownPadding)},enumerable:!1,configurable:!0}),e.prototype.renderSelect=function(){var t,e=this,n=this.style,r=n.x,i=n.y,o=n.width,a=n.height,s=n.bordered,l=n.showDropdownIcon,c=vk(this.attributes,"select"),u=vk(this.attributes,"placeholder");this.select.attr((0,ce.pi)((0,ce.pi)({x:r,y:i,width:o,height:a},c),{fill:"#fff",strokeWidth:s?1:0}));var h=this.dropdownPadding;l&&wk(this.select).maybeAppend(".dropdown-icon","path").style("d","M-5,-3.5 L0,3.5 L5,-3.5").style("transform","translate(".concat(r+o-10-h[1]-h[3],", ").concat(i+a/2,")")).style("lineWidth",1).style("stroke",this.select.style.stroke);var d=null===(t=this.style.options)||void 0===t?void 0:t.find((function(t){return t.value===e.currentValue})),f=(0,ce.pi)({x:r+h[3]},u);wk(this.select).selectAll(".placeholder").data(d?[]:[1]).join((function(t){return t.append("text").attr("className","placeholder").styles(f).style("y",(function(){var t=this.getBBox();return i+(a-t.height)/2}))}),(function(t){return t.styles(f)}),(function(t){return t.remove()}));var p=vk(this.attributes,"optionLabel"),g=(0,ce.pi)({x:r+h[3]},p);wk(this.select).selectAll(".value").data(d?[d]:[]).join((function(t){return t.append((function(t){return tM(t.label)})).attr("className","value").styles(g).style("y",(function(){var t=this.getBBox();return i+(a-t.height)/2}))}),(function(t){return t.styles(g)}),(function(t){return t.remove()}))},e.prototype.renderDropdown=function(){var t,e,n=this,r=this.style,i=r.x,o=r.y,a=r.width,s=r.height,l=r.options,c=r.onSelect,u=r.open,h=vk(this.attributes,"dropdown"),d=vk(this.attributes,"option"),f=this.dropdownPadding;wk(this.dropdown).maybeAppend(".dropdown-container","g").attr("className","dropdown-container").selectAll(".dropdown-item").data(l,(function(t){return t.value})).join((function(t){return t.append((function(t){return new sN({className:"dropdown-item",style:(0,ce.pi)((0,ce.pi)((0,ce.pi)({},t),d),{width:a-f[1]-f[3],selected:t.value===n.currentValue,onClick:function(t,e,r){n.setValue(t),null==c||c(t,e,r),n.dispatchEvent(new ws("change",{detail:{value:t,option:e,item:r}})),ok(n.dropdown)}})})})).each((function(t,e){var n,r=(null===(n=this.parentNode)||void 0===n?void 0:n.children).reduce((function(t,n,r){return r<e&&(t+=n.getBBox().height),t}),0);this.attr("transform","translate(".concat(f[3],", ").concat(f[0]+r,")"))}))}),(function(t){return t.update((function(t){return{selected:t.value===n.currentValue}}))}),(function(t){return t.remove()}));var p=null===(e=null===(t=this.dropdown.getElementsByClassName("dropdown-container"))||void 0===t?void 0:t[0])||void 0===e?void 0:e.getBBox(),g=h.spacing;this.dropdown.attr((0,ce.pi)({transform:"translate(".concat(i,", ").concat(o+s+g,")"),width:p.width+f[1]+f[3],height:p.height+f[0]+f[2]},h)),!u&&ok(this.dropdown)},e.prototype.render=function(){this.renderSelect(),this.renderDropdown()},e.prototype.bindEvents=function(){var t=this;this.addEventListener("click",(function(t){t.stopPropagation()})),this.select.addEventListener("click",(function(){"visible"===t.dropdown.style.visibility?ok(t.dropdown):ik(t.dropdown)})),this.addEventListener("pointerenter",(function(){t.isPointerInSelect=!0})),this.addEventListener("pointerleave",(function(){t.isPointerInSelect=!1})),null===document||void 0===document||document.addEventListener("click",(function(){t.isPointerInSelect||ok(t.dropdown)}))},e.defaultOptions={style:{x:0,y:0,width:140,height:32,options:[],bordered:!0,defaultValue:"",selectRadius:8,selectStroke:"#d9d9d9",showDropdownIcon:!0,placeholderText:"请选择",placeholderFontSize:12,placeholderTextBaseline:"top",placeholderFill:"#c2c2c2",dropdownFill:"#fff",dropdownStroke:"#d9d9d9",dropdownRadius:8,dropdownShadowBlur:4,dropdownShadowColor:"rgba(0, 0, 0, 0.08)",dropdownPadding:8,dropdownSpacing:10,optionPadding:[8,12],optionFontSize:12,optionTextBaseline:"top",optionBackgroundFill:"#fff",optionBackgroundRadius:4,optionLabelFontSize:12,optionLabelTextBaseline:"top"}},e}(dk),cN=function(t){function e(n){var r=t.call(this,lk({},{style:{backgroundOpacity:e.backgroundOpacities.default}},e.defaultOptions,n))||this;return r.showBackground=!0,r.background=r.appendChild(new zl({})),r.icon=r.appendChild(new Al({})),r}return(0,ce.ZT)(e,t),Object.defineProperty(e.prototype,"label",{get:function(){return"BaseIcon"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lineWidth",{get:function(){return Math.log10(this.attributes.size)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"padding",{get:function(){return Ak(this.attributes.size/5)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"iconSize",{get:function(){var t=this.attributes.size,e=(0,ce.CR)(this.padding,4),n=e[0],r=e[1],i=e[2],o=e[3];return Math.max(t-Math.max(o+r,n+i),2*this.lineWidth+1)},enumerable:!1,configurable:!0}),e.prototype.renderBackground=function(){var t=this.attributes,e=t.x,n=t.y,r=t.size,i=r/2,o=vk(this.attributes,"background");this.background.attr((0,ce.pi)({x:e-i,y:n-i,width:r,height:r},o))},e.prototype.showIndicator=function(){if(this.label){var t=this.attributes.size,e=this.background.getBBox(),n=e.x,r=e.y;this.indicator.update({x:n+t/2,y:r-5,labelText:this.label,visibility:"visible"})}},e.prototype.hideIndicator=function(){this.indicator.update({visibility:"hidden"})},e.prototype.connectedCallback=function(){var e;t.prototype.connectedCallback.call(this);var n=this.attributes.size,r=this.background.getBBox(),i=r.x,o=r.y,a=null===(e=this.ownerDocument)||void 0===e?void 0:e.defaultView;a&&(this.indicator=a.appendChild(new aN({style:{x:i+n/2,y:o-n/2,visibility:"hidden",position:"top",radius:3,zIndex:100}})))},e.prototype.disconnectedCallback=function(){this.indicator.destroy()},e.prototype.render=function(){this.renderIcon(),this.showBackground&&this.renderBackground()},e.prototype.bindEvents=function(){var t=this,n=this.attributes.onClick;if(this.addEventListener("click",(function(){null==n||n(t)})),this.showBackground){var r=function(){return t.background.attr({opacity:e.backgroundOpacities.default})};this.addEventListener("pointerenter",(function(){t.background.attr({opacity:e.backgroundOpacities.hover}),t.showIndicator()})),this.addEventListener("pointerleave",(function(){r(),t.hideIndicator()})),this.addEventListener("pointerdown",(function(){t.background.attr({opacity:e.backgroundOpacities.active})})),this.addEventListener("pointerup",(function(){r()}))}},e.tag="IconBase",e.defaultOptions={style:{x:0,y:0,size:10,color:"#565758",backgroundRadius:4,backgroundFill:"#e2e2e2"}},e.backgroundOpacities={default:0,hover:.8,active:1},e}(dk),uN=function(t,e){return void 0===e&&(e="#565758"),new Dl({style:{fill:e,d:"M ".concat(t,",").concat(t," L -").concat(t,",0 L ").concat(t,",-").concat(t," Z"),transformOrigin:"center"}})},hN=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,ce.ZT)(e,t),e.prototype.arcPath=function(t,e,n){var r=(0,ce.CR)([n,n],2),i=r[0],o=r[1],a=function(r){return[t+n*Math.cos(r),e+n*Math.sin(r)]},s=(0,ce.CR)(a(-5/4*Math.PI),2),l=s[0],c=s[1],u=(0,ce.CR)(a(1/4*Math.PI),2),h=u[0],d=u[1];return"M".concat(l,",").concat(c,",A").concat(i,",").concat(o,",0,1,1,").concat(h,",").concat(d)},Object.defineProperty(e.prototype,"label",{get:function(){return"重置"},enumerable:!1,configurable:!0}),e.prototype.renderIcon=function(){var t=this.attributes,e=t.x,n=t.y,r=t.color,i=this.iconSize,o=this.lineWidth,a=o+.5;wk(this.icon).maybeAppend(".reset","path").styles({stroke:r,lineWidth:o,d:this.arcPath(e,n,i/2-o),markerStart:uN(a,r)})},e}(cN),dN=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,ce.ZT)(e,t),Object.defineProperty(e.prototype,"label",{get:function(){return"快退"},enumerable:!1,configurable:!0}),e.prototype.renderIcon=function(){var t=this.attributes,e=t.x,n=t.y,r=t.color,i=this.iconSize,o=i/2,a=i/2/Math.pow(3,.5),s=[[e,n],[e,n-a],[e-o,n],[e,n+a],[e,n],[e+o,n-a],[e+o,n+a],[e,n]];wk(this.icon).maybeAppend(".backward","polygon").styles({points:s,fill:r})},e}(cN),fN=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,ce.ZT)(e,t),Object.defineProperty(e.prototype,"label",{get:function(){return"快进"},enumerable:!1,configurable:!0}),e.prototype.renderIcon=function(){var t=this.attributes,e=t.x,n=t.y,r=t.color,i=this.iconSize,o=i/2,a=i/2/Math.pow(3,.5),s=[[e,n],[e,n-a],[e+o,n],[e,n+a],[e,n],[e-o,n-a],[e-o,n+a],[e,n]];wk(this.icon).maybeAppend(".forward","polygon").styles({points:s,fill:r})},e}(cN),pN=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,ce.ZT)(e,t),Object.defineProperty(e.prototype,"label",{get:function(){return"播放"},enumerable:!1,configurable:!0}),e.prototype.renderIcon=function(){var t=this.attributes,e=t.x,n=t.y,r=t.color,i=this.iconSize,o=i/3*Math.pow(3,.5)*.8,a=[[e+o,n],[e-o/2,n-i/2*.8],[e-o/2,n+i/2*.8],[e+o,n]];wk(this.icon).maybeAppend(".play","polygon").styles({points:a,fill:r})},e}(cN),gN=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,ce.ZT)(e,t),Object.defineProperty(e.prototype,"label",{get:function(){return"暂停"},enumerable:!1,configurable:!0}),e.prototype.renderIcon=function(){var t=this.attributes,e=t.x,n=t.y,r=t.color,i=this.iconSize,o=i/3,a=[[e-o,n-i/2],[e-o,n+i/2],[e-o/2,n+i/2],[e-o/2,n-i/2],[e-o,n-i/2],[e+o/2,n-i/2],[e+o/2,n+i/2],[e+o,n+i/2],[e+o,n-i/2]];wk(this.icon).maybeAppend(".pause","polygon").styles({points:a,fill:r})},e}(cN),vN=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,ce.ZT)(e,t),Object.defineProperty(e.prototype,"label",{get:function(){return"范围时间"},enumerable:!1,configurable:!0}),e.prototype.renderIcon=function(){var t=this.attributes,e=t.x,n=t.y,r=t.color,i=this.iconSize,o=this.lineWidth,a=o;wk(this.icon).maybeAppend(".left-line","line").styles({x1:e-i/2,y1:n-i/2,x2:e-i/2,y2:n+i/2,stroke:r,lineWidth:o}),wk(this.icon).maybeAppend(".right-line","line").styles({x1:e+i/2,y1:n-i/2,x2:e+i/2,y2:n+i/2,stroke:r,lineWidth:o}),wk(this.icon).maybeAppend(".left-arrow","line").styles({x1:e,y1:n,x2:e-i/2+2*a,y2:n,stroke:r,lineWidth:o,markerEnd:uN(2*o,r)}),wk(this.icon).maybeAppend(".right-arrow","line").styles({x1:e,y1:n,x2:e+i/2-2*a,y2:n,stroke:r,lineWidth:o,markerEnd:uN(2*o,r)})},e}(cN),mN=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,ce.ZT)(e,t),Object.defineProperty(e.prototype,"label",{get:function(){return"单一时间"},enumerable:!1,configurable:!0}),e.prototype.renderIcon=function(){var t=this.attributes,e=t.x,n=t.y,r=t.color,i=this.iconSize,o=this.lineWidth;wk(this.icon).maybeAppend(".line","line").styles({x1:e,y1:n-i/2,x2:e,y2:n+i/2,stroke:r,lineWidth:o});var a=o;wk(this.icon).maybeAppend(".left-arrow","line").styles({x1:e-i/2-2*a,y1:n,x2:e-2*a,y2:n,stroke:r,lineWidth:o,markerEnd:uN(2*o,r)}),wk(this.icon).maybeAppend(".right-arrow","line").styles({x1:e+i/2+2*a,y1:n,x2:e+2*a,y2:n,stroke:r,lineWidth:o,markerEnd:uN(2*o,r)})},e}(cN),yN=function(t){return[[-t/2,-t/2],[-t/2,t/2],[t/2,t/2]]},bN=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,ce.ZT)(e,t),Object.defineProperty(e.prototype,"label",{get:function(){return"折线图"},enumerable:!1,configurable:!0}),e.prototype.renderIcon=function(){var t=this.attributes,e=t.x,n=t.y,r=t.color,i=this.iconSize,o=this.lineWidth,a=o,s=(i-2*a-o)/4,l=(i-2*a-o)/2,c=(0,ce.CR)([e-i/2+a,n+i/2-2*a],2),u=c[0],h=c[1];wk(this.icon).maybeAppend(".coordinate","polyline").styles({points:yN(i).map((function(t){var r=(0,ce.CR)(t,2),i=r[0],o=r[1];return[i+e,o+n]})),stroke:r,lineWidth:o}),wk(this.icon).maybeAppend(".line","polyline").styles({points:[[u,h],[u+s,h-l],[u+2*s,h],[u+4*s,h-2*l]],stroke:r,lineWidth:o})},e}(cN),xN=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,ce.ZT)(e,t),Object.defineProperty(e.prototype,"label",{get:function(){return"条形图"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"data",{get:function(){return[1,4,2,4,3]},enumerable:!1,configurable:!0}),e.prototype.renderIcon=function(){var t=this.data,e=this.attributes,n=e.x,r=e.y,i=e.color,o=this.iconSize,a=this.lineWidth,s=a,l=(o-s)/t.length,c=(o-2*s)/4,u=(0,ce.CR)([n-o/2+2*s,r+o/2-s],2),h=u[0],d=u[1];wk(this.icon).maybeAppend(".coordinate","polyline").styles({points:yN(o).map((function(t){var e=(0,ce.CR)(t,2),i=e[0],o=e[1];return[i+n,o+r]})),stroke:i,lineWidth:a}),wk(this.icon).maybeAppend(".bars","g").selectAll(".column").data(this.data.map((function(t,e){return{value:t,index:e}}))).join((function(t){return t.append("line").attr("className","column").style("x1",(function(t){var e=t.index;return h+l*e})).style("y1",d).style("x2",(function(t){var e=t.index;return h+l*e})).style("y2",(function(t){var e=t.value;return d-c*e})).styles({y1:d,stroke:i,lineWidth:a})}))},e}(cN),EN=function(t){function e(e){var n=t.call(this,lk({},{style:{color:"#d8d9d9"}},e))||this;return n.showBackground=!1,n}return(0,ce.ZT)(e,t),e.prototype.renderIcon=function(){var t=this.attributes,e=t.x,n=t.y,r=t.color,i=this.iconSize,o=this.lineWidth;wk(this.icon).maybeAppend(".split","line").styles({x1:e,y1:n-i/2,x2:e,y2:n+i/2,stroke:r,lineWidth:o})},e}(cN),wN=function(t){function e(){var e=t.apply(this,(0,ce.ev)([],(0,ce.CR)(arguments),!1))||this;return e.showBackground=!1,e}return(0,ce.ZT)(e,t),Object.defineProperty(e.prototype,"padding",{get:function(){return Ak(0)},enumerable:!1,configurable:!0}),e.prototype.renderIcon=function(){var t=this.iconSize,e=this.attributes,n=e.x,r=e.y,i=e.speed,o=void 0===i?1:i,a=cE(this.attributes,["x","y","transform","transformOrigin","width","height","size","color","speed"]),s=le(t,20,1/0),l=(0,ce.pi)((0,ce.pi)({},a),{x:n-s/2,y:r-10,width:s,height:20,defaultValue:o,bordered:!1,showDropdownIcon:!1,selectRadius:2,dropdownPadding:this.padding,dropdownRadius:2,dropdownSpacing:t/5,placeholderFontSize:t/2,optionPadding:0,optionLabelFontSize:t/2,optionBackgroundRadius:1,options:[{label:"1x",value:1},{label:"1.5x",value:1.5},{label:"2x",value:2}]});wk(this.icon).maybeAppend(".speed",(function(){return new lN({style:l})})).attr("className","speed").each((function(){this.update(l)}))},e.tag="SpeedSelect",e}(cN),kN=function(t){function e(e){var n=t.call(this,e)||this;return n.icon=n.appendChild(new Al({})),n.currentType=n.attributes.type,n}return(0,ce.ZT)(e,t),e.prototype.getType=function(){return this.currentType},e.prototype.render=function(){var t=this,e=this.attributes,n=(e.onChange,(0,ce._T)(e,["onChange"]));wk(this.icon).selectAll(".icon").data([this.currentType]).join((function(e){return e.append((function(e){var n,r=null===(n=t.toggles.find((function(t){return(0,ce.CR)(t,1)[0]===e})))||void 0===n?void 0:n[1];if(!r)throw new Error("Invalid type: ".concat(e));return new r({})})).attr("className","icon").styles(n,!1).update({})}),(function(t){return t.styles({restStyles:n}).update({})}),(function(t){return t.remove()}))},e.prototype.bindEvents=function(){var t=this,e=this.attributes.onChange;this.addEventListener("click",(function(n){n.preventDefault(),n.stopPropagation();var r=(t.toggles.findIndex((function(e){return(0,ce.CR)(e,1)[0]===t.currentType}))+1)%t.toggles.length,i=t.toggles[r][0];null==e||e(t.currentType),t.currentType=i,t.render()}))},e.tag="ToggleIcon",e}(dk),MN=function(t){function e(e){var n=t.call(this,lk({},{style:{type:"play"}},e))||this;return n.toggles=[["play",pN],["pause",gN]],n}return(0,ce.ZT)(e,t),e}(kN),SN=function(t){function e(e){var n=t.call(this,lk({},{style:{type:"range"}},e))||this;return n.toggles=[["range",vN],["value",mN]],n}return(0,ce.ZT)(e,t),e}(kN),AN=function(t){function e(e){var n=t.call(this,lk({},{style:{type:"column"}},e))||this;return n.toggles=[["line",bN],["column",xN]],n}return(0,ce.ZT)(e,t),e}(kN),NN={reset:hN,speed:wN,backward:dN,playPause:MN,forward:fN,selectionType:SN,chartType:AN,split:EN},CN=function(t){function e(n){var r=t.call(this,lk({},e.defaultOptions,n))||this;return r.background=r.appendChild(new zl({})),r.functions=r.appendChild(new Al({})),r}return(0,ce.ZT)(e,t),Object.defineProperty(e.prototype,"padding",{get:function(){return Ak(this.attributes.padding)},enumerable:!1,configurable:!0}),e.prototype.renderBackground=function(){var t=this.style,e=t.x,n=t.y,r=t.width,i=t.height,o=vk(this.attributes,"background");this.background.attr((0,ce.pi)({x:e,y:n,width:r,height:i},o))},e.prototype.renderFunctions=function(){var t,e=this,n=this.attributes,r=n.functions,i=n.iconSize,o=n.iconSpacing,a=n.x,s=n.y,l=n.width,c=n.height,u=n.align,h=(0,ce.CR)(this.padding,4),d=h[1],f=h[3],p=r.reduce((function(t,e){return t.length&&e.length?t.concat.apply(t,(0,ce.ev)(["split"],(0,ce.CR)(e),!1)):t.concat.apply(t,(0,ce.ev)([],(0,ce.CR)(e),!1))}),[]),g=p.length*(i+o)-o,v={left:f+i/2,center:(l-g)/2+i/2,right:l-g-f-d+i/2}[u]||0;null===(t=this.speedSelect)||void 0===t||t.destroy(),this.functions.removeChildren(),p.forEach((function(t,n){var r,l=NN[t],u={x:a+n*(i+o)+v,y:s+c/2,size:i};if(l===wN?(u.speed=e.attributes.speed,u.onSelect=function(n){return e.handleFunctionChange(t,{value:n})}):[MN,SN,AN].includes(l)?(u.onChange=function(n){return e.handleFunctionChange(t,{value:n})},l===MN&&(u.type="play"===e.attributes.state?"pause":"play"),l===SN&&(u.type="range"===e.attributes.selectionType?"value":"range"),l===AN&&(u.type="line"===e.attributes.chartType?"column":"line")):u.onClick=function(){return e.handleFunctionChange(t,{value:t})},l===wN){var h=null===(r=e.ownerDocument)||void 0===r?void 0:r.defaultView;h&&(e.speedSelect=new l({style:(0,ce.pi)((0,ce.pi)({},u),{zIndex:100})}),h.appendChild(e.speedSelect))}else e.functions.appendChild(new l({style:u}))}))},e.prototype.disconnectedCallback=function(){var e;t.prototype.disconnectedCallback.call(this),null===(e=this.speedSelect)||void 0===e||e.destroy()},e.prototype.render=function(){this.renderBackground(),this.renderFunctions()},e.prototype.handleFunctionChange=function(t,e){var n=this.attributes.onChange;null==n||n(t,e)},e.defaultOptions={style:{x:0,y:0,width:300,height:40,padding:0,align:"center",iconSize:25,iconSpacing:0,speed:1,state:"pause",chartType:"line",selectionType:"range",backgroundFill:"#fbfdff",backgroundStroke:"#ebedf0",functions:[["reset","speed"],["backward","playPause","forward"],["selectionType","chartType"]]}},e}(dk),ON=function(t){function e(n){var r=t.call(this,lk({},e.defaultOptions,n))||this;return r.bindEvents(),r}return(0,ce.ZT)(e,t),e.prototype.bindEvents=function(){var t=this;this.addEventListener("mouseenter",(function(){t.attr("lineWidth",Math.ceil(+(t.style.r||0)/2))})),this.addEventListener("mouseleave",(function(){t.attr("lineWidth",0)}))},e.defaultOptions={style:{r:5,fill:"#3f7cf7",lineWidth:0,stroke:"#3f7cf7",strokeOpacity:.5,cursor:"pointer"}},e}(wl),TN=function(t){function e(n){return t.call(this,lk({},e.defaultOptions,n))||this}return(0,ce.ZT)(e,t),e.prototype.renderBackground=function(){var t=this.attributes,e=t.x,n=t.y,r=t.width,i=t.height,o=vk(this.attributes,"background");wk(this).maybeAppend("background","rect").attr("className","background").styles((0,ce.pi)({x:e-r/2,y:n-i/2,width:r,height:i},o))},e.prototype.renderIcon=function(){var t=this.attributes,e=t.x,n=t.y,r=t.iconSize,i=vk(this.attributes,"icon"),o=r/2;wk(this).maybeAppend("icon-left-line","line").attr("className","icon-left-line").styles((0,ce.pi)({x1:e-1,y1:n-o,x2:e-1,y2:n+o},i)),wk(this).maybeAppend("icon-right-line","line").attr("className","icon-right-line").styles((0,ce.pi)({x1:e+1,y1:n-o,x2:e+1,y2:n+o},i))},e.prototype.renderBorder=function(){var t=this.attributes,e=t.x,n=t.y,r=t.width,i=t.height,o=t.type,a=vk(this.attributes,"border"),s="start"===o?+r/2:-r/2;wk(this).maybeAppend("border","line").attr("className","border").styles((0,ce.pi)({x1:s+e,y1:n-i/2,x2:s+e,y2:n+i/2},a))},e.prototype.render=function(){this.renderBackground(),this.renderIcon(),this.renderBorder()},e.defaultOptions={style:{x:0,y:0,width:10,height:50,iconSize:10,type:"start",backgroundFill:"#fff",backgroundFillOpacity:.5,iconStroke:"#9a9a9a",iconLineWidth:1,borderStroke:"#e8e8e8",borderLineWidth:1}},e}(dk);function PN(t,e){return"number"==typeof t?RN(t):function(t,e){var n=new Date(t);switch(e){case"half-hour":case"hour":case"four-hour":return[0,6,12,18].includes(n.getHours())&&0===n.getMinutes()?FM(n,"HH:mm\nYYYY-MM-DD"):FM(n,"HH:mm");case"half-day":return n.getHours()<12?"AM\n".concat(FM(n,"YYYY-MM-DD")):"PM";case"day":return[1,10,20].includes(n.getDate())?FM(n,"DD\nYYYY-MM"):FM(n,"DD");case"week":return n.getDate()<=7?FM(n,"DD\nYYYY-MM"):FM(n,"DD");case"month":return[0,6].includes(n.getMonth())?FM(n,"MM月\nYYYY"):FM(n,"MM月");case"season":return[0].includes(n.getMonth())?FM(n,"MM月\nYYYY"):FM(n,"MM月");case"year":return FM(n,"YYYY");default:return FM(n,"YYYY-MM-DD HH:mm")}}(t,e)}function RN(t){var e=String(Math.floor(t/3600)).padStart(2,"0"),n=String(Math.floor(t%3600/60)).padStart(2,"0"),r=String(Math.floor(t%60)).padStart(2,"0");return t<3600?"".concat(n,":").concat(r):"".concat(e,":").concat(n,":").concat(r)}var DN=function(t){function e(n){var r=t.call(this,lk({},e.defaultOptions,n))||this;r.axis=r.appendChild(new nA({style:{type:"linear",startPos:[0,0],endPos:[0,0],data:[],showArrow:!1,animate:!1}})),r.timeline=r.appendChild(new rN({style:{onChange:function(t){r.handleSliderChange(t)}}})),r.controller=r.appendChild(new CN({})),r.states={},r.handleSliderChange=function(t){var e,n=(e=r.states.values,Array.isArray(e)?(0,ce.ev)([],(0,ce.CR)(e),!1):e);r.setBySliderValues(t),r.dispatchOnChange(n)};var i=r.attributes,o=i.selectionType,a=i.chartType,s=i.speed,l=i.state,c=i.playMode,u=i.values;return r.states={chartType:a,playMode:c,selectionType:o,speed:s,state:l},r.setByTimebarValues(u),r}return(0,ce.ZT)(e,t),Object.defineProperty(e.prototype,"data",{get:function(){return this.attributes.data.sort((function(t,e){return t.time<e.time?-1:t.time>e.time?1:0}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"space",{get:function(){var t=this.attributes,e=t.x,n=t.y,r=t.width,i=t.height,o=t.type,a=t.controllerHeight,s=le(+i-a,0,+i),l=new kk(e,n+ +i-a,+r,a),c=0,u="time"===o?10:s;return{axisBBox:"chart"===o?new kk(e,n+s-(c=35),+r,c):new kk,controllerBBox:l,timelineBBox:new kk(e,n+("time"===o?s:s-u),+r,u-c)}},enumerable:!1,configurable:!0}),e.prototype.setBySliderValues=function(t){var e,n,r=this.data,i=(0,ce.CR)(Array.isArray(t)?t:[0,t],2),o=i[0],a=i[1],s=r.length,l=r[Math.floor(o*s)],c=r[Math.ceil(a*s)-(Array.isArray(t)?0:1)];this.states.values=[null!==(e=null==l?void 0:l.time)&&void 0!==e?e:r[0].time,null!==(n=null==c?void 0:c.time)&&void 0!==n?n:1/0]},e.prototype.setByTimebarValues=function(t){var e,n,r,i=this.data,o=(0,ce.CR)(Array.isArray(t)?t:[void 0,t],2),a=o[0],s=o[1],l=i.find((function(t){return t.time===a})),c=i.find((function(t){return t.time===s}));this.states.values=[null!==(e=null==l?void 0:l.time)&&void 0!==e?e:null===(n=i[0])||void 0===n?void 0:n.time,null!==(r=null==c?void 0:c.time)&&void 0!==r?r:1/0]},e.prototype.setByIndex=function(t){var e,n,r,i,o=this.data,a=(0,ce.CR)(t,2),s=a[0],l=a[1];this.states.values=[null!==(n=null===(e=o[s])||void 0===e?void 0:e.time)&&void 0!==n?n:o[0].time,null!==(i=null===(r=this.data[l])||void 0===r?void 0:r.time)&&void 0!==i?i:1/0]},Object.defineProperty(e.prototype,"sliderValues",{get:function(){var t,e=this.states,n=e.values,r=e.selectionType,i=(0,ce.CR)(Array.isArray(n)?n:[void 0,n],2),o=i[0],a=i[1],s=this.data,l=s.length,c="value"===r;return[(t=s.findIndex((function(t){return t.time===o})),c?0:t>-1?t/l:0),function(){if(a===1/0)return 1;var t=s.findIndex((function(t){return t.time===a}));return t>-1?t/l:c?.5:1}()]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"values",{get:function(){var t=this.states,e=t.values,n=t.selectionType,r=(0,ce.CR)(Array.isArray(e)?e:[this.data[0].time,e],2),i=r[0],o=r[1];return"value"===n?o:[i,o]},enumerable:!1,configurable:!0}),e.prototype.getDatumByRatio=function(t){var e=this.data,n=e.length;return e[Math.floor(t*(n-1))]},Object.defineProperty(e.prototype,"chartHandleIconShape",{get:function(){var t=this.states.selectionType,e=this.space.timelineBBox.height;return"range"===t?function(t){return new TN({style:{type:t,height:e,iconSize:e/6}})}:function(){return new Pl({style:{x1:0,y1:-e/2,x2:0,y2:e/2,lineWidth:2,stroke:"#c8c8c8"}})}},enumerable:!1,configurable:!0}),e.prototype.getChartStyle=function(t){var e=this,n=t.x,r=t.y,i=t.width,o=t.height,a=this.states,s=a.selectionType,l=a.chartType,c=this.data,u=this.attributes,h=u.type,d=u.labelFormatter,f=vk(this.attributes,"chart"),p=(f.type,(0,ce._T)(f,["type"])),g="range"===s;if("time"===h)return(0,ce.pi)({handleIconShape:function(){return new ON({})},selectionFill:"#2e7ff8",selectionFillOpacity:1,showLabelOnInteraction:!0,handleLabelDy:g?-15:0,autoFitLabel:g,handleSpacing:g?-15:0,trackFill:"#edeeef",trackLength:i,trackOpacity:.5,trackRadius:o/2,trackSize:o/2,type:s,values:this.sliderValues,formatter:function(t){if(d)return d(t);var n=e.getDatumByRatio(t).time;return"number"==typeof n?RN(n):FM(n,"YYYY-MM-DD HH:mm:ss")},transform:"translate(".concat(n,", ").concat(r,")"),zIndex:1},p);var v="range"===s?5:0,m=c.map((function(t){return t.value}));return(0,ce.pi)({handleIconOffset:v,handleIconShape:this.chartHandleIconShape,selectionFill:"#fff",selectionFillOpacity:.5,selectionType:"invert",sparklineSpacing:.1,sparklineColumnLineWidth:0,sparklineColor:"#d4e5fd",sparklineAreaOpacity:1,sparklineAreaLineWidth:0,sparklineData:m,sparklineType:l,sparklineScale:.8,trackLength:i,trackSize:o,type:s,values:this.sliderValues,transform:"translate(".concat(n,", ").concat(r,")"),zIndex:1},p)},e.prototype.renderChart=function(t){void 0===t&&(t=this.space.timelineBBox),this.timeline.update(this.getChartStyle(t))},e.prototype.updateSelection=function(){this.timeline.setValues(this.sliderValues,!0),this.handleSliderChange(this.sliderValues)},e.prototype.getAxisStyle=function(t){var e=this.data,n=this.attributes,r=n.interval,i=n.labelFormatter,o=vk(this.attributes,"axis"),a=t.x,s=t.y,l=t.width,c=(0,ce.ev)((0,ce.ev)([],(0,ce.CR)(e),!1),[{time:0}],!1).map((function(t,e,n){var r=t.time;return{label:"".concat(r),value:e/(n.length-1),time:r}})),u=(0,ce.pi)({startPos:[a,s],endPos:[a+l,s],data:c,labelFilter:function(t,e){return e<c.length-1},labelFormatter:function(t){var e=t.time;return i?i(e):PN(e,r)}},o);return u},e.prototype.renderAxis=function(t){void 0===t&&(t=this.space.axisBBox),"chart"===this.attributes.type&&this.axis.update(this.getAxisStyle(t))},e.prototype.renderController=function(t){void 0===t&&(t=this.space.controllerBBox);var e=this.attributes.type,n=this.states,r=n.state,i=n.speed,o=n.selectionType,a=n.chartType,s=vk(this.attributes,"controller"),l=this,c=(0,ce.pi)((0,ce.pi)((0,ce.pi)({},t),{iconSize:20,speed:i,state:r,selectionType:o,chartType:a,onChange:function(t,e){var n=e.value;switch(t){case"reset":l.internalReset();break;case"speed":l.handleSpeedChange(n);break;case"backward":l.internalBackward();break;case"playPause":"play"===n?l.internalPlay():l.internalPause();break;case"forward":l.internalForward();break;case"selectionType":l.handleSelectionTypeChange(n);break;case"chartType":l.handleChartTypeChange(n)}}}),s);"time"===e&&(c.functions=[["reset","speed"],["backward","playPause","forward"],["selectionType"]]),this.controller.update(c)},e.prototype.dispatchOnChange=function(t){var e=this.data,n=this.attributes.onChange,r=this.states,i=r.values,o=r.selectionType,a=(0,ce.CR)(i,2),s=a[0],l=a[1],c=l===1/0?e.at(-1).time:l;t&&function(t,e){if(Array.isArray(t)){if(!Array.isArray(e))return!1;if(t[0]===e[0]){if(t[1]===e[1])return!0;if(t[1]===1/0||e[1]===1/0)return!0}return!1}return!Array.isArray(e)&&t===e}(t,"range"===o?[s,c]:c)||null==n||n("range"===o?[s,c]:c)},e.prototype.internalReset=function(t){var e,n,r=this.states.selectionType;this.internalPause(),this.setBySliderValues("range"===r?[0,1]:[0,0]),this.renderController(),this.updateSelection(),t||(null===(n=null===(e=this.attributes)||void 0===e?void 0:e.onReset)||void 0===n||n.call(e),this.dispatchOnChange())},e.prototype.reset=function(){this.internalReset()},e.prototype.moveSelection=function(t,e){var n=this.data,r=n.length,i=this.states,o=i.values,a=i.selectionType,s=i.playMode,l=(0,ce.CR)(o,2),c=l[0],u=l[1],h=n.findIndex((function(t){return t.time===c})),d=n.findIndex((function(t){return t.time===u}));-1===d&&(d=r);var f,p="backward"===t?-1:1;"range"===a?"acc"===s?(f=[h,d+p],-1===p&&h===d&&(f=[h,r])):f=[h+p,d+p]:f=[h,d+p];var g=function(t){var e=(0,ce.CR)(t.sort((function(t,e){return t-e})),2),n=e[0],i=e[1],o=function(t){return le(t,0,r)};return i>r?"value"===a?[0,0]:"acc"===s?[o(n),o(n)]:[0,o(i-n)]:n<0?"acc"===s?[0,o(i)]:[o(n+r-i),r]:[o(n),o(i)]}(f);return this.setByIndex(g),this.updateSelection(),g},e.prototype.internalBackward=function(t){var e,n,r=this.moveSelection("backward",t);return t||(null===(n=null===(e=this.attributes)||void 0===e?void 0:e.onBackward)||void 0===n||n.call(e),this.dispatchOnChange()),r},e.prototype.backward=function(){this.internalBackward()},e.prototype.internalPlay=function(t){var e,n,r=this,i=this.data,o=this.attributes.loop,a=this.states.speed,s=void 0===a?1:a;this.playInterval=window.setInterval((function(){r.internalForward()[1]!==i.length||o||(r.internalPause(),r.renderController())}),1e3/s),this.states.state="play",!t&&(null===(n=null===(e=this.attributes)||void 0===e?void 0:e.onPlay)||void 0===n||n.call(e))},e.prototype.play=function(){this.internalPlay()},e.prototype.internalPause=function(t){var e,n;clearInterval(this.playInterval),this.states.state="pause",!t&&(null===(n=null===(e=this.attributes)||void 0===e?void 0:e.onPause)||void 0===n||n.call(e))},e.prototype.pause=function(){this.internalPause()},e.prototype.internalForward=function(t){var e,n,r=this.moveSelection("forward",t);return t||(null===(n=null===(e=this.attributes)||void 0===e?void 0:e.onForward)||void 0===n||n.call(e),this.dispatchOnChange()),r},e.prototype.forward=function(){this.internalForward()},e.prototype.handleSpeedChange=function(t){var e,n;this.states.speed=t,"play"===this.states.state&&(this.internalPause(!0),this.internalPlay(!0)),null===(n=null===(e=this.attributes)||void 0===e?void 0:e.onSpeedChange)||void 0===n||n.call(e,t)},e.prototype.handleSelectionTypeChange=function(t){var e,n;this.states.selectionType=t,this.renderChart(),null===(n=null===(e=this.attributes)||void 0===e?void 0:e.onSelectionTypeChange)||void 0===n||n.call(e,t)},e.prototype.handleChartTypeChange=function(t){var e,n;this.states.chartType=t,this.renderChart(),null===(n=null===(e=this.attributes)||void 0===e?void 0:e.onChartTypeChange)||void 0===n||n.call(e,t)},e.prototype.render=function(){var t=this.space,e=t.axisBBox,n=t.controllerBBox,r=t.timelineBBox;this.renderController(n),this.renderAxis(e),this.renderChart(r),"play"===this.states.state&&this.internalPlay()},e.prototype.destroy=function(){t.prototype.destroy.call(this),this.internalPause(!0)},e.defaultOptions={style:{x:0,y:0,axisLabelFill:"#6e6e6e",axisLabelTextAlign:"left",axisLabelTextBaseline:"top",axisLabelTransform:"translate(5, -12)",axisLineLineWidth:1,axisLineStroke:"#cacdd1",axisTickLength:15,axisTickLineWidth:1,axisTickStroke:"#cacdd1",chartShowLabel:!1,chartType:"line",controllerAlign:"center",controllerHeight:40,data:[],interval:"day",loop:!1,playMode:"acc",selectionType:"range",type:"time"}},e}(dk);var LN=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(t){o(t)}}function s(t){try{l(r.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}))},IN=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};const BN=["timestamp","time","date","datetime"];class jN extends uE{get padding(){return Uu(this.options.padding)}constructor(t,e){super(t,Object.assign({},jN.defaultOptions,e)),this.backup(),this.upsertTimebar()}play(){var t;null===(t=this.timebar)||void 0===t||t.play()}pause(){var t;null===(t=this.timebar)||void 0===t||t.pause()}forward(){var t;null===(t=this.timebar)||void 0===t||t.forward()}backward(){var t;null===(t=this.timebar)||void 0===t||t.backward()}reset(){var t;null===(t=this.timebar)||void 0===t||t.reset()}update(t){super.update(t),this.backup(),this.upsertTimebar()}backup(){this.originalData=zN(this.context.graph.getData())}upsertTimebar(){const{canvas:t}=this.context,e=this.options,{onChange:n,timebarType:r,data:i,x:o,y:a,width:s,height:l,mode:c}=e,u=IN(e,["onChange","timebarType","data","x","y","width","height","mode"]),h=t.getSize(),[d]=this.padding;this.upsertCanvas().ready.then((()=>{var t;const e=Object.assign(Object.assign({x:h[0]/2-s/2,y:d,onChange:t=>{const e=(Be(t)?t:[t,t]).map((t=>function(t){return t instanceof Date}(t)?t.getTime():t));"modify"===this.options.mode?this.filterElements(e):this.hiddenElements(e),null==n||n(e)}},u),{data:i.map((t=>ie(t)?{time:t,value:0}:t)),width:s,height:l,type:r});this.timebar?this.timebar.update(e):(this.timebar=new DN({style:e}),null===(t=this.canvas)||void 0===t||t.appendChild(this.timebar))}))}upsertCanvas(){if(this.canvas)return this.canvas;const{className:t,height:e,position:n}=this.options,r=this.context.canvas,[i]=r.getSize(),[o,,a]=this.padding,[s,l]=CM({width:i,height:e+o+a,graphCanvas:r,className:"timebar",placement:n});return this.container=s,t&&s.classList.add(t),this.canvas=l,this.canvas}filterElements(t){return LN(this,void 0,void 0,(function*(){var e;if(!this.originalData)return;const{elementTypes:n,getTime:r}=this.options,{graph:i,element:o}=this.context,a=zN(this.originalData);n.forEach((e=>{const n=`${e}s`;a[n]=(this.originalData[n]||[]).filter((e=>{const n=r(e);return!!FN(n,t)}))}));const s=[...a.nodes,...a.combos].map((t=>Fh(t)));a.edges=a.edges.filter((t=>{const e=t.source,n=t.target;return s.includes(e)&&s.includes(n)})),i.setData(a),yield null===(e=o.draw({animation:!1,silence:!0}))||void 0===e?void 0:e.finished}))}hiddenElements(t){const{graph:e}=this.context,{elementTypes:n,getTime:r}=this.options,i=[],o=[];n.forEach((e=>{var n;const a=`${e}s`;((null===(n=this.originalData)||void 0===n?void 0:n[a])||[]).forEach((e=>{const n=Fh(e),a=r(e);FN(a,t)?o.push(n):i.push(n)}))})),e.hideElement(i,!1),e.showElement(o,!1)}destroy(){var t,e,n;const{graph:r}=this.context;this.originalData&&r.setData(Object.assign({},this.originalData)),null===(t=this.timebar)||void 0===t||t.destroy(),null===(e=this.canvas)||void 0===e||e.destroy(),null===(n=this.container)||void 0===n||n.remove(),this.originalData=void 0,this.container=void 0,this.timebar=void 0,this.canvas=void 0,super.destroy()}}jN.defaultOptions={position:"bottom",enable:!0,timebarType:"time",className:"g6-timebar",width:450,height:60,zIndex:3,elementTypes:["node"],padding:10,mode:"modify",getTime:t=>_N(t,BN,void 0),loop:!1};const zN=t=>{const{nodes:e=[],edges:n=[],combos:r=[]}=t;return{nodes:[...e],edges:[...n],combos:[...r]}},FN=(t,e)=>{if(ie(e))return t===e;const[n,r]=e;return t>=n&&t<=r},_N=(t,e,n)=>{var r;for(let n=0;n<e.length;n++){const i=e[n],o=null===(r=t.data)||void 0===r?void 0:r[i];if(o)return o}return n};var ZN=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};const GN={fill:"#1D2129",wordWrap:!0,maxLines:1,textOverflow:"ellipsis",textBaseline:"top",textAlign:"start",x:0},VN=Object.assign(Object.assign({},GN),{fillOpacity:.9,fontSize:16,fontWeight:"bold"}),WN=Object.assign(Object.assign({},GN),{fillOpacity:.65,fontSize:12,fontWeight:"normal"}),HN={align:"left",spacing:8,size:44,padding:[16,24,0,24]},UN="title",YN="subtitle";class qN{get padding(){return Uu(this.options.padding)}constructor(t){const{options:e,ctx:n}=t;this.options=e,this.context=n}getTitle(){const t=this.options,e=UN,n=t[e],r=YN,i=t[r],{spacing:o=44,padding:a,align:s}=t,l=ZN(t,[e+"",r+"","spacing","padding","align"]),c=n,u=i,h=cf(l,UN),d=cf(l,YN),[f]=this.context.graph.getSize(),[p=0,g=0,,v=0]=this.padding,m=f,y=m-v-g;let b=null,x=v,E="left";switch(s){case"left":default:x=v,E="left";break;case"center":x=m/2,E="center";break;case"right":x=m-g,E="right"}const w=new Tf({className:UN,style:Object.assign(Object.assign(Object.assign(Object.assign({},VN),{wordWrapWidth:y-5,x:x,y:p,textAlign:E}),h),{text:c})}),k=w.getBBox();return u&&(b=new Tf({className:"subTitle",style:Object.assign(Object.assign(Object.assign(Object.assign({},WN),{wordWrapWidth:y-5,x:x,y:k.height+o+p,textAlign:E}),d),{text:u})})),[w,b]}}var XN=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(t){o(t)}}function s(t){try{l(r.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}))};class KN extends uE{constructor(t,e){super(t,Object.assign({},KN.defaultOptions,e)),this.$element=hE("toolbar",!1),this.onToolbarItemClick=t=>{const{onClick:e}=this.options;if(t.target instanceof Element&&t.target.className.includes("g6-toolbar-item")){const n=t.target.getAttribute("value");null==e||e(n,t.target)}};const n=this.context.canvas.getContainer();this.$element.style.display="flex",n.appendChild(this.$element),dE("g6-toolbar-css","style",{},"\n .g6-toolbar {\n position: absolute;\n z-index: 100;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: center;\n border-radius: 4px;\n box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.1);\n opacity: 0.65;\n }\n .g6-toolbar .g6-toolbar-item {\n display: inline-block;\n width: 16px;\n height: 16px;\n padding: 4px;\n cursor: pointer;\n box-sizing: content-box;\n }\n\n .g6-toolbar .g6-toolbar-item:hover {\n background-color: #f0f0f0;\n }\n\n .g6-toolbar .g6-toolbar-item svg {\n display: inline-block;\n width: 100%;\n height: 100%;\n pointer-events: none;\n }\n",document.head),dE("g6-toolbar-svgicon","div",{display:"none"},'\n <svg>\n <symbol id="zoom-in" viewBox="64 64 896 896">\n <path d="M637 443H519V309c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v134H325c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h118v134c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V519h118c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8zm284 424L775 721c122.1-148.9 113.6-369.5-26-509-148-148.1-388.4-148.1-537 0-148.1 148.6-148.1 389 0 537 139.5 139.6 360.1 148.1 509 26l146 146c3.2 2.8 8.3 2.8 11 0l43-43c2.8-2.7 2.8-7.8 0-11zM696 696c-118.8 118.7-311.2 118.7-430 0-118.7-118.8-118.7-311.2 0-430 118.8-118.7 311.2-118.7 430 0 118.7 118.8 118.7 311.2 0 430z"></path>\n </symbol>\n <symbol id="zoom-out" viewBox="64 64 896 896">\n <path d="M637 443H325c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h312c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8zm284 424L775 721c122.1-148.9 113.6-369.5-26-509-148-148.1-388.4-148.1-537 0-148.1 148.6-148.1 389 0 537 139.5 139.6 360.1 148.1 509 26l146 146c3.2 2.8 8.3 2.8 11 0l43-43c2.8-2.7 2.8-7.8 0-11zM696 696c-118.8 118.7-311.2 118.7-430 0-118.7-118.8-118.7-311.2 0-430 118.8-118.7 311.2-118.7 430 0 118.7 118.8 118.7 311.2 0 430z"></path>\n </symbol>\n <symbol id="edit" viewBox="64 64 896 896">\n <path d="M257.7 752c2 0 4-.2 6-.5L431.9 722c2-.4 3.9-1.3 5.3-2.8l423.9-423.9a9.96 9.96 0 000-14.1L694.9 114.9c-1.9-1.9-4.4-2.9-7.1-2.9s-5.2 1-7.1 2.9L256.8 538.8c-1.5 1.5-2.4 3.3-2.8 5.3l-29.5 168.2a33.5 33.5 0 009.4 29.8c6.6 6.4 14.9 9.9 23.8 9.9zm67.4-174.4L687.8 215l73.3 73.3-362.7 362.6-88.9 15.7 15.6-89zM880 836H144c-17.7 0-32 14.3-32 32v36c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-36c0-17.7-14.3-32-32-32z"></path>\n </symbol>\n <symbol id="delete" viewBox="64 64 896 896">\n <path d="M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z"></path>\n </symbol>\n <symbol id="redo" viewBox="64 64 896 896">\n <path d="M758.2 839.1C851.8 765.9 912 651.9 912 523.9 912 303 733.5 124.3 512.6 124 291.4 123.7 112 302.8 112 523.9c0 125.2 57.5 236.9 147.6 310.2 3.5 2.8 8.6 2.2 11.4-1.3l39.4-50.5c2.7-3.4 2.1-8.3-1.2-11.1-8.1-6.6-15.9-13.7-23.4-21.2a318.64 318.64 0 01-68.6-101.7C200.4 609 192 567.1 192 523.9s8.4-85.1 25.1-124.5c16.1-38.1 39.2-72.3 68.6-101.7 29.4-29.4 63.6-52.5 101.7-68.6C426.9 212.4 468.8 204 512 204s85.1 8.4 124.5 25.1c38.1 16.1 72.3 39.2 101.7 68.6 29.4 29.4 52.5 63.6 68.6 101.7 16.7 39.4 25.1 81.3 25.1 124.5s-8.4 85.1-25.1 124.5a318.64 318.64 0 01-68.6 101.7c-9.3 9.3-19.1 18-29.3 26L668.2 724a8 8 0 00-14.1 3l-39.6 162.2c-1.2 5 2.6 9.9 7.7 9.9l167 .8c6.7 0 10.5-7.7 6.3-12.9l-37.3-47.9z"></path>\n </symbol>\n <symbol id="undo" viewBox="64 64 896 896">\n <path d="M511.4 124C290.5 124.3 112 303 112 523.9c0 128 60.2 242 153.8 315.2l-37.5 48c-4.1 5.3-.3 13 6.3 12.9l167-.8c5.2 0 9-4.9 7.7-9.9L369.8 727a8 8 0 00-14.1-3L315 776.1c-10.2-8-20-16.7-29.3-26a318.64 318.64 0 01-68.6-101.7C200.4 609 192 567.1 192 523.9s8.4-85.1 25.1-124.5c16.1-38.1 39.2-72.3 68.6-101.7 29.4-29.4 63.6-52.5 101.7-68.6C426.9 212.4 468.8 204 512 204s85.1 8.4 124.5 25.1c38.1 16.1 72.3 39.2 101.7 68.6 29.4 29.4 52.5 63.6 68.6 101.7 16.7 39.4 25.1 81.3 25.1 124.5s-8.4 85.1-25.1 124.5a318.64 318.64 0 01-68.6 101.7c-7.5 7.5-15.3 14.5-23.4 21.2a7.93 7.93 0 00-1.2 11.1l39.4 50.5c2.8 3.5 7.9 4.1 11.4 1.3C854.5 760.8 912 649.1 912 523.9c0-221.1-179.4-400.2-400.6-399.9z"></path>\n </symbol>\n <symbol id="export" viewBox="64 64 896 896">\n <path d="M880 912H144c-17.7 0-32-14.3-32-32V144c0-17.7 14.3-32 32-32h360c4.4 0 8 3.6 8 8v56c0 4.4-3.6 8-8 8H184v656h656V520c0-4.4 3.6-8 8-8h56c4.4 0 8 3.6 8 8v360c0 17.7-14.3 32-32 32zM770.87 199.13l-52.2-52.2a8.01 8.01 0 014.7-13.6l179.4-21c5.1-.6 9.5 3.7 8.9 8.9l-21 179.4c-.8 6.6-8.9 9.4-13.6 4.7l-52.4-52.4-256.2 256.2a8.03 8.03 0 01-11.3 0l-42.4-42.4a8.03 8.03 0 010-11.3l256.1-256.3z"></path>\n </symbol>\n <symbol id="auto-fit" viewBox="64 64 896 896">\n <path d="M952 474H829.8C812.5 327.6 696.4 211.5 550 194.2V72c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v122.2C327.6 211.5 211.5 327.6 194.2 474H72c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h122.2C211.5 696.4 327.6 812.5 474 829.8V952c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V829.8C696.4 812.5 812.5 696.4 829.8 550H952c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8zM512 756c-134.8 0-244-109.2-244-244s109.2-244 244-244 244 109.2 244 244-109.2 244-244 244z"></path>\n <path d="M512 392c-32.1 0-62.1 12.4-84.8 35.2-22.7 22.7-35.2 52.7-35.2 84.8s12.5 62.1 35.2 84.8C449.9 619.4 480 632 512 632s62.1-12.5 84.8-35.2C619.4 574.1 632 544 632 512s-12.5-62.1-35.2-84.8A118.57 118.57 0 00512 392z"></path>\n </symbol>\n <symbol id="reset" viewBox="64 64 896 896">\n <path d="M909.1 209.3l-56.4 44.1C775.8 155.1 656.2 92 521.9 92 290 92 102.3 279.5 102 511.5 101.7 743.7 289.8 932 521.9 932c181.3 0 335.8-115 394.6-276.1 1.5-4.2-.7-8.9-4.9-10.3l-56.7-19.5a8 8 0 00-10.1 4.8c-1.8 5-3.8 10-5.9 14.9-17.3 41-42.1 77.8-73.7 109.4A344.77 344.77 0 01655.9 829c-42.3 17.9-87.4 27-133.8 27-46.5 0-91.5-9.1-133.8-27A341.5 341.5 0 01279 755.2a342.16 342.16 0 01-73.7-109.4c-17.9-42.4-27-87.4-27-133.9s9.1-91.5 27-133.9c17.3-41 42.1-77.8 73.7-109.4 31.6-31.6 68.4-56.4 109.3-73.8 42.3-17.9 87.4-27 133.8-27 46.5 0 91.5 9.1 133.8 27a341.5 341.5 0 01109.3 73.8c9.9 9.9 19.2 20.4 27.8 31.4l-60.2 47a8 8 0 003 14.1l175.6 43c5 1.2 9.9-2.6 9.9-7.7l.8-180.9c-.1-6.6-7.8-10.3-13-6.2z"></path>\n </symbol>\n <symbol id="exit-fullscreen" viewBox="0 0 1024 1024">\n <path d="M418.13333333 361.43786666c0 0.2048-0.13653333 0.4096-0.13653334 0.68266667C417.99679999 362.32533333 418.13333333 362.53013333 418.13333333 362.73493333 418.13333333 371.54133333 414.44693333 379.392 408.78079999 385.39946666 408.43946666 385.7408 408.30293333 386.21866666 408.02986666 386.49173333c-1.09226667 1.09226667-2.59413333 1.77493333-3.82293333 2.73066667C398.40426666 393.65973333 391.64586666 396.8 383.93173333 396.8 383.72693333 396.8 383.59039999 396.73173333 383.38559999 396.73173333S382.97599999 396.8 382.77119999 396.8L112.29866666 396.8C92.50133333 396.8 76.79999999 381.50826666 76.79999999 362.66666666 76.66346666 343.89333333 92.63786666 328.53333333 112.16213333 328.53333333l189.44 0L87.44959999 114.51733333C73.59146666 100.59093333 73.25013333 78.5408 86.63039999 65.29706666c13.17546667-13.44853333 35.36213333-12.97066667 49.152 0.88746667l214.08426667 214.08426667L349.86666666 90.89706666C349.79839999 71.23626666 365.22666666 55.46666666 383.99999999 55.46666666 402.77333333 55.33013333 418.13333333 71.30453333 418.13333333 90.8288L418.13333333 361.43786666zM928.90453333 328.53333333l-189.44 0 214.15253333-214.08426667c13.85813333-13.9264 14.19946667-35.90826667 0.88746667-49.22026666-13.17546667-13.44853333-35.36213333-12.97066667-49.152 0.88746666l-214.08426667 214.08426667L691.26826666 90.89706666C691.26826666 71.23626666 675.83999999 55.46666666 657.06666666 55.46666666 638.29333333 55.33013333 622.93333333 71.30453333 622.93333333 90.8288l0 270.60906666c0 0.2048 0.13653333 0.4096 0.13653333 0.68266667C623.06986666 362.32533333 622.93333333 362.53013333 622.93333333 362.73493333 622.93333333 371.54133333 626.61973333 379.392 632.28586666 385.39946666c0.34133333 0.34133333 0.47786667 0.8192 0.8192 1.09226667 1.09226667 1.09226667 2.59413333 1.77493333 3.8912 2.73066667C642.66239999 393.65973333 649.42079999 396.8 657.13493333 396.8c0.2048 0 0.34133333-0.06826667 0.54613333-0.06826667S658.09066666 396.8 658.29546666 396.8l270.5408 0C948.56533333 396.8 964.26666666 381.50826666 964.26666666 362.66666666 964.40319999 343.89333333 948.42879999 328.53333333 928.90453333 328.53333333zM418.13333333 635.73333333c0-8.8064-3.6864-16.5888-9.35253334-22.66453333C408.43946666 612.72746666 408.30293333 612.2496 408.02986666 611.90826666 406.86933333 610.88426666 405.43573333 610.2016 404.20693333 609.24586666 398.47253333 604.80853333 391.64586666 601.6 383.93173333 601.6 383.72693333 601.6 383.59039999 601.73653333 383.38559999 601.73653333S382.97599999 601.6 382.77119999 601.6L112.29866666 601.6C92.50133333 601.6 76.79999999 616.96 76.79999999 635.73333333 76.66346666 654.50666666 92.63786666 669.86666666 112.16213333 669.86666666l189.44 0-214.15253334 214.15253334c-13.85813333 13.85813333-14.19946667 35.84-0.88746666 49.22026666 13.17546667 13.44853333 35.36213333 12.9024 49.152-0.95573333l214.08426666-214.08426667 0 189.37173334c0 19.59253333 15.42826667 35.49866667 34.2016 35.36213333C402.77333333 943.2064 418.13333333 927.232 418.13333333 907.5712L418.13333333 637.09866666c0-0.27306667-0.13653333-0.47786667-0.13653334-0.68266666C417.99679999 636.14293333 418.13333333 635.93813333 418.13333333 635.73333333zM739.46453333 669.86666666l189.44 0c19.456 0 35.49866667-15.36 35.36213333-34.13333333C964.26666666 616.96 948.56533333 601.6 928.76799999 601.6L658.29546666 601.6C658.09066666 601.6 657.88586666 601.73653333 657.68106666 601.73653333S657.33973333 601.6 657.13493333 601.6C649.42079999 601.6 642.59413333 604.80853333 636.85973333 609.24586666 635.63093333 610.2016 634.19733333 610.88426666 633.03679999 611.90826666 632.76373333 612.2496 632.62719999 612.72746666 632.28586666 613.0688 626.61973333 619.14453333 622.93333333 626.92693333 622.93333333 635.73333333c0 0.2048 0.13653333 0.4096 0.13653333 0.68266667C623.06986666 636.6208 622.93333333 636.8256 622.93333333 637.09866666l0 270.5408C622.93333333 927.232 638.29333333 943.2064 657.06666666 942.93333333c18.77333333 0.13653333 34.2016-15.70133333 34.2016-35.36213333l0-189.37173334 214.08426667 214.08426667c13.78986667 13.85813333 35.90826667 14.40426667 49.152 0.95573333 13.312-13.312 12.97066667-35.36213333-0.88746667-49.22026666L739.46453333 669.86666666z" ></path></symbol>\n <symbol id="request-fullscreen" viewBox="0 0 1024 1024">\n <path d="M69.818182 87.598545v273.128728a34.909091 34.909091 0 0 0 69.818182 0V163.653818l221.928727 222.021818a33.512727 33.512727 0 0 0 47.383273-47.383272L186.926545 116.363636h197.073455a34.909091 34.909091 0 0 0 0-69.818181H110.871273C85.364364 46.545455 69.818182 59.671273 69.818182 87.598545zM938.542545 46.545455H665.413818a34.909091 34.909091 0 0 0 0 69.818181h197.073455L640.465455 338.292364a33.512727 33.512727 0 0 0 47.383272 47.383272l221.928728-222.021818v197.073455a34.909091 34.909091 0 0 0 69.818181 0V87.598545c0-27.927273-15.453091-41.053091-40.96-41.05309z m-827.671272 907.636363h273.128727a34.909091 34.909091 0 0 0 0-69.818182H186.926545l222.021819-221.928727a33.512727 33.512727 0 0 0-47.383273-47.383273L139.636364 837.073455V640a34.909091 34.909091 0 0 0-69.818182 0v273.128727c0 27.927273 15.546182 41.053091 41.053091 41.053091z m868.724363-41.053091V640a34.909091 34.909091 0 0 0-69.818181 0v197.073455L687.941818 615.051636a33.512727 33.512727 0 0 0-47.383273 47.383273L862.487273 884.363636H665.413818a34.909091 34.909091 0 0 0 0 69.818182h273.128727c25.6 0 41.053091-13.125818 41.053091-41.053091z" ></path></symbol>\n </svg>\n'),this.$element.addEventListener("click",this.onToolbarItemClick),this.update(e)}update(t){const e=Object.create(null,{update:{get:()=>super.update}});return XN(this,void 0,void 0,(function*(){e.update.call(this,t);const{className:n,position:r,style:i}=this.options;this.$element.className=`g6-toolbar ${n||""}`,Object.assign(this.$element.style,i,function(t){const e={top:"unset",right:"unset",bottom:"unset",left:"unset"};return t.split("-").forEach((t=>{e[t]="8px"})),e.flexDirection=t.startsWith("top")||t.startsWith("bottom")?"row":"column",e}(r)),this.$element.innerHTML=yield this.getDOMContent()}))}destroy(){this.$element.removeEventListener("click",this.onToolbarItemClick),this.$element.remove(),super.destroy()}getDOMContent(){return XN(this,void 0,void 0,(function*(){return(yield this.options.getItems()).map((t=>{var e;return`\n <div class="g6-toolbar-item" value="${t.value}" title="${null!==(e=t.title)&&void 0!==e?e:""}">\n <svg aria-hidden="true" focusable="false">\n <use xlink:href="#${t.id}"></use>\n </svg>\n </div>`})).join("")}))}}function QN(t){var e=document.createElement("div");e.innerHTML=t;var n=e.childNodes[0];return n&&e.contains(n)&&e.removeChild(n),n}KN.defaultOptions={position:"top-left"};var JN=function(t,e){return t&&e?t.replace(/\\?\{([^{}]+)\}/g,(function(t,n){return"\\"===t.charAt(0)?t.slice(1):void 0===e[n]?"":e[n]})):t},$N=function(t,e){null!=e?t.replaceChildren?Array.isArray(e)?t.replaceChildren.apply(t,(0,ce.ev)([],(0,ce.CR)(e),!1)):t.replaceChildren(e):(t.innerHTML="",Array.isArray(e)?e.forEach((function(e){return t.appendChild(e)})):t.appendChild(e)):t.innerHTML=""};function tC(t){return void 0===t&&(t=""),{CONTAINER:"".concat(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 eC={overflow:"hidden","white-space":"nowrap","text-overflow":"ellipsis"};function nC(t){var e;void 0===t&&(t="");var n=tC(t);return(e={})[".".concat(n.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"},e[".".concat(n.TITLE)]={color:"rgba(0, 0, 0, 0.45)"},e[".".concat(n.LIST)]={margin:"0px","list-style-type":"none",padding:"0px"},e[".".concat(n.LIST_ITEM)]={"list-style-type":"none",display:"flex","line-height":"2em","align-items":"center","justify-content":"space-between","white-space":"nowrap"},e[".".concat(n.MARKER)]={width:"8px",height:"8px","border-radius":"50%",display:"inline-block","margin-right":"4px"},e[".".concat(n.NAME)]={display:"flex","align-items":"center","max-width":"216px"},e[".".concat(n.NAME_LABEL)]=(0,ce.pi)({flex:1},eC),e[".".concat(n.VALUE)]=(0,ce.pi)({display:"inline-block",float:"right",flex:1,"text-align":"right","min-width":"28px","margin-left":"30px",color:"rgba(0, 0, 0, 0.85)"},eC),e[".".concat(n.CROSSHAIR_X)]={position:"absolute",width:"1px","background-color":"rgba(0, 0, 0, 0.25)"},e[".".concat(n.CROSSHAIR_Y)]={position:"absolute",height:"1px","background-color":"rgba(0, 0, 0, 0.25)"},e}var rC=function(t){function e(e){var n,r,i=this,o=null===(r=null===(n=e.style)||void 0===n?void 0:n.template)||void 0===r?void 0:r.prefixCls,a=tC(o);return(i=t.call(this,e,{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(a.CONTAINER,'"></div>'),title:'<div class="'.concat(a.TITLE,'"></div>'),item:'<li class="'.concat(a.LIST_ITEM,'" data-index={index}>\n <span class="').concat(a.NAME,'">\n <span class="').concat(a.MARKER,'" style="background:{color}"></span>\n <span class="').concat(a.NAME_LABEL,'" title="{name}">{name}</span>\n </span>\n <span class="').concat(a.VALUE,'" title="{value}">{value}</span>\n </li>')},style:nC(o)})||this).timestamp=-1,i.prevCustomContentKey=i.attributes.contentKey,i.initShape(),i.render(i.attributes,i),i}return(0,ce.ZT)(e,t),Object.defineProperty(e.prototype,"HTMLTooltipElement",{get:function(){return this.element},enumerable:!1,configurable:!0}),e.prototype.getContainer=function(){return this.element},Object.defineProperty(e.prototype,"elementSize",{get:function(){return{width:this.element.offsetWidth,height:this.element.offsetHeight}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"HTMLTooltipItemsElements",{get:function(){var t=this.attributes,e=t.data,n=t.template;return e.map((function(t,e){var r=t.name,i=void 0===r?"":r,o=t.color,a=void 0===o?"black":o,s=t.index,l=(0,ce._T)(t,["name","color","index"]),c=(0,ce.pi)({name:i,color:a,index:null!=s?s:e},l);return QN(JN(n.item,c))}))},enumerable:!1,configurable:!0}),e.prototype.render=function(t,e){this.renderHTMLTooltipElement(),this.updatePosition()},e.prototype.destroy=function(){var e;null===(e=this.element)||void 0===e||e.remove(),t.prototype.destroy.call(this)},e.prototype.show=function(t,e){var n=this;if(void 0!==t&&void 0!==e){var r=function(){n.attributes.x=null!=t?t:n.attributes.x,n.attributes.y=null!=e?e:n.attributes.y,n.updatePosition()};"hidden"===this.element.style.visibility?this.closeTransition(r):r()}this.element.style.visibility="visible"},e.prototype.hide=function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.attributes.enterable&&this.isCursorEntered(t,e)||(this.element.style.visibility="hidden")},e.prototype.initShape=function(){var t=this.attributes.template;this.element=QN(t.container),this.id&&this.element.setAttribute("id",this.id)},e.prototype.renderCustomContent=function(){if(void 0===this.prevCustomContentKey||this.prevCustomContentKey!==this.attributes.contentKey){this.prevCustomContentKey=this.attributes.contentKey;var t=this.attributes.content;t&&("string"==typeof t?this.element.innerHTML=t:$N(this.element,t))}},e.prototype.renderHTMLTooltipElement=function(){var t,e,n=this.attributes,r=n.template,i=n.title,o=n.enterable,a=n.style,s=n.content,l=tC(r.prefixCls),c=this.element;if(this.element.style.pointerEvents=o?"auto":"none",s)this.renderCustomContent();else{i?(c.innerHTML=r.title,c.getElementsByClassName(l.TITLE)[0].innerHTML=i):null===(e=null===(t=c.getElementsByClassName(l.TITLE))||void 0===t?void 0:t[0])||void 0===e||e.remove();var u=this.HTMLTooltipItemsElements,h=document.createElement("ul");h.className=l.LIST,$N(h,u);var d=this.element.querySelector(".".concat(l.LIST));d?d.replaceWith(h):c.appendChild(h)}!function(t,e){Object.entries(e).forEach((function(e){var n=(0,ce.CR)(e,2),r=n[0],i=n[1];(0,ce.ev)([t],(0,ce.CR)(t.querySelectorAll(r)),!1).filter((function(t){return t.matches(r)})).forEach((function(t){t&&(t.style.cssText+=Object.entries(i).reduce((function(t,e){return"".concat(t).concat(e.join(":"),";")}),""))}))}))}(c,a)},e.prototype.getRelativeOffsetFromCursor=function(t){var e=this.attributes,n=e.position,r=e.offset,i=(t||n).split("-"),o={left:[-1,0],right:[1,0],top:[0,-1],bottom:[0,1]},a=this.elementSize,s=a.width,l=a.height,c=[-s/2,-l/2];return i.forEach((function(t){var e=(0,ce.CR)(c,2),n=e[0],i=e[1],a=(0,ce.CR)(o[t],2),u=a[0],h=a[1];c=[n+(s/2+r[0])*u,i+(l/2+r[1])*h]})),c},e.prototype.setOffsetPosition=function(t){var e=(0,ce.CR)(t,2),n=e[0],r=e[1],i=this.attributes,o=i.x,a=void 0===o?0:o,s=i.y,l=void 0===s?0:s,c=i.container,u=c.x,h=c.y;this.element.style.left="".concat(+a+u+n,"px"),this.element.style.top="".concat(+l+h+r,"px")},e.prototype.updatePosition=function(){var t=this.attributes.showDelay,e=void 0===t?60:t,n=Date.now();this.timestamp>0&&n-this.timestamp<e||(this.timestamp=n,this.setOffsetPosition(this.autoPosition(this.getRelativeOffsetFromCursor())))},e.prototype.autoPosition=function(t){var e=(0,ce.CR)(t,2),n=e[0],r=e[1],i=this.attributes,o=i.x,a=i.y,s=i.bounding,l=i.position;if(!s)return[n,r];var c=this.element,u=c.offsetWidth,h=c.offsetHeight,d=(0,ce.CR)([+o+n,+a+r],2),f=d[0],p=d[1],g={left:"right",right:"left",top:"bottom",bottom:"top"},v=s.x,m=s.y,y={left:f<v,right:f+u>v+s.width,top:p<m,bottom:p+h>m+s.height},b=[];l.split("-").forEach((function(t){y[t]?b.push(g[t]):b.push(t)}));var x=b.join("-");return this.getRelativeOffsetFromCursor(x)},e.prototype.isCursorEntered=function(t,e){if(this.element){var n=this.element.getBoundingClientRect(),r=n.x,i=n.y,o=n.width,a=n.height;return new kk(r,i,o,a).isPointIn(t,e)}return!1},e.prototype.closeTransition=function(t){var e=this,n=this.element.style.transition;this.element.style.transition="none",t(),setTimeout((function(){e.element.style.transition=n}),10)},e.tag="tooltip",e}(dk),iC=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(t){o(t)}}function s(t){try{l(r.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}))};class oC extends uE{constructor(t,e){super(t,Object.assign({},oC.defaultOptions,e)),this.currentTarget=null,this.tooltipElement=null,this.container=null,this.isEnable=(t,e)=>{const{enable:n}=this.options;return"function"==typeof n?n(t,e):n},this.onClick=t=>{const{target:{id:e}}=t;this.currentTarget===e?this.hide(t):this.show(t)},this.onPointerMove=t=>{const{target:e}=t;this.currentTarget&&e.id!==this.currentTarget&&this.show(t)},this.onPointerLeave=t=>{this.hide(t)},this.onCanvasMove=t=>{this.hide(t)},this.onPointerOver=t=>{this.show(t)},this.showById=t=>iC(this,void 0,void 0,(function*(){const e={target:{id:t}};yield this.show(e)})),this.getElementData=(t,e)=>{const{model:n}=this.context;switch(e){case"node":return n.getNodeData([t]);case"edge":return n.getEdgeData([t]);case"combo":return n.getComboData([t]);default:return[]}},this.show=t=>iC(this,void 0,void 0,(function*(){var e,n;const{client:r,target:{id:i}}=t;if(Bv(t.target))return;const o=this.context.graph.getElementType(i),{getContent:a,title:s}=this.options,l=this.getElementData(i,o);if(!this.tooltipElement||!this.isEnable(t,l))return;let c,u,h={};if(a){if(h.content=yield a(t,l),!h.content)return}else{const t=this.context.graph.getElementRenderStyle(i),e="node"===o?t.fill:t.stroke;h={title:s||o,data:l.map((t=>({name:"ID",value:t.id||`${t.source} -> ${t.target}`,color:e})))}}if(this.currentTarget=i,r)c=r.x,u=r.y;else{const t=nf(l,"0.style",{x:0,y:0});c=t.x,u=t.y}null===(n=(e=this.options).onOpenChange)||void 0===n||n.call(e,!0),this.tooltipElement.update(Object.assign(Object.assign(Object.assign({},this.tooltipStyleProps),{x:c,y:u,style:{".tooltip":{visibility:"visible"}}}),h))})),this.hide=t=>{var e,n,r,i,o;if(!t)return null===(n=(e=this.options).onOpenChange)||void 0===n||n.call(e,!1),null===(r=this.tooltipElement)||void 0===r||r.hide(),void(this.currentTarget=null);if(!this.tooltipElement)return;if(!this.currentTarget)return;const{client:{x:a,y:s}}=t;null===(o=(i=this.options).onOpenChange)||void 0===o||o.call(i,!1),this.tooltipElement.hide(a,s),this.currentTarget=null},this.initTooltip=()=>{var t;const e=new rC({className:"tooltip",style:this.tooltipStyleProps});return null===(t=this.container)||void 0===t||t.appendChild(e.HTMLTooltipElement),e},this.render(),this.bindEvents()}getEvents(){return"click"===this.options.trigger?{"node:click":this.onClick,"edge:click":this.onClick,"combo:click":this.onClick,"canvas:click":this.onPointerLeave,contextmenu:this.onPointerLeave,drag:this.onPointerLeave}:{"node:pointerover":this.onPointerOver,"node:pointermove":this.onPointerMove,"canvas:pointermove":this.onCanvasMove,"edge:pointerover":this.onPointerOver,"edge:pointermove":this.onPointerMove,"combo:pointerover":this.onPointerOver,"combo:pointermove":this.onPointerMove,contextmenu:this.onPointerLeave,"node:drag":this.onPointerLeave}}update(t){var e;this.unbindEvents(),super.update(t),this.tooltipElement&&(null===(e=this.container)||void 0===e||e.removeChild(this.tooltipElement.HTMLTooltipElement)),this.tooltipElement=this.initTooltip(),this.bindEvents()}render(){const{canvas:t}=this.context,e=t.getContainer();e&&(this.container=e,this.tooltipElement=this.initTooltip())}unbindEvents(){const{graph:t}=this.context,e=this.getEvents();Object.keys(e).forEach((n=>{t.off(n,e[n])}))}bindEvents(){const{graph:t}=this.context,e=this.getEvents();Object.keys(e).forEach((n=>{t.on(n,e[n])}))}get tooltipStyleProps(){const{canvas:t}=this.context,{center:e}=t.getBounds(),n=t.getContainer(),{top:r,left:i}=n.getBoundingClientRect(),{style:o,position:a,enterable:s,container:l={x:-i,y:-r},title:c,offset:u}=this.options,[h,d]=e,[f,p]=t.getSize();return{x:h,y:d,container:l,title:c,bounding:{x:0,y:0,width:f,height:p},position:a,enterable:s,offset:u,style:o}}destroy(){var t;this.unbindEvents(),this.tooltipElement&&(null===(t=this.container)||void 0===t||t.removeChild(this.tooltipElement.HTMLTooltipElement)),super.destroy()}}oC.defaultOptions={trigger:"hover",position:"top-right",enterable:!1,enable:!0,offset:[10,10],style:{".tooltip":{visibility:"hidden"}}};var aC=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(t){o(t)}}function s(t){try{l(r.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}))};let sC;function lC(t,e){sC||(sC=document.createElement("canvas")),sC.width=t,sC.height=e;return sC.getContext("2d").clearRect(0,0,t,e),sC}var cC=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(t){o(t)}}function s(t){try{l(r.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}))},uC=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};class hC extends uE{constructor(t,e){super(t,Object.assign({},hC.defaultOptions,e)),this.$element=hE("watermark");this.context.canvas.getContainer().appendChild(this.$element),this.update(e)}update(t){const e=Object.create(null,{update:{get:()=>super.update}});return cC(this,void 0,void 0,(function*(){e.update.call(this,t);const n=this.options,{width:r,height:i,text:o,imageURL:a}=n,s=uC(n,["width","height","text","imageURL"]);Object.keys(s).forEach((e=>{e.startsWith("background")&&(this.$element.style[e]=t[e])}));const l=a?yield function(t,e,n,r){return aC(this,void 0,void 0,(function*(){const i=lC(t,e),o=i.getContext("2d"),{rotate:a,opacity:s}=r;a&&o.rotate(a),s&&(o.globalAlpha=s);const l=new Image;return l.crossOrigin="anonymous",l.src=n,new Promise((n=>{l.onload=function(){const r=t>l.width?(t-l.width)/2:0,a=e>l.height?(e-l.height)/2:0;o.drawImage(l,0,0,l.width,l.height,r,a,t-2*r,e-2*a),n(i.toDataURL())}}))}))}(r,i,a,s):yield function(t,e,n,r){return aC(this,void 0,void 0,(function*(){const i=lC(t,e),o=i.getContext("2d"),{rotate:a,opacity:s,textFill:l,textFontSize:c,textFontFamily:u,textFontVariant:h,textFontWeight:d,textAlign:f,textBaseline:p}=r;return o.textAlign=f,o.textBaseline=p,o.translate(t/2,e/2),o.font=`${c}px ${u} ${h} ${d}`,a&&o.rotate(a),s&&(o.globalAlpha=s),l&&(o.fillStyle=l,o.fillText(`${n}`,0,0)),i.toDataURL()}))}(r,i,o,s);this.$element.style.backgroundImage=`url(${l})`}))}destroy(){super.destroy(),this.$element.remove()}}hC.defaultOptions={width:200,height:100,opacity:.2,rotate:Math.PI/12,text:"",textFill:"#000",textFontSize:16,textAlign:"center",textBaseline:"middle",backgroundRepeat:"repeat"};const dC=["#7E92B5","#F4664A","#FFBE3A"],fC={type:"group",color:["#1783FF","#00C9C9","#F08F56","#D580FF","#7863FF","#DB9D0D","#60C42D","#FF80CA","#2491B3","#17C76F"]},pC={type:"group",color:["#99ADD1","#1783FF","#00C9C9","#F08F56","#D580FF","#7863FF","#DB9D0D","#60C42D","#FF80CA","#2491B3","#17C76F"]};function gC(t){const{bgColor:e,textColor:n,nodeColor:r,nodeColorDisabled:i,nodeStroke:o,nodeHaloStrokeOpacityActive:a=.15,nodeHaloStrokeOpacitySelected:s=.25,nodeOpacityDisabled:l=.06,nodeIconOpacityInactive:c=.85,nodeOpacityInactive:u=.25,nodeBadgePalette:h=dC,nodePaletteOptions:d=fC,edgeColor:f,edgeColorDisabled:p,edgePaletteOptions:g=pC,comboColor:v,comboColorDisabled:m,comboStroke:y,comboStrokeDisabled:b,edgeColorInactive:x}=t;return{background:e,node:{palette:d,style:{donutOpacity:1,badgeBackgroundOpacity:1,badgeFill:"#fff",badgeFontSize:8,badgePadding:[0,4],badgePalette:h,fill:r,fillOpacity:1,halo:!1,iconFill:"#fff",iconOpacity:1,labelBackground:!1,labelBackgroundFill:e,labelBackgroundLineWidth:0,labelBackgroundOpacity:.75,labelFill:n,labelFillOpacity:.85,labelLineHeight:16,labelPadding:[0,2],labelFontSize:12,labelFontWeight:400,labelOpacity:1,labelOffsetY:2,lineWidth:0,portFill:r,portLineWidth:1,portStroke:o,portStrokeOpacity:.65,size:32,stroke:o,strokeOpacity:1,zIndex:2},state:{selected:{halo:!0,haloLineWidth:24,haloStrokeOpacity:s,labelFontSize:12,labelFontWeight:"bold",lineWidth:4,stroke:o},active:{halo:!0,haloLineWidth:12,haloStrokeOpacity:a},highlight:{labelFontWeight:"bold",lineWidth:4,stroke:o,strokeOpacity:.85},inactive:{badgeBackgroundOpacity:u,donutOpacity:u,fillOpacity:u,iconOpacity:c,labelFill:n,labelFillOpacity:u,strokeOpacity:u},disabled:{badgeBackgroundOpacity:.25,donutOpacity:l,fill:i,fillOpacity:l,iconFill:i,iconOpacity:.25,labelFill:n,labelFillOpacity:.25,strokeOpacity:l}},animation:{enter:"fade",exit:"fade",show:"fade",hide:"fade",expand:"node-expand",collapse:"node-collapse",update:[{fields:["x","y","fill","stroke"]}],translate:[{fields:["x","y"]}]}},edge:{palette:g,style:{badgeBackgroundFill:f,badgeFill:"#fff",badgeFontSize:8,badgeOffsetX:10,badgeBackgroundOpacity:1,fillOpacity:1,halo:!1,haloLineWidth:12,haloStrokeOpacity:1,increasedLineWidthForHitTesting:2,labelBackground:!1,labelBackgroundFill:e,labelBackgroundLineWidth:0,labelBackgroundOpacity:.75,labelBackgroundPadding:[4,4,4,4],labelFill:n,labelFontSize:12,labelFontWeight:400,labelOpacity:1,labelPlacement:"center",labelTextBaseline:"middle",lineWidth:1,stroke:f,strokeOpacity:1,zIndex:1},state:{selected:{halo:!0,haloStrokeOpacity:.25,labelFontSize:14,labelFontWeight:"bold",lineWidth:3},active:{halo:!0,haloStrokeOpacity:.15},highlight:{labelFontWeight:"bold",lineWidth:3},inactive:{stroke:x,fillOpacity:.08,labelOpacity:.25,strokeOpacity:.08,badgeBackgroundOpacity:.25},disabled:{stroke:p,fillOpacity:.45,strokeOpacity:.45,labelOpacity:.25,badgeBackgroundOpacity:.45}},animation:{enter:"fade",exit:"fade",expand:"path-in",collapse:"path-out",show:"fade",hide:"fade",update:[{fields:["sourceNode","targetNode"]},{fields:["stroke"],shape:"key"}],translate:[{fields:["sourceNode","targetNode"]}]}},combo:{style:{collapsedMarkerFill:e,collapsedMarkerFontSize:12,collapsedMarkerFillOpacity:1,collapsedSize:32,collapsedFillOpacity:1,fill:v,halo:!1,haloLineWidth:12,haloStroke:y,haloStrokeOpacity:.25,labelBackground:!1,labelBackgroundFill:e,labelBackgroundLineWidth:0,labelBackgroundOpacity:.75,labelBackgroundPadding:[2,4,2,4],labelFill:n,labelFontSize:12,labelFontWeight:400,labelOpacity:1,lineDash:0,lineWidth:1,fillOpacity:.04,strokeOpacity:1,padding:10,stroke:y},state:{selected:{halo:!0,labelFontSize:14,labelFontWeight:700,lineWidth:4},active:{halo:!0},highlight:{labelFontWeight:700,lineWidth:4},inactive:{fillOpacity:.65,labelOpacity:.25,strokeOpacity:.65},disabled:{fill:m,fillOpacity:.25,labelOpacity:.25,stroke:b,strokeOpacity:.25}},animation:{enter:"fade",exit:"fade",show:"fade",hide:"fade",expand:"combo-expand",collapse:"combo-collapse",update:[{fields:["x","y"]},{fields:["fill","stroke","lineWidth"],shape:"key"}],translate:[{fields:["x","y"]}]}}}}const vC=gC({bgColor:"#000000",comboColor:"#fdfdfd",comboColorDisabled:"#d0e4ff",comboStroke:"#99add1",comboStrokeDisabled:"#969696",edgeColor:"#637088",edgeColorDisabled:"#637088",edgeColorInactive:"#D0E4FF",edgePaletteOptions:{type:"group",color:["#637088","#0F55A6","#008383","#9C5D38","#8B53A6","#4E40A6","#8F6608","#3E801D","#A65383","#175E75","#0F8248"]},nodeColor:"#1783ff",nodeColorDisabled:"#D0E4FF",nodeHaloStrokeOpacityActive:.25,nodeHaloStrokeOpacitySelected:.45,nodeIconOpacityInactive:.45,nodeOpacityDisabled:.25,nodeOpacityInactive:.45,nodeStroke:"#d0e4ff",textColor:"#ffffff"}),mC=gC({bgColor:"#ffffff",comboColor:"#99ADD1",comboColorDisabled:"#f0f0f0",comboStroke:"#99add1",comboStrokeDisabled:"#d9d9d9",edgeColor:"#99add1",edgeColorDisabled:"#d9d9d9",edgeColorInactive:"#1B324F",nodeColor:"#1783ff",nodeColorDisabled:"#1B324F",nodeHaloStrokeOpacityActive:.15,nodeHaloStrokeOpacitySelected:.25,nodeIconOpacityInactive:.85,nodeOpacityDisabled:.06,nodeOpacityInactive:.25,nodeStroke:"#000000",textColor:"#000000"});class yC extends $h{beforeDraw(t,e){return t}afterLayout(t,e){}}function bC(t,e,n,r,i){const o=Fh(r),a=`${n}s`,s=i?r:t.add[a].get(o)||t.update[a].get(o)||t.remove[a].get(o)||r;Object.entries(t).forEach((([t,n])=>{e===t?n[a].set(o,s):n[a].delete(o)}))}function xC(t,e){return Object.keys(t).every((n=>t[n]===e[n]))}const EC=(t,e,n,r)=>{const i=`${n}s`,o=Fh(r);t.add[i].has(o)||t.update[i].has(o)||t[e][i].set(Fh(r),r)};new WeakMap;var wC=function(){function t(e){(0,a.Z)(this,t),this.dragndropPluginOptions=e}return(0,s.Z)(t,[{key:"apply",value:function(e){var n=this,r=e.renderingService,i=e.renderingContext.root.ownerDocument,o=i.defaultView,a=function(t){var e=t.target,r=e===i,a=r&&n.dragndropPluginOptions.isDocumentDraggable?i:e.closest&&e.closest("[draggable=true]");if(a){var s=!1,l=t.timeStamp,c=[t.clientX,t.clientY],u=null,h=[t.clientX,t.clientY],d=function(){var t=(0,On.Z)((0,Cn.Z)().mark((function t(o){var d,f,p,g,v,m;return(0,Cn.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(s){t.next=2;break}if(d=o.timeStamp-l,f=oe([o.clientX,o.clientY],c),!(d<=n.dragndropPluginOptions.dragstartTimeThreshold||f<=n.dragndropPluginOptions.dragstartDistanceThreshold)){t.next=1;break}return t.abrupt("return");case 1:o.type="dragstart",a.dispatchEvent(o),s=!0;case 2:if(o.type="drag",o.dx=o.clientX-h[0],o.dy=o.clientY-h[1],a.dispatchEvent(o),h=[o.clientX,o.clientY],r){t.next=4;break}return p="pointer"===n.dragndropPluginOptions.overlap?[o.canvasX,o.canvasY]:e.getBounds().center,t.next=3,i.elementsFromPoint(p[0],p[1]);case 3:g=t.sent,v=g[g.indexOf(e)+1],m=(null==v?void 0:v.closest("[droppable=true]"))||(n.dragndropPluginOptions.isDocumentDroppable?i:null),u!==m&&(u&&(o.type="dragleave",o.target=u,u.dispatchEvent(o)),m&&(o.type="dragenter",o.target=m,m.dispatchEvent(o)),(u=m)&&(o.type="dragover",o.target=u,u.dispatchEvent(o)));case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}();o.addEventListener("pointermove",d);var f=function(t){if(s){t.detail={preventClick:!0};var e=t.clone();u&&(e.type="drop",e.target=u,u.dispatchEvent(e)),e.type="dragend",a.dispatchEvent(e),s=!1}o.removeEventListener("pointermove",d)};e.addEventListener("pointerup",f,{once:!0}),e.addEventListener("pointerupoutside",f,{once:!0})}};r.hooks.init.tap(t.tag,(function(){o.addEventListener("pointerdown",a)})),r.hooks.destroy.tap(t.tag,(function(){o.removeEventListener("pointerdown",a)}))}}])}();wC.tag="Dragndrop";var kC=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,a.Z)(this,e),(t=(0,c.Z)(this,e)).name="dragndrop",t.options=n,t}return(0,u.Z)(e,t),(0,s.Z)(e,[{key:"init",value:function(){this.addRenderingPlugin(new wC((0,o.Z)({overlap:"pointer",isDocumentDraggable:!1,isDocumentDroppable:!1,dragstartDistanceThreshold:0,dragstartTimeThreshold:0},this.options)))}},{key:"destroy",value:function(){this.removeAllRenderingPlugins()}},{key:"setOptions",value:function(t){Object.assign(this.plugins[0].dragndropPluginOptions,t)}}])}(Bn),MC=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(t){o(t)}}function s(t){try{l(r.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}))},SC=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};const AC=["main"],NC=["background","main","label","transient"];class CC{getConfig(){return this.config}getLayer(t="main"){return this.extends.layers[t]||this.getLayers().main}getLayers(){return this.extends.layers}getRenderer(t){return this.extends.renderers[t]}getCamera(t="main"){return this.getLayer(t).getCamera()}getRoot(t="main"){return this.getLayer(t).getRoot()}getContextService(t="main"){return this.getLayer(t).getContextService()}setCursor(t){this.config.cursor=t,this.getLayer().setCursor(t)}get document(){return this.getLayer().document}get context(){return this.getLayer().context}constructor(t){this.config={enableMultiLayer:!0},Object.assign(this.config,t);const e=this.config,{renderer:n,background:r,cursor:i,enableMultiLayer:o}=e,a=SC(e,["renderer","background","cursor","enableMultiLayer"]),s=o?NC:AC,l=OC(n,s),c=Object.fromEntries(s.map((t=>[t,new tc(Object.assign(Object.assign({},a),{supportsMutipleCanvasesInOneContainer:o,renderer:l[t],background:o?"background"===t?r:void 0:r}))])));TC(c),this.extends={config:this.config,renderer:n,renderers:l,layers:c}}get ready(){return Promise.all(Object.entries(this.getLayers()).map((([,t])=>t.ready)))}resize(t,e){Object.assign(this.extends.config,{width:t,height:e}),Object.values(this.getLayers()).forEach((n=>{const r=n.getCamera(),i=r.getPosition(),o=r.getFocalPoint();n.resize(t,e),r.setPosition(i),r.setFocalPoint(o)}))}getBounds(t){return th(Object.values(this.getLayers()).map((e=>t?e.getRoot().childNodes.find((e=>e.classList.includes(t))):e.getRoot())).filter((t=>(null==t?void 0:t.childNodes.length)>0)).map((t=>t.getBounds())))}getContainer(){const t=this.extends.config.container;return"string"==typeof t?document.getElementById(t):t}getSize(){return[this.extends.config.width||0,this.extends.config.height||0]}appendChild(t,e){var n;const r=(null===(n=t.style)||void 0===n?void 0:n.$layer)||"main";return this.getLayer(r).appendChild(t,e)}setRenderer(t){if(t===this.extends.renderer)return;const e=OC(t,this.config.enableMultiLayer?NC:AC);this.extends.renderers=e,Object.entries(e).forEach((([t,e])=>this.getLayer(t).setRenderer(e))),TC(this.getLayers())}getCanvasByViewport(t){return Od(this.getLayer().viewport2Canvas(Td(t)))}getViewportByCanvas(t){return Od(this.getLayer().canvas2Viewport(Td(t)))}getViewportByClient(t){return Od(this.getLayer().client2Viewport(Td(t)))}getClientByViewport(t){return Od(this.getLayer().viewport2Client(Td(t)))}getClientByCanvas(t){return this.getClientByViewport(this.getViewportByCanvas(t))}getCanvasByClient(t){const e=this.getLayer(),n=e.client2Viewport(Td(t));return Od(e.viewport2Canvas(n))}toDataURL(){return MC(this,arguments,void 0,(function*(t={}){const e=globalThis.devicePixelRatio||1,{mode:n="viewport"}=t,r=SC(t,["mode"]);let[i,o,a,s]=[0,0,0,0];if("viewport"===n)[a,s]=this.getSize();else if("overall"===n){const t=this.getBounds(),e=Ku(t);[i,o]=t.min,[a,s]=e}const l=QN('<div id="virtual-image"></div>'),c=new tc({width:a,height:s,renderer:new dg,devicePixelRatio:e,container:l,background:this.extends.config.background});yield c.ready,c.appendChild(this.getLayer("background").getRoot().cloneNode(!0)),c.appendChild(this.getRoot().cloneNode(!0));const u=this.getLayer("label").getRoot().cloneNode(!0),h=c.viewport2Canvas({x:0,y:0}),d=this.getCanvasByViewport([0,0]);u.translate([d[0]-h.x,d[1]-h.y]),u.scale(1/this.getCamera().getZoom()),c.appendChild(u),c.appendChild(this.getLayer("transient").getRoot().cloneNode(!0));const f=this.getCamera(),p=c.getCamera();if("viewport"===n)p.setZoom(f.getZoom()),p.setPosition(f.getPosition()),p.setFocalPoint(f.getFocalPoint());else if("overall"===n){const[t,e,n]=p.getPosition(),[r,a,s]=p.getFocalPoint();p.setPosition([t+i,e+o,n]),p.setFocalPoint([r+i,a+o,s])}const g=c.getContextService();return new Promise((t=>{c.addEventListener(ql.RERENDER,(()=>MC(this,void 0,void 0,(function*(){yield new Promise((t=>setTimeout(t,300)));const e=yield g.toDataURL(r);t(e)}))))}))}))}destroy(){Object.values(this.getLayers()).forEach((t=>{t.getCamera().cancelLandmarkAnimation(),t.destroy()}))}}function OC(t,e){return Object.fromEntries(e.map((e=>{const n=(null==t?void 0:t(e))||new dg;return n instanceof dg&&n.setConfig({enableDirtyRectangleRendering:!1}),"main"===e?n.registerPlugin(new kC({isDocumentDraggable:!0,isDocumentDroppable:!0,dragstartDistanceThreshold:10,dragstartTimeThreshold:100})):n.unregisterPlugin(n.getPlugin("dom-interaction")),[e,n]})))}function TC(t){Object.entries(t).forEach((([t,e])=>{const n=e.getContextService().getDomElement();(null==n?void 0:n.style)&&(n.style.gridArea="1 / 1 / 2 / 2",n.style.outline="none",n.tabIndex=1,"main"!==t&&(n.style.pointerEvents="none")),(null==n?void 0:n.parentElement)&&(n.parentElement.style.display="grid",n.parentElement.style.isolation="isolate")}))}const PC=t=>t?parseInt(t):0;function RC(t){if(!t)return[0,0];let e=640,n=480;const[r,i]=function(t){const e=getComputedStyle(t),n=t.clientWidth||PC(e.width),r=t.clientHeight||PC(e.height);return[n-(PC(e.paddingLeft)+PC(e.paddingRight)),r-(PC(e.paddingTop)+PC(e.paddingBottom))]}(t);e=r||e,n=i||n;return[Math.max(ie(e)?e:1,1),Math.max(ie(n)?n:1,1)]}class DC{constructor(t){this.type=t}}class LC extends DC{constructor(t,e){super(t),this.data=e}}class IC extends DC{constructor(t,e,n,r){super(t),this.animationType=e,this.animation=n,this.data=r}}class BC extends DC{constructor(t,e,n){super(t),this.elementType=e,this.data=n}}class jC extends DC{constructor(t,e){super(t),this.data=e}}function zC(t,e){t.emit(e.type,e)}function FC(t){var e;return(null===(e=null==t?void 0:t.style)||void 0===e?void 0:e.zIndex)||0}const _C="cachedStyle",ZC=t=>`__${t}__`;function GC(t,e){return nf(t,[_C,ZC(e)])}class VC{constructor(t){this.tasks=[],this.animations=new Set,this.context=t}getTasks(){const t=[...this.tasks];return this.tasks=[],t}add(t,e){this.tasks.push([t,e])}animate(t,e,n){var r,i,o;null===(r=null==e?void 0:e.before)||void 0===r||r.call(e);const a=this.getTasks().map((([e,r])=>{var i,o,a;const{element:s,elementType:l,stage:c}=e,u=Ou(this.context.options,l,c,t);null===(i=null==r?void 0:r.before)||void 0===i||i.call(r);const h=u.length?Ru(s,this.inferStyle(e,n),u):null;return h?(null===(o=null==r?void 0:r.beforeAnimate)||void 0===o||o.call(r,h),h.finished.then((()=>{var t,e;null===(t=null==r?void 0:r.afterAnimate)||void 0===t||t.call(r,h),null===(e=null==r?void 0:r.after)||void 0===e||e.call(r),this.animations.delete(h)}))):null===(a=null==r?void 0:r.after)||void 0===a||a.call(r),h})).filter(Boolean);a.forEach((t=>this.animations.add(t)));const s=Su(a);return s?(null===(i=null==e?void 0:e.beforeAnimate)||void 0===i||i.call(e,s),s.finished.then((()=>{var t,n;null===(t=null==e?void 0:e.afterAnimate)||void 0===t||t.call(e,s),null===(n=null==e?void 0:e.after)||void 0===n||n.call(e),this.release()}))):null===(o=null==e?void 0:e.after)||void 0===o||o.call(e),s}inferStyle(t,e){var n,r;const{element:i,elementType:o,stage:a,originalStyle:s,updatedStyle:l={}}=t;t.modifiedStyle||(t.modifiedStyle=Object.assign(Object.assign({},s),l));const{modifiedStyle:c}=t,u={},h={};if("enter"===a)Object.assign(u,{opacity:0});else if("exit"===a)Object.assign(h,{opacity:0});else if("show"===a)Object.assign(u,{opacity:0}),Object.assign(h,{opacity:null!==(n=GC(i,"opacity"))&&void 0!==n?n:Nu("opacity")});else if("hide"===a)Object.assign(u,{opacity:null!==(r=GC(i,"opacity"))&&void 0!==r?r:Nu("opacity")}),Object.assign(h,{opacity:0});else if("collapse"===a){const{collapse:t}=e||{},{target:n,descendants:r,position:a}=t;if("node"===o){if(r.includes(i.id)){const[t,e,n]=a;Object.assign(h,{x:t,y:e,z:n})}}else if("combo"===o){if(i.id===n||r.includes(i.id)){const[t,e]=a;Object.assign(h,{x:t,y:e,childrenNode:s.childrenNode})}}else"edge"===o&&Object.assign(h,{sourceNode:c.sourceNode,targetNode:c.targetNode})}else if("expand"===a){const{expand:t}=e||{},{target:n,descendants:r,position:a}=t;if("node"===o){if(i.id===n||r.includes(i.id)){const[t,e,n]=a;Object.assign(u,{x:t,y:e,z:n})}}else if("combo"===o){if(i.id===n||r.includes(i.id)){const[t,e,n]=a;Object.assign(u,{x:t,y:e,z:n,childrenNode:c.childrenNode})}}else"edge"===o&&Object.assign(u,{sourceNode:c.sourceNode,targetNode:c.targetNode})}return[Object.keys(u).length>0?Object.assign({},s,u):s,Object.keys(h).length>0?Object.assign({},c,h):c]}stop(){this.animations.forEach((t=>t.cancel()))}clear(){this.tasks=[]}release(){var t,e;const{canvas:n}=this.context,r=null===(e=null===(t=n.document)||void 0===t?void 0:t.timeline)||void 0===e?void 0:e.animationsWithPromises;r&&(n.document.timeline.animationsWithPromises=r.filter((t=>"finished"!==t.playState)))}destroy(){this.stop(),this.animations.clear(),this.tasks=[]}}class WC{constructor(t){this.batchCount=0,this.context=t}emit(t){const{graph:e}=this.context;e.emit(t.type,t)}startBatch(t=!0){this.batchCount++,1===this.batchCount&&this.emit(new LC(pu.BATCH_START,{initiate:t}))}endBatch(){this.batchCount--,0===this.batchCount&&this.emit(new LC(pu.BATCH_END))}get isBatching(){return this.batchCount>0}destroy(){this.context=null}}class HC extends Jh{constructor(t){super(t),this.currentTarget=null,this.currentTargetType=null,this.category="behavior",this.forwardCanvasEvents=t=>{const{target:e}=t,n=function(t){if(!t)return null;if(t instanceof Gl)return{type:"canvas",element:t};let e=t;for(;e;){if(Ev(e))return{type:"node",element:e};if(wv(e))return{type:"edge",element:e};if(kv(e))return{type:"combo",element:e};e=e.parentElement}return null}(e);if(!n)return;const{graph:r,canvas:i}=this.context,{type:o,element:a}=n;if("destroyed"in a&&(Bv(a)||a.destroyed))return;const{type:s,detail:l,button:c}=t,u=Object.assign(Object.assign({},t),{target:a,targetType:o,originalTarget:e});s===hu.POINTER_MOVE&&(this.currentTarget!==a&&(this.currentTarget&&r.emit(`${this.currentTargetType}:${hu.POINTER_LEAVE}`,Object.assign(Object.assign({},u),{type:hu.POINTER_LEAVE,target:this.currentTarget,targetType:this.currentTargetType})),a&&(Object.assign(u,{type:hu.POINTER_ENTER}),r.emit(`${o}:${hu.POINTER_ENTER}`,u))),this.currentTarget=a,this.currentTargetType=o),s===hu.CLICK&&2===c||(r.emit(`${o}:${s}`,u),r.emit(s,u)),s===hu.CLICK&&2===l&&(Object.assign(u,{type:hu.DBLCLICK}),r.emit(`${o}:${hu.DBLCLICK}`,u),r.emit(hu.DBLCLICK,u)),s===hu.POINTER_DOWN&&2===c&&(Object.assign(u,{type:hu.CONTEXT_MENU,preventDefault:()=>{var t;null===(t=i.getContainer())||void 0===t||t.addEventListener(hu.CONTEXT_MENU,(t=>t.preventDefault()),{once:!0})}}),r.emit(`${o}:${hu.CONTEXT_MENU}`,u),r.emit(hu.CONTEXT_MENU,u))},this.forwardContainerEvents=t=>{this.context.graph.emit(t.type,t)},this.forwardEvents(),this.setBehaviors(this.context.options.behaviors||[])}setBehaviors(t){this.setExtensions(t)}forwardEvents(){const t=this.context.canvas.getContainer();t&&[du.KEY_DOWN,du.KEY_UP].forEach((e=>{t.addEventListener(e,this.forwardContainerEvents)}));const e=this.context.canvas.document;e&&[hu.CLICK,hu.DBLCLICK,hu.POINTER_OVER,hu.POINTER_LEAVE,hu.POINTER_ENTER,hu.POINTER_MOVE,hu.POINTER_OUT,hu.POINTER_DOWN,hu.POINTER_UP,hu.CONTEXT_MENU,hu.DRAG_START,hu.DRAG,hu.DRAG_END,hu.DRAG_ENTER,hu.DRAG_OVER,hu.DRAG_LEAVE,hu.DROP,hu.WHEEL].forEach((t=>{e.addEventListener(t,this.forwardCanvasEvents)}))}destroy(){const t=this.context.canvas.getContainer();t&&[du.KEY_DOWN,du.KEY_UP].forEach((e=>{t.removeEventListener(e,this.forwardContainerEvents)})),this.context.canvas.document.removeAllEventListeners(),super.destroy()}}var UC=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};function YC(t,e){const{data:n,style:r}=t,i=UC(t,["data","style"]),{data:o,style:a}=e,s=UC(e,["data","style"]),l=Object.assign(Object.assign({},i),s);return(n||o)&&Object.assign(l,{data:Object.assign(Object.assign({},n),o)}),(r||a)&&Object.assign(l,{style:Object.assign(Object.assign({},r),a)}),l}function qC(t){const{data:e,style:n}=t,r=UC(t,["data","style"]);return e&&(r.data=Object.assign({},e)),n&&(r.style=Object.assign({},n)),r}function XC(t={},e={}){const{states:n=[],data:r={},style:i={},children:o=[]}=t,a=UC(t,["states","data","style","children"]),{states:s=[],data:l={},style:c={},children:u=[]}=e,h=(t,e)=>t.length===e.length&&t.every(((t,n)=>t===e[n])),d=(t,e)=>{const n=Object.keys(t),r=Object.keys(e);return n.length===r.length&&n.every((n=>t[n]===e[n]))};return!!d(a,UC(e,["states","data","style","children"]))&&(!!h(o,u)&&(!!h(n,s)&&(!!d(r,l)&&!!d(i,c))))}var KC=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};function QC(t){const{id:e=Fh(t),style:n,data:r}=t,i=KC(t,["id","style","data"]),o=Object.assign(Object.assign({},t),{style:Object.assign({},n),data:Object.assign({},r)});return function(t){return"source"in t&&"target"in t}(t)?Object.assign({id:e,data:o},i):{id:e,data:o}}function JC(t){return t.data}class $C{constructor(){this.latestRemovedComboIds=new Set,this.comboIds=new Set,this.changes=[],this.batchCount=0,this.isTraceless=!1,this.enableUpdateNodeLikeHierarchy=!0,this.model=new tm}pushChange(t){if(this.isTraceless)return;const{type:e}=t;if(e===su.NodeUpdated||e===su.EdgeUpdated||e===su.ComboUpdated){const{value:n,original:r}=t;this.changes.push({value:qC(n),original:qC(r),type:e})}else this.changes.push({value:qC(t.value),type:e})}getChanges(){return this.changes}clearChanges(){this.changes=[]}batch(t){this.batchCount++,this.model.batch(t),this.batchCount--}isBatching(){return this.batchCount>0}silence(t){this.isTraceless=!0,t(),this.isTraceless=!1}isCombo(t){return this.comboIds.has(t)||this.latestRemovedComboIds.has(t)}getData(){return{nodes:this.getNodeData(),edges:this.getEdgeData(),combos:this.getComboData()}}getNodeData(t){return this.model.getAllNodes().reduce(((e,n)=>{const r=JC(n);return this.isCombo(Fh(r))||(void 0===t||t.includes(Fh(r)))&&e.push(r),e}),[])}getEdgeDatum(t){return JC(this.model.getEdge(t))}getEdgeData(t){return this.model.getAllEdges().reduce(((e,n)=>{const r=JC(n);return(void 0===t||t.includes(Fh(r)))&&e.push(r),e}),[])}getComboData(t){return this.model.getAllNodes().reduce(((e,n)=>{const r=JC(n);return this.isCombo(Fh(r))?((void 0===t||t.includes(Fh(r)))&&e.push(r),e):e}),[])}getRootsData(t=yu){return this.model.getRoots(t).map(JC)}getAncestorsData(t,e){const{model:n}=this;return n.hasNode(t)&&n.hasTreeStructure(e)?n.getAncestors(t,e).map(JC):[]}getDescendantsData(t){const e=this.getElementDataById(t),n=[];return Xd(e,(t=>{t!==e&&n.push(t)}),(t=>this.getChildrenData(Fh(t))),"TB"),n}getParentData(t,e){const{model:n}=this;if(!e)return void ku.warn("The hierarchy structure key is not specified");if(!n.hasNode(t)||!n.hasTreeStructure(e))return;const r=n.getParent(t,e);return r?JC(r):void 0}getChildrenData(t){const e="node"===this.getElementType(t)?yu:mu,{model:n}=this;return n.hasNode(t)&&n.hasTreeStructure(e)?n.getChildren(t,e).map(JC):[]}getElementsDataByType(t){return"node"===t?this.getNodeData():"edge"===t?this.getEdgeData():"combo"===t?this.getComboData():[]}getElementDataById(t){return"edge"===this.getElementType(t)?this.getEdgeDatum(t):this.getNodeLikeDatum(t)}getNodeLikeDatum(t){return JC(this.model.getNode(t))}getNodeLikeData(t){return this.model.getAllNodes().reduce(((e,n)=>{const r=JC(n);return t?t.includes(Fh(r))&&e.push(r):e.push(r),e}),[])}getElementDataByState(t,e){return this.getElementsDataByType(t).filter((t=>{var n;return null===(n=t.states)||void 0===n?void 0:n.includes(e)}))}getElementState(t){var e;return(null===(e=this.getElementDataById(t))||void 0===e?void 0:e.states)||[]}hasNode(t){return this.model.hasNode(t)&&!this.isCombo(t)}hasEdge(t){return this.model.hasEdge(t)}hasCombo(t){return this.model.hasNode(t)&&this.isCombo(t)}getRelatedEdgesData(t,e="both"){return this.model.getRelatedEdges(t,e).map(JC)}getNeighborNodesData(t){return this.model.getNeighbors(t).map(JC)}setData(t){const{nodes:e=[],edges:n=[],combos:r=[]}=t,{nodes:i,edges:o,combos:a}=this.getData(),s=Kh(i,e,(t=>Fh(t)),XC),l=Kh(o,n,(t=>Fh(t)),XC),c=Kh(a,r,(t=>Fh(t)),XC);this.batch((()=>{const t={nodes:s.enter,edges:l.enter,combos:c.enter};this.addData(t),this.computeZIndex(t,"add",!0);const e={nodes:s.update,edges:l.update,combos:c.update};this.updateData(e),this.computeZIndex(e,"update",!0);const n={nodes:s.exit.map(Fh),edges:l.exit.map(Fh),combos:c.exit.map(Fh)};this.removeData(n)}))}addData(t){const{nodes:e,edges:n,combos:r}=t;this.batch((()=>{this.addComboData(r),this.addNodeData(e),this.addEdgeData(n)})),this.computeZIndex(t,"add")}addNodeData(t=[]){t.length&&(this.model.addNodes(t.map((t=>(this.pushChange({value:t,type:su.NodeAdded}),QC(t))))),this.updateNodeLikeHierarchy(t),this.computeZIndex({nodes:t},"add"))}addEdgeData(t=[]){t.length&&(this.model.addEdges(t.map((t=>(this.pushChange({value:t,type:su.EdgeAdded}),QC(t))))),this.computeZIndex({edges:t},"add"))}addComboData(t=[]){if(!t.length)return;const{model:e}=this;e.hasTreeStructure(mu)||e.attachTreeStructure(mu),e.addNodes(t.map((t=>(this.comboIds.add(Fh(t)),this.pushChange({value:t,type:su.ComboAdded}),QC(t))))),this.updateNodeLikeHierarchy(t),this.computeZIndex({combos:t},"add")}addChildrenData(t,e){const n=this.getNodeLikeDatum(t),r=e.map(Fh);this.addNodeData(e),this.updateNodeData([{id:t,children:[...n.children||[],...r]}]),this.addEdgeData(r.map((e=>({source:t,target:e}))))}computeZIndex(t,e,n=!1){!n&&this.isBatching()||this.batch((()=>{const{nodes:n=[],edges:r=[],combos:i=[]}=t;i.forEach((t=>{var n,r,i;const o=Fh(t);if("add"===e&&ie(null===(n=t.style)||void 0===n?void 0:n.zIndex))return;if("update"===e&&!("combo"in t))return;const a=this.getParentData(o,mu),s=a?(null!==(i=null===(r=a.style)||void 0===r?void 0:r.zIndex)&&void 0!==i?i:0)+1:0;this.preventUpdateNodeLikeHierarchy((()=>{this.updateComboData([{id:o,style:{zIndex:s}}])}))})),n.forEach((t=>{var n,r,i;const o=Fh(t);if("add"===e&&ie(null===(n=t.style)||void 0===n?void 0:n.zIndex))return;if("update"===e&&!("combo"in t)&&!("children"in t))return;let a=0;const s=this.getParentData(o,mu);if(s)a=((null===(r=s.style)||void 0===r?void 0:r.zIndex)||0)+1;else{const t=this.getParentData(o,yu);t&&(a=(null===(i=null==t?void 0:t.style)||void 0===i?void 0:i.zIndex)||0)}this.preventUpdateNodeLikeHierarchy((()=>{this.updateNodeData([{id:o,style:{zIndex:a}}])}))})),r.forEach((t=>{var e,n,r,i,o;if(ie(null===(e=t.style)||void 0===e?void 0:e.zIndex))return;let{id:a,source:s,target:l}=t;if(a){const t=this.getEdgeDatum(a);s=t.source,l=t.target}else a=Fh(t);if(!s||!l)return;const c=(null===(r=null===(n=this.getNodeLikeDatum(s))||void 0===n?void 0:n.style)||void 0===r?void 0:r.zIndex)||0,u=(null===(o=null===(i=this.getNodeLikeDatum(l))||void 0===i?void 0:i.style)||void 0===o?void 0:o.zIndex)||0;this.updateEdgeData([{id:Fh(t),style:{zIndex:Math.max(c,u)-1}}])}))}))}getFrontZIndex(t){var e;const n=this.getElementType(t),r=this.getElementDataById(t),i=this.getData();if(Object.assign(i,{[`${n}s`]:i[`${n}s`].filter((e=>Fh(e)!==t))}),"combo"===n&&!ef(r)){const e=new Set(this.getAncestorsData(t,mu).map(Fh));i.nodes=i.nodes.filter((t=>!e.has(Fh(t)))),i.combos=i.combos.filter((t=>!e.has(Fh(t)))),i.edges=i.edges.filter((({source:t,target:n})=>!e.has(t)&&!e.has(n)))}return Math.max((null===(e=r.style)||void 0===e?void 0:e.zIndex)||0,0,...Object.values(i).flat().map((t=>{var e;return((null===(e=null==t?void 0:t.style)||void 0===e?void 0:e.zIndex)||0)+1})))}updateNodeLikeHierarchy(t){if(!this.enableUpdateNodeLikeHierarchy)return;const{model:e}=this;t.forEach((t=>{const n=Fh(t),r=_h(t);void 0!==r&&(e.hasTreeStructure(mu)||e.attachTreeStructure(mu),null===r&&this.refreshComboData(n),this.setParent(n,_h(t),mu));const i=t.children||[];if(i.length){e.hasTreeStructure(yu)||e.attachTreeStructure(yu);const t=i.filter((t=>e.hasNode(t)));t.forEach((t=>this.setParent(t,n,yu))),t.length!==i.length&&this.updateNodeData([{id:n,children:t}])}}))}preventUpdateNodeLikeHierarchy(t){this.enableUpdateNodeLikeHierarchy=!1,t(),this.enableUpdateNodeLikeHierarchy=!0}updateData(t){const{nodes:e,edges:n,combos:r}=t;this.batch((()=>{this.updateNodeData(e),this.updateComboData(r),this.updateEdgeData(n)})),this.computeZIndex(t,"update")}updateNodeData(t=[]){if(!t.length)return;const{model:e}=this;this.batch((()=>{const n=[];t.forEach((t=>{const r=Fh(t),i=JC(e.getNode(r));if(XC(i,t))return;const o=YC(i,t);this.pushChange({value:o,original:i,type:su.NodeUpdated}),e.mergeNodeData(r,o),n.push(o)})),this.updateNodeLikeHierarchy(n)})),this.computeZIndex({nodes:t},"update")}refreshData(){const{nodes:t,edges:e,combos:n}=this.getData();t.forEach((t=>{this.pushChange({value:t,original:t,type:su.NodeUpdated})})),e.forEach((t=>{this.pushChange({value:t,original:t,type:su.EdgeUpdated})})),n.forEach((t=>{this.pushChange({value:t,original:t,type:su.ComboUpdated})}))}syncNodeLikeDatum(t){const{model:e}=this,n=Fh(t);if(!e.hasNode(n))return;const r=YC(JC(e.getNode(n)),t);e.mergeNodeData(n,r)}syncEdgeDatum(t){const{model:e}=this,n=Fh(t);if(!e.hasEdge(n))return;const r=YC(JC(e.getEdge(n)),t);e.mergeEdgeData(n,r)}updateEdgeData(t=[]){if(!t.length)return;const{model:e}=this;this.batch((()=>{t.forEach((t=>{const n=Fh(t),r=JC(e.getEdge(n));if(XC(r,t))return;t.source&&r.source!==t.source&&e.updateEdgeSource(n,t.source),t.target&&r.target!==t.target&&e.updateEdgeTarget(n,t.target);const i=YC(r,t);this.pushChange({value:i,original:r,type:su.EdgeUpdated}),e.mergeEdgeData(n,i)}))})),this.computeZIndex({edges:t},"update")}updateComboData(t=[]){if(!t.length)return;const{model:e}=this;e.batch((()=>{const n=[];t.forEach((t=>{const r=Fh(t),i=JC(e.getNode(r));if(XC(i,t))return;const o=YC(i,t);this.pushChange({value:o,original:i,type:su.ComboUpdated}),e.mergeNodeData(r,o),n.push(o)})),this.updateNodeLikeHierarchy(n)})),this.computeZIndex({combos:t},"update")}setParent(t,e,n,r=!0){if(t===e)return;const i=_h(this.getNodeLikeDatum(t));if(i!==e&&n===mu){const n={id:t,combo:e};this.isCombo(t),this.syncNodeLikeDatum(n)}this.model.setParent(t,e,n),r&&n===mu&&function(t,e){void 0===e&&(e=new Map);var n=[];if(Array.isArray(t))for(var r=0,i=t.length;r<i;r++){var o=t[r];e.has(o)||(n.push(o),e.set(o,!0))}return n}([i,e]).forEach((t=>{void 0!==t&&this.refreshComboData(t)}))}refreshComboData(t){const e=this.getComboData([t])[0],n=this.getAncestorsData(t,mu);e&&this.pushChange({value:e,original:e,type:su.ComboUpdated}),n.forEach((t=>{this.pushChange({value:t,original:t,type:su.ComboUpdated})}))}getElementPosition(t){return Sd(this.getElementDataById(t))}translateNodeLikeBy(t,e){this.isCombo(t)?this.translateComboBy(t,e):this.translateNodeBy(t,e)}translateNodeLikeTo(t,e){this.isCombo(t)?this.translateComboTo(t,e):this.translateNodeTo(t,e)}translateNodeBy(t,e){const n=sd(this.getElementPosition(t),[...e,0].slice(0,3));this.translateNodeTo(t,n)}translateNodeTo(t,e){const[n=0,r=0,i=0]=e;this.preventUpdateNodeLikeHierarchy((()=>{this.updateNodeData([{id:t,style:{x:n,y:r,z:i}}])}))}translateComboBy(t,e){const[n=0,r=0,i=0]=e;if([n,r,i].some(isNaN)||[n,r,i].every((t=>0===t)))return;const o=this.getComboData([t])[0];if(!o)return;const a=new Set;Xd(o,(t=>{const e=Fh(t);if(a.has(e))return;a.add(e);const[o,s,l]=Sd(t),c=YC(t,{style:{x:o+n,y:s+r,z:l+i}});this.pushChange({value:c,original:t,type:this.isCombo(e)?su.ComboUpdated:su.NodeUpdated}),this.model.mergeNodeData(e,c)}),(t=>this.getChildrenData(Fh(t))),"BT")}translateComboTo(t,e){var n;if(e.some(isNaN))return;const[r=0,i=0,o=0]=e,a=null===(n=this.getComboData([t]))||void 0===n?void 0:n[0];if(!a)return;const[s,l,c]=Sd(a),u=r-s,h=i-l,d=o-c;Xd(a,(t=>{const e=Fh(t),[n,r,i]=Sd(t),o=YC(t,{style:{x:n+u,y:r+h,z:i+d}});this.pushChange({value:o,original:t,type:this.isCombo(e)?su.ComboUpdated:su.NodeUpdated}),this.model.mergeNodeData(e,o)}),(t=>this.getChildrenData(Fh(t))),"BT")}removeData(t){const{nodes:e,edges:n,combos:r}=t;this.batch((()=>{this.removeEdgeData(n),this.removeNodeData(e),this.removeComboData(r),this.latestRemovedComboIds=new Set(r)}))}removeNodeData(t=[]){t.length&&this.batch((()=>{t.forEach((t=>{this.removeEdgeData(this.getRelatedEdgesData(t).map(Fh)),this.pushChange({value:this.getNodeData([t])[0],type:su.NodeRemoved}),this.removeNodeLikeHierarchy(t)})),this.model.removeNodes(t)}))}removeEdgeData(t=[]){t.length&&(t.forEach((t=>this.pushChange({value:this.getEdgeData([t])[0],type:su.EdgeRemoved}))),this.model.removeEdges(t))}removeComboData(t=[]){t.length&&this.batch((()=>{t.forEach((t=>{this.pushChange({value:this.getComboData([t])[0],type:su.ComboRemoved}),this.removeNodeLikeHierarchy(t),this.comboIds.delete(t)})),this.model.removeNodes(t)}))}removeNodeLikeHierarchy(t){if(this.model.hasTreeStructure(mu)){const e=_h(this.getNodeLikeDatum(t));this.setParent(t,void 0,mu,!1),this.model.getChildren(t,mu).forEach((t=>{const n=JC(t),r=Fh(n);this.setParent(Fh(n),e,mu,!1);const i=YC(n,{id:Fh(n),combo:e});this.pushChange({value:i,original:n,type:this.isCombo(r)?su.ComboUpdated:su.NodeUpdated}),this.model.mergeNodeData(Fh(n),i)})),ae(e)||this.refreshComboData(e)}}getElementType(t){if(this.model.hasNode(t))return this.isCombo(t)?"combo":"node";if(this.model.hasEdge(t))return"edge";throw new Error(wu(`Unknown element type of id: ${t}`))}destroy(){const{model:t}=this,e=t.getAllNodes(),n=t.getAllEdges();t.removeEdges(n.map((t=>t.id))),t.removeNodes(e.map((t=>t.id))),this.context={}}}var tO=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(t){o(t)}}function s(t){try{l(r.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}))};class eO{constructor(t){this.elementMap={},this.shapeTypeMap={},this.paletteStyle={},this.defaultStyle={},this.stateStyle={},this.visibilityCache=new WeakMap,this.context=t}init(){this.initContainer()}initContainer(){if(!this.container||this.container.destroyed){const{canvas:t}=this.context;this.container=t.appendChild(new Al({className:"elements"}))}}emit(t,e){e.silence||zC(this.context.graph,t)}forEachElementData(t){qd.forEach((e=>{const n=this.context.model.getElementsDataByType(e);t(e,n)}))}getElementType(t,e){var n;const{options:r,graph:i}=this.context,o=(null===(n=r[t])||void 0===n?void 0:n.type)||e.type;return o?"string"==typeof o?o:o.call(i,e):"edge"===t?"line":"circle"}getTheme(t){return Mu(this.context.options)[t]||{}}getThemeStyle(t){return this.getTheme(t).style||{}}getThemeStateStyle(t,e){const{state:n={}}=this.getTheme(t);return Object.assign({},...e.map((t=>n[t]||{})))}computePaletteStyle(){const{options:t}=this.context;this.paletteStyle={},this.forEachElementData(((e,n)=>{var r,i;const o=Object.assign({},vf(null===(r=this.getTheme(e))||void 0===r?void 0:r.palette),vf(null===(i=t[e])||void 0===i?void 0:i.palette));(null==o?void 0:o.field)&&Object.assign(this.paletteStyle,function(t,e){if(!e)return{};const{type:n,color:r,field:i,invert:o}=e,a=t=>{const e="string"==typeof r?Eu("palette",r):r;if("function"==typeof e){const n={};return t.forEach((([t,r])=>{n[t]=e(o?1-r:r)})),n}if(Array.isArray(e)){const n=o?[...e].reverse():e,r={};return t.forEach((([t,i])=>{r[t]=n[i%e.length]})),r}return{}},s=(t,e)=>{var n;return"string"==typeof t?null===(n=e.data)||void 0===n?void 0:n[t]:null==t?void 0:t(e)};if("group"===n){const e=_u(t,(t=>{if(!i)return"default";const e=s(i,t);return e?String(e):"default"})),n=a(Object.keys(e).map(((t,e)=>[t,e]))),r={};return Object.entries(e).forEach((([t,e])=>{e.forEach((e=>{r[Fh(e)]=n[t]}))})),r}if("value"===n){const[e,n]=t.reduce((([t,e],n)=>{const r=s(i,n);if("number"!=typeof r)throw new Error(wu(`Palette field ${i} is not a number`));return[Math.min(t,r),Math.max(e,r)]}),[1/0,-1/0]),r=n-e;return a(t.map((t=>[t.id,(s(i,t)-e)/r])))}}(n,o))}))}getPaletteStyle(t,e){const n=this.paletteStyle[e];return n?"edge"===t?{stroke:n}:{fill:n}:{}}computeElementDefaultStyle(t,e){var n;const{options:r}=this.context,i=(null===(n=r[t])||void 0===n?void 0:n.style)||{};"transform"in i&&Array.isArray(i.transform)&&(i.transform=[...i.transform]),this.defaultStyle[Fh(e.datum)]=pf(i,e)}computeElementsDefaultStyle(t){const{graph:e}=this.context;this.forEachElementData(((n,r)=>{const i=r.length;for(let o=0;o<i;o++){const i=r[o];(void 0===t||t.includes(Fh(i)))&&this.computeElementDefaultStyle(n,{datum:i,graph:e})}}))}getDefaultStyle(t){return this.defaultStyle[t]||{}}getElementState(t){try{const{model:e}=this.context;return e.getElementState(t)}catch(t){return[]}}getElementStateStyle(t,e,n){var r,i;const{options:o}=this.context;return pf((null===(i=null===(r=o[t])||void 0===r?void 0:r.state)||void 0===i?void 0:i[e])||{},n)}computeElementStatesStyle(t,e,n){this.stateStyle[Fh(n.datum)]=Object.assign({},...e.map((e=>this.getElementStateStyle(t,e,n))))}computeElementsStatesStyle(t){const{graph:e}=this.context;this.forEachElementData(((n,r)=>{const i=r.length;for(let o=0;o<i;o++){const i=r[o];if(void 0===t||t.includes(Fh(i))){const t=this.getElementState(Fh(i));this.computeElementStatesStyle(n,t,{datum:i,graph:e})}}}))}getStateStyle(t){return this.stateStyle[t]||{}}computeStyle(t,e){t&&["translate","zIndex"].includes(t)||(this.computePaletteStyle(),this.computeElementsDefaultStyle(e),this.computeElementsStatesStyle(e))}getElement(t){return this.elementMap[t]}getNodes(){return this.context.model.getNodeData().map((({id:t})=>this.elementMap[t]))}getEdges(){return this.context.model.getEdgeData().map((t=>this.elementMap[Fh(t)]))}getCombos(){return this.context.model.getComboData().map((({id:t})=>this.elementMap[t]))}getElementComputedStyle(t,e){const n=Fh(e),r=this.getThemeStyle(t),i=this.getPaletteStyle(t,n),o=e.style||{},a=this.getDefaultStyle(n),s=this.getThemeStateStyle(t,this.getElementState(n)),l=this.getStateStyle(n),c=Object.assign({},r,i,o,a,s,l);if("combo"===t){const t=this.context.model.getChildrenData(n),e=!!c.collapsed?[]:t.map(Fh).filter((t=>this.getElement(t)));Object.assign(c,{childrenNode:e,childrenData:t})}return c}getDrawData(t){this.init();const e=this.computeChangesAndDrawData(t);if(!e)return null;const{type:n="draw",stage:r=n}=t;return this.markDestroyElement(e.drawData),this.computeStyle(r),{type:n,stage:r,data:e}}draw(t={animation:!0}){const e=this.getDrawData(t);if(!e)return;const{data:{drawData:{add:n,update:r,remove:i}}}=e;return this.destroyElements(i,t),this.createElements(n,t),this.updateElements(r,t),this.setAnimationTask(t,e)}preLayoutDraw(){return tO(this,arguments,void 0,(function*(t={animation:!0}){var e,n;const r=this.getDrawData(t);if(!r)return;const{data:{drawData:i}}=r;yield null===(n=null===(e=this.context.layout)||void 0===e?void 0:e.preLayout)||void 0===n?void 0:n.call(e,i);const{add:o,update:a,remove:s}=i;return this.destroyElements(s,t),this.createElements(o,t),this.updateElements(a,t),this.setAnimationTask(t,r)}))}setAnimationTask(t,e){const{animation:n,silence:r}=t,{data:{dataChanges:i,drawData:o},stage:a,type:s}=e;return this.context.animation.animate(n,r?{}:{before:()=>this.emit(new LC(pu.BEFORE_DRAW,{dataChanges:i,animation:n,stage:a,render:"render"===s}),t),beforeAnimate:e=>this.emit(new IC(pu.BEFORE_ANIMATE,lu.DRAW,e,o),t),afterAnimate:e=>this.emit(new IC(pu.AFTER_ANIMATE,lu.DRAW,e,o),t),after:()=>this.emit(new LC(pu.AFTER_DRAW,{dataChanges:i,animation:n,stage:a,render:"render"===s,firstRender:!1===this.context.graph.rendered}),t)})}computeChangesAndDrawData(t){const{model:e}=this.context,n=e.getChanges(),r=mw(n);if(0===r.length)return null;const{NodeAdded:i=[],NodeUpdated:o=[],NodeRemoved:a=[],EdgeAdded:s=[],EdgeUpdated:l=[],EdgeRemoved:c=[],ComboAdded:u=[],ComboUpdated:h=[],ComboRemoved:d=[]}=_u(r,(t=>t.type)),f=t=>new Map(t.map((t=>{const e=t.value;return[Fh(e),e]}))),p={add:{nodes:f(i),edges:f(s),combos:f(u)},update:{nodes:f(o),edges:f(l),combos:f(h)},remove:{nodes:f(a),edges:f(c),combos:f(d)}},g=this.transformData(p,t);return e.clearChanges(),{dataChanges:n,drawData:g}}transformData(t,e){const n=this.context.transform.getTransformInstance();return Object.values(n).reduce(((t,n)=>n.beforeDraw(t,e)),t)}createElement(t,e,n){var r;const i=Fh(e);if(this.getElement(i))return;const o=this.getElementType(t,e),a=this.getElementComputedStyle(t,e),s=Eu(t,o);if(!s)return ku.warn(`The element ${o} of ${t} is not registered.`);this.emit(new BC(pu.BEFORE_ELEMENT_CREATE,t,e),n);const l=this.container.appendChild(new s({id:i,context:this.context,style:a}));this.shapeTypeMap[i]=o,this.elementMap[i]=l;const{stage:c="enter"}=n;null===(r=this.context.animation)||void 0===r||r.add({element:l,elementType:t,stage:c,originalStyle:Object.assign({},l.attributes),updatedStyle:a},{after:()=>{var r;this.emit(new BC(pu.AFTER_ELEMENT_CREATE,t,e),n),null===(r=l.onCreate)||void 0===r||r.call(l)}})}createElements(t,e){const{nodes:n,edges:r,combos:i}=t;[["node",n],["combo",i],["edge",r]].forEach((([t,n])=>{n.forEach((n=>this.createElement(t,n,e)))}))}getUpdateStageStyle(t,e,n){const{stage:r="update"}=n;if("translate"===r){if("node"===t||"combo"===t){const{style:{x:t=0,y:n=0,z:r=0}={}}=e;return{x:t,y:n,z:r}}return{}}return this.getElementComputedStyle(t,e)}updateElement(t,e,n){var r;const i=Fh(e),{stage:o="update"}=n,a=this.getElement(i);if(!a)return()=>null;this.emit(new BC(pu.BEFORE_ELEMENT_UPDATE,t,e),n);const s=this.getElementType(t,e),l=this.getUpdateStageStyle(t,e,n);this.shapeTypeMap[i]!==s&&(a.destroy(),delete this.shapeTypeMap[i],delete this.elementMap[i],this.createElement(t,e,{animation:!1,silence:!0}));const c="visibility"!==o?o:"hidden"===l.visibility?"hide":"show";"hide"===c&&delete l.visibility,null===(r=this.context.animation)||void 0===r||r.add({element:a,elementType:t,stage:c,originalStyle:Object.assign({},a.attributes),updatedStyle:l},{before:()=>{const t=this.elementMap[i];"collapse"!==o&&Iv(t,l),"visibility"===o&&(function(t,e){return ZC(e)in(nf(t,_C)||{})}(t,"opacity")||function(t,e){const n=Array.isArray(e)?e:[e];nf(t,_C)||rf(t,_C,{}),n.forEach((e=>{rf(nf(t,_C),ZC(e),t.attributes[e])}))}(t,"opacity"),this.visibilityCache.set(t,"show"===c?"visible":"hidden"),"show"===c&&Qh(t,"visible"))},after:()=>{var r;const a=this.elementMap[i];"collapse"===o&&Iv(a,l),"hide"===c&&Qh(a,this.visibilityCache.get(a)),this.emit(new BC(pu.AFTER_ELEMENT_UPDATE,t,e),n),null===(r=a.onUpdate)||void 0===r||r.call(a)}})}updateElements(t,e){const{nodes:n,edges:r,combos:i}=t;[["node",n],["combo",i],["edge",r]].forEach((([t,n])=>{n.forEach((n=>this.updateElement(t,n,e)))}))}markDestroyElement(t){Object.values(t.remove).forEach((t=>{t.forEach((t=>{const e=Fh(t),n=this.getElement(e);n&&function(t){rf(t,"__to_be_destroyed__",!0)}(n)}))}))}destroyElement(t,e,n){var r;const{stage:i="exit"}=n,o=Fh(e),a=this.elementMap[o];if(!a)return()=>null;this.emit(new BC(pu.BEFORE_ELEMENT_DESTROY,t,e),n),null===(r=this.context.animation)||void 0===r||r.add({element:a,elementType:t,stage:i,originalStyle:Object.assign({},a.attributes),updatedStyle:{}},{after:()=>{var r;this.clearElement(o),a.destroy(),null===(r=a.onDestroy)||void 0===r||r.call(a),this.emit(new BC(pu.AFTER_ELEMENT_DESTROY,t,e),n)}})}destroyElements(t,e){const{nodes:n,edges:r,combos:i}=t;[["combo",i],["edge",r],["node",n]].forEach((([t,n])=>{n.forEach((n=>this.destroyElement(t,n,e)))}))}clearElement(t){delete this.paletteStyle[t],delete this.defaultStyle[t],delete this.stateStyle[t],delete this.elementMap[t],delete this.shapeTypeMap[t]}alignLayoutResultToElement(t,e){var n,r;const i=null===(n=t.nodes)||void 0===n?void 0:n.find((t=>Fh(t)===e));if(i){const n=ld(Sd(this.context.model.getNodeLikeDatum(e)),Sd(i));null===(r=t.nodes)||void 0===r||r.forEach((t=>{var e,r,i;(null===(e=t.style)||void 0===e?void 0:e.x)&&(t.style.x+=n[0]),(null===(r=t.style)||void 0===r?void 0:r.y)&&(t.style.y+=n[1]),(null===(i=t.style)||void 0===i?void 0:i.z)&&(t.style.z+=n[2]||0)}))}}collapseNode(t,e){return tO(this,void 0,void 0,(function*(){var n;const{animation:r}=e,{model:i}=this.context,o=this.computeChangesAndDrawData({stage:"collapse",animation:r});if(!o)return;const{drawData:a}=o,{add:s,remove:l,update:c}=a;this.markDestroyElement(a);const u={animation:r,stage:"collapse",data:a};this.destroyElements(l,u),this.createElements(s,u),this.updateElements(c,u),yield null===(n=this.context.animation.animate(r,{beforeAnimate:t=>this.emit(new IC(pu.BEFORE_ANIMATE,lu.COLLAPSE,t,a),u),afterAnimate:t=>this.emit(new IC(pu.AFTER_ANIMATE,lu.COLLAPSE,t,a),u)},{collapse:{target:t,descendants:Array.from(l.nodes).map((([,t])=>Fh(t))),position:Sd(c.nodes.get(t))}}))||void 0===n?void 0:n.finished}))}expandNode(t,e){return tO(this,void 0,void 0,(function*(){var n;const{model:r,layout:i}=this.context,{animation:o,align:a}=e,s=Sd(r.getNodeData([t])[0]),l=this.computeChangesAndDrawData({stage:"expand",animation:o});if(this.createElements(l.drawData.add,{animation:!1,stage:"expand",target:t}),this.context.animation.clear(),this.computeStyle("expand"),!l)return;const{drawData:c}=l,{update:u,add:h}=c,d={animation:o,stage:"expand",data:c};h.edges.forEach((t=>u.edges.set(Fh(t),t))),h.nodes.forEach((t=>u.nodes.set(Fh(t),t))),this.updateElements(u,d),yield null===(n=this.context.animation.animate(o,{beforeAnimate:t=>this.emit(new IC(pu.BEFORE_ANIMATE,lu.EXPAND,t,c),d),afterAnimate:t=>this.emit(new IC(pu.AFTER_ANIMATE,lu.EXPAND,t,c),d)},{expand:{target:t,descendants:Array.from(h.nodes).map((([,t])=>Fh(t))),position:s}}))||void 0===n?void 0:n.finished}))}collapseCombo(t,e){return tO(this,void 0,void 0,(function*(){var n;const{model:r,element:i}=this.context;if(r.getAncestorsData(t,mu).some((t=>ef(t))))return;const o=i.getElement(t),a=o.getComboPosition(Object.assign(Object.assign({},o.attributes),{collapsed:!0})),s=this.computeChangesAndDrawData({stage:"collapse",animation:e});if(!s)return;const{dataChanges:l,drawData:c}=s;this.markDestroyElement(c);const{update:u,remove:h}=c,d={animation:e,stage:"collapse",data:c};this.destroyElements(h,d),this.updateElements(u,d);const f=t=>Array.from(t).map((([,t])=>Fh(t)));yield null===(n=this.context.animation.animate(e,{before:()=>this.emit(new LC(pu.BEFORE_DRAW,{dataChanges:l,animation:e}),d),beforeAnimate:t=>this.emit(new IC(pu.BEFORE_ANIMATE,lu.COLLAPSE,t,c),d),afterAnimate:t=>this.emit(new IC(pu.AFTER_ANIMATE,lu.COLLAPSE,t,c),d),after:()=>this.emit(new LC(pu.AFTER_DRAW,{dataChanges:l,animation:e}),d)},{collapse:{target:t,descendants:[...f(h.nodes),...f(h.combos)],position:a}}))||void 0===n?void 0:n.finished}))}expandCombo(t,e){return tO(this,void 0,void 0,(function*(){var n;const{model:r}=this.context,i=Sd(r.getComboData([t])[0]);this.computeStyle("expand");const o=this.computeChangesAndDrawData({stage:"expand",animation:e});if(!o)return;const{dataChanges:a,drawData:s}=o,{add:l,update:c}=s,u={animation:e,stage:"expand",data:s,target:t};this.createElements(l,u),this.updateElements(c,u);const h=t=>Array.from(t).map((([,t])=>Fh(t)));yield null===(n=this.context.animation.animate(e,{before:()=>this.emit(new LC(pu.BEFORE_DRAW,{dataChanges:a,animation:e}),u),beforeAnimate:t=>this.emit(new IC(pu.BEFORE_ANIMATE,lu.EXPAND,t,s),u),afterAnimate:t=>this.emit(new IC(pu.AFTER_ANIMATE,lu.EXPAND,t,s),u),after:()=>this.emit(new LC(pu.AFTER_DRAW,{dataChanges:a,animation:e}),u)},{expand:{target:t,descendants:[...h(l.nodes),...h(l.combos)],position:i}}))||void 0===n?void 0:n.finished}))}clear(){this.container.destroy(),this.initContainer(),this.elementMap={},this.shapeTypeMap={},this.defaultStyle={},this.stateStyle={},this.paletteStyle={}}destroy(){this.clear(),this.container.destroy(),this.context={}}}const nO=Symbol("Comlink.proxy"),rO=Symbol("Comlink.endpoint"),iO=Symbol("Comlink.releaseProxy"),oO=Symbol("Comlink.finalizer"),aO=Symbol("Comlink.thrown"),sO=t=>"object"==typeof t&&null!==t||"function"==typeof t,lO=new Map([["proxy",{canHandle:t=>sO(t)&&t[nO],serialize(t){const{port1:e,port2:n}=new MessageChannel;return cO(t,e),[n,[n]]},deserialize(t){return t.start(),hO(t)}}],["throw",{canHandle:t=>sO(t)&&aO in t,serialize({value:t}){let e;return e=t instanceof Error?{isError:!0,value:{message:t.message,name:t.name,stack:t.stack}}:{isError:!1,value:t},[e,[]]},deserialize(t){if(t.isError)throw Object.assign(new Error(t.value.message),t.value);throw t.value}}]]);function cO(t,e=globalThis,n=["*"]){e.addEventListener("message",(function r(i){if(!i||!i.data)return;if(!function(t,e){for(const n of t){if(e===n||"*"===n)return!0;if(n instanceof RegExp&&n.test(e))return!0}return!1}(n,i.origin))return void console.warn(`Invalid origin '${i.origin}' for comlink proxy`);const{id:o,type:a,path:s}=Object.assign({path:[]},i.data),l=(i.data.argumentList||[]).map(xO);let c;try{const e=s.slice(0,-1).reduce(((t,e)=>t[e]),t),n=s.reduce(((t,e)=>t[e]),t);switch(a){case"GET":c=n;break;case"SET":e[s.slice(-1)[0]]=xO(i.data.value),c=!0;break;case"APPLY":c=n.apply(e,l);break;case"CONSTRUCT":c=function(t){return Object.assign(t,{[nO]:!0})}(new n(...l));break;case"ENDPOINT":{const{port1:e,port2:n}=new MessageChannel;cO(t,n),c=function(t,e){return yO.set(t,e),t}(e,[e])}break;case"RELEASE":c=void 0;break;default:return}}catch(t){c={value:t,[aO]:0}}Promise.resolve(c).catch((t=>({value:t,[aO]:0}))).then((n=>{const[i,s]=bO(n);e.postMessage(Object.assign(Object.assign({},i),{id:o}),s),"RELEASE"===a&&(e.removeEventListener("message",r),uO(e),oO in t&&"function"==typeof t[oO]&&t[oO]())})).catch((t=>{const[n,r]=bO({value:new TypeError("Unserializable return value"),[aO]:0});e.postMessage(Object.assign(Object.assign({},n),{id:o}),r)}))})),e.start&&e.start()}function uO(t){(function(t){return"MessagePort"===t.constructor.name})(t)&&t.close()}function hO(t,e){const n=new Map;return t.addEventListener("message",(function(t){const{data:e}=t;if(!e||!e.id)return;const r=n.get(e.id);if(r)try{r(e)}finally{n.delete(e.id)}})),vO(t,n,[],e)}function dO(t){if(t)throw new Error("Proxy has been released and is not useable")}function fO(t){return EO(t,new Map,{type:"RELEASE"}).then((()=>{uO(t)}))}const pO=new WeakMap,gO="FinalizationRegistry"in globalThis&&new FinalizationRegistry((t=>{const e=(pO.get(t)||0)-1;pO.set(t,e),0===e&&fO(t)}));function vO(t,e,n=[],r=function(){}){let i=!1;const o=new Proxy(r,{get(r,a){if(dO(i),a===iO)return()=>{!function(t){gO&&gO.unregister(t)}(o),fO(t),e.clear(),i=!0};if("then"===a){if(0===n.length)return{then:()=>o};const r=EO(t,e,{type:"GET",path:n.map((t=>t.toString()))}).then(xO);return r.then.bind(r)}return vO(t,e,[...n,a])},set(r,o,a){dO(i);const[s,l]=bO(a);return EO(t,e,{type:"SET",path:[...n,o].map((t=>t.toString())),value:s},l).then(xO)},apply(r,o,a){dO(i);const s=n[n.length-1];if(s===rO)return EO(t,e,{type:"ENDPOINT"}).then(xO);if("bind"===s)return vO(t,e,n.slice(0,-1));const[l,c]=mO(a);return EO(t,e,{type:"APPLY",path:n.map((t=>t.toString())),argumentList:l},c).then(xO)},construct(r,o){dO(i);const[a,s]=mO(o);return EO(t,e,{type:"CONSTRUCT",path:n.map((t=>t.toString())),argumentList:a},s).then(xO)}});return function(t,e){const n=(pO.get(e)||0)+1;pO.set(e,n),gO&&gO.register(t,e,t)}(o,t),o}function mO(t){const e=t.map(bO);return[e.map((t=>t[0])),(n=e.map((t=>t[1])),Array.prototype.concat.apply([],n))];var n}const yO=new WeakMap;function bO(t){for(const[e,n]of lO)if(n.canHandle(t)){const[r,i]=n.serialize(t);return[{type:"HANDLER",name:e,value:r},i]}return[{type:"RAW",value:t},yO.get(t)||[]]}function xO(t){switch(t.type){case"HANDLER":return lO.get(t.name).deserialize(t.value);case"RAW":return t.value}}function EO(t,e,n,r){return new Promise((i=>{const o=new Array(4).fill(0).map((()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16))).join("-");e.set(o,i),t.start&&t.start(),t.postMessage(Object.assign({id:o},n),r)}))}class wO extends Xv{constructor(t,e,n){super(),this.graph=t,this.layout=e,this.options=n,this.spawnWorker()}spawnWorker(){this.proxy=hO(new Worker(new URL(n.p+n.u(1970),n.b),{type:void 0})),this.running&&(this.running=!1,this.execute())}execute(){var t;return(0,ce.mG)(this,void 0,void 0,(function*(){if(this.running)return this;this.running=!0;const e=this.layout.options,{onTick:n}=e,r=(0,ce._T)(e,["onTick"]),i={};Object.keys(r).forEach((t=>{en(r[t])||(i[t]=r[t])}));const o={layout:{id:this.layout.id,options:i,iterations:null===(t=this.options)||void 0===t?void 0:t.iterations},nodes:this.graph.getAllNodes(),edges:this.graph.getAllEdges()},a=new Float32Array([0]),[s]=yield this.proxy.calculateLayout(o,[a]);return s}))}stop(){return this.running=!1,this.proxy.stopLayout(),this}kill(){this.proxy[iO]()}isRunning(){return this.running}}var kO=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(t){o(t)}}function s(t){try{l(r.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}))},MO=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};class SO{get presetOptions(){return{animation:!!Cu(this.context.options,!0)}}get options(){const{options:t}=this.context;return t.layout}constructor(t){this.instances=[],this.context=t}getLayoutInstance(){return this.instances}preLayout(t){return kO(this,void 0,void 0,(function*(){var e,n,r,i;const{graph:o,model:a}=this.context,{add:s}=t;zC(o,new LC(pu.BEFORE_LAYOUT,{type:"pre"}));const l=yield null===(e=this.context.layout)||void 0===e?void 0:e.simulate();null===(n=null==l?void 0:l.nodes)||void 0===n||n.forEach((t=>{const e=Fh(t),n=s.nodes.get(e);a.syncNodeLikeDatum(t),n&&Object.assign(n.style,t.style)})),null===(r=null==l?void 0:l.edges)||void 0===r||r.forEach((t=>{const e=Fh(t),n=s.edges.get(e);a.syncEdgeDatum(t),n&&Object.assign(n.style,t.style)})),null===(i=null==l?void 0:l.combos)||void 0===i||i.forEach((t=>{const e=Fh(t),n=s.combos.get(e);a.syncNodeLikeDatum(t),n&&Object.assign(n.style,t.style)})),zC(o,new LC(pu.AFTER_LAYOUT,{type:"pre"})),this.transformDataAfterLayout("pre",t)}))}postLayout(){return kO(this,arguments,void 0,(function*(t=this.options){if(!t)return;const e=Array.isArray(t)?t:[t],{graph:n}=this.context;zC(n,new LC(pu.BEFORE_LAYOUT,{type:"post"}));for(let t=0;t<e.length;t++){const r=e[t],i=this.getLayoutData(r),o=Object.assign(Object.assign({},this.presetOptions),r);zC(n,new LC(pu.BEFORE_STAGE_LAYOUT,{options:o,index:t}));const a=yield this.stepLayout(i,o,t);zC(n,new LC(pu.AFTER_STAGE_LAYOUT,{options:o,index:t})),r.animation||this.updateElementPosition(a,!1)}zC(n,new LC(pu.AFTER_LAYOUT,{type:"post"})),this.transformDataAfterLayout("post")}))}transformDataAfterLayout(t,e){const n=this.context.transform.getTransformInstance();Object.values(n).forEach((n=>n.afterLayout(t,e)))}simulate(){return kO(this,void 0,void 0,(function*(){if(!this.options)return{};const t=Array.isArray(this.options)?this.options:[this.options];let e={};for(let n=0;n<t.length;n++){const r=t[n],i=this.getLayoutData(r);e=yield this.stepLayout(i,Object.assign(Object.assign(Object.assign({},this.presetOptions),r),{animation:!1}),n)}return e}))}stepLayout(t,e,n){return kO(this,void 0,void 0,(function*(){return function(t){const{type:e}=t;return["compact-box","mindmap","dendrogram","indented"].includes(e)}(e)?yield this.treeLayout(t,e,n):yield this.graphLayout(t,e,n)}))}graphLayout(t,e,n){return kO(this,void 0,void 0,(function*(){const{animation:r,enableWorker:i,iterations:o=300}=e,a=this.initGraphLayout(e);if(!a)return{};if(this.instances[n]=a,this.instance=a,i){const e=a;return this.supervisor=new wO(e.graphData2LayoutModel(t),e.instance,{iterations:o}),im(yield this.supervisor.execute())}if(nx(a))return r?yield a.execute(t,{onTick:t=>{this.updateElementPosition(t,!1)}}):(a.execute(t),a.stop(),a.tick(o));const s=yield a.execute(t);if(r){const t=this.updateElementPosition(s,r);yield null==t?void 0:t.finished}return s}))}treeLayout(t,e,n){return kO(this,void 0,void 0,(function*(){const{type:n,animation:r}=e,i=Eu("layout",n);if(!i)return{};const{nodes:o=[],edges:a=[]}=t,s=new tm({nodes:o.map((t=>({id:Fh(t),data:t.data||{}}))),edges:a.map((t=>({id:Fh(t),source:t.source,target:t.target,data:t.data||{}})))});!function(t){if(t.hasTreeStructure(yu))return;t.attachTreeStructure(yu);const e=t.getAllEdges();for(const n of e){const{source:e,target:r}=n;t.setParent(r,e,yu)}}(s);const l={nodes:[],edges:[]},c={nodes:[],edges:[]};s.getRoots(yu).forEach((t=>{Xd(t,(t=>{t.children=s.getSuccessors(t.id)}),(t=>s.getSuccessors(t.id)),"TB");const n=i(t,e),{x:r,y:o,z:a=0}=n;Xd(n,(t=>{const{id:e,x:n,y:i,z:s=0}=t;l.nodes.push({id:e,style:{x:r,y:o,z:a}}),c.nodes.push({id:e,style:{x:n,y:i,z:s}})}),(t=>t.children),"TB")}));const u=this.inferTreeLayoutOffset(c);if(AO(c,u),r){AO(l,u),this.updateElementPosition(l,!1);const t=this.updateElementPosition(c,r);yield null==t?void 0:t.finished}return c}))}inferTreeLayoutOffset(t){var e;let[n,r]=[1/0,-1/0],[i,o]=[1/0,-1/0];null===(e=t.nodes)||void 0===e||e.forEach((t=>{const{x:e=0,y:a=0}=t.style||{};n=Math.min(n,e),r=Math.max(r,e),i=Math.min(i,a),o=Math.max(o,a)}));const{canvas:a}=this.context,s=a.getSize(),[l,c]=a.getCanvasByViewport([0,0]),[u,h]=a.getCanvasByViewport(s);if(n>=l&&r<=u&&i>=c&&o<=h)return[0,0];return[(l+u)/2-(n+r)/2,(c+h)/2-(i+o)/2]}stopLayout(){this.instance&&nx(this.instance)&&(this.instance.stop(),this.instance=void 0),this.supervisor&&(this.supervisor.stop(),this.supervisor=void 0),this.animationResult&&(this.animationResult.finish(),this.animationResult=void 0)}getLayoutData(t){const{nodeFilter:e=(()=>!0),comboFilter:n=(()=>!0),preLayout:r=!1,isLayoutInvisibleNodes:i=!1}=t,{nodes:o,edges:a,combos:s}=this.context.model.getData(),{element:l,model:c}=this.context,u=t=>l.getElement(t),h=r?t=>{var n;if(!i){if("hidden"===(null===(n=t.style)||void 0===n?void 0:n.visibility))return!1;if(c.getAncestorsData(t.id,yu).some(ef))return!1;if(c.getAncestorsData(t.id,mu).some(ef))return!1}return e(t)}:t=>{const n=Fh(t),r=u(n);return!!r&&(!Bv(r)&&e(t))},d=o.filter(h),f=s.filter(n),p=new Map(d.map((t=>[Fh(t),t])));f.forEach((t=>p.set(Fh(t),t)));return{nodes:d,edges:a.filter((({source:t,target:e})=>p.has(t)&&p.has(e))),combos:f}}initGraphLayout(t){var e;const{element:n,viewport:r}=this.context,{type:i,enableWorker:o,animation:a,iterations:s}=t,l=MO(t,["type","enableWorker","animation","iterations"]),[c,u]=r.getCanvasSize(),h=[c/2,u/2],d=null!==(e=null==t?void 0:t.nodeSize)&&void 0!==e?e:t=>{const e=null==n?void 0:n.getElement(t.id);return e?e.attributes.size:null==n?void 0:n.getElementComputedStyle("node",t).size},f=Eu("layout",i);if(!f)return ku.warn(`The layout of ${i} is not registered.`);const p=Object.getPrototypeOf(f.prototype)===em.prototype?f:function(t,e){return class extends em{constructor(e,n){if(super(e,n),this.instance=new t({}),this.id=this.instance.id,"stop"in this.instance&&"tick"in this.instance){const t=this.instance;this.stop=t.stop.bind(t),this.tick=e=>im(t.tick(e))}}execute(t,e){return nm(this,void 0,void 0,(function*(){return im(yield this.instance.execute(this.graphData2LayoutModel(t),this.transformOptions(od({},this.options,e))))}))}transformOptions(t){if(!("onTick"in t))return t;const e=t.onTick;return t.onTick=t=>e(im(t)),t}graphData2LayoutModel(t){const{nodes:n=[],edges:r=[],combos:i=[]}=t,o=n.map((t=>{const e=Fh(t),{data:n,style:r,combo:i}=t,o=rm(t,["data","style","combo"]),a={id:e,data:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},n),{data:n}),i?{parentId:i}:{}),{style:r}),o)};return(null==r?void 0:r.x)&&Object.assign(a.data,{x:r.x}),(null==r?void 0:r.y)&&Object.assign(a.data,{y:r.y}),(null==r?void 0:r.z)&&Object.assign(a.data,{z:r.z}),a})),a=new Map(o.map((t=>[t.id,t]))),s=r.filter((t=>{const{source:e,target:n}=t;return a.has(e)&&a.has(n)})).map((t=>{const{source:e,target:n,data:r,style:i}=t;return{id:Fh(t),source:e,target:n,data:Object.assign({},r),style:Object.assign({},i)}})),l=i.map((t=>({id:Fh(t),data:Object.assign({_isCombo:!0},t.data),style:Object.assign({},t.style)}))),c=new tm({nodes:[...o,...l],edges:s});return e.model.model.hasTreeStructure(mu)&&(c.attachTreeStructure(mu),o.forEach((t=>{const n=e.model.model.getParent(t.id,mu);n&&c.hasNode(n.id)&&c.setParent(t.id,n.id,mu)}))),c}}}(f,this.context),g=new p(this.context),v={nodeSize:d,width:c,height:u,center:h};switch(g.id){case"d3-force":case"d3-force-3d":Object.assign(v,{center:{x:c/2,y:u/2,z:0}})}return od(g.options,v,l),g}updateElementPosition(t,e){const{model:n,element:r}=this.context;return r?(n.updateData(t),r.draw({animation:e,silence:!0})):null}destroy(){var t;this.stopLayout(),this.context={},null===(t=this.supervisor)||void 0===t||t.kill(),this.supervisor=void 0,this.instance=void 0,this.instances=[],this.animationResult=void 0}}const AO=(t,e)=>{var n;const[r,i]=e;null===(n=t.nodes)||void 0===n||n.forEach((t=>{if(t.style){const{x:e=0,y:n=0}=t.style;t.style.x=e+r,t.style.y=n+i}else t.style={x:r,y:i}}))};function NO(t){return t.layout?(Array.isArray(t.layout)||"preLayout"in t.layout||["antv-dagre","combo-combined","compact-box","circular","concentric","dagre","fishbone","grid","indented","mds","radial","random","snake","dendrogram","mindmap"].includes(t.layout.type)&&(t.layout.preLayout=!0),t):t}class CO extends Jh{constructor(t){super(t),this.category="plugin",this.setPlugins(this.context.options.plugins||[])}setPlugins(t){this.setExtensions(t)}getPluginInstance(t){const e=this.extensionMap[t];if(e)return e;ku.warn(`Cannot find the plugin ${t}, will try to find it by type.`);const n=this.extensions.find((e=>e.type===t));return n?this.extensionMap[n.key]:void 0}}const OO=["update-related-edges","collapse-expand-node","collapse-expand-combo","get-edge-actual-ends","arrange-draw-order"];class TO extends Jh{constructor(t){super(t),this.category="transform",this.setTransforms(this.context.options.transforms||[])}getTransforms(){}setTransforms(t){this.setExtensions([...OO.slice(0,OO.length-1),...t,OO[OO.length-1]])}getTransformInstance(t){return t?this.extensionMap[t]:this.extensionMap}}var PO=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(t){o(t)}}function s(t){try{l(r.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}))};class RO{get padding(){return Uu(this.context.options.padding)}get paddingOffset(){const[t,e,n,r]=this.padding,[i,o,a]=[(r-e)/2,(t-n)/2,0];return[i,o,a]}constructor(t){this.landmarkCounter=0,this.context=t;const[e,n]=this.paddingOffset,{zoom:r,rotation:i,x:o=e,y:a=n}=t.options;this.transform({mode:"absolute",scale:r,translate:[o,a],rotate:i},!1)}get camera(){const{canvas:t}=this.context;return new Proxy(t.getCamera(),{get:(e,n)=>{const r=Object.entries(t.getLayers()).filter((([t])=>!["main"].includes(t))).map((([,t])=>t.getCamera())),i=e[n];if("function"==typeof i)return(...t)=>{const o=i.apply(e,t);return r.forEach((e=>{e[n].apply(e,t)})),o}}})}createLandmark(t){return this.camera.createLandmark("landmark-"+this.landmarkCounter++,t)}getAnimation(t){const e=Cu(this.context.options,t);return!!e&&gg(Object.assign({},e),["easing","duration"])}getCanvasSize(){const{canvas:t}=this.context,{width:e=0,height:n=0}=t.getConfig();return[e,n]}getCanvasCenter(){const{canvas:t}=this.context,{width:e=0,height:n=0}=t.getConfig();return[e/2,n/2,0]}getViewportCenter(){const[t,e]=this.camera.getPosition();return[t,e,0]}getGraphCenter(){return this.context.graph.getViewportByCanvas(this.getCanvasCenter())}getZoom(){return this.camera.getZoom()}getRotation(){return this.camera.getRoll()}getTranslateOptions(t){const{camera:e}=this,{mode:n,translate:r=[]}=t,i=this.getZoom(),o=e.getPosition(),a=e.getFocalPoint(),[s,l]=this.getCanvasCenter(),[c=0,u=0,h=0]=r,d=ud([-c,-u,-h],i);return"relative"===n?{position:sd(o,d),focalPoint:sd(a,d)}:{position:sd([s,l,o[2]],d),focalPoint:sd([s,l,a[2]],d)}}getRotateOptions(t){const{mode:e,rotate:n=0}=t;return{roll:"relative"===e?this.camera.getRoll()+n:n}}getZoomOptions(t){const{zoomRange:e}=this.context.options,n=this.camera.getZoom(),{mode:r,scale:i=1}=t;return le("relative"===r?n*i:i,...e)}transform(t,e){return PO(this,void 0,void 0,(function*(){const{graph:n}=this.context,{translate:r,rotate:i,scale:o,origin:a}=t;this.cancelAnimation();const s=this.getAnimation(e);if(zC(n,new jC(pu.BEFORE_TRANSFORM,t)),!i&&o&&!r&&a&&!s)return this.camera.setZoomByViewportPoint(this.getZoomOptions(t),a),void zC(n,new jC(pu.AFTER_TRANSFORM,t));const l={};if(r&&Object.assign(l,this.getTranslateOptions(t)),ie(i)&&Object.assign(l,this.getRotateOptions(t)),ie(o)&&Object.assign(l,{zoom:this.getZoomOptions(t)}),s)return zC(n,new IC(pu.BEFORE_ANIMATE,lu.TRANSFORM,null,t)),new Promise((e=>{this.transformResolver=e,this.camera.gotoLandmark(this.createLandmark(l),Object.assign(Object.assign({},s),{onfinish:()=>{zC(n,new IC(pu.AFTER_ANIMATE,lu.TRANSFORM,null,t)),zC(n,new jC(pu.AFTER_TRANSFORM,t)),this.transformResolver=void 0,e()}}))}));this.camera.gotoLandmark(this.createLandmark(l),{duration:0}),zC(n,new jC(pu.AFTER_TRANSFORM,t))}))}fitView(t,e){return PO(this,void 0,void 0,(function*(){const[n,r,i,o]=this.padding,{when:a="always",direction:s="both"}=t||{},[l,c]=this.context.canvas.getSize(),u=l-o-r,h=c-n-i,d=this.context.canvas.getBounds(),f=this.getBBoxInViewport(d),[p,g]=Ku(f);if("overflow"===a&&!("x"===s&&p>=u||"y"===s&&g>=h||"both"===s&&p>=u&&g>=h))return yield this.fitCenter({animation:e});const v=u/p,m=h/g,y="x"===s?v:"y"===s?m:Math.min(v,m),b=this.getAnimation(e);Number.isFinite(y)&&(yield this.transform({mode:"relative",scale:y,translate:sd(ld(this.getCanvasCenter(),this.getBBoxInViewport(d).center),ud(this.paddingOffset,y))},b))}))}fitCenter(t){return PO(this,void 0,void 0,(function*(){const e=this.context.canvas.getBounds();yield this.focus(e,t)}))}focusElements(t){return PO(this,arguments,void 0,(function*(t,e={}){const{element:n}=this.context;if(!n)return;const r=th(t.map((t=>{return r=n.getElement(t),e.shapes?r.getShape(e.shapes).getRenderBounds():r.getRenderBounds();var r})));yield this.focus(r,e)}))}focus(t,e){return PO(this,void 0,void 0,(function*(){const n=this.context.graph.getViewportByCanvas(t.center),r=ld(e.position||this.getCanvasCenter(),n);yield this.transform({mode:"relative",translate:sd(r,this.paddingOffset)},e.animation)}))}getBBoxInViewport(t){const{min:e,max:n}=t,{graph:r}=this.context,[i,o]=r.getViewportByCanvas(e),[a,s]=r.getViewportByCanvas(n),l=new Wn;return l.setMinMax([i,o,0],[a,s,0]),l}isInViewport(t,e=!1,n=0){const{graph:r}=this.context,i=this.getCanvasSize(),[o,a]=r.getCanvasByViewport([0,0]),[s,l]=r.getCanvasByViewport(i);let c=new Wn;return c.setMinMax([o,a,0],[s,l,0]),n&&(c=$u(c,n)),Wu(t)?eh(t,c):e?function(t,e){const[n,r]=t.min,[i,o]=t.max,[a,s]=e.min,[l,c]=e.max;return n>=a&&i<=l&&r>=s&&o<=c}(t,c):c.intersects(t)}cancelAnimation(){var t,e;(null===(t=this.camera.landmarks)||void 0===t?void 0:t.length)&&this.camera.cancelLandmarkAnimation(),null===(e=this.transformResolver)||void 0===e||e.call(this)}}var DO=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(t){o(t)}}function s(t){try{l(r.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}))};class LO extends Xv{constructor(t){var e;super(),this.options={},this.rendered=!1,this.destroyed=!1,this.context={model:new $C},this.isCollapsingExpanding=!1,this.onResize=Vv((()=>{this.resize()}),300),this._setOptions(Object.assign({},LO.defaultOptions,t),!0),this.context.graph=this,this.options.autoResize&&(null===(e=globalThis.addEventListener)||void 0===e||e.call(globalThis,"resize",this.onResize))}getOptions(){return this.options}setOptions(t){this._setOptions(t,!1)}_setOptions(t,e){if(this.updateCanvas(t),Object.assign(this.options,function(t){return[NO].reduce(((t,e)=>e(t)),t)}(t)),e){const{data:e}=t;return void(e&&this.addData(e))}const{behaviors:n,combo:r,data:i,edge:o,layout:a,node:s,plugins:l,theme:c,transforms:u}=t;n&&this.setBehaviors(n),i&&this.setData(i),s&&this.setNode(s),o&&this.setEdge(o),r&&this.setCombo(r),a&&this.setLayout(a),c&&this.setTheme(c),l&&this.setPlugins(l),u&&this.setTransforms(u)}getSize(){return this.context.canvas?this.context.canvas.getSize():[this.options.width||0,this.options.height||0]}setSize(t,e){t&&(this.options.width=t),e&&(this.options.height=e),this.resize(t,e)}setZoomRange(t){this.options.zoomRange=t}getZoomRange(){return this.options.zoomRange}setNode(t){this.options.node=t,this.context.model.refreshData()}setEdge(t){this.options.edge=t,this.context.model.refreshData()}setCombo(t){this.options.combo=t,this.context.model.refreshData()}getTheme(){return this.options.theme}setTheme(t){this.options.theme=en(t)?t(this.getTheme()):t}setLayout(t){this.options.layout=en(t)?t(this.getLayout()):t}getLayout(){return this.options.layout}setBehaviors(t){var e;this.options.behaviors=en(t)?t(this.getBehaviors()):t,null===(e=this.context.behavior)||void 0===e||e.setBehaviors(this.options.behaviors)}updateBehavior(t){this.setBehaviors((e=>e.map((e=>"object"==typeof e&&e.key===t.key?Object.assign(Object.assign({},e),t):e))))}getBehaviors(){return this.options.behaviors||[]}setPlugins(t){var e;this.options.plugins=en(t)?t(this.getPlugins()):t,null===(e=this.context.plugin)||void 0===e||e.setPlugins(this.options.plugins)}updatePlugin(t){this.setPlugins((e=>e.map((e=>"object"==typeof e&&e.key===t.key?Object.assign(Object.assign({},e),t):e))))}getPlugins(){return this.options.plugins||[]}getPluginInstance(t){return this.context.plugin.getPluginInstance(t)}setTransforms(t){var e;this.options.transforms=en(t)?t(this.getTransforms()):t,null===(e=this.context.transform)||void 0===e||e.setTransforms(this.options.transforms)}updateTransform(t){this.setTransforms((e=>e.map((e=>"object"==typeof e&&e.key===t.key?Object.assign(Object.assign({},e),t):e)))),this.context.model.refreshData()}getTransforms(){return this.options.transforms||[]}getData(){return this.context.model.getData()}hasNode(t){return this.context.model.hasNode(t)}hasEdge(t){return this.context.model.hasEdge(t)}hasCombo(t){return this.context.model.hasCombo(t)}getElementData(t){return Array.isArray(t)?t.map((t=>this.context.model.getElementDataById(t))):this.context.model.getElementDataById(t)}getNodeData(t){return void 0===t?this.context.model.getNodeData():Array.isArray(t)?this.context.model.getNodeData(t):this.context.model.getNodeLikeDatum(t)}getEdgeData(t){return void 0===t?this.context.model.getEdgeData():Array.isArray(t)?this.context.model.getEdgeData(t):this.context.model.getEdgeDatum(t)}getComboData(t){return void 0===t?this.context.model.getComboData():Array.isArray(t)?this.context.model.getComboData(t):this.context.model.getNodeLikeDatum(t)}setData(t){this.context.model.setData(en(t)?t(this.getData()):t)}addData(t){this.context.model.addData(en(t)?t(this.getData()):t)}addNodeData(t){this.context.model.addNodeData(en(t)?t(this.getNodeData()):t)}addEdgeData(t){this.context.model.addEdgeData(en(t)?t(this.getEdgeData()):t)}addComboData(t){this.context.model.addComboData(en(t)?t(this.getComboData()):t)}addChildrenData(t,e){this.context.model.addChildrenData(t,e)}updateData(t){this.context.model.updateData(en(t)?t(this.getData()):t)}updateNodeData(t){this.context.model.updateNodeData(en(t)?t(this.getNodeData()):t)}updateEdgeData(t){this.context.model.updateEdgeData(en(t)?t(this.getEdgeData()):t)}updateComboData(t){this.context.model.updateComboData(en(t)?t(this.getComboData()):t)}removeData(t){this.context.model.removeData(en(t)?t(this.getData()):t)}removeNodeData(t){this.context.model.removeNodeData(en(t)?t(this.getNodeData()):t)}removeEdgeData(t){this.context.model.removeEdgeData(en(t)?t(this.getEdgeData()):t)}removeComboData(t){this.context.model.removeComboData(en(t)?t(this.getComboData()):t)}getElementType(t){return this.context.model.getElementType(t)}getRelatedEdgesData(t,e="both"){return this.context.model.getRelatedEdgesData(t,e)}getNeighborNodesData(t){return this.context.model.getNeighborNodesData(t)}getAncestorsData(t,e){return this.context.model.getAncestorsData(t,e)}getParentData(t,e){return this.context.model.getParentData(t,e)}getChildrenData(t){return this.context.model.getChildrenData(t)}getDescendantsData(t){return this.context.model.getDescendantsData(t)}getElementDataByState(t,e){return this.context.model.getElementDataByState(t,e)}initCanvas(){return DO(this,void 0,void 0,(function*(){var t;if(this.context.canvas)return yield this.context.canvas.ready;const{container:e="container",width:n,height:r,renderer:i,cursor:o,background:a,canvas:s,devicePixelRatio:l=(null!==(t=globalThis.devicePixelRatio)&&void 0!==t?t:1)}=this.options;if(e instanceof CC)this.context.canvas=e,o&&e.setCursor(o),i&&e.setRenderer(i),yield e.ready;else{const t=se(e)?document.getElementById(e):e,c=RC(t);this.emit(pu.BEFORE_CANVAS_INIT,{container:t,width:n,height:r});const u=Object.assign(Object.assign({},s),{container:t,width:n||c[0],height:r||c[1],background:a,renderer:i,cursor:o,devicePixelRatio:l}),h=new CC(u);this.context.canvas=h,yield h.ready,this.emit(pu.AFTER_CANVAS_INIT,{canvas:h})}}))}updateCanvas(t){var e,n;const{renderer:r,cursor:i,height:o,width:a}=t,s=this.context.canvas;s&&(r&&(this.emit(pu.BEFORE_RENDERER_CHANGE,{renderer:this.options.renderer}),s.setRenderer(r),this.emit(pu.AFTER_RENDERER_CHANGE,{renderer:r})),i&&s.setCursor(i),(ie(a)||ie(o))&&this.setSize(null!==(e=null!=a?a:this.options.width)&&void 0!==e?e:0,null!==(n=null!=o?o:this.options.height)&&void 0!==n?n:0))}initRuntime(){this.context.options=this.options,this.context.batch||(this.context.batch=new WC(this.context)),this.context.plugin||(this.context.plugin=new CO(this.context)),this.context.viewport||(this.context.viewport=new RO(this.context)),this.context.transform||(this.context.transform=new TO(this.context)),this.context.element||(this.context.element=new eO(this.context)),this.context.animation||(this.context.animation=new VC(this.context)),this.context.layout||(this.context.layout=new SO(this.context)),this.context.behavior||(this.context.behavior=new HC(this.context))}prepare(){return DO(this,void 0,void 0,(function*(){yield Promise.resolve(),this.destroyed?console.error(wu("The graph instance has been destroyed")):(yield this.initCanvas(),this.initRuntime())}))}render(){return DO(this,void 0,void 0,(function*(){if(yield this.prepare(),zC(this,new LC(pu.BEFORE_RENDER)),this.options.layout)if(this.rendered||(t=this.options.layout,Array.isArray(t)||!(null==t?void 0:t.preLayout))){const t=this.context.element.draw({type:"render"});yield Promise.all([null==t?void 0:t.finished,this.context.layout.postLayout()]),yield this.autoFit()}else{const t=yield this.context.element.preLayoutDraw({type:"render"});yield Promise.all([null==t?void 0:t.finished,this.autoFit()])}else{const t=this.context.element.draw({type:"render"});yield Promise.all([null==t?void 0:t.finished,this.autoFit()])}var t;this.rendered=!0,zC(this,new LC(pu.AFTER_RENDER))}))}draw(){return DO(this,void 0,void 0,(function*(){var t;yield this.prepare(),yield null===(t=this.context.element.draw())||void 0===t?void 0:t.finished}))}layout(t){return DO(this,void 0,void 0,(function*(){yield this.context.layout.postLayout(t)}))}stopLayout(){this.context.layout.stopLayout()}clear(){return DO(this,void 0,void 0,(function*(){const{model:t,element:e}=this.context;t.setData({}),t.clearChanges(),null==e||e.clear()}))}destroy(){var t;zC(this,new LC(pu.BEFORE_DESTROY));const{layout:e,animation:n,element:r,model:i,canvas:o,behavior:a,plugin:s}=this.context;null==s||s.destroy(),null==a||a.destroy(),null==e||e.destroy(),null==n||n.destroy(),null==r||r.destroy(),i.destroy(),null==o||o.destroy(),this.options={},this.context={},this.off(),null===(t=globalThis.removeEventListener)||void 0===t||t.call(globalThis,"resize",this.onResize),this.destroyed=!0,zC(this,new LC(pu.AFTER_DESTROY))}getCanvas(){return this.context.canvas}resize(t,e){var n;const r=RC(null===(n=this.context.canvas)||void 0===n?void 0:n.getContainer()),i=[t||r[0],e||r[1]];if(!this.context.canvas)return;const o=this.context.canvas.getSize();iu(i,o)||(zC(this,new LC(pu.BEFORE_SIZE_CHANGE,{size:i})),this.context.canvas.resize(...i),zC(this,new LC(pu.AFTER_SIZE_CHANGE,{size:i})))}fitView(t,e){return DO(this,void 0,void 0,(function*(){var n;yield null===(n=this.context.viewport)||void 0===n?void 0:n.fitView(t,e)}))}fitCenter(t){return DO(this,void 0,void 0,(function*(){var e;yield null===(e=this.context.viewport)||void 0===e?void 0:e.fitCenter({animation:t})}))}autoFit(){return DO(this,void 0,void 0,(function*(){const{autoFit:t}=this.context.options;if(t)if(se(t))"view"===t?yield this.fitView():"center"===t&&(yield this.fitCenter());else{const{type:e,animation:n}=t;"view"===e?yield this.fitView(t.options,n):"center"===e&&(yield this.fitCenter(n))}}))}focusElement(t,e){return DO(this,void 0,void 0,(function*(){var n;yield null===(n=this.context.viewport)||void 0===n?void 0:n.focusElements(Array.isArray(t)?t:[t],{animation:e})}))}zoomBy(t,e,n){return DO(this,void 0,void 0,(function*(){yield this.context.viewport.transform({mode:"relative",scale:t,origin:n},e)}))}zoomTo(t,e,n){return DO(this,void 0,void 0,(function*(){yield this.context.viewport.transform({mode:"absolute",scale:t,origin:n},e)}))}getZoom(){return this.context.viewport.getZoom()}rotateBy(t,e,n){return DO(this,void 0,void 0,(function*(){yield this.context.viewport.transform({mode:"relative",rotate:t,origin:n},e)}))}rotateTo(t,e,n){return DO(this,void 0,void 0,(function*(){yield this.context.viewport.transform({mode:"absolute",rotate:t,origin:n},e)}))}getRotation(){return this.context.viewport.getRotation()}translateBy(t,e){return DO(this,void 0,void 0,(function*(){yield this.context.viewport.transform({mode:"relative",translate:t},e)}))}translateTo(t,e){return DO(this,void 0,void 0,(function*(){yield this.context.viewport.transform({mode:"absolute",translate:t},e)}))}getPosition(){return ld([0,0],this.getCanvasByViewport([0,0]))}translateElementBy(t,e){return DO(this,arguments,void 0,(function*(t,e,n=!0){var r,i;const[o,a]=nn(t)?[t,null===(r=e)||void 0===r||r]:[{[t]:e},n];Object.entries(o).forEach((([t,e])=>this.context.model.translateNodeLikeBy(t,e))),yield null===(i=this.context.element.draw({animation:a,stage:"translate"}))||void 0===i?void 0:i.finished}))}translateElementTo(t,e){return DO(this,arguments,void 0,(function*(t,e,n=!0){var r,i;const[o,a]=nn(t)?[t,null===(r=e)||void 0===r||r]:[{[t]:e},n];Object.entries(o).forEach((([t,e])=>this.context.model.translateNodeLikeTo(t,e))),yield null===(i=this.context.element.draw({animation:a,stage:"translate"}))||void 0===i?void 0:i.finished}))}getElementPosition(t){return this.context.model.getElementPosition(t)}getElementRenderStyle(t){return cE(this.context.element.getElement(t).attributes,["context"])}setElementVisibility(t,e){return DO(this,arguments,void 0,(function*(t,e,n=!0){var r,i;const[o,a]=nn(t)?[t,null===(r=e)||void 0===r||r]:[{[t]:e},n],s={nodes:[],edges:[],combos:[]};Object.entries(o).forEach((([t,e])=>{const n=this.getElementType(t);s[`${n}s`].push({id:t,style:{visibility:e}})}));const{model:l,element:c}=this.context;l.preventUpdateNodeLikeHierarchy((()=>{l.updateData(s)})),yield null===(i=c.draw({animation:a,stage:"visibility"}))||void 0===i?void 0:i.finished}))}showElement(t,e){return DO(this,void 0,void 0,(function*(){const n=Array.isArray(t)?t:[t];yield this.setElementVisibility(Object.fromEntries(n.map((t=>[t,"visible"]))),e)}))}hideElement(t,e){return DO(this,void 0,void 0,(function*(){const n=Array.isArray(t)?t:[t];yield this.setElementVisibility(Object.fromEntries(n.map((t=>[t,"hidden"]))),e)}))}getElementVisibility(t){var e,n;const r=this.context.element.getElement(t);return null!==(n=null===(e=null==r?void 0:r.style)||void 0===e?void 0:e.visibility)&&void 0!==n?n:"visible"}setElementZIndex(t,e){return DO(this,void 0,void 0,(function*(){var n;const r={nodes:[],edges:[],combos:[]},i=nn(t)?t:{[t]:e};Object.entries(i).forEach((([t,e])=>{const n=this.getElementType(t);r[`${n}s`].push({id:t,style:{zIndex:e}})}));const{model:o,element:a}=this.context;o.preventUpdateNodeLikeHierarchy((()=>o.updateData(r))),yield null===(n=a.draw({animation:!1,stage:"zIndex"}))||void 0===n?void 0:n.finished}))}frontElement(t){return DO(this,void 0,void 0,(function*(){const e=Array.isArray(t)?t:[t],{model:n}=this.context,r={};e.map((t=>{const e=n.getFrontZIndex(t);if("combo"===n.getElementType(t)){const i=n.getAncestorsData(t,mu).at(-1)||this.getComboData(t),o=[i,...n.getDescendantsData(Fh(i))],a=e-FC(i);o.forEach((t=>{r[Fh(t)]=this.getElementZIndex(Fh(t))+a}));const{internal:s}=Ug(o.map(Fh),(t=>n.getRelatedEdgesData(t)));s.forEach((t=>{const e=Fh(t);r[e]=this.getElementZIndex(e)+a}))}else r[t]=e})),yield this.setElementZIndex(r)}))}getElementZIndex(t){return FC(this.context.model.getElementDataById(t))}setElementState(t,e){return DO(this,arguments,void 0,(function*(t,e,n=!0){var r,i;const[o,a]=nn(t)?[t,null===(r=e)||void 0===r||r]:[{[t]:e},n],s={nodes:[],edges:[],combos:[]};Object.entries(o).forEach((([t,e])=>{const n=this.getElementType(t);var r;s[`${n}s`].push({id:t,states:(r=e,r?Array.isArray(r)?r:[r]:[])})})),this.updateData(s),yield null===(i=this.context.element.draw({animation:a,stage:"state"}))||void 0===i?void 0:i.finished}))}getElementState(t){return this.context.model.getElementState(t)}getElementRenderBounds(t){return this.context.element.getElement(t).getRenderBounds()}collapseElement(t){return DO(this,arguments,void 0,(function*(t,e=!0){const{model:n,element:r}=this.context;if(ef(n.getNodeLikeData([t])[0]))return;if(this.isCollapsingExpanding)return;"boolean"==typeof e&&(e={animation:e,align:!0});const i=n.getElementType(t);yield this.frontElement(t),this.isCollapsingExpanding=!0,n.updateData("node"===i?{nodes:[{id:t,style:{collapsed:!0}}]}:{combos:[{id:t,style:{collapsed:!0}}]}),"node"===i?yield r.collapseNode(t,e):"combo"===i&&(yield r.collapseCombo(t,!!e.animation)),this.isCollapsingExpanding=!1}))}expandElement(t){return DO(this,arguments,void 0,(function*(t,e=!0){const{model:n,element:r}=this.context;if(!ef(n.getNodeLikeData([t])[0]))return;if(this.isCollapsingExpanding)return;"boolean"==typeof e&&(e={animation:e,align:!0});const i=n.getElementType(t);this.isCollapsingExpanding=!0,n.updateData("node"===i?{nodes:[{id:t,style:{collapsed:!1}}]}:{combos:[{id:t,style:{collapsed:!1}}]}),"node"===i?yield r.expandNode(t,e):"combo"===i&&(yield r.expandCombo(t,!!e.animation)),this.isCollapsingExpanding=!1}))}setElementCollapsibility(t,e){const n=this.getElementType(t);"node"===n?this.updateNodeData([{id:t,style:{collapsed:e}}]):"combo"===n&&this.updateComboData([{id:t,style:{collapsed:e}}])}toDataURL(){return DO(this,arguments,void 0,(function*(t={}){return this.context.canvas.toDataURL(t)}))}getCanvasByViewport(t){return this.context.canvas.getCanvasByViewport(t)}getViewportByCanvas(t){return this.context.canvas.getViewportByCanvas(t)}getClientByCanvas(t){return this.context.canvas.getClientByCanvas(t)}getCanvasByClient(t){return this.context.canvas.getCanvasByClient(t)}getViewportCenter(){return this.context.viewport.getViewportCenter()}getCanvasCenter(){return this.context.viewport.getCanvasCenter()}on(t,e,n){return super.on(t,e,n)}once(t,e){return super.once(t,e)}off(t,e){return super.off(t,e)}}LO.defaultOptions={autoResize:!1,theme:"light",rotation:0,zoom:1,zoomRange:[.01,10]};var IO=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n};function BO(t,e){const{getNodeData:n=((t,e)=>{if(t.depth=e,!t.children)return t;const{children:n}=t,r=IO(t,["children"]);return Object.assign(Object.assign({},r),{children:n.map((t=>t.id))})}),getEdgeData:r=((t,e)=>({source:t.id,target:e.id})),getChildren:i=(t=>t.children||[])}=e||{},o=[],a=[];return Xd(t,((t,e)=>{o.push(n(t,e));const s=i(t);for(const e of s)a.push(r(t,e))}),(t=>i(t)),"TB"),{nodes:o,edges:a}}const jO=(t,e)=>{const{source:n,target:r}=e,i=t.getElementDataById(n),o=t.getElementDataById(r),a=Yg(i,(e=>t.getParentData(e,mu))),s=Yg(o,(e=>t.getParentData(e,mu))),l={sourceNode:Fh(a),targetNode:Fh(s)};return e.style?Object.assign(e.style,l):e.style=l,e};class zO extends yC{constructor(t,e){super(t,od({},zO.defaultOptions,e)),this.assignSizeByCentrality=(t,e,n,r,i,o)=>{const a=[e,n],s=[r[0],i[0]],l=[r[1],i[1]],c=[r[2],i[2]],u=(t,e)=>{if("function"==typeof o)return o(t,a,e);switch(o){case"linear":return((t,e,n)=>{const[r,i]=e,[o,a]=n;return i===r?o:o+(t-r)/(i-r)*(a-o)})(t,a,e);case"log":return((t,e,n)=>{const[r,i]=e,[o,a]=n;return o+Math.log(t-r+1)/Math.log(i-r+1)*(a-o)})(t,a,e);case"pow":return((t,e,n,r=2)=>{const[i,o]=e,[a,s]=n;return a+Math.pow((t-i)/(o-i),r)*(s-a)})(t,a,e,2);case"sqrt":return((t,e,n)=>{const[r,i]=e,[o,a]=n;return o+Math.sqrt((t-r)/(i-r))*(a-o)})(t,a,e);default:return e[0]}};return[u(t,s),u(t,l),u(t,c)]}}beforeDraw(t){const{model:e}=this.context,n=e.getNodeData(),r=df(this.options.maxSize),i=df(this.options.minSize),o=this.getCentralities(this.options.centrality),a=o.size>0?Math.max(...o.values()):0,s=o.size>0?Math.min(...o.values()):0;return n.forEach((e=>{var n;const l=this.assignSizeByCentrality(o.get(Fh(e))||0,s,a,i,r,this.options.scale),c=null===(n=this.context.element)||void 0===n?void 0:n.getElement(Fh(e)),u={size:l};this.assignLabelStyle(u,l,e,c),c&&xC(u,c.attributes)||bC(t,c?"update":"add","node",od(e,{style:u}),!0)})),t}assignLabelStyle(t,e,n,r){var i;const o=r?r.config.style:null===(i=this.context.element)||void 0===i?void 0:i.getElementComputedStyle("node",n);if(Object.assign(t,gg(o,["labelFontSize","labelLineHeight"])),this.options.mapLabelSize){const n=this.getLabelSizeByNodeSize(e,1/0,Number(t.labelFontSize));Object.assign(t,{labelFontSize:n,labelLineHeight:n+Yu(t.labelPadding)})}return t}getLabelSizeByNodeSize(t,e,n){const r=Math.min(...t)/2,[i,o]=Array.isArray(this.options.mapLabelSize)?this.options.mapLabelSize:[n,e];return Math.min(o,Math.max(r,i))}getCentralities(t){const{model:e}=this.context,n=e.getData();if("function"==typeof t)return t(n);const r=e.getRelatedEdgesData.bind(e);return Gh(n,r,t)}}zO.defaultOptions={centrality:{type:"degree"},maxSize:80,minSize:20,scale:"linear",mapLabelSize:!1};class FO extends yC{constructor(t,e){super(t,Object.assign({},FO.defaultOptions,e))}get ref(){return this.context.model.getRootsData()[0]}afterLayout(){var t;const e=Sd(this.ref),{graph:n,model:r}=this.context;null===(t=r.getData().nodes)||void 0===t||t.forEach((t=>{var i;if(Fh(t)===Fh(this.ref))return;const o=xd(ld(Sd(t),e)),a=Math.abs(o)>Math.PI/2,s=!t.children||0===t.children.length,l=Fh(t),c=null===(i=this.context.element)||void 0===i?void 0:i.getElement(l);if(!c||!c.isVisible())return;const u=(s?1:-1)*(df(n.getElementRenderStyle(l).size)[0]/2+this.options.offset),h=[["translate",u*Math.cos(o),u*Math.sin(o)],["rotate",a?ir(o)+180:ir(o)]];r.updateNodeData([{id:Fh(t),style:{labelTextAlign:a===s?"right":"left",labelTextBaseline:"middle",labelTransform:h}}])})),n.draw()}}FO.defaultOptions={offset:5};const _O=["top","top-right","right","right-bottom","bottom","bottom-left","left","left-top"];class ZO extends yC{constructor(t,e){super(t,Object.assign({},ZO.defaultOptions,e)),this.cacheMergeStyle=new Map,this.getAffectedParallelEdges=t=>{const{add:{edges:e},update:{nodes:n,edges:r,combos:i},remove:{edges:o}}=t,{model:a}=this.context,s=new Map,l=(t,e)=>{a.getRelatedEdgesData(e).forEach((t=>!s.has(Fh(t))&&s.set(Fh(t),t)))};n.forEach(l),i.forEach(l);const c=e=>{const n=new Set(t.remove.edges.keys()),r=a.getEdgeData().filter((t=>!n.has(Fh(t)))).map((t=>jO(a,t)));VO(e,r,!0).forEach((t=>{const e=Fh(t);s.has(e)||s.set(e,t)}))};if(o.size&&o.forEach(c),e.size&&e.forEach(c),r.size){const t=yw(mw(a.getChanges())).update.edges;r.forEach((e=>{var n;c(e);const r=null===(n=t.find((t=>Fh(t.value)===Fh(e))))||void 0===n?void 0:n.original;r&&!WO(e,r)&&c(r)}))}Sf(this.options.edges)||s.forEach(((t,e)=>!this.options.edges.includes(e)&&s.delete(e)));const u=a.getEdgeData().map(Fh);return new Map([...s].sort(((t,e)=>u.indexOf(t[0])-u.indexOf(e[0]))))},this.applyBundlingStyle=(t,e,n)=>{const{edgeMap:r,reverses:i}=GO(e);r.forEach((e=>{e.forEach(((e,r,o)=>{var a;const s=o.length,l=e.style||{};if(e.source===e.target){const t=_O.length;l.loopPlacement=_O[r%t],l.loopDist=Math.floor(r/t)*n+50}else if(1===s)l.curveOffset=0;else{const t=(r%2==0?1:-1)*(i[`${e.source}|${e.target}|${r}`]?-1:1);l.curveOffset=s%2==1?t*Math.ceil(r/2)*n*2:t*(Math.floor(r/2)*n*2+n)}const c=Object.assign(e,{type:"quadratic",style:l}),u=null===(a=this.context.element)||void 0===a?void 0:a.getElement(Fh(e));u&&xC(c.style,u.attributes)||bC(t,u?"update":"add","edge",c,!0)}))}))},this.resetEdgeStyle=t=>{const e=t.style||{},n=this.cacheMergeStyle.get(Fh(t))||{};return Object.keys(n).forEach((r=>{iu(e[r],n[r])&&(t[r]?e[r]=t[r]:delete e[r])})),Object.assign(t,{style:e})},this.applyMergingStyle=(t,e)=>{const{edgeMap:n,reverses:r}=GO(e);n.forEach((e=>{var n;if(1===e.length){const r=e[0],i=null===(n=this.context.element)||void 0===n?void 0:n.getElement(Fh(r)),o=this.resetEdgeStyle(r);return void(i&&xC(o,i.attributes)||bC(t,i?"update":"add","edge",o))}const i=e.map((({source:t,target:e,style:n={}},i)=>{const{startArrow:o,endArrow:a}=n,s={},[l,c]=r[`${t}|${e}|${i}`]?["endArrow","startArrow"]:["startArrow","endArrow"];return tn(o)&&(s[l]=o),tn(a)&&(s[c]=a),s})).reduce(((t,e)=>Object.assign(Object.assign({},t),e)),{});e.forEach(((e,n,r)=>{var o;if(0!==n)return void bC(t,"remove","edge",e);const a=Object.assign({},en(this.options.style)?this.options.style(r):this.options.style,{childrenData:r});this.cacheMergeStyle.set(Fh(e),a);const s=Object.assign(Object.assign({},e),{type:"line",style:Object.assign(Object.assign(Object.assign({},e.style),i),a)}),l=null===(o=this.context.element)||void 0===o?void 0:o.getElement(Fh(e));l&&xC(s.style,l.attributes)||bC(t,l?"update":"add","edge",s,!0)}))}))}}beforeDraw(t){const e=this.getAffectedParallelEdges(t);return 0===e.size||("bundle"===this.options.mode?this.applyBundlingStyle(t,e,this.options.distance):this.applyMergingStyle(t,e)),t}}ZO.defaultOptions={mode:"bundle",distance:15};const GO=t=>{const e=new Map,n=new Set,r={},i=new Map;for(const[o,a]of t){if(n.has(o))continue;const{source:s,target:l}=a,c=`${s}-${l}`;e.has(c)||(e.set(c,[]),i.set(c,new Set));const u=e.get(c),h=i.get(c);u&&h&&!h.has(o)&&(u.push(a),h.add(o),n.add(o));for(const[u,h]of t)if(!n.has(u)&&u!==o&&WO(a,h)){const t=e.get(c),o=i.get(c);t&&o&&!o.has(u)&&(t.push(h),o.add(u),s===h.target&&l===h.source&&(r[`${h.source}|${h.target}|${t.length-1}`]=!0),n.add(u))}}return{edgeMap:e,reverses:r}},VO=(t,e,n)=>e.filter((e=>(n||Fh(e)!==Fh(t))&&WO(e,t))),WO=(t,e)=>{const{sourceNode:n,targetNode:r}=t.style||{},{sourceNode:i,targetNode:o}=e.style||{};return n===i&&r===o||n===o&&r===i};const HO={animation:{"combo-collapse":ju,"combo-expand":zu,"node-collapse":Du,"node-expand":Lu,"path-in":Iu,"path-out":Bu,fade:[{fields:["opacity"]}],translate:[{fields:["x","y"]}]},behavior:{"brush-select":Hd,"click-select":tf,"collapse-expand":zv,"create-edge":Gv,"drag-canvas":Hv,"drag-element-force":class extends Yv{get forceLayoutInstance(){return this.context.layout.getLayoutInstance().find((t=>["d3-force","d3-force-3d"].includes(null==t?void 0:t.id)))}validate(t){return!!this.context.layout&&(this.forceLayoutInstance?super.validate(t):(ku.warn("DragElementForce only works with d3-force or d3-force-3d layout"),!1))}moveElement(t,e){return sm(this,void 0,void 0,(function*(){const n=this.forceLayoutInstance;this.context.graph.getNodeData(t).forEach(((r,i)=>{const{x:o=0,y:a=0}=r.style||{};n&&om(n,"setFixedPosition",t[i],[...sd([+o,+a],this.clampByRotation(e))])}))}))}onDragStart(t){if(this.enable=this.validate(t),!this.enable)return;this.target=this.getSelectedNodeIDs([t.target.id]),this.hideEdge(),this.context.graph.frontElement(this.target);const e=this.forceLayoutInstance;e&&am(e,"simulation").alphaTarget(.3).restart(),this.context.graph.getNodeData(this.target).forEach((t=>{const{x:n=0,y:r=0}=t.style||{};e&&om(e,"setFixedPosition",Fh(t),[+n,+r])}))}onDrag(t){if(!this.enable)return;const e=this.getDelta(t);this.moveElement(this.target,e)}onDragEnd(){const t=this.forceLayoutInstance;t&&am(t,"simulation").alphaTarget(0),this.options.fixed||this.context.graph.getNodeData(this.target).forEach((e=>{t&&om(t,"setFixedPosition",Fh(e),[null,null,null])}))}},"drag-element":Yv,"fix-element-size":cm,"focus-element":hm,"hover-activate":dm,"lasso-select":class extends Hd{onPointerDown(t){if(!super.validate(t)||!super.isKeydown()||this.points)return;const{canvas:e,graph:n}=this.context;this.pathShape=new Dl({id:"g6-lasso-select",style:this.options.style}),e.appendChild(this.pathShape),this.points=[Ud(t,n)]}onPointerMove(t){var e;if(!this.points)return;const{immediately:n,mode:r}=this.options;this.points.push(Ud(t,this.context.graph)),null===(e=this.pathShape)||void 0===e||e.setAttribute("d",function(t,e=!0){const n=[];return t.forEach(((t,e)=>{n.push([0===e?"M":"L",...t])})),e&&n.push(["Z"]),n}(this.points)),n&&"default"===r&&this.points.length>2&&super.updateElementsStates(this.points)}onPointerUp(){this.points&&(this.points.length<2||super.updateElementsStates(this.points),this.clearLasso())}clearLasso(){var t;null===(t=this.pathShape)||void 0===t||t.remove(),this.pathShape=void 0,this.points=void 0}},"auto-adapt-label":ed,"optimize-viewport-transform":fm,"scroll-canvas":gm,"zoom-canvas":mm},combo:{circle:class extends wg{constructor(t){super(t)}drawKeyShape(t,e){return this.upsert("key",wl,this.getKeyStyle(t),e)}getKeyStyle(t){const{collapsed:e}=t,n=super.getKeyStyle(t),[r]=this.getKeySize(t);return Object.assign(Object.assign(Object.assign({},n),e&&cf(n,"collapsed")),{r:r/2})}getCollapsedKeySize(t){const[e,n]=df(t.collapsedSize),r=Math.max(e,n)/2;return[2*r,2*r,0]}getExpandedKeySize(t){const e=this.getContentBBox(t),[n,r]=Ku(e),i=Math.sqrt(Math.pow(n,2)+Math.pow(r,2))/2;return[2*i,2*i,0]}getIntersectPoint(t,e=!1){return jd(t,this.getShape("key").getBounds(),e)}},rect:class extends wg{constructor(t){super(t)}drawKeyShape(t,e){return this.upsert("key",zl,this.getKeyStyle(t),e)}getKeyStyle(t){const e=super.getKeyStyle(t),[n,r]=this.getKeySize(t);return Object.assign(Object.assign(Object.assign({},e),t.collapsed&&cf(e,"collapsed")),{width:n,height:r,x:-n/2,y:-r/2})}}},edge:{cubic:rv,line:sv,polyline:yv,quadratic:bv,"cubic-horizontal":iv,"cubic-radial":ov,"cubic-vertical":av},layout:{"antv-dagre":class{constructor(t={}){this.options=t,this.id="antv-dagre",this.options=Object.assign(Object.assign({},Mb),t)}execute(t,e){return(0,ce.mG)(this,void 0,void 0,(function*(){return this.genericDagreLayout(!1,t,e)}))}assign(t,e){return(0,ce.mG)(this,void 0,void 0,(function*(){yield this.genericDagreLayout(!0,t,e)}))}genericDagreLayout(t,e,n){return(0,ce.mG)(this,void 0,void 0,(function*(){const r=Object.assign(Object.assign({},this.options),n),{nodeSize:i,align:o,rankdir:a="TB",ranksep:s,nodesep:l,ranksepFunc:c,nodesepFunc:u,edgeLabelSpace:h,ranker:d,nodeOrder:f,begin:p,controlPoints:g,radial:v,sortByCombo:m,preset:y}=r,b=new tm({tree:[]}),x=bb(s||50,c),E=bb(l||50,u);let w=E,k=x;"LR"!==a&&"RL"!==a||(w=x,k=E);const M=xb(10,i,!1),S=e.getAllNodes(),A=e.getAllEdges();let N;S.forEach((t=>{const e=yb(M(t)),n=k(t),r=w(t),i=e[0]+2*r,o=e[1]+2*n,a=t.data.layer;ie(a)?b.addNode({id:t.id,data:{width:i,height:o,layer:a}}):b.addNode({id:t.id,data:{width:i,height:o}})})),m&&(b.attachTreeStructure("combo"),S.forEach((t=>{const{parentId:e}=t.data;void 0!==e&&b.hasNode(e)&&b.setParent(t.id,e,"combo")}))),A.forEach((t=>{b.addEdge({id:t.id,source:t.source,target:t.target,data:{weight:t.data.weight||1}})})),(null==y?void 0:y.length)&&(N=new tm({nodes:y})),((t,e)=>{const{edgeLabelSpace:n,keepNodeOrder:r,prevGraph:i,rankdir:o,ranksep:a}=e;!r&&i&&Ky(t,i);const s=rb(t);let l;n&&(e.ranksep=ib(s,{rankdir:o,ranksep:a}));try{l=Xy(s,e)}catch(t){if("Not possible to find intersection inside of the rectangle"===t.message)return void console.error("The following error may be caused by improper layer setting, please make sure your manual layer setting does not violate the graph's structure:\n",t);throw t}Qy(t,s)})(b,{prevGraph:N,edgeLabelSpace:h,keepNodeOrder:!!f,nodeOrder:f||[],acyclicer:"greedy",ranker:d,rankdir:a,nodesep:l,align:o});const C=[0,0];if(p){let t=1/0,e=1/0;b.getAllNodes().forEach((n=>{t>n.data.x&&(t=n.data.x),e>n.data.y&&(e=n.data.y)})),b.getAllEdges().forEach((n=>{var r;null===(r=n.data.points)||void 0===r||r.forEach((n=>{t>n.x&&(t=n.x),e>n.y&&(e=n.y)}))})),C[0]=p[0]-t,C[1]=p[1]-e}const O="LR"===a||"RL"===a;if(v);else{const t=new Set,e="BT"===a||"RL"===a?(t,e)=>e-t:(t,e)=>t-e;b.getAllNodes().forEach((e=>{e.data.x=e.data.x+C[0],e.data.y=e.data.y+C[1],t.add(O?e.data.x:e.data.y)}));const n=Array.from(t).sort(e),r=O?(t,e)=>t.x!==e.x:(t,e)=>t.y!==e.y,i=O?(t,e,n)=>{const r=Math.max(e.y,n.y),i=Math.min(e.y,n.y);return t.filter((t=>t.y<=r&&t.y>=i))}:(t,e,n)=>{const r=Math.max(e.x,n.x),i=Math.min(e.x,n.x);return t.filter((t=>t.x<=r&&t.x>=i))};b.getAllEdges().forEach(((t,e)=>{var o;h&&g&&"loop"!==t.data.type&&(t.data.controlPoints=Sb(null===(o=t.data.points)||void 0===o?void 0:o.map((({x:t,y:e})=>({x:t+C[0],y:e+C[1]}))),b.getNode(t.source),b.getNode(t.target),n,O,r,i))}))}let T=[];T=b.getAllNodes().map((t=>kb(t)));const P=b.getAllEdges();t&&(T.forEach((t=>{e.mergeNodeData(t.id,{x:t.data.x,y:t.data.y})})),P.forEach((t=>{e.mergeEdgeData(t.id,{controlPoints:t.data.controlPoints})})));return{nodes:T,edges:P}}))}},"combo-combined":class{constructor(t={}){this.options=t,this.id="comboCombined",this.options=Object.assign(Object.assign({},ix),t)}execute(t,e){return(0,ce.mG)(this,void 0,void 0,(function*(){return this.genericComboCombinedLayout(!1,t,e)}))}assign(t,e){return(0,ce.mG)(this,void 0,void 0,(function*(){yield this.genericComboCombinedLayout(!0,t,e)}))}genericComboCombinedLayout(t,e,n){return(0,ce.mG)(this,void 0,void 0,(function*(){const r=this.initVals(Object.assign(Object.assign({},this.options),n)),{center:i,treeKey:o,outerLayout:a}=r,s=e.getAllNodes().filter((t=>!t.data._isCombo)),l=e.getAllNodes().filter((t=>t.data._isCombo)),c=e.getAllEdges(),u=null==s?void 0:s.length;if(!u||1===u)return Ab(e,t,i);const h=[],d=new Map;s.forEach((t=>{d.set(t.id,t)}));const f=new Map;l.forEach((t=>{f.set(t.id,t)}));const p=new Map,g=this.getInnerGraphs(e,o,d,f,c,r,p);yield Promise.all(g);const v=new Map,m=[],y=new Map;let b=!0;e.getRoots(o).forEach((t=>{const n=p.get(t.id),r=f.get(t.id)||d.get(t.id),i={id:t.id,data:Object.assign(Object.assign({},t.data),{x:n.data.x||r.data.x,y:n.data.y||r.data.y,fx:n.data.fx||r.data.fx,fy:n.data.fy||r.data.fy,mass:n.data.mass||r.data.mass,size:n.data.size})};m.push(i),v.set(t.id,!0),isNaN(i.data.x)||0===i.data.x||isNaN(i.data.y)||0===i.data.y?(i.data.x=100*Math.random(),i.data.y=100*Math.random()):b=!1,Qb(e,[t],(e=>{e.id!==t.id&&y.set(e.id,t.id)}),"TB",o)}));const x=[];let E;if(c.forEach((t=>{const e=y.get(t.source)||t.source,n=y.get(t.target)||t.target;e!==n&&v.has(e)&&v.has(n)&&x.push({id:t.id,source:e,target:n,data:{}})})),null==m?void 0:m.length){if(1===m.length)m[0].data.x=i[0],m[0].data.y=i[1];else{const t=new tm({nodes:m,edges:x}),e=a||new Fb;if(b&&rx[e.id]){const e=m.length<100?new $b:new Rb;yield e.assign(t)}const n=Object.assign({center:i,kg:5,preventOverlap:!0,animate:!1},"force"===e.id?{gravity:1,factor:4,linkDistance:(t,e,n)=>(Math.max(...e.data.size)||32)/2+(Math.max(...n.data.size)||32)/2+200}:{});E=yield ox(e,t,n)}p.forEach((t=>{var e;const n=E.nodes.find((e=>e.id===t.id));if(n){const{x:e,y:r}=n.data;t.data.visited=!0,t.data.x=e,t.data.y=r,h.push({id:t.id,data:{x:e,y:r}})}const{x:r,y:i}=t.data;null===(e=t.data.nodes)||void 0===e||e.forEach((t=>{h.push({id:t.id,data:{x:t.data.x+r,y:t.data.y+i}})}))})),p.forEach((({data:t})=>{const{x:e,y:n,visited:r,nodes:i}=t;null==i||i.forEach((t=>{if(!r){const r=h.find((e=>e.id===t.id));r.data.x+=e||0,r.data.y+=n||0}}))}))}t&&h.forEach((t=>{e.mergeNodeData(t.id,{x:t.data.x,y:t.data.y})}));return{nodes:h,edges:c}}))}initVals(t){const e=Object.assign({},t),{nodeSize:n,spacing:r,comboPadding:i}=t;let o,a,s;if(a=ie(r)?()=>r:en(r)?r:()=>0,e.spacing=a,n)if(en(n))o=t=>{const e=n(t),r=a(t);if(Tb(t.size)){return((t.size[0]>t.size[1]?t.size[0]:t.size[1])+r)/2}return((e||32)+r)/2};else if(Tb(n)){const t=(n[0]>n[1]?n[0]:n[1])/2;o=e=>t+a(e)/2}else{const t=n/2;o=e=>t+a(e)/2}else o=t=>{const e=a(t);if(t.size){if(Tb(t.size)){return((t.size[0]>t.size[1]?t.size[0]:t.size[1])+e)/2}if(nn(t.size)){return((t.size.width>t.size.height?t.size.width:t.size.height)+e)/2}return(t.size+e)/2}return 32+e/2};return e.nodeSize=o,s=ie(i)?()=>i:Tb(i)?()=>Math.max.apply(null,i):en(i)?i:()=>0,e.comboPadding=s,e}getInnerGraphs(t,e,n,r,i,o,a){const{nodeSize:s,comboPadding:l,spacing:c,innerLayout:u}=o,h=u||new Rb({}),d={center:[0,0],preventOverlap:!0,nodeSpacing:c},f=[],p=t=>{let e=(null==l?void 0:l(t))||10;return Tb(e)&&(e=Math.max(...e)),{size:e?[2*e,2*e]:[30,30],padding:e}};return t.getRoots(e).forEach((o=>{a.set(o.id,{id:o.id,data:{nodes:[],size:p(o).size}});let l=Promise.resolve();Qb(t,[o],(o=>{var c;if(!o.data._isCombo)return;const{size:u,padding:f}=p(o);if(null===(c=t.getChildren(o.id,e))||void 0===c?void 0:c.length){const c=a.get(o.id);a.set(o.id,{id:o.id,data:Object.assign({nodes:[]},null==c?void 0:c.data)});const u=new Map,p=t.getChildren(o.id,e).map((t=>{if(t.data._isCombo)return a.has(t.id)||a.set(t.id,{id:t.id,data:Object.assign({},t.data)}),u.set(t.id,!0),a.get(t.id);const e=n.get(t.id)||r.get(t.id);return u.set(t.id,!0),{id:t.id,data:Object.assign(Object.assign({},e.data),t.data)}})),g={nodes:p,edges:i.filter((t=>u.has(t.source)&&u.has(t.target)))};let v=1/0;p.forEach((t=>{var e;let{size:n}=t.data;n||(n=(null===(e=a.get(t.id))||void 0===e?void 0:e.data.size)||(null==s?void 0:s(t))||[30,30]),ie(n)&&(n=[n,n]);const[r,i]=n;v>r&&(v=r),v>i&&(v=i),t.data.size=n})),l=l.then((()=>(0,ce.mG)(this,void 0,void 0,(function*(){const t=new tm(g);yield ox(h,t,d,!0);const{minX:e,minY:n,maxX:r,maxY:i}=(t=>{let e=1/0,n=1/0,r=-1/0,i=-1/0;return t.forEach((t=>{let o=t.data.size;Tb(o)?1===o.length&&(o=[o[0],o[0]]):ie(o)?o=[o,o]:(void 0===o||isNaN(o))&&(o=[30,30]);const a=[o[0]/2,o[1]/2],s=t.data.x-a[0],l=t.data.x+a[0],c=t.data.y-a[1],u=t.data.y+a[1];e>s&&(e=s),n>c&&(n=c),r<l&&(r=l),i<u&&(i=u)})),{minX:e,minY:n,maxX:r,maxY:i}})(p),s=(r+e)/2,l=(i+n)/2;g.nodes.forEach((t=>{t.data.x-=s,t.data.y-=l}));const c=[Math.max(r-e,v)+2*f,Math.max(i-n,v)+2*f];a.get(o.id).data.size=c,a.get(o.id).data.nodes=p}))))}else a.set(o.id,{id:o.id,data:Object.assign(Object.assign({},o.data),{size:u})});return!0}),"BT",e),f.push(l)})),f}},"compact-box":ym.compactBox,"d3-force":class{constructor(t){this.id="d3-force",this.config={inputNodeAttrs:["x","y","vx","vy","fx","fy"],outputNodeAttrs:["x","y","vx","vy"],simulationAttrs:["alpha","alphaMin","alphaDecay","alphaTarget","velocityDecay","randomSource"]},this.forceMap={link:ux,manyBody:yx,center:bx,collide:wx,radial:kx,x:Mx,y:Sx},this.options={link:{id:t=>t.id},manyBody:{},center:{x:0,y:0}},this.context={options:{},assign:!1,nodes:[],edges:[]},od(this.options,t),this.options.forceSimulation&&(this.simulation=this.options.forceSimulation)}execute(t,e){return(0,ce.mG)(this,void 0,void 0,(function*(){return this.genericLayout(!1,t,e)}))}assign(t,e){return(0,ce.mG)(this,void 0,void 0,(function*(){yield this.genericLayout(!0,t,e)}))}stop(){this.simulation.stop()}tick(t){return this.simulation.tick(t),this.getResult()}restart(){this.simulation.restart()}setFixedPosition(t,e){const n=this.context.nodes.find((e=>e.id===t));n&&e.forEach(((t,e)=>{if("number"==typeof t||null===t){n[["fx","fy","fz"][e]]=t}}))}getOptions(t){var e,n;const r=od({},this.options,t);return r.collide&&void 0===(null===(e=r.collide)||void 0===e?void 0:e.radius)&&(r.collide=r.collide||{},r.collide.radius=null!==(n=r.nodeSize)&&void 0!==n?n:10),void 0===r.iterations&&(r.link&&void 0===r.link.iterations&&(r.iterations=r.link.iterations),r.collide&&void 0===r.collide.iterations&&(r.iterations=r.collide.iterations)),this.context.options=r,r}genericLayout(t,e,n){var r;return(0,ce.mG)(this,void 0,void 0,(function*(){const i=this.getOptions(n),o=e.getAllNodes().map((({id:t,data:e})=>Object.assign(Object.assign({id:t},e),gg(e.data,this.config.inputNodeAttrs)))),a=e.getAllEdges().map((t=>Object.assign({},t)));Object.assign(this.context,{assign:t,nodes:o,edges:a,graph:e});const s=new Promise((t=>{this.resolver=t})),l=this.setSimulation(i);return l.nodes(o),null===(r=l.force("link"))||void 0===r||r.links(a),s}))}getResult(){const{assign:t,nodes:e,edges:n,graph:r}=this.context,i=e.map((t=>({id:t.id,data:Object.assign(Object.assign({},t.data),gg(t,this.config.outputNodeAttrs))}))),o=n.map((({id:t,source:e,target:n,data:r})=>({id:t,source:"object"==typeof e?e.id:e,target:"object"==typeof n?n.id:n,data:r})));return t&&i.forEach((t=>r.mergeNodeData(t.id,t.data))),{nodes:i,edges:o}}initSimulation(){return mx()}setSimulation(t){const e=this.simulation||this.options.forceSimulation||this.initSimulation();return this.simulation||(this.simulation=e.on("tick",(()=>{var e;return null===(e=t.onTick)||void 0===e?void 0:e.call(t,this.getResult())})).on("end",(()=>{var t;return null===(t=this.resolver)||void 0===t?void 0:t.call(this,this.getResult())}))),Ax(e,this.config.simulationAttrs.map((e=>[e,t[e]]))),Object.entries(this.forceMap).forEach((([n,r])=>{const i=n;if(t[n]){let n=e.force(i);n||(n=r(),e.force(i,n)),Ax(n,Object.entries(t[i]))}else e.force(i,null)})),e}},"force-atlas2":class{constructor(t={}){this.options=t,this.id="forceAtlas2",this.options=Object.assign(Object.assign({},Dx),t)}execute(t,e){return(0,ce.mG)(this,void 0,void 0,(function*(){return this.genericForceAtlas2Layout(!1,t,e)}))}assign(t,e){return(0,ce.mG)(this,void 0,void 0,(function*(){yield this.genericForceAtlas2Layout(!0,t,e)}))}genericForceAtlas2Layout(t,e,n){return(0,ce.mG)(this,void 0,void 0,(function*(){const r=e.getAllEdges(),i=e.getAllNodes(),o=this.formatOptions(n,i.length),{width:a,height:s,prune:l,maxIteration:c,nodeSize:u,center:h}=o;if(!(null==i?void 0:i.length)||1===i.length)return Ab(e,t,h);const d=i.map((t=>kb(t,[a,s]))),f=r.filter((t=>{const{source:e,target:n}=t;return e!==n})),p=new tm({nodes:d,edges:f}),g=this.getSizes(p,u);if(this.run(p,e,c,g,t,o),l){for(let t=0;t<f.length;t+=1){const{source:e,target:n}=f[t],r=p.getDegree(e),i=p.getDegree(e);if(r<=1){const t=p.getNode(n);p.mergeNodeData(e,{x:t.data.x,y:t.data.y})}else if(i<=1){const t=p.getNode(e);p.mergeNodeData(n,{x:t.data.x,y:t.data.y})}}const n=Object.assign(Object.assign({},o),{prune:!1,barnesHut:!1});this.run(p,e,100,g,t,n)}return{nodes:d,edges:r}}))}getSizes(t,e){const n=t.getAllNodes(),r={};for(let t=0;t<n.length;t+=1){const i=n[t];r[i.id]=Eb(e,void 0)(i)}return r}formatOptions(t={},e){const n=Object.assign(Object.assign({},this.options),t),{center:r,width:i,height:o,barnesHut:a,prune:s,maxIteration:l,kr:c,kg:u}=n;return n.width=i||"undefined"==typeof window?i:window.innerWidth,n.height=o||"undefined"==typeof window?o:window.innerHeight,n.center=r||[n.width/2,n.height/2],void 0===a&&e>250&&(n.barnesHut=!0),void 0===s&&e>100&&(n.prune=!0),0!==l||s?0===l&&s&&(n.maxIteration=100,e<=200&&e>100?n.maxIteration=500:e>200&&(n.maxIteration=950)):(n.maxIteration=250,e<=200&&e>100?n.maxIteration=1e3:e>200&&(n.maxIteration=1200)),c||(n.kr=50,e>100&&e<=500?n.kr=20:e>500&&(n.kr=1)),u||(n.kg=20,e>100&&e<=500?n.kg=10:e>500&&(n.kg=1)),n}run(t,e,n,r,i,o){const{kr:a,barnesHut:s,onTick:l}=o,c=t.getAllNodes();let u=0,h=n;const d={},f={},p={};for(let e=0;e<c.length;e+=1){const{data:n,id:r}=c[e];if(d[r]=[0,0],s){const i={id:e,rx:n.x,ry:n.y,mass:1,g:a,degree:t.getDegree(r)};p[r]=new Tx(i)}}for(;h>0;)u=this.oneStep(t,{iter:h,preventOverlapIters:50,krPrime:100,sg:u,forces:d,preForces:f,bodies:p,sizes:r},o),h--,null==l||l({nodes:c,edges:e.getAllEdges()});return t}oneStep(t,e,n){const{iter:r,preventOverlapIters:i,krPrime:o,sg:a,preForces:s,bodies:l,sizes:c}=e;let{forces:u}=e;const{preventOverlap:h,barnesHut:d}=n,f=t.getAllNodes();for(let t=0;t<f.length;t+=1){const{id:e}=f[t];s[e]=[...u[e]],u[e]=[0,0]}return u=this.getAttrForces(t,r,i,c,u,n),u=d&&(h&&r>i||!h)?this.getOptRepGraForces(t,u,l,n):this.getRepGraForces(t,r,i,u,o,c,n),this.updatePos(t,u,s,a,n)}getAttrForces(t,e,n,r,i,o){const{preventOverlap:a,dissuadeHubs:s,mode:l,prune:c}=o,u=t.getAllEdges();for(let o=0;o<u.length;o+=1){const{source:h,target:d}=u[o],f=t.getNode(h),p=t.getNode(d),g=t.getDegree(h),v=t.getDegree(d);if(c&&(g<=1||v<=1))continue;const m=[p.data.x-f.data.x,p.data.y-f.data.y];let y=Math.hypot(m[0],m[1]);y=y<1e-4?1e-4:y,m[0]=m[0]/y,m[1]=m[1]/y,a&&e<n&&(y=y-r[h]-r[d]);let b=y,x=b;"linlog"===l&&(b=Math.log(1+y),x=b),s&&(b=y/g,x=y/v),a&&e<n&&y<=0?(b=0,x=0):a&&e<n&&y>0&&(b=y,x=y),i[h][0]+=b*m[0],i[d][0]-=x*m[0],i[h][1]+=b*m[1],i[d][1]-=x*m[1]}return i}getOptRepGraForces(t,e,n,r){const{kg:i,center:o,prune:a}=r,s=t.getAllNodes(),l=s.length;let c=9e10,u=-9e10,h=9e10,d=-9e10;for(let e=0;e<l;e+=1){const{id:r,data:i}=s[e];a&&t.getDegree(r)<=1||(n[r].setPos(i.x,i.y),i.x>=u&&(u=i.x),i.x<=c&&(c=i.x),i.y>=d&&(d=i.y),i.y<=h&&(h=i.y))}const f=Math.max(u-c,d-h),p=new Px({xmid:(u+c)/2,ymid:(d+h)/2,length:f,massCenter:o,mass:l}),g=new Rx(p);for(let e=0;e<l;e+=1){const{id:r}=s[e];a&&t.getDegree(r)<=1||n[r].in(p)&&g.insert(n[r])}for(let r=0;r<l;r+=1){const{id:l,data:c}=s[r],u=t.getDegree(l);if(a&&u<=1)continue;n[l].resetForce(),g.updateForce(n[l]),e[l][0]-=n[l].fx,e[l][1]-=n[l].fy;const h=[c.x-o[0],c.y-o[1]];let d=Math.hypot(h[0],h[1]);d=d<1e-4?1e-4:d,h[0]=h[0]/d,h[1]=h[1]/d;const f=i*(u+1);e[l][0]-=f*h[0],e[l][1]-=f*h[1]}return e}getRepGraForces(t,e,n,r,i,o,a){const{preventOverlap:s,kr:l,kg:c,center:u,prune:h}=a,d=t.getAllNodes(),f=d.length;for(let a=0;a<f;a+=1){const p=d[a],g=t.getDegree(p.id);for(let c=a+1;c<f;c+=1){const a=d[c],u=t.getDegree(a.id);if(h&&(g<=1||u<=1))continue;const f=[a.data.x-p.data.x,a.data.y-p.data.y];let v=Math.hypot(f[0],f[1]);v=v<1e-4?1e-4:v,f[0]=f[0]/v,f[1]=f[1]/v,s&&e<n&&(v=v-o[p.id]-o[a.id]);let m=l*(g+1)*(u+1)/v;s&&e<n&&v<0?m=i*(g+1)*(u+1):s&&e<n&&0===v?m=0:s&&e<n&&v>0&&(m=l*(g+1)*(u+1)/v),r[p.id][0]-=m*f[0],r[a.id][0]+=m*f[0],r[p.id][1]-=m*f[1],r[a.id][1]+=m*f[1]}const v=[p.data.x-u[0],p.data.y-u[1]],m=Math.hypot(v[0],v[1]);v[0]=v[0]/m,v[1]=v[1]/m;const y=c*(g+1);r[p.id][0]-=y*v[0],r[p.id][1]-=y*v[1]}return r}updatePos(t,e,n,r,i){const{ks:o,tao:a,prune:s,ksmax:l}=i,c=t.getAllNodes(),u=c.length,h=[],d=[];let f=0,p=0,g=r;for(let r=0;r<u;r+=1){const{id:i}=c[r],o=t.getDegree(i);if(s&&o<=1)continue;const a=[e[i][0]-n[i][0],e[i][1]-n[i][1]],l=Math.hypot(a[0],a[1]),u=[e[i][0]+n[i][0],e[i][1]+n[i][1]],g=Math.hypot(u[0],u[1]);h[r]=l,d[r]=g/2,f+=(o+1)*h[r],p+=(o+1)*d[r]}const v=g;g=a*p/f,0!==v&&(g=g>1.5*v?1.5*v:g);for(let n=0;n<u;n+=1){const{id:r,data:i}=c[n],a=t.getDegree(r);if(s&&a<=1)continue;if(ie(i.fx)&&ie(i.fy))continue;let u=o*g/(1+g*Math.sqrt(h[n])),d=Math.hypot(e[r][0],e[r][1]);d=d<1e-4?1e-4:d;const f=l/d;u=u>f?f:u;const p=u*e[r][0],v=u*e[r][1];t.mergeNodeData(r,{x:i.x+p,y:i.y+v})}return g}},circular:class{constructor(t={}){this.options=t,this.id="circular",this.options=Object.assign(Object.assign({},Nb),t)}execute(t,e){return(0,ce.mG)(this,void 0,void 0,(function*(){return this.genericCircularLayout(!1,t,e)}))}assign(t,e){return(0,ce.mG)(this,void 0,void 0,(function*(){yield this.genericCircularLayout(!0,t,e)}))}genericCircularLayout(t,e,n){return(0,ce.mG)(this,void 0,void 0,(function*(){const r=Object.assign(Object.assign({},this.options),n),{width:i,height:o,center:a,divisions:s,startAngle:l=0,endAngle:c=2*Math.PI,angleRatio:u,ordering:h,clockwise:d,nodeSpacing:f,nodeSize:p}=r,g=e.getAllNodes(),v=e.getAllEdges(),[m,y,b]=Ob(i,o,a),x=null==g?void 0:g.length;if(!x||1===x)return Ab(e,t,b);const E=(c-l)/x;let{radius:w,startRadius:k,endRadius:M}=r;if(f){const t=bb(10,f),e=xb(10,p);let n=-1/0;g.forEach((t=>{const r=e(t);n<r&&(n=r)}));let r=0;g.forEach(((e,i)=>{r+=0===i?n||10:(t(e)||0)+(n||10)})),w=r/(2*Math.PI)}else w||k||M?!k&&M?k=M:k&&!M&&(M=k):w=Math.min(y,m)/2;const S=E*u;let A=[];A="topology"===h?Cb(e,g):"topology-directed"===h?Cb(e,g,!0):"degree"===h?function(t,e){const n=[];return e.forEach(((t,e)=>{n.push(kb(t))})),n.sort(((e,n)=>t.getDegree(e.id,"both")-t.getDegree(n.id,"both"))),n}(e,g):g.map((t=>kb(t)));const N=Math.ceil(x/s);for(let t=0;t<x;++t){let e=w;e||null===k||null===M||(e=k+t*(M-k)/(x-1)),e||(e=10+100*t/(x-1));let n=l+t%N*S+2*Math.PI/s*Math.floor(t/N);d||(n=c-t%N*S-2*Math.PI/s*Math.floor(t/N)),A[t].data.x=b[0]+Math.cos(n)*e,A[t].data.y=b[1]+Math.sin(n)*e}t&&A.forEach((t=>{e.mergeNodeData(t.id,{x:t.data.x,y:t.data.y})}));return{nodes:A,edges:v}}))}},concentric:Rb,dagre:Ox,dendrogram:ym.dendrogram,fishbone:nE,force:Fb,fruchterman:class{constructor(t={}){this.options=t,this.id="fruchterman",this.timeInterval=0,this.running=!1,this.options=Object.assign(Object.assign({},Lx),t)}execute(t,e){return(0,ce.mG)(this,void 0,void 0,(function*(){return this.genericFruchtermanLayout(!1,t,e)}))}assign(t,e){return(0,ce.mG)(this,void 0,void 0,(function*(){yield this.genericFruchtermanLayout(!0,t,e)}))}stop(){this.timeInterval&&"undefined"!=typeof window&&window.clearInterval(this.timeInterval),this.running=!1}tick(t=this.options.maxIteration||1){if(this.lastResult)return this.lastResult;for(let e=0;e<t;e++)this.runOneStep(this.lastGraph,this.lastClusterMap,this.lastOptions);const e={nodes:this.lastLayoutNodes,edges:this.lastLayoutEdges};return this.lastAssign&&e.nodes.forEach((t=>this.lastGraph.mergeNodeData(t.id,{x:t.data.x,y:t.data.y,z:3===this.options.dimensions?t.data.z:void 0}))),e}genericFruchtermanLayout(t,e,n){return(0,ce.mG)(this,void 0,void 0,(function*(){if(this.running)return;const r=this.formatOptions(n),{dimensions:i,width:o,height:a,center:s,clustering:l,nodeClusterBy:c,maxIteration:u,onTick:h}=r,d=e.getAllNodes(),f=e.getAllEdges();if(!(null==d?void 0:d.length)){const t={nodes:[],edges:f};return this.lastResult=t,t}if(1===d.length){t&&e.mergeNodeData(d[0].id,{x:s[0],y:s[1],z:3===i?s[2]:void 0});const n={nodes:[Object.assign(Object.assign({},d[0]),{data:Object.assign(Object.assign({},d[0].data),{x:s[0],y:s[1],z:3===i?s[2]:void 0})})],edges:f};return this.lastResult=n,n}const p=d.map((t=>kb(t,[o,a]))),g=new tm({nodes:p,edges:f}),v={};if(l&&p.forEach((t=>{const e=t.data[c];v[e]||(v[e]={name:e,cx:0,cy:0,count:0})})),this.lastLayoutNodes=p,this.lastLayoutEdges=f,this.lastAssign=t,this.lastGraph=g,this.lastOptions=r,this.lastClusterMap=v,"undefined"==typeof window)return;let m=0;return new Promise((n=>{this.timeInterval=window.setInterval((()=>{this.running?(this.runOneStep(g,v,r),t&&p.forEach((({id:t,data:n})=>e.mergeNodeData(t,{x:n.x,y:n.y,z:3===i?n.z:void 0}))),null==h||h({nodes:p,edges:f}),m++,m>=u&&(window.clearInterval(this.timeInterval),n({nodes:p,edges:f}))):n({nodes:p,edges:f})}),0),this.running=!0}))}))}formatOptions(t={}){const e=Object.assign(Object.assign({},this.options),t),{clustering:n,nodeClusterBy:r}=e,{center:i,width:o,height:a}=e;return e.width=o||"undefined"==typeof window?o:window.innerWidth,e.height=a||"undefined"==typeof window?a:window.innerHeight,e.center=i||[e.width/2,e.height/2],e.clustering=n&&!!r,e}runOneStep(t,e,n){const{dimensions:r,height:i,width:o,gravity:a,center:s,speed:l,clustering:c,nodeClusterBy:u,clusterGravity:h}=n,d=i*o,f=Math.sqrt(d)/10,p=t.getAllNodes(),g=d/(p.length+1),v=Math.sqrt(g),m={};if(this.applyCalculate(t,m,v,g),c){for(const t in e)e[t].cx=0,e[t].cy=0,e[t].count=0;p.forEach((t=>{const{data:n}=t,r=e[n[u]];ie(n.x)&&(r.cx+=n.x),ie(n.y)&&(r.cy+=n.y),r.count++}));for(const t in e)e[t].cx/=e[t].count,e[t].cy/=e[t].count;const t=h||a;p.forEach(((n,r)=>{const{id:i,data:o}=n;if(!ie(o.x)||!ie(o.y))return;const a=e[o[u]],s=Math.sqrt((o.x-a.cx)*(o.x-a.cx)+(o.y-a.cy)*(o.y-a.cy)),l=v*t;m[i].x-=l*(o.x-a.cx)/s,m[i].y-=l*(o.y-a.cy)/s}))}p.forEach(((t,e)=>{const{id:n,data:i}=t;if(!ie(i.x)||!ie(i.y))return;const o=.01*v*a;m[n].x-=o*(i.x-s[0]),m[n].y-=o*(i.y-s[1]),3===r&&(m[n].z-=o*(i.z-s[2]))})),p.forEach(((e,n)=>{const{id:i,data:o}=e;if(ie(o.fx)&&ie(o.fy))return o.x=o.fx,o.y=o.fy,void(3===r&&(o.z=o.fz));if(!ie(o.x)||!ie(o.y))return;const a=Math.sqrt(m[i].x*m[i].x+m[i].y*m[i].y+(3===r?m[i].z*m[i].z:0));if(a>0){const e=Math.min(f*(l/800),a);t.mergeNodeData(i,{x:o.x+m[i].x/a*e,y:o.y+m[i].y/a*e,z:3===r?o.z+m[i].z/a*e:void 0})}}))}applyCalculate(t,e,n,r){this.calRepulsive(t,e,r),this.calAttractive(t,e,n)}calRepulsive(t,e,n){const r=t.getAllNodes();r.forEach((({data:t,id:i},o)=>{e[i]={x:0,y:0,z:0},r.forEach((({data:r,id:a},s)=>{if(o<=s||!ie(t.x)||!ie(r.x)||!ie(t.y)||!ie(r.y))return;let l=t.x-r.x,c=t.y-r.y,u=3===this.options.dimensions?t.z-r.z:0,h=l*l+c*c+u*u;0===h&&(h=1,l=.01,c=.01,u=.01);const d=n/h,f=l*d,p=c*d,g=u*d;e[i].x+=f,e[i].y+=p,e[a].x-=f,e[a].y-=p,3===this.options.dimensions&&(e[i].z+=g,e[a].z-=g)}))}))}calAttractive(t,e,n){t.getAllEdges().forEach((r=>{const{source:i,target:o}=r;if(!i||!o||i===o)return;const{data:a}=t.getNode(i),{data:s}=t.getNode(o);if(!(ie(s.x)&&ie(a.x)&&ie(s.y)&&ie(a.y)))return;const l=s.x-a.x,c=s.y-a.y,u=3===this.options.dimensions?s.z-a.z:0,h=Math.sqrt(l*l+c*c+u*u)/n,d=l*h,f=c*h,p=u*h;e[i].x+=d,e[i].y+=f,e[o].x-=d,e[o].y-=f,3===this.options.dimensions&&(e[i].z+=p,e[o].z-=p)}))}},grid:class{constructor(t={}){this.options=t,this.id="grid",this.options=Object.assign(Object.assign({},Ix),t)}execute(t,e){return(0,ce.mG)(this,void 0,void 0,(function*(){return this.genericGridLayout(!1,t,e)}))}assign(t,e){return(0,ce.mG)(this,void 0,void 0,(function*(){yield this.genericGridLayout(!0,t,e)}))}genericGridLayout(t,e,n){return(0,ce.mG)(this,void 0,void 0,(function*(){const r=Object.assign(Object.assign({},this.options),n),{begin:i=[0,0],condense:o,preventOverlapPadding:a,preventOverlap:s,rows:l,cols:c,nodeSpacing:u,nodeSize:h,width:d,height:f,position:p}=r;let{sortBy:g}=r;const v=e.getAllNodes(),m=e.getAllEdges(),y=null==v?void 0:v.length;if(!y||1===y)return Ab(e,t,i);const b=v.map((t=>kb(t)));"id"===g||se(g)&&void 0!==b[0].data[g]||(g="degree"),"degree"===g?b.sort(((t,n)=>e.getDegree(n.id,"both")-e.getDegree(t.id,"both"))):"id"===g?b.sort(((t,e)=>ie(e.id)&&ie(t.id)?e.id-t.id:`${t.id}`.localeCompare(`${e.id}`))):b.sort(((t,e)=>e.data[g]-t.data[g]));const x=d||"undefined"==typeof window?d:window.innerWidth,E=f||"undefined"==typeof window?f:window.innerHeight,w=y,k={rows:l,cols:c};if(null!=l&&null!=c)k.rows=l,k.cols=c;else if(null!=l&&null==c)k.rows=l,k.cols=Math.ceil(w/k.rows);else if(null==l&&null!=c)k.cols=c,k.rows=Math.ceil(w/k.cols);else{const t=Math.sqrt(w*E/x);k.rows=Math.round(t),k.cols=Math.round(x/E*t)}if(k.rows=Math.max(k.rows,1),k.cols=Math.max(k.cols,1),k.cols*k.rows>w){const t=Bx(k),e=jx(k);(t-1)*e>=w?Bx(k,t-1):(e-1)*t>=w&&jx(k,e-1)}else for(;k.cols*k.rows<w;){const t=Bx(k),e=jx(k);(e+1)*t>=w?jx(k,e+1):Bx(k,t+1)}let M=o?0:x/k.cols,S=o?0:E/k.rows;if(s||u){const t=bb(10,u),n=xb(30,h,!1);b.forEach((r=>{r.data.x&&r.data.y||(r.data.x=0,r.data.y=0);const i=e.getNode(r.id),[o,s]=yb(n(i)||30),l=void 0!==t?t(r):a,c=o+l,u=s+l;M=Math.max(M,c),S=Math.max(S,u)}))}const A={},N={row:0,col:0},C={};for(let t=0;t<b.length;t++){const n=b[t];let r;if(p&&(r=p(e.getNode(n.id))),r&&(void 0!==r.row||void 0!==r.col)){const t={row:r.row,col:r.col};if(void 0===t.col)for(t.col=0;zx(A,t);)t.col++;else if(void 0===t.row)for(t.row=0;zx(A,t);)t.row++;C[n.id]=t,Fx(A,t)}Zx(n,i,M,S,C,k,N,A)}const O={nodes:b,edges:m};return t&&b.forEach((t=>{e.mergeNodeData(t.id,{x:t.data.x,y:t.data.y})})),O}))}},indented:ym.indented,mds:$b,mindmap:ym.mindmap,radial:class{constructor(t={}){this.options=t,this.id="radial",this.options=Object.assign(Object.assign({},Hx),t)}execute(t,e){return(0,ce.mG)(this,void 0,void 0,(function*(){return this.genericRadialLayout(!1,t,e)}))}assign(t,e){return(0,ce.mG)(this,void 0,void 0,(function*(){yield this.genericRadialLayout(!0,t,e)}))}genericRadialLayout(t,e,n){return(0,ce.mG)(this,void 0,void 0,(function*(){const r=Object.assign(Object.assign({},this.options),n),{width:i,height:o,center:a,focusNode:s,unitRadius:l,nodeSize:c,nodeSpacing:u,strictRadial:h,preventOverlap:d,maxPreventOverlapIteration:f,sortBy:p,linkDistance:g=50,sortStrength:v=10,maxIteration:m=1e3}=r,y=e.getAllNodes(),b=e.getAllEdges(),x=i||"undefined"==typeof window?i:window.innerWidth,E=o||"undefined"==typeof window?o:window.innerHeight,w=a||[x/2,E/2];if(!(null==y?void 0:y.length)||1===y.length)return Ab(e,t,w);let k=y[0];if(se(s)){for(let t=0;t<y.length;t++)if(y[t].id===s){k=y[t];break}}else k=s||y[0];const M=qx(y,k.id),S=Xb({nodes:y,edges:b},!1),A=qb(S),N=Kx(A,M);Xx(A,M,N+1);const C=A[M];let O=x-w[0]>w[0]?w[0]:x-w[0],T=E-w[1]>w[1]?w[1]:E-w[1];0===O&&(O=x/2),0===T&&(T=E/2);const P=Math.min(O,T),R=Math.max(...C),D=[],L=l||P/R;C.forEach(((t,e)=>{D[e]=t*L}));const I=Ux(y,A,g,D,L,p,v),B=Yx(I),j=((t,e,n)=>{try{const n=Ub.mul(Ub.pow(e,2),-.5),r=n.mean("row"),i=n.mean("column"),o=n.mean();n.add(o).subRowVector(r).subColumnVector(i);const a=new Yb(n),s=Ub.sqrt(a.diagonalMatrix).diagonal();return a.leftSingularVectors.toJSON().map((e=>Ub.mul([e],[s]).toJSON()[0].splice(0,t)))}catch(t){const r=[];for(let t=0;t<e.length;t++){const t=Math.random()*n,e=Math.random()*n;r.push([t,e])}return r}})(g,I,g);let z,F=j.map((([t,e])=>({x:(isNaN(t)?Math.random()*g:t)-j[M][0],y:(isNaN(e)?Math.random()*g:e)-j[M][1]})));if(this.run(m,F,B,I,D,M),d){z=Eb(c,u);const t={nodes:y,nodeSizeFunc:z,positions:F,radii:D,height:E,width:x,strictRadial:Boolean(h),focusIdx:M,iterations:f||200,k:F.length/4.5};F=((t,e)=>{const n=Object.assign(Object.assign({},Gx),e),{positions:r,iterations:i,width:o,k:a,speed:s=100,strictRadial:l,focusIdx:c,radii:u=[],nodeSizeFunc:h}=n,d=t.getAllNodes(),f=[],p=o/10;for(let t=0;t<i;t++)r.forEach(((t,e)=>{f[e]={x:0,y:0}})),Vx(d,r,f,a,u,h),Wx(r,f,s,l,c,p,o,u);return r})(e,t)}const _=[];F.forEach(((t,e)=>{const n=kb(y[e]);n.data.x=t.x+w[0],n.data.y=t.y+w[1],_.push(n)})),t&&_.forEach((t=>e.mergeNodeData(t.id,{x:t.data.x,y:t.data.y})));return{nodes:_,edges:b}}))}run(t,e,n,r,i,o){for(let a=0;a<=t;a++){const s=a/t;this.oneIteration(s,e,i,r,n,o)}}oneIteration(t,e,n,r,i,o){const a=1-t;e.forEach(((s,l)=>{const c=Kb(s,{x:0,y:0}),u=0===c?0:1/c;if(l===o)return;let h=0,d=0,f=0;e.forEach(((t,e)=>{if(l===e)return;const n=Kb(s,t),o=0===n?0:1/n,a=r[e][l];f+=i[l][e],h+=i[l][e]*(t.x+a*(s.x-t.x)*o),d+=i[l][e]*(t.y+a*(s.y-t.y)*o)}));const p=0===n[l]?0:1/n[l];f*=a,f+=t*p*p,h*=a,h+=t*p*s.x*u,s.x=h/f,d*=a,d+=t*p*s.y*u,s.y=d/f}))}},random:class{constructor(t={}){this.options=t,this.id="random",this.options=Object.assign(Object.assign({},Qx),t)}execute(t,e){return(0,ce.mG)(this,void 0,void 0,(function*(){return this.genericRandomLayout(!1,t,e)}))}assign(t,e){return(0,ce.mG)(this,void 0,void 0,(function*(){yield this.genericRandomLayout(!0,t,e)}))}genericRandomLayout(t,e,n){return(0,ce.mG)(this,void 0,void 0,(function*(){const r=Object.assign(Object.assign({},this.options),n),{center:i,width:o,height:a}=r,s=e.getAllNodes(),l=o||"undefined"==typeof window?o:window.innerWidth,c=a||"undefined"==typeof window?a:window.innerHeight,u=i||[l/2,c/2],h=[];s&&s.forEach((t=>{h.push({id:t.id,data:{x:.9*(Math.random()-.5)*l+u[0],y:.9*(Math.random()-.5)*c+u[1]}})})),t&&h.forEach((t=>e.mergeNodeData(t.id,{x:t.data.x,y:t.data.y})));return{nodes:h,edges:e.getAllEdges()}}))}},snake:sE},node:{circle:Uf,diamond:class extends Yf{constructor(t){super(t)}getPoints(t){const[e,n]=this.getSize(t);return function(t,e){return[[0,-e/2],[t/2,0],[0,e/2],[-t/2,0]]}(e,n)}},ellipse:Jf,hexagon:class extends Yf{constructor(t){super(t)}getOuterR(t){return t.outerR||Math.min(...this.getSize(t))/2}getPoints(t){return[[0,e=this.getOuterR(t)],[e*Math.sqrt(3)/2,e/2],[e*Math.sqrt(3)/2,-e/2],[0,-e],[-e*Math.sqrt(3)/2,-e/2],[-e*Math.sqrt(3)/2,e/2]];var e}getIconStyle(t){const e=super.getIconStyle(t),n=this.getOuterR(t)*Yd;return!!e&&Object.assign({width:n,height:n},e)}},html:mg,image:bg,rect:class extends Hf{constructor(t){super(t)}getKeyStyle(t){const[e,n]=this.getSize(t);return Object.assign(Object.assign({},super.getKeyStyle(t)),{width:e,height:n,x:-e/2,y:-n/2})}getIconStyle(t){const e=super.getIconStyle(t),{width:n,height:r}=this.getShape("key").attributes;return!!e&&Object.assign({width:n*Yd,height:r*Yd},e)}drawKeyShape(t,e){return this.upsert("key",zl,this.getKeyStyle(t),e)}},star:class extends Yf{constructor(t){super(t)}getInnerR(t){return t.innerR||3*this.getOuterR(t)/8}getOuterR(t){return Math.min(...this.getSize(t))/2}getPoints(t){return e=this.getOuterR(t),n=this.getInnerR(t),[[0,-e],[n*Math.cos(3*Math.PI/10),-n*Math.sin(3*Math.PI/10)],[e*Math.cos(Math.PI/10),-e*Math.sin(Math.PI/10)],[n*Math.cos(Math.PI/10),n*Math.sin(Math.PI/10)],[e*Math.cos(3*Math.PI/10),e*Math.sin(3*Math.PI/10)],[0,n],[-e*Math.cos(3*Math.PI/10),e*Math.sin(3*Math.PI/10)],[-n*Math.cos(Math.PI/10),n*Math.sin(Math.PI/10)],[-e*Math.cos(Math.PI/10),-e*Math.sin(Math.PI/10)],[-n*Math.cos(3*Math.PI/10),-n*Math.sin(3*Math.PI/10)]];var e,n}getIconStyle(t){const e=super.getIconStyle(t),n=2*this.getInnerR(t)*Yd;return!!e&&Object.assign({width:n,height:n},e)}getPortXY(t,e){const{placement:n="top"}=e;return Sv(this.getShape("key").getLocalBounds(),n,function(t,e){const n={};return n.top=[0,-t],n.left=[-t*Math.cos(Math.PI/10),-t*Math.sin(Math.PI/10)],n["left-bottom"]=[-t*Math.cos(3*Math.PI/10),t*Math.sin(3*Math.PI/10)],n.bottom=[0,e],n["right-bottom"]=[t*Math.cos(3*Math.PI/10),t*Math.sin(3*Math.PI/10)],n.right=n.default=[t*Math.cos(Math.PI/10),-t*Math.sin(Math.PI/10)],n}(this.getOuterR(t),this.getInnerR(t)),!1)}},donut:Xf,triangle:xg},palette:{spectral:["rgb(158, 1, 66)","rgb(213, 62, 79)","rgb(244, 109, 67)","rgb(253, 174, 97)","rgb(254, 224, 139)","rgb(255, 255, 191)","rgb(230, 245, 152)","rgb(171, 221, 164)","rgb(102, 194, 165)","rgb(50, 136, 189)","rgb(94, 79, 162)"],tableau:["rgb(78, 121, 167)","rgb(242, 142, 44)","rgb(225, 87, 89)","rgb(118, 183, 178)","rgb(89, 161, 79)","rgb(237, 201, 73)","rgb(175, 122, 161)","rgb(255, 157, 167)","rgb(156, 117, 95)","rgb(186, 176, 171)"],oranges:["rgb(255, 245, 235)","rgb(254, 230, 206)","rgb(253, 208, 162)","rgb(253, 174, 107)","rgb(253, 141, 60)","rgb(241, 105, 19)","rgb(217, 72, 1)","rgb(166, 54, 3)","rgb(127, 39, 4)"],greens:["rgb(247, 252, 245)","rgb(229, 245, 224)","rgb(199, 233, 192)","rgb(161, 217, 155)","rgb(116, 196, 118)","rgb(65, 171, 93)","rgb(35, 139, 69)","rgb(0, 109, 44)","rgb(0, 68, 27)"],blues:["rgb(247, 251, 255)","rgb(222, 235, 247)","rgb(198, 219, 239)","rgb(158, 202, 225)","rgb(107, 174, 214)","rgb(66, 146, 198)","rgb(33, 113, 181)","rgb(8, 81, 156)","rgb(8, 48, 107)"]},theme:{dark:vC,light:mC},plugin:{"bubble-sets":JE,"edge-bundling":rw,"edge-filter-lens":dw,"grid-line":vw,background:vE,contextmenu:nw,fisheye:pw,fullscreen:gw,history:Ew,hull:nk,legend:TM,minimap:PM,snapline:BM,timebar:jN,title:class extends uE{get padding(){return Uu(this.options.padding)}constructor(t,e){super(t,Object.assign({},HN,e)),this.onRender=()=>{const t=this.updateCanvas();this.renderTitle(t)},this.bindEvents()}bindEvents(){const{graph:t}=this.context;t.on(pu.AFTER_RENDER,this.onRender),t.on(pu.AFTER_ANIMATE,this.onRender)}unbindEvents(){const{graph:t}=this.context;t.off(pu.AFTER_RENDER,this.onRender),t.off(pu.AFTER_ANIMATE,this.onRender)}destroy(){var t,e;this.unbindEvents(),null===(t=this.canvas)||void 0===t||t.destroy(),null===(e=this.container)||void 0===e||e.remove(),super.destroy()}updateCanvas(){const{size:t,className:e,align:n}=this.options,[r]=this.context.canvas.getSize(),[i=0,,o=0]=this.padding,a=t+i+o;if(this.canvas){const{width:t,height:e}=this.canvas.getConfig();r===t&&a===e||this.canvas.resize(r,a)}else{const t={left:"left-top",center:"top",right:"right-top"},[i,o]=CM({width:r,height:a,placement:t[n]||t.left,className:"title-canvas",graphCanvas:this.context.canvas});e&&i.classList.add(e),this.container=i,this.canvas=o}return this.canvas}renderTitle(t){const e=new qN({options:this.options,ctx:this.context});t.removeChildren(),e.getTitle().forEach((e=>{e&&t.appendChild(e)}))}},toolbar:KN,tooltip:oC,watermark:hC},transform:{"arrange-draw-order":class extends yC{beforeDraw(t){const{model:e}=this.context,n=t.add.combos,r=t=>{const n=[];return t.forEach(((t,r)=>{const i=e.getAncestorsData(r,"combo").map((t=>Fh(t))).reverse();n.push([r,t,i.length])})),new Map(n.sort((([,,t],[,,e])=>e-t)).map((([t,e])=>[t,e])))};return t.add.combos=r(n),t.update.combos=r(t.update.combos),t}},"collapse-expand-combo":class extends yC{beforeDraw(t,e){if("visibility"===e.stage)return t;if(!this.context.model.model.hasTreeStructure(mu))return t;const{model:n}=this.context,{add:r,update:i}=t,o=[...t.update.combos.entries(),...t.add.combos.entries()];for(;o.length;){const[e,a]=o.pop();if(ef(a)){const a=n.getDescendantsData(e),s=a.map(Fh),{internal:l,external:c}=Ug(s,(t=>n.getRelatedEdgesData(t)));a.forEach((e=>{const r=Fh(e),i=o.findIndex((([t])=>t===r));-1!==i&&o.splice(i,1);const a=n.getElementType(r);bC(t,"remove",a,e)})),l.forEach((e=>bC(t,"remove","edge",e))),c.forEach((t=>{var e;const n=Fh(t);(null===(e=this.context.element)||void 0===e?void 0:e.getElement(n))?i.edges.set(n,t):r.edges.set(n,t)}))}else{const r=n.getChildrenData(e),i=r.map(Fh),{edges:a}=Ug(i,(t=>n.getRelatedEdgesData(t)));[...r,...a].forEach((e=>{var r;const i=Fh(e),a=n.getElementType(i),s=null===(r=this.context.element)||void 0===r?void 0:r.getElement(i);bC(t,s?"update":"add",a,e),"combo"===a&&o.push([i,e])}))}}return t}},"collapse-expand-node":class extends yC{getElement(t){return this.context.element.getElement(t)}handleExpand(t,e){if(EC(e,"add","node",t),ef(t))return;const n=Fh(t);EC(e,"add","node",t);this.context.model.getRelatedEdgesData(n).forEach((t=>{bC(e,"add","edge",t)}));this.context.model.getChildrenData(n).forEach((t=>{this.handleExpand(t,e)}))}beforeDraw(t){const{graph:e,model:n}=this.context;if(!n.model.hasTreeStructure(yu))return t;const{add:{nodes:r,edges:i},update:{nodes:o}}=t,a=new Map,s=new Map;r.forEach(((t,e)=>{ef(t)&&a.set(e,t)})),i.forEach((t=>{if("node"!==e.getElementType(t.source))return;const n=e.getNodeData(t.source);ef(n)&&a.set(t.source,n)})),o.forEach(((t,e)=>{const n=this.getElement(e);if(!n)return;const r=n.attributes.collapsed;ef(t)?r||a.set(e,t):r&&s.set(e,t)}));const l=new Set;return a.forEach(((e,r)=>{n.getDescendantsData(r).forEach((e=>{const r=Fh(e);if(l.has(r))return;bC(t,"remove","node",e);n.getRelatedEdgesData(r).forEach((e=>{bC(t,"remove","edge",e)})),l.add(r)}))})),s.forEach(((e,r)=>{n.getAncestorsData(r,yu).some(ef)?bC(t,"remove","node",e):this.handleExpand(e,t)})),t}},"get-edge-actual-ends":class extends yC{beforeDraw(t){const{add:e,update:n}=t,{model:r}=this.context;return[...e.edges.entries(),...n.edges.entries()].forEach((([,t])=>{jO(r,t)})),t}},"map-node-size":zO,"place-radial-labels":FO,"process-parallel-edges":ZO,"update-related-edges":class extends yC{beforeDraw(t,e){const{stage:n}=e;if("visibility"===n)return t;const{model:r}=this.context,{update:{nodes:i,edges:o,combos:a}}=t,s=(t,e)=>{r.getRelatedEdgesData(e).forEach((t=>!o.has(Fh(t))&&o.set(Fh(t),t)))};return i.forEach(s),a.forEach(s),t}}},shape:{circle:wl,ellipse:Sl,group:Al,html:Cl,image:jf,line:Pl,path:Dl,polygon:Il,polyline:jl,rect:zl,text:_l,label:Tf,badge:Pf}};Object.entries(HO).forEach((([t,e])=>{Object.entries(e).forEach((([e,n])=>{!function(t,e,n){xu[t][e]&&ku.warn(`The extension ${e} of ${t} has been registered before, and will be overridden.`),Object.assign(xu[t],{[e]:n})}(t,e,n)}))}))},13722:function(t){var e;"undefined"!=typeof self&&self,e=function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:r})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=5)}([function(t,e){t.exports={assign:Object.assign,getHeight:function(t,e,n,r){return void 0===r&&(r="height"),"center"===n?(t[r]+e[r])/2:t.height}}},function(t,e,n){var r=n(3),i=function(){function t(t,e){void 0===e&&(e={}),this.options=e,this.rootNode=r(t,e)}return t.prototype.execute=function(){throw new Error("please override this method")},t}();t.exports=i},function(t,e,n){var r=n(4),i=["LR","RL","TB","BT","H","V"],o=["LR","RL","H"],a=i[0];t.exports=function(t,e,n){var s=e.direction||a;if(e.isHorizontal=function(t){return o.indexOf(t)>-1}(s),s&&-1===i.indexOf(s))throw new TypeError("Invalid direction: "+s);if(s===i[0])n(t,e);else if(s===i[1])n(t,e),t.right2left();else if(s===i[2])n(t,e);else if(s===i[3])n(t,e),t.bottom2top();else if(s===i[4]||s===i[5]){var l=r(t,e),c=l.left,u=l.right;n(c,e),n(u,e),e.isHorizontal?c.right2left():c.bottom2top(),u.translate(c.x-u.x,c.y-u.y),t.x=c.x,t.y=u.y;var h=t.getBoundingBox();e.isHorizontal?h.top<0&&t.translate(0,-h.top):h.left<0&&t.translate(-h.left,0)}var d=e.fixedRoot;return void 0===d&&(d=!0),d&&t.translate(-(t.x+t.width/2+t.hgap),-(t.y+t.height/2+t.vgap)),function(t,e){if(e.radial){var n=e.isHorizontal?["x","y"]:["y","x"],r=n[0],i=n[1],o={x:1/0,y:1/0},a={x:-1/0,y:-1/0},s=0;t.DFTraverse((function(t){s++;var e=t.x,n=t.y;o.x=Math.min(o.x,e),o.y=Math.min(o.y,n),a.x=Math.max(a.x,e),a.y=Math.max(a.y,n)}));var l=a[i]-o[i];if(0===l)return;var c=2*Math.PI/s;t.DFTraverse((function(e){var n=(e[i]-o[i])/l*(2*Math.PI-c)+c,a=e[r]-t[r];e.x=Math.cos(n)*a,e.y=Math.sin(n)*a}))}}(t,e),t}},function(t,e,n){var r=n(0),i={getId:function(t){return t.id||t.name},getPreH:function(t){return t.preH||0},getPreV:function(t){return t.preV||0},getHGap:function(t){return t.hgap||18},getVGap:function(t){return t.vgap||18},getChildren:function(t){return t.children},getHeight:function(t){return t.height||36},getWidth:function(t){var e=t.label||" ";return t.width||18*e.split("").length}};function o(t,e){var n=this;if(n.vgap=n.hgap=0,t instanceof o)return t;n.data=t;var r=e.getHGap(t),i=e.getVGap(t);return n.preH=e.getPreH(t),n.preV=e.getPreV(t),n.width=e.getWidth(t),n.height=e.getHeight(t),n.width+=n.preH,n.height+=n.preV,n.id=e.getId(t),n.x=n.y=0,n.depth=0,n.children||(n.children=[]),n.addGap(r,i),n}r.assign(o.prototype,{isRoot:function(){return 0===this.depth},isLeaf:function(){return 0===this.children.length},addGap:function(t,e){var n=this;n.hgap+=t,n.vgap+=e,n.width+=2*t,n.height+=2*e},eachNode:function(t){for(var e,n=[this];e=n.shift();)t(e),n=e.children.concat(n)},DFTraverse:function(t){this.eachNode(t)},BFTraverse:function(t){for(var e,n=[this];e=n.shift();)t(e),n=n.concat(e.children)},getBoundingBox:function(){var t={left:Number.MAX_VALUE,top:Number.MAX_VALUE,width:0,height:0};return this.eachNode((function(e){t.left=Math.min(t.left,e.x),t.top=Math.min(t.top,e.y),t.width=Math.max(t.width,e.x+e.width),t.height=Math.max(t.height,e.y+e.height)})),t},translate:function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.eachNode((function(n){n.x+=t,n.y+=e,n.x+=n.preH,n.y+=n.preV}))},right2left:function(){var t=this,e=t.getBoundingBox();t.eachNode((function(t){t.x=t.x-2*(t.x-e.left)-t.width})),t.translate(e.width,0)},bottom2top:function(){var t=this,e=t.getBoundingBox();t.eachNode((function(t){t.y=t.y-2*(t.y-e.top)-t.height})),t.translate(0,e.height)}}),t.exports=function(t,e,n){void 0===e&&(e={});var a,s=new o(t,e=r.assign({},i,e)),l=[s];if(!n&&!t.collapsed)for(;a=l.shift();)if(!a.data.collapsed){var c=e.getChildren(a.data),u=c?c.length:0;if(a.children=new Array(u),c&&u)for(var h=0;h<u;h++){var d=new o(c[h],e);a.children[h]=d,l.push(d),d.parent=a,d.depth=a.depth+1}}return s}},function(t,e,n){var r=n(3);t.exports=function(t,e){for(var n=r(t.data,e,!0),i=r(t.data,e,!0),o=t.children.length,a=Math.round(o/2),s=e.getSide||function(t,e){return e<a?"right":"left"},l=0;l<o;l++){var c=t.children[l];"right"===s(c,l)?i.children.push(c):n.children.push(c)}return n.eachNode((function(t){t.isRoot()||(t.side="left")})),i.eachNode((function(t){t.isRoot()||(t.side="right")})),{left:n,right:i}}},function(t,e,n){var r={compactBox:n(6),dendrogram:n(8),indented:n(10),mindmap:n(12)};t.exports=r},function(t,e,n){function r(t,e){return r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},r(t,e)}var i=n(1),o=n(7),a=n(2),s=n(0),l=function(t){function e(){return t.apply(this,arguments)||this}var n,i;return i=t,(n=e).prototype=Object.create(i.prototype),n.prototype.constructor=n,r(n,i),e.prototype.execute=function(){return a(this.rootNode,this.options,o)},e}(i),c={};t.exports=function(t,e){return e=s.assign({},c,e),new l(t,e).execute()}},function(t,e){function n(t,e,n,r){void 0===r&&(r=[]);var i=this;i.w=t||0,i.h=e||0,i.y=n||0,i.x=0,i.c=r||[],i.cs=r.length,i.prelim=0,i.mod=0,i.shift=0,i.change=0,i.tl=null,i.tr=null,i.el=null,i.er=null,i.msel=0,i.mser=0}function r(t,e,n){n?t.y+=e:t.x+=e,t.children.forEach((function(t){r(t,e,n)}))}function i(t,e){var n=e?t.y:t.x;return t.children.forEach((function(t){n=Math.min(i(t,e),n)})),n}function o(t,e){r(t,-i(t,e),e)}function a(t,e,n){n?e.y=t.x:e.x=t.x,t.c.forEach((function(t,r){a(t,e.children[r],n)}))}function s(t,e,n){void 0===n&&(n=0),e?(t.x=n,n+=t.width):(t.y=n,n+=t.height),t.children.forEach((function(t){s(t,e,n)}))}n.fromNode=function(t,e){if(!t)return null;var r=[];return t.children.forEach((function(t){r.push(n.fromNode(t,e))})),e?new n(t.height,t.width,t.x,r):new n(t.width,t.height,t.y,r)},t.exports=function(t,e){void 0===e&&(e={});var r=e.isHorizontal;function i(t){0===t.cs?(t.el=t,t.er=t,t.msel=t.mser=0):(t.el=t.c[0].el,t.msel=t.c[0].msel,t.er=t.c[t.cs-1].er,t.mser=t.c[t.cs-1].mser)}function l(t,e,n){for(var r=t.c[e-1],i=r.mod,o=t.c[e],a=o.mod;null!==r&&null!==o;){d(r)>n.low&&(n=n.nxt);var s=i+r.prelim+r.w-(a+o.prelim);s>0&&(a+=s,c(t,e,n.index,s));var l=d(r),f=d(o);l<=f&&null!==(r=h(r))&&(i+=r.mod),l>=f&&null!==(o=u(o))&&(a+=o.mod)}!r&&o?function(t,e,n,r){var i=t.c[0].el;i.tl=n;var o=r-n.mod-t.c[0].msel;i.mod+=o,i.prelim-=o,t.c[0].el=t.c[e].el,t.c[0].msel=t.c[e].msel}(t,e,o,a):r&&!o&&function(t,e,n,r){var i=t.c[e].er;i.tr=n;var o=r-n.mod-t.c[e].mser;i.mod+=o,i.prelim-=o,t.c[e].er=t.c[e-1].er,t.c[e].mser=t.c[e-1].mser}(t,e,r,i)}function c(t,e,n,r){t.c[e].mod+=r,t.c[e].msel+=r,t.c[e].mser+=r,function(t,e,n,r){if(n!==e-1){var i=e-n;t.c[n+1].shift+=r/i,t.c[e].shift-=r/i,t.c[e].change-=r-r/i}}(t,e,n,r)}function u(t){return 0===t.cs?t.tl:t.c[0]}function h(t){return 0===t.cs?t.tr:t.c[t.cs-1]}function d(t){return t.y+t.h}function f(t,e,n){for(;null!==n&&t>=n.low;)n=n.nxt;return{low:t,index:e,nxt:n}}s(t,r);var p=n.fromNode(t,r);return function t(e){if(0!==e.cs){t(e.c[0]);for(var n=f(d(e.c[0].el),0,null),r=1;r<e.cs;++r){t(e.c[r]);var o=d(e.c[r].er);l(e,r,n),n=f(o,r,n)}!function(t){t.prelim=(t.c[0].prelim+t.c[0].mod+t.c[t.cs-1].mod+t.c[t.cs-1].prelim+t.c[t.cs-1].w)/2-t.w/2}(e),i(e)}else i(e)}(p),function t(e,n){n+=e.mod,e.x=e.prelim+n,function(t){for(var e=0,n=0,r=0;r<t.cs;r++)n+=(e+=t.c[r].shift)+t.c[r].change,t.c[r].mod+=n}(e);for(var r=0;r<e.cs;r++)t(e.c[r],n)}(p,0),a(p,t,r),o(t,r),t}},function(t,e,n){function r(t,e){return r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},r(t,e)}var i=n(1),o=n(9),a=n(2),s=n(0),l=function(t){function e(){return t.apply(this,arguments)||this}var n,i;return i=t,(n=e).prototype=Object.create(i.prototype),n.prototype.constructor=n,r(n,i),e.prototype.execute=function(){var t=this;return t.rootNode.width=0,a(t.rootNode,t.options,o)},e}(i),c={};t.exports=function(t,e){return e=s.assign({},c,e),new l(t,e).execute()}},function(t,e,n){var r=n(0);function i(t,e){void 0===t&&(t=0),void 0===e&&(e=[]);var n=this;n.x=n.y=0,n.leftChild=n.rightChild=null,n.height=0,n.children=e}var o={isHorizontal:!0,nodeSep:20,nodeSize:20,rankSep:200,subTreeSep:10};function a(t,e,n){n?(e.x=t.x,e.y=t.y):(e.x=t.y,e.y=t.x),t.children.forEach((function(t,r){a(t,e.children[r],n)}))}t.exports=function(t,e){void 0===e&&(e={}),e=r.assign({},o,e);var n,s=0,l=function t(e){if(!e)return null;e.width=0,e.depth&&e.depth>s&&(s=e.depth);var n=e.children,r=n.length,o=new i(e.height,[]);return n.forEach((function(e,n){var i=t(e);o.children.push(i),0===n&&(o.leftChild=i),n===r-1&&(o.rightChild=i)})),o.originNode=e,o.isLeaf=e.isLeaf(),o}(t);return function t(e){if(e.isLeaf||0===e.children.length)e.drawingDepth=s;else{var n=e.children.map((function(e){return t(e)})),r=Math.min.apply(null,n);e.drawingDepth=r-1}return e.drawingDepth}(l),function t(r){r.x=r.drawingDepth*e.rankSep,r.isLeaf?(r.y=0,n&&(r.y=n.y+n.height+e.nodeSep,r.originNode.parent!==n.originNode.parent&&(r.y+=e.subTreeSep)),n=r):(r.children.forEach((function(e){t(e)})),r.y=(r.leftChild.y+r.rightChild.y)/2)}(l),a(l,t,e.isHorizontal),t}},function(t,e,n){function r(t,e){return r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},r(t,e)}var i=n(1),o=n(11),a=n(4),s=n(0),l=["LR","RL","H"],c=l[0],u=function(t){function e(){return t.apply(this,arguments)||this}var n,i;return i=t,(n=e).prototype=Object.create(i.prototype),n.prototype.constructor=n,r(n,i),e.prototype.execute=function(){var t=this.options,e=this.rootNode;t.isHorizontal=!0;var n=t.indent,r=void 0===n?20:n,i=t.dropCap,s=void 0===i||i,u=t.direction,h=void 0===u?c:u,d=t.align;if(h&&-1===l.indexOf(h))throw new TypeError("Invalid direction: "+h);if(h===l[0])o(e,r,s,d);else if(h===l[1])o(e,r,s,d),e.right2left();else if(h===l[2]){var f=a(e,t),p=f.left,g=f.right;o(p,r,s,d),p.right2left(),o(g,r,s,d);var v=p.getBoundingBox();g.translate(v.width,0),e.x=g.x-e.width/2}return e},e}(i),h={};t.exports=function(t,e){return e=s.assign({},h,e),new u(t,e).execute()}},function(t,e,n){var r=n(0);t.exports=function(t,e,n,i){var o=null;t.eachNode((function(t){!function(t,e,n,i,o){var a=("function"==typeof n?n(t):n)*t.depth;if(!i)try{if(t.id===t.parent.children[0].id)return t.x+=a,void(t.y=e?e.y:0)}catch(t){}if(t.x+=a,e){if(t.y=e.y+r.getHeight(e,t,o),e.parent&&t.parent.id!==e.parent.id){var s=e.parent,l=s.y+r.getHeight(s,t,o);t.y=l>t.y?l:t.y}}else t.y=0}(t,o,e,n,i),o=t}))}},function(t,e,n){function r(t,e){return r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},r(t,e)}var i=n(1),o=n(13),a=n(2),s=n(0),l=function(t){function e(){return t.apply(this,arguments)||this}var n,i;return i=t,(n=e).prototype=Object.create(i.prototype),n.prototype.constructor=n,r(n,i),e.prototype.execute=function(){return a(this.rootNode,this.options,o)},e}(i),c={};t.exports=function(t,e){return e=s.assign({},c,e),new l(t,e).execute()}},function(t,e,n){var r=n(0);function i(t,e){var n=0;return t.children.length?t.children.forEach((function(t){n+=i(t,e)})):n=t.height,t._subTreeSep=e.getSubTreeSep(t.data),t.totalHeight=Math.max(t.height,n)+2*t._subTreeSep,t.totalHeight}function o(t){var e=t.children,n=e.length;if(n){e.forEach((function(t){o(t)}));var r=e[0],i=e[n-1],a=i.y-r.y+i.height,s=0;if(e.forEach((function(t){s+=t.totalHeight})),a>t.height)t.y=r.y+a/2-t.height/2;else if(1!==e.length||t.height>s){var l=t.y+(t.height-a)/2-r.y;e.forEach((function(t){t.translate(0,l)}))}else t.y=(r.y+r.height/2+i.y+i.height/2)/2-t.height/2}}var a={getSubTreeSep:function(){return 0}};t.exports=function(t,e){void 0===e&&(e={}),e=r.assign({},a,e),t.parent={x:0,width:0,height:0,y:0},t.BFTraverse((function(t){t.x=t.parent.x+t.parent.width})),t.parent=null,i(t,e),t.startY=0,t.y=t.totalHeight/2-t.height/2,t.eachNode((function(t){var e=t.children,n=e.length;if(n){var r=e[0];if(r.startY=t.startY+t._subTreeSep,1===n)r.y=t.y+t.height/2-r.height/2;else{r.y=r.startY+r.totalHeight/2-r.height/2;for(var i=1;i<n;i++){var o=e[i];o.startY=e[i-1].startY+e[i-1].totalHeight,o.y=o.startY+o.totalHeight/2-o.height/2}}}})),o(t)}}])},t.exports=e()},60008:function(t,e,n){"use strict";var r=n(82242),i=n.n(r),o=n(79800),a=n.n(o),s=n(37205),l=n.n(s),c=n(59301),u=n(42441),h=(n(48961),n(37712));function d(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1/3,r=arguments.length>3?arguments[3]:void 0,i=t*Math.PI*2,o=e*Math.PI*2;return{u:{min:-Math.PI,max:3*Math.PI,step:Math.PI/32},v:{min:0,max:2*Math.PI,step:Math.PI/20},x:function(t,e){return t<i?Math.cos(i)*(1+Math.cos(e)*n):t>o?Math.cos(o)*(1+Math.cos(e)*n):Math.cos(t)*(1+Math.cos(e)*n)},y:function(t,e){return t<i?Math.sin(i)*(1+Math.cos(e)*n):t>o?Math.sin(o)*(1+Math.cos(e)*n):Math.sin(t)*(1+Math.cos(e)*n)},z:function(t,e){return t<.5*-Math.PI?Math.sin(t):t>2.5*Math.PI?Math.sin(t)*r*.1:Math.sin(e)>0?1*r*.1:-1}}}e.Z=function(t){var e=t.dataSource,n=void 0===e?[{name:"掌握率80%~100%",value:0,itemStyle:{color:"rgb(223,209,38)"}},{name:"掌提率60%~79%",value:0,itemStyle:{color:"rgb(6,234,230)"}},{name:"掌推率59%以下",value:0,itemStyle:{color:"rgb(6,110,247)"}}]:e,r=t.className,o=void 0===r?"":r,s=t.style,f=void 0===s?{}:s,p=t.legend,g=void 0===p?{}:p,v=t.internalDiameterRatio,m=void 0===v?1/3:v,y=(0,c.useState)([]),b=a()(y,2),x=b[0],E=b[1],w=(0,c.useCallback)((function(t){var e=t.selected||{},r=n.map((function(t){return t.name})).filter((function(t){return!1===e[t]}));E(r)}),[n]),k=(0,c.useMemo)((function(){return n.filter((function(t){return!x.includes(t.name)}))}),[n,x]),M=(0,c.useMemo)((function(){var t=function(t){for(var e=t.pieData,n=void 0===e?[]:e,r=t.internalDiameterRatio,i=void 0===r?1/3:r,o=[],a=null==n?void 0:n.reduce((function(t,e){return(t||0)+((null==e?void 0:e.value)||0)}),0),s=0,c=0,u=[],h=0;h<(null==n?void 0:n.length);h++){var f,p,g,v;c=s+(0==a?1:(null==n||null===(f=n[h])||void 0===f?void 0:f.value)||0);var m={itemStyle:(null==n||null===(p=n[h])||void 0===p?void 0:p.itemStyle)||{},name:(null==n||null===(g=n[h])||void 0===g?void 0:g.name)||"name".concat(h),type:"surface",parametric:!0,parametricEquation:d(s/(a||(null==n?void 0:n.length)),c/(a||(null==n?void 0:n.length)),i,(null==n||null===(v=n[h])||void 0===v?void 0:v.value)||(0==a?25:0)),wireframe:{show:!1},pieData:null==n?void 0:n[h]};u.push(m.name),o.push(m),s=c}return o.push({name:"pie2d",type:"pie",showEmptyCircle:!0,label:{show:!0,formatter:function(t){return"".concat(t.value,"\n\n ").concat(t.name)}},startAngle:-35,radius:["49%","50%"],center:["50%","40%"],data:l()(n||[]).reverse(),itemStyle:{opacity:0}}),{legend:{left:"50%",top:"center",textStyle:{fontSize:12},data:u},xAxis3D:{},yAxis3D:{},zAxis3D:{},grid3D:{viewControl:{alpha:45,rotateSensitivity:0,zoomSensitivity:0,panSensitivity:0,autoRotate:!1},left:"center",top:"-10%",show:!1,boxHeight:25},series:o}}({pieData:k,internalDiameterRatio:m}),e=n.map((function(t){return t.name})),r=n.reduce((function(t,e){return t[e.name]=!x.includes(e.name),t}),{});return t.legend=i()(i()(i()({},t.legend),g),{},{data:e,selected:r}),t}),[k,g,m,n,x]);return(0,h.jsx)(u.Z,{onEvents:{legendselectchanged:w},className:"w-full h-full ".concat(o),option:M,style:i()({height:"100%"},f)})}},99982:function(t,e,n){"use strict";var r=n(4811).default,i=n(34577).default,o=n(31573).default,a=n(38689).default,s=n(24270).default,l=n(13720).default,c=n(80619).default,u=n(47074).default,h=n(7134).default,d=n(85573).default,f=n(68995).default,p=n(79800).default,g=n(91232).default,v=n(7557).default,m=n(31468).default,y=n(82100).default,b=n(29186).default;var x=n(34634),E=n(34402),w=" ".repeat(2),k=" ".repeat(4);function M(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.maxRows,r=void 0===n?15:n,i=e.maxColumns,o=void 0===i?10:i,a=e.maxNumSize,s=void 0===a?8:a,l=e.padMinus,c=void 0===l?"auto":l;return"".concat(t.constructor.name," {\n").concat(w,"[\n").concat(k).concat(S(t,r,o,s,c),"\n").concat(w,"]\n").concat(w,"rows: ").concat(t.rows,"\n").concat(w,"columns: ").concat(t.columns,"\n}")}function S(t,e,n,r,i){var o=t.rows,a=t.columns,s=Math.min(o,e),l=Math.min(a,n),c=[];if("auto"===i){i=!1;t:for(var u=0;u<s;u++)for(var h=0;h<l;h++)if(t.get(u,h)<0){i=!0;break t}}for(var d=0;d<s;d++){for(var f=[],p=0;p<l;p++)f.push(A(t.get(d,p),r,i));c.push("".concat(f.join(" ")))}return l!==a&&(c[c.length-1]+=" ... ".concat(a-n," more columns")),s!==o&&c.push("... ".concat(o-e," more rows")),c.join("\n".concat(k))}function A(t,e,n){return(t>=0&&n?" ".concat(N(t,e-1)):N(t,e)).padEnd(e)}function N(t,e){var n=t.toString();if(n.length<=e)return n;var r=t.toFixed(e);if(r.length>e&&(r=t.toFixed(Math.max(0,e-(r.length-e)))),r.length<=e&&!r.startsWith("0.000")&&!r.startsWith("-0.000"))return r;var i=t.toExponential(e);return i.length>e&&(i=t.toExponential(Math.max(0,e-(i.length-e)))),i.slice(0)}function C(t,e,n){var r=n?t.rows:t.rows-1;if(e<0||e>r)throw new RangeError("Row index out of range")}function O(t,e,n){var r=n?t.columns:t.columns-1;if(e<0||e>r)throw new RangeError("Column index out of range")}function T(t,e){if(e.to1DArray&&(e=e.to1DArray()),e.length!==t.columns)throw new RangeError("vector size must be the same as the number of columns");return e}function P(t,e){if(e.to1DArray&&(e=e.to1DArray()),e.length!==t.rows)throw new RangeError("vector size must be the same as the number of rows");return e}function R(t,e){if(!x.isAnyArray(e))throw new TypeError("row indices must be an array");for(var n=0;n<e.length;n++)if(e[n]<0||e[n]>=t.rows)throw new RangeError("row indices are out of range")}function D(t,e){if(!x.isAnyArray(e))throw new TypeError("column indices must be an array");for(var n=0;n<e.length;n++)if(e[n]<0||e[n]>=t.columns)throw new RangeError("column indices are out of range")}function L(t,e,n,r,i){if(5!==arguments.length)throw new RangeError("expected 4 arguments");if(B("startRow",e),B("endRow",n),B("startColumn",r),B("endColumn",i),e>n||r>i||e<0||e>=t.rows||n<0||n>=t.rows||r<0||r>=t.columns||i<0||i>=t.columns)throw new RangeError("Submatrix indices are out of range")}function I(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=[],r=0;r<t;r++)n.push(e);return n}function B(t,e){if("number"!=typeof e)throw new TypeError("".concat(t," must be a number"))}function j(t){if(t.isEmpty())throw new Error("Empty matrix has no elements to index")}function z(t,e,n){for(var r=t.rows,i=t.columns,o=[],a=0;a<r;a++){for(var s=0,l=0,c=0,u=0;u<i;u++)s+=c=t.get(a,u)-n[a],l+=c*c;e?o.push((l-s*s/i)/(i-1)):o.push((l-s*s/i)/i)}return o}function F(t,e,n){for(var r=t.rows,i=t.columns,o=[],a=0;a<i;a++){for(var s=0,l=0,c=0,u=0;u<r;u++)s+=c=t.get(u,a)-n[a],l+=c*c;e?o.push((l-s*s/r)/(r-1)):o.push((l-s*s/r)/r)}return o}function _(t,e,n){for(var r=t.rows,i=t.columns,o=r*i,a=0,s=0,l=0,c=0;c<r;c++)for(var u=0;u<i;u++)a+=l=t.get(c,u)-n,s+=l*l;return e?(s-a*a/o)/(o-1):(s-a*a/o)/o}function Z(t,e){for(var n=0;n<t.rows;n++)for(var r=0;r<t.columns;r++)t.set(n,r,t.get(n,r)-e[n])}function G(t,e){for(var n=0;n<t.rows;n++)for(var r=0;r<t.columns;r++)t.set(n,r,t.get(n,r)-e[r])}function V(t,e){for(var n=0;n<t.rows;n++)for(var r=0;r<t.columns;r++)t.set(n,r,t.get(n,r)-e)}function W(t){for(var e=[],n=0;n<t.rows;n++){for(var r=0,i=0;i<t.columns;i++)r+=Math.pow(t.get(n,i),2)/(t.columns-1);e.push(Math.sqrt(r))}return e}function H(t,e){for(var n=0;n<t.rows;n++)for(var r=0;r<t.columns;r++)t.set(n,r,t.get(n,r)/e[n])}function U(t){for(var e=[],n=0;n<t.columns;n++){for(var r=0,i=0;i<t.rows;i++)r+=Math.pow(t.get(i,n),2)/(t.rows-1);e.push(Math.sqrt(r))}return e}function Y(t,e){for(var n=0;n<t.rows;n++)for(var r=0;r<t.columns;r++)t.set(n,r,t.get(n,r)/e[r])}function q(t){for(var e=t.size-1,n=0,r=0;r<t.columns;r++)for(var i=0;i<t.rows;i++)n+=Math.pow(t.get(i,r),2)/e;return Math.sqrt(n)}function X(t,e){for(var n=0;n<t.rows;n++)for(var r=0;r<t.columns;r++)t.set(n,r,t.get(n,r)/e)}var K=function(t){function e(){y(this,e)}return b(e,[{key:"size",get:function(){return this.rows*this.columns}},{key:"apply",value:function(t){if("function"!=typeof t)throw new TypeError("callback must be a function");for(var e=0;e<this.rows;e++)for(var n=0;n<this.columns;n++)t.call(this,e,n);return this}},{key:"to1DArray",value:function(){for(var t=[],e=0;e<this.rows;e++)for(var n=0;n<this.columns;n++)t.push(this.get(e,n));return t}},{key:"to2DArray",value:function(){for(var t=[],e=0;e<this.rows;e++){t.push([]);for(var n=0;n<this.columns;n++)t[e].push(this.get(e,n))}return t}},{key:"toJSON",value:function(){return this.to2DArray()}},{key:"isRowVector",value:function(){return 1===this.rows}},{key:"isColumnVector",value:function(){return 1===this.columns}},{key:"isVector",value:function(){return 1===this.rows||1===this.columns}},{key:"isSquare",value:function(){return this.rows===this.columns}},{key:"isEmpty",value:function(){return 0===this.rows||0===this.columns}},{key:"isSymmetric",value:function(){if(this.isSquare()){for(var t=0;t<this.rows;t++)for(var e=0;e<=t;e++)if(this.get(t,e)!==this.get(e,t))return!1;return!0}return!1}},{key:"isDistance",value:function(){if(!this.isSymmetric())return!1;for(var t=0;t<this.rows;t++)if(0!==this.get(t,t))return!1;return!0}},{key:"isEchelonForm",value:function(){for(var t=0,e=0,n=-1,r=!0,i=!1;t<this.rows&&r;){for(e=0,i=!1;e<this.columns&&!1===i;)0===this.get(t,e)?e++:1===this.get(t,e)&&e>n?(i=!0,n=e):(r=!1,i=!0);t++}return r}},{key:"isReducedEchelonForm",value:function(){for(var t=0,e=0,n=-1,r=!0,i=!1;t<this.rows&&r;){for(e=0,i=!1;e<this.columns&&!1===i;)0===this.get(t,e)?e++:1===this.get(t,e)&&e>n?(i=!0,n=e):(r=!1,i=!0);for(var o=e+1;o<this.rows;o++)0!==this.get(t,o)&&(r=!1);t++}return r}},{key:"echelonForm",value:function(){for(var t=this.clone(),e=0,n=0;e<t.rows&&n<t.columns;){for(var r=e,i=e;i<t.rows;i++)t.get(i,n)>t.get(r,n)&&(r=i);if(0===t.get(r,n))n++;else{t.swapRows(e,r);for(var o=t.get(e,n),a=n;a<t.columns;a++)t.set(e,a,t.get(e,a)/o);for(var s=e+1;s<t.rows;s++){var l=t.get(s,n)/t.get(e,n);t.set(s,n,0);for(var c=n+1;c<t.columns;c++)t.set(s,c,t.get(s,c)-t.get(e,c)*l)}e++,n++}}return t}},{key:"reducedEchelonForm",value:function(){for(var t=this.echelonForm(),e=t.columns,n=t.rows,r=n-1;r>=0;)if(0===t.maxRow(r))r--;else{for(var i=0,o=!1;i<n&&!1===o;)1===t.get(r,i)?o=!0:i++;for(var a=0;a<r;a++)for(var s=t.get(a,i),l=i;l<e;l++){var c=t.get(a,l)-s*t.get(r,l);t.set(a,l,c)}r--}return t}},{key:"set",value:function(){throw new Error("set method is unimplemented")}},{key:"get",value:function(){throw new Error("get method is unimplemented")}},{key:"repeat",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("object"!==m(t))throw new TypeError("options must be an object");var e=t.rows,n=void 0===e?1:e,r=t.columns,i=void 0===r?1:r;if(!Number.isInteger(n)||n<=0)throw new TypeError("rows must be a positive integer");if(!Number.isInteger(i)||i<=0)throw new TypeError("columns must be a positive integer");for(var o=new $(this.rows*n,this.columns*i),a=0;a<n;a++)for(var s=0;s<i;s++)o.setSubMatrix(this,this.rows*a,this.columns*s);return o}},{key:"fill",value:function(t){for(var e=0;e<this.rows;e++)for(var n=0;n<this.columns;n++)this.set(e,n,t);return this}},{key:"neg",value:function(){return this.mulS(-1)}},{key:"getRow",value:function(t){C(this,t);for(var e=[],n=0;n<this.columns;n++)e.push(this.get(t,n));return e}},{key:"getRowVector",value:function(t){return $.rowVector(this.getRow(t))}},{key:"setRow",value:function(t,e){C(this,t),e=T(this,e);for(var n=0;n<this.columns;n++)this.set(t,n,e[n]);return this}},{key:"swapRows",value:function(t,e){C(this,t),C(this,e);for(var n=0;n<this.columns;n++){var r=this.get(t,n);this.set(t,n,this.get(e,n)),this.set(e,n,r)}return this}},{key:"getColumn",value:function(t){O(this,t);for(var e=[],n=0;n<this.rows;n++)e.push(this.get(n,t));return e}},{key:"getColumnVector",value:function(t){return $.columnVector(this.getColumn(t))}},{key:"setColumn",value:function(t,e){O(this,t),e=P(this,e);for(var n=0;n<this.rows;n++)this.set(n,t,e[n]);return this}},{key:"swapColumns",value:function(t,e){O(this,t),O(this,e);for(var n=0;n<this.rows;n++){var r=this.get(n,t);this.set(n,t,this.get(n,e)),this.set(n,e,r)}return this}},{key:"addRowVector",value:function(t){t=T(this,t);for(var e=0;e<this.rows;e++)for(var n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)+t[n]);return this}},{key:"subRowVector",value:function(t){t=T(this,t);for(var e=0;e<this.rows;e++)for(var n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)-t[n]);return this}},{key:"mulRowVector",value:function(t){t=T(this,t);for(var e=0;e<this.rows;e++)for(var n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)*t[n]);return this}},{key:"divRowVector",value:function(t){t=T(this,t);for(var e=0;e<this.rows;e++)for(var n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)/t[n]);return this}},{key:"addColumnVector",value:function(t){t=P(this,t);for(var e=0;e<this.rows;e++)for(var n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)+t[e]);return this}},{key:"subColumnVector",value:function(t){t=P(this,t);for(var e=0;e<this.rows;e++)for(var n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)-t[e]);return this}},{key:"mulColumnVector",value:function(t){t=P(this,t);for(var e=0;e<this.rows;e++)for(var n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)*t[e]);return this}},{key:"divColumnVector",value:function(t){t=P(this,t);for(var e=0;e<this.rows;e++)for(var n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)/t[e]);return this}},{key:"mulRow",value:function(t,e){C(this,t);for(var n=0;n<this.columns;n++)this.set(t,n,this.get(t,n)*e);return this}},{key:"mulColumn",value:function(t,e){O(this,t);for(var n=0;n<this.rows;n++)this.set(n,t,this.get(n,t)*e);return this}},{key:"max",value:function(t){if(this.isEmpty())return NaN;switch(t){case"row":for(var e=new Array(this.rows).fill(Number.NEGATIVE_INFINITY),n=0;n<this.rows;n++)for(var r=0;r<this.columns;r++)this.get(n,r)>e[n]&&(e[n]=this.get(n,r));return e;case"column":for(var i=new Array(this.columns).fill(Number.NEGATIVE_INFINITY),o=0;o<this.rows;o++)for(var a=0;a<this.columns;a++)this.get(o,a)>i[a]&&(i[a]=this.get(o,a));return i;case void 0:for(var s=this.get(0,0),l=0;l<this.rows;l++)for(var c=0;c<this.columns;c++)this.get(l,c)>s&&(s=this.get(l,c));return s;default:throw new Error("invalid option: ".concat(t))}}},{key:"maxIndex",value:function(){j(this);for(var t=this.get(0,0),e=[0,0],n=0;n<this.rows;n++)for(var r=0;r<this.columns;r++)this.get(n,r)>t&&(t=this.get(n,r),e[0]=n,e[1]=r);return e}},{key:"min",value:function(t){if(this.isEmpty())return NaN;switch(t){case"row":for(var e=new Array(this.rows).fill(Number.POSITIVE_INFINITY),n=0;n<this.rows;n++)for(var r=0;r<this.columns;r++)this.get(n,r)<e[n]&&(e[n]=this.get(n,r));return e;case"column":for(var i=new Array(this.columns).fill(Number.POSITIVE_INFINITY),o=0;o<this.rows;o++)for(var a=0;a<this.columns;a++)this.get(o,a)<i[a]&&(i[a]=this.get(o,a));return i;case void 0:for(var s=this.get(0,0),l=0;l<this.rows;l++)for(var c=0;c<this.columns;c++)this.get(l,c)<s&&(s=this.get(l,c));return s;default:throw new Error("invalid option: ".concat(t))}}},{key:"minIndex",value:function(){j(this);for(var t=this.get(0,0),e=[0,0],n=0;n<this.rows;n++)for(var r=0;r<this.columns;r++)this.get(n,r)<t&&(t=this.get(n,r),e[0]=n,e[1]=r);return e}},{key:"maxRow",value:function(t){if(C(this,t),this.isEmpty())return NaN;for(var e=this.get(t,0),n=1;n<this.columns;n++)this.get(t,n)>e&&(e=this.get(t,n));return e}},{key:"maxRowIndex",value:function(t){C(this,t),j(this);for(var e=this.get(t,0),n=[t,0],r=1;r<this.columns;r++)this.get(t,r)>e&&(e=this.get(t,r),n[1]=r);return n}},{key:"minRow",value:function(t){if(C(this,t),this.isEmpty())return NaN;for(var e=this.get(t,0),n=1;n<this.columns;n++)this.get(t,n)<e&&(e=this.get(t,n));return e}},{key:"minRowIndex",value:function(t){C(this,t),j(this);for(var e=this.get(t,0),n=[t,0],r=1;r<this.columns;r++)this.get(t,r)<e&&(e=this.get(t,r),n[1]=r);return n}},{key:"maxColumn",value:function(t){if(O(this,t),this.isEmpty())return NaN;for(var e=this.get(0,t),n=1;n<this.rows;n++)this.get(n,t)>e&&(e=this.get(n,t));return e}},{key:"maxColumnIndex",value:function(t){O(this,t),j(this);for(var e=this.get(0,t),n=[0,t],r=1;r<this.rows;r++)this.get(r,t)>e&&(e=this.get(r,t),n[0]=r);return n}},{key:"minColumn",value:function(t){if(O(this,t),this.isEmpty())return NaN;for(var e=this.get(0,t),n=1;n<this.rows;n++)this.get(n,t)<e&&(e=this.get(n,t));return e}},{key:"minColumnIndex",value:function(t){O(this,t),j(this);for(var e=this.get(0,t),n=[0,t],r=1;r<this.rows;r++)this.get(r,t)<e&&(e=this.get(r,t),n[0]=r);return n}},{key:"diag",value:function(){for(var t=Math.min(this.rows,this.columns),e=[],n=0;n<t;n++)e.push(this.get(n,n));return e}},{key:"norm",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"frobenius";switch(t){case"max":return this.max();case"frobenius":return Math.sqrt(this.dot(this));default:throw new RangeError("unknown norm type: ".concat(t))}}},{key:"cumulativeSum",value:function(){for(var t=0,e=0;e<this.rows;e++)for(var n=0;n<this.columns;n++)t+=this.get(e,n),this.set(e,n,t);return this}},{key:"dot",value:function(t){e.isMatrix(t)&&(t=t.to1DArray());var n=this.to1DArray();if(n.length!==t.length)throw new RangeError("vectors do not have the same size");for(var r=0,i=0;i<n.length;i++)r+=n[i]*t[i];return r}},{key:"mmul",value:function(t){t=$.checkMatrix(t);for(var e=this.rows,n=this.columns,r=t.columns,i=new $(e,r),o=new Float64Array(n),a=0;a<r;a++){for(var s=0;s<n;s++)o[s]=t.get(s,a);for(var l=0;l<e;l++){for(var c=0,u=0;u<n;u++)c+=this.get(l,u)*o[u];i.set(l,a,c)}}return i}},{key:"mpow",value:function(t){if(!this.isSquare())throw new RangeError("Matrix must be square");if(!Number.isInteger(t)||t<0)throw new RangeError("Exponent must be a non-negative integer");for(var e=$.eye(this.rows),n=this,r=t;r>=1;r/=2)0!=(1&r)&&(e=e.mmul(n)),n=n.mmul(n);return e}},{key:"strassen2x2",value:function(t){t=$.checkMatrix(t);var e=new $(2,2),n=this.get(0,0),r=t.get(0,0),i=this.get(0,1),o=t.get(0,1),a=this.get(1,0),s=t.get(1,0),l=this.get(1,1),c=t.get(1,1),u=(n+l)*(r+c),h=(a+l)*r,d=n*(o-c),f=l*(s-r),p=(n+i)*c,g=u+f-p+(i-l)*(s+c),v=d+p,m=h+f,y=u-h+d+(a-n)*(r+o);return e.set(0,0,g),e.set(0,1,v),e.set(1,0,m),e.set(1,1,y),e}},{key:"strassen3x3",value:function(t){t=$.checkMatrix(t);var e=new $(3,3),n=this.get(0,0),r=this.get(0,1),i=this.get(0,2),o=this.get(1,0),a=this.get(1,1),s=this.get(1,2),l=this.get(2,0),c=this.get(2,1),u=this.get(2,2),h=t.get(0,0),d=t.get(0,1),f=t.get(0,2),p=t.get(1,0),g=t.get(1,1),v=t.get(1,2),m=t.get(2,0),y=t.get(2,1),b=t.get(2,2),x=(n-o)*(-d+g),E=(-n+o+a)*(h-d+g),w=(o+a)*(-h+d),k=n*h,M=(-n+l+c)*(h-f+v),S=(-n+l)*(f-v),A=(l+c)*(-h+f),N=(-i+c+u)*(g+m-y),C=(i-u)*(g-y),O=i*m,T=(c+u)*(-m+y),P=(-i+a+s)*(v+m-b),R=(i-s)*(v-b),D=(a+s)*(-m+b),L=k+O+r*p,I=(n+r+i-o-a-c-u)*g+E+w+k+N+O+T,B=k+M+A+(n+r+i-a-s-l-c)*v+O+P+D,j=x+a*(-h+d+p-g-v-m+b)+E+k+O+P+R,z=x+E+w+k+s*y,F=O+P+R+D+o*f,_=k+M+S+c*(-h+f+p-g-v-m+y)+N+C+O,Z=N+C+O+T+l*d,G=k+M+S+A+u*b;return e.set(0,0,L),e.set(0,1,I),e.set(0,2,B),e.set(1,0,j),e.set(1,1,z),e.set(1,2,F),e.set(2,0,_),e.set(2,1,Z),e.set(2,2,G),e}},{key:"mmulStrassen",value:function(t){t=$.checkMatrix(t);var n=this.clone(),r=n.rows,i=n.columns,o=t.rows,a=t.columns;function s(t,n,r){var i=t.rows,o=t.columns;if(i===n&&o===r)return t;var a=e.zeros(n,r);return a=a.setSubMatrix(t,0,0)}i!==o&&console.warn("Multiplying ".concat(r," x ").concat(i," and ").concat(o," x ").concat(a," matrix: dimensions do not match."));var l=Math.max(r,o),c=Math.max(i,a);return function t(n,r,i,o){if(i<=512||o<=512)return n.mmul(r);i%2==1&&o%2==1?(n=s(n,i+1,o+1),r=s(r,i+1,o+1)):i%2==1?(n=s(n,i+1,o),r=s(r,i+1,o)):o%2==1&&(n=s(n,i,o+1),r=s(r,i,o+1));var a=parseInt(n.rows/2,10),l=parseInt(n.columns/2,10),c=n.subMatrix(0,a-1,0,l-1),u=r.subMatrix(0,a-1,0,l-1),h=n.subMatrix(0,a-1,l,n.columns-1),d=r.subMatrix(0,a-1,l,r.columns-1),f=n.subMatrix(a,n.rows-1,0,l-1),p=r.subMatrix(a,r.rows-1,0,l-1),g=n.subMatrix(a,n.rows-1,l,n.columns-1),v=r.subMatrix(a,r.rows-1,l,r.columns-1),m=t(e.add(c,g),e.add(u,v),a,l),y=t(e.add(f,g),u,a,l),b=t(c,e.sub(d,v),a,l),x=t(g,e.sub(p,u),a,l),E=t(e.add(c,h),v,a,l),w=t(e.sub(f,c),e.add(u,d),a,l),k=t(e.sub(h,g),e.add(p,v),a,l),M=e.add(m,x);M.sub(E),M.add(k);var S=e.add(b,E),A=e.add(y,x),N=e.sub(m,y);N.add(b),N.add(w);var C=e.zeros(2*M.rows,2*M.columns);return(C=(C=(C=(C=C.setSubMatrix(M,0,0)).setSubMatrix(S,M.rows,0)).setSubMatrix(A,0,M.columns)).setSubMatrix(N,M.rows,M.columns)).subMatrix(0,i-1,0,o-1)}(n=s(n,l,c),t=s(t,l,c),l,c)}},{key:"scaleRows",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("object"!==m(t))throw new TypeError("options must be an object");var e=t.min,n=void 0===e?0:e,r=t.max,i=void 0===r?1:r;if(!Number.isFinite(n))throw new TypeError("min must be a number");if(!Number.isFinite(i))throw new TypeError("max must be a number");if(n>=i)throw new RangeError("min must be smaller than max");for(var o=new $(this.rows,this.columns),a=0;a<this.rows;a++){var s=this.getRow(a);s.length>0&&E(s,{min:n,max:i,output:s}),o.setRow(a,s)}return o}},{key:"scaleColumns",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("object"!==m(t))throw new TypeError("options must be an object");var e=t.min,n=void 0===e?0:e,r=t.max,i=void 0===r?1:r;if(!Number.isFinite(n))throw new TypeError("min must be a number");if(!Number.isFinite(i))throw new TypeError("max must be a number");if(n>=i)throw new RangeError("min must be smaller than max");for(var o=new $(this.rows,this.columns),a=0;a<this.columns;a++){var s=this.getColumn(a);s.length&&E(s,{min:n,max:i,output:s}),o.setColumn(a,s)}return o}},{key:"flipRows",value:function(){for(var t=Math.ceil(this.columns/2),e=0;e<this.rows;e++)for(var n=0;n<t;n++){var r=this.get(e,n),i=this.get(e,this.columns-1-n);this.set(e,n,i),this.set(e,this.columns-1-n,r)}return this}},{key:"flipColumns",value:function(){for(var t=Math.ceil(this.rows/2),e=0;e<this.columns;e++)for(var n=0;n<t;n++){var r=this.get(n,e),i=this.get(this.rows-1-n,e);this.set(n,e,i),this.set(this.rows-1-n,e,r)}return this}},{key:"kroneckerProduct",value:function(t){t=$.checkMatrix(t);for(var e=this.rows,n=this.columns,r=t.rows,i=t.columns,o=new $(e*r,n*i),a=0;a<e;a++)for(var s=0;s<n;s++)for(var l=0;l<r;l++)for(var c=0;c<i;c++)o.set(r*a+l,i*s+c,this.get(a,s)*t.get(l,c));return o}},{key:"kroneckerSum",value:function(t){if(t=$.checkMatrix(t),!this.isSquare()||!t.isSquare())throw new Error("Kronecker Sum needs two Square Matrices");var e=this.rows,n=t.rows,r=this.kroneckerProduct($.eye(n,n)),i=$.eye(e,e).kroneckerProduct(t);return r.add(i)}},{key:"transpose",value:function(){for(var t=new $(this.columns,this.rows),e=0;e<this.rows;e++)for(var n=0;n<this.columns;n++)t.set(n,e,this.get(e,n));return t}},{key:"sortRows",value:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Q,e=0;e<this.rows;e++)this.setRow(e,this.getRow(e).sort(t));return this}},{key:"sortColumns",value:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Q,e=0;e<this.columns;e++)this.setColumn(e,this.getColumn(e).sort(t));return this}},{key:"subMatrix",value:function(t,e,n,r){L(this,t,e,n,r);for(var i=new $(e-t+1,r-n+1),o=t;o<=e;o++)for(var a=n;a<=r;a++)i.set(o-t,a-n,this.get(o,a));return i}},{key:"subMatrixRow",value:function(t,e,n){if(void 0===e&&(e=0),void 0===n&&(n=this.columns-1),e>n||e<0||e>=this.columns||n<0||n>=this.columns)throw new RangeError("Argument out of range");for(var r=new $(t.length,n-e+1),i=0;i<t.length;i++)for(var o=e;o<=n;o++){if(t[i]<0||t[i]>=this.rows)throw new RangeError("Row index out of range: ".concat(t[i]));r.set(i,o-e,this.get(t[i],o))}return r}},{key:"subMatrixColumn",value:function(t,e,n){if(void 0===e&&(e=0),void 0===n&&(n=this.rows-1),e>n||e<0||e>=this.rows||n<0||n>=this.rows)throw new RangeError("Argument out of range");for(var r=new $(n-e+1,t.length),i=0;i<t.length;i++)for(var o=e;o<=n;o++){if(t[i]<0||t[i]>=this.columns)throw new RangeError("Column index out of range: ".concat(t[i]));r.set(o-e,i,this.get(o,t[i]))}return r}},{key:"setSubMatrix",value:function(t,e,n){if((t=$.checkMatrix(t)).isEmpty())return this;L(this,e,e+t.rows-1,n,n+t.columns-1);for(var r=0;r<t.rows;r++)for(var i=0;i<t.columns;i++)this.set(e+r,n+i,t.get(r,i));return this}},{key:"selection",value:function(t,e){R(this,t),D(this,e);for(var n=new $(t.length,e.length),r=0;r<t.length;r++)for(var i=t[r],o=0;o<e.length;o++){var a=e[o];n.set(r,o,this.get(i,a))}return n}},{key:"trace",value:function(){for(var t=Math.min(this.rows,this.columns),e=0,n=0;n<t;n++)e+=this.get(n,n);return e}},{key:"clone",value:function(){return this.constructor.copy(this,new $(this.rows,this.columns))}},{key:"sum",value:function(t){switch(t){case"row":return function(t){for(var e=I(t.rows),n=0;n<t.rows;++n)for(var r=0;r<t.columns;++r)e[n]+=t.get(n,r);return e}(this);case"column":return function(t){for(var e=I(t.columns),n=0;n<t.rows;++n)for(var r=0;r<t.columns;++r)e[r]+=t.get(n,r);return e}(this);case void 0:return function(t){for(var e=0,n=0;n<t.rows;n++)for(var r=0;r<t.columns;r++)e+=t.get(n,r);return e}(this);default:throw new Error("invalid option: ".concat(t))}}},{key:"product",value:function(t){switch(t){case"row":return function(t){for(var e=I(t.rows,1),n=0;n<t.rows;++n)for(var r=0;r<t.columns;++r)e[n]*=t.get(n,r);return e}(this);case"column":return function(t){for(var e=I(t.columns,1),n=0;n<t.rows;++n)for(var r=0;r<t.columns;++r)e[r]*=t.get(n,r);return e}(this);case void 0:return function(t){for(var e=1,n=0;n<t.rows;n++)for(var r=0;r<t.columns;r++)e*=t.get(n,r);return e}(this);default:throw new Error("invalid option: ".concat(t))}}},{key:"mean",value:function(t){var e=this.sum(t);switch(t){case"row":for(var n=0;n<this.rows;n++)e[n]/=this.columns;return e;case"column":for(var r=0;r<this.columns;r++)e[r]/=this.rows;return e;case void 0:return e/this.size;default:throw new Error("invalid option: ".concat(t))}}},{key:"variance",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("object"===m(t)&&(e=t,t=void 0),"object"!==m(e))throw new TypeError("options must be an object");var n=e,r=n.unbiased,i=void 0===r||r,o=n.mean,a=void 0===o?this.mean(t):o;if("boolean"!=typeof i)throw new TypeError("unbiased must be a boolean");switch(t){case"row":if(!x.isAnyArray(a))throw new TypeError("mean must be an array");return z(this,i,a);case"column":if(!x.isAnyArray(a))throw new TypeError("mean must be an array");return F(this,i,a);case void 0:if("number"!=typeof a)throw new TypeError("mean must be a number");return _(this,i,a);default:throw new Error("invalid option: ".concat(t))}}},{key:"standardDeviation",value:function(t,e){"object"===m(t)&&(e=t,t=void 0);var n=this.variance(t,e);if(void 0===t)return Math.sqrt(n);for(var r=0;r<n.length;r++)n[r]=Math.sqrt(n[r]);return n}},{key:"center",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("object"===m(t)&&(e=t,t=void 0),"object"!==m(e))throw new TypeError("options must be an object");var n=e,r=n.center,i=void 0===r?this.mean(t):r;switch(t){case"row":if(!x.isAnyArray(i))throw new TypeError("center must be an array");return Z(this,i),this;case"column":if(!x.isAnyArray(i))throw new TypeError("center must be an array");return G(this,i),this;case void 0:if("number"!=typeof i)throw new TypeError("center must be a number");return V(this,i),this;default:throw new Error("invalid option: ".concat(t))}}},{key:"scale",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("object"===m(t)&&(e=t,t=void 0),"object"!==m(e))throw new TypeError("options must be an object");var n=e.scale;switch(t){case"row":if(void 0===n)n=W(this);else if(!x.isAnyArray(n))throw new TypeError("scale must be an array");return H(this,n),this;case"column":if(void 0===n)n=U(this);else if(!x.isAnyArray(n))throw new TypeError("scale must be an array");return Y(this,n),this;case void 0:if(void 0===n)n=q(this);else if("number"!=typeof n)throw new TypeError("scale must be a number");return X(this,n),this;default:throw new Error("invalid option: ".concat(t))}}},{key:"toString",value:function(t){return M(this,t)}},{key:t,value:function(){return this.entries()}},{key:"entries",value:v().mark((function t(){var e,n;return v().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e=0;case 1:if(!(e<this.rows)){t.next=12;break}n=0;case 3:if(!(n<this.columns)){t.next=9;break}return t.next=6,[e,n,this.get(e,n)];case 6:n++,t.next=3;break;case 9:e++,t.next=1;break;case 12:case"end":return t.stop()}}),t,this)}))},{key:"values",value:v().mark((function t(){var e,n;return v().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e=0;case 1:if(!(e<this.rows)){t.next=12;break}n=0;case 3:if(!(n<this.columns)){t.next=9;break}return t.next=6,this.get(e,n);case 6:n++,t.next=3;break;case 9:e++,t.next=1;break;case 12:case"end":return t.stop()}}),t,this)}))}],[{key:"from1DArray",value:function(t,e,n){if(t*e!==n.length)throw new RangeError("data length does not match given dimensions");for(var r=new $(t,e),i=0;i<t;i++)for(var o=0;o<e;o++)r.set(i,o,n[i*e+o]);return r}},{key:"rowVector",value:function(t){for(var e=new $(1,t.length),n=0;n<t.length;n++)e.set(0,n,t[n]);return e}},{key:"columnVector",value:function(t){for(var e=new $(t.length,1),n=0;n<t.length;n++)e.set(n,0,t[n]);return e}},{key:"zeros",value:function(t,e){return new $(t,e)}},{key:"ones",value:function(t,e){return new $(t,e).fill(1)}},{key:"rand",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if("object"!==m(n))throw new TypeError("options must be an object");for(var r=n.random,i=void 0===r?Math.random:r,o=new $(t,e),a=0;a<t;a++)for(var s=0;s<e;s++)o.set(a,s,i());return o}},{key:"randInt",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if("object"!==m(n))throw new TypeError("options must be an object");var r=n.min,i=void 0===r?0:r,o=n.max,a=void 0===o?1e3:o,s=n.random,l=void 0===s?Math.random:s;if(!Number.isInteger(i))throw new TypeError("min must be an integer");if(!Number.isInteger(a))throw new TypeError("max must be an integer");if(i>=a)throw new RangeError("min must be smaller than max");for(var c=a-i,u=new $(t,e),h=0;h<t;h++)for(var d=0;d<e;d++){var f=i+Math.round(l()*c);u.set(h,d,f)}return u}},{key:"eye",value:function(t,e,n){void 0===e&&(e=t),void 0===n&&(n=1);for(var r=Math.min(t,e),i=this.zeros(t,e),o=0;o<r;o++)i.set(o,o,n);return i}},{key:"diag",value:function(t,e,n){var r=t.length;void 0===e&&(e=r),void 0===n&&(n=e);for(var i=Math.min(r,e,n),o=this.zeros(e,n),a=0;a<i;a++)o.set(a,a,t[a]);return o}},{key:"min",value:function(t,e){t=this.checkMatrix(t),e=this.checkMatrix(e);for(var n=t.rows,r=t.columns,i=new $(n,r),o=0;o<n;o++)for(var a=0;a<r;a++)i.set(o,a,Math.min(t.get(o,a),e.get(o,a)));return i}},{key:"max",value:function(t,e){t=this.checkMatrix(t),e=this.checkMatrix(e);for(var n=t.rows,r=t.columns,i=new this(n,r),o=0;o<n;o++)for(var a=0;a<r;a++)i.set(o,a,Math.max(t.get(o,a),e.get(o,a)));return i}},{key:"checkMatrix",value:function(t){return e.isMatrix(t)?t:new $(t)}},{key:"isMatrix",value:function(t){return null!=t&&"Matrix"===t.klass}},{key:"copy",value:function(t,e){var n,r=g(t.entries());try{for(r.s();!(n=r.n()).done;){var i=p(n.value,3),o=i[0],a=i[1],s=i[2];e.set(o,a,s)}}catch(t){r.e(t)}finally{r.f()}return e}}]),e}(Symbol.iterator);function Q(t,e){return t-e}K.prototype.klass="Matrix","undefined"!=typeof Symbol&&(K.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return M(this)}),K.random=K.rand,K.randomInt=K.randInt,K.diagonal=K.diag,K.prototype.diagonal=K.prototype.diag,K.identity=K.eye,K.prototype.negate=K.prototype.neg,K.prototype.tensorProduct=K.prototype.kroneckerProduct;var J=new WeakSet,$=function(t){c(n,t);var e=u(n);function n(t,r){var i;if(y(this,n),i=e.call(this),h(l(i),J),d(l(i),"data",void 0),n.isMatrix(t))f(l(i),J,tt).call(l(i),t.rows,t.columns),n.copy(t,l(i));else if(Number.isInteger(t)&&t>=0)f(l(i),J,tt).call(l(i),t,r);else{if(!x.isAnyArray(t))throw new TypeError("First argument must be a positive number or an array");var o=t;if("number"!=typeof(r=(t=o.length)?o[0].length:0))throw new TypeError("Data must be a 2D array with at least one element");i.data=[];for(var a=0;a<t;a++){if(o[a].length!==r)throw new RangeError("Inconsistent array dimensions");if(!o[a].every((function(t){return"number"==typeof t})))throw new TypeError("Input data contains non-numeric values");i.data.push(Float64Array.from(o[a]))}i.rows=t,i.columns=r}return i}return b(n,[{key:"set",value:function(t,e,n){return this.data[t][e]=n,this}},{key:"get",value:function(t,e){return this.data[t][e]}},{key:"removeRow",value:function(t){return C(this,t),this.data.splice(t,1),this.rows-=1,this}},{key:"addRow",value:function(t,e){return void 0===e&&(e=t,t=this.rows),C(this,t,!0),e=Float64Array.from(T(this,e)),this.data.splice(t,0,e),this.rows+=1,this}},{key:"removeColumn",value:function(t){O(this,t);for(var e=0;e<this.rows;e++){for(var n=new Float64Array(this.columns-1),r=0;r<t;r++)n[r]=this.data[e][r];for(var i=t+1;i<this.columns;i++)n[i-1]=this.data[e][i];this.data[e]=n}return this.columns-=1,this}},{key:"addColumn",value:function(t,e){void 0===e&&(e=t,t=this.columns),O(this,t,!0),e=P(this,e);for(var n=0;n<this.rows;n++){for(var r=new Float64Array(this.columns+1),i=0;i<t;i++)r[i]=this.data[n][i];for(r[i++]=e[n];i<this.columns+1;i++)r[i]=this.data[n][i-1];this.data[n]=r}return this.columns+=1,this}}]),n}(K);function tt(t,e){if(this.data=[],!(Number.isInteger(e)&&e>=0))throw new TypeError("nColumns must be a positive integer");for(var n=0;n<t;n++)this.data.push(new Float64Array(e));this.rows=t,this.columns=e}!function(t,e){t.prototype.add=function(t){return"number"==typeof t?this.addS(t):this.addM(t)},t.prototype.addS=function(t){for(var e=0;e<this.rows;e++)for(var n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)+t);return this},t.prototype.addM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(var n=0;n<this.rows;n++)for(var r=0;r<this.columns;r++)this.set(n,r,this.get(n,r)+t.get(n,r));return this},t.add=function(t,n){return new e(t).add(n)},t.prototype.sub=function(t){return"number"==typeof t?this.subS(t):this.subM(t)},t.prototype.subS=function(t){for(var e=0;e<this.rows;e++)for(var n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)-t);return this},t.prototype.subM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(var n=0;n<this.rows;n++)for(var r=0;r<this.columns;r++)this.set(n,r,this.get(n,r)-t.get(n,r));return this},t.sub=function(t,n){return new e(t).sub(n)},t.prototype.subtract=t.prototype.sub,t.prototype.subtractS=t.prototype.subS,t.prototype.subtractM=t.prototype.subM,t.subtract=t.sub,t.prototype.mul=function(t){return"number"==typeof t?this.mulS(t):this.mulM(t)},t.prototype.mulS=function(t){for(var e=0;e<this.rows;e++)for(var n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)*t);return this},t.prototype.mulM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(var n=0;n<this.rows;n++)for(var r=0;r<this.columns;r++)this.set(n,r,this.get(n,r)*t.get(n,r));return this},t.mul=function(t,n){return new e(t).mul(n)},t.prototype.multiply=t.prototype.mul,t.prototype.multiplyS=t.prototype.mulS,t.prototype.multiplyM=t.prototype.mulM,t.multiply=t.mul,t.prototype.div=function(t){return"number"==typeof t?this.divS(t):this.divM(t)},t.prototype.divS=function(t){for(var e=0;e<this.rows;e++)for(var n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)/t);return this},t.prototype.divM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(var n=0;n<this.rows;n++)for(var r=0;r<this.columns;r++)this.set(n,r,this.get(n,r)/t.get(n,r));return this},t.div=function(t,n){return new e(t).div(n)},t.prototype.divide=t.prototype.div,t.prototype.divideS=t.prototype.divS,t.prototype.divideM=t.prototype.divM,t.divide=t.div,t.prototype.mod=function(t){return"number"==typeof t?this.modS(t):this.modM(t)},t.prototype.modS=function(t){for(var e=0;e<this.rows;e++)for(var n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)%t);return this},t.prototype.modM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(var n=0;n<this.rows;n++)for(var r=0;r<this.columns;r++)this.set(n,r,this.get(n,r)%t.get(n,r));return this},t.mod=function(t,n){return new e(t).mod(n)},t.prototype.modulus=t.prototype.mod,t.prototype.modulusS=t.prototype.modS,t.prototype.modulusM=t.prototype.modM,t.modulus=t.mod,t.prototype.and=function(t){return"number"==typeof t?this.andS(t):this.andM(t)},t.prototype.andS=function(t){for(var e=0;e<this.rows;e++)for(var n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)&t);return this},t.prototype.andM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(var n=0;n<this.rows;n++)for(var r=0;r<this.columns;r++)this.set(n,r,this.get(n,r)&t.get(n,r));return this},t.and=function(t,n){return new e(t).and(n)},t.prototype.or=function(t){return"number"==typeof t?this.orS(t):this.orM(t)},t.prototype.orS=function(t){for(var e=0;e<this.rows;e++)for(var n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)|t);return this},t.prototype.orM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(var n=0;n<this.rows;n++)for(var r=0;r<this.columns;r++)this.set(n,r,this.get(n,r)|t.get(n,r));return this},t.or=function(t,n){return new e(t).or(n)},t.prototype.xor=function(t){return"number"==typeof t?this.xorS(t):this.xorM(t)},t.prototype.xorS=function(t){for(var e=0;e<this.rows;e++)for(var n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)^t);return this},t.prototype.xorM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(var n=0;n<this.rows;n++)for(var r=0;r<this.columns;r++)this.set(n,r,this.get(n,r)^t.get(n,r));return this},t.xor=function(t,n){return new e(t).xor(n)},t.prototype.leftShift=function(t){return"number"==typeof t?this.leftShiftS(t):this.leftShiftM(t)},t.prototype.leftShiftS=function(t){for(var e=0;e<this.rows;e++)for(var n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)<<t);return this},t.prototype.leftShiftM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(var n=0;n<this.rows;n++)for(var r=0;r<this.columns;r++)this.set(n,r,this.get(n,r)<<t.get(n,r));return this},t.leftShift=function(t,n){return new e(t).leftShift(n)},t.prototype.signPropagatingRightShift=function(t){return"number"==typeof t?this.signPropagatingRightShiftS(t):this.signPropagatingRightShiftM(t)},t.prototype.signPropagatingRightShiftS=function(t){for(var e=0;e<this.rows;e++)for(var n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)>>t);return this},t.prototype.signPropagatingRightShiftM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(var n=0;n<this.rows;n++)for(var r=0;r<this.columns;r++)this.set(n,r,this.get(n,r)>>t.get(n,r));return this},t.signPropagatingRightShift=function(t,n){return new e(t).signPropagatingRightShift(n)},t.prototype.rightShift=function(t){return"number"==typeof t?this.rightShiftS(t):this.rightShiftM(t)},t.prototype.rightShiftS=function(t){for(var e=0;e<this.rows;e++)for(var n=0;n<this.columns;n++)this.set(e,n,this.get(e,n)>>>t);return this},t.prototype.rightShiftM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(var n=0;n<this.rows;n++)for(var r=0;r<this.columns;r++)this.set(n,r,this.get(n,r)>>>t.get(n,r));return this},t.rightShift=function(t,n){return new e(t).rightShift(n)},t.prototype.zeroFillRightShift=t.prototype.rightShift,t.prototype.zeroFillRightShiftS=t.prototype.rightShiftS,t.prototype.zeroFillRightShiftM=t.prototype.rightShiftM,t.zeroFillRightShift=t.rightShift,t.prototype.not=function(){for(var t=0;t<this.rows;t++)for(var e=0;e<this.columns;e++)this.set(t,e,~this.get(t,e));return this},t.not=function(t){return new e(t).not()},t.prototype.abs=function(){for(var t=0;t<this.rows;t++)for(var e=0;e<this.columns;e++)this.set(t,e,Math.abs(this.get(t,e)));return this},t.abs=function(t){return new e(t).abs()},t.prototype.acos=function(){for(var t=0;t<this.rows;t++)for(var e=0;e<this.columns;e++)this.set(t,e,Math.acos(this.get(t,e)));return this},t.acos=function(t){return new e(t).acos()},t.prototype.acosh=function(){for(var t=0;t<this.rows;t++)for(var e=0;e<this.columns;e++)this.set(t,e,Math.acosh(this.get(t,e)));return this},t.acosh=function(t){return new e(t).acosh()},t.prototype.asin=function(){for(var t=0;t<this.rows;t++)for(var e=0;e<this.columns;e++)this.set(t,e,Math.asin(this.get(t,e)));return this},t.asin=function(t){return new e(t).asin()},t.prototype.asinh=function(){for(var t=0;t<this.rows;t++)for(var e=0;e<this.columns;e++)this.set(t,e,Math.asinh(this.get(t,e)));return this},t.asinh=function(t){return new e(t).asinh()},t.prototype.atan=function(){for(var t=0;t<this.rows;t++)for(var e=0;e<this.columns;e++)this.set(t,e,Math.atan(this.get(t,e)));return this},t.atan=function(t){return new e(t).atan()},t.prototype.atanh=function(){for(var t=0;t<this.rows;t++)for(var e=0;e<this.columns;e++)this.set(t,e,Math.atanh(this.get(t,e)));return this},t.atanh=function(t){return new e(t).atanh()},t.prototype.cbrt=function(){for(var t=0;t<this.rows;t++)for(var e=0;e<this.columns;e++)this.set(t,e,Math.cbrt(this.get(t,e)));return this},t.cbrt=function(t){return new e(t).cbrt()},t.prototype.ceil=function(){for(var t=0;t<this.rows;t++)for(var e=0;e<this.columns;e++)this.set(t,e,Math.ceil(this.get(t,e)));return this},t.ceil=function(t){return new e(t).ceil()},t.prototype.clz32=function(){for(var t=0;t<this.rows;t++)for(var e=0;e<this.columns;e++)this.set(t,e,Math.clz32(this.get(t,e)));return this},t.clz32=function(t){return new e(t).clz32()},t.prototype.cos=function(){for(var t=0;t<this.rows;t++)for(var e=0;e<this.columns;e++)this.set(t,e,Math.cos(this.get(t,e)));return this},t.cos=function(t){return new e(t).cos()},t.prototype.cosh=function(){for(var t=0;t<this.rows;t++)for(var e=0;e<this.columns;e++)this.set(t,e,Math.cosh(this.get(t,e)));return this},t.cosh=function(t){return new e(t).cosh()},t.prototype.exp=function(){for(var t=0;t<this.rows;t++)for(var e=0;e<this.columns;e++)this.set(t,e,Math.exp(this.get(t,e)));return this},t.exp=function(t){return new e(t).exp()},t.prototype.expm1=function(){for(var t=0;t<this.rows;t++)for(var e=0;e<this.columns;e++)this.set(t,e,Math.expm1(this.get(t,e)));return this},t.expm1=function(t){return new e(t).expm1()},t.prototype.floor=function(){for(var t=0;t<this.rows;t++)for(var e=0;e<this.columns;e++)this.set(t,e,Math.floor(this.get(t,e)));return this},t.floor=function(t){return new e(t).floor()},t.prototype.fround=function(){for(var t=0;t<this.rows;t++)for(var e=0;e<this.columns;e++)this.set(t,e,Math.fround(this.get(t,e)));return this},t.fround=function(t){return new e(t).fround()},t.prototype.log=function(){for(var t=0;t<this.rows;t++)for(var e=0;e<this.columns;e++)this.set(t,e,Math.log(this.get(t,e)));return this},t.log=function(t){return new e(t).log()},t.prototype.log1p=function(){for(var t=0;t<this.rows;t++)for(var e=0;e<this.columns;e++)this.set(t,e,Math.log1p(this.get(t,e)));return this},t.log1p=function(t){return new e(t).log1p()},t.prototype.log10=function(){for(var t=0;t<this.rows;t++)for(var e=0;e<this.columns;e++)this.set(t,e,Math.log10(this.get(t,e)));return this},t.log10=function(t){return new e(t).log10()},t.prototype.log2=function(){for(var t=0;t<this.rows;t++)for(var e=0;e<this.columns;e++)this.set(t,e,Math.log2(this.get(t,e)));return this},t.log2=function(t){return new e(t).log2()},t.prototype.round=function(){for(var t=0;t<this.rows;t++)for(var e=0;e<this.columns;e++)this.set(t,e,Math.round(this.get(t,e)));return this},t.round=function(t){return new e(t).round()},t.prototype.sign=function(){for(var t=0;t<this.rows;t++)for(var e=0;e<this.columns;e++)this.set(t,e,Math.sign(this.get(t,e)));return this},t.sign=function(t){return new e(t).sign()},t.prototype.sin=function(){for(var t=0;t<this.rows;t++)for(var e=0;e<this.columns;e++)this.set(t,e,Math.sin(this.get(t,e)));return this},t.sin=function(t){return new e(t).sin()},t.prototype.sinh=function(){for(var t=0;t<this.rows;t++)for(var e=0;e<this.columns;e++)this.set(t,e,Math.sinh(this.get(t,e)));return this},t.sinh=function(t){return new e(t).sinh()},t.prototype.sqrt=function(){for(var t=0;t<this.rows;t++)for(var e=0;e<this.columns;e++)this.set(t,e,Math.sqrt(this.get(t,e)));return this},t.sqrt=function(t){return new e(t).sqrt()},t.prototype.tan=function(){for(var t=0;t<this.rows;t++)for(var e=0;e<this.columns;e++)this.set(t,e,Math.tan(this.get(t,e)));return this},t.tan=function(t){return new e(t).tan()},t.prototype.tanh=function(){for(var t=0;t<this.rows;t++)for(var e=0;e<this.columns;e++)this.set(t,e,Math.tanh(this.get(t,e)));return this},t.tanh=function(t){return new e(t).tanh()},t.prototype.trunc=function(){for(var t=0;t<this.rows;t++)for(var e=0;e<this.columns;e++)this.set(t,e,Math.trunc(this.get(t,e)));return this},t.trunc=function(t){return new e(t).trunc()},t.pow=function(t,n){return new e(t).pow(n)},t.prototype.pow=function(t){return"number"==typeof t?this.powS(t):this.powM(t)},t.prototype.powS=function(t){for(var e=0;e<this.rows;e++)for(var n=0;n<this.columns;n++)this.set(e,n,Math.pow(this.get(e,n),t));return this},t.prototype.powM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(var n=0;n<this.rows;n++)for(var r=0;r<this.columns;r++)this.set(n,r,Math.pow(this.get(n,r),t.get(n,r)));return this}}(K,$);var et=new WeakMap,nt=function(t){c(n,t);var e=u(n);function n(t){var r;if(y(this,n),r=e.call(this),o(l(r),et,{writable:!0,value:void 0}),$.isMatrix(t)){if(!t.isSymmetric())throw new TypeError("not symmetric data");a(l(r),et,$.copy(t,new $(t.rows,t.rows)))}else if(Number.isInteger(t)&&t>=0)a(l(r),et,new $(t,t));else if(a(l(r),et,new $(t)),!r.isSymmetric())throw new TypeError("not symmetric data");return r}return b(n,[{key:"size",get:function(){return s(this,et).size}},{key:"rows",get:function(){return s(this,et).rows}},{key:"columns",get:function(){return s(this,et).columns}},{key:"diagonalSize",get:function(){return this.rows}},{key:"clone",value:function(){var t,e=new n(this.diagonalSize),r=g(this.upperRightEntries());try{for(r.s();!(t=r.n()).done;){var i=p(t.value,3),o=i[0],a=i[1],s=i[2];e.set(o,a,s)}}catch(t){r.e(t)}finally{r.f()}return e}},{key:"toMatrix",value:function(){return new $(this)}},{key:"get",value:function(t,e){return s(this,et).get(t,e)}},{key:"set",value:function(t,e,n){return s(this,et).set(t,e,n),s(this,et).set(e,t,n),this}},{key:"removeCross",value:function(t){return s(this,et).removeRow(t),s(this,et).removeColumn(t),this}},{key:"addCross",value:function(t,e){void 0===e&&(e=t,t=this.diagonalSize);var n=e.slice();return n.splice(t,1),s(this,et).addRow(t,n),s(this,et).addColumn(t,e),this}},{key:"applyMask",value:function(t){if(t.length!==this.diagonalSize)throw new RangeError("Mask size do not match with matrix size");var e,n=[],r=g(t.entries());try{for(r.s();!(e=r.n()).done;){var i=p(e.value,2),o=i[0];i[1]||n.push(o)}}catch(t){r.e(t)}finally{r.f()}n.reverse();for(var a=0,s=n;a<s.length;a++){var l=s[a];this.removeCross(l)}return this}},{key:"toCompact",value:function(){for(var t=this.diagonalSize,e=new Array(t*(t+1)/2),n=0,r=0,i=0;i<e.length;i++)e[i]=this.get(r,n),++n>=t&&(n=++r);return e}},{key:"upperRightEntries",value:v().mark((function t(){var e,n,r;return v().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e=0,n=0;case 1:if(!(e<this.diagonalSize)){t.next=9;break}return r=this.get(e,n),t.next=5,[e,n,r];case 5:++n>=this.diagonalSize&&(n=++e);case 6:t.next=1;break;case 9:case"end":return t.stop()}}),t,this)}))},{key:"upperRightValues",value:v().mark((function t(){var e,n,r;return v().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e=0,n=0;case 1:if(!(e<this.diagonalSize)){t.next=9;break}return r=this.get(e,n),t.next=5,r;case 5:++n>=this.diagonalSize&&(n=++e);case 6:t.next=1;break;case 9:case"end":return t.stop()}}),t,this)}))}],[{key:"isSymmetricMatrix",value:function(t){return $.isMatrix(t)&&"SymmetricMatrix"===t.klassType}},{key:"zeros",value:function(t){return new this(t)}},{key:"ones",value:function(t){return new this(t).fill(1)}},{key:"fromCompact",value:function(t){var e=t.length,r=(Math.sqrt(8*e+1)-1)/2;if(!Number.isInteger(r))throw new TypeError("This array is not a compact representation of a Symmetric Matrix, ".concat(JSON.stringify(t)));for(var i=new n(r),o=0,a=0,s=0;s<e;s++)i.set(o,a,t[s]),++o>=r&&(o=++a);return i}}]),n}(K);nt.prototype.klassType="SymmetricMatrix";var rt=function(t){c(n,t);var e=u(n);function n(t){var r;if(y(this,n),!(r=e.call(this,t)).isDistance())throw new TypeError("Provided arguments do no produce a distance matrix");return r}return b(n,[{key:"set",value:function(t,e,o){return t===e&&(o=0),r(i(n.prototype),"set",this).call(this,t,e,o)}},{key:"addCross",value:function(t,e){return void 0===e&&(e=t,t=this.diagonalSize),(e=e.slice())[t]=0,r(i(n.prototype),"addCross",this).call(this,t,e)}},{key:"toSymmetricMatrix",value:function(){return new nt(this)}},{key:"clone",value:function(){var t,e=new n(this.diagonalSize),r=g(this.upperRightEntries());try{for(r.s();!(t=r.n()).done;){var i=p(t.value,3),o=i[0],a=i[1],s=i[2];o!==a&&e.set(o,a,s)}}catch(t){r.e(t)}finally{r.f()}return e}},{key:"toCompact",value:function(){for(var t=this.diagonalSize,e=new Array((t-1)*t/2),n=1,r=0,i=0;i<e.length;i++)e[i]=this.get(r,n),++n>=t&&(n=1+ ++r);return e}}],[{key:"isDistanceMatrix",value:function(t){return nt.isSymmetricMatrix(t)&&"DistanceMatrix"===t.klassSubType}},{key:"fromCompact",value:function(t){var e=t.length;if(0===e)return new this(0);var n=(Math.sqrt(8*e+1)+1)/2;if(!Number.isInteger(n))throw new TypeError("This array is not a compact representation of a DistanceMatrix, ".concat(JSON.stringify(t)));for(var r=new this(n),i=1,o=0,a=0;a<e;a++)r.set(i,o,t[a]),++i>=n&&(i=1+ ++o);return r}}]),n}(nt);rt.prototype.klassSubType="DistanceMatrix";var it=function(t){c(n,t);var e=u(n);function n(t,r,i){var o;return y(this,n),(o=e.call(this)).matrix=t,o.rows=r,o.columns=i,o}return b(n)}(K),ot=function(t){c(n,t);var e=u(n);function n(t,r){var i;return y(this,n),O(t,r),(i=e.call(this,t,t.rows,1)).column=r,i}return b(n,[{key:"set",value:function(t,e,n){return this.matrix.set(t,this.column,n),this}},{key:"get",value:function(t){return this.matrix.get(t,this.column)}}]),n}(it),at=function(t){c(n,t);var e=u(n);function n(t,r){var i;return y(this,n),D(t,r),(i=e.call(this,t,t.rows,r.length)).columnIndices=r,i}return b(n,[{key:"set",value:function(t,e,n){return this.matrix.set(t,this.columnIndices[e],n),this}},{key:"get",value:function(t,e){return this.matrix.get(t,this.columnIndices[e])}}]),n}(it),st=function(t){c(n,t);var e=u(n);function n(t){return y(this,n),e.call(this,t,t.rows,t.columns)}return b(n,[{key:"set",value:function(t,e,n){return this.matrix.set(t,this.columns-e-1,n),this}},{key:"get",value:function(t,e){return this.matrix.get(t,this.columns-e-1)}}]),n}(it),lt=function(t){c(n,t);var e=u(n);function n(t){return y(this,n),e.call(this,t,t.rows,t.columns)}return b(n,[{key:"set",value:function(t,e,n){return this.matrix.set(this.rows-t-1,e,n),this}},{key:"get",value:function(t,e){return this.matrix.get(this.rows-t-1,e)}}]),n}(it),ct=function(t){c(n,t);var e=u(n);function n(t,r){var i;return y(this,n),C(t,r),(i=e.call(this,t,1,t.columns)).row=r,i}return b(n,[{key:"set",value:function(t,e,n){return this.matrix.set(this.row,e,n),this}},{key:"get",value:function(t,e){return this.matrix.get(this.row,e)}}]),n}(it),ut=function(t){c(n,t);var e=u(n);function n(t,r){var i;return y(this,n),R(t,r),(i=e.call(this,t,r.length,t.columns)).rowIndices=r,i}return b(n,[{key:"set",value:function(t,e,n){return this.matrix.set(this.rowIndices[t],e,n),this}},{key:"get",value:function(t,e){return this.matrix.get(this.rowIndices[t],e)}}]),n}(it),ht=function(t){c(n,t);var e=u(n);function n(t,r,i){var o;return y(this,n),R(t,r),D(t,i),(o=e.call(this,t,r.length,i.length)).rowIndices=r,o.columnIndices=i,o}return b(n,[{key:"set",value:function(t,e,n){return this.matrix.set(this.rowIndices[t],this.columnIndices[e],n),this}},{key:"get",value:function(t,e){return this.matrix.get(this.rowIndices[t],this.columnIndices[e])}}]),n}(it),dt=function(t){c(n,t);var e=u(n);function n(t,r,i,o,a){var s;return y(this,n),L(t,r,i,o,a),(s=e.call(this,t,i-r+1,a-o+1)).startRow=r,s.startColumn=o,s}return b(n,[{key:"set",value:function(t,e,n){return this.matrix.set(this.startRow+t,this.startColumn+e,n),this}},{key:"get",value:function(t,e){return this.matrix.get(this.startRow+t,this.startColumn+e)}}]),n}(it),ft=function(t){c(n,t);var e=u(n);function n(t){return y(this,n),e.call(this,t,t.columns,t.rows)}return b(n,[{key:"set",value:function(t,e,n){return this.matrix.set(e,t,n),this}},{key:"get",value:function(t,e){return this.matrix.get(e,t)}}]),n}(it),pt=function(t){c(n,t);var e=u(n);function n(t){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};y(this,n);var o=i.rows,a=void 0===o?1:o;if(t.length%a!=0)throw new Error("the data length is not divisible by the number of rows");return(r=e.call(this)).rows=a,r.columns=t.length/a,r.data=t,r}return b(n,[{key:"set",value:function(t,e,n){var r=this._calculateIndex(t,e);return this.data[r]=n,this}},{key:"get",value:function(t,e){var n=this._calculateIndex(t,e);return this.data[n]}},{key:"_calculateIndex",value:function(t,e){return t*this.columns+e}}]),n}(K),gt=function(t){c(n,t);var e=u(n);function n(t){var r;return y(this,n),(r=e.call(this)).data=t,r.rows=t.length,r.columns=t[0].length,r}return b(n,[{key:"set",value:function(t,e,n){return this.data[t][e]=n,this}},{key:"get",value:function(t,e){return this.data[t][e]}}]),n}(K);var vt=function(){function t(e){y(this,t);var n,r,i,o,a,s,l,c,u,h=(e=gt.checkMatrix(e)).clone(),d=h.rows,f=h.columns,p=new Float64Array(d),g=1;for(n=0;n<d;n++)p[n]=n;for(c=new Float64Array(d),r=0;r<f;r++){for(n=0;n<d;n++)c[n]=h.get(n,r);for(n=0;n<d;n++){for(u=Math.min(n,r),a=0,i=0;i<u;i++)a+=h.get(n,i)*c[i];c[n]-=a,h.set(n,r,c[n])}for(o=r,n=r+1;n<d;n++)Math.abs(c[n])>Math.abs(c[o])&&(o=n);if(o!==r){for(i=0;i<f;i++)s=h.get(o,i),h.set(o,i,h.get(r,i)),h.set(r,i,s);l=p[o],p[o]=p[r],p[r]=l,g=-g}if(r<d&&0!==h.get(r,r))for(n=r+1;n<d;n++)h.set(n,r,h.get(n,r)/h.get(r,r))}this.LU=h,this.pivotVector=p,this.pivotSign=g}return b(t,[{key:"isSingular",value:function(){for(var t=this.LU,e=t.columns,n=0;n<e;n++)if(0===t.get(n,n))return!0;return!1}},{key:"solve",value:function(t){t=$.checkMatrix(t);var e=this.LU;if(e.rows!==t.rows)throw new Error("Invalid matrix dimensions");if(this.isSingular())throw new Error("LU matrix is singular");var n,r,i,o=t.columns,a=t.subMatrixRow(this.pivotVector,0,o-1),s=e.columns;for(i=0;i<s;i++)for(n=i+1;n<s;n++)for(r=0;r<o;r++)a.set(n,r,a.get(n,r)-a.get(i,r)*e.get(n,i));for(i=s-1;i>=0;i--){for(r=0;r<o;r++)a.set(i,r,a.get(i,r)/e.get(i,i));for(n=0;n<i;n++)for(r=0;r<o;r++)a.set(n,r,a.get(n,r)-a.get(i,r)*e.get(n,i))}return a}},{key:"determinant",get:function(){var t=this.LU;if(!t.isSquare())throw new Error("Matrix must be square");for(var e=this.pivotSign,n=t.columns,r=0;r<n;r++)e*=t.get(r,r);return e}},{key:"lowerTriangularMatrix",get:function(){for(var t=this.LU,e=t.rows,n=t.columns,r=new $(e,n),i=0;i<e;i++)for(var o=0;o<n;o++)i>o?r.set(i,o,t.get(i,o)):i===o?r.set(i,o,1):r.set(i,o,0);return r}},{key:"upperTriangularMatrix",get:function(){for(var t=this.LU,e=t.rows,n=t.columns,r=new $(e,n),i=0;i<e;i++)for(var o=0;o<n;o++)i<=o?r.set(i,o,t.get(i,o)):r.set(i,o,0);return r}},{key:"pivotPermutationVector",get:function(){return Array.from(this.pivotVector)}}]),t}();function mt(t,e){var n=0;return Math.abs(t)>Math.abs(e)?(n=e/t,Math.abs(t)*Math.sqrt(1+n*n)):0!==e?(n=t/e,Math.abs(e)*Math.sqrt(1+n*n)):0}var yt=function(){function t(e){y(this,t);var n,r,i,o,a=(e=gt.checkMatrix(e)).clone(),s=e.rows,l=e.columns,c=new Float64Array(l);for(i=0;i<l;i++){var u=0;for(n=i;n<s;n++)u=mt(u,a.get(n,i));if(0!==u){for(a.get(i,i)<0&&(u=-u),n=i;n<s;n++)a.set(n,i,a.get(n,i)/u);for(a.set(i,i,a.get(i,i)+1),r=i+1;r<l;r++){for(o=0,n=i;n<s;n++)o+=a.get(n,i)*a.get(n,r);for(o=-o/a.get(i,i),n=i;n<s;n++)a.set(n,r,a.get(n,r)+o*a.get(n,i))}}c[i]=-u}this.QR=a,this.Rdiag=c}return b(t,[{key:"solve",value:function(t){t=$.checkMatrix(t);var e=this.QR,n=e.rows;if(t.rows!==n)throw new Error("Matrix row dimensions must agree");if(!this.isFullRank())throw new Error("Matrix is rank deficient");var r,i,o,a,s=t.columns,l=t.clone(),c=e.columns;for(o=0;o<c;o++)for(i=0;i<s;i++){for(a=0,r=o;r<n;r++)a+=e.get(r,o)*l.get(r,i);for(a=-a/e.get(o,o),r=o;r<n;r++)l.set(r,i,l.get(r,i)+a*e.get(r,o))}for(o=c-1;o>=0;o--){for(i=0;i<s;i++)l.set(o,i,l.get(o,i)/this.Rdiag[o]);for(r=0;r<o;r++)for(i=0;i<s;i++)l.set(r,i,l.get(r,i)-l.get(o,i)*e.get(r,o))}return l.subMatrix(0,c-1,0,s-1)}},{key:"isFullRank",value:function(){for(var t=this.QR.columns,e=0;e<t;e++)if(0===this.Rdiag[e])return!1;return!0}},{key:"upperTriangularMatrix",get:function(){var t,e,n=this.QR,r=n.columns,i=new $(r,r);for(t=0;t<r;t++)for(e=0;e<r;e++)t<e?i.set(t,e,n.get(t,e)):t===e?i.set(t,e,this.Rdiag[t]):i.set(t,e,0);return i}},{key:"orthogonalMatrix",get:function(){var t,e,n,r,i=this.QR,o=i.rows,a=i.columns,s=new $(o,a);for(n=a-1;n>=0;n--){for(t=0;t<o;t++)s.set(t,n,0);for(s.set(n,n,1),e=n;e<a;e++)if(0!==i.get(n,n)){for(r=0,t=n;t<o;t++)r+=i.get(t,n)*s.get(t,e);for(r=-r/i.get(n,n),t=n;t<o;t++)s.set(t,e,s.get(t,e)+r*i.get(t,n))}}return s}}]),t}(),bt=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(y(this,t),(e=gt.checkMatrix(e)).isEmpty())throw new Error("Matrix must be non-empty");var r,i=e.rows,o=e.columns,a=n.computeLeftSingularVectors,s=void 0===a||a,l=n.computeRightSingularVectors,c=void 0===l||l,u=n.autoTranspose,h=void 0!==u&&u,d=Boolean(s),f=Boolean(c),p=!1;if(i<o)if(h){i=(r=e.transpose()).rows,o=r.columns,p=!0;var g=d;d=f,f=g}else r=e.clone(),console.warn("Computing SVD on a matrix with more columns than rows. Consider enabling autoTranspose");else r=e.clone();for(var v=Math.min(i,o),m=Math.min(i+1,o),b=new Float64Array(m),x=new $(i,v),E=new $(o,o),w=new Float64Array(o),k=new Float64Array(i),M=new Float64Array(m),S=0;S<m;S++)M[S]=S;for(var A=Math.min(i-1,o),N=Math.max(0,Math.min(o-2,i)),C=Math.max(A,N),O=0;O<C;O++){if(O<A){b[O]=0;for(var T=O;T<i;T++)b[O]=mt(b[O],r.get(T,O));if(0!==b[O]){r.get(O,O)<0&&(b[O]=-b[O]);for(var P=O;P<i;P++)r.set(P,O,r.get(P,O)/b[O]);r.set(O,O,r.get(O,O)+1)}b[O]=-b[O]}for(var R=O+1;R<o;R++){if(O<A&&0!==b[O]){for(var D=0,L=O;L<i;L++)D+=r.get(L,O)*r.get(L,R);D=-D/r.get(O,O);for(var I=O;I<i;I++)r.set(I,R,r.get(I,R)+D*r.get(I,O))}w[R]=r.get(O,R)}if(d&&O<A)for(var B=O;B<i;B++)x.set(B,O,r.get(B,O));if(O<N){w[O]=0;for(var j=O+1;j<o;j++)w[O]=mt(w[O],w[j]);if(0!==w[O]){w[O+1]<0&&(w[O]=0-w[O]);for(var z=O+1;z<o;z++)w[z]/=w[O];w[O+1]+=1}if(w[O]=-w[O],O+1<i&&0!==w[O]){for(var F=O+1;F<i;F++)k[F]=0;for(var _=O+1;_<i;_++)for(var Z=O+1;Z<o;Z++)k[_]+=w[Z]*r.get(_,Z);for(var G=O+1;G<o;G++)for(var V=-w[G]/w[O+1],W=O+1;W<i;W++)r.set(W,G,r.get(W,G)+V*k[W])}if(f)for(var H=O+1;H<o;H++)E.set(H,O,w[H])}}var U=Math.min(o,i+1);if(A<o&&(b[A]=r.get(A,A)),i<U&&(b[U-1]=0),N+1<U&&(w[N]=r.get(N,U-1)),w[U-1]=0,d){for(var Y=A;Y<v;Y++){for(var q=0;q<i;q++)x.set(q,Y,0);x.set(Y,Y,1)}for(var X=A-1;X>=0;X--)if(0!==b[X]){for(var K=X+1;K<v;K++){for(var Q=0,J=X;J<i;J++)Q+=x.get(J,X)*x.get(J,K);Q=-Q/x.get(X,X);for(var tt=X;tt<i;tt++)x.set(tt,K,x.get(tt,K)+Q*x.get(tt,X))}for(var et=X;et<i;et++)x.set(et,X,-x.get(et,X));x.set(X,X,1+x.get(X,X));for(var nt=0;nt<X-1;nt++)x.set(nt,X,0)}else{for(var rt=0;rt<i;rt++)x.set(rt,X,0);x.set(X,X,1)}}if(f)for(var it=o-1;it>=0;it--){if(it<N&&0!==w[it])for(var ot=it+1;ot<o;ot++){for(var at=0,st=it+1;st<o;st++)at+=E.get(st,it)*E.get(st,ot);at=-at/E.get(it+1,it);for(var lt=it+1;lt<o;lt++)E.set(lt,ot,E.get(lt,ot)+at*E.get(lt,it))}for(var ct=0;ct<o;ct++)E.set(ct,it,0);E.set(it,it,1)}for(var ut=U-1,ht=Number.EPSILON;U>0;){var dt=void 0,ft=void 0;for(dt=U-2;dt>=-1&&-1!==dt;dt--){var pt=Number.MIN_VALUE+ht*Math.abs(b[dt]+Math.abs(b[dt+1]));if(Math.abs(w[dt])<=pt||Number.isNaN(w[dt])){w[dt]=0;break}}if(dt===U-2)ft=4;else{var vt=void 0;for(vt=U-1;vt>=dt&&vt!==dt;vt--){var yt=(vt!==U?Math.abs(w[vt]):0)+(vt!==dt+1?Math.abs(w[vt-1]):0);if(Math.abs(b[vt])<=ht*yt){b[vt]=0;break}}vt===dt?ft=3:vt===U-1?ft=1:(ft=2,dt=vt)}switch(dt++,ft){case 1:var bt=w[U-2];w[U-2]=0;for(var xt=U-2;xt>=dt;xt--){var Et=mt(b[xt],bt),wt=b[xt]/Et,kt=bt/Et;if(b[xt]=Et,xt!==dt&&(bt=-kt*w[xt-1],w[xt-1]=wt*w[xt-1]),f)for(var Mt=0;Mt<o;Mt++)Et=wt*E.get(Mt,xt)+kt*E.get(Mt,U-1),E.set(Mt,U-1,-kt*E.get(Mt,xt)+wt*E.get(Mt,U-1)),E.set(Mt,xt,Et)}break;case 2:var St=w[dt-1];w[dt-1]=0;for(var At=dt;At<U;At++){var Nt=mt(b[At],St),Ct=b[At]/Nt,Ot=St/Nt;if(b[At]=Nt,St=-Ot*w[At],w[At]=Ct*w[At],d)for(var Tt=0;Tt<i;Tt++)Nt=Ct*x.get(Tt,At)+Ot*x.get(Tt,dt-1),x.set(Tt,dt-1,-Ot*x.get(Tt,At)+Ct*x.get(Tt,dt-1)),x.set(Tt,At,Nt)}break;case 3:var Pt=Math.max(Math.abs(b[U-1]),Math.abs(b[U-2]),Math.abs(w[U-2]),Math.abs(b[dt]),Math.abs(w[dt])),Rt=b[U-1]/Pt,Dt=b[U-2]/Pt,Lt=w[U-2]/Pt,It=b[dt]/Pt,Bt=w[dt]/Pt,jt=((Dt+Rt)*(Dt-Rt)+Lt*Lt)/2,zt=Rt*Lt*(Rt*Lt),Ft=0;0===jt&&0===zt||(Ft=zt/(jt+(Ft=jt<0?0-Math.sqrt(jt*jt+zt):Math.sqrt(jt*jt+zt))));for(var _t=(It+Rt)*(It-Rt)+Ft,Zt=It*Bt,Gt=dt;Gt<U-1;Gt++){var Vt=mt(_t,Zt);0===Vt&&(Vt=Number.MIN_VALUE);var Wt=_t/Vt,Ht=Zt/Vt;if(Gt!==dt&&(w[Gt-1]=Vt),_t=Wt*b[Gt]+Ht*w[Gt],w[Gt]=Wt*w[Gt]-Ht*b[Gt],Zt=Ht*b[Gt+1],b[Gt+1]=Wt*b[Gt+1],f)for(var Ut=0;Ut<o;Ut++)Vt=Wt*E.get(Ut,Gt)+Ht*E.get(Ut,Gt+1),E.set(Ut,Gt+1,-Ht*E.get(Ut,Gt)+Wt*E.get(Ut,Gt+1)),E.set(Ut,Gt,Vt);if(0===(Vt=mt(_t,Zt))&&(Vt=Number.MIN_VALUE),Wt=_t/Vt,Ht=Zt/Vt,b[Gt]=Vt,_t=Wt*w[Gt]+Ht*b[Gt+1],b[Gt+1]=-Ht*w[Gt]+Wt*b[Gt+1],Zt=Ht*w[Gt+1],w[Gt+1]=Wt*w[Gt+1],d&&Gt<i-1)for(var Yt=0;Yt<i;Yt++)Vt=Wt*x.get(Yt,Gt)+Ht*x.get(Yt,Gt+1),x.set(Yt,Gt+1,-Ht*x.get(Yt,Gt)+Wt*x.get(Yt,Gt+1)),x.set(Yt,Gt,Vt)}w[U-2]=_t;break;case 4:if(b[dt]<=0&&(b[dt]=b[dt]<0?-b[dt]:0,f))for(var qt=0;qt<=ut;qt++)E.set(qt,dt,-E.get(qt,dt));for(;dt<ut&&!(b[dt]>=b[dt+1]);){var Xt=b[dt];if(b[dt]=b[dt+1],b[dt+1]=Xt,f&&dt<o-1)for(var Kt=0;Kt<o;Kt++)Xt=E.get(Kt,dt+1),E.set(Kt,dt+1,E.get(Kt,dt)),E.set(Kt,dt,Xt);if(d&&dt<i-1)for(var Qt=0;Qt<i;Qt++)Xt=x.get(Qt,dt+1),x.set(Qt,dt+1,x.get(Qt,dt)),x.set(Qt,dt,Xt);dt++}U--}}if(p){var Jt=E;E=x,x=Jt}this.m=i,this.n=o,this.s=b,this.U=x,this.V=E}return b(t,[{key:"solve",value:function(t){for(var e=t,n=this.threshold,r=this.s.length,i=$.zeros(r,r),o=0;o<r;o++)Math.abs(this.s[o])<=n?i.set(o,o,0):i.set(o,o,1/this.s[o]);for(var a=this.U,s=this.rightSingularVectors,l=s.mmul(i),c=s.rows,u=a.rows,h=$.zeros(c,u),d=0;d<c;d++)for(var f=0;f<u;f++){for(var p=0,g=0;g<r;g++)p+=l.get(d,g)*a.get(f,g);h.set(d,f,p)}return h.mmul(e)}},{key:"solveForDiagonal",value:function(t){return this.solve($.diag(t))}},{key:"inverse",value:function(){for(var t=this.V,e=this.threshold,n=t.rows,r=t.columns,i=new $(n,this.s.length),o=0;o<n;o++)for(var a=0;a<r;a++)Math.abs(this.s[a])>e&&i.set(o,a,t.get(o,a)/this.s[a]);for(var s=this.U,l=s.rows,c=s.columns,u=new $(n,l),h=0;h<n;h++)for(var d=0;d<l;d++){for(var f=0,p=0;p<c;p++)f+=i.get(h,p)*s.get(d,p);u.set(h,d,f)}return u}},{key:"condition",get:function(){return this.s[0]/this.s[Math.min(this.m,this.n)-1]}},{key:"norm2",get:function(){return this.s[0]}},{key:"rank",get:function(){for(var t=Math.max(this.m,this.n)*this.s[0]*Number.EPSILON,e=0,n=this.s,r=0,i=n.length;r<i;r++)n[r]>t&&e++;return e}},{key:"diagonal",get:function(){return Array.from(this.s)}},{key:"threshold",get:function(){return Number.EPSILON/2*Math.max(this.m,this.n)*this.s[0]}},{key:"leftSingularVectors",get:function(){return this.U}},{key:"rightSingularVectors",get:function(){return this.V}},{key:"diagonalMatrix",get:function(){return $.diag(this.s)}}]),t}();function xt(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return t=gt.checkMatrix(t),e=gt.checkMatrix(e),n?new bt(t).solve(e):t.isSquare()?new vt(t).solve(e):new yt(t).solve(e)}function Et(t,e){for(var n=[],r=0;r<t;r++)r!==e&&n.push(r);return n}function wt(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1e-9,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1e-9;if(t>i)return new Array(e.rows+1).fill(0);for(var o=e.addRow(n,[0]),a=0;a<o.rows;a++)Math.abs(o.get(a,0))<r&&o.set(a,0,0);return o.to1DArray()}var kt=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};y(this,t);var r=n.assumeSymmetric,i=void 0!==r&&r;if(!(e=gt.checkMatrix(e)).isSquare())throw new Error("Matrix is not a square matrix");if(e.isEmpty())throw new Error("Matrix must be non-empty");var o,a,s=e.columns,l=new $(s,s),c=new Float64Array(s),u=new Float64Array(s),h=e;if(!!i||e.isSymmetric()){for(o=0;o<s;o++)for(a=0;a<s;a++)l.set(o,a,h.get(o,a));Mt(s,u,c,l),St(s,u,c,l)}else{var d=new $(s,s),f=new Float64Array(s);for(a=0;a<s;a++)for(o=0;o<s;o++)d.set(o,a,h.get(o,a));At(s,d,f,l),Nt(s,u,c,l,d)}this.n=s,this.e=u,this.d=c,this.V=l}return b(t,[{key:"realEigenvalues",get:function(){return Array.from(this.d)}},{key:"imaginaryEigenvalues",get:function(){return Array.from(this.e)}},{key:"eigenvectorMatrix",get:function(){return this.V}},{key:"diagonalMatrix",get:function(){var t,e,n=this.n,r=this.e,i=this.d,o=new $(n,n);for(t=0;t<n;t++){for(e=0;e<n;e++)o.set(t,e,0);o.set(t,t,i[t]),r[t]>0?o.set(t,t+1,r[t]):r[t]<0&&o.set(t,t-1,r[t])}return o}}]),t}();function Mt(t,e,n,r){var i,o,a,s,l,c,u,h;for(l=0;l<t;l++)n[l]=r.get(t-1,l);for(s=t-1;s>0;s--){for(h=0,a=0,c=0;c<s;c++)h+=Math.abs(n[c]);if(0===h)for(e[s]=n[s-1],l=0;l<s;l++)n[l]=r.get(s-1,l),r.set(s,l,0),r.set(l,s,0);else{for(c=0;c<s;c++)n[c]/=h,a+=n[c]*n[c];for(i=n[s-1],o=Math.sqrt(a),i>0&&(o=-o),e[s]=h*o,a-=i*o,n[s-1]=i-o,l=0;l<s;l++)e[l]=0;for(l=0;l<s;l++){for(i=n[l],r.set(l,s,i),o=e[l]+r.get(l,l)*i,c=l+1;c<=s-1;c++)o+=r.get(c,l)*n[c],e[c]+=r.get(c,l)*i;e[l]=o}for(i=0,l=0;l<s;l++)e[l]/=a,i+=e[l]*n[l];for(u=i/(a+a),l=0;l<s;l++)e[l]-=u*n[l];for(l=0;l<s;l++){for(i=n[l],o=e[l],c=l;c<=s-1;c++)r.set(c,l,r.get(c,l)-(i*e[c]+o*n[c]));n[l]=r.get(s-1,l),r.set(s,l,0)}}n[s]=a}for(s=0;s<t-1;s++){if(r.set(t-1,s,r.get(s,s)),r.set(s,s,1),0!==(a=n[s+1])){for(c=0;c<=s;c++)n[c]=r.get(c,s+1)/a;for(l=0;l<=s;l++){for(o=0,c=0;c<=s;c++)o+=r.get(c,s+1)*r.get(c,l);for(c=0;c<=s;c++)r.set(c,l,r.get(c,l)-o*n[c])}}for(c=0;c<=s;c++)r.set(c,s+1,0)}for(l=0;l<t;l++)n[l]=r.get(t-1,l),r.set(t-1,l,0);r.set(t-1,t-1,1),e[0]=0}function St(t,e,n,r){var i,o,a,s,l,c,u,h,d,f,p,g,v,m,y,b;for(a=1;a<t;a++)e[a-1]=e[a];e[t-1]=0;var x=0,E=0,w=Number.EPSILON;for(c=0;c<t;c++){for(E=Math.max(E,Math.abs(n[c])+Math.abs(e[c])),u=c;u<t&&!(Math.abs(e[u])<=w*E);)u++;if(u>c)do{for(i=n[c],d=mt(h=(n[c+1]-i)/(2*e[c]),1),h<0&&(d=-d),n[c]=e[c]/(h+d),n[c+1]=e[c]*(h+d),f=n[c+1],o=i-n[c],a=c+2;a<t;a++)n[a]-=o;for(x+=o,h=n[u],g=p=1,v=p,m=e[c+1],y=0,b=0,a=u-1;a>=c;a--)for(v=g,g=p,b=y,i=p*e[a],o=p*h,d=mt(h,e[a]),e[a+1]=y*d,y=e[a]/d,h=(p=h/d)*n[a]-y*i,n[a+1]=o+y*(p*i+y*n[a]),l=0;l<t;l++)o=r.get(l,a+1),r.set(l,a+1,y*r.get(l,a)+p*o),r.set(l,a,p*r.get(l,a)-y*o);h=-y*b*v*m*e[c]/f,e[c]=y*h,n[c]=p*h}while(Math.abs(e[c])>w*E);n[c]=n[c]+x,e[c]=0}for(a=0;a<t-1;a++){for(l=a,h=n[a],s=a+1;s<t;s++)n[s]<h&&(l=s,h=n[s]);if(l!==a)for(n[l]=n[a],n[a]=h,s=0;s<t;s++)h=r.get(s,a),r.set(s,a,r.get(s,l)),r.set(s,l,h)}}function At(t,e,n,r){var i,o,a,s,l,c,u,h=t-1;for(c=1;c<=h-1;c++){for(u=0,s=c;s<=h;s++)u+=Math.abs(e.get(s,c-1));if(0!==u){for(a=0,s=h;s>=c;s--)n[s]=e.get(s,c-1)/u,a+=n[s]*n[s];for(o=Math.sqrt(a),n[c]>0&&(o=-o),a-=n[c]*o,n[c]=n[c]-o,l=c;l<t;l++){for(i=0,s=h;s>=c;s--)i+=n[s]*e.get(s,l);for(i/=a,s=c;s<=h;s++)e.set(s,l,e.get(s,l)-i*n[s])}for(s=0;s<=h;s++){for(i=0,l=h;l>=c;l--)i+=n[l]*e.get(s,l);for(i/=a,l=c;l<=h;l++)e.set(s,l,e.get(s,l)-i*n[l])}n[c]=u*n[c],e.set(c,c-1,u*o)}}for(s=0;s<t;s++)for(l=0;l<t;l++)r.set(s,l,s===l?1:0);for(c=h-1;c>=1;c--)if(0!==e.get(c,c-1)){for(s=c+1;s<=h;s++)n[s]=e.get(s,c-1);for(l=c;l<=h;l++){for(o=0,s=c;s<=h;s++)o+=n[s]*r.get(s,l);for(o=o/n[c]/e.get(c,c-1),s=c;s<=h;s++)r.set(s,l,r.get(s,l)+o*n[s])}}}function Nt(t,e,n,r,i){var o,a,s,l,c,u,h,d,f,p,g,v,m,y,b,x=t-1,E=t-1,w=Number.EPSILON,k=0,M=0,S=0,A=0,N=0,C=0,O=0,T=0;for(o=0;o<t;o++)for((o<0||o>E)&&(n[o]=i.get(o,o),e[o]=0),a=Math.max(o-1,0);a<t;a++)M+=Math.abs(i.get(o,a));for(;x>=0;){for(l=x;l>0&&(0===(C=Math.abs(i.get(l-1,l-1))+Math.abs(i.get(l,l)))&&(C=M),!(Math.abs(i.get(l,l-1))<w*C));)l--;if(l===x)i.set(x,x,i.get(x,x)+k),n[x]=i.get(x,x),e[x]=0,x--,T=0;else if(l===x-1){if(h=i.get(x,x-1)*i.get(x-1,x),A=(S=(i.get(x-1,x-1)-i.get(x,x))/2)*S+h,O=Math.sqrt(Math.abs(A)),i.set(x,x,i.get(x,x)+k),i.set(x-1,x-1,i.get(x-1,x-1)+k),d=i.get(x,x),A>=0){for(O=S>=0?S+O:S-O,n[x-1]=d+O,n[x]=n[x-1],0!==O&&(n[x]=d-h/O),e[x-1]=0,e[x]=0,S=(d=i.get(x,x-1))/(C=Math.abs(d)+Math.abs(O)),A=O/C,S/=N=Math.sqrt(S*S+A*A),A/=N,a=x-1;a<t;a++)O=i.get(x-1,a),i.set(x-1,a,A*O+S*i.get(x,a)),i.set(x,a,A*i.get(x,a)-S*O);for(o=0;o<=x;o++)O=i.get(o,x-1),i.set(o,x-1,A*O+S*i.get(o,x)),i.set(o,x,A*i.get(o,x)-S*O);for(o=0;o<=E;o++)O=r.get(o,x-1),r.set(o,x-1,A*O+S*r.get(o,x)),r.set(o,x,A*r.get(o,x)-S*O)}else n[x-1]=d+S,n[x]=d+S,e[x-1]=O,e[x]=-O;x-=2,T=0}else{if(d=i.get(x,x),f=0,h=0,l<x&&(f=i.get(x-1,x-1),h=i.get(x,x-1)*i.get(x-1,x)),10===T){for(k+=d,o=0;o<=x;o++)i.set(o,o,i.get(o,o)-d);d=f=.75*(C=Math.abs(i.get(x,x-1))+Math.abs(i.get(x-1,x-2))),h=-.4375*C*C}if(30===T&&(C=(C=(f-d)/2)*C+h)>0){for(C=Math.sqrt(C),f<d&&(C=-C),C=d-h/((f-d)/2+C),o=0;o<=x;o++)i.set(o,o,i.get(o,o)-C);k+=C,d=f=h=.964}for(T+=1,c=x-2;c>=l&&(S=((N=d-(O=i.get(c,c)))*(C=f-O)-h)/i.get(c+1,c)+i.get(c,c+1),A=i.get(c+1,c+1)-O-N-C,N=i.get(c+2,c+1),S/=C=Math.abs(S)+Math.abs(A)+Math.abs(N),A/=C,N/=C,c!==l)&&!(Math.abs(i.get(c,c-1))*(Math.abs(A)+Math.abs(N))<w*(Math.abs(S)*(Math.abs(i.get(c-1,c-1))+Math.abs(O)+Math.abs(i.get(c+1,c+1)))));)c--;for(o=c+2;o<=x;o++)i.set(o,o-2,0),o>c+2&&i.set(o,o-3,0);for(s=c;s<=x-1&&(y=s!==x-1,s!==c&&(S=i.get(s,s-1),A=i.get(s+1,s-1),N=y?i.get(s+2,s-1):0,0!==(d=Math.abs(S)+Math.abs(A)+Math.abs(N))&&(S/=d,A/=d,N/=d)),0!==d);s++)if(C=Math.sqrt(S*S+A*A+N*N),S<0&&(C=-C),0!==C){for(s!==c?i.set(s,s-1,-C*d):l!==c&&i.set(s,s-1,-i.get(s,s-1)),d=(S+=C)/C,f=A/C,O=N/C,A/=S,N/=S,a=s;a<t;a++)S=i.get(s,a)+A*i.get(s+1,a),y&&(S+=N*i.get(s+2,a),i.set(s+2,a,i.get(s+2,a)-S*O)),i.set(s,a,i.get(s,a)-S*d),i.set(s+1,a,i.get(s+1,a)-S*f);for(o=0;o<=Math.min(x,s+3);o++)S=d*i.get(o,s)+f*i.get(o,s+1),y&&(S+=O*i.get(o,s+2),i.set(o,s+2,i.get(o,s+2)-S*N)),i.set(o,s,i.get(o,s)-S),i.set(o,s+1,i.get(o,s+1)-S*A);for(o=0;o<=E;o++)S=d*r.get(o,s)+f*r.get(o,s+1),y&&(S+=O*r.get(o,s+2),r.set(o,s+2,r.get(o,s+2)-S*N)),r.set(o,s,r.get(o,s)-S),r.set(o,s+1,r.get(o,s+1)-S*A)}}}if(0!==M){for(x=t-1;x>=0;x--)if(S=n[x],0===(A=e[x]))for(l=x,i.set(x,x,1),o=x-1;o>=0;o--){for(h=i.get(o,o)-S,N=0,a=l;a<=x;a++)N+=i.get(o,a)*i.get(a,x);if(e[o]<0)O=h,C=N;else if(l=o,0===e[o]?i.set(o,x,0!==h?-N/h:-N/(w*M)):(d=i.get(o,o+1),f=i.get(o+1,o),u=(d*C-O*N)/(A=(n[o]-S)*(n[o]-S)+e[o]*e[o]),i.set(o,x,u),i.set(o+1,x,Math.abs(d)>Math.abs(O)?(-N-h*u)/d:(-C-f*u)/O)),w*(u=Math.abs(i.get(o,x)))*u>1)for(a=o;a<=x;a++)i.set(a,x,i.get(a,x)/u)}else if(A<0)for(l=x-1,Math.abs(i.get(x,x-1))>Math.abs(i.get(x-1,x))?(i.set(x-1,x-1,A/i.get(x,x-1)),i.set(x-1,x,-(i.get(x,x)-S)/i.get(x,x-1))):(b=Ct(0,-i.get(x-1,x),i.get(x-1,x-1)-S,A),i.set(x-1,x-1,b[0]),i.set(x-1,x,b[1])),i.set(x,x-1,0),i.set(x,x,1),o=x-2;o>=0;o--){for(p=0,g=0,a=l;a<=x;a++)p+=i.get(o,a)*i.get(a,x-1),g+=i.get(o,a)*i.get(a,x);if(h=i.get(o,o)-S,e[o]<0)O=h,N=p,C=g;else if(l=o,0===e[o]?(b=Ct(-p,-g,h,A),i.set(o,x-1,b[0]),i.set(o,x,b[1])):(d=i.get(o,o+1),f=i.get(o+1,o),v=(n[o]-S)*(n[o]-S)+e[o]*e[o]-A*A,m=2*(n[o]-S)*A,0===v&&0===m&&(v=w*M*(Math.abs(h)+Math.abs(A)+Math.abs(d)+Math.abs(f)+Math.abs(O))),b=Ct(d*N-O*p+A*g,d*C-O*g-A*p,v,m),i.set(o,x-1,b[0]),i.set(o,x,b[1]),Math.abs(d)>Math.abs(O)+Math.abs(A)?(i.set(o+1,x-1,(-p-h*i.get(o,x-1)+A*i.get(o,x))/d),i.set(o+1,x,(-g-h*i.get(o,x)-A*i.get(o,x-1))/d)):(b=Ct(-N-f*i.get(o,x-1),-C-f*i.get(o,x),O,A),i.set(o+1,x-1,b[0]),i.set(o+1,x,b[1]))),w*(u=Math.max(Math.abs(i.get(o,x-1)),Math.abs(i.get(o,x))))*u>1)for(a=o;a<=x;a++)i.set(a,x-1,i.get(a,x-1)/u),i.set(a,x,i.get(a,x)/u)}for(o=0;o<t;o++)if(o<0||o>E)for(a=o;a<t;a++)r.set(o,a,i.get(o,a));for(a=t-1;a>=0;a--)for(o=0;o<=E;o++){for(O=0,s=0;s<=Math.min(a,E);s++)O+=r.get(o,s)*i.get(s,a);r.set(o,a,O)}}}function Ct(t,e,n,r){var i,o;return Math.abs(n)>Math.abs(r)?[(t+(i=r/n)*e)/(o=n+i*r),(e-i*t)/o]:[((i=n/r)*t+e)/(o=r+i*n),(i*e-t)/o]}var Ot=function(){function t(e){if(y(this,t),!(e=gt.checkMatrix(e)).isSymmetric())throw new Error("Matrix is not symmetric");var n,r,i,o=e,a=o.rows,s=new $(a,a),l=!0;for(r=0;r<a;r++){var c=0;for(i=0;i<r;i++){var u=0;for(n=0;n<i;n++)u+=s.get(i,n)*s.get(r,n);u=(o.get(r,i)-u)/s.get(i,i),s.set(r,i,u),c+=u*u}for(c=o.get(r,r)-c,l&&(l=c>0),s.set(r,r,Math.sqrt(Math.max(c,0))),i=r+1;i<a;i++)s.set(r,i,0)}this.L=s,this.positiveDefinite=l}return b(t,[{key:"isPositiveDefinite",value:function(){return this.positiveDefinite}},{key:"solve",value:function(t){t=gt.checkMatrix(t);var e=this.L,n=e.rows;if(t.rows!==n)throw new Error("Matrix dimensions do not match");if(!1===this.isPositiveDefinite())throw new Error("Matrix is not positive definite");var r,i,o,a=t.columns,s=t.clone();for(o=0;o<n;o++)for(i=0;i<a;i++){for(r=0;r<o;r++)s.set(o,i,s.get(o,i)-s.get(r,i)*e.get(o,r));s.set(o,i,s.get(o,i)/e.get(o,o))}for(o=n-1;o>=0;o--)for(i=0;i<a;i++){for(r=o+1;r<n;r++)s.set(o,i,s.get(o,i)-s.get(r,i)*e.get(r,o));s.set(o,i,s.get(o,i)/e.get(o,o))}return s}},{key:"lowerTriangularMatrix",get:function(){return this.L}}]),t}(),Tt=b((function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};y(this,t),e=gt.checkMatrix(e);var r,i=n.Y,o=n.scaleScores,a=void 0!==o&&o,s=n.maxIterations,l=void 0===s?1e3:s,c=n.terminationCriteria,u=void 0===c?1e-10:c;if(i){if((i=x.isAnyArray(i)&&"number"==typeof i[0]?$.columnVector(i):gt.checkMatrix(i)).rows!==e.rows)throw new Error("Y should have the same number of rows as X");r=i.getColumnVector(0)}else r=e.getColumnVector(0);for(var h,d,f,p,g=1,v=0;v<l&&g>u;v++)f=(f=e.transpose().mmul(r).div(r.transpose().mmul(r).get(0,0))).div(f.norm()),h=e.mmul(f).div(f.transpose().mmul(f).get(0,0)),v>0&&(g=h.clone().sub(p).pow(2).sum()),p=h.clone(),i?(d=(d=i.transpose().mmul(h).div(h.transpose().mmul(h).get(0,0))).div(d.norm()),r=i.mmul(d).div(d.transpose().mmul(d).get(0,0))):r=h;if(i){var m=e.transpose().mmul(h).div(h.transpose().mmul(h).get(0,0));m=m.div(m.norm());var b=e.clone().sub(h.clone().mmul(m.transpose())),E=r.transpose().mmul(h).div(h.transpose().mmul(h).get(0,0)),w=i.clone().sub(h.clone().mulS(E.get(0,0)).mmul(d.transpose()));this.t=h,this.p=m.transpose(),this.w=f.transpose(),this.q=d,this.u=r,this.s=h.transpose().mmul(h),this.xResidual=b,this.yResidual=w,this.betas=E}else this.w=f.transpose(),this.s=h.transpose().mmul(h).sqrt(),this.t=a?h.clone().div(this.s.get(0,0)):h,this.xResidual=e.sub(h.mmul(f.transpose()))}));e.XA=K,e.a_=Ot,e.yQ=Ot,e.Hs=rt,e.Ec=kt,e.dx=kt,e.LU=vt,e.Rm=vt,e.y3=$,e.qK=at,e.pb=ot,e.j=st,e.sO=lt,e.BZ=ut,e.EK=ct,e.Db=ht,e.Fx=dt,e.tU=ft,e.Ym=Tt,e.rs=Tt,e.QR=yt,e.TB=yt,e.oH=bt,e.Sc=bt,e.BN=nt,e.it=pt,e.$r=gt,e.QM=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};t=new $(t);var r=!1;if("object"!==m(e)||$.isMatrix(e)||x.isAnyArray(e)?e=new $(e):(n=e,e=t,r=!0),t.rows!==e.rows)throw new TypeError("Both matrices must have the same number of rows");var i=n,o=i.center,a=void 0===o||o,s=i.scale,l=void 0===s||s;a&&(t.center("column"),r||e.center("column")),l&&(t.scale("column"),r||e.scale("column"));for(var c=t.standardDeviation("column",{unbiased:!0}),u=r?c:e.standardDeviation("column",{unbiased:!0}),h=t.transpose().mmul(e),d=0;d<h.rows;d++)for(var f=0;f<h.columns;f++)h.set(d,f,h.get(d,f)*(1/(c[d]*u[f]))*(1/(t.rows-1)));return h},e.AV=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};t=new $(t);var r=!1;if("object"!==m(e)||$.isMatrix(e)||x.isAnyArray(e)?e=new $(e):(n=e,e=t,r=!0),t.rows!==e.rows)throw new TypeError("Both matrices must have the same number of rows");var i=n,o=i.center,a=void 0===o||o;a&&(t=t.center("column"),r||(e=e.center("column")));for(var s=t.transpose().mmul(e),l=0;l<s.rows;l++)for(var c=0;c<s.columns;c++)s.set(l,c,s.get(l,c)*(1/(t.rows-1)));return s},e.GH=function t(e){var n,r,i,o,a,s;if((e=$.checkMatrix(e)).isSquare())return 0===e.columns?1:2===e.columns?(n=e.get(0,0),r=e.get(0,1),i=e.get(1,0),n*e.get(1,1)-r*i):3===e.columns?(o=new ht(e,[1,2],[1,2]),a=new ht(e,[1,2],[0,2]),s=new ht(e,[1,2],[0,1]),n=e.get(0,0),r=e.get(0,1),i=e.get(0,2),n*t(o)-r*t(a)+i*t(s)):new vt(e).determinant;throw Error("determinant can only be calculated for a square matrix")},e.SO=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return t=gt.checkMatrix(t),e?new bt(t).inverse():xt(t,$.eye(t.rows))},e.uZ=function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.thresholdValue,r=void 0===n?1e-9:n,i=e.thresholdError,o=void 0===i?1e-9:i,a=(t=$.checkMatrix(t)).rows,s=new $(a,a),l=0;l<a;l++){var c=$.columnVector(t.getRow(l)),u=t.subMatrixRow(Et(a,l)).transpose(),h=new bt(u),d=h.solve(c),f=$.sub(c,u.mmul(d)).abs().max();s.setRow(l,wt(f,d,l,r,o))}return s},e.yU=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.EPSILON;if((t=$.checkMatrix(t)).isEmpty())return t.transpose();for(var n=new bt(t,{autoTranspose:!0}),r=n.leftSingularVectors,i=n.rightSingularVectors,o=n.diagonal,a=0;a<o.length;a++)Math.abs(o[a])>e?o[a]=1/o[a]:o[a]=0;return i.mmul($.diag(o).mmul(r.transpose()))},e.F1=xt,e.re=function(t,e){if(x.isAnyArray(t))return t[0]&&x.isAnyArray(t[0])?new gt(t):new pt(t,e);throw new Error("the argument is not an array")}},45411:function(t){"use strict";t.exports={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]}},75196:function(t,e,n){var r=n(45411),i=n(81683),o=Object.hasOwnProperty,a=Object.create(null);for(var s in r)o.call(r,s)&&(a[r[s]]=s);var l=t.exports={to:{},get:{}};function c(t,e,n){return Math.min(Math.max(e,t),n)}function u(t){var e=Math.round(t).toString(16).toUpperCase();return e.length<2?"0"+e:e}l.get=function(t){var e,n;switch(t.substring(0,3).toLowerCase()){case"hsl":e=l.get.hsl(t),n="hsl";break;case"hwb":e=l.get.hwb(t),n="hwb";break;default:e=l.get.rgb(t),n="rgb"}return e?{model:n,value:e}:null},l.get.rgb=function(t){if(!t)return null;var e,n,i,a=[0,0,0,1];if(e=t.match(/^#([a-f0-9]{6})([a-f0-9]{2})?$/i)){for(i=e[2],e=e[1],n=0;n<3;n++){var s=2*n;a[n]=parseInt(e.slice(s,s+2),16)}i&&(a[3]=parseInt(i,16)/255)}else if(e=t.match(/^#([a-f0-9]{3,4})$/i)){for(i=(e=e[1])[3],n=0;n<3;n++)a[n]=parseInt(e[n]+e[n],16);i&&(a[3]=parseInt(i+i,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++)a[n]=parseInt(e[n+1],0);e[4]&&(e[5]?a[3]=.01*parseFloat(e[4]):a[3]=parseFloat(e[4]))}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]:o.call(r,e[1])?((a=r[e[1]])[3]=1,a):null:null;for(n=0;n<3;n++)a[n]=Math.round(2.55*parseFloat(e[n+1]));e[4]&&(e[5]?a[3]=.01*parseFloat(e[4]):a[3]=parseFloat(e[4]))}for(n=0;n<3;n++)a[n]=c(a[n],0,255);return a[3]=c(a[3],0,1),a},l.get.hsl=function(t){if(!t)return null;var e=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*)?\)$/);if(e){var n=parseFloat(e[4]);return[(parseFloat(e[1])%360+360)%360,c(parseFloat(e[2]),0,100),c(parseFloat(e[3]),0,100),c(isNaN(n)?1:n,0,1)]}return null},l.get.hwb=function(t){if(!t)return null;var e=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*)?\)$/);if(e){var n=parseFloat(e[4]);return[(parseFloat(e[1])%360+360)%360,c(parseFloat(e[2]),0,100),c(parseFloat(e[3]),0,100),c(isNaN(n)?1:n,0,1)]}return null},l.to.hex=function(){var t=i(arguments);return"#"+u(t[0])+u(t[1])+u(t[2])+(t[3]<1?u(Math.round(255*t[3])):"")},l.to.rgb=function(){var t=i(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]+")"},l.to.rgb.percent=function(){var t=i(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]+")"},l.to.hsl=function(){var t=i(arguments);return t.length<4||1===t[3]?"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)":"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+t[3]+")"},l.to.hwb=function(){var t=i(arguments),e="";return t.length>=4&&1!==t[3]&&(e=", "+t[3]),"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+e+")"},l.to.keyword=function(t){return a[t.slice(0,3)]}},92546:function(t,e,n){t.exports={graphlib:n(76626),layout:n(47194),debug:n(11303),util:{time:n(53063).time,notime:n(53063).notime},version:n(11897)}},81255:function(t,e,n){"use strict";var r=n(72361),i=n(39240);t.exports={run:function(t){var e="greedy"===t.graph().acyclicer?i(t,function(t){return function(e){return t.edge(e).weight}}(t)):function(t){var e=[],n={},i={};function o(a){r.has(i,a)||(i[a]=!0,n[a]=!0,r.forEach(t.outEdges(a),(function(t){r.has(n,t.w)?e.push(t):o(t.w)})),delete n[a])}return r.forEach(t.nodes(),o),e}(t);r.forEach(e,(function(e){var n=t.edge(e);t.removeEdge(e),n.forwardName=e.name,n.reversed=!0,t.setEdge(e.w,e.v,n,r.uniqueId("rev"))}))},undo:function(t){r.forEach(t.edges(),(function(e){var n=t.edge(e);if(n.reversed){t.removeEdge(e);var r=n.forwardName;delete n.reversed,delete n.forwardName,t.setEdge(e.w,e.v,n,r)}}))}}},60765:function(t,e,n){var r=n(72361),i=n(53063);function o(t,e,n,r,o,a){var s={width:0,height:0,rank:a,borderType:e},l=o[e][a-1],c=i.addDummyNode(t,"border",s,n);o[e][a]=c,t.setParent(c,r),l&&t.setEdge(l,c,{weight:1})}t.exports=function(t){r.forEach(t.children(),(function e(n){var i=t.children(n),a=t.node(n);if(i.length&&r.forEach(i,e),r.has(a,"minRank")){a.borderLeft=[],a.borderRight=[];for(var s=a.minRank,l=a.maxRank+1;s<l;++s)o(t,"borderLeft","_bl",n,a,s),o(t,"borderRight","_br",n,a,s)}}))}},13257:function(t,e,n){"use strict";var r=n(72361);function i(t){r.forEach(t.nodes(),(function(e){o(t.node(e))})),r.forEach(t.edges(),(function(e){o(t.edge(e))}))}function o(t){var e=t.width;t.width=t.height,t.height=e}function a(t){t.y=-t.y}function s(t){var e=t.x;t.x=t.y,t.y=e}t.exports={adjust:function(t){var e=t.graph().rankdir.toLowerCase();"lr"!==e&&"rl"!==e||i(t)},undo:function(t){var e=t.graph().rankdir.toLowerCase();"bt"!==e&&"rl"!==e||function(t){r.forEach(t.nodes(),(function(e){a(t.node(e))})),r.forEach(t.edges(),(function(e){var n=t.edge(e);r.forEach(n.points,a),r.has(n,"y")&&a(n)}))}(t);"lr"!==e&&"rl"!==e||(!function(t){r.forEach(t.nodes(),(function(e){s(t.node(e))})),r.forEach(t.edges(),(function(e){var n=t.edge(e);r.forEach(n.points,s),r.has(n,"x")&&s(n)}))}(t),i(t))}}},21135:function(t){function e(){var t={};t._next=t._prev=t,this._sentinel=t}function n(t){t._prev._next=t._next,t._next._prev=t._prev,delete t._next,delete t._prev}function r(t,e){if("_next"!==t&&"_prev"!==t)return e}t.exports=e,e.prototype.dequeue=function(){var t=this._sentinel,e=t._prev;if(e!==t)return n(e),e},e.prototype.enqueue=function(t){var e=this._sentinel;t._prev&&t._next&&n(t),t._next=e._next,e._next._prev=t,e._next=t,t._prev=e},e.prototype.toString=function(){for(var t=[],e=this._sentinel,n=e._prev;n!==e;)t.push(JSON.stringify(n,r)),n=n._prev;return"["+t.join(", ")+"]"}},11303:function(t,e,n){var r=n(72361),i=n(53063),o=n(76626).Graph;t.exports={debugOrdering:function(t){var e=i.buildLayerMatrix(t),n=new o({compound:!0,multigraph:!0}).setGraph({});return r.forEach(t.nodes(),(function(e){n.setNode(e,{label:e}),n.setParent(e,"layer"+t.node(e).rank)})),r.forEach(t.edges(),(function(t){n.setEdge(t.v,t.w,{},t.name)})),r.forEach(e,(function(t,e){var i="layer"+e;n.setNode(i,{rank:"same"}),r.reduce(t,(function(t,e){return n.setEdge(t,e,{style:"invis"}),e}))})),n}}},76626:function(t,e,n){var r;try{r=n(75172)}catch(t){}r||(r=window.graphlib),t.exports=r},39240:function(t,e,n){var r=n(72361),i=n(76626).Graph,o=n(21135);t.exports=function(t,e){if(t.nodeCount()<=1)return[];var n=function(t,e){var n=new i,a=0,s=0;r.forEach(t.nodes(),(function(t){n.setNode(t,{v:t,in:0,out:0})})),r.forEach(t.edges(),(function(t){var r=n.edge(t.v,t.w)||0,i=e(t),o=r+i;n.setEdge(t.v,t.w,o),s=Math.max(s,n.node(t.v).out+=i),a=Math.max(a,n.node(t.w).in+=i)}));var c=r.range(s+a+3).map((function(){return new o})),u=a+1;return r.forEach(n.nodes(),(function(t){l(c,u,n.node(t))})),{graph:n,buckets:c,zeroIdx:u}}(t,e||a),c=function(t,e,n){var r,i=[],o=e[e.length-1],a=e[0];for(;t.nodeCount();){for(;r=a.dequeue();)s(t,e,n,r);for(;r=o.dequeue();)s(t,e,n,r);if(t.nodeCount())for(var l=e.length-2;l>0;--l)if(r=e[l].dequeue()){i=i.concat(s(t,e,n,r,!0));break}}return i}(n.graph,n.buckets,n.zeroIdx);return r.flatten(r.map(c,(function(e){return t.outEdges(e.v,e.w)})),!0)};var a=r.constant(1);function s(t,e,n,i,o){var a=o?[]:void 0;return r.forEach(t.inEdges(i.v),(function(r){var i=t.edge(r),s=t.node(r.v);o&&a.push({v:r.v,w:r.w}),s.out-=i,l(e,n,s)})),r.forEach(t.outEdges(i.v),(function(r){var i=t.edge(r),o=r.w,a=t.node(o);a.in-=i,l(e,n,a)})),t.removeNode(i.v),a}function l(t,e,n){n.out?n.in?t[n.out-n.in+e].enqueue(n):t[t.length-1].enqueue(n):t[0].enqueue(n)}},47194:function(t,e,n){"use strict";var r=n(72361),i=n(81255),o=n(27163),a=n(64505),s=n(53063).normalizeRanks,l=n(71970),c=n(53063).removeEmptyRanks,u=n(31733),h=n(60765),d=n(13257),f=n(62852),p=n(93021),g=n(53063),v=n(76626).Graph;t.exports=function(t,e){var n=e&&e.debugTiming?g.time:g.notime;n("layout",(function(){var e=n(" buildLayoutGraph",(function(){return function(t){var e=new v({multigraph:!0,compound:!0}),n=A(t.graph());return e.setGraph(r.merge({},y,S(n,m),r.pick(n,b))),r.forEach(t.nodes(),(function(n){var i=A(t.node(n));e.setNode(n,r.defaults(S(i,x),E)),e.setParent(n,t.parent(n))})),r.forEach(t.edges(),(function(n){var i=A(t.edge(n));e.setEdge(n,r.merge({},k,S(i,w),r.pick(i,M)))})),e}(t)}));n(" runLayout",(function(){!function(t,e){e(" makeSpaceForEdgeLabels",(function(){!function(t){var e=t.graph();e.ranksep/=2,r.forEach(t.edges(),(function(n){var r=t.edge(n);r.minlen*=2,"c"!==r.labelpos.toLowerCase()&&("TB"===e.rankdir||"BT"===e.rankdir?r.width+=r.labeloffset:r.height+=r.labeloffset)}))}(t)})),e(" removeSelfEdges",(function(){!function(t){r.forEach(t.edges(),(function(e){if(e.v===e.w){var n=t.node(e.v);n.selfEdges||(n.selfEdges=[]),n.selfEdges.push({e:e,label:t.edge(e)}),t.removeEdge(e)}}))}(t)})),e(" acyclic",(function(){i.run(t)})),e(" nestingGraph.run",(function(){u.run(t)})),e(" rank",(function(){a(g.asNonCompoundGraph(t))})),e(" injectEdgeLabelProxies",(function(){!function(t){r.forEach(t.edges(),(function(e){var n=t.edge(e);if(n.width&&n.height){var r=t.node(e.v),i={rank:(t.node(e.w).rank-r.rank)/2+r.rank,e:e};g.addDummyNode(t,"edge-proxy",i,"_ep")}}))}(t)})),e(" removeEmptyRanks",(function(){c(t)})),e(" nestingGraph.cleanup",(function(){u.cleanup(t)})),e(" normalizeRanks",(function(){s(t)})),e(" assignRankMinMax",(function(){!function(t){var e=0;r.forEach(t.nodes(),(function(n){var i=t.node(n);i.borderTop&&(i.minRank=t.node(i.borderTop).rank,i.maxRank=t.node(i.borderBottom).rank,e=r.max(e,i.maxRank))})),t.graph().maxRank=e}(t)})),e(" removeEdgeLabelProxies",(function(){!function(t){r.forEach(t.nodes(),(function(e){var n=t.node(e);"edge-proxy"===n.dummy&&(t.edge(n.e).labelRank=n.rank,t.removeNode(e))}))}(t)})),e(" normalize.run",(function(){o.run(t)})),e(" parentDummyChains",(function(){l(t)})),e(" addBorderSegments",(function(){h(t)})),e(" order",(function(){f(t)})),e(" insertSelfEdges",(function(){!function(t){var e=g.buildLayerMatrix(t);r.forEach(e,(function(e){var n=0;r.forEach(e,(function(e,i){var o=t.node(e);o.order=i+n,r.forEach(o.selfEdges,(function(e){g.addDummyNode(t,"selfedge",{width:e.label.width,height:e.label.height,rank:o.rank,order:i+ ++n,e:e.e,label:e.label},"_se")})),delete o.selfEdges}))}))}(t)})),e(" adjustCoordinateSystem",(function(){d.adjust(t)})),e(" position",(function(){p(t)})),e(" positionSelfEdges",(function(){!function(t){r.forEach(t.nodes(),(function(e){var n=t.node(e);if("selfedge"===n.dummy){var r=t.node(n.e.v),i=r.x+r.width/2,o=r.y,a=n.x-i,s=r.height/2;t.setEdge(n.e,n.label),t.removeNode(e),n.label.points=[{x:i+2*a/3,y:o-s},{x:i+5*a/6,y:o-s},{x:i+a,y:o},{x:i+5*a/6,y:o+s},{x:i+2*a/3,y:o+s}],n.label.x=n.x,n.label.y=n.y}}))}(t)})),e(" removeBorderNodes",(function(){!function(t){r.forEach(t.nodes(),(function(e){if(t.children(e).length){var n=t.node(e),i=t.node(n.borderTop),o=t.node(n.borderBottom),a=t.node(r.last(n.borderLeft)),s=t.node(r.last(n.borderRight));n.width=Math.abs(s.x-a.x),n.height=Math.abs(o.y-i.y),n.x=a.x+n.width/2,n.y=i.y+n.height/2}})),r.forEach(t.nodes(),(function(e){"border"===t.node(e).dummy&&t.removeNode(e)}))}(t)})),e(" normalize.undo",(function(){o.undo(t)})),e(" fixupEdgeLabelCoords",(function(){!function(t){r.forEach(t.edges(),(function(e){var n=t.edge(e);if(r.has(n,"x"))switch("l"!==n.labelpos&&"r"!==n.labelpos||(n.width-=n.labeloffset),n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset}}))}(t)})),e(" undoCoordinateSystem",(function(){d.undo(t)})),e(" translateGraph",(function(){!function(t){var e=Number.POSITIVE_INFINITY,n=0,i=Number.POSITIVE_INFINITY,o=0,a=t.graph(),s=a.marginx||0,l=a.marginy||0;function c(t){var r=t.x,a=t.y,s=t.width,l=t.height;e=Math.min(e,r-s/2),n=Math.max(n,r+s/2),i=Math.min(i,a-l/2),o=Math.max(o,a+l/2)}r.forEach(t.nodes(),(function(e){c(t.node(e))})),r.forEach(t.edges(),(function(e){var n=t.edge(e);r.has(n,"x")&&c(n)})),e-=s,i-=l,r.forEach(t.nodes(),(function(n){var r=t.node(n);r.x-=e,r.y-=i})),r.forEach(t.edges(),(function(n){var o=t.edge(n);r.forEach(o.points,(function(t){t.x-=e,t.y-=i})),r.has(o,"x")&&(o.x-=e),r.has(o,"y")&&(o.y-=i)})),a.width=n-e+s,a.height=o-i+l}(t)})),e(" assignNodeIntersects",(function(){!function(t){r.forEach(t.edges(),(function(e){var n,r,i=t.edge(e),o=t.node(e.v),a=t.node(e.w);i.points?(n=i.points[0],r=i.points[i.points.length-1]):(i.points=[],n=a,r=o),i.points.unshift(g.intersectRect(o,n)),i.points.push(g.intersectRect(a,r))}))}(t)})),e(" reversePoints",(function(){!function(t){r.forEach(t.edges(),(function(e){var n=t.edge(e);n.reversed&&n.points.reverse()}))}(t)})),e(" acyclic.undo",(function(){i.undo(t)}))}(e,n)})),n(" updateInputGraph",(function(){!function(t,e){r.forEach(t.nodes(),(function(n){var r=t.node(n),i=e.node(n);r&&(r.x=i.x,r.y=i.y,e.children(n).length&&(r.width=i.width,r.height=i.height))})),r.forEach(t.edges(),(function(n){var i=t.edge(n),o=e.edge(n);i.points=o.points,r.has(o,"x")&&(i.x=o.x,i.y=o.y)})),t.graph().width=e.graph().width,t.graph().height=e.graph().height}(t,e)}))}))};var m=["nodesep","edgesep","ranksep","marginx","marginy"],y={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},b=["acyclicer","ranker","rankdir","align"],x=["width","height"],E={width:0,height:0},w=["minlen","weight","width","height","labeloffset"],k={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},M=["labelpos"];function S(t,e){return r.mapValues(r.pick(t,e),Number)}function A(t){var e={};return r.forEach(t,(function(t,n){e[n.toLowerCase()]=t})),e}},72361:function(t,e,n){var r;try{r={cloneDeep:n(20250),constant:n(13503),defaults:n(28548),each:n(76934),filter:n(64725),find:n(79785),flatten:n(40151),forEach:n(99204),forIn:n(23190),has:n(99946),isUndefined:n(16513),last:n(10611),map:n(9924),mapValues:n(70642),max:n(95987),merge:n(28440),min:n(73376),minBy:n(83296),now:n(5795),pick:n(89409),range:n(60859),reduce:n(16473),sortBy:n(351),uniqueId:n(95708),values:n(81229),zipObject:n(65441)}}catch(t){}r||(r=window._),t.exports=r},31733:function(t,e,n){var r=n(72361),i=n(53063);function o(t,e,n,a,s,l,c){var u=t.children(c);if(u.length){var h=i.addBorderNode(t,"_bt"),d=i.addBorderNode(t,"_bb"),f=t.node(c);t.setParent(h,c),f.borderTop=h,t.setParent(d,c),f.borderBottom=d,r.forEach(u,(function(r){o(t,e,n,a,s,l,r);var i=t.node(r),u=i.borderTop?i.borderTop:r,f=i.borderBottom?i.borderBottom:r,p=i.borderTop?a:2*a,g=u!==f?1:s-l[c]+1;t.setEdge(h,u,{weight:p,minlen:g,nestingEdge:!0}),t.setEdge(f,d,{weight:p,minlen:g,nestingEdge:!0})})),t.parent(c)||t.setEdge(e,h,{weight:0,minlen:s+l[c]})}else c!==e&&t.setEdge(e,c,{weight:0,minlen:n})}t.exports={run:function(t){var e=i.addDummyNode(t,"root",{},"_root"),n=function(t){var e={};function n(i,o){var a=t.children(i);a&&a.length&&r.forEach(a,(function(t){n(t,o+1)})),e[i]=o}return r.forEach(t.children(),(function(t){n(t,1)})),e}(t),a=r.max(r.values(n))-1,s=2*a+1;t.graph().nestingRoot=e,r.forEach(t.edges(),(function(e){t.edge(e).minlen*=s}));var l=function(t){return r.reduce(t.edges(),(function(e,n){return e+t.edge(n).weight}),0)}(t)+1;r.forEach(t.children(),(function(r){o(t,e,s,l,a,n,r)})),t.graph().nodeRankFactor=s},cleanup:function(t){var e=t.graph();t.removeNode(e.nestingRoot),delete e.nestingRoot,r.forEach(t.edges(),(function(e){t.edge(e).nestingEdge&&t.removeEdge(e)}))}}},27163:function(t,e,n){"use strict";var r=n(72361),i=n(53063);t.exports={run:function(t){t.graph().dummyChains=[],r.forEach(t.edges(),(function(e){!function(t,e){var n,r,o,a=e.v,s=t.node(a).rank,l=e.w,c=t.node(l).rank,u=e.name,h=t.edge(e),d=h.labelRank;if(c===s+1)return;for(t.removeEdge(e),o=0,++s;s<c;++o,++s)h.points=[],r={width:0,height:0,edgeLabel:h,edgeObj:e,rank:s},n=i.addDummyNode(t,"edge",r,"_d"),s===d&&(r.width=h.width,r.height=h.height,r.dummy="edge-label",r.labelpos=h.labelpos),t.setEdge(a,n,{weight:h.weight},u),0===o&&t.graph().dummyChains.push(n),a=n;t.setEdge(a,l,{weight:h.weight},u)}(t,e)}))},undo:function(t){r.forEach(t.graph().dummyChains,(function(e){var n,r=t.node(e),i=r.edgeLabel;for(t.setEdge(r.edgeObj,i);r.dummy;)n=t.successors(e)[0],t.removeNode(e),i.points.push({x:r.x,y:r.y}),"edge-label"===r.dummy&&(i.x=r.x,i.y=r.y,i.width=r.width,i.height=r.height),e=n,r=t.node(e)}))}}},52205:function(t,e,n){var r=n(72361);t.exports=function(t,e,n){var i,o={};r.forEach(n,(function(n){for(var r,a,s=t.parent(n);s;){if((r=t.parent(s))?(a=o[r],o[r]=s):(a=i,i=s),a&&a!==s)return void e.setEdge(a,s);s=r}}))}},99506:function(t,e,n){var r=n(72361);t.exports=function(t,e){return r.map(e,(function(e){var n=t.inEdges(e);if(n.length){var i=r.reduce(n,(function(e,n){var r=t.edge(n),i=t.node(n.v);return{sum:e.sum+r.weight*i.order,weight:e.weight+r.weight}}),{sum:0,weight:0});return{v:e,barycenter:i.sum/i.weight,weight:i.weight}}return{v:e}}))}},59105:function(t,e,n){var r=n(72361),i=n(76626).Graph;t.exports=function(t,e,n){var o=function(t){var e;for(;t.hasNode(e=r.uniqueId("_root")););return e}(t),a=new i({compound:!0}).setGraph({root:o}).setDefaultNodeLabel((function(e){return t.node(e)}));return r.forEach(t.nodes(),(function(i){var s=t.node(i),l=t.parent(i);(s.rank===e||s.minRank<=e&&e<=s.maxRank)&&(a.setNode(i),a.setParent(i,l||o),r.forEach(t[n](i),(function(e){var n=e.v===i?e.w:e.v,o=a.edge(n,i),s=r.isUndefined(o)?0:o.weight;a.setEdge(n,i,{weight:t.edge(e).weight+s})})),r.has(s,"minRank")&&a.setNode(i,{borderLeft:s.borderLeft[e],borderRight:s.borderRight[e]}))})),a}},45456:function(t,e,n){"use strict";var r=n(72361);function i(t,e,n){for(var i=r.zipObject(n,r.map(n,(function(t,e){return e}))),o=r.flatten(r.map(e,(function(e){return r.sortBy(r.map(t.outEdges(e),(function(e){return{pos:i[e.w],weight:t.edge(e).weight}})),"pos")})),!0),a=1;a<n.length;)a<<=1;var s=2*a-1;a-=1;var l=r.map(new Array(s),(function(){return 0})),c=0;return r.forEach(o.forEach((function(t){var e=t.pos+a;l[e]+=t.weight;for(var n=0;e>0;)e%2&&(n+=l[e+1]),l[e=e-1>>1]+=t.weight;c+=t.weight*n}))),c}t.exports=function(t,e){for(var n=0,r=1;r<e.length;++r)n+=i(t,e[r-1],e[r]);return n}},62852:function(t,e,n){"use strict";var r=n(72361),i=n(18043),o=n(45456),a=n(86490),s=n(59105),l=n(52205),c=n(76626).Graph,u=n(53063);function h(t,e,n){return r.map(e,(function(e){return s(t,e,n)}))}function d(t,e){var n=new c;r.forEach(t,(function(t){var i=t.graph().root,o=a(t,i,n,e);r.forEach(o.vs,(function(e,n){t.node(e).order=n})),l(t,n,o.vs)}))}function f(t,e){r.forEach(e,(function(e){r.forEach(e,(function(e,n){t.node(e).order=n}))}))}t.exports=function(t){var e=u.maxRank(t),n=h(t,r.range(1,e+1),"inEdges"),a=h(t,r.range(e-1,-1,-1),"outEdges"),s=i(t);f(t,s);for(var l,c=Number.POSITIVE_INFINITY,p=0,g=0;g<4;++p,++g){d(p%2?n:a,p%4>=2),s=u.buildLayerMatrix(t);var v=o(t,s);v<c&&(g=0,l=r.cloneDeep(s),c=v)}f(t,l)}},18043:function(t,e,n){"use strict";var r=n(72361);t.exports=function(t){var e={},n=r.filter(t.nodes(),(function(e){return!t.children(e).length})),i=r.max(r.map(n,(function(e){return t.node(e).rank}))),o=r.map(r.range(i+1),(function(){return[]}));var a=r.sortBy(n,(function(e){return t.node(e).rank}));return r.forEach(a,(function n(i){if(r.has(e,i))return;e[i]=!0;var a=t.node(i);o[a.rank].push(i),r.forEach(t.successors(i),n)})),o}},45926:function(t,e,n){"use strict";var r=n(72361);t.exports=function(t,e){var n={};return r.forEach(t,(function(t,e){var i=n[t.v]={indegree:0,in:[],out:[],vs:[t.v],i:e};r.isUndefined(t.barycenter)||(i.barycenter=t.barycenter,i.weight=t.weight)})),r.forEach(e.edges(),(function(t){var e=n[t.v],i=n[t.w];r.isUndefined(e)||r.isUndefined(i)||(i.indegree++,e.out.push(n[t.w]))})),function(t){var e=[];function n(t){return function(e){e.merged||(r.isUndefined(e.barycenter)||r.isUndefined(t.barycenter)||e.barycenter>=t.barycenter)&&function(t,e){var n=0,r=0;t.weight&&(n+=t.barycenter*t.weight,r+=t.weight);e.weight&&(n+=e.barycenter*e.weight,r+=e.weight);t.vs=e.vs.concat(t.vs),t.barycenter=n/r,t.weight=r,t.i=Math.min(e.i,t.i),e.merged=!0}(t,e)}}function i(e){return function(n){n.in.push(e),0==--n.indegree&&t.push(n)}}for(;t.length;){var o=t.pop();e.push(o),r.forEach(o.in.reverse(),n(o)),r.forEach(o.out,i(o))}return r.map(r.filter(e,(function(t){return!t.merged})),(function(t){return r.pick(t,["vs","i","barycenter","weight"])}))}(r.filter(n,(function(t){return!t.indegree})))}},86490:function(t,e,n){var r=n(72361),i=n(99506),o=n(45926),a=n(1349);t.exports=function t(e,n,s,l){var c=e.children(n),u=e.node(n),h=u?u.borderLeft:void 0,d=u?u.borderRight:void 0,f={};h&&(c=r.filter(c,(function(t){return t!==h&&t!==d})));var p=i(e,c);r.forEach(p,(function(n){if(e.children(n.v).length){var i=t(e,n.v,s,l);f[n.v]=i,r.has(i,"barycenter")&&(o=n,a=i,r.isUndefined(o.barycenter)?(o.barycenter=a.barycenter,o.weight=a.weight):(o.barycenter=(o.barycenter*o.weight+a.barycenter*a.weight)/(o.weight+a.weight),o.weight+=a.weight))}var o,a}));var g=o(p,s);!function(t,e){r.forEach(t,(function(t){t.vs=r.flatten(t.vs.map((function(t){return e[t]?e[t].vs:t})),!0)}))}(g,f);var v=a(g,l);if(h&&(v.vs=r.flatten([h,v.vs,d],!0),e.predecessors(h).length)){var m=e.node(e.predecessors(h)[0]),y=e.node(e.predecessors(d)[0]);r.has(v,"barycenter")||(v.barycenter=0,v.weight=0),v.barycenter=(v.barycenter*v.weight+m.order+y.order)/(v.weight+2),v.weight+=2}return v}},1349:function(t,e,n){var r=n(72361),i=n(53063);function o(t,e,n){for(var i;e.length&&(i=r.last(e)).i<=n;)e.pop(),t.push(i.vs),n++;return n}t.exports=function(t,e){var n=i.partition(t,(function(t){return r.has(t,"barycenter")})),a=n.lhs,s=r.sortBy(n.rhs,(function(t){return-t.i})),l=[],c=0,u=0,h=0;a.sort((d=!!e,function(t,e){return t.barycenter<e.barycenter?-1:t.barycenter>e.barycenter?1:d?e.i-t.i:t.i-e.i})),h=o(l,s,h),r.forEach(a,(function(t){h+=t.vs.length,l.push(t.vs),c+=t.barycenter*t.weight,u+=t.weight,h=o(l,s,h)}));var d;var f={vs:r.flatten(l,!0)};u&&(f.barycenter=c/u,f.weight=u);return f}},71970:function(t,e,n){var r=n(72361);t.exports=function(t){var e=function(t){var e={},n=0;function i(o){var a=n;r.forEach(t.children(o),i),e[o]={low:a,lim:n++}}return r.forEach(t.children(),i),e}(t);r.forEach(t.graph().dummyChains,(function(n){for(var r=t.node(n),i=r.edgeObj,o=function(t,e,n,r){var i,o,a=[],s=[],l=Math.min(e[n].low,e[r].low),c=Math.max(e[n].lim,e[r].lim);i=n;do{i=t.parent(i),a.push(i)}while(i&&(e[i].low>l||c>e[i].lim));o=i,i=r;for(;(i=t.parent(i))!==o;)s.push(i);return{path:a.concat(s.reverse()),lca:o}}(t,e,i.v,i.w),a=o.path,s=o.lca,l=0,c=a[l],u=!0;n!==i.w;){if(r=t.node(n),u){for(;(c=a[l])!==s&&t.node(c).maxRank<r.rank;)l++;c===s&&(u=!1)}if(!u){for(;l<a.length-1&&t.node(c=a[l+1]).minRank<=r.rank;)l++;c=a[l]}t.setParent(n,c),n=t.successors(n)[0]}}))}},92080:function(t,e,n){"use strict";var r=n(72361),i=n(76626).Graph,o=n(53063);function a(t,e){var n={};return r.reduce(e,(function(e,i){var o=0,a=0,s=e.length,c=r.last(i);return r.forEach(i,(function(e,u){var h=function(t,e){if(t.node(e).dummy)return r.find(t.predecessors(e),(function(e){return t.node(e).dummy}))}(t,e),d=h?t.node(h).order:s;(h||e===c)&&(r.forEach(i.slice(a,u+1),(function(e){r.forEach(t.predecessors(e),(function(r){var i=t.node(r),a=i.order;!(a<o||d<a)||i.dummy&&t.node(e).dummy||l(n,r,e)}))})),a=u+1,o=d)})),i})),n}function s(t,e){var n={};function i(e,i,o,a,s){var c;r.forEach(r.range(i,o),(function(i){c=e[i],t.node(c).dummy&&r.forEach(t.predecessors(c),(function(e){var r=t.node(e);r.dummy&&(r.order<a||r.order>s)&&l(n,e,c)}))}))}return r.reduce(e,(function(e,n){var o,a=-1,s=0;return r.forEach(n,(function(r,l){if("border"===t.node(r).dummy){var c=t.predecessors(r);c.length&&(o=t.node(c[0]).order,i(n,s,l,a,o),s=l,a=o)}i(n,s,n.length,o,e.length)})),n})),n}function l(t,e,n){if(e>n){var r=e;e=n,n=r}var i=t[e];i||(t[e]=i={}),i[n]=!0}function c(t,e,n){if(e>n){var i=e;e=n,n=i}return r.has(t[e],n)}function u(t,e,n,i){var o={},a={},s={};return r.forEach(e,(function(t){r.forEach(t,(function(t,e){o[t]=t,a[t]=t,s[t]=e}))})),r.forEach(e,(function(t){var e=-1;r.forEach(t,(function(t){var l=i(t);if(l.length){l=r.sortBy(l,(function(t){return s[t]}));for(var u=(l.length-1)/2,h=Math.floor(u),d=Math.ceil(u);h<=d;++h){var f=l[h];a[t]===t&&e<s[f]&&!c(n,t,f)&&(a[f]=t,a[t]=o[t]=o[f],e=s[f])}}}))})),{root:o,align:a}}function h(t,e,n,o,a){var s={},l=function(t,e,n,o){var a=new i,s=t.graph(),l=function(t,e,n){return function(i,o,a){var s,l=i.node(o),c=i.node(a),u=0;if(u+=l.width/2,r.has(l,"labelpos"))switch(l.labelpos.toLowerCase()){case"l":s=-l.width/2;break;case"r":s=l.width/2}if(s&&(u+=n?s:-s),s=0,u+=(l.dummy?e:t)/2,u+=(c.dummy?e:t)/2,u+=c.width/2,r.has(c,"labelpos"))switch(c.labelpos.toLowerCase()){case"l":s=c.width/2;break;case"r":s=-c.width/2}return s&&(u+=n?s:-s),s=0,u}}(s.nodesep,s.edgesep,o);return r.forEach(e,(function(e){var i;r.forEach(e,(function(e){var r=n[e];if(a.setNode(r),i){var o=n[i],s=a.edge(o,r);a.setEdge(o,r,Math.max(l(t,e,i),s||0))}i=e}))})),a}(t,e,n,a),c=a?"borderLeft":"borderRight";function u(t,e){for(var n=l.nodes(),r=n.pop(),i={};r;)i[r]?t(r):(i[r]=!0,n.push(r),n=n.concat(e(r))),r=n.pop()}return u((function(t){s[t]=l.inEdges(t).reduce((function(t,e){return Math.max(t,s[e.v]+l.edge(e))}),0)}),l.predecessors.bind(l)),u((function(e){var n=l.outEdges(e).reduce((function(t,e){return Math.min(t,s[e.w]-l.edge(e))}),Number.POSITIVE_INFINITY),r=t.node(e);n!==Number.POSITIVE_INFINITY&&r.borderType!==c&&(s[e]=Math.max(s[e],n))}),l.successors.bind(l)),r.forEach(o,(function(t){s[t]=s[n[t]]})),s}function d(t,e){return r.minBy(r.values(e),(function(e){var n=Number.NEGATIVE_INFINITY,i=Number.POSITIVE_INFINITY;return r.forIn(e,(function(e,r){var o=function(t,e){return t.node(e).width}(t,r)/2;n=Math.max(e+o,n),i=Math.min(e-o,i)})),n-i}))}function f(t,e){var n=r.values(e),i=r.min(n),o=r.max(n);r.forEach(["u","d"],(function(n){r.forEach(["l","r"],(function(a){var s,l=n+a,c=t[l];if(c!==e){var u=r.values(c);(s="l"===a?i-r.min(u):o-r.max(u))&&(t[l]=r.mapValues(c,(function(t){return t+s})))}}))}))}function p(t,e){return r.mapValues(t.ul,(function(n,i){if(e)return t[e.toLowerCase()][i];var o=r.sortBy(r.map(t,i));return(o[1]+o[2])/2}))}t.exports={positionX:function(t){var e,n=o.buildLayerMatrix(t),i=r.merge(a(t,n),s(t,n)),l={};r.forEach(["u","d"],(function(o){e="u"===o?n:r.values(n).reverse(),r.forEach(["l","r"],(function(n){"r"===n&&(e=r.map(e,(function(t){return r.values(t).reverse()})));var a=("u"===o?t.predecessors:t.successors).bind(t),s=u(t,e,i,a),c=h(t,e,s.root,s.align,"r"===n);"r"===n&&(c=r.mapValues(c,(function(t){return-t}))),l[o+n]=c}))}));var c=d(t,l);return f(l,c),p(l,t.graph().align)},findType1Conflicts:a,findType2Conflicts:s,addConflict:l,hasConflict:c,verticalAlignment:u,horizontalCompaction:h,alignCoordinates:f,findSmallestWidthAlignment:d,balance:p}},93021:function(t,e,n){"use strict";var r=n(72361),i=n(53063),o=n(92080).positionX;t.exports=function(t){(function(t){var e=i.buildLayerMatrix(t),n=t.graph().ranksep,o=0;r.forEach(e,(function(e){var i=r.max(r.map(e,(function(e){return t.node(e).height})));r.forEach(e,(function(e){t.node(e).y=o+i/2})),o+=i+n}))})(t=i.asNonCompoundGraph(t)),r.forEach(o(t),(function(e,n){t.node(n).x=e}))}},61031:function(t,e,n){"use strict";var r=n(72361),i=n(76626).Graph,o=n(2416).slack;function a(t,e){return r.forEach(t.nodes(),(function n(i){r.forEach(e.nodeEdges(i),(function(r){var a=r.v,s=i===a?r.w:a;t.hasNode(s)||o(e,r)||(t.setNode(s,{}),t.setEdge(i,s,{}),n(s))}))})),t.nodeCount()}function s(t,e){return r.minBy(e.edges(),(function(n){if(t.hasNode(n.v)!==t.hasNode(n.w))return o(e,n)}))}function l(t,e,n){r.forEach(t.nodes(),(function(t){e.node(t).rank+=n}))}t.exports=function(t){var e,n,r=new i({directed:!1}),c=t.nodes()[0],u=t.nodeCount();r.setNode(c,{});for(;a(r,t)<u;)e=s(r,t),n=r.hasNode(e.v)?o(t,e):-o(t,e),l(r,t,n);return r}},64505:function(t,e,n){"use strict";var r=n(2416).longestPath,i=n(61031),o=n(77076);t.exports=function(t){switch(t.graph().ranker){case"network-simplex":default:s(t);break;case"tight-tree":!function(t){r(t),i(t)}(t);break;case"longest-path":a(t)}};var a=r;function s(t){o(t)}},77076:function(t,e,n){"use strict";var r=n(72361),i=n(61031),o=n(2416).slack,a=n(2416).longestPath,s=n(76626).alg.preorder,l=n(76626).alg.postorder,c=n(53063).simplify;function u(t){t=c(t),a(t);var e,n=i(t);for(f(n),h(n,t);e=g(n);)m(n,t,e,v(n,t,e))}function h(t,e){var n=l(t,t.nodes());n=n.slice(0,n.length-1),r.forEach(n,(function(n){!function(t,e,n){var r=t.node(n),i=r.parent;t.edge(n,i).cutvalue=d(t,e,n)}(t,e,n)}))}function d(t,e,n){var i=t.node(n).parent,o=!0,a=e.edge(n,i),s=0;return a||(o=!1,a=e.edge(i,n)),s=a.weight,r.forEach(e.nodeEdges(n),(function(r){var a,l,c=r.v===n,u=c?r.w:r.v;if(u!==i){var h=c===o,d=e.edge(r).weight;if(s+=h?d:-d,a=n,l=u,t.hasEdge(a,l)){var f=t.edge(n,u).cutvalue;s+=h?-f:f}}})),s}function f(t,e){arguments.length<2&&(e=t.nodes()[0]),p(t,{},1,e)}function p(t,e,n,i,o){var a=n,s=t.node(i);return e[i]=!0,r.forEach(t.neighbors(i),(function(o){r.has(e,o)||(n=p(t,e,n,o,i))})),s.low=a,s.lim=n++,o?s.parent=o:delete s.parent,n}function g(t){return r.find(t.edges(),(function(e){return t.edge(e).cutvalue<0}))}function v(t,e,n){var i=n.v,a=n.w;e.hasEdge(i,a)||(i=n.w,a=n.v);var s=t.node(i),l=t.node(a),c=s,u=!1;s.lim>l.lim&&(c=l,u=!0);var h=r.filter(e.edges(),(function(e){return u===y(t,t.node(e.v),c)&&u!==y(t,t.node(e.w),c)}));return r.minBy(h,(function(t){return o(e,t)}))}function m(t,e,n,i){var o=n.v,a=n.w;t.removeEdge(o,a),t.setEdge(i.v,i.w,{}),f(t),h(t,e),function(t,e){var n=r.find(t.nodes(),(function(t){return!e.node(t).parent})),i=s(t,n);i=i.slice(1),r.forEach(i,(function(n){var r=t.node(n).parent,i=e.edge(n,r),o=!1;i||(i=e.edge(r,n),o=!0),e.node(n).rank=e.node(r).rank+(o?i.minlen:-i.minlen)}))}(t,e)}function y(t,e,n){return n.low<=e.lim&&e.lim<=n.lim}t.exports=u,u.initLowLimValues=f,u.initCutValues=h,u.calcCutValue=d,u.leaveEdge=g,u.enterEdge=v,u.exchangeEdges=m},2416:function(t,e,n){"use strict";var r=n(72361);t.exports={longestPath:function(t){var e={};r.forEach(t.sources(),(function n(i){var o=t.node(i);if(r.has(e,i))return o.rank;e[i]=!0;var a=r.min(r.map(t.outEdges(i),(function(e){return n(e.w)-t.edge(e).minlen})));return a!==Number.POSITIVE_INFINITY&&null!=a||(a=0),o.rank=a}))},slack:function(t,e){return t.node(e.w).rank-t.node(e.v).rank-t.edge(e).minlen}}},53063:function(t,e,n){"use strict";var r=n(72361),i=n(76626).Graph;function o(t,e,n,i){var o;do{o=r.uniqueId(i)}while(t.hasNode(o));return n.dummy=e,t.setNode(o,n),o}function a(t){return r.max(r.map(t.nodes(),(function(e){var n=t.node(e).rank;if(!r.isUndefined(n))return n})))}t.exports={addDummyNode:o,simplify:function(t){var e=(new i).setGraph(t.graph());return r.forEach(t.nodes(),(function(n){e.setNode(n,t.node(n))})),r.forEach(t.edges(),(function(n){var r=e.edge(n.v,n.w)||{weight:0,minlen:1},i=t.edge(n);e.setEdge(n.v,n.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)})})),e},asNonCompoundGraph:function(t){var e=new i({multigraph:t.isMultigraph()}).setGraph(t.graph());return r.forEach(t.nodes(),(function(n){t.children(n).length||e.setNode(n,t.node(n))})),r.forEach(t.edges(),(function(n){e.setEdge(n,t.edge(n))})),e},successorWeights:function(t){var e=r.map(t.nodes(),(function(e){var n={};return r.forEach(t.outEdges(e),(function(e){n[e.w]=(n[e.w]||0)+t.edge(e).weight})),n}));return r.zipObject(t.nodes(),e)},predecessorWeights:function(t){var e=r.map(t.nodes(),(function(e){var n={};return r.forEach(t.inEdges(e),(function(e){n[e.v]=(n[e.v]||0)+t.edge(e).weight})),n}));return r.zipObject(t.nodes(),e)},intersectRect:function(t,e){var n,r,i=t.x,o=t.y,a=e.x-i,s=e.y-o,l=t.width/2,c=t.height/2;if(!a&&!s)throw new Error("Not possible to find intersection inside of the rectangle");Math.abs(s)*l>Math.abs(a)*c?(s<0&&(c=-c),n=c*a/s,r=c):(a<0&&(l=-l),n=l,r=l*s/a);return{x:i+n,y:o+r}},buildLayerMatrix:function(t){var e=r.map(r.range(a(t)+1),(function(){return[]}));return r.forEach(t.nodes(),(function(n){var i=t.node(n),o=i.rank;r.isUndefined(o)||(e[o][i.order]=n)})),e},normalizeRanks:function(t){var e=r.min(r.map(t.nodes(),(function(e){return t.node(e).rank})));r.forEach(t.nodes(),(function(n){var i=t.node(n);r.has(i,"rank")&&(i.rank-=e)}))},removeEmptyRanks:function(t){var e=r.min(r.map(t.nodes(),(function(e){return t.node(e).rank}))),n=[];r.forEach(t.nodes(),(function(r){var i=t.node(r).rank-e;n[i]||(n[i]=[]),n[i].push(r)}));var i=0,o=t.graph().nodeRankFactor;r.forEach(n,(function(e,n){r.isUndefined(e)&&n%o!=0?--i:i&&r.forEach(e,(function(e){t.node(e).rank+=i}))}))},addBorderNode:function(t,e,n,r){var i={width:0,height:0};arguments.length>=4&&(i.rank=n,i.order=r);return o(t,"border",i,e)},maxRank:a,partition:function(t,e){var n={lhs:[],rhs:[]};return r.forEach(t,(function(t){e(t)?n.lhs.push(t):n.rhs.push(t)})),n},time:function(t,e){var n=r.now();try{return e()}finally{console.log(t+" time: "+(r.now()-n)+"ms")}},notime:function(t,e){return e()}}},11897:function(t){t.exports="0.8.5"},37271:function(t){"use strict";var e=Object.prototype.hasOwnProperty,n="~";function r(){}function i(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function o(t,e,r,o,a){if("function"!=typeof r)throw new TypeError("The listener must be a function");var s=new i(r,o||t,a),l=n?n+e:e;return t._events[l]?t._events[l].fn?t._events[l]=[t._events[l],s]:t._events[l].push(s):(t._events[l]=s,t._eventsCount++),t}function a(t,e){0==--t._eventsCount?t._events=new r:delete t._events[e]}function s(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),s.prototype.eventNames=function(){var t,r,i=[];if(0===this._eventsCount)return i;for(r in t=this._events)e.call(t,r)&&i.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(t)):i},s.prototype.listeners=function(t){var e=n?n+t:t,r=this._events[e];if(!r)return[];if(r.fn)return[r.fn];for(var i=0,o=r.length,a=new Array(o);i<o;i++)a[i]=r[i].fn;return a},s.prototype.listenerCount=function(t){var e=n?n+t:t,r=this._events[e];return r?r.fn?1:r.length:0},s.prototype.emit=function(t,e,r,i,o,a){var s=n?n+t:t;if(!this._events[s])return!1;var l,c,u=this._events[s],h=arguments.length;if(u.fn){switch(u.once&&this.removeListener(t,u.fn,void 0,!0),h){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,e),!0;case 3:return u.fn.call(u.context,e,r),!0;case 4:return u.fn.call(u.context,e,r,i),!0;case 5:return u.fn.call(u.context,e,r,i,o),!0;case 6:return u.fn.call(u.context,e,r,i,o,a),!0}for(c=1,l=new Array(h-1);c<h;c++)l[c-1]=arguments[c];u.fn.apply(u.context,l)}else{var d,f=u.length;for(c=0;c<f;c++)switch(u[c].once&&this.removeListener(t,u[c].fn,void 0,!0),h){case 1:u[c].fn.call(u[c].context);break;case 2:u[c].fn.call(u[c].context,e);break;case 3:u[c].fn.call(u[c].context,e,r);break;case 4:u[c].fn.call(u[c].context,e,r,i);break;default:if(!l)for(d=1,l=new Array(h-1);d<h;d++)l[d-1]=arguments[d];u[c].fn.apply(u[c].context,l)}}return!0},s.prototype.on=function(t,e,n){return o(this,t,e,n,!1)},s.prototype.once=function(t,e,n){return o(this,t,e,n,!0)},s.prototype.removeListener=function(t,e,r,i){var o=n?n+t:t;if(!this._events[o])return this;if(!e)return a(this,o),this;var s=this._events[o];if(s.fn)s.fn!==e||i&&!s.once||r&&s.context!==r||a(this,o);else{for(var l=0,c=[],u=s.length;l<u;l++)(s[l].fn!==e||i&&!s[l].once||r&&s[l].context!==r)&&c.push(s[l]);c.length?this._events[o]=1===c.length?c[0]:c:a(this,o)}return this},s.prototype.removeAllListeners=function(t){var e;return t?(e=n?n+t:t,this._events[e]&&a(this,e)):(this._events=new r,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=n,s.EventEmitter=s,t.exports=s},75172:function(t,e,n){var r=n(89224);t.exports={Graph:r.Graph,json:n(17401),alg:n(54613),version:r.version}},91606:function(t,e,n){var r=n(95329);t.exports=function(t){var e,n={},i=[];function o(i){r.has(n,i)||(n[i]=!0,e.push(i),r.each(t.successors(i),o),r.each(t.predecessors(i),o))}return r.each(t.nodes(),(function(t){e=[],o(t),e.length&&i.push(e)})),i}},21482:function(t,e,n){var r=n(95329);function i(t,e,n,o,a,s){r.has(o,e)||(o[e]=!0,n||s.push(e),r.each(a(e),(function(e){i(t,e,n,o,a,s)})),n&&s.push(e))}t.exports=function(t,e,n){r.isArray(e)||(e=[e]);var o=(t.isDirected()?t.successors:t.neighbors).bind(t),a=[],s={};return r.each(e,(function(e){if(!t.hasNode(e))throw new Error("Graph does not have node: "+e);i(t,e,"post"===n,s,o,a)})),a}},40845:function(t,e,n){var r=n(13746),i=n(95329);t.exports=function(t,e,n){return i.transform(t.nodes(),(function(i,o){i[o]=r(t,o,e,n)}),{})}},13746:function(t,e,n){var r=n(95329),i=n(36614);t.exports=function(t,e,n,r){return function(t,e,n,r){var o,a,s={},l=new i,c=function(t){var e=t.v!==o?t.v:t.w,r=s[e],i=n(t),c=a.distance+i;if(i<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+t+" Weight: "+i);c<r.distance&&(r.distance=c,r.predecessor=o,l.decrease(e,c))};t.nodes().forEach((function(t){var n=t===e?0:Number.POSITIVE_INFINITY;s[t]={distance:n},l.add(t,n)}));for(;l.size()>0&&(o=l.removeMin(),(a=s[o]).distance!==Number.POSITIVE_INFINITY);)r(o).forEach(c);return s}(t,String(e),n||o,r||function(e){return t.outEdges(e)})};var o=r.constant(1)},59324:function(t,e,n){var r=n(95329),i=n(94558);t.exports=function(t){return r.filter(i(t),(function(e){return e.length>1||1===e.length&&t.hasEdge(e[0],e[0])}))}},22893:function(t,e,n){var r=n(95329);t.exports=function(t,e,n){return function(t,e,n){var r={},i=t.nodes();return i.forEach((function(t){r[t]={},r[t][t]={distance:0},i.forEach((function(e){t!==e&&(r[t][e]={distance:Number.POSITIVE_INFINITY})})),n(t).forEach((function(n){var i=n.v===t?n.w:n.v,o=e(n);r[t][i]={distance:o,predecessor:t}}))})),i.forEach((function(t){var e=r[t];i.forEach((function(n){var o=r[n];i.forEach((function(n){var r=o[t],i=e[n],a=o[n],s=r.distance+i.distance;s<a.distance&&(a.distance=s,a.predecessor=i.predecessor)}))}))})),r}(t,e||i,n||function(e){return t.outEdges(e)})};var i=r.constant(1)},54613:function(t,e,n){t.exports={components:n(91606),dijkstra:n(13746),dijkstraAll:n(40845),findCycles:n(59324),floydWarshall:n(22893),isAcyclic:n(588),postorder:n(98049),preorder:n(67158),prim:n(66058),tarjan:n(94558),topsort:n(7793)}},588:function(t,e,n){var r=n(7793);t.exports=function(t){try{r(t)}catch(t){if(t instanceof r.CycleException)return!1;throw t}return!0}},98049:function(t,e,n){var r=n(21482);t.exports=function(t,e){return r(t,e,"post")}},67158:function(t,e,n){var r=n(21482);t.exports=function(t,e){return r(t,e,"pre")}},66058:function(t,e,n){var r=n(95329),i=n(6349),o=n(36614);t.exports=function(t,e){var n,a=new i,s={},l=new o;function c(t){var r=t.v===n?t.w:t.v,i=l.priority(r);if(void 0!==i){var o=e(t);o<i&&(s[r]=n,l.decrease(r,o))}}if(0===t.nodeCount())return a;r.each(t.nodes(),(function(t){l.add(t,Number.POSITIVE_INFINITY),a.setNode(t)})),l.decrease(t.nodes()[0],0);var u=!1;for(;l.size()>0;){if(n=l.removeMin(),r.has(s,n))a.setEdge(n,s[n]);else{if(u)throw new Error("Input graph is not connected: "+t);u=!0}t.nodeEdges(n).forEach(c)}return a}},94558:function(t,e,n){var r=n(95329);t.exports=function(t){var e=0,n=[],i={},o=[];function a(s){var l=i[s]={onStack:!0,lowlink:e,index:e++};if(n.push(s),t.successors(s).forEach((function(t){r.has(i,t)?i[t].onStack&&(l.lowlink=Math.min(l.lowlink,i[t].index)):(a(t),l.lowlink=Math.min(l.lowlink,i[t].lowlink))})),l.lowlink===l.index){var c,u=[];do{c=n.pop(),i[c].onStack=!1,u.push(c)}while(s!==c);o.push(u)}}return t.nodes().forEach((function(t){r.has(i,t)||a(t)})),o}},7793:function(t,e,n){var r=n(95329);function i(t){var e={},n={},i=[];if(r.each(t.sinks(),(function a(s){if(r.has(n,s))throw new o;r.has(e,s)||(n[s]=!0,e[s]=!0,r.each(t.predecessors(s),a),delete n[s],i.push(s))})),r.size(e)!==t.nodeCount())throw new o;return i}function o(){}t.exports=i,i.CycleException=o,o.prototype=new Error},36614:function(t,e,n){var r=n(95329);function i(){this._arr=[],this._keyIndices={}}t.exports=i,i.prototype.size=function(){return this._arr.length},i.prototype.keys=function(){return this._arr.map((function(t){return t.key}))},i.prototype.has=function(t){return r.has(this._keyIndices,t)},i.prototype.priority=function(t){var e=this._keyIndices[t];if(void 0!==e)return this._arr[e].priority},i.prototype.min=function(){if(0===this.size())throw new Error("Queue underflow");return this._arr[0].key},i.prototype.add=function(t,e){var n=this._keyIndices;if(t=String(t),!r.has(n,t)){var i=this._arr,o=i.length;return n[t]=o,i.push({key:t,priority:e}),this._decrease(o),!0}return!1},i.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var t=this._arr.pop();return delete this._keyIndices[t.key],this._heapify(0),t.key},i.prototype.decrease=function(t,e){var n=this._keyIndices[t];if(e>this._arr[n].priority)throw new Error("New priority is greater than current priority. Key: "+t+" Old: "+this._arr[n].priority+" New: "+e);this._arr[n].priority=e,this._decrease(n)},i.prototype._heapify=function(t){var e=this._arr,n=2*t,r=n+1,i=t;n<e.length&&(i=e[n].priority<e[i].priority?n:i,r<e.length&&(i=e[r].priority<e[i].priority?r:i),i!==t&&(this._swap(t,i),this._heapify(i)))},i.prototype._decrease=function(t){for(var e,n=this._arr,r=n[t].priority;0!==t&&!(n[e=t>>1].priority<r);)this._swap(t,e),t=e},i.prototype._swap=function(t,e){var n=this._arr,r=this._keyIndices,i=n[t],o=n[e];n[t]=o,n[e]=i,r[o.key]=t,r[i.key]=e}},6349:function(t,e,n){"use strict";var r=n(95329);t.exports=o;var i="\0";function o(t){this._isDirected=!r.has(t,"directed")||t.directed,this._isMultigraph=!!r.has(t,"multigraph")&&t.multigraph,this._isCompound=!!r.has(t,"compound")&&t.compound,this._label=void 0,this._defaultNodeLabelFn=r.constant(void 0),this._defaultEdgeLabelFn=r.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[i]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}function a(t,e){t[e]?t[e]++:t[e]=1}function s(t,e){--t[e]||delete t[e]}function l(t,e,n,i){var o=""+e,a=""+n;if(!t&&o>a){var s=o;o=a,a=s}return o+""+a+""+(r.isUndefined(i)?"\0":i)}function c(t,e,n,r){var i=""+e,o=""+n;if(!t&&i>o){var a=i;i=o,o=a}var s={v:i,w:o};return r&&(s.name=r),s}function u(t,e){return l(t,e.v,e.w,e.name)}o.prototype._nodeCount=0,o.prototype._edgeCount=0,o.prototype.isDirected=function(){return this._isDirected},o.prototype.isMultigraph=function(){return this._isMultigraph},o.prototype.isCompound=function(){return this._isCompound},o.prototype.setGraph=function(t){return this._label=t,this},o.prototype.graph=function(){return this._label},o.prototype.setDefaultNodeLabel=function(t){return r.isFunction(t)||(t=r.constant(t)),this._defaultNodeLabelFn=t,this},o.prototype.nodeCount=function(){return this._nodeCount},o.prototype.nodes=function(){return r.keys(this._nodes)},o.prototype.sources=function(){var t=this;return r.filter(this.nodes(),(function(e){return r.isEmpty(t._in[e])}))},o.prototype.sinks=function(){var t=this;return r.filter(this.nodes(),(function(e){return r.isEmpty(t._out[e])}))},o.prototype.setNodes=function(t,e){var n=arguments,i=this;return r.each(t,(function(t){n.length>1?i.setNode(t,e):i.setNode(t)})),this},o.prototype.setNode=function(t,e){return r.has(this._nodes,t)?(arguments.length>1&&(this._nodes[t]=e),this):(this._nodes[t]=arguments.length>1?e:this._defaultNodeLabelFn(t),this._isCompound&&(this._parent[t]=i,this._children[t]={},this._children[i][t]=!0),this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this)},o.prototype.node=function(t){return this._nodes[t]},o.prototype.hasNode=function(t){return r.has(this._nodes,t)},o.prototype.removeNode=function(t){var e=this;if(r.has(this._nodes,t)){var n=function(t){e.removeEdge(e._edgeObjs[t])};delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],r.each(this.children(t),(function(t){e.setParent(t)})),delete this._children[t]),r.each(r.keys(this._in[t]),n),delete this._in[t],delete this._preds[t],r.each(r.keys(this._out[t]),n),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this},o.prototype.setParent=function(t,e){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(r.isUndefined(e))e=i;else{for(var n=e+="";!r.isUndefined(n);n=this.parent(n))if(n===t)throw new Error("Setting "+e+" as parent of "+t+" would create a cycle");this.setNode(e)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=e,this._children[e][t]=!0,this},o.prototype._removeFromParentsChildList=function(t){delete this._children[this._parent[t]][t]},o.prototype.parent=function(t){if(this._isCompound){var e=this._parent[t];if(e!==i)return e}},o.prototype.children=function(t){if(r.isUndefined(t)&&(t=i),this._isCompound){var e=this._children[t];if(e)return r.keys(e)}else{if(t===i)return this.nodes();if(this.hasNode(t))return[]}},o.prototype.predecessors=function(t){var e=this._preds[t];if(e)return r.keys(e)},o.prototype.successors=function(t){var e=this._sucs[t];if(e)return r.keys(e)},o.prototype.neighbors=function(t){var e=this.predecessors(t);if(e)return r.union(e,this.successors(t))},o.prototype.isLeaf=function(t){return 0===(this.isDirected()?this.successors(t):this.neighbors(t)).length},o.prototype.filterNodes=function(t){var e=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});e.setGraph(this.graph());var n=this;r.each(this._nodes,(function(n,r){t(r)&&e.setNode(r,n)})),r.each(this._edgeObjs,(function(t){e.hasNode(t.v)&&e.hasNode(t.w)&&e.setEdge(t,n.edge(t))}));var i={};function o(t){var r=n.parent(t);return void 0===r||e.hasNode(r)?(i[t]=r,r):r in i?i[r]:o(r)}return this._isCompound&&r.each(e.nodes(),(function(t){e.setParent(t,o(t))})),e},o.prototype.setDefaultEdgeLabel=function(t){return r.isFunction(t)||(t=r.constant(t)),this._defaultEdgeLabelFn=t,this},o.prototype.edgeCount=function(){return this._edgeCount},o.prototype.edges=function(){return r.values(this._edgeObjs)},o.prototype.setPath=function(t,e){var n=this,i=arguments;return r.reduce(t,(function(t,r){return i.length>1?n.setEdge(t,r,e):n.setEdge(t,r),r})),this},o.prototype.setEdge=function(){var t,e,n,i,o=!1,s=arguments[0];"object"==typeof s&&null!==s&&"v"in s?(t=s.v,e=s.w,n=s.name,2===arguments.length&&(i=arguments[1],o=!0)):(t=s,e=arguments[1],n=arguments[3],arguments.length>2&&(i=arguments[2],o=!0)),t=""+t,e=""+e,r.isUndefined(n)||(n=""+n);var u=l(this._isDirected,t,e,n);if(r.has(this._edgeLabels,u))return o&&(this._edgeLabels[u]=i),this;if(!r.isUndefined(n)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(e),this._edgeLabels[u]=o?i:this._defaultEdgeLabelFn(t,e,n);var h=c(this._isDirected,t,e,n);return t=h.v,e=h.w,Object.freeze(h),this._edgeObjs[u]=h,a(this._preds[e],t),a(this._sucs[t],e),this._in[e][u]=h,this._out[t][u]=h,this._edgeCount++,this},o.prototype.edge=function(t,e,n){var r=1===arguments.length?u(this._isDirected,arguments[0]):l(this._isDirected,t,e,n);return this._edgeLabels[r]},o.prototype.hasEdge=function(t,e,n){var i=1===arguments.length?u(this._isDirected,arguments[0]):l(this._isDirected,t,e,n);return r.has(this._edgeLabels,i)},o.prototype.removeEdge=function(t,e,n){var r=1===arguments.length?u(this._isDirected,arguments[0]):l(this._isDirected,t,e,n),i=this._edgeObjs[r];return i&&(t=i.v,e=i.w,delete this._edgeLabels[r],delete this._edgeObjs[r],s(this._preds[e],t),s(this._sucs[t],e),delete this._in[e][r],delete this._out[t][r],this._edgeCount--),this},o.prototype.inEdges=function(t,e){var n=this._in[t];if(n){var i=r.values(n);return e?r.filter(i,(function(t){return t.v===e})):i}},o.prototype.outEdges=function(t,e){var n=this._out[t];if(n){var i=r.values(n);return e?r.filter(i,(function(t){return t.w===e})):i}},o.prototype.nodeEdges=function(t,e){var n=this.inEdges(t,e);if(n)return n.concat(this.outEdges(t,e))}},89224:function(t,e,n){t.exports={Graph:n(6349),version:n(16544)}},17401:function(t,e,n){var r=n(95329),i=n(6349);function o(t){return r.map(t.nodes(),(function(e){var n=t.node(e),i=t.parent(e),o={v:e};return r.isUndefined(n)||(o.value=n),r.isUndefined(i)||(o.parent=i),o}))}function a(t){return r.map(t.edges(),(function(e){var n=t.edge(e),i={v:e.v,w:e.w};return r.isUndefined(e.name)||(i.name=e.name),r.isUndefined(n)||(i.value=n),i}))}t.exports={write:function(t){var e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:o(t),edges:a(t)};r.isUndefined(t.graph())||(e.value=r.clone(t.graph()));return e},read:function(t){var e=new i(t.options).setGraph(t.value);return r.each(t.nodes,(function(t){e.setNode(t.v,t.value),t.parent&&e.setParent(t.v,t.parent)})),r.each(t.edges,(function(t){e.setEdge({v:t.v,w:t.w,name:t.name},t.value)})),e}}},95329:function(t,e,n){var r;try{r={clone:n(76833),constant:n(13503),each:n(76934),filter:n(64725),has:n(99946),isArray:n(80744),isEmpty:n(61627),isFunction:n(9363),isUndefined:n(16513),keys:n(55451),map:n(9924),reduce:n(16473),size:n(40617),transform:n(91116),union:n(44065),values:n(81229)}}catch(t){}r||(r=window._),t.exports=r},16544:function(t){t.exports="2.1.8"},34634:function(t,e,n){"use strict";n.r(e),n.d(e,{isAnyArray:function(){return i}});const r=Object.prototype.toString;function i(t){const e=r.call(t);return e.endsWith("Array]")&&!e.includes("Big")}},55973:function(t){t.exports=function(t){return!(!t||"string"==typeof t)&&(t instanceof Array||Array.isArray(t)||t.length>=0&&(t.splice instanceof Function||Object.getOwnPropertyDescriptor(t,t.length-1)&&"String"!==t.constructor.name))}},15584:function(t,e,n){var r=n(73893)(n(33152),"DataView");t.exports=r},97288:function(t,e,n){var r=n(73893)(n(33152),"Promise");t.exports=r},23599:function(t,e,n){var r=n(73893)(n(33152),"Set");t.exports=r},98924:function(t,e,n){var r=n(52166),i=n(34776),o=n(40393);function a(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new r;++e<n;)this.add(t[e])}a.prototype.add=a.prototype.push=i,a.prototype.has=o,t.exports=a},26873:function(t,e,n){var r=n(73893)(n(33152),"WeakMap");t.exports=r},74809:function(t){t.exports=function(t,e){for(var n=-1,r=null==t?0:t.length;++n<r&&!1!==e(t[n],n,t););return t}},86952:function(t){t.exports=function(t,e){for(var n=-1,r=null==t?0:t.length,i=0,o=[];++n<r;){var a=t[n];e(a,n,t)&&(o[i++]=a)}return o}},84271:function(t,e,n){var r=n(17424);t.exports=function(t,e){return!!(null==t?0:t.length)&&r(t,e,0)>-1}},94874:function(t){t.exports=function(t,e,n){for(var r=-1,i=null==t?0:t.length;++r<i;)if(n(e,t[r]))return!0;return!1}},75010:function(t){t.exports=function(t,e){for(var n=-1,r=null==t?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}},57095:function(t){t.exports=function(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}},99861:function(t){t.exports=function(t,e,n,r){var i=-1,o=null==t?0:t.length;for(r&&o&&(n=t[++i]);++i<o;)n=e(n,t[i],i,t);return n}},64045:function(t){t.exports=function(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}},26539:function(t,e,n){var r=n(22310)("length");t.exports=r},91937:function(t,e,n){var r=n(95378),i=n(55451);t.exports=function(t,e){return t&&r(e,i(e),t)}},26680:function(t,e,n){var r=n(95378),i=n(56730);t.exports=function(t,e){return t&&r(e,i(e),t)}},99045:function(t,e,n){var r=n(91866),i=n(74809),o=n(60348),a=n(91937),s=n(26680),l=n(32315),c=n(47760),u=n(15168),h=n(71678),d=n(12076),f=n(22675),p=n(66139),g=n(79264),v=n(97541),m=n(4084),y=n(80744),b=n(57835),x=n(41626),E=n(20816),w=n(65226),k=n(55451),M=n(56730),S="[object Arguments]",A="[object Function]",N="[object Object]",C={};C[S]=C["[object Array]"]=C["[object ArrayBuffer]"]=C["[object DataView]"]=C["[object Boolean]"]=C["[object Date]"]=C["[object Float32Array]"]=C["[object Float64Array]"]=C["[object Int8Array]"]=C["[object Int16Array]"]=C["[object Int32Array]"]=C["[object Map]"]=C["[object Number]"]=C[N]=C["[object RegExp]"]=C["[object Set]"]=C["[object String]"]=C["[object Symbol]"]=C["[object Uint8Array]"]=C["[object Uint8ClampedArray]"]=C["[object Uint16Array]"]=C["[object Uint32Array]"]=!0,C["[object Error]"]=C[A]=C["[object WeakMap]"]=!1,t.exports=function t(e,n,O,T,P,R){var D,L=1&n,I=2&n,B=4&n;if(O&&(D=P?O(e,T,P,R):O(e)),void 0!==D)return D;if(!E(e))return e;var j=y(e);if(j){if(D=g(e),!L)return c(e,D)}else{var z=p(e),F=z==A||"[object GeneratorFunction]"==z;if(b(e))return l(e,L);if(z==N||z==S||F&&!P){if(D=I||F?{}:m(e),!L)return I?h(e,s(D,e)):u(e,a(D,e))}else{if(!C[z])return P?e:{};D=v(e,z,L)}}R||(R=new r);var _=R.get(e);if(_)return _;R.set(e,D),w(e)?e.forEach((function(r){D.add(t(r,n,O,r,e,R))})):x(e)&&e.forEach((function(r,i){D.set(i,t(r,n,O,i,e,R))}));var Z=j?void 0:(B?I?f:d:I?M:k)(e);return i(Z||e,(function(r,i){Z&&(r=e[i=r]),o(D,i,t(r,n,O,i,e,R))})),D}},44107:function(t,e,n){var r=n(1585),i=n(49164)(r);t.exports=i},2659:function(t,e,n){var r=n(45029);t.exports=function(t,e,n){for(var i=-1,o=t.length;++i<o;){var a=t[i],s=e(a);if(null!=s&&(void 0===l?s==s&&!r(s):n(s,l)))var l=s,c=a}return c}},32872:function(t,e,n){var r=n(44107);t.exports=function(t,e){var n=[];return r(t,(function(t,r,i){e(t,r,i)&&n.push(t)})),n}},51533:function(t){t.exports=function(t,e,n,r){for(var i=t.length,o=n+(r?1:-1);r?o--:++o<i;)if(e(t[o],o,t))return o;return-1}},9256:function(t,e,n){var r=n(57095),i=n(99869);t.exports=function t(e,n,o,a,s){var l=-1,c=e.length;for(o||(o=i),s||(s=[]);++l<c;){var u=e[l];n>0&&o(u)?n>1?t(u,n-1,o,a,s):r(s,u):a||(s[s.length]=u)}return s}},1585:function(t,e,n){var r=n(14018),i=n(55451);t.exports=function(t,e){return t&&r(t,e,i)}},89147:function(t,e,n){var r=n(1186),i=n(9171);t.exports=function(t,e){for(var n=0,o=(e=r(e,t)).length;null!=t&&n<o;)t=t[i(e[n++])];return n&&n==o?t:void 0}},75635:function(t,e,n){var r=n(57095),i=n(80744);t.exports=function(t,e,n){var o=e(t);return i(t)?o:r(o,n(t))}},40302:function(t){t.exports=function(t,e){return t>e}},3251:function(t){var e=Object.prototype.hasOwnProperty;t.exports=function(t,n){return null!=t&&e.call(t,n)}},62348:function(t){t.exports=function(t,e){return null!=t&&e in Object(t)}},17424:function(t,e,n){var r=n(51533),i=n(8373),o=n(49237);t.exports=function(t,e,n){return e==e?o(t,e,n):r(t,i,n)}},77295:function(t,e,n){var r=n(84412),i=n(93913);t.exports=function t(e,n,o,a,s){return e===n||(null==e||null==n||!i(e)&&!i(n)?e!=e&&n!=n:r(e,n,o,a,t,s))}},84412:function(t,e,n){var r=n(91866),i=n(50401),o=n(57710),a=n(4983),s=n(66139),l=n(80744),c=n(57835),u=n(18397),h="[object Arguments]",d="[object Array]",f="[object Object]",p=Object.prototype.hasOwnProperty;t.exports=function(t,e,n,g,v,m){var y=l(t),b=l(e),x=y?d:s(t),E=b?d:s(e),w=(x=x==h?f:x)==f,k=(E=E==h?f:E)==f,M=x==E;if(M&&c(t)){if(!c(e))return!1;y=!0,w=!1}if(M&&!w)return m||(m=new r),y||u(t)?i(t,e,n,g,v,m):o(t,e,x,n,g,v,m);if(!(1&n)){var S=w&&p.call(t,"__wrapped__"),A=k&&p.call(e,"__wrapped__");if(S||A){var N=S?t.value():t,C=A?e.value():e;return m||(m=new r),v(N,C,n,g,m)}}return!!M&&(m||(m=new r),a(t,e,n,g,v,m))}},55005:function(t,e,n){var r=n(66139),i=n(93913);t.exports=function(t){return i(t)&&"[object Map]"==r(t)}},51524:function(t,e,n){var r=n(91866),i=n(77295);t.exports=function(t,e,n,o){var a=n.length,s=a,l=!o;if(null==t)return!s;for(t=Object(t);a--;){var c=n[a];if(l&&c[2]?c[1]!==t[c[0]]:!(c[0]in t))return!1}for(;++a<s;){var u=(c=n[a])[0],h=t[u],d=c[1];if(l&&c[2]){if(void 0===h&&!(u in t))return!1}else{var f=new r;if(o)var p=o(h,d,u,t,e,f);if(!(void 0===p?i(d,h,3,o,f):p))return!1}}return!0}},8373:function(t){t.exports=function(t){return t!=t}},38652:function(t,e,n){var r=n(66139),i=n(93913);t.exports=function(t){return i(t)&&"[object Set]"==r(t)}},95979:function(t,e,n){var r=n(17632),i=n(38933),o=n(46962),a=n(80744),s=n(35769);t.exports=function(t){return"function"==typeof t?t:null==t?o:"object"==typeof t?a(t)?i(t[0],t[1]):r(t):s(t)}},6019:function(t,e,n){var r=n(7975),i=n(23730),o=Object.prototype.hasOwnProperty;t.exports=function(t){if(!r(t))return i(t);var e=[];for(var n in Object(t))o.call(t,n)&&"constructor"!=n&&e.push(n);return e}},93757:function(t){t.exports=function(t,e){return t<e}},65487:function(t,e,n){var r=n(44107),i=n(24665);t.exports=function(t,e){var n=-1,o=i(t)?Array(t.length):[];return r(t,(function(t,r,i){o[++n]=e(t,r,i)})),o}},17632:function(t,e,n){var r=n(51524),i=n(10261),o=n(24122);t.exports=function(t){var e=i(t);return 1==e.length&&e[0][2]?o(e[0][0],e[0][1]):function(n){return n===t||r(n,t,e)}}},38933:function(t,e,n){var r=n(77295),i=n(44231),o=n(37879),a=n(86773),s=n(88411),l=n(24122),c=n(9171);t.exports=function(t,e){return a(t)&&s(e)?l(c(t),e):function(n){var a=i(n,t);return void 0===a&&a===e?o(n,t):r(e,a,3)}}},58506:function(t,e,n){var r=n(75010),i=n(89147),o=n(95979),a=n(65487),s=n(33065),l=n(38342),c=n(11249),u=n(46962),h=n(80744);t.exports=function(t,e,n){e=e.length?r(e,(function(t){return h(t)?function(e){return i(e,1===t.length?t[0]:t)}:t})):[u];var d=-1;e=r(e,l(o));var f=a(t,(function(t,n,i){return{criteria:r(e,(function(e){return e(t)})),index:++d,value:t}}));return s(f,(function(t,e){return c(t,e,n)}))}},88832:function(t,e,n){var r=n(10867),i=n(37879);t.exports=function(t,e){return r(t,e,(function(e,n){return i(t,n)}))}},10867:function(t,e,n){var r=n(89147),i=n(36897),o=n(1186);t.exports=function(t,e,n){for(var a=-1,s=e.length,l={};++a<s;){var c=e[a],u=r(t,c);n(u,c)&&i(l,o(c,t),u)}return l}},22310:function(t){t.exports=function(t){return function(e){return null==e?void 0:e[t]}}},96916:function(t,e,n){var r=n(89147);t.exports=function(t){return function(e){return r(e,t)}}},36121:function(t){var e=Math.ceil,n=Math.max;t.exports=function(t,r,i,o){for(var a=-1,s=n(e((r-t)/(i||1)),0),l=Array(s);s--;)l[o?s:++a]=t,t+=i;return l}},30739:function(t){t.exports=function(t,e,n,r,i){return i(t,(function(t,i,o){n=r?(r=!1,t):e(n,t,i,o)})),n}},36897:function(t,e,n){var r=n(60348),i=n(1186),o=n(70213),a=n(20816),s=n(9171);t.exports=function(t,e,n,l){if(!a(t))return t;for(var c=-1,u=(e=i(e,t)).length,h=u-1,d=t;null!=d&&++c<u;){var f=s(e[c]),p=n;if("__proto__"===f||"constructor"===f||"prototype"===f)return t;if(c!=h){var g=d[f];void 0===(p=l?l(g,f,d):void 0)&&(p=a(g)?g:o(e[c+1])?[]:{})}r(d,f,p),d=d[f]}return t}},33065:function(t){t.exports=function(t,e){var n=t.length;for(t.sort(e);n--;)t[n]=t[n].value;return t}},50230:function(t,e,n){var r=n(91869),i=n(75010),o=n(80744),a=n(45029),s=r?r.prototype:void 0,l=s?s.toString:void 0;t.exports=function t(e){if("string"==typeof e)return e;if(o(e))return i(e,t)+"";if(a(e))return l?l.call(e):"";var n=e+"";return"0"==n&&1/e==-Infinity?"-0":n}},13927:function(t,e,n){var r=n(15333),i=/^\s+/;t.exports=function(t){return t?t.slice(0,r(t)+1).replace(i,""):t}},29098:function(t,e,n){var r=n(98924),i=n(84271),o=n(94874),a=n(1931),s=n(47506),l=n(79679);t.exports=function(t,e,n){var c=-1,u=i,h=t.length,d=!0,f=[],p=f;if(n)d=!1,u=o;else if(h>=200){var g=e?null:s(t);if(g)return l(g);d=!1,u=a,p=new r}else p=e?[]:f;t:for(;++c<h;){var v=t[c],m=e?e(v):v;if(v=n||0!==v?v:0,d&&m==m){for(var y=p.length;y--;)if(p[y]===m)continue t;e&&p.push(m),f.push(v)}else u(p,m,n)||(p!==f&&p.push(m),f.push(v))}return f}},20720:function(t,e,n){var r=n(75010);t.exports=function(t,e){return r(e,(function(e){return t[e]}))}},94484:function(t){t.exports=function(t,e,n){for(var r=-1,i=t.length,o=e.length,a={};++r<i;){var s=r<o?e[r]:void 0;n(a,t[r],s)}return a}},1931:function(t){t.exports=function(t,e){return t.has(e)}},11756:function(t,e,n){var r=n(46962);t.exports=function(t){return"function"==typeof t?t:r}},1186:function(t,e,n){var r=n(80744),i=n(86773),o=n(40493),a=n(44140);t.exports=function(t,e){return r(t)?t:i(t,e)?[t]:o(a(t))}},27984:function(t,e,n){var r=n(20188);t.exports=function(t,e){var n=e?r(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}},78583:function(t){var e=/\w*$/;t.exports=function(t){var n=new t.constructor(t.source,e.exec(t));return n.lastIndex=t.lastIndex,n}},28757:function(t,e,n){var r=n(91869),i=r?r.prototype:void 0,o=i?i.valueOf:void 0;t.exports=function(t){return o?Object(o.call(t)):{}}},83018:function(t,e,n){var r=n(45029);t.exports=function(t,e){if(t!==e){var n=void 0!==t,i=null===t,o=t==t,a=r(t),s=void 0!==e,l=null===e,c=e==e,u=r(e);if(!l&&!u&&!a&&t>e||a&&s&&c&&!l&&!u||i&&s&&c||!n&&c||!o)return 1;if(!i&&!a&&!u&&t<e||u&&n&&o&&!i&&!a||l&&n&&o||!s&&o||!c)return-1}return 0}},11249:function(t,e,n){var r=n(83018);t.exports=function(t,e,n){for(var i=-1,o=t.criteria,a=e.criteria,s=o.length,l=n.length;++i<s;){var c=r(o[i],a[i]);if(c)return i>=l?c:c*("desc"==n[i]?-1:1)}return t.index-e.index}},15168:function(t,e,n){var r=n(95378),i=n(58966);t.exports=function(t,e){return r(t,i(t),e)}},71678:function(t,e,n){var r=n(95378),i=n(66817);t.exports=function(t,e){return r(t,i(t),e)}},49164:function(t,e,n){var r=n(24665);t.exports=function(t,e){return function(n,i){if(null==n)return n;if(!r(n))return t(n,i);for(var o=n.length,a=e?o:-1,s=Object(n);(e?a--:++a<o)&&!1!==i(s[a],a,s););return n}}},19554:function(t,e,n){var r=n(95979),i=n(24665),o=n(55451);t.exports=function(t){return function(e,n,a){var s=Object(e);if(!i(e)){var l=r(n,3);e=o(e),n=function(t){return l(s[t],t,s)}}var c=t(e,n,a);return c>-1?s[l?e[c]:c]:void 0}}},76106:function(t,e,n){var r=n(36121),i=n(8138),o=n(97341);t.exports=function(t){return function(e,n,a){return a&&"number"!=typeof a&&i(e,n,a)&&(n=a=void 0),e=o(e),void 0===n?(n=e,e=0):n=o(n),a=void 0===a?e<n?1:-1:o(a),r(e,n,a,t)}}},47506:function(t,e,n){var r=n(23599),i=n(9958),o=n(79679),a=r&&1/o(new r([,-0]))[1]==1/0?function(t){return new r(t)}:i;t.exports=a},50401:function(t,e,n){var r=n(98924),i=n(64045),o=n(1931);t.exports=function(t,e,n,a,s,l){var c=1&n,u=t.length,h=e.length;if(u!=h&&!(c&&h>u))return!1;var d=l.get(t),f=l.get(e);if(d&&f)return d==e&&f==t;var p=-1,g=!0,v=2&n?new r:void 0;for(l.set(t,e),l.set(e,t);++p<u;){var m=t[p],y=e[p];if(a)var b=c?a(y,m,p,e,t,l):a(m,y,p,t,e,l);if(void 0!==b){if(b)continue;g=!1;break}if(v){if(!i(e,(function(t,e){if(!o(v,e)&&(m===t||s(m,t,n,a,l)))return v.push(e)}))){g=!1;break}}else if(m!==y&&!s(m,y,n,a,l)){g=!1;break}}return l.delete(t),l.delete(e),g}},57710:function(t,e,n){var r=n(91869),i=n(77945),o=n(43607),a=n(50401),s=n(83383),l=n(79679),c=r?r.prototype:void 0,u=c?c.valueOf:void 0;t.exports=function(t,e,n,r,c,h,d){switch(n){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=e.byteLength||!h(new i(t),new i(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return o(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case"[object Map]":var f=s;case"[object Set]":var p=1&r;if(f||(f=l),t.size!=e.size&&!p)return!1;var g=d.get(t);if(g)return g==e;r|=2,d.set(t,e);var v=a(f(t),f(e),r,c,h,d);return d.delete(t),v;case"[object Symbol]":if(u)return u.call(t)==u.call(e)}return!1}},4983:function(t,e,n){var r=n(12076),i=Object.prototype.hasOwnProperty;t.exports=function(t,e,n,o,a,s){var l=1&n,c=r(t),u=c.length;if(u!=r(e).length&&!l)return!1;for(var h=u;h--;){var d=c[h];if(!(l?d in e:i.call(e,d)))return!1}var f=s.get(t),p=s.get(e);if(f&&p)return f==e&&p==t;var g=!0;s.set(t,e),s.set(e,t);for(var v=l;++h<u;){var m=t[d=c[h]],y=e[d];if(o)var b=l?o(y,m,d,e,t,s):o(m,y,d,t,e,s);if(!(void 0===b?m===y||a(m,y,n,o,s):b)){g=!1;break}v||(v="constructor"==d)}if(g&&!v){var x=t.constructor,E=e.constructor;x==E||!("constructor"in t)||!("constructor"in e)||"function"==typeof x&&x instanceof x&&"function"==typeof E&&E instanceof E||(g=!1)}return s.delete(t),s.delete(e),g}},522:function(t,e,n){var r=n(40151),i=n(19652),o=n(71152);t.exports=function(t){return o(i(t,void 0,r),t+"")}},12076:function(t,e,n){var r=n(75635),i=n(58966),o=n(55451);t.exports=function(t){return r(t,o,i)}},22675:function(t,e,n){var r=n(75635),i=n(66817),o=n(56730);t.exports=function(t){return r(t,o,i)}},10261:function(t,e,n){var r=n(88411),i=n(55451);t.exports=function(t){for(var e=i(t),n=e.length;n--;){var o=e[n],a=t[o];e[n]=[o,a,r(a)]}return e}},58966:function(t,e,n){var r=n(86952),i=n(4134),o=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols,s=a?function(t){return null==t?[]:(t=Object(t),r(a(t),(function(e){return o.call(t,e)})))}:i;t.exports=s},66817:function(t,e,n){var r=n(57095),i=n(49217),o=n(58966),a=n(4134),s=Object.getOwnPropertySymbols?function(t){for(var e=[];t;)r(e,o(t)),t=i(t);return e}:a;t.exports=s},66139:function(t,e,n){var r=n(15584),i=n(40164),o=n(97288),a=n(23599),s=n(26873),l=n(86756),c=n(63256),u="[object Map]",h="[object Promise]",d="[object Set]",f="[object WeakMap]",p="[object DataView]",g=c(r),v=c(i),m=c(o),y=c(a),b=c(s),x=l;(r&&x(new r(new ArrayBuffer(1)))!=p||i&&x(new i)!=u||o&&x(o.resolve())!=h||a&&x(new a)!=d||s&&x(new s)!=f)&&(x=function(t){var e=l(t),n="[object Object]"==e?t.constructor:void 0,r=n?c(n):"";if(r)switch(r){case g:return p;case v:return u;case m:return h;case y:return d;case b:return f}return e}),t.exports=x},63100:function(t,e,n){var r=n(1186),i=n(13053),o=n(80744),a=n(70213),s=n(11156),l=n(9171);t.exports=function(t,e,n){for(var c=-1,u=(e=r(e,t)).length,h=!1;++c<u;){var d=l(e[c]);if(!(h=null!=t&&n(t,d)))break;t=t[d]}return h||++c!=u?h:!!(u=null==t?0:t.length)&&s(u)&&a(d,u)&&(o(t)||i(t))}},55015:function(t){var e=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");t.exports=function(t){return e.test(t)}},79264:function(t){var e=Object.prototype.hasOwnProperty;t.exports=function(t){var n=t.length,r=new t.constructor(n);return n&&"string"==typeof t[0]&&e.call(t,"index")&&(r.index=t.index,r.input=t.input),r}},97541:function(t,e,n){var r=n(20188),i=n(27984),o=n(78583),a=n(28757),s=n(78358);t.exports=function(t,e,n){var l=t.constructor;switch(e){case"[object ArrayBuffer]":return r(t);case"[object Boolean]":case"[object Date]":return new l(+t);case"[object DataView]":return i(t,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return s(t,n);case"[object Map]":case"[object Set]":return new l;case"[object Number]":case"[object String]":return new l(t);case"[object RegExp]":return o(t);case"[object Symbol]":return a(t)}}},99869:function(t,e,n){var r=n(91869),i=n(13053),o=n(80744),a=r?r.isConcatSpreadable:void 0;t.exports=function(t){return o(t)||i(t)||!!(a&&t&&t[a])}},86773:function(t,e,n){var r=n(80744),i=n(45029),o=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;t.exports=function(t,e){if(r(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!i(t))||(a.test(t)||!o.test(t)||null!=e&&t in Object(e))}},88411:function(t,e,n){var r=n(20816);t.exports=function(t){return t==t&&!r(t)}},83383:function(t){t.exports=function(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n}},24122:function(t){t.exports=function(t,e){return function(n){return null!=n&&(n[t]===e&&(void 0!==e||t in Object(n)))}}},26332:function(t,e,n){var r=n(52858);t.exports=function(t){var e=r(t,(function(t){return 500===n.size&&n.clear(),t})),n=e.cache;return e}},23730:function(t,e,n){var r=n(31030)(Object.keys,Object);t.exports=r},34776:function(t){t.exports=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this}},40393:function(t){t.exports=function(t){return this.__data__.has(t)}},79679:function(t){t.exports=function(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}},49237:function(t){t.exports=function(t,e,n){for(var r=n-1,i=t.length;++r<i;)if(t[r]===e)return r;return-1}},29405:function(t,e,n){var r=n(26539),i=n(55015),o=n(60844);t.exports=function(t){return i(t)?o(t):r(t)}},40493:function(t,e,n){var r=n(26332),i=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,o=/\\(\\)?/g,a=r((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(i,(function(t,n,r,i){e.push(r?i.replace(o,"$1"):n||t)})),e}));t.exports=a},9171:function(t,e,n){var r=n(45029);t.exports=function(t){if("string"==typeof t||r(t))return t;var e=t+"";return"0"==e&&1/t==-Infinity?"-0":e}},15333:function(t){var e=/\s/;t.exports=function(t){for(var n=t.length;n--&&e.test(t.charAt(n)););return n}},60844:function(t){var e="\\ud800-\\udfff",n="["+e+"]",r="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",i="\\ud83c[\\udffb-\\udfff]",o="[^"+e+"]",a="(?:\\ud83c[\\udde6-\\uddff]){2}",s="[\\ud800-\\udbff][\\udc00-\\udfff]",l="(?:"+r+"|"+i+")"+"?",c="[\\ufe0e\\ufe0f]?",u=c+l+("(?:\\u200d(?:"+[o,a,s].join("|")+")"+c+l+")*"),h="(?:"+[o+r+"?",r,a,s,n].join("|")+")",d=RegExp(i+"(?="+i+")|"+h+u,"g");t.exports=function(t){for(var e=d.lastIndex=0;d.test(t);)++e;return e}},76833:function(t,e,n){var r=n(99045);t.exports=function(t){return r(t,4)}},20250:function(t,e,n){var r=n(99045);t.exports=function(t){return r(t,5)}},28548:function(t,e,n){var r=n(92918),i=n(43607),o=n(8138),a=n(56730),s=Object.prototype,l=s.hasOwnProperty,c=r((function(t,e){t=Object(t);var n=-1,r=e.length,c=r>2?e[2]:void 0;for(c&&o(e[0],e[1],c)&&(r=1);++n<r;)for(var u=e[n],h=a(u),d=-1,f=h.length;++d<f;){var p=h[d],g=t[p];(void 0===g||i(g,s[p])&&!l.call(t,p))&&(t[p]=u[p])}return t}));t.exports=c},76934:function(t,e,n){t.exports=n(99204)},64725:function(t,e,n){var r=n(86952),i=n(32872),o=n(95979),a=n(80744);t.exports=function(t,e){return(a(t)?r:i)(t,o(e,3))}},79785:function(t,e,n){var r=n(19554)(n(9991));t.exports=r},9991:function(t,e,n){var r=n(51533),i=n(95979),o=n(12824),a=Math.max;t.exports=function(t,e,n){var s=null==t?0:t.length;if(!s)return-1;var l=null==n?0:o(n);return l<0&&(l=a(s+l,0)),r(t,i(e,3),l)}},40151:function(t,e,n){var r=n(9256);t.exports=function(t){return(null==t?0:t.length)?r(t,1):[]}},99204:function(t,e,n){var r=n(74809),i=n(44107),o=n(11756),a=n(80744);t.exports=function(t,e){return(a(t)?r:i)(t,o(e))}},23190:function(t,e,n){var r=n(14018),i=n(11756),o=n(56730);t.exports=function(t,e){return null==t?t:r(t,i(e),o)}},44231:function(t,e,n){var r=n(89147);t.exports=function(t,e,n){var i=null==t?void 0:r(t,e);return void 0===i?n:i}},99946:function(t,e,n){var r=n(3251),i=n(63100);t.exports=function(t,e){return null!=t&&i(t,e,r)}},37879:function(t,e,n){var r=n(62348),i=n(63100);t.exports=function(t,e){return null!=t&&i(t,e,r)}},61627:function(t,e,n){var r=n(6019),i=n(66139),o=n(13053),a=n(80744),s=n(24665),l=n(57835),c=n(7975),u=n(18397),h=Object.prototype.hasOwnProperty;t.exports=function(t){if(null==t)return!0;if(s(t)&&(a(t)||"string"==typeof t||"function"==typeof t.splice||l(t)||u(t)||o(t)))return!t.length;var e=i(t);if("[object Map]"==e||"[object Set]"==e)return!t.size;if(c(t))return!r(t).length;for(var n in t)if(h.call(t,n))return!1;return!0}},41626:function(t,e,n){var r=n(55005),i=n(38342),o=n(52495),a=o&&o.isMap,s=a?i(a):r;t.exports=s},65226:function(t,e,n){var r=n(38652),i=n(38342),o=n(52495),a=o&&o.isSet,s=a?i(a):r;t.exports=s},7941:function(t,e,n){var r=n(86756),i=n(80744),o=n(93913);t.exports=function(t){return"string"==typeof t||!i(t)&&o(t)&&"[object String]"==r(t)}},45029:function(t,e,n){var r=n(86756),i=n(93913);t.exports=function(t){return"symbol"==typeof t||i(t)&&"[object Symbol]"==r(t)}},16513:function(t){t.exports=function(t){return void 0===t}},55451:function(t,e,n){var r=n(63333),i=n(6019),o=n(24665);t.exports=function(t){return o(t)?r(t):i(t)}},10611:function(t){t.exports=function(t){var e=null==t?0:t.length;return e?t[e-1]:void 0}},9924:function(t,e,n){var r=n(75010),i=n(95979),o=n(65487),a=n(80744);t.exports=function(t,e){return(a(t)?r:o)(t,i(e,3))}},70642:function(t,e,n){var r=n(42813),i=n(1585),o=n(95979);t.exports=function(t,e){var n={};return e=o(e,3),i(t,(function(t,i,o){r(n,i,e(t,i,o))})),n}},95987:function(t,e,n){var r=n(2659),i=n(40302),o=n(46962);t.exports=function(t){return t&&t.length?r(t,o,i):void 0}},52858:function(t,e,n){var r=n(52166);function i(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=t.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(i.Cache||r),n}i.Cache=r,t.exports=i},73376:function(t,e,n){var r=n(2659),i=n(93757),o=n(46962);t.exports=function(t){return t&&t.length?r(t,o,i):void 0}},83296:function(t,e,n){var r=n(2659),i=n(95979),o=n(93757);t.exports=function(t,e){return t&&t.length?r(t,i(e,2),o):void 0}},9958:function(t){t.exports=function(){}},5795:function(t,e,n){var r=n(33152);t.exports=function(){return r.Date.now()}},89409:function(t,e,n){var r=n(88832),i=n(522)((function(t,e){return null==t?{}:r(t,e)}));t.exports=i},35769:function(t,e,n){var r=n(22310),i=n(96916),o=n(86773),a=n(9171);t.exports=function(t){return o(t)?r(a(t)):i(t)}},60859:function(t,e,n){var r=n(76106)();t.exports=r},16473:function(t,e,n){var r=n(99861),i=n(44107),o=n(95979),a=n(30739),s=n(80744);t.exports=function(t,e,n){var l=s(t)?r:a,c=arguments.length<3;return l(t,o(e,4),n,c,i)}},40617:function(t,e,n){var r=n(6019),i=n(66139),o=n(24665),a=n(7941),s=n(29405);t.exports=function(t){if(null==t)return 0;if(o(t))return a(t)?s(t):t.length;var e=i(t);return"[object Map]"==e||"[object Set]"==e?t.size:r(t).length}},351:function(t,e,n){var r=n(9256),i=n(58506),o=n(92918),a=n(8138),s=o((function(t,e){if(null==t)return[];var n=e.length;return n>1&&a(t,e[0],e[1])?e=[]:n>2&&a(e[0],e[1],e[2])&&(e=[e[0]]),i(t,r(e,1),[])}));t.exports=s},4134:function(t){t.exports=function(){return[]}},97341:function(t,e,n){var r=n(59406),i=1/0;t.exports=function(t){return t?(t=r(t))===i||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}},12824:function(t,e,n){var r=n(97341);t.exports=function(t){var e=r(t),n=e%1;return e==e?n?e-n:e:0}},59406:function(t,e,n){var r=n(13927),i=n(20816),o=n(45029),a=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,l=/^0o[0-7]+$/i,c=parseInt;t.exports=function(t){if("number"==typeof t)return t;if(o(t))return NaN;if(i(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=i(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=r(t);var n=s.test(t);return n||l.test(t)?c(t.slice(2),n?2:8):a.test(t)?NaN:+t}},44140:function(t,e,n){var r=n(50230);t.exports=function(t){return null==t?"":r(t)}},91116:function(t,e,n){var r=n(74809),i=n(35024),o=n(1585),a=n(95979),s=n(49217),l=n(80744),c=n(57835),u=n(9363),h=n(20816),d=n(18397);t.exports=function(t,e,n){var f=l(t),p=f||c(t)||d(t);if(e=a(e,4),null==n){var g=t&&t.constructor;n=p?f?new g:[]:h(t)&&u(g)?i(s(t)):{}}return(p?r:o)(t,(function(t,r,i){return e(n,t,r,i)})),n}},44065:function(t,e,n){var r=n(9256),i=n(92918),o=n(29098),a=n(41590),s=i((function(t){return o(r(t,1,a,!0))}));t.exports=s},95708:function(t,e,n){var r=n(44140),i=0;t.exports=function(t){var e=++i;return r(t)+e}},81229:function(t,e,n){var r=n(20720),i=n(55451);t.exports=function(t){return null==t?[]:r(t,i(t))}},65441:function(t,e,n){var r=n(60348),i=n(94484);t.exports=function(t,e){return i(t||[],e||[],r)}},34402:function(t,e,n){"use strict";n.r(e),n.d(e,{default:function(){return a}});var r=n(34634);function i(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!(0,r.isAnyArray)(t))throw new TypeError("input must be an array");if(0===t.length)throw new TypeError("input must not be empty");var n=e.fromIndex,i=void 0===n?0:n,o=e.toIndex,a=void 0===o?t.length:o;if(i<0||i>=t.length||!Number.isInteger(i))throw new Error("fromIndex must be a positive integer smaller than length");if(a<=i||a>t.length||!Number.isInteger(a))throw new Error("toIndex must be an integer greater than fromIndex and at most equal to length");for(var s=t[i],l=i+1;l<a;l++)t[l]>s&&(s=t[l]);return s}function o(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!(0,r.isAnyArray)(t))throw new TypeError("input must be an array");if(0===t.length)throw new TypeError("input must not be empty");var n=e.fromIndex,i=void 0===n?0:n,o=e.toIndex,a=void 0===o?t.length:o;if(i<0||i>=t.length||!Number.isInteger(i))throw new Error("fromIndex must be a positive integer smaller than length");if(a<=i||a>t.length||!Number.isInteger(a))throw new Error("toIndex must be an integer greater than fromIndex and at most equal to length");for(var s=t[i],l=i+1;l<a;l++)t[l]<s&&(s=t[l]);return s}function a(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!(0,r.isAnyArray)(t))throw new TypeError("input must be an array");if(0===t.length)throw new TypeError("input must not be empty");if(void 0!==n.output){if(!(0,r.isAnyArray)(n.output))throw new TypeError("output option must be an array if specified");e=n.output}else e=new Array(t.length);var a=o(t),s=i(t);if(a===s)throw new RangeError("minimum and maximum input values are equal. Cannot rescale a constant array");var l=n.min,c=void 0===l?n.autoMinMax?a:0:l,u=n.max,h=void 0===u?n.autoMinMax?s:1:u;if(c>=h)throw new RangeError("min option must be smaller than max option");for(var d=(h-c)/(s-a),f=0;f<t.length;f++)e[f]=(t[f]-a)*d+c;return e}},81683:function(t,e,n){"use strict";var r=n(55973),i=Array.prototype.concat,o=Array.prototype.slice,a=t.exports=function(t){for(var e=[],n=0,a=t.length;n<a;n++){var s=t[n];r(s)?e=i.call(e,o.call(s)):e.push(s)}return e};a.wrap=function(t){return function(){return t(a(arguments))}}},99755:function(t){"use strict";t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFQAAABSCAYAAADKMvPcAAAAAXNSR0IArs4c6QAAFkdJREFUeF7NXXlsHNd5/2Z3Z3e5S3J5LClREklJlGxZtmzJUVo0boEICdI2BYICrQQ0PaJaV2JZSOO6NtC/+EfbFC36T902QBpFllxbDYXayFH1MArXQRugKIIojmQ7kSlKpMX7Wh6z3B3uvuJ7b76ZNzNvDl6ulqZI7szOfO/3ft/93lgDz+vP2ZuFHsh37YSOhkZIJ7zHN+NvHQAMMKEOrD4O8+YirCw0wNj9E9qJ2lqv389YoqP8/Z3bkoXmgpZPt+q6loa0Rtcxwy4YcBDl87/wXRMqwOr3K/OVCbN8/1zb0ZL3PPvGjDHtCvzX/r3Q1WQAfpmA9xP/bu4LRdOtrxzogN8MUuxOZXyxmimP/L52bCXqjv1sIN0De3b1mvkWTU9rhomSkrRRUqshs+8pDdk5E+UE0HUdCpDjv9+oTc3+XsMTQ7KsHFAE8zL898ECNGenoQQlG1BZyKghxjsuBEQ4gQOJoqGA+F3Ed0yAH+oj989rx8aDrvg37H/aHzGbesu6ppVMw5ZXkECgYWOi5EMEoNIFhKQosZA6ZwGKsnbpObhZG536QsPRYZKVA/rX7D/62iHfMgYlwG8EFL8/CoaK2dahCAUOaJf1832YmD+pPTXoBfVvjbe7e1OtndNgAH1zAkgMVWIYqGhRbBWQyoCinEU9Bz1QgHZoYO/lpn9yTjvK76D1s+/mdkPLI8NQgmGYBsFQ0+IozfRmqr0koCkU32aoLgDtgSL/OVKdXP585hPvE6hfK7+1e3uyvR1lxYnnspqmzVBOLElU+lUJGT8YBqb7mA2oJS+yEwHt04tQWl1c+O3Ckdsc0L9g1/tqUG8ZhGkOqGCnV3U2D1BSIT4cDigOC1VeAItAclB1AeoNY2TsxfxnRr86/73Wnlxx7xgYXE78KdQdJ9/kSMpSqsG0QPINxwMsHhc+yAU6gYqyFnUEU3x3QzP75dy+H2maxrQ/Zf/y+ATM6ggoqbsDZzy7uK6zLDDJopJzEmovwMTvJkixm0sjg9sbO/YsQjXJzZKJ7HQmnkMp/pNefoYhe2UnEyi3Gcxcbke5iUIbKgA9oBdhyJj52Ysdv7io/XH1n568q89qpO7k3dcFUpwP2aP2Dk14UbSo3EZZgCJrESqUC0EkMPFvLmsMp8PJZoEpyBcAWEwzQHKi2vdBkQNaSlTvPd98dFr7QzbwsfdhzGancEVb+FIA6iiWmP2cqUNBF8Di3wgBykUenUwSv1QMQPGcWMzEs2I4Lx6hmKj2OejRC3BIL0K+3lA53fbETe08e+XJ2zChOer+UYAZ7BBIpdC+oq0iNuE4bVZScLRmMEMcURx2WrYVQzuUiwBFtd9RbxaAnmXffPI2zHJARTi/Ra8AZvqGaNkvglJWTwrj7EtFORfu+Gg8ER49dODSZ63zUHMKus7tPKp8MZmtfLnt4ze1U+zykTswldhSQF3CKpwF2TVuEGXl9IOgtpkK5ln3JGcdaDdD1dy6rsvrSzEp6NwxHdALsCvbtvJs0+Fb2in2jSN3YH7rAF0jM4P1Iyjk8Yc29rREsjPMZkrX9U2OlTVZgKLK70w0rjzX/nO3tDPs0uEPYIaHI5uu8hFg0mHOnjgqF8Nh8AmJ64RCwiMxsX5VlxmPNp57er3oAHqyeunwPX2LALW9sNvHuhSb/xEEqCLgDok1bQgiHQyCHpFyEpghpkMAKmJRm6FPs4tPDMFcatMZGoOdwmHETP/W7NHX64TCWOl2cP8PgPoH5aiMZPCVhtM/MPdpfvZuPNZ0201ZVqFV7jtglCxUXmLoaXb58UGY0jeVoQp2knBC5Cib6XcI8cCMUOO4GuHRBnFVf3SiBrTy948PpkubA2iEV3XNbxwn5MuEFIC5HFCECQm1m/4owg+hM608W+J1hxz05SSGnmWXDt2GmXQchgbPf1hIExwj+jU9Ss39IZK3IqSyHsEaEcfpuWNjOYrI8XKj5eUzTSvPtR++pZ2sXDp0L60GlG4nV6194YSPRWr1sAdqMVMmKP1uvxfDAZFDQxm9KqlSUQJCKb93FmzT4JQEXSJZWqEE9BS78tgdmMx4GSoEFV+5atLMpFMzddBW8d6NSieCb+YDj8Cy/9ASANShqtVqtUYjBQUhtKqC5Fc+ki1T1eq5ZOO0vlqr8o+jCPxeIbJYotCp3jP5x/GfPMCyUWkwNdZW1WqanKVRO8TH0FOVbzx2Jz3vApTAxHy10dTrVX3bzR9q50KtXjCS8Y583Pir7pVqtdNQNgbd3hULJ9jbQRvWZiZ+9p2OU4vx7rK+sz7509eK5SzrdcqFpiCaHNiTyp9hLz/6AUxnZYaSwRWNs6zxz9pX3lufKPE/9bmpi00TubmHsKWBMyf+VYRdJgCqGsaAbSxf/07rF34U/y7rO7Of9SfeHj54hPfZrEK2wEjKlGxAKy8/ei8tAKXGHFXPsZKyHVrqZWi+dU07IVRqi16fW764YxYqXVjzVBW5KezCOiSykxp6zbXG2y+1f3Zhi8Tilz07+2bh/uLSPixwi2agmGoBqJUpEaDn2DcPDsFsgxdQwU5smGEronk1CdkZHUxTh5Tdyw8eBNa0Q17cSCFsGbacX4aFFS03Xy+13odFbToAUMrPHVWzZGON9Tqk5nS9oaxDWYtjO72S2bYU7U0O7SaAmauz5WWAWm0xs5hibaPl5ST2sdyASoE9AXqaXXlkGCZzKoYKQIsWqKLNKyzHWl7q2BHnWW5r2J3MmIBikwwdgmjmWdV93SlI+yRcgwfAU0WHwIQx04BhE/tYom29LkBlGyqaZYKt6AQIToV1i6gYuYfoCC0E5W1hC0xZ5bmqe6pHvLhr9capj4/FXvqiOyknPkbFSkw2gMFBFKCibMK+yyqvYOhZdunAXZjJywyVvTyt6PDBSYZEEjAss/AyRhh37KmLvjr110lgb0zqzqOFnvDWM3dQwkl5c233PaOCeOds4RQRUEs+q12NMlNPA69Gk8pzea1p5bkuEdgfGE27AcVLC1sl0ita3ZExswwrbdyeBZbcQvghgU+evGLWNEMX6kVmAK/AT7WZqY5Dian4M6MnGYc0Iv1VG6u0eFtyuyZUOUsrqzWN1F9ur7vDJgnQp9nFhz+EuUZvkw6FxC8EMw/J+XYwRq5p/Zvu6XFd1a8sXGydqRu9Fa2acHW1AsAh1UZWZrWM0VrO3r3WfaK8Fsse99zjkwONE4uwp8LMtB0jW006NDPYqHMx9Ay7/NA9mGpSqTyC2W5ma0/pf/ROv6bV4wqxnvOemnppR1mvd4ng2Un5VL0gco1c1Yu5d69pWwMmjePXh95oma6ZfRTY22ETb9JZxREnsPcD6qziKEAnFIxvaWc+ksB+Vq88JBZ+kdKrXB/ZzxxsSzXW/7H1Nz+SwP4Hw08cQbMke3nOUAKUbOg5dmn/ECw0j/F1TcJKcNtkiqUmPdBhfk37/DvrYd1aPnO8NNBWYqU9TmgSkCmRh+chUwG2FfI/7teO8RrDVr0u3L6eGUnXHyNPT/dRAnpy5dL+0Ywf0KJZEC1S6IIE1Ef/TPuNsa0SGO3omaVvHRirreRwqU3YciC+AMJapYe2qwFS83/S8infssfNlPXZ8bf3TFQW25zQSVxdLBpDlS/CTi0rvPwp9sq+cZgtiJV3FkNNEYZgUI9rdzB4zkCqnKhoq5lMGjJKadXvuk6tAOCHK/gTKrgknC1ABeZWzYYJbVEXAXQIoLYzcOqQyNJmlqqa9VQFJcikQ+SI5VLR41dhoVKBMmOsnNTSU5XFLAX3aI7IwtNyIV5gJkDPspf77kOpxQbUFCovqtEivaOlhRQ+BS8aCFpr5J8BVGgeg2ImgmtTEUwpuPd/QrRNeNJh2S6eFqNZ0gt2aBdYC42gLFlrCizQVoqgXmRJ7uBeyOGKQ9MWQ8+uvNx3P1NqwQFRcYQSf8rnaTUcBc+hgAYKLjkYa5YpsEdVotXIOBDlgiCr6EtJh2CHtfJZFxmcCPW8r7UlyrQskk+4FdBz+SyHROZIhJRC5Q/kCtBJDP0Se3XvMEy3IkvwAuQKKHB1gmchdHQ13BlQGPA8sLfA44EzpnuujQcSMJ5ekCvp4HVRAtMrXQCYvvTTfR7JJuf0fKGavVRIoOQsdChAJzH0NLuyZwzm2mSG4lCICQSs/XdgoytYeCq94bXksVC2RHGncqGvxUyZdwQbTbA3i49nksKZS3VPOxW267TutU2coXoAoGI7jXiR0DKwtIxPrdVulQ42WfJARLuDcmf/ZpjgdjNl7k4G74XRuo+iGCImWAG7JzXGMcjAyrqHQvPVd1am1JnGXP7RW9oX2dXdIzDZ7rWh1NYX+bEOmWRiKccS1Xolqh7q97Led4SXB0hkdFYGU6vVodGsmbqLoQpm0oAICmJoBjJG3VytZALiD/fkZn1zzd+xZKINUsm0zmpVUyuvmrmalsgQ0fiHJefoA/Q8e7X3LpSKY6YIm9BWyNUmtJwNK3DvP5ufn45wlOs+/Mm3+lPLB4oPr6RqWTIDYWuPZPuey2Qm/739t0bWffOID2KMfOzda33lhGgiykUbjDZ8gJ4qv9o7niwV5UxJ7MsQhZF2lqlez1z4yVYJTNf91MLl9qXK8m5h/MMMhuOEeMG7C25cW8eWxrWM5/jIQMP0kn5Qlo3CNwJ0V7pp5VlU+bPscs+kudzBvbwVsNgxFhSgg2XLr2aefnctAqznXGzSLULSyuWDthYKZefhCuRge6q1frHzs1ufy/f3J278zi8csdszcl9e13m1ybahz7Cr3aPmXKcLUBP4PhwM7Luhtf5Lev2d9WxsXQuwJ5cGtk+VzZ28++rZcyQ7A6zR2gE1FKDM0j/9u85j2OLfsteF29ebx7XkfpF6ikyJmx1ebdL5Uhyboc8YV7tHU25AaRcG3ykGRWhmueW76buDX9+i3vyFmevNtVpl7z3NSPL9R1Y86kZIsJMCarE5rAA7k9kqtMIHz2mf2JJ6aP/QUHYpObpvtFrJYLZEsnkBtRl6mv3DrmlzYZsd2OtihxuygNJOBBXrfllIsbxVeCYzt8Y8hJwkD0cqepXNmGVtAsraoDltN8IowfCGKbaztOqQCCiuHkY7ljVTLM/7SmGveNJiXFzRdVaqGjC5Wk4MG6JRh9mSC1BsI+eEytsM/SIb2DlulrbzXN7OlNy7xbBIItJPquOj0PGECxoe9WfQblNnUbBTxMK+hQ7WDJIERe5hRQMRf6JdRRX0QRri4AJlk/pJqOY8lzesbZBeledxaM6xoc+yqzs+NJe6BKAiEnRUy9l2jbkzDYZDGbmk2iuuJ72z7KTcoPOnn/7A3snlnU23GGCvr84QHPxTqimah4KZos4gXtzLc4YKQG2GPr18dces7gZUfEB8UZ7sgBmiVpEg+0GlYgMVRew4NGDDAA2HPwyA5LPy+cBNhyFJAoEjsnNMjZGC4ifP5a2Jp5+kOTag6OWxOEKZ0tnlV7om9ZUdVDqTAxZyA2IdiOMUYu3YIIJGFSKsJW1i5t13tw2uRHZKiZ1Jp8mnk5xJc2oIqrKiwmSFpJ6OdE7iKnt5KWwa2D5llnZyo+uqlbsFo4WtfjE879hChdhYhV1zv+VWRfeVFBIoNGPjBRJhbny23Jpl0g5SeRvQL7PXto2ay7vCAI3aoMrnLKCH7jf8UevrreMWvYhljhsMmsAQR6mYZOUkKR2YLIFjIILDpqXXtpXSXkCl20WorD2M2MwMYq7/ni6VVUUVLtkCrhtgP51rh43Va0aEpaValeyUnGrT4uudM5mF7mETH48h1coDZ8vDOes8j4HwEzPCMXBBPfeMd82IEC4EUNtfB4ZW8pQ6YJL9VtrQC2ygY9w0ehBQ53ETqghNbT1jq3qcHRjC8tthCf2ptIeRE2QBrQDLNVGhYEoCWcyUV/QrAT3LvlucM2Z6qUlnczSOqtureaMcUMhxgk8JpId9bpKEJxdxVT3UbnoZGsOGnmevt88ZC7sH6XlNyv3TG2Bn3NhUGpi4W5hN3AQ1l8nnU0i6N82goyviVHmNvScOPb/wevtc0gLUWp/pvr7fq0baNrrAGsD0WysFoFGOz2awW0IZlvh2U3ZIXtUQRsgpMEup51dKA20TKWMPFkeo3ucA6g8uYj9ZJnT7odqzBjIzhvmxiBPIbN+1I22nzQrrFzdrAwH9Evtea8koYSs5EtD4+9AjVFKxdTpUK1zqGWav1abJvnYsx+hFWgbSY0P5pgWPyv8Be6Nl0jD6/IAGsTO+g1HFCrZt9NhMRy39Jsbt99VX9W5RVEIbGR4FEUFWeSkOlQrMdhz6InuzMGJM7iNA8aOqOYql6pGhjF/VQ+2xy2b6LaHDvGCNsFU9EMwwWxl0zLKhUj3UBvQCu968YMztxwIvX0ooEcB2FJsZHknqGw/MGOYjTkIQGB7JtlJ2jWHvSy0Qbz30Bfbtpglj6aFBqTjiunecHD0uMwOD7CA1lxmiUHXPff3WLqpu4NhEd5hGghLA8nnid+6UpHqozdAXpr7dNJFzAJUXanEB44Qqa3zMhd9fSmC5QA+z12GrSiRWhzJTBZwKZH88agPqdUrPTA40LufhYVR550GscZ8sE8UAtc2MdkBrY6baKMSVTRW8e4H2MzWw2vQ8+7f8lFE64AU0cntKXDW3WK6yTi41i83M4PaLzyYHslM+oFJrWTNUzlDKlKwWiK3y/eyt7JAx9ShVm2ing7ASIZ418rkh7rqmn3PrCI8CJtGR1LpmqEf3jssbEpGdk8/zT4DNUMspFSFdfr73yXc13Lo8ahw6fNuc1cSGAff6O2XUt0Z2ulVSYRfjslNx33is9NpFFYiyw/CC6bb63nooLmdsyqbnX9h2aJDvLD658NqB0fpynnbbBoTO4u24YEog+Rgk38DHpgBHpPDosqVT1VOd26jY5o0JvDrkBV3+21pwIS0WSzYnBvtbj8xzQH93/Ep+Lrv68BSs8Kduh2pMnPTNuoBbucKACok1Q6KM+OwM89xes+aeJifMcdMC/8LFtrjIYlcmV+rv/tgHeBd77/vxyUvbp9OrO90LDaRZ8zw5Uc1iqxQch3UbUHM//GGPenMzi1oYjkNUHZftqHukCCQPmaxtibu0bLUwXHmv/5jYK+V6mMDx2YHCXHWuZzFZS+NtnI6fNIsK+op+tqeCGQcwF/toiYV4k/+rUHNnimV++sOzULO1zoOcLjp/RgFfWNGebZ6Z+d+RkWsnnP9DhO/pDOikfry4p3VxFfIsUUuximmdE3MfkktY/2ph5Vis/UtGHdJstZbjk2mB7fWvYu2qsGGJVKKerIGhJeurfPVy5P+fYZ1ISh9r1JN10FLV1qbC3Nd3HHUtbPYxdOO32/gVfvX29cxKcmm3gcvEPY8col44bi3Pa5mpo3s//eFWb+pd64hiPD9krZfc+Pm4DPvXhl7vmanXinJHhq+q1nVIm9m7bzzy6ZmN32nzr/BAAorDRNPzg8HHDxqwmhGlQwFmkTXMX96/tXs7NwLzAwsoDur4rX9tMzKre2jFMIYpzT3dN1/S9lt7NjYy9K357AMNKP6/koaG3zpCgHYmM7W/3PXUja2BYnOu+kADikO8MPb9DnM5qWUSZS2Xblr96q6ffyBtJ03H/wHu5An4eGwyKAAAAABJRU5ErkJggg=="},92691:function(t){"use strict";t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABUCAYAAAB9czKDAAAAAXNSR0IArs4c6QAAD9VJREFUeF7tXWtsHFcVPrO7s4/Zlx9rx27IuiUkTeqEqk8VQYQqVYgfBYlSWS0tFQikAEKV2n8gEP7Bjz6iSK1KRalQW0RbCBIqlUBFqOIHCUIlTR8kbY1jx02J7cRO7F17Z707uzvo3MfszO7szJ19WdHuJI7t7J07957vnsc995wzErR46bouLbz7YjIg+aL+YCyglbb8LXbZ4dvDALAFAPjd/mr8CUAoKOuqulGRwaddVtWNfV/4zkYrA5aavfmTfx6N+IZ2p6PD10YBJAk0DfAP4Bd+6+Ald7Bv566rT5Zl/FkG0AuV7KWza2N/mjkvTU9XvA6tKQBmTj6X2jF+S1qTSpKmZgA0FTRQAUGwUL/DQDSerIlQbETtBU0GAoCsgCwrAHISCvk1bfT9K2ekqamyFxA8A3Dm77+Ije69ea+Wz0qaugqahl8q+aIA4OWB8tiUU6fmNisZvUxLrG1zoNC7zADISgrwq5RfV1MH7/lQ7Om0lWcAzp/944EASCE1swSaugQq4YAMaLWrn4+CExXHLYhLc4QhZGm43h37tFsEjcYry2y9IAcgJyRBVpIgJ8dBSY5DZmlufuLQD9ZEQfAEwEfHH48nxib3qpnzgF8GAETu14gfpxHUThjZmdxfT6bmwaADMNOxcV/s+USuuy8U0orpAOQEzgFyKg1ywL85cuM3ZzoCwNzJ59KBYGgkk5ljAKxS+W+IHjZpQlDRIYhIcufV7eVJrpxg6cydbZEfCAegGEqmIRDfWdl52/3viI7JEwfMv/fr6yv5tRgCoGWWQNVQ/FBK+wO+YiAQUIuaLIVCIdHnAxQAgDfHn/HC3/nPNj156L2mQ96xtx64WYrGKxQK4K8UQmVJD/O5oyKmAIyDktoH48PZ09Kehx1mUJ2UJwBmT/3yhlLuUoQDQBQvV0igrB164M/z4pS/elueevW+awKFrXHO/UQMoS4gAOyGnCzN7rnj4azIDD0B8MG/nzpQ2lgKqcgBxAKiqx9ZMCLH1m/92u/nRB56tbeZOfa9nRUtO6apKH4zKIQAFOQCCkBC8s8N3vnIusg8vQFw4skDpcJyiChhFeW/Rswxwn6RkcwtX372rMhDr/Y2Z197dJem50e1DNIAxTBZhSAnU6Ak0wCKPD9x6EdClpAnAGbfOjqZXVsIawiAhg9HY0ABRRkHX3Q0e9OXnpy92okrMv65v/0srRc2R1AP0o0oIQRZiMgBoMnzE3d3BIDHJvNri2GDA4j8TxL7NxIfy97wxZ/3BACL/3gsrWZyI7gQURR3HYBM5jyAmiG+HwpAGpTkjo39h6b/K7KCrvY2828emfCXMil11Q6ANICmdJ4DCOshAMQGToMS3rGx/64+AF0TQQgAcoDCAeghDlh888iE1pADuqQDKAeg8kclnAa55zhATamr1Bzvug6gfqDeBYByQD0ACprj3bKCDADQDE32FgdsHwDHH5vM56gZ2gcAOYB6hC0b0j4HdN7IrXIAmuNLxCVDPQLjgC7pzm3E+hxA0OUAaIwD+gB0ftFbnmAFgB7JGi7pPgd0Hg17DkBvaLLDVlBfBNmIoBoOQG8odMoZ1wegHoDMEjtEpu7oDivho5P53EKNGUq9ob20E7aIIDwTwJgoYAB0lgP6ANRbQTQwgRzIsIP5DoqgPgAGAHk1Rc4DajgAvQJa53RAH4A6DthOEUQDlHpUB2wnB5CYIHTDmo4ke04JbycA6IQi0QAMAIyH6W0AaFglj4rorA5YXwijB5AcRPQBoEqYW0EsLGUbAMDzgLGN/Xf9uCcO5RfffGYC8ldSxC1PlHA3OSC3ENZW0QVr5oBeA+DIBOTVKgA8LqgbHFDCnXAdAKgDdvUQB9gDoKArotP7gNI6uiKsHEDC8XpKBG0rABeoL4iHJpKwlHGQ470TF4S+IC6CIEODlI0Y2VSHd8IWDsCQSBYVHI6NqaFwdFkNxn1xiAMkyF9yZR0CtfWYphsefGrZGlc8Fql+xv43w9okYgr7rBqEzH9KlqN19/FO14DGzA6U6ttcYY0GSgXL/anBuL6Cn11agUpR1SV/YEd548qgcTbeLQA+Pn50Ul2v4QDmhCIeURKiOE6cUiQ5iKf8NDgjaZzR5XSo0mrSUpMHNpiGi7lwuOJRBPOwRAxQ6xYAs8ePTpY4AGwfwBPVSEwMIX6SxIvyHCo3UtpnhjVJpLrbvIPV6A6SC4HpWEhwND0xP4J8qTSzjYfpd1IEWTiAAMDsX5IvmwQgxGe5s2xQjqRkeWSEUURyylw4SqgPNqCmuI9wgUoDk9ETQBI0WJLK9gFAKM0SljFXBBOX6f81uuw/MZOkEV+YcnTtOie0sEGyJomQ3spG4QK+dVQsG5RxQ7U6AM2TIOcBXecAg1Y4VJZD6wIAmT/NaaCX7eo3wYTqBGSoyHK5DJCNyrES3lbQykaCSUj268Vy0Sdr/phWyYdoyQQRtrJfJgxq0wB5Ki0dMO262v/2AGDkBrusdiMP2Jkz7EhBICVlAWSIKvLZ3VN/qLGVrHdh8ZAPXvrGDT4tH+bJ48Yi56DzRdM8PtWH8j67zwG0RgTXA25q07s65IKC12RIwrAyMDM69eym27NmXvnWvkouF63mMJtWahtHTObEwewmACRHjIdlu1HDURu43UzSoNl5axJ8keFSJJZYiUnh3EZY9/n8IUlSg5LPvyXl8kUpoBf9uq+UrGxkY8Rby0zEWhnnvBhqlUJ9awtHcabmJQu6pwM4BzQmYrOrvtqjFQB66E0LY9AqJVTv8DIJxERE0xBtdQ6ASReIj8dZpDLfm3Xi3eeADgNAWJsrdWrmGiUBFNxncAC4LkQbHSu2sM0SL6PD9JQY8WutgupdtnqEQ0DWAStXQDgAOpMjxvcBZCeIZWpU+wIdlGytb7EMS4RkoiPBORBK/U6bb5QMO71av4isWDdpJ/C5E1+Q8RlmaIcAOHviqQOwuUoStXmSnpipV5WrvNiLwHyNJoYlxPUBFz2WBcsULatbZJTPqdsb2C+O1gCiC4TGhqbRPzY/IFiyxlOi9rm3nhgrr2XkcvFyRa8UdRVZvoUL17H4RVvjv3l/0H7ceYBIMKBjpJplZGSceCf/Lv7U2paNxiwFgpIUS0iR2A5JzUiru6YezYs8xRMAIh3223ijQB8Ab/Rqe+s+AG0nqbcO+wB4o1fbW/cBaDtJvXXoGYBzb70wlhz+9EgwFPZpuRzocqXh8Z+3odi0LuL/BV27cW/h2kXrDYJBgGIRSsXs5sBn7xauHOYJgMVTL08kd92cMmrkGO5YJ7eih01ZO72UgiT1MDrnHk2FXDfOv31x+I4H/ycyBGEAZv/128TI+Gf2UOKjz4VWS+Eu99Y2MiJDdZm/py48kJ2vrUZnF+SsAq+q01ALRPQLp5dPT05NER52uoQAQB/72swbB8v6lsyrRJEjObL9N69+syfRwyRtRtgWQM3eEGOYdFzN7MidCEkr6VJ/FSRToFW0zZHbplzrhwoBsHjypbQcHR6hsZAsMBfPQ0m9aPthuRPQvKTcW/OniLc0jcvl4KVV3xUZExdB3GOLEXLqeVeXhCsAs395OjRw7bWTWvaiVAUAD6X5YYzpeLEtMtzKOe0guHMf7k8Q42VWypgDkEpDQBnUojd/9T+SJDU0VFwBWHz/lX0AehTjYHg0sCF+LIu/3vtJptaGYz8ricTIYceXRj9ucr3u5uozHZ/OvbYsRhQdc6Gythr5/AMfNxJfjgAsnnwuJUd3TpDCRKReNK8SaFr9doPloRptdUu7qTOmCBs0sxDfrKpEunWsQV3DQdwrynKG5cSn9MzS0kfXfOWwreeyIQC6fsy/8kH0YGlrxc8BoCdO/EzcLvyDzoYopDaII3fh4K4ZCK1rIzCaAMAKr5P+wqopeDZAK+liAadyKLQ1fPu9Z+ywbgjApXde3iP55QQSv1702MkVk3XRBrHjvJ7NhG988GMhfgtj8iwCjVLGKYBUGpRUGvTs+oXYnd9ergXBFoC1d14YKIVHdhOxQ8QPFT28VnSdYGc0QGuCxEkSm7h5+S++8jlMDfQP10HmBSsocszN6O1edA97w4bBBWnQ46OVuVPLp289fNiyFOoAQJv/0unXD5aLazKpCMWKk5LzVv6OmJpJbB/h66lZt+qbXAj1atdd3FlAM5mlkKKFnHyafyNx6D5LGlcdAMTmDyZGSIFuYvlgSa4Gb8ggstW0Xltkc7FTZPeVaFhfTRK/ntTeeNK4n59jE12QpmGLamZ+4NADRl1pCwCzs0+HBjRm8xuih5ZjMcSOWdywNya1Y1cpNkUX4ruGO4rJn/qxiI2utndzTBMgCOP1ewMLAItv/24/QFnR8A0ZmAdGwq+pz8cq92ksjmHtiM3LwboW6cCZCHU2vllsi3RfF0DmZOm4d1jVG3gcjRYRC99PpaGoly8Pfu7+BezFAGD5xG9G/UNDu8w2P40ss5qvjmvQ1vfS2J5xFybuE3W1llh8UdVr6Px6lebWenWctgobxTRXyFjic2yXrsClGenGh3IEgDPHpoMjk7dPljYu+KjJycJOzFEPpGfBVWhHN04IYpkwWdHgxT31FogYEPatqmOuG715RyygvzyDY4TEMDeFiQsqodBW/PZ7zxAAVt47dj1IEKuufpb9zXZTEoAq++IZLSKVo2SW9N/tujr+9JxpZvgw8++Ck5aKJUnSKwmtXIqbE1kgieIoTfRBOZv/mALw4V9voXKfeztR7qPokUGqyOsHD7/WE68mEaStp2bLz3/3uoqqDhnyw7Q3qMQTBQLApXdfvSl/ZYGJH/ZaDnKHAnJo4PL++18kCqN/eafA8vM/vM6vbQ1ZXnjEnHX+wR0UgMUTz0xom+baB3T187yvYDixEvAN0LeGJpP0m/ex9MYdzFUmqVtSRS4kSmpmGI0ZHipv+IlSadgqRj8hAODu99wbP91b2Lgc47WQCQPwiF8eEs6jkquHcFclUd1NCbEtoe3k2SkhcdlnaLg8JnPTN46wjauSgkB8cHXw6z+hOoCCMO079/ransLmSoy6HXjjJGAKKs2ArKaferYI2gaV1UnQtm4FrCCRZ1FXCE1pJUQneQr4MzPnMbE9FL0y8NCRc9ifZSNGXs782vcnttTscNVu5q9s5d9rSe9g5omM2K2Ni6nY3oXQuDezV8P1mSSdlYOAx7aM+LIMvkj84vCDTxgRE7be0E+OPTK0CbmdoBWMkBsS/075wrodMCW+1R40Ge0tuQJ2uzXXKbUW3+9xdbe+pPhLratBCz5/IC/FlAtDU49bkgwbngdMT0/77tlzMRkJa1FtS7e8ppy+WzFM/haKNFWUv2+x4A9I+HORpZCStzaG+e8h9trI6gskeTs3RuCfN/c2SNHeWTvHt0BW30PpNpZg0F/WpNKWpqqZaw7/yvZE7P8Vipiu8V4ihQAAAABJRU5ErkJggg=="},46016:function(t){"use strict";t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFYAAABWCAYAAABVVmH3AAAAAXNSR0IArs4c6QAAIABJREFUeF7tfXuwJFd53+/0Y3p65r53V8vu6slDKAghg4SE3kgCSwjjOCSlKuwKxIaUE7tC4nJRJtiFbxWOE5yKqxLsuMDBGMlAkHAcwBAS7AjbvFYsK7FiV4+VWImVFkm7e++dVz/Oo7/U1z09t6enZ6Z3JcgfydRu3ZmefpzzO7/v933nO48R+P+vWggcJfLC57FvEGCXA/i2Az828C2AKEHfBn545UV4TAhBfENR664/gZOOETV3DbASGCwqwqLvoZ0YNKSBIxzYQsKBDUoIyrKhJEHZAbSyEDVdbIaEzQtX0Mkr9mIU+b5j1GxbeJlN2J0YrCY2ElJIDIAk/Ze9yMCCA+EQQtPA/TdcIDb/rwFLRN5WhJfoBLsswk4Q2lqDwIXnsnLpkX4mrYfvAZicDAaCT3FESg4hDIQGSNjoJ4QNO8EzF52D588G6MPHaS3SuNh2sCfWIKWRCAuGy8fvidIGToHlolkCFv/3GnBAiJ5/Bf73TxRYIrIj4Fylcb6KcA5x4RhIg0TzewM2I1I2EhMBNkAMFtnpcQzBTi3NmAxQB4BkYAUsh48LWImBxYALCzqx8SxCnHjlefjRPJAfPE77jMErAaxECobBlBpGJUiMgpGERCRIlAJx40sbZBkI14GADdu14DRtuK0mvv8TAfZ5ooWGwiVWgr1Gwo6BxLZTBjA7UyZYNkykQQ6lhU6iFNEMUMXMzVg7ehkNoQWEw2gCgsEUTspcSySwLAcWg50I2CnoCZS28ITcgyeuFEIV73XgBO1EgsuExopUMIpgtIBOFEygkOgYxthIkgSJVClb0/9FKbA9WC0bTtNFo+3h9I8VWCJa6ir8vSTGPrApZSCmYNoEE+oM4CEDUhNjs2dmjABlc1egIhKRznwDA5qaI7NTQzTclMmWcCFS8zQZsA0LduLAshM4FrPOwpOnNY76Gg3LxattYHcOaGygKYGOE5hIwuRgMlOZoTmYatjQsQRZAsITEG4TdqsBz3cR/liAZf0MFF4jNc4zGsayoTXBEJsVYIhSMBPbQRKwWRESBi9MRTUrvGRGDNGUw2P8mQ+JTFdHJGZQNSBcF/xGRALCNrBcF4IS2JYLyxOwVZKBLACL9ZmZnfqeBCZMYLSEJgM9ICSxRGIlSLS1raWCWSvRtRrouAmCTY0FinEus5fBbdgpsI2VNuIXFVgiEp0YL1UGl7KFEqAVGzEDSjDMCtvJGMqsTEHM3qeaVQa0yFJV+DB6OwQ6Za+A0Gob9MSC5TpAEsOymb0WLKsBhslpZBLBoHIhWDMTEtB9CcOAMjuTITtTYgr0mg6ef8cV2BBCjKKBj/4t7bEMLuglGfhNC5bfgrvURvSiAXuCqOVHuBoJlhlQTdCkoROCDhUMV4CZmrKPgcwdQEGrcvCmATqUh4y2mfaOXmXgmUF8QqrDFizHBVLGssMj2Hl0kUYgFpJBkAGaWgq/mBkSGzvbeOZtV4pgXOGzT587RJec3MIOI6ClBDUaqdW4q8DGiwJsENA+beG1UsLmOJMIipmaAEbKzPRTL5qBm4I6BkoBpSo2ngmgIw0sPIBBZmfHrOb3+d/UQtgZ2SD+OwLPwcYS8Myd1wpWp6mvP/8OXddNYIUB1IBALgDfhbu0gKdfELBs+psSlwngpcxOxYBqaGJQKW3F2YBWmTczccxnD5lZg6U5jWc1GgObsrnwnNzDG3ZCDYgG4cl3XieenwXqVw/QctfC63shZF9BhTESvpaBXW7i0FkDy6B2Fa5OFHZHGZiK2cqAxir9zGY1Yug80y1WdMS6wpsz0du6DC8/hyWj5cD2mnB8G0//g9eKJ6eB+z8fp1d3etjTDRBHYRrKJZTAai9B/NPX41tnBex9RM4VEa6RCmsJQeagyiFLWU8LzmmmFk5l2RCduZJRxfBpllBu3ZJO58A6LlyOR1sOnr/jMny/3LFYJ7Ku+j7e1FEw3QHiWEPHBGoQ7MU2tn7pDeLIGQPLoL62jxsVYYEsSKmhpMyYmrBzOhMdnWH2JTUYk4cz1eGZ1lCgJLFXt2E1Xbg+B/pNNDwHp2+9GAeK4H7pIF1gHLyqFyDaCCCjYeTXdOD4Dh5+z7XizJwXm38vwvWxwiqDGkZQJoE0zNQM0GQYvoxZ0LxQqa7pvhiAVpA2syiV9vlFw4HdsmEza9tNuJ4Lr+ni+JsuEYf4NMbgS9/DG0MNdzNAPJCQLAN8bctD8s+uwXe4EWozNtXUEFdJjd2JhZhBTRKoFNRkGE6Vvf2c2LMuoMXzpknDGGCF+HZCrwtNXnaS6VfMWA+WTXCWm3AcN2Vtw7Pw6O2Xisf/1yO0N5K4vBtBdmLE7F/SDgLBbrVw4p9fk+lybWA3+nSZSXCRIkipIBnUKElDqyRRhfgv160z8OJ1HFve6xoDas4zpoFaBWjeYMw824JgcInBdeB4rLmcuTI4pAUuijT8QQgVKigpYBIB0UxgbZ7GgfU7hawN7GBAe3oGV5GGlGz6CWTMmsp96cxRbfehK5xObVAKCL8YZl/W6SqtnSYNbgLLZ+YCTtuB02jC4U4D96Olhu5oaGlgDMevMaxGC6f+5U3iaN6Ycxl74gS1nGW80cSAsRAHMjV/xaDGQ0dVLvDM0KiKZVMALVa6CPSE2XNkXhX7Fs2+gr4TDrKEsmtn4AqC7TRg2RYsNvuYe2gGJg5AnF3zBRz7Ihx47ytEXBvYjZBuiCWWJCGWCkpLqDhJdSWNUXPhn2XOdbX0x8HS1OxLwFcyuVSB/BwGl8MwDv6TLAcMxfnjYXaLv1tZxMavXC8eLbTjbI3dDOnCQOEyoxAzW+MgTadpk4VVo+zTNIa+mIDWarhizSpCuWlmP4/tNneJLQh7mK5k82ddZbAXbVi2xMH33rHN1pkae/gwNdbOxa2cb45DSC0QG5mFVZwBmrCskieeyuQqsy+BMNPsy+CVPtfV0XKjTwW98AU7tfyja8FqO7DdFp59303iWLkYUzX2mU16LWnsjQWiiGO1JJUAkwxBrdPFnMWyMwW+CrB5GlkFVhWgdUAtnsMAew7sBVeZi7bcB+68Mx1+G3tVAstDKeEmbuawClYKrIolDCeEixFAbW8/rYtZPl7h2MrPmArWHOdVF9D55ynOnAuvCXvVAf3aLVmHoBawT27R6yDxkjhBrGPEQ7YmHAWMJKBG8F9mWRVLp5r98EGVma5CLYr3nJCnGefVcWDTmMwObdFR9oLnNnwnPParN7WOzwWWw6ukiZs5+A0lYm0goyRja3pxWUurWFbQzLEK1NThOmZfRyPr6m25cfN7s8mbZDSgOYzpXLiJshZ92E1PNHZ4oPdc53y9zNoJKXh6ky6PFPZqBlUg7kloBpVkjeT0DCc0pskFKkzoZAWVzuacOo1TbnS+JmH9tEGxwWOWjYuRwOLMlUkUpXEbD//Yymo1XWvR042dbXhtzzn6C68TTxVZOwYs5wOePInbeCS1ZxArk/ayTBQP2VqMw6v642X2lj6XzXYsbq0b5NfR0jrnVOmGDYvNfMnBsffdJp5f/zKda2zsiwNFyrgJg8u3Tru8Duy1lnAWPXhtH9EvXeV+cyqwx0/RPqlweWQQSQ6vBtA9Zuv2+H6t8aZKyTgDllZ6+5LgTdXIOedNM3sGlP8v+Nj6jVuyYJ/zrt5X1BVBAqsbuQnHrxlzgaYLu+kIe7WNxkoTzRU4f1scyhlj7A9O0VWxxGpoEIVRxladpEPWLwzQCm0+I/2ry8Ap0ccEOUuWlIdPyz70+TfjwTt52sfw9R/+hs4bDHB+SEr3wtTXpKxt2LBaTVgrlnBX2vCabfPUe65oPp5fNwKWE9jnP4uf7hvEWqYJbMnj64aHdqc4rDFyTEvVzZCMounU8dKV5/DBgoycKZMZVA72PUfbCTmH1+8Q3WK5PnqA3F4PV3f62mxpMjzizN/zdY0E1oIn3KUW3F0LjnrPNeIbE8A+eZL2DDR+SsWIujrtEGieWjMWt9Z1TjVDsZLVjuozK603xr45TK5yTmXg2fyb7OGBE+9/s/hhEdT8/Ue+SZds9vWO0wHpiFlrg7iMzNrFFuwlT6ROTCjnW796s+jzdSPGPvEsXRZIcHowlhGkNtDRcCJC2WzHnE6hJNMko46HHoFcx+zrnFOy//FLhjRnc/Zgtdvo/8Z1ODJt0twf7KeLN3p6d7dPkuUgGoZgzFoOu1Y84bY8eEu+88REovvICboxSuCqAeRAQIZx5rQqh1WqmDtF3+YF+HW1tgr4s5aP3LOTshcWXaUsHFq/mWcpTb7uPkB7eqG+9NQA8ZYk1QtgpMk6SgyssGEtN4TDTuycVef0L18pHhoxloich57Gm8MY8UCnYZZmp8WzO6qEv1ihOsBP3GN4oI7J12VyOZSbKjNDQFhXFywlfMf9/vtuE4MqUD/+CC1aA31dL4DeGiA+HZEMojQXm+QYsBysNISz2ERjxYP69VuzsCuVAp5oqwivDw3iIIIMYmhtMpF+Mcy+qpK1gXjBZp9Blt0m6+dzz4klAL77+PrN4lQVqOv3kXPpMm7ajE2jE1DcjRFvBJROl8qlIGWtgfBbsHc0RWNt0XEH9+Fr6+siSYE9coIuCDReyRebADHPvONoYF6YVRlv1gGizjkVrVH5vNJ5U88Zao5ru1ajqSzPcp9bf8v0CRn3HFTXBEqs9RVJHuLu9iE3NaUykHZzh9EOy4Hvwt7ZEs6Kj+aq7xz8lRuGU+UPPkWvijlFGCGOAdmL07Gs0cVjplyKAUffzfPQVYI4OaIyGoousmg2WEVGjnNPpXfjbmh2B9ZDjj09z+399q14eJqzuufb8asiy37ZICK5lTIVqqMytqZxbKlADOxSU7hrbTTW2s4T/+oG8cOUsYeeoisijZWORjyIoHSUjmdNDBDO09tZujYvSz8k1BgydZzTVJkptTjnALgbutR25SWbOFSVQ+VL/vwI7QkG5vUDlUYAcktCbsWkBqyt0WhC9Fg5XRc26+xyG+45i+b4r93Q/EEK7LeO09VygHasU43VoRkydlqWanjbeR6/jo5WnTMTrCnRR3bNkKGFVuIjaSfAhrXaBCVN96H1m0VUpav3HKYFE5qb+hq0EVDcZ1AlKXZYDGye6SoTzHMyB7bURGN11fnRB24Qj6XA3v8MXRv04HVCyFhDKTO9G1sn8Vw1gDcVrHkSUqEJU5lcApRlwLZUCuqyD8Bzj6wPA/gysPcQ2eY7+o1dEs1AUtwJILcGUBthQVcLFxXLwMD6Puwdjmgse8npD97uHU6B/cZjdGNgYA0iyAFPx+SIoNwVreia1mHWbBC2S3o2jmmMpSPzcQsRQMZUlxdeWOFj67cvb1QxlY996kG6Ko7NOf2hrvZ60Kfktq5OlTmVWcRyC/ZOXzRWm9T94O2N72WMPUY3dSKIrQhShhmw02LVCZ3NZaHiyXU08myBH4GaWn/moIr34srySOqCD7tF7pPrbxXPTgP17u9Er9TkXBxpkhtd1lRIdlaprupqXS36hCKwOxedwW/eKg6mwP7NY3TjIILoh5CsrzwZoXhhhTWOlXGe1o4wr2v2tXU0K8a2tm5fOIoAYJ79N2/1x5LQxcJ/+iHaLSNzdaRInuxB9mPIriLdDdM1XvnqnTHTKpOBLIilFuw1T7gvWaTBB9/ceCAD9nG6dhDAZWBZCnS2SGziVcmuOmDNOefMgC+GUGz2k6XKQXXs5PS/u307lVeu0KcO0WpicO1gYKgjKd7ieDWA7qlMV4sdgZGlVtTFGcayuxeEe47vdNffIrIZ3X99mK7iBbcMbJczWnp7xKBSR3PnO4NZVYyvY/ZV52wDv/1gVZ7eMoyJ0zwpZ6xsd+NDP4PHp8Wqf/ZtWhKeub4fQHQlxd0QaqMPyaAO8k5AoSVmES0HdseCcHe3ks0P5c7rr4/S6wY9LHYiKJ6dnAP749TI0b3nNc7Q2KHypOskS/NbMKguwVp0k60P/aw3WoldZuoXD1BrS+DGQBu7F5LkCKAzgOKeVTDsBExjaBXRRsA2hXvOonPyd94iHk0Z+9WH6bIowo6tLNzSgxJj6+ptHbDqnLNd+DwUqTb5YsPnoHpN6n74rY1HpjH1E/dR013UNw6McAd9Upsx4l4I3SHSHK/Gua7WkMKcxQwsa+yOpnD3rpkT628adhD+7mG6eCPGPl6o0C8wtq72na3ZV8pMmV4lb191DWfyhQNrqeX2fvct07uqPBrQTlKm+v2QZFdCDiTUKVUAtU5YWTqHgW21tL3Ldxurrfjov3/rwrMpY79yhPYMJC7hLhzPJ9AmnZ81MbujjjTMBKuW2W9392Zq8vBBzNQcVO9+PMKZpUm3C3AHIH4QN4ShWQgiUhsy9SdpWDWLqeUyVGmt5ShrueXau3zR2LPmHOROSAosa452cc1AIhpEmRQkJWDPJiKoYvxsB5Z/O11HR6Cl4/uwGkOmem/BI+uF5ZhFcHlY/zPfxXWBMqvM1BzUvibT68JoGxTF40SqQ6I8IvEc11pb0M7OpmjsPtT8u1HaMAX3IXrjRgwe01GDsJArqGj+OqFYWUtnevtCC0wwpPj84Zf8h5nKoLYt6rYONR6dxlQG9VP71dURWbvyFCCbf87U/owcwMiBlcxwvIwK7YZrr3rC2eEr84f/qLWfTx+NeX3+IbqyG8CPePmigWE5mFrJGSY9dk0BiAnpHC2Izbz9XLMfVm4MVNfd+vDPbu/DUiUBd+2XV6rE2ttTFG+FUL2h+Xf6maMqJlYq61s6uP0xe8f6apGwdvpwz9lhn/6Dt3mPjAH7pQfp4k6APaHkhG7arR2fAzv1AVl16gOan51N16nqNY2xfRhlFUOq1Pz9ZPN37/COzto149Pfpdf0pbkw1CQ3A8iBgtqMSc0DtXoW+LZMZbXN5MoxEO2GsHe14exc9B//j39fPDcG7F88QCuRxk/1AkiODOJhyHU2Zl/lwMaODW860+wLDM2ZmE+SsJru6d+/DU/MAvVP748vVYn98mDIVE4BnuZeVUgmZ2o9v5GBuE2fgv4roMly5AtrzReN2G7uv7dq1cxnv0PX9TTQD6H7JQdWR8xnRwR5AXOzH5+sNcv7cpKDp6s3mrBalJz6vZ/zfjAL1LsPyssjaV0YaciNXjoKIDtyNqjp8yutcrvc6Smlc2wH1toC66sjP3ln47s5CcamGH3xAF3yrMGudJl4BJPLwUz9m6u3bO/bLX6mLC2C2m64z/zeHeLpKi3lY+yo7n5AXRFLax+D2pUkN3ps/lA5U+v1/8ssZcy3h3jyNmB99Rxh7fLh7myJ4x+70x9N+BgD9i8P0epGH6/psh5pGGbtpNMZb9kq0LMHDws3FKwq91TW5fK98nH7lg8s2O6xf3uHODkL1LsewBukNOcwqCd7lAb/DGoQUdJV6Ty0sdi8zNKxEYhRVregAqW3DOxKW6Q9Lu00789lYExj8xb/zP14QyeGtRlmOQOeYTeuj9tVm+vJp4A65pwmy50e4TEq1lTfQ9JuuUc//GbRmQZqGvwf1NeGUqymieoIahaos5cobTspVeFginVmfV1aEM6uRbt399u97xfLNzHx+E/up/MiiQu5B5bLQRmI6YBus3T7nG0trRs55KAuLrl6ReGR9bdVbx3CFbnnMDXCUF8XK7GYg5qGVBK6E1HCI6tFplY746KOuigDWlVfzsFyNLDmwVlZ8h+56+3i9Exg19fJOvc2XDMIQJsKWsU1Yr0xVc+95pkDyhXIx+kXPETKdh/5SGn9VLHwnFBpLOvrewPhc/CfM5VBTceqNJIc1PpmP6mlxWfmIDeJ59IK65wWqc/+4/bBsjVVrpq5az9dtCGxLxg6sXxOaLXeqtHQSB7bVRUkPTYs1TQHlvamiHcCcrdOxHj83oplPvm9eUS139fXSSkaOai8IntLw3QLoFbLzrinH5V7hiMuyiHHrk1HWGsLcNZW/MfvfvvkNieVwN53HzkPC1wzCKFPM2sLnYWJqKSOc5oCaH6v1PNzoN3kPQLdZz7yD6d7fr7mowdouUm4NlDG7gxIcTJli7upkvQgzsapmKmTLM2bZRvYOktCy43D2sps3bng6Ht+3j1YeznSpw/QzkGIV58OIHlxR5RGB+wzt5PNeUD3wkKx7Qm87KRMHDzxR7+wsjnNSfHxT+6nHQbmmtgA00ANSwmVsSil0GuaN4mkyidwJJCzdYetH73rXUtj2pqXfYKxHAve8yCu3RqgkWbWYyjeNDHKV40M9TR7aLFHcqbd2iGoPJTiuPGOVTw6bSJFXtiPf532km2ukAmSTkQqHfuXUOlwypCpZVC3wanv7adFQXyc2er5wtrn293PvtN7eBoJJoD9wmE6vx/hVZ0AERd8QyodaXe4xuvMkiWVmjx0UGz6nPZbqqGn3Nif/IZ8lXLsl4cSelOSDEMoBnWLzT9Cwmm/Me8/mhVTALRitslUiyvIV04fZitHAqttiAt3+w/McqwTy5E+/xBu3QpgbfBoQpoJglaRGg4DF6SgnJGao6M5yAwod035Tlbb/eF/njHeP9RT1yNcpYzZGcRQmyoL/Dd60IOE9FYvi1q2vX+un9vNOqJDHedUhfTwVgsNYS+3YS86+OG972o9M0uyxoD90hG6YBDg1d0E0amBjgeBo4JIJbzGqczVOjFpuYw5S5d9N45dHP3YjPiUC80jqdrRb5CRaHY1FHdRexF4zF9vJRlTTYGpk2Y/2befcL6lOcBVVsYkqCsBExrL5va5Q7ilF2lnIJ240+FurTIBb3oAGL65Jlij0KtO6w+fknt9Nv2FZnJqx895x6Zl+/OC/fG36VyLzOt4T9meIh5G0cxUHvfnGJUzVKOBv+JkuJFHmh/oV4di254jL0suAcsLpAdPtr73tfXqafXFRhkx9s++F5xrK//yQYJoo6tlRzoqiDMJ0Ik+YVt+30BdzMAamW4NOrY/YTGQGT1gWHIek+JllL7nHvvDUg+lzBBu4Lv2y8uUsF8aaKhekIZQsqehTwXQ3O+vBnW6c5oWN6fPnmH6/JU/jAIWFxzRpM6RL7x7V2+WBEww9r89SNf3Y90+HaTDwSok0hzj+Z6b2E08wIsfPvBXtFtLdRHvhRLobC5+8SFleeDP6XooG1Z72T36Rz8jZoZS64epcUGkr9ZKrHVjqL4ilTupzZAMmz6DOopRx5jKZj+JUiWoM8As1icPrdo+rNVl/7F77xRTJ9WVwU4Ze9f3qN1U5o1bimJeHTKQxPsTkMUbKCI5+Tt3NJ/IL/zNL9EFcaz3hknWDx9Lw1XIQzou1YTVEMLZueacXjsXx4qb0uT3/cQDtAKFN4TSNJipuZ5udKH7uZ4moHC45LK4aq7cETgTHS26uuJ7BpX/L7d5dMA/9pmfz0YG6r5SYD/3IF3akzivG+h0XmiXeM9xwCNh77ac75b3O/mtL0avUMbexTNH8unjuVmVycB7ZfP09GVXOEseGqtt3onNec5J8OS7rxepWf2Xb9AFwsLlIZmkH6U9Kd3hnlQ3m0eVZ/zDsbRfBsO8hEmVk50HDidYWAK4d7W45B//wjvEiXnXVDL2Mwfp1n6grdMxGFilLErcWFjLK073/beIw1U3/e2v0vm9gT63H2bglhPIeYVYClou7GVLOIuLcBYaaCy4wvVtOLZjb8RKhRDWPt4WJTf9Uxz0RzCZnqqkr91kWwzHh0YqtX14sMzkyUAsH73armFu/k0PYsU3x/7inYsztzudBrj4+Ndp0fXMDZshxZ0IEY+185wCX/DUb+coLy+fdvEHPk+7exoXdSKV6u34pgnZVekCYILV8GAt8XRyF47nw/Et3uxOpNs5x4p49w6dh1J97klFSPqF7FRxAK92V3SOlpaBzkFdajlYWnI5CVRbUycY+18fopd1A/3yToB4qwMZs8PnuUi8K9r97v3TxuvzG/36F2lnINXLeT7pYDjvafSQwpIdnk7e5p3XhLAXmrB93jN7uEFuyF3mGAmzNCQyW5EaBv3uMOOfITRvHm5V+JTr7fhw4CRVGFTbEdaOBdJLCy12VOma2LN9iT/9Ll0RhXotdVoDqIBlIBHW2pLT+cCbxJFpN07X8n8N58dS793oAjytPC5NfywCwcxl7eIIoZnuKix4Q/J0w3IepVCCkkiCWE9ZVsZ6UhXMO9sQqlyf3Enx2NWqqzvN1cWjs9KVdYEWn9ivbhjEaJwcIO4p4m1KqCWE015wnvytW8VEt40z9lEXL1NCn9cZACdZlwdQveEUyPJUnbIGckV4xzXHy1KFvFmgSRxix5R1TbONFuowNGdjdvJ2lXMTL5t6+XjO0uUmkee2jn/5F6dPp68LaH6e+MS36c2nBtps9BEHw2igxVq46Bz51zdkcScH7X/yAPZ4hPOFZXZHESgwWUjEE3Z5dQmPgrImTluyUyxYcfpjjsk2oGfvnOpWvshSr2FtNqLjT/2P975itC9h3fvMOk98/Bvqp5/Plt7IPv/ODwB2MqvLzrMLFDu27a00LbMLFmz+6RJtwYQx8cQ53Y94rJ5DI9JsxkVQyabQsYWjNBp8vJx9ygAd51B5JWGJiKN6VMWtVZUsx6gcQuVD1m3fiXzLfeq//6LYejGALN9D/PF+uuVkR5tTARRHBPyjDCwFTRfOkg+3acO2LWEREYUKFAOal9zHhgFGwh48BZVAPKnCst2YBJ7+9DuQJoDvvLe/00oW9mqpmtzpYO3k3K5OcseUm/38XtMI6CmamzuoWTq64CUhifbTX3k3Nuf9qM8LAVz8p2/Kq7b6wt8aAsskshsQS65weFtl3m2SBASvreWENy/8YEA5OaMMpYtAeDUQ/+yJsd0Td78dz5YLzFLyrrt6a+R5e7rStJV2wPFpzvDpyelx3ZzVry+DkAf5ZAleRIw2WZ2m7z3342LoBGM/sp8u2urqCza3stXNXNl0+6MGBPuXdDNaTsRoIElYWyndzSe/UcOFJOU+17PxXB0L1Ju/AAABOklEQVRv+i++fNTbPL13bUDOjlibNkcFzGKTUOrA8vtOG10d0+rhGAabNx/nv1niRKS7FrsNu++76nTwVPtUnYzUC2HoBLAcNvl/pa7aCIWzKUnlXp1bnH9GZFTRgvmxydugvorjH33ynYv8+ysTs7/rFPKKj5J7sTVYi22nHQnRTqCbscw6DXlPTsf8MzRDuSgMBjn8o1LD13DGDDUoiVqu3ZNCdpaWljp1GrpOOc/mnLRwv/9N8jcH8uW9rrXEixyYRflruHty+tG23cCR4aa17G/MS1KfTWFYMu68F030+wtd13KsSNjkCIeMcITk300DqAHjpD/mQEaJRDWarXCXRPiJf4L4bBv4bMo675qxEYT3/+XWahA1d1LLc2VfIkoodnUS+w0/jjex9bFfHv+BsXk3/3/5+/8DKIf6sstcS3AAAAAASUVORK5CYII="},37426:function(t){"use strict";t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFwAAABGCAYAAABBovOlAAAAAXNSR0IArs4c6QAAEKNJREFUeF7tnAuQFdWZx/+nH/c1M84MyAzOIBpjBYRgNujWqMFE86AUNYpbRGMqmlTMEtmEGC2yZrfUcTdhw6KbJyYQNUIFycbEVMgTDBoRMwQzBAyia5AFBKI4w7zuq1/nbJ1+3Nu3b9/b3ffeGZDNqbIGb58+ffp3/v2d7/vO6SaIWD71ezYpl0OLoCJhyIgzBtFsQrMasv+Ut+o64FvH82PFdvg1qh10rqxa/7D/lPbHOV+ErgGaQDHa1YKBxz9CfKtHRFS1Ognb2CeeZglqYLouoCUK4EYMQM1teBRQbaANAiomcWDbx8hQWCa11AsFfNGPmChNwmwiQHZLuC6lcmlV63HQE2HDDNNGlAETxrC37w6SqwVmmHNCAb95C+vWCaZOmNlooHmKKgoiYXD7J8mBMPBqqRMInDFGbtyEd4sxkKrAgyCFsfMRTEAU1ZaBqdJXQsHObMee8bLngcC57VZVzA6cp6oBDzMhBpmQeo/7zOiV7kmn2Ne/mIzUouCgcwKBL3qStcoU53o7J4sYeuyDZH/QBU7m4z2PsFkwkCz00b5JXcTB/sVkYDz6Hgx8K5uCHKZ7L35KAP8umwURSe/srYs42r+Y/PWEAP/4JtaRB870XtzQMPTE1W9xhXPg1KVwO46IE7zedxs5cvIA1wADpxZwt8k8uYDb/rPwN+A1PQCBNnzhJtYhaUWT4ijhVAGueUwKp2gQvL77RJmUvwGvScgVTwqtcK9beEoq3L5JI3aCFc5cJsUZulMOuEtRJxb4E6yDxcrdwvECzhhLAJgKoBmADCDwKaz1odeqtC0DrNZ2AegAMgCOEULG3O0E3sxCP+AaIMiNdQt5zgZAB4BuTQMbHIRycEjRaK6uGy9llohHZ5hXop2TALraidx1eiwmy5A4dABHCCGUNxQNuDufIWPolw0MfBhjnQCmvXJAzaz8njY0eDxdg8KainD482EXQ8sG3mclqqKcKvYj7a7FBexfJLmJ6VqGLPt022kXz42fBuA4IVYGMrAjBYV7E1ANBG6bkVmvHFCzd60YOh5NUu7aJw9wp1eLb5ZbPnBhvB3Aq4SQ4XDAiWXDS5hTDP3yHxoT2jPGztY0tC/pzRytTdm8d42H7UArqDyCwt0yWH1fbGp7e0wnhLx0sgCfc+h1GLff90aNGToXbH6nzUA9ZsT7hNUL/K7PNLfOnYVWALtCAVdthZd0pLEKn/uHl5SxFd8cjpCD9kC2QTfCbjca+I1XSKnrFyROB/DiSQO8b6cyuvJ7w6OV7bcPYA/kYNgV2jA9uMqlXoUv+pCUXHRNYgqAvdGBF7cYNNKGzzWBb9CqAA8/lRbNSSXA1doqh3/igLtnTbGhk2ZdwP3tdRG2bruF83taYgveJzR1dcXiMYD8dRDqM8+PZH/+rJTLZLLmKEgFN7AI/sQA96wp8hWfBnopkYBXnhDLIU9qayI3XSWmLnpXvKm9yYxcy4qmwfjDXiW7/ql05tA+anihTzxwvTw9ezID54q+5MJm+cOXJ5tmdiMly8HxhjMK+w6p+Wf20PTGzUa+ODKW2kXFFQRVsfs88HGPanQbbgN3W5SGA9+rjH51zUhJ3iGc1S5V9Y1XxJLz57U2d7YjFu58/1oZDfq2PyqZB/9bH7PSIlZ2RJQc6NUjzZqBz3+CdcCl8IInIGJoS+MCn7l9ezH61TXHIgJ3wY7x8D2F1XfKU6Z1xuqC7dxjVgP93PKBNwaGkoYDvajyiQTO1zQTJwp4qefhTIhoSsHQcoTqIB9+b3P8ip5E6tzp4JnHyOWNIai/2a5kN242snmVMUnmCTSvWZlo4MDQlo81LLSPoHAf4DZsrnAaAzE0QnSSE5YsnJS8vgfNGQ2sLQWhGnmeoeT//eUo1DsezA2LMmOCCsb/IpOFxP+WmJWJAu6sijQY+NZdytgDj45U8MPL/emisjkFrm5CaCxrwqZyylT6LR8SUtdfGk9e25sfuepSErtqjpCY/TaZp0wL5cgwjCd3qfkntlDlnpuEJsbAvrjWGBE0MFHLMEECE02VTzRwj1sYoxg5LY5D7s63n2PnrvvLteT9qeUdxTz305fhfAu4Hjrw8QdeVLehp8glc4n8lVvibV/bqKR/3geNGiBnT4HwnllxKZlQSf9+pu/eD13QGbtgJhHv+Wi85ck/KdkHN9LMiQO+jnVALHcLS5CG2TvIT6iwRXn7rcDWXcroisdGI06ajrpz5oTpNieGnCJxHWTpIqHp2p5Y8s1h0J0HoW7fqxpHjjOqKMD0DpDzz4qLl8yA3N0B6eXDUJd9Oz+SZoyWA+feScblqYyXSXEBD9r6W+uO1nqBc+xFk9JEqAyi5fMCk5Pk7GlEXH+7mY8OLKt+pYxt2JTNy4kEFbQsEzXG5GSSTqwNt4HXCjPMnvLtt9Wq8JQJkXsnlsJLbbhOFCEmJ8jmf0tMln1jzNIx+NL3laHf76GaoOWYnExQc9IseCnWjFka/NizqGco6wp85q9jHZrLpBTaDto+bJsQp37ZgLl+ePY2oC/QpFhw/YoFHOATpSETQnU+cfJ/pwjTQX7wBbHtbd2lk6W3HU3TsOBu4029mjkpizYnCngQbNdecS4sX9j2AX6MK7wUeGW4XlAObOv3oh3nwPkA6IQI738nif37J8y1xYrlJ33IfPPHuYwg5ZjATQlLUq5ugLuElv02cyolqz4TATwkbI/AS2/UNSD8QBE4D6OjF8ekmCq3/XAO21I5IbKSF5be0JZceBF8R/LP+1X1jjV0RNUYkxio5YNnTXPC2yy4hBOq8CDQQSbEx7Y4TTrAl68dK9NPNPwuO64T0nVWSlxypdD8251MeWo3M3pmE+nG95HkOZ0xkadnXzsO/amdirLu6Zzyzu4E+ex1QurxZ2h6xytprWi/be/E7sjE2HAa4BZ6YEadYC3gGF2+dqAO4ClQPUuQskL8ZTc1N3/gwniTDBD+XuePn0Pm4U2KWrLLRAEEkbGr302kf7pOaEmlZHMu+NM+Nfef6/Xh0WMZcy/JxCuc4syoEAvK9ObRfWx6/cAtS8HNSVwmZMU/Jttm+eRRshrYtt2quuJnLKfqYJ+9Mh5///lITGkrD/uHMtD+5eu5wUNH0yX58QlTeCN8cF+7rgHblwJbdyhjKzeMRbThNmhT2ZYvvvafJ0+a1lk9NfuNjUg/96pi/OgLcb6SXrFkNBhLv5Y99vrBDHUmztIU7ThMmpetYs1Cs7nEX1J83xy1VqlCF6f685/B1OjAS2FzD2Xp9ammq3tQ1Rvh5mXhcmVoZCSPH97Telp3m/3qeoVe7z2k5pat0I5bGUPuimdcOfFxAB6aXh0VGWNzt+xQ0is3GJEUbtlsS9kc+Ia7k5M72v2X0ZzuDWdBr703P8z//9ufTzTPmVb9aeADdM0Xs0eLAZA7vP9/AtwBzW/Xgc1dwM1fTnaGiSgXfHlkeHAkTn/xr4k2P/vt1c5da/Jv7noprbmzhtWW2+qKNOsQbuhToyrcBM6L7ZFQM7pMkmceSPLdt4HlvnXK2PP/C/0X94bLsXzl4fzAs3uo6lZ5lPXNSGuagb1vQIVqwAtwvdexYXNTwhcbeDp22zfMzTaBZf0WNbdzP9Mf+HTc+jJGQLnv0fzgc/1pVaZJWlj9ibC+GRn4NatZalDEFEGAqBowk/KFPrrWtiv1u6yK54cdt2Py1t3K2MpHy224L3BzvrSX1OzFBp6oeu7+Nr6dLLD0vQx132HoH/+gf+TpbcABXlyMSLHSybN6qjYS8PnrWNNoDjMkAaRaAop3slbXsZ+7hbuVsRUPhYw0U06W0EpSOTmT392fOD1EUhB8lefV11TjvXPCLTZ/6bv5wf4XqWoBzzDTRSzxVhoEvLeXCZunYZbB4P/qQMhwPyho6r/TBv5YAHDHj3SZEyv3TQQmgzxye6J1xrTqXoojjOFhGFMCXEJel3s1N9x9fIBJCcMK98cR+HseZl06xRllz2gQ6KDjnsehUcCnnk7Ezy2Ip7omQyTQyvZNSrLMeNfMRKUGuD0aXbPq8zpm9zRgNA9j7a/zmT2vMU0Gs/PjfsD5Gf4q5x5LKJNy5a9YfOg1zGaCz66lal/ziQibV3/BV+HVU7SFRQfX6o654GAkCJVg5sG9zyUx/N8XMuvy10GkOAMUCCIYX+dU9TwTaYLKZo48y+QET9mOE/CLH2LnUuaKMCOC9LXpFdY+OfBtf1TS//F4+MDHDdyy4YpAbdgxiRC+YOw3e3KY/He+pskHhNvKnJEncSSgiXEWVxSoImOCDsbrSibsHJNZggqSlbItt+HVFR64P3zeetauZXFOSYcjAA+y2d7jT90KZEaQX7IqG+kDX+Y6pivvzZXKQZsKNxQTYkHldmYw2KlSIOhxEzbhoM31Te+WCe+kWRk4P2K/XMXTI7vLVHBZL5OyUzGbiOYrb2WuRzVPpSJoVzt+de6/Crh8OugNywePKVoy1NtrBYXrOYJksrC85pgHU+GV9l1VoO6oH8hDYnHKvRILNivsT6m8AlTZU/lOb3tHZ2eMEULK34C45CF2lsFQ9GeDlN2A4zPPAH56C9D3ZzVz7w/C703xha7nCfgnUJKAA7/4pFqkiZQoDqonCydK1ioPB23FG1mYwLmHYh/zX3LzB37zDa2p6y5LTAZwgBAyWKJwnhnMxTDDrewwqo1iryt5PEvnAbfNA55+QUn/16PptCJXV3pxLdPJGjpK5wvKxa8qVY6CXKRtxQvN1jU5bAs0//8sOHhFTbJUYX3TMiGla5zlwD/50damKy4W22VZHiWE7DMH2+kQfxP44ocwk/EQrl7VekYgyKY7fbjzcuDWHmA4A2P/UVU5PBDTRkejvQms2EZb1xQft5B7Ie5SuW2JFj2alpjbu8lDlr3tFNvkk3BnB5Gnd8bj7daWaZ6ZPEgI4a+DF4Ff+gibouaL37YKA6mmOj4nuX+aewbA1d4zvdRPrqxU60ihjRArTJXacnYYFKJV+x9holefNp137Ute9DVVcMFqJgsEswW9mIwPghkUxvuaGc/k6buFwlWHR/DemzWvW83OBX3x0yYT6vu1Pt+57ZyEIzuWIeh9UoMQ4jv5O8DfLhloq3ovDTQzYeaFege0UfdS1g4DPU/Bnv415amloKfQNCnzHmTtGnCO3w0yHbooIc8/URz42WGPOQxlecO0y3sZtW1XZ8P2u6y/BoggIaXR8gCKGhjIryIHwwD21iEXrWLnMYKUF7jIcGzHEhyu9GjUcrG32jnc1L68B7MYgeQ1Y+f9HV7oXxxd5eSCb7GZTHR/GcDCQsbx65RvFfDcc2v5PGZTHq96TGp3J1480EuCA1fPzZILVrNWZuDckt/5OzwEVBBwXNMRudFKb9RVf8Ha07MQlUNUKW20ygneQ4xAEIA2qpQvUhgGhpU15NVahONMmmcwA13exyZo4go6HmbiCvKGwrQRxiPyhRPkCPg0rEvIXXsp/ufxjxCjZuD8xL9fxaYaOrrrukGP21fWoQAfvFA/CEQDjzvXrJYjcuroFLk5DH+p1UMxTbUbCjcvqorpoBX2ati9qlnZQaA8o13tOmGejCDlhznu8KEy3rxrEg739lrfrqq1lIW/vYwJP/kOWomOJqr555TN3xOlySHmqlueNOL5NxSSd4GTgsdHC6zP796nUuB5FSoULs9AJQHZGQqG61G1e3D+Dy50RqLE9NSOAAAAAElFTkSuQmCC"},19150:function(t){"use strict";t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGIAAABGCAYAAAA3mEEuAAAAAXNSR0IArs4c6QAAEaRJREFUeF7dnHuQHMV5wL+v57Fv3UvHoUMCvYUNBpMirsiOsMSpXEiOcABLgAAXkkicwoQ4xFUJdipWGYfghMTP2I4jYqPEIUiAFQEWyIV0Fc4KihzAkiPkQgJ0Euhxx2n3HvuYR3+pnt3Zm92d3Z2ZnQ0i84dutTvzdff36+/7ur/uHoSQL9q7WYZz+7oBzE6QIApIMpiEoRSjA4DikCT+H9ZlyxZ/mcQBmQ6mmQVFTsPa584hIoVVlJuccBQEAESEsH1FHyjKhQCGFHqlnYoKXXhJYD2wJhWAxYbx9l3j7So6FBC0ba0EkZF5wLGjXRWFdoHwY1UavY0bBk+3o40tg7AsYeeKBW2D4EdRQTXkpwxMHsf1T48GLarec62D+PeBPuB8dtgVq5DnR1HNKtKqLI4EBj+MGwbzzYry83tLIGjvchnScDkAhhsT2umG7GDfChAJ03jLnmN+FN3s3tZAPPWJCwD1Oc0KCfR7K4qqV2BYMoWcyxcdxKt/EJZEaBHEwGJAngqk6HYrq1q+rTJhEWGorxAdxo27RsJqe4sgVlwJCHJYlQlFQW6VCUPx1XKZchZv3X0irLYHBmGNlnZc+xuhVMQ5UQtbaWHLsxusYxrvDC9OBAch5g7K6IdDASGEtENh7ZBp11WiDN4xeDSs9r83IISCZKUAnAqA3ASTK8CkOHCThdUwS06YIKpHcu9rEKbI4RgjEIuN4OpdBafSafNmBosOdICSnwXAYy0BCRNA2RWV8ly27PctCBPy0EPHcEXjiVAxZzXQD0AX+oLRDuU7IVRXxqAM3vV+c03IcqB1/xrXbTe9KpfEjL3gc8YeNoxGE8v3HQjhjnqM15pZghsgenJgPpi8qym8sGfiXuYcPkDQtrUqnBuZAUoMoVeewjVPZ6vb1P5greNpXLfn7abKdLmBfroqAuOFy4A1WM8I2woauSNnHT2AsABMjfSDgT3WOopdV6QMzOh90+kh2gtCFJyM/qo6MPuBQtuWLwSok15vBwSvMhuAsBbH3tw3C8DoLXeiarkc0/jZ6XlIm0GwHK574bAfxVffS9tW9QLkL6743quy/BTs1725gLDWZSbSfUDUB3LVUNytzh0zD+O67TlRzfaBsBqGabyhtdkn/cuqGaDmF5XnBWFkT+sB8gPYAcIaes/fNxN0fRZIpZSPF7CcjuNnB621jfaCkHAUb9pz3E/HrLGIrZ9IQFS/NPQJmj3hCwrWoAxs2nsMtq7sBo79gKbqarUNk4zsJP7eC2fCB1HdC5g8jp/+2estgdi2sgN0c2FFsGtFYPWzfqygMlgXQLY2FERrquPFGqyHPIAgIrHYIyi7px1GRxkc+ovFDXUiqzos+0ZrCyhDX+uB7PFeX7rXswCZU/VzHJ4V5avU4s2+ZDcAQURxABCLPckA1Th/HhEwhvcCvLwFQM/U1iuoJbi10Fa+DcKzFuqAIKJZANCvT6WN9JkDWeP0QS2XHXHfzxMFEAmhvGZUxZmoi60Wa1bQTPeYVGvcdWUU5VSXWdny+Mx5UqznciV5ydIYZDMIQw8BjL4coMd61mjABKMLCCLqBoB5E28PTRze9ZmMmc5STiOERLEyTvMQ35e+Bvt38YGJ++tcwszA+mf6ymvc82Bh+tE45PU65VSlClM9V0qzV/5dp5rsVmDHnQDZ0DdfBARg66AKBBGJ2H6ZNnZU+8U//Xa5tqGBiE8z8KN8J7QiiOK/XkFYHahzLltw0096YfQQwu77fXRxj7e25OJqQfQBwOxX/u1Tp3In9xt2FQSIZLnrT1fMt0W0G0SDpLn4qXvpVxIzr7w5BTtuKwVxj0pudltLEITwWhDzdH2q48A3F7zjLDunELpF7DIIB6QEJMCyoKrL6ZJaswZhCTF3V9YEhDp3tTL3uq/3wNADAMf2NlNv4999jYqaFVULYtHkuWORg4987GzoIErOPQiEypDiPTY42yAYMbkLF971Uh/s/xbAkR3NtFP/91AhuFvEYm1yWPnF9z9SsT3Ej0UwLe7aW+NxMbLyHpRr44IdE6oifbW266gvdBDBMbo8WWsRLYAo+ie3EZNQXV6uhFCrzmJPjyq58jDZTtZbz5dHSHVA1HFLzq9bsginFYS1J6qMpN0gSsHZtoSiQmOYnDWXpWZ/VInGZzOMdzPKjvF89iQffWPIkLPD1uqdlYrMFVFEOxKUzzQ5W/F/ASJUK3AKazMIVrICAaAQ7WL9v/kn8RkLr42qidnOYyYVzdOmTuqFEz/Pnxl6MMuNvGUdFpSKDy4aaRcIL6t0QQGVZbcIouyGLK9U6ZpsCEyPYf/H/yjWeen6lBLv9LxNRs+mefrQ1snMf33bsouowsgViAcAtp4Cu6aWh6d1SLULhA1GQBBWgHIM+1dv6UhevCzwthht+MXciWfunpgy8+QKo10gQh8ZNUgEKiFahD1ackKYe/OOLrXrA5Gglms/p505pJ14cn2azDzVWEeDUVL1T74tot2WYFcwbBDCCgSIAkXY/Ou+l0ouWtlgrNkYjz7yuqn0Liqft5g8uit3ZvcfTpCJZRiNwoaboXgG0S5rqNfksEAwRYxoEhaEhBzDzsXrohdc+0BnUEvQDv1Y006+YiZXPVyhz5HB+zPjh58pkJqnbK4qbjgKq+cHm4JohwV4SY2HAiIh5g5xZBpHpsQwkeK48NbBHkhcFGibvn54h0kvPqTBkuuZuvyLFW5NT79lntj2yTEyGAk3xRVWMapqFojeUxCNIIcGQo5jUiu6pFlXb4r2Lv2zYKdKR18j7ak/0DVukHrZDUxd9oWaYe74f3x1fPTIY4WsUSBuYkUAP29BNHMNLYNQCC1rEC5Jj6EUMVnfmq0dyTkfDRagf7LJmDr9OimqyWHuJ5k68MUaENqJfYW3d941kTOQVKZxO3g3a6s163fLNbXDHYnC/MhtBYSVeS25paTMUaIIYxGVzd9wYCYo7vmmhso6vJNr+x42gSPpoIPStQTUtT+s3BFhNTBLpx/52FiWaZyMAongbbuoZjBqQPhRVjPh9u9BJoCtg0hAUiPUohGW5CZLphbIfXc8L1b4/F3ZDMATt+haPksgGcVc00XLmXrdX7rOwE88OpA2Jk8ZHCXuHNI2K7QCxKEWsq/1Cgo62vIMwmVhyJq8JRIgc5OJkZJckKXUvKVq7/VbmscHsVQZnzndnAPfNbVXHjet2CAh4dUbZeWqjXWD/fgzG8bHTr6q84LGs8p0rHhPQQSxBN/ziDogmFKMDymKMIkpUmretZGZq7/T+HTp8H7QX/gqKWv+BmHmpQDZDGjbPq0VrQFJvfR3Jbcg7VTyxHOfnxw7ulfjqHOOGvfqntpiEUGtwNmgVi1CgLDiQzTCEgVFkrs+qPauf2JG3Z753z8kePVHBJyRvmQNKtfcx+DwdlP7+Td14AZB/xWorvn7aOWrZ2qlTTx+y0R24jU9WxAgiu7JS5z4fw1CpghLRlQmaYaUSHXJvZv2ubomXSxNDj7ILYVzgygWIfXWnYr21MaCln6Hq1KEcO2jMaWjv+mOjvEffXw8nztnmlw2s6i/NyDCDPQtWURp6CqTyZKRCEuwlCRxJneufTyl9C6ssyvwKOnP/bFJ2XFuBeVF16H22rOm5ZKW3a+oS66vmx4vD0pGjvL0U7dPEudmtjDBs8i412Fs2SKGQlgqFRUStTWoIOoPRsMtWI3DVztAdCy7L6Z+6LbaYaddlew7pD15jwbGKNdMnUATI6QrMfmp7zebj1kSpl7eqpsHvpvLl0BwZJx7nE+EAqI6JhBl4O69x+AHK3rAlPoBeNPOVEOlJRAaoYgRRYvoZAkmWxYR61mkJG/+53hDP58+yief2JQnrltD1ei6x2JK5yUe1ip00B6/I5tJv2UIizD5pHmuNLHzFSNasQgXEPi54mFGa1v+RS/2gmbOAvT4ghghL6G+iXc9PyZkWH6ZiNzXrBuMmkSwlpkqSVpKiscliZkozxz4chQW/07DXJP+5l5j/GdfKkQW3ygnl3/B00xc5KHyQ3+dz1POzHHTNLlhBgrWQUDUiwlEGRuE3dPLB1U06gNqcmZcyMXor/De4jHnlkCIWbUYvgqriMkxGeM9cnLdY1FQOhoG3snBBwuRq+5UvQRoPTsKhe0b85Q9ZeSJm5wbVqCuC6K8nDftCFiqtJ0mCAghxg2GC4gykH/4fQWMty4Echzdqp6Bi7Mj90yfHQkMQswjBIjeiMqYJktMYXIUYxLr+5CSWP0dFZRGLtOZI24Qz3QdtJ/eo2kjBw0ibubINHOazk3VMEWaY6qU/CtLcIEgfvMNwsscoQGIMpBvrYoATvUDl7rL5zuEWgr0Lnx++TDiZm7fGwiEc2ZtFAypOzKDiTgRRSYhkyR14YCsXvMlBZTA60MitwT6nq8YheEhC4KwBnvEJAK168w6LBD1rMDZZzyAcLgsFc6OFSe8CXPK7e1nvkFYPUzMrDWyArawikREtYJ2lMUlFDCQSWr3AglXPqQoHWKnv88rcwr0PX9uFM4cMUUuxbYG0nTudEtWBtYork00unxZhNd5gg8QzeoXKEYUQUynwQWIJFdZXLgoJkkxlIogSGJAEsOrbpeUD98mebIOcbjkl1u59uoTJmCOa4bJiZtmnhmcuFKMDdV5pjpW4Gy8ZxBeIRRHODXB2ovC690T0CKKIMR2Sm0qwiQyLauIRxQrXlguSpEtEKo4rC7FES9ZypQ51zDoXYSgdCLEO6x8E+hp0keOgHLyJa6/8Z+kFbLWuoRmSJzQ4JZb0gyeswL0dJAur0eEAcLLsma1Bs8LEKUDLPbikOWeJEJJUyQBI6oqDLVpGOJNyMgIldJrjHWTsCaWy0i6poOCjItsLCErQhAwmM5FfokMpIrY4AGCp2DtxxLKjv98sAgnCHvNWhYhVGWMuGUZqCosyotWgcQZMBnFtFtjZP2tuIQiJCSNMwJTJ2EJeVayCK1oCTkFyV4Q8mMNDUF4GR3V8yXnjUVYI4DSBgIBQY9hwoYR4YyRwjokFZFkpnGTRSQF0RBuSuz8UEEFzcpyWJeEROJ9qjKjgqmTygyeN5FEcLYgGEikFFfl/EJoCiKoYzcwjfe2dpjfWbQdIxZOnTsZ++UjV1uHr+2r6YmhEgirsaUtNUwvWkZMJtRIYTEpgihmmZKCUUZYMDjWTKdlVgKhkwAApkZiwpYzC0QtWEKZszi+teH5C2DobwGOPOtvXbkeKIPO4L2DJ4NyrH7OBnEJgN6z7+E5FYKbnqFzgLDPQdiWgRJhXI5gQUAxOIr/g7AQYRVVF4mD4yajPORB9HoyNAuAsIRItSWIZz3GBruYzivWRy4Y+HIXPHs/wKn94YDIq2/ifcU8URiXDUK8E2n+G0NfGzn90tfLr1r2A8K2Cmvvqx6zVvBQJ0RhETKhOMErPguLsE7zlo705kulkbAKYQ0ChuWKxObjHEQDuiOncvpv2tKRnPVbMXj0Bmui2PKF4h1UXQf9vAisWZk2CPF3ia5PRV/9x4+c1rPvWlNvLyCqz87Ze2DFAZNYLA7CVVmfozFAnaM4nC0AOSsmer/o5YJJpAqAxUxsKPNpBbb86BU3Ri4e+Ksu2L8F4OV/baYPb7+TchY/F947X0WhZYUQkeijH9D1NB/e+8DYmYM/LgQB4TwlVPwcQ+tgvF7cKV6EUtleoWPR88W3zv5qAQjgiqxnYqXTpB+8MQWjxwCevTscl2SAAWP0P7h5sHz61hu9xndV9kwiobO51oFmfcqYfPe4TpQrJ6bcRKGmT8uosyxkDVt1x31h1LyuDBXUVK+kJi8UuS60gvPQ98JxSWJkN0P+NX5m91TYTagNnOItkwA9ACA2E9d/KUp1TfQpCbLjDdYivMya/C9yuSpEvHtjdBjg2G6A4dKrH1rVnLCEXOoN/NOdE62Kcu3QYQqlbWuTkDk3BxTTW9rVC5sgFQxbrkhbZ3rfwc3by1OfINVq9EzTnRNBCqSn18ThbL4TkEeBuAJiyGr5pyDSWnwmSJmKYgLpOkRiU5BMZnBd+wDYrftf5H4s7DrfhR4AAAAASUVORK5CYII="},55303:function(t){"use strict";t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFwAAABGCAYAAABBovOlAAAAAXNSR0IArs4c6QAAFIpJREFUeF7VnHt0HNV9x3/33pnZl6SVJXltyw9kGyMjBztgNwk05diFHmJIk7QElYQmYBxIUx9oCOSc0D8a9eQP2rTp6Ukf5NGWJqchB7vlD5pwTpwmuAnBGGJjbPzCdg0SRpK1eqz2OXNn7u25Mzs7M7szOyN5ZZT5w5K1d+7M/dzffO/v97u/WQS/wccAH2rLlUudhJAOpKO4zoHJTKkgrE1vS70/uw8NGotteGix3VDY/QzxIfydfL5LQtIyGkNxmcq+p2CNGIYOl9b3wKUDaEgP6/dKff4bA3wrf1DOQk+PXjQyTEGShVkGoEGorBZIAyYxnI116eMn0ZB2pcAGXWfRA+/lQ0mlUsmoxOiSgSDBt2bTAdbtalGbEASEA7DpnpIxfrh3qPRegV+UwDnnaC38ZVpTS8s4xm1uOAI2pQKpv5T4wXbOt86REJnFenz8XPfDs1ca/KICvp0PSW+D1k01I2MgXXHDM0HXrDtcShqlxpkge9IULJclWRs/1f74FEKIXwn4iwJ4Hx+Ka1DOANBuThH2WKlbQgQRU7Pnat117c0nxD5kYIxTjvilvhOl7IEdC7vAvmfAhWysh690aMAyBrAOc/i1BbARaNRF0tuPA7XGtw6226oRR4wTyKIp+dK5DQ+rC2HxVxz4XXwv+QW80g0AGQw85gZh/e6F7RUC96TU46i2bPBaGnpoOrH2hGFCphO8e/zY8s8WWwn+igG/mn8zVoK3MkChh8tCNlyHB1IjcFO75+CR1C+S9ZMavOA2ShYBXIxRMn5szRdmWqHzCw78av5QRwWkjAE4HWgpAVJSWyjnBdv7tJjT2ESyHCnyXx8UXVE1DS59Zv2fZIcQYvO1+gUBLqLBb4HaDVDJIMDxpjcXsAh6hCAkuAnTbceV9NF0+08RF2OscgNJeKJ9Fb50GH0+8M6CxtxS4AN8SMlBKQOg9TAgJJIV1A3U6/5VrdR3WC5LDJGksAU5kufjuoa4MuKEc86mlkN87MDaXZVIYxXnRW3YrJ1IIuXV4jIds85Aj62+gyi6HSF09w/taz6NGSRZ0xbgSkax7DrYnngAAAhFOd7RMXYyM1gI4zlv4MKtWwV/3sVM/5kkwy7U8LnPQD3WHajbdZ5MmHWH6XbESW0IvHwMiBGpmAQYe63vvlzQAjtn4EKfvwfaUgraMgN4UAQSzr+ZlMzR6mwbdl/U1u1WW3fDtXzcUMyhwhJo7NTKzzZEsHMCvpI/3g2grmKApHCiTVo0te5mYXs0Tfcukk1sIsz7qcmRNRZLSnz6CzAQBFiVSuTi8c33TNs0IgNfwR+9CgB6Lgu0fdcBemoOpum6HxTcNMqMT7jjvfUoklUHvCGl0ETOahejAHGITb628e63hcxEAt7Hv9ipAlnfGtheOA1hTpgL2CSStHtunk2cXz4m2LLrJtsDyTEgrMgTJ9cPDkcC3ssf7eEAwsLnfzTxt2uPapj7V3tC6tXa9f9armSeXkndPQQ+KWGLcf0ahVHxeP+nT0cCfhe/i/wS1vQjgMS8iAfcnAdJRD31Xt8n79J0wRXWHaTp/nLlOJjeSfVbqD335roO4kTtbMfnD64eLEcCLjrayr8tj8L5dRwMz4ZApAlo4pGYj78cpN0uCLZfZl7QJ9/i0Vs/qOIajgftO3G+1l3XV5huu8aKOONxLI19vP/uMTsdEBm4uEHhe/fBI8s1CitAJtHObSIlNSsJ0+0GKWmE4GuJbqqtWCQ99xEuWYizd08NfGbUfRuh0ATkeiu+Hf5BeUMdWYVirDPYwiN4FE00uzacMIuqQWjm/oUsbPYgqvrvPAfR0gc1BnXGhZl88eSmwbGmwKuAlwFAFwiPpkXhfyTpaVEjMe5hmoP99DQ8WToCJTu+b+jfaxQ+K4JzRrNF0vyMawCK4r5EKHDOuVgU1wJAYqQwrb6dm9YuieoOsdZoavOnwdlKcCZc07znxKzEoU9ToPVt7V48Q4g2I104gTd0ZOQ1bW2xLC3BY7n9cIh6nmzvOtCg3dF0W2g0wiSrsdx4u7G0u8zZisjAOecietw0Q4vwxK9+Mfm9068E1HCkAFKNA+dSHdxqEy7RKnQn3cKJ/be6fux+VfF5sENU+yTEZ/pQ11rp7zbe2rkstUT+aPZpOE+zrgs2Sl5UjwRznUnAJ+QcGz+8zUrRXn/6h71zBb4OANIfefY/xl7PjdQqlbhaDzIAuGjnOxELCDyCwXe1daADv7N76QjkyGB2H1B7799l1bYD1Bw4AMFYZ1i5tOzC+Yn6zeb+0z/sRS4LF30ZQRrOORfP+qZnh89O7/nZf+bd42gEDgCpRrJmu4jARTte8bFyz/lJgIbJdu5sLgHBvf0fin2t/+auB7I/hhfosNWJy430XSRdbTg2vffxT6793ETQbo9t4c7kyWAw8F80OeciR3LV7p8+N/r8Oyc8inbZwIU8mCBdGdwq2AboCwQ8gWV05qOPLP+X0hH4q9yhhnxNkGUjQKqRTI59esWbU0NoqOm2mltS7P6aARdiv2L5t/72HRSjnoKYKwrcNmB7gppYuN00qqUf3rkn8ys6Qh7LvlB7TILCdgKkDJiNvbFq93TUjWMBXK9JitVzM+C9FGD5mqeeGKmXxdYBt3uuWnqQrIhmcwAumkeBfnDnnqVH6Zj0Z9n9ZpzqjTktQIyxYjuD0cPrP5+LsDx4mjiSUo2a5SsB3GOh1n94TVLmAVyc0iIrdwMX3bqtG2FplhXZ2JmNuz3r11ygOxbueD8GCdbwy7ZwC66zcHJVttxBty6L34sA9W5hqqrvLMC1dA+8HIGCn8XbwB/L7q/1oCMyk1QSY60o9rGAkxXufH7rgAuKdR6J44enYHWM4xWdK7EYuIG9buUFqrKp/Ky1TqQAWNWC13d04TRucwIlF7VT46OsHJM5lJ0q4yjg3XNz1CUpEpenukh+7ODqL821m8Dp9gMeJ3DxVb/QnnMeaOHuKzh6XqVtexumZafMOfjHm29L375yY3szQ3ynWNS+dPD53OuVd4xd/b8Ve6jvgx0pWQ4sqygBZY++/OPpn2cvUDf4udASwEd5wfiUcuTsOXR7pLrBG1/amyi00bh7iyxoXCZwjXgizRYCr142larJSFKV0Y5118j/dvPHMxGeepihReOZkTeK96++ocNMz4Ycpwrj6t2/3DtTMXQu7Bwxy5uKCv3ELXt6MqlUHiF0Iexa2y88FR9VyQrEWRdmaOLkpnurznvwmX7A5yUp/hbuBZ5KpSAhyeiBjZuTX7zuw0vCBjSfz4WVb9//3axqGNwNvZXAB07sVRgu9gKgbntVxWo48J1nn4+NVEr9iDOP5SgSeffwwJ2N6dm5S4oDPCnJiEsy6iYS2n3dDYkvbNi2UMD57/38+5NUV5kNvcxkDlCKZOXNLHw7f0GaunhxOS1rGY6wJ+EWBlxMEjGgHwBcaTbL8SRENhI5eubgTYM1uzA7nx/wFIiFUlh33OBYicXx7ms3xx96301NcuTzsW3rHAqUf+zAD6byOmY5VuCVqqULaYli5X7AhzjHz5z6zjKUUJYxA/msITJgVQ+UlK2//rZM5XQ/R9gvAVp1PpGmaKtOH962zYzgLxu4sPBERxp1KnF817oNiUcGbgyukp0/bxP4H7y4b6aMwcgLKy8K6DovzwO4yPlvOPdUDyHGCsSaLCBUBsz8gW9/4QVpIjNxDTb84i5bWazwilO19Mkb/uiMyMPMH7i5YMoomZbRkhjDaXkJ/tg16+KPrLeAf/fc65Xj+Xe5hDEiCHke011rrpcHOpfWasS/f+ENejz/LgPZ9VRSDQzO+eeuukG0JRSAD770TK6CuZEvzLI8xaxi5OcMfPPw0zM6La/ktZcBmm+VBQG/7tgPlgDIIsPqc3hjWcS52jW15PSBHTv0ywJuWrcko1gsjpfGEbl19UD8y9d+0Hx9JEcpLwLllHqzguJWlibTyD3MHC3BDPXmcOxR9FbbCuD3HNw3W6EVY1LX2KyuMk3DrMyqPn3I0/Prj+zpeZ1O4Icn/4eE14k7dxcEXFxuy9G9KxmG5d5Le63bMKiR6Vx6+sDaHWaFbUuApxOYtCud+NbVa2vAT85MGCNawXTdMBIT6wziA50Zkpad7OGxXJaPa4W6bBwFqgH8dqYPp2VZvJ/J7zny3GxFV43JwqwFXMKsXNDNhTPsqEWao07yyvflrIZ9yWANF9K05di+Po7kLic7YydbrSoBhcO5w9sGa7mZ1gLP9Ma//P6bTQv/1/PH1BOFUW7KiawA0XXzp6FTdP/qLdK16Z6azPz7W0eNs+ok0ygAkWQuSIvtJiJJfNeaTdJAypKU+w79Vz5HVaOsCR2fYdOGIVI1bO7Am204ez9rZuFinKK49dljAxs4gjZnAi3tRpyPHNvyh5fcxtAy4CmeJLes36B8ZcEWzVYBfzH4YagrpbB2bYIt3O5ILKBTXdMbOdKr3ooMksSyrw3c+Xb9xVoGXEjKTT3LY1+9Ybu5aJYo5TVddhsNpUjosvtGcpTCDC3V8vCyLPxr6+iVk+biKiz8/iPPzU6XCsyycJVNGwVeKei8PofvR9SRlADgLilxL3kGkydObhoMjTRF8DOsVjZipkuIQ+H1zXe96ZdLXzDg3zh5qPyWkWOMYiSKBwxKkRJTgAFG9/b2K1s6e2teypMXjtD/y2eZUZUTXZY4qNYe9q61W+XrOzOSreGleuCGzu0wv5mONwXuU6xk20hU4OLaAyf2tskUX7VkS/eZA2iH7zdYtBT4B3ozytfe97tm4DNBS+ySpjHk9lLMUciwQUkRd/4kS0v8YrHIZRksy3Zt8vWlOklSlk0LF4tm64E3ltnV7UtGsnB7ssVC2myXqKXAt3RnlK9vtYC3+vAAF8FPoSopl2PhATWPllnUtsnmBDxs3C0Gnla+vnXnggGveSmBwINfNTq4c5e5xfbYqEvDm0iJ7XEYDBYhcMCkPd2J+9vSyjdvWnjgRV1j+bzGcpLKRHjvaPgcgIdZd1XWDLJYgEMKRFgvIs30FQAu6gMfOPKT2RzRjKII7XWN5agN3PFqgh5py8InpcdE4NPUsi1BsdeR9xS4ezB2HuWKAj/xk9lSqchmtLIhgFOxXWda+FyBe4MbbzDubAKL8S4u4CKXknYsfH2yXf7nD9+xYPnw+1/5UUHVNSMIuFkhEHC8/IkHe0wLHxahvbcixVN5VVfYaWgwcXJbuB8etljan89p0Wyw8CpwK3mVJOk4kf5p2x2dS5NWsNLK4+jMhPE3bx0q5nRHUmwLj7IDYQIvCUnxBj4e9D716osKuNjp6Uk72cKkkiBrEt3yHX3rYjLCIo2CMIjUrAwi66zrlgUKH3xzeilKgiyyinCqNCGyirX5Eb9JEnChoww4n+Uq++n429pUKW+IXIq5aLo0fL7AfYVlMVu42PFJSp1oSZzhdHoJTsYSpB2w1NGmEFniJEaSGLBhklfMxJWOzIy3LMO6VBe6b+UA+fu3XjWmNLUWymtV8AZnXOTDxU8dY6NSKbE8BaNkFNi0Vjaojq3Q3tD5fIB7M9Ze3XaeTBkMjS4eSbGAOzs+3XEgCSVBYnKMtMsKQVjCiThCSDdwLWNoArc2GnpiMTRetL4PwMwSVg+NakCqwHXGuMoMljMoE/pd0jVWKGhs1nQJrQ1lE3hIvdvLt3klxaviQd80tMiAi0IU9yZEexyRNimNOxUgmEg4QSRs7fhgxJD4KSSluqsTA5CotQEiDpE5wa4cisFlrsuM67zCixWDM0NnJYMyW07Uos4ryvyAu0N38+I+2m0trBQWkYZbxT+iHoWnrV17RYnjdkXBkqTglGRgLMlYRhgJ6OI9E1kTwGNgYAt0rArfqcqxElZCj1RVBZ3LnMqM00qZU2ZwAVtIib2JjA2Zm3v2c7Rwy7qDZMQ2ARk4MmhPNv/mgR3Rvw8lzFG4DC/FAi6qsey6lFiM4TjuQLJi4A7chhimSMEYyZggoeTmMLEFXRzMtHjnwNySFRWsKaCmf10BAVtjBhewxU9RJiFAm3IS8bAl5XHbSwl5jZBTg/Z0db9pb41FvExoMxt4YH14UA9W2ZtVY2gGQULPUymIGQwzIqE4kVAikQBGNKRUYTMsIfGqBTPrDa0XrMS/jV+nUzH/hpnCK1AGEdiIv6hM59hQTNg16w4dotXg5dseXPpqaZL8hQm82Yu4FCQdymoMzp3cNNjy76q1gQe+AdEcuPP6iZAWAV9EnpxoKAlJENWwTJWQWNCSyWStcDNGnJdqjWqwQmIyF79romjTNQvlqmRgRVg1mKDFPUUr/7HuXkz+yZ0PLXs6exq+kT0SALxavGPIkxvO0pF9gwvzVdg2cOsdn7PHp/e8+KNINdKews5aUaeMxOs/TtlyChLErp61JsAEYMqK41ZwjQq/kbt/io9LZQCsON7LXCC7DeWPr9oce+K6W5b86fCL8GJp1HeRFFVSFOjwiU2DUxEfmnk1q2ko53w9Bej4xPP7Ro+Mnwv9ovPmlbT2vYhFta5m3JXQi4t3M5NJKEEJxBNhWa71NpC9Dy/CdRSTOcfVnzPUfGKiLJSivy7Sjv731k/1jFGdDA5Xa8PrvBJJIllcyr5rvwI4L5IRT3IDF8/UwLSm8a++9LOpfReONi3pbQDuMDZ/q31eqyN3Km3tP5m5j6QzA0zTEFYULn6638FyxmK1reVMQnzvGztXkb++/tbOVakl8uD5/XC+5H2ThEh4lpRiFw9v+/3wOouIQMOaebwEzrkYkXgTOT5cmKqcmZnRJqaLRnV9C+vL//OYeIu5/l1PVyleDECv+9xTqFf9j65hJCkKr2/rd9GueAL3JTrlq9u6YiWg8PjoIThUyppSYhAwMFMme9rSE632QKIAasiucc5F4sl+114MNzADF+UC71WbUVqC/blheDJ7HPJMrwBIeWIk83ded0fucr5Z83LH0xRm9YsOFg3wfQDov8f3x0fYZAJUSSrrREK6JiGZSFQHwiQwFGroZUwoJxLlpTJVtP6CXbl6ubBacf7/A7kxJfsyNujOAAAAAElFTkSuQmCC"},11845:function(t){t.exports=function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")},t.exports.__esModule=!0,t.exports.default=t.exports},78613:function(t){t.exports=function(t,e){return e.get?e.get.call(t):e.value},t.exports.__esModule=!0,t.exports.default=t.exports},61080:function(t){t.exports=function(t,e,n){if(e.set)e.set.call(t,n);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=n}},t.exports.__esModule=!0,t.exports.default=t.exports},39365:function(t){t.exports=function(t,e,n){if(!e.has(t))throw new TypeError("attempted to "+n+" private field on non-instance");return e.get(t)},t.exports.__esModule=!0,t.exports.default=t.exports},24270:function(t,e,n){var r=n(78613),i=n(39365);t.exports=function(t,e){var n=i(t,e,"get");return r(t,n)},t.exports.__esModule=!0,t.exports.default=t.exports},31573:function(t,e,n){var r=n(11845);t.exports=function(t,e,n){r(t,e),e.set(t,n)},t.exports.__esModule=!0,t.exports.default=t.exports},38689:function(t,e,n){var r=n(61080),i=n(39365);t.exports=function(t,e,n){var o=i(t,e,"set");return r(t,o,n),n},t.exports.__esModule=!0,t.exports.default=t.exports},68995:function(t){t.exports=function(t,e,n){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return n},t.exports.__esModule=!0,t.exports.default=t.exports},7134:function(t,e,n){var r=n(11845);t.exports=function(t,e){r(t,e),e.add(t)},t.exports.__esModule=!0,t.exports.default=t.exports},22214:function(t,e,n){"use strict";n.d(e,{Z:function(){return a}});var r=n(58289),i=n(75538),o=n(85458);function a(t,e,n){return e=(0,r.Z)(e),(0,o.Z)(t,(0,i.Z)()?Reflect.construct(e,n||[],(0,r.Z)(t).constructor):e.apply(t,n))}},75354:function(t,e){"use strict";var n={value:function(){}};function r(){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 i(r)}function i(t){this._=t}function o(t,e){return t.trim().split(/^|\s+/).map((function(t){var n="",r=t.indexOf(".");if(r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}}))}function a(t,e){for(var n,r=0,i=t.length;r<i;++r)if((n=t[r]).name===e)return n.value}function s(t,e,r){for(var i=0,o=t.length;i<o;++i)if(t[i].name===e){t[i]=n,t=t.slice(0,i).concat(t.slice(i+1));break}return null!=r&&t.push({name:e,value:r}),t}i.prototype=r.prototype={constructor:i,on:function(t,e){var n,r=this._,i=o(t+"",r),l=-1,c=i.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++l<c;)if(n=(t=i[l]).type)r[n]=s(r[n],t.name,e);else if(null==e)for(n in r)r[n]=s(r[n],t.name,null);return this}for(;++l<c;)if((n=(t=i[l]).type)&&(n=a(r[n],t.name)))return n},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new i(t)},call:function(t,e){if((n=arguments.length-2)>0)for(var n,r,i=new Array(n),o=0;o<n;++o)i[o]=arguments[o+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=0,n=(r=this._[t]).length;o<n;++o)r[o].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,o=r.length;i<o;++i)r[i].value.apply(e,n)}},e.Z=r},12713:function(t,e,n){"use strict";function r(t){const e=+this._x.call(null,t),n=+this._y.call(null,t),r=+this._z.call(null,t);return i(this.cover(e,n,r),e,n,r,t)}function i(t,e,n,r,i){if(isNaN(e)||isNaN(n)||isNaN(r))return t;var o,a,s,l,c,u,h,d,f,p,g,v,m=t._root,y={data:i},b=t._x0,x=t._y0,E=t._z0,w=t._x1,k=t._y1,M=t._z1;if(!m)return t._root=y,t;for(;m.length;)if((d=e>=(a=(b+w)/2))?b=a:w=a,(f=n>=(s=(x+k)/2))?x=s:k=s,(p=r>=(l=(E+M)/2))?E=l:M=l,o=m,!(m=m[g=p<<2|f<<1|d]))return o[g]=y,t;if(c=+t._x.call(null,m.data),u=+t._y.call(null,m.data),h=+t._z.call(null,m.data),e===c&&n===u&&r===h)return y.next=m,o?o[g]=y:t._root=y,t;do{o=o?o[g]=new Array(8):t._root=new Array(8),(d=e>=(a=(b+w)/2))?b=a:w=a,(f=n>=(s=(x+k)/2))?x=s:k=s,(p=r>=(l=(E+M)/2))?E=l:M=l}while((g=p<<2|f<<1|d)==(v=(h>=l)<<2|(u>=s)<<1|c>=a));return o[v]=m,o[g]=y,t}function o(t){Array.isArray(t)||(t=Array.from(t));const e=t.length,n=new Float64Array(e),r=new Float64Array(e),o=new Float64Array(e);let a=1/0,s=1/0,l=1/0,c=-1/0,u=-1/0,h=-1/0;for(let i,d,f,p,g=0;g<e;++g)isNaN(d=+this._x.call(null,i=t[g]))||isNaN(f=+this._y.call(null,i))||isNaN(p=+this._z.call(null,i))||(n[g]=d,r[g]=f,o[g]=p,d<a&&(a=d),d>c&&(c=d),f<s&&(s=f),f>u&&(u=f),p<l&&(l=p),p>h&&(h=p));if(a>c||s>u||l>h)return this;this.cover(a,s,l).cover(c,u,h);for(let a=0;a<e;++a)i(this,n[a],r[a],o[a],t[a]);return this}n.d(e,{H:function(){return o},Z:function(){return r}})},17646:function(t,e,n){"use strict";function r(t,e,n){if(isNaN(t=+t)||isNaN(e=+e)||isNaN(n=+n))return this;var r=this._x0,i=this._y0,o=this._z0,a=this._x1,s=this._y1,l=this._z1;if(isNaN(r))a=(r=Math.floor(t))+1,s=(i=Math.floor(e))+1,l=(o=Math.floor(n))+1;else{for(var c,u,h=a-r||1,d=this._root;r>t||t>=a||i>e||e>=s||o>n||n>=l;)switch(u=(n<o)<<2|(e<i)<<1|t<r,(c=new Array(8))[u]=d,d=c,h*=2,u){case 0:a=r+h,s=i+h,l=o+h;break;case 1:r=a-h,s=i+h,l=o+h;break;case 2:a=r+h,i=s-h,l=o+h;break;case 3:r=a-h,i=s-h,l=o+h;break;case 4:a=r+h,s=i+h,o=l-h;break;case 5:r=a-h,s=i+h,o=l-h;break;case 6:a=r+h,i=s-h,o=l-h;break;case 7:r=a-h,i=s-h,o=l-h}this._root&&this._root.length&&(this._root=d)}return this._x0=r,this._y0=i,this._z0=o,this._x1=a,this._y1=s,this._z1=l,this}n.d(e,{Z:function(){return r}})},39894:function(t,e,n){"use strict";function r(){var t=[];return this.visit((function(e){if(!e.length)do{t.push(e.data)}while(e=e.next)})),t}n.d(e,{Z:function(){return r}})},56033:function(t,e,n){"use strict";function r(t){return arguments.length?this.cover(+t[0][0],+t[0][1],+t[0][2]).cover(+t[1][0],+t[1][1],+t[1][2]):isNaN(this._x0)?void 0:[[this._x0,this._y0,this._z0],[this._x1,this._y1,this._z1]]}n.d(e,{Z:function(){return r}})},77480:function(t,e,n){"use strict";n.d(e,{Z:function(){return i}});var r=n(26805);function i(t,e,n,i){var o,a,s,l,c,u,h,d,f,p=this._x0,g=this._y0,v=this._z0,m=this._x1,y=this._y1,b=this._z1,x=[],E=this._root;for(E&&x.push(new r.Z(E,p,g,v,m,y,b)),null==i?i=1/0:(p=t-i,g=e-i,v=n-i,m=t+i,y=e+i,b=n+i,i*=i);d=x.pop();)if(!(!(E=d.node)||(a=d.x0)>m||(s=d.y0)>y||(l=d.z0)>b||(c=d.x1)<p||(u=d.y1)<g||(h=d.z1)<v))if(E.length){var w=(a+c)/2,k=(s+u)/2,M=(l+h)/2;x.push(new r.Z(E[7],w,k,M,c,u,h),new r.Z(E[6],a,k,M,w,u,h),new r.Z(E[5],w,s,M,c,k,h),new r.Z(E[4],a,s,M,w,k,h),new r.Z(E[3],w,k,l,c,u,M),new r.Z(E[2],a,k,l,w,u,M),new r.Z(E[1],w,s,l,c,k,M),new r.Z(E[0],a,s,l,w,k,M)),(f=(n>=M)<<2|(e>=k)<<1|t>=w)&&(d=x[x.length-1],x[x.length-1]=x[x.length-1-f],x[x.length-1-f]=d)}else{var S=t-+this._x.call(null,E.data),A=e-+this._y.call(null,E.data),N=n-+this._z.call(null,E.data),C=S*S+A*A+N*N;if(C<i){var O=Math.sqrt(i=C);p=t-O,g=e-O,v=n-O,m=t+O,y=e+O,b=n+O,o=E.data}}return o}},72096:function(t,e,n){"use strict";n.d(e,{r:function(){return i}});const r=(t,e,n,r,i,o)=>Math.sqrt((t-r)**2+(e-i)**2+(n-o)**2);function i(t,e,n,i){const o=[],a=t-i,s=e-i,l=n-i,c=t+i,u=e+i,h=n+i;return this.visit(((d,f,p,g,v,m,y)=>{if(!d.length)do{const a=d.data;r(t,e,n,this._x(a),this._y(a),this._z(a))<=i&&o.push(a)}while(d=d.next);return f>c||p>u||g>h||v<a||m<s||y<l})),o}},26805:function(t,e,n){"use strict";function r(t,e,n,r,i,o,a){this.node=t,this.x0=e,this.y0=n,this.z0=r,this.x1=i,this.y1=o,this.z1=a}n.d(e,{Z:function(){return r}})},7695:function(t,e,n){"use strict";n.d(e,{Z:function(){return m}});var r=n(12713),i=n(17646),o=n(39894),a=n(56033),s=n(77480),l=n(72096),c=n(36989),u=n(10325),h=n(15902),d=n(12027),f=n(66612),p=n(14763),g=n(94009),v=n(68889);function m(t,e,n,r){var i=new y(null==e?p.P:e,null==n?g.q:n,null==r?v.i:r,NaN,NaN,NaN,NaN,NaN,NaN);return null==t?i:i.addAll(t)}function y(t,e,n,r,i,o,a,s,l){this._x=t,this._y=e,this._z=n,this._x0=r,this._y0=i,this._z0=o,this._x1=a,this._y1=s,this._z1=l,this._root=void 0}function b(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}var x=m.prototype=y.prototype;x.copy=function(){var t,e,n=new y(this._x,this._y,this._z,this._x0,this._y0,this._z0,this._x1,this._y1,this._z1),r=this._root;if(!r)return n;if(!r.length)return n._root=b(r),n;for(t=[{source:r,target:n._root=new Array(8)}];r=t.pop();)for(var i=0;i<8;++i)(e=r.source[i])&&(e.length?t.push({source:e,target:r.target[i]=new Array(8)}):r.target[i]=b(e));return n},x.add=r.Z,x.addAll=r.H,x.cover=i.Z,x.data=o.Z,x.extent=a.Z,x.find=s.Z,x.findAllWithinRadius=l.r,x.remove=c.Z,x.removeAll=c.x,x.root=u.Z,x.size=h.Z,x.visit=d.Z,x.visitAfter=f.Z,x.x=p.Z,x.y=g.Z,x.z=v.Z},36989:function(t,e,n){"use strict";function r(t){if(isNaN(o=+this._x.call(null,t))||isNaN(a=+this._y.call(null,t))||isNaN(s=+this._z.call(null,t)))return this;var e,n,r,i,o,a,s,l,c,u,h,d,f,p,g,v=this._root,m=this._x0,y=this._y0,b=this._z0,x=this._x1,E=this._y1,w=this._z1;if(!v)return this;if(v.length)for(;;){if((h=o>=(l=(m+x)/2))?m=l:x=l,(d=a>=(c=(y+E)/2))?y=c:E=c,(f=s>=(u=(b+w)/2))?b=u:w=u,e=v,!(v=v[p=f<<2|d<<1|h]))return this;if(!v.length)break;(e[p+1&7]||e[p+2&7]||e[p+3&7]||e[p+4&7]||e[p+5&7]||e[p+6&7]||e[p+7&7])&&(n=e,g=p)}for(;v.data!==t;)if(r=v,!(v=v.next))return this;return(i=v.next)&&delete v.next,r?(i?r.next=i:delete r.next,this):e?(i?e[p]=i:delete e[p],(v=e[0]||e[1]||e[2]||e[3]||e[4]||e[5]||e[6]||e[7])&&v===(e[7]||e[6]||e[5]||e[4]||e[3]||e[2]||e[1]||e[0])&&!v.length&&(n?n[g]=v:this._root=v),this):(this._root=i,this)}function i(t){for(var e=0,n=t.length;e<n;++e)this.remove(t[e]);return this}n.d(e,{Z:function(){return r},x:function(){return i}})},10325:function(t,e,n){"use strict";function r(){return this._root}n.d(e,{Z:function(){return r}})},15902:function(t,e,n){"use strict";function r(){var t=0;return this.visit((function(e){if(!e.length)do{++t}while(e=e.next)})),t}n.d(e,{Z:function(){return r}})},12027:function(t,e,n){"use strict";n.d(e,{Z:function(){return i}});var r=n(26805);function i(t){var e,n,i,o,a,s,l,c,u=[],h=this._root;for(h&&u.push(new r.Z(h,this._x0,this._y0,this._z0,this._x1,this._y1,this._z1));e=u.pop();)if(!t(h=e.node,i=e.x0,o=e.y0,a=e.z0,s=e.x1,l=e.y1,c=e.z1)&&h.length){var d=(i+s)/2,f=(o+l)/2,p=(a+c)/2;(n=h[7])&&u.push(new r.Z(n,d,f,p,s,l,c)),(n=h[6])&&u.push(new r.Z(n,i,f,p,d,l,c)),(n=h[5])&&u.push(new r.Z(n,d,o,p,s,f,c)),(n=h[4])&&u.push(new r.Z(n,i,o,p,d,f,c)),(n=h[3])&&u.push(new r.Z(n,d,f,a,s,l,p)),(n=h[2])&&u.push(new r.Z(n,i,f,a,d,l,p)),(n=h[1])&&u.push(new r.Z(n,d,o,a,s,f,p)),(n=h[0])&&u.push(new r.Z(n,i,o,a,d,f,p))}return this}},66612:function(t,e,n){"use strict";n.d(e,{Z:function(){return i}});var r=n(26805);function i(t){var e,n=[],i=[];for(this._root&&n.push(new r.Z(this._root,this._x0,this._y0,this._z0,this._x1,this._y1,this._z1));e=n.pop();){var o=e.node;if(o.length){var a,s=e.x0,l=e.y0,c=e.z0,u=e.x1,h=e.y1,d=e.z1,f=(s+u)/2,p=(l+h)/2,g=(c+d)/2;(a=o[0])&&n.push(new r.Z(a,s,l,c,f,p,g)),(a=o[1])&&n.push(new r.Z(a,f,l,c,u,p,g)),(a=o[2])&&n.push(new r.Z(a,s,p,c,f,h,g)),(a=o[3])&&n.push(new r.Z(a,f,p,c,u,h,g)),(a=o[4])&&n.push(new r.Z(a,s,l,g,f,p,d)),(a=o[5])&&n.push(new r.Z(a,f,l,g,u,p,d)),(a=o[6])&&n.push(new r.Z(a,s,p,g,f,h,d)),(a=o[7])&&n.push(new r.Z(a,f,p,g,u,h,d))}i.push(e)}for(;e=i.pop();)t(e.node,e.x0,e.y0,e.z0,e.x1,e.y1,e.z1);return this}},14763:function(t,e,n){"use strict";function r(t){return t[0]}function i(t){return arguments.length?(this._x=t,this):this._x}n.d(e,{P:function(){return r},Z:function(){return i}})},94009:function(t,e,n){"use strict";function r(t){return t[1]}function i(t){return arguments.length?(this._y=t,this):this._y}n.d(e,{Z:function(){return i},q:function(){return r}})},68889:function(t,e,n){"use strict";function r(t){return t[2]}function i(t){return arguments.length?(this._z=t,this):this._z}n.d(e,{Z:function(){return i},i:function(){return r}})},60272:function(t,e,n){"use strict";function r(t){const e=+this._x.call(null,t),n=+this._y.call(null,t);return i(this.cover(e,n),e,n,t)}function i(t,e,n,r){if(isNaN(e)||isNaN(n))return t;var i,o,a,s,l,c,u,h,d,f=t._root,p={data:r},g=t._x0,v=t._y0,m=t._x1,y=t._y1;if(!f)return t._root=p,t;for(;f.length;)if((c=e>=(o=(g+m)/2))?g=o:m=o,(u=n>=(a=(v+y)/2))?v=a:y=a,i=f,!(f=f[h=u<<1|c]))return i[h]=p,t;if(s=+t._x.call(null,f.data),l=+t._y.call(null,f.data),e===s&&n===l)return p.next=f,i?i[h]=p:t._root=p,t;do{i=i?i[h]=new Array(4):t._root=new Array(4),(c=e>=(o=(g+m)/2))?g=o:m=o,(u=n>=(a=(v+y)/2))?v=a:y=a}while((h=u<<1|c)==(d=(l>=a)<<1|s>=o));return i[d]=f,i[h]=p,t}function o(t){var e,n,r,o,a=t.length,s=new Array(a),l=new Array(a),c=1/0,u=1/0,h=-1/0,d=-1/0;for(n=0;n<a;++n)isNaN(r=+this._x.call(null,e=t[n]))||isNaN(o=+this._y.call(null,e))||(s[n]=r,l[n]=o,r<c&&(c=r),r>h&&(h=r),o<u&&(u=o),o>d&&(d=o));if(c>h||u>d)return this;for(this.cover(c,u).cover(h,d),n=0;n<a;++n)i(this,s[n],l[n],t[n]);return this}n.d(e,{H:function(){return o},Z:function(){return r}})},51097:function(t,e,n){"use strict";function r(t,e){if(isNaN(t=+t)||isNaN(e=+e))return this;var n=this._x0,r=this._y0,i=this._x1,o=this._y1;if(isNaN(n))i=(n=Math.floor(t))+1,o=(r=Math.floor(e))+1;else{for(var a,s,l=i-n||1,c=this._root;n>t||t>=i||r>e||e>=o;)switch(s=(e<r)<<1|t<n,(a=new Array(4))[s]=c,c=a,l*=2,s){case 0:i=n+l,o=r+l;break;case 1:n=i-l,o=r+l;break;case 2:i=n+l,r=o-l;break;case 3:n=i-l,r=o-l}this._root&&this._root.length&&(this._root=c)}return this._x0=n,this._y0=r,this._x1=i,this._y1=o,this}n.d(e,{Z:function(){return r}})},58007:function(t,e,n){"use strict";function r(){var t=[];return this.visit((function(e){if(!e.length)do{t.push(e.data)}while(e=e.next)})),t}n.d(e,{Z:function(){return r}})},12070:function(t,e,n){"use strict";function r(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]]}n.d(e,{Z:function(){return r}})},47064:function(t,e,n){"use strict";n.d(e,{Z:function(){return i}});var r=n(44213);function i(t,e,n){var i,o,a,s,l,c,u,h=this._x0,d=this._y0,f=this._x1,p=this._y1,g=[],v=this._root;for(v&&g.push(new r.Z(v,h,d,f,p)),null==n?n=1/0:(h=t-n,d=e-n,f=t+n,p=e+n,n*=n);c=g.pop();)if(!(!(v=c.node)||(o=c.x0)>f||(a=c.y0)>p||(s=c.x1)<h||(l=c.y1)<d))if(v.length){var m=(o+s)/2,y=(a+l)/2;g.push(new r.Z(v[3],m,y,s,l),new r.Z(v[2],o,y,m,l),new r.Z(v[1],m,a,s,y),new r.Z(v[0],o,a,m,y)),(u=(e>=y)<<1|t>=m)&&(c=g[g.length-1],g[g.length-1]=g[g.length-1-u],g[g.length-1-u]=c)}else{var b=t-+this._x.call(null,v.data),x=e-+this._y.call(null,v.data),E=b*b+x*x;if(E<n){var w=Math.sqrt(n=E);h=t-w,d=e-w,f=t+w,p=e+w,i=v.data}}return i}},44213:function(t,e,n){"use strict";function r(t,e,n,r,i){this.node=t,this.x0=e,this.y0=n,this.x1=r,this.y1=i}n.d(e,{Z:function(){return r}})},14301:function(t,e,n){"use strict";n.d(e,{Z:function(){return g}});var r=n(60272),i=n(51097),o=n(58007),a=n(12070),s=n(47064),l=n(88866),c=n(10864),u=n(68984),h=n(3715),d=n(73607),f=n(56570),p=n(30992);function g(t,e,n){var r=new v(null==e?f.P:e,null==n?p.q:n,NaN,NaN,NaN,NaN);return null==t?r:r.addAll(t)}function v(t,e,n,r,i,o){this._x=t,this._y=e,this._x0=n,this._y0=r,this._x1=i,this._y1=o,this._root=void 0}function m(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}var y=g.prototype=v.prototype;y.copy=function(){var t,e,n=new v(this._x,this._y,this._x0,this._y0,this._x1,this._y1),r=this._root;if(!r)return n;if(!r.length)return n._root=m(r),n;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]=m(e));return n},y.add=r.Z,y.addAll=r.H,y.cover=i.Z,y.data=o.Z,y.extent=a.Z,y.find=s.Z,y.remove=l.Z,y.removeAll=l.x,y.root=c.Z,y.size=u.Z,y.visit=h.Z,y.visitAfter=d.Z,y.x=f.Z,y.y=p.Z},88866:function(t,e,n){"use strict";function r(t){if(isNaN(o=+this._x.call(null,t))||isNaN(a=+this._y.call(null,t)))return this;var e,n,r,i,o,a,s,l,c,u,h,d,f=this._root,p=this._x0,g=this._y0,v=this._x1,m=this._y1;if(!f)return this;if(f.length)for(;;){if((c=o>=(s=(p+v)/2))?p=s:v=s,(u=a>=(l=(g+m)/2))?g=l:m=l,e=f,!(f=f[h=u<<1|c]))return this;if(!f.length)break;(e[h+1&3]||e[h+2&3]||e[h+3&3])&&(n=e,d=h)}for(;f.data!==t;)if(r=f,!(f=f.next))return this;return(i=f.next)&&delete f.next,r?(i?r.next=i:delete r.next,this):e?(i?e[h]=i:delete e[h],(f=e[0]||e[1]||e[2]||e[3])&&f===(e[3]||e[2]||e[1]||e[0])&&!f.length&&(n?n[d]=f:this._root=f),this):(this._root=i,this)}function i(t){for(var e=0,n=t.length;e<n;++e)this.remove(t[e]);return this}n.d(e,{Z:function(){return r},x:function(){return i}})},10864:function(t,e,n){"use strict";function r(){return this._root}n.d(e,{Z:function(){return r}})},68984:function(t,e,n){"use strict";function r(){var t=0;return this.visit((function(e){if(!e.length)do{++t}while(e=e.next)})),t}n.d(e,{Z:function(){return r}})},3715:function(t,e,n){"use strict";n.d(e,{Z:function(){return i}});var r=n(44213);function i(t){var e,n,i,o,a,s,l=[],c=this._root;for(c&&l.push(new r.Z(c,this._x0,this._y0,this._x1,this._y1));e=l.pop();)if(!t(c=e.node,i=e.x0,o=e.y0,a=e.x1,s=e.y1)&&c.length){var u=(i+a)/2,h=(o+s)/2;(n=c[3])&&l.push(new r.Z(n,u,h,a,s)),(n=c[2])&&l.push(new r.Z(n,i,h,u,s)),(n=c[1])&&l.push(new r.Z(n,u,o,a,h)),(n=c[0])&&l.push(new r.Z(n,i,o,u,h))}return this}},73607:function(t,e,n){"use strict";n.d(e,{Z:function(){return i}});var r=n(44213);function i(t){var e,n=[],i=[];for(this._root&&n.push(new r.Z(this._root,this._x0,this._y0,this._x1,this._y1));e=n.pop();){var o=e.node;if(o.length){var a,s=e.x0,l=e.y0,c=e.x1,u=e.y1,h=(s+c)/2,d=(l+u)/2;(a=o[0])&&n.push(new r.Z(a,s,l,h,d)),(a=o[1])&&n.push(new r.Z(a,h,l,c,d)),(a=o[2])&&n.push(new r.Z(a,s,d,h,u)),(a=o[3])&&n.push(new r.Z(a,h,d,c,u))}i.push(e)}for(;e=i.pop();)t(e.node,e.x0,e.y0,e.x1,e.y1);return this}},56570:function(t,e,n){"use strict";function r(t){return t[0]}function i(t){return arguments.length?(this._x=t,this):this._x}n.d(e,{P:function(){return r},Z:function(){return i}})},30992:function(t,e,n){"use strict";function r(t){return t[1]}function i(t){return arguments.length?(this._y=t,this):this._y}n.d(e,{Z:function(){return i},q:function(){return r}})},83833:function(t,e,n){"use strict";n.d(e,{HT:function(){return v}});var r,i,o=0,a=0,s=0,l=0,c=0,u=0,h="object"==typeof performance&&performance.now?performance:Date,d="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function f(){return c||(d(p),c=h.now()+u)}function p(){c=0}function g(){this._call=this._time=this._next=null}function v(t,e,n){var r=new g;return r.restart(t,e,n),r}function m(){c=(l=h.now())+u,o=a=0;try{!function(){f(),++o;for(var t,e=r;e;)(t=c-e._time)>=0&&e._call.call(void 0,t),e=e._next;--o}()}finally{o=0,function(){var t,e,n=r,o=1/0;for(;n;)n._call?(o>n._time&&(o=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:r=e);i=t,b(o)}(),c=0}}function y(){var t=h.now(),e=t-l;e>1e3&&(u-=e,l=t)}function b(t){o||(a&&(a=clearTimeout(a)),t-c>24?(t<1/0&&(a=setTimeout(m,t-h.now()-u)),s&&(s=clearInterval(s))):(s||(l=h.now(),s=setInterval(y,1e3)),o=1,d(m)))}g.prototype=v.prototype={constructor:g,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?f():+n)+(null==e?0:+e),this._next||i===this||(i?i._next=this:r=this,i=this),this._call=t,this._time=n,b()},stop:function(){this._call&&(this._call=null,this._time=1/0,b())}}},80813:function(t,e,n){"use strict";n.d(e,{CR:function(){return u},Jh:function(){return l},Q_:function(){return f},XA:function(){return c},ZT:function(){return i},_T:function(){return a},ev:function(){return d},mG:function(){return s},pi:function(){return o},pr:function(){return h}});var r=function(t,e){return r=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])},r(t,e)};function i(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}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var o=function(){return o=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},o.apply(this,arguments)};function a(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}function s(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(t){o(t)}}function s(t){try{l(r.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}))}function l(t,e){var n,r,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(6===s[0]&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=e.call(t,o)}catch(t){s=[6,t],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}Object.create;function c(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 t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function u(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function h(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),i=0;for(e=0;e<n;e++)for(var o=arguments[e],a=0,s=o.length;a<s;a++,i++)r[i]=o[a];return r}function d(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}Object.create;function f(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))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(t):r?r.value:e.get(t)}"function"==typeof SuppressedError&&SuppressedError}}]); |