=x&&((M=g.onLayoutEnd)===null||M===void 0||M.call(g),window.clearInterval(g.timeInterval))},0)}return{nodes:p,edges:h}}},y.prototype.runOneStep=function(E){var g,p=this,h=p.nodes;if(!!h){var x=p.edges,m=p.center,b=p.gravity,A=p.speed,k=p.clustering,G=p.height*p.width,T=Math.sqrt(G)/10,M=G/(h.length+1),V=Math.sqrt(M),j=[];if(h.forEach(function(te,ee){j[ee]={x:0,y:0}}),p.applyCalculate(h,x,j,V,M),k){for(var $ in E)E[$].cx=0,E[$].cy=0,E[$].count=0;h.forEach(function(te){var ee=E[te.cluster];(0,B.isNumber)(te.x)&&(ee.cx+=te.x),(0,B.isNumber)(te.y)&&(ee.cy+=te.y),ee.count++});for(var $ in E)E[$].cx/=E[$].count,E[$].cy/=E[$].count;var q=p.clusterGravity||b;h.forEach(function(te,ee){if(!(!(0,B.isNumber)(te.x)||!(0,B.isNumber)(te.y))){var ie=E[te.cluster],ce=Math.sqrt((te.x-ie.cx)*(te.x-ie.cx)+(te.y-ie.cy)*(te.y-ie.cy)),ge=V*q;j[ee].x-=ge*(te.x-ie.cx)/ce,j[ee].y-=ge*(te.y-ie.cy)/ce}})}h.forEach(function(te,ee){if(!(!(0,B.isNumber)(te.x)||!(0,B.isNumber)(te.y))){var ie=.01*V*b;j[ee].x-=ie*(te.x-m[0]),j[ee].y-=ie*(te.y-m[1])}}),h.forEach(function(te,ee){if((0,B.isNumber)(te.fx)&&(0,B.isNumber)(te.fy)){te.x=te.fx,te.y=te.fy;return}if(!(!(0,B.isNumber)(te.x)||!(0,B.isNumber)(te.y))){var ie=Math.sqrt(j[ee].x*j[ee].x+j[ee].y*j[ee].y);if(ie>0){var ce=Math.min(T*(A/D),ie);te.x+=j[ee].x/ie*ce,te.y+=j[ee].y/ie*ce}}}),(g=p.tick)===null||g===void 0||g.call(p)}},y.prototype.applyCalculate=function(E,g,p,h,x){var m=this;m.calRepulsive(E,p,x),g&&m.calAttractive(g,p,h)},y.prototype.calRepulsive=function(E,g,p){E.forEach(function(h,x){g[x]={x:0,y:0},E.forEach(function(m,b){if(x!==b&&!(!(0,B.isNumber)(h.x)||!(0,B.isNumber)(m.x)||!(0,B.isNumber)(h.y)||!(0,B.isNumber)(m.y))){var A=h.x-m.x,k=h.y-m.y,G=A*A+k*k;if(G===0){G=1;var T=x>b?1:-1;A=.01*T,k=.01*T}var M=p/G;g[x].x+=A*M,g[x].y+=k*M}})})},y.prototype.calAttractive=function(E,g,p){var h=this;E.forEach(function(x){var m=(0,B.getEdgeTerminal)(x,"source"),b=(0,B.getEdgeTerminal)(x,"target");if(!(!m||!b)){var A=h.nodeIdxMap[m],k=h.nodeIdxMap[b];if(A!==k){var G=h.nodeMap[m],T=h.nodeMap[b];if(!(!(0,B.isNumber)(T.x)||!(0,B.isNumber)(G.x)||!(0,B.isNumber)(T.y)||!(0,B.isNumber)(G.y))){var M=T.x-G.x,V=T.y-G.y,j=Math.sqrt(M*M+V*V),$=j*j/p;g[k].x-=M/j*$,g[k].y-=V/j*$,g[A].x+=M/j*$,g[A].y+=V/j*$}}}})},y.prototype.stop=function(){this.timeInterval&&typeof window!="undefined"&&window.clearInterval(this.timeInterval)},y.prototype.destroy=function(){var E=this;E.stop(),E.tick=null,E.nodes=null,E.edges=null,E.destroyed=!0},y.prototype.getType=function(){return"fruchterman"},y}(Y.Base);X.FruchtermanLayout=P},46260:function(hr,X,W){"use strict";var U=this&&this.__extends||function(){var N=function(y,E){return N=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,p){g.__proto__=p}||function(g,p){for(var h in p)Object.prototype.hasOwnProperty.call(p,h)&&(g[h]=p[h])},N(y,E)};return function(y,E){if(typeof E!="function"&&E!==null)throw new TypeError("Class extends value "+String(E)+" is not a constructor or null");N(y,E);function g(){this.constructor=y}y.prototype=E===null?Object.create(E):(g.prototype=E.prototype,new g)}}();Object.defineProperty(X,"__esModule",{value:!0}),X.GForceLayout=void 0;var Y=W(46253),B=W(8273),D=function(N,y){var E;return N?(0,B.isNumber)(N)?E=function(g){return N}:E=N:E=function(g){return y||1},E},P=function(N){U(y,N);function y(E){var g=N.call(this)||this;return g.maxIteration=500,g.workerEnabled=!1,g.edgeStrength=200,g.nodeStrength=1e3,g.coulombDisScale=.005,g.damping=.9,g.maxSpeed=1e3,g.minMovement=.5,g.interval=.02,g.factor=1,g.linkDistance=1,g.gravity=10,g.preventOverlap=!0,g.collideStrength=1,g.tick=function(){},g.nodes=[],g.edges=[],g.width=300,g.height=300,g.nodeMap={},g.nodeIdxMap={},g.animate=!0,g.updateCfg(E),g}return y.prototype.getDefaultCfg=function(){return{maxIteration:500,gravity:10,enableTick:!0,animate:!0}},y.prototype.execute=function(){var E,g,p=this,h=p.nodes;if(p.timeInterval!==void 0&&typeof window!="undefined"&&window.clearInterval(p.timeInterval),!h||h.length===0){(E=p.onLayoutEnd)===null||E===void 0||E.call(p);return}!p.width&&typeof window!="undefined"&&(p.width=window.innerWidth),!p.height&&typeof window!="undefined"&&(p.height=window.innerHeight),p.center||(p.center=[p.width/2,p.height/2]);var x=p.center;if(h.length===1){h[0].x=x[0],h[0].y=x[1],(g=p.onLayoutEnd)===null||g===void 0||g.call(p);return}var m={},b={};h.forEach(function(V,j){(0,B.isNumber)(V.x)||(V.x=Math.random()*p.width),(0,B.isNumber)(V.y)||(V.y=Math.random()*p.height),m[V.id]=V,b[V.id]=j}),p.nodeMap=m,p.nodeIdxMap=b,p.linkDistance=D(p.linkDistance,1),p.nodeStrength=D(p.nodeStrength,1),p.edgeStrength=D(p.edgeStrength,1);var A=p.nodeSize,k;if(p.preventOverlap){var G=p.nodeSpacing,T;(0,B.isNumber)(G)?T=function(){return G}:(0,B.isFunction)(G)?T=G:T=function(){return 0},A?(0,B.isArray)(A)?k=function(V){return Math.max(A[0],A[1])+T(V)}:k=function(V){return A+T(V)}:k=function(V){return V.size?(0,B.isArray)(V.size)?Math.max(V.size[0],V.size[1])+T(V):(0,B.isObject)(V.size)?Math.max(V.size.width,V.size.height)+T(V):V.size+T(V):10+T(V)}}p.nodeSize=k;var M=p.edges;p.degrees=(0,B.getDegree)(h.length,p.nodeIdxMap,M),p.getMass||(p.getMass=function(V){var j=V.mass||p.degrees[p.nodeIdxMap[V.id]].all||1;return j}),p.run()},y.prototype.run=function(){var E,g=this,p=g.maxIteration,h=g.nodes,x=g.workerEnabled,m=g.minMovement,b=g.animate;if(!!h)if(x||!b){for(var A=0;A=p&&((M=g.onLayoutEnd)===null||M===void 0||M.call(g),window.clearInterval(g.timeInterval))}},0)}},y.prototype.reachMoveThreshold=function(E,g,p){var h=0;return E.forEach(function(x,m){var b=x.x-g[m].x,A=x.y-g[m].y;h+=Math.sqrt(b*b+A*A)}),h/=E.length,h
=q)){var te=M.x-$.x,ee=M.y-$.y;te===0&&ee===0&&(te=Math.random()*.01,ee=Math.random()*.01);var ie=te*te+ee*ee,ce=Math.sqrt(ie),ge=(ce+.1)*m,Le=te/ce,Oe=ee/ce,Re=(G(M)+G($))*.5*x/(ge*ge),de=h?h($):1;if(E[2*V]+=Le*Re,E[2*V+1]+=Oe*Re,E[2*q]-=Le*Re,E[2*q+1]-=Oe*Re,b&&(T(M)+T($))/2>ce){var ve=k*(G(M)+G($))*.5/ie;E[2*V]+=Le*ve/j,E[2*V+1]+=Oe*ve/j,E[2*q]-=Le*ve/de,E[2*q+1]-=Oe*ve/de}}})})},y.prototype.calAttractive=function(E,g){var p=this,h=p.nodeMap,x=p.nodeIdxMap,m=p.linkDistance,b=p.edgeStrength,A=p.nodeSize,k=p.getMass;g.forEach(function(G,T){var M=(0,B.getEdgeTerminal)(G,"source"),V=(0,B.getEdgeTerminal)(G,"target"),j=h[M],$=h[V],q=$.x-j.x,te=$.y-j.y;q===0&&te===0&&(q=Math.random()*.01,te=Math.random()*.01);var ee=Math.sqrt(q*q+te*te),ie=q/ee,ce=te/ee,ge=m(G,j,$)||1+(A(j)+A($)||0)/2,Le=ge-ee,Oe=Le*b(G),Re=x[M],de=x[V],ve=k?k(j):1,be=k?k($):1;E[2*Re]-=ie*Oe/ve,E[2*Re+1]-=ce*Oe/ve,E[2*de]+=ie*Oe/be,E[2*de+1]+=ce*Oe/be})},y.prototype.calGravity=function(E,g){for(var p=this,h=p.center,x=p.gravity,m=p.degrees,b=g.length,A=0;Ax.maxSpeed){var M=x.maxSpeed/T;k=M*k,G=M*G}g[2*A]=k,g[2*A+1]=G})},y.prototype.updatePosition=function(E,g,p){p.forEach(function(h,x){if((0,B.isNumber)(h.fx)&&(0,B.isNumber)(h.fy)){h.x=h.fx,h.y=h.fy;return}var m=E[2*x]*g,b=E[2*x+1]*g;h.x+=m,h.y+=b})},y.prototype.stop=function(){this.timeInterval&&typeof window!="undefined"&&window.clearInterval(this.timeInterval)},y.prototype.destroy=function(){var E=this;E.stop(),E.tick=null,E.nodes=null,E.edges=null,E.destroyed=!0},y.prototype.getType=function(){return"gForce"},y}(Y.Base);X.GForceLayout=P},81822:function(hr,X,W){"use strict";var U=this&&this.__extends||function(){var h=function(x,m){return h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(b,A){b.__proto__=A}||function(b,A){for(var k in A)Object.prototype.hasOwnProperty.call(A,k)&&(b[k]=A[k])},h(x,m)};return function(x,m){if(typeof m!="function"&&m!==null)throw new TypeError("Class extends value "+String(m)+" is not a constructor or null");h(x,m);function b(){this.constructor=x}x.prototype=m===null?Object.create(m):(b.prototype=m.prototype,new b)}}(),Y=this&&this.__awaiter||function(h,x,m,b){function A(k){return k instanceof m?k:new m(function(G){G(k)})}return new(m||(m=Promise))(function(k,G){function T(j){try{V(b.next(j))}catch($){G($)}}function M(j){try{V(b.throw(j))}catch($){G($)}}function V(j){j.done?k(j.value):A(j.value).then(T,M)}V((b=b.apply(h,x||[])).next())})},B=this&&this.__generator||function(h,x){var m={label:0,sent:function(){if(k[0]&1)throw k[1];return k[1]},trys:[],ops:[]},b,A,k,G;return G={next:T(0),throw:T(1),return:T(2)},typeof Symbol=="function"&&(G[Symbol.iterator]=function(){return this}),G;function T(V){return function(j){return M([V,j])}}function M(V){if(b)throw new TypeError("Generator is already executing.");for(;G&&(G=0,V[0]&&(m=0)),m;)try{if(b=1,A&&(k=V[0]&2?A.return:V[0]?A.throw||((k=A.return)&&k.call(A),0):A.next)&&!(k=k.call(A,V[1])).done)return k;switch(A=0,k&&(V=[V[0]&2,k.value]),V[0]){case 0:case 1:k=V;break;case 4:return m.label++,{value:V[1],done:!1};case 5:m.label++,A=V[1],V=[0];continue;case 7:V=m.ops.pop(),m.trys.pop();continue;default:if(k=m.trys,!(k=k.length>0&&k[k.length-1])&&(V[0]===6||V[0]===2)){m=0;continue}if(V[0]===3&&(!k||V[1]>k[0]&&V[1] 0.0) {
+ dx += param * xDist;
+ dy += param * yDist;
+ if (xDist == 0 && yDist == 0) {
+ const sign = i < j ? 1 : -1;
+ dx += param * sign;
+ dy += param * sign;
+ }
+ }
+ }
+ }
+ return [dx, dy];
+ }
+ calcGravity(currentNode: vec4, nodeAttributes: vec4): vec2 { //
+ let dx = 0, dy = 0;
+ const vx = currentNode[0] - this.u_Center[0];
+ const vy = currentNode[1] - this.u_Center[1];
+ const gf = 0.01 * this.u_K * this.u_Gravity;
+ dx = gf * vx;
+ dy = gf * vy;
+ if (this.u_Clustering == 1) {
+ const clusterIdx = int(nodeAttributes[0]);
+ const center = this.u_ClusterCenters[clusterIdx];
+ const cvx = currentNode[0] - center[0];
+ const cvy = currentNode[1] - center[1];
+ const dist = sqrt(cvx * cvx + cvy * cvy) + 0.01;
+ const parma = this.u_K * this.u_ClusterGravity / dist;
+ dx += parma * cvx;
+ dy += parma * cvy;
+ }
+ return [dx, dy];
+ }
+ calcAttractive(i: int, currentNode: vec4): vec2 {
+ let dx = 0, dy = 0;
+ const arr_offset = int(floor(currentNode[2] + 0.5));
+ const length = int(floor(currentNode[3] + 0.5));
+ const node_buffer: vec4;
+ for (let p = 0; p < MAX_EDGE_PER_VERTEX; p++) {
+ if (p >= length) break;
+ const arr_idx = arr_offset + p;
+ // when arr_idx % 4 == 0 update currentNodedx_buffer
+ const buf_offset = arr_idx - arr_idx / 4 * 4;
+ if (p == 0 || buf_offset == 0) {
+ node_buffer = this.u_Data[int(arr_idx / 4)];
+ }
+ const float_j = buf_offset == 0 ? node_buffer[0] :
+ buf_offset == 1 ? node_buffer[1] :
+ buf_offset == 2 ? node_buffer[2] :
+ node_buffer[3];
+ const nextNode = this.u_Data[int(float_j)];
+ const xDist = currentNode[0] - nextNode[0];
+ const yDist = currentNode[1] - nextNode[1];
+ const dist = sqrt(xDist * xDist + yDist * yDist) + 0.01;
+ let attractiveF = dist / this.u_K;
+
+ if (dist > 0.0) {
+ dx -= xDist * attractiveF;
+ dy -= yDist * attractiveF;
+ if (xDist == 0 && yDist == 0) {
+ const sign = i < int(float_j) ? 1 : -1;
+ dx -= sign * attractiveF;
+ dy -= sign * attractiveF;
+ }
+ }
+ }
+ return [dx, dy];
+ }
+ @main
+ compute() {
+ const i = globalInvocationID.x;
+ const currentNode = this.u_Data[i];
+ let dx = 0, dy = 0;
+ if (i >= VERTEX_COUNT) {
+ this.u_Data[i] = currentNode;
+ return;
+ }
+
+ // [gravity, fx, fy, 0]
+ const nodeAttributes = this.u_AttributeArray[i];
+
+ if (nodeAttributes[1] != 0 && nodeAttributes[2] != 0) {
+ // the node is fixed
+ this.u_Data[i] = [
+ nodeAttributes[1],
+ nodeAttributes[2],
+ currentNode[2],
+ currentNode[3]
+ ];
+ return;
+ }
+
+ // repulsive
+ const repulsive = this.calcRepulsive(i, currentNode);
+ dx += repulsive[0];
+ dy += repulsive[1];
+ // attractive
+ const attractive = this.calcAttractive(i, currentNode);
+ dx += attractive[0];
+ dy += attractive[1];
+ // gravity
+ const gravity = this.calcGravity(currentNode, nodeAttributes);
+ dx -= gravity[0];
+ dy -= gravity[1];
+ // speed
+ dx *= this.u_Speed;
+ dy *= this.u_Speed;
+
+ // move
+ const distLength = sqrt(dx * dx + dy * dy);
+ if (distLength > 0.0) {
+ const limitedDist = min(this.u_MaxDisplace * this.u_Speed, distLength);
+ this.u_Data[i] = [
+ currentNode[0] + dx / distLength * limitedDist,
+ currentNode[1] + dy / distLength * limitedDist,
+ currentNode[2],
+ currentNode[3]
+ ];
+ }
+ }
+}
+`,X.fruchtermanBundle='{"shaders":{"WGSL":"","GLSL450":"","GLSL100":"\\n\\nfloat epsilon = 0.00001;\\nvec2 addrTranslation_1Dto2D(float address1D, vec2 texSize) {\\n vec2 conv_const = vec2(1.0 / texSize.x, 1.0 / (texSize.x * texSize.y));\\n vec2 normAddr2D = float(address1D) * conv_const;\\n return vec2(fract(normAddr2D.x + epsilon), normAddr2D.y);\\n}\\n\\nvoid barrier() {}\\n \\n\\nuniform vec2 u_OutputTextureSize;\\nuniform int u_OutputTexelCount;\\nvarying vec2 v_TexCoord;\\n\\nbool gWebGPUDebug = false;\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\n\\n#define MAX_EDGE_PER_VERTEX __DefineValuePlaceholder__MAX_EDGE_PER_VERTEX\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\n\\nuniform sampler2D u_Data;\\nuniform vec2 u_DataSize;\\nvec4 getDatau_Data(vec2 address2D) {\\n return vec4(texture2D(u_Data, address2D).rgba);\\n}\\nvec4 getDatau_Data(float address1D) {\\n return getDatau_Data(addrTranslation_1Dto2D(address1D, u_DataSize));\\n}\\nvec4 getDatau_Data(int address1D) {\\n return getDatau_Data(float(address1D));\\n}\\nuniform float u_K;\\nuniform float u_K2;\\nuniform vec2 u_Center;\\nuniform float u_Gravity;\\nuniform float u_ClusterGravity;\\nuniform float u_Speed;\\nuniform float u_MaxDisplace;\\nuniform float u_Clustering;\\nuniform sampler2D u_AttributeArray;\\nuniform vec2 u_AttributeArraySize;\\nvec4 getDatau_AttributeArray(vec2 address2D) {\\n return vec4(texture2D(u_AttributeArray, address2D).rgba);\\n}\\nvec4 getDatau_AttributeArray(float address1D) {\\n return getDatau_AttributeArray(addrTranslation_1Dto2D(address1D, u_AttributeArraySize));\\n}\\nvec4 getDatau_AttributeArray(int address1D) {\\n return getDatau_AttributeArray(float(address1D));\\n}\\nuniform sampler2D u_ClusterCenters;\\nuniform vec2 u_ClusterCentersSize;\\nvec4 getDatau_ClusterCenters(vec2 address2D) {\\n return vec4(texture2D(u_ClusterCenters, address2D).rgba);\\n}\\nvec4 getDatau_ClusterCenters(float address1D) {\\n return getDatau_ClusterCenters(addrTranslation_1Dto2D(address1D, u_ClusterCentersSize));\\n}\\nvec4 getDatau_ClusterCenters(int address1D) {\\n return getDatau_ClusterCenters(float(address1D));\\n}\\nvec2 calcRepulsive(int i, vec4 currentNode) {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nfloat dx = 0.0;\\nfloat dy = 0.0;\\nfor (int j = 0; j < VERTEX_COUNT; j++) {if (i != j) {vec4 nextNode = getDatau_Data(j);\\nfloat xDist = currentNode.x - nextNode.x;\\nfloat yDist = currentNode.y - nextNode.y;\\nfloat dist = ((xDist * xDist) + (yDist * yDist)) + 0.01;\\nfloat param = u_K2 / dist;\\nif (dist > 0.0) {dx += param * xDist;\\ndy += param * yDist;\\nif ((xDist == 0.0) && (yDist == 0.0)) {float sign = (i < j) ? (1.0) : (-1.0);\\ndx += param * sign;\\ndy += param * sign;}}}}\\nreturn vec2(dx, dy);}\\nvec2 calcGravity(vec4 currentNode, vec4 nodeAttributes) {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nfloat dx = 0.0;\\nfloat dy = 0.0;\\nfloat vx = currentNode.x - u_Center.x;\\nfloat vy = currentNode.y - u_Center.y;\\nfloat gf = (0.01 * u_K) * u_Gravity;\\ndx = gf * vx;\\ndy = gf * vy;\\nif (u_Clustering == 1.0) {int clusterIdx = int(nodeAttributes.x);\\nvec4 center = getDatau_ClusterCenters(clusterIdx);\\nfloat cvx = currentNode.x - center.x;\\nfloat cvy = currentNode.y - center.y;\\nfloat dist = sqrt((cvx * cvx) + (cvy * cvy)) + 0.01;\\nfloat parma = (u_K * u_ClusterGravity) / dist;\\ndx += parma * cvx;\\ndy += parma * cvy;}\\nreturn vec2(dx, dy);}\\nvec2 calcAttractive(int i, vec4 currentNode) {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nfloat dx = 0.0;\\nfloat dy = 0.0;\\nint arr_offset = int(floor(currentNode.z + 0.5));\\nint length = int(floor(currentNode.w + 0.5));\\nvec4 node_buffer;\\nfor (int p = 0; p < MAX_EDGE_PER_VERTEX; p++) {if (p >= length) {break;}\\nint arr_idx = arr_offset + int(p);\\nint buf_offset = arr_idx - ((arr_idx / 4) * 4);\\nif ((p == 0) || (buf_offset == 0)) {node_buffer = getDatau_Data(int(arr_idx / 4));}\\nfloat float_j = (buf_offset == 0) ? (node_buffer.x) : ((buf_offset == 1) ? (node_buffer.y) : ((buf_offset == 2) ? (node_buffer.z) : (node_buffer.w)));\\nvec4 nextNode = getDatau_Data(int(float_j));\\nfloat xDist = currentNode.x - nextNode.x;\\nfloat yDist = currentNode.y - nextNode.y;\\nfloat dist = sqrt((xDist * xDist) + (yDist * yDist)) + 0.01;\\nfloat attractiveF = dist / u_K;\\nif (dist > 0.0) {dx -= xDist * attractiveF;\\ndy -= yDist * attractiveF;\\nif ((xDist == 0.0) && (yDist == 0.0)) {float sign = (i < int(float_j)) ? (1.0) : (-1.0);\\ndx -= sign * attractiveF;\\ndy -= sign * attractiveF;}}}\\nreturn vec2(dx, dy);}\\nvoid main() {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nint i = globalInvocationID.x;\\nvec4 currentNode = getDatau_Data(i);\\nfloat dx = 0.0;\\nfloat dy = 0.0;\\nif (i >= VERTEX_COUNT) {gl_FragColor = vec4(currentNode);\\nreturn ;}\\nvec4 nodeAttributes = getDatau_AttributeArray(i);\\nif ((nodeAttributes.y != 0.0) && (nodeAttributes.z != 0.0)) {gl_FragColor = vec4(vec4(nodeAttributes.y, nodeAttributes.z, currentNode.z, currentNode.w));\\nreturn ;}\\nvec2 repulsive = calcRepulsive(i, currentNode);\\ndx += repulsive.x;\\ndy += repulsive.y;\\nvec2 attractive = calcAttractive(i, currentNode);\\ndx += attractive.x;\\ndy += attractive.y;\\nvec2 gravity = calcGravity(currentNode, nodeAttributes);\\ndx -= gravity.x;\\ndy -= gravity.y;\\ndx *= u_Speed;\\ndy *= u_Speed;\\nfloat distLength = sqrt((dx * dx) + (dy * dy));\\nif (distLength > 0.0) {float limitedDist = min(u_MaxDisplace * u_Speed, distLength);\\ngl_FragColor = vec4(vec4(currentNode.x + ((dx / distLength) * limitedDist), currentNode.y + ((dy / distLength) * limitedDist), currentNode.z, currentNode.w));}if (gWebGPUDebug) {\\n gl_FragColor = gWebGPUDebugOutput;\\n}}\\n"},"context":{"name":"","dispatch":[1,1,1],"threadGroupSize":[1,1,1],"maxIteration":1,"defines":[{"name":"MAX_EDGE_PER_VERTEX","type":"Float","runtime":true},{"name":"VERTEX_COUNT","type":"Float","runtime":true}],"uniforms":[{"name":"u_Data","type":"vec4[]","storageClass":"StorageBuffer","readonly":false,"writeonly":false,"size":[1,1]},{"name":"u_K","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_K2","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_Center","type":"vec2","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_Gravity","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_ClusterGravity","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_Speed","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_MaxDisplace","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_Clustering","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_AttributeArray","type":"vec4[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_ClusterCenters","type":"vec4[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]}],"globalDeclarations":[],"output":{"name":"u_Data","size":[1,1],"length":1},"needPingpong":true}}',X.clusterCode=`
+import { globalInvocationID } from 'g-webgpu';
+const VERTEX_COUNT;
+const CLUSTER_COUNT;
+@numthreads(1, 1, 1)
+class CalcCenter {
+ @in
+ u_Data: vec4[];
+ @in
+ u_NodeAttributes: vec4[]; // [[clusterIdx, 0, 0, 0], ...]
+ @in @out
+ u_ClusterCenters: vec4[]; // [[cx, cy, nodeCount, clusterIdx], ...]
+ @main
+ compute() {
+ const i = globalInvocationID.x;
+ const center = this.u_ClusterCenters[i];
+ let sumx = 0;
+ let sumy = 0;
+ let count = 0;
+ for (let j = 0; j < VERTEX_COUNT; j++) {
+ const attributes = this.u_NodeAttributes[j];
+ const clusterIdx = int(attributes[0]);
+ const vertex = this.u_Data[j];
+ if (clusterIdx == i) {
+ sumx += vertex.x;
+ sumy += vertex.y;
+ count += 1;
+ }
+ }
+ this.u_ClusterCenters[i] = [
+ sumx / count,
+ sumy / count,
+ count,
+ i
+ ];
+ }
+}
+`,X.clusterBundle='{"shaders":{"WGSL":"","GLSL450":"","GLSL100":"\\n\\nfloat epsilon = 0.00001;\\nvec2 addrTranslation_1Dto2D(float address1D, vec2 texSize) {\\n vec2 conv_const = vec2(1.0 / texSize.x, 1.0 / (texSize.x * texSize.y));\\n vec2 normAddr2D = float(address1D) * conv_const;\\n return vec2(fract(normAddr2D.x + epsilon), normAddr2D.y);\\n}\\n\\nvoid barrier() {}\\n \\n\\nuniform vec2 u_OutputTextureSize;\\nuniform int u_OutputTexelCount;\\nvarying vec2 v_TexCoord;\\n\\nbool gWebGPUDebug = false;\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\n\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\n#define CLUSTER_COUNT __DefineValuePlaceholder__CLUSTER_COUNT\\n\\nuniform sampler2D u_Data;\\nuniform vec2 u_DataSize;\\nvec4 getDatau_Data(vec2 address2D) {\\n return vec4(texture2D(u_Data, address2D).rgba);\\n}\\nvec4 getDatau_Data(float address1D) {\\n return getDatau_Data(addrTranslation_1Dto2D(address1D, u_DataSize));\\n}\\nvec4 getDatau_Data(int address1D) {\\n return getDatau_Data(float(address1D));\\n}\\nuniform sampler2D u_NodeAttributes;\\nuniform vec2 u_NodeAttributesSize;\\nvec4 getDatau_NodeAttributes(vec2 address2D) {\\n return vec4(texture2D(u_NodeAttributes, address2D).rgba);\\n}\\nvec4 getDatau_NodeAttributes(float address1D) {\\n return getDatau_NodeAttributes(addrTranslation_1Dto2D(address1D, u_NodeAttributesSize));\\n}\\nvec4 getDatau_NodeAttributes(int address1D) {\\n return getDatau_NodeAttributes(float(address1D));\\n}\\nuniform sampler2D u_ClusterCenters;\\nuniform vec2 u_ClusterCentersSize;\\nvec4 getDatau_ClusterCenters(vec2 address2D) {\\n return vec4(texture2D(u_ClusterCenters, address2D).rgba);\\n}\\nvec4 getDatau_ClusterCenters(float address1D) {\\n return getDatau_ClusterCenters(addrTranslation_1Dto2D(address1D, u_ClusterCentersSize));\\n}\\nvec4 getDatau_ClusterCenters(int address1D) {\\n return getDatau_ClusterCenters(float(address1D));\\n}\\nvoid main() {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nint i = globalInvocationID.x;\\nvec4 center = getDatau_ClusterCenters(i);\\nfloat sumx = 0.0;\\nfloat sumy = 0.0;\\nfloat count = 0.0;\\nfor (int j = 0; j < VERTEX_COUNT; j++) {vec4 attributes = getDatau_NodeAttributes(j);\\nint clusterIdx = int(attributes.x);\\nvec4 vertex = getDatau_Data(j);\\nif (clusterIdx == i) {sumx += vertex.x;\\nsumy += vertex.y;\\ncount += 1.0;}}\\ngl_FragColor = vec4(vec4(sumx / count, sumy / count, count, i));if (gWebGPUDebug) {\\n gl_FragColor = gWebGPUDebugOutput;\\n}}\\n"},"context":{"name":"","dispatch":[1,1,1],"threadGroupSize":[1,1,1],"maxIteration":1,"defines":[{"name":"VERTEX_COUNT","type":"Float","runtime":true},{"name":"CLUSTER_COUNT","type":"Float","runtime":true}],"uniforms":[{"name":"u_Data","type":"vec4[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_NodeAttributes","type":"vec4[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_ClusterCenters","type":"vec4[]","storageClass":"StorageBuffer","readonly":false,"writeonly":false,"size":[1,1]}],"globalDeclarations":[],"output":{"name":"u_ClusterCenters","size":[1,1],"length":1},"needPingpong":true}}'},86043:function(hr,X,W){"use strict";var U=this&&this.__extends||function(){var x=function(m,b){return x=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(A,k){A.__proto__=k}||function(A,k){for(var G in k)Object.prototype.hasOwnProperty.call(k,G)&&(A[G]=k[G])},x(m,b)};return function(m,b){if(typeof b!="function"&&b!==null)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");x(m,b);function A(){this.constructor=m}m.prototype=b===null?Object.create(b):(A.prototype=b.prototype,new A)}}(),Y=this&&this.__awaiter||function(x,m,b,A){function k(G){return G instanceof b?G:new b(function(T){T(G)})}return new(b||(b=Promise))(function(G,T){function M($){try{j(A.next($))}catch(q){T(q)}}function V($){try{j(A.throw($))}catch(q){T(q)}}function j($){$.done?G($.value):k($.value).then(M,V)}j((A=A.apply(x,m||[])).next())})},B=this&&this.__generator||function(x,m){var b={label:0,sent:function(){if(G[0]&1)throw G[1];return G[1]},trys:[],ops:[]},A,k,G,T;return T={next:M(0),throw:M(1),return:M(2)},typeof Symbol=="function"&&(T[Symbol.iterator]=function(){return this}),T;function M(j){return function($){return V([j,$])}}function V(j){if(A)throw new TypeError("Generator is already executing.");for(;T&&(T=0,j[0]&&(b=0)),b;)try{if(A=1,k&&(G=j[0]&2?k.return:j[0]?k.throw||((G=k.return)&&G.call(k),0):k.next)&&!(G=G.call(k,j[1])).done)return G;switch(k=0,G&&(j=[j[0]&2,G.value]),j[0]){case 0:case 1:G=j;break;case 4:return b.label++,{value:j[1],done:!1};case 5:b.label++,k=j[1],j=[0];continue;case 7:j=b.ops.pop(),b.trys.pop();continue;default:if(G=b.trys,!(G=G.length>0&&G[G.length-1])&&(j[0]===6||j[0]===2)){b=0;continue}if(j[0]===3&&(!G||j[1]>G[0]&&j[1]= length) break;
+ const arr_idx = arr_offset + 4 * p; // i \u8282\u70B9\u7684\u7B2C p \u6761\u8FB9\u5F00\u59CB\u7684\u5C0F\u683C\u5B50\u4F4D\u7F6E
+ const buf_offset = arr_idx - arr_idx / 4 * 4;
+ if (p == 0 || buf_offset == 0) {
+ node_buffer = this.u_Data[int(arr_idx / 4)]; // \u5927\u683C\u5B50\uFF0C\u5927\u683C\u5B50\u4F4D\u7F6E=\u5C0F\u4E2A\u5B50\u4F4D\u7F6E / 4\uFF0C
+ }
+
+ let float_j: float = node_buffer[0];
+
+ const nextNode = this.u_Data[int(float_j)];
+ const vx = nextNode[0] - currentNode[0];
+ const vy = nextNode[1] - currentNode[1];
+ const dist = sqrt(vx * vx + vy * vy) + 0.01;
+ const direx = vx / dist;
+ const direy = vy / dist;
+ const edgeLength = node_buffer[1];
+ const edgeStrength = node_buffer[2];
+ const diff: float = edgeLength - dist;//edgeLength
+ // const param = diff * this.u_stiffness / mass; //
+ const param = diff * edgeStrength / mass; //
+ ax -= direx * param;
+ ay -= direy * param;
+ }
+ return [ax, ay];
+ }
+
+ @main
+ compute() {
+ const i = globalInvocationID.x;
+ const currentNode = this.u_Data[i];
+ const movement = u_AveMovement[0];
+ let ax = 0, ay = 0;
+
+ if (i >= VERTEX_COUNT || movement.x < u_minMovement) {
+ this.u_Data[i] = currentNode;
+ return;
+ }
+
+ // \u6BCF\u4E2A\u8282\u70B9\u5C5E\u6027\u5360\u4E24\u4E2A\u6570\u7EC4\u4E2D\u5404\u4E00\u683C
+ // [mass, degree, nodeStrength, fx]
+ const nodeAttributes1 = this.u_NodeAttributeArray1[i];
+ // [centerX, centerY, centerGravity, fy]
+ const nodeAttributes2 = this.u_NodeAttributeArray2[i];
+
+ // repulsive
+ const repulsive = this.calcRepulsive(i, currentNode);
+ ax += repulsive[0];
+ ay += repulsive[1];
+
+ // attractive
+ const attractive = this.calcAttractive(i, currentNode, nodeAttributes1);
+ ax += attractive[0];
+ ay += attractive[1];
+
+ // gravity
+ const gravity = this.calcGravity(i, currentNode, nodeAttributes2);
+ ax -= gravity[0];
+ ay -= gravity[1];
+
+ // speed
+ const param = this.u_interval * this.u_damping;
+ let vx = ax * param;
+ let vy = ay * param;
+ const vlength = sqrt(vx * vx + vy * vy) + 0.0001;
+ if (vlength > this.u_maxSpeed) {
+ const param2 = this.u_maxSpeed / vlength;
+ vx = param2 * vx;
+ vy = param2 * vy;
+ }
+
+ // move
+ if (nodeAttributes1[3] != 0 && nodeAttributes2[3] != 0) {
+ this.u_Data[i] = [
+ nodeAttributes1[3],
+ nodeAttributes2[3],
+ currentNode[2],
+ 0
+ ];
+ } else {
+ const distx = vx * this.u_interval;
+ const disty = vy * this.u_interval;
+ const distLength = sqrt(distx * distx + disty * disty);
+ this.u_Data[i] = [
+ currentNode[0] + distx,
+ currentNode[1] + disty,
+ currentNode[2],
+ distLength
+ ];
+ }
+
+ // the avarage move distance
+ // need to share memory
+
+ }
+}
+`,X.gForceBundle='{"shaders":{"WGSL":"","GLSL450":"","GLSL100":"\\n\\nfloat epsilon = 0.00001;\\nvec2 addrTranslation_1Dto2D(float address1D, vec2 texSize) {\\n vec2 conv_const = vec2(1.0 / texSize.x, 1.0 / (texSize.x * texSize.y));\\n vec2 normAddr2D = float(address1D) * conv_const;\\n return vec2(fract(normAddr2D.x + epsilon), normAddr2D.y);\\n}\\n\\nvoid barrier() {}\\n \\n\\nuniform vec2 u_OutputTextureSize;\\nuniform int u_OutputTexelCount;\\nvarying vec2 v_TexCoord;\\n\\nbool gWebGPUDebug = false;\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\n\\n#define MAX_EDGE_PER_VERTEX __DefineValuePlaceholder__MAX_EDGE_PER_VERTEX\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\n#define SHIFT_20 1048576.0\\n\\nuniform sampler2D u_Data;\\nuniform vec2 u_DataSize;\\nvec4 getDatau_Data(vec2 address2D) {\\n return vec4(texture2D(u_Data, address2D).rgba);\\n}\\nvec4 getDatau_Data(float address1D) {\\n return getDatau_Data(addrTranslation_1Dto2D(address1D, u_DataSize));\\n}\\nvec4 getDatau_Data(int address1D) {\\n return getDatau_Data(float(address1D));\\n}\\nuniform float u_damping;\\nuniform float u_maxSpeed;\\nuniform float u_minMovement;\\nuniform sampler2D u_AveMovement;\\nuniform vec2 u_AveMovementSize;\\nvec4 getDatau_AveMovement(vec2 address2D) {\\n return vec4(texture2D(u_AveMovement, address2D).rgba);\\n}\\nvec4 getDatau_AveMovement(float address1D) {\\n return getDatau_AveMovement(addrTranslation_1Dto2D(address1D, u_AveMovementSize));\\n}\\nvec4 getDatau_AveMovement(int address1D) {\\n return getDatau_AveMovement(float(address1D));\\n}\\nuniform float u_coulombDisScale;\\nuniform float u_factor;\\nuniform sampler2D u_NodeAttributeArray1;\\nuniform vec2 u_NodeAttributeArray1Size;\\nvec4 getDatau_NodeAttributeArray1(vec2 address2D) {\\n return vec4(texture2D(u_NodeAttributeArray1, address2D).rgba);\\n}\\nvec4 getDatau_NodeAttributeArray1(float address1D) {\\n return getDatau_NodeAttributeArray1(addrTranslation_1Dto2D(address1D, u_NodeAttributeArray1Size));\\n}\\nvec4 getDatau_NodeAttributeArray1(int address1D) {\\n return getDatau_NodeAttributeArray1(float(address1D));\\n}\\nuniform sampler2D u_NodeAttributeArray2;\\nuniform vec2 u_NodeAttributeArray2Size;\\nvec4 getDatau_NodeAttributeArray2(vec2 address2D) {\\n return vec4(texture2D(u_NodeAttributeArray2, address2D).rgba);\\n}\\nvec4 getDatau_NodeAttributeArray2(float address1D) {\\n return getDatau_NodeAttributeArray2(addrTranslation_1Dto2D(address1D, u_NodeAttributeArray2Size));\\n}\\nvec4 getDatau_NodeAttributeArray2(int address1D) {\\n return getDatau_NodeAttributeArray2(float(address1D));\\n}\\nuniform float u_interval;\\nivec2 unpack_float(float packedValue) {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nint packedIntValue = int(packedValue);\\nint v0 = packedIntValue / int(SHIFT_20);\\nreturn ivec2(v0, packedIntValue - (v0 * int(SHIFT_20)));}\\nvec2 calcRepulsive(int i, vec4 currentNode) {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nfloat ax = 0.0;\\nfloat ay = 0.0;\\nfor (int j = 0; j < VERTEX_COUNT; j++) {if (i != j) {vec4 nextNode = getDatau_Data(j);\\nfloat vx = currentNode.x - nextNode.x;\\nfloat vy = currentNode.y - nextNode.y;\\nfloat dist = sqrt((vx * vx) + (vy * vy)) + 0.01;\\nfloat n_dist = (dist + 0.1) * u_coulombDisScale;\\nfloat direx = vx / dist;\\nfloat direy = vy / dist;\\nvec4 attributesi = getDatau_NodeAttributeArray1(i);\\nvec4 attributesj = getDatau_NodeAttributeArray1(j);\\nfloat massi = attributesi.x;\\nfloat nodeStrengthi = attributesi.z;\\nfloat nodeStrengthj = attributesj.z;\\nfloat nodeStrength = (nodeStrengthi + nodeStrengthj) / 2.0;\\nfloat param = (nodeStrength * u_factor) / (n_dist * n_dist);\\nax += direx * param;\\nay += direy * param;}}\\nreturn vec2(ax, ay);}\\nvec2 calcGravity(int i, vec4 currentNode, vec4 attributes2) {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nfloat vx = currentNode.x - attributes2.x;\\nfloat vy = currentNode.y - attributes2.y;\\nfloat ax = vx * attributes2.z;\\nfloat ay = vy * attributes2.z;\\nreturn vec2(ax, ay);}\\nvec2 calcAttractive(int i, vec4 currentNode, vec4 attributes1) {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nfloat mass = attributes1.x;\\nfloat ax = 0.0;\\nfloat ay = 0.0;\\nivec2 compressed = unpack_float(currentNode.z);\\nint length = compressed.x;\\nint arr_offset = compressed.y;\\nvec4 node_buffer;\\nfor (int p = 0; p < MAX_EDGE_PER_VERTEX; p++) {if (p >= length) {break;}\\nint arr_idx = arr_offset + (4 * p);\\nint buf_offset = arr_idx - ((arr_idx / 4) * 4);\\nif ((p == 0) || (buf_offset == 0)) {node_buffer = getDatau_Data(int(arr_idx / 4));}\\nfloat float_j = node_buffer.x;\\nvec4 nextNode = getDatau_Data(int(float_j));\\nfloat vx = nextNode.x - currentNode.x;\\nfloat vy = nextNode.y - currentNode.y;\\nfloat dist = sqrt((vx * vx) + (vy * vy)) + 0.01;\\nfloat direx = vx / dist;\\nfloat direy = vy / dist;\\nfloat edgeLength = node_buffer.y;\\nfloat edgeStrength = node_buffer.z;\\nfloat diff = edgeLength - dist;\\nfloat param = (diff * edgeStrength) / mass;\\nax -= direx * param;\\nay -= direy * param;}\\nreturn vec2(ax, ay);}\\nvoid main() {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nint i = globalInvocationID.x;\\nvec4 currentNode = getDatau_Data(i);\\nvec4 movement = getDatau_AveMovement(0.0);\\nfloat ax = 0.0;\\nfloat ay = 0.0;\\nif ((i >= VERTEX_COUNT) || (movement.x < u_minMovement)) {gl_FragColor = vec4(currentNode);\\nreturn ;}\\nvec4 nodeAttributes1 = getDatau_NodeAttributeArray1(i);\\nvec4 nodeAttributes2 = getDatau_NodeAttributeArray2(i);\\nvec2 repulsive = calcRepulsive(i, currentNode);\\nax += repulsive.x;\\nay += repulsive.y;\\nvec2 attractive = calcAttractive(i, currentNode, nodeAttributes1);\\nax += attractive.x;\\nay += attractive.y;\\nvec2 gravity = calcGravity(i, currentNode, nodeAttributes2);\\nax -= gravity.x;\\nay -= gravity.y;\\nfloat param = u_interval * u_damping;\\nfloat vx = ax * param;\\nfloat vy = ay * param;\\nfloat vlength = sqrt((vx * vx) + (vy * vy)) + 0.0001;\\nif (vlength > u_maxSpeed) {float param2 = u_maxSpeed / vlength;\\nvx = param2 * vx;\\nvy = param2 * vy;}\\nif ((nodeAttributes1.w != 0.0) && (nodeAttributes2.w != 0.0)) {gl_FragColor = vec4(vec4(nodeAttributes1.w, nodeAttributes2.w, currentNode.z, 0.0));}else {float distx = vx * u_interval;\\nfloat disty = vy * u_interval;\\nfloat distLength = sqrt((distx * distx) + (disty * disty));\\ngl_FragColor = vec4(vec4(currentNode.x + distx, currentNode.y + disty, currentNode.z, distLength));}if (gWebGPUDebug) {\\n gl_FragColor = gWebGPUDebugOutput;\\n}}\\n"},"context":{"name":"","dispatch":[1,1,1],"threadGroupSize":[1,1,1],"maxIteration":1,"defines":[{"name":"MAX_EDGE_PER_VERTEX","type":"Float","runtime":true},{"name":"VERTEX_COUNT","type":"Float","runtime":true},{"name":"SHIFT_20","type":"Float","value":1048576,"runtime":false}],"uniforms":[{"name":"u_Data","type":"vec4[]","storageClass":"StorageBuffer","readonly":false,"writeonly":false,"size":[1,1]},{"name":"u_damping","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_maxSpeed","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_minMovement","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_AveMovement","type":"vec4[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_coulombDisScale","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_factor","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_NodeAttributeArray1","type":"vec4[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_NodeAttributeArray2","type":"vec4[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_interval","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]}],"globalDeclarations":[],"output":{"name":"u_Data","size":[1,1],"length":1},"needPingpong":true}}',X.aveMovementCode=`
+const VERTEX_COUNT;
+@numthreads(1, 1, 1)
+class CalcAveMovement {
+ @in
+ u_Data: vec4[];
+ @in
+ u_iter: float;
+ @in @out
+ u_AveMovement: vec4[];
+ @main
+ compute() {
+ let movement = 0;
+ for (let j: int = 0; j < VERTEX_COUNT; j++) {
+ const vertex = this.u_Data[j];
+ movement += vertex[3];
+ }
+ movement = movement / float(VERTEX_COUNT);
+ this.u_AveMovement[0] = [movement, 0, 0, 0];
+ }
+}
+`,X.aveMovementBundle='{"shaders":{"WGSL":"","GLSL450":"","GLSL100":"\\n\\nfloat epsilon = 0.00001;\\nvec2 addrTranslation_1Dto2D(float address1D, vec2 texSize) {\\n vec2 conv_const = vec2(1.0 / texSize.x, 1.0 / (texSize.x * texSize.y));\\n vec2 normAddr2D = float(address1D) * conv_const;\\n return vec2(fract(normAddr2D.x + epsilon), normAddr2D.y);\\n}\\n\\nvoid barrier() {}\\n \\n\\nuniform vec2 u_OutputTextureSize;\\nuniform int u_OutputTexelCount;\\nvarying vec2 v_TexCoord;\\n\\nbool gWebGPUDebug = false;\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\n\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\n\\nuniform sampler2D u_Data;\\nuniform vec2 u_DataSize;\\nvec4 getDatau_Data(vec2 address2D) {\\n return vec4(texture2D(u_Data, address2D).rgba);\\n}\\nvec4 getDatau_Data(float address1D) {\\n return getDatau_Data(addrTranslation_1Dto2D(address1D, u_DataSize));\\n}\\nvec4 getDatau_Data(int address1D) {\\n return getDatau_Data(float(address1D));\\n}\\nuniform float u_iter;\\nuniform sampler2D u_AveMovement;\\nuniform vec2 u_AveMovementSize;\\nvec4 getDatau_AveMovement(vec2 address2D) {\\n return vec4(texture2D(u_AveMovement, address2D).rgba);\\n}\\nvec4 getDatau_AveMovement(float address1D) {\\n return getDatau_AveMovement(addrTranslation_1Dto2D(address1D, u_AveMovementSize));\\n}\\nvec4 getDatau_AveMovement(int address1D) {\\n return getDatau_AveMovement(float(address1D));\\n}\\nvoid main() {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nfloat movement = 0.0;\\nfor (int j = 0; j < VERTEX_COUNT; j++) {vec4 vertex = getDatau_Data(j);\\nmovement += vertex.w;}\\nmovement = movement / float(VERTEX_COUNT);\\ngl_FragColor = vec4(vec4(movement, 0.0, 0.0, 0.0));if (gWebGPUDebug) {\\n gl_FragColor = gWebGPUDebugOutput;\\n}}\\n"},"context":{"name":"","dispatch":[1,1,1],"threadGroupSize":[1,1,1],"maxIteration":1,"defines":[{"name":"VERTEX_COUNT","type":"Float","runtime":true}],"uniforms":[{"name":"u_Data","type":"vec4[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_iter","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_AveMovement","type":"vec4[]","storageClass":"StorageBuffer","readonly":false,"writeonly":false,"size":[1,1]}],"globalDeclarations":[],"output":{"name":"u_AveMovement","size":[1,1],"length":1},"needPingpong":true}}'},74294:function(hr,X,W){"use strict";var U=this&&this.__extends||function(){var P=function(N,y){return P=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(E,g){E.__proto__=g}||function(E,g){for(var p in g)Object.prototype.hasOwnProperty.call(g,p)&&(E[p]=g[p])},P(N,y)};return function(N,y){if(typeof y!="function"&&y!==null)throw new TypeError("Class extends value "+String(y)+" is not a constructor or null");P(N,y);function E(){this.constructor=N}N.prototype=y===null?Object.create(y):(E.prototype=y.prototype,new E)}}();Object.defineProperty(X,"__esModule",{value:!0}),X.GridLayout=void 0;var Y=W(8273),B=W(46253),D=function(P){U(N,P);function N(y){var E=P.call(this)||this;return E.begin=[0,0],E.preventOverlap=!0,E.preventOverlapPadding=10,E.condense=!1,E.sortBy="degree",E.nodes=[],E.edges=[],E.width=300,E.height=300,E.row=0,E.col=0,E.cellWidth=0,E.cellHeight=0,E.cellUsed={},E.id2manPos={},E.onLayoutEnd=function(){},E.updateCfg(y),E}return N.prototype.getDefaultCfg=function(){return{begin:[0,0],preventOverlap:!0,preventOverlapPadding:10,condense:!1,rows:void 0,cols:void 0,position:void 0,sortBy:"degree",nodeSize:30}},N.prototype.execute=function(){var y=this,E=y.nodes,g=y.edges,p=y.begin,h=E.length;if(h===0)return y.onLayoutEnd&&y.onLayoutEnd(),{nodes:E,edges:g};if(h===1)return E[0].x=p[0],E[0].y=p[1],y.onLayoutEnd&&y.onLayoutEnd(),{nodes:E,edges:g};var x=y.sortBy,m=y.width,b=y.height,A=y.condense,k=y.preventOverlapPadding,G=y.preventOverlap,T=y.nodeSpacing,M=y.nodeSize,V=[];E.forEach(function(ve){V.push(ve)});var j={};if(V.forEach(function(ve,be){j[ve.id]=be}),(x==="degree"||!(0,Y.isString)(x)||V[0][x]===void 0)&&(x="degree",(0,Y.isNaN)(E[0].degree))){var $=(0,Y.getDegree)(V.length,j,g);V.forEach(function(ve,be){ve.degree=$[be].all})}V.sort(function(ve,be){return be[x]-ve[x]}),!m&&typeof window!="undefined"&&(m=window.innerWidth),!b&&typeof window!="undefined"&&(b=window.innerHeight);var q=y.rows,te=y.cols!=null?y.cols:y.columns;if(y.cells=h,q!=null&&te!=null?(y.rows=q,y.cols=te):q!=null&&te==null?(y.rows=q,y.cols=Math.ceil(y.cells/y.rows)):q==null&&te!=null?(y.cols=te,y.rows=Math.ceil(y.cells/y.cols)):(y.splits=Math.sqrt(y.cells*y.height/y.width),y.rows=Math.round(y.splits),y.cols=Math.round(y.width/y.height*y.splits)),y.rows=Math.max(y.rows,1),y.cols=Math.max(y.cols,1),y.cols*y.rows>y.cells){var ee=y.small(),ie=y.large();(ee-1)*ie>=y.cells?y.small(ee-1):(ie-1)*ee>=y.cells&&y.large(ie-1)}else for(;y.cols*y.rows=y.cells?y.large(ie+1):y.small(ee+1)}if(y.cellWidth=m/y.cols,y.cellHeight=b/y.rows,A&&(y.cellWidth=0,y.cellHeight=0),G||T){var ce=(0,Y.getFuncByUnknownType)(10,T),ge=(0,Y.getFuncByUnknownType)(30,M,!1);V.forEach(function(ve){(!ve.x||!ve.y)&&(ve.x=0,ve.y=0);var be=ge(ve)||30,Ae,Pe;(0,Y.isArray)(be)?(Ae=be[0],Pe=be[1]):(Ae=be,Pe=be);var Ve=ce!==void 0?ce(ve):k,Ue=Ae+Ve,Ke=Pe+Ve;y.cellWidth=Math.max(y.cellWidth,Ue),y.cellHeight=Math.max(y.cellHeight,Ke)})}y.cellUsed={},y.row=0,y.col=0,y.id2manPos={};for(var Le=0;Le=E&&(y.col=0,y.row++)},N.prototype.getPos=function(y){var E=this,g=E.begin,p=E.cellWidth,h=E.cellHeight,x,m,b=E.id2manPos[y.id];if(b)x=b.col*p+p/2+g[0],m=b.row*h+h/2+g[1];else{for(;E.used(E.row,E.col);)E.moveToNextCell();x=E.col*p+p/2+g[0],m=E.row*h+h/2+g[1],E.use(E.row,E.col),E.moveToNextCell()}y.x=x,y.y=m},N.prototype.getType=function(){return"grid"},N}(B.Base);X.GridLayout=D},64649:function(hr,X,W){"use strict";var U=this&&this.__createBinding||(Object.create?function($,q,te,ee){ee===void 0&&(ee=te);var ie=Object.getOwnPropertyDescriptor(q,te);(!ie||("get"in ie?!q.__esModule:ie.writable||ie.configurable))&&(ie={enumerable:!0,get:function(){return q[te]}}),Object.defineProperty($,ee,ie)}:function($,q,te,ee){ee===void 0&&(ee=te),$[ee]=q[te]}),Y=this&&this.__exportStar||function($,q){for(var te in $)te!=="default"&&!Object.prototype.hasOwnProperty.call(q,te)&&U(q,$,te)};Object.defineProperty(X,"__esModule",{value:!0}),X.ERLayout=X.ForceAtlas2Layout=X.ComboCombinedLayout=X.ComboForceLayout=X.GForceGPULayout=X.FruchtermanGPULayout=X.FruchtermanLayout=X.MDSLayout=X.ConcentricLayout=X.RadialLayout=X.DagreCompoundLayout=X.DagreLayout=X.CircularLayout=X.ForceLayout=X.Force2Layout=X.GForceLayout=X.RandomLayout=X.GridLayout=X.Layouts=X.Layout=void 0;var B=W(74294);Object.defineProperty(X,"GridLayout",{enumerable:!0,get:function(){return B.GridLayout}});var D=W(26729);Object.defineProperty(X,"RandomLayout",{enumerable:!0,get:function(){return D.RandomLayout}});var P=W(46260);Object.defineProperty(X,"GForceLayout",{enumerable:!0,get:function(){return P.GForceLayout}});var N=W(38129);Object.defineProperty(X,"Force2Layout",{enumerable:!0,get:function(){return N.Force2Layout}});var y=W(64180);Object.defineProperty(X,"ForceLayout",{enumerable:!0,get:function(){return y.ForceLayout}});var E=W(93959);Object.defineProperty(X,"CircularLayout",{enumerable:!0,get:function(){return E.CircularLayout}});var g=W(2);Object.defineProperty(X,"DagreLayout",{enumerable:!0,get:function(){return g.DagreLayout}});var p=W(77620);Object.defineProperty(X,"DagreCompoundLayout",{enumerable:!0,get:function(){return p.DagreCompoundLayout}});var h=W(90106);Object.defineProperty(X,"RadialLayout",{enumerable:!0,get:function(){return h.RadialLayout}});var x=W(98162);Object.defineProperty(X,"ConcentricLayout",{enumerable:!0,get:function(){return x.ConcentricLayout}});var m=W(98204);Object.defineProperty(X,"MDSLayout",{enumerable:!0,get:function(){return m.MDSLayout}});var b=W(23826);Object.defineProperty(X,"FruchtermanLayout",{enumerable:!0,get:function(){return b.FruchtermanLayout}});var A=W(81822);Object.defineProperty(X,"FruchtermanGPULayout",{enumerable:!0,get:function(){return A.FruchtermanGPULayout}});var k=W(86043);Object.defineProperty(X,"GForceGPULayout",{enumerable:!0,get:function(){return k.GForceGPULayout}});var G=W(48133);Object.defineProperty(X,"ComboForceLayout",{enumerable:!0,get:function(){return G.ComboForceLayout}});var T=W(6412);Object.defineProperty(X,"ComboCombinedLayout",{enumerable:!0,get:function(){return T.ComboCombinedLayout}});var M=W(16919);Object.defineProperty(X,"ForceAtlas2Layout",{enumerable:!0,get:function(){return M.ForceAtlas2Layout}});var V=W(40311);Object.defineProperty(X,"ERLayout",{enumerable:!0,get:function(){return V.ERLayout}});var j=W(99745);Object.defineProperty(X,"Layout",{enumerable:!0,get:function(){return j.Layout}}),Object.defineProperty(X,"Layouts",{enumerable:!0,get:function(){return j.Layouts}}),Y(W(2230),X)},99745:function(hr,X,W){"use strict";Object.defineProperty(X,"__esModule",{value:!0}),X.Layouts=X.Layout=void 0;var U=W(39464),Y=W(74294),B=W(26729),D=W(38129),P=W(46260),N=W(64180),y=W(93959),E=W(2),g=W(90106),p=W(98162),h=W(98204),x=W(23826),m=W(81822),b=W(86043),A=W(48133),k=W(6412),G=W(16919),T=W(40311),M=W(77620),V=W(8273),j=function(){function $(q){var te=(0,U.getLayoutByName)(q.type);this.layoutInstance=new te(q)}return $.prototype.layout=function(q){return this.layoutInstance.layout(q)},$.prototype.updateCfg=function(q){this.layoutInstance.updateCfg(q)},$.prototype.init=function(q){this.correctLayers(q.nodes),this.layoutInstance.init(q)},$.prototype.correctLayers=function(q){if(!!(q==null?void 0:q.length)){var te=Infinity,ee=[];if(q.forEach(function(ce){(0,V.isString)(ce.layer)&&(ce.layer=parseInt(ce.layer,10)),!(ce.layer===void 0||isNaN(ce.layer))&&(ee.push(ce),ce.layerk[0]?k[0]:ie-k[0],Le=ce-k[1]>k[1]?k[1]:ce-k[1];ge===0&&(ge=ie/2),Le===0&&(Le=ce/2);var Oe=Le>ge?ge:Le,Re=Math.max.apply(Math,ee),de=[];ee.forEach(function(dt,Et){m.unitRadius||(m.unitRadius=Oe/Re),de[Et]=dt*m.unitRadius}),m.radii=de;var ve=m.eIdealDisMatrix();m.eIdealDistances=ve;var be=y(ve);m.weights=be;var Ae=new P.default({linkDistance:G,distances:ve}),Pe=Ae.layout();Pe.forEach(function(dt){(0,B.isNaN)(dt[0])&&(dt[0]=Math.random()*G),(0,B.isNaN)(dt[1])&&(dt[1]=Math.random()*G)}),m.positions=Pe,Pe.forEach(function(dt,Et){b[Et].x=dt[0]+k[0],b[Et].y=dt[1]+k[1]}),Pe.forEach(function(dt){dt[0]-=Pe[j][0],dt[1]-=Pe[j][1]}),m.run();var Ve=m.preventOverlap,Ue=m.nodeSize,Ke,_t=m.strictRadial;if(Ve){var Ct=m.nodeSpacing,He;(0,B.isNumber)(Ct)?He=function(){return Ct}:(0,B.isFunction)(Ct)?He=Ct:He=function(){return 0},Ue?(0,B.isArray)(Ue)?Ke=function(dt){var Et=Ue[0]>Ue[1]?Ue[0]:Ue[1];return Et+He(dt)}:Ke=function(dt){return Ue+He(dt)}:Ke=function(dt){if(dt.size){if((0,B.isArray)(dt.size)){var Et=dt.size[0]>dt.size[1]?dt.size[0]:dt.size[1];return Et+He(dt)}if((0,B.isObject)(dt.size)){var Et=dt.size.width>dt.size.height?dt.size.width:dt.size.height;return Et+He(dt)}return dt.size+He(dt)}return 10+He(dt)};var ht={nodes:b,nodeSizeFunc:Ke,adjMatrix:$,positions:Pe,radii:de,height:ce,width:ie,strictRadial:_t,focusID:j,iterations:m.maxPreventOverlapIteration||200,k:Pe.length/4.5},mt=new N.default(ht);Pe=mt.layout()}return Pe.forEach(function(dt,Et){b[Et].x=dt[0]+k[0],b[Et].y=dt[1]+k[1]}),m.onLayoutEnd&&m.onLayoutEnd(),{nodes:b,edges:A}},x.prototype.run=function(){for(var m=this,b=m.maxIteration,A=m.positions||[],k=m.weights||[],G=m.eIdealDistances||[],T=m.radii||[],M=0;M<=b;M++){var V=M/b;m.oneIteration(V,A,T,G,k)}},x.prototype.oneIteration=function(m,b,A,k,G){var T=this,M=1-m,V=T.focusIndex;b.forEach(function(j,$){var q=g(j,[0,0]),te=q===0?0:1/q;if($!==V){var ee=0,ie=0,ce=0;b.forEach(function(Le,Oe){if($!==Oe){var Re=g(j,Le),de=Re===0?0:1/Re,ve=k[Oe][$];ce+=G[$][Oe],ee+=G[$][Oe]*(Le[0]+ve*(j[0]-Le[0])*de),ie+=G[$][Oe]*(Le[1]+ve*(j[1]-Le[1])*de)}});var ge=A[$]===0?0:1/A[$];ce*=M,ce+=m*ge*ge,ee*=M,ee+=m*ge*j[0]*te,j[0]=ee/ce,ie*=M,ie+=m*ge*j[1]*te,j[1]=ie/ce}})},x.prototype.eIdealDisMatrix=function(){var m=this,b=m.nodes;if(!b)return[];var A=m.distances,k=m.linkDistance,G=m.radii||[],T=m.unitRadius||50,M=[];return A&&A.forEach(function(V,j){var $=[];V.forEach(function(q,te){if(j===te)$.push(0);else if(G[j]===G[te])if(m.sortBy==="data")$.push(q*(Math.abs(j-te)*m.sortStrength)/(G[j]/T));else if(m.sortBy){var ee=b[j][m.sortBy]||0,ie=b[te][m.sortBy]||0;(0,B.isString)(ee)&&(ee=ee.charCodeAt(0)),(0,B.isString)(ie)&&(ie=ie.charCodeAt(0)),$.push(q*(Math.abs(ee-ie)*m.sortStrength)/(G[j]/T))}else $.push(q*k/(G[j]/T));else{var ce=(k+T)/2;$.push(q*ce)}}),M.push($)}),M},x.prototype.handleInfinity=function(m,b,A){for(var k=m.length,G=0;GA?m[b][k]:A);return A},x.prototype.getType=function(){return"radial"},x}(D.Base);X.RadialLayout=p},78614:function(hr,X){"use strict";Object.defineProperty(X,"__esModule",{value:!0});var W=800,U=function(){function Y(B){this.disp=[],this.positions=B.positions,this.adjMatrix=B.adjMatrix,this.focusID=B.focusID,this.radii=B.radii,this.iterations=B.iterations||10,this.height=B.height||10,this.width=B.width||10,this.speed=B.speed||100,this.gravity=B.gravity||10,this.nodeSizeFunc=B.nodeSizeFunc,this.k=B.k||5,this.strictRadial=B.strictRadial,this.nodes=B.nodes}return Y.prototype.layout=function(){var B=this,D=B.positions,P=[],N=B.iterations,y=B.width/10;B.maxDisplace=y,B.disp=P;for(var E=0;Ex?1:-1;m=.01*k,b=.01*k}if(AMath.PI/2&&(M-=Math.PI/2,k*=-1,G*=-1);var V=Math.cos(M)*T;h.x=k*V,h.y=G*V});var p=B.radii;D.forEach(function(h,x){if(x!==E){var m=Math.sqrt(P[x].x*P[x].x+P[x].y*P[x].y);if(m>0&&x!==E){var b=Math.min(g*(N/W),m);if(h[0]+=P[x].x/m*b,h[1]+=P[x].y/m*b,y){var A=h[0]-D[E][0],k=h[1]-D[E][1],G=Math.sqrt(A*A+k*k);A=A/G*p[x],k=k/G*p[x],h[0]=D[E][0]+A,h[1]=D[E][1]+k}}}})},Y}();X.default=U},26729:function(hr,X,W){"use strict";var U=this&&this.__extends||function(){var D=function(P,N){return D=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(y,E){y.__proto__=E}||function(y,E){for(var g in E)Object.prototype.hasOwnProperty.call(E,g)&&(y[g]=E[g])},D(P,N)};return function(P,N){if(typeof N!="function"&&N!==null)throw new TypeError("Class extends value "+String(N)+" is not a constructor or null");D(P,N);function y(){this.constructor=P}P.prototype=N===null?Object.create(N):(y.prototype=N.prototype,new y)}}();Object.defineProperty(X,"__esModule",{value:!0}),X.RandomLayout=void 0;var Y=W(46253),B=function(D){U(P,D);function P(N){var y=D.call(this)||this;return y.center=[0,0],y.width=300,y.height=300,y.nodes=[],y.edges=[],y.onLayoutEnd=function(){},y.updateCfg(N),y}return P.prototype.getDefaultCfg=function(){return{center:[0,0],width:300,height:300}},P.prototype.execute=function(){var N=this,y=N.nodes,E=.9,g=N.center;return!N.width&&typeof window!="undefined"&&(N.width=window.innerWidth),!N.height&&typeof window!="undefined"&&(N.height=window.innerHeight),y&&y.forEach(function(p){p.x=(Math.random()-.5)*E*N.width+g[0],p.y=(Math.random()-.5)*E*N.height+g[1]}),N.onLayoutEnd&&N.onLayoutEnd(),{nodes:y,edges:this.edges}},P.prototype.getType=function(){return"random"},P}(Y.Base);X.RandomLayout=B},2230:function(hr,X){"use strict";Object.defineProperty(X,"__esModule",{value:!0})},39464:function(hr,X,W){"use strict";var U=this&&this.__extends||function(){var E=function(g,p){return E=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,x){h.__proto__=x}||function(h,x){for(var m in x)Object.prototype.hasOwnProperty.call(x,m)&&(h[m]=x[m])},E(g,p)};return function(g,p){if(typeof p!="function"&&p!==null)throw new TypeError("Class extends value "+String(p)+" is not a constructor or null");E(g,p);function h(){this.constructor=g}g.prototype=p===null?Object.create(p):(h.prototype=p.prototype,new h)}}();Object.defineProperty(X,"__esModule",{value:!0}),X.getLayoutByName=X.unRegisterLayout=X.registerLayout=void 0;var Y=W(46253),B=W(8273),D=new Map,P=function(E,g){if(D.get(E)&&console.warn("The layout with the name ".concat(E," exists already, it will be overridden")),(0,B.isObject)(g)){var p=function(h){U(x,h);function x(m){var b=this,A;b=h.call(this)||this;var k=b,G={},T=Object.assign({},k.getDefaultCfg(),((A=g.getDefaultCfg)===null||A===void 0?void 0:A.call(g))||{});return Object.assign(G,T,g,m),Object.keys(G).forEach(function(M){var V=G[M];k[M]=V}),b}return x}(Y.Base);D.set(E,p)}else D.set(E,g);return D.get(E)};X.registerLayout=P;var N=function(E){D.has(E)&&D.delete(E)};X.unRegisterLayout=N;var y=function(E){return D.has(E)?D.get(E):null};X.getLayoutByName=y},92272:function(hr,X){"use strict";Object.defineProperty(X,"__esModule",{value:!0}),X.isArray=void 0,X.isArray=Array.isArray},72612:function(hr,X,W){"use strict";Object.defineProperty(X,"__esModule",{value:!0}),X.getFuncByUnknownType=X.getFunc=X.isFunction=void 0;var U=W(8273),Y=W(5049),B=function(N){return typeof N=="function"};X.isFunction=B;var D=function(N,y,E){var g;return E?g=E:(0,Y.isNumber)(N)?g=function(){return N}:g=function(){return y},g};X.getFunc=D;var P=function(N,y,E){return E===void 0&&(E=!0),!y&&y!==0?function(g){return g.size?(0,U.isArray)(g.size)?g.size[0]>g.size[1]?g.size[0]:g.size[1]:(0,U.isObject)(g.size)?g.size.width>g.size.height?g.size.width:g.size.height:g.size:N}:(0,X.isFunction)(y)?y:(0,Y.isNumber)(y)?function(){return y}:(0,U.isArray)(y)?function(){if(E){var g=Math.max.apply(Math,y);return isNaN(g)?N:g}return y}:(0,U.isObject)(y)?function(){if(E){var g=Math.max(y.width,y.height);return isNaN(g)?N:g}return[y.width,y.height]}:function(){return N}};X.getFuncByUnknownType=P},38342:function(hr,X,W){"use strict";Object.defineProperty(X,"__esModule",{value:!0}),X.arrayToTextureData=X.attributesToTextureData=X.buildTextureDataWithTwoEdgeAttr=X.buildTextureData=X.proccessToFunc=void 0;var U=W(8273),Y=W(64446),B=function(E,g){var p;return E?(0,U.isNumber)(E)?p=function(){return E}:p=E:p=function(){return g||1},p};X.proccessToFunc=B;var D=function(E,g){var p=[],h=[],x={},m=0;for(m=0;mM[j][q]+M[q][$]&&(M[j][$]=M[j][q]+M[q][$]);return M};X.floydWarshall=y;var E=function(T,M){var V=T.nodes,j=T.edges,$=[],q={};if(!V)throw new Error("invalid nodes data!");return V&&V.forEach(function(te,ee){q[te.id]=ee;var ie=[];$.push(ie)}),j==null||j.forEach(function(te){var ee=(0,X.getEdgeTerminal)(te,"source"),ie=(0,X.getEdgeTerminal)(te,"target"),ce=q[ee],ge=q[ie];ce===void 0||ge===void 0||($[ce][ge]=1,M||($[ge][ce]=1))}),$};X.getAdjMatrix=E;var g=function(T,M){var V=[];return T.forEach(function(j){var $=[];j.forEach(function(q){$.push(q*M)}),V.push($)}),V};X.scaleMatrix=g;var p=function(T,M){if(T&&T.children){for(var V=T.children.length-1;V>=0;V--)if(!p(T.children[V],M))return}return!!M(T)},h=function(T,M){typeof M=="function"&&p(T,M)};X.traverseTreeUp=h;var x=function(T){var M=Infinity,V=Infinity,j=-Infinity,$=-Infinity;return T.forEach(function(q){var te=q.size;(0,U.isArray)(te)?te.length===1&&(te=[te[0],te[0]]):(0,Y.isNumber)(te)?te=[te,te]:(te===void 0||isNaN(te))&&(te=[30,30]);var ee=[te[0]/2,te[1]/2],ie=q.x-ee[0],ce=q.x+ee[0],ge=q.y-ee[1],Le=q.y+ee[1];M>ie&&(M=ie),V>ge&&(V=ge),j1?1:Number(pe),Ge=ne.length-1,qe=Math.floor(Ge*Me),Lt=Ge*Me-qe,Pt=ne[qe],sr=qe===Ge?Pt:ne[qe+1];return B([E(Pt,sr,Lt,0),E(Pt,sr,Lt,1),E(Pt,sr,Lt,2)])}function p(ne){var pe=typeof ne=="string"?ne.split("-"):ne,Me=pe.map(function(Ge){return U(Ge.indexOf("#")===-1?y(Ge):Ge)});return function(Ge){return g(Me,Ge)}}var h=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,x=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,m=/[\d.]+:(#[^\s]+|[^)]+\))/gi;function b(ne){return/^[r,R,L,l]{1}[\s]*\(/.test(ne)}function A(ne){if(b(ne)){var pe,Me=void 0;if(ne[0]==="l"){var Ge=h.exec(ne),qe=+Ge[1]+90;Me=Ge[2],pe="linear-gradient("+qe+"deg, "}else if(ne[0]==="r"){pe="radial-gradient(";var Ge=x.exec(ne);Me=Ge[4]}var Lt=Me.match(m);return Lt.forEach(function(Pt,sr){var Ir=Pt.split(":");pe+=Ir[1]+" "+Number(Ir[0])*100+"%",sr!==Lt.length-1&&(pe+=", ")}),pe+=")",pe}return ne}var k=W(35600),G=W(31437);function T(ne,pe,Me){var Ge=[0,0,0,0,0,0,0,0,0];return k.fromTranslation(Ge,Me),k.multiply(ne,Ge,pe)}function M(ne,pe,Me){var Ge=[0,0,0,0,0,0,0,0,0];return k.fromRotation(Ge,Me),k.multiply(ne,Ge,pe)}function V(ne,pe,Me){var Ge=[0,0,0,0,0,0,0,0,0];return k.fromScaling(Ge,Me),k.multiply(ne,Ge,pe)}function j(ne,pe,Me){return k.multiply(ne,Me,pe)}function $(ne,pe){for(var Me=ne?[].concat(ne):[1,0,0,0,1,0,0,0,1],Ge=0,qe=pe.length;Ge=0;return Me?qe?Math.PI*2-Ge:Ge:qe?Ge:Math.PI*2-Ge}function ee(ne,pe,Me){return Me?(ne[0]=pe[1],ne[1]=-1*pe[0]):(ne[0]=-1*pe[1],ne[1]=pe[0]),ne}function ie(ne){return ne.map(function(pe){return Array.isArray(pe)?[].concat(pe):pe})}function ce(ne,pe){if(pe==="off")return ie(ne);var Me=typeof pe=="number"&&pe>=1?Math.pow(10,pe):1;return ne.map(function(Ge){var qe=Ge.slice(1).map(Number).map(function(Lt){return pe?Math.round(Lt*Me)/Me:Math.round(Lt)});return[Ge[0]].concat(qe)})}function ge(ne,pe){return pe===void 0&&(pe="off"),ce(ne,pe).map(function(Me){return Me[0]+Me.slice(1).join(" ")}).join("")}var Le=W(65353),Oe={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null};function Re(ne,pe,Me){if(ne[Me].length>7){ne[Me].shift();for(var Ge=ne[Me],qe=Me;Ge.length;)pe[Me]="A",ne.splice(qe+=1,0,["C"].concat(Ge.splice(0,6)));ne.splice(Me,1)}}var de={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function ve(ne){return Array.isArray(ne)&&ne.every(function(pe){var Me=pe[0].toLowerCase();return de[Me]===pe.length-1&&"achlmqstvz".includes(Me)})}function be(ne){return ve(ne)&&ne.every(function(pe){var Me=pe[0];return Me===Me.toUpperCase()})}function Ae(ne){return be(ne)&&ne.every(function(pe){var Me=pe[0];return"ACLMQZ".includes(Me)})}function Pe(ne){for(var pe=ne.pathValue[ne.segmentStart],Me=pe.toLowerCase(),Ge=ne.data;Ge.length>=de[Me]&&(Me==="m"&&Ge.length>2?(ne.segments.push([pe].concat(Ge.splice(0,2))),Me="l",pe=pe==="m"?"l":"L"):ne.segments.push([pe].concat(Ge.splice(0,de[Me]))),!!de[Me]););}function Ve(ne){var pe=ne.index,Me=ne.pathValue,Ge=Me.charCodeAt(pe);if(Ge===48){ne.param=0,ne.index+=1;return}if(Ge===49){ne.param=1,ne.index+=1;return}ne.err='[path-util]: invalid Arc flag "'+Me[pe]+'", expecting 0 or 1 at index '+pe}function Ue(ne){return ne>=48&&ne<=57||ne===43||ne===45||ne===46}function Ke(ne){return ne>=48&&ne<=57}function _t(ne){var pe=ne.max,Me=ne.pathValue,Ge=ne.index,qe=Ge,Lt=!1,Pt=!1,sr=!1,Ir=!1,Ar;if(qe>=pe){ne.err="[path-util]: Invalid path value at index "+qe+', "pathValue" is missing param';return}if(Ar=Me.charCodeAt(qe),(Ar===43||Ar===45)&&(qe+=1,Ar=Me.charCodeAt(qe)),!Ke(Ar)&&Ar!==46){ne.err="[path-util]: Invalid path value at index "+qe+', "'+Me[qe]+'" is not a number';return}if(Ar!==46){if(Lt=Ar===48,qe+=1,Ar=Me.charCodeAt(qe),Lt&&qe=5760&&pe.includes(ne)}function He(ne){for(var pe=ne.pathValue,Me=ne.max;ne.index0;Pt-=1){if(mt(qe)&&(Pt===3||Pt===4)?Ve(ne):_t(ne),ne.err.length)return;ne.data.push(ne.param),He(ne),ne.index=ne.max||!Ue(Me.charCodeAt(ne.index)))break}Pe(ne)}var Et=function(){function ne(pe){this.pathValue=pe,this.segments=[],this.max=pe.length,this.index=0,this.param=0,this.segmentStart=0,this.data=[],this.err=""}return ne}();function it(ne){if(ve(ne))return ie(ne);var pe=new Et(ne);for(He(pe);pe.index1&&(Ba=Math.sqrt(Ba),Qr*=Ba,Xn*=Ba);var fi=Qr*Qr,Di=Xn*Xn,Ni=(Lt===Pt?-1:1)*Math.sqrt(Math.abs((fi*Di-fi*Ya*Ya-Di*ui*ui)/(fi*Ya*Ya+Di*ui*ui)));ga=Ni*Qr*Ya/Xn+($r+ha)/2,ka=Ni*-Xn*ui/Qr+(sn+Yn)/2,Hn=Math.asin(((sn-ka)/Xn*Math.pow(10,9)>>0)/Math.pow(10,9)),Cn=Math.asin(((Yn-ka)/Xn*Math.pow(10,9)>>0)/Math.pow(10,9)),Hn=$rCn&&(Hn-=Math.PI*2),!Pt&&Cn>Hn&&(Cn-=Math.PI*2)}var Es=Cn-Hn;if(Math.abs(Es)>Rn){var Wf=Cn,bs=ha,vf=Yn;Cn=Hn+Rn*(Pt&&Cn>Hn?1:-1),ha=ga+Qr*Math.cos(Cn),Yn=ka+Xn*Math.sin(Cn),wn=nn(ha,Yn,Qr,Xn,qe,0,Pt,bs,vf,[Cn,Wf,ga,ka])}Es=Cn-Hn;var su=Math.cos(Hn),xs=Math.sin(Hn),Zu=Math.cos(Cn),lc=Math.sin(Cn),Ku=Math.tan(Es/4),$u=4/3*Qr*Ku,hf=4/3*Xn*Ku,Ls=[$r,sn],uu=[$r+$u*xs,sn-hf*su],Qu=[ha+$u*lc,Yn-hf*Zu],Iu=[ha,Yn];if(uu[0]=2*Ls[0]-uu[0],uu[1]=2*Ls[1]-uu[1],Ar)return uu.concat(Qu,Iu,wn);wn=uu.concat(Qu,Iu,wn);for(var gf=[],ws=0,fu=wn.length;ws=Lt)Pt={x:Me,y:Ge};else{var sr=bn([ne,pe],[Me,Ge],qe/Lt),Ir=sr[0],Ar=sr[1];Pt={x:Ir,y:Ar}}return{length:Lt,point:Pt,min:{x:Math.min(ne,Me),y:Math.min(pe,Ge)},max:{x:Math.max(ne,Me),y:Math.max(pe,Ge)}}}function kn(ne,pe,Me,Ge){var qe=.5,Lt=[ne,pe],Pt=[Me,Ge],sr=bn(Lt,Pt,qe),Ir=bn(Pt,sr,qe),Ar=bn(sr,Ir,qe),$r=bn(Ir,Ar,qe),sn=bn(Ar,$r,qe),Qr=zn(Lt[0],Lt[1],sr[0],sr[1],Ar[0]).point,Xn=zn(sn[0],sn[1],$r[0],$r[1],Ir[0]).point;return[Qr.x,Qr.y,Xn.x,Xn.y,Me,Ge]}function aa(ne,pe){var Me=ne[0],Ge=ne.slice(1).map(Number),qe=Ge[0],Lt=Ge[1],Pt,sr=pe.x1,Ir=pe.y1,Ar=pe.x,$r=pe.y;switch("TQ".includes(Me)||(pe.qx=null,pe.qy=null),Me){case"M":return pe.x=qe,pe.y=Lt,ne;case"A":return Pt=[sr,Ir].concat(Ge),["C"].concat(nn(Pt[0],Pt[1],Pt[2],Pt[3],Pt[4],Pt[5],Pt[6],Pt[7],Pt[8],Pt[9]));case"Q":return pe.qx=qe,pe.qy=Lt,Pt=[sr,Ir].concat(Ge),["C"].concat(In(Pt[0],Pt[1],Pt[2],Pt[3],Pt[4],Pt[5]));case"L":return["C"].concat(kn(sr,Ir,qe,Lt));case"Z":return sr===Ar&&Ir===$r?["C",sr,Ir,Ar,$r,Ar,$r]:["C"].concat(kn(sr,Ir,Ar,$r));default:}return ne}function ri(ne,pe){if(pe===void 0&&(pe=!1),mr(ne)){var Me=ie(ne);return pe?[Me,[]]:Me}for(var Ge=Nt(ne),qe=(0,Le.__assign)({},Oe),Lt=[],Pt="",sr=Ge.length,Ir,Ar,$r=[],sn=0;sn1&&(Yn*=Xn(ga),Rn*=Xn(ga));var ka=Math.pow(Yn,2)*Math.pow(Rn,2)-Math.pow(Yn,2)*Math.pow(Cn.y,2)-Math.pow(Rn,2)*Math.pow(Cn.x,2),ui=Math.pow(Yn,2)*Math.pow(Cn.y,2)+Math.pow(Rn,2)*Math.pow(Cn.x,2),Ya=ka/ui;Ya=Ya<0?0:Ya;var Ba=(Lt!==Pt?1:-1)*Xn(Ya),fi={x:Ba*(Yn*Cn.y/Rn),y:Ba*(-(Rn*Cn.x)/Yn)},Di={x:Qr(wn)*fi.x-sn(wn)*fi.y+(ne+sr)/2,y:sn(wn)*fi.x+Qr(wn)*fi.y+(pe+Ir)/2},Ni={x:(Cn.x-fi.x)/Yn,y:(Cn.y-fi.y)/Rn},Es=za({x:1,y:0},Ni),Wf={x:(-Cn.x-fi.x)/Yn,y:(-Cn.y-fi.y)/Rn},bs=za(Ni,Wf);!Pt&&bs>0?bs-=2*ha:Pt&&bs<0&&(bs+=2*ha),bs%=2*ha;var vf=Es+bs*Ar,su=Yn*Qr(vf),xs=Rn*sn(vf),Zu={x:Qr(wn)*su-sn(wn)*xs+Di.x,y:sn(wn)*su+Qr(wn)*xs+Di.y};return Zu}function Qa(ne,pe,Me,Ge,qe,Lt,Pt,sr,Ir,Ar,$r){var sn,Qr=$r.bbox,Xn=Qr===void 0?!0:Qr,ha=$r.length,Yn=ha===void 0?!0:ha,Rn=$r.sampleSize,qn=Rn===void 0?30:Rn,wn=typeof Ar=="number",Wn=ne,Hn=pe,Cn=0,ga=[Wn,Hn,Cn],ka=[Wn,Hn],ui=0,Ya={x:0,y:0},Ba=[{x:Wn,y:Hn}];wn&&Ar<=0&&(Ya={x:Wn,y:Hn});for(var fi=0;fi<=qn;fi+=1){if(ui=fi/qn,sn=Aa(ne,pe,Me,Ge,qe,Lt,Pt,sr,Ir,ui),Wn=sn.x,Hn=sn.y,Xn&&Ba.push({x:Wn,y:Hn}),Yn&&(Cn+=We(ka,[Wn,Hn])),ka=[Wn,Hn],wn&&Cn>=Ar&&Ar>ga[2]){var Di=(Cn-Ar)/(Cn-ga[2]);Ya={x:ka[0]*(1-Di)+ga[0]*Di,y:ka[1]*(1-Di)+ga[1]*Di}}ga=[Wn,Hn,Cn]}return wn&&Ar>=Cn&&(Ya={x:sr,y:Ir}),{length:Cn,point:Ya,min:{x:Math.min.apply(null,Ba.map(function(Ni){return Ni.x})),y:Math.min.apply(null,Ba.map(function(Ni){return Ni.y}))},max:{x:Math.max.apply(null,Ba.map(function(Ni){return Ni.x})),y:Math.max.apply(null,Ba.map(function(Ni){return Ni.y}))}}}function Oa(ne,pe,Me,Ge,qe,Lt,Pt,sr,Ir){var Ar=1-Ir;return{x:Math.pow(Ar,3)*ne+3*Math.pow(Ar,2)*Ir*Me+3*Ar*Math.pow(Ir,2)*qe+Math.pow(Ir,3)*Pt,y:Math.pow(Ar,3)*pe+3*Math.pow(Ar,2)*Ir*Ge+3*Ar*Math.pow(Ir,2)*Lt+Math.pow(Ir,3)*sr}}function La(ne,pe,Me,Ge,qe,Lt,Pt,sr,Ir,Ar){var $r,sn=Ar.bbox,Qr=sn===void 0?!0:sn,Xn=Ar.length,ha=Xn===void 0?!0:Xn,Yn=Ar.sampleSize,Rn=Yn===void 0?10:Yn,qn=typeof Ir=="number",wn=ne,Wn=pe,Hn=0,Cn=[wn,Wn,Hn],ga=[wn,Wn],ka=0,ui={x:0,y:0},Ya=[{x:wn,y:Wn}];qn&&Ir<=0&&(ui={x:wn,y:Wn});for(var Ba=0;Ba<=Rn;Ba+=1){if(ka=Ba/Rn,$r=Oa(ne,pe,Me,Ge,qe,Lt,Pt,sr,ka),wn=$r.x,Wn=$r.y,Qr&&Ya.push({x:wn,y:Wn}),ha&&(Hn+=We(ga,[wn,Wn])),ga=[wn,Wn],qn&&Hn>=Ir&&Ir>Cn[2]){var fi=(Hn-Ir)/(Hn-Cn[2]);ui={x:ga[0]*(1-fi)+Cn[0]*fi,y:ga[1]*(1-fi)+Cn[1]*fi}}Cn=[wn,Wn,Hn]}return qn&&Ir>=Hn&&(ui={x:Pt,y:sr}),{length:Hn,point:ui,min:{x:Math.min.apply(null,Ya.map(function(Di){return Di.x})),y:Math.min.apply(null,Ya.map(function(Di){return Di.y}))},max:{x:Math.max.apply(null,Ya.map(function(Di){return Di.x})),y:Math.max.apply(null,Ya.map(function(Di){return Di.y}))}}}function er(ne,pe,Me,Ge,qe,Lt,Pt){var sr=1-Pt;return{x:Math.pow(sr,2)*ne+2*sr*Pt*Me+Math.pow(Pt,2)*qe,y:Math.pow(sr,2)*pe+2*sr*Pt*Ge+Math.pow(Pt,2)*Lt}}function Cr(ne,pe,Me,Ge,qe,Lt,Pt,sr){var Ir,Ar=sr.bbox,$r=Ar===void 0?!0:Ar,sn=sr.length,Qr=sn===void 0?!0:sn,Xn=sr.sampleSize,ha=Xn===void 0?10:Xn,Yn=typeof Pt=="number",Rn=ne,qn=pe,wn=0,Wn=[Rn,qn,wn],Hn=[Rn,qn],Cn=0,ga={x:0,y:0},ka=[{x:Rn,y:qn}];Yn&&Pt<=0&&(ga={x:Rn,y:qn});for(var ui=0;ui<=ha;ui+=1){if(Cn=ui/ha,Ir=er(ne,pe,Me,Ge,qe,Lt,Cn),Rn=Ir.x,qn=Ir.y,$r&&ka.push({x:Rn,y:qn}),Qr&&(wn+=We(Hn,[Rn,qn])),Hn=[Rn,qn],Yn&&wn>=Pt&&Pt>Wn[2]){var Ya=(wn-Pt)/(wn-Wn[2]);ga={x:Hn[0]*(1-Ya)+Wn[0]*Ya,y:Hn[1]*(1-Ya)+Wn[1]*Ya}}Wn=[Rn,qn,wn]}return Yn&&Pt>=wn&&(ga={x:qe,y:Lt}),{length:wn,point:ga,min:{x:Math.min.apply(null,ka.map(function(Ba){return Ba.x})),y:Math.min.apply(null,ka.map(function(Ba){return Ba.y}))},max:{x:Math.max.apply(null,ka.map(function(Ba){return Ba.x})),y:Math.max.apply(null,ka.map(function(Ba){return Ba.y}))}}}function an(ne,pe,Me){for(var Ge,qe,Lt,Pt,sr,Ir,Ar=Nt(ne),$r=typeof pe=="number",sn,Qr=[],Xn,ha=0,Yn=0,Rn=0,qn=0,wn,Wn=[],Hn=[],Cn=0,ga={x:0,y:0},ka=ga,ui=ga,Ya=ga,Ba=0,fi=0,Di=Ar.length;fi=pe&&(Ya=ui),Hn.push(ka),Wn.push(ga),Ba+=Cn,Ir=Xn!=="Z"?wn.slice(-2):[Rn,qn],ha=Ir[0],Yn=Ir[1];return $r&&pe>=Ba&&(Ya={x:ha,y:Yn}),{length:Ba,point:Ya,min:{x:Math.min.apply(null,Wn.map(function(Ni){return Ni.x})),y:Math.min.apply(null,Wn.map(function(Ni){return Ni.y}))},max:{x:Math.max.apply(null,Hn.map(function(Ni){return Ni.x})),y:Math.max.apply(null,Hn.map(function(Ni){return Ni.y}))}}}function un(ne,pe){if(!ne)return{x:0,y:0,width:0,height:0,x2:0,y2:0,cx:0,cy:0,cz:0};var Me=an(ne,void 0,(0,Le.__assign)((0,Le.__assign)({},pe),{length:!1})),Ge=Me.min,qe=Ge.x,Lt=Ge.y,Pt=Me.max,sr=Pt.x,Ir=Pt.y,Ar=sr-qe,$r=Ir-Lt;return{width:Ar,height:$r,x:qe,y:Lt,x2:sr,y2:Ir,cx:qe+Ar/2,cy:Lt+$r/2,cz:Math.max(Ar,$r)+Math.min(Ar,$r)/2}}function Fn(ne,pe){return an(ne,void 0,(0,Le.__assign)((0,Le.__assign)({},pe),{bbox:!1,length:!0})).length}function Jn(ne,pe){if(!ne)return{length:0,x:0,y:0,width:0,height:0,x2:0,y2:0,cx:0,cy:0,cz:0};var Me=an(ne,void 0,(0,Le.__assign)((0,Le.__assign)({},pe),{bbox:!0,length:!0})),Ge=Me.length,qe=Me.min,Lt=qe.x,Pt=qe.y,sr=Me.max,Ir=sr.x,Ar=sr.y,$r=Ir-Lt,sn=Ar-Pt;return{length:Ge,width:$r,height:sn,x:Lt,y:Pt,x2:Ir,y2:Ar,cx:Lt+$r/2,cy:Pt+sn/2,cz:Math.max($r,sn)+Math.min($r,sn)/2}}function Vn(ne){var pe=ne.length,Me=pe-1;return ne.map(function(Ge,qe){return ne.map(function(Lt,Pt){var sr=qe+Pt,Ir;return Pt===0||ne[sr]&&ne[sr][0]==="M"?(Ir=ne[sr],["M"].concat(Ir.slice(-2))):(sr>=pe&&(sr-=Me),ne[sr])})})}function ya(ne,pe){var Me=ne.length-1,Ge=[],qe=0,Lt=0,Pt=Vn(ne);return Pt.forEach(function(sr,Ir){ne.slice(1).forEach(function(Ar,$r){Lt+=We(ne[(Ir+$r)%Me].slice(-2),pe[$r%Me].slice(-2))}),Ge[Ir]=Lt,Lt=0}),qe=Ge.indexOf(Math.min.apply(null,Ge)),Pt[qe]}function ea(ne,pe,Me,Ge,qe,Lt,Pt,sr){return 3*((sr-pe)*(Me+qe)-(Pt-ne)*(Ge+Lt)+Ge*(ne-qe)-Me*(pe-Lt)+sr*(qe+ne/3)-Pt*(Lt+pe/3))/20}function ti(ne){var pe=0,Me=0,Ge=0;return ri(ne).map(function(qe){var Lt;switch(qe[0]){case"M":return pe=qe[1],Me=qe[2],0;default:var Pt=qe.slice(1),sr=Pt[0],Ir=Pt[1],Ar=Pt[2],$r=Pt[3],sn=Pt[4],Qr=Pt[5];return Ge=ea(pe,Me,sr,Ir,Ar,$r,sn,Qr),Lt=qe.slice(-2),pe=Lt[0],Me=Lt[1],Ge}}).reduce(function(qe,Lt){return qe+Lt},0)}function vn(ne){return ti(ne)>=0}function Un(ne,pe,Me){return an(ne,pe,(0,Le.__assign)((0,Le.__assign)({},Me),{bbox:!1,length:!0})).point}function ta(ne,pe){var Me=it(ne);if(typeof Me=="string")throw TypeError(Me);var Ge=Me.slice(),qe=Fn(Ge),Lt=Ge.length-1,Pt=0,sr=0,Ir=Me[0],Ar=Ir.slice(-2),$r=Ar[0],sn=Ar[1],Qr={x:$r,y:sn};if(Lt<=0||!pe||!Number.isFinite(pe))return{segment:Ir,index:0,length:sr,point:Qr,lengthAtSegment:Pt};if(pe>=qe)return Ge=Me.slice(0,-1),Pt=Fn(Ge),sr=qe-Pt,{segment:Me[Lt],index:Lt,length:sr,lengthAtSegment:Pt};for(var Xn=[];Lt>0;)Ir=Ge[Lt],Ge=Ge.slice(0,-1),Pt=Fn(Ge),sr=qe-Pt,qe=Pt,Xn.push({segment:Ir,index:Lt,length:sr,lengthAtSegment:Pt}),Lt-=1;return Xn.find(function(ha){var Yn=ha.lengthAtSegment;return Yn<=pe})}function Tn(ne,pe){for(var Me=it(ne),Ge=Nt(Me),qe=Fn(Me),Lt=function(Cn){var ga=Cn.x-pe.x,ka=Cn.y-pe.y;return ga*ga+ka*ka},Pt=8,sr,Ir=0,Ar,$r=0,sn=Infinity,Qr=0;Qr<=qe;Qr+=Pt)sr=Un(Ge,Qr),Ir=Lt(sr),Ir.5;)Yn=$r-Pt,Xn=Un(Ge,Yn),qn=Lt(Xn),Rn=$r+Pt,ha=Un(Ge,Rn),wn=Lt(ha),Yn>=0&&qn=Qr[qn],Xn[qn]-=ha?1:0,ha?wn.ss:[wn.s]}).flat()});return Yn[0].length===Yn[1].length?Yn:ct(Yn[0],Yn[1],sn)}var se=function(ne){return ne!==null&&typeof ne!="function"&&isFinite(ne.length)},oe=se,R=function(ne,pe){return oe(ne)?ne.indexOf(pe)>-1:!1},_=R,C=function(ne,pe){if(!oe(ne))return ne;for(var Me=[],Ge=0;Ge-1;)xa.call(ne,Lt,1);return ne},di=Xa,Na=Array.prototype.splice,Ti=function(pe,Me){if(!oe(pe))return[];for(var Ge=pe?Me.length:0,qe=Ge-1;Ge--;){var Lt=void 0,Pt=Me[Ge];(Ge===qe||Pt!==Lt)&&(Lt=Pt,Na.call(pe,Pt,1))}return pe},Ii=Ti,ja=function(ne,pe,Me){if(!Zt(ne)&&!_n(ne))return ne;var Ge=Me;return Bt(ne,function(qe,Lt){Ge=pe(Ge,qe,Lt)}),Ge},Co=ja,Fo=function(ne,pe){var Me=[];if(!oe(ne))return Me;for(var Ge=-1,qe=[],Lt=ne.length;++GeLt[sr])return 1;if(qe[sr]Me?Me:ne},Is=oo,vo=function(ne,pe){var Me=pe.toString(),Ge=Me.indexOf(".");if(Ge===-1)return Math.round(ne);var qe=Me.substr(Ge+1).length;return qe>20&&(qe=20),parseFloat(ne.toFixed(qe))},as=vo,gs=function(ne){return rr(ne,"Number")},vi=gs,so=function(ne){return vi(ne)&&ne%1!=0},Ji=so,mo=function(ne){return vi(ne)&&ne%2==0},uo=mo,Da=Number.isInteger?Number.isInteger:function(ne){return vi(ne)&&ne%1==0},si=Da,Fi=function(ne){return vi(ne)&&ne<0},bi=Fi,Eo=1e-5;function Go(ne,pe,Me){return Me===void 0&&(Me=Eo),Math.abs(ne-pe)0},Oo=bo,qa=function(ne,pe){if(!!Zt(ne)){for(var Me,Ge=-Infinity,qe=0;qeGe&&(Me=Lt,Ge=Pt)}return Me}},Bs=function(ne,pe){if(!!Zt(ne)){for(var Me,Ge=Infinity,qe=0;qepe?(Ge&&(clearTimeout(Ge),Ge=null),sr=$r,Pt=ne.apply(qe,Lt),Ge||(qe=Lt=null)):!Ge&&Me.trailing!==!1&&(Ge=setTimeout(Ir,sn)),Pt};return Ar.cancel=function(){clearTimeout(Ge),sr=0,Ge=qe=Lt=null},Ar},Rf=function(ne){return oe(ne)?Array.prototype.slice.call(ne):[]},Mu={},es=function(ne){return ne=ne||"g",Mu[ne]?Mu[ne]+=1:Mu[ne]=1,ne+Mu[ne]},Bf=function(){},cc=function(ne){return ne};function Hs(ne){return Mt(ne)?0:oe(ne)?ne.length:Object.keys(ne).length}var Ff=function(){function ne(){this.map={}}return ne.prototype.has=function(pe){return this.map[pe]!==void 0},ne.prototype.get=function(pe,Me){var Ge=this.map[pe];return Ge===void 0?Me:Ge},ne.prototype.set=function(pe,Me){this.map[pe]=Me},ne.prototype.clear=function(){this.map={}},ne.prototype.delete=function(pe){delete this.map[pe]},ne.prototype.size=function(){return Object.keys(this.map).length},ne}(),en=Ff,iu=1e-6;function _a(ne){return Math.abs(ne)0!=_a(sr[1]-Me)>0&&_a(pe-(Me-Pt[1])*(Pt[0]-sr[0])/(Pt[1]-sr[1])-Pt[0])<0&&(Ge=!Ge)}return Ge}var Zs=function(ne,pe,Me){return ne>=pe&&ne<=Me};function zf(ne,pe,Me,Ge){var qe=.001,Lt={x:Me.x-ne.x,y:Me.y-ne.y},Pt={x:pe.x-ne.x,y:pe.y-ne.y},sr={x:Ge.x-Me.x,y:Ge.y-Me.y},Ir=Pt.x*sr.y-Pt.y*sr.x,Ar=Ir*Ir,$r=Pt.x*Pt.x+Pt.y*Pt.y,sn=sr.x*sr.x+sr.y*sr.y,Qr=null;if(Ar>qe*$r*sn){var Xn=(Lt.x*sr.y-Lt.y*sr.x)/Ir,ha=(Lt.x*Pt.y-Lt.y*Pt.x)/Ir;Zs(Xn,0,1)&&Zs(ha,0,1)&&(Qr={x:ne.x+Xn*Pt.x,y:ne.y+Xn*Pt.y})}return Qr}function Tu(ne){for(var pe=[],Me=ne.length,Ge=0;Ge1){var Pt=ne[0],sr=ne[Me-1];pe.push({from:{x:sr[0],y:sr[1]},to:{x:Pt[0],y:Pt[1]}})}return pe}function df(ne,pe){var Me=!1;return ne.forEach(function(Ge){if(zf(Ge.from,Ge.to,pe.from,pe.to))return Me=!0,!1}),Me}function Uf(ne){var pe=ne.map(function(Ge){return Ge[0]}),Me=ne.map(function(Ge){return Ge[1]});return{minX:Math.min.apply(null,pe),maxX:Math.max.apply(null,pe),minY:Math.min.apply(null,Me),maxY:Math.max.apply(null,Me)}}function ou(ne,pe){return!(pe.minX>ne.maxX||pe.maxXne.maxY||pe.maxY0?Je.set(ke,et):Je.delete(ke))}function E(Je,ke,et,bt){var vt=String(ke),It=String(et);if(!Je&&vt>It){var tr=vt;vt=It,It=tr}return vt+P.EDGE_KEY_DELIM+It+P.EDGE_KEY_DELIM+(bt===void 0?P.DEFAULT_EDGE_NAME:bt)}function g(Je,ke,et,bt){var vt=String(ke),It=String(et),tr={v:ke,w:et};if(!Je&&vt>It){var Tr=tr.v;tr.v=tr.w,tr.w=Tr}return bt!==void 0&&(tr.name=bt),tr}function p(Je,ke){return E(Je,ke.v,ke.w,ke.name)}function h(Je){return typeof Je=="function"}var x=function(ke){return ke.nodes().map(function(et){var bt=ke.node(et),vt=ke.parent(et),It={id:et,value:bt,parent:vt};return It.value===void 0&&delete It.value,It.parent===void 0&&delete It.parent,It})},m=function(ke){return ke.edges().map(function(et){var bt=ke.edge(et),vt={v:et.v,w:et.w,value:bt,name:et.name};return vt.name===void 0&&delete vt.name,vt.value===void 0&&delete vt.value,vt})},b=function(ke){var et={options:{directed:ke.isDirected(),multigraph:ke.isMultigraph(),compound:ke.isCompound()},nodes:x(ke),edges:m(ke),value:ke.graph()};return et.value===void 0&&delete et.value,et},A=function(ke){var et=new q(ke.options);return ke.value!==void 0&&et.setGraph(ke.value),ke.nodes.forEach(function(bt){et.setNode(bt.id,bt.value),bt.parent&&et.setParent(bt.id,bt.parent)}),ke.edges.forEach(function(bt){et.setEdge(bt.v,bt.w,bt.value,bt.name)}),et};function k(Je,ke){var et=Object.keys(Je);if(Object.getOwnPropertySymbols){var bt=Object.getOwnPropertySymbols(Je);ke&&(bt=bt.filter(function(vt){return Object.getOwnPropertyDescriptor(Je,vt).enumerable})),et.push.apply(et,bt)}return et}function G(Je){for(var ke=1;ke0&&arguments[0]!==void 0?arguments[0]:{};M(this,Je),this.directed=!0,this.multigraph=!1,this.compound=!1,this.GRAPH_NODE=P.GRAPH_NODE,this.label=void 0,this.nodeCountNum=0,this.edgeCountNum=0,this.defaultNodeLabelFn=function(){},this.defaultEdgeLabelFn=function(){},this.parentMap=void 0,this.childrenMap=void 0,this.nodesLabelMap=new Map,this.inEdgesMap=new Map,this.outEdgesMap=new Map,this.predecessorsMap=new Map,this.successorsMap=new Map,this.edgesMap=new Map,this.edgesLabelsMap=new Map,this.isDirected=function(){return ke.directed},this.isMultigraph=function(){return ke.multigraph},this.isCompound=function(){return ke.compound},this.setGraph=function(vt){return ke.label=vt,ke},this.graph=function(){return ke.label},this.setDefaultNodeLabel=function(vt){return h(vt)?ke.defaultNodeLabelFn=vt:ke.defaultNodeLabelFn=function(){return vt},ke},this.nodeCount=function(){return ke.nodeCountNum},this.node=function(vt){return ke.nodesLabelMap.get(vt)},this.nodes=function(){return Array.from(ke.nodesLabelMap.keys())},this.sources=function(){return ke.nodes().filter(function(vt){var It;return!((It=ke.inEdgesMap.get(vt))===null||It===void 0?void 0:It.size)})},this.sinks=function(){return ke.nodes().filter(function(vt){var It;return!((It=ke.outEdgesMap.get(vt))===null||It===void 0?void 0:It.size)})},this.setNodes=function(vt,It){return vt.map(function(tr){return ke.setNode(tr,It)}),ke},this.hasNode=function(vt){return ke.nodesLabelMap.has(vt)},this.checkCompound=function(){if(!ke.isCompound())throw new Error("Cannot construct parent-children relations in a non-compound graph")},this.parent=function(vt){if(ke.isCompound()){var It,tr=(It=ke.parentMap)===null||It===void 0?void 0:It.get(vt);if(tr!==ke.GRAPH_NODE)return tr}},this.removeFromParentsChildList=function(vt){var It=ke.parentMap.get(vt);ke.childrenMap.get(It).delete(vt)},this.setParent=function(vt,It){var tr,Tr;ke.checkCompound();for(var Vr=It===void 0?ke.GRAPH_NODE:It,on=ke.parent(Vr);on;){if(vt===on)throw new Error("Setting "+It+" as parent of "+vt+" would create a cycle");on=ke.parent(on)}It&&ke.setNode(It),ke.setNode(vt),ke.removeFromParentsChildList(vt),(tr=ke.parentMap)===null||tr===void 0||tr.set(vt,Vr);var xn=ke.childrenMap.get(Vr);return xn.set(vt,!0),(Tr=ke.childrenMap)===null||Tr===void 0||Tr.set(Vr,xn),ke},this.children=function(vt){var It=vt===void 0?ke.GRAPH_NODE:vt;if(ke.isCompound()){var tr,Tr=(tr=ke.childrenMap)===null||tr===void 0?void 0:tr.get(It);return Tr?Array.from(Tr.keys()):void 0}if(It===ke.GRAPH_NODE)return ke.nodes();if(vt&&ke.hasNode(vt))return[]},this.predecessors=function(vt){var It=ke.predecessorsMap.get(vt);return It?Array.from(It.keys()):void 0},this.successors=function(vt){var It=ke.successorsMap.get(vt);return It?Array.from(It.keys()):void 0},this.neighbors=function(vt){var It;if(!!ke.hasNode(vt))return Array.from(new Set((It=ke.predecessors(vt))===null||It===void 0?void 0:It.concat(ke.successors(vt))))},this.isLeaf=function(vt){var It;if(ke.isDirected()){var tr;return!((tr=ke.successors(vt))===null||tr===void 0?void 0:tr.length)}return!((It=ke.neighbors(vt))===null||It===void 0?void 0:It.length)},this.filterNodes=function(vt){var It=ke.directed,tr=ke.multigraph,Tr=ke.compound,Vr=new Je({directed:It,multigraph:tr,compound:Tr});if(Vr.setGraph(ke.graph()),ke.nodes().forEach(function(xn){vt(xn)&&Vr.setNode(xn,ke.node(xn))}),ke.edges().forEach(function(xn){Vr.hasNode(xn.v)&&Vr.hasNode(xn.w)&&Vr.setEdgeObj(xn,ke.edge(xn))}),Tr){var on=function(Zn){for(var ia=ke.parent(Zn);ia!==void 0&&!Vr.hasNode(ia);)ia=ke.parent(ia);return ia};Vr.nodes().forEach(function(xn){Vr.setParent(xn,on(xn))})}return Vr},this.setDefaultEdgeLabel=function(vt){return h(vt)?ke.defaultEdgeLabelFn=vt:ke.defaultEdgeLabelFn=function(){return vt},ke},this.edgeCount=function(){return ke.edgeCountNum},this.setEdgeObj=function(vt,It){return ke.setEdge(vt.v,vt.w,It,vt.name)},this.setPath=function(vt,It){return vt.reduce(function(tr,Tr){return ke.setEdge(tr,Tr,It),Tr}),ke},this.edgeFromArgs=function(vt,It,tr){return ke.edge({v:vt,w:It,name:tr})},this.edge=function(vt){return ke.edgesLabelsMap.get(p(ke.isDirected(),vt))},this.hasEdge=function(vt,It,tr){return ke.edgesLabelsMap.has(p(ke.isDirected(),{v:vt,w:It,name:tr}))},this.removeEdgeObj=function(vt){var It=vt.v,tr=vt.w,Tr=vt.name;return ke.removeEdge(It,tr,Tr)},this.edges=function(){return Array.from(ke.edgesMap.values())},this.inEdges=function(vt,It){var tr=ke.inEdgesMap.get(vt);if(tr)return Array.from(tr.values()).filter(function(Tr){return!It||Tr.v===It})},this.outEdges=function(vt,It){var tr=ke.outEdgesMap.get(vt);if(tr)return Array.from(tr.values()).filter(function(Tr){return!It||Tr.w===It})},this.nodeEdges=function(vt,It){var tr;if(!!ke.hasNode(vt))return(tr=ke.inEdges(vt,It))===null||tr===void 0?void 0:tr.concat(ke.outEdges(vt,It))},this.toJSON=function(){return b(ke)},this.nodeInDegree=function(vt){var It=ke.inEdgesMap.get(vt);return It?It.size:0},this.nodeOutDegree=function(vt){var It=ke.outEdgesMap.get(vt);return It?It.size:0},this.nodeDegree=function(vt){return ke.nodeInDegree(vt)+ke.nodeOutDegree(vt)},this.source=function(vt){return vt.v},this.target=function(vt){return vt.w};var bt=G(G({},$),et);this.compound=bt.compound,this.directed=bt.directed,this.multigraph=bt.multigraph,this.compound&&(this.parentMap=new Map,this.childrenMap=new Map)}return j(Je,[{key:"setNode",value:function(et,bt){var vt=this.nodesLabelMap,It=this.defaultNodeLabelFn,tr=this.isCompound,Tr=this.parentMap,Vr=this.childrenMap,on=this.inEdgesMap,xn=this.outEdgesMap,Zn=this.predecessorsMap,ia=this.successorsMap;if(vt.has(et))return bt!==void 0&&vt.set(et,bt),this;if(vt.set(et,bt||It(et)),tr()){var xa;Tr==null||Tr.set(et,this.GRAPH_NODE),Vr==null||Vr.set(et,new Map),(Vr==null?void 0:Vr.has(this.GRAPH_NODE))||Vr==null||Vr.set(this.GRAPH_NODE,new Map),Vr==null||(xa=Vr.get(this.GRAPH_NODE))===null||xa===void 0||xa.set(et,!0)}return[on,xn,Zn,ia].forEach(function(li){return li.set(et,new Map)}),this.nodeCountNum+=1,this}},{key:"removeNode",value:function(et){var bt=this;if(this.hasNode(et)){var vt=function(di){bt.removeEdge(di.v,di.w,di.name)},It=this.inEdgesMap,tr=this.outEdgesMap,Tr=this.predecessorsMap,Vr=this.successorsMap,on=this.nodesLabelMap;if(this.isCompound()){var xn,Zn,ia;this.removeFromParentsChildList(et),(xn=this.parentMap)===null||xn===void 0||xn.delete(et),(Zn=this.children(et))===null||Zn===void 0||Zn.forEach(function(Xa){return bt.setParent(Xa)}),(ia=this.childrenMap)===null||ia===void 0||ia.delete(et)}var xa=It.get(et),li=tr.get(et);Array.from(xa.values()).forEach(function(Xa){return vt(Xa)}),Array.from(li.values()).forEach(function(Xa){return vt(Xa)}),on.delete(et),It.delete(et),tr.delete(et),Tr.delete(et),Vr.delete(et),this.nodeCountNum-=1}return this}},{key:"setEdge",value:function(et,bt,vt,It){var tr,Tr,Vr=g(this.isDirected(),et,bt,It),on=p(this.isDirected(),Vr),xn=Vr.v,Zn=Vr.w;if(this.edgesLabelsMap.has(on))return this.edgesLabelsMap.set(on,vt),this;if(It!==void 0&&!this.isMultigraph())throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(xn),this.setNode(Zn),this.edgesLabelsMap.set(on,vt||this.defaultEdgeLabelFn(xn,Zn,It)),Object.freeze(Vr),this.edgesMap.set(on,Vr);var ia=this.predecessorsMap.get(Zn),xa=this.successorsMap.get(xn);return N(ia,xn),N(xa,Zn),(tr=this.inEdgesMap.get(Zn))===null||tr===void 0||tr.set(on,Vr),(Tr=this.outEdgesMap.get(xn))===null||Tr===void 0||Tr.set(on,Vr),this.edgeCountNum+=1,this}},{key:"removeEdge",value:function(et,bt,vt){var It=E(this.isDirected(),et,bt,vt),tr=this.edgesMap.get(It);if(tr){var Tr=g(this.isDirected(),et,bt,vt),Vr=Tr.v,on=Tr.w;this.edgesLabelsMap.delete(It),this.edgesMap.delete(It);var xn=this.predecessorsMap.get(on),Zn=this.successorsMap.get(Vr);y(xn,Vr),y(Zn,on),this.inEdgesMap.get(on).delete(It),this.outEdgesMap.get(Vr).delete(It),this.edgeCountNum-=1}return this}}]),Je}();q.fromJSON=A;function te(Je){return te=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(ke){return typeof ke}:function(ke){return ke&&typeof Symbol=="function"&&ke.constructor===Symbol&&ke!==Symbol.prototype?"symbol":typeof ke},te(Je)}function ee(Je,ke){if(!(Je instanceof ke))throw new TypeError("Cannot call a class as a function")}function ie(Je,ke){for(var et=0;et-1&&this.eventPool[vt].splice(tr,1)}}},{key:"emitEvent",value:function(vt){for(var It=arguments.length,tr=new Array(It>1?It-1:0),Tr=1;Tr>1,((Tr=bt[It])===null||Tr===void 0?void 0:Tr.priority)ke.arr[vt].priority)throw new Error("New priority is greater than current priority.Key: ".concat(et," Old: + ").concat(ke.arr[vt].priority," New: ").concat(bt));ke.arr[vt].priority=bt,ke.innerDecrease(vt)}}),He=function(ke,et){var bt=new q,vt=new Map,It=new Ct,tr;function Tr(xn){var Zn=xn.v===tr?xn.w:xn.v,ia=It.priority(Zn);if(ia!==void 0){var xa=et(xn);xa0;){var on;if(tr=It.removeMin(),vt.has(tr))bt.setEdge(tr,vt.get(tr));else{if(Vr)throw new Error("Input graph is not connected: "+ke.graph());Vr=!0}(on=ke.nodeEdges(tr))===null||on===void 0||on.forEach(Tr)}return bt},ht=He,mt=function(ke){var et=new Set,bt=[],vt=ke.nodes();return vt.forEach(function(It){for(var tr=[],Tr=[It];Tr.length>0;){var Vr=Tr.pop();if(!et.has(Vr)){var on,xn;et.add(Vr),tr.push(Vr),(on=ke.successors(Vr))===null||on===void 0||on.forEach(function(Zn){return Tr.push(Zn)}),(xn=ke.predecessors(Vr))===null||xn===void 0||xn.forEach(function(Zn){return Tr.push(Zn)})}}tr.length&&bt.push(tr)}),bt},dt=mt,Et=function Je(ke,et,bt,vt,It,tr){vt.includes(et)||(vt.push(et),bt||tr.push(et),It(et).forEach(function(Tr){return Je(ke,Tr,bt,vt,It,tr)}),bt&&tr.push(et))},it=function(ke,et,bt){var vt=Array.isArray(et)?et:[et],It=function(on){return ke.isDirected()?ke.successors(on):ke.neighbors(on)},tr=[],Tr=[];return vt.forEach(function(Vr){if(ke.hasNode(Vr))Et(ke,Vr,bt==="post",Tr,It,tr);else throw new Error("Graph does not have node: "+Vr)}),tr},St=it;function $t(Je,ke){return In(Je)||nn(Je,ke)||mr(Je,ke)||Nt()}function Nt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
+In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function mr(Je,ke){if(!!Je){if(typeof Je=="string")return br(Je,ke);var et=Object.prototype.toString.call(Je).slice(8,-1);if(et==="Object"&&Je.constructor&&(et=Je.constructor.name),et==="Map"||et==="Set")return Array.from(Je);if(et==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(et))return br(Je,ke)}}function br(Je,ke){(ke==null||ke>Je.length)&&(ke=Je.length);for(var et=0,bt=new Array(ke);et0&&(Tr=tr.removeMin(),Vr=It.get(Tr),!(Vr&&Vr.distance===Number.POSITIVE_INFINITY));)vt(Tr).forEach(on);var xn={};return Array.from(It.entries()).forEach(function(Zn){var ia=$t(Zn,2),xa=ia[0],li=ia[1];return xn[String(xa)]=li,xn}),xn},kn=We,aa=function(ke,et,bt){var vt={};return ke.nodes().forEach(function(It){return vt[String(It)]=kn(ke,It,et,bt),vt}),vt},ri=aa,Ia=function(ke){var et=0,bt=[],vt=new Map,It=[];function tr(Tr){var Vr,on={onStack:!0,lowlink:et,index:et};if(vt.set(Tr,on),et+=1,bt.push(Tr),(Vr=ke.successors(Tr))===null||Vr===void 0||Vr.forEach(function(xa){var li;if(vt.has(xa)){if((li=vt.get(xa))===null||li===void 0?void 0:li.onStack){var di=vt.get(xa);on.lowlink=Math.min(on.lowlink,di.index)}}else{tr(xa);var Xa=vt.get(xa);on.lowlink=Math.min(on.lowlink,Xa.lowlink)}}),on.lowlink===on.index){var xn=[],Zn;do{Zn=bt.pop();var ia=vt.get(Zn);ia.onStack=!1,xn.push(Zn)}while(Tr!==Zn);It.push(xn)}}return ke.nodes().forEach(function(Tr){vt.has(Tr)||tr(Tr)}),It},za=Ia,Aa=function(ke){return za(ke).filter(function(et){return et.length>1||et.length===1&&ke.hasEdge(et[0],et[0])})},Qa=Aa;function Oa(Je){return Oa=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(ke){return typeof ke}:function(ke){return ke&&typeof Symbol=="function"&&ke.constructor===Symbol&&ke!==Symbol.prototype?"symbol":typeof ke},Oa(Je)}function La(Je,ke){for(var et=0;etJe.length)&&(ke=Je.length);for(var et=0,bt=new Array(ke);et-1:!1};W.a=B},function(X,W,U){"use strict";var Y=function(B){return typeof B=="object"&&B!==null};W.a=Y},function(X,W,U){"use strict";var Y=U(8),B=U(2),D=Object.values?function(P){return Object.values(P)}:function(P){var N=[];return Object(Y.a)(P,function(y,E){Object(B.a)(P)&&E==="prototype"||N.push(y)}),N};W.a=D},function(X,W,U){"use strict";W.a=B;function Y(D,P){for(var N in P)P.hasOwnProperty(N)&&N!=="constructor"&&P[N]!==void 0&&(D[N]=P[N])}function B(D,P,N,y){return P&&Y(D,P),N&&Y(D,N),y&&Y(D,y),D}},function(X,W,U){var Y=U(35),B=["LR","RL","TB","BT","H","V"],D=["LR","RL","H"],P=function(E){return D.indexOf(E)>-1},N=B[0];X.exports=function(y,E,g){var p=E.direction||N;if(E.isHorizontal=P(p),p&&B.indexOf(p)===-1)throw new TypeError("Invalid direction: "+p);if(p===B[0])g(y,E);else if(p===B[1])g(y,E),y.right2left();else if(p===B[2])g(y,E);else if(p===B[3])g(y,E),y.bottom2top();else if(p===B[4]||p===B[5]){var h=Y(y,E),x=h.left,m=h.right;g(x,E),g(m,E),E.isHorizontal?x.right2left():x.bottom2top(),m.translate(x.x-m.x,x.y-m.y),y.x=x.x,y.y=m.y;var b=y.getBoundingBox();E.isHorizontal?b.top<0&&y.translate(0,-b.top):b.left<0&&y.translate(-b.left,0)}var A=E.fixedRoot;return A===void 0&&(A=!0),A&&y.translate(-(y.x+y.width/2+y.hgap),-(y.y+y.height/2+y.vgap)),y}},function(X,W,U){var Y=U(6),B=18,D=B*2,P=B,N={getId:function(p){return p.id||p.name},getPreH:function(p){return p.preH||0},getPreV:function(p){return p.preV||0},getHGap:function(p){return p.hgap||P},getVGap:function(p){return p.vgap||P},getChildren:function(p){return p.children},getHeight:function(p){return p.height||D},getWidth:function(p){var h=p.label||" ";return p.width||h.split("").length*B}};function y(g,p){var h=this;if(h.vgap=h.hgap=0,g instanceof y)return g;h.data=g;var x=p.getHGap(g),m=p.getVGap(g);return h.preH=p.getPreH(g),h.preV=p.getPreV(g),h.width=p.getWidth(g),h.height=p.getHeight(g),h.width+=h.preH,h.height+=h.preV,h.id=p.getId(g),h.x=h.y=0,h.depth=0,h.children||(h.children=[]),h.addGap(x,m),h}Y.assign(y.prototype,{isRoot:function(){return this.depth===0},isLeaf:function(){return this.children.length===0},addGap:function(p,h){var x=this;x.hgap+=p,x.vgap+=h,x.width+=2*p,x.height+=2*h},eachNode:function(p){for(var h=this,x=[h],m;m=x.shift();)p(m),x=m.children.concat(x)},DFTraverse:function(p){this.eachNode(p)},BFTraverse:function(p){for(var h=this,x=[h],m;m=x.shift();)p(m),x=x.concat(m.children)},getBoundingBox:function(){var p={left:Number.MAX_VALUE,top:Number.MAX_VALUE,width:0,height:0};return this.eachNode(function(h){p.left=Math.min(p.left,h.x),p.top=Math.min(p.top,h.y),p.width=Math.max(p.width,h.x+h.width),p.height=Math.max(p.height,h.y+h.height)}),p},translate:function(p,h){p===void 0&&(p=0),h===void 0&&(h=0),this.eachNode(function(x){x.x+=p,x.y+=h,x.x+=x.preH,x.y+=x.preV})},right2left:function(){var p=this,h=p.getBoundingBox();p.eachNode(function(x){x.x=x.x-(x.x-h.left)*2-x.width}),p.translate(h.width,0)},bottom2top:function(){var p=this,h=p.getBoundingBox();p.eachNode(function(x){x.y=x.y-(x.y-h.top)*2-x.height}),p.translate(0,h.height)}});function E(g,p,h){p===void 0&&(p={}),p=Y.assign({},N,p);var x=new y(g,p),m=[x],b;if(!h&&!g.collapsed){for(;b=m.shift();)if(!b.data.collapsed){var A=p.getChildren(b.data),k=A?A.length:0;if(b.children=new Array(k),A&&k)for(var G=0;G-1;)B.call(N,h,1);return N};W.a=P},function(X,W,U){"use strict";var Y=U(1),B=U(24),D=function(P,N){var y=[];if(!Object(Y.a)(P))return y;for(var E=-1,g=[],p=P.length;++Eh[m])return 1;if(p[m]P?P:B};W.a=Y},function(X,W,U){"use strict";var Y=function(B,D){var P=D.toString(),N=P.indexOf(".");if(N===-1)return Math.round(B);var y=P.substr(N+1).length;return y>20&&(y=20),parseFloat(B.toFixed(y))};W.a=Y},function(X,W,U){"use strict";var Y=U(5),B=function(D){return Object(Y.a)(D)&&D%1!=0};W.a=B},function(X,W,U){"use strict";var Y=U(5),B=function(D){return Object(Y.a)(D)&&D%2==0};W.a=B},function(X,W,U){"use strict";var Y=U(5),B=Number.isInteger?Number.isInteger:function(D){return Object(Y.a)(D)&&D%1==0};W.a=B},function(X,W,U){"use strict";var Y=U(5),B=function(D){return Object(Y.a)(D)&&D<0};W.a=B},function(X,W,U){"use strict";W.a=B;var Y=1e-5;function B(D,P,N){return N===void 0&&(N=Y),Math.abs(D-P)0};W.a=B},function(X,W,U){"use strict";var Y=U(0),B=U(2);W.a=function(D,P){if(!!Object(Y.a)(D)){for(var N,y=-Infinity,E=0;Ey&&(N=g,y=p)}return N}}},function(X,W,U){"use strict";var Y=U(0),B=U(2);W.a=function(D,P){if(!!Object(Y.a)(D)){for(var N,y=Infinity,E=0;EB?(P&&(clearTimeout(P),P=null),g=x,E=Y.apply(N,y),P||(N=y=null)):!P&&D.trailing!==!1&&(P=setTimeout(p,m)),E};return h.cancel=function(){clearTimeout(P),g=0,P=N=y=null},h}},function(X,W,U){"use strict";var Y=U(1);W.a=function(B){return Object(Y.a)(B)?Array.prototype.slice.call(B):[]}},function(X,W,U){"use strict";var Y={};W.a=function(B){return B=B||"g",Y[B]?Y[B]+=1:Y[B]=1,B+Y[B]}},function(X,W,U){"use strict";W.a=function(){}},function(X,W,U){"use strict";W.a=function(Y){return Y}},function(X,W,U){"use strict";W.a=D;var Y=U(7),B=U(1);function D(P){return Object(Y.a)(P)?0:Object(B.a)(P)?P.length:Object.keys(P).length}},function(X,W,U){"use strict";W.a=V;var Y=function(ve,be){return Y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Ae,Pe){Ae.__proto__=Pe}||function(Ae,Pe){for(var Ve in Pe)Object.prototype.hasOwnProperty.call(Pe,Ve)&&(Ae[Ve]=Pe[Ve])},Y(ve,be)};function B(ve,be){if(typeof be!="function"&&be!==null)throw new TypeError("Class extends value "+String(be)+" is not a constructor or null");Y(ve,be);function Ae(){this.constructor=ve}ve.prototype=be===null?Object.create(be):(Ae.prototype=be.prototype,new Ae)}var D=function(){return D=Object.assign||function(be){for(var Ae,Pe=1,Ve=arguments.length;Pe=0;_t--)(Ke=ve[_t])&&(Ue=(Ve<3?Ke(Ue):Ve>3?Ke(be,Ae,Ue):Ke(be,Ae))||Ue);return Ve>3&&Ue&&Object.defineProperty(be,Ae,Ue),Ue}function y(ve,be){return function(Ae,Pe){be(Ae,Pe,ve)}}function E(ve,be,Ae,Pe,Ve,Ue){function Ke(Nt){if(Nt!==void 0&&typeof Nt!="function")throw new TypeError("Function expected");return Nt}for(var _t=Pe.kind,Ct=_t==="getter"?"get":_t==="setter"?"set":"value",He=!be&&ve?Pe.static?ve:ve.prototype:null,ht=be||(He?Object.getOwnPropertyDescriptor(He,Pe.name):{}),mt,dt=!1,Et=Ae.length-1;Et>=0;Et--){var it={};for(var St in Pe)it[St]=St==="access"?{}:Pe[St];for(var St in Pe.access)it.access[St]=Pe.access[St];it.addInitializer=function(Nt){if(dt)throw new TypeError("Cannot add initializers after decoration has completed");Ue.push(Ke(Nt||null))};var $t=(0,Ae[Et])(_t==="accessor"?{get:ht.get,set:ht.set}:ht[Ct],it);if(_t==="accessor"){if($t===void 0)continue;if($t===null||typeof $t!="object")throw new TypeError("Object expected");(mt=Ke($t.get))&&(ht.get=mt),(mt=Ke($t.set))&&(ht.set=mt),(mt=Ke($t.init))&&Ve.push(mt)}else(mt=Ke($t))&&(_t==="field"?Ve.push(mt):ht[Ct]=mt)}He&&Object.defineProperty(He,Pe.name,ht),dt=!0}function g(ve,be,Ae){for(var Pe=arguments.length>2,Ve=0;Ve0&&Ue[Ue.length-1])&&(He[0]===6||He[0]===2)){Ae=0;continue}if(He[0]===3&&(!Ue||He[1]>Ue[0]&&He[1]=ve.length&&(ve=void 0),{value:ve&&ve[Pe++],done:!ve}}};throw new TypeError(be?"Object is not iterable.":"Symbol.iterator is not defined.")}function T(ve,be){var Ae=typeof Symbol=="function"&&ve[Symbol.iterator];if(!Ae)return ve;var Pe=Ae.call(ve),Ve,Ue=[],Ke;try{for(;(be===void 0||be-- >0)&&!(Ve=Pe.next()).done;)Ue.push(Ve.value)}catch(_t){Ke={error:_t}}finally{try{Ve&&!Ve.done&&(Ae=Pe.return)&&Ae.call(Pe)}finally{if(Ke)throw Ke.error}}return Ue}function M(){for(var ve=[],be=0;be1||_t(dt,Et)})})}function _t(dt,Et){try{Ct(Pe[dt](Et))}catch(it){mt(Ue[0][3],it)}}function Ct(dt){dt.value instanceof $?Promise.resolve(dt.value.v).then(He,ht):mt(Ue[0][2],dt)}function He(dt){_t("next",dt)}function ht(dt){_t("throw",dt)}function mt(dt,Et){dt(Et),Ue.shift(),Ue.length&&_t(Ue[0][0],Ue[0][1])}}function te(ve){var be,Ae;return be={},Pe("next"),Pe("throw",function(Ve){throw Ve}),Pe("return"),be[Symbol.iterator]=function(){return this},be;function Pe(Ve,Ue){be[Ve]=ve[Ve]?function(Ke){return(Ae=!Ae)?{value:$(ve[Ve](Ke)),done:!1}:Ue?Ue(Ke):Ke}:Ue}}function ee(ve){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var be=ve[Symbol.asyncIterator],Ae;return be?be.call(ve):(ve=typeof G=="function"?G(ve):ve[Symbol.iterator](),Ae={},Pe("next"),Pe("throw"),Pe("return"),Ae[Symbol.asyncIterator]=function(){return this},Ae);function Pe(Ue){Ae[Ue]=ve[Ue]&&function(Ke){return new Promise(function(_t,Ct){Ke=ve[Ue](Ke),Ve(_t,Ct,Ke.done,Ke.value)})}}function Ve(Ue,Ke,_t,Ct){Promise.resolve(Ct).then(function(He){Ue({value:He,done:_t})},Ke)}}function ie(ve,be){return Object.defineProperty?Object.defineProperty(ve,"raw",{value:be}):ve.raw=be,ve}var ce=Object.create?function(ve,be){Object.defineProperty(ve,"default",{enumerable:!0,value:be})}:function(ve,be){ve.default=be};function ge(ve){if(ve&&ve.__esModule)return ve;var be={};if(ve!=null)for(var Ae in ve)Ae!=="default"&&Object.prototype.hasOwnProperty.call(ve,Ae)&&A(be,ve,Ae);return ce(be,ve),be}function Le(ve){return ve&&ve.__esModule?ve:{default:ve}}function Oe(ve,be,Ae,Pe){if(Ae==="a"&&!Pe)throw new TypeError("Private accessor was defined without a getter");if(typeof be=="function"?ve!==be||!Pe:!be.has(ve))throw new TypeError("Cannot read private member from an object whose class did not declare it");return Ae==="m"?Pe:Ae==="a"?Pe.call(ve):Pe?Pe.value:be.get(ve)}function Re(ve,be,Ae,Pe,Ve){if(Pe==="m")throw new TypeError("Private method is not writable");if(Pe==="a"&&!Ve)throw new TypeError("Private accessor was defined without a setter");if(typeof be=="function"?ve!==be||!Ve:!be.has(ve))throw new TypeError("Cannot write private member to an object whose class did not declare it");return Pe==="a"?Ve.call(ve,Ae):Ve?Ve.value=Ae:be.set(ve,Ae),Ae}function de(ve,be){if(be===null||typeof be!="object"&&typeof be!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof ve=="function"?be===ve:ve.has(be)}},function(X,W,U){"use strict";var Y=U(4),B=U(9),D=U(34);W.a=function(P,N,y,E){E===void 0&&(E="...");var g=16,p=Object(D.a)(E,y),h=Object(Y.a)(P)?P:Object(B.a)(P),x=N,m=[],b,A;if(Object(D.a)(P,y)<=N)return P;for(;b=h.substr(0,g),A=Object(D.a)(b,y),!(A+p>x&&A>x);)if(m.push(b),x-=A,h=h.substr(g),!h)return m.join("");for(;b=h.substr(0,1),A=Object(D.a)(b,y),!(A+p>x);)if(m.push(b),x-=A,h=h.substr(1),!h)return m.join("");return""+m.join("")+E}},function(X,W,U){"use strict";var Y=function(){function B(){this.map={}}return B.prototype.has=function(D){return this.map[D]!==void 0},B.prototype.get=function(D,P){var N=this.map[D];return N===void 0?P:N},B.prototype.set=function(D,P){this.map[D]=P},B.prototype.clear=function(){this.map={}},B.prototype.delete=function(D){delete this.map[D]},B.prototype.size=function(){return Object.keys(this.map).length},B}();W.a=Y},function(X,W){function U(y,E,g,p){p===void 0&&(p=[]);var h=this;h.w=y||0,h.h=E||0,h.y=g||0,h.x=0,h.c=p||[],h.cs=p.length,h.prelim=0,h.mod=0,h.shift=0,h.change=0,h.tl=null,h.tr=null,h.el=null,h.er=null,h.msel=0,h.mser=0}U.fromNode=function(y,E){if(!y)return null;var g=[];return y.children.forEach(function(p){g.push(U.fromNode(p,E))}),E?new U(y.height,y.width,y.x,g):new U(y.width,y.height,y.y,g)};function Y(y,E,g){g?y.y+=E:y.x+=E,y.children.forEach(function(p){Y(p,E,g)})}function B(y,E){var g=E?y.y:y.x;return y.children.forEach(function(p){g=Math.min(B(p,E),g)}),g}function D(y,E){var g=B(y,E);Y(y,-g,E)}function P(y,E,g){g?E.y=y.x:E.x=y.x,y.c.forEach(function(p,h){P(p,E.children[h],g)})}function N(y,E,g){g===void 0&&(g=0),E?(y.x=g,g+=y.width):(y.y=g,g+=y.height),y.children.forEach(function(p){N(p,E,g)})}X.exports=function(y,E){E===void 0&&(E={});var g=E.isHorizontal;function p(ee){if(ee.cs===0){h(ee);return}p(ee.c[0]);for(var ie=q(k(ee.c[0].el),0,null),ce=1;cece.low&&(ce=ce.nxt);var de=Le+ge.prelim+ge.w-(Re+Oe.prelim);de>0&&(Re+=de,m(ee,ie,ce.index,de));var ve=k(ge),be=k(Oe);ve<=be&&(ge=A(ge),ge!==null&&(Le+=ge.mod)),ve>=be&&(Oe=b(Oe),Oe!==null&&(Re+=Oe.mod))}!ge&&!!Oe?G(ee,ie,Oe,Re):!!ge&&!Oe&&T(ee,ie,ge,Le)}function m(ee,ie,ce,ge){ee.c[ie].mod+=ge,ee.c[ie].msel+=ge,ee.c[ie].mser+=ge,j(ee,ie,ce,ge)}function b(ee){return ee.cs===0?ee.tl:ee.c[0]}function A(ee){return ee.cs===0?ee.tr:ee.c[ee.cs-1]}function k(ee){return ee.y+ee.h}function G(ee,ie,ce,ge){var Le=ee.c[0].el;Le.tl=ce;var Oe=ge-ce.mod-ee.c[0].msel;Le.mod+=Oe,Le.prelim-=Oe,ee.c[0].el=ee.c[ie].el,ee.c[0].msel=ee.c[ie].msel}function T(ee,ie,ce,ge){var Le=ee.c[ie].er;Le.tr=ce;var Oe=ge-ce.mod-ee.c[ie].mser;Le.mod+=Oe,Le.prelim-=Oe,ee.c[ie].er=ee.c[ie-1].er,ee.c[ie].mser=ee.c[ie-1].mser}function M(ee){ee.prelim=(ee.c[0].prelim+ee.c[0].mod+ee.c[ee.cs-1].mod+ee.c[ee.cs-1].prelim+ee.c[ee.cs-1].w)/2-ee.w/2}function V(ee,ie){ie+=ee.mod,ee.x=ee.prelim+ie,$(ee);for(var ce=0;ce=ce.low;)ce=ce.nxt;return{low:ee,index:ie,nxt:ce}}N(y,g);var te=U.fromNode(y,g);return p(te),V(te,0),P(te,y,g),D(y,g),y}},function(X,W,U){function Y(h,x){h.prototype=Object.create(x.prototype),h.prototype.constructor=h,B(h,x)}function B(h,x){return B=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(b,A){return b.__proto__=A,b},B(h,x)}var D=U(11),P=U(121),N=U(17),y=U(6),E=function(h){Y(x,h);function x(){return h.apply(this,arguments)||this}var m=x.prototype;return m.execute=function(){var A=this;return A.rootNode.width=0,N(A.rootNode,A.options,P)},x}(D),g={};function p(h,x){return x=y.assign({},g,x),new E(h,x).execute()}X.exports=p},function(X,W,U){var Y=U(6);function B(N,y){N===void 0&&(N=0),y===void 0&&(y=[]);var E=this;E.x=E.y=0,E.leftChild=E.rightChild=null,E.height=0,E.children=y}var D={isHorizontal:!0,nodeSep:20,nodeSize:20,rankSep:200,subTreeSep:10};function P(N,y,E){E?(y.x=N.x,y.y=N.y):(y.x=N.y,y.y=N.x),N.children.forEach(function(g,p){P(g,y.children[p],E)})}X.exports=function(N,y){y===void 0&&(y={}),y=Y.assign({},D,y);var E=0;function g(b){if(!b)return null;b.width=0,b.depth&&b.depth>E&&(E=b.depth);var A=b.children,k=A.length,G=new B(b.height,[]);return A.forEach(function(T,M){var V=g(T);G.children.push(V),M===0&&(G.leftChild=V),M===k-1&&(G.rightChild=V)}),G.originNode=b,G.isLeaf=b.isLeaf(),G}function p(b){if(b.isLeaf||b.children.length===0)b.drawingDepth=E;else{var A=b.children.map(function(G){return p(G)}),k=Math.min.apply(null,A);b.drawingDepth=k-1}return b.drawingDepth}var h;function x(b){b.x=b.drawingDepth*y.rankSep,b.isLeaf?(b.y=0,h&&(b.y=h.y+h.height+y.nodeSep,b.originNode.parent!==h.originNode.parent&&(b.y+=y.subTreeSep)),h=b):(b.children.forEach(function(A){x(A)}),b.y=(b.leftChild.y+b.rightChild.y)/2)}var m=g(N);return p(m),x(m),P(m,N,y.isHorizontal),N}},function(X,W,U){function Y(m,b){m.prototype=Object.create(b.prototype),m.prototype.constructor=m,B(m,b)}function B(m,b){return B=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(k,G){return k.__proto__=G,k},B(m,b)}var D=U(11),P=U(123),N=U(35),y=U(6),E=["LR","RL","H"],g=E[0],p=function(m){Y(b,m);function b(){return m.apply(this,arguments)||this}var A=b.prototype;return A.execute=function(){var G=this,T=G.options,M=G.rootNode;T.isHorizontal=!0;var V=T.indent,j=V===void 0?20:V,$=T.dropCap,q=$===void 0?!0:$,te=T.direction,ee=te===void 0?g:te,ie=T.align;if(ee&&E.indexOf(ee)===-1)throw new TypeError("Invalid direction: "+ee);if(ee===E[0])P(M,j,q,ie);else if(ee===E[1])P(M,j,q,ie),M.right2left();else if(ee===E[2]){var ce=N(M,T),ge=ce.left,Le=ce.right;P(ge,j,q,ie),ge.right2left(),P(Le,j,q,ie);var Oe=ge.getBoundingBox();Le.translate(Oe.width,0),M.x=Le.x-M.width/2}return M},b}(D),h={};function x(m,b){return b=y.assign({},h,b),new p(m,b).execute()}X.exports=x},function(X,W,U){var Y=U(6);function B(D,P,N,y,E){var g=typeof N=="function"?N(D):N*D.depth;if(!y)try{if(D.id===D.parent.children[0].id){D.x+=g,D.y=P?P.y:0;return}}catch(x){}if(D.x+=g,P){if(D.y=P.y+Y.getHeight(P,D,E),P.parent&&D.parent.id!==P.parent.id){var p=P.parent,h=p.y+Y.getHeight(p,D,E);D.y=h>D.y?h:D.y}}else D.y=0}X.exports=function(D,P,N,y){var E=null;D.eachNode(function(g){B(g,E,P,N,y),E=g})}},function(X,W,U){function Y(h,x){h.prototype=Object.create(x.prototype),h.prototype.constructor=h,B(h,x)}function B(h,x){return B=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(b,A){return b.__proto__=A,b},B(h,x)}var D=U(11),P=U(125),N=U(17),y=U(6),E=function(h){Y(x,h);function x(){return h.apply(this,arguments)||this}var m=x.prototype;return m.execute=function(){var A=this;return N(A.rootNode,A.options,P)},x}(D),g={};function p(h,x){return x=y.assign({},g,x),new E(h,x).execute()}X.exports=p},function(X,W,U){var Y=U(6);function B(N,y){var E=0;return N.children.length?N.children.forEach(function(g){E+=B(g,y)}):E=N.height,N._subTreeSep=y.getSubTreeSep(N.data),N.totalHeight=Math.max(N.height,E)+2*N._subTreeSep,N.totalHeight}function D(N){var y=N.children,E=y.length;if(E){y.forEach(function(b){D(b)});var g=y[0],p=y[E-1],h=p.y-g.y+p.height,x=0;if(y.forEach(function(b){x+=b.totalHeight}),h>N.height)N.y=g.y+h/2-N.height/2;else if(y.length!==1||N.height>x){var m=N.y+(N.height-h)/2-g.y;y.forEach(function(b){b.translate(0,m)})}else N.y=(g.y+g.height/2+p.y+p.height/2)/2-N.height/2}}var P={getSubTreeSep:function(){return 0}};X.exports=function(N,y){y===void 0&&(y={}),y=Y.assign({},P,y),N.parent={x:0,width:0,height:0,y:0},N.BFTraverse(function(E){E.x=E.parent.x+E.parent.width}),N.parent=null,B(N,y),N.startY=0,N.y=N.totalHeight/2-N.height/2,N.eachNode(function(E){var g=E.children,p=g.length;if(p){var h=g[0];if(h.startY=E.startY+E._subTreeSep,p===1)h.y=E.y+E.height/2-h.height/2;else{h.y=h.startY+h.totalHeight/2-h.height/2;for(var x=1;x=0;return m?A?Math.PI*2-b:b:A?b:Math.PI*2-b}U=g;function p(h,x,m){return m?(h[0]=x[1],h[1]=-1*x[0]):(h[0]=-1*x[1],h[1]=x[0]),h}U=p},59591:function(hr,X,W){var U=W(50008).default;function Y(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */hr.exports=Y=function(){return B},hr.exports.__esModule=!0,hr.exports.default=hr.exports;var B={},D=Object.prototype,P=D.hasOwnProperty,N=Object.defineProperty||function(Re,de,ve){Re[de]=ve.value},y=typeof Symbol=="function"?Symbol:{},E=y.iterator||"@@iterator",g=y.asyncIterator||"@@asyncIterator",p=y.toStringTag||"@@toStringTag";function h(Re,de,ve){return Object.defineProperty(Re,de,{value:ve,enumerable:!0,configurable:!0,writable:!0}),Re[de]}try{h({},"")}catch(Re){h=function(ve,be,Ae){return ve[be]=Ae}}function x(Re,de,ve,be){var Ae=de&&de.prototype instanceof A?de:A,Pe=Object.create(Ae.prototype),Ve=new ge(be||[]);return N(Pe,"_invoke",{value:te(Re,ve,Ve)}),Pe}function m(Re,de,ve){try{return{type:"normal",arg:Re.call(de,ve)}}catch(be){return{type:"throw",arg:be}}}B.wrap=x;var b={};function A(){}function k(){}function G(){}var T={};h(T,E,function(){return this});var M=Object.getPrototypeOf,V=M&&M(M(Le([])));V&&V!==D&&P.call(V,E)&&(T=V);var j=G.prototype=A.prototype=Object.create(T);function $(Re){["next","throw","return"].forEach(function(de){h(Re,de,function(ve){return this._invoke(de,ve)})})}function q(Re,de){function ve(Ae,Pe,Ve,Ue){var Ke=m(Re[Ae],Re,Pe);if(Ke.type!=="throw"){var _t=Ke.arg,Ct=_t.value;return Ct&&U(Ct)=="object"&&P.call(Ct,"__await")?de.resolve(Ct.__await).then(function(He){ve("next",He,Ve,Ue)},function(He){ve("throw",He,Ve,Ue)}):de.resolve(Ct).then(function(He){_t.value=He,Ve(_t)},function(He){return ve("throw",He,Ve,Ue)})}Ue(Ke.arg)}var be;N(this,"_invoke",{value:function(Pe,Ve){function Ue(){return new de(function(Ke,_t){ve(Pe,Ve,Ke,_t)})}return be=be?be.then(Ue,Ue):Ue()}})}function te(Re,de,ve){var be="suspendedStart";return function(Ae,Pe){if(be==="executing")throw new Error("Generator is already running");if(be==="completed"){if(Ae==="throw")throw Pe;return Oe()}for(ve.method=Ae,ve.arg=Pe;;){var Ve=ve.delegate;if(Ve){var Ue=ee(Ve,ve);if(Ue){if(Ue===b)continue;return Ue}}if(ve.method==="next")ve.sent=ve._sent=ve.arg;else if(ve.method==="throw"){if(be==="suspendedStart")throw be="completed",ve.arg;ve.dispatchException(ve.arg)}else ve.method==="return"&&ve.abrupt("return",ve.arg);be="executing";var Ke=m(Re,de,ve);if(Ke.type==="normal"){if(be=ve.done?"completed":"suspendedYield",Ke.arg===b)continue;return{value:Ke.arg,done:ve.done}}Ke.type==="throw"&&(be="completed",ve.method="throw",ve.arg=Ke.arg)}}}function ee(Re,de){var ve=de.method,be=Re.iterator[ve];if(be===void 0)return de.delegate=null,ve==="throw"&&Re.iterator.return&&(de.method="return",de.arg=void 0,ee(Re,de),de.method==="throw")||ve!=="return"&&(de.method="throw",de.arg=new TypeError("The iterator does not provide a '"+ve+"' method")),b;var Ae=m(be,Re.iterator,de.arg);if(Ae.type==="throw")return de.method="throw",de.arg=Ae.arg,de.delegate=null,b;var Pe=Ae.arg;return Pe?Pe.done?(de[Re.resultName]=Pe.value,de.next=Re.nextLoc,de.method!=="return"&&(de.method="next",de.arg=void 0),de.delegate=null,b):Pe:(de.method="throw",de.arg=new TypeError("iterator result is not an object"),de.delegate=null,b)}function ie(Re){var de={tryLoc:Re[0]};1 in Re&&(de.catchLoc=Re[1]),2 in Re&&(de.finallyLoc=Re[2],de.afterLoc=Re[3]),this.tryEntries.push(de)}function ce(Re){var de=Re.completion||{};de.type="normal",delete de.arg,Re.completion=de}function ge(Re){this.tryEntries=[{tryLoc:"root"}],Re.forEach(ie,this),this.reset(!0)}function Le(Re){if(Re){var de=Re[E];if(de)return de.call(Re);if(typeof Re.next=="function")return Re;if(!isNaN(Re.length)){var ve=-1,be=function Ae(){for(;++ve=0;--Ae){var Pe=this.tryEntries[Ae],Ve=Pe.completion;if(Pe.tryLoc==="root")return be("end");if(Pe.tryLoc<=this.prev){var Ue=P.call(Pe,"catchLoc"),Ke=P.call(Pe,"finallyLoc");if(Ue&&Ke){if(this.prev=0;--be){var Ae=this.tryEntries[be];if(Ae.tryLoc<=this.prev&&P.call(Ae,"finallyLoc")&&this.prev=0;--ve){var be=this.tryEntries[ve];if(be.finallyLoc===de)return this.complete(be.completion,be.afterLoc),ce(be),b}},catch:function(de){for(var ve=this.tryEntries.length-1;ve>=0;--ve){var be=this.tryEntries[ve];if(be.tryLoc===de){var Ae=be.completion;if(Ae.type==="throw"){var Pe=Ae.arg;ce(be)}return Pe}}throw new Error("illegal catch attempt")},delegateYield:function(de,ve,be){return this.delegate={iterator:Le(de),resultName:ve,nextLoc:be},this.method==="next"&&(this.arg=void 0),b}},B}hr.exports=Y,hr.exports.__esModule=!0,hr.exports.default=hr.exports},87757:function(hr,X,W){var U=W(59591)();hr.exports=U;try{regeneratorRuntime=U}catch(Y){typeof globalThis=="object"?globalThis.regeneratorRuntime=U:Function("r","regeneratorRuntime = r")(U)}},2482:function(hr,X,W){"use strict";W.r(X),W.d(X,{forceCenter:function(){return U},forceCollide:function(){return y},forceLink:function(){return p},forceManyBody:function(){return ge},forceRadial:function(){return Le},forceSimulation:function(){return ce},forceX:function(){return Oe},forceY:function(){return Re}});function U(de,ve){var be,Ae=1;de==null&&(de=0),ve==null&&(ve=0);function Pe(){var Ve,Ue=be.length,Ke,_t=0,Ct=0;for(Ve=0;Vemt.index){var aa=dt-We.x-We.vx,ri=Et-We.y-We.vy,Ia=aa*aa+ri*ri;Iadt+kn||InEt+kn||bnCt.r&&(Ct.r=Ct[He].r)}function _t(){if(!!ve){var Ct,He=ve.length,ht;for(be=new Array(He),Ct=0;Ct=0&&(Ae=be.slice(Pe+1),be=be.slice(0,Pe)),be&&!ve.hasOwnProperty(be))throw new Error("unknown type: "+be);return{type:be,name:Ae}})}m.prototype=x.prototype={constructor:m,on:function(ve,be){var Ae=this._,Pe=b(ve+"",Ae),Ve,Ue=-1,Ke=Pe.length;if(arguments.length<2){for(;++Ue0)for(var Ae=new Array(Ve),Pe=0,Ve,Ue;Pe1?($t==null?Ke.delete(St):Ke.set(St,Et($t)),ve):Ke.get(St)},find:function(St,$t,Nt){var mr=0,br=de.length,nn,In,bn,We,zn;for(Nt==null?Nt=Infinity:Nt*=Nt,mr=0;mr
1?(Ct.on(St,$t),ve):Ct.on(St)}}}function ge(){var de,ve,be,Ae,Pe=B(-30),Ve,Ue=1,Ke=Infinity,_t=.81;function Ct(dt){var Et,it=de.length,St=(0,Y.Z)(de,q,te).visitAfter(ht);for(Ae=dt,Et=0;Et=Ke)return;(dt.data!==ve||dt.next)&&($t===0&&($t=D(be),br+=$t*$t),Nt===0&&(Nt=D(be),br+=Nt*Nt),br1&&arguments[1]!==void 0?arguments[1]:{};if(!y(se))throw new TypeError("input must be an array");if(se.length===0)throw new TypeError("input must not be empty");var R=oe.fromIndex,_=R===void 0?0:R,C=oe.toIndex,H=C===void 0?se.length:C;if(_<0||_>=se.length||!Number.isInteger(_))throw new Error("fromIndex must be a positive integer smaller than length");if(H<=_||H>se.length||!Number.isInteger(H))throw new Error("toIndex must be an integer greater than fromIndex and at most equal to length");for(var ye=se[_],Ce=_+1;Ceye&&(ye=se[Ce]);return ye}function g(se){var oe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!y(se))throw new TypeError("input must be an array");if(se.length===0)throw new TypeError("input must not be empty");var R=oe.fromIndex,_=R===void 0?0:R,C=oe.toIndex,H=C===void 0?se.length:C;if(_<0||_>=se.length||!Number.isInteger(_))throw new Error("fromIndex must be a positive integer smaller than length");if(H<=_||H>se.length||!Number.isInteger(H))throw new Error("toIndex must be an integer greater than fromIndex and at most equal to length");for(var ye=se[_],Ce=_+1;Ce1&&arguments[1]!==void 0?arguments[1]:{};if(y(se)){if(se.length===0)throw new TypeError("input must not be empty")}else throw new TypeError("input must be an array");var R;if(oe.output!==void 0){if(!y(oe.output))throw new TypeError("output option must be an array if specified");R=oe.output}else R=new Array(se.length);var _=g(se),C=E(se);if(_===C)throw new RangeError("minimum and maximum input values are equal. Cannot rescale a constant array");var H=oe.min,ye=H===void 0?oe.autoMinMax?_:0:H,Ce=oe.max,_e=Ce===void 0?oe.autoMinMax?C:1:Ce;if(ye>=_e)throw new RangeError("min option must be smaller than max option");for(var Fe=(_e-ye)/(C-_),Mt=0;Mt1&&arguments[1]!==void 0?arguments[1]:{},R=oe.maxRows,_=R===void 0?15:R,C=oe.maxColumns,H=C===void 0?10:C,ye=oe.maxNumSize,Ce=ye===void 0?8:ye,_e=oe.padMinus,Fe=_e===void 0?"auto":_e;return"".concat(se.constructor.name,` {
+`).concat(h,`[
+`).concat(x).concat(A(se,_,H,Ce,Fe),`
+`).concat(h,`]
+`).concat(h,"rows: ").concat(se.rows,`
+`).concat(h,"columns: ").concat(se.columns,`
+}`)}function A(se,oe,R,_,C){var H=se.rows,ye=se.columns,Ce=Math.min(H,oe),_e=Math.min(ye,R),Fe=[];if(C==="auto"){C=!1;e:for(var Mt=0;Mt=0&&R?" ".concat(G(se,oe-1)):G(se,oe)).padEnd(oe)}function G(se,oe){var R=se.toString();if(R.length<=oe)return R;var _=se.toFixed(oe);if(_.length>oe&&(_=se.toFixed(Math.max(0,oe-(_.length-oe)))),_.length<=oe&&!_.startsWith("0.000")&&!_.startsWith("-0.000"))return _;var C=se.toExponential(oe);return C.length>oe&&(C=se.toExponential(Math.max(0,oe-(C.length-oe)))),C.slice(0)}function T(se,oe){se.prototype.add=function(_){return typeof _=="number"?this.addS(_):this.addM(_)},se.prototype.addS=function(_){for(var C=0;C>_);return this},se.prototype.signPropagatingRightShiftM=function(_){if(_=oe.checkMatrix(_),this.rows!==_.rows||this.columns!==_.columns)throw new RangeError("Matrices dimensions must be equal");for(var C=0;C>_.get(C,H));return this},se.signPropagatingRightShift=function(_,C){var H=new oe(_);return H.signPropagatingRightShift(C)},se.prototype.rightShift=function(_){return typeof _=="number"?this.rightShiftS(_):this.rightShiftM(_)},se.prototype.rightShiftS=function(_){for(var C=0;C>>_);return this},se.prototype.rightShiftM=function(_){if(_=oe.checkMatrix(_),this.rows!==_.rows||this.columns!==_.columns)throw new RangeError("Matrices dimensions must be equal");for(var C=0;C>>_.get(C,H));return this},se.rightShift=function(_,C){var H=new oe(_);return H.rightShift(C)},se.prototype.zeroFillRightShift=se.prototype.rightShift,se.prototype.zeroFillRightShiftS=se.prototype.rightShiftS,se.prototype.zeroFillRightShiftM=se.prototype.rightShiftM,se.zeroFillRightShift=se.rightShift,se.prototype.not=function(){for(var _=0;__)throw new RangeError("Row index out of range")}function V(se,oe,R){var _=R?se.columns:se.columns-1;if(oe<0||oe>_)throw new RangeError("Column index out of range")}function j(se,oe){if(oe.to1DArray&&(oe=oe.to1DArray()),oe.length!==se.columns)throw new RangeError("vector size must be the same as the number of columns");return oe}function $(se,oe){if(oe.to1DArray&&(oe=oe.to1DArray()),oe.length!==se.rows)throw new RangeError("vector size must be the same as the number of rows");return oe}function q(se,oe){if(!y(oe))throw new TypeError("row indices must be an array");for(var R=0;R=se.rows)throw new RangeError("row indices are out of range")}function te(se,oe){if(!y(oe))throw new TypeError("column indices must be an array");for(var R=0;R=se.columns)throw new RangeError("column indices are out of range")}function ee(se,oe,R,_,C){if(arguments.length!==5)throw new RangeError("expected 4 arguments");if(ce("startRow",oe),ce("endRow",R),ce("startColumn",_),ce("endColumn",C),oe>R||_>C||oe<0||oe>=se.rows||R<0||R>=se.rows||_<0||_>=se.columns||C<0||C>=se.columns)throw new RangeError("Submatrix indices are out of range")}function ie(se){for(var oe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,R=[],_=0;_C?(ye=!0,C=_):(H=!1,ye=!0);R++}return H}},{key:"isReducedEchelonForm",value:function(){for(var R=0,_=0,C=-1,H=!0,ye=!1;RC?(ye=!0,C=_):(H=!1,ye=!0);for(var Ce=_+1;CeR.get(H,C)&&(H=ye);if(R.get(H,C)===0)C++;else{R.swapRows(_,H);for(var Ce=R.get(_,C),_e=C;_e=0;)if(R.maxRow(H)===0)H--;else{for(var ye=0,Ce=!1;ye0&&arguments[0]!==void 0?arguments[0]:{};if(typeof R!="object")throw new TypeError("options must be an object");var _=R.rows,C=_===void 0?1:_,H=R.columns,ye=H===void 0?1:H;if(!Number.isInteger(C)||C<=0)throw new TypeError("rows must be a positive integer");if(!Number.isInteger(ye)||ye<=0)throw new TypeError("columns must be a positive integer");for(var Ce=new Nt(this.rows*C,this.columns*ye),_e=0;_e_[C]&&(_[C]=this.get(C,H));return _}case"column":{for(var ye=new Array(this.columns).fill(Number.NEGATIVE_INFINITY),Ce=0;Ceye[_e]&&(ye[_e]=this.get(Ce,_e));return ye}case void 0:{for(var Fe=this.get(0,0),Mt=0;MtFe&&(Fe=this.get(Mt,yt));return Fe}default:throw new Error("invalid option: ".concat(R))}}},{key:"maxIndex",value:function(){ge(this);for(var R=this.get(0,0),_=[0,0],C=0;CR&&(R=this.get(C,H),_[0]=C,_[1]=H);return _}},{key:"min",value:function(R){if(this.isEmpty())return NaN;switch(R){case"row":{for(var _=new Array(this.rows).fill(Number.POSITIVE_INFINITY),C=0;C_&&(_=this.get(R,C));return _}},{key:"maxRowIndex",value:function(R){M(this,R),ge(this);for(var _=this.get(R,0),C=[R,0],H=1;H_&&(_=this.get(R,H),C[1]=H);return C}},{key:"minRow",value:function(R){if(M(this,R),this.isEmpty())return NaN;for(var _=this.get(R,0),C=1;C_&&(_=this.get(C,R));return _}},{key:"maxColumnIndex",value:function(R){V(this,R),ge(this);for(var _=this.get(0,R),C=[0,R],H=1;H_&&(_=this.get(H,R),C[0]=H);return C}},{key:"minColumn",value:function(R){if(V(this,R),this.isEmpty())return NaN;for(var _=this.get(0,R),C=1;C0&&arguments[0]!==void 0?arguments[0]:"frobenius",_=0;if(R==="max")return this.max();if(R==="frobenius"){for(var C=0;C0&&arguments[0]!==void 0?arguments[0]:{};if(typeof R!="object")throw new TypeError("options must be an object");var _=R.min,C=_===void 0?0:_,H=R.max,ye=H===void 0?1:H;if(!Number.isFinite(C))throw new TypeError("min must be a number");if(!Number.isFinite(ye))throw new TypeError("max must be a number");if(C>=ye)throw new RangeError("min must be smaller than max");for(var Ce=new Nt(this.rows,this.columns),_e=0;_e0&&p(Fe,{min:C,max:ye,output:Fe}),Ce.setRow(_e,Fe)}return Ce}},{key:"scaleColumns",value:function(){var R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(typeof R!="object")throw new TypeError("options must be an object");var _=R.min,C=_===void 0?0:_,H=R.max,ye=H===void 0?1:H;if(!Number.isFinite(C))throw new TypeError("min must be a number");if(!Number.isFinite(ye))throw new TypeError("max must be a number");if(C>=ye)throw new RangeError("min must be smaller than max");for(var Ce=new Nt(this.rows,this.columns),_e=0;_e0&&arguments[0]!==void 0?arguments[0]:St,_=0;_0&&arguments[0]!==void 0?arguments[0]:St,_=0;_C||_<0||_>=this.columns||C<0||C>=this.columns)throw new RangeError("Argument out of range");for(var H=new Nt(R.length,C-_+1),ye=0;ye=this.rows)throw new RangeError("Row index out of range: ".concat(R[ye]));H.set(ye,Ce-_,this.get(R[ye],Ce))}return H}},{key:"subMatrixColumn",value:function(R,_,C){if(_===void 0&&(_=0),C===void 0&&(C=this.rows-1),_>C||_<0||_>=this.rows||C<0||C>=this.rows)throw new RangeError("Argument out of range");for(var H=new Nt(C-_+1,R.length),ye=0;ye=this.columns)throw new RangeError("Column index out of range: ".concat(R[ye]));H.set(Ce-_,ye,this.get(Ce,R[ye]))}return H}},{key:"setSubMatrix",value:function(R,_,C){if(R=Nt.checkMatrix(R),R.isEmpty())return this;var H=_+R.rows-1,ye=C+R.columns-1;ee(this,_,H,C,ye);for(var Ce=0;Ce1&&arguments[1]!==void 0?arguments[1]:{};if(typeof R=="object"&&(_=R,R=void 0),typeof _!="object")throw new TypeError("options must be an object");var C=_,H=C.unbiased,ye=H===void 0?!0:H,Ce=C.mean,_e=Ce===void 0?this.mean(R):Ce;if(typeof ye!="boolean")throw new TypeError("unbiased must be a boolean");switch(R){case"row":{if(!y(_e))throw new TypeError("mean must be an array");return Ae(this,ye,_e)}case"column":{if(!y(_e))throw new TypeError("mean must be an array");return Pe(this,ye,_e)}case void 0:{if(typeof _e!="number")throw new TypeError("mean must be a number");return Ve(this,ye,_e)}default:throw new Error("invalid option: ".concat(R))}}},{key:"standardDeviation",value:function(R,_){typeof R=="object"&&(_=R,R=void 0);var C=this.variance(R,_);if(R===void 0)return Math.sqrt(C);for(var H=0;H1&&arguments[1]!==void 0?arguments[1]:{};if(typeof R=="object"&&(_=R,R=void 0),typeof _!="object")throw new TypeError("options must be an object");var C=_,H=C.center,ye=H===void 0?this.mean(R):H;switch(R){case"row":{if(!y(ye))throw new TypeError("center must be an array");return Ue(this,ye),this}case"column":{if(!y(ye))throw new TypeError("center must be an array");return Ke(this,ye),this}case void 0:{if(typeof ye!="number")throw new TypeError("center must be a number");return _t(this,ye),this}default:throw new Error("invalid option: ".concat(R))}}},{key:"scale",value:function(R){var _=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(typeof R=="object"&&(_=R,R=void 0),typeof _!="object")throw new TypeError("options must be an object");var C=_.scale;switch(R){case"row":{if(C===void 0)C=Ct(this);else if(!y(C))throw new TypeError("scale must be an array");return He(this,C),this}case"column":{if(C===void 0)C=ht(this);else if(!y(C))throw new TypeError("scale must be an array");return mt(this,C),this}case void 0:{if(C===void 0)C=dt(this);else if(typeof C!="number")throw new TypeError("scale must be a number");return Et(this,C),this}default:throw new Error("invalid option: ".concat(R))}}},{key:"toString",value:function(R){return b(this,R)}}],[{key:"from1DArray",value:function(R,_,C){var H=R*_;if(H!==C.length)throw new RangeError("data length does not match given dimensions");for(var ye=new Nt(R,_),Ce=0;Ce2&&arguments[2]!==void 0?arguments[2]:{};if(typeof C!="object")throw new TypeError("options must be an object");for(var H=C.random,ye=H===void 0?Math.random:H,Ce=new Nt(R,_),_e=0;_e2&&arguments[2]!==void 0?arguments[2]:{};if(typeof C!="object")throw new TypeError("options must be an object");var H=C.min,ye=H===void 0?0:H,Ce=C.max,_e=Ce===void 0?1e3:Ce,Fe=C.random,Mt=Fe===void 0?Math.random:Fe;if(!Number.isInteger(ye))throw new TypeError("min must be an integer");if(!Number.isInteger(_e))throw new TypeError("max must be an integer");if(ye>=_e)throw new RangeError("min must be smaller than max");for(var yt=_e-ye,Ut=new Nt(R,_),rr=0;rr=0)if(H.data=[],Number.isInteger(C)&&C>=0)for(var ye=0;ye<_;ye++)H.data.push(new Float64Array(C));else throw new TypeError("nColumns must be a positive integer");else if(y(_)){var Ce=_;if(_=Ce.length,C=_?Ce[0].length:0,typeof C!="number")throw new TypeError("Data must be a 2D array with at least one element");H.data=[];for(var _e=0;_e<_;_e++){if(Ce[_e].length!==C)throw new RangeError("Inconsistent array dimensions");if(!$t(Ce[_e]))throw new TypeError("Input data contains non-numeric values");H.data.push(Float64Array.from(Ce[_e]))}}else throw new TypeError("First argument must be a positive number or an array");return H.rows=_,H.columns=C,H}return(0,P.Z)(R,[{key:"set",value:function(C,H,ye){return this.data[C][H]=ye,this}},{key:"get",value:function(C,H){return this.data[C][H]}},{key:"removeRow",value:function(C){return M(this,C),this.data.splice(C,1),this.rows-=1,this}},{key:"addRow",value:function(C,H){return H===void 0&&(H=C,C=this.rows),M(this,C,!0),H=Float64Array.from(j(this,H)),this.data.splice(C,0,H),this.rows+=1,this}},{key:"removeColumn",value:function(C){V(this,C);for(var H=0;H1&&arguments[1]!==void 0?arguments[1]:{};(0,D.Z)(this,R);var ye=H.rows,Ce=ye===void 0?1:ye;if(_.length%Ce!=0)throw new Error("the data length is not divisible by the number of rows");return C=oe.call(this),C.rows=Ce,C.columns=_.length/Ce,C.data=_,C}return(0,P.Z)(R,[{key:"set",value:function(C,H,ye){var Ce=this._calculateIndex(C,H);return this.data[Ce]=ye,this}},{key:"get",value:function(C,H){var ye=this._calculateIndex(C,H);return this.data[ye]}},{key:"_calculateIndex",value:function(C,H){return C*this.columns+H}}]),R}(it),za=function(se){(0,Y.Z)(R,se);var oe=(0,B.Z)(R);function R(_){var C;return(0,D.Z)(this,R),C=oe.call(this),C.data=_,C.rows=_.length,C.columns=_[0].length,C}return(0,P.Z)(R,[{key:"set",value:function(C,H,ye){return this.data[C][H]=ye,this}},{key:"get",value:function(C,H){return this.data[C][H]}}]),R}(it);function Aa(se,oe){if(y(se))return se[0]&&y(se[0])?new za(se):new Ia(se,oe);throw new Error("the argument is not an array")}var Qa=function(){function se(oe){(0,D.Z)(this,se),oe=za.checkMatrix(oe);var R=oe.clone(),_=R.rows,C=R.columns,H=new Float64Array(_),ye=1,Ce,_e,Fe,Mt,yt,Ut,rr,Zt,zr;for(Ce=0;Ce<_;Ce++)H[Ce]=Ce;for(Zt=new Float64Array(_),_e=0;_eMath.abs(Zt[Mt])&&(Mt=Ce);if(Mt!==_e){for(Fe=0;Fe=0;Mt--){for(Fe=0;FeCe?H.set(ye,Ce,R.get(ye,Ce)):ye===Ce?H.set(ye,Ce,1):H.set(ye,Ce,0);return H}},{key:"upperTriangularMatrix",get:function(){for(var R=this.LU,_=R.rows,C=R.columns,H=new Nt(_,C),ye=0;ye<_;ye++)for(var Ce=0;CeMath.abs(oe)?(R=oe/se,Math.abs(se)*Math.sqrt(1+R*R)):oe!==0?(R=se/oe,Math.abs(oe)*Math.sqrt(1+R*R)):0}var La=function(){function se(oe){(0,D.Z)(this,se),oe=za.checkMatrix(oe);var R=oe.clone(),_=oe.rows,C=oe.columns,H=new Float64Array(C),ye,Ce,_e,Fe;for(_e=0;_e=0;Mt--){for(Fe=0;Fe=0;_e--){for(ye=0;ye<_;ye++)H.set(ye,_e,0);for(H.set(_e,_e,1),Ce=_e;Ce1&&arguments[1]!==void 0?arguments[1]:{};if((0,D.Z)(this,se),oe=za.checkMatrix(oe),oe.isEmpty())throw new Error("Matrix must be non-empty");var _=oe.rows,C=oe.columns,H=R.computeLeftSingularVectors,ye=H===void 0?!0:H,Ce=R.computeRightSingularVectors,_e=Ce===void 0?!0:Ce,Fe=R.autoTranspose,Mt=Fe===void 0?!1:Fe,yt=Boolean(ye),Ut=Boolean(_e),rr=!1,Zt;if(_=0;ja--)if(ir[ja]!==0){for(var Co=ja+1;Co=0;Yi--){if(Yi0;){var Dn=void 0,Io=void 0;for(Dn=Na-2;Dn>=-1&&Dn!==-1;Dn--){var ls=Number.MIN_VALUE+po*Math.abs(ir[Dn]+Math.abs(ir[Dn+1]));if(Math.abs(Wr[Dn])<=ls||Number.isNaN(Wr[Dn])){Wr[Dn]=0;break}}if(Dn===Na-2)Io=4;else{var Ei=void 0;for(Ei=Na-1;Ei>=Dn&&Ei!==Dn;Ei--){var ns=(Ei!==Na?Math.abs(Wr[Ei]):0)+(Ei!==Dn+1?Math.abs(Wr[Ei-1]):0);if(Math.abs(ir[Ei])<=po*ns){ir[Ei]=0;break}}Ei===Dn?Io=3:Ei===Na-1?Io=1:(Io=2,Dn=Ei)}switch(Dn++,Io){case 1:{var ds=Wr[Na-2];Wr[Na-2]=0;for(var Qi=Na-2;Qi>=Dn;Qi--){var Uo=Oa(ir[Qi],ds),Wo=ir[Qi]/Uo,qi=ds/Uo;if(ir[Qi]=Uo,Qi!==Dn&&(ds=-qi*Wr[Qi-1],Wr[Qi-1]=Wo*Wr[Qi-1]),Ut)for(var ao=0;ao