=0&&"break"!==x(p);p--);if(v)return et.splice(n,1),"continue";i.edges=l;var w=(0,a.default)(i,i.nodes[0].id,!1).length;if(Object.keys(w).reverse().forEach(function(t){if(t!==i.nodes[0].id&&!v){if(w[t]===1/0){var e=u[t].node[m];if(s[e]--,s[e]nt[n][nt[n].length-1]){if(e=u[t].node[m],s[e]--,s[e] =0;E--){var k=i.nodes[E],T=u[k.id].degree,O=u[k.id].inDegree,A=u[k.id].outDegree,L=k[m],j=g(Z,L,P,M),N=j.minPatternNodeLabelDegree,R=j.minPatternNodeLabelInDegree,D=j.minPatternNodeLabelOutDegree;if(r?T =0;B--){var F=l[B];if(!u[F.source]||!u[F.target]){l.splice(B,1);var z=F[b];if(c[z]--,u[F.source]&&(u[F.source].degree--,u[F.source].outDegree--),u[F.target]&&(u[F.target].degree--,u[F.target].inDegree--),I[z]&&c[z]=0&&"break"!==it(ot);ot--);var at=et.length,st=function(t){var e={};et[t].edges.forEach(function(t){var r="".concat(t.source,"-").concat(t.target,"-").concat(t.label);e[r]?e[r]++:e[r]=1});for(var r=function(t){var r={};et[t].edges.forEach(function(t){var e="".concat(t.source,"-").concat(t.target,"-").concat(t.label);r[e]?r[e]++:r[e]=1});var n=!0;Object.keys(r).length!==Object.keys(e).length?n=!1:Object.keys(e).forEach(function(t){r[t]!==e[t]&&(n=!1)}),n&&et.splice(t,1)},n=at-1;n>t;n--)r(n);at=et.length};for(ot=0;ot<=at-1;ot++)st(ot);return et}}};e.default=m},8683:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n,i=(n=r(6018))&&n.__esModule?n:{default:n},o=r(5696);var a=function(t,e,r,n){void 0===e&&(e=!1),void 0===r&&(r="weight"),void 0===n&&(n=1e3);var a=t.nodes,s=void 0===a?[]:a,u=t.edges,l=void 0===u?[]:u,c={},f={};s.forEach(function(t,e){var r=(0,o.uniqueId)();t.clusterId=r,c[r]={id:r,nodes:[t]},f[t.id]={node:t,idx:e}});var h=[],p={};(0,i.default)(t,e).forEach(function(t,e){var r=0,n=s[e].id;p[n]={},t.forEach(function(t,e){if(t){r+=t;var i=s[e].id;p[n][i]=t}}),h.push(r)});for(var d=0,y=function(){var t=!1;if(s.forEach(function(e){var r={};Object.keys(p[e.id]).forEach(function(t){var n=p[e.id][t],i=f[t].node.clusterId;r[i]||(r[i]=0),r[i]+=n});var n=-1/0,i=[];if(Object.keys(r).forEach(function(t){n =0&&i.splice(o,1),i&&i.length){t=!0;var a=c[e.clusterId],s=a.nodes.indexOf(e);a.nodes.splice(s,1);var u=Math.floor(Math.random()*i.length),l=c[i[u]];l.nodes.push(e),e.clusterId=l.id}}}),!t)return"break";d++};d 0&&A>P&&A-P P&&(I=v.map(function(t){return{node:t,clusterId:t.clusterId}}),L=(0,n.clone)(S),P=A),j||M>100)break;M++,Object.keys(S).forEach(function(t){var e=0;m.forEach(function(n){var i=n.source,o=n.target,a=E[i].node.clusterId,s=E[o].node.clusterId;(a===t&&s!==t||s===t&&a!==t)&&(e+=n[r]||1)}),S[t].sumTot=e}),v.forEach(function(t,e){var n,i=S[t.clusterId],o=0,a=T[e]/(2*O),s=0,l=i.nodes;l.forEach(function(t){var r=E[t.id].idx;s+=k[e][r]||0});var f=s-i.sumTot*a,h=l.filter(function(e){return e.id!==t.id}),p=[];h.forEach(function(t,e){p[e]=b[t.originIndex]});var y=c(h,b)*d,v=C[t.id];if(Object.keys(v).forEach(function(r){var i=E[r].node.clusterId;if(i!==t.clusterId){var s=S[i],l=s.nodes;if(l&&l.length){var h=0;l.forEach(function(t){var r=E[t.id].idx;h+=k[e][r]||0});var p=h-s.sumTot*a,v=l.concat([t]),g=[];v.forEach(function(t,e){g[e]=b[t.originIndex]});var m=c(v,b)*d,x=p-f;u&&(x=p+m-(f+y)),x>o&&(o=x,n=s)}}}),o>0){n.nodes.push(t);var g=t.clusterId;t.clusterId=n.id;var x=i.nodes.indexOf(t);i.nodes.splice(x,1);var w=0,_=0;m.forEach(function(t){var e=t.source,i=t.target,o=E[e].node.clusterId,a=E[i].node.clusterId;(o===n.id&&a!==n.id||a===n.id&&o!==n.id)&&(w+=t[r]||1),(o===g&&a!==g||a===g&&o!==g)&&(_+=t[r]||1)}),n.sumTot=w,i.sumTot=_}})}var N={},R=0;Object.keys(L).forEach(function(t){var e=L[t];if(e.nodes&&e.nodes.length){var r=String(R+1);r!==t&&(e.id=r,e.nodes=e.nodes.map(function(t){return{id:t.id,clusterId:r}}),L[r]=e,N[t]=r,delete L[t],R++)}else delete L[t]}),I.forEach(function(t){var e=t.node,r=t.clusterId;e&&(e.clusterId=r,e.clusterId&&N[e.clusterId]&&(e.clusterId=N[e.clusterId]))});var D=[],B={};m.forEach(function(t){var e=t.source,n=t.target,i=t[r]||1,o=E[e].node.clusterId,a=E[n].node.clusterId;if(o&&a){var s="".concat(o,"---").concat(a);if(B[s])B[s].weight+=i,B[s].count++;else{var u={source:o,target:a,weight:i,count:1};B[s]=u,D.push(u)}}});var F=[];return Object.keys(L).forEach(function(t){F.push(L[t])}),{clusters:F,clusterEdges:D}};e.default=f},9324:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=a(r(8882)),i=a(r(4073)),o=r(5696);function a(t){return t&&t.__esModule?t:{default:t}}var s=function(t,e){var r=[],n=t.nodes,a=void 0===n?[]:n,s=t.edges,u=void 0===s?[]:s;if(0===a.length)return r;var l=a[0],c=new Set;c.add(l);var f=new i.default(function(t,r){return e?t.weight-r.weight:0});for((0,o.getEdgesByNodeId)(l.id,u).forEach(function(t){f.insert(t)});!f.isEmpty();){var h=f.delMin(),p=h.source,d=h.target;c.has(p)&&c.has(d)||(r.push(h),c.has(p)||(c.add(p),(0,o.getEdgesByNodeId)(p,u).forEach(function(t){f.insert(t)})),c.has(d)||(c.add(d),(0,o.getEdgesByNodeId)(d,u).forEach(function(t){f.insert(t)})))}return r},u=function(t,e){var r=[],i=t.nodes,o=void 0===i?[]:i,a=t.edges,s=void 0===a?[]:a;if(0===o.length)return r;var u=s.map(function(t){return t});e&&u.sort(function(t,e){return t.weight-e.weight});for(var l=new n.default(o.map(function(t){return t.id}));u.length>0;){var c=u.shift(),f=c.source,h=c.target;l.connected(f,h)||(r.push(c),l.union(f,h))}return r},l=function(t,e,r){return r?{prim:s,kruskal:u}[r](t,e):u(t,e)};e.default=l},2653:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n,i=(n=r(5240))&&n.__esModule?n:{default:n},o=r(5696);var a=function(t,e,r){"number"!=typeof e&&(e=1e-6),"number"!=typeof r&&(r=.85);for(var n,a=1,s=0,u=1e3,l=t.nodes,c=void 0===l?[]:l,f=t.edges,h=void 0===f?[]:f,p=c.length,d={},y={},v=0;v 0&&a>e;){for(s=0,v=0;v
0&&(n+=y[w]/_)}d[m]=r*n,s+=d[m]}}for(s=(1-s)/p,a=0,v=0;v
0&&(this.list[0]=e,this.moveDown(0)),t},t.prototype.insert=function(t){if(null!==t){this.list.push(t);var e=this.list.length-1;return this.moveUp(e),!0}return!1},t.prototype.moveUp=function(t){for(var e=this.getParent(t);t&&t>0&&this.compareFn(this.list[e],this.list[t])>0;){var r=this.list[e];this.list[e]=this.list[t],this.list[t]=r,t=e,e=this.getParent(t)}},t.prototype.moveDown=function(t){var e,r=t,n=this.getLeft(t),i=this.getRight(t),o=this.list.length;null!==n&&n
0?r=n:null!==i&&i 0&&(r=i),t!==r&&(e=[this.list[r],this.list[t]],this.list[t]=e[0],this.list[r]=e[1],this.moveDown(r))},t}();e.default=n},7875:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.LinkedListNode=void 0;var r=function(t,e){return t===e},n=function(){function t(t,e){void 0===e&&(e=null),this.value=t,this.next=e}return t.prototype.toString=function(t){return t?t(this.value):"".concat(this.value)},t}();e.LinkedListNode=n;var i=function(){function t(t){void 0===t&&(t=r),this.head=null,this.tail=null,this.compare=t}return t.prototype.prepend=function(t){var e=new n(t,this.head);return this.head=e,this.tail||(this.tail=e),this},t.prototype.append=function(t){var e=new n(t);return this.head?(this.tail.next=e,this.tail=e,this):(this.head=e,this.tail=e,this)},t.prototype.delete=function(t){if(!this.head)return null;for(var e=null;this.head&&this.compare(this.head.value,t);)e=this.head,this.head=this.head.next;var r=this.head;if(null!==r)for(;r.next;)this.compare(r.next.value,t)?(e=r.next,r.next=r.next.next):r=r.next;return this.compare(this.tail.value,t)&&(this.tail=r),e},t.prototype.find=function(t){var e=t.value,r=void 0===e?void 0:e,n=t.callback,i=void 0===n?void 0:n;if(!this.head)return null;for(var o=this.head;o;){if(i&&i(o.value))return o;if(void 0!==r&&this.compare(o.value,r))return o;o=o.next}return null},t.prototype.deleteTail=function(){var t=this.tail;if(this.head===this.tail)return this.head=null,this.tail=null,t;for(var e=this.head;e.next;)e.next.next?e=e.next:e.next=null;return this.tail=e,t},t.prototype.deleteHead=function(){if(!this.head)return null;var t=this.head;return this.head.next?this.head=this.head.next:(this.head=null,this.tail=null),t},t.prototype.fromArray=function(t){var e=this;return t.forEach(function(t){return e.append(t)}),this},t.prototype.toArray=function(){for(var t=[],e=this.head;e;)t.push(e),e=e.next;return t},t.prototype.reverse=function(){for(var t=this.head,e=null,r=null;t;)r=t.next,t.next=e,e=t,t=r;this.tail=this.head,this.head=e},t.prototype.toString=function(t){return void 0===t&&(t=void 0),this.toArray().map(function(e){return e.toString(t)}).toString()},t}();e.default=i},2500:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n,i=(n=r(7875))&&n.__esModule?n:{default:n};var o=function(){function t(){this.linkedList=new i.default}return t.prototype.isEmpty=function(){return!this.linkedList.head},t.prototype.peek=function(){return this.linkedList.head?this.linkedList.head.value:null},t.prototype.enqueue=function(t){this.linkedList.append(t)},t.prototype.dequeue=function(){var t=this.linkedList.deleteHead();return t?t.value:null},t.prototype.toString=function(t){return this.linkedList.toString(t)},t}();e.default=o},8882:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=function(){function t(t){this.count=t.length,this.parent={};for(var e=0,r=t;e >8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===r?C(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===r?C(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=v.exec(t))?new A(e[1],e[2],e[3],1):(e=g.exec(t))?new A(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=m.exec(t))?C(e[1],e[2],e[3],e[4]):(e=b.exec(t))?C(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=x.exec(t))?N(e[1],e[2]/100,e[3]/100,1):(e=w.exec(t))?N(e[1],e[2]/100,e[3]/100,e[4]):_.hasOwnProperty(t)?T(_[t]):"transparent"===t?new A(NaN,NaN,NaN,0):null}function T(t){return new A(t>>16&255,t>>8&255,255&t,1)}function C(t,e,r,n){return n<=0&&(t=e=r=NaN),new A(t,e,r,n)}function O(t,e,r,n){return 1===arguments.length?((i=t)instanceof f||(i=k(i)),i?new A((i=i.rgb()).r,i.g,i.b,i.opacity):new A):new A(t,e,r,null==n?1:n);var i}function A(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}function P(){return"#".concat(j(this.r)).concat(j(this.g)).concat(j(this.b))}function M(){var t=I(this.opacity);return"".concat(1===t?"rgb(":"rgba(").concat(L(this.r),", ").concat(L(this.g),", ").concat(L(this.b)).concat(1===t?")":", ".concat(t,")"))}function I(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function L(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function j(t){return((t=L(t))<16?"0":"")+t.toString(16)}function N(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new D(t,e,r,n)}function R(t){if(t instanceof D)return new D(t.h,t.s,t.l,t.opacity);if(t instanceof f||(t=k(t)),!t)return new D;if(t instanceof D)return t;var e=(t=t.rgb()).r/255,r=t.g/255,n=t.b/255,i=Math.min(e,r,n),o=Math.max(e,r,n),a=NaN,s=o-i,u=(o+i)/2;return s?(a=e===o?(r-n)/s+6*(r 0&&u<1?0:a,new D(a,s,u,t.opacity)}function D(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}function B(t){return(t=(t||0)%360)<0?t+360:t}function F(t){return Math.max(0,Math.min(1,t||0))}function z(t,e,r){return 255*(t<60?e+(r-e)*t/60:t<180?r:t<240?e+(r-e)*(240-t)/60:e)}function G(t,e,r,n,i){var o=t*t,a=o*t;return((1-3*t+3*o-a)*e+(4-6*o+3*a)*r+(1+3*t+3*o-3*a)*n+a*i)/6}l(f,k,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:S,formatHex:S,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return R(this).formatHsl()},formatRgb:E,toString:E}),l(A,O,c(f,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new A(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new A(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},clamp:function(){return new A(L(this.r),L(this.g),L(this.b),I(this.opacity))},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:P,formatHex:P,formatHex8:function(){return"#".concat(j(this.r)).concat(j(this.g)).concat(j(this.b)).concat(j(255*(isNaN(this.opacity)?1:this.opacity)))},formatRgb:M,toString:M})),l(D,function(t,e,r,n){return 1===arguments.length?R(t):new D(t,e,r,null==n?1:n)},c(f,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new D(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new D(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*e,i=2*r-n;return new A(z(t>=240?t-240:t+120,i,n),z(t,i,n),z(t<120?t+240:t-120,i,n),this.opacity)},clamp:function(){return new D(B(this.h),F(this.s),F(this.l),I(this.opacity))},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var t=I(this.opacity);return"".concat(1===t?"hsl(":"hsla(").concat(B(this.h),", ").concat(100*F(this.s),"%, ").concat(100*F(this.l),"%").concat(1===t?")":", ".concat(t,")"))}}));var U=function(t){return function(){return t}};function V(t,e){return function(r){return t+r*e}}function H(t){return 1==(t=+t)?W:function(e,r){return r-e?function(t,e,r){return t=Math.pow(t,r),e=Math.pow(e,r)-t,r=1/r,function(n){return Math.pow(t+n*e,r)}}(e,r,t):U(isNaN(e)?r:e)}}function W(t,e){var r=e-t;return r?V(t,r):U(isNaN(t)?e:t)}var q=function t(e){var r=H(e);function n(t,e){var n=r((t=O(t)).r,(e=O(e)).r),i=r(t.g,e.g),o=r(t.b,e.b),a=W(t.opacity,e.opacity);return function(e){return t.r=n(e),t.g=i(e),t.b=o(e),t.opacity=a(e),t+""}}return n.gamma=t,n}(1);function Y(t){return function(e){var r,n,i=e.length,o=new Array(i),a=new Array(i),s=new Array(i);for(r=0;r=1?(r=1,e-1):Math.floor(r*e),i=t[n],o=t[n+1],a=n>0?t[n-1]:2*i-o,s=n o&&(i=e.slice(o,i),s[a]?s[a]+=i:s[++a]=i),(r=r[0])===(n=n[0])?s[a]?s[a]+=n:s[++a]=n:(s[++a]=null,u.push({i:a,x:J(r,n)})),o=tt.lastIndex;return o h.length?(f=it.parsePathString(o[c]),h=it.parsePathString(i[c]),h=it.fillPathByDiff(h,f),h=it.formatPath(h,f),e.fromAttrs.path=h,e.toAttrs.path=f):e.pathFormatted||(f=it.parsePathString(o[c]),h=it.parsePathString(i[c]),h=it.formatPath(h,f),e.fromAttrs.path=h,e.toAttrs.path=f,e.pathFormatted=!0),n[c]=[];for(var p=0;p 0){for(var o=n.animators.length-1;o>=0;o--)if((t=n.animators[o]).destroyed)n.removeAnimator(o);else{if(!t.isAnimatePaused())for(var a=(e=t.get("animations")).length-1;a>=0;a--)r=e[a],ut(t,r,i)&&(e.splice(a,1),!1,r.callback&&r.callback());0===e.length&&n.removeAnimator(o)}n.canvas.get("autoDraw")||n.canvas.draw()}})},t.prototype.addAnimator=function(t){this.animators.push(t)},t.prototype.removeAnimator=function(t){this.animators.splice(t,1)},t.prototype.isAnimating=function(){return!!this.animators.length},t.prototype.stop=function(){this.timer&&this.timer.stop()},t.prototype.stopAllAnimations=function(t){void 0===t&&(t=!0),this.animators.forEach(function(e){e.stopAnimate(t)}),this.animators=[],this.canvas.draw()},t.prototype.getTime=function(){return this.current},t}(),ct=r(7158),ft=["mousedown","mouseup","dblclick","mouseout","mouseover","mousemove","mouseleave","mouseenter","touchstart","touchmove","touchend","dragenter","dragover","dragleave","drop","contextmenu","mousewheel"];function ht(t,e,r){r.name=e,r.target=t,r.currentTarget=t,r.delegateTarget=t,t.emit(e,r)}function pt(t,e,r){if(r.bubbles){var n=void 0,i=!1;if("mouseenter"===e?(n=r.fromShape,i=!0):"mouseleave"===e&&(i=!0,n=r.toShape),t.isCanvas()&&i)return;if(n&&(0,a.pu)(t,n))return void(r.bubbles=!1);r.name=e,r.currentTarget=t,r.delegateTarget=t,t.emit(e,r)}}var dt=function(){function t(t){var e=this;this.draggingShape=null,this.dragging=!1,this.currentShape=null,this.mousedownShape=null,this.mousedownPoint=null,this._eventCallback=function(t){var r=t.type;e._triggerEvent(r,t)},this._onDocumentMove=function(t){if(e.canvas.get("el")!==t.target&&(e.dragging||e.currentShape)){var r=e._getPointInfo(t);e.dragging&&e._emitEvent("drag",t,r,e.draggingShape)}},this._onDocumentMouseUp=function(t){if(e.canvas.get("el")!==t.target&&e.dragging){var r=e._getPointInfo(t);e.draggingShape&&e._emitEvent("drop",t,r,null),e._emitEvent("dragend",t,r,e.draggingShape),e._afterDrag(e.draggingShape,r,t)}},this.canvas=t.canvas}return t.prototype.init=function(){this._bindEvents()},t.prototype._bindEvents=function(){var t=this,e=this.canvas.get("el");(0,a.__)(ft,function(r){e.addEventListener(r,t._eventCallback)}),document&&(document.addEventListener("mousemove",this._onDocumentMove),document.addEventListener("mouseup",this._onDocumentMouseUp))},t.prototype._clearEvents=function(){var t=this,e=this.canvas.get("el");(0,a.__)(ft,function(r){e.removeEventListener(r,t._eventCallback)}),document&&(document.removeEventListener("mousemove",this._onDocumentMove),document.removeEventListener("mouseup",this._onDocumentMouseUp))},t.prototype._getEventObj=function(t,e,r,n,i,o){var a=new ct.A(t,e);return a.fromShape=i,a.toShape=o,a.x=r.x,a.y=r.y,a.clientX=r.clientX,a.clientY=r.clientY,a.propagationPath.push(n),a},t.prototype._getShape=function(t,e){return this.canvas.getShape(t.x,t.y,e)},t.prototype._getPointInfo=function(t){var e=this.canvas,r=e.getClientByEvent(t),n=e.getPointByEvent(t);return{x:n.x,y:n.y,clientX:r.x,clientY:r.y}},t.prototype._triggerEvent=function(t,e){var r=this._getPointInfo(e),n=this._getShape(r,e),i=this["_on"+t],o=!1;if(i)i.call(this,r,n,e);else{var a=this.currentShape;"mouseenter"===t||"dragenter"===t||"mouseover"===t?(this._emitEvent(t,e,r,null,null,n),n&&this._emitEvent(t,e,r,n,null,n),"mouseenter"===t&&this.draggingShape&&this._emitEvent("dragenter",e,r,null)):"mouseleave"===t||"dragleave"===t||"mouseout"===t?(o=!0,a&&this._emitEvent(t,e,r,a,a,null),this._emitEvent(t,e,r,null,a,null),"mouseleave"===t&&this.draggingShape&&this._emitEvent("dragleave",e,r,null)):this._emitEvent(t,e,r,n,null,null)}if(o||(this.currentShape=n),n&&!n.get("destroyed")){var s=this.canvas;s.get("el").style.cursor=n.attr("cursor")||s.get("cursor")}},t.prototype._onmousedown=function(t,e,r){0===r.button&&(this.mousedownShape=e,this.mousedownPoint=t,this.mousedownTimeStamp=r.timeStamp),this._emitEvent("mousedown",r,t,e,null,null)},t.prototype._emitMouseoverEvents=function(t,e,r,n){var i=this.canvas.get("el");r!==n&&(r&&(this._emitEvent("mouseout",t,e,r,r,n),this._emitEvent("mouseleave",t,e,r,r,n),n&&!n.get("destroyed")||(i.style.cursor=this.canvas.get("cursor"))),n&&(this._emitEvent("mouseover",t,e,n,r,n),this._emitEvent("mouseenter",t,e,n,r,n)))},t.prototype._emitDragoverEvents=function(t,e,r,n,i){n?(n!==r&&(r&&this._emitEvent("dragleave",t,e,r,r,n),this._emitEvent("dragenter",t,e,n,r,n)),i||this._emitEvent("dragover",t,e,n)):r&&this._emitEvent("dragleave",t,e,r,r,n),i&&this._emitEvent("dragover",t,e,n)},t.prototype._afterDrag=function(t,e,r){t&&(t.set("capture",!0),this.draggingShape=null),this.dragging=!1;var n=this._getShape(e,r);n!==t&&this._emitMouseoverEvents(r,e,t,n),this.currentShape=n},t.prototype._onmouseup=function(t,e,r){if(0===r.button){var n=this.draggingShape;this.dragging?(n&&this._emitEvent("drop",r,t,e),this._emitEvent("dragend",r,t,n),this._afterDrag(n,t,r)):(this._emitEvent("mouseup",r,t,e),e===this.mousedownShape&&this._emitEvent("click",r,t,e),this.mousedownShape=null,this.mousedownPoint=null)}},t.prototype._ondragover=function(t,e,r){r.preventDefault();var n=this.currentShape;this._emitDragoverEvents(r,t,n,e,!0)},t.prototype._onmousemove=function(t,e,r){var n=this.canvas,i=this.currentShape,o=this.draggingShape;if(this.dragging)o&&this._emitDragoverEvents(r,t,i,e,!1),this._emitEvent("drag",r,t,o);else{var a=this.mousedownPoint;if(a){var s=this.mousedownShape,u=r.timeStamp-this.mousedownTimeStamp,l=a.clientX-t.clientX,c=a.clientY-t.clientY;u>120||l*l+c*c>40?s&&s.get("draggable")?((o=this.mousedownShape).set("capture",!1),this.draggingShape=o,this.dragging=!0,this._emitEvent("dragstart",r,t,o),this.mousedownShape=null,this.mousedownPoint=null):!s&&n.get("draggable")?(this.dragging=!0,this._emitEvent("dragstart",r,t,null),this.mousedownShape=null,this.mousedownPoint=null):(this._emitMouseoverEvents(r,t,i,e),this._emitEvent("mousemove",r,t,e)):(this._emitMouseoverEvents(r,t,i,e),this._emitEvent("mousemove",r,t,e))}else this._emitMouseoverEvents(r,t,i,e),this._emitEvent("mousemove",r,t,e)}},t.prototype._emitEvent=function(t,e,r,n,i,o){var a=this._getEventObj(t,e,r,n,i,o);if(n){a.shape=n,ht(n,t,a);for(var s=n.getParent();s;)s.emitDelegation(t,a),a.propagationStopped||pt(s,t,a),a.propagationPath.push(s),s=s.getParent()}else{ht(this.canvas,t,a)}},t.prototype.destroy=function(){this._clearEvents(),this.canvas=null,this.currentShape=null,this.draggingShape=null,this.mousedownPoint=null,this.mousedownShape=null,this.mousedownTimeStamp=null},t}(),yt=(0,i.o0)(),vt=yt&&"firefox"===yt.name,gt=function(t){function e(e){var r=t.call(this,e)||this;return r.initContainer(),r.initDom(),r.initEvents(),r.initTimeline(),r}return(0,n.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return e.cursor="default",e.supportCSSTransform=!1,e},e.prototype.initContainer=function(){var t=this.get("container");(0,a.Kg)(t)&&(t=document.getElementById(t),this.set("container",t))},e.prototype.initDom=function(){var t=this.createDom();this.set("el",t),this.get("container").appendChild(t),this.setDOMSize(this.get("width"),this.get("height"))},e.prototype.initEvents=function(){var t=new dt({canvas:this});t.init(),this.set("eventController",t)},e.prototype.initTimeline=function(){var t=new lt(this);this.set("timeline",t)},e.prototype.setDOMSize=function(t,e){var r=this.get("el");a.Bd&&(r.style.width=t+"px",r.style.height=e+"px")},e.prototype.changeSize=function(t,e){this.setDOMSize(t,e),this.set("width",t),this.set("height",e),this.onCanvasChange("changeSize")},e.prototype.getRenderer=function(){return this.get("renderer")},e.prototype.getCursor=function(){return this.get("cursor")},e.prototype.setCursor=function(t){this.set("cursor",t);var e=this.get("el");a.Bd&&e&&(e.style.cursor=t)},e.prototype.getPointByEvent=function(t){if(this.get("supportCSSTransform")){if(vt&&!(0,a.gD)(t.layerX)&&t.layerX!==t.offsetX)return{x:t.layerX,y:t.layerY};if(!(0,a.gD)(t.offsetX))return{x:t.offsetX,y:t.offsetY}}var e=this.getClientByEvent(t),r=e.x,n=e.y;return this.getPointByClient(r,n)},e.prototype.getClientByEvent=function(t){var e=t;return t.touches&&(e="touchend"===t.type?t.changedTouches[0]:t.touches[0]),{x:e.clientX,y:e.clientY}},e.prototype.getPointByClient=function(t,e){var r=this.get("el").getBoundingClientRect();return{x:t-r.left,y:e-r.top}},e.prototype.getClientByPoint=function(t,e){var r=this.get("el").getBoundingClientRect();return{x:t+r.left,y:e+r.top}},e.prototype.draw=function(){},e.prototype.removeDom=function(){var t=this.get("el");t.parentNode.removeChild(t)},e.prototype.clearEvents=function(){this.get("eventController").destroy()},e.prototype.isCanvas=function(){return!0},e.prototype.getParent=function(){return null},e.prototype.destroy=function(){var e=this.get("timeline");this.get("destroyed")||(this.clear(),e&&e.stop(),this.clearEvents(),this.removeDom(),t.prototype.destroy.call(this))},e}(o.A)},3428:function(t,e,r){"use strict";var n=r(1635),i=r(8679),o=r(4389),a={},s="_INDEX";var u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,n.__extends)(e,t),e.prototype.isCanvas=function(){return!1},e.prototype.getBBox=function(){var t=1/0,e=-1/0,r=1/0,n=-1/0,i=this.getChildren().filter(function(t){return t.get("visible")&&(!t.isGroup()||t.isGroup()&&t.getChildren().length>0)});return i.length>0?(0,o.__)(i,function(i){var o=i.getBBox(),a=o.minX,s=o.maxX,u=o.minY,l=o.maxY;a e&&(e=s),u n&&(n=l)}):(t=0,e=0,r=0,n=0),{x:t,y:r,minX:t,minY:r,maxX:e,maxY:n,width:e-t,height:n-r}},e.prototype.getCanvasBBox=function(){var t=1/0,e=-1/0,r=1/0,n=-1/0,i=this.getChildren().filter(function(t){return t.get("visible")&&(!t.isGroup()||t.isGroup()&&t.getChildren().length>0)});return i.length>0?(0,o.__)(i,function(i){var o=i.getCanvasBBox(),a=o.minX,s=o.maxX,u=o.minY,l=o.maxY;a e&&(e=s),u n&&(n=l)}):(t=0,e=0,r=0,n=0),{x:t,y:r,minX:t,minY:r,maxX:e,maxY:n,width:e-t,height:n-r}},e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return e.children=[],e},e.prototype.onAttrChange=function(e,r,n){if(t.prototype.onAttrChange.call(this,e,r,n),"matrix"===e){var i=this.getTotalMatrix();this._applyChildrenMarix(i)}},e.prototype.applyMatrix=function(e){var r=this.getTotalMatrix();t.prototype.applyMatrix.call(this,e);var n=this.getTotalMatrix();n!==r&&this._applyChildrenMarix(n)},e.prototype._applyChildrenMarix=function(t){var e=this.getChildren();(0,o.__)(e,function(e){e.applyMatrix(t)})},e.prototype.addShape=function(){for(var t=[],e=0;e =0;a--){var s=t[a];if((0,o.OK)(s)&&(s.isGroup()?i=s.getShape(e,r,n):s.isHit(e,r)&&(i=s)),i)break}return i},e.prototype.add=function(t){var e=this.getCanvas(),r=this.getChildren(),n=this.get("timeline"),i=t.getParent();i&&function(t,e,r){void 0===r&&(r=!0),r?e.destroy():(e.set("parent",null),e.set("canvas",null)),(0,o.E6)(t.getChildren(),e)}(i,t,!1),t.set("parent",this),e&&function t(e,r){if(e.set("canvas",r),e.isGroup()){var n=e.get("children");n.length&&n.forEach(function(e){t(e,r)})}}(t,e),n&&function t(e,r){if(e.set("timeline",r),e.isGroup()){var n=e.get("children");n.length&&n.forEach(function(e){t(e,r)})}}(t,n),r.push(t),t.onCanvasChange("add"),this._applyElementMatrix(t)},e.prototype._applyElementMatrix=function(t){var e=this.getTotalMatrix();e&&t.applyMatrix(e)},e.prototype.getChildren=function(){return this.get("children")||[]},e.prototype.sort=function(){var t,e=this.getChildren();(0,o.__)(e,function(t,e){return t[s]=e,t}),e.sort((t=function(t,e){return t.get("zIndex")-e.get("zIndex")},function(e,r){var n=t(e,r);return 0===n?e[s]-r[s]:n})),this.onCanvasChange("sort")},e.prototype.clear=function(){if(this.set("clearing",!0),!this.destroyed){for(var t=this.getChildren(),e=t.length-1;e>=0;e--)t[e].destroy();this.set("children",[]),this.onCanvasChange("clear"),this.set("clearing",!1)}},e.prototype.destroy=function(){this.get("destroyed")||(this.clear(),t.prototype.destroy.call(this))},e.prototype.getFirst=function(){return this.getChildByIndex(0)},e.prototype.getLast=function(){var t=this.getChildren();return this.getChildByIndex(t.length-1)},e.prototype.getChildByIndex=function(t){return this.getChildren()[t]},e.prototype.getCount=function(){return this.getChildren().length},e.prototype.contain=function(t){return this.getChildren().indexOf(t)>-1},e.prototype.removeChild=function(t,e){void 0===e&&(e=!0),this.contain(t)&&t.remove(e)},e.prototype.findAll=function(t){var e=[],r=this.getChildren();return(0,o.__)(r,function(r){t(r)&&e.push(r),r.isGroup()&&(e=e.concat(r.findAll(t)))}),e},e.prototype.find=function(t){var e=null,r=this.getChildren();return(0,o.__)(r,function(r){if(t(r)?e=r:r.isGroup()&&(e=r.find(t)),e)return!1}),e},e.prototype.findById=function(t){return this.find(function(e){return e.get("id")===t})},e.prototype.findByClassName=function(t){return this.find(function(e){return e.get("className")===t})},e.prototype.findAllByName=function(t){return this.findAll(function(e){return e.get("name")===t})},e}(i.A);e.A=u},8679:function(t,e,r){"use strict";var n=r(1635),i=r(1359),o=r(5776),a=r(4389),s=r(1344),u=r(686),l=o.pd,c=["zIndex","capture","visible","type"],f=["repeat"];var h=function(t){function e(e){var r=t.call(this,e)||this;r.attrs={};var n=r.getDefaultAttrs();return(0,i.mix)(n,e.attrs),r.attrs=n,r.initAttrs(n),r.initAnimate(),r}return(0,n.__extends)(e,t),e.prototype.getDefaultCfg=function(){return{visible:!0,capture:!0,zIndex:0}},e.prototype.getDefaultAttrs=function(){return{matrix:this.getDefaultMatrix(),opacity:1}},e.prototype.onCanvasChange=function(t){},e.prototype.initAttrs=function(t){},e.prototype.initAnimate=function(){this.set("animable",!0),this.set("animating",!1)},e.prototype.isGroup=function(){return!1},e.prototype.getParent=function(){return this.get("parent")},e.prototype.getCanvas=function(){return this.get("canvas")},e.prototype.attr=function(){for(var t,e=[],r=0;r 0?n=function(t,e){if(e.onFrame)return t;var r=e.startTime,n=e.delay,o=e.duration,a=Object.prototype.hasOwnProperty;return(0,i.each)(t,function(t){r+n t.delay&&(0,i.each)(e.toAttrs,function(e,r){a.call(t.toAttrs,r)&&(delete t.toAttrs[r],delete t.fromAttrs[r])})}),t}(n,x):r.addAnimator(this),n.push(x),this.set("animations",n),this.set("_pause",{isPaused:!1})}},e.prototype.stopAnimate=function(t){var e=this;void 0===t&&(t=!0);var r=this.get("animations");(0,i.each)(r,function(r){t&&(r.onFrame?e.attr(r.onFrame(1)):e.attr(r.toAttrs)),r.callback&&r.callback()}),this.set("animating",!1),this.set("animations",[])},e.prototype.pauseAnimate=function(){var t=this.get("timeline"),e=this.get("animations"),r=t.getTime();return(0,i.each)(e,function(t){t._paused=!0,t._pauseTime=r,t.pauseCallback&&t.pauseCallback()}),this.set("_pause",{isPaused:!0,pauseTime:r}),this},e.prototype.resumeAnimate=function(){var t=this.get("timeline").getTime(),e=this.get("animations"),r=this.get("_pause").pauseTime;return(0,i.each)(e,function(e){e.startTime=e.startTime+(t-r),e._paused=!1,e._pauseTime=null,e.resumeCallback&&e.resumeCallback()}),this.set("_pause",{isPaused:!1}),this.set("animations",e),this},e.prototype.emitDelegation=function(t,e){var r,n=this,o=e.propagationPath;this.getEvents();"mouseenter"===t?r=e.fromShape:"mouseleave"===t&&(r=e.toShape);for(var s=function(t){var s=o[t],l=s.get("name");if(l){if((s.isGroup()||s.isCanvas&&s.isCanvas())&&r&&(0,a.pu)(s,r))return"break";(0,i.isArray)(l)?(0,i.each)(l,function(t){n.emitDelegateEvent(s,t,e)}):u.emitDelegateEvent(s,l,e)}},u=this,l=0;l =t&&r.minY<=e&&r.maxY>=e},e.prototype.afterAttrsChange=function(e){t.prototype.afterAttrsChange.call(this,e),this.clearCacheBBox()},e.prototype.getBBox=function(){var t=this.cfg.bbox;return t||(t=this.calculateBBox(),this.set("bbox",t)),t},e.prototype.getCanvasBBox=function(){var t=this.cfg.canvasBBox;return t||(t=this.calculateCanvasBBox(),this.set("canvasBBox",t)),t},e.prototype.applyMatrix=function(e){t.prototype.applyMatrix.call(this,e),this.set("canvasBBox",null)},e.prototype.calculateCanvasBBox=function(){var t=this.getBBox(),e=this.getTotalMatrix(),r=t.minX,n=t.minY,i=t.maxX,a=t.maxY;if(e){var s=(0,o.$F)(e,[t.minX,t.minY]),u=(0,o.$F)(e,[t.maxX,t.minY]),l=(0,o.$F)(e,[t.minX,t.maxY]),c=(0,o.$F)(e,[t.maxX,t.maxY]);r=Math.min(s[0],u[0],l[0],c[0]),i=Math.max(s[0],u[0],l[0],c[0]),n=Math.min(s[1],u[1],l[1],c[1]),a=Math.max(s[1],u[1],l[1],c[1])}var f=this.attrs;if(f.shadowColor){var h=f.shadowBlur,p=void 0===h?0:h,d=f.shadowOffsetX,y=void 0===d?0:d,v=f.shadowOffsetY,g=void 0===v?0:v,m=r-p+y,b=i+p+y,x=n-p+g,w=a+p+g;r=Math.min(r,m),i=Math.max(i,b),n=Math.min(n,x),a=Math.max(a,w)}return{x:r,y:n,minX:r,minY:n,maxX:i,maxY:a,width:i-r,height:a-n}},e.prototype.clearCacheBBox=function(){this.set("bbox",null),this.set("canvasBBox",null)},e.prototype.isClipShape=function(){return this.get("isClipShape")},e.prototype.isInShape=function(t,e){return!1},e.prototype.isOnlyHitBox=function(){return!1},e.prototype.isHit=function(t,e){var r=this.get("startArrowShape"),n=this.get("endArrowShape"),i=[t,e,1],o=(i=this.invertFromMatrix(i))[0],a=i[1],s=this._isInBBox(o,a);if(this.isOnlyHitBox())return s;if(s&&!this.isClipped(o,a)){if(this.isInShape(o,a))return!0;if(r&&r.isHit(o,a))return!0;if(n&&n.isHit(o,a))return!0}return!1},e}(i.A);e.A=a},2867:function(t,e,r){"use strict";r.d(e,{i:function(){return Y},f:function(){return X}});var n={};function i(t){return+t}function o(t){return t*t}function a(t){return t*(2-t)}function s(t){return((t*=2)<=1?t*t:--t*(2-t)+1)/2}function u(t){return t*t*t}function l(t){return--t*t*t+1}function c(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}r.r(n),r.d(n,{easeBack:function(){return G},easeBackIn:function(){return F},easeBackInOut:function(){return G},easeBackOut:function(){return z},easeBounce:function(){return D},easeBounceIn:function(){return R},easeBounceInOut:function(){return B},easeBounceOut:function(){return D},easeCircle:function(){return k},easeCircleIn:function(){return S},easeCircleInOut:function(){return k},easeCircleOut:function(){return E},easeCubic:function(){return c},easeCubicIn:function(){return u},easeCubicInOut:function(){return c},easeCubicOut:function(){return l},easeElastic:function(){return H},easeElasticIn:function(){return V},easeElasticInOut:function(){return W},easeElasticOut:function(){return H},easeExp:function(){return _},easeExpIn:function(){return x},easeExpInOut:function(){return _},easeExpOut:function(){return w},easeLinear:function(){return i},easePoly:function(){return p},easePolyIn:function(){return f},easePolyInOut:function(){return p},easePolyOut:function(){return h},easeQuad:function(){return s},easeQuadIn:function(){return o},easeQuadInOut:function(){return s},easeQuadOut:function(){return a},easeSin:function(){return m},easeSinIn:function(){return v},easeSinInOut:function(){return m},easeSinOut:function(){return g}});var f=function t(e){function r(t){return Math.pow(t,e)}return e=+e,r.exponent=t,r}(3),h=function t(e){function r(t){return 1-Math.pow(1-t,e)}return e=+e,r.exponent=t,r}(3),p=function t(e){function r(t){return((t*=2)<=1?Math.pow(t,e):2-Math.pow(2-t,e))/2}return e=+e,r.exponent=t,r}(3),d=Math.PI,y=d/2;function v(t){return 1==+t?1:1-Math.cos(t*y)}function g(t){return Math.sin(t*y)}function m(t){return(1-Math.cos(d*t))/2}function b(t){return 1.0009775171065494*(Math.pow(2,-10*t)-.0009765625)}function x(t){return b(1-+t)}function w(t){return 1-b(t)}function _(t){return((t*=2)<=1?b(1-t):2-b(t-1))/2}function S(t){return 1-Math.sqrt(1-t*t)}function E(t){return Math.sqrt(1- --t*t)}function k(t){return((t*=2)<=1?1-Math.sqrt(1-t*t):Math.sqrt(1-(t-=2)*t)+1)/2}var T=4/11,C=6/11,O=8/11,A=.75,P=9/11,M=10/11,I=.9375,L=21/22,j=63/64,N=1/T/T;function R(t){return 1-D(1-t)}function D(t){return(t=+t) Math.PI/2?Math.PI-l:l,c=c>Math.PI/2?Math.PI-c:c,{xExtra:Math.cos(u/2-l)*(e/2*(1/Math.sin(u/2)))-e/2||0,yExtra:Math.cos(c-u/2)*(e/2*(1/Math.sin(u/2)))-e/2||0}}i("rect",a),i("image",a),i("circle",s),i("marker",s),i("polyline",function(t){for(var e=t.attr().points,r=[],n=[],i=0;i 2&&(r.push([i].concat(s.splice(0,2))),u="l",i="m"===i?"l":"L"),"o"===u&&1===s.length&&r.push([i,s[0]]),"r"===u)r.push([i].concat(s));else for(;s.length>=e[u]&&(r.push([i].concat(s.splice(0,e[u]))),e[u]););return t}),r},u=function(t,e){for(var r=[],n=0,i=t.length;i-2*!e>n;n+=2){var o=[{x:+t[n-2],y:+t[n-1]},{x:+t[n],y:+t[n+1]},{x:+t[n+2],y:+t[n+3]},{x:+t[n+4],y:+t[n+5]}];e?n?i-4===n?o[3]={x:+t[0],y:+t[1]}:i-2===n&&(o[2]={x:+t[0],y:+t[1]},o[3]={x:+t[2],y:+t[3]}):o[0]={x:+t[i-2],y:+t[i-1]}:i-4===n?o[3]=o[2]:n||(o[0]={x:+t[n],y:+t[n+1]}),r.push(["C",(-o[0].x+6*o[1].x+o[2].x)/6,(-o[0].y+6*o[1].y+o[2].y)/6,(o[1].x+6*o[2].x-o[3].x)/6,(o[1].y+6*o[2].y-o[3].y)/6,o[2].x,o[2].y])}return r},l=function(t,e,r,n,i){var o=[];if(null===i&&null===n&&(n=r),t=+t,e=+e,r=+r,n=+n,null!==i){var a=Math.PI/180,s=t+r*Math.cos(-n*a),u=t+r*Math.cos(-i*a);o=[["M",s,e+r*Math.sin(-n*a)],["A",r,r,0,+(i-n>180),0,u,e+r*Math.sin(-i*a)]]}else o=[["M",t,e],["m",0,-n],["a",r,n,0,1,1,0,2*n],["a",r,n,0,1,1,0,-2*n],["z"]];return o},c=function(t){if(!(t=s(t))||!t.length)return[["M",0,0]];var e,r,n=[],i=0,o=0,a=0,c=0,f=0;"M"===t[0][0]&&(a=i=+t[0][1],c=o=+t[0][2],f++,n[0]=["M",i,o]);for(var h=3===t.length&&"M"===t[0][0]&&"R"===t[1][0].toUpperCase()&&"Z"===t[2][0].toUpperCase(),p=void 0,d=void 0,y=f,v=t.length;y 1&&(n*=_=Math.sqrt(_),i*=_);var S=n*n,E=i*i,k=(a===s?-1:1)*Math.sqrt(Math.abs((S*E-S*w*w-E*x*x)/(S*w*w+E*x*x)));d=k*n*w/i+(e+u)/2,y=k*-i*x/n+(r+l)/2,h=Math.asin(((r-y)/i).toFixed(9)),p=Math.asin(((l-y)/i).toFixed(9)),h=e p&&(h-=2*Math.PI),!s&&p>h&&(p-=2*Math.PI)}var T=p-h;if(Math.abs(T)>v){var C=p,O=u,A=l;p=h+v*(s&&p>h?1:-1),m=t(u=d+n*Math.cos(p),l=y+i*Math.sin(p),n,i,o,0,s,O,A,[p,C,d,y])}T=p-h;var P=Math.cos(h),M=Math.sin(h),I=Math.cos(p),L=Math.sin(p),j=Math.tan(T/4),N=4/3*n*j,R=4/3*i*j,D=[e,r],B=[e+N*M,r-R*P],F=[u+N*L,l-R*I],z=[u,l];if(B[0]=2*D[0]-B[0],B[1]=2*D[1]-B[1],c)return[B,F,z].concat(m);for(var G=[],U=0,V=(m=[B,F,z].concat(m).join().split(",")).length;U 7){t[e].shift();for(var o=t[e];o.length;)s[e]="A",i&&(u[e]="A"),t.splice(e++,0,["C"].concat(o.splice(0,6)));t.splice(e,1),r=Math.max(n.length,i&&i.length||0)}},v=function(t,e,o,a,s){t&&e&&"M"===t[s][0]&&"M"!==e[s][0]&&(e.splice(s,0,["M",a.x,a.y]),o.bx=0,o.by=0,o.x=t[s][1],o.y=t[s][2],r=Math.max(n.length,i&&i.length||0))};r=Math.max(n.length,i&&i.length||0);for(var g=0;g 1?1:u<0?0:u)/2,c=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],f=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],h=0,p=0;p<12;p++){var d=l*c[p]+l,y=v(d,t,r,i,a),g=v(d,e,n,o,s),m=y*y+g*g;h+=f[p]*Math.sqrt(m)}return l*h},m=function(t,e,r,n,i,o,a,s){if(!(Math.max(t,r) Math.max(i,a)||Math.max(e,n) Math.max(o,s))){var u=(t-r)*(o-s)-(e-n)*(i-a);if(u){var l=((t*n-e*r)*(i-a)-(t-r)*(i*s-o*a))/u,c=((t*n-e*r)*(o-s)-(e-n)*(i*s-o*a))/u,f=+l.toFixed(2),h=+c.toFixed(2);if(!(f<+Math.min(t,r).toFixed(2)||f>+Math.max(t,r).toFixed(2)||f<+Math.min(i,a).toFixed(2)||f>+Math.max(i,a).toFixed(2)||h<+Math.min(e,n).toFixed(2)||h>+Math.max(e,n).toFixed(2)||h<+Math.min(o,s).toFixed(2)||h>+Math.max(o,s).toFixed(2)))return{x:l,y:c}}}},b=function(t,e,r){return e>=t.x&&e<=t.x+t.width&&r>=t.y&&r<=t.y+t.height},x=function(t,e,r,n,i){if(i)return[["M",+t+ +i,e],["l",r-2*i,0],["a",i,i,0,0,1,i,i],["l",0,n-2*i],["a",i,i,0,0,1,-i,i],["l",2*i-r,0],["a",i,i,0,0,1,-i,-i],["l",0,2*i-n],["a",i,i,0,0,1,i,-i],["z"]];var o=[["M",t,e],["l",r,0],["l",0,n],["l",-r,0],["z"]];return o.parsePathArray=y,o},w=function(t,e,r,n){return null===t&&(t=e=r=n=0),null===e&&(e=t.y,r=t.width,n=t.height,t=t.x),{x:t,y:e,width:r,w:r,height:n,h:n,x2:t+r,y2:e+n,cx:t+r/2,cy:e+n/2,r1:Math.min(r,n)/2,r2:Math.max(r,n)/2,r0:Math.sqrt(r*r+n*n)/2,path:x(t,e,r,n),vb:[t,e,r,n].join(" ")}},_=function(t,e,r,i,o,a,s,u){(0,n.isArray)(t)||(t=[t,e,r,i,o,a,s,u]);var l=function(t,e,r,n,i,o,a,s){for(var u,l,c,f,h=[],p=[[],[]],d=0;d<2;++d)if(0===d?(l=6*t-12*r+6*i,u=-3*t+9*r-9*i+3*a,c=3*r-3*t):(l=6*e-12*n+6*o,u=-3*e+9*n-9*o+3*s,c=3*n-3*e),Math.abs(u)<1e-12){if(Math.abs(l)<1e-12)continue;(f=-c/l)>0&&f<1&&h.push(f)}else{var y=l*l-4*c*u,v=Math.sqrt(y);if(!(y<0)){var g=(-l+v)/(2*u);g>0&&g<1&&h.push(g);var m=(-l-v)/(2*u);m>0&&m<1&&h.push(m)}}for(var b,x=h.length,w=x;x--;)b=1-(f=h[x]),p[0][x]=b*b*b*t+3*b*b*f*r+3*b*f*f*i+f*f*f*a,p[1][x]=b*b*b*e+3*b*b*f*n+3*b*f*f*o+f*f*f*s;return p[0][w]=t,p[1][w]=e,p[0][w+1]=a,p[1][w+1]=s,p[0].length=p[1].length=w+2,{min:{x:Math.min.apply(0,p[0]),y:Math.min.apply(0,p[1])},max:{x:Math.max.apply(0,p[0]),y:Math.max.apply(0,p[1])}}}.apply(null,t);return w(l.min.x,l.min.y,l.max.x-l.min.x,l.max.y-l.min.y)},S=function(t,e,r,n,i,o,a,s,u){var l=1-u,c=Math.pow(l,3),f=Math.pow(l,2),h=u*u,p=h*u,d=t+2*u*(r-t)+h*(i-2*r+t),y=e+2*u*(n-e)+h*(o-2*n+e),v=r+2*u*(i-r)+h*(a-2*i+r),g=n+2*u*(o-n)+h*(s-2*o+n);return{x:c*t+3*f*u*r+3*l*u*u*i+p*a,y:c*e+3*f*u*n+3*l*u*u*o+p*s,m:{x:d,y:y},n:{x:v,y:g},start:{x:l*t+u*r,y:l*e+u*n},end:{x:l*i+u*a,y:l*o+u*s},alpha:90-180*Math.atan2(d-v,y-g)/Math.PI}},E=function(t,e,r){if(!function(t,e){return t=w(t),e=w(e),b(e,t.x,t.y)||b(e,t.x2,t.y)||b(e,t.x,t.y2)||b(e,t.x2,t.y2)||b(t,e.x,e.y)||b(t,e.x2,e.y)||b(t,e.x,e.y2)||b(t,e.x2,e.y2)||(t.x e.x||e.x t.x)&&(t.y e.y||e.y t.y)}(_(t),_(e)))return r?0:[];for(var n=~~(g.apply(0,t)/8),i=~~(g.apply(0,e)/8),o=[],a=[],s={},u=r?0:[],l=0;l =0&&k<=1&&T>=0&&T<=1&&(r?u+=1:u.push({x:E.x,y:E.y,t1:k,t2:T}))}}return u},k=function(t,e){return function(t,e,r){var n,i,o,a,s,u,l,c,f,h;t=p(t),e=p(e);for(var d=r?0:[],y=0,v=t.length;y =3&&(3===t.length&&e.push("Q"),e=e.concat(t[1])),2===t.length&&e.push("L"),e=e.concat(t[t.length-1])})}(t,e,r));else{var i=[].concat(t);"M"===i[0]&&(i[0]="L");for(var o=0;o<=r-1;o++)n.push(i)}return n},O=function(t,e){if(1===t.length)return t;var r=t.length-1,n=e.length-1,i=r/n,o=[];if(1===t.length&&"M"===t[0][0]){for(var a=0;a =0;u--)a=o[u].index,"add"===o[u].type?t.splice(a,0,[].concat(t[a])):t.splice(a,1)}var f=i-(n=t.length);if(n0)){t[n]=e[n];break}r=I(r,t[n-1],1)}t[n]=["Q"].concat(r.reduce(function(t,e){return t.concat(e)},[]));break;case"T":t[n]=["T"].concat(r[0]);break;case"C":if(r.length<3){if(!(n>0)){t[n]=e[n];break}r=I(r,t[n-1],2)}t[n]=["C"].concat(r.reduce(function(t,e){return t.concat(e)},[]));break;case"S":if(r.length<2){if(!(n>0)){t[n]=e[n];break}r=I(r,t[n-1],1)}t[n]=["S"].concat(r.reduce(function(t,e){return t.concat(e)},[]));break;default:t[n]=e[n]}return t}},8358:function(t,e,r){"use strict";r.d(e,{ei:function(){return s},lb:function(){return o},q_:function(){return a}});var n=r(4389),i=r(8204);function o(t,e,r){var i=1;return(0,n.Kg)(t)&&(i=t.split("\n").length),i>1?e*i+function(t,e){return e?e-t:.14*t}(e,r)*(i-1):e}function a(t,e){var r=(0,i.X)(),o=0;if((0,n.gD)(t)||""===t)return o;if(r.save(),r.font=e,(0,n.Kg)(t)&&t.includes("\n")){var a=t.split("\n");(0,n.__)(a,function(t){var e=r.measureText(t).width;o (r-t)*(r-t)+(n-e)*(n-e)?o(r,n,i,a):this.pointToLine(t,e,r,n,i,a)},pointToLine:function(t,e,r,n,i,o){var a=[r-t,n-e];if(c.exactEquals(a,[0,0]))return Math.sqrt((i-t)*(i-t)+(o-e)*(o-e));var s=[-a[1],a[0]];c.normalize(s,s);var u=[i-t,o-e];return Math.abs(c.dot(u,s))},tangentAngle:function(t,e,r,n){return Math.atan2(n-e,r-t)}},h=1e-4;function p(t,e,r,n,i,a){var s,u=1/0,l=[r,n],c=20;a&&a>200&&(c=a/10);for(var f=1/c,p=f/10,d=0;d<=c;d++){var y=d*f,v=[i.apply(null,t.concat([y])),i.apply(null,e.concat([y]))];(x=o(l[0],l[1],v[0],v[1]))=0&&x=0?[i]:[]}function v(t,e,r,n){return 2*(1-n)*(e-t)+2*n*(r-e)}function g(t,e,r,n,i,o,a){var s=d(t,r,i,a),u=d(e,n,o,a),l=f.pointAt(t,e,r,n,a),c=f.pointAt(r,n,i,o,a);return[[t,e,l.x,l.y,s,u],[s,u,c.x,c.y,i,o]]}var m={box:function(t,e,r,n,i,o){var a=y(t,r,i)[0],u=y(e,n,o)[0],l=[t,i],c=[e,o];return void 0!==a&&l.push(d(t,r,i,a)),void 0!==u&&c.push(d(e,n,o,u)),s(l,c)},length:function(t,e,r,n,i,a){return function t(e,r,n,i,a,s,u){if(0===u)return(o(e,r,n,i)+o(n,i,a,s)+o(e,r,a,s))/2;var l=g(e,r,n,i,a,s,.5),c=l[0],f=l[1];return c.push(u-1),f.push(u-1),t.apply(null,c)+t.apply(null,f)}(t,e,r,n,i,a,3)},nearestPoint:function(t,e,r,n,i,o,a,s){return p([t,r,i],[e,n,o],a,s,d)},pointDistance:function(t,e,r,n,i,a,s,u){var l=this.nearestPoint(t,e,r,n,i,a,s,u);return o(l.x,l.y,s,u)},interpolationAt:d,pointAt:function(t,e,r,n,i,o,a){return{x:d(t,r,i,a),y:d(e,n,o,a)}},divide:function(t,e,r,n,i,o,a){return g(t,e,r,n,i,o,a)},tangentAngle:function(t,e,r,n,i,o,a){var s=v(t,r,i,a),u=v(e,n,o,a);return l(Math.atan2(u,s))}};function b(t,e,r,n,i){var o=1-i;return o*o*o*t+3*e*i*o*o+3*r*i*i*o+n*i*i*i}function x(t,e,r,n,i){var o=1-i;return 3*(o*o*(e-t)+2*o*i*(r-e)+i*i*(n-r))}function w(t,e,r,n){var i,o,s,u=-3*t+9*e-9*r+3*n,l=6*t-12*e+6*r,c=3*e-3*t,f=[];if(a(u,0))a(l,0)||(i=-c/l)>=0&&i<=1&&f.push(i);else{var h=l*l-4*u*c;a(h,0)?f.push(-l/(2*u)):h>0&&(o=(-l-(s=Math.sqrt(h)))/(2*u),(i=(-l+s)/(2*u))>=0&&i<=1&&f.push(i),o>=0&&o<=1&&f.push(o))}return f}function _(t,e,r,n,i,o,a,s,u){var l=b(t,r,i,a,u),c=b(e,n,o,s,u),h=f.pointAt(t,e,r,n,u),p=f.pointAt(r,n,i,o,u),d=f.pointAt(i,o,a,s,u),y=f.pointAt(h.x,h.y,p.x,p.y,u),v=f.pointAt(p.x,p.y,d.x,d.y,u);return[[t,e,h.x,h.y,y.x,y.y,l,c],[l,c,v.x,v.y,d.x,d.y,a,s]]}function S(t,e,r,n,i,a,s,u,l){if(0===l)return function(t,e){for(var r=0,n=t.length,i=0;i 0?r:-1*r}var T=function(t,e,r,n,i,o){var a=r,s=n;if(0===a||0===s)return{x:t,y:e};for(var u,l,c=i-t,f=o-e,h=Math.abs(c),p=Math.abs(f),d=a*a,y=s*s,v=Math.PI/4,g=0;g<4;g++){u=a*Math.cos(v),l=s*Math.sin(v);var m=(d-y)*Math.pow(Math.cos(v),3)/a,b=(y-d)*Math.pow(Math.sin(v),3)/s,x=u-m,w=l-b,_=h-m,S=p-b,E=Math.hypot(w,x),T=Math.hypot(S,_);v+=E*Math.asin((x*S-w*_)/(E*T))/Math.sqrt(d+y-u*u-l*l),v=Math.min(Math.PI/2,Math.max(0,v))}return{x:t+k(u,c),y:e+k(l,f)}};function C(t,e,r,n,i,o){return r*Math.cos(i)*Math.cos(o)-n*Math.sin(i)*Math.sin(o)+t}function O(t,e,r,n,i,o){return r*Math.sin(i)*Math.cos(o)+n*Math.cos(i)*Math.sin(o)+e}function A(t,e,r){return{x:t*Math.cos(r),y:e*Math.sin(r)}}function P(t,e,r){var n=Math.cos(r),i=Math.sin(r);return[t*n-e*i,t*i+e*n]}var M={box:function(t,e,r,n,i,o,a){for(var s=function(t,e,r){return Math.atan(-e/t*Math.tan(r))}(r,n,i),u=1/0,l=-1/0,c=[o,a],f=2*-Math.PI;f<=2*Math.PI;f+=Math.PI){var h=s+f;ol&&(l=p)}var d=function(t,e,r){return Math.atan(e/(t*Math.tan(r)))}(r,n,i),y=1/0,v=-1/0,g=[o,a];for(f=2*-Math.PI;f<=2*Math.PI;f+=Math.PI){var m=d+f;ov&&(v=b)}return{x:u,y:y,width:l-u,height:v-y}},length:function(t,e,r,n,i,o,a){},nearestPoint:function(t,e,r,n,i,o,a,s,u){var l=P(s-t,u-e,-i),c=l[0],f=l[1],h=T(0,0,r,n,c,f),p=function(t,e,r,n){return(Math.atan2(n*t,r*e)+2*Math.PI)%(2*Math.PI)}(r,n,h.x,h.y);p a&&(h=A(r,n,a));var d=P(h.x,h.y,i);return{x:d[0]+t,y:d[1]+e}},pointDistance:function(t,e,r,n,i,a,s,u,l){var c=this.nearestPoint(t,e,r,n,u,l);return o(c.x,c.y,u,l)},pointAt:function(t,e,r,n,i,o,a,s){var u=(a-o)*s+o;return{x:C(t,0,r,n,i,u),y:O(0,e,r,n,i,u)}},tangentAngle:function(t,e,r,n,i,o,a,s){var u=(a-o)*s+o,c=function(t,e,r,n,i,o,a,s){return-1*r*Math.cos(i)*Math.sin(s)-n*Math.sin(i)*Math.cos(s)}(0,0,r,n,i,0,0,u),f=function(t,e,r,n,i,o,a,s){return-1*r*Math.sin(i)*Math.sin(s)+n*Math.cos(i)*Math.cos(s)}(0,0,r,n,i,0,0,u);return l(Math.atan2(f,c))}};function I(t){for(var e=0,r=[],n=0;n 1||e<0||t.length<2)return null;var r=I(t),n=r.segments,i=r.totalLength;if(0===i)return{x:t[0][0],y:t[0][1]};for(var o=0,a=null,s=0;s =o&&e<=o+h){var p=(e-o)/h;a=f.pointAt(l[0],l[1],c[0],c[1],p);break}o+=h}return a}function N(t,e){if(e>1||e<0||t.length<2)return 0;for(var r=I(t),n=r.segments,i=r.totalLength,o=0,a=0,s=0;s =o&&e<=o+f){a=Math.atan2(c[1]-l[1],c[0]-l[0]);break}o+=f}return a}function R(t,e,r){for(var n=1/0,i=0;i ",t.Vector3Float="vec3 ",t.Vector4Float="vec4 ",t.Vector2Boolean="vec2 ",t.Vector3Boolean="vec3 ",t.Vector4Boolean="vec4 ",t.Vector2Uint="vec2 ",t.Vector3Uint="vec3 ",t.Vector4Uint="vec4 ",t.Vector2Int="vec2 ",t.Vector3Int="vec3 ",t.Vector4Int="vec4 ",t.Matrix="Matrix",t.Matrix3x3Float="mat3x3 ",t.Matrix4x4Float="mat4x4 ",t.Struct="Struct",t.FloatArray="Float[]",t.Vector4FloatArray="vec4 []"}(_||(_={})),function(t){t.Program="Program",t.Identifier="Identifier",t.VariableDeclaration="VariableDeclaration",t.BlockStatement="BlockStatement",t.ReturnStatement="ReturnStatement",t.FunctionDeclaration="FunctionDeclaration",t.VariableDeclarator="VariableDeclarator",t.AssignmentExpression="AssignmentExpression",t.LogicalExpression="LogicalExpression",t.BinaryExpression="BinaryExpression",t.ArrayExpression="ArrayExpression",t.UnaryExpression="UnaryExpression",t.UpdateExpression="UpdateExpression",t.FunctionExpression="FunctionExpression",t.MemberExpression="MemberExpression",t.ConditionalExpression="ConditionalExpression",t.ExpressionStatement="ExpressionStatement",t.CallExpression="CallExpression",t.NumThreadStatement="NumThreadStatement",t.StorageStatement="StorageStatement",t.DoWhileStatement="DoWhileStatement",t.WhileStatement="WhileStatement",t.ForStatement="ForStatement",t.BreakStatement="BreakStatement",t.ContinueStatement="ContinueStatement",t.IfStatement="IfStatement",t.ImportedFunctionStatement="ImportedFunctionStatement"}(S||(S={})),function(t){t.Input="Input",t.Output="Output",t.Uniform="Uniform",t.Workgroup="Workgroup",t.UniformConstant="UniformConstant",t.Image="Image",t.StorageBuffer="StorageBuffer",t.Private="Private",t.Function="Function"}(E||(E={})),function(t){t.GLSL100="GLSL100",t.GLSL450="GLSL450",t.WGSL="WGSL"}(k||(k={}));function C(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function O(t){for(var e=1;e 0&&void 0!==i[0]?i[0]:1,!this.dirty){t.next=6;break}return this.compiledBundle.context&&(e>1?this.compiledBundle.context.maxIteration=e:this.compiledBundle.context.maxIteration++),t.next=5,this.compile();case 5:this.dirty=!1;case 6:for(this.engine.beginFrame(),this.engine.clear({}),this.compiledBundle.context&&this.compiledBundle.context.uniforms.filter(function(t){return t.isReferer}).forEach(function(t){var e=t.data,r=t.name;n.model.confirmInput(e.model,r)}),r=0;r t.length)&&(e=t.length);for(var r=0,n=new Array(e);r 16)throw new Error("invalid data type ".concat(r));i[e]=function(){return t.data}}});var o=this.getOuputDataTexture(),a=o.textureWidth,s=o.texelCount;i.u_OutputTextureSize=[a,a],i.u_OutputTexelCount=s,this.context.output.textureSize=[a,a];var l={attributes:{a_Position:[[-1,1,0],[-1,-1,0],[1,1,0],[1,-1,0]],a_TexCoord:[[0,1],[0,0],[1,1],[1,0]]},frag:"#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n#else\n precision mediump float;\n#endif\n".concat(this.context.shader),uniforms:i,vert:ht,primitive:"triangle strip",count:4};this.computeCommand=this.reGl(l)}return c(t,[{key:"run",value:function(){var t=this;this.context.maxIteration>1&&this.context.needPingpong&&(this.compiledPingpong=!0),(this.compiledPingpong||this.dynamicPingpong)&&this.swap(),this.texFBO=this.reGl.framebuffer({color:this.getOuputDataTexture().texture}),this.texFBO.use(function(){t.computeCommand()}),dt&&console.log("[".concat(this.entity,"]: output ").concat(this.getOuputDataTexture().id))}},{key:"readData",value:function(){var t=i(m().mark(function t(){var e,r,n,i,o,a,s,u,l=this;return m().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(this.reGl({framebuffer:this.texFBO})(function(){e=l.reGl.read()}),!e){t.next=6;break}if(r=this.getOuputDataTexture(),n=r.originalDataLength,i=r.elementsPerTexel,o=r.typedArrayConstructor,a=void 0===o?Float32Array:o,s=[],4!==i)for(u=0;u 2&&void 0!==arguments[2]&&arguments[2];var r=this.context.uniforms.find(function(e){return e.name===t});if(r){var n=this.calcDataTexture(t,r.type,e),i=n.texture,o=n.data;this.textureCache[t].data=o,this.textureCache[t].texture=i}}},{key:"destroy",value:function(){}},{key:"swap",value:function(){if(this.swapOutputTextureName||this.createSwapOutputDataTexture(),this.compiledPingpong){var t=this.context.output.name;this.textureCache[t].id=this.getOuputDataTexture().id,this.textureCache[t].texture=this.getOuputDataTexture().texture}var e=this.outputTextureName;this.outputTextureName=this.swapOutputTextureName,this.swapOutputTextureName=e,dt&&console.log("[".concat(this.entity,"]: after swap, output ").concat(this.getOuputDataTexture().id))}},{key:"getOuputDataTexture",value:function(){return this.textureCache[this.outputTextureName]}},{key:"createSwapOutputDataTexture",value:function(){var t=this.cloneDataTexture(this.getOuputDataTexture());this.swapOutputTextureName="".concat(this.entity,"-swap"),this.textureCache[this.swapOutputTextureName]=t}},{key:"cloneDataTexture",value:function(t){var e=t.data,r=t.textureWidth;return ft(ft({},t),{},{id:pt++,texture:this.reGl.texture({width:r,height:r,data:e,type:"float"})})}},{key:"calcDataTexture",value:function(t,e,r){var n=1;e===_.Vector4FloatArray&&(n=4);for(var i=[],o=0;o 0&&void 0!==arguments[0]?arguments[0]:{},r=new t;return r.setConfig(e),r.setEngine(new kt),r}}]),t}()},288:function(t,e,r){"use strict";r.r(e),r.d(e,{Graph:function(){return x},GraphWithEvent:function(){return C},algorithm:function(){return n},comparision:function(){return o},essence:function(){return i},generate:function(){return s}});var n={};r.r(n),r.d(n,{components:function(){return M},dfs:function(){return I},dijkstra:function(){return D},dijkstraAll:function(){return B},findCycles:function(){return z},floydWarshall:function(){return et},isAcyclic:function(){return J},postorder:function(){return Q},preorder:function(){return $},prim:function(){return P},tarjan:function(){return F},topsort:function(){return K}});var i={};r.r(i),r.d(i,{hasSelfLoop:function(){return vt},isGraph:function(){return pt},isNullGraph:function(){return yt},isSimpleGraph:function(){return dt}});var o={};r.r(o),r.d(o,{containAllSameEdges:function(){return ut},containAllSameNodes:function(){return st},containSameEdges:function(){return nt},containSameNodes:function(){return rt},getSameEdges:function(){return ot},getSameNodes:function(){return it},isGraphComplement:function(){return gt},isGraphContainsAnother:function(){return ct},isGraphOptionSame:function(){return at},isGraphSame:function(){return lt}});var a,s={};function u(t,e){var r=t.get(e)||0;t.set(e,r+1)}function l(t,e){var r=t.get(e);void 0!==r&&((r-=1)>0?t.set(e,r):t.delete(e))}function c(t,e,r,n){var i=String(e),o=String(r);if(!t&&i>o){var s=i;i=o,o=s}return i+a.EDGE_KEY_DELIM+o+a.EDGE_KEY_DELIM+(void 0===n?a.DEFAULT_EDGE_NAME:n)}function f(t,e,r,n){var i=String(e),o=String(r),a={v:e,w:r};if(!t&&i>o){var s=a.v;a.v=a.w,a.w=s}return void 0!==n&&(a.name=n),a}function h(t,e){return c(t,e.v,e.w,e.name)}function p(t){return"function"==typeof t}r.r(s),r.d(s,{getGraphComplement:function(){return mt}}),function(t){t.DEFAULT_EDGE_NAME="\0",t.GRAPH_NODE="\0",t.EDGE_KEY_DELIM=""}(a||(a={}));var d=function(t){var e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:function(t){return t.nodes().map(function(e){var r={id:e,value:t.node(e),parent:t.parent(e)};return void 0===r.value&&delete r.value,void 0===r.parent&&delete r.parent,r})}(t),edges:function(t){return t.edges().map(function(e){var r=t.edge(e),n={v:e.v,w:e.w,value:r,name:e.name};return void 0===n.name&&delete n.name,void 0===n.value&&delete n.value,n})}(t),value:t.graph()};return void 0===e.value&&delete e.value,e};function y(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function v(t){for(var e=1;e 0&&void 0!==arguments[0]?arguments[0]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.directed=!0,this.multigraph=!1,this.compound=!1,this.GRAPH_NODE=a.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 e.directed},this.isMultigraph=function(){return e.multigraph},this.isCompound=function(){return e.compound},this.setGraph=function(t){return e.label=t,e},this.graph=function(){return e.label},this.setDefaultNodeLabel=function(t){return p(t)?e.defaultNodeLabelFn=t:e.defaultNodeLabelFn=function(){return t},e},this.nodeCount=function(){return e.nodeCountNum},this.node=function(t){return e.nodesLabelMap.get(t)},this.nodes=function(){return Array.from(e.nodesLabelMap.keys())},this.sources=function(){return e.nodes().filter(function(t){var r;return!(null===(r=e.inEdgesMap.get(t))||void 0===r?void 0:r.size)})},this.sinks=function(){return e.nodes().filter(function(t){var r;return!(null===(r=e.outEdgesMap.get(t))||void 0===r?void 0:r.size)})},this.setNodes=function(t,r){return t.map(function(t){return e.setNode(t,r)}),e},this.hasNode=function(t){return e.nodesLabelMap.has(t)},this.checkCompound=function(){if(!e.isCompound())throw new Error("Cannot construct parent-children relations in a non-compound graph")},this.parent=function(t){if(e.isCompound()){var r,n=null===(r=e.parentMap)||void 0===r?void 0:r.get(t);if(n!==e.GRAPH_NODE)return n}},this.removeFromParentsChildList=function(t){var r=e.parentMap.get(t);e.childrenMap.get(r).delete(t)},this.setParent=function(t,r){var n,i;e.checkCompound();for(var o=void 0===r?e.GRAPH_NODE:r,a=e.parent(o);a;){if(t===a)throw new Error("Setting "+r+" as parent of "+t+" would create a cycle");a=e.parent(a)}r&&e.setNode(r),e.setNode(t),e.removeFromParentsChildList(t),null===(n=e.parentMap)||void 0===n||n.set(t,o);var s=e.childrenMap.get(o);return s.set(t,!0),null===(i=e.childrenMap)||void 0===i||i.set(o,s),e},this.children=function(t){var r=void 0===t?e.GRAPH_NODE:t;if(e.isCompound()){var n,i=null===(n=e.childrenMap)||void 0===n?void 0:n.get(r);return i?Array.from(i.keys()):void 0}return r===e.GRAPH_NODE?e.nodes():t&&e.hasNode(t)?[]:void 0},this.predecessors=function(t){var r=e.predecessorsMap.get(t);return r?Array.from(r.keys()):void 0},this.successors=function(t){var r=e.successorsMap.get(t);return r?Array.from(r.keys()):void 0},this.neighbors=function(t){var r;if(e.hasNode(t))return Array.from(new Set(null===(r=e.predecessors(t))||void 0===r?void 0:r.concat(e.successors(t))))},this.isLeaf=function(t){var r,n;return e.isDirected()?!(null===(n=e.successors(t))||void 0===n?void 0:n.length):!(null===(r=e.neighbors(t))||void 0===r?void 0:r.length)},this.filterNodes=function(r){var n=e.directed,i=e.multigraph,o=e.compound,a=new t({directed:n,multigraph:i,compound:o});if(a.setGraph(e.graph()),e.nodes().forEach(function(t){r(t)&&a.setNode(t,e.node(t))}),e.edges().forEach(function(t){a.hasNode(t.v)&&a.hasNode(t.w)&&a.setEdgeObj(t,e.edge(t))}),o){a.nodes().forEach(function(t){a.setParent(t,function(t){for(var r=e.parent(t);void 0!==r&&!a.hasNode(r);)r=e.parent(r);return r}(t))})}return a},this.setDefaultEdgeLabel=function(t){return p(t)?e.defaultEdgeLabelFn=t:e.defaultEdgeLabelFn=function(){return t},e},this.edgeCount=function(){return e.edgeCountNum},this.setEdgeObj=function(t,r){return e.setEdge(t.v,t.w,r,t.name)},this.setPath=function(t,r){return t.reduce(function(t,n){return e.setEdge(t,n,r),n}),e},this.edgeFromArgs=function(t,r,n){return e.edge({v:t,w:r,name:n})},this.edge=function(t){return e.edgesLabelsMap.get(h(e.isDirected(),t))},this.hasEdge=function(t,r,n){return e.edgesLabelsMap.has(h(e.isDirected(),{v:t,w:r,name:n}))},this.removeEdgeObj=function(t){var r=t.v,n=t.w,i=t.name;return e.removeEdge(r,n,i)},this.edges=function(){return Array.from(e.edgesMap.values())},this.inEdges=function(t,r){var n=e.inEdgesMap.get(t);if(n)return Array.from(n.values()).filter(function(t){return!r||t.v===r})},this.outEdges=function(t,r){var n=e.outEdgesMap.get(t);if(n)return Array.from(n.values()).filter(function(t){return!r||t.w===r})},this.nodeEdges=function(t,r){var n;if(e.hasNode(t))return null===(n=e.inEdges(t,r))||void 0===n?void 0:n.concat(e.outEdges(t,r))},this.toJSON=function(){return d(e)},this.nodeInDegree=function(t){var r=e.inEdgesMap.get(t);return r?r.size:0},this.nodeOutDegree=function(t){var r=e.outEdgesMap.get(t);return r?r.size:0},this.nodeDegree=function(t){return e.nodeInDegree(t)+e.nodeOutDegree(t)},this.source=function(t){return t.v},this.target=function(t){return t.w};var n=v(v({},b),r);this.compound=n.compound,this.directed=n.directed,this.multigraph=n.multigraph,this.compound&&(this.parentMap=new Map,this.childrenMap=new Map)}var e,r,n;return e=t,(r=[{key:"setNode",value:function(t,e){var r,n=this.nodesLabelMap,i=this.defaultNodeLabelFn,o=this.isCompound,a=this.parentMap,s=this.childrenMap,u=this.inEdgesMap,l=this.outEdgesMap,c=this.predecessorsMap,f=this.successorsMap;if(n.has(t))return void 0!==e&&n.set(t,e),this;(n.set(t,e||i(t)),o())&&(null===a||void 0===a||a.set(t,this.GRAPH_NODE),null===s||void 0===s||s.set(t,new Map),(null===s||void 0===s?void 0:s.has(this.GRAPH_NODE))||null===s||void 0===s||s.set(this.GRAPH_NODE,new Map),null===s||void 0===s||null===(r=s.get(this.GRAPH_NODE))||void 0===r||r.set(t,!0));return[u,l,c,f].forEach(function(e){return e.set(t,new Map)}),this.nodeCountNum+=1,this}},{key:"removeNode",value:function(t){var e=this;if(this.hasNode(t)){var r,n,i,o=function(t){e.removeEdge(t.v,t.w,t.name)},a=this.inEdgesMap,s=this.outEdgesMap,u=this.predecessorsMap,l=this.successorsMap,c=this.nodesLabelMap;if(this.isCompound())this.removeFromParentsChildList(t),null===(r=this.parentMap)||void 0===r||r.delete(t),null===(n=this.children(t))||void 0===n||n.forEach(function(t){return e.setParent(t)}),null===(i=this.childrenMap)||void 0===i||i.delete(t);var f=a.get(t),h=s.get(t);Array.from(f.values()).forEach(function(t){return o(t)}),Array.from(h.values()).forEach(function(t){return o(t)}),c.delete(t),a.delete(t),s.delete(t),u.delete(t),l.delete(t),this.nodeCountNum-=1}return this}},{key:"setEdge",value:function(t,e,r,n){var i,o,a=f(this.isDirected(),t,e,n),s=h(this.isDirected(),a),l=a.v,c=a.w;if(this.edgesLabelsMap.has(s))return this.edgesLabelsMap.set(s,r),this;if(void 0!==n&&!this.isMultigraph())throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(l),this.setNode(c),this.edgesLabelsMap.set(s,r||this.defaultEdgeLabelFn(l,c,n)),Object.freeze(a),this.edgesMap.set(s,a);var p=this.predecessorsMap.get(c),d=this.successorsMap.get(l);return u(p,l),u(d,c),null===(i=this.inEdgesMap.get(c))||void 0===i||i.set(s,a),null===(o=this.outEdgesMap.get(l))||void 0===o||o.set(s,a),this.edgeCountNum+=1,this}},{key:"removeEdge",value:function(t,e,r){var n=c(this.isDirected(),t,e,r);if(this.edgesMap.get(n)){var i=f(this.isDirected(),t,e,r),o=i.v,a=i.w;this.edgesLabelsMap.delete(n),this.edgesMap.delete(n);var s=this.predecessorsMap.get(a),u=this.successorsMap.get(o);l(s,o),l(u,a),this.inEdgesMap.get(a).delete(n),this.outEdgesMap.get(o).delete(n),this.edgeCountNum-=1}return this}}])&&m(e.prototype,r),n&&m(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function w(t){"@babel/helpers - typeof";return(w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function _(t,e){for(var r=0;r -1&&this.eventPool[t].splice(r,1)}}},{key:"emitEvent",value:function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n >1])||void 0===a?void 0:a.priority)e.arr[n].priority)throw new Error("New priority is greater than current priority.Key: ".concat(t," Old: + ").concat(e.arr[n].priority," New: ").concat(r));e.arr[n].priority=r,e.innerDecrease(n)}}),P=function(t,e){var r,n=new x,i=new Map,o=new A;function a(t){var n=t.v===r?t.w:t.v,a=o.priority(n);if(void 0!==a){var s=e(t);s0;){var u;if(r=o.removeMin(),i.has(r))n.setEdge(r,i.get(r));else{if(s)throw new Error("Input graph is not connected: "+t.graph());s=!0}null===(u=t.nodeEdges(r))||void 0===u||u.forEach(a)}return n},M=function(t){var e=new Set,r=[];return t.nodes().forEach(function(n){for(var i=[],o=[n];o.length>0;){var a,s,u=o.pop();e.has(u)||(e.add(u),i.push(u),null===(a=t.successors(u))||void 0===a||a.forEach(function(t){return o.push(t)}),null===(s=t.predecessors(u))||void 0===s||s.forEach(function(t){return o.push(t)}))}i.length&&r.push(i)}),r},I=function(t,e,r){var n=function(e){return t.isDirected()?t.successors(e):t.neighbors(e)},i=[],o=[];return(Array.isArray(e)?e:[e]).forEach(function(e){if(!t.hasNode(e))throw new Error("Graph does not have node: "+e);!function t(e,r,n,i,o,a){i.includes(r)||(i.push(r),n||a.push(r),o(r).forEach(function(r){return t(e,r,n,i,o,a)}),n&&a.push(r))}(t,e,"post"===r,o,n,i)}),i};function L(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==r)return;var n,i,o=[],a=!0,s=!1;try{for(r=r.call(t);!(a=(n=r.next()).done)&&(o.push(n.value),!e||o.length!==e);a=!0);}catch(t){s=!0,i=t}finally{try{a||null==r.return||r.return()}finally{if(s)throw i}}return o}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return j(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return j(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function j(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r 0&&(i=s.removeMin(),!(o=a.get(i))||o.distance!==Number.POSITIVE_INFINITY);)n(i).forEach(u);var l={};return Array.from(a.entries()).forEach(function(t){var e=L(t,2),r=e[0],n=e[1];return l[String(r)]=n,l}),l},D=function(t,e,r,n){return R(t,e,r||N,n||function(e){return t.outEdges(e)})},B=function(t,e,r){var n={};return t.nodes().forEach(function(i){return n[String(i)]=D(t,i,e,r),n}),n},F=function(t){var e=0,r=[],n=new Map,i=[];return t.nodes().forEach(function(o){n.has(o)||function o(a){var s,u={onStack:!0,lowlink:e,index:e};if(n.set(a,u),e+=1,r.push(a),null===(s=t.successors(a))||void 0===s||s.forEach(function(t){var e;if(n.has(t)){if(null===(e=n.get(t))||void 0===e?void 0:e.onStack){var r=n.get(t);u.lowlink=Math.min(u.lowlink,r.index)}}else{o(t);var i=n.get(t);u.lowlink=Math.min(u.lowlink,i.lowlink)}}),u.lowlink===u.index){var l,c=[];do{l=r.pop(),n.get(l).onStack=!1,c.push(l)}while(a!==l);i.push(c)}}(o)}),i},z=function(t){return F(t).filter(function(e){return e.length>1||1===e.length&&t.hasEdge(e[0],e[0])})};function G(t){"@babel/helpers - typeof";return(G="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function U(t,e){for(var r=0;r t.length)&&(e=t.length);for(var r=0,n=new Array(e);r o&&(o=e.depth);var r=e.children,n=r.length,i=new function(t,e){void 0===t&&(t=0),void 0===e&&(e=[]);var r=this;r.x=r.y=0,r.leftChild=r.rightChild=null,r.height=0,r.children=e}(e.height,[]);return r.forEach(function(e,r){var o=t(e);i.children.push(o),0===r&&(i.leftChild=o),r===n-1&&(i.rightChild=o)}),i.originNode=e,i.isLeaf=e.isLeaf(),i}(t);return function t(e){if(e.isLeaf||0===e.children.length)e.drawingDepth=o;else{var r=e.children.map(function(e){return t(e)}),n=Math.min.apply(null,r);e.drawingDepth=n-1}return e.drawingDepth}(a),function t(n){n.x=n.drawingDepth*e.rankSep,n.isLeaf?(n.y=0,r&&(n.y=r.y+r.height+e.nodeSep,n.originNode.parent!==r.originNode.parent&&(n.y+=e.subTreeSep)),r=n):(n.children.forEach(function(e){t(e)}),n.y=(n.leftChild.y+n.rightChild.y)/2)}(a),function t(e,r,n){n?(r.x=e.x,r.y=e.y):(r.x=e.y,r.y=e.x),e.children.forEach(function(e,i){t(e,r.children[i],n)})}(a,t,e.isHorizontal),t}},8725:function(t,e,r){var n=r(4711),i=["LR","RL","TB","BT","H","V"],o=["LR","RL","H"],a=i[0];t.exports=function(t,e,r){var s=e.direction||a;if(e.isHorizontal=function(t){return o.indexOf(t)>-1}(s),s&&-1===i.indexOf(s))throw new TypeError("Invalid direction: "+s);if(s===i[0])r(t,e);else if(s===i[1])r(t,e),t.right2left();else if(s===i[2])r(t,e);else if(s===i[3])r(t,e),t.bottom2top();else if(s===i[4]||s===i[5]){var u=n(t,e),l=u.left,c=u.right;r(l,e),r(c,e),e.isHorizontal?l.right2left():l.bottom2top(),c.translate(l.x-c.x,l.y-c.y),t.x=l.x,t.y=c.y;var f=t.getBoundingBox();e.isHorizontal?f.top<0&&t.translate(0,-f.top):f.left<0&&t.translate(-f.left,0)}var h=e.fixedRoot;return void 0===h&&(h=!0),h&&t.translate(-(t.x+t.width/2+t.hgap),-(t.y+t.height/2+t.vgap)),t}},3848:function(t,e,r){var n=r(2394),i={getId:function(t){return t.id||t.name},getPreH:function(t){return t.preH||0},getPreV:function(t){return t.preV||0},getHGap:function(t){return t.hgap||18},getVGap:function(t){return t.vgap||18},getChildren:function(t){return t.children},getHeight:function(t){return t.height||36},getWidth:function(t){var e=t.label||" ";return t.width||18*e.split("").length}};function o(t,e){var r=this;if(r.vgap=r.hgap=0,t instanceof o)return t;r.data=t;var n=e.getHGap(t),i=e.getVGap(t);return r.preH=e.getPreH(t),r.preV=e.getPreV(t),r.width=e.getWidth(t),r.height=e.getHeight(t),r.width+=r.preH,r.height+=r.preV,r.id=e.getId(t),r.x=r.y=0,r.depth=0,r.children||(r.children=[]),r.addGap(n,i),r}n.assign(o.prototype,{isRoot:function(){return 0===this.depth},isLeaf:function(){return 0===this.children.length},addGap:function(t,e){this.hgap+=t,this.vgap+=e,this.width+=2*t,this.height+=2*e},eachNode:function(t){for(var e,r=[this];e=r.shift();)t(e),r=e.children.concat(r)},DFTraverse:function(t){this.eachNode(t)},BFTraverse:function(t){for(var e,r=[this];e=r.shift();)t(e),r=r.concat(e.children)},getBoundingBox:function(){var t={left:Number.MAX_VALUE,top:Number.MAX_VALUE,width:0,height:0};return this.eachNode(function(e){t.left=Math.min(t.left,e.x),t.top=Math.min(t.top,e.y),t.width=Math.max(t.width,e.x+e.width),t.height=Math.max(t.height,e.y+e.height)}),t},translate:function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.eachNode(function(r){r.x+=t,r.y+=e,r.x+=r.preH,r.y+=r.preV})},right2left:function(){var t=this.getBoundingBox();this.eachNode(function(e){e.x=e.x-2*(e.x-t.left)-e.width}),this.translate(t.width,0)},bottom2top:function(){var t=this.getBoundingBox();this.eachNode(function(e){e.y=e.y-2*(e.y-t.top)-e.height}),this.translate(0,t.height)}}),t.exports=function(t,e,r){void 0===e&&(e={});var a,s=new o(t,e=n.assign({},i,e)),u=[s];if(!r&&!t.collapsed)for(;a=u.shift();)if(!a.data.collapsed){var l=e.getChildren(a.data),c=l?l.length:0;if(a.children=new Array(c),l&&c)for(var f=0;f t.y?u:t.y}}else t.y=0}(t,o,e,r,i),o=t})}},6401:function(t,e,r){var n=r(2394);var i={getSubTreeSep:function(){return 0}};t.exports=function(t,e){void 0===e&&(e={}),e=n.assign({},i,e),t.parent={x:0,width:0,height:0,y:0},t.BFTraverse(function(t){t.x=t.parent.x+t.parent.width}),t.parent=null,function t(e,r){var n=0;return e.children.length?e.children.forEach(function(e){n+=t(e,r)}):n=e.height,e._subTreeSep=r.getSubTreeSep(e.data),e.totalHeight=Math.max(e.height,n)+2*e._subTreeSep,e.totalHeight}(t,e),t.startY=0,t.y=t.totalHeight/2-t.height/2,t.eachNode(function(t){var e=t.children,r=e.length;if(r){var n=e[0];if(n.startY=t.startY+t._subTreeSep,1===r)n.y=t.y+t.height/2-n.height/2;else{n.y=n.startY+n.totalHeight/2-n.height/2;for(var i=1;i e.height)e.y=i.y+a/2-e.height/2;else if(1!==r.length||e.height>s){var u=e.y+(e.height-a)/2-i.y;r.forEach(function(t){t.translate(0,u)})}else e.y=(i.y+i.height/2+o.y+o.height/2)/2-e.height/2}}(t)}},514:function(t){function e(t,e,r,n){void 0===n&&(n=[]);var i=this;i.w=t||0,i.h=e||0,i.y=r||0,i.x=0,i.c=n||[],i.cs=n.length,i.prelim=0,i.mod=0,i.shift=0,i.change=0,i.tl=null,i.tr=null,i.el=null,i.er=null,i.msel=0,i.mser=0}function r(t,e){!function t(e,r,n){n?e.y+=r:e.x+=r,e.children.forEach(function(e){t(e,r,n)})}(t,-function t(e,r){var n=r?e.y:e.x;return e.children.forEach(function(e){n=Math.min(t(e,r),n)}),n}(t,e),e)}e.fromNode=function(t,r){if(!t)return null;var n=[];return t.children.forEach(function(t){n.push(e.fromNode(t,r))}),r?new e(t.height,t.width,t.x,n):new e(t.width,t.height,t.y,n)},t.exports=function(t,n){void 0===n&&(n={});var i=n.isHorizontal;function o(t){0===t.cs?(t.el=t,t.er=t,t.msel=t.mser=0):(t.el=t.c[0].el,t.msel=t.c[0].msel,t.er=t.c[t.cs-1].er,t.mser=t.c[t.cs-1].mser)}function a(t,e,r){for(var n=t.c[e-1],i=n.mod,o=t.c[e],a=o.mod;null!==n&&null!==o;){c(n)>r.low&&(r=r.nxt);var f=i+n.prelim+n.w-(a+o.prelim);f>0&&(a+=f,s(t,e,r.index,f));var h=c(n),p=c(o);h<=p&&null!==(n=l(n))&&(i+=n.mod),h>=p&&null!==(o=u(o))&&(a+=o.mod)}!n&&o?function(t,e,r,n){var i=t.c[0].el;i.tl=r;var o=n-r.mod-t.c[0].msel;i.mod+=o,i.prelim-=o,t.c[0].el=t.c[e].el,t.c[0].msel=t.c[e].msel}(t,e,o,a):n&&!o&&function(t,e,r,n){var i=t.c[e].er;i.tr=r;var o=n-r.mod-t.c[e].mser;i.mod+=o,i.prelim-=o,t.c[e].er=t.c[e-1].er,t.c[e].mser=t.c[e-1].mser}(t,e,n,i)}function s(t,e,r,n){t.c[e].mod+=n,t.c[e].msel+=n,t.c[e].mser+=n,function(t,e,r,n){if(r!==e-1){var i=e-r;t.c[r+1].shift+=n/i,t.c[e].shift-=n/i,t.c[e].change-=n-n/i}}(t,e,r,n)}function u(t){return 0===t.cs?t.tl:t.c[0]}function l(t){return 0===t.cs?t.tr:t.c[t.cs-1]}function c(t){return t.y+t.h}function f(t,e,r){for(;null!==r&&t>=r.low;)r=r.nxt;return{low:t,index:e,nxt:r}}!function t(e,r,n){void 0===n&&(n=0),r?(e.x=n,n+=e.width):(e.y=n,n+=e.height),e.children.forEach(function(e){t(e,r,n)})}(t,i);var h=e.fromNode(t,i);return function t(e){if(0!==e.cs){t(e.c[0]);for(var r=f(c(e.c[0].el),0,null),n=1;n n?1:0}var u=function(t){function e(e){var r=t.call(this)||this;return r.radius=null,r.nodeSize=void 0,r.startRadius=null,r.endRadius=null,r.startAngle=0,r.endAngle=2*Math.PI,r.clockwise=!0,r.divisions=1,r.ordering=null,r.angleRatio=1,r.nodes=[],r.edges=[],r.nodeMap={},r.degrees=[],r.width=300,r.height=300,r.updateCfg(e),r}return i(e,t),e.prototype.getDefaultCfg=function(){return{radius:null,startRadius:null,endRadius:null,startAngle:0,endAngle:2*Math.PI,clockwise:!0,divisions:1,ordering:null,angleRatio:1}},e.prototype.execute=function(){var t,e=this.nodes,r=this.edges,n=e.length;if(0!==n){this.width||"undefined"==typeof window||(this.width=window.innerWidth),this.height||"undefined"==typeof window||(this.height=window.innerHeight),this.center||(this.center=[this.width/2,this.height/2]);var i=this.center;if(1===n)return e[0].x=i[0],e[0].y=i[1],void(this.onLayoutEnd&&this.onLayoutEnd());var o=this.radius,s=this.startRadius,u=this.endRadius,l=this.divisions,c=this.startAngle,f=this.endAngle,h=this.angleRatio,p=this.ordering,d=this.clockwise,y=this.nodeSpacing,v=this.nodeSize,g=(f-c)/n,m={};e.forEach(function(t,e){m[t.id]=e}),this.nodeMap=m;var b=(0,a.getDegree)(e.length,m,r);if(this.degrees=b,y){var x=(0,a.getFuncByUnknownType)(10,y),w=(0,a.getFuncByUnknownType)(10,v),_=-1/0;e.forEach(function(t){var e=w(t);_ this.width?this.width/2:this.height/2;var E=g*h,k=[];k="topology"===p?this.topologyOrdering():"topology-directed"===p?this.topologyOrdering(!0):"degree"===p?this.degreeOrdering():e;for(var T=Math.ceil(n/l),C=0;C =0;S--)_(S);return{nodes:e,edges:r,combos:n,comboEdges:i}},e.prototype.getInnerGraphs=function(t){var e=this.comboTrees,r=this.nodeSize,n=this.edges,i=this.comboPadding,a=this.spacing,s={},c=this.innerLayout||new l.ConcentricLayout({type:"concentric",sortBy:"id"});return c.center=[0,0],c.preventOverlap=!0,c.nodeSpacing=a,(e||[]).forEach(function(e){(0,u.traverseTreeUp)(e,function(e){var a,l=(null===i||void 0===i?void 0:i(e))||10;if((0,u.isArray)(l)&&(l=Math.max.apply(Math,l)),null===(a=e.children)||void 0===a?void 0:a.length){var f=e.children.map(function(e){if("combo"===e.itemType)return s[e.id];var r=t[e.id]||{};return o(o({},r),e)}),h=f.map(function(t){return t.id}),p={nodes:f,edges:n.filter(function(t){return h.includes(t.source)&&h.includes(t.target)})},d=1/0;f.forEach(function(t){var e;t.size||(t.size=(null===(e=s[t.id])||void 0===e?void 0:e.size)||(null===r||void 0===r?void 0:r(t))||[30,30]),(0,u.isNumber)(t.size)&&(t.size=[t.size,t.size]),d>t.size[0]&&(d=t.size[0]),d>t.size[1]&&(d=t.size[1])}),c.layout(p);var y=(0,u.getLayoutBBox)(f),v=y.minX,g=y.minY,m=y.maxX,b=y.maxY,x={x:(m+v)/2,y:(b+g)/2};p.nodes.forEach(function(t){t.x-=x.x,t.y-=x.y});var w=Math.max(m-v,d)+2*l,_=Math.max(b-g,d)+2*l;s[e.id]={id:e.id,nodes:f,size:[w,_]}}else if("combo"===e.itemType){var S=l?[2*l,2*l]:[30,30];s[e.id]={id:e.id,nodes:[],size:S}}return!0})}),s},e.prototype.initVals=function(){var t,e,r=this.nodeSize,n=this.spacing;if(e=(0,u.isNumber)(n)?function(){return n}:(0,u.isFunction)(n)?n:function(){return 0},this.spacing=e,r)if((0,u.isFunction)(r))t=function(t){var n=r(t),i=e(t);return(0,u.isArray)(t.size)?((t.size[0]>t.size[1]?t.size[0]:t.size[1])+i)/2:((n||10)+i)/2};else if((0,u.isArray)(r)){var i=(r[0]>r[1]?r[0]:r[1])/2;t=function(t){return i+e(t)/2}}else{var o=r/2;t=function(t){return o+e(t)/2}}else t=function(t){var r=e(t);return t.size?(0,u.isArray)(t.size)?((t.size[0]>t.size[1]?t.size[0]:t.size[1])+r)/2:(0,u.isObject)(t.size)?((t.size.width>t.size.height?t.size.width:t.size.height)+r)/2:(t.size+r)/2:10+r/2};this.nodeSize=t;var a,s=this.comboPadding;a=(0,u.isNumber)(s)?function(){return s}:(0,u.isArray)(s)?function(){return Math.max.apply(null,s)}:(0,u.isFunction)(s)?s:function(){return 0},this.comboPadding=a},e.prototype.getType=function(){return"comboCombined"},e}(s.Base);e.ComboCombinedLayout=c},5773:function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.ComboForceLayout=void 0;var o=r(8933),a=r(864),s=function(t){function e(e){var r=t.call(this)||this;return r.center=[0,0],r.maxIteration=100,r.gravity=10,r.comboGravity=10,r.linkDistance=10,r.alpha=1,r.alphaMin=.001,r.alphaDecay=1-Math.pow(r.alphaMin,1/300),r.alphaTarget=0,r.velocityDecay=.6,r.edgeStrength=.6,r.nodeStrength=30,r.preventOverlap=!1,r.preventNodeOverlap=!1,r.preventComboOverlap=!1,r.collideStrength=void 0,r.nodeCollideStrength=.5,r.comboCollideStrength=.5,r.comboSpacing=20,r.comboPadding=10,r.optimizeRangeFactor=1,r.onTick=function(){},r.onLayoutEnd=function(){},r.depthAttractiveForceScale=1,r.depthRepulsiveForceScale=2,r.nodes=[],r.edges=[],r.combos=[],r.comboTrees=[],r.width=300,r.height=300,r.bias=[],r.nodeMap={},r.oriComboMap={},r.indexMap={},r.comboMap={},r.previousLayouted=!1,r.updateCfg(e),r}return i(e,t),e.prototype.getDefaultCfg=function(){return{maxIteration:100,center:[0,0],gravity:10,speed:1,comboGravity:30,preventOverlap:!1,preventComboOverlap:!0,preventNodeOverlap:!0,nodeSpacing:void 0,collideStrength:void 0,nodeCollideStrength:.5,comboCollideStrength:.5,comboSpacing:20,comboPadding:10,edgeStrength:.6,nodeStrength:30,linkDistance:10}},e.prototype.execute=function(){var t=this.nodes,e=this.center;if(this.comboTree={id:"comboTreeRoot",depth:-1,children:this.comboTrees},t&&0!==t.length){if(1===t.length)return t[0].x=e[0],t[0].y=e[1],void(this.onLayoutEnd&&this.onLayoutEnd());this.initVals(),this.run(),this.onLayoutEnd&&this.onLayoutEnd()}else this.onLayoutEnd&&this.onLayoutEnd()},e.prototype.run=function(){var t=this,e=t.nodes,r=t.previousLayouted?t.maxIteration/5:t.maxIteration;t.width||"undefined"==typeof window||(t.width=window.innerWidth),t.height||"undefined"==typeof window||(t.height=window.innerHeight);var n=t.center,i=t.velocityDecay,o=t.comboMap;t.previousLayouted||t.initPos(o);for(var s=function(r){var n=[];e.forEach(function(t,e){n[e]={x:0,y:0}}),t.applyCalculate(n),t.applyComboCenterForce(n),e.forEach(function(t,e){(0,a.isNumber)(t.x)&&(0,a.isNumber)(t.y)&&(t.x+=n[e].x*i,t.y+=n[e].y*i)}),t.alpha+=(t.alphaTarget-t.alpha)*t.alphaDecay,t.onTick()},u=0;u v[1]?v[0]:v[1])/2;d=function(t){return m}}else{var b=v/2;d=function(t){return b}}else d=function(t){return t.size?(0,a.isArray)(t.size)?(t.size[0]>t.size[1]?t.size[0]:t.size[1])/2:(0,a.isObject)(t.size)?(t.size.width>t.size.height?t.size.width:t.size.height)/2:t.size/2:10};this.nodeSize=d;var x,w=this.comboSpacing;x=(0,a.isNumber)(w)?function(){return w}:(0,a.isFunction)(w)?w:function(){return 0},this.comboSpacing=x;var _,S=this.comboPadding;_=(0,a.isNumber)(S)?function(){return S}:(0,a.isArray)(S)?function(){return Math.max.apply(null,S)}:(0,a.isFunction)(S)?S:function(){return 0},this.comboPadding=_;var E,k=this.linkDistance;k||(k=10),E=(0,a.isNumber)(k)?function(t){return k}:k,this.linkDistance=E;var T,C=this.edgeStrength;C||(C=1),T=(0,a.isNumber)(C)?function(t){return C}:C,this.edgeStrength=T;var O,A=this.nodeStrength;A||(A=30),O=(0,a.isNumber)(A)?function(t){return A}:A,this.nodeStrength=O},e.prototype.initPos=function(t){this.nodes.forEach(function(e,r){var n=e.comboId,i=t[n];n&&i?(e.x=i.cx+100/(r+1),e.y=i.cy+100/(r+1)):(e.x=100/(r+1),e.y=100/(r+1))})},e.prototype.getComboMap=function(){var t=this,e=t.nodeMap,r=t.comboTrees,n=t.oriComboMap,i={};return(r||[]).forEach(function(r){var o=[];(0,a.traverseTreeUp)(r,function(r){if("node"===r.itemType)return!0;if(!n[r.id])return!0;if(void 0===i[r.id]){var s={id:r.id,name:r.id,cx:0,cy:0,count:0,depth:t.oriComboMap[r.id].depth||0,children:[]};i[r.id]=s}var u=r.children;u&&u.forEach(function(t){if(!i[t.id]&&!e[t.id])return!0;o.push(t)});var l=i[r.id];if(l.cx=0,l.cy=0,0===o.length){l.empty=!0;var c=n[r.id];l.cx=c.x,l.cy=c.y}return o.forEach(function(t){if(l.count++,"node"!==t.itemType){var r=i[t.id];return(0,a.isNumber)(r.cx)&&(l.cx+=r.cx),void((0,a.isNumber)(r.cy)&&(l.cy+=r.cy))}var n=e[t.id];n&&((0,a.isNumber)(n.x)&&(l.cx+=n.x),(0,a.isNumber)(n.y)&&(l.cy+=n.y))}),l.cx/=l.count||1,l.cy/=l.count||1,l.children=o,!0})}),i},e.prototype.applyComboCenterForce=function(t){var e=this.gravity,r=this.comboGravity||e,n=this.alpha,i=this.comboTrees,o=this.indexMap,s=this.nodeMap,u=this.comboMap;(i||[]).forEach(function(e){(0,a.traverseTreeUp)(e,function(e){if("node"===e.itemType)return!0;if(!u[e.id])return!0;var i=u[e.id],l=(i.depth+1)/10*.5,c=i.cx,f=i.cy;return i.cx=0,i.cy=0,i.children.forEach(function(e){if("node"!==e.itemType){var h=u[e.id];return h&&(0,a.isNumber)(h.cx)&&(i.cx+=h.cx),void(h&&(0,a.isNumber)(h.cy)&&(i.cy+=h.cy))}var p=s[e.id],d=p.x-c||.005,y=p.y-f||.005,v=Math.sqrt(d*d+y*y),g=o[p.id],m=r*n/v*l;t[g].x-=d*m,t[g].y-=y*m,(0,a.isNumber)(p.x)&&(i.cx+=p.x),(0,a.isNumber)(p.y)&&(i.cy+=p.y)}),i.cx/=i.count||1,i.cy/=i.count||1,!0})})},e.prototype.applyCalculate=function(t){var e=this.comboMap,r=this.nodes,n={};r.forEach(function(t,e){r.forEach(function(r,i){if(!(eo&&(l.minX=o),l.minY>a&&(l.minY=a),l.maxX 1&&a.forEach(function(r,s){if("node"===r.itemType)return!1;var u=e[r.id];u&&a.forEach(function(a,l){if(s<=l)return!1;if("node"===a.itemType)return!1;var c=e[a.id];if(!c)return!1;var f=u.cx-c.cx||.005,h=u.cy-c.cy||.005,p=f*f+h*h,d=u.r||1,y=c.r||1,v=d+y,g=y*y,m=d*d;if(pi)){var g=e["".concat(p.id,"-").concat(r.id)],m=g.vx,b=g.vy,x=Math.log(Math.abs(r.depth-p.depth)/10)+1||1;x=x<1?1:x,r.comboId!==p.comboId&&(x+=1);var w=x?Math.pow(f,x):1,_=o(r)*a/y*w;if(t[d].x+=m*_,t[d].y+=b*_,d 0){var e=Math.abs(g[0][r.sortBy]-t[r.sortBy]);r.maxLevelDiff&&e>=r.maxLevelDiff&&(g=[],v.push(g))}g.push(t)});var m=u+(h||r.minNodeSpacing);if(!r.preventOverlap){var b=v.length>0&&v[0].length>1,x=(Math.min(r.width,r.height)/2-m)/(v.length+(b?1:0));m=Math.min(m,x)}var w=0;if(v.forEach(function(t){var e=r.sweep;void 0===e&&(e=2*Math.PI-2*Math.PI/t.length);var n=t.dTheta=e/Math.max(1,t.length-1);if(t.length>1&&r.preventOverlap){var i=Math.cos(n)-Math.cos(0),o=Math.sin(n)-Math.sin(0),a=Math.sqrt(m*m/(i*i+o*o));w=Math.max(a,w)}t.r=w,w+=m}),r.equidistant){for(var _=0,S=0,E=0;E e.x&&(L=e.x),j>e.y&&(j=e.y)}),w.edges().forEach(function(t){var e;null===(e=w.edge(t).points)||void 0===e||e.forEach(function(t){L>t.x&&(L=t.x),j>t.y&&(j=t.y)})}),I[0]=d[0]-L,I[1]=d[1]-j}var N="LR"===h||"RL"===h;if(y){var R=this.focusNode,D=this.ranksep,B=this.getRadialPos,F=(0,s.isString)(R)?R:null===R||void 0===R?void 0:R.id,z=F?null===(n=w.node(F))||void 0===n?void 0:n._rank:0,G=[],U=N?"y":"x",V=N?"height":"width",H=1/0,W=-1/0;w.nodes().forEach(function(t){var e=w.node(t);if(o.nodeMap[t]){var r=C(o.nodeMap[t]);if(0===z)G[e._rank]||(G[e._rank]={nodes:[],totalWidth:0,maxSize:-1/0}),G[e._rank].nodes.push(t),G[e._rank].totalWidth+=2*r+e[V],G[e._rank].maxSize W&&(W=s)}});var q=D||50,Y={},X=(W-H)/.9,Z=[.5*(H+W-X),.5*(H+W+X)],K=function(t,e,r,n){void 0===r&&(r=-1/0),void 0===n&&(n=[0,1]);var i=r;return t.forEach(function(t){var r=w.node(t);Y[t]=e;var a=B(r[U],Z,X,e,n),s=a.x,u=a.y;if(o.nodeMap[t]){o.nodeMap[t].x=s+I[0],o.nodeMap[t].y=u+I[1],o.nodeMap[t]._order=r._order;var l=T(o.nodeMap[t]);i =i})}:function(t,e,r){var n=Math.max(e.x,r.x),i=Math.min(e.x,r.x);return t.filter(function(t){return t.x<=n&&t.x>=i})};w.edges().forEach(function(t){var e,r=w.edge(t),n=x.findIndex(function(e){var r=(0,s.getEdgeTerminal)(e,"source"),n=(0,s.getEdgeTerminal)(e,"target");return r===t.v&&n===t.w});if(!(n<=-1)&&o.edgeLabelSpace&&o.controlPoints&&"loop"!==x[n].type){null===(e=null===r||void 0===r?void 0:r.points)||void 0===e||e.forEach(function(t){t.x+=I[0],t.y+=I[1]});var i=o.nodeMap[t.v],a=o.nodeMap[t.w];x[n].controlPoints=f(null===r||void 0===r?void 0:r.points,i,a,tt,N,et,rt)}})}return o.onLayoutEnd&&o.onLayoutEnd(),{nodes:u,edges:x}}},e.prototype.getRadialPos=function(t,e,r,n,i){void 0===i&&(i=[0,1]);var o=(t-e[0])/r,a=2*(o=o*(i[1]-i[0])+i[0])*Math.PI;return{x:Math.cos(a)*n,y:Math.sin(a)*n}},e.prototype.getType=function(){return"dagre"},e}(u.Base);e.DagreLayout=c;var f=function(t,e,r,n,i,o,a){var s=(null===t||void 0===t?void 0:t.slice(1,t.length-1))||[];if(e&&r){var u=e.x,l=e.y,c=r.x,f=r.y;if(i&&(u=e.y,l=e.x,c=r.y,f=r.x),f!==l&&u!==c){var h=n.indexOf(l),p=n[h+1];if(p){var d=s[0],y=i?{x:(l+p)/2,y:(null===d||void 0===d?void 0:d.y)||c}:{x:(null===d||void 0===d?void 0:d.x)||c,y:(l+p)/2};d&&!o(d,y)||s.unshift(y)}var v=n.indexOf(f),g=Math.abs(v-h);if(1===g)(s=a(s,e,r)).length||s.push(i?{x:(l+f)/2,y:u}:{x:u,y:(l+f)/2});else if(g>1){var m=n[v-1];if(m){var b=s[s.length-1],x=i?{x:(f+m)/2,y:(null===b||void 0===b?void 0:b.y)||c}:{x:(null===b||void 0===b?void 0:b.x)||u,y:(f+m)/2};b&&!o(b,x)||s.push(x)}}}}return s}},6006:function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__assign||function(){return(o=Object.assign||function(t){for(var e,r=1,n=arguments.length;r t.x&&(i=t.x),o>t.y&&(o=t.y)}),e.forEach(function(t){t.points.forEach(function(t){i>t.x&&(i=t.x),o>t.y&&(o=t.y)})}),n[0]=r[0]-i,n[1]=r[1]-o}return n},e.prototype.updateNodePosition=function(t,e){var r=this.combos,n=this.nodes,i=this.edges,o=this.anchorPoint,a=this.graphSettings,s=this.getBegin(t,e);t.forEach(function(t){var l,c=t.x,f=t.y,h=t.id,p=t.type,d=t.coreBox;if(p===u.HierarchyNodeType.META&&h!==u.ROOT_NAME){var y=r.findIndex(function(t){return t.id===h}),v=null===(l=null===a||void 0===a?void 0:a.subScene)||void 0===l?void 0:l.meta;r[y].offsetX=c+s[0],r[y].offsetY=f+s[1],r[y].fixSize=[d.width,d.height],r[y].fixCollapseSize=[d.width,d.height],t.expanded?r[y].padding=[null===v||void 0===v?void 0:v.paddingTop,null===v||void 0===v?void 0:v.paddingRight,null===v||void 0===v?void 0:v.paddingBottom,null===v||void 0===v?void 0:v.paddingLeft]:r[y].padding=[0,0,0,0]}else if(p===u.HierarchyNodeType.OP){y=n.findIndex(function(t){return t.id===h});if(n[y].x=c+s[0],n[y].y=f+s[1],o){var g=[],m=e.filter(function(t){return t.v===h}),b=e.filter(function(t){return t.w===h});m.length>0&&m.forEach(function(e){var r=e.points[0],n=(r.x-c)/t.width+.5,o=(r.y-f)/t.height+.5;g.push([n,o]),e.baseEdgeList.forEach(function(t){var e=i.find(function(e){return e.source===t.v&&e.target===t.w});e&&(e.sourceAnchor=g.length-1)})}),b.length>0&&b.forEach(function(e){var r=e.points[e.points.length-1],n=(r.x-c)/t.width+.5,o=(r.y-f)/t.height+.5;g.push([n,o]),e.baseEdgeList.forEach(function(t){var e=i.find(function(e){return e.source===t.v&&e.target===t.w});e&&(e.targetAnchor=g.length-1)})}),n[y].anchorPoints=g.length>0?g:n[y].anchorPoints||[]}}})},e.prototype.updateEdgePosition=function(t,e){var r=this,n=r.combos,i=r.edges,s=r.controlPoints,l=this.getBegin(t,e);s&&(n.forEach(function(t){t.inEdges=[],t.outEdges=[]}),i.forEach(function(e){var i,s,c,f,h=t.find(function(t){return t.id===e.source}),p=t.find(function(t){return t.id===e.target}),d=[],y=[];if(h&&p)y=(0,u.getEdges)(null===h||void 0===h?void 0:h.id,null===p||void 0===p?void 0:p.id,t);else if(!h||!p){var v=r.getNodePath(e.source),g=r.getNodePath(e.target),m=v.reverse().slice(h?0:1).find(function(e){return t.find(function(t){return t.id===e})}),b=g.reverse().slice(p?0:1).find(function(e){return t.find(function(t){return t.id===e})});h=t.find(function(t){return t.id===m}),p=t.find(function(t){return t.id===b}),y=(0,u.getEdges)(null===h||void 0===h?void 0:h.id,null===p||void 0===p?void 0:p.id,t,{v:e.source,w:e.target})}if(d=(d=y.reduce(function(t,e){return a(a([],t,!0),e.points.map(function(t){return o(o({},t),{x:t.x+l[0],y:t.y+l[1]})}),!0)},[])).slice(1,-1),e.controlPoints=d,(null===p||void 0===p?void 0:p.type)===u.NodeType.META){var x=n.findIndex(function(t){return t.id===(null===p||void 0===p?void 0:p.id)});if(!n[x]||(null===(i=n[x].inEdges)||void 0===i?void 0:i.some(function(t){return t.source===h.id&&t.target===p.id})))return;null===(s=n[x].inEdges)||void 0===s||s.push({source:h.id,target:p.id,controlPoints:d})}if((null===h||void 0===h?void 0:h.type)===u.NodeType.META){x=n.findIndex(function(t){return t.id===(null===h||void 0===h?void 0:h.id)});if(!n[x]||(null===(c=n[x].outEdges)||void 0===c?void 0:c.some(function(t){return t.source===h.id&&t.target===p.id})))return;null===(f=n[x].outEdges)||void 0===f||f.push({source:h.id,target:p.id,controlPoints:d})}}))},e.prototype.getType=function(){return"dagreCompound"},e.prototype.getDataByOrder=function(t){return t.every(function(t){return void 0!==t.layoutOrder})||t.forEach(function(t,e){t.layoutOrder=e}),t.sort(function(t,e){return t.layoutOrder-e.layoutOrder})},e}(s.Base);e.DagreCompoundLayout=c},4804:function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.Graph=void 0;var o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e}(r(288).Graph);e.Graph=o},2016:function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=n(r(2731)),o=r(2929);e.default={layout:i.default,util:{time:o.time,notime:o.notime}}},9441:function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=n(r(4818)),o=function(t){var e=[],r={},n={};return t.nodes().forEach(function i(o){var a;n[o]||(n[o]=!0,r[o]=!0,null===(a=t.outEdges(o))||void 0===a||a.forEach(function(t){r[t.w]?e.push(t):i(t.w)}),delete r[o])}),e};e.default={run:function(t){var e="greedy"===t.graph().acyclicer?(0,i.default)(t,function(t){return function(e){var r;return(null===(r=t.edge(e))||void 0===r?void 0:r.weight)||1}}(t)):o(t);null===e||void 0===e||e.forEach(function(e){var r=t.edge(e);t.removeEdgeObj(e),r.forwardName=e.name,r.reversed=!0,t.setEdge(e.w,e.v,r,"rev-".concat(Math.random()))})},undo:function(t){t.edges().forEach(function(e){var r=t.edge(e);if(r.reversed){t.removeEdgeObj(e);var n=r.forwardName;delete r.reversed,delete r.forwardName,t.setEdge(e.w,e.v,r,n)}})}}},3868:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(2929),i=function(t,e,r,i,o,a){var s={rank:a,borderType:e,width:0,height:0},u=o[e][a-1],l=(0,n.addDummyNode)(t,"border",s,r);o[e][a]=l,t.setParent(l,i),u&&t.setEdge(u,l,{weight:1})};e.default=function(t){var e;null===(e=t.children())||void 0===e||e.forEach(function(e){return function e(r){var n=t.children(r),o=t.node(r);if((null===n||void 0===n?void 0:n.length)&&n.forEach(function(t){return e(t)}),o.hasOwnProperty("minRank")){o.borderLeft=[],o.borderRight=[];for(var a=o.minRank,s=o.maxRank+1;a 0;--s)if(n=e[s].dequeue()){i=i.concat(h(t,e,r,n,!0));break}}return i},h=function(t,e,r,n,i){var o,a,s=[];return null===(o=t.inEdges(n.v))||void 0===o||o.forEach(function(n){var o=t.edge(n),a=t.node(n.v);i&&s.push({v:n.v,w:n.w,in:0,out:0}),void 0===a.out&&(a.out=0),a.out-=o,d(e,r,a)}),null===(a=t.outEdges(n.v))||void 0===a||a.forEach(function(n){var i=t.edge(n),o=n.w,a=t.node(o);void 0===a.in&&(a.in=0),a.in-=i,d(e,r,a)}),t.removeNode(n.v),i?s:void 0},p=function(t,e){var r=new l,n=0,i=0;t.nodes().forEach(function(t){r.setNode(t,{v:t,in:0,out:0})}),t.edges().forEach(function(t){var o=r.edge(t)||0,a=(null===e||void 0===e?void 0:e(t))||1,s=o+a;r.setEdge(t.v,t.w,s),i=Math.max(i,r.node(t.v).out+=a),n=Math.max(n,r.node(t.w).in+=a)});for(var o=[],a=i+n+3,s=0;s0;)e%2&&(r+=u[e+1]),u[e=e-1>>1]+=t.weight;l+=t.weight*r}}),l};e.default=function(t,e){for(var r=0,n=1;n<(null===e||void 0===e?void 0:e.length);n+=1)r+=i(t,e[n-1],e[n]);return r}},1422:function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=n(r(9987)),o=n(r(1100)),a=n(r(7611)),s=n(r(9285)),u=n(r(5959)),l=r(864),c=r(4804),f=r(2929),h=function(t,e,r){return e.map(function(e){return(0,a.default)(t,e,r)})},p=function(t,e,r,n){var i=new c.Graph;null===t||void 0===t||t.forEach(function(t){for(var o,a=t.graph().root,l=(0,u.default)(t,a,i,e,r,n),c=0;c<(null===(o=l.vs)||void 0===o?void 0:o.length);c++){var f=t.node(l.vs[c]);f&&(f.order=c)}(0,s.default)(t,i,l.vs)})},d=function(t,e){null===e||void 0===e||e.forEach(function(e){null===e||void 0===e||e.forEach(function(e,r){t.node(e).order=r})})};e.default=function(t,e){for(var r=(0,f.maxRank)(t),n=[],a=[],s=1;s-1;s--)a.push(s);var u=h(t,n,"inEdges"),c=h(t,a,"outEdges"),y=(0,i.default)(t);d(t,y);for(var v,g=Number.POSITIVE_INFINITY,m=(s=0,0);m<4;++s,++m)p(s%2?u:c,s%4>=2,!1,e),y=(0,f.buildLayerMatrix)(t),(b=(0,o.default)(t,y)) =2,!0,e),y=(0,f.buildLayerMatrix)(t),(b=(0,o.default)(t,y)) =e.barycenter)&&n(e,t)})(t);var e}),null===(r=o.out)||void 0===r||r.forEach(function(e){return(r=o,function(e){e.in.push(r),0==--e.indegree&&t.push(e)})(e);var r})};null===t||void 0===t?void 0:t.length;)o();var a=["vs","i","barycenter","weight"];return i.filter(function(t){return!t.merged}).map(function(t){var e={};return null===a||void 0===a||a.forEach(function(r){void 0!==t[r]&&(e[r]=t[r])}),e})},n=function(t,e){var r,n=0,i=0;t.weight&&(n+=t.barycenter*t.weight,i+=t.weight),e.weight&&(n+=e.barycenter*e.weight,i+=e.weight),t.vs=null===(r=e.vs)||void 0===r?void 0:r.concat(t.vs),t.barycenter=n/i,t.weight=i,t.i=Math.min(e.i,t.i),e.merged=!0};e.default=function(t,e){var n,i,o,a={};null===t||void 0===t||t.forEach(function(t,e){a[t.v]={i:e,indegree:0,in:[],out:[],vs:[t.v]};var r=a[t.v];void 0!==t.barycenter&&(r.barycenter=t.barycenter,r.weight=t.weight)}),null===(n=e.edges())||void 0===n||n.forEach(function(t){var e=a[t.v],r=a[t.w];void 0!==e&&void 0!==r&&(r.indegree++,e.out.push(a[t.w]))});var s=null===(o=(i=Object.values(a)).filter)||void 0===o?void 0:o.call(i,function(t){return!t.indegree});return r(s)}},5959:function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=n(r(4561)),o=n(r(7396)),a=n(r(572)),s=function(t,e){null===t||void 0===t||t.forEach(function(t){var r,n=null===(r=t.vs)||void 0===r?void 0:r.map(function(t){return e[t]?e[t].vs:t});t.vs=n.flat()})},u=function(t,e){void 0!==t.barycenter?(t.barycenter=(t.barycenter*t.weight+e.barycenter*e.weight)/(t.weight+e.weight),t.weight+=e.weight):(t.barycenter=e.barycenter,t.weight=e.weight)};e.default=function t(e,r,n,l,c,f){var h,p,d,y,v=e.children(r),g=e.node(r),m=g?g.borderLeft:void 0,b=g?g.borderRight:void 0,x={};m&&(v=null===v||void 0===v?void 0:v.filter(function(t){return t!==m&&t!==b}));var w=(0,i.default)(e,v||[]);null===w||void 0===w||w.forEach(function(r){var i;if(null===(i=e.children(r.v))||void 0===i?void 0:i.length){var o=t(e,r.v,n,l,f);x[r.v]=o,o.hasOwnProperty("barycenter")&&u(r,o)}});var _=(0,o.default)(w,n);s(_,x),null===(h=_.filter(function(t){return t.vs.length>0}))||void 0===h||h.forEach(function(t){var r=e.node(t.vs[0]);r&&(t.fixorder=r.fixorder,t.order=r.order)});var S=(0,a.default)(_,l,c,f);if(m&&(S.vs=[m,S.vs,b].flat(),null===(p=e.predecessors(m))||void 0===p?void 0:p.length)){var E=e.node((null===(d=e.predecessors(m))||void 0===d?void 0:d[0])||""),k=e.node((null===(y=e.predecessors(b))||void 0===y?void 0:y[0])||"");S.hasOwnProperty("barycenter")||(S.barycenter=0,S.weight=0),S.barycenter=(S.barycenter*S.weight+E.order+k.order)/(S.weight+2),S.weight+=2}return S}},572:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(2929),i=function(t,e,r){for(var n,i=r;e.length&&(n=e[e.length-1]).i<=i;)e.pop(),null===t||void 0===t||t.push(n.vs),i++;return i},o=function(t,e){return function(r,n){if(void 0!==r.fixorder&&void 0!==n.fixorder)return r.fixorder-n.fixorder;if(r.barycenter n.barycenter)return 1;if(e&&void 0!==r.order&&void 0!==n.order){if(r.order n.order)return 1}return t?n.i-r.i:r.i-n.i}};e.default=function(t,e,r,a){var s=(0,n.partition)(t,function(t){var e=t.hasOwnProperty("fixorder")&&!isNaN(t.fixorder);return a?!e&&t.hasOwnProperty("barycenter"):e||t.hasOwnProperty("barycenter")}),u=s.lhs,l=s.rhs.sort(function(t,e){return-t.i- -e.i}),c=[],f=0,h=0,p=0;null===u||void 0===u||u.sort(o(!!e,!!r)),p=i(c,l,p),null===u||void 0===u||u.forEach(function(t){var e;p+=null===(e=t.vs)||void 0===e?void 0:e.length,c.push(t.vs),f+=t.barycenter*t.weight,h+=t.weight,p=i(c,l,p)});var d={vs:c.flat()};return h&&(d.barycenter=f/h,d.weight=h),d}},8011:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(t){var e,r=function(t){var e,r={},n=0;return null===(e=t.children())||void 0===e||e.forEach(function e(i){var o,a=n;null===(o=t.children(i))||void 0===o||o.forEach(e),r[i]={low:a,lim:n++}}),r}(t);null===(e=t.graph().dummyChains)||void 0===e||e.forEach(function(e){var n,i,o=e,a=t.node(o),s=a.edgeObj;if(s)for(var u=function(t,e,r,n){var i,o,a=[],s=[],u=Math.min(e[r].low,e[n].low),l=Math.max(e[r].lim,e[n].lim);i=r;do{i=t.parent(i),a.push(i)}while(i&&(e[i].low>u||l>e[i].lim));for(o=i,i=n;i&&i!==o;)s.push(i),i=t.parent(i);return{lca:o,path:a.concat(s.reverse())}}(t,r,s.v,s.w),l=u.path,c=u.lca,f=0,h=l[f],p=!0;o!==s.w;){if(a=t.node(o),p){for(;h!==c&&(null===(n=t.node(h))||void 0===n?void 0:n.maxRank) s)&&(0,e.addConflict)(n,r,c)}))}.apply(void 0,r),i.set(o,!0))}return(null===r||void 0===r?void 0:r.length)&&r.reduce(function(e,r){var n,o=-1,a=0,s=new Map;return null===r||void 0===r||r.forEach(function(u,l){var c;if("border"===(null===(c=t.node(u))||void 0===c?void 0:c.dummy)){var f=t.predecessors(u)||[];f.length&&(n=t.node(f[0]).order,i([r,a,l,o,n],s),a=l,o=n)}i([r,a,r.length,n,e.length],s)}),r}),n};e.findOtherInnerSegmentNode=function(t,e){var r,n;if(null===(r=t.node(e))||void 0===r?void 0:r.dummy)return null===(n=t.predecessors(e))||void 0===n?void 0:n.find(function(e){return t.node(e).dummy})};e.addConflict=function(t,e,r){var n=e,i=r;if(n>i){var o=n;n=i,i=o}var a=t[n];a||(t[n]=a={}),a[i]=!0};e.hasConflict=function(t,e,r){var n=e;n>r&&(n=r);return!!t[n]};e.verticalAlignment=function(t,r,n,i){var o={},a={},s={};return null===r||void 0===r||r.forEach(function(t){null===t||void 0===t||t.forEach(function(t,e){o[t]=t,a[t]=t,s[t]=e})}),null===r||void 0===r||r.forEach(function(t){var r=-1;null===t||void 0===t||t.forEach(function(t){var u=i(t);if(u.length)for(var l=((u=u.sort(function(t,e){return s[t]-s[e]})).length-1)/2,c=Math.floor(l),f=Math.ceil(l);c<=f;++c){var h=u[c];a[t]===t&&r u.lim&&(l=u,c=!0);var f=e.edges().filter(function(e){return c===p(t,t.node(e.v),l)&&c!==p(t,t.node(e.w),l)});return(0,o.minBy)(f,function(t){return(0,i.slack)(e,t)})};e.exchangeEdges=function(t,r,n,i){var o=n.v,a=n.w;t.removeEdge(o,a),t.setEdge(i.v,i.w,{}),(0,e.initLowLimValues)(t),(0,e.initCutValues)(t,r),f(t,r)};var f=function(t,e){var r=t.nodes().find(function(t){var r;return!(null===(r=e.node(t))||void 0===r?void 0:r.parent)}),n=s(t,r);null===(n=null===n||void 0===n?void 0:n.slice(1))||void 0===n||n.forEach(function(r){var n=t.node(r).parent,i=e.edgeFromArgs(r,n),o=!1;i||(i=e.edgeFromArgs(n,r),o=!0),e.node(r).rank=e.node(n).rank+(o?i.minlen:-i.minlen)})},h=function(t,e,r){return t.hasEdge(e,r)},p=function(t,e,r){return r.low<=e.lim&&e.lim<=r.lim};e.default=function(t){var r=(0,o.simplify)(t);(0,i.longestPath)(r);var a,s,u=(0,n.feasibleTree)(r);for((0,e.initLowLimValues)(u),(0,e.initCutValues)(u,r);a=(0,e.leaveEdge)(u);)s=(0,e.enterEdge)(u,r,a),(0,e.exchangeEdges)(u,r,a,s)}},4166:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.slack=e.longestPathWithLayer=e.longestPath=void 0;var r=function(t){var e,r={};null===(e=t.sources())||void 0===e||e.forEach(function(e){return function e(n){var i,o,a=t.node(n);return a?r[n]?a.rank:(r[n]=!0,null===(i=t.outEdges(n))||void 0===i||i.forEach(function(r){var n=e(r.w)-t.edge(r).minlen;n&&(void 0===o||nMath.abs(a)*l?(s<0&&(l=-l),r=l*a/s,n=l):(a<0&&(u=-u),r=u,n=u*s/a),{x:i+r,y:o+n}):{x:0,y:0}};e.buildLayerMatrix=function(t){for(var r=[],n=(0,e.maxRank)(t)+1,i=0;i e)&&(e=i)}),e||(e=0),e};e.partition=function(t,e){var r={lhs:[],rhs:[]};return null===t||void 0===t||t.forEach(function(t){e(t)?r.lhs.push(t):r.rhs.push(t)}),r};e.time=function(t,e){var r=Date.now();try{return e()}finally{console.log("".concat(t," time: ").concat(Date.now()-r,"ms"))}};e.notime=function(t,e){return e()};e.minBy=function(t,e){return t.reduce(function(t,r){return e(t)>e(r)?r:t})}},4077:function(t,e,r){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r 1){var e=n({},t);delete e.size,s.push(e)}});var h=[];i.forEach(function(t){var e=s.find(function(e){return e.id===t.source}),r=s.find(function(e){return e.id===t.target});e&&r&&h.push(t)});var p=new f.DagreLayout({type:"dagre",ranksep:e.nodeMinGap,nodesep:e.nodeMinGap}).layout({nodes:s,edges:h}).nodes;r.forEach(function(t){var e=(p||[]).find(function(e){return e.id===t.id});t.x=(null===e||void 0===e?void 0:e.x)||o/2,t.y=(null===e||void 0===e?void 0:e.y)||a/2});var d=JSON.parse(JSON.stringify(r)),y=JSON.parse(JSON.stringify(i)),v=u.forceSimulation().nodes(d).force("link",u.forceLink(y).id(function(t){return t.id}).distance(function(t){return h.find(function(e){return e.source===t.source&&e.target===t.target})?30:20})).force("charge",u.forceManyBody()).force("center",u.forceCenter(o/2,a/2)).force("x",u.forceX(o/2)).force("y",u.forceY(a/2)).alpha(.3).alphaDecay(.08).alphaMin(.001);return new Promise(function(t){v.on("end",function(){r.forEach(function(t){var e=d.find(function(e){return e.id===t.id});e&&(t.x=e.x,t.y=e.y)});var n=Math.min.apply(Math,r.map(function(t){return t.x})),s=Math.max.apply(Math,r.map(function(t){return t.x})),u=Math.min.apply(Math,r.map(function(t){return t.y})),f=Math.max.apply(Math,r.map(function(t){return t.y})),h=o/(s-n),p=a/(f-u);r.forEach(function(t){void 0!==t.x&&h<1&&(t.x=(t.x-n)*h),void 0!==t.y&&p<1&&(t.y=(t.y-u)*p)}),r.forEach(function(t){t.sizeTemp=t.size,t.size=[10,10]}),(0,c.default)(r,i),r.forEach(function(t){t.size=t.sizeTemp||[],delete t.sizeTemp}),(0,l.default)({nodes:r,edges:i},e),t()})})}},5791:function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=n(r(2558));e.default=function(t,e){if(!t.nodes||0===t.nodes.length)return t;var r=e.width,n=e.height,o=e.nodeMinGap,a=1e4,s=1e4;t.nodes.forEach(function(t){var e=t.size[0]||50,r=t.size[1]||50;a=Math.min(e,a),s=Math.min(r,s)});var u=new i.default;u.init(r,n,{CELL_H:s,CELL_W:a}),t.nodes.forEach(function(t){var e=u.occupyNearest(t);e&&(e.node={id:t.id,size:t.size},t.x=e.x,t.y=e.y,t.dx=e.dx,t.dy=e.dy)});for(var l=0;l a){for(var d=v=Math.ceil((c.size[0]+o)/a)-1,y=0;y -1&&!u.cells[h+y+1][p].node);y++)d--;u.insertColumn(h,d)}if(c.size[1]+o>s){var v;for(d=v=Math.ceil((c.size[1]+o)/s)-1,y=0;y -1&&!u.cells[h][p+y+1].node);y++)d--;u.insertRow(p,d)}}for(l=0;l t;n--)for(i=0;i =t&&(this.additionColumn[i]+=e);for(n=0;n t;n--)this.cells[i][n+e]=r(r({},this.cells[i][n]),{dx:i,dy:n+e,x:i*this.CELL_W,y:(n+e)*this.CELL_H}),this.cells[i][n]={dx:i,dy:n,x:i*this.CELL_W,y:n*this.CELL_H,occupied:!1,node:null};for(n=0;n =t&&(this.additionRow[n]+=e);for(i=0;i a?e:t,h=n>a?t:e,p=f.x-f.size[0]/2,d=f.y-f.size[1]/2,y=f.x+f.size[0]/2,v=f.y+f.size[1]/2,g=h.x-h.size[0]/2,m=h.y-h.size[1]/2,b=h.x+h.size[0]/2,x=h.y+h.size[1]/2,w=f.x,_=f.y,S=h.x,E=h.y,k=0,T=0;if(y>=g&&b>=p&&v>=m&&x>=d){0===(T=Math.sqrt(Math.pow(S-w,2)+Math.pow(E-_,2)))&&(T=1e-7),k=1*o/T*100+((yg?p:g))*((v m?d:m)),k*=i}else{var C=!1,O=function(t,e,r){var n=t.x-t.size[0]/2,i=t.y-t.size[1]/2,o=t.x+t.size[0]/2,a=t.y+t.size[1]/2,c=e.x-e.size[0]/2,f=e.y-e.size[1]/2,h=e.x+e.size[0]/2,p=e.y+e.size[1]/2,d=t.x,y=t.y,v=e.x,g=e.y,m=v-d,b=Math.atan2(m,g-y),x=0,w=0,_=0,S=0;b>s?(w=i-p,x=c-o,_=parseFloat(w?(w/Math.cos(b)).toFixed(2):x.toFixed(2)),S=parseFloat(x?(x/Math.sin(b)).toFixed(2):w.toFixed(2))):_=S=0(x=c-o)?parseFloat(w?(w/Math.cos(b)).toFixed(2):x.toFixed(2)):parseFloat(x?(x/Math.sin(b)).toFixed(2):w.toFixed(2)):b<-s?(w=i-p)>(x=-(h-n))?parseFloat(w?(w/Math.cos(b)).toFixed(2):x.toFixed(2)):parseFloat(x?(x/Math.sin(b)).toFixed(2):w.toFixed(2)):(w=f-a)>(x=Math.abs(m)>(o-n)/2?n-h:m)?parseFloat(w?(w/Math.cos(b)).toFixed(2):x.toFixed(2)):parseFloat(x&&0!==b?(x/Math.sin(b)).toFixed(2):w.toFixed(2));var E=parseFloat(b.toFixed(2)),k=r;return r&&(k=u r||o.y>n)&&(e+=1e12);for(var a=i+1;a 150)&&!(c<30||c>150)||l*c<0){a=!1;break}if(l>70&&l<110&&!(c>70&&c<110)||l*c<0){a=!1;break}if((u.x-t.x)*(u.x-e.x)<0){a=!1;break}if((u.y-t.y)*(u.y-e.y)<0){a=!1;break}}return a}function b(t,e){for(var r=!1,n=1*f,i=1*h,o=[n,-n,0,0],a=[0,0,i,-i],s=0;s d?(l=v,r=!0):(u.x-=o[c],u.y-=a[c])}}return p>d&&(p*=y),r?g(t):0}function x(t,e){var i=0;(t.x<0||t.y<0||t.x+t.size[0]+20>r||t.y+t.size[1]+20>n)&&(i+=1e12);for(var o=0;o 0&&!(++a>=50);){var s=b(t,e);0!==s&&(o=s),i=o-r,r=o,0===i?--n:n=20}return t.forEach(function(t){t.x=t.x-t.size[0]/2,t.y=t.y-t.size[1]/2}),{nodes:t,edges:e}}},7333:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.forceNBody=void 0;var n=r(3487);function i(t){var e=0,r=0,n=0;if(t.length){for(var i=0;i<4;i++){(o=t[i])&&o.weight&&(e+=o.weight,r+=o.x*o.weight,n+=o.y*o.weight)}t.x=r/e,t.y=n/e,t.weight=e}else{var o=t;t.x=o.data.x,t.y=o.data.y,t.weight=o.data.weight}}e.forceNBody=function(t,e,r,a,s){var u=r/a,l=t.map(function(t,r){var n=e[t.id],i=n.data,o=n.x,a=n.y,s=n.size,l=i.layout.force.nodeStrength;return{x:o,y:a,size:s,index:r,vx:0,vy:0,weight:u*l}}),c=(0,n.quadtree)(l,function(t){return t.x},function(t){return t.y}).visitAfter(i);return l.forEach(function(t){!function(t,e){e.visit(function(e,r,n,i,a){return o(e,r,n,i,a,t)})}(t,c)}),l.map(function(r,n){var i=e[t[n].id].data.layout.force.mass,o=void 0===i?1:i;s[2*n]=r.vx/o,s[2*n+1]=r.vy/o}),s};var o=function(t,e,r,n,i,o){var a=o.x-t.x||.1,s=o.y-t.y||.1,u=n-e,l=a*a+s*s,c=Math.sqrt(l)*l;if(u*u*.81 1&&(o=(0,s.getAvgNodePosition)(l))}else o=void 0;return{x:null===o||void 0===o?void 0:o.x,y:null===o||void 0===o?void 0:o.y}}}}if(n){t||(t=this.getSameTypeLeafMap());var p={};Array.from(new Set(a.map(function(t,e){return t[i]}))).filter(function(t){return void 0!==t}).forEach(function(t){var e=a.filter(function(e){return e[i]===t}).map(function(t){return u[t.id]});p[t]=(0,s.getAvgNodePosition)(e)}),f={single:function(t){return c(t)},leaf:function(t){return c(t)},others:function(t){return c(t)},center:function(t,e,r){var n=p[t[i]];return{x:null===n||void 0===n?void 0:n.x,y:null===n||void 0===n?void 0:n.y}}}}this.centripetalOptions=o(o({},this.centripetalOptions),f);var d=this.centripetalOptions,y=d.leaf,v=d.single,g=d.others;y&&"function"!=typeof y&&(this.centripetalOptions.leaf=function(){return y}),v&&"function"!=typeof v&&(this.centripetalOptions.single=function(){return v}),g&&"function"!=typeof g&&(this.centripetalOptions.others=function(){return g})},e.prototype.updateCfg=function(t){t&&Object.assign(this,t)},e.prototype.getDefaultCfg=function(){return{maxIteration:500,gravity:10,enableTick:!0,animate:!0}},e.prototype.execute=function(){var t=this;t.stop();var e=t.nodes,r=t.edges,n=t.defSpringLen;if(t.judgingDistance=0,e&&0!==e.length){t.width||"undefined"==typeof window||(t.width=window.innerWidth),t.height||"undefined"==typeof window||(t.height=window.innerHeight),t.center||(t.center=[t.width/2,t.height/2]);var i=t.center;if(1===e.length)return e[0].x=i[0],e[0].y=i[1],void t.onLayoutEnd([o({},e[0])]);t.degreesMap=(0,s.getDegreeMap)(e,r),t.propsGetMass?t.getMass=t.propsGetMass:t.getMass=function(e){var r=1;(0,s.isNumber)(e.mass)&&(r=e.mass);var n=t.degreesMap[e.id].all;return!n||n<5?r:5*n*r};var a,u=t.nodeSize;if(t.preventOverlap){var c,f=t.nodeSpacing;c=(0,s.isNumber)(f)?function(){return f}:(0,s.isFunction)(f)?f:function(){return 0},a=u?(0,s.isArray)(u)?function(t){return Math.max(u[0],u[1])+c(t)}:function(t){return u+c(t)}:function(t){return t.size?(0,s.isArray)(t.size)?Math.max(t.size[0],t.size[1])+c(t):(0,s.isObject)(t.size)?Math.max(t.size.width,t.size.height)+c(t):t.size+c(t):10+c(t)}}t.nodeSize=a,t.linkDistance=l(t.linkDistance,1),t.nodeStrength=l(t.nodeStrength,1),t.edgeStrength=l(t.edgeStrength,1);var h={},p={};e.forEach(function(e,n){(0,s.isNumber)(e.x)||(e.x=Math.random()*t.width),(0,s.isNumber)(e.y)||(e.y=Math.random()*t.height);var i=t.degreesMap[e.id];h[e.id]=o(o({},e),{data:o(o({},e.data),{size:t.nodeSize(e)||30,layout:{inDegree:i.in,outDegree:i.out,degree:i.all,tDegree:i.in,sDegree:i.out,force:{mass:t.getMass(e),nodeStrength:t.nodeStrength(e,r)}}})}),p[e.id]=n}),t.nodeMap=h,t.nodeIdxMap=p,t.edgeInfos=[],null===r||void 0===r||r.forEach(function(e){var r=h[e.source],i=h[e.target];r&&i?t.edgeInfos.push({edgeStrength:t.edgeStrength(e),linkDistance:n?n(o(o({},e),{source:r,target:i}),r,i):t.linkDistance(e,r,i)||1+(u(r)+u(r)||0)/2}):elf.edgeInfos.push({})}),this.getCentripetalOptions(),t.onLayoutEnd=t.onLayoutEnd||function(){},t.run()}else t.onLayoutEnd([])},e.prototype.run=function(){var t=this,e=t.maxIteration,r=t.nodes,n=t.edges,i=t.workerEnabled,o=t.minMovement,a=t.animate,s=t.nodeMap,u=t.height;if(t.currentMinY=0,t.currentMaxY=u,r){var l=[];if(r.forEach(function(t,e){l[2*e]=0,l[2*e+1]=0}),this.defSideCoe&&"function"==typeof this.defSideCoe){var c={};n.forEach(function(t){var e=t.source,r=t.target;c[e]=c[e]||[],c[e].push(t),c[r]=c[r]||[],c[r].push(t)}),this.relatedEdges=c}var f=e;if(i||!a){for(var h=0;(t.judgingDistance>o||h<1)&&h =f||t.judgingDistance o){var c=o/l;s*=c,u*=c}e[2*a]=s,e[2*a+1]=u})},e.prototype.updatePosition=function(t,e){var r=this,n=r.nodes,i=r.distanceThresholdMode,o=r.nodeMap;if(null===n||void 0===n?void 0:n.length){var a=0;"max"===i?r.judgingDistance=-1/0:"min"===i&&(r.judgingDistance=1/0);var u=1/0,l=-1/0;n.forEach(function(n,c){var f=o[n.id];if((0,s.isNumber)(n.fx)&&(0,s.isNumber)(n.fy))return n.x=n.fx,n.y=n.fy,f.x=n.x,void(f.y=n.y);var h=t[2*c]*e,p=t[2*c+1]*e;n.x+=h,n.y+=p,f.x=n.x,f.y=n.y,n.yl&&(l=n.y);var d=Math.sqrt(h*h+p*p);switch(i){case"max":r.judgingDistance d&&(r.judgingDistance=d);break;default:a+=d}}),this.currentMinY=u,this.currentMaxY=l,i&&"mean"!==i||(r.judgingDistance=a/n.length)}else this.judgingDistance=0},e.prototype.stop=function(){this.timeInterval&&"undefined"!=typeof window&&window.clearInterval(this.timeInterval)},e.prototype.destroy=function(){this.stop(),this.tick=null,this.nodes=null,this.edges=null,this.destroyed=!0},e.prototype.getType=function(){return"force2"},e.prototype.getSameTypeLeafMap=function(){var t=this,e=t.nodeClusterBy,r=t.nodes,n=t.edges,i=t.nodeMap,o=t.degreesMap;if(null===r||void 0===r?void 0:r.length){var a={};return r.forEach(function(t,r){1===o[t.id].all&&(a[t.id]=(0,s.getCoreNodeAndRelativeLeafNodes)("leaf",t,n,e,o,i))}),a}},e}(a.Base);e.Force2Layout=c},5257:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t){this.id=t.id||0,this.rx=t.rx,this.ry=t.ry,this.fx=0,this.fy=0,this.mass=t.mass,this.degree=t.degree,this.g=t.g||0}return t.prototype.distanceTo=function(t){var e=this.rx-t.rx,r=this.ry-t.ry;return Math.hypot(e,r)},t.prototype.setPos=function(t,e){this.rx=t,this.ry=e},t.prototype.resetForce=function(){this.fx=0,this.fy=0},t.prototype.addForce=function(t){var e=t.rx-this.rx,r=t.ry-this.ry,n=Math.hypot(e,r);n=n<1e-4?1e-4:n;var i=this.g*(this.degree+1)*(t.degree+1)/n;this.fx+=i*e/n,this.fy+=i*r/n},t.prototype.in=function(t){return t.contains(this.rx,this.ry)},t.prototype.add=function(e){var r=this.mass+e.mass;return new t({rx:(this.rx*this.mass+e.rx*e.mass)/r,ry:(this.ry*this.mass+e.ry*e.mass)/r,mass:r,degree:this.degree+e.degree})},t}();e.default=r},3209:function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.ForceAtlas2Layout=void 0;var a=r(8933),s=r(864),u=o(r(5257)),l=o(r(5138)),c=o(r(5490)),f=function(t){function e(e){var r=t.call(this)||this;return r.center=[0,0],r.width=300,r.height=300,r.nodes=[],r.edges=[],r.kr=5,r.kg=1,r.mode="normal",r.preventOverlap=!1,r.dissuadeHubs=!1,r.barnesHut=void 0,r.maxIteration=0,r.ks=.1,r.ksmax=10,r.tao=.1,r.onLayoutEnd=function(){},r.prune=void 0,r.updateCfg(e),r}return i(e,t),e.prototype.getDefaultCfg=function(){return{}},e.prototype.execute=function(){var t=this.nodes,e=this.onLayoutEnd,r=this.prune,n=this.maxIteration;this.width||"undefined"==typeof window||(this.width=window.innerWidth),this.height||"undefined"==typeof window||(this.height=window.innerHeight);for(var i=[],o=t.length,a=0;a 250&&(this.barnesHut=!0),void 0===this.prune&&o>100&&(this.prune=!0),0!==this.maxIteration||this.prune?0===this.maxIteration&&r&&(n=100,o<=200&&o>100?n=500:o>200&&(n=950),this.maxIteration=n):(n=250,o<=200&&o>100?n=1e3:o>200&&(n=1200),this.maxIteration=n),this.kr||(this.kr=50,o>100&&o<=500?this.kr=20:o>500&&(this.kr=1)),this.kg||(this.kg=20,o>100&&o<=500?this.kg=10:o>500&&(this.kg=1)),this.nodes=this.updateNodesByForces(i),e()},e.prototype.updateNodesByForces=function(t){for(var e=this.edges,r=this.maxIteration,n=this.nodes,i=e.filter(function(t){return(0,s.getEdgeTerminal)(t,"source")!==(0,s.getEdgeTerminal)(t,"target")}),o=n.length,a=i.length,u=[],l={},c={},f=[],h=0;h 0;){for(g=0;g 50||!l)?this.getOptRepGraForces(d,v,i):this.getRepGraForces(p,50,d,100,o,i);var b=this.updatePos(d,y,h,i);a=b.nodes,h=b.sg,p--,this.tick&&this.tick()}return a},e.prototype.getAttrForces=function(t,e,r,n,i,o,a,s){for(var u=this.nodes,l=this.preventOverlap,c=this.dissuadeHubs,f=this.mode,h=this.prune,p=0;p 0&&(x=b,w=b),s[2*n[d.id]]+=x*m[0],s[2*n[v.id]]-=w*m[0],s[2*n[d.id]+1]+=x*m[1],s[2*n[v.id]+1]-=w*m[1]}}return s},e.prototype.getRepGraForces=function(t,e,r,n,i,o){for(var a=this.nodes,s=this.preventOverlap,u=this.kr,l=this.kg,c=this.center,f=this.prune,h=a.length,p=0;p 0&&(g=u*(o[p]+1)*(o[d]+1)/v),r[2*p]-=g*y[0],r[2*d]+=g*y[0],r[2*p+1]-=g*y[1],r[2*d+1]+=g*y[1]}var m=[a[p].x-c[0],a[p].y-c[1]],b=Math.hypot(m[0],m[1]);m[0]=m[0]/b,m[1]=m[1]/b;var x=l*(o[p]+1);r[2*p]-=x*m[0],r[2*p+1]-=x*m[1]}return r},e.prototype.getOptRepGraForces=function(t,e,r){for(var n=this.nodes,i=this.kg,o=this.center,a=this.prune,s=n.length,u=9e10,f=-9e10,h=9e10,p=-9e10,d=0;d =f&&(f=n[d].x),n[d].x<=u&&(u=n[d].x),n[d].y>=p&&(p=n[d].y),n[d].y<=h&&(h=n[d].y));var y={xmid:(f+u)/2,ymid:(p+h)/2,length:Math.max(f-u,p-h),massCenter:o,mass:s},v=new l.default(y),g=new c.default(v);for(d=0;d1.5*x?1.5*x:r);for(y=0;yS?S:w)*t[2*y],k=w*t[2*y+1];i[y].x+=E,i[y].y+=k}return{nodes:i,sg:r}},e}(a.Base);e.ForceAtlas2Layout=f},5138:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t){this.xmid=t.xmid,this.ymid=t.ymid,this.length=t.length,this.massCenter=t.massCenter||[0,0],this.mass=t.mass||1}return t.prototype.getLength=function(){return this.length},t.prototype.contains=function(t,e){var r=this.length/2;return t<=this.xmid+r&&t>=this.xmid-r&&e<=this.ymid+r&&e>=this.ymid-r},t.prototype.NW=function(){return new t({xmid:this.xmid-this.length/4,ymid:this.ymid+this.length/4,length:this.length/2})},t.prototype.NE=function(){return new t({xmid:this.xmid+this.length/4,ymid:this.ymid+this.length/4,length:this.length/2})},t.prototype.SW=function(){return new t({xmid:this.xmid-this.length/4,ymid:this.ymid-this.length/4,length:this.length/2})},t.prototype.SE=function(){return new t({xmid:this.xmid+this.length/4,ymid:this.ymid-this.length/4,length:this.length/2})},t}();e.default=r},5490:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t){this.body=null,this.quad=null,this.NW=null,this.NE=null,this.SW=null,this.SE=null,this.theta=.5,null!=t&&(this.quad=t)}return t.prototype.insert=function(e){null!=this.body?this._isExternal()?(this.quad&&(this.NW=new t(this.quad.NW()),this.NE=new t(this.quad.NE()),this.SW=new t(this.quad.SW()),this.SE=new t(this.quad.SE())),this._putBody(this.body),this._putBody(e),this.body=this.body.add(e)):(this.body=this.body.add(e),this._putBody(e)):this.body=e},t.prototype._putBody=function(t){this.quad&&(t.in(this.quad.NW())&&this.NW?this.NW.insert(t):t.in(this.quad.NE())&&this.NE?this.NE.insert(t):t.in(this.quad.SW())&&this.SW?this.SW.insert(t):t.in(this.quad.SE())&&this.SE&&this.SE.insert(t))},t.prototype._isExternal=function(){return null==this.NW&&null==this.NE&&null==this.SW&&null==this.SE},t.prototype.updateForce=function(t){null!=this.body&&t!==this.body&&(this._isExternal()?t.addForce(this.body):(this.quad?this.quad.getLength():0)/this.body.distanceTo(t) -1||(e[n]=t[n])}),e}),this.ticking=!1},e.prototype.execute=function(t){var e=this,r=e.nodes,n=e.edges;if(!e.ticking){var i=e.forceSimulation,o=e.alphaMin,a=e.alphaDecay,s=e.alpha;if(i){if(t)if(e.clustering&&e.clusterForce&&(e.clusterForce.nodes(r),e.clusterForce.links(n)),i.nodes(r),n&&e.edgeForce)e.edgeForce.links(n);else if(n&&!e.edgeForce){h=l.forceLink().id(function(t){return t.id}).links(n);e.edgeStrength&&h.strength(e.edgeStrength),e.linkDistance&&h.distance(e.linkDistance),e.edgeForce=h,i.force("link",h)}e.preventOverlap&&e.overlapProcess(i),i.alpha(s).restart(),this.ticking=!0}else try{var u=l.forceManyBody();if(e.nodeStrength&&u.strength(e.nodeStrength),i=l.forceSimulation().nodes(r),e.clustering){var f=(0,c.default)();f.centerX(e.center[0]).centerY(e.center[1]).template("force").strength(e.clusterFociStrength),n&&f.links(n),r&&f.nodes(r),f.forceLinkDistance(e.clusterEdgeDistance).forceLinkStrength(e.clusterEdgeStrength).forceCharge(e.clusterNodeStrength).forceNodeSize(e.clusterNodeSize),e.clusterForce=f,i.force("group",f)}if(i.force("center",l.forceCenter(e.center[0],e.center[1])).force("charge",u).alpha(s).alphaDecay(a).alphaMin(o),e.preventOverlap&&e.overlapProcess(i),n){var h=l.forceLink().id(function(t){return t.id}).links(n);e.edgeStrength&&h.strength(e.edgeStrength),e.linkDistance&&h.distance(e.linkDistance),e.edgeForce=h,i.force("link",h)}if(e.workerEnabled&&!y()&&(e.workerEnabled=!1,console.warn("workerEnabled option is only supported when running in web worker.")),e.workerEnabled){i.stop();for(var d=function(t){var e=t.alphaMin(),r=t.alphaTarget(),n=t.alpha(),i=Math.log((e-r)/(n-r))/Math.log(1-t.alphaDecay());return Math.ceil(i)}(i),v=1;v<=d;v++)i.tick(),postMessage({nodes:r,currentTick:v,totalTicks:d,type:p.LAYOUT_MESSAGE.TICK},void 0);e.ticking=!1}else i.on("tick",function(){e.tick()}).on("end",function(){e.ticking=!1,e.onLayoutEnd&&e.onLayoutEnd()}),e.ticking=!0;e.forceSimulation=i,e.ticking=!0}catch(t){e.ticking=!1,console.warn(t)}}},e.prototype.overlapProcess=function(t){var e,r,n=this.nodeSize,i=this.nodeSpacing,o=this.collideStrength;if(r=(0,f.isNumber)(i)?function(){return i}:(0,f.isFunction)(i)?i:function(){return 0},n)if((0,f.isFunction)(n))e=function(t){return n(t)+r(t)};else if((0,f.isArray)(n)){var a=(n[0]>n[1]?n[0]:n[1])/2;e=function(t){return a+r(t)}}else if((0,f.isNumber)(n)){var s=n/2;e=function(t){return s+r(t)}}else e=function(){return 10};else e=function(t){return t.size?(0,f.isArray)(t.size)?(t.size[0]>t.size[1]?t.size[0]:t.size[1])/2+r(t):(0,f.isObject)(t.size)?(t.size.width>t.size.height?t.size.width:t.size.height)/2+r(t):t.size/2+r(t):10+r(t)};t.force("collisionForce",l.forceCollide(e).strength(o))},e.prototype.updateCfg=function(t){this.ticking&&(this.forceSimulation.stop(),this.ticking=!1),this.forceSimulation=null,Object.assign(this,t)},e.prototype.destroy=function(){this.ticking&&(this.forceSimulation.stop(),this.ticking=!1),this.nodes=null,this.edges=null,this.destroyed=!0},e}(h.Base);function y(){return"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope}e.ForceLayout=d},574:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);i&&("get"in i?e.__esModule:!i.writable&&!i.configurable)||(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(5989),e)},6983:function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.FruchtermanLayout=void 0;var o=r(8933),a=r(864),s=function(t){function e(e){var r=t.call(this)||this;return r.maxIteration=1e3,r.workerEnabled=!1,r.gravity=10,r.speed=5,r.clustering=!1,r.clusterGravity=10,r.nodes=[],r.edges=[],r.width=300,r.height=300,r.nodeMap={},r.nodeIdxMap={},r.onLayoutEnd=function(){},r.tick=function(){},r.animate=!0,r.updateCfg(e),r}return i(e,t),e.prototype.getDefaultCfg=function(){return{maxIteration:1e3,gravity:10,speed:1,clustering:!1,clusterGravity:10,animate:!0}},e.prototype.execute=function(){var t,e,r=this,n=this.nodes;if(void 0!==this.timeInterval&&"undefined"!=typeof window&&window.clearInterval(this.timeInterval),n&&0!==n.length){this.width||"undefined"==typeof window||(this.width=window.innerWidth),this.height||"undefined"==typeof window||(this.height=window.innerHeight),this.center||(this.center=[this.width/2,this.height/2]);var i=this.center;if(1===n.length)return n[0].x=i[0],n[0].y=i[1],void(null===(e=this.onLayoutEnd)||void 0===e||e.call(this));var o={},s={};return n.forEach(function(t,e){(0,a.isNumber)(t.x)||(t.x=Math.random()*r.width),(0,a.isNumber)(t.y)||(t.y=Math.random()*r.height),o[t.id]=t,s[t.id]=e}),this.nodeMap=o,this.nodeIdxMap=s,this.run()}null===(t=this.onLayoutEnd)||void 0===t||t.call(this)},e.prototype.run=function(){var t,e=this,r=e.nodes;if(r){var n=e.edges,i=e.maxIteration,o=e.workerEnabled,a=e.clustering,s=e.animate,u={};if(a&&r.forEach(function(t){void 0===u[t.cluster]&&(u[t.cluster]={name:t.cluster,cx:0,cy:0,count:0})}),o||!s){for(var l=0;l=i&&(null===(t=e.onLayoutEnd)||void 0===t||t.call(e),window.clearInterval(e.timeInterval))},0)}return{nodes:r,edges:n}}},e.prototype.runOneStep=function(t){var e,r=this.nodes;if(r){var n=this.edges,i=this.center,o=this.gravity,s=this.speed,u=this.clustering,l=this.height*this.width,c=Math.sqrt(l)/10,f=l/(r.length+1),h=Math.sqrt(f),p=[];if(r.forEach(function(t,e){p[e]={x:0,y:0}}),this.applyCalculate(r,n,p,h,f),u){for(var d in t)t[d].cx=0,t[d].cy=0,t[d].count=0;for(var d in r.forEach(function(e){var r=t[e.cluster];(0,a.isNumber)(e.x)&&(r.cx+=e.x),(0,a.isNumber)(e.y)&&(r.cy+=e.y),r.count++}),t)t[d].cx/=t[d].count,t[d].cy/=t[d].count;var y=this.clusterGravity||o;r.forEach(function(e,r){if((0,a.isNumber)(e.x)&&(0,a.isNumber)(e.y)){var n=t[e.cluster],i=Math.sqrt((e.x-n.cx)*(e.x-n.cx)+(e.y-n.cy)*(e.y-n.cy)),o=h*y;p[r].x-=o*(e.x-n.cx)/i,p[r].y-=o*(e.y-n.cy)/i}})}r.forEach(function(t,e){if((0,a.isNumber)(t.x)&&(0,a.isNumber)(t.y)){var r=.01*h*o;p[e].x-=r*(t.x-i[0]),p[e].y-=r*(t.y-i[1])}}),r.forEach(function(t,e){if((0,a.isNumber)(t.fx)&&(0,a.isNumber)(t.fy))return t.x=t.fx,void(t.y=t.fy);if((0,a.isNumber)(t.x)&&(0,a.isNumber)(t.y)){var r=Math.sqrt(p[e].x*p[e].x+p[e].y*p[e].y);if(r>0){var n=Math.min(c*(s/800),r);t.x+=p[e].x/r*n,t.y+=p[e].y/r*n}}}),null===(e=this.tick)||void 0===e||e.call(this)}},e.prototype.applyCalculate=function(t,e,r,n,i){this.calRepulsive(t,r,i),e&&this.calAttractive(e,r,n)},e.prototype.calRepulsive=function(t,e,r){t.forEach(function(n,i){e[i]={x:0,y:0},t.forEach(function(t,o){if(i!==o&&(0,a.isNumber)(n.x)&&(0,a.isNumber)(t.x)&&(0,a.isNumber)(n.y)&&(0,a.isNumber)(t.y)){var s=n.x-t.x,u=n.y-t.y,l=s*s+u*u;if(0===l){l=1;var c=i>o?1:-1;s=.01*c,u=.01*c}var f=r/l;e[i].x+=s*f,e[i].y+=u*f}})})},e.prototype.calAttractive=function(t,e,r){var n=this;t.forEach(function(t){var i=(0,a.getEdgeTerminal)(t,"source"),o=(0,a.getEdgeTerminal)(t,"target");if(i&&o){var s=n.nodeIdxMap[i],u=n.nodeIdxMap[o];if(s!==u){var l=n.nodeMap[i],c=n.nodeMap[o];if((0,a.isNumber)(c.x)&&(0,a.isNumber)(l.x)&&(0,a.isNumber)(c.y)&&(0,a.isNumber)(l.y)){var f=c.x-l.x,h=c.y-l.y,p=Math.sqrt(f*f+h*h),d=p*p/r;e[u].x-=f/p*d,e[u].y-=h/p*d,e[s].x+=f/p*d,e[s].y+=h/p*d}}}})},e.prototype.stop=function(){this.timeInterval&&"undefined"!=typeof window&&window.clearInterval(this.timeInterval)},e.prototype.destroy=function(){this.stop(),this.tick=null,this.nodes=null,this.edges=null,this.destroyed=!0},e.prototype.getType=function(){return"fruchterman"},e}(o.Base);e.FruchtermanLayout=s},4600:function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.GForceLayout=void 0;var o=r(8933),a=r(864),s=function(t,e){return t?(0,a.isNumber)(t)?function(e){return t}:t:function(t){return e||1}},u=function(t){function e(e){var r=t.call(this)||this;return r.maxIteration=500,r.workerEnabled=!1,r.edgeStrength=200,r.nodeStrength=1e3,r.coulombDisScale=.005,r.damping=.9,r.maxSpeed=1e3,r.minMovement=.5,r.interval=.02,r.factor=1,r.linkDistance=1,r.gravity=10,r.preventOverlap=!0,r.collideStrength=1,r.tick=function(){},r.nodes=[],r.edges=[],r.width=300,r.height=300,r.nodeMap={},r.nodeIdxMap={},r.animate=!0,r.updateCfg(e),r}return i(e,t),e.prototype.getDefaultCfg=function(){return{maxIteration:500,gravity:10,enableTick:!0,animate:!0}},e.prototype.execute=function(){var t,e,r=this,n=r.nodes;if(void 0!==r.timeInterval&&"undefined"!=typeof window&&window.clearInterval(r.timeInterval),n&&0!==n.length){r.width||"undefined"==typeof window||(r.width=window.innerWidth),r.height||"undefined"==typeof window||(r.height=window.innerHeight),r.center||(r.center=[r.width/2,r.height/2]);var i=r.center;if(1===n.length)return n[0].x=i[0],n[0].y=i[1],void(null===(e=r.onLayoutEnd)||void 0===e||e.call(r));var o={},u={};n.forEach(function(t,e){(0,a.isNumber)(t.x)||(t.x=Math.random()*r.width),(0,a.isNumber)(t.y)||(t.y=Math.random()*r.height),o[t.id]=t,u[t.id]=e}),r.nodeMap=o,r.nodeIdxMap=u,r.linkDistance=s(r.linkDistance,1),r.nodeStrength=s(r.nodeStrength,1),r.edgeStrength=s(r.edgeStrength,1);var l,c=r.nodeSize;if(r.preventOverlap){var f,h=r.nodeSpacing;f=(0,a.isNumber)(h)?function(){return h}:(0,a.isFunction)(h)?h:function(){return 0},l=c?(0,a.isArray)(c)?function(t){return Math.max(c[0],c[1])+f(t)}:function(t){return c+f(t)}:function(t){return t.size?(0,a.isArray)(t.size)?Math.max(t.size[0],t.size[1])+f(t):(0,a.isObject)(t.size)?Math.max(t.size.width,t.size.height)+f(t):t.size+f(t):10+f(t)}}r.nodeSize=l;var p=r.edges;r.degrees=(0,a.getDegree)(n.length,r.nodeIdxMap,p),r.getMass||(r.getMass=function(t){return t.mass||r.degrees[r.nodeIdxMap[t.id]].all||1}),r.run()}else null===(t=r.onLayoutEnd)||void 0===t||t.call(r)},e.prototype.run=function(){var t,e=this,r=e.maxIteration,n=e.nodes,i=e.workerEnabled,o=e.minMovement,a=e.animate;if(n)if(i||!a){for(var s=0;s =r&&(null===(i=e.onLayoutEnd)||void 0===i||i.call(e),window.clearInterval(e.timeInterval))}},0)}},e.prototype.reachMoveThreshold=function(t,e,r){var n=0;return t.forEach(function(t,r){var i=t.x-e[r].x,o=t.y-e[r].y;n+=Math.sqrt(i*i+o*o)}),(n/=t.length) =h)){var p=a.x-e.x,d=a.y-e.y;0===p&&0===d&&(p=.01*Math.random(),d=.01*Math.random());var y=p*p+d*d,v=Math.sqrt(y),g=(v+.1)*i,m=p/v,b=d/v,x=.5*(u(a)+u(e))*n/(g*g),w=r?r(e):1;if(t[2*c]+=m*x,t[2*c+1]+=b*x,t[2*h]-=m*x,t[2*h+1]-=b*x,o&&(l(a)+l(e))/2>v){var _=s*(u(a)+u(e))*.5/y;t[2*c]+=m*_/f,t[2*c+1]+=b*_/f,t[2*h]-=m*_/w,t[2*h+1]-=b*_/w}}})})},e.prototype.calAttractive=function(t,e){var r=this.nodeMap,n=this.nodeIdxMap,i=this.linkDistance,o=this.edgeStrength,s=this.nodeSize,u=this.getMass;e.forEach(function(e,l){var c=(0,a.getEdgeTerminal)(e,"source"),f=(0,a.getEdgeTerminal)(e,"target"),h=r[c],p=r[f],d=p.x-h.x,y=p.y-h.y;0===d&&0===y&&(d=.01*Math.random(),y=.01*Math.random());var v=Math.sqrt(d*d+y*y),g=d/v,m=y/v,b=((i(e,h,p)||1+(s(h)+s(p)||0)/2)-v)*o(e),x=n[c],w=n[f],_=u?u(h):1,S=u?u(p):1;t[2*x]-=g*b/_,t[2*x+1]-=m*b/_,t[2*w]+=g*b/S,t[2*w+1]+=m*b/S})},e.prototype.calGravity=function(t,e){for(var r=this.center,n=this.gravity,i=this.degrees,o=e.length,s=0;s i.maxSpeed){var l=i.maxSpeed/u;a*=l,s*=l}e[2*n]=a,e[2*n+1]=s})},e.prototype.updatePosition=function(t,e,r){r.forEach(function(r,n){if((0,a.isNumber)(r.fx)&&(0,a.isNumber)(r.fy))return r.x=r.fx,void(r.y=r.fy);var i=t[2*n]*e,o=t[2*n+1]*e;r.x+=i,r.y+=o})},e.prototype.stop=function(){this.timeInterval&&"undefined"!=typeof window&&window.clearInterval(this.timeInterval)},e.prototype.destroy=function(){this.stop(),this.tick=null,this.nodes=null,this.edges=null,this.destroyed=!0},e.prototype.getType=function(){return"gForce"},e}(o.Base);e.GForceLayout=u},8834:function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function a(t){try{u(n.next(t))}catch(t){o(t)}}function s(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r(function(t){t(e)})).then(a,s)}u((n=n.apply(t,e||[])).next())})},a=this&&this.__generator||function(t,e){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(u){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(i=2&s[0]?n.return:s[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;switch(n=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===s[0]||2===s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1] 0.0) {\n dx += param * xDist;\n dy += param * yDist;\n if (xDist == 0 && yDist == 0) {\n const sign = i < j ? 1 : -1;\n dx += param * sign;\n dy += param * sign;\n }\n }\n }\n }\n return [dx, dy];\n }\n calcGravity(currentNode: vec4, nodeAttributes: vec4): vec2 { // \n let dx = 0, dy = 0;\n const vx = currentNode[0] - this.u_Center[0];\n const vy = currentNode[1] - this.u_Center[1];\n const gf = 0.01 * this.u_K * this.u_Gravity;\n dx = gf * vx;\n dy = gf * vy;\n if (this.u_Clustering == 1) {\n const clusterIdx = int(nodeAttributes[0]);\n const center = this.u_ClusterCenters[clusterIdx];\n const cvx = currentNode[0] - center[0];\n const cvy = currentNode[1] - center[1];\n const dist = sqrt(cvx * cvx + cvy * cvy) + 0.01;\n const parma = this.u_K * this.u_ClusterGravity / dist;\n dx += parma * cvx;\n dy += parma * cvy;\n }\n return [dx, dy];\n }\n calcAttractive(i: int, currentNode: vec4): vec2 {\n let dx = 0, dy = 0;\n const arr_offset = int(floor(currentNode[2] + 0.5));\n const length = int(floor(currentNode[3] + 0.5));\n const node_buffer: vec4;\n for (let p = 0; p < MAX_EDGE_PER_VERTEX; p++) {\n if (p >= length) break;\n const arr_idx = arr_offset + p;\n // when arr_idx % 4 == 0 update currentNodedx_buffer\n const buf_offset = arr_idx - arr_idx / 4 * 4;\n if (p == 0 || buf_offset == 0) {\n node_buffer = this.u_Data[int(arr_idx / 4)];\n }\n const float_j = buf_offset == 0 ? node_buffer[0] :\n buf_offset == 1 ? node_buffer[1] :\n buf_offset == 2 ? node_buffer[2] :\n node_buffer[3];\n const nextNode = this.u_Data[int(float_j)];\n const xDist = currentNode[0] - nextNode[0];\n const yDist = currentNode[1] - nextNode[1];\n const dist = sqrt(xDist * xDist + yDist * yDist) + 0.01;\n let attractiveF = dist / this.u_K;\n \n if (dist > 0.0) {\n dx -= xDist * attractiveF;\n dy -= yDist * attractiveF;\n if (xDist == 0 && yDist == 0) {\n const sign = i < int(float_j) ? 1 : -1;\n dx -= sign * attractiveF;\n dy -= sign * attractiveF;\n }\n }\n }\n return [dx, dy];\n }\n @main\n compute() {\n const i = globalInvocationID.x;\n const currentNode = this.u_Data[i];\n let dx = 0, dy = 0;\n if (i >= VERTEX_COUNT) {\n this.u_Data[i] = currentNode;\n return;\n }\n\n // [gravity, fx, fy, 0]\n const nodeAttributes = this.u_AttributeArray[i];\n\n if (nodeAttributes[1] != 0 && nodeAttributes[2] != 0) {\n // the node is fixed\n this.u_Data[i] = [\n nodeAttributes[1],\n nodeAttributes[2],\n currentNode[2],\n currentNode[3]\n ];\n return;\n }\n\n // repulsive\n const repulsive = this.calcRepulsive(i, currentNode);\n dx += repulsive[0];\n dy += repulsive[1];\n // attractive\n const attractive = this.calcAttractive(i, currentNode);\n dx += attractive[0];\n dy += attractive[1];\n // gravity\n const gravity = this.calcGravity(currentNode, nodeAttributes);\n dx -= gravity[0];\n dy -= gravity[1];\n // speed\n dx *= this.u_Speed;\n dy *= this.u_Speed;\n\n // move\n const distLength = sqrt(dx * dx + dy * dy);\n if (distLength > 0.0) {\n const limitedDist = min(this.u_MaxDisplace * this.u_Speed, distLength);\n this.u_Data[i] = [\n currentNode[0] + dx / distLength * limitedDist,\n currentNode[1] + dy / distLength * limitedDist,\n currentNode[2],\n currentNode[3]\n ];\n }\n }\n}\n",e.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}}',e.clusterCode="\nimport { globalInvocationID } from 'g-webgpu';\nconst VERTEX_COUNT;\nconst CLUSTER_COUNT;\n@numthreads(1, 1, 1)\nclass CalcCenter {\n @in\n u_Data: vec4[];\n @in\n u_NodeAttributes: vec4[]; // [[clusterIdx, 0, 0, 0], ...]\n @in @out\n u_ClusterCenters: vec4[]; // [[cx, cy, nodeCount, clusterIdx], ...]\n @main\n compute() {\n const i = globalInvocationID.x;\n const center = this.u_ClusterCenters[i];\n let sumx = 0;\n let sumy = 0;\n let count = 0;\n for (let j = 0; j < VERTEX_COUNT; j++) {\n const attributes = this.u_NodeAttributes[j];\n const clusterIdx = int(attributes[0]);\n const vertex = this.u_Data[j];\n if (clusterIdx == i) {\n sumx += vertex.x;\n sumy += vertex.y;\n count += 1;\n }\n }\n this.u_ClusterCenters[i] = [\n sumx / count,\n sumy / count,\n count,\n i\n ];\n }\n}\n",e.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}}'},1011:function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function a(t){try{u(n.next(t))}catch(t){o(t)}}function s(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r(function(t){t(e)})).then(a,s)}u((n=n.apply(t,e||[])).next())})},a=this&&this.__generator||function(t,e){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(u){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(i=2&s[0]?n.return:s[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;switch(n=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===s[0]||2===s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]= length) break;\n const arr_idx = arr_offset + 4 * p; // i 节点的第 p 条边开始的小格子位置\n const buf_offset = arr_idx - arr_idx / 4 * 4;\n if (p == 0 || buf_offset == 0) {\n node_buffer = this.u_Data[int(arr_idx / 4)]; // 大格子,大格子位置=小个子位置 / 4,\n }\n\n let float_j: float = node_buffer[0];\n\n const nextNode = this.u_Data[int(float_j)];\n const vx = nextNode[0] - currentNode[0];\n const vy = nextNode[1] - currentNode[1];\n const dist = sqrt(vx * vx + vy * vy) + 0.01;\n const direx = vx / dist;\n const direy = vy / dist;\n const edgeLength = node_buffer[1];\n const edgeStrength = node_buffer[2];\n const diff: float = edgeLength - dist;//edgeLength\n // const param = diff * this.u_stiffness / mass; //\n const param = diff * edgeStrength / mass; // \n ax -= direx * param;\n ay -= direy * param;\n }\n return [ax, ay];\n }\n\n @main\n compute() {\n const i = globalInvocationID.x;\n const currentNode = this.u_Data[i];\n const movement = u_AveMovement[0];\n let ax = 0, ay = 0;\n\n if (i >= VERTEX_COUNT || movement.x < u_minMovement) {\n this.u_Data[i] = currentNode;\n return;\n }\n\n // 每个节点属性占两个数组中各一格\n // [mass, degree, nodeStrength, fx]\n const nodeAttributes1 = this.u_NodeAttributeArray1[i];\n // [centerX, centerY, centerGravity, fy]\n const nodeAttributes2 = this.u_NodeAttributeArray2[i];\n\n // repulsive\n const repulsive = this.calcRepulsive(i, currentNode);\n ax += repulsive[0];\n ay += repulsive[1];\n\n // attractive\n const attractive = this.calcAttractive(i, currentNode, nodeAttributes1);\n ax += attractive[0];\n ay += attractive[1];\n\n // gravity\n const gravity = this.calcGravity(i, currentNode, nodeAttributes2);\n ax -= gravity[0];\n ay -= gravity[1];\n\n // speed\n const param = this.u_interval * this.u_damping;\n let vx = ax * param;\n let vy = ay * param;\n const vlength = sqrt(vx * vx + vy * vy) + 0.0001;\n if (vlength > this.u_maxSpeed) {\n const param2 = this.u_maxSpeed / vlength;\n vx = param2 * vx;\n vy = param2 * vy;\n }\n\n // move\n if (nodeAttributes1[3] != 0 && nodeAttributes2[3] != 0) {\n this.u_Data[i] = [\n nodeAttributes1[3],\n nodeAttributes2[3],\n currentNode[2],\n 0\n ];\n } else {\n const distx = vx * this.u_interval;\n const disty = vy * this.u_interval;\n const distLength = sqrt(distx * distx + disty * disty);\n this.u_Data[i] = [\n currentNode[0] + distx,\n currentNode[1] + disty,\n currentNode[2],\n distLength\n ];\n }\n \n // the avarage move distance\n // need to share memory\n \n }\n}\n",e.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}}',e.aveMovementCode="\nconst VERTEX_COUNT;\n@numthreads(1, 1, 1)\nclass CalcAveMovement {\n @in\n u_Data: vec4[];\n @in\n u_iter: float;\n @in @out\n u_AveMovement: vec4[];\n @main\n compute() {\n let movement = 0;\n for (let j: int = 0; j < VERTEX_COUNT; j++) {\n const vertex = this.u_Data[j];\n movement += vertex[3];\n }\n movement = movement / float(VERTEX_COUNT);\n this.u_AveMovement[0] = [movement, 0, 0, 0];\n }\n}\n",e.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}}'},7808:function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.GridLayout=void 0;var o=r(864),a=function(t){function e(e){var r=t.call(this)||this;return r.begin=[0,0],r.preventOverlap=!0,r.preventOverlapPadding=10,r.condense=!1,r.sortBy="degree",r.nodes=[],r.edges=[],r.width=300,r.height=300,r.row=0,r.col=0,r.cellWidth=0,r.cellHeight=0,r.cellUsed={},r.id2manPos={},r.onLayoutEnd=function(){},r.updateCfg(e),r}return i(e,t),e.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}},e.prototype.execute=function(){var t=this,e=t.nodes,r=t.edges,n=t.begin,i=e.length;if(0===i)return t.onLayoutEnd&&t.onLayoutEnd(),{nodes:e,edges:r};if(1===i)return e[0].x=n[0],e[0].y=n[1],t.onLayoutEnd&&t.onLayoutEnd(),{nodes:e,edges:r};var a=t.sortBy,s=t.width,u=t.height,l=t.condense,c=t.preventOverlapPadding,f=t.preventOverlap,h=t.nodeSpacing,p=t.nodeSize,d=[];e.forEach(function(t){d.push(t)});var y={};if(d.forEach(function(t,e){y[t.id]=e}),("degree"===a||!(0,o.isString)(a)||void 0===d[0][a])&&(a="degree",(0,o.isNaN)(e[0].degree))){var v=(0,o.getDegree)(d.length,y,r);d.forEach(function(t,e){t.degree=v[e].all})}d.sort(function(t,e){return e[a]-t[a]}),s||"undefined"==typeof window||(s=window.innerWidth),u||"undefined"==typeof window||(u=window.innerHeight);var g=t.rows,m=null!=t.cols?t.cols:t.columns;if(t.cells=i,null!=g&&null!=m?(t.rows=g,t.cols=m):null!=g&&null==m?(t.rows=g,t.cols=Math.ceil(t.cells/t.rows)):null==g&&null!=m?(t.cols=m,t.rows=Math.ceil(t.cells/t.cols)):(t.splits=Math.sqrt(t.cells*t.height/t.width),t.rows=Math.round(t.splits),t.cols=Math.round(t.width/t.height*t.splits)),t.rows=Math.max(t.rows,1),t.cols=Math.max(t.cols,1),t.cols*t.rows>t.cells)((x=t.small())-1)*(b=t.large())>=t.cells?t.small(x-1):(b-1)*x>=t.cells&&t.large(b-1);else for(;t.cols*t.rows =t.cells?t.large(b+1):t.small(x+1)}if(t.cellWidth=s/t.cols,t.cellHeight=u/t.rows,l&&(t.cellWidth=0,t.cellHeight=0),f||h){var w=(0,o.getFuncByUnknownType)(10,h),_=(0,o.getFuncByUnknownType)(30,p,!1);d.forEach(function(e){e.x&&e.y||(e.x=0,e.y=0);var r,n,i=_(e)||30;(0,o.isArray)(i)?(r=i[0],n=i[1]):(r=i,n=i);var a=void 0!==w?w(e):c,s=r+a,u=n+a;t.cellWidth=Math.max(t.cellWidth,s),t.cellHeight=Math.max(t.cellHeight,u)})}t.cellUsed={},t.row=0,t.col=0,t.id2manPos={};for(var S=0;S =t&&(this.col=0,this.row++)},e.prototype.getPos=function(t){var e,r,n=this.begin,i=this.cellWidth,o=this.cellHeight,a=this.id2manPos[t.id];if(a)e=a.col*i+i/2+n[0],r=a.row*o+o/2+n[1];else{for(;this.used(this.row,this.col);)this.moveToNextCell();e=this.col*i+i/2+n[0],r=this.row*o+o/2+n[1],this.use(this.row,this.col),this.moveToNextCell()}t.x=e,t.y=r},e.prototype.getType=function(){return"grid"},e}(r(8933).Base);e.GridLayout=a},9390:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);i&&("get"in i?e.__esModule:!i.writable&&!i.configurable)||(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.ERLayout=e.ForceAtlas2Layout=e.ComboCombinedLayout=e.ComboForceLayout=e.GForceGPULayout=e.FruchtermanGPULayout=e.FruchtermanLayout=e.MDSLayout=e.ConcentricLayout=e.RadialLayout=e.DagreCompoundLayout=e.DagreLayout=e.CircularLayout=e.ForceLayout=e.Force2Layout=e.GForceLayout=e.RandomLayout=e.GridLayout=e.Layouts=e.Layout=void 0;var o=r(7808);Object.defineProperty(e,"GridLayout",{enumerable:!0,get:function(){return o.GridLayout}});var a=r(1783);Object.defineProperty(e,"RandomLayout",{enumerable:!0,get:function(){return a.RandomLayout}});var s=r(4600);Object.defineProperty(e,"GForceLayout",{enumerable:!0,get:function(){return s.GForceLayout}});var u=r(8944);Object.defineProperty(e,"Force2Layout",{enumerable:!0,get:function(){return u.Force2Layout}});var l=r(574);Object.defineProperty(e,"ForceLayout",{enumerable:!0,get:function(){return l.ForceLayout}});var c=r(2381);Object.defineProperty(e,"CircularLayout",{enumerable:!0,get:function(){return c.CircularLayout}});var f=r(4855);Object.defineProperty(e,"DagreLayout",{enumerable:!0,get:function(){return f.DagreLayout}});var h=r(6006);Object.defineProperty(e,"DagreCompoundLayout",{enumerable:!0,get:function(){return h.DagreCompoundLayout}});var p=r(1884);Object.defineProperty(e,"RadialLayout",{enumerable:!0,get:function(){return p.RadialLayout}});var d=r(3080);Object.defineProperty(e,"ConcentricLayout",{enumerable:!0,get:function(){return d.ConcentricLayout}});var y=r(5084);Object.defineProperty(e,"MDSLayout",{enumerable:!0,get:function(){return y.MDSLayout}});var v=r(6983);Object.defineProperty(e,"FruchtermanLayout",{enumerable:!0,get:function(){return v.FruchtermanLayout}});var g=r(8834);Object.defineProperty(e,"FruchtermanGPULayout",{enumerable:!0,get:function(){return g.FruchtermanGPULayout}});var m=r(1011);Object.defineProperty(e,"GForceGPULayout",{enumerable:!0,get:function(){return m.GForceGPULayout}});var b=r(5773);Object.defineProperty(e,"ComboForceLayout",{enumerable:!0,get:function(){return b.ComboForceLayout}});var x=r(995);Object.defineProperty(e,"ComboCombinedLayout",{enumerable:!0,get:function(){return x.ComboCombinedLayout}});var w=r(3209);Object.defineProperty(e,"ForceAtlas2Layout",{enumerable:!0,get:function(){return w.ForceAtlas2Layout}});var _=r(6244);Object.defineProperty(e,"ERLayout",{enumerable:!0,get:function(){return _.ERLayout}});var S=r(2766);Object.defineProperty(e,"Layout",{enumerable:!0,get:function(){return S.Layout}}),Object.defineProperty(e,"Layouts",{enumerable:!0,get:function(){return S.Layouts}}),i(r(6451),e)},2766:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Layouts=e.Layout=void 0;var n=r(521),i=r(7808),o=r(1783),a=r(8944),s=r(4600),u=r(574),l=r(2381),c=r(4855),f=r(1884),h=r(3080),p=r(5084),d=r(6983),y=r(8834),v=r(1011),g=r(5773),m=r(995),b=r(3209),x=r(6244),w=r(6006),_=r(864),S=function(){function t(t){var e=(0,n.getLayoutByName)(t.type);this.layoutInstance=new e(t)}return t.prototype.layout=function(t){return this.layoutInstance.layout(t)},t.prototype.updateCfg=function(t){this.layoutInstance.updateCfg(t)},t.prototype.init=function(t){this.correctLayers(t.nodes),this.layoutInstance.init(t)},t.prototype.correctLayers=function(t){if(null===t||void 0===t?void 0:t.length){var e=1/0,r=[];if(t.forEach(function(t){(0,_.isString)(t.layer)&&(t.layer=parseInt(t.layer,10)),void 0===t.layer||isNaN(t.layer)||(r.push(t),t.layer n[0]?n[0]:b-n[0],_=x-n[1]>n[1]?n[1]:x-n[1];0===w&&(w=b/2),0===_&&(_=x/2);var S=_>w?w:_,E=Math.max.apply(Math,m),k=[];m.forEach(function(e,r){t.unitRadius||(t.unitRadius=S/E),k[r]=e*t.unitRadius}),t.radii=k;var T=t.eIdealDisMatrix();t.eIdealDistances=T;var C=function(t){for(var e=t.length,r=t[0].length,n=[],i=0;i M[1]?M[0]:M[1])+L(t)}:function(t){return M+L(t)}:function(t){return t.size?(0,a.isArray)(t.size)?(t.size[0]>t.size[1]?t.size[0]:t.size[1])+L(t):(0,a.isObject)(t.size)?(t.size.width>t.size.height?t.size.width:t.size.height)+L(t):t.size+L(t):10+L(t)};var N={nodes:e,nodeSizeFunc:A,adjMatrix:y,positions:O,radii:k,height:x,width:b,strictRadial:I,focusID:d,iterations:t.maxPreventOverlapIteration||200,k:O.length/4.5},R=new l.default(N);O=R.layout()}return O.forEach(function(t,r){e[r].x=t[0]+n[0],e[r].y=t[1]+n[1]}),t.onLayoutEnd&&t.onLayoutEnd(),{nodes:e,edges:r}}t.onLayoutEnd&&t.onLayoutEnd()},e.prototype.run=function(){for(var t=this.maxIteration,e=this.positions||[],r=this.weights||[],n=this.eIdealDistances||[],i=this.radii||[],o=0;o<=t;o++){var a=o/t;this.oneIteration(a,e,i,n,r)}},e.prototype.oneIteration=function(t,e,r,n,i){var o=1-t,a=this.focusIndex;e.forEach(function(s,u){var l=c(s,[0,0]),f=0===l?0:1/l;if(u!==a){var h=0,p=0,d=0;e.forEach(function(t,e){if(u!==e){var r=c(s,t),o=0===r?0:1/r,a=n[e][u];d+=i[u][e],h+=i[u][e]*(t[0]+a*(s[0]-t[0])*o),p+=i[u][e]*(t[1]+a*(s[1]-t[1])*o)}});var y=0===r[u]?0:1/r[u];d*=o,d+=t*y*y,h*=o,h+=t*y*s[0]*f,s[0]=h/d,p*=o,p+=t*y*s[1]*f,s[1]=p/d}})},e.prototype.eIdealDisMatrix=function(){var t=this,e=t.nodes;if(!e)return[];var r=t.distances,n=t.linkDistance,i=t.radii||[],o=t.unitRadius||50,s=[];return r&&r.forEach(function(r,u){var l=[];r.forEach(function(r,s){if(u===s)l.push(0);else if(i[u]===i[s])if("data"===t.sortBy)l.push(r*(Math.abs(u-s)*t.sortStrength)/(i[u]/o));else if(t.sortBy){var c=e[u][t.sortBy]||0,f=e[s][t.sortBy]||0;(0,a.isString)(c)&&(c=c.charCodeAt(0)),(0,a.isString)(f)&&(f=f.charCodeAt(0)),l.push(r*(Math.abs(c-f)*t.sortStrength)/(i[u]/o))}else l.push(r*n/(i[u]/o));else{var h=(n+o)/2;l.push(r*h)}}),s.push(l)}),s},e.prototype.handleInfinity=function(t,e,r){for(var n=t.length,i=0;i r?t[e][n]:r);return r},e.prototype.getType=function(){return"radial"},e}(s.Base);e.RadialLayout=f},9088:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t){this.disp=[],this.positions=t.positions,this.adjMatrix=t.adjMatrix,this.focusID=t.focusID,this.radii=t.radii,this.iterations=t.iterations||10,this.height=t.height||10,this.width=t.width||10,this.speed=t.speed||100,this.gravity=t.gravity||10,this.nodeSizeFunc=t.nodeSizeFunc,this.k=t.k||5,this.strictRadial=t.strictRadial,this.nodes=t.nodes}return t.prototype.layout=function(){var t=this.positions,e=[],r=this.iterations,n=this.width/10;this.maxDisplace=n,this.disp=e;for(var i=0;i u?1:-1;l=.01*h,c=.01*h}if(f Math.PI/2&&(c-=Math.PI/2,s*=-1,u*=-1);var f=Math.cos(c)*l;e.x=s*f,e.y=u*f});var a=this.radii;t.forEach(function(s,u){if(u!==i){var l=Math.sqrt(e[u].x*e[u].x+e[u].y*e[u].y);if(l>0&&u!==i){var c=Math.min(o*(r/800),l);if(s[0]+=e[u].x/l*c,s[1]+=e[u].y/l*c,n){var f=s[0]-t[i][0],h=s[1]-t[i][1],p=Math.sqrt(f*f+h*h);f=f/p*a[u],h=h/p*a[u],s[0]=t[i][0]+f,s[1]=t[i][1]+h}}}})},t}();e.default=r},1783:function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.RandomLayout=void 0;var o=function(t){function e(e){var r=t.call(this)||this;return r.center=[0,0],r.width=300,r.height=300,r.nodes=[],r.edges=[],r.onLayoutEnd=function(){},r.updateCfg(e),r}return i(e,t),e.prototype.getDefaultCfg=function(){return{center:[0,0],width:300,height:300}},e.prototype.execute=function(){var t=this,e=t.nodes,r=t.center;return t.width||"undefined"==typeof window||(t.width=window.innerWidth),t.height||"undefined"==typeof window||(t.height=window.innerHeight),e&&e.forEach(function(e){e.x=.9*(Math.random()-.5)*t.width+r[0],e.y=.9*(Math.random()-.5)*t.height+r[1]}),t.onLayoutEnd&&t.onLayoutEnd(),{nodes:e,edges:this.edges}},e.prototype.getType=function(){return"random"},e}(r(8933).Base);e.RandomLayout=o},6451:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},521:function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.getLayoutByName=e.unRegisterLayout=e.registerLayout=void 0;var o=r(8933),a=r(864),s=new Map;e.registerLayout=function(t,e){if(s.get(t)&&console.warn("The layout with the name ".concat(t," exists already, it will be overridden")),(0,a.isObject)(e)){var r=function(t){function r(r){var n,i,o=n=t.call(this)||this,a={},s=Object.assign({},o.getDefaultCfg(),(null===(i=e.getDefaultCfg)||void 0===i?void 0:i.call(e))||{});return Object.assign(a,s,e,r),Object.keys(a).forEach(function(t){var e=a[t];o[t]=e}),n}return i(r,t),r}(o.Base);s.set(t,r)}else s.set(t,e);return s.get(t)};e.unRegisterLayout=function(t){s.has(t)&&s.delete(t)};e.getLayoutByName=function(t){return s.has(t)?s.get(t):null}},1049:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isArray=void 0,e.isArray=Array.isArray},8514:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getFuncByUnknownType=e.getFunc=e.isFunction=void 0;var n=r(864),i=r(9759);e.isFunction=function(t){return"function"==typeof t};e.getFunc=function(t,e,r){return r||((0,i.isNumber)(t)?function(){return t}:function(){return e})};e.getFuncByUnknownType=function(t,r,o){return void 0===o&&(o=!0),r||0===r?(0,e.isFunction)(r)?r:(0,i.isNumber)(r)?function(){return r}:(0,n.isArray)(r)?function(){if(o){var e=Math.max.apply(Math,r);return isNaN(e)?t:e}return r}:(0,n.isObject)(r)?function(){if(o){var e=Math.max(r.width,r.height);return isNaN(e)?t:e}return[r.width,r.height]}:function(){return t}:function(e){return e.size?(0,n.isArray)(e.size)?e.size[0]>e.size[1]?e.size[0]:e.size[1]:(0,n.isObject)(e.size)?e.size.width>e.size.height?e.size.width:e.size.height:e.size:t}}},2590:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.arrayToTextureData=e.attributesToTextureData=e.buildTextureDataWithTwoEdgeAttr=e.buildTextureData=e.proccessToFunc=void 0;var n=r(864),i=r(6268);e.proccessToFunc=function(t,e){return t?(0,n.isNumber)(t)?function(){return t}:t:function(){return e||1}};e.buildTextureData=function(t,e){var r=[],n=[],o={},a=0;for(a=0;a e[n][o]+e[o][i]&&(e[n][i]=e[n][o]+e[o][i]);return e};e.getAdjMatrix=function(t,r){var n=t.nodes,i=t.edges,o=[],a={};if(!n)throw new Error("invalid nodes data!");return n&&n.forEach(function(t,e){a[t.id]=e,o.push([])}),null===i||void 0===i||i.forEach(function(t){var n=(0,e.getEdgeTerminal)(t,"source"),i=(0,e.getEdgeTerminal)(t,"target"),s=a[n],u=a[i];void 0!==s&&void 0!==u&&(o[s][u]=1,r||(o[u][s]=1))}),o};e.scaleMatrix=function(t,e){var r=[];return t.forEach(function(t){var n=[];t.forEach(function(t){n.push(t*e)}),r.push(n)}),r};e.traverseTreeUp=function(t,e){"function"==typeof e&&function t(e,r){if(e&&e.children)for(var n=e.children.length-1;n>=0;n--)if(!t(e.children[n],r))return;return!!r(e)}(t,e)};e.getLayoutBBox=function(t){var e=1/0,r=1/0,o=-1/0,a=-1/0;return t.forEach(function(t){var s=t.size;(0,n.isArray)(s)?1===s.length&&(s=[s[0],s[0]]):(0,i.isNumber)(s)?s=[s,s]:(void 0===s||isNaN(s))&&(s=[30,30]);var u=[s[0]/2,s[1]/2],l=t.x-u[0],c=t.x+u[0],f=t.y-u[1],h=t.y+u[1];e>l&&(e=l),r>f&&(r=f),o i&&(n=r,a(1),++e),r[t]=o}function a(t){e=0,r=Object.create(null),t||(n=Object.create(null))}return a(),{clear:a,has:function(t){return void 0!==r[t]||void 0!==n[t]},get:function(t){var e=r[t];return void 0!==e?e:void 0!==(e=n[t])?(o(t,e),e):void 0},set:function(t,e){void 0!==r[t]?r[t]=e:o(t,e)}}}(r),n},l=/rgba?\(([\s.,0-9]+)\)/;var c=u(function(t){if("#"===t[0]&&7===t.length)return t;var e;s||((e=document.createElement("i")).title="Web Colour Picker",e.style.display="none",document.body.appendChild(e),s=e),s.style.color=t;var r=document.defaultView.getComputedStyle(s,"").getPropertyValue("color");return r=o(l.exec(r)[1].split(/\s*,\s*/).map(function(t){return Number(t)}))},function(t){return t},256);function f(t,e,r,n){return t[n]+(e[n]-t[n])*r}function h(t){var e=("string"==typeof t?t.split("-"):t).map(function(t){return n(-1===t.indexOf("#")?c(t):t)});return function(t){return function(t,e){var r=isNaN(Number(e))||e<0?0:e>1?1:Number(e),n=t.length-1,i=Math.floor(n*r),a=n*r-i,s=t[i],u=i===n?s:t[i+1];return o([f(s,u,a,0),f(s,u,a,1),f(s,u,a,2)])}(e,t)}}var p=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,d=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,y=/[\d.]+:(#[^\s]+|[^)]+\))/gi;function v(t){if(/^[r,R,L,l]{1}[\s]*\(/.test(t)){var e,r=void 0;if("l"===t[0]){var n=+(i=p.exec(t))[1]+90;r=i[2],e="linear-gradient("+n+"deg, "}else if("r"===t[0]){var i;e="radial-gradient(",r=(i=d.exec(t))[4]}var o=r.match(y);return o.forEach(function(t,r){var n=t.split(":");e+=n[1]+" "+100*Number(n[0])+"%",r!==o.length-1&&(e+=", ")}),e+=")"}return t}var g=r(9019);function m(t,e,r){var n=[0,0,0,0,0,0,0,0,0];return g.fromRotation(n,r),g.multiply(t,n,e)}function b(t,e,r){var n=[0,0,0,0,0,0,0,0,0];return g.fromScaling(n,r),g.multiply(t,n,e)}function x(t,e,r){return g.multiply(t,r,e)}function w(t,e){for(var r,n,i,o,a=t?[].concat(t):[1,0,0,0,1,0,0,0,1],s=0,u=e.length;s=0;return r?i?2*Math.PI-n:n:i?n:2*Math.PI-n}function k(t,e,r){return r?(t[0]=e[1],t[1]=-1*e[0]):(t[0]=-1*e[1],t[1]=e[0]),t}function T(t,e){return void 0===e&&(e="off"),function(t,e){if("off"===e)return[].concat(t);var r="number"==typeof e&&e>=1?Math.pow(10,e):1;return t.map(function(t){var n=t.slice(1).map(Number).map(function(t){return e?Math.round(t*r)/r:Math.round(t)});return[t[0]].concat(n)})}(t,e).map(function(t){return t[0]+t.slice(1).join(" ")}).join("")}var C=r(1635),O={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null};function A(t,e,r){if(t[r].length>7){t[r].shift();for(var n=t[r],i=r;n.length;)e[r]="A",t.splice(i+=1,0,["C"].concat(n.splice(0,6)));t.splice(r,1)}}var P={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function M(t){return Array.isArray(t)&&t.every(function(t){var e=t[0].toLowerCase();return P[e]===t.length-1&&"achlmqstvz".includes(e)})}function I(t){return M(t)&&t.every(function(t){var e=t[0];return e===e.toUpperCase()})}function L(t){return I(t)&&t.every(function(t){var e=t[0];return"ACLMQZ".includes(e)})}function j(t){for(var e=t.pathValue[t.segmentStart],r=e.toLowerCase(),n=t.data;n.length>=P[r]&&("m"===r&&n.length>2?(t.segments.push([e].concat(n.splice(0,2))),r="l",e="m"===e?"l":"L"):t.segments.push([e].concat(n.splice(0,P[r]))),P[r]););}function N(t){var e=t.index,r=t.pathValue,n=r.charCodeAt(e);return 48===n?(t.param=0,void(t.index+=1)):49===n?(t.param=1,void(t.index+=1)):void(t.err='[path-util]: invalid Arc flag "'+r[e]+'", expecting 0 or 1 at index '+e)}function R(t){return t>=48&&t<=57||43===t||45===t||46===t}function D(t){return t>=48&&t<=57}function B(t){var e,r=t.max,n=t.pathValue,i=t.index,o=i,a=!1,s=!1,u=!1,l=!1;if(o>=r)t.err="[path-util]: Invalid path value at index "+o+', "pathValue" is missing param';else if(43!==(e=n.charCodeAt(o))&&45!==e||(o+=1,e=n.charCodeAt(o)),D(e)||46===e){if(46!==e){if(a=48===e,o+=1,e=n.charCodeAt(o),a&&o =5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].includes(e));)t.index+=1}function z(t){var e=t.max,r=t.pathValue,n=t.index,i=r.charCodeAt(n),o=P[r[n].toLowerCase()];if(t.segmentStart=n,function(t){switch(32|t){case 109:case 122:case 108:case 104:case 118:case 99:case 115:case 113:case 116:case 97:return!0;default:return!1}}(i))if(t.index+=1,F(t),t.data=[],o){for(;;){for(var a=o;a>0;a-=1){if(97!=(32|i)||3!==a&&4!==a?B(t):N(t),t.err.length)return;t.data.push(t.param),F(t),t.index =t.max)break;if(!R(r.charCodeAt(t.index)))break}j(t)}else j(t);else t.err='[path-util]: Invalid path value "'+r[n]+'" is not a path command'}var G=function(){return function(t){this.pathValue=t,this.segments=[],this.max=t.length,this.index=0,this.param=0,this.segmentStart=0,this.data=[],this.err=""}}();function U(t){if(M(t))return[].concat(t);var e=new G(t);for(F(e);e.index 1&&(g*=T=Math.sqrt(T),m*=T);var C=g*g,O=m*m,A=(o===a?-1:1)*Math.sqrt(Math.abs((C*O-C*k*k-O*E*E)/(C*k*k+O*E*E)));p=A*g*k/m+(y+b)/2,d=A*-m*E/g+(v+x)/2,f=Math.asin(((v-d)/m*Math.pow(10,9)>>0)/Math.pow(10,9)),h=Math.asin(((x-d)/m*Math.pow(10,9)>>0)/Math.pow(10,9)),f=y h&&(f-=2*Math.PI),!a&&h>f&&(h-=2*Math.PI)}var P=h-f;if(Math.abs(P)>w){var M=h,I=b,L=x;h=f+w*(a&&h>f?1:-1),S=Y(b=p+g*Math.cos(h),x=d+m*Math.sin(h),g,m,i,0,a,I,L,[h,M,p,d])}P=h-f;var j=Math.cos(f),N=Math.sin(f),R=Math.cos(h),D=Math.sin(h),B=Math.tan(P/4),F=4/3*g*B,z=4/3*m*B,G=[y,v],U=[y+F*N,v-z*j],V=[b+F*D,x-z*R],H=[b,x];if(U[0]=2*G[0]-U[0],U[1]=2*G[1]-U[1],l)return U.concat(V,H,S);for(var W=[],X=0,Z=(S=U.concat(V,H,S)).length;X
=o)a={x:r,y:n};else{var s=X([t,e],[r,n],i/o);a={x:s[0],y:s[1]}}return{length:o,point:a,min:{x:Math.min(t,r),y:Math.min(e,n)},max:{x:Math.max(t,r),y:Math.max(e,n)}}}function nt(t,e){var r=t.x,n=t.y,i=e.x,o=e.y,a=r*i+n*o,s=Math.sqrt((Math.pow(r,2)+Math.pow(n,2))*(Math.pow(i,2)+Math.pow(o,2)));return(r*o-n*i<0?-1:1)*Math.acos(a/s)}function it(t,e,r,n,i,o,a,s,u,l){var c=Math.abs,f=Math.sin,h=Math.cos,p=Math.sqrt,d=Math.PI,y=c(r),v=c(n),g=(i%360+360)%360*(d/180);if(t===s&&e===u)return{x:t,y:e};if(0===y||0===v)return rt(t,e,s,u,l).point;var m=(t-s)/2,b=(e-u)/2,x={x:h(g)*m+f(g)*b,y:-f(g)*m+h(g)*b},w=Math.pow(x.x,2)/Math.pow(y,2)+Math.pow(x.y,2)/Math.pow(v,2);w>1&&(y*=p(w),v*=p(w));var _=(Math.pow(y,2)*Math.pow(v,2)-Math.pow(y,2)*Math.pow(x.y,2)-Math.pow(v,2)*Math.pow(x.x,2))/(Math.pow(y,2)*Math.pow(x.y,2)+Math.pow(v,2)*Math.pow(x.x,2));_=_<0?0:_;var S=(o!==a?1:-1)*p(_),E=S*(y*x.y/v),k=S*(-v*x.x/y),T=h(g)*E-f(g)*k+(t+s)/2,C=f(g)*E+h(g)*k+(e+u)/2,O={x:(x.x-E)/y,y:(x.y-k)/v},A=nt({x:1,y:0},O),P=nt(O,{x:(-x.x-E)/y,y:(-x.y-k)/v});!a&&P>0?P-=2*d:a&&P<0&&(P+=2*d);var M=A+(P%=2*d)*l,I=y*h(M),L=v*f(M);return{x:h(g)*I-f(g)*L+T,y:f(g)*I+h(g)*L+C}}function ot(t,e,r,n,i,o,a,s,u,l,c){var f,h=c.bbox,p=void 0===h||h,d=c.length,y=void 0===d||d,v=c.sampleSize,g=void 0===v?30:v,m="number"==typeof l,b=t,x=e,w=0,_=[b,x,w],S=[b,x],E={x:0,y:0},k=[{x:b,y:x}];m&&l<=0&&(E={x:b,y:x});for(var T=0;T<=g;T+=1){if(b=(f=it(t,e,r,n,i,o,a,s,u,T/g)).x,x=f.y,p&&k.push({x:b,y:x}),y&&(w+=et(S,[b,x])),S=[b,x],m&&w>=l&&l>_[2]){var C=(w-l)/(w-_[2]);E={x:S[0]*(1-C)+_[0]*C,y:S[1]*(1-C)+_[1]*C}}_=[b,x,w]}return m&&l>=w&&(E={x:s,y:u}),{length:w,point:E,min:{x:Math.min.apply(null,k.map(function(t){return t.x})),y:Math.min.apply(null,k.map(function(t){return t.y}))},max:{x:Math.max.apply(null,k.map(function(t){return t.x})),y:Math.max.apply(null,k.map(function(t){return t.y}))}}}function at(t,e,r,n,i,o,a,s,u){var l=1-u;return{x:Math.pow(l,3)*t+3*Math.pow(l,2)*u*r+3*l*Math.pow(u,2)*i+Math.pow(u,3)*a,y:Math.pow(l,3)*e+3*Math.pow(l,2)*u*n+3*l*Math.pow(u,2)*o+Math.pow(u,3)*s}}function st(t,e,r,n,i,o,a,s,u,l){var c,f=l.bbox,h=void 0===f||f,p=l.length,d=void 0===p||p,y=l.sampleSize,v=void 0===y?10:y,g="number"==typeof u,m=t,b=e,x=0,w=[m,b,x],_=[m,b],S={x:0,y:0},E=[{x:m,y:b}];g&&u<=0&&(S={x:m,y:b});for(var k=0;k<=v;k+=1){if(m=(c=at(t,e,r,n,i,o,a,s,k/v)).x,b=c.y,h&&E.push({x:m,y:b}),d&&(x+=et(_,[m,b])),_=[m,b],g&&x>=u&&u>w[2]){var T=(x-u)/(x-w[2]);S={x:_[0]*(1-T)+w[0]*T,y:_[1]*(1-T)+w[1]*T}}w=[m,b,x]}return g&&u>=x&&(S={x:a,y:s}),{length:x,point:S,min:{x:Math.min.apply(null,E.map(function(t){return t.x})),y:Math.min.apply(null,E.map(function(t){return t.y}))},max:{x:Math.max.apply(null,E.map(function(t){return t.x})),y:Math.max.apply(null,E.map(function(t){return t.y}))}}}function ut(t,e,r,n,i,o,a){var s=1-a;return{x:Math.pow(s,2)*t+2*s*a*r+Math.pow(a,2)*i,y:Math.pow(s,2)*e+2*s*a*n+Math.pow(a,2)*o}}function lt(t,e,r,n,i,o,a,s){var u,l=s.bbox,c=void 0===l||l,f=s.length,h=void 0===f||f,p=s.sampleSize,d=void 0===p?10:p,y="number"==typeof a,v=t,g=e,m=0,b=[v,g,m],x=[v,g],w={x:0,y:0},_=[{x:v,y:g}];y&&a<=0&&(w={x:v,y:g});for(var S=0;S<=d;S+=1){if(v=(u=ut(t,e,r,n,i,o,S/d)).x,g=u.y,c&&_.push({x:v,y:g}),h&&(m+=et(x,[v,g])),x=[v,g],y&&m>=a&&a>b[2]){var E=(m-a)/(m-b[2]);w={x:x[0]*(1-E)+b[0]*E,y:x[1]*(1-E)+b[1]*E}}b=[v,g,m]}return y&&a>=m&&(w={x:i,y:o}),{length:m,point:w,min:{x:Math.min.apply(null,_.map(function(t){return t.x})),y:Math.min.apply(null,_.map(function(t){return t.y}))},max:{x:Math.max.apply(null,_.map(function(t){return t.x})),y:Math.max.apply(null,_.map(function(t){return t.y}))}}}function ct(t,e,r){for(var n,i,o,a,s,u,l,c,f,h=W(t),p="number"==typeof e,d=[],y=0,v=0,g=0,m=0,b=[],x=[],w=0,_={x:0,y:0},S=_,E=_,k=_,T=0,C=0,O=h.length;C =e&&(k=E),x.push(S),b.push(_),T+=w,y=(u="Z"!==c?f.slice(-2):[g,m])[0],v=u[1];return p&&e>=T&&(k={x:y,y:v}),{length:T,point:k,min:{x:Math.min.apply(null,b.map(function(t){return t.x})),y:Math.min.apply(null,b.map(function(t){return t.y}))},max:{x:Math.max.apply(null,x.map(function(t){return t.x})),y:Math.max.apply(null,x.map(function(t){return t.y}))}}}function ft(t,e){if(!t)return{x:0,y:0,width:0,height:0,x2:0,y2:0,cx:0,cy:0,cz:0};var r=ct(t,void 0,(0,C.__assign)((0,C.__assign)({},e),{length:!1})),n=r.min,i=n.x,o=n.y,a=r.max,s=a.x,u=a.y,l=s-i,c=u-o;return{width:l,height:c,x:i,y:o,x2:s,y2:u,cx:i+l/2,cy:o+c/2,cz:Math.max(l,c)+Math.min(l,c)/2}}function ht(t,e){return ct(t,void 0,(0,C.__assign)((0,C.__assign)({},e),{bbox:!1,length:!0})).length}function pt(t,e){if(!t)return{length:0,x:0,y:0,width:0,height:0,x2:0,y2:0,cx:0,cy:0,cz:0};var r=ct(t,void 0,(0,C.__assign)((0,C.__assign)({},e),{bbox:!0,length:!0})),n=r.length,i=r.min,o=i.x,a=i.y,s=r.max,u=s.x,l=s.y,c=u-o,f=l-a;return{length:n,width:c,height:f,x:o,y:a,x2:u,y2:l,cx:o+c/2,cy:a+f/2,cz:Math.max(c,f)+Math.min(c,f)/2}}function dt(t,e){var r=t.length-1,n=[],i=0,o=function(t){var e=t.length,r=e-1;return t.map(function(n,i){return t.map(function(n,o){var a,s=i+o;return 0===o||t[s]&&"M"===t[s][0]?(a=t[s],["M"].concat(a.slice(-2))):(s>=e&&(s-=r),t[s])})})}(t);return o.forEach(function(o,a){t.slice(1).forEach(function(n,o){i+=et(t[(a+o)%r].slice(-2),e[o%r].slice(-2))}),n[a]=i,i=0}),o[n.indexOf(Math.min.apply(null,n))]}function yt(t){var e=0,r=0,n=0;return J(t).map(function(t){var i;switch(t[0]){case"M":return e=t[1],r=t[2],0;default:var o=t.slice(1),a=o[0],s=o[1],u=o[2],l=o[3],c=o[4],f=o[5];return n=function(t,e,r,n,i,o,a,s){return 3*((s-e)*(r+i)-(a-t)*(n+o)+n*(t-i)-r*(e-o)+s*(i+t/3)-a*(o+e/3))/20}(e,r,a,s,u,l,c,f),i=t.slice(-2),e=i[0],r=i[1],n}}).reduce(function(t,e){return t+e},0)}function vt(t){return yt(t)>=0}function gt(t,e,r){return ct(t,e,(0,C.__assign)((0,C.__assign)({},r),{bbox:!1,length:!0})).point}function mt(t,e){for(var r,n,i,o,a=U(t),s=W(a),u=ht(a),l=function(t){var r=t.x-e.x,n=t.y-e.y;return r*r+n*n},c=8,f=0,h=0,p=1/0,d=0;d<=u;d+=c)(f=l(r=gt(s,d))) .5;)g=l(i=gt(s,y=h-c)),m=l(o=gt(s,v=h+c)),y>=0&&g
=i)return s=i-(a=ht(n=r.slice(0,-1))),{segment:r[o],index:o,length:s,lengthAtSegment:a};for(var f=[];o>0;)u=n[o],s=i-(a=ht(n=n.slice(0,-1))),i=a,f.push({segment:u,index:o,length:s,lengthAtSegment:a}),o-=1;return f.find(function(t){return t.lengthAtSegment<=e})}(a,h);return{closest:n,distance:Math.sqrt(p),segment:b}}function bt(t,e){var r=mt(t,e).distance;return Math.abs(r)<.001}function xt(t){return t.map(function(t,e,r){var n=e&&r[e-1].slice(-2).concat(t.slice(1)),i=e?st(n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7],n[8],{bbox:!1}).length:0;return{s:t,ss:e?i?function(t,e){void 0===e&&(e=.5);var r=t.slice(0,2),n=t.slice(2,4),i=t.slice(4,6),o=t.slice(6,8),a=X(r,n,e),s=X(n,i,e),u=X(i,o,e),l=X(a,s,e),c=X(s,u,e),f=X(l,c,e);return[["C"].concat(a,l,f),["C"].concat(c,u,o)]}(n):[t,t]:[t],l:i}})}function wt(t,e,r){var n=xt(t),i=xt(e),o=n.length,a=i.length,s=n.filter(function(t){return t.l}).length,u=i.filter(function(t){return t.l}).length,l=n.filter(function(t){return t.l}).reduce(function(t,e){return t+e.l},0)/s||0,c=i.filter(function(t){return t.l}).reduce(function(t,e){return t+e.l},0)/u||0,f=r||Math.max(o,a),h=[l,c],p=[f-o,f-a],d=0,y=[n,i].map(function(t,e){return t.l===f?t.map(function(t){return t.s}):t.map(function(t,r){return d=r&&p[e]&&t.l>=h[e],p[e]-=d?1:0,d?t.ss:[t.s]}).flat()});return y[0].length===y[1].length?y:wt(y[0],y[1],f)}var _t=function(t){return null!==t&&"function"!=typeof t&&isFinite(t.length)},St=function(t,e){return!!_t(t)&&t.indexOf(e)>-1},Et=function(t,e){if(!_t(t))return t;for(var r=[],n=0;n
-1;)Yt.call(t,o,1);return t},Kt=Array.prototype.splice,Jt=function(t,e){if(!_t(t))return[];for(var r=t?e.length:0,n=r-1;r--;){var i=void 0,o=e[r];r!==n&&o===i||(i=o,Kt.call(t,o,1))}return t},Qt=function(t,e,r){if(!At(t)&&!Dt(t))return t;var n=r;return It(t,function(t,r){n=e(n,t,r)}),n},$t=function(t,e){var r=[];if(!_t(t))return r;for(var n=-1,i=[],o=t.length;++n e[i])return 1;if(t[i] r?r:t},we=function(t,e){var r=e.toString(),n=r.indexOf(".");if(-1===n)return Math.round(t);var i=r.substr(n+1).length;return i>20&&(i=20),parseFloat(t.toFixed(i))},_e=function(t){return Ot(t,"Number")},Se=function(t){return _e(t)&&t%1!=0},Ee=function(t){return _e(t)&&t%2==0},ke=Number.isInteger?Number.isInteger:function(t){return _e(t)&&t%1==0},Te=function(t){return _e(t)&&t<0},Ce=1e-5;function Oe(t,e,r){return void 0===r&&(r=Ce),Math.abs(t-e) 0},Me=function(t,e){if(At(t)){for(var r,n=-1/0,i=0;i n&&(r=o,n=s)}return r}},Ie=function(t,e){if(At(t)){for(var r,n=1/0,i=0;i e?(n&&(clearTimeout(n),n=null),s=l,a=t.apply(i,o),n||(i=o=null)):n||!1===r.trailing||(n=setTimeout(u,c)),a};return l.cancel=function(){clearTimeout(n),s=0,n=i=o=null},l},Rr=function(t){return _t(t)?Array.prototype.slice.call(t):[]},Dr={},Br=function(t){return Dr[t=t||"g"]?Dr[t]+=1:Dr[t]=1,t+Dr[t]},Fr=function(){},zr=function(t){return t};function Gr(t){return Tt(t)?0:_t(t)?t.length:Object.keys(t).length}var Ur=function(){function t(){this.map={}}return t.prototype.has=function(t){return void 0!==this.map[t]},t.prototype.get=function(t,e){var r=this.map[t];return void 0===r?e:r},t.prototype.set=function(t,e){this.map[t]=e},t.prototype.clear=function(){this.map={}},t.prototype.delete=function(t){delete this.map[t]},t.prototype.size=function(){return Object.keys(this.map).length},t}(),Vr=1e-6;function Hr(t){return Math.abs(t) 0!=Hr(s[1]-r)>0&&Hr(e-(r-a[1])*(a[0]-s[0])/(a[1]-s[1])-a[0])<0&&(n=!n)}return n}var Yr=function(t,e,r){return t>=e&&t<=r};function Xr(t){for(var e=[],r=t.length,n=0;n 1){var a=t[0],s=t[r-1];e.push({from:{x:s[0],y:s[1]},to:{x:a[0],y:a[1]}})}return e}function Zr(t,e){var r=!1;return t.forEach(function(t){if(function(t,e,r,n){var i=r.x-t.x,o=r.y-t.y,a=e.x-t.x,s=e.y-t.y,u=n.x-r.x,l=n.y-r.y,c=a*l-s*u,f=null;if(c*c>.001*(a*a+s*s)*(u*u+l*l)){var h=(i*l-o*u)/c,p=(i*s-o*a)/c;Yr(h,0,1)&&Yr(p,0,1)&&(f={x:t.x+h*a,y:t.y+h*s})}return f}(t.from,t.to,e.from,e.to))return r=!0,!1}),r}function Kr(t){var e=t.map(function(t){return t[0]}),r=t.map(function(t){return t[1]});return{minX:Math.min.apply(null,e),maxX:Math.max.apply(null,e),minY:Math.min.apply(null,r),maxY:Math.max.apply(null,r)}}function Jr(t,e){if(t.length<2||e.length<2)return!1;var r,n,i=Kr(t),o=Kr(e);if(r=i,(n=o).minX>r.maxX||n.maxX r.maxY||n.maxY 1&&void 0!==arguments[1]?arguments[1]:{};if(!i(t))throw new TypeError("input must be an array");if(0===t.length)throw new TypeError("input must not be empty");if(void 0!==r.output){if(!i(r.output))throw new TypeError("output option must be an array if specified");e=r.output}else e=new Array(t.length);var n=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!i(t))throw new TypeError("input must be an array");if(0===t.length)throw new TypeError("input must not be empty");var r=e.fromIndex,n=void 0===r?0:r,o=e.toIndex,a=void 0===o?t.length:o;if(n<0||n>=t.length||!Number.isInteger(n))throw new Error("fromIndex must be a positive integer smaller than length");if(a<=n||a>t.length||!Number.isInteger(a))throw new Error("toIndex must be an integer greater than fromIndex and at most equal to length");for(var s=t[n],u=n+1;u1&&void 0!==arguments[1]?arguments[1]:{};if(!i(t))throw new TypeError("input must be an array");if(0===t.length)throw new TypeError("input must not be empty");var r=e.fromIndex,n=void 0===r?0:r,o=e.toIndex,a=void 0===o?t.length:o;if(n<0||n>=t.length||!Number.isInteger(n))throw new Error("fromIndex must be a positive integer smaller than length");if(a<=n||a>t.length||!Number.isInteger(a))throw new Error("toIndex must be an integer greater than fromIndex and at most equal to length");for(var s=t[n],u=n+1;us&&(s=t[u]);return s}(t);if(n===o)throw new RangeError("minimum and maximum input values are equal. Cannot rescale a constant array");var a=r.min,s=void 0===a?r.autoMinMax?n:0:a,u=r.max,l=void 0===u?r.autoMinMax?o:1:u;if(s>=l)throw new RangeError("min option must be smaller than max option");for(var c=(l-s)/(o-n),f=0;f 1&&void 0!==arguments[1]?arguments[1]:{},r=e.maxRows,n=void 0===r?15:r,i=e.maxColumns,o=void 0===i?10:i,u=e.maxNumSize,c=void 0===u?8:u;return"".concat(t.constructor.name," {\n").concat(a,"[\n").concat(s).concat(function(t,e,r,n){for(var i=t.rows,o=t.columns,a=Math.min(i,e),u=Math.min(o,r),c=[],f=0;fn)throw new RangeError("Row index out of range")}function h(t,e,r){var n=r?t.columns:t.columns-1;if(e<0||e>n)throw new RangeError("Column index out of range")}function p(t,e){if(e.to1DArray&&(e=e.to1DArray()),e.length!==t.columns)throw new RangeError("vector size must be the same as the number of columns");return e}function d(t,e){if(e.to1DArray&&(e=e.to1DArray()),e.length!==t.rows)throw new RangeError("vector size must be the same as the number of rows");return e}function y(t,e,r){return{row:v(t,e),column:g(t,r)}}function v(t,e){if("object"!==c(e))throw new TypeError("unexpected type for row indices");if(e.some(function(e){return e<0||e>=t.rows}))throw new RangeError("row indices are out of range");return Array.isArray(e)||(e=Array.from(e)),e}function g(t,e){if("object"!==c(e))throw new TypeError("unexpected type for column indices");if(e.some(function(e){return e<0||e>=t.columns}))throw new RangeError("column indices are out of range");return Array.isArray(e)||(e=Array.from(e)),e}function m(t,e,r,n,i){if(5!==arguments.length)throw new RangeError("expected 4 arguments");if(x("startRow",e),x("endRow",r),x("startColumn",n),x("endColumn",i),e>r||n>i||e<0||e>=t.rows||r<0||r>=t.rows||n<0||n>=t.columns||i<0||i>=t.columns)throw new RangeError("Submatrix indices are out of range")}function b(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=[],n=0;n r?(i=!0,r=e):(n=!1,i=!0);t++}return n}},{key:"isReducedEchelonForm",value:function(){for(var t=0,e=0,r=-1,n=!0,i=!1;t r?(i=!0,r=e):(n=!1,i=!0);for(var o=e+1;o t.get(n,r)&&(n=i);if(0===t.get(n,r))r++;else{t.swapRows(e,n);for(var o=t.get(e,r),a=r;a =0;)if(0===t.maxRow(n))n--;else{for(var i=0,o=!1;i 0&&void 0!==arguments[0]?arguments[0]:{};if("object"!==k(t))throw new TypeError("options must be an object");var e=t.rows,r=void 0===e?1:e,n=t.columns,i=void 0===n?1:n;if(!Number.isInteger(r)||r<=0)throw new TypeError("rows must be a positive integer");if(!Number.isInteger(i)||i<=0)throw new TypeError("columns must be a positive integer");for(var o=new I(this.rows*r,this.columns*i),a=0;a t&&(t=this.get(e,r));return t}},{key:"maxIndex",value:function(){for(var t=this.get(0,0),e=[0,0],r=0;r t&&(t=this.get(r,n),e[0]=r,e[1]=n);return e}},{key:"min",value:function(){for(var t=this.get(0,0),e=0;e e&&(e=this.get(t,r));return e}},{key:"maxRowIndex",value:function(t){f(this,t);for(var e=this.get(t,0),r=[t,0],n=1;n e&&(e=this.get(t,n),r[1]=n);return r}},{key:"minRow",value:function(t){f(this,t);for(var e=this.get(t,0),r=1;r e&&(e=this.get(r,t));return e}},{key:"maxColumnIndex",value:function(t){h(this,t);for(var e=this.get(0,t),r=[0,t],n=1;n e&&(e=this.get(n,t),r[0]=n);return r}},{key:"minColumn",value:function(t){h(this,t);for(var e=this.get(0,t),r=1;r 0&&void 0!==arguments[0]?arguments[0]:"frobenius",e=0;if("max"===t)return this.max();if("frobenius"===t){for(var r=0;r 0&&void 0!==arguments[0]?arguments[0]:{};if("object"!==k(t))throw new TypeError("options must be an object");var e=t.min,r=void 0===e?0:e,n=t.max,i=void 0===n?1:n;if(!Number.isFinite(r))throw new TypeError("min must be a number");if(!Number.isFinite(i))throw new TypeError("max must be a number");if(r>=i)throw new RangeError("min must be smaller than max");for(var a=new I(this.rows,this.columns),s=0;s 0&&void 0!==arguments[0]?arguments[0]:{};if("object"!==k(t))throw new TypeError("options must be an object");var e=t.min,r=void 0===e?0:e,n=t.max,i=void 0===n?1:n;if(!Number.isFinite(r))throw new TypeError("min must be a number");if(!Number.isFinite(i))throw new TypeError("max must be a number");if(r>=i)throw new RangeError("min must be smaller than max");for(var a=new I(this.rows,this.columns),s=0;s 0&&void 0!==arguments[0]?arguments[0]:M,e=0;e 0&&void 0!==arguments[0]?arguments[0]:M,e=0;e r||e<0||e>=this.columns||r<0||r>=this.columns)throw new RangeError("Argument out of range");for(var n=new I(t.length,r-e+1),i=0;i =this.rows)throw new RangeError("Row index out of range: ".concat(t[i]));n.set(i,o-e,this.get(t[i],o))}return n}},{key:"subMatrixColumn",value:function(t,e,r){if(void 0===e&&(e=0),void 0===r&&(r=this.rows-1),e>r||e<0||e>=this.rows||r<0||r>=this.rows)throw new RangeError("Argument out of range");for(var n=new I(r-e+1,t.length),i=0;i =this.columns)throw new RangeError("Column index out of range: ".concat(t[i]));n.set(o-e,i,this.get(o,t[i]))}return n}},{key:"setSubMatrix",value:function(t,e,r){m(this,e,e+(t=I.checkMatrix(t)).rows-1,r,r+t.columns-1);for(var n=0;n 1&&void 0!==arguments[1]?arguments[1]:{};if("object"===k(t)&&(e=t,t=void 0),"object"!==k(e))throw new TypeError("options must be an object");var r=e,n=r.unbiased,i=void 0===n||n,o=r.mean,a=void 0===o?this.mean(t):o;if("boolean"!=typeof i)throw new TypeError("unbiased must be a boolean");switch(t){case"row":if(!Array.isArray(a))throw new TypeError("mean must be an array");return function(t,e,r){for(var n=t.rows,i=t.columns,o=[],a=0;a 1&&void 0!==arguments[1]?arguments[1]:{};if("object"===k(t)&&(e=t,t=void 0),"object"!==k(e))throw new TypeError("options must be an object");var r=e.center,n=void 0===r?this.mean(t):r;switch(t){case"row":if(!Array.isArray(n))throw new TypeError("center must be an array");return function(t,e){for(var r=0;r 1&&void 0!==arguments[1]?arguments[1]:{};if("object"===k(t)&&(e=t,t=void 0),"object"!==k(e))throw new TypeError("options must be an object");var r=e.scale;switch(t){case"row":if(void 0===r)r=function(t){for(var e=[],r=0;r 2&&void 0!==arguments[2]?arguments[2]:{};if("object"!==k(r))throw new TypeError("options must be an object");for(var n=r.random,i=void 0===n?Math.random:n,o=new I(t,e),a=0;a 2&&void 0!==arguments[2]?arguments[2]:{};if("object"!==k(r))throw new TypeError("options must be an object");var n=r.min,i=void 0===n?0:n,o=r.max,a=void 0===o?1e3:o,s=r.random,u=void 0===s?Math.random:s;if(!Number.isInteger(i))throw new TypeError("min must be an integer");if(!Number.isInteger(a))throw new TypeError("max must be an integer");if(i>=a)throw new RangeError("min must be smaller than max");for(var l=a-i,c=new I(t,e),f=0;f 0){if(n.data=[],!(Number.isInteger(r)&&r>0))throw new TypeError("nColumns must be a positive integer");for(var i=0;i >t);return this},t.prototype.signPropagatingRightShiftM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(var r=0;r >t.get(r,n));return this},t.signPropagatingRightShift=function(t,r){return new e(t).signPropagatingRightShift(r)},t.prototype.rightShift=function(t){return"number"==typeof t?this.rightShiftS(t):this.rightShiftM(t)},t.prototype.rightShiftS=function(t){for(var e=0;e >>t);return this},t.prototype.rightShiftM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(var r=0;r >>t.get(r,n));return this},t.rightShift=function(t,r){return new e(t).rightShift(r)},t.prototype.zeroFillRightShift=t.prototype.rightShift,t.prototype.zeroFillRightShiftS=t.prototype.rightShiftS,t.prototype.zeroFillRightShiftM=t.prototype.rightShiftM,t.zeroFillRightShift=t.rightShift,t.prototype.not=function(){for(var t=0;t 1&&void 0!==arguments[1]?arguments[1]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var i=n.rows,o=void 0===i?1:i;if(t.length%o!=0)throw new Error("the data length is not divisible by the number of rows");return(r=Qt(this,e)).rows=o,r.columns=t.length/o,r.data=t,r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&te(t,e)}(e,P),r=e,(n=[{key:"set",value:function(t,e,r){var n=this._calculateIndex(t,e);return this.data[n]=r,this}},{key:"get",value:function(t,e){var r=this._calculateIndex(t,e);return this.data[r]}},{key:"_calculateIndex",value:function(t,e){return t*this.columns+e}}])&&Kt(r.prototype,n),i&&Kt(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}();function re(t){"@babel/helpers - typeof";return(re="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ne(t,e){for(var r=0;r