f7cloud_client/apps/whiteboard/js/architectureDiagram-VXUJARFQ-DiqBgp7x.chunk.mjs
root 8b6a0139db f7cloud_client
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-17 22:59:26 +00:00

39 lines
146 KiB
JavaScript

/*! third party licenses: js/vendor.LICENSE.txt */
import{_ as pt,G as Be,S as Ve,l as be,b as $e,a as je,p as qe,q as Ke,g as Ze,s as Je,y as Qe,C as ti,D as ei,E as ii,c as me,$ as ve,ae as ce,h as ni,x as ri,af as oi,ag as ai}from"./NcSelect-DXLJbwym.chunk.mjs";import{p as si}from"./chunk-4BX2VUAB-CRQkbnhe.chunk.mjs";import{p as hi}from"./treemap-KMMF4GRG-BMzvQTWV.chunk.mjs";import{c as Oe}from"./cytoscape.esm-3961YR65.chunk.mjs";import{g as li}from"./vendor-BeFBwUwf.chunk.mjs";import{s as di}from"./isEmpty-nTVdZyYD.chunk.mjs";import"./whiteboard-main.mjs";import"./index-Anv74-sp.chunk.mjs";import"./index-C0mkXnFg.chunk.mjs";import"./index-Bn0s6V7w.chunk.mjs";import"./index-vg7q3Iku.chunk.mjs";import"./translation-DoG5ZELJ-DKBzIEvm.chunk.mjs";import"./percentages-BXMCSKIN-Cw9SI0WV.chunk.mjs";import"./useJwtStore-B1DPLYgs.chunk.mjs";import"./_plugin-vue2_normalizer-CBCAj2XU.chunk.mjs";import"./line-2ECJkxIB.chunk.mjs";import"./array-Cg_lHFoG.chunk.mjs";import"./path-i7Zvihw6.chunk.mjs";import"./_baseUniq-CE6homwJ.chunk.mjs";import"./_basePickBy-0DU--7tw.chunk.mjs";import"./has-DJswI7NS.chunk.mjs";import"./clone-Dt8ItUbV.chunk.mjs";var ge={exports:{}},ue={exports:{}},fe={exports:{}},ci=fe.exports,Le;function gi(){return Le||(Le=1,function(D,C){(function(I,G){D.exports=G()})(ci,function(){return function(I){var G={};function T(u){if(G[u])return G[u].exports;var l=G[u]={i:u,l:!1,exports:{}};return I[u].call(l.exports,l,l.exports,T),l.l=!0,l.exports}return T.m=I,T.c=G,T.i=function(u){return u},T.d=function(u,l,o){T.o(u,l)||Object.defineProperty(u,l,{configurable:!1,enumerable:!0,get:o})},T.n=function(u){var l=u&&u.__esModule?function(){return u.default}:function(){return u};return T.d(l,"a",l),l},T.o=function(u,l){return Object.prototype.hasOwnProperty.call(u,l)},T.p="",T(T.s=28)}([function(I,G,T){function u(){}u.QUALITY=1,u.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,u.DEFAULT_INCREMENTAL=!1,u.DEFAULT_ANIMATION_ON_LAYOUT=!0,u.DEFAULT_ANIMATION_DURING_LAYOUT=!1,u.DEFAULT_ANIMATION_PERIOD=50,u.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,u.DEFAULT_GRAPH_MARGIN=15,u.NODE_DIMENSIONS_INCLUDE_LABELS=!1,u.SIMPLE_NODE_SIZE=40,u.SIMPLE_NODE_HALF_SIZE=u.SIMPLE_NODE_SIZE/2,u.EMPTY_COMPOUND_NODE_SIZE=40,u.MIN_EDGE_LENGTH=1,u.WORLD_BOUNDARY=1e6,u.INITIAL_WORLD_BOUNDARY=u.WORLD_BOUNDARY/1e3,u.WORLD_CENTER_X=1200,u.WORLD_CENTER_Y=900,I.exports=u},function(I,G,T){var u=T(2),l=T(8),o=T(9);function i(a,r,f){u.call(this,f),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=f,this.bendpoints=[],this.source=a,this.target=r}i.prototype=Object.create(u.prototype);for(var e in u)i[e]=u[e];i.prototype.getSource=function(){return this.source},i.prototype.getTarget=function(){return this.target},i.prototype.isInterGraph=function(){return this.isInterGraph},i.prototype.getLength=function(){return this.length},i.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},i.prototype.getBendpoints=function(){return this.bendpoints},i.prototype.getLca=function(){return this.lca},i.prototype.getSourceInLca=function(){return this.sourceInLca},i.prototype.getTargetInLca=function(){return this.targetInLca},i.prototype.getOtherEnd=function(a){if(this.source===a)return this.target;if(this.target===a)return this.source;throw"Node is not incident with this edge"},i.prototype.getOtherEndInGraph=function(a,r){for(var f=this.getOtherEnd(a),t=r.getGraphManager().getRoot();;){if(f.getOwner()==r)return f;if(f.getOwner()==t)break;f=f.getOwner().getParent()}return null},i.prototype.updateLength=function(){var a=new Array(4);this.isOverlapingSourceAndTarget=l.getIntersection(this.target.getRect(),this.source.getRect(),a),this.isOverlapingSourceAndTarget||(this.lengthX=a[0]-a[2],this.lengthY=a[1]-a[3],Math.abs(this.lengthX)<1&&(this.lengthX=o.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=o.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},i.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=o.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=o.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},I.exports=i},function(I,G,T){function u(l){this.vGraphObject=l}I.exports=u},function(I,G,T){var u=T(2),l=T(10),o=T(13),i=T(0),e=T(16),a=T(5);function r(t,s,h,g){h==null&&g==null&&(g=s),u.call(this,g),t.graphManager!=null&&(t=t.graphManager),this.estimatedSize=l.MIN_VALUE,this.inclusionTreeDepth=l.MAX_VALUE,this.vGraphObject=g,this.edges=[],this.graphManager=t,h!=null&&s!=null?this.rect=new o(s.x,s.y,h.width,h.height):this.rect=new o}r.prototype=Object.create(u.prototype);for(var f in u)r[f]=u[f];r.prototype.getEdges=function(){return this.edges},r.prototype.getChild=function(){return this.child},r.prototype.getOwner=function(){return this.owner},r.prototype.getWidth=function(){return this.rect.width},r.prototype.setWidth=function(t){this.rect.width=t},r.prototype.getHeight=function(){return this.rect.height},r.prototype.setHeight=function(t){this.rect.height=t},r.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},r.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},r.prototype.getCenter=function(){return new a(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},r.prototype.getLocation=function(){return new a(this.rect.x,this.rect.y)},r.prototype.getRect=function(){return this.rect},r.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},r.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},r.prototype.setRect=function(t,s){this.rect.x=t.x,this.rect.y=t.y,this.rect.width=s.width,this.rect.height=s.height},r.prototype.setCenter=function(t,s){this.rect.x=t-this.rect.width/2,this.rect.y=s-this.rect.height/2},r.prototype.setLocation=function(t,s){this.rect.x=t,this.rect.y=s},r.prototype.moveBy=function(t,s){this.rect.x+=t,this.rect.y+=s},r.prototype.getEdgeListToNode=function(t){var s=[],h=this;return h.edges.forEach(function(g){if(g.target==t){if(g.source!=h)throw"Incorrect edge source!";s.push(g)}}),s},r.prototype.getEdgesBetween=function(t){var s=[],h=this;return h.edges.forEach(function(g){if(!(g.source==h||g.target==h))throw"Incorrect edge source and/or target";(g.target==t||g.source==t)&&s.push(g)}),s},r.prototype.getNeighborsList=function(){var t=new Set,s=this;return s.edges.forEach(function(h){if(h.source==s)t.add(h.target);else{if(h.target!=s)throw"Incorrect incidency!";t.add(h.source)}}),t},r.prototype.withChildren=function(){var t=new Set,s,h;if(t.add(this),this.child!=null)for(var g=this.child.getNodes(),d=0;d<g.length;d++)s=g[d],h=s.withChildren(),h.forEach(function(N){t.add(N)});return t},r.prototype.getNoOfChildren=function(){var t=0,s;if(this.child==null)t=1;else for(var h=this.child.getNodes(),g=0;g<h.length;g++)s=h[g],t+=s.getNoOfChildren();return t==0&&(t=1),t},r.prototype.getEstimatedSize=function(){if(this.estimatedSize==l.MIN_VALUE)throw"assert failed";return this.estimatedSize},r.prototype.calcEstimatedSize=function(){return this.child==null?this.estimatedSize=(this.rect.width+this.rect.height)/2:(this.estimatedSize=this.child.calcEstimatedSize(),this.rect.width=this.estimatedSize,this.rect.height=this.estimatedSize,this.estimatedSize)},r.prototype.scatter=function(){var t,s,h=-i.INITIAL_WORLD_BOUNDARY,g=i.INITIAL_WORLD_BOUNDARY;t=i.WORLD_CENTER_X+e.nextDouble()*(g-h)+h;var d=-i.INITIAL_WORLD_BOUNDARY,N=i.INITIAL_WORLD_BOUNDARY;s=i.WORLD_CENTER_Y+e.nextDouble()*(N-d)+d,this.rect.x=t,this.rect.y=s},r.prototype.updateBounds=function(){if(this.getChild()==null)throw"assert failed";if(this.getChild().getNodes().length!=0){var t=this.getChild();if(t.updateBounds(!0),this.rect.x=t.getLeft(),this.rect.y=t.getTop(),this.setWidth(t.getRight()-t.getLeft()),this.setHeight(t.getBottom()-t.getTop()),i.NODE_DIMENSIONS_INCLUDE_LABELS){var s=t.getRight()-t.getLeft(),h=t.getBottom()-t.getTop();this.labelWidth&&(this.labelPosHorizontal=="left"?(this.rect.x-=this.labelWidth,this.setWidth(s+this.labelWidth)):this.labelPosHorizontal=="center"&&this.labelWidth>s?(this.rect.x-=(this.labelWidth-s)/2,this.setWidth(this.labelWidth)):this.labelPosHorizontal=="right"&&this.setWidth(s+this.labelWidth)),this.labelHeight&&(this.labelPosVertical=="top"?(this.rect.y-=this.labelHeight,this.setHeight(h+this.labelHeight)):this.labelPosVertical=="center"&&this.labelHeight>h?(this.rect.y-=(this.labelHeight-h)/2,this.setHeight(this.labelHeight)):this.labelPosVertical=="bottom"&&this.setHeight(h+this.labelHeight))}}},r.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==l.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},r.prototype.transform=function(t){var s=this.rect.x;s>i.WORLD_BOUNDARY?s=i.WORLD_BOUNDARY:s<-i.WORLD_BOUNDARY&&(s=-i.WORLD_BOUNDARY);var h=this.rect.y;h>i.WORLD_BOUNDARY?h=i.WORLD_BOUNDARY:h<-i.WORLD_BOUNDARY&&(h=-i.WORLD_BOUNDARY);var g=new a(s,h),d=t.inverseTransformPoint(g);this.setLocation(d.x,d.y)},r.prototype.getLeft=function(){return this.rect.x},r.prototype.getRight=function(){return this.rect.x+this.rect.width},r.prototype.getTop=function(){return this.rect.y},r.prototype.getBottom=function(){return this.rect.y+this.rect.height},r.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},I.exports=r},function(I,G,T){var u=T(0);function l(){}for(var o in u)l[o]=u[o];l.MAX_ITERATIONS=2500,l.DEFAULT_EDGE_LENGTH=50,l.DEFAULT_SPRING_STRENGTH=.45,l.DEFAULT_REPULSION_STRENGTH=4500,l.DEFAULT_GRAVITY_STRENGTH=.4,l.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,l.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,l.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,l.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,l.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,l.COOLING_ADAPTATION_FACTOR=.33,l.ADAPTATION_LOWER_NODE_LIMIT=1e3,l.ADAPTATION_UPPER_NODE_LIMIT=5e3,l.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,l.MAX_NODE_DISPLACEMENT=l.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,l.MIN_REPULSION_DIST=l.DEFAULT_EDGE_LENGTH/10,l.CONVERGENCE_CHECK_PERIOD=100,l.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,l.MIN_EDGE_LENGTH=1,l.GRID_CALCULATION_CHECK_PERIOD=10,I.exports=l},function(I,G,T){function u(l,o){l==null&&o==null?(this.x=0,this.y=0):(this.x=l,this.y=o)}u.prototype.getX=function(){return this.x},u.prototype.getY=function(){return this.y},u.prototype.setX=function(l){this.x=l},u.prototype.setY=function(l){this.y=l},u.prototype.getDifference=function(l){return new DimensionD(this.x-l.x,this.y-l.y)},u.prototype.getCopy=function(){return new u(this.x,this.y)},u.prototype.translate=function(l){return this.x+=l.width,this.y+=l.height,this},I.exports=u},function(I,G,T){var u=T(2),l=T(10),o=T(0),i=T(7),e=T(3),a=T(1),r=T(13),f=T(12),t=T(11);function s(g,d,N){u.call(this,N),this.estimatedSize=l.MIN_VALUE,this.margin=o.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=g,d!=null&&d instanceof i?this.graphManager=d:d!=null&&d instanceof Layout&&(this.graphManager=d.graphManager)}s.prototype=Object.create(u.prototype);for(var h in u)s[h]=u[h];s.prototype.getNodes=function(){return this.nodes},s.prototype.getEdges=function(){return this.edges},s.prototype.getGraphManager=function(){return this.graphManager},s.prototype.getParent=function(){return this.parent},s.prototype.getLeft=function(){return this.left},s.prototype.getRight=function(){return this.right},s.prototype.getTop=function(){return this.top},s.prototype.getBottom=function(){return this.bottom},s.prototype.isConnected=function(){return this.isConnected},s.prototype.add=function(g,d,N){if(d==null&&N==null){var c=g;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(c)>-1)throw"Node already in graph!";return c.owner=this,this.getNodes().push(c),c}else{var y=g;if(!(this.getNodes().indexOf(d)>-1&&this.getNodes().indexOf(N)>-1))throw"Source or target not in graph!";if(!(d.owner==N.owner&&d.owner==this))throw"Both owners must be this graph!";return d.owner!=N.owner?null:(y.source=d,y.target=N,y.isInterGraph=!1,this.getEdges().push(y),d.edges.push(y),N!=d&&N.edges.push(y),y)}},s.prototype.remove=function(g){var d=g;if(g instanceof e){if(d==null)throw"Node is null!";if(!(d.owner!=null&&d.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var N=d.edges.slice(),c,y=N.length,A=0;A<y;A++)c=N[A],c.isInterGraph?this.graphManager.remove(c):c.source.owner.remove(c);var w=this.nodes.indexOf(d);if(w==-1)throw"Node not in owner node list!";this.nodes.splice(w,1)}else if(g instanceof a){var c=g;if(c==null)throw"Edge is null!";if(!(c.source!=null&&c.target!=null))throw"Source and/or target is null!";if(!(c.source.owner!=null&&c.target.owner!=null&&c.source.owner==this&&c.target.owner==this))throw"Source and/or target owner is invalid!";var P=c.source.edges.indexOf(c),k=c.target.edges.indexOf(c);if(!(P>-1&&k>-1))throw"Source and/or target doesn't know this edge!";c.source.edges.splice(P,1),c.target!=c.source&&c.target.edges.splice(k,1);var w=c.source.owner.getEdges().indexOf(c);if(w==-1)throw"Not in owner's edge list!";c.source.owner.getEdges().splice(w,1)}},s.prototype.updateLeftTop=function(){for(var g=l.MAX_VALUE,d=l.MAX_VALUE,N,c,y,A=this.getNodes(),w=A.length,P=0;P<w;P++){var k=A[P];N=k.getTop(),c=k.getLeft(),g>N&&(g=N),d>c&&(d=c)}return g==l.MAX_VALUE?null:(A[0].getParent().paddingLeft!=null?y=A[0].getParent().paddingLeft:y=this.margin,this.left=d-y,this.top=g-y,new f(this.left,this.top))},s.prototype.updateBounds=function(g){for(var d=l.MAX_VALUE,N=-l.MAX_VALUE,c=l.MAX_VALUE,y=-l.MAX_VALUE,A,w,P,k,Y,H=this.nodes,Z=H.length,M=0;M<Z;M++){var rt=H[M];g&&rt.child!=null&&rt.updateBounds(),A=rt.getLeft(),w=rt.getRight(),P=rt.getTop(),k=rt.getBottom(),d>A&&(d=A),N<w&&(N=w),c>P&&(c=P),y<k&&(y=k)}var n=new r(d,c,N-d,y-c);d==l.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),H[0].getParent().paddingLeft!=null?Y=H[0].getParent().paddingLeft:Y=this.margin,this.left=n.x-Y,this.right=n.x+n.width+Y,this.top=n.y-Y,this.bottom=n.y+n.height+Y},s.calculateBounds=function(g){for(var d=l.MAX_VALUE,N=-l.MAX_VALUE,c=l.MAX_VALUE,y=-l.MAX_VALUE,A,w,P,k,Y=g.length,H=0;H<Y;H++){var Z=g[H];A=Z.getLeft(),w=Z.getRight(),P=Z.getTop(),k=Z.getBottom(),d>A&&(d=A),N<w&&(N=w),c>P&&(c=P),y<k&&(y=k)}var M=new r(d,c,N-d,y-c);return M},s.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},s.prototype.getEstimatedSize=function(){if(this.estimatedSize==l.MIN_VALUE)throw"assert failed";return this.estimatedSize},s.prototype.calcEstimatedSize=function(){for(var g=0,d=this.nodes,N=d.length,c=0;c<N;c++){var y=d[c];g+=y.calcEstimatedSize()}return g==0?this.estimatedSize=o.EMPTY_COMPOUND_NODE_SIZE:this.estimatedSize=g/Math.sqrt(this.nodes.length),this.estimatedSize},s.prototype.updateConnected=function(){var g=this;if(this.nodes.length==0){this.isConnected=!0;return}var d=new t,N=new Set,c=this.nodes[0],y,A,w=c.withChildren();for(w.forEach(function(M){d.push(M),N.add(M)});d.length!==0;){c=d.shift(),y=c.getEdges();for(var P=y.length,k=0;k<P;k++){var Y=y[k];if(A=Y.getOtherEndInGraph(c,this),A!=null&&!N.has(A)){var H=A.withChildren();H.forEach(function(M){d.push(M),N.add(M)})}}}if(this.isConnected=!1,N.size>=this.nodes.length){var Z=0;N.forEach(function(M){M.owner==g&&Z++}),Z==this.nodes.length&&(this.isConnected=!0)}},I.exports=s},function(I,G,T){var u,l=T(1);function o(i){u=T(6),this.layout=i,this.graphs=[],this.edges=[]}o.prototype.addRoot=function(){var i=this.layout.newGraph(),e=this.layout.newNode(null),a=this.add(i,e);return this.setRootGraph(a),this.rootGraph},o.prototype.add=function(i,e,a,r,f){if(a==null&&r==null&&f==null){if(i==null)throw"Graph is null!";if(e==null)throw"Parent node is null!";if(this.graphs.indexOf(i)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(i),i.parent!=null)throw"Already has a parent!";if(e.child!=null)throw"Already has a child!";return i.parent=e,e.child=i,i}else{f=a,r=e,a=i;var t=r.getOwner(),s=f.getOwner();if(!(t!=null&&t.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(s!=null&&s.getGraphManager()==this))throw"Target not in this graph mgr!";if(t==s)return a.isInterGraph=!1,t.add(a,r,f);if(a.isInterGraph=!0,a.source=r,a.target=f,this.edges.indexOf(a)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(a),!(a.source!=null&&a.target!=null))throw"Edge source and/or target is null!";if(!(a.source.edges.indexOf(a)==-1&&a.target.edges.indexOf(a)==-1))throw"Edge already in source and/or target incidency list!";return a.source.edges.push(a),a.target.edges.push(a),a}},o.prototype.remove=function(i){if(i instanceof u){var e=i;if(e.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(e==this.rootGraph||e.parent!=null&&e.parent.graphManager==this))throw"Invalid parent node!";var a=[];a=a.concat(e.getEdges());for(var r,f=a.length,t=0;t<f;t++)r=a[t],e.remove(r);var s=[];s=s.concat(e.getNodes());var h;f=s.length;for(var t=0;t<f;t++)h=s[t],e.remove(h);e==this.rootGraph&&this.setRootGraph(null);var g=this.graphs.indexOf(e);this.graphs.splice(g,1),e.parent=null}else if(i instanceof l){if(r=i,r==null)throw"Edge is null!";if(!r.isInterGraph)throw"Not an inter-graph edge!";if(!(r.source!=null&&r.target!=null))throw"Source and/or target is null!";if(!(r.source.edges.indexOf(r)!=-1&&r.target.edges.indexOf(r)!=-1))throw"Source and/or target doesn't know this edge!";var g=r.source.edges.indexOf(r);if(r.source.edges.splice(g,1),g=r.target.edges.indexOf(r),r.target.edges.splice(g,1),!(r.source.owner!=null&&r.source.owner.getGraphManager()!=null))throw"Edge owner graph or owner graph manager is null!";if(r.source.owner.getGraphManager().edges.indexOf(r)==-1)throw"Not in owner graph manager's edge list!";var g=r.source.owner.getGraphManager().edges.indexOf(r);r.source.owner.getGraphManager().edges.splice(g,1)}},o.prototype.updateBounds=function(){this.rootGraph.updateBounds(!0)},o.prototype.getGraphs=function(){return this.graphs},o.prototype.getAllNodes=function(){if(this.allNodes==null){for(var i=[],e=this.getGraphs(),a=e.length,r=0;r<a;r++)i=i.concat(e[r].getNodes());this.allNodes=i}return this.allNodes},o.prototype.resetAllNodes=function(){this.allNodes=null},o.prototype.resetAllEdges=function(){this.allEdges=null},o.prototype.resetAllNodesToApplyGravitation=function(){this.allNodesToApplyGravitation=null},o.prototype.getAllEdges=function(){if(this.allEdges==null){var i=[],e=this.getGraphs();e.length;for(var a=0;a<e.length;a++)i=i.concat(e[a].getEdges());i=i.concat(this.edges),this.allEdges=i}return this.allEdges},o.prototype.getAllNodesToApplyGravitation=function(){return this.allNodesToApplyGravitation},o.prototype.setAllNodesToApplyGravitation=function(i){if(this.allNodesToApplyGravitation!=null)throw"assert failed";this.allNodesToApplyGravitation=i},o.prototype.getRoot=function(){return this.rootGraph},o.prototype.setRootGraph=function(i){if(i.getGraphManager()!=this)throw"Root not in this graph mgr!";this.rootGraph=i,i.parent==null&&(i.parent=this.layout.newNode("Root node"))},o.prototype.getLayout=function(){return this.layout},o.prototype.isOneAncestorOfOther=function(i,e){if(!(i!=null&&e!=null))throw"assert failed";if(i==e)return!0;var a=i.getOwner(),r;do{if(r=a.getParent(),r==null)break;if(r==e)return!0;if(a=r.getOwner(),a==null)break}while(!0);a=e.getOwner();do{if(r=a.getParent(),r==null)break;if(r==i)return!0;if(a=r.getOwner(),a==null)break}while(!0);return!1},o.prototype.calcLowestCommonAncestors=function(){for(var i,e,a,r,f,t=this.getAllEdges(),s=t.length,h=0;h<s;h++){if(i=t[h],e=i.source,a=i.target,i.lca=null,i.sourceInLca=e,i.targetInLca=a,e==a){i.lca=e.getOwner();continue}for(r=e.getOwner();i.lca==null;){for(i.targetInLca=a,f=a.getOwner();i.lca==null;){if(f==r){i.lca=f;break}if(f==this.rootGraph)break;if(i.lca!=null)throw"assert failed";i.targetInLca=f.getParent(),f=i.targetInLca.getOwner()}if(r==this.rootGraph)break;i.lca==null&&(i.sourceInLca=r.getParent(),r=i.sourceInLca.getOwner())}if(i.lca==null)throw"assert failed"}},o.prototype.calcLowestCommonAncestor=function(i,e){if(i==e)return i.getOwner();var a=i.getOwner();do{if(a==null)break;var r=e.getOwner();do{if(r==null)break;if(r==a)return r;r=r.getParent().getOwner()}while(!0);a=a.getParent().getOwner()}while(!0);return a},o.prototype.calcInclusionTreeDepths=function(i,e){i==null&&e==null&&(i=this.rootGraph,e=1);for(var a,r=i.getNodes(),f=r.length,t=0;t<f;t++)a=r[t],a.inclusionTreeDepth=e,a.child!=null&&this.calcInclusionTreeDepths(a.child,e+1)},o.prototype.includesInvalidEdge=function(){for(var i,e=[],a=this.edges.length,r=0;r<a;r++)i=this.edges[r],this.isOneAncestorOfOther(i.source,i.target)&&e.push(i);for(var r=0;r<e.length;r++)this.remove(e[r]);return!1},I.exports=o},function(I,G,T){var u=T(12);function l(){}l.calcSeparationAmount=function(o,i,e,a){if(!o.intersects(i))throw"assert failed";var r=new Array(2);this.decideDirectionsForOverlappingNodes(o,i,r),e[0]=Math.min(o.getRight(),i.getRight())-Math.max(o.x,i.x),e[1]=Math.min(o.getBottom(),i.getBottom())-Math.max(o.y,i.y),o.getX()<=i.getX()&&o.getRight()>=i.getRight()?e[0]+=Math.min(i.getX()-o.getX(),o.getRight()-i.getRight()):i.getX()<=o.getX()&&i.getRight()>=o.getRight()&&(e[0]+=Math.min(o.getX()-i.getX(),i.getRight()-o.getRight())),o.getY()<=i.getY()&&o.getBottom()>=i.getBottom()?e[1]+=Math.min(i.getY()-o.getY(),o.getBottom()-i.getBottom()):i.getY()<=o.getY()&&i.getBottom()>=o.getBottom()&&(e[1]+=Math.min(o.getY()-i.getY(),i.getBottom()-o.getBottom()));var f=Math.abs((i.getCenterY()-o.getCenterY())/(i.getCenterX()-o.getCenterX()));i.getCenterY()===o.getCenterY()&&i.getCenterX()===o.getCenterX()&&(f=1);var t=f*e[0],s=e[1]/f;e[0]<s?s=e[0]:t=e[1],e[0]=-1*r[0]*(s/2+a),e[1]=-1*r[1]*(t/2+a)},l.decideDirectionsForOverlappingNodes=function(o,i,e){o.getCenterX()<i.getCenterX()?e[0]=-1:e[0]=1,o.getCenterY()<i.getCenterY()?e[1]=-1:e[1]=1},l.getIntersection2=function(o,i,e){var a=o.getCenterX(),r=o.getCenterY(),f=i.getCenterX(),t=i.getCenterY();if(o.intersects(i))return e[0]=a,e[1]=r,e[2]=f,e[3]=t,!0;var s=o.getX(),h=o.getY(),g=o.getRight(),d=o.getX(),N=o.getBottom(),c=o.getRight(),y=o.getWidthHalf(),A=o.getHeightHalf(),w=i.getX(),P=i.getY(),k=i.getRight(),Y=i.getX(),H=i.getBottom(),Z=i.getRight(),M=i.getWidthHalf(),rt=i.getHeightHalf(),n=!1,E=!1;if(a===f){if(r>t)return e[0]=a,e[1]=h,e[2]=f,e[3]=H,!1;if(r<t)return e[0]=a,e[1]=N,e[2]=f,e[3]=P,!1}else if(r===t){if(a>f)return e[0]=s,e[1]=r,e[2]=k,e[3]=t,!1;if(a<f)return e[0]=g,e[1]=r,e[2]=w,e[3]=t,!1}else{var p=o.height/o.width,m=i.height/i.width,v=(t-r)/(f-a),O=void 0,_=void 0,x=void 0,U=void 0,X=void 0,B=void 0;if(-p===v?a>f?(e[0]=d,e[1]=N,n=!0):(e[0]=g,e[1]=h,n=!0):p===v&&(a>f?(e[0]=s,e[1]=h,n=!0):(e[0]=c,e[1]=N,n=!0)),-m===v?f>a?(e[2]=Y,e[3]=H,E=!0):(e[2]=k,e[3]=P,E=!0):m===v&&(f>a?(e[2]=w,e[3]=P,E=!0):(e[2]=Z,e[3]=H,E=!0)),n&&E)return!1;if(a>f?r>t?(O=this.getCardinalDirection(p,v,4),_=this.getCardinalDirection(m,v,2)):(O=this.getCardinalDirection(-p,v,3),_=this.getCardinalDirection(-m,v,1)):r>t?(O=this.getCardinalDirection(-p,v,1),_=this.getCardinalDirection(-m,v,3)):(O=this.getCardinalDirection(p,v,2),_=this.getCardinalDirection(m,v,4)),!n)switch(O){case 1:U=h,x=a+-A/v,e[0]=x,e[1]=U;break;case 2:x=c,U=r+y*v,e[0]=x,e[1]=U;break;case 3:U=N,x=a+A/v,e[0]=x,e[1]=U;break;case 4:x=d,U=r+-y*v,e[0]=x,e[1]=U;break}if(!E)switch(_){case 1:B=P,X=f+-rt/v,e[2]=X,e[3]=B;break;case 2:X=Z,B=t+M*v,e[2]=X,e[3]=B;break;case 3:B=H,X=f+rt/v,e[2]=X,e[3]=B;break;case 4:X=Y,B=t+-M*v,e[2]=X,e[3]=B;break}}return!1},l.getCardinalDirection=function(o,i,e){return o>i?e:1+e%4},l.getIntersection=function(o,i,e,a){if(a==null)return this.getIntersection2(o,i,e);var r=o.x,f=o.y,t=i.x,s=i.y,h=e.x,g=e.y,d=a.x,N=a.y,c=void 0,y=void 0,A=void 0,w=void 0,P=void 0,k=void 0,Y=void 0,H=void 0,Z=void 0;return A=s-f,P=r-t,Y=t*f-r*s,w=N-g,k=h-d,H=d*g-h*N,Z=A*k-w*P,Z===0?null:(c=(P*H-k*Y)/Z,y=(w*Y-A*H)/Z,new u(c,y))},l.angleOfVector=function(o,i,e,a){var r=void 0;return o!==e?(r=Math.atan((a-i)/(e-o)),e<o?r+=Math.PI:a<i&&(r+=this.TWO_PI)):a<i?r=this.ONE_AND_HALF_PI:r=this.HALF_PI,r},l.doIntersect=function(o,i,e,a){var r=o.x,f=o.y,t=i.x,s=i.y,h=e.x,g=e.y,d=a.x,N=a.y,c=(t-r)*(N-g)-(d-h)*(s-f);if(c===0)return!1;var y=((N-g)*(d-r)+(h-d)*(N-f))/c,A=((f-s)*(d-r)+(t-r)*(N-f))/c;return 0<y&&y<1&&0<A&&A<1},l.findCircleLineIntersections=function(o,i,e,a,r,f,t){var s=(e-o)*(e-o)+(a-i)*(a-i),h=2*((o-r)*(e-o)+(i-f)*(a-i)),g=(o-r)*(o-r)+(i-f)*(i-f)-t*t,d=h*h-4*s*g;if(d>=0){var N=(-h+Math.sqrt(h*h-4*s*g))/(2*s),c=(-h-Math.sqrt(h*h-4*s*g))/(2*s),y=null;return N>=0&&N<=1?[N]:c>=0&&c<=1?[c]:y}else return null},l.HALF_PI=.5*Math.PI,l.ONE_AND_HALF_PI=1.5*Math.PI,l.TWO_PI=2*Math.PI,l.THREE_PI=3*Math.PI,I.exports=l},function(I,G,T){function u(){}u.sign=function(l){return l>0?1:l<0?-1:0},u.floor=function(l){return l<0?Math.ceil(l):Math.floor(l)},u.ceil=function(l){return l<0?Math.floor(l):Math.ceil(l)},I.exports=u},function(I,G,T){function u(){}u.MAX_VALUE=2147483647,u.MIN_VALUE=-2147483648,I.exports=u},function(I,G,T){var u=function(){function r(f,t){for(var s=0;s<t.length;s++){var h=t[s];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(f,h.key,h)}}return function(f,t,s){return t&&r(f.prototype,t),s&&r(f,s),f}}();function l(r,f){if(!(r instanceof f))throw new TypeError("Cannot call a class as a function")}var o=function(r){return{value:r,next:null,prev:null}},i=function(r,f,t,s){return r!==null?r.next=f:s.head=f,t!==null?t.prev=f:s.tail=f,f.prev=r,f.next=t,s.length++,f},e=function(r,f){var t=r.prev,s=r.next;return t!==null?t.next=s:f.head=s,s!==null?s.prev=t:f.tail=t,r.prev=r.next=null,f.length--,r},a=function(){function r(f){var t=this;l(this,r),this.length=0,this.head=null,this.tail=null,f?.forEach(function(s){return t.push(s)})}return u(r,[{key:"size",value:function(){return this.length}},{key:"insertBefore",value:function(f,t){return i(t.prev,o(f),t,this)}},{key:"insertAfter",value:function(f,t){return i(t,o(f),t.next,this)}},{key:"insertNodeBefore",value:function(f,t){return i(t.prev,f,t,this)}},{key:"insertNodeAfter",value:function(f,t){return i(t,f,t.next,this)}},{key:"push",value:function(f){return i(this.tail,o(f),null,this)}},{key:"unshift",value:function(f){return i(null,o(f),this.head,this)}},{key:"remove",value:function(f){return e(f,this)}},{key:"pop",value:function(){return e(this.tail,this).value}},{key:"popNode",value:function(){return e(this.tail,this)}},{key:"shift",value:function(){return e(this.head,this).value}},{key:"shiftNode",value:function(){return e(this.head,this)}},{key:"get_object_at",value:function(f){if(f<=this.length()){for(var t=1,s=this.head;t<f;)s=s.next,t++;return s.value}}},{key:"set_object_at",value:function(f,t){if(f<=this.length()){for(var s=1,h=this.head;s<f;)h=h.next,s++;h.value=t}}}]),r}();I.exports=a},function(I,G,T){function u(l,o,i){this.x=null,this.y=null,l==null&&o==null&&i==null?(this.x=0,this.y=0):typeof l=="number"&&typeof o=="number"&&i==null?(this.x=l,this.y=o):l.constructor.name=="Point"&&o==null&&i==null&&(i=l,this.x=i.x,this.y=i.y)}u.prototype.getX=function(){return this.x},u.prototype.getY=function(){return this.y},u.prototype.getLocation=function(){return new u(this.x,this.y)},u.prototype.setLocation=function(l,o,i){l.constructor.name=="Point"&&o==null&&i==null?(i=l,this.setLocation(i.x,i.y)):typeof l=="number"&&typeof o=="number"&&i==null&&(parseInt(l)==l&&parseInt(o)==o?this.move(l,o):(this.x=Math.floor(l+.5),this.y=Math.floor(o+.5)))},u.prototype.move=function(l,o){this.x=l,this.y=o},u.prototype.translate=function(l,o){this.x+=l,this.y+=o},u.prototype.equals=function(l){if(l.constructor.name=="Point"){var o=l;return this.x==o.x&&this.y==o.y}return this==l},u.prototype.toString=function(){return new u().constructor.name+"[x="+this.x+",y="+this.y+"]"},I.exports=u},function(I,G,T){function u(l,o,i,e){this.x=0,this.y=0,this.width=0,this.height=0,l!=null&&o!=null&&i!=null&&e!=null&&(this.x=l,this.y=o,this.width=i,this.height=e)}u.prototype.getX=function(){return this.x},u.prototype.setX=function(l){this.x=l},u.prototype.getY=function(){return this.y},u.prototype.setY=function(l){this.y=l},u.prototype.getWidth=function(){return this.width},u.prototype.setWidth=function(l){this.width=l},u.prototype.getHeight=function(){return this.height},u.prototype.setHeight=function(l){this.height=l},u.prototype.getRight=function(){return this.x+this.width},u.prototype.getBottom=function(){return this.y+this.height},u.prototype.intersects=function(l){return!(this.getRight()<l.x||this.getBottom()<l.y||l.getRight()<this.x||l.getBottom()<this.y)},u.prototype.getCenterX=function(){return this.x+this.width/2},u.prototype.getMinX=function(){return this.getX()},u.prototype.getMaxX=function(){return this.getX()+this.width},u.prototype.getCenterY=function(){return this.y+this.height/2},u.prototype.getMinY=function(){return this.getY()},u.prototype.getMaxY=function(){return this.getY()+this.height},u.prototype.getWidthHalf=function(){return this.width/2},u.prototype.getHeightHalf=function(){return this.height/2},I.exports=u},function(I,G,T){var u=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(o){return typeof o}:function(o){return o&&typeof Symbol=="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o};function l(){}l.lastID=0,l.createID=function(o){return l.isPrimitive(o)?o:(o.uniqueID!=null||(o.uniqueID=l.getString(),l.lastID++),o.uniqueID)},l.getString=function(o){return o==null&&(o=l.lastID),"Object#"+o},l.isPrimitive=function(o){var i=typeof o>"u"?"undefined":u(o);return o==null||i!="object"&&i!="function"},I.exports=l},function(I,G,T){function u(h){if(Array.isArray(h)){for(var g=0,d=Array(h.length);g<h.length;g++)d[g]=h[g];return d}else return Array.from(h)}var l=T(0),o=T(7),i=T(3),e=T(1),a=T(6),r=T(5),f=T(17),t=T(29);function s(h){t.call(this),this.layoutQuality=l.QUALITY,this.createBendsAsNeeded=l.DEFAULT_CREATE_BENDS_AS_NEEDED,this.incremental=l.DEFAULT_INCREMENTAL,this.animationOnLayout=l.DEFAULT_ANIMATION_ON_LAYOUT,this.animationDuringLayout=l.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=l.DEFAULT_ANIMATION_PERIOD,this.uniformLeafNodeSizes=l.DEFAULT_UNIFORM_LEAF_NODE_SIZES,this.edgeToDummyNodes=new Map,this.graphManager=new o(this),this.isLayoutFinished=!1,this.isSubLayout=!1,this.isRemoteUse=!1,h!=null&&(this.isRemoteUse=h)}s.RANDOM_SEED=1,s.prototype=Object.create(t.prototype),s.prototype.getGraphManager=function(){return this.graphManager},s.prototype.getAllNodes=function(){return this.graphManager.getAllNodes()},s.prototype.getAllEdges=function(){return this.graphManager.getAllEdges()},s.prototype.getAllNodesToApplyGravitation=function(){return this.graphManager.getAllNodesToApplyGravitation()},s.prototype.newGraphManager=function(){var h=new o(this);return this.graphManager=h,h},s.prototype.newGraph=function(h){return new a(null,this.graphManager,h)},s.prototype.newNode=function(h){return new i(this.graphManager,h)},s.prototype.newEdge=function(h){return new e(null,null,h)},s.prototype.checkLayoutSuccess=function(){return this.graphManager.getRoot()==null||this.graphManager.getRoot().getNodes().length==0||this.graphManager.includesInvalidEdge()},s.prototype.runLayout=function(){this.isLayoutFinished=!1,this.tilingPreLayout&&this.tilingPreLayout(),this.initParameters();var h;return this.checkLayoutSuccess()?h=!1:h=this.layout(),l.ANIMATE==="during"?!1:(h&&(this.isSubLayout||this.doPostLayout()),this.tilingPostLayout&&this.tilingPostLayout(),this.isLayoutFinished=!0,h)},s.prototype.doPostLayout=function(){this.incremental||this.transform(),this.update()},s.prototype.update2=function(){if(this.createBendsAsNeeded&&(this.createBendpointsFromDummyNodes(),this.graphManager.resetAllEdges()),!this.isRemoteUse){for(var h=this.graphManager.getAllEdges(),g=0;g<h.length;g++)h[g];for(var d=this.graphManager.getRoot().getNodes(),g=0;g<d.length;g++)d[g];this.update(this.graphManager.getRoot())}},s.prototype.update=function(h){if(h==null)this.update2();else if(h instanceof i){var g=h;if(g.getChild()!=null)for(var d=g.getChild().getNodes(),N=0;N<d.length;N++)update(d[N]);if(g.vGraphObject!=null){var c=g.vGraphObject;c.update(g)}}else if(h instanceof e){var y=h;if(y.vGraphObject!=null){var A=y.vGraphObject;A.update(y)}}else if(h instanceof a){var w=h;if(w.vGraphObject!=null){var P=w.vGraphObject;P.update(w)}}},s.prototype.initParameters=function(){this.isSubLayout||(this.layoutQuality=l.QUALITY,this.animationDuringLayout=l.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=l.DEFAULT_ANIMATION_PERIOD,this.animationOnLayout=l.DEFAULT_ANIMATION_ON_LAYOUT,this.incremental=l.DEFAULT_INCREMENTAL,this.createBendsAsNeeded=l.DEFAULT_CREATE_BENDS_AS_NEEDED,this.uniformLeafNodeSizes=l.DEFAULT_UNIFORM_LEAF_NODE_SIZES),this.animationDuringLayout&&(this.animationOnLayout=!1)},s.prototype.transform=function(h){if(h==null)this.transform(new r(0,0));else{var g=new f,d=this.graphManager.getRoot().updateLeftTop();if(d!=null){g.setWorldOrgX(h.x),g.setWorldOrgY(h.y),g.setDeviceOrgX(d.x),g.setDeviceOrgY(d.y);for(var N=this.getAllNodes(),c,y=0;y<N.length;y++)c=N[y],c.transform(g)}}},s.prototype.positionNodesRandomly=function(h){if(h==null)this.positionNodesRandomly(this.getGraphManager().getRoot()),this.getGraphManager().getRoot().updateBounds(!0);else for(var g,d,N=h.getNodes(),c=0;c<N.length;c++)g=N[c],d=g.getChild(),d==null||d.getNodes().length==0?g.scatter():(this.positionNodesRandomly(d),g.updateBounds())},s.prototype.getFlatForest=function(){for(var h=[],g=!0,d=this.graphManager.getRoot().getNodes(),N=!0,c=0;c<d.length;c++)d[c].getChild()!=null&&(N=!1);if(!N)return h;var y=new Set,A=[],w=new Map,P=[];for(P=P.concat(d);P.length>0&&g;){for(A.push(P[0]);A.length>0&&g;){var k=A[0];A.splice(0,1),y.add(k);for(var Y=k.getEdges(),c=0;c<Y.length;c++){var H=Y[c].getOtherEnd(k);if(w.get(k)!=H)if(!y.has(H))A.push(H),w.set(H,k);else{g=!1;break}}}if(!g)h=[];else{var Z=[].concat(u(y));h.push(Z);for(var c=0;c<Z.length;c++){var M=Z[c],rt=P.indexOf(M);rt>-1&&P.splice(rt,1)}y=new Set,w=new Map}}return h},s.prototype.createDummyNodesForBendpoints=function(h){for(var g=[],d=h.source,N=this.graphManager.calcLowestCommonAncestor(h.source,h.target),c=0;c<h.bendpoints.length;c++){var y=this.newNode(null);y.setRect(new Point(0,0),new Dimension(1,1)),N.add(y);var A=this.newEdge(null);this.graphManager.add(A,d,y),g.add(y),d=y}var A=this.newEdge(null);return this.graphManager.add(A,d,h.target),this.edgeToDummyNodes.set(h,g),h.isInterGraph()?this.graphManager.remove(h):N.remove(h),g},s.prototype.createBendpointsFromDummyNodes=function(){var h=[];h=h.concat(this.graphManager.getAllEdges()),h=[].concat(u(this.edgeToDummyNodes.keys())).concat(h);for(var g=0;g<h.length;g++){var d=h[g];if(d.bendpoints.length>0){for(var N=this.edgeToDummyNodes.get(d),c=0;c<N.length;c++){var y=N[c],A=new r(y.getCenterX(),y.getCenterY()),w=d.bendpoints.get(c);w.x=A.x,w.y=A.y,y.getOwner().remove(y)}this.graphManager.add(d,d.source,d.target)}}},s.transform=function(h,g,d,N){if(d!=null&&N!=null){var c=g;if(h<=50){var y=g/d;c-=(g-y)/50*(50-h)}else{var A=g*N;c+=(A-g)/50*(h-50)}return c}else{var w,P;return h<=50?(w=9*g/500,P=g/10):(w=9*g/50,P=-8*g),w*h+P}},s.findCenterOfTree=function(h){var g=[];g=g.concat(h);var d=[],N=new Map,c=!1,y=null;(g.length==1||g.length==2)&&(c=!0,y=g[0]);for(var A=0;A<g.length;A++){var w=g[A],P=w.getNeighborsList().size;N.set(w,w.getNeighborsList().size),P==1&&d.push(w)}var k=[];for(k=k.concat(d);!c;){var Y=[];Y=Y.concat(k),k=[];for(var A=0;A<g.length;A++){var w=g[A],H=g.indexOf(w);H>=0&&g.splice(H,1);var Z=w.getNeighborsList();Z.forEach(function(n){if(d.indexOf(n)<0){var E=N.get(n),p=E-1;p==1&&k.push(n),N.set(n,p)}})}d=d.concat(k),(g.length==1||g.length==2)&&(c=!0,y=g[0])}return y},s.prototype.setGraphManager=function(h){this.graphManager=h},I.exports=s},function(I,G,T){function u(){}u.seed=1,u.x=0,u.nextDouble=function(){return u.x=Math.sin(u.seed++)*1e4,u.x-Math.floor(u.x)},I.exports=u},function(I,G,T){var u=T(5);function l(o,i){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}l.prototype.getWorldOrgX=function(){return this.lworldOrgX},l.prototype.setWorldOrgX=function(o){this.lworldOrgX=o},l.prototype.getWorldOrgY=function(){return this.lworldOrgY},l.prototype.setWorldOrgY=function(o){this.lworldOrgY=o},l.prototype.getWorldExtX=function(){return this.lworldExtX},l.prototype.setWorldExtX=function(o){this.lworldExtX=o},l.prototype.getWorldExtY=function(){return this.lworldExtY},l.prototype.setWorldExtY=function(o){this.lworldExtY=o},l.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},l.prototype.setDeviceOrgX=function(o){this.ldeviceOrgX=o},l.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},l.prototype.setDeviceOrgY=function(o){this.ldeviceOrgY=o},l.prototype.getDeviceExtX=function(){return this.ldeviceExtX},l.prototype.setDeviceExtX=function(o){this.ldeviceExtX=o},l.prototype.getDeviceExtY=function(){return this.ldeviceExtY},l.prototype.setDeviceExtY=function(o){this.ldeviceExtY=o},l.prototype.transformX=function(o){var i=0,e=this.lworldExtX;return e!=0&&(i=this.ldeviceOrgX+(o-this.lworldOrgX)*this.ldeviceExtX/e),i},l.prototype.transformY=function(o){var i=0,e=this.lworldExtY;return e!=0&&(i=this.ldeviceOrgY+(o-this.lworldOrgY)*this.ldeviceExtY/e),i},l.prototype.inverseTransformX=function(o){var i=0,e=this.ldeviceExtX;return e!=0&&(i=this.lworldOrgX+(o-this.ldeviceOrgX)*this.lworldExtX/e),i},l.prototype.inverseTransformY=function(o){var i=0,e=this.ldeviceExtY;return e!=0&&(i=this.lworldOrgY+(o-this.ldeviceOrgY)*this.lworldExtY/e),i},l.prototype.inverseTransformPoint=function(o){var i=new u(this.inverseTransformX(o.x),this.inverseTransformY(o.y));return i},I.exports=l},function(I,G,T){function u(t){if(Array.isArray(t)){for(var s=0,h=Array(t.length);s<t.length;s++)h[s]=t[s];return h}else return Array.from(t)}var l=T(15),o=T(4),i=T(0),e=T(8),a=T(9);function r(){l.call(this),this.useSmartIdealEdgeLengthCalculation=o.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=o.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=o.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=o.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=o.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*o.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=o.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=o.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=o.MAX_ITERATIONS}r.prototype=Object.create(l.prototype);for(var f in l)r[f]=l[f];r.prototype.initParameters=function(){l.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=o.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},r.prototype.calcIdealEdgeLengths=function(){for(var t,s,h,g,d,N,c,y=this.getGraphManager().getAllEdges(),A=0;A<y.length;A++)t=y[A],s=t.idealLength,t.isInterGraph&&(g=t.getSource(),d=t.getTarget(),N=t.getSourceInLca().getEstimatedSize(),c=t.getTargetInLca().getEstimatedSize(),this.useSmartIdealEdgeLengthCalculation&&(t.idealLength+=N+c-2*i.SIMPLE_NODE_SIZE),h=t.getLca().getInclusionTreeDepth(),t.idealLength+=s*o.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR*(g.getInclusionTreeDepth()+d.getInclusionTreeDepth()-2*h))},r.prototype.initSpringEmbedder=function(){var t=this.getAllNodes().length;this.incremental?(t>o.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*o.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(t-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-o.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT_INCREMENTAL):(t>o.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(o.COOLING_ADAPTATION_FACTOR,1-(t-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*(1-o.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.displacementThresholdPerNode=3*o.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},r.prototype.calcSpringForces=function(){for(var t=this.getAllEdges(),s,h=0;h<t.length;h++)s=t[h],this.calcSpringForce(s,s.idealLength)},r.prototype.calcRepulsionForces=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,h,g,d,N,c=this.getAllNodes(),y;if(this.useFRGridVariant)for(this.totalIterations%o.GRID_CALCULATION_CHECK_PERIOD==1&&t&&this.updateGrid(),y=new Set,h=0;h<c.length;h++)d=c[h],this.calculateRepulsionForceOfANode(d,y,t,s),y.add(d);else for(h=0;h<c.length;h++)for(d=c[h],g=h+1;g<c.length;g++)N=c[g],d.getOwner()==N.getOwner()&&this.calcRepulsionForce(d,N)},r.prototype.calcGravitationalForces=function(){for(var t,s=this.getAllNodesToApplyGravitation(),h=0;h<s.length;h++)t=s[h],this.calcGravitationalForce(t)},r.prototype.moveNodes=function(){for(var t=this.getAllNodes(),s,h=0;h<t.length;h++)s=t[h],s.move()},r.prototype.calcSpringForce=function(t,s){var h=t.getSource(),g=t.getTarget(),d,N,c,y;if(this.uniformLeafNodeSizes&&h.getChild()==null&&g.getChild()==null)t.updateLengthSimple();else if(t.updateLength(),t.isOverlapingSourceAndTarget)return;d=t.getLength(),d!=0&&(N=t.edgeElasticity*(d-s),c=N*(t.lengthX/d),y=N*(t.lengthY/d),h.springForceX+=c,h.springForceY+=y,g.springForceX-=c,g.springForceY-=y)},r.prototype.calcRepulsionForce=function(t,s){var h=t.getRect(),g=s.getRect(),d=new Array(2),N=new Array(4),c,y,A,w,P,k,Y;if(h.intersects(g)){e.calcSeparationAmount(h,g,d,o.DEFAULT_EDGE_LENGTH/2),k=2*d[0],Y=2*d[1];var H=t.noOfChildren*s.noOfChildren/(t.noOfChildren+s.noOfChildren);t.repulsionForceX-=H*k,t.repulsionForceY-=H*Y,s.repulsionForceX+=H*k,s.repulsionForceY+=H*Y}else this.uniformLeafNodeSizes&&t.getChild()==null&&s.getChild()==null?(c=g.getCenterX()-h.getCenterX(),y=g.getCenterY()-h.getCenterY()):(e.getIntersection(h,g,N),c=N[2]-N[0],y=N[3]-N[1]),Math.abs(c)<o.MIN_REPULSION_DIST&&(c=a.sign(c)*o.MIN_REPULSION_DIST),Math.abs(y)<o.MIN_REPULSION_DIST&&(y=a.sign(y)*o.MIN_REPULSION_DIST),A=c*c+y*y,w=Math.sqrt(A),P=(t.nodeRepulsion/2+s.nodeRepulsion/2)*t.noOfChildren*s.noOfChildren/A,k=P*c/w,Y=P*y/w,t.repulsionForceX-=k,t.repulsionForceY-=Y,s.repulsionForceX+=k,s.repulsionForceY+=Y},r.prototype.calcGravitationalForce=function(t){var s,h,g,d,N,c,y,A;s=t.getOwner(),h=(s.getRight()+s.getLeft())/2,g=(s.getTop()+s.getBottom())/2,d=t.getCenterX()-h,N=t.getCenterY()-g,c=Math.abs(d)+t.getWidth()/2,y=Math.abs(N)+t.getHeight()/2,t.getOwner()==this.graphManager.getRoot()?(A=s.getEstimatedSize()*this.gravityRangeFactor,(c>A||y>A)&&(t.gravitationForceX=-this.gravityConstant*d,t.gravitationForceY=-this.gravityConstant*N)):(A=s.getEstimatedSize()*this.compoundGravityRangeFactor,(c>A||y>A)&&(t.gravitationForceX=-this.gravityConstant*d*this.compoundGravityConstant,t.gravitationForceY=-this.gravityConstant*N*this.compoundGravityConstant))},r.prototype.isConverged=function(){var t,s=!1;return this.totalIterations>this.maxIterations/3&&(s=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),t=this.totalDisplacement<this.totalDisplacementThreshold,this.oldTotalDisplacement=this.totalDisplacement,t||s},r.prototype.animate=function(){this.animationDuringLayout&&!this.isSubLayout&&(this.notAnimatedIterations==this.animationPeriod?(this.update(),this.notAnimatedIterations=0):this.notAnimatedIterations++)},r.prototype.calcNoOfChildrenForAllNodes=function(){for(var t,s=this.graphManager.getAllNodes(),h=0;h<s.length;h++)t=s[h],t.noOfChildren=t.getNoOfChildren()},r.prototype.calcGrid=function(t){var s=0,h=0;s=parseInt(Math.ceil((t.getRight()-t.getLeft())/this.repulsionRange)),h=parseInt(Math.ceil((t.getBottom()-t.getTop())/this.repulsionRange));for(var g=new Array(s),d=0;d<s;d++)g[d]=new Array(h);for(var d=0;d<s;d++)for(var N=0;N<h;N++)g[d][N]=new Array;return g},r.prototype.addNodeToGrid=function(t,s,h){var g=0,d=0,N=0,c=0;g=parseInt(Math.floor((t.getRect().x-s)/this.repulsionRange)),d=parseInt(Math.floor((t.getRect().width+t.getRect().x-s)/this.repulsionRange)),N=parseInt(Math.floor((t.getRect().y-h)/this.repulsionRange)),c=parseInt(Math.floor((t.getRect().height+t.getRect().y-h)/this.repulsionRange));for(var y=g;y<=d;y++)for(var A=N;A<=c;A++)this.grid[y][A].push(t),t.setGridCoordinates(g,d,N,c)},r.prototype.updateGrid=function(){var t,s,h=this.getAllNodes();for(this.grid=this.calcGrid(this.graphManager.getRoot()),t=0;t<h.length;t++)s=h[t],this.addNodeToGrid(s,this.graphManager.getRoot().getLeft(),this.graphManager.getRoot().getTop())},r.prototype.calculateRepulsionForceOfANode=function(t,s,h,g){if(this.totalIterations%o.GRID_CALCULATION_CHECK_PERIOD==1&&h||g){var d=new Set;t.surrounding=new Array;for(var N,c=this.grid,y=t.startX-1;y<t.finishX+2;y++)for(var A=t.startY-1;A<t.finishY+2;A++)if(!(y<0||A<0||y>=c.length||A>=c[0].length)){for(var w=0;w<c[y][A].length;w++)if(N=c[y][A][w],!(t.getOwner()!=N.getOwner()||t==N)&&!s.has(N)&&!d.has(N)){var P=Math.abs(t.getCenterX()-N.getCenterX())-(t.getWidth()/2+N.getWidth()/2),k=Math.abs(t.getCenterY()-N.getCenterY())-(t.getHeight()/2+N.getHeight()/2);P<=this.repulsionRange&&k<=this.repulsionRange&&d.add(N)}}t.surrounding=[].concat(u(d))}for(y=0;y<t.surrounding.length;y++)this.calcRepulsionForce(t,t.surrounding[y])},r.prototype.calcRepulsionRange=function(){return 0},I.exports=r},function(I,G,T){var u=T(1),l=T(4);function o(e,a,r){u.call(this,e,a,r),this.idealLength=l.DEFAULT_EDGE_LENGTH,this.edgeElasticity=l.DEFAULT_SPRING_STRENGTH}o.prototype=Object.create(u.prototype);for(var i in u)o[i]=u[i];I.exports=o},function(I,G,T){var u=T(3),l=T(4);function o(e,a,r,f){u.call(this,e,a,r,f),this.nodeRepulsion=l.DEFAULT_REPULSION_STRENGTH,this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0,this.startX=0,this.finishX=0,this.startY=0,this.finishY=0,this.surrounding=[]}o.prototype=Object.create(u.prototype);for(var i in u)o[i]=u[i];o.prototype.setGridCoordinates=function(e,a,r,f){this.startX=e,this.finishX=a,this.startY=r,this.finishY=f},I.exports=o},function(I,G,T){function u(l,o){this.width=0,this.height=0,l!==null&&o!==null&&(this.height=o,this.width=l)}u.prototype.getWidth=function(){return this.width},u.prototype.setWidth=function(l){this.width=l},u.prototype.getHeight=function(){return this.height},u.prototype.setHeight=function(l){this.height=l},I.exports=u},function(I,G,T){var u=T(14);function l(){this.map={},this.keys=[]}l.prototype.put=function(o,i){var e=u.createID(o);this.contains(e)||(this.map[e]=i,this.keys.push(o))},l.prototype.contains=function(o){return u.createID(o),this.map[o]!=null},l.prototype.get=function(o){var i=u.createID(o);return this.map[i]},l.prototype.keySet=function(){return this.keys},I.exports=l},function(I,G,T){var u=T(14);function l(){this.set={}}l.prototype.add=function(o){var i=u.createID(o);this.contains(i)||(this.set[i]=o)},l.prototype.remove=function(o){delete this.set[u.createID(o)]},l.prototype.clear=function(){this.set={}},l.prototype.contains=function(o){return this.set[u.createID(o)]==o},l.prototype.isEmpty=function(){return this.size()===0},l.prototype.size=function(){return Object.keys(this.set).length},l.prototype.addAllTo=function(o){for(var i=Object.keys(this.set),e=i.length,a=0;a<e;a++)o.push(this.set[i[a]])},l.prototype.size=function(){return Object.keys(this.set).length},l.prototype.addAll=function(o){for(var i=o.length,e=0;e<i;e++){var a=o[e];this.add(a)}},I.exports=l},function(I,G,T){function u(){}u.multMat=function(l,o){for(var i=[],e=0;e<l.length;e++){i[e]=[];for(var a=0;a<o[0].length;a++){i[e][a]=0;for(var r=0;r<l[0].length;r++)i[e][a]+=l[e][r]*o[r][a]}}return i},u.transpose=function(l){for(var o=[],i=0;i<l[0].length;i++){o[i]=[];for(var e=0;e<l.length;e++)o[i][e]=l[e][i]}return o},u.multCons=function(l,o){for(var i=[],e=0;e<l.length;e++)i[e]=l[e]*o;return i},u.minusOp=function(l,o){for(var i=[],e=0;e<l.length;e++)i[e]=l[e]-o[e];return i},u.dotProduct=function(l,o){for(var i=0,e=0;e<l.length;e++)i+=l[e]*o[e];return i},u.mag=function(l){return Math.sqrt(this.dotProduct(l,l))},u.normalize=function(l){for(var o=[],i=this.mag(l),e=0;e<l.length;e++)o[e]=l[e]/i;return o},u.multGamma=function(l){for(var o=[],i=0,e=0;e<l.length;e++)i+=l[e];i*=-1/l.length;for(var a=0;a<l.length;a++)o[a]=i+l[a];return o},u.multL=function(l,o,i){for(var e=[],a=[],r=[],f=0;f<o[0].length;f++){for(var t=0,s=0;s<o.length;s++)t+=-.5*o[s][f]*l[s];a[f]=t}for(var h=0;h<i.length;h++){for(var g=0,d=0;d<i.length;d++)g+=i[h][d]*a[d];r[h]=g}for(var N=0;N<o.length;N++){for(var c=0,y=0;y<o[0].length;y++)c+=o[N][y]*r[y];e[N]=c}return e},I.exports=u},function(I,G,T){var u=function(){function e(a,r){for(var f=0;f<r.length;f++){var t=r[f];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(a,t.key,t)}}return function(a,r,f){return r&&e(a.prototype,r),f&&e(a,f),a}}();function l(e,a){if(!(e instanceof a))throw new TypeError("Cannot call a class as a function")}var o=T(11),i=function(){function e(a,r){l(this,e),(r!==null||r!==void 0)&&(this.compareFunction=this._defaultCompareFunction);var f=void 0;a instanceof o?f=a.size():f=a.length,this._quicksort(a,0,f-1)}return u(e,[{key:"_quicksort",value:function(a,r,f){if(r<f){var t=this._partition(a,r,f);this._quicksort(a,r,t),this._quicksort(a,t+1,f)}}},{key:"_partition",value:function(a,r,f){for(var t=this._get(a,r),s=r,h=f;;){for(;this.compareFunction(t,this._get(a,h));)h--;for(;this.compareFunction(this._get(a,s),t);)s++;if(s<h)this._swap(a,s,h),s++,h--;else return h}}},{key:"_get",value:function(a,r){return a instanceof o?a.get_object_at(r):a[r]}},{key:"_set",value:function(a,r,f){a instanceof o?a.set_object_at(r,f):a[r]=f}},{key:"_swap",value:function(a,r,f){var t=this._get(a,r);this._set(a,r,this._get(a,f)),this._set(a,f,t)}},{key:"_defaultCompareFunction",value:function(a,r){return r>a}}]),e}();I.exports=i},function(I,G,T){function u(){}u.svd=function(l){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=l.length,this.n=l[0].length;var o=Math.min(this.m,this.n);this.s=function(It){for(var Tt=[];It-- >0;)Tt.push(0);return Tt}(Math.min(this.m+1,this.n)),this.U=function(It){var Tt=function Xt(Ut){if(Ut.length==0)return 0;for(var bt=[],Pt=0;Pt<Ut[0];Pt++)bt.push(Xt(Ut.slice(1)));return bt};return Tt(It)}([this.m,o]),this.V=function(It){var Tt=function Xt(Ut){if(Ut.length==0)return 0;for(var bt=[],Pt=0;Pt<Ut[0];Pt++)bt.push(Xt(Ut.slice(1)));return bt};return Tt(It)}([this.n,this.n]);for(var i=function(It){for(var Tt=[];It-- >0;)Tt.push(0);return Tt}(this.n),e=function(It){for(var Tt=[];It-- >0;)Tt.push(0);return Tt}(this.m),a=!0,r=Math.min(this.m-1,this.n),f=Math.max(0,Math.min(this.n-2,this.m)),t=0;t<Math.max(r,f);t++){if(t<r){this.s[t]=0;for(var s=t;s<this.m;s++)this.s[t]=u.hypot(this.s[t],l[s][t]);if(this.s[t]!==0){l[t][t]<0&&(this.s[t]=-this.s[t]);for(var h=t;h<this.m;h++)l[h][t]/=this.s[t];l[t][t]+=1}this.s[t]=-this.s[t]}for(var g=t+1;g<this.n;g++){if(function(It,Tt){return It&&Tt}(t<r,this.s[t]!==0)){for(var d=0,N=t;N<this.m;N++)d+=l[N][t]*l[N][g];d=-d/l[t][t];for(var c=t;c<this.m;c++)l[c][g]+=d*l[c][t]}i[g]=l[t][g]}if(function(It,Tt){return Tt}(a,t<r))for(var y=t;y<this.m;y++)this.U[y][t]=l[y][t];if(t<f){i[t]=0;for(var A=t+1;A<this.n;A++)i[t]=u.hypot(i[t],i[A]);if(i[t]!==0){i[t+1]<0&&(i[t]=-i[t]);for(var w=t+1;w<this.n;w++)i[w]/=i[t];i[t+1]+=1}if(i[t]=-i[t],function(It,Tt){return It&&Tt}(t+1<this.m,i[t]!==0)){for(var P=t+1;P<this.m;P++)e[P]=0;for(var k=t+1;k<this.n;k++)for(var Y=t+1;Y<this.m;Y++)e[Y]+=i[k]*l[Y][k];for(var H=t+1;H<this.n;H++)for(var Z=-i[H]/i[t+1],M=t+1;M<this.m;M++)l[M][H]+=Z*e[M]}for(var rt=t+1;rt<this.n;rt++)this.V[rt][t]=i[rt]}}var n=Math.min(this.n,this.m+1);r<this.n&&(this.s[r]=l[r][r]),this.m<n&&(this.s[n-1]=0),f+1<n&&(i[f]=l[f][n-1]),i[n-1]=0;{for(var E=r;E<o;E++){for(var p=0;p<this.m;p++)this.U[p][E]=0;this.U[E][E]=1}for(var m=r-1;m>=0;m--)if(this.s[m]!==0){for(var v=m+1;v<o;v++){for(var O=0,_=m;_<this.m;_++)O+=this.U[_][m]*this.U[_][v];O=-O/this.U[m][m];for(var x=m;x<this.m;x++)this.U[x][v]+=O*this.U[x][m]}for(var U=m;U<this.m;U++)this.U[U][m]=-this.U[U][m];this.U[m][m]=1+this.U[m][m];for(var X=0;X<m-1;X++)this.U[X][m]=0}else{for(var B=0;B<this.m;B++)this.U[B][m]=0;this.U[m][m]=1}}for(var z=this.n-1;z>=0;z--){if(function(It,Tt){return It&&Tt}(z<f,i[z]!==0))for(var W=z+1;W<o;W++){for(var q=0,S=z+1;S<this.n;S++)q+=this.V[S][z]*this.V[S][W];q=-q/this.V[z+1][z];for(var b=z+1;b<this.n;b++)this.V[b][W]+=q*this.V[b][z]}for(var F=0;F<this.n;F++)this.V[F][z]=0;this.V[z][z]=1}for(var j=n-1,et=Math.pow(2,-52),mt=Math.pow(2,-966);n>0;){var $=void 0,xt=void 0;for($=n-2;$>=-1&&$!==-1;$--)if(Math.abs(i[$])<=mt+et*(Math.abs(this.s[$])+Math.abs(this.s[$+1]))){i[$]=0;break}if($===n-2)xt=4;else{var Q=void 0;for(Q=n-1;Q>=$&&Q!==$;Q--){var nt=(Q!==n?Math.abs(i[Q]):0)+(Q!==$+1?Math.abs(i[Q-1]):0);if(Math.abs(this.s[Q])<=mt+et*nt){this.s[Q]=0;break}}Q===$?xt=3:Q===n-1?xt=1:(xt=2,$=Q)}switch($++,xt){case 1:{var vt=i[n-2];i[n-2]=0;for(var st=n-2;st>=$;st--){var Lt=u.hypot(this.s[st],vt),_t=this.s[st]/Lt,Nt=vt/Lt;this.s[st]=Lt,st!==$&&(vt=-Nt*i[st-1],i[st-1]=_t*i[st-1]);for(var At=0;At<this.n;At++)Lt=_t*this.V[At][st]+Nt*this.V[At][n-1],this.V[At][n-1]=-Nt*this.V[At][st]+_t*this.V[At][n-1],this.V[At][st]=Lt}}break;case 2:{var Ht=i[$-1];i[$-1]=0;for(var Ot=$;Ot<n;Ot++){var Rt=u.hypot(this.s[Ot],Ht),Ft=this.s[Ot]/Rt,Wt=Ht/Rt;this.s[Ot]=Rt,Ht=-Wt*i[Ot],i[Ot]=Ft*i[Ot];for(var Gt=0;Gt<this.m;Gt++)Rt=Ft*this.U[Gt][Ot]+Wt*this.U[Gt][$-1],this.U[Gt][$-1]=-Wt*this.U[Gt][Ot]+Ft*this.U[Gt][$-1],this.U[Gt][Ot]=Rt}}break;case 3:{var Bt=Math.max(Math.max(Math.max(Math.max(Math.abs(this.s[n-1]),Math.abs(this.s[n-2])),Math.abs(i[n-2])),Math.abs(this.s[$])),Math.abs(i[$])),dt=this.s[n-1]/Bt,L=this.s[n-2]/Bt,R=i[n-2]/Bt,V=this.s[$]/Bt,J=i[$]/Bt,K=((L+dt)*(L-dt)+R*R)/2,ft=dt*R*(dt*R),ht=0;(function(It,Tt){return It||Tt})(K!==0,ft!==0)&&(ht=Math.sqrt(K*K+ft),K<0&&(ht=-ht),ht=ft/(K+ht));for(var tt=(V+dt)*(V-dt)+ht,ct=V*J,it=$;it<n-1;it++){var Et=u.hypot(tt,ct),yt=tt/Et,Ct=ct/Et;it!==$&&(i[it-1]=Et),tt=yt*this.s[it]+Ct*i[it],i[it]=yt*i[it]-Ct*this.s[it],ct=Ct*this.s[it+1],this.s[it+1]=yt*this.s[it+1];for(var lt=0;lt<this.n;lt++)Et=yt*this.V[lt][it]+Ct*this.V[lt][it+1],this.V[lt][it+1]=-Ct*this.V[lt][it]+yt*this.V[lt][it+1],this.V[lt][it]=Et;if(Et=u.hypot(tt,ct),yt=tt/Et,Ct=ct/Et,this.s[it]=Et,tt=yt*i[it]+Ct*this.s[it+1],this.s[it+1]=-Ct*i[it]+yt*this.s[it+1],ct=Ct*i[it+1],i[it+1]=yt*i[it+1],it<this.m-1)for(var ot=0;ot<this.m;ot++)Et=yt*this.U[ot][it]+Ct*this.U[ot][it+1],this.U[ot][it+1]=-Ct*this.U[ot][it]+yt*this.U[ot][it+1],this.U[ot][it]=Et}i[n-2]=tt}break;case 4:{if(this.s[$]<=0){this.s[$]=this.s[$]<0?-this.s[$]:0;for(var at=0;at<=j;at++)this.V[at][$]=-this.V[at][$]}for(;$<j&&!(this.s[$]>=this.s[$+1]);){var wt=this.s[$];if(this.s[$]=this.s[$+1],this.s[$+1]=wt,$<this.n-1)for(var gt=0;gt<this.n;gt++)wt=this.V[gt][$+1],this.V[gt][$+1]=this.V[gt][$],this.V[gt][$]=wt;if($<this.m-1)for(var Dt=0;Dt<this.m;Dt++)wt=this.U[Dt][$+1],this.U[Dt][$+1]=this.U[Dt][$],this.U[Dt][$]=wt;$++}n--}break}}var St={U:this.U,V:this.V,S:this.s};return St},u.hypot=function(l,o){var i=void 0;return Math.abs(l)>Math.abs(o)?(i=o/l,i=Math.abs(l)*Math.sqrt(1+i*i)):o!=0?(i=l/o,i=Math.abs(o)*Math.sqrt(1+i*i)):i=0,i},I.exports=u},function(I,G,T){var u=function(){function i(e,a){for(var r=0;r<a.length;r++){var f=a[r];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(e,f.key,f)}}return function(e,a,r){return a&&i(e.prototype,a),r&&i(e,r),e}}();function l(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}var o=function(){function i(e,a){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,f=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,t=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;l(this,i),this.sequence1=e,this.sequence2=a,this.match_score=r,this.mismatch_penalty=f,this.gap_penalty=t,this.iMax=e.length+1,this.jMax=a.length+1,this.grid=new Array(this.iMax);for(var s=0;s<this.iMax;s++){this.grid[s]=new Array(this.jMax);for(var h=0;h<this.jMax;h++)this.grid[s][h]=0}this.tracebackGrid=new Array(this.iMax);for(var g=0;g<this.iMax;g++){this.tracebackGrid[g]=new Array(this.jMax);for(var d=0;d<this.jMax;d++)this.tracebackGrid[g][d]=[null,null,null]}this.alignments=[],this.score=-1,this.computeGrids()}return u(i,[{key:"getScore",value:function(){return this.score}},{key:"getAlignments",value:function(){return this.alignments}},{key:"computeGrids",value:function(){for(var e=1;e<this.jMax;e++)this.grid[0][e]=this.grid[0][e-1]+this.gap_penalty,this.tracebackGrid[0][e]=[!1,!1,!0];for(var a=1;a<this.iMax;a++)this.grid[a][0]=this.grid[a-1][0]+this.gap_penalty,this.tracebackGrid[a][0]=[!1,!0,!1];for(var r=1;r<this.iMax;r++)for(var f=1;f<this.jMax;f++){var t=void 0;this.sequence1[r-1]===this.sequence2[f-1]?t=this.grid[r-1][f-1]+this.match_score:t=this.grid[r-1][f-1]+this.mismatch_penalty;var s=this.grid[r-1][f]+this.gap_penalty,h=this.grid[r][f-1]+this.gap_penalty,g=[t,s,h],d=this.arrayAllMaxIndexes(g);this.grid[r][f]=g[d[0]],this.tracebackGrid[r][f]=[d.includes(0),d.includes(1),d.includes(2)]}this.score=this.grid[this.iMax-1][this.jMax-1]}},{key:"alignmentTraceback",value:function(){var e=[];for(e.push({pos:[this.sequence1.length,this.sequence2.length],seq1:"",seq2:""});e[0];){var a=e[0],r=this.tracebackGrid[a.pos[0]][a.pos[1]];r[0]&&e.push({pos:[a.pos[0]-1,a.pos[1]-1],seq1:this.sequence1[a.pos[0]-1]+a.seq1,seq2:this.sequence2[a.pos[1]-1]+a.seq2}),r[1]&&e.push({pos:[a.pos[0]-1,a.pos[1]],seq1:this.sequence1[a.pos[0]-1]+a.seq1,seq2:"-"+a.seq2}),r[2]&&e.push({pos:[a.pos[0],a.pos[1]-1],seq1:"-"+a.seq1,seq2:this.sequence2[a.pos[1]-1]+a.seq2}),a.pos[0]===0&&a.pos[1]===0&&this.alignments.push({sequence1:a.seq1,sequence2:a.seq2}),e.shift()}return this.alignments}},{key:"getAllIndexes",value:function(e,a){for(var r=[],f=-1;(f=e.indexOf(a,f+1))!==-1;)r.push(f);return r}},{key:"arrayAllMaxIndexes",value:function(e){return this.getAllIndexes(e,Math.max.apply(null,e))}}]),i}();I.exports=o},function(I,G,T){var u=function(){};u.FDLayout=T(18),u.FDLayoutConstants=T(4),u.FDLayoutEdge=T(19),u.FDLayoutNode=T(20),u.DimensionD=T(21),u.HashMap=T(22),u.HashSet=T(23),u.IGeometry=T(8),u.IMath=T(9),u.Integer=T(10),u.Point=T(12),u.PointD=T(5),u.RandomSeed=T(16),u.RectangleD=T(13),u.Transform=T(17),u.UniqueIDGeneretor=T(14),u.Quicksort=T(25),u.LinkedList=T(11),u.LGraphObject=T(2),u.LGraph=T(6),u.LEdge=T(1),u.LGraphManager=T(7),u.LNode=T(3),u.Layout=T(15),u.LayoutConstants=T(0),u.NeedlemanWunsch=T(27),u.Matrix=T(24),u.SVD=T(26),I.exports=u},function(I,G,T){function u(){this.listeners=[]}var l=u.prototype;l.addListener=function(o,i){this.listeners.push({event:o,callback:i})},l.removeListener=function(o,i){for(var e=this.listeners.length;e>=0;e--){var a=this.listeners[e];a.event===o&&a.callback===i&&this.listeners.splice(e,1)}},l.emit=function(o,i){for(var e=0;e<this.listeners.length;e++){var a=this.listeners[e];o===a.event&&a.callback(i)}},I.exports=u}])})}(fe)),fe.exports}var ui=ue.exports,_e;function fi(){return _e||(_e=1,function(D,C){(function(I,G){D.exports=G(gi())})(ui,function(I){return(()=>{var G={45:(o,i,e)=>{var a={};a.layoutBase=e(551),a.CoSEConstants=e(806),a.CoSEEdge=e(767),a.CoSEGraph=e(880),a.CoSEGraphManager=e(578),a.CoSELayout=e(765),a.CoSENode=e(991),a.ConstraintHandler=e(902),o.exports=a},806:(o,i,e)=>{var a=e(551).FDLayoutConstants;function r(){}for(var f in a)r[f]=a[f];r.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,r.DEFAULT_RADIAL_SEPARATION=a.DEFAULT_EDGE_LENGTH,r.DEFAULT_COMPONENT_SEPERATION=60,r.TILE=!0,r.TILING_PADDING_VERTICAL=10,r.TILING_PADDING_HORIZONTAL=10,r.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,r.ENFORCE_CONSTRAINTS=!0,r.APPLY_LAYOUT=!0,r.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,r.TREE_REDUCTION_ON_INCREMENTAL=!0,r.PURE_INCREMENTAL=r.DEFAULT_INCREMENTAL,o.exports=r},767:(o,i,e)=>{var a=e(551).FDLayoutEdge;function r(t,s,h){a.call(this,t,s,h)}r.prototype=Object.create(a.prototype);for(var f in a)r[f]=a[f];o.exports=r},880:(o,i,e)=>{var a=e(551).LGraph;function r(t,s,h){a.call(this,t,s,h)}r.prototype=Object.create(a.prototype);for(var f in a)r[f]=a[f];o.exports=r},578:(o,i,e)=>{var a=e(551).LGraphManager;function r(t){a.call(this,t)}r.prototype=Object.create(a.prototype);for(var f in a)r[f]=a[f];o.exports=r},765:(o,i,e)=>{var a=e(551).FDLayout,r=e(578),f=e(880),t=e(991),s=e(767),h=e(806),g=e(902),d=e(551).FDLayoutConstants,N=e(551).LayoutConstants,c=e(551).Point,y=e(551).PointD,A=e(551).DimensionD,w=e(551).Layout,P=e(551).Integer,k=e(551).IGeometry,Y=e(551).LGraph,H=e(551).Transform,Z=e(551).LinkedList;function M(){a.call(this),this.toBeTiled={},this.constraints={}}M.prototype=Object.create(a.prototype);for(var rt in a)M[rt]=a[rt];M.prototype.newGraphManager=function(){var n=new r(this);return this.graphManager=n,n},M.prototype.newGraph=function(n){return new f(null,this.graphManager,n)},M.prototype.newNode=function(n){return new t(this.graphManager,n)},M.prototype.newEdge=function(n){return new s(null,null,n)},M.prototype.initParameters=function(){a.prototype.initParameters.call(this,arguments),this.isSubLayout||(h.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=h.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=h.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=d.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=d.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=d.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=d.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},M.prototype.initSpringEmbedder=function(){a.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/d.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},M.prototype.layout=function(){var n=N.DEFAULT_CREATE_BENDS_AS_NEEDED;return n&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},M.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),this.incremental){if(h.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var n=new Set(this.getAllNodes()),E=this.nodesWithGravity.filter(function(m){return n.has(m)});this.graphManager.setAllNodesToApplyGravitation(E)}}else{var p=this.getFlatForest();if(p.length>0)this.positionNodesRadially(p);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var n=new Set(this.getAllNodes()),E=this.nodesWithGravity.filter(function(O){return n.has(O)});this.graphManager.setAllNodesToApplyGravitation(E),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(g.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),h.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},M.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%d.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var n=new Set(this.getAllNodes()),E=this.nodesWithGravity.filter(function(v){return n.has(v)});this.graphManager.setAllNodesToApplyGravitation(E),this.graphManager.updateBounds(),this.updateGrid(),h.PURE_INCREMENTAL?this.coolingFactor=d.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=d.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),h.PURE_INCREMENTAL?this.coolingFactor=d.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=d.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var p=!this.isTreeGrowing&&!this.isGrowthFinished,m=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(p,m),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},M.prototype.getPositionsData=function(){for(var n=this.graphManager.getAllNodes(),E={},p=0;p<n.length;p++){var m=n[p].rect,v=n[p].id;E[v]={id:v,x:m.getCenterX(),y:m.getCenterY(),w:m.width,h:m.height}}return E},M.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var n=!1;if(d.ANIMATE==="during")this.emit("layoutstarted");else{for(;!n;)n=this.tick();this.graphManager.updateBounds()}},M.prototype.moveNodes=function(){for(var n=this.getAllNodes(),E,p=0;p<n.length;p++)E=n[p],E.calculateDisplacement();Object.keys(this.constraints).length>0&&this.updateDisplacements();for(var p=0;p<n.length;p++)E=n[p],E.move()},M.prototype.initConstraintVariables=function(){var n=this;this.idToNodeMap=new Map,this.fixedNodeSet=new Set;for(var E=this.graphManager.getAllNodes(),p=0;p<E.length;p++){var m=E[p];this.idToNodeMap.set(m.id,m)}var v=function b(F){for(var j=F.getChild().getNodes(),et,mt=0,$=0;$<j.length;$++)et=j[$],et.getChild()==null?n.fixedNodeSet.has(et.id)&&(mt+=100):mt+=b(et);return mt};if(this.constraints.fixedNodeConstraint){this.constraints.fixedNodeConstraint.forEach(function(b){n.fixedNodeSet.add(b.nodeId)});for(var E=this.graphManager.getAllNodes(),m,p=0;p<E.length;p++)if(m=E[p],m.getChild()!=null){var O=v(m);O>0&&(m.fixedNodeWeight=O)}}if(this.constraints.relativePlacementConstraint){var _=new Map,x=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(b){n.fixedNodesOnHorizontal.add(b),n.fixedNodesOnVertical.add(b)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var U=this.constraints.alignmentConstraint.vertical,p=0;p<U.length;p++)this.dummyToNodeForVerticalAlignment.set("dummy"+p,[]),U[p].forEach(function(F){_.set(F,"dummy"+p),n.dummyToNodeForVerticalAlignment.get("dummy"+p).push(F),n.fixedNodeSet.has(F)&&n.fixedNodesOnHorizontal.add("dummy"+p)});if(this.constraints.alignmentConstraint.horizontal)for(var X=this.constraints.alignmentConstraint.horizontal,p=0;p<X.length;p++)this.dummyToNodeForHorizontalAlignment.set("dummy"+p,[]),X[p].forEach(function(F){x.set(F,"dummy"+p),n.dummyToNodeForHorizontalAlignment.get("dummy"+p).push(F),n.fixedNodeSet.has(F)&&n.fixedNodesOnVertical.add("dummy"+p)})}if(h.RELAX_MOVEMENT_ON_CONSTRAINTS)this.shuffle=function(b){var F,j,et;for(et=b.length-1;et>=2*b.length/3;et--)F=Math.floor(Math.random()*(et+1)),j=b[et],b[et]=b[F],b[F]=j;return b},this.nodesInRelativeHorizontal=[],this.nodesInRelativeVertical=[],this.nodeToRelativeConstraintMapHorizontal=new Map,this.nodeToRelativeConstraintMapVertical=new Map,this.nodeToTempPositionMapHorizontal=new Map,this.nodeToTempPositionMapVertical=new Map,this.constraints.relativePlacementConstraint.forEach(function(b){if(b.left){var F=_.has(b.left)?_.get(b.left):b.left,j=_.has(b.right)?_.get(b.right):b.right;n.nodesInRelativeHorizontal.includes(F)||(n.nodesInRelativeHorizontal.push(F),n.nodeToRelativeConstraintMapHorizontal.set(F,[]),n.dummyToNodeForVerticalAlignment.has(F)?n.nodeToTempPositionMapHorizontal.set(F,n.idToNodeMap.get(n.dummyToNodeForVerticalAlignment.get(F)[0]).getCenterX()):n.nodeToTempPositionMapHorizontal.set(F,n.idToNodeMap.get(F).getCenterX())),n.nodesInRelativeHorizontal.includes(j)||(n.nodesInRelativeHorizontal.push(j),n.nodeToRelativeConstraintMapHorizontal.set(j,[]),n.dummyToNodeForVerticalAlignment.has(j)?n.nodeToTempPositionMapHorizontal.set(j,n.idToNodeMap.get(n.dummyToNodeForVerticalAlignment.get(j)[0]).getCenterX()):n.nodeToTempPositionMapHorizontal.set(j,n.idToNodeMap.get(j).getCenterX())),n.nodeToRelativeConstraintMapHorizontal.get(F).push({right:j,gap:b.gap}),n.nodeToRelativeConstraintMapHorizontal.get(j).push({left:F,gap:b.gap})}else{var et=x.has(b.top)?x.get(b.top):b.top,mt=x.has(b.bottom)?x.get(b.bottom):b.bottom;n.nodesInRelativeVertical.includes(et)||(n.nodesInRelativeVertical.push(et),n.nodeToRelativeConstraintMapVertical.set(et,[]),n.dummyToNodeForHorizontalAlignment.has(et)?n.nodeToTempPositionMapVertical.set(et,n.idToNodeMap.get(n.dummyToNodeForHorizontalAlignment.get(et)[0]).getCenterY()):n.nodeToTempPositionMapVertical.set(et,n.idToNodeMap.get(et).getCenterY())),n.nodesInRelativeVertical.includes(mt)||(n.nodesInRelativeVertical.push(mt),n.nodeToRelativeConstraintMapVertical.set(mt,[]),n.dummyToNodeForHorizontalAlignment.has(mt)?n.nodeToTempPositionMapVertical.set(mt,n.idToNodeMap.get(n.dummyToNodeForHorizontalAlignment.get(mt)[0]).getCenterY()):n.nodeToTempPositionMapVertical.set(mt,n.idToNodeMap.get(mt).getCenterY())),n.nodeToRelativeConstraintMapVertical.get(et).push({bottom:mt,gap:b.gap}),n.nodeToRelativeConstraintMapVertical.get(mt).push({top:et,gap:b.gap})}});else{var B=new Map,z=new Map;this.constraints.relativePlacementConstraint.forEach(function(b){if(b.left){var F=_.has(b.left)?_.get(b.left):b.left,j=_.has(b.right)?_.get(b.right):b.right;B.has(F)?B.get(F).push(j):B.set(F,[j]),B.has(j)?B.get(j).push(F):B.set(j,[F])}else{var et=x.has(b.top)?x.get(b.top):b.top,mt=x.has(b.bottom)?x.get(b.bottom):b.bottom;z.has(et)?z.get(et).push(mt):z.set(et,[mt]),z.has(mt)?z.get(mt).push(et):z.set(mt,[et])}});var W=function(b,F){var j=[],et=[],mt=new Z,$=new Set,xt=0;return b.forEach(function(Q,nt){if(!$.has(nt)){j[xt]=[],et[xt]=!1;var vt=nt;for(mt.push(vt),$.add(vt),j[xt].push(vt);mt.length!=0;){vt=mt.shift(),F.has(vt)&&(et[xt]=!0);var st=b.get(vt);st.forEach(function(Lt){$.has(Lt)||(mt.push(Lt),$.add(Lt),j[xt].push(Lt))})}xt++}}),{components:j,isFixed:et}},q=W(B,n.fixedNodesOnHorizontal);this.componentsOnHorizontal=q.components,this.fixedComponentsOnHorizontal=q.isFixed;var S=W(z,n.fixedNodesOnVertical);this.componentsOnVertical=S.components,this.fixedComponentsOnVertical=S.isFixed}}},M.prototype.updateDisplacements=function(){var n=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function(S){var b=n.idToNodeMap.get(S.nodeId);b.displacementX=0,b.displacementY=0}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var E=this.constraints.alignmentConstraint.vertical,p=0;p<E.length;p++){for(var m=0,v=0;v<E[p].length;v++){if(this.fixedNodeSet.has(E[p][v])){m=0;break}m+=this.idToNodeMap.get(E[p][v]).displacementX}for(var O=m/E[p].length,v=0;v<E[p].length;v++)this.idToNodeMap.get(E[p][v]).displacementX=O}if(this.constraints.alignmentConstraint.horizontal)for(var _=this.constraints.alignmentConstraint.horizontal,p=0;p<_.length;p++){for(var x=0,v=0;v<_[p].length;v++){if(this.fixedNodeSet.has(_[p][v])){x=0;break}x+=this.idToNodeMap.get(_[p][v]).displacementY}for(var U=x/_[p].length,v=0;v<_[p].length;v++)this.idToNodeMap.get(_[p][v]).displacementY=U}}if(this.constraints.relativePlacementConstraint)if(h.RELAX_MOVEMENT_ON_CONSTRAINTS)this.totalIterations%10==0&&(this.shuffle(this.nodesInRelativeHorizontal),this.shuffle(this.nodesInRelativeVertical)),this.nodesInRelativeHorizontal.forEach(function(S){if(!n.fixedNodesOnHorizontal.has(S)){var b=0;n.dummyToNodeForVerticalAlignment.has(S)?b=n.idToNodeMap.get(n.dummyToNodeForVerticalAlignment.get(S)[0]).displacementX:b=n.idToNodeMap.get(S).displacementX,n.nodeToRelativeConstraintMapHorizontal.get(S).forEach(function(F){if(F.right){var j=n.nodeToTempPositionMapHorizontal.get(F.right)-n.nodeToTempPositionMapHorizontal.get(S)-b;j<F.gap&&(b-=F.gap-j)}else{var j=n.nodeToTempPositionMapHorizontal.get(S)-n.nodeToTempPositionMapHorizontal.get(F.left)+b;j<F.gap&&(b+=F.gap-j)}}),n.nodeToTempPositionMapHorizontal.set(S,n.nodeToTempPositionMapHorizontal.get(S)+b),n.dummyToNodeForVerticalAlignment.has(S)?n.dummyToNodeForVerticalAlignment.get(S).forEach(function(F){n.idToNodeMap.get(F).displacementX=b}):n.idToNodeMap.get(S).displacementX=b}}),this.nodesInRelativeVertical.forEach(function(S){if(!n.fixedNodesOnHorizontal.has(S)){var b=0;n.dummyToNodeForHorizontalAlignment.has(S)?b=n.idToNodeMap.get(n.dummyToNodeForHorizontalAlignment.get(S)[0]).displacementY:b=n.idToNodeMap.get(S).displacementY,n.nodeToRelativeConstraintMapVertical.get(S).forEach(function(F){if(F.bottom){var j=n.nodeToTempPositionMapVertical.get(F.bottom)-n.nodeToTempPositionMapVertical.get(S)-b;j<F.gap&&(b-=F.gap-j)}else{var j=n.nodeToTempPositionMapVertical.get(S)-n.nodeToTempPositionMapVertical.get(F.top)+b;j<F.gap&&(b+=F.gap-j)}}),n.nodeToTempPositionMapVertical.set(S,n.nodeToTempPositionMapVertical.get(S)+b),n.dummyToNodeForHorizontalAlignment.has(S)?n.dummyToNodeForHorizontalAlignment.get(S).forEach(function(F){n.idToNodeMap.get(F).displacementY=b}):n.idToNodeMap.get(S).displacementY=b}});else{for(var p=0;p<this.componentsOnHorizontal.length;p++){var X=this.componentsOnHorizontal[p];if(this.fixedComponentsOnHorizontal[p])for(var v=0;v<X.length;v++)this.dummyToNodeForVerticalAlignment.has(X[v])?this.dummyToNodeForVerticalAlignment.get(X[v]).forEach(function(F){n.idToNodeMap.get(F).displacementX=0}):this.idToNodeMap.get(X[v]).displacementX=0;else{for(var B=0,z=0,v=0;v<X.length;v++)if(this.dummyToNodeForVerticalAlignment.has(X[v])){var W=this.dummyToNodeForVerticalAlignment.get(X[v]);B+=W.length*this.idToNodeMap.get(W[0]).displacementX,z+=W.length}else B+=this.idToNodeMap.get(X[v]).displacementX,z++;for(var q=B/z,v=0;v<X.length;v++)this.dummyToNodeForVerticalAlignment.has(X[v])?this.dummyToNodeForVerticalAlignment.get(X[v]).forEach(function(F){n.idToNodeMap.get(F).displacementX=q}):this.idToNodeMap.get(X[v]).displacementX=q}}for(var p=0;p<this.componentsOnVertical.length;p++){var X=this.componentsOnVertical[p];if(this.fixedComponentsOnVertical[p])for(var v=0;v<X.length;v++)this.dummyToNodeForHorizontalAlignment.has(X[v])?this.dummyToNodeForHorizontalAlignment.get(X[v]).forEach(function(j){n.idToNodeMap.get(j).displacementY=0}):this.idToNodeMap.get(X[v]).displacementY=0;else{for(var B=0,z=0,v=0;v<X.length;v++)if(this.dummyToNodeForHorizontalAlignment.has(X[v])){var W=this.dummyToNodeForHorizontalAlignment.get(X[v]);B+=W.length*this.idToNodeMap.get(W[0]).displacementY,z+=W.length}else B+=this.idToNodeMap.get(X[v]).displacementY,z++;for(var q=B/z,v=0;v<X.length;v++)this.dummyToNodeForHorizontalAlignment.has(X[v])?this.dummyToNodeForHorizontalAlignment.get(X[v]).forEach(function(et){n.idToNodeMap.get(et).displacementY=q}):this.idToNodeMap.get(X[v]).displacementY=q}}}},M.prototype.calculateNodesToApplyGravitationTo=function(){var n=[],E,p=this.graphManager.getGraphs(),m=p.length,v;for(v=0;v<m;v++)E=p[v],E.updateConnected(),E.isConnected||(n=n.concat(E.getNodes()));return n},M.prototype.createBendpoints=function(){var n=[];n=n.concat(this.graphManager.getAllEdges());var E=new Set,p;for(p=0;p<n.length;p++){var m=n[p];if(!E.has(m)){var v=m.getSource(),O=m.getTarget();if(v==O)m.getBendpoints().push(new y),m.getBendpoints().push(new y),this.createDummyNodesForBendpoints(m),E.add(m);else{var _=[];if(_=_.concat(v.getEdgeListToNode(O)),_=_.concat(O.getEdgeListToNode(v)),!E.has(_[0])){if(_.length>1){var x;for(x=0;x<_.length;x++){var U=_[x];U.getBendpoints().push(new y),this.createDummyNodesForBendpoints(U)}}_.forEach(function(X){E.add(X)})}}}if(E.size==n.length)break}},M.prototype.positionNodesRadially=function(n){for(var E=new c(0,0),p=Math.ceil(Math.sqrt(n.length)),m=0,v=0,O=0,_=new y(0,0),x=0;x<n.length;x++){x%p==0&&(O=0,v=m,x!=0&&(v+=h.DEFAULT_COMPONENT_SEPERATION),m=0);var U=n[x],X=w.findCenterOfTree(U);E.x=O,E.y=v,_=M.radialLayout(U,X,E),_.y>m&&(m=Math.floor(_.y)),O=Math.floor(_.x+h.DEFAULT_COMPONENT_SEPERATION)}this.transform(new y(N.WORLD_CENTER_X-_.x/2,N.WORLD_CENTER_Y-_.y/2))},M.radialLayout=function(n,E,p){var m=Math.max(this.maxDiagonalInTree(n),h.DEFAULT_RADIAL_SEPARATION);M.branchRadialLayout(E,null,0,359,0,m);var v=Y.calculateBounds(n),O=new H;O.setDeviceOrgX(v.getMinX()),O.setDeviceOrgY(v.getMinY()),O.setWorldOrgX(p.x),O.setWorldOrgY(p.y);for(var _=0;_<n.length;_++){var x=n[_];x.transform(O)}var U=new y(v.getMaxX(),v.getMaxY());return O.inverseTransformPoint(U)},M.branchRadialLayout=function(n,E,p,m,v,O){var _=(m-p+1)/2;_<0&&(_+=180);var x=(_+p)%360,U=x*k.TWO_PI/360,X=v*Math.cos(U),B=v*Math.sin(U);n.setCenter(X,B);var z=[];z=z.concat(n.getEdges());var W=z.length;E!=null&&W--;for(var q=0,S=z.length,b,F=n.getEdgesBetween(E);F.length>1;){var j=F[0];F.splice(0,1);var et=z.indexOf(j);et>=0&&z.splice(et,1),S--,W--}E!=null?b=(z.indexOf(F[0])+1)%S:b=0;for(var mt=Math.abs(m-p)/W,$=b;q!=W;$=++$%S){var xt=z[$].getOtherEnd(n);if(xt!=E){var Q=(p+q*mt)%360,nt=(Q+mt)%360;M.branchRadialLayout(xt,n,Q,nt,v+O,O),q++}}},M.maxDiagonalInTree=function(n){for(var E=P.MIN_VALUE,p=0;p<n.length;p++){var m=n[p],v=m.getDiagonal();v>E&&(E=v)}return E},M.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},M.prototype.groupZeroDegreeMembers=function(){var n=this,E={};this.memberGroups={},this.idToDummyNode={};for(var p=[],m=this.graphManager.getAllNodes(),v=0;v<m.length;v++){var O=m[v],_=O.getParent();this.getNodeDegreeWithChildren(O)===0&&(_.id==null||!this.getToBeTiled(_))&&p.push(O)}for(var v=0;v<p.length;v++){var O=p[v],x=O.getParent().id;typeof E[x]>"u"&&(E[x]=[]),E[x]=E[x].concat(O)}Object.keys(E).forEach(function(U){if(E[U].length>1){var X="DummyCompound_"+U;n.memberGroups[X]=E[U];var B=E[U][0].getParent(),z=new t(n.graphManager);z.id=X,z.paddingLeft=B.paddingLeft||0,z.paddingRight=B.paddingRight||0,z.paddingBottom=B.paddingBottom||0,z.paddingTop=B.paddingTop||0,n.idToDummyNode[X]=z;var W=n.getGraphManager().add(n.newGraph(),z),q=B.getChild();q.add(z);for(var S=0;S<E[U].length;S++){var b=E[U][S];q.remove(b),W.add(b)}}})},M.prototype.clearCompounds=function(){var n={},E={};this.performDFSOnCompounds();for(var p=0;p<this.compoundOrder.length;p++)E[this.compoundOrder[p].id]=this.compoundOrder[p],n[this.compoundOrder[p].id]=[].concat(this.compoundOrder[p].getChild().getNodes()),this.graphManager.remove(this.compoundOrder[p].getChild()),this.compoundOrder[p].child=null;this.graphManager.resetAllNodes(),this.tileCompoundMembers(n,E)},M.prototype.clearZeroDegreeMembers=function(){var n=this,E=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach(function(p){var m=n.idToDummyNode[p];if(E[p]=n.tileNodes(n.memberGroups[p],m.paddingLeft+m.paddingRight),m.rect.width=E[p].width,m.rect.height=E[p].height,m.setCenter(E[p].centerX,E[p].centerY),m.labelMarginLeft=0,m.labelMarginTop=0,h.NODE_DIMENSIONS_INCLUDE_LABELS){var v=m.rect.width,O=m.rect.height;m.labelWidth&&(m.labelPosHorizontal=="left"?(m.rect.x-=m.labelWidth,m.setWidth(v+m.labelWidth),m.labelMarginLeft=m.labelWidth):m.labelPosHorizontal=="center"&&m.labelWidth>v?(m.rect.x-=(m.labelWidth-v)/2,m.setWidth(m.labelWidth),m.labelMarginLeft=(m.labelWidth-v)/2):m.labelPosHorizontal=="right"&&m.setWidth(v+m.labelWidth)),m.labelHeight&&(m.labelPosVertical=="top"?(m.rect.y-=m.labelHeight,m.setHeight(O+m.labelHeight),m.labelMarginTop=m.labelHeight):m.labelPosVertical=="center"&&m.labelHeight>O?(m.rect.y-=(m.labelHeight-O)/2,m.setHeight(m.labelHeight),m.labelMarginTop=(m.labelHeight-O)/2):m.labelPosVertical=="bottom"&&m.setHeight(O+m.labelHeight))}})},M.prototype.repopulateCompounds=function(){for(var n=this.compoundOrder.length-1;n>=0;n--){var E=this.compoundOrder[n],p=E.id,m=E.paddingLeft,v=E.paddingTop,O=E.labelMarginLeft,_=E.labelMarginTop;this.adjustLocations(this.tiledMemberPack[p],E.rect.x,E.rect.y,m,v,O,_)}},M.prototype.repopulateZeroDegreeMembers=function(){var n=this,E=this.tiledZeroDegreePack;Object.keys(E).forEach(function(p){var m=n.idToDummyNode[p],v=m.paddingLeft,O=m.paddingTop,_=m.labelMarginLeft,x=m.labelMarginTop;n.adjustLocations(E[p],m.rect.x,m.rect.y,v,O,_,x)})},M.prototype.getToBeTiled=function(n){var E=n.id;if(this.toBeTiled[E]!=null)return this.toBeTiled[E];var p=n.getChild();if(p==null)return this.toBeTiled[E]=!1,!1;for(var m=p.getNodes(),v=0;v<m.length;v++){var O=m[v];if(this.getNodeDegree(O)>0)return this.toBeTiled[E]=!1,!1;if(O.getChild()==null){this.toBeTiled[O.id]=!1;continue}if(!this.getToBeTiled(O))return this.toBeTiled[E]=!1,!1}return this.toBeTiled[E]=!0,!0},M.prototype.getNodeDegree=function(n){n.id;for(var E=n.getEdges(),p=0,m=0;m<E.length;m++){var v=E[m];v.getSource().id!==v.getTarget().id&&(p=p+1)}return p},M.prototype.getNodeDegreeWithChildren=function(n){var E=this.getNodeDegree(n);if(n.getChild()==null)return E;for(var p=n.getChild().getNodes(),m=0;m<p.length;m++){var v=p[m];E+=this.getNodeDegreeWithChildren(v)}return E},M.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},M.prototype.fillCompexOrderByDFS=function(n){for(var E=0;E<n.length;E++){var p=n[E];p.getChild()!=null&&this.fillCompexOrderByDFS(p.getChild().getNodes()),this.getToBeTiled(p)&&this.compoundOrder.push(p)}},M.prototype.adjustLocations=function(n,E,p,m,v,O,_){E+=m+O,p+=v+_;for(var x=E,U=0;U<n.rows.length;U++){var X=n.rows[U];E=x;for(var B=0,z=0;z<X.length;z++){var W=X[z];W.rect.x=E,W.rect.y=p,E+=W.rect.width+n.horizontalPadding,W.rect.height>B&&(B=W.rect.height)}p+=B+n.verticalPadding}},M.prototype.tileCompoundMembers=function(n,E){var p=this;this.tiledMemberPack=[],Object.keys(n).forEach(function(m){var v=E[m];if(p.tiledMemberPack[m]=p.tileNodes(n[m],v.paddingLeft+v.paddingRight),v.rect.width=p.tiledMemberPack[m].width,v.rect.height=p.tiledMemberPack[m].height,v.setCenter(p.tiledMemberPack[m].centerX,p.tiledMemberPack[m].centerY),v.labelMarginLeft=0,v.labelMarginTop=0,h.NODE_DIMENSIONS_INCLUDE_LABELS){var O=v.rect.width,_=v.rect.height;v.labelWidth&&(v.labelPosHorizontal=="left"?(v.rect.x-=v.labelWidth,v.setWidth(O+v.labelWidth),v.labelMarginLeft=v.labelWidth):v.labelPosHorizontal=="center"&&v.labelWidth>O?(v.rect.x-=(v.labelWidth-O)/2,v.setWidth(v.labelWidth),v.labelMarginLeft=(v.labelWidth-O)/2):v.labelPosHorizontal=="right"&&v.setWidth(O+v.labelWidth)),v.labelHeight&&(v.labelPosVertical=="top"?(v.rect.y-=v.labelHeight,v.setHeight(_+v.labelHeight),v.labelMarginTop=v.labelHeight):v.labelPosVertical=="center"&&v.labelHeight>_?(v.rect.y-=(v.labelHeight-_)/2,v.setHeight(v.labelHeight),v.labelMarginTop=(v.labelHeight-_)/2):v.labelPosVertical=="bottom"&&v.setHeight(_+v.labelHeight))}})},M.prototype.tileNodes=function(n,E){var p=this.tileNodesByFavoringDim(n,E,!0),m=this.tileNodesByFavoringDim(n,E,!1),v=this.getOrgRatio(p),O=this.getOrgRatio(m),_;return O<v?_=m:_=p,_},M.prototype.getOrgRatio=function(n){var E=n.width,p=n.height,m=E/p;return m<1&&(m=1/m),m},M.prototype.calcIdealRowWidth=function(n,E){var p=h.TILING_PADDING_VERTICAL,m=h.TILING_PADDING_HORIZONTAL,v=n.length,O=0,_=0,x=0;n.forEach(function(S){O+=S.getWidth(),_+=S.getHeight(),S.getWidth()>x&&(x=S.getWidth())});var U=O/v,X=_/v,B=Math.pow(p-m,2)+4*(U+m)*(X+p)*v,z=(m-p+Math.sqrt(B))/(2*(U+m)),W;E?(W=Math.ceil(z),W==z&&W++):W=Math.floor(z);var q=W*(U+m)-m;return x>q&&(q=x),q+=m*2,q},M.prototype.tileNodesByFavoringDim=function(n,E,p){var m=h.TILING_PADDING_VERTICAL,v=h.TILING_PADDING_HORIZONTAL,O=h.TILING_COMPARE_BY,_={rows:[],rowWidth:[],rowHeight:[],width:0,height:E,verticalPadding:m,horizontalPadding:v,centerX:0,centerY:0};O&&(_.idealRowWidth=this.calcIdealRowWidth(n,p));var x=function(S){return S.rect.width*S.rect.height},U=function(S,b){return x(b)-x(S)};n.sort(function(S,b){var F=U;return _.idealRowWidth?(F=O,F(S.id,b.id)):F(S,b)});for(var X=0,B=0,z=0;z<n.length;z++){var W=n[z];X+=W.getCenterX(),B+=W.getCenterY()}_.centerX=X/n.length,_.centerY=B/n.length;for(var z=0;z<n.length;z++){var W=n[z];if(_.rows.length==0)this.insertNodeToRow(_,W,0,E);else if(this.canAddHorizontal(_,W.rect.width,W.rect.height)){var q=_.rows.length-1;_.idealRowWidth||(q=this.getShortestRowIndex(_)),this.insertNodeToRow(_,W,q,E)}else this.insertNodeToRow(_,W,_.rows.length,E);this.shiftToLastRow(_)}return _},M.prototype.insertNodeToRow=function(n,E,p,m){var v=m;if(p==n.rows.length){var O=[];n.rows.push(O),n.rowWidth.push(v),n.rowHeight.push(0)}var _=n.rowWidth[p]+E.rect.width;n.rows[p].length>0&&(_+=n.horizontalPadding),n.rowWidth[p]=_,n.width<_&&(n.width=_);var x=E.rect.height;p>0&&(x+=n.verticalPadding);var U=0;x>n.rowHeight[p]&&(U=n.rowHeight[p],n.rowHeight[p]=x,U=n.rowHeight[p]-U),n.height+=U,n.rows[p].push(E)},M.prototype.getShortestRowIndex=function(n){for(var E=-1,p=Number.MAX_VALUE,m=0;m<n.rows.length;m++)n.rowWidth[m]<p&&(E=m,p=n.rowWidth[m]);return E},M.prototype.getLongestRowIndex=function(n){for(var E=-1,p=Number.MIN_VALUE,m=0;m<n.rows.length;m++)n.rowWidth[m]>p&&(E=m,p=n.rowWidth[m]);return E},M.prototype.canAddHorizontal=function(n,E,p){if(n.idealRowWidth){var m=n.rows.length-1,v=n.rowWidth[m];return v+E+n.horizontalPadding<=n.idealRowWidth}var O=this.getShortestRowIndex(n);if(O<0)return!0;var _=n.rowWidth[O];if(_+n.horizontalPadding+E<=n.width)return!0;var x=0;n.rowHeight[O]<p&&O>0&&(x=p+n.verticalPadding-n.rowHeight[O]);var U;n.width-_>=E+n.horizontalPadding?U=(n.height+x)/(_+E+n.horizontalPadding):U=(n.height+x)/n.width,x=p+n.verticalPadding;var X;return n.width<E?X=(n.height+x)/E:X=(n.height+x)/n.width,X<1&&(X=1/X),U<1&&(U=1/U),U<X},M.prototype.shiftToLastRow=function(n){var E=this.getLongestRowIndex(n),p=n.rowWidth.length-1,m=n.rows[E],v=m[m.length-1],O=v.width+n.horizontalPadding;if(n.width-n.rowWidth[p]>O&&E!=p){m.splice(-1,1),n.rows[p].push(v),n.rowWidth[E]=n.rowWidth[E]-O,n.rowWidth[p]=n.rowWidth[p]+O,n.width=n.rowWidth[instance.getLongestRowIndex(n)];for(var _=Number.MIN_VALUE,x=0;x<m.length;x++)m[x].height>_&&(_=m[x].height);E>0&&(_+=n.verticalPadding);var U=n.rowHeight[E]+n.rowHeight[p];n.rowHeight[E]=_,n.rowHeight[p]<v.height+n.verticalPadding&&(n.rowHeight[p]=v.height+n.verticalPadding);var X=n.rowHeight[E]+n.rowHeight[p];n.height+=X-U,this.shiftToLastRow(n)}},M.prototype.tilingPreLayout=function(){h.TILE&&(this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers())},M.prototype.tilingPostLayout=function(){h.TILE&&(this.repopulateZeroDegreeMembers(),this.repopulateCompounds())},M.prototype.reduceTrees=function(){for(var n=[],E=!0,p;E;){var m=this.graphManager.getAllNodes(),v=[];E=!1;for(var O=0;O<m.length;O++)if(p=m[O],p.getEdges().length==1&&!p.getEdges()[0].isInterGraph&&p.getChild()==null){if(h.PURE_INCREMENTAL){var _=p.getEdges()[0].getOtherEnd(p),x=new A(p.getCenterX()-_.getCenterX(),p.getCenterY()-_.getCenterY());v.push([p,p.getEdges()[0],p.getOwner(),x])}else v.push([p,p.getEdges()[0],p.getOwner()]);E=!0}if(E==!0){for(var U=[],X=0;X<v.length;X++)v[X][0].getEdges().length==1&&(U.push(v[X]),v[X][0].getOwner().remove(v[X][0]));n.push(U),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=n},M.prototype.growTree=function(n){for(var E=n.length,p=n[E-1],m,v=0;v<p.length;v++)m=p[v],this.findPlaceforPrunedNode(m),m[2].add(m[0]),m[2].add(m[1],m[1].source,m[1].target);n.splice(n.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},M.prototype.findPlaceforPrunedNode=function(n){var E,p,m=n[0];if(m==n[1].source?p=n[1].target:p=n[1].source,h.PURE_INCREMENTAL)m.setCenter(p.getCenterX()+n[3].getWidth(),p.getCenterY()+n[3].getHeight());else{var v=p.startX,O=p.finishX,_=p.startY,x=p.finishY,U=0,X=0,B=0,z=0,W=[U,B,X,z];if(_>0)for(var q=v;q<=O;q++)W[0]+=this.grid[q][_-1].length+this.grid[q][_].length-1;if(O<this.grid.length-1)for(var q=_;q<=x;q++)W[1]+=this.grid[O+1][q].length+this.grid[O][q].length-1;if(x<this.grid[0].length-1)for(var q=v;q<=O;q++)W[2]+=this.grid[q][x+1].length+this.grid[q][x].length-1;if(v>0)for(var q=_;q<=x;q++)W[3]+=this.grid[v-1][q].length+this.grid[v][q].length-1;for(var S=P.MAX_VALUE,b,F,j=0;j<W.length;j++)W[j]<S?(S=W[j],b=1,F=j):W[j]==S&&b++;if(b==3&&S==0)W[0]==0&&W[1]==0&&W[2]==0?E=1:W[0]==0&&W[1]==0&&W[3]==0?E=0:W[0]==0&&W[2]==0&&W[3]==0?E=3:W[1]==0&&W[2]==0&&W[3]==0&&(E=2);else if(b==2&&S==0){var et=Math.floor(Math.random()*2);W[0]==0&&W[1]==0?et==0?E=0:E=1:W[0]==0&&W[2]==0?et==0?E=0:E=2:W[0]==0&&W[3]==0?et==0?E=0:E=3:W[1]==0&&W[2]==0?et==0?E=1:E=2:W[1]==0&&W[3]==0?et==0?E=1:E=3:et==0?E=2:E=3}else if(b==4&&S==0){var et=Math.floor(Math.random()*4);E=et}else E=F;E==0?m.setCenter(p.getCenterX(),p.getCenterY()-p.getHeight()/2-d.DEFAULT_EDGE_LENGTH-m.getHeight()/2):E==1?m.setCenter(p.getCenterX()+p.getWidth()/2+d.DEFAULT_EDGE_LENGTH+m.getWidth()/2,p.getCenterY()):E==2?m.setCenter(p.getCenterX(),p.getCenterY()+p.getHeight()/2+d.DEFAULT_EDGE_LENGTH+m.getHeight()/2):m.setCenter(p.getCenterX()-p.getWidth()/2-d.DEFAULT_EDGE_LENGTH-m.getWidth()/2,p.getCenterY())}},o.exports=M},991:(o,i,e)=>{var a=e(551).FDLayoutNode,r=e(551).IMath;function f(s,h,g,d){a.call(this,s,h,g,d)}f.prototype=Object.create(a.prototype);for(var t in a)f[t]=a[t];f.prototype.calculateDisplacement=function(){var s=this.graphManager.getLayout();this.getChild()!=null&&this.fixedNodeWeight?(this.displacementX+=s.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=s.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=s.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=s.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>s.coolingFactor*s.maxNodeDisplacement&&(this.displacementX=s.coolingFactor*s.maxNodeDisplacement*r.sign(this.displacementX)),Math.abs(this.displacementY)>s.coolingFactor*s.maxNodeDisplacement&&(this.displacementY=s.coolingFactor*s.maxNodeDisplacement*r.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},f.prototype.propogateDisplacementToChildren=function(s,h){for(var g=this.getChild().getNodes(),d,N=0;N<g.length;N++)d=g[N],d.getChild()==null?(d.displacementX+=s,d.displacementY+=h):d.propogateDisplacementToChildren(s,h)},f.prototype.move=function(){var s=this.graphManager.getLayout();(this.child==null||this.child.getNodes().length==0)&&(this.moveBy(this.displacementX,this.displacementY),s.totalDisplacement+=Math.abs(this.displacementX)+Math.abs(this.displacementY)),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0},f.prototype.setPred1=function(s){this.pred1=s},f.prototype.getPred1=function(){return pred1},f.prototype.getPred2=function(){return pred2},f.prototype.setNext=function(s){this.next=s},f.prototype.getNext=function(){return next},f.prototype.setProcessed=function(s){this.processed=s},f.prototype.isProcessed=function(){return processed},o.exports=f},902:(o,i,e)=>{function a(g){if(Array.isArray(g)){for(var d=0,N=Array(g.length);d<g.length;d++)N[d]=g[d];return N}else return Array.from(g)}var r=e(806),f=e(551).LinkedList,t=e(551).Matrix,s=e(551).SVD;function h(){}h.handleConstraints=function(g){var d={};d.fixedNodeConstraint=g.constraints.fixedNodeConstraint,d.alignmentConstraint=g.constraints.alignmentConstraint,d.relativePlacementConstraint=g.constraints.relativePlacementConstraint;for(var N=new Map,c=new Map,y=[],A=[],w=g.getAllNodes(),P=0,k=0;k<w.length;k++){var Y=w[k];Y.getChild()==null&&(c.set(Y.id,P++),y.push(Y.getCenterX()),A.push(Y.getCenterY()),N.set(Y.id,Y))}d.relativePlacementConstraint&&d.relativePlacementConstraint.forEach(function(L){!L.gap&&L.gap!=0&&(L.left?L.gap=r.DEFAULT_EDGE_LENGTH+N.get(L.left).getWidth()/2+N.get(L.right).getWidth()/2:L.gap=r.DEFAULT_EDGE_LENGTH+N.get(L.top).getHeight()/2+N.get(L.bottom).getHeight()/2)});var H=function(L,R){return{x:L.x-R.x,y:L.y-R.y}},Z=function(L){var R=0,V=0;return L.forEach(function(J){R+=y[c.get(J)],V+=A[c.get(J)]}),{x:R/L.size,y:V/L.size}},M=function(L,R,V,J,K){function ft(lt,ot){var at=new Set(lt),wt=!0,gt=!1,Dt=void 0;try{for(var St=ot[Symbol.iterator](),It;!(wt=(It=St.next()).done);wt=!0){var Tt=It.value;at.add(Tt)}}catch(Xt){gt=!0,Dt=Xt}finally{try{!wt&&St.return&&St.return()}finally{if(gt)throw Dt}}return at}var ht=new Map;L.forEach(function(lt,ot){ht.set(ot,0)}),L.forEach(function(lt,ot){lt.forEach(function(at){ht.set(at.id,ht.get(at.id)+1)})});var tt=new Map,ct=new Map,it=new f;ht.forEach(function(lt,ot){lt==0?(it.push(ot),V||(R=="horizontal"?tt.set(ot,c.has(ot)?y[c.get(ot)]:J.get(ot)):tt.set(ot,c.has(ot)?A[c.get(ot)]:J.get(ot)))):tt.set(ot,Number.NEGATIVE_INFINITY),V&&ct.set(ot,new Set([ot]))}),V&&K.forEach(function(lt){var ot=[];if(lt.forEach(function(gt){V.has(gt)&&ot.push(gt)}),ot.length>0){var at=0;ot.forEach(function(gt){R=="horizontal"?(tt.set(gt,c.has(gt)?y[c.get(gt)]:J.get(gt)),at+=tt.get(gt)):(tt.set(gt,c.has(gt)?A[c.get(gt)]:J.get(gt)),at+=tt.get(gt))}),at=at/ot.length,lt.forEach(function(gt){V.has(gt)||tt.set(gt,at)})}else{var wt=0;lt.forEach(function(gt){R=="horizontal"?wt+=c.has(gt)?y[c.get(gt)]:J.get(gt):wt+=c.has(gt)?A[c.get(gt)]:J.get(gt)}),wt=wt/lt.length,lt.forEach(function(gt){tt.set(gt,wt)})}});for(var Et=function(){var lt=it.shift(),ot=L.get(lt);ot.forEach(function(at){if(tt.get(at.id)<tt.get(lt)+at.gap)if(V&&V.has(at.id)){var wt=void 0;if(R=="horizontal"?wt=c.has(at.id)?y[c.get(at.id)]:J.get(at.id):wt=c.has(at.id)?A[c.get(at.id)]:J.get(at.id),tt.set(at.id,wt),wt<tt.get(lt)+at.gap){var gt=tt.get(lt)+at.gap-wt;ct.get(lt).forEach(function(Dt){tt.set(Dt,tt.get(Dt)-gt)})}}else tt.set(at.id,tt.get(lt)+at.gap);ht.set(at.id,ht.get(at.id)-1),ht.get(at.id)==0&&it.push(at.id),V&&ct.set(at.id,ft(ct.get(lt),ct.get(at.id)))})};it.length!=0;)Et();if(V){var yt=new Set;L.forEach(function(lt,ot){lt.length==0&&yt.add(ot)});var Ct=[];ct.forEach(function(lt,ot){if(yt.has(ot)){var at=!1,wt=!0,gt=!1,Dt=void 0;try{for(var St=lt[Symbol.iterator](),It;!(wt=(It=St.next()).done);wt=!0){var Tt=It.value;V.has(Tt)&&(at=!0)}}catch(bt){gt=!0,Dt=bt}finally{try{!wt&&St.return&&St.return()}finally{if(gt)throw Dt}}if(!at){var Xt=!1,Ut=void 0;Ct.forEach(function(bt,Pt){bt.has([].concat(a(lt))[0])&&(Xt=!0,Ut=Pt)}),Xt?lt.forEach(function(bt){Ct[Ut].add(bt)}):Ct.push(new Set(lt))}}}),Ct.forEach(function(lt,ot){var at=Number.POSITIVE_INFINITY,wt=Number.POSITIVE_INFINITY,gt=Number.NEGATIVE_INFINITY,Dt=Number.NEGATIVE_INFINITY,St=!0,It=!1,Tt=void 0;try{for(var Xt=lt[Symbol.iterator](),Ut;!(St=(Ut=Xt.next()).done);St=!0){var bt=Ut.value,Pt=void 0;R=="horizontal"?Pt=c.has(bt)?y[c.get(bt)]:J.get(bt):Pt=c.has(bt)?A[c.get(bt)]:J.get(bt);var qt=tt.get(bt);Pt<at&&(at=Pt),Pt>gt&&(gt=Pt),qt<wt&&(wt=qt),qt>Dt&&(Dt=qt)}}catch(jt){It=!0,Tt=jt}finally{try{!St&&Xt.return&&Xt.return()}finally{if(It)throw Tt}}var ae=(at+gt)/2-(wt+Dt)/2,ie=!0,Kt=!1,Zt=void 0;try{for(var $t=lt[Symbol.iterator](),Jt;!(ie=(Jt=$t.next()).done);ie=!0){var re=Jt.value;tt.set(re,tt.get(re)+ae)}}catch(jt){Kt=!0,Zt=jt}finally{try{!ie&&$t.return&&$t.return()}finally{if(Kt)throw Zt}}})}return tt},rt=function(L){var R=0,V=0,J=0,K=0;if(L.forEach(function(ct){ct.left?y[c.get(ct.left)]-y[c.get(ct.right)]>=0?R++:V++:A[c.get(ct.top)]-A[c.get(ct.bottom)]>=0?J++:K++}),R>V&&J>K)for(var ft=0;ft<c.size;ft++)y[ft]=-1*y[ft],A[ft]=-1*A[ft];else if(R>V)for(var ht=0;ht<c.size;ht++)y[ht]=-1*y[ht];else if(J>K)for(var tt=0;tt<c.size;tt++)A[tt]=-1*A[tt]},n=function(L){var R=[],V=new f,J=new Set,K=0;return L.forEach(function(ft,ht){if(!J.has(ht)){R[K]=[];var tt=ht;for(V.push(tt),J.add(tt),R[K].push(tt);V.length!=0;){tt=V.shift();var ct=L.get(tt);ct.forEach(function(it){J.has(it.id)||(V.push(it.id),J.add(it.id),R[K].push(it.id))})}K++}}),R},E=function(L){var R=new Map;return L.forEach(function(V,J){R.set(J,[])}),L.forEach(function(V,J){V.forEach(function(K){R.get(J).push(K),R.get(K.id).push({id:J,gap:K.gap,direction:K.direction})})}),R},p=function(L){var R=new Map;return L.forEach(function(V,J){R.set(J,[])}),L.forEach(function(V,J){V.forEach(function(K){R.get(K.id).push({id:J,gap:K.gap,direction:K.direction})})}),R},m=[],v=[],O=!1,_=!1,x=new Set,U=new Map,X=new Map,B=[];if(d.fixedNodeConstraint&&d.fixedNodeConstraint.forEach(function(L){x.add(L.nodeId)}),d.relativePlacementConstraint&&(d.relativePlacementConstraint.forEach(function(L){L.left?(U.has(L.left)?U.get(L.left).push({id:L.right,gap:L.gap,direction:"horizontal"}):U.set(L.left,[{id:L.right,gap:L.gap,direction:"horizontal"}]),U.has(L.right)||U.set(L.right,[])):(U.has(L.top)?U.get(L.top).push({id:L.bottom,gap:L.gap,direction:"vertical"}):U.set(L.top,[{id:L.bottom,gap:L.gap,direction:"vertical"}]),U.has(L.bottom)||U.set(L.bottom,[]))}),X=E(U),B=n(X)),r.TRANSFORM_ON_CONSTRAINT_HANDLING){if(d.fixedNodeConstraint&&d.fixedNodeConstraint.length>1)d.fixedNodeConstraint.forEach(function(L,R){m[R]=[L.position.x,L.position.y],v[R]=[y[c.get(L.nodeId)],A[c.get(L.nodeId)]]}),O=!0;else if(d.alignmentConstraint)(function(){var L=0;if(d.alignmentConstraint.vertical){for(var R=d.alignmentConstraint.vertical,V=function(tt){var ct=new Set;R[tt].forEach(function(yt){ct.add(yt)});var it=new Set([].concat(a(ct)).filter(function(yt){return x.has(yt)})),Et=void 0;it.size>0?Et=y[c.get(it.values().next().value)]:Et=Z(ct).x,R[tt].forEach(function(yt){m[L]=[Et,A[c.get(yt)]],v[L]=[y[c.get(yt)],A[c.get(yt)]],L++})},J=0;J<R.length;J++)V(J);O=!0}if(d.alignmentConstraint.horizontal){for(var K=d.alignmentConstraint.horizontal,ft=function(tt){var ct=new Set;K[tt].forEach(function(yt){ct.add(yt)});var it=new Set([].concat(a(ct)).filter(function(yt){return x.has(yt)})),Et=void 0;it.size>0?Et=y[c.get(it.values().next().value)]:Et=Z(ct).y,K[tt].forEach(function(yt){m[L]=[y[c.get(yt)],Et],v[L]=[y[c.get(yt)],A[c.get(yt)]],L++})},ht=0;ht<K.length;ht++)ft(ht);O=!0}d.relativePlacementConstraint&&(_=!0)})();else if(d.relativePlacementConstraint){for(var z=0,W=0,q=0;q<B.length;q++)B[q].length>z&&(z=B[q].length,W=q);if(z<X.size/2)rt(d.relativePlacementConstraint),O=!1,_=!1;else{var S=new Map,b=new Map,F=[];B[W].forEach(function(L){U.get(L).forEach(function(R){R.direction=="horizontal"?(S.has(L)?S.get(L).push(R):S.set(L,[R]),S.has(R.id)||S.set(R.id,[]),F.push({left:L,right:R.id})):(b.has(L)?b.get(L).push(R):b.set(L,[R]),b.has(R.id)||b.set(R.id,[]),F.push({top:L,bottom:R.id}))})}),rt(F),_=!1;var j=M(S,"horizontal"),et=M(b,"vertical");B[W].forEach(function(L,R){v[R]=[y[c.get(L)],A[c.get(L)]],m[R]=[],j.has(L)?m[R][0]=j.get(L):m[R][0]=y[c.get(L)],et.has(L)?m[R][1]=et.get(L):m[R][1]=A[c.get(L)]}),O=!0}}if(O){for(var mt=void 0,$=t.transpose(m),xt=t.transpose(v),Q=0;Q<$.length;Q++)$[Q]=t.multGamma($[Q]),xt[Q]=t.multGamma(xt[Q]);var nt=t.multMat($,t.transpose(xt)),vt=s.svd(nt);mt=t.multMat(vt.V,t.transpose(vt.U));for(var st=0;st<c.size;st++){var Lt=[y[st],A[st]],_t=[mt[0][0],mt[1][0]],Nt=[mt[0][1],mt[1][1]];y[st]=t.dotProduct(Lt,_t),A[st]=t.dotProduct(Lt,Nt)}_&&rt(d.relativePlacementConstraint)}}if(r.ENFORCE_CONSTRAINTS){if(d.fixedNodeConstraint&&d.fixedNodeConstraint.length>0){var At={x:0,y:0};d.fixedNodeConstraint.forEach(function(L,R){var V={x:y[c.get(L.nodeId)],y:A[c.get(L.nodeId)]},J=L.position,K=H(J,V);At.x+=K.x,At.y+=K.y}),At.x/=d.fixedNodeConstraint.length,At.y/=d.fixedNodeConstraint.length,y.forEach(function(L,R){y[R]+=At.x}),A.forEach(function(L,R){A[R]+=At.y}),d.fixedNodeConstraint.forEach(function(L){y[c.get(L.nodeId)]=L.position.x,A[c.get(L.nodeId)]=L.position.y})}if(d.alignmentConstraint){if(d.alignmentConstraint.vertical)for(var Ht=d.alignmentConstraint.vertical,Ot=function(L){var R=new Set;Ht[L].forEach(function(K){R.add(K)});var V=new Set([].concat(a(R)).filter(function(K){return x.has(K)})),J=void 0;V.size>0?J=y[c.get(V.values().next().value)]:J=Z(R).x,R.forEach(function(K){x.has(K)||(y[c.get(K)]=J)})},Rt=0;Rt<Ht.length;Rt++)Ot(Rt);if(d.alignmentConstraint.horizontal)for(var Ft=d.alignmentConstraint.horizontal,Wt=function(L){var R=new Set;Ft[L].forEach(function(K){R.add(K)});var V=new Set([].concat(a(R)).filter(function(K){return x.has(K)})),J=void 0;V.size>0?J=A[c.get(V.values().next().value)]:J=Z(R).y,R.forEach(function(K){x.has(K)||(A[c.get(K)]=J)})},Gt=0;Gt<Ft.length;Gt++)Wt(Gt)}d.relativePlacementConstraint&&function(){var L=new Map,R=new Map,V=new Map,J=new Map,K=new Map,ft=new Map,ht=new Set,tt=new Set;if(x.forEach(function(ut){ht.add(ut),tt.add(ut)}),d.alignmentConstraint){if(d.alignmentConstraint.vertical)for(var ct=d.alignmentConstraint.vertical,it=function(ut){V.set("dummy"+ut,[]),ct[ut].forEach(function(Mt){L.set(Mt,"dummy"+ut),V.get("dummy"+ut).push(Mt),x.has(Mt)&&ht.add("dummy"+ut)}),K.set("dummy"+ut,y[c.get(ct[ut][0])])},Et=0;Et<ct.length;Et++)it(Et);if(d.alignmentConstraint.horizontal)for(var yt=d.alignmentConstraint.horizontal,Ct=function(ut){J.set("dummy"+ut,[]),yt[ut].forEach(function(Mt){R.set(Mt,"dummy"+ut),J.get("dummy"+ut).push(Mt),x.has(Mt)&&tt.add("dummy"+ut)}),ft.set("dummy"+ut,A[c.get(yt[ut][0])])},lt=0;lt<yt.length;lt++)Ct(lt)}var ot=new Map,at=new Map,wt=function(ut){U.get(ut).forEach(function(Mt){var Yt=void 0,zt=void 0;Mt.direction=="horizontal"?(Yt=L.get(ut)?L.get(ut):ut,L.get(Mt.id)?zt={id:L.get(Mt.id),gap:Mt.gap,direction:Mt.direction}:zt=Mt,ot.has(Yt)?ot.get(Yt).push(zt):ot.set(Yt,[zt]),ot.has(zt.id)||ot.set(zt.id,[])):(Yt=R.get(ut)?R.get(ut):ut,R.get(Mt.id)?zt={id:R.get(Mt.id),gap:Mt.gap,direction:Mt.direction}:zt=Mt,at.has(Yt)?at.get(Yt).push(zt):at.set(Yt,[zt]),at.has(zt.id)||at.set(zt.id,[]))})},gt=!0,Dt=!1,St=void 0;try{for(var It=U.keys()[Symbol.iterator](),Tt;!(gt=(Tt=It.next()).done);gt=!0){var Xt=Tt.value;wt(Xt)}}catch(ut){Dt=!0,St=ut}finally{try{!gt&&It.return&&It.return()}finally{if(Dt)throw St}}var Ut=E(ot),bt=E(at),Pt=n(Ut),qt=n(bt),ae=p(ot),ie=p(at),Kt=[],Zt=[];Pt.forEach(function(ut,Mt){Kt[Mt]=[],ut.forEach(function(Yt){ae.get(Yt).length==0&&Kt[Mt].push(Yt)})}),qt.forEach(function(ut,Mt){Zt[Mt]=[],ut.forEach(function(Yt){ie.get(Yt).length==0&&Zt[Mt].push(Yt)})});var $t=M(ot,"horizontal",ht,K,Kt),Jt=M(at,"vertical",tt,ft,Zt),re=function(ut){V.get(ut)?V.get(ut).forEach(function(Mt){y[c.get(Mt)]=$t.get(ut)}):y[c.get(ut)]=$t.get(ut)},jt=!0,Ee=!1,Ne=void 0;try{for(var se=$t.keys()[Symbol.iterator](),Te;!(jt=(Te=se.next()).done);jt=!0){var he=Te.value;re(he)}}catch(ut){Ee=!0,Ne=ut}finally{try{!jt&&se.return&&se.return()}finally{if(Ee)throw Ne}}var ze=function(ut){J.get(ut)?J.get(ut).forEach(function(Mt){A[c.get(Mt)]=Jt.get(ut)}):A[c.get(ut)]=Jt.get(ut)},le=!0,Ae=!1,we=void 0;try{for(var de=Jt.keys()[Symbol.iterator](),Ie;!(le=(Ie=de.next()).done);le=!0){var he=Ie.value;ze(he)}}catch(ut){Ae=!0,we=ut}finally{try{!le&&de.return&&de.return()}finally{if(Ae)throw we}}}()}for(var Bt=0;Bt<w.length;Bt++){var dt=w[Bt];dt.getChild()==null&&dt.setCenter(y[c.get(dt.id)],A[c.get(dt.id)])}},o.exports=h},551:o=>{o.exports=I}},T={};function u(o){var i=T[o];if(i!==void 0)return i.exports;var e=T[o]={exports:{}};return G[o](e,e.exports,u),e.exports}var l=u(45);return l})()})}(ue)),ue.exports}var pi=ge.exports,Me;function mi(){return Me||(Me=1,function(D,C){(function(I,G){D.exports=G(fi())})(pi,function(I){return(()=>{var G={658:o=>{o.exports=Object.assign!=null?Object.assign.bind(Object):function(i){for(var e=arguments.length,a=Array(e>1?e-1:0),r=1;r<e;r++)a[r-1]=arguments[r];return a.forEach(function(f){Object.keys(f).forEach(function(t){return i[t]=f[t]})}),i}},548:(o,i,e)=>{var a=function(){function t(s,h){var g=[],d=!0,N=!1,c=void 0;try{for(var y=s[Symbol.iterator](),A;!(d=(A=y.next()).done)&&(g.push(A.value),!(h&&g.length===h));d=!0);}catch(w){N=!0,c=w}finally{try{!d&&y.return&&y.return()}finally{if(N)throw c}}return g}return function(s,h){if(Array.isArray(s))return s;if(Symbol.iterator in Object(s))return t(s,h);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),r=e(140).layoutBase.LinkedList,f={};f.getTopMostNodes=function(t){for(var s={},h=0;h<t.length;h++)s[t[h].id()]=!0;var g=t.filter(function(d,N){typeof d=="number"&&(d=N);for(var c=d.parent()[0];c!=null;){if(s[c.id()])return!1;c=c.parent()[0]}return!0});return g},f.connectComponents=function(t,s,h,g){var d=new r,N=new Set,c=[],y=void 0,A=void 0,w=void 0,P=!1,k=1,Y=[],H=[],Z=function(){var M=t.collection();H.push(M);var rt=h[0],n=t.collection();n.merge(rt).merge(rt.descendants().intersection(s)),c.push(rt),n.forEach(function(m){d.push(m),N.add(m),M.merge(m)});for(var E=function(){rt=d.shift();var m=t.collection();rt.neighborhood().nodes().forEach(function(x){s.intersection(rt.edgesWith(x)).length>0&&m.merge(x)});for(var v=0;v<m.length;v++){var O=m[v];if(y=h.intersection(O.union(O.ancestors())),y!=null&&!N.has(y[0])){var _=y.union(y.descendants());_.forEach(function(x){d.push(x),N.add(x),M.merge(x),h.has(x)&&c.push(x)})}}};d.length!=0;)E();if(M.forEach(function(m){s.intersection(m.connectedEdges()).forEach(function(v){M.has(v.source())&&M.has(v.target())&&M.merge(v)})}),c.length==h.length&&(P=!0),!P||P&&k>1){A=c[0],w=A.connectedEdges().length,c.forEach(function(m){m.connectedEdges().length<w&&(w=m.connectedEdges().length,A=m)}),Y.push(A.id());var p=t.collection();p.merge(c[0]),c.forEach(function(m){p.merge(m)}),c=[],h=h.difference(p),k++}};do Z();while(!P);return g&&Y.length>0&&g.set("dummy"+(g.size+1),Y),H},f.relocateComponent=function(t,s,h){if(!h.fixedNodeConstraint){var g=Number.POSITIVE_INFINITY,d=Number.NEGATIVE_INFINITY,N=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY;if(h.quality=="draft"){var y=!0,A=!1,w=void 0;try{for(var P=s.nodeIndexes[Symbol.iterator](),k;!(y=(k=P.next()).done);y=!0){var Y=k.value,H=a(Y,2),Z=H[0],M=H[1],rt=h.cy.getElementById(Z);if(rt){var n=rt.boundingBox(),E=s.xCoords[M]-n.w/2,p=s.xCoords[M]+n.w/2,m=s.yCoords[M]-n.h/2,v=s.yCoords[M]+n.h/2;E<g&&(g=E),p>d&&(d=p),m<N&&(N=m),v>c&&(c=v)}}}catch(X){A=!0,w=X}finally{try{!y&&P.return&&P.return()}finally{if(A)throw w}}var O=t.x-(d+g)/2,_=t.y-(c+N)/2;s.xCoords=s.xCoords.map(function(X){return X+O}),s.yCoords=s.yCoords.map(function(X){return X+_})}else{Object.keys(s).forEach(function(X){var B=s[X],z=B.getRect().x,W=B.getRect().x+B.getRect().width,q=B.getRect().y,S=B.getRect().y+B.getRect().height;z<g&&(g=z),W>d&&(d=W),q<N&&(N=q),S>c&&(c=S)});var x=t.x-(d+g)/2,U=t.y-(c+N)/2;Object.keys(s).forEach(function(X){var B=s[X];B.setCenter(B.getCenterX()+x,B.getCenterY()+U)})}}},f.calcBoundingBox=function(t,s,h,g){for(var d=Number.MAX_SAFE_INTEGER,N=Number.MIN_SAFE_INTEGER,c=Number.MAX_SAFE_INTEGER,y=Number.MIN_SAFE_INTEGER,A=void 0,w=void 0,P=void 0,k=void 0,Y=t.descendants().not(":parent"),H=Y.length,Z=0;Z<H;Z++){var M=Y[Z];A=s[g.get(M.id())]-M.width()/2,w=s[g.get(M.id())]+M.width()/2,P=h[g.get(M.id())]-M.height()/2,k=h[g.get(M.id())]+M.height()/2,d>A&&(d=A),N<w&&(N=w),c>P&&(c=P),y<k&&(y=k)}var rt={};return rt.topLeftX=d,rt.topLeftY=c,rt.width=N-d,rt.height=y-c,rt},f.calcParentsWithoutChildren=function(t,s){var h=t.collection();return s.nodes(":parent").forEach(function(g){var d=!1;g.children().forEach(function(N){N.css("display")!="none"&&(d=!0)}),d||h.merge(g)}),h},o.exports=f},816:(o,i,e)=>{var a=e(548),r=e(140).CoSELayout,f=e(140).CoSENode,t=e(140).layoutBase.PointD,s=e(140).layoutBase.DimensionD,h=e(140).layoutBase.LayoutConstants,g=e(140).layoutBase.FDLayoutConstants,d=e(140).CoSEConstants,N=function(c,y){var A=c.cy,w=c.eles,P=w.nodes(),k=w.edges(),Y=void 0,H=void 0,Z=void 0,M={};c.randomize&&(Y=y.nodeIndexes,H=y.xCoords,Z=y.yCoords);var rt=function(x){return typeof x=="function"},n=function(x,U){return rt(x)?x(U):x},E=a.calcParentsWithoutChildren(A,w),p=function x(U,X,B,z){for(var W=X.length,q=0;q<W;q++){var S=X[q],b=null;S.intersection(E).length==0&&(b=S.children());var F=void 0,j=S.layoutDimensions({nodeDimensionsIncludeLabels:z.nodeDimensionsIncludeLabels});if(S.outerWidth()!=null&&S.outerHeight()!=null)if(z.randomize)if(!S.isParent())F=U.add(new f(B.graphManager,new t(H[Y.get(S.id())]-j.w/2,Z[Y.get(S.id())]-j.h/2),new s(parseFloat(j.w),parseFloat(j.h))));else{var et=a.calcBoundingBox(S,H,Z,Y);S.intersection(E).length==0?F=U.add(new f(B.graphManager,new t(et.topLeftX,et.topLeftY),new s(et.width,et.height))):F=U.add(new f(B.graphManager,new t(et.topLeftX,et.topLeftY),new s(parseFloat(j.w),parseFloat(j.h))))}else F=U.add(new f(B.graphManager,new t(S.position("x")-j.w/2,S.position("y")-j.h/2),new s(parseFloat(j.w),parseFloat(j.h))));else F=U.add(new f(this.graphManager));if(F.id=S.data("id"),F.nodeRepulsion=n(z.nodeRepulsion,S),F.paddingLeft=parseInt(S.css("padding")),F.paddingTop=parseInt(S.css("padding")),F.paddingRight=parseInt(S.css("padding")),F.paddingBottom=parseInt(S.css("padding")),z.nodeDimensionsIncludeLabels&&(F.labelWidth=S.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).w,F.labelHeight=S.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).h,F.labelPosVertical=S.css("text-valign"),F.labelPosHorizontal=S.css("text-halign")),M[S.data("id")]=F,isNaN(F.rect.x)&&(F.rect.x=0),isNaN(F.rect.y)&&(F.rect.y=0),b!=null&&b.length>0){var mt=void 0;mt=B.getGraphManager().add(B.newGraph(),F),x(mt,b,B,z)}}},m=function(x,U,X){for(var B=0,z=0,W=0;W<X.length;W++){var q=X[W],S=M[q.data("source")],b=M[q.data("target")];if(S&&b&&S!==b&&S.getEdgesBetween(b).length==0){var F=U.add(x.newEdge(),S,b);F.id=q.id(),F.idealLength=n(c.idealEdgeLength,q),F.edgeElasticity=n(c.edgeElasticity,q),B+=F.idealLength,z++}}c.idealEdgeLength!=null&&(z>0?d.DEFAULT_EDGE_LENGTH=g.DEFAULT_EDGE_LENGTH=B/z:rt(c.idealEdgeLength)?d.DEFAULT_EDGE_LENGTH=g.DEFAULT_EDGE_LENGTH=50:d.DEFAULT_EDGE_LENGTH=g.DEFAULT_EDGE_LENGTH=c.idealEdgeLength,d.MIN_REPULSION_DIST=g.MIN_REPULSION_DIST=g.DEFAULT_EDGE_LENGTH/10,d.DEFAULT_RADIAL_SEPARATION=g.DEFAULT_EDGE_LENGTH)},v=function(x,U){U.fixedNodeConstraint&&(x.constraints.fixedNodeConstraint=U.fixedNodeConstraint),U.alignmentConstraint&&(x.constraints.alignmentConstraint=U.alignmentConstraint),U.relativePlacementConstraint&&(x.constraints.relativePlacementConstraint=U.relativePlacementConstraint)};c.nestingFactor!=null&&(d.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=g.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=c.nestingFactor),c.gravity!=null&&(d.DEFAULT_GRAVITY_STRENGTH=g.DEFAULT_GRAVITY_STRENGTH=c.gravity),c.numIter!=null&&(d.MAX_ITERATIONS=g.MAX_ITERATIONS=c.numIter),c.gravityRange!=null&&(d.DEFAULT_GRAVITY_RANGE_FACTOR=g.DEFAULT_GRAVITY_RANGE_FACTOR=c.gravityRange),c.gravityCompound!=null&&(d.DEFAULT_COMPOUND_GRAVITY_STRENGTH=g.DEFAULT_COMPOUND_GRAVITY_STRENGTH=c.gravityCompound),c.gravityRangeCompound!=null&&(d.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=g.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=c.gravityRangeCompound),c.initialEnergyOnIncremental!=null&&(d.DEFAULT_COOLING_FACTOR_INCREMENTAL=g.DEFAULT_COOLING_FACTOR_INCREMENTAL=c.initialEnergyOnIncremental),c.tilingCompareBy!=null&&(d.TILING_COMPARE_BY=c.tilingCompareBy),c.quality=="proof"?h.QUALITY=2:h.QUALITY=0,d.NODE_DIMENSIONS_INCLUDE_LABELS=g.NODE_DIMENSIONS_INCLUDE_LABELS=h.NODE_DIMENSIONS_INCLUDE_LABELS=c.nodeDimensionsIncludeLabels,d.DEFAULT_INCREMENTAL=g.DEFAULT_INCREMENTAL=h.DEFAULT_INCREMENTAL=!c.randomize,d.ANIMATE=g.ANIMATE=h.ANIMATE=c.animate,d.TILE=c.tile,d.TILING_PADDING_VERTICAL=typeof c.tilingPaddingVertical=="function"?c.tilingPaddingVertical.call():c.tilingPaddingVertical,d.TILING_PADDING_HORIZONTAL=typeof c.tilingPaddingHorizontal=="function"?c.tilingPaddingHorizontal.call():c.tilingPaddingHorizontal,d.DEFAULT_INCREMENTAL=g.DEFAULT_INCREMENTAL=h.DEFAULT_INCREMENTAL=!0,d.PURE_INCREMENTAL=!c.randomize,h.DEFAULT_UNIFORM_LEAF_NODE_SIZES=c.uniformNodeDimensions,c.step=="transformed"&&(d.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,d.ENFORCE_CONSTRAINTS=!1,d.APPLY_LAYOUT=!1),c.step=="enforced"&&(d.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,d.ENFORCE_CONSTRAINTS=!0,d.APPLY_LAYOUT=!1),c.step=="cose"&&(d.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,d.ENFORCE_CONSTRAINTS=!1,d.APPLY_LAYOUT=!0),c.step=="all"&&(c.randomize?d.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:d.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,d.ENFORCE_CONSTRAINTS=!0,d.APPLY_LAYOUT=!0),c.fixedNodeConstraint||c.alignmentConstraint||c.relativePlacementConstraint?d.TREE_REDUCTION_ON_INCREMENTAL=!1:d.TREE_REDUCTION_ON_INCREMENTAL=!0;var O=new r,_=O.newGraphManager();return p(_.addRoot(),a.getTopMostNodes(P),O,c),m(O,_,k),v(O,c),O.runLayout(),M};o.exports={coseLayout:N}},212:(o,i,e)=>{var a=function(){function y(A,w){for(var P=0;P<w.length;P++){var k=w[P];k.enumerable=k.enumerable||!1,k.configurable=!0,"value"in k&&(k.writable=!0),Object.defineProperty(A,k.key,k)}}return function(A,w,P){return w&&y(A.prototype,w),P&&y(A,P),A}}();function r(y,A){if(!(y instanceof A))throw new TypeError("Cannot call a class as a function")}var f=e(658),t=e(548),s=e(657),h=s.spectralLayout,g=e(816),d=g.coseLayout,N=Object.freeze({quality:"default",randomize:!0,animate:!0,animationDuration:1e3,animationEasing:void 0,fit:!0,padding:30,nodeDimensionsIncludeLabels:!1,uniformNodeDimensions:!1,packComponents:!0,step:"all",samplingType:!0,sampleSize:25,nodeSeparation:75,piTol:1e-7,nodeRepulsion:function(y){return 4500},idealEdgeLength:function(y){return 50},edgeElasticity:function(y){return .45},nestingFactor:.1,gravity:.25,numIter:2500,tile:!0,tilingCompareBy:void 0,tilingPaddingVertical:10,tilingPaddingHorizontal:10,gravityRangeCompound:1.5,gravityCompound:1,gravityRange:3.8,initialEnergyOnIncremental:.3,fixedNodeConstraint:void 0,alignmentConstraint:void 0,relativePlacementConstraint:void 0,ready:function(){},stop:function(){}}),c=function(){function y(A){r(this,y),this.options=f({},N,A)}return a(y,[{key:"run",value:function(){var A=this,w=this.options,P=w.cy,k=w.eles,Y=[],H=[],Z=void 0,M=[];w.fixedNodeConstraint&&(!Array.isArray(w.fixedNodeConstraint)||w.fixedNodeConstraint.length==0)&&(w.fixedNodeConstraint=void 0),w.alignmentConstraint&&(w.alignmentConstraint.vertical&&(!Array.isArray(w.alignmentConstraint.vertical)||w.alignmentConstraint.vertical.length==0)&&(w.alignmentConstraint.vertical=void 0),w.alignmentConstraint.horizontal&&(!Array.isArray(w.alignmentConstraint.horizontal)||w.alignmentConstraint.horizontal.length==0)&&(w.alignmentConstraint.horizontal=void 0)),w.relativePlacementConstraint&&(!Array.isArray(w.relativePlacementConstraint)||w.relativePlacementConstraint.length==0)&&(w.relativePlacementConstraint=void 0);var rt=w.fixedNodeConstraint||w.alignmentConstraint||w.relativePlacementConstraint;rt&&(w.tile=!1,w.packComponents=!1);var n=void 0,E=!1;if(P.layoutUtilities&&w.packComponents&&(n=P.layoutUtilities("get"),n||(n=P.layoutUtilities()),E=!0),k.nodes().length>0)if(E){var p=t.getTopMostNodes(w.eles.nodes());if(Z=t.connectComponents(P,w.eles,p),Z.forEach(function(Q){var nt=Q.boundingBox();M.push({x:nt.x1+nt.w/2,y:nt.y1+nt.h/2})}),w.randomize&&Z.forEach(function(Q){w.eles=Q,Y.push(h(w))}),w.quality=="default"||w.quality=="proof"){var m=P.collection();if(w.tile){var v=new Map,O=[],_=[],x=0,U={nodeIndexes:v,xCoords:O,yCoords:_},X=[];if(Z.forEach(function(Q,nt){Q.edges().length==0&&(Q.nodes().forEach(function(vt,st){m.merge(Q.nodes()[st]),vt.isParent()||(U.nodeIndexes.set(Q.nodes()[st].id(),x++),U.xCoords.push(Q.nodes()[0].position().x),U.yCoords.push(Q.nodes()[0].position().y))}),X.push(nt))}),m.length>1){var B=m.boundingBox();M.push({x:B.x1+B.w/2,y:B.y1+B.h/2}),Z.push(m),Y.push(U);for(var z=X.length-1;z>=0;z--)Z.splice(X[z],1),Y.splice(X[z],1),M.splice(X[z],1)}}Z.forEach(function(Q,nt){w.eles=Q,H.push(d(w,Y[nt])),t.relocateComponent(M[nt],H[nt],w)})}else Z.forEach(function(Q,nt){t.relocateComponent(M[nt],Y[nt],w)});var W=new Set;if(Z.length>1){var q=[],S=k.filter(function(Q){return Q.css("display")=="none"});Z.forEach(function(Q,nt){var vt=void 0;if(w.quality=="draft"&&(vt=Y[nt].nodeIndexes),Q.nodes().not(S).length>0){var st={};st.edges=[],st.nodes=[];var Lt=void 0;Q.nodes().not(S).forEach(function(_t){if(w.quality=="draft")if(!_t.isParent())Lt=vt.get(_t.id()),st.nodes.push({x:Y[nt].xCoords[Lt]-_t.boundingbox().w/2,y:Y[nt].yCoords[Lt]-_t.boundingbox().h/2,width:_t.boundingbox().w,height:_t.boundingbox().h});else{var Nt=t.calcBoundingBox(_t,Y[nt].xCoords,Y[nt].yCoords,vt);st.nodes.push({x:Nt.topLeftX,y:Nt.topLeftY,width:Nt.width,height:Nt.height})}else H[nt][_t.id()]&&st.nodes.push({x:H[nt][_t.id()].getLeft(),y:H[nt][_t.id()].getTop(),width:H[nt][_t.id()].getWidth(),height:H[nt][_t.id()].getHeight()})}),Q.edges().forEach(function(_t){var Nt=_t.source(),At=_t.target();if(Nt.css("display")!="none"&&At.css("display")!="none")if(w.quality=="draft"){var Ht=vt.get(Nt.id()),Ot=vt.get(At.id()),Rt=[],Ft=[];if(Nt.isParent()){var Wt=t.calcBoundingBox(Nt,Y[nt].xCoords,Y[nt].yCoords,vt);Rt.push(Wt.topLeftX+Wt.width/2),Rt.push(Wt.topLeftY+Wt.height/2)}else Rt.push(Y[nt].xCoords[Ht]),Rt.push(Y[nt].yCoords[Ht]);if(At.isParent()){var Gt=t.calcBoundingBox(At,Y[nt].xCoords,Y[nt].yCoords,vt);Ft.push(Gt.topLeftX+Gt.width/2),Ft.push(Gt.topLeftY+Gt.height/2)}else Ft.push(Y[nt].xCoords[Ot]),Ft.push(Y[nt].yCoords[Ot]);st.edges.push({startX:Rt[0],startY:Rt[1],endX:Ft[0],endY:Ft[1]})}else H[nt][Nt.id()]&&H[nt][At.id()]&&st.edges.push({startX:H[nt][Nt.id()].getCenterX(),startY:H[nt][Nt.id()].getCenterY(),endX:H[nt][At.id()].getCenterX(),endY:H[nt][At.id()].getCenterY()})}),st.nodes.length>0&&(q.push(st),W.add(nt))}});var b=n.packComponents(q,w.randomize).shifts;if(w.quality=="draft")Y.forEach(function(Q,nt){var vt=Q.xCoords.map(function(Lt){return Lt+b[nt].dx}),st=Q.yCoords.map(function(Lt){return Lt+b[nt].dy});Q.xCoords=vt,Q.yCoords=st});else{var F=0;W.forEach(function(Q){Object.keys(H[Q]).forEach(function(nt){var vt=H[Q][nt];vt.setCenter(vt.getCenterX()+b[F].dx,vt.getCenterY()+b[F].dy)}),F++})}}}else{var j=w.eles.boundingBox();if(M.push({x:j.x1+j.w/2,y:j.y1+j.h/2}),w.randomize){var et=h(w);Y.push(et)}w.quality=="default"||w.quality=="proof"?(H.push(d(w,Y[0])),t.relocateComponent(M[0],H[0],w)):t.relocateComponent(M[0],Y[0],w)}var mt=function(Q,nt){if(w.quality=="default"||w.quality=="proof"){typeof Q=="number"&&(Q=nt);var vt=void 0,st=void 0,Lt=Q.data("id");return H.forEach(function(Nt){Lt in Nt&&(vt={x:Nt[Lt].getRect().getCenterX(),y:Nt[Lt].getRect().getCenterY()},st=Nt[Lt])}),w.nodeDimensionsIncludeLabels&&(st.labelWidth&&(st.labelPosHorizontal=="left"?vt.x+=st.labelWidth/2:st.labelPosHorizontal=="right"&&(vt.x-=st.labelWidth/2)),st.labelHeight&&(st.labelPosVertical=="top"?vt.y+=st.labelHeight/2:st.labelPosVertical=="bottom"&&(vt.y-=st.labelHeight/2))),vt==null&&(vt={x:Q.position("x"),y:Q.position("y")}),{x:vt.x,y:vt.y}}else{var _t=void 0;return Y.forEach(function(Nt){var At=Nt.nodeIndexes.get(Q.id());At!=null&&(_t={x:Nt.xCoords[At],y:Nt.yCoords[At]})}),_t==null&&(_t={x:Q.position("x"),y:Q.position("y")}),{x:_t.x,y:_t.y}}};if(w.quality=="default"||w.quality=="proof"||w.randomize){var $=t.calcParentsWithoutChildren(P,k),xt=k.filter(function(Q){return Q.css("display")=="none"});w.eles=k.not(xt),k.nodes().not(":parent").not(xt).layoutPositions(A,w,mt),$.length>0&&$.forEach(function(Q){Q.position(mt(Q))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),y}();o.exports=c},657:(o,i,e)=>{var a=e(548),r=e(140).layoutBase.Matrix,f=e(140).layoutBase.SVD,t=function(s){var h=s.cy,g=s.eles,d=g.nodes(),N=g.nodes(":parent"),c=new Map,y=new Map,A=new Map,w=[],P=[],k=[],Y=[],H=[],Z=[],M=[],rt=[],n=void 0,E=1e8,p=1e-9,m=s.piTol,v=s.samplingType,O=s.nodeSeparation,_=void 0,x=function(){for(var dt=0,L=0,R=!1;L<_;){dt=Math.floor(Math.random()*n),R=!1;for(var V=0;V<L;V++)if(Y[V]==dt){R=!0;break}if(!R)Y[L]=dt,L++;else continue}},U=function(dt,L,R){for(var V=[],J=0,K=0,ft=0,ht=void 0,tt=[],ct=0,it=1,Et=0;Et<n;Et++)tt[Et]=E;for(V[K]=dt,tt[dt]=0;K>=J;){ft=V[J++];for(var yt=w[ft],Ct=0;Ct<yt.length;Ct++)ht=y.get(yt[Ct]),tt[ht]==E&&(tt[ht]=tt[ft]+1,V[++K]=ht);Z[ft][L]=tt[ft]*O}if(R){for(var lt=0;lt<n;lt++)Z[lt][L]<H[lt]&&(H[lt]=Z[lt][L]);for(var ot=0;ot<n;ot++)H[ot]>ct&&(ct=H[ot],it=ot)}return it},X=function(dt){var L=void 0;if(dt){L=Math.floor(Math.random()*n);for(var R=0;R<n;R++)H[R]=E;for(var V=0;V<_;V++)Y[V]=L,L=U(L,V,dt)}else{x();for(var J=0;J<_;J++)U(Y[J],J,dt)}for(var K=0;K<n;K++)for(var ft=0;ft<_;ft++)Z[K][ft]*=Z[K][ft];for(var ht=0;ht<_;ht++)M[ht]=[];for(var tt=0;tt<_;tt++)for(var ct=0;ct<_;ct++)M[tt][ct]=Z[Y[ct]][tt]},B=function(){for(var dt=f.svd(M),L=dt.S,R=dt.U,V=dt.V,J=L[0]*L[0]*L[0],K=[],ft=0;ft<_;ft++){K[ft]=[];for(var ht=0;ht<_;ht++)K[ft][ht]=0,ft==ht&&(K[ft][ht]=L[ft]/(L[ft]*L[ft]+J/(L[ft]*L[ft])))}rt=r.multMat(r.multMat(V,K),r.transpose(R))},z=function(){for(var dt=void 0,L=void 0,R=[],V=[],J=[],K=[],ft=0;ft<n;ft++)R[ft]=Math.random(),V[ft]=Math.random();R=r.normalize(R),V=r.normalize(V);for(var ht=p,tt=p,ct=void 0;;){for(var it=0;it<n;it++)J[it]=R[it];if(R=r.multGamma(r.multL(r.multGamma(J),Z,rt)),dt=r.dotProduct(J,R),R=r.normalize(R),ht=r.dotProduct(J,R),ct=Math.abs(ht/tt),ct<=1+m&&ct>=1)break;tt=ht}for(var Et=0;Et<n;Et++)J[Et]=R[Et];for(tt=p;;){for(var yt=0;yt<n;yt++)K[yt]=V[yt];if(K=r.minusOp(K,r.multCons(J,r.dotProduct(J,K))),V=r.multGamma(r.multL(r.multGamma(K),Z,rt)),L=r.dotProduct(K,V),V=r.normalize(V),ht=r.dotProduct(K,V),ct=Math.abs(ht/tt),ct<=1+m&&ct>=1)break;tt=ht}for(var Ct=0;Ct<n;Ct++)K[Ct]=V[Ct];P=r.multCons(J,Math.sqrt(Math.abs(dt))),k=r.multCons(K,Math.sqrt(Math.abs(L)))};a.connectComponents(h,g,a.getTopMostNodes(d),c),N.forEach(function(dt){a.connectComponents(h,g,a.getTopMostNodes(dt.descendants().intersection(g)),c)});for(var W=0,q=0;q<d.length;q++)d[q].isParent()||y.set(d[q].id(),W++);var S=!0,b=!1,F=void 0;try{for(var j=c.keys()[Symbol.iterator](),et;!(S=(et=j.next()).done);S=!0){var mt=et.value;y.set(mt,W++)}}catch(dt){b=!0,F=dt}finally{try{!S&&j.return&&j.return()}finally{if(b)throw F}}for(var $=0;$<y.size;$++)w[$]=[];N.forEach(function(dt){for(var L=dt.children().intersection(g);L.nodes(":childless").length==0;)L=L.nodes()[0].children().intersection(g);var R=0,V=L.nodes(":childless")[0].connectedEdges().length;L.nodes(":childless").forEach(function(J,K){J.connectedEdges().length<V&&(V=J.connectedEdges().length,R=K)}),A.set(dt.id(),L.nodes(":childless")[R].id())}),d.forEach(function(dt){var L=void 0;dt.isParent()?L=y.get(A.get(dt.id())):L=y.get(dt.id()),dt.neighborhood().nodes().forEach(function(R){g.intersection(dt.edgesWith(R)).length>0&&(R.isParent()?w[L].push(A.get(R.id())):w[L].push(R.id()))})});var xt=function(dt){var L=y.get(dt),R=void 0;c.get(dt).forEach(function(V){h.getElementById(V).isParent()?R=A.get(V):R=V,w[L].push(R),w[y.get(R)].push(dt)})},Q=!0,nt=!1,vt=void 0;try{for(var st=c.keys()[Symbol.iterator](),Lt;!(Q=(Lt=st.next()).done);Q=!0){var _t=Lt.value;xt(_t)}}catch(dt){nt=!0,vt=dt}finally{try{!Q&&st.return&&st.return()}finally{if(nt)throw vt}}n=y.size;var Nt=void 0;if(n>2){_=n<s.sampleSize?n:s.sampleSize;for(var At=0;At<n;At++)Z[At]=[];for(var Ht=0;Ht<_;Ht++)rt[Ht]=[];return s.quality=="draft"||s.step=="all"?(X(v),B(),z(),Nt={nodeIndexes:y,xCoords:P,yCoords:k}):(y.forEach(function(dt,L){P.push(h.getElementById(L).position("x")),k.push(h.getElementById(L).position("y"))}),Nt={nodeIndexes:y,xCoords:P,yCoords:k}),Nt}else{var Ot=y.keys(),Rt=h.getElementById(Ot.next().value),Ft=Rt.position(),Wt=Rt.outerWidth();if(P.push(Ft.x),k.push(Ft.y),n==2){var Gt=h.getElementById(Ot.next().value),Bt=Gt.outerWidth();P.push(Ft.x+Wt/2+Bt/2+s.idealEdgeLength),k.push(Ft.y)}return Nt={nodeIndexes:y,xCoords:P,yCoords:k},Nt}};o.exports={spectralLayout:t}},579:(o,i,e)=>{var a=e(212),r=function(f){f&&f("layout","fcose",a)};typeof cytoscape<"u"&&r(cytoscape),o.exports=r},140:o=>{o.exports=I}},T={};function u(o){var i=T[o];if(i!==void 0)return i.exports;var e=T[o]={exports:{}};return G[o](e,e.exports,u),e.exports}var l=u(579);return l})()})}(ge)),ge.exports}var vi=mi();const yi=li(vi);var Ce={L:"left",R:"right",T:"top",B:"bottom"},xe={L:pt(D=>`${D},${D/2} 0,${D} 0,0`,"L"),R:pt(D=>`0,${D/2} ${D},0 ${D},${D}`,"R"),T:pt(D=>`0,0 ${D},0 ${D/2},${D}`,"T"),B:pt(D=>`${D/2},0 ${D},${D} 0,${D}`,"B")},oe={L:pt((D,C)=>D-C+2,"L"),R:pt((D,C)=>D-2,"R"),T:pt((D,C)=>D-C+2,"T"),B:pt((D,C)=>D-2,"B")},Ei=pt(function(D){return kt(D)?D==="L"?"R":"L":D==="T"?"B":"T"},"getOppositeArchitectureDirection"),De=pt(function(D){const C=D;return C==="L"||C==="R"||C==="T"||C==="B"},"isArchitectureDirection"),kt=pt(function(D){const C=D;return C==="L"||C==="R"},"isArchitectureDirectionX"),Vt=pt(function(D){const C=D;return C==="T"||C==="B"},"isArchitectureDirectionY"),ye=pt(function(D,C){const I=kt(D)&&Vt(C),G=Vt(D)&&kt(C);return I||G},"isArchitectureDirectionXY"),Ni=pt(function(D){const C=D[0],I=D[1],G=kt(C)&&Vt(I),T=Vt(C)&&kt(I);return G||T},"isArchitecturePairXY"),Ti=pt(function(D){return D!=="LL"&&D!=="RR"&&D!=="TT"&&D!=="BB"},"isValidArchitectureDirectionPair"),pe=pt(function(D,C){const I=`${D}${C}`;return Ti(I)?I:void 0},"getArchitectureDirectionPair"),Ai=pt(function([D,C],I){const G=I[0],T=I[1];return kt(G)?Vt(T)?[D+(G==="L"?-1:1),C+(T==="T"?1:-1)]:[D+(G==="L"?-1:1),C]:kt(T)?[D+(T==="L"?1:-1),C+(G==="T"?1:-1)]:[D,C+(G==="T"?1:-1)]},"shiftPositionByArchitectureDirectionPair"),wi=pt(function(D){return D==="LT"||D==="TL"?[1,1]:D==="BL"||D==="LB"?[1,-1]:D==="BR"||D==="RB"?[-1,-1]:[-1,1]},"getArchitectureDirectionXYFactors"),Ii=pt(function(D,C){return ye(D,C)?"bend":kt(D)?"horizontal":"vertical"},"getArchitectureDirectionAlignment"),Li=pt(function(D){return D.type==="service"},"isArchitectureService"),_i=pt(function(D){return D.type==="junction"},"isArchitectureJunction"),Re=pt(D=>D.data(),"edgeData"),te=pt(D=>D.data(),"nodeData"),Mi=ii.architecture,ee,Ge=(ee=class{constructor(){this.nodes={},this.groups={},this.edges=[],this.registeredIds={},this.elements={},this.setAccTitle=$e,this.getAccTitle=je,this.setDiagramTitle=qe,this.getDiagramTitle=Ke,this.getAccDescription=Ze,this.setAccDescription=Je,this.clear()}clear(){this.nodes={},this.groups={},this.edges=[],this.registeredIds={},this.dataStructures=void 0,this.elements={},Qe()}addService({id:C,icon:I,in:G,title:T,iconText:u}){if(this.registeredIds[C]!==void 0)throw new Error(`The service id [${C}] is already in use by another ${this.registeredIds[C]}`);if(G!==void 0){if(C===G)throw new Error(`The service [${C}] cannot be placed within itself`);if(this.registeredIds[G]===void 0)throw new Error(`The service [${C}]'s parent does not exist. Please make sure the parent is created before this service`);if(this.registeredIds[G]==="node")throw new Error(`The service [${C}]'s parent is not a group`)}this.registeredIds[C]="node",this.nodes[C]={id:C,type:"service",icon:I,iconText:u,title:T,edges:[],in:G}}getServices(){return Object.values(this.nodes).filter(Li)}addJunction({id:C,in:I}){this.registeredIds[C]="node",this.nodes[C]={id:C,type:"junction",edges:[],in:I}}getJunctions(){return Object.values(this.nodes).filter(_i)}getNodes(){return Object.values(this.nodes)}getNode(C){return this.nodes[C]??null}addGroup({id:C,icon:I,in:G,title:T}){if(this.registeredIds?.[C]!==void 0)throw new Error(`The group id [${C}] is already in use by another ${this.registeredIds[C]}`);if(G!==void 0){if(C===G)throw new Error(`The group [${C}] cannot be placed within itself`);if(this.registeredIds?.[G]===void 0)throw new Error(`The group [${C}]'s parent does not exist. Please make sure the parent is created before this group`);if(this.registeredIds?.[G]==="node")throw new Error(`The group [${C}]'s parent is not a group`)}this.registeredIds[C]="group",this.groups[C]={id:C,icon:I,title:T,in:G}}getGroups(){return Object.values(this.groups)}addEdge({lhsId:C,rhsId:I,lhsDir:G,rhsDir:T,lhsInto:u,rhsInto:l,lhsGroup:o,rhsGroup:i,title:e}){if(!De(G))throw new Error(`Invalid direction given for left hand side of edge ${C}--${I}. Expected (L,R,T,B) got ${String(G)}`);if(!De(T))throw new Error(`Invalid direction given for right hand side of edge ${C}--${I}. Expected (L,R,T,B) got ${String(T)}`);if(this.nodes[C]===void 0&&this.groups[C]===void 0)throw new Error(`The left-hand id [${C}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(this.nodes[I]===void 0&&this.groups[I]===void 0)throw new Error(`The right-hand id [${I}] does not yet exist. Please create the service/group before declaring an edge to it.`);const a=this.nodes[C].in,r=this.nodes[I].in;if(o&&a&&r&&a==r)throw new Error(`The left-hand id [${C}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(i&&a&&r&&a==r)throw new Error(`The right-hand id [${I}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);const f={lhsId:C,lhsDir:G,lhsInto:u,lhsGroup:o,rhsId:I,rhsDir:T,rhsInto:l,rhsGroup:i,title:e};this.edges.push(f),this.nodes[C]&&this.nodes[I]&&(this.nodes[C].edges.push(this.edges[this.edges.length-1]),this.nodes[I].edges.push(this.edges[this.edges.length-1]))}getEdges(){return this.edges}getDataStructures(){if(this.dataStructures===void 0){const C={},I=Object.entries(this.nodes).reduce((i,[e,a])=>(i[e]=a.edges.reduce((r,f)=>{const t=this.getNode(f.lhsId)?.in,s=this.getNode(f.rhsId)?.in;if(t&&s&&t!==s){const h=Ii(f.lhsDir,f.rhsDir);h!=="bend"&&(C[t]??(C[t]={}),C[t][s]=h,C[s]??(C[s]={}),C[s][t]=h)}if(f.lhsId===e){const h=pe(f.lhsDir,f.rhsDir);h&&(r[h]=f.rhsId)}else{const h=pe(f.rhsDir,f.lhsDir);h&&(r[h]=f.lhsId)}return r},{}),i),{}),G=Object.keys(I)[0],T={[G]:1},u=Object.keys(I).reduce((i,e)=>e===G?i:{...i,[e]:1},{}),l=pt(i=>{const e={[i]:[0,0]},a=[i];for(;a.length>0;){const r=a.shift();if(r){T[r]=1,delete u[r];const f=I[r],[t,s]=e[r];Object.entries(f).forEach(([h,g])=>{T[g]||(e[g]=Ai([t,s],h),a.push(g))})}}return e},"BFS"),o=[l(G)];for(;Object.keys(u).length>0;)o.push(l(Object.keys(u)[0]));this.dataStructures={adjList:I,spatialMaps:o,groupAlignments:C}}return this.dataStructures}setElementForId(C,I){this.elements[C]=I}getElementById(C){return this.elements[C]}getConfig(){return ti({...Mi,...ei().architecture})}getConfigField(C){return this.getConfig()[C]}},pt(ee,"ArchitectureDB"),ee),Ci=pt((D,C)=>{si(D,C),D.groups.map(I=>C.addGroup(I)),D.services.map(I=>C.addService({...I,type:"service"})),D.junctions.map(I=>C.addJunction({...I,type:"junction"})),D.edges.map(I=>C.addEdge(I))},"populateDb"),Fe={parser:{yy:void 0},parse:pt(async D=>{const C=await hi("architecture",D);be.debug(C);const I=Fe.parser?.yy;if(!(I instanceof Ge))throw new Error("parser.parser?.yy was not a ArchitectureDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");Ci(C,I)},"parse")},xi=pt(D=>`
.edge {
stroke-width: ${D.archEdgeWidth};
stroke: ${D.archEdgeColor};
fill: none;
}
.arrow {
fill: ${D.archEdgeArrowColor};
}
.node-bkg {
fill: none;
stroke: ${D.archGroupBorderColor};
stroke-width: ${D.archGroupBorderWidth};
stroke-dasharray: 8;
}
.node-icon-text {
display: flex;
align-items: center;
}
.node-icon-text > div {
color: #fff;
margin: 1px;
height: fit-content;
text-align: center;
overflow: hidden;
display: -webkit-box;
-webkit-box-orient: vertical;
}
`,"getStyles"),Di=xi,Qt=pt(D=>`<g><rect width="80" height="80" style="fill: #087ebf; stroke-width: 0px;"/>${D}</g>`,"wrapIcon"),ne={prefix:"mermaid-architecture",height:80,width:80,icons:{database:{body:Qt('<path id="b" data-name="4" d="m20,57.86c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path id="c" data-name="3" d="m20,45.95c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path id="d" data-name="2" d="m20,34.05c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse id="e" data-name="1" cx="40" cy="22.14" rx="20" ry="7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="20" y1="57.86" x2="20" y2="22.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="60" y1="57.86" x2="60" y2="22.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/>')},server:{body:Qt('<rect x="17.5" y="17.5" width="45" height="45" rx="2" ry="2" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="32.5" x2="62.5" y2="32.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="47.5" x2="62.5" y2="47.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><g><path d="m56.25,25c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,25c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><path d="m56.25,40c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,40c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><path d="m56.25,55c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,55c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g>')},disk:{body:Qt('<rect x="20" y="15" width="40" height="50" rx="1" ry="1" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="24" cy="19.17" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="56" cy="19.17" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="24" cy="60.83" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="56" cy="60.83" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="40" cy="33.75" rx="14" ry="14.58" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="40" cy="33.75" rx="4" ry="4.17" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path d="m37.51,42.52l-4.83,13.22c-.26.71-1.1,1.02-1.76.64l-4.18-2.42c-.66-.38-.81-1.26-.33-1.84l9.01-10.8c.88-1.05,2.56-.08,2.09,1.2Z" style="fill: #fff; stroke-width: 0px;"/>')},internet:{body:Qt('<circle cx="40" cy="40" r="22.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="40" y1="17.5" x2="40" y2="62.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="40" x2="62.5" y2="40" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path d="m39.99,17.51c-15.28,11.1-15.28,33.88,0,44.98" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path d="m40.01,17.51c15.28,11.1,15.28,33.88,0,44.98" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="19.75" y1="30.1" x2="60.25" y2="30.1" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="19.75" y1="49.9" x2="60.25" y2="49.9" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/>')},cloud:{body:Qt('<path d="m65,47.5c0,2.76-2.24,5-5,5H20c-2.76,0-5-2.24-5-5,0-1.87,1.03-3.51,2.56-4.36-.04-.21-.06-.42-.06-.64,0-2.6,2.48-4.74,5.65-4.97,1.65-4.51,6.34-7.76,11.85-7.76.86,0,1.69.08,2.5.23,2.09-1.57,4.69-2.5,7.5-2.5,6.1,0,11.19,4.38,12.28,10.17,2.14.56,3.72,2.51,3.72,4.83,0,.03,0,.07-.01.1,2.29.46,4.01,2.48,4.01,4.9Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/>')},unknown:ai,blank:{body:Qt("")}}},bi=pt(async function(D,C,I){const G=I.getConfigField("padding"),T=I.getConfigField("iconSize"),u=T/2,l=T/6,o=l/2;await Promise.all(C.edges().map(async i=>{const{source:e,sourceDir:a,sourceArrow:r,sourceGroup:f,target:t,targetDir:s,targetArrow:h,targetGroup:g,label:d}=Re(i);let{x:N,y:c}=i[0].sourceEndpoint();const{x:y,y:A}=i[0].midpoint();let{x:w,y:P}=i[0].targetEndpoint();const k=G+4;if(f&&(kt(a)?N+=a==="L"?-k:k:c+=a==="T"?-k:k+18),g&&(kt(s)?w+=s==="L"?-k:k:P+=s==="T"?-k:k+18),!f&&I.getNode(e)?.type==="junction"&&(kt(a)?N+=a==="L"?u:-u:c+=a==="T"?u:-u),!g&&I.getNode(t)?.type==="junction"&&(kt(s)?w+=s==="L"?u:-u:P+=s==="T"?u:-u),i[0]._private.rscratch){const Y=D.insert("g");if(Y.insert("path").attr("d",`M ${N},${c} L ${y},${A} L${w},${P} `).attr("class","edge").attr("id",ri(e,t,{prefix:"L"})),r){const H=kt(a)?oe[a](N,l):N-o,Z=Vt(a)?oe[a](c,l):c-o;Y.insert("polygon").attr("points",xe[a](l)).attr("transform",`translate(${H},${Z})`).attr("class","arrow")}if(h){const H=kt(s)?oe[s](w,l):w-o,Z=Vt(s)?oe[s](P,l):P-o;Y.insert("polygon").attr("points",xe[s](l)).attr("transform",`translate(${H},${Z})`).attr("class","arrow")}if(d){const H=ye(a,s)?"XY":kt(a)?"X":"Y";let Z=0;H==="X"?Z=Math.abs(N-w):H==="Y"?Z=Math.abs(c-P)/1.5:Z=Math.abs(N-w)/2;const M=Y.append("g");if(await ve(M,d,{useHtmlLabels:!1,width:Z,classes:"architecture-service-label"},me()),M.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),H==="X")M.attr("transform","translate("+y+", "+A+")");else if(H==="Y")M.attr("transform","translate("+y+", "+A+") rotate(-90)");else if(H==="XY"){const rt=pe(a,s);if(rt&&Ni(rt)){const n=M.node().getBoundingClientRect(),[E,p]=wi(rt);M.attr("dominant-baseline","auto").attr("transform",`rotate(${-1*E*p*45})`);const m=M.node().getBoundingClientRect();M.attr("transform",`
translate(${y}, ${A-n.height/2})
translate(${E*m.width/2}, ${p*m.height/2})
rotate(${-1*E*p*45}, 0, ${n.height/2})
`)}}}}}))},"drawEdges"),Oi=pt(async function(D,C,I){const G=I.getConfigField("padding")*.75,T=I.getConfigField("fontSize"),u=I.getConfigField("iconSize")/2;await Promise.all(C.nodes().map(async l=>{const o=te(l);if(o.type==="group"){const{h:i,w:e,x1:a,y1:r}=l.boundingBox(),f=D.append("rect");f.attr("id",`group-${o.id}`).attr("x",a+u).attr("y",r+u).attr("width",e).attr("height",i).attr("class","node-bkg");const t=D.append("g");let s=a,h=r;if(o.icon){const g=t.append("g");g.html(`<g>${await ce(o.icon,{height:G,width:G,fallbackPrefix:ne.prefix})}</g>`),g.attr("transform","translate("+(s+u+1)+", "+(h+u+1)+")"),s+=G,h+=T/2-1-2}if(o.label){const g=t.append("g");await ve(g,o.label,{useHtmlLabels:!1,width:e,classes:"architecture-service-label"},me()),g.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","start").attr("text-anchor","start"),g.attr("transform","translate("+(s+u+4)+", "+(h+u+2)+")")}I.setElementForId(o.id,f)}}))},"drawGroups"),Ri=pt(async function(D,C,I){const G=me();for(const T of I){const u=C.append("g"),l=D.getConfigField("iconSize");if(T.title){const a=u.append("g");await ve(a,T.title,{useHtmlLabels:!1,width:l*1.5,classes:"architecture-service-label"},G),a.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),a.attr("transform","translate("+l/2+", "+l+")")}const o=u.append("g");if(T.icon)o.html(`<g>${await ce(T.icon,{height:l,width:l,fallbackPrefix:ne.prefix})}</g>`);else if(T.iconText){o.html(`<g>${await ce("blank",{height:l,width:l,fallbackPrefix:ne.prefix})}</g>`);const a=o.append("g").append("foreignObject").attr("width",l).attr("height",l).append("div").attr("class","node-icon-text").attr("style",`height: ${l}px;`).append("div").html(ni(T.iconText,G)),r=parseInt(window.getComputedStyle(a.node(),null).getPropertyValue("font-size").replace(/\D/g,""))??16;a.attr("style",`-webkit-line-clamp: ${Math.floor((l-2)/r)};`)}else o.append("path").attr("class","node-bkg").attr("id","node-"+T.id).attr("d",`M0 ${l} v${-l} q0,-5 5,-5 h${l} q5,0 5,5 v${l} H0 Z`);u.attr("id",`service-${T.id}`).attr("class","architecture-service");const{width:i,height:e}=u.node().getBBox();T.width=i,T.height=e,D.setElementForId(T.id,u)}return 0},"drawServices"),Gi=pt(function(D,C,I){I.forEach(G=>{const T=C.append("g"),u=D.getConfigField("iconSize");T.append("g").append("rect").attr("id","node-"+G.id).attr("fill-opacity","0").attr("width",u).attr("height",u),T.attr("class","architecture-junction");const{width:l,height:o}=T._groups[0][0].getBBox();T.width=l,T.height=o,D.setElementForId(G.id,T)})},"drawJunctions");oi([{name:ne.prefix,icons:ne}]),Oe.use(yi);function Se(D,C,I){D.forEach(G=>{C.add({group:"nodes",data:{type:"service",id:G.id,icon:G.icon,label:G.title,parent:G.in,width:I.getConfigField("iconSize"),height:I.getConfigField("iconSize")},classes:"node-service"})})}pt(Se,"addServices");function Pe(D,C,I){D.forEach(G=>{C.add({group:"nodes",data:{type:"junction",id:G.id,parent:G.in,width:I.getConfigField("iconSize"),height:I.getConfigField("iconSize")},classes:"node-junction"})})}pt(Pe,"addJunctions");function Ue(D,C){C.nodes().map(I=>{const G=te(I);G.type!=="group"&&(G.x=I.position().x,G.y=I.position().y,D.getElementById(G.id).attr("transform","translate("+(G.x||0)+","+(G.y||0)+")"))})}pt(Ue,"positionNodes");function ke(D,C){D.forEach(I=>{C.add({group:"nodes",data:{type:"group",id:I.id,icon:I.icon,label:I.title,parent:I.in},classes:"node-group"})})}pt(ke,"addGroups");function Xe(D,C){D.forEach(I=>{const{lhsId:G,rhsId:T,lhsInto:u,lhsGroup:l,rhsInto:o,lhsDir:i,rhsDir:e,rhsGroup:a,title:r}=I,f=ye(I.lhsDir,I.rhsDir)?"segments":"straight",t={id:`${G}-${T}`,label:r,source:G,sourceDir:i,sourceArrow:u,sourceGroup:l,sourceEndpoint:i==="L"?"0 50%":i==="R"?"100% 50%":i==="T"?"50% 0":"50% 100%",target:T,targetDir:e,targetArrow:o,targetGroup:a,targetEndpoint:e==="L"?"0 50%":e==="R"?"100% 50%":e==="T"?"50% 0":"50% 100%"};C.add({group:"edges",data:t,classes:f})})}pt(Xe,"addEdges");function Ye(D,C,I){const G=pt((o,i)=>Object.entries(o).reduce((e,[a,r])=>{let f=0;const t=Object.entries(r);if(t.length===1)return e[a]=t[0][1],e;for(let s=0;s<t.length-1;s++)for(let h=s+1;h<t.length;h++){const[g,d]=t[s],[N,c]=t[h];if(I[g]?.[N]===i)e[a]??(e[a]=[]),e[a]=[...e[a],...d,...c];else if(g==="default"||N==="default")e[a]??(e[a]=[]),e[a]=[...e[a],...d,...c];else{const y=`${a}-${f++}`;e[y]=d;const A=`${a}-${f++}`;e[A]=c}}return e},{}),"flattenAlignments"),T=C.map(o=>{const i={},e={};return Object.entries(o).forEach(([a,[r,f]])=>{var s,h;const t=D.getNode(a)?.in??"default";i[f]??(i[f]={}),(s=i[f])[t]??(s[t]=[]),i[f][t].push(a),e[r]??(e[r]={}),(h=e[r])[t]??(h[t]=[]),e[r][t].push(a)}),{horiz:Object.values(G(i,"horizontal")).filter(a=>a.length>1),vert:Object.values(G(e,"vertical")).filter(a=>a.length>1)}}),[u,l]=T.reduce(([o,i],{horiz:e,vert:a})=>[[...o,...e],[...i,...a]],[[],[]]);return{horizontal:u,vertical:l}}pt(Ye,"getAlignments");function He(D,C){const I=[],G=pt(u=>`${u[0]},${u[1]}`,"posToStr"),T=pt(u=>u.split(",").map(l=>parseInt(l)),"strToPos");return D.forEach(u=>{const l=Object.fromEntries(Object.entries(u).map(([a,r])=>[G(r),a])),o=[G([0,0])],i={},e={L:[-1,0],R:[1,0],T:[0,1],B:[0,-1]};for(;o.length>0;){const a=o.shift();if(a){i[a]=1;const r=l[a];if(r){const f=T(a);Object.entries(e).forEach(([t,s])=>{const h=G([f[0]+s[0],f[1]+s[1]]),g=l[h];g&&!i[h]&&(o.push(h),I.push({[Ce[t]]:g,[Ce[Ei(t)]]:r,gap:1.5*C.getConfigField("iconSize")}))})}}}}),I}pt(He,"getRelativeConstraints");function We(D,C,I,G,T,{spatialMaps:u,groupAlignments:l}){return new Promise(o=>{const i=di("body").append("div").attr("id","cy").attr("style","display:none"),e=Oe({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"straight",label:"data(label)","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"edge.segments",style:{"curve-style":"segments","segment-weights":"0","segment-distances":[.5],"edge-distances":"endpoints","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"node",style:{"compound-sizing-wrt-labels":"include"}},{selector:"node[label]",style:{"text-valign":"bottom","text-halign":"center","font-size":`${T.getConfigField("fontSize")}px`}},{selector:".node-service",style:{label:"data(label)",width:"data(width)",height:"data(height)"}},{selector:".node-junction",style:{width:"data(width)",height:"data(height)"}},{selector:".node-group",style:{padding:`${T.getConfigField("padding")}px`}}],layout:{name:"grid",boundingBox:{x1:0,x2:100,y1:0,y2:100}}});i.remove(),ke(I,e),Se(D,e,T),Pe(C,e,T),Xe(G,e);const a=Ye(T,u,l),r=He(u,T),f=e.layout({name:"fcose",quality:"proof",styleEnabled:!1,animate:!1,nodeDimensionsIncludeLabels:!1,idealEdgeLength(t){const[s,h]=t.connectedNodes(),{parent:g}=te(s),{parent:d}=te(h);return g===d?1.5*T.getConfigField("iconSize"):.5*T.getConfigField("iconSize")},edgeElasticity(t){const[s,h]=t.connectedNodes(),{parent:g}=te(s),{parent:d}=te(h);return g===d?.45:.001},alignmentConstraint:a,relativePlacementConstraint:r});f.one("layoutstop",()=>{function t(s,h,g,d){let N,c;const{x:y,y:A}=s,{x:w,y:P}=h;c=(d-A+(y-g)*(A-P)/(y-w))/Math.sqrt(1+Math.pow((A-P)/(y-w),2)),N=Math.sqrt(Math.pow(d-A,2)+Math.pow(g-y,2)-Math.pow(c,2));const k=Math.sqrt(Math.pow(w-y,2)+Math.pow(P-A,2));N=N/k;let Y=(w-y)*(d-A)-(P-A)*(g-y);switch(!0){case Y>=0:Y=1;break;case Y<0:Y=-1;break}let H=(w-y)*(g-y)+(P-A)*(d-A);switch(!0){case H>=0:H=1;break;case H<0:H=-1;break}return c=Math.abs(c)*Y,N=N*H,{distances:c,weights:N}}pt(t,"getSegmentWeights"),e.startBatch();for(const s of Object.values(e.edges()))if(s.data?.()){const{x:h,y:g}=s.source().position(),{x:d,y:N}=s.target().position();if(h!==d&&g!==N){const c=s.sourceEndpoint(),y=s.targetEndpoint(),{sourceDir:A}=Re(s),[w,P]=Vt(A)?[c.x,y.y]:[y.x,c.y],{weights:k,distances:Y}=t(c,y,w,P);s.style("segment-distances",Y),s.style("segment-weights",k)}}e.endBatch(),f.run()}),f.run(),e.ready(t=>{be.info("Ready",t),o(e)})})}pt(We,"layoutArchitecture");var Fi=pt(async(D,C,I,G)=>{const T=G.db,u=T.getServices(),l=T.getJunctions(),o=T.getGroups(),i=T.getEdges(),e=T.getDataStructures(),a=Be(C),r=a.append("g");r.attr("class","architecture-edges");const f=a.append("g");f.attr("class","architecture-services");const t=a.append("g");t.attr("class","architecture-groups"),await Ri(T,f,u),Gi(T,f,l);const s=await We(u,l,o,i,T,e);await bi(r,s,T),await Oi(t,s,T),Ue(T,s),Ve(void 0,a,T.getConfigField("padding"),T.getConfigField("useMaxWidth"))},"draw"),Si={draw:Fi},an={parser:Fe,get db(){return new Ge},renderer:Si,styles:Di};export{an as diagram};
//# sourceMappingURL=architectureDiagram-VXUJARFQ-DiqBgp7x.chunk.mjs.map