38 lines
145 KiB
JavaScript
38 lines
145 KiB
JavaScript
import{_ as pt,K as ze,ac as Be,l as De,b as Ve,a as $e,q as je,t as qe,g as Ke,s as Ze,z as Je,F as Qe,G as ti,H as ei,c as pe,an as me,aI as de,i as ii,d as ni,y as ri,aJ as oi,aK as ai}from"./mermaid.core-DrJfu-9d.chunk.mjs";import{p as si}from"./chunk-4BX2VUAB-CXxCl32T.chunk.mjs";import{p as hi}from"./treemap-KMMF4GRG-BHT9xVli.chunk.mjs";import{c as be}from"./cytoscape.esm-jrxdzse9.chunk.mjs";import{g as li}from"./emoji-picker-MDCGxHB0.chunk.mjs";import"./index-CRQM6PVi.chunk.mjs";import"./NcLoadingIcon-ZJnsd-es.chunk.mjs";import"./vue.runtime.esm-CLeelJur.chunk.mjs";import"./index-DxwFe63_.chunk.mjs";import"./_baseUniq-pf37y4On.chunk.mjs";import"./_basePickBy-Dy1ViJhr.chunk.mjs";import"./clone-DchRqQR-.chunk.mjs";var ce={exports:{}},ge={exports:{}},ue={exports:{}},di=ue.exports,Ie;function ci(){return Ie||(Ie=1,function(w,H){(function(L,P){w.exports=P()})(di,function(){return function(L){var P={};function T(u){if(P[u])return P[u].exports;var h=P[u]={i:u,l:!1,exports:{}};return L[u].call(h.exports,h,h.exports,T),h.l=!0,h.exports}return T.m=L,T.c=P,T.i=function(u){return u},T.d=function(u,h,r){T.o(u,h)||Object.defineProperty(u,h,{configurable:!1,enumerable:!0,get:r})},T.n=function(u){var h=u&&u.__esModule?function(){return u.default}:function(){return u};return T.d(h,"a",h),h},T.o=function(u,h){return Object.prototype.hasOwnProperty.call(u,h)},T.p="",T(T.s=28)}([function(L,P,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,L.exports=u},function(L,P,T){var u=T(2),h=T(8),r=T(9);function i(a,o,f){u.call(this,f),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=f,this.bendpoints=[],this.source=a,this.target=o}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,o){for(var f=this.getOtherEnd(a),t=o.getGraphManager().getRoot();;){if(f.getOwner()==o)return f;if(f.getOwner()==t)break;f=f.getOwner().getParent()}return null},i.prototype.updateLength=function(){var a=new Array(4);this.isOverlapingSourceAndTarget=h.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=r.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=r.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=r.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=r.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},L.exports=i},function(L,P,T){function u(h){this.vGraphObject=h}L.exports=u},function(L,P,T){var u=T(2),h=T(10),r=T(13),i=T(0),e=T(16),a=T(5);function o(t,s,l,g){l==null&&g==null&&(g=s),u.call(this,g),t.graphManager!=null&&(t=t.graphManager),this.estimatedSize=h.MIN_VALUE,this.inclusionTreeDepth=h.MAX_VALUE,this.vGraphObject=g,this.edges=[],this.graphManager=t,l!=null&&s!=null?this.rect=new r(s.x,s.y,l.width,l.height):this.rect=new r}o.prototype=Object.create(u.prototype);for(var f in u)o[f]=u[f];o.prototype.getEdges=function(){return this.edges},o.prototype.getChild=function(){return this.child},o.prototype.getOwner=function(){return this.owner},o.prototype.getWidth=function(){return this.rect.width},o.prototype.setWidth=function(t){this.rect.width=t},o.prototype.getHeight=function(){return this.rect.height},o.prototype.setHeight=function(t){this.rect.height=t},o.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},o.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},o.prototype.getCenter=function(){return new a(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},o.prototype.getLocation=function(){return new a(this.rect.x,this.rect.y)},o.prototype.getRect=function(){return this.rect},o.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},o.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},o.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},o.prototype.setCenter=function(t,s){this.rect.x=t-this.rect.width/2,this.rect.y=s-this.rect.height/2},o.prototype.setLocation=function(t,s){this.rect.x=t,this.rect.y=s},o.prototype.moveBy=function(t,s){this.rect.x+=t,this.rect.y+=s},o.prototype.getEdgeListToNode=function(t){var s=[],l=this;return l.edges.forEach(function(g){if(g.target==t){if(g.source!=l)throw"Incorrect edge source!";s.push(g)}}),s},o.prototype.getEdgesBetween=function(t){var s=[],l=this;return l.edges.forEach(function(g){if(!(g.source==l||g.target==l))throw"Incorrect edge source and/or target";(g.target==t||g.source==t)&&s.push(g)}),s},o.prototype.getNeighborsList=function(){var t=new Set,s=this;return s.edges.forEach(function(l){if(l.source==s)t.add(l.target);else{if(l.target!=s)throw"Incorrect incidency!";t.add(l.source)}}),t},o.prototype.withChildren=function(){var t=new Set,s,l;if(t.add(this),this.child!=null)for(var g=this.child.getNodes(),d=0;d<g.length;d++)s=g[d],l=s.withChildren(),l.forEach(function(N){t.add(N)});return t},o.prototype.getNoOfChildren=function(){var t=0,s;if(this.child==null)t=1;else for(var l=this.child.getNodes(),g=0;g<l.length;g++)s=l[g],t+=s.getNoOfChildren();return t==0&&(t=1),t},o.prototype.getEstimatedSize=function(){if(this.estimatedSize==h.MIN_VALUE)throw"assert failed";return this.estimatedSize},o.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)},o.prototype.scatter=function(){var t,s,l=-i.INITIAL_WORLD_BOUNDARY,g=i.INITIAL_WORLD_BOUNDARY;t=i.WORLD_CENTER_X+e.nextDouble()*(g-l)+l;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},o.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(),l=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(l+this.labelHeight)):this.labelPosVertical=="center"&&this.labelHeight>l?(this.rect.y-=(this.labelHeight-l)/2,this.setHeight(this.labelHeight)):this.labelPosVertical=="bottom"&&this.setHeight(l+this.labelHeight))}}},o.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==h.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},o.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 l=this.rect.y;l>i.WORLD_BOUNDARY?l=i.WORLD_BOUNDARY:l<-i.WORLD_BOUNDARY&&(l=-i.WORLD_BOUNDARY);var g=new a(s,l),d=t.inverseTransformPoint(g);this.setLocation(d.x,d.y)},o.prototype.getLeft=function(){return this.rect.x},o.prototype.getRight=function(){return this.rect.x+this.rect.width},o.prototype.getTop=function(){return this.rect.y},o.prototype.getBottom=function(){return this.rect.y+this.rect.height},o.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},L.exports=o},function(L,P,T){var u=T(0);function h(){}for(var r in u)h[r]=u[r];h.MAX_ITERATIONS=2500,h.DEFAULT_EDGE_LENGTH=50,h.DEFAULT_SPRING_STRENGTH=.45,h.DEFAULT_REPULSION_STRENGTH=4500,h.DEFAULT_GRAVITY_STRENGTH=.4,h.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,h.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,h.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,h.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,h.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,h.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,h.COOLING_ADAPTATION_FACTOR=.33,h.ADAPTATION_LOWER_NODE_LIMIT=1e3,h.ADAPTATION_UPPER_NODE_LIMIT=5e3,h.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,h.MAX_NODE_DISPLACEMENT=h.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,h.MIN_REPULSION_DIST=h.DEFAULT_EDGE_LENGTH/10,h.CONVERGENCE_CHECK_PERIOD=100,h.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,h.MIN_EDGE_LENGTH=1,h.GRID_CALCULATION_CHECK_PERIOD=10,L.exports=h},function(L,P,T){function u(h,r){h==null&&r==null?(this.x=0,this.y=0):(this.x=h,this.y=r)}u.prototype.getX=function(){return this.x},u.prototype.getY=function(){return this.y},u.prototype.setX=function(h){this.x=h},u.prototype.setY=function(h){this.y=h},u.prototype.getDifference=function(h){return new DimensionD(this.x-h.x,this.y-h.y)},u.prototype.getCopy=function(){return new u(this.x,this.y)},u.prototype.translate=function(h){return this.x+=h.width,this.y+=h.height,this},L.exports=u},function(L,P,T){var u=T(2),h=T(10),r=T(0),i=T(7),e=T(3),a=T(1),o=T(13),f=T(12),t=T(11);function s(g,d,N){u.call(this,N),this.estimatedSize=h.MIN_VALUE,this.margin=r.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 l in u)s[l]=u[l];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 I=this.nodes.indexOf(d);if(I==-1)throw"Node not in owner node list!";this.nodes.splice(I,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 F=c.source.edges.indexOf(c),U=c.target.edges.indexOf(c);if(!(F>-1&&U>-1))throw"Source and/or target doesn't know this edge!";c.source.edges.splice(F,1),c.target!=c.source&&c.target.edges.splice(U,1);var I=c.source.owner.getEdges().indexOf(c);if(I==-1)throw"Not in owner's edge list!";c.source.owner.getEdges().splice(I,1)}},s.prototype.updateLeftTop=function(){for(var g=h.MAX_VALUE,d=h.MAX_VALUE,N,c,y,A=this.getNodes(),I=A.length,F=0;F<I;F++){var U=A[F];N=U.getTop(),c=U.getLeft(),g>N&&(g=N),d>c&&(d=c)}return g==h.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=h.MAX_VALUE,N=-h.MAX_VALUE,c=h.MAX_VALUE,y=-h.MAX_VALUE,A,I,F,U,X,Y=this.nodes,Z=Y.length,C=0;C<Z;C++){var rt=Y[C];g&&rt.child!=null&&rt.updateBounds(),A=rt.getLeft(),I=rt.getRight(),F=rt.getTop(),U=rt.getBottom(),d>A&&(d=A),N<I&&(N=I),c>F&&(c=F),y<U&&(y=U)}var n=new o(d,c,N-d,y-c);d==h.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),Y[0].getParent().paddingLeft!=null?X=Y[0].getParent().paddingLeft:X=this.margin,this.left=n.x-X,this.right=n.x+n.width+X,this.top=n.y-X,this.bottom=n.y+n.height+X},s.calculateBounds=function(g){for(var d=h.MAX_VALUE,N=-h.MAX_VALUE,c=h.MAX_VALUE,y=-h.MAX_VALUE,A,I,F,U,X=g.length,Y=0;Y<X;Y++){var Z=g[Y];A=Z.getLeft(),I=Z.getRight(),F=Z.getTop(),U=Z.getBottom(),d>A&&(d=A),N<I&&(N=I),c>F&&(c=F),y<U&&(y=U)}var C=new o(d,c,N-d,y-c);return C},s.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},s.prototype.getEstimatedSize=function(){if(this.estimatedSize==h.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=r.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,I=c.withChildren();for(I.forEach(function(C){d.push(C),N.add(C)});d.length!==0;){c=d.shift(),y=c.getEdges();for(var F=y.length,U=0;U<F;U++){var X=y[U];if(A=X.getOtherEndInGraph(c,this),A!=null&&!N.has(A)){var Y=A.withChildren();Y.forEach(function(C){d.push(C),N.add(C)})}}}if(this.isConnected=!1,N.size>=this.nodes.length){var Z=0;N.forEach(function(C){C.owner==g&&Z++}),Z==this.nodes.length&&(this.isConnected=!0)}},L.exports=s},function(L,P,T){var u,h=T(1);function r(i){u=T(6),this.layout=i,this.graphs=[],this.edges=[]}r.prototype.addRoot=function(){var i=this.layout.newGraph(),e=this.layout.newNode(null),a=this.add(i,e);return this.setRootGraph(a),this.rootGraph},r.prototype.add=function(i,e,a,o,f){if(a==null&&o==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,o=e,a=i;var t=o.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,o,f);if(a.isInterGraph=!0,a.source=o,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}},r.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 o,f=a.length,t=0;t<f;t++)o=a[t],e.remove(o);var s=[];s=s.concat(e.getNodes());var l;f=s.length;for(var t=0;t<f;t++)l=s[t],e.remove(l);e==this.rootGraph&&this.setRootGraph(null);var g=this.graphs.indexOf(e);this.graphs.splice(g,1),e.parent=null}else if(i instanceof h){if(o=i,o==null)throw"Edge is null!";if(!o.isInterGraph)throw"Not an inter-graph edge!";if(!(o.source!=null&&o.target!=null))throw"Source and/or target is null!";if(!(o.source.edges.indexOf(o)!=-1&&o.target.edges.indexOf(o)!=-1))throw"Source and/or target doesn't know this edge!";var g=o.source.edges.indexOf(o);if(o.source.edges.splice(g,1),g=o.target.edges.indexOf(o),o.target.edges.splice(g,1),!(o.source.owner!=null&&o.source.owner.getGraphManager()!=null))throw"Edge owner graph or owner graph manager is null!";if(o.source.owner.getGraphManager().edges.indexOf(o)==-1)throw"Not in owner graph manager's edge list!";var g=o.source.owner.getGraphManager().edges.indexOf(o);o.source.owner.getGraphManager().edges.splice(g,1)}},r.prototype.updateBounds=function(){this.rootGraph.updateBounds(!0)},r.prototype.getGraphs=function(){return this.graphs},r.prototype.getAllNodes=function(){if(this.allNodes==null){for(var i=[],e=this.getGraphs(),a=e.length,o=0;o<a;o++)i=i.concat(e[o].getNodes());this.allNodes=i}return this.allNodes},r.prototype.resetAllNodes=function(){this.allNodes=null},r.prototype.resetAllEdges=function(){this.allEdges=null},r.prototype.resetAllNodesToApplyGravitation=function(){this.allNodesToApplyGravitation=null},r.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},r.prototype.getAllNodesToApplyGravitation=function(){return this.allNodesToApplyGravitation},r.prototype.setAllNodesToApplyGravitation=function(i){if(this.allNodesToApplyGravitation!=null)throw"assert failed";this.allNodesToApplyGravitation=i},r.prototype.getRoot=function(){return this.rootGraph},r.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"))},r.prototype.getLayout=function(){return this.layout},r.prototype.isOneAncestorOfOther=function(i,e){if(!(i!=null&&e!=null))throw"assert failed";if(i==e)return!0;var a=i.getOwner(),o;do{if(o=a.getParent(),o==null)break;if(o==e)return!0;if(a=o.getOwner(),a==null)break}while(!0);a=e.getOwner();do{if(o=a.getParent(),o==null)break;if(o==i)return!0;if(a=o.getOwner(),a==null)break}while(!0);return!1},r.prototype.calcLowestCommonAncestors=function(){for(var i,e,a,o,f,t=this.getAllEdges(),s=t.length,l=0;l<s;l++){if(i=t[l],e=i.source,a=i.target,i.lca=null,i.sourceInLca=e,i.targetInLca=a,e==a){i.lca=e.getOwner();continue}for(o=e.getOwner();i.lca==null;){for(i.targetInLca=a,f=a.getOwner();i.lca==null;){if(f==o){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(o==this.rootGraph)break;i.lca==null&&(i.sourceInLca=o.getParent(),o=i.sourceInLca.getOwner())}if(i.lca==null)throw"assert failed"}},r.prototype.calcLowestCommonAncestor=function(i,e){if(i==e)return i.getOwner();var a=i.getOwner();do{if(a==null)break;var o=e.getOwner();do{if(o==null)break;if(o==a)return o;o=o.getParent().getOwner()}while(!0);a=a.getParent().getOwner()}while(!0);return a},r.prototype.calcInclusionTreeDepths=function(i,e){i==null&&e==null&&(i=this.rootGraph,e=1);for(var a,o=i.getNodes(),f=o.length,t=0;t<f;t++)a=o[t],a.inclusionTreeDepth=e,a.child!=null&&this.calcInclusionTreeDepths(a.child,e+1)},r.prototype.includesInvalidEdge=function(){for(var i,e=[],a=this.edges.length,o=0;o<a;o++)i=this.edges[o],this.isOneAncestorOfOther(i.source,i.target)&&e.push(i);for(var o=0;o<e.length;o++)this.remove(e[o]);return!1},L.exports=r},function(L,P,T){var u=T(12);function h(){}h.calcSeparationAmount=function(r,i,e,a){if(!r.intersects(i))throw"assert failed";var o=new Array(2);this.decideDirectionsForOverlappingNodes(r,i,o),e[0]=Math.min(r.getRight(),i.getRight())-Math.max(r.x,i.x),e[1]=Math.min(r.getBottom(),i.getBottom())-Math.max(r.y,i.y),r.getX()<=i.getX()&&r.getRight()>=i.getRight()?e[0]+=Math.min(i.getX()-r.getX(),r.getRight()-i.getRight()):i.getX()<=r.getX()&&i.getRight()>=r.getRight()&&(e[0]+=Math.min(r.getX()-i.getX(),i.getRight()-r.getRight())),r.getY()<=i.getY()&&r.getBottom()>=i.getBottom()?e[1]+=Math.min(i.getY()-r.getY(),r.getBottom()-i.getBottom()):i.getY()<=r.getY()&&i.getBottom()>=r.getBottom()&&(e[1]+=Math.min(r.getY()-i.getY(),i.getBottom()-r.getBottom()));var f=Math.abs((i.getCenterY()-r.getCenterY())/(i.getCenterX()-r.getCenterX()));i.getCenterY()===r.getCenterY()&&i.getCenterX()===r.getCenterX()&&(f=1);var t=f*e[0],s=e[1]/f;e[0]<s?s=e[0]:t=e[1],e[0]=-1*o[0]*(s/2+a),e[1]=-1*o[1]*(t/2+a)},h.decideDirectionsForOverlappingNodes=function(r,i,e){r.getCenterX()<i.getCenterX()?e[0]=-1:e[0]=1,r.getCenterY()<i.getCenterY()?e[1]=-1:e[1]=1},h.getIntersection2=function(r,i,e){var a=r.getCenterX(),o=r.getCenterY(),f=i.getCenterX(),t=i.getCenterY();if(r.intersects(i))return e[0]=a,e[1]=o,e[2]=f,e[3]=t,!0;var s=r.getX(),l=r.getY(),g=r.getRight(),d=r.getX(),N=r.getBottom(),c=r.getRight(),y=r.getWidthHalf(),A=r.getHeightHalf(),I=i.getX(),F=i.getY(),U=i.getRight(),X=i.getX(),Y=i.getBottom(),Z=i.getRight(),C=i.getWidthHalf(),rt=i.getHeightHalf(),n=!1,E=!1;if(a===f){if(o>t)return e[0]=a,e[1]=l,e[2]=f,e[3]=Y,!1;if(o<t)return e[0]=a,e[1]=N,e[2]=f,e[3]=F,!1}else if(o===t){if(a>f)return e[0]=s,e[1]=o,e[2]=U,e[3]=t,!1;if(a<f)return e[0]=g,e[1]=o,e[2]=I,e[3]=t,!1}else{var p=r.height/r.width,m=i.height/i.width,v=(t-o)/(f-a),b=void 0,M=void 0,x=void 0,S=void 0,k=void 0,B=void 0;if(-p===v?a>f?(e[0]=d,e[1]=N,n=!0):(e[0]=g,e[1]=l,n=!0):p===v&&(a>f?(e[0]=s,e[1]=l,n=!0):(e[0]=c,e[1]=N,n=!0)),-m===v?f>a?(e[2]=X,e[3]=Y,E=!0):(e[2]=U,e[3]=F,E=!0):m===v&&(f>a?(e[2]=I,e[3]=F,E=!0):(e[2]=Z,e[3]=Y,E=!0)),n&&E)return!1;if(a>f?o>t?(b=this.getCardinalDirection(p,v,4),M=this.getCardinalDirection(m,v,2)):(b=this.getCardinalDirection(-p,v,3),M=this.getCardinalDirection(-m,v,1)):o>t?(b=this.getCardinalDirection(-p,v,1),M=this.getCardinalDirection(-m,v,3)):(b=this.getCardinalDirection(p,v,2),M=this.getCardinalDirection(m,v,4)),!n)switch(b){case 1:S=l,x=a+-A/v,e[0]=x,e[1]=S;break;case 2:x=c,S=o+y*v,e[0]=x,e[1]=S;break;case 3:S=N,x=a+A/v,e[0]=x,e[1]=S;break;case 4:x=d,S=o+-y*v,e[0]=x,e[1]=S;break}if(!E)switch(M){case 1:B=F,k=f+-rt/v,e[2]=k,e[3]=B;break;case 2:k=Z,B=t+C*v,e[2]=k,e[3]=B;break;case 3:B=Y,k=f+rt/v,e[2]=k,e[3]=B;break;case 4:k=X,B=t+-C*v,e[2]=k,e[3]=B;break}}return!1},h.getCardinalDirection=function(r,i,e){return r>i?e:1+e%4},h.getIntersection=function(r,i,e,a){if(a==null)return this.getIntersection2(r,i,e);var o=r.x,f=r.y,t=i.x,s=i.y,l=e.x,g=e.y,d=a.x,N=a.y,c=void 0,y=void 0,A=void 0,I=void 0,F=void 0,U=void 0,X=void 0,Y=void 0,Z=void 0;return A=s-f,F=o-t,X=t*f-o*s,I=N-g,U=l-d,Y=d*g-l*N,Z=A*U-I*F,Z===0?null:(c=(F*Y-U*X)/Z,y=(I*X-A*Y)/Z,new u(c,y))},h.angleOfVector=function(r,i,e,a){var o=void 0;return r!==e?(o=Math.atan((a-i)/(e-r)),e<r?o+=Math.PI:a<i&&(o+=this.TWO_PI)):a<i?o=this.ONE_AND_HALF_PI:o=this.HALF_PI,o},h.doIntersect=function(r,i,e,a){var o=r.x,f=r.y,t=i.x,s=i.y,l=e.x,g=e.y,d=a.x,N=a.y,c=(t-o)*(N-g)-(d-l)*(s-f);if(c===0)return!1;var y=((N-g)*(d-o)+(l-d)*(N-f))/c,A=((f-s)*(d-o)+(t-o)*(N-f))/c;return 0<y&&y<1&&0<A&&A<1},h.findCircleLineIntersections=function(r,i,e,a,o,f,t){var s=(e-r)*(e-r)+(a-i)*(a-i),l=2*((r-o)*(e-r)+(i-f)*(a-i)),g=(r-o)*(r-o)+(i-f)*(i-f)-t*t,d=l*l-4*s*g;if(d>=0){var N=(-l+Math.sqrt(l*l-4*s*g))/(2*s),c=(-l-Math.sqrt(l*l-4*s*g))/(2*s),y=null;return N>=0&&N<=1?[N]:c>=0&&c<=1?[c]:y}else return null},h.HALF_PI=.5*Math.PI,h.ONE_AND_HALF_PI=1.5*Math.PI,h.TWO_PI=2*Math.PI,h.THREE_PI=3*Math.PI,L.exports=h},function(L,P,T){function u(){}u.sign=function(h){return h>0?1:h<0?-1:0},u.floor=function(h){return h<0?Math.ceil(h):Math.floor(h)},u.ceil=function(h){return h<0?Math.floor(h):Math.ceil(h)},L.exports=u},function(L,P,T){function u(){}u.MAX_VALUE=2147483647,u.MIN_VALUE=-2147483648,L.exports=u},function(L,P,T){var u=function(){function o(f,t){for(var s=0;s<t.length;s++){var l=t[s];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(f,l.key,l)}}return function(f,t,s){return t&&o(f.prototype,t),s&&o(f,s),f}}();function h(o,f){if(!(o instanceof f))throw new TypeError("Cannot call a class as a function")}var r=function(o){return{value:o,next:null,prev:null}},i=function(o,f,t,s){return o!==null?o.next=f:s.head=f,t!==null?t.prev=f:s.tail=f,f.prev=o,f.next=t,s.length++,f},e=function(o,f){var t=o.prev,s=o.next;return t!==null?t.next=s:f.head=s,s!==null?s.prev=t:f.tail=t,o.prev=o.next=null,f.length--,o},a=function(){function o(f){var t=this;h(this,o),this.length=0,this.head=null,this.tail=null,f?.forEach(function(s){return t.push(s)})}return u(o,[{key:"size",value:function(){return this.length}},{key:"insertBefore",value:function(f,t){return i(t.prev,r(f),t,this)}},{key:"insertAfter",value:function(f,t){return i(t,r(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,r(f),null,this)}},{key:"unshift",value:function(f){return i(null,r(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,l=this.head;s<f;)l=l.next,s++;l.value=t}}}]),o}();L.exports=a},function(L,P,T){function u(h,r,i){this.x=null,this.y=null,h==null&&r==null&&i==null?(this.x=0,this.y=0):typeof h=="number"&&typeof r=="number"&&i==null?(this.x=h,this.y=r):h.constructor.name=="Point"&&r==null&&i==null&&(i=h,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(h,r,i){h.constructor.name=="Point"&&r==null&&i==null?(i=h,this.setLocation(i.x,i.y)):typeof h=="number"&&typeof r=="number"&&i==null&&(parseInt(h)==h&&parseInt(r)==r?this.move(h,r):(this.x=Math.floor(h+.5),this.y=Math.floor(r+.5)))},u.prototype.move=function(h,r){this.x=h,this.y=r},u.prototype.translate=function(h,r){this.x+=h,this.y+=r},u.prototype.equals=function(h){if(h.constructor.name=="Point"){var r=h;return this.x==r.x&&this.y==r.y}return this==h},u.prototype.toString=function(){return new u().constructor.name+"[x="+this.x+",y="+this.y+"]"},L.exports=u},function(L,P,T){function u(h,r,i,e){this.x=0,this.y=0,this.width=0,this.height=0,h!=null&&r!=null&&i!=null&&e!=null&&(this.x=h,this.y=r,this.width=i,this.height=e)}u.prototype.getX=function(){return this.x},u.prototype.setX=function(h){this.x=h},u.prototype.getY=function(){return this.y},u.prototype.setY=function(h){this.y=h},u.prototype.getWidth=function(){return this.width},u.prototype.setWidth=function(h){this.width=h},u.prototype.getHeight=function(){return this.height},u.prototype.setHeight=function(h){this.height=h},u.prototype.getRight=function(){return this.x+this.width},u.prototype.getBottom=function(){return this.y+this.height},u.prototype.intersects=function(h){return!(this.getRight()<h.x||this.getBottom()<h.y||h.getRight()<this.x||h.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},L.exports=u},function(L,P,T){var u=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r};function h(){}h.lastID=0,h.createID=function(r){return h.isPrimitive(r)?r:(r.uniqueID!=null||(r.uniqueID=h.getString(),h.lastID++),r.uniqueID)},h.getString=function(r){return r==null&&(r=h.lastID),"Object#"+r},h.isPrimitive=function(r){var i=typeof r>"u"?"undefined":u(r);return r==null||i!="object"&&i!="function"},L.exports=h},function(L,P,T){function u(l){if(Array.isArray(l)){for(var g=0,d=Array(l.length);g<l.length;g++)d[g]=l[g];return d}else return Array.from(l)}var h=T(0),r=T(7),i=T(3),e=T(1),a=T(6),o=T(5),f=T(17),t=T(29);function s(l){t.call(this),this.layoutQuality=h.QUALITY,this.createBendsAsNeeded=h.DEFAULT_CREATE_BENDS_AS_NEEDED,this.incremental=h.DEFAULT_INCREMENTAL,this.animationOnLayout=h.DEFAULT_ANIMATION_ON_LAYOUT,this.animationDuringLayout=h.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=h.DEFAULT_ANIMATION_PERIOD,this.uniformLeafNodeSizes=h.DEFAULT_UNIFORM_LEAF_NODE_SIZES,this.edgeToDummyNodes=new Map,this.graphManager=new r(this),this.isLayoutFinished=!1,this.isSubLayout=!1,this.isRemoteUse=!1,l!=null&&(this.isRemoteUse=l)}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 l=new r(this);return this.graphManager=l,l},s.prototype.newGraph=function(l){return new a(null,this.graphManager,l)},s.prototype.newNode=function(l){return new i(this.graphManager,l)},s.prototype.newEdge=function(l){return new e(null,null,l)},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 l;return this.checkLayoutSuccess()?l=!1:l=this.layout(),h.ANIMATE==="during"?!1:(l&&(this.isSubLayout||this.doPostLayout()),this.tilingPostLayout&&this.tilingPostLayout(),this.isLayoutFinished=!0,l)},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 l=this.graphManager.getAllEdges(),g=0;g<l.length;g++)l[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(l){if(l==null)this.update2();else if(l instanceof i){var g=l;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(l instanceof e){var y=l;if(y.vGraphObject!=null){var A=y.vGraphObject;A.update(y)}}else if(l instanceof a){var I=l;if(I.vGraphObject!=null){var F=I.vGraphObject;F.update(I)}}},s.prototype.initParameters=function(){this.isSubLayout||(this.layoutQuality=h.QUALITY,this.animationDuringLayout=h.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=h.DEFAULT_ANIMATION_PERIOD,this.animationOnLayout=h.DEFAULT_ANIMATION_ON_LAYOUT,this.incremental=h.DEFAULT_INCREMENTAL,this.createBendsAsNeeded=h.DEFAULT_CREATE_BENDS_AS_NEEDED,this.uniformLeafNodeSizes=h.DEFAULT_UNIFORM_LEAF_NODE_SIZES),this.animationDuringLayout&&(this.animationOnLayout=!1)},s.prototype.transform=function(l){if(l==null)this.transform(new o(0,0));else{var g=new f,d=this.graphManager.getRoot().updateLeftTop();if(d!=null){g.setWorldOrgX(l.x),g.setWorldOrgY(l.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(l){if(l==null)this.positionNodesRandomly(this.getGraphManager().getRoot()),this.getGraphManager().getRoot().updateBounds(!0);else for(var g,d,N=l.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 l=[],g=!0,d=this.graphManager.getRoot().getNodes(),N=!0,c=0;c<d.length;c++)d[c].getChild()!=null&&(N=!1);if(!N)return l;var y=new Set,A=[],I=new Map,F=[];for(F=F.concat(d);F.length>0&&g;){for(A.push(F[0]);A.length>0&&g;){var U=A[0];A.splice(0,1),y.add(U);for(var X=U.getEdges(),c=0;c<X.length;c++){var Y=X[c].getOtherEnd(U);if(I.get(U)!=Y)if(!y.has(Y))A.push(Y),I.set(Y,U);else{g=!1;break}}}if(!g)l=[];else{var Z=[].concat(u(y));l.push(Z);for(var c=0;c<Z.length;c++){var C=Z[c],rt=F.indexOf(C);rt>-1&&F.splice(rt,1)}y=new Set,I=new Map}}return l},s.prototype.createDummyNodesForBendpoints=function(l){for(var g=[],d=l.source,N=this.graphManager.calcLowestCommonAncestor(l.source,l.target),c=0;c<l.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,l.target),this.edgeToDummyNodes.set(l,g),l.isInterGraph()?this.graphManager.remove(l):N.remove(l),g},s.prototype.createBendpointsFromDummyNodes=function(){var l=[];l=l.concat(this.graphManager.getAllEdges()),l=[].concat(u(this.edgeToDummyNodes.keys())).concat(l);for(var g=0;g<l.length;g++){var d=l[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 o(y.getCenterX(),y.getCenterY()),I=d.bendpoints.get(c);I.x=A.x,I.y=A.y,y.getOwner().remove(y)}this.graphManager.add(d,d.source,d.target)}}},s.transform=function(l,g,d,N){if(d!=null&&N!=null){var c=g;if(l<=50){var y=g/d;c-=(g-y)/50*(50-l)}else{var A=g*N;c+=(A-g)/50*(l-50)}return c}else{var I,F;return l<=50?(I=9*g/500,F=g/10):(I=9*g/50,F=-8*g),I*l+F}},s.findCenterOfTree=function(l){var g=[];g=g.concat(l);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 I=g[A],F=I.getNeighborsList().size;N.set(I,I.getNeighborsList().size),F==1&&d.push(I)}var U=[];for(U=U.concat(d);!c;){var X=[];X=X.concat(U),U=[];for(var A=0;A<g.length;A++){var I=g[A],Y=g.indexOf(I);Y>=0&&g.splice(Y,1);var Z=I.getNeighborsList();Z.forEach(function(n){if(d.indexOf(n)<0){var E=N.get(n),p=E-1;p==1&&U.push(n),N.set(n,p)}})}d=d.concat(U),(g.length==1||g.length==2)&&(c=!0,y=g[0])}return y},s.prototype.setGraphManager=function(l){this.graphManager=l},L.exports=s},function(L,P,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)},L.exports=u},function(L,P,T){var u=T(5);function h(r,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}h.prototype.getWorldOrgX=function(){return this.lworldOrgX},h.prototype.setWorldOrgX=function(r){this.lworldOrgX=r},h.prototype.getWorldOrgY=function(){return this.lworldOrgY},h.prototype.setWorldOrgY=function(r){this.lworldOrgY=r},h.prototype.getWorldExtX=function(){return this.lworldExtX},h.prototype.setWorldExtX=function(r){this.lworldExtX=r},h.prototype.getWorldExtY=function(){return this.lworldExtY},h.prototype.setWorldExtY=function(r){this.lworldExtY=r},h.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},h.prototype.setDeviceOrgX=function(r){this.ldeviceOrgX=r},h.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},h.prototype.setDeviceOrgY=function(r){this.ldeviceOrgY=r},h.prototype.getDeviceExtX=function(){return this.ldeviceExtX},h.prototype.setDeviceExtX=function(r){this.ldeviceExtX=r},h.prototype.getDeviceExtY=function(){return this.ldeviceExtY},h.prototype.setDeviceExtY=function(r){this.ldeviceExtY=r},h.prototype.transformX=function(r){var i=0,e=this.lworldExtX;return e!=0&&(i=this.ldeviceOrgX+(r-this.lworldOrgX)*this.ldeviceExtX/e),i},h.prototype.transformY=function(r){var i=0,e=this.lworldExtY;return e!=0&&(i=this.ldeviceOrgY+(r-this.lworldOrgY)*this.ldeviceExtY/e),i},h.prototype.inverseTransformX=function(r){var i=0,e=this.ldeviceExtX;return e!=0&&(i=this.lworldOrgX+(r-this.ldeviceOrgX)*this.lworldExtX/e),i},h.prototype.inverseTransformY=function(r){var i=0,e=this.ldeviceExtY;return e!=0&&(i=this.lworldOrgY+(r-this.ldeviceOrgY)*this.lworldExtY/e),i},h.prototype.inverseTransformPoint=function(r){var i=new u(this.inverseTransformX(r.x),this.inverseTransformY(r.y));return i},L.exports=h},function(L,P,T){function u(t){if(Array.isArray(t)){for(var s=0,l=Array(t.length);s<t.length;s++)l[s]=t[s];return l}else return Array.from(t)}var h=T(15),r=T(4),i=T(0),e=T(8),a=T(9);function o(){h.call(this),this.useSmartIdealEdgeLengthCalculation=r.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=r.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=r.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=r.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=r.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*r.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=r.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=r.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=r.MAX_ITERATIONS}o.prototype=Object.create(h.prototype);for(var f in h)o[f]=h[f];o.prototype.initParameters=function(){h.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=r.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},o.prototype.calcIdealEdgeLengths=function(){for(var t,s,l,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),l=t.getLca().getInclusionTreeDepth(),t.idealLength+=s*r.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR*(g.getInclusionTreeDepth()+d.getInclusionTreeDepth()-2*l))},o.prototype.initSpringEmbedder=function(){var t=this.getAllNodes().length;this.incremental?(t>r.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*r.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(t-r.ADAPTATION_LOWER_NODE_LIMIT)/(r.ADAPTATION_UPPER_NODE_LIMIT-r.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-r.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=r.MAX_NODE_DISPLACEMENT_INCREMENTAL):(t>r.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(r.COOLING_ADAPTATION_FACTOR,1-(t-r.ADAPTATION_LOWER_NODE_LIMIT)/(r.ADAPTATION_UPPER_NODE_LIMIT-r.ADAPTATION_LOWER_NODE_LIMIT)*(1-r.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=r.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.displacementThresholdPerNode=3*r.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},o.prototype.calcSpringForces=function(){for(var t=this.getAllEdges(),s,l=0;l<t.length;l++)s=t[l],this.calcSpringForce(s,s.idealLength)},o.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,l,g,d,N,c=this.getAllNodes(),y;if(this.useFRGridVariant)for(this.totalIterations%r.GRID_CALCULATION_CHECK_PERIOD==1&&t&&this.updateGrid(),y=new Set,l=0;l<c.length;l++)d=c[l],this.calculateRepulsionForceOfANode(d,y,t,s),y.add(d);else for(l=0;l<c.length;l++)for(d=c[l],g=l+1;g<c.length;g++)N=c[g],d.getOwner()==N.getOwner()&&this.calcRepulsionForce(d,N)},o.prototype.calcGravitationalForces=function(){for(var t,s=this.getAllNodesToApplyGravitation(),l=0;l<s.length;l++)t=s[l],this.calcGravitationalForce(t)},o.prototype.moveNodes=function(){for(var t=this.getAllNodes(),s,l=0;l<t.length;l++)s=t[l],s.move()},o.prototype.calcSpringForce=function(t,s){var l=t.getSource(),g=t.getTarget(),d,N,c,y;if(this.uniformLeafNodeSizes&&l.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),l.springForceX+=c,l.springForceY+=y,g.springForceX-=c,g.springForceY-=y)},o.prototype.calcRepulsionForce=function(t,s){var l=t.getRect(),g=s.getRect(),d=new Array(2),N=new Array(4),c,y,A,I,F,U,X;if(l.intersects(g)){e.calcSeparationAmount(l,g,d,r.DEFAULT_EDGE_LENGTH/2),U=2*d[0],X=2*d[1];var Y=t.noOfChildren*s.noOfChildren/(t.noOfChildren+s.noOfChildren);t.repulsionForceX-=Y*U,t.repulsionForceY-=Y*X,s.repulsionForceX+=Y*U,s.repulsionForceY+=Y*X}else this.uniformLeafNodeSizes&&t.getChild()==null&&s.getChild()==null?(c=g.getCenterX()-l.getCenterX(),y=g.getCenterY()-l.getCenterY()):(e.getIntersection(l,g,N),c=N[2]-N[0],y=N[3]-N[1]),Math.abs(c)<r.MIN_REPULSION_DIST&&(c=a.sign(c)*r.MIN_REPULSION_DIST),Math.abs(y)<r.MIN_REPULSION_DIST&&(y=a.sign(y)*r.MIN_REPULSION_DIST),A=c*c+y*y,I=Math.sqrt(A),F=(t.nodeRepulsion/2+s.nodeRepulsion/2)*t.noOfChildren*s.noOfChildren/A,U=F*c/I,X=F*y/I,t.repulsionForceX-=U,t.repulsionForceY-=X,s.repulsionForceX+=U,s.repulsionForceY+=X},o.prototype.calcGravitationalForce=function(t){var s,l,g,d,N,c,y,A;s=t.getOwner(),l=(s.getRight()+s.getLeft())/2,g=(s.getTop()+s.getBottom())/2,d=t.getCenterX()-l,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))},o.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},o.prototype.animate=function(){this.animationDuringLayout&&!this.isSubLayout&&(this.notAnimatedIterations==this.animationPeriod?(this.update(),this.notAnimatedIterations=0):this.notAnimatedIterations++)},o.prototype.calcNoOfChildrenForAllNodes=function(){for(var t,s=this.graphManager.getAllNodes(),l=0;l<s.length;l++)t=s[l],t.noOfChildren=t.getNoOfChildren()},o.prototype.calcGrid=function(t){var s=0,l=0;s=parseInt(Math.ceil((t.getRight()-t.getLeft())/this.repulsionRange)),l=parseInt(Math.ceil((t.getBottom()-t.getTop())/this.repulsionRange));for(var g=new Array(s),d=0;d<s;d++)g[d]=new Array(l);for(var d=0;d<s;d++)for(var N=0;N<l;N++)g[d][N]=new Array;return g},o.prototype.addNodeToGrid=function(t,s,l){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-l)/this.repulsionRange)),c=parseInt(Math.floor((t.getRect().height+t.getRect().y-l)/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)},o.prototype.updateGrid=function(){var t,s,l=this.getAllNodes();for(this.grid=this.calcGrid(this.graphManager.getRoot()),t=0;t<l.length;t++)s=l[t],this.addNodeToGrid(s,this.graphManager.getRoot().getLeft(),this.graphManager.getRoot().getTop())},o.prototype.calculateRepulsionForceOfANode=function(t,s,l,g){if(this.totalIterations%r.GRID_CALCULATION_CHECK_PERIOD==1&&l||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 I=0;I<c[y][A].length;I++)if(N=c[y][A][I],!(t.getOwner()!=N.getOwner()||t==N)&&!s.has(N)&&!d.has(N)){var F=Math.abs(t.getCenterX()-N.getCenterX())-(t.getWidth()/2+N.getWidth()/2),U=Math.abs(t.getCenterY()-N.getCenterY())-(t.getHeight()/2+N.getHeight()/2);F<=this.repulsionRange&&U<=this.repulsionRange&&d.add(N)}}t.surrounding=[].concat(u(d))}for(y=0;y<t.surrounding.length;y++)this.calcRepulsionForce(t,t.surrounding[y])},o.prototype.calcRepulsionRange=function(){return 0},L.exports=o},function(L,P,T){var u=T(1),h=T(4);function r(e,a,o){u.call(this,e,a,o),this.idealLength=h.DEFAULT_EDGE_LENGTH,this.edgeElasticity=h.DEFAULT_SPRING_STRENGTH}r.prototype=Object.create(u.prototype);for(var i in u)r[i]=u[i];L.exports=r},function(L,P,T){var u=T(3),h=T(4);function r(e,a,o,f){u.call(this,e,a,o,f),this.nodeRepulsion=h.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=[]}r.prototype=Object.create(u.prototype);for(var i in u)r[i]=u[i];r.prototype.setGridCoordinates=function(e,a,o,f){this.startX=e,this.finishX=a,this.startY=o,this.finishY=f},L.exports=r},function(L,P,T){function u(h,r){this.width=0,this.height=0,h!==null&&r!==null&&(this.height=r,this.width=h)}u.prototype.getWidth=function(){return this.width},u.prototype.setWidth=function(h){this.width=h},u.prototype.getHeight=function(){return this.height},u.prototype.setHeight=function(h){this.height=h},L.exports=u},function(L,P,T){var u=T(14);function h(){this.map={},this.keys=[]}h.prototype.put=function(r,i){var e=u.createID(r);this.contains(e)||(this.map[e]=i,this.keys.push(r))},h.prototype.contains=function(r){return u.createID(r),this.map[r]!=null},h.prototype.get=function(r){var i=u.createID(r);return this.map[i]},h.prototype.keySet=function(){return this.keys},L.exports=h},function(L,P,T){var u=T(14);function h(){this.set={}}h.prototype.add=function(r){var i=u.createID(r);this.contains(i)||(this.set[i]=r)},h.prototype.remove=function(r){delete this.set[u.createID(r)]},h.prototype.clear=function(){this.set={}},h.prototype.contains=function(r){return this.set[u.createID(r)]==r},h.prototype.isEmpty=function(){return this.size()===0},h.prototype.size=function(){return Object.keys(this.set).length},h.prototype.addAllTo=function(r){for(var i=Object.keys(this.set),e=i.length,a=0;a<e;a++)r.push(this.set[i[a]])},h.prototype.size=function(){return Object.keys(this.set).length},h.prototype.addAll=function(r){for(var i=r.length,e=0;e<i;e++){var a=r[e];this.add(a)}},L.exports=h},function(L,P,T){function u(){}u.multMat=function(h,r){for(var i=[],e=0;e<h.length;e++){i[e]=[];for(var a=0;a<r[0].length;a++){i[e][a]=0;for(var o=0;o<h[0].length;o++)i[e][a]+=h[e][o]*r[o][a]}}return i},u.transpose=function(h){for(var r=[],i=0;i<h[0].length;i++){r[i]=[];for(var e=0;e<h.length;e++)r[i][e]=h[e][i]}return r},u.multCons=function(h,r){for(var i=[],e=0;e<h.length;e++)i[e]=h[e]*r;return i},u.minusOp=function(h,r){for(var i=[],e=0;e<h.length;e++)i[e]=h[e]-r[e];return i},u.dotProduct=function(h,r){for(var i=0,e=0;e<h.length;e++)i+=h[e]*r[e];return i},u.mag=function(h){return Math.sqrt(this.dotProduct(h,h))},u.normalize=function(h){for(var r=[],i=this.mag(h),e=0;e<h.length;e++)r[e]=h[e]/i;return r},u.multGamma=function(h){for(var r=[],i=0,e=0;e<h.length;e++)i+=h[e];i*=-1/h.length;for(var a=0;a<h.length;a++)r[a]=i+h[a];return r},u.multL=function(h,r,i){for(var e=[],a=[],o=[],f=0;f<r[0].length;f++){for(var t=0,s=0;s<r.length;s++)t+=-.5*r[s][f]*h[s];a[f]=t}for(var l=0;l<i.length;l++){for(var g=0,d=0;d<i.length;d++)g+=i[l][d]*a[d];o[l]=g}for(var N=0;N<r.length;N++){for(var c=0,y=0;y<r[0].length;y++)c+=r[N][y]*o[y];e[N]=c}return e},L.exports=u},function(L,P,T){var u=function(){function e(a,o){for(var f=0;f<o.length;f++){var t=o[f];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(a,t.key,t)}}return function(a,o,f){return o&&e(a.prototype,o),f&&e(a,f),a}}();function h(e,a){if(!(e instanceof a))throw new TypeError("Cannot call a class as a function")}var r=T(11),i=function(){function e(a,o){h(this,e),(o!==null||o!==void 0)&&(this.compareFunction=this._defaultCompareFunction);var f=void 0;a instanceof r?f=a.size():f=a.length,this._quicksort(a,0,f-1)}return u(e,[{key:"_quicksort",value:function(a,o,f){if(o<f){var t=this._partition(a,o,f);this._quicksort(a,o,t),this._quicksort(a,t+1,f)}}},{key:"_partition",value:function(a,o,f){for(var t=this._get(a,o),s=o,l=f;;){for(;this.compareFunction(t,this._get(a,l));)l--;for(;this.compareFunction(this._get(a,s),t);)s++;if(s<l)this._swap(a,s,l),s++,l--;else return l}}},{key:"_get",value:function(a,o){return a instanceof r?a.get_object_at(o):a[o]}},{key:"_set",value:function(a,o,f){a instanceof r?a.set_object_at(o,f):a[o]=f}},{key:"_swap",value:function(a,o,f){var t=this._get(a,o);this._set(a,o,this._get(a,f)),this._set(a,f,t)}},{key:"_defaultCompareFunction",value:function(a,o){return o>a}}]),e}();L.exports=i},function(L,P,T){function u(){}u.svd=function(h){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=h.length,this.n=h[0].length;var r=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,r]),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,o=Math.min(this.m-1,this.n),f=Math.max(0,Math.min(this.n-2,this.m)),t=0;t<Math.max(o,f);t++){if(t<o){this.s[t]=0;for(var s=t;s<this.m;s++)this.s[t]=u.hypot(this.s[t],h[s][t]);if(this.s[t]!==0){h[t][t]<0&&(this.s[t]=-this.s[t]);for(var l=t;l<this.m;l++)h[l][t]/=this.s[t];h[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<o,this.s[t]!==0)){for(var d=0,N=t;N<this.m;N++)d+=h[N][t]*h[N][g];d=-d/h[t][t];for(var c=t;c<this.m;c++)h[c][g]+=d*h[c][t]}i[g]=h[t][g]}if(function(It,Tt){return Tt}(a,t<o))for(var y=t;y<this.m;y++)this.U[y][t]=h[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 I=t+1;I<this.n;I++)i[I]/=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 F=t+1;F<this.m;F++)e[F]=0;for(var U=t+1;U<this.n;U++)for(var X=t+1;X<this.m;X++)e[X]+=i[U]*h[X][U];for(var Y=t+1;Y<this.n;Y++)for(var Z=-i[Y]/i[t+1],C=t+1;C<this.m;C++)h[C][Y]+=Z*e[C]}for(var rt=t+1;rt<this.n;rt++)this.V[rt][t]=i[rt]}}var n=Math.min(this.n,this.m+1);o<this.n&&(this.s[o]=h[o][o]),this.m<n&&(this.s[n-1]=0),f+1<n&&(i[f]=h[f][n-1]),i[n-1]=0;{for(var E=o;E<r;E++){for(var p=0;p<this.m;p++)this.U[p][E]=0;this.U[E][E]=1}for(var m=o-1;m>=0;m--)if(this.s[m]!==0){for(var v=m+1;v<r;v++){for(var b=0,M=m;M<this.m;M++)b+=this.U[M][m]*this.U[M][v];b=-b/this.U[m][m];for(var x=m;x<this.m;x++)this.U[x][v]+=b*this.U[x][m]}for(var S=m;S<this.m;S++)this.U[S][m]=-this.U[S][m];this.U[m][m]=1+this.U[m][m];for(var k=0;k<m-1;k++)this.U[k][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<r;W++){for(var q=0,G=z+1;G<this.n;G++)q+=this.V[G][z]*this.V[G][W];q=-q/this.V[z+1][z];for(var D=z+1;D<this.n;D++)this.V[D][W]+=q*this.V[D][z]}for(var R=0;R<this.n;R++)this.V[R][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,_=this.s[n-2]/Bt,O=i[n-2]/Bt,V=this.s[$]/Bt,J=i[$]/Bt,K=((_+dt)*(_-dt)+O*O)/2,ft=dt*O*(dt*O),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(h,r){var i=void 0;return Math.abs(h)>Math.abs(r)?(i=r/h,i=Math.abs(h)*Math.sqrt(1+i*i)):r!=0?(i=h/r,i=Math.abs(r)*Math.sqrt(1+i*i)):i=0,i},L.exports=u},function(L,P,T){var u=function(){function i(e,a){for(var o=0;o<a.length;o++){var f=a[o];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(e,f.key,f)}}return function(e,a,o){return a&&i(e.prototype,a),o&&i(e,o),e}}();function h(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}var r=function(){function i(e,a){var o=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;h(this,i),this.sequence1=e,this.sequence2=a,this.match_score=o,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 l=0;l<this.jMax;l++)this.grid[s][l]=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 o=1;o<this.iMax;o++)for(var f=1;f<this.jMax;f++){var t=void 0;this.sequence1[o-1]===this.sequence2[f-1]?t=this.grid[o-1][f-1]+this.match_score:t=this.grid[o-1][f-1]+this.mismatch_penalty;var s=this.grid[o-1][f]+this.gap_penalty,l=this.grid[o][f-1]+this.gap_penalty,g=[t,s,l],d=this.arrayAllMaxIndexes(g);this.grid[o][f]=g[d[0]],this.tracebackGrid[o][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],o=this.tracebackGrid[a.pos[0]][a.pos[1]];o[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}),o[1]&&e.push({pos:[a.pos[0]-1,a.pos[1]],seq1:this.sequence1[a.pos[0]-1]+a.seq1,seq2:"-"+a.seq2}),o[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 o=[],f=-1;(f=e.indexOf(a,f+1))!==-1;)o.push(f);return o}},{key:"arrayAllMaxIndexes",value:function(e){return this.getAllIndexes(e,Math.max.apply(null,e))}}]),i}();L.exports=r},function(L,P,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),L.exports=u},function(L,P,T){function u(){this.listeners=[]}var h=u.prototype;h.addListener=function(r,i){this.listeners.push({event:r,callback:i})},h.removeListener=function(r,i){for(var e=this.listeners.length;e>=0;e--){var a=this.listeners[e];a.event===r&&a.callback===i&&this.listeners.splice(e,1)}},h.emit=function(r,i){for(var e=0;e<this.listeners.length;e++){var a=this.listeners[e];r===a.event&&a.callback(i)}},L.exports=u}])})}(ue)),ue.exports}var gi=ge.exports,Le;function ui(){return Le||(Le=1,function(w,H){(function(L,P){w.exports=P(ci())})(gi,function(L){return(()=>{var P={45:(r,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),r.exports=a},806:(r,i,e)=>{var a=e(551).FDLayoutConstants;function o(){}for(var f in a)o[f]=a[f];o.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,o.DEFAULT_RADIAL_SEPARATION=a.DEFAULT_EDGE_LENGTH,o.DEFAULT_COMPONENT_SEPERATION=60,o.TILE=!0,o.TILING_PADDING_VERTICAL=10,o.TILING_PADDING_HORIZONTAL=10,o.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,o.ENFORCE_CONSTRAINTS=!0,o.APPLY_LAYOUT=!0,o.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,o.TREE_REDUCTION_ON_INCREMENTAL=!0,o.PURE_INCREMENTAL=o.DEFAULT_INCREMENTAL,r.exports=o},767:(r,i,e)=>{var a=e(551).FDLayoutEdge;function o(t,s,l){a.call(this,t,s,l)}o.prototype=Object.create(a.prototype);for(var f in a)o[f]=a[f];r.exports=o},880:(r,i,e)=>{var a=e(551).LGraph;function o(t,s,l){a.call(this,t,s,l)}o.prototype=Object.create(a.prototype);for(var f in a)o[f]=a[f];r.exports=o},578:(r,i,e)=>{var a=e(551).LGraphManager;function o(t){a.call(this,t)}o.prototype=Object.create(a.prototype);for(var f in a)o[f]=a[f];r.exports=o},765:(r,i,e)=>{var a=e(551).FDLayout,o=e(578),f=e(880),t=e(991),s=e(767),l=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,I=e(551).Layout,F=e(551).Integer,U=e(551).IGeometry,X=e(551).LGraph,Y=e(551).Transform,Z=e(551).LinkedList;function C(){a.call(this),this.toBeTiled={},this.constraints={}}C.prototype=Object.create(a.prototype);for(var rt in a)C[rt]=a[rt];C.prototype.newGraphManager=function(){var n=new o(this);return this.graphManager=n,n},C.prototype.newGraph=function(n){return new f(null,this.graphManager,n)},C.prototype.newNode=function(n){return new t(this.graphManager,n)},C.prototype.newEdge=function(n){return new s(null,null,n)},C.prototype.initParameters=function(){a.prototype.initParameters.call(this,arguments),this.isSubLayout||(l.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=l.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=l.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)},C.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},C.prototype.layout=function(){var n=N.DEFAULT_CREATE_BENDS_AS_NEEDED;return n&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},C.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(l.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(b){return n.has(b)});this.graphManager.setAllNodesToApplyGravitation(E),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(g.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),l.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},C.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(),l.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()),l.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},C.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},C.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()}},C.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()},C.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 D(R){for(var j=R.getChild().getNodes(),et,mt=0,$=0;$<j.length;$++)et=j[$],et.getChild()==null?n.fixedNodeSet.has(et.id)&&(mt+=100):mt+=D(et);return mt};if(this.constraints.fixedNodeConstraint){this.constraints.fixedNodeConstraint.forEach(function(D){n.fixedNodeSet.add(D.nodeId)});for(var E=this.graphManager.getAllNodes(),m,p=0;p<E.length;p++)if(m=E[p],m.getChild()!=null){var b=v(m);b>0&&(m.fixedNodeWeight=b)}}if(this.constraints.relativePlacementConstraint){var M=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(D){n.fixedNodesOnHorizontal.add(D),n.fixedNodesOnVertical.add(D)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var S=this.constraints.alignmentConstraint.vertical,p=0;p<S.length;p++)this.dummyToNodeForVerticalAlignment.set("dummy"+p,[]),S[p].forEach(function(R){M.set(R,"dummy"+p),n.dummyToNodeForVerticalAlignment.get("dummy"+p).push(R),n.fixedNodeSet.has(R)&&n.fixedNodesOnHorizontal.add("dummy"+p)});if(this.constraints.alignmentConstraint.horizontal)for(var k=this.constraints.alignmentConstraint.horizontal,p=0;p<k.length;p++)this.dummyToNodeForHorizontalAlignment.set("dummy"+p,[]),k[p].forEach(function(R){x.set(R,"dummy"+p),n.dummyToNodeForHorizontalAlignment.get("dummy"+p).push(R),n.fixedNodeSet.has(R)&&n.fixedNodesOnVertical.add("dummy"+p)})}if(l.RELAX_MOVEMENT_ON_CONSTRAINTS)this.shuffle=function(D){var R,j,et;for(et=D.length-1;et>=2*D.length/3;et--)R=Math.floor(Math.random()*(et+1)),j=D[et],D[et]=D[R],D[R]=j;return D},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(D){if(D.left){var R=M.has(D.left)?M.get(D.left):D.left,j=M.has(D.right)?M.get(D.right):D.right;n.nodesInRelativeHorizontal.includes(R)||(n.nodesInRelativeHorizontal.push(R),n.nodeToRelativeConstraintMapHorizontal.set(R,[]),n.dummyToNodeForVerticalAlignment.has(R)?n.nodeToTempPositionMapHorizontal.set(R,n.idToNodeMap.get(n.dummyToNodeForVerticalAlignment.get(R)[0]).getCenterX()):n.nodeToTempPositionMapHorizontal.set(R,n.idToNodeMap.get(R).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(R).push({right:j,gap:D.gap}),n.nodeToRelativeConstraintMapHorizontal.get(j).push({left:R,gap:D.gap})}else{var et=x.has(D.top)?x.get(D.top):D.top,mt=x.has(D.bottom)?x.get(D.bottom):D.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:D.gap}),n.nodeToRelativeConstraintMapVertical.get(mt).push({top:et,gap:D.gap})}});else{var B=new Map,z=new Map;this.constraints.relativePlacementConstraint.forEach(function(D){if(D.left){var R=M.has(D.left)?M.get(D.left):D.left,j=M.has(D.right)?M.get(D.right):D.right;B.has(R)?B.get(R).push(j):B.set(R,[j]),B.has(j)?B.get(j).push(R):B.set(j,[R])}else{var et=x.has(D.top)?x.get(D.top):D.top,mt=x.has(D.bottom)?x.get(D.bottom):D.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(D,R){var j=[],et=[],mt=new Z,$=new Set,xt=0;return D.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(),R.has(vt)&&(et[xt]=!0);var st=D.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 G=W(z,n.fixedNodesOnVertical);this.componentsOnVertical=G.components,this.fixedComponentsOnVertical=G.isFixed}}},C.prototype.updateDisplacements=function(){var n=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function(G){var D=n.idToNodeMap.get(G.nodeId);D.displacementX=0,D.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 b=m/E[p].length,v=0;v<E[p].length;v++)this.idToNodeMap.get(E[p][v]).displacementX=b}if(this.constraints.alignmentConstraint.horizontal)for(var M=this.constraints.alignmentConstraint.horizontal,p=0;p<M.length;p++){for(var x=0,v=0;v<M[p].length;v++){if(this.fixedNodeSet.has(M[p][v])){x=0;break}x+=this.idToNodeMap.get(M[p][v]).displacementY}for(var S=x/M[p].length,v=0;v<M[p].length;v++)this.idToNodeMap.get(M[p][v]).displacementY=S}}if(this.constraints.relativePlacementConstraint)if(l.RELAX_MOVEMENT_ON_CONSTRAINTS)this.totalIterations%10==0&&(this.shuffle(this.nodesInRelativeHorizontal),this.shuffle(this.nodesInRelativeVertical)),this.nodesInRelativeHorizontal.forEach(function(G){if(!n.fixedNodesOnHorizontal.has(G)){var D=0;n.dummyToNodeForVerticalAlignment.has(G)?D=n.idToNodeMap.get(n.dummyToNodeForVerticalAlignment.get(G)[0]).displacementX:D=n.idToNodeMap.get(G).displacementX,n.nodeToRelativeConstraintMapHorizontal.get(G).forEach(function(R){if(R.right){var j=n.nodeToTempPositionMapHorizontal.get(R.right)-n.nodeToTempPositionMapHorizontal.get(G)-D;j<R.gap&&(D-=R.gap-j)}else{var j=n.nodeToTempPositionMapHorizontal.get(G)-n.nodeToTempPositionMapHorizontal.get(R.left)+D;j<R.gap&&(D+=R.gap-j)}}),n.nodeToTempPositionMapHorizontal.set(G,n.nodeToTempPositionMapHorizontal.get(G)+D),n.dummyToNodeForVerticalAlignment.has(G)?n.dummyToNodeForVerticalAlignment.get(G).forEach(function(R){n.idToNodeMap.get(R).displacementX=D}):n.idToNodeMap.get(G).displacementX=D}}),this.nodesInRelativeVertical.forEach(function(G){if(!n.fixedNodesOnHorizontal.has(G)){var D=0;n.dummyToNodeForHorizontalAlignment.has(G)?D=n.idToNodeMap.get(n.dummyToNodeForHorizontalAlignment.get(G)[0]).displacementY:D=n.idToNodeMap.get(G).displacementY,n.nodeToRelativeConstraintMapVertical.get(G).forEach(function(R){if(R.bottom){var j=n.nodeToTempPositionMapVertical.get(R.bottom)-n.nodeToTempPositionMapVertical.get(G)-D;j<R.gap&&(D-=R.gap-j)}else{var j=n.nodeToTempPositionMapVertical.get(G)-n.nodeToTempPositionMapVertical.get(R.top)+D;j<R.gap&&(D+=R.gap-j)}}),n.nodeToTempPositionMapVertical.set(G,n.nodeToTempPositionMapVertical.get(G)+D),n.dummyToNodeForHorizontalAlignment.has(G)?n.dummyToNodeForHorizontalAlignment.get(G).forEach(function(R){n.idToNodeMap.get(R).displacementY=D}):n.idToNodeMap.get(G).displacementY=D}});else{for(var p=0;p<this.componentsOnHorizontal.length;p++){var k=this.componentsOnHorizontal[p];if(this.fixedComponentsOnHorizontal[p])for(var v=0;v<k.length;v++)this.dummyToNodeForVerticalAlignment.has(k[v])?this.dummyToNodeForVerticalAlignment.get(k[v]).forEach(function(R){n.idToNodeMap.get(R).displacementX=0}):this.idToNodeMap.get(k[v]).displacementX=0;else{for(var B=0,z=0,v=0;v<k.length;v++)if(this.dummyToNodeForVerticalAlignment.has(k[v])){var W=this.dummyToNodeForVerticalAlignment.get(k[v]);B+=W.length*this.idToNodeMap.get(W[0]).displacementX,z+=W.length}else B+=this.idToNodeMap.get(k[v]).displacementX,z++;for(var q=B/z,v=0;v<k.length;v++)this.dummyToNodeForVerticalAlignment.has(k[v])?this.dummyToNodeForVerticalAlignment.get(k[v]).forEach(function(R){n.idToNodeMap.get(R).displacementX=q}):this.idToNodeMap.get(k[v]).displacementX=q}}for(var p=0;p<this.componentsOnVertical.length;p++){var k=this.componentsOnVertical[p];if(this.fixedComponentsOnVertical[p])for(var v=0;v<k.length;v++)this.dummyToNodeForHorizontalAlignment.has(k[v])?this.dummyToNodeForHorizontalAlignment.get(k[v]).forEach(function(j){n.idToNodeMap.get(j).displacementY=0}):this.idToNodeMap.get(k[v]).displacementY=0;else{for(var B=0,z=0,v=0;v<k.length;v++)if(this.dummyToNodeForHorizontalAlignment.has(k[v])){var W=this.dummyToNodeForHorizontalAlignment.get(k[v]);B+=W.length*this.idToNodeMap.get(W[0]).displacementY,z+=W.length}else B+=this.idToNodeMap.get(k[v]).displacementY,z++;for(var q=B/z,v=0;v<k.length;v++)this.dummyToNodeForHorizontalAlignment.has(k[v])?this.dummyToNodeForHorizontalAlignment.get(k[v]).forEach(function(et){n.idToNodeMap.get(et).displacementY=q}):this.idToNodeMap.get(k[v]).displacementY=q}}}},C.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},C.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(),b=m.getTarget();if(v==b)m.getBendpoints().push(new y),m.getBendpoints().push(new y),this.createDummyNodesForBendpoints(m),E.add(m);else{var M=[];if(M=M.concat(v.getEdgeListToNode(b)),M=M.concat(b.getEdgeListToNode(v)),!E.has(M[0])){if(M.length>1){var x;for(x=0;x<M.length;x++){var S=M[x];S.getBendpoints().push(new y),this.createDummyNodesForBendpoints(S)}}M.forEach(function(k){E.add(k)})}}}if(E.size==n.length)break}},C.prototype.positionNodesRadially=function(n){for(var E=new c(0,0),p=Math.ceil(Math.sqrt(n.length)),m=0,v=0,b=0,M=new y(0,0),x=0;x<n.length;x++){x%p==0&&(b=0,v=m,x!=0&&(v+=l.DEFAULT_COMPONENT_SEPERATION),m=0);var S=n[x],k=I.findCenterOfTree(S);E.x=b,E.y=v,M=C.radialLayout(S,k,E),M.y>m&&(m=Math.floor(M.y)),b=Math.floor(M.x+l.DEFAULT_COMPONENT_SEPERATION)}this.transform(new y(N.WORLD_CENTER_X-M.x/2,N.WORLD_CENTER_Y-M.y/2))},C.radialLayout=function(n,E,p){var m=Math.max(this.maxDiagonalInTree(n),l.DEFAULT_RADIAL_SEPARATION);C.branchRadialLayout(E,null,0,359,0,m);var v=X.calculateBounds(n),b=new Y;b.setDeviceOrgX(v.getMinX()),b.setDeviceOrgY(v.getMinY()),b.setWorldOrgX(p.x),b.setWorldOrgY(p.y);for(var M=0;M<n.length;M++){var x=n[M];x.transform(b)}var S=new y(v.getMaxX(),v.getMaxY());return b.inverseTransformPoint(S)},C.branchRadialLayout=function(n,E,p,m,v,b){var M=(m-p+1)/2;M<0&&(M+=180);var x=(M+p)%360,S=x*U.TWO_PI/360,k=v*Math.cos(S),B=v*Math.sin(S);n.setCenter(k,B);var z=[];z=z.concat(n.getEdges());var W=z.length;E!=null&&W--;for(var q=0,G=z.length,D,R=n.getEdgesBetween(E);R.length>1;){var j=R[0];R.splice(0,1);var et=z.indexOf(j);et>=0&&z.splice(et,1),G--,W--}E!=null?D=(z.indexOf(R[0])+1)%G:D=0;for(var mt=Math.abs(m-p)/W,$=D;q!=W;$=++$%G){var xt=z[$].getOtherEnd(n);if(xt!=E){var Q=(p+q*mt)%360,nt=(Q+mt)%360;C.branchRadialLayout(xt,n,Q,nt,v+b,b),q++}}},C.maxDiagonalInTree=function(n){for(var E=F.MIN_VALUE,p=0;p<n.length;p++){var m=n[p],v=m.getDiagonal();v>E&&(E=v)}return E},C.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},C.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 b=m[v],M=b.getParent();this.getNodeDegreeWithChildren(b)===0&&(M.id==null||!this.getToBeTiled(M))&&p.push(b)}for(var v=0;v<p.length;v++){var b=p[v],x=b.getParent().id;typeof E[x]>"u"&&(E[x]=[]),E[x]=E[x].concat(b)}Object.keys(E).forEach(function(S){if(E[S].length>1){var k="DummyCompound_"+S;n.memberGroups[k]=E[S];var B=E[S][0].getParent(),z=new t(n.graphManager);z.id=k,z.paddingLeft=B.paddingLeft||0,z.paddingRight=B.paddingRight||0,z.paddingBottom=B.paddingBottom||0,z.paddingTop=B.paddingTop||0,n.idToDummyNode[k]=z;var W=n.getGraphManager().add(n.newGraph(),z),q=B.getChild();q.add(z);for(var G=0;G<E[S].length;G++){var D=E[S][G];q.remove(D),W.add(D)}}})},C.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)},C.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,l.NODE_DIMENSIONS_INCLUDE_LABELS){var v=m.rect.width,b=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(b+m.labelHeight),m.labelMarginTop=m.labelHeight):m.labelPosVertical=="center"&&m.labelHeight>b?(m.rect.y-=(m.labelHeight-b)/2,m.setHeight(m.labelHeight),m.labelMarginTop=(m.labelHeight-b)/2):m.labelPosVertical=="bottom"&&m.setHeight(b+m.labelHeight))}})},C.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,b=E.labelMarginLeft,M=E.labelMarginTop;this.adjustLocations(this.tiledMemberPack[p],E.rect.x,E.rect.y,m,v,b,M)}},C.prototype.repopulateZeroDegreeMembers=function(){var n=this,E=this.tiledZeroDegreePack;Object.keys(E).forEach(function(p){var m=n.idToDummyNode[p],v=m.paddingLeft,b=m.paddingTop,M=m.labelMarginLeft,x=m.labelMarginTop;n.adjustLocations(E[p],m.rect.x,m.rect.y,v,b,M,x)})},C.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 b=m[v];if(this.getNodeDegree(b)>0)return this.toBeTiled[E]=!1,!1;if(b.getChild()==null){this.toBeTiled[b.id]=!1;continue}if(!this.getToBeTiled(b))return this.toBeTiled[E]=!1,!1}return this.toBeTiled[E]=!0,!0},C.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},C.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},C.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},C.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)}},C.prototype.adjustLocations=function(n,E,p,m,v,b,M){E+=m+b,p+=v+M;for(var x=E,S=0;S<n.rows.length;S++){var k=n.rows[S];E=x;for(var B=0,z=0;z<k.length;z++){var W=k[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}},C.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,l.NODE_DIMENSIONS_INCLUDE_LABELS){var b=v.rect.width,M=v.rect.height;v.labelWidth&&(v.labelPosHorizontal=="left"?(v.rect.x-=v.labelWidth,v.setWidth(b+v.labelWidth),v.labelMarginLeft=v.labelWidth):v.labelPosHorizontal=="center"&&v.labelWidth>b?(v.rect.x-=(v.labelWidth-b)/2,v.setWidth(v.labelWidth),v.labelMarginLeft=(v.labelWidth-b)/2):v.labelPosHorizontal=="right"&&v.setWidth(b+v.labelWidth)),v.labelHeight&&(v.labelPosVertical=="top"?(v.rect.y-=v.labelHeight,v.setHeight(M+v.labelHeight),v.labelMarginTop=v.labelHeight):v.labelPosVertical=="center"&&v.labelHeight>M?(v.rect.y-=(v.labelHeight-M)/2,v.setHeight(v.labelHeight),v.labelMarginTop=(v.labelHeight-M)/2):v.labelPosVertical=="bottom"&&v.setHeight(M+v.labelHeight))}})},C.prototype.tileNodes=function(n,E){var p=this.tileNodesByFavoringDim(n,E,!0),m=this.tileNodesByFavoringDim(n,E,!1),v=this.getOrgRatio(p),b=this.getOrgRatio(m),M;return b<v?M=m:M=p,M},C.prototype.getOrgRatio=function(n){var E=n.width,p=n.height,m=E/p;return m<1&&(m=1/m),m},C.prototype.calcIdealRowWidth=function(n,E){var p=l.TILING_PADDING_VERTICAL,m=l.TILING_PADDING_HORIZONTAL,v=n.length,b=0,M=0,x=0;n.forEach(function(G){b+=G.getWidth(),M+=G.getHeight(),G.getWidth()>x&&(x=G.getWidth())});var S=b/v,k=M/v,B=Math.pow(p-m,2)+4*(S+m)*(k+p)*v,z=(m-p+Math.sqrt(B))/(2*(S+m)),W;E?(W=Math.ceil(z),W==z&&W++):W=Math.floor(z);var q=W*(S+m)-m;return x>q&&(q=x),q+=m*2,q},C.prototype.tileNodesByFavoringDim=function(n,E,p){var m=l.TILING_PADDING_VERTICAL,v=l.TILING_PADDING_HORIZONTAL,b=l.TILING_COMPARE_BY,M={rows:[],rowWidth:[],rowHeight:[],width:0,height:E,verticalPadding:m,horizontalPadding:v,centerX:0,centerY:0};b&&(M.idealRowWidth=this.calcIdealRowWidth(n,p));var x=function(G){return G.rect.width*G.rect.height},S=function(G,D){return x(D)-x(G)};n.sort(function(G,D){var R=S;return M.idealRowWidth?(R=b,R(G.id,D.id)):R(G,D)});for(var k=0,B=0,z=0;z<n.length;z++){var W=n[z];k+=W.getCenterX(),B+=W.getCenterY()}M.centerX=k/n.length,M.centerY=B/n.length;for(var z=0;z<n.length;z++){var W=n[z];if(M.rows.length==0)this.insertNodeToRow(M,W,0,E);else if(this.canAddHorizontal(M,W.rect.width,W.rect.height)){var q=M.rows.length-1;M.idealRowWidth||(q=this.getShortestRowIndex(M)),this.insertNodeToRow(M,W,q,E)}else this.insertNodeToRow(M,W,M.rows.length,E);this.shiftToLastRow(M)}return M},C.prototype.insertNodeToRow=function(n,E,p,m){var v=m;if(p==n.rows.length){var b=[];n.rows.push(b),n.rowWidth.push(v),n.rowHeight.push(0)}var M=n.rowWidth[p]+E.rect.width;n.rows[p].length>0&&(M+=n.horizontalPadding),n.rowWidth[p]=M,n.width<M&&(n.width=M);var x=E.rect.height;p>0&&(x+=n.verticalPadding);var S=0;x>n.rowHeight[p]&&(S=n.rowHeight[p],n.rowHeight[p]=x,S=n.rowHeight[p]-S),n.height+=S,n.rows[p].push(E)},C.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},C.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},C.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 b=this.getShortestRowIndex(n);if(b<0)return!0;var M=n.rowWidth[b];if(M+n.horizontalPadding+E<=n.width)return!0;var x=0;n.rowHeight[b]<p&&b>0&&(x=p+n.verticalPadding-n.rowHeight[b]);var S;n.width-M>=E+n.horizontalPadding?S=(n.height+x)/(M+E+n.horizontalPadding):S=(n.height+x)/n.width,x=p+n.verticalPadding;var k;return n.width<E?k=(n.height+x)/E:k=(n.height+x)/n.width,k<1&&(k=1/k),S<1&&(S=1/S),S<k},C.prototype.shiftToLastRow=function(n){var E=this.getLongestRowIndex(n),p=n.rowWidth.length-1,m=n.rows[E],v=m[m.length-1],b=v.width+n.horizontalPadding;if(n.width-n.rowWidth[p]>b&&E!=p){m.splice(-1,1),n.rows[p].push(v),n.rowWidth[E]=n.rowWidth[E]-b,n.rowWidth[p]=n.rowWidth[p]+b,n.width=n.rowWidth[instance.getLongestRowIndex(n)];for(var M=Number.MIN_VALUE,x=0;x<m.length;x++)m[x].height>M&&(M=m[x].height);E>0&&(M+=n.verticalPadding);var S=n.rowHeight[E]+n.rowHeight[p];n.rowHeight[E]=M,n.rowHeight[p]<v.height+n.verticalPadding&&(n.rowHeight[p]=v.height+n.verticalPadding);var k=n.rowHeight[E]+n.rowHeight[p];n.height+=k-S,this.shiftToLastRow(n)}},C.prototype.tilingPreLayout=function(){l.TILE&&(this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers())},C.prototype.tilingPostLayout=function(){l.TILE&&(this.repopulateZeroDegreeMembers(),this.repopulateCompounds())},C.prototype.reduceTrees=function(){for(var n=[],E=!0,p;E;){var m=this.graphManager.getAllNodes(),v=[];E=!1;for(var b=0;b<m.length;b++)if(p=m[b],p.getEdges().length==1&&!p.getEdges()[0].isInterGraph&&p.getChild()==null){if(l.PURE_INCREMENTAL){var M=p.getEdges()[0].getOtherEnd(p),x=new A(p.getCenterX()-M.getCenterX(),p.getCenterY()-M.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 S=[],k=0;k<v.length;k++)v[k][0].getEdges().length==1&&(S.push(v[k]),v[k][0].getOwner().remove(v[k][0]));n.push(S),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=n},C.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()},C.prototype.findPlaceforPrunedNode=function(n){var E,p,m=n[0];if(m==n[1].source?p=n[1].target:p=n[1].source,l.PURE_INCREMENTAL)m.setCenter(p.getCenterX()+n[3].getWidth(),p.getCenterY()+n[3].getHeight());else{var v=p.startX,b=p.finishX,M=p.startY,x=p.finishY,S=0,k=0,B=0,z=0,W=[S,B,k,z];if(M>0)for(var q=v;q<=b;q++)W[0]+=this.grid[q][M-1].length+this.grid[q][M].length-1;if(b<this.grid.length-1)for(var q=M;q<=x;q++)W[1]+=this.grid[b+1][q].length+this.grid[b][q].length-1;if(x<this.grid[0].length-1)for(var q=v;q<=b;q++)W[2]+=this.grid[q][x+1].length+this.grid[q][x].length-1;if(v>0)for(var q=M;q<=x;q++)W[3]+=this.grid[v-1][q].length+this.grid[v][q].length-1;for(var G=F.MAX_VALUE,D,R,j=0;j<W.length;j++)W[j]<G?(G=W[j],D=1,R=j):W[j]==G&&D++;if(D==3&&G==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(D==2&&G==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(D==4&&G==0){var et=Math.floor(Math.random()*4);E=et}else E=R;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())}},r.exports=C},991:(r,i,e)=>{var a=e(551).FDLayoutNode,o=e(551).IMath;function f(s,l,g,d){a.call(this,s,l,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*o.sign(this.displacementX)),Math.abs(this.displacementY)>s.coolingFactor*s.maxNodeDisplacement&&(this.displacementY=s.coolingFactor*s.maxNodeDisplacement*o.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},f.prototype.propogateDisplacementToChildren=function(s,l){for(var g=this.getChild().getNodes(),d,N=0;N<g.length;N++)d=g[N],d.getChild()==null?(d.displacementX+=s,d.displacementY+=l):d.propogateDisplacementToChildren(s,l)},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},r.exports=f},902:(r,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 o=e(806),f=e(551).LinkedList,t=e(551).Matrix,s=e(551).SVD;function l(){}l.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=[],I=g.getAllNodes(),F=0,U=0;U<I.length;U++){var X=I[U];X.getChild()==null&&(c.set(X.id,F++),y.push(X.getCenterX()),A.push(X.getCenterY()),N.set(X.id,X))}d.relativePlacementConstraint&&d.relativePlacementConstraint.forEach(function(_){!_.gap&&_.gap!=0&&(_.left?_.gap=o.DEFAULT_EDGE_LENGTH+N.get(_.left).getWidth()/2+N.get(_.right).getWidth()/2:_.gap=o.DEFAULT_EDGE_LENGTH+N.get(_.top).getHeight()/2+N.get(_.bottom).getHeight()/2)});var Y=function(_,O){return{x:_.x-O.x,y:_.y-O.y}},Z=function(_){var O=0,V=0;return _.forEach(function(J){O+=y[c.get(J)],V+=A[c.get(J)]}),{x:O/_.size,y:V/_.size}},C=function(_,O,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;_.forEach(function(lt,ot){ht.set(ot,0)}),_.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||(O=="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){O=="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){O=="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=_.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(O=="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;_.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;O=="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 oe=(at+gt)/2-(wt+Dt)/2,ee=!0,Kt=!1,Zt=void 0;try{for(var $t=lt[Symbol.iterator](),Jt;!(ee=(Jt=$t.next()).done);ee=!0){var ne=Jt.value;tt.set(ne,tt.get(ne)+oe)}}catch(jt){Kt=!0,Zt=jt}finally{try{!ee&&$t.return&&$t.return()}finally{if(Kt)throw Zt}}})}return tt},rt=function(_){var O=0,V=0,J=0,K=0;if(_.forEach(function(ct){ct.left?y[c.get(ct.left)]-y[c.get(ct.right)]>=0?O++:V++:A[c.get(ct.top)]-A[c.get(ct.bottom)]>=0?J++:K++}),O>V&&J>K)for(var ft=0;ft<c.size;ft++)y[ft]=-1*y[ft],A[ft]=-1*A[ft];else if(O>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(_){var O=[],V=new f,J=new Set,K=0;return _.forEach(function(ft,ht){if(!J.has(ht)){O[K]=[];var tt=ht;for(V.push(tt),J.add(tt),O[K].push(tt);V.length!=0;){tt=V.shift();var ct=_.get(tt);ct.forEach(function(it){J.has(it.id)||(V.push(it.id),J.add(it.id),O[K].push(it.id))})}K++}}),O},E=function(_){var O=new Map;return _.forEach(function(V,J){O.set(J,[])}),_.forEach(function(V,J){V.forEach(function(K){O.get(J).push(K),O.get(K.id).push({id:J,gap:K.gap,direction:K.direction})})}),O},p=function(_){var O=new Map;return _.forEach(function(V,J){O.set(J,[])}),_.forEach(function(V,J){V.forEach(function(K){O.get(K.id).push({id:J,gap:K.gap,direction:K.direction})})}),O},m=[],v=[],b=!1,M=!1,x=new Set,S=new Map,k=new Map,B=[];if(d.fixedNodeConstraint&&d.fixedNodeConstraint.forEach(function(_){x.add(_.nodeId)}),d.relativePlacementConstraint&&(d.relativePlacementConstraint.forEach(function(_){_.left?(S.has(_.left)?S.get(_.left).push({id:_.right,gap:_.gap,direction:"horizontal"}):S.set(_.left,[{id:_.right,gap:_.gap,direction:"horizontal"}]),S.has(_.right)||S.set(_.right,[])):(S.has(_.top)?S.get(_.top).push({id:_.bottom,gap:_.gap,direction:"vertical"}):S.set(_.top,[{id:_.bottom,gap:_.gap,direction:"vertical"}]),S.has(_.bottom)||S.set(_.bottom,[]))}),k=E(S),B=n(k)),o.TRANSFORM_ON_CONSTRAINT_HANDLING){if(d.fixedNodeConstraint&&d.fixedNodeConstraint.length>1)d.fixedNodeConstraint.forEach(function(_,O){m[O]=[_.position.x,_.position.y],v[O]=[y[c.get(_.nodeId)],A[c.get(_.nodeId)]]}),b=!0;else if(d.alignmentConstraint)(function(){var _=0;if(d.alignmentConstraint.vertical){for(var O=d.alignmentConstraint.vertical,V=function(tt){var ct=new Set;O[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,O[tt].forEach(function(yt){m[_]=[Et,A[c.get(yt)]],v[_]=[y[c.get(yt)],A[c.get(yt)]],_++})},J=0;J<O.length;J++)V(J);b=!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[_]=[y[c.get(yt)],Et],v[_]=[y[c.get(yt)],A[c.get(yt)]],_++})},ht=0;ht<K.length;ht++)ft(ht);b=!0}d.relativePlacementConstraint&&(M=!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<k.size/2)rt(d.relativePlacementConstraint),b=!1,M=!1;else{var G=new Map,D=new Map,R=[];B[W].forEach(function(_){S.get(_).forEach(function(O){O.direction=="horizontal"?(G.has(_)?G.get(_).push(O):G.set(_,[O]),G.has(O.id)||G.set(O.id,[]),R.push({left:_,right:O.id})):(D.has(_)?D.get(_).push(O):D.set(_,[O]),D.has(O.id)||D.set(O.id,[]),R.push({top:_,bottom:O.id}))})}),rt(R),M=!1;var j=C(G,"horizontal"),et=C(D,"vertical");B[W].forEach(function(_,O){v[O]=[y[c.get(_)],A[c.get(_)]],m[O]=[],j.has(_)?m[O][0]=j.get(_):m[O][0]=y[c.get(_)],et.has(_)?m[O][1]=et.get(_):m[O][1]=A[c.get(_)]}),b=!0}}if(b){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)}M&&rt(d.relativePlacementConstraint)}}if(o.ENFORCE_CONSTRAINTS){if(d.fixedNodeConstraint&&d.fixedNodeConstraint.length>0){var At={x:0,y:0};d.fixedNodeConstraint.forEach(function(_,O){var V={x:y[c.get(_.nodeId)],y:A[c.get(_.nodeId)]},J=_.position,K=Y(J,V);At.x+=K.x,At.y+=K.y}),At.x/=d.fixedNodeConstraint.length,At.y/=d.fixedNodeConstraint.length,y.forEach(function(_,O){y[O]+=At.x}),A.forEach(function(_,O){A[O]+=At.y}),d.fixedNodeConstraint.forEach(function(_){y[c.get(_.nodeId)]=_.position.x,A[c.get(_.nodeId)]=_.position.y})}if(d.alignmentConstraint){if(d.alignmentConstraint.vertical)for(var Ht=d.alignmentConstraint.vertical,Ot=function(_){var O=new Set;Ht[_].forEach(function(K){O.add(K)});var V=new Set([].concat(a(O)).filter(function(K){return x.has(K)})),J=void 0;V.size>0?J=y[c.get(V.values().next().value)]:J=Z(O).x,O.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(_){var O=new Set;Ft[_].forEach(function(K){O.add(K)});var V=new Set([].concat(a(O)).filter(function(K){return x.has(K)})),J=void 0;V.size>0?J=A[c.get(V.values().next().value)]:J=Z(O).y,O.forEach(function(K){x.has(K)||(A[c.get(K)]=J)})},Gt=0;Gt<Ft.length;Gt++)Wt(Gt)}d.relativePlacementConstraint&&function(){var _=new Map,O=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){_.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){O.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){S.get(ut).forEach(function(Mt){var Yt=void 0,zt=void 0;Mt.direction=="horizontal"?(Yt=_.get(ut)?_.get(ut):ut,_.get(Mt.id)?zt={id:_.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=O.get(ut)?O.get(ut):ut,O.get(Mt.id)?zt={id:O.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=S.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),oe=p(ot),ee=p(at),Kt=[],Zt=[];Pt.forEach(function(ut,Mt){Kt[Mt]=[],ut.forEach(function(Yt){oe.get(Yt).length==0&&Kt[Mt].push(Yt)})}),qt.forEach(function(ut,Mt){Zt[Mt]=[],ut.forEach(function(Yt){ee.get(Yt).length==0&&Zt[Mt].push(Yt)})});var $t=C(ot,"horizontal",ht,K,Kt),Jt=C(at,"vertical",tt,ft,Zt),ne=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,ye=!1,Ee=void 0;try{for(var ae=$t.keys()[Symbol.iterator](),Ne;!(jt=(Ne=ae.next()).done);jt=!0){var se=Ne.value;ne(se)}}catch(ut){ye=!0,Ee=ut}finally{try{!jt&&ae.return&&ae.return()}finally{if(ye)throw Ee}}var We=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)},he=!0,Te=!1,Ae=void 0;try{for(var le=Jt.keys()[Symbol.iterator](),we;!(he=(we=le.next()).done);he=!0){var se=we.value;We(se)}}catch(ut){Te=!0,Ae=ut}finally{try{!he&&le.return&&le.return()}finally{if(Te)throw Ae}}}()}for(var Bt=0;Bt<I.length;Bt++){var dt=I[Bt];dt.getChild()==null&&dt.setCenter(y[c.get(dt.id)],A[c.get(dt.id)])}},r.exports=l},551:r=>{r.exports=L}},T={};function u(r){var i=T[r];if(i!==void 0)return i.exports;var e=T[r]={exports:{}};return P[r](e,e.exports,u),e.exports}var h=u(45);return h})()})}(ge)),ge.exports}var fi=ce.exports,_e;function pi(){return _e||(_e=1,function(w,H){(function(L,P){w.exports=P(ui())})(fi,function(L){return(()=>{var P={658:r=>{r.exports=Object.assign!=null?Object.assign.bind(Object):function(i){for(var e=arguments.length,a=Array(e>1?e-1:0),o=1;o<e;o++)a[o-1]=arguments[o];return a.forEach(function(f){Object.keys(f).forEach(function(t){return i[t]=f[t]})}),i}},548:(r,i,e)=>{var a=function(){function t(s,l){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),!(l&&g.length===l));d=!0);}catch(I){N=!0,c=I}finally{try{!d&&y.return&&y.return()}finally{if(N)throw c}}return g}return function(s,l){if(Array.isArray(s))return s;if(Symbol.iterator in Object(s))return t(s,l);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),o=e(140).layoutBase.LinkedList,f={};f.getTopMostNodes=function(t){for(var s={},l=0;l<t.length;l++)s[t[l].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,l,g){var d=new o,N=new Set,c=[],y=void 0,A=void 0,I=void 0,F=!1,U=1,X=[],Y=[],Z=function(){var C=t.collection();Y.push(C);var rt=l[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),C.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 b=m[v];if(y=l.intersection(b.union(b.ancestors())),y!=null&&!N.has(y[0])){var M=y.union(y.descendants());M.forEach(function(x){d.push(x),N.add(x),C.merge(x),l.has(x)&&c.push(x)})}}};d.length!=0;)E();if(C.forEach(function(m){s.intersection(m.connectedEdges()).forEach(function(v){C.has(v.source())&&C.has(v.target())&&C.merge(v)})}),c.length==l.length&&(F=!0),!F||F&&U>1){A=c[0],I=A.connectedEdges().length,c.forEach(function(m){m.connectedEdges().length<I&&(I=m.connectedEdges().length,A=m)}),X.push(A.id());var p=t.collection();p.merge(c[0]),c.forEach(function(m){p.merge(m)}),c=[],l=l.difference(p),U++}};do Z();while(!F);return g&&X.length>0&&g.set("dummy"+(g.size+1),X),Y},f.relocateComponent=function(t,s,l){if(!l.fixedNodeConstraint){var g=Number.POSITIVE_INFINITY,d=Number.NEGATIVE_INFINITY,N=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY;if(l.quality=="draft"){var y=!0,A=!1,I=void 0;try{for(var F=s.nodeIndexes[Symbol.iterator](),U;!(y=(U=F.next()).done);y=!0){var X=U.value,Y=a(X,2),Z=Y[0],C=Y[1],rt=l.cy.getElementById(Z);if(rt){var n=rt.boundingBox(),E=s.xCoords[C]-n.w/2,p=s.xCoords[C]+n.w/2,m=s.yCoords[C]-n.h/2,v=s.yCoords[C]+n.h/2;E<g&&(g=E),p>d&&(d=p),m<N&&(N=m),v>c&&(c=v)}}}catch(k){A=!0,I=k}finally{try{!y&&F.return&&F.return()}finally{if(A)throw I}}var b=t.x-(d+g)/2,M=t.y-(c+N)/2;s.xCoords=s.xCoords.map(function(k){return k+b}),s.yCoords=s.yCoords.map(function(k){return k+M})}else{Object.keys(s).forEach(function(k){var B=s[k],z=B.getRect().x,W=B.getRect().x+B.getRect().width,q=B.getRect().y,G=B.getRect().y+B.getRect().height;z<g&&(g=z),W>d&&(d=W),q<N&&(N=q),G>c&&(c=G)});var x=t.x-(d+g)/2,S=t.y-(c+N)/2;Object.keys(s).forEach(function(k){var B=s[k];B.setCenter(B.getCenterX()+x,B.getCenterY()+S)})}}},f.calcBoundingBox=function(t,s,l,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,I=void 0,F=void 0,U=void 0,X=t.descendants().not(":parent"),Y=X.length,Z=0;Z<Y;Z++){var C=X[Z];A=s[g.get(C.id())]-C.width()/2,I=s[g.get(C.id())]+C.width()/2,F=l[g.get(C.id())]-C.height()/2,U=l[g.get(C.id())]+C.height()/2,d>A&&(d=A),N<I&&(N=I),c>F&&(c=F),y<U&&(y=U)}var rt={};return rt.topLeftX=d,rt.topLeftY=c,rt.width=N-d,rt.height=y-c,rt},f.calcParentsWithoutChildren=function(t,s){var l=t.collection();return s.nodes(":parent").forEach(function(g){var d=!1;g.children().forEach(function(N){N.css("display")!="none"&&(d=!0)}),d||l.merge(g)}),l},r.exports=f},816:(r,i,e)=>{var a=e(548),o=e(140).CoSELayout,f=e(140).CoSENode,t=e(140).layoutBase.PointD,s=e(140).layoutBase.DimensionD,l=e(140).layoutBase.LayoutConstants,g=e(140).layoutBase.FDLayoutConstants,d=e(140).CoSEConstants,N=function(c,y){var A=c.cy,I=c.eles,F=I.nodes(),U=I.edges(),X=void 0,Y=void 0,Z=void 0,C={};c.randomize&&(X=y.nodeIndexes,Y=y.xCoords,Z=y.yCoords);var rt=function(x){return typeof x=="function"},n=function(x,S){return rt(x)?x(S):x},E=a.calcParentsWithoutChildren(A,I),p=function x(S,k,B,z){for(var W=k.length,q=0;q<W;q++){var G=k[q],D=null;G.intersection(E).length==0&&(D=G.children());var R=void 0,j=G.layoutDimensions({nodeDimensionsIncludeLabels:z.nodeDimensionsIncludeLabels});if(G.outerWidth()!=null&&G.outerHeight()!=null)if(z.randomize)if(!G.isParent())R=S.add(new f(B.graphManager,new t(Y[X.get(G.id())]-j.w/2,Z[X.get(G.id())]-j.h/2),new s(parseFloat(j.w),parseFloat(j.h))));else{var et=a.calcBoundingBox(G,Y,Z,X);G.intersection(E).length==0?R=S.add(new f(B.graphManager,new t(et.topLeftX,et.topLeftY),new s(et.width,et.height))):R=S.add(new f(B.graphManager,new t(et.topLeftX,et.topLeftY),new s(parseFloat(j.w),parseFloat(j.h))))}else R=S.add(new f(B.graphManager,new t(G.position("x")-j.w/2,G.position("y")-j.h/2),new s(parseFloat(j.w),parseFloat(j.h))));else R=S.add(new f(this.graphManager));if(R.id=G.data("id"),R.nodeRepulsion=n(z.nodeRepulsion,G),R.paddingLeft=parseInt(G.css("padding")),R.paddingTop=parseInt(G.css("padding")),R.paddingRight=parseInt(G.css("padding")),R.paddingBottom=parseInt(G.css("padding")),z.nodeDimensionsIncludeLabels&&(R.labelWidth=G.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).w,R.labelHeight=G.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).h,R.labelPosVertical=G.css("text-valign"),R.labelPosHorizontal=G.css("text-halign")),C[G.data("id")]=R,isNaN(R.rect.x)&&(R.rect.x=0),isNaN(R.rect.y)&&(R.rect.y=0),D!=null&&D.length>0){var mt=void 0;mt=B.getGraphManager().add(B.newGraph(),R),x(mt,D,B,z)}}},m=function(x,S,k){for(var B=0,z=0,W=0;W<k.length;W++){var q=k[W],G=C[q.data("source")],D=C[q.data("target")];if(G&&D&&G!==D&&G.getEdgesBetween(D).length==0){var R=S.add(x.newEdge(),G,D);R.id=q.id(),R.idealLength=n(c.idealEdgeLength,q),R.edgeElasticity=n(c.edgeElasticity,q),B+=R.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,S){S.fixedNodeConstraint&&(x.constraints.fixedNodeConstraint=S.fixedNodeConstraint),S.alignmentConstraint&&(x.constraints.alignmentConstraint=S.alignmentConstraint),S.relativePlacementConstraint&&(x.constraints.relativePlacementConstraint=S.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"?l.QUALITY=2:l.QUALITY=0,d.NODE_DIMENSIONS_INCLUDE_LABELS=g.NODE_DIMENSIONS_INCLUDE_LABELS=l.NODE_DIMENSIONS_INCLUDE_LABELS=c.nodeDimensionsIncludeLabels,d.DEFAULT_INCREMENTAL=g.DEFAULT_INCREMENTAL=l.DEFAULT_INCREMENTAL=!c.randomize,d.ANIMATE=g.ANIMATE=l.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=l.DEFAULT_INCREMENTAL=!0,d.PURE_INCREMENTAL=!c.randomize,l.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 b=new o,M=b.newGraphManager();return p(M.addRoot(),a.getTopMostNodes(F),b,c),m(b,M,U),v(b,c),b.runLayout(),C};r.exports={coseLayout:N}},212:(r,i,e)=>{var a=function(){function y(A,I){for(var F=0;F<I.length;F++){var U=I[F];U.enumerable=U.enumerable||!1,U.configurable=!0,"value"in U&&(U.writable=!0),Object.defineProperty(A,U.key,U)}}return function(A,I,F){return I&&y(A.prototype,I),F&&y(A,F),A}}();function o(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),l=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){o(this,y),this.options=f({},N,A)}return a(y,[{key:"run",value:function(){var A=this,I=this.options,F=I.cy,U=I.eles,X=[],Y=[],Z=void 0,C=[];I.fixedNodeConstraint&&(!Array.isArray(I.fixedNodeConstraint)||I.fixedNodeConstraint.length==0)&&(I.fixedNodeConstraint=void 0),I.alignmentConstraint&&(I.alignmentConstraint.vertical&&(!Array.isArray(I.alignmentConstraint.vertical)||I.alignmentConstraint.vertical.length==0)&&(I.alignmentConstraint.vertical=void 0),I.alignmentConstraint.horizontal&&(!Array.isArray(I.alignmentConstraint.horizontal)||I.alignmentConstraint.horizontal.length==0)&&(I.alignmentConstraint.horizontal=void 0)),I.relativePlacementConstraint&&(!Array.isArray(I.relativePlacementConstraint)||I.relativePlacementConstraint.length==0)&&(I.relativePlacementConstraint=void 0);var rt=I.fixedNodeConstraint||I.alignmentConstraint||I.relativePlacementConstraint;rt&&(I.tile=!1,I.packComponents=!1);var n=void 0,E=!1;if(F.layoutUtilities&&I.packComponents&&(n=F.layoutUtilities("get"),n||(n=F.layoutUtilities()),E=!0),U.nodes().length>0)if(E){var p=t.getTopMostNodes(I.eles.nodes());if(Z=t.connectComponents(F,I.eles,p),Z.forEach(function(Q){var nt=Q.boundingBox();C.push({x:nt.x1+nt.w/2,y:nt.y1+nt.h/2})}),I.randomize&&Z.forEach(function(Q){I.eles=Q,X.push(l(I))}),I.quality=="default"||I.quality=="proof"){var m=F.collection();if(I.tile){var v=new Map,b=[],M=[],x=0,S={nodeIndexes:v,xCoords:b,yCoords:M},k=[];if(Z.forEach(function(Q,nt){Q.edges().length==0&&(Q.nodes().forEach(function(vt,st){m.merge(Q.nodes()[st]),vt.isParent()||(S.nodeIndexes.set(Q.nodes()[st].id(),x++),S.xCoords.push(Q.nodes()[0].position().x),S.yCoords.push(Q.nodes()[0].position().y))}),k.push(nt))}),m.length>1){var B=m.boundingBox();C.push({x:B.x1+B.w/2,y:B.y1+B.h/2}),Z.push(m),X.push(S);for(var z=k.length-1;z>=0;z--)Z.splice(k[z],1),X.splice(k[z],1),C.splice(k[z],1)}}Z.forEach(function(Q,nt){I.eles=Q,Y.push(d(I,X[nt])),t.relocateComponent(C[nt],Y[nt],I)})}else Z.forEach(function(Q,nt){t.relocateComponent(C[nt],X[nt],I)});var W=new Set;if(Z.length>1){var q=[],G=U.filter(function(Q){return Q.css("display")=="none"});Z.forEach(function(Q,nt){var vt=void 0;if(I.quality=="draft"&&(vt=X[nt].nodeIndexes),Q.nodes().not(G).length>0){var st={};st.edges=[],st.nodes=[];var Lt=void 0;Q.nodes().not(G).forEach(function(_t){if(I.quality=="draft")if(!_t.isParent())Lt=vt.get(_t.id()),st.nodes.push({x:X[nt].xCoords[Lt]-_t.boundingbox().w/2,y:X[nt].yCoords[Lt]-_t.boundingbox().h/2,width:_t.boundingbox().w,height:_t.boundingbox().h});else{var Nt=t.calcBoundingBox(_t,X[nt].xCoords,X[nt].yCoords,vt);st.nodes.push({x:Nt.topLeftX,y:Nt.topLeftY,width:Nt.width,height:Nt.height})}else Y[nt][_t.id()]&&st.nodes.push({x:Y[nt][_t.id()].getLeft(),y:Y[nt][_t.id()].getTop(),width:Y[nt][_t.id()].getWidth(),height:Y[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(I.quality=="draft"){var Ht=vt.get(Nt.id()),Ot=vt.get(At.id()),Rt=[],Ft=[];if(Nt.isParent()){var Wt=t.calcBoundingBox(Nt,X[nt].xCoords,X[nt].yCoords,vt);Rt.push(Wt.topLeftX+Wt.width/2),Rt.push(Wt.topLeftY+Wt.height/2)}else Rt.push(X[nt].xCoords[Ht]),Rt.push(X[nt].yCoords[Ht]);if(At.isParent()){var Gt=t.calcBoundingBox(At,X[nt].xCoords,X[nt].yCoords,vt);Ft.push(Gt.topLeftX+Gt.width/2),Ft.push(Gt.topLeftY+Gt.height/2)}else Ft.push(X[nt].xCoords[Ot]),Ft.push(X[nt].yCoords[Ot]);st.edges.push({startX:Rt[0],startY:Rt[1],endX:Ft[0],endY:Ft[1]})}else Y[nt][Nt.id()]&&Y[nt][At.id()]&&st.edges.push({startX:Y[nt][Nt.id()].getCenterX(),startY:Y[nt][Nt.id()].getCenterY(),endX:Y[nt][At.id()].getCenterX(),endY:Y[nt][At.id()].getCenterY()})}),st.nodes.length>0&&(q.push(st),W.add(nt))}});var D=n.packComponents(q,I.randomize).shifts;if(I.quality=="draft")X.forEach(function(Q,nt){var vt=Q.xCoords.map(function(Lt){return Lt+D[nt].dx}),st=Q.yCoords.map(function(Lt){return Lt+D[nt].dy});Q.xCoords=vt,Q.yCoords=st});else{var R=0;W.forEach(function(Q){Object.keys(Y[Q]).forEach(function(nt){var vt=Y[Q][nt];vt.setCenter(vt.getCenterX()+D[R].dx,vt.getCenterY()+D[R].dy)}),R++})}}}else{var j=I.eles.boundingBox();if(C.push({x:j.x1+j.w/2,y:j.y1+j.h/2}),I.randomize){var et=l(I);X.push(et)}I.quality=="default"||I.quality=="proof"?(Y.push(d(I,X[0])),t.relocateComponent(C[0],Y[0],I)):t.relocateComponent(C[0],X[0],I)}var mt=function(Q,nt){if(I.quality=="default"||I.quality=="proof"){typeof Q=="number"&&(Q=nt);var vt=void 0,st=void 0,Lt=Q.data("id");return Y.forEach(function(Nt){Lt in Nt&&(vt={x:Nt[Lt].getRect().getCenterX(),y:Nt[Lt].getRect().getCenterY()},st=Nt[Lt])}),I.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 X.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(I.quality=="default"||I.quality=="proof"||I.randomize){var $=t.calcParentsWithoutChildren(F,U),xt=U.filter(function(Q){return Q.css("display")=="none"});I.eles=U.not(xt),U.nodes().not(":parent").not(xt).layoutPositions(A,I,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}();r.exports=c},657:(r,i,e)=>{var a=e(548),o=e(140).layoutBase.Matrix,f=e(140).layoutBase.SVD,t=function(s){var l=s.cy,g=s.eles,d=g.nodes(),N=g.nodes(":parent"),c=new Map,y=new Map,A=new Map,I=[],F=[],U=[],X=[],Y=[],Z=[],C=[],rt=[],n=void 0,E=1e8,p=1e-9,m=s.piTol,v=s.samplingType,b=s.nodeSeparation,M=void 0,x=function(){for(var dt=0,_=0,O=!1;_<M;){dt=Math.floor(Math.random()*n),O=!1;for(var V=0;V<_;V++)if(X[V]==dt){O=!0;break}if(!O)X[_]=dt,_++;else continue}},S=function(dt,_,O){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=I[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][_]=tt[ft]*b}if(O){for(var lt=0;lt<n;lt++)Z[lt][_]<Y[lt]&&(Y[lt]=Z[lt][_]);for(var ot=0;ot<n;ot++)Y[ot]>ct&&(ct=Y[ot],it=ot)}return it},k=function(dt){var _=void 0;if(dt){_=Math.floor(Math.random()*n);for(var O=0;O<n;O++)Y[O]=E;for(var V=0;V<M;V++)X[V]=_,_=S(_,V,dt)}else{x();for(var J=0;J<M;J++)S(X[J],J,dt)}for(var K=0;K<n;K++)for(var ft=0;ft<M;ft++)Z[K][ft]*=Z[K][ft];for(var ht=0;ht<M;ht++)C[ht]=[];for(var tt=0;tt<M;tt++)for(var ct=0;ct<M;ct++)C[tt][ct]=Z[X[ct]][tt]},B=function(){for(var dt=f.svd(C),_=dt.S,O=dt.U,V=dt.V,J=_[0]*_[0]*_[0],K=[],ft=0;ft<M;ft++){K[ft]=[];for(var ht=0;ht<M;ht++)K[ft][ht]=0,ft==ht&&(K[ft][ht]=_[ft]/(_[ft]*_[ft]+J/(_[ft]*_[ft])))}rt=o.multMat(o.multMat(V,K),o.transpose(O))},z=function(){for(var dt=void 0,_=void 0,O=[],V=[],J=[],K=[],ft=0;ft<n;ft++)O[ft]=Math.random(),V[ft]=Math.random();O=o.normalize(O),V=o.normalize(V);for(var ht=p,tt=p,ct=void 0;;){for(var it=0;it<n;it++)J[it]=O[it];if(O=o.multGamma(o.multL(o.multGamma(J),Z,rt)),dt=o.dotProduct(J,O),O=o.normalize(O),ht=o.dotProduct(J,O),ct=Math.abs(ht/tt),ct<=1+m&&ct>=1)break;tt=ht}for(var Et=0;Et<n;Et++)J[Et]=O[Et];for(tt=p;;){for(var yt=0;yt<n;yt++)K[yt]=V[yt];if(K=o.minusOp(K,o.multCons(J,o.dotProduct(J,K))),V=o.multGamma(o.multL(o.multGamma(K),Z,rt)),_=o.dotProduct(K,V),V=o.normalize(V),ht=o.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];F=o.multCons(J,Math.sqrt(Math.abs(dt))),U=o.multCons(K,Math.sqrt(Math.abs(_)))};a.connectComponents(l,g,a.getTopMostNodes(d),c),N.forEach(function(dt){a.connectComponents(l,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 G=!0,D=!1,R=void 0;try{for(var j=c.keys()[Symbol.iterator](),et;!(G=(et=j.next()).done);G=!0){var mt=et.value;y.set(mt,W++)}}catch(dt){D=!0,R=dt}finally{try{!G&&j.return&&j.return()}finally{if(D)throw R}}for(var $=0;$<y.size;$++)I[$]=[];N.forEach(function(dt){for(var _=dt.children().intersection(g);_.nodes(":childless").length==0;)_=_.nodes()[0].children().intersection(g);var O=0,V=_.nodes(":childless")[0].connectedEdges().length;_.nodes(":childless").forEach(function(J,K){J.connectedEdges().length<V&&(V=J.connectedEdges().length,O=K)}),A.set(dt.id(),_.nodes(":childless")[O].id())}),d.forEach(function(dt){var _=void 0;dt.isParent()?_=y.get(A.get(dt.id())):_=y.get(dt.id()),dt.neighborhood().nodes().forEach(function(O){g.intersection(dt.edgesWith(O)).length>0&&(O.isParent()?I[_].push(A.get(O.id())):I[_].push(O.id()))})});var xt=function(dt){var _=y.get(dt),O=void 0;c.get(dt).forEach(function(V){l.getElementById(V).isParent()?O=A.get(V):O=V,I[_].push(O),I[y.get(O)].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){M=n<s.sampleSize?n:s.sampleSize;for(var At=0;At<n;At++)Z[At]=[];for(var Ht=0;Ht<M;Ht++)rt[Ht]=[];return s.quality=="draft"||s.step=="all"?(k(v),B(),z(),Nt={nodeIndexes:y,xCoords:F,yCoords:U}):(y.forEach(function(dt,_){F.push(l.getElementById(_).position("x")),U.push(l.getElementById(_).position("y"))}),Nt={nodeIndexes:y,xCoords:F,yCoords:U}),Nt}else{var Ot=y.keys(),Rt=l.getElementById(Ot.next().value),Ft=Rt.position(),Wt=Rt.outerWidth();if(F.push(Ft.x),U.push(Ft.y),n==2){var Gt=l.getElementById(Ot.next().value),Bt=Gt.outerWidth();F.push(Ft.x+Wt/2+Bt/2+s.idealEdgeLength),U.push(Ft.y)}return Nt={nodeIndexes:y,xCoords:F,yCoords:U},Nt}};r.exports={spectralLayout:t}},579:(r,i,e)=>{var a=e(212),o=function(f){f&&f("layout","fcose",a)};typeof cytoscape<"u"&&o(cytoscape),r.exports=o},140:r=>{r.exports=L}},T={};function u(r){var i=T[r];if(i!==void 0)return i.exports;var e=T[r]={exports:{}};return P[r](e,e.exports,u),e.exports}var h=u(579);return h})()})}(ce)),ce.exports}var mi=pi();const vi=li(mi);var Me={L:"left",R:"right",T:"top",B:"bottom"},Ce={L:pt(w=>`${w},${w/2} 0,${w} 0,0`,"L"),R:pt(w=>`0,${w/2} ${w},0 ${w},${w}`,"R"),T:pt(w=>`0,0 ${w},0 ${w/2},${w}`,"T"),B:pt(w=>`${w/2},0 ${w},${w} 0,${w}`,"B")},re={L:pt((w,H)=>w-H+2,"L"),R:pt((w,H)=>w-2,"R"),T:pt((w,H)=>w-H+2,"T"),B:pt((w,H)=>w-2,"B")},yi=pt(function(w){return kt(w)?w==="L"?"R":"L":w==="T"?"B":"T"},"getOppositeArchitectureDirection"),xe=pt(function(w){const H=w;return H==="L"||H==="R"||H==="T"||H==="B"},"isArchitectureDirection"),kt=pt(function(w){const H=w;return H==="L"||H==="R"},"isArchitectureDirectionX"),Vt=pt(function(w){const H=w;return H==="T"||H==="B"},"isArchitectureDirectionY"),ve=pt(function(w,H){const L=kt(w)&&Vt(H),P=Vt(w)&&kt(H);return L||P},"isArchitectureDirectionXY"),Ei=pt(function(w){const H=w[0],L=w[1],P=kt(H)&&Vt(L),T=Vt(H)&&kt(L);return P||T},"isArchitecturePairXY"),Ni=pt(function(w){return w!=="LL"&&w!=="RR"&&w!=="TT"&&w!=="BB"},"isValidArchitectureDirectionPair"),fe=pt(function(w,H){const L=`${w}${H}`;return Ni(L)?L:void 0},"getArchitectureDirectionPair"),Ti=pt(function([w,H],L){const P=L[0],T=L[1];return kt(P)?Vt(T)?[w+(P==="L"?-1:1),H+(T==="T"?1:-1)]:[w+(P==="L"?-1:1),H]:kt(T)?[w+(T==="L"?1:-1),H+(P==="T"?1:-1)]:[w,H+(P==="T"?1:-1)]},"shiftPositionByArchitectureDirectionPair"),Ai=pt(function(w){return w==="LT"||w==="TL"?[1,1]:w==="BL"||w==="LB"?[1,-1]:w==="BR"||w==="RB"?[-1,-1]:[-1,1]},"getArchitectureDirectionXYFactors"),wi=pt(function(w,H){return ve(w,H)?"bend":kt(w)?"horizontal":"vertical"},"getArchitectureDirectionAlignment"),Ii=pt(function(w){return w.type==="service"},"isArchitectureService"),Li=pt(function(w){return w.type==="junction"},"isArchitectureJunction"),Oe=pt(w=>w.data(),"edgeData"),te=pt(w=>w.data(),"nodeData"),_i=ei.architecture,Re=class{constructor(){this.nodes={},this.groups={},this.edges=[],this.registeredIds={},this.elements={},this.setAccTitle=Ve,this.getAccTitle=$e,this.setDiagramTitle=je,this.getDiagramTitle=qe,this.getAccDescription=Ke,this.setAccDescription=Ze,this.clear()}static{pt(this,"ArchitectureDB")}clear(){this.nodes={},this.groups={},this.edges=[],this.registeredIds={},this.dataStructures=void 0,this.elements={},Je()}addService({id:w,icon:H,in:L,title:P,iconText:T}){if(this.registeredIds[w]!==void 0)throw new Error(`The service id [${w}] is already in use by another ${this.registeredIds[w]}`);if(L!==void 0){if(w===L)throw new Error(`The service [${w}] cannot be placed within itself`);if(this.registeredIds[L]===void 0)throw new Error(`The service [${w}]'s parent does not exist. Please make sure the parent is created before this service`);if(this.registeredIds[L]==="node")throw new Error(`The service [${w}]'s parent is not a group`)}this.registeredIds[w]="node",this.nodes[w]={id:w,type:"service",icon:H,iconText:T,title:P,edges:[],in:L}}getServices(){return Object.values(this.nodes).filter(Ii)}addJunction({id:w,in:H}){this.registeredIds[w]="node",this.nodes[w]={id:w,type:"junction",edges:[],in:H}}getJunctions(){return Object.values(this.nodes).filter(Li)}getNodes(){return Object.values(this.nodes)}getNode(w){return this.nodes[w]??null}addGroup({id:w,icon:H,in:L,title:P}){if(this.registeredIds?.[w]!==void 0)throw new Error(`The group id [${w}] is already in use by another ${this.registeredIds[w]}`);if(L!==void 0){if(w===L)throw new Error(`The group [${w}] cannot be placed within itself`);if(this.registeredIds?.[L]===void 0)throw new Error(`The group [${w}]'s parent does not exist. Please make sure the parent is created before this group`);if(this.registeredIds?.[L]==="node")throw new Error(`The group [${w}]'s parent is not a group`)}this.registeredIds[w]="group",this.groups[w]={id:w,icon:H,title:P,in:L}}getGroups(){return Object.values(this.groups)}addEdge({lhsId:w,rhsId:H,lhsDir:L,rhsDir:P,lhsInto:T,rhsInto:u,lhsGroup:h,rhsGroup:r,title:i}){if(!xe(L))throw new Error(`Invalid direction given for left hand side of edge ${w}--${H}. Expected (L,R,T,B) got ${String(L)}`);if(!xe(P))throw new Error(`Invalid direction given for right hand side of edge ${w}--${H}. Expected (L,R,T,B) got ${String(P)}`);if(this.nodes[w]===void 0&&this.groups[w]===void 0)throw new Error(`The left-hand id [${w}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(this.nodes[H]===void 0&&this.groups[H]===void 0)throw new Error(`The right-hand id [${H}] does not yet exist. Please create the service/group before declaring an edge to it.`);const e=this.nodes[w].in,a=this.nodes[H].in;if(h&&e&&a&&e==a)throw new Error(`The left-hand id [${w}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(r&&e&&a&&e==a)throw new Error(`The right-hand id [${H}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);const o={lhsId:w,lhsDir:L,lhsInto:T,lhsGroup:h,rhsId:H,rhsDir:P,rhsInto:u,rhsGroup:r,title:i};this.edges.push(o),this.nodes[w]&&this.nodes[H]&&(this.nodes[w].edges.push(this.edges[this.edges.length-1]),this.nodes[H].edges.push(this.edges[this.edges.length-1]))}getEdges(){return this.edges}getDataStructures(){if(this.dataStructures===void 0){const w={},H=Object.entries(this.nodes).reduce((r,[i,e])=>(r[i]=e.edges.reduce((a,o)=>{const f=this.getNode(o.lhsId)?.in,t=this.getNode(o.rhsId)?.in;if(f&&t&&f!==t){const s=wi(o.lhsDir,o.rhsDir);s!=="bend"&&(w[f]??={},w[f][t]=s,w[t]??={},w[t][f]=s)}if(o.lhsId===i){const s=fe(o.lhsDir,o.rhsDir);s&&(a[s]=o.rhsId)}else{const s=fe(o.rhsDir,o.lhsDir);s&&(a[s]=o.lhsId)}return a},{}),r),{}),L=Object.keys(H)[0],P={[L]:1},T=Object.keys(H).reduce((r,i)=>i===L?r:{...r,[i]:1},{}),u=pt(r=>{const i={[r]:[0,0]},e=[r];for(;e.length>0;){const a=e.shift();if(a){P[a]=1,delete T[a];const o=H[a],[f,t]=i[a];Object.entries(o).forEach(([s,l])=>{P[l]||(i[l]=Ti([f,t],s),e.push(l))})}}return i},"BFS"),h=[u(L)];for(;Object.keys(T).length>0;)h.push(u(Object.keys(T)[0]));this.dataStructures={adjList:H,spatialMaps:h,groupAlignments:w}}return this.dataStructures}setElementForId(w,H){this.elements[w]=H}getElementById(w){return this.elements[w]}getConfig(){return Qe({..._i,...ti().architecture})}getConfigField(w){return this.getConfig()[w]}},Mi=pt((w,H)=>{si(w,H),w.groups.map(L=>H.addGroup(L)),w.services.map(L=>H.addService({...L,type:"service"})),w.junctions.map(L=>H.addJunction({...L,type:"junction"})),w.edges.map(L=>H.addEdge(L))},"populateDb"),Ge={parser:{yy:void 0},parse:pt(async w=>{const H=await hi("architecture",w);De.debug(H);const L=Ge.parser?.yy;if(!(L instanceof Re))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.");Mi(H,L)},"parse")},Ci=pt(w=>`
|
|
.edge {
|
|
stroke-width: ${w.archEdgeWidth};
|
|
stroke: ${w.archEdgeColor};
|
|
fill: none;
|
|
}
|
|
|
|
.arrow {
|
|
fill: ${w.archEdgeArrowColor};
|
|
}
|
|
|
|
.node-bkg {
|
|
fill: none;
|
|
stroke: ${w.archGroupBorderColor};
|
|
stroke-width: ${w.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"),xi=Ci,Qt=pt(w=>`<g><rect width="80" height="80" style="fill: #087ebf; stroke-width: 0px;"/>${w}</g>`,"wrapIcon"),ie={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("")}}},Di=pt(async function(w,H,L){const P=L.getConfigField("padding"),T=L.getConfigField("iconSize"),u=T/2,h=T/6,r=h/2;await Promise.all(H.edges().map(async i=>{const{source:e,sourceDir:a,sourceArrow:o,sourceGroup:f,target:t,targetDir:s,targetArrow:l,targetGroup:g,label:d}=Oe(i);let{x:N,y:c}=i[0].sourceEndpoint();const{x:y,y:A}=i[0].midpoint();let{x:I,y:F}=i[0].targetEndpoint();const U=P+4;if(f&&(kt(a)?N+=a==="L"?-U:U:c+=a==="T"?-U:U+18),g&&(kt(s)?I+=s==="L"?-U:U:F+=s==="T"?-U:U+18),!f&&L.getNode(e)?.type==="junction"&&(kt(a)?N+=a==="L"?u:-u:c+=a==="T"?u:-u),!g&&L.getNode(t)?.type==="junction"&&(kt(s)?I+=s==="L"?u:-u:F+=s==="T"?u:-u),i[0]._private.rscratch){const X=w.insert("g");if(X.insert("path").attr("d",`M ${N},${c} L ${y},${A} L${I},${F} `).attr("class","edge").attr("id",ri(e,t,{prefix:"L"})),o){const Y=kt(a)?re[a](N,h):N-r,Z=Vt(a)?re[a](c,h):c-r;X.insert("polygon").attr("points",Ce[a](h)).attr("transform",`translate(${Y},${Z})`).attr("class","arrow")}if(l){const Y=kt(s)?re[s](I,h):I-r,Z=Vt(s)?re[s](F,h):F-r;X.insert("polygon").attr("points",Ce[s](h)).attr("transform",`translate(${Y},${Z})`).attr("class","arrow")}if(d){const Y=ve(a,s)?"XY":kt(a)?"X":"Y";let Z=0;Y==="X"?Z=Math.abs(N-I):Y==="Y"?Z=Math.abs(c-F)/1.5:Z=Math.abs(N-I)/2;const C=X.append("g");if(await me(C,d,{useHtmlLabels:!1,width:Z,classes:"architecture-service-label"},pe()),C.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),Y==="X")C.attr("transform","translate("+y+", "+A+")");else if(Y==="Y")C.attr("transform","translate("+y+", "+A+") rotate(-90)");else if(Y==="XY"){const rt=fe(a,s);if(rt&&Ei(rt)){const n=C.node().getBoundingClientRect(),[E,p]=Ai(rt);C.attr("dominant-baseline","auto").attr("transform",`rotate(${-1*E*p*45})`);const m=C.node().getBoundingClientRect();C.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"),bi=pt(async function(w,H,L){const P=L.getConfigField("padding")*.75,T=L.getConfigField("fontSize"),u=L.getConfigField("iconSize")/2;await Promise.all(H.nodes().map(async h=>{const r=te(h);if(r.type==="group"){const{h:i,w:e,x1:a,y1:o}=h.boundingBox(),f=w.append("rect");f.attr("id",`group-${r.id}`).attr("x",a+u).attr("y",o+u).attr("width",e).attr("height",i).attr("class","node-bkg");const t=w.append("g");let s=a,l=o;if(r.icon){const g=t.append("g");g.html(`<g>${await de(r.icon,{height:P,width:P,fallbackPrefix:ie.prefix})}</g>`),g.attr("transform","translate("+(s+u+1)+", "+(l+u+1)+")"),s+=P,l+=T/2-1-2}if(r.label){const g=t.append("g");await me(g,r.label,{useHtmlLabels:!1,width:e,classes:"architecture-service-label"},pe()),g.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","start").attr("text-anchor","start"),g.attr("transform","translate("+(s+u+4)+", "+(l+u+2)+")")}L.setElementForId(r.id,f)}}))},"drawGroups"),Oi=pt(async function(w,H,L){const P=pe();for(const T of L){const u=H.append("g"),h=w.getConfigField("iconSize");if(T.title){const a=u.append("g");await me(a,T.title,{useHtmlLabels:!1,width:h*1.5,classes:"architecture-service-label"},P),a.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),a.attr("transform","translate("+h/2+", "+h+")")}const r=u.append("g");if(T.icon)r.html(`<g>${await de(T.icon,{height:h,width:h,fallbackPrefix:ie.prefix})}</g>`);else if(T.iconText){r.html(`<g>${await de("blank",{height:h,width:h,fallbackPrefix:ie.prefix})}</g>`);const a=r.append("g").append("foreignObject").attr("width",h).attr("height",h).append("div").attr("class","node-icon-text").attr("style",`height: ${h}px;`).append("div").html(ii(T.iconText,P)),o=parseInt(window.getComputedStyle(a.node(),null).getPropertyValue("font-size").replace(/\D/g,""))??16;a.attr("style",`-webkit-line-clamp: ${Math.floor((h-2)/o)};`)}else r.append("path").attr("class","node-bkg").attr("id","node-"+T.id).attr("d",`M0 ${h} v${-h} q0,-5 5,-5 h${h} q5,0 5,5 v${h} 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,w.setElementForId(T.id,u)}return 0},"drawServices"),Ri=pt(function(w,H,L){L.forEach(P=>{const T=H.append("g"),u=w.getConfigField("iconSize");T.append("g").append("rect").attr("id","node-"+P.id).attr("fill-opacity","0").attr("width",u).attr("height",u),T.attr("class","architecture-junction");const{width:h,height:r}=T._groups[0][0].getBBox();T.width=h,T.height=r,w.setElementForId(P.id,T)})},"drawJunctions");oi([{name:ie.prefix,icons:ie}]),be.use(vi);function Fe(w,H,L){w.forEach(P=>{H.add({group:"nodes",data:{type:"service",id:P.id,icon:P.icon,label:P.title,parent:P.in,width:L.getConfigField("iconSize"),height:L.getConfigField("iconSize")},classes:"node-service"})})}pt(Fe,"addServices");function Se(w,H,L){w.forEach(P=>{H.add({group:"nodes",data:{type:"junction",id:P.id,parent:P.in,width:L.getConfigField("iconSize"),height:L.getConfigField("iconSize")},classes:"node-junction"})})}pt(Se,"addJunctions");function Pe(w,H){H.nodes().map(L=>{const P=te(L);P.type!=="group"&&(P.x=L.position().x,P.y=L.position().y,w.getElementById(P.id).attr("transform","translate("+(P.x||0)+","+(P.y||0)+")"))})}pt(Pe,"positionNodes");function Ue(w,H){w.forEach(L=>{H.add({group:"nodes",data:{type:"group",id:L.id,icon:L.icon,label:L.title,parent:L.in},classes:"node-group"})})}pt(Ue,"addGroups");function ke(w,H){w.forEach(L=>{const{lhsId:P,rhsId:T,lhsInto:u,lhsGroup:h,rhsInto:r,lhsDir:i,rhsDir:e,rhsGroup:a,title:o}=L,f=ve(L.lhsDir,L.rhsDir)?"segments":"straight",t={id:`${P}-${T}`,label:o,source:P,sourceDir:i,sourceArrow:u,sourceGroup:h,sourceEndpoint:i==="L"?"0 50%":i==="R"?"100% 50%":i==="T"?"50% 0":"50% 100%",target:T,targetDir:e,targetArrow:r,targetGroup:a,targetEndpoint:e==="L"?"0 50%":e==="R"?"100% 50%":e==="T"?"50% 0":"50% 100%"};H.add({group:"edges",data:t,classes:f})})}pt(ke,"addEdges");function Xe(w,H,L){const P=pt((r,i)=>Object.entries(r).reduce((e,[a,o])=>{let f=0;const t=Object.entries(o);if(t.length===1)return e[a]=t[0][1],e;for(let s=0;s<t.length-1;s++)for(let l=s+1;l<t.length;l++){const[g,d]=t[s],[N,c]=t[l];if(L[g]?.[N]===i)e[a]??=[],e[a]=[...e[a],...d,...c];else if(g==="default"||N==="default")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=H.map(r=>{const i={},e={};return Object.entries(r).forEach(([a,[o,f]])=>{const t=w.getNode(a)?.in??"default";i[f]??={},i[f][t]??=[],i[f][t].push(a),e[o]??={},e[o][t]??=[],e[o][t].push(a)}),{horiz:Object.values(P(i,"horizontal")).filter(a=>a.length>1),vert:Object.values(P(e,"vertical")).filter(a=>a.length>1)}}),[u,h]=T.reduce(([r,i],{horiz:e,vert:a})=>[[...r,...e],[...i,...a]],[[],[]]);return{horizontal:u,vertical:h}}pt(Xe,"getAlignments");function Ye(w,H){const L=[],P=pt(u=>`${u[0]},${u[1]}`,"posToStr"),T=pt(u=>u.split(",").map(h=>parseInt(h)),"strToPos");return w.forEach(u=>{const h=Object.fromEntries(Object.entries(u).map(([a,o])=>[P(o),a])),r=[P([0,0])],i={},e={L:[-1,0],R:[1,0],T:[0,1],B:[0,-1]};for(;r.length>0;){const a=r.shift();if(a){i[a]=1;const o=h[a];if(o){const f=T(a);Object.entries(e).forEach(([t,s])=>{const l=P([f[0]+s[0],f[1]+s[1]]),g=h[l];g&&!i[l]&&(r.push(l),L.push({[Me[t]]:g,[Me[yi(t)]]:o,gap:1.5*H.getConfigField("iconSize")}))})}}}}),L}pt(Ye,"getRelativeConstraints");function He(w,H,L,P,T,{spatialMaps:u,groupAlignments:h}){return new Promise(r=>{const i=ni("body").append("div").attr("id","cy").attr("style","display:none"),e=be({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(),Ue(L,e),Fe(w,e,T),Se(H,e,T),ke(P,e);const a=Xe(T,u,h),o=Ye(u,T),f=e.layout({name:"fcose",quality:"proof",styleEnabled:!1,animate:!1,nodeDimensionsIncludeLabels:!1,idealEdgeLength(t){const[s,l]=t.connectedNodes(),{parent:g}=te(s),{parent:d}=te(l);return g===d?1.5*T.getConfigField("iconSize"):.5*T.getConfigField("iconSize")},edgeElasticity(t){const[s,l]=t.connectedNodes(),{parent:g}=te(s),{parent:d}=te(l);return g===d?.45:.001},alignmentConstraint:a,relativePlacementConstraint:o});f.one("layoutstop",()=>{function t(s,l,g,d){let N,c;const{x:y,y:A}=s,{x:I,y:F}=l;c=(d-A+(y-g)*(A-F)/(y-I))/Math.sqrt(1+Math.pow((A-F)/(y-I),2)),N=Math.sqrt(Math.pow(d-A,2)+Math.pow(g-y,2)-Math.pow(c,2));const U=Math.sqrt(Math.pow(I-y,2)+Math.pow(F-A,2));N=N/U;let X=(I-y)*(d-A)-(F-A)*(g-y);switch(!0){case X>=0:X=1;break;case X<0:X=-1;break}let Y=(I-y)*(g-y)+(F-A)*(d-A);switch(!0){case Y>=0:Y=1;break;case Y<0:Y=-1;break}return c=Math.abs(c)*X,N=N*Y,{distances:c,weights:N}}pt(t,"getSegmentWeights"),e.startBatch();for(const s of Object.values(e.edges()))if(s.data?.()){const{x:l,y:g}=s.source().position(),{x:d,y:N}=s.target().position();if(l!==d&&g!==N){const c=s.sourceEndpoint(),y=s.targetEndpoint(),{sourceDir:A}=Oe(s),[I,F]=Vt(A)?[c.x,y.y]:[y.x,c.y],{weights:U,distances:X}=t(c,y,I,F);s.style("segment-distances",X),s.style("segment-weights",U)}}e.endBatch(),f.run()}),f.run(),e.ready(t=>{De.info("Ready",t),r(e)})})}pt(He,"layoutArchitecture");var Gi=pt(async(w,H,L,P)=>{const T=P.db,u=T.getServices(),h=T.getJunctions(),r=T.getGroups(),i=T.getEdges(),e=T.getDataStructures(),a=ze(H),o=a.append("g");o.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 Oi(T,f,u),Ri(T,f,h);const s=await He(u,h,r,i,T,e);await Di(o,s,T),await bi(t,s,T),Pe(T,s),Be(void 0,a,T.getConfigField("padding"),T.getConfigField("useMaxWidth"))},"draw"),Fi={draw:Gi},ji={parser:Ge,get db(){return new Re},renderer:Fi,styles:xi};export{ji as diagram};
|
|
//# sourceMappingURL=architectureDiagram-VXUJARFQ-bYoXwm-B.chunk.mjs.map
|