|
|
!(function(){var eF=Object.defineProperty,nF=Object.defineProperties;var rF=Object.getOwnPropertyDescriptors;var vw=Object.getOwnPropertySymbols;var iF=Object.prototype.hasOwnProperty,aF=Object.prototype.propertyIsEnumerable;var ls=Math.pow,Q0=(Y,Q,S)=>Q in Y?eF(Y,Q,{enumerable:!0,configurable:!0,writable:!0,value:S}):Y[Q]=S,Wo=(Y,Q)=>{for(var S in Q||(Q={}))iF.call(Q,S)&&Q0(Y,S,Q[S]);if(vw)for(var S of vw(Q))aF.call(Q,S)&&Q0(Y,S,Q[S]);return Y},q0=(Y,Q)=>nF(Y,rF(Q));var Cn=(Y,Q,S)=>Q0(Y,typeof Q!="symbol"?Q+"":Q,S);(self.webpackChunk=self.webpackChunk||[]).push([[6461],{10514:function(Y,Q,S){"use strict";S.d(Q,{kJ:function(){return vd},RN:function(){return FB}});var A={};S.r(A),S.d(A,{add:function(){return ww},adjoint:function(){return Kt},clone:function(){return gn},copy:function(){return me},create:function(){return oe},decompose:function(){return Md},determinant:function(){return pn},equals:function(){return Aw},exactEquals:function(){return Td},frob:function(){return Ew},fromQuat:function(){return Xo},fromQuat2:function(){return Sd},fromRotation:function(){return Qn},fromRotationTranslation:function(){return rc},fromRotationTranslationScale:function(){return Ad},fromRotationTranslationScaleOrigin:function(){return ds},fromScaling:function(){return De},fromTranslation:function(){return hr},fromValues:function(){return xe},fromXRotation:function(){return Cr},fromYRotation:function(){return Nr},fromZRotation:function(){return Nn},frustum:function(){return gw},getRotation:function(){return io},getScaling:function(){return _a},getTranslation:function(){return ro},identity:function(){return Et},invert:function(){return ee},lookAt:function(){return vg},mul:function(){return pg},multiply:function(){return Re},multiplyScalar:function(){return Sw},multiplyScalarAndAdd:function(){return Mw},ortho:function(){return dg},orthoNO:function(){return hg},orthoZO:function(){return fg},perspective:function(){return pw},perspectiveFromFieldOfView:function(){return yw},perspectiveNO:function(){return ug},perspectiveZO:function(){return mw},rotate:function(){return ir},rotateX:function(){return Hr},rotateY:function(){return _n},rotateZ:function(){return Si},scale:function(){return mn},set:function(){return rn},str:function(){return xw},sub:function(){return Tw},subtract:function(){return gg},targetTo:function(){return bw},translate:function(){return Je},transpose:function(){return Yt}});var W={};S.r(W),S.d(W,{circle:function(){return L3},diamond:function(){return _3},rect:function(){return I3},simple:function(){return F3},triangle:function(){return M1},triangleRect:function(){return B3},vee:function(){return D3}});var z=S(33885),C=S(67732),T=S(83652),N=S(94480),D=S(58289),R=S(75538),_=S(85458);function I(r,t,e){return t=(0,D.Z)(t),(0,_.Z)(r,(0,R.Z)()?Reflect.construct(t,e||[],(0,D.Z)(r).constructor):t.apply(r,e))}var L=S(42403),G=S(42978),K=S(37271),X=K,et=1e-6,tt=typeof Float32Array!="undefined"?Float32Array:Array,q=Math.random,it="zyx";function st(r){return r>=0?Math.round(r):r%.5===0?Math.floor(r):Math.round(r)}function ut(r){tt=r}var ht=Math.PI/180,mt=180/Math.PI;function St(r){return r*ht}function Mt(r){return r*mt}function pt(r,t){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:et;return Math.abs(r-t)<=e*Math.max(1,Math.abs(r),Math.abs(t))}function xt(){var r=new tt(3);return tt!=Float32Array&&(r[0]=0,r[1]=0,r[2]=0),r}function kt(r){var t=new tt(3);return t[0]=r[0],t[1]=r[1],t[2]=r[2],t}function Gt(r){var t=r[0],e=r[1],n=r[2];return Math.sqrt(t*t+e*e+n*n)}function jt(r,t,e){var n=new tt(3);return n[0]=r,n[1]=t,n[2]=e,n}function Ht(r,t){return r[0]=t[0],r[1]=t[1],r[2]=t[2],r}function fe(r,t,e,n){return r[0]=t,r[1]=e,r[2]=n,r}function we(r,t,e){return r[0]=t[0]+e[0],r[1]=t[1]+e[1],r[2]=t[2]+e[2],r}function Xe(r,t,e){return r[0]=t[0]-e[0],r[1]=t[1]-e[1],r[2]=t[2]-e[2],r}function Hn(r,t,e){return r[0]=t[0]*e[0],r[1]=t[1]*e[1],r[2]=t[2]*e[2],r}function Ei(r,t,e){return r[0]=t[0]/e[0],r[1]=t[1]/e[1],r[2]=t[2]/e[2],r}function Ra(r,t){return r[0]=Math.ceil(t[0]),r[1]=Math.ceil(t[1]),r[2]=Math.ceil(t[2]),r}function cs(r,t){return r[0]=Math.floor(t[0]),r[1]=Math.floor(t[1]),r[2]=Math.floor(t[2]),r}function Rt(r,t,e){return r[0]=Math.min(t[0],e[0]),r[1]=Math.min(t[1],e[1]),r[2]=Math.min(t[2],e[2]),r}function _t(r,t,e){return r[0]=Math.max(t[0],e[0]),r[1]=Math.max(t[1],e[1]),r[2]=Math.max(t[2],e[2]),r}function Bt(r,t){return r[0]=glMatrix.round(t[0]),r[1]=glMatrix.round(t[1]),r[2]=glMatrix.round(t[2]),r}function dt(r,t,e){return r[0]=t[0]*e,r[1]=t[1]*e,r[2]=t[2]*e,r}function wt(r,t,e,n){return r[0]=t[0]+e[0]*n,r[1]=t[1]+e[1]*n,r[2]=t[2]+e[2]*n,r}function Ot(r,t){var e=t[0]-r[0],n=t[1]-r[1],i=t[2]-r[2];return Math.sqrt(e*e+n*n+i*i)}function Zt(r,t){var e=t[0]-r[0],n=t[1]-r[1],i=t[2]-r[2];return e*e+n*n+i*i}function ve(r){var t=r[0],e=r[1],n=r[2];return t*t+e*e+n*n}function Be(r,t){return r[0]=-t[0],r[1]=-t[1],r[2]=-t[2],r}function ge(r,t){return r[0]=1/t[0],r[1]=1/t[1],r[2]=1/t[2],r}function ke(r,t){var e=t[0],n=t[1],i=t[2],a=e*e+n*n+i*i;return a>0&&(a=1/Math.sqrt(a)),r[0]=t[0]*a,r[1]=t[1]*a,r[2]=t[2]*a,r}function Ve(r,t){return r[0]*t[0]+r[1]*t[1]+r[2]*t[2]}function vn(r,t,e){var n=t[0],i=t[1],a=t[2],s=e[0],o=e[1],l=e[2];return r[0]=i*l-a*o,r[1]=a*s-n*l,r[2]=n*o-i*s,r}function Ce(r,t,e,n){var i=t[0],a=t[1],s=t[2];return r[0]=i+n*(e[0]-i),r[1]=a+n*(e[1]-a),r[2]=s+n*(e[2]-s),r}function Se(r,t,e,n){var i=Math.acos(Math.min(Math.max(Ve(t,e),-1),1)),a=Math.sin(i),s=Math.sin((1-n)*i)/a,o=Math.sin(n*i)/a;return r[0]=s*t[0]+o*e[0],r[1]=s*t[1]+o*e[1],r[2]=s*t[2]+o*e[2],r}function ye(r,t,e,n,i,a){var s=a*a,o=s*(2*a-3)+1,l=s*(a-2)+a,c=s*(a-1),u=s*(3-2*a);return r[0]=t[0]*o+e[0]*l+n[0]*c+i[0]*u,r[1]=t[1]*o+e[1]*l+n[1]*c+i[1]*u,r[2]=t[2]*o+e[2]*l+n[2]*c+i[2]*u,r}function Pe(r,t,e,n,i,a){var s=1-a,o=s*s,l=a*a,c=o*s,u=3*a*o,h=3*l*s,d=l*a;return r[0]=t[0]*c+e[0]*u+n[0]*h+i[0]*d,r[1]=t[1]*c+e[1]*u+n[1]*h+i[1]*d,r[2]=t[2]*c+e[2]*u+n[2]*h+i[2]*d,r}function mr(r,t){t=t===void 0?1:t;var e=glMatrix.RANDOM()*2*Math.PI,n=glMatrix.RANDOM()*2-1,i=Math.sqrt(1-n*n)*t;return r[0]=Math.cos(e)*i,r[1]=Math.sin(e)*i,r[2]=n*t,r}function Sn(r,t,e){var n=t[0],i=t[1],a=t[2],s=e[3]*n+e[7]*i+e[11]*a+e[15];return s=s||1,r[0]=(e[0]*n+e[4]*i+e[8]*a+e[12])/s,r[1]=(e[1]*n+e[5]*i+e[9]*a+e[13])/s,r[2]=(e[2]*n+e[6]*i+e[10]*a+e[14])/s,r}function ne(r,t,e){var n=t[0],i=t[1],a=t[2];return r[0]=n*e[0]+i*e[3]+a*e[6],r[1]=n*e[1]+i*e[4]+a*e[7],r[2]=n*e[2]+i*e[5]+a*e[8],r}function La(r,t,e){var n=e[0],i=e[1],a=e[2],s=e[3],o=t[0],l=t[1],c=t[2],u=i*c-a*l,h=a*o-n*c,d=n*l-i*o;return u=u+u,h=h+h,d=d+d,r[0]=o+s*u+i*d-a*h,r[1]=l+s*h+a*u-n*d,r[2]=c+s*d+n*h-i*u,r}function Br(r,t,e,n){var i=[],a=[];return i[0]=t[0]-e[0],i[1]=t[1]-e[1],i[2]=t[2]-e[2],a[0]=i[0],a[1]=i[1]*Math.cos(n)-i[2]*Math.sin(n),a[2]=i[1]*Math.sin(n)+i[2]*Math.cos(n),r[0]=a[0]+e[0],r[1]=a[1]+e[1],r[2]=a[2]+e[2],r}function Xn(r,t,e,n){var i=[],a=[];return i[0]=t[0]-e[0],i[1]=t[1]-e[1],i[2]=t[2]-e[2],a[0]=i[2]*Math.sin(n)+i[0]*Math.cos(n),a[1]=i[1],a[2]=i[2]*Math.cos(n)-i[0]*Math.sin(n),r[0]=a[0]+e[0],r[1]=a[1]+e[1],r[2]=a[2]+e[2],r}function Fr(r,t,e,n){var i=[],a=[];return i[0]=t[0]-e[0],i[1]=t[1]-e[1],i[2]=t[2]-e[2],a[0]=i[0]*Math.cos(n)-i[1]*Math.sin(n),a[1]=i[0]*Math.sin(n)+i[1]*Math.cos(n),a[2]=i[2],r[0]=a[0]+e[0],r[1]=a[1]+e[1],r[2]=a[2]+e[2],r}function us(r,t){var e=r[0],n=r[1],i=r[2],a=t[0],s=t[1],o=t[2],l=Math.sqrt((e*e+n*n+i*i)*(a*a+s*s+o*o)),c=l&&Ve(r,t)/l;return Math.acos(Math.min(Math.max(c,-1),1))}function $l(r){return r[0]=0,r[1]=0,r[2]=0,r}function Zo(r){return"vec3("+r[0]+", "+r[1]+", "+r[2]+")"}function pa(r,t){return r[0]===t[0]&&r[1]===t[1]&&r[2]===t[2]}function Ji(r,t){var e=r[0],n=r[1],i=r[2],a=t[0],s=t[1],o=t[2];return Math.abs(e-a)<=et*Math.max(1,Math.abs(e),Math.abs(a))&&Math.abs(n-s)<=et*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(i-o)<=et*Math.max(1,Math.abs(i),Math.abs(o))}var eo=Xe,hs=null,Vo=null,si=Ot,Di=null,Or=Gt,tg=null,Uo=function(){var r=xt();return function(t,e,n,i,a,s){var o,l;for(e||(e=3),n||(n=0),i?l=Math.min(i*e+n,t.length):l=t.length,o=n;o<l;o+=e)r[0]=t[o],r[1]=t[o+1],r[2]=t[o+2],a(r,r,s),t[o]=r[0],t[o+1]=r[1],t[o+2]=r[2];return t}}();function Kn(){var r=new tt(4);return tt!=Float32Array&&(r[0]=0,r[1]=0,r[2]=0,r[3]=0),r}function Yo(r){var t=new tt(4);return t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t}function wi(r,t,e,n){var i=new tt(4);return i[0]=r,i[1]=t,i[2]=e,i[3]=n,i}function xd(r,t){return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r}function tc(r,t,e,n,i){return r[0]=t,r[1]=e,r[2]=n,r[3]=i,r}function no(r,t,e){return r[0]=t[0]+e[0],r[1]=t[1]+e[1],r[2]=t[2]+e[2],r[3]=t[3]+e[3],r}function eg(r,t,e){return r[0]=t[0]-e[0],r[1]=t[1]-e[1],r[2]=t[2]-e[2],r[3]=t[3]-e[3],r}function ng(r,t,e){return r[0]=t[0]*e[0],r[1]=t[1]*e[1],r[2]=t[2]*e[2],r[3]=t[3]*e[3],r}function rg(r,t,e){return r[0]=t[0]/e[0],r[1]=t[1]/e[1],r[2]=t[2]/e[2],r[3]=t[3]/e[3],r}function ig(r,t){return r[0]=Math.ceil(t[0]),r[1]=Math.ceil(t[1]),r[2]=Math.ceil(t[2]),r[3]=Math.ceil(t[3]),r}function ag(r,t){return r[0]=Math.floor(t[0]),r[1]=Math.floor(t[1]),r[2]=Math.floor(t[2]),r[3]=Math.floor(t[3]),r}function sg(r,t,e){return r[0]=Math.min(t[0],e[0]),r[1]=Math.min(t[1],e[1]),r[2]=Math.min(t[2],e[2]),r[3]=Math.min(t[3],e[3]),r}function Ed(r,t,e){return r[0]=Math.max(t[0],e[0]),r[1]=Math.max(t[1],e[1]),r[2]=Math.max(t[2],e[2]),r[3]=Math.max(t[3],e[3]),r}function og(r,t){return r[0]=glMatrix.round(t[0]),r[1]=glMatrix.round(t[1]),r[2]=glMatrix.round(t[2]),r[3]=glMatrix.round(t[3]),r}function wd(r,t,e){return r[0]=t[0]*e,r[1]=t[1]*e,r[2]=t[2]*e,r[3]=t[3]*e,r}function lg(r,t,e,n){return r[0]=t[0]+e[0]*n,r[1]=t[1]+e[1]*n,r[2]=t[2]+e[2]*n,r[3]=t[3]+e[3]*n,r}function cg(r,t){var e=t[0]-r[0],n=t[1]-r[1],i=t[2]-r[2],a=t[3]-r[3];return Math.sqrt(e*e+n*n+i*i+a*a)}function Ho(r,t){var e=t[0]-r[0],n=t[1]-r[1],i=t[2]-r[2],a=t[3]-r[3];return e*e+n*n+i*i+a*a}function ec(r){var t=r[0],e=r[1],n=r[2],i=r[3];return Math.sqrt(t*t+e*e+n*n+i*i)}function nc(r){var t=r[0],e=r[1],n=r[2],i=r[3];return t*t+e*e+n*n+i*i}function H(r,t){return r[0]=-t[0],r[1]=-t[1],r[2]=-t[2],r[3]=-t[3],r}function x(r,t){return r[0]=1/t[0],r[1]=1/t[1],r[2]=1/t[2],r[3]=1/t[3],r}function w(r,t){var e=t[0],n=t[1],i=t[2],a=t[3],s=e*e+n*n+i*i+a*a;return s>0&&(s=1/Math.sqrt(s)),r[0]=e*s,r[1]=n*s,r[2]=i*s,r[3]=a*s,r}function m(r,t){return r[0]*t[0]+r[1]*t[1]+r[2]*t[2]+r[3]*t[3]}function M(r,t,e,n){var i=e[0]*n[1]-e[1]*n[0],a=e[0]*n[2]-e[2]*n[0],s=e[0]*n[3]-e[3]*n[0],o=e[1]*n[2]-e[2]*n[1],l=e[1]*n[3]-e[3]*n[1],c=e[2]*n[3]-e[3]*n[2],u=t[0],h=t[1],d=t[2],f=t[3];return r[0]=h*c-d*l+f*o,r[1]=-(u*c)+d*s-f*a,r[2]=u*l-h*s+f*i,r[3]=-(u*o)+h*a-d*i,r}function j(r,t,e,n){var i=t[0],a=t[1],s=t[2],o=t[3];return r[0]=i+n*(e[0]-i),r[1]=a+n*(e[1]-a),r[2]=s+n*(e[2]-s),r[3]=o+n*(e[3]-o),r}function rt(r,t){t=t===void 0?1:t;var e,n,i,a,s,o,l;l=glMatrix.RANDOM(),e=l*2-1,n=(4*glMatrix.RANDOM()-2)*Math.sqrt(l*-l+l),s=e*e+n*n,l=glMatrix.RANDOM(),i=l*2-1,a=(4*glMatrix.RANDOM()-2)*Math.sqrt(l*-l+l),o=i*i+a*a;var c=Math.sqrt((1-s)/o);return r[0]=t*e,r[1]=t*n,r[2]=t*i*c,r[3]=t*a*c,r}function nt(r,t,e){var n=t[0],i=t[1],a=t[2],s=t[3];return r[0]=e[0]*n+e[4]*i+e[8]*a+e[12]*s,r[1]=e[1]*n+e[5]*i+e[9]*a+e[13]*s,r[2]=e[2]*n+e[6]*i+e[10]*a+e[14]*s,r[3]=e[3]*n+e[7]*i+e[11]*a+e[15]*s,r}function ot(r,t,e){var n=e[0],i=e[1],a=e[2],s=e[3],o=t[0],l=t[1],c=t[2],u=i*c-a*l,h=a*o-n*c,d=n*l-i*o;return u=u+u,h=h+h,d=d+d,r[0]=o+s*u+i*d-a*h,r[1]=l+s*h+a*u-n*d,r[2]=c+s*d+n*h-i*u,r[3]=t[3],r}function lt(r){return r[0]=0,r[1]=0,r[2]=0,r[3]=0,r}function Tt(r){return"vec4("+r[0]+", "+r[1]+", "+r[2]+", "+r[3]+")"}function vt(r,t){return r[0]===t[0]&&r[1]===t[1]&&r[2]===t[2]&&r[3]===t[3]}function Ft(r,t){var e=r[0],n=r[1],i=r[2],a=r[3],s=t[0],o=t[1],l=t[2],c=t[3];return Math.abs(e-s)<=glMatrix.EPSILON*Math.max(1,Math.abs(e),Math.abs(s))&&Math.abs(n-o)<=glMatrix.EPSILON*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(i-l)<=glMatrix.EPSILON*Math.max(1,Math.abs(i),Math.abs(l))&&Math.abs(a-c)<=glMatrix.EPSILON*Math.max(1,Math.abs(a),Math.abs(c))}var qt=null,Lt=null,Wt=null,se=null,yt=null,Qt=null,de=null,Ae=function(){var r=Kn();return function(t,e,n,i,a,s){var o,l;for(e||(e=4),n||(n=0),i?l=Math.min(i*e+n,t.length):l=t.length,o=n;o<l;o+=e)r[0]=t[o],r[1]=t[o+1],r[2]=t[o+2],r[3]=t[o+3],a(r,r,s),t[o]=r[0],t[o+1]=r[1],t[o+2]=r[2],t[o+3]=r[3];return t}}();function oe(){var r=new tt(16);return tt!=Float32Array&&(r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[11]=0,r[12]=0,r[13]=0,r[14]=0),r[0]=1,r[5]=1,r[10]=1,r[15]=1,r}function gn(r){var t=new tt(16);return t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t[4]=r[4],t[5]=r[5],t[6]=r[6],t[7]=r[7],t[8]=r[8],t[9]=r[9],t[10]=r[10],t[11]=r[11],t[12]=r[12],t[13]=r[13],t[14]=r[14],t[15]=r[15],t}function me(r,t){return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r[4]=t[4],r[5]=t[5],r[6]=t[6],r[7]=t[7],r[8]=t[8],r[9]=t[9],r[10]=t[10],r[11]=t[11],r[12]=t[12],r[13]=t[13],r[14]=t[14],r[15]=t[15],r}function xe(r,t,e,n,i,a,s,o,l,c,u,h,d,f,v,g){var p=new tt(16);return p[0]=r,p[1]=t,p[2]=e,p[3]=n,p[4]=i,p[5]=a,p[6]=s,p[7]=o,p[8]=l,p[9]=c,p[10]=u,p[11]=h,p[12]=d,p[13]=f,p[14]=v,p[15]=g,p}function rn(r,t,e,n,i,a,s,o,l,c,u,h,d,f,v,g,p){return r[0]=t,r[1]=e,r[2]=n,r[3]=i,r[4]=a,r[5]=s,r[6]=o,r[7]=l,r[8]=c,r[9]=u,r[10]=h,r[11]=d,r[12]=f,r[13]=v,r[14]=g,r[15]=p,r}function Et(r){return r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=1,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}function Yt(r,t){if(r===t){var e=t[1],n=t[2],i=t[3],a=t[6],s=t[7],o=t[11];r[1]=t[4],r[2]=t[8],r[3]=t[12],r[4]=e,r[6]=t[9],r[7]=t[13],r[8]=n,r[9]=a,r[11]=t[14],r[12]=i,r[13]=s,r[14]=o}else r[0]=t[0],r[1]=t[4],r[2]=t[8],r[3]=t[12],r[4]=t[1],r[5]=t[5],r[6]=t[9],r[7]=t[13],r[8]=t[2],r[9]=t[6],r[10]=t[10],r[11]=t[14],r[12]=t[3],r[13]=t[7],r[14]=t[11],r[15]=t[15];return r}function ee(r,t){var e=t[0],n=t[1],i=t[2],a=t[3],s=t[4],o=t[5],l=t[6],c=t[7],u=t[8],h=t[9],d=t[10],f=t[11],v=t[12],g=t[13],p=t[14],y=t[15],b=e*o-n*s,E=e*l-i*s,O=e*c-a*s,k=n*l-i*o,P=n*c-a*o,F=i*c-a*l,B=u*g-h*v,V=u*p-d*v,U=u*y-f*v,J=h*p-d*g,$=h*y-f*g,at=d*y-f*p,ct=b*at-E*$+O*J+k*U-P*V+F*B;return ct?(ct=1/ct,r[0]=(o*at-l*$+c*J)*ct,r[1]=(i*$-n*at-a*J)*ct,r[2]=(g*F-p*P+y*k)*ct,r[3]=(d*P-h*F-f*k)*ct,r[4]=(l*U-s*at-c*V)*ct,r[5]=(e*at-i*U+a*V)*ct,r[6]=(p*O-v*F-y*E)*ct,r[7]=(u*F-d*O+f*E)*ct,r[8]=(s*$-o*U+c*B)*ct,r[9]=(n*U-e*$-a*B)*ct,r[10]=(v*P-g*O+y*b)*ct,r[11]=(h*O-u*P-f*b)*ct,r[12]=(o*V-s*J-l*B)*ct,r[13]=(e*J-n*V+i*B)*ct,r[14]=(g*E-v*k-p*b)*ct,r[15]=(u*k-h*E+d*b)*ct,r):null}function Kt(r,t){var e=t[0],n=t[1],i=t[2],a=t[3],s=t[4],o=t[5],l=t[6],c=t[7],u=t[8],h=t[9],d=t[10],f=t[11],v=t[12],g=t[13],p=t[14],y=t[15],b=e*o-n*s,E=e*l-i*s,O=e*c-a*s,k=n*l-i*o,P=n*c-a*o,F=i*c-a*l,B=u*g-h*v,V=u*p-d*v,U=u*y-f*v,J=h*p-d*g,$=h*y-f*g,at=d*y-f*p;return r[0]=o*at-l*$+c*J,r[1]=i*$-n*at-a*J,r[2]=g*F-p*P+y*k,r[3]=d*P-h*F-f*k,r[4]=l*U-s*at-c*V,r[5]=e*at-i*U+a*V,r[6]=p*O-v*F-y*E,r[7]=u*F-d*O+f*E,r[8]=s*$-o*U+c*B,r[9]=n*U-e*$-a*B,r[10]=v*P-g*O+y*b,r[11]=h*O-u*P-f*b,r[12]=o*V-s*J-l*B,r[13]=e*J-n*V+i*B,r[14]=g*E-v*k-p*b,r[15]=u*k-h*E+d*b,r}function pn(r){var t=r[0],e=r[1],n=r[2],i=r[3],a=r[4],s=r[5],o=r[6],l=r[7],c=r[8],u=r[9],h=r[10],d=r[11],f=r[12],v=r[13],g=r[14],p=r[15],y=t*s-e*a,b=t*o-n*a,E=e*o-n*s,O=c*v-u*f,k=c*g-h*f,P=u*g-h*v,F=t*P-e*k+n*O,B=a*P-s*k+o*O,V=c*E-u*b+h*y,U=f*E-v*b+g*y;return l*F-i*B+p*V-d*U}function Re(r,t,e){var n=t[0],i=t[1],a=t[2],s=t[3],o=t[4],l=t[5],c=t[6],u=t[7],h=t[8],d=t[9],f=t[10],v=t[11],g=t[12],p=t[13],y=t[14],b=t[15],E=e[0],O=e[1],k=e[2],P=e[3];return r[0]=E*n+O*o+k*h+P*g,r[1]=E*i+O*l+k*d+P*p,r[2]=E*a+O*c+k*f+P*y,r[3]=E*s+O*u+k*v+P*b,E=e[4],O=e[5],k=e[6],P=e[7],r[4]=E*n+O*o+k*h+P*g,r[5]=E*i+O*l+k*d+P*p,r[6]=E*a+O*c+k*f+P*y,r[7]=E*s+O*u+k*v+P*b,E=e[8],O=e[9],k=e[10],P=e[11],r[8]=E*n+O*o+k*h+P*g,r[9]=E*i+O*l+k*d+P*p,r[10]=E*a+O*c+k*f+P*y,r[11]=E*s+O*u+k*v+P*b,E=e[12],O=e[13],k=e[14],P=e[15],r[12]=E*n+O*o+k*h+P*g,r[13]=E*i+O*l+k*d+P*p,r[14]=E*a+O*c+k*f+P*y,r[15]=E*s+O*u+k*v+P*b,r}function Je(r,t,e){var n=e[0],i=e[1],a=e[2],s,o,l,c,u,h,d,f,v,g,p,y;return t===r?(r[12]=t[0]*n+t[4]*i+t[8]*a+t[12],r[13]=t[1]*n+t[5]*i+t[9]*a+t[13],r[14]=t[2]*n+t[6]*i+t[10]*a+t[14],r[15]=t[3]*n+t[7]*i+t[11]*a+t[15]):(s=t[0],o=t[1],l=t[2],c=t[3],u=t[4],h=t[5],d=t[6],f=t[7],v=t[8],g=t[9],p=t[10],y=t[11],r[0]=s,r[1]=o,r[2]=l,r[3]=c,r[4]=u,r[5]=h,r[6]=d,r[7]=f,r[8]=v,r[9]=g,r[10]=p,r[11]=y,r[12]=s*n+u*i+v*a+t[12],r[13]=o*n+h*i+g*a+t[13],r[14]=l*n+d*i+p*a+t[14],r[15]=c*n+f*i+y*a+t[15]),r}function mn(r,t,e){var n=e[0],i=e[1],a=e[2];return r[0]=t[0]*n,r[1]=t[1]*n,r[2]=t[2]*n,r[3]=t[3]*n,r[4]=t[4]*i,r[5]=t[5]*i,r[6]=t[6]*i,r[7]=t[7]*i,r[8]=t[8]*a,r[9]=t[9]*a,r[10]=t[10]*a,r[11]=t[11]*a,r[12]=t[12],r[13]=t[13],r[14]=t[14],r[15]=t[15],r}function ir(r,t,e,n){var i=n[0],a=n[1],s=n[2],o=Math.sqrt(i*i+a*a+s*s),l,c,u,h,d,f,v,g,p,y,b,E,O,k,P,F,B,V,U,J,$,at,ct,ft;return o<et?null:(o=1/o,i*=o,a*=o,s*=o,l=Math.sin(e),c=Math.cos(e),u=1-c,h=t[0],d=t[1],f=t[2],v=t[3],g=t[4],p=t[5],y=t[6],b=t[7],E=t[8],O=t[9],k=t[10],P=t[11],F=i*i*u+c,B=a*i*u+s*l,V=s*i*u-a*l,U=i*a*u-s*l,J=a*a*u+c,$=s*a*u+i*l,at=i*s*u+a*l,ct=a*s*u-i*l,ft=s*s*u+c,r[0]=h*F+g*B+E*V,r[1]=d*F+p*B+O*V,r[2]=f*F+y*B+k*V,r[3]=v*F+b*B+P*V,r[4]=h*U+g*J+E*$,r[5]=d*U+p*J+O*$,r[6]=f*U+y*J+k*$,r[7]=v*U+b*J+P*$,r[8]=h*at+g*ct+E*ft,r[9]=d*at+p*ct+O*ft,r[10]=f*at+y*ct+k*ft,r[11]=v*at+b*ct+P*ft,t!==r&&(r[12]=t[12],r[13]=t[13],r[14]=t[14],r[15]=t[15]),r)}function Hr(r,t,e){var n=Math.sin(e),i=Math.cos(e),a=t[4],s=t[5],o=t[6],l=t[7],c=t[8],u=t[9],h=t[10],d=t[11];return t!==r&&(r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r[12]=t[12],r[13]=t[13],r[14]=t[14],r[15]=t[15]),r[4]=a*i+c*n,r[5]=s*i+u*n,r[6]=o*i+h*n,r[7]=l*i+d*n,r[8]=c*i-a*n,r[9]=u*i-s*n,r[10]=h*i-o*n,r[11]=d*i-l*n,r}function _n(r,t,e){var n=Math.sin(e),i=Math.cos(e),a=t[0],s=t[1],o=t[2],l=t[3],c=t[8],u=t[9],h=t[10],d=t[11];return t!==r&&(r[4]=t[4],r[5]=t[5],r[6]=t[6],r[7]=t[7],r[12]=t[12],r[13]=t[13],r[14]=t[14],r[15]=t[15]),r[0]=a*i-c*n,r[1]=s*i-u*n,r[2]=o*i-h*n,r[3]=l*i-d*n,r[8]=a*n+c*i,r[9]=s*n+u*i,r[10]=o*n+h*i,r[11]=l*n+d*i,r}function Si(r,t,e){var n=Math.sin(e),i=Math.cos(e),a=t[0],s=t[1],o=t[2],l=t[3],c=t[4],u=t[5],h=t[6],d=t[7];return t!==r&&(r[8]=t[8],r[9]=t[9],r[10]=t[10],r[11]=t[11],r[12]=t[12],r[13]=t[13],r[14]=t[14],r[15]=t[15]),r[0]=a*i+c*n,r[1]=s*i+u*n,r[2]=o*i+h*n,r[3]=l*i+d*n,r[4]=c*i-a*n,r[5]=u*i-s*n,r[6]=h*i-o*n,r[7]=d*i-l*n,r}function hr(r,t){return r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=1,r[11]=0,r[12]=t[0],r[13]=t[1],r[14]=t[2],r[15]=1,r}function De(r,t){return r[0]=t[0],r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=t[1],r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=t[2],r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}function Qn(r,t,e){var n=e[0],i=e[1],a=e[2],s=Math.sqrt(n*n+i*i+a*a),o,l,c;return s<et?null:(s=1/s,n*=s,i*=s,a*=s,o=Math.sin(t),l=Math.cos(t),c=1-l,r[0]=n*n*c+l,r[1]=i*n*c+a*o,r[2]=a*n*c-i*o,r[3]=0,r[4]=n*i*c-a*o,r[5]=i*i*c+l,r[6]=a*i*c+n*o,r[7]=0,r[8]=n*a*c+i*o,r[9]=i*a*c-n*o,r[10]=a*a*c+l,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r)}function Cr(r,t){var e=Math.sin(t),n=Math.cos(t);return r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=n,r[6]=e,r[7]=0,r[8]=0,r[9]=-e,r[10]=n,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}function Nr(r,t){var e=Math.sin(t),n=Math.cos(t);return r[0]=n,r[1]=0,r[2]=-e,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=e,r[9]=0,r[10]=n,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}function Nn(r,t){var e=Math.sin(t),n=Math.cos(t);return r[0]=n,r[1]=e,r[2]=0,r[3]=0,r[4]=-e,r[5]=n,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=1,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}function rc(r,t,e){var n=t[0],i=t[1],a=t[2],s=t[3],o=n+n,l=i+i,c=a+a,u=n*o,h=n*l,d=n*c,f=i*l,v=i*c,g=a*c,p=s*o,y=s*l,b=s*c;return r[0]=1-(f+g),r[1]=h+b,r[2]=d-y,r[3]=0,r[4]=h-b,r[5]=1-(u+g),r[6]=v+p,r[7]=0,r[8]=d+y,r[9]=v-p,r[10]=1-(u+f),r[11]=0,r[12]=e[0],r[13]=e[1],r[14]=e[2],r[15]=1,r}function Sd(r,t){var e=new tt(3),n=-t[0],i=-t[1],a=-t[2],s=t[3],o=t[4],l=t[5],c=t[6],u=t[7],h=n*n+i*i+a*a+s*s;return h>0?(e[0]=(o*s+u*n+l*a-c*i)*2/h,e[1]=(l*s+u*i+c*n-o*a)*2/h,e[2]=(c*s+u*a+o*i-l*n)*2/h):(e[0]=(o*s+u*n+l*a-c*i)*2,e[1]=(l*s+u*i+c*n-o*a)*2,e[2]=(c*s+u*a+o*i-l*n)*2),rc(r,t,e),r}function ro(r,t){return r[0]=t[12],r[1]=t[13],r[2]=t[14],r}function _a(r,t){var e=t[0],n=t[1],i=t[2],a=t[4],s=t[5],o=t[6],l=t[8],c=t[9],u=t[10];return r[0]=Math.sqrt(e*e+n*n+i*i),r[1]=Math.sqrt(a*a+s*s+o*o),r[2]=Math.sqrt(l*l+c*c+u*u),r}function io(r,t){var e=new tt(3);_a(e,t);var n=1/e[0],i=1/e[1],a=1/e[2],s=t[0]*n,o=t[1]*i,l=t[2]*a,c=t[4]*n,u=t[5]*i,h=t[6]*a,d=t[8]*n,f=t[9]*i,v=t[10]*a,g=s+u+v,p=0;return g>0?(p=Math.sqrt(g+1)*2,r[3]=.25*p,r[0]=(h-f)/p,r[1]=(d-l)/p,r[2]=(o-c)/p):s>u&&s>v?(p=Math.sqrt(1+s-u-v)*2,r[3]=(h-f)/p,r[0]=.25*p,r[1]=(o+c)/p,r[2]=(d+l)/p):u>v?(p=Math.sqrt(1+u-s-v)*2,r[3]=(d-l)/p,r[0]=(o+c)/p,r[1]=.25*p,r[2]=(h+f)/p):(p=Math.sqrt(1+v-s-u)*2,r[3]=(o-c)/p,r[0]=(d+l)/p,r[1]=(h+f)/p,r[2]=.25*p),r}function Md(r,t,e,n){t[0]=n[12],t[1]=n[13],t[2]=n[14];var i=n[0],a=n[1],s=n[2],o=n[4],l=n[5],c=n[6],u=n[8],h=n[9],d=n[10];e[0]=Math.sqrt(i*i+a*a+s*s),e[1]=Math.sqrt(o*o+l*l+c*c),e[2]=Math.sqrt(u*u+h*h+d*d);var f=1/e[0],v=1/e[1],g=1/e[2],p=i*f,y=a*v,b=s*g,E=o*f,O=l*v,k=c*g,P=u*f,F=h*v,B=d*g,V=p+O+B,U=0;return V>0?(U=Math.sqrt(V+1)*2,r[3]=.25*U,r[0]=(k-F)/U,r[1]=(P-b)/U,r[2]=(y-E)/U):p>O&&p>B?(U=Math.sqrt(1+p-O-B)*2,r[3]=(k-F)/U,r[0]=.25*U,r[1]=(y+E)/U,r[2]=(P+b)/U):O>B?(U=Math.sqrt(1+O-p-B)*2,r[3]=(P-b)/U,r[0]=(y+E)/U,r[1]=.25*U,r[2]=(k+F)/U):(U=Math.sqrt(1+B-p-O)*2,r[3]=(y-E)/U,r[0]=(P+b)/U,r[1]=(k+F)/U,r[2]=.25*U),r}function Ad(r,t,e,n){var i=t[0],a=t[1],s=t[2],o=t[3],l=i+i,c=a+a,u=s+s,h=i*l,d=i*c,f=i*u,v=a*c,g=a*u,p=s*u,y=o*l,b=o*c,E=o*u,O=n[0],k=n[1],P=n[2];return r[0]=(1-(v+p))*O,r[1]=(d+E)*O,r[2]=(f-b)*O,r[3]=0,r[4]=(d-E)*k,r[5]=(1-(h+p))*k,r[6]=(g+y)*k,r[7]=0,r[8]=(f+b)*P,r[9]=(g-y)*P,r[10]=(1-(h+v))*P,r[11]=0,r[12]=e[0],r[13]=e[1],r[14]=e[2],r[15]=1,r}function ds(r,t,e,n,i){var a=t[0],s=t[1],o=t[2],l=t[3],c=a+a,u=s+s,h=o+o,d=a*c,f=a*u,v=a*h,g=s*u,p=s*h,y=o*h,b=l*c,E=l*u,O=l*h,k=n[0],P=n[1],F=n[2],B=i[0],V=i[1],U=i[2],J=(1-(g+y))*k,$=(f+O)*k,at=(v-E)*k,ct=(f-O)*P,ft=(1-(d+y))*P,Nt=(p+b)*P,Ct=(v+E)*F,gt=(p-b)*F,bt=(1-(d+g))*F;return r[0]=J,r[1]=$,r[2]=at,r[3]=0,r[4]=ct,r[5]=ft,r[6]=Nt,r[7]=0,r[8]=Ct,r[9]=gt,r[10]=bt,r[11]=0,r[12]=e[0]+B-(J*B+ct*V+Ct*U),r[13]=e[1]+V-($*B+ft*V+gt*U),r[14]=e[2]+U-(at*B+Nt*V+bt*U),r[15]=1,r}function Xo(r,t){var e=t[0],n=t[1],i=t[2],a=t[3],s=e+e,o=n+n,l=i+i,c=e*s,u=n*s,h=n*o,d=i*s,f=i*o,v=i*l,g=a*s,p=a*o,y=a*l;return r[0]=1-h-v,r[1]=u+y,r[2]=d-p,r[3]=0,r[4]=u-y,r[5]=1-c-v,r[6]=f+g,r[7]=0,r[8]=d+p,r[9]=f-g,r[10]=1-c-h,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}function gw(r,t,e,n,i,a,s){var o=1/(e-t),l=1/(i-n),c=1/(a-s);return r[0]=a*2*o,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=a*2*l,r[6]=0,r[7]=0,r[8]=(e+t)*o,r[9]=(i+n)*l,r[10]=(s+a)*c,r[11]=-1,r[12]=0,r[13]=0,r[14]=s*a*2*c,r[15]=0,r}function ug(r,t,e,n,i){var a=1/Math.tan(t/2);if(r[0]=a/e,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=a,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[11]=-1,r[12]=0,r[13]=0,r[15]=0,i!=null&&i!==1/0){var s=1/(n-i);r[10]=(i+n)*s,r[14]=2*i*n*s}else r[10]=-1,r[14]=-2*n;return r}var pw=ug;function mw(r,t,e,n,i){var a=1/Math.tan(t/2);if(r[0]=a/e,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=a,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[11]=-1,r[12]=0,r[13]=0,r[15]=0,i!=null&&i!==1/0){var s=1/(n-i);r[10]=i*s,r[14]=i*n*s}else r[10]=-1,r[14]=-n;return r}function yw(r,t,e,n){var i=Math.tan(t.upDegrees*Math.PI/180),a=Math.tan(t.downDegrees*Math.PI/180),s=Math.tan(t.leftDegrees*Math.PI/180),o=Math.tan(t.rightDegrees*Math.PI/180),l=2/(s+o),c=2/(i+a);return r[0]=l,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=c,r[6]=0,r[7]=0,r[8]=-((s-o)*l*.5),r[9]=(i-a)*c*.5,r[10]=n/(e-n),r[11]=-1,r[12]=0,r[13]=0,r[14]=n*e/(e-n),r[15]=0,r}function hg(r,t,e,n,i,a,s){var o=1/(t-e),l=1/(n-i),c=1/(a-s);return r[0]=-2*o,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=-2*l,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=2*c,r[11]=0,r[12]=(t+e)*o,r[13]=(i+n)*l,r[14]=(s+a)*c,r[15]=1,r}var dg=hg;function fg(r,t,e,n,i,a,s){var o=1/(t-e),l=1/(n-i),c=1/(a-s);return r[0]=-2*o,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=-2*l,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=c,r[11]=0,r[12]=(t+e)*o,r[13]=(i+n)*l,r[14]=a*c,r[15]=1,r}function vg(r,t,e,n){var i,a,s,o,l,c,u,h,d,f,v=t[0],g=t[1],p=t[2],y=n[0],b=n[1],E=n[2],O=e[0],k=e[1],P=e[2];return Math.abs(v-O)<et&&Math.abs(g-k)<et&&Math.abs(p-P)<et?Et(r):(u=v-O,h=g-k,d=p-P,f=1/Math.sqrt(u*u+h*h+d*d),u*=f,h*=f,d*=f,i=b*d-E*h,a=E*u-y*d,s=y*h-b*u,f=Math.sqrt(i*i+a*a+s*s),f?(f=1/f,i*=f,a*=f,s*=f):(i=0,a=0,s=0),o=h*s-d*a,l=d*i-u*s,c=u*a-h*i,f=Math.sqrt(o*o+l*l+c*c),f?(f=1/f,o*=f,l*=f,c*=f):(o=0,l=0,c=0),r[0]=i,r[1]=o,r[2]=u,r[3]=0,r[4]=a,r[5]=l,r[6]=h,r[7]=0,r[8]=s,r[9]=c,r[10]=d,r[11]=0,r[12]=-(i*v+a*g+s*p),r[13]=-(o*v+l*g+c*p),r[14]=-(u*v+h*g+d*p),r[15]=1,r)}function bw(r,t,e,n){var i=t[0],a=t[1],s=t[2],o=n[0],l=n[1],c=n[2],u=i-e[0],h=a-e[1],d=s-e[2],f=u*u+h*h+d*d;f>0&&(f=1/Math.sqrt(f),u*=f,h*=f,d*=f);var v=l*d-c*h,g=c*u-o*d,p=o*h-l*u;return f=v*v+g*g+p*p,f>0&&(f=1/Math.sqrt(f),v*=f,g*=f,p*=f),r[0]=v,r[1]=g,r[2]=p,r[3]=0,r[4]=h*p-d*g,r[5]=d*v-u*p,r[6]=u*g-h*v,r[7]=0,r[8]=u,r[9]=h,r[10]=d,r[11]=0,r[12]=i,r[13]=a,r[14]=s,r[15]=1,r}function xw(r){return"mat4("+r[0]+", "+r[1]+", "+r[2]+", "+r[3]+", "+r[4]+", "+r[5]+", "+r[6]+", "+r[7]+", "+r[8]+", "+r[9]+", "+r[10]+", "+r[11]+", "+r[12]+", "+r[13]+", "+r[14]+", "+r[15]+")"}function Ew(r){return Math.sqrt(r[0]*r[0]+r[1]*r[1]+r[2]*r[2]+r[3]*r[3]+r[4]*r[4]+r[5]*r[5]+r[6]*r[6]+r[7]*r[7]+r[8]*r[8]+r[9]*r[9]+r[10]*r[10]+r[11]*r[11]+r[12]*r[12]+r[13]*r[13]+r[14]*r[14]+r[15]*r[15])}function ww(r,t,e){return r[0]=t[0]+e[0],r[1]=t[1]+e[1],r[2]=t[2]+e[2],r[3]=t[3]+e[3],r[4]=t[4]+e[4],r[5]=t[5]+e[5],r[6]=t[6]+e[6],r[7]=t[7]+e[7],r[8]=t[8]+e[8],r[9]=t[9]+e[9],r[10]=t[10]+e[10],r[11]=t[11]+e[11],r[12]=t[12]+e[12],r[13]=t[13]+e[13],r[14]=t[14]+e[14],r[15]=t[15]+e[15],r}function gg(r,t,e){return r[0]=t[0]-e[0],r[1]=t[1]-e[1],r[2]=t[2]-e[2],r[3]=t[3]-e[3],r[4]=t[4]-e[4],r[5]=t[5]-e[5],r[6]=t[6]-e[6],r[7]=t[7]-e[7],r[8]=t[8]-e[8],r[9]=t[9]-e[9],r[10]=t[10]-e[10],r[11]=t[11]-e[11],r[12]=t[12]-e[12],r[13]=t[13]-e[13],r[14]=t[14]-e[14],r[15]=t[15]-e[15],r}function Sw(r,t,e){return r[0]=t[0]*e,r[1]=t[1]*e,r[2]=t[2]*e,r[3]=t[3]*e,r[4]=t[4]*e,r[5]=t[5]*e,r[6]=t[6]*e,r[7]=t[7]*e,r[8]=t[8]*e,r[9]=t[9]*e,r[10]=t[10]*e,r[11]=t[11]*e,r[12]=t[12]*e,r[13]=t[13]*e,r[14]=t[14]*e,r[15]=t[15]*e,r}function Mw(r,t,e,n){return r[0]=t[0]+e[0]*n,r[1]=t[1]+e[1]*n,r[2]=t[2]+e[2]*n,r[3]=t[3]+e[3]*n,r[4]=t[4]+e[4]*n,r[5]=t[5]+e[5]*n,r[6]=t[6]+e[6]*n,r[7]=t[7]+e[7]*n,r[8]=t[8]+e[8]*n,r[9]=t[9]+e[9]*n,r[10]=t[10]+e[10]*n,r[11]=t[11]+e[11]*n,r[12]=t[12]+e[12]*n,r[13]=t[13]+e[13]*n,r[14]=t[14]+e[14]*n,r[15]=t[15]+e[15]*n,r}function Td(r,t){return r[0]===t[0]&&r[1]===t[1]&&r[2]===t[2]&&r[3]===t[3]&&r[4]===t[4]&&r[5]===t[5]&&r[6]===t[6]&&r[7]===t[7]&&r[8]===t[8]&&r[9]===t[9]&&r[10]===t[10]&&r[11]===t[11]&&r[12]===t[12]&&r[13]===t[13]&&r[14]===t[14]&&r[15]===t[15]}function Aw(r,t){var e=r[0],n=r[1],i=r[2],a=r[3],s=r[4],o=r[5],l=r[6],c=r[7],u=r[8],h=r[9],d=r[10],f=r[11],v=r[12],g=r[13],p=r[14],y=r[15],b=t[0],E=t[1],O=t[2],k=t[3],P=t[4],F=t[5],B=t[6],V=t[7],U=t[8],J=t[9],$=t[10],at=t[11],ct=t[12],ft=t[13],Nt=t[14],Ct=t[15];return Math.abs(e-b)<=et*Math.max(1,Math.abs(e),Math.abs(b))&&Math.abs(n-E)<=et*Math.max(1,Math.abs(n),Math.abs(E))&&Math.abs(i-O)<=et*Math.max(1,Math.abs(i),Math.abs(O))&&Math.abs(a-k)<=et*Math.max(1,Math.abs(a),Math.abs(k))&&Math.abs(s-P)<=et*Math.max(1,Math.abs(s),Math.abs(P))&&Math.abs(o-F)<=et*Math.max(1,Math.abs(o),Math.abs(F))&&Math.abs(l-B)<=et*Math.max(1,Math.abs(l),Math.abs(B))&&Math.abs(c-V)<=et*Math.max(1,Math.abs(c),Math.abs(V))&&Math.abs(u-U)<=et*Math.max(1,Math.abs(u),Math.abs(U))&&Math.abs(h-J)<=et*Math.max(1,Math.abs(h),Math.abs(J))&&Math.abs(d-$)<=et*Math.max(1,Math.abs(d),Math.abs($))&&Math.abs(f-at)<=et*Math.max(1,Math.abs(f),Math.abs(at))&&Math.abs(v-ct)<=et*Math.max(1,Math.abs(v),Math.abs(ct))&&Math.abs(g-ft)<=et*Math.max(1,Math.abs(g),Math.abs(ft))&&Math.abs(p-Nt)<=et*Math.max(1,Math.abs(p),Math.abs(Nt))&&Math.abs(y-Ct)<=et*Math.max(1,Math.abs(y),Math.abs(Ct))}var pg=Re,Tw=gg;function mg(){var r=new tt(9);return tt!=Float32Array&&(r[1]=0,r[2]=0,r[3]=0,r[5]=0,r[6]=0,r[7]=0),r[0]=1,r[4]=1,r[8]=1,r}function Ow(r,t){return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[4],r[4]=t[5],r[5]=t[6],r[6]=t[8],r[7]=t[9],r[8]=t[10],r}function sF(r){var t=new glMatrix.ARRAY_TYPE(9);return t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t[4]=r[4],t[5]=r[5],t[6]=r[6],t[7]=r[7],t[8]=r[8],t}function oF(r,t){return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r[4]=t[4],r[5]=t[5],r[6]=t[6],r[7]=t[7],r[8]=t[8],r}function Cw(r,t,e,n,i,a,s,o,l){var c=new tt(9);return c[0]=r,c[1]=t,c[2]=e,c[3]=n,c[4]=i,c[5]=a,c[6]=s,c[7]=o,c[8]=l,c}function lF(r,t,e,n,i,a,s,o,l,c){return r[0]=t,r[1]=e,r[2]=n,r[3]=i,r[4]=a,r[5]=s,r[6]=o,r[7]=l,r[8]=c,r}function cF(r){return r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=1,r[5]=0,r[6]=0,r[7]=0,r[8]=1,r}function uF(r,t){if(r===t){var e=t[1],n=t[2],i=t[5];r[1]=t[3],r[2]=t[6],r[3]=e,r[5]=t[7],r[6]=n,r[7]=i}else r[0]=t[0],r[1]=t[3],r[2]=t[6],r[3]=t[1],r[4]=t[4],r[5]=t[7],r[6]=t[2],r[7]=t[5],r[8]=t[8];return r}function hF(r,t){var e=t[0],n=t[1],i=t[2],a=t[3],s=t[4],o=t[5],l=t[6],c=t[7],u=t[8],h=u*s-o*c,d=-u*a+o*l,f=c*a-s*l,v=e*h+n*d+i*f;return v?(v=1/v,r[0]=h*v,r[1]=(-u*n+i*c)*v,r[2]=(o*n-i*s)*v,r[3]=d*v,r[4]=(u*e-i*l)*v,r[5]=(-o*e+i*a)*v,r[6]=f*v,r[7]=(-c*e+n*l)*v,r[8]=(s*e-n*a)*v,r):null}function dF(r,t){var e=t[0],n=t[1],i=t[2],a=t[3],s=t[4],o=t[5],l=t[6],c=t[7],u=t[8];return r[0]=s*u-o*c,r[1]=i*c-n*u,r[2]=n*o-i*s,r[3]=o*l-a*u,r[4]=e*u-i*l,r[5]=i*a-e*o,r[6]=a*c-s*l,r[7]=n*l-e*c,r[8]=e*s-n*a,r}function fF(r){var t=r[0],e=r[1],n=r[2],i=r[3],a=r[4],s=r[5],o=r[6],l=r[7],c=r[8];return t*(c*a-s*l)+e*(-c*i+s*o)+n*(l*i-a*o)}function vF(r,t,e){var n=t[0],i=t[1],a=t[2],s=t[3],o=t[4],l=t[5],c=t[6],u=t[7],h=t[8],d=e[0],f=e[1],v=e[2],g=e[3],p=e[4],y=e[5],b=e[6],E=e[7],O=e[8];return r[0]=d*n+f*s+v*c,r[1]=d*i+f*o+v*u,r[2]=d*a+f*l+v*h,r[3]=g*n+p*s+y*c,r[4]=g*i+p*o+y*u,r[5]=g*a+p*l+y*h,r[6]=b*n+E*s+O*c,r[7]=b*i+E*o+O*u,r[8]=b*a+E*l+O*h,r}function gF(r,t,e){var n=t[0],i=t[1],a=t[2],s=t[3],o=t[4],l=t[5],c=t[6],u=t[7],h=t[8],d=e[0],f=e[1];return r[0]=n,r[1]=i,r[2]=a,r[3]=s,r[4]=o,r[5]=l,r[6]=d*n+f*s+c,r[7]=d*i+f*o+u,r[8]=d*a+f*l+h,r}function pF(r,t,e){var n=t[0],i=t[1],a=t[2],s=t[3],o=t[4],l=t[5],c=t[6],u=t[7],h=t[8],d=Math.sin(e),f=Math.cos(e);return r[0]=f*n+d*s,r[1]=f*i+d*o,r[2]=f*a+d*l,r[3]=f*s-d*n,r[4]=f*o-d*i,r[5]=f*l-d*a,r[6]=c,r[7]=u,r[8]=h,r}function mF(r,t,e){var n=e[0],i=e[1];return r[0]=n*t[0],r[1]=n*t[1],r[2]=n*t[2],r[3]=i*t[3],r[4]=i*t[4],r[5]=i*t[5],r[6]=t[6],r[7]=t[7],r[8]=t[8],r}function yF(r,t){return r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=1,r[5]=0,r[6]=t[0],r[7]=t[1],r[8]=1,r}function bF(r,t){var e=Math.sin(t),n=Math.cos(t);return r[0]=n,r[1]=e,r[2]=0,r[3]=-e,r[4]=n,r[5]=0,r[6]=0,r[7]=0,r[8]=1,r}function xF(r,t){return r[0]=t[0],r[1]=0,r[2]=0,r[3]=0,r[4]=t[1],r[5]=0,r[6]=0,r[7]=0,r[8]=1,r}function EF(r,t){return r[0]=t[0],r[1]=t[1],r[2]=0,r[3]=t[2],r[4]=t[3],r[5]=0,r[6]=t[4],r[7]=t[5],r[8]=1,r}function wF(r,t){var e=t[0],n=t[1],i=t[2],a=t[3],s=e+e,o=n+n,l=i+i,c=e*s,u=n*s,h=n*o,d=i*s,f=i*o,v=i*l,g=a*s,p=a*o,y=a*l;return r[0]=1-h-v,r[3]=u-y,r[6]=d+p,r[1]=u+y,r[4]=1-c-v,r[7]=f-g,r[2]=d-p,r[5]=f+g,r[8]=1-c-h,r}function SF(r,t){var e=t[0],n=t[1],i=t[2],a=t[3],s=t[4],o=t[5],l=t[6],c=t[7],u=t[8],h=t[9],d=t[10],f=t[11],v=t[12],g=t[13],p=t[14],y=t[15],b=e*o-n*s,E=e*l-i*s,O=e*c-a*s,k=n*l-i*o,P=n*c-a*o,F=i*c-a*l,B=u*g-h*v,V=u*p-d*v,U=u*y-f*v,J=h*p-d*g,$=h*y-f*g,at=d*y-f*p,ct=b*at-E*$+O*J+k*U-P*V+F*B;return ct?(ct=1/ct,r[0]=(o*at-l*$+c*J)*ct,r[1]=(l*U-s*at-c*V)*ct,r[2]=(s*$-o*U+c*B)*ct,r[3]=(i*$-n*at-a*J)*ct,r[4]=(e*at-i*U+a*V)*ct,r[5]=(n*U-e*$-a*B)*ct,r[6]=(g*F-p*P+y*k)*ct,r[7]=(p*O-v*F-y*E)*ct,r[8]=(v*P-g*O+y*b)*ct,r):null}function MF(r,t,e){return r[0]=2/t,r[1]=0,r[2]=0,r[3]=0,r[4]=-2/e,r[5]=0,r[6]=-1,r[7]=1,r[8]=1,r}function AF(r){return"mat3("+r[0]+", "+r[1]+", "+r[2]+", "+r[3]+", "+r[4]+", "+r[5]+", "+r[6]+", "+r[7]+", "+r[8]+")"}function TF(r){return Math.sqrt(r[0]*r[0]+r[1]*r[1]+r[2]*r[2]+r[3]*r[3]+r[4]*r[4]+r[5]*r[5]+r[6]*r[6]+r[7]*r[7]+r[8]*r[8])}function OF(r,t,e){return r[0]=t[0]+e[0],r[1]=t[1]+e[1],r[2]=t[2]+e[2],r[3]=t[3]+e[3],r[4]=t[4]+e[4],r[5]=t[5]+e[5],r[6]=t[6]+e[6],r[7]=t[7]+e[7],r[8]=t[8]+e[8],r}function CF(r,t,e){return r[0]=t[0]-e[0],r[1]=t[1]-e[1],r[2]=t[2]-e[2],r[3]=t[3]-e[3],r[4]=t[4]-e[4],r[5]=t[5]-e[5],r[6]=t[6]-e[6],r[7]=t[7]-e[7],r[8]=t[8]-e[8],r}function NF(r,t,e){return r[0]=t[0]*e,r[1]=t[1]*e,r[2]=t[2]*e,r[3]=t[3]*e,r[4]=t[4]*e,r[5]=t[5]*e,r[6]=t[6]*e,r[7]=t[7]*e,r[8]=t[8]*e,r}function kF(r,t,e,n){return r[0]=t[0]+e[0]*n,r[1]=t[1]+e[1]*n,r[2]=t[2]+e[2]*n,r[3]=t[3]+e[3]*n,r[4]=t[4]+e[4]*n,r[5]=t[5]+e[5]*n,r[6]=t[6]+e[6]*n,r[7]=t[7]+e[7]*n,r[8]=t[8]+e[8]*n,r}function PF(r,t){return r[0]===t[0]&&r[1]===t[1]&&r[2]===t[2]&&r[3]===t[3]&&r[4]===t[4]&&r[5]===t[5]&&r[6]===t[6]&&r[7]===t[7]&&r[8]===t[8]}function RF(r,t){var e=r[0],n=r[1],i=r[2],a=r[3],s=r[4],o=r[5],l=r[6],c=r[7],u=r[8],h=t[0],d=t[1],f=t[2],v=t[3],g=t[4],p=t[5],y=t[6],b=t[7],E=t[8];return Math.abs(e-h)<=glMatrix.EPSILON*Math.max(1,Math.abs(e),Math.abs(h))&&Math.abs(n-d)<=glMatrix.EPSILON*Math.max(1,Math.abs(n),Math.abs(d))&&Math.abs(i-f)<=glMatrix.EPSILON*Math.max(1,Math.abs(i),Math.abs(f))&&Math.abs(a-v)<=glMatrix.EPSILON*Math.max(1,Math.abs(a),Math.abs(v))&&Math.abs(s-g)<=glMatrix.EPSILON*Math.max(1,Math.abs(s),Math.abs(g))&&Math.abs(o-p)<=glMatrix.EPSILON*Math.max(1,Math.abs(o),Math.abs(p))&&Math.abs(l-y)<=glMatrix.EPSILON*Math.max(1,Math.abs(l),Math.abs(y))&&Math.abs(c-b)<=glMatrix.EPSILON*Math.max(1,Math.abs(c),Math.abs(b))&&Math.abs(u-E)<=glMatrix.EPSILON*Math.max(1,Math.abs(u),Math.abs(E))}var LF=null,_F=null;function qn(){var r=new tt(4);return tt!=Float32Array&&(r[0]=0,r[1]=0,r[2]=0),r[3]=1,r}function DF(r){return r[0]=0,r[1]=0,r[2]=0,r[3]=1,r}function Da(r,t,e){e=e*.5;var n=Math.sin(e);return r[0]=n*t[0],r[1]=n*t[1],r[2]=n*t[2],r[3]=Math.cos(e),r}function IF(r,t){var e=Math.acos(t[3])*2,n=Math.sin(e/2);return n>glMatrix.EPSILON?(r[0]=t[0]/n,r[1]=t[1]/n,r[2]=t[2]/n):(r[0]=1,r[1]=0,r[2]=0),e}function BF(r,t){var e=_w(r,t);return Math.acos(2*e*e-1)}function Ia(r,t,e){var n=t[0],i=t[1],a=t[2],s=t[3],o=e[0],l=e[1],c=e[2],u=e[3];return r[0]=n*u+s*o+i*c-a*l,r[1]=i*u+s*l+a*o-n*c,r[2]=a*u+s*c+n*l-i*o,r[3]=s*u-n*o-i*l-a*c,r}function FF(r,t,e){e*=.5;var n=t[0],i=t[1],a=t[2],s=t[3],o=Math.sin(e),l=Math.cos(e);return r[0]=n*l+s*o,r[1]=i*l+a*o,r[2]=a*l-i*o,r[3]=s*l-n*o,r}function zF(r,t,e){e*=.5;var n=t[0],i=t[1],a=t[2],s=t[3],o=Math.sin(e),l=Math.cos(e);return r[0]=n*l-a*o,r[1]=i*l+s*o,r[2]=a*l+n*o,r[3]=s*l-i*o,r}function jF(r,t,e){e*=.5;var n=t[0],i=t[1],a=t[2],s=t[3],o=Math.sin(e),l=Math.cos(e);return r[0]=n*l+i*o,r[1]=i*l-n*o,r[2]=a*l+s*o,r[3]=s*l-a*o,r}function GF(r,t){var e=t[0],n=t[1],i=t[2];return r[0]=e,r[1]=n,r[2]=i,r[3]=Math.sqrt(Math.abs(1-e*e-n*n-i*i)),r}function Nw(r,t){var e=t[0],n=t[1],i=t[2],a=t[3],s=Math.sqrt(e*e+n*n+i*i),o=Math.exp(a),l=s>0?o*Math.sin(s)/s:0;return r[0]=e*l,r[1]=n*l,r[2]=i*l,r[3]=o*Math.cos(s),r}function kw(r,t){var e=t[0],n=t[1],i=t[2],a=t[3],s=Math.sqrt(e*e+n*n+i*i),o=s>0?Math.atan2(s,a)/s:0;return r[0]=e*o,r[1]=n*o,r[2]=i*o,r[3]=.5*Math.log(e*e+n*n+i*i+a*a),r}function WF(r,t,e){return kw(r,t),Lw(r,r,e),Nw(r,r),r}function Od(r,t,e,n){var i=t[0],a=t[1],s=t[2],o=t[3],l=e[0],c=e[1],u=e[2],h=e[3],d,f,v,g,p;return f=i*l+a*c+s*u+o*h,f<0&&(f=-f,l=-l,c=-c,u=-u,h=-h),1-f>et?(d=Math.acos(f),v=Math.sin(d),g=Math.sin((1-n)*d)/v,p=Math.sin(n*d)/v):(g=1-n,p=n),r[0]=g*i+p*l,r[1]=g*a+p*c,r[2]=g*s+p*u,r[3]=g*o+p*h,r}function ZF(r){var t=glMatrix.RANDOM(),e=glMatrix.RANDOM(),n=glMatrix.RANDOM(),i=Math.sqrt(1-t),a=Math.sqrt(t);return r[0]=i*Math.sin(2*Math.PI*e),r[1]=i*Math.cos(2*Math.PI*e),r[2]=a*Math.sin(2*Math.PI*n),r[3]=a*Math.cos(2*Math.PI*n),r}function Cd(r,t){var e=t[0],n=t[1],i=t[2],a=t[3],s=e*e+n*n+i*i+a*a,o=s?1/s:0;return r[0]=-e*o,r[1]=-n*o,r[2]=-i*o,r[3]=a*o,r}function VF(r,t){return r[0]=-t[0],r[1]=-t[1],r[2]=-t[2],r[3]=t[3],r}function Pw(r,t){var e=t[0]+t[4]+t[8],n;if(e>0)n=Math.sqrt(e+1),r[3]=.5*n,n=.5/n,r[0]=(t[5]-t[7])*n,r[1]=(t[6]-t[2])*n,r[2]=(t[1]-t[3])*n;else{var i=0;t[4]>t[0]&&(i=1),t[8]>t[i*3+i]&&(i=2);var a=(i+1)%3,s=(i+2)%3;n=Math.sqrt(t[i*3+i]-t[a*3+a]-t[s*3+s]+1),r[i]=.5*n,n=.5/n,r[3]=(t[a*3+s]-t[s*3+a])*n,r[a]=(t[a*3+i]+t[i*3+a])*n,r[s]=(t[s*3+i]+t[i*3+s])*n}return r}function ic(r,t,e,n){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:it,a=Math.PI/360;t*=a,n*=a,e*=a;var s=Math.sin(t),o=Math.cos(t),l=Math.sin(e),c=Math.cos(e),u=Math.sin(n),h=Math.cos(n);switch(i){case"xyz":r[0]=s*c*h+o*l*u,r[1]=o*l*h-s*c*u,r[2]=o*c*u+s*l*h,r[3]=o*c*h-s*l*u;break;case"xzy":r[0]=s*c*h-o*l*u,r[1]=o*l*h-s*c*u,r[2]=o*c*u+s*l*h,r[3]=o*c*h+s*l*u;break;case"yxz":r[0]=s*c*h+o*l*u,r[1]=o*l*h-s*c*u,r[2]=o*c*u-s*l*h,r[3]=o*c*h+s*l*u;break;case"yzx":r[0]=s*c*h+o*l*u,r[1]=o*l*h+s*c*u,r[2]=o*c*u-s*l*h,r[3]=o*c*h-s*l*u;break;case"zxy":r[0]=s*c*h-o*l*u,r[1]=o*l*h+s*c*u,r[2]=o*c*u+s*l*h,r[3]=o*c*h-s*l*u;break;case"zyx":r[0]=s*c*h-o*l*u,r[1]=o*l*h+s*c*u,r[2]=o*c*u-s*l*h,r[3]=o*c*h+s*l*u;break;default:throw new Error("Unknown angle order "+i)}return r}function UF(r){return"quat("+r[0]+", "+r[1]+", "+r[2]+", "+r[3]+")"}var YF=Yo,Rw=wi,ac=xd,yg=tc,HF=no,bg=Ia,Lw=wd,_w=m,XF=j,KF=ec,QF=null,qF=nc,JF=null,sc=w,$F=vt;function t8(r,t){return Math.abs(vec4.dot(r,t))>=1-glMatrix.EPSILON}var e8=function(){var r=xt(),t=jt(1,0,0),e=jt(0,1,0);return function(n,i,a){var s=Ve(i,a);return s<-.999999?(vn(r,t,i),Or(r)<1e-6&&vn(r,e,i),ke(r,r),Da(n,r,Math.PI),n):s>.999999?(n[0]=0,n[1]=0,n[2]=0,n[3]=1,n):(vn(r,i,a),n[0]=r[0],n[1]=r[1],n[2]=r[2],n[3]=1+s,sc(n,n))}}(),n8=function(){var r=qn(),t=qn();return function(e,n,i,a,s,o){return Od(r,n,s,o),Od(t,i,a,o),Od(e,r,t,2*o*(1-o)),e}}(),r8=function(){var r=mg();return function(t,e,n,i){return r[0]=n[0],r[3]=n[1],r[6]=n[2],r[1]=i[0],r[4]=i[1],r[7]=i[2],r[2]=-e[0],r[5]=-e[1],r[8]=-e[2],sc(t,Pw(t,r))}}();function Nd(){var r=new tt(2);return tt!=Float32Array&&(r[0]=0,r[1]=0),r}function i8(r){var t=new glMatrix.ARRAY_TYPE(2);return t[0]=r[0],t[1]=r[1],t}function a8(r,t){var e=new glMatrix.ARRAY_TYPE(2);return e[0]=r,e[1]=t,e}function Dw(r,t){return r[0]=t[0],r[1]=t[1],r}function Iw(r,t,e){return r[0]=t,r[1]=e,r}function s8(r,t,e){return r[0]=t[0]+e[0],r[1]=t[1]+e[1],r}function o8(r,t,e){return r[0]=t[0]-e[0],r[1]=t[1]-e[1],r}function l8(r,t,e){return r[0]=t[0]*e[0],r[1]=t[1]*e[1],r}function c8(r,t,e){return r[0]=t[0]/e[0],r[1]=t[1]/e[1],r}function u8(r,t){return r[0]=Math.ceil(t[0]),r[1]=Math.ceil(t[1]),r}function h8(r,t){return r[0]=Math.floor(t[0]),r[1]=Math.floor(t[1]),r}function d8(r,t,e){return r[0]=Math.min(t[0],e[0]),r[1]=Math.min(t[1],e[1]),r}function f8(r,t,e){return r[0]=Math.max(t[0],e[0]),r[1]=Math.max(t[1],e[1]),r}function v8(r,t){return r[0]=glMatrix.round(t[0]),r[1]=glMatrix.round(t[1]),r}function g8(r,t,e){return r[0]=t[0]*e,r[1]=t[1]*e,r}function p8(r,t,e,n){return r[0]=t[0]+e[0]*n,r[1]=t[1]+e[1]*n,r}function m8(r,t){var e=t[0]-r[0],n=t[1]-r[1];return Math.sqrt(e*e+n*n)}function y8(r,t){var e=t[0]-r[0],n=t[1]-r[1];return e*e+n*n}function b8(r){var t=r[0],e=r[1];return Math.sqrt(t*t+e*e)}function x8(r){var t=r[0],e=r[1];return t*t+e*e}function E8(r,t){return r[0]=-t[0],r[1]=-t[1],r}function w8(r,t){return r[0]=1/t[0],r[1]=1/t[1],r}function Bw(r,t){var e=t[0],n=t[1],i=e*e+n*n;return i>0&&(i=1/Math.sqrt(i)),r[0]=t[0]*i,r[1]=t[1]*i,r}function Fw(r,t){return r[0]*t[0]+r[1]*t[1]}function S8(r,t,e){var n=t[0]*e[1]-t[1]*e[0];return r[0]=r[1]=0,r[2]=n,r}function M8(r,t,e,n){var i=t[0],a=t[1];return r[0]=i+n*(e[0]-i),r[1]=a+n*(e[1]-a),r}function A8(r,t){t=t===void 0?1:t;var e=glMatrix.RANDOM()*2*Math.PI;return r[0]=Math.cos(e)*t,r[1]=Math.sin(e)*t,r}function T8(r,t,e){var n=t[0],i=t[1];return r[0]=e[0]*n+e[2]*i,r[1]=e[1]*n+e[3]*i,r}function O8(r,t,e){var n=t[0],i=t[1];return r[0]=e[0]*n+e[2]*i+e[4],r[1]=e[1]*n+e[3]*i+e[5],r}function C8(r,t,e){var n=t[0],i=t[1];return r[0]=e[0]*n+e[3]*i+e[6],r[1]=e[1]*n+e[4]*i+e[7],r}function N8(r,t,e){var n=t[0],i=t[1];return r[0]=e[0]*n+e[4]*i+e[12],r[1]=e[1]*n+e[5]*i+e[13],r}function k8(r,t,e,n){var i=t[0]-e[0],a=t[1]-e[1],s=Math.sin(n),o=Math.cos(n);return r[0]=i*o-a*s+e[0],r[1]=i*s+a*o+e[1],r}function P8(r,t){var e=r[0],n=r[1],i=t[0],a=t[1];return Math.abs(Math.atan2(n*i-e*a,e*i+n*a))}function R8(r,t){var e=r[0],n=r[1],i=t[0],a=t[1];return Math.atan2(e*a-n*i,e*i+n*a)}function L8(r){return r[0]=0,r[1]=0,r}function _8(r){return"vec2("+r[0]+", "+r[1]+")"}function zw(r,t){return r[0]===t[0]&&r[1]===t[1]}function D8(r,t){var e=r[0],n=r[1],i=t[0],a=t[1];return Math.abs(e-i)<=glMatrix.EPSILON*Math.max(1,Math.abs(e),Math.abs(i))&&Math.abs(n-a)<=glMatrix.EPSILON*Math.max(1,Math.abs(n),Math.abs(a))}var I8=null,B8=null,F8=null,z8=null,j8=null,G8=null,W8=null,Z8=function(){var r=Nd();return function(t,e,n,i,a,s){var o,l;for(e||(e=2),n||(n=0),i?l=Math.min(i*e+n,t.length):l=t.length,o=n;o<l;o+=e)r[0]=t[o],r[1]=t[o+1],a(r,r,s),t[o]=r[0],t[o+1]=r[1];return t}}();function ie(r){return typeof r=="number"}function Xr(r,t){return Math.sqrt((r[0]-t[0])*(r[0]-t[0])+(r[1]-t[1])*(r[1]-t[1]))}function be(r){return r==null}function Ue(r){return typeof r=="string"}var jw=function(r,t,e){return r<t?t:r>e?e:r},kn=jw,Z=S(80813),Ko={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function xg(r){return Array.isArray(r)&&r.every(function(t){var e=t[0].toLowerCase();return Ko[e]===t.length-1&&"achlmqstvz".includes(e)})}function Eg(r){return xg(r)&&r.every(function(t){var e=t[0];return e===e.toUpperCase()})}function wg(r){return Eg(r)&&r.every(function(t){var e=t[0];return"ACLMQZ".includes(e)})}var Sg={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null};function Mg(r){for(var t=r.pathValue[r.segmentStart],e=t.toLowerCase(),n=r.data;n.length>=Ko[e]&&(e==="m"&&n.length>2?(r.segments.push([t].concat(n.splice(0,2))),e="l",t=t==="m"?"l":"L"):r.segments.push([t].concat(n.splice(0,Ko[e]))),!!Ko[e]););}function Gw(r){var t=r.index,e=r.pathValue,n=e.charCodeAt(t);if(n===48){r.param=0,r.index+=1;return}if(n===49){r.param=1,r.index+=1;return}r.err='[path-util]: invalid Arc flag "'.concat(e[t],'", expecting 0 or 1 at index ').concat(t)}function Ww(r){return r>=48&&r<=57||r===43||r===45||r===46}function ao(r){return r>=48&&r<=57}function Zw(r){var t=r.max,e=r.pathValue,n=r.index,i=n,a=!1,s=!1,o=!1,l=!1,c;if(i>=t){r.err="[path-util]: Invalid path value at index ".concat(i,', "pathValue" is missing param');return}if(c=e.charCodeAt(i),(c===43||c===45)&&(i+=1,c=e.charCodeAt(i)),!ao(c)&&c!==46){r.err="[path-util]: Invalid path value at index ".concat(i,', "').concat(e[i],'" is not a number');return}if(c!==46){if(a=c===48,i+=1,c=e.charCodeAt(i),a&&i<t&&c&&ao(c)){r.err="[path-util]: Invalid path value at index ".concat(n,', "').concat(e[n],'" illegal number');return}for(;i<t&&ao(e.charCodeAt(i));)i+=1,s=!0;c=e.charCodeAt(i)}if(c===46){for(l=!0,i+=1;ao(e.charCodeAt(i));)i+=1,o=!0;c=e.charCodeAt(i)}if(c===101||c===69){if(l&&!s&&!o){r.err="[path-util]: Invalid path value at index ".concat(i,', "').concat(e[i],'" invalid float exponent');return}if(i+=1,c=e.charCodeAt(i),(c===43||c===45)&&(i+=1),i<t&&ao(e.charCodeAt(i)))for(;i<t&&ao(e.charCodeAt(i));)i+=1;else{r.err="[path-util]: Invalid path value at index ".concat(i,', "').concat(e[i],'" invalid integer exponent');return}}r.index=i,r.param=+r.pathValue.slice(n,i)}function Vw(r){var t=[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279];return r===10||r===13||r===8232||r===8233||r===32||r===9||r===11||r===12||r===160||r>=5760&&t.includes(r)}function oc(r){for(var t=r.pathValue,e=r.max;r.index<e&&Vw(t.charCodeAt(r.index));)r.index+=1}function Uw(r){switch(r|32){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}}function Yw(r){return(r|32)===97}function Hw(r){var t=r.max,e=r.pathValue,n=r.index,i=e.charCodeAt(n),a=Ko[e[n].toLowerCase()];if(r.segmentStart=n,!Uw(i)){r.err='[path-util]: Invalid path value "'.concat(e[n],'" is not a path command');return}if(r.index+=1,oc(r),r.data=[],!a){Mg(r);return}for(;;){for(var s=a;s>0;s-=1){if(Yw(i)&&(s===3||s===4)?Gw(r):Zw(r),r.err.length)return;r.data.push(r.param),oc(r),r.index<t&&e.charCodeAt(r.index)===44&&(r.index+=1,oc(r))}if(r.index>=r.max||!Ww(e.charCodeAt(r.index)))break}Mg(r)}var Xw=function(){function r(t){this.pathValue=t,this.segments=[],this.max=t.length,this.index=0,this.param=0,this.segmentStart=0,this.data=[],this.err=""}return r}();function Kw(r){if(xg(r))return[].concat(r);var t=new Xw(r);for(oc(t);t.index<t.max&&!t.err.length;)Hw(t);return t.err?t.err:t.segments}function Qw(r){if(Eg(r))return[].concat(r);var t=Kw(r),e=0,n=0,i=0,a=0;return t.map(function(s){var o=s.slice(1).map(Number),l=s[0],c=l.toUpperCase();if(l==="M")return e=o[0],n=o[1],i=e,a=n,["M",e,n];var u;if(l!==c)switch(c){case"A":u=[c,o[0],o[1],o[2],o[3],o[4],o[5]+e,o[6]+n];break;case"V":u=[c,o[0]+n];break;case"H":u=[c,o[0]+e];break;default:{var h=o.map(function(f,v){return f+(v%2?n:e)});u=[c].concat(h)}}else u=[c].concat(o);var d=u.length;switch(c){case"Z":e=i,n=a;break;case"H":e=u[1];break;case"V":n=u[1];break;default:e=u[d-2],n=u[d-1],c==="M"&&(i=e,a=n)}return u})}function qw(r,t){var e=r[0],n=t.x1,i=t.y1,a=t.x2,s=t.y2,o=r.slice(1).map(Number),l=r;if("TQ".includes(e)||(t.qx=null,t.qy=null),e==="H")l=["L",r[1],i];else if(e==="V")l=["L",n,r[1]];else if(e==="S"){var c=n*2-a,u=i*2-s;t.x1=c,t.y1=u,l=["C",c,u].concat(o)}else if(e==="T"){var h=n*2-t.qx,d=i*2-t.qy;t.qx=h,t.qy=d,l=["Q",h,d].concat(o)}else if(e==="Q"){var f=o[0],v=o[1];t.qx=f,t.qy=v}return l}function lc(r){if(wg(r))return[].concat(r);for(var t=Qw(r),e=(0,Z.pi)({},Sg),n=0;n<t.length;n+=1){t[n]=qw(t[n],e);var i=t[n],a=i.length;e.x1=+i[a-2],e.y1=+i[a-1],e.x2=+i[a-4]||e.x1,e.y2=+i[a-3]||e.y1}return t}function Ba(r,t,e){var n=r[0],i=r[1],a=t[0],s=t[1];return[n+(a-n)*e,i+(s-i)*e]}function kd(r,t,e,n,i){var a=Xr([r,t],[e,n]),s={x:0,y:0};if(typeof i=="number")if(i<=0)s={x:r,y:t};else if(i>=a)s={x:e,y:n};else{var o=Ba([r,t],[e,n],i/a),l=o[0],c=o[1];s={x:l,y:c}}return{length:a,point:s,min:{x:Math.min(r,e),y:Math.min(t,n)},max:{x:Math.max(r,e),y:Math.max(t,n)}}}function Ag(r,t){var e=r.x,n=r.y,i=t.x,a=t.y,s=e*i+n*a,o=Math.sqrt((Math.pow(e,2)+Math.pow(n,2))*(Math.pow(i,2)+Math.pow(a,2))),l=e*a-n*i<0?-1:1,c=l*Math.acos(s/o);return c}function Jw(r,t,e,n,i,a,s,o,l,c){var u=Math.abs,h=Math.sin,d=Math.cos,f=Math.sqrt,v=Math.PI,g=u(e),p=u(n),y=(i%360+360)%360,b=y*(v/180);if(r===o&&t===l)return{x:r,y:t};if(g===0||p===0)return kd(r,t,o,l,c).point;var E=(r-o)/2,O=(t-l)/2,k={x:d(b)*E+h(b)*O,y:-h(b)*E+d(b)*O},P=Math.pow(k.x,2)/Math.pow(g,2)+Math.pow(k.y,2)/Math.pow(p,2);P>1&&(g*=f(P),p*=f(P));var F=Math.pow(g,2)*Math.pow(p,2)-Math.pow(g,2)*Math.pow(k.y,2)-Math.pow(p,2)*Math.pow(k.x,2),B=Math.pow(g,2)*Math.pow(k.y,2)+Math.pow(p,2)*Math.pow(k.x,2),V=F/B;V=V<0?0:V;var U=(a!==s?1:-1)*f(V),J={x:U*(g*k.y/p),y:U*(-(p*k.x)/g)},$={x:d(b)*J.x-h(b)*J.y+(r+o)/2,y:h(b)*J.x+d(b)*J.y+(t+l)/2},at={x:(k.x-J.x)/g,y:(k.y-J.y)/p},ct=Ag({x:1,y:0},at),ft={x:(-k.x-J.x)/g,y:(-k.y-J.y)/p},Nt=Ag(at,ft);!s&&Nt>0?Nt-=2*v:s&&Nt<0&&(Nt+=2*v),Nt%=2*v;var Ct=ct+Nt*c,gt=g*d(Ct),bt=p*h(Ct),Pt={x:d(b)*gt-h(b)*bt+$.x,y:h(b)*gt+d(b)*bt+$.y};return Pt}function $w(r,t,e,n,i,a,s,o,l,c,u){var h,d=u.bbox,f=d===void 0?!0:d,v=u.length,g=v===void 0?!0:v,p=u.sampleSize,y=p===void 0?30:p,b=typeof c=="number",E=r,O=t,k=0,P=[E,O,k],F=[E,O],B=0,V={x:0,y:0},U=[{x:E,y:O}];b&&c<=0&&(V={x:E,y:O});for(var J=0;J<=y;J+=1){if(B=J/y,h=Jw(r,t,e,n,i,a,s,o,l,B),E=h.x,O=h.y,f&&U.push({x:E,y:O}),g&&(k+=Xr(F,[E,O])),F=[E,O],b&&k>=c&&c>P[2]){var $=(k-c)/(k-P[2]);V={x:F[0]*(1-$)+P[0]*$,y:F[1]*(1-$)+P[1]*$}}P=[E,O,k]}return b&&c>=k&&(V={x:o,y:l}),{length:k,point:V,min:{x:Math.min.apply(null,U.map(function(at){return at.x})),y:Math.min.apply(null,U.map(function(at){return at.y}))},max:{x:Math.max.apply(null,U.map(function(at){return at.x})),y:Math.max.apply(null,U.map(function(at){return at.y}))}}}function t2(r,t,e,n,i,a,s,o,l){var c=1-l;return{x:Math.pow(c,3)*r+3*Math.pow(c,2)*l*e+3*c*Math.pow(l,2)*i+Math.pow(l,3)*s,y:Math.pow(c,3)*t+3*Math.pow(c,2)*l*n+3*c*Math.pow(l,2)*a+Math.pow(l,3)*o}}function Tg(r,t,e,n,i,a,s,o,l,c){var u,h=c.bbox,d=h===void 0?!0:h,f=c.length,v=f===void 0?!0:f,g=c.sampleSize,p=g===void 0?10:g,y=typeof l=="number",b=r,E=t,O=0,k=[b,E,O],P=[b,E],F=0,B={x:0,y:0},V=[{x:b,y:E}];y&&l<=0&&(B={x:b,y:E});for(var U=0;U<=p;U+=1){if(F=U/p,u=t2(r,t,e,n,i,a,s,o,F),b=u.x,E=u.y,d&&V.push({x:b,y:E}),v&&(O+=Xr(P,[b,E])),P=[b,E],y&&O>=l&&l>k[2]){var J=(O-l)/(O-k[2]);B={x:P[0]*(1-J)+k[0]*J,y:P[1]*(1-J)+k[1]*J}}k=[b,E,O]}return y&&l>=O&&(B={x:s,y:o}),{length:O,point:B,min:{x:Math.min.apply(null,V.map(function($){return $.x})),y:Math.min.apply(null,V.map(function($){return $.y}))},max:{x:Math.max.apply(null,V.map(function($){return $.x})),y:Math.max.apply(null,V.map(function($){return $.y}))}}}function e2(r,t,e,n,i,a,s){var o=1-s;return{x:Math.pow(o,2)*r+2*o*s*e+Math.pow(s,2)*i,y:Math.pow(o,2)*t+2*o*s*n+Math.pow(s,2)*a}}function n2(r,t,e,n,i,a,s,o){var l,c=o.bbox,u=c===void 0?!0:c,h=o.length,d=h===void 0?!0:h,f=o.sampleSize,v=f===void 0?10:f,g=typeof s=="number",p=r,y=t,b=0,E=[p,y,b],O=[p,y],k=0,P={x:0,y:0},F=[{x:p,y}];g&&s<=0&&(P={x:p,y});for(var B=0;B<=v;B+=1){if(k=B/v,l=e2(r,t,e,n,i,a,k),p=l.x,y=l.y,u&&F.push({x:p,y}),d&&(b+=Xr(O,[p,y])),O=[p,y],g&&b>=s&&s>E[2]){var V=(b-s)/(b-E[2]);P={x:O[0]*(1-V)+E[0]*V,y:O[1]*(1-V)+E[1]*V}}E=[p,y,b]}return g&&s>=b&&(P={x:i,y:a}),{length:b,point:P,min:{x:Math.min.apply(null,F.map(function(U){return U.x})),y:Math.min.apply(null,F.map(function(U){return U.y}))},max:{x:Math.max.apply(null,F.map(function(U){return U.x})),y:Math.max.apply(null,F.map(function(U){return U.y}))}}}function Og(r,t,e){for(var n,i,a,s,o,l,c=lc(r),u=typeof t=="number",h,d=[],f,v=0,g=0,p=0,y=0,b,E=[],O=[],k=0,P={x:0,y:0},F=P,B=P,V=P,U=0,J=0,$=c.length;J<$;J+=1)b=c[J],f=b[0],h=f==="M",d=h?d:[v,g].concat(b.slice(1)),h?(p=b[1],y=b[2],P={x:p,y},F=P,k=0,u&&t<.001&&(V=P)):f==="L"?(n=kd(d[0],d[1],d[2],d[3],(t||0)-U),k=n.length,P=n.min,F=n.max,B=n.point):f==="A"?(i=$w(d[0],d[1],d[2],d[3],d[4],d[5],d[6],d[7],d[8],(t||0)-U,e||{}),k=i.length,P=i.min,F=i.max,B=i.point):f==="C"?(a=Tg(d[0],d[1],d[2],d[3],d[4],d[5],d[6],d[7],(t||0)-U,e||{}),k=a.length,P=a.min,F=a.max,B=a.point):f==="Q"?(s=n2(d[0],d[1],d[2],d[3],d[4],d[5],(t||0)-U,e||{}),k=s.length,P=s.min,F=s.max,B=s.point):f==="Z"&&(d=[v,g,p,y],o=kd(d[0],d[1],d[2],d[3],(t||0)-U),k=o.length,P=o.min,F=o.max,B=o.point),u&&U<t&&U+k>=t&&(V=B),O.push(F),E.push(P),U+=k,l=f!=="Z"?b.slice(-2):[p,y],v=l[0],g=l[1];return u&&t>=U&&(V={x:v,y:g}),{length:U,point:V,min:{x:Math.min.apply(null,E.map(function(at){return at.x})),y:Math.min.apply(null,E.map(function(at){return at.y}))},max:{x:Math.max.apply(null,O.map(function(at){return at.x})),y:Math.max.apply(null,O.map(function(at){return at.y}))}}}function r2(r,t){return Og(r,void 0,(0,Z.pi)((0,Z.pi)({},t),{bbox:!1,length:!0})).length}function Kr(r){return Array.isArray(r)}var cc=function(r){if(Kr(r))return r.reduce(function(t,e){return Math.min(t,e)},r[0])};function uc(r){if(!Array.isArray(r))return-1/0;var t=r.length;if(!t)return-1/0;for(var e=r[0],n=1;n<t;n++)e=Math.max(e,r[n]);return e}var i2=1e-5;function Qo(r,t,e){return e===void 0&&(e=i2),r===t||Math.abs(r-t)<e}var a2=function(r,t){return(r%t+t)%t},Cg=a2;function s2(r,t,e){if(r[e].length>7){r[e].shift();for(var n=r[e],i=e;n.length;)t[e]="A",r.splice(i+=1,0,["C"].concat(n.splice(0,6)));r.splice(e,1)}}function o2(r){return wg(r)&&r.every(function(t){var e=t[0];return"MC".includes(e)})}function hc(r,t,e){var n=r*Math.cos(e)-t*Math.sin(e),i=r*Math.sin(e)+t*Math.cos(e);return{x:n,y:i}}function Pd(r,t,e,n,i,a,s,o,l,c){var u=r,h=t,d=e,f=n,v=o,g=l,p=Math.PI*120/180,y=Math.PI/180*(+i||0),b=[],E,O,k,P,F;if(c)O=c[0],k=c[1],P=c[2],F=c[3];else{E=hc(u,h,-y),u=E.x,h=E.y,E=hc(v,g,-y),v=E.x,g=E.y;var B=(u-v)/2,V=(h-g)/2,U=B*B/(d*d)+V*V/(f*f);U>1&&(U=Math.sqrt(U),d*=U,f*=U);var J=d*d,$=f*f,at=(a===s?-1:1)*Math.sqrt(Math.abs((J*$-J*V*V-$*B*B)/(J*V*V+$*B*B)));P=at*d*V/f+(u+v)/2,F=at*-f*B/d+(h+g)/2,O=Math.asin(((h-F)/f*Math.pow(10,9)>>0)/Math.pow(10,9)),k=Math.asin(((g-F)/f*Math.pow(10,9)>>0)/Math.pow(10,9)),O=u<P?Math.PI-O:O,k=v<P?Math.PI-k:k,O<0&&(O=Math.PI*2+O),k<0&&(k=Math.PI*2+k),s&&O>k&&(O-=Math.PI*2),!s&&k>O&&(k-=Math.PI*2)}var ct=k-O;if(Math.abs(ct)>p){var ft=k,Nt=v,Ct=g;k=O+p*(s&&k>O?1:-1),v=P+d*Math.cos(k),g=F+f*Math.sin(k),b=Pd(v,g,d,f,i,0,s,Nt,Ct,[k,ft,P,F])}ct=k-O;var gt=Math.cos(O),bt=Math.sin(O),Pt=Math.cos(k),zt=Math.sin(k),Ut=Math.tan(ct/4),$t=4/3*d*Ut,re=4/3*f*Ut,ce=[u,h],le=[u+$t*bt,h-re*gt],Ee=[v+$t*zt,g-re*Pt],Ne=[v,g];if(le[0]=2*ce[0]-le[0],le[1]=2*ce[1]-le[1],c)return le.concat(Ee,Ne,b);b=le.concat(Ee,Ne,b);for(var We=[],He=0,cr=b.length;He<cr;He+=1)We[He]=He%2?hc(b[He-1],b[He],y).y:hc(b[He],b[He+1],y).x;return We}function l2(r,t,e,n,i,a){var s=.3333333333333333,o=2/3;return[s*r+o*e,s*t+o*n,s*i+o*e,s*a+o*n,i,a]}var Ng=function(r,t,e,n){var i=.5,a=Ba([r,t],[e,n],i);return(0,Z.ev)((0,Z.ev)([],a,!0),[e,n,e,n],!1)};function c2(r,t){var e=r[0],n=r.slice(1).map(Number),i=n[0],a=n[1],s,o=t.x1,l=t.y1,c=t.x,u=t.y;switch("TQ".includes(e)||(t.qx=null,t.qy=null),e){case"M":return t.x=i,t.y=a,r;case"A":return s=[o,l].concat(n),["C"].concat(Pd(s[0],s[1],s[2],s[3],s[4],s[5],s[6],s[7],s[8],s[9]));case"Q":return t.qx=i,t.qy=a,s=[o,l].concat(n),["C"].concat(l2(s[0],s[1],s[2],s[3],s[4],s[5]));case"L":return["C"].concat(Ng(o,l,i,a));case"Z":return o===c&&l===u?["C",o,l,c,u,c,u]:["C"].concat(Ng(o,l,c,u));default:}return r}function Rd(r,t){if(t===void 0&&(t=!1),o2(r)){var e=[].concat(r);return t?[e,[]]:e}for(var n=lc(r),i=(0,Z.pi)({},Sg),a=[],s="",o=n.length,l,c,u=[],h=0;h<o;h+=1){n[h]&&(s=n[h][0]),a[h]=s;var d=c2(n[h],i);n[h]=d,s2(n,a,h),o=n.length,s==="Z"&&u.push(h),l=n[h],c=l.length,i.x1=+l[c-2],i.y1=+l[c-1],i.x2=+l[c-4]||i.x1,i.y2=+l[c-3]||i.y1}return t?[n,u]:n}var u2=50;function h2(r,t){t===void 0&&(t=.5);var e=r.slice(0,2),n=r.slice(2,4),i=r.slice(4,6),a=r.slice(6,8),s=Ba(e,n,t),o=Ba(n,i,t),l=Ba(i,a,t),c=Ba(s,o,t),u=Ba(o,l,t),h=Ba(c,u,t);return[["C"].concat(s,c,h),["C"].concat(u,l,a)]}function kg(r){return r.map(function(t,e,n){var i=e&&n[e-1].slice(-2).concat(t.slice(1)),a=e?Tg(i[0],i[1],i[2],i[3],i[4],i[5],i[6],i[7],i[8],{bbox:!1}).length:0,s;return e?s=a?h2(i):[t,t]:s=[t],{s:t,ss:s,l:a}})}function Pg(r,t,e,n){if(n===void 0&&(n=0),n>u2)return console.warn("Maximum recursion depth reached in equalizeSegments"),[r,t];var i=kg(r),a=kg(t),s=i.length,o=a.length,l=i.filter(function(y){return y.l}).length,c=a.filter(function(y){return y.l}).length,u=i.filter(function(y){return y.l}).reduce(function(y,b){var E=b.l;return y+E},0)/l||0,h=a.filter(function(y){return y.l}).reduce(function(y,b){var E=b.l;return y+E},0)/c||0,d=e||Math.max(s,o),f=[u,h],v=[d-s,d-o],g=0,p=[i,a].map(function(y,b){return y.l===d?y.map(function(E){return E.s}):y.map(function(E,O){return g=O&&v[b]&&E.l>=f[b],v[b]-=g?1:0,g?E.ss:[E.s]}).flat()});return p[0].length===p[1].length?p:Pg(p[0],p[1],d,n+1)}function d2(r,t,e,n,i,a,s,o){return 3*((o-t)*(e+i)-(s-r)*(n+a)+n*(r-i)-e*(t-a)+o*(i+r/3)-s*(a+t/3))/20}function f2(r){var t=0,e=0,n=0;return Rd(r).map(function(i){var a;switch(i[0]){case"M":return t=i[1],e=i[2],0;default:var s=i.slice(1),o=s[0],l=s[1],c=s[2],u=s[3],h=s[4],d=s[5];return n=d2(t,e,o,l,c,u,h,d),a=i.slice(-2),t=a[0],e=a[1],n}}).reduce(function(i,a){return i+a},0)}function Rg(r){return f2(r)>=0}function v2(r){var t=r.slice(1).map(function(e,n,i){return n?i[n-1].slice(-2).concat(e.slice(1)):r[0].slice(1).concat(e.slice(1))}).map(function(e){return e.map(function(n,i){return e[e.length-i-2*(1-i%2)]})}).reverse();return[["M"].concat(t[0].slice(0,2))].concat(t.map(function(e){return["C"].concat(e.slice(2))}))}function g2(r){return r.map(function(t){return Array.isArray(t)?[].concat(t):t})}function p2(r){var t=r.length,e=t-1;return r.map(function(n,i){return r.map(function(a,s){var o=i+s,l;return s===0||r[o]&&r[o][0]==="M"?(l=r[o],["M"].concat(l.slice(-2))):(o>=t&&(o-=e),r[o])})})}function m2(r,t){var e=r.length-1,n=[],i=0,a=0,s=p2(r);return s.forEach(function(o,l){r.slice(1).forEach(function(c,u){a+=Xr(r[(l+u)%e].slice(-2),t[u%e].slice(-2))}),n[l]=a,a=0}),i=n.indexOf(Math.min.apply(null,n)),s[i]}var y2=function(r){return r===void 0},Te=y2,b2={}.toString,x2=function(r,t){return b2.call(r)==="[object "+t+"]"},Lg=x2,E2=function(r){return Lg(r,"Boolean")},qo=E2;function ue(r){return typeof r=="function"}var zn=function(r){var t=typeof r;return r!==null&&t==="object"||t==="function"};function w2(r,t,e){return Og(r,t,(0,Z.pi)((0,Z.pi)({},e),{bbox:!1,length:!0})).point}var ae=S(20068);function S2(r,t){for(;!{}.hasOwnProperty.call(r,t)&&(r=(0,D.Z)(r))!==null;);return r}function Ld(){return Ld=typeof Reflect!="undefined"&&Reflect.get?Reflect.get.bind():function(r,t,e){var n=S2(r,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?r:e):i.value}},Ld.apply(null,arguments)}function _g(r,t,e,n){var i=Ld((0,D.Z)(1&n?r.prototype:r),t,e);return 2&n&&typeof i=="function"?function(a){return i.apply(e,a)}:i}function kr(r,t,e,n){var i=r-e,a=t-n;return Math.sqrt(i*i+a*a)}function dc(r,t){var e=Math.min.apply(Math,(0,N.Z)(r)),n=Math.min.apply(Math,(0,N.Z)(t)),i=Math.max.apply(Math,(0,N.Z)(r)),a=Math.max.apply(Math,(0,N.Z)(t));return{x:e,y:n,width:i-e,height:a-n}}function Dg(r){return(r+Math.PI*2)%(Math.PI*2)}function Ig(r,t){var e=Math.abs(r);return t>0?e:e*-1}function M2(r,t,e,n,i,a){var s=e,o=n;if(s===0||o===0)return{x:r,y:t};for(var l=i-r,c=a-t,u=Math.abs(l),h=Math.abs(c),d=s*s,f=o*o,v=Math.PI/4,g=0,p=0,y=0;y<4;y++){g=s*Math.cos(v),p=o*Math.sin(v);var b=(d-f)*Math.pow(Math.cos(v),3)/s,E=(f-d)*Math.pow(Math.sin(v),3)/o,O=g-b,k=p-E,P=u-b,F=h-E,B=Math.hypot(k,O),V=Math.hypot(F,P),U=B*Math.asin((O*F-k*P)/(B*V)),J=U/Math.sqrt(d+f-g*g-p*p);v+=J,v=Math.min(Math.PI/2,Math.max(0,v))}return{x:r+Ig(g,l),y:t+Ig(p,c)}}function A2(r,t,e,n,i,a,s,o){return-1*e*Math.cos(i)*Math.sin(o)-n*Math.sin(i)*Math.cos(o)}function T2(r,t,e,n,i,a,s,o){return-1*e*Math.sin(i)*Math.sin(o)+n*Math.cos(i)*Math.cos(o)}function O2(r,t,e){return Math.atan(-t/r*Math.tan(e))}function C2(r,t,e){return Math.atan(t/(r*Math.tan(e)))}function N2(r,t,e,n,i,a){return e*Math.cos(i)*Math.cos(a)-n*Math.sin(i)*Math.sin(a)+r}function k2(r,t,e,n,i,a){return e*Math.sin(i)*Math.cos(a)+n*Math.cos(i)*Math.sin(a)+t}function P2(r,t,e,n){var i=Math.atan2(n*r,e*t);return(i+Math.PI*2)%(Math.PI*2)}function Bg(r,t,e){return{x:r*Math.cos(e),y:t*Math.sin(e)}}function Fg(r,t,e){var n=Math.cos(e),i=Math.sin(e);return[r*n-t*i,r*i+t*n]}function R2(r,t,e,n,i,a,s){for(var o=O2(e,n,i),l=1/0,c=-1/0,u=[a,s],h=-Math.PI*2;h<=Math.PI*2;h+=Math.PI){var d=o+h;a<s?a<d&&d<s&&u.push(d):s<d&&d<a&&u.push(d)}for(var f=0;f<u.length;f++){var v=N2(r,t,e,n,i,u[f]);v<l&&(l=v),v>c&&(c=v)}for(var g=C2(e,n,i),p=1/0,y=-1/0,b=[a,s],E=-Math.PI*2;E<=Math.PI*2;E+=Math.PI){var O=g+E;a<s?a<O&&O<s&&b.push(O):s<O&&O<a&&b.push(O)}for(var k=0;k<b.length;k++){var P=k2(r,t,e,n,i,b[k]);P<p&&(p=P),P>y&&(y=P)}return{x:l,y:p,width:c-l,height:y-p}}function V8(r,t,e,n,i,a,s,o,l){var c=Fg(o-r,l-t,-i),u=_slicedToArray(c,2),h=u[0],d=u[1],f=M2(0,0,e,n,h,d),v=P2(e,n,f.x,f.y);v<a?f=Bg(e,n,a):v>s&&(f=Bg(e,n,s));var g=Fg(f.x,f.y,i);return{x:g[0]+r,y:g[1]+t}}function U8(r,t,e,n,i,a,s,o){var l=(s-a)*o+a,c=A2(r,t,e,n,i,a,s,l),u=T2(r,t,e,n,i,a,s,l);return Dg(Math.atan2(u,c))}var L2=1e-4;function zg(r,t,e,n,i,a){var s=-1,o=1/0,l=[e,n],c=20;a&&a>200&&(c=a/10);for(var u=1/c,h=u/10,d=0;d<=c;d++){var f=d*u,v=[i.apply(void 0,(0,N.Z)(r.concat([f]))),i.apply(void 0,(0,N.Z)(t.concat([f])))],g=kr(l[0],l[1],v[0],v[1]);g<o&&(s=f,o=g)}if(s===0)return{x:r[0],y:t[0]};if(s===1){var p=r.length;return{x:r[p-1],y:t[p-1]}}o=1/0;for(var y=0;y<32&&!(h<L2);y++){var b=s-h,E=s+h,O=[i.apply(void 0,(0,N.Z)(r.concat([b]))),i.apply(void 0,(0,N.Z)(t.concat([b])))],k=kr(l[0],l[1],O[0],O[1]);if(b>=0&&k<o)s=b,o=k;else{var P=[i.apply(void 0,(0,N.Z)(r.concat([E]))),i.apply(void 0,(0,N.Z)(t.concat([E])))],F=kr(l[0],l[1],P[0],P[1]);E<=1&&F<o?(s=E,o=F):h*=.5}}return{x:i.apply(void 0,(0,N.Z)(r.concat([s]))),y:i.apply(void 0,(0,N.Z)(t.concat([s])))}}function _2(r,t){for(var e=0,n=r.length,i=0;i<n;i++){var a=r[i],s=t[i],o=r[(i+1)%n],l=t[(i+1)%n];e+=kr(a,s,o,l)}return e/2}function Y8(r,t,e,n){return dc([r,e],[t,n])}function jg(r,t,e,n){return kr(r,t,e,n)}function $i(r,t,e,n,i){return{x:(1-i)*r+i*e,y:(1-i)*t+i*n}}function D2(r,t,e,n,i,a){var s=(e-r)*(i-r)+(n-t)*(a-t);if(s<0)return kr(r,t,i,a);var o=(e-r)*(e-r)+(n-t)*(n-t);return s>o?kr(e,n,i,a):Gg(r,t,e,n,i,a)}function Gg(r,t,e,n,i,a){var s=[e-r,n-t];if(zw(s,[0,0]))return Math.sqrt((i-r)*(i-r)+(a-t)*(a-t));var o=[-s[1],s[0]];Bw(o,o);var l=[i-r,a-t];return Math.abs(Fw(l,o))}function H8(r,t,e,n){return Math.atan2(n-t,e-r)}function fs(r,t,e,n,i){var a=1-i;return a*a*a*r+3*t*i*a*a+3*e*i*i*a+n*i*i*i}function Wg(r,t,e,n,i){var a=1-i;return 3*(a*a*(t-r)+2*a*i*(e-t)+i*i*(n-e))}function Zg(r,t,e,n){var i=-3*r+9*t-9*e+3*n,a=6*r-12*t+6*e,s=3*t-3*r,o=[],l,c,u;if(Qo(i,0))Qo(a,0)||(l=-s/a,l>=0&&l<=1&&o.push(l));else{var h=a*a-4*i*s;Qo(h,0)?o.push(-a/(2*i)):h>0&&(u=Math.sqrt(h),l=(-a+u)/(2*i),c=(-a-u)/(2*i),l>=0&&l<=1&&o.push(l),c>=0&&c<=1&&o.push(c))}return o}function I2(r,t,e,n,i,a,s,o,l){var c=fs(r,e,i,s,l),u=fs(t,n,a,o,l),h=$i(r,t,e,n,l),d=$i(e,n,i,a,l),f=$i(i,a,s,o,l),v=$i(h.x,h.y,d.x,d.y,l),g=$i(d.x,d.y,f.x,f.y,l);return[[r,t,h.x,h.y,v.x,v.y,c,u],[c,u,g.x,g.y,f.x,f.y,s,o]]}function _d(r,t,e,n,i,a,s,o,l){if(l===0)return _2([r,e,i,s],[t,n,a,o]);var c=I2(r,t,e,n,i,a,s,o,.5),u=[].concat(_toConsumableArray(c[0]),[l-1]),h=[].concat(_toConsumableArray(c[1]),[l-1]);return _d.apply(void 0,_toConsumableArray(u))+_d.apply(void 0,_toConsumableArray(h))}function B2(r,t,e,n,i,a,s,o){for(var l=[r,s],c=[t,o],u=Zg(r,e,i,s),h=Zg(t,n,a,o),d=0;d<u.length;d++)l.push(fs(r,e,i,s,u[d]));for(var f=0;f<h.length;f++)c.push(fs(t,n,a,o,h[f]));return dc(l,c)}function X8(r,t,e,n,i,a,s,o){return _d(r,t,e,n,i,a,s,o,3)}function F2(r,t,e,n,i,a,s,o,l,c,u){return zg([r,e,i,s],[t,n,a,o],l,c,fs,u)}function Vg(r,t,e,n,i,a,s,o,l,c,u){var h=F2(r,t,e,n,i,a,s,o,l,c,u);return kr(h.x,h.y,l,c)}function K8(r,t,e,n,i,a,s,o,l){return{x:fs(r,e,i,s,l),y:fs(t,n,a,o,l)}}function Q8(r,t,e,n,i,a,s,o,l){var c=Wg(r,e,i,s,l),u=Wg(t,n,a,o,l);return Dg(Math.atan2(u,c))}function Ug(r){for(var t=0,e=[],n=0;n<r.length-1;n++){var i=r[n],a=r[n+1],s=kr(i[0],i[1],a[0],a[1]),o={from:i,to:a,length:s};e.push(o),t+=s}return{segments:e,totalLength:t}}function Yg(r){if(r.length<2)return 0;for(var t=0,e=0;e<r.length-1;e++){var n=r[e],i=r[e+1];t+=kr(n[0],n[1],i[0],i[1])}return t}function Hg(r,t){if(t>1||t<0||r.length<2)return null;var e=Ug(r),n=e.segments,i=e.totalLength;if(i===0)return{x:r[0][0],y:r[0][1]};for(var a=0,s=null,o=0;o<n.length;o++){var l=n[o],c=l.from,u=l.to,h=l.length/i;if(t>=a&&t<=a+h){var d=(t-a)/h;s=$i(c[0],c[1],u[0],u[1],d);break}a+=h}return s}function Xg(r,t){if(t>1||t<0||r.length<2)return 0;for(var e=Ug(r),n=e.segments,i=e.totalLength,a=0,s=0,o=0;o<n.length;o++){var l=n[o],c=l.from,u=l.to,h=l.length/i;if(t>=a&&t<=a+h){s=Math.atan2(u[1]-c[1],u[0]-c[0]);break}a+=h}return s}function Kg(r,t,e){for(var n=1/0,i=0;i<r.length-1;i++){var a=r[i],s=r[i+1],o=D2(a[0],a[1],s[0],s[1],t,e);o<n&&(n=o)}return n}function z2(r){for(var t=[],e=[],n=0;n<r.length;n++){var i=r[n];t.push(i[0]),e.push(i[1])}return dc(t,e)}function j2(r){return Yg(r)}function q8(r,t){return Hg(r,t)}function J8(r,t,e){return Kg(r,t,e)}function $8(r,t){return Xg(r,t)}function fc(r){var t=r.slice(0);return r.length&&t.push(r[0]),t}function t9(r){return z2(r)}function e9(r){return Yg(fc(r))}function n9(r,t){return Hg(fc(r),t)}function r9(r,t,e){return Kg(fc(r),t,e)}function i9(r,t){return Xg(fc(r),t)}function Jo(r,t,e,n){var i=1-n;return i*i*r+2*n*i*t+n*n*e}function Qg(r,t,e){var n=r+e-2*t;if(Qo(n,0))return[.5];var i=(r-t)/n;return i<=1&&i>=0?[i]:[]}function G2(r,t,e,n,i,a,s){var o=Jo(r,e,i,s),l=Jo(t,n,a,s),c=$i(r,t,e,n,s),u=$i(e,n,i,a,s);return[[r,t,c.x,c.y,o,l],[o,l,u.x,u.y,i,a]]}function Dd(r,t,e,n,i,a,s){if(s===0)return(kr(r,t,e,n)+kr(e,n,i,a)+kr(r,t,i,a))/2;var o=G2(r,t,e,n,i,a,.5),l=o[0],c=o[1];return l.push(s-1),c.push(s-1),Dd.apply(void 0,_toConsumableArray(l))+Dd.apply(void 0,_toConsumableArray(c))}function W2(r,t,e,n,i,a){var s=Qg(r,e,i)[0],o=Qg(t,n,a)[0],l=[r,i],c=[t,a];return s!==void 0&&l.push(Jo(r,e,i,s)),o!==void 0&&c.push(Jo(t,n,a,o)),dc(l,c)}function a9(r,t,e,n,i,a){return Dd(r,t,e,n,i,a,3)}function Z2(r,t,e,n,i,a,s,o){return zg([r,e,i],[t,n,a],s,o,Jo)}function V2(r,t,e,n,i,a,s,o){var l=Z2(r,t,e,n,i,a,s,o);return kr(l.x,l.y,s,o)}var Pr=S(75044),Fa=S(3202),U2=S(3208);function vs(r,t){var e=typeof Symbol!="undefined"&&r[Symbol.iterator]||r["@@iterator"];if(!e){if(Array.isArray(r)||(e=(0,U2.Z)(r))||t&&r&&typeof r.length=="number"){e&&(r=e);var n=0,i=function(){};return{s:i,n:function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]}},e:function(c){throw c},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,s=!0,o=!1;return{s:function(){e=e.call(r)},n:function(){var c=e.next();return s=c.done,c},e:function(c){o=!0,a=c},f:function(){try{s||e.return==null||e.return()}finally{if(o)throw a}}}}var gs=S(75931);var Y2=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof S.g!="undefined"?S.g:typeof self!="undefined"?self:{},qg={exports:{}};(function(r,t){(function(e,n){r.exports=n()})(Y2,function(){function e(k,P,F,B,V){n(k,P,F||0,B||k.length-1,V||a)}function n(k,P,F,B,V){for(;B>F;){if(B-F>600){var U=B-F+1,J=P-F+1,$=Math.log(U),at=.5*Math.exp(2*$/3),ct=.5*Math.sqrt($*at*(U-at)/U)*(J-U/2<0?-1:1),ft=Math.max(F,Math.floor(P-J*at/U+ct)),Nt=Math.min(B,Math.floor(P+(U-J)*at/U+ct));n(k,P,ft,Nt,V)}var Ct=k[P],gt=F,bt=B;for(i(k,F,P),V(k[B],Ct)>0&&i(k,F,B);gt<bt;){for(i(k,gt,bt),gt++,bt--;V(k[gt],Ct)<0;)gt++;for(;V(k[bt],Ct)>0;)bt--}V(k[F],Ct)===0?i(k,F,bt):(bt++,i(k,bt,B)),bt<=P&&(F=bt+1),P<=bt&&(B=bt-1)}}function i(k,P,F){var B=k[P];k[P]=k[F],k[F]=B}function a(k,P){return k<P?-1:k>P?1:0}var s=function(P){P===void 0&&(P=9),this._maxEntries=Math.max(4,P),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()};s.prototype.all=function(){return this._all(this.data,[])},s.prototype.search=function(P){var F=this.data,B=[];if(!b(P,F))return B;for(var V=this.toBBox,U=[];F;){for(var J=0;J<F.children.length;J++){var $=F.children[J],at=F.leaf?V($):$;b(P,at)&&(F.leaf?B.push($):y(P,at)?this._all($,B):U.push($))}F=U.pop()}return B},s.prototype.collides=function(P){var F=this.data;if(!b(P,F))return!1;for(var B=[];F;){for(var V=0;V<F.children.length;V++){var U=F.children[V],J=F.leaf?this.toBBox(U):U;if(b(P,J)){if(F.leaf||y(P,J))return!0;B.push(U)}}F=B.pop()}return!1},s.prototype.load=function(P){if(!(P&&P.length))return this;if(P.length<this._minEntries){for(var F=0;F<P.length;F++)this.insert(P[F]);return this}var B=this._build(P.slice(),0,P.length-1,0);if(!this.data.children.length)this.data=B;else if(this.data.height===B.height)this._splitRoot(this.data,B);else{if(this.data.height<B.height){var V=this.data;this.data=B,B=V}this._insert(B,this.data.height-B.height-1,!0)}return this},s.prototype.insert=function(P){return P&&this._insert(P,this.data.height-1),this},s.prototype.clear=function(){return this.data=E([]),this},s.prototype.remove=function(P,F){if(!P)return this;for(var B=this.data,V=this.toBBox(P),U=[],J=[],$,at,ct;B||U.length;){if(B||(B=U.pop(),at=U[U.length-1],$=J.pop(),ct=!0),B.leaf){var ft=o(P,B.children,F);if(ft!==-1)return B.children.splice(ft,1),U.push(B),this._condense(U),this}!ct&&!B.leaf&&y(B,V)?(U.push(B),J.push($),$=0,at=B,B=B.children[0]):at?($++,B=at.children[$],ct=!1):B=null}return this},s.prototype.toBBox=function(P){return P},s.prototype.compareMinX=function(P,F){return P.minX-F.minX},s.prototype.compareMinY=function(P,F){return P.minY-F.minY},s.prototype.toJSON=function(){return this.data},s.prototype.fromJSON=function(P){return this.data=P,this},s.prototype._all=function(P,F){for(var B=[];P;)P.leaf?F.push.apply(F,P.children):B.push.apply(B,P.children),P=B.pop();return F},s.prototype._build=function(P,F,B,V){var U=B-F+1,J=this._maxEntries,$;if(U<=J)return $=E(P.slice(F,B+1)),l($,this.toBBox),$;V||(V=Math.ceil(Math.log(U)/Math.log(J)),J=Math.ceil(U/Math.pow(J,V-1))),$=E([]),$.leaf=!1,$.height=V;var at=Math.ceil(U/J),ct=at*Math.ceil(Math.sqrt(J));O(P,F,B,ct,this.compareMinX);for(var ft=F;ft<=B;ft+=ct){var Nt=Math.min(ft+ct-1,B);O(P,ft,Nt,at,this.compareMinY);for(var Ct=ft;Ct<=Nt;Ct+=at){var gt=Math.min(Ct+at-1,Nt);$.children.push(this._build(P,Ct,gt,V-1))}}return l($,this.toBBox),$},s.prototype._chooseSubtree=function(P,F,B,V){for(;V.push(F),!(F.leaf||V.length-1===B);){for(var U=1/0,J=1/0,$=void 0,at=0;at<F.children.length;at++){var ct=F.children[at],ft=f(ct),Nt=g(P,ct)-ft;Nt<J?(J=Nt,U=ft<U?ft:U,$=ct):Nt===J&&ft<U&&(U=ft,$=ct)}F=$||F.children[0]}return F},s.prototype._insert=function(P,F,B){var V=B?P:this.toBBox(P),U=[],J=this._chooseSubtree(V,this.data,F,U);for(J.children.push(P),u(J,V);F>=0&&U[F].children.length>this._maxEntries;)this._split(U,F),F--;this._adjustParentBBoxes(V,U,F)},s.prototype._split=function(P,F){var B=P[F],V=B.children.length,U=this._minEntries;this._chooseSplitAxis(B,U,V);var J=this._chooseSplitIndex(B,U,V),$=E(B.children.splice(J,B.children.length-J));$.height=B.height,$.leaf=B.leaf,l(B,this.toBBox),l($,this.toBBox),F?P[F-1].children.push($):this._splitRoot(B,$)},s.prototype._splitRoot=function(P,F){this.data=E([P,F]),this.data.height=P.height+1,this.data.leaf=!1,l(this.data,this.toBBox)},s.prototype._chooseSplitIndex=function(P,F,B){for(var V,U=1/0,J=1/0,$=F;$<=B-F;$++){var at=c(P,0,$,this.toBBox),ct=c(P,$,B,this.toBBox),ft=p(at,ct),Nt=f(at)+f(ct);ft<U?(U=ft,V=$,J=Nt<J?Nt:J):ft===U&&Nt<J&&(J=Nt,V=$)}return V||B-F},s.prototype._chooseSplitAxis=function(P,F,B){var V=P.leaf?this.compareMinX:h,U=P.leaf?this.compareMinY:d,J=this._allDistMargin(P,F,B,V),$=this._allDistMargin(P,F,B,U);J<$&&P.children.sort(V)},s.prototype._allDistMargin=function(P,F,B,V){P.children.sort(V);for(var U=this.toBBox,J=c(P,0,F,U),$=c(P,B-F,B,U),at=v(J)+v($),ct=F;ct<B-F;ct++){var ft=P.children[ct];u(J,P.leaf?U(ft):ft),at+=v(J)}for(var Nt=B-F-1;Nt>=F;Nt--){var Ct=P.children[Nt];u($,P.leaf?U(Ct):Ct),at+=v($)}return at},s.prototype._adjustParentBBoxes=function(P,F,B){for(var V=B;V>=0;V--)u(F[V],P)},s.prototype._condense=function(P){for(var F=P.length-1,B=void 0;F>=0;F--)P[F].children.length===0?F>0?(B=P[F-1].children,B.splice(B.indexOf(P[F]),1)):this.clear():l(P[F],this.toBBox)};function o(k,P,F){if(!F)return P.indexOf(k);for(var B=0;B<P.length;B++)if(F(k,P[B]))return B;return-1}function l(k,P){c(k,0,k.children.length,P,k)}function c(k,P,F,B,V){V||(V=E(null)),V.minX=1/0,V.minY=1/0,V.maxX=-1/0,V.maxY=-1/0;for(var U=P;U<F;U++){var J=k.children[U];u(V,k.leaf?B(J):J)}return V}function u(k,P){return k.minX=Math.min(k.minX,P.minX),k.minY=Math.min(k.minY,P.minY),k.maxX=Math.max(k.maxX,P.maxX),k.maxY=Math.max(k.maxY,P.maxY),k}function h(k,P){return k.minX-P.minX}function d(k,P){return k.minY-P.minY}function f(k){return(k.maxX-k.minX)*(k.maxY-k.minY)}function v(k){return k.maxX-k.minX+(k.maxY-k.minY)}function g(k,P){return(Math.max(P.maxX,k.maxX)-Math.min(P.minX,k.minX))*(Math.max(P.maxY,k.maxY)-Math.min(P.minY,k.minY))}function p(k,P){var F=Math.max(k.minX,P.minX),B=Math.max(k.minY,P.minY),V=Math.min(k.maxX,P.maxX),U=Math.min(k.maxY,P.maxY);return Math.max(0,V-F)*Math.max(0,U-B)}function y(k,P){return k.minX<=P.minX&&k.minY<=P.minY&&P.maxX<=k.maxX&&P.maxY<=k.maxY}function b(k,P){return P.minX<=k.maxX&&P.minY<=k.maxY&&P.maxX>=k.minX&&P.maxY>=k.minY}function E(k){return{children:k,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function O(k,P,F,B,V){for(var U=[P,F];U.length;)if(F=U.pop(),P=U.pop(),!(F-P<=B)){var J=P+Math.ceil((F-P)/B/2)*B;e(k,J,P,F,V),U.push(P,J,J,F)}}return s})})(qg);var H2=qg.exports,Dt=function(r){return r.GROUP="g",r.FRAGMENT="fragment",r.CIRCLE="circle",r.ELLIPSE="ellipse",r.IMAGE="image",r.RECT="rect",r.LINE="line",r.POLYLINE="polyline",r.POLYGON="polygon",r.TEXT="text",r.PATH="path",r.HTML="html",r.MESH="mesh",r}({}),vc=function(r){return r[r.ZERO=0]="ZERO",r[r.NEGATIVE_ONE=1]="NEGATIVE_ONE",r}({}),za=function(){function r(){(0,C.Z)(this,r),this.plugins=[]}return(0,T.Z)(r,[{key:"addRenderingPlugin",value:function(e){this.plugins.push(e),this.context.renderingPlugins.push(e)}},{key:"removeAllRenderingPlugins",value:function(){var e=this;this.plugins.forEach(function(n){var i=e.context.renderingPlugins.indexOf(n);i>=0&&e.context.renderingPlugins.splice(i,1)})}}])}(),X2=function(){function r(t){(0,C.Z)(this,r),this.clipSpaceNearZ=vc.NEGATIVE_ONE,this.plugins=[],this.config=(0,z.Z)({enableDirtyCheck:!0,enableCulling:!1,enableAutoRendering:!0,enableDirtyRectangleRendering:!0,enableDirtyRectangleRenderingDebug:!1,enableSizeAttenuation:!0,enableRenderingOptimization:!1},t)}return(0,T.Z)(r,[{key:"registerPlugin",value:function(e){var n=this.plugins.findIndex(function(i){return i===e});n===-1&&this.plugins.push(e)}},{key:"unregisterPlugin",value:function(e){var n=this.plugins.findIndex(function(i){return i===e});n>-1&&this.plugins.splice(n,1)}},{key:"getPlugins",value:function(){return this.plugins}},{key:"getPlugin",value:function(e){return this.plugins.find(function(n){return n.name===e})}},{key:"getConfig",value:function(){return this.config}},{key:"setConfig",value:function(e){Object.assign(this.config,e)}}])}(),Id=we,so=Ht,K2=_t,Q2=Rt,Jg=dt,Bd=eo,yn=function(){function r(){(0,C.Z)(this,r),this.center=[0,0,0],this.halfExtents=[0,0,0],this.min=[0,0,0],this.max=[0,0,0]}return(0,T.Z)(r,[{key:"update",value:function(e,n){so(this.center,e),so(this.halfExtents,n),Bd(this.min,this.center,this.halfExtents),Id(this.max,this.center,this.halfExtents)}},{key:"setMinMax",value:function(e,n){Id(this.center,n,e),Jg(this.center,this.center,.5),Bd(this.halfExtents,n,e),Jg(this.halfExtents,this.halfExtents,.5),so(this.min,e),so(this.max,n)}},{key:"getMin",value:function(){return this.min}},{key:"getMax",value:function(){return this.max}},{key:"add",value:function(e){if(!r.isEmpty(e)){if(r.isEmpty(this)){this.setMinMax(e.getMin(),e.getMax());return}var n=this.center,i=n[0],a=n[1],s=n[2],o=this.halfExtents,l=o[0],c=o[1],u=o[2],h=i-l,d=i+l,f=a-c,v=a+c,g=s-u,p=s+u,y=e.center,b=y[0],E=y[1],O=y[2],k=e.halfExtents,P=k[0],F=k[1],B=k[2],V=b-P,U=b+P,J=E-F,$=E+F,at=O-B,ct=O+B;V<h&&(h=V),U>d&&(d=U),J<f&&(f=J),$>v&&(v=$),at<g&&(g=at),ct>p&&(p=ct),n[0]=(h+d)*.5,n[1]=(f+v)*.5,n[2]=(g+p)*.5,o[0]=(d-h)*.5,o[1]=(v-f)*.5,o[2]=(p-g)*.5,this.min[0]=h,this.min[1]=f,this.min[2]=g,this.max[0]=d,this.max[1]=v,this.max[2]=p}}},{key:"setFromTransformedAABB",value:function(e,n){var i=this.center,a=this.halfExtents,s=e.center,o=e.halfExtents,l=n[0],c=n[4],u=n[8],h=n[1],d=n[5],f=n[9],v=n[2],g=n[6],p=n[10],y=Math.abs(l),b=Math.abs(c),E=Math.abs(u),O=Math.abs(h),k=Math.abs(d),P=Math.abs(f),F=Math.abs(v),B=Math.abs(g),V=Math.abs(p);i[0]=n[12]+l*s[0]+c*s[1]+u*s[2],i[1]=n[13]+h*s[0]+d*s[1]+f*s[2],i[2]=n[14]+v*s[0]+g*s[1]+p*s[2],a[0]=y*o[0]+b*o[1]+E*o[2],a[1]=O*o[0]+k*o[1]+P*o[2],a[2]=F*o[0]+B*o[1]+V*o[2],Bd(this.min,i,a),Id(this.max,i,a)}},{key:"intersects",value:function(e){var n=this.getMax(),i=this.getMin(),a=e.getMax(),s=e.getMin();return i[0]<=a[0]&&n[0]>=s[0]&&i[1]<=a[1]&&n[1]>=s[1]&&i[2]<=a[2]&&n[2]>=s[2]}},{key:"intersection",value:function(e){if(!this.intersects(e))return null;var n=new r,i=K2([0,0,0],this.getMin(),e.getMin()),a=Q2([0,0,0],this.getMax(),e.getMax());return n.setMinMax(i,a),n}},{key:"getNegativeFarPoint",value:function(e){return e.pnVertexFlag===273?so([0,0,0],this.min):e.pnVertexFlag===272?[this.min[0],this.min[1],this.max[2]]:e.pnVertexFlag===257?[this.min[0],this.max[1],this.min[2]]:e.pnVertexFlag===256?[this.min[0],this.max[1],this.max[2]]:e.pnVertexFlag===17?[this.max[0],this.min[1],this.min[2]]:e.pnVertexFlag===16?[this.max[0],this.min[1],this.max[2]]:e.pnVertexFlag===1?[this.max[0],this.max[1],this.min[2]]:[this.max[0],this.max[1],this.max[2]]}},{key:"getPositiveFarPoint",value:function(e){return e.pnVertexFlag===273?so([0,0,0],this.max):e.pnVertexFlag===272?[this.max[0],this.max[1],this.min[2]]:e.pnVertexFlag===257?[this.max[0],this.min[1],this.max[2]]:e.pnVertexFlag===256?[this.max[0],this.min[1],this.min[2]]:e.pnVertexFlag===17?[this.min[0],this.max[1],this.max[2]]:e.pnVertexFlag===16?[this.min[0],this.max[1],this.min[2]]:e.pnVertexFlag===1?[this.min[0],this.min[1],this.max[2]]:[this.min[0],this.min[1],this.min[2]]}}],[{key:"isEmpty",value:function(e){return!e||e.halfExtents[0]===0&&e.halfExtents[1]===0&&e.halfExtents[2]===0}}])}(),q2=function(){function r(t,e){(0,C.Z)(this,r),this.distance=t||0,this.normal=e||jt(0,1,0),this.updatePNVertexFlag()}return(0,T.Z)(r,[{key:"updatePNVertexFlag",value:function(){this.pnVertexFlag=(+(this.normal[0]>=0)<<8)+(+(this.normal[1]>=0)<<4)+ +(this.normal[2]>=0)}},{key:"distanceToPoint",value:function(e){return Ve(e,this.normal)-this.distance}},{key:"normalize",value:function(){var e=1/Or(this.normal);dt(this.normal,this.normal,e),this.distance*=e}},{key:"intersectsLine",value:function(e,n,i){var a=this.distanceToPoint(e),s=this.distanceToPoint(n),o=a/(a-s),l=o>=0&&o<=1;return l&&i&&Ce(i,e,n,o),l}}])}(),oo=function(r){return r[r.OUTSIDE=4294967295]="OUTSIDE",r[r.INSIDE=0]="INSIDE",r[r.INDETERMINATE=2147483647]="INDETERMINATE",r}({}),J2=function(){function r(t){if((0,C.Z)(this,r),this.planes=[],t)this.planes=t;else for(var e=0;e<6;e++)this.planes.push(new q2)}return(0,T.Z)(r,[{key:"extractFromVPMatrix",value:function(e){var n=(0,G.Z)(e,16),i=n[0],a=n[1],s=n[2],o=n[3],l=n[4],c=n[5],u=n[6],h=n[7],d=n[8],f=n[9],v=n[10],g=n[11],p=n[12],y=n[13],b=n[14],E=n[15];fe(this.planes[0].normal,o-i,h-l,g-d),this.planes[0].distance=E-p,fe(this.planes[1].normal,o+i,h+l,g+d),this.planes[1].distance=E+p,fe(this.planes[2].normal,o+a,h+c,g+f),this.planes[2].distance=E+y,fe(this.planes[3].normal,o-a,h-c,g-f),this.planes[3].distance=E-y,fe(this.planes[4].normal,o-s,h-u,g-v),this.planes[4].distance=E-b,fe(this.planes[5].normal,o+s,h+u,g+v),this.planes[5].distance=E+b,this.planes.forEach(function(O){O.normalize(),O.updatePNVertexFlag()})}}])}(),yr=function(){function r(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;(0,C.Z)(this,r),this.x=0,this.y=0,this.x=t,this.y=e}return(0,T.Z)(r,[{key:"clone",value:function(){return new r(this.x,this.y)}},{key:"copyFrom",value:function(e){this.x=e.x,this.y=e.y}}])}(),lo=function(){function r(t,e,n,i){(0,C.Z)(this,r),this.x=t,this.y=e,this.width=n,this.height=i,this.left=t,this.right=t+n,this.top=e,this.bottom=e+i}return(0,T.Z)(r,[{key:"toJSON",value:function(){}}],[{key:"fromRect",value:function(e){return new r(e.x,e.y,e.width,e.height)}},{key:"applyTransform",value:function(e,n){var i=wi(e.x,e.y,0,1),a=wi(e.x+e.width,e.y,0,1),s=wi(e.x,e.y+e.height,0,1),o=wi(e.x+e.width,e.y+e.height,0,1),l=Kn(),c=Kn(),u=Kn(),h=Kn();nt(l,i,n),nt(c,a,n),nt(u,s,n),nt(h,o,n);var d=Math.min(l[0],c[0],u[0],h[0]),f=Math.min(l[1],c[1],u[1],h[1]),v=Math.max(l[0],c[0],u[0],h[0]),g=Math.max(l[1],c[1],u[1],h[1]);return r.fromRect({x:d,y:f,width:v-d,height:g-f})}}])}(),ln="Method not implemented.",co="Use document.documentElement instead.",$2="Cannot append a destroyed element.";function uo(r){return r===void 0?0:r>360||r<-360?r%360:r}var Fd=xt();function zr(r){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0;return Array.isArray(r)&&r.length===3?n?kt(r):Ht(Fd,r):ie(r)?n?jt(r,t,e):fe(Fd,r,t,e):n?jt(r[0],r[1]||t,r[2]||e):fe(Fd,r[0],r[1]||t,r[2]||e)}var tS=Math.PI/180;function cn(r){return r*tS}var eS=180/Math.PI;function Qr(r){return r*eS}var nS=.9;function s9(r){return r%=400,r<0&&(r+=400),r*nS}function o9(r){return r/360}function rS(r){return 360*r}var gc=Math.PI/2;function iS(r,t){var e=t[0],n=t[1],i=t[2],a=t[3],s=e*e,o=n*n,l=i*i,c=a*a,u=s+o+l+c,h=e*a-n*i;return h>.499995*u?(r[0]=gc,r[1]=2*Math.atan2(n,e),r[2]=0):h<-.499995*u?(r[0]=-gc,r[1]=2*Math.atan2(n,e),r[2]=0):(r[0]=Math.asin(2*(e*i-a*n)),r[1]=Math.atan2(2*(e*a+n*i),1-2*(l+c)),r[2]=Math.atan2(2*(e*n+i*a),1-2*(o+l))),r}function aS(r,t){var e,n,i=_a(xt(),t),a=(0,G.Z)(i,3),s=a[0],o=a[1],l=a[2],c=Math.asin(-t[2]/s);return c<gc?c>-gc?(e=Math.atan2(t[6]/o,t[10]/l),n=Math.atan2(t[1]/s,t[0]/s)):(n=0,e=-Math.atan2(t[4]/o,t[5]/o)):(n=0,e=Math.atan2(t[4]/o,t[5]/o)),r[0]=e,r[1]=c,r[2]=n,r}function zd(r,t){return t.length===16?aS(r,t):iS(r,t)}function sS(r,t,e,n,i){var a=Math.cos(r),s=Math.sin(r);return Cw(n*a,i*s,0,-n*s,i*a,0,t,e,1)}function oS(r,t,e,n,i,a,s){var o=arguments.length>7&&arguments[7]!==void 0?arguments[7]:!1,l=2*a,c=e-t,u=n-i,h=l/c,d=l/u,f=(e+t)/c,v=(n+i)/u,g,p,y=s-a,b=s*a;return o?(g=-s/y,p=-b/y):(g=-(s+a)/y,p=-2*b/y),r[0]=h,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=d,r[6]=0,r[7]=0,r[8]=f,r[9]=v,r[10]=g,r[11]=-1,r[12]=0,r[13]=0,r[14]=p,r[15]=0,r}function $g(r){var t=r[0],e=r[1],n=r[3],i=r[4],a=Math.sqrt(t*t+e*e),s=Math.sqrt(n*n+i*i),o=t*i-e*n;if(o<0&&(t<i?a=-a:s=-s),a){var l=1/a;t*=l,e*=l}if(s){var c=1/s;n*=c,i*=c}var u=Math.atan2(e,t),h=Qr(u);return[r[6],r[7],a,s,h]}var ta=oe(),Ii=oe(),$o=Kn(),Me=[xt(),xt(),xt()],tp=xt();function lS(r,t,e,n,i,a){if(!cS(ta,r)||(me(Ii,ta),Ii[3]=0,Ii[7]=0,Ii[11]=0,Ii[15]=1,Math.abs(pn(Ii))<1e-8))return!1;var s=ta[3],o=ta[7],l=ta[11],c=ta[12],u=ta[13],h=ta[14],d=ta[15];if(s!==0||o!==0||l!==0){$o[0]=s,$o[1]=o,$o[2]=l,$o[3]=d;var f=ee(Ii,Ii);if(!f)return!1;Yt(Ii,Ii),nt(i,$o,Ii)}else i[0]=i[1]=i[2]=0,i[3]=1;if(t[0]=c,t[1]=u,t[2]=h,uS(Me,ta),e[0]=Gt(Me[0]),ke(Me[0],Me[0]),n[0]=Ve(Me[0],Me[1]),jd(Me[1],Me[1],Me[0],1,-n[0]),e[1]=Gt(Me[1]),ke(Me[1],Me[1]),n[0]/=e[1],n[1]=Ve(Me[0],Me[2]),jd(Me[2],Me[2],Me[0],1,-n[1]),n[2]=Ve(Me[1],Me[2]),jd(Me[2],Me[2],Me[1],1,-n[2]),e[2]=Gt(Me[2]),ke(Me[2],Me[2]),n[1]/=e[2],n[2]/=e[2],vn(tp,Me[1],Me[2]),Ve(Me[0],tp)<0)for(var v=0;v<3;v++)e[v]*=-1,Me[v][0]*=-1,Me[v][1]*=-1,Me[v][2]*=-1;return a[0]=.5*Math.sqrt(Math.max(1+Me[0][0]-Me[1][1]-Me[2][2],0)),a[1]=.5*Math.sqrt(Math.max(1-Me[0][0]+Me[1][1]-Me[2][2],0)),a[2]=.5*Math.sqrt(Math.max(1-Me[0][0]-Me[1][1]+Me[2][2],0)),a[3]=.5*Math.sqrt(Math.max(1+Me[0][0]+Me[1][1]+Me[2][2],0)),Me[2][1]>Me[1][2]&&(a[0]=-a[0]),Me[0][2]>Me[2][0]&&(a[1]=-a[1]),Me[1][0]>Me[0][1]&&(a[2]=-a[2]),!0}function cS(r,t){var e=t[15];if(e===0)return!1;for(var n=1/e,i=0;i<16;i++)r[i]=t[i]*n;return!0}function uS(r,t){r[0][0]=t[0],r[0][1]=t[1],r[0][2]=t[2],r[1][0]=t[4],r[1][1]=t[5],r[1][2]=t[6],r[2][0]=t[8],r[2][1]=t[9],r[2][2]=t[10]}function jd(r,t,e,n,i){r[0]=t[0]*n+e[0]*i,r[1]=t[1]*n+e[1]*i,r[2]=t[2]*n+e[2]*i}var un=function(r){return r[r.ORBITING=0]="ORBITING",r[r.EXPLORING=1]="EXPLORING",r[r.TRACKING=2]="TRACKING",r}({}),Gd=function(r){return r[r.DEFAULT=0]="DEFAULT",r[r.ROTATIONAL=1]="ROTATIONAL",r[r.TRANSLATIONAL=2]="TRANSLATIONAL",r[r.CINEMATIC=3]="CINEMATIC",r}({}),Mi=function(r){return r[r.ORTHOGRAPHIC=0]="ORTHOGRAPHIC",r[r.PERSPECTIVE=1]="PERSPECTIVE",r}({}),ep={UPDATED:"updated"},np=2e-4,rp=function(){function r(){(0,C.Z)(this,r),this.clipSpaceNearZ=vc.NEGATIVE_ONE,this.eventEmitter=new X,this.matrix=oe(),this.right=jt(1,0,0),this.up=jt(0,1,0),this.forward=jt(0,0,1),this.position=jt(0,0,1),this.focalPoint=jt(0,0,0),this.distanceVector=jt(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=oe(),this.projectionMatrixInverse=oe(),this.jitteredProjectionMatrix=void 0,this.enableUpdate=!0,this.type=un.EXPLORING,this.trackingMode=Gd.DEFAULT,this.projectionMode=Mi.PERSPECTIVE,this.frustum=new J2,this.orthoMatrix=oe()}return(0,T.Z)(r,[{key:"isOrtho",value:function(){return this.projectionMode===Mi.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(e){this.enableUpdate=e}},{key:"setType",value:function(e,n){return this.type=e,this.type===un.EXPLORING?this.setWorldRotation(!0):this.setWorldRotation(!1),this._getAngles(),this.type===un.TRACKING&&n!==void 0&&this.setTrackingMode(n),this}},{key:"setProjectionMode",value:function(e){return this.projectionMode=e,this}},{key:"setTrackingMode",value:function(e){if(this.type!==un.TRACKING)throw new Error("Impossible to set a tracking mode if the camera is not of tracking type");return this.trackingMode=e,this}},{key:"setWorldRotation",value:function(e){return this.rotateWorld=e,this._getAngles(),this}},{key:"getViewTransform",value:function(){return ee(oe(),this.matrix)}},{key:"getWorldTransform",value:function(){return this.matrix}},{key:"jitterProjectionMatrix",value:function(e,n){var i=hr(oe(),[e,n,0]);this.jitteredProjectionMatrix=Re(oe(),i,this.projectionMatrix)}},{key:"clearJitterProjectionMatrix",value:function(){this.jitteredProjectionMatrix=void 0}},{key:"setMatrix",value:function(e){return this.matrix=e,this._update(),this}},{key:"setProjectionMatrix",value:function(e){this.projectionMatrix=e}},{key:"setFov",value:function(e){return this.setPerspective(this.near,this.far,e,this.aspect),this}},{key:"setAspect",value:function(e){return this.setPerspective(this.near,this.far,this.fov,e),this}},{key:"setNear",value:function(e){return this.projectionMode===Mi.PERSPECTIVE?this.setPerspective(e,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,e,this.far),this}},{key:"setFar",value:function(e){return this.projectionMode===Mi.PERSPECTIVE?this.setPerspective(this.near,e,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,e),this}},{key:"setViewOffset",value:function(e,n,i,a,s,o){return this.aspect=e/n,this.view===void 0&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=n,this.view.offsetX=i,this.view.offsetY=a,this.view.width=s,this.view.height=o,this.projectionMode===Mi.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 this.view!==void 0&&(this.view.enabled=!1),this.projectionMode===Mi.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(e){return this.zoom=e,this.projectionMode===Mi.ORTHOGRAPHIC?this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far):this.projectionMode===Mi.PERSPECTIVE&&this.setPerspective(this.near,this.far,this.fov,this.aspect),this}},{key:"setZoomByViewportPoint",value:function(e,n){var i=this.canvas.viewport2Canvas({x:n[0],y:n[1]}),a=i.x,s=i.y,o=this.roll;this.rotate(0,0,-o),this.setPosition(a,s),this.setFocalPoint(a,s),this.setZoom(e),this.rotate(0,0,o);var l=this.canvas.viewport2Canvas({x:n[0],y:n[1]}),c=l.x,u=l.y,h=jt(c-a,u-s,0),d=Ve(h,this.right)/Gt(this.right),f=Ve(h,this.up)/Gt(this.up),v=this.getPosition(),g=(0,G.Z)(v,2),p=g[0],y=g[1],b=this.getFocalPoint(),E=(0,G.Z)(b,2),O=E[0],k=E[1];return this.setPosition(p-d,y-f),this.setFocalPoint(O-d,k-f),this}},{key:"setPerspective",value:function(e,n,i,a){var s;this.projectionMode=Mi.PERSPECTIVE,this.fov=i,this.near=e,this.far=n,this.aspect=a;var o=this.near*Math.tan(cn(.5*this.fov))/this.zoom,l=2*o,c=this.aspect*l,u=-.5*c;if((s=this.view)!==null&&s!==void 0&&s.enabled){var h=this.view.fullWidth,d=this.view.fullHeight;u+=this.view.offsetX*c/h,o-=this.view.offsetY*l/d,c*=this.view.width/h,l*=this.view.height/d}return oS(this.projectionMatrix,u,u+c,o-l,o,e,this.far,this.clipSpaceNearZ===vc.ZERO),ee(this.projectionMatrixInverse,this.projectionMatrix),this.triggerUpdate(),this}},{key:"setOrthographic",value:function(e,n,i,a,s,o){var l;this.projectionMode=Mi.ORTHOGRAPHIC,this.rright=n,this.left=e,this.top=i,this.bottom=a,this.near=s,this.far=o;var c=(this.rright-this.left)/(2*this.zoom),u=(this.top-this.bottom)/(2*this.zoom),h=(this.rright+this.left)/2,d=(this.top+this.bottom)/2,f=h-c,v=h+c,g=d+u,p=d-u;if((l=this.view)!==null&&l!==void 0&&l.enabled){var y=(this.rright-this.left)/this.view.fullWidth/this.zoom,b=(this.top-this.bottom)/this.view.fullHeight/this.zoom;f+=y*this.view.offsetX,v=f+y*this.view.width,g-=b*this.view.offsetY,p=g-b*this.view.height}return this.clipSpaceNearZ===vc.NEGATIVE_ONE?dg(this.projectionMatrix,f,v,g,p,s,o):fg(this.projectionMatrix,f,v,g,p,s,o),ee(this.projectionMatrixInverse,this.projectionMatrix),this._getOrthoMatrix(),this.triggerUpdate(),this}},{key:"setPosition",value:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.position[1],i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.position[2],a=zr(e,n,i);return this._setPosition(a),this.setFocalPoint(this.focalPoint),this.triggerUpdate(),this}},{key:"setFocalPoint",value:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.focalPoint[1],i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.focalPoint[2],a=jt(0,1,0);if(this.focalPoint=zr(e,n,i),this.trackingMode===Gd.CINEMATIC){var s=Xe(xt(),this.focalPoint,this.position);e=s[0],n=s[1],i=s[2];var o=Gt(s),l=Qr(Math.asin(n/o)),c=90+Qr(Math.atan2(i,e)),u=oe();_n(u,u,cn(c)),Hr(u,u,cn(l)),a=Sn(xt(),[0,1,0],u)}return ee(this.matrix,vg(oe(),this.position,this.focalPoint,a)),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(e){if(this.distance===e||e<0)return this;this.distance=e,this.distance<np&&(this.distance=np),this.dollyingStep=this.distance/100;var n=xt();e=this.distance;var i=this.forward,a=this.focalPoint;return n[0]=e*i[0]+a[0],n[1]=e*i[1]+a[1],n[2]=e*i[2]+a[2],this._setPosition(n),this.triggerUpdate(),this}},{key:"setMaxDistance",value:function(e){return this.maxDistance=e,this}},{key:"setMinDistance",value:function(e){return this.minDistance=e,this}},{key:"setAzimuth",value:function(e){return this.azimuth=uo(e),this.computeMatrix(),this._getAxes(),this.type===un.ORBITING||this.type===un.EXPLORING?this._getPosition():this.type===un.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this}},{key:"getAzimuth",value:function(){return this.azimuth}},{key:"setElevation",value:function(e){return this.elevation=uo(e),this.computeMatrix(),this._getAxes(),this.type===un.ORBITING||this.type===un.EXPLORING?this._getPosition():this.type===un.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this}},{key:"getElevation",value:function(){return this.elevation}},{key:"setRoll",value:function(e){return this.roll=uo(e),this.computeMatrix(),this._getAxes(),this.type===un.ORBITING||this.type===un.EXPLORING?this._getPosition():this.type===un.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 e=Da(qn(),[0,0,1],cn(this.roll));Et(this.matrix);var n=Da(qn(),[1,0,0],cn((this.rotateWorld&&this.type!==un.TRACKING||this.type===un.TRACKING?1:-1)*this.elevation)),i=Da(qn(),[0,1,0],cn((this.rotateWorld&&this.type!==un.TRACKING||this.type===un.TRACKING?1:-1)*this.azimuth)),a=Ia(qn(),i,n);a=Ia(qn(),a,e);var s=Xo(oe(),a);this.type===un.ORBITING||this.type===un.EXPLORING?(Je(this.matrix,this.matrix,this.focalPoint),Re(this.matrix,this.matrix,s),Je(this.matrix,this.matrix,[0,0,this.distance])):this.type===un.TRACKING&&(Je(this.matrix,this.matrix,this.position),Re(this.matrix,this.matrix,s))}},{key:"_setPosition",value:function(e,n,i){this.position=zr(e,n,i);var a=this.matrix;a[12]=this.position[0],a[13]=this.position[1],a[14]=this.position[2],a[15]=1,this._getOrthoMatrix()}},{key:"_getAxes",value:function(){Ht(this.right,zr(nt(Kn(),[1,0,0,0],this.matrix))),Ht(this.up,zr(nt(Kn(),[0,1,0,0],this.matrix))),Ht(this.forward,zr(nt(Kn(),[0,0,1,0],this.matrix))),ke(this.right,this.right),ke(this.up,this.up),ke(this.forward,this.forward)}},{key:"_getAngles",value:function(){var e=this.distanceVector[0],n=this.distanceVector[1],i=this.distanceVector[2],a=Gt(this.distanceVector);if(a===0){this.elevation=0,this.azimuth=0;return}this.type===un.TRACKING?(this.elevation=Qr(Math.asin(n/a)),this.azimuth=Qr(Math.atan2(-e,-i))):this.rotateWorld?(this.elevation=Qr(Math.asin(n/a)),this.azimuth=Qr(Math.atan2(-e,-i))):(this.elevation=-Qr(Math.asin(n/a)),this.azimuth=-Qr(Math.atan2(-e,-i)))}},{key:"_getPosition",value:function(){Ht(this.position,zr(nt(Kn(),[0,0,0,1],this.matrix))),this._getDistance()}},{key:"_getFocalPoint",value:function(){ne(this.distanceVector,[0,0,-this.distance],Ow(mg(),this.matrix)),we(this.focalPoint,this.position,this.distanceVector),this._getDistance()}},{key:"_getDistance",value:function(){this.distanceVector=Xe(xt(),this.focalPoint,this.position),this.distance=Gt(this.distanceVector),this.dollyingStep=this.distance/100}},{key:"_getOrthoMatrix",value:function(){if(this.projectionMode===Mi.ORTHOGRAPHIC){var e=this.position,n=Da(qn(),[0,0,1],-this.roll*Math.PI/180);ds(this.orthoMatrix,n,jt((this.rright-this.left)/2-e[0],(this.top-this.bottom)/2-e[1],0),jt(this.zoom,this.zoom,1),e)}}},{key:"triggerUpdate",value:function(){if(this.enableUpdate){var e=this.getViewTransform(),n=Re(oe(),this.getPerspective(),e);this.getFrustum().extractFromVPMatrix(n),this.eventEmitter.emit(ep.UPDATED)}}},{key:"rotate",value:function(e,n,i){throw new Error(ln)}},{key:"pan",value:function(e,n){throw new Error(ln)}},{key:"dolly",value:function(e){throw new Error(ln)}},{key:"createLandmark",value:function(e,n){throw new Error(ln)}},{key:"gotoLandmark",value:function(e,n){throw new Error(ln)}},{key:"cancelLandmarkAnimation",value:function(){throw new Error(ln)}}])}(),hS=function(r){return r[r.Standard=0]="Standard",r}({}),pc=function(r){return r[r.ADDED=0]="ADDED",r[r.REMOVED=1]="REMOVED",r[r.Z_INDEX_CHANGED=2]="Z_INDEX_CHANGED",r}({}),dS=xt(),tl=oe(),fS=qn();function ip(r){if(r.localDirtyFlag){var t=r.localSkew[0]!==0||r.localSkew[1]!==0;if(t){ds(r.localTransform,r.localRotation,r.localPosition,jt(1,1,1),r.origin),(r.localSkew[0]!==0||r.localSkew[1]!==0)&&(Et(tl),tl[4]=Math.tan(r.localSkew[0]),tl[1]=Math.tan(r.localSkew[1]),Re(r.localTransform,r.localTransform,tl));var e=ds(tl,yg(fS,0,0,0,1),fe(dS,1,1,1),r.localScale,r.origin);Re(r.localTransform,r.localTransform,e)}else{var n=r.localTransform,i=r.localPosition,a=r.localRotation,s=r.localScale,o=r.origin,l=i[0]!==0||i[1]!==0||i[2]!==0,c=a[3]!==1||a[0]!==0||a[1]!==0||a[2]!==0,u=s[0]!==1||s[1]!==1||s[2]!==1,h=o[0]!==0||o[1]!==0||o[2]!==0;!c&&!u&&!h?l?hr(n,i):Et(n):ds(n,a,i,s,o)}r.localDirtyFlag=!1}}function vS(r,t){r.dirtyFlag&&(t?Re(r.worldTransform,t.worldTransform,r.localTransform):me(r.worldTransform,r.localTransform),r.dirtyFlag=!1)}var ap={absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new lo(0,0,0,0)},Jt=function(r){return r.COORDINATE="<coordinate>",r.COLOR="<color>",r.PAINT="<paint>",r.NUMBER="<number>",r.ANGLE="<angle>",r.OPACITY_VALUE="<opacity-value>",r.SHADOW_BLUR="<shadow-blur>",r.LENGTH="<length>",r.PERCENTAGE="<percentage>",r.LENGTH_PERCENTAGE="<length> | <percentage>",r.LENGTH_PERCENTAGE_12="[<length> | <percentage>]{1,2}",r.LENGTH_PERCENTAGE_14="[<length> | <percentage>]{1,4}",r.LIST_OF_POINTS="<list-of-points>",r.PATH="<path>",r.FILTER="<filter>",r.Z_INDEX="<z-index>",r.OFFSET_DISTANCE="<offset-distance>",r.DEFINED_PATH="<defined-path>",r.MARKER="<marker>",r.TRANSFORM="<transform>",r.TRANSFORM_ORIGIN="<transform-origin>",r.TEXT="<text>",r.TEXT_TRANSFORM="<text-transform>",r}({});function Wd(r,t,e){r.prototype=t.prototype=e,e.constructor=r}function sp(r,t){var e=Object.create(r.prototype);for(var n in t)e[n]=t[n];return e}function el(){}var nl=.7,mc=1/nl,ho="\\s*([+-]?\\d+)\\s*",rl="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ea="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",gS=/^#([0-9a-f]{3,8})$/,pS=new RegExp(`^rgb\\(${ho},${ho},${ho}\\)$`),mS=new RegExp(`^rgb\\(${ea},${ea},${ea}\\)$`),yS=new RegExp(`^rgba\\(${ho},${ho},${ho},${rl}\\)$`),bS=new RegExp(`^rgba\\(${ea},${ea},${ea},${rl}\\)$`),xS=new RegExp(`^hsl\\(${rl},${ea},${ea}\\)$`),ES=new RegExp(`^hsla\\(${rl},${ea},${ea},${rl}\\)$`),op={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};Wd(el,yc,{copy(r){return Object.assign(new this.constructor,this,r)},displayable(){return this.rgb().displayable()},hex:lp,formatHex:lp,formatHex8:wS,formatHsl:SS,formatRgb:cp,toString:cp});function lp(){return this.rgb().formatHex()}function wS(){return this.rgb().formatHex8()}function SS(){return vp(this).formatHsl()}function cp(){return this.rgb().formatRgb()}function yc(r){var t,e;return r=(r+"").trim().toLowerCase(),(t=gS.exec(r))?(e=t[1].length,t=parseInt(t[1],16),e===6?up(t):e===3?new qr(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):e===8?bc(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):e===4?bc(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=pS.exec(r))?new qr(t[1],t[2],t[3],1):(t=mS.exec(r))?new qr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=yS.exec(r))?bc(t[1],t[2],t[3],t[4]):(t=bS.exec(r))?bc(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=xS.exec(r))?fp(t[1],t[2]/100,t[3]/100,1):(t=ES.exec(r))?fp(t[1],t[2]/100,t[3]/100,t[4]):op.hasOwnProperty(r)?up(op[r]):r==="transparent"?new qr(NaN,NaN,NaN,0):null}function up(r){return new qr(r>>16&255,r>>8&255,r&255,1)}function bc(r,t,e,n){return n<=0&&(r=t=e=NaN),new qr(r,t,e,n)}function MS(r){return r instanceof el||(r=yc(r)),r?(r=r.rgb(),new qr(r.r,r.g,r.b,r.opacity)):new qr}function AS(r,t,e,n){return arguments.length===1?MS(r):new qr(r,t,e,n==null?1:n)}function qr(r,t,e,n){this.r=+r,this.g=+t,this.b=+e,this.opacity=+n}Wd(qr,AS,sp(el,{brighter(r){return r=r==null?mc:Math.pow(mc,r),new qr(this.r*r,this.g*r,this.b*r,this.opacity)},darker(r){return r=r==null?nl:Math.pow(nl,r),new qr(this.r*r,this.g*r,this.b*r,this.opacity)},rgb(){return this},clamp(){return new qr(ps(this.r),ps(this.g),ps(this.b),xc(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:hp,formatHex:hp,formatHex8:TS,formatRgb:dp,toString:dp}));function hp(){return`#${ms(this.r)}${ms(this.g)}${ms(this.b)}`}function TS(){return`#${ms(this.r)}${ms(this.g)}${ms(this.b)}${ms((isNaN(this.opacity)?1:this.opacity)*255)}`}function dp(){const r=xc(this.opacity);return`${r===1?"rgb(":"rgba("}${ps(this.r)}, ${ps(this.g)}, ${ps(this.b)}${r===1?")":`, ${r})`}`}function xc(r){return isNaN(r)?1:Math.max(0,Math.min(1,r))}function ps(r){return Math.max(0,Math.min(255,Math.round(r)||0))}function ms(r){return r=ps(r),(r<16?"0":"")+r.toString(16)}function fp(r,t,e,n){return n<=0?r=t=e=NaN:e<=0||e>=1?r=t=NaN:t<=0&&(r=NaN),new Bi(r,t,e,n)}function vp(r){if(r instanceof Bi)return new Bi(r.h,r.s,r.l,r.opacity);if(r instanceof el||(r=yc(r)),!r)return new Bi;if(r instanceof Bi)return r;r=r.rgb();var t=r.r/255,e=r.g/255,n=r.b/255,i=Math.min(t,e,n),a=Math.max(t,e,n),s=NaN,o=a-i,l=(a+i)/2;return o?(t===a?s=(e-n)/o+(e<n)*6:e===a?s=(n-t)/o+2:s=(t-e)/o+4,o/=l<.5?a+i:2-a-i,s*=60):o=l>0&&l<1?0:s,new Bi(s,o,l,r.opacity)}function OS(r,t,e,n){return arguments.length===1?vp(r):new Bi(r,t,e,n==null?1:n)}function Bi(r,t,e,n){this.h=+r,this.s=+t,this.l=+e,this.opacity=+n}Wd(Bi,OS,sp(el,{brighter(r){return r=r==null?mc:Math.pow(mc,r),new Bi(this.h,this.s,this.l*r,this.opacity)},darker(r){return r=r==null?nl:Math.pow(nl,r),new Bi(this.h,this.s,this.l*r,this.opacity)},rgb(){var r=this.h%360+(this.h<0)*360,t=isNaN(r)||isNaN(this.s)?0:this.s,e=this.l,n=e+(e<.5?e:1-e)*t,i=2*e-n;return new qr(Zd(r>=240?r-240:r+120,i,n),Zd(r,i,n),Zd(r<120?r+240:r-120,i,n),this.opacity)},clamp(){return new Bi(gp(this.h),Ec(this.s),Ec(this.l),xc(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 r=xc(this.opacity);return`${r===1?"hsl(":"hsla("}${gp(this.h)}, ${Ec(this.s)*100}%, ${Ec(this.l)*100}%${r===1?")":`, ${r})`}`}}));function gp(r){return r=(r||0)%360,r<0?r+360:r}function Ec(r){return Math.max(0,Math.min(1,r||0))}function Zd(r,t,e){return(r<60?t+(e-t)*r/60:r<180?e:r<240?t+(e-t)*(240-r)/60:t)*255}function jn(r,t){if(typeof r!="function"||t!=null&&typeof t!="function")throw new TypeError("Expected a function");var e=function(){for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];var o=t?t.apply(this,a):a[0],l=e.cache;if(l.has(o))return l.get(o);var c=r.apply(this,a);return e.cache=l.set(o,c)||l,c};return e.cache=new(jn.Cache||Map),jn.cacheList.push(e.cache),e}jn.Cache=Map,jn.cacheList=[],jn.clearCache=function(){jn.cacheList.forEach(function(r){return r.clear()})};var te=function(r){return r[r.kUnknown=0]="kUnknown",r[r.kNumber=1]="kNumber",r[r.kPercentage=2]="kPercentage",r[r.kEms=3]="kEms",r[r.kPixels=4]="kPixels",r[r.kRems=5]="kRems",r[r.kDegrees=6]="kDegrees",r[r.kRadians=7]="kRadians",r[r.kGradians=8]="kGradians",r[r.kTurns=9]="kTurns",r[r.kMilliseconds=10]="kMilliseconds",r[r.kSeconds=11]="kSeconds",r[r.kInteger=12]="kInteger",r}({}),Fi=function(r){return r[r.kUNumber=0]="kUNumber",r[r.kUPercent=1]="kUPercent",r[r.kULength=2]="kULength",r[r.kUAngle=3]="kUAngle",r[r.kUTime=4]="kUTime",r[r.kUOther=5]="kUOther",r}({}),CS=function(r){return r[r.kYes=0]="kYes",r[r.kNo=1]="kNo",r}({}),NS=function(r){return r[r.kYes=0]="kYes",r[r.kNo=1]="kNo",r}({}),kS=[{name:"em",unit_type:te.kEms},{name:"px",unit_type:te.kPixels},{name:"deg",unit_type:te.kDegrees},{name:"rad",unit_type:te.kRadians},{name:"grad",unit_type:te.kGradians},{name:"ms",unit_type:te.kMilliseconds},{name:"s",unit_type:te.kSeconds},{name:"rem",unit_type:te.kRems},{name:"turn",unit_type:te.kTurns}],fo=function(r){return r[r.kUnknownType=0]="kUnknownType",r[r.kUnparsedType=1]="kUnparsedType",r[r.kKeywordType=2]="kKeywordType",r[r.kUnitType=3]="kUnitType",r[r.kSumType=4]="kSumType",r[r.kProductType=5]="kProductType",r[r.kNegateType=6]="kNegateType",r[r.kInvertType=7]="kInvertType",r[r.kMinType=8]="kMinType",r[r.kMaxType=9]="kMaxType",r[r.kClampType=10]="kClampType",r[r.kTransformType=11]="kTransformType",r[r.kPositionType=12]="kPositionType",r[r.kURLImageType=13]="kURLImageType",r[r.kColorType=14]="kColorType",r[r.kUnsupportedColorType=15]="kUnsupportedColorType",r}({}),PS=function(t){return kS.find(function(e){return e.name===t}).unit_type},RS=function(t){return t?t==="number"?te.kNumber:t==="percent"||t==="%"?te.kPercentage:PS(t):te.kUnknown},LS=function(t){switch(t){case te.kNumber:case te.kInteger:return Fi.kUNumber;case te.kPercentage:return Fi.kUPercent;case te.kPixels:return Fi.kULength;case te.kMilliseconds:case te.kSeconds:return Fi.kUTime;case te.kDegrees:case te.kRadians:case te.kGradians:case te.kTurns:return Fi.kUAngle;default:return Fi.kUOther}},_S=function(t){switch(t){case Fi.kUNumber:return te.kNumber;case Fi.kULength:return te.kPixels;case Fi.kUPercent:return te.kPercentage;case Fi.kUTime:return te.kSeconds;case Fi.kUAngle:return te.kDegrees;default:return te.kUnknown}},pp=function(t){var e=1;switch(t){case te.kPixels:case te.kDegrees:case te.kSeconds:break;case te.kMilliseconds:e=.001;break;case te.kRadians:e=180/Math.PI;break;case te.kGradians:e=.9;break;case te.kTurns:e=360;break}return e},Vd=function(t){switch(t){case te.kNumber:case te.kInteger:return"";case te.kPercentage:return"%";case te.kEms:return"em";case te.kRems:return"rem";case te.kPixels:return"px";case te.kDegrees:return"deg";case te.kRadians:return"rad";case te.kGradians:return"grad";case te.kMilliseconds:return"ms";case te.kSeconds:return"s";case te.kTurns:return"turn"}return""},wc=function(){function r(){(0,C.Z)(this,r)}return(0,T.Z)(r,[{key:"toString",value:function(){return this.buildCSSText(CS.kNo,NS.kNo,"")}},{key:"isNumericValue",value:function(){return this.getType()>=fo.kUnitType&&this.getType()<=fo.kClampType}}],[{key:"isAngle",value:function(e){return e===te.kDegrees||e===te.kRadians||e===te.kGradians||e===te.kTurns}},{key:"isLength",value:function(e){return e>=te.kEms&&e<te.kDegrees}},{key:"isRelativeUnit",value:function(e){return e===te.kPercentage||e===te.kEms||e===te.kRems}},{key:"isTime",value:function(e){return e===te.kSeconds||e===te.kMilliseconds}}])}(),DS=function(r){function t(e){var n;return(0,C.Z)(this,t),n=I(this,t),n.colorSpace=e,n}return(0,L.Z)(t,r),(0,T.Z)(t,[{key:"getType",value:function(){return fo.kColorType}},{key:"to",value:function(n){return this}}])}(wc),ja=function(r){return r[r.Constant=0]="Constant",r[r.LinearGradient=1]="LinearGradient",r[r.RadialGradient=2]="RadialGradient",r}({}),Sc=function(r){function t(e,n){var i;return(0,C.Z)(this,t),i=I(this,t),i.type=e,i.value=n,i}return(0,L.Z)(t,r),(0,T.Z)(t,[{key:"clone",value:function(){return new t(this.type,this.value)}},{key:"buildCSSText",value:function(n,i,a){return a}},{key:"getType",value:function(){return fo.kColorType}}])}(wc),Ai=function(r){function t(e){var n;return(0,C.Z)(this,t),n=I(this,t),n.value=e,n}return(0,L.Z)(t,r),(0,T.Z)(t,[{key:"clone",value:function(){return new t(this.value)}},{key:"getType",value:function(){return fo.kKeywordType}},{key:"buildCSSText",value:function(n,i,a){return a+this.value}}])}(wc),IS=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",n="";return Number.isFinite(t)?n="NaN":t>0?n="infinity":n="-infinity",n+=e},Ud=function(t){return _S(LS(t))},hn=function(r){function t(e){var n,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:te.kNumber;(0,C.Z)(this,t),n=I(this,t);var a;return typeof i=="string"?a=RS(i):a=i,n.unit=a,n.value=e,n}return(0,L.Z)(t,r),(0,T.Z)(t,[{key:"clone",value:function(){return new t(this.value,this.unit)}},{key:"equals",value:function(n){var i=n;return this.value===i.value&&this.unit===i.unit}},{key:"getType",value:function(){return fo.kUnitType}},{key:"convertTo",value:function(n){if(this.unit===n)return new t(this.value,this.unit);var i=Ud(this.unit);if(i!==Ud(n)||i===te.kUnknown)return null;var a=pp(this.unit)/pp(n);return new t(this.value*a,n)}},{key:"buildCSSText",value:function(n,i,a){var s;switch(this.unit){case te.kUnknown:break;case te.kInteger:s=Number(this.value).toFixed(0);break;case te.kNumber:case te.kPercentage:case te.kEms:case te.kRems:case te.kPixels:case te.kDegrees:case te.kRadians:case te.kGradians:case te.kMilliseconds:case te.kSeconds:case te.kTurns:{var o=-999999,l=999999,c=this.value,u=Vd(this.unit);if(c<o||c>l){var h=Vd(this.unit);!Number.isFinite(c)||Number.isNaN(c)?s=IS(c,h):s=c+(h||"")}else s="".concat(c).concat(u)}}return a+=s,a}}])}(wc),zi=new hn(0,"px");new hn(1,"px");var ys=new hn(0,"deg"),Yd=function(r){function t(e,n,i){var a,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;return(0,C.Z)(this,t),a=I(this,t,["rgb"]),a.r=e,a.g=n,a.b=i,a.alpha=s,a.isNone=o,a}return(0,L.Z)(t,r),(0,T.Z)(t,[{key:"clone",value:function(){return new t(this.r,this.g,this.b,this.alpha)}},{key:"buildCSSText",value:function(n,i,a){return"".concat(a,"rgba(").concat(this.r,",").concat(this.g,",").concat(this.b,",").concat(this.alpha,")")}}])}(DS),mp=new Ai("unset"),BS=new Ai("initial"),FS=new Ai("inherit"),Hd={"":mp,unset:mp,initial:BS,inherit:FS},zS=function(t){return Hd[t]||(Hd[t]=new Ai(t)),Hd[t]},yp=new Yd(0,0,0,0,!0),bp=new Yd(0,0,0,0),jS=jn(function(r,t,e,n){return new Yd(r,t,e,n)},function(r,t,e,n){return"rgba(".concat(r,",").concat(t,",").concat(e,",").concat(n,")")}),Mn=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:te.kNumber;return new hn(t,e)};new hn(50,"%");function GS(r){var t=r.type,e=r.value;return t==="hex"?"#".concat(e):t==="literal"?e:t==="rgb"?"rgb(".concat(e.join(","),")"):"rgba(".concat(e.join(","),")")}var WS=function(){var r={linearGradient:/^(linear\-gradient)/i,repeatingLinearGradient:/^(repeating\-linear\-gradient)/i,radialGradient:/^(radial\-gradient)/i,repeatingRadialGradient:/^(repeating\-radial\-gradient)/i,conicGradient:/^(conic\-gradient)/i,sideOrCorner:/^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|left|right|top|bottom)/i,extentKeywords:/^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,positionKeywords:/^(left|center|right|top|bottom)/i,pixelValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,percentageValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,emValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,angleValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,startCall:/^\(/,endCall:/^\)/,comma:/^,/,hexColor:/^\#([0-9a-fA-F]+)/,literalColor:/^([a-zA-Z]+)/,rgbColor:/^rgb/i,rgbaColor:/^rgba/i,number:/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/},t="";function e(Ct){throw new Error("".concat(t,": ").concat(Ct))}function n(){var Ct=i();return t.length>0&&e("Invalid input not EOF"),Ct}function i(){return E(a)}function a(){return s("linear-gradient",r.linearGradient,l)||s("repeating-linear-gradient",r.repeatingLinearGradient,l)||s("radial-gradient",r.radialGradient,h)||s("repeating-radial-gradient",r.repeatingRadialGradient,h)||s("conic-gradient",r.conicGradient,h)}function s(Ct,gt,bt){return o(gt,function(Pt){var zt=bt();return zt&&(ft(r.comma)||e("Missing comma before color stops")),{type:Ct,orientation:zt,colorStops:E(O)}})}function o(Ct,gt){var bt=ft(Ct);if(bt){ft(r.startCall)||e("Missing (");var Pt=gt(bt);return ft(r.endCall)||e("Missing )"),Pt}}function l(){return c()||u()}function c(){return ct("directional",r.sideOrCorner,1)}function u(){return ct("angular",r.angleValue,1)}function h(){var Ct,gt=d(),bt;return gt&&(Ct=[],Ct.push(gt),bt=t,ft(r.comma)&&(gt=d(),gt?Ct.push(gt):t=bt)),Ct}function d(){var Ct=f()||v();if(Ct)Ct.at=p();else{var gt=g();if(gt){Ct=gt;var bt=p();bt&&(Ct.at=bt)}else{var Pt=y();Pt&&(Ct={type:"default-radial",at:Pt})}}return Ct}function f(){var Ct=ct("shape",/^(circle)/i,0);return Ct&&(Ct.style=at()||g()),Ct}function v(){var Ct=ct("shape",/^(ellipse)/i,0);return Ct&&(Ct.style=J()||g()),Ct}function g(){return ct("extent-keyword",r.extentKeywords,1)}function p(){if(ct("position",/^at/,0)){var Ct=y();return Ct||e("Missing positioning value"),Ct}}function y(){var Ct=b();if(Ct.x||Ct.y)return{type:"position",value:Ct}}function b(){return{x:J(),y:J()}}function E(Ct){var gt=Ct(),bt=[];if(gt)for(bt.push(gt);ft(r.comma);)gt=Ct(),gt?bt.push(gt):e("One extra comma");return bt}function O(){var Ct=k();return Ct||e("Expected color definition"),Ct.length=J(),Ct}function k(){return F()||V()||B()||P()}function P(){return ct("literal",r.literalColor,0)}function F(){return ct("hex",r.hexColor,1)}function B(){return o(r.rgbColor,function(){return{type:"rgb",value:E(U)}})}function V(){return o(r.rgbaColor,function(){return{type:"rgba",value:E(U)}})}function U(){return ft(r.number)[1]}function J(){return ct("%",r.percentageValue,1)||$()||at()}function $(){return ct("position-keyword",r.positionKeywords,1)}function at(){return ct("px",r.pixelValue,1)||ct("em",r.emValue,1)}function ct(Ct,gt,bt){var Pt=ft(gt);if(Pt)return{type:Ct,value:Pt[bt]}}function ft(Ct){var gt=/^[\n\r\t\s]+/.exec(t);gt&&Nt(gt[0].length);var bt=Ct.exec(t);return bt&&Nt(bt[0].length),bt}function Nt(Ct){t=t.substring(Ct)}return function(Ct){return t=Ct,n()}}();function ZS(r,t,e,n){var i=cn(n.value),a=0,s=0,o=a+t/2,l=s+e/2,c=Math.abs(t*Math.cos(i))+Math.abs(e*Math.sin(i)),u=r[0]+o-Math.cos(i)*c/2,h=r[1]+l-Math.sin(i)*c/2,d=r[0]+o+Math.cos(i)*c/2,f=r[1]+l+Math.sin(i)*c/2;return{x1:u,y1:h,x2:d,y2:f}}function VS(r,t,e,n,i,a){var s=n.value,o=i.value;n.unit===te.kPercentage&&(s=n.value/100*t),i.unit===te.kPercentage&&(o=i.value/100*e);var l=Math.max(Xr([0,0],[s,o]),Xr([0,e],[s,o]),Xr([t,e],[s,o]),Xr([t,0],[s,o]));return a&&(a instanceof hn?l=a.value:a instanceof Ai&&(a.value==="closest-side"?l=Math.min(s,t-s,o,e-o):a.value==="farthest-side"?l=Math.max(s,t-s,o,e-o):a.value==="closest-corner"&&(l=Math.min(Xr([0,0],[s,o]),Xr([0,e],[s,o]),Xr([t,e],[s,o]),Xr([t,0],[s,o]))))),{x:s+r[0],y:o+r[1],r:l}}var US=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,YS=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,HS=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,xp=/[\d.]+:(#[^\s]+|[^\)]+\))/gi;function XS(r){var t,e=r.length;if(r[e-1].length=(t=r[e-1].length)!==null&&t!==void 0?t:{type:"%",value:"100"},e>1){var n;r[0].length=(n=r[0].length)!==null&&n!==void 0?n:{type:"%",value:"0"}}for(var i=0,a=Number(r[0].length.value),s=1;s<e;s++){var o,l=(o=r[s].length)===null||o===void 0?void 0:o.value;if(!be(l)&&!be(a)){for(var c=1;c<s-i;c++)r[i+c].length={type:"%",value:"".concat(a+(Number(l)-a)*c/(s-i))};i=s,a=Number(l)}}}var KS={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},QS=jn(function(r){var t;return r.type==="angular"?t=Number(r.value):t=KS[r.value]||0,Mn(t,"deg")}),qS=jn(function(r){var t=50,e=50,n="%",i="%";if((r==null?void 0:r.type)==="position"){var a=r.value,s=a.x,o=a.y;(s==null?void 0:s.type)==="position-keyword"&&(s.value==="left"?t=0:s.value==="center"?t=50:s.value==="right"?t=100:s.value==="top"?e=0:s.value==="bottom"&&(e=100)),(o==null?void 0:o.type)==="position-keyword"&&(o.value==="left"?t=0:o.value==="center"?e=50:o.value==="right"?t=100:o.value==="top"?e=0:o.value==="bottom"&&(e=100)),((s==null?void 0:s.type)==="px"||(s==null?void 0:s.type)==="%"||(s==null?void 0:s.type)==="em")&&(n=s==null?void 0:s.type,t=Number(s.value)),((o==null?void 0:o.type)==="px"||(o==null?void 0:o.type)==="%"||(o==null?void 0:o.type)==="em")&&(i=o==null?void 0:o.type,e=Number(o.value))}return{cx:Mn(t,n),cy:Mn(e,i)}}),JS=jn(function(r){if(r.indexOf("linear")>-1||r.indexOf("radial")>-1){var t=WS(r);return t.map(function(o){var l=o.type,c=o.orientation,u=o.colorStops;XS(u);var h=u.map(function(E){return{offset:Mn(Number(E.length.value),"%"),color:GS(E)}});if(l==="linear-gradient")return new Sc(ja.LinearGradient,{angle:c?QS(c):ys,steps:h});if(l==="radial-gradient"&&(c||(c=[{type:"shape",value:"circle"}]),c[0].type==="shape"&&c[0].value==="circle")){var d=qS(c[0].at),f=d.cx,v=d.cy,g;if(c[0].style){var p=c[0].style,y=p.type,b=p.value;y==="extent-keyword"?g=zS(b):g=Mn(b,y)}return new Sc(ja.RadialGradient,{cx:f,cy:v,size:g,steps:h})}})}var e=r[0];if(r[1]==="("||r[2]==="("){if(e==="l"){var n=US.exec(r);if(n){var i,a=((i=n[2].match(xp))===null||i===void 0?void 0:i.map(function(o){return o.split(":")}))||[];return[new Sc(ja.LinearGradient,{angle:Mn(parseFloat(n[1]),"deg"),steps:a.map(function(o){var l=(0,G.Z)(o,2),c=l[0],u=l[1];return{offset:Mn(Number(c)*100,"%"),color:u}})})]}}else if(e==="r"){var s=$S(r);if(s)if(Ue(s))r=s;else return[new Sc(ja.RadialGradient,s)]}else if(e==="p")return tM(r)}});function $S(r){var t=YS.exec(r);if(t){var e,n=((e=t[4].match(xp))===null||e===void 0?void 0:e.map(function(i){return i.split(":")}))||[];return{cx:Mn(50,"%"),cy:Mn(50,"%"),steps:n.map(function(i){var a=(0,G.Z)(i,2),s=a[0],o=a[1];return{offset:Mn(Number(s)*100,"%"),color:o}})}}return null}function tM(r){var t=HS.exec(r);if(t){var e=t[1],n=t[2];switch(e){case"a":e="repeat";break;case"x":e="repeat-x";break;case"y":e="repeat-y";break;case"n":e="no-repeat";break;default:e="no-repeat"}return{image:n,repetition:e}}return null}function l9(r){return!!r.type&&!!r.value}function bs(r){return r&&!!r.image}function Mc(r){return r&&!be(r.r)&&!be(r.g)&&!be(r.b)}var il=jn(function(r){if(bs(r))return(0,z.Z)({repetition:"repeat"},r);if(be(r)&&(r=""),r==="transparent")return bp;if(r==="currentColor")r="black";else if(r==="none")return yp;var t=JS(r);if(t)return t;var e=yc(r),n=[0,0,0,0];return e!==null&&(n[0]=e.r||0,n[1]=e.g||0,n[2]=e.b||0,n[3]=e.opacity),jS.apply(void 0,n)});function eM(r,t){if(!(!Mc(r)||!Mc(t)))return[[Number(r.r),Number(r.g),Number(r.b),Number(r.alpha)],[Number(t.r),Number(t.g),Number(t.b),Number(t.alpha)],function(e){var n=e.slice();if(n[3])for(var i=0;i<3;i++)n[i]=Math.round(kn(n[i],0,255));return n[3]=kn(n[3],0,1),"rgba(".concat(n.join(","),")")}]}function al(r,t){if(be(t))return Mn(0,"px");if(t="".concat(t).trim().toLowerCase(),isFinite(Number(t))){if("px".search(r)>=0)return Mn(Number(t),"px");if("deg".search(r)>=0)return Mn(Number(t),"deg")}var e=[];t=t.replace(r,function(i){return e.push(i),"U".concat(i)});var n="U(".concat(r.source,")");return e.map(function(i){return Mn(Number(t.replace(new RegExp("U".concat(i),"g"),"").replace(new RegExp(n,"g"),"*0")),i)})[0]}var Ep=function(t){return al(new RegExp("px","g"),t)},nM=jn(Ep),rM=function(t){return al(new RegExp("%","g"),t)};jn(rM);var wp=function(t){return ie(t)||isFinite(Number(t))?Mn(Number(t)||0,"px"):al(new RegExp("px|%|em|rem","g"),t)},Xd=jn(wp),Sp=function(t){return al(new RegExp("deg|rad|grad|turn","g"),t)},iM=jn(Sp);function aM(r,t,e,n){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,a="",s=r.value||0,o=t.value||0,l=Ud(r.unit),c=r.convertTo(l),u=t.convertTo(l);return c&&u?(s=c.value,o=u.value,a=Vd(r.unit)):(hn.isLength(r.unit)||hn.isLength(t.unit))&&(s=oi(r,i,e),o=oi(t,i,e),a="px"),[s,o,function(h){return n&&(h=Math.max(h,0)),h+a}]}function Jr(r){var t=0;return r.unit===te.kDegrees?t=r.value:r.unit===te.kRadians?t=Qr(Number(r.value)):r.unit===te.kTurns?t=rS(Number(r.value)):r.value&&(t=r.value),t}function Mp(r,t){var e;return Array.isArray(r)?e=r.map(function(n){return Number(n)}):Ue(r)?e=r.split(" ").map(function(n){return Number(n)}):ie(r)&&(e=[r]),t===2?e.length===1?[e[0],e[0]]:[e[0],e[1]]:t===4?e.length===1?[e[0],e[0],e[0],e[0]]:e.length===2?[e[0],e[1],e[0],e[1]]:e.length===3?[e[0],e[1],e[2],e[1]]:[e[0],e[1],e[2],e[3]]:t==="even"&&e.length%2===1?[].concat((0,N.Z)(e),(0,N.Z)(e)):e}function oi(r,t,e){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(r.unit===te.kPixels)return Number(r.value);if(r.unit===te.kPercentage&&e){var i=e.nodeName===Dt.GROUP?e.getLocalBounds():e.getGeometryBounds();return(n?i.min[t]:0)+r.value/100*i.halfExtents[t]*2}return 0}var sM=function(t){return al(/deg|rad|grad|turn|px|%/g,t)},oM=["blur","brightness","drop-shadow","contrast","grayscale","sepia","saturate","hue-rotate","invert"];function lM(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";if(r=r.toLowerCase().trim(),r==="none")return[];for(var t=/\s*([\w-]+)\(([^)]*)\)/g,e=[],n,i=0;n=t.exec(r);){if(n.index!==i)return[];if(i=n.index+n[0].length,oM.indexOf(n[1])>-1&&e.push({name:n[1],params:n[2].split(" ").map(function(a){return sM(a)||il(a)})}),t.lastIndex===r.length)return e}return[]}function Ap(r){return r.toString()}var Tp=function(t){return typeof t=="number"?Mn(t):/^\s*[-+]?(\d*\.)?\d+\s*$/.test(t)?Mn(Number(t)):Mn(0)},Kd=jn(Tp);jn(function(r){return Ue(r)?r.split(" ").map(Kd):r.map(Kd)});function Qd(r,t){return[r,t,Ap]}function qd(r,t){return function(e,n){return[e,n,function(i){return Ap(kn(i,r,t))}]}}function Op(r,t){if(r.length===t.length)return[r,t,function(e){return e}]}function Jd(r){return r.parsedStyle.d.totalLength===0&&(r.parsedStyle.d.totalLength=r2(r.parsedStyle.d.absolutePath)),r.parsedStyle.d.totalLength}function cM(r){return r.parsedStyle.points.totalLength===0&&(r.parsedStyle.points.totalLength=j2(r.parsedStyle.points.points)),r.parsedStyle.points.totalLength}function uM(r){for(var t=0;t<r.length;t++){var e=r[t-1],n=r[t],i=n[0];if(i==="M"&&e){var a=e[0],s=[n[1],n[2]],o=void 0;a==="L"||a==="M"?o=[e[1],e[2]]:(a==="C"||a==="A"||a==="Q")&&(o=[e[e.length-2],e[e.length-1]]),o&&Ac(s,o)&&(r.splice(t,1),t--)}}}function hM(r){for(var t=!1,e=r.length,n=0;n<e;n++){var i=r[n],a=i[0];if(a==="C"||a==="A"||a==="Q"){t=!0;break}}return t}function dM(r){for(var t=[],e=[],n=[],i=0;i<r.length;i++){var a=r[i],s=a[0];s==="M"?(n.length&&(e.push(n),n=[]),n.push([a[1],a[2]])):s==="Z"?n.length&&(t.push(n),n=[]):n.push([a[1],a[2]])}return n.length>0&&e.push(n),{polygons:t,polylines:e}}function Ac(r,t){return r[0]===t[0]&&r[1]===t[1]}function fM(r,t){for(var e=[],n=[],i=[],a=0;a<r.length;a++){var s=r[a],o=s.currentPoint,l=s.params,c=s.prePoint,u=void 0;switch(s.command){case"Q":u=W2(c[0],c[1],l[1],l[2],l[3],l[4]);break;case"C":u=B2(c[0],c[1],l[1],l[2],l[3],l[4],l[5],l[6]);break;case"A":var h=s.arcParams;u=R2(h.cx,h.cy,h.rx,h.ry,h.xRotation,h.startAngle,h.endAngle);break;default:e.push(o[0]),n.push(o[1]);break}u&&(s.box=u,e.push(u.x,u.x+u.width),n.push(u.y,u.y+u.height)),t&&(s.command==="L"||s.command==="M")&&s.prePoint&&s.nextPoint&&i.push(s)}e=e.filter(function(O){return!Number.isNaN(O)&&O!==1/0&&O!==-1/0}),n=n.filter(function(O){return!Number.isNaN(O)&&O!==1/0&&O!==-1/0});var d=cc(e),f=cc(n),v=uc(e),g=uc(n);if(i.length===0)return{x:d,y:f,width:v-d,height:g-f};for(var p=0;p<i.length;p++){var y=i[p],b=y.currentPoint,E=void 0;b[0]===d?(E=Tc(y,t),d-=E.xExtra):b[0]===v&&(E=Tc(y,t),v+=E.xExtra),b[1]===f?(E=Tc(y,t),f-=E.yExtra):b[1]===g&&(E=Tc(y,t),g+=E.yExtra)}return{x:d,y:f,width:v-d,height:g-f}}function Tc(r,t){var e=r.prePoint,n=r.currentPoint,i=r.nextPoint,a=Math.pow(n[0]-e[0],2)+Math.pow(n[1]-e[1],2),s=Math.pow(n[0]-i[0],2)+Math.pow(n[1]-i[1],2),o=Math.pow(e[0]-i[0],2)+Math.pow(e[1]-i[1],2),l=Math.acos((a+s-o)/(2*Math.sqrt(a)*Math.sqrt(s)));if(!l||Math.sin(l)===0||Qo(l,0))return{xExtra:0,yExtra:0};var c=Math.abs(Math.atan2(i[1]-n[1],i[0]-n[0])),u=Math.abs(Math.atan2(i[0]-n[0],i[1]-n[1]));c=c>Math.PI/2?Math.PI-c:c,u=u>Math.PI/2?Math.PI-u:u;var h={xExtra:Math.cos(l/2-c)*(t/2*(1/Math.sin(l/2)))-t/2||0,yExtra:Math.cos(u-l/2)*(t/2*(1/Math.sin(l/2)))-t/2||0};return h}function Cp(r,t){return[t[0]+(t[0]-r[0]),t[1]+(t[1]-r[1])]}var Np=function(t,e){var n=t.x*e.x+t.y*e.y,i=Math.sqrt((Math.pow(t.x,2)+Math.pow(t.y,2))*(Math.pow(e.x,2)+Math.pow(e.y,2))),a=t.x*e.y-t.y*e.x<0?-1:1,s=a*Math.acos(n/i);return s},kp=function(t,e,n,i,a,s,o,l){e=Math.abs(e),n=Math.abs(n),i=Cg(i,360);var c=cn(i);if(t.x===o.x&&t.y===o.y)return{x:t.x,y:t.y,ellipticalArcAngle:0};if(e===0||n===0)return{x:0,y:0,ellipticalArcAngle:0};var u=(t.x-o.x)/2,h=(t.y-o.y)/2,d={x:Math.cos(c)*u+Math.sin(c)*h,y:-Math.sin(c)*u+Math.cos(c)*h},f=Math.pow(d.x,2)/Math.pow(e,2)+Math.pow(d.y,2)/Math.pow(n,2);f>1&&(e*=Math.sqrt(f),n*=Math.sqrt(f));var v=Math.pow(e,2)*Math.pow(n,2)-Math.pow(e,2)*Math.pow(d.y,2)-Math.pow(n,2)*Math.pow(d.x,2),g=Math.pow(e,2)*Math.pow(d.y,2)+Math.pow(n,2)*Math.pow(d.x,2),p=v/g;p=p<0?0:p;var y=(a!==s?1:-1)*Math.sqrt(p),b={x:y*(e*d.y/n),y:y*(-(n*d.x)/e)},E={x:Math.cos(c)*b.x-Math.sin(c)*b.y+(t.x+o.x)/2,y:Math.sin(c)*b.x+Math.cos(c)*b.y+(t.y+o.y)/2},O={x:(d.x-b.x)/e,y:(d.y-b.y)/n},k=Np({x:1,y:0},O),P={x:(-d.x-b.x)/e,y:(-d.y-b.y)/n},F=Np(O,P);!s&&F>0?F-=2*Math.PI:s&&F<0&&(F+=2*Math.PI),F%=2*Math.PI;var B=k+F*l,V=e*Math.cos(B),U=n*Math.sin(B),J={x:Math.cos(c)*V-Math.sin(c)*U+E.x,y:Math.sin(c)*V+Math.cos(c)*U+E.y,ellipticalArcStartAngle:k,ellipticalArcEndAngle:k+F,ellipticalArcAngle:B,ellipticalArcCenter:E,resultantRx:e,resultantRy:n};return J};function vM(r){for(var t=[],e=null,n=null,i=null,a=0,s=r.length,o=0;o<s;o++){var l=r[o];n=r[o+1];var c=l[0],u={command:c,prePoint:e,params:l,startTangent:null,endTangent:null,currentPoint:null,nextPoint:null,arcParams:null,box:null,cubicParams:null};switch(c){case"M":i=[l[1],l[2]],a=o;break;case"A":var h=gM(e,l);u.arcParams=h;break}if(c==="Z")e=i,n=r[a+1];else{var d=l.length;e=[l[d-2],l[d-1]]}n&&n[0]==="Z"&&(n=r[a],t[a]&&(t[a].prePoint=e)),u.currentPoint=e,t[a]&&Ac(e,t[a].currentPoint)&&(t[a].prePoint=u.prePoint);var f=n?[n[n.length-2],n[n.length-1]]:null;u.nextPoint=f;var v=u.prePoint;if(["L","H","V"].includes(c))u.startTangent=[v[0]-e[0],v[1]-e[1]],u.endTangent=[e[0]-v[0],e[1]-v[1]];else if(c==="Q"){var g=[l[1],l[2]];u.startTangent=[v[0]-g[0],v[1]-g[1]],u.endTangent=[e[0]-g[0],e[1]-g[1]]}else if(c==="T"){var p=t[o-1],y=Cp(p.currentPoint,v);p.command==="Q"?(u.command="Q",u.startTangent=[v[0]-y[0],v[1]-y[1]],u.endTangent=[e[0]-y[0],e[1]-y[1]]):(u.command="TL",u.startTangent=[v[0]-e[0],v[1]-e[1]],u.endTangent=[e[0]-v[0],e[1]-v[1]])}else if(c==="C"){var b=[l[1],l[2]],E=[l[3],l[4]];u.startTangent=[v[0]-b[0],v[1]-b[1]],u.endTangent=[e[0]-E[0],e[1]-E[1]],u.startTangent[0]===0&&u.startTangent[1]===0&&(u.startTangent=[b[0]-E[0],b[1]-E[1]]),u.endTangent[0]===0&&u.endTangent[1]===0&&(u.endTangent=[E[0]-b[0],E[1]-b[1]])}else if(c==="S"){var O=t[o-1],k=Cp(O.currentPoint,v),P=[l[1],l[2]];O.command==="C"?(u.command="C",u.startTangent=[v[0]-k[0],v[1]-k[1]],u.endTangent=[e[0]-P[0],e[1]-P[1]]):(u.command="SQ",u.startTangent=[v[0]-P[0],v[1]-P[1]],u.endTangent=[e[0]-P[0],e[1]-P[1]])}else if(c==="A"){var F=Pp(u,0),B=F.x,V=F.y,U=Pp(u,1,!1),J=U.x,$=U.y;u.startTangent=[B,V],u.endTangent=[J,$]}t.push(u)}return t}function Pp(r,t){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,n=r.arcParams,i=n.rx,a=i===void 0?0:i,s=n.ry,o=s===void 0?0:s,l=n.xRotation,c=n.arcFlag,u=n.sweepFlag,h=kp({x:r.prePoint[0],y:r.prePoint[1]},a,o,l,!!c,!!u,{x:r.currentPoint[0],y:r.currentPoint[1]},t),d=kp({x:r.prePoint[0],y:r.prePoint[1]},a,o,l,!!c,!!u,{x:r.currentPoint[0],y:r.currentPoint[1]},e?t+.005:t-.005),f=d.x-h.x,v=d.y-h.y,g=Math.sqrt(f*f+v*v);return{x:-f/g,y:-v/g}}function Oc(r){return Math.sqrt(r[0]*r[0]+r[1]*r[1])}function $d(r,t){return Oc(r)*Oc(t)?(r[0]*t[0]+r[1]*t[1])/(Oc(r)*Oc(t)):1}function Rp(r,t){return(r[0]*t[1]<r[1]*t[0]?-1:1)*Math.acos($d(r,t))}function gM(r,t){var e=t[1],n=t[2],i=Cg(cn(t[3]),Math.PI*2),a=t[4],s=t[5],o=r[0],l=r[1],c=t[6],u=t[7],h=Math.cos(i)*(o-c)/2+Math.sin(i)*(l-u)/2,d=-1*Math.sin(i)*(o-c)/2+Math.cos(i)*(l-u)/2,f=h*h/(e*e)+d*d/(n*n);f>1&&(e*=Math.sqrt(f),n*=Math.sqrt(f));var v=e*e*(d*d)+n*n*(h*h),g=v?Math.sqrt((e*e*(n*n)-v)/v):1;a===s&&(g*=-1),isNaN(g)&&(g=0);var p=n?g*e*d/n:0,y=e?g*-n*h/e:0,b=(o+c)/2+Math.cos(i)*p-Math.sin(i)*y,E=(l+u)/2+Math.sin(i)*p+Math.cos(i)*y,O=[(h-p)/e,(d-y)/n],k=[(-1*h-p)/e,(-1*d-y)/n],P=Rp([1,0],O),F=Rp(O,k);return $d(O,k)<=-1&&(F=Math.PI),$d(O,k)>=1&&(F=0),s===0&&F>0&&(F-=2*Math.PI),s===1&&F<0&&(F+=2*Math.PI),{cx:b,cy:E,rx:Ac(r,[c,u])?0:e,ry:Ac(r,[c,u])?0:n,startAngle:P,endAngle:P+F,xRotation:i,arcFlag:a,sweepFlag:s}}function pM(r,t,e){return r.reduce(function(n,i){var a="";if(i[0]==="M"||i[0]==="L"){var s=vec3.fromValues(i[1],i[2],0);e&&vec3.transformMat4(s,s,e),a="".concat(i[0]).concat(s[0],",").concat(s[1])}else if(i[0]==="Z")a=i[0];else if(i[0]==="C"){var o=vec3.fromValues(i[1],i[2],0),l=vec3.fromValues(i[3],i[4],0),c=vec3.fromValues(i[5],i[6],0);e&&(vec3.transformMat4(o,o,e),vec3.transformMat4(l,l,e),vec3.transformMat4(c,c,e)),a="".concat(i[0]).concat(o[0],",").concat(o[1],",").concat(l[0],",").concat(l[1],",").concat(c[0],",").concat(c[1])}else if(i[0]==="A"){var u=vec3.fromValues(i[6],i[7],0);e&&vec3.transformMat4(u,u,e),a="".concat(i[0]).concat(i[1],",").concat(i[2],",").concat(i[3],",").concat(i[4],",").concat(i[5],",").concat(u[0],",").concat(u[1])}else if(i[0]==="Q"){var h=vec3.fromValues(i[1],i[2],0),d=vec3.fromValues(i[3],i[4],0);e&&(vec3.transformMat4(h,h,e),vec3.transformMat4(d,d,e)),a="".concat(i[0]).concat(i[1],",").concat(i[2],",").concat(i[3],",").concat(i[4],"}")}return n+=a},"")}function mM(r,t,e,n){return[["M",r,t],["L",e,n]]}function Lp(r,t,e,n){var i=(-1+Math.sqrt(2))/3*4,a=r*i,s=t*i,o=e-r,l=e+r,c=n-t,u=n+t;return[["M",o,n],["C",o,n-s,e-a,c,e,c],["C",e+a,c,l,n-s,l,n],["C",l,n+s,e+a,u,e,u],["C",e-a,u,o,n+s,o,n],["Z"]]}function yM(r,t){var e=r.map(function(n,i){return[i===0?"M":"L",n[0],n[1]]});return t&&e.push(["Z"]),e}function bM(r,t,e,n,i){if(i){var a=_slicedToArray(i,4),s=a[0],o=a[1],l=a[2],c=a[3],u=r>0?1:-1,h=t>0?1:-1,d=u+h!==0?1:0;return[["M",u*s+e,n],["L",r-u*o+e,n],o?["A",o,o,0,0,d,r+e,h*o+n]:null,["L",r+e,t-h*l+n],l?["A",l,l,0,0,d,r+e-u*l,t+n]:null,["L",e+u*c,t+n],c?["A",c,c,0,0,d,e,t+n-h*c]:null,["L",e,h*s+n],s?["A",s,s,0,0,d,u*s+e,n]:null,["Z"]].filter(function(f){return f})}return[["M",e,n],["L",e+r,n],["L",e+r,n+t],["L",e,n+t],["Z"]]}function c9(r){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:r.getLocalTransform(),e=[];switch(r.nodeName){case Dt.LINE:var n=r.parsedStyle,i=n.x1,a=i===void 0?0:i,s=n.y1,o=s===void 0?0:s,l=n.x2,c=l===void 0?0:l,u=n.y2,h=u===void 0?0:u;e=mM(a,o,c,h);break;case Dt.CIRCLE:{var d=r.parsedStyle,f=d.r,v=f===void 0?0:f,g=d.cx,p=g===void 0?0:g,y=d.cy,b=y===void 0?0:y;e=Lp(v,v,p,b);break}case Dt.ELLIPSE:{var E=r.parsedStyle,O=E.rx,k=O===void 0?0:O,P=E.ry,F=P===void 0?0:P,B=E.cx,V=B===void 0?0:B,U=E.cy,J=U===void 0?0:U;e=Lp(k,F,V,J);break}case Dt.POLYLINE:case Dt.POLYGON:var $=r.parsedStyle.points;e=yM($.points,r.nodeName===Dt.POLYGON);break;case Dt.RECT:var at=r.parsedStyle,ct=at.width,ft=ct===void 0?0:ct,Nt=at.height,Ct=Nt===void 0?0:Nt,gt=at.x,bt=gt===void 0?0:gt,Pt=at.y,zt=Pt===void 0?0:Pt,Ut=at.radius,$t=Ut&&Ut.some(function(ce){return ce!==0});e=bM(ft,Ct,bt,zt,$t&&Ut.map(function(ce){return clamp(ce,0,Math.min(Math.abs(ft)/2,Math.abs(Ct)/2))}));break;case Dt.PATH:var re=r.parsedStyle.d.absolutePath;e=_toConsumableArray(re);break}if(e.length)return pM(e,r,t)}function u9(r){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,a=r.map(function(s,o){var l=s[0],c=r[o+1],u=o===0&&(t!==0||e!==0),h=(o===r.length-1||c&&(c[0]==="M"||c[0]==="Z"))&&n!==0&&i!==0,d=u?[t,e]:[0,0],f=_slicedToArray(d,2),v=f[0],g=f[1],p=h?[n,i]:[0,0],y=_slicedToArray(p,2),b=y[0],E=y[1];switch(l){case"M":return"M ".concat(s[1]+v,",").concat(s[2]+g);case"L":return"L ".concat(s[1]+b,",").concat(s[2]+E);case"Q":return"Q ".concat(s[1]," ").concat(s[2],",").concat(s[3]+b," ").concat(s[4]+E);case"C":return"C ".concat(s[1]," ").concat(s[2],",").concat(s[3]," ").concat(s[4],",").concat(s[5]+b," ").concat(s[6]+E);case"A":return"A ".concat(s[1]," ").concat(s[2]," ").concat(s[3]," ").concat(s[4]," ").concat(s[5]," ").concat(s[6]," ").concat(s[7]).concat(h?" L ".concat(s[6]+n,",").concat(s[7]+i):"");case"Z":return"Z";default:return null}}).filter(function(s){return s!==null}).join(" ");return~a.indexOf("NaN")?"":a}var _p=function(t){if(t===""||Array.isArray(t)&&t.length===0)return{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:{x:0,y:0,width:0,height:0}};var e;try{e=lc(t)}catch(f){e=lc(""),console.error("[g]: Invalid SVG Path definition: ".concat(t))}uM(e);var n=hM(e),i=dM(e),a=i.polygons,s=i.polylines,o=vM(e),l=fM(o,0),c=l.x,u=l.y,h=l.width,d=l.height;return{absolutePath:e,hasArc:n,segments:o,polygons:a,polylines:s,totalLength:0,rect:{x:Number.isFinite(c)?c:0,y:Number.isFinite(u)?u:0,width:Number.isFinite(h)?h:0,height:Number.isFinite(d)?d:0}}},xM=jn(_p);function Dp(r){return Ue(r)?xM(r):_p(r)}function EM(r,t,e){var n=r.curve,i=t.curve;(!n||n.length===0)&&(n=Rd(r.absolutePath,!1),r.curve=n),(!i||i.length===0)&&(i=Rd(t.absolutePath,!1),t.curve=i);var a=[n,i];n.length!==i.length&&(a=Pg(n,i));var s=Rg(a[0])!==Rg(a[1])?v2(a[0]):g2(a[0]);return[s,m2(a[1],s),function(o){return o}]}function wM(r,t){var e;return Ue(r)?e=r.split(" ").map(function(n){var i=n.split(","),a=(0,G.Z)(i,2),s=a[0],o=a[1];return[Number(s),Number(o)]}):e=r,{points:e,totalLength:0,segments:[]}}function SM(r,t){return[r.points,t.points,function(e){return e}]}var Pn=null,vo=/\s*(\w+)\(([^)]*)\)/g;function $r(r){return function(t){var e=0;return r.map(function(n){return n===Pn?t[e++]:n})}}function xs(r){return r}var sl={matrix:["NNNNNN",[Pn,Pn,0,0,Pn,Pn,0,0,0,0,1,0,Pn,Pn,0,1],xs],matrix3d:["NNNNNNNNNNNNNNNN",xs],rotate:["A"],rotateX:["A"],rotateY:["A"],rotateZ:["A"],rotate3d:["NNNA"],perspective:["L"],scale:["Nn",$r([Pn,Pn,new hn(1)]),xs],scaleX:["N",$r([Pn,new hn(1),new hn(1)]),$r([Pn,new hn(1)])],scaleY:["N",$r([new hn(1),Pn,new hn(1)]),$r([new hn(1),Pn])],scaleZ:["N",$r([new hn(1),new hn(1),Pn])],scale3d:["NNN",xs],skew:["Aa",null,xs],skewX:["A",null,$r([Pn,ys])],skewY:["A",null,$r([ys,Pn])],translate:["Tt",$r([Pn,Pn,zi]),xs],translateX:["T",$r([Pn,zi,zi]),$r([Pn,zi])],translateY:["T",$r([zi,Pn,zi]),$r([zi,Pn])],translateZ:["L",$r([zi,zi,Pn])],translate3d:["TTL",xs]};function Ip(r){for(var t=[],e=r.length,n=0;n<e;n++){var i=r[n],a=i[0],s=i.slice(1);a==="translate"||a==="skew"?s.length===1&&s.push(0):a==="scale"&&s.length===1&&s.push(s[0]);var o=sl[a];if(!o)return[];var l=s.map(function(c){return Mn(c)});t.push({t:a,d:l})}return t}function Bp(r){if(Array.isArray(r))return Ip(r);if(r=(r||"none").trim(),r==="none")return[];var t=[],e,n=0;for(vo.lastIndex=0;e=vo.exec(r);){if(e.index!==n)return[];n=e.index+e[0].length;var i=e[1],a=sl[i];if(!a)return[];var s=e[2].split(","),o=a[0];if(o.length<s.length)return[];for(var l=[],c=0;c<o.length;c++){var u=s[c],h=o[c],d=void 0;if(u?d={A:function(v){return v.trim()==="0"?ys:iM(v)},N:Kd,T:Xd,L:nM}[h.toUpperCase()](u):d={a:ys,n:l[0],t:zi}[h],d===void 0)return[];l.push(d)}if(t.push({t:i,d:l}),vo.lastIndex===r.length)return t}return[]}function MM(r){if(Array.isArray(r))return Ip(r);if(r=(r||"none").trim(),r==="none")return[];var t=[],e,n=0;for(vo.lastIndex=0;e=vo.exec(r);){if(e.index!==n)return[];n=e.index+e[0].length;var i=e[1],a=sl[i];if(!a)return[];var s=e[2].split(","),o=a[0];if(o.length<s.length)return[];for(var l=[],c=0;c<o.length;c++){var u=s[c],h=o[c],d=void 0;if(u?d={A:function(v){return v.trim()==="0"?ys:Sp(v)},N:Tp,T:wp,L:Ep}[h.toUpperCase()](u):d={a:ys,n:l[0],t:zi}[h],d===void 0)return[];l.push(d)}if(t.push({t:i,d:l}),vo.lastIndex===r.length)return t}return[]}function AM(r){var t,e,n,i;switch(r.t){case"rotateX":return i=cn(Jr(r.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=cn(Jr(r.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=cn(Jr(r.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":t=r.d[0].value,e=r.d[1].value,n=r.d[2].value,i=cn(Jr(r.d[3]));var a=t*t+e*e+n*n;if(a===0)t=1,e=0,n=0;else if(a!==1){var s=Math.sqrt(a);t/=s,e/=s,n/=s}var o=Math.sin(i/2),l=o*Math.cos(i/2),c=o*o;return[1-2*(e*e+n*n)*c,2*(t*e*c+n*l),2*(t*n*c-e*l),0,2*(t*e*c-n*l),1-2*(t*t+n*n)*c,2*(e*n*c+t*l),0,2*(t*n*c+e*l),2*(e*n*c-t*l),1-2*(t*t+e*e)*c,0,0,0,0,1];case"scale":return[r.d[0].value,0,0,0,0,r.d[1].value,0,0,0,0,1,0,0,0,0,1];case"scaleX":return[r.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,r.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,r.d[0].value,0,0,0,0,1];case"scale3d":return[r.d[0].value,0,0,0,0,r.d[1].value,0,0,0,0,r.d[2].value,0,0,0,0,1];case"skew":var u=cn(Jr(r.d[0])),h=cn(Jr(r.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=cn(Jr(r.d[0])),[1,0,0,0,Math.tan(i),1,0,0,0,0,1,0,0,0,0,1];case"skewY":return i=cn(Jr(r.d[0])),[1,Math.tan(i),0,0,0,1,0,0,0,0,1,0,0,0,0,1];case"translate":return t=oi(r.d[0],0,null)||0,e=oi(r.d[1],0,null)||0,[1,0,0,0,0,1,0,0,0,0,1,0,t,e,0,1];case"translateX":return t=oi(r.d[0],0,null)||0,[1,0,0,0,0,1,0,0,0,0,1,0,t,0,0,1];case"translateY":return e=oi(r.d[0],0,null)||0,[1,0,0,0,0,1,0,0,0,0,1,0,0,e,0,1];case"translateZ":return n=oi(r.d[0],0,null)||0,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,n,1];case"translate3d":return t=oi(r.d[0],0,null)||0,e=oi(r.d[1],0,null)||0,n=oi(r.d[2],0,null)||0,[1,0,0,0,0,1,0,0,0,0,1,0,t,e,n,1];case"perspective":var d=oi(r.d[0],0,null)||0,f=d?-1/d:0;return[1,0,0,0,0,1,0,0,0,0,1,f,0,0,0,1];case"matrix":return[r.d[0].value,r.d[1].value,0,0,r.d[2].value,r.d[3].value,0,0,0,0,1,0,r.d[4].value,r.d[5].value,0,1];case"matrix3d":return r.d.map(function(v){return v.value})}}function TM(r,t){return[r[0]*t[0]+r[4]*t[1]+r[8]*t[2]+r[12]*t[3],r[1]*t[0]+r[5]*t[1]+r[9]*t[2]+r[13]*t[3],r[2]*t[0]+r[6]*t[1]+r[10]*t[2]+r[14]*t[3],r[3]*t[0]+r[7]*t[1]+r[11]*t[2]+r[15]*t[3],r[0]*t[4]+r[4]*t[5]+r[8]*t[6]+r[12]*t[7],r[1]*t[4]+r[5]*t[5]+r[9]*t[6]+r[13]*t[7],r[2]*t[4]+r[6]*t[5]+r[10]*t[6]+r[14]*t[7],r[3]*t[4]+r[7]*t[5]+r[11]*t[6]+r[15]*t[7],r[0]*t[8]+r[4]*t[9]+r[8]*t[10]+r[12]*t[11],r[1]*t[8]+r[5]*t[9]+r[9]*t[10]+r[13]*t[11],r[2]*t[8]+r[6]*t[9]+r[10]*t[10]+r[14]*t[11],r[3]*t[8]+r[7]*t[9]+r[11]*t[10]+r[15]*t[11],r[0]*t[12]+r[4]*t[13]+r[8]*t[14]+r[12]*t[15],r[1]*t[12]+r[5]*t[13]+r[9]*t[14]+r[13]*t[15],r[2]*t[12]+r[6]*t[13]+r[10]*t[14]+r[14]*t[15],r[3]*t[12]+r[7]*t[13]+r[11]*t[14]+r[15]*t[15]]}function OM(r){return r.length===0?[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]:r.map(AM).reduce(TM)}function Fp(r){var t=[0,0,0],e=[1,1,1],n=[0,0,0],i=[0,0,0,1],a=[0,0,0,1];return lS(OM(r),t,e,n,i,a),[[t,e,n,a,i]]}var CM=function(){function r(n,i){for(var a=[[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0]],s=0;s<4;s++)for(var o=0;o<4;o++)for(var l=0;l<4;l++)a[s][o]+=i[s][l]*n[l][o];return a}function t(n){return n[0][2]===0&&n[0][3]===0&&n[1][2]===0&&n[1][3]===0&&n[2][0]===0&&n[2][1]===0&&n[2][2]===1&&n[2][3]===0&&n[3][2]===0&&n[3][3]===1}function e(n,i,a,s,o){for(var l=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]],c=0;c<4;c++)l[c][3]=o[c];for(var u=0;u<3;u++)for(var h=0;h<3;h++)l[3][u]+=n[h]*l[h][u];var d=s[0],f=s[1],v=s[2],g=s[3],p=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];p[0][0]=1-2*(f*f+v*v),p[0][1]=2*(d*f-v*g),p[0][2]=2*(d*v+f*g),p[1][0]=2*(d*f+v*g),p[1][1]=1-2*(d*d+v*v),p[1][2]=2*(f*v-d*g),p[2][0]=2*(d*v-f*g),p[2][1]=2*(f*v+d*g),p[2][2]=1-2*(d*d+f*f),l=r(l,p);var y=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];a[2]&&(y[2][1]=a[2],l=r(l,y)),a[1]&&(y[2][1]=0,y[2][0]=a[0],l=r(l,y)),a[0]&&(y[2][0]=0,y[1][0]=a[0],l=r(l,y));for(var b=0;b<3;b++)for(var E=0;E<3;E++)l[b][E]*=i[b];return t(l)?[l[0][0],l[0][1],l[1][0],l[1][1],l[3][0],l[3][1]]:l[0].concat(l[1],l[2],l[3])}return e}();function NM(r){return r.toFixed(6).replace(".000000","")}function tf(r,t){var e,n;return r.decompositionPair!==t&&(r.decompositionPair=t,e=Fp(r)),t.decompositionPair!==r&&(t.decompositionPair=r,n=Fp(t)),e[0]===null||n[0]===null?[[!1],[!0],function(i){return i?t[0].d:r[0].d}]:(e[0].push(0),n[0].push(1),[e,n,function(i){var a=PM(e[0][3],n[0][3],i[5]),s=CM(i[0],i[1],i[2],a,i[4]),o=s.map(NM).join(",");return o}])}function kM(r,t){for(var e=0,n=0;n<r.length;n++)e+=r[n]*t[n];return e}function PM(r,t,e){var n=kM(r,t);n=kn(n,-1,1);var i=[];if(n===1)i=r;else for(var a=Math.acos(n),s=Math.sin(e*a)*1/Math.sqrt(1-n*n),o=0;o<4;o++)i.push(r[o]*(Math.cos(e*a)-n*s)+t[o]*s);return i}function ef(r){return r.replace(/[XY]/,"")}function nf(r){return r.replace(/(X|Y|Z|3d)?$/,"3d")}var RM=function(t,e){return t==="perspective"&&e==="perspective"||(t==="matrix"||t==="matrix3d")&&(e==="matrix"||e==="matrix3d")};function LM(r,t,e){var n=!1;if(!r.length||!t.length){r.length||(n=!0,r=t,t=[]);for(var i=function(){var J=r[a],$=J.t,at=J.d,ct=$.substring(0,5)==="scale"?1:0;t.push({t:$,d:at.map(function(ft){return typeof ft=="number"?Mn(ct):Mn(ct,ft.unit)})})},a=0;a<r.length;a++)i()}var s=[],o=[],l=[];if(r.length!==t.length){var c=tf(r,t);s=[c[0]],o=[c[1]],l=[["matrix",[c[2]]]]}else for(var u=0;u<r.length;u++){var h=r[u].t,d=t[u].t,f=r[u].d,v=t[u].d,g=sl[h],p=sl[d],y=void 0;if(RM(h,d)){var b=tf([r[u]],[t[u]]);s.push(b[0]),o.push(b[1]),l.push(["matrix",[b[2]]]);continue}else if(h===d)y=h;else if(g[2]&&p[2]&&ef(h)===ef(d))y=ef(h),f=g[2](f),v=p[2](v);else if(g[1]&&p[1]&&nf(h)===nf(d))y=nf(h),f=g[1](f),v=p[1](v);else{var E=tf(r,t);s=[E[0]],o=[E[1]],l=[["matrix",[E[2]]]];break}for(var O=[],k=[],P=[],F=0;F<f.length;F++){var B=aM(f[F],v[F],e,!1,F);O[F]=B[0],k[F]=B[1],P.push(B[2])}s.push(O),o.push(k),l.push([y,P])}if(n){var V=s;s=o,o=V}return[s,o,function(U){return U.map(function(J,$){var at=J.map(function(ct,ft){return l[$][1][ft](ct)}).join(",");return l[$][0]==="matrix"&&at.split(",").length===16&&(l[$][0]="matrix3d"),l[$][0]==="matrix3d"&&at.split(",").length===6&&(l[$][0]="matrix"),"".concat(l[$][0],"(").concat(at,")")}).join(" ")}]}var _M=jn(function(r){if(Ue(r)){if(r==="text-anchor")return[Mn(0,"px"),Mn(0,"px")];var t=r.split(" ");return t.length===1&&(t[0]==="top"||t[0]==="bottom"?(t[1]=t[0],t[0]="center"):t[1]="center"),t.length!==2?null:[Xd(zp(t[0])),Xd(zp(t[1]))]}return[Mn(r[0]||0,"px"),Mn(r[1]||0,"px")]});function zp(r){return r==="center"?"50%":r==="left"||r==="top"?"0%":r==="right"||r==="bottom"?"100%":r}var rf=[{n:"display",k:["none"]},{n:"opacity",int:!0,inh:!0,d:"1",syntax:Jt.OPACITY_VALUE},{n:"fillOpacity",int:!0,inh:!0,d:"1",syntax:Jt.OPACITY_VALUE},{n:"strokeOpacity",int:!0,inh:!0,d:"1",syntax:Jt.OPACITY_VALUE},{n:"fill",int:!0,k:["none"],d:"none",syntax:Jt.PAINT},{n:"fillRule",k:["nonzero","evenodd"],d:"nonzero"},{n:"stroke",int:!0,k:["none"],d:"none",syntax:Jt.PAINT,l:!0},{n:"shadowType",k:["inner","outer","both"],d:"outer",l:!0},{n:"shadowColor",int:!0,syntax:Jt.COLOR},{n:"shadowOffsetX",int:!0,l:!0,d:"0",syntax:Jt.LENGTH_PERCENTAGE},{n:"shadowOffsetY",int:!0,l:!0,d:"0",syntax:Jt.LENGTH_PERCENTAGE},{n:"shadowBlur",int:!0,l:!0,d:"0",syntax:Jt.SHADOW_BLUR},{n:"lineWidth",int:!0,inh:!0,d:"1",l:!0,a:["strokeWidth"],syntax:Jt.LENGTH_PERCENTAGE},{n:"increasedLineWidthForHitTesting",inh:!0,d:"0",l:!0,syntax:Jt.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:Jt.LENGTH_PERCENTAGE_12},{n:"lineDashOffset",int:!0,inh:!0,d:"0",a:["strokeDashoffset"],syntax:Jt.LENGTH_PERCENTAGE},{n:"offsetPath",syntax:Jt.DEFINED_PATH},{n:"offsetDistance",int:!0,syntax:Jt.OFFSET_DISTANCE},{n:"dx",int:!0,l:!0,d:"0",syntax:Jt.LENGTH_PERCENTAGE},{n:"dy",int:!0,l:!0,d:"0",syntax:Jt.LENGTH_PERCENTAGE},{n:"zIndex",ind:!0,int:!0,d:"0",k:["auto"],syntax:Jt.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:Jt.FILTER},{n:"clipPath",syntax:Jt.DEFINED_PATH},{n:"textPath",syntax:Jt.DEFINED_PATH},{n:"textPathSide",k:["left","right"],d:"left"},{n:"textPathStartOffset",l:!0,d:"0",syntax:Jt.LENGTH_PERCENTAGE},{n:"transform",p:100,int:!0,k:["none"],d:"none",syntax:Jt.TRANSFORM},{n:"transformOrigin",p:100,d:"0 0",l:!0,syntax:Jt.TRANSFORM_ORIGIN},{n:"cx",int:!0,l:!0,d:"0",syntax:Jt.COORDINATE},{n:"cy",int:!0,l:!0,d:"0",syntax:Jt.COORDINATE},{n:"cz",int:!0,l:!0,d:"0",syntax:Jt.COORDINATE},{n:"r",int:!0,l:!0,d:"0",syntax:Jt.LENGTH_PERCENTAGE},{n:"rx",int:!0,l:!0,d:"0",syntax:Jt.LENGTH_PERCENTAGE},{n:"ry",int:!0,l:!0,d:"0",syntax:Jt.LENGTH_PERCENTAGE},{n:"x",int:!0,l:!0,d:"0",syntax:Jt.COORDINATE},{n:"y",int:!0,l:!0,d:"0",syntax:Jt.COORDINATE},{n:"z",int:!0,l:!0,d:"0",syntax:Jt.COORDINATE},{n:"width",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:Jt.LENGTH_PERCENTAGE},{n:"height",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:Jt.LENGTH_PERCENTAGE},{n:"radius",int:!0,l:!0,d:"0",syntax:Jt.LENGTH_PERCENTAGE_14},{n:"x1",int:!0,l:!0,syntax:Jt.COORDINATE},{n:"y1",int:!0,l:!0,syntax:Jt.COORDINATE},{n:"z1",int:!0,l:!0,syntax:Jt.COORDINATE},{n:"x2",int:!0,l:!0,syntax:Jt.COORDINATE},{n:"y2",int:!0,l:!0,syntax:Jt.COORDINATE},{n:"z2",int:!0,l:!0,syntax:Jt.COORDINATE},{n:"d",int:!0,l:!0,d:"",syntax:Jt.PATH,p:50},{n:"points",int:!0,l:!0,syntax:Jt.LIST_OF_POINTS,p:50},{n:"text",l:!0,d:"",syntax:Jt.TEXT,p:50},{n:"textTransform",l:!0,inh:!0,k:["capitalize","uppercase","lowercase","none"],d:"none",syntax:Jt.TEXT_TRANSFORM,p:51},{n:"font",l:!0},{n:"fontSize",int:!0,inh:!0,d:"16px",l:!0,syntax:Jt.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:Jt.LENGTH,int:!0,d:"0"},{n:"letterSpacing",l:!0,syntax:Jt.LENGTH,int:!0,d:"0"},{n:"miterLimit",l:!0,syntax:Jt.NUMBER,d:function(t){return t===Dt.PATH||t===Dt.POLYGON||t===Dt.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:Jt.MARKER},{n:"markerEnd",syntax:Jt.MARKER},{n:"markerMid",syntax:Jt.MARKER},{n:"markerStartOffset",syntax:Jt.LENGTH,l:!0,int:!0,d:"0"},{n:"markerEndOffset",syntax:Jt.LENGTH,l:!0,int:!0,d:"0"}],DM=new Set(rf.filter(function(r){return!!r.l}).map(function(r){return r.n})),jp={},IM=function(){function r(t){var e=this;(0,C.Z)(this,r),this.runtime=t,rf.forEach(function(n){e.registerMetadata(n)})}return(0,T.Z)(r,[{key:"registerMetadata",value:function(e){[e.n].concat((0,N.Z)(e.a||[])).forEach(function(n){jp[n]=e})}},{key:"getPropertySyntax",value:function(e){return this.runtime.CSSPropertySyntaxFactory[e]}},{key:"processProperties",value:function(e,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{skipUpdateAttribute:!1,skipParse:!1,forceUpdateGeometry:!1,usedAttributes:[],memoize:!0};Object.assign(e.attributes,n);var a=e.parsedStyle.clipPath,s=e.parsedStyle.offsetPath;BM(e,n);var o=!!i.forceUpdateGeometry;if(!o){for(var l in n)if(DM.has(l)){o=!0;break}}var c=Gp(e);c.has("fill")&&n.fill&&(e.parsedStyle.fill=il(n.fill)),c.has("stroke")&&n.stroke&&(e.parsedStyle.stroke=il(n.stroke)),c.has("shadowColor")&&n.shadowColor&&(e.parsedStyle.shadowColor=il(n.shadowColor)),c.has("filter")&&n.filter&&(e.parsedStyle.filter=lM(n.filter)),c.has("radius")&&!be(n.radius)&&(e.parsedStyle.radius=Mp(n.radius,4)),c.has("lineDash")&&!be(n.lineDash)&&(e.parsedStyle.lineDash=Mp(n.lineDash,"even")),c.has("points")&&n.points&&(e.parsedStyle.points=wM(n.points)),c.has("d")&&n.d===""&&(e.parsedStyle.d=(0,z.Z)({},ap)),c.has("d")&&n.d&&(e.parsedStyle.d=Dp(n.d)),c.has("textTransform")&&n.textTransform&&this.runtime.CSSPropertySyntaxFactory[Jt.TEXT_TRANSFORM].calculator(null,null,{value:n.textTransform},e,null),c.has("clipPath")&&!Te(n.clipPath)&&this.runtime.CSSPropertySyntaxFactory[Jt.DEFINED_PATH].calculator("clipPath",a,n.clipPath,e,this.runtime),c.has("offsetPath")&&n.offsetPath&&this.runtime.CSSPropertySyntaxFactory[Jt.DEFINED_PATH].calculator("offsetPath",s,n.offsetPath,e,this.runtime),c.has("transform")&&n.transform&&(e.parsedStyle.transform=Bp(n.transform)),c.has("transformOrigin")&&n.transformOrigin&&(e.parsedStyle.transformOrigin=_M(n.transformOrigin)),c.has("markerStart")&&n.markerStart&&(e.parsedStyle.markerStart=this.runtime.CSSPropertySyntaxFactory[Jt.MARKER].calculator(null,n.markerStart,n.markerStart,null,null)),c.has("markerEnd")&&n.markerEnd&&(e.parsedStyle.markerEnd=this.runtime.CSSPropertySyntaxFactory[Jt.MARKER].calculator(null,n.markerEnd,n.markerEnd,null,null)),c.has("markerMid")&&n.markerMid&&(e.parsedStyle.markerMid=this.runtime.CSSPropertySyntaxFactory[Jt.MARKER].calculator("",n.markerMid,n.markerMid,null,null)),c.has("zIndex")&&!be(n.zIndex)&&this.runtime.CSSPropertySyntaxFactory[Jt.Z_INDEX].postProcessor(e),c.has("offsetDistance")&&!be(n.offsetDistance)&&this.runtime.CSSPropertySyntaxFactory[Jt.OFFSET_DISTANCE].postProcessor(e),c.has("transform")&&n.transform&&this.runtime.CSSPropertySyntaxFactory[Jt.TRANSFORM].postProcessor(e),c.has("transformOrigin")&&n.transformOrigin&&this.runtime.CSSPropertySyntaxFactory[Jt.TRANSFORM_ORIGIN].postProcessor(e),o&&(e.geometry.dirty=!0,e.dirty(!0,!0),i.forceUpdateGeometry||this.runtime.sceneGraphService.dirtyToRoot(e))}},{key:"updateGeometry",value:function(e){var n=e.nodeName,i=this.runtime.geometryUpdaterFactory[n];if(i){var a=e.geometry;a.contentBounds||(a.contentBounds=new yn),a.renderBounds||(a.renderBounds=new yn);var s=e.parsedStyle,o=i.update(s,e),l=o.cx,c=l===void 0?0:l,u=o.cy,h=u===void 0?0:u,d=o.cz,f=d===void 0?0:d,v=o.hwidth,g=v===void 0?0:v,p=o.hheight,y=p===void 0?0:p,b=o.hdepth,E=b===void 0?0:b,O=[Math.abs(g),Math.abs(y),E],k=s.stroke,P=s.lineWidth,F=P===void 0?1:P,B=s.increasedLineWidthForHitTesting,V=B===void 0?0:B,U=s.shadowType,J=U===void 0?"outer":U,$=s.shadowColor,at=s.filter,ct=at===void 0?[]:at,ft=s.transformOrigin,Nt=[c,h,f];a.contentBounds.update(Nt,O);var Ct=n===Dt.POLYLINE||n===Dt.POLYGON||n===Dt.PATH?Math.SQRT2:.5,gt=k&&!k.isNone;if(gt){var bt=((F||0)+(V||0))*Ct;O[0]+=bt,O[1]+=bt}if(a.renderBounds.update(Nt,O),$&&J&&J!=="inner"){var Pt=a.renderBounds,zt=Pt.min,Ut=Pt.max,$t=s.shadowBlur,re=s.shadowOffsetX,ce=s.shadowOffsetY,le=$t||0,Ee=re||0,Ne=ce||0,We=zt[0]-le+Ee,He=Ut[0]+le+Ee,cr=zt[1]-le+Ne,$e=Ut[1]+le+Ne;zt[0]=Math.min(zt[0],We),Ut[0]=Math.max(Ut[0],He),zt[1]=Math.min(zt[1],cr),Ut[1]=Math.max(Ut[1],$e),a.renderBounds.setMinMax(zt,Ut)}ct.forEach(function(pr){var Na=pr.name,Tr=pr.params;if(Na==="blur"){var ai=Tr[0].value;a.renderBounds.update(a.renderBounds.center,we(a.renderBounds.halfExtents,a.renderBounds.halfExtents,[ai,ai,0]))}else if(Na==="drop-shadow"){var je=Tr[0].value,tn=Tr[1].value,Ge=Tr[2].value,Ke=a.renderBounds,on=Ke.min,pe=Ke.max,Qe=on[0]-Ge+je,en=pe[0]+Ge+je,rr=on[1]-Ge+tn,nn=pe[1]+Ge+tn;on[0]=Math.min(on[0],Qe),pe[0]=Math.max(pe[0],en),on[1]=Math.min(on[1],rr),pe[1]=Math.max(pe[1],nn),a.renderBounds.setMinMax(on,pe)}}),e.geometry.dirty=!1;var yi=g<0,Ir=y<0,ss=(yi?-1:1)*(ft?oi(ft[0],0,e,!0):0),Ar=(Ir?-1:1)*(ft?oi(ft[1],1,e,!0):0);(ss||Ar)&&e.setOrigin(ss,Ar)}}},{key:"updateSizeAttenuation",value:function(e,n){e.style.isSizeAttenuation?(e.style.rawLineWidth||(e.style.rawLineWidth=e.style.lineWidth),e.style.lineWidth=(e.style.rawLineWidth||1)/n,e.nodeName===Dt.CIRCLE&&(e.style.rawR||(e.style.rawR=e.style.r),e.style.r=(e.style.rawR||1)/n)):(e.style.rawLineWidth&&(e.style.lineWidth=e.style.rawLineWidth,delete e.style.rawLineWidth),e.nodeName===Dt.CIRCLE&&e.style.rawR&&(e.style.r=e.style.rawR,delete e.style.rawR))}}])}();function BM(r,t){var e=Gp(r);for(var n in t)e.has(n)&&(r.parsedStyle[n]=t[n])}function Gp(r){return r.constructor.PARSED_STYLE_LIST}var FM=function(){function r(){(0,C.Z)(this,r),this.mixer=Qd}return(0,T.Z)(r,[{key:"calculator",value:function(e,n,i,a){return Jr(i)}}])}(),zM=function(){function r(){(0,C.Z)(this,r)}return(0,T.Z)(r,[{key:"calculator",value:function(e,n,i,a,s){return i instanceof Ai&&(i=null),s.sceneGraphService.updateDisplayObjectDependency(e,n,i,a),e==="clipPath"&&a.forEach(function(o){o.childNodes.length===0&&s.sceneGraphService.dirtyToRoot(o)}),i}}])}(),jM=function(){function r(){(0,C.Z)(this,r),this.parser=il,this.mixer=eM}return(0,T.Z)(r,[{key:"calculator",value:function(e,n,i,a){return i instanceof Ai?i.value==="none"?yp:bp:i}}])}(),GM=function(){function r(){(0,C.Z)(this,r)}return(0,T.Z)(r,[{key:"calculator",value:function(e,n,i){return i instanceof Ai?[]:i}}])}();function Wp(r){var t=r.parsedStyle,e=t.fontSize;return be(e)?null:e}var af=function(){function r(){(0,C.Z)(this,r),this.mixer=Qd}return(0,T.Z)(r,[{key:"calculator",value:function(e,n,i,a,s){if(ie(i))return i;if(hn.isRelativeUnit(i.unit)){if(i.unit===te.kPercentage)return 0;if(i.unit===te.kEms){if(a.parentNode){var o=Wp(a.parentNode);if(o)return o*=i.value,o}return 0}if(i.unit===te.kRems){var l;if(a!=null&&(l=a.ownerDocument)!==null&&l!==void 0&&l.documentElement){var c=Wp(a.ownerDocument.documentElement);if(c)return c*=i.value,c}return 0}}else return i.value}}])}(),WM=function(){function r(){(0,C.Z)(this,r),this.mixer=Op}return(0,T.Z)(r,[{key:"calculator",value:function(e,n,i){return i.map(function(a){return a.value})}}])}(),ZM=function(){function r(){(0,C.Z)(this,r),this.mixer=Op}return(0,T.Z)(r,[{key:"calculator",value:function(e,n,i){return i.map(function(a){return a.value})}}])}(),VM=function(){function r(){(0,C.Z)(this,r)}return(0,T.Z)(r,[{key:"calculator",value:function(e,n,i,a){var s;i instanceof Ai&&(i=null);var o=(s=i)===null||s===void 0?void 0:s.cloneNode(!0);return o&&(o.style.isMarker=!0),o}}])}(),UM=function(){function r(){(0,C.Z)(this,r),this.mixer=Qd}return(0,T.Z)(r,[{key:"calculator",value:function(e,n,i){return i.value}}])}(),YM=function(){function r(){(0,C.Z)(this,r),this.mixer=qd(0,1)}return(0,T.Z)(r,[{key:"calculator",value:function(e,n,i){return i.value}},{key:"postProcessor",value:function(e){var n=e.parsedStyle,i=n.offsetPath,a=n.offsetDistance;if(i){var s=i.nodeName;if(s===Dt.LINE||s===Dt.PATH||s===Dt.POLYLINE){var o=i.getPoint(a);o&&e.setLocalPosition(o.x,o.y)}}}}])}(),HM=function(){function r(){(0,C.Z)(this,r),this.mixer=qd(0,1)}return(0,T.Z)(r,[{key:"calculator",value:function(e,n,i){return i.value}}])}(),XM=function(){function r(){(0,C.Z)(this,r),this.parser=Dp,this.mixer=EM}return(0,T.Z)(r,[{key:"calculator",value:function(e,n,i){return i instanceof Ai&&i.value==="unset"?{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new lo(0,0,0,0)}:i}}])}(),KM=(0,T.Z)(function r(){(0,C.Z)(this,r),this.mixer=SM}),QM=function(r){function t(){var e;(0,C.Z)(this,t);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return e=I(this,t,[].concat(i)),e.mixer=qd(0,1/0),e}return(0,L.Z)(t,r),(0,T.Z)(t)}(af),qM=function(){function r(){(0,C.Z)(this,r)}return(0,T.Z)(r,[{key:"calculator",value:function(e,n,i,a){return i instanceof Ai?i.value==="unset"?"":i.value:"".concat(i)}},{key:"postProcessor",value:function(e){e.nodeValue="".concat(e.parsedStyle.text)||""}}])}(),JM=function(){function r(){(0,C.Z)(this,r)}return(0,T.Z)(r,[{key:"calculator",value:function(e,n,i,a){var s=a.getAttribute("text");if(s){var o=s;i.value==="capitalize"?o=s.charAt(0).toUpperCase()+s.slice(1):i.value==="lowercase"?o=s.toLowerCase():i.value==="uppercase"&&(o=s.toUpperCase()),a.parsedStyle.text=o}return i.value}}])}(),h9=function(t){return Object.fromEntries(Object.entries(t).filter(function(e){var n=_slicedToArray(e,2),i=n[1];return i!==void 0}))},sf=new WeakMap;function $M(r,t,e){if(r){var n=typeof r=="string"?document.getElementById(r):r;sf.has(n)&&sf.get(n).destroy(e),sf.set(n,t)}}var of=typeof window!="undefined"&&typeof window.document!="undefined";function tA(r){return!!r.getAttribute}function eA(r,t){for(var e=0,n=r.length;e<n;){var i=e+n>>>1;Zp(r[i],t)<0?e=i+1:n=i}return e}function Zp(r,t){var e=Number(r.parsedStyle.zIndex||0),n=Number(t.parsedStyle.zIndex||0);if(e===n){var i=r.parentNode;if(i){var a=i.childNodes||[];return a.indexOf(r)-a.indexOf(t)}}return e-n}function Vp(r){var t=r;do{var e,n=(e=t.parsedStyle)===null||e===void 0?void 0:e.clipPath;if(n)return t;t=t.parentElement}while(t!==null);return null}var Up="px";function nA(r,t,e){of&&r.style&&(r.style.width=t+Up,r.style.height=e+Up)}function Yp(r,t){if(of)return document.defaultView.getComputedStyle(r,null).getPropertyValue(t)}function rA(r){var t=Yp(r,"width");return t==="auto"?r.offsetWidth:parseFloat(t)}function iA(r){var t=Yp(r,"height");return t==="auto"?r.offsetHeight:parseFloat(t)}var aA=1,sA={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"},lf=typeof performance=="object"&&performance.now?performance:Date;function Cc(r){return r.nodeName===Dt.FRAGMENT?!0:r.getRootNode().nodeName===Dt.FRAGMENT}function Es(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"auto",t=arguments.length>1?arguments[1]:void 0,e=arguments.length>2?arguments[2]:void 0,n=!1,i=!1,a=!!t&&!t.isNone,s=!!e&&!e.isNone;return r==="visiblepainted"||r==="painted"||r==="auto"?(n=a,i=s):r==="visiblefill"||r==="fill"?n=!0:r==="visiblestroke"||r==="stroke"?i=!0:(r==="visible"||r==="all")&&(n=!0,i=!0),[n,i]}var oA=1,lA=function(){return oA++},na=typeof self=="object"&&self.self===self?self:typeof S.g=="object"&&S.g.global===S.g?S.g:{},cA=Date.now(),uA=function(){return na.performance&&typeof na.performance.now=="function"?na.performance.now():Date.now()-cA},ol={},Hp=Date.now(),hA=function(t){if(typeof t!="function")throw new TypeError("".concat(t," is not a function"));var e=Date.now(),n=e-Hp,i=n>16?0:16-n,a=lA();return ol[a]=t,Object.keys(ol).length>1||setTimeout(function(){Hp=e;var s=ol;ol={},Object.keys(s).forEach(function(o){return s[o](uA())})},i),a},dA=function(t){delete ol[t]},fA=["","webkit","moz","ms","o"],Xp=function(t){return typeof t!="string"?hA:t===""?na.requestAnimationFrame:na["".concat(t,"RequestAnimationFrame")]},vA=function(t){return typeof t!="string"?dA:t===""?na.cancelAnimationFrame:na["".concat(t,"CancelAnimationFrame")]||na["".concat(t,"CancelRequestAnimationFrame")]},gA=function(t,e){for(var n=0;t[n]!==void 0;){if(e(t[n]))return t[n];n+=1}},Kp=gA(fA,function(r){return!!Xp(r)}),cf=Xp(Kp),Qp=vA(Kp);na.requestAnimationFrame=cf,na.cancelAnimationFrame=Qp;var pA=function(){function r(){(0,C.Z)(this,r),this.callbacks=[]}return(0,T.Z)(r,[{key:"getCallbacksNum",value:function(){return this.callbacks.length}},{key:"tapPromise",value:function(e,n){this.callbacks.push(n)}},{key:"promise",value:function(){for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];return Promise.all(this.callbacks.map(function(a){return a.apply(void 0,n)}))}}])}(),mA=function(){function r(){(0,C.Z)(this,r),this.callbacks=[]}return(0,T.Z)(r,[{key:"tapPromise",value:function(e,n){this.callbacks.push(n)}},{key:"promise",value:function(){var t=(0,Fa.Z)((0,Pr.Z)().mark(function n(){var i,a,s,o,l=arguments;return(0,Pr.Z)().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:if(!this.callbacks.length){c.next=6;break}return c.next=1,(i=this.callbacks)[0].apply(i,l);case 1:a=c.sent,s=0;case 2:if(!(s<this.callbacks.length-1)){c.next=5;break}return o=this.callbacks[s],c.next=3,o(a);case 3:a=c.sent;case 4:s++,c.next=2;break;case 5:return c.abrupt("return",a);case 6:return c.abrupt("return",null);case 7:case"end":return c.stop()}},n,this)}));function e(){return t.apply(this,arguments)}return e}()}])}(),jr=function(){function r(){(0,C.Z)(this,r),this.callbacks=[]}return(0,T.Z)(r,[{key:"tap",value:function(e,n){this.callbacks.push(n)}},{key:"call",value:function(){for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];var a=arguments;this.callbacks.forEach(function(s){s.apply(void 0,a)})}}])}(),uf=function(){function r(){(0,C.Z)(this,r),this.callbacks=[]}return(0,T.Z)(r,[{key:"tap",value:function(e,n){this.callbacks.push(n)}},{key:"call",value:function(){for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];if(this.callbacks.length){for(var a=arguments,s=this.callbacks[0].apply(void 0,a),o=0;o<this.callbacks.length-1;o++){var l=this.callbacks[o];s=l(s)}return s}return null}}])}(),yA=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],bA=/([\"\'])[^\'\"]+\1/;function qp(r){var t=r.fontSize,e=t===void 0?16:t,n=r.fontFamily,i=n===void 0?"sans-serif":n,a=r.fontStyle,s=a===void 0?"normal":a,o=r.fontVariant,l=o===void 0?"normal":o,c=r.fontWeight,u=c===void 0?"normal":c;return{fontSize:e,fontFamily:i,fontStyle:s,fontVariant:l,fontWeight:u}}var Jp=jn(function(t){for(var e=qp(t),n=e.fontSize,i=e.fontFamily,a=e.fontStyle,s=e.fontVariant,o=e.fontWeight,l=ie(n)&&"".concat(n,"px")||"16px",c=i.split(","),u=c.length-1;u>=0;u--){var h=c[u].trim();!bA.test(h)&&yA.indexOf(h)<0&&(h='"'.concat(h,'"')),c[u]=h}return"".concat(a," ").concat(s," ").concat(o," ").concat(l," ").concat(c.join(","))},function(r){var t=qp(r),e=t.fontSize,n=t.fontFamily,i=t.fontStyle,a=t.fontVariant,s=t.fontWeight;return"".concat(i,"_").concat(a,"_").concat(s,"_").concat(e,"_").concat(n)}),xA=1e-6,ll=function(t){return Math.max(t,xA)};function hf(r,t,e){return Et(r),r[4]=Math.tan(t),r[1]=Math.tan(e),r}var Gn=oe(),EA=oe(),wA={scale:function(t){De(Gn,[t[0].value,t[1].value,1].map(function(e){return ll(e)}))},scaleX:function(t){De(Gn,[t[0].value,1,1].map(function(e){return ll(e)}))},scaleY:function(t){De(Gn,[1,t[0].value,1].map(function(e){return ll(e)}))},scaleZ:function(t){De(Gn,[1,1,t[0].value].map(function(e){return ll(e)}))},scale3d:function(t){De(Gn,[t[0].value,t[1].value,t[2].value].map(function(e){return ll(e)}))},translate:function(t){hr(Gn,[t[0].value,t[1].value,0])},translateX:function(t){hr(Gn,[t[0].value,0,0])},translateY:function(t){hr(Gn,[0,t[0].value,0])},translateZ:function(t){hr(Gn,[0,0,t[0].value])},translate3d:function(t){hr(Gn,[t[0].value,t[1].value,t[2].value])},rotate:function(t){Nn(Gn,cn(Jr(t[0])))},rotateX:function(t){Cr(Gn,cn(Jr(t[0])))},rotateY:function(t){Nr(Gn,cn(Jr(t[0])))},rotateZ:function(t){Nn(Gn,cn(Jr(t[0])))},rotate3d:function(t){Qn(Gn,cn(Jr(t[3])),[t[0].value,t[1].value,t[2].value])},skew:function(t){hf(Gn,cn(t[0].value),cn(t[1].value))},skewX:function(t){hf(Gn,cn(t[0].value),0)},skewY:function(t){hf(Gn,0,cn(t[0].value))},matrix:function(t){rn(Gn,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){rn.apply(A,[Gn].concat((0,N.Z)(t.map(function(e){return e.value}))))}},SA=jt(1,1,1),MA=xt(),$p={translate:function(t,e){Vt.sceneGraphService.setLocalScale(t,SA,!1),Vt.sceneGraphService.setLocalEulerAngles(t,MA,void 0,void 0,!1),Vt.sceneGraphService.setLocalPosition(t,[e[0].value,e[1].value,0],!1),Vt.sceneGraphService.dirtyLocalTransform(t,t.transformable)}};function tm(r,t){if(r.length){if(r.length===1&&$p[r[0].t]){$p[r[0].t](t,r[0].d);return}for(var e=Et(EA),n=0;n<r.length;n++){var i=r[n],a=i.t,s=i.d,o=wA[a];o&&(o(s),pg(e,e,Gn))}t.setLocalTransform(e)}else t.resetLocalTransform();return t.getLocalTransform()}var AA=function(){function r(){(0,C.Z)(this,r),this.parser=MM,this.mixer=LM}return(0,T.Z)(r,[{key:"calculator",value:function(e,n,i,a){return i instanceof Ai?[]:i}},{key:"postProcessor",value:function(e){tm(e.parsedStyle.transform,e)}}])}(),TA=function(){function r(){(0,C.Z)(this,r)}return(0,T.Z)(r,[{key:"postProcessor",value:function(e){var n=e.parsedStyle.transformOrigin;n[0].unit===te.kPixels&&n[1].unit===te.kPixels?e.setOrigin(n[0].value,n[1].value):e.getGeometryBounds()}}])}(),OA=function(){function r(){(0,C.Z)(this,r)}return(0,T.Z)(r,[{key:"calculator",value:function(e,n,i,a){return i.value}},{key:"postProcessor",value:function(e){if(e.parentNode){var n=e.parentNode,i=n.renderable,a=n.sortable;i&&n.dirty(),a&&(a.dirty=!0,a.dirtyReason=pc.Z_INDEX_CHANGED)}}}])}(),CA=function(){function r(){(0,C.Z)(this,r)}return(0,T.Z)(r,[{key:"update",value:function(e,n){var i=e.cx,a=i===void 0?0:i,s=e.cy,o=s===void 0?0:s,l=e.r,c=l===void 0?0:l;return{cx:a,cy:o,hwidth:c,hheight:c}}}])}(),NA=function(){function r(){(0,C.Z)(this,r)}return(0,T.Z)(r,[{key:"update",value:function(e,n){var i=e.cx,a=i===void 0?0:i,s=e.cy,o=s===void 0?0:s,l=e.rx,c=l===void 0?0:l,u=e.ry,h=u===void 0?0:u;return{cx:a,cy:o,hwidth:c,hheight:h}}}])}(),kA=function(){function r(){(0,C.Z)(this,r)}return(0,T.Z)(r,[{key:"update",value:function(e){var n=e.x1,i=e.y1,a=e.x2,s=e.y2,o=Math.min(n,a),l=Math.max(n,a),c=Math.min(i,s),u=Math.max(i,s),h=l-o,d=u-c,f=h/2,v=d/2;return{cx:o+f,cy:c+v,hwidth:f,hheight:v}}}])}(),PA=function(){function r(){(0,C.Z)(this,r)}return(0,T.Z)(r,[{key:"update",value:function(e){var n=e.d,i=n.rect,a=i.x,s=i.y,o=i.width,l=i.height,c=o/2,u=l/2;return{cx:a+c,cy:s+u,hwidth:c,hheight:u}}}])}(),RA=function(){function r(){(0,C.Z)(this,r)}return(0,T.Z)(r,[{key:"update",value:function(e){if(e.points&&Kr(e.points.points)){var n=e.points.points,i=Math.min.apply(Math,(0,N.Z)(n.map(function(d){return d[0]}))),a=Math.max.apply(Math,(0,N.Z)(n.map(function(d){return d[0]}))),s=Math.min.apply(Math,(0,N.Z)(n.map(function(d){return d[1]}))),o=Math.max.apply(Math,(0,N.Z)(n.map(function(d){return d[1]}))),l=a-i,c=o-s,u=l/2,h=c/2;return{cx:i+u,cy:s+h,hwidth:u,hheight:h}}return{cx:0,cy:0,hwidth:0,hheight:0}}}])}(),LA=function(){function r(){(0,C.Z)(this,r)}return(0,T.Z)(r,[{key:"update",value:function(e,n){var i=e.x,a=i===void 0?0:i,s=e.y,o=s===void 0?0:s,l=e.src,c=e.width,u=c===void 0?0:c,h=e.height,d=h===void 0?0:h,f=u,v=d;return l&&!Ue(l)&&(f||(f=l.width,e.width=f),v||(v=l.height,e.height=v)),{cx:a+f/2,cy:o+v/2,hwidth:f/2,hheight:v/2}}}])}(),_A=function(){function r(t){(0,C.Z)(this,r),this.globalRuntime=t}return(0,T.Z)(r,[{key:"isReadyToMeasure",value:function(e,n){var i=e.text;return i}},{key:"update",value:function(e,n){var i,a=e.text,s=e.textAlign,o=s===void 0?"start":s,l=e.lineWidth,c=l===void 0?1:l,u=e.textBaseline,h=u===void 0?"alphabetic":u,d=e.dx,f=d===void 0?0:d,v=e.dy,g=v===void 0?0:v,p=e.x,y=p===void 0?0:p,b=e.y,E=b===void 0?0:b;if(!this.isReadyToMeasure(e,n))return e.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 O=(n==null||(i=n.ownerDocument)===null||i===void 0||(i=i.defaultView)===null||i===void 0?void 0:i.getConfig())||{},k=O.offscreenCanvas,P=this.globalRuntime.textService.measureText(a,e,k);e.metrics=P;var F=P.width,B=P.height,V=F/2,U=B/2,J=y+V;o==="center"||o==="middle"?J+=c/2-V:(o==="right"||o==="end")&&(J+=c-V*2);var $=E-U;return h==="middle"?$+=U:h==="top"||h==="hanging"?$+=U*2:h==="alphabetic"||(h==="bottom"||h==="ideographic")&&($+=0),f&&(J+=f),g&&($+=g),{cx:J,cy:$,hwidth:V,hheight:U}}}])}(),DA=function(){function r(){(0,C.Z)(this,r)}return(0,T.Z)(r,[{key:"update",value:function(e,n){return{cx:0,cy:0,hwidth:0,hheight:0}}}])}(),IA=function(){function r(){(0,C.Z)(this,r)}return(0,T.Z)(r,[{key:"update",value:function(e,n){var i=e.x,a=i===void 0?0:i,s=e.y,o=s===void 0?0:s,l=e.width,c=l===void 0?0:l,u=e.height,h=u===void 0?0:u;return{cx:a+c/2,cy:o+h/2,hwidth:c/2,hheight:h/2}}}])}();function d9(r){return!!r.type}var Nc=function(){function r(t){(0,C.Z)(this,r),this.eventPhase=r.prototype.NONE,this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.defaultPrevented=!1,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new yr,this.page=new yr,this.canvas=new yr,this.viewport=new yr,this.composed=!1,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=t}return(0,T.Z)(r,[{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(ln)}}])}(),em=function(r){function t(){var e;(0,C.Z)(this,t);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return e=I(this,t,[].concat(i)),e.client=new yr,e.movement=new yr,e.offset=new yr,e.global=new yr,e.screen=new yr,e}return(0,L.Z)(t,r),(0,T.Z)(t,[{key:"clientX",get:function(){return this.client.x}},{key:"clientY",get:function(){return this.client.y}},{key:"movementX",get:function(){return this.movement.x}},{key:"movementY",get:function(){return this.movement.y}},{key:"offsetX",get:function(){return this.offset.x}},{key:"offsetY",get:function(){return this.offset.y}},{key:"globalX",get:function(){return this.global.x}},{key:"globalY",get:function(){return this.global.y}},{key:"screenX",get:function(){return this.screen.x}},{key:"screenY",get:function(){return this.screen.y}},{key:"getModifierState",value:function(n){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(n)}},{key:"initMouseEvent",value:function(){throw new Error(ln)}}])}(Nc),kc=function(r){function t(){var e;(0,C.Z)(this,t);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return e=I(this,t,[].concat(i)),e.width=0,e.height=0,e.isPrimary=!1,e}return(0,L.Z)(t,r),(0,T.Z)(t,[{key:"getCoalescedEvents",value:function(){return this.type==="pointermove"||this.type==="mousemove"||this.type==="touchmove"?[this]:[]}},{key:"getPredictedEvents",value:function(){throw new Error("getPredictedEvents is not supported!")}},{key:"clone",value:function(){return this.manager.clonePointerEvent(this)}}])}(em),df=function(r){function t(){return(0,C.Z)(this,t),I(this,t,arguments)}return(0,L.Z)(t,r),(0,T.Z)(t,[{key:"clone",value:function(){return this.manager.cloneWheelEvent(this)}}])}(em),Jn=function(r){function t(e,n){var i;return(0,C.Z)(this,t),i=I(this,t,[null]),i.type=e,i.detail=n,Object.assign(i,n),i}return(0,L.Z)(t,r),(0,T.Z)(t)}(Nc),nm=function(){function r(){(0,C.Z)(this,r),this.emitter=new X}return(0,T.Z)(r,[{key:"on",value:function(e,n,i){return this.addEventListener(e,n,i),this}},{key:"addEventListener",value:function(e,n,i){var a=!1,s=!1;if(qo(i))a=i;else if(i){var o=i.capture;a=o===void 0?!1:o;var l=i.once;s=l===void 0?!1:l}a&&(e+="capture"),n=ue(n)?n:n.handleEvent;var c=ue(n)?void 0:n;return s?this.emitter.once(e,n,c):this.emitter.on(e,n,c),this}},{key:"off",value:function(e,n,i){return e?this.removeEventListener(e,n,i):this.removeAllEventListeners(),this}},{key:"removeAllEventListeners",value:function(){var e;(e=this.emitter)===null||e===void 0||e.removeAllListeners()}},{key:"removeEventListener",value:function(e,n,i){var a;if(!this.emitter)return this;var s=qo(i)?i:i==null?void 0:i.capture;s&&(e+="capture"),n=ue(n)?n:(a=n)===null||a===void 0?void 0:a.handleEvent;var o=ue(n)?void 0:n;return this.emitter.off(e,n,o),this}},{key:"emit",value:function(e,n){this.dispatchEvent(new Jn(e,n))}},{key:"dispatchEventToSelf",value:function(e){e.target||(e.target=this),e.currentTarget=this,this.emitter.emit(e.type,e)}},{key:"dispatchEvent",value:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,i=arguments.length>2?arguments[2]:void 0;if(i)return this.dispatchEventToSelf(e),!0;var a;if(this.document)a=this;else if(this.defaultView)a=this.defaultView;else{var s;a=(s=this.ownerDocument)===null||s===void 0?void 0:s.defaultView}if(a){if(e.manager=a.getEventService(),!e.manager)return!1;e.defaultPrevented=!1,e.path?e.path.length=0:e.page=[],n||(e.target=this),e.manager.dispatchEvent(e,e.type,n)}else this.dispatchEventToSelf(e);return!e.defaultPrevented}}])}(),On=function(r){function t(){var e;(0,C.Z)(this,t);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return e=I(this,t,[].concat(i)),e.shadow=!1,e.ownerDocument=null,e.isConnected=!1,e.baseURI="",e.childNodes=[],e.nodeType=0,e.nodeName="",e.nodeValue=null,e.parentNode=null,e.destroyed=!1,e}return(0,L.Z)(t,r),(0,T.Z)(t,[{key:"textContent",get:function(){var n="";this.nodeName===Dt.TEXT&&(n+=this.style.text);var i=vs(this.childNodes),a;try{for(i.s();!(a=i.n()).done;){var s=a.value;s.nodeName===Dt.TEXT?n+=s.nodeValue:n+=s.textContent}}catch(o){i.e(o)}finally{i.f()}return n},set:function(n){var i=this;this.childNodes.slice().forEach(function(a){i.removeChild(a)}),this.nodeName===Dt.TEXT&&(this.style.text="".concat(n))}},{key:"getRootNode",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return this.parentNode?this.parentNode.getRootNode(n):n.composed&&this.host?this.host.getRootNode(n):this}},{key:"hasChildNodes",value:function(){return this.childNodes.length>0}},{key:"isDefaultNamespace",value:function(n){throw new Error(ln)}},{key:"lookupNamespaceURI",value:function(n){throw new Error(ln)}},{key:"lookupPrefix",value:function(n){throw new Error(ln)}},{key:"normalize",value:function(){throw new Error(ln)}},{key:"isEqualNode",value:function(n){return this===n}},{key:"isSameNode",value:function(n){return this.isEqualNode(n)}},{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(n){if(n===this)return 0;for(var i=n,a=this,s=[i],o=[a];(l=i.parentNode)!==null&&l!==void 0?l:a.parentNode;){var l;i=i.parentNode?(s.push(i.parentNode),i.parentNode):i,a=a.parentNode?(o.push(a.parentNode),a.parentNode):a}if(i!==a)return t.DOCUMENT_POSITION_DISCONNECTED|t.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC|t.DOCUMENT_POSITION_PRECEDING;var c=s.length>o.length?s:o,u=c===s?o:s;if(c[c.length-u.length]===u[0])return c===s?t.DOCUMENT_POSITION_CONTAINED_BY|t.DOCUMENT_POSITION_FOLLOWING:t.DOCUMENT_POSITION_CONTAINS|t.DOCUMENT_POSITION_PRECEDING;for(var h=c.length-u.length,d=u.length-1;d>=0;d--){var f=u[d],v=c[h+d];if(v!==f){var g=f.parentNode.childNodes;return g.indexOf(f)<g.indexOf(v)?u===s?t.DOCUMENT_POSITION_PRECEDING:t.DOCUMENT_POSITION_FOLLOWING:c===s?t.DOCUMENT_POSITION_PRECEDING:t.DOCUMENT_POSITION_FOLLOWING}}return t.DOCUMENT_POSITION_FOLLOWING}},{key:"contain",value:function(n){return this.contains(n)}},{key:"contains",value:function(n){for(var i=n;i&&this!==i;)i=i.parentNode;return!!i}},{key:"getAncestor",value:function(n){for(var i=this;n>0&&i;)i=i.parentNode,n--;return i}},{key:"forEach",value:function(n){for(var i=[this];i.length>0;){var a=i.pop(),s=n(a);if(s===!1)break;for(var o=a.childNodes.length-1;o>=0;o--)i.push(a.childNodes[o])}}}],[{key:"isNode",value:function(n){return!!n.childNodes}}])}(nm);On.DOCUMENT_POSITION_DISCONNECTED=1,On.DOCUMENT_POSITION_PRECEDING=2,On.DOCUMENT_POSITION_FOLLOWING=4,On.DOCUMENT_POSITION_CONTAINS=8,On.DOCUMENT_POSITION_CONTAINED_BY=16,On.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC=32;var BA=2048,FA=function(){function r(t,e){var n=this;(0,C.Z)(this,r),this.nativeHTMLMap=new WeakMap,this.cursor="default",this.mappingTable={},this.mappingState={trackingData:{}},this.eventPool=new Map,this.tmpMatrix=oe(),this.tmpVec3=xt(),this.onPointerDown=function(i){var a=n.createPointerEvent(i);if(n.dispatchEvent(a,"pointerdown"),a.pointerType==="touch")n.dispatchEvent(a,"touchstart");else if(a.pointerType==="mouse"||a.pointerType==="pen"){var s=a.button===2;n.dispatchEvent(a,s?"rightdown":"mousedown")}var o=n.trackingData(i.pointerId);o.pressTargetsByButton[i.button]=a.composedPath(),n.freeEvent(a)},this.onPointerUp=function(i){var a=lf.now(),s=n.createPointerEvent(i,void 0,void 0,n.context.config.alwaysTriggerPointerEventOnCanvas?n.rootTarget:void 0);if(n.dispatchEvent(s,"pointerup"),s.pointerType==="touch")n.dispatchEvent(s,"touchend");else if(s.pointerType==="mouse"||s.pointerType==="pen"){var o=s.button===2;n.dispatchEvent(s,o?"rightup":"mouseup")}var l=n.trackingData(i.pointerId),c=n.findMountedTarget(l.pressTargetsByButton[i.button]),u=c;if(c&&!s.composedPath().includes(c)){for(var h=c;h&&!s.composedPath().includes(h);){if(s.currentTarget=h,n.notifyTarget(s,"pointerupoutside"),s.pointerType==="touch")n.notifyTarget(s,"touchendoutside");else if(s.pointerType==="mouse"||s.pointerType==="pen"){var d=s.button===2;n.notifyTarget(s,d?"rightupoutside":"mouseupoutside")}On.isNode(h)&&(h=h.parentNode)}delete l.pressTargetsByButton[i.button],u=h}if(u){var f,v=n.clonePointerEvent(s,"click");v.target=u,v.path=[],l.clicksByButton[i.button]||(l.clicksByButton[i.button]={clickCount:0,target:v.target,timeStamp:a});var g=n.context.renderingContext.root.ownerDocument.defaultView,p=l.clicksByButton[i.button];p.target===v.target&&a-p.timeStamp<g.getConfig().dblClickSpeed?++p.clickCount:p.clickCount=1,p.target=v.target,p.timeStamp=a,v.detail=p.clickCount,(f=s.detail)!==null&&f!==void 0&&f.preventClick||(!n.context.config.useNativeClickEvent&&(v.pointerType==="mouse"||v.pointerType==="touch")&&n.dispatchEvent(v,"click"),n.dispatchEvent(v,"pointertap")),n.freeEvent(v)}n.freeEvent(s)},this.onPointerMove=function(i){var a=n.createPointerEvent(i,void 0,void 0,n.context.config.alwaysTriggerPointerEventOnCanvas?n.rootTarget:void 0),s=a.pointerType==="mouse"||a.pointerType==="pen",o=n.trackingData(i.pointerId),l=n.findMountedTarget(o.overTargets);if(o.overTargets&&l!==a.target){var c=i.type==="mousemove"?"mouseout":"pointerout",u=n.createPointerEvent(i,c,l||void 0);if(n.dispatchEvent(u,"pointerout"),s&&n.dispatchEvent(u,"mouseout"),!a.composedPath().includes(l)){var h=n.createPointerEvent(i,"pointerleave",l||void 0);for(h.eventPhase=h.AT_TARGET;h.target&&!a.composedPath().includes(h.target);)h.currentTarget=h.target,n.notifyTarget(h),s&&n.notifyTarget(h,"mouseleave"),On.isNode(h.target)&&(h.target=h.target.parentNode);n.freeEvent(h)}n.freeEvent(u)}if(l!==a.target){var d=i.type==="mousemove"?"mouseover":"pointerover",f=n.clonePointerEvent(a,d);n.dispatchEvent(f,"pointerover"),s&&n.dispatchEvent(f,"mouseover");for(var v=l&&On.isNode(l)&&l.parentNode;v&&v!==(On.isNode(n.rootTarget)&&n.rootTarget.parentNode)&&v!==a.target;)v=v.parentNode;var g=!v||v===(On.isNode(n.rootTarget)&&n.rootTarget.parentNode);if(g){var p=n.clonePointerEvent(a,"pointerenter");for(p.eventPhase=p.AT_TARGET;p.target&&p.target!==l&&p.target!==(On.isNode(n.rootTarget)&&n.rootTarget.parentNode);)p.currentTarget=p.target,n.notifyTarget(p),s&&n.notifyTarget(p,"mouseenter"),On.isNode(p.target)&&(p.target=p.target.parentNode);n.freeEvent(p)}n.freeEvent(f)}n.dispatchEvent(a,"pointermove"),a.pointerType==="touch"&&n.dispatchEvent(a,"touchmove"),s&&(n.dispatchEvent(a,"mousemove"),n.cursor=n.getCursor(a.target)),o.overTargets=a.composedPath(),n.freeEvent(a)},this.onPointerOut=function(i){var a=n.trackingData(i.pointerId);if(a.overTargets){var s=i.pointerType==="mouse"||i.pointerType==="pen",o=n.findMountedTarget(a.overTargets),l=n.createPointerEvent(i,"pointerout",o||void 0);n.dispatchEvent(l),s&&n.dispatchEvent(l,"mouseout");var c=n.createPointerEvent(i,"pointerleave",o||void 0);for(c.eventPhase=c.AT_TARGET;c.target&&c.target!==(On.isNode(n.rootTarget)&&n.rootTarget.parentNode);)c.currentTarget=c.target,n.notifyTarget(c),s&&n.notifyTarget(c,"mouseleave"),On.isNode(c.target)&&(c.target=c.target.parentNode);a.overTargets=null,n.freeEvent(l),n.freeEvent(c)}n.cursor=null},this.onPointerOver=function(i){var a=n.trackingData(i.pointerId),s=n.createPointerEvent(i),o=s.pointerType==="mouse"||s.pointerType==="pen";n.dispatchEvent(s,"pointerover"),o&&n.dispatchEvent(s,"mouseover"),s.pointerType==="mouse"&&(n.cursor=n.getCursor(s.target));var l=n.clonePointerEvent(s,"pointerenter");for(l.eventPhase=l.AT_TARGET;l.target&&l.target!==(On.isNode(n.rootTarget)&&n.rootTarget.parentNode);)l.currentTarget=l.target,n.notifyTarget(l),o&&n.notifyTarget(l,"mouseenter"),On.isNode(l.target)&&(l.target=l.target.parentNode);a.overTargets=s.composedPath(),n.freeEvent(s),n.freeEvent(l)},this.onPointerUpOutside=function(i){var a=n.trackingData(i.pointerId),s=n.findMountedTarget(a.pressTargetsByButton[i.button]),o=n.createPointerEvent(i);if(s){for(var l=s;l;)o.currentTarget=l,n.notifyTarget(o,"pointerupoutside"),o.pointerType==="touch"||(o.pointerType==="mouse"||o.pointerType==="pen")&&n.notifyTarget(o,o.button===2?"rightupoutside":"mouseupoutside"),On.isNode(l)&&(l=l.parentNode);delete a.pressTargetsByButton[i.button]}n.freeEvent(o)},this.onWheel=function(i){var a=n.createWheelEvent(i);n.dispatchEvent(a),n.freeEvent(a)},this.onClick=function(i){if(n.context.config.useNativeClickEvent){var a=n.createPointerEvent(i);n.dispatchEvent(a),n.freeEvent(a)}},this.onPointerCancel=function(i){var a=n.createPointerEvent(i,void 0,void 0,n.context.config.alwaysTriggerPointerEventOnCanvas?n.rootTarget:void 0);n.dispatchEvent(a),n.freeEvent(a)},this.globalRuntime=t,this.context=e}return(0,T.Z)(r,[{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 e=this.context.contextService.getBoundingClientRect(),n=1,i=1,a=this.context.contextService.getDomElement();if(a&&e){var s=a.offsetWidth,o=a.offsetHeight;s&&o&&(n=e.width/s,i=e.height/o)}return{scaleX:n,scaleY:i,bbox:e}}},{key:"client2Viewport",value:function(e){var n=this.getScale(),i=n.scaleX,a=n.scaleY,s=n.bbox;return new yr((e.x-((s==null?void 0:s.left)||0))/i,(e.y-((s==null?void 0:s.top)||0))/a)}},{key:"viewport2Client",value:function(e){var n=this.getScale(),i=n.scaleX,a=n.scaleY,s=n.bbox;return new yr((e.x+((s==null?void 0:s.left)||0))*i,(e.y+((s==null?void 0:s.top)||0))*a)}},{key:"viewport2Canvas",value:function(e){var n=e.x,i=e.y,a=this.rootTarget.defaultView,s=a.getCamera(),o=this.context.config,l=o.width,c=o.height,u=s.getPerspectiveInverse(),h=s.getWorldTransform(),d=Re(this.tmpMatrix,h,u),f=fe(this.tmpVec3,n/l*2-1,(1-i/c)*2-1,0);return Sn(f,f,d),new yr(f[0],f[1])}},{key:"canvas2Viewport",value:function(e){var n=this.rootTarget.defaultView,i=n.getCamera(),a=i.getPerspective(),s=i.getViewTransform(),o=Re(this.tmpMatrix,a,s),l=fe(this.tmpVec3,e.x,e.y,0);Sn(this.tmpVec3,this.tmpVec3,o);var c=this.context.config,u=c.width,h=c.height;return new yr((l[0]+1)/2*u,(1-(l[1]+1)/2)*h)}},{key:"setPickHandler",value:function(e){this.pickHandler=e}},{key:"addEventMapping",value:function(e,n){this.mappingTable[e]||(this.mappingTable[e]=[]),this.mappingTable[e].push({fn:n,priority:0}),this.mappingTable[e].sort(function(i,a){return i.priority-a.priority})}},{key:"mapEvent",value:function(e){if(this.rootTarget){var n=this.mappingTable[e.type];if(n)for(var i=0,a=n.length;i<a;i++)n[i].fn(e);else console.warn("[EventService]: Event mapping not defined for ".concat(e.type))}}},{key:"dispatchEvent",value:function(e,n,i){if(!i)e.propagationStopped=!1,e.propagationImmediatelyStopped=!1,this.propagate(e,n);else{e.eventPhase=e.AT_TARGET;var a=this.rootTarget.defaultView||null;e.currentTarget=a,this.notifyListeners(e,n)}}},{key:"propagate",value:function(e,n){if(e.target){var i=e.composedPath();e.eventPhase=e.CAPTURING_PHASE;for(var a=i.length-1;a>=1;a--)if(e.currentTarget=i[a],this.notifyTarget(e,n),e.propagationStopped||e.propagationImmediatelyStopped)return;if(e.eventPhase=e.AT_TARGET,e.currentTarget=e.target,this.notifyTarget(e,n),!(e.propagationStopped||e.propagationImmediatelyStopped)){var s=i.indexOf(e.currentTarget);e.eventPhase=e.BUBBLING_PHASE;for(var o=s+1;o<i.length;o++)if(e.currentTarget=i[o],this.notifyTarget(e,n),e.propagationStopped||e.propagationImmediatelyStopped)return}}}},{key:"propagationPath",value:function(e){var n=[e],i=this.rootTarget.defaultView||null;if(i&&i===e)return n.unshift(i.document),n;for(var a=0;a<BA&&e!==this.rootTarget;a++)On.isNode(e)&&e.parentNode&&(n.push(e.parentNode),e=e.parentNode);return i&&n.push(i),n}},{key:"hitTest",value:function(e){var n=e.viewportX,i=e.viewportY,a=this.context.config,s=a.width,o=a.height,l=a.disableHitTesting;return n<0||i<0||n>s||i>o?null:!l&&this.pickHandler(e)||this.rootTarget||null}},{key:"isNativeEventFromCanvas",value:function(e,n){var i,a=n==null?void 0:n.target;if((i=a)!==null&&i!==void 0&&i.shadowRoot&&(a=n.composedPath()[0]),a){if(a===e)return!0;if(e&&e.contains)return e.contains(a)}return n!=null&&n.composedPath?n.composedPath().indexOf(e)>-1:!1}},{key:"getExistedHTML",value:function(e){if(e.nativeEvent.composedPath)for(var n=0,i=e.nativeEvent.composedPath();n<i.length;n++){var a=i[n],s=this.nativeHTMLMap.get(a);if(s)return s}return null}},{key:"pickTarget",value:function(e){return this.hitTest({clientX:e.clientX,clientY:e.clientY,viewportX:e.viewportX,viewportY:e.viewportY,x:e.canvasX,y:e.canvasY})}},{key:"createPointerEvent",value:function(e,n,i,a){var s=this.allocateEvent(kc);this.copyPointerData(e,s),this.copyMouseData(e,s),this.copyData(e,s),s.nativeEvent=e.nativeEvent,s.originalEvent=e;var o=this.getExistedHTML(s),l=this.context.contextService.getDomElement();return s.target=i!=null?i:o||this.isNativeEventFromCanvas(l,s.nativeEvent)&&this.pickTarget(s)||a,typeof n=="string"&&(s.type=n),s}},{key:"createWheelEvent",value:function(e){var n=this.allocateEvent(df);this.copyWheelData(e,n),this.copyMouseData(e,n),this.copyData(e,n),n.nativeEvent=e.nativeEvent,n.originalEvent=e;var i=this.getExistedHTML(n),a=this.context.contextService.getDomElement();return n.target=i||this.isNativeEventFromCanvas(a,n.nativeEvent)&&this.pickTarget(n),n}},{key:"trackingData",value:function(e){return this.mappingState.trackingData[e]||(this.mappingState.trackingData[e]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[e]}},{key:"cloneWheelEvent",value:function(e){var n=this.allocateEvent(df);return n.nativeEvent=e.nativeEvent,n.originalEvent=e.originalEvent,this.copyWheelData(e,n),this.copyMouseData(e,n),this.copyData(e,n),n.target=e.target,n.path=e.composedPath().slice(),n.type=e.type,n}},{key:"clonePointerEvent",value:function(e,n){var i=this.allocateEvent(kc);return i.nativeEvent=e.nativeEvent,i.originalEvent=e.originalEvent,this.copyPointerData(e,i),this.copyMouseData(e,i),this.copyData(e,i),i.target=e.target,i.path=e.composedPath().slice(),i.type=n!=null?n:i.type,i}},{key:"copyPointerData",value:function(e,n){n.pointerId=e.pointerId,n.width=e.width,n.height=e.height,n.isPrimary=e.isPrimary,n.pointerType=e.pointerType,n.pressure=e.pressure,n.tangentialPressure=e.tangentialPressure,n.tiltX=e.tiltX,n.tiltY=e.tiltY,n.twist=e.twist}},{key:"copyMouseData",value:function(e,n){n.altKey=e.altKey,n.button=e.button,n.buttons=e.buttons,n.ctrlKey=e.ctrlKey,n.metaKey=e.metaKey,n.shiftKey=e.shiftKey,n.client.copyFrom(e.client),n.movement.copyFrom(e.movement),n.canvas.copyFrom(e.canvas),n.screen.copyFrom(e.screen),n.global.copyFrom(e.global),n.offset.copyFrom(e.offset)}},{key:"copyWheelData",value:function(e,n){n.deltaMode=e.deltaMode,n.deltaX=e.deltaX,n.deltaY=e.deltaY,n.deltaZ=e.deltaZ}},{key:"copyData",value:function(e,n){n.isTrusted=e.isTrusted,n.timeStamp=lf.now(),n.type=e.type,n.detail=e.detail,n.view=e.view,n.page.copyFrom(e.page),n.viewport.copyFrom(e.viewport)}},{key:"allocateEvent",value:function(e){this.eventPool.has(e)||this.eventPool.set(e,[]);var n=this.eventPool.get(e).pop()||new e(this);return n.eventPhase=n.NONE,n.currentTarget=null,n.path=[],n.target=null,n}},{key:"freeEvent",value:function(e){if(e.manager!==this)throw new Error("It is illegal to free an event not managed by this EventBoundary!");var n=e.constructor;this.eventPool.has(n)||this.eventPool.set(n,[]),this.eventPool.get(n).push(e)}},{key:"notifyTarget",value:function(e,n){n=n!=null?n:e.type;var i=e.eventPhase===e.CAPTURING_PHASE||e.eventPhase===e.AT_TARGET?"".concat(n,"capture"):n;this.notifyListeners(e,i),e.eventPhase===e.AT_TARGET&&this.notifyListeners(e,n)}},{key:"notifyListeners",value:function(e,n){var i=e.currentTarget.emitter,a=i._events[n];if(a)if("fn"in a)a.once&&i.removeListener(n,a.fn,void 0,!0),a.fn.call(e.currentTarget||a.context,e);else for(var s=0;s<a.length&&!e.propagationImmediatelyStopped;s++)a[s].once&&i.removeListener(n,a[s].fn,void 0,!0),a[s].fn.call(e.currentTarget||a[s].context,e)}},{key:"findMountedTarget",value:function(e){if(!e)return null;for(var n=e[e.length-1],i=e.length-2;i>=0;i--){var a=e[i];if(a===this.rootTarget||On.isNode(a)&&a.parentNode===n)n=e[i];else break}return n}},{key:"getCursor",value:function(e){for(var n=e;n;){var i=tA(n)&&n.getAttribute("cursor");if(i)return i;n=On.isNode(n)&&n.parentNode}}}])}(),ff=function(){function r(){(0,C.Z)(this,r)}return(0,T.Z)(r,[{key:"getOrCreateCanvas",value:function(e,n){if(this.canvas)return this.canvas;if(e||Vt.offscreenCanvas)this.canvas=e||Vt.offscreenCanvas,this.context=this.canvas.getContext("2d",(0,z.Z)({willReadFrequently:!0},n));else try{this.canvas=new window.OffscreenCanvas(0,0),this.context=this.canvas.getContext("2d",(0,z.Z)({willReadFrequently:!0},n)),(!this.context||!this.context.measureText)&&(this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"))}catch(i){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d",(0,z.Z)({willReadFrequently:!0},n))}return this.canvas.width=10,this.canvas.height=10,this.canvas}},{key:"getOrCreateContext",value:function(e,n){return this.context?this.context:(this.getOrCreateCanvas(e,n),this.context)}}],[{key:"createCanvas",value:function(){try{return new window.OffscreenCanvas(0,0)}catch(e){}try{return document.createElement("canvas")}catch(e){}return null}}])}(),go=function(r){return r[r.CAMERA_CHANGED=0]="CAMERA_CHANGED",r[r.DISPLAY_OBJECT_CHANGED=1]="DISPLAY_OBJECT_CHANGED",r[r.NONE=2]="NONE",r}({}),zA=function(){function r(t,e){(0,C.Z)(this,r),this.inited=!1,this.stats={total:0,rendered:0},this.zIndexCounter=0,this.hooks={init:new jr,initAsync:new pA,dirtycheck:new uf,cull:new uf,beginFrame:new jr,beforeRender:new jr,render:new jr,afterRender:new jr,endFrame:new jr,destroy:new jr,pick:new mA,pickSync:new uf,pointerDown:new jr,pointerUp:new jr,pointerMove:new jr,pointerOut:new jr,pointerOver:new jr,pointerWheel:new jr,pointerCancel:new jr,click:new jr},this.globalRuntime=t,this.context=e}return(0,T.Z)(r,[{key:"init",value:function(e){var n=this,i=(0,z.Z)((0,z.Z)({},this.globalRuntime),this.context);this.context.renderingPlugins.forEach(function(a){a.apply(i,n.globalRuntime)}),this.hooks.init.call(),this.hooks.initAsync.getCallbacksNum()===0?(this.inited=!0,e()):this.hooks.initAsync.promise().then(function(){n.inited=!0,e()}).catch(function(a){})}},{key:"getStats",value:function(){return this.stats}},{key:"disableDirtyRectangleRendering",value:function(){var e=this.context.config.renderer,n=e.getConfig(),i=n.enableDirtyRectangleRendering;return!i||this.context.renderingContext.renderReasons.has(go.CAMERA_CHANGED)}},{key:"render",value:function(e,n,i){var a=this;this.stats.total=0,this.stats.rendered=0,this.zIndexCounter=0;var s=this.context.renderingContext;if(this.globalRuntime.sceneGraphService.syncHierarchy(s.root),this.globalRuntime.sceneGraphService.triggerPendingEvents(),s.renderReasons.size&&this.inited){s.dirtyRectangleRenderingDisabled=this.disableDirtyRectangleRendering();var o=s.renderReasons.size===1&&s.renderReasons.has(go.CAMERA_CHANGED),l=!e.disableRenderHooks||!o;l&&this.renderDisplayObject(s.root,e,s),this.hooks.beginFrame.call(n),l&&s.renderListCurrentFrame.forEach(function(c){a.hooks.beforeRender.call(c),a.hooks.render.call(c),a.hooks.afterRender.call(c)}),this.hooks.endFrame.call(n),s.renderListCurrentFrame=[],s.renderReasons.clear(),i()}}},{key:"renderDisplayObject",value:function(e,n,i){var a=this,s=n.renderer.getConfig(),o=s.enableDirtyCheck,l=s.enableCulling;function c(g){var p=g.renderable,y=g.sortable,b=o?p.dirty||i.dirtyRectangleRenderingDisabled?g:null:g,E=null;b&&(E=l?a.hooks.cull.call(b,a.context.camera):b,E&&(a.stats.rendered+=1,i.renderListCurrentFrame.push(E))),g.dirty(!1),y.renderOrder=a.zIndexCounter,a.zIndexCounter+=1,a.stats.total+=1,y.dirty&&(a.sort(g,y),y.dirty=!1,y.dirtyChildren=[],y.dirtyReason=void 0)}for(var u=[e];u.length>0;){var h,d=u.pop();c(d);for(var f=((h=d.sortable)===null||h===void 0||(h=h.sorted)===null||h===void 0?void 0:h.length)>0?d.sortable.sorted:d.childNodes,v=f.length-1;v>=0;v--)u.push(f[v])}}},{key:"sort",value:function(e,n){var i,a;(n==null||(i=n.sorted)===null||i===void 0?void 0:i.length)>0&&n.dirtyReason!==pc.Z_INDEX_CHANGED?n.dirtyChildren.forEach(function(s){var o=n.sorted.indexOf(s);o>-1&&n.sorted.splice(o,1);var l=e.childNodes.indexOf(s);if(l>-1)if(n.sorted.length===0)n.sorted.push(s);else{var c=eA(n.sorted,s);n.sorted.splice(c,0,s)}}):n.sorted=e.childNodes.slice().sort(Zp),((a=n.sorted)===null||a===void 0?void 0:a.length)>0&&e.childNodes.filter(function(s){return s.parsedStyle.zIndex}).length===0&&(n.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(go.DISPLAY_OBJECT_CHANGED)}}])}(),jA=/\[\s*(.*)=(.*)\s*\]/,GA=function(){function r(){(0,C.Z)(this,r)}return(0,T.Z)(r,[{key:"selectOne",value:function(e,n){var i=this;if(e.startsWith("."))return n.find(function(l){return((l==null?void 0:l.classList)||[]).indexOf(i.getIdOrClassname(e))>-1});if(e.startsWith("#"))return n.find(function(l){return l.id===i.getIdOrClassname(e)});if(e.startsWith("[")){var a=this.getAttribute(e),s=a.name,o=a.value;return s?n.find(function(l){return n!==l&&(s==="name"?l.name===o:i.attributeToString(l,s)===o)}):null}return n.find(function(l){return n!==l&&l.nodeName===e})}},{key:"selectAll",value:function(e,n){var i=this;if(e.startsWith("."))return n.findAll(function(l){return n!==l&&((l==null?void 0:l.classList)||[]).indexOf(i.getIdOrClassname(e))>-1});if(e.startsWith("#"))return n.findAll(function(l){return n!==l&&l.id===i.getIdOrClassname(e)});if(e.startsWith("[")){var a=this.getAttribute(e),s=a.name,o=a.value;return s?n.findAll(function(l){return n!==l&&(s==="name"?l.name===o:i.attributeToString(l,s)===o)}):[]}return n.findAll(function(l){return n!==l&&l.nodeName===e})}},{key:"is",value:function(e,n){if(e.startsWith("."))return n.className===this.getIdOrClassname(e);if(e.startsWith("#"))return n.id===this.getIdOrClassname(e);if(e.startsWith("[")){var i=this.getAttribute(e),a=i.name,s=i.value;return a==="name"?n.name===s:this.attributeToString(n,a)===s}return n.nodeName===e}},{key:"getIdOrClassname",value:function(e){return e.substring(1)}},{key:"getAttribute",value:function(e){var n=e.match(jA),i="",a="";return n&&n.length>2&&(i=n[1].replace(/"/g,""),a=n[2].replace(/"/g,"")),{name:i,value:a}}},{key:"attributeToString",value:function(e,n){if(!e.getAttribute)return"";var i=e.getAttribute(n);return be(i)?"":i.toString?i.toString():""}}])}(),Fe=function(r){return r.ATTR_MODIFIED="DOMAttrModified",r.INSERTED="DOMNodeInserted",r.MOUNTED="DOMNodeInsertedIntoDocument",r.REMOVED="removed",r.UNMOUNTED="DOMNodeRemovedFromDocument",r.REPARENT="reparent",r.DESTROY="destroy",r.BOUNDS_CHANGED="bounds-changed",r.CULLED="culled",r}({}),ra=function(r){function t(e,n,i,a,s,o,l,c){var u;return(0,C.Z)(this,t),u=I(this,t,[null]),u.relatedNode=n,u.prevValue=i,u.newValue=a,u.attrName=s,u.attrChange=o,u.prevParsedValue=l,u.newParsedValue=c,u.type=e,u}return(0,L.Z)(t,r),(0,T.Z)(t)}(Nc);ra.ADDITION=2,ra.MODIFICATION=1,ra.REMOVAL=3;var WA=new ra(Fe.REPARENT,null,"","","",0,"",""),ZA=Nd(),Pc=xt(),VA=jt(1,1,1),UA=oe(),YA=Nd(),ws=xt(),HA=oe(),Ss=qn(),XA=xt(),KA=qn(),QA=xt(),cl=xt(),Ms=xt(),Rc=oe(),rm=qn(),im=qn(),Lc=qn(),_c={affectChildren:!0},qA=function(){function r(t){(0,C.Z)(this,r),this.pendingEvents=new Map,this.boundsChangedEvent=new Jn(Fe.BOUNDS_CHANGED),this.displayObjectDependencyMap=new WeakMap,this.runtime=t}return(0,T.Z)(r,[{key:"matches",value:function(e,n){return this.runtime.sceneGraphSelector.is(e,n)}},{key:"querySelector",value:function(e,n){return this.runtime.sceneGraphSelector.selectOne(e,n)}},{key:"querySelectorAll",value:function(e,n){return this.runtime.sceneGraphSelector.selectAll(e,n)}},{key:"attach",value:function(e,n,i){var a,s=!1;e.parentNode&&(s=e.parentNode!==n,this.detach(e));var o=e.nodeName===Dt.FRAGMENT,l=Cc(n);e.parentNode=n;var c=o?e.childNodes:[e];ie(i)?c.forEach(function(g){n.childNodes.splice(i,0,g),g.parentNode=n}):c.forEach(function(g){n.childNodes.push(g),g.parentNode=n});var u=n,h=u.sortable;if((h!=null&&(a=h.sorted)!==null&&a!==void 0&&a.length||h.dirty||e.parsedStyle.zIndex)&&(h.dirtyChildren.indexOf(e)===-1&&h.dirtyChildren.push(e),h.dirty=!0,h.dirtyReason=pc.ADDED),!l){if(o)this.dirtifyFragment(e);else{var d=e.transformable;d&&this.dirtyWorldTransform(e,d)}if(s){var f,v=((f=n.ownerDocument)===null||f===void 0||(f=f.defaultView)===null||f===void 0||(f=f.getConfig())===null||f===void 0||(f=f.future)===null||f===void 0?void 0:f.experimentalCancelEventPropagation)===!0;e.dispatchEvent(WA,v,v)}}}},{key:"detach",value:function(e){var n,i;if(e.parentNode){var a=e.transformable,s=e.parentNode,o=s.sortable;(o!=null&&(n=o.sorted)!==null&&n!==void 0&&n.length||(i=e.style)!==null&&i!==void 0&&i.zIndex)&&(o.dirtyChildren.indexOf(e)===-1&&o.dirtyChildren.push(e),o.dirty=!0,o.dirtyReason=pc.REMOVED);var l=e.parentNode.childNodes.indexOf(e);l>-1&&e.parentNode.childNodes.splice(l,1),a&&this.dirtyWorldTransform(e,a),e.parentNode=null}}},{key:"getLocalPosition",value:function(e){return e.transformable.localPosition}},{key:"getLocalRotation",value:function(e){return e.transformable.localRotation}},{key:"getLocalScale",value:function(e){return e.transformable.localScale}},{key:"getLocalSkew",value:function(e){return e.transformable.localSkew}},{key:"getLocalTransform",value:function(e){var n=e.transformable;return ip(n),n.localTransform}},{key:"setLocalPosition",value:function(e,n){var i,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,s=e.transformable;cl[0]=n[0],cl[1]=n[1],cl[2]=(i=n[2])!==null&&i!==void 0?i:0,!Ji(s.localPosition,cl)&&(Ht(s.localPosition,cl),a&&this.dirtyLocalTransform(e,s))}},{key:"translateLocal",value:function(e,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;typeof n=="number"&&(n=jt(n,i,a));var s=e.transformable;Ji(n,Pc)||(La(n,n,s.localRotation),we(s.localPosition,s.localPosition,n),this.dirtyLocalTransform(e,s))}},{key:"setLocalRotation",value:function(e,n,i,a,s){var o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0;typeof n=="number"&&(n=yg(Ss,n,i,a,s));var l=e.transformable;ac(l.localRotation,n),o&&this.dirtyLocalTransform(e,l)}},{key:"rotateLocal",value:function(e,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;typeof n=="number"&&(n=jt(n,i,a));var s=e.transformable;ic(im,n[0],n[1],n[2]),bg(s.localRotation,s.localRotation,im),this.dirtyLocalTransform(e,s)}},{key:"setLocalScale",value:function(e,n){var i,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,s=e.transformable;fe(ws,n[0],n[1],(i=n[2])!==null&&i!==void 0?i:s.localScale[2]),!Ji(ws,s.localScale)&&(Ht(s.localScale,ws),a&&this.dirtyLocalTransform(e,s))}},{key:"scaleLocal",value:function(e,n){var i,a=e.transformable;Hn(a.localScale,a.localScale,fe(ws,n[0],n[1],(i=n[2])!==null&&i!==void 0?i:1)),this.dirtyLocalTransform(e,a)}},{key:"setLocalSkew",value:function(e,n,i){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0;typeof n=="number"&&(n=Iw(YA,n,i));var s=e.transformable;Dw(s.localSkew,n),a&&this.dirtyLocalTransform(e,s)}},{key:"setLocalEulerAngles",value:function(e,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0;typeof n=="number"&&(n=jt(n,i,a));var o=e.transformable;ic(o.localRotation,n[0],n[1],n[2]),s&&this.dirtyLocalTransform(e,o)}},{key:"setLocalTransform",value:function(e,n){var i=ro(XA,n),a=io(KA,n),s=_a(QA,n);this.setLocalScale(e,s,!1),this.setLocalPosition(e,i,!1),this.setLocalRotation(e,a,void 0,void 0,void 0,!1),this.dirtyLocalTransform(e,e.transformable)}},{key:"resetLocalTransform",value:function(e){this.setLocalScale(e,VA,!1),this.setLocalPosition(e,Pc,!1),this.setLocalEulerAngles(e,Pc,void 0,void 0,!1),this.setLocalSkew(e,ZA,void 0,!1),this.dirtyLocalTransform(e,e.transformable)}},{key:"getPosition",value:function(e){var n=e.transformable;return ro(n.position,this.getWorldTransform(e,n))}},{key:"getRotation",value:function(e){var n=e.transformable;return io(n.rotation,this.getWorldTransform(e,n))}},{key:"getScale",value:function(e){var n=e.transformable;return _a(n.scaling,this.getWorldTransform(e,n))}},{key:"getOrigin",value:function(e){return e.getGeometryBounds(),e.transformable.origin}},{key:"getWorldTransform",value:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e.transformable;return!n.localDirtyFlag&&!n.dirtyFlag||(e.parentNode&&e.parentNode.transformable&&this.getWorldTransform(e.parentNode),this.internalUpdateTransform(e)),n.worldTransform}},{key:"setPosition",value:function(e,n){var i,a=e.transformable;if(Ms[0]=n[0],Ms[1]=n[1],Ms[2]=(i=n[2])!==null&&i!==void 0?i:0,!Ji(this.getPosition(e),Ms)){if(Ht(a.position,Ms),e.parentNode===null||!e.parentNode.transformable)Ht(a.localPosition,Ms);else{var s=e.parentNode.transformable;me(Rc,s.worldTransform),ee(Rc,Rc),Sn(a.localPosition,Ms,Rc)}this.dirtyLocalTransform(e,a)}}},{key:"translate",value:function(e,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;typeof n=="number"&&(n=fe(ws,n,i,a)),!Ji(n,Pc)&&(we(ws,this.getPosition(e),n),this.setPosition(e,ws))}},{key:"setRotation",value:function(e,n,i,a,s){var o=e.transformable;if(typeof n=="number"&&(n=Rw(n,i,a,s)),e.parentNode===null||!e.parentNode.transformable)this.setLocalRotation(e,n);else{var l=this.getRotation(e.parentNode);ac(Ss,l),Cd(Ss,Ss),Ia(o.localRotation,Ss,n),sc(o.localRotation,o.localRotation),this.dirtyLocalTransform(e,o)}}},{key:"rotate",value:function(e,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;typeof n=="number"&&(n=jt(n,i,a));var s=e.transformable;if(e.parentNode===null||!e.parentNode.transformable)this.rotateLocal(e,n);else{var o=Ss;ic(o,n[0],n[1],n[2]);var l=this.getRotation(e),c=this.getRotation(e.parentNode);ac(Lc,c),Cd(Lc,Lc),Ia(o,Lc,o),Ia(s.localRotation,o,l),sc(s.localRotation,s.localRotation),this.dirtyLocalTransform(e,s)}}},{key:"setOrigin",value:function(e,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;typeof n=="number"&&(n=[n,i,a]);var s=e.transformable;if(!(n[0]===s.origin[0]&&n[1]===s.origin[1]&&n[2]===s.origin[2])){var o=s.origin;o[0]=n[0],o[1]=n[1],o[2]=n[2]||0,this.dirtyLocalTransform(e,s)}}},{key:"setEulerAngles",value:function(e,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;typeof n=="number"&&(n=jt(n,i,a));var s=e.transformable;if(e.parentNode===null||!e.parentNode.transformable)this.setLocalEulerAngles(e,n);else{ic(s.localRotation,n[0],n[1],n[2]);var o=this.getRotation(e.parentNode);ac(rm,Cd(Ss,o)),bg(s.localRotation,s.localRotation,rm),this.dirtyLocalTransform(e,s)}}},{key:"getTransformedGeometryBounds",value:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,i=arguments.length>2?arguments[2]:void 0,a=this.getGeometryBounds(e,n);if(!yn.isEmpty(a)){var s=i||new yn;return s.setFromTransformedAABB(a,this.getWorldTransform(e)),s}return null}},{key:"getGeometryBounds",value:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,i=e,a=i.geometry;a.dirty&&Vt.styleValueRegistry.updateGeometry(e);var s=n?a.renderBounds:a.contentBounds||null;return s||new yn}},{key:"getBounds",value:function(e){var n=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,a=e,s=a.renderable;if(!s.boundsDirty&&!i&&s.bounds)return s.bounds;if(!s.renderBoundsDirty&&i&&s.renderBounds)return s.renderBounds;var o=i?s.renderBounds:s.bounds,l=this.getTransformedGeometryBounds(e,i,o),c=e.childNodes;if(c.forEach(function(d){var f=n.getBounds(d,i);f&&(l?l.add(f):(l=o||new yn,l.update(f.center,f.halfExtents)))}),l||(l=new yn),i){var u=Vp(e);if(u){var h=u.parsedStyle.clipPath.getBounds(i);l?h&&(l=h.intersection(l)):l.update(h.center,h.halfExtents)}}return i?(s.renderBounds=l,s.renderBoundsDirty=!1):(s.bounds=l,s.boundsDirty=!1),l}},{key:"getLocalBounds",value:function(e){if(e.parentNode){var n=UA;e.parentNode.transformable&&(n=ee(HA,this.getWorldTransform(e.parentNode)));var i=this.getBounds(e);if(!yn.isEmpty(i)){var a=new yn;return a.setFromTransformedAABB(i,n),a}}return this.getBounds(e)}},{key:"getBoundingClientRect",value:function(e){var n,i,a=this.getGeometryBounds(e);yn.isEmpty(a)||(i=new yn,i.setFromTransformedAABB(a,this.getWorldTransform(e)));var s=(n=e.ownerDocument)===null||n===void 0||(n=n.defaultView)===null||n===void 0?void 0:n.getContextService().getBoundingClientRect();if(i){var o=i.getMin(),l=(0,G.Z)(o,2),c=l[0],u=l[1],h=i.getMax(),d=(0,G.Z)(h,2),f=d[0],v=d[1];return new lo(c+((s==null?void 0:s.left)||0),u+((s==null?void 0:s.top)||0),f-c,v-u)}return new lo((s==null?void 0:s.left)||0,(s==null?void 0:s.top)||0,0,0)}},{key:"internalUpdateTransform",value:function(e){var n,i=(n=e.parentNode)===null||n===void 0?void 0:n.transformable;ip(e.transformable),vS(e.transformable,i)}},{key:"internalUpdateElement",value:function(e,n){var i,a,s,o,l=((i=e.ownerDocument)===null||i===void 0||(i=i.defaultView)===null||i===void 0||(i=i.getConfig())===null||i===void 0||(i=i.future)===null||i===void 0?void 0:i.experimentalAttributeUpdateOptimization)===!0,c=n[n.length-1],u=(c==null?void 0:c.transformDirty)||((a=e.transformable)===null||a===void 0?void 0:a.localDirtyFlag);if(e.transformable){var h;(h=e.transformable).dirtyFlag||(h.dirtyFlag=u)}if(this.internalUpdateTransform(e),u){var d;(d=e.dirty)===null||d===void 0||d.call(e,!0,!0)}var f=((s=e.renderable)===null||s===void 0?void 0:s.boundsDirty)||((o=e.renderable)===null||o===void 0?void 0:o.renderBoundsDirty);if((u||f)&&(c==null?void 0:c.shapeUpdated)===!1&&l)for(var v=n.length-1;v>=0;){var g,p,y=n[v];if(y.shapeUpdated)break;(g=(p=y.node).dirty)===null||g===void 0||g.call(p,!0,!0),y.shapeUpdated=!0,v-=1}return u}},{key:"syncHierarchy",value:function(e){for(var n,i,a=[e],s=e.parentNode?[{node:e.parentNode,transformDirty:((n=e.parentNode.transformable)===null||n===void 0?void 0:n.localDirtyFlag)||((i=e.parentNode.transformable)===null||i===void 0?void 0:i.dirtyFlag),shapeUpdated:!1}]:[];a.length>0;){for(var o=a.pop(),l=s[s.length-1];s.length>0&&o.parentNode!==l.node;)l=s.pop();var c=this.internalUpdateElement(o,s);if(o.childNodes.length>0){for(var u=o.childNodes.length-1;u>=0;u--)a.push(o.childNodes[u]);s.push({node:o,transformDirty:c,shapeUpdated:!1})}}}},{key:"dirtyLocalTransform",value:function(e,n){Cc(e)||n.localDirtyFlag||(n.localDirtyFlag=!0,n.dirtyFlag||this.dirtyWorldTransform(e,n))}},{key:"dirtyWorldTransform",value:function(e,n){this.dirtifyWorldInternal(e,n),this.dirtyToRoot(e,!0)}},{key:"dirtifyWorldInternal",value:function(e,n){var i,a=this,s=((i=e.ownerDocument)===null||i===void 0||(i=i.defaultView)===null||i===void 0||(i=i.getConfig())===null||i===void 0||(i=i.future)===null||i===void 0?void 0:i.experimentalAttributeUpdateOptimization)===!0;n.dirtyFlag||(n.dirtyFlag=!0,e.dirty(!0,!0),s||e.childNodes.forEach(function(o){var l=o.transformable;a.dirtifyWorldInternal(o,l)}))}},{key:"dirtyToRoot",value:function(e){for(var n,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,a=e,s=((n=e.ownerDocument)===null||n===void 0||(n=n.defaultView)===null||n===void 0||(n=n.getConfig())===null||n===void 0||(n=n.future)===null||n===void 0?void 0:n.experimentalAttributeUpdateOptimization)===!0;a;){var o,l;if((o=(l=a).dirty)===null||o===void 0||o.call(l,!0,!0),s)break;a=a.parentNode}i&&e.forEach(function(c){var u;(u=c.dirty)===null||u===void 0||u.call(c,!0,!0)}),this.informDependentDisplayObjects(e),this.pendingEvents.set(e,i)}},{key:"dirtifyFragment",value:function(e){var n,i,a=e.transformable;a&&(a.dirtyFlag=!0,a.localDirtyFlag=!0),(n=(i=e).dirty)===null||n===void 0||n.call(i,!0,!0);for(var s=e.childNodes.length,o=0;o<s;o++)this.dirtifyFragment(e.childNodes[o]);e.nodeName===Dt.FRAGMENT&&this.pendingEvents.set(e,!1)}},{key:"triggerPendingEvents",value:function(){var e=this,n=new Set,i,a,s=function(l,c){if(!(!l.isConnected||n.has(l)||l.nodeName===Dt.FRAGMENT)){if(e.boundsChangedEvent.detail=c,e.boundsChangedEvent.target=l,l.isMutationObserved)l.dispatchEvent(e.boundsChangedEvent);else{if(i===void 0){var u;i=((u=l.ownerDocument.defaultView)===null||u===void 0||(u=u.getConfig())===null||u===void 0||(u=u.future)===null||u===void 0?void 0:u.experimentalCancelEventPropagation)===!0}l.ownerDocument.defaultView.dispatchEvent(e.boundsChangedEvent,!0,i)}n.add(l)}};this.pendingEvents.forEach(function(o,l){if(l.nodeName!==Dt.FRAGMENT){if(a===void 0){var c;a=((c=l.ownerDocument)===null||c===void 0||(c=c.defaultView)===null||c===void 0||(c=c.getConfig())===null||c===void 0||(c=c.future)===null||c===void 0?void 0:c.experimentalAttributeUpdateOptimization)===!0}_c.affectChildren=o,a?s(l,_c):o?l.forEach(function(u){s(u,_c)}):s(l,_c)}}),n.clear(),this.clearPendingEvents()}},{key:"clearPendingEvents",value:function(){this.pendingEvents.clear()}},{key:"updateDisplayObjectDependency",value:function(e,n,i,a){if(n&&n!==i){var s=this.displayObjectDependencyMap.get(n);if(s&&s[e]){var o=s[e].indexOf(a);s[e].splice(o,1)}}if(i){var l=this.displayObjectDependencyMap.get(i);l||(this.displayObjectDependencyMap.set(i,{}),l=this.displayObjectDependencyMap.get(i)),l[e]||(l[e]=[]),l[e].push(a)}}},{key:"informDependentDisplayObjects",value:function(e){var n,i=this,a=this.displayObjectDependencyMap.get(e);if(a){var s=(n=e.ownerDocument)===null||n===void 0||(n=n.defaultView)===null||n===void 0||(n=n.getConfig())===null||n===void 0||(n=n.future)===null||n===void 0?void 0:n.experimentalCancelEventPropagation;Object.keys(a).forEach(function(o){a[o].forEach(function(l){i.dirtyToRoot(l,!0),l.dispatchEvent(new ra(Fe.ATTR_MODIFIED,l,i,i,o,ra.MODIFICATION,i,i),s,s),l.isCustomElement&&l.isConnected&&l.attributeChangedCallback&&l.attributeChangedCallback(o,i,i)})})}}}])}(),am=function(){function r(t){if((0,C.Z)(this,r),t<=0)throw new Error("LRU capacity must be a positive number.");this.capacity=t,this.cache=new Map}return(0,T.Z)(r,[{key:"get",value:function(e){if(this.cache.has(e)){var n=this.cache.get(e);return this.cache.delete(e),this.cache.set(e,n),n}}},{key:"put",value:function(e,n){if(this.cache.has(e)&&this.cache.delete(e),this.cache.set(e,n),this.cache.size>this.capacity){var i=this.cache.keys().next().value;this.cache.delete(i)}}},{key:"len",value:function(){return this.cache.size}},{key:"clear",value:function(){this.cache.clear()}}])}(),As={MetricsString:"|\xC9q\xC5",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]},sm=/[a-zA-Z0-9\u00C0-\u00D6\u00D8-\u00f6\u00f8-\u00ff!"#$%&'()*+,-./:;]/,JA=/[!%),.:;?\]}¢°·'""†‡›℃∶、。〃〆〕〗〞﹚﹜!"%'),.:;?!]}~]/,$A=/[$(£¥·'"〈《「『【〔〖〝﹙﹛$(.[{£¥]/,tT=/[!),.:;?\]}¢·–—'"•"、。〆〞〕〉》」︰︱︲︳﹐﹑﹒﹔﹕﹖﹘﹚﹜!),.:;?︶︸︺︼︾﹀﹂﹗]|}、]/,eT=/[([{£¥'"‵〈《「『〔〝︴﹙﹛({︵︷︹︻︽︿﹁﹃﹏]/,nT=/[)\]}〕〉》」』】〙〗〟'"⦆»ヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻‐゠–〜?!‼⁇⁈⁉・、:;,。.]/,rT=/[([{〔〈《「『【〘〖〝'"⦅«—...‥〳〴〵]/,iT=/[!%),.:;?\]}¢°'"†‡℃〆〈《「『〕!%),.:;?]}]/,aT=/[$([{£¥'"々〇〉》」〔$([{⦆¥₩#]/,sT=new RegExp("".concat(JA.source,"|").concat(tT.source,"|").concat(nT.source,"|").concat(iT.source)),oT=new RegExp("".concat($A.source,"|").concat(eT.source,"|").concat(rT.source,"|").concat(aT.source)),lT=function(){function r(t){var e=this;(0,C.Z)(this,r),this.fontMetricsCache={},this.shouldBreakByKinsokuShorui=function(n,i){return e.isBreakingSpace(i)?!1:!!(n&&(oT.exec(i)||sT.exec(n)))},this.trimByKinsokuShorui=function(n){var i=(0,N.Z)(n),a=i[i.length-2];if(!a)return n;var s=a[a.length-1];return i[i.length-2]=a.slice(0,-1),i[i.length-1]=s+i[i.length-1],i},this.runtime=t,this.charWidthCache=new am(100)}return(0,T.Z)(r,[{key:"measureFont",value:function(e,n){if(this.fontMetricsCache[e])return this.fontMetricsCache[e];var i={ascent:0,descent:0,fontSize:0},a=this.runtime.offscreenCanvasCreator.getOrCreateCanvas(n),s=this.runtime.offscreenCanvasCreator.getOrCreateContext(n,{willReadFrequently:!0});s.font=e;var o=As.MetricsString+As.BaselineSymbol,l=Math.ceil(s.measureText(o).width),c=Math.ceil(s.measureText(As.BaselineSymbol).width),u=As.HeightMultiplier*c;c=c*As.BaselineMultiplier|0,a.width=l,a.height=u,s.fillStyle="#f00",s.fillRect(0,0,l,u),s.font=e,s.textBaseline="alphabetic",s.fillStyle="#000",s.fillText(o,0,c);var h=s.getImageData(0,0,l||1,u||1).data,d=h.length,f=l*4,v=0,g=0,p=!1;for(v=0;v<c;++v){for(var y=0;y<f;y+=4)if(h[g+y]!==255){p=!0;break}if(!p)g+=f;else break}for(i.ascent=c-v,g=d-f,p=!1,v=u;v>c;--v){for(var b=0;b<f;b+=4)if(h[g+b]!==255){p=!0;break}if(!p)g-=f;else break}return i.descent=v-c,i.fontSize=i.ascent+i.descent,this.fontMetricsCache[e]=i,i}},{key:"measureText",value:function(e,n,i){var a=n.fontSize,s=a===void 0?16:a,o=n.wordWrap,l=o===void 0?!1:o,c=n.lineHeight,u=n.lineWidth,h=u===void 0?1:u,d=n.textBaseline,f=d===void 0?"alphabetic":d,v=n.textAlign,g=v===void 0?"start":v,p=n.letterSpacing,y=p===void 0?0:p,b=n.textPath;n.textPathSide,n.textPathStartOffset;var E=n.leading,O=E===void 0?0:E,k=Jp(n),P=this.measureFont(k,i);P.fontSize===0&&(P.fontSize=s,P.ascent=s);var F=this.runtime.offscreenCanvasCreator.getOrCreateContext(i);F.font=k,n.isOverflowing=!1;var B=l?this.wordWrap(e,n,i):e,V=B.split(/(?:\r\n|\r|\n)/),U=new Array(V.length),J=0;if(b){b.getTotalLength();for(var $=0;$<V.length;$++)F.measureText(V[$]).width+(V[$].length-1)*y}else{for(var at=0;at<V.length;at++){var ct=F.measureText(V[at]).width+(V[at].length-1)*y;U[at]=ct,J=Math.max(J,ct)}var ft=J+h,Nt=c||P.fontSize+h,Ct=Math.max(Nt,P.fontSize+h)+(V.length-1)*(Nt+O);Nt+=O;var gt=0;return f==="middle"?gt=-Ct/2:f==="bottom"||f==="alphabetic"||f==="ideographic"?gt=-Ct:(f==="top"||f==="hanging")&&(gt=0),{font:k,width:ft,height:Ct,lines:V,lineWidths:U,lineHeight:Nt,maxLineWidth:J,fontProperties:P,lineMetrics:U.map(function(bt,Pt){var zt=0;return g==="center"||g==="middle"?zt-=bt/2:(g==="right"||g==="end")&&(zt-=bt),new lo(zt-h/2,gt+Pt*Nt,bt+h,Nt)})}}}},{key:"wordWrap",value:function(e,n,i){var a=this,s=Array.from(e);if(s.length===0)return"";var o=this,l=n.wordWrapWidth,c=l===void 0?0:l,u=n.letterSpacing,h=u===void 0?0:u,d=n.maxLines,f=d===void 0?1/0:d,v=n.textOverflow,g=this.runtime.offscreenCanvasCreator.getOrCreateContext(i),p=c+h,y="";v==="ellipsis"?y="...":v&&v!=="clip"&&(y=v);var b=[""],E=0,O=0,k=-1,P=Jp(n),F=this.charWidthCache.get(P);F||(F=new am(500),this.charWidthCache.put(P,F));var B=function(bt){return a.getFromCache(bt,h,F,g)},V=B(y);function U(gt,bt,Pt,zt){for(;B(gt)<zt&&bt<s.length-1&&!o.isNewline(s[bt+1]);)bt+=1,gt+=s[bt];for(;B(gt)>zt&&bt>=Pt;)bt-=1,gt=gt.slice(0,-1);return{lineTxt:gt,txtLastCharIndex:bt}}function J(gt,bt){if(!(V<=0||V>p)){if(!b[gt]){b[gt]=y;return}var Pt=U(b[gt],bt,k+1,p-V);b[gt]=Pt.lineTxt+y}}for(var $=0;$<s.length;$++){var at=s[$],ct=s[$-1],ft=s[$+1],Nt=B(at);if(this.isNewline(at)){if(E+1>=f){$<s.length-1&&J(E,$-1),n.isOverflowing=!0;break}k=$-1,E+=1,O=0,b[E]="";continue}if(Nt>p){J(E,$-1),n.isOverflowing=!0;break}if(O>0&&O+Nt>p){var Ct=U(b[E],$-1,k+1,p);if(Ct.txtLastCharIndex!==$-1){if(b[E]=Ct.lineTxt,Ct.txtLastCharIndex===s.length-1)break;$=Ct.txtLastCharIndex+1,at=s[$],ct=s[$-1],ft=s[$+1],Nt=B(at)}if(E+1>=f){J(E,$-1),n.isOverflowing=!0;break}if(k=$-1,E+=1,O=0,b[E]="",this.isBreakingSpace(at))continue;this.canBreakInLastChar(at)||(b=this.trimToBreakable(b),O=this.sumTextWidthByCache(b[E]||"",B)),this.shouldBreakByKinsokuShorui(at,ft)&&(b=this.trimByKinsokuShorui(b),O+=B(ct||""))}O+=Nt,b[E]+=at}return b.join(`
|
|
|
`)}},{key:"isBreakingSpace",value:function(e){return typeof e!="string"?!1:As.BreakingSpaces.indexOf(e.charCodeAt(0))>=0}},{key:"isNewline",value:function(e){return typeof e!="string"?!1:As.Newlines.indexOf(e.charCodeAt(0))>=0}},{key:"trimToBreakable",value:function(e){var n=(0,N.Z)(e),i=n[n.length-2],a=this.findBreakableIndex(i);if(a===-1||!i)return n;var s=i.slice(a,a+1),o=this.isBreakingSpace(s),l=a+1,c=a+(o?0:1);return n[n.length-1]+=i.slice(l,i.length),n[n.length-2]=i.slice(0,c),n}},{key:"canBreakInLastChar",value:function(e){return!(e&&sm.test(e))}},{key:"sumTextWidthByCache",value:function(e,n){return e.split("").reduce(function(i,a){return i+n(a)},0)}},{key:"findBreakableIndex",value:function(e){for(var n=e.length-1;n>=0;n--)if(!sm.test(e[n]))return n;return-1}},{key:"getFromCache",value:function(e,n,i,a){var s=i.get(e);if(typeof s!="number"){var o=e.length*n,l=a.measureText(e);s=l.width+o,i.put(e,s)}return s}},{key:"clearCache",value:function(){this.fontMetricsCache={},this.charWidthCache.clear()}}])}(),Vt={},cT=function(r){var t=new LA,e=new RA;return r={},(0,ae.Z)((0,ae.Z)((0,ae.Z)((0,ae.Z)((0,ae.Z)((0,ae.Z)((0,ae.Z)((0,ae.Z)((0,ae.Z)((0,ae.Z)(r,Dt.FRAGMENT,null),Dt.CIRCLE,new CA),Dt.ELLIPSE,new NA),Dt.RECT,t),Dt.IMAGE,t),Dt.GROUP,new DA),Dt.LINE,new kA),Dt.TEXT,new _A(Vt)),Dt.POLYLINE,e),Dt.POLYGON,e),(0,ae.Z)((0,ae.Z)((0,ae.Z)(r,Dt.PATH,new PA),Dt.HTML,new IA),Dt.MESH,null)}(),uT=function(r){var t=new jM,e=new af;return r={},(0,ae.Z)((0,ae.Z)((0,ae.Z)((0,ae.Z)((0,ae.Z)((0,ae.Z)((0,ae.Z)((0,ae.Z)((0,ae.Z)((0,ae.Z)(r,Jt.PERCENTAGE,null),Jt.NUMBER,new UM),Jt.ANGLE,new FM),Jt.DEFINED_PATH,new zM),Jt.PAINT,t),Jt.COLOR,t),Jt.FILTER,new GM),Jt.LENGTH,e),Jt.LENGTH_PERCENTAGE,e),Jt.LENGTH_PERCENTAGE_12,new WM),(0,ae.Z)((0,ae.Z)((0,ae.Z)((0,ae.Z)((0,ae.Z)((0,ae.Z)((0,ae.Z)((0,ae.Z)((0,ae.Z)((0,ae.Z)(r,Jt.LENGTH_PERCENTAGE_14,new ZM),Jt.COORDINATE,new af),Jt.OFFSET_DISTANCE,new YM),Jt.OPACITY_VALUE,new HM),Jt.PATH,new XM),Jt.LIST_OF_POINTS,new KM),Jt.SHADOW_BLUR,new QM),Jt.TEXT,new qM),Jt.TEXT_TRANSFORM,new JM),Jt.TRANSFORM,new AA),(0,ae.Z)((0,ae.Z)((0,ae.Z)(r,Jt.TRANSFORM_ORIGIN,new TA),Jt.Z_INDEX,new OA),Jt.MARKER,new VM)}(),hT=function(){return typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:typeof window!="undefined"?window:typeof S.g!="undefined"?S.g:{}};Vt.CameraContribution=rp,Vt.AnimationTimeline=null,Vt.EasingFunction=null,Vt.offscreenCanvasCreator=new ff,Vt.sceneGraphSelector=new GA,Vt.sceneGraphService=new qA(Vt),Vt.textService=new lT(Vt),Vt.geometryUpdaterFactory=cT,Vt.CSSPropertySyntaxFactory=uT,Vt.styleValueRegistry=new IM(Vt),Vt.layoutRegistry=null,Vt.globalThis=hT(),Vt.enableStyleSyntax=!0,Vt.enableSizeAttenuation=!1;var om=0;function f9(){om=0}var vf=new ra(Fe.INSERTED,null,"","","",0,"",""),gf=new ra(Fe.REMOVED,null,"","","",0,"",""),lm=new Jn(Fe.DESTROY),dT=function(r){function t(){var e;(0,C.Z)(this,t);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return e=I(this,t,[].concat(i)),e.entity=om++,e.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]},e.renderable={bounds:void 0,boundsDirty:!0,renderBounds:void 0,renderBoundsDirty:!0,dirtyRenderBounds:void 0,dirty:!1},e.geometry={contentBounds:void 0,renderBounds:void 0,dirty:!0},e.cullable={strategy:hS.Standard,visibilityPlaneMask:-1,visible:!0,enable:!0},e.sortable={dirty:!1,sorted:void 0,renderOrder:0,dirtyChildren:[],dirtyReason:void 0},e.rBushNode={aabb:void 0},e.namespaceURI="g",e.scrollLeft=0,e.scrollTop=0,e.clientTop=0,e.clientLeft=0,e.style={},e.computedStyle={},e.parsedStyle={},e.attributes={},e}return(0,L.Z)(t,r),(0,T.Z)(t,[{key:"dirty",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;this.renderable.dirty=n,i&&(this.renderable.boundsDirty=n,this.renderable.renderBoundsDirty=n)}},{key:"className",get:function(){return this.getAttribute("class")||""},set:function(n){this.setAttribute("class",n)}},{key:"classList",get:function(){return this.className.split(" ").filter(function(n){return n!==""})}},{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 n=this.parentNode.childNodes.indexOf(this);return this.parentNode.childNodes[n+1]||null}return null}},{key:"previousSibling",get:function(){if(this.parentNode){var n=this.parentNode.childNodes.indexOf(this);return this.parentNode.childNodes[n-1]||null}return null}},{key:"cloneNode",value:function(n){throw new Error(ln)}},{key:"appendChild",value:function(n,i){var a;if(n.destroyed)throw new Error($2);return Vt.sceneGraphService.attach(n,this,i),(a=this.ownerDocument)!==null&&a!==void 0&&a.defaultView&&(!Cc(this)&&n.nodeName===Dt.FRAGMENT?this.ownerDocument.defaultView.mountFragment(n):this.ownerDocument.defaultView.mountChildren(n)),this.isMutationObserved&&(vf.relatedNode=this,n.dispatchEvent(vf)),n}},{key:"insertBefore",value:function(n,i){if(!i)this.appendChild(n);else{n.parentElement&&n.parentElement.removeChild(n);var a=this.childNodes.indexOf(i);a===-1?this.appendChild(n):this.appendChild(n,a)}return n}},{key:"replaceChild",value:function(n,i){var a=this.childNodes.indexOf(i);return this.removeChild(i),this.appendChild(n,a),i}},{key:"removeChild",value:function(n){var i,a,s=((i=this.ownerDocument)===null||i===void 0||(i=i.defaultView)===null||i===void 0||(i=i.getConfig().future)===null||i===void 0?void 0:i.experimentalCancelEventPropagation)===!0;return gf.relatedNode=this,n.dispatchEvent(gf,s,s),(a=n.ownerDocument)!==null&&a!==void 0&&a.defaultView&&n.ownerDocument.defaultView.unmountChildren(n),Vt.sceneGraphService.detach(n),n}},{key:"removeChildren",value:function(){for(var n=this.childNodes.length-1;n>=0;n--){var i=this.childNodes[n];this.removeChild(i)}}},{key:"destroyChildren",value:function(){for(var n=this.childNodes.length-1;n>=0;n--){var i=this.childNodes[n];i.childNodes.length>0&&i.destroyChildren(),i.destroy()}}},{key:"matches",value:function(n){return Vt.sceneGraphService.matches(n,this)}},{key:"getElementById",value:function(n){return Vt.sceneGraphService.querySelector("#".concat(n),this)}},{key:"getElementsByName",value:function(n){return Vt.sceneGraphService.querySelectorAll('[name="'.concat(n,'"]'),this)}},{key:"getElementsByClassName",value:function(n){return Vt.sceneGraphService.querySelectorAll(".".concat(n),this)}},{key:"getElementsByTagName",value:function(n){return Vt.sceneGraphService.querySelectorAll(n,this)}},{key:"querySelector",value:function(n){return Vt.sceneGraphService.querySelector(n,this)}},{key:"querySelectorAll",value:function(n){return Vt.sceneGraphService.querySelectorAll(n,this)}},{key:"closest",value:function(n){var i=this;do{if(Vt.sceneGraphService.matches(n,i))return i;i=i.parentElement}while(i!==null);return null}},{key:"find",value:function(n){var i=this,a=null;return this.forEach(function(s){return s!==i&&n(s)?(a=s,!1):!0}),a}},{key:"findAll",value:function(n){var i=this,a=[];return this.forEach(function(s){s!==i&&n(s)&&a.push(s)}),a}},{key:"after",value:function(){var n=this;if(this.parentNode){for(var i=this.parentNode.childNodes.indexOf(this),a=arguments.length,s=new Array(a),o=0;o<a;o++)s[o]=arguments[o];s.forEach(function(l,c){var u;return(u=n.parentNode)===null||u===void 0?void 0:u.appendChild(l,i+c+1)})}}},{key:"before",value:function(){if(this.parentNode){for(var n,i=this.parentNode.childNodes.indexOf(this),a=arguments.length,s=new Array(a),o=0;o<a;o++)s[o]=arguments[o];var l=s[0],c=s.slice(1);this.parentNode.appendChild(l,i),(n=l).after.apply(n,(0,N.Z)(c))}}},{key:"replaceWith",value:function(){this.after.apply(this,arguments),this.remove()}},{key:"append",value:function(){for(var n=this,i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];a.forEach(function(o){return n.appendChild(o)})}},{key:"prepend",value:function(){for(var n=this,i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];a.forEach(function(o,l){return n.appendChild(o,l)})}},{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 n,i=((n=this.ownerDocument)===null||n===void 0||(n=n.defaultView)===null||n===void 0||(n=n.getConfig().future)===null||n===void 0?void 0:n.experimentalCancelEventPropagation)===!0;this.destroyChildren(),this.dispatchEvent(lm,i,i),this.remove(),this.emitter.removeAllListeners(),this.destroyed=!0}},{key:"getGeometryBounds",value:function(){return Vt.sceneGraphService.getGeometryBounds(this)}},{key:"getRenderBounds",value:function(){return Vt.sceneGraphService.getBounds(this,!0)}},{key:"getBounds",value:function(){return Vt.sceneGraphService.getBounds(this)}},{key:"getLocalBounds",value:function(){return Vt.sceneGraphService.getLocalBounds(this)}},{key:"getBoundingClientRect",value:function(){return Vt.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(n){if(typeof n!="symbol"){var i=this.attributes[n];return i}}},{key:"hasAttribute",value:function(n){return this.getAttributeNames().includes(n)}},{key:"hasAttributes",value:function(){return!!this.getAttributeNames().length}},{key:"removeAttribute",value:function(n){this.setAttribute(n,null),delete this.attributes[n]}},{key:"setAttribute",value:function(n,i,a,s){this.attributes[n]=i}},{key:"getAttributeNS",value:function(n,i){throw new Error(ln)}},{key:"getAttributeNode",value:function(n){throw new Error(ln)}},{key:"getAttributeNodeNS",value:function(n,i){throw new Error(ln)}},{key:"hasAttributeNS",value:function(n,i){throw new Error(ln)}},{key:"removeAttributeNS",value:function(n,i){throw new Error(ln)}},{key:"removeAttributeNode",value:function(n){throw new Error(ln)}},{key:"setAttributeNS",value:function(n,i,a){throw new Error(ln)}},{key:"setAttributeNode",value:function(n){throw new Error(ln)}},{key:"setAttributeNodeNS",value:function(n){throw new Error(ln)}},{key:"toggleAttribute",value:function(n,i){throw new Error(ln)}}])}(On);function Ye(r){return!!(r!=null&&r.nodeName)}var fT=Vt.globalThis.Proxy?Vt.globalThis.Proxy:function(){},ia=new ra(Fe.ATTR_MODIFIED,null,null,null,null,ra.MODIFICATION,null,null),ul=xt(),vT=qn(),xn=function(r){function t(e){var n;return(0,C.Z)(this,t),n=I(this,t),n.isCustomElement=!1,n.isMutationObserved=!1,n.activeAnimations=[],n.config=e,n.id=e.id||"",n.name=e.name||"",(e.className||e.class)&&(n.className=e.className||e.class),n.nodeName=e.type||Dt.GROUP,e.initialParsedStyle&&Object.assign(n.parsedStyle,e.initialParsedStyle),n.initAttributes(e.style),Vt.enableStyleSyntax&&(n.style=new fT({setProperty:function(a,s){n.setAttribute(a,s)},getPropertyValue:function(a){return n.getAttribute(a)},removeProperty:function(a){n.removeAttribute(a)},item:function(){return""}},{get:function(a,s){return a[s]!==void 0?a[s]:n.getAttribute(s)},set:function(a,s,o){return n.setAttribute(s,o),!0}})),n}return(0,L.Z)(t,r),(0,T.Z)(t,[{key:"destroy",value:function(){_g(t,"destroy",this,3)([]),this.getAnimations().forEach(function(n){n.cancel()})}},{key:"cloneNode",value:function(n,i){var a=(0,z.Z)({},this.attributes);for(var s in a){var o=a[s];Ye(o)&&s!=="clipPath"&&s!=="offsetPath"&&s!=="textPath"&&(a[s]=o.cloneNode(n)),i&&(a[s]=i(s,o))}var l=new this.constructor((0,z.Z)((0,z.Z)({},this.config),{},{style:a}));return l.setLocalTransform(this.getLocalTransform()),n&&this.children.forEach(function(c){if(!c.style.isMarker){var u=c.cloneNode(n);l.appendChild(u)}}),l}},{key:"initAttributes",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i={forceUpdateGeometry:!0};Vt.styleValueRegistry.processProperties(this,n,i),this.dirty()}},{key:"setAttribute",value:function(n,i){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0;Te(i)||(a||i!==this.attributes[n])&&(this.internalSetAttribute(n,i,{memoize:s}),_g(t,"setAttribute",this,3)([n,i]))}},{key:"internalSetAttribute",value:function(n,i){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=this.attributes[n],o=this.parsedStyle[n];Vt.styleValueRegistry.processProperties(this,(0,ae.Z)({},n,i),a),this.dirty();var l=this.parsedStyle[n];if(this.isConnected)if(ia.relatedNode=this,ia.prevValue=s,ia.newValue=i,ia.attrName=n,ia.prevParsedValue=o,ia.newParsedValue=l,this.isMutationObserved)this.dispatchEvent(ia);else{var c,u=((c=this.ownerDocument.defaultView.getConfig().future)===null||c===void 0?void 0:c.experimentalCancelEventPropagation)===!0;ia.target=this,this.ownerDocument.defaultView.dispatchEvent(ia,!0,u)}if(this.isCustomElement&&this.isConnected||!this.isCustomElement){var h,d;(h=(d=this).attributeChangedCallback)===null||h===void 0||h.call(d,n,s,i,o,l)}}},{key:"getBBox",value:function(){var n=this.getBounds(),i=n.getMin(),a=(0,G.Z)(i,2),s=a[0],o=a[1],l=n.getMax(),c=(0,G.Z)(l,2),u=c[0],h=c[1];return new lo(s,o,u-s,h-o)}},{key:"setOrigin",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;return Vt.sceneGraphService.setOrigin(this,zr(n,i,a,!1)),this}},{key:"getOrigin",value:function(){return Vt.sceneGraphService.getOrigin(this)}},{key:"setPosition",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;return Vt.sceneGraphService.setPosition(this,zr(n,i,a,!1)),this}},{key:"setLocalPosition",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;return Vt.sceneGraphService.setLocalPosition(this,zr(n,i,a,!1)),this}},{key:"translate",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;return Vt.sceneGraphService.translate(this,zr(n,i,a,!1)),this}},{key:"translateLocal",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;return Vt.sceneGraphService.translateLocal(this,zr(n,i,a,!1)),this}},{key:"getPosition",value:function(){return Vt.sceneGraphService.getPosition(this)}},{key:"getLocalPosition",value:function(){return Vt.sceneGraphService.getLocalPosition(this)}},{key:"scale",value:function(n,i,a){return this.scaleLocal(n,i,a)}},{key:"scaleLocal",value:function(n,i,a){return typeof n=="number"&&(i=i||n,a=a||n,n=zr(n,i,a,!1)),Vt.sceneGraphService.scaleLocal(this,n),this}},{key:"setLocalScale",value:function(n,i,a){return typeof n=="number"&&(i=i||n,a=a||n,n=zr(n,i,a,!1)),Vt.sceneGraphService.setLocalScale(this,n),this}},{key:"getLocalScale",value:function(){return Vt.sceneGraphService.getLocalScale(this)}},{key:"getScale",value:function(){return Vt.sceneGraphService.getScale(this)}},{key:"getEulerAngles",value:function(){var n=zd(ul,Vt.sceneGraphService.getWorldTransform(this)),i=(0,G.Z)(n,3),a=i[2];return Qr(a)}},{key:"getLocalEulerAngles",value:function(){var n=zd(ul,Vt.sceneGraphService.getLocalRotation(this)),i=(0,G.Z)(n,3),a=i[2];return Qr(a)}},{key:"setEulerAngles",value:function(n){return Vt.sceneGraphService.setEulerAngles(this,0,0,n),this}},{key:"setLocalEulerAngles",value:function(n){return Vt.sceneGraphService.setLocalEulerAngles(this,0,0,n),this}},{key:"rotateLocal",value:function(n,i,a){return be(i)&&be(a)?Vt.sceneGraphService.rotateLocal(this,0,0,n):Vt.sceneGraphService.rotateLocal(this,n,i,a),this}},{key:"rotate",value:function(n,i,a){return be(i)&&be(a)?Vt.sceneGraphService.rotate(this,0,0,n):Vt.sceneGraphService.rotate(this,n,i,a),this}},{key:"setRotation",value:function(n,i,a,s){return Vt.sceneGraphService.setRotation(this,n,i,a,s),this}},{key:"setLocalRotation",value:function(n,i,a,s){return Vt.sceneGraphService.setLocalRotation(this,n,i,a,s),this}},{key:"setLocalSkew",value:function(n,i){return Vt.sceneGraphService.setLocalSkew(this,n,i),this}},{key:"getRotation",value:function(){return Vt.sceneGraphService.getRotation(this)}},{key:"getLocalRotation",value:function(){return Vt.sceneGraphService.getLocalRotation(this)}},{key:"getLocalSkew",value:function(){return Vt.sceneGraphService.getLocalSkew(this)}},{key:"getLocalTransform",value:function(){return Vt.sceneGraphService.getLocalTransform(this)}},{key:"getWorldTransform",value:function(){return Vt.sceneGraphService.getWorldTransform(this)}},{key:"setLocalTransform",value:function(n){return Vt.sceneGraphService.setLocalTransform(this,n),this}},{key:"resetLocalTransform",value:function(){Vt.sceneGraphService.resetLocalTransform(this)}},{key:"getAnimations",value:function(){return this.activeAnimations}},{key:"animate",value:function(n,i){var a,s=(a=this.ownerDocument)===null||a===void 0?void 0:a.timeline;return s?s.play(this,n,i):null}},{key:"isVisible",value:function(){var n;return((n=this.parsedStyle)===null||n===void 0?void 0:n.visibility)!=="hidden"}},{key:"interactive",get:function(){return this.isInteractive()},set:function(n){this.style.pointerEvents=n?"auto":"none"}},{key:"isInteractive",value:function(){var n;return((n=this.parsedStyle)===null||n===void 0?void 0:n.pointerEvents)!=="none"}},{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,N.Z)(this.parentNode.children.map(function(n){return Number(n.style.zIndex)})))+1),this}},{key:"toBack",value:function(){return this.parentNode&&(this.style.zIndex=Math.min.apply(Math,(0,N.Z)(this.parentNode.children.map(function(n){return Number(n.style.zIndex)})))-1),this}},{key:"getConfig",value:function(){return this.config}},{key:"attr",value:function(){for(var n=this,i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];var o=a[0],l=a[1];return o?zn(o)?(Object.keys(o).forEach(function(c){n.setAttribute(c,o[c])}),this):a.length===2?(this.setAttribute(o,l),this):this.attributes[o]:this.attributes}},{key:"getMatrix",value:function(n){var i=n||this.getWorldTransform(),a=ro(ul,i),s=(0,G.Z)(a,2),o=s[0],l=s[1],c=_a(ul,i),u=(0,G.Z)(c,2),h=u[0],d=u[1],f=io(vT,i),v=zd(ul,f),g=(0,G.Z)(v,3),p=g[0],y=g[2];return sS(p||y,o,l,h,d)}},{key:"getLocalMatrix",value:function(){return this.getMatrix(this.getLocalTransform())}},{key:"setMatrix",value:function(n){var i=$g(n),a=(0,G.Z)(i,5),s=a[0],o=a[1],l=a[2],c=a[3],u=a[4];this.setEulerAngles(u).setPosition(s,o).setLocalScale(l,c)}},{key:"setLocalMatrix",value:function(n){var i=$g(n),a=(0,G.Z)(i,5),s=a[0],o=a[1],l=a[2],c=a[3],u=a[4];this.setLocalEulerAngles(u).setLocalPosition(s,o).setLocalScale(l,c)}},{key:"show",value:function(){this.forEach(function(n){n.style.visibility="visible"})}},{key:"hide",value:function(){this.forEach(function(n){n.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(n){return this.children[n]||null}},{key:"add",value:function(n,i){return this.appendChild(n,i)}},{key:"set",value:function(n,i){this.config[n]=i}},{key:"get",value:function(n){return this.config[n]}},{key:"moveTo",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;return this.setPosition(n,i,a),this}},{key:"move",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;return this.setPosition(n,i,a),this}},{key:"setZIndex",value:function(n){return this.style.zIndex=n,this}}])}(dT);xn.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 aa=function(r){function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return(0,C.Z)(this,t),I(this,t,[(0,z.Z)({type:Dt.CIRCLE},e)])}return(0,L.Z)(t,r),(0,T.Z)(t)}(xn);aa.PARSED_STYLE_LIST=new Set([].concat((0,N.Z)(xn.PARSED_STYLE_LIST),["cx","cy","cz","r","isBillboard","isSizeAttenuation"]));var gT=["style"],pf=function(r){function t(){var e,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=n.style,a=(0,gs.Z)(n,gT);return(0,C.Z)(this,t),e=I(this,t,[(0,z.Z)({style:i},a)]),e.isCustomElement=!0,e}return(0,L.Z)(t,r),(0,T.Z)(t)}(xn);pf.PARSED_STYLE_LIST=new Set(["class","className","clipPath","cursor","draggable","droppable","opacity","pointerEvents","transform","transformOrigin","zIndex","visibility"]);var hl=function(r){function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return(0,C.Z)(this,t),I(this,t,[(0,z.Z)({type:Dt.ELLIPSE},e)])}return(0,L.Z)(t,r),(0,T.Z)(t)}(xn);hl.PARSED_STYLE_LIST=new Set([].concat((0,N.Z)(xn.PARSED_STYLE_LIST),["cx","cy","cz","rx","ry","isBillboard","isSizeAttenuation"]));var pT=function(r){function t(){return(0,C.Z)(this,t),I(this,t,[{type:Dt.FRAGMENT}])}return(0,L.Z)(t,r),(0,T.Z)(t)}(xn);pT.PARSED_STYLE_LIST=new Set(["class","className"]);var ar=function(r){function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return(0,C.Z)(this,t),I(this,t,[(0,z.Z)({type:Dt.GROUP},e)])}return(0,L.Z)(t,r),(0,T.Z)(t)}(xn);ar.PARSED_STYLE_LIST=new Set(["class","className","clipPath","cursor","draggable","droppable","opacity","pointerEvents","transform","transformOrigin","zIndex","visibility"]);var mT=["style"],Ts=function(r){function t(){var e,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=n.style,a=(0,gs.Z)(n,mT);return(0,C.Z)(this,t),e=I(this,t,[(0,z.Z)({type:Dt.HTML,style:i},a)]),e.cullable.enable=!1,e}return(0,L.Z)(t,r),(0,T.Z)(t,[{key:"getDomElement",value:function(){return this.parsedStyle.$el}},{key:"getClientRects",value:function(){return[this.getBoundingClientRect()]}},{key:"getLocalBounds",value:function(){if(this.parentNode){var n=ee(oe(),this.parentNode.getWorldTransform()),i=this.getBounds();if(!yn.isEmpty(i)){var a=new yn;return a.setFromTransformedAABB(i,n),a}}return this.getBounds()}}])}(xn);Ts.PARSED_STYLE_LIST=new Set([].concat((0,N.Z)(xn.PARSED_STYLE_LIST),["x","y","$el","innerHTML","width","height"]));var dl=function(r){function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return(0,C.Z)(this,t),I(this,t,[(0,z.Z)({type:Dt.IMAGE},e)])}return(0,L.Z)(t,r),(0,T.Z)(t)}(xn);dl.PARSED_STYLE_LIST=new Set([].concat((0,N.Z)(xn.PARSED_STYLE_LIST),["x","y","z","src","width","height","isBillboard","billboardRotation","isSizeAttenuation","keepAspectRatio"]));var yT=["style"],Os=function(r){function t(){var e,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=n.style,a=(0,gs.Z)(n,yT);(0,C.Z)(this,t),e=I(this,t,[(0,z.Z)({type:Dt.LINE,style:(0,z.Z)({x1:0,y1:0,x2:0,y2:0,z1:0,z2:0},i)},a)]),e.markerStartAngle=0,e.markerEndAngle=0;var s=e.parsedStyle,o=s.markerStart,l=s.markerEnd;return o&&Ye(o)&&(e.markerStartAngle=o.getLocalEulerAngles(),e.appendChild(o)),l&&Ye(l)&&(e.markerEndAngle=l.getLocalEulerAngles(),e.appendChild(l)),e.transformMarker(!0),e.transformMarker(!1),e}return(0,L.Z)(t,r),(0,T.Z)(t,[{key:"attributeChangedCallback",value:function(n,i,a,s,o){n==="x1"||n==="y1"||n==="x2"||n==="y2"||n==="markerStartOffset"||n==="markerEndOffset"?(this.transformMarker(!0),this.transformMarker(!1)):n==="markerStart"?(s&&Ye(s)&&(this.markerStartAngle=0,s.remove()),o&&Ye(o)&&(this.markerStartAngle=o.getLocalEulerAngles(),this.appendChild(o),this.transformMarker(!0))):n==="markerEnd"&&(s&&Ye(s)&&(this.markerEndAngle=0,s.remove()),o&&Ye(o)&&(this.markerEndAngle=o.getLocalEulerAngles(),this.appendChild(o),this.transformMarker(!1)))}},{key:"transformMarker",value:function(n){var i=this.parsedStyle,a=i.markerStart,s=i.markerEnd,o=i.markerStartOffset,l=i.markerEndOffset,c=i.x1,u=i.x2,h=i.y1,d=i.y2,f=n?a:s;if(!(!f||!Ye(f))){var v=0,g,p,y,b,E,O;n?(y=c,b=h,g=u-c,p=d-h,E=o||0,O=this.markerStartAngle):(y=u,b=d,g=c-u,p=h-d,E=l||0,O=this.markerEndAngle),v=Math.atan2(p,g),f.setLocalEulerAngles(v*180/Math.PI+O),f.setLocalPosition(y+Math.cos(v)*E,b+Math.sin(v)*E)}}},{key:"getPoint",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,a=this.parsedStyle,s=a.x1,o=a.y1,l=a.x2,c=a.y2,u=$i(s,o,l,c,n),h=u.x,d=u.y,f=Sn(xt(),jt(h,d,0),i?this.getWorldTransform():this.getLocalTransform());return new yr(f[0],f[1])}},{key:"getPointAtLength",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return this.getPoint(n/this.getTotalLength(),i)}},{key:"getTotalLength",value:function(){var n=this.parsedStyle,i=n.x1,a=n.y1,s=n.x2,o=n.y2;return jg(i,a,s,o)}}])}(xn);Os.PARSED_STYLE_LIST=new Set([].concat((0,N.Z)(xn.PARSED_STYLE_LIST),["x1","y1","x2","y2","z1","z2","isBillboard","isSizeAttenuation","markerStart","markerEnd","markerStartOffset","markerEndOffset"]));var bT=["style"],li=function(r){function t(){var e,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=n.style,a=(0,gs.Z)(n,bT);(0,C.Z)(this,t),e=I(this,t,[(0,z.Z)({type:Dt.PATH,style:i,initialParsedStyle:{miterLimit:4,d:(0,z.Z)({},ap)}},a)]),e.markerStartAngle=0,e.markerEndAngle=0,e.markerMidList=[];var s=e.parsedStyle,o=s.markerStart,l=s.markerEnd,c=s.markerMid;return o&&Ye(o)&&(e.markerStartAngle=o.getLocalEulerAngles(),e.appendChild(o)),c&&Ye(c)&&e.placeMarkerMid(c),l&&Ye(l)&&(e.markerEndAngle=l.getLocalEulerAngles(),e.appendChild(l)),e.transformMarker(!0),e.transformMarker(!1),e}return(0,L.Z)(t,r),(0,T.Z)(t,[{key:"attributeChangedCallback",value:function(n,i,a,s,o){n==="d"?(this.transformMarker(!0),this.transformMarker(!1),this.placeMarkerMid(this.parsedStyle.markerMid)):n==="markerStartOffset"||n==="markerEndOffset"?(this.transformMarker(!0),this.transformMarker(!1)):n==="markerStart"?(s&&Ye(s)&&(this.markerStartAngle=0,s.remove()),o&&Ye(o)&&(this.markerStartAngle=o.getLocalEulerAngles(),this.appendChild(o),this.transformMarker(!0))):n==="markerEnd"?(s&&Ye(s)&&(this.markerEndAngle=0,s.remove()),o&&Ye(o)&&(this.markerEndAngle=o.getLocalEulerAngles(),this.appendChild(o),this.transformMarker(!1))):n==="markerMid"&&this.placeMarkerMid(o)}},{key:"transformMarker",value:function(n){var i=this.parsedStyle,a=i.markerStart,s=i.markerEnd,o=i.markerStartOffset,l=i.markerEndOffset,c=n?a:s;if(!(!c||!Ye(c))){var u=0,h,d,f,v,g,p;if(n){var y=this.getStartTangent(),b=(0,G.Z)(y,2),E=b[0],O=b[1];f=O[0],v=O[1],h=E[0]-O[0],d=E[1]-O[1],g=o||0,p=this.markerStartAngle}else{var k=this.getEndTangent(),P=(0,G.Z)(k,2),F=P[0],B=P[1];f=B[0],v=B[1],h=F[0]-B[0],d=F[1]-B[1],g=l||0,p=this.markerEndAngle}u=Math.atan2(d,h),c.setLocalEulerAngles(u*180/Math.PI+p),c.setLocalPosition(f+Math.cos(u)*g,v+Math.sin(u)*g)}}},{key:"placeMarkerMid",value:function(n){var i=this.parsedStyle.d.segments;if(this.markerMidList.forEach(function(u){u.remove()}),n&&Ye(n))for(var a=1;a<i.length-1;a++){var s=(0,G.Z)(i[a].currentPoint,2),o=s[0],l=s[1],c=a===1?n:n.cloneNode(!0);this.markerMidList.push(c),this.appendChild(c),c.setLocalPosition(o,l)}}},{key:"getTotalLength",value:function(){return Jd(this)}},{key:"getPointAtLength",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,a=this.parsedStyle.d.absolutePath,s=w2(a,n),o=s.x,l=s.y,c=Sn(xt(),jt(o,l,0),i?this.getWorldTransform():this.getLocalTransform());return new yr(c[0],c[1])}},{key:"getPoint",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return this.getPointAtLength(n*Jd(this),i)}},{key:"getStartTangent",value:function(){var n=this.parsedStyle.d.segments,i=[];if(n.length>1){var a=n[0].currentPoint,s=n[1].currentPoint,o=n[1].startTangent;i=[],o?(i.push([a[0]-o[0],a[1]-o[1]]),i.push([a[0],a[1]])):(i.push([s[0],s[1]]),i.push([a[0],a[1]]))}return i}},{key:"getEndTangent",value:function(){var n=this.parsedStyle.d.segments,i=n.length,a=[];if(i>1){var s=n[i-2].currentPoint,o=n[i-1].currentPoint,l=n[i-1].endTangent;a=[],l?(a.push([o[0]-l[0],o[1]-l[1]]),a.push([o[0],o[1]])):(a.push([s[0],s[1]]),a.push([o[0],o[1]]))}return a}}])}(xn);li.PARSED_STYLE_LIST=new Set([].concat((0,N.Z)(xn.PARSED_STYLE_LIST),["d","markerStart","markerMid","markerEnd","markerStartOffset","markerEndOffset","isBillboard","isSizeAttenuation"]));var xT=["style"],Cs=function(r){function t(){var e,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=n.style,a=(0,gs.Z)(n,xT);(0,C.Z)(this,t),e=I(this,t,[(0,z.Z)({type:Dt.POLYGON,style:i,initialParsedStyle:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!0}},a)]),e.markerStartAngle=0,e.markerEndAngle=0,e.markerMidList=[];var s=e.parsedStyle,o=s.markerStart,l=s.markerEnd,c=s.markerMid;return o&&Ye(o)&&(e.markerStartAngle=o.getLocalEulerAngles(),e.appendChild(o)),c&&Ye(c)&&e.placeMarkerMid(c),l&&Ye(l)&&(e.markerEndAngle=l.getLocalEulerAngles(),e.appendChild(l)),e.transformMarker(!0),e.transformMarker(!1),e}return(0,L.Z)(t,r),(0,T.Z)(t,[{key:"attributeChangedCallback",value:function(n,i,a,s,o){n==="points"?(this.transformMarker(!0),this.transformMarker(!1),this.placeMarkerMid(this.parsedStyle.markerMid)):n==="markerStartOffset"||n==="markerEndOffset"?(this.transformMarker(!0),this.transformMarker(!1)):n==="markerStart"?(s&&Ye(s)&&(this.markerStartAngle=0,s.remove()),o&&Ye(o)&&(this.markerStartAngle=o.getLocalEulerAngles(),this.appendChild(o),this.transformMarker(!0))):n==="markerEnd"?(s&&Ye(s)&&(this.markerEndAngle=0,s.remove()),o&&Ye(o)&&(this.markerEndAngle=o.getLocalEulerAngles(),this.appendChild(o),this.transformMarker(!1))):n==="markerMid"&&this.placeMarkerMid(o)}},{key:"transformMarker",value:function(n){var i=this.parsedStyle,a=i.markerStart,s=i.markerEnd,o=i.markerStartOffset,l=i.markerEndOffset,c=i.points,u=c||{},h=u.points,d=n?a:s;if(!(!d||!Ye(d)||!h)){var f=0,v,g,p,y,b,E;if(p=h[0][0],y=h[0][1],n)v=h[1][0]-h[0][0],g=h[1][1]-h[0][1],b=o||0,E=this.markerStartAngle;else{var O=h.length;this.parsedStyle.isClosed?(v=h[O-1][0]-h[0][0],g=h[O-1][1]-h[0][1]):(p=h[O-1][0],y=h[O-1][1],v=h[O-2][0]-h[O-1][0],g=h[O-2][1]-h[O-1][1]),b=l||0,E=this.markerEndAngle}f=Math.atan2(g,v),d.setLocalEulerAngles(f*180/Math.PI+E),d.setLocalPosition(p+Math.cos(f)*b,y+Math.sin(f)*b)}}},{key:"placeMarkerMid",value:function(n){var i=this.parsedStyle.points,a=i||{},s=a.points;if(this.markerMidList.forEach(function(h){h.remove()}),this.markerMidList=[],n&&Ye(n)&&s)for(var o=1;o<(this.parsedStyle.isClosed?s.length:s.length-1);o++){var l=s[o][0],c=s[o][1],u=o===1?n:n.cloneNode(!0);this.markerMidList.push(u),this.appendChild(u),u.setLocalPosition(l,c)}}}])}(xn);Cs.PARSED_STYLE_LIST=new Set([].concat((0,N.Z)(xn.PARSED_STYLE_LIST),["points","markerStart","markerMid","markerEnd","markerStartOffset","markerEndOffset","isClosed","isBillboard","isSizeAttenuation"]));var ET=["style"],Dc=function(r){function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=e.style,i=(0,gs.Z)(e,ET);return(0,C.Z)(this,t),I(this,t,[(0,z.Z)({type:Dt.POLYLINE,style:n,initialParsedStyle:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!1}},i)])}return(0,L.Z)(t,r),(0,T.Z)(t,[{key:"getTotalLength",value:function(){return cM(this)}},{key:"getPointAtLength",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return this.getPoint(n/this.getTotalLength(),i)}},{key:"getPoint",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,a=this.parsedStyle.points.points;if(this.parsedStyle.points.segments.length===0){var s=[],o=0,l,c,u=this.getTotalLength();a.forEach(function(y,b){a[b+1]&&(l=[0,0],l[0]=o/u,c=jg(y[0],y[1],a[b+1][0],a[b+1][1]),o+=c,l[1]=o/u,s.push(l))}),this.parsedStyle.points.segments=s}var h=0,d=0;this.parsedStyle.points.segments.forEach(function(y,b){n>=y[0]&&n<=y[1]&&(h=(n-y[0])/(y[1]-y[0]),d=b)});var f=$i(a[d][0],a[d][1],a[d+1][0],a[d+1][1],h),v=f.x,g=f.y,p=Sn(xt(),jt(v,g,0),i?this.getWorldTransform():this.getLocalTransform());return new yr(p[0],p[1])}},{key:"getStartTangent",value:function(){var n=this.parsedStyle.points.points,i=[];return i.push([n[1][0],n[1][1]]),i.push([n[0][0],n[0][1]]),i}},{key:"getEndTangent",value:function(){var n=this.parsedStyle.points.points,i=n.length-1,a=[];return a.push([n[i-1][0],n[i-1][1]]),a.push([n[i][0],n[i][1]]),a}}])}(Cs);Dc.PARSED_STYLE_LIST=new Set([].concat((0,N.Z)(Cs.PARSED_STYLE_LIST),["points","markerStart","markerMid","markerEnd","markerStartOffset","markerEndOffset","isBillboard"]));var br=function(r){function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return(0,C.Z)(this,t),I(this,t,[(0,z.Z)({type:Dt.RECT},e)])}return(0,L.Z)(t,r),(0,T.Z)(t)}(xn);br.PARSED_STYLE_LIST=new Set([].concat((0,N.Z)(xn.PARSED_STYLE_LIST),["x","y","z","width","height","isBillboard","isSizeAttenuation","radius"]));var wT=["style"],Ns=function(r){function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=e.style,i=(0,gs.Z)(e,wT);return(0,C.Z)(this,t),I(this,t,[(0,z.Z)({type:Dt.TEXT,style:(0,z.Z)({fill:"black"},n)},i)])}return(0,L.Z)(t,r),(0,T.Z)(t,[{key:"getComputedTextLength",value:function(){var n;return this.getGeometryBounds(),((n=this.parsedStyle.metrics)===null||n===void 0?void 0:n.maxLineWidth)||0}},{key:"getLineBoundingRects",value:function(){var n;return this.getGeometryBounds(),((n=this.parsedStyle.metrics)===null||n===void 0?void 0:n.lineMetrics)||[]}},{key:"isOverflowing",value:function(){return this.getGeometryBounds(),!!this.parsedStyle.isOverflowing}}])}(xn);Ns.PARSED_STYLE_LIST=new Set([].concat((0,N.Z)(xn.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 ST=function(){function r(){(0,C.Z)(this,r),this.registry={},this.define(Dt.CIRCLE,aa),this.define(Dt.ELLIPSE,hl),this.define(Dt.RECT,br),this.define(Dt.IMAGE,dl),this.define(Dt.LINE,Os),this.define(Dt.GROUP,ar),this.define(Dt.PATH,li),this.define(Dt.POLYGON,Cs),this.define(Dt.POLYLINE,Dc),this.define(Dt.TEXT,Ns),this.define(Dt.HTML,Ts)}return(0,T.Z)(r,[{key:"define",value:function(e,n){this.registry[e]=n}},{key:"get",value:function(e){return this.registry[e]}}])}(),v9={number:function(t){return new hn(t)},percent:function(t){return new hn(t,"%")},px:function(t){return new hn(t,"px")},em:function(t){return new hn(t,"em")},rem:function(t){return new hn(t,"rem")},deg:function(t){return new hn(t,"deg")},grad:function(t){return new hn(t,"grad")},rad:function(t){return new hn(t,"rad")},turn:function(t){return new hn(t,"turn")},s:function(t){return new hn(t,"s")},ms:function(t){return new hn(t,"ms")},registerProperty:function(t){var e=t.name,n=t.inherits,i=t.interpolable,a=t.initialValue,s=t.syntax;Vt.styleValueRegistry.registerMetadata({n:e,inh:n,int:i,d:a,syntax:s})},registerLayout:function(t,e){Vt.layoutRegistry.registerLayout(t,e)}},cm=function(r){function t(){var e;(0,C.Z)(this,t),e=I(this,t),e.defaultView=null,e.ownerDocument=null,e.nodeName="document";try{e.timeline=new Vt.AnimationTimeline(e)}catch(i){}var n={};return rf.forEach(function(i){var a=i.n,s=i.inh,o=i.d;s&&o&&(n[a]=ue(o)?o(Dt.GROUP):o)}),e.documentElement=new ar({id:"g-root",style:n}),e.documentElement.ownerDocument=e,e.documentElement.parentNode=e,e.childNodes=[e.documentElement],e}return(0,L.Z)(t,r),(0,T.Z)(t,[{key:"children",get:function(){return this.childNodes}},{key:"childElementCount",get:function(){return this.childNodes.length}},{key:"firstElementChild",get:function(){return this.firstChild}},{key:"lastElementChild",get:function(){return this.lastChild}},{key:"createElement",value:function(n,i){if(n==="svg")return this.documentElement;var a=this.defaultView.customElements.get(n);a||(console.warn("Unsupported tagName: ",n),a=n==="tspan"?Ns:ar);var s=new a(i);return s.ownerDocument=this,s}},{key:"createElementNS",value:function(n,i,a){return this.createElement(i,a)}},{key:"cloneNode",value:function(n){throw new Error(ln)}},{key:"destroy",value:function(){try{this.documentElement.destroyChildren(),this.timeline.destroy()}catch(n){}}},{key:"elementsFromBBox",value:function(n,i,a,s){var o=this.defaultView.context.rBushRoot,l=o.search({minX:n,minY:i,maxX:a,maxY:s}),c=[];return l.forEach(function(u){var h=u.displayObject,d=h.parsedStyle.pointerEvents,f=d===void 0?"auto":d,v=["auto","visiblepainted","visiblefill","visiblestroke","visible"].includes(f);(!v||v&&h.isVisible())&&!h.isCulled()&&h.isInteractive()&&c.push(h)}),c.sort(function(u,h){return h.sortable.renderOrder-u.sortable.renderOrder}),c}},{key:"elementFromPointSync",value:function(n,i){var a=this.defaultView.canvas2Viewport({x:n,y:i}),s=a.x,o=a.y,l=this.defaultView.getConfig(),c=l.width,u=l.height;if(s<0||o<0||s>c||o>u)return null;var h=this.defaultView.viewport2Client({x:s,y:o}),d=h.x,f=h.y,v=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!0,position:{x:n,y:i,viewportX:s,viewportY:o,clientX:d,clientY:f},picked:[]}),g=v.picked;return g&&g[0]||this.documentElement}},{key:"elementFromPoint",value:function(){var e=(0,Fa.Z)((0,Pr.Z)().mark(function i(a,s){var o,l,c,u,h,d,f,v,g,p,y;return(0,Pr.Z)().wrap(function(b){for(;;)switch(b.prev=b.next){case 0:if(o=this.defaultView.canvas2Viewport({x:a,y:s}),l=o.x,c=o.y,u=this.defaultView.getConfig(),h=u.width,d=u.height,!(l<0||c<0||l>h||c>d)){b.next=1;break}return b.abrupt("return",null);case 1:return f=this.defaultView.viewport2Client({x:l,y:c}),v=f.x,g=f.y,b.next=2,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!0,position:{x:a,y:s,viewportX:l,viewportY:c,clientX:v,clientY:g},picked:[]});case 2:return p=b.sent,y=p.picked,b.abrupt("return",y&&y[0]||this.documentElement);case 3:case"end":return b.stop()}},i,this)}));function n(i,a){return e.apply(this,arguments)}return n}()},{key:"elementsFromPointSync",value:function(n,i){var a=this.defaultView.canvas2Viewport({x:n,y:i}),s=a.x,o=a.y,l=this.defaultView.getConfig(),c=l.width,u=l.height;if(s<0||o<0||s>c||o>u)return[];var h=this.defaultView.viewport2Client({x:s,y:o}),d=h.x,f=h.y,v=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!1,position:{x:n,y:i,viewportX:s,viewportY:o,clientX:d,clientY:f},picked:[]}),g=v.picked;return g[g.length-1]!==this.documentElement&&g.push(this.documentElement),g}},{key:"elementsFromPoint",value:function(){var e=(0,Fa.Z)((0,Pr.Z)().mark(function i(a,s){var o,l,c,u,h,d,f,v,g,p,y;return(0,Pr.Z)().wrap(function(b){for(;;)switch(b.prev=b.next){case 0:if(o=this.defaultView.canvas2Viewport({x:a,y:s}),l=o.x,c=o.y,u=this.defaultView.getConfig(),h=u.width,d=u.height,!(l<0||c<0||l>h||c>d)){b.next=1;break}return b.abrupt("return",[]);case 1:return f=this.defaultView.viewport2Client({x:l,y:c}),v=f.x,g=f.y,b.next=2,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!1,position:{x:a,y:s,viewportX:l,viewportY:c,clientX:v,clientY:g},picked:[]});case 2:return p=b.sent,y=p.picked,y[y.length-1]!==this.documentElement&&y.push(this.documentElement),b.abrupt("return",y);case 3:case"end":return b.stop()}},i,this)}));function n(i,a){return e.apply(this,arguments)}return n}()},{key:"appendChild",value:function(n,i){throw new Error(co)}},{key:"insertBefore",value:function(n,i){throw new Error(co)}},{key:"removeChild",value:function(n,i){throw new Error(co)}},{key:"replaceChild",value:function(n,i,a){throw new Error(co)}},{key:"append",value:function(){throw new Error(co)}},{key:"prepend",value:function(){throw new Error(co)}},{key:"getElementById",value:function(n){return this.documentElement.getElementById(n)}},{key:"getElementsByName",value:function(n){return this.documentElement.getElementsByName(n)}},{key:"getElementsByTagName",value:function(n){return this.documentElement.getElementsByTagName(n)}},{key:"getElementsByClassName",value:function(n){return this.documentElement.getElementsByClassName(n)}},{key:"querySelector",value:function(n){return this.documentElement.querySelector(n)}},{key:"querySelectorAll",value:function(n){return this.documentElement.querySelectorAll(n)}},{key:"find",value:function(n){return this.documentElement.find(n)}},{key:"findAll",value:function(n){return this.documentElement.findAll(n)}}])}(On),um=function(){function r(t){(0,C.Z)(this,r),this.strategies=t}return(0,T.Z)(r,[{key:"apply",value:function(e){var n=e.config,i=e.camera,a=e.renderingService,s=e.renderingContext,o=this.strategies;a.hooks.cull.tap(r.tag,function(l){if(l){var c,u=l.cullable;if(o.length===0?u.visible=s.unculledEntities.indexOf(l.entity)>-1:u.visible=o.every(function(d){return d.isVisible(i,l)}),!l.isCulled()&&l.isVisible())return l;var h=((c=n.future)===null||c===void 0?void 0:c.experimentalCancelEventPropagation)===!0;return l.dispatchEvent(new Jn(Fe.CULLED),h,h),null}return l}),a.hooks.afterRender.tap(r.tag,function(l){l.cullable.visibilityPlaneMask=-1})}}])}();um.tag="Culling";var hm=function(){function r(){var t=this;(0,C.Z)(this,r),this.autoPreventDefault=!1,this.rootPointerEvent=new kc(null),this.rootWheelEvent=new df(null),this.onPointerMove=function(e){var n,i=(n=t.context.renderingContext.root)===null||n===void 0||(n=n.ownerDocument)===null||n===void 0?void 0:n.defaultView;if(!(i.supportsTouchEvents&&e.pointerType==="touch")){var a=t.normalizeToPointerEvent(e,i),s=vs(a),o;try{for(s.s();!(o=s.n()).done;){var l=o.value,c=t.bootstrapEvent(t.rootPointerEvent,l,i,e);t.context.eventService.mapEvent(c)}}catch(u){s.e(u)}finally{s.f()}t.setCursor(t.context.eventService.cursor)}},this.onClick=function(e){var n,i=(n=t.context.renderingContext.root)===null||n===void 0||(n=n.ownerDocument)===null||n===void 0?void 0:n.defaultView,a=t.normalizeToPointerEvent(e,i),s=vs(a),o;try{for(s.s();!(o=s.n()).done;){var l=o.value,c=t.bootstrapEvent(t.rootPointerEvent,l,i,e);t.context.eventService.mapEvent(c)}}catch(u){s.e(u)}finally{s.f()}t.setCursor(t.context.eventService.cursor)}}return(0,T.Z)(r,[{key:"apply",value:function(e){var n=this;this.context=e;var i=e.renderingService,a=this.context.renderingContext.root.ownerDocument.defaultView;this.context.eventService.setPickHandler(function(s){var o=n.context.renderingService.hooks.pickSync.call({position:s,picked:[],topmost:!0}),l=o.picked;return l[0]||null}),i.hooks.pointerWheel.tap(r.tag,function(s){var o=n.normalizeWheelEvent(s);n.context.eventService.mapEvent(o)}),i.hooks.pointerDown.tap(r.tag,function(s){if(!(a.supportsTouchEvents&&s.pointerType==="touch")){var o=n.normalizeToPointerEvent(s,a);if(n.autoPreventDefault&&o[0].isNormalized){var l=s.cancelable||!("cancelable"in s);l&&s.preventDefault()}var c=vs(o),u;try{for(c.s();!(u=c.n()).done;){var h=u.value,d=n.bootstrapEvent(n.rootPointerEvent,h,a,s);n.context.eventService.mapEvent(d)}}catch(f){c.e(f)}finally{c.f()}n.setCursor(n.context.eventService.cursor)}}),i.hooks.pointerUp.tap(r.tag,function(s){if(!(a.supportsTouchEvents&&s.pointerType==="touch")){var o=n.context.contextService.getDomElement(),l=n.context.eventService.isNativeEventFromCanvas(o,s),c=l?"":"outside",u=n.normalizeToPointerEvent(s,a),h=vs(u),d;try{for(h.s();!(d=h.n()).done;){var f=d.value,v=n.bootstrapEvent(n.rootPointerEvent,f,a,s);v.type+=c,n.context.eventService.mapEvent(v)}}catch(g){h.e(g)}finally{h.f()}n.setCursor(n.context.eventService.cursor)}}),i.hooks.pointerMove.tap(r.tag,this.onPointerMove),i.hooks.pointerOver.tap(r.tag,this.onPointerMove),i.hooks.pointerOut.tap(r.tag,this.onPointerMove),i.hooks.click.tap(r.tag,this.onClick),i.hooks.pointerCancel.tap(r.tag,function(s){var o=n.normalizeToPointerEvent(s,a),l=vs(o),c;try{for(l.s();!(c=l.n()).done;){var u=c.value,h=n.bootstrapEvent(n.rootPointerEvent,u,a,s);n.context.eventService.mapEvent(h)}}catch(d){l.e(d)}finally{l.f()}n.setCursor(n.context.eventService.cursor)})}},{key:"bootstrapEvent",value:function(e,n,i,a){e.view=i,e.originalEvent=null,e.nativeEvent=a,e.pointerId=n.pointerId,e.width=n.width,e.height=n.height,e.isPrimary=n.isPrimary,e.pointerType=n.pointerType,e.pressure=n.pressure,e.tangentialPressure=n.tangentialPressure,e.tiltX=n.tiltX,e.tiltY=n.tiltY,e.twist=n.twist,this.transferMouseData(e,n);var s=this.context.eventService.client2Viewport({x:n.clientX,y:n.clientY}),o=s.x,l=s.y;e.viewport.x=o,e.viewport.y=l;var c=this.context.eventService.viewport2Canvas(e.viewport),u=c.x,h=c.y;return e.canvas.x=u,e.canvas.y=h,e.global.copyFrom(e.canvas),e.offset.copyFrom(e.canvas),e.isTrusted=a.isTrusted,e.type==="pointerleave"&&(e.type="pointerout"),e.type.startsWith("mouse")&&(e.type=e.type.replace("mouse","pointer")),e.type.startsWith("touch")&&(e.type=sA[e.type]||e.type),e}},{key:"normalizeWheelEvent",value:function(e){var n=this.rootWheelEvent;this.transferMouseData(n,e),n.deltaMode=e.deltaMode,n.deltaX=e.deltaX,n.deltaY=e.deltaY,n.deltaZ=e.deltaZ;var i=this.context.eventService.client2Viewport({x:e.clientX,y:e.clientY}),a=i.x,s=i.y;n.viewport.x=a,n.viewport.y=s;var o=this.context.eventService.viewport2Canvas(n.viewport),l=o.x,c=o.y;return n.canvas.x=l,n.canvas.y=c,n.global.copyFrom(n.canvas),n.offset.copyFrom(n.canvas),n.nativeEvent=e,n.type=e.type,n}},{key:"transferMouseData",value:function(e,n){e.isTrusted=n.isTrusted,e.srcElement=n.srcElement,e.timeStamp=lf.now(),e.type=n.type,e.altKey=n.altKey,e.metaKey=n.metaKey,e.shiftKey=n.shiftKey,e.ctrlKey=n.ctrlKey,e.button=n.button,e.buttons=n.buttons,e.client.x=n.clientX,e.client.y=n.clientY,e.movement.x=n.movementX,e.movement.y=n.movementY,e.page.x=n.pageX,e.page.y=n.pageY,e.screen.x=n.screenX,e.screen.y=n.screenY,e.relatedTarget=null}},{key:"setCursor",value:function(e){this.context.contextService.applyCursorStyle(e||this.context.config.cursor||"default")}},{key:"normalizeToPointerEvent",value:function(e,n){var i=[];if(n.isTouchEvent(e))for(var a=0;a<e.changedTouches.length;a++){var s=e.changedTouches[a];Te(s.button)&&(s.button=0),Te(s.buttons)&&(s.buttons=1),Te(s.isPrimary)&&(s.isPrimary=e.touches.length===1&&e.type==="touchstart"),Te(s.width)&&(s.width=s.radiusX||1),Te(s.height)&&(s.height=s.radiusY||1),Te(s.tiltX)&&(s.tiltX=0),Te(s.tiltY)&&(s.tiltY=0),Te(s.pointerType)&&(s.pointerType="touch"),Te(s.pointerId)&&(s.pointerId=s.identifier||0),Te(s.pressure)&&(s.pressure=s.force||.5),Te(s.twist)&&(s.twist=0),Te(s.tangentialPressure)&&(s.tangentialPressure=0),s.isNormalized=!0,s.type=e.type,i.push(s)}else if(n.isMouseEvent(e)){var o=e;Te(o.isPrimary)&&(o.isPrimary=!0),Te(o.width)&&(o.width=1),Te(o.height)&&(o.height=1),Te(o.tiltX)&&(o.tiltX=0),Te(o.tiltY)&&(o.tiltY=0),Te(o.pointerType)&&(o.pointerType="mouse"),Te(o.pointerId)&&(o.pointerId=aA),Te(o.pressure)&&(o.pressure=.5),Te(o.twist)&&(o.twist=0),Te(o.tangentialPressure)&&(o.tangentialPressure=0),o.isNormalized=!0,i.push(o)}else i.push(e);return i}}])}();hm.tag="Event";var MT=[Dt.CIRCLE,Dt.ELLIPSE,Dt.IMAGE,Dt.RECT,Dt.LINE,Dt.POLYLINE,Dt.POLYGON,Dt.TEXT,Dt.PATH,Dt.HTML],AT=function(){function r(){(0,C.Z)(this,r)}return(0,T.Z)(r,[{key:"isVisible",value:function(e,n){var i,a=n.cullable;if(!a.enable)return!0;var s=n.getRenderBounds();if(yn.isEmpty(s))return!1;var o=e.getFrustum(),l=(i=n.parentNode)===null||i===void 0||(i=i.cullable)===null||i===void 0?void 0:i.visibilityPlaneMask;return a.visibilityPlaneMask=this.computeVisibilityWithPlaneMask(n,s,l||oo.INDETERMINATE,o.planes),a.visible=a.visibilityPlaneMask!==oo.OUTSIDE,a.visible}},{key:"computeVisibilityWithPlaneMask",value:function(e,n,i,a){if(i===oo.OUTSIDE||i===oo.INSIDE)return i;for(var s=oo.INSIDE,o=MT.indexOf(e.nodeName)>-1,l=0,c=a.length;l<c;++l){var u=1<<l;if(i&u&&!(o&&(l===4||l===5))){var h=a[l],d=h.normal,f=h.distance;if(Ve(d,n.getPositiveFarPoint(a[l]))+f<0)return oo.OUTSIDE;Ve(d,n.getNegativeFarPoint(a[l]))+f<0&&(s|=u)}}return s}}])}(),dm=function(){function r(){(0,C.Z)(this,r),this.syncTasks=new Map,this.isFirstTimeRendering=!0,this.syncing=!1,this.isFirstTimeRenderingFinished=!1}return(0,T.Z)(r,[{key:"apply",value:function(e){var n=this,i,a,s=e.config,o=e.renderingService,l=e.renderingContext,c=e.rBushRoot,u=l.root.ownerDocument.defaultView;this.rBush=c;var h=function(b){o.dirtify()},d=function(b){n.syncTasks.set(b.target,b.detail.affectChildren),o.dirtify()},f=function(b){var E=b.target;Vt.enableSizeAttenuation&&Vt.styleValueRegistry.updateSizeAttenuation(E,u.getCamera().getZoom())},v=function(b){var E=b.target,O=E.rBushNode;O!=null&&O.aabb&&n.rBush.remove(O.aabb),n.syncTasks.delete(E),Vt.sceneGraphService.dirtyToRoot(E),o.dirtify()};o.hooks.init.tap(r.tag,function(){u.addEventListener(Fe.MOUNTED,f),u.addEventListener(Fe.UNMOUNTED,v),u.addEventListener(Fe.ATTR_MODIFIED,h),u.addEventListener(Fe.BOUNDS_CHANGED,d)}),o.hooks.destroy.tap(r.tag,function(){u.removeEventListener(Fe.MOUNTED,f),u.removeEventListener(Fe.UNMOUNTED,v),u.removeEventListener(Fe.ATTR_MODIFIED,h),u.removeEventListener(Fe.BOUNDS_CHANGED,d),n.syncTasks.clear()});var g=(i=Vt.globalThis.requestIdleCallback)!==null&&i!==void 0?i:cf.bind(Vt.globalThis),p=((a=s.future)===null||a===void 0?void 0:a.experimentalRICSyncRTree)===!0;o.hooks.endFrame.tap(r.tag,function(){n.isFirstTimeRendering?(n.isFirstTimeRendering=!1,n.syncing=!0,g(function(){n.syncRTree(!0),n.isFirstTimeRenderingFinished=!0})):p&&Vt.globalThis.requestIdleCallback&&Vt.globalThis.cancelIdleCallback?(Vt.globalThis.cancelIdleCallback(n.ricSyncRTreeId),n.ricSyncRTreeId=Vt.globalThis.requestIdleCallback(function(){return n.syncRTree()})):n.syncRTree()})}},{key:"syncNode",value:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(e.isConnected){var i=e.rBushNode;i.aabb&&this.rBush.remove(i.aabb);var a=e.getRenderBounds();if(a){var s=e.renderable;n&&(s.dirtyRenderBounds||(s.dirtyRenderBounds=new yn),s.dirtyRenderBounds.update(a.center,a.halfExtents));var o=a.getMin(),l=(0,G.Z)(o,2),c=l[0],u=l[1],h=a.getMax(),d=(0,G.Z)(h,2),f=d[0],v=d[1];i.aabb||(i.aabb={}),i.aabb.displayObject=e,i.aabb.minX=c,i.aabb.minY=u,i.aabb.maxX=f,i.aabb.maxY=v}if(i.aabb&&!isNaN(i.aabb.maxX)&&!isNaN(i.aabb.maxX)&&!isNaN(i.aabb.minX)&&!isNaN(i.aabb.minY))return i.aabb}}},{key:"syncRTree",value:function(){var e=this,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(!(!n&&(this.syncing||this.syncTasks.size===0))){this.syncing=!0;var i=[],a=new Set,s=function(l){if(!a.has(l)&&l.renderable){var c=e.syncNode(l,n);c&&(i.push(c),a.add(l))}};this.syncTasks.forEach(function(o,l){o&&l.forEach(s);for(var c=l;c;)s(c),c=c.parentElement}),this.rBush.load(i),i.length=0,this.syncing=!1}}}])}();dm.tag="Prepare";function g9(r){return!!r.document}var ci=function(r){return r.READY="ready",r.BEFORE_RENDER="beforerender",r.RERENDER="rerender",r.AFTER_RENDER="afterrender",r.BEFORE_DESTROY="beforedestroy",r.AFTER_DESTROY="afterdestroy",r.RESIZE="resize",r.DIRTY_RECTANGLE="dirtyrectangle",r.RENDERER_CHANGED="rendererchanged",r}({}),fm=500,TT=.1,OT=1e3,Ic=new Jn(Fe.MOUNTED),Bc=new Jn(Fe.UNMOUNTED),mf=new Jn(ci.BEFORE_RENDER),vm=new Jn(ci.RERENDER),yf=new Jn(ci.AFTER_RENDER),bf=function(r){function t(e){var n;(0,C.Z)(this,t),n=I(this,t),n.Element=xn,n.inited=!1,n.context={};var i=e.container,a=e.canvas,s=e.renderer,o=e.width,l=e.height,c=e.background,u=e.cursor,h=e.supportsMutipleCanvasesInOneContainer,d=e.cleanUpOnDestroy,f=d===void 0?!0:d,v=e.offscreenCanvas,g=e.devicePixelRatio,p=e.requestAnimationFrame,y=e.cancelAnimationFrame,b=e.createImage,E=e.supportsTouchEvents,O=e.supportsPointerEvents,k=e.isTouchEvent,P=e.isMouseEvent,F=e.dblClickSpeed,B=o,V=l,U=g||of&&window.devicePixelRatio||1;return U=U>=1?Math.ceil(U):1,a&&(B=o||rA(a)||a.width/U,V=l||iA(a)||a.height/U),n.customElements=new ST,n.devicePixelRatio=U,n.requestAnimationFrame=p!=null?p:cf.bind(Vt.globalThis),n.cancelAnimationFrame=y!=null?y:Qp.bind(Vt.globalThis),n.createImage=b!=null?b:function(){return new window.Image},n.supportsTouchEvents=E!=null?E:"ontouchstart"in Vt.globalThis,n.supportsPointerEvents=O!=null?O:!!Vt.globalThis.PointerEvent,n.isTouchEvent=k!=null?k:function(J){return n.supportsTouchEvents&&J instanceof Vt.globalThis.TouchEvent},n.isMouseEvent=P!=null?P:function(J){return!Vt.globalThis.MouseEvent||J instanceof Vt.globalThis.MouseEvent&&(!n.supportsPointerEvents||!(J instanceof Vt.globalThis.PointerEvent))},v&&(Vt.offscreenCanvas=v),n.document=new cm,n.document.defaultView=n,h||$M(i,n,f),n.initRenderingContext((0,z.Z)((0,z.Z)({},e),{},{width:B,height:V,background:c!=null?c:"transparent",cursor:u!=null?u:"default",cleanUpOnDestroy:f,devicePixelRatio:U,requestAnimationFrame:n.requestAnimationFrame,cancelAnimationFrame:n.cancelAnimationFrame,createImage:n.createImage,supportsTouchEvents:n.supportsTouchEvents,supportsPointerEvents:n.supportsPointerEvents,isTouchEvent:n.isTouchEvent,isMouseEvent:n.isMouseEvent,dblClickSpeed:F!=null?F:200})),n.initDefaultCamera(B,V,s.clipSpaceNearZ),n.initRenderer(s,!0),n}return(0,L.Z)(t,r),(0,T.Z)(t,[{key:"initRenderingContext",value:function(n){this.context.config=n,this.context.renderingContext={root:this.document.documentElement,unculledEntities:[],renderListCurrentFrame:[],renderReasons:new Set,force:!1,dirty:!1}}},{key:"initDefaultCamera",value:function(n,i,a){var s=this,o=new Vt.CameraContribution;o.clipSpaceNearZ=a,o.setType(un.EXPLORING,Gd.DEFAULT).setPosition(n/2,i/2,fm).setFocalPoint(n/2,i/2,0).setOrthographic(n/-2,n/2,i/2,i/-2,TT,OT),o.canvas=this,o.eventEmitter.on(ep.UPDATED,function(){s.context.renderingContext.renderReasons.add(go.CAMERA_CHANGED),Vt.enableSizeAttenuation&&s.getConfig().renderer.getConfig().enableSizeAttenuation&&s.updateSizeAttenuation()}),this.context.camera=o}},{key:"updateSizeAttenuation",value:function(){var n=this.getCamera().getZoom();this.document.documentElement.forEach(function(i){Vt.styleValueRegistry.updateSizeAttenuation(i,n)})}},{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 n=this;return this.readyPromise||(this.readyPromise=new Promise(function(i){n.resolveReadyPromise=function(){i(n)}}),this.inited&&this.resolveReadyPromise()),this.readyPromise}},{key:"destroy",value:function(){var n,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,a=arguments.length>1?arguments[1]:void 0;jn.clearCache();var s=((n=this.getConfig().future)===null||n===void 0?void 0:n.experimentalCancelEventPropagation)===!0;a||this.dispatchEvent(new Jn(ci.BEFORE_DESTROY),s,s),this.frameId&&this.cancelAnimationFrame(this.frameId);var o=this.getRoot();i&&(this.unmountChildren(o),this.document.destroy(),this.getEventService().destroy()),this.getRenderingService().destroy(),this.getContextService().destroy(),this.context.rBushRoot&&this.context.rBushRoot.clear(),a||this.dispatchEvent(new Jn(ci.AFTER_DESTROY),s,s);var l=function(u){u.currentTarget=null,u.manager=null,u.target=null,u.relatedNode=null};l(Ic),l(Bc),l(mf),l(vm),l(yf),l(ia),l(vf),l(gf),l(lm),Vt.textService.clearCache()}},{key:"changeSize",value:function(n,i){this.resize(n,i)}},{key:"resize",value:function(n,i){var a,s=this.context.config;s.width=n,s.height=i,this.getContextService().resize(n,i);var o=this.context.camera,l=o.getProjectionMode();o.setPosition(n/2,i/2,fm).setFocalPoint(n/2,i/2,0),l===Mi.ORTHOGRAPHIC?o.setOrthographic(n/-2,n/2,i/2,i/-2,o.getNear(),o.getFar()):o.setAspect(n/i);var c=((a=s.future)===null||a===void 0?void 0:a.experimentalCancelEventPropagation)===!0;this.dispatchEvent(new Jn(ci.RESIZE,{width:n,height:i}),c,c)}},{key:"appendChild",value:function(n,i){return this.document.documentElement.appendChild(n,i)}},{key:"insertBefore",value:function(n,i){return this.document.documentElement.insertBefore(n,i)}},{key:"removeChild",value:function(n){return this.document.documentElement.removeChild(n)}},{key:"removeChildren",value:function(){this.document.documentElement.removeChildren()}},{key:"destroyChildren",value:function(){this.document.documentElement.destroyChildren()}},{key:"render",value:function(n){var i,a=this;n&&(mf.detail=n,yf.detail=n);var s=((i=this.getConfig().future)===null||i===void 0?void 0:i.experimentalCancelEventPropagation)===!0;this.dispatchEvent(mf,s,s);var o=this.getRenderingService();o.render(this.getConfig(),n,function(){a.dispatchEvent(vm,s,s)}),this.dispatchEvent(yf,s,s)}},{key:"run",value:function(){var n=this,i=function(s,o){n.render(o),n.frameId=n.requestAnimationFrame(i)};i()}},{key:"initRenderer",value:function(n){var i=this,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(!n)throw new Error("Renderer is required.");this.inited=!1,this.readyPromise=void 0,this.context.rBushRoot=new H2,this.context.renderingPlugins=[],this.context.renderingPlugins.push(new hm,new dm,new um([new AT])),this.loadRendererContainerModule(n),this.context.contextService=new this.context.ContextService((0,z.Z)((0,z.Z)({},Vt),this.context)),this.context.renderingService=new zA(Vt,this.context),this.context.eventService=new FA(Vt,this.context),this.context.eventService.init(),this.context.contextService.init?(this.context.contextService.init(),this.initRenderingService(n,a,!0)):this.context.contextService.initAsync().then(function(){i.initRenderingService(n,a)}).catch(function(s){console.error(s)})}},{key:"initRenderingService",value:function(n){var i=this,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;this.context.renderingService.init(function(){var o;i.inited=!0;var l=((o=i.getConfig().future)===null||o===void 0?void 0:o.experimentalCancelEventPropagation)===!0;a?s?i.requestAnimationFrame(function(){i.dispatchEvent(new Jn(ci.READY),l,l)}):i.dispatchEvent(new Jn(ci.READY),l,l):i.dispatchEvent(new Jn(ci.RENDERER_CHANGED),l,l),i.readyPromise&&i.resolveReadyPromise(),a||i.getRoot().forEach(function(c){var u,h;(u=(h=c).dirty)===null||u===void 0||u.call(h,!0,!0)}),i.mountChildren(i.getRoot()),n.getConfig().enableAutoRendering&&i.run()})}},{key:"loadRendererContainerModule",value:function(n){var i=this,a=n.getPlugins();a.forEach(function(s){s.context=i.context,s.init(Vt)})}},{key:"setRenderer",value:function(n){var i=this.getConfig();if(i.renderer!==n){var a=i.renderer;i.renderer=n,this.destroy(!1,!0),(0,N.Z)((a==null?void 0:a.getPlugins())||[]).reverse().forEach(function(s){s.destroy(Vt)}),this.initRenderer(n)}}},{key:"setCursor",value:function(n){var i=this.getConfig();i.cursor=n,this.getContextService().applyCursorStyle(n)}},{key:"unmountChildren",value:function(n){var i=this;if(n.childNodes.forEach(function(o){i.unmountChildren(o)}),this.inited){if(n.isMutationObserved)n.dispatchEvent(Bc);else{var a,s=((a=this.getConfig().future)===null||a===void 0?void 0:a.experimentalCancelEventPropagation)===!0;Bc.target=n,this.dispatchEvent(Bc,!0,s)}n!==this.document.documentElement&&(n.ownerDocument=null),n.isConnected=!1}n.isCustomElement&&n.disconnectedCallback&&n.disconnectedCallback()}},{key:"mountChildren",value:function(n){var i=this,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Cc(n);if(this.inited){if(!n.isConnected&&(n.ownerDocument=this.document,n.isConnected=!0,!a))if(n.isMutationObserved)n.dispatchEvent(Ic);else{var s,o=((s=this.getConfig().future)===null||s===void 0?void 0:s.experimentalCancelEventPropagation)===!0;Ic.target=n,this.dispatchEvent(Ic,!0,o)}}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: ",n.nodeName);n.childNodes.forEach(function(l){i.mountChildren(l,a)}),n.isCustomElement&&n.connectedCallback&&n.connectedCallback()}},{key:"mountFragment",value:function(n){this.mountChildren(n,!1)}},{key:"client2Viewport",value:function(n){return this.getEventService().client2Viewport(n)}},{key:"viewport2Client",value:function(n){return this.getEventService().viewport2Client(n)}},{key:"viewport2Canvas",value:function(n){return this.getEventService().viewport2Canvas(n)}},{key:"canvas2Viewport",value:function(n){return this.getEventService().canvas2Viewport(n)}},{key:"getPointByClient",value:function(n,i){return this.client2Viewport({x:n,y:i})}},{key:"getClientByPoint",value:function(n,i){return this.viewport2Client({x:n,y:i})}}])}(nm);var CT=function(r){function t(){var e;(0,C.Z)(this,t);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return e=I(this,t,[].concat(i)),e.landmarks=[],e}return(0,L.Z)(t,r),(0,T.Z)(t,[{key:"rotate",value:function(n,i,a){if(this.relElevation=uo(i),this.relAzimuth=uo(n),this.relRoll=uo(a),this.elevation+=this.relElevation,this.azimuth+=this.relAzimuth,this.roll+=this.relRoll,this.type===un.EXPLORING){var s=Da(qn(),[1,0,0],cn((this.rotateWorld?1:-1)*this.relElevation)),o=Da(qn(),[0,1,0],cn((this.rotateWorld?1:-1)*this.relAzimuth)),l=Da(qn(),[0,0,1],cn(this.relRoll)),c=Ia(qn(),o,s);c=Ia(qn(),c,l);var u=Xo(oe(),c);Je(this.matrix,this.matrix,[0,0,-this.distance]),Re(this.matrix,this.matrix,u),Je(this.matrix,this.matrix,[0,0,this.distance])}else{if(Math.abs(this.elevation)>90)return this;this.computeMatrix()}return this._getAxes(),this.type===un.ORBITING||this.type===un.EXPLORING?this._getPosition():this.type===un.TRACKING&&this._getFocalPoint(),this._update(),this}},{key:"pan",value:function(n,i){var a=zr(n,i,0),s=kt(this.position);return we(s,s,dt(xt(),this.right,a[0])),we(s,s,dt(xt(),this.up,a[1])),this._setPosition(s),this.triggerUpdate(),this}},{key:"dolly",value:function(n){var i=this.forward,a=kt(this.position),s=n*this.dollyingStep,o=this.distance+n*this.dollyingStep;return s=Math.max(Math.min(o,this.maxDistance),this.minDistance)-this.distance,a[0]+=s*i[0],a[1]+=s*i[1],a[2]+=s*i[2],this._setPosition(a),this.type===un.ORBITING||this.type===un.EXPLORING?this._getDistance():this.type===un.TRACKING&&we(this.focalPoint,a,this.distanceVector),this.triggerUpdate(),this}},{key:"cancelLandmarkAnimation",value:function(){this.landmarkAnimationID!==void 0&&this.canvas.cancelAnimationFrame(this.landmarkAnimationID)}},{key:"createLandmark",value:function(n){var i,a,s,o,l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},c=l.position,u=c===void 0?this.position:c,h=l.focalPoint,d=h===void 0?this.focalPoint:h,f=l.roll,v=l.zoom,g=new Vt.CameraContribution;g.setType(this.type,void 0),g.setPosition(u[0],(i=u[1])!==null&&i!==void 0?i:this.position[1],(a=u[2])!==null&&a!==void 0?a:this.position[2]),g.setFocalPoint(d[0],(s=d[1])!==null&&s!==void 0?s:this.focalPoint[1],(o=d[2])!==null&&o!==void 0?o:this.focalPoint[2]),g.setRoll(f!=null?f:this.roll),g.setZoom(v!=null?v:this.zoom);var p={name:n,matrix:gn(g.getWorldTransform()),right:kt(g.right),up:kt(g.up),forward:kt(g.forward),position:kt(g.getPosition()),focalPoint:kt(g.getFocalPoint()),distanceVector:kt(g.getDistanceVector()),distance:g.getDistance(),dollyingStep:g.getDollyingStep(),azimuth:g.getAzimuth(),elevation:g.getElevation(),roll:g.getRoll(),relAzimuth:g.relAzimuth,relElevation:g.relElevation,relRoll:g.relRoll,zoom:g.getZoom()};return this.landmarks.push(p),p}},{key:"gotoLandmark",value:function(n){var i=this,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=Ue(n)?this.landmarks.find(function(J){return J.name===n}):n;if(s){var o=ie(a)?{duration:a}:a,l=o.easing,c=l===void 0?"linear":l,u=o.duration,h=u===void 0?100:u,d=o.easingFunction,f=d===void 0?void 0:d,v=o.onfinish,g=v===void 0?void 0:v,p=o.onframe,y=p===void 0?void 0:p,b=.01;this.cancelLandmarkAnimation();var E=s.position,O=s.focalPoint,k=s.zoom,P=s.roll,F=f||Vt.EasingFunction(c),B,V=function(){i.setFocalPoint(O),i.setPosition(E),i.setRoll(P),i.setZoom(k),i.computeMatrix(),i.triggerUpdate(),g==null||g()};if(h===0)return V();var U=function($){B===void 0&&(B=$);var at=$-B;if(at>=h){V();return}var ct=F(at/h),ft=xt(),Nt=xt(),Ct=1,gt=0;Ce(ft,i.focalPoint,O,ct),Ce(Nt,i.position,E,ct),gt=i.roll*(1-ct)+P*ct,Ct=i.zoom*(1-ct)+k*ct,i.setFocalPoint(ft),i.setPosition(Nt),i.setRoll(gt),i.setZoom(Ct);var bt=si(ft,O)+si(Nt,E);if(bt<=b&&k===void 0&&P===void 0)return V();i.computeMatrix(),i.triggerUpdate(),at<h&&(y==null||y(ct),i.landmarkAnimationID=i.canvas.requestAnimationFrame(U))};this.canvas.requestAnimationFrame(U)}}}])}(rp);Vt.CameraContribution=CT;var gm=null,p9=0,pm=new WeakMap,m9=null,y9=null,Fc,ma;function b9(r,t){return Fc=new gm(r,t)}function x9(r){return ma||(ma=gm.copy(Fc),ma.oldValue=r,ma)}function E9(){Fc=ma=void 0}function NT(r){return r===ma||r===Fc}function w9(r,t){return r===t?r:ma&&NT(r)?ma:null}function kT(r){r.nodes.forEach(function(t){var e=pm.get(t);e&&e.forEach(function(n){n.observer===r&&n.removeTransientObservers()})})}function S9(r,t){for(var e=r;e;e=e.parentNode){var n=pm.get(e);if(n)for(var i=0;i<n.length;i++){var a=n[i],s=a.options;if(!(e!==r&&!s.subtree)){var o=t(s);o&&a.enqueue(o)}}}}var xf=!1,Ef=null;function M9(r){Ef.push(r),xf||(xf=!0,typeof runtime.globalThis!="undefined"?runtime.globalThis.setTimeout(wf):wf())}function wf(){xf=!1;var r=Ef;Ef=[],r.sort(function(e,n){return e.uid-n.uid});var t=!1;r.forEach(function(e){var n=e.takeRecords();kT(e),n.length&&(e.callback(n,e),t=!0)}),t&&wf()}var Sf=function(r){function t(e,n,i,a){var s;return(0,C.Z)(this,t),s=I(this,t,[e]),s.currentTime=i,s.timelineTime=a,s.target=n,s.type="finish",s.bubbles=!1,s.currentTarget=n,s.defaultPrevented=!1,s.eventPhase=s.AT_TARGET,s.timeStamp=Date.now(),s.currentTime=i,s.timelineTime=a,s}return(0,L.Z)(t,r),(0,T.Z)(t)}(Nc),PT=0,RT=function(){function r(t,e){var n;(0,C.Z)(this,r),this.currentTimePending=!1,this._idle=!0,this._paused=!1,this._finishedFlag=!0,this._currentTime=0,this._playbackRate=1,this._inTimeline=!0,this.effect=t,t.animation=this,this.timeline=e,this.id="".concat(PT++),this._inEffect=!!this.effect.update(0),this._totalDuration=Number((n=this.effect)===null||n===void 0?void 0:n.getComputedTiming().endTime),this._holdTime=0,this._paused=!1,this.oldPlayState="idle",this.updatePromises()}return(0,T.Z)(r,[{key:"pending",get:function(){return this._startTime===null&&!this._paused&&this.playbackRate!==0||this.currentTimePending}},{key:"playState",get:function(){return this._idle?"idle":this._isFinished?"finished":this._paused?"paused":"running"}},{key:"ready",get:function(){var e=this;return this.readyPromise||(this.timeline.animationsWithPromises.indexOf(this)===-1&&this.timeline.animationsWithPromises.push(this),this.readyPromise=new Promise(function(n,i){e.resolveReadyPromise=function(){n(e)},e.rejectReadyPromise=function(){i(new Error)}}),this.pending||this.resolveReadyPromise()),this.readyPromise}},{key:"finished",get:function(){var e=this;return this.finishedPromise||(this.timeline.animationsWithPromises.indexOf(this)===-1&&this.timeline.animationsWithPromises.push(this),this.finishedPromise=new Promise(function(n,i){e.resolveFinishedPromise=function(){n(e)},e.rejectFinishedPromise=function(){i(new Error)}}),this.playState==="finished"&&this.resolveFinishedPromise()),this.finishedPromise}},{key:"currentTime",get:function(){return this.updatePromises(),this._idle||this.currentTimePending?null:this._currentTime},set:function(e){if(e=Number(e),!isNaN(e)){if(this.timeline.restart(),!this._paused&&this._startTime!==null){var n;this._startTime=Number((n=this.timeline)===null||n===void 0?void 0:n.currentTime)-e/this.playbackRate}this.currentTimePending=!1,this._currentTime!==e&&(this._idle&&(this._idle=!1,this._paused=!0),this.tickCurrentTime(e,!0),this.timeline.applyDirtiedAnimation(this))}}},{key:"startTime",get:function(){return this._startTime},set:function(e){if(e!==null){if(this.updatePromises(),e=Number(e),isNaN(e)||this._paused||this._idle)return;this._startTime=e,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(e){if(e!==this._playbackRate){this.updatePromises();var n=this.currentTime;this._playbackRate=e,this.startTime=null,this.playState!=="paused"&&this.playState!=="idle"&&(this._finishedFlag=!1,this._idle=!1,this.ensureAlive(),this.timeline.applyDirtiedAnimation(this)),n!==null&&(this.currentTime=n),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||this.playState==="running"||!this._finishedFlag}},{key:"updatePromises",value:function(){var e;if((e=this.effect.target)!==null&&e!==void 0&&e.destroyed)return this.readyPromise=void 0,this.finishedPromise=void 0,!1;var n=this.oldPlayState,i=this.pending?"pending":this.playState;return this.readyPromise&&i!==n&&(i==="idle"?(this.rejectReadyPromise(),this.readyPromise=void 0):n==="pending"?this.resolveReadyPromise():i==="pending"&&(this.readyPromise=void 0)),this.finishedPromise&&i!==n&&(i==="idle"?(this.rejectFinishedPromise(),this.finishedPromise=void 0):i==="finished"?this.resolveFinishedPromise():n==="finished"&&(this.finishedPromise=void 0)),this.oldPlayState=i,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),this.timeline.animations.indexOf(this)===-1&&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.currentTimePending=!0:this._idle&&(this.rewind(),this._idle=!1),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 e=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 n=new Sf(null,this,this.currentTime,null);setTimeout(function(){e.oncancel(n)})}}},{key:"reverse",value:function(){this.updatePromises();var e=this.currentTime;this.playbackRate*=-1,this.play(),e!==null&&(this.currentTime=e),this.updatePromises()}},{key:"updatePlaybackRate",value:function(e){this.playbackRate=e}},{key:"targetAnimations",value:function(){var e,n=(e=this.effect)===null||e===void 0?void 0:e.target;return n.getAnimations()}},{key:"markTarget",value:function(){var e=this.targetAnimations();e.indexOf(this)===-1&&e.push(this)}},{key:"unmarkTarget",value:function(){var e=this.targetAnimations(),n=e.indexOf(this);n!==-1&&e.splice(n,1)}},{key:"tick",value:function(e,n){!this._idle&&!this._paused&&(this._startTime===null?n&&(this.startTime=e-this._currentTime/this.playbackRate):this._isFinished||this.tickCurrentTime((e-this._startTime)*this.playbackRate)),n&&(this.currentTimePending=!1,this.fireEvents(e))}},{key:"rewind",value:function(){if(this.playbackRate>=0)this.currentTime=0;else if(this._totalDuration<1/0)this.currentTime=this._totalDuration;else throw new Error("Unable to rewind negative playback rate animation with infinite duration")}},{key:"persist",value:function(){throw new Error(ln)}},{key:"addEventListener",value:function(e,n,i){throw new Error(ln)}},{key:"removeEventListener",value:function(e,n,i){throw new Error(ln)}},{key:"dispatchEvent",value:function(e){throw new Error(ln)}},{key:"commitStyles",value:function(){throw new Error(ln)}},{key:"ensureAlive",value:function(){if(this.playbackRate<0&&this.currentTime===0){var e;this._inEffect=!!((e=this.effect)!==null&&e!==void 0&&e.update(-1))}else{var n;this._inEffect=!!((n=this.effect)!==null&&n!==void 0&&n.update(this.currentTime))}!this._inTimeline&&(this._inEffect||!this._finishedFlag)&&(this._inTimeline=!0,this.timeline.animations.push(this))}},{key:"tickCurrentTime",value:function(e,n){e!==this._currentTime&&(this._currentTime=e,this._isFinished&&!n&&(this._currentTime=this._playbackRate>0?this._totalDuration:0),this.ensureAlive())}},{key:"fireEvents",value:function(e){var n=this;if(this._isFinished){if(!this._finishedFlag){if(this.onfinish){var i=new Sf(null,this,this.currentTime,e);setTimeout(function(){n.onfinish&&n.onfinish(i)})}this._finishedFlag=!0}}else{if(this.onframe&&this.playState==="running"){var a=new Sf(null,this,this.currentTime,e);this.onframe(a)}this._finishedFlag=!1}}}])}(),LT=4,_T=.001,DT=1e-7,IT=10,fl=11,zc=1/(fl-1),BT=typeof Float32Array=="function",mm=function(t,e){return 1-3*e+3*t},ym=function(t,e){return 3*e-6*t},bm=function(t){return 3*t},jc=function(t,e,n){return((mm(e,n)*t+ym(e,n))*t+bm(e))*t},xm=function(t,e,n){return 3*mm(e,n)*t*t+2*ym(e,n)*t+bm(e)},FT=function(t,e,n,i,a){var s,o,l=0;do o=e+(n-e)/2,s=jc(o,i,a)-t,s>0?n=o:e=o;while(Math.abs(s)>DT&&++l<IT);return o},zT=function(t,e,n,i){for(var a=0;a<LT;++a){var s=xm(e,n,i);if(s===0)return e;var o=jc(e,n,i)-t;e-=o/s}return e},Mf=function(t,e,n,i){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===i)return function(l){return l};for(var a=BT?new Float32Array(fl):new Array(fl),s=0;s<fl;++s)a[s]=jc(s*zc,t,n);var o=function(c){for(var u=0,h=1,d=fl-1;h!==d&&a[h]<=c;++h)u+=zc;--h;var f=(c-a[h])/(a[h+1]-a[h]),v=u+f*zc,g=xm(v,t,n);return g>=_T?zT(c,v,t,n):g===0?v:FT(c,u,u+zc,t,n)};return function(l){return l===0||l===1?l:jc(o(l),e,i)}},jT=function(t){return t=t.replace(/([A-Z])/g,function(e){return"-".concat(e.toLowerCase())}),t.charAt(0)==="-"?t.substring(1):t},Gc=function(t){return Math.pow(t,2)},Wc=function(t){return Math.pow(t,3)},Zc=function(t){return Math.pow(t,4)},Vc=function(t){return Math.pow(t,5)},Uc=function(t){return Math.pow(t,6)},Yc=function(t){return 1-Math.cos(t*Math.PI/2)},Hc=function(t){return 1-Math.sqrt(1-t*t)},Xc=function(t){return t*t*(3*t-2)},Kc=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((e*3-2)/22-t,2)},Qc=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=(0,G.Z)(e,2),i=n[0],a=i===void 0?1:i,s=n[1],o=s===void 0?.5:s,l=kn(Number(a),1,10),c=kn(Number(o),.1,2);return t===0||t===1?t:-l*Math.pow(2,10*(t-1))*Math.sin((t-1-c/(Math.PI*2)*Math.asin(1/l))*(Math.PI*2)/c)},vl=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>2?arguments[2]:void 0,i=(0,G.Z)(e,4),a=i[0],s=a===void 0?1:a,o=i[1],l=o===void 0?100:o,c=i[2],u=c===void 0?10:c,h=i[3],d=h===void 0?0:h;s=kn(s,.1,1e3),l=kn(l,.1,1e3),u=kn(u,.1,1e3),d=kn(d,.1,1e3);var f=Math.sqrt(l/s),v=u/(2*Math.sqrt(l*s)),g=v<1?f*Math.sqrt(1-v*v):0,p=1,y=v<1?(v*f+-d)/g:-d+f,b=n?n*t/1e3:t;return v<1?b=Math.exp(-b*v*f)*(p*Math.cos(g*b)+y*Math.sin(g*b)):b=(p+y*b)*Math.exp(-b*f),t===0||t===1?t:1-b},Af=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=e,i=(0,G.Z)(n,2),a=i[0],s=a===void 0?10:a,o=i[1],l=o==="start"?Math.ceil:Math.floor;return l(kn(t,0,1)*s)/s},Em=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=(0,G.Z)(e,4),i=n[0],a=n[1],s=n[2],o=n[3];return Mf(i,a,s,o)(t)},qc=Mf(.42,0,1,1),Ti=function(t){return function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0;return 1-t(1-e,n,i)}},Oi=function(t){return function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0;return e<.5?t(e*2,n,i)/2:1-t(e*-2+2,n,i)/2}},Ci=function(t){return function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0;return e<.5?(1-t(1-e*2,n,i))/2:(t(e*2-1,n,i)+1)/2}},wm={steps:Af,"step-start":function(t){return Af(t,[1,"start"])},"step-end":function(t){return Af(t,[1,"end"])},linear:function(t){return t},"cubic-bezier":Em,ease:function(t){return Em(t,[.25,.1,.25,1])},in:qc,out:Ti(qc),"in-out":Oi(qc),"out-in":Ci(qc),"in-quad":Gc,"out-quad":Ti(Gc),"in-out-quad":Oi(Gc),"out-in-quad":Ci(Gc),"in-cubic":Wc,"out-cubic":Ti(Wc),"in-out-cubic":Oi(Wc),"out-in-cubic":Ci(Wc),"in-quart":Zc,"out-quart":Ti(Zc),"in-out-quart":Oi(Zc),"out-in-quart":Ci(Zc),"in-quint":Vc,"out-quint":Ti(Vc),"in-out-quint":Oi(Vc),"out-in-quint":Ci(Vc),"in-expo":Uc,"out-expo":Ti(Uc),"in-out-expo":Oi(Uc),"out-in-expo":Ci(Uc),"in-sine":Yc,"out-sine":Ti(Yc),"in-out-sine":Oi(Yc),"out-in-sine":Ci(Yc),"in-circ":Hc,"out-circ":Ti(Hc),"in-out-circ":Oi(Hc),"out-in-circ":Ci(Hc),"in-back":Xc,"out-back":Ti(Xc),"in-out-back":Oi(Xc),"out-in-back":Ci(Xc),"in-bounce":Kc,"out-bounce":Ti(Kc),"in-out-bounce":Oi(Kc),"out-in-bounce":Ci(Kc),"in-elastic":Qc,"out-elastic":Ti(Qc),"in-out-elastic":Oi(Qc),"out-in-elastic":Ci(Qc),spring:vl,"spring-in":vl,"spring-out":Ti(vl),"spring-in-out":Oi(vl),"spring-out-in":Ci(vl)},GT=function(t){return jT(t).replace(/^ease-/,"").replace(/(\(|\s).+/,"").toLowerCase().trim()},WT=function(t){return wm[GT(t)]||wm.linear},ZT=function(t){return t},VT=1,UT=.5,Sm=0;function Mm(r,t){return function(e){if(e>=1)return 1;var n=1/r;return e+=t*n,e-e%n}}var Jc="\\s*(-?\\d+\\.?\\d*|-?\\.\\d+)\\s*",YT=new RegExp("cubic-bezier\\(".concat(Jc,",").concat(Jc,",").concat(Jc,",").concat(Jc,"\\)")),HT=/steps\(\s*(\d+)\s*\)/,XT=/steps\(\s*(\d+)\s*,\s*(start|middle|end)\s*\)/;function Tf(r){var t=YT.exec(r);if(t)return Mf.apply(void 0,(0,N.Z)(t.slice(1).map(Number)));var e=HT.exec(r);if(e)return Mm(Number(e[1]),Sm);var n=XT.exec(r);return n?Mm(Number(n[1]),{start:VT,middle:UT,end:Sm}[n[2]]):WT(r)}function KT(r){return Math.abs(QT(r)/(r.playbackRate||1))}function QT(r){var t;return r.duration===0||r.iterations===0?0:(r.duration==="auto"?0:Number(r.duration))*((t=r.iterations)!==null&&t!==void 0?t:1)}var Am=0,Of=1,$c=2,Tm=3;function qT(r,t,e){if(t===null)return Am;var n=e.endTime;return t<Math.min(e.delay,n)?Of:t>=Math.min(e.delay+r+e.endDelay,n)?$c:Tm}function JT(r,t,e,n,i){switch(n){case Of:return t==="backwards"||t==="both"?0:null;case Tm:return e-i;case $c:return t==="forwards"||t==="both"?r:null;case Am:return null}}function $T(r,t,e,n,i){var a=i;return r===0?t!==Of&&(a+=e):a+=n/r,a}function tO(r,t,e,n,i,a){var s=r===1/0?t%1:r%1;return s===0&&e===$c&&n!==0&&(i!==0||a===0)&&(s=1),s}function eO(r,t,e,n){return r===$c&&t===1/0?1/0:e===1?Math.floor(n)-1:Math.floor(n)}function nO(r,t,e){var n=r;if(r!=="normal"&&r!=="reverse"){var i=t;r==="alternate-reverse"&&(i+=1),n="normal",i!==1/0&&i%2!==0&&(n="reverse")}return n==="normal"?e:1-e}function rO(r,t,e){var n=qT(r,t,e),i=JT(r,e.fill,t,n,e.delay);if(i===null)return null;var a=e.duration==="auto"?0:e.duration,s=$T(a,n,e.iterations,i,e.iterationStart),o=tO(s,e.iterationStart,n,e.iterations,i,a),l=eO(n,e.iterations,o,s),c=nO(e.direction,l,o);return e.currentIteration=l,e.progress=c,e.easingFunction(c)}function iO(r,t,e){var n=aO(r,t),i=sO(n,e);return function(a,s){if(s!==null)i.filter(function(l){return s>=l.applyFrom&&s<l.applyTo}).forEach(function(l){var c=s-l.startOffset,u=l.endOffset-l.startOffset,h=u===0?0:c/u;a.setAttribute(l.property,l.interpolation(h),!1,!1)});else for(var o in n)Om(o)&&a.setAttribute(o,null)}}function Om(r){return r!=="offset"&&r!=="easing"&&r!=="composite"&&r!=="computedOffset"}function aO(r,t){for(var e={},n=0;n<r.length;n++)for(var i in r[n])if(Om(i)){var a={offset:r[n].offset,computedOffset:r[n].computedOffset,easing:r[n].easing,easingFunction:Tf(r[n].easing)||t.easingFunction,value:r[n][i]};e[i]=e[i]||[],e[i].push(a)}return e}function sO(r,t){var e=[];for(var n in r)for(var i=r[n],a=0;a<i.length-1;a++){var s=a,o=a+1,l=i[s].computedOffset,c=i[o].computedOffset,u=l,h=c;a===0&&(u=-1/0,c===0&&(o=s)),a===i.length-2&&(h=1/0,l===1&&(s=o)),e.push({applyFrom:u,applyTo:h,startOffset:i[s].computedOffset,endOffset:i[o].computedOffset,easingFunction:i[s].easingFunction,property:n,interpolation:oO(n,i[s].value,i[o].value,t)})}return e.sort(function(d,f){return d.startOffset-f.startOffset}),e}var Cm=function(t,e,n){return function(i){var a=Nm(t,e,i);return ie(a)?a:n(a)}};function oO(r,t,e,n){var i=jp[r];if(i&&i.syntax&&i.int){var a=Vt.styleValueRegistry.getPropertySyntax(i.syntax);if(a){var s=a.parser,o=s?s(t,n):t,l=s?s(e,n):e,c=a.mixer(o,l,n);if(c){var u=Cm.apply(void 0,(0,N.Z)(c));return function(h){return h===0?t:h===1?e:u(h)}}}}return Cm(!1,!0,function(h){return h?e:t})}function Nm(r,t,e){if(typeof r=="number"&&typeof t=="number")return r*(1-e)+t*e;if(typeof r=="boolean"&&typeof t=="boolean"||typeof r=="string"&&typeof t=="string")return e<.5?r:t;if(Array.isArray(r)&&Array.isArray(t)){for(var n=r.length,i=t.length,a=Math.max(n,i),s=[],o=0;o<a;o++)s.push(Nm(r[o<n?o:n-1],t[o<i?o:i-1],e));return s}throw new Error("Mismatched interpolation arguments ".concat(r,":").concat(t))}var lO=function(){function r(){(0,C.Z)(this,r),this.delay=0,this.direction="normal",this.duration="auto",this._easing="linear",this.easingFunction=ZT,this.endDelay=0,this.fill="auto",this.iterationStart=0,this.iterations=1,this.currentIteration=null,this.progress=null}return(0,T.Z)(r,[{key:"easing",get:function(){return this._easing},set:function(e){this.easingFunction=Tf(e),this._easing=e}}])}();function cO(r){var t=[];for(var e in r)if(!(e in["easing","offset","composite"])){var n=r[e];Array.isArray(n)||(n=[n]);for(var i=n.length,a=0;a<i;a++){if(!t[a]){var s={};"offset"in r&&(s.offset=Number(r.offset)),"easing"in r&&(s.easing=r.easing),"composite"in r&&(s.composite=r.composite),t[a]=s}n[a]!==void 0&&n[a]!==null&&(t[a][e]=n[a])}}return t.sort(function(o,l){return(o.computedOffset||0)-(l.computedOffset||0)}),t}function km(r,t){if(r===null)return[];Array.isArray(r)||(r=cO(r));for(var e=r.map(function(l){var c={};t!=null&&t.composite&&(c.composite="auto");for(var u in l){var h=l[u];if(u==="offset"){if(h!==null){if(h=Number(h),!isFinite(h))throw new Error("Keyframe offsets must be numbers.");if(h<0||h>1)throw new Error("Keyframe offsets must be between 0 and 1.");c.computedOffset=h}}else if(u==="composite"&&["replace","add","accumulate","auto"].indexOf(h)===-1)throw new Error("".concat(h," compositing is not supported"));c[u]=h}return c.offset===void 0&&(c.offset=null),c.easing===void 0&&(c.easing=(t==null?void 0:t.easing)||"linear"),c.composite===void 0&&(c.composite="auto"),c}),n=!0,i=-1/0,a=0;a<e.length;a++){var s=e[a].offset;if(be(s))n=!1;else{if(s<i)throw new TypeError("Keyframes are not loosely sorted by offset. Sort or specify offsets.");i=s}}e=e.filter(function(l){return Number(l.offset)>=0&&Number(l.offset)<=1});function o(){var l,c=e,u=c.length;if(e[u-1].computedOffset=Number((l=e[u-1].offset)!==null&&l!==void 0?l:1),u>1){var h;e[0].computedOffset=Number((h=e[0].offset)!==null&&h!==void 0?h:0)}for(var d=0,f=Number(e[0].computedOffset),v=1;v<u;v++){var g=e[v].computedOffset;if(!be(g)&&!be(f)){for(var p=1;p<v-d;p++)e[d+p].computedOffset=f+(Number(g)-f)*p/(v-d);d=v,f=Number(g)}}}return n||o(),e}var uO="backwards|forwards|both|none".split("|"),hO="reverse|alternate|alternate-reverse".split("|");function dO(r,t){var e=new lO;return t&&(e.fill="both",e.duration="auto"),typeof r=="number"&&!isNaN(r)?e.duration=r:r!==void 0&&Object.keys(r).forEach(function(n){if(r[n]!==void 0&&r[n]!==null&&r[n]!=="auto"){if((typeof e[n]=="number"||n==="duration")&&(typeof r[n]!="number"||isNaN(r[n]))||n==="fill"&&uO.indexOf(r[n])===-1||n==="direction"&&hO.indexOf(r[n])===-1)return;e[n]=r[n]}}),e}function fO(r,t){return r=vO(r!=null?r:{duration:"auto"}),dO(r,t)}function vO(r){return typeof r=="number"&&(isNaN(r)?r={duration:"auto"}:r={duration:r}),r}var gO=function(){function r(t,e,n){var i=this;(0,C.Z)(this,r),this.composite="replace",this.iterationComposite="replace",this.target=t,this.timing=fO(n,!1),this.timing.effect=this,this.timing.activeDuration=KT(this.timing),this.timing.endTime=Math.max(0,this.timing.delay+this.timing.activeDuration+this.timing.endDelay),this.normalizedKeyframes=km(e,this.timing),this.interpolations=iO(this.normalizedKeyframes,this.timing,this.target);var a=Vt.globalThis.Proxy;this.computedTiming=a?new a(this.timing,{get:function(o,l){return l==="duration"?o.duration==="auto"?0:o.duration:l==="fill"?o.fill==="auto"?"none":o.fill:l==="localTime"?i.animation&&i.animation.currentTime||null:l==="currentIteration"?!i.animation||i.animation.playState!=="running"?null:o.currentIteration||0:l==="progress"?!i.animation||i.animation.playState!=="running"?null:o.progress||0:o[l]},set:function(){return!0}}):this.timing}return(0,T.Z)(r,[{key:"applyInterpolations",value:function(){this.interpolations(this.target,Number(this.timeFraction))}},{key:"update",value:function(e){return e===null?!1:(this.timeFraction=rO(this.timing.activeDuration,e,this.timing),this.timeFraction!==null)}},{key:"getKeyframes",value:function(){return this.normalizedKeyframes}},{key:"setKeyframes",value:function(e){this.normalizedKeyframes=km(e)}},{key:"getComputedTiming",value:function(){return this.computedTiming}},{key:"getTiming",value:function(){return this.timing}},{key:"updateTiming",value:function(e){var n=this;Object.keys(e||{}).forEach(function(i){n.timing[i]=e[i]})}}])}();function Pm(r,t){return Number(r.id)-Number(t.id)}var pO=function(){function r(t){var e=this;(0,C.Z)(this,r),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(n){e.currentTime=n,e.discardAnimations(),e.animations.length===0?e.timelineTicking=!1:e.requestAnimationFrame(e.webAnimationsNextTick)},this.processRafCallbacks=function(n){var i=e.rafCallbacks;e.rafCallbacks=[],n<Number(e.currentTime)&&(n=Number(e.currentTime)),e.animations.sort(Pm),e.animations=e.tick(n,!0,e.animations)[0],i.forEach(function(a){a[1](n)}),e.applyPendingEffects()},this.document=t}return(0,T.Z)(r,[{key:"getAnimations",value:function(){return this.discardAnimations(),this.animations.slice()}},{key:"isTicking",value:function(){return this.inTick}},{key:"play",value:function(e,n,i){var a=new gO(e,n,i),s=new RT(a,this);return this.animations.push(s),this.restartWebAnimationsNextTick(),s.updatePromises(),s.play(),s.updatePromises(),s}},{key:"applyDirtiedAnimation",value:function(e){var n=this;if(!this.inTick){e.markTarget();var i=e.targetAnimations();i.sort(Pm);var a=this.tick(Number(this.currentTime),!1,i.slice())[1];a.forEach(function(s){var o=n.animations.indexOf(s);o!==-1&&n.animations.splice(o,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(e){e==null||e.applyInterpolations()}),this.pendingEffects=[]}},{key:"updateAnimationsPromises",value:function(){this.animationsWithPromises=this.animationsWithPromises.filter(function(e){return e.updatePromises()})}},{key:"discardAnimations",value:function(){this.updateAnimationsPromises(),this.animations=this.animations.filter(function(e){return e.playState!=="finished"&&e.playState!=="idle"})}},{key:"restartWebAnimationsNextTick",value:function(){this.timelineTicking||(this.timelineTicking=!0,this.requestAnimationFrame(this.webAnimationsNextTick))}},{key:"rAF",value:function(e){var n=this.rafId++;return this.rafCallbacks.length===0&&(this.frameId=this.document.defaultView.requestAnimationFrame(this.processRafCallbacks)),this.rafCallbacks.push([n,e]),n}},{key:"requestAnimationFrame",value:function(e){var n=this;return this.rAF(function(i){n.updateAnimationsPromises(),e(i),n.updateAnimationsPromises()})}},{key:"tick",value:function(e,n,i){var a=this,s,o;this.inTick=!0,this.hasRestartedThisFrame=!1,this.currentTime=e,this.ticking=!1;var l=[],c=[],u=[],h=[];return i.forEach(function(d){d.tick(e,n),d._inEffect?(c.push(d.effect),d.markTarget()):(l.push(d.effect),d.unmarkTarget()),d._needsTick&&(a.ticking=!0);var f=d._inEffect||d._needsTick;d._inTimeline=f,f?u.push(d):h.push(d)}),(s=this.pendingEffects).push.apply(s,l),(o=this.pendingEffects).push.apply(o,c),this.ticking&&this.requestAnimationFrame(function(){}),this.inTick=!1,[u,h]}}])}();Vt.EasingFunction=Tf,Vt.AnimationTimeline=pO;var Rm=function(r){return be(r)?"":r.toString()},mO=function(r){var t=Rm(r);return t.charAt(0).toUpperCase()+t.substring(1)},tu=mO,yO=function(r){return typeof r=="object"&&r!==null},Cf=yO,bO=function(r){return r!==null&&typeof r!="function"&&isFinite(r.length)},gl=bO,Nf=function(r,t){if(r===t)return!0;if(!r||!t||Ue(r)||Ue(t))return!1;if(gl(r)||gl(t)){if(r.length!==t.length)return!1;for(var e=!0,n=0;n<r.length&&(e=Nf(r[n],t[n]),!!e);n++);return e}if(Cf(r)||Cf(t)){var i=Object.keys(r),a=Object.keys(t);if(i.length!==a.length)return!1;for(var e=!0,n=0;n<i.length&&(e=Nf(r[i[n]],t[i[n]]),!!e);n++);return e}return!1},Wn=Nf;const xO={duration:500},EO={duration:1e3,easing:"cubic-bezier(0.250, 0.460, 0.450, 0.940)",iterations:1,fill:"both"},A9={CHANGE:"change"};var An;(function(r){r.NodeAdded="NodeAdded",r.NodeUpdated="NodeUpdated",r.NodeRemoved="NodeRemoved",r.EdgeAdded="EdgeAdded",r.EdgeUpdated="EdgeUpdated",r.EdgeRemoved="EdgeRemoved",r.ComboAdded="ComboAdded",r.ComboUpdated="ComboUpdated",r.ComboRemoved="ComboRemoved"})(An||(An={}));var ti;(function(r){r.DRAW="draw",r.COLLAPSE="collapse",r.EXPAND="expand",r.TRANSFORM="transform"})(ti||(ti={}));var ya;(function(r){r.CLICK="canvas:click",r.DBLCLICK="canvas:dblclick",r.POINTER_OVER="canvas:pointerover",r.POINTER_LEAVE="canvas:pointerleave",r.POINTER_ENTER="canvas:pointerenter",r.POINTER_MOVE="canvas:pointermove",r.POINTER_OUT="canvas:pointerout",r.POINTER_DOWN="canvas:pointerdown",r.POINTER_UP="canvas:pointerup",r.CONTEXT_MENU="canvas:contextmenu",r.DRAG_START="canvas:dragstart",r.DRAG="canvas:drag",r.DRAG_END="canvas:dragend",r.DRAG_ENTER="canvas:dragenter",r.DRAG_OVER="canvas:dragover",r.DRAG_LEAVE="canvas:dragleave",r.DROP="canvas:drop",r.WHEEL="canvas:wheel"})(ya||(ya={}));var ks;(function(r){r.CLICK="combo:click",r.DBLCLICK="combo:dblclick",r.POINTER_OVER="combo:pointerover",r.POINTER_LEAVE="combo:pointerleave",r.POINTER_ENTER="combo:pointerenter",r.POINTER_MOVE="combo:pointermove",r.POINTER_OUT="combo:pointerout",r.POINTER_DOWN="combo:pointerdown",r.POINTER_UP="combo:pointerup",r.CONTEXT_MENU="combo:contextmenu",r.DRAG_START="combo:dragstart",r.DRAG="combo:drag",r.DRAG_END="combo:dragend",r.DRAG_ENTER="combo:dragenter",r.DRAG_OVER="combo:dragover",r.DRAG_LEAVE="combo:dragleave",r.DROP="combo:drop"})(ks||(ks={}));var It;(function(r){r.CLICK="click",r.DBLCLICK="dblclick",r.POINTER_OVER="pointerover",r.POINTER_LEAVE="pointerleave",r.POINTER_ENTER="pointerenter",r.POINTER_MOVE="pointermove",r.POINTER_OUT="pointerout",r.POINTER_DOWN="pointerdown",r.POINTER_UP="pointerup",r.CONTEXT_MENU="contextmenu",r.DRAG_START="dragstart",r.DRAG="drag",r.DRAG_END="dragend",r.DRAG_ENTER="dragenter",r.DRAG_OVER="dragover",r.DRAG_LEAVE="dragleave",r.DROP="drop",r.KEY_DOWN="keydown",r.KEY_UP="keyup",r.WHEEL="wheel",r.PINCH="pinch"})(It||(It={}));var po;(function(r){r.KEY_DOWN="keydown",r.KEY_UP="keyup"})(po||(po={}));var eu;(function(r){r.CLICK="edge:click",r.DBLCLICK="edge:dblclick",r.POINTER_OVER="edge:pointerover",r.POINTER_LEAVE="edge:pointerleave",r.POINTER_ENTER="edge:pointerenter",r.POINTER_MOVE="edge:pointermove",r.POINTER_OUT="edge:pointerout",r.POINTER_DOWN="edge:pointerdown",r.POINTER_UP="edge:pointerup",r.CONTEXT_MENU="edge:contextmenu",r.DRAG_ENTER="edge:dragenter",r.DRAG_OVER="edge:dragover",r.DRAG_LEAVE="edge:dragleave",r.DROP="edge:drop"})(eu||(eu={}));var Xt;(function(r){r.BEFORE_CANVAS_INIT="beforecanvasinit",r.AFTER_CANVAS_INIT="aftercanvasinit",r.BEFORE_SIZE_CHANGE="beforesizechange",r.AFTER_SIZE_CHANGE="aftersizechange",r.BEFORE_ELEMENT_CREATE="beforeelementcreate",r.AFTER_ELEMENT_CREATE="afterelementcreate",r.BEFORE_ELEMENT_UPDATE="beforeelementupdate",r.AFTER_ELEMENT_UPDATE="afterelementupdate",r.BEFORE_ELEMENT_DESTROY="beforeelementdestroy",r.AFTER_ELEMENT_DESTROY="afterelementdestroy",r.BEFORE_ELEMENT_TRANSLATE="beforeelementtranslate",r.AFTER_ELEMENT_TRANSLATE="afterelementtranslate",r.BEFORE_DRAW="beforedraw",r.AFTER_DRAW="afterdraw",r.BEFORE_RENDER="beforerender",r.AFTER_RENDER="afterrender",r.BEFORE_ANIMATE="beforeanimate",r.AFTER_ANIMATE="afteranimate",r.BEFORE_LAYOUT="beforelayout",r.AFTER_LAYOUT="afterlayout",r.BEFORE_STAGE_LAYOUT="beforestagelayout",r.AFTER_STAGE_LAYOUT="afterstagelayout",r.BEFORE_TRANSFORM="beforetransform",r.AFTER_TRANSFORM="aftertransform",r.BATCH_START="batchstart",r.BATCH_END="batchend",r.BEFORE_DESTROY="beforedestroy",r.AFTER_DESTROY="afterdestroy",r.BEFORE_RENDERER_CHANGE="beforerendererchange",r.AFTER_RENDERER_CHANGE="afterrendererchange"})(Xt||(Xt={}));var Ga;(function(r){r.UNDO="undo",r.REDO="redo",r.CANCEL="cancel",r.ADD="add",r.CLEAR="clear",r.CHANGE="change"})(Ga||(Ga={}));var Ni;(function(r){r.CLICK="node:click",r.DBLCLICK="node:dblclick",r.POINTER_OVER="node:pointerover",r.POINTER_LEAVE="node:pointerleave",r.POINTER_ENTER="node:pointerenter",r.POINTER_MOVE="node:pointermove",r.POINTER_OUT="node:pointerout",r.POINTER_DOWN="node:pointerdown",r.POINTER_UP="node:pointerup",r.CONTEXT_MENU="node:contextmenu",r.DRAG_START="node:dragstart",r.DRAG="node:drag",r.DRAG_END="node:dragend",r.DRAG_ENTER="node:dragenter",r.DRAG_OVER="node:dragover",r.DRAG_LEAVE="node:dragleave",r.DROP="node:drop"})(Ni||(Ni={}));const fn="combo",ui="tree";var pl;(function(r){r.NODE="node",r.EDGE="edge",r.COMBO="combo",r.THEME="theme",r.PALETTE="palette",r.LAYOUT="layout",r.BEHAVIOR="behavior",r.PLUGIN="plugin",r.ANIMATION="animation",r.TRANSFORM="transform",r.SHAPE="shape"})(pl||(pl={}));const kf={animation:{},behavior:{},combo:{},edge:{},layout:{},node:{},palette:{},theme:{},plugin:{},transform:{},shape:{}};function ba(r,t){var e;const n=(e=kf[r])===null||e===void 0?void 0:e[t];if(n)return n}function T9(r){return EXTENSION_REGISTRY[r]}const wO="5.0.50",SO="G6";function xa(r){return`[${SO} v${wO}] ${r}`}const ei={mute:!1,debug:r=>{!ei.mute&&console.debug(xa(r))},info:r=>{!ei.mute&&console.info(xa(r))},warn:r=>{!ei.mute&&console.warn(xa(r))},error:r=>{!ei.mute&&console.error(xa(r))}};function Lm(r){const{theme:t}=r;if(!t)return{};const e=ba(pl.THEME,t);return e||(ei.warn(`The theme of ${t} is not registered.`),{})}function Pf(r,t){if(Array.isArray(r)&&r.length===0)return null;const e=Array.isArray(r)?r[0]:r,n=Array.isArray(r)?r.slice(1):t||[];return new Proxy(e,{get(i,a){return typeof i[a]=="function"&&!["onframe","onfinish"].includes(a)?(...s)=>{i[a](...s),n.forEach(o=>{var l;return(l=o[a])===null||l===void 0?void 0:l.call(o,...s)})}:a==="finished"?Promise.all([e.finished,...n.map(s=>s.finished)]):Reflect.get(i,a)},set(i,a,s){return["onframe","onfinish"].includes(a)||n.forEach(o=>{o[a]=s}),Reflect.set(i,a,s)}})}function Rf(r){const t=r.reduce((n,i)=>(Object.entries(i).forEach(([a,s])=>{n[a]===void 0?n[a]=[s]:n[a].push(s)}),n),{});Object.entries(t).forEach(([n,i])=>{(i.length!==r.length||i.some(a=>be(a))||i.every(a=>!["sourceNode","targetNode","childrenNode"].includes(n)&&Wn(a,i[0])))&&delete t[n]});const e=Object.entries(t).reduce((n,[i,a])=>(a.forEach((s,o)=>{n[o]?n[o][i]=s:n[o]={[i]:s}}),n),[]);return r.length!==0&&e.length===0&&e.push({_:0},{_:0}),e}function ml(r){switch(r){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 _m(r,t){const{animation:e}=r;if(e===!1||t===!1)return!1;const n=Object.assign({},xO);return zn(e)&&Object.assign(n,e),zn(t)&&Object.assign(n,t),n}function MO(r){if(typeof r=="string"){const t=ba(pl.ANIMATION,r);return t||(ei.warn(`The animation of ${r} is not registered.`),[])}return r}function AO(r,t,e,n){var i,a;const{animation:s}=r;if(s===!1||n===!1)return[];const o=(i=r==null?void 0:r[t])===null||i===void 0?void 0:i.animation;if(o===!1)return[];const l=o==null?void 0:o[e];if(l===!1)return[];const c=(a=Lm(r)[t])===null||a===void 0?void 0:a.animation,u=(d=[])=>MO(d).map(f=>Object.assign(Object.assign(Object.assign(Object.assign({},EO),zn(s)&&s),f),zn(n)&&n));if(l)return u(l);if(!c)return[];const h=c[e];return h===!1?[]:u(h)}function Dm(r,t,e,n=[]){if(!n&&r===0&&t===0&&e===0)return null;if(Array.isArray(n)){let a=-1;const s=[];for(let o=0;o<n.length;o++){const l=n[o];if(l[0]==="translate"){if(l[1]===r&&l[2]===t)return null;a=o,s.push(["translate",r,t])}else if(l[0]==="translate3d"){if(l[1]===r&&l[2]===t&&l[3]===e)return null;a=o,s.push(["translate3d",r,t,e!=null?e:0])}else s.push(l)}return a===-1&&s.splice(0,0,ie(e)?["translate3d",r,t,e!=null?e:0]:["translate",r,t]),s.length===0?null:s}const i=n?n.replace(/translate(3d)?\([^)]*\)/g,""):"";return e===0?`translate(${r}, ${t})${i}`:`translate3d(${r}, ${t}, ${e})${i}`}var TO=function(r,t){var e={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&t.indexOf(n)<0&&(e[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(e[n[i]]=r[n[i]]);return e};const OO=(r,t,e)=>{if(!e.length)return null;const[n,i]=t,a=c=>{var u;if(c){const h=r.getShape(c);if(!h)return null;const d=`get${tu(c)}Style`,f=((u=r==null?void 0:r[d])===null||u===void 0?void 0:u.bind(r))||(p=>p),v=(f==null?void 0:f(n))||{},g=(f==null?void 0:f(i))||{};return{shape:h,fromStyle:v,toStyle:g}}else return{shape:r,fromStyle:n,toStyle:i}};let s;const o=e.map(c=>{var{fields:u,shape:h,states:d}=c,f=TO(c,["fields","shape","states"]);const v=a(h);if(!v)return null;const{shape:g,fromStyle:p,toStyle:y}=v,b=[{},{}];if(u.forEach(O=>{var k,P;Object.assign(b[0],{[O]:(k=p[O])!==null&&k!==void 0?k:ml(O)}),Object.assign(b[1],{[O]:(P=y[O])!==null&&P!==void 0?P:ml(O)})}),b.some(O=>Object.keys(O).some(k=>["x","y","z"].includes(k)))){const{x:O=0,y:k=0,z:P,transform:F=""}=g.attributes||{};b.forEach(B=>{var V,U,J;B.transform=Dm((V=B.x)!==null&&V!==void 0?V:O,(U=B.y)!==null&&U!==void 0?U:k,(J=B.z)!==null&&J!==void 0?J:P,F)})}const E=g.animate(Rf(b),f);return h===void 0&&(s=E),E}).filter(Boolean),l=s||(o==null?void 0:o[0]);return l?Pf(l,o.filter(c=>c!==c)):null},CO=[{fields:["opacity"]}],NO=[{fields:["x","y"]}],Im=[{fields:["x","y"]}],kO=Im,Bm=[{fields:["sourceNode","targetNode"]}],PO=Bm,Fm=[{fields:["childrenNode","x","y"]}],RO=Fm,O9=[{fields:["childrenNode","x","y"]}];var LO=Object.prototype.hasOwnProperty;function _O(r,t){if(!t||!Kr(r))return{};for(var e={},n=ue(t)?t:function(o){return o[t]},i,a=0;a<r.length;a++){var s=r[a];i=n(s),LO.call(e,i)?e[i].push(s):e[i]=[s]}return e}var nu=_O,zm=function(r,t,e){var n,i,a,s,o=0;e||(e={});var l=function(){o=e.leading===!1?0:Date.now(),n=null,s=r.apply(i,a),n||(i=a=null)},c=function(){var u=Date.now();!o&&e.leading===!1&&(o=u);var h=t-(u-o);return i=this,a=arguments,h<=0||h>t?(n&&(clearTimeout(n),n=null),o=u,s=r.apply(i,a),n||(i=a=null)):!n&&e.trailing!==!1&&(n=setTimeout(l,h)),s};return c.cancel=function(){clearTimeout(n),o=0,n=i=a=null},c},Lf=function(r){if(typeof r!="object"||r===null)return r;var t;if(Kr(r)){t=[];for(var e=0,n=r.length;e<n;e++)typeof r[e]=="object"&&r[e]!=null?t[e]=Lf(r[e]):t[e]=r[e]}else{t={};for(var i in r)typeof r[i]=="object"&&r[i]!=null?t[i]=Lf(r[i]):t[i]=r[i]}return t},mo=Lf;function DO(r){return"source"in r&&"target"in r}function IO(r){return r.length===2}function C9(r){return r.length===3}function yo(r){return r instanceof Float32Array?!0:Array.isArray(r)&&(r.length===2||r.length===3)?r.every(t=>typeof t=="number"):!1}function sa(r,t,e){return r>=t&&r<=e}function hi(r=0){if(Array.isArray(r)){const[t=0,e=t,n=t,i=e]=r;return[t,e,n,i]}return[r,r,r,r]}function BO(r=0){const t=hi(r);return t[0]+t[2]}function N9(r=0){const t=hi(r);return t[1]+t[3]}function oa(r){return r.max[0]-r.min[0]}function la(r){return r.max[1]-r.min[1]}function Wa(r){return[oa(r),la(r)]}function Za(r,t){const e=yo(r)?_f(r):r.getShape("key").getBounds();return t?Va(e,t):e}function _f(r){const[t,e,n=0]=r,i=new yn;return i.setMinMax([t,e,n],[t,e,n]),i}function Va(r,t){const[e,n,i,a]=hi(t),[s,o,l]=r.min,[c,u,h]=r.max,d=new yn;return d.setMinMax([s-a,o-e,l],[c+n,u+i,h]),d}function yl(r){if(r.length===0)return new yn;if(r.length===1)return r[0];const t=new yn;t.setMinMax(r[0].min,r[0].max);for(let e=1;e<r.length;e++){const n=r[e];t.setMinMax([Math.min(t.min[0],n.min[0]),Math.min(t.min[1],n.min[1]),Math.min(t.min[2],n.min[2])],[Math.max(t.max[0],n.max[0]),Math.max(t.max[1],n.max[1]),Math.max(t.max[2],n.max[2])])}return t}function FO(r,t){const[e,n]=r.min,[i,a]=r.max,[s,o]=t.min,[l,c]=t.max;return e>=s&&i<=l&&n>=o&&a<=c}function ji(r,t){return sa(r[0],t.min[0],t.max[0])&&sa(r[1],t.min[1],t.max[1])}function jm(r,t,e=!1){const{min:[n,i],max:[a,s]}=t,o=(r[1]===i||r[1]===s)&&(e||sa(r[0],n,a)),l=(r[0]===n||r[0]===a)&&(e||sa(r[1],i,s));return o||l}function zO(r,t){return!ji(r,t)}function ru(r,t){const{center:e}=t;return r[0]===e[0]&&r[1]===e[1]}function bl(r,t){const[e,n]=r,[i,a]=t.min,[s,o]=t.max,l=e-i,c=s-e,u=n-a,h=o-n,d=Math.min(l,c,u,h);return d===l?"left":d===c?"right":d===u?"top":d===h?"bottom":"left"}function Ps(r,t){const e=mo(r);if(ji(r,t))switch(bl(r,t)){case"left":e[0]=t.min[0];break;case"right":e[0]=t.max[0];break;case"top":e[1]=t.min[1];break;case"bottom":e[1]=t.max[1];break}else{const[n,i]=r,[a,s]=t.min,[o,l]=t.max;e[0]=sa(n,a,o)?n:n<a?a:o,e[1]=sa(i,s,l)?i:i<s?s:l}return e}function jO(r,t){const{center:e}=r,[n,i]=Wa(r),a=t==="up"||t==="down"?e[0]:t==="right"?e[0]-n/6:e[0]+n/6,s=t==="left"||t==="right"?e[1]:t==="down"?e[1]-i/6:e[1]+i/6;return[a,s]}function GO(r,t){let[e,n]=Wa(r);return[e,n]=t==="up"||t==="down"?[e,n]:[n,e],(Math.pow(n,2)-Math.pow(Math.sqrt(Math.pow(e/2,2)+Math.pow(n,2))-e/2,2))/(2*n)}function WO(r){const{min:[t,e],max:[n,i]}=r,a=[t,i],s=[n,i],o=[n,e],l=[t,e];return[[a,s],[s,o],[o,l],[l,a]]}var ZO=function(t,e){var n=t.nodes,i=t.edges,a=[],s={};if(!n)throw new Error("invalid nodes data!");return n&&n.forEach(function(o,l){s[o.id]=l;var c=[];a.push(c)}),i&&i.forEach(function(o){var l=o.source,c=o.target,u=s[l],h=s[c];!u&&u!==0||!h&&h!==0||(a[u][h]=1,e||(a[h][u]=1))}),a},iu=ZO,VO=function(t,e){return t===e},Gm=function(){function r(t,e){e===void 0&&(e=null),this.value=t,this.next=e}return r.prototype.toString=function(t){return t?t(this.value):"".concat(this.value)},r}(),UO=function(){function r(t){t===void 0&&(t=VO),this.head=null,this.tail=null,this.compare=t}return r.prototype.prepend=function(t){var e=new Gm(t,this.head);return this.head=e,this.tail||(this.tail=e),this},r.prototype.append=function(t){var e=new Gm(t);return this.head?(this.tail.next=e,this.tail=e,this):(this.head=e,this.tail=e,this)},r.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(n!==null)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},r.prototype.find=function(t){var e=t.value,n=e===void 0?void 0:e,i=t.callback,a=i===void 0?void 0:i;if(!this.head)return null;for(var s=this.head;s;){if(a&&a(s.value)||n!==void 0&&this.compare(s.value,n))return s;s=s.next}return null},r.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},r.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},r.prototype.fromArray=function(t){var e=this;return t.forEach(function(n){return e.append(n)}),this},r.prototype.toArray=function(){for(var t=[],e=this.head;e;)t.push(e),e=e.next;return t},r.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},r.prototype.toString=function(t){return t===void 0&&(t=void 0),this.toArray().map(function(e){return e.toString(t)}).toString()},r}(),Wm=UO,YO=function(){function r(){this.linkedList=new Wm}return r.prototype.isEmpty=function(){return!this.linkedList.head},r.prototype.peek=function(){return this.linkedList.head?this.linkedList.head.value:null},r.prototype.enqueue=function(t){this.linkedList.append(t)},r.prototype.dequeue=function(){var t=this.linkedList.deleteHead();return t?t.value:null},r.prototype.toString=function(t){return this.linkedList.toString(t)},r}(),HO=YO,ki=function(t,e,n){e===void 0&&(e=[]);var i=e.filter(function(l){return l.source===t||l.target===t});if(n==="target"){var a=function(c){return c.source===t};return i.filter(a).map(function(l){return l.target})}if(n==="source"){var s=function(c){return c.target===t};return i.filter(s).map(function(l){return l.source})}var o=function(c){return c.source===t?c.target:c.source};return i.map(o)},XO=function(t,e){return e.filter(function(n){return n.source===t})},au=function(t,e){return e.filter(function(n){return n.source===t||n.target===t})},Zm=function(t){t===void 0&&(t=0);var e="".concat(Math.random()).split(".")[1].substr(0,5),n="".concat(Math.random()).split(".")[1].substr(0,5);return"".concat(t,"-").concat(e).concat(n)};function KO(r){r===void 0&&(r={});var t=r,e=function(){},n=function(){var i={};return function(a){var s=a.next,o=s;return i[o]?!1:(i[o]=!0,!0)}}();return t.allowTraversal=r.allowTraversal||n,t.enter=r.enter||e,t.leave=r.leave||e,t}var QO=function(t,e,n,i){i===void 0&&(i=!0);var a=KO(n),s=new HO,o=t.edges,l=o===void 0?[]:o;s.enqueue(e);for(var c="",u=function(){var d=s.dequeue();a.enter({current:d,previous:c}),ki(d,l,i?"target":void 0).forEach(function(f){a.allowTraversal({previous:c,current:d,next:f})&&s.enqueue(f)}),a.leave({current:d,previous:c}),c=d};!s.isEmpty();)u()},qO=QO,JO=function(t){for(var e=t.nodes,n=e===void 0?[]:e,i=t.edges,a=i===void 0?[]:i,s=[],o={},l=[],c=function f(v){l.push(v),o[v.id]=!0;for(var g=ki(v.id,a),p=function(E){var O=g[E];if(!o[O]){var k=n.filter(function(P){return P.id===O});k.length>0&&f(k[0])}},y=0;y<g.length;++y)p(y)},u=0;u<n.length;u++){var h=n[u];if(!o[h.id]){c(h);for(var d=[];l.length>0;)d.push(l.pop());s.push(d)}}return s},Vm=function(t){for(var e=t.nodes,n=e===void 0?[]:e,i=t.edges,a=i===void 0?[]:i,s=[],o={},l={},c={},u=[],h=0,d=function p(y){l[y.id]=h,c[y.id]=h,h+=1,s.push(y),o[y.id]=!0;for(var b=ki(y.id,a,"target").filter(function(F){return n.map(function(B){return B.id}).indexOf(F)>-1}),E=function(B){var V=b[B];if(!l[V]&&l[V]!==0){var U=n.filter(function(J){return J.id===V});U.length>0&&p(U[0]),c[y.id]=Math.min(c[y.id],c[V])}else o[V]&&(c[y.id]=Math.min(c[y.id],l[V]))},O=0;O<b.length;O++)E(O);if(c[y.id]===l[y.id]){for(var k=[];s.length>0;){var P=s.pop();if(o[P.id]=!1,k.push(P),P===y)break}k.length>0&&u.push(k)}},f=0,v=n;f<v.length;f++){var g=v[f];!l[g.id]&&l[g.id]!==0&&d(g)}return u};function Um(r,t){return t?Vm(r):JO(r)}var xl=function(t){var e={},n=t.nodes,i=n===void 0?[]:n,a=t.edges,s=a===void 0?[]:a;return i.forEach(function(o){e[o.id]={degree:0,inDegree:0,outDegree:0}}),s.forEach(function(o){e[o.source].degree++,e[o.source].outDegree++,e[o.target].degree++,e[o.target].inDegree++}),e},Df=xl,$O=function(t,e){var n=xl(t);return n[e]?xl(t)[e].inDegree:0},tC=function(t,e){var n=xl(t);return n[e]?xl(t)[e].outDegree:0};function eC(r){r===void 0&&(r={});var t=r,e=function(){},n=function(){var i={};return function(a){var s=a.next;return i[s]?!1:(i[s]=!0,!0)}}();return t.allowTraversal=r.allowTraversal||n,t.enter=r.enter||e,t.leave=r.leave||e,t}function Ym(r,t,e,n,i){i===void 0&&(i=!0),n.enter({current:t,previous:e});var a=r.edges,s=a===void 0?[]:a;ki(t,s,i?"target":void 0).forEach(function(o){n.allowTraversal({previous:e,current:t,next:o})&&Ym(r,o,t,n,i)}),n.leave({current:t,previous:e})}function Hm(r,t,e,n){n===void 0&&(n=!0),Ym(r,t,"",eC(e),n)}var nC=function(t){var e=null,n=t.nodes,i=n===void 0?[]:n,a={},s={},o={},l={};i.forEach(function(h){s[h.id]=h});for(var c={enter:function(d){var f=d.current,v=d.previous;if(o[f]){e={};for(var g=f,p=v;p!==f;)e[g]=p,g=p,p=a[p];e[g]=p}else o[f]=f,delete s[f],a[f]=v},leave:function(d){var f=d.current;l[f]=f,delete o[f]},allowTraversal:function(d){var f=d.next;return e?!1:!l[f]}};Object.keys(s).length;){var u=Object.keys(s)[0];Hm(t,u,c)}return e},Xm=function(t,e,n){var i,a;n===void 0&&(n=!0);for(var s=[],o=Um(t,!1),l=0,c=o;l<c.length;l++){var u=c[l];if(u.length)for(var h=u[0],d=h.id,f=[h],v=(i={},i[d]=h,i),g=(a={},a[d]=new Set,a);f.length>0;)for(var p=f.pop(),y=p.id,b=ki(y,t.edges),E=function(P){var F,B=b[P],V=t.nodes.find(function(ft){return ft.id===B});if(B===y)s.push((F={},F[B]=p,F));else if(!(B in g))v[B]=p,f.push(V),g[B]=new Set([p]);else if(!g[y].has(V)){for(var U=!0,J=[V,p],$=v[y];g[B].size&&!g[B].has($)&&(J.push($),$!==v[$.id]);)$=v[$.id];if(J.push($),e&&n?(U=!1,J.findIndex(function(ft){return e.indexOf(ft.id)>-1})>-1&&(U=!0)):e&&!n&&J.findIndex(function(ft){return e.indexOf(ft.id)>-1})>-1&&(U=!1),U){for(var at={},ct=1;ct<J.length;ct+=1)at[J[ct-1].id]=J[ct];J.length&&(at[J[J.length-1].id]=J[0]),s.push(at)}g[B].add(p)}},O=0;O<b.length;O+=1)E(O)}return s},Km=function(t,e,n){n===void 0&&(n=!0);for(var i=[],a=new Set,s=[],o=[],l={},c={},u=function($){for(var at=[$];at.length>0;){var ct=at.pop();a.has(ct)&&(a.delete(ct),s[ct.id].forEach(function(ft){at.push(ft)}),s[ct.id].clear())}},h=function J($,at,ct){var ft=!1;if(e&&n===!1&&e.indexOf($.id)>-1)return ft;i.push($),a.add($);for(var Nt=ct[$.id],Ct=0;Ct<Nt.length;Ct+=1){var gt=l[Nt[Ct]];if(gt===at){for(var bt={},Pt=1;Pt<i.length;Pt+=1)bt[i[Pt-1].id]=i[Pt];i.length&&(bt[i[i.length-1].id]=i[0]),o.push(bt),ft=!0}else a.has(gt)||J(gt,at,ct)&&(ft=!0)}if(ft)u($);else for(var Ct=0;Ct<Nt.length;Ct+=1){var gt=l[Nt[Ct]];s[gt.id].has($)||s[gt.id].add($)}return i.pop(),ft},d=t.nodes,f=d===void 0?[]:d,v=0;v<f.length;v+=1){var g=f[v],p=g.id;c[p]=v,l[v]=g}if(e&&n)for(var y=function($){var at=e[$];c[f[$].id]=c[at],c[at]=0,l[0]=f.find(function(ct){return ct.id===at}),l[c[f[$].id]]=f[$]},v=0;v<e.length;v++)y(v);for(var b=function($){for(var at,ct,ft=1/0,Nt=0;Nt<$.length;Nt+=1)for(var Ct=$[Nt],gt=0;gt<Ct.length;gt++){var bt=c[Ct[gt].id];bt<ft&&(ft=bt,ct=Nt)}for(var Pt=$[ct],zt=[],Nt=0;Nt<Pt.length;Nt+=1){var Ut=Pt[Nt];zt[Ut.id]=[];for(var $t=0,re=ki(Ut.id,t.edges,"target").filter(function(Ee){return Pt.map(function(Ne){return Ne.id}).indexOf(Ee)>-1});$t<re.length;$t++){var ce=re[$t];ce===Ut.id&&!(n===!1&&e.indexOf(Ut.id)>-1)?o.push((at={},at[Ut.id]=Ut,at)):zt[Ut.id].push(c[ce])}}return{component:Pt,adjList:zt,minIdx:ft}},E=0;E<f.length;){var O=f.filter(function(J){return c[J.id]>=E}),k=Vm({nodes:O,edges:t.edges}).filter(function(J){return J.length>1});if(k.length===0)break;var P=b(k),F=P.minIdx,B=P.adjList,V=P.component;if(V.length>1){V.forEach(function(J){s[J.id]=new Set});var U=l[F];if(e&&n&&e.indexOf(U.id)===-1)return o;h(U,U,B),E=F+1}else break}return o},rC=function(t,e,n,i){return i===void 0&&(i=!0),e?Km(t,n,i):Xm(t,n,i)},Qm=nC,iC={}.toString,aC=function(r,t){return iC.call(r)==="[object "+t+"]"},su=aC,If=function(r){return su(r,"Function")},Bf=function(r){return Array.isArray?Array.isArray(r):su(r,"Array")},sC=function(r){var t=typeof r;return r!==null&&t==="object"||t==="function"};function oC(r,t){if(r){var e;if(Bf(r))for(var n=0,i=r.length;n<i&&(e=t(r[n],n),e!==!1);n++);else if(sC(r)){for(var a in r)if(r.hasOwnProperty(a)&&(e=t(r[a],a),e===!1))break}}}var qm=oC,k9=Object.keys?function(r){return Object.keys(r)}:function(r){var t=[];return qm(r,function(e,n){If(r)&&n==="prototype"||t.push(n)}),t},P9=null;function R9(r,t){var e=keys(t),n=e.length;if(isNil(r))return!n;for(var i=0;i<n;i+=1){var a=e[i];if(t[a]!==r[a]||!(a in r))return!1}return!0}var L9=null,_9=function(r){if(!isObjectLike(r)||!isType(r,"Object"))return!1;if(Object.getPrototypeOf(r)===null)return!0;for(var t=r;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(r)===t},D9=null;function I9(r,t){if(!isArray(r))return null;var e;if(isFunction(t)&&(e=t),isPlainObject(t)&&(e=function(i){return isMatch(i,t)}),e){for(var n=0;n<r.length;n+=1)if(e(r[n]))return r[n]}return null}var B9=null,F9=function(r,t){for(var e=null,n=0;n<r.length;n++){var i=r[n],a=i[t];if(!isNil(a)){isArray(a)?e=a[0]:e=a;break}}return e},z9=null,j9=function(r){if(!isArray(r))return[];for(var t=[],e=0;e<r.length;e++)t=t.concat(r[e]);return t},G9=null,lC=function(r,t){if(t===void 0&&(t=[]),!isArray(r))t.push(r);else for(var e=0;e<r.length;e+=1)lC(r[e],t);return t},W9=null,Z9=function(r){if(isArray(r))return r.reduce(function(t,e){return Math.max(t,e)},r[0])},V9=function(r){if(isArray(r))return r.reduce(function(t,e){return Math.min(t,e)},r[0])},U9=function(r){var t=r.filter(function(s){return!isNaN(s)});if(!t.length)return{min:0,max:0};if(isArray(r[0])){for(var e=[],n=0;n<r.length;n++)e=e.concat(r[n]);t=e}var i=getMax(t),a=getMin(t);return{min:a,max:i}},Y9=null,Jm=Array.prototype,cC=Jm.splice,uC=Jm.indexOf,H9=function(r){for(var t=[],e=1;e<arguments.length;e++)t[e-1]=arguments[e];for(var n=0;n<t.length;n++)for(var i=t[n],a=-1;(a=uC.call(r,i))>-1;)cC.call(r,a,1);return r},X9=null,hC=Array.prototype.splice,K9=function(t,e){if(!isArrayLike(t))return[];for(var n=t?e.length:0,i=n-1;n--;){var a=void 0,s=e[n];(n===i||s!==a)&&(a=s,hC.call(t,s,1))}return t},Q9=null,q9=function(r,t,e){if(!isArray(r)&&!isPlainObject(r))return r;var n=e;return each(r,function(i,a){n=t(n,i,a)}),n},J9=null,$9=function(r,t){var e=[];if(!isArrayLike(r))return e;for(var n=-1,i=[],a=r.length;++n<a;){var s=r[n];t(s,n,r)&&(e.push(s),i.push(n))}return pullAt(r,i),e},tz=null,Ff=function(r){return su(r,"String")};function ez(r,t){var e;if(isFunction(t))e=function(i,a){return t(i)-t(a)};else{var n=[];isString(t)?n.push(t):isArray(t)&&(n=t),e=function(i,a){for(var s=0;s<n.length;s+=1){var o=n[s];if(i[o]>a[o])return 1;if(i[o]<a[o])return-1}return 0}}return r.sort(e),r}var nz=null;function zf(r,t){t===void 0&&(t=new Map);var e=[];if(Array.isArray(r))for(var n=0,i=r.length;n<i;n++){var a=r[n];t.has(a)||(e.push(a),t.set(a,!0))}return e}var rz=function(r,t){for(var e=[],n={},i=0;i<r.length;i++){var a=r[i],s=a[t];if(!isNil(s)){isArray(s)||(s=[s]);for(var o=0;o<s.length;o++){var l=s[o];n[l]||(e.push(l),n[l]=!0)}}}return e};function iz(r,t){return isArray(r)||isString(r)?r[0]===t:!1}var az=null;function sz(r,t){return isArray(r)||isString(r)?r[r.length-1]===t:!1}var oz=null,dC=Object.prototype.hasOwnProperty;function lz(r,t){if(!t||!isArray(r))return{};for(var e={},n=isFunction(t)?t:function(o){return o[t]},i,a=0;a<r.length;a++){var s=r[a];i=n(s),dC.call(e,i)?e[i].push(s):e[i]=[s]}return e}var cz=null;function uz(r,t){if(!t)return{0:r};if(!isFunction(t)){var e=isArray(t)?t:t.replace(/\s+/g,"").split("*");t=function(n){for(var i="_",a=0,s=e.length;a<s;a++)i+=n[e[a]]&&n[e[a]].toString();return i}}return groupBy(r,t)}var hz=function(r,t){if(!t)return[r];var e=groupToMap(r,t),n=[];for(var i in e)n.push(e[i]);return n},$m={};function dz(r){var t=$m[r];if(!t){for(var e=r.toString(16),n=e.length;n<6;n++)e="0"+e;t="#"+e,$m[r]=t}return t}var fz=null;function vz(r){var t=0,e=0,n=0,i=0;return isArray(r)?r.length===1?t=e=n=i=r[0]:r.length===2?(t=n=r[0],e=i=r[1]):r.length===3?(t=r[0],e=i=r[1],n=r[2]):(t=r[0],e=r[1],n=r[2],i=r[3]):t=e=n=i=r,{r1:t,r2:e,r3:n,r4:i}}var gz=null,fC=function(r){return su(r,"Number")},vC=fC,pz=function(r){return isNumber(r)&&r%1!==0},mz=null,yz=function(r){return isNumber(r)&&r%2===0},bz=null,xz=Number.isInteger?Number.isInteger:function(r){return vC(r)&&r%1===0},Ez=null,wz=function(r){return isNumber(r)&&r<0},Sz=null,Mz=function(r){return isNumber(r)&&r%2!==0},Az=null,Tz=function(r){return isNumber(r)&&r>0},Oz=null,Cz=function(r,t){if(isArray(r)){for(var e,n=-1/0,i=0;i<r.length;i++){var a=r[i],s=isFunction(t)?t(a):a[t];s>n&&(e=a,n=s)}return e}},Nz=function(r,t){if(isArray(r)){for(var e,n=1/0,i=0;i<r.length;i++){var a=r[i],s=isFunction(t)?t(a):a[t];s<n&&(e=a,n=s)}return e}},gC=180/Math.PI,kz=function(r){return gC*r},Pz=null,pC=Math.PI/180,Rz=function(r){return pC*r},Lz=null,_z=null,mC=Object.values?function(r){return Object.values(r)}:function(r){var t=[];return qm(r,function(e,n){If(r)&&n==="prototype"||t.push(e)}),t},yC=mC,Dz=function(r,t){return contains(values(r),t)},bC={}.toString,Iz=function(r){return bC.call(r).replace(/^\[object /,"").replace(/]$/,"")},Bz=null,Fz=function(r){return isType(r,"Arguments")},zz=null,jz=function(r){return isType(r,"Boolean")},Gz=null,Wz=function(r){return isType(r,"Date")},Zz=null,Vz=function(r){return isType(r,"Error")},Uz=null;function Yz(r){return isNumber(r)&&isFinite(r)}var xC=Object.prototype,Hz=function(r){var t=r&&r.constructor,e=typeof t=="function"&&t.prototype||xC;return r===e},Xz=null,Kz=function(r){return isType(r,"RegExp")},Qz=null,qz=function(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];for(var e=r[0],n=1;n<r.length;n++){var i=r[n];isFunction(i)&&(i=i.prototype),mix(e.prototype,i)}},Jz=null,jf=function(r){if(typeof r!="object"||r===null)return r;var t;if(Bf(r)){t=[];for(var e=0,n=r.length;e<n;e++)typeof r[e]=="object"&&r[e]!=null?t[e]=jf(r[e]):t[e]=r[e]}else{t={};for(var i in r)typeof r[i]=="object"&&r[i]!=null?t[i]=jf(r[i]):t[i]=r[i]}return t},El=jf,EC=function(r,t){if(!If(r))throw new TypeError("Expected a function");var e=function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];var a=t?t.apply(this,n):n[0],s=e.cache;if(s.has(a))return s.get(a);var o=r.apply(this,n);return s.set(a,o),o};return e.cache=new Map,e},wC=5;function ty(r,t,e,n){e=e||0,n=n||wC;for(var i in t)if(t.hasOwnProperty(i)){var a=t[i];a!==null&&isPlainObject(a)?(isPlainObject(r[i])||(r[i]={}),e<n?ty(r[i],a,e+1,n):r[i]=t[i]):isArray(a)?(r[i]=[],r[i]=r[i].concat(a)):a!==void 0&&(r[i]=a)}}var $z=function(r){for(var t=[],e=1;e<arguments.length;e++)t[e-1]=arguments[e];for(var n=0;n<t.length;n+=1)ty(r,t[n]);return r},t7=null,e7=function(r,t,e,n){isFunction(t)||(e=t,t=r,r=function(){});var i=Object.create?function(s,o){return Object.create(s,{constructor:{value:o}})}:function(s,o){function l(){}l.prototype=s;var c=new l;return c.constructor=o,c},a=i(t.prototype,r);return r.prototype=mix(a,r.prototype),r.superclass=i(t.prototype,t),mix(a,e),mix(r,n),r},n7=null,SC=Object.prototype.hasOwnProperty;function r7(r){if(isNil(r))return!0;if(isArrayLike(r))return!r.length;var t=getType(r);if(t==="Map"||t==="Set")return!r.size;if(isPrototype(r))return!Object.keys(r).length;for(var e in r)if(SC.call(r,e))return!1;return!0}var i7=null,MC=function(r){return typeof r=="object"&&r!==null},ey=MC,AC=function(r){return r!==null&&typeof r!="function"&&isFinite(r.length)},ny=AC,Gf=function(r,t){if(r===t)return!0;if(!r||!t||Ff(r)||Ff(t))return!1;if(ny(r)||ny(t)){if(r.length!==t.length)return!1;for(var e=!0,n=0;n<r.length&&(e=Gf(r[n],t[n]),!!e);n++);return e}if(ey(r)||ey(t)){var i=Object.keys(r),a=Object.keys(t);if(i.length!==a.length)return!1;for(var e=!0,n=0;n<i.length&&(e=Gf(r[i[n]],t[i[n]]),!!e);n++);return e}return!1},TC=Gf,a7=function(r,t,e){return isFunction(e)?!!e(r,t):isEqual(r,t)},s7=function(r,t,e){for(var n=0,i=isString(t)?t.split("."):t;r&&n<i.length;)r=r[i[n++]];return r===void 0||n<i.length?e:r},o7=function(r,t,e){var n=r,i=isString(t)?t.split("."):t;return i.forEach(function(a,s){s<i.length-1?(isObject(n[a])||(n[a]=isNumber(i[s+1])?[]:{}),n=n[a]):n[a]=e}),r},OC=Object.prototype.hasOwnProperty,l7=function(r,t){if(r===null||!isPlainObject(r))return{};var e={};return each(t,function(n){OC.call(r,n)&&(e[n]=r[n])}),e},c7=function(r,t){return reduce(r,function(e,n,i){return t.includes(i)||(e[i]=n),e},{})},ou={},u7=function(r){return r=r||"g",ou[r]?ou[r]+=1:ou[r]=1,r+ou[r]},lu,h7=EC(function(r,t){t===void 0&&(t={});var e=t.fontSize,n=t.fontFamily,i=t.fontWeight,a=t.fontStyle,s=t.fontVariant;return lu||(lu=document.createElement("canvas").getContext("2d")),lu.font=[a,s,i,e+"px",n].join(" "),lu.measureText(Ff(r)?r:"").width},function(r,t){return t===void 0&&(t={}),(0,Z.pr)([r],yC(t)).join("")}),d7=function(r,t,e,n){n===void 0&&(n="...");var i=16,a=measureTextWidth(n,e),s=isString(r)?r:toString(r),o=t,l=[],c,u;if(measureTextWidth(r,e)<=t)return r;for(;c=s.substr(0,i),u=measureTextWidth(c,e),!(u+a>o&&u>o);)if(l.push(c),o-=u,s=s.substr(i),!s)return l.join("");for(;c=s.substr(0,1),u=measureTextWidth(c,e),!(u+a>o);)if(l.push(c),o-=u,s=s.substr(1),!s)return l.join("");return""+l.join("")+n},f7=function(){function r(){this.map={}}return r.prototype.has=function(t){return this.map[t]!==void 0},r.prototype.get=function(t,e){var n=this.map[t];return n===void 0?e:n},r.prototype.set=function(t,e){this.map[t]=e},r.prototype.clear=function(){this.map={}},r.prototype.delete=function(t){delete this.map[t]},r.prototype.size=function(){return Object.keys(this.map).length},r}(),v7=null,CC=function(t,e,n){for(var i=1/0,a,s=0;s<e.length;s++){var o=e[s].id;!n[o]&&t[o]<=i&&(i=t[o],a=e[s])}return a},NC=function(t,e,n,i){var a=t.nodes,s=a===void 0?[]:a,o=t.edges,l=o===void 0?[]:o,c=[],u={},h={},d={};s.forEach(function(E,O){var k=E.id;c.push(k),h[k]=1/0,k===e&&(h[k]=0)});for(var f=s.length,v=function(O){var k=CC(h,s,u),P=k.id;if(u[P]=!0,h[P]===1/0)return"continue";var F=[];n?F=XO(P,l):F=au(P,l),F.forEach(function(B){var V=B.target,U=B.source,J=V===P?U:V,$=i&&B[i]?B[i]:1;h[J]>h[k.id]+$?(h[J]=h[k.id]+$,d[J]=[k.id]):h[J]===h[k.id]+$&&d[J].push(k.id)})},g=0;g<f;g++)v(g);d[e]=[e];var p={};for(var y in h)h[y]!==1/0&&ry(e,y,d,p);var b={};for(var y in p)b[y]=p[y][0];return{length:h,path:b,allPath:p}},cu=NC;function ry(r,t,e,n){if(r===t)return[r];if(n[t])return n[t];for(var i=[],a=0,s=e[t];a<s.length;a++){var o=s[a],l=ry(r,o,e,n);if(!l)return;for(var c=0,u=l;c<u.length;c++){var h=u[c];Bf(h)?i.push((0,Z.ev)((0,Z.ev)([],h,!0),[t],!1)):i.push([h,t])}}return n[t]=i,n[t]}var Wf=function(t,e,n,i,a){var s=cu(t,e,i,a),o=s.length,l=s.path,c=s.allPath;return{length:o[n],path:l[n],allPath:c[n]}},kC=function(t,e,n,i){var a;if(e===n)return[[e]];var s=t.edges,o=s===void 0?[]:s,l=[e],c=(a={},a[e]=!0,a),u=[],h=[],d=i?ki(e,o,"target"):ki(e,o);for(u.push(d);l.length>0&&u.length>0;){var f=u[u.length-1];if(f.length){var v=f.shift();v&&(l.push(v),c[v]=!0,d=i?ki(v,o,"target"):ki(v,o),u.push(d.filter(function(y){return!c[y]})))}else{var g=l.pop();c[g]=!1,u.pop();continue}if(l[l.length-1]===n){var p=l.map(function(b){return b});h.push(p);var g=l.pop();c[g]=!1,u.pop()}}return h},PC=function(t,e){for(var n=iu(t,e),i=[],a=n.length,s=0;s<a;s+=1){i[s]=[];for(var o=0;o<a;o+=1)s===o?i[s][o]=0:n[s][o]===0||!n[s][o]?i[s][o]=1/0:i[s][o]=n[s][o]}for(var l=0;l<a;l+=1)for(var s=0;s<a;s+=1)for(var o=0;o<a;o+=1)i[s][o]>i[s][l]+i[l][o]&&(i[s][o]=i[s][l]+i[l][o]);return i},Zf=PC,RC=function(t,e,n,i){e===void 0&&(e=!1),n===void 0&&(n="weight"),i===void 0&&(i=1e3);var a=t.nodes,s=a===void 0?[]:a,o=t.edges,l=o===void 0?[]:o,c={},u={};s.forEach(function(O,k){var P=Zm();O.clusterId=P,c[P]={id:P,nodes:[O]},u[O.id]={node:O,idx:k}});var h=iu(t,e),d=[],f={};h.forEach(function(O,k){var P=0,F=s[k].id;f[F]={},O.forEach(function(B,V){if(B){P+=B;var U=s[V].id;f[F][U]=B}}),d.push(P)});for(var v=0,g=function(){var k=!1;if(s.forEach(function(P){var F={};Object.keys(f[P.id]).forEach(function(ft){var Nt=f[P.id][ft],Ct=u[ft].node,gt=Ct.clusterId;F[gt]||(F[gt]=0),F[gt]+=Nt});var B=-1/0,V=[];if(Object.keys(F).forEach(function(ft){B<F[ft]?(B=F[ft],V=[ft]):B===F[ft]&&V.push(ft)}),!(V.length===1&&V[0]===P.clusterId)){var U=V.indexOf(P.clusterId);if(U>=0&&V.splice(U,1),V&&V.length){k=!0;var J=c[P.clusterId],$=J.nodes.indexOf(P);J.nodes.splice($,1);var at=Math.floor(Math.random()*V.length),ct=c[V[at]];ct.nodes.push(P),P.clusterId=ct.id}}}),!k)return"break";v++};v<i;){var p=g();if(p==="break")break}Object.keys(c).forEach(function(O){var k=c[O];(!k.nodes||!k.nodes.length)&&delete c[O]});var y=[],b={};l.forEach(function(O){var k=O.source,P=O.target,F=O[n]||1,B=u[k].node.clusterId,V=u[P].node.clusterId,U="".concat(B,"---").concat(V);if(b[U])b[U].weight+=F,b[U].count++;else{var J={source:B,target:V,weight:F,count:1};b[U]=J,y.push(J)}});var E=[];return Object.keys(c).forEach(function(O){E.push(c[O])}),{clusters:E,clusterEdges:y}},LC=RC,_C=function(){function r(t){this.arr=t}return r.prototype.getArr=function(){return this.arr||[]},r.prototype.add=function(t){var e,n=t.arr;if(!(!((e=this.arr)===null||e===void 0)&&e.length))return new r(n);if(!(n!=null&&n.length))return new r(this.arr);if(this.arr.length===n.length){var i=[];for(var a in this.arr)i[a]=this.arr[a]+n[a];return new r(i)}},r.prototype.subtract=function(t){var e,n=t.arr;if(!(!((e=this.arr)===null||e===void 0)&&e.length))return new r(n);if(!(n!=null&&n.length))return new r(this.arr);if(this.arr.length===n.length){var i=[];for(var a in this.arr)i[a]=this.arr[a]-n[a];return new r(i)}},r.prototype.avg=function(t){var e=[];if(t!==0)for(var n in this.arr)e[n]=this.arr[n]/t;return new r(e)},r.prototype.negate=function(){var t=[];for(var e in this.arr)t[e]=-this.arr[e];return new r(t)},r.prototype.squareEuclideanDistance=function(t){var e,n=t.arr;if(!(!((e=this.arr)===null||e===void 0)&&e.length)||!(n!=null&&n.length))return 0;if(this.arr.length===n.length){var i=0;for(var a in this.arr)i+=Math.pow(this.arr[a]-t.arr[a],2);return i}},r.prototype.euclideanDistance=function(t){var e,n=t.arr;if(!(!((e=this.arr)===null||e===void 0)&&e.length)||!(n!=null&&n.length))return 0;if(this.arr.length===n.length){var i=0;for(var a in this.arr)i+=Math.pow(this.arr[a]-t.arr[a],2);return Math.sqrt(i)}else console.error("The two vectors are unequal in length.")},r.prototype.normalize=function(){var t=[],e=El(this.arr);e.sort(function(s,o){return s-o});var n=e[e.length-1],i=e[0];for(var a in this.arr)t[a]=(this.arr[a]-i)/(n-i);return new r(t)},r.prototype.norm2=function(){var t;if(!(!((t=this.arr)===null||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)},r.prototype.dot=function(t){var e,n=t.arr;if(!(!((e=this.arr)===null||e===void 0)&&e.length)||!(n!=null&&n.length))return 0;if(this.arr.length===n.length){var i=0;for(var a in this.arr)i+=this.arr[a]*t.arr[a];return i}else console.error("The two vectors are unequal in length.")},r.prototype.equal=function(t){var e,n=t.arr;if(((e=this.arr)===null||e===void 0?void 0:e.length)!==(n==null?void 0:n.length))return!1;for(var i in this.arr)if(this.arr[i]!==n[i])return!1;return!0},r}(),Pi=_C,DC=/^(\d{1,4})(-|\/)(\d{1,2})\2(\d{1,2})$/,IC=/^(\d{1,4})(-|\/)(\d{1,2})\2(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})$/,iy=function(t,e){t===void 0&&(t=[]),e===void 0&&(e=100);var n={};t.forEach(function(a){a.properties&&Object.keys(a.properties).forEach(function(s){if(s==="id"||!"".concat(a.properties[s]).match(DC)&&!"".concat(a.properties[s]).match(IC)&&isNaN(Number(a.properties[s]))){n.hasOwnProperty(s)&&delete n[s];return}n.hasOwnProperty(s)?n[s]+=1:n[s]=1})});var i=Object.keys(n).sort(function(a,s){return n[s]-n[a]});return i.length<e?i:i.slice(0,e)},BC=function(t,e){return e.map(function(n){return t.hasOwnProperty(n)?t[n]:0})},FC=function(t){for(var e=iy(t),n=[],i=0;i<t.length;i++)n[i]=BC(t[i].properties,e);return n},uu=function(t,e){e===void 0&&(e=void 0);var n=[];return t.forEach(function(i){e===void 0&&n.push(i),i[e]!==void 0&&n.push(i[e])}),n},g7={getAllSortProperties:iy,getPropertyWeight:FC,getAllProperties:uu},Gi;(function(r){r.EuclideanDistance="euclideanDistance"})(Gi||(Gi={}));var ay=function(t,e,n){var i=[];e!=null&&e.length?i=e:(t.forEach(function(s){i=i.concat(Object.keys(s))}),i=zf(i));var a={};return i.forEach(function(s){var o=[];t.forEach(function(l){l[s]!==void 0&&l[s]!==""&&o.push(l[s])}),o.length&&!(n!=null&&n.includes(s))&&(a[s]=zf(o))}),a},hu=function(t,e,n){var i=ay(t,e,n),a=[];if(!Object.keys(i).length)return a;var s=Object.values(i),o=s.every(function(l){return l.every(function(c){return typeof c=="number"})});return t.forEach(function(l,c){var u=[];Object.keys(i).forEach(function(h){var d=l[h],f=i[h],v=f.findIndex(function(y){return d===y}),g=[];if(o)g.push(d);else for(var p=0;p<f.length;p++)p===v?g.push(1):g.push(0);u=u.concat(g)}),a[c]=u}),a},Vf=function(t,e,n,i){n===void 0&&(n=Gi.EuclideanDistance);var a=0;switch(n){case Gi.EuclideanDistance:a=new Pi(t).euclideanDistance(new Pi(e));break;default:break}return a},p7={getAllKeyValueMap:ay,oneHot:hu,getDistance:Vf},sy=function(t,e,n,i){for(var a=e.length,s=2*i,o=0,l=0;l<a;l++)for(var c=t[l].clusterId,u=0;u<a;u++){var h=t[u].clusterId;if(c===h){var d=e[l][u]||0,f=n[l]||0,v=n[u]||0;o+=d-f*v/s}}return o*=1/s,o},Uf=function(t,e){t===void 0&&(t=[]);for(var n=t.length,i=new Pi([]),a=0;a<n;a++)i=i.add(new Pi(e[a]));var s=i.avg(n);s.normalize();for(var o=0,a=0;a<n;a++){var l=new Pi(e[a]),c=l.squareEuclideanDistance(s);o+=c}var u=[];t.forEach(function(){u.push([])});for(var a=0;a<n;a++){var l=new Pi(e[a]);t[a].clusterInertial=0;for(var h=0;h<n;h++){if(a===h){u[a][h]=0;continue}var d=new Pi(e[h]);u[a][h]=l.squareEuclideanDistance(d),t[a].clusterInertial+=u[a][h]}}for(var f=0,v=2*n*o,a=0;a<n;a++)for(var g=t[a].clusterId,h=0;h<n;h++){var p=t[h].clusterId;if(!(a===h||g!==p)){var y=t[a].clusterInertial*t[h].clusterInertial/Math.pow(v,2)-u[a][h]/v;f+=y}}return Number(f.toFixed(4))},zC=function(t,e,n,i,a,s,o,l,c){e===void 0&&(e=!1),n===void 0&&(n="weight"),i===void 0&&(i=1e-4),a===void 0&&(a=!1),s===void 0&&(s=void 0),o===void 0&&(o=[]),l===void 0&&(l=["id"]),c===void 0&&(c=1);var u=t.nodes,h=u===void 0?[]:u,d=t.edges,f=d===void 0?[]:d,v=[];if(a){h.forEach(function(bt,Pt){bt.properties=bt.properties||{},bt.originIndex=Pt});var g=[];h.every(function(bt){return bt.hasOwnProperty("nodeType")})&&(g=Array.from(new Set(h.map(function(bt){return bt.nodeType}))),h.forEach(function(bt){bt.properties.nodeType=g.findIndex(function(Pt){return Pt===bt.nodeType})}));var p=uu(h,s);v=hu(p,o,l)}var y=1,b={},E={};h.forEach(function(bt,Pt){var zt=String(y++);bt.clusterId=zt,b[zt]={id:zt,nodes:[bt]},E[bt.id]={node:bt,idx:Pt}});var O=iu(t,e),k=[],P={},F=0;O.forEach(function(bt,Pt){var zt=0,Ut=h[Pt].id;P[Ut]={},bt.forEach(function($t,re){if($t){zt+=$t;var ce=h[re].id;P[Ut][ce]=$t,F+=$t}}),k.push(zt)}),F/=2;for(var B=1/0,V=1/0,U=0,J=[],$={};;){a&&h.every(function(bt){return bt.hasOwnProperty("properties")})?B=sy(h,O,k,F)+Uf(h,v)*c:B=sy(h,O,k,F),U===0&&(V=B,J=h,$=b);var at=B>0&&B>V&&B-V<i;if(B>V&&(J=h.map(function(bt){return{node:bt,clusterId:bt.clusterId}}),$=El(b),V=B),at||U>100)break;U++,Object.keys(b).forEach(function(bt){var Pt=0;f.forEach(function(zt){var Ut=zt.source,$t=zt.target,re=E[Ut].node.clusterId,ce=E[$t].node.clusterId;(re===bt&&ce!==bt||ce===bt&&re!==bt)&&(Pt=Pt+(zt[n]||1))}),b[bt].sumTot=Pt}),h.forEach(function(bt,Pt){var zt=b[bt.clusterId],Ut=0,$t,re=k[Pt]/(2*F),ce=0,le=zt.nodes;le.forEach(function(Ar){var pr=E[Ar.id].idx;ce+=O[Pt][pr]||0});var Ee=ce-zt.sumTot*re,Ne=le.filter(function(Ar){return Ar.id!==bt.id}),We=[];Ne.forEach(function(Ar,pr){We[pr]=v[Ar.originIndex]});var He=Uf(Ne,v)*c,cr=P[bt.id];if(Object.keys(cr).forEach(function(Ar){var pr=E[Ar].node,Na=pr.clusterId;if(Na!==bt.clusterId){var Tr=b[Na],ai=Tr.nodes;if(!(!ai||!ai.length)){var je=0;ai.forEach(function(Qe){var en=E[Qe.id].idx;je+=O[Pt][en]||0});var tn=je-Tr.sumTot*re,Ge=ai.concat([bt]),Ke=[];Ge.forEach(function(Qe,en){Ke[en]=v[Qe.originIndex]});var on=Uf(Ge,v)*c,pe=tn-Ee;a&&(pe=tn+on-(Ee+He)),pe>Ut&&(Ut=pe,$t=Tr)}}}),Ut>0){$t.nodes.push(bt);var $e=bt.clusterId;bt.clusterId=$t.id;var yi=zt.nodes.indexOf(bt);zt.nodes.splice(yi,1);var Ir=0,ss=0;f.forEach(function(Ar){var pr=Ar.source,Na=Ar.target,Tr=E[pr].node.clusterId,ai=E[Na].node.clusterId;(Tr===$t.id&&ai!==$t.id||ai===$t.id&&Tr!==$t.id)&&(Ir=Ir+(Ar[n]||1)),(Tr===$e&&ai!==$e||ai===$e&&Tr!==$e)&&(ss=ss+(Ar[n]||1))}),$t.sumTot=Ir,zt.sumTot=ss}})}var ct={},ft=0;Object.keys($).forEach(function(bt){var Pt=$[bt];if(!Pt.nodes||!Pt.nodes.length){delete $[bt];return}var zt=String(ft+1);zt!==bt&&(Pt.id=zt,Pt.nodes=Pt.nodes.map(function(Ut){return{id:Ut.id,clusterId:zt}}),$[zt]=Pt,ct[bt]=zt,delete $[bt],ft++)}),J.forEach(function(bt){var Pt=bt.node,zt=bt.clusterId;Pt&&(Pt.clusterId=zt,Pt.clusterId&&ct[Pt.clusterId]&&(Pt.clusterId=ct[Pt.clusterId]))});var Nt=[],Ct={};f.forEach(function(bt){var Pt=bt.source,zt=bt.target,Ut=bt[n]||1,$t=E[Pt].node.clusterId,re=E[zt].node.clusterId;if(!(!$t||!re)){var ce="".concat($t,"---").concat(re);if(Ct[ce])Ct[ce].weight+=Ut,Ct[ce].count++;else{var le={source:$t,target:re,weight:Ut,count:1};Ct[ce]=le,Nt.push(le)}}});var gt=[];return Object.keys($).forEach(function(bt){gt.push($[bt])}),{clusters:gt,clusterEdges:Nt}},oy=zC,jC=function(t,e,n,i,a,s,o,l){return e===void 0&&(e=!1),n===void 0&&(n="weight"),i===void 0&&(i=1e-4),a===void 0&&(a=void 0),s===void 0&&(s=[]),o===void 0&&(o=["id"]),l===void 0&&(l=1),oy(t,e,n,i,!0,a,s,o,l)},GC=jC,WC=function(t,e){var n;e===void 0&&(e=1);for(var i=El(t),a=i.nodes,s=a===void 0?[]:a,o=i.edges,l=o===void 0?[]:o,c=function(){var d=Df({nodes:s,edges:l}),f=Object.keys(d);f.sort(function(p,y){var b,E;return((b=d[p])===null||b===void 0?void 0:b.degree)-((E=d[y])===null||E===void 0?void 0:E.degree)});var v=f[0];if(!s.length||((n=d[v])===null||n===void 0?void 0:n.degree)>=e)return"break";var g=s.findIndex(function(p){return p.id===v});s.splice(g,1),l=l.filter(function(p){return!(p.source===v||p.target===v)})};;){var u=c();if(u==="break")break}return{nodes:s,edges:l}},ZC=WC,ly=function(t,e,n){var i=[];switch(t){case Gi.EuclideanDistance:i=e[n];break;default:i=[];break}return i},VC=function(t,e,n,i,a,s){e===void 0&&(e=3),n===void 0&&(n=void 0),i===void 0&&(i=[]),a===void 0&&(a=["id"]),s===void 0&&(s=Gi.EuclideanDistance);var o=t.nodes,l=o===void 0?[]:o,c=t.edges,u=c===void 0?[]:c,h={clusters:[{id:"0",nodes:l}],clusterEdges:[]};if(s===Gi.EuclideanDistance&&!l.every(function(zt){return zt.hasOwnProperty(n)}))return h;var d=[],f=[];if(s===Gi.EuclideanDistance&&(d=uu(l,n),f=hu(d,i,a)),!f.length)return h;for(var v=zf(f.map(function(zt){return zt.join("")})),g=Math.min(e,l.length,v.length),p=0;p<l.length;p++)l[p].originIndex=p;for(var y=[],b=[],E=[],p=0;p<g;p++)if(p===0){var O=Math.floor(Math.random()*l.length);switch(s){case Gi.EuclideanDistance:y[p]=f[O];break;default:y[p]=[];break}b.push(O),E[p]=[l[O]],l[O].clusterId=String(p)}else{for(var k=-1/0,P=0,F=function($t){if(!b.includes($t)){for(var re=0,ce=0;ce<y.length;ce++){var le=0;switch(s){case Gi.EuclideanDistance:le=Vf(f[l[$t].originIndex],y[ce],s);break;default:break}re+=le}var Ee=re/y.length;Ee>k&&!y.find(function(Ne){return TC(Ne,ly(s,f,l[$t].originIndex))})&&(k=Ee,P=$t)}},B=0;B<l.length;B++)F(B);y[p]=ly(s,f,P),b.push(P),E[p]=[l[P]],l[P].clusterId=String(p)}for(var V=0;;){for(var p=0;p<l.length;p++){var U=0,J=1/0;if(!(V===0&&b.includes(p))){for(var $=0;$<y.length;$++){var at=0;switch(s){case Gi.EuclideanDistance:at=Vf(f[p],y[$],s);break;default:break}at<J&&(J=at,U=$)}if(l[p].clusterId!==void 0)for(var ct=E[Number(l[p].clusterId)].length-1;ct>=0;ct--)E[Number(l[p].clusterId)][ct].id===l[p].id&&E[Number(l[p].clusterId)].splice(ct,1);l[p].clusterId=String(U),E[U].push(l[p])}}for(var ft=!1,p=0;p<E.length;p++){for(var Nt=E[p],Ct=new Pi([]),$=0;$<Nt.length;$++)Ct=Ct.add(new Pi(f[Nt[$].originIndex]));var gt=Ct.avg(Nt.length);gt.equal(new Pi(y[p]))||(ft=!0,y[p]=gt.getArr())}if(V++,l.every(function(zt){return zt.clusterId!==void 0})&&ft||V>=1e3)break}var bt=[],Pt={};return u.forEach(function(zt){var Ut,$t,re=zt.source,ce=zt.target,le=(Ut=l.find(function(He){return He.id===re}))===null||Ut===void 0?void 0:Ut.clusterId,Ee=($t=l.find(function(He){return He.id===ce}))===null||$t===void 0?void 0:$t.clusterId,Ne="".concat(le,"---").concat(Ee);if(Pt[Ne])Pt[Ne].count++;else{var We={source:le,target:Ee,count:1};Pt[Ne]=We,bt.push(We)}}),{clusters:E,clusterEdges:bt}},UC=VC,YC=function(t,e){var n=new Pi(e),i=n.norm2(),a=new Pi(t),s=a.norm2(),o=n.dot(a),l=i*s,c=l?o/l:0;return c},cy=YC,HC=function(t,e,n,i,a){t===void 0&&(t=[]),n===void 0&&(n=void 0),i===void 0&&(i=[]),a===void 0&&(a=[]);var s=El(t.filter(function(d){return d.id!==e.id})),o=t.findIndex(function(d){return d.id===e.id}),l=uu(t,n),c=hu(l,i,a),u=c[o],h=[];return s.forEach(function(d,f){if(d.id!==e.id){var v=c[f],g=cy(v,u);h.push(g),d.cosineSimilarity=g}}),s.sort(function(d,f){return f.cosineSimilarity-d.cosineSimilarity}),{allCosineSimilarity:h,similarNodes:s}},XC=HC,KC=function(){function r(t){this.count=t.length,this.parent={};for(var e=0,n=t;e<n.length;e++){var i=n[e];this.parent[i]=i}}return r.prototype.find=function(t){for(;this.parent[t]!==t;)t=this.parent[t];return t},r.prototype.union=function(t,e){var n=this.find(t),i=this.find(e);n!==i&&(n<i?(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]))},r.prototype.connected=function(t,e){return this.find(t)===this.find(e)},r}(),QC=KC,qC=function(t,e){return t-e},JC=function(){function r(t){t===void 0&&(t=qC),this.compareFn=t,this.list=[]}return r.prototype.getLeft=function(t){return 2*t+1},r.prototype.getRight=function(t){return 2*t+2},r.prototype.getParent=function(t){return t===0?null:Math.floor((t-1)/2)},r.prototype.isEmpty=function(){return this.list.length<=0},r.prototype.top=function(){return this.isEmpty()?void 0:this.list[0]},r.prototype.delMin=function(){var t=this.top(),e=this.list.pop();return this.list.length>0&&(this.list[0]=e,this.moveDown(0)),t},r.prototype.insert=function(t){if(t!==null){this.list.push(t);var e=this.list.length-1;return this.moveUp(e),!0}return!1},r.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)}},r.prototype.moveDown=function(t){var e,n=t,i=this.getLeft(t),a=this.getRight(t),s=this.list.length;i!==null&&i<s&&this.compareFn(this.list[n],this.list[i])>0?n=i:a!==null&&a<s&&this.compareFn(this.list[n],this.list[a])>0&&(n=a),t!==n&&(e=[this.list[n],this.list[t]],this.list[t]=e[0],this.list[n]=e[1],this.moveDown(n))},r}(),$C=JC,tN=function(t,e){var n=[],i=t.nodes,a=i===void 0?[]:i,s=t.edges,o=s===void 0?[]:s;if(a.length===0)return n;var l=a[0],c=new Set;c.add(l);var u=function(p,y){return e?p.weight-y.weight:0},h=new $C(u);for(au(l.id,o).forEach(function(g){h.insert(g)});!h.isEmpty();){var d=h.delMin(),f=d.source,v=d.target;c.has(f)&&c.has(v)||(n.push(d),c.has(f)||(c.add(f),au(f,o).forEach(function(g){h.insert(g)})),c.has(v)||(c.add(v),au(v,o).forEach(function(g){h.insert(g)})))}return n},uy=function(t,e){var n=[],i=t.nodes,a=i===void 0?[]:i,s=t.edges,o=s===void 0?[]:s;if(a.length===0)return n;var l=o.map(function(f){return f});e&&l.sort(function(f,v){return f.weight-v.weight});for(var c=new QC(a.map(function(f){return f.id}));l.length>0;){var u=l.shift(),h=u.source,d=u.target;c.connected(h,d)||(n.push(u),c.union(h,d))}return n},eN=function(t,e,n){var i={prim:tN,kruskal:uy};return n?i[n](t,e):uy(t,e)},nN=eN,rN=function(t,e,n){typeof e!="number"&&(e=1e-6),typeof n!="number"&&(n=.85);for(var i=1,a=0,s=1e3,o=t.nodes,l=o===void 0?[]:o,c=t.edges,u=c===void 0?[]:c,h=l.length,d,f={},v={},g=0;g<h;++g){var p=l[g],y=p.id;f[y]=1/h,v[y]=1/h}for(var b=Df(t);s>0&&i>e;){a=0;for(var g=0;g<h;++g){var p=l[g],y=p.id;if(d=0,b[p.id].inDegree===0)f[y]=0;else{for(var E=ki(y,u,"source"),O=0;O<E.length;++O){var k=E[O],P=b[k].outDegree;P>0&&(d+=v[k]/P)}f[y]=n*d,a+=f[y]}}a=(1-a)/h,i=0;for(var g=0;g<h;++g){var p=l[g],y=p.id;d=f[y]+a,i+=Math.abs(d-v[y]),v[y]=d}s-=1}return v},hy=rN,iN=-1,du=-1,dy="-1",ca="-1",fy=-1,m7="-1",vy=function(){function r(t,e,n,i){t===void 0&&(t=iN),e===void 0&&(e=du),n===void 0&&(n=du),i===void 0&&(i=dy),this.id=t,this.from=e,this.to=n,this.label=i}return r}(),aN=function(){function r(t,e){t===void 0&&(t=du),e===void 0&&(e=ca),this.id=t,this.label=e,this.edges=[],this.edgeMap={}}return r.prototype.addEdge=function(t){this.edges.push(t),this.edgeMap[t.id]=t},r}(),gy=function(){function r(t,e,n){t===void 0&&(t=du),e===void 0&&(e=!0),n===void 0&&(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 r.prototype.getNodeNum=function(){return this.nodes.length},r.prototype.addNode=function(t,e){if(!this.nodeMap[t]){var n=new aN(t,e);this.nodes.push(n),this.nodeMap[t]=n,this.nodeLabelMap[e]||(this.nodeLabelMap[e]=[]),this.nodeLabelMap[e].push(t)}},r.prototype.addEdge=function(t,e,n,i){if((this.edgeIdAutoIncrease||t===void 0)&&(t=this.counter++),!(this.nodeMap[e]&&this.nodeMap[n]&&this.nodeMap[n].edgeMap[t])){var a=new vy(t,e,n,i);if(this.edges.push(a),this.edgeMap[t]=a,this.nodeMap[e].addEdge(a),this.edgeLabelMap[i]||(this.edgeLabelMap[i]=[]),this.edgeLabelMap[i].push(a),!this.directed){var s=new vy(t,n,e,i);this.nodeMap[n].addEdge(s),this.edgeLabelMap[i].push(s)}}},r}(),Rs=function(){function r(t,e,n,i,a){this.fromNode=t,this.toNode=e,this.nodeEdgeNodeLabel={nodeLabel1:n||ca,edgeLabel:i||dy,nodeLabel2:a||ca}}return r.prototype.equalTo=function(t){return this.fromNode===t.formNode&&this.toNode===t.toNode&&this.nodeEdgeNodeLabel===t.nodeEdgeNodeLabel},r.prototype.notEqualTo=function(t){return!this.equalTo(t)},r}(),py=function(){function r(){this.rmpath=[],this.dfsEdgeList=[]}return r.prototype.equalTo=function(t){var e=this.dfsEdgeList.length,n=t.length;if(e!==n)return!1;for(var i=0;i<e;i++)if(this.dfsEdgeList[i]!==t[i])return!1;return!0},r.prototype.notEqualTo=function(t){return!this.equalTo(t)},r.prototype.pushBack=function(t,e,n,i,a){return this.dfsEdgeList.push(new Rs(t,e,n,i,a)),this.dfsEdgeList},r.prototype.toGraph=function(t,e){t===void 0&&(t=fy),e===void 0&&(e=!1);var n=new gy(t,!0,e);return this.dfsEdgeList.forEach(function(i){var a=i.fromNode,s=i.toNode,o=i.nodeEdgeNodeLabel,l=o.nodeLabel1,c=o.edgeLabel,u=o.nodeLabel2;l!==ca&&n.addNode(a,l),u!==ca&&n.addNode(s,u),l!==ca&&u!==l&&n.addEdge(void 0,a,s,c)}),n},r.prototype.buildRmpath=function(){this.rmpath=[];for(var t=void 0,e=this.dfsEdgeList.length,n=e-1;n>=0;n--){var i=this.dfsEdgeList[n],a=i.fromNode,s=i.toNode;a<s&&(t===void 0||s===t)&&(this.rmpath.push(n),t=a)}return this.rmpath},r.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},r}(),fu=function(){function r(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 r.prototype.hasNode=function(t){return this.nodesUsed[t.id]===1},r.prototype.hasEdge=function(t){return this.edgesUsed[t.id]===1},r}(),sN=function(){function r(t){var e=t.graphs,n=t.minSupport,i=n===void 0?2:n,a=t.minNodeNum,s=a===void 0?1:a,o=t.maxNodeNum,l=o===void 0?4:o,c=t.top,u=c===void 0?10:c,h=t.directed,d=h===void 0?!1:h,f=t.verbose,v=f===void 0?!1:f;this.graphs=e,this.dfsCode=new py,this.support=0,this.frequentSize1Subgraphs=[],this.frequentSubgraphs=[],this.minSupport=i,this.top=u,this.directed=d,this.counter=0,this.maxNodeNum=l,this.minNodeNum=s,this.verbose=v,this.maxNodeNum<this.minNodeNum&&(this.maxNodeNum=this.minNodeNum),this.reportDF=[]}return r.prototype.findForwardRootEdges=function(t,e){var n=this,i=[],a=t.nodeMap;return e.edges.forEach(function(s){(n.directed||e.label<=a[s.to].label)&&i.push(s)}),i},r.prototype.findBackwardEdge=function(t,e,n,i){if(!this.directed&&e===n)return null;for(var a=t.nodeMap,s=a[n.to],o=s.edges,l=o.length,c=0;c<l;c++){var u=o[c];if(!(i.hasEdge(u)||u.to!==e.from)){if(this.directed){if(a[e.from].label<a[n.to].label||a[e.from].label===a[n.to].label&&e.label<=u.label)return u}else if(e.label<u.label||e.label===u.label&&a[e.to].label<=a[n.to].label)return u}}return null},r.prototype.findForwardPureEdges=function(t,e,n,i){for(var a=[],s=e.to,o=t.nodeMap[s].edges,l=o.length,c=0;c<l;c++){var u=o[c],h=t.nodeMap[u.to];n<=h.label&&!i.hasNode(h)&&a.push(u)}return a},r.prototype.findForwardRmpathEdges=function(t,e,n,i){for(var a=[],s=t.nodeMap,o=s[e.to].label,l=s[e.from],c=l.edges,u=c.length,h=0;h<u;h++){var d=c[h],f=s[d.to].label;e.to===d.to||n>f||i.hasNode(s[d.to])||(e.label<d.label||e.label===d.label&&o<=f)&&a.push(d)}return a},r.prototype.getSupport=function(t){var e={};return t.forEach(function(n){e[n.graphId]||(e[n.graphId]=!0)}),Object.keys(e).length},r.prototype.findMinLabel=function(t){var e=void 0;return Object.keys(t).forEach(function(n){var i=t[n],a=i.nodeLabel1,s=i.edgeLabel,o=i.nodeLabel2;if(!e){e={nodeLabel1:a,edgeLabel:s,nodeLabel2:o};return}(a<e.nodeLabel1||a===e.nodeLabel1&&s<e.edgeLabel||a===e.nodeLabel1&&s===e.edgeLabel&&o<e.nodeLabel2)&&(e={nodeLabel1:a,edgeLabel:s,nodeLabel2:o})}),e},r.prototype.isMin=function(){var t=this,e=this.dfsCode;if(this.verbose&&console.log("isMin checking",e),e.dfsEdgeList.length===1)return!0;var n=this.directed,i=e.toGraph(fy,n),a=i.nodeMap,s=new py,o={};i.nodes.forEach(function(h){var d=t.findForwardRootEdges(i,h);d.forEach(function(f){var v=a[f.to],g="".concat(h.label,"-").concat(f.label,"-").concat(v.label);o[g]||(o[g]={projected:[],nodeLabel1:h.label,edgeLabel:f.label,nodeLabel2:v.label});var p={graphId:i.id,edge:f,preNode:null};o[g].projected.push(p)})});var l=this.findMinLabel(o);if(l){s.dfsEdgeList.push(new Rs(0,1,l.nodeLabel1,l.edgeLabel,l.nodeLabel2));var c=function h(d){for(var f=s.buildRmpath(),v=s.dfsEdgeList[0].nodeEdgeNodeLabel.nodeLabel1,g=s.dfsEdgeList[f[0]].toNode,p={},y=!1,b=0,E=n?-1:0,O=function(Ct){if(y)return"break";d.forEach(function(gt){var bt=new fu(gt),Pt=t.findBackwardEdge(i,bt.edges[f[Ct]],bt.edges[f[0]],bt);Pt&&(p[Pt.label]||(p[Pt.label]={projected:[],edgeLabel:Pt.label}),p[Pt.label].projected.push({graphId:i.id,edge:p,preNode:gt}),b=s.dfsEdgeList[f[Ct]].fromNode,y=!0)})},k=f.length-1;k>E;k--){var P=O(k);if(P==="break")break}if(y){var F=t.findMinLabel(p);s.dfsEdgeList.push(new Rs(g,b,ca,F.edgeLabel,ca));var B=s.dfsEdgeList.length-1;return t.dfsCode.dfsEdgeList[B]!==s.dfsEdgeList[B]?!1:h(p[F.edgeLabel].projected)}var V={};y=!1;var U=0;d.forEach(function(Nt){var Ct=new fu(Nt),gt=t.findForwardPureEdges(i,Ct.edges[f[0]],v,Ct);gt.length>0&&(y=!0,U=g,gt.forEach(function(bt){var Pt="".concat(bt.label,"-").concat(a[bt.to].label);V[Pt]||(V[Pt]={projected:[],edgeLabel:bt.label,nodeLabel2:a[bt.to].label}),V[Pt].projected.push({graphId:i.id,edge:bt,preNode:Nt})}))});for(var J=f.length,$=function(Ct){if(y)return"break";var gt=f[Ct];d.forEach(function(bt){var Pt=new fu(bt),zt=t.findForwardRmpathEdges(i,Pt.edges[gt],v,Pt);zt.length>0&&(y=!0,U=s.dfsEdgeList[gt].fromNode,zt.forEach(function(Ut){var $t="".concat(Ut.label,"-").concat(a[Ut.to].label);V[$t]||(V[$t]={projected:[],edgeLabel:Ut.label,nodeLabel2:a[Ut.to].label}),V[$t].projected.push({graphId:i.id,edge:Ut,preNode:bt})}))})},k=0;k<J;k++){var at=$(k);if(at==="break")break}if(!y)return!0;var ct=t.findMinLabel(V);s.dfsEdgeList.push(new Rs(U,g+1,ca,ct.edgeLabel,ct.nodeLabel2));var ft=s.dfsEdgeList.length-1;return e.dfsEdgeList[ft]!==s.dfsEdgeList[ft]?!1:h(V["".concat(ct.edgeLabel,"-").concat(ct.nodeLabel2)].projected)},u="".concat(l.nodeLabel1,"-").concat(l.edgeLabel,"-").concat(l.nodeLabel2);return c(o[u].projected)}},r.prototype.report=function(){if(!(this.dfsCode.getNodeNum()<this.minNodeNum)){this.counter++;var t=this.dfsCode.toGraph(this.counter,this.directed);this.frequentSubgraphs.push(El(t))}},r.prototype.subGraphMining=function(t){var e=this,n=this.getSupport(t);if(!(n<this.minSupport)&&this.isMin()){this.report();var i=this.dfsCode.getNodeNum(),a=this.dfsCode.buildRmpath(),s=this.dfsCode.dfsEdgeList[a[0]].toNode,o=this.dfsCode.dfsEdgeList[0].nodeEdgeNodeLabel.nodeLabel1,l={},c={};t.forEach(function(u){for(var h=e.graphs[u.graphId],d=h.nodeMap,f=new fu(u),v=a.length-1;v>=0;v--){var g=e.findBackwardEdge(h,f.edges[a[v]],f.edges[a[0]],f);if(g){var p="".concat(e.dfsCode.dfsEdgeList[a[v]].fromNode,"-").concat(g.label);c[p]||(c[p]={projected:[],toNodeId:e.dfsCode.dfsEdgeList[a[v]].fromNode,edgeLabel:g.label}),c[p].projected.push({graphId:u.graphId,edge:g,preNode:u})}}if(!(i>=e.maxNodeNum)){var y=e.findForwardPureEdges(h,f.edges[a[0]],o,f);y.forEach(function(E){var O="".concat(s,"-").concat(E.label,"-").concat(d[E.to].label);l[O]||(l[O]={projected:[],fromNodeId:s,edgeLabel:E.label,nodeLabel2:d[E.to].label}),l[O].projected.push({graphId:u.graphId,edge:E,preNode:u})});for(var b=function(O){var k=e.findForwardRmpathEdges(h,f.edges[a[O]],o,f);k.forEach(function(P){var F="".concat(e.dfsCode.dfsEdgeList[a[O]].fromNode,"-").concat(P.label,"-").concat(d[P.to].label);l[F]||(l[F]={projected:[],fromNodeId:e.dfsCode.dfsEdgeList[a[O]].fromNode,edgeLabel:P.label,nodeLabel2:d[P.to].label}),l[F].projected.push({graphId:u.graphId,edge:P,preNode:u})})},v=0;v<a.length;v++)b(v)}}),Object.keys(c).forEach(function(u){var h=c[u],d=h.toNodeId,f=h.edgeLabel;e.dfsCode.dfsEdgeList.push(new Rs(s,d,"-1",f,"-1")),e.subGraphMining(c[u].projected),e.dfsCode.dfsEdgeList.pop()}),Object.keys(l).forEach(function(u){var h=l[u],d=h.fromNodeId,f=h.edgeLabel,v=h.nodeLabel2;e.dfsCode.dfsEdgeList.push(new Rs(d,s+1,ca,f,v)),e.subGraphMining(l[u].projected),e.dfsCode.dfsEdgeList.pop()})}},r.prototype.generate1EdgeFrequentSubGraphs=function(){var t=this.graphs,e=this.directed,n=this.minSupport,i=this.frequentSize1Subgraphs,a={},s={},o={},l={};return Object.keys(t).forEach(function(c){var u=t[c],h=u.nodeMap;u.nodes.forEach(function(d,f){var v=d.label,g="".concat(c,"-").concat(v);if(!o[g]){var p=a[v]||0;p++,a[v]=p}o[g]={graphKey:c,label:v},d.edges.forEach(function(y){var b=v,E=h[y.to].label;if(!e&&b>E){var O=E;E=b,b=O}var k=y.label,P="".concat(c,"-").concat(b,"-").concat(k,"-").concat(E),F="".concat(b,"-").concat(k,"-").concat(E);if(!s[F]){var B=s[F]||0;B++,s[F]=B}l[P]={graphId:c,nodeLabel1:b,edgeLabel:k,nodeLabel2:E}})})}),Object.keys(a).forEach(function(c){var u=a[c];if(!(u<n)){var h={nodes:[],edges:[]};h.nodes.push({id:"0",label:c}),i.push(h)}}),i},r.prototype.run=function(){var t=this;if(this.frequentSize1Subgraphs=this.generate1EdgeFrequentSubGraphs(),!(this.maxNodeNum<2)){var e=this.graphs,n=this.directed,i={};Object.keys(e).forEach(function(a){var s=e[a],o=s.nodeMap;s.nodes.forEach(function(l){var c=t.findForwardRootEdges(s,l);c.forEach(function(u){var h=o[u.to],d="".concat(l.label,"-").concat(u.label,"-").concat(h.label);i[d]||(i[d]={projected:[],nodeLabel1:l.label,edgeLabel:u.label,nodeLabel2:h.label});var f={graphId:a,edge:u,preNode:null};i[d].projected.push(f)})})}),Object.keys(i).forEach(function(a){var s=i[a],o=s.projected,l=s.nodeLabel1,c=s.edgeLabel,u=s.nodeLabel2;t.dfsCode.dfsEdgeList.push(new Rs(0,1,l,c,u)),t.subGraphMining(o),t.dfsCode.dfsEdgeList.pop()})}},r}(),oN=function(t,e,n,i){var a={};return Object.keys(t).forEach(function(s,o){var l=t[s],c=new gy(o,!0,e),u={};l.nodes.forEach(function(h,d){c.addNode(d,h[n]),u[h.id]=d}),l.edges.forEach(function(h,d){var f=u[h.source],v=u[h.target];c.addEdge(-1,f,v,h[i])}),c&&c.getNodeNum()&&(a[c.id]=c)}),a},lN=function(t,e,n){var i=[];return t.forEach(function(a){var s={nodes:[],edges:[]};a.nodes.forEach(function(o){var l;s.nodes.push((l={id:"".concat(o.id)},l[e]=o.label,l))}),a.edges.forEach(function(o){var l;s.edges.push((l={source:"".concat(o.from),target:"".concat(o.to)},l[n]=o.label,l))}),i.push(s)}),i},my="cluster",cN=function(t){var e=t.graphs,n=t.directed,i=n===void 0?!1:n,a=t.nodeLabelProp,s=a===void 0?my:a,o=t.edgeLabelProp,l=o===void 0?my:o,c=oN(e,i,s,l),u=t.minSupport,h=t.maxNodeNum,d=t.minNodeNum,f=t.verbose,v=t.top,g={graphs:c,minSupport:u,maxNodeNum:h,minNodeNum:d,top:v,verbose:f,directed:i},p=new sN(g);p.run();var y=lN(p.frequentSubgraphs,s,l);return y},uN=cN,yy=function(t,e,n,i){n===void 0&&(n="cluster"),i===void 0&&(i=2);var a=[],s=t.nodes;return e.forEach(function(o,l){a.push(by(s,o,l,n,i))}),a},by=function(t,e,n,i,a){var s=[n],o=[],l={};return e.forEach(function(c,u){if(c<=a&&n!==u){s.push(u),o.push(t[u]);var h=t[u][i];l[h]?(l[h].count++,l[h].dists.push(c)):l[h]={count:1,dists:[c]}}}),Object.keys(l).forEach(function(c){l[c].dists=l[c].dists.sort(function(u,h){return u-h})}),{nodeIdx:n,nodeId:t[n].id,nodeIdxs:s,neighbors:o,neighborNum:s.length-1,nodeLabelCountMap:l}},hN=function(t,e,n,i,a){var s=Math.ceil(n/e),o={},l=0;return i.forEach(function(c,u){for(var h=0,d=0,f=c.nodeIdxs,v=c.neighborNum-1;h<s;){for(var g=f[1+Math.floor(Math.random()*v)],p=0;(o["".concat(u,"-").concat(g)]||o["".concat(g,"-").concat(u)])&&(g=Math.floor(Math.random()*e),p++,!(p>2*e)););if(p<2*e&&(o["".concat(u,"-").concat(g)]={start:u,end:g,distance:a[u][g]},h++,l++,l>=n))return o;if(d++,d>2*e)break}if(h<s){var y=s-h;s=(s+y)/(e-u-1)}}),o},vu=function(t,e,n,i){var a=n.nodes;return i||(i={}),Object.keys(t).forEach(function(s){var o,l;if(!(i&&i[s])){i[s]={nodes:[],edges:[]};var c=t[s],u=(o=e[c.start])===null||o===void 0?void 0:o.nodeIdxs,h=(l=e[c.end])===null||l===void 0?void 0:l.nodeIdxs;if(!(!u||!h)){var d=new Set(h),f=u.filter(function(b){return d.has(b)});if(!(!f||!f.length)){for(var v={},g=f.length,p=0;p<g;p++){var y=a[f[p]];i[s].nodes.push(y),v[y.id]=!0}n.edges.forEach(function(b){v[b.source]&&v[b.target]&&i[s].edges.push(b)})}}}}),i},gu=function(t,e,n,i){var a,s,o={};t.nodes.forEach(function(c){o[c.id]=c});var l=0;return!(!((a=e==null?void 0:e.edges)===null||a===void 0)&&a.length)||((s=e==null?void 0:e.nodes)===null||s===void 0?void 0:s.length)<2?0:(t.edges.forEach(function(c){var u=o[c.source][n],h=o[c.target][n],d=e==null?void 0:e.nodes[0][n],f=e==null?void 0:e.nodes[1][n],v=e==null?void 0:e.edges[0][i];c[i]===v&&(u===d&&h===f||u===f&&h===d)&&l++}),l)},dN=function(t,e,n){for(var i=1/0,a=0,s=function(c){var u=t[c],h=Object.keys(u).sort(function(b,E){return u[b]-u[E]}),d=10,f=[];h.forEach(function(b,E){f[E%d]||(f[E%d]={graphs:[],totalCount:0,aveCount:0}),f[E%d].graphs.push(b),f[E%d].totalCount+=u[b]});var v=0,g=[];f.forEach(function(b){var E=b.totalCount/b.graphs.length;b.aveCount=E,g.push(E);var O=0,k=b.length;b.graphs.forEach(function(P,F){var B=u[P];b.graphs.forEach(function(V,U){F!==U&&(O+=Math.abs(B-u[V]))})}),O/=k*(k-1)/2,v+=O}),v/=f.length;var p=0;g.forEach(function(b,E){g.forEach(function(O,k){E!==k&&(p+=Math.abs(b-O))}),p/=g.length*(g.length-1)/2});var y=p-v;i<y&&(i=y,a=c)},o=0;o<e;o++)s(o);return{structure:n[a],structureCountMap:t[a]}},xy=function(t,e){var n={},i={};return t.forEach(function(a,s){n[a.id]={idx:s,node:a,degree:0,inDegree:0,outDegree:0};var o=a[e];i[o]||(i[o]=[]),i[o].push(a)}),{nodeMap:n,nodeLabelMap:i}},Ey=function(t,e,n){var i={},a={};return t.forEach(function(s,o){i["".concat(Zm)]={idx:o,edge:s};var l=s[e];a[l]||(a[l]=[]),a[l].push(s);var c=n[s.source];c&&(c.degree++,c.outDegree++);var u=n[s.target];u&&(u.degree++,u.inDegree++)}),{edgeMap:i,edgeLabelMap:a}},wy=function(t,e,n){var i=e.length,a={};return e.forEach(function(s,o){for(var l=n?0:o+1,c=t[o].id,u=l;u<i;u++)if(o!==u){var h=t[u].id,d=s[u];a["".concat(c,"-").concat(h)]=d,n||(a["".concat(h,"-").concat(c)]=d)}}),a},fN=function(t,e,n,i,a,s,o,l,c,u,h){var d,f="".concat(e.id,"-").concat(n.id);if(u&&u[f])return u[f];var v=h?h[f]:void 0;if(!v){var g=(d={},d[f]={start:i[e.id].idx,end:i[n.id].idx,distance:a},d);h=vu(g,s,t,h),v=h[f]}return gu(v,o,l,c)},Sy=function(t,e,n,i){var a,s,o,l=(a=t[e])===null||a===void 0?void 0:a.degree,c=(s=t[e])===null||s===void 0?void 0:s.inDegree,u=(o=t[e])===null||o===void 0?void 0:o.outDegree;return t[e]===void 0&&(l=1/0,c=1/0,u=1/0,i[e].forEach(function(h){var d=n[h.id].degree;l>d&&(l=d);var f=n[h.id].inDegree;c>f&&(c=f);var v=n[h.id].outDegree;u>v&&(u=v)}),t[e]={degree:l,inDegree:c,outDegree:u}),{minPatternNodeLabelDegree:l,minPatternNodeLabelInDegree:c,minPatternNodeLabelOutDegree:u}},vN=function(t,e,n,i,a,s,o){var l;if(n===void 0&&(n=!1),s===void 0&&(s="cluster"),o===void 0&&(o="cluster"),!(!t||!t.nodes)){var c=t.nodes.length;if(c){var u=Zf(t,n),h=Zf(e,n),d=wy(t.nodes,u,n),f=wy(e.nodes,h,n),v=xy(t.nodes,s),g=v.nodeMap,p=v.nodeLabelMap,y=xy(e.nodes,s),b=y.nodeMap,E=y.nodeLabelMap;Ey(t.edges,o,g);var O=Ey(e.edges,o,b).edgeLabelMap,k=[];h==null||h.forEach(function(je){k=k.concat(je)}),a||(a=Math.max.apply(Math,(0,Z.ev)((0,Z.ev)([],k,!1),[2],!1))),i||(i=a);var P=yy(t,u,s,i),F=yy(e,h,s,i),B=Math.min(100,c*(c-1)/2),V=hN(i,c,B,P,u),U=vu(V,P,t),J=10,$=1,at=1,ct=4,ft={graphs:U,nodeLabelProp:s,edgeLabelProp:o,minSupport:$,minNodeNum:at,maxNodeNum:ct,directed:n},Nt=uN(ft).slice(0,J),Ct=Nt.length,gt=[];Nt.forEach(function(je,tn){gt[tn]={},Object.keys(U).forEach(function(Ge){var Ke=U[Ge],on=gu(Ke,je,s,o);gt[tn][Ge]=on})});var bt=dN(gt,Ct,Nt),Pt=bt.structure,zt=bt.structureCountMap,Ut=e.nodes[0],$t=[],re=(l=e.nodes[0])===null||l===void 0?void 0:l[s],ce=-1/0;e.nodes.forEach(function(je){var tn=je[s],Ge=p[tn];(Ge==null?void 0:Ge.length)>ce&&(ce=Ge.length,$t=Ge,re=tn,Ut=je)});var le={},Ee={},Ne={},We={},He={},cr={};Object.keys(E).forEach(function(je,tn){He[je]=[],n&&(cr[je]=[]);var Ge=-1/0,Ke=E[je],on={};Ke.forEach(function(nn){var qe=f["".concat(Ut.id,"-").concat(nn.id)];if(qe&&He[je].push(qe),Ge<qe&&(Ge=qe),on["".concat(Ut.id,"-").concat(nn.id)]={start:0,end:b[nn.id].idx,distance:qe},n){var Fn=f["".concat(nn.id,"-").concat(Ut.id)];Fn&&cr[je].push(Fn)}}),He[je]=He[je].sort(function(nn,qe){return nn-qe}),n&&(cr[je]=cr[je].sort(function(nn,qe){return nn-qe})),Ee=vu(on,F,e,Ee);var pe=[];if(Object.keys(on).forEach(function(nn){if(Ne[nn]){pe.push(Ne[nn]);return}var qe=Ee[nn];Ne[nn]=gu(qe,Pt,s,o),pe.push(Ne[nn])}),pe=pe.sort(function(nn,qe){return qe-nn}),We["".concat(Ut.id,"-").concat(je)]=pe,je!==re)for(var Qe=($t==null?void 0:$t.length)||0,en=function(qe){var Fn=$t[qe],bi=P[g[Fn.id].idx],Yn=bi.nodeLabelCountMap[je],$s=E[je].length;if(!Yn||Yn.count<$s)return $t.splice(qe,1),"continue";for(var Go=!1,Ur=0;Ur<$s;Ur++)if(Yn.dists[Ur]>He[je][Ur]){Go=!0;break}if(Go)return $t.splice(qe,1),"continue";var _i={};bi.neighbors.forEach(function(Yr){var qi=d["".concat(Fn.id,"-").concat(Yr.id)];_i["".concat(Fn.id,"-").concat(Yr.id)]={start:g[Fn.id].idx,end:g[Yr.id].idx,distance:qi}}),U=vu(_i,P,t,U);var va=[];Object.keys(_i).forEach(function(Yr){if(zt[Yr]){va.push(zt[Yr]);return}var qi=U[Yr];zt[Yr]=gu(qi,Pt,s,o),va.push(zt[Yr])}),va=va.sort(function(Yr,qi){return qi-Yr});for(var os=!1,Ur=0;Ur<$s;Ur++)if(va[Ur]<pe[Ur]){os=!0;break}if(os)return $t.splice(qe,1),"continue"},rr=Qe-1;rr>=0;rr--)en(rr)});var $e=[];$t==null||$t.forEach(function(je){for(var tn=g[je.id].idx,Ge=by(t.nodes,u[tn],tn,s,a),Ke=Ge.neighbors,on=Ke.length,pe=!1,Qe=on-1;Qe>=0;Qe--){if(Ke.length+1<e.nodes.length){pe=!0;return}var en=Ke[Qe],rr=en[s];if(!E[rr]||!E[rr].length){Ke.splice(Qe,1);continue}if(!He[rr]||!He[rr].length){Ke.splice(Qe,1);continue}var nn="".concat(je.id,"-").concat(en.id),qe=d[nn],Fn=He[rr].length-1,bi=He[rr][Fn];if(qe>bi){Ke.splice(Qe,1);continue}if(n){var Yn="".concat(en.id,"-").concat(je.id),$s=d[Yn];Fn=cr[rr].length-1;var Go=cr[rr][Fn];if($s>Go){Ke.splice(Qe,1);continue}}var Ur=zt[nn]?zt[nn]:fN(t,je,en,g,qe,P,Pt,s,o,zt,U),_i="".concat(Ut.id,"-").concat(rr),va=We[_i][We[_i].length-1];if(Ur<va){Ke.splice(Qe,1);continue}var os=Sy(le,rr,b,E),Yr=os.minPatternNodeLabelDegree,qi=os.minPatternNodeLabelInDegree,ka=os.minPatternNodeLabelOutDegree;if(g[en.id].degree<Yr){Ke.splice(Qe,1);continue}}pe||$e.push({nodes:[je].concat(Ke)})});var yi=cu(e,Ut.id,!1).length,Ir={};n?(Object.keys(yi).forEach(function(je){var tn=b[je].node[s];Ir[tn]?Ir[tn].push(yi[je]):Ir[tn]=[yi[je]]}),Object.keys(Ir).forEach(function(je){Ir[je].sort(function(tn,Ge){return tn-Ge})})):Ir=He;for(var ss=$e.length,Ar=function(tn){var Ge=$e[tn],Ke=Ge.nodes[0],on={},pe={};Ge.nodes.forEach(function(wn,xi){pe[wn.id]={idx:xi,node:wn,degree:0,inDegree:0,outDegree:0};var ur=wn[s];on[ur]?on[ur]++:on[ur]=1});var Qe=[],en={};t.edges.forEach(function(wn){pe[wn.source]&&pe[wn.target]&&(Qe.push(wn),en[wn[o]]?en[wn[o]]++:en[wn[o]]=1,pe[wn.source].degree++,pe[wn.target].degree++,pe[wn.source].outDegree++,pe[wn.target].inDegree++)});for(var rr=Object.keys(O).length,nn=!1,qe=0;qe<rr;qe++){var Fn=Object.keys(O)[qe];if(!en[Fn]||en[Fn]<O[Fn].length){nn=!0;break}}if(nn)return $e.splice(tn,1),"continue";var bi=Qe.length;if(bi<e.edges.length)return $e.splice(tn,1),"break";for(var Yn=!1,$s=function(xi){var ur=Qe[xi],ga=ur[o],to=O[ga];if(!to||!to.length)return en[ga]--,to&&en[ga]<to.length?(Yn=!0,"break"):(Qe.splice(xi,1),pe[ur.source].degree--,pe[ur.target].degree--,pe[ur.source].outDegree--,pe[ur.target].inDegree--,"continue");var cw=pe[ur.source].node[s],uw=pe[ur.target].node[s],K0=!1;if(to.forEach(function(hw){var dw=b[hw.source].node,fw=b[hw.target].node;dw[s]===cw&&fw[s]===uw&&(K0=!0),!n&&dw[s]===uw&&fw[s]===cw&&(K0=!0)}),!K0)return en[ga]--,to&&en[ga]<to.length?(Yn=!0,"break"):(Qe.splice(xi,1),pe[ur.source].degree--,pe[ur.target].degree--,pe[ur.source].outDegree--,pe[ur.target].inDegree--,"continue")},qe=bi-1;qe>=0;qe--){var Go=$s(qe);if(Go==="break")break}if(Yn)return $e.splice(tn,1),"continue";Ge.edges=Qe;var Ur=cu(Ge,Ge.nodes[0].id,!1).length;if(Object.keys(Ur).reverse().forEach(function(wn){if(!(wn===Ge.nodes[0].id||Yn)){if(Ur[wn]===1/0){var xi=pe[wn].node[s];if(on[xi]--,on[xi]<E[xi].length){Yn=!0;return}var ur=Ge.nodes.indexOf(pe[wn].node);Ge.nodes.splice(ur,1),pe[wn]=void 0;return}var ga=g[wn].node[s];if(!Ir[ga]||!Ir[ga].length||Ur[wn]>Ir[ga][Ir[ga].length-1]){var xi=pe[wn].node[s];if(on[xi]--,on[xi]<E[xi].length){Yn=!0;return}var ur=Ge.nodes.indexOf(pe[wn].node);Ge.nodes.splice(ur,1),pe[wn]=void 0}}}),Yn)return $e.splice(tn,1),"continue";for(var _i=!0,va=0;_i&&!Yn;){_i=!1;var os=n?pe[Ke.id].degree<b[Ut.id].degree||pe[Ke.id].inDegree<b[Ut.id].inDegree||pe[Ke.id].outDegree<b[Ut.id].outDegree:pe[Ke.id].degree<b[Ut.id].degree;if(os){Yn=!0;break}if(on[Ke[s]]<E[Ke[s]].length){Yn=!0;break}for(var Yr=Ge.nodes.length,qi=Yr-1;qi>=0;qi--){var ka=Ge.nodes[qi],ow=pe[ka.id].degree,KB=pe[ka.id].inDegree,QB=pe[ka.id].outDegree,qB=ka[s],X0=Sy(le,qB,b,E),lw=X0.minPatternNodeLabelDegree,JB=X0.minPatternNodeLabelInDegree,$B=X0.minPatternNodeLabelOutDegree,tF=n?ow<lw||KB<JB||QB<$B:ow<lw;if(tF){if(on[ka[s]]--,on[ka[s]]<E[ka[s]].length){Yn=!0;break}Ge.nodes.splice(qi,1),pe[ka.id]=void 0,_i=!0}}if(Yn||!_i&&va!==0)break;bi=Qe.length;for(var yd=bi-1;yd>=0;yd--){var Pa=Qe[yd];if(!pe[Pa.source]||!pe[Pa.target]){Qe.splice(yd,1);var bd=Pa[o];if(en[bd]--,pe[Pa.source]&&(pe[Pa.source].degree--,pe[Pa.source].outDegree--),pe[Pa.target]&&(pe[Pa.target].degree--,pe[Pa.target].inDegree--),O[bd]&&en[bd]<O[bd].length){Yn=!0;break}_i=!0}}va++}if(Yn||Yn||Ge.nodes.length<e.nodes.length||Qe.length<e.edges.length)return $e.splice(tn,1),"continue"},pr=ss-1;pr>=0;pr--){var Na=Ar(pr);if(Na==="break")break}for(var Tr=$e.length,ai=function(tn){var Ge=$e[tn],Ke={};Ge.edges.forEach(function(Qe){var en="".concat(Qe.source,"-").concat(Qe.target,"-").concat(Qe.label);Ke[en]?Ke[en]++:Ke[en]=1});for(var on=function(en){var rr=$e[en],nn={};rr.edges.forEach(function(Fn){var bi="".concat(Fn.source,"-").concat(Fn.target,"-").concat(Fn.label);nn[bi]?nn[bi]++:nn[bi]=1});var qe=!0;Object.keys(nn).length!==Object.keys(Ke).length?qe=!1:Object.keys(Ke).forEach(function(Fn){nn[Fn]!==Ke[Fn]&&(qe=!1)}),qe&&$e.splice(en,1)},pe=Tr-1;pe>tn;pe--)on(pe);Tr=$e.length},pr=0;pr<=Tr-1;pr++)ai(pr);return $e}}},gN=vN,pN=function(){function r(t){t===void 0&&(t=10),this.linkedList=new Wm,this.maxStep=t}return Object.defineProperty(r.prototype,"length",{get:function(){return this.linkedList.toArray().length},enumerable:!1,configurable:!0}),r.prototype.isEmpty=function(){return!this.linkedList.head},r.prototype.isMaxStack=function(){return this.toArray().length>=this.maxStep},r.prototype.peek=function(){return this.isEmpty()?null:this.linkedList.head.value},r.prototype.push=function(t){this.linkedList.prepend(t),this.length>this.maxStep&&this.linkedList.deleteTail()},r.prototype.pop=function(){var t=this.linkedList.deleteHead();return t?t.value:null},r.prototype.toArray=function(){return this.linkedList.toArray().map(function(t){return t.value})},r.prototype.clear=function(){for(;!this.isEmpty();)this.pop()},r}(),mN=pN,yN=Qm,y7={getAdjMatrix:iu,breadthFirstSearch:qO,connectedComponent:Um,getDegree:Df,getInDegree:$O,getOutDegree:tC,detectCycle:Qm,detectDirectedCycle:yN,detectAllCycles:rC,detectAllDirectedCycle:Km,detectAllUndirectedCycle:Xm,depthFirstSearch:Hm,dijkstra:cu,findAllPath:kC,findShortestPath:Wf,floydWarshall:Zf,labelPropagation:LC,louvain:oy,iLouvain:GC,kCore:ZC,kMeans:UC,cosineSimilarity:cy,nodesCosineSimilarity:XC,minimumSpanningTree:nN,pageRank:hy,getNeighbors:ki,Stack:mN,GADDI:gN};function At(r){if(r.id!==void 0)return r.id;if(r.source!==void 0&&r.target!==void 0)return`${r.source}-${r.target}`;throw new Error(xa("The datum does not have available id."))}function pu(r){return r.combo}function My(r,t){const e={nodes:(r.nodes||[]).map(At),edges:(r.edges||[]).map(At),combos:(r.combos||[]).map(At)};return t?Object.values(e).flat():e}const Ay=(r,t,e)=>{var n;switch(e.type){case"degree":{const i=new Map;return(n=r.nodes)===null||n===void 0||n.forEach(a=>{const s=t(At(a),e.direction).length;i.set(At(a),s)}),i}case"betweenness":return bN(r,e.directed,e.weightPropertyName);case"closeness":return xN(r,e.directed,e.weightPropertyName);case"eigenvector":return wN(r,e.directed);case"pagerank":return EN(r,e.epsilon,e.linkProb);default:return Ty(r)}},Ty=r=>{var t;const e=new Map;return(t=r.nodes)===null||t===void 0||t.forEach(n=>{e.set(At(n),0)}),e},bN=(r,t,e)=>{const n=Ty(r),{nodes:i=[]}=r;return i.forEach(a=>{i.forEach(s=>{if(a!==s){const{allPath:o}=Wf(r,At(a),At(s),t,e),l=o.length;o.flat().forEach(c=>{c!==At(a)&&c!==At(s)&&n.set(c,n.get(c)+1/l)})}})}),n},xN=(r,t,e)=>{const n=new Map,{nodes:i=[]}=r;return i.forEach(a=>{const s=i.reduce((o,l)=>{if(a!==l){const{length:c}=Wf(r,At(a),At(l),t,e);o+=c}return o},0);n.set(At(a),1/s)}),n},EN=(r,t,e)=>{var n;const i=new Map,a=hy(r,t,e);return(n=r.nodes)===null||n===void 0||n.forEach(s=>{i.set(At(s),a[At(s)])}),i},wN=(r,t)=>{const{nodes:e=[]}=r,n=SN(r,t),i=MN(n,e.length),a=new Map;return e.forEach((s,o)=>{a.set(At(s),i[o])}),a},SN=(r,t)=>{const{nodes:e=[],edges:n=[]}=r,i=Array(e.length).fill(null).map(()=>Array(e.length).fill(0));return n.forEach(({source:a,target:s})=>{const o=e.findIndex(c=>At(c)===a),l=e.findIndex(c=>At(c)===s);t?i[o][l]=1:(i[o][l]=1,i[l][o]=1)}),i},MN=(r,t,e=100,n=1e-6)=>{let i=Array(t).fill(1),a=1/0;for(let s=0;s<e&&a>n;s++){const o=Array(t).fill(0);for(let c=0;c<t;c++)for(let u=0;u<t;u++)o[c]+=r[c][u]*i[u];const l=Math.sqrt(o.reduce((c,u)=>c+u*u,0));for(let c=0;c<t;c++)o[c]/=l;a=Math.sqrt(o.reduce((c,u,h)=>c+(u-i[h])*u,0)),i=o}return i};function Ua(r,t,e,n=Wn){const i=new Map(r.map(d=>[e(d),d])),a=new Map(t.map(d=>[e(d),d])),s=new Set(i.keys()),o=new Set(a.keys()),l=[],c=[],u=[],h=[];return o.forEach(d=>{s.has(d)?n(i.get(d),a.get(d))?h.push(a.get(d)):c.push(a.get(d)):l.push(a.get(d))}),s.forEach(d=>{o.has(d)||u.push(i.get(d))}),{enter:l,exit:u,keep:h,update:c}}function Ls(r,t,e){const n=i=>{e&&!e(i)||(i.style.visibility=t)};r.forEach(i=>{n(i)})}function AN(r,t,e){const n={},i=a=>(a in n||(n[a]=0),`${t}-${a}-${n[a]++}`);return e.map(a=>typeof a=="string"?{type:a,key:i(a)}:typeof a=="function"?a.call(r):a.key?a:Object.assign(Object.assign({},a),{key:i(a.type)}))}class Yf{constructor(t){this.extensions=[],this.extensionMap={},this.context=t}setExtensions(t){const e=AN(this.context.graph,this.category,t),{enter:n,update:i,exit:a,keep:s}=Ua(this.extensions,e,o=>o.key);this.createExtensions(n),this.updateExtensions([...i,...s]),this.destroyExtensions(a),this.extensions=e}createExtension(t){const{category:e}=this,{key:n,type:i}=t,a=ba(e,i);if(!a)return ei.warn(`The extension ${i} of ${e} is not registered.`);const s=new a(this.context,t);s.initialized=!0,this.extensionMap[n]=s}createExtensions(t){t.forEach(e=>this.createExtension(e))}updateExtension(t){const{key:e}=t,n=this.extensionMap[e];n&&n.update(t)}updateExtensions(t){t.forEach(e=>this.updateExtension(e))}destroyExtension(t){const e=this.extensionMap[t];e&&(e.initialized&&!e.destroyed&&e.destroy(),delete this.extensionMap[t])}destroyExtensions(t){t.forEach(({key:e})=>this.destroyExtension(e))}destroy(){this.destroyExtensions(this.extensions),this.context={},this.extensions=[],this.extensionMap={}}}class Hf{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 di extends Hf{}class mu extends di{constructor(t,e){super(t,Object.assign({},mu.defaultOptions,e)),this.isOverlapping=(n,i)=>i.some(a=>n.intersects(a)),this.occupiedBounds=[],this.detectLabelCollision=n=>{const i=this.context.viewport,a={show:[],hide:[]};return this.occupiedBounds=[],n.forEach(s=>{const o=s.getShape("label").getRenderBounds();i.isInViewport(o,!0)&&!this.isOverlapping(o,this.occupiedBounds)?(a.show.push(s),this.occupiedBounds.push(Va(o,this.options.padding))):a.hide.push(s)}),a},this.hideLabelIfExceedViewport=(n,i)=>{const{exit:a}=Ua(n,i,s=>s.id);a==null||a.forEach(this.hideLabel)},this.nodeCentralities=new Map,this.sortNodesByCentrality=(n,i)=>{const{model:a}=this.context,s=a.getData(),o=a.getRelatedEdgesData.bind(a);return n.map(c=>(this.nodeCentralities.has(c.id)||(this.nodeCentralities=Ay(s,o,i)),{node:c,centrality:this.nodeCentralities.get(c.id)})).sort((c,u)=>u.centrality-c.centrality).map(c=>c.node)},this.sortLabelElementsInView=n=>{const{sort:i,sortNode:a,sortCombo:s,sortEdge:o}=this.options,{model:l}=this.context;if(ue(i))return n.sort((g,p)=>i(l.getElementDataById(g.id),l.getElementDataById(p.id)));const{node:c=[],edge:u=[],combo:h=[]}=nu(n,g=>g.type),d=ue(s)?h.sort((g,p)=>s(...l.getComboData([g.id,p.id]))):h,f=ue(a)?c.sort((g,p)=>a(...l.getNodeData([g.id,p.id]))):this.sortNodesByCentrality(c,a),v=ue(o)?u.sort((g,p)=>o(...l.getEdgeData([g.id,p.id]))):u;return[...d,...f,...v]},this.labelElementsInView=[],this.isFirstRender=!0,this.onToggleVisibility=n=>{var i;if(((i=n.data)===null||i===void 0?void 0:i.stage)==="zIndex")return;if(!this.validate(n)){this.hiddenElements.size>0&&(this.hiddenElements.forEach(this.showLabel),this.hiddenElements.clear());return}const a=this.isFirstRender?this.getLabelElements():this.getLabelElementsInView();this.hideLabelIfExceedViewport(this.labelElementsInView,a),this.labelElementsInView=a;const s=this.sortLabelElementsInView(this.labelElementsInView),{show:o,hide:l}=this.detectLabelCollision(s);for(let c=o.length-1;c>=0;c--)this.showLabel(o[c]);l.forEach(this.hideLabel)},this.hiddenElements=new Map,this.hideLabel=n=>{const i=n.getShape("label");i&&Ls(i,"hidden"),this.hiddenElements.set(n.id,n)},this.showLabel=n=>{const i=n.getShape("label");i&&Ls(i,"visible"),n.toFront(),this.hiddenElements.delete(n.id)},this.onTransform=zm(this.onToggleVisibility,this.options.throttle,{leading:!0}),this.enableToggle=!0,this.toggle=n=>{this.enableToggle&&this.onToggleVisibility(n)},this.onBeforeRender=()=>{this.enableToggle=!1},this.onAfterRender=n=>{this.onToggleVisibility(n),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 i=t[n];i.isVisible()&&i.getShape("label")&&e.push(i)}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(Xt.BEFORE_RENDER,this.onBeforeRender),t.on(Xt.AFTER_RENDER,this.onAfterRender),t.on(Xt.AFTER_DRAW,this.toggle),t.on(Xt.AFTER_LAYOUT,this.toggle),t.on(Xt.AFTER_TRANSFORM,this.onTransform)}unbindEvents(){const{graph:t}=this.context;t.off(Xt.BEFORE_RENDER,this.onBeforeRender),t.off(Xt.AFTER_RENDER,this.onAfterRender),t.off(Xt.AFTER_DRAW,this.toggle),t.off(Xt.AFTER_LAYOUT,this.toggle),t.off(Xt.AFTER_TRANSFORM,this.onTransform)}validate(t){if(this.destroyed)return!1;const{enable:e}=this.options;return ue(e)?e(t):!!e}destroy(){this.unbindEvents(),super.destroy()}}mu.defaultOptions={enable:!0,throttle:100,padding:0,sortNode:{type:"degree"}};var TN=function(r){if(!Cf(r)||!Lg(r,"Object"))return!1;if(Object.getPrototypeOf(r)===null)return!0;for(var t=r;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(r)===t},bo=TN,ON=5;function CN(r,t){if(Object.hasOwn)return Object.hasOwn(r,t);if(r==null)throw new TypeError("Cannot convert undefined or null to object");return Object.prototype.hasOwnProperty.call(Object(r),t)}function Oy(r,t,e,n){e=e||0,n=n||ON;for(var i in t)if(CN(t,i)){var a=t[i];a!==null&&bo(a)?(bo(r[i])||(r[i]={}),e<n?Oy(r[i],a,e+1,n):r[i]=t[i]):Kr(a)?(r[i]=[],r[i]=r[i].concat(a)):a!==void 0&&(r[i]=a)}}var NN=function(r){for(var t=[],e=1;e<arguments.length;e++)t[e-1]=arguments[e];for(var n=0;n<t.length;n+=1)Oy(r,t[n]);return r},xr=NN;const Cy=[0,0,0];function Le(r,t){return r.map((e,n)=>e+t[n])}function dn(r,t){return r.map((e,n)=>e-t[n])}function Wi(r,t){return typeof t=="number"?r.map(e=>e*t):r.map((e,n)=>e*t[n])}function Zi(r,t){return typeof t=="number"?r.map(e=>e/t):r.map((e,n)=>e/t[n])}function kN(r,t){return r.reduce((e,n,i)=>e+n*t[i],0)}function PN(r,t){const e=wl(r),n=wl(t);return[e[1]*n[2]-e[2]*n[1],e[2]*n[0]-e[0]*n[2],e[0]*n[1]-e[1]*n[0]]}function Ya(r,t){return r.map(e=>e*t)}function En(r,t){return Math.sqrt(r.reduce((e,n,i)=>e+Math.pow(n-t[i]||0,2),0))}function yu(r,t){return r.reduce((e,n,i)=>e+Math.abs(n-t[i]),0)}function Ea(r){const t=r.reduce((e,n)=>e+Math.pow(n,2),0);return r.map(e=>e/Math.sqrt(t))}function Xf(r,t,e=!1){const n=r[0]*t[1]-r[1]*t[0];let i=Math.acos(Wi(r,t).reduce((a,s)=>a+s,0)/(En(r,Cy)*En(t,Cy)));return e&&n<0&&(i=2*Math.PI-i),i}function b7(r,t){return r.every((e,n)=>e===t[n])}function bu(r,t=!0){return t?[-r[1],r[0]]:[r[1],-r[0]]}function Kf(r,t){return r.map(e=>e%t)}function _s(r){return[r[0],r[1]]}function wl(r){return IO(r)?[r[0],r[1],0]:r}function Ny(r){const[t,e]=r;return!t&&!e?0:Math.atan2(e,t)}function ky(r,t){const[e,n]=r;if(t%360===0)return[e,n];const i=t*Math.PI/180,a=Math.cos(i),s=Math.sin(i);return[e*a-n*s,e*s+n*a]}function Py(r,t){const[e,n]=r,[i,a]=t,s=dn(e,n),o=dn(i,a);return PN(s,o).every(l=>l===0)}function Qf(r,t,e=!1){if(Py(r,t))return;const[n,i]=r,[a,s]=t,o=((n[0]-a[0])*(a[1]-s[1])-(n[1]-a[1])*(a[0]-s[0]))/((n[0]-i[0])*(a[1]-s[1])-(n[1]-i[1])*(a[0]-s[0])),l=s[0]-a[0]?(n[0]-a[0]+o*(i[0]-n[0]))/(s[0]-a[0]):(n[1]-a[1]+o*(i[1]-n[1]))/(s[1]-a[1]);if(!(!e&&(!sa(o,0,1)||!sa(l,0,1))))return[n[0]+o*(i[0]-n[0]),n[1]+o*(i[1]-n[1])]}function Ry(r){if(Array.isArray(r))return sa(r[0],0,1)&&sa(r[1],0,1)?r:[.5,.5];const t=r.split("-"),e=t.includes("left")?0:t.includes("right")?1:.5,n=t.includes("top")?0:t.includes("bottom")?1:.5;return[e,n]}function sr(r){const{x:t=0,y:e=0,z:n=0}=r.style||{};return[+t,+e,+n]}function RN(r){const{x:t,y:e,z:n}=r.style||{};return t!==void 0||e!==void 0||n!==void 0}function Ly(r,t){const[e,n]=t,{min:i,max:a}=r;return[i[0]+e*(a[0]-i[0]),i[1]+n*(a[1]-i[1])]}function wa(r,t="center"){const e=Ry(t);return Ly(r,e)}function x7(r,t){const e=parseAnchor(t);return Ly(r,e)}const E7=r=>{const[t,e]=r;return{left:Math.min(t[0],e[0]),right:Math.max(t[0],e[0]),top:Math.min(t[1],e[1]),bottom:Math.max(t[1],e[1])}};function Er(r){var t;return[r.x,r.y,(t=r.z)!==null&&t!==void 0?t:0]}function Vi(r){var t;return{x:r[0],y:r[1],z:(t=r[2])!==null&&t!==void 0?t:0}}function w7(r){return r.sort((t,e)=>t[0]-e[0]||t[1]-e[1])}function S7(r){const t=new Set;return r.filter(e=>{const n=e.join(",");return t.has(n)?!1:(t.add(n),!0)})}function Sl(r,t=0){return r.map(e=>parseFloat(e.toFixed(t)))}function Ha(r,t,e,n=!1){if(Wn(r,t))return r;const i=n?dn(r,t):dn(t,r),a=Ea(i),s=[a[0]*e,a[1]*e];return Le(_s(r),s)}function _y(r,t){return r[1]===t[1]}function LN(r,t){return r[0]===t[0]}function _N(r,t){return _y(r,t)||LN(r,t)}function Dy(r,t,e){return Py([r,t],[t,e])}function Iy(r,t){return[2*t[0]-r[0],2*t[1]-r[1]]}function By(r,t,e,n=!0,i=!1){for(let a=0;a<e.length;a++){let s=e[a],o=e[(a+1)%e.length];n&&(s=Le(t,s),o=Le(t,o));const l=i?Iy(r,t):r,c=Qf([t,l],[s,o]);if(c)return{point:c,line:[s,o]}}return{point:t,line:void 0}}function DN(r,t,e,n){const i=r[0],a=r[1];let s=!1;e===void 0&&(e=0),n===void 0&&(n=t.length);const o=n-e;for(let l=0,c=o-1;l<o;c=l++){const u=t[l+e][0],h=t[l+e][1],d=t[c+e][0],f=t[c+e][1];h>a!=f>a&&i<(d-u)*(a-h)/(f-h)+u&&(s=!s)}return s}function IN(r,t,e=!1){const n=wa(t,"center"),i=[wa(t,"left-top"),wa(t,"right-top"),wa(t,"right-bottom"),wa(t,"left-bottom")];return By(r,n,i,!1,e).point}function xu(r,t,e=!1){const n=t.center,i=e?Iy(r,n):r,a=dn(i,t.center),s=Math.atan2(a[1],a[0]);if(isNaN(s))return n;const o=oa(t)/2,l=la(t)/2,c=n[0]+o*Math.cos(s),u=n[1]+l*Math.sin(s);return[c,u]}function BN(r,t){let e=1/0,n=[r[0],t[0]];return r.forEach(i=>{t.forEach(a=>{const s=En(i,a);s<e&&(e=s,n=[i,a])})}),n}function FN(r,t){let e=1/0,n=[[0,0],[0,0]];return t.forEach(i=>{const a=zN(r,i);a<e&&(e=a,n=i)}),n}function zN(r,t){const e=Fy(r,t);return En(r,e)}function Fy(r,t){const[e,n]=t[0],[i,a]=t[1],[s,o]=r,l=i-e,c=a-n;if(l===0&&c===0)return[e,n];let u=((s-e)*l+(o-n)*c)/(l*l+c*c);u>1?u=1:u<0&&(u=0);const h=e+u*l,d=n+u*c;return[h,d]}function jN(r){const t=r.reduce((e,n)=>Le(e,n),[0,0]);return Zi(t,r.length)}function qf(r,t=!0){const e=jN(r);return r.sort(([n,i],[a,s])=>{const o=Math.atan2(i-e[1],n-e[0]),l=Math.atan2(s-e[1],a-e[0]);return t?l-o:o-l})}function zy(r,t){return[r,[r[0],t[1]],t,[t[0],r[1]]]}class Zn{constructor(t,e,n){if(this.phase=e,this.pointerByTouch=[],this.initialDistance=null,this.emitter=t,Zn.instance)return Zn.callbacks[this.phase].push(n),Zn.instance;this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.bindEvents(),Zn.instance=this,Zn.callbacks[this.phase].push(n)}bindEvents(){const{emitter:t}=this;t.on(It.POINTER_DOWN,this.onPointerDown),t.on(It.POINTER_MOVE,this.onPointerMove),t.on(It.POINTER_UP,this.onPointerUp)}updatePointerPosition(t,e,n){const i=this.pointerByTouch.findIndex(a=>a.pointerId===t);i>=0&&(this.pointerByTouch[i]={x:e,y:n,pointerId:t})}onPointerDown(t){const{x:e,y:n}=t.client||{};if(!(e===void 0||n===void 0)&&(this.pointerByTouch.push({x:e,y:n,pointerId:t.pointerId}),t.pointerType==="touch"&&this.pointerByTouch.length===2)){Zn.isPinching=!0;const i=this.pointerByTouch[0].x-this.pointerByTouch[1].x,a=this.pointerByTouch[0].y-this.pointerByTouch[1].y;this.initialDistance=Math.sqrt(i*i+a*a),Zn.callbacks.pinchstart.forEach(s=>s(t,{scale:0}))}}onPointerMove(t){if(this.pointerByTouch.length!==2||this.initialDistance===null)return;const{x:e,y:n}=t.client||{};if(e===void 0||n===void 0)return;this.updatePointerPosition(t.pointerId,e,n);const i=this.pointerByTouch[0].x-this.pointerByTouch[1].x,a=this.pointerByTouch[0].y-this.pointerByTouch[1].y,o=Math.sqrt(i*i+a*a)/this.initialDistance;Zn.callbacks.pinchmove.forEach(l=>l(t,{scale:(o-1)*5}))}onPointerUp(t){var e;Zn.callbacks.pinchend.forEach(n=>n(t,{scale:0})),Zn.isPinching=!1,this.initialDistance=null,this.pointerByTouch=[],(e=Zn.instance)===null||e===void 0||e.tryDestroy()}destroy(){this.emitter.off(It.POINTER_DOWN,this.onPointerDown),this.emitter.off(It.POINTER_MOVE,this.onPointerMove),this.emitter.off(It.POINTER_UP,this.onPointerUp),Zn.instance=null}off(t,e){const n=Zn.callbacks[t].indexOf(e);n>-1&&Zn.callbacks[t].splice(n,1),this.tryDestroy()}tryDestroy(){Object.values(Zn.callbacks).every(t=>t.length===0)&&this.destroy()}}Zn.isPinching=!1,Zn.instance=null,Zn.callbacks={pinchstart:[],pinchmove:[],pinchend:[]};const jy=r=>r.map(t=>Ue(t)?t.toLocaleLowerCase():t);class xo{constructor(t){this.map=new Map,this.boundHandlePinch=()=>{},this.recordKey=new Set,this.onKeyDown=e=>{e!=null&&e.key&&(this.recordKey.add(e.key),this.trigger(e))},this.onKeyUp=e=>{e!=null&&e.key&&this.recordKey.delete(e.key)},this.onWheel=e=>{this.triggerExtendKey(It.WHEEL,e)},this.onDrag=e=>{this.triggerExtendKey(It.DRAG,e)},this.handlePinch=(e,n)=>{this.triggerExtendKey(It.PINCH,Object.assign(Object.assign({},e),n))},this.onFocus=()=>{this.recordKey.clear()},this.emitter=t,this.bindEvents()}bind(t,e){t.length!==0&&(t.includes(It.PINCH)&&!this.pinchHandler&&(this.boundHandlePinch=this.handlePinch.bind(this),this.pinchHandler=new Zn(this.emitter,"pinchmove",this.boundHandlePinch)),this.map.set(t,e))}unbind(t,e){this.map.forEach((n,i)=>{Wn(i,t)&&(!e||e===n)&&this.map.delete(i)})}unbindAll(){this.map.clear()}match(t){const e=jy(Array.from(this.recordKey)).sort(),n=jy(t).sort();return Wn(e,n)}bindEvents(){var t;const{emitter:e}=this;e.on(It.KEY_DOWN,this.onKeyDown),e.on(It.KEY_UP,this.onKeyUp),e.on(It.WHEEL,this.onWheel),e.on(It.DRAG,this.onDrag),(t=globalThis.addEventListener)===null||t===void 0||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,i)=>{i.includes(t)&&Wn(Array.from(this.recordKey),i.filter(a=>a!==t))&&n(e)})}destroy(){var t,e;this.unbindAll(),this.emitter.off(It.KEY_DOWN,this.onKeyDown),this.emitter.off(It.KEY_UP,this.onKeyUp),this.emitter.off(It.WHEEL,this.onWheel),this.emitter.off(It.DRAG,this.onDrag),(t=this.pinchHandler)===null||t===void 0||t.off("pinchmove",this.boundHandlePinch),(e=globalThis.removeEventListener)===null||e===void 0||e.call(globalThis,"blur",this.onFocus)}}class Ml extends di{constructor(t,e){super(t,xr({},Ml.defaultOptions,e)),this.shortcut=new xo(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,i=Object.assign({},this.options.style);this.options.style.lineWidth&&(i.lineWidth=+this.options.style.lineWidth/n.getZoom()),this.rectShape=new br({id:"g6-brush-select",style:i}),e.appendChild(this.rectShape),this.startPoint=[t.canvas.x,t.canvas.y]}onPointerMove(t){var e;if(!this.startPoint)return;const{immediately:n,mode:i}=this.options;this.endPoint=Eu(t,this.context.graph),(e=this.rectShape)===null||e===void 0||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&&i==="default"&&this.updateElementsStates(zy(this.startPoint,this.endPoint))}onPointerUp(t){if(this.startPoint){if(!this.endPoint){this.clearBrush();return}this.endPoint=Eu(t,this.context.graph),this.updateElementsStates(zy(this.startPoint,this.endPoint)),this.clearBrush()}}clearStates(){this.endPoint||this.clearElementsStates()}clearElementsStates(){const{graph:t}=this.context,e=Object.values(t.getData()).reduce((n,i)=>Object.assign({},n,i.reduce((a,s)=>{var o;const l=(o=s.states||[])===null||o===void 0?void 0:o.filter(c=>c!==this.options.state);return a[At(s)]=l,a},{})),{});t.setElementState(e,this.options.animation)}updateElementsStates(t){const{graph:e}=this.context,{enableElements:n,state:i,mode:a,onSelect:s}=this.options,o=this.selector(e,t,n);let l={};switch(a){case"union":o.forEach(c=>{l[c]=[...e.getElementState(c),i]});break;case"diff":o.forEach(c=>{const u=e.getElementState(c);l[c]=u.includes(i)?u.filter(h=>h!==i):[...u,i]});break;case"intersect":o.forEach(c=>{const u=e.getElementState(c);l[c]=u.includes(i)?[i]:[]});break;case"default":default:o.forEach(c=>{l[c]=[i]});break}ue(s)&&(l=s(l)),e.setElementState(l,this.options.animation)}selector(t,e,n){if(!n||n.length===0)return[];const i=[],a=t.getData();if(n.forEach(s=>{a[`${s}s`].forEach(o=>{const l=At(o);t.getElementVisibility(l)!=="hidden"&&DN(t.getElementPosition(l),e)&&i.push(l)})}),n.includes("edge")){const s=a.edges;s==null||s.forEach(o=>{const{source:l,target:c}=o;i.includes(l)&&i.includes(c)&&i.push(At(o))})}return i}clearBrush(){var t;(t=this.rectShape)===null||t===void 0||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(n=>n!=="drag"))}validate(t){if(this.destroyed)return!1;const{enable:e}=this.options;return ue(e)?e(t):!!e}bindEvents(){const{graph:t}=this.context;t.on(It.POINTER_DOWN,this.onPointerDown),t.on(It.POINTER_MOVE,this.onPointerMove),t.on(It.POINTER_UP,this.onPointerUp),t.on(ya.CLICK,this.clearStates)}unbindEvents(){const{graph:t}=this.context;t.off(It.POINTER_DOWN,this.onPointerDown),t.off(It.POINTER_MOVE,this.onPointerMove),t.off(It.POINTER_UP,this.onPointerUp),t.off(ya.CLICK,this.clearStates)}update(t){this.unbindEvents(),this.options=xr(this.options,t),this.bindEvents()}destroy(){this.unbindEvents(),super.destroy()}}Ml.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 Eu=(r,t)=>{if((r.targetType==="node"||r.targetType==="combo")&&!(r.nativeEvent.target instanceof HTMLCanvasElement)){const[e,n]=t.getCanvasByClient([r.client.x,r.client.y]);return[e,n]}return[r.canvas.x,r.canvas.y]},Sa=.8,Ds=["node","edge","combo"];function Is(r,t,e,n,i=0){n==="TB"&&t(r,i);const a=e(r);if(a)for(const s of a)Is(s,t,e,n,i+1);n==="BT"&&t(r,i)}function GN(r,t,e){const n=[[r,0]];for(;n.length;){const[i,a]=n.shift();t(i,a);const s=e(i);if(s)for(const o of s)n.push([o,a+1])}}function Gy(r,t,e,n,i="both"){if(t==="combo"||t==="node")return Jf(r,e,n,i);const a=r.getEdgeData(e);if(!a)return[];const s=Jf(r,a.source,n-1,i),o=Jf(r,a.target,n-1,i);return Array.from(new Set([...s,...o,e]))}function Jf(r,t,e,n="both"){const i=new Set,a=new Set,s=new Set;return GN(t,(o,l)=>{l>e||(s.add(o),r.getRelatedEdgesData(o,n).forEach(c=>{const u=At(c);!a.has(u)&&l<e&&(s.add(u),a.add(u))}))},o=>r.getRelatedEdgesData(o,n).map(l=>l.source===o?l.target:l.source).filter(l=>i.has(l)?!1:(i.add(l),!0))),Array.from(s)}function $f(r){return r.states||[]}var wu=function(r,t,e,n){function i(a){return a instanceof e?a:new e(function(s){s(a)})}return new(e||(e=Promise))(function(a,s){function o(u){try{c(n.next(u))}catch(h){s(h)}}function l(u){try{c(n.throw(u))}catch(h){s(h)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((n=n.apply(r,t||[])).next())})};class Su extends di{constructor(t,e){super(t,Object.assign({},Su.defaultOptions,e)),this.onClickSelect=n=>wu(this,void 0,void 0,function*(){var i,a;this.validate(n)&&(yield this.updateState(n),(a=(i=this.options).onClick)===null||a===void 0||a.call(i,n))}),this.onClickCanvas=n=>wu(this,void 0,void 0,function*(){var i,a;this.validate(n)&&(yield this.clearState(),(a=(i=this.options).onClick)===null||a===void 0||a.call(i,n))}),this.shortcut=new xo(t.graph),this.bindEvents()}bindEvents(){const{graph:t}=this.context;this.unbindEvents(),Ds.forEach(e=>{t.on(`${e}:${It.CLICK}`,this.onClickSelect)}),t.on(ya.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:i}=this.context,{degree:a}=this.options;return Gy(i,n,e.id,typeof a=="function"?a(t):a).filter(s=>s!==e.id)}updateState(t){return wu(this,void 0,void 0,function*(){const{state:e,unselectedState:n,neighborState:i,animation:a}=this.options;if(!e&&!i&&!n)return;const{target:s}=t,{graph:o}=this.context,l=o.getElementData(s.id),c=$f(l).includes(e)?"unselect":"select",u={},h=this.isMultipleSelect,d=[s.id],f=this.getNeighborIds(t);if(h)if(Object.assign(u,this.getDataStates()),c==="select"){const v=(g,p)=>{g.forEach(y=>{const b=new Set(o.getElementState(y));b.add(p),b.delete(n),u[y]=Array.from(b)})};v(d,e),v(f,i),n&&Object.keys(u).forEach(g=>{const p=u[g];!p.includes(e)&&!p.includes(i)&&!p.includes(n)&&u[g].push(n)})}else{const v=u[s.id];u[s.id]=v.filter(g=>g!==e&&g!==i),v.includes(n)||u[s.id].push(n),f.forEach(g=>{u[g]=u[g].filter(p=>p!==i),u[g].includes(e)||u[g].push(n)})}else if(c==="select"){Object.assign(u,this.getClearStates(!!n));const v=(g,p)=>{g.forEach(y=>{u[y]||(u[y]=o.getElementState(y)),u[y].push(p)})};v(d,e),v(f,i),n&&Object.keys(u).forEach(g=>{!d.includes(g)&&!f.includes(g)&&u[g].push(n)})}else Object.assign(u,this.getClearStates());yield o.setElementState(u,a)})}getDataStates(){const{graph:t}=this.context,{nodes:e,edges:n,combos:i}=t.getData(),a={};return[...e,...n,...i].forEach(s=>{a[At(s)]=$f(s)}),a}getClearStates(t=!1){const{graph:e}=this.context,{state:n,unselectedState:i,neighborState:a}=this.options,s=new Set([n,i,a]),{nodes:o,edges:l,combos:c}=e.getData(),u={};return[...o,...l,...c].forEach(h=>{const d=$f(h),f=d.filter(v=>!s.has(v));(t||f.length!==d.length)&&(u[At(h)]=f)}),u}clearState(){return wu(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 ue(e)?e(t):!!e}unbindEvents(){const{graph:t}=this.context;Ds.forEach(e=>{t.off(`${e}:${It.CLICK}`,this.onClickSelect)}),t.off(ya.CLICK,this.onClickCanvas)}destroy(){this.unbindEvents(),super.destroy()}}Su.defaultOptions={animation:!0,enable:!0,multiple:!1,trigger:["shift"],state:"selected",neighborState:"selected",unselectedState:void 0,degree:0};function ni(r){var t;return!!(!((t=r.style)===null||t===void 0)&&t.collapsed)}var wr=function(r,t,e){for(var n=0,i=Ue(t)?t.split("."):t;r&&n<i.length;)r=r[i[n++]];return r===void 0||n<i.length?e:r},Al=function(r,t,e){var n=r,i=Ue(t)?t.split("."):t;return i.forEach(function(a,s){s<i.length-1?(zn(n[a])||(n[a]=ie(i[s+1])?[]:{}),n=n[a]):n[a]=e}),r},WN=function(r){var t=Rm(r);return t.charAt(0).toLowerCase()+t.substring(1)},ZN=WN;function Tl(r,t){if(!r.startsWith(t))return!1;const e=r[t.length];return e>="A"&&e<="Z"}function Wy(r,t){return`${t}${tu(r)}`}function Zy(r,t,e=!0){if(!t||!Tl(r,t))return r;const n=r.slice(t.length);return e?ZN(n):n}function Dn(r,t){const e=Object.entries(r).reduce((n,[i,a])=>(i==="className"||i==="class"||Tl(i,t)&&Object.assign(n,{[Zy(i,t)]:a}),n),{});if("opacity"in r){const n=Wy("opacity",t),i=r.opacity;if(n in r){const a=r[n];Object.assign(e,{opacity:i*a})}else Object.assign(e,{opacity:i})}return e}function tv(r,t){const e=t.length;return Object.keys(r).reduce((n,i)=>{if(i.startsWith(t)){const a=i.slice(e);n[a]=r[i]}return n},{})}function Vy(r,t){const e=typeof t=="string"?[t]:t,n={};return Object.keys(r).forEach(i=>{e.find(a=>i.startsWith(a))||(n[i]=r[i])}),n}function M7(r,t,e){return Object.entries(r).reduce((n,[i,a])=>(Tl(i,t)?n[Wy(Zy(i,t,!1),e)]=a:n[i]=a,n),{})}function fi(r=0){if(typeof r=="number")return[r,r,r];const[t,e=t,n=t]=r;return[t,e,n]}var VN=function(r,t){var e={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&t.indexOf(n)<0&&(e[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(e[n[i]]=r[n[i]]);return e};function Uy(r,t){const{datum:e,graph:n}=t;return typeof r=="function"?r.call(n,e):Object.fromEntries(Object.entries(r).map(([i,a])=>typeof a=="function"?[i,a.call(n,e)]:[i,a]))}function dr(r,t){const e=(r==null?void 0:r.style)||{},n=(t==null?void 0:t.style)||{};for(const i in e)i in n||(n[i]=e[i]);return Object.assign({},r,t,{style:n})}function UN(r){const{x:t,y:e,z:n,class:i,className:a,transform:s,transformOrigin:o,zIndex:l,visibility:c}=r;return VN(r,["x","y","z","class","className","transform","transformOrigin","zIndex","visibility"])}function YN(r,t){const e=fi(r);let n={};return t.text&&!t.fontSize&&(n={fontSize:Math.min(...e)*.5}),t.src&&(!t.width||!t.height)&&(n={width:e[0]*.5,height:e[1]*.5}),n}function Yy(r){if(r)return typeof r=="string"||typeof r=="function"||Array.isArray(r)?{type:"group",field:t=>t.id,color:r,invert:!1}:r}function HN(r,t){if(!t)return{};const{type:e,color:n,field:i,invert:a}=t,s=l=>{const c=typeof n=="string"?ba("palette",n):n;if(typeof c=="function"){const u={};return l.forEach(([h,d])=>{u[h]=c(a?1-d:d)}),u}else if(Array.isArray(c)){const u=a?[...c].reverse():c,h={};return l.forEach(([d,f])=>{h[d]=u[f%c.length]}),h}return{}},o=(l,c)=>{var u;return typeof l=="string"?(u=c.data)===null||u===void 0?void 0:u[l]:l==null?void 0:l(c)};if(e==="group"){const l=nu(r,d=>{if(!i)return"default";const f=o(i,d);return f?String(f):"default"}),c=Object.keys(l),u=s(c.map((d,f)=>[d,f])),h={};return Object.entries(l).forEach(([d,f])=>{f.forEach(v=>{h[At(v)]=u[d]})}),h}else if(e==="value"){const[l,c]=r.reduce(([h,d],f)=>{const v=o(i,f);if(typeof v!="number")throw new Error(xa(`Palette field ${i} is not a number`));return[Math.min(h,v),Math.max(d,v)]},[1/0,-1/0]),u=c-l;return s(r.map(h=>[h.id,(o(i,h)-l)/u]))}}function Hy(r){const t=typeof r=="string"?ba("palette",r):r;if(typeof t!="function")return t}function Xy(r,t){let e=2*r;return typeof t=="string"?e=r*Number(t.replace("%",""))/100:typeof t=="number"&&(e=t),isNaN(e)&&(e=2*r),e}function Ky(r,t,e=1,n=!1){const i=n?e:1,a=(r.max[0]-r.min[0])*i;return Xy(a,t)}function XN(r,t,e=1){const n=En(r[0],r[1])*e;return Xy(n,t)}var KN={}.toString,QN=function(r){return KN.call(r).replace(/^\[object /,"").replace(/]$/,"")},qN=QN,JN=Object.prototype,$N=function(r){var t=r&&r.constructor,e=typeof t=="function"&&t.prototype||JN;return r===e},tk=$N,ek=Object.prototype.hasOwnProperty;function nk(r){if(be(r))return!0;if(gl(r))return!r.length;var t=qN(r);if(t==="Map"||t==="Set")return!r.size;if(tk(r))return!Object.keys(r).length;for(var e in r)if(ek.call(r,e))return!1;return!0}var ua=nk;class Ol extends pf{constructor(t){Qy(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,i,a){var s,o,l,c,u,h,d,f;const v=this.shapeMap[t];if(n===!1){v&&((s=a==null?void 0:a.beforeDestroy)===null||s===void 0||s.call(a,v),i.removeChild(v),delete this.shapeMap[t],(o=a==null?void 0:a.afterDestroy)===null||o===void 0||o.call(a,v));return}const g=typeof e=="string"?ba(pl.SHAPE,e):e;if(!g)throw new Error(xa(`Shape ${e} not found`));if(!v||v.destroyed||!(v instanceof g)){v&&((l=a==null?void 0:a.beforeDestroy)===null||l===void 0||l.call(a,v),v==null||v.destroy(),(c=a==null?void 0:a.afterDestroy)===null||c===void 0||c.call(a,v)),(u=a==null?void 0:a.beforeCreate)===null||u===void 0||u.call(a);const p=new g({className:t,style:n});return i.appendChild(p),this.shapeMap[t]=p,(h=a==null?void 0:a.afterCreate)===null||h===void 0||h.call(a,p),p}return(d=a==null?void 0:a.beforeUpdate)===null||d===void 0||d.call(a,v),wv(v,n),(f=a==null?void 0:a.afterUpdate)===null||f===void 0||f.call(a,v),v}update(t={}){const e=Object.assign({},this.attributes,t);Qy(e),rP(this,e),this.render(e,this),this.setVisibility()}bindEvents(){}getGraphicStyle(t){return UN(t)}get compositeShapes(){return[["badges","badge-"],["ports","port-"]]}animate(t,e){if(t.length===0)return null;const n=[];if(t[0].x!==void 0||t[0].y!==void 0||t[0].z!==void 0){const{x:a=0,y:s=0,z:o=0}=this.attributes;t.forEach(l=>{const{x:c=a,y:u=s,z:h=o}=l;Object.assign(l,{transform:h?[["translate3d",c,u,h]]:[["translate",c,u]]})})}const i=super.animate(t,e);if(i&&(ev(this,i),n.push(i)),Array.isArray(t)&&t.length>0){const a=["transform","transformOrigin","x","y","z","zIndex"];if(Object.keys(t[0]).some(s=>!a.includes(s))){Object.entries(this.shapeMap).forEach(([o,l])=>{const c=`get${tu(o)}Style`,u=this[c];if(ue(u)){const h=t.map(f=>u.call(this,Object.assign(Object.assign({},this.attributes),f))),d=l.animate(Rf(h),e);d&&(ev(l,d),n.push(d))}});const s=(o,l)=>{if(!ua(o)){const c=`get${tu(l)}Style`,u=this[c];if(ue(u)){const h=t.map(d=>u.call(this,Object.assign(Object.assign({},this.attributes),d)));Object.entries(h[0]).map(([d])=>{const f=h.map(g=>g[d]),v=o[d];if(v){const g=v.animate(Rf(f),e);g&&(ev(v,g),n.push(g))}})}}};this.compositeShapes.forEach(([o,l])=>{const c=tv(this.shapeMap,l);s(c,o)})}}return Pf(n)}getShape(t){return this.shapeMap[t]}setVisibility(){const{visibility:t}=this.attributes;Ls(this,t)}destroy(){this.shapeMap={},this.animateMap={},super.destroy()}}function ev(r,t){t==null||t.finished.then(()=>{const e=r.activeAnimations.findIndex(n=>n===t);e>-1&&r.activeAnimations.splice(e,1)})}function Qy(r){if(!r)return{};if("x"in r||"y"in r||"z"in r){const{x:t=0,y:e=0,z:n,transform:i}=r,a=Dm(t,e,n,i);a&&(r.transform=a)}return r}var rk=function(r,t){var e={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&t.indexOf(n)<0&&(e[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(e[n[i]]=r[n[i]]);return e};class ha extends Ol{constructor(t){super(dr({style:ha.defaultStyleProps},t))}isTextStyle(t){return Tl(t,"label")}isBackgroundStyle(t){return Tl(t,"background")}getTextStyle(t){const e=this.getGraphicStyle(t),{padding:n}=e,i=rk(e,["padding"]);return Vy(i,"background")}getBackgroundStyle(t){if(t.background===!1)return!1;const e=this.getGraphicStyle(t),{wordWrap:n,wordWrapWidth:i,padding:a}=e,s=Dn(e,"background"),{min:[o,l],center:[c,u],halfExtents:[h,d]}=this.shapeMap.text.getGeometryBounds(),[f,v,g,p]=hi(a),y=h*2+p+v,{width:b,height:E}=s;b&&E?Object.assign(s,{x:c-Number(b)/2,y:u-Number(E)/2}):Object.assign(s,{x:o-p,y:l-f,width:n?Math.min(y,i+p+v):y,height:d*2+f+g});const{radius:O}=s;if(typeof O=="string"&&O.endsWith("%")){const k=Number(O.replace("%",""))/100;s.radius=Math.min(+s.width,+s.height)*k}return s}render(t=this.parsedAttributes,e=this){this.upsert("text",Ns,this.getTextStyle(t),e),this.upsert("background",br,this.getBackgroundStyle(t),e)}getGeometryBounds(){return(this.getShape("background")||this.getShape("text")).getGeometryBounds()}}ha.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 Eo extends Ol{constructor(t){super(dr({style:Eo.defaultStyleProps},t))}getBadgeStyle(t){return this.getGraphicStyle(t)}render(t=this.parsedAttributes,e=this){this.upsert("label",ha,this.getBadgeStyle(t),e)}getGeometryBounds(){const t=this.getShape("label");return(t.getShape("background")||t.getShape("text")).getGeometryBounds()}}Eo.defaultStyleProps={padding:[2,4,2,4],fontSize:10,wordWrap:!1,backgroundRadius:"50%",backgroundOpacity:1};function ik(r,t=!0){const e=[];return r.forEach((n,i)=>{e.push([i===0?"M":"L",...n])}),t&&e.push(["Z"]),e}const qy={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 ak(r){const t=r.replace(/[\n\r]/g,"").replace(/-/g," -").replace(/(\d*\.)(\d+)(?=\.)/g,"$1$2 ").trim().split(/\s*,|\s+/),e=[];let n="",i={};for(;t.length>0;){let a=t.shift();a in qy?n=a:t.unshift(a),i={type:n},qy[n].forEach(l=>{a=t.shift(),i[l]=a}),n==="M"?n="L":n==="m"&&(n="l");const[s,...o]=Object.values(i);e.push([s,...o.map(Number)])}return e}function sk(r){const t=[];return(typeof r=="string"?ak(r):r).forEach(n=>{const i=n[0];if(i==="Z"){t.push(t[0]);return}if(i!=="A")for(let a=1;a<n.length;a=a+2)t.push([n[a],n[a+1],0]);else{const a=n.length;t.push([n[a-2],n[a-1],0])}}),t}const Jy=r=>{if(r.length<2)return[["M",0,0],["L",0,0]];const t=r[0],e=r[1],n=r[r.length-1],i=r[r.length-2];r.unshift(i,n),r.push(t,e);const a=[["M",n[0],n[1]]];for(let s=1;s<r.length-2;s+=1){const[o,l]=r[s-1],[c,u]=r[s],[h,d]=r[s+1],[f,v]=s!==r.length-2?r[s+2]:[h,d],g=c+(h-o)/6,p=u+(d-l)/6,y=h-(f-c)/6,b=d-(v-u)/6;a.push(["C",g,p,y,b,h,d])}return a};function ok(r,t,e,n,i,a,s){const[o,l]=wa(r,t),c={textAlign:t==="left"?"right":t==="right"?"left":"center",textBaseline:t==="top"?"bottom":t==="bottom"?"top":"middle",transform:[["translate",o+e,l+n]]};if(t==="center"||!i)return c;const u=sk(a);if(!u||u.length<=3)return c;const h=u.map((v,g)=>{const p=v,y=u[(g+1)%u.length];return Wn(p,y)?null:[p,y]}).filter(Boolean),d=FN([o,l],h),f=Fy([o,l],d);if(f&&d&&(c.transform=[["translate",f[0]+e,f[1]+n]],s)){const v=Math.atan((d[0][1]-d[1][1])/(d[0][0]-d[1][0]));c.transform.push(["rotate",v/Math.PI*180]),c.textAlign="center",(t==="right"||t==="left")&&(v>0?c.textBaseline=t==="right"?"bottom":"top":c.textBaseline=t==="right"?"top":"bottom")}return c}var lk=function(r,t){var e={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&t.indexOf(n)<0&&(e[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(e[n[i]]=r[n[i]]);return e};class Cl extends Ol{constructor(t){super(dr({style:Cl.defaultStyleProps},t))}getLabelStyle(t){if(!t.label||!t.d||t.d.length===0)return!1;const e=Dn(this.getGraphicStyle(t),"label"),{maxWidth:n,offsetX:i,offsetY:a,autoRotate:s,placement:o,closeToPath:l}=e,c=lk(e,["maxWidth","offsetX","offsetY","autoRotate","placement","closeToPath"]),u=this.shapeMap.key,h=u==null?void 0:u.getRenderBounds();return Object.assign(ok(h,o,i,a,l,t.d,s),{wordWrapWidth:Ky(h,n)},c)}getKeyStyle(t){return this.getGraphicStyle(t)}render(t,e){this.upsert("key",li,this.getKeyStyle(t),e),this.upsert("label",ha,this.getLabelStyle(t),e)}}Cl.defaultStyleProps={label:!0,labelPlacement:"bottom",labelCloseToPath:!0,labelAutoRotate:!0,labelOffsetX:0,labelOffsetY:0};function ck(r){const t=[],e=n=>{n!=null&&n.children.length&&n.children.forEach(i=>{t.push(i),e(i)})};return e(r),t}function uk(r){const t=[];let e=r.parentNode;for(;e;)t.push(e),e=e.parentNode;return t}class nv extends dl{constructor(t){super(t),this.onMounted=()=>{this.handleRadius()},this.onAttrModified=()=>{this.handleRadius()},wo=this,this.isMutationObserved=!0,this.addEventListener(Fe.MOUNTED,this.onMounted),this.addEventListener(Fe.ATTR_MODIFIED,this.onAttrModified)}handleRadius(){const{radius:t,clipPath:e,width:n=0,height:i=0}=this.attributes;if(t&&n&&i){const[a,s]=this.getBounds().min,o={x:a,y:s,radius:t,width:n,height:i};if(e)Object.assign(this.parsedStyle.clipPath.style,o);else{const l=new br({style:o});this.style.clipPath=l}}else e&&(this.style.clipPath=null)}}const rv=new WeakMap;let wo=null;const iv=r=>{if(wo&&uk(wo).includes(r)){const t=rv.get(r);t?t.includes(wo)||t.push(wo):rv.set(r,[wo])}},av=r=>{const t=rv.get(r);t&&t.forEach(e=>e.handleRadius())};class $y extends Ol{constructor(t){super(t)}isImage(){const{src:t}=this.attributes;return!!t}getIconStyle(t=this.attributes){const{width:e=0,height:n=0}=t,i=this.getGraphicStyle(t);return this.isImage()?Object.assign({x:-e/2,y:-n/2},i):Object.assign({textBaseline:"middle",textAlign:"center"},i)}render(t=this.attributes,e=this){this.upsert("icon",this.isImage()?nv:Ns,this.getIconStyle(t),e)}}class t1 extends Ol{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 Mu=function(r,t){var e={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&t.indexOf(n)<0&&(e[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(e[n[i]]=r[n[i]]);return e};class Ui extends t1{constructor(t){super(dr({style:Ui.defaultStyleProps},t)),this.type="node"}getSize(t=this.attributes){const{size:e}=t;return fi(e)}getKeyStyle(t){const e=this.getGraphicStyle(t);return Object.assign(Vy(e,["label","halo","icon","badge","port"]))}getLabelStyle(t){if(t.label===!1||!t.labelText)return!1;const e=Dn(this.getGraphicStyle(t),"label"),{placement:n,maxWidth:i,offsetX:a,offsetY:s}=e,o=Mu(e,["placement","maxWidth","offsetX","offsetY"]),l=this.getShape("key").getLocalBounds();return Object.assign(L1(l,n,a,s),{wordWrapWidth:Ky(l,i)},o)}getHaloStyle(t){if(t.halo===!1)return!1;const e=this.getKeyStyle(t),{fill:n}=e,i=Mu(e,["fill"]),a=Dn(this.getGraphicStyle(t),"halo");return Object.assign(Object.assign(Object.assign({},i),{stroke:n}),a)}getIconStyle(t){if(t.icon===!1||!t.iconText&&!t.iconSrc)return!1;const e=Dn(this.getGraphicStyle(t),"icon");return Object.assign(YN(t.size,e),e)}getBadgesStyle(t){var e;const n=tv(this.shapeMap,"badge-"),i={};if(Object.keys(n).forEach(h=>{i[h]=!1}),t.badge===!1||!(!((e=t.badges)===null||e===void 0)&&e.length))return i;const{badges:a=[],badgePalette:s,opacity:o=1}=t,l=Mu(t,["badges","badgePalette","opacity"]),c=Hy(s),u=Dn(this.getGraphicStyle(l),"badge");return a.forEach((h,d)=>{i[d]=Object.assign(Object.assign({backgroundFill:c?c[d%(c==null?void 0:c.length)]:void 0,opacity:o},u),this.getBadgeStyle(h))}),i}getBadgeStyle(t){const e=this.getShape("key"),{placement:n="top",offsetX:i,offsetY:a}=t,s=Mu(t,["placement","offsetX","offsetY"]),o=L1(e.getLocalBounds(),n,i,a,!0);return Object.assign(Object.assign({},o),s)}getPortsStyle(t){var e;const n=this.getPorts(),i={};if(Object.keys(n).forEach(o=>{i[o]=!1}),t.port===!1||!(!((e=t.ports)===null||e===void 0)&&e.length))return i;const a=Dn(this.getGraphicStyle(t),"port"),{ports:s=[]}=t;return s.forEach((o,l)=>{const c=o.key||l,u=Object.assign(Object.assign({},a),o);if(k1(u))i[c]=!1;else{const[h,d]=this.getPortXY(t,o);i[c]=Object.assign({transform:[["translate",h,d]]},u)}}),i}getPortXY(t,e){const{placement:n="left"}=e,i=this.getShape("key");return bv(hk(this.context,i),n)}getPorts(){return tv(this.shapeMap,"port-")}getCenter(){return this.getShape("key").getBounds().center}getIntersectPoint(t,e=!1){const n=this.getShape("key").getBounds();return IN(t,n,e)}drawHaloShape(t,e){const n=this.getHaloStyle(t),i=this.getShape("key");this.upsert("halo",i.constructor,n,e)}drawIconShape(t,e){const n=this.getIconStyle(t);this.upsert("icon",$y,n,e),iv(this)}drawBadgeShapes(t,e){const n=this.getBadgesStyle(t);Object.keys(n).forEach(i=>{const a=n[i];this.upsert(`badge-${i}`,Eo,a,e)})}drawPortShapes(t,e){const n=this.getPortsStyle(t);Object.keys(n).forEach(i=>{const a=n[i],s=`port-${i}`;this.upsert(s,aa,a,e)})}drawLabelShape(t,e){const n=this.getLabelStyle(t);this.upsert("label",ha,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)&&av(this)}onframe(){this.drawBadgeShapes(this.parsedAttributes,this),this.drawLabelShape(this.parsedAttributes,this)}}Ui.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};function hk(r,t){if(!r)return t.getLocalBounds();const e=r.canvas.getLayer(),n=t.cloneNode();Ls(n,"hidden"),e.appendChild(n);const i=n.getLocalBounds();return n.destroy(),i}class Bs extends Ui{constructor(t){super(dr({style:Bs.defaultStyleProps},t))}drawKeyShape(t,e){return this.upsert("key",aa,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,i=n*2*Sa;return e?Object.assign({width:i,height:i},e):!1}getIntersectPoint(t,e=!1){const n=this.getShape("key").getBounds();return xu(t,n,e)}}Bs.defaultStyleProps={size:32};class Au extends Ui{constructor(t){super(t)}get parsedAttributes(){return this.attributes}drawKeyShape(t,e){return this.upsert("key",Cs,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,i;const{points:a}=this.getShape("key").attributes,s=[+(((n=this.attributes)===null||n===void 0?void 0:n.x)||0),+(((i=this.attributes)===null||i===void 0?void 0:i.y)||0)];return By(t,s,a,!0,e).point}}class dk extends Au{constructor(t){super(t)}getPoints(t){const[e,n]=this.getSize(t);return nP(e,n)}}var fk=function(r,t){var e={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&t.indexOf(n)<0&&(e[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(e[n[i]]=r[n[i]]);return e};class Tu extends Bs{constructor(t){super(dr({style:Tu.defaultStyleProps},t))}parseOuterR(){const{size:t}=this.parsedAttributes;return Math.min(...fi(t))/2}parseInnerR(){const{innerR:t}=this.parsedAttributes;return Ue(t)?parseInt(t)/100*this.parseOuterR():t}drawDonutShape(t,e){const{donuts:n}=t;if(!(n!=null&&n.length))return;const i=n.map(h=>ie(h)?{value:h}:h),a=Dn(this.getGraphicStyle(t),"donut"),s=Hy(t.donutPalette);if(!s)return;const o=i.reduce((h,d)=>{var f;return h+((f=d.value)!==null&&f!==void 0?f:0)},0),l=this.parseOuterR(),c=this.parseInnerR();let u=0;i.forEach((h,d)=>{const{value:f=0,color:v=s[d%s.length]}=h,g=fk(h,["value","color"]),p=(o===0?1/i.length:f/o)*360;this.upsert(`round${d}`,li,Object.assign(Object.assign(Object.assign({},a),{d:pk(l,c,u,u+p),fill:v}),g),e),u+=p})}render(t,e=this){super.render(t,e),this.drawDonutShape(t,e)}}Tu.defaultStyleProps={innerR:"50%",donuts:[],donutPalette:"tableau"};const Ou=(r,t,e,n)=>[r+Math.sin(n)*e,t-Math.cos(n)*e],vk=(r,t,e,n)=>n<=0||e<=n?[["M",r-e,t],["A",e,e,0,1,1,r+e,t],["A",e,e,0,1,1,r-e,t],["Z"]]:[["M",r-e,t],["A",e,e,0,1,1,r+e,t],["A",e,e,0,1,1,r-e,t],["Z"],["M",r+n,t],["A",n,n,0,1,0,r-n,t],["A",n,n,0,1,0,r+n,t],["Z"]],gk=(r,t,e,n,i,a)=>{const[s,o]=[i/360*2*Math.PI,a/360*2*Math.PI],l=[Ou(r,t,n,s),Ou(r,t,e,s),Ou(r,t,e,o),Ou(r,t,n,o)],c=o-s>Math.PI?1:0;return[["M",l[0][0],l[0][1]],["L",l[1][0],l[1][1]],["A",e,e,0,c,1,l[2][0],l[2][1]],["L",l[3][0],l[3][1]],["A",n,n,0,c,0,l[0][0],l[0][1]],["Z"]]},pk=(r=0,t=0,e,n)=>{const[i,a]=[0,0];return Math.abs(e-n)%360<1e-6?vk(i,a,r,t):gk(i,a,r,t,e,n)};class Cu extends Ui{constructor(t){super(dr({style:Cu.defaultStyleProps},t))}drawKeyShape(t,e){return this.upsert("key",hl,this.getKeyStyle(t),e)}getKeyStyle(t){const e=super.getKeyStyle(t),[n,i]=this.getSize(t);return Object.assign(Object.assign({},e),{rx:n/2,ry:i/2})}getIconStyle(t){const e=super.getIconStyle(t),{rx:n,ry:i}=this.getShape("key").attributes,a=Math.min(+n,+i)*2*Sa;return e?Object.assign({width:a,height:a},e):!1}getIntersectPoint(t,e=!1){const n=this.getShape("key").getBounds();return xu(t,n,e)}}Cu.defaultStyleProps={size:[45,35]};class mk extends Au{constructor(t){super(t)}getOuterR(t){return t.outerR||Math.min(...this.getSize(t))/2}getPoints(t){return iP(this.getOuterR(t))}getIconStyle(t){const e=super.getIconStyle(t),n=this.getOuterR(t)*Sa;return e?Object.assign({width:n,height:n},e):!1}}function yk(r,t){var e=t.cx,n=e===void 0?0:e,i=t.cy,a=i===void 0?0:i,s=t.r;r.arc(n,a,s,0,Math.PI*2,!1)}function bk(r,t){var e=t.cx,n=e===void 0?0:e,i=t.cy,a=i===void 0?0:i,s=t.rx,o=t.ry;if(r.ellipse)r.ellipse(n,a,s,o,0,0,Math.PI*2,!1);else{var l=s>o?s:o,c=s>o?1:s/o,u=s>o?o/s:1;r.save(),r.scale(c,u),r.arc(n,a,l,0,Math.PI*2)}}function xk(r,t){var e=t.x1,n=t.y1,i=t.x2,a=t.y2,s=t.markerStart,o=t.markerEnd,l=t.markerStartOffset,c=t.markerEndOffset,u=0,h=0,d=0,f=0,v=0,g,p;s&&Ye(s)&&l&&(g=i-e,p=a-n,v=Math.atan2(p,g),u=Math.cos(v)*(l||0),h=Math.sin(v)*(l||0)),o&&Ye(o)&&c&&(g=e-i,p=n-a,v=Math.atan2(p,g),d=Math.cos(v)*(c||0),f=Math.sin(v)*(c||0)),r.moveTo(e+u,n+h),r.lineTo(i+d,a+f)}function Ek(r,t){var e=t.markerStart,n=t.markerEnd,i=t.markerStartOffset,a=t.markerEndOffset,s=t.d,o=s.absolutePath,l=s.segments,c=0,u=0,h=0,d=0,f=0,v,g;if(e&&Ye(e)&&i){var p=e.parentNode.getStartTangent(),y=(0,G.Z)(p,2),b=y[0],E=y[1];v=b[0]-E[0],g=b[1]-E[1],f=Math.atan2(g,v),c=Math.cos(f)*(i||0),u=Math.sin(f)*(i||0)}if(n&&Ye(n)&&a){var O=n.parentNode.getEndTangent(),k=(0,G.Z)(O,2),P=k[0],F=k[1];v=P[0]-F[0],g=P[1]-F[1],f=Math.atan2(g,v),h=Math.cos(f)*(a||0),d=Math.sin(f)*(a||0)}for(var B=0;B<o.length;B++){var V=o[B],U=V[0],J=o[B+1],$=B===0&&(c!==0||u!==0),at=(B===o.length-1||J&&(J[0]==="M"||J[0]==="Z"))&&h!==0&&d!==0,ct=$?[c,u]:[0,0],ft=(0,G.Z)(ct,2),Nt=ft[0],Ct=ft[1],gt=at?[h,d]:[0,0],bt=(0,G.Z)(gt,2),Pt=bt[0],zt=bt[1];switch(U){case"M":r.moveTo(V[1]+Nt,V[2]+Ct);break;case"L":r.lineTo(V[1]+Pt,V[2]+zt);break;case"Q":r.quadraticCurveTo(V[1],V[2],V[3]+Pt,V[4]+zt);break;case"C":r.bezierCurveTo(V[1],V[2],V[3],V[4],V[5]+Pt,V[6]+zt);break;case"A":{var Ut=l[B].arcParams,$t=Ut.cx,re=Ut.cy,ce=Ut.rx,le=Ut.ry,Ee=Ut.startAngle,Ne=Ut.endAngle,We=Ut.xRotation,He=Ut.sweepFlag;if(r.ellipse)r.ellipse($t,re,ce,le,We,Ee,Ne,!!(1-He));else{var cr=ce>le?ce:le,$e=ce>le?1:ce/le,yi=ce>le?le/ce:1;r.translate($t,re),r.rotate(We),r.scale($e,yi),r.arc(0,0,cr,Ee,Ne,!!(1-He)),r.scale(1/$e,1/yi),r.rotate(-We),r.translate(-$t,-re)}at&&r.lineTo(V[6]+h,V[7]+d);break}case"Z":r.closePath();break}}}function wk(r,t){var e=t.markerStart,n=t.markerEnd,i=t.markerStartOffset,a=t.markerEndOffset,s=t.points.points,o=s.length,l=s[0][0],c=s[0][1],u=s[o-1][0],h=s[o-1][1],d=0,f=0,v=0,g=0,p=0,y,b;e&&Ye(e)&&i&&(y=s[1][0]-s[0][0],b=s[1][1]-s[0][1],p=Math.atan2(b,y),d=Math.cos(p)*(i||0),f=Math.sin(p)*(i||0)),n&&Ye(n)&&a&&(y=s[o-1][0]-s[0][0],b=s[o-1][1]-s[0][1],p=Math.atan2(b,y),v=Math.cos(p)*(a||0),g=Math.sin(p)*(a||0)),r.moveTo(l+(d||v),c+(f||g));for(var E=1;E<o-1;E++){var O=s[E];r.lineTo(O[0],O[1])}r.lineTo(u,h)}function Sk(r,t){var e=t.markerStart,n=t.markerEnd,i=t.markerStartOffset,a=t.markerEndOffset,s=t.points.points,o=s.length,l=s[0][0],c=s[0][1],u=s[o-1][0],h=s[o-1][1],d=0,f=0,v=0,g=0,p=0,y,b;e&&Ye(e)&&i&&(y=s[1][0]-s[0][0],b=s[1][1]-s[0][1],p=Math.atan2(b,y),d=Math.cos(p)*(i||0),f=Math.sin(p)*(i||0)),n&&Ye(n)&&a&&(y=s[o-2][0]-s[o-1][0],b=s[o-2][1]-s[o-1][1],p=Math.atan2(b,y),v=Math.cos(p)*(a||0),g=Math.sin(p)*(a||0)),r.moveTo(l+d,c+f);for(var E=1;E<o-1;E++){var O=s[E];r.lineTo(O[0],O[1])}r.lineTo(u+v,h+g)}function Mk(r,t){var e=t.x,n=e===void 0?0:e,i=t.y,a=i===void 0?0:i,s=t.radius,o=t.width,l=t.height,c=o,u=l,h=s&&s.some(function(k){return k!==0});if(!h)r.rect(n,a,c,u);else{var d=o>0?1:-1,f=l>0?1:-1,v=d+f===0,g=s.map(function(k){return kn(k,0,Math.min(Math.abs(c)/2,Math.abs(u)/2))}),p=(0,G.Z)(g,4),y=p[0],b=p[1],E=p[2],O=p[3];r.moveTo(d*y+n,a),r.lineTo(c-d*b+n,a),b!==0&&r.arc(c-d*b+n,f*b+a,b,-f*Math.PI/2,d>0?0:Math.PI,v),r.lineTo(c+n,u-f*E+a),E!==0&&r.arc(c-d*E+n,u-f*E+a,E,d>0?0:Math.PI,f>0?Math.PI/2:1.5*Math.PI,v),r.lineTo(d*O+n,u+a),O!==0&&r.arc(d*O+n,u-f*O+a,O,f>0?Math.PI/2:-Math.PI/2,d>0?Math.PI:0,v),r.lineTo(n,f*y+a),y!==0&&r.arc(d*y+n,f*y+a,y,d>0?Math.PI:0,f>0?Math.PI*1.5:Math.PI/2,v)}}var Ak=function(r){function t(){var e;(0,C.Z)(this,t);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return e=I(this,t,[].concat(i)),e.name="canvas-path-generator",e}return(0,L.Z)(t,r),(0,T.Z)(t,[{key:"init",value:function(){var n,i=(n={},(0,ae.Z)((0,ae.Z)((0,ae.Z)((0,ae.Z)((0,ae.Z)((0,ae.Z)((0,ae.Z)((0,ae.Z)((0,ae.Z)((0,ae.Z)(n,Dt.CIRCLE,yk),Dt.ELLIPSE,bk),Dt.RECT,Mk),Dt.LINE,xk),Dt.POLYLINE,Sk),Dt.POLYGON,wk),Dt.PATH,Ek),Dt.TEXT,void 0),Dt.GROUP,void 0),Dt.IMAGE,void 0),(0,ae.Z)((0,ae.Z)((0,ae.Z)(n,Dt.HTML,void 0),Dt.MESH,void 0),Dt.FRAGMENT,void 0));this.context.pathGeneratorFactory=i}},{key:"destroy",value:function(){delete this.context.pathGeneratorFactory}}])}(za);var Tk=xt(),Ok=xt(),Ck=xt(),Nk=oe(),e1=function(){function r(){var t=this;(0,C.Z)(this,r),this.isHit=function(e,n,i,a){var s=t.context.pointInPathPickerFactory[e.nodeName];if(s){var o=ee(Nk,i),l=Sn(Ok,fe(Ck,n[0],n[1],0),o);if(s(e,new yr(l[0],l[1]),a,t.isPointInPath,t.context,t.runtime))return!0}return!1},this.isPointInPath=function(e,n){var i=t.runtime.offscreenCanvasCreator.getOrCreateContext(t.context.config.offscreenCanvas),a=t.context.pathGeneratorFactory[e.nodeName];return a&&(i.beginPath(),a(i,e.parsedStyle),i.closePath()),i.isPointInPath(n.x,n.y)}}return(0,T.Z)(r,[{key:"apply",value:function(e,n){var i,a=this,s=e.renderingService,o=e.renderingContext;this.context=e,this.runtime=n;var l=(i=o.root)===null||i===void 0?void 0:i.ownerDocument;s.hooks.pick.tapPromise(r.tag,function(){var c=(0,Fa.Z)((0,Pr.Z)().mark(function u(h){return(0,Pr.Z)().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return d.abrupt("return",a.pick(l,h));case 1:case"end":return d.stop()}},u)}));return function(u){return c.apply(this,arguments)}}()),s.hooks.pickSync.tap(r.tag,function(c){return a.pick(l,c)})}},{key:"pick",value:function(e,n){var i=n.topmost,a=n.position,s=a.x,o=a.y,l=fe(Tk,s,o,0),c=e.elementsFromBBox(l[0],l[1],l[0],l[1]),u=[],h=vs(c),d;try{for(h.s();!(d=h.n()).done;){var f=d.value,v=f.getWorldTransform(),g=this.isHit(f,l,v,!1);if(g){var p=Vp(f);if(p){var y=p.parsedStyle.clipPath,b=this.isHit(y,l,y.getWorldTransform(),!0);if(b){if(i)return n.picked=[f],n;u.push(f)}}else{if(i)return n.picked=[f],n;u.push(f)}}}}catch(E){h.e(E)}finally{h.f()}return n.picked=u,n}}])}();e1.tag="CanvasPicker";function kk(r,t,e){var n=r.parsedStyle,i=n.cx,a=i===void 0?0:i,s=n.cy,o=s===void 0?0:s,l=n.r,c=n.fill,u=n.stroke,h=n.lineWidth,d=h===void 0?1:h,f=n.increasedLineWidthForHitTesting,v=f===void 0?0:f,g=n.pointerEvents,p=g===void 0?"auto":g,y=(d+v)/2,b=kr(a,o,t.x,t.y),E=Es(p,c,u),O=(0,G.Z)(E,2),k=O[0],P=O[1];return k&&P||e?b<=l+y:k?b<=l:P?b>=l-y&&b<=l+y:!1}function Nu(r,t,e,n){return r/(e*e)+t/(n*n)}function Pk(r,t,e){var n=r.parsedStyle,i=n.cx,a=i===void 0?0:i,s=n.cy,o=s===void 0?0:s,l=n.rx,c=n.ry,u=n.fill,h=n.stroke,d=n.lineWidth,f=d===void 0?1:d,v=n.increasedLineWidthForHitTesting,g=v===void 0?0:v,p=n.pointerEvents,y=p===void 0?"auto":p,b=t.x,E=t.y,O=Es(y,u,h),k=(0,G.Z)(O,2),P=k[0],F=k[1],B=(f+g)/2,V=(b-a)*(b-a),U=(E-o)*(E-o);return P&&F||e?Nu(V,U,l+B,c+B)<=1:P?Nu(V,U,l,c)<=1:F?Nu(V,U,l-B,c-B)>=1&&Nu(V,U,l+B,c+B)<=1:!1}function Fs(r,t,e,n,i,a){return i>=r&&i<=r+e&&a>=t&&a<=t+n}function Rk(r,t,e,n,i,a,s){var o=i/2;return Fs(r-o,t-o,e,i,a,s)||Fs(r+e-o,t-o,i,n,a,s)||Fs(r+o,t+n-o,e,i,a,s)||Fs(r-o,t+o,i,n,a,s)}function ku(r,t,e,n,i,a,s,o){var l=(Math.atan2(o-t,s-r)+Math.PI*2)%(Math.PI*2),c={x:r+e*Math.cos(l),y:t+e*Math.sin(l)};return kr(c.x,c.y,s,o)<=a/2}function Xa(r,t,e,n,i,a,s){var o=Math.min(r,e),l=Math.max(r,e),c=Math.min(t,n),u=Math.max(t,n),h=i/2;return a>=o-h&&a<=l+h&&s>=c-h&&s<=u+h?Gg(r,t,e,n,a,s)<=i/2:!1}function n1(r,t,e,n,i){var a=r.length;if(a<2)return!1;for(var s=0;s<a-1;s++){var o=r[s][0],l=r[s][1],c=r[s+1][0],u=r[s+1][1];if(Xa(o,l,c,u,t,e,n))return!0}if(i){var h=r[0],d=r[a-1];if(Xa(h[0],h[1],d[0],d[1],t,e,n))return!0}return!1}var Lk=1e-6;function sv(r){return Math.abs(r)<Lk?0:r<0?-1:1}function _k(r,t,e){return(e[0]-r[0])*(t[1]-r[1])===(t[0]-r[0])*(e[1]-r[1])&&Math.min(r[0],t[0])<=e[0]&&e[0]<=Math.max(r[0],t[0])&&Math.min(r[1],t[1])<=e[1]&&e[1]<=Math.max(r[1],t[1])}function r1(r,t,e){var n=!1,i=r.length;if(i<=2)return!1;for(var a=0;a<i;a++){var s=r[a],o=r[(a+1)%i];if(_k(s,o,[t,e]))return!0;sv(s[1]-e)>0!=sv(o[1]-e)>0&&sv(t-(e-s[1])*(s[0]-o[0])/(s[1]-o[1])-s[0])<0&&(n=!n)}return n}function i1(r,t,e){for(var n=!1,i=0;i<r.length;i++){var a=r[i];if(n=r1(a,t,e),n)break}return n}function Dk(r,t,e){var n=r.parsedStyle,i=n.x1,a=n.y1,s=n.x2,o=n.y2,l=n.lineWidth,c=l===void 0?1:l,u=n.increasedLineWidthForHitTesting,h=u===void 0?0:u,d=n.pointerEvents,f=d===void 0?"auto":d,v=n.fill,g=n.stroke,p=Es(f,v,g),y=(0,G.Z)(p,2),b=y[1];return!b&&!e||!c?!1:Xa(i,a,s,o,c+h,t.x,t.y)}function Ik(r,t,e,n,i){for(var a=!1,s=t/2,o=0;o<r.length;o++){var l=r[o],c=l.currentPoint,u=l.params,h=l.prePoint,d=l.box;if(!(d&&!Fs(d.x-s,d.y-s,d.width+t,d.height+t,e,n)))switch(l.command){case"L":case"Z":if(a=Xa(h[0],h[1],c[0],c[1],t,e,n),a)return!0;break;case"Q":var f=V2(h[0],h[1],u[1],u[2],u[3],u[4],e,n);if(a=f<=t/2,a)return!0;break;case"C":var v=Vg(h[0],h[1],u[1],u[2],u[3],u[4],u[5],u[6],e,n,i);if(a=v<=t/2,a)return!0;break;case"A":l.cubicParams||(l.cubicParams=Pd(h[0],h[1],u[1],u[2],u[3],u[4],u[5],u[6],u[7],void 0));for(var g=l.cubicParams,p=h,y=0;y<g.length;y+=6){var b=Vg(p[0],p[1],g[y],g[y+1],g[y+2],g[y+3],g[y+4],g[y+5],e,n,i);if(p=[g[y+4],g[y+5]],a=b<=t/2,a)return!0}break}}return a}function Bk(r,t,e,n,i,a){var s=r.parsedStyle,o=s.lineWidth,l=o===void 0?1:o,c=s.increasedLineWidthForHitTesting,u=c===void 0?0:c,h=s.stroke,d=s.fill,f=s.d,v=s.pointerEvents,g=v===void 0?"auto":v,p=f.segments,y=f.hasArc,b=f.polylines,E=f.polygons,O=Es(g,(E==null?void 0:E.length)&&d,h),k=(0,G.Z)(O,2),P=k[0],F=k[1],B=Jd(r),V=!1;return P||e?(y?V=n(r,t):V=i1(E,t.x,t.y)||i1(b,t.x,t.y),V):((F||e)&&(V=Ik(p,l+u,t.x,t.y,B)),V)}function Fk(r,t,e){var n=r.parsedStyle,i=n.stroke,a=n.fill,s=n.lineWidth,o=s===void 0?1:s,l=n.increasedLineWidthForHitTesting,c=l===void 0?0:l,u=n.points,h=n.pointerEvents,d=h===void 0?"auto":h,f=Es(d,a,i),v=(0,G.Z)(f,2),g=v[0],p=v[1],y=!1;return(p||e)&&(y=n1(u.points,o+c,t.x,t.y,!0)),!y&&(g||e)&&(y=r1(u.points,t.x,t.y)),y}function zk(r,t,e){var n=r.parsedStyle,i=n.lineWidth,a=i===void 0?1:i,s=n.increasedLineWidthForHitTesting,o=s===void 0?0:s,l=n.points,c=n.pointerEvents,u=c===void 0?"auto":c,h=n.fill,d=n.stroke,f=Es(u,h,d),v=(0,G.Z)(f,2),g=v[1];return!g&&!e||!a?!1:n1(l.points,a+o,t.x,t.y,!1)}function jk(r,t,e,n,i){var a=r.parsedStyle,s=a.radius,o=a.fill,l=a.stroke,c=a.lineWidth,u=c===void 0?1:c,h=a.increasedLineWidthForHitTesting,d=h===void 0?0:h,f=a.x,v=f===void 0?0:f,g=a.y,p=g===void 0?0:g,y=a.width,b=a.height,E=a.pointerEvents,O=E===void 0?"auto":E,k=Es(O,o,l),P=(0,G.Z)(k,2),F=P[0],B=P[1],V=s&&s.some(function(at){return at!==0}),U=u+d;if(V){var $=!1;return(B||e)&&($=Gk(v,p,y,b,s.map(function(at){return kn(at,0,Math.min(Math.abs(y)/2,Math.abs(b)/2))}),U,t.x,t.y)),!$&&(F||e)&&($=n(r,t)),$}else{var J=U/2;if(F&&B||e)return Fs(v-J,p-J,y+J,b+J,t.x,t.y);if(F)return Fs(v,p,y,b,t.x,t.y);if(B)return Rk(v,p,y,b,U,t.x,t.y)}return!1}function Gk(r,t,e,n,i,a,s,o){var l=(0,G.Z)(i,4),c=l[0],u=l[1],h=l[2],d=l[3];return Xa(r+c,t,r+e-u,t,a,s,o)||Xa(r+e,t+u,r+e,t+n-h,a,s,o)||Xa(r+e-h,t+n,r+d,t+n,a,s,o)||Xa(r,t+n-d,r,t+c,a,s,o)||ku(r+e-u,t+u,u,1.5*Math.PI,2*Math.PI,a,s,o)||ku(r+e-h,t+n-h,h,0,.5*Math.PI,a,s,o)||ku(r+d,t+n-d,d,.5*Math.PI,Math.PI,a,s,o)||ku(r+c,t+c,c,Math.PI,1.5*Math.PI,a,s,o)}function Wk(r,t,e,n,i,a){var s=r.parsedStyle,o=s.pointerEvents,l=o===void 0?"auto":o,c=s.x,u=c===void 0?0:c,h=s.y,d=h===void 0?0:h,f=s.width,v=s.height;if(l==="non-transparent-pixel"){var g=i.config.offscreenCanvas,p=a.offscreenCanvasCreator.getOrCreateCanvas(g),y=a.offscreenCanvasCreator.getOrCreateContext(g,{willReadFrequently:!0});p.width=f,p.height=v,i.defaultStyleRendererFactory[Dt.IMAGE].render(y,(0,z.Z)((0,z.Z)({},r.parsedStyle),{},{x:0,y:0}),r,void 0,void 0,void 0);var b=y.getImageData(t.x-u,t.y-d,1,1).data;return b.every(function(E){return E!==0})}return!0}function Zk(r,t,e,n){var i=r.getGeometryBounds();return t.x>=i.min[0]&&t.y>=i.min[1]&&t.x<=i.max[0]&&t.y<=i.max[1]}var Vk=function(r){function t(){var e;(0,C.Z)(this,t);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return e=I(this,t,[].concat(i)),e.name="canvas-picker",e}return(0,L.Z)(t,r),(0,T.Z)(t,[{key:"init",value:function(){var n,i=(n={},(0,ae.Z)((0,ae.Z)((0,ae.Z)((0,ae.Z)((0,ae.Z)((0,ae.Z)((0,ae.Z)((0,ae.Z)((0,ae.Z)((0,ae.Z)(n,Dt.CIRCLE,kk),Dt.ELLIPSE,Pk),Dt.RECT,jk),Dt.LINE,Dk),Dt.POLYLINE,zk),Dt.POLYGON,Fk),Dt.PATH,Bk),Dt.TEXT,Zk),Dt.GROUP,null),Dt.IMAGE,Wk),(0,ae.Z)((0,ae.Z)(n,Dt.HTML,null),Dt.MESH,null));this.context.pointInPathPickerFactory=i,this.addRenderingPlugin(new e1)}},{key:"destroy",value:function(){delete this.context.pointInPathPickerFactory,this.removeAllRenderingPlugins()}}])}(za);function da(r,t){if(!{}.hasOwnProperty.call(r,t))throw new TypeError("attempted to use private field on non-instance");return r}var Uk=0;function Yk(r){return"__private_"+Uk+++"_"+r}var Hk=function(){function r(){(0,C.Z)(this,r),this.cacheStore=new Map}return(0,T.Z)(r,[{key:"onRefAdded",value:function(e){}},{key:"has",value:function(e){return this.cacheStore.has(e)}},{key:"put",value:function(e,n,i){return this.cacheStore.has(e)?!1:(this.cacheStore.set(e,{value:n,counter:new Set([i.entity])}),this.onRefAdded(i),!0)}},{key:"get",value:function(e,n){var i=this.cacheStore.get(e);return i?(i.counter.has(n.entity)||(i.counter.add(n.entity),this.onRefAdded(n)),i.value):null}},{key:"update",value:function(e,n,i){var a=this.cacheStore.get(e);return a?(a.value=(0,z.Z)((0,z.Z)({},a.value),n),a.counter.has(i.entity)||(a.counter.add(i.entity),this.onRefAdded(i)),!0):!1}},{key:"release",value:function(e,n){var i=this.cacheStore.get(e);return i?(i.counter.delete(n.entity),i.counter.size<=0&&this.cacheStore.delete(e),!0):!1}},{key:"releaseRef",value:function(e){var n=this;Array.from(this.cacheStore.keys()).forEach(function(i){n.release(i,e)})}},{key:"getSize",value:function(){return this.cacheStore.size}},{key:"clear",value:function(){this.cacheStore.clear()}}])}(),ov=[],lv=[],cv=function(){function r(){(0,C.Z)(this,r)}return(0,T.Z)(r,null,[{key:"stop",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:r.api;r.rafId&&(e.cancelAnimationFrame(r.rafId),r.rafId=null)}},{key:"executeTask",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:r.api;ov.length<=0&&lv.length<=0||(lv.forEach(function(n){return n()}),lv=ov.splice(0,r.TASK_NUM_PER_FRAME),r.rafId=e.requestAnimationFrame(function(){r.executeTask(e)}))}},{key:"sliceImage",value:function(e,n,i,a){for(var s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:r.api,l=e.naturalWidth||e.width,c=e.naturalHeight||e.height,u=n-s,h=i-s,d=Math.ceil(l/u),f=Math.ceil(c/h),v={tileSize:[n,i],gridSize:[f,d],tiles:Array(f).fill(null).map(function(){return Array(d).fill(null)})},g=function(b){for(var E=function(P){ov.push(function(){var F=P*u,B=b*h,V=[Math.min(n,l-F),Math.min(i,c-B)],U=V[0],J=V[1],$=o.createCanvas();$.width=n,$.height=i;var at=$.getContext("2d");at.drawImage(e,F,B,U,J,0,0,U,J),v.tiles[b][P]={x:F,y:B,tileX:P,tileY:b,data:$},a()})},O=0;O<d;O++)E(O)},p=0;p<f;p++)g(p);return r.stop(),r.executeTask(),v}}])}();cv.TASK_NUM_PER_FRAME=10;var vi=new Hk;vi.onRefAdded=function(t){var e=this;t.addEventListener(Fe.DESTROY,function(){e.releaseRef(t)},{once:!0})};var uv=function(){function r(t,e){(0,C.Z)(this,r),this.gradientCache={},this.patternCache={},this.context=t,this.runtime=e}return(0,T.Z)(r,[{key:"getImageSync",value:function(e,n,i){var a=Ue(e)?e:e.src;if(vi.has(a)){var s=vi.get(a,n);if(s.img.complete)return i==null||i(s),s}return this.getOrCreateImage(e,n).then(function(o){i==null||i(o)}).catch(function(o){console.error(o)}),null}},{key:"getOrCreateImage",value:function(e,n){var i=this,a=Ue(e)?e:e.src;if(!Ue(e)&&!vi.has(a)){var s={img:e,size:[e.naturalWidth||e.width,e.naturalHeight||e.height],tileSize:Pu(e)};vi.put(a,s,n)}if(vi.has(a)){var o=vi.get(a,n);return o.img.complete?Promise.resolve(o):new Promise(function(l,c){o.img.addEventListener("load",function(){o.size=[o.img.naturalWidth||o.img.width,o.img.naturalHeight||o.img.height],o.tileSize=Pu(o.img),l(o)}),o.img.addEventListener("error",function(u){c(u)})})}return new Promise(function(l,c){var u=i.context.config.createImage();if(u){var h={img:u,size:[0,0],tileSize:Pu(u)};vi.put(a,h,n),u.onload=function(){h.size=[u.naturalWidth||u.width,u.naturalHeight||u.height],h.tileSize=Pu(h.img),l(h)},u.onerror=function(d){c(d)},u.crossOrigin="Anonymous",u.src=a}})}},{key:"createDownSampledImage",value:function(){var t=(0,Fa.Z)((0,Pr.Z)().mark(function n(i,a){var s,o,l,c,u,h,d,f,v,g,p,y,b,E;return(0,Pr.Z)().wrap(function(O){for(;;)switch(O.prev=O.next){case 0:return O.next=1,this.getOrCreateImage(i,a);case 1:if(s=O.sent,typeof s.downSamplingRate=="undefined"){O.next=2;break}return O.abrupt("return",s);case 2:if(o=this.context.config.enableLargeImageOptimization,l=typeof o=="boolean"?{}:o,c=l.maxDownSampledImageSize,u=c===void 0?2048:c,h=l.downSamplingRateThreshold,d=h===void 0?.5:h,f=this.runtime.globalThis.createImageBitmap,v=(0,G.Z)(s.size,2),g=v[0],p=v[1],y=s.img,b=Math.min((u+u)/(g+p),Math.max(.01,Math.min(d,.5))),E=(0,z.Z)((0,z.Z)({},s),{},{downSamplingRate:b}),vi.update(s.img.src,E,a),!f){O.next=7;break}return O.prev=3,O.next=4,f(s.img,{resizeWidth:g*b,resizeHeight:p*b});case 4:y=O.sent,O.next=6;break;case 5:O.prev=5,O.catch(3),b=1;case 6:O.next=8;break;case 7:b=1;case 8:return E=(0,z.Z)((0,z.Z)({},this.getImageSync(i,a)),{},{downSampled:y,downSamplingRate:b}),vi.update(s.img.src,E,a),O.abrupt("return",E);case 9:case"end":return O.stop()}},n,this,[[3,5]])}));function e(n,i){return t.apply(this,arguments)}return e}()},{key:"createImageTiles",value:function(){var t=(0,Fa.Z)((0,Pr.Z)().mark(function n(i,a,s,o){var l,c,u,h,d;return(0,Pr.Z)().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return f.next=1,this.getOrCreateImage(i,o);case 1:return l=f.sent,c=o.ownerDocument.defaultView,u=c.requestAnimationFrame,h=c.cancelAnimationFrame,cv.api={requestAnimationFrame:u,cancelAnimationFrame:h,createCanvas:function(){return ff.createCanvas()}},d=(0,z.Z)((0,z.Z)({},l),cv.sliceImage(l.img,l.tileSize[0],l.tileSize[0],s)),vi.update(l.img.src,d,o),f.abrupt("return",d);case 2:case"end":return f.stop()}},n,this)}));function e(n,i,a,s){return t.apply(this,arguments)}return e}()},{key:"releaseImage",value:function(e,n){vi.release(Ue(e)?e:e.src,n)}},{key:"releaseImageRef",value:function(e){vi.releaseRef(e)}},{key:"getOrCreatePatternSync",value:function(e,n,i,a,s,o,l){var c=this.generatePatternKey(n);if(c&&this.patternCache[c])return this.patternCache[c];var u=n.image,h=n.repetition,d=n.transform,f,v=!1;if(Ue(u)){var g=this.getImageSync(u,e,l);f=g==null?void 0:g.img}else a?(f=a,v=!0):f=u;var p=f&&i.createPattern(f,h);if(p){var y;d?y=tm(Bp(d),new xn({})):y=Et(oe()),v&&mn(y,y,[1/s,1/s,1]),p.setTransform({a:y[0],b:y[1],c:y[4],d:y[5],e:y[12]+o[0],f:y[13]+o[1]})}return c&&p&&(this.patternCache[c]=p),p}},{key:"getOrCreateGradient",value:function(e,n){var i=this.generateGradientKey(e),a=e.type,s=e.steps,o=e.min,l=e.width,c=e.height,u=e.angle,h=e.cx,d=e.cy,f=e.size;if(this.gradientCache[i])return this.gradientCache[i];var v=null;if(a===ja.LinearGradient){var g=ZS(o,l,c,u),p=g.x1,y=g.y1,b=g.x2,E=g.y2;v=n.createLinearGradient(p,y,b,E)}else if(a===ja.RadialGradient){var O=VS(o,l,c,h,d,f),k=O.x,P=O.y,F=O.r;v=n.createRadialGradient(k,P,0,k,P,F)}return v&&(s.forEach(function(B){var V=B.offset,U=B.color;if(V.unit===te.kPercentage){var J;(J=v)===null||J===void 0||J.addColorStop(V.value/100,U.toString())}}),this.gradientCache[i]=v),this.gradientCache[i]}},{key:"generateGradientKey",value:function(e){var n=e.type,i=e.min,a=e.width,s=e.height,o=e.steps,l=e.angle,c=e.cx,u=e.cy,h=e.size;return"gradient-".concat(n,"-").concat((l==null?void 0:l.toString())||0,"-").concat((c==null?void 0:c.toString())||0,"-").concat((u==null?void 0:u.toString())||0,"-").concat((h==null?void 0:h.toString())||0,"-").concat(i[0],"-").concat(i[1],"-").concat(a,"-").concat(s,"-").concat(o.map(function(d){var f=d.offset,v=d.color;return"".concat(f).concat(v)}).join("-"))}},{key:"generatePatternKey",value:function(e){var n=e.image,i=e.repetition;if(Ue(n))return"pattern-".concat(n,"-").concat(i);if(n.nodeName==="rect")return"pattern-".concat(n.entity,"-").concat(i)}}])}();uv.isSupportTile=!!ff.createCanvas();function Pu(r){if(!r.complete)return[0,0];var t=r.naturalWidth||r.width,e=r.naturalHeight||r.height,n=256;return[256,512].forEach(function(i){var a=Math.ceil(e/i),s=Math.ceil(t/i);a*s<1e3&&(n=i)}),[n,n]}var a1=function(){function r(){(0,C.Z)(this,r)}return(0,T.Z)(r,[{key:"apply",value:function(e){var n=e.renderingService,i=e.renderingContext,a=e.imagePool,s=i.root.ownerDocument.defaultView,o=function(h,d,f){var v=h.parsedStyle,g=v.width,p=v.height;g&&!p?h.setAttribute("height",f/d*g):!g&&p&&h.setAttribute("width",d/f*p)},l=function(h){var d=h.target,f=d.nodeName,v=d.attributes;if(f===Dt.IMAGE){var g=v.src,p=v.keepAspectRatio;a.getImageSync(g,d,function(y){var b=y.img,E=b.width,O=b.height;p&&o(d,E,O),d.renderable.dirty=!0,n.dirtify()})}},c=function(h){var d=h.target,f=h.attrName,v=h.prevValue,g=h.newValue;d.nodeName!==Dt.IMAGE||f!=="src"||(v!==g&&a.releaseImage(v,d),Ue(g)&&a.getOrCreateImage(g,d).then(function(p){var y=p.img,b=y.width,E=y.height;d.attributes.keepAspectRatio&&o(d,b,E),d.renderable.dirty=!0,n.dirtify()}).catch(function(){}))};n.hooks.init.tap(r.tag,function(){s.addEventListener(Fe.MOUNTED,l),s.addEventListener(Fe.ATTR_MODIFIED,c)}),n.hooks.destroy.tap(r.tag,function(){s.removeEventListener(Fe.MOUNTED,l),s.removeEventListener(Fe.ATTR_MODIFIED,c)})}}])}();a1.tag="LoadImage";var Xk=function(r){function t(){var e;(0,C.Z)(this,t);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return e=I(this,t,[].concat(i)),e.name="image-loader",e}return(0,L.Z)(t,r),(0,T.Z)(t,[{key:"init",value:function(n){this.context.imagePool=new uv(this.context,n),this.addRenderingPlugin(new a1)}},{key:"destroy",value:function(){this.removeAllRenderingPlugins()}}])}(za);var Vn=Yk("renderState"),s1=function(){function r(t){(0,C.Z)(this,r),this.removedRBushNodeAABBs=[],this.renderQueue=[],Object.defineProperty(this,Vn,{writable:!0,value:{restoreStack:[],prevObject:null,currentContext:new Map}}),this.clearFullScreenLastFrame=!1,this.clearFullScreen=!1,this.vpMatrix=oe(),this.dprMatrix=oe(),this.tmpMat4=oe(),this.vec3a=xt(),this.vec3b=xt(),this.vec3c=xt(),this.vec3d=xt(),this.canvasRendererPluginOptions=t}return(0,T.Z)(r,[{key:"apply",value:function(e,n){var i=this;this.context=e;var a=this.context,s=a.config,o=a.camera,l=a.renderingService,c=a.renderingContext,u=a.rBushRoot,h=a.pathGeneratorFactory,d=s.renderer.getConfig().enableRenderingOptimization;s.renderer.getConfig().enableDirtyCheck=!1,s.renderer.getConfig().enableDirtyRectangleRendering=!1,this.rBush=u,this.pathGeneratorFactory=h;var f=e.contextService,v=c.root.ownerDocument.defaultView,g=function(O){var k=O.target,P=k.rBushNode;P!=null&&P.aabb&&i.removedRBushNodeAABBs.push(P.aabb)},p=function(O){var k=O.target,P=k.rBushNode;P.aabb&&i.removedRBushNodeAABBs.push(P.aabb)};l.hooks.init.tap(r.tag,function(){v.addEventListener(Fe.UNMOUNTED,g),v.addEventListener(Fe.CULLED,p);var E=f.getDPR(),O=s.width,k=s.height,P=f.getContext();i.clearRect(P,0,0,O*E,k*E,s.background)}),l.hooks.destroy.tap(r.tag,function(){v.removeEventListener(Fe.UNMOUNTED,g),v.removeEventListener(Fe.CULLED,p),i.renderQueue=[],i.removedRBushNodeAABBs=[],da(i,Vn)[Vn]={restoreStack:[],prevObject:null,currentContext:null}});var y=function(){var O,k=f.getContext(),P=f.getDPR(),F=s.width,B=s.height,V=i.canvasRendererPluginOptions,U=V.dirtyObjectNumThreshold,J=V.dirtyObjectRatioThreshold,$=l.getStats(),at=$.total,ct=$.rendered,ft=ct/at;i.clearFullScreen=i.clearFullScreenLastFrame||!((O=v.context.renderingPlugins[1])!==null&&O!==void 0&&O.isFirstTimeRenderingFinished)||l.disableDirtyRectangleRendering()||ct>U&&ft>J,k&&(typeof k.resetTransform=="function"?k.resetTransform():k.setTransform(1,0,0,1,0,0),i.clearFullScreen&&i.clearRect(k,0,0,F*P,B*P,s.background))},b=function(O,k){for(var P=[O];P.length>0;){var F,B=P.pop();B.isVisible()&&!B.isCulled()&&(d?i.renderDisplayObjectOptimized(B,k,i.context,da(i,Vn)[Vn],n):i.renderDisplayObject(B,k,i.context,da(i,Vn)[Vn],n));for(var V=((F=B.sortable)===null||F===void 0||(F=F.sorted)===null||F===void 0?void 0:F.length)>0?B.sortable.sorted:B.childNodes,U=V.length-1;U>=0;U--)P.push(V[U])}};l.hooks.endFrame.tap(r.tag,function(){if(y(),c.root.childNodes.length===0){i.clearFullScreenLastFrame=!0;return}d=s.renderer.getConfig().enableRenderingOptimization,da(i,Vn)[Vn]={restoreStack:[],prevObject:null,currentContext:da(i,Vn)[Vn].currentContext},da(i,Vn)[Vn].currentContext.clear(),i.clearFullScreenLastFrame=!1;var E=f.getContext(),O=f.getDPR();if(De(i.dprMatrix,[O,O,1]),Re(i.vpMatrix,i.dprMatrix,o.getOrthoMatrix()),i.clearFullScreen)d?(E.save(),b(c.root,E),E.restore()):b(c.root,E),i.removedRBushNodeAABBs=[];else{var k=i.safeMergeAABB.apply(i,[i.mergeDirtyAABBs(i.renderQueue)].concat((0,N.Z)(i.removedRBushNodeAABBs.map(function(le){var Ee=le.minX,Ne=le.minY,We=le.maxX,He=le.maxY,cr=new yn;return cr.setMinMax([Ee,Ne,0],[We,He,0]),cr}))));if(i.removedRBushNodeAABBs=[],yn.isEmpty(k)){i.renderQueue=[];return}var P=i.convertAABB2Rect(k),F=P.x,B=P.y,V=P.width,U=P.height,J=Sn(i.vec3a,[F,B,0],i.vpMatrix),$=Sn(i.vec3b,[F+V,B,0],i.vpMatrix),at=Sn(i.vec3c,[F,B+U,0],i.vpMatrix),ct=Sn(i.vec3d,[F+V,B+U,0],i.vpMatrix),ft=Math.min(J[0],$[0],ct[0],at[0]),Nt=Math.min(J[1],$[1],ct[1],at[1]),Ct=Math.max(J[0],$[0],ct[0],at[0]),gt=Math.max(J[1],$[1],ct[1],at[1]),bt=Math.floor(ft),Pt=Math.floor(Nt),zt=Math.ceil(Ct-ft),Ut=Math.ceil(gt-Nt);E.save(),i.clearRect(E,bt,Pt,zt,Ut,s.background),E.beginPath(),E.rect(bt,Pt,zt,Ut),E.clip(),E.setTransform(i.vpMatrix[0],i.vpMatrix[1],i.vpMatrix[4],i.vpMatrix[5],i.vpMatrix[12],i.vpMatrix[13]);var $t=s.renderer.getConfig(),re=$t.enableDirtyRectangleRenderingDebug;re&&v.dispatchEvent(new Jn(ci.DIRTY_RECTANGLE,{dirtyRect:{x:bt,y:Pt,width:zt,height:Ut}}));var ce=i.searchDirtyObjects(k);ce.sort(function(le,Ee){return le.sortable.renderOrder-Ee.sortable.renderOrder}).forEach(function(le){le&&le.isVisible()&&!le.isCulled()&&i.renderDisplayObject(le,E,i.context,da(i,Vn)[Vn],n)}),E.restore(),i.renderQueue.forEach(function(le){i.saveDirtyAABB(le)}),i.renderQueue=[]}da(i,Vn)[Vn].restoreStack.forEach(function(){E.restore()}),da(i,Vn)[Vn].restoreStack=[]}),l.hooks.render.tap(r.tag,function(E){i.clearFullScreen||i.renderQueue.push(E)})}},{key:"clearRect",value:function(e,n,i,a,s,o){e.clearRect(n,i,a,s),o&&(e.fillStyle=o,e.fillRect(n,i,a,s))}},{key:"renderDisplayObjectOptimized",value:function(e,n,i,a,s){var o=e.nodeName,l=!1,c=!1,u=this.context.styleRendererFactory[o],h=this.pathGeneratorFactory[o],d=e.parsedStyle.clipPath;if(d){l=!a.prevObject||!Td(d.getWorldTransform(),a.prevObject.getWorldTransform()),l&&(this.applyWorldTransform(n,d),a.prevObject=null);var f=this.pathGeneratorFactory[d.nodeName];f&&(n.save(),c=!0,n.beginPath(),f(n,d.parsedStyle),n.closePath(),n.clip())}if(u){l=!a.prevObject||!Td(e.getWorldTransform(),a.prevObject.getWorldTransform()),l&&this.applyWorldTransform(n,e);var v=!a.prevObject;if(!v){var g=a.prevObject.nodeName;o===Dt.TEXT?v=g!==Dt.TEXT:o===Dt.IMAGE?v=g!==Dt.IMAGE:v=g===Dt.TEXT||g===Dt.IMAGE}u.applyStyleToContext(n,e,v,a),a.prevObject=e}h&&(n.beginPath(),h(n,e.parsedStyle),o!==Dt.LINE&&o!==Dt.PATH&&o!==Dt.POLYLINE&&n.closePath()),u&&u.drawToContext(n,e,da(this,Vn)[Vn],this,s),c&&n.restore(),e.dirty(!1)}},{key:"renderDisplayObject",value:function(e,n,i,a,s){var o=e.nodeName,l=a.restoreStack[a.restoreStack.length-1];l&&!(e.compareDocumentPosition(l)&On.DOCUMENT_POSITION_CONTAINS)&&(n.restore(),a.restoreStack.pop());var c=this.context.styleRendererFactory[o],u=this.pathGeneratorFactory[o],h=e.parsedStyle.clipPath;if(h){this.applyWorldTransform(n,h);var d=this.pathGeneratorFactory[h.nodeName];d&&(n.save(),a.restoreStack.push(e),n.beginPath(),d(n,h.parsedStyle),n.closePath(),n.clip())}c&&(this.applyWorldTransform(n,e),n.save(),this.applyAttributesToContext(n,e)),u&&(n.beginPath(),u(n,e.parsedStyle),o!==Dt.LINE&&o!==Dt.PATH&&o!==Dt.POLYLINE&&n.closePath()),c&&(c.render(n,e.parsedStyle,e,i,this,s),n.restore()),e.dirty(!1)}},{key:"applyAttributesToContext",value:function(e,n){var i=n.parsedStyle,a=i.stroke,s=i.fill,o=i.opacity,l=i.lineDash,c=i.lineDashOffset;l&&e.setLineDash(l),be(c)||(e.lineDashOffset=c),be(o)||(e.globalAlpha*=o),!be(a)&&!Array.isArray(a)&&!a.isNone&&(e.strokeStyle=n.attributes.stroke),!be(s)&&!Array.isArray(s)&&!s.isNone&&(e.fillStyle=n.attributes.fill)}},{key:"convertAABB2Rect",value:function(e){var n=e.getMin(),i=e.getMax(),a=Math.floor(n[0]),s=Math.floor(n[1]),o=Math.ceil(i[0]),l=Math.ceil(i[1]),c=o-a,u=l-s;return{x:a,y:s,width:c,height:u}}},{key:"mergeDirtyAABBs",value:function(e){var n=new yn;return e.forEach(function(i){var a=i.getRenderBounds();n.add(a);var s=i.renderable.dirtyRenderBounds;s&&n.add(s)}),n}},{key:"searchDirtyObjects",value:function(e){var n=e.getMin(),i=(0,G.Z)(n,2),a=i[0],s=i[1],o=e.getMax(),l=(0,G.Z)(o,2),c=l[0],u=l[1],h=this.rBush.search({minX:a,minY:s,maxX:c,maxY:u});return h.map(function(d){var f=d.displayObject;return f})}},{key:"saveDirtyAABB",value:function(e){var n=e.renderable;n.dirtyRenderBounds||(n.dirtyRenderBounds=new yn);var i=e.getRenderBounds();i&&n.dirtyRenderBounds.update(i.center,i.halfExtents)}},{key:"applyWorldTransform",value:function(e,n,i){i?(me(this.tmpMat4,n.getLocalTransform()),Re(this.tmpMat4,i,this.tmpMat4),Re(this.tmpMat4,this.vpMatrix,this.tmpMat4)):(me(this.tmpMat4,n.getWorldTransform()),Re(this.tmpMat4,this.vpMatrix,this.tmpMat4)),e.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 e=new yn,n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return i.forEach(function(s){e.add(s)}),e}}])}();s1.tag="CanvasRenderer";function Ru(r,t,e,n,i,a,s){var o,l;if(r.image.nodeName==="rect"){var c=r.image.parsedStyle,u=c.width,h=c.height;l=n.contextService.getDPR();var d=n.config.offscreenCanvas;o=a.offscreenCanvasCreator.getOrCreateCanvas(d),o.width=u*l,o.height=h*l;var f=a.offscreenCanvasCreator.getOrCreateContext(d),v={restoreStack:[],prevObject:null,currentContext:new Map};r.image.forEach(function(p){i.renderDisplayObject(p,f,n,v,a)}),v.restoreStack.forEach(function(){f.restore()})}var g=s.getOrCreatePatternSync(t,r,e,o,l,t.getGeometryBounds().min,function(){t.dirty(),n.renderingService.dirtify()});return g}function Lu(r,t,e,n){var i;if(r.type===ja.LinearGradient||r.type===ja.RadialGradient){var a=t.getGeometryBounds(),s=a&&a.halfExtents[0]*2||1,o=a&&a.halfExtents[1]*2||1,l=a&&a.min||[0,0];i=n.getOrCreateGradient((0,z.Z)((0,z.Z)({type:r.type},r.value),{},{min:l,width:s,height:o}),e)}return i}var _u=["shadowBlur","shadowOffsetX","shadowOffsetY"],o1=["lineCap","lineJoin","miterLimit"],$n={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},l1={};function Rn(r,t,e,n){var i=n.has(t)?n.get(t):$n[t];return i!==e&&(t==="lineDash"?r.setLineDash(e):r[t]=e,n.set(t,e)),i}var Kk=function(){function r(t){(0,C.Z)(this,r),this.imagePool=t}return(0,T.Z)(r,[{key:"applyAttributesToContext",value:function(e,n){}},{key:"render",value:function(e,n,i,a,s,o){}},{key:"applyCommonStyleToContext",value:function(e,n,i,a){var s=i?l1:a.prevObject.parsedStyle,o=n.parsedStyle;(i||o.opacity!==s.opacity)&&Rn(e,"globalAlpha",be(o.opacity)?$n.globalAlpha:o.opacity,a.currentContext),(i||o.blend!==s.blend)&&Rn(e,"globalCompositeOperation",be(o.blend)?$n.globalCompositeOperation:o.blend,a.currentContext)}},{key:"applyStrokeFillStyleToContext",value:function(e,n,i,a){var s=i?l1:a.prevObject.parsedStyle,o=n.parsedStyle,l=o.lineWidth,c=l===void 0?$n.lineWidth:l,u=o.fill&&!o.fill.isNone,h=o.stroke&&!o.stroke.isNone&&c>0;if(h){if(i||n.attributes.stroke!==a.prevObject.attributes.stroke){var d=!be(o.stroke)&&!Array.isArray(o.stroke)&&!o.stroke.isNone?n.attributes.stroke:$n.strokeStyle;Rn(e,"strokeStyle",d,a.currentContext)}(i||o.lineWidth!==s.lineWidth)&&Rn(e,"lineWidth",be(o.lineWidth)?$n.lineWidth:o.lineWidth,a.currentContext),(i||o.lineDash!==s.lineDash)&&Rn(e,"lineDash",o.lineDash||$n.lineDash,a.currentContext),(i||o.lineDashOffset!==s.lineDashOffset)&&Rn(e,"lineDashOffset",be(o.lineDashOffset)?$n.lineDashOffset:o.lineDashOffset,a.currentContext);for(var f=0;f<o1.length;f++){var v=o1[f];(i||o[v]!==s[v])&&Rn(e,v,be(o[v])?$n[v]:o[v],a.currentContext)}}if(u&&(i||n.attributes.fill!==a.prevObject.attributes.fill)){var g=!be(o.fill)&&!Array.isArray(o.fill)&&!o.fill.isNone?n.attributes.fill:$n.fillStyle;Rn(e,"fillStyle",g,a.currentContext)}}},{key:"applyStyleToContext",value:function(e,n,i,a){var s=n.nodeName;this.applyCommonStyleToContext(e,n,i,a),s===Dt.IMAGE||this.applyStrokeFillStyleToContext(e,n,i,a)}},{key:"applyShadowAndFilterStyleToContext",value:function(e,n,i,a){var s=n.parsedStyle;if(i){Rn(e,"shadowColor",s.shadowColor.toString(),a.currentContext);for(var o=0;o<_u.length;o++){var l=_u[o];Rn(e,l,s[l]||$n[l],a.currentContext)}}s.filter&&s.filter.length&&Rn(e,"filter",n.attributes.filter,a.currentContext)}},{key:"clearShadowAndFilterStyleForContext",value:function(e,n,i,a){var s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(n){Rn(e,"shadowColor",$n.shadowColor,a.currentContext);for(var o=0;o<_u.length;o++){var l=_u[o];Rn(e,l,$n[l],a.currentContext)}}if(i)if(n&&s){var c=e.filter;!be(c)&&c.indexOf("drop-shadow")>-1&&Rn(e,"filter",c.replace(/drop-shadow\([^)]*\)/,"").trim()||$n.filter,a.currentContext)}else Rn(e,"filter",$n.filter,a.currentContext)}},{key:"fillToContext",value:function(e,n,i,a,s){var o=this,l=n.parsedStyle,c=l.fill,u=l.fillRule,h=null;if(Array.isArray(c)&&c.length>0)c.forEach(function(f){var v=Rn(e,"fillStyle",Lu(f,n,e,o.imagePool),i.currentContext);h=h!=null?h:v,u?e.fill(u):e.fill()});else{if(bs(c)){var d=Ru(c,n,e,n.ownerDocument.defaultView.context,a,s,this.imagePool);d&&(e.fillStyle=d,h=!0)}u?e.fill(u):e.fill()}h!==null&&Rn(e,"fillStyle",h,i.currentContext)}},{key:"strokeToContext",value:function(e,n,i,a,s){var o=this,l=n.parsedStyle.stroke,c=null;if(Array.isArray(l)&&l.length>0)l.forEach(function(d){var f=Rn(e,"strokeStyle",Lu(d,n,e,o.imagePool),i.currentContext);c=c!=null?c:f,e.stroke()});else{if(bs(l)){var u=Ru(l,n,e,n.ownerDocument.defaultView.context,a,s,this.imagePool);if(u){var h=Rn(e,"strokeStyle",u,i.currentContext);c=c!=null?c:h}}e.stroke()}c!==null&&Rn(e,"strokeStyle",c,i.currentContext)}},{key:"drawToContext",value:function(e,n,i,a,s){var o,l=n.nodeName,c=n.parsedStyle,u=c.opacity,h=u===void 0?$n.globalAlpha:u,d=c.fillOpacity,f=d===void 0?$n.fillOpacity:d,v=c.strokeOpacity,g=v===void 0?$n.strokeOpacity:v,p=c.lineWidth,y=p===void 0?$n.lineWidth:p,b=c.fill&&!c.fill.isNone,E=c.stroke&&!c.stroke.isNone&&y>0;if(!(!b&&!E)){var O=!be(c.shadowColor)&&c.shadowBlur>0,k=c.shadowType==="inner",P=((o=c.fill)===null||o===void 0?void 0:o.alpha)===0,F=!!(c.filter&&c.filter.length),B=O&&E&&(l===Dt.PATH||l===Dt.LINE||l===Dt.POLYLINE||P||k),V=null;if(b){B||this.applyShadowAndFilterStyleToContext(e,n,O,i);var U=h*f;V=Rn(e,"globalAlpha",U,i.currentContext),this.fillToContext(e,n,i,a,s),B||this.clearShadowAndFilterStyleForContext(e,O,F,i)}if(E){var J=!1,$=h*g,at=Rn(e,"globalAlpha",$,i.currentContext);if(V=b?V:at,B&&(this.applyShadowAndFilterStyleToContext(e,n,O,i),J=!0,k)){var ct=e.globalCompositeOperation;e.globalCompositeOperation="source-atop",this.strokeToContext(e,n,i,a,s),e.globalCompositeOperation=ct,this.clearShadowAndFilterStyleForContext(e,O,F,i,!0)}this.strokeToContext(e,n,i,a,s),J&&this.clearShadowAndFilterStyleForContext(e,O,F,i)}V!==null&&Rn(e,"globalAlpha",V,i.currentContext)}}}])}(),hv=function(r){function t(){return(0,C.Z)(this,t),I(this,t,arguments)}return(0,L.Z)(t,r),(0,T.Z)(t,[{key:"render",value:function(n,i,a,s,o,l){var c=i.fill,u=i.fillRule,h=i.opacity,d=h===void 0?1:h,f=i.fillOpacity,v=f===void 0?1:f,g=i.stroke,p=i.strokeOpacity,y=p===void 0?1:p,b=i.lineWidth,E=b===void 0?1:b,O=i.lineCap,k=i.lineJoin,P=i.shadowType,F=i.shadowColor,B=i.shadowBlur,V=i.filter,U=i.miterLimit,J=c&&!c.isNone,$=g&&!g.isNone&&E>0,at=(c==null?void 0:c.alpha)===0,ct=!!(V&&V.length),ft=!be(F)&&B>0,Nt=a.nodeName,Ct=P==="inner",gt=$&&ft&&(Nt===Dt.PATH||Nt===Dt.LINE||Nt===Dt.POLYLINE||at||Ct);J&&(n.globalAlpha=d*v,gt||Du(a,n,ft),c1(n,a,c,u,s,o,l,this.imagePool),gt||this.clearShadowAndFilter(n,ct,ft)),$&&(n.globalAlpha=d*y,n.lineWidth=E,be(U)||(n.miterLimit=U),be(O)||(n.lineCap=O),be(k)||(n.lineJoin=k),gt&&(Ct&&(n.globalCompositeOperation="source-atop"),Du(a,n,!0),Ct&&(dv(n,a,g,s,o,l,this.imagePool),n.globalCompositeOperation=$n.globalCompositeOperation,this.clearShadowAndFilter(n,ct,!0))),dv(n,a,g,s,o,l,this.imagePool))}},{key:"clearShadowAndFilter",value:function(n,i,a){if(a&&(n.shadowColor="transparent",n.shadowBlur=0),i){var s=n.filter;!be(s)&&s.indexOf("drop-shadow")>-1&&(n.filter=s.replace(/drop-shadow\([^)]*\)/,"").trim()||"none")}}}])}(Kk);function Du(r,t,e){var n=r.parsedStyle,i=n.filter,a=n.shadowColor,s=n.shadowBlur,o=n.shadowOffsetX,l=n.shadowOffsetY;i&&i.length&&(t.filter=r.style.filter),e&&(t.shadowColor=a.toString(),t.shadowBlur=s||0,t.shadowOffsetX=o||0,t.shadowOffsetY=l||0)}function c1(r,t,e,n,i,a,s,o){var l=arguments.length>8&&arguments[8]!==void 0?arguments[8]:!1;Array.isArray(e)?e.forEach(function(c){r.fillStyle=Lu(c,t,r,o),l||(n?r.fill(n):r.fill())}):(bs(e)&&(r.fillStyle=Ru(e,t,r,i,a,s,o)),l||(n?r.fill(n):r.fill()))}function dv(r,t,e,n,i,a,s){var o=arguments.length>7&&arguments[7]!==void 0?arguments[7]:!1;Array.isArray(e)?e.forEach(function(l){r.strokeStyle=Lu(l,t,r,s),o||r.stroke()}):(bs(e)&&(r.strokeStyle=Ru(e,t,r,n,i,a,s)),o||r.stroke())}function Qk(r,t){var e=(0,G.Z)(r,4),n=e[0],i=e[1],a=e[2],s=e[3],o=(0,G.Z)(t,4),l=o[0],c=o[1],u=o[2],h=o[3],d=Math.max(n,l),f=Math.max(i,c),v=Math.min(n+a,l+u),g=Math.min(i+s,c+h);return v<=d||g<=f?null:[d,f,v-d,g-f]}function qk(r,t){var e=Sn(xt(),[r[0],r[1],0],t),n=Sn(xt(),[r[0]+r[2],r[1],0],t),i=Sn(xt(),[r[0],r[1]+r[3],0],t),a=Sn(xt(),[r[0]+r[2],r[1]+r[3],0],t);return[Math.min(e[0],n[0],i[0],a[0]),Math.min(e[1],n[1],i[1],a[1]),Math.max(e[0],n[0],i[0],a[0])-Math.min(e[0],n[0],i[0],a[0]),Math.max(e[1],n[1],i[1],a[1])-Math.min(e[1],n[1],i[1],a[1])]}var Jk=function(r){function t(){return(0,C.Z)(this,t),I(this,t,arguments)}return(0,L.Z)(t,r),(0,T.Z)(t,[{key:"renderDownSampled",value:function(n,i,a,s){var o=s.src,l=s.imageCache;if(!l.downSampled){this.imagePool.createDownSampledImage(o,a).then(function(){a.ownerDocument&&(a.dirty(),a.ownerDocument.defaultView.context.renderingService.dirtify())}).catch(function(c){console.error(c)});return}n.drawImage(l.downSampled,Math.floor(s.drawRect[0]),Math.floor(s.drawRect[1]),Math.ceil(s.drawRect[2]),Math.ceil(s.drawRect[3]))}},{key:"renderTile",value:function(n,i,a,s){var o=s.src,l=s.imageCache,c=s.imageRect,u=s.drawRect,h=l.size,d=n.getTransform(),f=d.a,v=d.b,g=d.c,p=d.d,y=d.e,b=d.f;if(n.resetTransform(),!(l!=null&&l.gridSize)){this.imagePool.createImageTiles(o,[],function(){a.ownerDocument&&(a.dirty(),a.ownerDocument.defaultView.context.renderingService.dirtify())},a).catch(function(ft){console.error(ft)});return}for(var E=[h[0]/c[2],h[1]/c[3]],O=[l.tileSize[0]/E[0],l.tileSize[1]/E[1]],k=[Math.floor((u[0]-c[0])/O[0]),Math.ceil((u[0]+u[2]-c[0])/O[0])],P=k[0],F=k[1],B=[Math.floor((u[1]-c[1])/O[1]),Math.ceil((u[1]+u[3]-c[1])/O[1])],V=B[0],U=B[1],J=V;J<=U;J++)for(var $=P;$<=F;$++){var at=l.tiles[J][$];if(at){var ct=[Math.floor(c[0]+at.tileX*O[0]),Math.floor(c[1]+at.tileY*O[1]),Math.ceil(O[0]),Math.ceil(O[1])];n.drawImage(at.data,ct[0],ct[1],ct[2],ct[3])}}n.setTransform(f,v,g,p,y,b)}},{key:"render",value:function(n,i,a){var s=i.x,o=s===void 0?0:s,l=i.y,c=l===void 0?0:l,u=i.width,h=i.height,d=i.src,f=i.shadowColor,v=i.shadowBlur,g=this.imagePool.getImageSync(d,a),p=g==null?void 0:g.img,y=u,b=h;if(p){y||(y=p.width),b||(b=p.height);var E=!be(f)&&v>0;Du(a,n,E);try{var O=a.ownerDocument.defaultView.getContextService().getDomElement(),k=O.width,P=O.height,F=n.getTransform(),B=F.a,V=F.b,U=F.c,J=F.d,$=F.e,at=F.f,ct=xe(B,U,0,0,V,J,0,0,0,0,1,0,$,at,0,1),ft=qk([o,c,y,b],ct),Nt=Qk([0,0,k,P],ft);if(!Nt)return;if(!a.ownerDocument.defaultView.getConfig().enableLargeImageOptimization){t.renderFull(n,i,a,{image:p,drawRect:[o,c,y,b]});return}var Ct=ft[2]/g.size[0];if(Ct<(g.downSamplingRate||.5)){this.renderDownSampled(n,i,a,{src:d,imageCache:g,drawRect:[o,c,y,b]});return}if(!uv.isSupportTile){t.renderFull(n,i,a,{image:p,drawRect:[o,c,y,b]});return}this.renderTile(n,i,a,{src:d,imageCache:g,imageRect:ft,drawRect:Nt})}catch(gt){}}}},{key:"drawToContext",value:function(n,i,a,s,o){this.render(n,i.parsedStyle,i)}}],[{key:"renderFull",value:function(n,i,a,s){n.drawImage(s.image,Math.floor(s.drawRect[0]),Math.floor(s.drawRect[1]),Math.ceil(s.drawRect[2]),Math.ceil(s.drawRect[3]))}}])}(hv),$k=function(r){function t(){return(0,C.Z)(this,t),I(this,t,arguments)}return(0,L.Z)(t,r),(0,T.Z)(t,[{key:"render",value:function(n,i,a,s,o,l){a.getBounds();var c=i.lineWidth,u=c===void 0?1:c,h=i.textAlign,d=h===void 0?"start":h,f=i.textBaseline,v=f===void 0?"alphabetic":f,g=i.lineJoin,p=g===void 0?"miter":g,y=i.miterLimit,b=y===void 0?10:y,E=i.letterSpacing,O=E===void 0?0:E,k=i.stroke,P=i.fill,F=i.fillRule,B=i.fillOpacity,V=B===void 0?1:B,U=i.strokeOpacity,J=U===void 0?1:U,$=i.opacity,at=$===void 0?1:$,ct=i.metrics,ft=i.x,Nt=ft===void 0?0:ft,Ct=i.y,gt=Ct===void 0?0:Ct,bt=i.dx,Pt=i.dy,zt=i.shadowColor,Ut=i.shadowBlur,$t=ct.font,re=ct.lines,ce=ct.height,le=ct.lineHeight,Ee=ct.lineMetrics;n.font=$t,n.lineWidth=u,n.textAlign=d==="middle"?"center":d;var Ne=v;Ne==="alphabetic"&&(Ne="bottom"),n.lineJoin=p,be(b)||(n.miterLimit=b);var We=gt;v==="middle"?We+=-ce/2-le/2:v==="bottom"||v==="alphabetic"||v==="ideographic"?We+=-ce:(v==="top"||v==="hanging")&&(We+=-le);var He=Nt+(bt||0);We+=Pt||0,re.length===1&&(Ne==="bottom"?(Ne="middle",We-=.5*ce):Ne==="top"&&(Ne="middle",We+=.5*ce)),n.textBaseline=Ne;var cr=!be(zt)&&Ut>0;Du(a,n,cr);for(var $e=0;$e<re.length;$e++){var yi=u/2+He;We+=le,!be(k)&&!k.isNone&&u&&this.drawLetterSpacing(n,a,re[$e],Ee[$e],d,yi,We,O,P,F,V,k,J,at,!0,s,o,l),be(P)||this.drawLetterSpacing(n,a,re[$e],Ee[$e],d,yi,We,O,P,F,V,k,J,at,!1,s,o,l)}}},{key:"drawLetterSpacing",value:function(n,i,a,s,o,l,c,u,h,d,f,v,g,p,y,b,E,O){if(u===0){y?this.strokeText(n,i,a,l,c,v,g,b,E,O):this.fillText(n,i,a,l,c,h,d,f,p,b,E,O);return}var k=n.textAlign;n.textAlign="left";var P=l;o==="center"||o==="middle"?P=l-s.width/2:(o==="right"||o==="end")&&(P=l-s.width);for(var F=Array.from(a),B=n.measureText(a).width,V=0,U=0;U<F.length;++U){var J=F[U];y?this.strokeText(n,i,J,P,c,v,g,b,E,O):this.fillText(n,i,J,P,c,h,d,f,p,b,E,O),V=n.measureText(a.substring(U+1)).width,P+=B-V+u,B=V}n.textAlign=k}},{key:"fillText",value:function(n,i,a,s,o,l,c,u,h,d,f,v){c1(n,i,l,c,d,f,v,this.imagePool,!0);var g,p=!be(u)&&u!==1;p&&(g=n.globalAlpha,n.globalAlpha=u*h),n.fillText(a,s,o),p&&(n.globalAlpha=g)}},{key:"strokeText",value:function(n,i,a,s,o,l,c,u,h,d){dv(n,i,l,u,h,d,this.imagePool,!0);var f,v=!be(c)&&c!==1;v&&(f=n.globalAlpha,n.globalAlpha=c),n.strokeText(a,s,o),v&&(n.globalAlpha=f)}},{key:"drawToContext",value:function(n,i,a,s,o){this.render(n,i.parsedStyle,i,i.ownerDocument.defaultView.context,s,o)}}])}(hv),t3=function(r){function t(){var e,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return(0,C.Z)(this,t),e=I(this,t),e.name="canvas-renderer",e.options=n,e}return(0,L.Z)(t,r),(0,T.Z)(t,[{key:"init",value:function(){var n,i=(0,z.Z)({dirtyObjectNumThreshold:500,dirtyObjectRatioThreshold:.8},this.options),a=this.context.imagePool,s=new hv(a),o=(n={},(0,ae.Z)((0,ae.Z)((0,ae.Z)((0,ae.Z)((0,ae.Z)((0,ae.Z)((0,ae.Z)((0,ae.Z)((0,ae.Z)((0,ae.Z)(n,Dt.CIRCLE,s),Dt.ELLIPSE,s),Dt.RECT,s),Dt.IMAGE,new Jk(a)),Dt.TEXT,new $k(a)),Dt.LINE,s),Dt.POLYLINE,s),Dt.POLYGON,s),Dt.PATH,s),Dt.GROUP,void 0),(0,ae.Z)((0,ae.Z)((0,ae.Z)(n,Dt.HTML,void 0),Dt.MESH,void 0),Dt.FRAGMENT,void 0));this.context.defaultStyleRendererFactory=o,this.context.styleRendererFactory=o,this.addRenderingPlugin(new s1(i))}},{key:"destroy",value:function(){this.removeAllRenderingPlugins(),delete this.context.defaultStyleRendererFactory,delete this.context.styleRendererFactory}}])}(za);var u1=function(){function r(){(0,C.Z)(this,r)}return(0,T.Z)(r,[{key:"apply",value:function(e,n){var i=this,a=e.renderingService,s=e.renderingContext,o=e.config;this.context=e;var l=s.root.ownerDocument.defaultView,c=function(B){a.hooks.pointerMove.call(B)},u=function(B){a.hooks.pointerUp.call(B)},h=function(B){a.hooks.pointerDown.call(B)},d=function(B){a.hooks.pointerOver.call(B)},f=function(B){a.hooks.pointerOut.call(B)},v=function(B){a.hooks.pointerCancel.call(B)},g=function(B){a.hooks.pointerWheel.call(B)},p=function(B){a.hooks.click.call(B)},y=function(B){n.globalThis.document.addEventListener("pointermove",c,!0),B.addEventListener("pointerdown",h,!0),B.addEventListener("pointerleave",f,!0),B.addEventListener("pointerover",d,!0),n.globalThis.addEventListener("pointerup",u,!0),n.globalThis.addEventListener("pointercancel",v,!0)},b=function(B){B.addEventListener("touchstart",h,!0),B.addEventListener("touchend",u,!0),B.addEventListener("touchmove",c,!0),B.addEventListener("touchcancel",v,!0)},E=function(B){n.globalThis.document.addEventListener("mousemove",c,!0),B.addEventListener("mousedown",h,!0),B.addEventListener("mouseout",f,!0),B.addEventListener("mouseover",d,!0),n.globalThis.addEventListener("mouseup",u,!0)},O=function(B){n.globalThis.document.removeEventListener("pointermove",c,!0),B.removeEventListener("pointerdown",h,!0),B.removeEventListener("pointerleave",f,!0),B.removeEventListener("pointerover",d,!0),n.globalThis.removeEventListener("pointerup",u,!0),n.globalThis.removeEventListener("pointercancel",v,!0)},k=function(B){B.removeEventListener("touchstart",h,!0),B.removeEventListener("touchend",u,!0),B.removeEventListener("touchmove",c,!0),B.removeEventListener("touchcancel",v,!0)},P=function(B){n.globalThis.document.removeEventListener("mousemove",c,!0),B.removeEventListener("mousedown",h,!0),B.removeEventListener("mouseout",f,!0),B.removeEventListener("mouseover",d,!0),n.globalThis.removeEventListener("mouseup",u,!0)};a.hooks.init.tap(r.tag,function(){var F=i.context.contextService.getDomElement();n.globalThis.navigator.msPointerEnabled?(F.style.msContentZooming="none",F.style.msTouchAction="none"):l.supportsPointerEvents&&(F.style.touchAction="none"),l.supportsPointerEvents?y(F):E(F),l.supportsTouchEvents&&b(F),o.useNativeClickEvent&&F.addEventListener("click",p,!0),F.addEventListener("wheel",g,{passive:!0,capture:!0})}),a.hooks.destroy.tap(r.tag,function(){var F=i.context.contextService.getDomElement();n.globalThis.navigator.msPointerEnabled?(F.style.msContentZooming="",F.style.msTouchAction=""):l.supportsPointerEvents&&(F.style.touchAction=""),l.supportsPointerEvents?O(F):P(F),l.supportsTouchEvents&&k(F),o.useNativeClickEvent&&F.removeEventListener("click",p,!0),F.removeEventListener("wheel",g,!0)})}}])}();u1.tag="DOMInteraction";var e3=function(r){function t(){var e;(0,C.Z)(this,t);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return e=I(this,t,[].concat(i)),e.name="dom-interaction",e}return(0,L.Z)(t,r),(0,T.Z)(t,[{key:"init",value:function(){this.addRenderingPlugin(new u1)}},{key:"destroy",value:function(){this.removeAllRenderingPlugins()}}])}(za);var n3="g-canvas-camera",h1=function(){function r(){(0,C.Z)(this,r),this.displayObjectHTMLElementMap=new WeakMap}return(0,T.Z)(r,[{key:"joinTransformMatrix",value:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0];return"matrix(".concat([e[0],e[1],e[4],e[5],e[12]+n[0],e[13]+n[1]].join(","),")")}},{key:"apply",value:function(e,n){var i=this,a=e.camera,s=e.renderingContext,o=e.renderingService;this.context=e;var l=s.root.ownerDocument.defaultView,c=l.context.eventService.nativeHTMLMap,u=function(y,b){b.style.transform=i.joinTransformMatrix(y.getWorldTransform(),y.getOrigin())},h=function(y){var b=y.target;if(b.nodeName===Dt.HTML){i.$camera||(i.$camera=i.createCamera(a));var E=i.getOrCreateEl(b);i.$camera.appendChild(E),Object.keys(b.attributes).forEach(function(O){i.updateAttribute(O,b)}),u(b,E),c.set(E,b)}},d=function(y){var b=y.target;if(b.nodeName===Dt.HTML&&i.$camera){var E=i.getOrCreateEl(b);E&&(E.remove(),c.delete(E))}},f=function(y){var b=y.target;if(b.nodeName===Dt.HTML){var E=y.attrName;i.updateAttribute(E,b)}},v=function(y){var b=y.target,E=b.nodeName===Dt.FRAGMENT?b.childNodes:[b];E.forEach(function(O){if(O.nodeName===Dt.HTML){var k=i.getOrCreateEl(O);u(O,k)}})},g=function(){if(i.$camera){var y=i.context.config,b=y.width,E=y.height;i.$camera.parentElement.style.width="".concat(b||0,"px"),i.$camera.parentElement.style.height="".concat(E||0,"px")}};o.hooks.init.tap(r.tag,function(){l.addEventListener(ci.RESIZE,g),l.addEventListener(Fe.MOUNTED,h),l.addEventListener(Fe.UNMOUNTED,d),l.addEventListener(Fe.ATTR_MODIFIED,f),l.addEventListener(Fe.BOUNDS_CHANGED,v)}),o.hooks.endFrame.tap(r.tag,function(){i.$camera&&s.renderReasons.has(go.CAMERA_CHANGED)&&(i.$camera.style.transform=i.joinTransformMatrix(a.getOrthoMatrix()))}),o.hooks.destroy.tap(r.tag,function(){i.$camera&&i.$camera.remove(),l.removeEventListener(ci.RESIZE,g),l.removeEventListener(Fe.MOUNTED,h),l.removeEventListener(Fe.UNMOUNTED,d),l.removeEventListener(Fe.ATTR_MODIFIED,f),l.removeEventListener(Fe.BOUNDS_CHANGED,v)})}},{key:"createCamera",value:function(e){var n=this.context.config,i=n.document,a=n.width,s=n.height,o=this.context.contextService.getDomElement(),l=o.parentNode;if(l){var c=n3,u=l.querySelector("#".concat(c));if(!u){var h=(i||document).createElement("div");h.style.overflow="hidden",h.style.pointerEvents="none",h.style.position="absolute",h.style.left="0px",h.style.top="0px",h.style.width="".concat(a||0,"px"),h.style.height="".concat(s||0,"px");var d=(i||document).createElement("div");u=d,d.id=c,d.style.position="absolute",d.style.left="".concat(o.offsetLeft||0,"px"),d.style.top="".concat(o.offsetTop||0,"px"),d.style.transformOrigin="left top",d.style.transform=this.joinTransformMatrix(e.getOrthoMatrix()),d.style.pointerEvents="none",d.style.width="100%",d.style.height="100%",h.appendChild(d),l.appendChild(h)}return u}return null}},{key:"getOrCreateEl",value:function(e){var n=this.context.config.document,i=this.displayObjectHTMLElementMap.get(e);return i||(i=(n||document).createElement("div"),e.parsedStyle.$el=i,this.displayObjectHTMLElementMap.set(e,i),e.id&&(i.id=e.id),e.name&&i.setAttribute("name",e.name),e.className&&(i.className=e.className),i.style.position="absolute",i.style["will-change"]="transform",i.style.transform=this.joinTransformMatrix(e.getWorldTransform(),e.getOrigin())),i}},{key:"updateAttribute",value:function(e,n){var i=this.getOrCreateEl(n);switch(e){case"innerHTML":var a=n.parsedStyle.innerHTML;Ue(a)?i.innerHTML=a:(i.innerHTML="",i.appendChild(a));break;case"x":i.style.left="".concat(n.parsedStyle.x,"px");break;case"y":i.style.top="".concat(n.parsedStyle.y,"px");break;case"transformOrigin":var s=n.parsedStyle.transformOrigin;i.style["transform-origin"]="".concat(s[0].buildCSSText(null,null,"")," ").concat(s[1].buildCSSText(null,null,""));break;case"width":var o=n.parsedStyle.width;i.style.width=ie(o)?"".concat(o,"px"):o.toString();break;case"height":var l=n.parsedStyle.height;i.style.height=ie(l)?"".concat(l,"px"):l.toString();break;case"zIndex":var c=n.parsedStyle.zIndex;i.style["z-index"]="".concat(c);break;case"visibility":var u=n.parsedStyle.visibility;i.style.visibility=u;break;case"pointerEvents":var h=n.parsedStyle.pointerEvents,d=h===void 0?"auto":h;i.style.pointerEvents=d;break;case"opacity":var f=n.parsedStyle.opacity;i.style.opacity="".concat(f);break;case"fill":var v=n.parsedStyle.fill,g="";Mc(v)?v.isNone?g="transparent":g=n.getAttribute("fill"):Array.isArray(v)?g=n.getAttribute("fill"):bs(v),i.style.background=g;break;case"stroke":var p=n.parsedStyle.stroke,y="";Mc(p)?p.isNone?y="transparent":y=n.getAttribute("stroke"):Array.isArray(p)?y=n.getAttribute("stroke"):bs(p),i.style["border-color"]=y,i.style["border-style"]="solid";break;case"lineWidth":var b=n.parsedStyle.lineWidth;i.style["border-width"]="".concat(b||0,"px");break;case"lineDash":i.style["border-style"]="dashed";break;case"filter":var E=n.style.filter;i.style.filter=E;break;default:!be(n.style[e])&&n.style[e]!==""&&(i.style[e]=n.style[e])}}}])}();h1.tag="HTMLRendering";var r3=function(r){function t(){var e;(0,C.Z)(this,t);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return e=I(this,t,[].concat(i)),e.name="html-renderer",e}return(0,L.Z)(t,r),(0,T.Z)(t,[{key:"init",value:function(){this.addRenderingPlugin(new h1)}},{key:"destroy",value:function(){this.removeAllRenderingPlugins()}}])}(za);var i3=function(){function r(t){(0,C.Z)(this,r),this.renderingContext=t.renderingContext,this.canvasConfig=t.config}return(0,T.Z)(r,[{key:"init",value:function(){var e=this.canvasConfig,n=e.container,i=e.canvas;if(i)this.$canvas=i,n&&i.parentElement!==n&&n.appendChild(i),this.$container=i.parentElement,this.canvasConfig.container=this.$container;else if(n&&(this.$container=Ue(n)?document.getElementById(n):n,this.$container)){var a=document.createElement("canvas");this.$container.appendChild(a),this.$container.style.position||(this.$container.style.position="relative"),this.$canvas=a}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(e,n){var i=this.canvasConfig.devicePixelRatio;this.dpr=i,this.$canvas&&(this.$canvas.width=this.dpr*e,this.$canvas.height=this.dpr*n,nA(this.$canvas,e,n)),this.renderingContext.renderReasons.add(go.CAMERA_CHANGED)}},{key:"applyCursorStyle",value:function(e){this.$container&&this.$container.style&&(this.$container.style.cursor=e)}},{key:"toDataURL",value:function(){var t=(0,Fa.Z)((0,Pr.Z)().mark(function n(){var i,a,s,o=arguments;return(0,Pr.Z)().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return i=o.length>0&&o[0]!==void 0?o[0]:{},a=i.type,s=i.encoderOptions,l.abrupt("return",this.context.canvas.toDataURL(a,s));case 1:case"end":return l.stop()}},n,this)}));function e(){return t.apply(this,arguments)}return e}()}])}(),a3=function(r){function t(){var e;(0,C.Z)(this,t);for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return e=I(this,t,[].concat(i)),e.name="canvas-context-register",e}return(0,L.Z)(t,r),(0,T.Z)(t,[{key:"init",value:function(){this.context.ContextService=i3}},{key:"destroy",value:function(){delete this.context.ContextService}}])}(za),Nl=function(r){function t(e){var n;return(0,C.Z)(this,t),n=I(this,t,[e]),n.registerPlugin(new a3),n.registerPlugin(new Xk),n.registerPlugin(new Ak),n.registerPlugin(new t3),n.registerPlugin(new e3),n.registerPlugin(new Vk),n.registerPlugin(new r3),n}return(0,L.Z)(t,r),(0,T.Z)(t)}(X2);function s3(r,t){if(r){var e;if(Kr(r))for(var n=0,i=r.length;n<i&&(e=t(r[n],n),e!==!1);n++);else if(zn(r)){for(var a in r)if(r.hasOwnProperty(a)&&(e=t(r[a],a),e===!1))break}}}var d1=s3,o3=Object.prototype.hasOwnProperty,zs=function(r,t){if(r===null||!bo(r))return{};var e={};return d1(t,function(n){o3.call(r,n)&&(e[n]=r[n])}),e},l3=function(r,t){var e={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&t.indexOf(n)<0&&(e[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(e[n[i]]=r[n[i]]);return e};class Iu extends Ui{constructor(t){super(Object.assign(Object.assign({},t),{style:Object.assign({},Iu.defaultStyleProps,t.style)})),this.rootPointerEvent=new kc(null),this.forwardEvents=e=>{const n=this.context.canvas,i=n.context.renderingContext.root.ownerDocument.defaultView;this.normalizeToPointerEvent(e,i).forEach(s=>{const o=this.bootstrapEvent(this.rootPointerEvent,s,i,e);Al(n.context.eventService,"mappingTable.pointerupoutside",[]),n.context.eventService.mapEvent(o)})}}get eventService(){return this.context.canvas.context.eventService}get events(){return[It.CLICK,It.POINTER_DOWN,It.POINTER_MOVE,It.POINTER_UP,It.POINTER_OVER,It.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=zs(t,["dx","dy","innerHTML","pointerEvents","cursor"]),{dx:n=0,dy:i=0}=e,a=l3(e,["dx","dy"]),[s,o]=this.getSize(t);return Object.assign(Object.assign({x:n,y:i},a),{width:s,height:o})}drawKeyShape(t,e){const n=this.getKeyStyle(t),{x:i,y:a,width:s=0,height:o=0}=n,l=this.upsert("key-container",br,{x:i,y:a,width:s,height:o,opacity:0},e);return this.upsert("key",Ts,n,l)}connectedCallback(){if(!(this.context.canvas.getRenderer("main")instanceof Nl))return;const n=this.getDomElement();this.events.forEach(i=>{n.addEventListener(i,this.forwardEvents)})}attributeChangedCallback(t,e,n){t==="zIndex"&&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 i=0;i<t.changedTouches.length;i++){const a=t.changedTouches[i];Te(a.button)&&(a.button=0),Te(a.buttons)&&(a.buttons=1),Te(a.isPrimary)&&(a.isPrimary=t.touches.length===1&&t.type==="touchstart"),Te(a.width)&&(a.width=a.radiusX||1),Te(a.height)&&(a.height=a.radiusY||1),Te(a.tiltX)&&(a.tiltX=0),Te(a.tiltY)&&(a.tiltY=0),Te(a.pointerType)&&(a.pointerType="touch"),Te(a.pointerId)&&(a.pointerId=a.identifier||0),Te(a.pressure)&&(a.pressure=a.force||.5),Te(a.twist)&&(a.twist=0),Te(a.tangentialPressure)&&(a.tangentialPressure=0),a.isNormalized=!0,a.type=t.type,n.push(a)}else if(e.isMouseEvent(t)){const i=t;Te(i.isPrimary)&&(i.isPrimary=!0),Te(i.width)&&(i.width=1),Te(i.height)&&(i.height=1),Te(i.tiltX)&&(i.tiltX=0),Te(i.tiltY)&&(i.tiltY=0),Te(i.pointerType)&&(i.pointerType="mouse"),Te(i.pointerId)&&(i.pointerId=1),Te(i.pressure)&&(i.pressure=.5),Te(i.twist)&&(i.twist=0),Te(i.tangentialPressure)&&(i.tangentialPressure=0),i.isNormalized=!0,n.push(i)}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,i){t.view=n,t.originalEvent=null,t.nativeEvent=i,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:a,y:s}=this.getViewportXY(e);t.viewport.x=a,t.viewport.y=s;const[o,l]=this.context.canvas.getCanvasByViewport([a,s]);return t.canvas.x=o,t.canvas.y=l,t.global.copyFrom(t.canvas),t.offset.copyFrom(t.canvas),t.isTrusted=i.isTrusted,t.type==="pointerleave"&&(t.type="pointerout"),t}getViewportXY(t){let e,n;const{offsetX:i,offsetY:a,clientX:s,clientY:o}=t;if(!be(i)&&!be(a))e=i,n=a;else{const l=this.eventService.client2Viewport({x:s,y:o});e=l.x,n=l.y}return{x:e,y:n}}onframe(){super.onframe();const{opacity:t}=this.attributes;this.getDomElement().style.opacity=`${t}`}}Iu.defaultStyleProps={size:[160,80],halo:!1,icon:!1,label:!1,pointerEvents:"auto"};var f1=function(r,t){var e={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&t.indexOf(n)<0&&(e[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(e[n[i]]=r[n[i]]);return e};class Bu extends Ui{constructor(t){super(dr({style:Bu.defaultStyleProps},t))}getKeyStyle(t){const[e,n]=this.getSize(t),i=super.getKeyStyle(t),{fillOpacity:a,opacity:s=a}=i,o=f1(i,["fillOpacity","opacity"]);return Object.assign(Object.assign({opacity:s},o),{width:e,height:n,x:-e/2,y:-n/2})}getBounds(){return this.getShape("key").getBounds()}getHaloStyle(t){if(t.halo===!1)return!1;const e=this.getShape("key").attributes,{fill:n,stroke:i}=e,a=f1(e,["fill","stroke"]),s=Dn(this.getGraphicStyle(t),"halo"),o=Number(s.lineWidth),[l,c]=Le(this.getSize(t),[o,o]),{lineWidth:u}=s,h={fill:"transparent",lineWidth:u/2,width:l-u/2,height:c-u/2,x:-(l-u/2)/2,y:-(c-u/2)/2};return Object.assign(Object.assign({},s),h)}getIconStyle(t){const e=super.getIconStyle(t),[n,i]=this.getSize(t);return e?Object.assign({width:n*Sa,height:i*Sa},e):!1}drawKeyShape(t,e){const n=this.upsert("key",nv,this.getKeyStyle(t),e);return iv(this),n}drawHaloShape(t,e){this.upsert("halo",br,this.getHaloStyle(t),e)}update(t){super.update(t),t&&("x"in t||"y"in t||"z"in t)&&av(this)}}Bu.defaultStyleProps={size:32};class c3 extends Ui{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:i}=this.getShape("key").attributes;return e?Object.assign({width:n*Sa,height:i*Sa},e):!1}drawKeyShape(t,e){return this.upsert("key",br,this.getKeyStyle(t),e)}}class u3 extends Au{constructor(t){super(t)}getInnerR(t){return t.innerR||this.getOuterR(t)*3/8}getOuterR(t){return Math.min(...this.getSize(t))/2}getPoints(t){return J3(this.getOuterR(t),this.getInnerR(t))}getIconStyle(t){const e=super.getIconStyle(t),n=this.getInnerR(t)*2*Sa;return e?Object.assign({width:n,height:n},e):!1}getPortXY(t,e){const{placement:n="top"}=e,i=this.getShape("key").getLocalBounds(),a=$3(this.getOuterR(t),this.getInnerR(t));return bv(i,n,a,!1)}}class Fu extends Au{constructor(t){super(dr({style:Fu.defaultStyleProps},t))}getPoints(t){const{direction:e}=t,[n,i]=this.getSize(t);return tP(n,i,e)}getPortXY(t,e){const{direction:n}=t,{placement:i="top"}=e,a=this.getShape("key").getLocalBounds(),[s,o]=this.getSize(t),l=eP(s,o,n);return bv(a,i,l,!1)}getIconStyle(t){const{icon:e,iconText:n,iconSrc:i,direction:a}=t;if(e===!1||ua(n||i))return!1;const s=Dn(this.getGraphicStyle(t),"icon"),o=this.getShape("key").getLocalBounds(),[l,c]=jO(o,a),u=GO(o,a)*2*Sa;return Object.assign({x:l,y:c,width:u,height:u},s)}}Fu.defaultStyleProps={size:40,direction:"up"};var v1=function(r,t){var e={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&t.indexOf(n)<0&&(e[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(e[n[i]]=r[n[i]]);return e};class So extends Ui{constructor(t){super(dr({style:So.defaultStyleProps},t)),this.type="combo",this.updateComboPosition(this.parsedAttributes)}getKeySize(t){const{collapsed:e,childrenNode:n=[]}=t;return n.length===0?this.getEmptyKeySize(t):e?this.getCollapsedKeySize(t):this.getExpandedKeySize(t)}getEmptyKeySize(t){const{padding:e,collapsedSize:n}=t,[i,a,s,o]=hi(e);return Le(fi(n),[o+a,i+s,0])}getCollapsedKeySize(t){return fi(t.collapsedSize)}getExpandedKeySize(t){const e=this.getContentBBox(t);return[oa(e),la(e),0]}getContentBBox(t){const{childrenNode:e=[],padding:n}=t,i=e.map(s=>this.context.element.getElement(s)).filter(Boolean);if(i.length===0){const s=new yn,{x:o=0,y:l=0,size:c}=t,[u,h]=fi(c);return s.setMinMax([o-u/2,l-h/2,0],[o+u/2,l+h/2,0]),s}const a=yl(i.map(s=>s.getBounds()));return n?Va(a,n):a}drawCollapsedMarkerShape(t,e){const n=this.getCollapsedMarkerStyle(t);this.upsert("collapsed-marker",$y,n,e),iv(this)}getCollapsedMarkerStyle(t){if(!t.collapsed||!t.collapsedMarker)return!1;const e=Dn(this.getGraphicStyle(t),"collapsedMarker"),{type:n}=e,i=v1(e,["type"]),a=this.getShape("key"),[s,o]=wa(a.getLocalBounds(),"center"),l=Object.assign(Object.assign({},i),{x:s,y:o});if(n){const c=this.getCollapsedMarkerText(n,t);Object.assign(l,{text:c})}return l}getCollapsedMarkerText(t,e){const{childrenData:n=[]}=e,{model:i}=this.context;return t==="descendant-count"?i.getDescendantsData(this.id).length.toString():t==="child-count"?n.length.toString():t==="node-count"?i.getDescendantsData(this.id).filter(a=>i.getElementType(At(a))==="node").length.toString():ue(t)?t(n):""}getComboPosition(t){const{x:e=0,y:n=0,collapsed:i,childrenData:a=[]}=t;if(a.length===0)return[+e,+n,0];if(i){const{model:s}=this.context,o=s.getDescendantsData(this.id).filter(l=>!s.isCombo(At(l)));if(o.length>0&&o.some(RN)){const l=o.reduce((c,u)=>Le(c,sr(u)),[0,0,0]);return Zi(l,o.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:i}=e;this.context.model.syncNodeLikeDatum({id:this.id,style:{x:n,y:i}}),av(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(i=>{var{x:a,y:s,z:o,transform:l}=i,c=v1(i,["x","y","z","transform"]);return c}),e);return n&&new Proxy(n,{set:(i,a,s)=>(a==="currentTime"&&Promise.resolve().then(()=>this.onframe()),Reflect.set(i,a,s))})}}So.defaultStyleProps={childrenNode:[],droppable:!0,draggable:!0,collapsed:!1,collapsedSize:32,collapsedMarker:!0,collapsedMarkerZIndex:1,collapsedMarkerFontSize:12,collapsedMarkerTextAlign:"center",collapsedMarkerTextBaseline:"middle",collapsedMarkerType:"child-count"};class h3 extends So{constructor(t){super(t)}drawKeyShape(t,e){return this.upsert("key",aa,this.getKeyStyle(t),e)}getKeyStyle(t){const{collapsed:e}=t,n=super.getKeyStyle(t),[i]=this.getKeySize(t);return Object.assign(Object.assign(Object.assign({},n),e&&Dn(n,"collapsed")),{r:i/2})}getCollapsedKeySize(t){const[e,n]=fi(t.collapsedSize),i=Math.max(e,n)/2;return[i*2,i*2,0]}getExpandedKeySize(t){const e=this.getContentBBox(t),[n,i]=Wa(e),a=Math.sqrt(Math.pow(n,2)+Math.pow(i,2))/2;return[a*2,a*2,0]}getIntersectPoint(t,e=!1){const n=this.getShape("key").getBounds();return xu(t,n,e)}}class d3 extends So{constructor(t){super(t)}drawKeyShape(t,e){return this.upsert("key",br,this.getKeyStyle(t),e)}getKeyStyle(t){const e=super.getKeyStyle(t),[n,i]=this.getKeySize(t);return Object.assign(Object.assign(Object.assign({},e),t.collapsed&&Dn(e,"collapsed")),{width:n,height:i,x:-n/2,y:-i/2})}}var f3=function(r,t){if(!gl(r))return r;for(var e=[],n=0;n<r.length;n++){var i=r[n];t(i,n)&&e.push(i)}return e},v3=f3,g3=function(r,t){return gl(r)?r.indexOf(t)>-1:!1},p3=g3,m3=function(r,t){return t===void 0&&(t=[]),v3(r,function(e){return!p3(t,e)})},y3=m3;const b3={padding:10};function g1(r,t,e,n,i,a){const{padding:s}=Object.assign(b3,a),o=Za(e,s),l=Za(n,s),c=[r,...i,t];let u=null;const h=[];for(let d=0,f=c.length;d<f-1;d++){const v=d+1,g=c[d],p=c[v],y=_N(g,p);let b=null;if(d===0)if(v===f-1)if(o.intersects(l))b=vv(g,p,o,l);else if(!ru(g,o)&&!ru(p,l)){const E=Ps(g,o),O=Ps(p,l);b=m1(E,O,Gr(E,O)),b.points.unshift(E),b.points.push(O)}else y||(b=E3(g,p,o,l));else ji(p,o)?b=vv(g,p,o,Za(p,s),u):y||(b=zu(g,p,o));else v===f-1?ji(g,l)?b=vv(g,p,Za(g,s),l,u):y||(b=y1(g,p,l,u)):y||(b=m1(g,p,u));b?(h.push(...b.points),u=b.direction):u=Gr(g,p),v<f-1&&h.push(p)}return h.map(_s)}const x3={N:"S",S:"N",W:"E",E:"W"},p1={N:-Math.PI/2,S:Math.PI/2,E:0,W:Math.PI};function Gr(r,t){const[e,n]=r,[i,a]=t;return e===i?n>a?"N":"S":n===a?e>i?"W":"E":null}function fv(r,t){return t==="N"||t==="S"?la(r):oa(r)}function m1(r,t,e){const n=[r[0],t[1]],i=[t[0],r[1]],a=Gr(r,n),s=Gr(r,i),o=e?x3[e]:null,l=a===e||a!==o&&s!==e?n:i;return{points:[l],direction:Gr(l,t)}}function zu(r,t,e){if(ru(r,e)){const n=kl(r,t,e);return{points:[n],direction:Gr(n,t)}}else{const n=Ps(r,e),a=["left","right"].includes(bl(r,e))?[t[0],n[1]]:[n[0],t[1]];return{points:[a],direction:Gr(a,t)}}}function y1(r,t,e,n){const i=ru(t,e)?t:Ps(t,e),a=[[i[0],r[1]],[r[0],i[1]]],s=a.filter(l=>zO(l,e)&&!jm(l,e,!0)),o=s.filter(l=>Gr(l,r)!==n);if(o.length>0){const l=o.find(c=>Gr(r,c)===n)||o[0];return{points:[l],direction:Gr(l,t)}}else{const l=y3(a,s)[0],c=Ha(t,l,fv(e,n)/2);return{points:[kl(c,r,e),c],direction:Gr(c,t)}}}function E3(r,t,e,n){let i=zu(r,t,e);const a=wl(i.points[0]);if(ji(a,n)){i=zu(t,r,n);const s=wl(i.points[0]);if(ji(s,e)){const o=Ha(r,a,fv(e,Gr(r,a))/2),l=Ha(t,s,fv(n,Gr(t,s))/2),c=[(o[0]+l[0])/2,(o[1]+l[1])/2],u=zu(r,c,e),h=y1(c,t,n,u.direction);i.points=[u.points[0],h.points[0]],i.direction=h.direction}}return i}function vv(r,t,e,n,i){const s=yl([e,n]),o=En(t,s.center)>En(r,s.center),[l,c]=o?[t,r]:[r,t],u=la(s)+oa(s);let h;if(i){const v=[l[0]+u*Math.cos(p1[i]),l[1]+u*Math.sin(p1[i])];h=Ha(Ps(v,s),v,.01)}else h=Ha(Ps(l,s),l,-.01);let d=kl(h,c,s),f=[Sl(h,2),Sl(d,2)];if(Wn(Sl(h),Sl(d))){const v=Xf(dn(h,l),[1,0,0])+Math.PI/2;d=[c[0]+u*Math.cos(v),c[1]+u*Math.sin(v),0],d=Sl(Ha(Ps(d,s),c,-.01),2);const g=kl(h,d,s);f=[h,g,d]}return{points:o?f.reverse():f,direction:Gr(o?h:d,t)}}function kl(r,t,e){let n=[r[0],t[1]];return ji(n,e)&&(n=[t[0],r[1]]),n}function b1(r,t,e,n,i){let l=typeof t=="number"?t:.5;t==="start"&&(l=0),t==="end"&&(l=.99);const c=Er(r.getPoint(l)),u=Er(r.getPoint(l+.01));let h=t==="start"?"left":t==="end"?"right":"center";if(_y(c,u)||!e){const[y,b]=x1(r,l,n,i);return{transform:[["translate",y,b]],textAlign:h}}let d=Math.atan2(u[1]-c[1],u[0]-c[0]);u[0]<c[0]&&(h=h==="center"?h:h==="left"?"right":"left",n*=-1,d+=Math.PI);const[v,g]=x1(r,l,n,i,d),p=[["translate",v,g],["rotate",d/Math.PI*180]];return{textAlign:h,transform:p}}function w3(r,t,e,n,i){var a,s;const o=((a=r.badge)===null||a===void 0?void 0:a.getGeometryBounds().halfExtents[0])*2||0,l=((s=r.label)===null||s===void 0?void 0:s.getGeometryBounds().halfExtents[0])*2||0;return b1(r.key,e,!0,(l?(l/2+o/2)*(t==="suffix"?1:-1):0)+n,i)}function x1(r,t,e,n,i){const[a,s]=Er(r.getPoint(t));let o=e,l=n;return i&&(o=e*Math.cos(i)-n*Math.sin(i),l=e*Math.sin(i)+n*Math.cos(i)),[a+o,s+l]}function gv(r,t,e,n){if(Wn(r,t))return r;const i=dn(t,r),a=[r[0]+e*i[0],r[1]+e*i[1]],s=Ea(bu(i,!1));return a[0]+=n*s[0],a[1]+=n*s[1],a}function S3(r){return ie(r)?[r,-r]:r}function M3(r){return ie(r)?[r,1-r]:r}function A3(r,t,e){return[["M",r[0],r[1]],["Q",e[0],e[1],t[0],t[1]]]}function E1(r,t,e){return[["M",r[0],r[1]],["C",e[0][0],e[0][1],e[1][0],e[1][1],t[0],t[1]]]}function pv(r,t=0,e=!1){const n=r.length-1,i=r[0],a=r[n],s=r.slice(1,n),o=[["M",i[0],i[1]]];return s.forEach((l,c)=>{const u=s[c-1]||i,h=s[c+1]||a;if(!Dy(u,l,h)&&t){const[d,f]=T3(u,l,h,t);o.push(["L",d[0],d[1]],["Q",l[0],l[1],f[0],f[1]],["L",f[0],f[1]])}else o.push(["L",l[0],l[1]])}),o.push(["L",a[0],a[1]]),e&&o.push(["Z"]),o}function T3(r,t,e,n){const i=yu(r,t),a=yu(e,t),s=Math.min(n,Math.min(i,a)/2),o=[t[0]-s/i*(t[0]-r[0]),t[1]-s/i*(t[1]-r[1])],l=[t[0]-s/a*(t[0]-e[0]),t[1]-s/a*(t[1]-e[1])];return[o,l]}const O3=r=>{const t=Math.PI/2,e=la(r)/2,n=oa(r)/2,i=Math.atan2(e,n)/2,a=Math.atan2(n,e)/2;return{top:[-t-a,-t+a],"top-right":[-t+a,-i],"right-top":[-t+a,-i],right:[-i,i],"bottom-right":[i,t-a],"right-bottom":[i,t-a],bottom:[t-a,t+a],"bottom-left":[t+a,Math.PI-i],"left-bottom":[t+a,Math.PI-i],left:[Math.PI-i,Math.PI+i],"top-left":[Math.PI+i,-t-a],"left-top":[Math.PI+i,-t-a]}};function w1(r,t,e,n,i){const a=Za(r),s=r.getCenter();let o=n&&Qa(n),l=i&&Qa(i);if(!o||!l){const c=O3(a),u=c[t][0],h=c[t][1],[d,f]=Wa(a),v=Math.max(d,f),g=Le(s,[v*Math.cos(u),v*Math.sin(u),0]),p=Le(s,[v*Math.cos(h),v*Math.sin(h),0]);o=Ev(r,g),l=Ev(r,p),e||([o,l]=[l,o])}return[o,l]}function C3(r,t,e,n,i,a){const s=r.getPorts()[i||a],o=r.getPorts()[a||i];let[l,c]=w1(r,t,e,s,o);const u=N3(r,l,c,n);return s&&(l=Rl(s,u[0])),o&&(c=Rl(o,u.at(-1))),E1(l,c,u)}function N3(r,t,e,n){const i=r.getCenter();if(Wn(t,e)){const a=dn(t,i),s=[n*Math.sign(a[0])||n/2,n*Math.sign(a[1])||-n/2,0];return[Le(t,s),Le(e,Wi(s,[1,-1,1]))]}return[Ha(i,t,En(i,t)+n),Ha(i,e,En(i,e)+n)]}function k3(r,t,e,n,i,a,s){const o=xv(r),l=o[a||s],c=o[s||a];let[u,h]=w1(r,e,n,l,c);const d=P3(r,u,h,i);return l&&(u=Rl(l,d[0])),c&&(h=Rl(c,d.at(-1))),pv([u,...d,h],t)}function P3(r,t,e,n){const i=[],a=Za(r);if(Wn(t,e))switch(bl(t,a)){case"left":i.push([t[0]-n,t[1]]),i.push([t[0]-n,t[1]+n]),i.push([t[0],t[1]+n]);break;case"right":i.push([t[0]+n,t[1]]),i.push([t[0]+n,t[1]+n]),i.push([t[0],t[1]+n]);break;case"top":i.push([t[0],t[1]-n]),i.push([t[0]+n,t[1]-n]),i.push([t[0]+n,t[1]]);break;case"bottom":i.push([t[0],t[1]+n]),i.push([t[0]+n,t[1]+n]),i.push([t[0]+n,t[1]]);break}else{const s=bl(t,a),o=bl(e,a);if(s===o){const l=s;let c,u;switch(l){case"left":c=Math.min(t[0],e[0])-n,i.push([c,t[1]]),i.push([c,e[1]]);break;case"right":c=Math.max(t[0],e[0])+n,i.push([c,t[1]]),i.push([c,e[1]]);break;case"top":u=Math.min(t[1],e[1])-n,i.push([t[0],u]),i.push([e[0],u]);break;case"bottom":u=Math.max(t[1],e[1])+n,i.push([t[0],u]),i.push([e[0],u]);break}}else{const l=(d,f)=>({left:[f[0]-n,f[1]],right:[f[0]+n,f[1]],top:[f[0],f[1]-n],bottom:[f[0],f[1]+n]})[d],c=l(s,t),u=l(o,e),h=kl(c,u,a);i.push(c,h,u)}}return i}function mv(r,t){const e=new Set,n=new Set,i=new Set;return r.forEach(a=>{t(a).forEach(o=>{e.add(o),r.includes(o.source)&&r.includes(o.target)?n.add(o):i.add(o)})}),{edges:Array.from(e),internal:Array.from(n),external:Array.from(i)}}function S1(r,t){const e=[];let n=r;for(;n;){e.push(n);const i=t(At(n));if(i)n=i;else break}if(e.some(i=>{var a;return(a=i.style)===null||a===void 0?void 0:a.collapsed})){const i=e.reverse().findIndex(ni);return e[i]||e.at(-1)}return r}function R3(r,t){return t||(r<4?10:r===4?12:r*2.5)}const L3=(r,t)=>{const e=Math.max(r,t)/2;return[["M",-r/2,0],["A",e,e,0,1,0,2*e-r/2,0],["A",e,e,0,1,0,-r/2,0],["Z"]]},M1=(r,t)=>[["M",-r/2,0],["L",r/2,-t/2],["L",r/2,t/2],["Z"]],_3=(r,t)=>[["M",-r/2,0],["L",0,-t/2],["L",r/2,0],["L",0,t/2],["Z"]],D3=(r,t)=>[["M",-r/2,0],["L",r/2,-t/2],["L",4*r/5-r/2,0],["L",r/2,t/2],["Z"]],I3=(r,t)=>[["M",-r/2,-t/2],["L",r/2,-t/2],["L",r/2,t/2],["L",-r/2,t/2],["Z"]],B3=(r,t)=>{const e=r/2,n=r/7,i=r-n;return[["M",-e,0],["L",0,-t/2],["L",0,t/2],["Z"],["M",i-e,-t/2],["L",i+n-e,-t/2],["L",i+n-e,t/2],["L",i-e,t/2],["Z"]]},F3=(r,t)=>[["M",r/2,-t/2],["L",-r/2,0],["L",r/2,0],["L",-r/2,0],["L",r/2,t/2]];var ju=function(r,t){var e={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&t.indexOf(n)<0&&(e[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(e[n[i]]=r[n[i]]);return e};class Ka extends t1{constructor(t){super(dr({style:Ka.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,i=ju(e,["loop"]),{sourceNode:a,targetNode:s}=this,l={d:n&&X3(a,s)?this.getLoopPath(t):this.getKeyPath(t)};return li.PARSED_STYLE_LIST.forEach(c=>{c in i&&(l[c]=i[c])}),l}getLoopPath(t){const{sourcePort:e,targetPort:n}=t,i=this.sourceNode,a=Za(i),s=Math.max(oa(a),la(a)),{placement:o,clockwise:l,dist:c=s}=Dn(this.getGraphicStyle(t),"loop");return C3(i,o,l,c,e,n)}getEndpoints(t,e=!0,n=[]){const{sourcePort:i,targetPort:a}=t,{sourceNode:s,targetNode:o}=this,[l,c]=Q3(s,o,i,a);if(!e){const f=l?Qa(l):s.getCenter(),v=c?Qa(c):o.getCenter();return[f,v]}const u=typeof n=="function"?n():n,h=R1(l||s,u[0]||c||o),d=R1(c||o,u[u.length-1]||l||s);return[h,d]}getHaloStyle(t){if(t.halo===!1)return!1;const e=this.getKeyStyle(t),n=Dn(this.getGraphicStyle(t),"halo");return Object.assign(Object.assign({},e),n)}getLabelStyle(t){if(t.label===!1||!t.labelText)return!1;const e=Dn(this.getGraphicStyle(t),"label"),{placement:n,offsetX:i,offsetY:a,autoRotate:s,maxWidth:o}=e,l=ju(e,["placement","offsetX","offsetY","autoRotate","maxWidth"]),c=b1(this.shapeMap.key,n,s,i,a),u=this.shapeMap.key.getLocalBounds(),h=XN([u.min,u.max],o);return Object.assign({wordWrapWidth:h},c,l)}getBadgeStyle(t){if(t.badge===!1||!t.badgeText)return!1;const e=Dn(t,"badge"),{offsetX:n,offsetY:i,placement:a}=e,s=ju(e,["offsetX","offsetY","placement"]);return Object.assign(s,w3(this.shapeMap,a,t.labelPlacement,n,i))}drawArrow(t,e){var n;const i=e==="start",s=t[e==="start"?"startArrow":"endArrow"],o=this.shapeMap.key;if(s){const l=this.getArrowStyle(t,i),[c,u,h]=i?["markerStart","markerStartOffset","startArrowOffset"]:["markerEnd","markerEndOffset","endArrowOffset"],d=o.parsedStyle[c];if(d)d.attr(l);else{const f=l.src?dl:li,v=new f({style:l});o.style[c]=v}o.style[u]=t[h]||l.width/2+ +l.lineWidth}else{const l=i?"markerStart":"markerEnd";(n=o.style[l])===null||n===void 0||n.destroy(),o.style[l]=null}}getArrowStyle(t,e){const n=this.getShape("key").attributes,i=e?"startArrow":"endArrow",a=Dn(this.getGraphicStyle(t),i),{size:s,type:o}=a,l=ju(a,["size","type"]),[c,u]=fi(R3(n.lineWidth,s)),d=(ue(o)?o:W[o]||M1)(c,u);return Object.assign(zs(n,["stroke","strokeOpacity","fillOpacity"]),{width:c,height:u},Object.assign({},d&&{d,fill:o==="simple"?"":n.stroke}),l)}drawLabelShape(t,e){const n=this.getLabelStyle(t);this.upsert("label",ha,n,e)}drawHaloShape(t,e){const n=this.getHaloStyle(t);this.upsert("halo",li,n,e)}drawBadgeShape(t,e){const n=this.getBadgeStyle(t);this.upsert("badge",Eo,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",li,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:(i,a,s)=>(a==="currentTime"&&Promise.resolve().then(()=>this.onframe()),Reflect.set(i,a,s))})}}Ka.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 js extends Ka{constructor(t){super(dr({style:js.defaultStyleProps},t))}getKeyPath(t){const[e,n]=this.getEndpoints(t),{controlPoints:i,curvePosition:a,curveOffset:s}=t,o=this.getControlPoints(e,n,M3(a),S3(s),i);return E1(e,n,o)}getControlPoints(t,e,n,i,a){return(a==null?void 0:a.length)===2?a:[gv(t,e,n[0],i[0]),gv(t,e,n[1],i[1])]}}js.defaultStyleProps={curvePosition:.5,curveOffset:20};class Gu extends js{constructor(t){super(dr({style:Gu.defaultStyleProps},t))}getControlPoints(t,e,n,i){const a=e[0]-t[0];return[[t[0]+a*n[0]+i[0],t[1]],[e[0]-a*n[1]+i[1],e[1]]]}}Gu.defaultStyleProps={curvePosition:[.5,.5],curveOffset:[0,0]};class Wu extends js{constructor(t){super(dr({style:Wu.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=sr(this.ref),n=this.sourceNode.getIntersectPoint(e,!0),i=this.targetNode.getIntersectPoint(e);return[n,i]}toRadialCoordinate(t){const e=sr(this.ref),n=En(t,e),i=Ny(dn(t,e));return[n,i]}getControlPoints(t,e,n,i){const[a,s]=this.toRadialCoordinate(t),[o]=this.toRadialCoordinate(e),l=o-a;return[[t[0]+(l*n[0]+i[0])*Math.cos(s),t[1]+(l*n[0]+i[0])*Math.sin(s)],[e[0]-(l*n[1]-i[0])*Math.cos(s),e[1]-(l*n[1]-i[0])*Math.sin(s)]]}}Wu.defaultStyleProps={curvePosition:.5,curveOffset:20};class Zu extends js{constructor(t){super(dr({style:Zu.defaultStyleProps},t))}getControlPoints(t,e,n,i){const a=e[1]-t[1];return[[t[0],t[1]+a*n[0]+i[0]],[e[0],e[1]-a*n[1]+i[1]]]}}Zu.defaultStyleProps={curvePosition:[.5,.5],curveOffset:[0,0]};class Vu extends Ka{constructor(t){super(dr({style:Vu.defaultStyleProps},t))}getKeyPath(t){const[e,n]=this.getEndpoints(t);return[["M",e[0],e[1]],["L",n[0],n[1]]]}}Vu.defaultStyleProps={};const z3={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:yu},Ma=r=>`${Math.round(r[0])}|||${Math.round(r[1])}`;function Gs(r,t){const e=n=>Math.round(n/t);return ie(r)?e(r):r.map(e)}function j3(r,t){const e=Math.abs(r-t);return e>Math.PI?2*Math.PI-e:e}function A1(r,t){const e=t[0]-r[0],n=t[1]-r[1];return!e&&!n?0:Math.atan2(n,e)}function T1(r,t,e,n){const i=A1(r,t),a=e[Ma(r)],o=A1(a||n,r);return j3(o,i)}const G3=(r,t)=>{const{offset:e,gridSize:n}=t,i={};return r.forEach(a=>{if(!a||a.destroyed||!a.isVisible())return;const s=Va(a.getRenderBounds(),e);for(let o=Gs(s.min[0],n);o<=Gs(s.max[0],n);o+=1)for(let l=Gs(s.min[1],n);l<=Gs(s.max[1],n);l+=1)i[`${o}|||${l}`]=!0}),i};function O1(r,t,e){return Math.min(...t.map(n=>e(r,n)))}function W3(r,t,e){let n=r[0],i=e(r[0],t);for(let a=0;a<r.length;a++){const s=r[a],o=e(s,t);o<i&&(n=s,i=o)}return n}const C1=(r,t,e,n)=>{if(!t)return[r];const{directionMap:i,offset:a}=n,s=Va(t.getRenderBounds(),a),o=Object.keys(i).reduce((l,c)=>{if(e.includes(c)){const u=i[c],[h,d]=Wa(s),f=[r[0]+u.stepX*h,r[1]+u.stepY*d],v=WO(s);for(let g=0;g<v.length;g++){const p=Qf([r,f],v[g]);p&&jm(p,s)&&l.push(p)}}return l},[]);return ji(r,s)||o.push(r),o.map(l=>Gs(l,n.gridSize))},Z3=(r,t,e,n,i,a,s)=>{const o=[];let l=[a[0]===n[0]?n[0]:r[0]*s,a[1]===n[1]?n[1]:r[1]*s];o.unshift(l);let c=r,u=t[Ma(c)];for(;u;){const f=u,v=c;T1(f,v,t,e)&&(l=[f[0]===v[0]?l[0]:f[0]*s,f[1]===v[1]?l[1]:f[1]*s],o.unshift(l)),u=t[Ma(f)],c=f}const h=i.map(f=>[f[0]*s,f[1]*s]),d=W3(h,l,yu);return o.unshift(d),o};function V3(r,t,e,n){const i=_s(r.getCenter()),a=_s(t.getCenter()),s=Object.assign(z3,n),{gridSize:o}=s,l=s.enableObstacleAvoidance?e:[r,t],c=G3(l,s),u=Gs(i,o),h=Gs(a,o),d=C1(i,r,s.startDirections,s),f=C1(a,t,s.endDirections,s);d.forEach(B=>delete c[Ma(B)]),f.forEach(B=>delete c[Ma(B)]);const v={},g={},p={},y={},b={},E=new U3;for(let B=0;B<d.length;B++){const V=d[B],U=Ma(V);v[U]=V,y[U]=0,b[U]=O1(V,f,s.distFunc),E.add({id:U,value:b[U]})}const O=f.map(B=>Ma(B));let k=s.maximumLoops,P,F=1/0;for(const[B,V]of Object.entries(v))b[B]<=F&&(F=b[B],P=V);for(;Object.keys(v).length>0&&k>0;){const B=E.minId(!1);if(B)P=v[B];else break;const V=Ma(P);if(O.includes(V))return Z3(P,p,u,a,d,h,o);delete v[V],E.remove(V),g[V]=!0;for(const U of Object.values(s.directionMap)){const J=Le(P,[U.stepX,U.stepY]),$=Ma(J);if(g[$])continue;const at=T1(P,J,p,u);if(at>s.maxAllowedDirectionChange||c[$])continue;v[$]||(v[$]=J);const ct=s.penalties[at],ft=s.distFunc(P,J)+(isNaN(ct)?o:ct),Nt=y[V]+ft,Ct=y[$];Ct&&Nt>=Ct||(p[$]=P,y[$]=Nt,b[$]=Nt+O1(J,f,s.distFunc),E.add({id:$,value:b[$]}))}k-=1}return[]}class U3{constructor(){this.arr=[],this.map={},this.arr=[],this.map={}}_innerAdd(t,e){let n=0,i=e-1;for(;i-n>1;){const a=Math.floor((n+i)/2);if(this.arr[a].value>t.value)i=a;else if(this.arr[a].value<t.value)n=a;else{this.arr.splice(a,0,t),this.map[t.id]=!0;return}}this.arr.splice(i,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){this.arr.push(t),this.map[t.id]=!0;return}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 Uu extends Ka{constructor(t){super(dr({style:Uu.defaultStyleProps},t))}getControlPoints(t){const{router:e}=t,{sourceNode:n,targetNode:i}=this,[a,s]=this.getEndpoints(t,!1);let o=[];if(!e)o=t.controlPoints;else if(e.type==="shortest-path"){const l=this.context.element.getNodes();o=V3(n,i,l,e),o.length||(o=g1(a,s,n,i,t.controlPoints,{padding:e.offset}))}else e.type==="orth"&&(o=g1(a,s,n,i,t.controlPoints,e));return o}getPoints(t){const e=this.getControlPoints(t),[n,i]=this.getEndpoints(t,!0,e);return[n,...e,i]}getKeyPath(t){const e=this.getPoints(t);return pv(e,t.radius)}getLoopPath(t){const{sourcePort:e,targetPort:n,radius:i}=t,a=this.sourceNode,s=Za(a),o=Math.max(oa(s),la(s))/4,{placement:l,clockwise:c,dist:u=o}=Dn(this.getGraphicStyle(t),"loop");return k3(a,i,l,c,u,e,n)}}Uu.defaultStyleProps={radius:0,controlPoints:[],router:!1};class Yu extends Ka{constructor(t){super(dr({style:Yu.defaultStyleProps},t))}getKeyPath(t){const{curvePosition:e,curveOffset:n}=t,[i,a]=this.getEndpoints(t),s=t.controlPoint||gv(i,a,e,n);return A3(i,a,s)}}Yu.defaultStyleProps={curvePosition:.5,curveOffset:30};var Y3=function(r,t){var e={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&t.indexOf(n)<0&&(e[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(e[n[i]]=r[n[i]]);return e};function Pl(r){return r instanceof Ui&&r.type==="node"}function N1(r){return r instanceof Ka}function yv(r){return r instanceof So}function H3(r){return Pl(r)||N1(r)||yv(r)}function X3(r,t){return!r||!t?!1:r===t}const K3={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 bv(r,t,e=K3,n=!0){const i=[.5,.5],a=Ue(t)?wr(e,t.toLocaleLowerCase(),i):t;if(!n&&Ue(t))return a;const[s,o]=a||i;return[r.min[0]+oa(r)*s,r.min[1]+la(r)*o]}function xv(r){if(!r)return{};const t=r.getPorts();return(r.attributes.ports||[]).forEach((n,i)=>{var a;const{key:s,placement:o}=n;k1(n)&&(t[a=s||i]||(t[a]=wa(r.getShape("key").getBounds(),o)))}),t}function k1(r){const{r:t}=r;return!t||Number(t)===0}function Qa(r){return yo(r)?r:r.getPosition()}function Q3(r,t,e,n){const i=P1(r,t,e,n),a=P1(t,r,n,e);return[i,a]}function P1(r,t,e,n){const i=xv(r);if(e)return i[e];const a=Object.values(i);if(a.length===0)return;const s=a.map(c=>Qa(c)),o=q3(t,n),[l]=BN(s,o);return a.find(c=>Qa(c)===l)}function q3(r,t){const e=xv(r);if(t)return[Qa(e[t])];const n=Object.values(e);return n.length>0?n.map(i=>Qa(i)):[r.getCenter()]}function R1(r,t){return yv(r)||Pl(r)?Ev(r,t):Rl(r,t)}function Rl(r,t){if(!r||!t)return[0,0,0];if(yo(r))return r;if(r.attributes.linkToCenter)return r.getPosition();const e=yo(t)?t:Pl(t)?t.getCenter():t.getPosition();return xu(e,r.getBounds())}function Ev(r,t){if(!r||!t)return[0,0,0];const e=yo(t)?t:Pl(t)?t.getCenter():t.getPosition();return r.getIntersectPoint(e)||r.getCenter()}function L1(r,t="bottom",e=0,n=0,i=!1){const a=t.split("-"),[s,o]=wa(r,t),[l,c]=i?["bottom","top"]:["top","bottom"],u=a.includes("top")?c:a.includes("bottom")?l:"middle",h=a.includes("left")?"right":a.includes("right")?"left":"center";return{transform:[["translate",s+e,o+n]],textBaseline:u,textAlign:h}}function J3(r,t){return[[0,-r],[t*Math.cos(3*Math.PI/10),-t*Math.sin(3*Math.PI/10)],[r*Math.cos(Math.PI/10),-r*Math.sin(Math.PI/10)],[t*Math.cos(Math.PI/10),t*Math.sin(Math.PI/10)],[r*Math.cos(3*Math.PI/10),r*Math.sin(3*Math.PI/10)],[0,t],[-r*Math.cos(3*Math.PI/10),r*Math.sin(3*Math.PI/10)],[-t*Math.cos(Math.PI/10),t*Math.sin(Math.PI/10)],[-r*Math.cos(Math.PI/10),-r*Math.sin(Math.PI/10)],[-t*Math.cos(3*Math.PI/10),-t*Math.sin(3*Math.PI/10)]]}function $3(r,t){const e={};return e.top=[0,-r],e.left=[-r*Math.cos(Math.PI/10),-r*Math.sin(Math.PI/10)],e["left-bottom"]=[-r*Math.cos(3*Math.PI/10),r*Math.sin(3*Math.PI/10)],e.bottom=[0,t],e["right-bottom"]=[r*Math.cos(3*Math.PI/10),r*Math.sin(3*Math.PI/10)],e.right=e.default=[r*Math.cos(Math.PI/10),-r*Math.sin(Math.PI/10)],e}function tP(r,t,e){const n=t/2,i=r/2,a={up:[[-i,n],[i,n],[0,-n]],left:[[-i,0],[i,n],[i,-n]],right:[[-i,n],[-i,-n],[i,0]],down:[[-i,-n],[i,-n],[0,n]]};return a[e]||a.up}function eP(r,t,e){const n=t/2,i=r/2,a={};return e==="down"?(a.bottom=a.default=[0,n],a.right=[i,-n],a.left=[-i,-n]):e==="left"?(a.top=[i,-n],a.bottom=[i,n],a.left=a.default=[-i,0]):e==="right"?(a.top=[-i,-n],a.bottom=[-i,n],a.right=a.default=[i,0]):(a.left=[-i,n],a.top=a.default=[0,-n],a.right=[i,n]),a}function A7(r,t){return[[r/2,-t/2],[r/2,t/2],[-r/2,t/2],[-r/2,-t/2]]}function nP(r,t){return[[0,-t/2],[r/2,0],[0,t/2],[-r/2,0]]}function _1(r){return wr(r,["style","visibility"])!=="hidden"}function rP(r,t){const{zIndex:e,transform:n,transformOrigin:i,visibility:a,cursor:s,clipPath:o,component:l}=t,c=Y3(t,["zIndex","transform","transformOrigin","visibility","cursor","clipPath","component"]);Object.assign(r.attributes,c),n&&r.setAttribute("transform",n),ie(e)&&r.setAttribute("zIndex",e),i&&r.setAttribute("transformOrigin",i),a&&r.setAttribute("visibility",a),s&&r.setAttribute("cursor",s),o&&r.setAttribute("clipPath",o),l&&r.setAttribute("component",l)}function wv(r,t){"update"in r?r.update(t):r.attr(t)}function iP(r){return[[0,r],[r*Math.sqrt(3)/2,r/2],[r*Math.sqrt(3)/2,-r/2],[0,-r],[-r*Math.sqrt(3)/2,-r/2],[-r*Math.sqrt(3)/2,r/2]]}function aP(r){Al(r,"__to_be_destroyed__",!0)}function Ll(r){return wr(r,"__to_be_destroyed__",!1)}var sP=function(r,t,e,n){function i(a){return a instanceof e?a:new e(function(s){s(a)})}return new(e||(e=Promise))(function(a,s){function o(u){try{c(n.next(u))}catch(h){s(h)}}function l(u){try{c(n.throw(u))}catch(h){s(h)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((n=n.apply(r,t||[])).next())})};class Hu extends di{constructor(t,e){super(t,Object.assign({},Hu.defaultOptions,e)),this.onCollapseExpand=n=>sP(this,void 0,void 0,function*(){if(!this.validate(n))return;const{target:i}=n;if(!H3(i))return;const a=i.id,{model:s,graph:o}=this.context,l=s.getElementDataById(a);if(!l)return!1;const{onCollapse:c,onExpand:u,animation:h,align:d}=this.options;ni(l)?(yield o.expandElement(a,{animation:h,align:d}),u==null||u(a)):(yield o.collapseElement(a,{animation:h,align:d}),c==null||c(a))}),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 ue(e)?e(t):!!e}destroy(){this.unbindEvents(),super.destroy()}}Hu.defaultOptions={enable:!0,animation:!0,trigger:It.DBLCLICK,align:!0};var Xu={},oP=function(r){return r=r||"g",Xu[r]?Xu[r]+=1:Xu[r]=1,r+Xu[r]},Ku=function(r,t,e,n){function i(a){return a instanceof e?a:new e(function(s){s(a)})}return new(e||(e=Promise))(function(a,s){function o(u){try{c(n.next(u))}catch(h){s(h)}}function l(u){try{c(n.throw(u))}catch(h){s(h)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((n=n.apply(r,t||[])).next())})};const lP="g6-create-edge-assist-edge-id",Qu="g6-create-edge-assist-node-id";class qu extends di{constructor(t,e){super(t,Object.assign({},qu.defaultOptions,e)),this.drop=n=>Ku(this,void 0,void 0,function*(){const{targetType:i}=n;["combo","node"].includes(i)&&this.source?yield this.handleCreateEdge(n):yield this.cancelEdge()}),this.handleCreateEdge=n=>Ku(this,void 0,void 0,function*(){var i,a,s;if(!this.validate(n))return;const{graph:o,canvas:l,batch:c,element:u}=this.context,{style:h}=this.options;if(this.source){this.createEdge(n),yield this.cancelEdge();return}c.startBatch(),l.setCursor("crosshair"),this.source=this.getSelectedNodeIDs([n.target.id])[0];const d=o.getElementData(this.source);o.addNodeData([{id:Qu,style:{visibility:"hidden",ports:[{key:"port-1",placement:[.5,.5]}],x:(i=d.style)===null||i===void 0?void 0:i.x,y:(a=d.style)===null||a===void 0?void 0:a.y}}]),o.addEdgeData([{id:lP,source:this.source,target:Qu,style:Object.assign({pointerEvents:"none"},h)}]),yield(s=u.draw({animation:!1}))===null||s===void 0?void 0:s.finished}),this.updateAssistEdge=n=>Ku(this,void 0,void 0,function*(){var i;if(!this.source)return;const{model:a,element:s}=this.context;a.translateNodeTo(Qu,[n.canvas.x,n.canvas.y]),yield(i=s.draw({animation:!1,silence:!0}))===null||i===void 0?void 0:i.finished}),this.createEdge=n=>{var i,a;const{graph:s}=this.context,{style:o,onFinish:l,onCreate:c}=this.options;if(((i=n.target)===null||i===void 0?void 0:i.id)===void 0||this.source===void 0)return;const h=(a=this.getSelectedNodeIDs([n.target.id]))===null||a===void 0?void 0:a[0],d=`${this.source}-${h}-${oP()}`,f=c({id:d,source:this.source,target:h,style:o});f&&(s.addEdgeData([f]),l(f))},this.cancelEdge=()=>Ku(this,void 0,void 0,function*(){var n;if(!this.source)return;const{graph:i,element:a,batch:s}=this.context;i.removeNodeData([Qu]),this.source=void 0,yield(n=a.draw({animation:!1}))===null||n===void 0?void 0:n.finished,s.endBatch()}),this.bindEvents()}update(t){super.update(t),this.bindEvents()}bindEvents(){const{graph:t}=this.context,{trigger:e}=this.options;this.unbindEvents(),e==="click"?(t.on(Ni.CLICK,this.handleCreateEdge),t.on(ks.CLICK,this.handleCreateEdge),t.on(ya.CLICK,this.cancelEdge),t.on(eu.CLICK,this.cancelEdge)):(t.on(Ni.DRAG_START,this.handleCreateEdge),t.on(ks.DRAG_START,this.handleCreateEdge),t.on(It.POINTER_UP,this.drop)),t.on(It.POINTER_MOVE,this.updateAssistEdge)}getSelectedNodeIDs(t){return Array.from(new Set(this.context.graph.getElementDataByState("node",this.options.state).map(e=>e.id).concat(t)))}validate(t){if(this.destroyed)return!1;const{enable:e}=this.options;return ue(e)?e(t):!!e}unbindEvents(){const{graph:t}=this.context;t.off(Ni.CLICK,this.handleCreateEdge),t.off(ks.CLICK,this.handleCreateEdge),t.off(ya.CLICK,this.cancelEdge),t.off(eu.CLICK,this.cancelEdge),t.off(Ni.DRAG_START,this.handleCreateEdge),t.off(ks.DRAG_START,this.handleCreateEdge),t.off(It.POINTER_UP,this.drop),t.off(It.POINTER_MOVE,this.updateAssistEdge)}destroy(){this.unbindEvents(),super.destroy()}}qu.defaultOptions={animation:!0,enable:!0,style:{},trigger:"drag",onCreate:r=>r,onFinish:()=>{}};function cP(r,t,e){var n;return function(){var i=this,a=arguments,s=function(){n=null,e||r.apply(i,a)},o=e&&!n;clearTimeout(n),n=setTimeout(s,t),o&&r.apply(i,a)}}var _l=cP,D1=function(r,t,e,n){function i(a){return a instanceof e?a:new e(function(s){s(a)})}return new(e||(e=Promise))(function(a,s){function o(u){try{c(n.next(u))}catch(h){s(h)}}function l(u){try{c(n.throw(u))}catch(h){s(h)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((n=n.apply(r,t||[])).next())})};class Ju extends di{constructor(t,e){super(t,Object.assign({},Ju.defaultOptions,e)),this.isDragging=!1,this.onDragStart=n=>{this.validate(n)&&(this.isDragging=!0,this.context.canvas.setCursor("grabbing"))},this.onDrag=n=>{var i,a,s,o;if(!this.isDragging||Zn.isPinching)return;const l=(a=(i=n.movement)===null||i===void 0?void 0:i.x)!==null&&a!==void 0?a:n.dx,c=(o=(s=n.movement)===null||s===void 0?void 0:s.y)!==null&&o!==void 0?o:n.dy;l|c&&this.translate([l,c],!1)},this.onDragEnd=()=>{var n,i;this.isDragging=!1,this.context.canvas.setCursor(this.defaultCursor),(i=(n=this.options).onFinish)===null||i===void 0||i.call(n)},this.invokeOnFinish=_l(()=>{var n,i;(i=(n=this.options).onFinish)===null||i===void 0||i.call(n)},300),this.shortcut=new xo(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(zn(t)){const{up:e=[],down:n=[],left:i=[],right:a=[]}=t;this.shortcut.bind(e,s=>this.onTranslate([0,1],s)),this.shortcut.bind(n,s=>this.onTranslate([0,-1],s)),this.shortcut.bind(i,s=>this.onTranslate([1,0],s)),this.shortcut.bind(a,s=>this.onTranslate([-1,0],s))}else{const{graph:e}=this.context;e.on(It.DRAG_START,this.onDragStart),e.on(It.DRAG,this.onDrag),e.on(It.DRAG_END,this.onDragEnd)}}onTranslate(t,e){return D1(this,void 0,void 0,function*(){if(!this.validate(e))return;const{sensitivity:n}=this.options,i=n*-1;yield this.translate(Wi(t,i),this.options.animation),this.invokeOnFinish()})}translate(t,e){return D1(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]){const n=this.context.graph.getRotation();return ky([t,e],n)}clampByDirection([t,e]){const{direction:n}=this.options;return n==="x"?e=0:n==="y"&&(t=0),[t,e]}clampByRange([t,e]){const{viewport:n,canvas:i}=this.context,[a,s]=i.getSize(),[o,l,c,u]=hi(this.options.range),h=[s*o,a*l,s*c,a*u],d=Va(_f(n.getCanvasCenter()),h),f=dn(n.getViewportCenter(),[t,e,0]);if(!ji(f,d)){const{min:[v,g],max:[p,y]}=d;(f[0]<v&&t>0||f[0]>p&&t<0)&&(t=0),(f[1]<g&&e>0||f[1]>y&&e<0)&&(e=0)}return[t,e]}validate(t){if(this.destroyed)return!1;const{enable:e}=this.options;return typeof e=="function"?e(t):!!e}unbindEvents(){this.shortcut.unbindAll();const{graph:t}=this.context;t.off(It.DRAG_START,this.onDragStart),t.off(It.DRAG,this.onDrag),t.off(It.DRAG_END,this.onDragEnd)}destroy(){this.shortcut.destroy(),this.unbindEvents(),this.context.canvas.setCursor(this.defaultCursor),super.destroy()}}Ju.defaultOptions={enable:r=>"targetType"in r?r.targetType==="canvas":!0,sensitivity:10,direction:"both",range:1/0};var I1=function(r,t,e,n){function i(a){return a instanceof e?a:new e(function(s){s(a)})}return new(e||(e=Promise))(function(a,s){function o(u){try{c(n.next(u))}catch(h){s(h)}}function l(u){try{c(n.throw(u))}catch(h){s(h)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((n=n.apply(r,t||[])).next())})};class Dl extends di{constructor(t,e){super(t,Object.assign({},Dl.defaultOptions,e)),this.enable=!1,this.enableElements=["node","combo"],this.target=[],this.shadowOrigin=[0,0],this.hiddenEdges=[],this.isDragging=!1,this.onDrop=n=>I1(this,void 0,void 0,function*(){var i;if(this.options.dropEffect!=="link")return;const{model:a,element:s}=this.context,o=n.target.id;this.target.forEach(l=>{const c=a.getParentData(l,fn);c&&At(c)===o&&a.refreshComboData(o),a.setParent(l,o,fn)}),yield(i=s==null?void 0:s.draw({animation:!0}))===null||i===void 0?void 0:i.finished}),this.setCursor=n=>{if(this.isDragging)return;const{type:i}=n,{canvas:a}=this.context,{cursor:s}=this.options;i===It.POINTER_ENTER?a.setCursor((s==null?void 0:s.grab)||"grab"):a.setCursor((s==null?void 0:s.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(i=>{t.on(`${i}:${It.DRAG_START}`,this.onDragStart),t.on(`${i}:${It.DRAG}`,this.onDrag),t.on(`${i}:${It.DRAG_END}`,this.onDragEnd),t.on(`${i}:${It.POINTER_ENTER}`,this.setCursor),t.on(`${i}:${It.POINTER_LEAVE}`,this.setCursor)}),["link"].includes(this.options.dropEffect)&&(t.on(ks.DROP,this.onDrop),t.on(ya.DROP,this.onDrop))}getSelectedNodeIDs(t){return Array.from(new Set(this.context.graph.getElementDataByState("node",this.options.state).map(e=>e.id).concat(t)))}getDelta(t){const e=this.context.graph.getZoom();return Zi([t.dx,t.dy],e)}onDragStart(t){var e;if(this.enable=this.validate(t),!this.enable)return;const{batch:n,canvas:i,graph:a}=this.context;i.setCursor(((e=this.options.cursor)===null||e===void 0?void 0:e.grabbing)||"grabbing"),this.isDragging=!0,n.startBatch();const s=t.target.id;a.getElementState(s).includes(this.options.state)?this.target=this.getSelectedNodeIDs([s]):this.target=[s],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:s=0,y:o=0}=this.shadow.attributes,[l,c]=dn([+s,+o],this.shadowOrigin);this.moveElement(this.target,[l,c])}this.showEdges(),(e=(t=this.options).onFinish)===null||e===void 0||e.call(t,this.target);const{batch:i,canvas:a}=this.context;i.endBatch(),a.setCursor(((n=this.options.cursor)===null||n===void 0?void 0:n.grab)||"grab"),this.isDragging=!1,this.target=[]}validate(t){if(this.destroyed||Ll(t.target)||this.context.graph.isCollapsingExpanding)return!1;const{enable:e}=this.options;return ue(e)?e(t):!!e}clampByRotation([t,e]){const n=this.context.graph.getRotation();return ky([t,e],n)}moveElement(t,e){return I1(this,void 0,void 0,function*(){const{graph:n,model:i}=this.context,{dropEffect:a}=this.options;a==="move"&&t.forEach(s=>i.refreshComboData(s)),n.translateElementBy(Object.fromEntries(t.map(s=>[s,this.clampByRotation(e)])),!1)})}moveShadow(t){if(!this.shadow)return;const{x:e=0,y:n=0}=this.shadow.attributes,[i,a]=t;this.shadow.attr({x:+e+i,y:+n+a})}createShadow(t){const e=Dn(this.options,"shadow"),n=yl(t.map(c=>this.context.element.getElement(c).getBounds())),[i,a]=n.min;this.shadowOrigin=[i,a];const[s,o]=Wa(n),l={width:s,height:o,x:i,y:a};this.shadow?this.shadow.attr(Object.assign(Object.assign(Object.assign({},e),l),{visibility:"visible"})):(this.shadow=new br({style:Object.assign(Object.assign(Object.assign({$layer:"transient"},e),l),{pointerEvents:"none"})}),this.context.canvas.appendChild(this.shadow))}showEdges(){this.options.shadow||this.hiddenEdges.length===0||(this.context.graph.showElement(this.hiddenEdges),this.hiddenEdges=[])}hideEdge(){const{hideEdge:t,shadow:e}=this.options;if(t==="none"||e)return;const{graph:n}=this.context;t==="all"?this.hiddenEdges=n.getEdgeData().map(At):this.hiddenEdges=Array.from(new Set(this.target.map(i=>n.getRelatedEdgesData(i,t).map(At)).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(i=>{t.off(`${i}:${It.DRAG_START}`,this.onDragStart),t.off(`${i}:${It.DRAG}`,this.onDrag),t.off(`${i}:${It.DRAG_END}`,this.onDragEnd),t.off(`${i}:${It.POINTER_ENTER}`,this.setCursor),t.off(`${i}:${It.POINTER_LEAVE}`,this.setCursor)}),t.off(`combo:${It.DROP}`,this.onDrop),t.off(`canvas:${It.DROP}`,this.onDrop)}destroy(){var t;this.unbindEvents(),(t=this.shadow)===null||t===void 0||t.destroy(),super.destroy()}}Dl.defaultOptions={animation:!0,enable:r=>["node","combo"].includes(r.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 uP="*",hP=function(){function r(){this._events={}}return r.prototype.on=function(t,e,n){return this._events[t]||(this._events[t]=[]),this._events[t].push({callback:e,once:!!n}),this},r.prototype.once=function(t,e){return this.on(t,e,!0)},r.prototype.emit=function(t){for(var e=this,n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];var a=this._events[t]||[],s=this._events[uP]||[],o=function(l){for(var c=l.length,u=0;u<c;u++)if(l[u]){var h=l[u],d=h.callback,f=h.once;f&&(l.splice(u,1),l.length===0&&delete e._events[t],c--,u--),d.apply(e,n)}};o(a),o(s)},r.prototype.off=function(t,e){if(!t)this._events={};else if(!e)delete this._events[t];else{for(var n=this._events[t]||[],i=n.length,a=0;a<i;a++)n[a].callback===e&&(n.splice(a,1),i--,a--);n.length===0&&delete this._events[t]}return this},r.prototype.getEvents=function(){return this._events},r}(),$u=hP;function Sv(r,t,e,n){for(;r.length;){const i=r.shift();if(e(i))return!0;t.add(i.id),n(i.id).forEach(s=>{t.has(s.id)||(t.add(s.id),r.push(s))})}return!1}function th(r,t,e,n){if(e(r))return!0;t.add(r.id);for(const a of n(r.id))if(!t.has(a.id)&&th(a,t,e,n))return!0;return!1}const B1=()=>!0;class dP{constructor(t){Cn(this,"graph");Cn(this,"nodeFilter");Cn(this,"edgeFilter");Cn(this,"cacheEnabled");Cn(this,"inEdgesMap",new Map);Cn(this,"outEdgesMap",new Map);Cn(this,"bothEdgesMap",new Map);Cn(this,"allNodesMap",new Map);Cn(this,"allEdgesMap",new Map);Cn(this,"clearCache",()=>{this.inEdgesMap.clear(),this.outEdgesMap.clear(),this.bothEdgesMap.clear(),this.allNodesMap.clear(),this.allEdgesMap.clear()});Cn(this,"refreshCache",()=>{this.clearCache(),this.updateCache(this.graph.getAllNodes().map(t=>t.id))});Cn(this,"updateCache",t=>{const e=new Set;t.forEach(n=>{const i=this.bothEdgesMap.get(n);if(i&&i.forEach(a=>e.add(a.id)),!this.hasNode(n))this.inEdgesMap.delete(n),this.outEdgesMap.delete(n),this.bothEdgesMap.delete(n),this.allNodesMap.delete(n);else{const a=this.graph.getRelatedEdges(n,"in").filter(this.edgeFilter),s=this.graph.getRelatedEdges(n,"out").filter(this.edgeFilter),o=Array.from(new Set([...a,...s]));o.forEach(l=>e.add(l.id)),this.inEdgesMap.set(n,a),this.outEdgesMap.set(n,s),this.bothEdgesMap.set(n,o),this.allNodesMap.set(n,this.graph.getNode(n))}}),e.forEach(n=>{this.hasEdge(n)?this.allEdgesMap.set(n,this.graph.getEdge(n)):this.allEdgesMap.delete(n)})});Cn(this,"handleGraphChanged",t=>{const e=new Set;t.changes.forEach(n=>{switch(n.type){case"NodeAdded":e.add(n.value.id);break;case"NodeDataUpdated":e.add(n.id);break;case"EdgeAdded":e.add(n.value.source),e.add(n.value.target);break;case"EdgeUpdated":(n.propertyName==="source"||n.propertyName==="target")&&(e.add(n.oldValue),e.add(n.newValue));break;case"EdgeDataUpdated":if(t.graph.hasEdge(n.id)){const i=t.graph.getEdge(n.id);e.add(i.source),e.add(i.target)}break;case"EdgeRemoved":e.add(n.value.source),e.add(n.value.target);break;case"NodeRemoved":e.add(n.value.id);break;default:break}}),this.updateCache(e)});this.graph=t.graph;const e=t.nodeFilter||B1,n=t.edgeFilter||B1;this.nodeFilter=e,this.edgeFilter=i=>{const{source:a,target:s}=this.graph.getEdgeDetail(i.id);return!e(a)||!e(s)?!1:n(i,a,s)},t.cache==="auto"?(this.cacheEnabled=!0,this.startAutoCache()):t.cache==="manual"?this.cacheEnabled=!0:this.cacheEnabled=!1}startAutoCache(){this.refreshCache(),this.graph.on("changed",this.handleGraphChanged)}stopAutoCache(){this.graph.off("changed",this.handleGraphChanged)}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(n=>n.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){return this.checkNodeExistence(t),this.cacheEnabled?e==="in"?this.inEdgesMap.get(t):e==="out"?this.outEdgesMap.get(t):this.bothEdgesMap.get(t):this.graph.getRelatedEdges(t,e).filter(this.edgeFilter)}getDegree(t,e){return this.getRelatedEdges(t,e).length}getSuccessors(t){const n=this.getRelatedEdges(t,"out").map(i=>this.getNode(i.target));return Array.from(new Set(n))}getPredecessors(t){const n=this.getRelatedEdges(t,"in").map(i=>this.getNode(i.source));return Array.from(new Set(n))}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)?null:n}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 i={in:this.getPredecessors.bind(this),out:this.getSuccessors.bind(this),both:this.getNeighbors.bind(this)}[n];Sv([this.getNode(t)],new Set,e,i)}dfs(t,e,n="out"){const i={in:this.getPredecessors.bind(this),out:this.getSuccessors.bind(this),both:this.getNeighbors.bind(this)}[n];th(this.getNode(t),new Set,e,i)}}class Un extends $u{constructor(e){super();Cn(this,"nodeMap",new Map);Cn(this,"edgeMap",new Map);Cn(this,"inEdgesMap",new Map);Cn(this,"outEdgesMap",new Map);Cn(this,"bothEdgesMap",new Map);Cn(this,"treeIndices",new Map);Cn(this,"changes",[]);Cn(this,"batchCount",0);Cn(this,"onChanged",()=>{});Cn(this,"batch",e=>{this.batchCount+=1,e(),this.batchCount-=1,this.batchCount||this.commit()});e&&(e.nodes&&this.addNodes(e.nodes),e.edges&&this.addEdges(e.edges),e.tree&&this.addTree(e.tree),e.onChanged&&(this.onChanged=e.onChanged))}commit(){const e=this.changes;this.changes=[];const n={graph:this,changes:e};this.emit("changed",n),this.onChanged(n)}reduceChanges(e){let n=[];return e.forEach(i=>{switch(i.type){case"NodeRemoved":{let a=!1;n=n.filter(s=>{if(s.type==="NodeAdded"){const o=s.value.id===i.value.id;return o&&(a=!0),!o}else{if(s.type==="NodeDataUpdated")return s.id!==i.value.id;if(s.type==="TreeStructureChanged")return s.nodeId!==i.value.id}return!0}),a||n.push(i);break}case"EdgeRemoved":{let a=!1;n=n.filter(s=>{if(s.type==="EdgeAdded"){const o=s.value.id===i.value.id;return o&&(a=!0),!o}else if(s.type==="EdgeDataUpdated"||s.type==="EdgeUpdated")return s.id!==i.value.id;return!0}),a||n.push(i);break}case"NodeDataUpdated":case"EdgeDataUpdated":case"EdgeUpdated":{const a=n.findIndex(o=>o.type===i.type&&o.id===i.id&&(i.propertyName===void 0||o.propertyName===i.propertyName)),s=n[a];s?i.propertyName!==void 0?s.newValue=i.newValue:(n.splice(a,1),n.push(i)):n.push(i);break}case"TreeStructureDetached":{n=n.filter(a=>a.type==="TreeStructureAttached"||a.type==="TreeStructureChanged"?a.treeKey!==i.treeKey:!0),n.push(i);break}case"TreeStructureChanged":{const a=n.find(s=>s.type==="TreeStructureChanged"&&s.treeKey===i.treeKey&&s.nodeId===i.nodeId);a?a.newParentId=i.newParentId:n.push(i);break}default:n.push(i);break}}),n}checkNodeExistence(e){this.getNode(e)}hasNode(e){return this.nodeMap.has(e)}areNeighbors(e,n){return this.getNeighbors(n).some(i=>i.id===e)}getNode(e){const n=this.nodeMap.get(e);if(!n)throw new Error("Node not found for id: "+e);return n}getRelatedEdges(e,n){if(this.checkNodeExistence(e),n==="in"){const i=this.inEdgesMap.get(e);return Array.from(i)}else if(n==="out"){const i=this.outEdgesMap.get(e);return Array.from(i)}else{const i=this.bothEdgesMap.get(e);return Array.from(i)}}getDegree(e,n){return this.getRelatedEdges(e,n).length}getSuccessors(e){const i=this.getRelatedEdges(e,"out").map(a=>this.getNode(a.target));return Array.from(new Set(i))}getPredecessors(e){const i=this.getRelatedEdges(e,"in").map(a=>this.getNode(a.source));return Array.from(new Set(i))}getNeighbors(e){const n=this.getPredecessors(e),i=this.getSuccessors(e);return Array.from(new Set([...n,...i]))}doAddNode(e){if(this.hasNode(e.id))throw new Error("Node already exists: "+e.id);this.nodeMap.set(e.id,e),this.inEdgesMap.set(e.id,new Set),this.outEdgesMap.set(e.id,new Set),this.bothEdgesMap.set(e.id,new Set),this.treeIndices.forEach(n=>{n.childrenMap.set(e.id,new Set)}),this.changes.push({type:"NodeAdded",value:e})}addNodes(e){this.batch(()=>{for(const n of e)this.doAddNode(n)})}addNode(e){this.addNodes([e])}doRemoveNode(e){const n=this.getNode(e),i=this.bothEdgesMap.get(e);i==null||i.forEach(a=>this.doRemoveEdge(a.id)),this.nodeMap.delete(e),this.treeIndices.forEach(a=>{var o,l;(o=a.childrenMap.get(e))==null||o.forEach(c=>{a.parentMap.delete(c.id)});const s=a.parentMap.get(e);s&&((l=a.childrenMap.get(s.id))==null||l.delete(n)),a.parentMap.delete(e),a.childrenMap.delete(e)}),this.bothEdgesMap.delete(e),this.inEdgesMap.delete(e),this.outEdgesMap.delete(e),this.changes.push({type:"NodeRemoved",value:n})}removeNodes(e){this.batch(()=>{e.forEach(n=>this.doRemoveNode(n))})}removeNode(e){this.removeNodes([e])}updateNodeDataProperty(e,n,i){const a=this.getNode(e);this.batch(()=>{const s=a.data[n],o=i;a.data[n]=o,this.changes.push({type:"NodeDataUpdated",id:e,propertyName:n,oldValue:s,newValue:o})})}mergeNodeData(e,n){this.batch(()=>{Object.entries(n).forEach(([i,a])=>{this.updateNodeDataProperty(e,i,a)})})}updateNodeData(...e){const n=e[0],i=this.getNode(n);if(typeof e[1]=="string"){this.updateNodeDataProperty(n,e[1],e[2]);return}let a;if(typeof e[1]=="function"){const s=e[1];a=s(i.data)}else typeof e[1]=="object"&&(a=e[1]);this.batch(()=>{const s=i.data,o=a;i.data=a,this.changes.push({type:"NodeDataUpdated",id:n,oldValue:s,newValue:o})})}checkEdgeExistence(e){if(!this.hasEdge(e))throw new Error("Edge not found for id: "+e)}hasEdge(e){return this.edgeMap.has(e)}getEdge(e){return this.checkEdgeExistence(e),this.edgeMap.get(e)}getEdgeDetail(e){const n=this.getEdge(e);return{edge:n,source:this.getNode(n.source),target:this.getNode(n.target)}}doAddEdge(e){if(this.hasEdge(e.id))throw new Error("Edge already exists: "+e.id);this.checkNodeExistence(e.source),this.checkNodeExistence(e.target),this.edgeMap.set(e.id,e);const n=this.inEdgesMap.get(e.target),i=this.outEdgesMap.get(e.source),a=this.bothEdgesMap.get(e.source),s=this.bothEdgesMap.get(e.target);n.add(e),i.add(e),a.add(e),s.add(e),this.changes.push({type:"EdgeAdded",value:e})}addEdges(e){this.batch(()=>{for(const n of e)this.doAddEdge(n)})}addEdge(e){this.addEdges([e])}doRemoveEdge(e){const n=this.getEdge(e),i=this.outEdgesMap.get(n.source),a=this.inEdgesMap.get(n.target),s=this.bothEdgesMap.get(n.source),o=this.bothEdgesMap.get(n.target);i.delete(n),a.delete(n),s.delete(n),o.delete(n),this.edgeMap.delete(e),this.changes.push({type:"EdgeRemoved",value:n})}removeEdges(e){this.batch(()=>{e.forEach(n=>this.doRemoveEdge(n))})}removeEdge(e){this.removeEdges([e])}updateEdgeSource(e,n){const i=this.getEdge(e);this.checkNodeExistence(n);const a=i.source,s=n;this.outEdgesMap.get(a).delete(i),this.bothEdgesMap.get(a).delete(i),this.outEdgesMap.get(s).add(i),this.bothEdgesMap.get(s).add(i),i.source=n,this.batch(()=>{this.changes.push({type:"EdgeUpdated",id:e,propertyName:"source",oldValue:a,newValue:s})})}updateEdgeTarget(e,n){const i=this.getEdge(e);this.checkNodeExistence(n);const a=i.target,s=n;this.inEdgesMap.get(a).delete(i),this.bothEdgesMap.get(a).delete(i),this.inEdgesMap.get(s).add(i),this.bothEdgesMap.get(s).add(i),i.target=n,this.batch(()=>{this.changes.push({type:"EdgeUpdated",id:e,propertyName:"target",oldValue:a,newValue:s})})}updateEdgeDataProperty(e,n,i){const a=this.getEdge(e);this.batch(()=>{const s=a.data[n],o=i;a.data[n]=o,this.changes.push({type:"EdgeDataUpdated",id:e,propertyName:n,oldValue:s,newValue:o})})}updateEdgeData(...e){const n=e[0],i=this.getEdge(n);if(typeof e[1]=="string"){this.updateEdgeDataProperty(n,e[1],e[2]);return}let a;if(typeof e[1]=="function"){const s=e[1];a=s(i.data)}else typeof e[1]=="object"&&(a=e[1]);this.batch(()=>{const s=i.data,o=a;i.data=a,this.changes.push({type:"EdgeDataUpdated",id:n,oldValue:s,newValue:o})})}mergeEdgeData(e,n){this.batch(()=>{Object.entries(n).forEach(([i,a])=>{this.updateEdgeDataProperty(e,i,a)})})}checkTreeExistence(e){if(!this.hasTreeStructure(e))throw new Error("Tree structure not found for treeKey: "+e)}hasTreeStructure(e){return this.treeIndices.has(e)}attachTreeStructure(e){this.treeIndices.has(e)||(this.treeIndices.set(e,{parentMap:new Map,childrenMap:new Map}),this.batch(()=>{this.changes.push({type:"TreeStructureAttached",treeKey:e})}))}detachTreeStructure(e){this.checkTreeExistence(e),this.treeIndices.delete(e),this.batch(()=>{this.changes.push({type:"TreeStructureDetached",treeKey:e})})}addTree(e,n){this.batch(()=>{this.attachTreeStructure(n);const i=[],a=Array.isArray(e)?e:[e];for(;a.length;){const s=a.shift();i.push(s),s.children&&a.push(...s.children)}this.addNodes(i),i.forEach(s=>{var o;(o=s.children)==null||o.forEach(l=>{this.setParent(l.id,s.id,n)})})})}getRoots(e){return this.checkTreeExistence(e),this.getAllNodes().filter(n=>!this.getParent(n.id,e))}getChildren(e,n){this.checkNodeExistence(e),this.checkTreeExistence(n);const a=this.treeIndices.get(n).childrenMap.get(e);return Array.from(a||[])}getParent(e,n){return this.checkNodeExistence(e),this.checkTreeExistence(n),this.treeIndices.get(n).parentMap.get(e)||null}getAncestors(e,n){const i=[];let a=this.getNode(e),s;for(;s=this.getParent(a.id,n);)i.push(s),a=s;return i}setParent(e,n,i){var u,h;this.checkTreeExistence(i);const a=this.treeIndices.get(i);if(!a)return;const s=this.getNode(e),o=a.parentMap.get(e);if((o==null?void 0:o.id)===n)return;if(n==null){o&&((u=a.childrenMap.get(o.id))==null||u.delete(s)),a.parentMap.delete(e);return}const l=this.getNode(n);a.parentMap.set(e,l),o&&((h=a.childrenMap.get(o.id))==null||h.delete(s));let c=a.childrenMap.get(l.id);c||(c=new Set,a.childrenMap.set(l.id,c)),c.add(s),this.batch(()=>{this.changes.push({type:"TreeStructureChanged",treeKey:i,nodeId:e,oldParentId:o==null?void 0:o.id,newParentId:l.id})})}dfsTree(e,n,i){const a=s=>this.getChildren(s,i);return th(this.getNode(e),new Set,n,a)}bfsTree(e,n,i){const a=s=>this.getChildren(s,i);return Sv([this.getNode(e)],new Set,n,a)}getAllNodes(){return Array.from(this.nodeMap.values())}getAllEdges(){return Array.from(this.edgeMap.values())}bfs(e,n,i="out"){const a={in:this.getPredecessors.bind(this),out:this.getSuccessors.bind(this),both:this.getNeighbors.bind(this)}[i];return Sv([this.getNode(e)],new Set,n,a)}dfs(e,n,i="out"){const a={in:this.getPredecessors.bind(this),out:this.getSuccessors.bind(this),both:this.getNeighbors.bind(this)}[i];return th(this.getNode(e),new Set,n,a)}clone(){const e=this.getAllNodes().map(a=>q0(Wo({},a),{data:Wo({},a.data)})),n=this.getAllEdges().map(a=>q0(Wo({},a),{data:Wo({},a.data)})),i=new Un({nodes:e,edges:n});return this.treeIndices.forEach(({parentMap:a,childrenMap:s},o)=>{const l=new Map;a.forEach((u,h)=>{l.set(h,i.getNode(u.id))});const c=new Map;s.forEach((u,h)=>{c.set(h,new Set(Array.from(u).map(d=>i.getNode(d.id))))}),i.treeIndices.set(o,{parentMap:l,childrenMap:c})}),i}toJSON(){return JSON.stringify({nodes:this.getAllNodes(),edges:this.getAllEdges()})}createView(e){return new dP(Wo({graph:this},e))}}class eh{constructor(t,e){this.context=t,this.options=e||{}}}var fP=function(r,t,e,n){function i(a){return a instanceof e?a:new e(function(s){s(a)})}return new(e||(e=Promise))(function(a,s){function o(u){try{c(n.next(u))}catch(h){s(h)}}function l(u){try{c(n.throw(u))}catch(h){s(h)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((n=n.apply(r,t||[])).next())})},vP=function(r,t){var e={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&t.indexOf(n)<0&&(e[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(e[n[i]]=r[n[i]]);return e};function T7(r){const{type:t}=r;return!!(["comboCombined","comboForce"].includes(t)||t==="antv-dagre"&&r.sortByCombo)}function gP(r){const{type:t}=r;return["compact-box","mindmap","dendrogram","indented"].includes(t)}function O7(r){return isNumber(r.x)&&isNumber(r.y)}function pP(r){return!Array.isArray(r)&&(r==null?void 0:r.preLayout)}function nh(r){const{nodes:t,edges:e}=r,n={nodes:[],edges:[],combos:[]};return t.forEach(i=>{const a=i.data._isCombo?n.combos:n.nodes,{x:s,y:o,z:l=0}=i.data;a==null||a.push({id:i.id,style:{x:s,y:o,z:l}})}),e.forEach(i=>{const{id:a,source:s,target:o,data:{points:l=[],controlPoints:c=l.slice(1,l.length-1)}}=i;n.edges.push({id:a,source:s,target:o,style:Object.assign({},c!=null&&c.length?{controlPoints:c.map(Er)}:{})})}),n}function mP(r,t){class e extends eh{constructor(i,a){if(super(i,a),this.instance=new r({}),this.id=this.instance.id,"stop"in this.instance&&"tick"in this.instance){const s=this.instance;this.stop=s.stop.bind(s),this.tick=o=>{const l=s.tick(o);return nh(l)}}}execute(i,a){return fP(this,void 0,void 0,function*(){return nh(yield this.instance.execute(this.graphData2LayoutModel(i),this.transformOptions(xr({},this.options,a))))})}transformOptions(i){if(!("onTick"in i))return i;const a=i.onTick;return i.onTick=s=>a(nh(s)),i}graphData2LayoutModel(i){const{nodes:a=[],edges:s=[],combos:o=[]}=i,l=a.map(f=>{const v=At(f),{data:g,style:p,combo:y}=f,b=vP(f,["data","style","combo"]),E={id:v,data:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},g),{data:g}),y?{parentId:y}:{}),{style:p}),b)};return p!=null&&p.x&&Object.assign(E.data,{x:p.x}),p!=null&&p.y&&Object.assign(E.data,{y:p.y}),p!=null&&p.z&&Object.assign(E.data,{z:p.z}),E}),c=new Map(l.map(f=>[f.id,f])),u=s.filter(f=>{const{source:v,target:g}=f;return c.has(v)&&c.has(g)}).map(f=>{const{source:v,target:g,data:p,style:y}=f;return{id:At(f),source:v,target:g,data:Object.assign({},p),style:Object.assign({},y)}}),h=o.map(f=>({id:At(f),data:Object.assign({_isCombo:!0},f.data),style:Object.assign({},f.style)})),d=new Un({nodes:[...l,...h],edges:u});return t.model.model.hasTreeStructure(fn)&&(d.attachTreeStructure(fn),l.forEach(f=>{const v=t.model.model.getParent(f.id,fn);v&&d.hasNode(v.id)&&d.setParent(f.id,v.id,fn)})),d}}return e}function Mv(r,t,...e){if(t in r)return r[t](...e);if("instance"in r){const n=r.instance;if(t in n)return n[t](...e)}return null}function F1(r,t){if(t in r)return r[t];if("instance"in r){const e=r.instance;if(t in e)return e[t]}return null}var yP=function(r,t,e,n){function i(a){return a instanceof e?a:new e(function(s){s(a)})}return new(e||(e=Promise))(function(a,s){function o(u){try{c(n.next(u))}catch(h){s(h)}}function l(u){try{c(n.throw(u))}catch(h){s(h)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((n=n.apply(r,t||[])).next())})};class bP extends Dl{get forceLayoutInstance(){return this.context.layout.getLayoutInstance().find(t=>["d3-force","d3-force-3d"].includes(t==null?void 0:t.id))}validate(t){return this.context.layout?this.forceLayoutInstance?super.validate(t):(ei.warn("DragElementForce only works with d3-force or d3-force-3d layout"),!1):!1}moveElement(t,e){return yP(this,void 0,void 0,function*(){const n=this.forceLayoutInstance;this.context.graph.getNodeData(t).forEach((i,a)=>{const{x:s=0,y:o=0}=i.style||{};n&&Mv(n,"setFixedPosition",t[a],[...Le([+s,+o],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&&F1(e,"simulation").alphaTarget(.3).restart(),this.context.graph.getNodeData(this.target).forEach(n=>{const{x:i=0,y:a=0}=n.style||{};e&&Mv(e,"setFixedPosition",At(n),[+i,+a])})}onDrag(t){if(!this.enable)return;const e=this.getDelta(t);this.moveElement(this.target,e)}onDragEnd(){const t=this.forceLayoutInstance;t&&F1(t,"simulation").alphaTarget(0),!this.options.fixed&&this.context.graph.getNodeData(this.target).forEach(e=>{t&&Mv(t,"setFixedPosition",At(e),[null,null,null])})}}var z1=function(r,t,e,n){function i(a){return a instanceof e?a:new e(function(s){s(a)})}return new(e||(e=Promise))(function(a,s){function o(u){try{c(n.next(u))}catch(h){s(h)}}function l(u){try{c(n.throw(u))}catch(h){s(h)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((n=n.apply(r,t||[])).next())})};class rh extends di{constructor(t,e){super(t,Object.assign({},rh.defaultOptions,e)),this.isZoomEvent=n=>!!(n.data&&"scale"in n.data),this.relatedEdgeToUpdate=new Set,this.zoom=this.context.graph.getZoom(),this.fixElementSize=n=>z1(this,void 0,void 0,function*(){if(!this.validate(n))return;const{graph:i}=this.context,{state:a,nodeFilter:s,edgeFilter:o,comboFilter:l}=this.options,c=(a?i.getElementDataByState("node",a):i.getNodeData()).filter(s),u=(a?i.getElementDataByState("edge",a):i.getEdgeData()).filter(o),h=(a?i.getElementDataByState("combo",a):i.getComboData()).filter(l),d=this.isZoomEvent(n)?this.zoom=Math.max(.01,Math.min(n.data.scale,10)):this.zoom,f=[...c,...h];f.length>0&&f.forEach(v=>this.fixNodeLike(v,d)),this.updateRelatedEdges(),u.length>0&&u.forEach(v=>this.fixEdge(v,d))}),this.cachedStyles=new Map,this.getOriginalFieldValue=(n,i,a)=>{var s;const o=this.cachedStyles.get(n)||[],l=((s=o.find(c=>c.shape===i))===null||s===void 0?void 0:s.style)||{};return a in l||(l[a]=i.attributes[a],this.cachedStyles.set(n,[...o.filter(c=>c.shape!==i),{shape:i,style:l}])),l[a]},this.scaleEntireElement=(n,i,a)=>{i.setLocalScale(1/a);const s=this.cachedStyles.get(n)||[];s.push({shape:i}),this.cachedStyles.set(n,s)},this.scaleSpecificShapes=(n,i,a)=>{const s=ck(n);(Array.isArray(a)?a:[a]).forEach(l=>{const{shape:c,fields:u}=l,h=typeof c=="function"?c(s):n.getShape(c);if(h){if(!u){this.scaleEntireElement(n.id,h,i);return}u.forEach(d=>{const f=this.getOriginalFieldValue(n.id,h,d);ie(f)&&(h.style[d]=f/i)})}})},this.skipIfExceedViewport=n=>{const{viewport:i}=this.context;return!(i!=null&&i.isInViewport(n.getRenderBounds(),!1,30))},this.fixNodeLike=(n,i)=>{const a=At(n),{element:s,model:o}=this.context,l=s.getElement(a);if(!l||this.skipIfExceedViewport(l))return;o.getRelatedEdgesData(a).forEach(h=>this.relatedEdgeToUpdate.add(At(h)));const u=this.options[l.type];if(!u){this.scaleEntireElement(a,l,i);return}this.scaleSpecificShapes(l,i,u)},this.fixEdge=(n,i)=>{const a=At(n),s=this.context.element.getElement(a);if(!s||this.skipIfExceedViewport(s))return;const o=this.options.edge;if(!o){s.style.transformOrigin="center",this.scaleEntireElement(a,s,i);return}this.scaleSpecificShapes(s,i,o)},this.updateRelatedEdges=()=>{const{element:n}=this.context;this.relatedEdgeToUpdate.size>0&&this.relatedEdgeToUpdate.forEach(i=>{const a=n.getElement(i);a==null||a.update({})}),this.relatedEdgeToUpdate.clear()},this.resetTransform=n=>z1(this,void 0,void 0,function*(){var i;!((i=n.data)===null||i===void 0)&&i.firstRender||(this.options.reset?this.restoreCachedStyles():this.fixElementSize({data:{scale:this.zoom}}))}),this.bindEvents()}restoreCachedStyles(){if(this.cachedStyles.size>0){this.cachedStyles.forEach(i=>{i.forEach(({shape:a,style:s})=>{if(ua(s))a.setLocalScale(1);else{if(this.options.state)return;Object.entries(s).forEach(([o,l])=>a.style[o]=l)}})});const{graph:t,element:e}=this.context,n=Object.keys(Object.fromEntries(this.cachedStyles)).filter(i=>i&&t.getElementType(i)==="node");if(n.length>0){const i=new Set;n.forEach(a=>{t.getRelatedEdgesData(a).forEach(s=>i.add(At(s)))}),i.forEach(a=>{const s=e==null?void 0:e.getElement(a);s==null||s.update({})})}}}bindEvents(){const{graph:t}=this.context;t.on(Xt.AFTER_DRAW,this.resetTransform),t.on(Xt.AFTER_TRANSFORM,this.fixElementSize)}unbindEvents(){const{graph:t}=this.context;t.off(Xt.AFTER_DRAW,this.resetTransform),t.off(Xt.AFTER_TRANSFORM,this.fixElementSize)}validate(t){if(this.destroyed)return!1;const{enable:e}=this.options;return ue(e)?e(t):!!e}destroy(){this.unbindEvents(),super.destroy()}}rh.defaultOptions={enable:r=>r.data.scale<1,nodeFilter:()=>!0,edgeFilter:()=>!0,comboFilter:()=>!0,edge:[{shape:"key",fields:["lineWidth"]},{shape:"halo",fields:["lineWidth"]},{shape:"label"}],reset:!1};var xP=function(r,t,e,n){function i(a){return a instanceof e?a:new e(function(s){s(a)})}return new(e||(e=Promise))(function(a,s){function o(u){try{c(n.next(u))}catch(h){s(h)}}function l(u){try{c(n.throw(u))}catch(h){s(h)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((n=n.apply(r,t||[])).next())})};class ih extends di{constructor(t,e){super(t,Object.assign({},ih.defaultOptions,e)),this.focus=n=>xP(this,void 0,void 0,function*(){if(!this.validate(n))return;const{graph:i}=this.context;yield i.focusElement(n.target.id,this.options.animation)}),this.bindEvents()}bindEvents(){const{graph:t}=this.context;this.unbindEvents(),Ds.forEach(e=>{t.on(`${e}:${It.CLICK}`,this.focus)})}validate(t){if(this.destroyed)return!1;const{enable:e}=this.options;return ue(e)?e(t):!!e}unbindEvents(){const{graph:t}=this.context;Ds.forEach(e=>{t.off(`${e}:${It.CLICK}`,this.focus)})}destroy(){this.unbindEvents(),super.destroy()}}ih.defaultOptions={animation:{easing:"ease-in",duration:500},enable:!0};class ah extends di{constructor(t,e){super(t,Object.assign({},ah.defaultOptions,e)),this.isFrozen=!1,this.toggleFrozen=n=>{this.isFrozen=n.type==="dragstart"},this.hoverElement=n=>{if(!this.validate(n))return;const i=n.type===It.POINTER_ENTER;this.updateElementsState(n,i);const{onHover:a,onHoverEnd:s}=this.options;i?a==null||a(n):s==null||s(n)},this.updateElementsState=(n,i)=>{if(!this.options.state&&!this.options.inactiveState)return;const{graph:a}=this.context,{state:s,animation:o,inactiveState:l}=this.options,c=this.getActiveIds(n),u={};if(s&&Object.assign(u,this.getElementsState(c,s,i)),l){const h=My(a.getData(),!0).filter(d=>!c.includes(d));Object.assign(u,this.getElementsState(h,l,i))}a.setElementState(u,o)},this.getElementsState=(n,i,a)=>{const{graph:s}=this.context,o={};return n.forEach(l=>{const c=s.getElementState(l);a?o[l]=c.includes(i)?c:[...c,i]:o[l]=c.filter(u=>u!==i)}),o},this.bindEvents()}bindEvents(){const{graph:t}=this.context;this.unbindEvents(),Ds.forEach(n=>{t.on(`${n}:${It.POINTER_ENTER}`,this.hoverElement),t.on(`${n}:${It.POINTER_LEAVE}`,this.hoverElement)});const e=this.context.canvas.document;e.addEventListener(`${It.DRAG_START}`,this.toggleFrozen),e.addEventListener(`${It.DRAG_END}`,this.toggleFrozen)}getActiveIds(t){const{graph:e}=this.context,{degree:n,direction:i}=this.options,a=t.target.id;return n?Gy(e,t.targetType,a,typeof n=="function"?n(t):n,i):[a]}validate(t){if(this.destroyed||this.isFrozen||Ll(t.target)||this.context.graph.isCollapsingExpanding)return!1;const{enable:e}=this.options;return ue(e)?e(t):!!e}unbindEvents(){const{graph:t}=this.context;Ds.forEach(n=>{t.off(`${n}:${It.POINTER_ENTER}`,this.hoverElement),t.off(`${n}:${It.POINTER_LEAVE}`,this.hoverElement)});const e=this.context.canvas.document;e.removeEventListener(`${It.DRAG_START}`,this.toggleFrozen),e.removeEventListener(`${It.DRAG_END}`,this.toggleFrozen)}destroy(){this.unbindEvents(),super.destroy()}}ah.defaultOptions={animation:!1,enable:!0,degree:0,direction:"both",state:"active",inactiveState:void 0};class EP extends Ml{onPointerDown(t){if(!super.validate(t)||!super.isKeydown()||this.points)return;const{canvas:e,graph:n}=this.context;this.pathShape=new li({id:"g6-lasso-select",style:this.options.style}),e.appendChild(this.pathShape),this.points=[Eu(t,n)]}onPointerMove(t){var e;if(!this.points)return;const{immediately:n,mode:i}=this.options;this.points.push(Eu(t,this.context.graph)),(e=this.pathShape)===null||e===void 0||e.setAttribute("d",ik(this.points)),n&&i==="default"&&this.points.length>2&&super.updateElementsStates(this.points)}onPointerUp(){if(this.points){if(this.points.length<2){this.clearLasso();return}super.updateElementsStates(this.points),this.clearLasso()}}clearLasso(){var t;(t=this.pathShape)===null||t===void 0||t.remove(),this.pathShape=void 0,this.points=void 0}}class sh extends di{constructor(t,e){super(t,Object.assign({},sh.defaultOptions,e)),this.hiddenShapes=[],this.isVisible=!0,this.setElementsVisibility=(n,i,a)=>{n.filter(Boolean).forEach(s=>{i==="hidden"&&!s.isVisible()?this.hiddenShapes.push(s):i==="visible"&&this.hiddenShapes.includes(s)?this.hiddenShapes.splice(this.hiddenShapes.indexOf(s),1):Ls(s,i,a)})},this.filterShapes=(n,i)=>{if(ue(i))return s=>!i(n,s);const a=i==null?void 0:i[n];return s=>s.className?!(a!=null&&a.includes(s.className)):!0},this.hideShapes=n=>{if(!this.validate(n)||!this.isVisible)return;const{element:i}=this.context,{shapes:a={}}=this.options;this.setElementsVisibility(i.getNodes(),"hidden",this.filterShapes("node",a)),this.setElementsVisibility(i.getEdges(),"hidden",this.filterShapes("edge",a)),this.setElementsVisibility(i.getCombos(),"hidden",this.filterShapes("combo",a)),this.isVisible=!1},this.showShapes=_l(n=>{if(!this.validate(n)||this.isVisible)return;const{element:i}=this.context;this.setElementsVisibility(i.getNodes(),"visible"),this.setElementsVisibility(i.getEdges(),"visible"),this.setElementsVisibility(i.getCombos(),"visible"),this.isVisible=!0},this.options.debounce),this.bindEvents()}bindEvents(){const{graph:t}=this.context;t.on(Xt.BEFORE_TRANSFORM,this.hideShapes),t.on(Xt.AFTER_TRANSFORM,this.showShapes)}unbindEvents(){const{graph:t}=this.context;t.off(Xt.BEFORE_TRANSFORM,this.hideShapes),t.off(Xt.AFTER_TRANSFORM,this.showShapes)}validate(t){if(this.destroyed)return!1;const{enable:e}=this.options;return ue(e)?e(t):!!e}update(t){this.unbindEvents(),super.update(t),this.bindEvents()}destroy(){this.unbindEvents(),super.destroy()}}sh.defaultOptions={enable:!0,debounce:200,shapes:r=>r==="node"};var j1=function(r,t,e,n){function i(a){return a instanceof e?a:new e(function(s){s(a)})}return new(e||(e=Promise))(function(a,s){function o(u){try{c(n.next(u))}catch(h){s(h)}}function l(u){try{c(n.throw(u))}catch(h){s(h)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((n=n.apply(r,t||[])).next())})};class oh extends di{constructor(t,e){super(t,Object.assign({},oh.defaultOptions,e)),this.onWheel=n=>j1(this,void 0,void 0,function*(){this.options.preventDefault&&n.preventDefault();const i=n.deltaX,a=n.deltaY;yield this.scroll([-i,-a],n)}),this.shortcut=new xo(t.graph),this.bindEvents()}update(t){super.update(t),this.bindEvents()}bindEvents(){var t,e;const{trigger:n}=this.options;if(this.shortcut.unbindAll(),zn(n)){(t=this.graphDom)===null||t===void 0||t.removeEventListener(It.WHEEL,this.onWheel);const{up:i=[],down:a=[],left:s=[],right:o=[]}=n;this.shortcut.bind(i,l=>this.scroll([0,-10],l)),this.shortcut.bind(a,l=>this.scroll([0,10],l)),this.shortcut.bind(s,l=>this.scroll([-10,0],l)),this.shortcut.bind(o,l=>this.scroll([10,0],l))}else(e=this.graphDom)===null||e===void 0||e.addEventListener(It.WHEEL,this.onWheel,{passive:!1})}get graphDom(){return this.context.graph.getCanvas().getContextService().getDomElement()}formatDisplacement(t){const{sensitivity:e}=this.options;return t=Wi(t,e),t=this.clampByDirection(t),t=this.clampByRange(t),t}clampByDirection([t,e]){const{direction:n}=this.options;return n==="x"?e=0:n==="y"&&(t=0),[t,e]}clampByRange([t,e]){const{viewport:n,canvas:i}=this.context,[a,s]=i.getSize(),[o,l,c,u]=hi(this.options.range),h=[s*o,a*l,s*c,a*u],d=Va(_f(n.getCanvasCenter()),h),f=dn(n.getViewportCenter(),[t,e,0]);if(!ji(f,d)){const{min:[v,g],max:[p,y]}=d;(f[0]<v&&t>0||f[0]>p&&t<0)&&(t=0),(f[1]<g&&e>0||f[1]>y&&e<0)&&(e=0)}return[t,e]}scroll(t,e){return j1(this,void 0,void 0,function*(){if(!this.validate(e))return;const{onFinish:n}=this.options,i=this.context.graph,a=this.formatDisplacement(t);yield i.translateBy(a,!1),n==null||n()})}validate(t){if(this.destroyed)return!1;const{enable:e}=this.options;return ue(e)?e(t):!!e}destroy(){var t;this.shortcut.destroy(),(t=this.graphDom)===null||t===void 0||t.removeEventListener(It.WHEEL,this.onWheel),super.destroy()}}oh.defaultOptions={enable:!0,sensitivity:1,preventDefault:!0,range:1/0};var G1=function(r,t,e,n){function i(a){return a instanceof e?a:new e(function(s){s(a)})}return new(e||(e=Promise))(function(a,s){function o(u){try{c(n.next(u))}catch(h){s(h)}}function l(u){try{c(n.throw(u))}catch(h){s(h)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((n=n.apply(r,t||[])).next())})};class lh extends di{constructor(t,e){super(t,Object.assign({},lh.defaultOptions,e)),this.zoom=(n,i,a)=>G1(this,void 0,void 0,function*(){if(!this.validate(i))return;const{graph:s}=this.context;let o=this.options.origin;!o&&"viewport"in i&&(o=Er(i.viewport));const{sensitivity:l,onFinish:c}=this.options,u=1+kn(n,-50,50)*l/100,h=s.getZoom();yield s.zoomTo(h*u,a,o),c==null||c()}),this.onReset=()=>G1(this,void 0,void 0,function*(){yield this.context.graph.zoomTo(1,this.options.animation)}),this.preventDefault=n=>{this.options.preventDefault&&n.preventDefault()},this.shortcut=new xo(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(It.PINCH))this.shortcut.bind([It.PINCH],e=>{this.zoom(e.scale,e,!1)});else{const e=this.context.canvas.getContainer();e==null||e.addEventListener(It.WHEEL,this.preventDefault),this.shortcut.bind([...t,It.WHEEL],n=>{const{deltaX:i,deltaY:a}=n;this.zoom(-(a!=null?a:i),n,!1)})}if(typeof t=="object"){const{zoomIn:e=[],zoomOut:n=[],reset:i=[]}=t;this.shortcut.bind(e,a=>this.zoom(10,a,this.options.animation)),this.shortcut.bind(n,a=>this.zoom(-10,a,this.options.animation)),this.shortcut.bind(i,this.onReset)}}validate(t){if(this.destroyed)return!1;const{enable:e}=this.options;return ue(e)?e(t):!!e}destroy(){var t;this.shortcut.destroy(),(t=this.context.canvas.getContainer())===null||t===void 0||t.removeEventListener(It.WHEEL,this.preventDefault),super.destroy()}}lh.defaultOptions={animation:{duration:200},enable:!0,sensitivity:1,trigger:[],preventDefault:!0};var ch=S(13722);const wP=(r,t)=>{if(r!=="next"&&r!=="prev")return t},W1=r=>{r.prev.next=r.next,r.next.prev=r.prev,delete r.next,delete r.prev};class SP{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 W1(e),e}enqueue(t){const e=this.shortcut;t.prev&&t.next&&W1(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,wP)),n=n==null?void 0:n.prev;return`[${t.join(", ")}]`}}class MP extends SP{}const AP=()=>1,TP=(r,t)=>{var e;if(r.getAllNodes().length<=1)return[];const n=CP(r,t||AP);return(e=OP(n.graph,n.buckets,n.zeroIdx).map(a=>r.getRelatedEdges(a.v,"out").filter(({target:s})=>s===a.w)))===null||e===void 0?void 0:e.flat()},OP=(r,t,e)=>{let n=[];const i=t[t.length-1],a=t[0];let s;for(;r.getAllNodes().length;){for(;s=a.dequeue();)Av(r,t,e,s);for(;s=i.dequeue();)Av(r,t,e,s);if(r.getAllNodes().length){for(let o=t.length-2;o>0;--o)if(s=t[o].dequeue(),s){n=n.concat(Av(r,t,e,s,!0));break}}}return n},Av=(r,t,e,n,i)=>{var a,s;const o=[];return r.hasNode(n.v)&&((a=r.getRelatedEdges(n.v,"in"))===null||a===void 0||a.forEach(l=>{const c=l.data.weight,u=r.getNode(l.source);i&&o.push({v:l.source,w:l.target,in:0,out:0}),u.data.out===void 0&&(u.data.out=0),u.data.out-=c,Tv(t,e,Object.assign({v:u.id},u.data))}),(s=r.getRelatedEdges(n.v,"out"))===null||s===void 0||s.forEach(l=>{const c=l.data.weight,u=l.target,h=r.getNode(u);h.data.in===void 0&&(h.data.in=0),h.data.in-=c,Tv(t,e,Object.assign({v:h.id},h.data))}),r.removeNode(n.v)),i?o:void 0},CP=(r,t)=>{const e=new Un;let n=0,i=0;r.getAllNodes().forEach(l=>{e.addNode({id:l.id,data:{v:l.id,in:0,out:0}})}),r.getAllEdges().forEach(l=>{const c=e.getRelatedEdges(l.source,"out").find(h=>h.target===l.target),u=(t==null?void 0:t(l))||1;c?e.updateEdgeData(c==null?void 0:c.id,Object.assign(Object.assign({},c.data),{weight:c.data.weight+u})):e.addEdge({id:l.id,source:l.source,target:l.target,data:{weight:u}}),i=Math.max(i,e.getNode(l.source).data.out+=u),n=Math.max(n,e.getNode(l.target).data.in+=u)});const a=[],s=i+n+3;for(let l=0;l<s;l++)a.push(new MP);const o=n+1;return e.getAllNodes().forEach(l=>{Tv(a,o,Object.assign({v:l.id},e.getNode(l.id).data))}),{buckets:a,zeroIdx:o,graph:e}},Tv=(r,t,e)=>{e.out?e.in?r[e.out-e.in+t].enqueue(e):r[r.length-1].enqueue(e):r[0].enqueue(e)},NP=(r,t)=>{const n=t==="greedy"?TP(r,(i=>a=>a.data.weight||1)(r)):kP(r);n==null||n.forEach(i=>{const a=i.data;r.removeEdge(i.id),a.forwardName=i.data.name,a.reversed=!0,r.addEdge({id:i.id,source:i.target,target:i.source,data:Object.assign({},a)})})},kP=r=>{const t=[],e={},n={},i=a=>{n[a]||(n[a]=!0,e[a]=!0,r.getRelatedEdges(a,"out").forEach(s=>{e[s.target]?t.push(s):i(s.target)}),delete e[a])};return r.getAllNodes().forEach(a=>i(a.id)),t},PP=r=>{r.getAllEdges().forEach(t=>{const e=t.data;if(e.reversed){r.removeEdge(t.id);const n=e.forwardName;delete e.reversed,delete e.forwardName,r.addEdge({id:t.id,source:t.target,target:t.source,data:Object.assign(Object.assign({},e),{forwardName:n})})}})},RP=(r,t)=>Number(r)-Number(t),Mo=(r,t,e,n)=>{let i;do i=`${n}${Math.random()}`;while(r.hasNode(i));return e.dummy=t,r.addNode({id:i,data:e}),i},LP=r=>{const t=new Un;return r.getAllNodes().forEach(e=>{t.addNode(Object.assign({},e))}),r.getAllEdges().forEach(e=>{const n=t.getRelatedEdges(e.source,"out").find(i=>i.target===e.target);n?t.updateEdgeData(n==null?void 0:n.id,Object.assign(Object.assign({},n.data),{weight:n.data.weight+e.data.weight||0,minlen:Math.max(n.data.minlen,e.data.minlen||1)})):t.addEdge({id:e.id,source:e.source,target:e.target,data:{weight:e.data.weight||0,minlen:e.data.minlen||1}})}),t},Z1=r=>{const t=new Un;return r.getAllNodes().forEach(e=>{r.getChildren(e.id).length||t.addNode(Object.assign({},e))}),r.getAllEdges().forEach(e=>{t.addEdge(e)}),t},V1=(r,t)=>r==null?void 0:r.reduce((e,n,i)=>(e[n]=t[i],e),{}),C7=r=>{const t={};return r.getAllNodes().forEach(e=>{const n={};r.getRelatedEdges(e.id,"out").forEach(i=>{n[i.target]=(n[i.target]||0)+(i.data.weight||0)}),t[e.id]=n}),t},N7=r=>{const t=r.getAllNodes(),e=t.map(n=>{const i={};return r.getRelatedEdges(n.id,"in").forEach(a=>{i[a.source]=(i[a.source]||0)+a.data.weight}),i});return V1(t.map(n=>n.id),e)},U1=(r,t)=>{const e=Number(r.x),n=Number(r.y),i=Number(t.x)-e,a=Number(t.y)-n;let s=Number(r.width)/2,o=Number(r.height)/2;if(!i&&!a)return{x:0,y:0};let l,c;return Math.abs(a)*s>Math.abs(i)*o?(a<0&&(o=-o),l=o*i/a,c=o):(i<0&&(s=-s),l=s,c=s*a/i),{x:e+l,y:n+c}},Il=r=>{const t=[],e=H1(r)+1;for(let n=0;n<e;n++)t.push([]);r.getAllNodes().forEach(n=>{const i=n.data.rank;i!==void 0&&t[i]&&t[i].push(n.id)});for(let n=0;n<e;n++)t[n]=t[n].sort((i,a)=>RP(r.getNode(i).data.order,r.getNode(a).data.order));return t},_P=r=>{const t=r.getAllNodes().filter(n=>n.data.rank!==void 0).map(n=>n.data.rank),e=Math.min(...t);r.getAllNodes().forEach(n=>{n.data.hasOwnProperty("rank")&&e!==1/0&&(n.data.rank-=e)})},DP=(r,t=0)=>{const e=r.getAllNodes(),n=e.filter(o=>o.data.rank!==void 0).map(o=>o.data.rank),i=Math.min(...n),a=[];e.forEach(o=>{const l=(o.data.rank||0)-i;a[l]||(a[l]=[]),a[l].push(o.id)});let s=0;for(let o=0;o<a.length;o++){const l=a[o];l===void 0?o%t!==0&&(s-=1):s&&(l==null||l.forEach(c=>{const u=r.getNode(c);u&&(u.data.rank=u.data.rank||0,u.data.rank+=s)}))}},Y1=(r,t,e,n)=>{const i={width:0,height:0};return ie(e)&&ie(n)&&(i.rank=e,i.order=n),Mo(r,"border",i,t)},H1=r=>{let t;return r.getAllNodes().forEach(e=>{const n=e.data.rank;n!==void 0&&(t===void 0||n>t)&&(t=n)}),t||(t=0),t},IP=(r,t)=>{const e={lhs:[],rhs:[]};return r==null||r.forEach(n=>{t(n)?e.lhs.push(n):e.rhs.push(n)}),e},Ov=(r,t)=>r.reduce((e,n)=>{const i=t(e),a=t(n);return i>a?n:e}),X1=(r,t,e,n,i,a)=>{n.includes(t.id)||(n.push(t.id),e||a.push(t.id),i(t.id).forEach(s=>X1(r,s,e,n,i,a)),e&&a.push(t.id))},K1=(r,t,e,n)=>{const i=Array.isArray(t)?t:[t],a=l=>n?r.getSuccessors(l):r.getNeighbors(l),s=[],o=[];return i.forEach(l=>{if(r.hasNode(l.id))X1(r,l,e==="post",o,a,s);else throw new Error(`Graph does not have node: ${l}`)}),s},BP=r=>{const t=e=>{const n=r.getChildren(e),i=r.getNode(e);if(n!=null&&n.length&&n.forEach(a=>t(a.id)),i.data.hasOwnProperty("minRank")){i.data.borderLeft=[],i.data.borderRight=[];for(let a=i.data.minRank,s=i.data.maxRank+1;a<s;a+=1)Q1(r,"borderLeft","_bl",e,i,a),Q1(r,"borderRight","_br",e,i,a)}};r.getRoots().forEach(e=>t(e.id))},Q1=(r,t,e,n,i,a)=>{const s={rank:a,borderType:t,width:0,height:0},o=i.data[t][a-1],l=Mo(r,"border",s,e);i.data[t][a]=l,r.setParent(l,n),o&&r.addEdge({id:`e${Math.random()}`,source:o,target:l,data:{weight:1}})},FP=(r,t)=>{const e=t.toLowerCase();(e==="lr"||e==="rl")&&q1(r)},zP=(r,t)=>{const e=t.toLowerCase();(e==="bt"||e==="rl")&&jP(r),(e==="lr"||e==="rl")&&(GP(r),q1(r))},q1=r=>{r.getAllNodes().forEach(t=>{J1(t)}),r.getAllEdges().forEach(t=>{J1(t)})},J1=r=>{const t=r.data.width;r.data.width=r.data.height,r.data.height=t},jP=r=>{r.getAllNodes().forEach(t=>{Cv(t.data)}),r.getAllEdges().forEach(t=>{var e;(e=t.data.points)===null||e===void 0||e.forEach(n=>Cv(n)),t.data.hasOwnProperty("y")&&Cv(t.data)})},Cv=r=>{r!=null&&r.y&&(r.y=-r.y)},GP=r=>{r.getAllNodes().forEach(t=>{Nv(t.data)}),r.getAllEdges().forEach(t=>{var e;(e=t.data.points)===null||e===void 0||e.forEach(n=>Nv(n)),t.data.hasOwnProperty("x")&&Nv(t.data)})},Nv=r=>{const t=r.x;r.x=r.y,r.y=t},WP=r=>{const t=Mo(r,"root",{},"_root"),e=ZP(r);let n=Math.max(...Object.values(e));Math.abs(n)===1/0&&(n=1);const i=n-1,a=2*i+1;r.getAllEdges().forEach(o=>{o.data.minlen*=a});const s=VP(r)+1;return r.getRoots().forEach(o=>{$1(r,t,a,s,i,e,o.id)}),{nestingRoot:t,nodeRankFactor:a}},$1=(r,t,e,n,i,a,s)=>{const o=r.getChildren(s);if(!(o!=null&&o.length)){s!==t&&r.addEdge({id:`e${Math.random()}`,source:t,target:s,data:{weight:0,minlen:e}});return}const l=Y1(r,"_bt"),c=Y1(r,"_bb"),u=r.getNode(s);r.setParent(l,s),u.data.borderTop=l,r.setParent(c,s),u.data.borderBottom=c,o==null||o.forEach(h=>{$1(r,t,e,n,i,a,h.id);const d=h.data.borderTop?h.data.borderTop:h.id,f=h.data.borderBottom?h.data.borderBottom:h.id,v=h.data.borderTop?n:2*n,g=d!==f?1:i-a[s]+1;r.addEdge({id:`e${Math.random()}`,source:l,target:d,data:{minlen:g,weight:v,nestingEdge:!0}}),r.addEdge({id:`e${Math.random()}`,source:f,target:c,data:{minlen:g,weight:v,nestingEdge:!0}})}),r.getParent(s)||r.addEdge({id:`e${Math.random()}`,source:t,target:l,data:{weight:0,minlen:i+a[s]}})},ZP=r=>{const t={},e=(n,i)=>{const a=r.getChildren(n);a==null||a.forEach(s=>e(s.id,i+1)),t[n]=i};return r.getRoots().forEach(n=>e(n.id,1)),t},VP=r=>{let t=0;return r.getAllEdges().forEach(e=>{t+=e.data.weight}),t},UP=(r,t)=>{t&&r.removeNode(t),r.getAllEdges().forEach(e=>{e.data.nestingEdge&&r.removeEdge(e.id)})},YP="edge",tb="edge-label",HP=(r,t)=>{r.getAllEdges().forEach(e=>XP(r,e,t))},XP=(r,t,e)=>{let n=t.source,i=r.getNode(n).data.rank;const a=t.target,s=r.getNode(a).data.rank,o=t.data.labelRank;if(s===i+1)return;r.removeEdge(t.id);let l,c,u;for(u=0,++i;i<s;++u,++i)t.data.points=[],c={originalEdge:t,width:0,height:0,rank:i},l=Mo(r,YP,c,"_d"),i===o&&(c.width=t.data.width,c.height=t.data.height,c.dummy=tb,c.labelpos=t.data.labelpos),r.addEdge({id:`e${Math.random()}`,source:n,target:l,data:{weight:t.data.weight}}),u===0&&e.push(l),n=l;r.addEdge({id:`e${Math.random()}`,source:n,target:a,data:{weight:t.data.weight}})},KP=(r,t)=>{t.forEach(e=>{let n=r.getNode(e);const{data:i}=n,a=i.originalEdge;let s;a&&r.addEdge(a);let o=e;for(;n.data.dummy;)s=r.getSuccessors(o)[0],r.removeNode(o),a.data.points.push({x:n.data.x,y:n.data.y}),n.data.dummy===tb&&(a.data.x=n.data.x,a.data.y=n.data.y,a.data.width=n.data.width,a.data.height=n.data.height),o=s.id,n=r.getNode(o)})},QP=(r,t,e)=>{const n={};let i;e==null||e.forEach(a=>{let s=r.getParent(a),o,l;for(;s;){if(o=r.getParent(s.id),o?(l=n[o.id],n[o.id]=s.id):(l=i,i=s.id),l&&l!==s.id){t.hasNode(l)||t.addNode({id:l,data:{}}),t.hasNode(s.id)||t.addNode({id:s.id,data:{}}),t.hasEdge(`e${l}-${s.id}`)||t.addEdge({id:`e${l}-${s.id}`,source:l,target:s.id,data:{}});return}s=o}})},qP=(r,t,e)=>{const n=JP(r),i=new Un({tree:[{id:n,children:[],data:{}}]});return r.getAllNodes().forEach(a=>{const s=r.getParent(a.id);(a.data.rank===t||a.data.minRank<=t&&t<=a.data.maxRank)&&(i.hasNode(a.id)||i.addNode(Object.assign({},a)),s!=null&&s.id&&!i.hasNode(s==null?void 0:s.id)&&i.addNode(Object.assign({},s)),i.setParent(a.id,(s==null?void 0:s.id)||n),r.getRelatedEdges(a.id,e).forEach(o=>{const l=o.source===a.id?o.target:o.source;i.hasNode(l)||i.addNode(Object.assign({},r.getNode(l)));const c=i.getRelatedEdges(l,"out").find(({target:h})=>h===a.id),u=c!==void 0?c.data.weight:0;c?i.updateEdgeData(c.id,Object.assign(Object.assign({},c.data),{weight:o.data.weight+u})):i.addEdge({id:o.id,source:l,target:a.id,data:{weight:o.data.weight+u}})}),a.data.hasOwnProperty("minRank")&&i.updateNodeData(a.id,Object.assign(Object.assign({},a.data),{borderLeft:a.data.borderLeft[t],borderRight:a.data.borderRight[t]})))}),i},JP=r=>{let t;for(;r.hasNode(t=`_root${Math.random()}`););return t},$P=(r,t,e)=>{const n=V1(e,e.map((u,h)=>h)),a=t.map(u=>{const h=r.getRelatedEdges(u,"out").map(d=>({pos:n[d.target]||0,weight:d.data.weight}));return h==null?void 0:h.sort((d,f)=>d.pos-f.pos)}).flat().filter(u=>u!==void 0);let s=1;for(;s<e.length;)s<<=1;const o=2*s-1;s-=1;const l=Array(o).fill(0,0,o);let c=0;return a==null||a.forEach(u=>{if(u){let h=u.pos+s;l[h]+=u.weight;let d=0;for(;h>0;)h%2&&(d+=l[h+1]),h=h-1>>1,l[h]+=u.weight;c+=u.weight*d}}),c},eb=(r,t)=>{let e=0;for(let n=1;n<(t==null?void 0:t.length);n+=1)e+=$P(r,t[n-1],t[n]);return e},nb=r=>{const t={},e=r.getAllNodes(),n=e.map(c=>{var u;return(u=c.data.rank)!==null&&u!==void 0?u:-1/0}),i=Math.max(...n),a=[];for(let c=0;c<i+1;c++)a.push([]);const s=e.sort((c,u)=>r.getNode(c.id).data.rank-r.getNode(u.id).data.rank),l=s.filter(c=>r.getNode(c.id).data.fixorder!==void 0).sort((c,u)=>r.getNode(c.id).data.fixorder-r.getNode(u.id).data.fixorder);return l==null||l.forEach(c=>{isNaN(r.getNode(c.id).data.rank)||a[r.getNode(c.id).data.rank].push(c.id),t[c.id]=!0}),s==null||s.forEach(c=>r.dfsTree(c.id,u=>{if(t.hasOwnProperty(u.id))return!0;t[u.id]=!0,isNaN(u.data.rank)||a[u.data.rank].push(u.id)})),a},tR=(r,t)=>t.map(e=>{const n=r.getRelatedEdges(e,"in");if(!(n!=null&&n.length))return{v:e};const i={sum:0,weight:0};return n==null||n.forEach(a=>{const s=r.getNode(a.source);i.sum+=a.data.weight*s.data.order,i.weight+=a.data.weight}),{v:e,barycenter:i.sum/i.weight,weight:i.weight}}),eR=(r,t)=>{var e,n,i;const a={};r==null||r.forEach((o,l)=>{a[o.v]={i:l,indegree:0,in:[],out:[],vs:[o.v]};const c=a[o.v];o.barycenter!==void 0&&(c.barycenter=o.barycenter,c.weight=o.weight)}),(e=t.getAllEdges())===null||e===void 0||e.forEach(o=>{const l=a[o.source],c=a[o.target];l!==void 0&&c!==void 0&&(c.indegree++,l.out.push(a[o.target]))});const s=(i=(n=Object.values(a)).filter)===null||i===void 0?void 0:i.call(n,o=>!o.indegree);return nR(s)},nR=r=>{var t,e;const n=[],i=l=>c=>{c.merged||(c.barycenter===void 0||l.barycenter===void 0||c.barycenter>=l.barycenter)&&rR(l,c)},a=l=>c=>{c.in.push(l),--c.indegree===0&&r.push(c)};for(;r!=null&&r.length;){const l=r.pop();n.push(l),(t=l.in.reverse())===null||t===void 0||t.forEach(c=>i(l)(c)),(e=l.out)===null||e===void 0||e.forEach(c=>a(l)(c))}const s=n.filter(l=>!l.merged),o=["vs","i","barycenter","weight"];return s.map(l=>{const c={};return o==null||o.forEach(u=>{l[u]!==void 0&&(c[u]=l[u])}),c})},rR=(r,t)=>{var e;let n=0,i=0;r.weight&&(n+=r.barycenter*r.weight,i+=r.weight),t.weight&&(n+=t.barycenter*t.weight,i+=t.weight),r.vs=(e=t.vs)===null||e===void 0?void 0:e.concat(r.vs),r.barycenter=n/i,r.weight=i,r.i=Math.min(t.i,r.i),t.merged=!0};var iR=eR;const aR=(r,t,e,n)=>{const i=IP(r,d=>{const f=d.hasOwnProperty("fixorder")&&!isNaN(d.fixorder);return n?!f&&d.hasOwnProperty("barycenter"):f||d.hasOwnProperty("barycenter")}),a=i.lhs,s=i.rhs.sort((d,f)=>-d.i- -f.i),o=[];let l=0,c=0,u=0;a==null||a.sort(sR(!!t,!!e)),u=rb(o,s,u),a==null||a.forEach(d=>{var f;u+=(f=d.vs)===null||f===void 0?void 0:f.length,o.push(d.vs),l+=d.barycenter*d.weight,c+=d.weight,u=rb(o,s,u)});const h={vs:o.flat()};return c&&(h.barycenter=l/c,h.weight=c),h},rb=(r,t,e)=>{let n=e,i;for(;t.length&&(i=t[t.length-1]).i<=n;)t.pop(),r==null||r.push(i.vs),n++;return n},sR=(r,t)=>(e,n)=>{if(e.fixorder!==void 0&&n.fixorder!==void 0)return e.fixorder-n.fixorder;if(e.barycenter<n.barycenter)return-1;if(e.barycenter>n.barycenter)return 1;if(t&&e.order!==void 0&&n.order!==void 0){if(e.order<n.order)return-1;if(e.order>n.order)return 1}return r?n.i-e.i:e.i-n.i},ib=(r,t,e,n,i,a)=>{var s,o,l,c;let u=r.getChildren(t).map(b=>b.id);const h=r.getNode(t),d=h?h.data.borderLeft:void 0,f=h?h.data.borderRight:void 0,v={};d&&(u=u==null?void 0:u.filter(b=>b!==d&&b!==f));const g=tR(r,u||[]);g==null||g.forEach(b=>{var E;if(!((E=r.getChildren(b.v))===null||E===void 0)&&E.length){const O=ib(r,b.v,e,n,a);v[b.v]=O,O.hasOwnProperty("barycenter")&&lR(b,O)}});const p=iR(g,e);oR(p,v),(s=p.filter(b=>b.vs.length>0))===null||s===void 0||s.forEach(b=>{const E=r.getNode(b.vs[0]);E&&(b.fixorder=E.data.fixorder,b.order=E.data.order)});const y=aR(p,n,i,a);if(d&&(y.vs=[d,y.vs,f].flat(),!((o=r.getPredecessors(d))===null||o===void 0)&&o.length)){const b=r.getNode(((l=r.getPredecessors(d))===null||l===void 0?void 0:l[0].id)||""),E=r.getNode(((c=r.getPredecessors(f))===null||c===void 0?void 0:c[0].id)||"");y.hasOwnProperty("barycenter")||(y.barycenter=0,y.weight=0),y.barycenter=(y.barycenter*y.weight+b.data.order+E.data.order)/(y.weight+2),y.weight+=2}return y},oR=(r,t)=>{r==null||r.forEach(e=>{var n;const i=(n=e.vs)===null||n===void 0?void 0:n.map(a=>t[a]?t[a].vs:a);e.vs=i.flat()})},lR=(r,t)=>{r.barycenter!==void 0?(r.barycenter=(r.barycenter*r.weight+t.barycenter*t.weight)/(r.weight+t.weight),r.weight+=t.weight):(r.barycenter=t.barycenter,r.weight=t.weight)},cR=(r,t)=>{const e=H1(r),n=[],i=[];for(let u=1;u<e+1;u++)n.push(u);for(let u=e-1;u>-1;u--)i.push(u);const a=ab(r,n,"in"),s=ab(r,i,"out");let o=nb(r);kv(r,o);let l=Number.POSITIVE_INFINITY,c;for(let u=0,h=0;h<4;++u,++h){sb(u%2?a:s,u%4>=2,!1,t),o=Il(r);const d=eb(r,o);d<l&&(h=0,c=mo(o),l=d)}o=nb(r),kv(r,o);for(let u=0,h=0;h<4;++u,++h){sb(u%2?a:s,u%4>=2,!0,t),o=Il(r);const d=eb(r,o);d<l&&(h=0,c=mo(o),l=d)}kv(r,c)},ab=(r,t,e)=>t.map(n=>qP(r,n,e)),sb=(r,t,e,n)=>{const i=new Un;r==null||r.forEach(a=>{var s;const o=a.getRoots()[0].id,l=ib(a,o,i,t,e,n);for(let c=0;c<((s=l.vs)===null||s===void 0?void 0:s.length);c++){const u=a.getNode(l.vs[c]);u&&(u.data.order=c)}QP(a,i,l.vs)})},kv=(r,t)=>{t==null||t.forEach(e=>{e==null||e.forEach((n,i)=>{r.getNode(n).data.order=i})})},uR=(r,t)=>{const n=r.getAllNodes().filter(s=>{var o;return!(!((o=r.getChildren(s.id))===null||o===void 0)&&o.length)}).map(s=>s.data.rank),i=Math.max(...n),a=[];for(let s=0;s<i+1;s++)a[s]=[];t==null||t.forEach(s=>{const o=r.getNode(s);!o||o.data.dummy||isNaN(o.data.rank)||(o.data.fixorder=a[o.data.rank].length,a[o.data.rank].push(s))})},hR=r=>{const t={};let e=0;const n=i=>{const a=e;r.getChildren(i).forEach(s=>n(s.id)),t[i]={low:a,lim:e++}};return r.getRoots().forEach(i=>n(i.id)),t},dR=(r,t,e,n)=>{var i,a;const s=[],o=[],l=Math.min(t[e].low,t[n].low),c=Math.max(t[e].lim,t[n].lim);let u,h;u=e;do u=(i=r.getParent(u))===null||i===void 0?void 0:i.id,s.push(u);while(u&&(t[u].low>l||c>t[u].lim));for(h=u,u=n;u&&u!==h;)o.push(u),u=(a=r.getParent(u))===null||a===void 0?void 0:a.id;return{lca:h,path:s.concat(o.reverse())}},fR=(r,t)=>{const e=hR(r);t.forEach(n=>{var i,a;let s=n,o=r.getNode(s);const l=o.data.originalEdge;if(!l)return;const c=dR(r,e,l.source,l.target),u=c.path,h=c.lca;let d=0,f=u[d],v=!0;for(;s!==l.target;){if(o=r.getNode(s),v){for(;f!==h&&((i=r.getNode(f))===null||i===void 0?void 0:i.data.maxRank)<o.data.rank;)d++,f=u[d];f===h&&(v=!1)}if(!v){for(;d<u.length-1&&((a=r.getNode(u[d+1]))===null||a===void 0?void 0:a.data.minRank)<=o.data.rank;)d++;f=u[d]}r.hasNode(f)&&r.setParent(s,f),s=r.getSuccessors(s)[0].id}})},ob=(r,t)=>{const e={},n=(i,a)=>{let s=0,o=0;const l=i.length,c=a==null?void 0:a[(a==null?void 0:a.length)-1];return a==null||a.forEach((u,h)=>{var d;const f=vR(r,u),v=f?r.getNode(f.id).data.order:l;(f||u===c)&&((d=a.slice(o,h+1))===null||d===void 0||d.forEach(g=>{var p;(p=r.getPredecessors(g))===null||p===void 0||p.forEach(y=>{var b;const E=r.getNode(y.id),O=E.data.order;(O<s||v<O)&&!(E.data.dummy&&(!((b=r.getNode(g))===null||b===void 0)&&b.data.dummy))&&cb(e,y.id,g)})}),o=h+1,s=v)}),a};return t!=null&&t.length&&t.reduce(n),e},lb=(r,t)=>{const e={};function n(o,l,c,u,h){var d,f;let v;for(let g=l;g<c;g++)v=o[g],!((d=r.getNode(v))===null||d===void 0)&&d.data.dummy&&((f=r.getPredecessors(v))===null||f===void 0||f.forEach(p=>{const y=r.getNode(p.id);y.data.dummy&&(y.data.order<u||y.data.order>h)&&cb(e,p.id,v)}))}function i(o){return JSON.stringify(o.slice(1))}function a(o,l){const c=i(o);l.get(c)||(n(...o),l.set(c,!0))}const s=(o,l)=>{let c=-1,u,h=0;const d=new Map;return l==null||l.forEach((f,v)=>{var g;if(((g=r.getNode(f))===null||g===void 0?void 0:g.data.dummy)==="border"){const p=r.getPredecessors(f)||[];p.length&&(u=r.getNode(p[0].id).data.order,a([l,h,v,c,u],d),h=v,c=u)}a([l,h,l.length,u,o.length],d)}),l};return t!=null&&t.length&&t.reduce(s),e},vR=(r,t)=>{var e,n;if(!((e=r.getNode(t))===null||e===void 0)&&e.data.dummy)return(n=r.getPredecessors(t))===null||n===void 0?void 0:n.find(i=>r.getNode(i.id).data.dummy)},cb=(r,t,e)=>{let n=t,i=e;if(n>i){const s=n;n=i,i=s}let a=r[n];a||(r[n]=a={}),a[i]=!0},gR=(r,t,e)=>{let n=t,i=e;if(n>i){const a=t;n=i,i=a}return!!r[n]},ub=(r,t,e,n)=>{const i={},a={},s={};return t==null||t.forEach(o=>{o==null||o.forEach((l,c)=>{i[l]=l,a[l]=l,s[l]=c})}),t==null||t.forEach(o=>{let l=-1;o==null||o.forEach(c=>{let u=n(c).map(h=>h.id);if(u.length){u=u.sort((d,f)=>s[d]-s[f]);const h=(u.length-1)/2;for(let d=Math.floor(h),f=Math.ceil(h);d<=f;++d){const v=u[d];a[c]===c&&l<s[v]&&!gR(e,c,v)&&(a[v]=c,a[c]=i[c]=i[v],l=s[v])}}})}),{root:i,align:a}},hb=(r,t,e,n,i,a,s)=>{var o;const l={},c=pR(r,t,e,i,a,s),u=s?"borderLeft":"borderRight",h=(v,g)=>{let p=c.getAllNodes(),y=p.pop();const b={};for(;y;)b[y.id]?v(y.id):(b[y.id]=!0,p.push(y),p=p.concat(g(y.id))),y=p.pop()},d=v=>{l[v]=(c.getRelatedEdges(v,"in")||[]).reduce((g,p)=>Math.max(g,(l[p.source]||0)+p.data.weight),0)},f=v=>{const g=(c.getRelatedEdges(v,"out")||[]).reduce((y,b)=>Math.min(y,(l[b.target]||0)-b.data.weight),Number.POSITIVE_INFINITY),p=r.getNode(v);g!==Number.POSITIVE_INFINITY&&p.data.borderType!==u&&(l[v]=Math.max(l[v],g))};return h(d,c.getPredecessors.bind(c)),h(f,c.getSuccessors.bind(c)),(o=Object.values(n))===null||o===void 0||o.forEach(v=>{l[v]=l[e[v]]}),l},pR=(r,t,e,n,i,a)=>{const s=new Un,o=mR(n,i,a);return t==null||t.forEach(l=>{let c;l==null||l.forEach(u=>{const h=e[u];if(s.hasNode(h)||s.addNode({id:h,data:{}}),c){const d=e[c],f=s.getRelatedEdges(d,"out").find(v=>v.target===h);f?s.updateEdgeData(f.id,Object.assign(Object.assign({},f.data),{weight:Math.max(o(r,u,c),f.data.weight||0)})):s.addEdge({id:`e${Math.random()}`,source:d,target:h,data:{weight:Math.max(o(r,u,c),0)}})}c=u})}),s},db=(r,t)=>Ov(Object.values(t),e=>{var n;let i=Number.NEGATIVE_INFINITY,a=Number.POSITIVE_INFINITY;return(n=Object.keys(e))===null||n===void 0||n.forEach(s=>{const o=e[s],l=yR(r,s)/2;i=Math.max(o+l,i),a=Math.min(o-l,a)}),i-a});function fb(r,t){const e=Object.values(t),n=Math.min(...e),i=Math.max(...e);["u","d"].forEach(a=>{["l","r"].forEach(s=>{const o=a+s,l=r[o];let c;if(l===t)return;const u=Object.values(l);c=s==="l"?n-Math.min(...u):i-Math.max(...u),c&&(r[o]={},Object.keys(l).forEach(h=>{r[o][h]=l[h]+c}))})})}const vb=(r,t)=>{const e={};return Object.keys(r.ul).forEach(n=>{if(t)e[n]=r[t.toLowerCase()][n];else{const i=Object.values(r).map(a=>a[n]);e[n]=(i[0]+i[1])/2}}),e},k7=(r,t)=>{const{align:e,nodesep:n=0,edgesep:i=0}=t||{},a=buildLayerMatrix(r),s=Object.assign(ob(r,a),lb(r,a)),o={};let l;["u","d"].forEach(u=>{l=u==="u"?a:Object.values(a).reverse(),["l","r"].forEach(h=>{h==="r"&&(l=l.map(g=>Object.values(g).reverse()));const d=(u==="u"?r.getPredecessors:r.getSuccessors).bind(r),f=ub(r,l,s,d),v=hb(r,l,f.root,f.align,n,i,h==="r");h==="r"&&Object.keys(v).forEach(g=>{v[g]=-v[g]}),o[u+h]=v})});const c=db(r,o);return fb(o,c),vb(o,e)},mR=(r,t,e)=>(n,i,a)=>{const s=n.getNode(i),o=n.getNode(a);let l=0,c=0;if(l+=s.data.width/2,s.data.hasOwnProperty("labelpos"))switch((s.data.labelpos||"").toLowerCase()){case"l":c=-s.data.width/2;break;case"r":c=s.data.width/2;break}if(c&&(l+=e?c:-c),c=0,l+=(s.data.dummy?t:r)/2,l+=(o.data.dummy?t:r)/2,l+=o.data.width/2,o.data.labelpos)switch((o.data.labelpos||"").toLowerCase()){case"l":c=o.data.width/2;break;case"r":c=-o.data.width/2;break}return c&&(l+=e?c:-c),c=0,l},yR=(r,t)=>r.getNode(t).data.width||0,bR=(r,t)=>{const{ranksep:e=0}=t||{},n=Il(r);let i=0;n==null||n.forEach(a=>{const s=a.map(l=>r.getNode(l).data.height),o=Math.max(...s,0);a==null||a.forEach(l=>{r.getNode(l).data.y=i+o/2}),i+=o+e})},xR=(r,t)=>{const{align:e,nodesep:n=0,edgesep:i=0}=t||{},a=Il(r),s=Object.assign(ob(r,a),lb(r,a)),o={};let l=[];["u","d"].forEach(u=>{l=u==="u"?a:Object.values(a).reverse(),["l","r"].forEach(h=>{h==="r"&&(l=l.map(g=>Object.values(g).reverse()));const d=(u==="u"?r.getPredecessors:r.getSuccessors).bind(r),f=ub(r,l,s,d),v=hb(r,l,f.root,f.align,n,i,h==="r");h==="r"&&Object.keys(v).forEach(g=>v[g]=-v[g]),o[u+h]=v})});const c=db(r,o);return c&&fb(o,c),vb(o,e)},ER=(r,t)=>{var e;const n=Z1(r);bR(n,t);const i=xR(n,t);(e=Object.keys(i))===null||e===void 0||e.forEach(a=>{n.getNode(a).data.x=i[a]})},gb=r=>{const t={},e=n=>{var i;const a=r.getNode(n);if(!a)return 0;if(t[n])return a.data.rank;t[n]=!0;let s;return(i=r.getRelatedEdges(n,"out"))===null||i===void 0||i.forEach(o=>{const l=e(o.target),c=o.data.minlen,u=l-c;u&&(s===void 0||u<s)&&(s=u)}),s||(s=0),a.data.rank=s,s};r.getAllNodes().filter(n=>r.getRelatedEdges(n.id,"in").length===0).forEach(n=>e(n.id))},wR=r=>{const t={};let e;const n=s=>{var o;const l=r.getNode(s);if(!l)return 0;if(t[s])return l.data.rank;t[s]=!0;let c;return(o=r.getRelatedEdges(s,"out"))===null||o===void 0||o.forEach(u=>{const h=n(u.target),d=u.data.minlen,f=h-d;f&&(c===void 0||f<c)&&(c=f)}),c||(c=0),(e===void 0||c<e)&&(e=c),l.data.rank=c,c};r.getAllNodes().filter(s=>r.getRelatedEdges(s.id,"in").length===0).forEach(s=>{s&&n(s.id)}),e===void 0&&(e=0);const i={},a=(s,o)=>{var l;const c=r.getNode(s),u=isNaN(c.data.layer)?o:c.data.layer;(c.data.rank===void 0||c.data.rank<u)&&(c.data.rank=u),!i[s]&&(i[s]=!0,(l=r.getRelatedEdges(s,"out"))===null||l===void 0||l.forEach(h=>{a(h.target,u+h.data.minlen)}))};r.getAllNodes().forEach(s=>{const o=s.data;o&&(isNaN(o.layer)?o.rank-=e:a(s.id,o.layer))})},qa=(r,t)=>r.getNode(t.target).data.rank-r.getNode(t.source).data.rank-t.data.minlen,SR=r=>{const t=new Un({tree:[]}),e=r.getAllNodes()[0],n=r.getAllNodes().length;t.addNode(e);let i,a;for(;MR(t,r)<n;)i=pb(t,r),a=t.hasNode(i.source)?qa(r,i):-qa(r,i),mb(t,r,a);return t},MR=(r,t)=>{const e=n=>{t.getRelatedEdges(n,"both").forEach(i=>{const a=i.source,s=n===a?i.target:a;!r.hasNode(s)&&!qa(t,i)&&(r.addNode({id:s,data:{}}),r.addEdge({id:i.id,source:n,target:s,data:{}}),e(s))})};return r.getAllNodes().forEach(n=>e(n.id)),r.getAllNodes().length},AR=r=>{const t=new Un({tree:[]}),e=r.getAllNodes()[0],n=r.getAllNodes().length;t.addNode(e);let i,a;for(;TR(t,r)<n;)i=pb(t,r),a=t.hasNode(i.source)?qa(r,i):-qa(r,i),mb(t,r,a);return t},TR=(r,t)=>{const e=n=>{var i;(i=t.getRelatedEdges(n,"both"))===null||i===void 0||i.forEach(a=>{const s=a.source,o=n===s?a.target:s;!r.hasNode(o)&&(t.getNode(o).data.layer!==void 0||!qa(t,a))&&(r.addNode({id:o,data:{}}),r.addEdge({id:a.id,source:n,target:o,data:{}}),e(o))})};return r.getAllNodes().forEach(n=>e(n.id)),r.getAllNodes().length},pb=(r,t)=>Ov(t.getAllEdges(),e=>r.hasNode(e.source)!==r.hasNode(e.target)?qa(t,e):1/0),mb=(r,t,e)=>{r.getAllNodes().forEach(n=>{const i=t.getNode(n.id);i.data.rank||(i.data.rank=0),i.data.rank+=e})},OR=r=>{const t=LP(r);gb(t);const e=SR(t);bb(e),yb(e,t);let n,i;for(;n=kR(e);)i=PR(e,t,n),RR(e,t,n,i)},yb=(r,t)=>{let e=K1(r,r.getAllNodes(),"post",!1);e=e.slice(0,(e==null?void 0:e.length)-1),e.forEach(n=>{CR(r,t,n)})},CR=(r,t,e)=>{const i=r.getNode(e).data.parent,a=r.getRelatedEdges(e,"both").find(s=>s.target===i||s.source===i);a.data.cutvalue=NR(r,t,e)},NR=(r,t,e)=>{const i=r.getNode(e).data.parent;let a=!0,s=t.getRelatedEdges(e,"out").find(l=>l.target===i),o=0;return s||(a=!1,s=t.getRelatedEdges(i,"out").find(l=>l.target===e)),o=s.data.weight,t.getRelatedEdges(e,"both").forEach(l=>{const c=l.source===e,u=c?l.target:l.source;if(u!==i){const h=c===a,d=l.data.weight;if(o+=h?d:-d,_R(r,e,u)){const f=r.getRelatedEdges(e,"both").find(v=>v.source===u||v.target===u).data.cutvalue;o+=h?-f:f}}}),o},bb=(r,t=r.getAllNodes()[0].id)=>{xb(r,{},1,t)},xb=(r,t,e,n,i)=>{var a;const s=e;let o=e;const l=r.getNode(n);return t[n]=!0,(a=r.getNeighbors(n))===null||a===void 0||a.forEach(c=>{t[c.id]||(o=xb(r,t,o,c.id,n))}),l.data.low=s,l.data.lim=o++,i?l.data.parent=i:delete l.data.parent,o},kR=r=>r.getAllEdges().find(t=>t.data.cutvalue<0),PR=(r,t,e)=>{let n=e.source,i=e.target;t.getRelatedEdges(n,"out").find(u=>u.target===i)||(n=e.target,i=e.source);const a=r.getNode(n),s=r.getNode(i);let o=a,l=!1;a.data.lim>s.data.lim&&(o=s,l=!0);const c=t.getAllEdges().filter(u=>l===Eb(r.getNode(u.source),o)&&l!==Eb(r.getNode(u.target),o));return Ov(c,u=>qa(t,u))},RR=(r,t,e,n)=>{const i=r.getRelatedEdges(e.source,"both").find(a=>a.source===e.target||a.target===e.target);i&&r.removeEdge(i.id),r.addEdge({id:`e${Math.random()}`,source:n.source,target:n.target,data:{}}),bb(r),yb(r,t),LR(r,t)},LR=(r,t)=>{const e=r.getAllNodes().find(i=>!i.data.parent);let n=K1(r,e,"pre",!1);n=n.slice(1),n.forEach(i=>{const a=r.getNode(i).data.parent;let s=t.getRelatedEdges(i,"out").find(l=>l.target===a),o=!1;!s&&t.hasNode(a)&&(s=t.getRelatedEdges(a,"out").find(l=>l.target===i),o=!0),t.getNode(i).data.rank=(t.hasNode(a)&&t.getNode(a).data.rank||0)+(o?s==null?void 0:s.data.minlen:-(s==null?void 0:s.data.minlen))})},_R=(r,t,e)=>r.getRelatedEdges(t,"both").find(n=>n.source===e||n.target===e),Eb=(r,t)=>t.data.low<=r.data.lim&&r.data.lim<=t.data.lim,DR=(r,t)=>{switch(t){case"network-simplex":BR(r);break;case"tight-tree":wb(r);break;case"longest-path":IR(r);break;default:wb(r)}},IR=gb,wb=r=>{wR(r),AR(r)},BR=r=>{OR(r)},FR=(r,t)=>{const{edgeLabelSpace:e,keepNodeOrder:n,prevGraph:i,rankdir:a,ranksep:s}=t;!n&&i&&jR(r,i);const o=YR(r);e&&(t.ranksep=HR(o,{rankdir:a,ranksep:s}));let l;try{l=zR(o,t)}catch(c){if(c.message==="Not possible to find intersection inside of the rectangle"){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:
|
|
|
`,c);return}throw c}return GR(r,o),l},zR=(r,t)=>{const{acyclicer:e,ranker:n,rankdir:i="tb",nodeOrder:a,keepNodeOrder:s,align:o,nodesep:l=50,edgesep:c=20,ranksep:u=50}=t;nL(r),NP(r,e);const{nestingRoot:h,nodeRankFactor:d}=WP(r);DR(Z1(r),n),XR(r),DP(r,d),UP(r,h),_P(r),KR(r),QR(r);const f=[];HP(r,f),fR(r,f),BP(r),s&&uR(r,a),cR(r,s),rL(r),FP(r,i),ER(r,{align:o,nodesep:l,edgesep:c,ranksep:u}),iL(r),eL(r),KP(r,f),$R(r),zP(r,i);const{width:v,height:g}=qR(r);return JR(r),tL(r),PP(r),{width:v,height:g}},jR=(r,t)=>{r.getAllNodes().forEach(e=>{const n=r.getNode(e.id);if(t.hasNode(e.id)){const i=t.getNode(e.id);n.data.fixorder=i.data._order,delete i.data._order}else delete n.data.fixorder})},GR=(r,t)=>{r.getAllNodes().forEach(e=>{var n;const i=r.getNode(e.id);if(i){const a=t.getNode(e.id);i.data.x=a.data.x,i.data.y=a.data.y,i.data._order=a.data.order,i.data._rank=a.data.rank,!((n=t.getChildren(e.id))===null||n===void 0)&&n.length&&(i.data.width=a.data.width,i.data.height=a.data.height)}}),r.getAllEdges().forEach(e=>{const n=r.getEdge(e.id),i=t.getEdge(e.id);n.data.points=i?i.data.points:[],i&&i.data.hasOwnProperty("x")&&(n.data.x=i.data.x,n.data.y=i.data.y)})},WR=["width","height","layer","fixorder"],ZR={width:0,height:0},VR=["minlen","weight","width","height","labeloffset"],UR={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},Pv=["labelpos"],YR=r=>{const t=new Un({tree:[]});return r.getAllNodes().forEach(e=>{const n=Mb(r.getNode(e.id).data),i=Object.assign(Object.assign({},ZR),n),a=Sb(i,WR);t.hasNode(e.id)||t.addNode({id:e.id,data:Object.assign({},a)});const s=r.hasTreeStructure("combo")?r.getParent(e.id,"combo"):r.getParent(e.id);be(s)||(t.hasNode(s.id)||t.addNode(Object.assign({},s)),t.setParent(e.id,s.id))}),r.getAllEdges().forEach(e=>{const n=Mb(r.getEdge(e.id).data),i={};Pv==null||Pv.forEach(a=>{n[a]!==void 0&&(i[a]=n[a])}),t.addEdge({id:e.id,source:e.source,target:e.target,data:Object.assign({},UR,Sb(n,VR),i)})}),t},HR=(r,t)=>{const{ranksep:e=0,rankdir:n}=t;return r.getAllNodes().forEach(i=>{isNaN(i.data.layer)||i.data.layer||(i.data.layer=0)}),r.getAllEdges().forEach(i=>{var a;i.data.minlen*=2,((a=i.data.labelpos)===null||a===void 0?void 0:a.toLowerCase())!=="c"&&(n==="TB"||n==="BT"?i.data.width+=i.data.labeloffset:i.data.height+=i.data.labeloffset)}),e/2},XR=r=>{r.getAllEdges().forEach(t=>{if(t.data.width&&t.data.height){const e=r.getNode(t.source),n=r.getNode(t.target),i={e:t,rank:(n.data.rank-e.data.rank)/2+e.data.rank};Mo(r,"edge-proxy",i,"_ep")}})},KR=r=>{let t=0;return r.getAllNodes().forEach(e=>{var n,i;e.data.borderTop&&(e.data.minRank=(n=r.getNode(e.data.borderTop))===null||n===void 0?void 0:n.data.rank,e.data.maxRank=(i=r.getNode(e.data.borderBottom))===null||i===void 0?void 0:i.data.rank,t=Math.max(t,e.data.maxRank||-1/0))}),t},QR=r=>{r.getAllNodes().forEach(t=>{t.data.dummy==="edge-proxy"&&(r.getEdge(t.data.e.id).data.labelRank=t.data.rank,r.removeNode(t.id))})},qR=(r,t)=>{let e,n=0,i,a=0;const{marginx:s=0,marginy:o=0}=t||{},l=c=>{if(!c.data)return;const u=c.data.x,h=c.data.y,d=c.data.width,f=c.data.height;!isNaN(u)&&!isNaN(d)&&(e===void 0&&(e=u-d/2),e=Math.min(e,u-d/2),n=Math.max(n,u+d/2)),!isNaN(h)&&!isNaN(f)&&(i===void 0&&(i=h-f/2),i=Math.min(i,h-f/2),a=Math.max(a,h+f/2))};return r.getAllNodes().forEach(c=>{l(c)}),r.getAllEdges().forEach(c=>{c!=null&&c.data.hasOwnProperty("x")&&l(c)}),e-=s,i-=o,r.getAllNodes().forEach(c=>{c.data.x-=e,c.data.y-=i}),r.getAllEdges().forEach(c=>{var u;(u=c.data.points)===null||u===void 0||u.forEach(h=>{h.x-=e,h.y-=i}),c.data.hasOwnProperty("x")&&(c.data.x-=e),c.data.hasOwnProperty("y")&&(c.data.y-=i)}),{width:n-e+s,height:a-i+o}},JR=r=>{r.getAllEdges().forEach(t=>{const e=r.getNode(t.source),n=r.getNode(t.target);let i,a;t.data.points?(i=t.data.points[0],a=t.data.points[t.data.points.length-1]):(t.data.points=[],i={x:n.data.x,y:n.data.y},a={x:e.data.x,y:e.data.y}),t.data.points.unshift(U1(e.data,i)),t.data.points.push(U1(n.data,a))})},$R=r=>{r.getAllEdges().forEach(t=>{if(t.data.hasOwnProperty("x"))switch((t.data.labelpos==="l"||t.data.labelpos==="r")&&(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;break}})},tL=r=>{r.getAllEdges().forEach(t=>{var e;t.data.reversed&&((e=t.data.points)===null||e===void 0||e.reverse())})},eL=r=>{r.getAllNodes().forEach(t=>{var e,n,i;if(!((e=r.getChildren(t.id))===null||e===void 0)&&e.length){const a=r.getNode(t.id),s=r.getNode(a.data.borderTop),o=r.getNode(a.data.borderBottom),l=r.getNode(a.data.borderLeft[((n=a.data.borderLeft)===null||n===void 0?void 0:n.length)-1]),c=r.getNode(a.data.borderRight[((i=a.data.borderRight)===null||i===void 0?void 0:i.length)-1]);a.data.width=Math.abs((c==null?void 0:c.data.x)-(l==null?void 0:l.data.x))||10,a.data.height=Math.abs((o==null?void 0:o.data.y)-(s==null?void 0:s.data.y))||10,a.data.x=((l==null?void 0:l.data.x)||0)+a.data.width/2,a.data.y=((s==null?void 0:s.data.y)||0)+a.data.height/2}}),r.getAllNodes().forEach(t=>{t.data.dummy==="border"&&r.removeNode(t.id)})},nL=r=>{r.getAllEdges().forEach(t=>{if(t.source===t.target){const e=r.getNode(t.source);e.data.selfEdges||(e.data.selfEdges=[]),e.data.selfEdges.push(t),r.removeEdge(t.id)}})},rL=r=>{const t=Il(r);t==null||t.forEach(e=>{let n=0;e==null||e.forEach((i,a)=>{var s;const o=r.getNode(i);o.data.order=a+n,(s=o.data.selfEdges)===null||s===void 0||s.forEach(l=>{Mo(r,"selfedge",{width:l.data.width,height:l.data.height,rank:o.data.rank,order:a+ ++n,e:l},"_se")}),delete o.data.selfEdges})})},iL=r=>{r.getAllNodes().forEach(t=>{const e=r.getNode(t.id);if(e.data.dummy==="selfedge"){const n=r.getNode(e.data.e.source),i=n.data.x+n.data.width/2,a=n.data.y,s=e.data.x-i,o=n.data.height/2;r.hasEdge(e.data.e.id)?r.updateEdgeData(e.data.e.id,e.data.e.data):r.addEdge({id:e.data.e.id,source:e.data.e.source,target:e.data.e.target,data:e.data.e.data}),r.removeNode(t.id),e.data.e.data.points=[{x:i+2*s/3,y:a-o},{x:i+5*s/6,y:a-o},{y:a,x:i+s},{x:i+5*s/6,y:a+o},{x:i+2*s/3,y:a+o}],e.data.e.data.x=e.data.x,e.data.e.data.y=e.data.y}})},Sb=(r,t)=>{const e={};return t==null||t.forEach(n=>{r[n]!==void 0&&(e[n]=+r[n])}),e},Mb=(r={})=>{const t={};return Object.keys(r).forEach(e=>{t[e.toLowerCase()]=r[e]}),t};function Bl(r){if(!r)return[0,0,0];if(ie(r))return[r,r,r];if(r.length===0)return[0,0,0];const[t,e=t,n=t]=r;return[t,e,n]}function Ws(r,t){let e;return ue(t)?e=t:ie(t)?e=()=>t:e=()=>r,e}function Rv(r,t,e=!0){return!t&&t!==0?n=>{const{size:i}=n.data||{};return i?Array.isArray(i)?e?Math.max(...i)||r:i:zn(i)&&i.width&&i.height?e?Math.max(i.width,i.height)||r:[i.width,i.height]:i:r}:ue(t)?t:ie(t)?()=>t:Array.isArray(t)?()=>e?Math.max(...t)||r:t:zn(t)&&t.width&&t.height?()=>e?Math.max(t.width,t.height)||r:[t.width,t.height]:()=>r}const Lv=(r,t,e=10)=>{let n;const i=typeof t=="function"?t:()=>t||0;return r?Array.isArray(r)?n=s=>r:ue(r)?n=r:n=s=>r:n=s=>{var o,l,c;if(!((o=s.data)===null||o===void 0)&&o.bboxSize)return(l=s.data)===null||l===void 0?void 0:l.bboxSize;if(!((c=s.data)===null||c===void 0)&&c.size){const u=s.data.size;return Array.isArray(u)?u:zn(u)?[u.width,u.height]:u}return e},s=>{const o=n(s),l=i(s);return Math.max(...Bl(o))+l}},_v=r=>{if(r===null)return r;if(r instanceof Date)return new Date(r.getTime());if(r instanceof Array){const t=[];return r.forEach(e=>{t.push(e)}),t.map(e=>_v(e))}if(typeof r=="object"){const t={};return Object.keys(r).forEach(e=>{t[e]=_v(r[e])}),t}return r},gi=(r,t)=>{const e=_v(r);return e.data=e.data||{},t&&(ie(e.data.x)||(e.data.x=Math.random()*t[0]),ie(e.data.y)||(e.data.y=Math.random()*t[1])),e},aL={rankdir:"TB",nodesep:50,ranksep:50,edgeLabelSpace:!0,ranker:"tight-tree",controlPoints:!1,radial:!1,focusNode:null};class sL{constructor(t={}){this.options=t,this.id="antv-dagre",this.options=Object.assign(Object.assign({},aL),t)}execute(t,e){return(0,Z.mG)(this,void 0,void 0,function*(){return this.genericDagreLayout(!1,t,e)})}assign(t,e){return(0,Z.mG)(this,void 0,void 0,function*(){yield this.genericDagreLayout(!0,t,e)})}genericDagreLayout(t,e,n){return(0,Z.mG)(this,void 0,void 0,function*(){const i=Object.assign(Object.assign({},this.options),n),{nodeSize:a,align:s,rankdir:o="TB",ranksep:l,nodesep:c,ranksepFunc:u,nodesepFunc:h,edgeLabelSpace:d,ranker:f,nodeOrder:v,begin:g,controlPoints:p,radial:y,sortByCombo:b,preset:E}=i,O=new Un({tree:[]}),k=Ws(l||50,u),P=Ws(c||50,h);let F=P,B=k;(o==="LR"||o==="RL")&&(F=k,B=P);const V=Rv(10,a,!1),U=e.getAllNodes(),J=e.getAllEdges();U.forEach(gt=>{const bt=Bl(V(gt)),Pt=B(gt),zt=F(gt),Ut=bt[0]+2*zt,$t=bt[1]+2*Pt,re=gt.data.layer;ie(re)?O.addNode({id:gt.id,data:{width:Ut,height:$t,layer:re}}):O.addNode({id:gt.id,data:{width:Ut,height:$t}})}),b&&(O.attachTreeStructure("combo"),U.forEach(gt=>{const{parentId:bt}=gt.data;bt!==void 0&&O.hasNode(bt)&&O.setParent(gt.id,bt,"combo")})),J.forEach(gt=>{O.addEdge({id:gt.id,source:gt.source,target:gt.target,data:{weight:gt.data.weight||1}})});let $;E!=null&&E.length&&($=new Un({nodes:E})),FR(O,{prevGraph:$,edgeLabelSpace:d,keepNodeOrder:!!v,nodeOrder:v||[],acyclicer:"greedy",ranker:f,rankdir:o,nodesep:c,align:s});const at=[0,0];if(g){let gt=1/0,bt=1/0;O.getAllNodes().forEach(Pt=>{gt>Pt.data.x&&(gt=Pt.data.x),bt>Pt.data.y&&(bt=Pt.data.y)}),O.getAllEdges().forEach(Pt=>{var zt;(zt=Pt.data.points)===null||zt===void 0||zt.forEach(Ut=>{gt>Ut.x&&(gt=Ut.x),bt>Ut.y&&(bt=Ut.y)})}),at[0]=g[0]-gt,at[1]=g[1]-bt}const ct=o==="LR"||o==="RL";if(!y){const gt=new Set,Pt=o==="BT"||o==="RL"?(re,ce)=>ce-re:(re,ce)=>re-ce;O.getAllNodes().forEach(re=>{re.data.x=re.data.x+at[0],re.data.y=re.data.y+at[1],gt.add(ct?re.data.x:re.data.y)});const zt=Array.from(gt).sort(Pt),Ut=ct?(re,ce)=>re.x!==ce.x:(re,ce)=>re.y!==ce.y,$t=ct?(re,ce,le)=>{const Ee=Math.max(ce.y,le.y),Ne=Math.min(ce.y,le.y);return re.filter(We=>We.y<=Ee&&We.y>=Ne)}:(re,ce,le)=>{const Ee=Math.max(ce.x,le.x),Ne=Math.min(ce.x,le.x);return re.filter(We=>We.x<=Ee&&We.x>=Ne)};O.getAllEdges().forEach((re,ce)=>{var le;d&&p&&re.data.type!=="loop"&&(re.data.controlPoints=oL((le=re.data.points)===null||le===void 0?void 0:le.map(({x:Ee,y:Ne})=>({x:Ee+at[0],y:Ne+at[1]})),O.getNode(re.source),O.getNode(re.target),zt,ct,Ut,$t))})}let ft=[];ft=O.getAllNodes().map(gt=>gi(gt));const Nt=O.getAllEdges();return t&&(ft.forEach(gt=>{e.mergeNodeData(gt.id,{x:gt.data.x,y:gt.data.y})}),Nt.forEach(gt=>{e.mergeEdgeData(gt.id,{controlPoints:gt.data.controlPoints})})),{nodes:ft,edges:Nt}})}}const oL=(r,t,e,n,i,a,s)=>{let o=(r==null?void 0:r.slice(1,r.length-1))||[];if(t&&e){let{x:l,y:c}=t.data,{x:u,y:h}=e.data;if(i&&(l=t.data.y,c=t.data.x,u=e.data.y,h=e.data.x),h!==c&&l!==u){const d=n.indexOf(c),f=n[d+1];if(f){const p=o[0],y=i?{x:(c+f)/2,y:(p==null?void 0:p.y)||u}:{x:(p==null?void 0:p.x)||u,y:(c+f)/2};(!p||a(p,y))&&o.unshift(y)}const v=n.indexOf(h),g=Math.abs(v-d);if(g===1)o=s(o,t.data,e.data),o.length||o.push(i?{x:(c+h)/2,y:l}:{x:l,y:(c+h)/2});else if(g>1){const p=n[v-1];if(p){const y=o[o.length-1],b=i?{x:(h+p)/2,y:(y==null?void 0:y.y)||u}:{x:(y==null?void 0:y.x)||l,y:(h+p)/2};(!y||a(y,b))&&o.push(b)}}}}return o},Zs=(r,t,e)=>{const n=r.getAllNodes(),i=r.getAllEdges();if(!(n!=null&&n.length))return{nodes:[],edges:i};if(n.length===1)return t&&r.mergeNodeData(n[0].id,{x:e[0],y:e[1]}),{nodes:[Object.assign(Object.assign({},n[0]),{data:Object.assign(Object.assign({},n[0].data),{x:e[0],y:e[1]})})],edges:i}},lL={radius:null,startRadius:null,endRadius:null,startAngle:0,endAngle:2*Math.PI,clockwise:!0,divisions:1,ordering:null,angleRatio:1};class cL{constructor(t={}){this.options=t,this.id="circular",this.options=Object.assign(Object.assign({},lL),t)}execute(t,e){return(0,Z.mG)(this,void 0,void 0,function*(){return this.genericCircularLayout(!1,t,e)})}assign(t,e){return(0,Z.mG)(this,void 0,void 0,function*(){yield this.genericCircularLayout(!0,t,e)})}genericCircularLayout(t,e,n){return(0,Z.mG)(this,void 0,void 0,function*(){const i=Object.assign(Object.assign({},this.options),n),{width:a,height:s,center:o,divisions:l,startAngle:c=0,endAngle:u=2*Math.PI,angleRatio:h,ordering:d,clockwise:f,nodeSpacing:v,nodeSize:g}=i,p=e.getAllNodes(),y=e.getAllEdges(),[b,E,O]=hL(a,s,o),k=p==null?void 0:p.length;if(!k||k===1)return Zs(e,t,O);const P=(u-c)/k;let{radius:F,startRadius:B,endRadius:V}=i;if(v){const ct=Ws(10,v),ft=Rv(10,g);let Nt=-1/0;p.forEach(gt=>{const bt=ft(gt);Nt<bt&&(Nt=bt)});let Ct=0;p.forEach((gt,bt)=>{bt===0?Ct+=Nt||10:Ct+=(ct(gt)||0)+(Nt||10)}),F=Ct/(2*Math.PI)}else!F&&!B&&!V?F=Math.min(E,b)/2:!B&&V?B=V:B&&!V&&(V=B);const U=P*h;let J=[];d==="topology"?J=Ab(e,p):d==="topology-directed"?J=Ab(e,p,!0):d==="degree"?J=uL(e,p):J=p.map(ct=>gi(ct));const $=Math.ceil(k/l);for(let ct=0;ct<k;++ct){let ft=F;!ft&&B!==null&&V!==null&&(ft=B+ct*(V-B)/(k-1)),ft||(ft=10+ct*100/(k-1));let Nt=c+ct%$*U+2*Math.PI/l*Math.floor(ct/$);f||(Nt=u-ct%$*U-2*Math.PI/l*Math.floor(ct/$)),J[ct].data.x=O[0]+Math.cos(Nt)*ft,J[ct].data.y=O[1]+Math.sin(Nt)*ft}return t&&J.forEach(ct=>{e.mergeNodeData(ct.id,{x:ct.data.x,y:ct.data.y})}),{nodes:J,edges:y}})}}const Ab=(r,t,e=!1)=>{const n=[gi(t[0])],i={},a=t.length;i[t[0].id]=!0;let s=0;return t.forEach((o,l)=>{if(l!==0)if((l===a-1||r.getDegree(o.id,"both")!==r.getDegree(t[l+1].id,"both")||r.areNeighbors(n[s].id,o.id))&&!i[o.id])n.push(gi(o)),i[o.id]=!0,s++;else{const c=e?r.getSuccessors(n[s].id):r.getNeighbors(n[s].id);let u=!1;for(let d=0;d<c.length;d++){const f=c[d];if(r.getDegree(f.id)===r.getDegree(o.id)&&!i[f.id]){n.push(gi(f)),i[f.id]=!0,u=!0;break}}let h=0;for(;!u&&(i[t[h].id]||(n.push(gi(t[h])),i[t[h].id]=!0,u=!0),h++,h!==a););}}),n};function uL(r,t){const e=[];return t.forEach((n,i)=>{e.push(gi(n))}),e.sort((n,i)=>r.getDegree(n.id,"both")-r.getDegree(i.id,"both")),e}const hL=(r,t,e)=>{let n=r,i=t,a=e;return!n&&typeof window!="undefined"&&(n=window.innerWidth),!i&&typeof window!="undefined"&&(i=window.innerHeight),a||(a=[n/2,i/2]),[n,i,a]},Aa=Array.isArray,dL={nodeSize:30,nodeSpacing:10,preventOverlap:!1,sweep:void 0,equidistant:!1,startAngle:3/2*Math.PI,clockwise:!0,maxLevelDiff:void 0,sortBy:"degree"};class Dv{constructor(t={}){this.options=t,this.id="concentric",this.options=Object.assign(Object.assign({},dL),t)}execute(t,e){return(0,Z.mG)(this,void 0,void 0,function*(){return this.genericConcentricLayout(!1,t,e)})}assign(t,e){return(0,Z.mG)(this,void 0,void 0,function*(){yield this.genericConcentricLayout(!0,t,e)})}genericConcentricLayout(t,e,n){return(0,Z.mG)(this,void 0,void 0,function*(){const i=Object.assign(Object.assign({},this.options),n),{center:a,width:s,height:o,sortBy:l,maxLevelDiff:c,sweep:u,clockwise:h,equidistant:d,preventOverlap:f,startAngle:v=3/2*Math.PI,nodeSize:g,nodeSpacing:p}=i,y=e.getAllNodes(),b=e.getAllEdges(),E=!s&&typeof window!="undefined"?window.innerWidth:s,O=!o&&typeof window!="undefined"?window.innerHeight:o,k=a||[E/2,O/2];if(!(y!=null&&y.length)||y.length===1)return Zs(e,t,k);const P=[];let F,B=0;Aa(g)?F=Math.max(g[0],g[1]):ue(g)?(F=-1/0,y.forEach(gt=>{const bt=Math.max(...Bl(g(gt)));bt>F&&(F=bt)})):F=g,Aa(p)?B=Math.max(p[0],p[1]):ie(p)&&(B=p),y.forEach(gt=>{const bt=gi(gt);P.push(bt);let Pt=F;const{data:zt}=bt;Aa(zt.size)?Pt=Math.max(zt.size[0],zt.size[1]):ie(zt.size)?Pt=zt.size:zn(zt.size)&&(Pt=Math.max(zt.size.width,zt.size.height)),F=Math.max(F,Pt),ue(p)&&(B=Math.max(p(gt),B))});const V={};P.forEach((gt,bt)=>{V[gt.id]=bt});let U=l;(!Ue(U)||P[0].data[U]===void 0)&&(U="degree"),U==="degree"?P.sort((gt,bt)=>e.getDegree(bt.id,"both")-e.getDegree(gt.id,"both")):P.sort((gt,bt)=>bt.data[U]-gt.data[U]);const J=P[0],$=(c||(U==="degree"?e.getDegree(J.id,"both"):J.data[U]))/4,at=[{nodes:[]}];let ct=at[0];P.forEach(gt=>{if(ct.nodes.length>0){const bt=Math.abs(U==="degree"?e.getDegree(ct.nodes[0].id,"both")-e.getDegree(gt.id,"both"):ct.nodes[0].data[U]-gt.data[U]);$&&bt>=$&&(ct={nodes:[]},at.push(ct))}ct.nodes.push(gt)});let ft=F+B;if(!f){const gt=at.length>0&&at[0].nodes.length>1,Pt=(Math.min(E,O)/2-ft)/(at.length+(gt?1:0));ft=Math.min(ft,Pt)}let Nt=0;if(at.forEach(gt=>{const bt=u===void 0?2*Math.PI-2*Math.PI/gt.nodes.length:u;if(gt.dTheta=bt/Math.max(1,gt.nodes.length-1),gt.nodes.length>1&&f){const Pt=Math.cos(gt.dTheta)-Math.cos(0),zt=Math.sin(gt.dTheta)-Math.sin(0),Ut=Math.sqrt(ft*ft/(Pt*Pt+zt*zt));Nt=Math.max(Ut,Nt)}gt.r=Nt,Nt+=ft}),d){let gt=0,bt=0;for(let Pt=0;Pt<at.length;Pt++){const Ut=(at[Pt].r||0)-bt;gt=Math.max(gt,Ut)}bt=0,at.forEach((Pt,zt)=>{zt===0&&(bt=Pt.r||0),Pt.r=bt,bt+=gt})}return at.forEach(gt=>{const bt=gt.dTheta||0,Pt=gt.r||0;gt.nodes.forEach((zt,Ut)=>{const $t=v+(h?1:-1)*bt*Ut;zt.data.x=k[0]+Pt*Math.cos($t),zt.data.y=k[1]+Pt*Math.sin($t)})}),t&&P.forEach(gt=>e.mergeNodeData(gt.id,{x:gt.data.x,y:gt.data.y})),{nodes:P,edges:b}})}}var Iv=S(14301),fL=S(7695);const vL=.81,Bv=.1;function gL(r,t,e,n,i=2){const a=t/e,s=r.getAllNodes(),o=s.map((u,h)=>{const{nodeStrength:d,x:f,y:v,z:g,size:p}=u.data;return{x:f,y:v,z:g,size:p,index:h,id:u.id,vx:0,vy:0,vz:0,weight:a*d}}),l=(i===2?(0,Iv.Z)(o,u=>u.x,u=>u.y):(0,fL.Z)(o,u=>u.x,u=>u.y,u=>u.z)).visitAfter(pL),c=new Map;return o.forEach(u=>{c.set(u.id,u),yL(u,l,i)}),o.map((u,h)=>{const{id:d,data:f}=s[h],{mass:v=1}=f;n[d]={x:u.vx/v,y:u.vy/v,z:u.vz/v}}),n}function pL(r){let t=0,e=0,n=0,i=0,a=0;const s=r.length;if(s){for(let o=0;o<s;o++){const l=r[o];l&&l.weight&&(t+=l.weight,e+=l.x*l.weight,n+=l.y*l.weight,i+=l.z*l.weight,a+=l.size*l.weight)}r.x=e/t,r.y=n/t,r.z=i/t,r.size=a/t,r.weight=t}else{const o=r;r.x=o.data.x,r.y=o.data.y,r.z=o.data.z,r.size=o.data.size,r.weight=o.data.weight}}const mL=(r,t,e,n,i,a,s)=>{var o;if(((o=r.data)===null||o===void 0?void 0:o.id)===a.id)return;const l=[e,n,i][s-1],c=a.x-r.x||Bv,u=a.y-r.y||Bv,h=a.z-r.z||Bv,d=[c,u,h],f=l-t;let v=0;for(let y=0;y<s;y++)v+=d[y]*d[y];const p=Math.sqrt(v)*v;if(f*f*vL<v){const y=r.weight/p;return a.vx+=c*y,a.vy+=u*y,a.vz+=h*y,!0}if(r.length)return!1;if(r.data!==a){const y=r.data.weight/p;a.vx+=c*y,a.vy+=u*y,a.vz+=h*y}};function yL(r,t,e){t.visit((n,i,a,s,o)=>mL(n,i,a,s,o,r,e))}const bL={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 Tb{constructor(t={}){this.options=t,this.id="force",this.timeInterval=0,this.judgingDistance=0,this.running=!1,this.options=Object.assign(Object.assign({},bL),t)}execute(t,e){return(0,Z.mG)(this,void 0,void 0,function*(){return this.genericForceLayout(!1,t,e)})}assign(t,e){return(0,Z.mG)(this,void 0,void 0,function*(){yield this.genericForceLayout(!0,t,e)})}stop(){this.timeInterval&&typeof window!="undefined"&&window.clearInterval(this.timeInterval),this.running=!1}tick(t=this.options.maxIteration||1){if(this.lastResult)return this.lastResult;for(let n=0;(this.judgingDistance>this.lastOptions.minMovement||n<1)&&n<t;n++)this.runOneStep(this.lastCalcGraph,this.lastGraph,n,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(n=>this.lastGraph.mergeNodeData(n.id,{x:n.data.x,y:n.data.y,z:this.options.dimensions===3?n.data.z:void 0})),e}genericForceLayout(t,e,n){return(0,Z.mG)(this,void 0,void 0,function*(){const i=Object.assign(Object.assign({},this.options),n),a=e.getAllNodes(),s=e.getAllEdges(),o=this.formatOptions(i,e),{dimensions:l,width:c,height:u,nodeSize:h,getMass:d,nodeStrength:f,edgeStrength:v,linkDistance:g}=o,p=a.map((B,V)=>Object.assign(Object.assign({},B),{data:Object.assign(Object.assign({},B.data),{x:ie(B.data.x)?B.data.x:Math.random()*c,y:ie(B.data.y)?B.data.y:Math.random()*u,z:ie(B.data.z)?B.data.z:Math.random()*Math.sqrt(c*u),size:h(B)||30,mass:d(B),nodeStrength:f(B)})})),y=s.map(B=>Object.assign(Object.assign({},B),{data:Object.assign(Object.assign({},B.data),{edgeStrength:v(B),linkDistance:g(B,e.getNode(B.source),e.getNode(B.target))})}));if(!(a!=null&&a.length))return this.lastResult={nodes:[],edges:s},{nodes:[],edges:s};const b={};a.forEach((B,V)=>{b[B.id]={x:0,y:0,z:0}});const E=new Un({nodes:p,edges:y});this.formatCentripetal(o,E);const{maxIteration:O,minMovement:k,onTick:P}=o;if(this.lastLayoutNodes=p,this.lastLayoutEdges=y,this.lastAssign=t,this.lastGraph=e,this.lastCalcGraph=E,this.lastOptions=o,this.lastVelMap=b,typeof window=="undefined")return;let F=0;return new Promise(B=>{this.timeInterval=window.setInterval(()=>{(!a||!this.running)&&B({nodes:Fv(e,p),edges:s}),this.runOneStep(E,e,F,b,o),this.updatePosition(e,E,b,o),t&&p.forEach(V=>e.mergeNodeData(V.id,{x:V.data.x,y:V.data.y,z:l===3?V.data.z:void 0})),P==null||P({nodes:Fv(e,p),edges:s}),F++,(F>=O||this.judgingDistance<k)&&(window.clearInterval(this.timeInterval),B({nodes:Fv(e,p),edges:s}))},0),this.running=!0})})}formatOptions(t,e){const n=Object.assign({},t),{width:i,height:a,getMass:s}=t;n.width=!i&&typeof window!="undefined"?window.innerWidth:i,n.height=!a&&typeof window!="undefined"?window.innerHeight:a,t.center||(n.center=[n.width/2,n.height/2]),s||(n.getMass=l=>{let c=1;ie(l==null?void 0:l.data.mass)&&(c=l==null?void 0:l.data.mass);const u=e.getDegree(l.id,"both");return!u||u<5?c:u*5*c}),n.nodeSize=Lv(t.nodeSize,t.nodeSpacing);const o=t.linkDistance?Ws(1,t.linkDistance):l=>1+n.nodeSize(e.getNode(l.source))+n.nodeSize(e.getNode(l.target));return n.linkDistance=o,n.nodeStrength=Ws(1,t.nodeStrength),n.edgeStrength=Ws(1,t.edgeStrength),n}formatCentripetal(t,e){const{dimensions:n,centripetalOptions:i,center:a,clusterNodeStrength:s,leafCluster:o,clustering:l,nodeClusterBy:c}=t,u=e.getAllNodes(),h=i||{leaf:2,single:2,others:1,center:y=>({x:a[0],y:a[1],z:n===3?a[2]:void 0})};typeof s!="function"&&(t.clusterNodeStrength=y=>s);let d,f;if(o&&c&&(d=Ob(e,c),f=Array.from(new Set(u==null?void 0:u.map(y=>y.data[c])))||[],t.centripetalOptions=Object.assign(h,{single:100,leaf:y=>{const{siblingLeaves:b,sameTypeLeaves:E}=d[y.id]||{};return(E==null?void 0:E.length)===(b==null?void 0:b.length)||(f==null?void 0:f.length)===1?1:t.clusterNodeStrength(y)},others:1,center:y=>{const b=e.getDegree(y.id,"both");if(!b)return{x:100,y:100,z:0};let E;if(b===1){const{sameTypeLeaves:O=[]}=d[y.id]||{};O.length===1?E=void 0:O.length>1&&(E=Cb(O))}else E=void 0;return{x:E==null?void 0:E.x,y:E==null?void 0:E.y,z:E==null?void 0:E.z}}})),l&&c){d||(d=Ob(e,c)),f||(f=Array.from(new Set(u.map(b=>b.data[c])))),f=f.filter(b=>b!==void 0);const y={};f.forEach(b=>{const E=u.filter(O=>O.data[c]===b).map(O=>e.getNode(O.id));y[b]=Cb(E)}),t.centripetalOptions=Object.assign(h,{single:b=>t.clusterNodeStrength(b),leaf:b=>t.clusterNodeStrength(b),others:b=>t.clusterNodeStrength(b),center:b=>{const E=y[b.data[c]];return{x:E==null?void 0:E.x,y:E==null?void 0:E.y,z:E==null?void 0:E.z}}})}const{leaf:v,single:g,others:p}=t.centripetalOptions||{};v&&typeof v!="function"&&(t.centripetalOptions.leaf=()=>v),g&&typeof g!="function"&&(t.centripetalOptions.single=()=>g),p&&typeof p!="function"&&(t.centripetalOptions.others=()=>p)}runOneStep(t,e,n,i,a){const s={},o=t.getAllNodes(),l=t.getAllEdges();if(!(o!=null&&o.length))return;const{monitor:c}=a;if(this.calRepulsive(t,s,a),l&&this.calAttractive(t,s,a),this.calGravity(t,e,s,a),this.updateVelocity(t,s,i,a),c){const u=this.calTotalEnergy(s,o);c({energy:u,nodes:e.getAllNodes(),edges:e.getAllEdges(),iterations:n})}}calTotalEnergy(t,e){if(!(e!=null&&e.length))return 0;let n=0;return e.forEach((i,a)=>{const s=t[i.id].x,o=t[i.id].y,l=this.options.dimensions===3?t[i.id].z:0,c=s*s+o*o+l*l,{mass:u=1}=i.data;n+=u*c*.5}),n}calRepulsive(t,e,n){const{dimensions:i,factor:a,coulombDisScale:s}=n;gL(t,a,s*s,e,i)}calAttractive(t,e,n){const{dimensions:i,nodeSize:a}=n;t.getAllEdges().forEach((s,o)=>{const{source:l,target:c}=s,u=t.getNode(l),h=t.getNode(c);if(!u||!h)return;let d=h.data.x-u.data.x,f=h.data.y-u.data.y,v=i===3?h.data.z-u.data.z:0;!d&&!f&&(d=Math.random()*.01,f=Math.random()*.01,i===3&&!v&&(v=Math.random()*.01));const g=Math.sqrt(d*d+f*f+v*v);if(g<a(u)+a(h))return;const p=d/g,y=f/g,b=v/g,{linkDistance:E=200,edgeStrength:O=200}=s.data||{},P=(E-g)*O,F=u.data.mass||1,B=h.data.mass||1,V=1/F,U=1/B,J=p*P,$=y*P,at=b*P;e[l].x-=J*V,e[l].y-=$*V,e[l].z-=at*V,e[c].x+=J*U,e[c].y+=$*U,e[c].z+=at*U})}calGravity(t,e,n,i){const{getCenter:a}=i,s=t.getAllNodes(),o=e.getAllNodes(),l=e.getAllEdges(),{width:c,height:u,center:h,gravity:d,centripetalOptions:f}=i;s&&s.forEach(v=>{const{id:g,data:p}=v,{mass:y,x:b,y:E,z:O}=p,k=e.getNode(g);let P=0,F=0,B=0,V=d;const U=t.getDegree(g,"in"),J=t.getDegree(g,"out"),$=t.getDegree(g,"both"),at=a==null?void 0:a(k,$);if(at){const[ct,ft,Nt]=at;P=b-ct,F=E-ft,V=Nt}else P=b-h[0],F=E-h[1],B=O-h[2];if(V&&(n[g].x-=V*P/y,n[g].y-=V*F/y,n[g].z-=V*B/y),f){const{leaf:ct,single:ft,others:Nt,center:Ct}=f,{x:gt,y:bt,z:Pt,centerStrength:zt}=(Ct==null?void 0:Ct(k,o,l,c,u))||{x:0,y:0,z:0,centerStrength:0};if(!ie(gt)||!ie(bt))return;const Ut=(b-gt)/y,$t=(E-bt)/y,re=(O-Pt)/y;if(zt&&(n[g].x-=zt*Ut,n[g].y-=zt*$t,n[g].z-=zt*re),$===0){const le=ft(k);if(!le)return;n[g].x-=le*Ut,n[g].y-=le*$t,n[g].z-=le*re;return}if(U===0||J===0){const le=ct(k,o,l);if(!le)return;n[g].x-=le*Ut,n[g].y-=le*$t,n[g].z-=le*re;return}const ce=Nt(k);if(!ce)return;n[g].x-=ce*Ut,n[g].y-=ce*$t,n[g].z-=ce*re}})}updateVelocity(t,e,n,i){const{damping:a,maxSpeed:s,interval:o,dimensions:l}=i,c=t.getAllNodes();c!=null&&c.length&&c.forEach(u=>{const{id:h}=u;let d=(n[h].x+e[h].x*o)*a||.01,f=(n[h].y+e[h].y*o)*a||.01,v=l===3?(n[h].z+e[h].z*o)*a||.01:0;const g=Math.sqrt(d*d+f*f+v*v);if(g>s){const p=s/g;d=p*d,f=p*f,v=p*v}n[h]={x:d,y:f,z:v}})}updatePosition(t,e,n,i){const{distanceThresholdMode:a,interval:s,dimensions:o}=i,l=e.getAllNodes();if(!(l!=null&&l.length)){this.judgingDistance=0;return}let c=0;a==="max"?this.judgingDistance=-1/0:a==="min"&&(this.judgingDistance=1/0),l.forEach(u=>{const{id:h}=u,d=t.getNode(h);if(ie(d.data.fx)&&ie(d.data.fy)){e.mergeNodeData(h,{x:d.data.fx,y:d.data.fy,z:o===3?d.data.fz:void 0});return}const f=n[h].x*s,v=n[h].y*s,g=o===3?n[h].z*s:0;e.mergeNodeData(h,{x:u.data.x+f,y:u.data.y+v,z:u.data.z+g});const p=Math.sqrt(f*f+v*v+g*g);switch(a){case"max":this.judgingDistance<p&&(this.judgingDistance=p);break;case"min":this.judgingDistance>p&&(this.judgingDistance=p);break;default:c=c+p;break}}),(!a||a==="mean")&&(this.judgingDistance=c/l.length)}}const Ob=(r,t)=>{const e=r.getAllNodes();if(!(e!=null&&e.length))return{};const n={};return e.forEach((i,a)=>{r.getDegree(i.id,"both")===1&&(n[i.id]=xL(r,"leaf",i,t))}),n},xL=(r,t,e,n)=>{const i=r.getDegree(e.id,"in"),a=r.getDegree(e.id,"out");let s=e,o=[];i===0?(s=r.getSuccessors(e.id)[0],o=r.getNeighbors(s.id)):a===0&&(s=r.getPredecessors(e.id)[0],o=r.getNeighbors(s.id)),o=o.filter(c=>r.getDegree(c.id,"in")===0||r.getDegree(c.id,"out")===0);const l=EL(r,t,n,e,o);return{coreNode:s,siblingLeaves:o,sameTypeLeaves:l}},EL=(r,t,e,n,i)=>{const a=n.data[e]||"";let s=(i==null?void 0:i.filter(o=>o.data[e]===a))||[];return t==="leaf"&&(s=s.filter(o=>r.getDegree(o.id,"in")===0||r.getDegree(o.id,"out")===0)),s},Cb=r=>{const t={x:0,y:0};r.forEach(n=>{const{x:i,y:a}=n.data;t.x+=i||0,t.y+=a||0});const e=r.length||1;return{x:t.x/e,y:t.y/e}},Fv=(r,t)=>t.map(e=>{const{id:n,data:i}=e,a=r.getNode(n);return Object.assign(Object.assign({},a),{data:Object.assign(Object.assign({},a.data),{x:i.x,y:i.y,z:i.z})})});var Ze=S(13393);const P7=Ze.XA,R7=Ze.a_,L7=Ze.yQ,_7=Ze.Hs,D7=Ze.Ec,I7=Ze.dx,B7=Ze.LU,F7=Ze.Rm,Ja=Ze.y3,z7=Ze.qK,j7=Ze.pb,G7=Ze.j,W7=Ze.sO,Z7=Ze.BZ,V7=Ze.EK,U7=Ze.Db,Y7=Ze.Fx,H7=Ze.tU,X7=Ze.Ym,K7=Ze.rs,Q7=Ze.QR,q7=Ze.TB,J7=Ze.oH,Nb=Ze.Sc,$7=Ze.BN,tj=Ze.it,ej=Ze.$r,nj=Ze.QM,rj=Ze.AV;var ij=(Ze.y3,Ze.y3);const aj=Ze.GH,sj=Ze.SO,oj=Ze.uZ,lj=Ze.yU,cj=Ze.F1,uj=Ze.re,kb=r=>{const t=[],e=r.length;for(let n=0;n<e;n+=1){t[n]=[];for(let i=0;i<e;i+=1)n===i?t[n][i]=0:r[n][i]===0||!r[n][i]?t[n][i]=1/0:t[n][i]=r[n][i]}for(let n=0;n<e;n+=1)for(let i=0;i<e;i+=1)for(let a=0;a<e;a+=1)t[i][a]>t[i][n]+t[n][a]&&(t[i][a]=t[i][n]+t[n][a]);return t},Pb=(r,t)=>{const{nodes:e,edges:n}=r,i=[],a={};if(!e)throw new Error("invalid nodes data!");return e&&e.forEach((s,o)=>{a[s.id]=o;const l=[];i.push(l)}),n==null||n.forEach(s=>{const{source:o,target:l}=s,c=a[o],u=a[l];c===void 0||u===void 0||(i[c][u]=1,t||(i[u][c]=1))}),i},wL=(r,t)=>{const e=[];return r.forEach(n=>{const i=[];n.forEach(a=>{i.push(a*t)}),e.push(i)}),e},SL=r=>{let t=1/0,e=1/0,n=-1/0,i=-1/0;return r.forEach(a=>{let s=a.data.size;Aa(s)?s.length===1&&(s=[s[0],s[0]]):ie(s)?s=[s,s]:(s===void 0||isNaN(s))&&(s=[30,30]);const o=[s[0]/2,s[1]/2],l=a.data.x-o[0],c=a.data.x+o[0],u=a.data.y-o[1],h=a.data.y+o[1];t>l&&(t=l),e>u&&(e=u),n<c&&(n=c),i<h&&(i=h)}),{minX:t,minY:e,maxX:n,maxY:i}},Rb=(r,t)=>Math.sqrt((r.x-t.x)*(r.x-t.x)+(r.y-t.y)*(r.y-t.y)),zv=(r,t,e,n="TB",i,a={})=>{if(!(t!=null&&t.length))return;const{stopBranchFn:s,stopAllFn:o}=a;for(let l=0;l<t.length;l++){const c=t[l];if(r.hasNode(c.id)&&!(s!=null&&s(c))){if(o!=null&&o(c))return;n==="TB"&&e(c),zv(r,r.getChildren(c.id,i),e,n,i,a),n!=="TB"&&e(c)}}},ML={center:[0,0],linkDistance:50};class Lb{constructor(t={}){this.options=t,this.id="mds",this.options=Object.assign(Object.assign({},ML),t)}execute(t,e){return(0,Z.mG)(this,void 0,void 0,function*(){return this.genericMDSLayout(!1,t,e)})}assign(t,e){return(0,Z.mG)(this,void 0,void 0,function*(){yield this.genericMDSLayout(!0,t,e)})}genericMDSLayout(t,e,n){return(0,Z.mG)(this,void 0,void 0,function*(){const i=Object.assign(Object.assign({},this.options),n),{center:a=[0,0],linkDistance:s=50}=i,o=e.getAllNodes(),l=e.getAllEdges();if(!(o!=null&&o.length)||o.length===1)return Zs(e,t,a);const c=Pb({nodes:o,edges:l},!1),u=kb(c);AL(u);const h=wL(u,s),d=TL(h),f=[];return d.forEach((g,p)=>{const y=gi(o[p]);y.data.x=g[0]+a[0],y.data.y=g[1]+a[1],f.push(y)}),t&&f.forEach(g=>e.mergeNodeData(g.id,{x:g.data.x,y:g.data.y})),{nodes:f,edges:l}})}}const AL=r=>{let t=-999999;r.forEach(e=>{e.forEach(n=>{n!==1/0&&t<n&&(t=n)})}),r.forEach((e,n)=>{e.forEach((i,a)=>{i===1/0&&(r[n][a]=t)})})},TL=r=>{const e=Ja.mul(Ja.pow(r,2),-.5),n=e.mean("row"),i=e.mean("column"),a=e.mean();e.add(a).subRowVector(n).subColumnVector(i);const s=new Nb(e),o=Ja.sqrt(s.diagonalMatrix).diagonal();return s.leftSingularVectors.toJSON().map(l=>Ja.mul([l],[o]).toJSON()[0].splice(0,2))};function jv(r){return!!r.tick&&!!r.stop}const OL={gForce:!0,force2:!0,d3force:!0,fruchterman:!0,forceAtlas2:!0,force:!0,"graphin-force":!0},CL={center:[0,0],comboPadding:10,treeKey:"combo"};class NL{constructor(t={}){this.options=t,this.id="comboCombined",this.options=Object.assign(Object.assign({},CL),t)}execute(t,e){return(0,Z.mG)(this,void 0,void 0,function*(){return this.genericComboCombinedLayout(!1,t,e)})}assign(t,e){return(0,Z.mG)(this,void 0,void 0,function*(){yield this.genericComboCombinedLayout(!0,t,e)})}genericComboCombinedLayout(t,e,n){return(0,Z.mG)(this,void 0,void 0,function*(){const i=this.initVals(Object.assign(Object.assign({},this.options),n)),{center:a,treeKey:s,outerLayout:o}=i,l=e.getAllNodes().filter(B=>!B.data._isCombo),c=e.getAllNodes().filter(B=>B.data._isCombo),u=e.getAllEdges(),h=l==null?void 0:l.length;if(!h||h===1)return Zs(e,t,a);const d=[],f=new Map;l.forEach(B=>{f.set(B.id,B)});const v=new Map;c.forEach(B=>{v.set(B.id,B)});const g=new Map,p=this.getInnerGraphs(e,s,f,v,u,i,g);yield Promise.all(p);const y=new Map,b=[],E=new Map;let O=!0;e.getRoots(s).forEach(B=>{const V=g.get(B.id),U=v.get(B.id)||f.get(B.id),J={id:B.id,data:Object.assign(Object.assign({},B.data),{x:V.data.x||U.data.x,y:V.data.y||U.data.y,fx:V.data.fx||U.data.fx,fy:V.data.fy||U.data.fy,mass:V.data.mass||U.data.mass,size:V.data.size})};b.push(J),y.set(B.id,!0),!isNaN(J.data.x)&&J.data.x!==0&&!isNaN(J.data.y)&&J.data.y!==0?O=!1:(J.data.x=Math.random()*100,J.data.y=Math.random()*100),zv(e,[B],$=>{$.id!==B.id&&E.set($.id,B.id)},"TB",s)});const k=[];u.forEach(B=>{const V=E.get(B.source)||B.source,U=E.get(B.target)||B.target;V!==U&&y.has(V)&&y.has(U)&&k.push({id:B.id,source:V,target:U,data:{}})});let P;if(b!=null&&b.length){if(b.length===1)b[0].data.x=a[0],b[0].data.y=a[1];else{const B=new Un({nodes:b,edges:k}),V=o||new Tb;O&&OL[V.id]&&(yield(b.length<100?new Lb:new Dv).assign(B));const U=Object.assign({center:a,kg:5,preventOverlap:!0,animate:!1},V.id==="force"?{gravity:1,factor:4,linkDistance:(J,$,at)=>{const ct=Math.max(...$.data.size)||32,ft=Math.max(...at.data.size)||32;return ct/2+ft/2+200}}:{});P=yield _b(V,B,U)}g.forEach(B=>{var V;const U=P.nodes.find(at=>at.id===B.id);if(U){const{x:at,y:ct}=U.data;B.data.visited=!0,B.data.x=at,B.data.y=ct,d.push({id:B.id,data:{x:at,y:ct}})}const{x:J,y:$}=B.data;(V=B.data.nodes)===null||V===void 0||V.forEach(at=>{d.push({id:at.id,data:{x:at.data.x+J,y:at.data.y+$}})})}),g.forEach(({data:B})=>{const{x:V,y:U,visited:J,nodes:$}=B;$==null||$.forEach(at=>{if(!J){const ct=d.find(ft=>ft.id===at.id);ct.data.x+=V||0,ct.data.y+=U||0}})})}return t&&d.forEach(B=>{e.mergeNodeData(B.id,{x:B.data.x,y:B.data.y})}),{nodes:d,edges:u}})}initVals(t){const e=Object.assign({},t),{nodeSize:n,spacing:i,comboPadding:a}=t;let s,o;if(ie(i)?o=()=>i:ue(i)?o=i:o=()=>0,e.spacing=o,!n)s=c=>{const u=o(c);return c.size?Aa(c.size)?((c.size[0]>c.size[1]?c.size[0]:c.size[1])+u)/2:zn(c.size)?((c.size.width>c.size.height?c.size.width:c.size.height)+u)/2:(c.size+u)/2:32+u/2};else if(ue(n))s=c=>{const u=n(c),h=o(c);return Aa(c.size)?((c.size[0]>c.size[1]?c.size[0]:c.size[1])+h)/2:((u||32)+h)/2};else if(Aa(n)){const u=(n[0]>n[1]?n[0]:n[1])/2;s=h=>u+o(h)/2}else{const c=n/2;s=u=>c+o(u)/2}e.nodeSize=s;let l;return ie(a)?l=()=>a:Aa(a)?l=()=>Math.max.apply(null,a):ue(a)?l=a:l=()=>0,e.comboPadding=l,e}getInnerGraphs(t,e,n,i,a,s,o){const{nodeSize:l,comboPadding:c,spacing:u,innerLayout:h}=s,d=h||new Dv({}),f={center:[0,0],preventOverlap:!0,nodeSpacing:u},v=[],g=p=>{let y=(c==null?void 0:c(p))||10;return Aa(y)&&(y=Math.max(...y)),{size:y?[y*2,y*2]:[30,30],padding:y}};return t.getRoots(e).forEach(p=>{o.set(p.id,{id:p.id,data:{nodes:[],size:g(p).size}});let y=Promise.resolve();zv(t,[p],b=>{var E;if(!b.data._isCombo)return;const{size:O,padding:k}=g(b);if(!(!((E=t.getChildren(b.id,e))===null||E===void 0)&&E.length))o.set(b.id,{id:b.id,data:Object.assign(Object.assign({},b.data),{size:O})});else{const P=o.get(b.id);o.set(b.id,{id:b.id,data:Object.assign({nodes:[]},P==null?void 0:P.data)});const F=new Map,B=t.getChildren(b.id,e).map(J=>{if(J.data._isCombo)return o.has(J.id)||o.set(J.id,{id:J.id,data:Object.assign({},J.data)}),F.set(J.id,!0),o.get(J.id);const $=n.get(J.id)||i.get(J.id);return F.set(J.id,!0),{id:J.id,data:Object.assign(Object.assign({},$.data),J.data)}}),V={nodes:B,edges:a.filter(J=>F.has(J.source)&&F.has(J.target))};let U=1/0;B.forEach(J=>{var $;let{size:at}=J.data;at||(at=(($=o.get(J.id))===null||$===void 0?void 0:$.data.size)||(l==null?void 0:l(J))||[30,30]),ie(at)&&(at=[at,at]);const[ct,ft]=at;U>ct&&(U=ct),U>ft&&(U=ft),J.data.size=at}),y=y.then(()=>(0,Z.mG)(this,void 0,void 0,function*(){const J=new Un(V);yield _b(d,J,f,!0);const{minX:$,minY:at,maxX:ct,maxY:ft}=SL(B),Nt={x:(ct+$)/2,y:(ft+at)/2};V.nodes.forEach(gt=>{gt.data.x-=Nt.x,gt.data.y-=Nt.y});const Ct=[Math.max(ct-$,U)+k*2,Math.max(ft-at,U)+k*2];o.get(b.id).data.size=Ct,o.get(b.id).data.nodes=B}))}return!0},"BT",e),v.push(y)}),v}}function _b(r,t,e,n){var i;return(0,Z.mG)(this,void 0,void 0,function*(){return jv(r)?(r.execute(t,e),r.stop(),r.tick((i=e.iterations)!==null&&i!==void 0?i:300)):n?yield r.assign(t,e):yield r.execute(t,e)})}function or(r){return function(){return r}}function $a(r){return(r()-.5)*1e-6}function kL(r){return r.index}function Db(r,t){var e=r.get(t);if(!e)throw new Error("node not found: "+t);return e}function PL(r){var t=kL,e=h,n,i=or(30),a,s,o,l,c,u=1;r==null&&(r=[]);function h(p){return 1/Math.min(o[p.source.index],o[p.target.index])}function d(p){for(var y=0,b=r.length;y<u;++y)for(var E=0,O,k,P,F,B,V,U;E<b;++E)O=r[E],k=O.source,P=O.target,F=P.x+P.vx-k.x-k.vx||$a(c),B=P.y+P.vy-k.y-k.vy||$a(c),V=Math.sqrt(F*F+B*B),V=(V-a[E])/V*p*n[E],F*=V,B*=V,P.vx-=F*(U=l[E]),P.vy-=B*U,k.vx+=F*(U=1-U),k.vy+=B*U}function f(){if(s){var p,y=s.length,b=r.length,E=new Map(s.map((k,P)=>[t(k,P,s),k])),O;for(p=0,o=new Array(y);p<b;++p)O=r[p],O.index=p,typeof O.source!="object"&&(O.source=Db(E,O.source)),typeof O.target!="object"&&(O.target=Db(E,O.target)),o[O.source.index]=(o[O.source.index]||0)+1,o[O.target.index]=(o[O.target.index]||0)+1;for(p=0,l=new Array(b);p<b;++p)O=r[p],l[p]=o[O.source.index]/(o[O.source.index]+o[O.target.index]);n=new Array(b),v(),a=new Array(b),g()}}function v(){if(s)for(var p=0,y=r.length;p<y;++p)n[p]=+e(r[p],p,r)}function g(){if(s)for(var p=0,y=r.length;p<y;++p)a[p]=+i(r[p],p,r)}return d.initialize=function(p,y){s=p,c=y,f()},d.links=function(p){return arguments.length?(r=p,f(),d):r},d.id=function(p){return arguments.length?(t=p,d):t},d.iterations=function(p){return arguments.length?(u=+p,d):u},d.strength=function(p){return arguments.length?(e=typeof p=="function"?p:or(+p),v(),d):e},d.distance=function(p){return arguments.length?(i=typeof p=="function"?p:or(+p),g(),d):i},d}var RL=S(72640),LL=S(83833);const _L=1664525,DL=1013904223,Ib=4294967296;function IL(){let r=1;return()=>(r=(_L*r+DL)%Ib)/Ib}function BL(r){return r.x}function FL(r){return r.y}var zL=10,jL=Math.PI*(3-Math.sqrt(5));function GL(r){var t,e=1,n=.001,i=1-Math.pow(n,1/300),a=0,s=.6,o=new Map,l=(0,LL.HT)(h),c=(0,RL.Z)("tick","end"),u=IL();r==null&&(r=[]);function h(){d(),c.call("tick",t),e<n&&(l.stop(),c.call("end",t))}function d(g){var p,y=r.length,b;g===void 0&&(g=1);for(var E=0;E<g;++E)for(e+=(a-e)*i,o.forEach(function(O){O(e)}),p=0;p<y;++p)b=r[p],b.fx==null?b.x+=b.vx*=s:(b.x=b.fx,b.vx=0),b.fy==null?b.y+=b.vy*=s:(b.y=b.fy,b.vy=0);return t}function f(){for(var g=0,p=r.length,y;g<p;++g){if(y=r[g],y.index=g,y.fx!=null&&(y.x=y.fx),y.fy!=null&&(y.y=y.fy),isNaN(y.x)||isNaN(y.y)){var b=zL*Math.sqrt(.5+g),E=g*jL;y.x=b*Math.cos(E),y.y=b*Math.sin(E)}(isNaN(y.vx)||isNaN(y.vy))&&(y.vx=y.vy=0)}}function v(g){return g.initialize&&g.initialize(r,u),g}return f(),t={tick:d,restart:function(){return l.restart(h),t},stop:function(){return l.stop(),t},nodes:function(g){return arguments.length?(r=g,f(),o.forEach(v),t):r},alpha:function(g){return arguments.length?(e=+g,t):e},alphaMin:function(g){return arguments.length?(n=+g,t):n},alphaDecay:function(g){return arguments.length?(i=+g,t):+i},alphaTarget:function(g){return arguments.length?(a=+g,t):a},velocityDecay:function(g){return arguments.length?(s=1-g,t):1-s},randomSource:function(g){return arguments.length?(u=g,o.forEach(v),t):u},force:function(g,p){return arguments.length>1?(p==null?o.delete(g):o.set(g,v(p)),t):o.get(g)},find:function(g,p,y){var b=0,E=r.length,O,k,P,F,B;for(y==null?y=1/0:y*=y,b=0;b<E;++b)F=r[b],O=g-F.x,k=p-F.y,P=O*O+k*k,P<y&&(B=F,y=P);return B},on:function(g,p){return arguments.length>1?(c.on(g,p),t):c.on(g)}}}function WL(){var r,t,e,n,i=or(-30),a,s=1,o=1/0,l=.81;function c(f){var v,g=r.length,p=(0,Iv.Z)(r,BL,FL).visitAfter(h);for(n=f,v=0;v<g;++v)t=r[v],p.visit(d)}function u(){if(r){var f,v=r.length,g;for(a=new Array(v),f=0;f<v;++f)g=r[f],a[g.index]=+i(g,f,r)}}function h(f){var v=0,g,p,y=0,b,E,O;if(f.length){for(b=E=O=0;O<4;++O)(g=f[O])&&(p=Math.abs(g.value))&&(v+=g.value,y+=p,b+=p*g.x,E+=p*g.y);f.x=b/y,f.y=E/y}else{g=f,g.x=g.data.x,g.y=g.data.y;do v+=a[g.data.index];while(g=g.next)}f.value=v}function d(f,v,g,p){if(!f.value)return!0;var y=f.x-t.x,b=f.y-t.y,E=p-v,O=y*y+b*b;if(E*E/l<O)return O<o&&(y===0&&(y=$a(e),O+=y*y),b===0&&(b=$a(e),O+=b*b),O<s&&(O=Math.sqrt(s*O)),t.vx+=y*f.value*n/O,t.vy+=b*f.value*n/O),!0;if(f.length||O>=o)return;(f.data!==t||f.next)&&(y===0&&(y=$a(e),O+=y*y),b===0&&(b=$a(e),O+=b*b),O<s&&(O=Math.sqrt(s*O)));do f.data!==t&&(E=a[f.data.index]*n/O,t.vx+=y*E,t.vy+=b*E);while(f=f.next)}return c.initialize=function(f,v){r=f,e=v,u()},c.strength=function(f){return arguments.length?(i=typeof f=="function"?f:or(+f),u(),c):i},c.distanceMin=function(f){return arguments.length?(s=f*f,c):Math.sqrt(s)},c.distanceMax=function(f){return arguments.length?(o=f*f,c):Math.sqrt(o)},c.theta=function(f){return arguments.length?(l=f*f,c):Math.sqrt(l)},c}function ZL(r,t){var e,n=1;r==null&&(r=0),t==null&&(t=0);function i(){var a,s=e.length,o,l=0,c=0;for(a=0;a<s;++a)o=e[a],l+=o.x,c+=o.y;for(l=(l/s-r)*n,c=(c/s-t)*n,a=0;a<s;++a)o=e[a],o.x-=l,o.y-=c}return i.initialize=function(a){e=a},i.x=function(a){return arguments.length?(r=+a,i):r},i.y=function(a){return arguments.length?(t=+a,i):t},i.strength=function(a){return arguments.length?(n=+a,i):n},i}function VL(r){return r.x+r.vx}function UL(r){return r.y+r.vy}function YL(r){var t,e,n,i=1,a=1;typeof r!="function"&&(r=or(r==null?1:+r));function s(){for(var c,u=t.length,h,d,f,v,g,p,y=0;y<a;++y)for(h=(0,Iv.Z)(t,VL,UL).visitAfter(o),c=0;c<u;++c)d=t[c],g=e[d.index],p=g*g,f=d.x+d.vx,v=d.y+d.vy,h.visit(b);function b(E,O,k,P,F){var B=E.data,V=E.r,U=g+V;if(B){if(B.index>d.index){var J=f-B.x-B.vx,$=v-B.y-B.vy,at=J*J+$*$;at<U*U&&(J===0&&(J=$a(n),at+=J*J),$===0&&($=$a(n),at+=$*$),at=(U-(at=Math.sqrt(at)))/at*i,d.vx+=(J*=at)*(U=(V*=V)/(p+V)),d.vy+=($*=at)*U,B.vx-=J*(U=1-U),B.vy-=$*U)}return}return O>f+U||P<f-U||k>v+U||F<v-U}}function o(c){if(c.data)return c.r=e[c.data.index];for(var u=c.r=0;u<4;++u)c[u]&&c[u].r>c.r&&(c.r=c[u].r)}function l(){if(t){var c,u=t.length,h;for(e=new Array(u),c=0;c<u;++c)h=t[c],e[h.index]=+r(h,c,t)}}return s.initialize=function(c,u){t=c,n=u,l()},s.iterations=function(c){return arguments.length?(a=+c,s):a},s.strength=function(c){return arguments.length?(i=+c,s):i},s.radius=function(c){return arguments.length?(r=typeof c=="function"?c:or(+c),l(),s):r},s}function HL(r,t,e){var n,i=or(.1),a,s;typeof r!="function"&&(r=or(+r)),t==null&&(t=0),e==null&&(e=0);function o(c){for(var u=0,h=n.length;u<h;++u){var d=n[u],f=d.x-t||1e-6,v=d.y-e||1e-6,g=Math.sqrt(f*f+v*v),p=(s[u]-g)*a[u]*c/g;d.vx+=f*p,d.vy+=v*p}}function l(){if(n){var c,u=n.length;for(a=new Array(u),s=new Array(u),c=0;c<u;++c)s[c]=+r(n[c],c,n),a[c]=isNaN(s[c])?0:+i(n[c],c,n)}}return o.initialize=function(c){n=c,l()},o.strength=function(c){return arguments.length?(i=typeof c=="function"?c:or(+c),l(),o):i},o.radius=function(c){return arguments.length?(r=typeof c=="function"?c:or(+c),l(),o):r},o.x=function(c){return arguments.length?(t=+c,o):t},o.y=function(c){return arguments.length?(e=+c,o):e},o}function XL(r){var t=or(.1),e,n,i;typeof r!="function"&&(r=or(r==null?0:+r));function a(o){for(var l=0,c=e.length,u;l<c;++l)u=e[l],u.vx+=(i[l]-u.x)*n[l]*o}function s(){if(e){var o,l=e.length;for(n=new Array(l),i=new Array(l),o=0;o<l;++o)n[o]=isNaN(i[o]=+r(e[o],o,e))?0:+t(e[o],o,e)}}return a.initialize=function(o){e=o,s()},a.strength=function(o){return arguments.length?(t=typeof o=="function"?o:or(+o),s(),a):t},a.x=function(o){return arguments.length?(r=typeof o=="function"?o:or(+o),s(),a):r},a}function KL(r){var t=or(.1),e,n,i;typeof r!="function"&&(r=or(r==null?0:+r));function a(o){for(var l=0,c=e.length,u;l<c;++l)u=e[l],u.vy+=(i[l]-u.y)*n[l]*o}function s(){if(e){var o,l=e.length;for(n=new Array(l),i=new Array(l),o=0;o<l;++o)n[o]=isNaN(i[o]=+r(e[o],o,e))?0:+t(e[o],o,e)}}return a.initialize=function(o){e=o,s()},a.strength=function(o){return arguments.length?(t=typeof o=="function"?o:or(+o),s(),a):t},a.y=function(o){return arguments.length?(r=typeof o=="function"?o:or(+o),s(),a):r},a}class QL{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:PL,manyBody:WL,center:ZL,collide:YL,radial:HL,x:XL,y:KL},this.options={link:{id:e=>e.id},manyBody:{},center:{x:0,y:0}},this.context={options:{},assign:!1,nodes:[],edges:[]},xr(this.options,t),this.options.forceSimulation&&(this.simulation=this.options.forceSimulation)}execute(t,e){return(0,Z.mG)(this,void 0,void 0,function*(){return this.genericLayout(!1,t,e)})}assign(t,e){return(0,Z.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(i=>i.id===t);n&&e.forEach((i,a)=>{if(typeof i=="number"||i===null){const s=["fx","fy","fz"][a];n[s]=i}})}getOptions(t){var e,n;const i=xr({},this.options,t);return i.collide&&((e=i.collide)===null||e===void 0?void 0:e.radius)===void 0&&(i.collide=i.collide||{},i.collide.radius=(n=i.nodeSize)!==null&&n!==void 0?n:10),i.iterations===void 0&&(i.link&&i.link.iterations===void 0&&(i.iterations=i.link.iterations),i.collide&&i.collide.iterations===void 0&&(i.iterations=i.collide.iterations)),this.context.options=i,i}genericLayout(t,e,n){var i;return(0,Z.mG)(this,void 0,void 0,function*(){const a=this.getOptions(n),s=e.getAllNodes().map(({id:u,data:h})=>Object.assign(Object.assign({id:u},h),zs(h.data,this.config.inputNodeAttrs))),o=e.getAllEdges().map(u=>Object.assign({},u));Object.assign(this.context,{assign:t,nodes:s,edges:o,graph:e});const l=new Promise(u=>{this.resolver=u}),c=this.setSimulation(a);return c.nodes(s),(i=c.force("link"))===null||i===void 0||i.links(o),l})}getResult(){const{assign:t,nodes:e,edges:n,graph:i}=this.context,a=e.map(o=>({id:o.id,data:Object.assign(Object.assign({},o.data),zs(o,this.config.outputNodeAttrs))})),s=n.map(({id:o,source:l,target:c,data:u})=>({id:o,source:typeof l=="object"?l.id:l,target:typeof c=="object"?c.id:c,data:u}));return t&&a.forEach(o=>i.mergeNodeData(o.id,o.data)),{nodes:a,edges:s}}initSimulation(){return GL()}setSimulation(t){const e=this.simulation||this.options.forceSimulation||this.initSimulation();return this.simulation||(this.simulation=e.on("tick",()=>{var n;return(n=t.onTick)===null||n===void 0?void 0:n.call(t,this.getResult())}).on("end",()=>{var n;return(n=this.resolver)===null||n===void 0?void 0:n.call(this,this.getResult())})),Bb(e,this.config.simulationAttrs.map(n=>[n,t[n]])),Object.entries(this.forceMap).forEach(([n,i])=>{const a=n;if(t[n]){let s=e.force(a);s||(s=i(),e.force(a,s)),Bb(s,Object.entries(t[a]))}else e.force(a,null)}),e}}const Bb=(r,t)=>t.reduce((e,[n,i])=>!e[n]||i===void 0?e:e[n].call(r,i),r);var Fb=S(92546),qL=S.n(Fb);class uh{constructor(t){this.id="dagre",this.options={},Object.assign(this.options,uh.defaultOptions,t)}execute(t,e){return(0,Z.mG)(this,void 0,void 0,function*(){return this.genericDagreLayout(!1,t,Object.assign(Object.assign({},this.options),e))})}assign(t,e){return(0,Z.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,Z.mG)(this,void 0,void 0,function*(){const{nodeSize:i}=n,a=new Fb.graphlib.Graph;a.setGraph(n),a.setDefaultEdgeLabel(()=>({}));const s=e.getAllNodes(),o=e.getAllEdges();[...s,...o].some(({id:c})=>ie(c))&&console.error("Dagre layout only support string id, it will convert number to string."),e.getAllNodes().forEach(c=>{const{id:u}=c,h=Object.assign({},c.data);if(i!==void 0){const[d,f]=Bl(ue(i)?i(c):i);Object.assign(h,{width:d,height:f})}a.setNode(u.toString(),h)}),e.getAllEdges().forEach(({id:c,source:u,target:h})=>{a.setEdge(u.toString(),h.toString(),{id:c})}),qL().layout(a);const l={nodes:[],edges:[]};return a.nodes().forEach(c=>{const u=a.node(c);l.nodes.push({id:c,data:u}),t&&e.mergeNodeData(c,u)}),a.edges().forEach(c=>{const u=a.edge(c),{id:h}=u,d=(0,Z._T)(u,["id"]),{v:f,w:v}=c;l.edges.push({id:h,source:f,target:v,data:d}),t&&e.mergeEdgeData(h,d)}),l})}}uh.defaultOptions={};class Gv{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 i=Math.hypot(e,n);i=i<1e-4?1e-4:i;const a=this.g*(this.degree+1)*(t.degree+1)/i;this.fx+=a*e/i,this.fy+=a*n/i}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,i=(this.ry*this.mass+t.ry*t.mass)/e,a=this.degree+t.degree,s={rx:n,ry:i,mass:e,degree:a};return new Gv(s)}}class Ao{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,i={xmid:t,ymid:e,length:n};return new Ao(i)}NE(){const t=this.xmid+this.length/4,e=this.ymid+this.length/4,n=this.length/2,i={xmid:t,ymid:e,length:n};return new Ao(i)}SW(){const t=this.xmid-this.length/4,e=this.ymid-this.length/4,n=this.length/2,i={xmid:t,ymid:e,length:n};return new Ao(i)}SE(){const t=this.xmid+this.length/4,e=this.ymid-this.length/4,n=this.length/2,i={xmid:t,ymid:e,length:n};return new Ao(i)}}class To{constructor(t){this.body=null,this.quad=null,this.NW=null,this.NE=null,this.SW=null,this.SE=null,this.theta=.5,t!=null&&(this.quad=t)}insert(t){if(this.body==null){this.body=t;return}this._isExternal()?(this.quad&&(this.NW=new To(this.quad.NW()),this.NE=new To(this.quad.NE()),this.SW=new To(this.quad.SW()),this.SE=new To(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))}_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 this.NW==null&&this.NE==null&&this.SW==null&&this.SE==null}updateForce(t){if(!(this.body==null||t===this.body))if(this._isExternal())t.addForce(this.body);else{const e=this.quad?this.quad.getLength():0,n=this.body.distanceTo(t);e/n<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 JL={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};class $L{constructor(t={}){this.options=t,this.id="forceAtlas2",this.options=Object.assign(Object.assign({},JL),t)}execute(t,e){return(0,Z.mG)(this,void 0,void 0,function*(){return this.genericForceAtlas2Layout(!1,t,e)})}assign(t,e){return(0,Z.mG)(this,void 0,void 0,function*(){yield this.genericForceAtlas2Layout(!0,t,e)})}genericForceAtlas2Layout(t,e,n){return(0,Z.mG)(this,void 0,void 0,function*(){const i=e.getAllEdges(),a=e.getAllNodes(),s=this.formatOptions(n,a.length),{width:o,height:l,prune:c,maxIteration:u,nodeSize:h,center:d}=s;if(!(a!=null&&a.length)||a.length===1)return Zs(e,t,d);const f=a.map(y=>gi(y,[o,l])),v=i.filter(y=>{const{source:b,target:E}=y;return b!==E}),g=new Un({nodes:f,edges:v}),p=this.getSizes(g,h);if(this.run(g,e,u,p,t,s),c){for(let b=0;b<v.length;b+=1){const{source:E,target:O}=v[b],k=g.getDegree(E),P=g.getDegree(E);if(k<=1){const F=g.getNode(O);g.mergeNodeData(E,{x:F.data.x,y:F.data.y})}else if(P<=1){const F=g.getNode(E);g.mergeNodeData(O,{x:F.data.x,y:F.data.y})}}const y=Object.assign(Object.assign({},s),{prune:!1,barnesHut:!1});this.run(g,e,100,p,t,y)}return{nodes:f,edges:i}})}getSizes(t,e){const n=t.getAllNodes(),i={};for(let a=0;a<n.length;a+=1){const s=n[a];i[s.id]=Lv(e,void 0)(s)}return i}formatOptions(t={},e){const n=Object.assign(Object.assign({},this.options),t),{center:i,width:a,height:s,barnesHut:o,prune:l,maxIteration:c,kr:u,kg:h}=n;return n.width=!a&&typeof window!="undefined"?window.innerWidth:a,n.height=!s&&typeof window!="undefined"?window.innerHeight:s,n.center=i||[n.width/2,n.height/2],o===void 0&&e>250&&(n.barnesHut=!0),l===void 0&&e>100&&(n.prune=!0),c===0&&!l?(n.maxIteration=250,e<=200&&e>100?n.maxIteration=1e3:e>200&&(n.maxIteration=1200)):c===0&&l&&(n.maxIteration=100,e<=200&&e>100?n.maxIteration=500:e>200&&(n.maxIteration=950)),u||(n.kr=50,e>100&&e<=500?n.kr=20:e>500&&(n.kr=1)),h||(n.kg=20,e>100&&e<=500?n.kg=10:e>500&&(n.kg=1)),n}run(t,e,n,i,a,s){const{kr:o,barnesHut:l,onTick:c}=s,u=t.getAllNodes();let h=0,d=n;const f={},v={},g={};for(let p=0;p<u.length;p+=1){const{data:y,id:b}=u[p];if(f[b]=[0,0],l){const E={id:p,rx:y.x,ry:y.y,mass:1,g:o,degree:t.getDegree(b)};g[b]=new Gv(E)}}for(;d>0;)h=this.oneStep(t,{iter:d,preventOverlapIters:50,krPrime:100,sg:h,forces:f,preForces:v,bodies:g,sizes:i},s),d--,c==null||c({nodes:u,edges:e.getAllEdges()});return t}oneStep(t,e,n){const{iter:i,preventOverlapIters:a,krPrime:s,sg:o,preForces:l,bodies:c,sizes:u}=e;let{forces:h}=e;const{preventOverlap:d,barnesHut:f}=n,v=t.getAllNodes();for(let g=0;g<v.length;g+=1){const{id:p}=v[g];l[p]=[...h[p]],h[p]=[0,0]}return h=this.getAttrForces(t,i,a,u,h,n),f&&(d&&i>a||!d)?h=this.getOptRepGraForces(t,h,c,n):h=this.getRepGraForces(t,i,a,h,s,u,n),this.updatePos(t,h,l,o,n)}getAttrForces(t,e,n,i,a,s){const{preventOverlap:o,dissuadeHubs:l,mode:c,prune:u}=s,h=t.getAllEdges();for(let d=0;d<h.length;d+=1){const{source:f,target:v}=h[d],g=t.getNode(f),p=t.getNode(v),y=t.getDegree(f),b=t.getDegree(v);if(u&&(y<=1||b<=1))continue;const E=[p.data.x-g.data.x,p.data.y-g.data.y];let O=Math.hypot(E[0],E[1]);O=O<1e-4?1e-4:O,E[0]=E[0]/O,E[1]=E[1]/O,o&&e<n&&(O=O-i[f]-i[v]);let k=O,P=k;c==="linlog"&&(k=Math.log(1+O),P=k),l&&(k=O/y,P=O/b),o&&e<n&&O<=0?(k=0,P=0):o&&e<n&&O>0&&(k=O,P=O),a[f][0]+=k*E[0],a[v][0]-=P*E[0],a[f][1]+=k*E[1],a[v][1]-=P*E[1]}return a}getOptRepGraForces(t,e,n,i){const{kg:a,center:s,prune:o}=i,l=t.getAllNodes(),c=l.length;let u=9e10,h=-9e10,d=9e10,f=-9e10;for(let b=0;b<c;b+=1){const{id:E,data:O}=l[b];o&&t.getDegree(E)<=1||(n[E].setPos(O.x,O.y),O.x>=h&&(h=O.x),O.x<=u&&(u=O.x),O.y>=f&&(f=O.y),O.y<=d&&(d=O.y))}const v=Math.max(h-u,f-d),g={xmid:(h+u)/2,ymid:(f+d)/2,length:v,massCenter:s,mass:c},p=new Ao(g),y=new To(p);for(let b=0;b<c;b+=1){const{id:E}=l[b];o&&t.getDegree(E)<=1||n[E].in(p)&&y.insert(n[E])}for(let b=0;b<c;b+=1){const{id:E,data:O}=l[b],k=t.getDegree(E);if(o&&k<=1)continue;n[E].resetForce(),y.updateForce(n[E]),e[E][0]-=n[E].fx,e[E][1]-=n[E].fy;const P=[O.x-s[0],O.y-s[1]];let F=Math.hypot(P[0],P[1]);F=F<1e-4?1e-4:F,P[0]=P[0]/F,P[1]=P[1]/F;const B=a*(k+1);e[E][0]-=B*P[0],e[E][1]-=B*P[1]}return e}getRepGraForces(t,e,n,i,a,s,o){const{preventOverlap:l,kr:c,kg:u,center:h,prune:d}=o,f=t.getAllNodes(),v=f.length;for(let g=0;g<v;g+=1){const p=f[g],y=t.getDegree(p.id);for(let k=g+1;k<v;k+=1){const P=f[k],F=t.getDegree(P.id);if(d&&(y<=1||F<=1))continue;const B=[P.data.x-p.data.x,P.data.y-p.data.y];let V=Math.hypot(B[0],B[1]);V=V<1e-4?1e-4:V,B[0]=B[0]/V,B[1]=B[1]/V,l&&e<n&&(V=V-s[p.id]-s[P.id]);let U=c*(y+1)*(F+1)/V;l&&e<n&&V<0?U=a*(y+1)*(F+1):l&&e<n&&V===0?U=0:l&&e<n&&V>0&&(U=c*(y+1)*(F+1)/V),i[p.id][0]-=U*B[0],i[P.id][0]+=U*B[0],i[p.id][1]-=U*B[1],i[P.id][1]+=U*B[1]}const b=[p.data.x-h[0],p.data.y-h[1]],E=Math.hypot(b[0],b[1]);b[0]=b[0]/E,b[1]=b[1]/E;const O=u*(y+1);i[p.id][0]-=O*b[0],i[p.id][1]-=O*b[1]}return i}updatePos(t,e,n,i,a){const{ks:s,tao:o,prune:l,ksmax:c}=a,u=t.getAllNodes(),h=u.length,d=[],f=[];let v=0,g=0,p=i;for(let b=0;b<h;b+=1){const{id:E}=u[b],O=t.getDegree(E);if(l&&O<=1)continue;const k=[e[E][0]-n[E][0],e[E][1]-n[E][1]],P=Math.hypot(k[0],k[1]),F=[e[E][0]+n[E][0],e[E][1]+n[E][1]],B=Math.hypot(F[0],F[1]);d[b]=P,f[b]=B/2,v+=(O+1)*d[b],g+=(O+1)*f[b]}const y=p;p=o*g/v,y!==0&&(p=p>1.5*y?1.5*y:p);for(let b=0;b<h;b+=1){const{id:E,data:O}=u[b],k=t.getDegree(E);if(l&&k<=1||ie(O.fx)&&ie(O.fy))continue;let P=s*p/(1+p*Math.sqrt(d[b])),F=Math.hypot(e[E][0],e[E][1]);F=F<1e-4?1e-4:F;const B=c/F;P=P>B?B:P;const V=P*e[E][0],U=P*e[E][1];t.mergeNodeData(E,{x:O.x+V,y:O.y+U})}return p}}const t_={maxIteration:1e3,gravity:10,speed:5,clustering:!1,clusterGravity:10,width:300,height:300,nodeClusterBy:"cluster"},e_=800;class n_{constructor(t={}){this.options=t,this.id="fruchterman",this.timeInterval=0,this.running=!1,this.options=Object.assign(Object.assign({},t_),t)}execute(t,e){return(0,Z.mG)(this,void 0,void 0,function*(){return this.genericFruchtermanLayout(!1,t,e)})}assign(t,e){return(0,Z.mG)(this,void 0,void 0,function*(){yield this.genericFruchtermanLayout(!0,t,e)})}stop(){this.timeInterval&&typeof window!="undefined"&&window.clearInterval(this.timeInterval),this.running=!1}tick(t=this.options.maxIteration||1){if(this.lastResult)return this.lastResult;for(let n=0;n<t;n++)this.runOneStep(this.lastGraph,this.lastClusterMap,this.lastOptions);const e={nodes:this.lastLayoutNodes,edges:this.lastLayoutEdges};return this.lastAssign&&e.nodes.forEach(n=>this.lastGraph.mergeNodeData(n.id,{x:n.data.x,y:n.data.y,z:this.options.dimensions===3?n.data.z:void 0})),e}genericFruchtermanLayout(t,e,n){return(0,Z.mG)(this,void 0,void 0,function*(){if(this.running)return;const i=this.formatOptions(n),{dimensions:a,width:s,height:o,center:l,clustering:c,nodeClusterBy:u,maxIteration:h,onTick:d}=i,f=e.getAllNodes(),v=e.getAllEdges();if(!(f!=null&&f.length)){const E={nodes:[],edges:v};return this.lastResult=E,E}if(f.length===1){t&&e.mergeNodeData(f[0].id,{x:l[0],y:l[1],z:a===3?l[2]:void 0});const E={nodes:[Object.assign(Object.assign({},f[0]),{data:Object.assign(Object.assign({},f[0].data),{x:l[0],y:l[1],z:a===3?l[2]:void 0})})],edges:v};return this.lastResult=E,E}const g=f.map(E=>gi(E,[s,o])),p=new Un({nodes:g,edges:v}),y={};if(c&&g.forEach(E=>{const O=E.data[u];y[O]||(y[O]={name:O,cx:0,cy:0,count:0})}),this.lastLayoutNodes=g,this.lastLayoutEdges=v,this.lastAssign=t,this.lastGraph=p,this.lastOptions=i,this.lastClusterMap=y,typeof window=="undefined")return;let b=0;return new Promise(E=>{this.timeInterval=window.setInterval(()=>{if(!this.running){E({nodes:g,edges:v});return}this.runOneStep(p,y,i),t&&g.forEach(({id:O,data:k})=>e.mergeNodeData(O,{x:k.x,y:k.y,z:a===3?k.z:void 0})),d==null||d({nodes:g,edges:v}),b++,b>=h&&(window.clearInterval(this.timeInterval),E({nodes:g,edges:v}))},0),this.running=!0})})}formatOptions(t={}){const e=Object.assign(Object.assign({},this.options),t),{clustering:n,nodeClusterBy:i}=e,{center:a,width:s,height:o}=e;return e.width=!s&&typeof window!="undefined"?window.innerWidth:s,e.height=!o&&typeof window!="undefined"?window.innerHeight:o,e.center=a||[e.width/2,e.height/2],e.clustering=n&&!!i,e}runOneStep(t,e,n){const{dimensions:i,height:a,width:s,gravity:o,center:l,speed:c,clustering:u,nodeClusterBy:h,clusterGravity:d}=n,f=a*s,v=Math.sqrt(f)/10,g=t.getAllNodes(),p=f/(g.length+1),y=Math.sqrt(p),b={};if(this.applyCalculate(t,b,y,p),u){for(const O in e)e[O].cx=0,e[O].cy=0,e[O].count=0;g.forEach(O=>{const{data:k}=O,P=e[k[h]];ie(k.x)&&(P.cx+=k.x),ie(k.y)&&(P.cy+=k.y),P.count++});for(const O in e)e[O].cx/=e[O].count,e[O].cy/=e[O].count;const E=d||o;g.forEach((O,k)=>{const{id:P,data:F}=O;if(!ie(F.x)||!ie(F.y))return;const B=e[F[h]],V=Math.sqrt((F.x-B.cx)*(F.x-B.cx)+(F.y-B.cy)*(F.y-B.cy)),U=y*E;b[P].x-=U*(F.x-B.cx)/V,b[P].y-=U*(F.y-B.cy)/V})}g.forEach((E,O)=>{const{id:k,data:P}=E;if(!ie(P.x)||!ie(P.y))return;const F=.01*y*o;b[k].x-=F*(P.x-l[0]),b[k].y-=F*(P.y-l[1]),i===3&&(b[k].z-=F*(P.z-l[2]))}),g.forEach((E,O)=>{const{id:k,data:P}=E;if(ie(P.fx)&&ie(P.fy)){P.x=P.fx,P.y=P.fy,i===3&&(P.z=P.fz);return}if(!ie(P.x)||!ie(P.y))return;const F=Math.sqrt(b[k].x*b[k].x+b[k].y*b[k].y+(i===3?b[k].z*b[k].z:0));if(F>0){const B=Math.min(v*(c/e_),F);t.mergeNodeData(k,{x:P.x+b[k].x/F*B,y:P.y+b[k].y/F*B,z:i===3?P.z+b[k].z/F*B:void 0})}})}applyCalculate(t,e,n,i){this.calRepulsive(t,e,i),this.calAttractive(t,e,n)}calRepulsive(t,e,n){const i=t.getAllNodes();i.forEach(({data:a,id:s},o)=>{e[s]={x:0,y:0,z:0},i.forEach(({data:l,id:c},u)=>{if(o<=u||!ie(a.x)||!ie(l.x)||!ie(a.y)||!ie(l.y))return;let h=a.x-l.x,d=a.y-l.y,f=this.options.dimensions===3?a.z-l.z:0,v=h*h+d*d+f*f;v===0&&(v=1,h=.01,d=.01,f=.01);const g=n/v,p=h*g,y=d*g,b=f*g;e[s].x+=p,e[s].y+=y,e[c].x-=p,e[c].y-=y,this.options.dimensions===3&&(e[s].z+=b,e[c].z-=b)})})}calAttractive(t,e,n){t.getAllEdges().forEach(a=>{const{source:s,target:o}=a;if(!s||!o||s===o)return;const{data:l}=t.getNode(s),{data:c}=t.getNode(o);if(!ie(c.x)||!ie(l.x)||!ie(c.y)||!ie(l.y))return;const u=c.x-l.x,h=c.y-l.y,d=this.options.dimensions===3?c.z-l.z:0,f=Math.sqrt(u*u+h*h+d*d)/n,v=u*f,g=h*f,p=d*f;e[s].x+=v,e[s].y+=g,e[o].x-=v,e[o].y-=g,this.options.dimensions===3&&(e[s].z+=p,e[o].z-=p)})}}const r_={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};class i_{constructor(t={}){this.options=t,this.id="grid",this.options=Object.assign(Object.assign({},r_),t)}execute(t,e){return(0,Z.mG)(this,void 0,void 0,function*(){return this.genericGridLayout(!1,t,e)})}assign(t,e){return(0,Z.mG)(this,void 0,void 0,function*(){yield this.genericGridLayout(!0,t,e)})}genericGridLayout(t,e,n){return(0,Z.mG)(this,void 0,void 0,function*(){const i=Object.assign(Object.assign({},this.options),n),{begin:a=[0,0],condense:s,preventOverlapPadding:o,preventOverlap:l,rows:c,cols:u,nodeSpacing:h,nodeSize:d,width:f,height:v,position:g}=i;let{sortBy:p}=i;const y=e.getAllNodes(),b=e.getAllEdges(),E=y==null?void 0:y.length;if(!E||E===1)return Zs(e,t,a);const O=y.map(ft=>gi(ft));p!=="id"&&(!Ue(p)||O[0].data[p]===void 0)&&(p="degree"),p==="degree"?O.sort((ft,Nt)=>e.getDegree(Nt.id,"both")-e.getDegree(ft.id,"both")):p==="id"?O.sort((ft,Nt)=>ie(Nt.id)&&ie(ft.id)?Nt.id-ft.id:`${ft.id}`.localeCompare(`${Nt.id}`)):O.sort((ft,Nt)=>Nt.data[p]-ft.data[p]);const k=!f&&typeof window!="undefined"?window.innerWidth:f,P=!v&&typeof window!="undefined"?window.innerHeight:v,F=E,B={rows:c,cols:u};if(c!=null&&u!=null)B.rows=c,B.cols=u;else if(c!=null&&u==null)B.rows=c,B.cols=Math.ceil(F/B.rows);else if(c==null&&u!=null)B.cols=u,B.rows=Math.ceil(F/B.cols);else{const ft=Math.sqrt(F*P/k);B.rows=Math.round(ft),B.cols=Math.round(k/P*ft)}if(B.rows=Math.max(B.rows,1),B.cols=Math.max(B.cols,1),B.cols*B.rows>F){const ft=hh(B),Nt=dh(B);(ft-1)*Nt>=F?hh(B,ft-1):(Nt-1)*ft>=F&&dh(B,Nt-1)}else for(;B.cols*B.rows<F;){const ft=hh(B),Nt=dh(B);(Nt+1)*ft>=F?dh(B,Nt+1):hh(B,ft+1)}let V=s?0:k/B.cols,U=s?0:P/B.rows;if(l||h){const ft=Ws(10,h),Nt=Rv(30,d,!1);O.forEach(Ct=>{(!Ct.data.x||!Ct.data.y)&&(Ct.data.x=0,Ct.data.y=0);const gt=e.getNode(Ct.id),[bt,Pt]=Bl(Nt(gt)||30),zt=ft!==void 0?ft(Ct):o,Ut=bt+zt,$t=Pt+zt;V=Math.max(V,Ut),U=Math.max(U,$t)})}const J={},$={row:0,col:0},at={};for(let ft=0;ft<O.length;ft++){const Nt=O[ft];let Ct;if(g&&(Ct=g(e.getNode(Nt.id))),Ct&&(Ct.row!==void 0||Ct.col!==void 0)){const gt={row:Ct.row,col:Ct.col};if(gt.col===void 0)for(gt.col=0;Wv(J,gt);)gt.col++;else if(gt.row===void 0)for(gt.row=0;Wv(J,gt);)gt.row++;at[Nt.id]=gt,zb(J,gt)}a_(Nt,a,V,U,at,B,$,J)}const ct={nodes:O,edges:b};return t&&O.forEach(ft=>{e.mergeNodeData(ft.id,{x:ft.data.x,y:ft.data.y})}),ct})}}const hh=(r,t)=>{let e;const n=r.rows||5,i=r.cols||5;return t==null?e=Math.min(n,i):Math.min(n,i)===r.rows?r.rows=t:r.cols=t,e},dh=(r,t)=>{let e;const n=r.rows||5,i=r.cols||5;return t==null?e=Math.max(n,i):Math.max(n,i)===r.rows?r.rows=t:r.cols=t,e},Wv=(r,t)=>r[`c-${t.row}-${t.col}`]||!1,zb=(r,t)=>r[`c-${t.row}-${t.col}`]=!0,jb=(r,t)=>{const e=r.cols||5;t.col++,t.col>=e&&(t.col=0,t.row++)},a_=(r,t,e,n,i,a,s,o)=>{let l,c;const u=i[r.id];if(u)l=u.col*e+e/2+t[0],c=u.row*n+n/2+t[1];else{for(;Wv(o,s);)jb(a,s);l=s.col*e+e/2+t[0],c=s.row*n+n/2+t[1],zb(o,s),jb(a,s)}r.data.x=l,r.data.y=c},s_=(r,t,e)=>{try{const n=Ja.mul(Ja.pow(t,2),-.5),i=n.mean("row"),a=n.mean("column"),s=n.mean();n.add(s).subRowVector(i).subColumnVector(a);const o=new Nb(n),l=Ja.sqrt(o.diagonalMatrix).diagonal();return o.leftSingularVectors.toJSON().map(c=>Ja.mul([c],[l]).toJSON()[0].splice(0,r))}catch(n){const i=[];for(let a=0;a<t.length;a++){const s=Math.random()*e,o=Math.random()*e;i.push([s,o])}return i}},o_=800,l_={iterations:10,height:10,width:10,speed:100,gravity:10,k:5},c_=(r,t)=>{const e=Object.assign(Object.assign({},l_),t),{positions:n,iterations:i,width:a,k:s,speed:o=100,strictRadial:l,focusIdx:c,radii:u=[],nodeSizeFunc:h}=e,d=r.getAllNodes(),f=[],v=a/10;for(let g=0;g<i;g++)n.forEach((p,y)=>{f[y]={x:0,y:0}}),u_(d,n,f,s,u,h),h_(n,f,o,l,c,v,a,u);return n},u_=(r,t,e,n,i,a)=>{t.forEach((s,o)=>{e[o]={x:0,y:0},t.forEach((l,c)=>{if(o===c||i[o]!==i[c])return;let u=s.x-l.x,h=s.y-l.y,d=Math.sqrt(u*u+h*h);if(d===0){d=1;const f=o>c?1:-1;u=.01*f,h=.01*f}if(d<a(r[o])/2+a(r[c])/2){const f=n*n/d;e[o].x+=u/d*f,e[o].y+=h/d*f}})})},h_=(r,t,e,n,i,a,s,o)=>{const l=a||s/10;return n&&t.forEach((c,u)=>{const h=r[u].x-r[i].x,d=r[u].y-r[i].y,f=Math.sqrt(h*h+d*d);let v=d/f,g=-h/f;const p=Math.sqrt(c.x*c.x+c.y*c.y);let y=Math.acos((v*c.x+g*c.y)/p);y>Math.PI/2&&(y-=Math.PI/2,v*=-1,g*=-1);const b=Math.cos(y)*p;c.x=v*b,c.y=g*b}),r.forEach((c,u)=>{if(u===i)return;const h=Math.sqrt(t[u].x*t[u].x+t[u].y*t[u].y);if(h>0&&u!==i){const d=Math.min(l*(e/o_),h);if(c.x+=t[u].x/h*d,c.y+=t[u].y/h*d,n){let f=c.x-r[i].x,v=c.y-r[i].y;const g=Math.sqrt(f*f+v*v);f=f/g*o[u],v=v/g*o[u],c.x=r[i].x+f,c.y=r[i].y+v}}}),r},d_={maxIteration:1e3,focusNode:null,unitRadius:null,linkDistance:50,preventOverlap:!1,strictRadial:!0,maxPreventOverlapIteration:200,sortStrength:10};class f_{constructor(t={}){this.options=t,this.id="radial",this.options=Object.assign(Object.assign({},d_),t)}execute(t,e){return(0,Z.mG)(this,void 0,void 0,function*(){return this.genericRadialLayout(!1,t,e)})}assign(t,e){return(0,Z.mG)(this,void 0,void 0,function*(){yield this.genericRadialLayout(!0,t,e)})}genericRadialLayout(t,e,n){return(0,Z.mG)(this,void 0,void 0,function*(){const i=Object.assign(Object.assign({},this.options),n),{width:a,height:s,center:o,focusNode:l,unitRadius:c,nodeSize:u,nodeSpacing:h,strictRadial:d,preventOverlap:f,maxPreventOverlapIteration:v,sortBy:g,linkDistance:p=50,sortStrength:y=10,maxIteration:b=1e3}=i,E=e.getAllNodes(),O=e.getAllEdges(),k=!a&&typeof window!="undefined"?window.innerWidth:a,P=!s&&typeof window!="undefined"?window.innerHeight:s,F=o||[k/2,P/2];if(!(E!=null&&E.length)||E.length===1)return Zs(e,t,F);let B=E[0];if(Ue(l)){for(let Ee=0;Ee<E.length;Ee++)if(E[Ee].id===l){B=E[Ee];break}}else B=l||E[0];const V=p_(E,B.id),U=Pb({nodes:E,edges:O},!1),J=kb(U),$=y_(J,V);m_(J,V,$+1);const at=J[V];let ct=k-F[0]>F[0]?F[0]:k-F[0],ft=P-F[1]>F[1]?F[1]:P-F[1];ct===0&&(ct=k/2),ft===0&&(ft=P/2);const Nt=Math.min(ct,ft),Ct=Math.max(...at),gt=[],bt=c||Nt/Ct;at.forEach((Ee,Ne)=>{gt[Ne]=Ee*bt});const Pt=v_(E,J,p,gt,bt,g,y),zt=g_(Pt),Ut=s_(p,Pt,p);let $t=Ut.map(([Ee,Ne])=>({x:(isNaN(Ee)?Math.random()*p:Ee)-Ut[V][0],y:(isNaN(Ne)?Math.random()*p:Ne)-Ut[V][1]}));this.run(b,$t,zt,Pt,gt,V);let re;if(f){re=Lv(u,h);const Ee={nodes:E,nodeSizeFunc:re,positions:$t,radii:gt,height:P,width:k,strictRadial:!!d,focusIdx:V,iterations:v||200,k:$t.length/4.5};$t=c_(e,Ee)}const ce=[];return $t.forEach((Ee,Ne)=>{const We=gi(E[Ne]);We.data.x=Ee.x+F[0],We.data.y=Ee.y+F[1],ce.push(We)}),t&&ce.forEach(Ee=>e.mergeNodeData(Ee.id,{x:Ee.data.x,y:Ee.data.y})),{nodes:ce,edges:O}})}run(t,e,n,i,a,s){for(let o=0;o<=t;o++){const l=o/t;this.oneIteration(l,e,a,i,n,s)}}oneIteration(t,e,n,i,a,s){const o=1-t;e.forEach((l,c)=>{const u=Rb(l,{x:0,y:0}),h=u===0?0:1/u;if(c===s)return;let d=0,f=0,v=0;e.forEach((p,y)=>{if(c===y)return;const b=Rb(l,p),E=b===0?0:1/b,O=i[y][c];v+=a[c][y],d+=a[c][y]*(p.x+O*(l.x-p.x)*E),f+=a[c][y]*(p.y+O*(l.y-p.y)*E)});const g=n[c]===0?0:1/n[c];v*=o,v+=t*g*g,d*=o,d+=t*g*l.x*h,l.x=d/v,f*=o,f+=t*g*l.y*h,l.y=f/v})}}const v_=(r,t,e,n,i,a,s)=>{if(!r)return[];const o=[];if(t){const l={};t.forEach((c,u)=>{const h=[];c.forEach((d,f)=>{var v,g;if(u===f)h.push(0);else if(n[u]===n[f])if(a==="data")h.push(d*(Math.abs(u-f)*s)/(n[u]/i));else if(a){let p,y;if(l[r[u].id])p=l[r[u].id];else{const b=(a==="id"?r[u].id:(v=r[u].data)===null||v===void 0?void 0:v[a])||0;Ue(b)?p=b.charCodeAt(0):p=b,l[r[u].id]=p}if(l[r[f].id])y=l[r[f].id];else{const b=(a==="id"?r[f].id:(g=r[f].data)===null||g===void 0?void 0:g[a])||0;Ue(b)?y=b.charCodeAt(0):y=b,l[r[f].id]=y}h.push(d*(Math.abs(p-y)*s)/(n[u]/i))}else h.push(d*e/(n[u]/i));else{const p=(e+i)/2;h.push(d*p)}}),o.push(h)})}return o},g_=r=>{const t=r.length,e=r[0].length,n=[];for(let i=0;i<t;i++){const a=[];for(let s=0;s<e;s++)r[i][s]!==0?a.push(1/(r[i][s]*r[i][s])):a.push(0);n.push(a)}return n},p_=(r,t)=>{let e=-1;return r.forEach((n,i)=>{n.id===t&&(e=i)}),Math.max(e,0)},m_=(r,t,e)=>{const n=r.length;for(let i=0;i<n;i++)if(r[t][i]===1/0){r[t][i]=e,r[i][t]=e;for(let a=0;a<n;a++)r[i][a]!==1/0&&r[t][a]===1/0&&(r[t][a]=e+r[i][a],r[a][t]=e+r[i][a])}for(let i=0;i<n;i++)if(i!==t){for(let a=0;a<n;a++)if(r[i][a]===1/0){let s=Math.abs(r[t][i]-r[t][a]);s=s===0?1:s,r[i][a]=s}}},y_=(r,t)=>{let e=0;for(let n=0;n<r[t].length;n++)r[t][n]!==1/0&&(e=r[t][n]>e?r[t][n]:e);return e},b_={center:[0,0],width:300,height:300};class x_{constructor(t={}){this.options=t,this.id="random",this.options=Object.assign(Object.assign({},b_),t)}execute(t,e){return(0,Z.mG)(this,void 0,void 0,function*(){return this.genericRandomLayout(!1,t,e)})}assign(t,e){return(0,Z.mG)(this,void 0,void 0,function*(){yield this.genericRandomLayout(!0,t,e)})}genericRandomLayout(t,e,n){return(0,Z.mG)(this,void 0,void 0,function*(){const i=Object.assign(Object.assign({},this.options),n),{center:a,width:s,height:o}=i,l=e.getAllNodes(),c=.9,u=!s&&typeof window!="undefined"?window.innerWidth:s,h=!o&&typeof window!="undefined"?window.innerHeight:o,d=a||[u/2,h/2],f=[];return l&&l.forEach(g=>{f.push({id:g.id,data:{x:(Math.random()-.5)*c*u+d[0],y:(Math.random()-.5)*c*h+d[1]}})}),t&&f.forEach(g=>e.mergeNodeData(g.id,{x:g.data.x,y:g.data.y})),{nodes:f,edges:e.getAllEdges()}})}}function E_(r){var t,e,n,i=r||1;function a(o,l){++t>i&&(n=e,s(1),++t),e[o]=l}function s(o){t=0,e=Object.create(null),o||(n=Object.create(null))}return s(),{clear:s,has:function(o){return e[o]!==void 0||n[o]!==void 0},get:function(o){var l=e[o];if(l!==void 0)return l;if((l=n[o])!==void 0)return a(o,l),l},set:function(o,l){e[o]!==void 0?e[o]=l:a(o,l)}}}var Zv=new Map;function Vv(r,t,e){e===void 0&&(e=128);var n=function(){for(var i=[],a=0;a<arguments.length;a++)i[a]=arguments[a];var s=t?t.apply(this,i):i[0];Zv.has(r)||Zv.set(r,E_(e));var o=Zv.get(r);if(o.has(s))return o.get(s);var l=r.apply(this,i);return o.set(s,l),l};return n}var w_=function(r,t,e,n){function i(a){return a instanceof e?a:new e(function(s){s(a)})}return new(e||(e=Promise))(function(a,s){function o(u){try{c(n.next(u))}catch(h){s(h)}}function l(u){try{c(n.throw(u))}catch(h){s(h)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((n=n.apply(r,t||[])).next())})};class fh extends eh{constructor(){super(...arguments),this.id="fishbone"}getRoot(){const t=this.context.model.getRootsData();if(!(ua(t)||t.length>2))return t[0]}formatSize(t){const e=typeof t=="function"?t:()=>t;return n=>fi(e(n))}doLayout(t,e){const{hGap:n,getRibSep:i,vGap:a,nodeSize:s,height:o}=e,{model:l}=this.context,c=this.formatSize(s);let u=c(t)[0]+i(t);const h=(E,O=0)=>{var k;return O+=n*((E.children||[]).length+1),(k=E.children)===null||k===void 0||k.forEach(P=>{var F;(F=l.getNodeLikeDatum(P).children)===null||F===void 0||F.forEach(V=>{const U=l.getNodeLikeDatum(V);O=h(U,O)})}),O},d=E=>{if(E.depth===1)return u;const O=l.getParentData(E.id,"tree");if(Oo(E)){const k=l.getParentData(O.id,"tree"),P=g(E)-g(k);return d(O)+P*n/a}else{const k=(O.children||[]).indexOf(E.id),P=l.getNodeData((O.children||[]).slice(k));return f(O)-P.reduce((F,B)=>F+h(B),0)-c(O)[0]/2}},f=Vv(E=>{if(Uv(E))return c(E)[0]/2;const O=l.getParentData(E.id,"tree");if(Oo(E))return d(E)+h(E)+c(E)[0]/2;{const k=g(E)-g(O),P=n/a;return d(E)+k*P}},E=>E.id),v=E=>g(l.getParentData(E,"tree")),g=Vv(E=>{if(Uv(E))return o/2;if(Oo(E)){const O=l.getParentData(E.id,"tree"),k=O.children.indexOf(E.id);if(k===0)return v(O.id)+a;const P=l.getNodeLikeDatum(O.children[k-1]);if(ua(P.children))return g(P)+a;const F=l.getDescendantsData(P.id);return Math.max(...F.map(B=>Oo(B)?v(B.id):g(B)))+a}else{if(ua(E.children))return v(E.id)+a;const O=l.getNodeLikeDatum(E.children.slice(-1)[0]);if(ua(O.children))return g(O)+a;const k=l.getDescendantsData(E.id).slice(-1)[0];return(Oo(k)?v(k.id):g(k))+a}},E=>E.id);let p=0;const y={nodes:[],edges:[]},b=E=>{var O;(O=E.children)===null||O===void 0||O.forEach(V=>b(l.getNodeLikeDatum(V)));const k=g(E),P=f(E);if(y.nodes.push({id:E.id,x:P,y:k}),Uv(E))return;const F=l.getRelatedEdgesData(E.id,"in")[0],B=[d(E),Oo(E)?k:v(E.id)];y.edges.push({id:At(F),controlPoints:[B],relatedNodeId:E.id}),p=Math.max(p,P+i(E)),E.depth===1&&(u=p)};return b(t),y}placeAlterative(t,e){const n=(e.children||[]).filter((o,l)=>l%2!==0);if(n.length===0)return t;const{model:i}=this.context,a=t.nodes.find(o=>o.id===e.id).y,s=o=>{const l=i.getAncestorsData(o,"tree");if(ua(l))return!1;const c=l.length===1?o:l[l.length-2].id;return n.includes(c)};t.nodes.forEach(o=>{s(o.id)&&(o.y=2*a-o.y)}),t.edges.forEach(o=>{s(o.relatedNodeId)&&(o.controlPoints=o.controlPoints.map(l=>[l[0],2*a-l[1]]))})}rightToLeft(t,e){return t.nodes.forEach(n=>n.x=e.width-n.x),t.edges.forEach(n=>{n.controlPoints=n.controlPoints.map(i=>[e.width-i[0],i[1]])}),t}execute(t,e){return w_(this,void 0,void 0,function*(){const n=Object.assign(Object.assign(Object.assign({},fh.defaultOptions),this.options),e),{direction:i,nodeSize:a}=n,s=this.getRoot();if(!s)return t;const o=this.formatSize(a);n.vGap||(n.vGap=Math.max(...(t.nodes||[]).map(d=>o(d)[1]))),n.hGap||(n.hGap=Math.max(...(t.nodes||[]).map(d=>o(d)[0])));let l=this.doLayout(s,n);this.placeAlterative(l,s),i==="RL"&&(l=this.rightToLeft(l,n));const{model:c}=this.context,u=[],h=[];return l.nodes.forEach(d=>{const{id:f,x:v,y:g}=d,p=c.getNodeLikeDatum(f);u.push(Gb(p,{x:v,y:g}))}),l.edges.forEach(d=>{const{id:f,controlPoints:v}=d,g=c.getEdgeDatum(f);h.push(Gb(g,{controlPoints:v}))}),{nodes:u,edges:h}})}}fh.defaultOptions={direction:"RL",getRibSep:()=>60};const Gb=(r,t)=>Object.assign(Object.assign({},r),{style:Object.assign(Object.assign({},r.style||{}),t)}),Uv=r=>r.depth===0,Oo=r=>(r.depth||(r.depth=0))%2===0;var S_=function(r,t,e,n){function i(a){return a instanceof e?a:new e(function(s){s(a)})}return new(e||(e=Promise))(function(a,s){function o(u){try{c(n.next(u))}catch(h){s(h)}}function l(u){try{c(n.throw(u))}catch(h){s(h)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((n=n.apply(r,t||[])).next())})};class vh extends eh{constructor(){super(...arguments),this.id="snake"}formatSize(t,e){const n=typeof e=="function"?e:()=>e;return t.reduce((i,a)=>{const[s,o]=fi(n(a))||[0,0];return[Math.max(i[0],s),Math.max(i[1],o)]},[0,0])}validate(t){const{nodes:e=[],edges:n=[]}=t,i={},a={},s={};e.forEach(d=>{i[d.id]=0,a[d.id]=0,s[d.id]=[]}),n.forEach(d=>{i[d.target]++,a[d.source]++,s[d.source].push(d.target)});const o=new Set,l=d=>{o.has(d)||(o.add(d),s[d].forEach(l))};if(l(e[0].id),o.size!==e.length)return!1;const c=e.filter(d=>i[d.id]===0),u=e.filter(d=>a[d.id]===0);return!(c.length!==1||u.length!==1||e.filter(d=>i[d.id]===1&&a[d.id]===1).length!==e.length-2)}execute(t,e){return S_(this,void 0,void 0,function*(){var n;if(!this.validate(t))return t;const{nodeSize:i,padding:a,sortBy:s,cols:o,colGap:l,rowGap:c,clockwise:u,width:h,height:d}=Object.assign({},vh.defaultOptions,this.options,e),[f,v,g,p]=hi(a),y=this.formatSize(t.nodes||[],i),b=Math.ceil((t.nodes||[]).length/o);let E=l||(h-p-v-o*y[0])/(o-1),O=c||(d-f-g-b*y[1])/(b-1);return(O===1/0||O<0)&&(O=0),(E===1/0||E<0)&&(E=0),{nodes:((s?(n=t.nodes)===null||n===void 0?void 0:n.sort(s):M_(t))||[]).map((F,B)=>{const V=Math.floor(B/o),U=B%o,J=u?V%2===0?U:o-1-U:V%2===0?o-1-U:U,$=p+J*(y[0]+E)+y[0]/2,at=f+V*(y[1]+O)+y[1]/2;return{id:F.id,style:{x:$,y:at}}})}})}}vh.defaultOptions={padding:0,cols:5,clockwise:!0};function M_(r){const{nodes:t=[],edges:e=[]}=r,n={},i={};t.forEach(o=>{n[o.id]=0,i[o.id]=[]}),e.forEach(o=>{n[o.target]++,i[o.source].push(o.target)});const a=[],s=[];for(t.forEach(o=>{n[o.id]===0&&a.push(o.id)});a.length>0;){const o=a.shift(),l=t.find(c=>c.id===o);s.push(l),i[o].forEach(c=>{n[c]--,n[c]===0&&a.push(c)})}return s}const A_=["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)"],T_=["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)"],O_=["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)"],C_=["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)"],N_=["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)"];var k_=function(r,t,e){if(!Kr(r)&&!bo(r))return r;var n=e;return d1(r,function(i,a){n=t(n,i,a)}),n},P_=k_,Yv=function(r,t){return P_(r,function(e,n,i){return t.includes(i)||(e[i]=n),e},{})};class fr extends Hf{}function Co(r,t=!0,e){const n=document.createElement("div");return n.setAttribute("class",`g6-${r}`),Object.assign(n.style,{position:"absolute",display:"block"}),t&&Object.assign(n.style,{position:"unset",gridArea:"1 / 1 / 2 / 2",inset:"0px",height:"100%",width:"100%",overflow:"hidden",pointerEvents:"none"}),e&&Object.assign(n.style,e),n}function Hv(r,t="div",e={},n="",i=document.body){const a=document.getElementById(r);a&&a.remove();const s=document.createElement(t);return s.innerHTML=n,s.id=r,Object.assign(s.style,e),i.appendChild(s),s}var R_=function(r,t,e,n){function i(a){return a instanceof e?a:new e(function(s){s(a)})}return new(e||(e=Promise))(function(a,s){function o(u){try{c(n.next(u))}catch(h){s(h)}}function l(u){try{c(n.throw(u))}catch(h){s(h)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((n=n.apply(r,t||[])).next())})};class gh extends fr{constructor(t,e){super(t,Object.assign({},gh.defaultOptions,e)),this.$element=Co("background"),this.context.canvas.getContainer().prepend(this.$element),this.update(e)}update(t){const e=Object.create(null,{update:{get:()=>super.update}});return R_(this,void 0,void 0,function*(){e.update.call(this,t),Object.assign(this.$element.style,Yv(this.options,["key","type"]))})}destroy(){super.destroy(),this.$element.remove()}}gh.defaultOptions={transition:"background 0.5s",backgroundSize:"cover",zIndex:"-1"};function Xv(r,t,e,n,i,a){const s=r,o=t,l=e-s,c=n-o;let u=i-s,h=a-o,d=u*l+h*c,f=0;d<=0?f=0:(u=l-u,h=c-h,d=u*l+h*c,d<=0?f=0:f=d*d/(l*l+c*c));const v=u*u+h*h-f;return v<0?0:v}function ts(r,t,e,n){return(r-e)*(r-e)+(t-n)*(t-n)}function Wb(r,t,e,n,i){return ts(r,t,e,n)<i*i}function L_(r){if(!Number.isFinite(r))return e=>e;if(r===0)return Math.round;const t=Math.pow(10,r);return e=>Math.round(e*t)/t}function Zb(r){const t=Math.min(r.x1,r.x2),e=Math.max(r.x1,r.x2),n=Math.min(r.y1,r.y2),i=Math.max(r.y1,r.y2);return{x:t,y:n,x2:e,y2:i,width:e-t,height:i-n}}class vr{constructor(t,e,n,i){this.x1=t,this.y1=e,this.x2=n,this.y2=i}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 vr(t.x1,t.y1,t.x2,t.y2)}cuts(t,e){if(this.y1===this.y2||e<this.y1&&e<=this.y2||e>this.y1&&e>=this.y2||t>this.x1&&t>=this.x2)return!1;if(t<this.x1&&t<=this.x2)return!0;const n=this.x1+(e-this.y1)*(this.x2-this.x1)/(this.y2-this.y1);return t<=n}distSquare(t,e){return Xv(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}}var In;(function(r){r[r.POINT=1]="POINT",r[r.PARALLEL=2]="PARALLEL",r[r.COINCIDENT=3]="COINCIDENT",r[r.NONE=4]="NONE"})(In||(In={}));class Kv{constructor(t,e=0,n=0){this.state=t,this.x=e,this.y=n}}function ph(r,t){const e=(t.x2-t.x1)*(r.y1-t.y1)-(t.y2-t.y1)*(r.x1-t.x1),n=(r.x2-r.x1)*(r.y1-t.y1)-(r.y2-r.y1)*(r.x1-t.x1),i=(t.y2-t.y1)*(r.x2-r.x1)-(t.x2-t.x1)*(r.y2-r.y1);if(i){const a=e/i,s=n/i;return 0<=a&&a<=1&&0<=s&&s<=1?new Kv(In.POINT,r.x1+a*(r.x2-r.x1),r.y1+a*(r.y2-r.y1)):new Kv(In.NONE)}return new Kv(e===0||n===0?In.COINCIDENT:In.PARALLEL)}function Vb(r,t){const e=(t.x2-t.x1)*(r.y1-t.y1)-(t.y2-t.y1)*(r.x1-t.x1),n=(r.x2-r.x1)*(r.y1-t.y1)-(r.y2-r.y1)*(r.x1-t.x1),i=(t.y2-t.y1)*(r.x2-r.x1)-(t.x2-t.x1)*(r.y2-r.y1);if(i){const a=e/i,s=n/i;if(0<=a&&a<=1&&0<=s&&s<=1)return a}return Number.POSITIVE_INFINITY}function __(r,t){function e(i,a,s,o){let l=Vb(t,new vr(i,a,s,o));return l=Math.abs(l-.5),l>=0&&l<=1?1:0}let n=e(r.x,r.y,r.x2,r.y);return n+=e(r.x,r.y,r.x,r.y2),n>1||(n+=e(r.x,r.y2,r.x2,r.y2),n>1)?!0:(n+=e(r.x2,r.y,r.x2,r.y2),n>0)}var Bn;(function(r){r[r.LEFT=0]="LEFT",r[r.TOP=1]="TOP",r[r.RIGHT=2]="RIGHT",r[r.BOTTOM=3]="BOTTOM"})(Bn||(Bn={}));function mh(r,t,e){const n=new Set;return r.width<=0?(n.add(Bn.LEFT),n.add(Bn.RIGHT)):t<r.x?n.add(Bn.LEFT):t>r.x+r.width&&n.add(Bn.RIGHT),r.height<=0?(n.add(Bn.TOP),n.add(Bn.BOTTOM)):e<r.y?n.add(Bn.TOP):e>r.y+r.height&&n.add(Bn.BOTTOM),n}function Ub(r,t){let e=t.x1,n=t.y1;const i=t.x2,a=t.y2,s=Array.from(mh(r,i,a));if(s.length===0)return!0;let o=mh(r,e,n);for(;o.size!==0;){for(const l of s)if(o.has(l))return!1;if(o.has(Bn.RIGHT)||o.has(Bn.LEFT)){let l=r.x;o.has(Bn.RIGHT)&&(l+=r.width),n=n+(l-e)*(a-n)/(i-e),e=l}else{let l=r.y;o.has(Bn.BOTTOM)&&(l+=r.height),e=e+(l-n)*(i-e)/(a-n),n=l}o=mh(r,e,n)}return!0}function D_(r,t){let e=Number.POSITIVE_INFINITY,n=0;function i(a,s,o,l){let c=Vb(t,new vr(a,s,o,l));c=Math.abs(c-.5),c>=0&&c<=1&&(n++,c<e&&(e=c))}return i(r.x,r.y,r.x2,r.y),i(r.x,r.y,r.x,r.y2),n>1||(i(r.x,r.y2,r.x2,r.y2),n>1)?e:(i(r.x2,r.y,r.x2,r.y2),n===0?-1:e)}function I_(r,t){let e=0;const n=ph(r,new vr(t.x,t.y,t.x2,t.y));e+=n.state===In.POINT?1:0;const i=ph(r,new vr(t.x,t.y,t.x,t.y2));e+=i.state===In.POINT?1:0;const a=ph(r,new vr(t.x,t.y2,t.x2,t.y2));e+=a.state===In.POINT?1:0;const s=ph(r,new vr(t.x2,t.y,t.x2,t.y2));return e+=s.state===In.POINT?1:0,{top:n,left:i,bottom:a,right:s,count:e}}class Rr{constructor(t,e,n,i){this.x=t,this.y=e,this.width=n,this.height=i}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 Rr(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 Rr(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),i=Math.max(this.x2,t.x+t.width),a=Math.max(this.y2,t.y+t.height);this.x=e,this.y=n,this.width=i-e,this.height=a-n}addPoint(t){const e=Math.min(this.x,t.x),n=Math.min(this.y,t.y),i=Math.max(this.x2,t.x),a=Math.max(this.y2,t.y);this.x=e,this.y=n,this.width=i-e,this.height=a-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?!1: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=mh(this,t,e);return n.has(Bn.TOP)?n.has(Bn.LEFT)?ts(t,e,this.x,this.y):n.has(Bn.RIGHT)?ts(t,e,this.x2,this.y):(this.y-e)*(this.y-e):n.has(Bn.BOTTOM)?n.has(Bn.LEFT)?ts(t,e,this.x,this.y2):n.has(Bn.RIGHT)?ts(t,e,this.x2,this.y2):(e-this.y2)*(e-this.y2):n.has(Bn.LEFT)?(this.x-t)*(this.x-t):n.has(Bn.RIGHT)?(t-this.x2)*(t-this.x2):0}}function B_(r){if(r.length===0)return null;const t=r[0],e=new Rr(t.x,t.y,0,0);for(const n of r)e.addPoint(n);return e}class yh{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 this.radius*2}get y(){return this.cy-this.radius}get y2(){return this.cy+this.radius}get height(){return this.radius*2}static from(t){return new yh(t.cx,t.cy,t.radius)}containsPt(t,e){return ts(this.cx,this.cy,t,e)<this.radius*this.radius}distSquare(t,e){const n=ts(this.cx,this.cy,t,e);if(n<this.radius*this.radius)return 0;const i=Math.sqrt(n)-this.radius;return i*i}draw(t){t.ellipse(this.cx,this.cy,this.radius,this.radius,0,0,Math.PI*2)}}class Vs{constructor(t,e=0,n=0,i=0,a=0,s=10,o=10,l=new Float32Array(Math.max(0,s*o)).fill(0)){this.pixelGroup=t,this.i=e,this.j=n,this.pixelX=i,this.pixelY=a,this.width=s,this.height=o,this.area=l}createSub(t,e){return new Vs(this.pixelGroup,t.x,t.y,e.x,e.y,t.width,t.height)}static fromPixelRegion(t,e){return new Vs(e,0,0,t.x,t.y,Math.ceil(t.width/e),Math.ceil(t.height/e))}copy(t,e){return new Vs(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),i=this.boundX(Math.ceil((t.x+t.width-this.pixelX)/this.pixelGroup)),a=this.boundY(Math.ceil((t.y+t.height-this.pixelY)/this.pixelGroup)),s=i-e,o=a-n;return new Rr(e,n,s,o)}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),i=this.boundX(t.x-n),a=this.boundY(t.y-n),s=this.boundX(t.x2+n),o=this.boundY(t.y2+n),l=s-i,c=o-a;return new Rr(i,a,l,c)}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||e===0)return;const n=this.width,i=t.width,a=Math.max(0,t.i),s=Math.max(0,t.j),o=Math.min(t.i+t.width,n),l=Math.min(t.j+t.height,this.height);if(!(l<=0||o<=0||a>=n||l>=this.height))for(let c=s;c<l;c++){const u=(c-t.j)*i,h=c*n;for(let d=a;d<o;d++){const f=t.area[d-t.i+u];f!==0&&(this.area[d+h]+=e*f)}}}fill(t){this.area.fill(t)}fillArea(t,e){const n=t.x+t.y*this.width;for(let i=0;i<t.height;i++){const a=n+i*this.width;this.area.fill(e,a,a+t.width)}}fillHorizontalLine(t,e,n,i){const a=t+e*this.width;this.area.fill(i,a,a+n)}fillVerticalLine(t,e,n,i){const a=t+e*this.width;for(let s=0;s<n;s++)this.area[a+s*this.width]=i}clear(){this.area.fill(0)}toString(){let t="";for(let e=0;e<this.height;e++){const n=e*this.width;for(let i=0;i<this.width;i++){const a=this.area[n+i];t+=a.toFixed(1).padStart(6),t+=" "}t+=`
|
|
|
`}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((s,o)=>Math.min(s,o),Number.POSITIVE_INFINITY),i=this.area.reduce((s,o)=>Math.max(s,o),Number.NEGATIVE_INFINITY),a=s=>(s-n)/(i-n);t.scale(this.pixelGroup,this.pixelGroup);for(let s=0;s<this.width;s++)for(let o=0;o<this.height;o++){const l=this.area[s+o*this.width];t.fillStyle=`rgba(0, 0, 0, ${a(l)})`,t.fillRect(s,o,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 i=0;i<this.width;i++)for(let a=0;a<this.height;a++){const s=this.area[i+a*this.width];t.fillStyle=s>e?"black":"white",t.fillRect(i,a,1,1)}t.restore()}}}function Yb(r,t){const e=n=>({x:n.x-t,y:n.y-t,width:n.width+2*t,height:n.height+2*t});return Array.isArray(r)?r.map(e):e(r)}function Hb(r,t,e){return Xb(Object.assign(Zb(r),{distSquare:(n,i)=>Xv(r.x1,r.y1,r.x2,r.y2,n,i)}),t,e)}function Xb(r,t,e){const n=Yb(r,e),i=t.scale(n),a=t.createSub(i,n);return F_(a,t,e,(s,o)=>r.distSquare(s,o)),a}function F_(r,t,e,n){const i=e*e;for(let a=0;a<r.height;a++)for(let s=0;s<r.width;s++){const o=t.invertScaleX(r.i+s),l=t.invertScaleY(r.j+a),c=n(o,l);if(c===0){r.set(s,a,i);continue}if(c<i){const u=e-Math.sqrt(c);r.set(s,a,u*u)}}return r}function z_(r,t,e){const n=t.scale(r),i=t.addPadding(n,e),a=t.createSub(i,{x:r.x-e,y:r.y-e}),s=n.x-i.x,o=n.y-i.y,l=i.x2-n.x2,c=i.y2-n.y2,u=i.width-s-l,h=i.height-o-c,d=e*e;a.fillArea({x:s,y:o,width:u+1,height:h+1},d);const f=[0],v=Math.max(o,s,l,c);{const b=t.invertScaleX(n.x+n.width/2);for(let E=1;E<v;E++){const O=t.invertScaleY(n.y-E),k=r.distSquare(b,O);if(k<d){const P=e-Math.sqrt(k);f.push(P*P)}else break}}const g=[],p=Math.max(s,l),y=Math.max(o,l);for(let b=1;b<p;b++){const E=t.invertScaleX(n.x-b),O=[];for(let k=1;k<y;k++){const P=t.invertScaleY(n.y-k),F=r.distSquare(E,P);if(F<d){const B=e-Math.sqrt(F);O.push(B*B)}else O.push(0)}g.push(O)}for(let b=1;b<Math.min(o,f.length);b++){const E=f[b];a.fillHorizontalLine(s,o-b,u+1,E)}for(let b=1;b<Math.min(c,f.length);b++){const E=f[b];a.fillHorizontalLine(s,o+h+b,u+1,E)}for(let b=1;b<Math.min(s,f.length);b++){const E=f[b];a.fillVerticalLine(s-b,o,h+1,E)}for(let b=1;b<Math.min(c,f.length);b++){const E=f[b];a.fillVerticalLine(s+u+b,o,h+1,E)}for(let b=1;b<s;b++){const E=g[b-1],O=s-b;for(let k=1;k<o;k++)a.set(O,o-k,E[k-1]);for(let k=1;k<c;k++)a.set(O,o+h+k,E[k-1])}for(let b=1;b<l;b++){const E=g[b-1],O=s+u+b;for(let k=1;k<o;k++)a.set(O,o-k,E[k-1]);for(let k=1;k<c;k++)a.set(O,o+h+k,E[k-1])}return a}function hj(r,t,e,n){return{x:r,y:t,width:e,height:n}}function dj(r,t,e){return{cx:r,cy:t,radius:e}}function fj(r,t,e,n){return{x1:r,y1:t,x2:e,y2:n}}function Tn(r,t){return{x:r,y:t}}function j_(r,t,e,n){if(r.length===0)return[];const i=U_(r);return i.map((a,s)=>{const o=i.slice(0,s);return G_(t,a,o,e,n)}).flat()}function G_(r,t,e,n,i){const a=Tn(t.cx,t.cy),s=V_(a,e,r);if(s==null)return[];const o=new vr(a.x,a.y,s.cx,s.cy),l=W_(o,r,n,i);return Z_(l,r)}function W_(r,t,e,n){const i=[],a=[];a.push(r);let s=!0;for(let o=0;o<e&&s;o++)for(s=!1;!s&&a.length>0;){const l=a.pop(),c=Kb(t,l),u=c?I_(l,c):null;if(!c||!u||u.count!==2){s||i.push(l);continue}let h=n,d=xh(c,h,u,!0),f=es(d,a)||es(d,i),v=bh(d,t);for(;!f&&v&&h>=1;)h/=1.5,d=xh(c,h,u,!0),f=es(d,a)||es(d,i),v=bh(d,t);if(d&&!f&&!v&&(a.push(new vr(l.x1,l.y1,d.x,d.y)),a.push(new vr(d.x,d.y,l.x2,l.y2)),s=!0),s)continue;h=n,d=xh(c,h,u,!1);let g=es(d,a)||es(d,i);for(v=bh(d,t);!g&&v&&h>=1;)h/=1.5,d=xh(c,h,u,!1),g=es(d,a)||es(d,i),v=bh(d,t);d&&!g&&(a.push(new vr(l.x1,l.y1,d.x,d.y)),a.push(new vr(d.x,d.y,l.x2,l.y2)),s=!0),s||i.push(l)}for(;a.length>0;)i.push(a.pop());return i}function Z_(r,t){const e=[];for(;r.length>0;){const n=r.pop();if(r.length===0){e.push(n);break}const i=r.pop(),a=new vr(n.x1,n.y1,i.x2,i.y2);Kb(t,a)?(e.push(n),r.push(i)):r.push(a)}return e}function V_(r,t,e){let n=Number.POSITIVE_INFINITY;return t.reduce((i,a)=>{const s=ts(r.x,r.y,a.cx,a.cy);if(s>n)return i;const o=new vr(r.x,r.y,a.cx,a.cy),l=Y_(e,o);return s*(l+1)*(l+1)<n&&(i=a,n=s*(l+1)*(l+1)),i},null)}function U_(r){if(r.length<2)return r;let t=0,e=0;return r.forEach(n=>{t+=n.cx,e+=n.cy}),t/=r.length,e/=r.length,r.map(n=>{const i=t-n.cx,a=e-n.cy,s=i*i+a*a;return[n,s]}).sort((n,i)=>n[1]-i[1]).map(n=>n[0])}function bh(r,t){return t.some(e=>e.containsPt(r.x,r.y))}function es(r,t){return t.some(e=>!!(Wb(e.x1,e.y1,r.x,r.y,.001)||Wb(e.x2,e.y2,r.x,r.y,.001)))}function Kb(r,t){let e=Number.POSITIVE_INFINITY,n=null;for(const i of r){if(!Ub(i,t))continue;const a=D_(i,t);a>=0&&a<e&&(n=i,e=a)}return n}function Y_(r,t){return r.reduce((e,n)=>Ub(n,t)&&__(n,t)?e+1:e,0)}function xh(r,t,e,n){const i=e.top,a=e.left,s=e.bottom,o=e.right;if(n){if(a.state===In.POINT){if(i.state===In.POINT)return Tn(r.x-t,r.y-t);if(s.state===In.POINT)return Tn(r.x-t,r.y2+t);const d=r.width*r.height;return r.width*((a.y-r.y+(o.y-r.y))*.5)<d*.5?a.y>o.y?Tn(r.x-t,r.y-t):Tn(r.x2+t,r.y-t):a.y<o.y?Tn(r.x-t,r.y2+t):Tn(r.x2+t,r.y2+t)}if(o.state===In.POINT){if(i.state===In.POINT)return Tn(r.x2+t,r.y-t);if(s.state===In.POINT)return Tn(r.x2+t,r.y2+t)}const u=r.height*r.width;return r.height*((i.x-r.x+(o.x-r.x))*.5)<u*.5?i.x>s.x?Tn(r.x-t,r.y-t):Tn(r.x-t,r.y2+t):i.x<s.x?Tn(r.x2+t,r.y-t):Tn(r.x2+t,r.y2+t)}if(a.state===In.POINT){if(i.state===In.POINT)return Tn(r.x2+t,r.y2+t);if(s.state===In.POINT)return Tn(r.x2+t,r.y-t);const u=r.height*r.width;return r.width*((a.y-r.y+(o.y-r.y))*.5)<u*.5?a.y>o.y?Tn(r.x2+t,r.y2+t):Tn(r.x-t,r.y2+t):a.y<o.y?Tn(r.x2+t,r.y-t):Tn(r.x-t,r.y-t)}if(o.state===In.POINT){if(i.state===In.POINT)return Tn(r.x-t,r.y2+t);if(s.state===In.POINT)return Tn(r.x-t,r.y-t)}const l=r.height*r.width;return r.height*((i.x-r.x+(o.x-r.x))*.5)<l*.5?i.x>s.x?Tn(r.x2+t,r.y2+t):Tn(r.x2+t,r.y-t):i.x<s.x?Tn(r.x-t,r.y2+t):Tn(r.x-t,r.y-t)}function H_(r,t,e,n){if(!(r.closed?e<r.length:e<r.length-1))return!1;const a=r.get(t),s=r.get(e+1);for(let o=t+1;o<=e;o++){const l=r.get(o);if(Xv(a.x,a.y,s.x,s.y,l.x,l.y)>n)return!1}return!0}function X_(r=0){return t=>{if(r<0||t.length<3)return t;const e=[];let n=0;const i=r*r;for(;n<t.length;){let a=n+1;for(;H_(t,n,a,i);)a++;e.push(t.get(n)),n=a}return new Us(e)}}function K_(r,t){switch(r){case-2:return(((-t+3)*t-3)*t+1)/6;case-1:return((3*t-6)*t*t+4)/6;case 0:return(((-3*t+3)*t+3)*t+1)/6;case 1:return t*t*t/6;default:throw new Error("unknown error")}}function Q_(r=6){function a(s,o,l){let c=0,u=0;for(let h=-2;h<=1;h++){const d=s.get(o+h),f=K_(h,l);c+=f*d.x,u+=f*d.y}return{x:c,y:u}}return s=>{if(s.length<3)return s;const o=[],l=s.closed,c=s.length+3-1+(l?0:2);o.push(a(s,2-(l?0:2),0));for(let u=2-(l?0:2);u<c;u++)for(let h=1;h<=r;h++)o.push(a(s,u,h/r));return new Us(o)}}function q_(r=8){return t=>{let e=r,n=t.length;if(e>1)for(n=Math.floor(t.length/e);n<3&&e>1;)e-=1,n=Math.floor(t.length/e);const i=[];for(let a=0,s=0;s<n;s++,a+=e)i.push(t.get(a));return new Us(i)}}class Us{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(e.length===0)return"";const n=typeof t=="function"?t:L_(t);let i="M";for(const a of e)i+=`${n(a.x)},${n(a.y)} L`;return i=i.slice(0,-1),this.closed&&(i+=" Z"),i}draw(t){const e=this.points;if(e.length!==0){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 q_(t)(this)}simplify(t){return X_(t)(this)}bSplines(t){return Q_(t)(this)}apply(t){return t(this)}containsElements(t){const e=B_(this.points);return e?t.every(n=>e.containsPt(n.cx,n.cy)&&this.withinArea(n.cx,n.cy)):!1}withinArea(t,e){if(this.length===0)return!1;let n=0;const i=this.points[0],a=new vr(i.x,i.y,i.x,i.y);for(let s=1;s<this.points.length;s++){const o=this.points[s];a.x1=a.x2,a.y1=a.y2,a.x2=o.x,a.y2=o.y,a.cuts(t,e)&&n++}return a.x1=a.x2,a.y1=a.y2,a.x2=i.x,a.y2=i.y,a.cuts(t,e)&&n++,n%2===1}}class J_{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(this.count===0)return!1;const e=this.arr[0];return e!=null&&e.x===t.x&&e.y===t.y}path(){return new Us(this.arr.slice(0,this.count))}clear(){this.set.clear(),this.count=0}get(t){return this.arr[t]}get length(){return this.count}}const Fl=0,Eh=1,wh=2,Qv=3;function $_(r,t){const e=(Math.floor(r.width)+Math.floor(r.height))*2,n=new J_(e);function i(l,c,u,h){const d=r.get(l,c);return Number.isNaN(d)?Number.NaN:d>t?u+h:u}function a(l,c){let u=Fl;return u=i(l,c,u,1),u=i(l+1,c,u,2),u=i(l,c+1,u,4),u=i(l+1,c+1,u,8),Number.isNaN(u)?-1:u}let s=Eh;function o(l,c){let u=l,h=c,d=r.invertScaleX(u),f=r.invertScaleY(h);for(let v=0;v<r.width*r.height;v++){const g={x:d,y:f};if(n.contains(g)){if(n.isFirst(g))return!0}else n.add(g);const p=a(u,h);switch(p){case-1:return!0;case 0:case 3:case 2:case 7:s=wh;break;case 12:case 14:case 4:s=Qv;break;case 6:s=s===Fl?Qv:wh;break;case 1:case 13:case 5:s=Fl;break;case 9:s=s===wh?Fl:Eh;break;case 10:case 8:case 11:s=Eh;break;default:return console.warn("Marching squares invalid state: "+p),!0}switch(s){case Fl:h--,f-=r.pixelGroup;break;case Eh:h++,f+=r.pixelGroup;break;case Qv:u--,d-=r.pixelGroup;break;case wh:u++,d+=r.pixelGroup;break;default:return console.warn("Marching squares invalid state: "+p),!0}}return!0}for(let l=0;l<r.width;l++)for(let c=0;c<r.height;c++){if(r.get(l,c)<=t)continue;const u=a(l,c);if(!(u<0||u===15)&&o(l,c))return n.path()}return null}const Sh={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 zl(r){return r!=null&&typeof r.radius=="number"}function Qb(r,t){if(zl(r)!==zl(t))return!1;if(zl(r)){const n=t;return r.cx===n.cx&&r.cy===n.cy&&r.radius===n.radius}const e=t;return r.x===e.x&&r.y===e.y&&r.width===e.width&&r.height===e.height}var Yi;(function(r){r[r.MEMBERS=0]="MEMBERS",r[r.NON_MEMBERS=1]="NON_MEMBERS",r[r.EDGES=2]="EDGES"})(Yi||(Yi={}));class qv{constructor(t={}){this.dirty=new Set,this.members=[],this.nonMembers=[],this.virtualEdges=[],this.edges=[],this.activeRegion=new Rr(0,0,0,0),this.potentialArea=new Vs(1,0,0,0,0,0,0),this.o=Object.assign({},Sh,t)}pushMember(...t){if(t.length!==0){this.dirty.add(Yi.MEMBERS);for(const e of t)this.members.push({raw:e,obj:zl(e)?yh.from(e):Rr.from(e),area:null})}}removeMember(t){const e=this.members.findIndex(n=>Qb(n.raw,t));return e<0?!1:(this.members.splice(e,1),this.dirty.add(Yi.MEMBERS),!0)}removeNonMember(t){const e=this.nonMembers.findIndex(n=>Qb(n.raw,t));return e<0?!1:(this.nonMembers.splice(e,1),this.dirty.add(Yi.NON_MEMBERS),!0)}removeEdge(t){const e=this.edges.findIndex(n=>n.obj.equals(t));return e<0?!1:(this.edges.splice(e,1),this.dirty.add(Yi.NON_MEMBERS),!0)}pushNonMember(...t){if(t.length!==0){this.dirty.add(Yi.NON_MEMBERS);for(const e of t)this.nonMembers.push({raw:e,obj:zl(e)?yh.from(e):Rr.from(e),area:null})}}pushEdge(...t){if(t.length!==0){this.dirty.add(Yi.EDGES);for(const e of t)this.edges.push({raw:e,obj:vr.from(e),area:null})}}update(){const t=this.dirty.has(Yi.MEMBERS),e=this.dirty.has(Yi.NON_MEMBERS);let n=this.dirty.has(Yi.EDGES);this.dirty.clear();const i=this.members.map(c=>c.obj);if(this.o.virtualEdges&&(t||e)){const c=this.nonMembers.map(d=>d.obj),u=j_(i,c,this.o.maxRoutingIterations,this.o.morphBuffer),h=new Map(this.virtualEdges.map(d=>[d.obj.toString(),d.area]));this.virtualEdges=u.map(d=>{var f;return{raw:d,obj:d,area:(f=h.get(d.toString()))!==null&&f!==void 0?f:null}}),n=!0}let a=!1;if(t||n){const c=this.virtualEdges.concat(this.edges).map(f=>f.obj),u=eD(i,c),h=Math.max(this.o.edgeR1,this.o.nodeR1)+this.o.morphBuffer,d=Rr.from(Yb(u,h));d.equals(this.activeRegion)||(a=!0,this.activeRegion=d)}if(a){const c=Math.ceil(this.activeRegion.width/this.o.pixelGroup),u=Math.ceil(this.activeRegion.height/this.o.pixelGroup);this.activeRegion.x!==this.potentialArea.pixelX||this.activeRegion.y!==this.potentialArea.pixelY?(this.potentialArea=Vs.fromPixelRegion(this.activeRegion,this.o.pixelGroup),this.members.forEach(h=>h.area=null),this.nonMembers.forEach(h=>h.area=null),this.edges.forEach(h=>h.area=null),this.virtualEdges.forEach(h=>h.area=null)):(c!==this.potentialArea.width||u!==this.potentialArea.height)&&(this.potentialArea=Vs.fromPixelRegion(this.activeRegion,this.o.pixelGroup))}const s=new Map,o=c=>{if(c.area){const u=`${c.obj.width}x${c.obj.height}x${c.obj instanceof Rr?"R":"C"}`;s.set(u,c.area)}},l=c=>{if(c.area)return;const u=`${c.obj.width}x${c.obj.height}x${c.obj instanceof Rr?"R":"C"}`;if(s.has(u)){const d=s.get(u);c.area=this.potentialArea.copy(d,{x:c.obj.x-this.o.nodeR1,y:c.obj.y-this.o.nodeR1});return}const h=c.obj instanceof Rr?z_(c.obj,this.potentialArea,this.o.nodeR1):Xb(c.obj,this.potentialArea,this.o.nodeR1);c.area=h,s.set(u,h)};this.members.forEach(o),this.nonMembers.forEach(o),this.members.forEach(l),this.nonMembers.forEach(c=>{this.activeRegion.intersects(c.obj)?l(c):c.area=null}),this.edges.forEach(c=>{c.area||(c.area=Hb(c.obj,this.potentialArea,this.o.edgeR1))}),this.virtualEdges.forEach(c=>{c.area||(c.area=Hb(c.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(this.members.length===0)return new Us([]);this.dirty.size>0&&this.update();const{o:t,potentialArea:e}=this,n=this.members.map(o=>o.area),i=this.virtualEdges.concat(this.edges).map(o=>o.area),a=this.nonMembers.filter(o=>o.area!=null).map(o=>o.area),s=this.members.map(o=>o.obj);return tD(e,n,i,a,o=>o.containsElements(s),t)}}function tD(r,t,e,n,i,a={}){const s=Object.assign({},Sh,a);let o=s.threshold,l=s.memberInfluenceFactor,c=s.edgeInfluenceFactor,u=s.nonMemberInfluenceFactor;const h=(s.nodeR0-s.nodeR1)*(s.nodeR0-s.nodeR1),d=(s.edgeR0-s.edgeR1)*(s.edgeR0-s.edgeR1);for(let f=0;f<s.maxMarchingIterations;f++){if(r.clear(),l!==0){const g=l/h;for(const p of t)r.incArea(p,g)}if(c!==0){const g=c/d;for(const p of e)r.incArea(p,g)}if(u!==0){const g=u/h;for(const p of n)r.incArea(p,g)}const v=$_(r,o);if(v&&i(v))return v;if(o*=.95,f<=s.maxMarchingIterations*.5)l*=1.2,c*=1.2;else if(u!==0&&n.length>0)u*=.8;else break}return new Us([])}function eD(r,t){if(r.length===0)return new Rr(0,0,0,0);const e=Rr.from(r[0]);for(const n of r)e.add(n);for(const n of t)e.add(Zb(n));return e}function vj(r,t=[],e=[],n={}){if(r.length===0)return new Us([]);const i=new qv(n);return i.pushMember(...r),i.pushNonMember(...t),i.pushEdge(...e),i.compute()}var nD=function(r,t){var e={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&t.indexOf(n)<0&&(e[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(e[n[i]]=r[n[i]]);return e};class Mh extends fr{constructor(t,e){super(t,xr({},Mh.defaultOptions,e)),this.members=new Map,this.avoidMembers=new Map,this.bubbleSetOptions={},this.drawBubbleSets=()=>{const{style:n,bubbleSetOptions:i}=this.parseOptions();Wn(this.bubbleSetOptions,i)||this.init(),this.bubbleSetOptions=Object.assign({},i);const a=Object.assign(Object.assign({},n),{d:this.getPath()});this.shape?this.shape.update(a):(this.shape=new Cl({style:a}),this.context.canvas.appendChild(this.shape))},this.updateBubbleSetsPath=n=>{if(!this.shape)return;const i=At(n.data);[...this.options.members,...this.options.avoidMembers].includes(i)&&this.shape.update(Object.assign(Object.assign({},this.parseOptions().style),{d:this.getPath(i)}))},this.getPath=n=>{const{graph:i}=this.context,a=this.options.members,s=[...this.members.keys()],o=this.options.avoidMembers,l=[...this.avoidMembers.keys()];if(!n&&Wn(a,s)&&Wn(o,l))return this.path;const{enter:c=[],exit:u=[]}=Ua(s,a,p=>p),{enter:h=[],exit:d=[]}=Ua(l,o,p=>p);n&&(u.push(n),c.push(n));const f=(p,y,b)=>{p.forEach(E=>{const O=b?this.members:this.avoidMembers,k=b?"pushMember":"pushNonMember",P=b?"removeMember":"removeNonMember";if(y){let F;i.getElementType(E)==="edge"?([F]=iD(i,E),this.bubbleSets.pushEdge(F)):([F]=rD(i,E),this.bubbleSets[k](F)),O.set(E,F)}else{const F=O.get(E);F&&(i.getElementType(E)==="edge"?this.bubbleSets.removeEdge(F):this.bubbleSets[P](F),O.delete(E))}})};f(u,!1,!0),f(c,!0,!0),f(d,!1,!1),f(h,!0,!1);const g=this.bubbleSets.compute().sample(8).simplify(0).bSplines().simplify(0);return this.path=Jy(g.points.map(Er)),this.path},this.bindEvents(),this.bubbleSets=new qv(this.options)}bindEvents(){this.context.graph.on(Xt.AFTER_RENDER,this.drawBubbleSets),this.context.graph.on(Xt.AFTER_ELEMENT_UPDATE,this.updateBubbleSetsPath)}init(){this.bubbleSets=new qv(this.options),this.members=new Map,this.avoidMembers=new Map}parseOptions(){const t=this.options,{type:e,key:n,members:i,avoidMembers:a}=t,s=nD(t,["type","key","members","avoidMembers"]),o=Object.keys(s).reduce((l,c)=>(c in Sh?l.bubbleSetOptions[c]=s[c]:l.style[c]=s[c],l),{style:{},bubbleSetOptions:{}});return Object.assign({type:e,key:n,members:i,avoidMembers:a},o)}addMember(t){const e=Array.isArray(t)?t:[t];e.some(n=>this.options.avoidMembers.includes(n))&&(this.options.avoidMembers=this.options.avoidMembers.filter(n=>!e.includes(n))),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(n=>!e.includes(n)),this.drawBubbleSets()}updateMember(t){this.options.members=ue(t)?t(this.options.members):t,this.drawBubbleSets()}getMember(){return this.options.members}addAvoidMember(t){const e=Array.isArray(t)?t:[t];e.some(n=>this.options.members.includes(n))&&(this.options.members=this.options.members.filter(n=>!e.includes(n))),this.options.avoidMembers=[...new Set([...this.options.avoidMembers,...e])],this.drawBubbleSets()}removeAvoidMember(t){const e=Array.isArray(t)?t:[t];this.options.avoidMembers.some(n=>e.includes(n))&&(this.options.avoidMembers=this.options.avoidMembers.filter(n=>!e.includes(n)),this.drawBubbleSets())}updateAvoidMember(t){this.options.avoidMembers=Array.isArray(t)?t:[t],this.drawBubbleSets()}getAvoidMember(){return this.options.avoidMembers}destroy(){this.context.graph.off(Xt.AFTER_RENDER,this.drawBubbleSets),this.context.graph.off(Xt.AFTER_ELEMENT_UPDATE,this.updateBubbleSetsPath),this.shape.destroy(),super.destroy()}}Mh.defaultOptions=Object.assign({members:[],avoidMembers:[],fill:"lightblue",fillOpacity:.2,stroke:"blue",strokeOpacity:.2},Sh);const rD=(r,t)=>(Array.isArray(t)?t:[t]).map(n=>{const i=r.getElementRenderBounds(n);return new Rr(i.min[0],i.min[1],oa(i),la(i))}),iD=(r,t)=>(Array.isArray(t)?t:[t]).map(n=>{const i=r.getEdgeData(n),a=r.getElementPosition(i.source),s=r.getElementPosition(i.target);return vr.from({x1:a[0],y1:a[1],x2:s[0],y2:s[1]})});class gj extends null{constructor(t,e){super(t,e),this.setOptions=n=>{const i={cameraType:"setType",near:"setNear",far:"setFar",fov:"setFov",aspect:"setAspect",projectionMode:"setProjectionMode",distance:"setDistance",minDistance:"setMinDistance",maxDistance:"setMaxDistance",roll:"setRoll",elevation:"setElevation",azimuth:"setAzimuth"},a=(s,o)=>{switch(s){case"projectionMode":return o==="perspective"?1:0;case"cameraType":return{orbiting:0,exploring:1,tracking:2}[o];case"aspect":return typeof o=="number"?o:this.getCanvasAspect();default:return o}};Object.entries(i).forEach(([s,o])=>{const l=n[s];if(l!==void 0){const c=a(s,l);this.context.canvas.getCamera()[o](c)}})},this.bindEvents()}update(t){this.setOptions(t),super.update(t)}bindEvents(){this.context.graph.once(GraphEvent.BEFORE_DRAW,()=>this.setOptions(this.options))}getCanvasAspect(){const[t,e]=this.context.viewport.getCanvasSize();return t/e}}function aD(r){return`
|
|
|
<ul class="g6-contextmenu-ul">
|
|
|
${r.map(t=>`<li class="g6-contextmenu-li" value="${t.value}">${t.name}</li>`).join("")}
|
|
|
</ul>
|
|
|
`}const sD=`
|
|
|
.g6-contextmenu {
|
|
|
font-size: 12px;
|
|
|
background-color: rgba(255, 255, 255, 0.96);
|
|
|
border-radius: 4px;
|
|
|
overflow: hidden;
|
|
|
box-shadow: rgba(0, 0, 0, 0.12) 0px 6px 12px 0px;
|
|
|
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;
|
|
|
}
|
|
|
|
|
|
.g6-contextmenu-ul {
|
|
|
max-width: 256px;
|
|
|
min-width: 96px;
|
|
|
list-style: none;
|
|
|
padding: 0;
|
|
|
margin: 0;
|
|
|
}
|
|
|
|
|
|
.g6-contextmenu-li {
|
|
|
padding: 8px 12px;
|
|
|
cursor: pointer;
|
|
|
user-select: none;
|
|
|
}
|
|
|
|
|
|
.g6-contextmenu-li:hover {
|
|
|
background-color: #f5f5f5;
|
|
|
cursor: pointer;
|
|
|
}
|
|
|
`;var qb=function(r,t,e,n){function i(a){return a instanceof e?a:new e(function(s){s(a)})}return new(e||(e=Promise))(function(a,s){function o(u){try{c(n.next(u))}catch(h){s(h)}}function l(u){try{c(n.throw(u))}catch(h){s(h)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((n=n.apply(r,t||[])).next())})};class Ah extends fr{constructor(t,e){super(t,Object.assign({},Ah.defaultOptions,e)),this.targetElement=null,this.onTriggerEvent=n=>{var i;(i=n.preventDefault)===null||i===void 0||i.call(n),this.show(n)},this.onMenuItemClick=n=>{const{onClick:i,trigger:a}=this.options;if(n.target instanceof HTMLElement&&n.target.className.includes("g6-contextmenu-li")){const s=n.target.getAttribute("value");i==null||i(s,n.target,this.targetElement),this.hide()}a!=="click"&&this.hide()},this.initElement(),this.update(e)}initElement(){this.$element=Co("contextmenu",!1,{zIndex:"99"});const{className:t}=this.options;t&&this.$element.classList.add(t),this.context.canvas.getContainer().appendChild(this.$element),Hv("g6-contextmenu-css","style",{},sD,document.head)}show(t){return qb(this,void 0,void 0,function*(){const{enable:e,offset:n}=this.options;if(typeof e=="function"&&!e(t)||!e){this.hide();return}const i=yield this.getDOMContent(t);i instanceof HTMLElement?(this.$element.innerHTML="",this.$element.appendChild(i)):this.$element.innerHTML=i;const a=this.context.graph.getCanvas().getContainer().getBoundingClientRect();this.$element.style.left=`${t.client.x-a.left+n[0]}px`,this.$element.style.top=`${t.client.y-a.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 qb(this,void 0,void 0,function*(){const{getContent:e,getItems:n}=this.options;return n?aD(yield n(t)):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)}}Ah.defaultOptions={trigger:"contextmenu",offset:[4,4],loadingContent:'<div class="g6-contextmenu-loading">Loading...</div>',getContent:()=>"It is a empty context menu.",enable:()=>!0};class Th extends fr{constructor(t,e){super(t,Object.assign({},Th.defaultOptions,e)),this.edgeBundles={},this.edgePoints={},this.onBundle=()=>{const{model:n,element:i}=this.context,a=n.getEdgeData();this.divideEdges(this.options.divisions);const{cycles:s,iterRate:o,divRate:l}=this.options;let{lambda:c,divisions:u,iterations:h}=this.options;for(let d=0;d<s;d++){for(let f=0;f<h;f++){const v={};a.forEach(g=>{var p;if(g.source===g.target)return;const y=At(g);v[y]=this.getEdgeForces(g,u,c);for(let b=0;b<u+1;b++)(p=this.edgePoints)[y]||(p[y]=[]),this.edgePoints[y][b]=Le(this.edgePoints[y][b],v[y][b])})}c/=2,u*=l,h*=o,this.divideEdges(u)}a.forEach(d=>{const f=At(d),v=i.getElement(f);v==null||v.update({d:pv(this.edgePoints[f])})})},this.bindEvents()}get nodeMap(){const t=this.context.model.getNodeData();return Object.fromEntries(t.map(e=>[At(e),_s(sr(e))]))}divideEdges(t){this.context.model.getEdgeData().forEach(n=>{var i;const a=At(n);(i=this.edgePoints)[a]||(i[a]=[]);const s=this.nodeMap[n.source],o=this.nodeMap[n.target];if(t===1)this.edgePoints[a].push(s),this.edgePoints[a].push(Zi(Le(s,o),2)),this.edgePoints[a].push(o);else{const c=(this.edgePoints[a].length===0?En(s,o):hD(this.edgePoints[a]))/(t+1);let u=c;const h=[s];for(let d=1;d<this.edgePoints[a].length;d++){const f=this.edgePoints[a][d-1],v=this.edgePoints[a][d];let g=En(v,f);for(;g>u;){const p=u/g,y=Le(f,Wi(dn(v,f),p));h.push(y),g-=u,u=c}u-=g}h.push(o),this.edgePoints[a]=h}})}getVectorPosition(t){const e=this.nodeMap[t.source],n=this.nodeMap[t.target],[i,a]=dn(n,e),s=En(e,n);return{source:e,target:n,vx:i,vy:a,length:s}}measureEdgeCompatibility(t,e){const n=this.getVectorPosition(t),i=this.getVectorPosition(e),a=oD(n,i),s=lD(n,i),o=cD(n,i),l=uD(n,i);return a*s*o*l}getEdgeBundles(){const t={},e=this.options.bundleThreshold,n=this.context.model.getEdgeData();return n.forEach((i,a)=>{n.forEach((s,o)=>{var l,c;if(o<=a)return;this.measureEdgeCompatibility(i,s)>=e&&(t[l=At(i)]||(t[l]=[]),t[At(i)].push(s),t[c=At(s)]||(t[c]=[]),t[At(s)].push(i))})}),t}getSpringForce(t,e){const{pre:n,cur:i,next:a}=t;return Wi(dn(Le(n,a),Wi(i,2)),e)}getElectrostaticForce(t,e){ua(this.edgeBundles)&&(this.edgeBundles=this.getEdgeBundles());const n=this.edgeBundles[At(e)];let i=[0,0];return n==null||n.forEach(a=>{const s=this.edgePoints[At(a)][t],o=this.edgePoints[At(e)][t],l=dn(s,o),c=En(s,o);i=Le(i,Wi(l,1/c))}),i}getEdgeForces(t,e,n){const i=this.nodeMap[t.source],a=this.nodeMap[t.target],s=this.options.K/(En(i,a)*(e+1)),o=[[0,0]],l=At(t);for(let c=1;c<e;c++){const u=this.getSpringForce({pre:this.edgePoints[l][c-1],cur:this.edgePoints[l][c],next:this.edgePoints[l][c+1]||[0,0]},s),h=this.getElectrostaticForce(c,t);o.push(Wi(Le(u,h),n))}return o.push([0,0]),o}bindEvents(){const{graph:t}=this.context;t.on(Xt.AFTER_RENDER,this.onBundle)}unbindEvents(){const{graph:t}=this.context;t.off(Xt.AFTER_RENDER,this.onBundle)}destroy(){this.unbindEvents(),super.destroy()}}Th.defaultOptions={K:.1,lambda:.1,divisions:1,divRate:2,cycles:6,iterations:90,iterRate:2/3,bundleThreshold:.6};const oD=(r,t)=>Math.abs(kN([r.vx,r.vy],[t.vx,t.vy])/(r.length*t.length)),lD=(r,t)=>{const e=(r.length+t.length)/2;return 2/(e/Math.min(r.length,t.length)+Math.max(r.length,t.length)/e)},cD=(r,t)=>{const e=(r.length+t.length)/2,n=Zi(Le(r.source,r.target),2),i=Zi(Le(t.source,t.target),2);return e/(e+En(n,i))},Jb=(r,t)=>{if(t.source[0]===t.target[0])return[t.source[0],r[1]];if(t.source[1]===t.target[1])return[r[0],t.source[1]];const e=(t.source[1]-t.target[1])/(t.source[0]-t.target[0]),n=(e*e*t.source[0]+e*(r[1]-t.source[1])+r[0])/(e*e+1),i=e*(n-t.source[0])+t.source[1];return[n,i]},$b=(r,t)=>{const e=Jb(t.source,r),n=Jb(t.target,r),i=Zi(Le(e,n),2),a=Zi(Le(r.source,r.target),2);return En(e,n)===0?0:Math.max(0,1-2*En(a,i)/En(e,n))},uD=(r,t)=>Math.min($b(r,t),$b(t,r)),hD=r=>{let t=0;for(let e=1;e<r.length;e++)t+=En(r[e],r[e-1]);return t},dD={fill:"#fff",fillOpacity:1,lineWidth:1,stroke:"#000",strokeOpacity:.8,zIndex:-1/0},tx=.05;class Oh extends fr{constructor(t,e){super(t,Object.assign({},Oh.defaultOptions,e)),this.shapes=new Map,this.r=this.options.r,this.onEdgeFilter=n=>{if(this.options.trigger==="drag"&&this.isLensOn)return;const i=Er(n.canvas);this.renderLens(i),this.renderFocusElements()},this.renderLens=n=>{const i=Object.assign({},dD,this.options.style);this.isLensOn||(this.lens=new Bs({style:i}),this.canvas.appendChild(this.lens)),Object.assign(i,Vi(n),{size:this.r*2}),this.lens.update(i)},this.getFilterData=()=>{const{filter:n}=this.options,{model:i}=this.context,a=i.getData();if(!n)return a;const{nodes:s,edges:o,combos:l}=a;return{nodes:s.filter(c=>n(At(c),"node")),edges:o.filter(c=>n(At(c),"edge")),combos:l.filter(c=>n(At(c),"combo"))}},this.getFocusElements=n=>{const{nodes:i,edges:a}=this.getFilterData(),s=i.filter(c=>En(sr(c),n)<this.r),o=s.map(c=>At(c)),l=a.filter(c=>{const{source:u,target:h}=c,d=o.includes(u),f=o.includes(h);switch(this.options.nodeType){case"both":return d&&f;case"either":return d!==f;case"source":return d&&!f;case"target":return!d&&f;default:return!1}});return{nodes:s,edges:l}},this.renderFocusElements=()=>{const{element:n,graph:i}=this.context;if(!this.isLensOn)return;const a=this.lens.getCenter(),{nodes:s,edges:o}=this.getFocusElements(a),l=new Set,c=u=>{const h=At(u);l.add(h);const d=n.getElement(h);if(!d)return;const f=this.shapes.get(h)||d.cloneNode();f.setPosition(d.getPosition()),f.id=d.id,this.shapes.has(h)?Object.entries(d.attributes).forEach(([p,y])=>{f.style[p]!==y&&(f.style[p]=y)}):(this.canvas.appendChild(f),this.shapes.set(h,f));const v=i.getElementType(h),g=this.getElementStyle(v,u);f.update(g)};s.forEach(c),o.forEach(c),this.shapes.forEach((u,h)=>{l.has(h)||(u.destroy(),this.shapes.delete(h))})},this.scaleRByWheel=n=>{var i;this.options.preventDefault&&n.preventDefault();const{clientX:a,clientY:s,deltaX:o,deltaY:l}=n,{graph:c,canvas:u}=this.context,h=c.getCanvasByClient([a,s]),d=(i=this.lens)===null||i===void 0?void 0:i.getCenter();if(!this.isLensOn||En(h,d)>this.r)return;const{maxR:f,minR:v}=this.options,g=o+l>0?1/(1-tx):1-tx,p=Math.min(...u.getSize())/2;this.r=Math.max(v||0,Math.min(f||p,this.r*g)),this.renderLens(d),this.renderFocusElements()},this.isLensDragging=!1,this.onDragStart=n=>{var i;const a=Er(n.canvas),s=(i=this.lens)===null||i===void 0?void 0:i.getCenter();!this.isLensOn||En(a,s)>this.r||(this.isLensDragging=!0)},this.onDrag=n=>{if(!this.isLensDragging)return;const i=Er(n.canvas);this.renderLens(i),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=t==="node"?this.options.nodeStyle:this.options.edgeStyle;return typeof n=="function"?n(e):n}get graphDom(){return this.context.graph.getCanvas().getContextService().getDomElement()}bindEvents(){var t;const{graph:e}=this.context,{trigger:n,scaleRBy:i}=this.options,a=e.getCanvas().getLayer();["click","drag"].includes(n)&&a.addEventListener(It.CLICK,this.onEdgeFilter),n==="pointermove"?a.addEventListener(It.POINTER_MOVE,this.onEdgeFilter):n==="drag"&&(a.addEventListener(It.DRAG_START,this.onDragStart),a.addEventListener(It.DRAG,this.onDrag),a.addEventListener(It.DRAG_END,this.onDragEnd)),i==="wheel"&&((t=this.graphDom)===null||t===void 0||t.addEventListener(It.WHEEL,this.scaleRByWheel,{passive:!1}))}unbindEvents(){var t;const{graph:e}=this.context,{trigger:n,scaleRBy:i}=this.options,a=e.getCanvas().getLayer();["click","drag"].includes(n)&&a.removeEventListener(It.CLICK,this.onEdgeFilter),n==="pointermove"?a.removeEventListener(It.POINTER_MOVE,this.onEdgeFilter):n==="drag"&&(a.removeEventListener(It.DRAG_START,this.onDragStart),a.removeEventListener(It.DRAG,this.onDrag),a.removeEventListener(It.DRAG_END,this.onDragEnd)),i==="wheel"&&((t=this.graphDom)===null||t===void 0||t.removeEventListener(It.WHEEL,this.scaleRByWheel))}update(t){var e;this.unbindEvents(),super.update(t),this.r=(e=t.r)!==null&&e!==void 0?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()}}Oh.defaultOptions={trigger:"pointermove",r:60,nodeType:"both",filter:()=>!0,style:{lineWidth:2},nodeStyle:{label:!1},edgeStyle:{label:!0},scaleRBy:"wheel",preventDefault:!0};const fD={fill:"#ccc",fillOpacity:.1,lineWidth:2,stroke:"#000",strokeOpacity:.8,labelFontSize:12},ex=.05,nx=.1;class Ch extends fr{constructor(t,e){super(t,Object.assign({},Ch.defaultOptions,e)),this.r=this.options.r,this.d=this.options.d,this.onCreateFisheye=n=>{if(this.options.trigger==="drag"&&this.isLensOn)return;const i=Er(n.canvas);this.onMagnify(i)},this.onMagnify=n=>{n.some(isNaN)||(this.renderLens(n),this.renderFocusElements())},this.renderLens=n=>{const i=Object.assign({},fD,this.options.style);this.isLensOn||(this.lens=new Bs({style:i}),this.canvas.appendChild(this.lens)),Object.assign(i,Vi(n),{size:this.r*2,label:this.options.showDPercent,labelText:this.getDPercent()}),this.lens.update(i)},this.getDPercent=()=>{const{minD:n,maxD:i}=this.options;return`${Math.round((this.d-n)/(i-n)*100)}%`},this.prevMagnifiedStyleMap=new Map,this.prevOriginStyleMap=new Map,this.renderFocusElements=()=>{if(!this.isLensOn)return;const{graph:n}=this.context,i=this.lens.getCenter(),a=(this.d+1)*this.r,s=new Map,o=new Map;n.getNodeData().forEach(c=>{const u=sr(c),h=En(u,i);if(h>this.r)return;const d=a*h/(this.d*h+this.r),[f,v]=u,[g,p]=i,y=(f-g)/h,b=(v-p)/h,E=[g+d*y,p+d*b],O=At(c),k=this.getNodeStyle(c),P=zs(n.getElementRenderStyle(O),Object.keys(k));s.set(O,Object.assign(Object.assign({},Vi(E)),k)),o.set(O,Object.assign(Object.assign({},Vi(u)),P))}),this.updateStyle(s,o)},this.getNodeStyle=n=>{const{nodeStyle:i}=this.options;return typeof i=="function"?i(n):i},this.updateStyle=(n,i)=>{const{graph:a,element:s}=this.context,{enter:o,exit:l,keep:c}=Ua(Array.from(this.prevMagnifiedStyleMap.keys()),Array.from(n.keys()),d=>d),u=new Set,h=(d,f)=>{const v=s.getElement(d);v==null||v.update(f),a.getRelatedEdgesData(d).forEach(g=>{u.add(At(g))})};[...o,...c].forEach(d=>{h(d,n.get(d))}),l.forEach(d=>{h(d,this.prevOriginStyleMap.get(d)),this.prevOriginStyleMap.delete(d)}),u.forEach(d=>{const f=s.getElement(d);f==null||f.update({})}),this.prevMagnifiedStyleMap=n,i.forEach((d,f)=>{this.prevOriginStyleMap.has(f)||this.prevOriginStyleMap.set(f,d)})},this.isWheelValid=n=>{if(this.options.preventDefault&&n.preventDefault(),!this.isLensOn)return!1;const{clientX:i,clientY:a}=n,s=this.context.graph.getCanvasByClient([i,a]),o=this.lens.getCenter();return!(En(s,o)>this.r)},this.scaleR=n=>{const{maxR:i,minR:a}=this.options,s=n?1/(1-ex):1-ex,o=Math.min(...this.context.canvas.getSize())/2;this.r=Math.max(a||0,Math.min(i||o,this.r*s))},this.scaleD=n=>{const{maxD:i,minD:a}=this.options,s=n?this.d+nx:this.d-nx;this.d=Math.max(a,Math.min(i,s))},this.scaleRByWheel=n=>{if(!this.isWheelValid(n))return;const{deltaX:i,deltaY:a}=n;this.scaleR(i+a>0);const s=this.lens.getCenter();this.onMagnify(s)},this.scaleDByWheel=n=>{if(!this.isWheelValid(n))return;const{deltaX:i,deltaY:a}=n;this.scaleD(i+a>0);const s=this.lens.getCenter();this.onMagnify(s)},this.isDragValid=n=>{if(this.options.preventDefault&&n.preventDefault(),!this.isLensOn)return!1;const i=Er(n.canvas),a=this.lens.getCenter();return!(En(i,a)>this.r)},this.isLensDragging=!1,this.onDragStart=n=>{this.isDragValid(n)&&(this.isLensDragging=!0)},this.onDrag=n=>{if(!this.isLensDragging)return;const i=Er(n.canvas);this.onMagnify(i)},this.onDragEnd=()=>{this.isLensDragging=!1},this.scaleRByDrag=n=>{if(!this.isLensDragging)return;const{dx:i,dy:a}=n;this.scaleR(i-a>0);const s=this.lens.getCenter();this.onMagnify(s)},this.scaleDByDrag=n=>{if(!this.isLensDragging)return;const{dx:i,dy:a}=n;this.scaleD(i-a>0);const s=this.lens.getCenter();this.onMagnify(s)},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:i,scaleDBy:a}=this.options,s=e.getCanvas().getLayer();if(["click","drag"].includes(n)&&s.addEventListener(It.CLICK,this.onCreateFisheye),n==="pointermove"&&s.addEventListener(It.POINTER_MOVE,this.onCreateFisheye),n==="drag"||i==="drag"||a==="drag"){s.addEventListener(It.DRAG_START,this.onDragStart),s.addEventListener(It.DRAG_END,this.onDragEnd);const o=n==="drag"?this.onDrag:i==="drag"?this.scaleRByDrag:this.scaleDByDrag;s.addEventListener(It.DRAG,o)}if(i==="wheel"||a==="wheel"){const o=i==="wheel"?this.scaleRByWheel:this.scaleDByWheel;(t=this.graphDom)===null||t===void 0||t.addEventListener(It.WHEEL,o,{passive:!1})}}unbindEvents(){var t;const{graph:e}=this.context,{trigger:n,scaleRBy:i,scaleDBy:a}=this.options,s=e.getCanvas().getLayer();if(["click","drag"].includes(n)&&s.removeEventListener(It.CLICK,this.onCreateFisheye),n==="pointermove"&&s.removeEventListener(It.POINTER_MOVE,this.onCreateFisheye),n==="drag"||i==="drag"||a==="drag"){s.removeEventListener(It.DRAG_START,this.onDragStart),s.removeEventListener(It.DRAG_END,this.onDragEnd);const o=n==="drag"?this.onDrag:i==="drag"?this.scaleRByDrag:this.scaleDByDrag;s.removeEventListener(It.DRAG,o)}if(i==="wheel"||a==="wheel"){const o=i==="wheel"?this.scaleRByWheel:this.scaleDByWheel;(t=this.graphDom)===null||t===void 0||t.removeEventListener(It.WHEEL,o)}}update(t){var e,n;this.unbindEvents(),super.update(t),this.r=(e=t.r)!==null&&e!==void 0?e:this.r,this.d=(n=t.d)!==null&&n!==void 0?n:this.d,this.bindEvents()}destroy(){var t;this.unbindEvents(),this.isLensOn&&((t=this.lens)===null||t===void 0||t.destroy()),this.prevMagnifiedStyleMap.clear(),this.prevOriginStyleMap.clear(),super.destroy()}}Ch.defaultOptions={trigger:"pointermove",r:120,d:1.5,maxD:5,minD:0,showDPercent:!0,style:{},nodeStyle:{label:!0},preventDefault:!0};class Nh extends fr{constructor(t,e){super(t,Object.assign({},Nh.defaultOptions,e)),this.$el=this.context.canvas.getContainer(),this.graphSize=[0,0],this.onFullscreenChange=()=>{var n,i,a,s;const o=!!document.fullscreenElement;this.options.autoFit&&this.setGraphSize(o),o?(i=(n=this.options).onEnter)===null||i===void 0||i.call(n):(s=(a=this.options).onExit)===null||s===void 0||s.call(a)},this.shortcut=new xo(t.graph),this.bindEvents(),this.style=document.createElement("style"),document.head.appendChild(this.style),this.style.innerHTML=`
|
|
|
:not(:root):fullscreen::backdrop {
|
|
|
background: transparent;
|
|
|
}
|
|
|
`}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(i=>{document.addEventListener(i,this.onFullscreenChange,!1)})}unbindEvents(){this.shortcut.unbindAll(),["webkitfullscreenchange","mozfullscreenchange","fullscreenchange","MSFullscreenChange"].forEach(e=>{document.removeEventListener(e,this.onFullscreenChange,!1)})}setGraphSize(t=!0){var e,n;let i,a;t?(i=((e=globalThis.screen)===null||e===void 0?void 0:e.width)||0,a=((n=globalThis.screen)===null||n===void 0?void 0:n.height)||0,this.graphSize=this.context.graph.getSize()):[i,a]=this.graphSize,this.context.graph.setSize(i,a),this.context.graph.render()}request(){document.fullscreenElement||!vD()||this.$el.requestFullscreen().catch(t=>{ei.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()}}Nh.defaultOptions={trigger:{},autoFit:!0};function vD(){return document.fullscreenEnabled||Reflect.get(document,"webkitFullscreenEnabled")||Reflect.get(document,"mozFullscreenEnabled")||Reflect.get(document,"msFullscreenEnabled")}class kh extends fr{constructor(t,e){super(t,Object.assign({},kh.defaultOptions,e)),this.$element=Co("grid-line",!0),this.offset=[0,0],this.currentScale=1,this.followZoom=i=>{const{data:{scale:a,origin:s}}=i;if(!a||s===void 0&&this.context.viewport===void 0)return;const o=this.currentScale;this.currentScale=a;const l=a/o,c=Wi(s||this.context.graph.getCanvasCenter(),1-l),u=this.baseSize*a,h=Wi(this.offset,l),d=Kf(h,u),f=Le(d,c);this.$element.style.backgroundSize=`${u}px ${u}px`,this.$element.style.backgroundPosition=`${f[0]}px ${f[1]}px`,this.offset=Kf(f,u)},this.followTranslate=i=>{if(!this.options.follow)return;const{data:{translate:a}}=i;a&&this.updateOffset(a)},this.onTransform=i=>{const a=this.parseFollow(this.options.follow);a.zoom&&this.followZoom(i),a.translate&&this.followTranslate(i)},this.context.canvas.getContainer().prepend(this.$element),this.baseSize=this.options.size,this.updateStyle(),this.bindEvents()}update(t){super.update(t),t.size!==void 0&&(this.baseSize=t.size),this.updateStyle()}bindEvents(){const{graph:t}=this.context;t.on(Xt.AFTER_TRANSFORM,this.onTransform)}updateStyle(){const{stroke:t,lineWidth:e,border:n,borderLineWidth:i,borderStroke:a,borderStyle:s}=this.options,o=this.baseSize*this.currentScale;Object.assign(this.$element.style,{border:n?`${i}px ${s} ${a}`:"none",backgroundImage:`linear-gradient(${t} ${e}px, transparent ${e}px), linear-gradient(90deg, ${t} ${e}px, transparent ${e}px)`,backgroundSize:`${o}px ${o}px`,backgroundRepeat:"repeat"})}updateOffset(t){const e=this.baseSize*this.currentScale;this.offset=Kf(Le(this.offset,t),e),this.$element.style.backgroundPosition=`${this.offset[0]}px ${this.offset[1]}px`}parseFollow(t){var e,n;return qo(t)?{translate:t,zoom:t}:{translate:(e=t==null?void 0:t.translate)!==null&&e!==void 0?e:!1,zoom:(n=t==null?void 0:t.zoom)!==null&&n!==void 0?n:!1}}destroy(){this.context.graph.off(Xt.AFTER_TRANSFORM,this.onTransform),this.$element.remove(),super.destroy()}}kh.defaultOptions={border:!0,borderLineWidth:1,borderStroke:"#eee",borderStyle:"solid",lineWidth:1,size:20,stroke:"#eee"};function Jv(r){const t={Added:new Map,Updated:new Map,Removed:new Map};return r.forEach(e=>{const{type:n,value:i}=e,a=At(i);if(n==="NodeAdded"||n==="EdgeAdded"||n==="ComboAdded")t.Added.set(a,e);else if(n==="NodeUpdated"||n==="EdgeUpdated"||n==="ComboUpdated")if(t.Added.has(a))t.Added.set(a,{type:n.replace("Updated","Added"),value:i});else if(t.Updated.has(a)){const{original:s}=t.Updated.get(a);t.Updated.set(a,{type:n,value:i,original:s})}else t.Removed.has(a)||t.Updated.set(a,e);else(n==="NodeRemoved"||n==="EdgeRemoved"||n==="ComboRemoved")&&(t.Added.has(a)?t.Added.delete(a):(t.Updated.has(a)&&t.Updated.delete(a),t.Removed.set(a,e)))}),[...Array.from(t.Added.values()),...Array.from(t.Updated.values()),...Array.from(t.Removed.values())]}function rx(r){const{NodeAdded:t=[],NodeUpdated:e=[],NodeRemoved:n=[],EdgeAdded:i=[],EdgeUpdated:a=[],EdgeRemoved:s=[],ComboAdded:o=[],ComboUpdated:l=[],ComboRemoved:c=[]}=nu(r,u=>u.type);return{add:{nodes:t,edges:i,combos:o},update:{nodes:e,edges:a,combos:l},remove:{nodes:n,edges:s,combos:c}}}function ix(r,t){for(const e in r)zn(r[e])&&!Array.isArray(r[e])&&r[e]!==null?(t[e]||(t[e]={}),ix(r[e],t[e])):t[e]===void 0&&(t[e]=ml(e))}function gD(r,t=!1,e){const n={animation:t,current:{add:{},update:{},remove:{}},original:{add:{},update:{},remove:{}}},{add:i,update:a,remove:s}=rx(Jv(r));return["nodes","edges","combos"].forEach(o=>{a[o]&&a[o].forEach(l=>{var c,u;const h=Object.assign({},l.value);let d=Object.assign({},l.original);if(e){const f=e.graph.getElementType(At(l.original)),v=f==="edge"?"stroke":"fill",g=e.element.getElementComputedStyle(f,l.original);d=Object.assign(Object.assign({},l.original),{style:Object.assign({[v]:g[v]},l.original.style)})}ix(h,d),(c=n.current.update)[o]||(c[o]=[]),n.current.update[o].push(h),(u=n.original.update)[o]||(u[o]=[]),n.original.update[o].push(d)}),i[o]&&i[o].forEach(l=>{var c,u;const h=Object.assign({},l.value);(c=n.current.add)[o]||(c[o]=[]),n.current.add[o].push(h),(u=n.original.remove)[o]||(u[o]=[]),n.original.remove[o].push(h)}),s[o]&&s[o].forEach(l=>{var c,u;const h=Object.assign({},l.value);(c=n.current.remove)[o]||(c[o]=[]),n.current.remove[o].push(h),(u=n.original.add)[o]||(u[o]=[]),n.original.add[o].push(h)})}),n}class Ph extends fr{constructor(t,e){super(t,Object.assign({},Ph.defaultOptions,e)),this.batchChanges=null,this.batchAnimation=!1,this.undoStack=[],this.redoStack=[],this.freezed=!1,this.executeCommand=(i,a=!0)=>{var s,o,l;this.freezed=!0,(o=(s=this.options).executeCommand)===null||o===void 0||o.call(s,i);const c=a?i.original:i.current;this.context.graph.addData(c.add),this.context.graph.updateData(c.update),this.context.graph.removeData(My(c.remove,!1)),(l=this.context.element)===null||l===void 0||l.draw({silence:!0,animation:i.animation}),this.freezed=!1},this.addCommand=i=>{var a;if(!this.freezed){if(i.type===Xt.AFTER_DRAW){const{dataChanges:s=[],animation:o=!0}=i.data;if(!((a=this.context.batch)===null||a===void 0)&&a.isBatching){if(!this.batchChanges)return;this.batchChanges.push(s),this.batchAnimation&&(this.batchAnimation=o);return}this.batchChanges=[s],this.batchAnimation=o}this.undoStackPush(gD(this.batchChanges.flat(),this.batchAnimation,this.context)),this.notify(Ga.ADD,this.undoStack[this.undoStack.length-1])}},this.initBatchCommand=i=>{const{initiate:a}=i.data;this.batchAnimation=!1,a?this.batchChanges=[]:this.undoStack.pop()||(this.batchChanges=null)},this.emitter=new $u;const{graph:n}=this.context;n.on(Xt.AFTER_DRAW,this.addCommand),n.on(Xt.BATCH_START,this.initBatchCommand),n.on(Xt.BATCH_END,this.addCommand)}canUndo(){return this.undoStack.length>0}canRedo(){return this.redoStack.length>0}undo(){var t,e,n,i;const a=this.undoStack.pop();if(a){if(this.executeCommand(a),((e=(t=this.options).beforeAddCommand)===null||e===void 0?void 0:e.call(t,a,!1))===!1)return;this.redoStack.push(a),(i=(n=this.options).afterAddCommand)===null||i===void 0||i.call(n,a,!1),this.notify(Ga.UNDO,a)}return this}redo(){const t=this.redoStack.pop();return t&&(this.executeCommand(t,!1),this.undoStackPush(t),this.notify(Ga.REDO,t)),this}undoAndCancel(){const t=this.undoStack.pop();return t&&(this.executeCommand(t,!1),this.redoStack=[],this.notify(Ga.CANCEL,t)),this}undoStackPush(t){var e,n,i,a;const{stackSize:s}=this.options;s!==0&&this.undoStack.length>=s&&this.undoStack.shift(),((n=(e=this.options).beforeAddCommand)===null||n===void 0?void 0:n.call(e,t,!0))!==!1&&(this.undoStack.push(t),(a=(i=this.options).afterAddCommand)===null||a===void 0||a.call(i,t,!0))}clear(){this.undoStack=[],this.redoStack=[],this.batchChanges=null,this.batchAnimation=!1,this.notify(Ga.CLEAR,null)}notify(t,e){this.emitter.emit(t,{cmd:e}),this.emitter.emit(Ga.CHANGE,{cmd:e})}on(t,e){this.emitter.on(t,e)}destroy(){const{graph:t}=this.context;t.off(Xt.AFTER_DRAW,this.addCommand),t.off(Xt.BATCH_START,this.initBatchCommand),t.off(Xt.BATCH_END,this.addCommand),this.emitter.off(),super.destroy(),this.undoStack=[],this.redoStack=[]}}Ph.defaultOptions={stackSize:0};const $v={toXy(r,t){if(!t)return[...r];const e=t[0].slice(1),n=t[1].slice(1);return r.map(i=>[i[e],i[n]])},fromXy(r,t){if(!t)return[...r];const e=t[0].slice(1),n=t[1].slice(1);return r.map(([i,a])=>({[e]:i,[n]:a}))}};class pD{constructor(t,e){this._cells=[],this._cellSize=e,this._reverseCellSize=1/e;for(const n of t){const i=this.coordToCellNum(n[0]),a=this.coordToCellNum(n[1]);this._cells[i]||(this._cells[i]=[]),this._cells[i][a]||(this._cells[i][a]=[]),this._cells[i][a].push(n)}}cellPoints(t,e){var n;return((n=this._cells[t])===null||n===void 0?void 0:n[e])||[]}rangePoints(t){const e=this.coordToCellNum(t[0]),n=this.coordToCellNum(t[1]),i=this.coordToCellNum(t[2]),a=this.coordToCellNum(t[3]),s=[];for(let o=e;o<=i;o++)for(let l=n;l<=a;l++){const c=this.cellPoints(o,l);for(const u of c)s.push(u)}return s}removePoint(t){const e=this.coordToCellNum(t[0]),n=this.coordToCellNum(t[1]),i=this._cells[e][n],a=i.findIndex(([s,o])=>s===t[0]&&o===t[1]);return a>-1&&i.splice(a,1),i}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]}}function mD(r,t){return new pD(r,t)}const ax=+(Math.pow(2,27)+1);function Rh(r,t,e){const n=r*t,i=ax*r,a=i-r,s=i-a,o=r-s,l=ax*t,c=l-t,u=l-c,h=t-u,v=n-s*u-o*u-s*h,g=o*h-v;return e?(e[0]=g,e[1]=n,e):[g,n]}function yD(r,t,e){const n=r+t,i=n-r,a=n-i,s=t-i,o=r-a;return e?(e[0]=o+s,e[1]=n,e):[o+s,n]}function bD(r,t){const e=r.length;if(e===1){const o=Rh(r[0],t);return o[0]?o:[o[1]]}const n=new Array(2*e),i=[.1,.1],a=[.1,.1];let s=0;Rh(r[0],t,i),i[0]&&(n[s++]=i[0]);for(let o=1;o<e;++o){Rh(r[o],t,a);const l=i[1];yD(l,a[0],i),i[0]&&(n[s++]=i[0]);const c=a[1],u=i[1],h=c+u,d=h-c,f=u-d;i[1]=h,f&&(n[s++]=f)}return i[1]&&(n[s++]=i[1]),s===0&&(n[s++]=0),n.length=s,n}function xD(r,t){const e=r+t,n=e-r,i=e-n,a=t-n,o=r-i+a;return o?[o,e]:[e]}function ED(r,t){const e=r.length|0,n=t.length|0;if(e===1&&n===1)return xD(r[0],-t[0]);const i=e+n,a=new Array(i);let s=0,o=0,l=0;const c=Math.abs;let u=r[o],h=c(u),d=-t[l],f=c(d),v,g;h<f?(g=u,o+=1,o<e&&(u=r[o],h=c(u))):(g=d,l+=1,l<n&&(d=-t[l],f=c(d))),o<e&&h<f||l>=n?(v=u,o+=1,o<e&&(u=r[o],h=c(u))):(v=d,l+=1,l<n&&(d=-t[l],f=c(d)));let p=v+g,y=p-v,b=g-y,E=b,O=p,k,P,F,B,V;for(;o<e&&l<n;)h<f?(v=u,o+=1,o<e&&(u=r[o],h=c(u))):(v=d,l+=1,l<n&&(d=-t[l],f=c(d))),g=E,p=v+g,y=p-v,b=g-y,b&&(a[s++]=b),k=O+p,P=k-O,F=k-P,B=p-P,V=O-F,E=V+B,O=k;for(;o<e;)v=u,g=E,p=v+g,y=p-v,b=g-y,b&&(a[s++]=b),k=O+p,P=k-O,F=k-P,B=p-P,V=O-F,E=V+B,O=k,o+=1,o<e&&(u=r[o]);for(;l<n;)v=d,g=E,p=v+g,y=p-v,b=g-y,b&&(a[s++]=b),k=O+p,P=k-O,F=k-P,B=p-P,V=O-F,E=V+B,O=k,l+=1,l<n&&(d=-t[l]);return E&&(a[s++]=E),O&&(a[s++]=O),s||(a[s++]=0),a.length=s,a}function wD(r,t){const e=r+t,n=e-r,i=e-n,a=t-n,o=r-i+a;return o?[o,e]:[e]}function SD(r,t){const e=r.length|0,n=t.length|0;if(e===1&&n===1)return wD(r[0],t[0]);const i=e+n,a=new Array(i);let s=0,o=0,l=0;const c=Math.abs;let u=r[o],h=c(u),d=t[l],f=c(d),v,g;h<f?(g=u,o+=1,o<e&&(u=r[o],h=c(u))):(g=d,l+=1,l<n&&(d=t[l],f=c(d))),o<e&&h<f||l>=n?(v=u,o+=1,o<e&&(u=r[o],h=c(u))):(v=d,l+=1,l<n&&(d=t[l],f=c(d)));let p=v+g,y=p-v,b=g-y,E=b,O=p,k,P,F,B,V;for(;o<e&&l<n;)h<f?(v=u,o+=1,o<e&&(u=r[o],h=c(u))):(v=d,l+=1,l<n&&(d=t[l],f=c(d))),g=E,p=v+g,y=p-v,b=g-y,b&&(a[s++]=b),k=O+p,P=k-O,F=k-P,B=p-P,V=O-F,E=V+B,O=k;for(;o<e;)v=u,g=E,p=v+g,y=p-v,b=g-y,b&&(a[s++]=b),k=O+p,P=k-O,F=k-P,B=p-P,V=O-F,E=V+B,O=k,o+=1,o<e&&(u=r[o]);for(;l<n;)v=d,g=E,p=v+g,y=p-v,b=g-y,b&&(a[s++]=b),k=O+p,P=k-O,F=k-P,B=p-P,V=O-F,E=V+B,O=k,l+=1,l<n&&(d=t[l]);return E&&(a[s++]=E),O&&(a[s++]=O),s||(a[s++]=0),a.length=s,a}const sx=5,Lh=11102230246251565e-32,MD=(3+16*Lh)*Lh,AD=(7+56*Lh)*Lh;function TD(r,t,e,n){return function(a,s,o){const l=r(r(t(s[1],o[0]),t(-o[1],s[0])),r(t(a[1],s[0]),t(-s[1],a[0]))),c=r(t(a[1],o[0]),t(-o[1],a[0])),u=n(l,c);return u[u.length-1]}}function OD(r,t,e,n){return function(a,s,o,l){const c=r(r(e(r(t(o[1],l[0]),t(-l[1],o[0])),s[2]),r(e(r(t(s[1],l[0]),t(-l[1],s[0])),-o[2]),e(r(t(s[1],o[0]),t(-o[1],s[0])),l[2]))),r(e(r(t(s[1],l[0]),t(-l[1],s[0])),a[2]),r(e(r(t(a[1],l[0]),t(-l[1],a[0])),-s[2]),e(r(t(a[1],s[0]),t(-s[1],a[0])),l[2])))),u=r(r(e(r(t(o[1],l[0]),t(-l[1],o[0])),a[2]),r(e(r(t(a[1],l[0]),t(-l[1],a[0])),-o[2]),e(r(t(a[1],o[0]),t(-o[1],a[0])),l[2]))),r(e(r(t(s[1],o[0]),t(-o[1],s[0])),a[2]),r(e(r(t(a[1],o[0]),t(-o[1],a[0])),-s[2]),e(r(t(a[1],s[0]),t(-s[1],a[0])),o[2])))),h=n(c,u);return h[h.length-1]}}function CD(r,t,e,n){return function(a,s,o,l,c){const u=r(r(r(e(r(e(r(t(l[1],c[0]),t(-c[1],l[0])),o[2]),r(e(r(t(o[1],c[0]),t(-c[1],o[0])),-l[2]),e(r(t(o[1],l[0]),t(-l[1],o[0])),c[2]))),s[3]),r(e(r(e(r(t(l[1],c[0]),t(-c[1],l[0])),s[2]),r(e(r(t(s[1],c[0]),t(-c[1],s[0])),-l[2]),e(r(t(s[1],l[0]),t(-l[1],s[0])),c[2]))),-o[3]),e(r(e(r(t(o[1],c[0]),t(-c[1],o[0])),s[2]),r(e(r(t(s[1],c[0]),t(-c[1],s[0])),-o[2]),e(r(t(s[1],o[0]),t(-o[1],s[0])),c[2]))),l[3]))),r(e(r(e(r(t(o[1],l[0]),t(-l[1],o[0])),s[2]),r(e(r(t(s[1],l[0]),t(-l[1],s[0])),-o[2]),e(r(t(s[1],o[0]),t(-o[1],s[0])),l[2]))),-c[3]),r(e(r(e(r(t(l[1],c[0]),t(-c[1],l[0])),s[2]),r(e(r(t(s[1],c[0]),t(-c[1],s[0])),-l[2]),e(r(t(s[1],l[0]),t(-l[1],s[0])),c[2]))),a[3]),e(r(e(r(t(l[1],c[0]),t(-c[1],l[0])),a[2]),r(e(r(t(a[1],c[0]),t(-c[1],a[0])),-l[2]),e(r(t(a[1],l[0]),t(-l[1],a[0])),c[2]))),-s[3])))),r(r(e(r(e(r(t(s[1],c[0]),t(-c[1],s[0])),a[2]),r(e(r(t(a[1],c[0]),t(-c[1],a[0])),-s[2]),e(r(t(a[1],s[0]),t(-s[1],a[0])),c[2]))),l[3]),r(e(r(e(r(t(s[1],l[0]),t(-l[1],s[0])),a[2]),r(e(r(t(a[1],l[0]),t(-l[1],a[0])),-s[2]),e(r(t(a[1],s[0]),t(-s[1],a[0])),l[2]))),-c[3]),e(r(e(r(t(o[1],l[0]),t(-l[1],o[0])),s[2]),r(e(r(t(s[1],l[0]),t(-l[1],s[0])),-o[2]),e(r(t(s[1],o[0]),t(-o[1],s[0])),l[2]))),a[3]))),r(e(r(e(r(t(o[1],l[0]),t(-l[1],o[0])),a[2]),r(e(r(t(a[1],l[0]),t(-l[1],a[0])),-o[2]),e(r(t(a[1],o[0]),t(-o[1],a[0])),l[2]))),-s[3]),r(e(r(e(r(t(s[1],l[0]),t(-l[1],s[0])),a[2]),r(e(r(t(a[1],l[0]),t(-l[1],a[0])),-s[2]),e(r(t(a[1],s[0]),t(-s[1],a[0])),l[2]))),o[3]),e(r(e(r(t(s[1],o[0]),t(-o[1],s[0])),a[2]),r(e(r(t(a[1],o[0]),t(-o[1],a[0])),-s[2]),e(r(t(a[1],s[0]),t(-s[1],a[0])),o[2]))),-l[3]))))),h=r(r(r(e(r(e(r(t(l[1],c[0]),t(-c[1],l[0])),o[2]),r(e(r(t(o[1],c[0]),t(-c[1],o[0])),-l[2]),e(r(t(o[1],l[0]),t(-l[1],o[0])),c[2]))),a[3]),e(r(e(r(t(l[1],c[0]),t(-c[1],l[0])),a[2]),r(e(r(t(a[1],c[0]),t(-c[1],a[0])),-l[2]),e(r(t(a[1],l[0]),t(-l[1],a[0])),c[2]))),-o[3])),r(e(r(e(r(t(o[1],c[0]),t(-c[1],o[0])),a[2]),r(e(r(t(a[1],c[0]),t(-c[1],a[0])),-o[2]),e(r(t(a[1],o[0]),t(-o[1],a[0])),c[2]))),l[3]),e(r(e(r(t(o[1],l[0]),t(-l[1],o[0])),a[2]),r(e(r(t(a[1],l[0]),t(-l[1],a[0])),-o[2]),e(r(t(a[1],o[0]),t(-o[1],a[0])),l[2]))),-c[3]))),r(r(e(r(e(r(t(o[1],c[0]),t(-c[1],o[0])),s[2]),r(e(r(t(s[1],c[0]),t(-c[1],s[0])),-o[2]),e(r(t(s[1],o[0]),t(-o[1],s[0])),c[2]))),a[3]),e(r(e(r(t(o[1],c[0]),t(-c[1],o[0])),a[2]),r(e(r(t(a[1],c[0]),t(-c[1],a[0])),-o[2]),e(r(t(a[1],o[0]),t(-o[1],a[0])),c[2]))),-s[3])),r(e(r(e(r(t(s[1],c[0]),t(-c[1],s[0])),a[2]),r(e(r(t(a[1],c[0]),t(-c[1],a[0])),-s[2]),e(r(t(a[1],s[0]),t(-s[1],a[0])),c[2]))),o[3]),e(r(e(r(t(s[1],o[0]),t(-o[1],s[0])),a[2]),r(e(r(t(a[1],o[0]),t(-o[1],a[0])),-s[2]),e(r(t(a[1],s[0]),t(-s[1],a[0])),o[2]))),-c[3])))),d=n(u,h);return d[d.length-1]}}function _h(r){return(r===3?TD:r===4?OD:CD)(SD,Rh,bD,ED)}const ND=_h(3),kD=_h(4),Ys=[function(){return 0},function(){return 0},function(t,e){return e[0]-t[0]},function(t,e,n){const i=(t[1]-n[1])*(e[0]-n[0]),a=(t[0]-n[0])*(e[1]-n[1]),s=i-a;let o;if(i>0){if(a<=0)return s;o=i+a}else if(i<0){if(a>=0)return s;o=-(i+a)}else return s;const l=MD*o;return s>=l||s<=-l?s:ND(t,e,n)},function(t,e,n,i){const a=t[0]-i[0],s=e[0]-i[0],o=n[0]-i[0],l=t[1]-i[1],c=e[1]-i[1],u=n[1]-i[1],h=t[2]-i[2],d=e[2]-i[2],f=n[2]-i[2],v=s*u,g=o*c,p=o*l,y=a*u,b=a*c,E=s*l,O=h*(v-g)+d*(p-y)+f*(b-E),k=(Math.abs(v)+Math.abs(g))*Math.abs(h)+(Math.abs(p)+Math.abs(y))*Math.abs(d)+(Math.abs(b)+Math.abs(E))*Math.abs(f),P=AD*k;return O>P||-O>P?O:kD(t,e,n,i)}];function PD(r){let t=Ys[r.length];return t||(t=Ys[r.length]=_h(r.length)),t.apply(void 0,...r)}function RD(r,t,e,n,i,a,s){return function(...l){switch(l.length){case 0:case 1:return 0;case 2:return n(l[0],l[1]);case 3:return i(l[0],l[1],l[2]);case 4:return a(l[0],l[1],l[2],l[3]);case 5:return s(l[0],l[1],l[2],l[3],l[4])}return r(l)}}function LD(){for(;Ys.length<=sx;)Ys.push(_h(Ys.length));const r=RD(void 0,PD,...Ys);for(let t=0;t<=sx;++t)r[t]=Ys[t];return r}var jl=LD();const ox=jl[3];function _D(r){const t=r.length;if(t<3){const o=new Array(t);for(let l=0;l<t;++l)o[l]=l;return t===2&&r[0][0]===r[1][0]&&r[0][1]===r[1][1]?[0]:o}const e=new Array(t);for(let o=0;o<t;++o)e[o]=o;e.sort((o,l)=>{const c=r[o][0]-r[l][0];return c||r[o][1]-r[l][1]});const n=[e[0],e[1]],i=[e[0],e[1]];for(let o=2;o<t;++o){const l=e[o],c=r[l];let u=n.length;for(;u>1&&ox(r[n[u-2]],r[n[u-1]],c)<=0;)u-=1,n.pop();for(n.push(l),u=i.length;u>1&&ox(r[i[u-2]],r[i[u-1]],c)>=0;)u-=1,i.pop();i.push(l)}const a=new Array(i.length+n.length-2);let s=0;for(let o=0,l=n.length;o<l;++o)a[s++]=n[o];for(let o=i.length-2;o>0;--o)a[s++]=i[o];return a}function DD(r,t,e,n){for(let i=0;i<2;++i){const a=r[i],s=t[i],[o,l]=[Math.min(a,s),Math.max(a,s)],c=e[i],u=n[i],[h,d]=[Math.min(c,u),Math.max(c,u)];if(d<o||l<h)return!1}return!0}function ID(r,t,e,n){const i=jl(r,e,n),a=jl(t,e,n);if(i>0&&a>0||i<0&&a<0)return!1;const s=jl(e,r,t),o=jl(n,r,t);return s>0&&o>0||s<0&&o<0?!1:i===0&&a===0&&s===0&&o===0?DD(r,t,e,n):!0}function BD(r){const t=[r[0]];let e=r[0];for(let n=1;n<r.length;n++){const i=r[n];(e[0]!==i[0]||e[1]!==i[1])&&t.push(i),e=i}return t}function FD(r){return r.sort(function(t,e){return t[0]-e[0]||t[1]-e[1]})}function t0(r,t){return Math.pow(t[0]-r[0],2)+Math.pow(t[1]-r[1],2)}function lx(r,t,e){const n=[t[0]-r[0],t[1]-r[1]],i=[e[0]-r[0],e[1]-r[1]],a=t0(r,t),s=t0(r,e);return(n[0]*i[0]+n[1]*i[1])/Math.sqrt(a*s)}function cx(r,t){for(let e=0;e<t.length-1;e++){const n=[t[e],t[e+1]];if(!(r[0][0]===n[0][0]&&r[0][1]===n[0][1]||r[0][0]===n[1][0]&&r[0][1]===n[1][1])&&ID(r[0],r[1],n[0],n[1]))return!0}return!1}function zD(r){let t=1/0,e=1/0,n=-1/0,i=-1/0;for(let a=r.length-1;a>=0;a--)r[a][0]<t&&(t=r[a][0]),r[a][1]<e&&(e=r[a][1]),r[a][0]>n&&(n=r[a][0]),r[a][1]>i&&(i=r[a][1]);return[n-t,i-e]}function jD(r){return[Math.min(r[0][0],r[1][0]),Math.min(r[0][1],r[1][1]),Math.max(r[0][0],r[1][0]),Math.max(r[0][1],r[1][1])]}function GD(r,t,e){let n=null,i=hx,a=hx,s,o;for(let l=0;l<t.length;l++)s=lx(r[0],r[1],t[l]),o=lx(r[1],r[0],t[l]),s>i&&o>a&&!cx([r[0],t[l]],e)&&!cx([r[1],t[l]],e)&&(i=s,a=o,n=t[l]);return n}function ux(r,t,e,n,i){let a=!1;for(let s=0;s<r.length-1;s++){const o=[r[s],r[s+1]],l=o[0][0]+","+o[0][1]+","+o[1][0]+","+o[1][1];if(t0(o[0],o[1])<t||i.has(l))continue;let c=0,u=jD(o),h,d,f;do u=n.extendBbox(u,c),h=u[2]-u[0],d=u[3]-u[1],f=GD(o,n.rangePoints(u),r),c++;while(f===null&&(e[0]>h||e[1]>d));h>=e[0]&&d>=e[1]&&i.add(l),f!==null&&(r.splice(s+1,0,f),n.removePoint(f),a=!0)}return a?ux(r,t,e,n,i):r}function WD(r,t,e){const n=t||20,i=BD(FD($v.toXy(r,e)));if(i.length<4){const h=i.concat([i[0]]);return e?$v.fromXy(h,e):h}const a=zD(i),s=[a[0]*dx,a[1]*dx],o=_D(i).reverse().map(h=>i[h]);o.push(o[0]);const l=i.filter(function(h){return o.indexOf(h)<0}),c=Math.ceil(1/(i.length/(a[0]*a[1]))),u=ux(o,Math.pow(n,2),s,mD(l,c),new Set);return e?$v.fromXy(u,e):u}const hx=Math.cos(90/(180/Math.PI)),dx=.6;function ZD(r,t,e){if(r.length===1)return VD(r[0],t,e);if(r.length===2)return fx(r,t,e);if(r.length===3){const[n,i,a]=qf(r);if(Dy(n,i,a))return fx([n,a],t,e)}switch(e){case"smooth":return YD(r,t);case"sharp":return HD(r,t);case"rounded":default:return UD(r,t)}}const VD=(r,t,e)=>{if(e==="sharp")return[["M",r[0]-t,r[1]-t],["L",r[0]+t,r[1]-t],["L",r[0]+t,r[1]+t],["L",r[0]-t,r[1]+t],["Z"]];const n=[t,t,0,0,0];return[["M",r[0],r[1]-t],["A",...n,r[0],r[1]+t],["A",...n,r[0],r[1]-t]]},fx=(r,t,e)=>{const n=[t,t,0,0,0],i=e==="sharp"?Le(r[0],Ya(Ea(dn(r[0],r[1])),t)):r[0],a=e==="sharp"?Le(r[1],Ya(Ea(dn(r[1],r[0])),t)):r[1],s=Ya(Ea(bu(dn(i,a),!1)),t),o=Ya(s,-1),l=Le(i,s),c=Le(a,s),u=Le(a,o),h=Le(i,o);return e==="sharp"?[["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",...n,u[0],u[1]],["L",h[0],h[1]],["A",...n,l[0],l[1]]]},UD=(r,t)=>{const e=qf(r).map((o,l)=>{const c=(l-2+r.length)%r.length,u=(l-1+r.length)%r.length,h=(l+1)%r.length,d=r[c],f=r[u],v=r[h],g=dn(d,f),p=dn(f,o),y=dn(o,v),b=(F,B)=>Xf(F,B,!0)<Math.PI,E=b(g,p),O=b(p,y),k=F=>Ya(Ea(bu(F,!1)),t),P=k(p);return[{p:_s(E?Le(f,k(g)):Le(f,P)),concave:E&&f},{p:_s(O?Le(o,k(y)):Le(o,P)),concave:O&&o}]}),n=[t,t,0,0,0],i=e.findIndex((o,l)=>!e[(l-1+e.length)%e.length][0].concave&&!e[(l-1+e.length)%e.length][1].concave&&!o[0].concave&&!o[0].concave&&!o[1].concave),a=e.slice(i).concat(e.slice(0,i));let s=[];return a.flatMap((o,l)=>{const c=[],u=a[e.length-1];return l===0&&c.push(["M",...u[1].p]),o[0].concave?s.push(o[0].p,o[1].p):c.push(["A",...n,...o[0].p]),o[1].concave?s.unshift(o[1].p):c.push(["L",...o[1].p]),s.length===3&&(c.pop(),c.push(["C",...s.flat()]),s=[]),c})},YD=(r,t)=>{const e=qf(r).map((n,i)=>{const a=r[(i+1)%r.length];return{p:n,v:Ea(dn(a,n))}});return e.forEach((n,i)=>{const a=i>0?i-1:r.length-1,s=e[a].v,o=Ea(Le(s,Ya(n.v,Xf(s,n.v,!0)<Math.PI?1:-1)));n.p=Le(n.p,Ya(o,t))}),Jy(e.map(n=>n.p))},HD=(r,t)=>{const n=r.map((a,s)=>{const o=r[s===0?r.length-1:s-1],l=wl(Ya(Ea(bu(dn(o,a),!1)),t));return[Le(o,l),Le(a,l)]}).flat();return n.map((a,s)=>{if(s%2===0)return null;const o=[n[(s-1)%n.length],n[s%n.length]],l=[n[(s+1)%n.length],n[(s+2)%n.length]];return Qf(o,l,!0)}).filter(Boolean).map((a,s)=>[s===0?"M":"L",a[0],a[1]]).concat([["Z"]])};var XD=function(r,t){var e={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&t.indexOf(n)<0&&(e[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(e[n[i]]=r[n[i]]);return e};class Dh extends fr{constructor(t,e){super(t,Object.assign({},Dh.defaultOptions,e)),this.hullMemberIds=[],this.drawHull=()=>{if(!this.shape)this.shape=new Cl({style:this.getHullStyle()}),this.context.canvas.appendChild(this.shape);else{const n=!Wn(this.optionsCache,this.options);this.shape.update(this.getHullStyle(n))}this.optionsCache=Object.assign({},this.options)},this.updateHullPath=n=>{this.shape&&this.options.members.includes(At(n.data))&&this.shape.update({d:this.getHullPath(!0)})},this.getHullPath=(n=!1)=>{const{graph:i}=this.context,a=this.getMember();if(a.length===0)return"";const s=a.map(c=>i.getNodeData(c)),o=WD(s.map(sr),this.options.concavity).slice(1).reverse(),l=o.flatMap(c=>s.filter(u=>Wn(sr(u),c)).map(At));return Wn(l,this.hullMemberIds)&&!n?this.path:(this.hullMemberIds=l,this.path=ZD(o,this.getPadding(),this.options.corner),this.path)},this.bindEvents()}bindEvents(){this.context.graph.on(Xt.AFTER_RENDER,this.drawHull),this.context.graph.on(Xt.AFTER_ELEMENT_UPDATE,this.updateHullPath)}unbindEvents(){this.context.graph.off(Xt.AFTER_RENDER,this.drawHull),this.context.graph.off(Xt.AFTER_ELEMENT_UPDATE,this.updateHullPath)}getHullStyle(t){const e=this.options,{members:n,padding:i,corner:a}=e,s=XD(e,["members","padding","corner"]);return Object.assign(Object.assign({},s),{d:this.getHullPath(t)})}getPadding(){const{graph:t}=this.context;return this.hullMemberIds.reduce((n,i)=>{const{halfExtents:a}=t.getElementRenderBounds(i),s=Math.max(a[0],a[1]);return Math.max(n,s)},0)+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(n=>!e.includes(n)),e.some(n=>this.hullMemberIds.includes(n))&&this.shape.update({d:this.getHullPath()})}updateMember(t){this.options.members=ue(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()}}Dh.defaultOptions={members:[],padding:10,corner:"rounded",concavity:1/0,fill:"lightblue",fillOpacity:.2,labelOpacity:1,stroke:"blue",strokeOpacity:.2};function vx(r,t){t(r),r.children&&r.children.forEach(function(e){e&&vx(e,t)})}function Gl(r){Ih(r,!0)}function Hi(r){Ih(r,!1)}function Ih(r,t){var e=t?"visible":"hidden";vx(r,function(n){n.attr("visibility",e)})}var KD=5,gx=function(r,t,e,n){e===void 0&&(e=0),n===void 0&&(n=KD),Object.entries(t).forEach(function(i){var a=(0,Z.CR)(i,2),s=a[0],o=a[1],l=r;Object.prototype.hasOwnProperty.call(t,s)&&(o?bo(o)?(bo(r[s])||(l[s]={}),e<n?gx(r[s],o,e+1,n):l[s]=t[s]):Kr(o)?(l[s]=[],l[s]=l[s].concat(o)):l[s]=o:l[s]=o)})},tr=function(r){for(var t=[],e=1;e<arguments.length;e++)t[e-1]=arguments[e];for(var n=0;n<t.length;n+=1)gx(r,t[n]);return r},QD=function(r){(0,Z.ZT)(t,r);function t(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var i=r.apply(this,(0,Z.ev)([],(0,Z.CR)(e),!1))||this;return i.isMutationObserved=!0,i.addEventListener(Fe.INSERTED,function(){Hi(i)}),i}return t}(ar);function px(r){var t=r.appendChild(new QD({class:"offscreen"}));return Hi(t),t}function qD(r){for(var t=r;t;){if(t.className==="offscreen")return!0;t=t.parent}return!1}function JD(){Ih(this,this.attributes.visibility!=="hidden")}var Ln=function(r){(0,Z.ZT)(t,r);function t(e,n){n===void 0&&(n={});var i=r.call(this,tr({},{style:n},e))||this;return i.initialized=!1,i._defaultOptions=n,i}return Object.defineProperty(t.prototype,"offscreenGroup",{get:function(){return this._offscreen||(this._offscreen=px(this)),this._offscreen},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"defaultOptions",{get:function(){return this._defaultOptions},enumerable:!1,configurable:!0}),t.prototype.connectedCallback=function(){this.render(this.attributes,this),this.bindEvents(this.attributes,this),this.initialized=!0},t.prototype.disconnectedCallback=function(){var e;(e=this._offscreen)===null||e===void 0||e.destroy()},t.prototype.attributeChangedCallback=function(e){e==="visibility"&&JD.call(this)},t.prototype.update=function(e,n){var i;return this.attr(tr({},this.attributes,e||{})),(i=this.render)===null||i===void 0?void 0:i.call(this,this.attributes,this,n)},t.prototype.clear=function(){this.removeChildren()},t.prototype.bindEvents=function(e,n){},t.prototype.getSubShapeStyle=function(e){var n=e.x,i=e.y,a=e.transform,s=e.transformOrigin,o=e.class,l=e.className,c=e.zIndex,u=(0,Z._T)(e,["x","y","transform","transformOrigin","class","className","zIndex"]);return u},t}(pf);function e0(r){return r.toString().charAt(0).toUpperCase()+r.toString().slice(1)}function $D(r){return r.toString().charAt(0).toLowerCase()+r.toString().slice(1)}function tI(r,t){return"".concat(t).concat(e0(r))}function mx(r,t,e){var n;e===void 0&&(e=!0);var i=t||((n=r.match(/^([a-z][a-z0-9]+)/))===null||n===void 0?void 0:n[0])||"",a=r.replace(new RegExp("^(".concat(i,")")),"");return e?$D(a):a}function eI(r,t){Object.entries(t).forEach(function(e){var n=(0,Z.CR)(e,2),i=n[0],a=n[1];(0,Z.ev)([r],(0,Z.CR)(r.querySelectorAll(i)),!1).filter(function(s){return s.matches(i)}).forEach(function(s){if(s){var o=s;o.style.cssText+=Object.entries(a).reduce(function(l,c){return"".concat(l).concat(c.join(":"),";")},"")}})})}var Bh=function(r,t){if(!(r!=null&&r.startsWith(t)))return!1;var e=r[t.length];return e>="A"&&e<="Z"};function _e(r,t,e){e===void 0&&(e=!1);var n={};return Object.entries(r).forEach(function(i){var a=(0,Z.CR)(i,2),s=a[0],o=a[1];if(!(s==="className"||s==="class")){if(Bh(s,"show")&&Bh(mx(s,"show"),t)!==e)s===tI(t,"show")?n[s]=o:n[s.replace(new RegExp(e0(t)),"")]=o;else if(!Bh(s,"show")&&Bh(s,t)!==e){var l=mx(s,t);l==="filter"&&typeof o=="function"||(n[l]=o)}}}),n}function No(r,t){return Object.entries(r).reduce(function(e,n){var i=(0,Z.CR)(n,2),a=i[0],s=i[1];return a.startsWith("show")?e["show".concat(t).concat(a.slice(4))]=s:e["".concat(t).concat(e0(a))]=s,e},{})}function Ta(r,t){t===void 0&&(t=["x","y","class","className"]);var e=["transform","transformOrigin","anchor","visibility","pointerEvents","zIndex","cursor","clipPath","clipPathTargets","offsetPath","offsetPathTargets","offsetDistance","draggable","droppable"],n={},i={};return Object.entries(r).forEach(function(a){var s=(0,Z.CR)(a,2),o=s[0],l=s[1];t.includes(o)||(e.indexOf(o)!==-1?i[o]=l:n[o]=l)}),[n,i]}var nI=function(r){if(!Kr(r))return[];for(var t=[],e=0;e<r.length;e++)t=t.concat(r[e]);return t},rI=nI,n0=function(r){(0,Z.ZT)(t,r);function t(e){e===void 0&&(e={});var n=e.style,i=(0,Z._T)(e,["style"]);return r.call(this,(0,Z.pi)({style:(0,Z.pi)({text:"",fill:"black",fontFamily:"sans-serif",fontSize:16,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",lineWidth:1,textAlign:"start",textBaseline:"middle"},n)},i))||this}return Object.defineProperty(t.prototype,"offscreenGroup",{get:function(){return this._offscreen||(this._offscreen=px(this)),this._offscreen},enumerable:!1,configurable:!0}),t.prototype.disconnectedCallback=function(){var e;(e=this._offscreen)===null||e===void 0||e.destroy()},t}(Ns);function iI(r,t){var e=new Map;return r.forEach(function(n){var i=t(n);e.has(i)||e.set(i,[]),e.get(i).push(n)}),e}function aI(r){throw new Error(r)}var sI=function(){function r(i,a,s,o,l,c,u){i===void 0&&(i=null),a===void 0&&(a=null),s===void 0&&(s=null),o===void 0&&(o=null),l===void 0&&(l=[null,null,null,null,null]),c===void 0&&(c=[]),u===void 0&&(u=[]),t.add(this),this._elements=Array.from(i),this._data=a,this._parent=s,this._document=o,this._enter=l[0],this._update=l[1],this._exit=l[2],this._merge=l[3],this._split=l[4],this._transitions=c,this._facetElements=u}r.prototype.selectAll=function(i){var a=typeof i=="string"?this._parent.querySelectorAll(i):i;return new e(a,null,this._elements[0],this._document)},r.prototype.selectFacetAll=function(i){var a=typeof i=="string"?this._parent.querySelectorAll(i):i;return new e(this._elements,null,this._parent,this._document,void 0,void 0,a)},r.prototype.select=function(i){var a=typeof i=="string"?this._parent.querySelectorAll(i)[0]||null:i;return new e([a],null,a,this._document)},r.prototype.append=function(i){var a=this,s=typeof i=="function"?i:function(){return a.createElement(i)},o=[];if(this._data!==null){for(var l=0;l<this._data.length;l++){var c=this._data[l],u=(0,Z.CR)(Array.isArray(c)?c:[c,null],2),h=u[0],d=u[1],f=s(h,l);f.__data__=h,d!==null&&(f.__fromElements__=d),this._parent.appendChild(f),o.push(f)}return new e(o,null,this._parent,this._document)}for(var l=0;l<this._elements.length;l++){var v=this._elements[l],h=v.__data__,f=s(h,l);v.appendChild(f),o.push(f)}return new e(o,null,o[0],this._document)},r.prototype.maybeAppend=function(i,a){var s=(0,Z.Q_)(this,t,"m",n).call(this,i[0]==="#"?i:"#".concat(i),a);return s.attr("id",i),s},r.prototype.maybeAppendByClassName=function(i,a){var s=i.toString(),o=(0,Z.Q_)(this,t,"m",n).call(this,s[0]==="."?s:".".concat(s),a);return o.attr("className",s),o},r.prototype.maybeAppendByName=function(i,a){var s=(0,Z.Q_)(this,t,"m",n).call(this,'[name="'.concat(i,'"]'),a);return s.attr("name",i),s},r.prototype.data=function(i,a,s){var o,l;a===void 0&&(a=function(U){return U}),s===void 0&&(s=function(){return null});for(var c=[],u=[],h=new Set(this._elements),d=[],f=new Set,v=new Map(this._elements.map(function(U,J){return[a(U.__data__,J),U]})),g=new Map(this._facetElements.map(function(U,J){return[a(U.__data__,J),U]})),p=iI(this._elements,function(U){return s(U.__data__)}),y=0;y<i.length;y++){var b=i[y],E=a(b,y),O=s(b,y);if(v.has(E)){var k=v.get(E);k.__data__=b,k.__facet__=!1,u.push(k),h.delete(k),v.delete(E)}else if(g.has(E)){var k=g.get(E);k.__data__=b,k.__facet__=!0,u.push(k),g.delete(E)}else if(p.has(E)){var P=p.get(E);d.push([b,P]);try{for(var F=(o=void 0,(0,Z.XA)(P)),B=F.next();!B.done;B=F.next()){var k=B.value;h.delete(k)}}catch(U){o={error:U}}finally{try{B&&!B.done&&(l=F.return)&&l.call(F)}finally{if(o)throw o.error}}p.delete(E)}else if(v.has(O)){var k=v.get(O);k.__toData__?k.__toData__.push(b):k.__toData__=[b],f.add(k),h.delete(k)}else c.push(b)}var V=[new e([],c,this._parent,this._document),new e(u,null,this._parent,this._document),new e(h,null,this._parent,this._document),new e([],d,this._parent,this._document),new e(f,null,this._parent,this._document)];return new e(this._elements,null,this._parent,this._document,V)},r.prototype.merge=function(i){var a=(0,Z.ev)((0,Z.ev)([],(0,Z.CR)(this._elements),!1),(0,Z.CR)(i._elements),!1),s=(0,Z.ev)((0,Z.ev)([],(0,Z.CR)(this._transitions),!1),(0,Z.CR)(i._transitions),!1);return new e(a,null,this._parent,this._document,void 0,s)},r.prototype.createElement=function(i){if(this._document)return this._document.createElement(i,{});var a=e.registry[i];return a?new a:aI("Unknown node type: ".concat(i))},r.prototype.join=function(i,a,s,o,l){i===void 0&&(i=function(v){return v}),a===void 0&&(a=function(v){return v}),s===void 0&&(s=function(v){return v.remove()}),o===void 0&&(o=function(v){return v}),l===void 0&&(l=function(v){return v.remove()});var c=i(this._enter),u=a(this._update),h=s(this._exit),d=o(this._merge),f=l(this._split);return u.merge(c).merge(h).merge(d).merge(f)},r.prototype.remove=function(){for(var i=function(o){var l=a._elements[o],c=a._transitions[o];c?c.then(function(){return l.remove()}):l.remove()},a=this,s=0;s<this._elements.length;s++)i(s);return new e([],null,this._parent,this._document,void 0,this._transitions)},r.prototype.each=function(i){for(var a=0;a<this._elements.length;a++){var s=this._elements[a],o=s.__data__;i.call(s,o,a)}return this},r.prototype.attr=function(i,a){var s=typeof a!="function"?function(){return a}:a;return this.each(function(o,l){a!==void 0&&(this[i]=s.call(this,o,l))})},r.prototype.style=function(i,a,s){s===void 0&&(s=!0);var o=typeof a!="function"||!s?function(){return a}:a;return this.each(function(l,c){a!==void 0&&(this.style[i]=o.call(this,l,c))})},r.prototype.styles=function(i,a){return i===void 0&&(i={}),a===void 0&&(a=!0),this.each(function(s,o){var l=this;Object.entries(i).forEach(function(c){var u=(0,Z.CR)(c,2),h=u[0],d=u[1],f=typeof d!="function"||!a?function(){return d}:d;d!==void 0&&l.attr(h,f.call(l,s,o))})})},r.prototype.update=function(i,a){a===void 0&&(a=!0);var s=typeof i!="function"||!a?function(){return i}:i;return this.each(function(o,l){i&&this.update&&this.update(s.call(this,o,l))})},r.prototype.maybeUpdate=function(i,a){a===void 0&&(a=!0);var s=typeof i!="function"||!a?function(){return i}:i;return this.each(function(o,l){i&&this.update&&this.update(s.call(this,o,l))})},r.prototype.transition=function(i){var a=this._transitions,s=new Array(this._elements.length);return this.each(function(o,l){s[l]=i.call(this,o,l)}),this._transitions=rI(s),this},r.prototype.on=function(i,a){return this.each(function(){this.addEventListener(i,a)}),this},r.prototype.call=function(i){for(var a=[],s=1;s<arguments.length;s++)a[s-1]=arguments[s];return i.call.apply(i,(0,Z.ev)([this._parent,this],(0,Z.CR)(a),!1)),this},r.prototype.node=function(){return this._elements[0]},r.prototype.nodes=function(){return this._elements},r.prototype.transitions=function(){return this._transitions.filter(function(i){return!!i})},r.prototype.parent=function(){return this._parent};var t,e,n;return e=r,t=new WeakSet,n=function(a,s){var o=this._elements[0],l=o.querySelector(a);if(l)return new e([l],null,this._parent,this._document);var c=typeof s=="string"?this.createElement(s):s();return o.appendChild(c),new e([c],null,this._parent,this._document)},r.registry={g:ar,rect:br,circle:aa,path:li,text:n0,ellipse:hl,image:dl,line:Os,polygon:Cs,polyline:Dc,html:Ts},r}();function he(r){return new sI([r],null,r,r.ownerDocument)}function oI(r,t,e){return r.querySelector(t)?he(r).select(t):he(r).append(e)}var Lr=function(){function r(t,e,n,i){t===void 0&&(t=0),e===void 0&&(e=0),n===void 0&&(n=0),i===void 0&&(i=0),this.x=0,this.y=0,this.width=0,this.height=0,this.x=t,this.y=e,this.width=n,this.height=i}return Object.defineProperty(r.prototype,"bottom",{get:function(){return this.y+this.height},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"left",{get:function(){return this.x},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"right",{get:function(){return this.x+this.width},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"top",{get:function(){return this.y},enumerable:!1,configurable:!0}),r.fromRect=function(t){return new r(t.x,t.y,t.width,t.height)},r.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}},r.prototype.isPointIn=function(t,e){return t>=this.left&&t<=this.right&&e>=this.top&&e<=this.bottom},r}();function pj(r){var t=r.getRenderBounds(),e=__read(t.min,2),n=e[0],i=e[1],a=__read(t.max,2),s=a[0],o=a[1],l=s-n,c=o-i;return new Lr(n,i,l,c)}var Xi=function(r,t){var e=function(i){return"".concat(t,"-").concat(i)},n=Object.fromEntries(Object.entries(r).map(function(i){var a=(0,Z.CR)(i,2),s=a[0],o=a[1],l=e(o);return[s,{name:l,class:".".concat(l),id:"#".concat(l),toString:function(){return l}}]}));return Object.assign(n,{prefix:e}),n};function Fh(r){return/\S+-\S+/g.test(r)?r.split("-").map(function(t){return t[0]}):r.length>2?[r[0]]:r.split("")}function Sr(r){if(ie(r))return[r,r,r,r];if(Kr(r)){var t=r.length;if(t===1)return[r[0],r[0],r[0],r[0]];if(t===2)return[r[0],r[1],r[0],r[1]];if(t===3)return[r[0],r[1],r[2],r[1]];if(t===4)return r}return[0,0,0,0]}function ri(r,t,e,n,i){return n===void 0&&(n=!0),i===void 0&&(i=function(a){a.node().removeChildren()}),r?e(t):(n&&i(t),null)}function _r(r,t,e){return e?"".concat(r," ").concat(e,"legend-").concat(t):r}function mj(r,t,e){var n=r.classNamePrefix,i=n===void 0?"":n;return _r(t.name,e,i)}var Wr={title:"title",item:"item",marker:"marker",label:"label",value:"value",focusIcon:"focus-icon",background:"background",ribbon:"ribbon",track:"track",selection:"selection",handle:"handle",handleMarker:"handle-marker",handleLabel:"handle-label",indicator:"indicator",prevBtn:"prev-btn",nextBtn:"next-btn",pageInfo:"page-info"},r0=Xi({text:"text"},"title");function lI(r,t){var e=r.attributes,n=e.position,i=e.spacing,a=e.inset,s=e.text,o=r.getBBox(),l=t.getBBox(),c=Fh(n),u=(0,Z.CR)(Sr(s?i:0),4),h=u[0],d=u[1],f=u[2],v=u[3],g=(0,Z.CR)(Sr(a),4),p=g[0],y=g[1],b=g[2],E=g[3],O=(0,Z.CR)([v+d,h+f],2),k=O[0],P=O[1],F=(0,Z.CR)([E+y,p+b],2),B=F[0],V=F[1];if(c[0]==="l")return new Lr(o.x,o.y,l.width+o.width+k+B,Math.max(l.height+V,o.height));if(c[0]==="t")return new Lr(o.x,o.y,Math.max(l.width+B,o.width),l.height+o.height+P+V);var U=(0,Z.CR)([t.attributes.width||l.width,t.attributes.height||l.height],2),J=U[0],$=U[1];return new Lr(l.x,l.y,J+o.width+k+B,$+o.height+P+V)}function cI(r,t){var e=Object.entries(t).reduce(function(n,i){var a=(0,Z.CR)(i,2),s=a[0],o=a[1],l=r.node().attr(s);return l||(n[s]=o),n},{});r.styles(e)}function uI(r){var t,e,n,i,a=r,s=a.width,o=a.height,l=a.position,c=(0,Z.CR)([+s/2,+o/2],2),u=c[0],h=c[1],d=(0,Z.CR)([+u,+h,"center","middle"],4),f=d[0],v=d[1],g=d[2],p=d[3],y=Fh(l);return y.includes("l")&&(t=(0,Z.CR)([0,"start"],2),f=t[0],g=t[1]),y.includes("r")&&(e=(0,Z.CR)([+s,"end"],2),f=e[0],g=e[1]),y.includes("t")&&(n=(0,Z.CR)([0,"top"],2),v=n[0],p=n[1]),y.includes("b")&&(i=(0,Z.CR)([+o,"bottom"],2),v=i[0],p=i[1]),{x:f,y:v,textAlign:g,textBaseline:p}}var hI=function(r){(0,Z.ZT)(t,r);function t(e){return r.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 t.prototype.getAvailableSpace=function(){var e=this,n=this.attributes,i=n.width,a=n.height,s=n.position,o=n.spacing,l=n.inset,c=e.querySelector(r0.text.class);if(!c)return new Lr(0,0,+i,+a);var u=c.getBBox(),h=u.width,d=u.height,f=(0,Z.CR)(Sr(o),4),v=f[0],g=f[1],p=f[2],y=f[3],b=(0,Z.CR)([0,0,+i,+a],4),E=b[0],O=b[1],k=b[2],P=b[3],F=Fh(s);if(F.includes("i"))return new Lr(E,O,k,P);F.forEach(function(Nt,Ct){var gt,bt,Pt,zt;Nt==="t"&&(gt=(0,Z.CR)(Ct===0?[d+p,+a-d-p]:[0,+a],2),O=gt[0],P=gt[1]),Nt==="r"&&(bt=(0,Z.CR)([+i-h-y],1),k=bt[0]),Nt==="b"&&(Pt=(0,Z.CR)([+a-d-v],1),P=Pt[0]),Nt==="l"&&(zt=(0,Z.CR)(Ct===0?[h+g,+i-h-g]:[0,+i],2),E=zt[0],k=zt[1])});var B=(0,Z.CR)(Sr(l),4),V=B[0],U=B[1],J=B[2],$=B[3],at=(0,Z.CR)([$+U,V+J],2),ct=at[0],ft=at[1];return new Lr(E+$,O+V,k-ct,P-ft)},t.prototype.getBBox=function(){return this.title?this.title.getBBox():new Lr(0,0,0,0)},t.prototype.render=function(e,n){var i=this,a=e.width,s=e.height,o=e.position,l=e.spacing,c=e.classNamePrefix,u=(0,Z._T)(e,["width","height","position","spacing","classNamePrefix"]),h=(0,Z.CR)(Ta(u),1),d=h[0],f=uI(e),v=f.x,g=f.y,p=f.textAlign,y=f.textBaseline;ri(!!u.text,he(n),function(b){var E=_r(r0.text.name,Wr.title,c);i.title=b.maybeAppendByClassName(r0.text,"text").attr("className",E).styles(d).call(cI,{x:v,y:g,textAlign:p,textBaseline:y}).node()})},t}(Ln),i0=function(){};function ii(r,t){return ue(r)?r.apply(void 0,(0,Z.ev)([],(0,Z.CR)(t),!1)):r}function dI(r,t){return r.reduce(function(e,n){return(e[n[t]]=e[n[t]]||[]).push(n),e},{})}function fI(r){return typeof r=="boolean"?!1:"enter"in r&&"update"in r&&"exit"in r}function yx(r){if(!r)return{enter:!1,update:!1,exit:!1};var t=["enter","update","exit"],e=Object.fromEntries(Object.entries(r).filter(function(n){var i=(0,Z.CR)(n,1),a=i[0];return!t.includes(a)}));return Object.fromEntries(t.map(function(n){return fI(r)?r[n]===!1?[n,!1]:[n,(0,Z.pi)((0,Z.pi)({},r[n]),e)]:[n,e]}))}function ko(r,t){r?r.finished.then(t):t()}function vI(r,t){r.length===0?t():Promise.all(r.map(function(e){return e==null?void 0:e.finished})).then(t)}function bx(r,t){"update"in r?r.update(t):r.attr(t)}function xx(r,t,e){if(t.length===0)return null;if(!e){var n=t.slice(-1)[0];return bx(r,{style:n}),null}return r.animate(t,e)}function gI(r,t){return!(r.nodeName!=="text"||t.nodeName!=="text"||r.attributes.text!==t.attributes.text)}function pI(r,t,e,n){if(n===void 0&&(n="destroy"),gI(r,t))return r.remove(),[null];var i=function(){n==="destroy"?r.destroy():n==="hide"&&Hi(r),t.isVisible()&&Gl(t)};if(!e)return i(),[null];var a=e.duration,s=a===void 0?0:a,o=e.delay,l=o===void 0?0:o,c=Math.ceil(+s/2),u=+s/4,h=(0,Z.CR)(r.getGeometryBounds().center,2),d=h[0],f=h[1],v=(0,Z.CR)(t.getGeometryBounds().center,2),g=v[0],p=v[1],y=(0,Z.CR)([(d+g)/2-d,(f+p)/2-f],2),b=y[0],E=y[1],O=r.style.opacity,k=O===void 0?1:O,P=t.style.opacity,F=P===void 0?1:P,B=r.style.transform||"",V=t.style.transform||"",U=r.animate([{opacity:k,transform:"translate(0, 0) ".concat(B)},{opacity:0,transform:"translate(".concat(b,", ").concat(E,") ").concat(B)}],(0,Z.pi)((0,Z.pi)({fill:"both"},e),{duration:l+c+u})),J=t.animate([{opacity:0,transform:"translate(".concat(-b,", ").concat(-E,") ").concat(V),offset:.01},{opacity:F,transform:"translate(0, 0) ".concat(V)}],(0,Z.pi)((0,Z.pi)({fill:"both"},e),{duration:c+u,delay:l+c-u}));return ko(J,i),[U,J]}function Ki(r,t,e){var n={},i={};return Object.entries(t).forEach(function(a){var s=(0,Z.CR)(a,2),o=s[0],l=s[1];if(!be(l)){var c=r.style[o]||r.parsedStyle[o]||0;c!==l&&(n[o]=c,i[o]=l)}}),e?xx(r,[n,i],(0,Z.pi)({fill:"both"},e)):(bx(r,i),null)}function mI(r){var t;return((t=r[0])===null||t===void 0?void 0:t.map(function(e,n){return r.map(function(i){return i[n]})}))||[]}function a0(r,t,e){e===void 0&&(e=!1);var n=r.getBBox(),i=n.width,a=n.height,s=t/Math.max(i,a);return e&&(r.style.transform="scale(".concat(s,")")),s}var Ex=function(r,t,e){return[["M",r-e,t],["A",e,e,0,1,0,r+e,t],["A",e,e,0,1,0,r-e,t],["Z"]]},yI=Ex,bI=function(r,t,e){return[["M",r-e,t-e],["L",r+e,t-e],["L",r+e,t+e],["L",r-e,t+e],["Z"]]},xI=function(r,t,e){return[["M",r-e,t],["L",r,t-e],["L",r+e,t],["L",r,t+e],["Z"]]},EI=function(r,t,e){var n=e*Math.sin(.3333333333333333*Math.PI);return[["M",r-e,t+n],["L",r,t-n],["L",r+e,t+n],["Z"]]},wI=function(r,t,e){var n=e*Math.sin(.3333333333333333*Math.PI);return[["M",r-e,t-n],["L",r+e,t-n],["L",r,t+n],["Z"]]},SI=function(r,t,e){var n=e/2*Math.sqrt(3);return[["M",r,t-e],["L",r+n,t-e/2],["L",r+n,t+e/2],["L",r,t+e],["L",r-n,t+e/2],["L",r-n,t-e/2],["Z"]]},MI=function(r,t,e){var n=e-1.5;return[["M",r-e,t-n],["L",r+e,t+n],["L",r+e,t-n],["L",r-e,t+n],["Z"]]},wx=function(r,t,e){return[["M",r,t+e],["L",r,t-e]]},AI=function(r,t,e){return[["M",r-e,t-e],["L",r+e,t+e],["M",r+e,t-e],["L",r-e,t+e]]},TI=function(r,t,e){return[["M",r-e/2,t-e],["L",r+e/2,t-e],["M",r,t-e],["L",r,t+e],["M",r-e/2,t+e],["L",r+e/2,t+e]]},OI=function(r,t,e){return[["M",r-e,t],["L",r+e,t],["M",r,t-e],["L",r,t+e]]},CI=function(r,t,e){return[["M",r-e,t],["L",r+e,t]]},Sx=function(r,t,e){return[["M",r-e,t],["L",r+e,t]]},NI=Sx,kI=function(r,t,e){return[["M",r-e,t],["A",e/2,e/2,0,1,1,r,t],["A",e/2,e/2,0,1,0,r+e,t]]},PI=function(r,t,e){return[["M",r-e-1,t-2.5],["L",r,t-2.5],["L",r,t+2.5],["L",r+e+1,t+2.5]]},RI=function(r,t,e){return[["M",r-e-1,t+2.5],["L",r,t+2.5],["L",r,t-2.5],["L",r+e+1,t-2.5]]},LI=function(r,t,e){return[["M",r-(e+1),t+2.5],["L",r-e/2,t+2.5],["L",r-e/2,t-2.5],["L",r+e/2,t-2.5],["L",r+e/2,t+2.5],["L",r+e+1,t+2.5]]};function _I(r,t){return[["M",r-5,t+2.5],["L",r-5,t],["L",r,t],["L",r,t-3],["L",r,t+3],["L",r+6.5,t+3]]}var DI=function(r,t,e){return[["M",r-e,t-e],["L",r+e,t],["L",r-e,t+e],["Z"]]},II=function(r,t,e){var n=e,i=e*.2,a=e*.7;return[["M",r-n,t],["A",n,n,0,1,0,r+n,t],["A",n,n,0,1,0,r-n,t],["Z"],["M",r-a,t],["L",r-i,t],["M",r+i,t],["L",r+a,t],["M",r,t-a],["L",r,t-i],["M",r,t+i],["L",r,t+a]]},Zr=Xi({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"),BI=function(r){(0,Z.ZT)(t,r);function t(e){var n=r.call(this,e,{x:0,y:0,animate:{easing:"linear",duration:200,fill:"both"},buttonCursor:"pointer",buttonFill:"black",buttonD:DI(0,0,6),buttonSize:12,controllerPadding:5,controllerSpacing:5,formatter:function(i,a){return"".concat(i,"/").concat(a)},defaultPage:0,loop:!1,orientation:"horizontal",pageNumFill:"black",pageNumFontSize:12,pageNumTextAlign:"start",pageNumTextBaseline:"middle"})||this;return n.playState="idle",n.contentGroup=n.appendChild(new ar({class:Zr.contentGroup.name})),n.playWindow=n.contentGroup.appendChild(new ar({class:Zr.playWindow.name})),n.innerCurrPage=n.defaultPage,n}return Object.defineProperty(t.prototype,"defaultPage",{get:function(){var e=this.attributes.defaultPage;return kn(e,0,Math.max(this.pageViews.length-1,0))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pageViews",{get:function(){return this.playWindow.children},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"controllerShape",{get:function(){return this.totalPages>1?{width:55,height:0}:{width:0,height:0}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pageShape",{get:function(){var e=this.pageViews,n=(0,Z.CR)(mI(e.map(function(h){var d=h.getBBox(),f=d.width,v=d.height;return[f,v]})).map(function(h){return Math.max.apply(Math,(0,Z.ev)([],(0,Z.CR)(h),!1))}),2),i=n[0],a=n[1],s=this.attributes,o=s.pageWidth,l=o===void 0?i:o,c=s.pageHeight,u=c===void 0?a:c;return{pageWidth:l,pageHeight:u}},enumerable:!1,configurable:!0}),t.prototype.getContainer=function(){return this.playWindow},Object.defineProperty(t.prototype,"totalPages",{get:function(){return this.pageViews.length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"currPage",{get:function(){return this.innerCurrPage},enumerable:!1,configurable:!0}),t.prototype.getBBox=function(){var e=r.prototype.getBBox.call(this),n=e.x,i=e.y,a=this.controllerShape,s=this.pageShape,o=s.pageWidth,l=s.pageHeight;return new Lr(n,i,o+a.width,l)},t.prototype.goTo=function(e){var n=this,i=this.attributes.animate,a=this,s=a.currPage,o=a.playState,l=a.playWindow,c=a.pageViews;if(o!=="idle"||e<0||c.length<=0||e>=c.length)return null;c[s].setLocalPosition(0,0),this.prepareFollowingPage(e);var u=(0,Z.CR)(this.getFollowingPageDiff(e),2),h=u[0],d=u[1];this.playState="running";var f=xx(l,[{transform:"translate(0, 0)"},{transform:"translate(".concat(-h,", ").concat(-d,")")}],i);return ko(f,function(){n.innerCurrPage=e,n.playState="idle",n.setVisiblePages([e]),n.updatePageInfo()}),f},t.prototype.prev=function(){var e=this.attributes.loop,n=this.pageViews.length,i=this.currPage;if(!e&&i<=0)return null;var a=e?(i-1+n)%n:kn(i-1,0,n);return this.goTo(a)},t.prototype.next=function(){var e=this.attributes.loop,n=this.pageViews.length,i=this.currPage;if(!e&&i>=n-1)return null;var a=e?(i+1)%n:kn(i+1,0,n);return this.goTo(a)},t.prototype.renderClipPath=function(e){var n=this.pageShape,i=n.pageWidth,a=n.pageHeight;if(!i||!a){this.contentGroup.style.clipPath=void 0;return}this.clipPath=e.maybeAppendByClassName(Zr.clipPath,"rect").styles({width:i,height:a}),this.contentGroup.attr("clipPath",this.clipPath.node())},t.prototype.setVisiblePages=function(e){this.playWindow.children.forEach(function(n,i){e.includes(i)?Gl(n):Hi(n)})},t.prototype.adjustControllerLayout=function(){var e=this,n=e.prevBtnGroup,i=e.nextBtnGroup,a=e.pageInfoGroup,s=this.attributes,o=s.orientation,l=s.controllerPadding,c=a.getBBox(),u=c.width,h=c.height,d=(0,Z.CR)(o==="horizontal"?[-180,0]:[-90,90],2),f=d[0],v=d[1];n.setLocalEulerAngles(f),i.setLocalEulerAngles(v);var g=n.getBBox(),p=g.width,y=g.height,b=i.getBBox(),E=b.width,O=b.height,k=Math.max(p,u,E),P=o==="horizontal"?{offset:[[0,0],[p/2+l,0],[p+u+l*2,0]],textAlign:"start"}:{offset:[[k/2,-y-l],[k/2,0],[k/2,O+l]],textAlign:"center"},F=(0,Z.CR)(P.offset,3),B=(0,Z.CR)(F[0],2),V=B[0],U=B[1],J=(0,Z.CR)(F[1],2),$=J[0],at=J[1],ct=(0,Z.CR)(F[2],2),ft=ct[0],Nt=ct[1],Ct=P.textAlign,gt=a.querySelector("text");gt&&(gt.style.textAlign=Ct),n.setLocalPosition(V,U),a.setLocalPosition($,at),i.setLocalPosition(ft,Nt)},t.prototype.updatePageInfo=function(){var e,n=this,i=n.currPage,a=n.pageViews,s=n.attributes.formatter;a.length<2||((e=this.pageInfoGroup.querySelector(Zr.pageInfo.class))===null||e===void 0||e.attr("text",s(i+1,a.length)),this.adjustControllerLayout())},t.prototype.getFollowingPageDiff=function(e){var n=this.currPage;if(n===e)return[0,0];var i=this.attributes.orientation,a=this.pageShape,s=a.pageWidth,o=a.pageHeight,l=e<n?-1:1;return i==="horizontal"?[l*s,0]:[0,l*o]},t.prototype.prepareFollowingPage=function(e){var n=this,i=n.currPage,a=n.pageViews;if(this.setVisiblePages([e,i]),e!==i){var s=(0,Z.CR)(this.getFollowingPageDiff(e),2),o=s[0],l=s[1];a[e].setLocalPosition(o,l)}},t.prototype.renderController=function(e){var n=this,i=this.attributes,a=i.controllerSpacing,s=i.classNamePrefix,o=s===void 0?"":s,l=this.pageShape,c=l.pageWidth,u=l.pageHeight,h=this.pageViews.length>=2,d=e.maybeAppendByClassName(Zr.controller,"g");if(Ih(d.node(),h),!!h){var f=_e(this.attributes,"button"),v=_e(this.attributes,"pageNum"),g=(0,Z.CR)(Ta(f),2),p=g[0],y=g[1],b=p.size,E=(0,Z._T)(p,["size"]),O=!d.select(Zr.prevBtnGroup.class).node(),k=d.maybeAppendByClassName(Zr.prevBtnGroup,"g").styles(y);this.prevBtnGroup=k.node();var P=k.maybeAppendByClassName(Zr.prevBtn,"path");if(o){var F=_r(Zr.prevBtn.name,Wr.prevBtn,o);P.node().setAttribute("class",F)}var B=d.maybeAppendByClassName(Zr.nextBtnGroup,"g").styles(y);this.nextBtnGroup=B.node();var V=B.maybeAppendByClassName(Zr.nextBtn,"path");if(o){var U=_r(Zr.nextBtn.name,Wr.nextBtn,o);V.node().setAttribute("class",U)}[P,V].forEach(function(ct){ct.styles((0,Z.pi)((0,Z.pi)({},E),{transformOrigin:"center"})),a0(ct.node(),b,!0)});var J=d.maybeAppendByClassName(Zr.pageInfoGroup,"g");this.pageInfoGroup=J.node();var $=J.maybeAppendByClassName(Zr.pageInfo,"text");if($.styles(v),o){var at=_r(Zr.pageInfo.name,Wr.pageInfo,o);$.node().setAttribute("class",at)}this.updatePageInfo(),d.node().setLocalPosition(c+a,u/2),O&&(this.prevBtnGroup.addEventListener("click",function(){n.prev()}),this.nextBtnGroup.addEventListener("click",function(){n.next()}))}},t.prototype.render=function(e,n){var i=e.x,a=i===void 0?0:i,s=e.y,o=s===void 0?0:s;this.attr("transform","translate(".concat(a,", ").concat(o,")"));var l=he(n);this.renderClipPath(l),this.renderController(l),this.setVisiblePages([this.defaultPage]),this.goTo(this.defaultPage)},t.prototype.bindEvents=function(){var e=this,n=_l(function(){return e.render(e.attributes,e)},50);this.playWindow.addEventListener(Fe.INSERTED,n),this.playWindow.addEventListener(Fe.REMOVED,n)},t}(Ln);function FI(r){var t="default";if(zn(r)&&r instanceof Image)t="image";else if(ue(r))t="symbol";else if(Ue(r)){var e=new RegExp("data:(image|text)");r.match(e)?t="base64":/^(https?:\/\/(([a-zA-Z0-9]+-?)+[a-zA-Z0-9]+\.)+[a-zA-Z]+)(:\d+)?(\/.*)?(\?.*)?(#.*)?$/.test(r)?t="url":t="symbol"}return t}function zI(r){var t=FI(r);return["base64","url","image"].includes(t)?"image":r&&t==="symbol"?"path":null}var an=function(r){(0,Z.ZT)(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.prototype.render=function(e,n){var i=e.x,a=i===void 0?0:i,s=e.y,o=s===void 0?0:s,l=this.getSubShapeStyle(e),c=l.symbol,u=l.size,h=u===void 0?16:u,d=(0,Z._T)(l,["symbol","size"]),f=zI(c);ri(!!f,he(n),function(v){v.maybeAppendByClassName("marker",f).attr("className","marker ".concat(f,"-marker")).call(function(g){if(f==="image"){var p=h*2;g.styles({img:c,width:p,height:p,x:a-h,y:o-h})}else{var p=h/2,y=ue(c)?c:t.getSymbol(c);g.styles((0,Z.pi)({d:y==null?void 0:y(a,o,p)},d))}})})},t.MARKER_SYMBOL_MAP=new Map,t.registerSymbol=function(e,n){t.MARKER_SYMBOL_MAP.set(e,n)},t.getSymbol=function(e){return t.MARKER_SYMBOL_MAP.get(e)},t.getSymbols=function(){return Array.from(t.MARKER_SYMBOL_MAP.keys())},t}(Ln);an.registerSymbol("cross",AI),an.registerSymbol("hyphen",CI),an.registerSymbol("line",wx),an.registerSymbol("plus",OI),an.registerSymbol("tick",TI),an.registerSymbol("circle",Ex),an.registerSymbol("point",yI),an.registerSymbol("bowtie",MI),an.registerSymbol("hexagon",SI),an.registerSymbol("square",bI),an.registerSymbol("diamond",xI),an.registerSymbol("triangle",EI),an.registerSymbol("triangle-down",wI),an.registerSymbol("line",wx),an.registerSymbol("dot",Sx),an.registerSymbol("dash",NI),an.registerSymbol("smooth",kI),an.registerSymbol("hv",PI),an.registerSymbol("vh",RI),an.registerSymbol("hvh",LI),an.registerSymbol("vhv",_I),an.registerSymbol("focus",II);function yj(r,t,e){var n=Math.round((r-e)/t);return e+n*t}function jI(r,t,e){var n=1.4,i=n*e;return[["M",r-e,t-i],["L",r+e,t-i],["L",r+e,t+i],["L",r-e,t+i],["Z"]]}var Mx=1.4,Ax=.4;function GI(r,t,e){var n=e,i=n*Mx,a=n/2,s=n/6,o=r+i*Ax;return[["M",r,t],["L",o,t+a],["L",r+i,t+a],["L",r+i,t-a],["L",o,t-a],["Z"],["M",o,t+s],["L",r+i-2,t+s],["M",o,t-s],["L",r+i-2,t-s]]}function WI(r,t,e){var n=e,i=n*Mx,a=n/2,s=n/6,o=t+i*Ax;return[["M",r,t],["L",r-a,o],["L",r-a,t+i],["L",r+a,t+i],["L",r+a,o],["Z"],["M",r-s,o],["L",r-s,t+i-2],["M",r+s,o],["L",r+s,t+i-2]]}an.registerSymbol("hiddenHandle",jI),an.registerSymbol("verticalHandle",GI),an.registerSymbol("horizontalHandle",WI);var bj=function(r,t,e){return r===void 0&&(r="horizontal"),r==="horizontal"?t:e};function xj(r,t,e,n){var i;n===void 0&&(n=4);var a=__read(r,2),s=a[0],o=a[1],l=__read(t,2),c=l[0],u=l[1],h=__read(e,2),d=h[0],f=h[1],v=__read([c,u],2),g=v[0],p=v[1],y=p-g;return g>p&&(i=__read([p,g],2),g=i[0],p=i[1]),y>o-s?[s,o]:g<s?d===s&&f===p?[s,p]:[s,y+s]:p>o?f===o&&d===g?[g,o]:[o-y,o]:[g,p]}function s0(r,t,e){return r===void 0&&(r="horizontal"),r==="horizontal"?t:e}function Ej(r){var t=r&&r.getRenderBounds();if(!t)return{width:0,height:0};var e=t.getMax(),n=t.getMin();return{width:e[0]-n[0],height:e[1]-n[1]}}function Tx(r){var t=r.getLocalBounds(),e=t.min,n=t.max,i=(0,Z.CR)([e,n],2),a=(0,Z.CR)(i[0],2),s=a[0],o=a[1],l=(0,Z.CR)(i[1],2),c=l[0],u=l[1];return{x:s,y:o,width:c-s,height:u-o,left:s,bottom:u,top:o,right:c}}function wj(r,t){var e=select(r).append("text").node();return e.attr(__assign(__assign({},t),{visibility:"hidden"})),e}function ZI(r,t){var e=(0,Z.CR)(r,2),n=e[0],i=e[1],a=(0,Z.CR)(t,2),s=a[0],o=a[1];return n!==s&&i===o}function Sj(r,t){var e=__read(r,2),n=e[0],i=e[1],a=__read(t,2),s=a[0],o=a[1];return n===s&&i!==o}function VI(r,t){var e,n,i=t.attributes;try{for(var a=(0,Z.XA)(Object.entries(i)),s=a.next();!s.done;s=a.next()){var o=(0,Z.CR)(s.value,2),l=o[0],c=o[1];l!=="id"&&l!=="className"&&r.attr(l,c)}}catch(u){e={error:u}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(e)throw e.error}}}function Oa(r){return typeof r=="function"?r():Ue(r)||ie(r)?new n0({style:{text:String(r)}}):r}function UI(r,t){return typeof r=="function"?r():Ue(r)||ie(r)?new Ts({style:(0,Z.pi)((0,Z.pi)({},t),{innerHTML:String(r)})}):r}var zh,o0;function Mj(r){o0=r}var YI=Vv(function(r,t){var e=t.fontSize,n=t.fontFamily,i=t.fontWeight,a=t.fontStyle,s=t.fontVariant;return o0?o0(r,e):(zh||(zh=Vt.offscreenCanvasCreator.getOrCreateContext(void 0)),zh.font=[a,s,i,"".concat(e,"px"),n].join(" "),zh.measureText(r).width)},function(r,t){return[r,Object.values(t||Ox(r)).join()].join("")},4096),Ox=function(r){var t=r.style.fontFamily||"sans-serif",e=r.style.fontWeight||"normal",n=r.style.fontStyle||"normal",i=r.style.fontVariant,a=r.style.fontSize;return a=typeof a=="object"?a.value:a,{fontSize:a,fontFamily:t,fontWeight:e,fontStyle:n,fontVariant:i}};function Cx(r){return r.nodeName==="text"?r:r.nodeName==="g"&&r.children.length===1&&r.children[0].nodeName==="text"?r.children[0]:null}function Nx(r,t){var e=Cx(r);e&&e.attr(t)}function l0(r,t,e){e===void 0&&(e="..."),Nx(r,{wordWrap:!0,wordWrapWidth:t,maxLines:1,textOverflow:e})}function c0(r,t){for(var e in t)t.hasOwnProperty(e)&&e!=="constructor"&&t[e]!==void 0&&(r[e]=t[e])}function HI(r,t,e,n){return t&&c0(r,t),e&&c0(r,e),n&&c0(r,n),r}function XI(r){return r instanceof Element||r instanceof Document}var ze,KI="component-poptip",Ie={CONTAINER:"component-poptip",ARROW:"component-poptip-arrow",TEXT:"component-poptip-text"},kx=(ze={},ze[".".concat(Ie.CONTAINER)]={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"},ze[".".concat(Ie.TEXT)]={"text-align":"center"},ze[".".concat(Ie.CONTAINER,"[data-position='top']")]={transform:"translate(-50%, -100%)"},ze[".".concat(Ie.CONTAINER,"[data-position='left']")]={transform:"translate(-100%, -50%)"},ze[".".concat(Ie.CONTAINER,"[data-position='right']")]={transform:"translate(0, -50%)"},ze[".".concat(Ie.CONTAINER,"[data-position='bottom']")]={transform:"translate(-50%, 0)"},ze[".".concat(Ie.CONTAINER,"[data-position='top-left']")]={transform:"translate(0,-100%)"},ze[".".concat(Ie.CONTAINER,"[data-position='top-right']")]={transform:"translate(-100%,-100%)"},ze[".".concat(Ie.CONTAINER,"[data-position='left-top']")]={transform:"translate(-100%, 0)"},ze[".".concat(Ie.CONTAINER,"[data-position='left-bottom']")]={transform:"translate(-100%, -100%)"},ze[".".concat(Ie.CONTAINER,"[data-position='right-top']")]={transform:"translate(0, 0)"},ze[".".concat(Ie.CONTAINER,"[data-position='right-bottom']")]={transform:"translate(0, -100%)"},ze[".".concat(Ie.CONTAINER,"[data-position='bottom-left']")]={transform:"translate(0, 0)"},ze[".".concat(Ie.CONTAINER,"[data-position='bottom-right']")]={transform:"translate(-100%, 0)"},ze[".".concat(Ie.ARROW)]={width:"4px",height:"4px",transform:"rotate(45deg)","background-color":"rgba(0, 0, 0)",position:"absolute","z-index":-1},ze[".".concat(Ie.CONTAINER,"[data-position='top']")]={transform:"translate(-50%, calc(-100% - 5px))"},ze["[data-position='top'] .".concat(Ie.ARROW)]={bottom:"-2px"},ze[".".concat(Ie.CONTAINER,"[data-position='left']")]={transform:"translate(calc(-100% - 5px), -50%)"},ze["[data-position='left'] .".concat(Ie.ARROW)]={right:"-2px"},ze[".".concat(Ie.CONTAINER,"[data-position='right']")]={transform:"translate(5px, -50%)"},ze["[data-position='right'] .".concat(Ie.ARROW)]={left:"-2px"},ze[".".concat(Ie.CONTAINER,"[data-position='bottom']")]={transform:"translate(-50%, 5px)"},ze["[data-position='bottom'] .".concat(Ie.ARROW)]={top:"-2px"},ze[".".concat(Ie.CONTAINER,"[data-position='top-left']")]={transform:"translate(0, calc(-100% - 5px))"},ze["[data-position='top-left'] .".concat(Ie.ARROW)]={left:"10px",bottom:"-2px"},ze[".".concat(Ie.CONTAINER,"[data-position='top-right']")]={transform:"translate(-100%, calc(-100% - 5px))"},ze["[data-position='top-right'] .".concat(Ie.ARROW)]={right:"10px",bottom:"-2px"},ze[".".concat(Ie.CONTAINER,"[data-position='left-top']")]={transform:"translate(calc(-100% - 5px), 0)"},ze["[data-position='left-top'] .".concat(Ie.ARROW)]={right:"-2px",top:"8px"},ze[".".concat(Ie.CONTAINER,"[data-position='left-bottom']")]={transform:"translate(calc(-100% - 5px), -100%)"},ze["[data-position='left-bottom'] .".concat(Ie.ARROW)]={right:"-2px",bottom:"8px"},ze[".".concat(Ie.CONTAINER,"[data-position='right-top']")]={transform:"translate(5px, 0)"},ze["[data-position='right-top'] .".concat(Ie.ARROW)]={left:"-2px",top:"8px"},ze[".".concat(Ie.CONTAINER,"[data-position='right-bottom']")]={transform:"translate(5px, -100%)"},ze["[data-position='right-bottom'] .".concat(Ie.ARROW)]={left:"-2px",bottom:"8px"},ze[".".concat(Ie.CONTAINER,"[data-position='bottom-left']")]={transform:"translate(0, 5px)"},ze["[data-position='bottom-left'] .".concat(Ie.ARROW)]={top:"-2px",left:"8px"},ze[".".concat(Ie.CONTAINER,"[data-position='bottom-right']")]={transform:"translate(-100%, 5px)"},ze["[data-position='bottom-right'] .".concat(Ie.ARROW)]={top:"-2px",right:"8px"},ze),QI=void 0;function qI(r,t,e,n,i,a){if(i===void 0&&(i=!1),a===void 0&&(a=!1),a)return[r,t];var s=e.getBoundingClientRect(),o=s.x,l=s.y,c=s.width,u=s.height;switch(n){case"top":return i?[o+c/2,l]:[r,l];case"left":return i?[o,l+u/2]:[o,t];case"bottom":return i?[o+c/2,l+u]:[r,l+u];case"right":return i?[o+c,l+u/2]:[o+c,t];case"top-right":case"right-top":return[o+c,l];case"left-bottom":case"bottom-left":return[o,l+u];case"right-bottom":case"bottom-right":return[o+c,l+u];case"top-left":case"left-top":default:return[o,l]}}var JI=function(r){var t;return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return t||(t=r.apply(QI,e)),t}};function $I(r){var t=r&&document.getElementById(r);return t||(t=document.createElement("div"),t.setAttribute("id",r),document.body.appendChild(t)),t}function t6(r){var t=JI($I)(r);return t}var e6=function(r){(0,Z.ZT)(t,r);function t(e){var n=r.call(this,xr({style:{id:KI}},t.defaultOptions,e))||this;return n.visibility="visible",n.map=new Map,n.domStyles="",n.initShape(),n.render(n.attributes,n),n}return Object.defineProperty(t.prototype,"visible",{get:function(){return this.visibility==="visible"},enumerable:!1,configurable:!0}),t.prototype.render=function(e,n){this.visibility=this.style.visibility,this.updatePoptipElement()},t.prototype.update=function(e){this.attr(xr({},this.style,e)),this.render(this.attributes,this)},t.prototype.bind=function(e,n){var i=this;if(e){var a=this.style.text,s=function(l){var c=e,u=i.style,h=a;if(n){var d=typeof n=="function"?n.call(null,l):n,f=d.html,v=d.target,g=(0,Z._T)(d,["html","target"]);u=HI({},i.style,g),(v||v===!1)&&(c=v),typeof f=="string"&&(h=f)}var p=u.position,y=u.arrowPointAtCenter,b=u.follow,E=u.offset;if(c){var O=l,k=O.clientX,P=O.clientY,F=(0,Z.CR)(qI(k,P,c,p,y,b),2),B=F[0],V=F[1];i.showTip(B,V,{text:h,position:p,offset:E})}else i.hideTip()},o=function(){i.hideTip()};e.addEventListener("mousemove",s),e.addEventListener("mouseleave",o),this.map.set(e,[s,o])}},t.prototype.unbind=function(e){if(this.map.has(e)){var n=(0,Z.CR)(this.map.get(e)||[],2),i=n[0],a=n[1];i&&e.removeEventListener("mousemove",i),a&&e.removeEventListener("mouseleave",a),this.map.delete(e)}},t.prototype.clear=function(){this.container.innerHTML=""},t.prototype.destroy=function(){var e=this,n;(0,Z.ev)([],(0,Z.CR)(this.map.keys()),!1).forEach(function(i){return e.unbind(i)}),(n=this.container)===null||n===void 0||n.remove(),r.prototype.destroy.call(this)},t.prototype.showTip=function(e,n,i){var a=wr(i,"text");if(!(a&&typeof a!="string")&&(this.applyStyles(),e&&n&&i)){var s=i.offset,o=i.position;if(o&&this.container.setAttribute("data-position",o),this.setOffsetPosition(e,n,s),typeof a=="string"){var l=this.container.querySelector(".".concat(Ie.TEXT));l&&(l.innerHTML=a)}this.visibility="visible",this.container.style.visibility="visible"}},t.prototype.hideTip=function(){this.visibility="hidden",this.container.style.visibility="hidden"},t.prototype.getContainer=function(){return this.container},t.prototype.getClassName=function(){var e=this.style.containerClassName;return"".concat(Ie.CONTAINER).concat(e?" ".concat(e):"")},t.prototype.initShape=function(){var e=this,n=this.style.id;this.container=t6(n),this.container.className=this.getClassName(),this.container.addEventListener("mousemove",function(){return e.showTip()}),this.container.addEventListener("mouseleave",function(){return e.hideTip()})},t.prototype.updatePoptipElement=function(){var e=this.container;this.clear();var n=this.style,i=n.id,a=n.template,s=n.text;this.container.setAttribute("id",i),this.container.className=this.getClassName();var o='<span class="'.concat(Ie.ARROW,'"></span>');e.innerHTML=o,Ue(a)?e.innerHTML+=a:a&&XI(a)&&e.appendChild(a),s&&(e.getElementsByClassName(Ie.TEXT)[0].textContent=s),this.applyStyles(),this.container.style.visibility=this.visibility},t.prototype.applyStyles=function(){var e=tr({},kx,this.style.domStyles),n=Object.entries(e).reduce(function(a,s){var o=(0,Z.CR)(s,2),l=o[0],c=o[1],u=Object.entries(c).reduce(function(h,d){var f=(0,Z.CR)(d,2),v=f[0],g=f[1];return"".concat(h).concat(v,": ").concat(g,";")},"");return"".concat(a).concat(l,"{").concat(u,"}")},"");if(this.domStyles!==n){this.domStyles=n;var i=this.container.querySelector("style");i&&this.container.removeChild(i),i=document.createElement("style"),i.innerHTML=n,this.container.appendChild(i)}},t.prototype.setOffsetPosition=function(e,n,i){i===void 0&&(i=this.style.offset);var a=(0,Z.CR)(i,2),s=a[0],o=s===void 0?0:s,l=a[1],c=l===void 0?0:l;this.container.style.left="".concat(e+o,"px"),this.container.style.top="".concat(n+c,"px")},t.tag="poptip",t.defaultOptions={style:{x:0,y:0,width:0,height:0,target:null,visibility:"hidden",text:"",position:"top",follow:!1,offset:[0,0],domStyles:kx,template:'<div class="'.concat(Ie.TEXT,'"></div>')}},t}(Ln),er=Xi({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"),n6={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"}}};function r6(r){var t=r.querySelector(er.marker.class);return t?t.style:{}}var i6=function(r){(0,Z.ZT)(t,r);function t(e,n){var i=r.call(this,e,{span:[1,1],marker:function(){return new aa({style:{r:6}})},markerSize:10,labelFill:"#646464",valueFill:"#646464",labelFontSize:12,valueFontSize:12,labelTextBaseline:"middle",valueTextBaseline:"middle"})||this;return i.keyFields={},i.keyFields=n||{},i}return Object.defineProperty(t.prototype,"showValue",{get:function(){var e=this.attributes.valueText;return e?typeof e=="string"||typeof e=="number"?e!=="":typeof e=="function"?!0:e.attr("text")!=="":!1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"actualSpace",{get:function(){var e=this.labelGroup,n=this.valueGroup,i=this.attributes,a=i.markerSize,s=i.focus,o=i.focusMarkerSize,l=e.node().getBBox(),c=l.width,u=l.height,h=n.node().getBBox(),d=h.width,f=h.height,v=s?o!=null?o:12:0;return{markerWidth:a,labelWidth:c,valueWidth:d,focusWidth:v,height:Math.max(a,u,f)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"span",{get:function(){var e=this.attributes.span;if(!e)return[1,1];var n=(0,Z.CR)(Sr(e),2),i=n[0],a=n[1],s=this.showValue?a:0,o=i+s;return[i/o,s/o]},enumerable:!1,configurable:!0}),t.prototype.setAttribute=function(e,n){r.prototype.setAttribute.call(this,e,n)},Object.defineProperty(t.prototype,"shape",{get:function(){var e,n=this.attributes,i=n.markerSize,a=n.width,s=this.actualSpace,o=s.markerWidth,l=s.focusWidth,c=s.height,u=this.actualSpace,h=u.labelWidth,d=u.valueWidth,f=(0,Z.CR)(this.spacing,3),v=f[0],g=f[1],p=f[2];if(a){var y=a-i-v-g-l-p,b=(0,Z.CR)(this.span,2),E=b[0],O=b[1];e=(0,Z.CR)([E*y,O*y],2),h=e[0],d=e[1]}var k=o+h+d+v+g+l+p;return{width:k,height:c,markerWidth:o,labelWidth:h,valueWidth:d,focusWidth:l}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"spacing",{get:function(){var e=this.attributes,n=e.spacing,i=e.focus;if(!n)return[0,0,0];var a=(0,Z.CR)(Sr(n),3),s=a[0],o=a[1],l=a[2];return[s,this.showValue?o:0,i?l:0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"layout",{get:function(){var e=this.shape,n=e.markerWidth,i=e.labelWidth,a=e.valueWidth,s=e.focusWidth,o=e.width,l=e.height,c=(0,Z.CR)(this.spacing,3),u=c[0],h=c[1],d=c[2];return{height:l,width:o,markerWidth:n,labelWidth:i,valueWidth:a,focusWidth:s,position:[n/2,n+u,n+i+u+h,n+i+a+u+h+d+s/2]}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"scaleSize",{get:function(){var e=r6(this.markerGroup.node()),n=this.attributes,i=n.markerSize,a=n.markerStrokeWidth,s=a===void 0?e.strokeWidth:a,o=n.markerLineWidth,l=o===void 0?e.lineWidth:o,c=n.markerStroke,u=c===void 0?e.stroke:c,h=+(s||l||(u?1:0))*Math.sqrt(2),d=this.markerGroup.node().getBBox(),f=d.width,v=d.height;return(1-h/Math.max(f,v))*i},enumerable:!1,configurable:!0}),t.prototype.renderMarker=function(e){var n=this,i=this.attributes,a=i.marker,s=i.classNamePrefix,o=_e(this.attributes,"marker");this.markerGroup=e.maybeAppendByClassName(er.markerGroup,"g").style("zIndex",0),ri(!!a,this.markerGroup,function(){var l,c=n.markerGroup.node(),u=(l=c.childNodes)===null||l===void 0?void 0:l[0],h=_r(er.marker.name,Wr.marker,s),d=typeof a=="string"?new an({style:{symbol:a},className:h}):a();if(u)if(d.nodeName===u.nodeName)u instanceof an?u.update((0,Z.pi)((0,Z.pi)({},o),{symbol:a})):(VI(u,d),he(u).styles(o));else{if(u.remove(),!(d instanceof an)){var v=_r(er.marker.name,Wr.marker,s);d.className=v}he(d).styles(o),c.appendChild(d)}else{if(!(d instanceof an)){var f=_r(er.marker.name,Wr.marker,s);d.className=f,he(d).styles(o)}c.appendChild(d)}n.markerGroup.node().scale(1/n.markerGroup.node().getScale()[0]);var g=a0(n.markerGroup.node(),n.scaleSize,!0);n.markerGroup.node().style._transform="scale(".concat(g,")")})},t.prototype.renderLabel=function(e){var n=_e(this.attributes,"label"),i=n.text,a=(0,Z._T)(n,["text"]),s=this.attributes.classNamePrefix;this.labelGroup=e.maybeAppendByClassName(er.labelGroup,"g").style("zIndex",0);var o=_r(er.label.name,Wr.label,s),l=this.labelGroup.maybeAppendByClassName(er.label,function(){return Oa(i)});l.node().setAttribute("class",o),l.styles(a)},t.prototype.renderValue=function(e){var n=this,i=_e(this.attributes,"value"),a=i.text,s=(0,Z._T)(i,["text"]),o=this.attributes.classNamePrefix;this.valueGroup=e.maybeAppendByClassName(er.valueGroup,"g").style("zIndex",0),ri(this.showValue,this.valueGroup,function(){var l=_r(er.value.name,Wr.value,o),c=n.valueGroup.maybeAppendByClassName(er.value,function(){return Oa(a)});c.node().setAttribute("class",l),c.styles(s)})},t.prototype.createPoptip=function(){var e=this.attributes.poptip,n=e||{},i=n.render,a=(0,Z._T)(n,["render"]),s=new e6({style:tr(n6,a)});return this.poptipGroup=s,s},t.prototype.bindPoptip=function(e){var n=this,i=this.attributes.poptip;if(i){var a=this.poptipGroup||this.createPoptip();a.bind(e,function(){var s=n.attributes,o=s.labelText,l=s.valueText,c=s.markerFill,u=typeof o=="string"?o:o==null?void 0:o.attr("text"),h=typeof l=="string"?l:l==null?void 0:l.attr("text");if(typeof i.render=="function")return{html:i.render((0,Z.pi)((0,Z.pi)({},n.keyFields),{label:u,value:h,color:c}))};var d="";return(typeof u=="string"||typeof u=="number")&&(d+='<div class="component-poptip-label">'.concat(u,"</div>")),(typeof h=="string"||typeof h=="number")&&(d+='<div class="component-poptip-value">'.concat(h,"</div>")),{html:d}})}},t.prototype.renderFocus=function(e){var n=this,i=this.attributes,a=i.focus,s=i.focusMarkerSize,o=i.classNamePrefix,l={x:0,y:0,size:s,opacity:.6,symbol:"focus",stroke:"#aaaaaa",lineWidth:1};Te(a)||(this.focusGroup=e.maybeAppendByClassName(er.focusGroup,"g").style("zIndex",0),ri(a,this.focusGroup,function(){var c=_r(er.focus.name,Wr.focusIcon,o),u=new an({style:(0,Z.pi)((0,Z.pi)({},l),{symbol:"focus"}),className:c}),h=new aa({style:{r:l.size/2,fill:"transparent"}}),d=n.focusGroup.node();d.appendChild(h),d.appendChild(u),u.update({opacity:0}),e.node().addEventListener("pointerenter",function(){u.update({opacity:1})}),e.node().addEventListener("pointerleave",function(){u.update({opacity:0})})}))},t.prototype.renderPoptip=function(e){var n=this,i=this.attributes.poptip;if(i){var a=e.maybeAppendByClassName(er.value,"g").node(),s=e.maybeAppendByClassName(er.label,"g").node();[a,s].forEach(function(o){o&&n.bindPoptip(o)})}},t.prototype.renderBackground=function(e){var n=this.shape,i=n.width,a=n.height,s=_e(this.attributes,"background");this.background=e.maybeAppendByClassName(er.backgroundGroup,"g").style("zIndex",-1);var o=this.background.maybeAppendByClassName(er.background,"rect");o.styles((0,Z.pi)({width:i,height:a},s));var l=this.attributes.classNamePrefix,c=l===void 0?"":l;if(c){var u=_r(er.background.name,Wr.background,c);o.node().setAttribute("class",u)}},t.prototype.adjustLayout=function(){var e=this.layout,n=e.labelWidth,i=e.valueWidth,a=e.height,s=(0,Z.CR)(e.position,4),o=s[0],l=s[1],c=s[2],u=s[3],h=a/2;this.markerGroup.styles({transform:"translate(".concat(o,", ").concat(h,")").concat(this.markerGroup.node().style._transform)}),this.labelGroup.styles({transform:"translate(".concat(l,", ").concat(h,")")}),this.focusGroup&&this.focusGroup.styles({transform:"translate(".concat(u,", ").concat(h,")")}),l0(this.labelGroup.select(er.label.class).node(),Math.ceil(n)),this.showValue&&(this.valueGroup.styles({transform:"translate(".concat(c,", ").concat(h,")")}),l0(this.valueGroup.select(er.value.class).node(),Math.ceil(i)))},t.prototype.render=function(e,n){var i=he(n),a=e.x,s=a===void 0?0:a,o=e.y,l=o===void 0?0:o;i.styles({transform:"translate(".concat(s,", ").concat(l,")")}),this.renderMarker(i),this.renderLabel(i),this.renderValue(i),this.renderBackground(i),this.renderPoptip(i),this.renderFocus(i),this.adjustLayout()},t}(Ln),Hs=Xi({page:"item-page",navigator:"navigator",item:"item"},"items"),Px=function(r,t,e){return e===void 0&&(e=!0),r?t(r):e},a6=function(r){(0,Z.ZT)(t,r);function t(e){var n=r.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:i0,mouseenter:i0,mouseleave:i0})||this;return n.navigatorShape=[0,0],n}return Object.defineProperty(t.prototype,"pageViews",{get:function(){return this.navigator.getContainer()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"grid",{get:function(){var e=this.attributes,n=e.gridRow,i=e.gridCol,a=e.data;if(!n&&!i)throw new Error("gridRow and gridCol can not be set null at the same time");return n&&i?[n,i]:n?[n,a.length]:[a.length,i]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"renderData",{get:function(){var e=this.attributes,n=e.data,i=e.layout,a=e.poptip,s=e.focus,o=e.focusMarkerSize,l=e.classNamePrefix,c=_e(this.attributes,"item"),u=n.map(function(h,d){var f=h.id,v=f===void 0?d:f,g=h.label,p=h.value;return{id:"".concat(v),index:d,style:(0,Z.pi)({layout:i,labelText:g,valueText:p,poptip:a,focus:s,focusMarkerSize:o,classNamePrefix:l},Object.fromEntries(Object.entries(c).map(function(y){var b=(0,Z.CR)(y,2),E=b[0],O=b[1];return[E,ii(O,[h,d,n])]})))}});return u},enumerable:!1,configurable:!0}),t.prototype.getGridLayout=function(){var e=this,n=this.attributes,i=n.orientation,a=n.width,s=n.rowPadding,o=n.colPadding,l=(0,Z.CR)(this.navigatorShape,1),c=l[0],u=(0,Z.CR)(this.grid,2),h=u[0],d=u[1],f=d*h,v=0;return this.pageViews.children.map(function(g,p){var y,b,E=Math.floor(p/f),O=p%f,k=e.ifHorizontal(d,h),P=[Math.floor(O/k),O%k];i==="vertical"&&P.reverse();var F=(0,Z.CR)(P,2),B=F[0],V=F[1],U=(a-c-(d-1)*o)/d,J=g.getBBox().height,$=(0,Z.CR)([0,0],2),at=$[0],ct=$[1];return i==="horizontal"?(y=(0,Z.CR)([v,B*(J+s)],2),at=y[0],ct=y[1],v=V===d-1?0:v+U+o):(b=(0,Z.CR)([V*(U+o),v],2),at=b[0],ct=b[1],v=B===h-1?0:v+J+s),{page:E,index:p,row:B,col:V,pageIndex:O,width:U,height:J,x:at,y:ct}})},t.prototype.getFlexLayout=function(){var e=this.attributes,n=e.width,i=e.height,a=e.rowPadding,s=e.colPadding,o=(0,Z.CR)(this.navigatorShape,1),l=o[0],c=(0,Z.CR)(this.grid,2),u=c[0],h=c[1],d=(0,Z.CR)([n-l,i],2),f=d[0],v=d[1],g=(0,Z.CR)([0,0,0,0,0,0,0,0],8),p=g[0],y=g[1],b=g[2],E=g[3],O=g[4],k=g[5],P=g[6],F=g[7];return this.pageViews.children.map(function(B,V){var U,J,$,at,ct=B.getBBox(),ft=ct.width,Nt=ct.height,Ct=P===0?0:s,gt=P+Ct+ft;if(gt<=f&&Px(O,function(Pt){return Pt<h}))return U=(0,Z.CR)([P+Ct,F,gt],3),p=U[0],y=U[1],P=U[2],{width:ft,height:Nt,x:p,y,page:b,index:V,pageIndex:E++,row:k,col:O++};J=(0,Z.CR)([k+1,0,0,F+Nt+a],4),k=J[0],O=J[1],P=J[2],F=J[3];var bt=F+Nt;return bt<=v&&Px(k,function(Pt){return Pt<u})?($=(0,Z.CR)([P,F,ft],3),p=$[0],y=$[1],P=$[2],{width:ft,height:Nt,x:p,y,page:b,index:V,pageIndex:E++,row:k,col:O++}):(at=(0,Z.CR)([0,0,ft,0,b+1,0,0,0],8),p=at[0],y=at[1],P=at[2],F=at[3],b=at[4],E=at[5],k=at[6],O=at[7],{width:ft,height:Nt,x:p,y,page:b,index:V,pageIndex:E++,row:k,col:O++})})},Object.defineProperty(t.prototype,"itemsLayout",{get:function(){this.navigatorShape=[0,0];var e=this.attributes.layout==="grid"?this.getGridLayout:this.getFlexLayout,n=e.call(this);return n.slice(-1)[0].page>0?(this.navigatorShape=[55,0],e.call(this)):n},enumerable:!1,configurable:!0}),t.prototype.ifHorizontal=function(e,n){var i=this.attributes.orientation;return s0(i,e,n)},t.prototype.flattenPage=function(e){e.querySelectorAll(Hs.item.class).forEach(function(n){e.appendChild(n)}),e.querySelectorAll(Hs.page.class).forEach(function(n){var i=e.removeChild(n);i.destroy()})},t.prototype.renderItems=function(e){var n=this.attributes,i=n.click,a=n.mouseenter,s=n.mouseleave,o=n.classNamePrefix;this.flattenPage(e);var l=this.dispatchCustomEvent.bind(this),c=_r(Hs.item.name,Wr.item,o);he(e).selectAll(Hs.item.class).data(this.renderData,function(u){return u.id}).join(function(u){return u.append(function(h){var d=h.style,f=(0,Z._T)(h,["style"]);return new i6({style:d},f)}).attr("className",c).on("click",function(){i==null||i(this),l("itemClick",{item:this})}).on("pointerenter",function(){a==null||a(this),l("itemMouseenter",{item:this})}).on("pointerleave",function(){s==null||s(this),l("itemMouseleave",{item:this})})},function(u){return u.each(function(h){var d=h.style;this.update(d)})},function(u){return u.remove()})},t.prototype.relayoutNavigator=function(){var e,n=this.attributes,i=n.layout,a=n.width,s=((e=this.pageViews.children[0])===null||e===void 0?void 0:e.getBBox().height)||0,o=(0,Z.CR)(this.navigatorShape,2),l=o[0],c=o[1];this.navigator.update(i==="grid"?{pageWidth:a-l,pageHeight:s-c}:{})},t.prototype.adjustLayout=function(){var e=this,n=Object.entries(dI(this.itemsLayout,"page")).map(function(a){var s=(0,Z.CR)(a,2),o=s[0],l=s[1];return{page:o,layouts:l}}),i=(0,Z.ev)([],(0,Z.CR)(this.navigator.getContainer().children),!1);n.forEach(function(a){var s=a.layouts,o=e.pageViews.appendChild(new ar({className:Hs.page.name}));s.forEach(function(l){var c=l.x,u=l.y,h=l.index,d=l.width,f=l.height,v=i[h];o.appendChild(v),Al(v,"__layout__",l),v.update({x:c,y:u,width:d,height:f})})}),this.relayoutNavigator()},t.prototype.renderNavigator=function(e){var n=this.attributes,i=n.orientation,a=n.classNamePrefix,s=_e(this.attributes,"nav"),o=tr({orientation:i,classNamePrefix:a},s),l=this;return e.selectAll(Hs.navigator.class).data(["nav"]).join(function(c){return c.append(function(){return new BI({style:o})}).attr("className",Hs.navigator.name).each(function(){l.navigator=this})},function(c){return c.each(function(){this.update(o)})},function(c){return c.remove()}),this.navigator},t.prototype.getBBox=function(){return this.navigator.getBBox()},t.prototype.render=function(e,n){var i=this.attributes.data;if(!(!i||i.length===0)){var a=this.renderNavigator(he(n));this.renderItems(a.getContainer()),this.adjustLayout()}},t.prototype.dispatchCustomEvent=function(e,n){var i=new Jn(e,{detail:n});this.dispatchEvent(i)},t}(Ln),Xs=Xi({markerGroup:"marker-group",marker:"marker",labelGroup:"label-group",label:"label"},"handle"),Rx={showLabel:!0,formatter:function(r){return r.toString()},markerSize:25,markerStroke:"#c5c5c5",markerFill:"#fff",markerLineWidth:1,labelFontSize:12,labelFill:"#c5c5c5",labelText:"",orientation:"vertical",spacing:0},Aj=function(r){(0,Z.ZT)(t,r);function t(e){return r.call(this,e,Rx)||this}return t.prototype.render=function(e,n){var i=he(n).maybeAppendByClassName(Xs.markerGroup,"g");this.renderMarker(i);var a=he(n).maybeAppendByClassName(Xs.labelGroup,"g");this.renderLabel(a)},t.prototype.renderMarker=function(e){var n=this,i=this.attributes,a=i.orientation,s=i.classNamePrefix,o=i.markerSymbol,l=o===void 0?s0(a,"horizontalHandle","verticalHandle"):o;ri(!!l,e,function(c){var u=_e(n.attributes,"marker"),h=(0,Z.pi)({symbol:l},u),d=_r(Xs.marker.name,Wr.handleMarker,s);if(n.marker=c.maybeAppendByClassName(Xs.marker,function(){return new an({style:h,className:d})}).update(h),s){var f=n.marker.node().querySelector(".marker");if(f){var v=f.getAttribute("class")||"",g=v.split(" ")[0],p=_r(g,Wr.handleMarker,s);f.setAttribute("class",p)}}})},t.prototype.renderLabel=function(e){var n=this,i=this.attributes,a=i.showLabel,s=i.orientation,o=i.spacing,l=o===void 0?0:o,c=i.formatter,u=i.classNamePrefix;ri(a,e,function(h){var d,f=_e(n.attributes,"label"),v=f.text,g=(0,Z._T)(f,["text"]),p=((d=h.select(Xs.marker.class))===null||d===void 0?void 0:d.node().getBBox())||{},y=p.width,b=y===void 0?0:y,E=p.height,O=E===void 0?0:E,k=(0,Z.CR)(s0(s,[0,O+l,"center","top"],[b+l,0,"start","middle"]),4),P=k[0],F=k[1],B=k[2],V=k[3],U=_r(Xs.label.name,Wr.handleLabel,u);h.maybeAppendByClassName(Xs.label,"text").attr("className",U).styles((0,Z.pi)((0,Z.pi)({},g),{x:P,y:F,text:c(v).toString(),textAlign:B,textBaseline:V}))})},t}(Ln),Lx={showTitle:!0,padding:0,orientation:"horizontal",backgroundFill:"transparent",titleText:"",titleSpacing:4,titlePosition:"top-left",titleFill:"#2C3542",titleFontWeight:"bold",titleFontFamily:"sans-serif",titleFontSize:12},s6=tr({},Lx,{}),Tj=tr({},Lx,No(Rx,"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"}),Oj=.01,Cj=.5,Ks=Xi({title:"title",html:"html",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"),o6=function(r){(0,Z.ZT)(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.prototype.update=function(e){this.attr(e)},t}(Ts),l6=function(r){(0,Z.ZT)(t,r);function t(e){return r.call(this,e,s6)||this}return t.prototype.renderTitle=function(e,n,i){var a=this.attributes,s=a.showTitle,o=a.titleText,l=a.classNamePrefix,c=_e(this.attributes,"title"),u=(0,Z.CR)(Ta(c),2),h=u[0],d=u[1];this.titleGroup=e.maybeAppendByClassName(Ks.titleGroup,"g").styles(d);var f=(0,Z.pi)((0,Z.pi)({width:n,height:i},h),{text:s?o:"",classNamePrefix:l});this.title=this.titleGroup.maybeAppendByClassName(Ks.title,function(){return new hI({style:f})}).update(f)},t.prototype.renderCustom=function(e){var n=this.attributes.data,i={innerHTML:this.attributes.render(n),pointerEvents:"auto"};e.maybeAppendByClassName(Ks.html,function(){return new o6({className:Ks.html.name,style:i})}).update(i)},t.prototype.renderItems=function(e,n){var i=n.x,a=n.y,s=n.width,o=n.height,l=_e(this.attributes,"title",!0),c=(0,Z.CR)(Ta(l),2),u=c[0],h=c[1],d=(0,Z.pi)((0,Z.pi)({},u),{width:s,height:o,x:0,y:0});this.itemsGroup=e.maybeAppendByClassName(Ks.itemsGroup,"g").styles((0,Z.pi)((0,Z.pi)({},h),{transform:"translate(".concat(i,", ").concat(a,")")}));var f=this;this.itemsGroup.selectAll(Ks.items.class).data(["items"]).join(function(v){return v.append(function(){return new a6({style:d})}).attr("className",Ks.items.name).each(function(){f.items=he(this)})},function(v){return v.update(d)},function(v){return v.remove()})},t.prototype.adjustLayout=function(){var e=this.attributes.showTitle;if(e){var n=this.title.node().getAvailableSpace(),i=n.x,a=n.y;this.itemsGroup.node().style.transform="translate(".concat(i,", ").concat(a,")")}},Object.defineProperty(t.prototype,"availableSpace",{get:function(){var e=this.attributes,n=e.showTitle,i=e.width,a=e.height;return n?this.title.node().getAvailableSpace():new Lr(0,0,i,a)},enumerable:!1,configurable:!0}),t.prototype.getBBox=function(){var e,n,i=(e=this.title)===null||e===void 0?void 0:e.node(),a=(n=this.items)===null||n===void 0?void 0:n.node();return!i||!a?r.prototype.getBBox.call(this):lI(i,a)},t.prototype.render=function(e,n){var i=this.attributes,a=i.width,s=i.height,o=i.x,l=o===void 0?0:o,c=i.y,u=c===void 0?0:c,h=i.classNamePrefix,d=i.render,f=he(n),v=n.className||"legend-category";h?n.attr("className","".concat(v," ").concat(h,"legend")):n.className||n.attr("className","legend-category"),n.style.transform="translate(".concat(l,", ").concat(u,")"),d?this.renderCustom(f):(this.renderTitle(f,a,s),this.renderItems(f,this.availableSpace),this.adjustLayout())},t}(Ln);function jh(r){const{width:t,height:e,renderer:n}=r,i=c6(r),a=new bf({width:t,height:e,container:i,renderer:n||new Nl});return[i,a]}function c6(r){var t;const{container:e,className:n,graphCanvas:i}=r;if(e)return typeof e=="string"?document.getElementById(e):e;const a=Co(n,!1),{width:s,height:o,containerStyle:l}=r,[c,u]=u6(r);return Object.assign(a.style,Object.assign({position:"absolute",left:c+"px",top:u+"px",width:s+"px",height:o+"px"},l)),(t=i.getContainer())===null||t===void 0||t.appendChild(a),a}function u6(r){const{width:t,height:e,placement:n,graphCanvas:i}=r,[a,s]=i.getSize(),[o,l]=Ry(n);return[o*(a-t),l*(s-e)]}var h6=function(r,t){var e={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&t.indexOf(n)<0&&(e[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(e[n[i]]=r[n[i]]);return e};class Gh extends fr{constructor(t,e){super(t,Object.assign({},Gh.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:n}=this.context;n.on(Xt.AFTER_DRAW,this.createElement)},this.changeState=(n,i)=>{const{graph:a}=this.context,{typePrefix:s}=this,o=wr(n,[s,"id"]),l=wr(n,[s,"style","labelText"]),[c]=o.split("__"),u=this.fieldMap[c].get(l)||[];a.setElementState(Object.fromEntries(u==null?void 0:u.map(h=>[h,i])))},this.click=n=>{if(this.options.trigger==="hover")return;const i=wr(n,[this.typePrefix,"id"]);this.selectedItems.includes(i)?(this.selectedItems=this.selectedItems.filter(a=>a!==i),this.changeState(n,[])):(this.selectedItems.push(i),this.changeState(n,"selected"))},this.mouseleave=n=>{this.options.trigger!=="click"&&(this.selectedItems=[],this.changeState(n,[]))},this.mouseenter=n=>{if(this.options.trigger==="click")return;const i=wr(n,[this.typePrefix,"id"]);this.selectedItems.includes(i)?this.selectedItems=this.selectedItems.filter(a=>a!==i):(this.selectedItems.push(i),this.changeState(n,"active"))},this.setFieldMap=(n,i,a)=>{if(!n)return;const s=this.fieldMap[a];if(s)if(!s.has(n))s.set(n,[i]);else{const o=s.get(n);o&&(o.push(i),s.set(n,o))}},this.getEvents=()=>({mouseenter:this.mouseenter,mouseleave:this.mouseleave,click:this.click}),this.getMarkerData=(n,i)=>{if(!n)return[];const{model:a,element:s}=this.context,{nodes:o,edges:l,combos:c}=a.getData(),u={},h=p=>ue(n)?n(p):n,d={node:"circle",edge:"line",combo:"rect"},f={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"},v=(p,y)=>s==null?void 0:s.getElementComputedStyle(p,y),g=(p,y)=>{p.forEach(b=>{const{id:E}=b,O=wr(b,["data",h(b)]),k=(s==null?void 0:s.getElementType(y,b))||"circle",P=v(y,b),F=(y==="edge"?P==null?void 0:P.stroke:P==null?void 0:P.fill)||"#1783ff";E&&O&&O.replace(/\s+/g,"")&&(this.setFieldMap(O,E,y),u[O]||(u[O]={id:`${y}__${E}`,label:O,marker:f[k]||d[y],elementType:y,lineWidth:1,stroke:F,fill:F}))})};switch(i){case"node":g(o,"node");break;case"edge":g(l,"edge");break;case"combo":g(c,"combo");break;default:return[]}return Object.values(u)},this.createElement=()=>{if(this.draw){this.updateElement();return}const n=this.options,{width:i,height:a,nodeField:s,edgeField:o,comboField:l,trigger:c,position:u,container:h,containerStyle:d,className:f}=n,v=h6(n,["width","height","nodeField","edgeField","comboField","trigger","position","container","containerStyle","className"]),g=this.getMarkerData(s,"node"),p=this.getMarkerData(o,"edge"),y=this.getMarkerData(l,"combo"),b=[...g,...y,...p],E=Object.assign({width:i,height:a,data:b,itemMarkerLineWidth:({lineWidth:P})=>P,itemMarker:({marker:P})=>P,itemMarkerStroke:({stroke:P})=>P,itemMarkerFill:({fill:P})=>P,gridCol:g.length},v,this.getEvents()),O=new l6({className:"legend",style:E});this.category=O,this.upsertCanvas().appendChild(O),this.draw=!0},this.bindEvents()}update(t){super.update(t),this.clear(),this.createElement()}clear(){var t,e;(t=this.canvas)===null||t===void 0||t.destroy(),(e=this.container)===null||e===void 0||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:i=e,height:a=n,position:s,container:o,containerStyle:l,className:c}=this.options,[u,h]=jh({width:i,height:a,graphCanvas:t,container:o,containerStyle:l,placement:s,className:"legend"});return this.container=u,c&&u.classList.add(c),this.canvas=h,this.canvas}destroy(){this.clear(),this.context.graph.off(Xt.AFTER_DRAW,this.createElement),super.destroy()}}Gh.defaultOptions={position:"bottom",trigger:"hover",orientation:"horizontal",layout:"flex",itemSpacing:4,rowPadding:10,colPadding:10,itemMarkerSize:16,itemLabelFontSize:16,width:240,height:160};class Wh extends fr{constructor(t,e){super(t,Object.assign({},Wh.defaultOptions,e)),this.onDraw=n=>{var i;!((i=n==null?void 0:n.data)===null||i===void 0)&&i.render||this.onRender()},this.landmarkMap=new Map,this.mask=null,this.isMaskDragging=!1,this.onMaskDragStart=n=>{this.mask&&(this.isMaskDragging=!0,this.mask.setPointerCapture(n.pointerId),this.mask.addEventListener("pointermove",this.onMaskDrag),this.mask.addEventListener("pointerup",this.onMaskDragEnd),this.mask.addEventListener("pointercancel",this.onMaskDragEnd))},this.onMaskDrag=n=>{if(!this.mask||!this.isMaskDragging)return;const{size:[i,a]}=this.options,{movementX:s,movementY:o}=n,{left:l,top:c,width:u,height:h}=this.mask.style,[,,d,f]=this.maskBBox;let v=parseInt(l)+s,g=parseInt(c)+o,p=parseInt(u),y=parseInt(h);v<0&&(v=0),g<0&&(g=0),v+p>i&&(v=rs(i-p,0)),g+y>a&&(g=rs(a-y,0)),p<d&&(s>0?(v=rs(v-s,0),p=ns(p+s,i)):s<0&&(p=ns(p-s,i))),y<f&&(o>0?(g=rs(g-o,0),y=ns(y+o,a)):o<0&&(y=ns(y-o,a))),Object.assign(this.mask.style,{left:v+"px",top:g+"px",width:p+"px",height:y+"px"});const b=parseInt(l)-v,E=parseInt(c)-g;if(b===0&&E===0)return;const O=this.context.canvas.getCamera().getZoom(),k=this.canvas.getCamera().getZoom(),P=O/k;this.context.graph.translateBy([b*P,E*P],!1)},this.onMaskDragEnd=n=>{this.mask&&(this.isMaskDragging=!1,this.mask.releasePointerCapture(n.pointerId),this.mask.removeEventListener("pointermove",this.onMaskDrag),this.mask.removeEventListener("pointerup",this.onMaskDragEnd),this.mask.removeEventListener("pointercancel",this.onMaskDragEnd))},this.onTransform=zm(()=>{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=_l(()=>{this.renderMinimap(),this.renderMask()},this.options.delay)}bindEvents(){const{graph:t}=this.context;t.on(Xt.AFTER_DRAW,this.onDraw),t.on(Xt.AFTER_RENDER,this.onRender),t.on(Xt.AFTER_ANIMATE,this.onRender),t.on(Xt.AFTER_TRANSFORM,this.onTransform)}unbindEvents(){const{graph:t}=this.context;t.off(Xt.AFTER_DRAW,this.onDraw),t.off(Xt.AFTER_RENDER,this.onRender),t.off(Xt.AFTER_ANIMATE,this.onRender),t.off(Xt.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,i=e.getData(),a={nodes:i.nodes.filter(c=>n==null?void 0:n.getElement(At(c))),edges:i.edges.filter(c=>{const u=n==null?void 0:n.getElement(At(c));return u&&_1(u)}),combos:i.combos.filter(c=>n==null?void 0:n.getElement(At(c)))};if(!t)return a;const{nodes:s,edges:o,combos:l}=a;return{nodes:s.filter(c=>t(At(c),"node")),edges:o.filter(c=>t(At(c),"edge")),combos:l.filter(c=>t(At(c),"combo"))}}setShapes(t,e){const{nodes:n,edges:i,combos:a}=e,{shape:s}=this.options,{element:o}=this.context,l=(c,u)=>{const h=At(c),d=o==null?void 0:o.getElement(h);if(!d)return;const f=d.getShape("key");let v;if(typeof s=="string"){const g=s;v=d.getShape(g).cloneNode()}else{const g=s(h,u,d);g===d?v=g.cloneNode(!0):v=g}v.setPosition(f.getPosition()),d.style.zIndex&&(v.style.zIndex=d.style.zIndex),v.id=d.id,t.appendChild(v)};t.removeChildren(),i.forEach(c=>l(c,"edge")),a.forEach(c=>l(c,"combo")),n.forEach(c=>l(c,"node"))}initCanvas(){const{renderer:t,size:[e,n]}=this.options;if(this.canvas){const{width:i,height:a}=this.canvas.getConfig();(e!==i||n!==a)&&this.canvas.resize(e,n),t&&this.canvas.setRenderer(t)}else{const{className:i,position:a,container:s,containerStyle:o}=this.options,[l,c]=jh({renderer:t,width:e,height:n,placement:a,className:"minimap",container:s,containerStyle:o,graphCanvas:this.context.canvas});i&&l.classList.add(i),this.container=l,this.canvas=c}return this.setCamera(),this.canvas}createLandmark(t,e,n){const i=`${t.join(",")}-${e.join(",")}-${n}`;if(this.landmarkMap.has(i))return this.landmarkMap.get(i);const s=this.canvas.getCamera().createLandmark(i,{position:t,focalPoint:e,zoom:n});return this.landmarkMap.set(i,s),s}setCamera(){var t;const{canvas:e}=this.context,n=(t=this.canvas)===null||t===void 0?void 0:t.getCamera();if(!n)return;const{size:[i,a],padding:s}=this.options,[o,l,c,u]=hi(s),{min:h,max:d,center:f}=e.getBounds("elements"),v=d[0]-h[0],g=d[1]-h[1],p=i-u-l,y=a-o-c,b=p/v,E=y/g,O=Math.min(b,E),k=this.createLandmark(f,f,O);n.gotoLandmark(k,0)}get maskBBox(){const{canvas:t}=this.context,e=t.getSize(),n=t.getCanvasByViewport([0,0]),i=t.getCanvasByViewport(e),a=this.canvas.canvas2Viewport(Vi(n)),s=this.canvas.canvas2Viewport(Vi(i)),o=s.x-a.x,l=s.y-a.y;return[a.x,a.y,o,l]}calculateMaskBBox(){const{size:[t,e]}=this.options;let[n,i,a,s]=this.maskBBox;return n<0&&(a=ns(a+n,t),n=0),i<0&&(s=ns(s+i,e),i=0),n+a>t&&(a=rs(t-n,0)),i+s>e&&(s=rs(e-i,0)),[ns(n,t),ns(i,e),rs(a,0),rs(s,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",e=>e.preventDefault&&e.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,i]=this.calculateMaskBBox();Object.assign(this.mask.style,{top:e+"px",left:t+"px",width:n+"px",height:i+"px"})}destroy(){var t,e,n;this.unbindEvents(),(t=this.canvas)===null||t===void 0||t.destroy(),(e=this.mask)===null||e===void 0||e.remove(),(n=this.container)===null||n===void 0||n.remove(),super.destroy()}}Wh.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 ns=(r,t)=>Math.min(r,t),rs=(r,t)=>Math.max(r,t);var u0=function(r,t,e,n){function i(a){return a instanceof e?a:new e(function(s){s(a)})}return new(e||(e=Promise))(function(a,s){function o(u){try{c(n.next(u))}catch(h){s(h)}}function l(u){try{c(n.throw(u))}catch(h){s(h)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((n=n.apply(r,t||[])).next())})};const h0={x1:0,y1:0,x2:0,y2:0,visibility:"hidden"};class Zh extends fr{constructor(t,e){super(t,Object.assign({},Zh.defaultOptions,e)),this.initSnapline=()=>{const n=this.context.canvas.getLayer("transient");this.horizontalLine||(this.horizontalLine=n.appendChild(new Os({style:Object.assign(Object.assign({},h0),this.options.horizontalLineStyle)}))),this.verticalLine||(this.verticalLine=n.appendChild(new Os({style:Object.assign(Object.assign({},h0),this.options.verticalLineStyle)})))},this.isHorizontalSticking=!1,this.isVerticalSticking=!1,this.enableStick=!0,this.autoSnapToLine=(n,i,a)=>u0(this,void 0,void 0,function*(){const{verticalX:s,horizontalY:o}=a,{tolerance:l}=this.options,{min:[c,u],max:[h,d],center:[f,v]}=i;let g=0,p=0;s!==null&&(Dr(h,s)<l&&(g=s-h),Dr(c,s)<l&&(g=s-c),Dr(f,s)<l&&(g=s-f),g!==0&&(this.isVerticalSticking=!0)),o!==null&&(Dr(d,o)<l&&(p=o-d),Dr(u,o)<l&&(p=o-u),Dr(v,o)<l&&(p=o-v),p!==0&&(this.isHorizontalSticking=!0)),(g!==0||p!==0)&&(yield this.context.graph.translateElementBy({[n]:[g,p]},!1))}),this.enableSnap=n=>{const{target:i}=n,a=.5;if(this.isHorizontalSticking||this.isVerticalSticking){const[s,o]=this.getDelta(n);if(this.isHorizontalSticking&&this.isVerticalSticking&&Math.abs(s)<=a&&Math.abs(o)<=a)return this.context.graph.translateElementBy({[i.id]:[-s,-o]},!1),!1;if(this.isHorizontalSticking&&Math.abs(o)<=a)return this.context.graph.translateElementBy({[i.id]:[0,-o]},!1),!1;if(this.isVerticalSticking&&Math.abs(s)<=a)return this.context.graph.translateElementBy({[i.id]:[-s,0]},!1),!1;this.isHorizontalSticking=!1,this.isVerticalSticking=!1,this.enableStick=!1,setTimeout(()=>{this.enableStick=!0},200)}return this.enableStick},this.calcSnaplineMetadata=(n,i)=>{const{tolerance:a,shape:s}=this.options,{min:[o,l],max:[c,u],center:[h,d]}=i;let f=null,v=null,g=null,p=null,y=null,b=null;return this.getNodes().some(E=>{if(Wn(n.id,E.id))return!1;const O=_x(E,s).getRenderBounds(),{min:[k,P],max:[F,B],center:[V,U]}=O;return f===null&&(Dr(V,h)<a?f=V:Dr(k,o)<a||Dr(k,c)<a?f=k:(Dr(F,c)<a||Dr(F,o)<a)&&(f=F),f!==null&&(v=Math.min(P,l),g=Math.max(B,u))),p===null&&(Dr(U,d)<a?p=U:Dr(P,l)<a||Dr(P,u)<a?p=P:(Dr(B,u)<a||Dr(B,l)<a)&&(p=B),p!==null&&(y=Math.min(k,o),b=Math.max(F,c))),f!==null&&p!==null}),{verticalX:f,verticalMinY:v,verticalMaxY:g,horizontalY:p,horizontalMinX:y,horizontalMaxX:b}},this.onDragStart=()=>{this.initSnapline()},this.onDrag=n=>u0(this,void 0,void 0,function*(){const{target:i}=n;if(this.options.autoSnap&&!this.enableSnap(n))return;const a=_x(i,this.options.shape).getRenderBounds(),s=this.calcSnaplineMetadata(i,a);this.hideSnapline(),(s.verticalX!==null||s.horizontalY!==null)&&this.updateSnapline(s),this.options.autoSnap&&(yield this.autoSnapToLine(i.id,a,s))}),this.onDragEnd=()=>{this.hideSnapline()},this.bindEvents()}getNodes(){var t;const{filter:e}=this.options,i=(((t=this.context.element)===null||t===void 0?void 0:t.getNodes())||[]).filter(a=>{var s;return _1(a)&&((s=this.context.viewport)===null||s===void 0?void 0:s.isInViewport(a.getRenderBounds()))});return e?i.filter(a=>e(a)):i}hideSnapline(){this.horizontalLine.style.visibility="hidden",this.verticalLine.style.visibility="hidden"}getLineWidth(t){const{lineWidth:e}=this.options[`${t}LineStyle`];return+(e||h0.lineWidth||1)/this.context.graph.getZoom()}updateSnapline(t){const{verticalX:e,verticalMinY:n,verticalMaxY:i,horizontalY:a,horizontalMinX:s,horizontalMaxX:o}=t,[l,c]=this.context.canvas.getSize(),{offset:u}=this.options;a!==null?Object.assign(this.horizontalLine.style,{x1:u===1/0?0:s-u,y1:a,x2:u===1/0?l:o+u,y2:a,visibility:"visible",lineWidth:this.getLineWidth("horizontal")}):this.horizontalLine.style.visibility="hidden",e!==null?Object.assign(this.verticalLine.style,{x1:e,y1:u===1/0?0:n-u,x2:e,y2:u===1/0?c:i+u,visibility:"visible",lineWidth:this.getLineWidth("vertical")}):this.verticalLine.style.visibility="hidden"}getDelta(t){const e=this.context.graph.getZoom();return Zi([t.dx,t.dy],e)}bindEvents(){return u0(this,void 0,void 0,function*(){const{graph:t}=this.context;t.on(Ni.DRAG_START,this.onDragStart),t.on(Ni.DRAG,this.onDrag),t.on(Ni.DRAG_END,this.onDragEnd)})}unbindEvents(){const{graph:t}=this.context;t.off(Ni.DRAG_START,this.onDragStart),t.off(Ni.DRAG,this.onDrag),t.off(Ni.DRAG_END,this.onDragEnd)}destroyElements(){var t,e;(t=this.horizontalLine)===null||t===void 0||t.destroy(),(e=this.verticalLine)===null||e===void 0||e.destroy()}destroy(){this.destroyElements(),this.unbindEvents(),super.destroy()}}Zh.defaultOptions={tolerance:5,offset:20,autoSnap:!0,shape:"key",verticalLineStyle:{stroke:"#1783FF"},horizontalLineStyle:{stroke:"#1783FF"},filter:()=>!0};const Dr=(r,t)=>Math.abs(r-t),_x=(r,t)=>typeof t=="function"?t(r):r.getShape(t);var Dx=null,d6=null;function Vh(r){return r instanceof Date?r:new Date(r)}function f6(r){for(var t=__read(r,2),e=t[0],n=t[1],i=Dx.indexOf(e),a=Dx.indexOf(n),s="",o=i;o<=a;o+=1)if(s+=d6[o],o<a){var l="-";o===2?l=" ":o>2&&(l=":"),s+=l}return s}function Vr(r,t){var e={YYYY:r.getFullYear(),MM:r.getMonth()+1,DD:r.getDate(),HH:r.getHours(),mm:r.getMinutes(),ss:r.getSeconds()},n=t;return Object.keys(e).forEach(function(i){var a=e[i];n=n.replace(i,i==="YYYY"?"".concat(a):"".concat(a).padStart(2,"0"))}),n}function Nj(r,t){return Vh(r).getTime()-Vh(t).getTime()}function kj(r,t){var e=__read([Vh(r),Vh(t)],2),n=e[0],i=e[1];return n.getFullYear()!==i.getFullYear()?"year":n.getMonth()!==i.getMonth()?"month":n.getDay()!==i.getDay()?"day":n.getHours()!==i.getHours()?"hour":n.getMinutes()!==i.getMinutes()?"minute":"second"}function Pj(r,t){var e=new Date(r),n={year:function(i){i.setMonth(0),i.setHours(0,0,0,0)},month:function(i){i.setDate(1),i.setHours(0,0,0,0)},day:function(i){return i.setHours(0,0,0,0)},hour:function(i){return i.setMinutes(0,0,0)},minute:function(i){return i.setSeconds(0,0)},second:function(i){return i.setMilliseconds(0)}};return n[t](e),Vr(e,f6(["year",t]))}function v6(r,t){if(r.length<=t)return r;for(var e=Math.floor(r.length/t),n=[],i=0;i<r.length;i+=e)n.push(r[i]);return n}var sn={gridGroup:"grid-group",mainGroup:"main-group",lineGroup:"line-group",tickGroup:"tick-group",labelGroup:"label-group",titleGroup:"title-group",grid:"grid",line:"line",lineFirst:"line-first",lineSecond:"line-second",tick:"tick",tickItem:"tick-item",label:"label",labelItem:"label-item",title:"title"},d0={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 li({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:[]},Rj=xr({},d0,{style:{type:"arc"}}),Lj=xr({},d0,{style:{}}),Oe=Xi({mainGroup:sn.mainGroup,gridGroup:sn.gridGroup,grid:sn.grid,lineGroup:sn.lineGroup,line:sn.line,tickGroup:sn.tickGroup,tick:sn.tick,tickItem:sn.tickItem,labelGroup:sn.labelGroup,label:sn.label,labelItem:sn.labelItem,titleGroup:sn.titleGroup,title:sn.title,lineFirst:sn.lineFirst,lineSecond:sn.lineSecond},"axis");function Ca(r,t){return[r[0]*t,r[1]*t]}function Wl(r,t){return[r[0]+t[0],r[1]+t[1]]}function f0(r,t){return[r[0]-t[0],r[1]-t[1]]}function Qs(r,t){return[Math.min(r[0],t[0]),Math.min(r[1],t[1])]}function qs(r,t){return[Math.max(r[0],t[0]),Math.max(r[1],t[1])]}function Zl(r,t){return Math.sqrt(Math.pow(r[0]-t[0],2)+Math.pow(r[1]-t[1],2))}function Ix(r){if(r[0]===0&&r[1]===0)return[0,0];var t=Math.sqrt(Math.pow(r[0],2)+Math.pow(r[1],2));return[r[0]/t,r[1]/t]}function _j(r,t,e){var n=__read(r,2),i=n[0],a=n[1],s=__read(t,2),o=s[0],l=s[1],c=i-o,u=a-l,h=Math.sin(e),d=Math.cos(e);return[c*d-u*h+o,c*h+u*d+l]}function g6(r,t){return t?[r[1],-r[0]]:[-r[1],r[0]]}function Po(r){return r*Math.PI/180}function Bx(r){return Number((r*180/Math.PI).toPrecision(5))}function Uh(r,t){return r.style.opacity||(r.style.opacity=1),Ki(r,{opacity:0},t)}var p6=["$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 m6(r){return p6.includes(r)}function Fx(r){var t={};for(var e in r)m6(e)&&(t[e]=r[e]);return t}var Ro=Xi({lineGroup:"line-group",line:"line",regionGroup:"region-group",region:"region"},"grid");function zx(r){return r.reduce(function(t,e,n){return t.push((0,Z.ev)([n===0?"M":"L"],(0,Z.CR)(e),!1)),t},[])}function y6(r,t,e){var n=t.connect,i=n===void 0?"line":n,a=t.center;if(i==="line")return zx(r);if(!a)return[];var s=Zl(r[0],a),o=e?0:1;return r.reduce(function(l,c,u){return u===0?l.push((0,Z.ev)(["M"],(0,Z.CR)(c),!1)):l.push((0,Z.ev)(["A",s,s,0,0,o],(0,Z.CR)(c),!1)),l},[])}function v0(r,t,e){return t.type==="surround"?y6(r,t,e):zx(r)}function b6(r,t,e){var n=e.type,i=e.connect,a=e.center,s=e.closed,o=s?[["Z"]]:[],l=(0,Z.CR)([v0(r,e),v0(t.slice().reverse(),e,!0)],2),c=l[0],u=l[1],h=(0,Z.CR)([r[0],t.slice(-1)[0]],2),d=h[0],f=h[1],v=function(b,E){return[c,b,u,E,o].flat()};if(i==="line"||n==="surround")return v([(0,Z.ev)(["L"],(0,Z.CR)(f),!1)],[(0,Z.ev)(["L"],(0,Z.CR)(d),!1)]);if(!a)throw new Error("Arc grid need to specified center");var g=(0,Z.CR)([Zl(f,a),Zl(d,a)],2),p=g[0],y=g[1];return v([(0,Z.ev)(["A",p,p,0,0,1],(0,Z.CR)(f),!1),(0,Z.ev)(["L"],(0,Z.CR)(f),!1)],[(0,Z.ev)(["A",y,y,0,0,0],(0,Z.CR)(d),!1),(0,Z.ev)(["L"],(0,Z.CR)(d),!1)])}function x6(r,t,e,n){var i=e.animate,a=e.isBillboard,s=t.map(function(o,l){return{id:o.id||"grid-line-".concat(l),d:v0(o.points,e)}});return r.selectAll(Ro.line.class).data(s,function(o){return o.id}).join(function(o){return o.append("path").each(function(l,c){var u=ii(Fx((0,Z.pi)({d:l.d},n)),[l,c,s]);this.attr((0,Z.pi)({class:Ro.line.name,stroke:"#D9D9D9",lineWidth:1,lineDash:[4,4],isBillboard:a},u))})},function(o){return o.transition(function(l,c){var u=ii(Fx((0,Z.pi)({d:l.d},n)),[l,c,s]);return Ki(this,u,i.update)})},function(o){return o.transition(function(){var l=this,c=Uh(this,i.exit);return ko(c,function(){return l.remove()}),c})}).transitions()}function E6(r,t,e){var n=e.animate,i=e.connect,a=e.areaFill;if(t.length<2||!a||!i)return[];for(var s=Array.isArray(a)?a:[a,"transparent"],o=function(v){return s[v%s.length]},l=[],c=0;c<t.length-1;c++){var u=(0,Z.CR)([t[c].points,t[c+1].points],2),h=u[0],d=u[1],f=b6(h,d,e);l.push({d:f,fill:o(c)})}return r.selectAll(Ro.region.class).data(l,function(v,g){return g}).join(function(v){return v.append("path").each(function(g,p){var y=ii(g,[g,p,l]);this.attr(y)}).attr("className",Ro.region.name)},function(v){return v.transition(function(g,p){var y=ii(g,[g,p,l]);return Ki(this,y,n.update)})},function(v){return v.transition(function(){var g=this,p=Uh(this,n.exit);return ko(p,function(){return g.remove()}),p})}).transitions()}function w6(r){var t=r.data,e=t===void 0?[]:t,n=r.closed;return n?e.map(function(i){var a=i.points,s=(0,Z.CR)(a,1),o=s[0];return(0,Z.pi)((0,Z.pi)({},i),{points:(0,Z.ev)((0,Z.ev)([],(0,Z.CR)(a),!1),[o],!1)})}):e}var S6=function(r){(0,Z.ZT)(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.prototype.render=function(e,n){var i=e.type,a=e.center,s=e.areaFill,o=e.closed,l=(0,Z._T)(e,["type","center","areaFill","closed"]),c=w6(e),u=he(n).maybeAppendByClassName(Ro.lineGroup,"g"),h=he(n).maybeAppendByClassName(Ro.regionGroup,"g"),d=x6(u,c,e,l),f=E6(h,c,e);return(0,Z.ev)((0,Z.ev)([],(0,Z.CR)(d),!1),(0,Z.CR)(f),!1)},t}(Ln),M6=function(r,t){return function(e){return r*(1-e)+t*e}};function A6(r,t){var e=t?t.length:0,n=r?Math.min(e,r.length):0;return function(i){var a=new Array(n),s=new Array(e),o=0;for(o=0;o<n;++o)a[o]=g0(r[o],t[o]);for(;o<e;++o)s[o]=t[o];for(o=0;o<n;++o)s[o]=a[o](i);return s}}function T6(r,t){r===void 0&&(r={}),t===void 0&&(t={});var e={},n={};return Object.entries(t).forEach(function(i){var a=(0,Z.CR)(i,2),s=a[0],o=a[1];s in r?e[s]=g0(r[s],o):n[s]=o}),function(i){return Object.entries(e).forEach(function(a){var s=(0,Z.CR)(a,2),o=s[0],l=s[1];return n[o]=l(i)}),n}}function g0(r,t){return typeof r=="number"&&typeof t=="number"?M6(r,t):Array.isArray(r)&&Array.isArray(t)?A6(r,t):typeof r=="object"&&typeof t=="object"?T6(r,t):function(e){return r}}function O6(r,t,e,n){if(!n)return r.attr("__keyframe_data__",e),null;var i=n.duration,a=i===void 0?0:i,s=g0(t,e),o=Math.ceil(+a/16),l=new Array(o).fill(0).map(function(c,u,h){return{__keyframe_data__:s(u/(h.length-1))}});return r.animate(l,(0,Z.pi)({fill:"both"},n))}function jx(r,t){var e={},n=Array.isArray(t)?t:[t];for(var i in r)n.includes(i)||(e[i]=r[i]);return e}function Gx(r,t){return Object.fromEntries(Object.entries(r).map(function(e){var n=(0,Z.CR)(e,2),i=n[0],a=n[1];return[i,ii(a,t)]}))}function Dj(r){if(r.type==="linear"){var t=r.startPos,e=r.endPos;return __spreadArray(__spreadArray([],__read(t),!1),__read(e),!1)}var n=r.startAngle,i=r.endAngle,a=r.center,s=r.radius;return __spreadArray(__spreadArray([n,i],__read(a),!1),[s],!1)}function p0(r,t){return t&&ue(t)?r.filter(t):r}function Wx(r,t){var e=t.startAngle,n=t.endAngle;return(n-e)*r+e}function Yh(r,t){if(t.type==="linear"){var e=(0,Z.CR)(t.startPos,2),n=e[0],i=e[1],a=(0,Z.CR)(t.endPos,2),s=a[0],o=a[1],l=(0,Z.CR)([s-n,o-i],2),c=l[0],u=l[1];return Ix([c,u])}var h=Po(Wx(r,t));return[-Math.sin(h),Math.cos(h)]}function m0(r,t,e){var n=Yh(r,e);return g6(n,t!=="positive")}function Lo(r,t){return m0(r,t.labelDirection,t)}function Vl(r,t,e){return e?"".concat(r," ").concat(e,"axis-").concat(t):r}function Ij(r,t,e){var n=r.classNamePrefix,i=n===void 0?"":n;return Vl(t.name,e,i)}function pi(r,t,e,n){return n&&r.attr("className",Vl(t.name,e,n)),r}function C6(r,t){var e=(0,Z.CR)(t.startPos,2),n=e[0],i=e[1],a=(0,Z.CR)(t.endPos,2),s=a[0],o=a[1],l=(0,Z.CR)([s-n,o-i],2),c=l[0],u=l[1];return[n+c*r,i+u*r]}function N6(r,t){var e=t.radius,n=(0,Z.CR)(t.center,2),i=n[0],a=n[1],s=Po(Wx(r,t));return[i+e*Math.cos(s),a+e*Math.sin(s)]}function Hh(r,t){return t.type==="linear"?C6(r,t):N6(r,t)}function y0(r){return Yh(0,r)[1]===0}function Zx(r){return Yh(0,r)[0]===0}function Vx(r,t){return t-r===360}function Ux(r,t,e,n,i){var a=t-r,s=(0,Z.CR)([i,i],2),o=s[0],l=s[1],c=(0,Z.CR)([Po(r),Po(t)],2),u=c[0],h=c[1],d=function(U){return[e+i*Math.cos(U),n+i*Math.sin(U)]},f=(0,Z.CR)(d(u),2),v=f[0],g=f[1],p=(0,Z.CR)(d(h),2),y=p[0],b=p[1];if(Vx(r,t)){var E=(h+u)/2,O=(0,Z.CR)(d(E),2),k=O[0],P=O[1];return[["M",v,g],["A",o,l,0,1,0,k,P],["A",o,l,0,1,0,y,b]]}var F=a>180?1:0,B=r>t?0:1,V=!1;return V?"M".concat(e,",").concat(n,",L").concat(v,",").concat(g,",A").concat(o,",").concat(l,",0,").concat(F,",").concat(B,",").concat(y,",").concat(b,",L").concat(e,",").concat(n):"M".concat(v,",").concat(g,",A").concat(o,",").concat(l,",0,").concat(F,",").concat(B,",").concat(y,",").concat(b)}function k6(r){var t=r.attributes,e=t.startAngle,n=t.endAngle,i=t.center,a=t.radius;return(0,Z.ev)((0,Z.ev)([e,n],(0,Z.CR)(i),!1),[a],!1)}function P6(r,t,e,n){var i=t.startAngle,a=t.endAngle,s=t.center,o=t.radius,l=t.classNamePrefix;return r.selectAll(Oe.line.class).data([{d:Ux.apply(void 0,(0,Z.ev)((0,Z.ev)([i,a],(0,Z.CR)(s),!1),[o],!1))}],function(c,u){return u}).join(function(c){var u=c.append("path").attr("className",Oe.line.name).styles(t).styles({d:function(h){return h.d}});return pi(u,Oe.line,sn.line,l),u},function(c){return c.transition(function(){var u=this,h=O6(this,k6(this),(0,Z.ev)((0,Z.ev)([i,a],(0,Z.CR)(s),!1),[o],!1),n.update);if(h){var d=function(){var f=wr(u.attributes,"__keyframe_data__");u.style.d=Ux.apply(void 0,(0,Z.ev)([],(0,Z.CR)(f),!1))};h.onframe=d,h.onfinish=d}return h}).styles(t)},function(c){return c.remove()}).styles(e).transitions()}function R6(r,t){var e=t.truncRange,n=t.truncShape,i=t.lineExtension}function L6(r,t,e){e===void 0&&(e=[0,0]);var n=(0,Z.CR)([r,t,e],3),i=(0,Z.CR)(n[0],2),a=i[0],s=i[1],o=(0,Z.CR)(n[1],2),l=o[0],c=o[1],u=(0,Z.CR)(n[2],2),h=u[0],d=u[1],f=(0,Z.CR)([l-a,c-s],2),v=f[0],g=f[1],p=Math.sqrt(Math.pow(v,2)+Math.pow(g,2)),y=(0,Z.CR)([-h/p,d/p],2),b=y[0],E=y[1];return[b*v,b*g,E*v,E*g]}function Yx(r){var t=(0,Z.CR)(r,2),e=(0,Z.CR)(t[0],2),n=e[0],i=e[1],a=(0,Z.CR)(t[1],2),s=a[0],o=a[1];return{x1:n,y1:i,x2:s,y2:o}}function _6(r,t,e,n){var i=t.showTrunc,a=t.startPos,s=t.endPos,o=t.truncRange,l=t.lineExtension,c=t.classNamePrefix,u=(0,Z.CR)([a,s],2),h=(0,Z.CR)(u[0],2),d=h[0],f=h[1],v=(0,Z.CR)(u[1],2),g=v[0],p=v[1],y=(0,Z.CR)(l?L6(a,s,l):new Array(4).fill(0),4),b=y[0],E=y[1],O=y[2],k=y[3],P=function(bt){return r.selectAll(Oe.line.class).data(bt,function(Pt,zt){return zt}).join(function(Pt){var zt=Pt.append("line").styles(e).transition(function(Ut){return Ki(this,Yx(Ut.line),!1)});return zt.attr("className",function(Ut){if(!c)return"".concat(Oe.line.name," ").concat(Ut.className);var $t=Vl(Oe.line.name,sn.line,c);if(Ut.className===Oe.lineFirst.name){var re=Vl(Oe.lineFirst.name,sn.lineFirst,c);return"".concat($t," ").concat(re)}if(Ut.className===Oe.lineSecond.name){var re=Vl(Oe.lineSecond.name,sn.lineSecond,c);return"".concat($t," ").concat(re)}return $t}),zt},function(Pt){return Pt.styles(e).transition(function(zt){var Ut=zt.line;return Ki(this,Yx(Ut),n.update)})},function(Pt){return Pt.remove()}).transitions()};if(!i||!o)return P([{line:[[d+b,f+E],[g+O,p+k]],className:Oe.line.name}]);var F=(0,Z.CR)(o,2),B=F[0],V=F[1],U=g-d,J=p-f,$=(0,Z.CR)([d+U*B,f+J*B],2),at=$[0],ct=$[1],ft=(0,Z.CR)([d+U*V,f+J*V],2),Nt=ft[0],Ct=ft[1],gt=P([{line:[[d+b,f+E],[at,ct]],className:Oe.lineFirst.name},{line:[[Nt,Ct],[g+O,p+k]],className:Oe.lineSecond.name}]);return R6(r,t),gt}function D6(r,t,e,n){var i=e.showArrow,a=e.showTrunc,s=e.lineArrow,o=e.lineArrowOffset,l=e.lineArrowSize,c;if(t==="arc"?c=r.select(Oe.line.class):a?c=r.select(Oe.lineSecond.class):c=r.select(Oe.line.class),!i||!s||e.type==="arc"&&Vx(e.startAngle,e.endAngle)){var u=c.node();u&&(u.style.markerEnd=void 0);return}var h=Oa(s);h.attr(n),a0(h,l,!0),c.style("markerEnd",h).style("markerEndOffset",-o)}function I6(r,t,e){var n=t.type,i,a=_e(t,"line");return n==="linear"?i=_6(r,t,jx(a,"arrow"),e):i=P6(r,t,jx(a,"arrow"),e),D6(r,n,t,a),i}function B6(r,t){return m0(r,t.gridDirection,t)}function Hx(r){var t=r.type,e=r.gridCenter;return t==="linear"?e:e||r.center}function F6(r,t){var e=t.gridLength;return r.map(function(n,i){var a=n.value,s=(0,Z.CR)(Hh(a,t),2),o=s[0],l=s[1],c=(0,Z.CR)(Ca(B6(a,t),e),2),u=c[0],h=c[1];return{id:i,points:[[o,l],[o+u,l+h]]}})}function z6(r,t){var e=t.gridControlAngles,n=Hx(t);if(!n)throw new Error("grid center is not provide");if(r.length<2)throw new Error("Invalid grid data");if(!e||e.length===0)throw new Error("Invalid gridControlAngles");var i=(0,Z.CR)(n,2),a=i[0],s=i[1];return r.map(function(o,l){var c=o.value,u=(0,Z.CR)(Hh(c,t),2),h=u[0],d=u[1],f=(0,Z.CR)([h-a,d-s],2),v=f[0],g=f[1],p=[];return e.forEach(function(y){var b=Po(y),E=(0,Z.CR)([Math.cos(b),Math.sin(b)],2),O=E[0],k=E[1],P=v*O-g*k+a,F=v*k+g*O+s;p.push([P,F])}),{points:p,id:l}})}function j6(r,t,e,n){var i=e.classNamePrefix,a=_e(e,"grid"),s=a.type,o=a.areaFill,l=Hx(e),c=p0(t,e.gridFilter),u=s==="segment"?F6(c,e):z6(c,e),h=(0,Z.pi)((0,Z.pi)({},a),{center:l,areaFill:ue(o)?c.map(function(d,f){return ii(o,[d,f,c])}):o,animate:n,data:u});return r.selectAll(Oe.grid.class).data([1]).join(function(d){var f=d.append(function(){return new S6({style:h})}).attr("className",Oe.grid.name);return pi(f,Oe.grid,sn.grid,i),f},function(d){return d.transition(function(){return this.update(h)})},function(d){return d.remove()}).transitions()}function Mr(r,t,e,n,i){return n===void 0&&(n=!0),i===void 0&&(i=!1),n&&r===t||i&&r===e?!0:r>t&&r<e}var G6=function(r){var t=new DOMParser,e=t.parseFromString(r,"text/html"),n=e.body.firstElementChild;if(console.log(n==null?void 0:n.getClientRects(),11),!n)return 0;var i=n.getAttribute("style")||"",a=Object.fromEntries(i.split(";").map(function(p){return p.trim()}).filter(function(p){return p.includes(":")}).map(function(p){var y=(0,Z.CR)(p.split(":").map(function(O){return O.trim()}),2),b=y[0],E=y[1];return[b.toLowerCase(),E]})),s=function(p){if(!p)return 0;var y=p.match(/([\d.]+)px/);return y?parseFloat(y[1]):0};if(a.height)return s(a.height);var o=s(a["font-size"])||16,l=a["line-height"],c;!l||l==="normal"?c=1.2*o:l.endsWith("px")?c=s(l):/^[\d.]+$/.test(l)?c=parseFloat(l)*o:c=o;var u=s(a["padding-top"]),h=s(a["padding-bottom"]);if(a.padding){var d=a.padding.split(/\s+/).map(s);d.length===1||d.length===2?(u=d[0],h=d[0]):(d.length===3||d.length===4)&&(u=d[0],h=d[2])}var f=s(a["border-top-width"]),v=s(a["border-bottom-width"]);if(a.border){var g=a.border.match(/([\d.]+)px/);g&&(f=parseFloat(g[1]),v=parseFloat(g[1]))}if(a["border-width"]){var d=a["border-width"].split(/\s+/).map(s);d.length===1||d.length===2?(f=d[0],v=d[0]):(d.length===3||d.length===4)&&(f=d[0],v=d[2])}return c+u+h+f+v};function W6(r,t,e,n){e===void 0&&(e=2),n===void 0&&(n="top"),Nx(r,{wordWrap:!0,wordWrapWidth:t,maxLines:e,textBaseline:n})}function Z6(r,t,e){var n=r.getBBox(),i=n.width,a=n.height,s=(0,Z.CR)([t,e].map(function(c,u){var h;return c.includes("%")?parseFloat(((h=c.match(/[+-]?([0-9]*[.])?[0-9]+/))===null||h===void 0?void 0:h[0])||"0")/100*(u===0?i:a):c}),2),o=s[0],l=s[1];return[o,l]}function Xx(r,t){if(t)try{var e=/translate\(([+-]*[\d]+[%]*),[ ]*([+-]*[\d]+[%]*)\)/g,n=t.replace(e,function(i,a,s){return"translate(".concat(Z6(r,a,s),")")});r.attr("transform",n)}catch(i){}}var b0=function(){function r(t,e,n,i){this.set(t,e,n,i)}return Object.defineProperty(r.prototype,"left",{get:function(){return this.x1},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"top",{get:function(){return this.y1},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"right",{get:function(){return this.x2},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"bottom",{get:function(){return this.y2},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"width",{get:function(){return this.defined("x2")&&this.defined("x1")?this.x2-this.x1:void 0},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"height",{get:function(){return this.defined("y2")&&this.defined("y1")?this.y2-this.y1:void 0},enumerable:!1,configurable:!0}),r.prototype.rotatedPoints=function(t,e,n){var i=this,a=i.x1,s=i.y1,o=i.x2,l=i.y2,c=Math.cos(t),u=Math.sin(t),h=e-e*c+n*u,d=n-e*u-n*c,f=[[c*a-u*l+h,u*a+c*l+d],[c*o-u*l+h,u*o+c*l+d],[c*a-u*s+h,u*a+c*s+d],[c*o-u*s+h,u*o+c*s+d]];return f},r.prototype.set=function(t,e,n,i){return n<t?(this.x2=t,this.x1=n):(this.x1=t,this.x2=n),i<e?(this.y2=e,this.y1=i):(this.y1=e,this.y2=i),this},r.prototype.defined=function(t){return this[t]!==Number.MAX_VALUE&&this[t]!==-Number.MAX_VALUE},r}();function Xh(r,t){var e=r.getEulerAngles()||0;r.setEulerAngles(0);var n=r.getBounds(),i=(0,Z.CR)(n.min,2),a=i[0],s=i[1],o=(0,Z.CR)(n.max,2),l=o[0],c=o[1],u=r.getBBox(),h=u.width,d=u.height,f=d,v=0,g=0,p=a,y=s,b=Cx(r);if(b){f-=1.5;var E=b.style.textAlign,O=b.style.textBaseline;E==="center"?p=(a+l)/2:(E==="right"||E==="end")&&(p=l),O==="middle"?y=(s+c)/2:O==="bottom"&&(y=c)}var k=(0,Z.CR)(Sr(t),4),P=k[0],F=P===void 0?0:P,B=k[1],V=B===void 0?0:B,U=k[2],J=U===void 0?F:U,$=k[3],at=$===void 0?V:$,ct=new b0((v+=a)-at,(g+=s)-F,v+h+V,g+f+J);return r.setEulerAngles(e),ct.rotatedPoints(Po(e),p,y)}function Ul(r,t){return t[0]<=Math.max(r[0][0],r[1][0])&&t[0]<=Math.min(r[0][0],r[1][0])&&t[1]<=Math.max(r[0][1],r[1][1])&&t[1]<=Math.min(r[0][1],r[1][1])}function Yl(r,t,e){var n=(t[1]-r[1])*(e[0]-t[0])-(t[0]-r[0])*(e[1]-t[1]);return n===0?0:n<0?2:1}function V6(r,t){var e=Yl(r[0],r[1],t[0]),n=Yl(r[0],r[1],t[1]),i=Yl(t[0],t[1],r[0]),a=Yl(t[0],t[1],r[1]);return!!(e!==n&&i!==a||e===0&&Ul(r,t[0])||n===0&&Ul(r,t[1])||i===0&&Ul(t,r[0])||a===0&&Ul(t,r[1]))}function U6(r,t){var e=r.length;if(e<3)return!1;var n=[t,[9999,t[1]]],i=0,a=0;do{var s=[r[a],r[(a+1)%e]];if(V6(s,n)){if(Yl(s[0],t,s[1])===0)return Ul(s,t);i++}a=(a+1)%e}while(a!==0);return!!(i&1)}function Y6(r,t){return t.every(function(e){return U6(r,e)})}function H6(r,t,e){var n=r.x1,i=r.x2,a=r.y1,s=r.y2,o=[[n,a],[i,a],[i,s],[n,s]],l=Xh(t,e);return Y6(o,l)}function Kx(r,t){var e=(0,Z.CR)(r,4),n=e[0],i=e[1],a=e[2],s=e[3],o=(0,Z.CR)(t,4),l=o[0],c=o[1],u=o[2],h=o[3],d=a-n,f=s-i,v=u-l,g=h-c,p=d*g-v*f;if(p===0)return!1;var y=p>0,b=n-l,E=i-c,O=d*E-f*b;if(O<0===y)return!1;var k=v*E-g*b;return!(k<0===y||O>p===y||k>p===y)}function Qx(r,t){var e=[[r[0],r[1],r[2],r[3]],[r[2],r[3],r[4],r[5]],[r[4],r[5],r[6],r[7]],[r[6],r[7],r[0],r[1]]];return e.some(function(n){return Kx(t,n)})}var Bj={lineToLine:Kx,intersectBoxLine:Qx,getBounds:Xh};function X6(r,t,e){var n,i,a=Xh(r,e).flat(1),s=Xh(t,e).flat(1),o=[[a[0],a[1],a[2],a[3]],[a[0],a[1],a[4],a[5]],[a[4],a[5],a[6],a[7]],[a[2],a[3],a[6],a[7]]];try{for(var l=(0,Z.XA)(o),c=l.next();!c.done;c=l.next()){var u=c.value;if(Qx(s,u))return!0}}catch(h){n={error:h}}finally{try{c&&!c.done&&(i=l.return)&&i.call(l)}finally{if(n)throw n.error}}return!1}function K6(r,t){var e=r.type,n=r.labelDirection,i=r.crossSize;if(!i)return!1;if(e==="arc"){var a=r.center,s=r.radius,o=(0,Z.CR)(a,2),l=o[0],c=o[1],u=n==="negative"?0:i,h=-s-u,d=s+u,f=(0,Z.CR)(Sr(t),4),v=f[0],g=f[1],p=f[2],y=f[3];return new b0(l+h-y,c+h-v,l+d+g,c+d+p)}var b=(0,Z.CR)(r.startPos,2),E=b[0],O=b[1],k=(0,Z.CR)(r.endPos,2),P=k[0],F=k[1],B=(0,Z.CR)(Zx(r)?[-t,0,t,0]:[0,t,0,-t],4),V=B[0],U=B[1],J=B[2],$=B[3],at=Lo(0,r),ct=Ca(at,i),ft=new b0(E,O,P,F);return ft.x1+=$,ft.y1+=V,ft.x2+=U+ct[0],ft.y2+=J+ct[1],ft}function Kh(r,t,e){var n,i,a=t.crossPadding,s=new Set,o=null,l=K6(t,a),c=function(v){return l?H6(l,v):!0},u=function(v,g){return!v||!v.firstChild?!0:!X6(v.firstChild,g.firstChild,Sr(e))};try{for(var h=(0,Z.XA)(r),d=h.next();!d.done;d=h.next()){var f=d.value;c(f)?!o||u(o,f)?o=f:(s.add(o),s.add(f)):s.add(f)}}catch(v){n={error:v}}finally{try{d&&!d.done&&(i=h.return)&&i.call(h)}finally{if(n)throw n.error}}return Array.from(s)}function x0(r,t){return t===void 0&&(t={}),be(r)?0:typeof r=="number"?r:Math.floor(YI(r,t))}function Q6(r,t,e,n){if(!(r.length<=0)){var i=t.suffix,a=i===void 0?"...":i,s=t.minLength,o=t.maxLength,l=o===void 0?1/0:o,c=t.step,u=c===void 0?" ":c,h=t.margin,d=h===void 0?[0,0,0,0]:h,f=Ox(n.getTextShape(r[0])),v=x0(u,f),g=s?x0(s,f):v,p=x0(l,f);(be(p)||p===1/0)&&(p=Math.max.apply(null,r.map(function(ct){return ct.getBBox().width})));for(var y=r.slice(),b=(0,Z.CR)(d,4),E=b[0],O=E===void 0?0:E,k=b[1],P=k===void 0?0:k,F=b[2],B=F===void 0?O:F,V=b[3],U=V===void 0?P:V,J=function(ct){if(y.forEach(function(ft){n.ellipsis(n.getTextShape(ft),ct,a)}),y=Kh(r,e,d),y.length<1)return{value:void 0}},$=p;$>g+v;$-=v){var at=J($);if(typeof at=="object")return at.value}}}var q6=function(r){return r!==void 0&&r!=null&&!Number.isNaN(r)},J6={parity:function(r,t){var e=t.seq,n=e===void 0?2:e;return r.filter(function(i,a){return a%n?(Hi(i),!1):!0})}},$6=function(r){return r.filter(q6)};function t5(r,t,e,n){var i=r.length,a=t.keepHeader,s=t.keepTail;if(!(i<=1||i===2&&a&&s)){var o=J6.parity,l=function(E){return E.forEach(n.show),E},c=2,u=r.slice(),h=r.slice(),d=Math.min.apply(Math,(0,Z.ev)([1],(0,Z.CR)(r.map(function(E){return E.getBBox().width})),!1));if(e.type==="linear"&&(y0(e)||Zx(e))){var f=Tx(r[0]).left,v=Tx(r[i-1]).right,g=Math.abs(v-f)||1;c=Math.max(Math.floor(i*d/g),c)}var p,y;for(a&&(p=u.splice(0,1)[0]),s&&(y=u.splice(-1,1)[0],u.reverse()),l(u);c<r.length&&Kh($6(y?(0,Z.ev)((0,Z.ev)([y],(0,Z.CR)(h),!1),[p],!1):(0,Z.ev)([p],(0,Z.CR)(h),!1)),e,t==null?void 0:t.margin).length;){if(y&&!p&&c%2===0){var b=u.splice(0,1);b.forEach(n.hide)}else if(y&&p){var b=u.splice(0,1);b.forEach(n.hide)}h=o(l(u),{seq:c}),c++}}}function e5(r,t,e,n){var i,a,s=t.optionalAngles,o=s===void 0?[0,45,90]:s,l=t.margin,c=t.recoverWhenFailed,u=c===void 0?!0:c,h=r.map(function(y){return y.getLocalEulerAngles()}),d=function(){return Kh(r,e,l).length<1},f=function(y){return r.forEach(function(b,E){var O=Array.isArray(y)?y[E]:y;n.rotate(b,+O)})};try{for(var v=(0,Z.XA)(o),g=v.next();!g.done;g=v.next()){var p=g.value;if(f(p),d())return}}catch(y){i={error:y}}finally{try{g&&!g.done&&(a=v.return)&&a.call(v)}finally{if(i)throw i.error}}u&&f(h)}function n5(r){var t=r.type,e=r.labelDirection;return t==="linear"&&y0(r)?e==="negative"?"bottom":"top":"middle"}function r5(r,t,e,n,i){var a,s=t.maxLines,o=s===void 0?3:s,l=t.recoverWhenFailed,c=l===void 0?!0:l,u=t.margin,h=u===void 0?[0,0,0,0]:u,d=ii((a=t.wordWrapWidth)!==null&&a!==void 0?a:50,[i]),f=r.map(function(E){return E.attr("maxLines")||1}),v=Math.min.apply(Math,(0,Z.ev)([],(0,Z.CR)(f),!1)),g=function(){return Kh(r,e,h).length<1},p=n5(e),y=function(E){return r.forEach(function(O,k){var P=Array.isArray(E)?E[k]:E;n.wrap(O,d,P,p)})};if(!(v>o)){if(e.type==="linear"&&y0(e)){if(y(o),g())return}else for(var b=v;b<=o;b++)if(y(b),g())return;c&&y(f)}}var i5=new Map([["hide",t5],["rotate",e5],["ellipsis",Q6],["wrap",r5]]);function a5(r,t,e){return t.labelOverlap.length<1?!1:e==="hide"?!qD(r[0]):e==="rotate"?!r.some(function(n){var i;return!!(!((i=n.attr("transform"))===null||i===void 0)&&i.includes("rotate"))}):e==="ellipsis"||e==="wrap"?r.filter(function(n){return n.querySelector("text")}).length>=1:!0}function s5(r,t,e,n){var i=t.labelOverlap,a=i===void 0?[]:i;a.length&&a.forEach(function(s){var o=s.type,l=i5.get(o);a5(r,t,o)&&(l==null||l(r,s,t,n,e))})}function o5(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];var e=function(n){return n==="positive"?-1:1};return r.reduce(function(n,i){return n*e(i)},1)}function qx(r){for(var t=r;t<0;)t+=360;return Math.round(t%360)}function E0(r,t){var e=(0,Z.CR)(r,2),n=e[0],i=e[1],a=(0,Z.CR)(t,2),s=a[0],o=a[1],l=(0,Z.CR)([n*s+i*o,n*o-i*s],2),c=l[0],u=l[1];return Math.atan2(u,c)}function l5(r){var t=(r+360)%180;return Mr(t,-90,90)||(t+=180),t}function c5(r,t,e){var n,i=e.labelAlign,a=(n=t.style.transform)===null||n===void 0?void 0:n.includes("rotate");if(a)return t.getLocalEulerAngles();var s=0,o=Lo(r.value,e),l=Yh(r.value,e);return i==="horizontal"?0:(i==="perpendicular"?s=E0([1,0],o):s=E0([l[0]<0?-1:1,0],l),l5(Bx(s)))}function Jx(r,t,e){var n=e.type,i=e.labelAlign,a=Lo(r,e),s=qx(t),o=qx(Bx(E0([1,0],a))),l="center",c="middle";return n==="linear"?[90,270].includes(o)&&s===0?(l="center",c=a[1]===1?"top":"bottom"):!(o%180)&&[90,270].includes(s)?l="center":o===0?(Mr(s,0,90,!1,!0)||Mr(s,0,90)||Mr(s,270,360))&&(l="start"):o===90?Mr(s,0,90,!1,!0)?l="start":(Mr(s,90,180)||Mr(s,270,360))&&(l="end"):o===270?Mr(s,0,90,!1,!0)?l="end":(Mr(s,90,180)||Mr(s,270,360))&&(l="start"):o===180&&(s===90?l="start":(Mr(s,0,90)||Mr(s,270,360))&&(l="end")):i==="parallel"?Mr(o,0,180,!0)?c="top":c="bottom":i==="horizontal"?Mr(o,90,270,!1)?l="end":(Mr(o,270,360,!1)||Mr(o,0,90))&&(l="start"):i==="perpendicular"&&(Mr(o,90,270)?l="end":l="start"),{textAlign:l,textBaseline:c}}function u5(r,t,e){t.setLocalEulerAngles(r);var n=t.__data__.value,i=Jx(n,r,e),a=t.querySelector(Oe.labelItem.class);a&&tE(a,i)}function $x(r,t,e){var n=e.showTick,i=e.tickLength,a=e.tickDirection,s=e.labelDirection,o=e.labelSpacing,l=t.indexOf(r),c=ii(o,[r,l,t]),u=(0,Z.CR)([Lo(r.value,e),o5(s,a)],2),h=u[0],d=u[1],f=d===1?ii(n?i:0,[r,l,t]):0,v=(0,Z.CR)(Wl(Ca(h,c+f),Hh(r.value,e)),2),g=v[0],p=v[1];return{x:g,y:p}}function h5(r,t,e,n){var i=n.labelFormatter,a=ue(i)?function(){return Oa(ii(i,[r,t,e,Lo(r.value,n)]))}:function(){return Oa(r.label||"")};return a}function d5(r,t,e,n){var i=n.labelRender,a=(wr(n,"endPos.0",400)-wr(n,"startPos.0",0))/e.length,s=ue(i)?ii(i,[r,t,e,Lo(r.value,n)]):r.label||"",o=G6(s)||30;return function(){return UI(s,{width:a,height:o})}}function tE(r,t){["text","html"].includes(r.nodeName)&&r.attr(t)}function f5(r,t){s5(this.node().childNodes,r,t,{hide:Hi,show:Gl,rotate:function(e,n){u5(+n,e,r)},ellipsis:function(e,n,i){e&&l0(e,n||1/0,i)},wrap:function(e,n,i){e&&W6(e,n,i)},getTextShape:function(e){return e.querySelector(Oe.labelItem.class)}})}function eE(r,t,e,n,i){var a=e.indexOf(t),s=i.labelRender,o=i.classNamePrefix,l=he(r).append(s?d5(t,a,e,i):h5(t,a,e,i)).attr("className",Oe.labelItem.name).node();pi(he(l),Oe.labelItem,sn.labelItem,o);var c=(0,Z.CR)(Ta(Gx(n,[t,a,e])),2),u=c[0],h=c[1],d=h.transform,f=(0,Z._T)(h,["transform"]);Xx(l,d);var v=c5(t,l,i);return l.getLocalEulerAngles()||l.setLocalEulerAngles(v),tE(l,(0,Z.pi)((0,Z.pi)({},Jx(t.value,v,i)),u)),r.attr(f),l}function v5(r,t,e,n,i){var a=e.classNamePrefix,s=p0(t,e.labelFilter),o=_e(e,"label"),l,c=r.selectAll(Oe.label.class).data(s,function(u,h){return h}).join(function(u){var h=u.append("g").attr("className",Oe.label.name).transition(function(d){eE(this,d,t,o,e);var f=$x(d,t,e),v=f.x,g=f.y;return this.style.transform="translate(".concat(v,", ").concat(g,")"),null});return pi(h,Oe.label,sn.label,a),h},function(u){return u.transition(function(h){var d=this.querySelector(Oe.labelItem.class),f=eE(this,h,t,o,e),v=pI(d,f,n.update),g=$x(h,t,e),p=g.x,y=g.y,b=Ki(this,{transform:"translate(".concat(p,", ").concat(y,")")},n.update);return(0,Z.ev)((0,Z.ev)([],(0,Z.CR)(v),!1),[b],!1)})},function(u){return l=u,u.transition(function(){var h=this,d=Uh(this.childNodes[0],n.exit);return ko(d,function(){return he(h).remove()}),d}),l}).transitions();return vI(c,function(){f5.call(r,e,i)}),c}function nE(r,t){return m0(r,t.tickDirection,t)}function g5(r,t){var e=(0,Z.CR)(r,2),n=e[0],i=e[1];return[[0,0],[n*t,i*t]]}function p5(r,t,e,n,i){var a=i.tickLength,s=(0,Z.CR)(g5(n,ii(a,[r,t,e])),2),o=(0,Z.CR)(s[0],2),l=o[0],c=o[1],u=(0,Z.CR)(s[1],2),h=u[0],d=u[1];return{x1:l,x2:h,y1:c,y2:d}}function m5(r,t,e,n,i){var a=i.tickFormatter,s=i.classNamePrefix,o=nE(t.value,i),l="line";ue(a)&&(l=function(){return ii(a,[t,e,n,o])});var c=r.append(l).attr("className",Oe.tickItem.name);return pi(c,Oe.tickItem,sn.tickItem,s),c}function y5(r,t,e,n,i,a,s){var o=nE(r.value,a),l=p5(r,t,e,o,a),c=l.x1,u=l.x2,h=l.y1,d=l.y2,f=(0,Z.CR)(Ta(Gx(s,[r,t,e,o])),2),v=f[0],g=f[1];n.node().nodeName==="line"&&n.styles((0,Z.pi)({x1:c,x2:u,y1:h,y2:d},v)),i.attr(g),n.styles(v)}function rE(r,t,e,n,i,a){var s=m5(he(this),r,t,e,n);y5(r,t,e,s,this,n,i);var o=(0,Z.CR)(Hh(r.value,n),2),l=o[0],c=o[1];return Ki(this,{transform:"translate(".concat(l,", ").concat(c,")")},a)}function b5(r,t,e,n){var i=e.classNamePrefix,a=p0(t,e.tickFilter),s=_e(e,"tick");return r.selectAll(Oe.tick.class).data(a,function(o){return o.id||o.label}).join(function(o){var l=o.append("g").attr("className",Oe.tick.name).transition(function(c,u){return rE.call(this,c,u,a,e,s,!1)});return pi(l,Oe.tick,sn.tick,i),l},function(o){return o.transition(function(l,c){return this.removeChildren(),rE.call(this,l,c,a,e,s,n.update)})},function(o){return o.transition(function(){var l=this,c=Uh(this.childNodes[0],n.exit);return ko(c,function(){return l.remove()}),c})}).transitions()}function x5(r,t,e){var n=e.titlePosition,i=n===void 0?"lb":n,a=e.titleSpacing,s=Fh(i),o=r.node().getLocalBounds(),l=(0,Z.CR)(o.min,2),c=l[0],u=l[1],h=(0,Z.CR)(o.halfExtents,2),d=h[0],f=h[1],v=(0,Z.CR)(t.node().getLocalBounds().halfExtents,2),g=v[0],p=v[1],y=(0,Z.CR)([c+d,u+f],2),b=y[0],E=y[1],O=(0,Z.CR)(Sr(a),4),k=O[0],P=O[1],F=O[2],B=O[3];if(["start","end"].includes(i)&&e.type==="linear"){var V=e.startPos,U=e.endPos,J=(0,Z.CR)(i==="start"?[V,U]:[U,V],2),$=J[0],at=J[1],ct=Ix([-at[0]+$[0],-at[1]+$[1]]),ft=(0,Z.CR)(Ca(ct,k),2),Nt=ft[0],Ct=ft[1];return{x:$[0]+Nt,y:$[1]+Ct}}return s.includes("t")&&(E-=f+p+k),s.includes("r")&&(b+=d+g+P),s.includes("l")&&(b-=d+g+B),s.includes("b")&&(E+=f+p+F),{x:b,y:E}}function E5(r,t,e){var n=r.getGeometryBounds().halfExtents,i=n[1]*2;if(t==="vertical"){if(e==="left")return"rotate(-90) translate(0, ".concat(i/2,")");if(e==="right")return"rotate(-90) translate(0, -".concat(i/2,")")}return""}function iE(r,t,e,n,i){var a=_e(n,"title"),s=(0,Z.CR)(Ta(a),2),o=s[0],l=s[1],c=l.transform,u=l.transformOrigin,h=(0,Z._T)(l,["transform","transformOrigin"]);t.styles(h);var d=c||E5(r.node(),o.direction,o.position);r.styles((0,Z.pi)((0,Z.pi)({},o),{transformOrigin:u})),Xx(r.node(),d);var f=x5(he(e._offscreen||e.querySelector(Oe.mainGroup.class)),t,n),v=f.x,g=f.y,p=Ki(t.node(),{transform:"translate(".concat(v,", ").concat(g,")")},i);return p}function w5(r,t,e,n){var i=e.titleText,a=e.classNamePrefix;return r.selectAll(Oe.title.class).data([{title:i}].filter(function(s){return!!s.title}),function(s,o){return s.title}).join(function(s){var o=s.append(function(){return Oa(i)}).attr("className",Oe.title.name).transition(function(){return iE(he(this),r,t,e,n.enter)});return pi(o,Oe.title,sn.title,a),o},function(s){return s.transition(function(){return iE(he(this),r,t,e,n.update)})},function(s){return s.remove()}).transitions()}function aE(r,t,e,n){var i=r.showLine,a=r.showTick,s=r.showLabel,o=r.classNamePrefix,l=t.maybeAppendByClassName(Oe.lineGroup,"g");pi(l,Oe.lineGroup,sn.lineGroup,o);var c=ri(i,l,function(v){return I6(v,r,n)})||[],u=t.maybeAppendByClassName(Oe.tickGroup,"g");pi(u,Oe.tickGroup,sn.tickGroup,o);var h=ri(a,u,function(v){return b5(v,e,r,n)})||[],d=t.maybeAppendByClassName(Oe.labelGroup,"g");pi(d,Oe.labelGroup,sn.labelGroup,o);var f=ri(s,d,function(v){return v5(v,e,r,n,t.node())})||[];return(0,Z.ev)((0,Z.ev)((0,Z.ev)([],(0,Z.CR)(c),!1),(0,Z.CR)(h),!1),(0,Z.CR)(f),!1).filter(function(v){return!!v})}var S5=function(r){(0,Z.ZT)(t,r);function t(e){return r.call(this,e,d0)||this}return t.prototype.render=function(e,n,i){var a=this,s=e.titleText,o=e.data,l=e.animate,c=e.showTitle,u=e.showGrid,h=e.dataThreshold,d=e.truncRange,f=e.classNamePrefix,v=n.className||"axis";f?n.attr("className","".concat(v," ").concat(f,"axis")):n.className||n.attr("className","axis");var g=v6(o,h).filter(function(F){var B=F.value;return!(d&&B>d[0]&&B<d[1])}),p=yx(i===void 0?l:i),y=he(n).maybeAppendByClassName(Oe.gridGroup,"g");pi(y,Oe.gridGroup,sn.gridGroup,f);var b=ri(u,y,function(F){return j6(F,g,e,p)})||[],E=he(n).maybeAppendByClassName(Oe.mainGroup,"g");pi(E,Oe.mainGroup,sn.mainGroup,f),s&&(!this.initialized&&p.enter||this.initialized&&p.update)&&aE(e,he(this.offscreenGroup),g,yx(!1));var O=aE(e,he(E.node()),g,p),k=he(n).maybeAppendByClassName(Oe.titleGroup,"g");pi(k,Oe.titleGroup,sn.titleGroup,f);var P=ri(c,k,function(F){return w5(F,a,e,p)})||[];return(0,Z.ev)((0,Z.ev)((0,Z.ev)([],(0,Z.CR)(b),!1),(0,Z.CR)(O),!1),(0,Z.CR)(P),!1).flat().filter(function(F){return!!F})},t}(Ln);function sE(r){var t=r.canvas,e=r.touches,n=r.offsetX,i=r.offsetY;if(t){var a=t.x,s=t.y;return[a,s]}if(e){var o=e[0],l=o.clientX,c=o.clientY;return[l,c]}return n&&i?[n,i]:[0,0]}function w0(r,t){return+r.toPrecision(t)}function Fj(r){return r.toLocaleString()}function zj(r){return r.toExponential()}function jj(r,t){return t===void 0&&(t=0),Math.abs(r)<1e3?String(r):"".concat(w0(r/1e3,t).toLocaleString(),"K")}var Gj=function(r,t,e){return r<0&&Number.isFinite(r)?t:e},Wj=function(r,t,e){return r>0&&Number.isFinite(r)?t:e},Zj=function(r,t){return r*t},Vj=function(r,t){return r/2+(t||0)/2},S0=function(r){return r};class oE{constructor(t){this.options=xr({},this.getDefaultOptions()),this.update(t)}getOptions(){return this.options}update(t={}){this.options=xr({},this.options,t),this.rescale(t)}rescale(t){}}function M0(r,t){return t-r?e=>(e-r)/(t-r):e=>.5}function Qh(r,...t){return t.reduce((e,n)=>i=>e(n(i)),r)}function M5(r,t,e,n,i){let a=e||0,s=n||r.length;const o=i||(l=>l);for(;a<s;){const l=Math.floor((a+s)/2);o(r[l])>t?s=l:a=l+1}return a}var A5=S(75196),T5=S.n(A5);function A0(r,t,e){let n=e;return n<0&&(n+=1),n>1&&(n-=1),n<1/6?r+(t-r)*6*n:n<1/2?t:n<2/3?r+(t-r)*(2/3-n)*6:r}function O5(r){const t=r[0]/360,e=r[1]/100,n=r[2]/100,i=r[3];if(e===0)return[n*255,n*255,n*255,i];const a=n<.5?n*(1+e):n+e-n*e,s=2*n-a,o=A0(s,a,t+1/3),l=A0(s,a,t),c=A0(s,a,t-1/3);return[o*255,l*255,c*255,i]}function lE(r){const t=T5().get(r);if(!t)return null;const{model:e,value:n}=t;return e==="rgb"?n:e==="hsl"?O5(n):null}const qh=(r,t)=>e=>r*(1-e)+t*e,C5=(r,t)=>{const e=lE(r),n=lE(t);return e===null||n===null?e?()=>r:()=>t:i=>{const a=new Array(4);for(let u=0;u<4;u+=1){const h=e[u],d=n[u];a[u]=h*(1-i)+d*i}const[s,o,l,c]=a;return`rgba(${Math.round(s)}, ${Math.round(o)}, ${Math.round(l)}, ${c})`}},N5=(r,t)=>typeof r=="number"&&typeof t=="number"?qh(r,t):typeof r=="string"&&typeof t=="string"?C5(r,t):()=>r,k5=(r,t)=>{const e=qh(r,t);return n=>Math.round(e(n))};function P5(r){return r===null}function cE(r){return!Te(r)&&!P5(r)&&!Number.isNaN(r)}const T0=Math.sqrt(50),O0=Math.sqrt(10),C0=Math.sqrt(2);function Jh(r,t,e){const n=(t-r)/Math.max(0,e),i=Math.floor(Math.log(n)/Math.LN10),a=n/ls(10,i);return i>=0?(a>=T0?10:a>=O0?5:a>=C0?2:1)*ls(10,i):-ls(10,-i)/(a>=T0?10:a>=O0?5:a>=C0?2:1)}function Uj(r,t,e){const n=Math.abs(t-r)/Math.max(0,e);let i=ls(10,Math.floor(Math.log(n)/Math.LN10));const a=n/i;return a>=T0?i*=10:a>=O0?i*=5:a>=C0&&(i*=2),t<r?-i:i}const R5=(r,t,e=5)=>{const n=[r,t];let i=0,a=n.length-1,s=n[i],o=n[a],l;return o<s&&([s,o]=[o,s],[i,a]=[a,i]),l=Jh(s,o,e),l>0?(s=Math.floor(s/l)*l,o=Math.ceil(o/l)*l,l=Jh(s,o,e)):l<0&&(s=Math.ceil(s*l)/l,o=Math.floor(o*l)/l,l=Jh(s,o,e)),l>0?(n[i]=Math.floor(s/l)*l,n[a]=Math.ceil(o/l)*l):l<0&&(n[i]=Math.ceil(s*l)/l,n[a]=Math.floor(o*l)/l),n};function L5(r,t){const e=t<r?t:r,n=r>t?r:t;return i=>Math.min(Math.max(e,i),n)}const _5=(r,t,e)=>{const[n,i]=r,[a,s]=t;let o,l;return n<i?(o=M0(n,i),l=e(a,s)):(o=M0(i,n),l=e(s,a)),Qh(l,o)},D5=(r,t,e)=>{const n=Math.min(r.length,t.length)-1,i=new Array(n),a=new Array(n),s=r[0]>r[n],o=s?[...r].reverse():r,l=s?[...t].reverse():t;for(let c=0;c<n;c+=1)i[c]=M0(o[c],o[c+1]),a[c]=e(l[c],l[c+1]);return c=>{const u=M5(r,c,1,n)-1,h=i[u],d=a[u];return Qh(d,h)(c)}},uE=(r,t,e,n)=>(Math.min(r.length,t.length)>2?D5:_5)(r,t,n?k5:e);class I5 extends oE{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,interpolate:qh,tickCount:5}}map(t){return cE(t)?this.output(t):this.options.unknown}invert(t){return cE(t)?this.input(t):this.options.unknown}nice(){if(!this.options.nice)return;const[t,e,n,...i]=this.getTickMethodOptions();this.options.domain=this.chooseNice()(t,e,n,...i)}getTicks(){const{tickMethod:t}=this.options,[e,n,i,...a]=this.getTickMethodOptions();return t(e,n,i,...a)}getTickMethodOptions(){const{domain:t,tickCount:e}=this.options,n=t[0],i=t[t.length-1];return[n,i,e]}chooseNice(){return R5}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,i=this.options.domain.map(t),a=Math.min(i.length,n.length);return e?L5(i[0],i[a-1]):S0}composeOutput(t,e){const{domain:n,range:i,round:a,interpolate:s}=this.options,o=uE(n.map(t),i,s,a);this.output=Qh(o,e,t)}composeInput(t,e,n){const{domain:i,range:a}=this.options,s=uE(a,i.map(t),qh);this.input=Qh(e,n,s)}}const B5=(r,t,e)=>{let n,i,a=r,s=t;if(a===s&&e>0)return[a];let o=Jh(a,s,e);if(o===0||!Number.isFinite(o))return[];if(o>0){a=Math.ceil(a/o),s=Math.floor(s/o),i=new Array(n=Math.ceil(s-a+1));for(let l=0;l<n;l+=1)i[l]=(a+l)*o}else{o=-o,a=Math.ceil(a*o),s=Math.floor(s*o),i=new Array(n=Math.ceil(s-a+1));for(let l=0;l<n;l+=1)i[l]=(a+l)/o}return i};class Hl extends I5{getDefaultOptions(){return{domain:[0,1],range:[0,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolate:N5,tickMethod:B5,tickCount:5}}chooseTransforms(){return[S0,S0]}clone(){return new Hl(this.options)}}function hE({map:r,initKey:t},e){const n=t(e);return r.has(n)?r.get(n):e}function F5({map:r,initKey:t},e){const n=t(e);return r.has(n)?r.get(n):(r.set(n,e),e)}function z5({map:r,initKey:t},e){const n=t(e);return r.has(n)&&(e=r.get(n),r.delete(n)),e}function j5(r){return typeof r=="object"?r.valueOf():r}class dE extends Map{constructor(t){if(super(),this.map=new Map,this.initKey=j5,t!==null)for(const[e,n]of t)this.set(e,n)}get(t){return super.get(hE({map:this.map,initKey:this.initKey},t))}has(t){return super.has(hE({map:this.map,initKey:this.initKey},t))}set(t,e){return super.set(F5({map:this.map,initKey:this.initKey},t),e)}delete(t){return super.delete(z5({map:this.map,initKey:this.initKey},t))}}const N0=Symbol("defaultUnknown");function fE(r,t,e){for(let n=0;n<t.length;n+=1)r.has(t[n])||r.set(e(t[n]),n)}function vE(r){const{value:t,from:e,to:n,mapper:i,notFoundReturn:a}=r;let s=i.get(t);if(s===void 0){if(a!==N0)return a;s=e.push(t)-1,i.set(t,s)}return n[s%n.length]}function gE(r){return r instanceof Date?t=>`${t}`:typeof r=="object"?t=>JSON.stringify(t):t=>t}class k0 extends oE{getDefaultOptions(){return{domain:[],range:[],unknown:N0}}constructor(t){super(t)}map(t){return this.domainIndexMap.size===0&&fE(this.domainIndexMap,this.getDomain(),this.domainKey),vE({value:this.domainKey(t),mapper:this.domainIndexMap,from:this.getDomain(),to:this.getRange(),notFoundReturn:this.options.unknown})}invert(t){return this.rangeIndexMap.size===0&&fE(this.rangeIndexMap,this.getRange(),this.rangeKey),vE({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=gE(e),this.rangeKey=gE(n),!this.rangeIndexMap){this.rangeIndexMap=new Map,this.domainIndexMap=new Map;return}(!t||t.range)&&this.rangeIndexMap.clear(),(!t||t.domain||t.compare)&&(this.domainIndexMap.clear(),this.sortedDomain=void 0)}clone(){return new k0(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 G5(r){const t=Math.min(...r);return r.map(e=>e/t)}function W5(r,t){const e=r.length,n=t-e;return n>0?[...r,...new Array(n).fill(1)]:n<0?r.slice(0,t):r}function Z5(r){return Math.round(r*1e12)/1e12}function V5(r){const{domain:t,range:e,paddingOuter:n,paddingInner:i,flex:a,round:s,align:o}=r,l=t.length,c=W5(a,l),[u,h]=e,d=h-u,f=2/l*n+1-1/l*i,v=d/f,g=v*i/l,p=v-l*g,y=G5(c),b=y.reduce(($,at)=>$+at),E=p/b,O=new dE(t.map(($,at)=>{const ct=y[at]*E;return[$,s?Math.floor(ct):ct]})),k=new dE(t.map(($,at)=>{const ft=y[at]*E+g;return[$,s?Math.floor(ft):ft]})),P=Array.from(k.values()).reduce(($,at)=>$+at),B=(d-(P-P/l*i))*o,V=u+B;let U=s?Math.round(V):V;const J=new Array(l);for(let $=0;$<l;$+=1){J[$]=Z5(U);const at=t[$];U+=k.get(at)}return{valueBandWidth:O,valueStep:k,adjustedRange:J}}function U5(r){var t;const{domain:e}=r,n=e.length;if(n===0)return{valueBandWidth:void 0,valueStep:void 0,adjustedRange:[]};if(!!(!((t=r.flex)===null||t===void 0)&&t.length))return V5(r);const{range:a,paddingOuter:s,paddingInner:o,round:l,align:c}=r;let u,h,d=a[0];const v=a[1]-d,g=s*2,p=n-o;u=v/Math.max(1,g+p),l&&(u=Math.floor(u)),d+=(v-u*(n-o))*c,h=u*(1-o),l&&(d=Math.round(d),h=Math.round(h));const y=new Array(n).fill(0).map((b,E)=>d+E*u);return{valueStep:u,valueBandWidth:h,adjustedRange:y}}class P0 extends k0{getDefaultOptions(){return{domain:[],range:[0,1],align:.5,round:!1,paddingInner:0,paddingOuter:0,padding:0,unknown:N0,flex:[]}}constructor(t){super(t)}clone(){return new P0(this.options)}getStep(t){return this.valueStep===void 0?1:typeof this.valueStep=="number"?this.valueStep:t===void 0?Array.from(this.valueStep.values())[0]:this.valueStep.get(t)}getBandWidth(t){return this.valueBandWidth===void 0?1:typeof this.valueBandWidth=="number"?this.valueBandWidth:t===void 0?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:i,flex:a}=this.options,{adjustedRange:s,valueBandWidth:o,valueStep:l}=U5({align:t,range:n,round:i,flex:a,paddingInner:this.getPaddingInner(),paddingOuter:this.getPaddingOuter(),domain:e});this.valueStep=l,this.valueBandWidth=o,this.adjustedRange=s}}var Y5=function(r){(0,Z.ZT)(t,r);function t(e){var n=this,i=e.style,a=(0,Z._T)(e,["style"]);return n=r.call(this,xr({},{type:"column"},(0,Z.pi)({style:i},a)))||this,n.columnsGroup=new ar({name:"columns"}),n.appendChild(n.columnsGroup),n.render(),n}return t.prototype.render=function(){var e=this.attributes,n=e.columns,i=e.x,a=e.y;this.columnsGroup.style.transform="translate(".concat(i,", ").concat(a,")"),he(this.columnsGroup).selectAll(".column").data(n.flat()).join(function(s){return s.append("rect").attr("className","column").each(function(o){this.attr(o)})},function(s){return s.each(function(o){this.attr(o)})},function(s){return s.remove()})},t.prototype.update=function(e){this.attr(tr({},this.attributes,e)),this.render()},t.prototype.clear=function(){this.removeChildren()},t}(xn),H5=function(r){(0,Z.ZT)(t,r);function t(e){var n=this,i=e.style,a=(0,Z._T)(e,["style"]);return n=r.call(this,xr({},{type:"lines"},(0,Z.pi)({style:i},a)))||this,n.linesGroup=n.appendChild(new ar),n.areasGroup=n.appendChild(new ar),n.render(),n}return t.prototype.render=function(){var e=this.attributes,n=e.lines,i=e.areas,a=e.x,s=e.y;this.style.transform="translate(".concat(a,", ").concat(s,")"),n&&this.renderLines(n),i&&this.renderAreas(i)},t.prototype.clear=function(){this.linesGroup.removeChildren(),this.areasGroup.removeChildren()},t.prototype.update=function(e){this.attr(tr({},this.attributes,e)),this.render()},t.prototype.renderLines=function(e){he(this.linesGroup).selectAll(".line").data(e).join(function(n){return n.append("path").attr("className","line").each(function(i){this.attr(i)})},function(n){return n.each(function(i){this.attr(i)})},function(n){return n.remove()})},t.prototype.renderAreas=function(e){he(this.linesGroup).selectAll(".area").data(e).join(function(n){return n.append("path").attr("className","area").each(function(i){this.attr(i)})},function(n){return n.each(function(i){this.style(i)})},function(n){return n.remove()})},t}(xn);function X5(r,t,e,n){var i,a=[],s=!!n,o,l,c=[1/0,1/0],u=[-1/0,-1/0],h,d,f;if(s){i=(0,Z.CR)(n,2),c=i[0],u=i[1];for(var v=0,g=r.length;v<g;v+=1){var p=r[v];c=Qs(c,p),u=qs(u,p)}}for(var v=0,y=r.length;v<y;v+=1){var p=r[v];if(v===0&&!e)f=p;else if(v===y-1&&!e)d=p,a.push(f),a.push(d);else{var b=[v?v-1:y-1,v-1][e?0:1];o=r[b],l=r[e?(v+1)%y:v+1];var E=[0,0];E=f0(l,o),E=Ca(E,t);var O=Zl(p,o),k=Zl(p,l),P=O+k;P!==0&&(O/=P,k/=P);var F=Ca(E,-O),B=Ca(E,k);d=Wl(p,F),h=Wl(p,B),h=Qs(h,qs(l,p)),h=qs(h,Qs(l,p)),F=f0(h,p),F=Ca(F,-O/k),d=Wl(p,F),d=Qs(d,qs(o,p)),d=qs(d,Qs(o,p)),B=f0(p,d),B=Ca(B,k/O),h=Wl(p,B),s&&(d=qs(d,c),d=Qs(d,u),h=qs(h,c),h=Qs(h,u)),a.push(f),a.push(d),f=h}}return e&&a.push(a.shift()),a}function K5(r,t,e){var n;t===void 0&&(t=!1),e===void 0&&(e=[[0,0],[1,1]]);for(var i=!!t,a=[],s=0,o=r.length;s<o;s+=2)a.push([r[s],r[s+1]]);for(var l=X5(a,.4,i,e),c=a.length,u=[],h,d,f,s=0;s<c-1;s+=1)h=l[s*2],d=l[s*2+1],f=a[s+1],u.push(["C",h[0],h[1],d[0],d[1],f[0],f[1]]);return i&&(h=l[c],d=l[c+1],n=(0,Z.CR)(a,1),f=n[0],u.push(["C",h[0],h[1],d[0],d[1],f[0],f[1]])),u}function Q5(r,t){var e,n=t.x,i=t.y,a=(0,Z.CR)(i.getOptions().range||[0,0],2),s=a[0],o=a[1];return o>s&&(e=(0,Z.CR)([s,o],2),o=e[0],s=e[1]),r.map(function(l){var c=l.map(function(u,h){return[n.map(h),kn(i.map(u),o,s)]});return c})}function Xl(r,t){t===void 0&&(t=!1);var e=t?r.length-1:0,n=r.map(function(i,a){return(0,Z.ev)([a===e?"M":"L"],(0,Z.CR)(i),!1)});return t?n.reverse():n}function $h(r,t){if(t===void 0&&(t=!1),r.length<=2)return Xl(r);for(var e=[],n=r.length,i=0;i<n;i+=1){var a=t?r[n-i-1]:r[i];Wn(a,e.slice(-2))||e.push.apply(e,(0,Z.ev)([],(0,Z.CR)(a),!1))}var s=K5(e,!1);return t?s.unshift((0,Z.ev)(["M"],(0,Z.CR)(r[n-1]),!1)):s.unshift((0,Z.ev)(["M"],(0,Z.CR)(r[0]),!1)),s}function R0(r,t,e){var n=mo(r);return n.push(["L",t,e],["L",0,e],["Z"]),n}function q5(r,t,e,n){return r.map(function(i){return R0(t?$h(i):Xl(i),e,n)})}function J5(r,t,e){for(var n=[],i=r.length-1;i>=0;i-=1){var a=r[i],s=Xl(a),o=void 0;if(i===0)o=R0(s,t,e);else{var l=r[i-1],c=Xl(l,!0);c[0][0]="L",o=(0,Z.ev)((0,Z.ev)((0,Z.ev)([],(0,Z.CR)(s),!1),(0,Z.CR)(c),!1),[["Z"]],!1)}n.push(o)}return n}function $5(r,t,e){for(var n=[],i=r.length-1;i>=0;i-=1){var a=r[i],s=$h(a),o=void 0;if(i===0)o=R0(s,t,e);else{var l=r[i-1],c=$h(l,!0),u=a[0];c[0][0]="L",o=(0,Z.ev)((0,Z.ev)((0,Z.ev)([],(0,Z.CR)(s),!1),(0,Z.CR)(c),!1),[(0,Z.ev)(["M"],(0,Z.CR)(u),!1),["Z"]],!1)}n.push(o)}return n}var t4=function(r,t){if(Kr(r)){for(var e,n=1/0,i=0;i<r.length;i++){var a=r[i],s=ue(t)?t(a):a[t];s<n&&(e=a,n=s)}return e}},e4=function(r,t){if(Kr(r)){for(var e,n=-1/0,i=0;i<r.length;i++){var a=r[i],s=ue(t)?t(a):a[t];s>n&&(e=a,n=s)}return e}};function pE(r){return r.length===0?[0,0]:[cc(t4(r,function(t){return cc(t)||0})),uc(e4(r,function(t){return uc(t)||0}))]}function mE(r){for(var t=mo(r),e=t[0].length,n=(0,Z.CR)([Array(e).fill(0),Array(e).fill(0)],2),i=n[0],a=n[1],s=0;s<t.length;s+=1)for(var o=t[s],l=0;l<e;l+=1)o[l]>=0?(o[l]+=i[l],i[l]=o[l]):(o[l]+=a[l],a[l]=o[l]);return t}var n4=function(r){(0,Z.ZT)(t,r);function t(e){return r.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 Object.defineProperty(t.prototype,"rawData",{get:function(){var e=this.attributes.data;if(!e||(e==null?void 0:e.length)===0)return[[]];var n=mo(e);return ie(n[0])?[n]:n},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"data",{get:function(){return this.attributes.isStack?mE(this.rawData):this.rawData},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"scales",{get:function(){return this.createScales(this.data)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"baseline",{get:function(){var e=this.scales.y,n=(0,Z.CR)(e.getOptions().domain||[0,0],2),i=n[0],a=n[1];return a<0?e.map(a):e.map(i<0?0:i)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"containerShape",{get:function(){var e=this.attributes,n=e.width,i=e.height;return{width:n,height:i}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"linesStyle",{get:function(){var e=this,n=this.attributes,i=n.type,a=n.isStack,s=n.smooth;if(i!=="line")throw new Error("linesStyle can only be used in line type");var o=_e(this.attributes,"area"),l=_e(this.attributes,"line"),c=this.containerShape.width,u=this.data;if(u[0].length===0)return{lines:[],areas:[]};var h=this.scales,d=h.x,f=h.y,v=Q5(u,{type:"line",x:d,y:f}),g=[];if(o){var p=this.baseline;a?g=s?$5(v,c,p):J5(v,c,p):g=q5(v,s,c,p)}return{lines:v.map(function(y,b){return(0,Z.pi)({stroke:e.getColor(b),d:s?$h(y):Xl(y)},l)}),areas:g.map(function(y,b){return(0,Z.pi)({d:y,fill:e.getColor(b)},o)})}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"columnsStyle",{get:function(){var e=this,n=_e(this.attributes,"column"),i=this.attributes,a=i.isStack,s=i.type,o=i.scale;if(s!=="column")throw new Error("columnsStyle can only be used in column type");var l=this.containerShape.height,c=this.rawData;if(!c)return{columns:[]};a&&(c=mE(c));var u=this.createScales(c),h=u.x,d=u.y,f=(0,Z.CR)(pE(c),2),v=f[0],g=f[1],p=new Hl({domain:[0,g-(v>0?0:v)],range:[0,l*o]}),y=h.getBandWidth(),b=this.rawData;return{columns:c.map(function(E,O){return E.map(function(k,P){var F=y/c.length,B=function(){return{x:h.map(P)+F*O,y:k>=0?d.map(k):d.map(0),width:F,height:p.map(Math.abs(k))}},V=function(){return{x:h.map(P),y:d.map(k),width:y,height:p.map(b[O][P])}};return(0,Z.pi)((0,Z.pi)({fill:e.getColor(O)},n),a?V():B())})})}},enumerable:!1,configurable:!0}),t.prototype.render=function(e,n){oI(n,".container","rect").attr("className","container").node();var i=e.type,a=e.x,s=e.y,o="spark".concat(i),l=(0,Z.pi)({x:a,y:s},i==="line"?this.linesStyle:this.columnsStyle);he(n).selectAll(".spark").data([i]).join(function(c){return c.append(function(u){return u==="line"?new H5({className:o,style:l}):new Y5({className:o,style:l})}).attr("className","spark ".concat(o))},function(c){return c.update(l)},function(c){return c.remove()})},t.prototype.getColor=function(e){var n=this.attributes.color;return Kr(n)?n[e%n.length]:ue(n)?n.call(null,e):n},t.prototype.createScales=function(e){var n,i,a=this.attributes,s=a.type,o=a.scale,l=a.range,c=l===void 0?[]:l,u=a.spacing,h=this.containerShape,d=h.width,f=h.height,v=(0,Z.CR)(pE(e),2),g=v[0],p=v[1],y=new Hl({domain:[(n=c[0])!==null&&n!==void 0?n:g,(i=c[1])!==null&&i!==void 0?i:p],range:[f,f*(1-o)]});return s==="line"?{type:s,x:new Hl({domain:[0,e[0].length-1],range:[0,d]}),y}:{type:s,x:new P0({domain:e[0].map(function(b,E){return E}),range:[0,d],paddingInner:u,paddingOuter:u/2,align:.5}),y}},t.tag="sparkline",t}(Ln),yE={fill:"#fff",lineWidth:1,radius:2,size:10,stroke:"#bfbfbf",strokeOpacity:1,zIndex:0},bE={fill:"#000",fillOpacity:.45,fontSize:12,textAlign:"center",textBaseline:"middle",zIndex:1},xE={x:0,y:0,orientation:"horizontal",showLabel:!0,type:"start"},fa=Xi({foreground:"foreground",handle:"handle",selection:"selection",sparkline:"sparkline",sparklineGroup:"sparkline-group",track:"track",brushArea:"brush-area"},"slider"),Ri=Xi({labelGroup:"label-group",label:"label",iconGroup:"icon-group",icon:"icon",iconRect:"icon-rect",iconLine:"icon-line"},"handle"),r4=function(r){(0,Z.ZT)(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.prototype.render=function(e,n){var i=e.x,a=e.y,s=e.size,o=s===void 0?10:s,l=e.radius,c=l===void 0?o/4:l,u=e.orientation,h=e.classNamePrefix,d=(0,Z._T)(e,["x","y","size","radius","orientation","classNamePrefix"]),f=o,v=f*2.4,g=h?"".concat(Ri.iconRect.name," ").concat(h,"handle-icon-rect"):Ri.iconRect.name,p=function(P){return h?"".concat(Ri.iconLine,"-").concat(P," ").concat(h,"handle-icon-line"):"".concat(Ri.iconLine,"-").concat(P)},y=he(n).maybeAppendByClassName(Ri.iconRect,"rect").attr("className",g).styles((0,Z.pi)((0,Z.pi)({},d),{width:f,height:v,radius:c,x:i-f/2,y:a-v/2,transformOrigin:"center"})),b=i+1/3*f-f/2,E=i+2/3*f-f/2,O=a+1/4*v-v/2,k=a+3/4*v-v/2;y.maybeAppendByClassName("".concat(Ri.iconLine,"-1"),"line").attr("className",p(1)).styles((0,Z.pi)({x1:b,x2:b,y1:O,y2:k},d)),y.maybeAppendByClassName("".concat(Ri.iconLine,"-2"),"line").attr("className",p(2)).styles((0,Z.pi)({x1:E,x2:E,y1:O,y2:k},d)),u==="vertical"&&(y.node().style.transform="rotate(90)")},t}(Ln),i4=function(r){(0,Z.ZT)(t,r);function t(e){return r.call(this,e,xE)||this}return t.prototype.renderLabel=function(e){var n=this,i=this.attributes,a=i.x,s=i.y,o=i.showLabel,l=_e(this.attributes,"label"),c=l.x,u=c===void 0?0:c,h=l.y,d=h===void 0?0:h,f=l.transform,v=l.transformOrigin,g=(0,Z._T)(l,["x","y","transform","transformOrigin"]),p=(0,Z.CR)(Ta(g,[]),2),y=p[0],b=p[1],E=he(e).maybeAppendByClassName(Ri.labelGroup,"g").styles(b),O=(0,Z.pi)((0,Z.pi)({},bE),y),k=O.text,P=(0,Z._T)(O,["text"]);ri(!!o,E,function(F){n.label=F.maybeAppendByClassName(Ri.label,"text").styles((0,Z.pi)((0,Z.pi)({},P),{x:a+u,y:s+d,transform:f,transformOrigin:v,text:"".concat(k)})),n.label.on("mousedown",function(B){B.stopPropagation()}),n.label.on("touchstart",function(B){B.stopPropagation()})})},t.prototype.renderIcon=function(e){var n=this.attributes,i=n.x,a=n.y,s=n.orientation,o=n.type,l=n.classNamePrefix,c=(0,Z.pi)((0,Z.pi)({x:i,y:a,orientation:s,classNamePrefix:l},yE),_e(this.attributes,"icon")),u=this.attributes.iconShape,h=u===void 0?function(){return new r4({style:c})}:u,d=he(e).maybeAppendByClassName(Ri.iconGroup,"g");d.selectAll(Ri.icon.class).data([h]).join(function(f){return f.append(typeof h=="string"?h:function(){return h(o)}).attr("className",Ri.icon.name)},function(f){return f.update(c)},function(f){return f.remove()})},t.prototype.render=function(e,n){this.renderIcon(n),this.renderLabel(n)},t}(Ln),a4=function(r){(0,Z.ZT)(t,r);function t(e){var n=r.call(this,e,(0,Z.pi)((0,Z.pi)((0,Z.pi)({x:0,y:0,animate:{duration:100,fill:"both"},brushable:!0,formatter:function(i){return i.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},No(xE,"handle")),No(yE,"handleIcon")),No(bE,"handleLabel")))||this;return n.range=[0,1],n.onDragStart=function(i){return function(a){a.stopPropagation(),n.target=i,n.prevPos=n.getOrientVal(sE(a));var s=n.availableSpace,o=s.x,l=s.y,c=n.getBBox(),u=c.x,h=c.y;n.selectionStartPos=n.getRatio(n.prevPos-n.getOrientVal([o,l])-n.getOrientVal([+u,+h])),n.selectionWidth=0,document.addEventListener("pointermove",n.onDragging),document.addEventListener("pointerup",n.onDragEnd)}},n.onDragging=function(i){var a=n.attributes,s=a.slidable,o=a.brushable,l=a.type;i.stopPropagation();var c=n.getOrientVal(sE(i)),u=c-n.prevPos;if(u){var h=n.getRatio(u);switch(n.target){case"start":s&&n.setValuesOffset(h);break;case"end":s&&n.setValuesOffset(0,h);break;case"selection":s&&n.setValuesOffset(h,h);break;case"track":if(!o)return;n.selectionWidth+=h,l==="range"?n.innerSetValues([n.selectionStartPos,n.selectionStartPos+n.selectionWidth].sort(),!0):n.innerSetValues([0,n.selectionStartPos+n.selectionWidth],!0);break;default:break}n.prevPos=c}},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(i){var a=n.attributes,s=a.onChange,o=a.type,l=o==="range"?i:i[1],c=o==="range"?n.getValues():n.getValues()[1],u=new Jn("valuechange",{detail:{oldValue:l,value:c}});n.dispatchEvent(u),s==null||s(c)},n.selectionStartPos=0,n.selectionWidth=0,n.prevPos=0,n.target="",n}return Object.defineProperty(t.prototype,"values",{get:function(){return this.attributes.values},set:function(e){this.attributes.values=this.clampValues(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sparklineStyle",{get:function(){var e=this.attributes.orientation;if(e!=="horizontal")return null;var n=_e(this.attributes,"sparkline");return(0,Z.pi)((0,Z.pi)({zIndex:0},this.availableSpace),n)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"shape",{get:function(){var e=this.attributes,n=e.trackLength,i=e.trackSize,a=(0,Z.CR)(this.getOrientVal([[n,i],[i,n]]),2),s=a[0],o=a[1];return{width:s,height:o}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"availableSpace",{get:function(){var e=this.attributes,n=e.x,i=e.y,a=e.padding,s=(0,Z.CR)(Sr(a),4),o=s[0],l=s[1],c=s[2],u=s[3],h=this.shape,d=h.width,f=h.height;return{x:u,y:o,width:d-(u+l),height:f-(o+c)}},enumerable:!1,configurable:!0}),t.prototype.getValues=function(){return this.values},t.prototype.setValues=function(e,n){e===void 0&&(e=[0,0]),n===void 0&&(n=!1),this.attributes.values=e;var i=n===!1?!1:this.attributes.animate;this.updateSelectionArea(i),this.updateHandlesPosition(i)},t.prototype.updateSelectionArea=function(e){var n=this.calcSelectionArea();this.foregroundGroup.selectAll(fa.selection.class).each(function(i,a){Ki(this,n[a],e)})},t.prototype.updateHandlesPosition=function(e){this.attributes.showHandle&&(this.startHandle&&Ki(this.startHandle,this.getHandleStyle("start"),e),this.endHandle&&Ki(this.endHandle,this.getHandleStyle("end"),e))},t.prototype.innerSetValues=function(e,n){e===void 0&&(e=[0,0]),n===void 0&&(n=!1);var i=this.values,a=this.clampValues(e);this.attributes.values=a,this.setValues(a),n&&this.onValueChange(i)},t.prototype.renderTrack=function(e){var n=this.attributes,i=n.x,a=n.y,s=_e(this.attributes,"track");this.trackShape=he(e).maybeAppendByClassName(fa.track,"rect").styles((0,Z.pi)((0,Z.pi)({x:i,y:a},this.shape),s))},t.prototype.renderBrushArea=function(e){var n=this.attributes,i=n.x,a=n.y,s=n.brushable;this.brushArea=he(e).maybeAppendByClassName(fa.brushArea,"rect").styles((0,Z.pi)({x:i,y:a,fill:"transparent",cursor:s?"crosshair":"default"},this.shape))},t.prototype.renderSparkline=function(e){var n=this,i=this.attributes,a=i.x,s=i.y,o=i.orientation,l=he(e).maybeAppendByClassName(fa.sparklineGroup,"g");ri(o==="horizontal",l,function(c){var u=(0,Z.pi)((0,Z.pi)({},n.sparklineStyle),{x:a,y:s});c.maybeAppendByClassName(fa.sparkline,function(){return new n4({style:u})}).update(u)})},t.prototype.renderHandles=function(){var e=this,n,i=this.attributes,a=i.showHandle,s=i.type,o=s==="range"?["start","end"]:["end"],l=a?o:[],c=this;(n=this.foregroundGroup)===null||n===void 0||n.selectAll(fa.handle.class).data(l.map(function(u){return{type:u}}),function(u){return u.type}).join(function(u){return u.append(function(h){var d=h.type;return new i4({style:e.getHandleStyle(d)})}).each(function(h){var d=h.type;this.attr("class","".concat(fa.handle.name," ").concat(d,"-handle"));var f="".concat(d,"Handle");c[f]=this,this.addEventListener("pointerdown",c.onDragStart(d))})},function(u){return u.each(function(h){var d=h.type;this.update(c.getHandleStyle(d))})},function(u){return u.each(function(h){var d=h.type,f="".concat(d,"Handle");c[f]=void 0}).remove()})},t.prototype.renderSelection=function(e){var n=this.attributes,i=n.x,a=n.y,s=n.type,o=n.selectionType;this.foregroundGroup=he(e).maybeAppendByClassName(fa.foreground,"g");var l=_e(this.attributes,"selection"),c=function(h){return h.style("visibility",function(d){return d.show?"visible":"hidden"}).style("cursor",function(d){return o==="select"?"grab":o==="invert"?"crosshair":"default"}).styles((0,Z.pi)((0,Z.pi)({},l),{transform:"translate(".concat(i,", ").concat(a,")")}))},u=this;this.foregroundGroup.selectAll(fa.selection.class).data(s==="value"?[]:this.calcSelectionArea().map(function(h,d){return{style:(0,Z.pi)({},h),index:d,show:o==="select"?d===1:d!==1}}),function(h){return h.index}).join(function(h){return h.append("rect").attr("className",fa.selection.name).call(c).each(function(d,f){var v=this;f===1?(u.selectionShape=he(this),this.on("pointerdown",function(g){v.attr("cursor","grabbing"),u.onDragStart("selection")(g)}),u.dispatchCustomEvent(this,"pointerenter","selectionMouseenter"),u.dispatchCustomEvent(this,"pointerleave","selectionMouseleave"),u.dispatchCustomEvent(this,"click","selectionClick"),this.addEventListener("pointerdown",function(){v.attr("cursor","grabbing")}),this.addEventListener("pointerup",function(){v.attr("cursor","pointer")}),this.addEventListener("pointerover",function(){v.attr("cursor","pointer")})):this.on("pointerdown",u.onDragStart("track"))})},function(h){return h.call(c)},function(h){return h.remove()}),this.updateSelectionArea(!1),this.renderHandles()},t.prototype.render=function(e,n){this.renderTrack(n),this.renderSparkline(n),this.renderBrushArea(n),this.renderSelection(n)},t.prototype.clampValues=function(e,n){var i;n===void 0&&(n=4);var a=(0,Z.CR)(this.range,2),s=a[0],o=a[1],l=(0,Z.CR)(this.getValues().map(function(p){return w0(p,n)}),2),c=l[0],u=l[1],h=Array.isArray(e)?e:[c,e!=null?e:u],d=(0,Z.CR)((h||[c,u]).map(function(p){return w0(p,n)}),2),f=d[0],v=d[1];if(this.attributes.type==="value")return[0,kn(v,s,o)];f>v&&(i=(0,Z.CR)([v,f],2),f=i[0],v=i[1]);var g=v-f;return g>o-s?[s,o]:f<s?c===s&&u===v?[s,v]:[s,g+s]:v>o?u===o&&c===f?[f,o]:[o-g,o]:[f,v]},t.prototype.calcSelectionArea=function(e){var n=(0,Z.CR)(this.clampValues(e),2),i=n[0],a=n[1],s=this.availableSpace,o=s.x,l=s.y,c=s.width,u=s.height;return this.getOrientVal([[{y:l,height:u,x:o,width:i*c},{y:l,height:u,x:i*c+o,width:(a-i)*c},{y:l,height:u,x:a*c,width:(1-a)*c}],[{x:o,width:c,y:l,height:i*u},{x:o,width:c,y:i*u+l,height:(a-i)*u},{x:o,width:c,y:a*u,height:(1-a)*u}]])},t.prototype.calcHandlePosition=function(e){var n=this.attributes.handleIconOffset,i=this.availableSpace,a=i.x,s=i.y,o=i.width,l=i.height,c=(0,Z.CR)(this.clampValues(),2),u=c[0],h=c[1],d=e==="start"?-n:n,f=(e==="start"?u:h)*this.getOrientVal([o,l])+d;return{x:a+this.getOrientVal([f,o/2]),y:s+this.getOrientVal([l/2,f])}},t.prototype.inferTextStyle=function(e){var n=this.attributes.orientation;return n==="horizontal"?{}:e==="start"?{transformOrigin:"left center",transform:"rotate(90)",textAlign:"start"}:e==="end"?{transformOrigin:"right center",transform:"rotate(90)",textAlign:"end"}:{}},t.prototype.calcHandleText=function(e){var n,i=this.attributes,a=i.type,s=i.orientation,o=i.formatter,l=i.autoFitLabel,c=_e(this.attributes,"handle"),u=_e(c,"label"),h=c.spacing,d=this.getHandleSize(),f=this.clampValues(),v=e==="start"?f[0]:f[1],g=o(v),p=new n0({style:(0,Z.pi)((0,Z.pi)((0,Z.pi)({},u),this.inferTextStyle(e)),{text:g})}),y=p.getBBox(),b=y.width,E=y.height;if(p.destroy(),!l){if(a==="value")return{text:g,x:0,y:-E-h};var O=h+d+(s==="horizontal"?b/2:0);return n={text:g},n[s==="horizontal"?"x":"y"]=e==="start"?-O:O,n}var k=0,P=0,F=this.availableSpace,B=F.width,V=F.height,U=this.calcSelectionArea()[1],J=U.x,$=U.y,at=U.width,ct=U.height,ft=h+d;if(s==="horizontal"){var Nt=ft+b/2;if(e==="start"){var Ct=J-ft-b;k=Ct>0?-Nt:Nt}else{var gt=B-J-at-ft>b;k=gt?Nt:-Nt}}else{var bt=ft,Pt=E+ft;e==="start"?P=$-d>E?-Pt:bt:P=V-($+ct)-d>E?Pt:-bt}return{x:k,y:P,text:g}},t.prototype.getHandleLabelStyle=function(e){var n=_e(this.attributes,"handleLabel");return(0,Z.pi)((0,Z.pi)((0,Z.pi)({},n),this.calcHandleText(e)),this.inferTextStyle(e))},t.prototype.getHandleIconStyle=function(){var e=this.attributes.handleIconShape,n=_e(this.attributes,"handleIcon"),i=this.getOrientVal(["ew-resize","ns-resize"]),a=this.getHandleSize();return(0,Z.pi)({cursor:i,shape:e,size:a},n)},t.prototype.getHandleStyle=function(e){var n=this.attributes,i=n.x,a=n.y,s=n.showLabel,o=n.showLabelOnInteraction,l=n.orientation,c=this.calcHandlePosition(e),u=c.x,h=c.y,d=this.calcHandleText(e),f=s;return!s&&o&&(this.target?f=!0:f=!1),(0,Z.pi)((0,Z.pi)((0,Z.pi)({},No(this.getHandleIconStyle(),"icon")),No((0,Z.pi)((0,Z.pi)({},this.getHandleLabelStyle(e)),d),"label")),{transform:"translate(".concat(u+i,", ").concat(h+a,")"),orientation:l,showLabel:f,type:e,zIndex:3})},t.prototype.getHandleSize=function(){var e=this.attributes,n=e.handleIconSize,i=e.width,a=e.height;return n||Math.floor((this.getOrientVal([+a,+i])+4)/2.4)},t.prototype.getOrientVal=function(e){var n=(0,Z.CR)(e,2),i=n[0],a=n[1],s=this.attributes.orientation;return s==="horizontal"?i:a},t.prototype.setValuesOffset=function(e,n){n===void 0&&(n=0);var i=this.attributes.type,a=(0,Z.CR)(this.getValues(),2),s=a[0],o=a[1],l=i==="range"?e:0,c=[s+l,o+n].sort();this.innerSetValues(c,!0)},t.prototype.getRatio=function(e){var n=this.availableSpace,i=n.width,a=n.height;return e/this.getOrientVal([i,a])},t.prototype.dispatchCustomEvent=function(e,n,i){var a=this;e.on(n,function(s){s.stopPropagation(),a.dispatchEvent(new Jn(i,{detail:s}))})},t.prototype.bindEvents=function(){this.addEventListener("wheel",this.onScroll);var e=this.brushArea;this.dispatchCustomEvent(e,"click","trackClick"),this.dispatchCustomEvent(e,"pointerenter","trackMouseenter"),this.dispatchCustomEvent(e,"pointerleave","trackMouseleave"),e.on("pointerdown",this.onDragStart("track"))},t.prototype.onScroll=function(e){var n=this.attributes.scrollable;if(n){var i=e.deltaX,a=e.deltaY,s=a||i,o=this.getRatio(s);this.setValuesOffset(o,o)}},t.tag="slider",t}(Ln),s4={backgroundFill:"#262626",backgroundLineCap:"round",backgroundLineWidth:1,backgroundStroke:"#333",backgroundZIndex:-1,formatter:function(r){return r.toString()},labelFill:"#fff",labelFontSize:12,labelTextBaseline:"middle",padding:[2,4],position:"right",radius:0,zIndex:999},L0=Xi({background:"background",labelGroup:"label-group",label:"label"},"indicator"),o4=function(r){(0,Z.ZT)(t,r);function t(e){var n=r.call(this,e,s4)||this;return n.point=[0,0],n.group=n.appendChild(new ar({})),n.isMutationObserved=!0,n}return t.prototype.renderBackground=function(){if(this.label){var e=this.attributes,n=e.position,i=e.padding,a=(0,Z.CR)(Sr(i),4),s=a[0],o=a[1],l=a[2],c=a[3],u=this.label.node().getLocalBounds(),h=u.min,d=u.max,f=new Lr(h[0]-c,h[1]-s,d[0]+o-h[0]+c,d[1]+l-h[1]+s),v=this.getPath(n,f),g=_e(this.attributes,"background");this.background=he(this.group).maybeAppendByClassName(L0.background,"path").styles((0,Z.pi)((0,Z.pi)({},g),{d:v})),this.group.appendChild(this.label.node())}},t.prototype.renderLabel=function(){var e=this.attributes,n=e.formatter,i=e.labelText,a=_e(this.attributes,"label"),s=(0,Z.CR)(Ta(a),2),o=s[0],l=s[1],c=o.text,u=(0,Z._T)(o,["text"]);if(this.label=he(this.group).maybeAppendByClassName(L0.labelGroup,"g").styles(l),!!i){var h=this.label.maybeAppendByClassName(L0.label,function(){return Oa(n(i))}).style("text",n(i).toString());h.selectAll("text").styles(u)}},t.prototype.adjustLayout=function(){var e=(0,Z.CR)(this.point,2),n=e[0],i=e[1],a=this.attributes,s=a.x,o=a.y;this.group.attr("transform","translate(".concat(s-n,", ").concat(o-i,")"))},t.prototype.getPath=function(e,n){var i=this.attributes.radius,a=n.x,s=n.y,o=n.width,l=n.height,c=[["M",a+i,s],["L",a+o-i,s],["A",i,i,0,0,1,a+o,s+i],["L",a+o,s+l-i],["A",i,i,0,0,1,a+o-i,s+l],["L",a+i,s+l],["A",i,i,0,0,1,a,s+l-i],["L",a,s+i],["A",i,i,0,0,1,a+i,s],["Z"]],u={top:4,right:6,bottom:0,left:2},h=u[e],d=this.createCorner([c[h].slice(-2),c[h+1].slice(-2)]);return c.splice.apply(c,(0,Z.ev)([h+1,1],(0,Z.CR)(d),!1)),c[0][0]="M",c},t.prototype.createCorner=function(e,n){n===void 0&&(n=10);var i=.8,a=ZI.apply(void 0,(0,Z.ev)([],(0,Z.CR)(e),!1)),s=(0,Z.CR)(e,2),o=(0,Z.CR)(s[0],2),l=o[0],c=o[1],u=(0,Z.CR)(s[1],2),h=u[0],d=u[1],f=(0,Z.CR)(a?[h-l,[l,h]]:[d-c,[c,d]],2),v=f[0],g=(0,Z.CR)(f[1],2),p=g[0],y=g[1],b=v/2,E=v/Math.abs(v),O=n*E,k=O/2,P=O*Math.sqrt(3)/2*i,F=(0,Z.CR)([p,p+b-k,p+b,p+b+k,y],5),B=F[0],V=F[1],U=F[2],J=F[3],$=F[4];return a?(this.point=[U,c-P],[["L",B,c],["L",V,c],["L",U,c-P],["L",J,c],["L",$,c]]):(this.point=[l+P,U],[["L",l,B],["L",l,V],["L",l+P,U],["L",l,J],["L",l,$]])},t.prototype.applyVisibility=function(){var e=this.attributes.visibility;e==="hidden"?Hi(this):Gl(this)},t.prototype.bindEvents=function(){this.label.on(Fe.BOUNDS_CHANGED,this.renderBackground)},t.prototype.render=function(){this.renderLabel(),this.renderBackground(),this.adjustLayout(),this.applyVisibility()},t}(Ln),l4=function(r){(0,Z.ZT)(t,r);function t(e){var n=r.call(this,tr({},t.defaultOptions,e))||this;return n.hoverColor="#f5f5f5",n.selectedColor="#e6f7ff",n.background=n.appendChild(new br({})),n.label=n.background.appendChild(new ar({})),n}return Object.defineProperty(t.prototype,"padding",{get:function(){return Sr(this.style.padding)},enumerable:!1,configurable:!0}),t.prototype.renderLabel=function(){var e=this.style,n=e.label,i=e.value,a=_e(this.attributes,"label");he(this.label).maybeAppend(".label",function(){return Oa(n)}).attr("className","label").styles(a),this.label.attr("__data__",i)},t.prototype.renderBackground=function(){var e=this.label.getBBox(),n=(0,Z.CR)(this.padding,4),i=n[0],a=n[1],s=n[2],o=n[3],l=e.width,c=e.height,u=l+o+a,h=c+i+s,d=_e(this.attributes,"background"),f=this.style,v=f.width,g=v===void 0?0:v,p=f.height,y=p===void 0?0:p,b=f.selected;this.background.attr((0,Z.pi)((0,Z.pi)({},d),{width:Math.max(u,g),height:Math.max(h,y),fill:b?this.selectedColor:"#fff"})),this.label.attr({transform:"translate(".concat(o,", ").concat((h-c)/2,")")})},t.prototype.render=function(){this.renderLabel(),this.renderBackground()},t.prototype.bindEvents=function(){var e=this;this.addEventListener("pointerenter",function(){e.style.selected||e.background.attr("fill",e.hoverColor)}),this.addEventListener("pointerleave",function(){e.style.selected||e.background.attr("fill",e.style.backgroundFill)});var n=this;this.addEventListener("click",function(){var i=e.style,a=i.label,s=i.value,o=i.onClick;o==null||o(s,{label:a,value:s},n)})},t.defaultOptions={style:{value:"",label:"",cursor:"pointer"}},t}(Ln),c4=function(r){(0,Z.ZT)(t,r);function t(e){var n,i,a=r.call(this,tr({},t.defaultOptions,e))||this;a.currentValue=(n=t.defaultOptions.style)===null||n===void 0?void 0:n.defaultValue,a.isPointerInSelect=!1,a.select=a.appendChild(new br({className:"select",style:{cursor:"pointer",width:0,height:0}})),a.dropdown=a.appendChild(new br({className:"dropdown"}));var s=a.style.defaultValue;return s&&(!((i=a.style.options)===null||i===void 0)&&i.some(function(o){return o.value===s}))&&(a.currentValue=s),a}return t.prototype.setValue=function(e){this.currentValue=e,this.render()},t.prototype.getValue=function(){return this.currentValue},Object.defineProperty(t.prototype,"dropdownPadding",{get:function(){return Sr(this.style.dropdownPadding)},enumerable:!1,configurable:!0}),t.prototype.renderSelect=function(){var e=this,n,i=this.style,a=i.x,s=i.y,o=i.width,l=i.height,c=i.bordered,u=i.showDropdownIcon,h=_e(this.attributes,"select"),d=_e(this.attributes,"placeholder");this.select.attr((0,Z.pi)((0,Z.pi)({x:a,y:s,width:o,height:l},h),{fill:"#fff",strokeWidth:c?1:0}));var f=this.dropdownPadding,v=10;u&&he(this.select).maybeAppend(".dropdown-icon","path").style("d","M-5,-3.5 L0,3.5 L5,-3.5").style("transform","translate(".concat(a+o-v-f[1]-f[3],", ").concat(s+l/2,")")).style("lineWidth",1).style("stroke",this.select.style.stroke);var g=(n=this.style.options)===null||n===void 0?void 0:n.find(function(E){return E.value===e.currentValue}),p=(0,Z.pi)({x:a+f[3]},d);he(this.select).selectAll(".placeholder").data(g?[]:[1]).join(function(E){return E.append("text").attr("className","placeholder").styles(p).style("y",function(){var O=this.getBBox();return s+(l-O.height)/2})},function(E){return E.styles(p)},function(E){return E.remove()});var y=_e(this.attributes,"optionLabel"),b=(0,Z.pi)({x:a+f[3]},y);he(this.select).selectAll(".value").data(g?[g]:[]).join(function(E){return E.append(function(O){return Oa(O.label)}).attr("className","value").styles(b).style("y",function(){var O=this.getBBox();return s+(l-O.height)/2})},function(E){return E.styles(b)},function(E){return E.remove()})},t.prototype.renderDropdown=function(){var e=this,n,i,a=this.style,s=a.x,o=a.y,l=a.width,c=a.height,u=a.options,h=a.onSelect,d=a.open,f=_e(this.attributes,"dropdown"),v=_e(this.attributes,"option"),g=this.dropdownPadding;he(this.dropdown).maybeAppend(".dropdown-container","g").attr("className","dropdown-container").selectAll(".dropdown-item").data(u,function(b){return b.value}).join(function(b){return b.append(function(E){return new l4({className:"dropdown-item",style:(0,Z.pi)((0,Z.pi)((0,Z.pi)({},E),v),{width:l-g[1]-g[3],selected:E.value===e.currentValue,onClick:function(O,k,P){e.setValue(O),h==null||h(O,k,P),e.dispatchEvent(new Jn("change",{detail:{value:O,option:k,item:P}})),Hi(e.dropdown)}})})}).each(function(E,O){var k,P=(k=this.parentNode)===null||k===void 0?void 0:k.children,F=P.reduce(function(B,V,U){return U<O&&(B+=V.getBBox().height),B},0);this.attr("transform","translate(".concat(g[3],", ").concat(g[0]+F,")"))})},function(b){return b.update(function(E){return{selected:E.value===e.currentValue}})},function(b){return b.remove()});var p=(i=(n=this.dropdown.getElementsByClassName("dropdown-container"))===null||n===void 0?void 0:n[0])===null||i===void 0?void 0:i.getBBox(),y=f.spacing;this.dropdown.attr((0,Z.pi)({transform:"translate(".concat(s,", ").concat(o+c+y,")"),width:p.width+g[1]+g[3],height:p.height+g[0]+g[2]},f)),!d&&Hi(this.dropdown)},t.prototype.render=function(){this.renderSelect(),this.renderDropdown()},t.prototype.bindEvents=function(){var e=this;this.addEventListener("click",function(n){n.stopPropagation()}),this.select.addEventListener("click",function(){e.dropdown.style.visibility==="visible"?Hi(e.dropdown):Gl(e.dropdown)}),this.addEventListener("pointerenter",function(){e.isPointerInSelect=!0}),this.addEventListener("pointerleave",function(){e.isPointerInSelect=!1}),document==null||document.addEventListener("click",function(){e.isPointerInSelect||Hi(e.dropdown)})},t.defaultOptions={style:{x:0,y:0,width:140,height:32,options:[],bordered:!0,defaultValue:"",selectRadius:8,selectStroke:"#d9d9d9",showDropdownIcon:!0,placeholderText:"\u8BF7\u9009\u62E9",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"}},t}(Ln),Qi=function(r){(0,Z.ZT)(t,r);function t(e){var n=r.call(this,tr({},{style:{backgroundOpacity:t.backgroundOpacities.default}},t.defaultOptions,e))||this;return n.showBackground=!0,n.background=n.appendChild(new br({})),n.icon=n.appendChild(new ar({})),n}return Object.defineProperty(t.prototype,"label",{get:function(){return"BaseIcon"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lineWidth",{get:function(){return Math.log10(this.attributes.size)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"padding",{get:function(){return Sr(this.attributes.size/5)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"iconSize",{get:function(){var e=this.attributes.size,n=(0,Z.CR)(this.padding,4),i=n[0],a=n[1],s=n[2],o=n[3];return Math.max(e-Math.max(o+a,i+s),this.lineWidth*2+1)},enumerable:!1,configurable:!0}),t.prototype.renderBackground=function(){var e=this.attributes,n=e.x,i=e.y,a=e.size,s=a/2,o=_e(this.attributes,"background");this.background.attr((0,Z.pi)({x:n-s,y:i-s,width:a,height:a},o))},t.prototype.showIndicator=function(){if(this.label){var e=this.attributes.size,n=this.background.getBBox(),i=n.x,a=n.y;this.indicator.update({x:i+e/2,y:a-5,labelText:this.label,visibility:"visible"})}},t.prototype.hideIndicator=function(){this.indicator.update({visibility:"hidden"})},t.prototype.connectedCallback=function(){var e;r.prototype.connectedCallback.call(this);var n=this.attributes.size,i=this.background.getBBox(),a=i.x,s=i.y,o=(e=this.ownerDocument)===null||e===void 0?void 0:e.defaultView;o&&(this.indicator=o.appendChild(new o4({style:{x:a+n/2,y:s-n/2,visibility:"hidden",position:"top",radius:3,zIndex:100}})))},t.prototype.disconnectedCallback=function(){this.indicator.destroy()},t.prototype.render=function(){this.renderIcon(),this.showBackground&&this.renderBackground()},t.prototype.bindEvents=function(){var e=this,n=this.attributes.onClick;if(this.addEventListener("click",function(){n==null||n(e)}),this.showBackground){var i=function(){return e.background.attr({opacity:t.backgroundOpacities.default})},a=function(){return e.background.attr({opacity:t.backgroundOpacities.hover})},s=function(){return e.background.attr({opacity:t.backgroundOpacities.active})};this.addEventListener("pointerenter",function(){a(),e.showIndicator()}),this.addEventListener("pointerleave",function(){i(),e.hideIndicator()}),this.addEventListener("pointerdown",function(){s()}),this.addEventListener("pointerup",function(){i()})}},t.tag="IconBase",t.defaultOptions={style:{x:0,y:0,size:10,color:"#565758",backgroundRadius:4,backgroundFill:"#e2e2e2"}},t.backgroundOpacities={default:0,hover:.8,active:1},t}(Ln),Kl=function(r,t){return t===void 0&&(t="#565758"),new li({style:{fill:t,d:"M ".concat(r,",").concat(r," L -").concat(r,",0 L ").concat(r,",-").concat(r," Z"),transformOrigin:"center"}})},u4=function(r){(0,Z.ZT)(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return t.prototype.arcPath=function(e,n,i){var a=(0,Z.CR)([i,i],2),s=a[0],o=a[1],l=function(g){return[e+i*Math.cos(g),n+i*Math.sin(g)]},c=(0,Z.CR)(l(-5/4*Math.PI),2),u=c[0],h=c[1],d=(0,Z.CR)(l(1/4*Math.PI),2),f=d[0],v=d[1];return"M".concat(u,",").concat(h,",A").concat(s,",").concat(o,",0,1,1,").concat(f,",").concat(v)},Object.defineProperty(t.prototype,"label",{get:function(){return"\u91CD\u7F6E"},enumerable:!1,configurable:!0}),t.prototype.renderIcon=function(){var e=this.attributes,n=e.x,i=e.y,a=e.color,s=this.iconSize,o=this.lineWidth,l=o+.5;he(this.icon).maybeAppend(".reset","path").styles({stroke:a,lineWidth:o,d:this.arcPath(n,i,s/2-o),markerStart:Kl(l,a)})},t}(Qi),h4=function(r){(0,Z.ZT)(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return Object.defineProperty(t.prototype,"label",{get:function(){return"\u5FEB\u9000"},enumerable:!1,configurable:!0}),t.prototype.renderIcon=function(){var e=this.attributes,n=e.x,i=e.y,a=e.color,s=this.iconSize,o=s/2,l=s/2/Math.pow(3,.5),c=[[n,i],[n,i-l],[n-o,i],[n,i+l],[n,i],[n+o,i-l],[n+o,i+l],[n,i]];he(this.icon).maybeAppend(".backward","polygon").styles({points:c,fill:a})},t}(Qi),d4=function(r){(0,Z.ZT)(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return Object.defineProperty(t.prototype,"label",{get:function(){return"\u5FEB\u8FDB"},enumerable:!1,configurable:!0}),t.prototype.renderIcon=function(){var e=this.attributes,n=e.x,i=e.y,a=e.color,s=this.iconSize,o=s/2,l=s/2/Math.pow(3,.5),c=[[n,i],[n,i-l],[n+o,i],[n,i+l],[n,i],[n-o,i-l],[n-o,i+l],[n,i]];he(this.icon).maybeAppend(".forward","polygon").styles({points:c,fill:a})},t}(Qi),f4=function(r){(0,Z.ZT)(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return Object.defineProperty(t.prototype,"label",{get:function(){return"\u64AD\u653E"},enumerable:!1,configurable:!0}),t.prototype.renderIcon=function(){var e=this.attributes,n=e.x,i=e.y,a=e.color,s=this.iconSize,o=s/3*Math.pow(3,.5)*.8,l=[[n+o,i],[n-o/2,i-s/2*.8],[n-o/2,i+s/2*.8],[n+o,i]];he(this.icon).maybeAppend(".play","polygon").styles({points:l,fill:a})},t}(Qi),v4=function(r){(0,Z.ZT)(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return Object.defineProperty(t.prototype,"label",{get:function(){return"\u6682\u505C"},enumerable:!1,configurable:!0}),t.prototype.renderIcon=function(){var e=this.attributes,n=e.x,i=e.y,a=e.color,s=this.iconSize,o=s/3,l=[[n-o,i-s/2],[n-o,i+s/2],[n-o/2,i+s/2],[n-o/2,i-s/2],[n-o,i-s/2],[n+o/2,i-s/2],[n+o/2,i+s/2],[n+o,i+s/2],[n+o,i-s/2]];he(this.icon).maybeAppend(".pause","polygon").styles({points:l,fill:a})},t}(Qi),g4=function(r){(0,Z.ZT)(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return Object.defineProperty(t.prototype,"label",{get:function(){return"\u8303\u56F4\u65F6\u95F4"},enumerable:!1,configurable:!0}),t.prototype.renderIcon=function(){var e=this.attributes,n=e.x,i=e.y,a=e.color,s=this,o=s.iconSize,l=s.lineWidth,c=l;he(this.icon).maybeAppend(".left-line","line").styles({x1:n-o/2,y1:i-o/2,x2:n-o/2,y2:i+o/2,stroke:a,lineWidth:l}),he(this.icon).maybeAppend(".right-line","line").styles({x1:n+o/2,y1:i-o/2,x2:n+o/2,y2:i+o/2,stroke:a,lineWidth:l}),he(this.icon).maybeAppend(".left-arrow","line").styles({x1:n,y1:i,x2:n-o/2+c*2,y2:i,stroke:a,lineWidth:l,markerEnd:Kl(l*2,a)}),he(this.icon).maybeAppend(".right-arrow","line").styles({x1:n,y1:i,x2:n+o/2-c*2,y2:i,stroke:a,lineWidth:l,markerEnd:Kl(l*2,a)})},t}(Qi),p4=function(r){(0,Z.ZT)(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return Object.defineProperty(t.prototype,"label",{get:function(){return"\u5355\u4E00\u65F6\u95F4"},enumerable:!1,configurable:!0}),t.prototype.renderIcon=function(){var e=this.attributes,n=e.x,i=e.y,a=e.color,s=this,o=s.iconSize,l=s.lineWidth;he(this.icon).maybeAppend(".line","line").styles({x1:n,y1:i-o/2,x2:n,y2:i+o/2,stroke:a,lineWidth:l});var c=l;he(this.icon).maybeAppend(".left-arrow","line").styles({x1:n-o/2-c*2,y1:i,x2:n-c*2,y2:i,stroke:a,lineWidth:l,markerEnd:Kl(l*2,a)}),he(this.icon).maybeAppend(".right-arrow","line").styles({x1:n+o/2+c*2,y1:i,x2:n+c*2,y2:i,stroke:a,lineWidth:l,markerEnd:Kl(l*2,a)})},t}(Qi),EE=function(r){return[[-r/2,-r/2],[-r/2,r/2],[r/2,r/2]]},m4=function(r){(0,Z.ZT)(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return Object.defineProperty(t.prototype,"label",{get:function(){return"\u6298\u7EBF\u56FE"},enumerable:!1,configurable:!0}),t.prototype.renderIcon=function(){var e=this.attributes,n=e.x,i=e.y,a=e.color,s=this,o=s.iconSize,l=s.lineWidth,c=l,u=(o-c*2-l)/4,h=(o-c*2-l)/2,d=(0,Z.CR)([n-o/2+c,i+o/2-c*2],2),f=d[0],v=d[1];he(this.icon).maybeAppend(".coordinate","polyline").styles({points:EE(o).map(function(g){var p=(0,Z.CR)(g,2),y=p[0],b=p[1];return[y+n,b+i]}),stroke:a,lineWidth:l}),he(this.icon).maybeAppend(".line","polyline").styles({points:[[f,v],[f+u,v-h],[f+u*2,v],[f+u*4,v-h*2]],stroke:a,lineWidth:l})},t}(Qi),y4=function(r){(0,Z.ZT)(t,r);function t(){return r!==null&&r.apply(this,arguments)||this}return Object.defineProperty(t.prototype,"label",{get:function(){return"\u6761\u5F62\u56FE"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"data",{get:function(){return[1,4,2,4,3]},enumerable:!1,configurable:!0}),t.prototype.renderIcon=function(){var e=this.data,n=this.attributes,i=n.x,a=n.y,s=n.color,o=this,l=o.iconSize,c=o.lineWidth,u=c,h=(l-u)/e.length,d=(l-u*2)/4,f=(0,Z.CR)([i-l/2+u*2,a+l/2-u],2),v=f[0],g=f[1];he(this.icon).maybeAppend(".coordinate","polyline").styles({points:EE(l).map(function(p){var y=(0,Z.CR)(p,2),b=y[0],E=y[1];return[b+i,E+a]}),stroke:s,lineWidth:c}),he(this.icon).maybeAppend(".bars","g").selectAll(".column").data(this.data.map(function(p,y){return{value:p,index:y}})).join(function(p){return p.append("line").attr("className","column").style("x1",function(y){var b=y.index;return v+h*b}).style("y1",g).style("x2",function(y){var b=y.index;return v+h*b}).style("y2",function(y){var b=y.value;return g-d*b}).styles({y1:g,stroke:s,lineWidth:c})})},t}(Qi),b4=function(r){(0,Z.ZT)(t,r);function t(e){var n=r.call(this,tr({},{style:{color:"#d8d9d9"}},e))||this;return n.showBackground=!1,n}return t.prototype.renderIcon=function(){var e=this.attributes,n=e.x,i=e.y,a=e.color,s=this,o=s.iconSize,l=s.lineWidth;he(this.icon).maybeAppend(".split","line").styles({x1:n,y1:i-o/2,x2:n,y2:i+o/2,stroke:a,lineWidth:l})},t}(Qi),_0=function(r){(0,Z.ZT)(t,r);function t(){var e=r.apply(this,(0,Z.ev)([],(0,Z.CR)(arguments),!1))||this;return e.showBackground=!1,e}return Object.defineProperty(t.prototype,"padding",{get:function(){return Sr(0)},enumerable:!1,configurable:!0}),t.prototype.renderIcon=function(){var e=this.iconSize,n=this.attributes,i=n.x,a=n.y,s=n.speed,o=s===void 0?1:s,l=Yv(this.attributes,["x","y","transform","transformOrigin","width","height","size","color","speed"]),c=kn(e,20,1/0),u=20,h=(0,Z.pi)((0,Z.pi)({},l),{x:i-c/2,y:a-u/2,width:c,height:u,defaultValue:o,bordered:!1,showDropdownIcon:!1,selectRadius:2,dropdownPadding:this.padding,dropdownRadius:2,dropdownSpacing:e/5,placeholderFontSize:e/2,optionPadding:0,optionLabelFontSize:e/2,optionBackgroundRadius:1,options:[{label:"1x",value:1},{label:"1.5x",value:1.5},{label:"2x",value:2}]});he(this.icon).maybeAppend(".speed",function(){return new c4({style:h})}).attr("className","speed").each(function(){this.update(h)})},t.tag="SpeedSelect",t}(Qi),D0=function(r){(0,Z.ZT)(t,r);function t(e){var n=r.call(this,e)||this;return n.icon=n.appendChild(new ar({})),n.currentType=n.attributes.type,n}return t.prototype.getType=function(){return this.currentType},t.prototype.render=function(){var e=this,n=this.attributes,i=n.onChange,a=(0,Z._T)(n,["onChange"]);he(this.icon).selectAll(".icon").data([this.currentType]).join(function(s){return s.append(function(o){var l,c=(l=e.toggles.find(function(u){var h=(0,Z.CR)(u,1),d=h[0];return d===o}))===null||l===void 0?void 0:l[1];if(!c)throw new Error("Invalid type: ".concat(o));return new c({})}).attr("className","icon").styles(a,!1).update({})},function(s){return s.styles({restStyles:a}).update({})},function(s){return s.remove()})},t.prototype.bindEvents=function(){var e=this,n=this.attributes.onChange;this.addEventListener("click",function(i){i.preventDefault(),i.stopPropagation();var a=(e.toggles.findIndex(function(o){var l=(0,Z.CR)(o,1),c=l[0];return c===e.currentType})+1)%e.toggles.length,s=e.toggles[a][0];n==null||n(e.currentType),e.currentType=s,e.render()})},t.tag="ToggleIcon",t}(Ln),I0=function(r){(0,Z.ZT)(t,r);function t(e){var n=r.call(this,tr({},{style:{type:"play"}},e))||this;return n.toggles=[["play",f4],["pause",v4]],n}return t}(D0),B0=function(r){(0,Z.ZT)(t,r);function t(e){var n=r.call(this,tr({},{style:{type:"range"}},e))||this;return n.toggles=[["range",g4],["value",p4]],n}return t}(D0),F0=function(r){(0,Z.ZT)(t,r);function t(e){var n=r.call(this,tr({},{style:{type:"column"}},e))||this;return n.toggles=[["line",m4],["column",y4]],n}return t}(D0),x4={reset:u4,speed:_0,backward:h4,playPause:I0,forward:d4,selectionType:B0,chartType:F0,split:b4},E4=function(r){(0,Z.ZT)(t,r);function t(e){var n=r.call(this,tr({},t.defaultOptions,e))||this;return n.background=n.appendChild(new br({})),n.functions=n.appendChild(new ar({})),n}return Object.defineProperty(t.prototype,"padding",{get:function(){return Sr(this.attributes.padding)},enumerable:!1,configurable:!0}),t.prototype.renderBackground=function(){var e=this.style,n=e.x,i=e.y,a=e.width,s=e.height,o=_e(this.attributes,"background");this.background.attr((0,Z.pi)({x:n,y:i,width:a,height:s},o))},t.prototype.renderFunctions=function(){var e=this,n,i=this.attributes,a=i.functions,s=i.iconSize,o=i.iconSpacing,l=i.x,c=i.y,u=i.width,h=i.height,d=i.align,f=(0,Z.CR)(this.padding,4),v=f[1],g=f[3],p=a.reduce(function(E,O){return E.length&&O.length?E.concat.apply(E,(0,Z.ev)(["split"],(0,Z.CR)(O),!1)):E.concat.apply(E,(0,Z.ev)([],(0,Z.CR)(O),!1))},[]),y=p.length*(s+o)-o,b={left:g+s/2,center:(u-y)/2+s/2,right:u-y-g-v+s/2}[d]||0;(n=this.speedSelect)===null||n===void 0||n.destroy(),this.functions.removeChildren(),p.forEach(function(E,O){var k,P=x4[E],F={x:l+O*(s+o)+b,y:c+h/2,size:s};if(P===_0?(F.speed=e.attributes.speed,F.onSelect=function(V){return e.handleFunctionChange(E,{value:V})}):[I0,B0,F0].includes(P)?(F.onChange=function(V){return e.handleFunctionChange(E,{value:V})},P===I0&&(F.type=e.attributes.state==="play"?"pause":"play"),P===B0&&(F.type=e.attributes.selectionType==="range"?"value":"range"),P===F0&&(F.type=e.attributes.chartType==="line"?"column":"line")):F.onClick=function(){return e.handleFunctionChange(E,{value:E})},P===_0){var B=(k=e.ownerDocument)===null||k===void 0?void 0:k.defaultView;B&&(e.speedSelect=new P({style:(0,Z.pi)((0,Z.pi)({},F),{zIndex:100})}),B.appendChild(e.speedSelect))}else e.functions.appendChild(new P({style:F}))})},t.prototype.disconnectedCallback=function(){var e;r.prototype.disconnectedCallback.call(this),(e=this.speedSelect)===null||e===void 0||e.destroy()},t.prototype.render=function(){this.renderBackground(),this.renderFunctions()},t.prototype.handleFunctionChange=function(e,n){var i=this.attributes.onChange;i==null||i(e,n)},t.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"]]}},t}(Ln),w4=function(r){(0,Z.ZT)(t,r);function t(e){var n=r.call(this,tr({},t.defaultOptions,e))||this;return n.bindEvents(),n}return t.prototype.bindEvents=function(){var e=this;this.addEventListener("mouseenter",function(){e.attr("lineWidth",Math.ceil(+(e.style.r||0)/2))}),this.addEventListener("mouseleave",function(){e.attr("lineWidth",0)})},t.defaultOptions={style:{r:5,fill:"#3f7cf7",lineWidth:0,stroke:"#3f7cf7",strokeOpacity:.5,cursor:"pointer"}},t}(aa),S4=function(r){(0,Z.ZT)(t,r);function t(e){return r.call(this,tr({},t.defaultOptions,e))||this}return t.prototype.renderBackground=function(){var e=this.attributes,n=e.x,i=e.y,a=e.width,s=e.height,o=_e(this.attributes,"background");he(this).maybeAppend("background","rect").attr("className","background").styles((0,Z.pi)({x:n-a/2,y:i-s/2,width:a,height:s},o))},t.prototype.renderIcon=function(){var e=this.attributes,n=e.x,i=e.y,a=e.iconSize,s=_e(this.attributes,"icon"),o=1,l=a/2;he(this).maybeAppend("icon-left-line","line").attr("className","icon-left-line").styles((0,Z.pi)({x1:n-o,y1:i-l,x2:n-o,y2:i+l},s)),he(this).maybeAppend("icon-right-line","line").attr("className","icon-right-line").styles((0,Z.pi)({x1:n+o,y1:i-l,x2:n+o,y2:i+l},s))},t.prototype.renderBorder=function(){var e=this.attributes,n=e.x,i=e.y,a=e.width,s=e.height,o=e.type,l=_e(this.attributes,"border"),c=o==="start"?+a/2:-a/2;he(this).maybeAppend("border","line").attr("className","border").styles((0,Z.pi)({x1:c+n,y1:i-s/2,x2:c+n,y2:i+s/2},l))},t.prototype.render=function(){this.renderBackground(),this.renderIcon(),this.renderBorder()},t.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}},t}(Ln);function M4(r,t){return typeof r=="number"?wE(r):A4(r,t)}function A4(r,t){var e=new Date(r);switch(t){case"half-hour":case"hour":case"four-hour":return[0,6,12,18].includes(e.getHours())&&e.getMinutes()===0?Vr(e,`HH:mm
|
|
|
YYYY-MM-DD`):Vr(e,"HH:mm");case"half-day":return e.getHours()<12?`AM
|
|
|
`.concat(Vr(e,"YYYY-MM-DD")):"PM";case"day":return[1,10,20].includes(e.getDate())?Vr(e,`DD
|
|
|
YYYY-MM`):Vr(e,"DD");case"week":return e.getDate()<=7?Vr(e,`DD
|
|
|
YYYY-MM`):Vr(e,"DD");case"month":return[0,6].includes(e.getMonth())?Vr(e,`MM\u6708
|
|
|
YYYY`):Vr(e,"MM\u6708");case"season":return[0].includes(e.getMonth())?Vr(e,`MM\u6708
|
|
|
YYYY`):Vr(e,"MM\u6708");case"year":return Vr(e,"YYYY");default:return Vr(e,"YYYY-MM-DD HH:mm")}}function wE(r){var t=String(Math.floor(r/3600)).padStart(2,"0"),e=String(Math.floor(r%3600/60)).padStart(2,"0"),n=String(Math.floor(r%60)).padStart(2,"0");return r<3600?"".concat(e,":").concat(n):"".concat(t,":").concat(e,":").concat(n)}var T4=function(r){(0,Z.ZT)(t,r);function t(e){var n=r.call(this,tr({},t.defaultOptions,e))||this;n.axis=n.appendChild(new S5({style:{type:"linear",startPos:[0,0],endPos:[0,0],data:[],showArrow:!1,animate:!1}})),n.timeline=n.appendChild(new a4({style:{onChange:function(h){n.handleSliderChange(h)}}})),n.controller=n.appendChild(new E4({})),n.states={},n.handleSliderChange=function(h){var d=function(){var f=n.states.values;return Array.isArray(f)?(0,Z.ev)([],(0,Z.CR)(f),!1):f}();n.setBySliderValues(h),n.dispatchOnChange(d)};var i=n.attributes,a=i.selectionType,s=i.chartType,o=i.speed,l=i.state,c=i.playMode,u=i.values;return n.states={chartType:s,playMode:c,selectionType:a,speed:o,state:l},n.setByTimebarValues(u),n}return Object.defineProperty(t.prototype,"data",{get:function(){var e=this.attributes.data,n=function(i,a){return i.time<a.time?-1:i.time>a.time?1:0};return e.sort(n)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"space",{get:function(){var e=this.attributes,n=e.x,i=e.y,a=e.width,s=e.height,o=e.type,l=e.controllerHeight,c=kn(+s-l,0,+s),u=new Lr(n,i+ +s-l,+a,l),h,d=0;o==="chart"?(d=35,h=new Lr(n,i+c-d,+a,d)):h=new Lr;var f=o==="time"?10:c,v=new Lr(n,i+(o==="time"?c:c-f),+a,f-d);return{axisBBox:h,controllerBBox:u,timelineBBox:v}},enumerable:!1,configurable:!0}),t.prototype.setBySliderValues=function(e){var n,i,a=this.data,s=(0,Z.CR)(Array.isArray(e)?e:[0,e],2),o=s[0],l=s[1],c=a.length,u=a[Math.floor(o*c)],h=a[Math.ceil(l*c)-(Array.isArray(e)?0:1)];this.states.values=[(n=u==null?void 0:u.time)!==null&&n!==void 0?n:a[0].time,(i=h==null?void 0:h.time)!==null&&i!==void 0?i:1/0]},t.prototype.setByTimebarValues=function(e){var n,i,a,s=this.data,o=(0,Z.CR)(Array.isArray(e)?e:[void 0,e],2),l=o[0],c=o[1],u=s.find(function(d){var f=d.time;return f===l}),h=s.find(function(d){var f=d.time;return f===c});this.states.values=[(n=u==null?void 0:u.time)!==null&&n!==void 0?n:(i=s[0])===null||i===void 0?void 0:i.time,(a=h==null?void 0:h.time)!==null&&a!==void 0?a:1/0]},t.prototype.setByIndex=function(e){var n,i,a,s,o=this.data,l=(0,Z.CR)(e,2),c=l[0],u=l[1];this.states.values=[(i=(n=o[c])===null||n===void 0?void 0:n.time)!==null&&i!==void 0?i:o[0].time,(s=(a=this.data[u])===null||a===void 0?void 0:a.time)!==null&&s!==void 0?s:1/0]},Object.defineProperty(t.prototype,"sliderValues",{get:function(){var e=this.states,n=e.values,i=e.selectionType,a=(0,Z.CR)(Array.isArray(n)?n:[void 0,n],2),s=a[0],o=a[1],l=this.data,c=l.length,u=i==="value",h=function(){var f=l.findIndex(function(v){var g=v.time;return g===s});return u?0:f>-1?f/c:0},d=function(){if(o===1/0)return 1;var f=l.findIndex(function(v){var g=v.time;return g===o});return f>-1?f/c:u?.5:1};return[h(),d()]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"values",{get:function(){var e=this.states,n=e.values,i=e.selectionType,a=(0,Z.CR)(Array.isArray(n)?n:[this.data[0].time,n],2),s=a[0],o=a[1];return i==="value"?o:[s,o]},enumerable:!1,configurable:!0}),t.prototype.getDatumByRatio=function(e){var n=this.data,i=n.length,a=Math.floor(e*(i-1));return n[a]},Object.defineProperty(t.prototype,"chartHandleIconShape",{get:function(){var e=this.states.selectionType,n=this.space.timelineBBox.height;return e==="range"?function(i){return new S4({style:{type:i,height:n,iconSize:n/6}})}:function(){return new Os({style:{x1:0,y1:-n/2,x2:0,y2:n/2,lineWidth:2,stroke:"#c8c8c8"}})}},enumerable:!1,configurable:!0}),t.prototype.getChartStyle=function(e){var n=this,i=e.x,a=e.y,s=e.width,o=e.height,l=this.states,c=l.selectionType,u=l.chartType,h=this.data,d=this.attributes,f=d.type,v=d.labelFormatter,g=_e(this.attributes,"chart"),p=g.type,y=(0,Z._T)(g,["type"]),b=c==="range";if(f==="time")return(0,Z.pi)({handleIconShape:function(){return new w4({})},selectionFill:"#2e7ff8",selectionFillOpacity:1,showLabelOnInteraction:!0,handleLabelDy:b?-15:0,autoFitLabel:b,handleSpacing:b?-15:0,trackFill:"#edeeef",trackLength:s,trackOpacity:.5,trackRadius:o/2,trackSize:o/2,type:c,values:this.sliderValues,formatter:function(k){if(v)return v(k);var P=n.getDatumByRatio(k).time;return typeof P=="number"?wE(P):Vr(P,"YYYY-MM-DD HH:mm:ss")},transform:"translate(".concat(i,", ").concat(a,")"),zIndex:1},y);var E=c==="range"?5:0,O=h.map(function(k){var P=k.value;return P});return(0,Z.pi)({handleIconOffset:E,handleIconShape:this.chartHandleIconShape,selectionFill:"#fff",selectionFillOpacity:.5,selectionType:"invert",sparklineSpacing:.1,sparklineColumnLineWidth:0,sparklineColor:"#d4e5fd",sparklineAreaOpacity:1,sparklineAreaLineWidth:0,sparklineData:O,sparklineType:u,sparklineScale:.8,trackLength:s,trackSize:o,type:c,values:this.sliderValues,transform:"translate(".concat(i,", ").concat(a,")"),zIndex:1},y)},t.prototype.renderChart=function(e){e===void 0&&(e=this.space.timelineBBox),this.timeline.update(this.getChartStyle(e))},t.prototype.updateSelection=function(){this.timeline.setValues(this.sliderValues,!0),this.handleSliderChange(this.sliderValues)},t.prototype.getAxisStyle=function(e){var n=this.data,i=this.attributes,a=i.interval,s=i.labelFormatter,o=_e(this.attributes,"axis"),l=e.x,c=e.y,u=e.width,h=(0,Z.ev)((0,Z.ev)([],(0,Z.CR)(n),!1),[{time:0}],!1).map(function(f,v,g){var p=f.time;return{label:"".concat(p),value:v/(g.length-1),time:p}}),d=(0,Z.pi)({startPos:[l,c],endPos:[l+u,c],data:h,labelFilter:function(f,v){return v<h.length-1},labelFormatter:function(f){var v=f.time;return s?s(v):M4(v,a)}},o);return d},t.prototype.renderAxis=function(e){e===void 0&&(e=this.space.axisBBox);var n=this.attributes.type;n==="chart"&&this.axis.update(this.getAxisStyle(e))},t.prototype.renderController=function(e){e===void 0&&(e=this.space.controllerBBox);var n=this.attributes.type,i=this.states,a=i.state,s=i.speed,o=i.selectionType,l=i.chartType,c=_e(this.attributes,"controller"),u=this,h=(0,Z.pi)((0,Z.pi)((0,Z.pi)({},e),{iconSize:20,speed:s,state:a,selectionType:o,chartType:l,onChange:function(d,f){var v=f.value;switch(d){case"reset":u.internalReset();break;case"speed":u.handleSpeedChange(v);break;case"backward":u.internalBackward();break;case"playPause":v==="play"?u.internalPlay():u.internalPause();break;case"forward":u.internalForward();break;case"selectionType":u.handleSelectionTypeChange(v);break;case"chartType":u.handleChartTypeChange(v);break;default:break}}}),c);n==="time"&&(h.functions=[["reset","speed"],["backward","playPause","forward"],["selectionType"]]),this.controller.update(h)},t.prototype.dispatchOnChange=function(e){var n=this.data,i=this.attributes.onChange,a=this.states,s=a.values,o=a.selectionType,l=(0,Z.CR)(s,2),c=l[0],u=l[1],h=u===1/0?n.at(-1).time:u,d=o==="range"?[c,h]:h,f=function(v,g){return Array.isArray(v)?Array.isArray(g)?v[0]===g[0]&&(v[1]===g[1]||v[1]===1/0||g[1]===1/0):!1:Array.isArray(g)?!1:v===g};(!e||!f(e,d))&&(i==null||i(o==="range"?[c,h]:h))},t.prototype.internalReset=function(e){var n,i,a=this.states.selectionType;this.internalPause(),this.setBySliderValues(a==="range"?[0,1]:[0,0]),this.renderController(),this.updateSelection(),e||((i=(n=this.attributes)===null||n===void 0?void 0:n.onReset)===null||i===void 0||i.call(n),this.dispatchOnChange())},t.prototype.reset=function(){this.internalReset()},t.prototype.moveSelection=function(e,n){var i=this.data,a=i.length,s=this.states,o=s.values,l=s.selectionType,c=s.playMode,u=(0,Z.CR)(o,2),h=u[0],d=u[1],f=i.findIndex(function(E){var O=E.time;return O===h}),v=i.findIndex(function(E){var O=E.time;return O===d});v===-1&&(v=a);var g=e==="backward"?-1:1,p;l==="range"?c==="acc"?(p=[f,v+g],g===-1&&f===v&&(p=[f,a])):p=[f+g,v+g]:p=[f,v+g];var y=function(E){var O=(0,Z.CR)(E.sort(function(B,V){return B-V}),2),k=O[0],P=O[1],F=function(B){return kn(B,0,a)};return P>a?l==="value"?[0,0]:c==="acc"?[F(k),F(k)]:[0,F(P-k)]:k<0?c==="acc"?[0,F(P)]:[F(k+a-P),a]:[F(k),F(P)]},b=y(p);return this.setByIndex(b),this.updateSelection(),b},t.prototype.internalBackward=function(e){var n,i,a=this.moveSelection("backward",e);return e||((i=(n=this.attributes)===null||n===void 0?void 0:n.onBackward)===null||i===void 0||i.call(n),this.dispatchOnChange()),a},t.prototype.backward=function(){this.internalBackward()},t.prototype.internalPlay=function(e){var n=this,i,a,s=this.data,o=this.attributes.loop,l=this.states.speed,c=l===void 0?1:l;this.playInterval=window.setInterval(function(){var u=n.internalForward();u[1]===s.length&&!o&&(n.internalPause(),n.renderController())},1e3/c),this.states.state="play",!e&&((a=(i=this.attributes)===null||i===void 0?void 0:i.onPlay)===null||a===void 0||a.call(i))},t.prototype.play=function(){this.internalPlay()},t.prototype.internalPause=function(e){var n,i;clearInterval(this.playInterval),this.states.state="pause",!e&&((i=(n=this.attributes)===null||n===void 0?void 0:n.onPause)===null||i===void 0||i.call(n))},t.prototype.pause=function(){this.internalPause()},t.prototype.internalForward=function(e){var n,i,a=this.moveSelection("forward",e);return e||((i=(n=this.attributes)===null||n===void 0?void 0:n.onForward)===null||i===void 0||i.call(n),this.dispatchOnChange()),a},t.prototype.forward=function(){this.internalForward()},t.prototype.handleSpeedChange=function(e){var n,i;this.states.speed=e;var a=this.states.state;a==="play"&&(this.internalPause(!0),this.internalPlay(!0)),(i=(n=this.attributes)===null||n===void 0?void 0:n.onSpeedChange)===null||i===void 0||i.call(n,e)},t.prototype.handleSelectionTypeChange=function(e){var n,i;this.states.selectionType=e,this.renderChart(),(i=(n=this.attributes)===null||n===void 0?void 0:n.onSelectionTypeChange)===null||i===void 0||i.call(n,e)},t.prototype.handleChartTypeChange=function(e){var n,i;this.states.chartType=e,this.renderChart(),(i=(n=this.attributes)===null||n===void 0?void 0:n.onChartTypeChange)===null||i===void 0||i.call(n,e)},t.prototype.render=function(){var e=this.space,n=e.axisBBox,i=e.controllerBBox,a=e.timelineBBox;this.renderController(i),this.renderAxis(n),this.renderChart(a),this.states.state==="play"&&this.internalPlay()},t.prototype.destroy=function(){r.prototype.destroy.call(this),this.internalPause(!0)},t.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"}},t}(Ln);function O4(r){return r instanceof Date}var C4=function(r,t,e,n){function i(a){return a instanceof e?a:new e(function(s){s(a)})}return new(e||(e=Promise))(function(a,s){function o(u){try{c(n.next(u))}catch(h){s(h)}}function l(u){try{c(n.throw(u))}catch(h){s(h)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((n=n.apply(r,t||[])).next())})},N4=function(r,t){var e={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&t.indexOf(n)<0&&(e[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(e[n[i]]=r[n[i]]);return e};const k4=["timestamp","time","date","datetime"];class td extends fr{get padding(){return hi(this.options.padding)}constructor(t,e){super(t,Object.assign({},td.defaultOptions,e)),this.backup(),this.upsertTimebar()}play(){var t;(t=this.timebar)===null||t===void 0||t.play()}pause(){var t;(t=this.timebar)===null||t===void 0||t.pause()}forward(){var t;(t=this.timebar)===null||t===void 0||t.forward()}backward(){var t;(t=this.timebar)===null||t===void 0||t.backward()}reset(){var t;(t=this.timebar)===null||t===void 0||t.reset()}update(t){super.update(t),this.backup(),this.upsertTimebar()}backup(){this.originalData=SE(this.context.graph.getData())}upsertTimebar(){const{canvas:t}=this.context,e=this.options,{onChange:n,timebarType:i,data:a,x:s,y:o,width:l,height:c,mode:u}=e,h=N4(e,["onChange","timebarType","data","x","y","width","height","mode"]),d=t.getSize(),[f]=this.padding;this.upsertCanvas().ready.then(()=>{var v;const g=Object.assign(Object.assign({x:d[0]/2-l/2,y:f,onChange:p=>{const y=(Kr(p)?p:[p,p]).map(b=>O4(b)?b.getTime():b);this.options.mode==="modify"?this.filterElements(y):this.hiddenElements(y),n==null||n(y)}},h),{data:a.map(p=>ie(p)?{time:p,value:0}:p),width:l,height:c,type:i});this.timebar?this.timebar.update(g):(this.timebar=new T4({style:g}),(v=this.canvas)===null||v===void 0||v.appendChild(this.timebar))})}upsertCanvas(){if(this.canvas)return this.canvas;const{className:t,height:e,position:n}=this.options,i=this.context.canvas,[a]=i.getSize(),[s,,o]=this.padding,[l,c]=jh({width:a,height:e+s+o,graphCanvas:i,className:"timebar",placement:n});return this.container=l,t&&l.classList.add(t),this.canvas=c,this.canvas}filterElements(t){return C4(this,void 0,void 0,function*(){var e;if(!this.originalData)return;const{elementTypes:n,getTime:i}=this.options,{graph:a,element:s}=this.context,o=SE(this.originalData);n.forEach(c=>{const u=`${c}s`;o[u]=(this.originalData[u]||[]).filter(h=>{const d=i(h);return!!ME(d,t)})});const l=[...o.nodes,...o.combos].map(c=>At(c));o.edges=o.edges.filter(c=>{const u=c.source,h=c.target;return l.includes(u)&&l.includes(h)}),a.setData(o),yield(e=s.draw({animation:!1,silence:!0}))===null||e===void 0?void 0:e.finished})}hiddenElements(t){const{graph:e}=this.context,{elementTypes:n,getTime:i}=this.options,a=[],s=[];n.forEach(o=>{var l;const c=`${o}s`;(((l=this.originalData)===null||l===void 0?void 0:l[c])||[]).forEach(h=>{const d=At(h),f=i(h);ME(f,t)?s.push(d):a.push(d)})}),e.hideElement(a,!1),e.showElement(s,!1)}destroy(){var t,e,n;const{graph:i}=this.context;this.originalData&&i.setData(Object.assign({},this.originalData)),(t=this.timebar)===null||t===void 0||t.destroy(),(e=this.canvas)===null||e===void 0||e.destroy(),(n=this.container)===null||n===void 0||n.remove(),this.originalData=void 0,this.container=void 0,this.timebar=void 0,this.canvas=void 0,super.destroy()}}td.defaultOptions={position:"bottom",enable:!0,timebarType:"time",className:"g6-timebar",width:450,height:60,zIndex:3,elementTypes:["node"],padding:10,mode:"modify",getTime:r=>P4(r,k4,void 0),loop:!1};const SE=r=>{const{nodes:t=[],edges:e=[],combos:n=[]}=r;return{nodes:[...t],edges:[...e],combos:[...n]}},ME=(r,t)=>{if(ie(t))return r===t;const[e,n]=t;return r>=e&&r<=n},P4=(r,t,e)=>{var n;for(let i=0;i<t.length;i++){const a=t[i],s=(n=r.data)===null||n===void 0?void 0:n[a];if(s)return s}return e};var R4=function(r,t){var e={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&t.indexOf(n)<0&&(e[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(e[n[i]]=r[n[i]]);return e};const AE={fill:"#1D2129",wordWrap:!0,maxLines:1,textOverflow:"ellipsis",textBaseline:"top",textAlign:"start",x:0},L4=Object.assign(Object.assign({},AE),{fillOpacity:.9,fontSize:16,fontWeight:"bold"}),_4=Object.assign(Object.assign({},AE),{fillOpacity:.65,fontSize:12,fontWeight:"normal"}),D4={align:"left",spacing:8,size:44,padding:[16,24,0,24]},z0="title",TE="subtitle";class I4 extends fr{get padding(){return hi(this.options.padding)}constructor(t,e){const n=Object.assign({},D4,e);super(t,n),this.onRender=()=>{const i=this.updateCanvas();this.renderTitle(i)},this.bindEvents()}bindEvents(){const{graph:t}=this.context;t.on(Xt.AFTER_RENDER,this.onRender),t.on(Xt.AFTER_ANIMATE,this.onRender)}unbindEvents(){const{graph:t}=this.context;t.off(Xt.AFTER_RENDER,this.onRender),t.off(Xt.AFTER_ANIMATE,this.onRender)}destroy(){var t,e;this.unbindEvents(),(t=this.canvas)===null||t===void 0||t.destroy(),(e=this.container)===null||e===void 0||e.remove(),super.destroy()}updateCanvas(){const{size:t,className:e,align:n}=this.options,[i]=this.context.canvas.getSize(),[a=0,,s=0]=this.padding,o=t+a+s;if(this.canvas){const{width:l,height:c}=this.canvas.getConfig();(i!==l||o!==c)&&this.canvas.resize(i,o)}else{const l={left:"left-top",center:"top",right:"right-top"},[c,u]=jh({width:i,height:o,placement:l[n]||l.left,className:"title-canvas",graphCanvas:this.context.canvas});e&&c.classList.add(e),this.container=c,this.canvas=u}return this.canvas}renderTitle(t){const e=new B4({options:this.options,ctx:this.context});t.removeChildren(),e.getTitle().forEach(n=>{n&&t.appendChild(n)})}}class B4{get padding(){return hi(this.options.padding)}constructor(t){const{options:e,ctx:n}=t;this.options=e,this.context=n}getTitle(){const t=this.options,e=z0,n=t[e],i=TE,a=t[i],{spacing:s=44,padding:o,align:l}=t,c=R4(t,[typeof e=="symbol"?e:e+"",typeof i=="symbol"?i:i+"","spacing","padding","align"]),u=n,h=a,d=Dn(c,z0),f=Dn(c,TE),[v]=this.context.graph.getSize(),[g=0,p=0,,y=0]=this.padding,b=v,E=b-y-p;let O=null,k=y,P="left";switch(l){case"left":k=y,P="left";break;case"center":k=b/2,P="center";break;case"right":k=b-p,P="right";break;default:k=y,P="left"}const F=new ha({className:z0,style:Object.assign(Object.assign(Object.assign(Object.assign({},L4),{wordWrapWidth:E-5,x:k,y:g,textAlign:P}),d),{text:u})}),B=F.getBBox();return h&&(O=new ha({className:"subTitle",style:Object.assign(Object.assign(Object.assign(Object.assign({},_4),{wordWrapWidth:E-5,x:k,y:B.height+s+g,textAlign:P}),f),{text:h})})),[F,O]}}function F4(r){const t={top:"unset",right:"unset",bottom:"unset",left:"unset"};return r.split("-").forEach(n=>{t[n]="8px"}),t.flexDirection=r.startsWith("top")||r.startsWith("bottom")?"row":"column",t}const z4=`
|
|
|
.g6-toolbar {
|
|
|
position: absolute;
|
|
|
z-index: 100;
|
|
|
display: flex;
|
|
|
flex-direction: row;
|
|
|
align-items: center;
|
|
|
justify-content: center;
|
|
|
border-radius: 4px;
|
|
|
box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.1);
|
|
|
opacity: 0.65;
|
|
|
}
|
|
|
.g6-toolbar .g6-toolbar-item {
|
|
|
display: inline-block;
|
|
|
width: 16px;
|
|
|
height: 16px;
|
|
|
padding: 4px;
|
|
|
cursor: pointer;
|
|
|
box-sizing: content-box;
|
|
|
}
|
|
|
|
|
|
.g6-toolbar .g6-toolbar-item:hover {
|
|
|
background-color: #f0f0f0;
|
|
|
}
|
|
|
|
|
|
.g6-toolbar .g6-toolbar-item svg {
|
|
|
display: inline-block;
|
|
|
width: 100%;
|
|
|
height: 100%;
|
|
|
pointer-events: none;
|
|
|
}
|
|
|
`,j4=`
|
|
|
<svg>
|
|
|
<symbol id="zoom-in" viewBox="64 64 896 896">
|
|
|
<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>
|
|
|
</symbol>
|
|
|
<symbol id="zoom-out" viewBox="64 64 896 896">
|
|
|
<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>
|
|
|
</symbol>
|
|
|
<symbol id="edit" viewBox="64 64 896 896">
|
|
|
<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>
|
|
|
</symbol>
|
|
|
<symbol id="delete" viewBox="64 64 896 896">
|
|
|
<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>
|
|
|
</symbol>
|
|
|
<symbol id="redo" viewBox="64 64 896 896">
|
|
|
<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>
|
|
|
</symbol>
|
|
|
<symbol id="undo" viewBox="64 64 896 896">
|
|
|
<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>
|
|
|
</symbol>
|
|
|
<symbol id="export" viewBox="64 64 896 896">
|
|
|
<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>
|
|
|
</symbol>
|
|
|
<symbol id="auto-fit" viewBox="64 64 896 896">
|
|
|
<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>
|
|
|
<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>
|
|
|
</symbol>
|
|
|
<symbol id="reset" viewBox="64 64 896 896">
|
|
|
<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>
|
|
|
</symbol>
|
|
|
<symbol id="exit-fullscreen" viewBox="0 0 1024 1024">
|
|
|
<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>
|
|
|
<symbol id="request-fullscreen" viewBox="0 0 1024 1024">
|
|
|
<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>
|
|
|
</svg>
|
|
|
`;var OE=function(r,t,e,n){function i(a){return a instanceof e?a:new e(function(s){s(a)})}return new(e||(e=Promise))(function(a,s){function o(u){try{c(n.next(u))}catch(h){s(h)}}function l(u){try{c(n.throw(u))}catch(h){s(h)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((n=n.apply(r,t||[])).next())})};class ed extends fr{constructor(t,e){super(t,Object.assign({},ed.defaultOptions,e)),this.$element=Co("toolbar",!1),this.onToolbarItemClick=i=>{const{onClick:a}=this.options;if(i.target instanceof Element&&i.target.className.includes("g6-toolbar-item")){const s=i.target.getAttribute("value");a==null||a(s,i.target)}};const n=this.context.canvas.getContainer();this.$element.style.display="flex",n.appendChild(this.$element),Hv("g6-toolbar-css","style",{},z4,document.head),Hv("g6-toolbar-svgicon","div",{display:"none"},j4),this.$element.addEventListener("click",this.onToolbarItemClick),this.update(e)}update(t){const e=Object.create(null,{update:{get:()=>super.update}});return OE(this,void 0,void 0,function*(){e.update.call(this,t);const{className:n,position:i,style:a}=this.options;this.$element.className=`g6-toolbar ${n||""}`,Object.assign(this.$element.style,a,F4(i)),this.$element.innerHTML=yield this.getDOMContent()})}destroy(){this.$element.removeEventListener("click",this.onToolbarItemClick),this.$element.remove(),super.destroy()}getDOMContent(){return OE(this,void 0,void 0,function*(){return(yield this.options.getItems()).map(e=>{var n;return`
|
|
|
<div class="g6-toolbar-item" value="${e.value}" title="${(n=e.title)!==null&&n!==void 0?n:""}">
|
|
|
<svg aria-hidden="true" focusable="false">
|
|
|
<use xlink:href="#${e.id}"></use>
|
|
|
</svg>
|
|
|
</div>`}).join("")})}}ed.defaultOptions={position:"top-left"};function j0(r){var t=document.createElement("div");t.innerHTML=r;var e=t.childNodes[0];return e&&t.contains(e)&&t.removeChild(e),e}function G4(r,t){return!r||!t?r:r.replace(/\\?\{([^{}]+)\}/g,function(e,n){return e.charAt(0)==="\\"?e.slice(1):t[n]===void 0?"":t[n]})}var W4=G4,CE=function(r,t){if(t==null){r.innerHTML="";return}r.replaceChildren?Array.isArray(t)?r.replaceChildren.apply(r,(0,Z.ev)([],(0,Z.CR)(t),!1)):r.replaceChildren(t):(r.innerHTML="",Array.isArray(t)?t.forEach(function(e){return r.appendChild(e)}):r.appendChild(t))};function G0(r){return r===void 0&&(r=""),{CONTAINER:"".concat(r,"tooltip"),TITLE:"".concat(r,"tooltip-title"),LIST:"".concat(r,"tooltip-list"),LIST_ITEM:"".concat(r,"tooltip-list-item"),NAME:"".concat(r,"tooltip-list-item-name"),MARKER:"".concat(r,"tooltip-list-item-marker"),NAME_LABEL:"".concat(r,"tooltip-list-item-name-label"),VALUE:"".concat(r,"tooltip-list-item-value"),CROSSHAIR_X:"".concat(r,"tooltip-crosshair-x"),CROSSHAIR_Y:"".concat(r,"tooltip-crosshair-y")}}var NE={overflow:"hidden","white-space":"nowrap","text-overflow":"ellipsis"};function Z4(r){var t;r===void 0&&(r="");var e=G0(r);return t={},t[".".concat(e.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"},t[".".concat(e.TITLE)]={color:"rgba(0, 0, 0, 0.45)"},t[".".concat(e.LIST)]={margin:"0px","list-style-type":"none",padding:"0px"},t[".".concat(e.LIST_ITEM)]={"list-style-type":"none",display:"flex","line-height":"2em","align-items":"center","justify-content":"space-between","white-space":"nowrap"},t[".".concat(e.MARKER)]={width:"8px",height:"8px","border-radius":"50%",display:"inline-block","margin-right":"4px"},t[".".concat(e.NAME)]={display:"flex","align-items":"center","max-width":"216px"},t[".".concat(e.NAME_LABEL)]=(0,Z.pi)({flex:1},NE),t[".".concat(e.VALUE)]=(0,Z.pi)({display:"inline-block",float:"right",flex:1,"text-align":"right","min-width":"28px","margin-left":"30px",color:"rgba(0, 0, 0, 0.85)"},NE),t[".".concat(e.CROSSHAIR_X)]={position:"absolute",width:"1px","background-color":"rgba(0, 0, 0, 0.25)"},t[".".concat(e.CROSSHAIR_Y)]={position:"absolute",height:"1px","background-color":"rgba(0, 0, 0, 0.25)"},t}var V4=function(r){(0,Z.ZT)(t,r);function t(e){var n=this,i,a,s=(a=(i=e.style)===null||i===void 0?void 0:i.template)===null||a===void 0?void 0:a.prefixCls,o=G0(s);return n=r.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(o.CONTAINER,'"></div>'),title:'<div class="'.concat(o.TITLE,'"></div>'),item:'<li class="'.concat(o.LIST_ITEM,`" data-index={index}>
|
|
|
<span class="`).concat(o.NAME,`">
|
|
|
<span class="`).concat(o.MARKER,`" style="background:{color}"></span>
|
|
|
<span class="`).concat(o.NAME_LABEL,`" title="{name}">{name}</span>
|
|
|
</span>
|
|
|
<span class="`).concat(o.VALUE,`" title="{value}">{value}</span>
|
|
|
</li>`)},style:Z4(s)})||this,n.timestamp=-1,n.prevCustomContentKey=n.attributes.contentKey,n.initShape(),n.render(n.attributes,n),n}return Object.defineProperty(t.prototype,"HTMLTooltipElement",{get:function(){return this.element},enumerable:!1,configurable:!0}),t.prototype.getContainer=function(){return this.element},Object.defineProperty(t.prototype,"elementSize",{get:function(){var e=this.element.offsetWidth,n=this.element.offsetHeight;return{width:e,height:n}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"HTMLTooltipItemsElements",{get:function(){var e=this.attributes,n=e.data,i=e.template;return n.map(function(a,s){var o=a.name,l=o===void 0?"":o,c=a.color,u=c===void 0?"black":c,h=a.index,d=(0,Z._T)(a,["name","color","index"]),f=(0,Z.pi)({name:l,color:u,index:h!=null?h:s},d);return j0(W4(i.item,f))})},enumerable:!1,configurable:!0}),t.prototype.render=function(e,n){this.renderHTMLTooltipElement(),this.updatePosition()},t.prototype.destroy=function(){var e;(e=this.element)===null||e===void 0||e.remove(),r.prototype.destroy.call(this)},t.prototype.show=function(e,n){var i=this;if(e!==void 0&&n!==void 0){var a=this.element.style.visibility==="hidden",s=function(){i.attributes.x=e!=null?e:i.attributes.x,i.attributes.y=n!=null?n:i.attributes.y,i.updatePosition()};a?this.closeTransition(s):s()}this.element.style.visibility="visible"},t.prototype.hide=function(e,n){e===void 0&&(e=0),n===void 0&&(n=0);var i=this.attributes.enterable;i&&this.isCursorEntered(e,n)||(this.element.style.visibility="hidden")},t.prototype.initShape=function(){var e=this.attributes.template;this.element=j0(e.container),this.id&&this.element.setAttribute("id",this.id)},t.prototype.renderCustomContent=function(){if(!(this.prevCustomContentKey!==void 0&&this.prevCustomContentKey===this.attributes.contentKey)){this.prevCustomContentKey=this.attributes.contentKey;var e=this.attributes.content;e&&(typeof e=="string"?this.element.innerHTML=e:CE(this.element,e))}},t.prototype.renderHTMLTooltipElement=function(){var e,n,i=this.attributes,a=i.template,s=i.title,o=i.enterable,l=i.style,c=i.content,u=G0(a.prefixCls),h=this.element;if(this.element.style.pointerEvents=o?"auto":"none",c)this.renderCustomContent();else{s?(h.innerHTML=a.title,h.getElementsByClassName(u.TITLE)[0].innerHTML=s):(n=(e=h.getElementsByClassName(u.TITLE))===null||e===void 0?void 0:e[0])===null||n===void 0||n.remove();var d=this.HTMLTooltipItemsElements,f=document.createElement("ul");f.className=u.LIST,CE(f,d);var v=this.element.querySelector(".".concat(u.LIST));v?v.replaceWith(f):h.appendChild(f)}eI(h,l)},t.prototype.getRelativeOffsetFromCursor=function(e){var n=this.attributes,i=n.position,a=n.offset,s=e||i,o=s.split("-"),l={left:[-1,0],right:[1,0],top:[0,-1],bottom:[0,1]},c=this.elementSize,u=c.width,h=c.height,d=[-u/2,-h/2];return o.forEach(function(f){var v=(0,Z.CR)(d,2),g=v[0],p=v[1],y=(0,Z.CR)(l[f],2),b=y[0],E=y[1];d=[g+(u/2+a[0])*b,p+(h/2+a[1])*E]}),d},t.prototype.setOffsetPosition=function(e){var n=(0,Z.CR)(e,2),i=n[0],a=n[1],s=this.attributes,o=s.x,l=o===void 0?0:o,c=s.y,u=c===void 0?0:c,h=s.container,d=h.x,f=h.y;this.element.style.left="".concat(+l+d+i,"px"),this.element.style.top="".concat(+u+f+a,"px")},t.prototype.updatePosition=function(){var e=this.attributes.showDelay,n=e===void 0?60:e,i=Date.now();this.timestamp>0&&i-this.timestamp<n||(this.timestamp=i,this.setOffsetPosition(this.autoPosition(this.getRelativeOffsetFromCursor())))},t.prototype.autoPosition=function(e){var n=(0,Z.CR)(e,2),i=n[0],a=n[1],s=this.attributes,o=s.x,l=s.y,c=s.bounding,u=s.position;if(!c)return[i,a];var h=this.element,d=h.offsetWidth,f=h.offsetHeight,v=(0,Z.CR)([+o+i,+l+a],2),g=v[0],p=v[1],y={left:"right",right:"left",top:"bottom",bottom:"top"},b=c.x,E=c.y,O=c.width,k=c.height,P={left:g<b,right:g+d>b+O,top:p<E,bottom:p+f>E+k},F=[];u.split("-").forEach(function(V){P[V]?F.push(y[V]):F.push(V)});var B=F.join("-");return this.getRelativeOffsetFromCursor(B)},t.prototype.isCursorEntered=function(e,n){if(this.element){var i=this.element.getBoundingClientRect(),a=i.x,s=i.y,o=i.width,l=i.height;return new Lr(a,s,o,l).isPointIn(e,n)}return!1},t.prototype.closeTransition=function(e){var n=this,i=this.element.style.transition;this.element.style.transition="none",e(),setTimeout(function(){n.element.style.transition=i},10)},t.tag="tooltip",t}(Ln),kE=function(r,t,e,n){function i(a){return a instanceof e?a:new e(function(s){s(a)})}return new(e||(e=Promise))(function(a,s){function o(u){try{c(n.next(u))}catch(h){s(h)}}function l(u){try{c(n.throw(u))}catch(h){s(h)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((n=n.apply(r,t||[])).next())})};class nd extends fr{constructor(t,e){super(t,Object.assign({},nd.defaultOptions,e)),this.currentTarget=null,this.tooltipElement=null,this.container=null,this.isEnable=(n,i)=>{const{enable:a}=this.options;return typeof a=="function"?a(n,i):a},this.onClick=n=>{const{target:{id:i}}=n;this.currentTarget===i?this.hide(n):this.show(n)},this.onPointerMove=n=>{const{target:i}=n;!this.currentTarget||i.id===this.currentTarget||this.show(n)},this.onPointerLeave=n=>{this.hide(n)},this.onCanvasMove=n=>{this.hide(n)},this.onPointerOver=n=>{this.show(n)},this.showById=n=>kE(this,void 0,void 0,function*(){const i={target:{id:n}};yield this.show(i)}),this.getElementData=(n,i)=>{const{model:a}=this.context;switch(i){case"node":return a.getNodeData([n]);case"edge":return a.getEdgeData([n]);case"combo":return a.getComboData([n]);default:return[]}},this.show=n=>kE(this,void 0,void 0,function*(){var i,a;const{client:s,target:{id:o}}=n;if(Ll(n.target))return;const l=this.context.graph.getElementType(o),{getContent:c,title:u}=this.options,h=this.getElementData(o,l);if(!this.tooltipElement||!this.isEnable(n,h))return;let d={};if(c){if(d.content=yield c(n,h),!d.content)return}else{const g=this.context.graph.getElementRenderStyle(o),p=l==="node"?g.fill:g.stroke;d={title:u||l,data:h.map(y=>({name:"ID",value:y.id||`${y.source} -> ${y.target}`,color:p}))}}this.currentTarget=o;let f,v;if(s)f=s.x,v=s.y;else{const g=wr(h,"0.style",{x:0,y:0});f=g.x,v=g.y}(a=(i=this.options).onOpenChange)===null||a===void 0||a.call(i,!0),this.tooltipElement.update(Object.assign(Object.assign(Object.assign({},this.tooltipStyleProps),{x:f,y:v,style:{".tooltip":{visibility:"visible"}}}),d))}),this.hide=n=>{var i,a,s,o,l;if(!n){(a=(i=this.options).onOpenChange)===null||a===void 0||a.call(i,!1),(s=this.tooltipElement)===null||s===void 0||s.hide(),this.currentTarget=null;return}if(!this.tooltipElement||!this.currentTarget)return;const{client:{x:c,y:u}}=n;(l=(o=this.options).onOpenChange)===null||l===void 0||l.call(o,!1),this.tooltipElement.hide(c,u),this.currentTarget=null},this.initTooltip=()=>{var n;const i=new V4({className:"tooltip",style:this.tooltipStyleProps});return(n=this.container)===null||n===void 0||n.appendChild(i.HTMLTooltipElement),i},this.render(),this.bindEvents()}getEvents(){return this.options.trigger==="click"?{"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&&((e=this.container)===null||e===void 0||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:i,left:a}=n.getBoundingClientRect(),{style:s,position:o,enterable:l,container:c={x:-a,y:-i},title:u,offset:h}=this.options,[d,f]=e,[v,g]=t.getSize();return{x:d,y:f,container:c,title:u,bounding:{x:0,y:0,width:v,height:g},position:o,enterable:l,offset:h,style:s}}destroy(){var t;this.unbindEvents(),this.tooltipElement&&((t=this.container)===null||t===void 0||t.removeChild(this.tooltipElement.HTMLTooltipElement)),super.destroy()}}nd.defaultOptions={trigger:"hover",position:"top-right",enterable:!1,enable:!0,offset:[10,10],style:{".tooltip":{visibility:"hidden"}}};var PE=function(r,t,e,n){function i(a){return a instanceof e?a:new e(function(s){s(a)})}return new(e||(e=Promise))(function(a,s){function o(u){try{c(n.next(u))}catch(h){s(h)}}function l(u){try{c(n.throw(u))}catch(h){s(h)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((n=n.apply(r,t||[])).next())})};let _o;function RE(r,t){return _o||(_o=document.createElement("canvas")),_o.width=r,_o.height=t,_o.getContext("2d").clearRect(0,0,r,t),_o}function U4(r,t,e,n){return PE(this,void 0,void 0,function*(){const i=RE(r,t),a=i.getContext("2d"),{rotate:s,opacity:o,textFill:l,textFontSize:c,textFontFamily:u,textFontVariant:h,textFontWeight:d,textAlign:f,textBaseline:v}=n;return a.textAlign=f,a.textBaseline=v,a.translate(r/2,t/2),a.font=`${c}px ${u} ${h} ${d}`,s&&a.rotate(s),o&&(a.globalAlpha=o),l&&(a.fillStyle=l,a.fillText(`${e}`,0,0)),i.toDataURL()})}function Y4(r,t,e,n){return PE(this,void 0,void 0,function*(){const i=RE(r,t),a=i.getContext("2d"),{rotate:s,opacity:o}=n;s&&a.rotate(s),o&&(a.globalAlpha=o);const l=new Image;return l.crossOrigin="anonymous",l.src=e,new Promise(c=>{l.onload=function(){const u=r>l.width?(r-l.width)/2:0,h=t>l.height?(t-l.height)/2:0;a.drawImage(l,0,0,l.width,l.height,u,h,r-u*2,t-h*2),c(i.toDataURL())}})})}var H4=function(r,t,e,n){function i(a){return a instanceof e?a:new e(function(s){s(a)})}return new(e||(e=Promise))(function(a,s){function o(u){try{c(n.next(u))}catch(h){s(h)}}function l(u){try{c(n.throw(u))}catch(h){s(h)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((n=n.apply(r,t||[])).next())})},X4=function(r,t){var e={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&t.indexOf(n)<0&&(e[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(e[n[i]]=r[n[i]]);return e};class rd extends fr{constructor(t,e){super(t,Object.assign({},rd.defaultOptions,e)),this.$element=Co("watermark"),this.context.canvas.getContainer().appendChild(this.$element),this.update(e)}update(t){const e=Object.create(null,{update:{get:()=>super.update}});return H4(this,void 0,void 0,function*(){e.update.call(this,t);const n=this.options,{width:i,height:a,text:s,imageURL:o}=n,l=X4(n,["width","height","text","imageURL"]);Object.keys(l).forEach(u=>{u.startsWith("background")&&(this.$element.style[u]=t[u])});const c=o?yield Y4(i,a,o,l):yield U4(i,a,s,l);this.$element.style.backgroundImage=`url(${c})`})}destroy(){super.destroy(),this.$element.remove()}}rd.defaultOptions={width:200,height:100,opacity:.2,rotate:Math.PI/12,text:"",textFill:"#000",textFontSize:16,textAlign:"center",textBaseline:"middle",backgroundRepeat:"repeat"};const K4=["#7E92B5","#F4664A","#FFBE3A"],Q4={type:"group",color:["#1783FF","#00C9C9","#F08F56","#D580FF","#7863FF","#DB9D0D","#60C42D","#FF80CA","#2491B3","#17C76F"]},q4={type:"group",color:["#99ADD1","#1783FF","#00C9C9","#F08F56","#D580FF","#7863FF","#DB9D0D","#60C42D","#FF80CA","#2491B3","#17C76F"]};function LE(r){const{bgColor:t,textColor:e,nodeColor:n,nodeColorDisabled:i,nodeStroke:a,nodeHaloStrokeOpacityActive:s=.15,nodeHaloStrokeOpacitySelected:o=.25,nodeOpacityDisabled:l=.06,nodeIconOpacityInactive:c=.85,nodeOpacityInactive:u=.25,nodeBadgePalette:h=K4,nodePaletteOptions:d=Q4,edgeColor:f,edgeColorDisabled:v,edgePaletteOptions:g=q4,comboColor:p,comboColorDisabled:y,comboStroke:b,comboStrokeDisabled:E,edgeColorInactive:O}=r;return{background:t,node:{palette:d,style:{donutOpacity:1,badgeBackgroundOpacity:1,badgeFill:"#fff",badgeFontSize:8,badgePadding:[0,4],badgePalette:h,fill:n,fillOpacity:1,halo:!1,iconFill:"#fff",iconOpacity:1,labelBackground:!1,labelBackgroundFill:t,labelBackgroundLineWidth:0,labelBackgroundOpacity:.75,labelFill:e,labelFillOpacity:.85,labelLineHeight:16,labelPadding:[0,2],labelFontSize:12,labelFontWeight:400,labelOpacity:1,labelOffsetY:2,lineWidth:0,portFill:n,portLineWidth:1,portStroke:a,portStrokeOpacity:.65,size:32,stroke:a,strokeOpacity:1,zIndex:2},state:{selected:{halo:!0,haloLineWidth:24,haloStrokeOpacity:o,labelFontSize:12,labelFontWeight:"bold",lineWidth:4,stroke:a},active:{halo:!0,haloLineWidth:12,haloStrokeOpacity:s},highlight:{labelFontWeight:"bold",lineWidth:4,stroke:a,strokeOpacity:.85},inactive:{badgeBackgroundOpacity:u,donutOpacity:u,fillOpacity:u,iconOpacity:c,labelFill:e,labelFillOpacity:u,strokeOpacity:u},disabled:{badgeBackgroundOpacity:.25,donutOpacity:l,fill:i,fillOpacity:l,iconFill:i,iconOpacity:.25,labelFill:e,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:t,labelBackgroundLineWidth:0,labelBackgroundOpacity:.75,labelBackgroundPadding:[4,4,4,4],labelFill:e,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:O,fillOpacity:.08,labelOpacity:.25,strokeOpacity:.08,badgeBackgroundOpacity:.25},disabled:{stroke:v,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:t,collapsedMarkerFontSize:12,collapsedMarkerFillOpacity:1,collapsedSize:32,collapsedFillOpacity:1,fill:p,halo:!1,haloLineWidth:12,haloStroke:b,haloStrokeOpacity:.25,labelBackground:!1,labelBackgroundFill:t,labelBackgroundLineWidth:0,labelBackgroundOpacity:.75,labelBackgroundPadding:[2,4,2,4],labelFill:e,labelFontSize:12,labelFontWeight:400,labelOpacity:1,lineDash:0,lineWidth:1,fillOpacity:.04,strokeOpacity:1,padding:10,stroke:b},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:y,fillOpacity:.25,labelOpacity:.25,stroke:E,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 J4=LE({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"}),$4=LE({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 is extends Hf{beforeDraw(t,e){return t}afterLayout(t,e){}}class tB extends is{beforeDraw(t){const{model:e}=this.context,n=t.add.combos,i=a=>{const s=[];return a.forEach((o,l)=>{const u=e.getAncestorsData(l,"combo").map(h=>At(h)).reverse();s.push([l,o,u.length])}),new Map(s.sort(([,,o],[,,l])=>l-o).map(([o,l])=>[o,l]))};return t.add.combos=i(n),t.update.combos=i(t.update.combos),t}}function mi(r,t,e,n,i){const a=At(n),s=`${e}s`,o=i?n:r.add[s].get(a)||r.update[s].get(a)||r.remove[s].get(a)||n;Object.entries(r).forEach(([l,c])=>{t===l?c[s].set(a,o):c[s].delete(a)})}function id(r,t){return Object.keys(r).every(e=>r[e]===t[e])}class eB extends is{beforeDraw(t,e){if(e.stage==="visibility"||!this.context.model.model.hasTreeStructure(fn))return t;const{model:n}=this.context,{add:i,update:a}=t,s=[...t.update.combos.entries(),...t.add.combos.entries()];for(;s.length;){const[o,l]=s.pop();if(ni(l)){const c=n.getDescendantsData(o),u=c.map(At),{internal:h,external:d}=mv(u,f=>n.getRelatedEdgesData(f));c.forEach(f=>{const v=At(f),g=s.findIndex(([y])=>y===v);g!==-1&&s.splice(g,1);const p=n.getElementType(v);mi(t,"remove",p,f)}),h.forEach(f=>mi(t,"remove","edge",f)),d.forEach(f=>{var v;const g=At(f);((v=this.context.element)===null||v===void 0?void 0:v.getElement(g))?a.edges.set(g,f):i.edges.set(g,f)})}else{const c=n.getChildrenData(o),u=c.map(At),{edges:h}=mv(u,d=>n.getRelatedEdgesData(d));[...c,...h].forEach(d=>{var f;const v=At(d),g=n.getElementType(v);((f=this.context.element)===null||f===void 0?void 0:f.getElement(v))?mi(t,"update",g,d):mi(t,"add",g,d),g==="combo"&&s.push([v,d])})}}return t}}const _E=(r,t,e,n)=>{const i=`${e}s`,a=At(n);!r.add[i].has(a)&&!r.update[i].has(a)&&r[t][i].set(At(n),n)};class nB extends is{getElement(t){return this.context.element.getElement(t)}handleExpand(t,e){if(_E(e,"add","node",t),ni(t))return;const n=At(t);_E(e,"add","node",t),this.context.model.getRelatedEdgesData(n).forEach(s=>{mi(e,"add","edge",s)}),this.context.model.getChildrenData(n).forEach(s=>{this.handleExpand(s,e)})}beforeDraw(t){const{graph:e,model:n}=this.context;if(!n.model.hasTreeStructure(ui))return t;const{add:{nodes:i,edges:a},update:{nodes:s}}=t,o=new Map,l=new Map;i.forEach((u,h)=>{ni(u)&&o.set(h,u)}),a.forEach(u=>{if(e.getElementType(u.source)!=="node")return;const h=e.getNodeData(u.source);ni(h)&&o.set(u.source,h)}),s.forEach((u,h)=>{const d=this.getElement(h);if(!d)return;const f=d.attributes.collapsed;ni(u)?f||o.set(h,u):f&&l.set(h,u)});const c=new Set;return o.forEach((u,h)=>{n.getDescendantsData(h).forEach(f=>{const v=At(f);if(c.has(v))return;mi(t,"remove","node",f),n.getRelatedEdgesData(v).forEach(p=>{mi(t,"remove","edge",p)}),c.add(v)})}),l.forEach((u,h)=>{if(n.getAncestorsData(h,ui).some(ni)){mi(t,"remove","node",u);return}this.handleExpand(u,t)}),t}}const W0=new WeakMap;function Kj(r,t,e){W0.has(r)||W0.set(r,{});const n=W0.get(r);if(!n[t])return n[t]=e,!0;const i=n[t];return DE(i,e)?!1:(n[t]=e,!0)}const DE=(r,t,e=2)=>{if(typeof r!="object"||typeof t!="object")return r===t;const n=Object.keys(r),i=Object.keys(t);if(n.length!==i.length)return!1;for(const a of n){const s=r[a],o=t[a];if(e>1&&typeof s=="object"&&typeof o=="object"){if(!DE(s,o,e-1))return!1}else if(s!==o)return!1}return!0};function rB(r,t,e){kf[r][t]&&ei.warn(`The extension ${t} of ${r} has been registered before, and will be overridden.`),Object.assign(kf[r],{[t]:e})}var IE=function(){function r(t){(0,C.Z)(this,r),this.dragndropPluginOptions=t}return(0,T.Z)(r,[{key:"apply",value:function(e){var n=this,i=e.renderingService,a=e.renderingContext,s=a.root.ownerDocument,o=s.defaultView,l=function(u){var h=u.target,d=h===s,f=d&&n.dragndropPluginOptions.isDocumentDraggable?s:h.closest&&h.closest("[draggable=true]");if(f){var v=!1,g=u.timeStamp,p=[u.clientX,u.clientY],y=null,b=[u.clientX,u.clientY],E=function(){var k=(0,Fa.Z)((0,Pr.Z)().mark(function P(F){var B,V,U,J,$,at;return(0,Pr.Z)().wrap(function(ct){for(;;)switch(ct.prev=ct.next){case 0:if(v){ct.next=2;break}if(B=F.timeStamp-g,V=Xr([F.clientX,F.clientY],p),!(B<=n.dragndropPluginOptions.dragstartTimeThreshold||V<=n.dragndropPluginOptions.dragstartDistanceThreshold)){ct.next=1;break}return ct.abrupt("return");case 1:F.type="dragstart",f.dispatchEvent(F),v=!0;case 2:if(F.type="drag",F.dx=F.clientX-b[0],F.dy=F.clientY-b[1],f.dispatchEvent(F),b=[F.clientX,F.clientY],d){ct.next=4;break}return U=n.dragndropPluginOptions.overlap==="pointer"?[F.canvasX,F.canvasY]:h.getBounds().center,ct.next=3,s.elementsFromPoint(U[0],U[1]);case 3:J=ct.sent,$=J[J.indexOf(h)+1],at=($==null?void 0:$.closest("[droppable=true]"))||(n.dragndropPluginOptions.isDocumentDroppable?s:null),y!==at&&(y&&(F.type="dragleave",F.target=y,y.dispatchEvent(F)),at&&(F.type="dragenter",F.target=at,at.dispatchEvent(F)),y=at,y&&(F.type="dragover",F.target=y,y.dispatchEvent(F)));case 4:case"end":return ct.stop()}},P)}));return function(F){return k.apply(this,arguments)}}();o.addEventListener("pointermove",E);var O=function(P){if(v){P.detail={preventClick:!0};var F=P.clone();y&&(F.type="drop",F.target=y,y.dispatchEvent(F)),F.type="dragend",f.dispatchEvent(F),v=!1}o.removeEventListener("pointermove",E)};h.addEventListener("pointerup",O,{once:!0}),h.addEventListener("pointerupoutside",O,{once:!0})}};i.hooks.init.tap(r.tag,function(){o.addEventListener("pointerdown",l)}),i.hooks.destroy.tap(r.tag,function(){o.removeEventListener("pointerdown",l)})}}])}();IE.tag="Dragndrop";var iB=function(r){function t(){var e,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return(0,C.Z)(this,t),e=I(this,t),e.name="dragndrop",e.options=n,e}return(0,L.Z)(t,r),(0,T.Z)(t,[{key:"init",value:function(){this.addRenderingPlugin(new IE((0,z.Z)({overlap:"pointer",isDocumentDraggable:!1,isDocumentDroppable:!1,dragstartDistanceThreshold:0,dragstartTimeThreshold:0},this.options)))}},{key:"destroy",value:function(){this.removeAllRenderingPlugins()}},{key:"setOptions",value:function(n){Object.assign(this.plugins[0].dragndropPluginOptions,n)}}])}(za),BE=function(r,t,e,n){function i(a){return a instanceof e?a:new e(function(s){s(a)})}return new(e||(e=Promise))(function(a,s){function o(u){try{c(n.next(u))}catch(h){s(h)}}function l(u){try{c(n.throw(u))}catch(h){s(h)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((n=n.apply(r,t||[])).next())})},FE=function(r,t){var e={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&t.indexOf(n)<0&&(e[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(e[n[i]]=r[n[i]]);return e};const zE=["main"],jE=["background","main","label","transient"];function aB(r){return r.main}class GE{getConfig(){return this.config}getLayer(t="main"){return this.extends.layers[t]||aB(this.getLayers())}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:i,cursor:a,enableMultiLayer:s}=e,o=FE(e,["renderer","background","cursor","enableMultiLayer"]),l=s?jE:zE,c=WE(n,l),u=Object.fromEntries(l.map(h=>{const d=new bf(Object.assign(Object.assign({},o),{supportsMutipleCanvasesInOneContainer:s,renderer:c[h],background:s?h==="background"?i:void 0:i}));return[h,d]}));ZE(u),this.extends={config:this.config,renderer:n,renderers:c,layers:u}}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 i=n.getCamera(),a=i.getPosition(),s=i.getFocalPoint();n.resize(t,e),i.setPosition(a),i.setFocalPoint(s)})}getBounds(t){return yl(Object.values(this.getLayers()).map(e=>t?e.getRoot().childNodes.find(i=>i.classList.includes(t)):e.getRoot()).filter(e=>(e==null?void 0:e.childNodes.length)>0).map(e=>e.getBounds()))}getContainer(){const t=this.extends.config.container;return typeof t=="string"?document.getElementById(t):t}getSize(){return[this.extends.config.width||0,this.extends.config.height||0]}appendChild(t,e){var n;const i=((n=t.style)===null||n===void 0?void 0:n.$layer)||"main";return this.getLayer(i).appendChild(t,e)}setRenderer(t){if(t===this.extends.renderer)return;const e=WE(t,this.config.enableMultiLayer?jE:zE);this.extends.renderers=e,Object.entries(e).forEach(([n,i])=>this.getLayer(n).setRenderer(i)),ZE(this.getLayers())}getCanvasByViewport(t){return Er(this.getLayer().viewport2Canvas(Vi(t)))}getViewportByCanvas(t){return Er(this.getLayer().canvas2Viewport(Vi(t)))}getViewportByClient(t){return Er(this.getLayer().client2Viewport(Vi(t)))}getClientByViewport(t){return Er(this.getLayer().viewport2Client(Vi(t)))}getClientByCanvas(t){return this.getClientByViewport(this.getViewportByCanvas(t))}getCanvasByClient(t){const e=this.getLayer(),n=e.client2Viewport(Vi(t));return Er(e.viewport2Canvas(n))}toDataURL(){return BE(this,arguments,void 0,function*(t={}){const e=globalThis.devicePixelRatio||1,{mode:n="viewport"}=t,i=FE(t,["mode"]);let[a,s,o,l]=[0,0,0,0];if(n==="viewport")[o,l]=this.getSize();else if(n==="overall"){const y=this.getBounds(),b=Wa(y);[a,s]=y.min,[o,l]=b}const c=j0('<div id="virtual-image"></div>'),u=new bf({width:o,height:l,renderer:new Nl,devicePixelRatio:e,container:c,background:this.extends.config.background});yield u.ready,u.appendChild(this.getLayer("background").getRoot().cloneNode(!0)),u.appendChild(this.getRoot().cloneNode(!0));const h=this.getLayer("label").getRoot().cloneNode(!0),d=u.viewport2Canvas({x:0,y:0}),f=this.getCanvasByViewport([0,0]);h.translate([f[0]-d.x,f[1]-d.y]),h.scale(1/this.getCamera().getZoom()),u.appendChild(h),u.appendChild(this.getLayer("transient").getRoot().cloneNode(!0));const v=this.getCamera(),g=u.getCamera();if(n==="viewport")g.setZoom(v.getZoom()),g.setPosition(v.getPosition()),g.setFocalPoint(v.getFocalPoint());else if(n==="overall"){const[y,b,E]=g.getPosition(),[O,k,P]=g.getFocalPoint();g.setPosition([y+a,b+s,E]),g.setFocalPoint([O+a,k+s,P])}const p=u.getContextService();return new Promise(y=>{u.addEventListener(ci.RERENDER,()=>BE(this,void 0,void 0,function*(){yield new Promise(E=>setTimeout(E,300));const b=yield p.toDataURL(i);y(b)}))})})}destroy(){Object.values(this.getLayers()).forEach(t=>{t.getCamera().cancelLandmarkAnimation(),t.destroy()})}}function WE(r,t){return Object.fromEntries(t.map(e=>{const n=(r==null?void 0:r(e))||new Nl;return n instanceof Nl&&n.setConfig({enableDirtyRectangleRendering:!1}),e==="main"?n.registerPlugin(new iB({isDocumentDraggable:!0,isDocumentDroppable:!0,dragstartDistanceThreshold:10,dragstartTimeThreshold:100})):n.unregisterPlugin(n.getPlugin("dom-interaction")),[e,n]}))}function ZE(r){Object.entries(r).forEach(([t,e])=>{const n=e.getContextService().getDomElement();n!=null&&n.style&&(n.style.gridArea="1 / 1 / 2 / 2",n.style.outline="none",n.tabIndex=1,t!=="main"&&(n.style.pointerEvents="none")),n!=null&&n.parentElement&&(n.parentElement.style.display="grid",n.parentElement.style.isolation="isolate")})}const Do=r=>r?parseInt(r):0;function sB(r){const t=getComputedStyle(r),e=r.clientWidth||Do(t.width),n=r.clientHeight||Do(t.height),i=Do(t.paddingLeft)+Do(t.paddingRight),a=Do(t.paddingTop)+Do(t.paddingBottom);return[e-i,n-a]}function VE(r){if(!r)return[0,0];let t=640,e=480;const[n,i]=sB(r);t=n||t,e=i||e;const a=1,s=1;return[Math.max(ie(t)?t:a,a),Math.max(ie(e)?e:s,s)]}class ad{constructor(t){this.type=t}}class nr extends ad{constructor(t,e){super(t),this.data=e}}class Li extends ad{constructor(t,e,n,i){super(t),this.animationType=e,this.animation=n,this.data=i}}class Io extends ad{constructor(t,e,n){super(t),this.elementType=e,this.data=n}}class sd extends ad{constructor(t,e){super(t),this.data=e}}function lr(r,t){r.emit(t.type,t)}function oB(r){if(!r)return null;if(r instanceof cm)return{type:"canvas",element:r};let t=r;for(;t;){if(Pl(t))return{type:"node",element:t};if(N1(t))return{type:"edge",element:t};if(yv(t))return{type:"combo",element:t};t=t.parentElement}return null}function UE(r){var t;return((t=r==null?void 0:r.style)===null||t===void 0?void 0:t.zIndex)||0}const Bo="cachedStyle",od=r=>`__${r}__`;function lB(r,t){const e=Array.isArray(t)?t:[t];wr(r,Bo)||Al(r,Bo,{}),e.forEach(n=>{Al(wr(r,Bo),od(n),r.attributes[n])})}function YE(r,t){return wr(r,[Bo,od(t)])}function cB(r,t){return od(t)in(wr(r,Bo)||{})}function Qj(r,t,e){set(r,[Bo,od(t)],e)}class uB{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 i,a,s;(i=e==null?void 0:e.before)===null||i===void 0||i.call(e);const o=this.getTasks().map(([c,u])=>{var h,d,f;const{element:v,elementType:g,stage:p}=c,y=AO(this.context.options,g,p,t);(h=u==null?void 0:u.before)===null||h===void 0||h.call(u);const b=y.length?OO(v,this.inferStyle(c,n),y):null;return b?((d=u==null?void 0:u.beforeAnimate)===null||d===void 0||d.call(u,b),b.finished.then(()=>{var E,O;(E=u==null?void 0:u.afterAnimate)===null||E===void 0||E.call(u,b),(O=u==null?void 0:u.after)===null||O===void 0||O.call(u),this.animations.delete(b)})):(f=u==null?void 0:u.after)===null||f===void 0||f.call(u),b}).filter(Boolean);o.forEach(c=>this.animations.add(c));const l=Pf(o);return l?((a=e==null?void 0:e.beforeAnimate)===null||a===void 0||a.call(e,l),l.finished.then(()=>{var c,u;(c=e==null?void 0:e.afterAnimate)===null||c===void 0||c.call(e,l),(u=e==null?void 0:e.after)===null||u===void 0||u.call(e),this.release()})):(s=e==null?void 0:e.after)===null||s===void 0||s.call(e),l}inferStyle(t,e){var n,i;const{element:a,elementType:s,stage:o,originalStyle:l,updatedStyle:c={}}=t;t.modifiedStyle||(t.modifiedStyle=Object.assign(Object.assign({},l),c));const{modifiedStyle:u}=t,h={},d={};if(o==="enter")Object.assign(h,{opacity:0});else if(o==="exit")Object.assign(d,{opacity:0});else if(o==="show")Object.assign(h,{opacity:0}),Object.assign(d,{opacity:(n=YE(a,"opacity"))!==null&&n!==void 0?n:ml("opacity")});else if(o==="hide")Object.assign(h,{opacity:(i=YE(a,"opacity"))!==null&&i!==void 0?i:ml("opacity")}),Object.assign(d,{opacity:0});else if(o==="collapse"){const{collapse:f}=e||{},{target:v,descendants:g,position:p}=f;if(s==="node"){if(g.includes(a.id)){const[y,b,E]=p;Object.assign(d,{x:y,y:b,z:E})}}else if(s==="combo"){if(a.id===v||g.includes(a.id)){const[y,b]=p;Object.assign(d,{x:y,y:b,childrenNode:l.childrenNode})}}else s==="edge"&&Object.assign(d,{sourceNode:u.sourceNode,targetNode:u.targetNode})}else if(o==="expand"){const{expand:f}=e||{},{target:v,descendants:g,position:p}=f;if(s==="node"){if(a.id===v||g.includes(a.id)){const[y,b,E]=p;Object.assign(h,{x:y,y:b,z:E})}}else if(s==="combo"){if(a.id===v||g.includes(a.id)){const[y,b,E]=p;Object.assign(h,{x:y,y:b,z:E,childrenNode:u.childrenNode})}}else s==="edge"&&Object.assign(h,{sourceNode:u.sourceNode,targetNode:u.targetNode})}return[Object.keys(h).length>0?Object.assign({},l,h):l,Object.keys(d).length>0?Object.assign({},u,d):u]}stop(){this.animations.forEach(t=>t.cancel())}clear(){this.tasks=[]}release(){var t,e;const{canvas:n}=this.context,i=(e=(t=n.document)===null||t===void 0?void 0:t.timeline)===null||e===void 0?void 0:e.animationsWithPromises;i&&(n.document.timeline.animationsWithPromises=i.filter(a=>a.playState!=="finished"))}destroy(){this.stop(),this.animations.clear(),this.tasks=[]}}class hB{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++,this.batchCount===1&&this.emit(new nr(Xt.BATCH_START,{initiate:t}))}endBatch(){this.batchCount--,this.batchCount===0&&this.emit(new nr(Xt.BATCH_END))}get isBatching(){return this.batchCount>0}destroy(){this.context=null}}class dB extends Yf{constructor(t){super(t),this.currentTarget=null,this.currentTargetType=null,this.category="behavior",this.forwardCanvasEvents=e=>{const{target:n}=e,i=oB(n);if(!i)return;const{graph:a,canvas:s}=this.context,{type:o,element:l}=i;if("destroyed"in l&&(Ll(l)||l.destroyed))return;const{type:c,detail:u,button:h}=e,d=Object.assign(Object.assign({},e),{target:l,targetType:o,originalTarget:n});c===It.POINTER_MOVE&&(this.currentTarget!==l&&(this.currentTarget&&a.emit(`${this.currentTargetType}:${It.POINTER_LEAVE}`,Object.assign(Object.assign({},d),{type:It.POINTER_LEAVE,target:this.currentTarget,targetType:this.currentTargetType})),l&&(Object.assign(d,{type:It.POINTER_ENTER}),a.emit(`${o}:${It.POINTER_ENTER}`,d))),this.currentTarget=l,this.currentTargetType=o),c===It.CLICK&&h===2||(a.emit(`${o}:${c}`,d),a.emit(c,d)),c===It.CLICK&&u===2&&(Object.assign(d,{type:It.DBLCLICK}),a.emit(`${o}:${It.DBLCLICK}`,d),a.emit(It.DBLCLICK,d)),c===It.POINTER_DOWN&&h===2&&(Object.assign(d,{type:It.CONTEXT_MENU,preventDefault:()=>{var f;(f=s.getContainer())===null||f===void 0||f.addEventListener(It.CONTEXT_MENU,v=>v.preventDefault(),{once:!0})}}),a.emit(`${o}:${It.CONTEXT_MENU}`,d),a.emit(It.CONTEXT_MENU,d))},this.forwardContainerEvents=e=>{this.context.graph.emit(e.type,e)},this.forwardEvents(),this.setBehaviors(this.context.options.behaviors||[])}setBehaviors(t){this.setExtensions(t)}forwardEvents(){const t=this.context.canvas.getContainer();t&&[po.KEY_DOWN,po.KEY_UP].forEach(n=>{t.addEventListener(n,this.forwardContainerEvents)});const e=this.context.canvas.document;e&&[It.CLICK,It.DBLCLICK,It.POINTER_OVER,It.POINTER_LEAVE,It.POINTER_ENTER,It.POINTER_MOVE,It.POINTER_OUT,It.POINTER_DOWN,It.POINTER_UP,It.CONTEXT_MENU,It.DRAG_START,It.DRAG,It.DRAG_END,It.DRAG_ENTER,It.DRAG_OVER,It.DRAG_LEAVE,It.DROP,It.WHEEL].forEach(n=>{e.addEventListener(n,this.forwardCanvasEvents)})}destroy(){const t=this.context.canvas.getContainer();t&&[po.KEY_DOWN,po.KEY_UP].forEach(e=>{t.removeEventListener(e,this.forwardContainerEvents)}),this.context.canvas.document.removeAllEventListeners(),super.destroy()}}function fB(r,t){t===void 0&&(t=new Map);var e=[];if(Array.isArray(r))for(var n=0,i=r.length;n<i;n++){var a=r[n];t.has(a)||(e.push(a),t.set(a,!0))}return e}var Ql=function(r,t){var e={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&t.indexOf(n)<0&&(e[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(e[n[i]]=r[n[i]]);return e};function as(r,t){const{data:e,style:n}=r,i=Ql(r,["data","style"]),{data:a,style:s}=t,o=Ql(t,["data","style"]),l=Object.assign(Object.assign({},i),o);return(e||a)&&Object.assign(l,{data:Object.assign(Object.assign({},e),a)}),(n||s)&&Object.assign(l,{style:Object.assign(Object.assign({},n),s)}),l}function Z0(r){const{data:t,style:e}=r,i=Ql(r,["data","style"]);return t&&(i.data=Object.assign({},t)),e&&(i.style=Object.assign({},e)),i}function qj(r){return!get(r,["nodes","length"])&&!get(r,["edges","length"])&&!get(r,["combos","length"])}function Fo(r={},t={}){const{states:e=[],data:n={},style:i={},children:a=[]}=r,s=Ql(r,["states","data","style","children"]),{states:o=[],data:l={},style:c={},children:u=[]}=t,h=Ql(t,["states","data","style","children"]),d=(v,g)=>v.length!==g.length?!1:v.every((p,y)=>p===g[y]),f=(v,g)=>{const p=Object.keys(v),y=Object.keys(g);return p.length!==y.length?!1:p.every(b=>v[b]===g[b])};return!(!f(s,h)||!d(a,u)||!d(e,o)||!f(n,l)||!f(i,c))}var vB=function(r,t){var e={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&t.indexOf(n)<0&&(e[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(e[n[i]]=r[n[i]]);return e};function V0(r){const{id:t=At(r),style:e,data:n}=r,i=vB(r,["id","style","data"]),a=Object.assign(Object.assign({},r),{style:Object.assign({},e),data:Object.assign({},n)});return DO(r)?Object.assign({id:t,data:a},i):{id:t,data:a}}function gr(r){return r.data}function gB(r){if(r.hasTreeStructure(ui))return;r.attachTreeStructure(ui);const t=r.getAllEdges();for(const e of t){const{source:n,target:i}=e;r.setParent(i,n,ui)}}class pB{constructor(){this.latestRemovedComboIds=new Set,this.comboIds=new Set,this.changes=[],this.batchCount=0,this.isTraceless=!1,this.enableUpdateNodeLikeHierarchy=!0,this.model=new Un}pushChange(t){if(this.isTraceless)return;const{type:e}=t;if(e===An.NodeUpdated||e===An.EdgeUpdated||e===An.ComboUpdated){const{value:n,original:i}=t;this.changes.push({value:Z0(n),original:Z0(i),type:e})}else this.changes.push({value:Z0(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 i=gr(n);return this.isCombo(At(i))||(t===void 0||t.includes(At(i)))&&e.push(i),e},[])}getEdgeDatum(t){return gr(this.model.getEdge(t))}getEdgeData(t){return this.model.getAllEdges().reduce((e,n)=>{const i=gr(n);return(t===void 0||t.includes(At(i)))&&e.push(i),e},[])}getComboData(t){return this.model.getAllNodes().reduce((e,n)=>{const i=gr(n);return this.isCombo(At(i))&&(t===void 0||t.includes(At(i)))&&e.push(i),e},[])}getRootsData(t=ui){return this.model.getRoots(t).map(gr)}getAncestorsData(t,e){const{model:n}=this;return!n.hasNode(t)||!n.hasTreeStructure(e)?[]:n.getAncestors(t,e).map(gr)}getDescendantsData(t){const e=this.getElementDataById(t),n=[];return Is(e,i=>{i!==e&&n.push(i)},i=>this.getChildrenData(At(i)),"TB"),n}getParentData(t,e){const{model:n}=this;if(!e){ei.warn("The hierarchy structure key is not specified");return}if(!n.hasNode(t)||!n.hasTreeStructure(e))return;const i=n.getParent(t,e);return i?gr(i):void 0}getChildrenData(t){const e=this.getElementType(t)==="node"?ui:fn,{model:n}=this;return!n.hasNode(t)||!n.hasTreeStructure(e)?[]:n.getChildren(t,e).map(gr)}getElementsDataByType(t){return t==="node"?this.getNodeData():t==="edge"?this.getEdgeData():t==="combo"?this.getComboData():[]}getElementDataById(t){return this.getElementType(t)==="edge"?this.getEdgeDatum(t):this.getNodeLikeDatum(t)}getNodeLikeDatum(t){const e=this.model.getNode(t);return gr(e)}getNodeLikeData(t){return this.model.getAllNodes().reduce((e,n)=>{const i=gr(n);return t?t.includes(At(i))&&e.push(i):e.push(i),e},[])}getElementDataByState(t,e){return this.getElementsDataByType(t).filter(i=>{var a;return(a=i.states)===null||a===void 0?void 0:a.includes(e)})}getElementState(t){var e;return((e=this.getElementDataById(t))===null||e===void 0?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(gr)}getNeighborNodesData(t){return this.model.getNeighbors(t).map(gr)}setData(t){const{nodes:e=[],edges:n=[],combos:i=[]}=t,{nodes:a,edges:s,combos:o}=this.getData(),l=Ua(a,e,h=>At(h),Fo),c=Ua(s,n,h=>At(h),Fo),u=Ua(o,i,h=>At(h),Fo);this.batch(()=>{const h={nodes:l.enter,edges:c.enter,combos:u.enter};this.addData(h),this.computeZIndex(h,"add",!0);const d={nodes:l.update,edges:c.update,combos:u.update};this.updateData(d),this.computeZIndex(d,"update",!0);const f={nodes:l.exit.map(At),edges:c.exit.map(At),combos:u.exit.map(At)};this.removeData(f)})}addData(t){const{nodes:e,edges:n,combos:i}=t;this.batch(()=>{this.addComboData(i),this.addNodeData(e),this.addEdgeData(n)}),this.computeZIndex(t,"add")}addNodeData(t=[]){t.length&&(this.model.addNodes(t.map(e=>(this.pushChange({value:e,type:An.NodeAdded}),V0(e)))),this.updateNodeLikeHierarchy(t),this.computeZIndex({nodes:t},"add"))}addEdgeData(t=[]){t.length&&(this.model.addEdges(t.map(e=>(this.pushChange({value:e,type:An.EdgeAdded}),V0(e)))),this.computeZIndex({edges:t},"add"))}addComboData(t=[]){if(!t.length)return;const{model:e}=this;e.hasTreeStructure(fn)||e.attachTreeStructure(fn),e.addNodes(t.map(n=>(this.comboIds.add(At(n)),this.pushChange({value:n,type:An.ComboAdded}),V0(n)))),this.updateNodeLikeHierarchy(t),this.computeZIndex({combos:t},"add")}addChildrenData(t,e){const n=this.getNodeLikeDatum(t),i=e.map(At);this.addNodeData(e),this.updateNodeData([{id:t,children:[...n.children||[],...i]}]),this.addEdgeData(i.map(a=>({source:t,target:a})))}computeZIndex(t,e,n=!1){!n&&this.isBatching()||this.batch(()=>{const{nodes:i=[],edges:a=[],combos:s=[]}=t;s.forEach(o=>{var l,c,u;const h=At(o);if(e==="add"&&ie((l=o.style)===null||l===void 0?void 0:l.zIndex)||e==="update"&&!("combo"in o))return;const d=this.getParentData(h,fn),f=d?((u=(c=d.style)===null||c===void 0?void 0:c.zIndex)!==null&&u!==void 0?u:0)+1:0;this.preventUpdateNodeLikeHierarchy(()=>{this.updateComboData([{id:h,style:{zIndex:f}}])})}),i.forEach(o=>{var l,c,u;const h=At(o);if(e==="add"&&ie((l=o.style)===null||l===void 0?void 0:l.zIndex)||e==="update"&&!("combo"in o)&&!("children"in o))return;let d=0;const f=this.getParentData(h,fn);if(f)d=(((c=f.style)===null||c===void 0?void 0:c.zIndex)||0)+1;else{const v=this.getParentData(h,ui);v&&(d=((u=v==null?void 0:v.style)===null||u===void 0?void 0:u.zIndex)||0)}this.preventUpdateNodeLikeHierarchy(()=>{this.updateNodeData([{id:h,style:{zIndex:d}}])})}),a.forEach(o=>{var l,c,u,h,d;if(ie((l=o.style)===null||l===void 0?void 0:l.zIndex))return;let{id:f,source:v,target:g}=o;if(!f)f=At(o);else{const b=this.getEdgeDatum(f);v=b.source,g=b.target}if(!v||!g)return;const p=((u=(c=this.getNodeLikeDatum(v))===null||c===void 0?void 0:c.style)===null||u===void 0?void 0:u.zIndex)||0,y=((d=(h=this.getNodeLikeDatum(g))===null||h===void 0?void 0:h.style)===null||d===void 0?void 0:d.zIndex)||0;this.updateEdgeData([{id:At(o),style:{zIndex:Math.max(p,y)-1}}])})})}getFrontZIndex(t){var e;const n=this.getElementType(t),i=this.getElementDataById(t),a=this.getData();if(Object.assign(a,{[`${n}s`]:a[`${n}s`].filter(s=>At(s)!==t)}),n==="combo"&&!ni(i)){const s=new Set(this.getAncestorsData(t,fn).map(At));a.nodes=a.nodes.filter(o=>!s.has(At(o))),a.combos=a.combos.filter(o=>!s.has(At(o))),a.edges=a.edges.filter(({source:o,target:l})=>!s.has(o)&&!s.has(l))}return Math.max(((e=i.style)===null||e===void 0?void 0:e.zIndex)||0,0,...Object.values(a).flat().map(s=>{var o;return(((o=s==null?void 0:s.style)===null||o===void 0?void 0:o.zIndex)||0)+1}))}updateNodeLikeHierarchy(t){if(!this.enableUpdateNodeLikeHierarchy)return;const{model:e}=this;t.forEach(n=>{const i=At(n),a=pu(n);a!==void 0&&(e.hasTreeStructure(fn)||e.attachTreeStructure(fn),a===null&&this.refreshComboData(i),this.setParent(i,pu(n),fn));const s=n.children||[];if(s.length){e.hasTreeStructure(ui)||e.attachTreeStructure(ui);const o=s.filter(l=>e.hasNode(l));o.forEach(l=>this.setParent(l,i,ui)),o.length!==s.length&&this.updateNodeData([{id:i,children:o}])}})}preventUpdateNodeLikeHierarchy(t){this.enableUpdateNodeLikeHierarchy=!1,t(),this.enableUpdateNodeLikeHierarchy=!0}updateData(t){const{nodes:e,edges:n,combos:i}=t;this.batch(()=>{this.updateNodeData(e),this.updateComboData(i),this.updateEdgeData(n)}),this.computeZIndex(t,"update")}updateNodeData(t=[]){if(!t.length)return;const{model:e}=this;this.batch(()=>{const n=[];t.forEach(i=>{const a=At(i),s=gr(e.getNode(a));if(Fo(s,i))return;const o=as(s,i);this.pushChange({value:o,original:s,type:An.NodeUpdated}),e.mergeNodeData(a,o),n.push(o)}),this.updateNodeLikeHierarchy(n)}),this.computeZIndex({nodes:t},"update")}refreshData(){const{nodes:t,edges:e,combos:n}=this.getData();t.forEach(i=>{this.pushChange({value:i,original:i,type:An.NodeUpdated})}),e.forEach(i=>{this.pushChange({value:i,original:i,type:An.EdgeUpdated})}),n.forEach(i=>{this.pushChange({value:i,original:i,type:An.ComboUpdated})})}syncNodeLikeDatum(t){const{model:e}=this,n=At(t);if(!e.hasNode(n))return;const i=gr(e.getNode(n)),a=as(i,t);e.mergeNodeData(n,a)}syncEdgeDatum(t){const{model:e}=this,n=At(t);if(!e.hasEdge(n))return;const i=gr(e.getEdge(n)),a=as(i,t);e.mergeEdgeData(n,a)}updateEdgeData(t=[]){if(!t.length)return;const{model:e}=this;this.batch(()=>{t.forEach(n=>{const i=At(n),a=gr(e.getEdge(i));if(Fo(a,n))return;n.source&&a.source!==n.source&&e.updateEdgeSource(i,n.source),n.target&&a.target!==n.target&&e.updateEdgeTarget(i,n.target);const s=as(a,n);this.pushChange({value:s,original:a,type:An.EdgeUpdated}),e.mergeEdgeData(i,s)})}),this.computeZIndex({edges:t},"update")}updateComboData(t=[]){if(!t.length)return;const{model:e}=this;e.batch(()=>{const n=[];t.forEach(i=>{const a=At(i),s=gr(e.getNode(a));if(Fo(s,i))return;const o=as(s,i);this.pushChange({value:o,original:s,type:An.ComboUpdated}),e.mergeNodeData(a,o),n.push(o)}),this.updateNodeLikeHierarchy(n)}),this.computeZIndex({combos:t},"update")}setParent(t,e,n,i=!0){if(t===e)return;const a=this.getNodeLikeDatum(t),s=pu(a);if(s!==e&&n===fn){const o={id:t,combo:e};this.isCombo(t)?this.syncNodeLikeDatum(o):this.syncNodeLikeDatum(o)}this.model.setParent(t,e,n),i&&n===fn&&fB([s,e]).forEach(o=>{o!==void 0&&this.refreshComboData(o)})}refreshComboData(t){const e=this.getComboData([t])[0],n=this.getAncestorsData(t,fn);e&&this.pushChange({value:e,original:e,type:An.ComboUpdated}),n.forEach(i=>{this.pushChange({value:i,original:i,type:An.ComboUpdated})})}getElementPosition(t){const e=this.getElementDataById(t);return sr(e)}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=this.getElementPosition(t),i=Le(n,[...e,0].slice(0,3));this.translateNodeTo(t,i)}translateNodeTo(t,e){const[n=0,i=0,a=0]=e;this.preventUpdateNodeLikeHierarchy(()=>{this.updateNodeData([{id:t,style:{x:n,y:i,z:a}}])})}translateComboBy(t,e){const[n=0,i=0,a=0]=e;if([n,i,a].some(isNaN)||[n,i,a].every(l=>l===0))return;const s=this.getComboData([t])[0];if(!s)return;const o=new Set;Is(s,l=>{const c=At(l);if(o.has(c))return;o.add(c);const[u,h,d]=sr(l),f=as(l,{style:{x:u+n,y:h+i,z:d+a}});this.pushChange({value:f,original:l,type:this.isCombo(c)?An.ComboUpdated:An.NodeUpdated}),this.model.mergeNodeData(c,f)},l=>this.getChildrenData(At(l)),"BT")}translateComboTo(t,e){var n;if(e.some(isNaN))return;const[i=0,a=0,s=0]=e,o=(n=this.getComboData([t]))===null||n===void 0?void 0:n[0];if(!o)return;const[l,c,u]=sr(o),h=i-l,d=a-c,f=s-u;Is(o,v=>{const g=At(v),[p,y,b]=sr(v),E=as(v,{style:{x:p+h,y:y+d,z:b+f}});this.pushChange({value:E,original:v,type:this.isCombo(g)?An.ComboUpdated:An.NodeUpdated}),this.model.mergeNodeData(g,E)},v=>this.getChildrenData(At(v)),"BT")}removeData(t){const{nodes:e,edges:n,combos:i}=t;this.batch(()=>{this.removeEdgeData(n),this.removeNodeData(e),this.removeComboData(i),this.latestRemovedComboIds=new Set(i)})}removeNodeData(t=[]){t.length&&this.batch(()=>{t.forEach(e=>{this.removeEdgeData(this.getRelatedEdgesData(e).map(At)),this.pushChange({value:this.getNodeData([e])[0],type:An.NodeRemoved}),this.removeNodeLikeHierarchy(e)}),this.model.removeNodes(t)})}removeEdgeData(t=[]){t.length&&(t.forEach(e=>this.pushChange({value:this.getEdgeData([e])[0],type:An.EdgeRemoved})),this.model.removeEdges(t))}removeComboData(t=[]){t.length&&this.batch(()=>{t.forEach(e=>{this.pushChange({value:this.getComboData([e])[0],type:An.ComboRemoved}),this.removeNodeLikeHierarchy(e),this.comboIds.delete(e)}),this.model.removeNodes(t)})}removeNodeLikeHierarchy(t){if(this.model.hasTreeStructure(fn)){const e=pu(this.getNodeLikeDatum(t));this.setParent(t,void 0,fn,!1),this.model.getChildren(t,fn).forEach(n=>{const i=gr(n),a=At(i);this.setParent(At(i),e,fn,!1);const s=as(i,{id:At(i),combo:e});this.pushChange({value:s,original:i,type:this.isCombo(a)?An.ComboUpdated:An.NodeUpdated}),this.model.mergeNodeData(At(i),s)}),be(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(xa(`Unknown element type of id: ${t}`))}destroy(){const{model:t}=this,e=t.getAllNodes(),n=t.getAllEdges();t.removeEdges(n.map(i=>i.id)),t.removeNodes(e.map(i=>i.id)),this.context={}}}var ql=function(r,t,e,n){function i(a){return a instanceof e?a:new e(function(s){s(a)})}return new(e||(e=Promise))(function(a,s){function o(u){try{c(n.next(u))}catch(h){s(h)}}function l(u){try{c(n.throw(u))}catch(h){s(h)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((n=n.apply(r,t||[])).next())})};class mB{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 ar({className:"elements"}))}}emit(t,e){e.silence||lr(this.context.graph,t)}forEachElementData(t){Ds.forEach(e=>{const n=this.context.model.getElementsDataByType(e);t(e,n)})}getElementType(t,e){var n;const{options:i,graph:a}=this.context,s=((n=i[t])===null||n===void 0?void 0:n.type)||e.type;return s?typeof s=="string"?s:s.call(a,e):t==="edge"?"line":"circle"}getTheme(t){return Lm(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(i=>n[i]||{}))}computePaletteStyle(){const{options:t}=this.context;this.paletteStyle={},this.forEachElementData((e,n)=>{var i,a;const s=Object.assign({},Yy((i=this.getTheme(e))===null||i===void 0?void 0:i.palette),Yy((a=t[e])===null||a===void 0?void 0:a.palette));s!=null&&s.field&&Object.assign(this.paletteStyle,HN(n,s))})}getPaletteStyle(t,e){const n=this.paletteStyle[e];return n?t==="edge"?{stroke:n}:{fill:n}:{}}computeElementDefaultStyle(t,e){var n;const{options:i}=this.context,a=((n=i[t])===null||n===void 0?void 0:n.style)||{};"transform"in a&&Array.isArray(a.transform)&&(a.transform=[...a.transform]),this.defaultStyle[At(e.datum)]=Uy(a,e)}computeElementsDefaultStyle(t){const{graph:e}=this.context;this.forEachElementData((n,i)=>{const a=i.length;for(let s=0;s<a;s++){const o=i[s];(t===void 0||t.includes(At(o)))&&this.computeElementDefaultStyle(n,{datum:o,graph:e})}})}getDefaultStyle(t){return this.defaultStyle[t]||{}}getElementState(t){try{const{model:e}=this.context;return e.getElementState(t)}catch(e){return[]}}getElementStateStyle(t,e,n){var i,a;const{options:s}=this.context,o=((a=(i=s[t])===null||i===void 0?void 0:i.state)===null||a===void 0?void 0:a[e])||{};return Uy(o,n)}computeElementStatesStyle(t,e,n){this.stateStyle[At(n.datum)]=Object.assign({},...e.map(i=>this.getElementStateStyle(t,i,n)))}computeElementsStatesStyle(t){const{graph:e}=this.context;this.forEachElementData((n,i)=>{const a=i.length;for(let s=0;s<a;s++){const o=i[s];if(t===void 0||t.includes(At(o))){const l=this.getElementState(At(o));this.computeElementStatesStyle(n,l,{datum:o,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[At(t)])}getCombos(){return this.context.model.getComboData().map(({id:t})=>this.elementMap[t])}getElementComputedStyle(t,e){const n=At(e),i=this.getThemeStyle(t),a=this.getPaletteStyle(t,n),s=e.style||{},o=this.getDefaultStyle(n),l=this.getThemeStateStyle(t,this.getElementState(n)),c=this.getStateStyle(n),u=Object.assign({},i,a,s,o,l,c);if(t==="combo"){const h=this.context.model.getChildrenData(n),f=!!u.collapsed?[]:h.map(At).filter(v=>this.getElement(v));Object.assign(u,{childrenNode:f,childrenData:h})}return u}getDrawData(t){this.init();const e=this.computeChangesAndDrawData(t);if(!e)return null;const{type:n="draw",stage:i=n}=t;return this.markDestroyElement(e.drawData),this.computeStyle(i),{type:n,stage:i,data:e}}draw(t={animation:!0}){const e=this.getDrawData(t);if(!e)return;const{data:{drawData:{add:n,update:i,remove:a}}}=e;return this.destroyElements(a,t),this.createElements(n,t),this.updateElements(i,t),this.setAnimationTask(t,e)}preLayoutDraw(){return ql(this,arguments,void 0,function*(t={animation:!0}){var e,n;const i=this.getDrawData(t);if(!i)return;const{data:{drawData:a}}=i;yield(n=(e=this.context.layout)===null||e===void 0?void 0:e.preLayout)===null||n===void 0?void 0:n.call(e,a);const{add:s,update:o,remove:l}=a;return this.destroyElements(l,t),this.createElements(s,t),this.updateElements(o,t),this.setAnimationTask(t,i)})}setAnimationTask(t,e){const{animation:n,silence:i}=t,{data:{dataChanges:a,drawData:s},stage:o,type:l}=e;return this.context.animation.animate(n,i?{}:{before:()=>this.emit(new nr(Xt.BEFORE_DRAW,{dataChanges:a,animation:n,stage:o,render:l==="render"}),t),beforeAnimate:c=>this.emit(new Li(Xt.BEFORE_ANIMATE,ti.DRAW,c,s),t),afterAnimate:c=>this.emit(new Li(Xt.AFTER_ANIMATE,ti.DRAW,c,s),t),after:()=>this.emit(new nr(Xt.AFTER_DRAW,{dataChanges:a,animation:n,stage:o,render:l==="render",firstRender:this.context.graph.rendered===!1}),t)})}computeChangesAndDrawData(t){const{model:e}=this.context,n=e.getChanges(),i=Jv(n);if(i.length===0)return null;const{NodeAdded:a=[],NodeUpdated:s=[],NodeRemoved:o=[],EdgeAdded:l=[],EdgeUpdated:c=[],EdgeRemoved:u=[],ComboAdded:h=[],ComboUpdated:d=[],ComboRemoved:f=[]}=nu(i,y=>y.type),v=y=>new Map(y.map(b=>{const E=b.value;return[At(E),E]})),g={add:{nodes:v(a),edges:v(l),combos:v(h)},update:{nodes:v(s),edges:v(c),combos:v(d)},remove:{nodes:v(o),edges:v(u),combos:v(f)}},p=this.transformData(g,t);return e.clearChanges(),{dataChanges:n,drawData:p}}transformData(t,e){const n=this.context.transform.getTransformInstance();return Object.values(n).reduce((i,a)=>a.beforeDraw(i,e),t)}createElement(t,e,n){var i;const a=At(e);if(this.getElement(a))return;const o=this.getElementType(t,e),l=this.getElementComputedStyle(t,e),c=ba(t,o);if(!c)return ei.warn(`The element ${o} of ${t} is not registered.`);this.emit(new Io(Xt.BEFORE_ELEMENT_CREATE,t,e),n);const u=this.container.appendChild(new c({id:a,context:this.context,style:l}));this.shapeTypeMap[a]=o,this.elementMap[a]=u;const{stage:h="enter"}=n;(i=this.context.animation)===null||i===void 0||i.add({element:u,elementType:t,stage:h,originalStyle:Object.assign({},u.attributes),updatedStyle:l},{after:()=>{var d;this.emit(new Io(Xt.AFTER_ELEMENT_CREATE,t,e),n),(d=u.onCreate)===null||d===void 0||d.call(u)}})}createElements(t,e){const{nodes:n,edges:i,combos:a}=t;[["node",n],["combo",a],["edge",i]].forEach(([o,l])=>{l.forEach(c=>this.createElement(o,c,e))})}getUpdateStageStyle(t,e,n){const{stage:i="update"}=n;if(i==="translate")if(t==="node"||t==="combo"){const{style:{x:a=0,y:s=0,z:o=0}={}}=e;return{x:a,y:s,z:o}}else return{};return this.getElementComputedStyle(t,e)}updateElement(t,e,n){var i;const a=At(e),{stage:s="update"}=n,o=this.getElement(a);if(!o)return()=>null;this.emit(new Io(Xt.BEFORE_ELEMENT_UPDATE,t,e),n);const l=this.getElementType(t,e),c=this.getUpdateStageStyle(t,e,n);this.shapeTypeMap[a]!==l&&(o.destroy(),delete this.shapeTypeMap[a],delete this.elementMap[a],this.createElement(t,e,{animation:!1,silence:!0}));const u=s!=="visibility"?s:c.visibility==="hidden"?"hide":"show";u==="hide"&&delete c.visibility,(i=this.context.animation)===null||i===void 0||i.add({element:o,elementType:t,stage:u,originalStyle:Object.assign({},o.attributes),updatedStyle:c},{before:()=>{const h=this.elementMap[a];s!=="collapse"&&wv(h,c),s==="visibility"&&(cB(h,"opacity")||lB(h,"opacity"),this.visibilityCache.set(h,u==="show"?"visible":"hidden"),u==="show"&&Ls(h,"visible"))},after:()=>{var h;const d=this.elementMap[a];s==="collapse"&&wv(d,c),u==="hide"&&Ls(d,this.visibilityCache.get(d)),this.emit(new Io(Xt.AFTER_ELEMENT_UPDATE,t,e),n),(h=d.onUpdate)===null||h===void 0||h.call(d)}})}updateElements(t,e){const{nodes:n,edges:i,combos:a}=t;[["node",n],["combo",a],["edge",i]].forEach(([o,l])=>{l.forEach(c=>this.updateElement(o,c,e))})}markDestroyElement(t){Object.values(t.remove).forEach(e=>{e.forEach(n=>{const i=At(n),a=this.getElement(i);a&&aP(a)})})}destroyElement(t,e,n){var i;const{stage:a="exit"}=n,s=At(e),o=this.elementMap[s];if(!o)return()=>null;this.emit(new Io(Xt.BEFORE_ELEMENT_DESTROY,t,e),n),(i=this.context.animation)===null||i===void 0||i.add({element:o,elementType:t,stage:a,originalStyle:Object.assign({},o.attributes),updatedStyle:{}},{after:()=>{var l;this.clearElement(s),o.destroy(),(l=o.onDestroy)===null||l===void 0||l.call(o),this.emit(new Io(Xt.AFTER_ELEMENT_DESTROY,t,e),n)}})}destroyElements(t,e){const{nodes:n,edges:i,combos:a}=t;[["combo",a],["edge",i],["node",n]].forEach(([o,l])=>{l.forEach(c=>this.destroyElement(o,c,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,i;const a=(n=t.nodes)===null||n===void 0?void 0:n.find(s=>At(s)===e);if(a){const s=sr(this.context.model.getNodeLikeDatum(e)),o=sr(a),l=dn(s,o);(i=t.nodes)===null||i===void 0||i.forEach(c=>{var u,h,d;!((u=c.style)===null||u===void 0)&&u.x&&(c.style.x+=l[0]),!((h=c.style)===null||h===void 0)&&h.y&&(c.style.y+=l[1]),!((d=c.style)===null||d===void 0)&&d.z&&(c.style.z+=l[2]||0)})}}collapseNode(t,e){return ql(this,void 0,void 0,function*(){var n;const{animation:i}=e,{model:a}=this.context,s=this.computeChangesAndDrawData({stage:"collapse",animation:i});if(!s)return;const{drawData:o}=s,{add:l,remove:c,update:u}=o;this.markDestroyElement(o);const h={animation:i,stage:"collapse",data:o};this.destroyElements(c,h),this.createElements(l,h),this.updateElements(u,h),yield(n=this.context.animation.animate(i,{beforeAnimate:d=>this.emit(new Li(Xt.BEFORE_ANIMATE,ti.COLLAPSE,d,o),h),afterAnimate:d=>this.emit(new Li(Xt.AFTER_ANIMATE,ti.COLLAPSE,d,o),h)},{collapse:{target:t,descendants:Array.from(c.nodes).map(([,d])=>At(d)),position:sr(u.nodes.get(t))}}))===null||n===void 0?void 0:n.finished})}expandNode(t,e){return ql(this,void 0,void 0,function*(){var n;const{model:i,layout:a}=this.context,{animation:s,align:o}=e,l=sr(i.getNodeData([t])[0]),c=this.computeChangesAndDrawData({stage:"expand",animation:s});if(this.createElements(c.drawData.add,{animation:!1,stage:"expand",target:t}),this.context.animation.clear(),this.computeStyle("expand"),!c)return;const{drawData:u}=c,{update:h,add:d}=u,f={animation:s,stage:"expand",data:u};d.edges.forEach(v=>h.edges.set(At(v),v)),d.nodes.forEach(v=>h.nodes.set(At(v),v)),this.updateElements(h,f),yield(n=this.context.animation.animate(s,{beforeAnimate:v=>this.emit(new Li(Xt.BEFORE_ANIMATE,ti.EXPAND,v,u),f),afterAnimate:v=>this.emit(new Li(Xt.AFTER_ANIMATE,ti.EXPAND,v,u),f)},{expand:{target:t,descendants:Array.from(d.nodes).map(([,v])=>At(v)),position:l}}))===null||n===void 0?void 0:n.finished})}collapseCombo(t,e){return ql(this,void 0,void 0,function*(){var n;const{model:i,element:a}=this.context;if(i.getAncestorsData(t,fn).some(g=>ni(g)))return;const s=a.getElement(t),o=s.getComboPosition(Object.assign(Object.assign({},s.attributes),{collapsed:!0})),l=this.computeChangesAndDrawData({stage:"collapse",animation:e});if(!l)return;const{dataChanges:c,drawData:u}=l;this.markDestroyElement(u);const{update:h,remove:d}=u,f={animation:e,stage:"collapse",data:u};this.destroyElements(d,f),this.updateElements(h,f);const v=g=>Array.from(g).map(([,p])=>At(p));yield(n=this.context.animation.animate(e,{before:()=>this.emit(new nr(Xt.BEFORE_DRAW,{dataChanges:c,animation:e}),f),beforeAnimate:g=>this.emit(new Li(Xt.BEFORE_ANIMATE,ti.COLLAPSE,g,u),f),afterAnimate:g=>this.emit(new Li(Xt.AFTER_ANIMATE,ti.COLLAPSE,g,u),f),after:()=>this.emit(new nr(Xt.AFTER_DRAW,{dataChanges:c,animation:e}),f)},{collapse:{target:t,descendants:[...v(d.nodes),...v(d.combos)],position:o}}))===null||n===void 0?void 0:n.finished})}expandCombo(t,e){return ql(this,void 0,void 0,function*(){var n;const{model:i}=this.context,a=sr(i.getComboData([t])[0]);this.computeStyle("expand");const s=this.computeChangesAndDrawData({stage:"expand",animation:e});if(!s)return;const{dataChanges:o,drawData:l}=s,{add:c,update:u}=l,h={animation:e,stage:"expand",data:l,target:t};this.createElements(c,h),this.updateElements(u,h);const d=f=>Array.from(f).map(([,v])=>At(v));yield(n=this.context.animation.animate(e,{before:()=>this.emit(new nr(Xt.BEFORE_DRAW,{dataChanges:o,animation:e}),h),beforeAnimate:f=>this.emit(new Li(Xt.BEFORE_ANIMATE,ti.EXPAND,f,l),h),afterAnimate:f=>this.emit(new Li(Xt.AFTER_ANIMATE,ti.EXPAND,f,l),h),after:()=>this.emit(new nr(Xt.AFTER_DRAW,{dataChanges:o,animation:e}),h)},{expand:{target:t,descendants:[...d(c.nodes),...d(c.combos)],position:a}}))===null||n===void 0?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 HE=Symbol("Comlink.proxy"),yB=Symbol("Comlink.endpoint"),XE=Symbol("Comlink.releaseProxy"),U0=Symbol("Comlink.finalizer"),ld=Symbol("Comlink.thrown"),KE=r=>typeof r=="object"&&r!==null||typeof r=="function",bB={canHandle:r=>KE(r)&&r[HE],serialize(r){const{port1:t,port2:e}=new MessageChannel;return qE(r,t),[e,[e]]},deserialize(r){return r.start(),$E(r)}},xB={canHandle:r=>KE(r)&&ld in r,serialize({value:r}){let t;return r instanceof Error?t={isError:!0,value:{message:r.message,name:r.name,stack:r.stack}}:t={isError:!1,value:r},[t,[]]},deserialize(r){throw r.isError?Object.assign(new Error(r.value.message),r.value):r.value}},QE=new Map([["proxy",bB],["throw",xB]]);function EB(r,t){for(const e of r)if(t===e||e==="*"||e instanceof RegExp&&e.test(t))return!0;return!1}function qE(r,t=globalThis,e=["*"]){t.addEventListener("message",function n(i){if(!i||!i.data)return;if(!EB(e,i.origin)){console.warn(`Invalid origin '${i.origin}' for comlink proxy`);return}const{id:a,type:s,path:o}=Object.assign({path:[]},i.data),l=(i.data.argumentList||[]).map(Js);let c;try{const u=o.slice(0,-1).reduce((d,f)=>d[f],r),h=o.reduce((d,f)=>d[f],r);switch(s){case"GET":c=h;break;case"SET":u[o.slice(-1)[0]]=Js(i.data.value),c=!0;break;case"APPLY":c=h.apply(u,l);break;case"CONSTRUCT":{const d=new h(...l);c=OB(d)}break;case"ENDPOINT":{const{port1:d,port2:f}=new MessageChannel;qE(r,f),c=TB(d,[d])}break;case"RELEASE":c=void 0;break;default:return}}catch(u){c={value:u,[ld]:0}}Promise.resolve(c).catch(u=>({value:u,[ld]:0})).then(u=>{const[h,d]=dd(u);t.postMessage(Object.assign(Object.assign({},h),{id:a}),d),s==="RELEASE"&&(t.removeEventListener("message",n),JE(t),U0 in r&&typeof r[U0]=="function"&&r[U0]())}).catch(u=>{const[h,d]=dd({value:new TypeError("Unserializable return value"),[ld]:0});t.postMessage(Object.assign(Object.assign({},h),{id:a}),d)})}),t.start&&t.start()}function wB(r){return r.constructor.name==="MessagePort"}function JE(r){wB(r)&&r.close()}function $E(r,t){const e=new Map;return r.addEventListener("message",function(i){const{data:a}=i;if(!a||!a.id)return;const s=e.get(a.id);if(s)try{s(a)}finally{e.delete(a.id)}}),Y0(r,e,[],t)}function cd(r){if(r)throw new Error("Proxy has been released and is not useable")}function tw(r){return zo(r,new Map,{type:"RELEASE"}).then(()=>{JE(r)})}const ud=new WeakMap,hd="FinalizationRegistry"in globalThis&&new FinalizationRegistry(r=>{const t=(ud.get(r)||0)-1;ud.set(r,t),t===0&&tw(r)});function SB(r,t){const e=(ud.get(t)||0)+1;ud.set(t,e),hd&&hd.register(r,t,r)}function MB(r){hd&&hd.unregister(r)}function Y0(r,t,e=[],n=function(){}){let i=!1;const a=new Proxy(n,{get(s,o){if(cd(i),o===XE)return()=>{MB(a),tw(r),t.clear(),i=!0};if(o==="then"){if(e.length===0)return{then:()=>a};const l=zo(r,t,{type:"GET",path:e.map(c=>c.toString())}).then(Js);return l.then.bind(l)}return Y0(r,t,[...e,o])},set(s,o,l){cd(i);const[c,u]=dd(l);return zo(r,t,{type:"SET",path:[...e,o].map(h=>h.toString()),value:c},u).then(Js)},apply(s,o,l){cd(i);const c=e[e.length-1];if(c===yB)return zo(r,t,{type:"ENDPOINT"}).then(Js);if(c==="bind")return Y0(r,t,e.slice(0,-1));const[u,h]=ew(l);return zo(r,t,{type:"APPLY",path:e.map(d=>d.toString()),argumentList:u},h).then(Js)},construct(s,o){cd(i);const[l,c]=ew(o);return zo(r,t,{type:"CONSTRUCT",path:e.map(u=>u.toString()),argumentList:l},c).then(Js)}});return SB(a,r),a}function AB(r){return Array.prototype.concat.apply([],r)}function ew(r){const t=r.map(dd);return[t.map(e=>e[0]),AB(t.map(e=>e[1]))]}const nw=new WeakMap;function TB(r,t){return nw.set(r,t),r}function OB(r){return Object.assign(r,{[HE]:!0})}function Jj(r,t=globalThis,e="*"){return{postMessage:(n,i)=>r.postMessage(n,e,i),addEventListener:t.addEventListener.bind(t),removeEventListener:t.removeEventListener.bind(t)}}function dd(r){for(const[t,e]of QE)if(e.canHandle(r)){const[n,i]=e.serialize(r);return[{type:"HANDLER",name:t,value:n},i]}return[{type:"RAW",value:r},nw.get(r)||[]]}function Js(r){switch(r.type){case"HANDLER":return QE.get(r.name).deserialize(r.value);case"RAW":return r.value}}function zo(r,t,e,n){return new Promise(i=>{const a=CB();t.set(a,i),r.start&&r.start(),r.postMessage(Object.assign({id:a},e),n)})}function CB(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}class NB extends $u{constructor(t,e,n){super(),this.graph=t,this.layout=e,this.options=n,this.spawnWorker()}spawnWorker(){this.proxy=$E(new Worker(new URL(S.p+S.u(1750),S.b),{type:void 0})),this.running&&(this.running=!1,this.execute())}execute(){var t;return(0,Z.mG)(this,void 0,void 0,function*(){if(this.running)return this;this.running=!0;const e=this.layout.options,{onTick:n}=e,i=(0,Z._T)(e,["onTick"]),a={};Object.keys(i).forEach(c=>{ue(i[c])||(a[c]=i[c])});const s={layout:{id:this.layout.id,options:a,iterations:(t=this.options)===null||t===void 0?void 0:t.iterations},nodes:this.graph.getAllNodes(),edges:this.graph.getAllEdges()},o=new Float32Array([0]),[l]=yield this.proxy.calculateLayout(s,[o]);return l})}stop(){return this.running=!1,this.proxy.stopLayout(),this}kill(){this.proxy[XE]()}isRunning(){return this.running}}var jo=function(r,t,e,n){function i(a){return a instanceof e?a:new e(function(s){s(a)})}return new(e||(e=Promise))(function(a,s){function o(u){try{c(n.next(u))}catch(h){s(h)}}function l(u){try{c(n.throw(u))}catch(h){s(h)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((n=n.apply(r,t||[])).next())})},kB=function(r,t){var e={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&t.indexOf(n)<0&&(e[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(e[n[i]]=r[n[i]]);return e};class PB{get presetOptions(){return{animation:!!_m(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 jo(this,void 0,void 0,function*(){var e,n,i,a;const{graph:s,model:o}=this.context,{add:l}=t;lr(s,new nr(Xt.BEFORE_LAYOUT,{type:"pre"}));const c=yield(e=this.context.layout)===null||e===void 0?void 0:e.simulate();(n=c==null?void 0:c.nodes)===null||n===void 0||n.forEach(u=>{const h=At(u),d=l.nodes.get(h);o.syncNodeLikeDatum(u),d&&Object.assign(d.style,u.style)}),(i=c==null?void 0:c.edges)===null||i===void 0||i.forEach(u=>{const h=At(u),d=l.edges.get(h);o.syncEdgeDatum(u),d&&Object.assign(d.style,u.style)}),(a=c==null?void 0:c.combos)===null||a===void 0||a.forEach(u=>{const h=At(u),d=l.combos.get(h);o.syncNodeLikeDatum(u),d&&Object.assign(d.style,u.style)}),lr(s,new nr(Xt.AFTER_LAYOUT,{type:"pre"})),this.transformDataAfterLayout("pre",t)})}postLayout(){return jo(this,arguments,void 0,function*(t=this.options){if(!t)return;const e=Array.isArray(t)?t:[t],{graph:n}=this.context;lr(n,new nr(Xt.BEFORE_LAYOUT,{type:"post"}));for(let i=0;i<e.length;i++){const a=e[i],s=this.getLayoutData(a),o=Object.assign(Object.assign({},this.presetOptions),a);lr(n,new nr(Xt.BEFORE_STAGE_LAYOUT,{options:o,index:i}));const l=yield this.stepLayout(s,o,i);lr(n,new nr(Xt.AFTER_STAGE_LAYOUT,{options:o,index:i})),a.animation||this.updateElementPosition(l,!1)}lr(n,new nr(Xt.AFTER_LAYOUT,{type:"post"})),this.transformDataAfterLayout("post")})}transformDataAfterLayout(t,e){const n=this.context.transform.getTransformInstance();Object.values(n).forEach(i=>i.afterLayout(t,e))}simulate(){return jo(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 i=t[n],a=this.getLayoutData(i);e=yield this.stepLayout(a,Object.assign(Object.assign(Object.assign({},this.presetOptions),i),{animation:!1}),n)}return e})}stepLayout(t,e,n){return jo(this,void 0,void 0,function*(){return gP(e)?yield this.treeLayout(t,e,n):yield this.graphLayout(t,e,n)})}graphLayout(t,e,n){return jo(this,void 0,void 0,function*(){const{animation:i,enableWorker:a,iterations:s=300}=e,o=this.initGraphLayout(e);if(!o)return{};if(this.instances[n]=o,this.instance=o,a){const c=o;return this.supervisor=new NB(c.graphData2LayoutModel(t),c.instance,{iterations:s}),nh(yield this.supervisor.execute())}if(jv(o))return i?yield o.execute(t,{onTick:c=>{this.updateElementPosition(c,!1)}}):(o.execute(t),o.stop(),o.tick(s));const l=yield o.execute(t);if(i){const c=this.updateElementPosition(l,i);yield c==null?void 0:c.finished}return l})}treeLayout(t,e,n){return jo(this,void 0,void 0,function*(){const{type:i,animation:a}=e,s=ba("layout",i);if(!s)return{};const{nodes:o=[],edges:l=[]}=t,c=new Un({nodes:o.map(v=>({id:At(v),data:v.data||{}})),edges:l.map(v=>({id:At(v),source:v.source,target:v.target,data:v.data||{}}))});gB(c);const u={nodes:[],edges:[]},h={nodes:[],edges:[]};c.getRoots(ui).forEach(v=>{Is(v,E=>{E.children=c.getSuccessors(E.id)},E=>c.getSuccessors(E.id),"TB");const g=s(v,e),{x:p,y,z:b=0}=g;Is(g,E=>{const{id:O,x:k,y:P,z:F=0}=E;u.nodes.push({id:O,style:{x:p,y,z:b}}),h.nodes.push({id:O,style:{x:k,y:P,z:F}})},E=>E.children,"TB")});const f=this.inferTreeLayoutOffset(h);if(rw(h,f),a){rw(u,f),this.updateElementPosition(u,!1);const v=this.updateElementPosition(h,a);yield v==null?void 0:v.finished}return h})}inferTreeLayoutOffset(t){var e;let[n,i]=[1/0,-1/0],[a,s]=[1/0,-1/0];(e=t.nodes)===null||e===void 0||e.forEach(g=>{const{x:p=0,y=0}=g.style||{};n=Math.min(n,p),i=Math.max(i,p),a=Math.min(a,y),s=Math.max(s,y)});const{canvas:o}=this.context,l=o.getSize(),[c,u]=o.getCanvasByViewport([0,0]),[h,d]=o.getCanvasByViewport(l);if(n>=c&&i<=h&&a>=u&&s<=d)return[0,0];const f=(c+h)/2,v=(u+d)/2;return[f-(n+i)/2,v-(a+s)/2]}stopLayout(){this.instance&&jv(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:i=!1,isLayoutInvisibleNodes:a=!1}=t,{nodes:s,edges:o,combos:l}=this.context.model.getData(),{element:c,model:u}=this.context,h=y=>c.getElement(y),d=i?y=>{var b;return!a&&(((b=y.style)===null||b===void 0?void 0:b.visibility)==="hidden"||u.getAncestorsData(y.id,ui).some(ni)||u.getAncestorsData(y.id,fn).some(ni))?!1:e(y)}:y=>{const b=At(y),E=h(b);return!E||Ll(E)?!1:e(y)},f=s.filter(d),v=l.filter(n),g=new Map(f.map(y=>[At(y),y]));v.forEach(y=>g.set(At(y),y));const p=o.filter(({source:y,target:b})=>g.has(y)&&g.has(b));return{nodes:f,edges:p,combos:v}}initGraphLayout(t){var e;const{element:n,viewport:i}=this.context,{type:a,enableWorker:s,animation:o,iterations:l}=t,c=kB(t,["type","enableWorker","animation","iterations"]),[u,h]=i.getCanvasSize(),d=[u/2,h/2],f=(e=t==null?void 0:t.nodeSize)!==null&&e!==void 0?e:b=>{const E=n==null?void 0:n.getElement(b.id);return E?E.attributes.size:n==null?void 0:n.getElementComputedStyle("node",b).size},v=ba("layout",a);if(!v)return ei.warn(`The layout of ${a} is not registered.`);const g=Object.getPrototypeOf(v.prototype)===eh.prototype?v:mP(v,this.context),p=new g(this.context),y={nodeSize:f,width:u,height:h,center:d};switch(p.id){case"d3-force":case"d3-force-3d":Object.assign(y,{center:{x:u/2,y:h/2,z:0}});break;default:break}return xr(p.options,y,c),p}updateElementPosition(t,e){const{model:n,element:i}=this.context;return i?(n.updateData(t),i.draw({animation:e,silence:!0})):null}destroy(){var t;this.stopLayout(),this.context={},(t=this.supervisor)===null||t===void 0||t.kill(),this.supervisor=void 0,this.instance=void 0,this.instances=[],this.animationResult=void 0}}const rw=(r,t)=>{var e;const[n,i]=t;(e=r.nodes)===null||e===void 0||e.forEach(a=>{if(a.style){const{x:s=0,y:o=0}=a.style;a.style.x=s+n,a.style.y=o+i}else a.style={x:n,y:i}})};function RB(r){return[LB].reduce((e,n)=>n(e),r)}function LB(r){return!r.layout||Array.isArray(r.layout)||"preLayout"in r.layout||["antv-dagre","combo-combined","compact-box","circular","concentric","dagre","fishbone","grid","indented","mds","radial","random","snake","dendrogram","mindmap"].includes(r.layout.type)&&(r.layout.preLayout=!0),r}class _B extends Yf{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;ei.warn(`Cannot find the plugin ${t}, will try to find it by type.`);const n=this.extensions.find(i=>i.type===t);if(n)return this.extensionMap[n.key]}}const fd=["update-related-edges","collapse-expand-node","collapse-expand-combo","get-edge-actual-ends","arrange-draw-order"];class DB extends Yf{constructor(t){super(t),this.category="transform",this.setTransforms(this.context.options.transforms||[])}getTransforms(){}setTransforms(t){this.setExtensions([...fd.slice(0,fd.length-1),...t,fd[fd.length-1]])}getTransformInstance(t){return t?this.extensionMap[t]:this.extensionMap}}var Jl=function(r,t,e,n){function i(a){return a instanceof e?a:new e(function(s){s(a)})}return new(e||(e=Promise))(function(a,s){function o(u){try{c(n.next(u))}catch(h){s(h)}}function l(u){try{c(n.throw(u))}catch(h){s(h)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((n=n.apply(r,t||[])).next())})};class IB{get padding(){return hi(this.context.options.padding)}get paddingOffset(){const[t,e,n,i]=this.padding,[a,s,o]=[(i-e)/2,(t-n)/2,0];return[a,s,o]}constructor(t){this.landmarkCounter=0,this.context=t;const[e,n]=this.paddingOffset,{zoom:i,rotation:a,x:s=e,y:o=n}=t.options;this.transform({mode:"absolute",scale:i,translate:[s,o],rotate:a},!1)}get camera(){const{canvas:t}=this.context;return new Proxy(t.getCamera(),{get:(e,n)=>{const a=Object.entries(t.getLayers()).filter(([o])=>!["main"].includes(o)).map(([,o])=>o.getCamera()),s=e[n];if(typeof s=="function")return(...o)=>{const l=s.apply(e,o);return a.forEach(c=>{c[n].apply(c,o)}),l}}})}createLandmark(t){return this.camera.createLandmark(`landmark-${this.landmarkCounter++}`,t)}getAnimation(t){const e=_m(this.context.options,t);return e?zs(Object.assign({},e),["easing","duration"]):!1}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:i=[]}=t,a=this.getZoom(),s=e.getPosition(),o=e.getFocalPoint(),[l,c]=this.getCanvasCenter(),[u=0,h=0,d=0]=i,f=Zi([-u,-h,-d],a);return n==="relative"?{position:Le(s,f),focalPoint:Le(o,f)}:{position:Le([l,c,s[2]],f),focalPoint:Le([l,c,o[2]],f)}}getRotateOptions(t){const{mode:e,rotate:n=0}=t;return{roll:e==="relative"?this.camera.getRoll()+n:n}}getZoomOptions(t){const{zoomRange:e}=this.context.options,n=this.camera.getZoom(),{mode:i,scale:a=1}=t;return kn(i==="relative"?n*a:a,...e)}transform(t,e){return Jl(this,void 0,void 0,function*(){const{graph:n}=this.context,{translate:i,rotate:a,scale:s,origin:o}=t;this.cancelAnimation();const l=this.getAnimation(e);if(lr(n,new sd(Xt.BEFORE_TRANSFORM,t)),!a&&s&&!i&&o&&!l){this.camera.setZoomByViewportPoint(this.getZoomOptions(t),o),lr(n,new sd(Xt.AFTER_TRANSFORM,t));return}const c={};if(i&&Object.assign(c,this.getTranslateOptions(t)),ie(a)&&Object.assign(c,this.getRotateOptions(t)),ie(s)&&Object.assign(c,{zoom:this.getZoomOptions(t)}),l)return lr(n,new Li(Xt.BEFORE_ANIMATE,ti.TRANSFORM,null,t)),new Promise(u=>{this.transformResolver=u,this.camera.gotoLandmark(this.createLandmark(c),Object.assign(Object.assign({},l),{onfinish:()=>{lr(n,new Li(Xt.AFTER_ANIMATE,ti.TRANSFORM,null,t)),lr(n,new sd(Xt.AFTER_TRANSFORM,t)),this.transformResolver=void 0,u()}}))});this.camera.gotoLandmark(this.createLandmark(c),{duration:0}),lr(n,new sd(Xt.AFTER_TRANSFORM,t))})}fitView(t,e){return Jl(this,void 0,void 0,function*(){const[n,i,a,s]=this.padding,{when:o="always",direction:l="both"}=t||{},[c,u]=this.context.canvas.getSize(),h=c-s-i,d=u-n-a,f=this.context.canvas.getBounds(),v=this.getBBoxInViewport(f),[g,p]=Wa(v),y=l==="x"&&g>=h||l==="y"&&p>=d||l==="both"&&g>=h&&p>=d;if(o==="overflow"&&!y)return yield this.fitCenter({animation:e});const b=h/g,E=d/p,O=l==="x"?b:l==="y"?E:Math.min(b,E),k=this.getAnimation(e);Number.isFinite(O)&&(yield this.transform({mode:"relative",scale:O,translate:Le(dn(this.getCanvasCenter(),this.getBBoxInViewport(f).center),Zi(this.paddingOffset,O))},k))})}fitCenter(t){return Jl(this,void 0,void 0,function*(){const e=this.context.canvas.getBounds();yield this.focus(e,t)})}focusElements(t){return Jl(this,arguments,void 0,function*(e,n={}){const{element:i}=this.context;if(!i)return;const a=o=>n.shapes?o.getShape(n.shapes).getRenderBounds():o.getRenderBounds(),s=yl(e.map(o=>a(i.getElement(o))));yield this.focus(s,n)})}focus(t,e){return Jl(this,void 0,void 0,function*(){const n=this.context.graph.getViewportByCanvas(t.center),i=e.position||this.getCanvasCenter(),a=dn(i,n);yield this.transform({mode:"relative",translate:Le(a,this.paddingOffset)},e.animation)})}getBBoxInViewport(t){const{min:e,max:n}=t,{graph:i}=this.context,[a,s]=i.getViewportByCanvas(e),[o,l]=i.getViewportByCanvas(n),c=new yn;return c.setMinMax([a,s,0],[o,l,0]),c}isInViewport(t,e=!1,n=0){const{graph:i}=this.context,a=this.getCanvasSize(),[s,o]=i.getCanvasByViewport([0,0]),[l,c]=i.getCanvasByViewport(a);let u=new yn;return u.setMinMax([s,o,0],[l,c,0]),n&&(u=Va(u,n)),yo(t)?ji(t,u):e?FO(t,u):u.intersects(t)}cancelAnimation(){var t,e;!((t=this.camera.landmarks)===null||t===void 0)&&t.length&&this.camera.cancelLandmarkAnimation(),(e=this.transformResolver)===null||e===void 0||e.call(this)}}var bn=function(r,t,e,n){function i(a){return a instanceof e?a:new e(function(s){s(a)})}return new(e||(e=Promise))(function(a,s){function o(u){try{c(n.next(u))}catch(h){s(h)}}function l(u){try{c(n.throw(u))}catch(h){s(h)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((n=n.apply(r,t||[])).next())})};class vd extends $u{constructor(t){var e;super(),this.options={},this.rendered=!1,this.destroyed=!1,this.context={model:new pB},this.isCollapsingExpanding=!1,this.onResize=_l(()=>{this.resize()},300),this._setOptions(Object.assign({},vd.defaultOptions,t),!0),this.context.graph=this,this.options.autoResize&&((e=globalThis.addEventListener)===null||e===void 0||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,RB(t)),e){const{data:d}=t;d&&this.addData(d);return}const{behaviors:n,combo:i,data:a,edge:s,layout:o,node:l,plugins:c,theme:u,transforms:h}=t;n&&this.setBehaviors(n),a&&this.setData(a),l&&this.setNode(l),s&&this.setEdge(s),i&&this.setCombo(i),o&&this.setLayout(o),u&&this.setTheme(u),c&&this.setPlugins(c),h&&this.setTransforms(h)}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=ue(t)?t(this.getTheme()):t}setLayout(t){this.options.layout=ue(t)?t(this.getLayout()):t}getLayout(){return this.options.layout}setBehaviors(t){var e;this.options.behaviors=ue(t)?t(this.getBehaviors()):t,(e=this.context.behavior)===null||e===void 0||e.setBehaviors(this.options.behaviors)}updateBehavior(t){this.setBehaviors(e=>e.map(n=>typeof n=="object"&&n.key===t.key?Object.assign(Object.assign({},n),t):n))}getBehaviors(){return this.options.behaviors||[]}setPlugins(t){var e;this.options.plugins=ue(t)?t(this.getPlugins()):t,(e=this.context.plugin)===null||e===void 0||e.setPlugins(this.options.plugins)}updatePlugin(t){this.setPlugins(e=>e.map(n=>typeof n=="object"&&n.key===t.key?Object.assign(Object.assign({},n),t):n))}getPlugins(){return this.options.plugins||[]}getPluginInstance(t){return this.context.plugin.getPluginInstance(t)}setTransforms(t){var e;this.options.transforms=ue(t)?t(this.getTransforms()):t,(e=this.context.transform)===null||e===void 0||e.setTransforms(this.options.transforms)}updateTransform(t){this.setTransforms(e=>e.map(n=>typeof n=="object"&&n.key===t.key?Object.assign(Object.assign({},n),t):n)),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(e=>this.context.model.getElementDataById(e)):this.context.model.getElementDataById(t)}getNodeData(t){return t===void 0?this.context.model.getNodeData():Array.isArray(t)?this.context.model.getNodeData(t):this.context.model.getNodeLikeDatum(t)}getEdgeData(t){return t===void 0?this.context.model.getEdgeData():Array.isArray(t)?this.context.model.getEdgeData(t):this.context.model.getEdgeDatum(t)}getComboData(t){return t===void 0?this.context.model.getComboData():Array.isArray(t)?this.context.model.getComboData(t):this.context.model.getNodeLikeDatum(t)}setData(t){this.context.model.setData(ue(t)?t(this.getData()):t)}addData(t){this.context.model.addData(ue(t)?t(this.getData()):t)}addNodeData(t){this.context.model.addNodeData(ue(t)?t(this.getNodeData()):t)}addEdgeData(t){this.context.model.addEdgeData(ue(t)?t(this.getEdgeData()):t)}addComboData(t){this.context.model.addComboData(ue(t)?t(this.getComboData()):t)}addChildrenData(t,e){this.context.model.addChildrenData(t,e)}updateData(t){this.context.model.updateData(ue(t)?t(this.getData()):t)}updateNodeData(t){this.context.model.updateNodeData(ue(t)?t(this.getNodeData()):t)}updateEdgeData(t){this.context.model.updateEdgeData(ue(t)?t(this.getEdgeData()):t)}updateComboData(t){this.context.model.updateComboData(ue(t)?t(this.getComboData()):t)}removeData(t){this.context.model.removeData(ue(t)?t(this.getData()):t)}removeNodeData(t){this.context.model.removeNodeData(ue(t)?t(this.getNodeData()):t)}removeEdgeData(t){this.context.model.removeEdgeData(ue(t)?t(this.getEdgeData()):t)}removeComboData(t){this.context.model.removeComboData(ue(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 bn(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:i,renderer:a,cursor:s,background:o,canvas:l,devicePixelRatio:c=(t=globalThis.devicePixelRatio)!==null&&t!==void 0?t:1}=this.options;if(e instanceof GE)this.context.canvas=e,s&&e.setCursor(s),a&&e.setRenderer(a),yield e.ready;else{const u=Ue(e)?document.getElementById(e):e,h=VE(u);this.emit(Xt.BEFORE_CANVAS_INIT,{container:u,width:n,height:i});const d=Object.assign(Object.assign({},l),{container:u,width:n||h[0],height:i||h[1],background:o,renderer:a,cursor:s,devicePixelRatio:c}),f=new GE(d);this.context.canvas=f,yield f.ready,this.emit(Xt.AFTER_CANVAS_INIT,{canvas:f})}})}updateCanvas(t){var e,n;const{renderer:i,cursor:a,height:s,width:o}=t,l=this.context.canvas;l&&(i&&(this.emit(Xt.BEFORE_RENDERER_CHANGE,{renderer:this.options.renderer}),l.setRenderer(i),this.emit(Xt.AFTER_RENDERER_CHANGE,{renderer:i})),a&&l.setCursor(a),(ie(o)||ie(s))&&this.setSize((e=o!=null?o:this.options.width)!==null&&e!==void 0?e:0,(n=s!=null?s:this.options.height)!==null&&n!==void 0?n:0))}initRuntime(){this.context.options=this.options,this.context.batch||(this.context.batch=new hB(this.context)),this.context.plugin||(this.context.plugin=new _B(this.context)),this.context.viewport||(this.context.viewport=new IB(this.context)),this.context.transform||(this.context.transform=new DB(this.context)),this.context.element||(this.context.element=new mB(this.context)),this.context.animation||(this.context.animation=new uB(this.context)),this.context.layout||(this.context.layout=new PB(this.context)),this.context.behavior||(this.context.behavior=new dB(this.context))}prepare(){return bn(this,void 0,void 0,function*(){if(yield Promise.resolve(),this.destroyed){console.error(xa("The graph instance has been destroyed"));return}yield this.initCanvas(),this.initRuntime()})}render(){return bn(this,void 0,void 0,function*(){if(yield this.prepare(),lr(this,new nr(Xt.BEFORE_RENDER)),this.options.layout)if(!this.rendered&&pP(this.options.layout)){const t=yield this.context.element.preLayoutDraw({type:"render"});yield Promise.all([t==null?void 0:t.finished,this.autoFit()])}else{const t=this.context.element.draw({type:"render"});yield Promise.all([t==null?void 0:t.finished,this.context.layout.postLayout()]),yield this.autoFit()}else{const t=this.context.element.draw({type:"render"});yield Promise.all([t==null?void 0:t.finished,this.autoFit()])}this.rendered=!0,lr(this,new nr(Xt.AFTER_RENDER))})}draw(){return bn(this,void 0,void 0,function*(){var t;yield this.prepare(),yield(t=this.context.element.draw())===null||t===void 0?void 0:t.finished})}layout(t){return bn(this,void 0,void 0,function*(){yield this.context.layout.postLayout(t)})}stopLayout(){this.context.layout.stopLayout()}clear(){return bn(this,void 0,void 0,function*(){const{model:t,element:e}=this.context;t.setData({}),t.clearChanges(),e==null||e.clear()})}destroy(){var t;lr(this,new nr(Xt.BEFORE_DESTROY));const{layout:e,animation:n,element:i,model:a,canvas:s,behavior:o,plugin:l}=this.context;l==null||l.destroy(),o==null||o.destroy(),e==null||e.destroy(),n==null||n.destroy(),i==null||i.destroy(),a.destroy(),s==null||s.destroy(),this.options={},this.context={},this.off(),(t=globalThis.removeEventListener)===null||t===void 0||t.call(globalThis,"resize",this.onResize),this.destroyed=!0,lr(this,new nr(Xt.AFTER_DESTROY))}getCanvas(){return this.context.canvas}resize(t,e){var n;const i=VE((n=this.context.canvas)===null||n===void 0?void 0:n.getContainer()),a=[t||i[0],e||i[1]];if(!this.context.canvas)return;const s=this.context.canvas.getSize();Wn(a,s)||(lr(this,new nr(Xt.BEFORE_SIZE_CHANGE,{size:a})),this.context.canvas.resize(...a),lr(this,new nr(Xt.AFTER_SIZE_CHANGE,{size:a})))}fitView(t,e){return bn(this,void 0,void 0,function*(){var n;yield(n=this.context.viewport)===null||n===void 0?void 0:n.fitView(t,e)})}fitCenter(t){return bn(this,void 0,void 0,function*(){var e;yield(e=this.context.viewport)===null||e===void 0?void 0:e.fitCenter({animation:t})})}autoFit(){return bn(this,void 0,void 0,function*(){const{autoFit:t}=this.context.options;if(t)if(Ue(t))t==="view"?yield this.fitView():t==="center"&&(yield this.fitCenter());else{const{type:e,animation:n}=t;e==="view"?yield this.fitView(t.options,n):e==="center"&&(yield this.fitCenter(n))}})}focusElement(t,e){return bn(this,void 0,void 0,function*(){var n;yield(n=this.context.viewport)===null||n===void 0?void 0:n.focusElements(Array.isArray(t)?t:[t],{animation:e})})}zoomBy(t,e,n){return bn(this,void 0,void 0,function*(){yield this.context.viewport.transform({mode:"relative",scale:t,origin:n},e)})}zoomTo(t,e,n){return bn(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 bn(this,void 0,void 0,function*(){yield this.context.viewport.transform({mode:"relative",rotate:t,origin:n},e)})}rotateTo(t,e,n){return bn(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 bn(this,void 0,void 0,function*(){yield this.context.viewport.transform({mode:"relative",translate:t},e)})}translateTo(t,e){return bn(this,void 0,void 0,function*(){yield this.context.viewport.transform({mode:"absolute",translate:t},e)})}getPosition(){return dn([0,0],this.getCanvasByViewport([0,0]))}translateElementBy(t,e){return bn(this,arguments,void 0,function*(n,i,a=!0){var s,o;const[l,c]=zn(n)?[n,(s=i)!==null&&s!==void 0?s:!0]:[{[n]:i},a];Object.entries(l).forEach(([u,h])=>this.context.model.translateNodeLikeBy(u,h)),yield(o=this.context.element.draw({animation:c,stage:"translate"}))===null||o===void 0?void 0:o.finished})}translateElementTo(t,e){return bn(this,arguments,void 0,function*(n,i,a=!0){var s,o;const[l,c]=zn(n)?[n,(s=i)!==null&&s!==void 0?s:!0]:[{[n]:i},a];Object.entries(l).forEach(([u,h])=>this.context.model.translateNodeLikeTo(u,h)),yield(o=this.context.element.draw({animation:c,stage:"translate"}))===null||o===void 0?void 0:o.finished})}getElementPosition(t){return this.context.model.getElementPosition(t)}getElementRenderStyle(t){return Yv(this.context.element.getElement(t).attributes,["context"])}setElementVisibility(t,e){return bn(this,arguments,void 0,function*(n,i,a=!0){var s,o;const[l,c]=zn(n)?[n,(s=i)!==null&&s!==void 0?s:!0]:[{[n]:i},a],u={nodes:[],edges:[],combos:[]};Object.entries(l).forEach(([f,v])=>{const g=this.getElementType(f);u[`${g}s`].push({id:f,style:{visibility:v}})});const{model:h,element:d}=this.context;h.preventUpdateNodeLikeHierarchy(()=>{h.updateData(u)}),yield(o=d.draw({animation:c,stage:"visibility"}))===null||o===void 0?void 0:o.finished})}showElement(t,e){return bn(this,void 0,void 0,function*(){const n=Array.isArray(t)?t:[t];yield this.setElementVisibility(Object.fromEntries(n.map(i=>[i,"visible"])),e)})}hideElement(t,e){return bn(this,void 0,void 0,function*(){const n=Array.isArray(t)?t:[t];yield this.setElementVisibility(Object.fromEntries(n.map(i=>[i,"hidden"])),e)})}getElementVisibility(t){var e,n;const i=this.context.element.getElement(t);return(n=(e=i==null?void 0:i.style)===null||e===void 0?void 0:e.visibility)!==null&&n!==void 0?n:"visible"}setElementZIndex(t,e){return bn(this,void 0,void 0,function*(){var n;const i={nodes:[],edges:[],combos:[]},a=zn(t)?t:{[t]:e};Object.entries(a).forEach(([l,c])=>{const u=this.getElementType(l);i[`${u}s`].push({id:l,style:{zIndex:c}})});const{model:s,element:o}=this.context;s.preventUpdateNodeLikeHierarchy(()=>s.updateData(i)),yield(n=o.draw({animation:!1,stage:"zIndex"}))===null||n===void 0?void 0:n.finished})}frontElement(t){return bn(this,void 0,void 0,function*(){const e=Array.isArray(t)?t:[t],{model:n}=this.context,i={};e.map(a=>{const s=n.getFrontZIndex(a);if(n.getElementType(a)==="combo"){const l=n.getAncestorsData(a,fn).at(-1)||this.getComboData(a),c=[l,...n.getDescendantsData(At(l))],u=s-UE(l);c.forEach(d=>{i[At(d)]=this.getElementZIndex(At(d))+u});const{internal:h}=mv(c.map(At),d=>n.getRelatedEdgesData(d));h.forEach(d=>{const f=At(d);i[f]=this.getElementZIndex(f)+u})}else i[a]=s}),yield this.setElementZIndex(i)})}getElementZIndex(t){return UE(this.context.model.getElementDataById(t))}setElementState(t,e){return bn(this,arguments,void 0,function*(n,i,a=!0){var s,o;const[l,c]=zn(n)?[n,(s=i)!==null&&s!==void 0?s:!0]:[{[n]:i},a],u=d=>d?Array.isArray(d)?d:[d]:[],h={nodes:[],edges:[],combos:[]};Object.entries(l).forEach(([d,f])=>{const v=this.getElementType(d);h[`${v}s`].push({id:d,states:u(f)})}),this.updateData(h),yield(o=this.context.element.draw({animation:c,stage:"state"}))===null||o===void 0?void 0:o.finished})}getElementState(t){return this.context.model.getElementState(t)}getElementRenderBounds(t){return this.context.element.getElement(t).getRenderBounds()}collapseElement(t){return bn(this,arguments,void 0,function*(e,n=!0){const{model:i,element:a}=this.context;if(ni(i.getNodeLikeData([e])[0])||this.isCollapsingExpanding)return;typeof n=="boolean"&&(n={animation:n,align:!0});const s=i.getElementType(e);yield this.frontElement(e),this.isCollapsingExpanding=!0,i.updateData(s==="node"?{nodes:[{id:e,style:{collapsed:!0}}]}:{combos:[{id:e,style:{collapsed:!0}}]}),s==="node"?yield a.collapseNode(e,n):s==="combo"&&(yield a.collapseCombo(e,!!n.animation)),this.isCollapsingExpanding=!1})}expandElement(t){return bn(this,arguments,void 0,function*(e,n=!0){const{model:i,element:a}=this.context;if(!ni(i.getNodeLikeData([e])[0])||this.isCollapsingExpanding)return;typeof n=="boolean"&&(n={animation:n,align:!0});const s=i.getElementType(e);this.isCollapsingExpanding=!0,i.updateData(s==="node"?{nodes:[{id:e,style:{collapsed:!1}}]}:{combos:[{id:e,style:{collapsed:!1}}]}),s==="node"?yield a.expandNode(e,n):s==="combo"&&(yield a.expandCombo(e,!!n.animation)),this.isCollapsingExpanding=!1})}setElementCollapsibility(t,e){const n=this.getElementType(t);n==="node"?this.updateNodeData([{id:t,style:{collapsed:e}}]):n==="combo"&&this.updateComboData([{id:t,style:{collapsed:e}}])}toDataURL(){return bn(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)}}vd.defaultOptions={autoResize:!1,theme:"light",rotation:0,zoom:1,zoomRange:[.01,10]};var BB=function(r,t){var e={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&t.indexOf(n)<0&&(e[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(e[n[i]]=r[n[i]]);return e};function FB(r,t){const{getNodeData:e=(o,l)=>{if(o.depth=l,!o.children)return o;const{children:c}=o,u=BB(o,["children"]);return Object.assign(Object.assign({},u),{children:c.map(h=>h.id)})},getEdgeData:n=(o,l)=>({source:o.id,target:l.id}),getChildren:i=o=>o.children||[]}=t||{},a=[],s=[];return Is(r,(o,l)=>{a.push(e(o,l));const c=i(o);for(const u of c)s.push(n(o,u))},o=>i(o),"TB"),{nodes:a,edges:s}}class zB extends is{beforeDraw(t){const{add:e,update:n}=t,{model:i}=this.context;return[...e.edges.entries(),...n.edges.entries()].forEach(([,a])=>{iw(i,a)}),t}}const iw=(r,t)=>{const{source:e,target:n}=t,i=r.getElementDataById(e),a=r.getElementDataById(n),s=S1(i,h=>r.getParentData(h,fn)),o=S1(a,h=>r.getParentData(h,fn)),l=At(s),c=At(o),u={sourceNode:l,targetNode:c};return t.style?Object.assign(t.style,u):t.style=u,t},jB=(r,t,e)=>{const[n,i]=t,[a,s]=e;if(i===n)return a;const o=(r-n)/(i-n);return a+o*(s-a)},GB=(r,t,e)=>{const[n,i]=t,[a,s]=e,o=Math.log(r-n+1)/Math.log(i-n+1);return a+o*(s-a)},WB=(r,t,e,n=2)=>{const[i,a]=t,[s,o]=e,l=Math.pow((r-i)/(a-i),n);return s+l*(o-s)},ZB=(r,t,e)=>{const[n,i]=t,[a,s]=e,o=Math.sqrt((r-n)/(i-n));return a+o*(s-a)};class gd extends is{constructor(t,e){super(t,xr({},gd.defaultOptions,e)),this.assignSizeByCentrality=(n,i,a,s,o,l)=>{const c=[i,a],u=[s[0],o[0]],h=[s[1],o[1]],d=[s[2],o[2]],f=(v,g)=>{if(typeof l=="function")return l(v,c,g);switch(l){case"linear":return jB(v,c,g);case"log":return GB(v,c,g);case"pow":return WB(v,c,g,2);case"sqrt":return ZB(v,c,g);default:return g[0]}};return[f(n,u),f(n,h),f(n,d)]}}beforeDraw(t){const{model:e}=this.context,n=e.getNodeData(),i=fi(this.options.maxSize),a=fi(this.options.minSize),s=this.getCentralities(this.options.centrality),o=s.size>0?Math.max(...s.values()):0,l=s.size>0?Math.min(...s.values()):0;return n.forEach(c=>{var u;const h=this.assignSizeByCentrality(s.get(At(c))||0,l,o,a,i,this.options.scale),d=(u=this.context.element)===null||u===void 0?void 0:u.getElement(At(c)),f={size:h};this.assignLabelStyle(f,h,c,d),(!d||!id(f,d.attributes))&&mi(t,d?"update":"add","node",xr(c,{style:f}),!0)}),t}assignLabelStyle(t,e,n,i){var a;const s=i?i.config.style:(a=this.context.element)===null||a===void 0?void 0:a.getElementComputedStyle("node",n);if(Object.assign(t,zs(s,["labelFontSize","labelLineHeight"])),this.options.mapLabelSize){const o=this.getLabelSizeByNodeSize(e,1/0,Number(t.labelFontSize));Object.assign(t,{labelFontSize:o,labelLineHeight:o+BO(t.labelPadding)})}return t}getLabelSizeByNodeSize(t,e,n){const i=Math.min(...t)/2,[a,s]=Array.isArray(this.options.mapLabelSize)?this.options.mapLabelSize:[n,e];return Math.min(s,Math.max(i,a))}getCentralities(t){const{model:e}=this.context,n=e.getData();if(typeof t=="function")return t(n);const i=e.getRelatedEdgesData.bind(e);return Ay(n,i,t)}}gd.defaultOptions={centrality:{type:"degree"},maxSize:80,minSize:20,scale:"linear",mapLabelSize:!1};class pd extends is{constructor(t,e){super(t,Object.assign({},pd.defaultOptions,e))}get ref(){return this.context.model.getRootsData()[0]}afterLayout(){var t;const e=sr(this.ref),{graph:n,model:i}=this.context;(t=i.getData().nodes)===null||t===void 0||t.forEach(s=>{var o;if(At(s)===At(this.ref))return;const l=Ny(dn(sr(s),e)),c=Math.abs(l)>Math.PI/2,u=!s.children||s.children.length===0,h=At(s),d=(o=this.context.element)===null||o===void 0?void 0:o.getElement(h);if(!d||!d.isVisible())return;const f=fi(n.getElementRenderStyle(h).size)[0]/2,v=(u?1:-1)*(f+this.options.offset),g=[["translate",v*Math.cos(l),v*Math.sin(l)],["rotate",c?Qr(l)+180:Qr(l)]];i.updateNodeData([{id:At(s),style:{labelTextAlign:c===u?"right":"left",labelTextBaseline:"middle",labelTransform:g}}])}),n.draw()}}pd.defaultOptions={offset:5};const VB="quadratic",aw=["top","top-right","right","right-bottom","bottom","bottom-left","left","left-top"];class md extends is{constructor(t,e){super(t,Object.assign({},md.defaultOptions,e)),this.cacheMergeStyle=new Map,this.getAffectedParallelEdges=n=>{const{add:{edges:i},update:{nodes:a,edges:s,combos:o},remove:{edges:l}}=n,{model:c}=this.context,u=new Map,h=(v,g)=>{c.getRelatedEdgesData(g).forEach(y=>!u.has(At(y))&&u.set(At(y),y))};a.forEach(h),o.forEach(h);const d=v=>{const g=new Set(n.remove.edges.keys()),p=c.getEdgeData().filter(y=>!g.has(At(y))).map(y=>iw(c,y));UB(v,p,!0).forEach(y=>{const b=At(y);u.has(b)||u.set(b,y)})};if(l.size&&l.forEach(d),i.size&&i.forEach(d),s.size){const v=rx(Jv(c.getChanges())).update.edges;s.forEach(g=>{var p;d(g);const y=(p=v.find(b=>At(b.value)===At(g)))===null||p===void 0?void 0:p.original;y&&!H0(g,y)&&d(y)})}ua(this.options.edges)||u.forEach((v,g)=>!this.options.edges.includes(g)&&u.delete(g));const f=c.getEdgeData().map(At);return new Map([...u].sort((v,g)=>f.indexOf(v[0])-f.indexOf(g[0])))},this.applyBundlingStyle=(n,i,a)=>{const{edgeMap:s,reverses:o}=sw(i);s.forEach(l=>{l.forEach((c,u,h)=>{var d;const f=h.length,v=c.style||{};if(c.source===c.target){const y=aw.length;v.loopPlacement=aw[u%y],v.loopDist=Math.floor(u/y)*a+50}else if(f===1)v.curveOffset=0;else{const y=(u%2===0?1:-1)*(o[`${c.source}|${c.target}|${u}`]?-1:1);v.curveOffset=f%2===1?y*Math.ceil(u/2)*a*2:y*(Math.floor(u/2)*a*2+a)}const g=Object.assign(c,{type:VB,style:v}),p=(d=this.context.element)===null||d===void 0?void 0:d.getElement(At(c));(!p||!id(g.style,p.attributes))&&mi(n,p?"update":"add","edge",g,!0)})})},this.resetEdgeStyle=n=>{const i=n.style||{},a=this.cacheMergeStyle.get(At(n))||{};return Object.keys(a).forEach(s=>{Wn(i[s],a[s])&&(n[s]?i[s]=n[s]:delete i[s])}),Object.assign(n,{style:i})},this.applyMergingStyle=(n,i)=>{const{edgeMap:a,reverses:s}=sw(i);a.forEach(o=>{var l;if(o.length===1){const u=o[0],h=(l=this.context.element)===null||l===void 0?void 0:l.getElement(At(u)),d=this.resetEdgeStyle(u);(!h||!id(d,h.attributes))&&mi(n,h?"update":"add","edge",d);return}const c=o.map(({source:u,target:h,style:d={}},f)=>{const{startArrow:v,endArrow:g}=d,p={},[y,b]=s[`${u}|${h}|${f}`]?["endArrow","startArrow"]:["startArrow","endArrow"];return qo(v)&&(p[y]=v),qo(g)&&(p[b]=g),p}).reduce((u,h)=>Object.assign(Object.assign({},u),h),{});o.forEach((u,h,d)=>{var f;if(h!==0){mi(n,"remove","edge",u);return}const v=Object.assign({},ue(this.options.style)?this.options.style(d):this.options.style,{childrenData:d});this.cacheMergeStyle.set(At(u),v);const g=Object.assign(Object.assign({},u),{type:"line",style:Object.assign(Object.assign(Object.assign({},u.style),c),v)}),p=(f=this.context.element)===null||f===void 0?void 0:f.getElement(At(u));(!p||!id(g.style,p.attributes))&&mi(n,p?"update":"add","edge",g,!0)})})}}beforeDraw(t){const e=this.getAffectedParallelEdges(t);return e.size===0||(this.options.mode==="bundle"?this.applyBundlingStyle(t,e,this.options.distance):this.applyMergingStyle(t,e)),t}}md.defaultOptions={mode:"bundle",distance:15};const sw=r=>{const t=new Map,e=new Set,n={},i=new Map;for(const[a,s]of r){if(e.has(a))continue;const{source:o,target:l}=s,c=`${o}-${l}`;t.has(c)||(t.set(c,[]),i.set(c,new Set));const u=t.get(c),h=i.get(c);u&&h&&!h.has(a)&&(u.push(s),h.add(a),e.add(a));for(const[d,f]of r)if(!(e.has(d)||d===a)&&H0(s,f)){const v=t.get(c),g=i.get(c);v&&g&&!g.has(d)&&(v.push(f),g.add(d),o===f.target&&l===f.source&&(n[`${f.source}|${f.target}|${v.length-1}`]=!0),e.add(d))}}return{edgeMap:t,reverses:n}},UB=(r,t,e)=>t.filter(n=>(e||At(n)!==At(r))&&H0(n,r)),H0=(r,t)=>{const{sourceNode:e,targetNode:n}=r.style||{},{sourceNode:i,targetNode:a}=t.style||{};return e===i&&n===a||e===a&&n===i};class YB extends is{beforeDraw(t,e){const{stage:n}=e;if(n==="visibility")return t;const{model:i}=this.context,{update:{nodes:a,edges:s,combos:o}}=t,l=(c,u)=>{i.getRelatedEdgesData(u).forEach(d=>!s.has(At(d))&&s.set(At(d),d))};return a.forEach(l),o.forEach(l),t}}const HB={animation:{"combo-collapse":Fm,"combo-expand":RO,"node-collapse":Im,"node-expand":kO,"path-in":Bm,"path-out":PO,fade:CO,translate:NO},behavior:{"brush-select":Ml,"click-select":Su,"collapse-expand":Hu,"create-edge":qu,"drag-canvas":Ju,"drag-element-force":bP,"drag-element":Dl,"fix-element-size":rh,"focus-element":ih,"hover-activate":ah,"lasso-select":EP,"auto-adapt-label":mu,"optimize-viewport-transform":sh,"scroll-canvas":oh,"zoom-canvas":lh},combo:{circle:h3,rect:d3},edge:{cubic:js,line:Vu,polyline:Uu,quadratic:Yu,"cubic-horizontal":Gu,"cubic-radial":Wu,"cubic-vertical":Zu},layout:{"antv-dagre":sL,"combo-combined":NL,"compact-box":ch.compactBox,"d3-force":QL,"force-atlas2":$L,circular:cL,concentric:Dv,dagre:uh,dendrogram:ch.dendrogram,fishbone:fh,force:Tb,fruchterman:n_,grid:i_,indented:ch.indented,mds:Lb,mindmap:ch.mindmap,radial:f_,random:x_,snake:vh},node:{circle:Bs,diamond:dk,ellipse:Cu,hexagon:mk,html:Iu,image:Bu,rect:c3,star:u3,donut:Tu,triangle:Fu},palette:{spectral:A_,tableau:T_,oranges:O_,greens:C_,blues:N_},theme:{dark:J4,light:$4},plugin:{"bubble-sets":Mh,"edge-bundling":Th,"edge-filter-lens":Oh,"grid-line":kh,background:gh,contextmenu:Ah,fisheye:Ch,fullscreen:Nh,history:Ph,hull:Dh,legend:Gh,minimap:Wh,snapline:Zh,timebar:td,title:I4,toolbar:ed,tooltip:nd,watermark:rd},transform:{"arrange-draw-order":tB,"collapse-expand-combo":eB,"collapse-expand-node":nB,"get-edge-actual-ends":zB,"map-node-size":gd,"place-radial-labels":pd,"process-parallel-edges":md,"update-related-edges":YB},shape:{circle:aa,ellipse:hl,group:ar,html:Ts,image:nv,line:Os,path:li,polygon:Cs,polyline:Dc,rect:br,text:Ns,label:ha,badge:Eo}};function XB(){Object.entries(HB).forEach(([r,t])=>{Object.entries(t).forEach(([e,n])=>{rB(r,e,n)})})}XB();const $j={css:"//at.alicdn.com/t/a/font_470089_8hnbbf8n4u8.css",js:"//at.alicdn.com/t/a/font_470089_8hnbbf8n4u8.js"}},13722:function(Y){(function(S,A){Y.exports=A()})(typeof self!="undefined"?self:this,function(){return function(Q){var S={};function A(W){if(S[W])return S[W].exports;var z=S[W]={i:W,l:!1,exports:{}};return Q[W].call(z.exports,z,z.exports,A),z.l=!0,z.exports}return A.m=Q,A.c=S,A.d=function(W,z,C){A.o(W,z)||Object.defineProperty(W,z,{configurable:!1,enumerable:!0,get:C})},A.n=function(W){var z=W&&W.__esModule?function(){return W.default}:function(){return W};return A.d(z,"a",z),z},A.o=function(W,z){return Object.prototype.hasOwnProperty.call(W,z)},A.p="",A(A.s=5)}([function(Q,S){function A(W,z,C,T){return T===void 0&&(T="height"),C==="center"?(W[T]+z[T])/2:W.height}Q.exports={assign:Object.assign,getHeight:A}},function(Q,S,A){var W=A(3),z=function(){function C(N,D){D===void 0&&(D={});var R=this;R.options=D,R.rootNode=W(N,D)}var T=C.prototype;return T.execute=function(){throw new Error("please override this method")},C}();Q.exports=z},function(Q,S,A){var W=A(4),z=["LR","RL","TB","BT","H","V"],C=["LR","RL","H"],T=function(_){return C.indexOf(_)>-1},N=z[0];Q.exports=function(R,_,I){var L=_.direction||N;if(_.isHorizontal=T(L),L&&z.indexOf(L)===-1)throw new TypeError("Invalid direction: "+L);if(L===z[0])I(R,_);else if(L===z[1])I(R,_),R.right2left();else if(L===z[2])I(R,_);else if(L===z[3])I(R,_),R.bottom2top();else if(L===z[4]||L===z[5]){var G=W(R,_),K=G.left,X=G.right;I(K,_),I(X,_),_.isHorizontal?K.right2left():K.bottom2top(),X.translate(K.x-X.x,K.y-X.y),R.x=K.x,R.y=X.y;var et=R.getBoundingBox();_.isHorizontal?et.top<0&&R.translate(0,-et.top):et.left<0&&R.translate(-et.left,0)}var tt=_.fixedRoot;return tt===void 0&&(tt=!0),tt&&R.translate(-(R.x+R.width/2+R.hgap),-(R.y+R.height/2+R.vgap)),D(R,_),R};function D(R,_){if(_.radial){var I=_.isHorizontal?["x","y"]:["y","x"],L=I[0],G=I[1],K={x:1/0,y:1/0},X={x:-1/0,y:-1/0},et=0;R.DFTraverse(function(it){et++;var st=it.x,ut=it.y;K.x=Math.min(K.x,st),K.y=Math.min(K.y,ut),X.x=Math.max(X.x,st),X.y=Math.max(X.y,ut)});var tt=X[G]-K[G];if(tt===0)return;var q=Math.PI*2/et;R.DFTraverse(function(it){var st=(it[G]-K[G])/tt*(Math.PI*2-q)+q,ut=it[L]-R[L];it.x=Math.cos(st)*ut,it.y=Math.sin(st)*ut})}}},function(Q,S,A){var W=A(0),z=18,C=z*2,T=z,N={getId:function(I){return I.id||I.name},getPreH:function(I){return I.preH||0},getPreV:function(I){return I.preV||0},getHGap:function(I){return I.hgap||T},getVGap:function(I){return I.vgap||T},getChildren:function(I){return I.children},getHeight:function(I){return I.height||C},getWidth:function(I){var L=I.label||" ";return I.width||L.split("").length*z}};function D(_,I){var L=this;if(L.vgap=L.hgap=0,_ instanceof D)return _;L.data=_;var G=I.getHGap(_),K=I.getVGap(_);return L.preH=I.getPreH(_),L.preV=I.getPreV(_),L.width=I.getWidth(_),L.height=I.getHeight(_),L.width+=L.preH,L.height+=L.preV,L.id=I.getId(_),L.x=L.y=0,L.depth=0,L.children||(L.children=[]),L.addGap(G,K),L}W.assign(D.prototype,{isRoot:function(){return this.depth===0},isLeaf:function(){return this.children.length===0},addGap:function(I,L){var G=this;G.hgap+=I,G.vgap+=L,G.width+=2*I,G.height+=2*L},eachNode:function(I){for(var L=this,G=[L],K;K=G.shift();)I(K),G=K.children.concat(G)},DFTraverse:function(I){this.eachNode(I)},BFTraverse:function(I){for(var L=this,G=[L],K;K=G.shift();)I(K),G=G.concat(K.children)},getBoundingBox:function(){var I={left:Number.MAX_VALUE,top:Number.MAX_VALUE,width:0,height:0};return this.eachNode(function(L){I.left=Math.min(I.left,L.x),I.top=Math.min(I.top,L.y),I.width=Math.max(I.width,L.x+L.width),I.height=Math.max(I.height,L.y+L.height)}),I},translate:function(I,L){I===void 0&&(I=0),L===void 0&&(L=0),this.eachNode(function(G){G.x+=I,G.y+=L,G.x+=G.preH,G.y+=G.preV})},right2left:function(){var I=this,L=I.getBoundingBox();I.eachNode(function(G){G.x=G.x-(G.x-L.left)*2-G.width}),I.translate(L.width,0)},bottom2top:function(){var I=this,L=I.getBoundingBox();I.eachNode(function(G){G.y=G.y-(G.y-L.top)*2-G.height}),I.translate(0,L.height)}});function R(_,I,L){I===void 0&&(I={}),I=W.assign({},N,I);var G=new D(_,I),K=[G],X;if(!L&&!_.collapsed){for(;X=K.shift();)if(!X.data.collapsed){var et=I.getChildren(X.data),tt=et?et.length:0;if(X.children=new Array(tt),et&&tt)for(var q=0;q<tt;q++){var it=new D(et[q],I);X.children[q]=it,K.push(it),it.parent=X,it.depth=X.depth+1}}}return G}Q.exports=R},function(Q,S,A){var W=A(3);Q.exports=function(z,C){for(var T=W(z.data,C,!0),N=W(z.data,C,!0),D=z.children.length,R=Math.round(D/2),_=C.getSide||function(K,X){return X<R?"right":"left"},I=0;I<D;I++){var L=z.children[I],G=_(L,I);G==="right"?N.children.push(L):T.children.push(L)}return T.eachNode(function(K){K.isRoot()||(K.side="left")}),N.eachNode(function(K){K.isRoot()||(K.side="right")}),{left:T,right:N}}},function(Q,S,A){var W={compactBox:A(6),dendrogram:A(8),indented:A(10),mindmap:A(12)};Q.exports=W},function(Q,S,A){function W(L,G){L.prototype=Object.create(G.prototype),L.prototype.constructor=L,z(L,G)}function z(L,G){return z=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(K,X){return K.__proto__=X,K},z(L,G)}var C=A(1),T=A(7),N=A(2),D=A(0),R=function(L){function G(){return L.apply(this,arguments)||this}W(G,L);var K=G.prototype;return K.execute=function(){var et=this;return N(et.rootNode,et.options,T)},G}(C),_={};function I(L,G){return G=D.assign({},_,G),new R(L,G).execute()}Q.exports=I},function(Q,S){function A(D,R,_,I){I===void 0&&(I=[]);var L=this;L.w=D||0,L.h=R||0,L.y=_||0,L.x=0,L.c=I||[],L.cs=I.length,L.prelim=0,L.mod=0,L.shift=0,L.change=0,L.tl=null,L.tr=null,L.el=null,L.er=null,L.msel=0,L.mser=0}A.fromNode=function(D,R){if(!D)return null;var _=[];return D.children.forEach(function(I){_.push(A.fromNode(I,R))}),R?new A(D.height,D.width,D.x,_):new A(D.width,D.height,D.y,_)};function W(D,R,_){_?D.y+=R:D.x+=R,D.children.forEach(function(I){W(I,R,_)})}function z(D,R){var _=R?D.y:D.x;return D.children.forEach(function(I){_=Math.min(z(I,R),_)}),_}function C(D,R){var _=z(D,R);W(D,-_,R)}function T(D,R,_){_?R.y=D.x:R.x=D.x,D.c.forEach(function(I,L){T(I,R.children[L],_)})}function N(D,R,_){_===void 0&&(_=0),R?(D.x=_,_+=D.width):(D.y=_,_+=D.height),D.children.forEach(function(I){N(I,R,_)})}Q.exports=function(D,R){R===void 0&&(R={});var _=R.isHorizontal;function I(pt){if(pt.cs===0){L(pt);return}I(pt.c[0]);for(var xt=St(tt(pt.c[0].el),0,null),kt=1;kt<pt.cs;++kt){I(pt.c[kt]);var Gt=tt(pt.c[kt].er);G(pt,kt,xt),xt=St(Gt,kt,xt)}st(pt),L(pt)}function L(pt){pt.cs===0?(pt.el=pt,pt.er=pt,pt.msel=pt.mser=0):(pt.el=pt.c[0].el,pt.msel=pt.c[0].msel,pt.er=pt.c[pt.cs-1].er,pt.mser=pt.c[pt.cs-1].mser)}function G(pt,xt,kt){for(var Gt=pt.c[xt-1],jt=Gt.mod,Ht=pt.c[xt],fe=Ht.mod;Gt!==null&&Ht!==null;){tt(Gt)>kt.low&&(kt=kt.nxt);var we=jt+Gt.prelim+Gt.w-(fe+Ht.prelim);we>0&&(fe+=we,K(pt,xt,kt.index,we));var Xe=tt(Gt),Hn=tt(Ht);Xe<=Hn&&(Gt=et(Gt),Gt!==null&&(jt+=Gt.mod)),Xe>=Hn&&(Ht=X(Ht),Ht!==null&&(fe+=Ht.mod))}!Gt&&Ht?q(pt,xt,Ht,fe):Gt&&!Ht&&it(pt,xt,Gt,jt)}function K(pt,xt,kt,Gt){pt.c[xt].mod+=Gt,pt.c[xt].msel+=Gt,pt.c[xt].mser+=Gt,ht(pt,xt,kt,Gt)}function X(pt){return pt.cs===0?pt.tl:pt.c[0]}function et(pt){return pt.cs===0?pt.tr:pt.c[pt.cs-1]}function tt(pt){return pt.y+pt.h}function q(pt,xt,kt,Gt){var jt=pt.c[0].el;jt.tl=kt;var Ht=Gt-kt.mod-pt.c[0].msel;jt.mod+=Ht,jt.prelim-=Ht,pt.c[0].el=pt.c[xt].el,pt.c[0].msel=pt.c[xt].msel}function it(pt,xt,kt,Gt){var jt=pt.c[xt].er;jt.tr=kt;var Ht=Gt-kt.mod-pt.c[xt].mser;jt.mod+=Ht,jt.prelim-=Ht,pt.c[xt].er=pt.c[xt-1].er,pt.c[xt].mser=pt.c[xt-1].mser}function st(pt){pt.prelim=(pt.c[0].prelim+pt.c[0].mod+pt.c[pt.cs-1].mod+pt.c[pt.cs-1].prelim+pt.c[pt.cs-1].w)/2-pt.w/2}function ut(pt,xt){xt+=pt.mod,pt.x=pt.prelim+xt,mt(pt);for(var kt=0;kt<pt.cs;kt++)ut(pt.c[kt],xt)}function ht(pt,xt,kt,Gt){if(kt!==xt-1){var jt=xt-kt;pt.c[kt+1].shift+=Gt/jt,pt.c[xt].shift-=Gt/jt,pt.c[xt].change-=Gt-Gt/jt}}function mt(pt){for(var xt=0,kt=0,Gt=0;Gt<pt.cs;Gt++)xt+=pt.c[Gt].shift,kt+=xt+pt.c[Gt].change,pt.c[Gt].mod+=kt}function St(pt,xt,kt){for(;kt!==null&&pt>=kt.low;)kt=kt.nxt;return{low:pt,index:xt,nxt:kt}}N(D,_);var Mt=A.fromNode(D,_);return I(Mt),ut(Mt,0),T(Mt,D,_),C(D,_),D}},function(Q,S,A){function W(L,G){L.prototype=Object.create(G.prototype),L.prototype.constructor=L,z(L,G)}function z(L,G){return z=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(K,X){return K.__proto__=X,K},z(L,G)}var C=A(1),T=A(9),N=A(2),D=A(0),R=function(L){function G(){return L.apply(this,arguments)||this}W(G,L);var K=G.prototype;return K.execute=function(){var et=this;return et.rootNode.width=0,N(et.rootNode,et.options,T)},G}(C),_={};function I(L,G){return G=D.assign({},_,G),new R(L,G).execute()}Q.exports=I},function(Q,S,A){var W=A(0);function z(N,D){N===void 0&&(N=0),D===void 0&&(D=[]);var R=this;R.x=R.y=0,R.leftChild=R.rightChild=null,R.height=0,R.children=D}var C={isHorizontal:!0,nodeSep:20,nodeSize:20,rankSep:200,subTreeSep:10};function T(N,D,R){R?(D.x=N.x,D.y=N.y):(D.x=N.y,D.y=N.x),N.children.forEach(function(_,I){T(_,D.children[I],R)})}Q.exports=function(N,D){D===void 0&&(D={}),D=W.assign({},C,D);var R=0;function _(X){if(!X)return null;X.width=0,X.depth&&X.depth>R&&(R=X.depth);var et=X.children,tt=et.length,q=new z(X.height,[]);return et.forEach(function(it,st){var ut=_(it);q.children.push(ut),st===0&&(q.leftChild=ut),st===tt-1&&(q.rightChild=ut)}),q.originNode=X,q.isLeaf=X.isLeaf(),q}function I(X){if(X.isLeaf||X.children.length===0)X.drawingDepth=R;else{var et=X.children.map(function(q){return I(q)}),tt=Math.min.apply(null,et);X.drawingDepth=tt-1}return X.drawingDepth}var L;function G(X){X.x=X.drawingDepth*D.rankSep,X.isLeaf?(X.y=0,L&&(X.y=L.y+L.height+D.nodeSep,X.originNode.parent!==L.originNode.parent&&(X.y+=D.subTreeSep)),L=X):(X.children.forEach(function(et){G(et)}),X.y=(X.leftChild.y+X.rightChild.y)/2)}var K=_(N);return I(K),G(K),T(K,N,D.isHorizontal),N}},function(Q,S,A){function W(K,X){K.prototype=Object.create(X.prototype),K.prototype.constructor=K,z(K,X)}function z(K,X){return z=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(et,tt){return et.__proto__=tt,et},z(K,X)}var C=A(1),T=A(11),N=A(4),D=A(0),R=["LR","RL","H"],_=R[0],I=function(K){function X(){return K.apply(this,arguments)||this}W(X,K);var et=X.prototype;return et.execute=function(){var q=this,it=q.options,st=q.rootNode;it.isHorizontal=!0;var ut=it.indent,ht=ut===void 0?20:ut,mt=it.dropCap,St=mt===void 0?!0:mt,Mt=it.direction,pt=Mt===void 0?_:Mt,xt=it.align;if(pt&&R.indexOf(pt)===-1)throw new TypeError("Invalid direction: "+pt);if(pt===R[0])T(st,ht,St,xt);else if(pt===R[1])T(st,ht,St,xt),st.right2left();else if(pt===R[2]){var kt=N(st,it),Gt=kt.left,jt=kt.right;T(Gt,ht,St,xt),Gt.right2left(),T(jt,ht,St,xt);var Ht=Gt.getBoundingBox();jt.translate(Ht.width,0),st.x=jt.x-st.width/2}return st},X}(C),L={};function G(K,X){return X=D.assign({},L,X),new I(K,X).execute()}Q.exports=G},function(Q,S,A){var W=A(0);function z(C,T,N,D,R){var _=(typeof N=="function"?N(C):N)*C.depth;if(!D)try{if(C.id===C.parent.children[0].id){C.x+=_,C.y=T?T.y:0;return}}catch(G){}if(C.x+=_,T){if(C.y=T.y+W.getHeight(T,C,R),T.parent&&C.parent.id!==T.parent.id){var I=T.parent,L=I.y+W.getHeight(I,C,R);C.y=L>C.y?L:C.y}}else C.y=0}Q.exports=function(C,T,N,D){var R=null;C.eachNode(function(_){z(_,R,T,N,D),R=_})}},function(Q,S,A){function W(L,G){L.prototype=Object.create(G.prototype),L.prototype.constructor=L,z(L,G)}function z(L,G){return z=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(K,X){return K.__proto__=X,K},z(L,G)}var C=A(1),T=A(13),N=A(2),D=A(0),R=function(L){function G(){return L.apply(this,arguments)||this}W(G,L);var K=G.prototype;return K.execute=function(){var et=this;return N(et.rootNode,et.options,T)},G}(C),_={};function I(L,G){return G=D.assign({},_,G),new R(L,G).execute()}Q.exports=I},function(Q,S,A){var W=A(0);function z(N,D){var R=0;return N.children.length?N.children.forEach(function(_){R+=z(_,D)}):R=N.height,N._subTreeSep=D.getSubTreeSep(N.data),N.totalHeight=Math.max(N.height,R)+2*N._subTreeSep,N.totalHeight}function C(N){var D=N.children,R=D.length;if(R){D.forEach(function(X){C(X)});var _=D[0],I=D[R-1],L=I.y-_.y+I.height,G=0;if(D.forEach(function(X){G+=X.totalHeight}),L>N.height)N.y=_.y+L/2-N.height/2;else if(D.length!==1||N.height>G){var K=N.y+(N.height-L)/2-_.y;D.forEach(function(X){X.translate(0,K)})}else N.y=(_.y+_.height/2+I.y+I.height/2)/2-N.height/2}}var T={getSubTreeSep:function(){return 0}};Q.exports=function(N,D){D===void 0&&(D={}),D=W.assign({},T,D),N.parent={x:0,width:0,height:0,y:0},N.BFTraverse(function(R){R.x=R.parent.x+R.parent.width}),N.parent=null,z(N,D),N.startY=0,N.y=N.totalHeight/2-N.height/2,N.eachNode(function(R){var _=R.children,I=_.length;if(I){var L=_[0];if(L.startY=R.startY+R._subTreeSep,I===1)L.y=R.y+R.height/2-L.height/2;else{L.y=L.startY+L.totalHeight/2-L.height/2;for(var G=1;G<I;G++){var K=_[G];K.startY=_[G-1].startY+_[G-1].totalHeight,K.y=K.startY+K.totalHeight/2-K.height/2}}}}),C(N)}}])})},2866:function(Y,Q,S){"use strict";var A=S(59301),W=S(42441),z=S(48961),C=S.n(z),T=Object.defineProperty,N=Object.defineProperties,D=Object.getOwnPropertyDescriptors,R=Object.getOwnPropertySymbols,_=Object.prototype.hasOwnProperty,I=Object.prototype.propertyIsEnumerable,L=(q,it,st)=>it in q?T(q,it,{enumerable:!0,configurable:!0,writable:!0,value:st}):q[it]=st,G=(q,it)=>{for(var st in it||(it={}))_.call(it,st)&&L(q,st,it[st]);if(R)for(var st of R(it))I.call(it,st)&&L(q,st,it[st]);return q},K=(q,it)=>N(q,D(it));function X(q,it,st=1/3,ut){let ht=q*Math.PI*2,mt=it*Math.PI*2;return{u:{min:-Math.PI,max:Math.PI*3,step:Math.PI/32},v:{min:0,max:Math.PI*2,step:Math.PI/20},x:function(St,Mt){return St<ht?Math.cos(ht)*(1+Math.cos(Mt)*st):St>mt?Math.cos(mt)*(1+Math.cos(Mt)*st):Math.cos(St)*(1+Math.cos(Mt)*st)},y:function(St,Mt){return St<ht?Math.sin(ht)*(1+Math.cos(Mt)*st):St>mt?Math.sin(mt)*(1+Math.cos(Mt)*st):Math.sin(St)*(1+Math.cos(Mt)*st)},z:function(St,Mt){return St<-Math.PI*.5?Math.sin(St):St>Math.PI*2.5?Math.sin(St)*ut*.1:Math.sin(Mt)>0?1*ut*.1:-1}}}function et({pieData:q=[],internalDiameterRatio:it=1/3}){var st,ut,ht,mt;const St=[],Mt=q==null?void 0:q.reduce((jt,Ht)=>(jt||0)+((Ht==null?void 0:Ht.value)||0),0);let pt=0,xt=0;const kt=[];for(let jt=0;jt<(q==null?void 0:q.length);jt++){xt=pt+(Mt==0?1:((st=q==null?void 0:q[jt])==null?void 0:st.value)||0);const Ht={itemStyle:((ut=q==null?void 0:q[jt])==null?void 0:ut.itemStyle)||{},name:((ht=q==null?void 0:q[jt])==null?void 0:ht.name)||`name${jt}`,type:"surface",parametric:!0,parametricEquation:X(pt/(Mt||(q==null?void 0:q.length)),xt/(Mt||(q==null?void 0:q.length)),it,((mt=q==null?void 0:q[jt])==null?void 0:mt.value)||(Mt==0?25:0)),wireframe:{show:!1},pieData:q==null?void 0:q[jt]};kt.push(Ht.name),St.push(Ht),pt=xt}return St.push({name:"pie2d",type:"pie",showEmptyCircle:!0,label:{show:!0,formatter:jt=>`${jt.value}
|
|
|
|
|
|
${jt.name}`},startAngle:-35,radius:["49%","50%"],center:["50%","40%"],data:[...q||[]].reverse(),itemStyle:{opacity:0}}),{legend:{left:"50%",top:"center",textStyle:{fontSize:12},data:kt},xAxis3D:{},yAxis3D:{},zAxis3D:{},grid3D:{viewControl:{alpha:45,rotateSensitivity:0,zoomSensitivity:0,panSensitivity:0,autoRotate:!1},left:"center",top:"-10%",show:!1,boxHeight:25},series:St}}const tt=({dataSource:q=[{name:"\u638C\u63E1\u738780%~100%",value:0,itemStyle:{color:"rgb(223,209,38)"}},{name:"\u638C\u63D0\u738760%~79%",value:0,itemStyle:{color:"rgb(6,234,230)"}},{name:"\u638C\u63A8\u738759%\u4EE5\u4E0B",value:0,itemStyle:{color:"rgb(6,110,247)"}}],className:it="",style:st={},legend:ut={},internalDiameterRatio:ht=1/3})=>{const[mt,St]=(0,A.useState)([]),Mt=(0,A.useCallback)(kt=>{const Gt=kt.selected||{},jt=q.map(Ht=>Ht.name).filter(Ht=>Gt[Ht]===!1);St(jt)},[q]),pt=(0,A.useMemo)(()=>q.filter(kt=>!mt.includes(kt.name)),[q,mt]),xt=(0,A.useMemo)(()=>{const kt=et({pieData:pt,internalDiameterRatio:ht}),Gt=q.map(Ht=>Ht.name),jt=q.reduce((Ht,fe)=>(Ht[fe.name]=!mt.includes(fe.name),Ht),{});return kt.legend=K(G(G({},kt.legend),ut),{data:Gt,selected:jt}),kt},[pt,ut,ht,q,mt]);return A.createElement(W.Z,{onEvents:{legendselectchanged:Mt},className:`w-full h-full ${it}`,option:xt,style:G({height:"100%"},st)})};Q.Z=tt},13393:function(Y,Q,S){"use strict";var A,W=Object.defineProperty,z=H=>{throw TypeError(H)},C=Math.pow,T=(H,x,w)=>x in H?W(H,x,{enumerable:!0,configurable:!0,writable:!0,value:w}):H[x]=w,N=(H,x,w)=>T(H,typeof x!="symbol"?x+"":x,w),D=(H,x,w)=>x.has(H)||z("Cannot "+w),R=(H,x,w)=>(D(H,x,"read from private field"),w?w.call(H):x.get(H)),_=(H,x,w)=>x.has(H)?z("Cannot add the same private member more than once"):x instanceof WeakSet?x.add(H):x.set(H,w),I=(H,x,w,m)=>(D(H,x,"write to private field"),m?m.call(H,w):x.set(H,w),w),L=(H,x,w)=>(D(H,x,"access private method"),w),G,K,X;A={value:!0};var et=S(34634),tt=S(34402);const q=" ".repeat(2),it=" ".repeat(4);function st(){return ut(this)}function ut(H,x={}){const{maxRows:w=15,maxColumns:m=10,maxNumSize:M=8,padMinus:j="auto"}=x;return`${H.constructor.name} {
|
|
|
${q}[
|
|
|
${it}${ht(H,w,m,M,j)}
|
|
|
${q}]
|
|
|
${q}rows: ${H.rows}
|
|
|
${q}columns: ${H.columns}
|
|
|
}`}function ht(H,x,w,m,M){const{rows:j,columns:rt}=H,nt=Math.min(j,x),ot=Math.min(rt,w),lt=[];if(M==="auto"){M=!1;t:for(let Tt=0;Tt<nt;Tt++)for(let vt=0;vt<ot;vt++)if(H.get(Tt,vt)<0){M=!0;break t}}for(let Tt=0;Tt<nt;Tt++){let vt=[];for(let Ft=0;Ft<ot;Ft++)vt.push(mt(H.get(Tt,Ft),m,M));lt.push(`${vt.join(" ")}`)}return ot!==rt&&(lt[lt.length-1]+=` ... ${rt-w} more columns`),nt!==j&<.push(`... ${j-x} more rows`),lt.join(`
|
|
|
${it}`)}function mt(H,x,w){return(H>=0&&w?` ${St(H,x-1)}`:St(H,x)).padEnd(x)}function St(H,x){let w=H.toString();if(w.length<=x)return w;let m=H.toFixed(x);if(m.length>x&&(m=H.toFixed(Math.max(0,x-(m.length-x)))),m.length<=x&&!m.startsWith("0.000")&&!m.startsWith("-0.000"))return m;let M=H.toExponential(x);return M.length>x&&(M=H.toExponential(Math.max(0,x-(M.length-x)))),M.slice(0)}function Mt(H,x){H.prototype.add=function(m){return typeof m=="number"?this.addS(m):this.addM(m)},H.prototype.addS=function(m){for(let M=0;M<this.rows;M++)for(let j=0;j<this.columns;j++)this.set(M,j,this.get(M,j)+m);return this},H.prototype.addM=function(m){if(m=x.checkMatrix(m),this.rows!==m.rows||this.columns!==m.columns)throw new RangeError("Matrices dimensions must be equal");for(let M=0;M<this.rows;M++)for(let j=0;j<this.columns;j++)this.set(M,j,this.get(M,j)+m.get(M,j));return this},H.add=function(m,M){return new x(m).add(M)},H.prototype.sub=function(m){return typeof m=="number"?this.subS(m):this.subM(m)},H.prototype.subS=function(m){for(let M=0;M<this.rows;M++)for(let j=0;j<this.columns;j++)this.set(M,j,this.get(M,j)-m);return this},H.prototype.subM=function(m){if(m=x.checkMatrix(m),this.rows!==m.rows||this.columns!==m.columns)throw new RangeError("Matrices dimensions must be equal");for(let M=0;M<this.rows;M++)for(let j=0;j<this.columns;j++)this.set(M,j,this.get(M,j)-m.get(M,j));return this},H.sub=function(m,M){return new x(m).sub(M)},H.prototype.subtract=H.prototype.sub,H.prototype.subtractS=H.prototype.subS,H.prototype.subtractM=H.prototype.subM,H.subtract=H.sub,H.prototype.mul=function(m){return typeof m=="number"?this.mulS(m):this.mulM(m)},H.prototype.mulS=function(m){for(let M=0;M<this.rows;M++)for(let j=0;j<this.columns;j++)this.set(M,j,this.get(M,j)*m);return this},H.prototype.mulM=function(m){if(m=x.checkMatrix(m),this.rows!==m.rows||this.columns!==m.columns)throw new RangeError("Matrices dimensions must be equal");for(let M=0;M<this.rows;M++)for(let j=0;j<this.columns;j++)this.set(M,j,this.get(M,j)*m.get(M,j));return this},H.mul=function(m,M){return new x(m).mul(M)},H.prototype.multiply=H.prototype.mul,H.prototype.multiplyS=H.prototype.mulS,H.prototype.multiplyM=H.prototype.mulM,H.multiply=H.mul,H.prototype.div=function(m){return typeof m=="number"?this.divS(m):this.divM(m)},H.prototype.divS=function(m){for(let M=0;M<this.rows;M++)for(let j=0;j<this.columns;j++)this.set(M,j,this.get(M,j)/m);return this},H.prototype.divM=function(m){if(m=x.checkMatrix(m),this.rows!==m.rows||this.columns!==m.columns)throw new RangeError("Matrices dimensions must be equal");for(let M=0;M<this.rows;M++)for(let j=0;j<this.columns;j++)this.set(M,j,this.get(M,j)/m.get(M,j));return this},H.div=function(m,M){return new x(m).div(M)},H.prototype.divide=H.prototype.div,H.prototype.divideS=H.prototype.divS,H.prototype.divideM=H.prototype.divM,H.divide=H.div,H.prototype.mod=function(m){return typeof m=="number"?this.modS(m):this.modM(m)},H.prototype.modS=function(m){for(let M=0;M<this.rows;M++)for(let j=0;j<this.columns;j++)this.set(M,j,this.get(M,j)%m);return this},H.prototype.modM=function(m){if(m=x.checkMatrix(m),this.rows!==m.rows||this.columns!==m.columns)throw new RangeError("Matrices dimensions must be equal");for(let M=0;M<this.rows;M++)for(let j=0;j<this.columns;j++)this.set(M,j,this.get(M,j)%m.get(M,j));return this},H.mod=function(m,M){return new x(m).mod(M)},H.prototype.modulus=H.prototype.mod,H.prototype.modulusS=H.prototype.modS,H.prototype.modulusM=H.prototype.modM,H.modulus=H.mod,H.prototype.and=function(m){return typeof m=="number"?this.andS(m):this.andM(m)},H.prototype.andS=function(m){for(let M=0;M<this.rows;M++)for(let j=0;j<this.columns;j++)this.set(M,j,this.get(M,j)&m);return this},H.prototype.andM=function(m){if(m=x.checkMatrix(m),this.rows!==m.rows||this.columns!==m.columns)throw new RangeError("Matrices dimensions must be equal");for(let M=0;M<this.rows;M++)for(let j=0;j<this.columns;j++)this.set(M,j,this.get(M,j)&m.get(M,j));return this},H.and=function(m,M){return new x(m).and(M)},H.prototype.or=function(m){return typeof m=="number"?this.orS(m):this.orM(m)},H.prototype.orS=function(m){for(let M=0;M<this.rows;M++)for(let j=0;j<this.columns;j++)this.set(M,j,this.get(M,j)|m);return this},H.prototype.orM=function(m){if(m=x.checkMatrix(m),this.rows!==m.rows||this.columns!==m.columns)throw new RangeError("Matrices dimensions must be equal");for(let M=0;M<this.rows;M++)for(let j=0;j<this.columns;j++)this.set(M,j,this.get(M,j)|m.get(M,j));return this},H.or=function(m,M){return new x(m).or(M)},H.prototype.xor=function(m){return typeof m=="number"?this.xorS(m):this.xorM(m)},H.prototype.xorS=function(m){for(let M=0;M<this.rows;M++)for(let j=0;j<this.columns;j++)this.set(M,j,this.get(M,j)^m);return this},H.prototype.xorM=function(m){if(m=x.checkMatrix(m),this.rows!==m.rows||this.columns!==m.columns)throw new RangeError("Matrices dimensions must be equal");for(let M=0;M<this.rows;M++)for(let j=0;j<this.columns;j++)this.set(M,j,this.get(M,j)^m.get(M,j));return this},H.xor=function(m,M){return new x(m).xor(M)},H.prototype.leftShift=function(m){return typeof m=="number"?this.leftShiftS(m):this.leftShiftM(m)},H.prototype.leftShiftS=function(m){for(let M=0;M<this.rows;M++)for(let j=0;j<this.columns;j++)this.set(M,j,this.get(M,j)<<m);return this},H.prototype.leftShiftM=function(m){if(m=x.checkMatrix(m),this.rows!==m.rows||this.columns!==m.columns)throw new RangeError("Matrices dimensions must be equal");for(let M=0;M<this.rows;M++)for(let j=0;j<this.columns;j++)this.set(M,j,this.get(M,j)<<m.get(M,j));return this},H.leftShift=function(m,M){return new x(m).leftShift(M)},H.prototype.signPropagatingRightShift=function(m){return typeof m=="number"?this.signPropagatingRightShiftS(m):this.signPropagatingRightShiftM(m)},H.prototype.signPropagatingRightShiftS=function(m){for(let M=0;M<this.rows;M++)for(let j=0;j<this.columns;j++)this.set(M,j,this.get(M,j)>>m);return this},H.prototype.signPropagatingRightShiftM=function(m){if(m=x.checkMatrix(m),this.rows!==m.rows||this.columns!==m.columns)throw new RangeError("Matrices dimensions must be equal");for(let M=0;M<this.rows;M++)for(let j=0;j<this.columns;j++)this.set(M,j,this.get(M,j)>>m.get(M,j));return this},H.signPropagatingRightShift=function(m,M){return new x(m).signPropagatingRightShift(M)},H.prototype.rightShift=function(m){return typeof m=="number"?this.rightShiftS(m):this.rightShiftM(m)},H.prototype.rightShiftS=function(m){for(let M=0;M<this.rows;M++)for(let j=0;j<this.columns;j++)this.set(M,j,this.get(M,j)>>>m);return this},H.prototype.rightShiftM=function(m){if(m=x.checkMatrix(m),this.rows!==m.rows||this.columns!==m.columns)throw new RangeError("Matrices dimensions must be equal");for(let M=0;M<this.rows;M++)for(let j=0;j<this.columns;j++)this.set(M,j,this.get(M,j)>>>m.get(M,j));return this},H.rightShift=function(m,M){return new x(m).rightShift(M)},H.prototype.zeroFillRightShift=H.prototype.rightShift,H.prototype.zeroFillRightShiftS=H.prototype.rightShiftS,H.prototype.zeroFillRightShiftM=H.prototype.rightShiftM,H.zeroFillRightShift=H.rightShift,H.prototype.not=function(){for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.set(m,M,~this.get(m,M));return this},H.not=function(m){return new x(m).not()},H.prototype.abs=function(){for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.set(m,M,Math.abs(this.get(m,M)));return this},H.abs=function(m){return new x(m).abs()},H.prototype.acos=function(){for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.set(m,M,Math.acos(this.get(m,M)));return this},H.acos=function(m){return new x(m).acos()},H.prototype.acosh=function(){for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.set(m,M,Math.acosh(this.get(m,M)));return this},H.acosh=function(m){return new x(m).acosh()},H.prototype.asin=function(){for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.set(m,M,Math.asin(this.get(m,M)));return this},H.asin=function(m){return new x(m).asin()},H.prototype.asinh=function(){for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.set(m,M,Math.asinh(this.get(m,M)));return this},H.asinh=function(m){return new x(m).asinh()},H.prototype.atan=function(){for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.set(m,M,Math.atan(this.get(m,M)));return this},H.atan=function(m){return new x(m).atan()},H.prototype.atanh=function(){for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.set(m,M,Math.atanh(this.get(m,M)));return this},H.atanh=function(m){return new x(m).atanh()},H.prototype.cbrt=function(){for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.set(m,M,Math.cbrt(this.get(m,M)));return this},H.cbrt=function(m){return new x(m).cbrt()},H.prototype.ceil=function(){for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.set(m,M,Math.ceil(this.get(m,M)));return this},H.ceil=function(m){return new x(m).ceil()},H.prototype.clz32=function(){for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.set(m,M,Math.clz32(this.get(m,M)));return this},H.clz32=function(m){return new x(m).clz32()},H.prototype.cos=function(){for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.set(m,M,Math.cos(this.get(m,M)));return this},H.cos=function(m){return new x(m).cos()},H.prototype.cosh=function(){for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.set(m,M,Math.cosh(this.get(m,M)));return this},H.cosh=function(m){return new x(m).cosh()},H.prototype.exp=function(){for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.set(m,M,Math.exp(this.get(m,M)));return this},H.exp=function(m){return new x(m).exp()},H.prototype.expm1=function(){for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.set(m,M,Math.expm1(this.get(m,M)));return this},H.expm1=function(m){return new x(m).expm1()},H.prototype.floor=function(){for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.set(m,M,Math.floor(this.get(m,M)));return this},H.floor=function(m){return new x(m).floor()},H.prototype.fround=function(){for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.set(m,M,Math.fround(this.get(m,M)));return this},H.fround=function(m){return new x(m).fround()},H.prototype.log=function(){for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.set(m,M,Math.log(this.get(m,M)));return this},H.log=function(m){return new x(m).log()},H.prototype.log1p=function(){for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.set(m,M,Math.log1p(this.get(m,M)));return this},H.log1p=function(m){return new x(m).log1p()},H.prototype.log10=function(){for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.set(m,M,Math.log10(this.get(m,M)));return this},H.log10=function(m){return new x(m).log10()},H.prototype.log2=function(){for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.set(m,M,Math.log2(this.get(m,M)));return this},H.log2=function(m){return new x(m).log2()},H.prototype.round=function(){for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.set(m,M,Math.round(this.get(m,M)));return this},H.round=function(m){return new x(m).round()},H.prototype.sign=function(){for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.set(m,M,Math.sign(this.get(m,M)));return this},H.sign=function(m){return new x(m).sign()},H.prototype.sin=function(){for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.set(m,M,Math.sin(this.get(m,M)));return this},H.sin=function(m){return new x(m).sin()},H.prototype.sinh=function(){for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.set(m,M,Math.sinh(this.get(m,M)));return this},H.sinh=function(m){return new x(m).sinh()},H.prototype.sqrt=function(){for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.set(m,M,Math.sqrt(this.get(m,M)));return this},H.sqrt=function(m){return new x(m).sqrt()},H.prototype.tan=function(){for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.set(m,M,Math.tan(this.get(m,M)));return this},H.tan=function(m){return new x(m).tan()},H.prototype.tanh=function(){for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.set(m,M,Math.tanh(this.get(m,M)));return this},H.tanh=function(m){return new x(m).tanh()},H.prototype.trunc=function(){for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.set(m,M,Math.trunc(this.get(m,M)));return this},H.trunc=function(m){return new x(m).trunc()},H.pow=function(m,M){return new x(m).pow(M)},H.prototype.pow=function(m){return typeof m=="number"?this.powS(m):this.powM(m)},H.prototype.powS=function(m){for(let M=0;M<this.rows;M++)for(let j=0;j<this.columns;j++)this.set(M,j,C(this.get(M,j),m));return this},H.prototype.powM=function(m){if(m=x.checkMatrix(m),this.rows!==m.rows||this.columns!==m.columns)throw new RangeError("Matrices dimensions must be equal");for(let M=0;M<this.rows;M++)for(let j=0;j<this.columns;j++)this.set(M,j,C(this.get(M,j),m.get(M,j)));return this}}function pt(H,x,w){let m=w?H.rows:H.rows-1;if(x<0||x>m)throw new RangeError("Row index out of range")}function xt(H,x,w){let m=w?H.columns:H.columns-1;if(x<0||x>m)throw new RangeError("Column index out of range")}function kt(H,x){if(x.to1DArray&&(x=x.to1DArray()),x.length!==H.columns)throw new RangeError("vector size must be the same as the number of columns");return x}function Gt(H,x){if(x.to1DArray&&(x=x.to1DArray()),x.length!==H.rows)throw new RangeError("vector size must be the same as the number of rows");return x}function jt(H,x){if(!et.isAnyArray(x))throw new TypeError("row indices must be an array");for(let w=0;w<x.length;w++)if(x[w]<0||x[w]>=H.rows)throw new RangeError("row indices are out of range")}function Ht(H,x){if(!et.isAnyArray(x))throw new TypeError("column indices must be an array");for(let w=0;w<x.length;w++)if(x[w]<0||x[w]>=H.columns)throw new RangeError("column indices are out of range")}function fe(H,x,w,m,M){if(arguments.length!==5)throw new RangeError("expected 4 arguments");if(Xe("startRow",x),Xe("endRow",w),Xe("startColumn",m),Xe("endColumn",M),x>w||m>M||x<0||x>=H.rows||w<0||w>=H.rows||m<0||m>=H.columns||M<0||M>=H.columns)throw new RangeError("Submatrix indices are out of range")}function we(H,x=0){let w=[];for(let m=0;m<H;m++)w.push(x);return w}function Xe(H,x){if(typeof x!="number")throw new TypeError(`${H} must be a number`)}function Hn(H){if(H.isEmpty())throw new Error("Empty matrix has no elements to index")}function Ei(H){let x=we(H.rows);for(let w=0;w<H.rows;++w)for(let m=0;m<H.columns;++m)x[w]+=H.get(w,m);return x}function Ra(H){let x=we(H.columns);for(let w=0;w<H.rows;++w)for(let m=0;m<H.columns;++m)x[m]+=H.get(w,m);return x}function cs(H){let x=0;for(let w=0;w<H.rows;w++)for(let m=0;m<H.columns;m++)x+=H.get(w,m);return x}function Rt(H){let x=we(H.rows,1);for(let w=0;w<H.rows;++w)for(let m=0;m<H.columns;++m)x[w]*=H.get(w,m);return x}function _t(H){let x=we(H.columns,1);for(let w=0;w<H.rows;++w)for(let m=0;m<H.columns;++m)x[m]*=H.get(w,m);return x}function Bt(H){let x=1;for(let w=0;w<H.rows;w++)for(let m=0;m<H.columns;m++)x*=H.get(w,m);return x}function dt(H,x,w){const m=H.rows,M=H.columns,j=[];for(let rt=0;rt<m;rt++){let nt=0,ot=0,lt=0;for(let Tt=0;Tt<M;Tt++)lt=H.get(rt,Tt)-w[rt],nt+=lt,ot+=lt*lt;x?j.push((ot-nt*nt/M)/(M-1)):j.push((ot-nt*nt/M)/M)}return j}function wt(H,x,w){const m=H.rows,M=H.columns,j=[];for(let rt=0;rt<M;rt++){let nt=0,ot=0,lt=0;for(let Tt=0;Tt<m;Tt++)lt=H.get(Tt,rt)-w[rt],nt+=lt,ot+=lt*lt;x?j.push((ot-nt*nt/m)/(m-1)):j.push((ot-nt*nt/m)/m)}return j}function Ot(H,x,w){const m=H.rows,M=H.columns,j=m*M;let rt=0,nt=0,ot=0;for(let lt=0;lt<m;lt++)for(let Tt=0;Tt<M;Tt++)ot=H.get(lt,Tt)-w,rt+=ot,nt+=ot*ot;return x?(nt-rt*rt/j)/(j-1):(nt-rt*rt/j)/j}function Zt(H,x){for(let w=0;w<H.rows;w++)for(let m=0;m<H.columns;m++)H.set(w,m,H.get(w,m)-x[w])}function ve(H,x){for(let w=0;w<H.rows;w++)for(let m=0;m<H.columns;m++)H.set(w,m,H.get(w,m)-x[m])}function Be(H,x){for(let w=0;w<H.rows;w++)for(let m=0;m<H.columns;m++)H.set(w,m,H.get(w,m)-x)}function ge(H){const x=[];for(let w=0;w<H.rows;w++){let m=0;for(let M=0;M<H.columns;M++)m+=C(H.get(w,M),2)/(H.columns-1);x.push(Math.sqrt(m))}return x}function ke(H,x){for(let w=0;w<H.rows;w++)for(let m=0;m<H.columns;m++)H.set(w,m,H.get(w,m)/x[w])}function Ve(H){const x=[];for(let w=0;w<H.columns;w++){let m=0;for(let M=0;M<H.rows;M++)m+=C(H.get(M,w),2)/(H.rows-1);x.push(Math.sqrt(m))}return x}function vn(H,x){for(let w=0;w<H.rows;w++)for(let m=0;m<H.columns;m++)H.set(w,m,H.get(w,m)/x[m])}function Ce(H){const x=H.size-1;let w=0;for(let m=0;m<H.columns;m++)for(let M=0;M<H.rows;M++)w+=C(H.get(M,m),2)/x;return Math.sqrt(w)}function Se(H,x){for(let w=0;w<H.rows;w++)for(let m=0;m<H.columns;m++)H.set(w,m,H.get(w,m)/x)}class ye{static from1DArray(x,w,m){if(x*w!==m.length)throw new RangeError("data length does not match given dimensions");let j=new ne(x,w);for(let rt=0;rt<x;rt++)for(let nt=0;nt<w;nt++)j.set(rt,nt,m[rt*w+nt]);return j}static rowVector(x){let w=new ne(1,x.length);for(let m=0;m<x.length;m++)w.set(0,m,x[m]);return w}static columnVector(x){let w=new ne(x.length,1);for(let m=0;m<x.length;m++)w.set(m,0,x[m]);return w}static zeros(x,w){return new ne(x,w)}static ones(x,w){return new ne(x,w).fill(1)}static rand(x,w,m={}){if(typeof m!="object")throw new TypeError("options must be an object");const{random:M=Math.random}=m;let j=new ne(x,w);for(let rt=0;rt<x;rt++)for(let nt=0;nt<w;nt++)j.set(rt,nt,M());return j}static randInt(x,w,m={}){if(typeof m!="object")throw new TypeError("options must be an object");const{min:M=0,max:j=1e3,random:rt=Math.random}=m;if(!Number.isInteger(M))throw new TypeError("min must be an integer");if(!Number.isInteger(j))throw new TypeError("max must be an integer");if(M>=j)throw new RangeError("min must be smaller than max");let nt=j-M,ot=new ne(x,w);for(let lt=0;lt<x;lt++)for(let Tt=0;Tt<w;Tt++){let vt=M+Math.round(rt()*nt);ot.set(lt,Tt,vt)}return ot}static eye(x,w,m){w===void 0&&(w=x),m===void 0&&(m=1);let M=Math.min(x,w),j=this.zeros(x,w);for(let rt=0;rt<M;rt++)j.set(rt,rt,m);return j}static diag(x,w,m){let M=x.length;w===void 0&&(w=M),m===void 0&&(m=w);let j=Math.min(M,w,m),rt=this.zeros(w,m);for(let nt=0;nt<j;nt++)rt.set(nt,nt,x[nt]);return rt}static min(x,w){x=this.checkMatrix(x),w=this.checkMatrix(w);let m=x.rows,M=x.columns,j=new ne(m,M);for(let rt=0;rt<m;rt++)for(let nt=0;nt<M;nt++)j.set(rt,nt,Math.min(x.get(rt,nt),w.get(rt,nt)));return j}static max(x,w){x=this.checkMatrix(x),w=this.checkMatrix(w);let m=x.rows,M=x.columns,j=new this(m,M);for(let rt=0;rt<m;rt++)for(let nt=0;nt<M;nt++)j.set(rt,nt,Math.max(x.get(rt,nt),w.get(rt,nt)));return j}static checkMatrix(x){return ye.isMatrix(x)?x:new ne(x)}static isMatrix(x){return x!=null&&x.klass==="Matrix"}get size(){return this.rows*this.columns}apply(x){if(typeof x!="function")throw new TypeError("callback must be a function");for(let w=0;w<this.rows;w++)for(let m=0;m<this.columns;m++)x.call(this,w,m);return this}to1DArray(){let x=[];for(let w=0;w<this.rows;w++)for(let m=0;m<this.columns;m++)x.push(this.get(w,m));return x}to2DArray(){let x=[];for(let w=0;w<this.rows;w++){x.push([]);for(let m=0;m<this.columns;m++)x[w].push(this.get(w,m))}return x}toJSON(){return this.to2DArray()}isRowVector(){return this.rows===1}isColumnVector(){return this.columns===1}isVector(){return this.rows===1||this.columns===1}isSquare(){return this.rows===this.columns}isEmpty(){return this.rows===0||this.columns===0}isSymmetric(){if(this.isSquare()){for(let x=0;x<this.rows;x++)for(let w=0;w<=x;w++)if(this.get(x,w)!==this.get(w,x))return!1;return!0}return!1}isDistance(){if(!this.isSymmetric())return!1;for(let x=0;x<this.rows;x++)if(this.get(x,x)!==0)return!1;return!0}isEchelonForm(){let x=0,w=0,m=-1,M=!0,j=!1;for(;x<this.rows&&M;){for(w=0,j=!1;w<this.columns&&j===!1;)this.get(x,w)===0?w++:this.get(x,w)===1&&w>m?(j=!0,m=w):(M=!1,j=!0);x++}return M}isReducedEchelonForm(){let x=0,w=0,m=-1,M=!0,j=!1;for(;x<this.rows&&M;){for(w=0,j=!1;w<this.columns&&j===!1;)this.get(x,w)===0?w++:this.get(x,w)===1&&w>m?(j=!0,m=w):(M=!1,j=!0);for(let rt=w+1;rt<this.rows;rt++)this.get(x,rt)!==0&&(M=!1);x++}return M}echelonForm(){let x=this.clone(),w=0,m=0;for(;w<x.rows&&m<x.columns;){let M=w;for(let j=w;j<x.rows;j++)x.get(j,m)>x.get(M,m)&&(M=j);if(x.get(M,m)===0)m++;else{x.swapRows(w,M);let j=x.get(w,m);for(let rt=m;rt<x.columns;rt++)x.set(w,rt,x.get(w,rt)/j);for(let rt=w+1;rt<x.rows;rt++){let nt=x.get(rt,m)/x.get(w,m);x.set(rt,m,0);for(let ot=m+1;ot<x.columns;ot++)x.set(rt,ot,x.get(rt,ot)-x.get(w,ot)*nt)}w++,m++}}return x}reducedEchelonForm(){let x=this.echelonForm(),w=x.columns,m=x.rows,M=m-1;for(;M>=0;)if(x.maxRow(M)===0)M--;else{let j=0,rt=!1;for(;j<m&&rt===!1;)x.get(M,j)===1?rt=!0:j++;for(let nt=0;nt<M;nt++){let ot=x.get(nt,j);for(let lt=j;lt<w;lt++){let Tt=x.get(nt,lt)-ot*x.get(M,lt);x.set(nt,lt,Tt)}}M--}return x}set(){throw new Error("set method is unimplemented")}get(){throw new Error("get method is unimplemented")}repeat(x={}){if(typeof x!="object")throw new TypeError("options must be an object");const{rows:w=1,columns:m=1}=x;if(!Number.isInteger(w)||w<=0)throw new TypeError("rows must be a positive integer");if(!Number.isInteger(m)||m<=0)throw new TypeError("columns must be a positive integer");let M=new ne(this.rows*w,this.columns*m);for(let j=0;j<w;j++)for(let rt=0;rt<m;rt++)M.setSubMatrix(this,this.rows*j,this.columns*rt);return M}fill(x){for(let w=0;w<this.rows;w++)for(let m=0;m<this.columns;m++)this.set(w,m,x);return this}neg(){return this.mulS(-1)}getRow(x){pt(this,x);let w=[];for(let m=0;m<this.columns;m++)w.push(this.get(x,m));return w}getRowVector(x){return ne.rowVector(this.getRow(x))}setRow(x,w){pt(this,x),w=kt(this,w);for(let m=0;m<this.columns;m++)this.set(x,m,w[m]);return this}swapRows(x,w){pt(this,x),pt(this,w);for(let m=0;m<this.columns;m++){let M=this.get(x,m);this.set(x,m,this.get(w,m)),this.set(w,m,M)}return this}getColumn(x){xt(this,x);let w=[];for(let m=0;m<this.rows;m++)w.push(this.get(m,x));return w}getColumnVector(x){return ne.columnVector(this.getColumn(x))}setColumn(x,w){xt(this,x),w=Gt(this,w);for(let m=0;m<this.rows;m++)this.set(m,x,w[m]);return this}swapColumns(x,w){xt(this,x),xt(this,w);for(let m=0;m<this.rows;m++){let M=this.get(m,x);this.set(m,x,this.get(m,w)),this.set(m,w,M)}return this}addRowVector(x){x=kt(this,x);for(let w=0;w<this.rows;w++)for(let m=0;m<this.columns;m++)this.set(w,m,this.get(w,m)+x[m]);return this}subRowVector(x){x=kt(this,x);for(let w=0;w<this.rows;w++)for(let m=0;m<this.columns;m++)this.set(w,m,this.get(w,m)-x[m]);return this}mulRowVector(x){x=kt(this,x);for(let w=0;w<this.rows;w++)for(let m=0;m<this.columns;m++)this.set(w,m,this.get(w,m)*x[m]);return this}divRowVector(x){x=kt(this,x);for(let w=0;w<this.rows;w++)for(let m=0;m<this.columns;m++)this.set(w,m,this.get(w,m)/x[m]);return this}addColumnVector(x){x=Gt(this,x);for(let w=0;w<this.rows;w++)for(let m=0;m<this.columns;m++)this.set(w,m,this.get(w,m)+x[w]);return this}subColumnVector(x){x=Gt(this,x);for(let w=0;w<this.rows;w++)for(let m=0;m<this.columns;m++)this.set(w,m,this.get(w,m)-x[w]);return this}mulColumnVector(x){x=Gt(this,x);for(let w=0;w<this.rows;w++)for(let m=0;m<this.columns;m++)this.set(w,m,this.get(w,m)*x[w]);return this}divColumnVector(x){x=Gt(this,x);for(let w=0;w<this.rows;w++)for(let m=0;m<this.columns;m++)this.set(w,m,this.get(w,m)/x[w]);return this}mulRow(x,w){pt(this,x);for(let m=0;m<this.columns;m++)this.set(x,m,this.get(x,m)*w);return this}mulColumn(x,w){xt(this,x);for(let m=0;m<this.rows;m++)this.set(m,x,this.get(m,x)*w);return this}max(x){if(this.isEmpty())return NaN;switch(x){case"row":{const w=new Array(this.rows).fill(Number.NEGATIVE_INFINITY);for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.get(m,M)>w[m]&&(w[m]=this.get(m,M));return w}case"column":{const w=new Array(this.columns).fill(Number.NEGATIVE_INFINITY);for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.get(m,M)>w[M]&&(w[M]=this.get(m,M));return w}case void 0:{let w=this.get(0,0);for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.get(m,M)>w&&(w=this.get(m,M));return w}default:throw new Error(`invalid option: ${x}`)}}maxIndex(){Hn(this);let x=this.get(0,0),w=[0,0];for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.get(m,M)>x&&(x=this.get(m,M),w[0]=m,w[1]=M);return w}min(x){if(this.isEmpty())return NaN;switch(x){case"row":{const w=new Array(this.rows).fill(Number.POSITIVE_INFINITY);for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.get(m,M)<w[m]&&(w[m]=this.get(m,M));return w}case"column":{const w=new Array(this.columns).fill(Number.POSITIVE_INFINITY);for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.get(m,M)<w[M]&&(w[M]=this.get(m,M));return w}case void 0:{let w=this.get(0,0);for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.get(m,M)<w&&(w=this.get(m,M));return w}default:throw new Error(`invalid option: ${x}`)}}minIndex(){Hn(this);let x=this.get(0,0),w=[0,0];for(let m=0;m<this.rows;m++)for(let M=0;M<this.columns;M++)this.get(m,M)<x&&(x=this.get(m,M),w[0]=m,w[1]=M);return w}maxRow(x){if(pt(this,x),this.isEmpty())return NaN;let w=this.get(x,0);for(let m=1;m<this.columns;m++)this.get(x,m)>w&&(w=this.get(x,m));return w}maxRowIndex(x){pt(this,x),Hn(this);let w=this.get(x,0),m=[x,0];for(let M=1;M<this.columns;M++)this.get(x,M)>w&&(w=this.get(x,M),m[1]=M);return m}minRow(x){if(pt(this,x),this.isEmpty())return NaN;let w=this.get(x,0);for(let m=1;m<this.columns;m++)this.get(x,m)<w&&(w=this.get(x,m));return w}minRowIndex(x){pt(this,x),Hn(this);let w=this.get(x,0),m=[x,0];for(let M=1;M<this.columns;M++)this.get(x,M)<w&&(w=this.get(x,M),m[1]=M);return m}maxColumn(x){if(xt(this,x),this.isEmpty())return NaN;let w=this.get(0,x);for(let m=1;m<this.rows;m++)this.get(m,x)>w&&(w=this.get(m,x));return w}maxColumnIndex(x){xt(this,x),Hn(this);let w=this.get(0,x),m=[0,x];for(let M=1;M<this.rows;M++)this.get(M,x)>w&&(w=this.get(M,x),m[0]=M);return m}minColumn(x){if(xt(this,x),this.isEmpty())return NaN;let w=this.get(0,x);for(let m=1;m<this.rows;m++)this.get(m,x)<w&&(w=this.get(m,x));return w}minColumnIndex(x){xt(this,x),Hn(this);let w=this.get(0,x),m=[0,x];for(let M=1;M<this.rows;M++)this.get(M,x)<w&&(w=this.get(M,x),m[0]=M);return m}diag(){let x=Math.min(this.rows,this.columns),w=[];for(let m=0;m<x;m++)w.push(this.get(m,m));return w}norm(x="frobenius"){switch(x){case"max":return this.max();case"frobenius":return Math.sqrt(this.dot(this));default:throw new RangeError(`unknown norm type: ${x}`)}}cumulativeSum(){let x=0;for(let w=0;w<this.rows;w++)for(let m=0;m<this.columns;m++)x+=this.get(w,m),this.set(w,m,x);return this}dot(x){ye.isMatrix(x)&&(x=x.to1DArray());let w=this.to1DArray();if(w.length!==x.length)throw new RangeError("vectors do not have the same size");let m=0;for(let M=0;M<w.length;M++)m+=w[M]*x[M];return m}mmul(x){x=ne.checkMatrix(x);let w=this.rows,m=this.columns,M=x.columns,j=new ne(w,M),rt=new Float64Array(m);for(let nt=0;nt<M;nt++){for(let ot=0;ot<m;ot++)rt[ot]=x.get(ot,nt);for(let ot=0;ot<w;ot++){let lt=0;for(let Tt=0;Tt<m;Tt++)lt+=this.get(ot,Tt)*rt[Tt];j.set(ot,nt,lt)}}return j}mpow(x){if(!this.isSquare())throw new RangeError("Matrix must be square");if(!Number.isInteger(x)||x<0)throw new RangeError("Exponent must be a non-negative integer");let w=ne.eye(this.rows),m=this;for(let M=x;M>=1;M/=2)M&1&&(w=w.mmul(m)),m=m.mmul(m);return w}strassen2x2(x){x=ne.checkMatrix(x);let w=new ne(2,2);const m=this.get(0,0),M=x.get(0,0),j=this.get(0,1),rt=x.get(0,1),nt=this.get(1,0),ot=x.get(1,0),lt=this.get(1,1),Tt=x.get(1,1),vt=(m+lt)*(M+Tt),Ft=(nt+lt)*M,qt=m*(rt-Tt),Lt=lt*(ot-M),Wt=(m+j)*Tt,se=(nt-m)*(M+rt),yt=(j-lt)*(ot+Tt),Qt=vt+Lt-Wt+yt,de=qt+Wt,Ae=Ft+Lt,oe=vt-Ft+qt+se;return w.set(0,0,Qt),w.set(0,1,de),w.set(1,0,Ae),w.set(1,1,oe),w}strassen3x3(x){x=ne.checkMatrix(x);let w=new ne(3,3);const m=this.get(0,0),M=this.get(0,1),j=this.get(0,2),rt=this.get(1,0),nt=this.get(1,1),ot=this.get(1,2),lt=this.get(2,0),Tt=this.get(2,1),vt=this.get(2,2),Ft=x.get(0,0),qt=x.get(0,1),Lt=x.get(0,2),Wt=x.get(1,0),se=x.get(1,1),yt=x.get(1,2),Qt=x.get(2,0),de=x.get(2,1),Ae=x.get(2,2),oe=(m+M+j-rt-nt-Tt-vt)*se,gn=(m-rt)*(-qt+se),me=nt*(-Ft+qt+Wt-se-yt-Qt+Ae),xe=(-m+rt+nt)*(Ft-qt+se),rn=(rt+nt)*(-Ft+qt),Et=m*Ft,Yt=(-m+lt+Tt)*(Ft-Lt+yt),ee=(-m+lt)*(Lt-yt),Kt=(lt+Tt)*(-Ft+Lt),pn=(m+M+j-nt-ot-lt-Tt)*yt,Re=Tt*(-Ft+Lt+Wt-se-yt-Qt+de),Je=(-j+Tt+vt)*(se+Qt-de),mn=(j-vt)*(se-de),ir=j*Qt,Hr=(Tt+vt)*(-Qt+de),_n=(-j+nt+ot)*(yt+Qt-Ae),Si=(j-ot)*(yt-Ae),hr=(nt+ot)*(-Qt+Ae),De=M*Wt,Qn=ot*de,Cr=rt*Lt,Nr=lt*qt,Nn=vt*Ae,rc=Et+ir+De,Sd=oe+xe+rn+Et+Je+ir+Hr,ro=Et+Yt+Kt+pn+ir+_n+hr,_a=gn+me+xe+Et+ir+_n+Si,io=gn+xe+rn+Et+Qn,Md=ir+_n+Si+hr+Cr,Ad=Et+Yt+ee+Re+Je+mn+ir,ds=Je+mn+ir+Hr+Nr,Xo=Et+Yt+ee+Kt+Nn;return w.set(0,0,rc),w.set(0,1,Sd),w.set(0,2,ro),w.set(1,0,_a),w.set(1,1,io),w.set(1,2,Md),w.set(2,0,Ad),w.set(2,1,ds),w.set(2,2,Xo),w}mmulStrassen(x){x=ne.checkMatrix(x);let w=this.clone(),m=w.rows,M=w.columns,j=x.rows,rt=x.columns;M!==j&&console.warn(`Multiplying ${m} x ${M} and ${j} x ${rt} matrix: dimensions do not match.`);function nt(vt,Ft,qt){let Lt=vt.rows,Wt=vt.columns;if(Lt===Ft&&Wt===qt)return vt;{let se=ye.zeros(Ft,qt);return se=se.setSubMatrix(vt,0,0),se}}let ot=Math.max(m,j),lt=Math.max(M,rt);w=nt(w,ot,lt),x=nt(x,ot,lt);function Tt(vt,Ft,qt,Lt){if(qt<=512||Lt<=512)return vt.mmul(Ft);qt%2===1&&Lt%2===1?(vt=nt(vt,qt+1,Lt+1),Ft=nt(Ft,qt+1,Lt+1)):qt%2===1?(vt=nt(vt,qt+1,Lt),Ft=nt(Ft,qt+1,Lt)):Lt%2===1&&(vt=nt(vt,qt,Lt+1),Ft=nt(Ft,qt,Lt+1));let Wt=parseInt(vt.rows/2,10),se=parseInt(vt.columns/2,10),yt=vt.subMatrix(0,Wt-1,0,se-1),Qt=Ft.subMatrix(0,Wt-1,0,se-1),de=vt.subMatrix(0,Wt-1,se,vt.columns-1),Ae=Ft.subMatrix(0,Wt-1,se,Ft.columns-1),oe=vt.subMatrix(Wt,vt.rows-1,0,se-1),gn=Ft.subMatrix(Wt,Ft.rows-1,0,se-1),me=vt.subMatrix(Wt,vt.rows-1,se,vt.columns-1),xe=Ft.subMatrix(Wt,Ft.rows-1,se,Ft.columns-1),rn=Tt(ye.add(yt,me),ye.add(Qt,xe),Wt,se),Et=Tt(ye.add(oe,me),Qt,Wt,se),Yt=Tt(yt,ye.sub(Ae,xe),Wt,se),ee=Tt(me,ye.sub(gn,Qt),Wt,se),Kt=Tt(ye.add(yt,de),xe,Wt,se),pn=Tt(ye.sub(oe,yt),ye.add(Qt,Ae),Wt,se),Re=Tt(ye.sub(de,me),ye.add(gn,xe),Wt,se),Je=ye.add(rn,ee);Je.sub(Kt),Je.add(Re);let mn=ye.add(Yt,Kt),ir=ye.add(Et,ee),Hr=ye.sub(rn,Et);Hr.add(Yt),Hr.add(pn);let _n=ye.zeros(2*Je.rows,2*Je.columns);return _n=_n.setSubMatrix(Je,0,0),_n=_n.setSubMatrix(mn,Je.rows,0),_n=_n.setSubMatrix(ir,0,Je.columns),_n=_n.setSubMatrix(Hr,Je.rows,Je.columns),_n.subMatrix(0,qt-1,0,Lt-1)}return Tt(w,x,ot,lt)}scaleRows(x={}){if(typeof x!="object")throw new TypeError("options must be an object");const{min:w=0,max:m=1}=x;if(!Number.isFinite(w))throw new TypeError("min must be a number");if(!Number.isFinite(m))throw new TypeError("max must be a number");if(w>=m)throw new RangeError("min must be smaller than max");let M=new ne(this.rows,this.columns);for(let j=0;j<this.rows;j++){const rt=this.getRow(j);rt.length>0&&tt(rt,{min:w,max:m,output:rt}),M.setRow(j,rt)}return M}scaleColumns(x={}){if(typeof x!="object")throw new TypeError("options must be an object");const{min:w=0,max:m=1}=x;if(!Number.isFinite(w))throw new TypeError("min must be a number");if(!Number.isFinite(m))throw new TypeError("max must be a number");if(w>=m)throw new RangeError("min must be smaller than max");let M=new ne(this.rows,this.columns);for(let j=0;j<this.columns;j++){const rt=this.getColumn(j);rt.length&&tt(rt,{min:w,max:m,output:rt}),M.setColumn(j,rt)}return M}flipRows(){const x=Math.ceil(this.columns/2);for(let w=0;w<this.rows;w++)for(let m=0;m<x;m++){let M=this.get(w,m),j=this.get(w,this.columns-1-m);this.set(w,m,j),this.set(w,this.columns-1-m,M)}return this}flipColumns(){const x=Math.ceil(this.rows/2);for(let w=0;w<this.columns;w++)for(let m=0;m<x;m++){let M=this.get(m,w),j=this.get(this.rows-1-m,w);this.set(m,w,j),this.set(this.rows-1-m,w,M)}return this}kroneckerProduct(x){x=ne.checkMatrix(x);let w=this.rows,m=this.columns,M=x.rows,j=x.columns,rt=new ne(w*M,m*j);for(let nt=0;nt<w;nt++)for(let ot=0;ot<m;ot++)for(let lt=0;lt<M;lt++)for(let Tt=0;Tt<j;Tt++)rt.set(M*nt+lt,j*ot+Tt,this.get(nt,ot)*x.get(lt,Tt));return rt}kroneckerSum(x){if(x=ne.checkMatrix(x),!this.isSquare()||!x.isSquare())throw new Error("Kronecker Sum needs two Square Matrices");let w=this.rows,m=x.rows,M=this.kroneckerProduct(ne.eye(m,m)),j=ne.eye(w,w).kroneckerProduct(x);return M.add(j)}transpose(){let x=new ne(this.columns,this.rows);for(let w=0;w<this.rows;w++)for(let m=0;m<this.columns;m++)x.set(m,w,this.get(w,m));return x}sortRows(x=Pe){for(let w=0;w<this.rows;w++)this.setRow(w,this.getRow(w).sort(x));return this}sortColumns(x=Pe){for(let w=0;w<this.columns;w++)this.setColumn(w,this.getColumn(w).sort(x));return this}subMatrix(x,w,m,M){fe(this,x,w,m,M);let j=new ne(w-x+1,M-m+1);for(let rt=x;rt<=w;rt++)for(let nt=m;nt<=M;nt++)j.set(rt-x,nt-m,this.get(rt,nt));return j}subMatrixRow(x,w,m){if(w===void 0&&(w=0),m===void 0&&(m=this.columns-1),w>m||w<0||w>=this.columns||m<0||m>=this.columns)throw new RangeError("Argument out of range");let M=new ne(x.length,m-w+1);for(let j=0;j<x.length;j++)for(let rt=w;rt<=m;rt++){if(x[j]<0||x[j]>=this.rows)throw new RangeError(`Row index out of range: ${x[j]}`);M.set(j,rt-w,this.get(x[j],rt))}return M}subMatrixColumn(x,w,m){if(w===void 0&&(w=0),m===void 0&&(m=this.rows-1),w>m||w<0||w>=this.rows||m<0||m>=this.rows)throw new RangeError("Argument out of range");let M=new ne(m-w+1,x.length);for(let j=0;j<x.length;j++)for(let rt=w;rt<=m;rt++){if(x[j]<0||x[j]>=this.columns)throw new RangeError(`Column index out of range: ${x[j]}`);M.set(rt-w,j,this.get(rt,x[j]))}return M}setSubMatrix(x,w,m){if(x=ne.checkMatrix(x),x.isEmpty())return this;let M=w+x.rows-1,j=m+x.columns-1;fe(this,w,M,m,j);for(let rt=0;rt<x.rows;rt++)for(let nt=0;nt<x.columns;nt++)this.set(w+rt,m+nt,x.get(rt,nt));return this}selection(x,w){jt(this,x),Ht(this,w);let m=new ne(x.length,w.length);for(let M=0;M<x.length;M++){let j=x[M];for(let rt=0;rt<w.length;rt++){let nt=w[rt];m.set(M,rt,this.get(j,nt))}}return m}trace(){let x=Math.min(this.rows,this.columns),w=0;for(let m=0;m<x;m++)w+=this.get(m,m);return w}clone(){return this.constructor.copy(this,new ne(this.rows,this.columns))}static copy(x,w){for(const[m,M,j]of x.entries())w.set(m,M,j);return w}sum(x){switch(x){case"row":return Ei(this);case"column":return Ra(this);case void 0:return cs(this);default:throw new Error(`invalid option: ${x}`)}}product(x){switch(x){case"row":return Rt(this);case"column":return _t(this);case void 0:return Bt(this);default:throw new Error(`invalid option: ${x}`)}}mean(x){const w=this.sum(x);switch(x){case"row":{for(let m=0;m<this.rows;m++)w[m]/=this.columns;return w}case"column":{for(let m=0;m<this.columns;m++)w[m]/=this.rows;return w}case void 0:return w/this.size;default:throw new Error(`invalid option: ${x}`)}}variance(x,w={}){if(typeof x=="object"&&(w=x,x=void 0),typeof w!="object")throw new TypeError("options must be an object");const{unbiased:m=!0,mean:M=this.mean(x)}=w;if(typeof m!="boolean")throw new TypeError("unbiased must be a boolean");switch(x){case"row":{if(!et.isAnyArray(M))throw new TypeError("mean must be an array");return dt(this,m,M)}case"column":{if(!et.isAnyArray(M))throw new TypeError("mean must be an array");return wt(this,m,M)}case void 0:{if(typeof M!="number")throw new TypeError("mean must be a number");return Ot(this,m,M)}default:throw new Error(`invalid option: ${x}`)}}standardDeviation(x,w){typeof x=="object"&&(w=x,x=void 0);const m=this.variance(x,w);if(x===void 0)return Math.sqrt(m);for(let M=0;M<m.length;M++)m[M]=Math.sqrt(m[M]);return m}center(x,w={}){if(typeof x=="object"&&(w=x,x=void 0),typeof w!="object")throw new TypeError("options must be an object");const{center:m=this.mean(x)}=w;switch(x){case"row":{if(!et.isAnyArray(m))throw new TypeError("center must be an array");return Zt(this,m),this}case"column":{if(!et.isAnyArray(m))throw new TypeError("center must be an array");return ve(this,m),this}case void 0:{if(typeof m!="number")throw new TypeError("center must be a number");return Be(this,m),this}default:throw new Error(`invalid option: ${x}`)}}scale(x,w={}){if(typeof x=="object"&&(w=x,x=void 0),typeof w!="object")throw new TypeError("options must be an object");let m=w.scale;switch(x){case"row":{if(m===void 0)m=ge(this);else if(!et.isAnyArray(m))throw new TypeError("scale must be an array");return ke(this,m),this}case"column":{if(m===void 0)m=Ve(this);else if(!et.isAnyArray(m))throw new TypeError("scale must be an array");return vn(this,m),this}case void 0:{if(m===void 0)m=Ce(this);else if(typeof m!="number")throw new TypeError("scale must be a number");return Se(this,m),this}default:throw new Error(`invalid option: ${x}`)}}toString(x){return ut(this,x)}[Symbol.iterator](){return this.entries()}*entries(){for(let x=0;x<this.rows;x++)for(let w=0;w<this.columns;w++)yield[x,w,this.get(x,w)]}*values(){for(let x=0;x<this.rows;x++)for(let w=0;w<this.columns;w++)yield this.get(x,w)}}ye.prototype.klass="Matrix",typeof Symbol!="undefined"&&(ye.prototype[Symbol.for("nodejs.util.inspect.custom")]=st);function Pe(H,x){return H-x}function mr(H){return H.every(x=>typeof x=="number")}ye.random=ye.rand,ye.randomInt=ye.randInt,ye.diagonal=ye.diag,ye.prototype.diagonal=ye.prototype.diag,ye.identity=ye.eye,ye.prototype.negate=ye.prototype.neg,ye.prototype.tensorProduct=ye.prototype.kroneckerProduct;const Sn=class J0 extends ye{constructor(x,w){if(super(),_(this,G),N(this,"data"),J0.isMatrix(x))L(this,G,K).call(this,x.rows,x.columns),J0.copy(x,this);else if(Number.isInteger(x)&&x>=0)L(this,G,K).call(this,x,w);else if(et.isAnyArray(x)){const m=x;if(x=m.length,w=x?m[0].length:0,typeof w!="number")throw new TypeError("Data must be a 2D array with at least one element");this.data=[];for(let M=0;M<x;M++){if(m[M].length!==w)throw new RangeError("Inconsistent array dimensions");if(!mr(m[M]))throw new TypeError("Input data contains non-numeric values");this.data.push(Float64Array.from(m[M]))}this.rows=x,this.columns=w}else throw new TypeError("First argument must be a positive number or an array")}set(x,w,m){return this.data[x][w]=m,this}get(x,w){return this.data[x][w]}removeRow(x){return pt(this,x),this.data.splice(x,1),this.rows-=1,this}addRow(x,w){return w===void 0&&(w=x,x=this.rows),pt(this,x,!0),w=Float64Array.from(kt(this,w)),this.data.splice(x,0,w),this.rows+=1,this}removeColumn(x){xt(this,x);for(let w=0;w<this.rows;w++){const m=new Float64Array(this.columns-1);for(let M=0;M<x;M++)m[M]=this.data[w][M];for(let M=x+1;M<this.columns;M++)m[M-1]=this.data[w][M];this.data[w]=m}return this.columns-=1,this}addColumn(x,w){typeof w=="undefined"&&(w=x,x=this.columns),xt(this,x,!0),w=Gt(this,w);for(let m=0;m<this.rows;m++){const M=new Float64Array(this.columns+1);let j=0;for(;j<x;j++)M[j]=this.data[m][j];for(M[j++]=w[m];j<this.columns+1;j++)M[j]=this.data[m][j-1];this.data[m]=M}return this.columns+=1,this}};G=new WeakSet,K=function(H,x){if(this.data=[],Number.isInteger(x)&&x>=0)for(let w=0;w<H;w++)this.data.push(new Float64Array(x));else throw new TypeError("nColumns must be a positive integer");this.rows=H,this.columns=x};let ne=Sn;Mt(ye,ne);const La=class $0 extends ye{constructor(x){if(super(),_(this,X),ne.isMatrix(x)){if(!x.isSymmetric())throw new TypeError("not symmetric data");I(this,X,ne.copy(x,new ne(x.rows,x.rows)))}else if(Number.isInteger(x)&&x>=0)I(this,X,new ne(x,x));else if(I(this,X,new ne(x)),!this.isSymmetric())throw new TypeError("not symmetric data")}get size(){return R(this,X).size}get rows(){return R(this,X).rows}get columns(){return R(this,X).columns}get diagonalSize(){return this.rows}static isSymmetricMatrix(x){return ne.isMatrix(x)&&x.klassType==="SymmetricMatrix"}static zeros(x){return new this(x)}static ones(x){return new this(x).fill(1)}clone(){const x=new $0(this.diagonalSize);for(const[w,m,M]of this.upperRightEntries())x.set(w,m,M);return x}toMatrix(){return new ne(this)}get(x,w){return R(this,X).get(x,w)}set(x,w,m){return R(this,X).set(x,w,m),R(this,X).set(w,x,m),this}removeCross(x){return R(this,X).removeRow(x),R(this,X).removeColumn(x),this}addCross(x,w){w===void 0&&(w=x,x=this.diagonalSize);const m=w.slice();return m.splice(x,1),R(this,X).addRow(x,m),R(this,X).addColumn(x,w),this}applyMask(x){if(x.length!==this.diagonalSize)throw new RangeError("Mask size do not match with matrix size");const w=[];for(const[m,M]of x.entries())M||w.push(m);w.reverse();for(const m of w)this.removeCross(m);return this}toCompact(){const{diagonalSize:x}=this,w=new Array(x*(x+1)/2);for(let m=0,M=0,j=0;j<w.length;j++)w[j]=this.get(M,m),++m>=x&&(m=++M);return w}static fromCompact(x){const w=x.length,m=(Math.sqrt(8*w+1)-1)/2;if(!Number.isInteger(m))throw new TypeError(`This array is not a compact representation of a Symmetric Matrix, ${JSON.stringify(x)}`);const M=new $0(m);for(let j=0,rt=0,nt=0;nt<w;nt++)M.set(j,rt,x[nt]),++j>=m&&(j=++rt);return M}*upperRightEntries(){for(let x=0,w=0;x<this.diagonalSize;void 0){const m=this.get(x,w);yield[x,w,m],++w>=this.diagonalSize&&(w=++x)}}*upperRightValues(){for(let x=0,w=0;x<this.diagonalSize;void 0)yield this.get(x,w),++w>=this.diagonalSize&&(w=++x)}};X=new WeakMap;let Br=La;Br.prototype.klassType="SymmetricMatrix";class Xn extends Br{static isDistanceMatrix(x){return Br.isSymmetricMatrix(x)&&x.klassSubType==="DistanceMatrix"}constructor(x){if(super(x),!this.isDistance())throw new TypeError("Provided arguments do no produce a distance matrix")}set(x,w,m){return x===w&&(m=0),super.set(x,w,m)}addCross(x,w){return w===void 0&&(w=x,x=this.diagonalSize),w=w.slice(),w[x]=0,super.addCross(x,w)}toSymmetricMatrix(){return new Br(this)}clone(){const x=new Xn(this.diagonalSize);for(const[w,m,M]of this.upperRightEntries())w!==m&&x.set(w,m,M);return x}toCompact(){const{diagonalSize:x}=this,w=(x-1)*x/2,m=new Array(w);for(let M=1,j=0,rt=0;rt<m.length;rt++)m[rt]=this.get(j,M),++M>=x&&(M=++j+1);return m}static fromCompact(x){const w=x.length;if(w===0)return new this(0);const m=(Math.sqrt(8*w+1)+1)/2;if(!Number.isInteger(m))throw new TypeError(`This array is not a compact representation of a DistanceMatrix, ${JSON.stringify(x)}`);const M=new this(m);for(let j=1,rt=0,nt=0;nt<w;nt++)M.set(j,rt,x[nt]),++j>=m&&(j=++rt+1);return M}}Xn.prototype.klassSubType="DistanceMatrix";class Fr extends ye{constructor(x,w,m){super(),this.matrix=x,this.rows=w,this.columns=m}}class us extends Fr{constructor(x,w){xt(x,w),super(x,x.rows,1),this.column=w}set(x,w,m){return this.matrix.set(x,this.column,m),this}get(x){return this.matrix.get(x,this.column)}}class $l extends Fr{constructor(x,w){Ht(x,w),super(x,x.rows,w.length),this.columnIndices=w}set(x,w,m){return this.matrix.set(x,this.columnIndices[w],m),this}get(x,w){return this.matrix.get(x,this.columnIndices[w])}}class Zo extends Fr{constructor(x){super(x,x.rows,x.columns)}set(x,w,m){return this.matrix.set(x,this.columns-w-1,m),this}get(x,w){return this.matrix.get(x,this.columns-w-1)}}class pa extends Fr{constructor(x){super(x,x.rows,x.columns)}set(x,w,m){return this.matrix.set(this.rows-x-1,w,m),this}get(x,w){return this.matrix.get(this.rows-x-1,w)}}class Ji extends Fr{constructor(x,w){pt(x,w),super(x,1,x.columns),this.row=w}set(x,w,m){return this.matrix.set(this.row,w,m),this}get(x,w){return this.matrix.get(this.row,w)}}class eo extends Fr{constructor(x,w){jt(x,w),super(x,w.length,x.columns),this.rowIndices=w}set(x,w,m){return this.matrix.set(this.rowIndices[x],w,m),this}get(x,w){return this.matrix.get(this.rowIndices[x],w)}}class hs extends Fr{constructor(x,w,m){jt(x,w),Ht(x,m),super(x,w.length,m.length),this.rowIndices=w,this.columnIndices=m}set(x,w,m){return this.matrix.set(this.rowIndices[x],this.columnIndices[w],m),this}get(x,w){return this.matrix.get(this.rowIndices[x],this.columnIndices[w])}}class Vo extends Fr{constructor(x,w,m,M,j){fe(x,w,m,M,j),super(x,m-w+1,j-M+1),this.startRow=w,this.startColumn=M}set(x,w,m){return this.matrix.set(this.startRow+x,this.startColumn+w,m),this}get(x,w){return this.matrix.get(this.startRow+x,this.startColumn+w)}}class si extends Fr{constructor(x){super(x,x.columns,x.rows)}set(x,w,m){return this.matrix.set(w,x,m),this}get(x,w){return this.matrix.get(w,x)}}class Di extends ye{constructor(x,w={}){const{rows:m=1}=w;if(x.length%m!==0)throw new Error("the data length is not divisible by the number of rows");super(),this.rows=m,this.columns=x.length/m,this.data=x}set(x,w,m){let M=this._calculateIndex(x,w);return this.data[M]=m,this}get(x,w){let m=this._calculateIndex(x,w);return this.data[m]}_calculateIndex(x,w){return x*this.columns+w}}class Or extends ye{constructor(x){super(),this.data=x,this.rows=x.length,this.columns=x[0].length}set(x,w,m){return this.data[x][w]=m,this}get(x,w){return this.data[x][w]}}function tg(H,x){if(et.isAnyArray(H))return H[0]&&et.isAnyArray(H[0])?new Or(H):new Di(H,x);throw new Error("the argument is not an array")}class Uo{constructor(x){x=Or.checkMatrix(x);let w=x.clone(),m=w.rows,M=w.columns,j=new Float64Array(m),rt=1,nt,ot,lt,Tt,vt,Ft,qt,Lt,Wt;for(nt=0;nt<m;nt++)j[nt]=nt;for(Lt=new Float64Array(m),ot=0;ot<M;ot++){for(nt=0;nt<m;nt++)Lt[nt]=w.get(nt,ot);for(nt=0;nt<m;nt++){for(Wt=Math.min(nt,ot),vt=0,lt=0;lt<Wt;lt++)vt+=w.get(nt,lt)*Lt[lt];Lt[nt]-=vt,w.set(nt,ot,Lt[nt])}for(Tt=ot,nt=ot+1;nt<m;nt++)Math.abs(Lt[nt])>Math.abs(Lt[Tt])&&(Tt=nt);if(Tt!==ot){for(lt=0;lt<M;lt++)Ft=w.get(Tt,lt),w.set(Tt,lt,w.get(ot,lt)),w.set(ot,lt,Ft);qt=j[Tt],j[Tt]=j[ot],j[ot]=qt,rt=-rt}if(ot<m&&w.get(ot,ot)!==0)for(nt=ot+1;nt<m;nt++)w.set(nt,ot,w.get(nt,ot)/w.get(ot,ot))}this.LU=w,this.pivotVector=j,this.pivotSign=rt}isSingular(){let x=this.LU,w=x.columns;for(let m=0;m<w;m++)if(x.get(m,m)===0)return!0;return!1}solve(x){x=ne.checkMatrix(x);let w=this.LU;if(w.rows!==x.rows)throw new Error("Invalid matrix dimensions");if(this.isSingular())throw new Error("LU matrix is singular");let M=x.columns,j=x.subMatrixRow(this.pivotVector,0,M-1),rt=w.columns,nt,ot,lt;for(lt=0;lt<rt;lt++)for(nt=lt+1;nt<rt;nt++)for(ot=0;ot<M;ot++)j.set(nt,ot,j.get(nt,ot)-j.get(lt,ot)*w.get(nt,lt));for(lt=rt-1;lt>=0;lt--){for(ot=0;ot<M;ot++)j.set(lt,ot,j.get(lt,ot)/w.get(lt,lt));for(nt=0;nt<lt;nt++)for(ot=0;ot<M;ot++)j.set(nt,ot,j.get(nt,ot)-j.get(lt,ot)*w.get(nt,lt))}return j}get determinant(){let x=this.LU;if(!x.isSquare())throw new Error("Matrix must be square");let w=this.pivotSign,m=x.columns;for(let M=0;M<m;M++)w*=x.get(M,M);return w}get lowerTriangularMatrix(){let x=this.LU,w=x.rows,m=x.columns,M=new ne(w,m);for(let j=0;j<w;j++)for(let rt=0;rt<m;rt++)j>rt?M.set(j,rt,x.get(j,rt)):j===rt?M.set(j,rt,1):M.set(j,rt,0);return M}get upperTriangularMatrix(){let x=this.LU,w=x.rows,m=x.columns,M=new ne(w,m);for(let j=0;j<w;j++)for(let rt=0;rt<m;rt++)j<=rt?M.set(j,rt,x.get(j,rt)):M.set(j,rt,0);return M}get pivotPermutationVector(){return Array.from(this.pivotVector)}}function Kn(H,x){let w=0;return Math.abs(H)>Math.abs(x)?(w=x/H,Math.abs(H)*Math.sqrt(1+w*w)):x!==0?(w=H/x,Math.abs(x)*Math.sqrt(1+w*w)):0}class Yo{constructor(x){x=Or.checkMatrix(x);let w=x.clone(),m=x.rows,M=x.columns,j=new Float64Array(M),rt,nt,ot,lt;for(ot=0;ot<M;ot++){let Tt=0;for(rt=ot;rt<m;rt++)Tt=Kn(Tt,w.get(rt,ot));if(Tt!==0){for(w.get(ot,ot)<0&&(Tt=-Tt),rt=ot;rt<m;rt++)w.set(rt,ot,w.get(rt,ot)/Tt);for(w.set(ot,ot,w.get(ot,ot)+1),nt=ot+1;nt<M;nt++){for(lt=0,rt=ot;rt<m;rt++)lt+=w.get(rt,ot)*w.get(rt,nt);for(lt=-lt/w.get(ot,ot),rt=ot;rt<m;rt++)w.set(rt,nt,w.get(rt,nt)+lt*w.get(rt,ot))}}j[ot]=-Tt}this.QR=w,this.Rdiag=j}solve(x){x=ne.checkMatrix(x);let w=this.QR,m=w.rows;if(x.rows!==m)throw new Error("Matrix row dimensions must agree");if(!this.isFullRank())throw new Error("Matrix is rank deficient");let M=x.columns,j=x.clone(),rt=w.columns,nt,ot,lt,Tt;for(lt=0;lt<rt;lt++)for(ot=0;ot<M;ot++){for(Tt=0,nt=lt;nt<m;nt++)Tt+=w.get(nt,lt)*j.get(nt,ot);for(Tt=-Tt/w.get(lt,lt),nt=lt;nt<m;nt++)j.set(nt,ot,j.get(nt,ot)+Tt*w.get(nt,lt))}for(lt=rt-1;lt>=0;lt--){for(ot=0;ot<M;ot++)j.set(lt,ot,j.get(lt,ot)/this.Rdiag[lt]);for(nt=0;nt<lt;nt++)for(ot=0;ot<M;ot++)j.set(nt,ot,j.get(nt,ot)-j.get(lt,ot)*w.get(nt,lt))}return j.subMatrix(0,rt-1,0,M-1)}isFullRank(){let x=this.QR.columns;for(let w=0;w<x;w++)if(this.Rdiag[w]===0)return!1;return!0}get upperTriangularMatrix(){let x=this.QR,w=x.columns,m=new ne(w,w),M,j;for(M=0;M<w;M++)for(j=0;j<w;j++)M<j?m.set(M,j,x.get(M,j)):M===j?m.set(M,j,this.Rdiag[M]):m.set(M,j,0);return m}get orthogonalMatrix(){let x=this.QR,w=x.rows,m=x.columns,M=new ne(w,m),j,rt,nt,ot;for(nt=m-1;nt>=0;nt--){for(j=0;j<w;j++)M.set(j,nt,0);for(M.set(nt,nt,1),rt=nt;rt<m;rt++)if(x.get(nt,nt)!==0){for(ot=0,j=nt;j<w;j++)ot+=x.get(j,nt)*M.get(j,rt);for(ot=-ot/x.get(nt,nt),j=nt;j<w;j++)M.set(j,rt,M.get(j,rt)+ot*x.get(j,nt))}}return M}}class wi{constructor(x,w={}){if(x=Or.checkMatrix(x),x.isEmpty())throw new Error("Matrix must be non-empty");let m=x.rows,M=x.columns;const{computeLeftSingularVectors:j=!0,computeRightSingularVectors:rt=!0,autoTranspose:nt=!1}=w;let ot=!!j,lt=!!rt,Tt=!1,vt;if(m<M)if(!nt)vt=x.clone(),console.warn("Computing SVD on a matrix with more columns than rows. Consider enabling autoTranspose");else{vt=x.transpose(),m=vt.rows,M=vt.columns,Tt=!0;let Et=ot;ot=lt,lt=Et}else vt=x.clone();let Ft=Math.min(m,M),qt=Math.min(m+1,M),Lt=new Float64Array(qt),Wt=new ne(m,Ft),se=new ne(M,M),yt=new Float64Array(M),Qt=new Float64Array(m),de=new Float64Array(qt);for(let Et=0;Et<qt;Et++)de[Et]=Et;let Ae=Math.min(m-1,M),oe=Math.max(0,Math.min(M-2,m)),gn=Math.max(Ae,oe);for(let Et=0;Et<gn;Et++){if(Et<Ae){Lt[Et]=0;for(let Yt=Et;Yt<m;Yt++)Lt[Et]=Kn(Lt[Et],vt.get(Yt,Et));if(Lt[Et]!==0){vt.get(Et,Et)<0&&(Lt[Et]=-Lt[Et]);for(let Yt=Et;Yt<m;Yt++)vt.set(Yt,Et,vt.get(Yt,Et)/Lt[Et]);vt.set(Et,Et,vt.get(Et,Et)+1)}Lt[Et]=-Lt[Et]}for(let Yt=Et+1;Yt<M;Yt++){if(Et<Ae&&Lt[Et]!==0){let ee=0;for(let Kt=Et;Kt<m;Kt++)ee+=vt.get(Kt,Et)*vt.get(Kt,Yt);ee=-ee/vt.get(Et,Et);for(let Kt=Et;Kt<m;Kt++)vt.set(Kt,Yt,vt.get(Kt,Yt)+ee*vt.get(Kt,Et))}yt[Yt]=vt.get(Et,Yt)}if(ot&&Et<Ae)for(let Yt=Et;Yt<m;Yt++)Wt.set(Yt,Et,vt.get(Yt,Et));if(Et<oe){yt[Et]=0;for(let Yt=Et+1;Yt<M;Yt++)yt[Et]=Kn(yt[Et],yt[Yt]);if(yt[Et]!==0){yt[Et+1]<0&&(yt[Et]=0-yt[Et]);for(let Yt=Et+1;Yt<M;Yt++)yt[Yt]/=yt[Et];yt[Et+1]+=1}if(yt[Et]=-yt[Et],Et+1<m&&yt[Et]!==0){for(let Yt=Et+1;Yt<m;Yt++)Qt[Yt]=0;for(let Yt=Et+1;Yt<m;Yt++)for(let ee=Et+1;ee<M;ee++)Qt[Yt]+=yt[ee]*vt.get(Yt,ee);for(let Yt=Et+1;Yt<M;Yt++){let ee=-yt[Yt]/yt[Et+1];for(let Kt=Et+1;Kt<m;Kt++)vt.set(Kt,Yt,vt.get(Kt,Yt)+ee*Qt[Kt])}}if(lt)for(let Yt=Et+1;Yt<M;Yt++)se.set(Yt,Et,yt[Yt])}}let me=Math.min(M,m+1);if(Ae<M&&(Lt[Ae]=vt.get(Ae,Ae)),m<me&&(Lt[me-1]=0),oe+1<me&&(yt[oe]=vt.get(oe,me-1)),yt[me-1]=0,ot){for(let Et=Ae;Et<Ft;Et++){for(let Yt=0;Yt<m;Yt++)Wt.set(Yt,Et,0);Wt.set(Et,Et,1)}for(let Et=Ae-1;Et>=0;Et--)if(Lt[Et]!==0){for(let Yt=Et+1;Yt<Ft;Yt++){let ee=0;for(let Kt=Et;Kt<m;Kt++)ee+=Wt.get(Kt,Et)*Wt.get(Kt,Yt);ee=-ee/Wt.get(Et,Et);for(let Kt=Et;Kt<m;Kt++)Wt.set(Kt,Yt,Wt.get(Kt,Yt)+ee*Wt.get(Kt,Et))}for(let Yt=Et;Yt<m;Yt++)Wt.set(Yt,Et,-Wt.get(Yt,Et));Wt.set(Et,Et,1+Wt.get(Et,Et));for(let Yt=0;Yt<Et-1;Yt++)Wt.set(Yt,Et,0)}else{for(let Yt=0;Yt<m;Yt++)Wt.set(Yt,Et,0);Wt.set(Et,Et,1)}}if(lt)for(let Et=M-1;Et>=0;Et--){if(Et<oe&&yt[Et]!==0)for(let Yt=Et+1;Yt<M;Yt++){let ee=0;for(let Kt=Et+1;Kt<M;Kt++)ee+=se.get(Kt,Et)*se.get(Kt,Yt);ee=-ee/se.get(Et+1,Et);for(let Kt=Et+1;Kt<M;Kt++)se.set(Kt,Yt,se.get(Kt,Yt)+ee*se.get(Kt,Et))}for(let Yt=0;Yt<M;Yt++)se.set(Yt,Et,0);se.set(Et,Et,1)}let xe=me-1,rn=Number.EPSILON;for(;me>0;){let Et,Yt;for(Et=me-2;Et>=-1&&Et!==-1;Et--){const ee=Number.MIN_VALUE+rn*Math.abs(Lt[Et]+Math.abs(Lt[Et+1]));if(Math.abs(yt[Et])<=ee||Number.isNaN(yt[Et])){yt[Et]=0;break}}if(Et===me-2)Yt=4;else{let ee;for(ee=me-1;ee>=Et&&ee!==Et;ee--){let Kt=(ee!==me?Math.abs(yt[ee]):0)+(ee!==Et+1?Math.abs(yt[ee-1]):0);if(Math.abs(Lt[ee])<=rn*Kt){Lt[ee]=0;break}}ee===Et?Yt=3:ee===me-1?Yt=1:(Yt=2,Et=ee)}switch(Et++,Yt){case 1:{let ee=yt[me-2];yt[me-2]=0;for(let Kt=me-2;Kt>=Et;Kt--){let pn=Kn(Lt[Kt],ee),Re=Lt[Kt]/pn,Je=ee/pn;if(Lt[Kt]=pn,Kt!==Et&&(ee=-Je*yt[Kt-1],yt[Kt-1]=Re*yt[Kt-1]),lt)for(let mn=0;mn<M;mn++)pn=Re*se.get(mn,Kt)+Je*se.get(mn,me-1),se.set(mn,me-1,-Je*se.get(mn,Kt)+Re*se.get(mn,me-1)),se.set(mn,Kt,pn)}break}case 2:{let ee=yt[Et-1];yt[Et-1]=0;for(let Kt=Et;Kt<me;Kt++){let pn=Kn(Lt[Kt],ee),Re=Lt[Kt]/pn,Je=ee/pn;if(Lt[Kt]=pn,ee=-Je*yt[Kt],yt[Kt]=Re*yt[Kt],ot)for(let mn=0;mn<m;mn++)pn=Re*Wt.get(mn,Kt)+Je*Wt.get(mn,Et-1),Wt.set(mn,Et-1,-Je*Wt.get(mn,Kt)+Re*Wt.get(mn,Et-1)),Wt.set(mn,Kt,pn)}break}case 3:{const ee=Math.max(Math.abs(Lt[me-1]),Math.abs(Lt[me-2]),Math.abs(yt[me-2]),Math.abs(Lt[Et]),Math.abs(yt[Et])),Kt=Lt[me-1]/ee,pn=Lt[me-2]/ee,Re=yt[me-2]/ee,Je=Lt[Et]/ee,mn=yt[Et]/ee,ir=((pn+Kt)*(pn-Kt)+Re*Re)/2,Hr=Kt*Re*(Kt*Re);let _n=0;(ir!==0||Hr!==0)&&(ir<0?_n=0-Math.sqrt(ir*ir+Hr):_n=Math.sqrt(ir*ir+Hr),_n=Hr/(ir+_n));let Si=(Je+Kt)*(Je-Kt)+_n,hr=Je*mn;for(let De=Et;De<me-1;De++){let Qn=Kn(Si,hr);Qn===0&&(Qn=Number.MIN_VALUE);let Cr=Si/Qn,Nr=hr/Qn;if(De!==Et&&(yt[De-1]=Qn),Si=Cr*Lt[De]+Nr*yt[De],yt[De]=Cr*yt[De]-Nr*Lt[De],hr=Nr*Lt[De+1],Lt[De+1]=Cr*Lt[De+1],lt)for(let Nn=0;Nn<M;Nn++)Qn=Cr*se.get(Nn,De)+Nr*se.get(Nn,De+1),se.set(Nn,De+1,-Nr*se.get(Nn,De)+Cr*se.get(Nn,De+1)),se.set(Nn,De,Qn);if(Qn=Kn(Si,hr),Qn===0&&(Qn=Number.MIN_VALUE),Cr=Si/Qn,Nr=hr/Qn,Lt[De]=Qn,Si=Cr*yt[De]+Nr*Lt[De+1],Lt[De+1]=-Nr*yt[De]+Cr*Lt[De+1],hr=Nr*yt[De+1],yt[De+1]=Cr*yt[De+1],ot&&De<m-1)for(let Nn=0;Nn<m;Nn++)Qn=Cr*Wt.get(Nn,De)+Nr*Wt.get(Nn,De+1),Wt.set(Nn,De+1,-Nr*Wt.get(Nn,De)+Cr*Wt.get(Nn,De+1)),Wt.set(Nn,De,Qn)}yt[me-2]=Si;break}case 4:{if(Lt[Et]<=0&&(Lt[Et]=Lt[Et]<0?-Lt[Et]:0,lt))for(let ee=0;ee<=xe;ee++)se.set(ee,Et,-se.get(ee,Et));for(;Et<xe&&!(Lt[Et]>=Lt[Et+1]);){let ee=Lt[Et];if(Lt[Et]=Lt[Et+1],Lt[Et+1]=ee,lt&&Et<M-1)for(let Kt=0;Kt<M;Kt++)ee=se.get(Kt,Et+1),se.set(Kt,Et+1,se.get(Kt,Et)),se.set(Kt,Et,ee);if(ot&&Et<m-1)for(let Kt=0;Kt<m;Kt++)ee=Wt.get(Kt,Et+1),Wt.set(Kt,Et+1,Wt.get(Kt,Et)),Wt.set(Kt,Et,ee);Et++}me--;break}}}if(Tt){let Et=se;se=Wt,Wt=Et}this.m=m,this.n=M,this.s=Lt,this.U=Wt,this.V=se}solve(x){let w=x,m=this.threshold,M=this.s.length,j=ne.zeros(M,M);for(let Ft=0;Ft<M;Ft++)Math.abs(this.s[Ft])<=m?j.set(Ft,Ft,0):j.set(Ft,Ft,1/this.s[Ft]);let rt=this.U,nt=this.rightSingularVectors,ot=nt.mmul(j),lt=nt.rows,Tt=rt.rows,vt=ne.zeros(lt,Tt);for(let Ft=0;Ft<lt;Ft++)for(let qt=0;qt<Tt;qt++){let Lt=0;for(let Wt=0;Wt<M;Wt++)Lt+=ot.get(Ft,Wt)*rt.get(qt,Wt);vt.set(Ft,qt,Lt)}return vt.mmul(w)}solveForDiagonal(x){return this.solve(ne.diag(x))}inverse(){let x=this.V,w=this.threshold,m=x.rows,M=x.columns,j=new ne(m,this.s.length);for(let Tt=0;Tt<m;Tt++)for(let vt=0;vt<M;vt++)Math.abs(this.s[vt])>w&&j.set(Tt,vt,x.get(Tt,vt)/this.s[vt]);let rt=this.U,nt=rt.rows,ot=rt.columns,lt=new ne(m,nt);for(let Tt=0;Tt<m;Tt++)for(let vt=0;vt<nt;vt++){let Ft=0;for(let qt=0;qt<ot;qt++)Ft+=j.get(Tt,qt)*rt.get(vt,qt);lt.set(Tt,vt,Ft)}return lt}get condition(){return this.s[0]/this.s[Math.min(this.m,this.n)-1]}get norm2(){return this.s[0]}get rank(){let x=Math.max(this.m,this.n)*this.s[0]*Number.EPSILON,w=0,m=this.s;for(let M=0,j=m.length;M<j;M++)m[M]>x&&w++;return w}get diagonal(){return Array.from(this.s)}get threshold(){return Number.EPSILON/2*Math.max(this.m,this.n)*this.s[0]}get leftSingularVectors(){return this.U}get rightSingularVectors(){return this.V}get diagonalMatrix(){return ne.diag(this.s)}}function xd(H,x=!1){return H=Or.checkMatrix(H),x?new wi(H).inverse():tc(H,ne.eye(H.rows))}function tc(H,x,w=!1){return H=Or.checkMatrix(H),x=Or.checkMatrix(x),w?new wi(H).solve(x):H.isSquare()?new Uo(H).solve(x):new Yo(H).solve(x)}function no(H){if(H=ne.checkMatrix(H),H.isSquare()){if(H.columns===0)return 1;let x,w,m,M;if(H.columns===2)return x=H.get(0,0),w=H.get(0,1),m=H.get(1,0),M=H.get(1,1),x*M-w*m;if(H.columns===3){let j,rt,nt;return j=new hs(H,[1,2],[1,2]),rt=new hs(H,[1,2],[0,2]),nt=new hs(H,[1,2],[0,1]),x=H.get(0,0),w=H.get(0,1),m=H.get(0,2),x*no(j)-w*no(rt)+m*no(nt)}else return new Uo(H).determinant}else throw Error("determinant can only be calculated for a square matrix")}function eg(H,x){let w=[];for(let m=0;m<H;m++)m!==x&&w.push(m);return w}function ng(H,x,w,m=1e-9,M=1e-9){if(H>M)return new Array(x.rows+1).fill(0);{let j=x.addRow(w,[0]);for(let rt=0;rt<j.rows;rt++)Math.abs(j.get(rt,0))<m&&j.set(rt,0,0);return j.to1DArray()}}function rg(H,x={}){const{thresholdValue:w=1e-9,thresholdError:m=1e-9}=x;H=ne.checkMatrix(H);let M=H.rows,j=new ne(M,M);for(let rt=0;rt<M;rt++){let nt=ne.columnVector(H.getRow(rt)),ot=H.subMatrixRow(eg(M,rt)).transpose(),Tt=new wi(ot).solve(nt),vt=ne.sub(nt,ot.mmul(Tt)).abs().max();j.setRow(rt,ng(vt,Tt,rt,w,m))}return j}function ig(H,x=Number.EPSILON){if(H=ne.checkMatrix(H),H.isEmpty())return H.transpose();let w=new wi(H,{autoTranspose:!0}),m=w.leftSingularVectors,M=w.rightSingularVectors,j=w.diagonal;for(let rt=0;rt<j.length;rt++)Math.abs(j[rt])>x?j[rt]=1/j[rt]:j[rt]=0;return M.mmul(ne.diag(j).mmul(m.transpose()))}function ag(H,x=H,w={}){H=new ne(H);let m=!1;if(typeof x=="object"&&!ne.isMatrix(x)&&!et.isAnyArray(x)?(w=x,x=H,m=!0):x=new ne(x),H.rows!==x.rows)throw new TypeError("Both matrices must have the same number of rows");const{center:M=!0}=w;M&&(H=H.center("column"),m||(x=x.center("column")));const j=H.transpose().mmul(x);for(let rt=0;rt<j.rows;rt++)for(let nt=0;nt<j.columns;nt++)j.set(rt,nt,j.get(rt,nt)*(1/(H.rows-1)));return j}function sg(H,x=H,w={}){H=new ne(H);let m=!1;if(typeof x=="object"&&!ne.isMatrix(x)&&!et.isAnyArray(x)?(w=x,x=H,m=!0):x=new ne(x),H.rows!==x.rows)throw new TypeError("Both matrices must have the same number of rows");const{center:M=!0,scale:j=!0}=w;M&&(H.center("column"),m||x.center("column")),j&&(H.scale("column"),m||x.scale("column"));const rt=H.standardDeviation("column",{unbiased:!0}),nt=m?rt:x.standardDeviation("column",{unbiased:!0}),ot=H.transpose().mmul(x);for(let lt=0;lt<ot.rows;lt++)for(let Tt=0;Tt<ot.columns;Tt++)ot.set(lt,Tt,ot.get(lt,Tt)*(1/(rt[lt]*nt[Tt]))*(1/(H.rows-1)));return ot}class Ed{constructor(x,w={}){const{assumeSymmetric:m=!1}=w;if(x=Or.checkMatrix(x),!x.isSquare())throw new Error("Matrix is not a square matrix");if(x.isEmpty())throw new Error("Matrix must be non-empty");let M=x.columns,j=new ne(M,M),rt=new Float64Array(M),nt=new Float64Array(M),ot=x,lt,Tt,vt=!1;if(m?vt=!0:vt=x.isSymmetric(),vt){for(lt=0;lt<M;lt++)for(Tt=0;Tt<M;Tt++)j.set(lt,Tt,ot.get(lt,Tt));og(M,nt,rt,j),wd(M,nt,rt,j)}else{let Ft=new ne(M,M),qt=new Float64Array(M);for(Tt=0;Tt<M;Tt++)for(lt=0;lt<M;lt++)Ft.set(lt,Tt,ot.get(lt,Tt));lg(M,Ft,qt,j),cg(M,nt,rt,j,Ft)}this.n=M,this.e=nt,this.d=rt,this.V=j}get realEigenvalues(){return Array.from(this.d)}get imaginaryEigenvalues(){return Array.from(this.e)}get eigenvectorMatrix(){return this.V}get diagonalMatrix(){let x=this.n,w=this.e,m=this.d,M=new ne(x,x),j,rt;for(j=0;j<x;j++){for(rt=0;rt<x;rt++)M.set(j,rt,0);M.set(j,j,m[j]),w[j]>0?M.set(j,j+1,w[j]):w[j]<0&&M.set(j,j-1,w[j])}return M}}function og(H,x,w,m){let M,j,rt,nt,ot,lt,Tt,vt;for(ot=0;ot<H;ot++)w[ot]=m.get(H-1,ot);for(nt=H-1;nt>0;nt--){for(vt=0,rt=0,lt=0;lt<nt;lt++)vt=vt+Math.abs(w[lt]);if(vt===0)for(x[nt]=w[nt-1],ot=0;ot<nt;ot++)w[ot]=m.get(nt-1,ot),m.set(nt,ot,0),m.set(ot,nt,0);else{for(lt=0;lt<nt;lt++)w[lt]/=vt,rt+=w[lt]*w[lt];for(M=w[nt-1],j=Math.sqrt(rt),M>0&&(j=-j),x[nt]=vt*j,rt=rt-M*j,w[nt-1]=M-j,ot=0;ot<nt;ot++)x[ot]=0;for(ot=0;ot<nt;ot++){for(M=w[ot],m.set(ot,nt,M),j=x[ot]+m.get(ot,ot)*M,lt=ot+1;lt<=nt-1;lt++)j+=m.get(lt,ot)*w[lt],x[lt]+=m.get(lt,ot)*M;x[ot]=j}for(M=0,ot=0;ot<nt;ot++)x[ot]/=rt,M+=x[ot]*w[ot];for(Tt=M/(rt+rt),ot=0;ot<nt;ot++)x[ot]-=Tt*w[ot];for(ot=0;ot<nt;ot++){for(M=w[ot],j=x[ot],lt=ot;lt<=nt-1;lt++)m.set(lt,ot,m.get(lt,ot)-(M*x[lt]+j*w[lt]));w[ot]=m.get(nt-1,ot),m.set(nt,ot,0)}}w[nt]=rt}for(nt=0;nt<H-1;nt++){if(m.set(H-1,nt,m.get(nt,nt)),m.set(nt,nt,1),rt=w[nt+1],rt!==0){for(lt=0;lt<=nt;lt++)w[lt]=m.get(lt,nt+1)/rt;for(ot=0;ot<=nt;ot++){for(j=0,lt=0;lt<=nt;lt++)j+=m.get(lt,nt+1)*m.get(lt,ot);for(lt=0;lt<=nt;lt++)m.set(lt,ot,m.get(lt,ot)-j*w[lt])}}for(lt=0;lt<=nt;lt++)m.set(lt,nt+1,0)}for(ot=0;ot<H;ot++)w[ot]=m.get(H-1,ot),m.set(H-1,ot,0);m.set(H-1,H-1,1),x[0]=0}function wd(H,x,w,m){let M,j,rt,nt,ot,lt,Tt,vt,Ft,qt,Lt,Wt,se,yt,Qt,de;for(rt=1;rt<H;rt++)x[rt-1]=x[rt];x[H-1]=0;let Ae=0,oe=0,gn=Number.EPSILON;for(lt=0;lt<H;lt++){for(oe=Math.max(oe,Math.abs(w[lt])+Math.abs(x[lt])),Tt=lt;Tt<H&&!(Math.abs(x[Tt])<=gn*oe);)Tt++;if(Tt>lt)do{for(M=w[lt],vt=(w[lt+1]-M)/(2*x[lt]),Ft=Kn(vt,1),vt<0&&(Ft=-Ft),w[lt]=x[lt]/(vt+Ft),w[lt+1]=x[lt]*(vt+Ft),qt=w[lt+1],j=M-w[lt],rt=lt+2;rt<H;rt++)w[rt]-=j;for(Ae=Ae+j,vt=w[Tt],Lt=1,Wt=Lt,se=Lt,yt=x[lt+1],Qt=0,de=0,rt=Tt-1;rt>=lt;rt--)for(se=Wt,Wt=Lt,de=Qt,M=Lt*x[rt],j=Lt*vt,Ft=Kn(vt,x[rt]),x[rt+1]=Qt*Ft,Qt=x[rt]/Ft,Lt=vt/Ft,vt=Lt*w[rt]-Qt*M,w[rt+1]=j+Qt*(Lt*M+Qt*w[rt]),ot=0;ot<H;ot++)j=m.get(ot,rt+1),m.set(ot,rt+1,Qt*m.get(ot,rt)+Lt*j),m.set(ot,rt,Lt*m.get(ot,rt)-Qt*j);vt=-Qt*de*se*yt*x[lt]/qt,x[lt]=Qt*vt,w[lt]=Lt*vt}while(Math.abs(x[lt])>gn*oe);w[lt]=w[lt]+Ae,x[lt]=0}for(rt=0;rt<H-1;rt++){for(ot=rt,vt=w[rt],nt=rt+1;nt<H;nt++)w[nt]<vt&&(ot=nt,vt=w[nt]);if(ot!==rt)for(w[ot]=w[rt],w[rt]=vt,nt=0;nt<H;nt++)vt=m.get(nt,rt),m.set(nt,rt,m.get(nt,ot)),m.set(nt,ot,vt)}}function lg(H,x,w,m){let M=0,j=H-1,rt,nt,ot,lt,Tt,vt,Ft;for(vt=M+1;vt<=j-1;vt++){for(Ft=0,lt=vt;lt<=j;lt++)Ft=Ft+Math.abs(x.get(lt,vt-1));if(Ft!==0){for(ot=0,lt=j;lt>=vt;lt--)w[lt]=x.get(lt,vt-1)/Ft,ot+=w[lt]*w[lt];for(nt=Math.sqrt(ot),w[vt]>0&&(nt=-nt),ot=ot-w[vt]*nt,w[vt]=w[vt]-nt,Tt=vt;Tt<H;Tt++){for(rt=0,lt=j;lt>=vt;lt--)rt+=w[lt]*x.get(lt,Tt);for(rt=rt/ot,lt=vt;lt<=j;lt++)x.set(lt,Tt,x.get(lt,Tt)-rt*w[lt])}for(lt=0;lt<=j;lt++){for(rt=0,Tt=j;Tt>=vt;Tt--)rt+=w[Tt]*x.get(lt,Tt);for(rt=rt/ot,Tt=vt;Tt<=j;Tt++)x.set(lt,Tt,x.get(lt,Tt)-rt*w[Tt])}w[vt]=Ft*w[vt],x.set(vt,vt-1,Ft*nt)}}for(lt=0;lt<H;lt++)for(Tt=0;Tt<H;Tt++)m.set(lt,Tt,lt===Tt?1:0);for(vt=j-1;vt>=M+1;vt--)if(x.get(vt,vt-1)!==0){for(lt=vt+1;lt<=j;lt++)w[lt]=x.get(lt,vt-1);for(Tt=vt;Tt<=j;Tt++){for(nt=0,lt=vt;lt<=j;lt++)nt+=w[lt]*m.get(lt,Tt);for(nt=nt/w[vt]/x.get(vt,vt-1),lt=vt;lt<=j;lt++)m.set(lt,Tt,m.get(lt,Tt)+nt*w[lt])}}}function cg(H,x,w,m,M){let j=H-1,rt=0,nt=H-1,ot=Number.EPSILON,lt=0,Tt=0,vt=0,Ft=0,qt=0,Lt=0,Wt=0,se=0,yt,Qt,de,Ae,oe,gn,me,xe,rn,Et,Yt,ee,Kt,pn,Re;for(yt=0;yt<H;yt++)for((yt<rt||yt>nt)&&(w[yt]=M.get(yt,yt),x[yt]=0),Qt=Math.max(yt-1,0);Qt<H;Qt++)Tt=Tt+Math.abs(M.get(yt,Qt));for(;j>=rt;){for(Ae=j;Ae>rt&&(Lt=Math.abs(M.get(Ae-1,Ae-1))+Math.abs(M.get(Ae,Ae)),Lt===0&&(Lt=Tt),!(Math.abs(M.get(Ae,Ae-1))<ot*Lt));)Ae--;if(Ae===j)M.set(j,j,M.get(j,j)+lt),w[j]=M.get(j,j),x[j]=0,j--,se=0;else if(Ae===j-1){if(me=M.get(j,j-1)*M.get(j-1,j),vt=(M.get(j-1,j-1)-M.get(j,j))/2,Ft=vt*vt+me,Wt=Math.sqrt(Math.abs(Ft)),M.set(j,j,M.get(j,j)+lt),M.set(j-1,j-1,M.get(j-1,j-1)+lt),xe=M.get(j,j),Ft>=0){for(Wt=vt>=0?vt+Wt:vt-Wt,w[j-1]=xe+Wt,w[j]=w[j-1],Wt!==0&&(w[j]=xe-me/Wt),x[j-1]=0,x[j]=0,xe=M.get(j,j-1),Lt=Math.abs(xe)+Math.abs(Wt),vt=xe/Lt,Ft=Wt/Lt,qt=Math.sqrt(vt*vt+Ft*Ft),vt=vt/qt,Ft=Ft/qt,Qt=j-1;Qt<H;Qt++)Wt=M.get(j-1,Qt),M.set(j-1,Qt,Ft*Wt+vt*M.get(j,Qt)),M.set(j,Qt,Ft*M.get(j,Qt)-vt*Wt);for(yt=0;yt<=j;yt++)Wt=M.get(yt,j-1),M.set(yt,j-1,Ft*Wt+vt*M.get(yt,j)),M.set(yt,j,Ft*M.get(yt,j)-vt*Wt);for(yt=rt;yt<=nt;yt++)Wt=m.get(yt,j-1),m.set(yt,j-1,Ft*Wt+vt*m.get(yt,j)),m.set(yt,j,Ft*m.get(yt,j)-vt*Wt)}else w[j-1]=xe+vt,w[j]=xe+vt,x[j-1]=Wt,x[j]=-Wt;j=j-2,se=0}else{if(xe=M.get(j,j),rn=0,me=0,Ae<j&&(rn=M.get(j-1,j-1),me=M.get(j,j-1)*M.get(j-1,j)),se===10){for(lt+=xe,yt=rt;yt<=j;yt++)M.set(yt,yt,M.get(yt,yt)-xe);Lt=Math.abs(M.get(j,j-1))+Math.abs(M.get(j-1,j-2)),xe=rn=.75*Lt,me=-.4375*Lt*Lt}if(se===30&&(Lt=(rn-xe)/2,Lt=Lt*Lt+me,Lt>0)){for(Lt=Math.sqrt(Lt),rn<xe&&(Lt=-Lt),Lt=xe-me/((rn-xe)/2+Lt),yt=rt;yt<=j;yt++)M.set(yt,yt,M.get(yt,yt)-Lt);lt+=Lt,xe=rn=me=.964}for(se=se+1,oe=j-2;oe>=Ae&&(Wt=M.get(oe,oe),qt=xe-Wt,Lt=rn-Wt,vt=(qt*Lt-me)/M.get(oe+1,oe)+M.get(oe,oe+1),Ft=M.get(oe+1,oe+1)-Wt-qt-Lt,qt=M.get(oe+2,oe+1),Lt=Math.abs(vt)+Math.abs(Ft)+Math.abs(qt),vt=vt/Lt,Ft=Ft/Lt,qt=qt/Lt,!(oe===Ae||Math.abs(M.get(oe,oe-1))*(Math.abs(Ft)+Math.abs(qt))<ot*(Math.abs(vt)*(Math.abs(M.get(oe-1,oe-1))+Math.abs(Wt)+Math.abs(M.get(oe+1,oe+1))))));)oe--;for(yt=oe+2;yt<=j;yt++)M.set(yt,yt-2,0),yt>oe+2&&M.set(yt,yt-3,0);for(de=oe;de<=j-1&&(pn=de!==j-1,de!==oe&&(vt=M.get(de,de-1),Ft=M.get(de+1,de-1),qt=pn?M.get(de+2,de-1):0,xe=Math.abs(vt)+Math.abs(Ft)+Math.abs(qt),xe!==0&&(vt=vt/xe,Ft=Ft/xe,qt=qt/xe)),xe!==0);de++)if(Lt=Math.sqrt(vt*vt+Ft*Ft+qt*qt),vt<0&&(Lt=-Lt),Lt!==0){for(de!==oe?M.set(de,de-1,-Lt*xe):Ae!==oe&&M.set(de,de-1,-M.get(de,de-1)),vt=vt+Lt,xe=vt/Lt,rn=Ft/Lt,Wt=qt/Lt,Ft=Ft/vt,qt=qt/vt,Qt=de;Qt<H;Qt++)vt=M.get(de,Qt)+Ft*M.get(de+1,Qt),pn&&(vt=vt+qt*M.get(de+2,Qt),M.set(de+2,Qt,M.get(de+2,Qt)-vt*Wt)),M.set(de,Qt,M.get(de,Qt)-vt*xe),M.set(de+1,Qt,M.get(de+1,Qt)-vt*rn);for(yt=0;yt<=Math.min(j,de+3);yt++)vt=xe*M.get(yt,de)+rn*M.get(yt,de+1),pn&&(vt=vt+Wt*M.get(yt,de+2),M.set(yt,de+2,M.get(yt,de+2)-vt*qt)),M.set(yt,de,M.get(yt,de)-vt),M.set(yt,de+1,M.get(yt,de+1)-vt*Ft);for(yt=rt;yt<=nt;yt++)vt=xe*m.get(yt,de)+rn*m.get(yt,de+1),pn&&(vt=vt+Wt*m.get(yt,de+2),m.set(yt,de+2,m.get(yt,de+2)-vt*qt)),m.set(yt,de,m.get(yt,de)-vt),m.set(yt,de+1,m.get(yt,de+1)-vt*Ft)}}}if(Tt!==0){for(j=H-1;j>=0;j--)if(vt=w[j],Ft=x[j],Ft===0)for(Ae=j,M.set(j,j,1),yt=j-1;yt>=0;yt--){for(me=M.get(yt,yt)-vt,qt=0,Qt=Ae;Qt<=j;Qt++)qt=qt+M.get(yt,Qt)*M.get(Qt,j);if(x[yt]<0)Wt=me,Lt=qt;else if(Ae=yt,x[yt]===0?M.set(yt,j,me!==0?-qt/me:-qt/(ot*Tt)):(xe=M.get(yt,yt+1),rn=M.get(yt+1,yt),Ft=(w[yt]-vt)*(w[yt]-vt)+x[yt]*x[yt],gn=(xe*Lt-Wt*qt)/Ft,M.set(yt,j,gn),M.set(yt+1,j,Math.abs(xe)>Math.abs(Wt)?(-qt-me*gn)/xe:(-Lt-rn*gn)/Wt)),gn=Math.abs(M.get(yt,j)),ot*gn*gn>1)for(Qt=yt;Qt<=j;Qt++)M.set(Qt,j,M.get(Qt,j)/gn)}else if(Ft<0)for(Ae=j-1,Math.abs(M.get(j,j-1))>Math.abs(M.get(j-1,j))?(M.set(j-1,j-1,Ft/M.get(j,j-1)),M.set(j-1,j,-(M.get(j,j)-vt)/M.get(j,j-1))):(Re=Ho(0,-M.get(j-1,j),M.get(j-1,j-1)-vt,Ft),M.set(j-1,j-1,Re[0]),M.set(j-1,j,Re[1])),M.set(j,j-1,0),M.set(j,j,1),yt=j-2;yt>=0;yt--){for(Et=0,Yt=0,Qt=Ae;Qt<=j;Qt++)Et=Et+M.get(yt,Qt)*M.get(Qt,j-1),Yt=Yt+M.get(yt,Qt)*M.get(Qt,j);if(me=M.get(yt,yt)-vt,x[yt]<0)Wt=me,qt=Et,Lt=Yt;else if(Ae=yt,x[yt]===0?(Re=Ho(-Et,-Yt,me,Ft),M.set(yt,j-1,Re[0]),M.set(yt,j,Re[1])):(xe=M.get(yt,yt+1),rn=M.get(yt+1,yt),ee=(w[yt]-vt)*(w[yt]-vt)+x[yt]*x[yt]-Ft*Ft,Kt=(w[yt]-vt)*2*Ft,ee===0&&Kt===0&&(ee=ot*Tt*(Math.abs(me)+Math.abs(Ft)+Math.abs(xe)+Math.abs(rn)+Math.abs(Wt))),Re=Ho(xe*qt-Wt*Et+Ft*Yt,xe*Lt-Wt*Yt-Ft*Et,ee,Kt),M.set(yt,j-1,Re[0]),M.set(yt,j,Re[1]),Math.abs(xe)>Math.abs(Wt)+Math.abs(Ft)?(M.set(yt+1,j-1,(-Et-me*M.get(yt,j-1)+Ft*M.get(yt,j))/xe),M.set(yt+1,j,(-Yt-me*M.get(yt,j)-Ft*M.get(yt,j-1))/xe)):(Re=Ho(-qt-rn*M.get(yt,j-1),-Lt-rn*M.get(yt,j),Wt,Ft),M.set(yt+1,j-1,Re[0]),M.set(yt+1,j,Re[1]))),gn=Math.max(Math.abs(M.get(yt,j-1)),Math.abs(M.get(yt,j))),ot*gn*gn>1)for(Qt=yt;Qt<=j;Qt++)M.set(Qt,j-1,M.get(Qt,j-1)/gn),M.set(Qt,j,M.get(Qt,j)/gn)}for(yt=0;yt<H;yt++)if(yt<rt||yt>nt)for(Qt=yt;Qt<H;Qt++)m.set(yt,Qt,M.get(yt,Qt));for(Qt=H-1;Qt>=rt;Qt--)for(yt=rt;yt<=nt;yt++){for(Wt=0,de=rt;de<=Math.min(Qt,nt);de++)Wt=Wt+m.get(yt,de)*M.get(de,Qt);m.set(yt,Qt,Wt)}}}function Ho(H,x,w,m){let M,j;return Math.abs(w)>Math.abs(m)?(M=m/w,j=w+M*m,[(H+M*x)/j,(x-M*H)/j]):(M=w/m,j=m+M*w,[(M*H+x)/j,(M*x-H)/j])}class ec{constructor(x){if(x=Or.checkMatrix(x),!x.isSymmetric())throw new Error("Matrix is not symmetric");let w=x,m=w.rows,M=new ne(m,m),j=!0,rt,nt,ot;for(nt=0;nt<m;nt++){let lt=0;for(ot=0;ot<nt;ot++){let Tt=0;for(rt=0;rt<ot;rt++)Tt+=M.get(ot,rt)*M.get(nt,rt);Tt=(w.get(nt,ot)-Tt)/M.get(ot,ot),M.set(nt,ot,Tt),lt=lt+Tt*Tt}for(lt=w.get(nt,nt)-lt,j&&(j=lt>0),M.set(nt,nt,Math.sqrt(Math.max(lt,0))),ot=nt+1;ot<m;ot++)M.set(nt,ot,0)}this.L=M,this.positiveDefinite=j}isPositiveDefinite(){return this.positiveDefinite}solve(x){x=Or.checkMatrix(x);let w=this.L,m=w.rows;if(x.rows!==m)throw new Error("Matrix dimensions do not match");if(this.isPositiveDefinite()===!1)throw new Error("Matrix is not positive definite");let M=x.columns,j=x.clone(),rt,nt,ot;for(ot=0;ot<m;ot++)for(nt=0;nt<M;nt++){for(rt=0;rt<ot;rt++)j.set(ot,nt,j.get(ot,nt)-j.get(rt,nt)*w.get(ot,rt));j.set(ot,nt,j.get(ot,nt)/w.get(ot,ot))}for(ot=m-1;ot>=0;ot--)for(nt=0;nt<M;nt++){for(rt=ot+1;rt<m;rt++)j.set(ot,nt,j.get(ot,nt)-j.get(rt,nt)*w.get(rt,ot));j.set(ot,nt,j.get(ot,nt)/w.get(ot,ot))}return j}get lowerTriangularMatrix(){return this.L}}class nc{constructor(x,w={}){x=Or.checkMatrix(x);let{Y:m}=w;const{scaleScores:M=!1,maxIterations:j=1e3,terminationCriteria:rt=1e-10}=w;let nt;if(m){if(et.isAnyArray(m)&&typeof m[0]=="number"?m=ne.columnVector(m):m=Or.checkMatrix(m),m.rows!==x.rows)throw new Error("Y should have the same number of rows as X");nt=m.getColumnVector(0)}else nt=x.getColumnVector(0);let ot=1,lt,Tt,vt,Ft;for(let qt=0;qt<j&&ot>rt;qt++)vt=x.transpose().mmul(nt).div(nt.transpose().mmul(nt).get(0,0)),vt=vt.div(vt.norm()),lt=x.mmul(vt).div(vt.transpose().mmul(vt).get(0,0)),qt>0&&(ot=lt.clone().sub(Ft).pow(2).sum()),Ft=lt.clone(),m?(Tt=m.transpose().mmul(lt).div(lt.transpose().mmul(lt).get(0,0)),Tt=Tt.div(Tt.norm()),nt=m.mmul(Tt).div(Tt.transpose().mmul(Tt).get(0,0))):nt=lt;if(m){let qt=x.transpose().mmul(lt).div(lt.transpose().mmul(lt).get(0,0));qt=qt.div(qt.norm());let Lt=x.clone().sub(lt.clone().mmul(qt.transpose())),Wt=nt.transpose().mmul(lt).div(lt.transpose().mmul(lt).get(0,0)),se=m.clone().sub(lt.clone().mulS(Wt.get(0,0)).mmul(Tt.transpose()));this.t=lt,this.p=qt.transpose(),this.w=vt.transpose(),this.q=Tt,this.u=nt,this.s=lt.transpose().mmul(lt),this.xResidual=Lt,this.yResidual=se,this.betas=Wt}else this.w=vt.transpose(),this.s=lt.transpose().mmul(lt).sqrt(),M?this.t=lt.clone().div(this.s.get(0,0)):this.t=lt,this.xResidual=x.sub(lt.mmul(vt.transpose()))}}Q.XA=ye,Q.a_=ec,Q.yQ=ec,Q.Hs=Xn,Q.Ec=Ed,Q.dx=Ed,Q.LU=Uo,Q.Rm=Uo,Q.y3=ne,Q.qK=$l,Q.pb=us,Q.j=Zo,Q.sO=pa,Q.BZ=eo,Q.EK=Ji,Q.Db=hs,Q.Fx=Vo,Q.tU=si,Q.Ym=nc,Q.rs=nc,Q.QR=Yo,Q.TB=Yo,Q.oH=wi,Q.Sc=wi,Q.BN=Br,Q.it=Di,Q.$r=Or,Q.QM=sg,Q.AV=ag,A=ne,Q.GH=no,Q.SO=xd,Q.uZ=rg,Q.yU=ig,Q.F1=tc,Q.re=tg},45411:function(Y){"use strict";Y.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(Y,Q,S){var A=S(45411),W=S(81683),z=Object.hasOwnProperty,C=Object.create(null);for(var T in A)z.call(A,T)&&(C[A[T]]=T);var N=Y.exports={to:{},get:{}};N.get=function(_){var I=_.substring(0,3).toLowerCase(),L,G;switch(I){case"hsl":L=N.get.hsl(_),G="hsl";break;case"hwb":L=N.get.hwb(_),G="hwb";break;default:L=N.get.rgb(_),G="rgb";break}return L?{model:G,value:L}:null},N.get.rgb=function(_){if(!_)return null;var I=/^#([a-f0-9]{3,4})$/i,L=/^#([a-f0-9]{6})([a-f0-9]{2})?$/i,G=/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,K=/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,X=/^(\w+)$/,et=[0,0,0,1],tt,q,it;if(tt=_.match(L)){for(it=tt[2],tt=tt[1],q=0;q<3;q++){var st=q*2;et[q]=parseInt(tt.slice(st,st+2),16)}it&&(et[3]=parseInt(it,16)/255)}else if(tt=_.match(I)){for(tt=tt[1],it=tt[3],q=0;q<3;q++)et[q]=parseInt(tt[q]+tt[q],16);it&&(et[3]=parseInt(it+it,16)/255)}else if(tt=_.match(G)){for(q=0;q<3;q++)et[q]=parseInt(tt[q+1],0);tt[4]&&(tt[5]?et[3]=parseFloat(tt[4])*.01:et[3]=parseFloat(tt[4]))}else if(tt=_.match(K)){for(q=0;q<3;q++)et[q]=Math.round(parseFloat(tt[q+1])*2.55);tt[4]&&(tt[5]?et[3]=parseFloat(tt[4])*.01:et[3]=parseFloat(tt[4]))}else return(tt=_.match(X))?tt[1]==="transparent"?[0,0,0,0]:z.call(A,tt[1])?(et=A[tt[1]],et[3]=1,et):null:null;for(q=0;q<3;q++)et[q]=D(et[q],0,255);return et[3]=D(et[3],0,1),et},N.get.hsl=function(_){if(!_)return null;var I=/^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*)?\)$/,L=_.match(I);if(L){var G=parseFloat(L[4]),K=(parseFloat(L[1])%360+360)%360,X=D(parseFloat(L[2]),0,100),et=D(parseFloat(L[3]),0,100),tt=D(isNaN(G)?1:G,0,1);return[K,X,et,tt]}return null},N.get.hwb=function(_){if(!_)return null;var I=/^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*)?\)$/,L=_.match(I);if(L){var G=parseFloat(L[4]),K=(parseFloat(L[1])%360+360)%360,X=D(parseFloat(L[2]),0,100),et=D(parseFloat(L[3]),0,100),tt=D(isNaN(G)?1:G,0,1);return[K,X,et,tt]}return null},N.to.hex=function(){var _=W(arguments);return"#"+R(_[0])+R(_[1])+R(_[2])+(_[3]<1?R(Math.round(_[3]*255)):"")},N.to.rgb=function(){var _=W(arguments);return _.length<4||_[3]===1?"rgb("+Math.round(_[0])+", "+Math.round(_[1])+", "+Math.round(_[2])+")":"rgba("+Math.round(_[0])+", "+Math.round(_[1])+", "+Math.round(_[2])+", "+_[3]+")"},N.to.rgb.percent=function(){var _=W(arguments),I=Math.round(_[0]/255*100),L=Math.round(_[1]/255*100),G=Math.round(_[2]/255*100);return _.length<4||_[3]===1?"rgb("+I+"%, "+L+"%, "+G+"%)":"rgba("+I+"%, "+L+"%, "+G+"%, "+_[3]+")"},N.to.hsl=function(){var _=W(arguments);return _.length<4||_[3]===1?"hsl("+_[0]+", "+_[1]+"%, "+_[2]+"%)":"hsla("+_[0]+", "+_[1]+"%, "+_[2]+"%, "+_[3]+")"},N.to.hwb=function(){var _=W(arguments),I="";return _.length>=4&&_[3]!==1&&(I=", "+_[3]),"hwb("+_[0]+", "+_[1]+"%, "+_[2]+"%"+I+")"},N.to.keyword=function(_){return C[_.slice(0,3)]};function D(_,I,L){return Math.min(Math.max(I,_),L)}function R(_){var I=Math.round(_).toString(16).toUpperCase();return I.length<2?"0"+I:I}},92546:function(Y,Q,S){Y.exports={graphlib:S(76626),layout:S(47194),debug:S(11303),util:{time:S(53063).time,notime:S(53063).notime},version:S(11897)}},81255:function(Y,Q,S){"use strict";var A=S(72361),W=S(39240);Y.exports={run:z,undo:T};function z(N){var D=N.graph().acyclicer==="greedy"?W(N,R(N)):C(N);A.forEach(D,function(_){var I=N.edge(_);N.removeEdge(_),I.forwardName=_.name,I.reversed=!0,N.setEdge(_.w,_.v,I,A.uniqueId("rev"))});function R(_){return function(I){return _.edge(I).weight}}}function C(N){var D=[],R={},_={};function I(L){A.has(_,L)||(_[L]=!0,R[L]=!0,A.forEach(N.outEdges(L),function(G){A.has(R,G.w)?D.push(G):I(G.w)}),delete R[L])}return A.forEach(N.nodes(),I),D}function T(N){A.forEach(N.edges(),function(D){var R=N.edge(D);if(R.reversed){N.removeEdge(D);var _=R.forwardName;delete R.reversed,delete R.forwardName,N.setEdge(D.w,D.v,R,_)}})}},60765:function(Y,Q,S){var A=S(72361),W=S(53063);Y.exports=z;function z(T){function N(D){var R=T.children(D),_=T.node(D);if(R.length&&A.forEach(R,N),A.has(_,"minRank")){_.borderLeft=[],_.borderRight=[];for(var I=_.minRank,L=_.maxRank+1;I<L;++I)C(T,"borderLeft","_bl",D,_,I),C(T,"borderRight","_br",D,_,I)}}A.forEach(T.children(),N)}function C(T,N,D,R,_,I){var L={width:0,height:0,rank:I,borderType:N},G=_[N][I-1],K=W.addDummyNode(T,"border",L,D);_[N][I]=K,T.setParent(K,R),G&&T.setEdge(G,K,{weight:1})}},13257:function(Y,Q,S){"use strict";var A=S(72361);Y.exports={adjust:W,undo:z};function W(I){var L=I.graph().rankdir.toLowerCase();(L==="lr"||L==="rl")&&C(I)}function z(I){var L=I.graph().rankdir.toLowerCase();(L==="bt"||L==="rl")&&N(I),(L==="lr"||L==="rl")&&(R(I),C(I))}function C(I){A.forEach(I.nodes(),function(L){T(I.node(L))}),A.forEach(I.edges(),function(L){T(I.edge(L))})}function T(I){var L=I.width;I.width=I.height,I.height=L}function N(I){A.forEach(I.nodes(),function(L){D(I.node(L))}),A.forEach(I.edges(),function(L){var G=I.edge(L);A.forEach(G.points,D),A.has(G,"y")&&D(G)})}function D(I){I.y=-I.y}function R(I){A.forEach(I.nodes(),function(L){_(I.node(L))}),A.forEach(I.edges(),function(L){var G=I.edge(L);A.forEach(G.points,_),A.has(G,"x")&&_(G)})}function _(I){var L=I.x;I.x=I.y,I.y=L}},21135:function(Y){Y.exports=Q;function Q(){var W={};W._next=W._prev=W,this._sentinel=W}Q.prototype.dequeue=function(){var W=this._sentinel,z=W._prev;if(z!==W)return S(z),z},Q.prototype.enqueue=function(W){var z=this._sentinel;W._prev&&W._next&&S(W),W._next=z._next,z._next._prev=W,z._next=W,W._prev=z},Q.prototype.toString=function(){for(var W=[],z=this._sentinel,C=z._prev;C!==z;)W.push(JSON.stringify(C,A)),C=C._prev;return"["+W.join(", ")+"]"};function S(W){W._prev._next=W._next,W._next._prev=W._prev,delete W._next,delete W._prev}function A(W,z){if(W!=="_next"&&W!=="_prev")return z}},11303:function(Y,Q,S){var A=S(72361),W=S(53063),z=S(76626).Graph;Y.exports={debugOrdering:C};function C(T){var N=W.buildLayerMatrix(T),D=new z({compound:!0,multigraph:!0}).setGraph({});return A.forEach(T.nodes(),function(R){D.setNode(R,{label:R}),D.setParent(R,"layer"+T.node(R).rank)}),A.forEach(T.edges(),function(R){D.setEdge(R.v,R.w,{},R.name)}),A.forEach(N,function(R,_){var I="layer"+_;D.setNode(I,{rank:"same"}),A.reduce(R,function(L,G){return D.setEdge(L,G,{style:"invis"}),G})}),D}},76626:function(Y,Q,S){var A;try{A=S(75172)}catch(W){}A||(A=window.graphlib),Y.exports=A},39240:function(Y,Q,S){var A=S(72361),W=S(76626).Graph,z=S(21135);Y.exports=T;var C=A.constant(1);function T(I,L){if(I.nodeCount()<=1)return[];var G=R(I,L||C),K=N(G.graph,G.buckets,G.zeroIdx);return A.flatten(A.map(K,function(X){return I.outEdges(X.v,X.w)}),!0)}function N(I,L,G){for(var K=[],X=L[L.length-1],et=L[0],tt;I.nodeCount();){for(;tt=et.dequeue();)D(I,L,G,tt);for(;tt=X.dequeue();)D(I,L,G,tt);if(I.nodeCount()){for(var q=L.length-2;q>0;--q)if(tt=L[q].dequeue(),tt){K=K.concat(D(I,L,G,tt,!0));break}}}return K}function D(I,L,G,K,X){var et=X?[]:void 0;return A.forEach(I.inEdges(K.v),function(tt){var q=I.edge(tt),it=I.node(tt.v);X&&et.push({v:tt.v,w:tt.w}),it.out-=q,_(L,G,it)}),A.forEach(I.outEdges(K.v),function(tt){var q=I.edge(tt),it=tt.w,st=I.node(it);st.in-=q,_(L,G,st)}),I.removeNode(K.v),et}function R(I,L){var G=new W,K=0,X=0;A.forEach(I.nodes(),function(q){G.setNode(q,{v:q,in:0,out:0})}),A.forEach(I.edges(),function(q){var it=G.edge(q.v,q.w)||0,st=L(q),ut=it+st;G.setEdge(q.v,q.w,ut),X=Math.max(X,G.node(q.v).out+=st),K=Math.max(K,G.node(q.w).in+=st)});var et=A.range(X+K+3).map(function(){return new z}),tt=K+1;return A.forEach(G.nodes(),function(q){_(et,tt,G.node(q))}),{graph:G,buckets:et,zeroIdx:tt}}function _(I,L,G){G.out?G.in?I[G.out-G.in+L].enqueue(G):I[I.length-1].enqueue(G):I[0].enqueue(G)}},47194:function(Y,Q,S){"use strict";var A=S(72361),W=S(81255),z=S(27163),C=S(64505),T=S(53063).normalizeRanks,N=S(71970),D=S(53063).removeEmptyRanks,R=S(31733),_=S(60765),I=S(13257),L=S(62852),G=S(93021),K=S(53063),X=S(76626).Graph;Y.exports=et;function et(dt,wt){var Ot=wt&&wt.debugTiming?K.time:K.notime;Ot("layout",function(){var Zt=Ot(" buildLayoutGraph",function(){return xt(dt)});Ot(" runLayout",function(){tt(Zt,Ot)}),Ot(" updateInputGraph",function(){q(dt,Zt)})})}function tt(dt,wt){wt(" makeSpaceForEdgeLabels",function(){kt(dt)}),wt(" removeSelfEdges",function(){Ra(dt)}),wt(" acyclic",function(){W.run(dt)}),wt(" nestingGraph.run",function(){R.run(dt)}),wt(" rank",function(){C(K.asNonCompoundGraph(dt))}),wt(" injectEdgeLabelProxies",function(){Gt(dt)}),wt(" removeEmptyRanks",function(){D(dt)}),wt(" nestingGraph.cleanup",function(){R.cleanup(dt)}),wt(" normalizeRanks",function(){T(dt)}),wt(" assignRankMinMax",function(){jt(dt)}),wt(" removeEdgeLabelProxies",function(){Ht(dt)}),wt(" normalize.run",function(){z.run(dt)}),wt(" parentDummyChains",function(){N(dt)}),wt(" addBorderSegments",function(){_(dt)}),wt(" order",function(){L(dt)}),wt(" insertSelfEdges",function(){cs(dt)}),wt(" adjustCoordinateSystem",function(){I.adjust(dt)}),wt(" position",function(){G(dt)}),wt(" positionSelfEdges",function(){Rt(dt)}),wt(" removeBorderNodes",function(){Ei(dt)}),wt(" normalize.undo",function(){z.undo(dt)}),wt(" fixupEdgeLabelCoords",function(){Xe(dt)}),wt(" undoCoordinateSystem",function(){I.undo(dt)}),wt(" translateGraph",function(){fe(dt)}),wt(" assignNodeIntersects",function(){we(dt)}),wt(" reversePoints",function(){Hn(dt)}),wt(" acyclic.undo",function(){W.undo(dt)})}function q(dt,wt){A.forEach(dt.nodes(),function(Ot){var Zt=dt.node(Ot),ve=wt.node(Ot);Zt&&(Zt.x=ve.x,Zt.y=ve.y,wt.children(Ot).length&&(Zt.width=ve.width,Zt.height=ve.height))}),A.forEach(dt.edges(),function(Ot){var Zt=dt.edge(Ot),ve=wt.edge(Ot);Zt.points=ve.points,A.has(ve,"x")&&(Zt.x=ve.x,Zt.y=ve.y)}),dt.graph().width=wt.graph().width,dt.graph().height=wt.graph().height}var it=["nodesep","edgesep","ranksep","marginx","marginy"],st={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},ut=["acyclicer","ranker","rankdir","align"],ht=["width","height"],mt={width:0,height:0},St=["minlen","weight","width","height","labeloffset"],Mt={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},pt=["labelpos"];function xt(dt){var wt=new X({multigraph:!0,compound:!0}),Ot=Bt(dt.graph());return wt.setGraph(A.merge({},st,_t(Ot,it),A.pick(Ot,ut))),A.forEach(dt.nodes(),function(Zt){var ve=Bt(dt.node(Zt));wt.setNode(Zt,A.defaults(_t(ve,ht),mt)),wt.setParent(Zt,dt.parent(Zt))}),A.forEach(dt.edges(),function(Zt){var ve=Bt(dt.edge(Zt));wt.setEdge(Zt,A.merge({},Mt,_t(ve,St),A.pick(ve,pt)))}),wt}function kt(dt){var wt=dt.graph();wt.ranksep/=2,A.forEach(dt.edges(),function(Ot){var Zt=dt.edge(Ot);Zt.minlen*=2,Zt.labelpos.toLowerCase()!=="c"&&(wt.rankdir==="TB"||wt.rankdir==="BT"?Zt.width+=Zt.labeloffset:Zt.height+=Zt.labeloffset)})}function Gt(dt){A.forEach(dt.edges(),function(wt){var Ot=dt.edge(wt);if(Ot.width&&Ot.height){var Zt=dt.node(wt.v),ve=dt.node(wt.w),Be={rank:(ve.rank-Zt.rank)/2+Zt.rank,e:wt};K.addDummyNode(dt,"edge-proxy",Be,"_ep")}})}function jt(dt){var wt=0;A.forEach(dt.nodes(),function(Ot){var Zt=dt.node(Ot);Zt.borderTop&&(Zt.minRank=dt.node(Zt.borderTop).rank,Zt.maxRank=dt.node(Zt.borderBottom).rank,wt=A.max(wt,Zt.maxRank))}),dt.graph().maxRank=wt}function Ht(dt){A.forEach(dt.nodes(),function(wt){var Ot=dt.node(wt);Ot.dummy==="edge-proxy"&&(dt.edge(Ot.e).labelRank=Ot.rank,dt.removeNode(wt))})}function fe(dt){var wt=Number.POSITIVE_INFINITY,Ot=0,Zt=Number.POSITIVE_INFINITY,ve=0,Be=dt.graph(),ge=Be.marginx||0,ke=Be.marginy||0;function Ve(vn){var Ce=vn.x,Se=vn.y,ye=vn.width,Pe=vn.height;wt=Math.min(wt,Ce-ye/2),Ot=Math.max(Ot,Ce+ye/2),Zt=Math.min(Zt,Se-Pe/2),ve=Math.max(ve,Se+Pe/2)}A.forEach(dt.nodes(),function(vn){Ve(dt.node(vn))}),A.forEach(dt.edges(),function(vn){var Ce=dt.edge(vn);A.has(Ce,"x")&&Ve(Ce)}),wt-=ge,Zt-=ke,A.forEach(dt.nodes(),function(vn){var Ce=dt.node(vn);Ce.x-=wt,Ce.y-=Zt}),A.forEach(dt.edges(),function(vn){var Ce=dt.edge(vn);A.forEach(Ce.points,function(Se){Se.x-=wt,Se.y-=Zt}),A.has(Ce,"x")&&(Ce.x-=wt),A.has(Ce,"y")&&(Ce.y-=Zt)}),Be.width=Ot-wt+ge,Be.height=ve-Zt+ke}function we(dt){A.forEach(dt.edges(),function(wt){var Ot=dt.edge(wt),Zt=dt.node(wt.v),ve=dt.node(wt.w),Be,ge;Ot.points?(Be=Ot.points[0],ge=Ot.points[Ot.points.length-1]):(Ot.points=[],Be=ve,ge=Zt),Ot.points.unshift(K.intersectRect(Zt,Be)),Ot.points.push(K.intersectRect(ve,ge))})}function Xe(dt){A.forEach(dt.edges(),function(wt){var Ot=dt.edge(wt);if(A.has(Ot,"x"))switch((Ot.labelpos==="l"||Ot.labelpos==="r")&&(Ot.width-=Ot.labeloffset),Ot.labelpos){case"l":Ot.x-=Ot.width/2+Ot.labeloffset;break;case"r":Ot.x+=Ot.width/2+Ot.labeloffset;break}})}function Hn(dt){A.forEach(dt.edges(),function(wt){var Ot=dt.edge(wt);Ot.reversed&&Ot.points.reverse()})}function Ei(dt){A.forEach(dt.nodes(),function(wt){if(dt.children(wt).length){var Ot=dt.node(wt),Zt=dt.node(Ot.borderTop),ve=dt.node(Ot.borderBottom),Be=dt.node(A.last(Ot.borderLeft)),ge=dt.node(A.last(Ot.borderRight));Ot.width=Math.abs(ge.x-Be.x),Ot.height=Math.abs(ve.y-Zt.y),Ot.x=Be.x+Ot.width/2,Ot.y=Zt.y+Ot.height/2}}),A.forEach(dt.nodes(),function(wt){dt.node(wt).dummy==="border"&&dt.removeNode(wt)})}function Ra(dt){A.forEach(dt.edges(),function(wt){if(wt.v===wt.w){var Ot=dt.node(wt.v);Ot.selfEdges||(Ot.selfEdges=[]),Ot.selfEdges.push({e:wt,label:dt.edge(wt)}),dt.removeEdge(wt)}})}function cs(dt){var wt=K.buildLayerMatrix(dt);A.forEach(wt,function(Ot){var Zt=0;A.forEach(Ot,function(ve,Be){var ge=dt.node(ve);ge.order=Be+Zt,A.forEach(ge.selfEdges,function(ke){K.addDummyNode(dt,"selfedge",{width:ke.label.width,height:ke.label.height,rank:ge.rank,order:Be+ ++Zt,e:ke.e,label:ke.label},"_se")}),delete ge.selfEdges})})}function Rt(dt){A.forEach(dt.nodes(),function(wt){var Ot=dt.node(wt);if(Ot.dummy==="selfedge"){var Zt=dt.node(Ot.e.v),ve=Zt.x+Zt.width/2,Be=Zt.y,ge=Ot.x-ve,ke=Zt.height/2;dt.setEdge(Ot.e,Ot.label),dt.removeNode(wt),Ot.label.points=[{x:ve+2*ge/3,y:Be-ke},{x:ve+5*ge/6,y:Be-ke},{x:ve+ge,y:Be},{x:ve+5*ge/6,y:Be+ke},{x:ve+2*ge/3,y:Be+ke}],Ot.label.x=Ot.x,Ot.label.y=Ot.y}})}function _t(dt,wt){return A.mapValues(A.pick(dt,wt),Number)}function Bt(dt){var wt={};return A.forEach(dt,function(Ot,Zt){wt[Zt.toLowerCase()]=Ot}),wt}},72361:function(Y,Q,S){var A;try{A={cloneDeep:S(20250),constant:S(13503),defaults:S(28548),each:S(76934),filter:S(64725),find:S(79785),flatten:S(40151),forEach:S(99204),forIn:S(23190),has:S(99946),isUndefined:S(16513),last:S(10611),map:S(9924),mapValues:S(70642),max:S(95987),merge:S(28440),min:S(73376),minBy:S(83296),now:S(5795),pick:S(89409),range:S(60859),reduce:S(16473),sortBy:S(351),uniqueId:S(95708),values:S(81229),zipObject:S(65441)}}catch(W){}A||(A=window._),Y.exports=A},31733:function(Y,Q,S){var A=S(72361),W=S(53063);Y.exports={run:z,cleanup:D};function z(R){var _=W.addDummyNode(R,"root",{},"_root"),I=T(R),L=A.max(A.values(I))-1,G=2*L+1;R.graph().nestingRoot=_,A.forEach(R.edges(),function(X){R.edge(X).minlen*=G});var K=N(R)+1;A.forEach(R.children(),function(X){C(R,_,G,K,L,I,X)}),R.graph().nodeRankFactor=G}function C(R,_,I,L,G,K,X){var et=R.children(X);if(!et.length){X!==_&&R.setEdge(_,X,{weight:0,minlen:I});return}var tt=W.addBorderNode(R,"_bt"),q=W.addBorderNode(R,"_bb"),it=R.node(X);R.setParent(tt,X),it.borderTop=tt,R.setParent(q,X),it.borderBottom=q,A.forEach(et,function(st){C(R,_,I,L,G,K,st);var ut=R.node(st),ht=ut.borderTop?ut.borderTop:st,mt=ut.borderBottom?ut.borderBottom:st,St=ut.borderTop?L:2*L,Mt=ht!==mt?1:G-K[X]+1;R.setEdge(tt,ht,{weight:St,minlen:Mt,nestingEdge:!0}),R.setEdge(mt,q,{weight:St,minlen:Mt,nestingEdge:!0})}),R.parent(X)||R.setEdge(_,tt,{weight:0,minlen:G+K[X]})}function T(R){var _={};function I(L,G){var K=R.children(L);K&&K.length&&A.forEach(K,function(X){I(X,G+1)}),_[L]=G}return A.forEach(R.children(),function(L){I(L,1)}),_}function N(R){return A.reduce(R.edges(),function(_,I){return _+R.edge(I).weight},0)}function D(R){var _=R.graph();R.removeNode(_.nestingRoot),delete _.nestingRoot,A.forEach(R.edges(),function(I){var L=R.edge(I);L.nestingEdge&&R.removeEdge(I)})}},27163:function(Y,Q,S){"use strict";var A=S(72361),W=S(53063);Y.exports={run:z,undo:T};function z(N){N.graph().dummyChains=[],A.forEach(N.edges(),function(D){C(N,D)})}function C(N,D){var R=D.v,_=N.node(R).rank,I=D.w,L=N.node(I).rank,G=D.name,K=N.edge(D),X=K.labelRank;if(L!==_+1){N.removeEdge(D);var et,tt,q;for(q=0,++_;_<L;++q,++_)K.points=[],tt={width:0,height:0,edgeLabel:K,edgeObj:D,rank:_},et=W.addDummyNode(N,"edge",tt,"_d"),_===X&&(tt.width=K.width,tt.height=K.height,tt.dummy="edge-label",tt.labelpos=K.labelpos),N.setEdge(R,et,{weight:K.weight},G),q===0&&N.graph().dummyChains.push(et),R=et;N.setEdge(R,I,{weight:K.weight},G)}}function T(N){A.forEach(N.graph().dummyChains,function(D){var R=N.node(D),_=R.edgeLabel,I;for(N.setEdge(R.edgeObj,_);R.dummy;)I=N.successors(D)[0],N.removeNode(D),_.points.push({x:R.x,y:R.y}),R.dummy==="edge-label"&&(_.x=R.x,_.y=R.y,_.width=R.width,_.height=R.height),D=I,R=N.node(D)})}},52205:function(Y,Q,S){var A=S(72361);Y.exports=W;function W(z,C,T){var N={},D;A.forEach(T,function(R){for(var _=z.parent(R),I,L;_;){if(I=z.parent(_),I?(L=N[I],N[I]=_):(L=D,D=_),L&&L!==_){C.setEdge(L,_);return}_=I}})}},99506:function(Y,Q,S){var A=S(72361);Y.exports=W;function W(z,C){return A.map(C,function(T){var N=z.inEdges(T);if(N.length){var D=A.reduce(N,function(R,_){var I=z.edge(_),L=z.node(_.v);return{sum:R.sum+I.weight*L.order,weight:R.weight+I.weight}},{sum:0,weight:0});return{v:T,barycenter:D.sum/D.weight,weight:D.weight}}else return{v:T}})}},59105:function(Y,Q,S){var A=S(72361),W=S(76626).Graph;Y.exports=z;function z(T,N,D){var R=C(T),_=new W({compound:!0}).setGraph({root:R}).setDefaultNodeLabel(function(I){return T.node(I)});return A.forEach(T.nodes(),function(I){var L=T.node(I),G=T.parent(I);(L.rank===N||L.minRank<=N&&N<=L.maxRank)&&(_.setNode(I),_.setParent(I,G||R),A.forEach(T[D](I),function(K){var X=K.v===I?K.w:K.v,et=_.edge(X,I),tt=A.isUndefined(et)?0:et.weight;_.setEdge(X,I,{weight:T.edge(K).weight+tt})}),A.has(L,"minRank")&&_.setNode(I,{borderLeft:L.borderLeft[N],borderRight:L.borderRight[N]}))}),_}function C(T){for(var N;T.hasNode(N=A.uniqueId("_root")););return N}},45456:function(Y,Q,S){"use strict";var A=S(72361);Y.exports=W;function W(C,T){for(var N=0,D=1;D<T.length;++D)N+=z(C,T[D-1],T[D]);return N}function z(C,T,N){for(var D=A.zipObject(N,A.map(N,function(K,X){return X})),R=A.flatten(A.map(T,function(K){return A.sortBy(A.map(C.outEdges(K),function(X){return{pos:D[X.w],weight:C.edge(X).weight}}),"pos")}),!0),_=1;_<N.length;)_<<=1;var I=2*_-1;_-=1;var L=A.map(new Array(I),function(){return 0}),G=0;return A.forEach(R.forEach(function(K){var X=K.pos+_;L[X]+=K.weight;for(var et=0;X>0;)X%2&&(et+=L[X+1]),X=X-1>>1,L[X]+=K.weight;G+=K.weight*et})),G}},62852:function(Y,Q,S){"use strict";var A=S(72361),W=S(18043),z=S(45456),C=S(86490),T=S(59105),N=S(52205),D=S(76626).Graph,R=S(53063);Y.exports=_;function _(K){var X=R.maxRank(K),et=I(K,A.range(1,X+1),"inEdges"),tt=I(K,A.range(X-1,-1,-1),"outEdges"),q=W(K);G(K,q);for(var it=Number.POSITIVE_INFINITY,st,ut=0,ht=0;ht<4;++ut,++ht){L(ut%2?et:tt,ut%4>=2),q=R.buildLayerMatrix(K);var mt=z(K,q);mt<it&&(ht=0,st=A.cloneDeep(q),it=mt)}G(K,st)}function I(K,X,et){return A.map(X,function(tt){return T(K,tt,et)})}function L(K,X){var et=new D;A.forEach(K,function(tt){var q=tt.graph().root,it=C(tt,q,et,X);A.forEach(it.vs,function(st,ut){tt.node(st).order=ut}),N(tt,et,it.vs)})}function G(K,X){A.forEach(X,function(et){A.forEach(et,function(tt,q){K.node(tt).order=q})})}},18043:function(Y,Q,S){"use strict";var A=S(72361);Y.exports=W;function W(z){var C={},T=A.filter(z.nodes(),function(I){return!z.children(I).length}),N=A.max(A.map(T,function(I){return z.node(I).rank})),D=A.map(A.range(N+1),function(){return[]});function R(I){if(!A.has(C,I)){C[I]=!0;var L=z.node(I);D[L.rank].push(I),A.forEach(z.successors(I),R)}}var _=A.sortBy(T,function(I){return z.node(I).rank});return A.forEach(_,R),D}},45926:function(Y,Q,S){"use strict";var A=S(72361);Y.exports=W;function W(T,N){var D={};A.forEach(T,function(_,I){var L=D[_.v]={indegree:0,in:[],out:[],vs:[_.v],i:I};A.isUndefined(_.barycenter)||(L.barycenter=_.barycenter,L.weight=_.weight)}),A.forEach(N.edges(),function(_){var I=D[_.v],L=D[_.w];!A.isUndefined(I)&&!A.isUndefined(L)&&(L.indegree++,I.out.push(D[_.w]))});var R=A.filter(D,function(_){return!_.indegree});return z(R)}function z(T){var N=[];function D(I){return function(L){L.merged||(A.isUndefined(L.barycenter)||A.isUndefined(I.barycenter)||L.barycenter>=I.barycenter)&&C(I,L)}}function R(I){return function(L){L.in.push(I),--L.indegree===0&&T.push(L)}}for(;T.length;){var _=T.pop();N.push(_),A.forEach(_.in.reverse(),D(_)),A.forEach(_.out,R(_))}return A.map(A.filter(N,function(I){return!I.merged}),function(I){return A.pick(I,["vs","i","barycenter","weight"])})}function C(T,N){var D=0,R=0;T.weight&&(D+=T.barycenter*T.weight,R+=T.weight),N.weight&&(D+=N.barycenter*N.weight,R+=N.weight),T.vs=N.vs.concat(T.vs),T.barycenter=D/R,T.weight=R,T.i=Math.min(N.i,T.i),N.merged=!0}},86490:function(Y,Q,S){var A=S(72361),W=S(99506),z=S(45926),C=S(1349);Y.exports=T;function T(R,_,I,L){var G=R.children(_),K=R.node(_),X=K?K.borderLeft:void 0,et=K?K.borderRight:void 0,tt={};X&&(G=A.filter(G,function(mt){return mt!==X&&mt!==et}));var q=W(R,G);A.forEach(q,function(mt){if(R.children(mt.v).length){var St=T(R,mt.v,I,L);tt[mt.v]=St,A.has(St,"barycenter")&&D(mt,St)}});var it=z(q,I);N(it,tt);var st=C(it,L);if(X&&(st.vs=A.flatten([X,st.vs,et],!0),R.predecessors(X).length)){var ut=R.node(R.predecessors(X)[0]),ht=R.node(R.predecessors(et)[0]);A.has(st,"barycenter")||(st.barycenter=0,st.weight=0),st.barycenter=(st.barycenter*st.weight+ut.order+ht.order)/(st.weight+2),st.weight+=2}return st}function N(R,_){A.forEach(R,function(I){I.vs=A.flatten(I.vs.map(function(L){return _[L]?_[L].vs:L}),!0)})}function D(R,_){A.isUndefined(R.barycenter)?(R.barycenter=_.barycenter,R.weight=_.weight):(R.barycenter=(R.barycenter*R.weight+_.barycenter*_.weight)/(R.weight+_.weight),R.weight+=_.weight)}},1349:function(Y,Q,S){var A=S(72361),W=S(53063);Y.exports=z;function z(N,D){var R=W.partition(N,function(tt){return A.has(tt,"barycenter")}),_=R.lhs,I=A.sortBy(R.rhs,function(tt){return-tt.i}),L=[],G=0,K=0,X=0;_.sort(T(!!D)),X=C(L,I,X),A.forEach(_,function(tt){X+=tt.vs.length,L.push(tt.vs),G+=tt.barycenter*tt.weight,K+=tt.weight,X=C(L,I,X)});var et={vs:A.flatten(L,!0)};return K&&(et.barycenter=G/K,et.weight=K),et}function C(N,D,R){for(var _;D.length&&(_=A.last(D)).i<=R;)D.pop(),N.push(_.vs),R++;return R}function T(N){return function(D,R){return D.barycenter<R.barycenter?-1:D.barycenter>R.barycenter?1:N?R.i-D.i:D.i-R.i}}},71970:function(Y,Q,S){var A=S(72361);Y.exports=W;function W(T){var N=C(T);A.forEach(T.graph().dummyChains,function(D){for(var R=T.node(D),_=R.edgeObj,I=z(T,N,_.v,_.w),L=I.path,G=I.lca,K=0,X=L[K],et=!0;D!==_.w;){if(R=T.node(D),et){for(;(X=L[K])!==G&&T.node(X).maxRank<R.rank;)K++;X===G&&(et=!1)}if(!et){for(;K<L.length-1&&T.node(X=L[K+1]).minRank<=R.rank;)K++;X=L[K]}T.setParent(D,X),D=T.successors(D)[0]}})}function z(T,N,D,R){var _=[],I=[],L=Math.min(N[D].low,N[R].low),G=Math.max(N[D].lim,N[R].lim),K,X;K=D;do K=T.parent(K),_.push(K);while(K&&(N[K].low>L||G>N[K].lim));for(X=K,K=R;(K=T.parent(K))!==X;)I.push(K);return{path:_.concat(I.reverse()),lca:X}}function C(T){var N={},D=0;function R(_){var I=D;A.forEach(T.children(_),R),N[_]={low:I,lim:D++}}return A.forEach(T.children(),R),N}},92080:function(Y,Q,S){"use strict";var A=S(72361),W=S(76626).Graph,z=S(53063);Y.exports={positionX:et,findType1Conflicts:C,findType2Conflicts:T,addConflict:D,hasConflict:R,verticalAlignment:_,horizontalCompaction:I,alignCoordinates:K,findSmallestWidthAlignment:G,balance:X};function C(it,st){var ut={};function ht(mt,St){var Mt=0,pt=0,xt=mt.length,kt=A.last(St);return A.forEach(St,function(Gt,jt){var Ht=N(it,Gt),fe=Ht?it.node(Ht).order:xt;(Ht||Gt===kt)&&(A.forEach(St.slice(pt,jt+1),function(we){A.forEach(it.predecessors(we),function(Xe){var Hn=it.node(Xe),Ei=Hn.order;(Ei<Mt||fe<Ei)&&!(Hn.dummy&&it.node(we).dummy)&&D(ut,Xe,we)})}),pt=jt+1,Mt=fe)}),St}return A.reduce(st,ht),ut}function T(it,st){var ut={};function ht(St,Mt,pt,xt,kt){var Gt;A.forEach(A.range(Mt,pt),function(jt){Gt=St[jt],it.node(Gt).dummy&&A.forEach(it.predecessors(Gt),function(Ht){var fe=it.node(Ht);fe.dummy&&(fe.order<xt||fe.order>kt)&&D(ut,Ht,Gt)})})}function mt(St,Mt){var pt=-1,xt,kt=0;return A.forEach(Mt,function(Gt,jt){if(it.node(Gt).dummy==="border"){var Ht=it.predecessors(Gt);Ht.length&&(xt=it.node(Ht[0]).order,ht(Mt,kt,jt,pt,xt),kt=jt,pt=xt)}ht(Mt,kt,Mt.length,xt,St.length)}),Mt}return A.reduce(st,mt),ut}function N(it,st){if(it.node(st).dummy)return A.find(it.predecessors(st),function(ut){return it.node(ut).dummy})}function D(it,st,ut){if(st>ut){var ht=st;st=ut,ut=ht}var mt=it[st];mt||(it[st]=mt={}),mt[ut]=!0}function R(it,st,ut){if(st>ut){var ht=st;st=ut,ut=ht}return A.has(it[st],ut)}function _(it,st,ut,ht){var mt={},St={},Mt={};return A.forEach(st,function(pt){A.forEach(pt,function(xt,kt){mt[xt]=xt,St[xt]=xt,Mt[xt]=kt})}),A.forEach(st,function(pt){var xt=-1;A.forEach(pt,function(kt){var Gt=ht(kt);if(Gt.length){Gt=A.sortBy(Gt,function(Xe){return Mt[Xe]});for(var jt=(Gt.length-1)/2,Ht=Math.floor(jt),fe=Math.ceil(jt);Ht<=fe;++Ht){var we=Gt[Ht];St[kt]===kt&&xt<Mt[we]&&!R(ut,kt,we)&&(St[we]=kt,St[kt]=mt[kt]=mt[we],xt=Mt[we])}}})}),{root:mt,align:St}}function I(it,st,ut,ht,mt){var St={},Mt=L(it,st,ut,mt),pt=mt?"borderLeft":"borderRight";function xt(jt,Ht){for(var fe=Mt.nodes(),we=fe.pop(),Xe={};we;)Xe[we]?jt(we):(Xe[we]=!0,fe.push(we),fe=fe.concat(Ht(we))),we=fe.pop()}function kt(jt){St[jt]=Mt.inEdges(jt).reduce(function(Ht,fe){return Math.max(Ht,St[fe.v]+Mt.edge(fe))},0)}function Gt(jt){var Ht=Mt.outEdges(jt).reduce(function(we,Xe){return Math.min(we,St[Xe.w]-Mt.edge(Xe))},Number.POSITIVE_INFINITY),fe=it.node(jt);Ht!==Number.POSITIVE_INFINITY&&fe.borderType!==pt&&(St[jt]=Math.max(St[jt],Ht))}return xt(kt,Mt.predecessors.bind(Mt)),xt(Gt,Mt.successors.bind(Mt)),A.forEach(ht,function(jt){St[jt]=St[ut[jt]]}),St}function L(it,st,ut,ht){var mt=new W,St=it.graph(),Mt=tt(St.nodesep,St.edgesep,ht);return A.forEach(st,function(pt){var xt;A.forEach(pt,function(kt){var Gt=ut[kt];if(mt.setNode(Gt),xt){var jt=ut[xt],Ht=mt.edge(jt,Gt);mt.setEdge(jt,Gt,Math.max(Mt(it,kt,xt),Ht||0))}xt=kt})}),mt}function G(it,st){return A.minBy(A.values(st),function(ut){var ht=Number.NEGATIVE_INFINITY,mt=Number.POSITIVE_INFINITY;return A.forIn(ut,function(St,Mt){var pt=q(it,Mt)/2;ht=Math.max(St+pt,ht),mt=Math.min(St-pt,mt)}),ht-mt})}function K(it,st){var ut=A.values(st),ht=A.min(ut),mt=A.max(ut);A.forEach(["u","d"],function(St){A.forEach(["l","r"],function(Mt){var pt=St+Mt,xt=it[pt],kt;if(xt!==st){var Gt=A.values(xt);kt=Mt==="l"?ht-A.min(Gt):mt-A.max(Gt),kt&&(it[pt]=A.mapValues(xt,function(jt){return jt+kt}))}})})}function X(it,st){return A.mapValues(it.ul,function(ut,ht){if(st)return it[st.toLowerCase()][ht];var mt=A.sortBy(A.map(it,ht));return(mt[1]+mt[2])/2})}function et(it){var st=z.buildLayerMatrix(it),ut=A.merge(C(it,st),T(it,st)),ht={},mt;A.forEach(["u","d"],function(Mt){mt=Mt==="u"?st:A.values(st).reverse(),A.forEach(["l","r"],function(pt){pt==="r"&&(mt=A.map(mt,function(jt){return A.values(jt).reverse()}));var xt=(Mt==="u"?it.predecessors:it.successors).bind(it),kt=_(it,mt,ut,xt),Gt=I(it,mt,kt.root,kt.align,pt==="r");pt==="r"&&(Gt=A.mapValues(Gt,function(jt){return-jt})),ht[Mt+pt]=Gt})});var St=G(it,ht);return K(ht,St),X(ht,it.graph().align)}function tt(it,st,ut){return function(ht,mt,St){var Mt=ht.node(mt),pt=ht.node(St),xt=0,kt;if(xt+=Mt.width/2,A.has(Mt,"labelpos"))switch(Mt.labelpos.toLowerCase()){case"l":kt=-Mt.width/2;break;case"r":kt=Mt.width/2;break}if(kt&&(xt+=ut?kt:-kt),kt=0,xt+=(Mt.dummy?st:it)/2,xt+=(pt.dummy?st:it)/2,xt+=pt.width/2,A.has(pt,"labelpos"))switch(pt.labelpos.toLowerCase()){case"l":kt=pt.width/2;break;case"r":kt=-pt.width/2;break}return kt&&(xt+=ut?kt:-kt),kt=0,xt}}function q(it,st){return it.node(st).width}},93021:function(Y,Q,S){"use strict";var A=S(72361),W=S(53063),z=S(92080).positionX;Y.exports=C;function C(N){N=W.asNonCompoundGraph(N),T(N),A.forEach(z(N),function(D,R){N.node(R).x=D})}function T(N){var D=W.buildLayerMatrix(N),R=N.graph().ranksep,_=0;A.forEach(D,function(I){var L=A.max(A.map(I,function(G){return N.node(G).height}));A.forEach(I,function(G){N.node(G).y=_+L/2}),_+=L+R})}},61031:function(Y,Q,S){"use strict";var A=S(72361),W=S(76626).Graph,z=S(2416).slack;Y.exports=C;function C(R){var _=new W({directed:!1}),I=R.nodes()[0],L=R.nodeCount();_.setNode(I,{});for(var G,K;T(_,R)<L;)G=N(_,R),K=_.hasNode(G.v)?z(R,G):-z(R,G),D(_,R,K);return _}function T(R,_){function I(L){A.forEach(_.nodeEdges(L),function(G){var K=G.v,X=L===K?G.w:K;!R.hasNode(X)&&!z(_,G)&&(R.setNode(X,{}),R.setEdge(L,X,{}),I(X))})}return A.forEach(R.nodes(),I),R.nodeCount()}function N(R,_){return A.minBy(_.edges(),function(I){if(R.hasNode(I.v)!==R.hasNode(I.w))return z(_,I)})}function D(R,_,I){A.forEach(R.nodes(),function(L){_.node(L).rank+=I})}},64505:function(Y,Q,S){"use strict";var A=S(2416),W=A.longestPath,z=S(61031),C=S(77076);Y.exports=T;function T(_){switch(_.graph().ranker){case"network-simplex":R(_);break;case"tight-tree":D(_);break;case"longest-path":N(_);break;default:R(_)}}var N=W;function D(_){W(_),z(_)}function R(_){C(_)}},77076:function(Y,Q,S){"use strict";var A=S(72361),W=S(61031),z=S(2416).slack,C=S(2416).longestPath,T=S(76626).alg.preorder,N=S(76626).alg.postorder,D=S(53063).simplify;Y.exports=R,R.initLowLimValues=G,R.initCutValues=_,R.calcCutValue=L,R.leaveEdge=X,R.enterEdge=et,R.exchangeEdges=tt;function R(ut){ut=D(ut),C(ut);var ht=W(ut);G(ht),_(ht,ut);for(var mt,St;mt=X(ht);)St=et(ht,ut,mt),tt(ht,ut,mt,St)}function _(ut,ht){var mt=N(ut,ut.nodes());mt=mt.slice(0,mt.length-1),A.forEach(mt,function(St){I(ut,ht,St)})}function I(ut,ht,mt){var St=ut.node(mt),Mt=St.parent;ut.edge(mt,Mt).cutvalue=L(ut,ht,mt)}function L(ut,ht,mt){var St=ut.node(mt),Mt=St.parent,pt=!0,xt=ht.edge(mt,Mt),kt=0;return xt||(pt=!1,xt=ht.edge(Mt,mt)),kt=xt.weight,A.forEach(ht.nodeEdges(mt),function(Gt){var jt=Gt.v===mt,Ht=jt?Gt.w:Gt.v;if(Ht!==Mt){var fe=jt===pt,we=ht.edge(Gt).weight;if(kt+=fe?we:-we,it(ut,mt,Ht)){var Xe=ut.edge(mt,Ht).cutvalue;kt+=fe?-Xe:Xe}}}),kt}function G(ut,ht){arguments.length<2&&(ht=ut.nodes()[0]),K(ut,{},1,ht)}function K(ut,ht,mt,St,Mt){var pt=mt,xt=ut.node(St);return ht[St]=!0,A.forEach(ut.neighbors(St),function(kt){A.has(ht,kt)||(mt=K(ut,ht,mt,kt,St))}),xt.low=pt,xt.lim=mt++,Mt?xt.parent=Mt:delete xt.parent,mt}function X(ut){return A.find(ut.edges(),function(ht){return ut.edge(ht).cutvalue<0})}function et(ut,ht,mt){var St=mt.v,Mt=mt.w;ht.hasEdge(St,Mt)||(St=mt.w,Mt=mt.v);var pt=ut.node(St),xt=ut.node(Mt),kt=pt,Gt=!1;pt.lim>xt.lim&&(kt=xt,Gt=!0);var jt=A.filter(ht.edges(),function(Ht){return Gt===st(ut,ut.node(Ht.v),kt)&&Gt!==st(ut,ut.node(Ht.w),kt)});return A.minBy(jt,function(Ht){return z(ht,Ht)})}function tt(ut,ht,mt,St){var Mt=mt.v,pt=mt.w;ut.removeEdge(Mt,pt),ut.setEdge(St.v,St.w,{}),G(ut),_(ut,ht),q(ut,ht)}function q(ut,ht){var mt=A.find(ut.nodes(),function(Mt){return!ht.node(Mt).parent}),St=T(ut,mt);St=St.slice(1),A.forEach(St,function(Mt){var pt=ut.node(Mt).parent,xt=ht.edge(Mt,pt),kt=!1;xt||(xt=ht.edge(pt,Mt),kt=!0),ht.node(Mt).rank=ht.node(pt).rank+(kt?xt.minlen:-xt.minlen)})}function it(ut,ht,mt){return ut.hasEdge(ht,mt)}function st(ut,ht,mt){return mt.low<=ht.lim&&ht.lim<=mt.lim}},2416:function(Y,Q,S){"use strict";var A=S(72361);Y.exports={longestPath:W,slack:z};function W(C){var T={};function N(D){var R=C.node(D);if(A.has(T,D))return R.rank;T[D]=!0;var _=A.min(A.map(C.outEdges(D),function(I){return N(I.w)-C.edge(I).minlen}));return(_===Number.POSITIVE_INFINITY||_===void 0||_===null)&&(_=0),R.rank=_}A.forEach(C.sources(),N)}function z(C,T){return C.node(T.w).rank-C.node(T.v).rank-C.edge(T).minlen}},53063:function(Y,Q,S){"use strict";var A=S(72361),W=S(76626).Graph;Y.exports={addDummyNode:z,simplify:C,asNonCompoundGraph:T,successorWeights:N,predecessorWeights:D,intersectRect:R,buildLayerMatrix:_,normalizeRanks:I,removeEmptyRanks:L,addBorderNode:G,maxRank:K,partition:X,time:et,notime:tt};function z(q,it,st,ut){var ht;do ht=A.uniqueId(ut);while(q.hasNode(ht));return st.dummy=it,q.setNode(ht,st),ht}function C(q){var it=new W().setGraph(q.graph());return A.forEach(q.nodes(),function(st){it.setNode(st,q.node(st))}),A.forEach(q.edges(),function(st){var ut=it.edge(st.v,st.w)||{weight:0,minlen:1},ht=q.edge(st);it.setEdge(st.v,st.w,{weight:ut.weight+ht.weight,minlen:Math.max(ut.minlen,ht.minlen)})}),it}function T(q){var it=new W({multigraph:q.isMultigraph()}).setGraph(q.graph());return A.forEach(q.nodes(),function(st){q.children(st).length||it.setNode(st,q.node(st))}),A.forEach(q.edges(),function(st){it.setEdge(st,q.edge(st))}),it}function N(q){var it=A.map(q.nodes(),function(st){var ut={};return A.forEach(q.outEdges(st),function(ht){ut[ht.w]=(ut[ht.w]||0)+q.edge(ht).weight}),ut});return A.zipObject(q.nodes(),it)}function D(q){var it=A.map(q.nodes(),function(st){var ut={};return A.forEach(q.inEdges(st),function(ht){ut[ht.v]=(ut[ht.v]||0)+q.edge(ht).weight}),ut});return A.zipObject(q.nodes(),it)}function R(q,it){var st=q.x,ut=q.y,ht=it.x-st,mt=it.y-ut,St=q.width/2,Mt=q.height/2;if(!ht&&!mt)throw new Error("Not possible to find intersection inside of the rectangle");var pt,xt;return Math.abs(mt)*St>Math.abs(ht)*Mt?(mt<0&&(Mt=-Mt),pt=Mt*ht/mt,xt=Mt):(ht<0&&(St=-St),pt=St,xt=St*mt/ht),{x:st+pt,y:ut+xt}}function _(q){var it=A.map(A.range(K(q)+1),function(){return[]});return A.forEach(q.nodes(),function(st){var ut=q.node(st),ht=ut.rank;A.isUndefined(ht)||(it[ht][ut.order]=st)}),it}function I(q){var it=A.min(A.map(q.nodes(),function(st){return q.node(st).rank}));A.forEach(q.nodes(),function(st){var ut=q.node(st);A.has(ut,"rank")&&(ut.rank-=it)})}function L(q){var it=A.min(A.map(q.nodes(),function(mt){return q.node(mt).rank})),st=[];A.forEach(q.nodes(),function(mt){var St=q.node(mt).rank-it;st[St]||(st[St]=[]),st[St].push(mt)});var ut=0,ht=q.graph().nodeRankFactor;A.forEach(st,function(mt,St){A.isUndefined(mt)&&St%ht!==0?--ut:ut&&A.forEach(mt,function(Mt){q.node(Mt).rank+=ut})})}function G(q,it,st,ut){var ht={width:0,height:0};return arguments.length>=4&&(ht.rank=st,ht.order=ut),z(q,"border",ht,it)}function K(q){return A.max(A.map(q.nodes(),function(it){var st=q.node(it).rank;if(!A.isUndefined(st))return st}))}function X(q,it){var st={lhs:[],rhs:[]};return A.forEach(q,function(ut){it(ut)?st.lhs.push(ut):st.rhs.push(ut)}),st}function et(q,it){var st=A.now();try{return it()}finally{console.log(q+" time: "+(A.now()-st)+"ms")}}function tt(q,it){return it()}},11897:function(Y){Y.exports="0.8.5"},37271:function(Y){"use strict";var Q=Object.prototype.hasOwnProperty,S="~";function A(){}Object.create&&(A.prototype=Object.create(null),new A().__proto__||(S=!1));function W(N,D,R){this.fn=N,this.context=D,this.once=R||!1}function z(N,D,R,_,I){if(typeof R!="function")throw new TypeError("The listener must be a function");var L=new W(R,_||N,I),G=S?S+D:D;return N._events[G]?N._events[G].fn?N._events[G]=[N._events[G],L]:N._events[G].push(L):(N._events[G]=L,N._eventsCount++),N}function C(N,D){--N._eventsCount===0?N._events=new A:delete N._events[D]}function T(){this._events=new A,this._eventsCount=0}T.prototype.eventNames=function(){var D=[],R,_;if(this._eventsCount===0)return D;for(_ in R=this._events)Q.call(R,_)&&D.push(S?_.slice(1):_);return Object.getOwnPropertySymbols?D.concat(Object.getOwnPropertySymbols(R)):D},T.prototype.listeners=function(D){var R=S?S+D:D,_=this._events[R];if(!_)return[];if(_.fn)return[_.fn];for(var I=0,L=_.length,G=new Array(L);I<L;I++)G[I]=_[I].fn;return G},T.prototype.listenerCount=function(D){var R=S?S+D:D,_=this._events[R];return _?_.fn?1:_.length:0},T.prototype.emit=function(D,R,_,I,L,G){var K=S?S+D:D;if(!this._events[K])return!1;var X=this._events[K],et=arguments.length,tt,q;if(X.fn){switch(X.once&&this.removeListener(D,X.fn,void 0,!0),et){case 1:return X.fn.call(X.context),!0;case 2:return X.fn.call(X.context,R),!0;case 3:return X.fn.call(X.context,R,_),!0;case 4:return X.fn.call(X.context,R,_,I),!0;case 5:return X.fn.call(X.context,R,_,I,L),!0;case 6:return X.fn.call(X.context,R,_,I,L,G),!0}for(q=1,tt=new Array(et-1);q<et;q++)tt[q-1]=arguments[q];X.fn.apply(X.context,tt)}else{var it=X.length,st;for(q=0;q<it;q++)switch(X[q].once&&this.removeListener(D,X[q].fn,void 0,!0),et){case 1:X[q].fn.call(X[q].context);break;case 2:X[q].fn.call(X[q].context,R);break;case 3:X[q].fn.call(X[q].context,R,_);break;case 4:X[q].fn.call(X[q].context,R,_,I);break;default:if(!tt)for(st=1,tt=new Array(et-1);st<et;st++)tt[st-1]=arguments[st];X[q].fn.apply(X[q].context,tt)}}return!0},T.prototype.on=function(D,R,_){return z(this,D,R,_,!1)},T.prototype.once=function(D,R,_){return z(this,D,R,_,!0)},T.prototype.removeListener=function(D,R,_,I){var L=S?S+D:D;if(!this._events[L])return this;if(!R)return C(this,L),this;var G=this._events[L];if(G.fn)G.fn===R&&(!I||G.once)&&(!_||G.context===_)&&C(this,L);else{for(var K=0,X=[],et=G.length;K<et;K++)(G[K].fn!==R||I&&!G[K].once||_&&G[K].context!==_)&&X.push(G[K]);X.length?this._events[L]=X.length===1?X[0]:X:C(this,L)}return this},T.prototype.removeAllListeners=function(D){var R;return D?(R=S?S+D:D,this._events[R]&&C(this,R)):(this._events=new A,this._eventsCount=0),this},T.prototype.off=T.prototype.removeListener,T.prototype.addListener=T.prototype.on,T.prefixed=S,T.EventEmitter=T,Y.exports=T},75172:function(Y,Q,S){var A=S(89224);Y.exports={Graph:A.Graph,json:S(17401),alg:S(54613),version:A.version}},91606:function(Y,Q,S){var A=S(95329);Y.exports=W;function W(z){var C={},T=[],N;function D(R){A.has(C,R)||(C[R]=!0,N.push(R),A.each(z.successors(R),D),A.each(z.predecessors(R),D))}return A.each(z.nodes(),function(R){N=[],D(R),N.length&&T.push(N)}),T}},21482:function(Y,Q,S){var A=S(95329);Y.exports=W;function W(C,T,N){A.isArray(T)||(T=[T]);var D=(C.isDirected()?C.successors:C.neighbors).bind(C),R=[],_={};return A.each(T,function(I){if(!C.hasNode(I))throw new Error("Graph does not have node: "+I);z(C,I,N==="post",_,D,R)}),R}function z(C,T,N,D,R,_){A.has(D,T)||(D[T]=!0,N||_.push(T),A.each(R(T),function(I){z(C,I,N,D,R,_)}),N&&_.push(T))}},40845:function(Y,Q,S){var A=S(13746),W=S(95329);Y.exports=z;function z(C,T,N){return W.transform(C.nodes(),function(D,R){D[R]=A(C,R,T,N)},{})}},13746:function(Y,Q,S){var A=S(95329),W=S(36614);Y.exports=C;var z=A.constant(1);function C(N,D,R,_){return T(N,String(D),R||z,_||function(I){return N.outEdges(I)})}function T(N,D,R,_){var I={},L=new W,G,K,X=function(et){var tt=et.v!==G?et.v:et.w,q=I[tt],it=R(et),st=K.distance+it;if(it<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+et+" Weight: "+it);st<q.distance&&(q.distance=st,q.predecessor=G,L.decrease(tt,st))};for(N.nodes().forEach(function(et){var tt=et===D?0:Number.POSITIVE_INFINITY;I[et]={distance:tt},L.add(et,tt)});L.size()>0&&(G=L.removeMin(),K=I[G],K.distance!==Number.POSITIVE_INFINITY);)_(G).forEach(X);return I}},59324:function(Y,Q,S){var A=S(95329),W=S(94558);Y.exports=z;function z(C){return A.filter(W(C),function(T){return T.length>1||T.length===1&&C.hasEdge(T[0],T[0])})}},22893:function(Y,Q,S){var A=S(95329);Y.exports=z;var W=A.constant(1);function z(T,N,D){return C(T,N||W,D||function(R){return T.outEdges(R)})}function C(T,N,D){var R={},_=T.nodes();return _.forEach(function(I){R[I]={},R[I][I]={distance:0},_.forEach(function(L){I!==L&&(R[I][L]={distance:Number.POSITIVE_INFINITY})}),D(I).forEach(function(L){var G=L.v===I?L.w:L.v,K=N(L);R[I][G]={distance:K,predecessor:I}})}),_.forEach(function(I){var L=R[I];_.forEach(function(G){var K=R[G];_.forEach(function(X){var et=K[I],tt=L[X],q=K[X],it=et.distance+tt.distance;it<q.distance&&(q.distance=it,q.predecessor=tt.predecessor)})})}),R}},54613:function(Y,Q,S){Y.exports={components:S(91606),dijkstra:S(13746),dijkstraAll:S(40845),findCycles:S(59324),floydWarshall:S(22893),isAcyclic:S(588),postorder:S(98049),preorder:S(67158),prim:S(66058),tarjan:S(94558),topsort:S(7793)}},588:function(Y,Q,S){var A=S(7793);Y.exports=W;function W(z){try{A(z)}catch(C){if(C instanceof A.CycleException)return!1;throw C}return!0}},98049:function(Y,Q,S){var A=S(21482);Y.exports=W;function W(z,C){return A(z,C,"post")}},67158:function(Y,Q,S){var A=S(21482);Y.exports=W;function W(z,C){return A(z,C,"pre")}},66058:function(Y,Q,S){var A=S(95329),W=S(6349),z=S(36614);Y.exports=C;function C(T,N){var D=new W,R={},_=new z,I;function L(K){var X=K.v===I?K.w:K.v,et=_.priority(X);if(et!==void 0){var tt=N(K);tt<et&&(R[X]=I,_.decrease(X,tt))}}if(T.nodeCount()===0)return D;A.each(T.nodes(),function(K){_.add(K,Number.POSITIVE_INFINITY),D.setNode(K)}),_.decrease(T.nodes()[0],0);for(var G=!1;_.size()>0;){if(I=_.removeMin(),A.has(R,I))D.setEdge(I,R[I]);else{if(G)throw new Error("Input graph is not connected: "+T);G=!0}T.nodeEdges(I).forEach(L)}return D}},94558:function(Y,Q,S){var A=S(95329);Y.exports=W;function W(z){var C=0,T=[],N={},D=[];function R(_){var I=N[_]={onStack:!0,lowlink:C,index:C++};if(T.push(_),z.successors(_).forEach(function(K){A.has(N,K)?N[K].onStack&&(I.lowlink=Math.min(I.lowlink,N[K].index)):(R(K),I.lowlink=Math.min(I.lowlink,N[K].lowlink))}),I.lowlink===I.index){var L=[],G;do G=T.pop(),N[G].onStack=!1,L.push(G);while(_!==G);D.push(L)}}return z.nodes().forEach(function(_){A.has(N,_)||R(_)}),D}},7793:function(Y,Q,S){var A=S(95329);Y.exports=W,W.CycleException=z;function W(C){var T={},N={},D=[];function R(_){if(A.has(N,_))throw new z;A.has(T,_)||(N[_]=!0,T[_]=!0,A.each(C.predecessors(_),R),delete N[_],D.push(_))}if(A.each(C.sinks(),R),A.size(T)!==C.nodeCount())throw new z;return D}function z(){}z.prototype=new Error},36614:function(Y,Q,S){var A=S(95329);Y.exports=W;function W(){this._arr=[],this._keyIndices={}}W.prototype.size=function(){return this._arr.length},W.prototype.keys=function(){return this._arr.map(function(z){return z.key})},W.prototype.has=function(z){return A.has(this._keyIndices,z)},W.prototype.priority=function(z){var C=this._keyIndices[z];if(C!==void 0)return this._arr[C].priority},W.prototype.min=function(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key},W.prototype.add=function(z,C){var T=this._keyIndices;if(z=String(z),!A.has(T,z)){var N=this._arr,D=N.length;return T[z]=D,N.push({key:z,priority:C}),this._decrease(D),!0}return!1},W.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var z=this._arr.pop();return delete this._keyIndices[z.key],this._heapify(0),z.key},W.prototype.decrease=function(z,C){var T=this._keyIndices[z];if(C>this._arr[T].priority)throw new Error("New priority is greater than current priority. Key: "+z+" Old: "+this._arr[T].priority+" New: "+C);this._arr[T].priority=C,this._decrease(T)},W.prototype._heapify=function(z){var C=this._arr,T=2*z,N=T+1,D=z;T<C.length&&(D=C[T].priority<C[D].priority?T:D,N<C.length&&(D=C[N].priority<C[D].priority?N:D),D!==z&&(this._swap(z,D),this._heapify(D)))},W.prototype._decrease=function(z){for(var C=this._arr,T=C[z].priority,N;z!==0&&(N=z>>1,!(C[N].priority<T));)this._swap(z,N),z=N},W.prototype._swap=function(z,C){var T=this._arr,N=this._keyIndices,D=T[z],R=T[C];T[z]=R,T[C]=D,N[R.key]=z,N[D.key]=C}},6349:function(Y,Q,S){"use strict";var A=S(95329);Y.exports=T;var W="\0",z="\0",C="";function T(L){this._isDirected=A.has(L,"directed")?L.directed:!0,this._isMultigraph=A.has(L,"multigraph")?L.multigraph:!1,this._isCompound=A.has(L,"compound")?L.compound:!1,this._label=void 0,this._defaultNodeLabelFn=A.constant(void 0),this._defaultEdgeLabelFn=A.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[z]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}T.prototype._nodeCount=0,T.prototype._edgeCount=0,T.prototype.isDirected=function(){return this._isDirected},T.prototype.isMultigraph=function(){return this._isMultigraph},T.prototype.isCompound=function(){return this._isCompound},T.prototype.setGraph=function(L){return this._label=L,this},T.prototype.graph=function(){return this._label},T.prototype.setDefaultNodeLabel=function(L){return A.isFunction(L)||(L=A.constant(L)),this._defaultNodeLabelFn=L,this},T.prototype.nodeCount=function(){return this._nodeCount},T.prototype.nodes=function(){return A.keys(this._nodes)},T.prototype.sources=function(){var L=this;return A.filter(this.nodes(),function(G){return A.isEmpty(L._in[G])})},T.prototype.sinks=function(){var L=this;return A.filter(this.nodes(),function(G){return A.isEmpty(L._out[G])})},T.prototype.setNodes=function(L,G){var K=arguments,X=this;return A.each(L,function(et){K.length>1?X.setNode(et,G):X.setNode(et)}),this},T.prototype.setNode=function(L,G){return A.has(this._nodes,L)?(arguments.length>1&&(this._nodes[L]=G),this):(this._nodes[L]=arguments.length>1?G:this._defaultNodeLabelFn(L),this._isCompound&&(this._parent[L]=z,this._children[L]={},this._children[z][L]=!0),this._in[L]={},this._preds[L]={},this._out[L]={},this._sucs[L]={},++this._nodeCount,this)},T.prototype.node=function(L){return this._nodes[L]},T.prototype.hasNode=function(L){return A.has(this._nodes,L)},T.prototype.removeNode=function(L){var G=this;if(A.has(this._nodes,L)){var K=function(X){G.removeEdge(G._edgeObjs[X])};delete this._nodes[L],this._isCompound&&(this._removeFromParentsChildList(L),delete this._parent[L],A.each(this.children(L),function(X){G.setParent(X)}),delete this._children[L]),A.each(A.keys(this._in[L]),K),delete this._in[L],delete this._preds[L],A.each(A.keys(this._out[L]),K),delete this._out[L],delete this._sucs[L],--this._nodeCount}return this},T.prototype.setParent=function(L,G){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(A.isUndefined(G))G=z;else{G+="";for(var K=G;!A.isUndefined(K);K=this.parent(K))if(K===L)throw new Error("Setting "+G+" as parent of "+L+" would create a cycle");this.setNode(G)}return this.setNode(L),this._removeFromParentsChildList(L),this._parent[L]=G,this._children[G][L]=!0,this},T.prototype._removeFromParentsChildList=function(L){delete this._children[this._parent[L]][L]},T.prototype.parent=function(L){if(this._isCompound){var G=this._parent[L];if(G!==z)return G}},T.prototype.children=function(L){if(A.isUndefined(L)&&(L=z),this._isCompound){var G=this._children[L];if(G)return A.keys(G)}else{if(L===z)return this.nodes();if(this.hasNode(L))return[]}},T.prototype.predecessors=function(L){var G=this._preds[L];if(G)return A.keys(G)},T.prototype.successors=function(L){var G=this._sucs[L];if(G)return A.keys(G)},T.prototype.neighbors=function(L){var G=this.predecessors(L);if(G)return A.union(G,this.successors(L))},T.prototype.isLeaf=function(L){var G;return this.isDirected()?G=this.successors(L):G=this.neighbors(L),G.length===0},T.prototype.filterNodes=function(L){var G=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});G.setGraph(this.graph());var K=this;A.each(this._nodes,function(tt,q){L(q)&&G.setNode(q,tt)}),A.each(this._edgeObjs,function(tt){G.hasNode(tt.v)&&G.hasNode(tt.w)&&G.setEdge(tt,K.edge(tt))});var X={};function et(tt){var q=K.parent(tt);return q===void 0||G.hasNode(q)?(X[tt]=q,q):q in X?X[q]:et(q)}return this._isCompound&&A.each(G.nodes(),function(tt){G.setParent(tt,et(tt))}),G},T.prototype.setDefaultEdgeLabel=function(L){return A.isFunction(L)||(L=A.constant(L)),this._defaultEdgeLabelFn=L,this},T.prototype.edgeCount=function(){return this._edgeCount},T.prototype.edges=function(){return A.values(this._edgeObjs)},T.prototype.setPath=function(L,G){var K=this,X=arguments;return A.reduce(L,function(et,tt){return X.length>1?K.setEdge(et,tt,G):K.setEdge(et,tt),tt}),this},T.prototype.setEdge=function(){var L,G,K,X,et=!1,tt=arguments[0];typeof tt=="object"&&tt!==null&&"v"in tt?(L=tt.v,G=tt.w,K=tt.name,arguments.length===2&&(X=arguments[1],et=!0)):(L=tt,G=arguments[1],K=arguments[3],arguments.length>2&&(X=arguments[2],et=!0)),L=""+L,G=""+G,A.isUndefined(K)||(K=""+K);var q=R(this._isDirected,L,G,K);if(A.has(this._edgeLabels,q))return et&&(this._edgeLabels[q]=X),this;if(!A.isUndefined(K)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(L),this.setNode(G),this._edgeLabels[q]=et?X:this._defaultEdgeLabelFn(L,G,K);var it=_(this._isDirected,L,G,K);return L=it.v,G=it.w,Object.freeze(it),this._edgeObjs[q]=it,N(this._preds[G],L),N(this._sucs[L],G),this._in[G][q]=it,this._out[L][q]=it,this._edgeCount++,this},T.prototype.edge=function(L,G,K){var X=arguments.length===1?I(this._isDirected,arguments[0]):R(this._isDirected,L,G,K);return this._edgeLabels[X]},T.prototype.hasEdge=function(L,G,K){var X=arguments.length===1?I(this._isDirected,arguments[0]):R(this._isDirected,L,G,K);return A.has(this._edgeLabels,X)},T.prototype.removeEdge=function(L,G,K){var X=arguments.length===1?I(this._isDirected,arguments[0]):R(this._isDirected,L,G,K),et=this._edgeObjs[X];return et&&(L=et.v,G=et.w,delete this._edgeLabels[X],delete this._edgeObjs[X],D(this._preds[G],L),D(this._sucs[L],G),delete this._in[G][X],delete this._out[L][X],this._edgeCount--),this},T.prototype.inEdges=function(L,G){var K=this._in[L];if(K){var X=A.values(K);return G?A.filter(X,function(et){return et.v===G}):X}},T.prototype.outEdges=function(L,G){var K=this._out[L];if(K){var X=A.values(K);return G?A.filter(X,function(et){return et.w===G}):X}},T.prototype.nodeEdges=function(L,G){var K=this.inEdges(L,G);if(K)return K.concat(this.outEdges(L,G))};function N(L,G){L[G]?L[G]++:L[G]=1}function D(L,G){--L[G]||delete L[G]}function R(L,G,K,X){var et=""+G,tt=""+K;if(!L&&et>tt){var q=et;et=tt,tt=q}return et+C+tt+C+(A.isUndefined(X)?W:X)}function _(L,G,K,X){var et=""+G,tt=""+K;if(!L&&et>tt){var q=et;et=tt,tt=q}var it={v:et,w:tt};return X&&(it.name=X),it}function I(L,G){return R(L,G.v,G.w,G.name)}},89224:function(Y,Q,S){Y.exports={Graph:S(6349),version:S(16544)}},17401:function(Y,Q,S){var A=S(95329),W=S(6349);Y.exports={write:z,read:N};function z(D){var R={options:{directed:D.isDirected(),multigraph:D.isMultigraph(),compound:D.isCompound()},nodes:C(D),edges:T(D)};return A.isUndefined(D.graph())||(R.value=A.clone(D.graph())),R}function C(D){return A.map(D.nodes(),function(R){var _=D.node(R),I=D.parent(R),L={v:R};return A.isUndefined(_)||(L.value=_),A.isUndefined(I)||(L.parent=I),L})}function T(D){return A.map(D.edges(),function(R){var _=D.edge(R),I={v:R.v,w:R.w};return A.isUndefined(R.name)||(I.name=R.name),A.isUndefined(_)||(I.value=_),I})}function N(D){var R=new W(D.options).setGraph(D.value);return A.each(D.nodes,function(_){R.setNode(_.v,_.value),_.parent&&R.setParent(_.v,_.parent)}),A.each(D.edges,function(_){R.setEdge({v:_.v,w:_.w,name:_.name},_.value)}),R}},95329:function(Y,Q,S){var A;try{A={clone:S(76833),constant:S(13503),each:S(76934),filter:S(64725),has:S(99946),isArray:S(80744),isEmpty:S(61627),isFunction:S(9363),isUndefined:S(16513),keys:S(55451),map:S(9924),reduce:S(16473),size:S(40617),transform:S(91116),union:S(44065),values:S(81229)}}catch(W){}A||(A=window._),Y.exports=A},16544:function(Y){Y.exports="2.1.8"},34634:function(Y,Q,S){"use strict";S.r(Q),S.d(Q,{isAnyArray:function(){return W}});const A=Object.prototype.toString;function W(z){const C=A.call(z);return C.endsWith("Array]")&&!C.includes("Big")}},55973:function(Y){Y.exports=function(S){return!S||typeof S=="string"?!1:S instanceof Array||Array.isArray(S)||S.length>=0&&(S.splice instanceof Function||Object.getOwnPropertyDescriptor(S,S.length-1)&&S.constructor.name!=="String")}},15584:function(Y,Q,S){var A=S(73893),W=S(33152),z=A(W,"DataView");Y.exports=z},97288:function(Y,Q,S){var A=S(73893),W=S(33152),z=A(W,"Promise");Y.exports=z},23599:function(Y,Q,S){var A=S(73893),W=S(33152),z=A(W,"Set");Y.exports=z},98924:function(Y,Q,S){var A=S(52166),W=S(34776),z=S(40393);function C(T){var N=-1,D=T==null?0:T.length;for(this.__data__=new A;++N<D;)this.add(T[N])}C.prototype.add=C.prototype.push=W,C.prototype.has=z,Y.exports=C},26873:function(Y,Q,S){var A=S(73893),W=S(33152),z=A(W,"WeakMap");Y.exports=z},74809:function(Y){function Q(S,A){for(var W=-1,z=S==null?0:S.length;++W<z&&A(S[W],W,S)!==!1;);return S}Y.exports=Q},86952:function(Y){function Q(S,A){for(var W=-1,z=S==null?0:S.length,C=0,T=[];++W<z;){var N=S[W];A(N,W,S)&&(T[C++]=N)}return T}Y.exports=Q},84271:function(Y,Q,S){var A=S(17424);function W(z,C){var T=z==null?0:z.length;return!!T&&A(z,C,0)>-1}Y.exports=W},94874:function(Y){function Q(S,A,W){for(var z=-1,C=S==null?0:S.length;++z<C;)if(W(A,S[z]))return!0;return!1}Y.exports=Q},75010:function(Y){function Q(S,A){for(var W=-1,z=S==null?0:S.length,C=Array(z);++W<z;)C[W]=A(S[W],W,S);return C}Y.exports=Q},57095:function(Y){function Q(S,A){for(var W=-1,z=A.length,C=S.length;++W<z;)S[C+W]=A[W];return S}Y.exports=Q},99861:function(Y){function Q(S,A,W,z){var C=-1,T=S==null?0:S.length;for(z&&T&&(W=S[++C]);++C<T;)W=A(W,S[C],C,S);return W}Y.exports=Q},64045:function(Y){function Q(S,A){for(var W=-1,z=S==null?0:S.length;++W<z;)if(A(S[W],W,S))return!0;return!1}Y.exports=Q},26539:function(Y,Q,S){var A=S(22310),W=A("length");Y.exports=W},91937:function(Y,Q,S){var A=S(95378),W=S(55451);function z(C,T){return C&&A(T,W(T),C)}Y.exports=z},26680:function(Y,Q,S){var A=S(95378),W=S(56730);function z(C,T){return C&&A(T,W(T),C)}Y.exports=z},99045:function(Y,Q,S){var A=S(91866),W=S(74809),z=S(60348),C=S(91937),T=S(26680),N=S(32315),D=S(47760),R=S(15168),_=S(71678),I=S(12076),L=S(22675),G=S(66139),K=S(79264),X=S(97541),et=S(4084),tt=S(80744),q=S(57835),it=S(41626),st=S(20816),ut=S(65226),ht=S(55451),mt=S(56730),St=1,Mt=2,pt=4,xt="[object Arguments]",kt="[object Array]",Gt="[object Boolean]",jt="[object Date]",Ht="[object Error]",fe="[object Function]",we="[object GeneratorFunction]",Xe="[object Map]",Hn="[object Number]",Ei="[object Object]",Ra="[object RegExp]",cs="[object Set]",Rt="[object String]",_t="[object Symbol]",Bt="[object WeakMap]",dt="[object ArrayBuffer]",wt="[object DataView]",Ot="[object Float32Array]",Zt="[object Float64Array]",ve="[object Int8Array]",Be="[object Int16Array]",ge="[object Int32Array]",ke="[object Uint8Array]",Ve="[object Uint8ClampedArray]",vn="[object Uint16Array]",Ce="[object Uint32Array]",Se={};Se[xt]=Se[kt]=Se[dt]=Se[wt]=Se[Gt]=Se[jt]=Se[Ot]=Se[Zt]=Se[ve]=Se[Be]=Se[ge]=Se[Xe]=Se[Hn]=Se[Ei]=Se[Ra]=Se[cs]=Se[Rt]=Se[_t]=Se[ke]=Se[Ve]=Se[vn]=Se[Ce]=!0,Se[Ht]=Se[fe]=Se[Bt]=!1;function ye(Pe,mr,Sn,ne,La,Br){var Xn,Fr=mr&St,us=mr&Mt,$l=mr&pt;if(Sn&&(Xn=La?Sn(Pe,ne,La,Br):Sn(Pe)),Xn!==void 0)return Xn;if(!st(Pe))return Pe;var Zo=tt(Pe);if(Zo){if(Xn=K(Pe),!Fr)return D(Pe,Xn)}else{var pa=G(Pe),Ji=pa==fe||pa==we;if(q(Pe))return N(Pe,Fr);if(pa==Ei||pa==xt||Ji&&!La){if(Xn=us||Ji?{}:et(Pe),!Fr)return us?_(Pe,T(Xn,Pe)):R(Pe,C(Xn,Pe))}else{if(!Se[pa])return La?Pe:{};Xn=X(Pe,pa,Fr)}}Br||(Br=new A);var eo=Br.get(Pe);if(eo)return eo;Br.set(Pe,Xn),ut(Pe)?Pe.forEach(function(si){Xn.add(ye(si,mr,Sn,si,Pe,Br))}):it(Pe)&&Pe.forEach(function(si,Di){Xn.set(Di,ye(si,mr,Sn,Di,Pe,Br))});var hs=$l?us?L:I:us?mt:ht,Vo=Zo?void 0:hs(Pe);return W(Vo||Pe,function(si,Di){Vo&&(Di=si,si=Pe[Di]),z(Xn,Di,ye(si,mr,Sn,Di,Pe,Br))}),Xn}Y.exports=ye},44107:function(Y,Q,S){var A=S(85605),W=S(49164),z=W(A);Y.exports=z},2659:function(Y,Q,S){var A=S(45029);function W(z,C,T){for(var N=-1,D=z.length;++N<D;){var R=z[N],_=C(R);if(_!=null&&(I===void 0?_===_&&!A(_):T(_,I)))var I=_,L=R}return L}Y.exports=W},32872:function(Y,Q,S){var A=S(44107);function W(z,C){var T=[];return A(z,function(N,D,R){C(N,D,R)&&T.push(N)}),T}Y.exports=W},51533:function(Y){function Q(S,A,W,z){for(var C=S.length,T=W+(z?1:-1);z?T--:++T<C;)if(A(S[T],T,S))return T;return-1}Y.exports=Q},9256:function(Y,Q,S){var A=S(57095),W=S(88133);function z(C,T,N,D,R){var _=-1,I=C.length;for(N||(N=W),R||(R=[]);++_<I;){var L=C[_];T>0&&N(L)?T>1?z(L,T-1,N,D,R):A(R,L):D||(R[R.length]=L)}return R}Y.exports=z},85605:function(Y,Q,S){var A=S(14018),W=S(55451);function z(C,T){return C&&A(C,T,W)}Y.exports=z},89147:function(Y,Q,S){var A=S(1186),W=S(9171);function z(C,T){T=A(T,C);for(var N=0,D=T.length;C!=null&&N<D;)C=C[W(T[N++])];return N&&N==D?C:void 0}Y.exports=z},75635:function(Y,Q,S){var A=S(57095),W=S(80744);function z(C,T,N){var D=T(C);return W(C)?D:A(D,N(C))}Y.exports=z},40302:function(Y){function Q(S,A){return S>A}Y.exports=Q},3251:function(Y){var Q=Object.prototype,S=Q.hasOwnProperty;function A(W,z){return W!=null&&S.call(W,z)}Y.exports=A},62348:function(Y){function Q(S,A){return S!=null&&A in Object(S)}Y.exports=Q},17424:function(Y,Q,S){var A=S(51533),W=S(8373),z=S(49237);function C(T,N,D){return N===N?z(T,N,D):A(T,W,D)}Y.exports=C},77295:function(Y,Q,S){var A=S(84412),W=S(93913);function z(C,T,N,D,R){return C===T?!0:C==null||T==null||!W(C)&&!W(T)?C!==C&&T!==T:A(C,T,N,D,z,R)}Y.exports=z},84412:function(Y,Q,S){var A=S(91866),W=S(50401),z=S(57710),C=S(4983),T=S(66139),N=S(80744),D=S(57835),R=S(18397),_=1,I="[object Arguments]",L="[object Array]",G="[object Object]",K=Object.prototype,X=K.hasOwnProperty;function et(tt,q,it,st,ut,ht){var mt=N(tt),St=N(q),Mt=mt?L:T(tt),pt=St?L:T(q);Mt=Mt==I?G:Mt,pt=pt==I?G:pt;var xt=Mt==G,kt=pt==G,Gt=Mt==pt;if(Gt&&D(tt)){if(!D(q))return!1;mt=!0,xt=!1}if(Gt&&!xt)return ht||(ht=new A),mt||R(tt)?W(tt,q,it,st,ut,ht):z(tt,q,Mt,it,st,ut,ht);if(!(it&_)){var jt=xt&&X.call(tt,"__wrapped__"),Ht=kt&&X.call(q,"__wrapped__");if(jt||Ht){var fe=jt?tt.value():tt,we=Ht?q.value():q;return ht||(ht=new A),ut(fe,we,it,st,ht)}}return Gt?(ht||(ht=new A),C(tt,q,it,st,ut,ht)):!1}Y.exports=et},55005:function(Y,Q,S){var A=S(66139),W=S(93913),z="[object Map]";function C(T){return W(T)&&A(T)==z}Y.exports=C},51524:function(Y,Q,S){var A=S(91866),W=S(77295),z=1,C=2;function T(N,D,R,_){var I=R.length,L=I,G=!_;if(N==null)return!L;for(N=Object(N);I--;){var K=R[I];if(G&&K[2]?K[1]!==N[K[0]]:!(K[0]in N))return!1}for(;++I<L;){K=R[I];var X=K[0],et=N[X],tt=K[1];if(G&&K[2]){if(et===void 0&&!(X in N))return!1}else{var q=new A;if(_)var it=_(et,tt,X,N,D,q);if(!(it===void 0?W(tt,et,z|C,_,q):it))return!1}}return!0}Y.exports=T},8373:function(Y){function Q(S){return S!==S}Y.exports=Q},38652:function(Y,Q,S){var A=S(66139),W=S(93913),z="[object Set]";function C(T){return W(T)&&A(T)==z}Y.exports=C},95979:function(Y,Q,S){var A=S(17632),W=S(38933),z=S(46962),C=S(80744),T=S(35769);function N(D){return typeof D=="function"?D:D==null?z:typeof D=="object"?C(D)?W(D[0],D[1]):A(D):T(D)}Y.exports=N},6019:function(Y,Q,S){var A=S(7975),W=S(23730),z=Object.prototype,C=z.hasOwnProperty;function T(N){if(!A(N))return W(N);var D=[];for(var R in Object(N))C.call(N,R)&&R!="constructor"&&D.push(R);return D}Y.exports=T},93757:function(Y){function Q(S,A){return S<A}Y.exports=Q},65487:function(Y,Q,S){var A=S(44107),W=S(24665);function z(C,T){var N=-1,D=W(C)?Array(C.length):[];return A(C,function(R,_,I){D[++N]=T(R,_,I)}),D}Y.exports=z},17632:function(Y,Q,S){var A=S(51524),W=S(10261),z=S(24122);function C(T){var N=W(T);return N.length==1&&N[0][2]?z(N[0][0],N[0][1]):function(D){return D===T||A(D,T,N)}}Y.exports=C},38933:function(Y,Q,S){var A=S(77295),W=S(44231),z=S(37879),C=S(86773),T=S(88411),N=S(24122),D=S(9171),R=1,_=2;function I(L,G){return C(L)&&T(G)?N(D(L),G):function(K){var X=W(K,L);return X===void 0&&X===G?z(K,L):A(G,X,R|_)}}Y.exports=I},58506:function(Y,Q,S){var A=S(75010),W=S(89147),z=S(95979),C=S(65487),T=S(33065),N=S(38342),D=S(11249),R=S(46962),_=S(80744);function I(L,G,K){G.length?G=A(G,function(tt){return _(tt)?function(q){return W(q,tt.length===1?tt[0]:tt)}:tt}):G=[R];var X=-1;G=A(G,N(z));var et=C(L,function(tt,q,it){var st=A(G,function(ut){return ut(tt)});return{criteria:st,index:++X,value:tt}});return T(et,function(tt,q){return D(tt,q,K)})}Y.exports=I},88832:function(Y,Q,S){var A=S(10867),W=S(37879);function z(C,T){return A(C,T,function(N,D){return W(C,D)})}Y.exports=z},10867:function(Y,Q,S){var A=S(89147),W=S(36897),z=S(1186);function C(T,N,D){for(var R=-1,_=N.length,I={};++R<_;){var L=N[R],G=A(T,L);D(G,L)&&W(I,z(L,T),G)}return I}Y.exports=C},22310:function(Y){function Q(S){return function(A){return A==null?void 0:A[S]}}Y.exports=Q},96916:function(Y,Q,S){var A=S(89147);function W(z){return function(C){return A(C,z)}}Y.exports=W},36121:function(Y){var Q=Math.ceil,S=Math.max;function A(W,z,C,T){for(var N=-1,D=S(Q((z-W)/(C||1)),0),R=Array(D);D--;)R[T?D:++N]=W,W+=C;return R}Y.exports=A},30739:function(Y){function Q(S,A,W,z,C){return C(S,function(T,N,D){W=z?(z=!1,T):A(W,T,N,D)}),W}Y.exports=Q},36897:function(Y,Q,S){var A=S(60348),W=S(1186),z=S(70213),C=S(20816),T=S(9171);function N(D,R,_,I){if(!C(D))return D;R=W(R,D);for(var L=-1,G=R.length,K=G-1,X=D;X!=null&&++L<G;){var et=T(R[L]),tt=_;if(et==="__proto__"||et==="constructor"||et==="prototype")return D;if(L!=K){var q=X[et];tt=I?I(q,et,X):void 0,tt===void 0&&(tt=C(q)?q:z(R[L+1])?[]:{})}A(X,et,tt),X=X[et]}return D}Y.exports=N},33065:function(Y){function Q(S,A){var W=S.length;for(S.sort(A);W--;)S[W]=S[W].value;return S}Y.exports=Q},50230:function(Y,Q,S){var A=S(91869),W=S(75010),z=S(80744),C=S(45029),T=1/0,N=A?A.prototype:void 0,D=N?N.toString:void 0;function R(_){if(typeof _=="string")return _;if(z(_))return W(_,R)+"";if(C(_))return D?D.call(_):"";var I=_+"";return I=="0"&&1/_==-T?"-0":I}Y.exports=R},13927:function(Y,Q,S){var A=S(15333),W=/^\s+/;function z(C){return C&&C.slice(0,A(C)+1).replace(W,"")}Y.exports=z},29098:function(Y,Q,S){var A=S(98924),W=S(84271),z=S(94874),C=S(1931),T=S(47506),N=S(79679),D=200;function R(_,I,L){var G=-1,K=W,X=_.length,et=!0,tt=[],q=tt;if(L)et=!1,K=z;else if(X>=D){var it=I?null:T(_);if(it)return N(it);et=!1,K=C,q=new A}else q=I?[]:tt;t:for(;++G<X;){var st=_[G],ut=I?I(st):st;if(st=L||st!==0?st:0,et&&ut===ut){for(var ht=q.length;ht--;)if(q[ht]===ut)continue t;I&&q.push(ut),tt.push(st)}else K(q,ut,L)||(q!==tt&&q.push(ut),tt.push(st))}return tt}Y.exports=R},20720:function(Y,Q,S){var A=S(75010);function W(z,C){return A(C,function(T){return z[T]})}Y.exports=W},94484:function(Y){function Q(S,A,W){for(var z=-1,C=S.length,T=A.length,N={};++z<C;){var D=z<T?A[z]:void 0;W(N,S[z],D)}return N}Y.exports=Q},1931:function(Y){function Q(S,A){return S.has(A)}Y.exports=Q},11756:function(Y,Q,S){var A=S(46962);function W(z){return typeof z=="function"?z:A}Y.exports=W},1186:function(Y,Q,S){var A=S(80744),W=S(86773),z=S(40493),C=S(44140);function T(N,D){return A(N)?N:W(N,D)?[N]:z(C(N))}Y.exports=T},27984:function(Y,Q,S){var A=S(20188);function W(z,C){var T=C?A(z.buffer):z.buffer;return new z.constructor(T,z.byteOffset,z.byteLength)}Y.exports=W},78583:function(Y){var Q=/\w*$/;function S(A){var W=new A.constructor(A.source,Q.exec(A));return W.lastIndex=A.lastIndex,W}Y.exports=S},28757:function(Y,Q,S){var A=S(91869),W=A?A.prototype:void 0,z=W?W.valueOf:void 0;function C(T){return z?Object(z.call(T)):{}}Y.exports=C},83018:function(Y,Q,S){var A=S(45029);function W(z,C){if(z!==C){var T=z!==void 0,N=z===null,D=z===z,R=A(z),_=C!==void 0,I=C===null,L=C===C,G=A(C);if(!I&&!G&&!R&&z>C||R&&_&&L&&!I&&!G||N&&_&&L||!T&&L||!D)return 1;if(!N&&!R&&!G&&z<C||G&&T&&D&&!N&&!R||I&&T&&D||!_&&D||!L)return-1}return 0}Y.exports=W},11249:function(Y,Q,S){var A=S(83018);function W(z,C,T){for(var N=-1,D=z.criteria,R=C.criteria,_=D.length,I=T.length;++N<_;){var L=A(D[N],R[N]);if(L){if(N>=I)return L;var G=T[N];return L*(G=="desc"?-1:1)}}return z.index-C.index}Y.exports=W},15168:function(Y,Q,S){var A=S(95378),W=S(58966);function z(C,T){return A(C,W(C),T)}Y.exports=z},71678:function(Y,Q,S){var A=S(95378),W=S(66817);function z(C,T){return A(C,W(C),T)}Y.exports=z},49164:function(Y,Q,S){var A=S(24665);function W(z,C){return function(T,N){if(T==null)return T;if(!A(T))return z(T,N);for(var D=T.length,R=C?D:-1,_=Object(T);(C?R--:++R<D)&&N(_[R],R,_)!==!1;);return T}}Y.exports=W},19554:function(Y,Q,S){var A=S(95979),W=S(24665),z=S(55451);function C(T){return function(N,D,R){var _=Object(N);if(!W(N)){var I=A(D,3);N=z(N),D=function(G){return I(_[G],G,_)}}var L=T(N,D,R);return L>-1?_[I?N[L]:L]:void 0}}Y.exports=C},76106:function(Y,Q,S){var A=S(36121),W=S(8138),z=S(97341);function C(T){return function(N,D,R){return R&&typeof R!="number"&&W(N,D,R)&&(D=R=void 0),N=z(N),D===void 0?(D=N,N=0):D=z(D),R=R===void 0?N<D?1:-1:z(R),A(N,D,R,T)}}Y.exports=C},47506:function(Y,Q,S){var A=S(23599),W=S(9958),z=S(79679),C=1/0,T=A&&1/z(new A([,-0]))[1]==C?function(N){return new A(N)}:W;Y.exports=T},50401:function(Y,Q,S){var A=S(98924),W=S(64045),z=S(1931),C=1,T=2;function N(D,R,_,I,L,G){var K=_&C,X=D.length,et=R.length;if(X!=et&&!(K&&et>X))return!1;var tt=G.get(D),q=G.get(R);if(tt&&q)return tt==R&&q==D;var it=-1,st=!0,ut=_&T?new A:void 0;for(G.set(D,R),G.set(R,D);++it<X;){var ht=D[it],mt=R[it];if(I)var St=K?I(mt,ht,it,R,D,G):I(ht,mt,it,D,R,G);if(St!==void 0){if(St)continue;st=!1;break}if(ut){if(!W(R,function(Mt,pt){if(!z(ut,pt)&&(ht===Mt||L(ht,Mt,_,I,G)))return ut.push(pt)})){st=!1;break}}else if(!(ht===mt||L(ht,mt,_,I,G))){st=!1;break}}return G.delete(D),G.delete(R),st}Y.exports=N},57710:function(Y,Q,S){var A=S(91869),W=S(77945),z=S(43607),C=S(50401),T=S(83383),N=S(79679),D=1,R=2,_="[object Boolean]",I="[object Date]",L="[object Error]",G="[object Map]",K="[object Number]",X="[object RegExp]",et="[object Set]",tt="[object String]",q="[object Symbol]",it="[object ArrayBuffer]",st="[object DataView]",ut=A?A.prototype:void 0,ht=ut?ut.valueOf:void 0;function mt(St,Mt,pt,xt,kt,Gt,jt){switch(pt){case st:if(St.byteLength!=Mt.byteLength||St.byteOffset!=Mt.byteOffset)return!1;St=St.buffer,Mt=Mt.buffer;case it:return!(St.byteLength!=Mt.byteLength||!Gt(new W(St),new W(Mt)));case _:case I:case K:return z(+St,+Mt);case L:return St.name==Mt.name&&St.message==Mt.message;case X:case tt:return St==Mt+"";case G:var Ht=T;case et:var fe=xt&D;if(Ht||(Ht=N),St.size!=Mt.size&&!fe)return!1;var we=jt.get(St);if(we)return we==Mt;xt|=R,jt.set(St,Mt);var Xe=C(Ht(St),Ht(Mt),xt,kt,Gt,jt);return jt.delete(St),Xe;case q:if(ht)return ht.call(St)==ht.call(Mt)}return!1}Y.exports=mt},4983:function(Y,Q,S){var A=S(12076),W=1,z=Object.prototype,C=z.hasOwnProperty;function T(N,D,R,_,I,L){var G=R&W,K=A(N),X=K.length,et=A(D),tt=et.length;if(X!=tt&&!G)return!1;for(var q=X;q--;){var it=K[q];if(!(G?it in D:C.call(D,it)))return!1}var st=L.get(N),ut=L.get(D);if(st&&ut)return st==D&&ut==N;var ht=!0;L.set(N,D),L.set(D,N);for(var mt=G;++q<X;){it=K[q];var St=N[it],Mt=D[it];if(_)var pt=G?_(Mt,St,it,D,N,L):_(St,Mt,it,N,D,L);if(!(pt===void 0?St===Mt||I(St,Mt,R,_,L):pt)){ht=!1;break}mt||(mt=it=="constructor")}if(ht&&!mt){var xt=N.constructor,kt=D.constructor;xt!=kt&&"constructor"in N&&"constructor"in D&&!(typeof xt=="function"&&xt instanceof xt&&typeof kt=="function"&&kt instanceof kt)&&(ht=!1)}return L.delete(N),L.delete(D),ht}Y.exports=T},522:function(Y,Q,S){var A=S(40151),W=S(19652),z=S(71152);function C(T){return z(W(T,void 0,A),T+"")}Y.exports=C},12076:function(Y,Q,S){var A=S(75635),W=S(58966),z=S(55451);function C(T){return A(T,z,W)}Y.exports=C},22675:function(Y,Q,S){var A=S(75635),W=S(66817),z=S(56730);function C(T){return A(T,z,W)}Y.exports=C},10261:function(Y,Q,S){var A=S(88411),W=S(55451);function z(C){for(var T=W(C),N=T.length;N--;){var D=T[N],R=C[D];T[N]=[D,R,A(R)]}return T}Y.exports=z},58966:function(Y,Q,S){var A=S(86952),W=S(4134),z=Object.prototype,C=z.propertyIsEnumerable,T=Object.getOwnPropertySymbols,N=T?function(D){return D==null?[]:(D=Object(D),A(T(D),function(R){return C.call(D,R)}))}:W;Y.exports=N},66817:function(Y,Q,S){var A=S(57095),W=S(49217),z=S(58966),C=S(4134),T=Object.getOwnPropertySymbols,N=T?function(D){for(var R=[];D;)A(R,z(D)),D=W(D);return R}:C;Y.exports=N},66139:function(Y,Q,S){var A=S(15584),W=S(40164),z=S(97288),C=S(23599),T=S(26873),N=S(86756),D=S(63256),R="[object Map]",_="[object Object]",I="[object Promise]",L="[object Set]",G="[object WeakMap]",K="[object DataView]",X=D(A),et=D(W),tt=D(z),q=D(C),it=D(T),st=N;(A&&st(new A(new ArrayBuffer(1)))!=K||W&&st(new W)!=R||z&&st(z.resolve())!=I||C&&st(new C)!=L||T&&st(new T)!=G)&&(st=function(ut){var ht=N(ut),mt=ht==_?ut.constructor:void 0,St=mt?D(mt):"";if(St)switch(St){case X:return K;case et:return R;case tt:return I;case q:return L;case it:return G}return ht}),Y.exports=st},63100:function(Y,Q,S){var A=S(1186),W=S(13053),z=S(80744),C=S(70213),T=S(11156),N=S(9171);function D(R,_,I){_=A(_,R);for(var L=-1,G=_.length,K=!1;++L<G;){var X=N(_[L]);if(!(K=R!=null&&I(R,X)))break;R=R[X]}return K||++L!=G?K:(G=R==null?0:R.length,!!G&&T(G)&&C(X,G)&&(z(R)||W(R)))}Y.exports=D},55015:function(Y){var Q="\\ud800-\\udfff",S="\\u0300-\\u036f",A="\\ufe20-\\ufe2f",W="\\u20d0-\\u20ff",z=S+A+W,C="\\ufe0e\\ufe0f",T="\\u200d",N=RegExp("["+T+Q+z+C+"]");function D(R){return N.test(R)}Y.exports=D},79264:function(Y){var Q=Object.prototype,S=Q.hasOwnProperty;function A(W){var z=W.length,C=new W.constructor(z);return z&&typeof W[0]=="string"&&S.call(W,"index")&&(C.index=W.index,C.input=W.input),C}Y.exports=A},97541:function(Y,Q,S){var A=S(20188),W=S(27984),z=S(78583),C=S(28757),T=S(78358),N="[object Boolean]",D="[object Date]",R="[object Map]",_="[object Number]",I="[object RegExp]",L="[object Set]",G="[object String]",K="[object Symbol]",X="[object ArrayBuffer]",et="[object DataView]",tt="[object Float32Array]",q="[object Float64Array]",it="[object Int8Array]",st="[object Int16Array]",ut="[object Int32Array]",ht="[object Uint8Array]",mt="[object Uint8ClampedArray]",St="[object Uint16Array]",Mt="[object Uint32Array]";function pt(xt,kt,Gt){var jt=xt.constructor;switch(kt){case X:return A(xt);case N:case D:return new jt(+xt);case et:return W(xt,Gt);case tt:case q:case it:case st:case ut:case ht:case mt:case St:case Mt:return T(xt,Gt);case R:return new jt;case _:case G:return new jt(xt);case I:return z(xt);case L:return new jt;case K:return C(xt)}}Y.exports=pt},88133:function(Y,Q,S){var A=S(91869),W=S(13053),z=S(80744),C=A?A.isConcatSpreadable:void 0;function T(N){return z(N)||W(N)||!!(C&&N&&N[C])}Y.exports=T},86773:function(Y,Q,S){var A=S(80744),W=S(45029),z=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,C=/^\w*$/;function T(N,D){if(A(N))return!1;var R=typeof N;return R=="number"||R=="symbol"||R=="boolean"||N==null||W(N)?!0:C.test(N)||!z.test(N)||D!=null&&N in Object(D)}Y.exports=T},88411:function(Y,Q,S){var A=S(20816);function W(z){return z===z&&!A(z)}Y.exports=W},83383:function(Y){function Q(S){var A=-1,W=Array(S.size);return S.forEach(function(z,C){W[++A]=[C,z]}),W}Y.exports=Q},24122:function(Y){function Q(S,A){return function(W){return W==null?!1:W[S]===A&&(A!==void 0||S in Object(W))}}Y.exports=Q},26332:function(Y,Q,S){var A=S(52858),W=500;function z(C){var T=A(C,function(D){return N.size===W&&N.clear(),D}),N=T.cache;return T}Y.exports=z},23730:function(Y,Q,S){var A=S(31030),W=A(Object.keys,Object);Y.exports=W},34776:function(Y){var Q="__lodash_hash_undefined__";function S(A){return this.__data__.set(A,Q),this}Y.exports=S},40393:function(Y){function Q(S){return this.__data__.has(S)}Y.exports=Q},79679:function(Y){function Q(S){var A=-1,W=Array(S.size);return S.forEach(function(z){W[++A]=z}),W}Y.exports=Q},49237:function(Y){function Q(S,A,W){for(var z=W-1,C=S.length;++z<C;)if(S[z]===A)return z;return-1}Y.exports=Q},29405:function(Y,Q,S){var A=S(26539),W=S(55015),z=S(60844);function C(T){return W(T)?z(T):A(T)}Y.exports=C},40493:function(Y,Q,S){var A=S(26332),W=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,z=/\\(\\)?/g,C=A(function(T){var N=[];return T.charCodeAt(0)===46&&N.push(""),T.replace(W,function(D,R,_,I){N.push(_?I.replace(z,"$1"):R||D)}),N});Y.exports=C},9171:function(Y,Q,S){var A=S(45029),W=1/0;function z(C){if(typeof C=="string"||A(C))return C;var T=C+"";return T=="0"&&1/C==-W?"-0":T}Y.exports=z},15333:function(Y){var Q=/\s/;function S(A){for(var W=A.length;W--&&Q.test(A.charAt(W)););return W}Y.exports=S},60844:function(Y){var Q="\\ud800-\\udfff",S="\\u0300-\\u036f",A="\\ufe20-\\ufe2f",W="\\u20d0-\\u20ff",z=S+A+W,C="\\ufe0e\\ufe0f",T="["+Q+"]",N="["+z+"]",D="\\ud83c[\\udffb-\\udfff]",R="(?:"+N+"|"+D+")",_="[^"+Q+"]",I="(?:\\ud83c[\\udde6-\\uddff]){2}",L="[\\ud800-\\udbff][\\udc00-\\udfff]",G="\\u200d",K=R+"?",X="["+C+"]?",et="(?:"+G+"(?:"+[_,I,L].join("|")+")"+X+K+")*",tt=X+K+et,q="(?:"+[_+N+"?",N,I,L,T].join("|")+")",it=RegExp(D+"(?="+D+")|"+q+tt,"g");function st(ut){for(var ht=it.lastIndex=0;it.test(ut);)++ht;return ht}Y.exports=st},76833:function(Y,Q,S){var A=S(99045),W=4;function z(C){return A(C,W)}Y.exports=z},20250:function(Y,Q,S){var A=S(99045),W=1,z=4;function C(T){return A(T,W|z)}Y.exports=C},28548:function(Y,Q,S){var A=S(92918),W=S(43607),z=S(8138),C=S(56730),T=Object.prototype,N=T.hasOwnProperty,D=A(function(R,_){R=Object(R);var I=-1,L=_.length,G=L>2?_[2]:void 0;for(G&&z(_[0],_[1],G)&&(L=1);++I<L;)for(var K=_[I],X=C(K),et=-1,tt=X.length;++et<tt;){var q=X[et],it=R[q];(it===void 0||W(it,T[q])&&!N.call(R,q))&&(R[q]=K[q])}return R});Y.exports=D},76934:function(Y,Q,S){Y.exports=S(99204)},64725:function(Y,Q,S){var A=S(86952),W=S(32872),z=S(95979),C=S(80744);function T(N,D){var R=C(N)?A:W;return R(N,z(D,3))}Y.exports=T},79785:function(Y,Q,S){var A=S(19554),W=S(9991),z=A(W);Y.exports=z},9991:function(Y,Q,S){var A=S(51533),W=S(95979),z=S(12824),C=Math.max;function T(N,D,R){var _=N==null?0:N.length;if(!_)return-1;var I=R==null?0:z(R);return I<0&&(I=C(_+I,0)),A(N,W(D,3),I)}Y.exports=T},40151:function(Y,Q,S){var A=S(9256);function W(z){var C=z==null?0:z.length;return C?A(z,1):[]}Y.exports=W},99204:function(Y,Q,S){var A=S(74809),W=S(44107),z=S(11756),C=S(80744);function T(N,D){var R=C(N)?A:W;return R(N,z(D))}Y.exports=T},23190:function(Y,Q,S){var A=S(14018),W=S(11756),z=S(56730);function C(T,N){return T==null?T:A(T,W(N),z)}Y.exports=C},44231:function(Y,Q,S){var A=S(89147);function W(z,C,T){var N=z==null?void 0:A(z,C);return N===void 0?T:N}Y.exports=W},99946:function(Y,Q,S){var A=S(3251),W=S(63100);function z(C,T){return C!=null&&W(C,T,A)}Y.exports=z},37879:function(Y,Q,S){var A=S(62348),W=S(63100);function z(C,T){return C!=null&&W(C,T,A)}Y.exports=z},61627:function(Y,Q,S){var A=S(6019),W=S(66139),z=S(13053),C=S(80744),T=S(24665),N=S(57835),D=S(7975),R=S(18397),_="[object Map]",I="[object Set]",L=Object.prototype,G=L.hasOwnProperty;function K(X){if(X==null)return!0;if(T(X)&&(C(X)||typeof X=="string"||typeof X.splice=="function"||N(X)||R(X)||z(X)))return!X.length;var et=W(X);if(et==_||et==I)return!X.size;if(D(X))return!A(X).length;for(var tt in X)if(G.call(X,tt))return!1;return!0}Y.exports=K},41626:function(Y,Q,S){var A=S(55005),W=S(38342),z=S(52495),C=z&&z.isMap,T=C?W(C):A;Y.exports=T},65226:function(Y,Q,S){var A=S(38652),W=S(38342),z=S(52495),C=z&&z.isSet,T=C?W(C):A;Y.exports=T},7941:function(Y,Q,S){var A=S(86756),W=S(80744),z=S(93913),C="[object String]";function T(N){return typeof N=="string"||!W(N)&&z(N)&&A(N)==C}Y.exports=T},45029:function(Y,Q,S){var A=S(86756),W=S(93913),z="[object Symbol]";function C(T){return typeof T=="symbol"||W(T)&&A(T)==z}Y.exports=C},16513:function(Y){function Q(S){return S===void 0}Y.exports=Q},55451:function(Y,Q,S){var A=S(63333),W=S(6019),z=S(24665);function C(T){return z(T)?A(T):W(T)}Y.exports=C},10611:function(Y){function Q(S){var A=S==null?0:S.length;return A?S[A-1]:void 0}Y.exports=Q},9924:function(Y,Q,S){var A=S(75010),W=S(95979),z=S(65487),C=S(80744);function T(N,D){var R=C(N)?A:z;return R(N,W(D,3))}Y.exports=T},70642:function(Y,Q,S){var A=S(42813),W=S(85605),z=S(95979);function C(T,N){var D={};return N=z(N,3),W(T,function(R,_,I){A(D,_,N(R,_,I))}),D}Y.exports=C},95987:function(Y,Q,S){var A=S(2659),W=S(40302),z=S(46962);function C(T){return T&&T.length?A(T,z,W):void 0}Y.exports=C},52858:function(Y,Q,S){var A=S(52166),W="Expected a function";function z(C,T){if(typeof C!="function"||T!=null&&typeof T!="function")throw new TypeError(W);var N=function(){var D=arguments,R=T?T.apply(this,D):D[0],_=N.cache;if(_.has(R))return _.get(R);var I=C.apply(this,D);return N.cache=_.set(R,I)||_,I};return N.cache=new(z.Cache||A),N}z.Cache=A,Y.exports=z},73376:function(Y,Q,S){var A=S(2659),W=S(93757),z=S(46962);function C(T){return T&&T.length?A(T,z,W):void 0}Y.exports=C},83296:function(Y,Q,S){var A=S(2659),W=S(95979),z=S(93757);function C(T,N){return T&&T.length?A(T,W(N,2),z):void 0}Y.exports=C},9958:function(Y){function Q(){}Y.exports=Q},5795:function(Y,Q,S){var A=S(33152),W=function(){return A.Date.now()};Y.exports=W},89409:function(Y,Q,S){var A=S(88832),W=S(522),z=W(function(C,T){return C==null?{}:A(C,T)});Y.exports=z},35769:function(Y,Q,S){var A=S(22310),W=S(96916),z=S(86773),C=S(9171);function T(N){return z(N)?A(C(N)):W(N)}Y.exports=T},60859:function(Y,Q,S){var A=S(76106),W=A();Y.exports=W},16473:function(Y,Q,S){var A=S(99861),W=S(44107),z=S(95979),C=S(30739),T=S(80744);function N(D,R,_){var I=T(D)?A:C,L=arguments.length<3;return I(D,z(R,4),_,L,W)}Y.exports=N},40617:function(Y,Q,S){var A=S(6019),W=S(66139),z=S(24665),C=S(7941),T=S(29405),N="[object Map]",D="[object Set]";function R(_){if(_==null)return 0;if(z(_))return C(_)?T(_):_.length;var I=W(_);return I==N||I==D?_.size:A(_).length}Y.exports=R},351:function(Y,Q,S){var A=S(9256),W=S(58506),z=S(92918),C=S(8138),T=z(function(N,D){if(N==null)return[];var R=D.length;return R>1&&C(N,D[0],D[1])?D=[]:R>2&&C(D[0],D[1],D[2])&&(D=[D[0]]),W(N,A(D,1),[])});Y.exports=T},4134:function(Y){function Q(){return[]}Y.exports=Q},97341:function(Y,Q,S){var A=S(59406),W=1/0,z=17976931348623157e292;function C(T){if(!T)return T===0?T:0;if(T=A(T),T===W||T===-W){var N=T<0?-1:1;return N*z}return T===T?T:0}Y.exports=C},12824:function(Y,Q,S){var A=S(97341);function W(z){var C=A(z),T=C%1;return C===C?T?C-T:C:0}Y.exports=W},59406:function(Y,Q,S){var A=S(13927),W=S(20816),z=S(45029),C=NaN,T=/^[-+]0x[0-9a-f]+$/i,N=/^0b[01]+$/i,D=/^0o[0-7]+$/i,R=parseInt;function _(I){if(typeof I=="number")return I;if(z(I))return C;if(W(I)){var L=typeof I.valueOf=="function"?I.valueOf():I;I=W(L)?L+"":L}if(typeof I!="string")return I===0?I:+I;I=A(I);var G=N.test(I);return G||D.test(I)?R(I.slice(2),G?2:8):T.test(I)?C:+I}Y.exports=_},44140:function(Y,Q,S){var A=S(50230);function W(z){return z==null?"":A(z)}Y.exports=W},91116:function(Y,Q,S){var A=S(74809),W=S(35024),z=S(85605),C=S(95979),T=S(49217),N=S(80744),D=S(57835),R=S(9363),_=S(20816),I=S(18397);function L(G,K,X){var et=N(G),tt=et||D(G)||I(G);if(K=C(K,4),X==null){var q=G&&G.constructor;tt?X=et?new q:[]:_(G)?X=R(q)?W(T(G)):{}:X={}}return(tt?A:z)(G,function(it,st,ut){return K(X,it,st,ut)}),X}Y.exports=L},44065:function(Y,Q,S){var A=S(9256),W=S(92918),z=S(29098),C=S(41590),T=W(function(N){return z(A(N,1,C,!0))});Y.exports=T},95708:function(Y,Q,S){var A=S(44140),W=0;function z(C){var T=++W;return A(C)+T}Y.exports=z},81229:function(Y,Q,S){var A=S(20720),W=S(55451);function z(C){return C==null?[]:A(C,W(C))}Y.exports=z},65441:function(Y,Q,S){var A=S(60348),W=S(94484);function z(C,T){return W(C||[],T||[],A)}Y.exports=z},34402:function(Y,Q,S){"use strict";S.r(Q),S.d(Q,{default:function(){return C}});var A=S(34634);function W(T){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!(0,A.isAnyArray)(T))throw new TypeError("input must be an array");if(T.length===0)throw new TypeError("input must not be empty");var D=N.fromIndex,R=D===void 0?0:D,_=N.toIndex,I=_===void 0?T.length:_;if(R<0||R>=T.length||!Number.isInteger(R))throw new Error("fromIndex must be a positive integer smaller than length");if(I<=R||I>T.length||!Number.isInteger(I))throw new Error("toIndex must be an integer greater than fromIndex and at most equal to length");for(var L=T[R],G=R+1;G<I;G++)T[G]>L&&(L=T[G]);return L}function z(T){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!(0,A.isAnyArray)(T))throw new TypeError("input must be an array");if(T.length===0)throw new TypeError("input must not be empty");var D=N.fromIndex,R=D===void 0?0:D,_=N.toIndex,I=_===void 0?T.length:_;if(R<0||R>=T.length||!Number.isInteger(R))throw new Error("fromIndex must be a positive integer smaller than length");if(I<=R||I>T.length||!Number.isInteger(I))throw new Error("toIndex must be an integer greater than fromIndex and at most equal to length");for(var L=T[R],G=R+1;G<I;G++)T[G]<L&&(L=T[G]);return L}function C(T){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if((0,A.isAnyArray)(T)){if(T.length===0)throw new TypeError("input must not be empty")}else throw new TypeError("input must be an array");var D;if(N.output!==void 0){if(!(0,A.isAnyArray)(N.output))throw new TypeError("output option must be an array if specified");D=N.output}else D=new Array(T.length);var R=z(T),_=W(T);if(R===_)throw new RangeError("minimum and maximum input values are equal. Cannot rescale a constant array");var I=N.min,L=I===void 0?N.autoMinMax?R:0:I,G=N.max,K=G===void 0?N.autoMinMax?_:1:G;if(L>=K)throw new RangeError("min option must be smaller than max option");for(var X=(K-L)/(_-R),et=0;et<T.length;et++)D[et]=(T[et]-R)*X+L;return D}},81683:function(Y,Q,S){"use strict";var A=S(55973),W=Array.prototype.concat,z=Array.prototype.slice,C=Y.exports=function(N){for(var D=[],R=0,_=N.length;R<_;R++){var I=N[R];A(I)?D=W.call(D,z.call(I)):D.push(I)}return D};C.wrap=function(T){return function(){return T(C(arguments))}}},99755:function(Y){"use strict";Y.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(Y){"use strict";Y.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(Y){"use strict";Y.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(Y){"use strict";Y.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(Y){"use strict";Y.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(Y){"use strict";Y.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"},72640:function(Y,Q){"use strict";var S={value:()=>{}};function A(){for(var N=0,D=arguments.length,R={},_;N<D;++N){if(!(_=arguments[N]+"")||_ in R||/[\s.]/.test(_))throw new Error("illegal type: "+_);R[_]=[]}return new W(R)}function W(N){this._=N}function z(N,D){return N.trim().split(/^|\s+/).map(function(R){var _="",I=R.indexOf(".");if(I>=0&&(_=R.slice(I+1),R=R.slice(0,I)),R&&!D.hasOwnProperty(R))throw new Error("unknown type: "+R);return{type:R,name:_}})}W.prototype=A.prototype={constructor:W,on:function(N,D){var R=this._,_=z(N+"",R),I,L=-1,G=_.length;if(arguments.length<2){for(;++L<G;)if((I=(N=_[L]).type)&&(I=C(R[I],N.name)))return I;return}if(D!=null&&typeof D!="function")throw new Error("invalid callback: "+D);for(;++L<G;)if(I=(N=_[L]).type)R[I]=T(R[I],N.name,D);else if(D==null)for(I in R)R[I]=T(R[I],N.name,null);return this},copy:function(){var N={},D=this._;for(var R in D)N[R]=D[R].slice();return new W(N)},call:function(N,D){if((I=arguments.length-2)>0)for(var R=new Array(I),_=0,I,L;_<I;++_)R[_]=arguments[_+2];if(!this._.hasOwnProperty(N))throw new Error("unknown type: "+N);for(L=this._[N],_=0,I=L.length;_<I;++_)L[_].value.apply(D,R)},apply:function(N,D,R){if(!this._.hasOwnProperty(N))throw new Error("unknown type: "+N);for(var _=this._[N],I=0,L=_.length;I<L;++I)_[I].value.apply(D,R)}};function C(N,D){for(var R=0,_=N.length,I;R<_;++R)if((I=N[R]).name===D)return I.value}function T(N,D,R){for(var _=0,I=N.length;_<I;++_)if(N[_].name===D){N[_]=S,N=N.slice(0,_).concat(N.slice(_+1));break}return R!=null&&N.push({name:D,value:R}),N}Q.Z=A},12713:function(Y,Q,S){"use strict";S.d(Q,{H:function(){return z},Z:function(){return A}});function A(C){const T=+this._x.call(null,C),N=+this._y.call(null,C),D=+this._z.call(null,C);return W(this.cover(T,N,D),T,N,D,C)}function W(C,T,N,D,R){if(isNaN(T)||isNaN(N)||isNaN(D))return C;var _,I=C._root,L={data:R},G=C._x0,K=C._y0,X=C._z0,et=C._x1,tt=C._y1,q=C._z1,it,st,ut,ht,mt,St,Mt,pt,xt,kt,Gt;if(!I)return C._root=L,C;for(;I.length;)if((Mt=T>=(it=(G+et)/2))?G=it:et=it,(pt=N>=(st=(K+tt)/2))?K=st:tt=st,(xt=D>=(ut=(X+q)/2))?X=ut:q=ut,_=I,!(I=I[kt=xt<<2|pt<<1|Mt]))return _[kt]=L,C;if(ht=+C._x.call(null,I.data),mt=+C._y.call(null,I.data),St=+C._z.call(null,I.data),T===ht&&N===mt&&D===St)return L.next=I,_?_[kt]=L:C._root=L,C;do _=_?_[kt]=new Array(8):C._root=new Array(8),(Mt=T>=(it=(G+et)/2))?G=it:et=it,(pt=N>=(st=(K+tt)/2))?K=st:tt=st,(xt=D>=(ut=(X+q)/2))?X=ut:q=ut;while((kt=xt<<2|pt<<1|Mt)===(Gt=(St>=ut)<<2|(mt>=st)<<1|ht>=it));return _[Gt]=I,_[kt]=L,C}function z(C){Array.isArray(C)||(C=Array.from(C));const T=C.length,N=new Float64Array(T),D=new Float64Array(T),R=new Float64Array(T);let _=1/0,I=1/0,L=1/0,G=-1/0,K=-1/0,X=-1/0;for(let et=0,tt,q,it,st;et<T;++et)isNaN(q=+this._x.call(null,tt=C[et]))||isNaN(it=+this._y.call(null,tt))||isNaN(st=+this._z.call(null,tt))||(N[et]=q,D[et]=it,R[et]=st,q<_&&(_=q),q>G&&(G=q),it<I&&(I=it),it>K&&(K=it),st<L&&(L=st),st>X&&(X=st));if(_>G||I>K||L>X)return this;this.cover(_,I,L).cover(G,K,X);for(let et=0;et<T;++et)W(this,N[et],D[et],R[et],C[et]);return this}},17646:function(Y,Q,S){"use strict";S.d(Q,{Z:function(){return A}});function A(W,z,C){if(isNaN(W=+W)||isNaN(z=+z)||isNaN(C=+C))return this;var T=this._x0,N=this._y0,D=this._z0,R=this._x1,_=this._y1,I=this._z1;if(isNaN(T))R=(T=Math.floor(W))+1,_=(N=Math.floor(z))+1,I=(D=Math.floor(C))+1;else{for(var L=R-T||1,G=this._root,K,X;T>W||W>=R||N>z||z>=_||D>C||C>=I;)switch(X=(C<D)<<2|(z<N)<<1|W<T,K=new Array(8),K[X]=G,G=K,L*=2,X){case 0:R=T+L,_=N+L,I=D+L;break;case 1:T=R-L,_=N+L,I=D+L;break;case 2:R=T+L,N=_-L,I=D+L;break;case 3:T=R-L,N=_-L,I=D+L;break;case 4:R=T+L,_=N+L,D=I-L;break;case 5:T=R-L,_=N+L,D=I-L;break;case 6:R=T+L,N=_-L,D=I-L;break;case 7:T=R-L,N=_-L,D=I-L;break}this._root&&this._root.length&&(this._root=G)}return this._x0=T,this._y0=N,this._z0=D,this._x1=R,this._y1=_,this._z1=I,this}},39894:function(Y,Q,S){"use strict";S.d(Q,{Z:function(){return A}});function A(){var W=[];return this.visit(function(z){if(!z.length)do W.push(z.data);while(z=z.next)}),W}},56033:function(Y,Q,S){"use strict";S.d(Q,{Z:function(){return A}});function A(W){return arguments.length?this.cover(+W[0][0],+W[0][1],+W[0][2]).cover(+W[1][0],+W[1][1],+W[1][2]):isNaN(this._x0)?void 0:[[this._x0,this._y0,this._z0],[this._x1,this._y1,this._z1]]}},77480:function(Y,Q,S){"use strict";S.d(Q,{Z:function(){return W}});var A=S(26805);function W(z,C,T,N){var D,R=this._x0,_=this._y0,I=this._z0,L,G,K,X,et,tt,q=this._x1,it=this._y1,st=this._z1,ut=[],ht=this._root,mt,St;for(ht&&ut.push(new A.Z(ht,R,_,I,q,it,st)),N==null?N=1/0:(R=z-N,_=C-N,I=T-N,q=z+N,it=C+N,st=T+N,N*=N);mt=ut.pop();)if(!(!(ht=mt.node)||(L=mt.x0)>q||(G=mt.y0)>it||(K=mt.z0)>st||(X=mt.x1)<R||(et=mt.y1)<_||(tt=mt.z1)<I))if(ht.length){var Mt=(L+X)/2,pt=(G+et)/2,xt=(K+tt)/2;ut.push(new A.Z(ht[7],Mt,pt,xt,X,et,tt),new A.Z(ht[6],L,pt,xt,Mt,et,tt),new A.Z(ht[5],Mt,G,xt,X,pt,tt),new A.Z(ht[4],L,G,xt,Mt,pt,tt),new A.Z(ht[3],Mt,pt,K,X,et,xt),new A.Z(ht[2],L,pt,K,Mt,et,xt),new A.Z(ht[1],Mt,G,K,X,pt,xt),new A.Z(ht[0],L,G,K,Mt,pt,xt)),(St=(T>=xt)<<2|(C>=pt)<<1|z>=Mt)&&(mt=ut[ut.length-1],ut[ut.length-1]=ut[ut.length-1-St],ut[ut.length-1-St]=mt)}else{var kt=z-+this._x.call(null,ht.data),Gt=C-+this._y.call(null,ht.data),jt=T-+this._z.call(null,ht.data),Ht=kt*kt+Gt*Gt+jt*jt;if(Ht<N){var fe=Math.sqrt(N=Ht);R=z-fe,_=C-fe,I=T-fe,q=z+fe,it=C+fe,st=T+fe,D=ht.data}}return D}},72096:function(Y,Q,S){"use strict";S.d(Q,{r:function(){return W}});const A=(z,C,T,N,D,R)=>Math.sqrt(ls(z-N,2)+ls(C-D,2)+ls(T-R,2));function W(z,C,T,N){const D=[],R=z-N,_=C-N,I=T-N,L=z+N,G=C+N,K=T+N;return this.visit((X,et,tt,q,it,st,ut)=>{if(!X.length)do{const ht=X.data;A(z,C,T,this._x(ht),this._y(ht),this._z(ht))<=N&&D.push(ht)}while(X=X.next);return et>L||tt>G||q>K||it<R||st<_||ut<I}),D}},26805:function(Y,Q,S){"use strict";S.d(Q,{Z:function(){return A}});function A(W,z,C,T,N,D,R){this.node=W,this.x0=z,this.y0=C,this.z0=T,this.x1=N,this.y1=D,this.z1=R}},7695:function(Y,Q,S){"use strict";S.d(Q,{Z:function(){return et}});var A=S(12713),W=S(17646),z=S(39894),C=S(56033),T=S(77480),N=S(72096),D=S(36989),R=S(10325),_=S(15902),I=S(12027),L=S(66612),G=S(14763),K=S(94009),X=S(68889);function et(st,ut,ht,mt){var St=new tt(ut==null?G.P:ut,ht==null?K.q:ht,mt==null?X.i:mt,NaN,NaN,NaN,NaN,NaN,NaN);return st==null?St:St.addAll(st)}function tt(st,ut,ht,mt,St,Mt,pt,xt,kt){this._x=st,this._y=ut,this._z=ht,this._x0=mt,this._y0=St,this._z0=Mt,this._x1=pt,this._y1=xt,this._z1=kt,this._root=void 0}function q(st){for(var ut={data:st.data},ht=ut;st=st.next;)ht=ht.next={data:st.data};return ut}var it=et.prototype=tt.prototype;it.copy=function(){var st=new tt(this._x,this._y,this._z,this._x0,this._y0,this._z0,this._x1,this._y1,this._z1),ut=this._root,ht,mt;if(!ut)return st;if(!ut.length)return st._root=q(ut),st;for(ht=[{source:ut,target:st._root=new Array(8)}];ut=ht.pop();)for(var St=0;St<8;++St)(mt=ut.source[St])&&(mt.length?ht.push({source:mt,target:ut.target[St]=new Array(8)}):ut.target[St]=q(mt));return st},it.add=A.Z,it.addAll=A.H,it.cover=W.Z,it.data=z.Z,it.extent=C.Z,it.find=T.Z,it.findAllWithinRadius=N.r,it.remove=D.Z,it.removeAll=D.x,it.root=R.Z,it.size=_.Z,it.visit=I.Z,it.visitAfter=L.Z,it.x=G.Z,it.y=K.Z,it.z=X.Z},36989:function(Y,Q,S){"use strict";S.d(Q,{Z:function(){return A},x:function(){return W}});function A(z){if(isNaN(et=+this._x.call(null,z))||isNaN(tt=+this._y.call(null,z))||isNaN(q=+this._z.call(null,z)))return this;var C,T=this._root,N,D,R,_=this._x0,I=this._y0,L=this._z0,G=this._x1,K=this._y1,X=this._z1,et,tt,q,it,st,ut,ht,mt,St,Mt,pt;if(!T)return this;if(T.length)for(;;){if((ht=et>=(it=(_+G)/2))?_=it:G=it,(mt=tt>=(st=(I+K)/2))?I=st:K=st,(St=q>=(ut=(L+X)/2))?L=ut:X=ut,C=T,!(T=T[Mt=St<<2|mt<<1|ht]))return this;if(!T.length)break;(C[Mt+1&7]||C[Mt+2&7]||C[Mt+3&7]||C[Mt+4&7]||C[Mt+5&7]||C[Mt+6&7]||C[Mt+7&7])&&(N=C,pt=Mt)}for(;T.data!==z;)if(D=T,!(T=T.next))return this;return(R=T.next)&&delete T.next,D?(R?D.next=R:delete D.next,this):C?(R?C[Mt]=R:delete C[Mt],(T=C[0]||C[1]||C[2]||C[3]||C[4]||C[5]||C[6]||C[7])&&T===(C[7]||C[6]||C[5]||C[4]||C[3]||C[2]||C[1]||C[0])&&!T.length&&(N?N[pt]=T:this._root=T),this):(this._root=R,this)}function W(z){for(var C=0,T=z.length;C<T;++C)this.remove(z[C]);return this}},10325:function(Y,Q,S){"use strict";S.d(Q,{Z:function(){return A}});function A(){return this._root}},15902:function(Y,Q,S){"use strict";S.d(Q,{Z:function(){return A}});function A(){var W=0;return this.visit(function(z){if(!z.length)do++W;while(z=z.next)}),W}},12027:function(Y,Q,S){"use strict";S.d(Q,{Z:function(){return W}});var A=S(26805);function W(z){var C=[],T,N=this._root,D,R,_,I,L,G,K;for(N&&C.push(new A.Z(N,this._x0,this._y0,this._z0,this._x1,this._y1,this._z1));T=C.pop();)if(!z(N=T.node,R=T.x0,_=T.y0,I=T.z0,L=T.x1,G=T.y1,K=T.z1)&&N.length){var X=(R+L)/2,et=(_+G)/2,tt=(I+K)/2;(D=N[7])&&C.push(new A.Z(D,X,et,tt,L,G,K)),(D=N[6])&&C.push(new A.Z(D,R,et,tt,X,G,K)),(D=N[5])&&C.push(new A.Z(D,X,_,tt,L,et,K)),(D=N[4])&&C.push(new A.Z(D,R,_,tt,X,et,K)),(D=N[3])&&C.push(new A.Z(D,X,et,I,L,G,tt)),(D=N[2])&&C.push(new A.Z(D,R,et,I,X,G,tt)),(D=N[1])&&C.push(new A.Z(D,X,_,I,L,et,tt)),(D=N[0])&&C.push(new A.Z(D,R,_,I,X,et,tt))}return this}},66612:function(Y,Q,S){"use strict";S.d(Q,{Z:function(){return W}});var A=S(26805);function W(z){var C=[],T=[],N;for(this._root&&C.push(new A.Z(this._root,this._x0,this._y0,this._z0,this._x1,this._y1,this._z1));N=C.pop();){var D=N.node;if(D.length){var R,_=N.x0,I=N.y0,L=N.z0,G=N.x1,K=N.y1,X=N.z1,et=(_+G)/2,tt=(I+K)/2,q=(L+X)/2;(R=D[0])&&C.push(new A.Z(R,_,I,L,et,tt,q)),(R=D[1])&&C.push(new A.Z(R,et,I,L,G,tt,q)),(R=D[2])&&C.push(new A.Z(R,_,tt,L,et,K,q)),(R=D[3])&&C.push(new A.Z(R,et,tt,L,G,K,q)),(R=D[4])&&C.push(new A.Z(R,_,I,q,et,tt,X)),(R=D[5])&&C.push(new A.Z(R,et,I,q,G,tt,X)),(R=D[6])&&C.push(new A.Z(R,_,tt,q,et,K,X)),(R=D[7])&&C.push(new A.Z(R,et,tt,q,G,K,X))}T.push(N)}for(;N=T.pop();)z(N.node,N.x0,N.y0,N.z0,N.x1,N.y1,N.z1);return this}},14763:function(Y,Q,S){"use strict";S.d(Q,{P:function(){return A},Z:function(){return W}});function A(z){return z[0]}function W(z){return arguments.length?(this._x=z,this):this._x}},94009:function(Y,Q,S){"use strict";S.d(Q,{Z:function(){return W},q:function(){return A}});function A(z){return z[1]}function W(z){return arguments.length?(this._y=z,this):this._y}},68889:function(Y,Q,S){"use strict";S.d(Q,{Z:function(){return W},i:function(){return A}});function A(z){return z[2]}function W(z){return arguments.length?(this._z=z,this):this._z}},60272:function(Y,Q,S){"use strict";S.d(Q,{H:function(){return z},Z:function(){return A}});function A(C){const T=+this._x.call(null,C),N=+this._y.call(null,C);return W(this.cover(T,N),T,N,C)}function W(C,T,N,D){if(isNaN(T)||isNaN(N))return C;var R,_=C._root,I={data:D},L=C._x0,G=C._y0,K=C._x1,X=C._y1,et,tt,q,it,st,ut,ht,mt;if(!_)return C._root=I,C;for(;_.length;)if((st=T>=(et=(L+K)/2))?L=et:K=et,(ut=N>=(tt=(G+X)/2))?G=tt:X=tt,R=_,!(_=_[ht=ut<<1|st]))return R[ht]=I,C;if(q=+C._x.call(null,_.data),it=+C._y.call(null,_.data),T===q&&N===it)return I.next=_,R?R[ht]=I:C._root=I,C;do R=R?R[ht]=new Array(4):C._root=new Array(4),(st=T>=(et=(L+K)/2))?L=et:K=et,(ut=N>=(tt=(G+X)/2))?G=tt:X=tt;while((ht=ut<<1|st)===(mt=(it>=tt)<<1|q>=et));return R[mt]=_,R[ht]=I,C}function z(C){var T,N,D=C.length,R,_,I=new Array(D),L=new Array(D),G=1/0,K=1/0,X=-1/0,et=-1/0;for(N=0;N<D;++N)isNaN(R=+this._x.call(null,T=C[N]))||isNaN(_=+this._y.call(null,T))||(I[N]=R,L[N]=_,R<G&&(G=R),R>X&&(X=R),_<K&&(K=_),_>et&&(et=_));if(G>X||K>et)return this;for(this.cover(G,K).cover(X,et),N=0;N<D;++N)W(this,I[N],L[N],C[N]);return this}},51097:function(Y,Q,S){"use strict";S.d(Q,{Z:function(){return A}});function A(W,z){if(isNaN(W=+W)||isNaN(z=+z))return this;var C=this._x0,T=this._y0,N=this._x1,D=this._y1;if(isNaN(C))N=(C=Math.floor(W))+1,D=(T=Math.floor(z))+1;else{for(var R=N-C||1,_=this._root,I,L;C>W||W>=N||T>z||z>=D;)switch(L=(z<T)<<1|W<C,I=new Array(4),I[L]=_,_=I,R*=2,L){case 0:N=C+R,D=T+R;break;case 1:C=N-R,D=T+R;break;case 2:N=C+R,T=D-R;break;case 3:C=N-R,T=D-R;break}this._root&&this._root.length&&(this._root=_)}return this._x0=C,this._y0=T,this._x1=N,this._y1=D,this}},58007:function(Y,Q,S){"use strict";S.d(Q,{Z:function(){return A}});function A(){var W=[];return this.visit(function(z){if(!z.length)do W.push(z.data);while(z=z.next)}),W}},12070:function(Y,Q,S){"use strict";S.d(Q,{Z:function(){return A}});function A(W){return arguments.length?this.cover(+W[0][0],+W[0][1]).cover(+W[1][0],+W[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}},47064:function(Y,Q,S){"use strict";S.d(Q,{Z:function(){return W}});var A=S(44213);function W(z,C,T){var N,D=this._x0,R=this._y0,_,I,L,G,K=this._x1,X=this._y1,et=[],tt=this._root,q,it;for(tt&&et.push(new A.Z(tt,D,R,K,X)),T==null?T=1/0:(D=z-T,R=C-T,K=z+T,X=C+T,T*=T);q=et.pop();)if(!(!(tt=q.node)||(_=q.x0)>K||(I=q.y0)>X||(L=q.x1)<D||(G=q.y1)<R))if(tt.length){var st=(_+L)/2,ut=(I+G)/2;et.push(new A.Z(tt[3],st,ut,L,G),new A.Z(tt[2],_,ut,st,G),new A.Z(tt[1],st,I,L,ut),new A.Z(tt[0],_,I,st,ut)),(it=(C>=ut)<<1|z>=st)&&(q=et[et.length-1],et[et.length-1]=et[et.length-1-it],et[et.length-1-it]=q)}else{var ht=z-+this._x.call(null,tt.data),mt=C-+this._y.call(null,tt.data),St=ht*ht+mt*mt;if(St<T){var Mt=Math.sqrt(T=St);D=z-Mt,R=C-Mt,K=z+Mt,X=C+Mt,N=tt.data}}return N}},44213:function(Y,Q,S){"use strict";S.d(Q,{Z:function(){return A}});function A(W,z,C,T,N){this.node=W,this.x0=z,this.y0=C,this.x1=T,this.y1=N}},14301:function(Y,Q,S){"use strict";S.d(Q,{Z:function(){return K}});var A=S(60272),W=S(51097),z=S(58007),C=S(12070),T=S(47064),N=S(88866),D=S(10864),R=S(68984),_=S(3715),I=S(73607),L=S(56570),G=S(30992);function K(q,it,st){var ut=new X(it==null?L.P:it,st==null?G.q:st,NaN,NaN,NaN,NaN);return q==null?ut:ut.addAll(q)}function X(q,it,st,ut,ht,mt){this._x=q,this._y=it,this._x0=st,this._y0=ut,this._x1=ht,this._y1=mt,this._root=void 0}function et(q){for(var it={data:q.data},st=it;q=q.next;)st=st.next={data:q.data};return it}var tt=K.prototype=X.prototype;tt.copy=function(){var q=new X(this._x,this._y,this._x0,this._y0,this._x1,this._y1),it=this._root,st,ut;if(!it)return q;if(!it.length)return q._root=et(it),q;for(st=[{source:it,target:q._root=new Array(4)}];it=st.pop();)for(var ht=0;ht<4;++ht)(ut=it.source[ht])&&(ut.length?st.push({source:ut,target:it.target[ht]=new Array(4)}):it.target[ht]=et(ut));return q},tt.add=A.Z,tt.addAll=A.H,tt.cover=W.Z,tt.data=z.Z,tt.extent=C.Z,tt.find=T.Z,tt.remove=N.Z,tt.removeAll=N.x,tt.root=D.Z,tt.size=R.Z,tt.visit=_.Z,tt.visitAfter=I.Z,tt.x=L.Z,tt.y=G.Z},88866:function(Y,Q,S){"use strict";S.d(Q,{Z:function(){return A},x:function(){return W}});function A(z){if(isNaN(K=+this._x.call(null,z))||isNaN(X=+this._y.call(null,z)))return this;var C,T=this._root,N,D,R,_=this._x0,I=this._y0,L=this._x1,G=this._y1,K,X,et,tt,q,it,st,ut;if(!T)return this;if(T.length)for(;;){if((q=K>=(et=(_+L)/2))?_=et:L=et,(it=X>=(tt=(I+G)/2))?I=tt:G=tt,C=T,!(T=T[st=it<<1|q]))return this;if(!T.length)break;(C[st+1&3]||C[st+2&3]||C[st+3&3])&&(N=C,ut=st)}for(;T.data!==z;)if(D=T,!(T=T.next))return this;return(R=T.next)&&delete T.next,D?(R?D.next=R:delete D.next,this):C?(R?C[st]=R:delete C[st],(T=C[0]||C[1]||C[2]||C[3])&&T===(C[3]||C[2]||C[1]||C[0])&&!T.length&&(N?N[ut]=T:this._root=T),this):(this._root=R,this)}function W(z){for(var C=0,T=z.length;C<T;++C)this.remove(z[C]);return this}},10864:function(Y,Q,S){"use strict";S.d(Q,{Z:function(){return A}});function A(){return this._root}},68984:function(Y,Q,S){"use strict";S.d(Q,{Z:function(){return A}});function A(){var W=0;return this.visit(function(z){if(!z.length)do++W;while(z=z.next)}),W}},3715:function(Y,Q,S){"use strict";S.d(Q,{Z:function(){return W}});var A=S(44213);function W(z){var C=[],T,N=this._root,D,R,_,I,L;for(N&&C.push(new A.Z(N,this._x0,this._y0,this._x1,this._y1));T=C.pop();)if(!z(N=T.node,R=T.x0,_=T.y0,I=T.x1,L=T.y1)&&N.length){var G=(R+I)/2,K=(_+L)/2;(D=N[3])&&C.push(new A.Z(D,G,K,I,L)),(D=N[2])&&C.push(new A.Z(D,R,K,G,L)),(D=N[1])&&C.push(new A.Z(D,G,_,I,K)),(D=N[0])&&C.push(new A.Z(D,R,_,G,K))}return this}},73607:function(Y,Q,S){"use strict";S.d(Q,{Z:function(){return W}});var A=S(44213);function W(z){var C=[],T=[],N;for(this._root&&C.push(new A.Z(this._root,this._x0,this._y0,this._x1,this._y1));N=C.pop();){var D=N.node;if(D.length){var R,_=N.x0,I=N.y0,L=N.x1,G=N.y1,K=(_+L)/2,X=(I+G)/2;(R=D[0])&&C.push(new A.Z(R,_,I,K,X)),(R=D[1])&&C.push(new A.Z(R,K,I,L,X)),(R=D[2])&&C.push(new A.Z(R,_,X,K,G)),(R=D[3])&&C.push(new A.Z(R,K,X,L,G))}T.push(N)}for(;N=T.pop();)z(N.node,N.x0,N.y0,N.x1,N.y1);return this}},56570:function(Y,Q,S){"use strict";S.d(Q,{P:function(){return A},Z:function(){return W}});function A(z){return z[0]}function W(z){return arguments.length?(this._x=z,this):this._x}},30992:function(Y,Q,S){"use strict";S.d(Q,{Z:function(){return W},q:function(){return A}});function A(z){return z[1]}function W(z){return arguments.length?(this._y=z,this):this._y}},83833:function(Y,Q,S){"use strict";S.d(Q,{HT:function(){return et}});var A=0,W=0,z=0,C=1e3,T,N,D=0,R=0,_=0,I=typeof performance=="object"&&performance.now?performance:Date,L=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(ht){setTimeout(ht,17)};function G(){return R||(L(K),R=I.now()+_)}function K(){R=0}function X(){this._call=this._time=this._next=null}X.prototype=et.prototype={constructor:X,restart:function(ht,mt,St){if(typeof ht!="function")throw new TypeError("callback is not a function");St=(St==null?G():+St)+(mt==null?0:+mt),!this._next&&N!==this&&(N?N._next=this:T=this,N=this),this._call=ht,this._time=St,ut()},stop:function(){this._call&&(this._call=null,this._time=1/0,ut())}};function et(ht,mt,St){var Mt=new X;return Mt.restart(ht,mt,St),Mt}function tt(){G(),++A;for(var ht=T,mt;ht;)(mt=R-ht._time)>=0&&ht._call.call(void 0,mt),ht=ht._next;--A}function q(){R=(D=I.now())+_,A=W=0;try{tt()}finally{A=0,st(),R=0}}function it(){var ht=I.now(),mt=ht-D;mt>C&&(_-=mt,D=ht)}function st(){for(var ht,mt=T,St,Mt=1/0;mt;)mt._call?(Mt>mt._time&&(Mt=mt._time),ht=mt,mt=mt._next):(St=mt._next,mt._next=null,mt=ht?ht._next=St:T=St);N=ht,ut(Mt)}function ut(ht){if(!A){W&&(W=clearTimeout(W));var mt=ht-R;mt>24?(ht<1/0&&(W=setTimeout(q,ht-I.now()-_)),z&&(z=clearInterval(z))):(z||(D=I.now(),z=setInterval(it,C)),A=1,L(q))}}},80813:function(Y,Q,S){"use strict";S.d(Q,{CR:function(){return q},Jh:function(){return K},Q_:function(){return Ht},XA:function(){return tt},ZT:function(){return W},_T:function(){return C},ev:function(){return ut},mG:function(){return G},pi:function(){return z},pr:function(){return st}});var A=function(Rt,_t){return A=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Bt,dt){Bt.__proto__=dt}||function(Bt,dt){for(var wt in dt)Object.prototype.hasOwnProperty.call(dt,wt)&&(Bt[wt]=dt[wt])},A(Rt,_t)};function W(Rt,_t){if(typeof _t!="function"&&_t!==null)throw new TypeError("Class extends value "+String(_t)+" is not a constructor or null");A(Rt,_t);function Bt(){this.constructor=Rt}Rt.prototype=_t===null?Object.create(_t):(Bt.prototype=_t.prototype,new Bt)}var z=function(){return z=Object.assign||function(_t){for(var Bt,dt=1,wt=arguments.length;dt<wt;dt++){Bt=arguments[dt];for(var Ot in Bt)Object.prototype.hasOwnProperty.call(Bt,Ot)&&(_t[Ot]=Bt[Ot])}return _t},z.apply(this,arguments)};function C(Rt,_t){var Bt={};for(var dt in Rt)Object.prototype.hasOwnProperty.call(Rt,dt)&&_t.indexOf(dt)<0&&(Bt[dt]=Rt[dt]);if(Rt!=null&&typeof Object.getOwnPropertySymbols=="function")for(var wt=0,dt=Object.getOwnPropertySymbols(Rt);wt<dt.length;wt++)_t.indexOf(dt[wt])<0&&Object.prototype.propertyIsEnumerable.call(Rt,dt[wt])&&(Bt[dt[wt]]=Rt[dt[wt]]);return Bt}function T(Rt,_t,Bt,dt){var wt=arguments.length,Ot=wt<3?_t:dt===null?dt=Object.getOwnPropertyDescriptor(_t,Bt):dt,Zt;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")Ot=Reflect.decorate(Rt,_t,Bt,dt);else for(var ve=Rt.length-1;ve>=0;ve--)(Zt=Rt[ve])&&(Ot=(wt<3?Zt(Ot):wt>3?Zt(_t,Bt,Ot):Zt(_t,Bt))||Ot);return wt>3&&Ot&&Object.defineProperty(_t,Bt,Ot),Ot}function N(Rt,_t){return function(Bt,dt){_t(Bt,dt,Rt)}}function D(Rt,_t,Bt,dt,wt,Ot){function Zt(mr){if(mr!==void 0&&typeof mr!="function")throw new TypeError("Function expected");return mr}for(var ve=dt.kind,Be=ve==="getter"?"get":ve==="setter"?"set":"value",ge=!_t&&Rt?dt.static?Rt:Rt.prototype:null,ke=_t||(ge?Object.getOwnPropertyDescriptor(ge,dt.name):{}),Ve,vn=!1,Ce=Bt.length-1;Ce>=0;Ce--){var Se={};for(var ye in dt)Se[ye]=ye==="access"?{}:dt[ye];for(var ye in dt.access)Se.access[ye]=dt.access[ye];Se.addInitializer=function(mr){if(vn)throw new TypeError("Cannot add initializers after decoration has completed");Ot.push(Zt(mr||null))};var Pe=(0,Bt[Ce])(ve==="accessor"?{get:ke.get,set:ke.set}:ke[Be],Se);if(ve==="accessor"){if(Pe===void 0)continue;if(Pe===null||typeof Pe!="object")throw new TypeError("Object expected");(Ve=Zt(Pe.get))&&(ke.get=Ve),(Ve=Zt(Pe.set))&&(ke.set=Ve),(Ve=Zt(Pe.init))&&wt.unshift(Ve)}else(Ve=Zt(Pe))&&(ve==="field"?wt.unshift(Ve):ke[Be]=Ve)}ge&&Object.defineProperty(ge,dt.name,ke),vn=!0}function R(Rt,_t,Bt){for(var dt=arguments.length>2,wt=0;wt<_t.length;wt++)Bt=dt?_t[wt].call(Rt,Bt):_t[wt].call(Rt);return dt?Bt:void 0}function _(Rt){return typeof Rt=="symbol"?Rt:"".concat(Rt)}function I(Rt,_t,Bt){return typeof _t=="symbol"&&(_t=_t.description?"[".concat(_t.description,"]"):""),Object.defineProperty(Rt,"name",{configurable:!0,value:Bt?"".concat(Bt," ",_t):_t})}function L(Rt,_t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(Rt,_t)}function G(Rt,_t,Bt,dt){function wt(Ot){return Ot instanceof Bt?Ot:new Bt(function(Zt){Zt(Ot)})}return new(Bt||(Bt=Promise))(function(Ot,Zt){function ve(ke){try{ge(dt.next(ke))}catch(Ve){Zt(Ve)}}function Be(ke){try{ge(dt.throw(ke))}catch(Ve){Zt(Ve)}}function ge(ke){ke.done?Ot(ke.value):wt(ke.value).then(ve,Be)}ge((dt=dt.apply(Rt,_t||[])).next())})}function K(Rt,_t){var Bt={label:0,sent:function(){if(Ot[0]&1)throw Ot[1];return Ot[1]},trys:[],ops:[]},dt,wt,Ot,Zt=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return Zt.next=ve(0),Zt.throw=ve(1),Zt.return=ve(2),typeof Symbol=="function"&&(Zt[Symbol.iterator]=function(){return this}),Zt;function ve(ge){return function(ke){return Be([ge,ke])}}function Be(ge){if(dt)throw new TypeError("Generator is already executing.");for(;Zt&&(Zt=0,ge[0]&&(Bt=0)),Bt;)try{if(dt=1,wt&&(Ot=ge[0]&2?wt.return:ge[0]?wt.throw||((Ot=wt.return)&&Ot.call(wt),0):wt.next)&&!(Ot=Ot.call(wt,ge[1])).done)return Ot;switch(wt=0,Ot&&(ge=[ge[0]&2,Ot.value]),ge[0]){case 0:case 1:Ot=ge;break;case 4:return Bt.label++,{value:ge[1],done:!1};case 5:Bt.label++,wt=ge[1],ge=[0];continue;case 7:ge=Bt.ops.pop(),Bt.trys.pop();continue;default:if(Ot=Bt.trys,!(Ot=Ot.length>0&&Ot[Ot.length-1])&&(ge[0]===6||ge[0]===2)){Bt=0;continue}if(ge[0]===3&&(!Ot||ge[1]>Ot[0]&&ge[1]<Ot[3])){Bt.label=ge[1];break}if(ge[0]===6&&Bt.label<Ot[1]){Bt.label=Ot[1],Ot=ge;break}if(Ot&&Bt.label<Ot[2]){Bt.label=Ot[2],Bt.ops.push(ge);break}Ot[2]&&Bt.ops.pop(),Bt.trys.pop();continue}ge=_t.call(Rt,Bt)}catch(ke){ge=[6,ke],wt=0}finally{dt=Ot=0}if(ge[0]&5)throw ge[1];return{value:ge[0]?ge[1]:void 0,done:!0}}}var X=Object.create?function(Rt,_t,Bt,dt){dt===void 0&&(dt=Bt);var wt=Object.getOwnPropertyDescriptor(_t,Bt);(!wt||("get"in wt?!_t.__esModule:wt.writable||wt.configurable))&&(wt={enumerable:!0,get:function(){return _t[Bt]}}),Object.defineProperty(Rt,dt,wt)}:function(Rt,_t,Bt,dt){dt===void 0&&(dt=Bt),Rt[dt]=_t[Bt]};function et(Rt,_t){for(var Bt in Rt)Bt!=="default"&&!Object.prototype.hasOwnProperty.call(_t,Bt)&&X(_t,Rt,Bt)}function tt(Rt){var _t=typeof Symbol=="function"&&Symbol.iterator,Bt=_t&&Rt[_t],dt=0;if(Bt)return Bt.call(Rt);if(Rt&&typeof Rt.length=="number")return{next:function(){return Rt&&dt>=Rt.length&&(Rt=void 0),{value:Rt&&Rt[dt++],done:!Rt}}};throw new TypeError(_t?"Object is not iterable.":"Symbol.iterator is not defined.")}function q(Rt,_t){var Bt=typeof Symbol=="function"&&Rt[Symbol.iterator];if(!Bt)return Rt;var dt=Bt.call(Rt),wt,Ot=[],Zt;try{for(;(_t===void 0||_t-- >0)&&!(wt=dt.next()).done;)Ot.push(wt.value)}catch(ve){Zt={error:ve}}finally{try{wt&&!wt.done&&(Bt=dt.return)&&Bt.call(dt)}finally{if(Zt)throw Zt.error}}return Ot}function it(){for(var Rt=[],_t=0;_t<arguments.length;_t++)Rt=Rt.concat(q(arguments[_t]));return Rt}function st(){for(var Rt=0,_t=0,Bt=arguments.length;_t<Bt;_t++)Rt+=arguments[_t].length;for(var dt=Array(Rt),wt=0,_t=0;_t<Bt;_t++)for(var Ot=arguments[_t],Zt=0,ve=Ot.length;Zt<ve;Zt++,wt++)dt[wt]=Ot[Zt];return dt}function ut(Rt,_t,Bt){if(Bt||arguments.length===2)for(var dt=0,wt=_t.length,Ot;dt<wt;dt++)(Ot||!(dt in _t))&&(Ot||(Ot=Array.prototype.slice.call(_t,0,dt)),Ot[dt]=_t[dt]);return Rt.concat(Ot||Array.prototype.slice.call(_t))}function ht(Rt){return this instanceof ht?(this.v=Rt,this):new ht(Rt)}function mt(Rt,_t,Bt){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var dt=Bt.apply(Rt,_t||[]),wt,Ot=[];return wt=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),ve("next"),ve("throw"),ve("return",Zt),wt[Symbol.asyncIterator]=function(){return this},wt;function Zt(Ce){return function(Se){return Promise.resolve(Se).then(Ce,Ve)}}function ve(Ce,Se){dt[Ce]&&(wt[Ce]=function(ye){return new Promise(function(Pe,mr){Ot.push([Ce,ye,Pe,mr])>1||Be(Ce,ye)})},Se&&(wt[Ce]=Se(wt[Ce])))}function Be(Ce,Se){try{ge(dt[Ce](Se))}catch(ye){vn(Ot[0][3],ye)}}function ge(Ce){Ce.value instanceof ht?Promise.resolve(Ce.value.v).then(ke,Ve):vn(Ot[0][2],Ce)}function ke(Ce){Be("next",Ce)}function Ve(Ce){Be("throw",Ce)}function vn(Ce,Se){Ce(Se),Ot.shift(),Ot.length&&Be(Ot[0][0],Ot[0][1])}}function St(Rt){var _t,Bt;return _t={},dt("next"),dt("throw",function(wt){throw wt}),dt("return"),_t[Symbol.iterator]=function(){return this},_t;function dt(wt,Ot){_t[wt]=Rt[wt]?function(Zt){return(Bt=!Bt)?{value:ht(Rt[wt](Zt)),done:!1}:Ot?Ot(Zt):Zt}:Ot}}function Mt(Rt){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var _t=Rt[Symbol.asyncIterator],Bt;return _t?_t.call(Rt):(Rt=typeof tt=="function"?tt(Rt):Rt[Symbol.iterator](),Bt={},dt("next"),dt("throw"),dt("return"),Bt[Symbol.asyncIterator]=function(){return this},Bt);function dt(Ot){Bt[Ot]=Rt[Ot]&&function(Zt){return new Promise(function(ve,Be){Zt=Rt[Ot](Zt),wt(ve,Be,Zt.done,Zt.value)})}}function wt(Ot,Zt,ve,Be){Promise.resolve(Be).then(function(ge){Ot({value:ge,done:ve})},Zt)}}function pt(Rt,_t){return Object.defineProperty?Object.defineProperty(Rt,"raw",{value:_t}):Rt.raw=_t,Rt}var xt=Object.create?function(Rt,_t){Object.defineProperty(Rt,"default",{enumerable:!0,value:_t})}:function(Rt,_t){Rt.default=_t},kt=function(Rt){return kt=Object.getOwnPropertyNames||function(_t){var Bt=[];for(var dt in _t)Object.prototype.hasOwnProperty.call(_t,dt)&&(Bt[Bt.length]=dt);return Bt},kt(Rt)};function Gt(Rt){if(Rt&&Rt.__esModule)return Rt;var _t={};if(Rt!=null)for(var Bt=kt(Rt),dt=0;dt<Bt.length;dt++)Bt[dt]!=="default"&&X(_t,Rt,Bt[dt]);return xt(_t,Rt),_t}function jt(Rt){return Rt&&Rt.__esModule?Rt:{default:Rt}}function Ht(Rt,_t,Bt,dt){if(Bt==="a"&&!dt)throw new TypeError("Private accessor was defined without a getter");if(typeof _t=="function"?Rt!==_t||!dt:!_t.has(Rt))throw new TypeError("Cannot read private member from an object whose class did not declare it");return Bt==="m"?dt:Bt==="a"?dt.call(Rt):dt?dt.value:_t.get(Rt)}function fe(Rt,_t,Bt,dt,wt){if(dt==="m")throw new TypeError("Private method is not writable");if(dt==="a"&&!wt)throw new TypeError("Private accessor was defined without a setter");if(typeof _t=="function"?Rt!==_t||!wt:!_t.has(Rt))throw new TypeError("Cannot write private member to an object whose class did not declare it");return dt==="a"?wt.call(Rt,Bt):wt?wt.value=Bt:_t.set(Rt,Bt),Bt}function we(Rt,_t){if(_t===null||typeof _t!="object"&&typeof _t!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof Rt=="function"?_t===Rt:Rt.has(_t)}function Xe(Rt,_t,Bt){if(_t!=null){if(typeof _t!="object"&&typeof _t!="function")throw new TypeError("Object expected.");var dt,wt;if(Bt){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");dt=_t[Symbol.asyncDispose]}if(dt===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");dt=_t[Symbol.dispose],Bt&&(wt=dt)}if(typeof dt!="function")throw new TypeError("Object not disposable.");wt&&(dt=function(){try{wt.call(this)}catch(Ot){return Promise.reject(Ot)}}),Rt.stack.push({value:_t,dispose:dt,async:Bt})}else Bt&&Rt.stack.push({async:!0});return _t}var Hn=typeof SuppressedError=="function"?SuppressedError:function(Rt,_t,Bt){var dt=new Error(Bt);return dt.name="SuppressedError",dt.error=Rt,dt.suppressed=_t,dt};function Ei(Rt){function _t(Ot){Rt.error=Rt.hasError?new Hn(Ot,Rt.error,"An error was suppressed during disposal."):Ot,Rt.hasError=!0}var Bt,dt=0;function wt(){for(;Bt=Rt.stack.pop();)try{if(!Bt.async&&dt===1)return dt=0,Rt.stack.push(Bt),Promise.resolve().then(wt);if(Bt.dispose){var Ot=Bt.dispose.call(Bt.value);if(Bt.async)return dt|=2,Promise.resolve(Ot).then(wt,function(Zt){return _t(Zt),wt()})}else dt|=1}catch(Zt){_t(Zt)}if(dt===1)return Rt.hasError?Promise.reject(Rt.error):Promise.resolve();if(Rt.hasError)throw Rt.error}return wt()}function Ra(Rt,_t){return typeof Rt=="string"&&/^\.\.?\//.test(Rt)?Rt.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(Bt,dt,wt,Ot,Zt){return dt?_t?".jsx":".js":wt&&(!Ot||!Zt)?Bt:wt+Ot+"."+Zt.toLowerCase()+"js"}):Rt}var cs={__extends:W,__assign:z,__rest:C,__decorate:T,__param:N,__esDecorate:D,__runInitializers:R,__propKey:_,__setFunctionName:I,__metadata:L,__awaiter:G,__generator:K,__createBinding:X,__exportStar:et,__values:tt,__read:q,__spread:it,__spreadArrays:st,__spreadArray:ut,__await:ht,__asyncGenerator:mt,__asyncDelegator:St,__asyncValues:Mt,__makeTemplateObject:pt,__importStar:Gt,__importDefault:jt,__classPrivateFieldGet:Ht,__classPrivateFieldSet:fe,__classPrivateFieldIn:we,__addDisposableResource:Xe,__disposeResources:Ei,__rewriteRelativeImportExtension:Ra}}}]);
|
|
|
}()); |