UNPKG

mermaid

Version:

Markdown-ish syntax for generating flowcharts, mindmaps, sequence diagrams, class diagrams, gantt charts, git graphs and more.

37 lines 151 kB
import{a as De}from"./chunk-VSJQYA62.mjs";import{a as je}from"./chunk-VSLJSFIP.mjs";import{a as Ke}from"./chunk-4KE642ED.mjs";import{a as Qe}from"./chunk-XIWCMPW2.mjs";import"./chunk-HJ3FXQNF.mjs";import"./chunk-6ZD6GYE6.mjs";import"./chunk-BARJOBEZ.mjs";import{a as Ue,b as Xe,c as de}from"./chunk-BZCPFP2Z.mjs";import{a as _e}from"./chunk-GSFY7FJO.mjs";import{d as pe}from"./chunk-7CRZUUBC.mjs";import"./chunk-INOGIEW4.mjs";import"./chunk-TI4EEUUG.mjs";import{N as We,P as Ve,Q as ze,R as Be,S as $e,T as ke,U as Ze,V as Je,X as ae,b as ge,fa as qe,s as He}from"./chunk-DMXVZUOD.mjs";import"./chunk-ZR7IV3AY.mjs";import"./chunk-DML4XSUC.mjs";import"./chunk-MHJHRR6Z.mjs";import"./chunk-BKDDFIKN.mjs";import"./chunk-YPUTD6PB.mjs";import"./chunk-6BY5RJGC.mjs";import{a as L,b as Le,e as yr}from"./chunk-GTKDMUJJ.mjs";var Oe=Le((le,xe)=>{"use strict";L(function(w,N){typeof le=="object"&&typeof xe=="object"?xe.exports=N():typeof define=="function"&&define.amd?define([],N):typeof le=="object"?le.layoutBase=N():w.layoutBase=N()},"webpackUniversalModuleDefinition")(le,function(){return function(E){var w={};function N(u){if(w[u])return w[u].exports;var o=w[u]={i:u,l:!1,exports:{}};return E[u].call(o.exports,o,o.exports,N),o.l=!0,o.exports}return L(N,"__webpack_require__"),N.m=E,N.c=w,N.i=function(u){return u},N.d=function(u,o,a){N.o(u,o)||Object.defineProperty(u,o,{configurable:!1,enumerable:!0,get:a})},N.n=function(u){var o=u&&u.__esModule?L(function(){return u.default},"getDefault"):L(function(){return u},"getModuleExports");return N.d(o,"a",o),o},N.o=function(u,o){return Object.prototype.hasOwnProperty.call(u,o)},N.p="",N(N.s=28)}([function(E,w,N){"use strict";function u(){}L(u,"LayoutConstants"),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,E.exports=u},function(E,w,N){"use strict";var u=N(2),o=N(8),a=N(9);function t(c,e,p){u.call(this,p),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=p,this.bendpoints=[],this.source=c,this.target=e}L(t,"LEdge"),t.prototype=Object.create(u.prototype);for(var n in u)t[n]=u[n];t.prototype.getSource=function(){return this.source},t.prototype.getTarget=function(){return this.target},t.prototype.isInterGraph=function(){return this.isInterGraph},t.prototype.getLength=function(){return this.length},t.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},t.prototype.getBendpoints=function(){return this.bendpoints},t.prototype.getLca=function(){return this.lca},t.prototype.getSourceInLca=function(){return this.sourceInLca},t.prototype.getTargetInLca=function(){return this.targetInLca},t.prototype.getOtherEnd=function(c){if(this.source===c)return this.target;if(this.target===c)return this.source;throw"Node is not incident with this edge"},t.prototype.getOtherEndInGraph=function(c,e){for(var p=this.getOtherEnd(c),i=e.getGraphManager().getRoot();;){if(p.getOwner()==e)return p;if(p.getOwner()==i)break;p=p.getOwner().getParent()}return null},t.prototype.updateLength=function(){var c=new Array(4);this.isOverlapingSourceAndTarget=o.getIntersection(this.target.getRect(),this.source.getRect(),c),this.isOverlapingSourceAndTarget||(this.lengthX=c[0]-c[2],this.lengthY=c[1]-c[3],Math.abs(this.lengthX)<1&&(this.lengthX=a.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=a.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},t.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=a.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=a.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},E.exports=t},function(E,w,N){"use strict";function u(o){this.vGraphObject=o}L(u,"LGraphObject"),E.exports=u},function(E,w,N){"use strict";var u=N(2),o=N(10),a=N(13),t=N(0),n=N(16),c=N(5);function e(i,r,h,f){h==null&&f==null&&(f=r),u.call(this,f),i.graphManager!=null&&(i=i.graphManager),this.estimatedSize=o.MIN_VALUE,this.inclusionTreeDepth=o.MAX_VALUE,this.vGraphObject=f,this.edges=[],this.graphManager=i,h!=null&&r!=null?this.rect=new a(r.x,r.y,h.width,h.height):this.rect=new a}L(e,"LNode"),e.prototype=Object.create(u.prototype);for(var p in u)e[p]=u[p];e.prototype.getEdges=function(){return this.edges},e.prototype.getChild=function(){return this.child},e.prototype.getOwner=function(){return this.owner},e.prototype.getWidth=function(){return this.rect.width},e.prototype.setWidth=function(i){this.rect.width=i},e.prototype.getHeight=function(){return this.rect.height},e.prototype.setHeight=function(i){this.rect.height=i},e.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},e.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},e.prototype.getCenter=function(){return new c(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},e.prototype.getLocation=function(){return new c(this.rect.x,this.rect.y)},e.prototype.getRect=function(){return this.rect},e.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},e.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},e.prototype.setRect=function(i,r){this.rect.x=i.x,this.rect.y=i.y,this.rect.width=r.width,this.rect.height=r.height},e.prototype.setCenter=function(i,r){this.rect.x=i-this.rect.width/2,this.rect.y=r-this.rect.height/2},e.prototype.setLocation=function(i,r){this.rect.x=i,this.rect.y=r},e.prototype.moveBy=function(i,r){this.rect.x+=i,this.rect.y+=r},e.prototype.getEdgeListToNode=function(i){var r=[],h,f=this;return f.edges.forEach(function(l){if(l.target==i){if(l.source!=f)throw"Incorrect edge source!";r.push(l)}}),r},e.prototype.getEdgesBetween=function(i){var r=[],h,f=this;return f.edges.forEach(function(l){if(!(l.source==f||l.target==f))throw"Incorrect edge source and/or target";(l.target==i||l.source==i)&&r.push(l)}),r},e.prototype.getNeighborsList=function(){var i=new Set,r=this;return r.edges.forEach(function(h){if(h.source==r)i.add(h.target);else{if(h.target!=r)throw"Incorrect incidency!";i.add(h.source)}}),i},e.prototype.withChildren=function(){var i=new Set,r,h;if(i.add(this),this.child!=null)for(var f=this.child.getNodes(),l=0;l<f.length;l++)r=f[l],h=r.withChildren(),h.forEach(function(A){i.add(A)});return i},e.prototype.getNoOfChildren=function(){var i=0,r;if(this.child==null)i=1;else for(var h=this.child.getNodes(),f=0;f<h.length;f++)r=h[f],i+=r.getNoOfChildren();return i==0&&(i=1),i},e.prototype.getEstimatedSize=function(){if(this.estimatedSize==o.MIN_VALUE)throw"assert failed";return this.estimatedSize},e.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)},e.prototype.scatter=function(){var i,r,h=-t.INITIAL_WORLD_BOUNDARY,f=t.INITIAL_WORLD_BOUNDARY;i=t.WORLD_CENTER_X+n.nextDouble()*(f-h)+h;var l=-t.INITIAL_WORLD_BOUNDARY,A=t.INITIAL_WORLD_BOUNDARY;r=t.WORLD_CENTER_Y+n.nextDouble()*(A-l)+l,this.rect.x=i,this.rect.y=r},e.prototype.updateBounds=function(){if(this.getChild()==null)throw"assert failed";if(this.getChild().getNodes().length!=0){var i=this.getChild();if(i.updateBounds(!0),this.rect.x=i.getLeft(),this.rect.y=i.getTop(),this.setWidth(i.getRight()-i.getLeft()),this.setHeight(i.getBottom()-i.getTop()),t.NODE_DIMENSIONS_INCLUDE_LABELS){var r=i.getRight()-i.getLeft(),h=i.getBottom()-i.getTop();this.labelWidth&&(this.labelPosHorizontal=="left"?(this.rect.x-=this.labelWidth,this.setWidth(r+this.labelWidth)):this.labelPosHorizontal=="center"&&this.labelWidth>r?(this.rect.x-=(this.labelWidth-r)/2,this.setWidth(this.labelWidth)):this.labelPosHorizontal=="right"&&this.setWidth(r+this.labelWidth)),this.labelHeight&&(this.labelPosVertical=="top"?(this.rect.y-=this.labelHeight,this.setHeight(h+this.labelHeight)):this.labelPosVertical=="center"&&this.labelHeight>h?(this.rect.y-=(this.labelHeight-h)/2,this.setHeight(this.labelHeight)):this.labelPosVertical=="bottom"&&this.setHeight(h+this.labelHeight))}}},e.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==o.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},e.prototype.transform=function(i){var r=this.rect.x;r>t.WORLD_BOUNDARY?r=t.WORLD_BOUNDARY:r<-t.WORLD_BOUNDARY&&(r=-t.WORLD_BOUNDARY);var h=this.rect.y;h>t.WORLD_BOUNDARY?h=t.WORLD_BOUNDARY:h<-t.WORLD_BOUNDARY&&(h=-t.WORLD_BOUNDARY);var f=new c(r,h),l=i.inverseTransformPoint(f);this.setLocation(l.x,l.y)},e.prototype.getLeft=function(){return this.rect.x},e.prototype.getRight=function(){return this.rect.x+this.rect.width},e.prototype.getTop=function(){return this.rect.y},e.prototype.getBottom=function(){return this.rect.y+this.rect.height},e.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},E.exports=e},function(E,w,N){"use strict";var u=N(0);function o(){}L(o,"FDLayoutConstants");for(var a in u)o[a]=u[a];o.MAX_ITERATIONS=2500,o.DEFAULT_EDGE_LENGTH=50,o.DEFAULT_SPRING_STRENGTH=.45,o.DEFAULT_REPULSION_STRENGTH=4500,o.DEFAULT_GRAVITY_STRENGTH=.4,o.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,o.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,o.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,o.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,o.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,o.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,o.COOLING_ADAPTATION_FACTOR=.33,o.ADAPTATION_LOWER_NODE_LIMIT=1e3,o.ADAPTATION_UPPER_NODE_LIMIT=5e3,o.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,o.MAX_NODE_DISPLACEMENT=o.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,o.MIN_REPULSION_DIST=o.DEFAULT_EDGE_LENGTH/10,o.CONVERGENCE_CHECK_PERIOD=100,o.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,o.MIN_EDGE_LENGTH=1,o.GRID_CALCULATION_CHECK_PERIOD=10,E.exports=o},function(E,w,N){"use strict";function u(o,a){o==null&&a==null?(this.x=0,this.y=0):(this.x=o,this.y=a)}L(u,"PointD"),u.prototype.getX=function(){return this.x},u.prototype.getY=function(){return this.y},u.prototype.setX=function(o){this.x=o},u.prototype.setY=function(o){this.y=o},u.prototype.getDifference=function(o){return new DimensionD(this.x-o.x,this.y-o.y)},u.prototype.getCopy=function(){return new u(this.x,this.y)},u.prototype.translate=function(o){return this.x+=o.width,this.y+=o.height,this},E.exports=u},function(E,w,N){"use strict";var u=N(2),o=N(10),a=N(0),t=N(7),n=N(3),c=N(1),e=N(13),p=N(12),i=N(11);function r(f,l,A){u.call(this,A),this.estimatedSize=o.MIN_VALUE,this.margin=a.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=f,l!=null&&l instanceof t?this.graphManager=l:l!=null&&l instanceof Layout&&(this.graphManager=l.graphManager)}L(r,"LGraph"),r.prototype=Object.create(u.prototype);for(var h in u)r[h]=u[h];r.prototype.getNodes=function(){return this.nodes},r.prototype.getEdges=function(){return this.edges},r.prototype.getGraphManager=function(){return this.graphManager},r.prototype.getParent=function(){return this.parent},r.prototype.getLeft=function(){return this.left},r.prototype.getRight=function(){return this.right},r.prototype.getTop=function(){return this.top},r.prototype.getBottom=function(){return this.bottom},r.prototype.isConnected=function(){return this.isConnected},r.prototype.add=function(f,l,A){if(l==null&&A==null){var v=f;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(v)>-1)throw"Node already in graph!";return v.owner=this,this.getNodes().push(v),v}else{var y=f;if(!(this.getNodes().indexOf(l)>-1&&this.getNodes().indexOf(A)>-1))throw"Source or target not in graph!";if(!(l.owner==A.owner&&l.owner==this))throw"Both owners must be this graph!";return l.owner!=A.owner?null:(y.source=l,y.target=A,y.isInterGraph=!1,this.getEdges().push(y),l.edges.push(y),A!=l&&A.edges.push(y),y)}},r.prototype.remove=function(f){var l=f;if(f instanceof n){if(l==null)throw"Node is null!";if(!(l.owner!=null&&l.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var A=l.edges.slice(),v,y=A.length,D=0;D<y;D++)v=A[D],v.isInterGraph?this.graphManager.remove(v):v.source.owner.remove(v);var F=this.nodes.indexOf(l);if(F==-1)throw"Node not in owner node list!";this.nodes.splice(F,1)}else if(f instanceof c){var v=f;if(v==null)throw"Edge is null!";if(!(v.source!=null&&v.target!=null))throw"Source and/or target is null!";if(!(v.source.owner!=null&&v.target.owner!=null&&v.source.owner==this&&v.target.owner==this))throw"Source and/or target owner is invalid!";var C=v.source.edges.indexOf(v),G=v.target.edges.indexOf(v);if(!(C>-1&&G>-1))throw"Source and/or target doesn't know this edge!";v.source.edges.splice(C,1),v.target!=v.source&&v.target.edges.splice(G,1);var F=v.source.owner.getEdges().indexOf(v);if(F==-1)throw"Not in owner's edge list!";v.source.owner.getEdges().splice(F,1)}},r.prototype.updateLeftTop=function(){for(var f=o.MAX_VALUE,l=o.MAX_VALUE,A,v,y,D=this.getNodes(),F=D.length,C=0;C<F;C++){var G=D[C];A=G.getTop(),v=G.getLeft(),f>A&&(f=A),l>v&&(l=v)}return f==o.MAX_VALUE?null:(D[0].getParent().paddingLeft!=null?y=D[0].getParent().paddingLeft:y=this.margin,this.left=l-y,this.top=f-y,new p(this.left,this.top))},r.prototype.updateBounds=function(f){for(var l=o.MAX_VALUE,A=-o.MAX_VALUE,v=o.MAX_VALUE,y=-o.MAX_VALUE,D,F,C,G,z,X=this.nodes,rt=X.length,I=0;I<rt;I++){var J=X[I];f&&J.child!=null&&J.updateBounds(),D=J.getLeft(),F=J.getRight(),C=J.getTop(),G=J.getBottom(),l>D&&(l=D),A<F&&(A=F),v>C&&(v=C),y<G&&(y=G)}var s=new e(l,v,A-l,y-v);l==o.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),X[0].getParent().paddingLeft!=null?z=X[0].getParent().paddingLeft:z=this.margin,this.left=s.x-z,this.right=s.x+s.width+z,this.top=s.y-z,this.bottom=s.y+s.height+z},r.calculateBounds=function(f){for(var l=o.MAX_VALUE,A=-o.MAX_VALUE,v=o.MAX_VALUE,y=-o.MAX_VALUE,D,F,C,G,z=f.length,X=0;X<z;X++){var rt=f[X];D=rt.getLeft(),F=rt.getRight(),C=rt.getTop(),G=rt.getBottom(),l>D&&(l=D),A<F&&(A=F),v>C&&(v=C),y<G&&(y=G)}var I=new e(l,v,A-l,y-v);return I},r.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},r.prototype.getEstimatedSize=function(){if(this.estimatedSize==o.MIN_VALUE)throw"assert failed";return this.estimatedSize},r.prototype.calcEstimatedSize=function(){for(var f=0,l=this.nodes,A=l.length,v=0;v<A;v++){var y=l[v];f+=y.calcEstimatedSize()}return f==0?this.estimatedSize=a.EMPTY_COMPOUND_NODE_SIZE:this.estimatedSize=f/Math.sqrt(this.nodes.length),this.estimatedSize},r.prototype.updateConnected=function(){var f=this;if(this.nodes.length==0){this.isConnected=!0;return}var l=new i,A=new Set,v=this.nodes[0],y,D,F=v.withChildren();for(F.forEach(function(I){l.push(I),A.add(I)});l.length!==0;){v=l.shift(),y=v.getEdges();for(var C=y.length,G=0;G<C;G++){var z=y[G];if(D=z.getOtherEndInGraph(v,this),D!=null&&!A.has(D)){var X=D.withChildren();X.forEach(function(I){l.push(I),A.add(I)})}}}if(this.isConnected=!1,A.size>=this.nodes.length){var rt=0;A.forEach(function(I){I.owner==f&&rt++}),rt==this.nodes.length&&(this.isConnected=!0)}},E.exports=r},function(E,w,N){"use strict";var u,o=N(1);function a(t){u=N(6),this.layout=t,this.graphs=[],this.edges=[]}L(a,"LGraphManager"),a.prototype.addRoot=function(){var t=this.layout.newGraph(),n=this.layout.newNode(null),c=this.add(t,n);return this.setRootGraph(c),this.rootGraph},a.prototype.add=function(t,n,c,e,p){if(c==null&&e==null&&p==null){if(t==null)throw"Graph is null!";if(n==null)throw"Parent node is null!";if(this.graphs.indexOf(t)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(t),t.parent!=null)throw"Already has a parent!";if(n.child!=null)throw"Already has a child!";return t.parent=n,n.child=t,t}else{p=c,e=n,c=t;var i=e.getOwner(),r=p.getOwner();if(!(i!=null&&i.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(r!=null&&r.getGraphManager()==this))throw"Target not in this graph mgr!";if(i==r)return c.isInterGraph=!1,i.add(c,e,p);if(c.isInterGraph=!0,c.source=e,c.target=p,this.edges.indexOf(c)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(c),!(c.source!=null&&c.target!=null))throw"Edge source and/or target is null!";if(!(c.source.edges.indexOf(c)==-1&&c.target.edges.indexOf(c)==-1))throw"Edge already in source and/or target incidency list!";return c.source.edges.push(c),c.target.edges.push(c),c}},a.prototype.remove=function(t){if(t instanceof u){var n=t;if(n.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(n==this.rootGraph||n.parent!=null&&n.parent.graphManager==this))throw"Invalid parent node!";var c=[];c=c.concat(n.getEdges());for(var e,p=c.length,i=0;i<p;i++)e=c[i],n.remove(e);var r=[];r=r.concat(n.getNodes());var h;p=r.length;for(var i=0;i<p;i++)h=r[i],n.remove(h);n==this.rootGraph&&this.setRootGraph(null);var f=this.graphs.indexOf(n);this.graphs.splice(f,1),n.parent=null}else if(t instanceof o){if(e=t,e==null)throw"Edge is null!";if(!e.isInterGraph)throw"Not an inter-graph edge!";if(!(e.source!=null&&e.target!=null))throw"Source and/or target is null!";if(!(e.source.edges.indexOf(e)!=-1&&e.target.edges.indexOf(e)!=-1))throw"Source and/or target doesn't know this edge!";var f=e.source.edges.indexOf(e);if(e.source.edges.splice(f,1),f=e.target.edges.indexOf(e),e.target.edges.splice(f,1),!(e.source.owner!=null&&e.source.owner.getGraphManager()!=null))throw"Edge owner graph or owner graph manager is null!";if(e.source.owner.getGraphManager().edges.indexOf(e)==-1)throw"Not in owner graph manager's edge list!";var f=e.source.owner.getGraphManager().edges.indexOf(e);e.source.owner.getGraphManager().edges.splice(f,1)}},a.prototype.updateBounds=function(){this.rootGraph.updateBounds(!0)},a.prototype.getGraphs=function(){return this.graphs},a.prototype.getAllNodes=function(){if(this.allNodes==null){for(var t=[],n=this.getGraphs(),c=n.length,e=0;e<c;e++)t=t.concat(n[e].getNodes());this.allNodes=t}return this.allNodes},a.prototype.resetAllNodes=function(){this.allNodes=null},a.prototype.resetAllEdges=function(){this.allEdges=null},a.prototype.resetAllNodesToApplyGravitation=function(){this.allNodesToApplyGravitation=null},a.prototype.getAllEdges=function(){if(this.allEdges==null){for(var t=[],n=this.getGraphs(),c=n.length,e=0;e<n.length;e++)t=t.concat(n[e].getEdges());t=t.concat(this.edges),this.allEdges=t}return this.allEdges},a.prototype.getAllNodesToApplyGravitation=function(){return this.allNodesToApplyGravitation},a.prototype.setAllNodesToApplyGravitation=function(t){if(this.allNodesToApplyGravitation!=null)throw"assert failed";this.allNodesToApplyGravitation=t},a.prototype.getRoot=function(){return this.rootGraph},a.prototype.setRootGraph=function(t){if(t.getGraphManager()!=this)throw"Root not in this graph mgr!";this.rootGraph=t,t.parent==null&&(t.parent=this.layout.newNode("Root node"))},a.prototype.getLayout=function(){return this.layout},a.prototype.isOneAncestorOfOther=function(t,n){if(!(t!=null&&n!=null))throw"assert failed";if(t==n)return!0;var c=t.getOwner(),e;do{if(e=c.getParent(),e==null)break;if(e==n)return!0;if(c=e.getOwner(),c==null)break}while(!0);c=n.getOwner();do{if(e=c.getParent(),e==null)break;if(e==t)return!0;if(c=e.getOwner(),c==null)break}while(!0);return!1},a.prototype.calcLowestCommonAncestors=function(){for(var t,n,c,e,p,i=this.getAllEdges(),r=i.length,h=0;h<r;h++){if(t=i[h],n=t.source,c=t.target,t.lca=null,t.sourceInLca=n,t.targetInLca=c,n==c){t.lca=n.getOwner();continue}for(e=n.getOwner();t.lca==null;){for(t.targetInLca=c,p=c.getOwner();t.lca==null;){if(p==e){t.lca=p;break}if(p==this.rootGraph)break;if(t.lca!=null)throw"assert failed";t.targetInLca=p.getParent(),p=t.targetInLca.getOwner()}if(e==this.rootGraph)break;t.lca==null&&(t.sourceInLca=e.getParent(),e=t.sourceInLca.getOwner())}if(t.lca==null)throw"assert failed"}},a.prototype.calcLowestCommonAncestor=function(t,n){if(t==n)return t.getOwner();var c=t.getOwner();do{if(c==null)break;var e=n.getOwner();do{if(e==null)break;if(e==c)return e;e=e.getParent().getOwner()}while(!0);c=c.getParent().getOwner()}while(!0);return c},a.prototype.calcInclusionTreeDepths=function(t,n){t==null&&n==null&&(t=this.rootGraph,n=1);for(var c,e=t.getNodes(),p=e.length,i=0;i<p;i++)c=e[i],c.inclusionTreeDepth=n,c.child!=null&&this.calcInclusionTreeDepths(c.child,n+1)},a.prototype.includesInvalidEdge=function(){for(var t,n=[],c=this.edges.length,e=0;e<c;e++)t=this.edges[e],this.isOneAncestorOfOther(t.source,t.target)&&n.push(t);for(var e=0;e<n.length;e++)this.remove(n[e]);return!1},E.exports=a},function(E,w,N){"use strict";var u=N(12);function o(){}L(o,"IGeometry"),o.calcSeparationAmount=function(a,t,n,c){if(!a.intersects(t))throw"assert failed";var e=new Array(2);this.decideDirectionsForOverlappingNodes(a,t,e),n[0]=Math.min(a.getRight(),t.getRight())-Math.max(a.x,t.x),n[1]=Math.min(a.getBottom(),t.getBottom())-Math.max(a.y,t.y),a.getX()<=t.getX()&&a.getRight()>=t.getRight()?n[0]+=Math.min(t.getX()-a.getX(),a.getRight()-t.getRight()):t.getX()<=a.getX()&&t.getRight()>=a.getRight()&&(n[0]+=Math.min(a.getX()-t.getX(),t.getRight()-a.getRight())),a.getY()<=t.getY()&&a.getBottom()>=t.getBottom()?n[1]+=Math.min(t.getY()-a.getY(),a.getBottom()-t.getBottom()):t.getY()<=a.getY()&&t.getBottom()>=a.getBottom()&&(n[1]+=Math.min(a.getY()-t.getY(),t.getBottom()-a.getBottom()));var p=Math.abs((t.getCenterY()-a.getCenterY())/(t.getCenterX()-a.getCenterX()));t.getCenterY()===a.getCenterY()&&t.getCenterX()===a.getCenterX()&&(p=1);var i=p*n[0],r=n[1]/p;n[0]<r?r=n[0]:i=n[1],n[0]=-1*e[0]*(r/2+c),n[1]=-1*e[1]*(i/2+c)},o.decideDirectionsForOverlappingNodes=function(a,t,n){a.getCenterX()<t.getCenterX()?n[0]=-1:n[0]=1,a.getCenterY()<t.getCenterY()?n[1]=-1:n[1]=1},o.getIntersection2=function(a,t,n){var c=a.getCenterX(),e=a.getCenterY(),p=t.getCenterX(),i=t.getCenterY();if(a.intersects(t))return n[0]=c,n[1]=e,n[2]=p,n[3]=i,!0;var r=a.getX(),h=a.getY(),f=a.getRight(),l=a.getX(),A=a.getBottom(),v=a.getRight(),y=a.getWidthHalf(),D=a.getHeightHalf(),F=t.getX(),C=t.getY(),G=t.getRight(),z=t.getX(),X=t.getBottom(),rt=t.getRight(),I=t.getWidthHalf(),J=t.getHeightHalf(),s=!1,m=!1;if(c===p){if(e>i)return n[0]=c,n[1]=h,n[2]=p,n[3]=X,!1;if(e<i)return n[0]=c,n[1]=A,n[2]=p,n[3]=C,!1}else if(e===i){if(c>p)return n[0]=r,n[1]=e,n[2]=G,n[3]=i,!1;if(c<p)return n[0]=f,n[1]=e,n[2]=F,n[3]=i,!1}else{var g=a.height/a.width,T=t.height/t.width,d=(i-e)/(p-c),O=void 0,x=void 0,P=void 0,S=void 0,R=void 0,Z=void 0;if(-g===d?c>p?(n[0]=l,n[1]=A,s=!0):(n[0]=f,n[1]=h,s=!0):g===d&&(c>p?(n[0]=r,n[1]=h,s=!0):(n[0]=v,n[1]=A,s=!0)),-T===d?p>c?(n[2]=z,n[3]=X,m=!0):(n[2]=G,n[3]=C,m=!0):T===d&&(p>c?(n[2]=F,n[3]=C,m=!0):(n[2]=rt,n[3]=X,m=!0)),s&&m)return!1;if(c>p?e>i?(O=this.getCardinalDirection(g,d,4),x=this.getCardinalDirection(T,d,2)):(O=this.getCardinalDirection(-g,d,3),x=this.getCardinalDirection(-T,d,1)):e>i?(O=this.getCardinalDirection(-g,d,1),x=this.getCardinalDirection(-T,d,3)):(O=this.getCardinalDirection(g,d,2),x=this.getCardinalDirection(T,d,4)),!s)switch(O){case 1:S=h,P=c+-D/d,n[0]=P,n[1]=S;break;case 2:P=v,S=e+y*d,n[0]=P,n[1]=S;break;case 3:S=A,P=c+D/d,n[0]=P,n[1]=S;break;case 4:P=l,S=e+-y*d,n[0]=P,n[1]=S;break}if(!m)switch(x){case 1:Z=C,R=p+-J/d,n[2]=R,n[3]=Z;break;case 2:R=rt,Z=i+I*d,n[2]=R,n[3]=Z;break;case 3:Z=X,R=p+J/d,n[2]=R,n[3]=Z;break;case 4:R=z,Z=i+-I*d,n[2]=R,n[3]=Z;break}}return!1},o.getCardinalDirection=function(a,t,n){return a>t?n:1+n%4},o.getIntersection=function(a,t,n,c){if(c==null)return this.getIntersection2(a,t,n);var e=a.x,p=a.y,i=t.x,r=t.y,h=n.x,f=n.y,l=c.x,A=c.y,v=void 0,y=void 0,D=void 0,F=void 0,C=void 0,G=void 0,z=void 0,X=void 0,rt=void 0;return D=r-p,C=e-i,z=i*p-e*r,F=A-f,G=h-l,X=l*f-h*A,rt=D*G-F*C,rt===0?null:(v=(C*X-G*z)/rt,y=(F*z-D*X)/rt,new u(v,y))},o.angleOfVector=function(a,t,n,c){var e=void 0;return a!==n?(e=Math.atan((c-t)/(n-a)),n<a?e+=Math.PI:c<t&&(e+=this.TWO_PI)):c<t?e=this.ONE_AND_HALF_PI:e=this.HALF_PI,e},o.doIntersect=function(a,t,n,c){var e=a.x,p=a.y,i=t.x,r=t.y,h=n.x,f=n.y,l=c.x,A=c.y,v=(i-e)*(A-f)-(l-h)*(r-p);if(v===0)return!1;var y=((A-f)*(l-e)+(h-l)*(A-p))/v,D=((p-r)*(l-e)+(i-e)*(A-p))/v;return 0<y&&y<1&&0<D&&D<1},o.findCircleLineIntersections=function(a,t,n,c,e,p,i){var r=(n-a)*(n-a)+(c-t)*(c-t),h=2*((a-e)*(n-a)+(t-p)*(c-t)),f=(a-e)*(a-e)+(t-p)*(t-p)-i*i,l=h*h-4*r*f;if(l>=0){var A=(-h+Math.sqrt(h*h-4*r*f))/(2*r),v=(-h-Math.sqrt(h*h-4*r*f))/(2*r),y=null;return A>=0&&A<=1?[A]:v>=0&&v<=1?[v]:y}else return null},o.HALF_PI=.5*Math.PI,o.ONE_AND_HALF_PI=1.5*Math.PI,o.TWO_PI=2*Math.PI,o.THREE_PI=3*Math.PI,E.exports=o},function(E,w,N){"use strict";function u(){}L(u,"IMath"),u.sign=function(o){return o>0?1:o<0?-1:0},u.floor=function(o){return o<0?Math.ceil(o):Math.floor(o)},u.ceil=function(o){return o<0?Math.floor(o):Math.ceil(o)},E.exports=u},function(E,w,N){"use strict";function u(){}L(u,"Integer"),u.MAX_VALUE=2147483647,u.MIN_VALUE=-2147483648,E.exports=u},function(E,w,N){"use strict";var u=function(){function e(p,i){for(var r=0;r<i.length;r++){var h=i[r];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(p,h.key,h)}}return L(e,"defineProperties"),function(p,i,r){return i&&e(p.prototype,i),r&&e(p,r),p}}();function o(e,p){if(!(e instanceof p))throw new TypeError("Cannot call a class as a function")}L(o,"_classCallCheck");var a=L(function(p){return{value:p,next:null,prev:null}},"nodeFrom"),t=L(function(p,i,r,h){return p!==null?p.next=i:h.head=i,r!==null?r.prev=i:h.tail=i,i.prev=p,i.next=r,h.length++,i},"add"),n=L(function(p,i){var r=p.prev,h=p.next;return r!==null?r.next=h:i.head=h,h!==null?h.prev=r:i.tail=r,p.prev=p.next=null,i.length--,p},"_remove"),c=function(){function e(p){var i=this;o(this,e),this.length=0,this.head=null,this.tail=null,p?.forEach(function(r){return i.push(r)})}return L(e,"LinkedList"),u(e,[{key:"size",value:L(function(){return this.length},"size")},{key:"insertBefore",value:L(function(i,r){return t(r.prev,a(i),r,this)},"insertBefore")},{key:"insertAfter",value:L(function(i,r){return t(r,a(i),r.next,this)},"insertAfter")},{key:"insertNodeBefore",value:L(function(i,r){return t(r.prev,i,r,this)},"insertNodeBefore")},{key:"insertNodeAfter",value:L(function(i,r){return t(r,i,r.next,this)},"insertNodeAfter")},{key:"push",value:L(function(i){return t(this.tail,a(i),null,this)},"push")},{key:"unshift",value:L(function(i){return t(null,a(i),this.head,this)},"unshift")},{key:"remove",value:L(function(i){return n(i,this)},"remove")},{key:"pop",value:L(function(){return n(this.tail,this).value},"pop")},{key:"popNode",value:L(function(){return n(this.tail,this)},"popNode")},{key:"shift",value:L(function(){return n(this.head,this).value},"shift")},{key:"shiftNode",value:L(function(){return n(this.head,this)},"shiftNode")},{key:"get_object_at",value:L(function(i){if(i<=this.length()){for(var r=1,h=this.head;r<i;)h=h.next,r++;return h.value}},"get_object_at")},{key:"set_object_at",value:L(function(i,r){if(i<=this.length()){for(var h=1,f=this.head;h<i;)f=f.next,h++;f.value=r}},"set_object_at")}]),e}();E.exports=c},function(E,w,N){"use strict";function u(o,a,t){this.x=null,this.y=null,o==null&&a==null&&t==null?(this.x=0,this.y=0):typeof o=="number"&&typeof a=="number"&&t==null?(this.x=o,this.y=a):o.constructor.name=="Point"&&a==null&&t==null&&(t=o,this.x=t.x,this.y=t.y)}L(u,"Point"),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(o,a,t){o.constructor.name=="Point"&&a==null&&t==null?(t=o,this.setLocation(t.x,t.y)):typeof o=="number"&&typeof a=="number"&&t==null&&(parseInt(o)==o&&parseInt(a)==a?this.move(o,a):(this.x=Math.floor(o+.5),this.y=Math.floor(a+.5)))},u.prototype.move=function(o,a){this.x=o,this.y=a},u.prototype.translate=function(o,a){this.x+=o,this.y+=a},u.prototype.equals=function(o){if(o.constructor.name=="Point"){var a=o;return this.x==a.x&&this.y==a.y}return this==o},u.prototype.toString=function(){return new u().constructor.name+"[x="+this.x+",y="+this.y+"]"},E.exports=u},function(E,w,N){"use strict";function u(o,a,t,n){this.x=0,this.y=0,this.width=0,this.height=0,o!=null&&a!=null&&t!=null&&n!=null&&(this.x=o,this.y=a,this.width=t,this.height=n)}L(u,"RectangleD"),u.prototype.getX=function(){return this.x},u.prototype.setX=function(o){this.x=o},u.prototype.getY=function(){return this.y},u.prototype.setY=function(o){this.y=o},u.prototype.getWidth=function(){return this.width},u.prototype.setWidth=function(o){this.width=o},u.prototype.getHeight=function(){return this.height},u.prototype.setHeight=function(o){this.height=o},u.prototype.getRight=function(){return this.x+this.width},u.prototype.getBottom=function(){return this.y+this.height},u.prototype.intersects=function(o){return!(this.getRight()<o.x||this.getBottom()<o.y||o.getRight()<this.x||o.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},E.exports=u},function(E,w,N){"use strict";var u=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(a){return typeof a}:function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a};function o(){}L(o,"UniqueIDGeneretor"),o.lastID=0,o.createID=function(a){return o.isPrimitive(a)?a:(a.uniqueID!=null||(a.uniqueID=o.getString(),o.lastID++),a.uniqueID)},o.getString=function(a){return a==null&&(a=o.lastID),"Object#"+a},o.isPrimitive=function(a){var t=typeof a>"u"?"undefined":u(a);return a==null||t!="object"&&t!="function"},E.exports=o},function(E,w,N){"use strict";function u(h){if(Array.isArray(h)){for(var f=0,l=Array(h.length);f<h.length;f++)l[f]=h[f];return l}else return Array.from(h)}L(u,"_toConsumableArray");var o=N(0),a=N(7),t=N(3),n=N(1),c=N(6),e=N(5),p=N(17),i=N(29);function r(h){i.call(this),this.layoutQuality=o.QUALITY,this.createBendsAsNeeded=o.DEFAULT_CREATE_BENDS_AS_NEEDED,this.incremental=o.DEFAULT_INCREMENTAL,this.animationOnLayout=o.DEFAULT_ANIMATION_ON_LAYOUT,this.animationDuringLayout=o.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=o.DEFAULT_ANIMATION_PERIOD,this.uniformLeafNodeSizes=o.DEFAULT_UNIFORM_LEAF_NODE_SIZES,this.edgeToDummyNodes=new Map,this.graphManager=new a(this),this.isLayoutFinished=!1,this.isSubLayout=!1,this.isRemoteUse=!1,h!=null&&(this.isRemoteUse=h)}L(r,"Layout"),r.RANDOM_SEED=1,r.prototype=Object.create(i.prototype),r.prototype.getGraphManager=function(){return this.graphManager},r.prototype.getAllNodes=function(){return this.graphManager.getAllNodes()},r.prototype.getAllEdges=function(){return this.graphManager.getAllEdges()},r.prototype.getAllNodesToApplyGravitation=function(){return this.graphManager.getAllNodesToApplyGravitation()},r.prototype.newGraphManager=function(){var h=new a(this);return this.graphManager=h,h},r.prototype.newGraph=function(h){return new c(null,this.graphManager,h)},r.prototype.newNode=function(h){return new t(this.graphManager,h)},r.prototype.newEdge=function(h){return new n(null,null,h)},r.prototype.checkLayoutSuccess=function(){return this.graphManager.getRoot()==null||this.graphManager.getRoot().getNodes().length==0||this.graphManager.includesInvalidEdge()},r.prototype.runLayout=function(){this.isLayoutFinished=!1,this.tilingPreLayout&&this.tilingPreLayout(),this.initParameters();var h;return this.checkLayoutSuccess()?h=!1:h=this.layout(),o.ANIMATE==="during"?!1:(h&&(this.isSubLayout||this.doPostLayout()),this.tilingPostLayout&&this.tilingPostLayout(),this.isLayoutFinished=!0,h)},r.prototype.doPostLayout=function(){this.incremental||this.transform(),this.update()},r.prototype.update2=function(){if(this.createBendsAsNeeded&&(this.createBendpointsFromDummyNodes(),this.graphManager.resetAllEdges()),!this.isRemoteUse){for(var h,f=this.graphManager.getAllEdges(),l=0;l<f.length;l++)h=f[l];for(var A,v=this.graphManager.getRoot().getNodes(),l=0;l<v.length;l++)A=v[l];this.update(this.graphManager.getRoot())}},r.prototype.update=function(h){if(h==null)this.update2();else if(h instanceof t){var f=h;if(f.getChild()!=null)for(var l=f.getChild().getNodes(),A=0;A<l.length;A++)update(l[A]);if(f.vGraphObject!=null){var v=f.vGraphObject;v.update(f)}}else if(h instanceof n){var y=h;if(y.vGraphObject!=null){var D=y.vGraphObject;D.update(y)}}else if(h instanceof c){var F=h;if(F.vGraphObject!=null){var C=F.vGraphObject;C.update(F)}}},r.prototype.initParameters=function(){this.isSubLayout||(this.layoutQuality=o.QUALITY,this.animationDuringLayout=o.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=o.DEFAULT_ANIMATION_PERIOD,this.animationOnLayout=o.DEFAULT_ANIMATION_ON_LAYOUT,this.incremental=o.DEFAULT_INCREMENTAL,this.createBendsAsNeeded=o.DEFAULT_CREATE_BENDS_AS_NEEDED,this.uniformLeafNodeSizes=o.DEFAULT_UNIFORM_LEAF_NODE_SIZES),this.animationDuringLayout&&(this.animationOnLayout=!1)},r.prototype.transform=function(h){if(h==null)this.transform(new e(0,0));else{var f=new p,l=this.graphManager.getRoot().updateLeftTop();if(l!=null){f.setWorldOrgX(h.x),f.setWorldOrgY(h.y),f.setDeviceOrgX(l.x),f.setDeviceOrgY(l.y);for(var A=this.getAllNodes(),v,y=0;y<A.length;y++)v=A[y],v.transform(f)}}},r.prototype.positionNodesRandomly=function(h){if(h==null)this.positionNodesRandomly(this.getGraphManager().getRoot()),this.getGraphManager().getRoot().updateBounds(!0);else for(var f,l,A=h.getNodes(),v=0;v<A.length;v++)f=A[v],l=f.getChild(),l==null||l.getNodes().length==0?f.scatter():(this.positionNodesRandomly(l),f.updateBounds())},r.prototype.getFlatForest=function(){for(var h=[],f=!0,l=this.graphManager.getRoot().getNodes(),A=!0,v=0;v<l.length;v++)l[v].getChild()!=null&&(A=!1);if(!A)return h;var y=new Set,D=[],F=new Map,C=[];for(C=C.concat(l);C.length>0&&f;){for(D.push(C[0]);D.length>0&&f;){var G=D[0];D.splice(0,1),y.add(G);for(var z=G.getEdges(),v=0;v<z.length;v++){var X=z[v].getOtherEnd(G);if(F.get(G)!=X)if(!y.has(X))D.push(X),F.set(X,G);else{f=!1;break}}}if(!f)h=[];else{var rt=[].concat(u(y));h.push(rt);for(var v=0;v<rt.length;v++){var I=rt[v],J=C.indexOf(I);J>-1&&C.splice(J,1)}y=new Set,F=new Map}}return h},r.prototype.createDummyNodesForBendpoints=function(h){for(var f=[],l=h.source,A=this.graphManager.calcLowestCommonAncestor(h.source,h.target),v=0;v<h.bendpoints.length;v++){var y=this.newNode(null);y.setRect(new Point(0,0),new Dimension(1,1)),A.add(y);var D=this.newEdge(null);this.graphManager.add(D,l,y),f.add(y),l=y}var D=this.newEdge(null);return this.graphManager.add(D,l,h.target),this.edgeToDummyNodes.set(h,f),h.isInterGraph()?this.graphManager.remove(h):A.remove(h),f},r.prototype.createBendpointsFromDummyNodes=function(){var h=[];h=h.concat(this.graphManager.getAllEdges()),h=[].concat(u(this.edgeToDummyNodes.keys())).concat(h);for(var f=0;f<h.length;f++){var l=h[f];if(l.bendpoints.length>0){for(var A=this.edgeToDummyNodes.get(l),v=0;v<A.length;v++){var y=A[v],D=new e(y.getCenterX(),y.getCenterY()),F=l.bendpoints.get(v);F.x=D.x,F.y=D.y,y.getOwner().remove(y)}this.graphManager.add(l,l.source,l.target)}}},r.transform=function(h,f,l,A){if(l!=null&&A!=null){var v=f;if(h<=50){var y=f/l;v-=(f-y)/50*(50-h)}else{var D=f*A;v+=(D-f)/50*(h-50)}return v}else{var F,C;return h<=50?(F=9*f/500,C=f/10):(F=9*f/50,C=-8*f),F*h+C}},r.findCenterOfTree=function(h){var f=[];f=f.concat(h);var l=[],A=new Map,v=!1,y=null;(f.length==1||f.length==2)&&(v=!0,y=f[0]);for(var D=0;D<f.length;D++){var F=f[D],C=F.getNeighborsList().size;A.set(F,F.getNeighborsList().size),C==1&&l.push(F)}var G=[];for(G=G.concat(l);!v;){var z=[];z=z.concat(G),G=[];for(var D=0;D<f.length;D++){var F=f[D],X=f.indexOf(F);X>=0&&f.splice(X,1);var rt=F.getNeighborsList();rt.forEach(function(s){if(l.indexOf(s)<0){var m=A.get(s),g=m-1;g==1&&G.push(s),A.set(s,g)}})}l=l.concat(G),(f.length==1||f.length==2)&&(v=!0,y=f[0])}return y},r.prototype.setGraphManager=function(h){this.graphManager=h},E.exports=r},function(E,w,N){"use strict";function u(){}L(u,"RandomSeed"),u.seed=1,u.x=0,u.nextDouble=function(){return u.x=Math.sin(u.seed++)*1e4,u.x-Math.floor(u.x)},E.exports=u},function(E,w,N){"use strict";var u=N(5);function o(a,t){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}L(o,"Transform"),o.prototype.getWorldOrgX=function(){return this.lworldOrgX},o.prototype.setWorldOrgX=function(a){this.lworldOrgX=a},o.prototype.getWorldOrgY=function(){return this.lworldOrgY},o.prototype.setWorldOrgY=function(a){this.lworldOrgY=a},o.prototype.getWorldExtX=function(){return this.lworldExtX},o.prototype.setWorldExtX=function(a){this.lworldExtX=a},o.prototype.getWorldExtY=function(){return this.lworldExtY},o.prototype.setWorldExtY=function(a){this.lworldExtY=a},o.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},o.prototype.setDeviceOrgX=function(a){this.ldeviceOrgX=a},o.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},o.prototype.setDeviceOrgY=function(a){this.ldeviceOrgY=a},o.prototype.getDeviceExtX=function(){return this.ldeviceExtX},o.prototype.setDeviceExtX=function(a){this.ldeviceExtX=a},o.prototype.getDeviceExtY=function(){return this.ldeviceExtY},o.prototype.setDeviceExtY=function(a){this.ldeviceExtY=a},o.prototype.transformX=function(a){var t=0,n=this.lworldExtX;return n!=0&&(t=this.ldeviceOrgX+(a-this.lworldOrgX)*this.ldeviceExtX/n),t},o.prototype.transformY=function(a){var t=0,n=this.lworldExtY;return n!=0&&(t=this.ldeviceOrgY+(a-this.lworldOrgY)*this.ldeviceExtY/n),t},o.prototype.inverseTransformX=function(a){var t=0,n=this.ldeviceExtX;return n!=0&&(t=this.lworldOrgX+(a-this.ldeviceOrgX)*this.lworldExtX/n),t},o.prototype.inverseTransformY=function(a){var t=0,n=this.ldeviceExtY;return n!=0&&(t=this.lworldOrgY+(a-this.ldeviceOrgY)*this.lworldExtY/n),t},o.prototype.inverseTransformPoint=function(a){var t=new u(this.inverseTransformX(a.x),this.inverseTransformY(a.y));return t},E.exports=o},function(E,w,N){"use strict";function u(i){if(Array.isArray(i)){for(var r=0,h=Array(i.length);r<i.length;r++)h[r]=i[r];return h}else return Array.from(i)}L(u,"_toConsumableArray");var o=N(15),a=N(4),t=N(0),n=N(8),c=N(9);function e(){o.call(this),this.useSmartIdealEdgeLengthCalculation=a.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=a.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=a.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=a.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=a.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*a.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=a.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=a.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=a.MAX_ITERATIONS}L(e,"FDLayout"),e.prototype=Object.create(o.prototype);for(var p in o)e[p]=o[p];e.prototype.initParameters=function(){o.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=a.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},e.prototype.calcIdealEdgeLengths=function(){for(var i,r,h,f,l,A,v,y=this.getGraphManager().getAllEdges(),D=0;D<y.length;D++)i=y[D],r=i.idealLength,i.isInterGraph&&(f=i.getSource(),l=i.getTarget(),A=i.getSourceInLca().getEstimatedSize(),v=i.getTargetInLca().getEstimatedSize(),this.useSmartIdealEdgeLengthCalculation&&(i.idealLength+=A+v-2*t.SIMPLE_NODE_SIZE),h=i.getLca().getInclusionTreeDepth(),i.idealLength+=r*a.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR*(f.getInclusionTreeDepth()+l.getInclusionTreeDepth()-2*h))},e.prototype.initSpringEmbedder=function(){var i=this.getAllNodes().length;this.incremental?(i>a.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*a.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(i-a.ADAPTATION_LOWER_NODE_LIMIT)/(a.ADAPTATION_UPPER_NODE_LIMIT-a.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-a.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=a.MAX_NODE_DISPLACEMENT_INCREMENTAL):(i>a.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(a.COOLING_ADAPTATION_FACTOR,1-(i-a.ADAPTATION_LOWER_NODE_LIMIT)/(a.ADAPTATION_UPPER_NODE_LIMIT-a.ADAPTATION_LOWER_NODE_LIMIT)*(1-a.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=a.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.displacementThresholdPerNode=3*a.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},e.prototype.calcSpringForces=function(){for(var i=this.getAllEdges(),r,h=0;h<i.length;h++)r=i[h],this.calcSpringForce(r,r.idealLength)},e.prototype.calcRepulsionForces=function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,h,f,l,A,v=this.getAllNodes(),y;if(this.useFRGridVariant)for(this.totalIterations%a.GRID_CALCULATION_CHECK_PERIOD==1&&i&&this.updateGrid(),y=new Set,h=0;h<v.length;h++)l=v[h],this.calculateRepulsionForceOfANode(l,y,i,r),y.add(l);else for(h=0;h<v.length;h++)for(l=v[h],f=h+1;f<v.length;f++)A=v[f],l.getOwner()==A.getOwner()&&this.calcRepulsionForce(l,A)},e.prototype.calcGravitationalForces=function(){for(var i,r=this.getAllNodesToApplyGravitation(),h=0;h<r.length;h++)i=r[h],this.calcGravitationalForce(i)},e.prototype.moveNodes=function(){for(var i=this.getAllNodes(),r,h=0;h<i.length;h++)r=i[h],r.move()},e.prototype.calcSpringForce=function(i,r){var h=i.getSource(),f=i.getTarget(),l,A,v,y;if(this.uniformLeafNodeSizes&&h.getChild()==null&&f.getChild()==null)i.updateLengthSimple();else if(i.updateLength(),i.isOverlapingSourceAndTarget)return;l=i.getLength(),l!=0&&(A=i.edgeElasticity*(l-r),v=A*(i.lengthX/l),y=A*(i.lengthY/l),h.springForceX+=v,h.springForceY+=y,f.springForceX-=v,f.springForceY-=y)},e.prototype.calcRepulsionForce=function(i,r){var h=i.getRect(),f=r.getRect(),l=new Array(2),A=new Array(4),v,y,D,F,C,G,z;if(h.intersects(f)){n.calcSeparationAmount(h,f,l,a.DEFAULT_EDGE_LENGTH/2),G=2*l[0],z=2*l[1];var X=i.noOfChildren*r.noOfChildren/(i.noOfChildren+r.noOfChildren);i.repulsionForceX-=X*G,i.repulsionForceY-=X*z,r.repulsionForceX+=X*G,r.repulsionForceY+=X*z}else this.uniformLeafNodeSizes&&i.getChild()==null&&r.getChild()==null?(v=f.getCenterX()-h.getCenterX(),y=f.getCenterY()-h.getCenterY()):(n.getIntersection(h,f,A),v=A[2]-A[0],y=A[3]-A[1]),Math.abs(v)<a.MIN_REPULSION_DIST&&(v=c.sign(v)*a.MIN_REPULSION_DIST),Math.abs(y)<a.MIN_REPULSION_DIST&&(y=c.sign(y)*a.MIN_REPULSION_DIST),D=v*v+y*y,F=Math.sqrt(D),C=(i.nodeRepulsion/2+r.nodeRepulsion/2)*i.noOfChildren*r.noOfChildren/D,G=C*v/F,z=C*y/F,i.repulsionForceX-=G,i.repulsionForceY-=z,r.repulsionForceX+=G,r.repulsionForceY+=z},e.prototype.calcGravitationalForce=function(i){var r,h,f,l,A,v,y,D;r=i.getOwner(),h=(r.getRight()+r.getLeft())/2,f=(r.getTop()+r.getBottom())/2,l=i.getCenterX()-h,A=i.getCenterY()-f,v=Math.abs(l)+i.getWidth()/2,y=Math.abs(A)+i.getHeight()/2,i.getOwner()==this.graphManager.getRoot()?(D=r.getEstimatedSize()*this.gravityRangeFactor,(v>D||y>D)&&(i.gravitationForceX=-this.gravityConstant*l,i.gravitationForceY=-this.gravityConstant*A)):(D=r.getEstimatedSize()*this.compoundGravityRangeFactor,(v>D||y>D)&&(i.gravitationForceX=-this.gravityConstant*l*this.compoundGravityConstant,i.gravitationForceY=-this.gravityConstant*A*this.compoundGravityConstant))},e.prototype.isConverged=function(){var i,r=!1;return this.totalIterations>this.maxIterations/3&&(r=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),i=this.totalDisplacement<this.totalDisplacementThreshold,this.oldTotalDisplacement=this.totalDisplacement,i||r},e.prototype.animate=function(){this.animationDuringLayout&&!this.isSubLayout&&(this.notAnimatedIterations==this.animationPeriod?(this.update(),this.notAnimatedIterations=0):this.notAnimatedIterations++)},e.prototype.calcNoOfChildrenForAllNodes=function(){for(var i,r=this.graphManager.getAllNodes(),h=0;h<r.length;h++)i=r[h],i.noOfChildren=i.getNoOfChildren()},e.prototype.calcGrid=function(i){var r=0,h=0;r=parseInt(Math.ceil((i.getRight()-i.getLeft())/this.repulsionRange)),h=parseInt(Math.ceil((i.getBottom()-i.getTop())/this.repulsionRange));for(var f=new Array(r),l=0;l<r;l++)f[l]=new Array(h);for(var l=0;l<r;l++)for(var A=0;A<h;A++)f[l][A]=new Array;return f},e.prototype.addNodeToGrid=function(i,r,h){var f=0,l=0,A=0,v=0;f=parseInt(Math.floor((i.getRect().x-r)/this.repulsionRange)),l=parseInt(Math.floor((i.getRect().width+i.getRect().x-r)/this.repulsionRange)),A=parseInt(Math.floor((i.getRect().y-h)/this.repulsionRange)),v=parseInt(Math.floor((i.getRect().height+i.getRect().y-h)/this.repulsionRange));for(var y=f;y<=l;y++)for(var D=A;D<=v;D++)this.grid[y][D].push(i),i.setGridCoordinates(f,l,A,v)},e.prototype.updateGrid=function(){var i,r,h=this.getAllNodes();for(this.grid=this.calcGrid(this.graphManager.getRoot()),i=0;i<h.length;i++)r=h[i],this.addNodeToGrid(r,this.graphManager.getRoot().getLeft(),this.graphManager.getRoot().getTop())},e.prototype.calculateRepulsionForceOfANode=function(i,r,h,f){if(this.totalIterations%a.GRID_CALCULATION_CHECK_PERIOD==1&&h||f){var l=new Set;i.surrounding=new Array;for(var A,v=this.grid,y=i.startX-1;y<i.finishX+2;y++)for(var D=i.startY-1;D<i.finishY+2;D++)if(!(y<0||D<0||y>=v.length||D>=v[0].length)){for(var F=0;F<v[y][D].length;F++)if(A=v[y][D][F],!(i.getOwner()!=A.getOwner()||i==A)&&!r.has(A)&&!l.has(A)){var C=Math.abs(i.getCenterX()-A.getCenterX())-(i.getWidth()/2+A.getWidth()/2),G=Math.abs(i.getCenterY()-A.getCenterY())-(i.getHeight()/2+A.getHeight()/2);C<=this.repulsionRange&&G<=this.repulsionRange&&l.add(A)}}i.surrounding=[].concat(u(l))}for(y=0;y<i.surrounding.length;y++)this.calcRepulsionForce(i,i.surrounding[y])},e.prototype.calcRepulsionRange=function(){return 0},E.exports=e},function(E,w,N){"use strict";var u=N(1),o=N(4);function a(n,c,e){u.call(this,n,c,e),this.idealLength=o.DEFAULT_EDGE_LENGTH,this.edgeElasticity=o.DEFAULT_SPRING_STRENGTH}L(a,"FDLayoutEdge"),a.prototype=Object.create(u.prototype);for(var t in u)a[t]=u[t];E.exports=a},function(E,w,N){"use strict";var u=N(3),o=N(4);function a(n,c,e,p){u.call(this,n,c,e,p),this.nodeRepulsion=o.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=[]}L(a,"FDLayoutNode"),a.prototype=Object.create(u.prototype);for(var t in u)a[t]=u[t];a.prototype.setGridCoordinates=function(n,c,e,p){this.startX=n,this.finishX=c,this.startY=e,this.finishY=p},E.exports=a},function(E,w,N){"use strict";function u(o,a){this.width=0,this.height=0,o!==null&&a!==null&&(this.height=a,this.width=o)}L(u,"DimensionD"),u.prototype.getWidth=function(){return this.width},u.prototype.setWidth=function(o){this.width=o},u.prototype.getHeight=function(){return this.height},u.prototype.setHeight=function(o){this.height=o},E.exports=u},function(E,w,N){"use strict";var u=N(14);function o(){this.map={},this.keys=[]}L(o,"HashMap"),o.prototype.put=function(a,t){var n=u.createID(a);this.contains(n)||(this.map[n]=t,this.keys.push(a))},o.prototype.contains=function(a){var t=u.createID(a);return this.map[a]!=null},o.prototype.get=function(a){var t=u.createID(a);return this.map[t]},o.prototype.keySet=function(){return this.keys},E.exports=o},function(E,w,N){"use strict";var u=N(14);function o(){this.set={}}L(o,"HashSet"),o.prototype.add=function(a){var t=u.createID(a);this.contains(t)||(this.set[t]=a)},o.prototype.remove=function(a){delete this.set[u.createID(a)]},o.prototype.clear=function(){this.set={}},o.prototype.contains=function(a){return this.set[u.createID(a)]==a},o.prototype.isEmpty=function(){return this.size()===0},o.prototype.size=function(){return Object.keys(this.set).length},o.prototype.addAllTo=function(a){for(var t=Object.keys(this.set),n=t.length,c=0;c<n;c++)a.push(this.set[t[c]])},o.prototype.size=function(){return Object.keys(this.set).length},o.prototype.addAll=function(a){for(var t=a.length,n=0;n<t;n++){var c=a[n];this.add(c)}},E.exports=o},function(E,w,N){"use strict";function u(){}L(u,"Matrix"),u.multMat=function(o,a){for(var t=[],n=0;n<o.length;n++){t[n]=[];for(var c=0;c<a[0].length;c++){t[n][c]=0;for(var e=0;e<o[0].length;e++)t[n][c]+=o[n][e]*a[e][c]}}return t},u.transpose=function(o){for(var a=[],t=0;t<o[0].length;t++){a[t]=[];for(var n=0;n<o.length;n++)a[t][n]=o[n][t]}return a},u.multCons=function(o,a){for(var t=[],n=0;n<o.length;n++)t[n]=o[n]*a;return t},u.minusOp=function(o,a){for(var t=[],n=0;n<o.length;n++)t[n]=o[n]-a[n];return t},u.dotProduct=function(o,a){for(var t=0,n=0;n<o.length;n++)t+=o[n]*a[n];return t},u.mag=function(o){return Math.sqrt(this.dotProduct(o,o))},u.normalize=function(o){for(var a=[],t=this.mag(o),n=0;n<o.length;n++)a[n]=o[n]/t;return a},u.multGamma=function(o){for(var a=[],t=0,n=0;n<o.length;n++)t+=o[n];t*=-1/o.length;for(var c=0;c<o.length;c++)a[c]=t+o[c];return a},u.multL=function(o,a,t){for(var n=[],c=[],e=[],p=0;p<a[0].length;p++){for(var i=0,r=0;r<a.length;r++)i+=-.5*a[r][p]*o[r];c[p]=i}for(var h=0;h<t.length;h++){for(var f=0,l=0;l<t.length;l++)f+=t[h][l]*c[l];e[h]=f}for(var A=0;A<a.length;A++){for(var v=0,y=0;y<a[0].length;y++)v+=a[A][y]*e[y];n[A]=v}return n},E.exports=u},function(E,w,N){"use strict";var u=function(){function n(c,e){for(var p=0;p<e.length;p++){var i=e[p];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(c,i.key,i)}}return L(n,"defineProperties"),function(c,e,p){return e&&n(c.prototype,e),p&&n(c,p),c}}();function o(n,c){if(!(n instanceof c))throw new TypeError("Cannot call a class as a function")}L(o,"_classCallCheck");var a=N(11),t=function(){function n(c,e){o(this,n),(e!==null||e!==void 0)&&(this.compareFunction=this._defaultCompareFunction);var p=void 0;c instanceof a?p=c.size():p=c.length,this._quicksort(c,0,p-1)}return L(n,"Quicksort"),u(n,[{key:"_quicksort",value:L(function(e,p,i){if(p<i){var r=this._partition(e,p,i);this._quicksort(e,p,r),this._quicksort(e,r+1,i)}},"_quicksort")},{key:"_partition",value:L(function(e,p,i){for(var r=this._get(e,p),h=p,f=i;;){for(;this.compareFunction(r,this._get(e,f));)f--;for(;this.compareFunction(this._get(e,h),r);)h++;if(h<f)this._swap(e,h,f),h++,f--;else return f}},"_partition")},{key:"_get",value:L(function(e,p){return e instanceof a?e.get_object_at(p):e[p]},"_get")},{key:"_set",value:L(function(e,p,i){e instanceof a?e.set_object_at(p,i):e[p]=i},"_set")},{key:"_swap",value:L(function(e,p,i){var r=this._get(e,p);this._set(e,p,this._get(e,i)),this._set(e,i,r)},"_swap")},{key:"_defaultCompareFunction",value:L(function(e,p){return p>e},"_defaultCompareFunction")}]),n}();E.exports=t},function(E,w,N){"use strict";function u(){}L(u,"SVD"),u.svd=function(o){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=o.length,this.n=o[0].length;var a=Math.min(this.m,this.n);this.s=function(Ot){for(var Nt=[];Ot-- >0;)Nt.push(0);return Nt}(Math.min(this.m+1,this.n)),this.U=function(Ot){var Nt=L(function Zt(St){if(St.length==0)return 0;for(var Wt=[],$t=0;$t<St[0];$t++)Wt.push(Zt(St.slice(1)));return Wt},"allocate");return Nt(Ot)}([this.m,a]),this.V=function(Ot){var Nt=L(function Zt(St){if(St.length==0)return 0;for(var Wt=[],$t=0;$t<St[0];$t++)Wt.push(Zt(St.slice(1)));return Wt},"allocate");return Nt(Ot)}([this.n,this.n]);for(var t=function(Ot){for(var Nt=[];Ot-- >0;)Nt.push(0);return Nt}(this.n),n=function(Ot){for(var Nt=[];Ot-- >0;)Nt.push(0);return Nt}(this.m),c=!0,e=!0,p=Math.min(this.m-1,this.n),i=Math.max(0,Math.min(this.n-2,this.m)),r=0;r<Math.max(p,i);r++){if(r<p){this.s[r]=0;for(var h=r;h<this.m;h++)this.s[r]=u.hypot(this.s[r],o[h][r]);if(this.s[r]!==0){o[r][r]<0&&(this.s[r]=-this.s[r]);for(var f=r;f<this.m;f++)o[f][r]/=this.s[r];o[r][r]+=1}this.s[r]=-this.s[r]}for(var l=r+1;l<this.n;l++){if(function(Ot,Nt){return Ot&&Nt}(r<p,this.s[r]!==0)){for(var A=0,v=r;v<this.m;v++)A+=o[v][r]*o[v][l];A=-A/o[r][r];for(var y=r;y<this.m;y++)o[y][l]+=A*o[y][r]}t[l]=o[r][l]}if(function(Ot,Nt){return Ot&&Nt}(c,r<p))for(var D=r;D<this.m;D++)this.U[D][r]=o[D][r];if(r<i){t[r]=0;for(var F=r+1;F<this.n;F++)t[r]=u.hypot(t[r],t[F]);if(t[r]!==0){t[r+1]<0&&(t[r]=-t[r]);for(var C=r+1;C<this.n;C++)t[C]/=t[r];t[r+1]+=1}if(t[r]=-t[r],function(Ot,Nt){return Ot&&Nt}(r+1<this.m,t[r]!==0)){for(var G=r+1;G<this.m;G++)n[G]=0;for(var z=r+1;z<this.n;z++)for(var X=r+1;X<this.m;X++)n[X]+=t[z]*o[X][z];for(var rt=r+1;rt<this.n;rt++)for(var I=-t[rt]/t[r+1],J=r+1;J<this.m;J++)o[J][rt]+=I*n[J]}if(e)for(var s=r+1;s<this.n;s++)this.V[s][r]=t[s]}}var m=Math.min(this.n,this.m+1);if(p<this.n&&(this.s[p]=o[p][p]),this.m<m&&(this.s[m-1]=0),i+1<m&&(t[i]=o[i][m-1]),t[m-1]=0,c){for(var g=p;g<a;g++){for(var T=0;T<this.m;T++)this.U[T][g]=0;this.U[g][g]=1}for(var d=p-1;d>=0;d--)if(this.s[d]!==0){for(var O=d+1;O<a;O++){for(var x=0,P=d;P<this.m;P++)x+=this.U[P][d]*this.U[P][O];x=-x/this.U[d][d];for(var S=d;S<this.m;S++)this.U[S][O]+=x*this.U[S][d]}for(var R=d;R<this.m;R++)this.U[R][d]=-this.U[R][d];this.U[d][d]=1+this.U[d][d];for(var Z=0;Z<d-1;Z++)this.U[Z][d]=0}else{for(var tt=0;tt<this.m;tt++)this.U[tt][d]=0;this.U[d][d]=1}}if(e)for(var b=this.n-1;b>=0;b--){if(function(Ot,Nt){return Ot&&Nt}(b<i,t[b]!==0))for(var _=b+1;_<a;_++){for(var B=0,M=b+1;M<this.n;M++)B+=this.V[M][b]*this.V[M][_];B=-B/this.V[b+1][b];for(var U=b+1;U<this.n;U++)this.V[U][_]+=B*this.V[U][b]}for(var H=0;H<this.n;H++)this.V[H][b]=0;this.V[b][b]=1}for(var K=m-1,ht=0,Lt=Math.pow(2,-52),bt=Math.pow(2,-966);m>0;){var Q=void 0,Xt=void 0;for(Q=m-2;Q>=-1&&Q!==-1;Q--)if(Math.abs(t[Q])<=bt+Lt*(Math.abs(this.s[Q])+Math.abs(this.s[Q+1]))){t[Q]=0;break}if(Q===m-2)Xt=4;else{var wt=void 0;for(wt=m-1;wt>=Q&&wt!==Q;wt--){var ot=(wt!==m?Math.abs(t[wt]):0)+(wt!==Q+1?Math.abs(t[wt-1]):0);if(Math.abs(this.s[wt])<=bt+Lt*ot){this.s[wt]=0;break}}wt===Q?Xt=3:wt===m-1?Xt=1:(Xt=2,Q=wt)}switch(Q++,Xt){case 1:{var et=t[m-2];t[m-2]=0;for(var yt=m-2;yt>=Q;yt--){var Et=u.hypot(this.s[yt],et),Dt=this.s[yt]/Et,Tt=et/Et;if(this.s[yt]=Et,yt!==Q&&(et=-Tt*t[yt-1],t[yt-1]=Dt*t[yt-1]),e)for(var At=0;At<this.n;At++)Et=Dt*this.V[At][yt]+Tt*this.V[At][m-1],this.V[At][m-1]=-Tt*this.V[At][yt]+Dt*this.V[At][m-1],this.V[At][yt]=Et}}break;case 2:{var xt=t[Q-1];t[Q-1]=0;for(var It=Q;It<m;It++){var zt=u.hypot(this.s[It],xt),Yt=this.s[It]/zt,Ht=xt/zt;if(this.s[It]=zt,xt=-Ht*t[It],t[It]=Yt*t[It],c)for(var Pt=0;Pt<this.m;Pt++)zt=Yt*this.U[Pt][It]+Ht*this.U[Pt][Q-1],this.U[Pt][Q-1]=-Ht*this.U[Pt][It]+Yt*this.U[Pt][Q-1],this.U[Pt][It]=zt}}break;case 3:{var Y=Math.max(Math.max(Math.max(Math.max(Math.abs(this.s[m-1]),Math.abs(this.s[m-2])),Math.abs(t[m-2])),Math.abs(this.s[Q])),Math.abs(t[Q])),W=this.s[m-1]/Y,V=this.s[m-2]/Y,$=t[m-2]/Y,k=this.s[Q]/Y,j=t[Q]/Y,gt=((V+W)*(V-W)+$*$)/2,ft=W*$*(W*$),q=0;(function(Ot,Nt){return Ot||Nt})(gt!==0,ft!==0)&&(q=Math.sqrt(gt*gt+ft),gt<0&&(q=-q),q=ft/(gt+q));for(var lt=(k+W)*(k-W)+q,ut=k*j,it=Q;it<m-1;it++){var pt=u.hypot(lt,ut),Ct=lt/pt,st=ut/pt;if(it!==Q&&(t[it-1]=pt),lt=Ct*this.s[it]+st*t[it],t[it]=Ct*t[it]-st*this.s[it],ut=st*this.s[it+1],this.s[it+1]=Ct*this.s[it+1],e)for(var nt=0;nt<this.n;nt++)pt=Ct*this.V[nt][it]+st*this.V[nt][it+1],this.V[nt][it+1]=-st*this.V[nt][it]+Ct*this.V[nt][it+1],this.V[nt][it]=pt;if(pt=u.hypot(lt,ut),Ct=lt/pt,st=ut/pt,this.s[it]=pt,lt=Ct*t[it]+st*this.s[it+1],this.s[it+1]=-st*t[it]+Ct*this.s[it+1],ut=st*t[it+1],t[it+1]=Ct*t[it+1],c&&it<this.m-1)for(var dt=0;dt<this.m;dt++)pt=Ct*this.U[dt][it]+st*this.U[dt][it+1],this.U[dt][it+1]=-st*this.U[dt][it]+Ct*this.U[dt][it+1],this.U[dt][it]=pt}t[m-2]=lt,ht=ht+1}break;case 4:{if(this.s[Q]<=0&&(this.s[Q]=this.s[Q]<0?-this.s[Q]:0,e))for(var at=0;at<=K;at++)this.V[at][Q]=-this.V[at][Q];for(;Q<K&&!(this.s[Q]>=this.s[Q+1]);){var ct=this.s[Q];if(this.s[Q]=this.s[Q+1],this.s[Q+1]=ct,e&&Q<this.n-1)for(var Ft=0;Ft<this.n;Ft++)ct=this.V[Ft][Q+1],this.V[Ft][Q+1]=this.V[Ft][Q],this.V[Ft][Q]=ct;if(c&&Q<this.m-1)for(var Rt=0;Rt<this.m;Rt++)ct=this.U[Rt][Q+1],this.U[Rt][Q+1]=this.U[Rt][Q],this.U[Rt][Q]=ct;Q++}ht=0,m--}break}}var Bt={U:this.U,V:this.V,S:this.s};return Bt},u.hypot=function(o,a){var t=void 0;return Math.abs(o)>Math.abs(a)?(t=a/o,t=Math.abs(o)*Math.sqrt(1+t*t)):a!=0?(t=o/a,t=Math.abs(a)*Math.sqrt(1+t*t)):t=0,t},E.exports=u},function(E,w,N){"use strict";var u=function(){function t(n,c){for(var e=0;e<c.length;e++){var p=c[e];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(n,p.key,p)}}return L(t,"defineProperties"),function(n,c,e){return c&&t(n.prototype,c),e&&t(n,e),n}}();function o(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}L(o,"_classCallCheck");var a=function(){function t(n,c){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,p=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;o(this,t),this.sequence1=n,this.sequence2=c,this.match_score=e,this.mismatch_penalty=p,this.gap_penalty=i,this.iMax=n.length+1,this.jMax=c.length+1,this.grid=new Array(this.iMax);for(var r=0;r<this.iMax;r++){this.grid[r]=new Array(this.jMax);for(var h=0;h<this.jMax;h++)this.grid[r][h]=0}this.tracebackGrid=new Array(this.iMax);for(var f=0;f<this.iMax;f++){this.tracebackGrid[f]=new Array(this.jMax);for(var l=0;l<this.jMax;l++)this.tracebackGrid[f][l]=[null,null,null]}this.alignments=[],this.score=-1,this.computeGrids()}return L(t,"NeedlemanWunsch"),u(t,[{key:"getScore",value:L(function(){return this.score},"getScore")},{key:"getAlignments",value:L(function(){return this.alignments},"getAlignments")},{key:"computeGrids",value:L(function(){for(var c=1;c<this.jMax;c++)this.grid[0][c]=this.grid[0][c-1]+this.gap_penalty,this.tracebackGrid[0][c]=[!1,!1,!0];for(var e=1;e<this.iMax;e++)this.grid[e][0]=this.grid[e-1][0]+this.gap_penalty,this.tracebackGrid[e][0]=[!1,!0,!1];for(var p=1;p<this.iMax;p++)for(var i=1;i<this.jMax;i++){var r=void 0;this.sequence1[p-1]===this.sequence2[i-1]?r=this.grid[p-1][i-1]+this.match_score:r=this.grid[p-1][i-1]+this.mismatch_penalty;var h=this.grid[p-1][i]+this.gap_penalty,f=this.grid[p][i-1]+this.gap_penalty,l=[r,h,f],A=this.arrayAllMaxIndexes(l);this.grid[p][i]=l[A[0]],this.tracebackGrid[p][i]=[A.includes(0),A.includes(1),A.includes(2)]}this.score=this.grid[this.iMax-1][this.jMax-1]},"computeGrids")},{key:"alignmentTraceback",value:L(function(){var c=[];for(c.push({pos:[this.sequence1.length,this.sequence2.length],seq1:"",seq2:""});c[0];){var e=c[0],p=this.tracebackGrid[e.pos[0]][e.pos[1]];p[0]&&c.push({pos:[e.pos[0]-1,e.pos[1]-1],seq1:this.sequence1[e.pos[0]-1]+e.seq1,seq2:this.sequence2[e.pos[1]-1]+e.seq2}),p[1]&&c.push({pos:[e.pos[0]-1,e.pos[1]],seq1:this.sequence1[e.pos[0]-1]+e.seq1,seq2:"-"+e.seq2}),p[2]&&c.push({pos:[e.pos[0],e.pos[1]-1],seq1:"-"+e.seq1,seq2:this.sequence2[e.pos[1]-1]+e.seq2}),e.pos[0]===0&&e.pos[1]===0&&this.alignments.push({sequence1:e.seq1,sequence2:e.seq2}),c.shift()}return this.alignments},"alignmentTraceback")},{key:"getAllIndexes",value:L(function(c,e){for(var p=[],i=-1;(i=c.indexOf(e,i+1))!==-1;)p.push(i);return p},"getAllIndexes")},{key:"arrayAllMaxIndexes",value:L(function(c){return this.getAllIndexes(c,Math.max.apply(null,c))},"arrayAllMaxIndexes")}]),t}();E.exports=a},function(E,w,N){"use strict";var u=L(function(){},"layoutBase");u.FDLayout=N(18),u.FDLayoutConstants=N(4),u.FDLayoutEdge=N(19),u.FDLayoutNode=N(20),u.DimensionD=N(21),u.HashMap=N(22),u.HashSet=N(23),u.IGeometry=N(8),u.IMath=N(9),u.Integer=N(10),u.Point=N(12),u.PointD=N(5),u.RandomSeed=N(16),u.RectangleD=N(13),u.Transform=N(17),u.UniqueIDGeneretor=N(14),u.Quicksort=N(25),u.LinkedList=N(11),u.LGraphObject=N(2),u.LGraph=N(6),u.LEdge=N(1),u.LGraphManager=N(7),u.LNode=N(3),u.Layout=N(15),u.LayoutConstants=N(0),u.NeedlemanWunsch=N(27),u.Matrix=N(24),u.SVD=N(26),E.exports=u},function(E,w,N){"use strict";function u(){this.listeners=[]}L(u,"Emitter");var o=u.prototype;o.addListener=function(a,t){this.listeners.push({event:a,callback:t})},o.removeListener=function(a,t){for(var n=this.listeners.length;n>=0;n--){var c=this.listeners[n];c.event===a&&c.callback===t&&this.listeners.splice(n,1)}},o.emit=function(a,t){for(var n=0;n<this.listeners.length;n++){var c=this.listeners[n];a===c.event&&c.callback(t)}},E.exports=u}])})});var Ie=Le((ce,Re)=>{"use strict";L(function(w,N){typeof ce=="object"&&typeof Re=="object"?Re.exports=N(Oe()):typeof define=="function"&&define.amd?define(["layout-base"],N):typeof ce=="object"?ce.coseBase=N(Oe()):w.coseBase=N(w.layoutBase)},"webpackUniversalModuleDefinition")(ce,function(E){return(()=>{"use strict";var w={45:(a,t,n)=>{var c={};c.layoutBase=n(551),c.CoSEConstants=n(806),c.CoSEEdge=n(767),c.CoSEGraph=n(880),c.CoSEGraphManager=n(578),c.CoSELayout=n(765),c.CoSENode=n(991),c.ConstraintHandler=n(902),a.exports=c},806:(a,t,n)=>{var c=n(551).FDLayoutConstants;function e(){}L(e,"CoSEConstants");for(var p in c)e[p]=c[p];e.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,e.DEFAULT_RADIAL_SEPARATION=c.DEFAULT_EDGE_LENGTH,e.DEFAULT_COMPONENT_SEPERATION=60,e.TILE=!0,e.TILING_PADDING_VERTICAL=10,e.TILING_PADDING_HORIZONTAL=10,e.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,e.ENFORCE_CONSTRAINTS=!0,e.APPLY_LAYOUT=!0,e.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,e.TREE_REDUCTION_ON_INCREMENTAL=!0,e.PURE_INCREMENTAL=e.DEFAULT_INCREMENTAL,a.exports=e},767:(a,t,n)=>{var c=n(551).FDLayoutEdge;function e(i,r,h){c.call(this,i,r,h)}L(e,"CoSEEdge"),e.prototype=Object.create(c.prototype);for(var p in c)e[p]=c[p];a.exports=e},880:(a,t,n)=>{var c=n(551).LGraph;function e(i,r,h){c.call(this,i,r,h)}L(e,"CoSEGraph"),e.prototype=Object.create(c.prototype);for(var p in c)e[p]=c[p];a.exports=e},578:(a,t,n)=>{var c=n(551).LGraphManager;function e(i){c.call(this,i)}L(e,"CoSEGraphManager"),e.prototype=Object.create(c.prototype);for(var p in c)e[p]=c[p];a.exports=e},765:(a,t,n)=>{var c=n(551).FDLayout,e=n(578),p=n(880),i=n(991),r=n(767),h=n(806),f=n(902),l=n(551).FDLayoutConstants,A=n(551).LayoutConstants,v=n(551).Point,y=n(551).PointD,D=n(551).DimensionD,F=n(551).Layout,C=n(551).Integer,G=n(551).IGeometry,z=n(551).LGraph,X=n(551).Transform,rt=n(551).LinkedList;function I(){c.call(this),this.toBeTiled={},this.constraints={}}L(I,"CoSELayout"),I.prototype=Object.create(c.prototype);for(var J in c)I[J]=c[J];I.prototype.newGraphManager=function(){var s=new e(this);return this.graphManager=s,s},I.prototype.newGraph=function(s){return new p(null,this.graphManager,s)},I.prototype.newNode=function(s){return new i(this.graphManager,s)},I.prototype.newEdge=function(s){return new r(null,null,s)},I.prototype.initParameters=function(){c.prototype.initParameters.call(this,arguments),this.isSubLayout||(h.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=h.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=h.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=l.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=l.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=l.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},I.prototype.initSpringEmbedder=function(){c.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/l.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},I.prototype.layout=function(){var s=A.DEFAULT_CREATE_BENDS_AS_NEEDED;return s&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},I.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),this.incremental){if(h.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var m=new Set(this.getAllNodes()),g=this.nodesWithGravity.filter(function(O){return m.has(O)});this.graphManager.setAllNodesToApplyGravitation(g)}}else{var s=this.getFlatForest();if(s.length>0)this.positionNodesRadially(s);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var m=new Set(this.getAllNodes()),g=this.nodesWithGravity.filter(function(T){return m.has(T)});this.graphManager.setAllNodesToApplyGravitation(g),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(f.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),h.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},I.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%l.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 s=new Set(this.getAllNodes()),m=this.nodesWithGravity.filter(function(d){return s.has(d)});this.graphManager.setAllNodesToApplyGravitation(m),this.graphManager.updateBounds(),this.updateGrid(),h.PURE_INCREMENTAL?this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),h.PURE_INCREMENTAL?this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var g=!this.isTreeGrowing&&!this.isGrowthFinished,T=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(g,T),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},I.prototype.getPositionsData=function(){for(var s=this.graphManager.getAllNodes(),m={},g=0;g<s.length;g++){var T=s[g].rect,d=s[g].id;m[d]={id:d,x:T.getCenterX(),y:T.getCenterY(),w:T.width,h:T.height}}return m},I.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var s=!1;if(l.ANIMATE==="during")this.emit("layoutstarted");else{for(;!s;)s=this.tick();this.graphManager.updateBounds()}},I.prototype.moveNodes=function(){for(var s=this.getAllNodes(),m,g=0;g<s.length;g++)m=s[g],m.calculateDisplacement();Object.keys(this.constraints).length>0&&this.updateDisplacements();for(var g=0;g<s.length;g++)m=s[g],m.move()},I.prototype.initConstraintVariables=function(){var s=this;this.idToNodeMap=new Map,this.fixedNodeSet=new Set;for(var m=this.graphManager.getAllNodes(),g=0;g<m.length;g++){var T=m[g];this.idToNodeMap.set(T.id,T)}var d=L(function M(U){for(var H=U.getChild().getNodes(),K,ht=0,Lt=0;Lt<H.length;Lt++)K=H[Lt],K.getChild()==null?s.fixedNodeSet.has(K.id)&&(ht+=100):ht+=M(K);return ht},"calculateCompoundWeight");if(this.constraints.fixedNodeConstraint){this.constraints.fixedNodeConstraint.forEach(function(H){s.fixedNodeSet.add(H.nodeId)});for(var m=this.graphManager.getAllNodes(),T,g=0;g<m.length;g++)if(T=m[g],T.getChild()!=null){var O=d(T);O>0&&(T.fixedNodeWeight=O)}}if(this.constraints.relativePlacementConstraint){var x=new Map,P=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(M){s.fixedNodesOnHorizontal.add(M),s.fixedNodesOnVertical.add(M)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var S=this.constraints.alignmentConstraint.vertical,g=0;g<S.length;g++)this.dummyToNodeForVerticalAlignment.set("dummy"+g,[]),S[g].forEach(function(U){x.set(U,"dummy"+g),s.dummyToNodeForVerticalAlignment.get("dummy"+g).push(U),s.fixedNodeSet.has(U)&&s.fixedNodesOnHorizontal.add("dummy"+g)});if(this.constraints.alignmentConstraint.horizontal)for(var R=this.constraints.alignmentConstraint.horizontal,g=0;g<R.length;g++)this.dummyToNodeForHorizontalAlignment.set("dummy"+g,[]),R[g].forEach(function(U){P.set(U,"dummy"+g),s.dummyToNodeForHorizontalAlignment.get("dummy"+g).push(U),s.fixedNodeSet.has(U)&&s.fixedNodesOnVertical.add("dummy"+g)})}if(h.RELAX_MOVEMENT_ON_CONSTRAINTS)this.shuffle=function(M){var U,H,K;for(K=M.length-1;K>=2*M.length/3;K--)U=Math.floor(Math.random()*(K+1)),H=M[K],M[K]=M[U],M[U]=H;return M},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(M){if(M.left){var U=x.has(M.left)?x.get(M.left):M.left,H=x.has(M.right)?x.get(M.right):M.right;s.nodesInRelativeHorizontal.includes(U)||(s.nodesInRelativeHorizontal.push(U),s.nodeToRelativeConstraintMapHorizontal.set(U,[]),s.dummyToNodeForVerticalAlignment.has(U)?s.nodeToTempPositionMapHorizontal.set(U,s.idToNodeMap.get(s.dummyToNodeForVerticalAlignment.get(U)[0]).getCenterX()):s.nodeToTempPositionMapHorizontal.set(U,s.idToNodeMap.get(U).getCenterX())),s.nodesInRelativeHorizontal.includes(H)||(s.nodesInRelativeHorizontal.push(H),s.nodeToRelativeConstraintMapHorizontal.set(H,[]),s.dummyToNodeForVerticalAlignment.has(H)?s.nodeToTempPositionMapHorizontal.set(H,s.idToNodeMap.get(s.dummyToNodeForVerticalAlignment.get(H)[0]).getCenterX()):s.nodeToTempPositionMapHorizontal.set(H,s.idToNodeMap.get(H).getCenterX())),s.nodeToRelativeConstraintMapHorizontal.get(U).push({right:H,gap:M.gap}),s.nodeToRelativeConstraintMapHorizontal.get(H).push({left:U,gap:M.gap})}else{var K=P.has(M.top)?P.get(M.top):M.top,ht=P.has(M.bottom)?P.get(M.bottom):M.bottom;s.nodesInRelativeVertical.includes(K)||(s.nodesInRelativeVertical.push(K),s.nodeToRelativeConstraintMapVertical.set(K,[]),s.dummyToNodeForHorizontalAlignment.has(K)?s.nodeToTempPositionMapVertical.set(K,s.idToNodeMap.get(s.dummyToNodeForHorizontalAlignment.get(K)[0]).getCenterY()):s.nodeToTempPositionMapVertical.set(K,s.idToNodeMap.get(K).getCenterY())),s.nodesInRelativeVertical.includes(ht)||(s.nodesInRelativeVertical.push(ht),s.nodeToRelativeConstraintMapVertical.set(ht,[]),s.dummyToNodeForHorizontalAlignment.has(ht)?s.nodeToTempPositionMapVertical.set(ht,s.idToNodeMap.get(s.dummyToNodeForHorizontalAlignment.get(ht)[0]).getCenterY()):s.nodeToTempPositionMapVertical.set(ht,s.idToNodeMap.get(ht).getCenterY())),s.nodeToRelativeConstraintMapVertical.get(K).push({bottom:ht,gap:M.gap}),s.nodeToRelativeConstraintMapVertical.get(ht).push({top:K,gap:M.gap})}});else{var Z=new Map,tt=new Map;this.constraints.relativePlacementConstraint.forEach(function(M){if(M.left){var U=x.has(M.left)?x.get(M.left):M.left,H=x.has(M.right)?x.get(M.right):M.right;Z.has(U)?Z.get(U).push(H):Z.set(U,[H]),Z.has(H)?Z.get(H).push(U):Z.set(H,[U])}else{var K=P.has(M.top)?P.get(M.top):M.top,ht=P.has(M.bottom)?P.get(M.bottom):M.bottom;tt.has(K)?tt.get(K).push(ht):tt.set(K,[ht]),tt.has(ht)?tt.get(ht).push(K):tt.set(ht,[K])}});var b=L(function(U,H){var K=[],ht=[],Lt=new rt,bt=new Set,Q=0;return U.forEach(function(Xt,wt){if(!bt.has(wt)){K[Q]=[],ht[Q]=!1;var ot=wt;for(Lt.push(ot),bt.add(ot),K[Q].push(ot);Lt.length!=0;){ot=Lt.shift(),H.has(ot)&&(ht[Q]=!0);var et=U.get(ot);et.forEach(function(yt){bt.has(yt)||(Lt.push(yt),bt.add(yt),K[Q].push(yt))})}Q++}}),{components:K,isFixed:ht}},"constructComponents"),_=b(Z,s.fixedNodesOnHorizontal);this.componentsOnHorizontal=_.components,this.fixedComponentsOnHorizontal=_.isFixed;var B=b(tt,s.fixedNodesOnVertical);this.componentsOnVertical=B.components,this.fixedComponentsOnVertical=B.isFixed}}},I.prototype.updateDisplacements=function(){var s=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function(B){var M=s.idToNodeMap.get(B.nodeId);M.displacementX=0,M.displacementY=0}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var m=this.constraints.alignmentConstraint.vertical,g=0;g<m.length;g++){for(var T=0,d=0;d<m[g].length;d++){if(this.fixedNodeSet.has(m[g][d])){T=0;break}T+=this.idToNodeMap.get(m[g][d]).displacementX}for(var O=T/m[g].length,d=0;d<m[g].length;d++)this.idToNodeMap.get(m[g][d]).displacementX=O}if(this.constraints.alignmentConstraint.horizontal)for(var x=this.constraints.alignmentConstraint.horizontal,g=0;g<x.length;g++){for(var P=0,d=0;d<x[g].length;d++){if(this.fixedNodeSet.has(x[g][d])){P=0;break}P+=this.idToNodeMap.get(x[g][d]).displacementY}for(var S=P/x[g].length,d=0;d<x[g].length;d++)this.idToNodeMap.get(x[g][d]).displacementY=S}}if(this.constraints.relativePlacementConstraint)if(h.RELAX_MOVEMENT_ON_CONSTRAINTS)this.totalIterations%10==0&&(this.shuffle(this.nodesInRelativeHorizontal),this.shuffle(this.nodesInRelativeVertical)),this.nodesInRelativeHorizontal.forEach(function(B){if(!s.fixedNodesOnHorizontal.has(B)){var M=0;s.dummyToNodeForVerticalAlignment.has(B)?M=s.idToNodeMap.get(s.dummyToNodeForVerticalAlignment.get(B)[0]).displacementX:M=s.idToNodeMap.get(B).displacementX,s.nodeToRelativeConstraintMapHorizontal.get(B).forEach(function(U){if(U.right){var H=s.nodeToTempPositionMapHorizontal.get(U.right)-s.nodeToTempPositionMapHorizontal.get(B)-M;H<U.gap&&(M-=U.gap-H)}else{var H=s.nodeToTempPositionMapHorizontal.get(B)-s.nodeToTempPositionMapHorizontal.get(U.left)+M;H<U.gap&&(M+=U.gap-H)}}),s.nodeToTempPositionMapHorizontal.set(B,s.nodeToTempPositionMapHorizontal.get(B)+M),s.dummyToNodeForVerticalAlignment.has(B)?s.dummyToNodeForVerticalAlignment.get(B).forEach(function(U){s.idToNodeMap.get(U).displacementX=M}):s.idToNodeMap.get(B).displacementX=M}}),this.nodesInRelativeVertical.forEach(function(B){if(!s.fixedNodesOnHorizontal.has(B)){var M=0;s.dummyToNodeForHorizontalAlignment.has(B)?M=s.idToNodeMap.get(s.dummyToNodeForHorizontalAlignment.get(B)[0]).displacementY:M=s.idToNodeMap.get(B).displacementY,s.nodeToRelativeConstraintMapVertical.get(B).forEach(function(U){if(U.bottom){var H=s.nodeToTempPositionMapVertical.get(U.bottom)-s.nodeToTempPositionMapVertical.get(B)-M;H<U.gap&&(M-=U.gap-H)}else{var H=s.nodeToTempPositionMapVertical.get(B)-s.nodeToTempPositionMapVertical.get(U.top)+M;H<U.gap&&(M+=U.gap-H)}}),s.nodeToTempPositionMapVertical.set(B,s.nodeToTempPositionMapVertical.get(B)+M),s.dummyToNodeForHorizontalAlignment.has(B)?s.dummyToNodeForHorizontalAlignment.get(B).forEach(function(U){s.idToNodeMap.get(U).displacementY=M}):s.idToNodeMap.get(B).displacementY=M}});else{for(var g=0;g<this.componentsOnHorizontal.length;g++){var R=this.componentsOnHorizontal[g];if(this.fixedComponentsOnHorizontal[g])for(var d=0;d<R.length;d++)this.dummyToNodeForVerticalAlignment.has(R[d])?this.dummyToNodeForVerticalAlignment.get(R[d]).forEach(function(U){s.idToNodeMap.get(U).displacementX=0}):this.idToNodeMap.get(R[d]).displacementX=0;else{for(var Z=0,tt=0,d=0;d<R.length;d++)if(this.dummyToNodeForVerticalAlignment.has(R[d])){var b=this.dummyToNodeForVerticalAlignment.get(R[d]);Z+=b.length*this.idToNodeMap.get(b[0]).displacementX,tt+=b.length}else Z+=this.idToNodeMap.get(R[d]).displacementX,tt++;for(var _=Z/tt,d=0;d<R.length;d++)this.dummyToNodeForVerticalAlignment.has(R[d])?this.dummyToNodeForVerticalAlignment.get(R[d]).forEach(function(U){s.idToNodeMap.get(U).displacementX=_}):this.idToNodeMap.get(R[d]).displacementX=_}}for(var g=0;g<this.componentsOnVertical.length;g++){var R=this.componentsOnVertical[g];if(this.fixedComponentsOnVertical[g])for(var d=0;d<R.length;d++)this.dummyToNodeForHorizontalAlignment.has(R[d])?this.dummyToNodeForHorizontalAlignment.get(R[d]).forEach(function(H){s.idToNodeMap.get(H).displacementY=0}):this.idToNodeMap.get(R[d]).displacementY=0;else{for(var Z=0,tt=0,d=0;d<R.length;d++)if(this.dummyToNodeForHorizontalAlignment.has(R[d])){var b=this.dummyToNodeForHorizontalAlignment.get(R[d]);Z+=b.length*this.idToNodeMap.get(b[0]).displacementY,tt+=b.length}else Z+=this.idToNodeMap.get(R[d]).displacementY,tt++;for(var _=Z/tt,d=0;d<R.length;d++)this.dummyToNodeForHorizontalAlignment.has(R[d])?this.dummyToNodeForHorizontalAlignment.get(R[d]).forEach(function(Lt){s.idToNodeMap.get(Lt).displacementY=_}):this.idToNodeMap.get(R[d]).displacementY=_}}}},I.prototype.calculateNodesToApplyGravitationTo=function(){var s=[],m,g=this.graphManager.getGraphs(),T=g.length,d;for(d=0;d<T;d++)m=g[d],m.updateConnected(),m.isConnected||(s=s.concat(m.getNodes()));return s},I.prototype.createBendpoints=function(){var s=[];s=s.concat(this.graphManager.getAllEdges());var m=new Set,g;for(g=0;g<s.length;g++){var T=s[g];if(!m.has(T)){var d=T.getSource(),O=T.getTarget();if(d==O)T.getBendpoints().push(new y),T.getBendpoints().push(new y),this.createDummyNodesForBendpoints(T),m.add(T);else{var x=[];if(x=x.concat(d.getEdgeListToNode(O)),x=x.concat(O.getEdgeListToNode(d)),!m.has(x[0])){if(x.length>1){var P;for(P=0;P<x.length;P++){var S=x[P];S.getBendpoints().push(new y),this.createDummyNodesForBendpoints(S)}}x.forEach(function(R){m.add(R)})}}}if(m.size==s.length)break}},I.prototype.positionNodesRadially=function(s){for(var m=new v(0,0),g=Math.ceil(Math.sqrt(s.length)),T=0,d=0,O=0,x=new y(0,0),P=0;P<s.length;P++){P%g==0&&(O=0,d=T,P!=0&&(d+=h.DEFAULT_COMPONENT_SEPERATION),T=0);var S=s[P],R=F.findCenterOfTree(S);m.x=O,m.y=d,x=I.radialLayout(S,R,m),x.y>T&&(T=Math.floor(x.y)),O=Math.floor(x.x+h.DEFAULT_COMPONENT_SEPERATION)}this.transform(new y(A.WORLD_CENTER_X-x.x/2,A.WORLD_CENTER_Y-x.y/2))},I.radialLayout=function(s,m,g){var T=Math.max(this.maxDiagonalInTree(s),h.DEFAULT_RADIAL_SEPARATION);I.branchRadialLayout(m,null,0,359,0,T);var d=z.calculateBounds(s),O=new X;O.setDeviceOrgX(d.getMinX()),O.setDeviceOrgY(d.getMinY()),O.setWorldOrgX(g.x),O.setWorldOrgY(g.y);for(var x=0;x<s.length;x++){var P=s[x];P.transform(O)}var S=new y(d.getMaxX(),d.getMaxY());return O.inverseTransformPoint(S)},I.branchRadialLayout=function(s,m,g,T,d,O){var x=(T-g+1)/2;x<0&&(x+=180);var P=(x+g)%360,S=P*G.TWO_PI/360,R=Math.cos(S),Z=d*Math.cos(S),tt=d*Math.sin(S);s.setCenter(Z,tt);var b=[];b=b.concat(s.getEdges());var _=b.length;m!=null&&_--;for(var B=0,M=b.length,U,H=s.getEdgesBetween(m);H.length>1;){var K=H[0];H.splice(0,1);var ht=b.indexOf(K);ht>=0&&b.splice(ht,1),M--,_--}m!=null?U=(b.indexOf(H[0])+1)%M:U=0;for(var Lt=Math.abs(T-g)/_,bt=U;B!=_;bt=++bt%M){var Q=b[bt].getOtherEnd(s);if(Q!=m){var Xt=(g+B*Lt)%360,wt=(Xt+Lt)%360;I.branchRadialLayout(Q,s,Xt,wt,d+O,O),B++}}},I.maxDiagonalInTree=function(s){for(var m=C.MIN_VALUE,g=0;g<s.length;g++){var T=s[g],d=T.getDiagonal();d>m&&(m=d)}return m},I.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},I.prototype.groupZeroDegreeMembers=function(){var s=this,m={};this.memberGroups={},this.idToDummyNode={};for(var g=[],T=this.graphManager.getAllNodes(),d=0;d<T.length;d++){var O=T[d],x=O.getParent();this.getNodeDegreeWithChildren(O)===0&&(x.id==null||!this.getToBeTiled(x))&&g.push(O)}for(var d=0;d<g.length;d++){var O=g[d],P=O.getParent().id;typeof m[P]>"u"&&(m[P]=[]),m[P]=m[P].concat(O)}Object.keys(m).forEach(function(S){if(m[S].length>1){var R="DummyCompound_"+S;s.memberGroups[R]=m[S];var Z=m[S][0].getParent(),tt=new i(s.graphManager);tt.id=R,tt.paddingLeft=Z.paddingLeft||0,tt.paddingRight=Z.paddingRight||0,tt.paddingBottom=Z.paddingBottom||0,tt.paddingTop=Z.paddingTop||0,s.idToDummyNode[R]=tt;var b=s.getGraphManager().add(s.newGraph(),tt),_=Z.getChild();_.add(tt);for(var B=0;B<m[S].length;B++){var M=m[S][B];_.remove(M),b.add(M)}}})},I.prototype.clearCompounds=function(){var s={},m={};this.performDFSOnCompounds();for(var g=0;g<this.compoundOrder.length;g++)m[this.compoundOrder[g].id]=this.compoundOrder[g],s[this.compoundOrder[g].id]=[].concat(this.compoundOrder[g].getChild().getNodes()),this.graphManager.remove(this.compoundOrder[g].getChild()),this.compoundOrder[g].child=null;this.graphManager.resetAllNodes(),this.tileCompoundMembers(s,m)},I.prototype.clearZeroDegreeMembers=function(){var s=this,m=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach(function(g){var T=s.idToDummyNode[g];if(m[g]=s.tileNodes(s.memberGroups[g],T.paddingLeft+T.paddingRight),T.rect.width=m[g].width,T.rect.height=m[g].height,T.setCenter(m[g].centerX,m[g].centerY),T.labelMarginLeft=0,T.labelMarginTop=0,h.NODE_DIMENSIONS_INCLUDE_LABELS){var d=T.rect.width,O=T.rect.height;T.labelWidth&&(T.labelPosHorizontal=="left"?(T.rect.x-=T.labelWidth,T.setWidth(d+T.labelWidth),T.labelMarginLeft=T.labelWidth):T.labelPosHorizontal=="center"&&T.labelWidth>d?(T.rect.x-=(T.labelWidth-d)/2,T.setWidth(T.labelWidth),T.labelMarginLeft=(T.labelWidth-d)/2):T.labelPosHorizontal=="right"&&T.setWidth(d+T.labelWidth)),T.labelHeight&&(T.labelPosVertical=="top"?(T.rect.y-=T.labelHeight,T.setHeight(O+T.labelHeight),T.labelMarginTop=T.labelHeight):T.labelPosVertical=="center"&&T.labelHeight>O?(T.rect.y-=(T.labelHeight-O)/2,T.setHeight(T.labelHeight),T.labelMarginTop=(T.labelHeight-O)/2):T.labelPosVertical=="bottom"&&T.setHeight(O+T.labelHeight))}})},I.prototype.repopulateCompounds=function(){for(var s=this.compoundOrder.length-1;s>=0;s--){var m=this.compoundOrder[s],g=m.id,T=m.paddingLeft,d=m.paddingTop,O=m.labelMarginLeft,x=m.labelMarginTop;this.adjustLocations(this.tiledMemberPack[g],m.rect.x,m.rect.y,T,d,O,x)}},I.prototype.repopulateZeroDegreeMembers=function(){var s=this,m=this.tiledZeroDegreePack;Object.keys(m).forEach(function(g){var T=s.idToDummyNode[g],d=T.paddingLeft,O=T.paddingTop,x=T.labelMarginLeft,P=T.labelMarginTop;s.adjustLocations(m[g],T.rect.x,T.rect.y,d,O,x,P)})},I.prototype.getToBeTiled=function(s){var m=s.id;if(this.toBeTiled[m]!=null)return this.toBeTiled[m];var g=s.getChild();if(g==null)return this.toBeTiled[m]=!1,!1;for(var T=g.getNodes(),d=0;d<T.length;d++){var O=T[d];if(this.getNodeDegree(O)>0)return this.toBeTiled[m]=!1,!1;if(O.getChild()==null){this.toBeTiled[O.id]=!1;continue}if(!this.getToBeTiled(O))return this.toBeTiled[m]=!1,!1}return this.toBeTiled[m]=!0,!0},I.prototype.getNodeDegree=function(s){for(var m=s.id,g=s.getEdges(),T=0,d=0;d<g.length;d++){var O=g[d];O.getSource().id!==O.getTarget().id&&(T=T+1)}return T},I.prototype.getNodeDegreeWithChildren=function(s){var m=this.getNodeDegree(s);if(s.getChild()==null)return m;for(var g=s.getChild().getNodes(),T=0;T<g.length;T++){var d=g[T];m+=this.getNodeDegreeWithChildren(d)}return m},I.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},I.prototype.fillCompexOrderByDFS=function(s){for(var m=0;m<s.length;m++){var g=s[m];g.getChild()!=null&&this.fillCompexOrderByDFS(g.getChild().getNodes()),this.getToBeTiled(g)&&this.compoundOrder.push(g)}},I.prototype.adjustLocations=function(s,m,g,T,d,O,x){m+=T+O,g+=d+x;for(var P=m,S=0;S<s.rows.length;S++){var R=s.rows[S];m=P;for(var Z=0,tt=0;tt<R.length;tt++){var b=R[tt];b.rect.x=m,b.rect.y=g,m+=b.rect.width+s.horizontalPadding,b.rect.height>Z&&(Z=b.rect.height)}g+=Z+s.verticalPadding}},I.prototype.tileCompoundMembers=function(s,m){var g=this;this.tiledMemberPack=[],Object.keys(s).forEach(function(T){var d=m[T];if(g.tiledMemberPack[T]=g.tileNodes(s[T],d.paddingLeft+d.paddingRight),d.rect.width=g.tiledMemberPack[T].width,d.rect.height=g.tiledMemberPack[T].height,d.setCenter(g.tiledMemberPack[T].centerX,g.tiledMemberPack[T].centerY),d.labelMarginLeft=0,d.labelMarginTop=0,h.NODE_DIMENSIONS_INCLUDE_LABELS){var O=d.rect.width,x=d.rect.height;d.labelWidth&&(d.labelPosHorizontal=="left"?(d.rect.x-=d.labelWidth,d.setWidth(O+d.labelWidth),d.labelMarginLeft=d.labelWidth):d.labelPosHorizontal=="center"&&d.labelWidth>O?(d.rect.x-=(d.labelWidth-O)/2,d.setWidth(d.labelWidth),d.labelMarginLeft=(d.labelWidth-O)/2):d.labelPosHorizontal=="right"&&d.setWidth(O+d.labelWidth)),d.labelHeight&&(d.labelPosVertical=="top"?(d.rect.y-=d.labelHeight,d.setHeight(x+d.labelHeight),d.labelMarginTop=d.labelHeight):d.labelPosVertical=="center"&&d.labelHeight>x?(d.rect.y-=(d.labelHeight-x)/2,d.setHeight(d.labelHeight),d.labelMarginTop=(d.labelHeight-x)/2):d.labelPosVertical=="bottom"&&d.setHeight(x+d.labelHeight))}})},I.prototype.tileNodes=function(s,m){var g=this.tileNodesByFavoringDim(s,m,!0),T=this.tileNodesByFavoringDim(s,m,!1),d=this.getOrgRatio(g),O=this.getOrgRatio(T),x;return O<d?x=T:x=g,x},I.prototype.getOrgRatio=function(s){var m=s.width,g=s.height,T=m/g;return T<1&&(T=1/T),T},I.prototype.calcIdealRowWidth=function(s,m){var g=h.TILING_PADDING_VERTICAL,T=h.TILING_PADDING_HORIZONTAL,d=s.length,O=0,x=0,P=0;s.forEach(function(B){O+=B.getWidth(),x+=B.getHeight(),B.getWidth()>P&&(P=B.getWidth())});var S=O/d,R=x/d,Z=Math.pow(g-T,2)+4*(S+T)*(R+g)*d,tt=(T-g+Math.sqrt(Z))/(2*(S+T)),b;m?(b=Math.ceil(tt),b==tt&&b++):b=Math.floor(tt);var _=b*(S+T)-T;return P>_&&(_=P),_+=T*2,_},I.prototype.tileNodesByFavoringDim=function(s,m,g){var T=h.TILING_PADDING_VERTICAL,d=h.TILING_PADDING_HORIZONTAL,O=h.TILING_COMPARE_BY,x={rows:[],rowWidth:[],rowHeight:[],width:0,height:m,verticalPadding:T,horizontalPadding:d,centerX:0,centerY:0};O&&(x.idealRowWidth=this.calcIdealRowWidth(s,g));var P=L(function(M){return M.rect.width*M.rect.height},"getNodeArea"),S=L(function(M,U){return P(U)-P(M)},"areaCompareFcn");s.sort(function(B,M){var U=S;return x.idealRowWidth?(U=O,U(B.id,M.id)):U(B,M)});for(var R=0,Z=0,tt=0;tt<s.length;tt++){var b=s[tt];R+=b.getCenterX(),Z+=b.getCenterY()}x.centerX=R/s.length,x.centerY=Z/s.length;for(var tt=0;tt<s.length;tt++){var b=s[tt];if(x.rows.length==0)this.insertNodeToRow(x,b,0,m);else if(this.canAddHorizontal(x,b.rect.width,b.rect.height)){var _=x.rows.length-1;x.idealRowWidth||(_=this.getShortestRowIndex(x)),this.insertNodeToRow(x,b,_,m)}else this.insertNodeToRow(x,b,x.rows.length,m);this.shiftToLastRow(x)}return x},I.prototype.insertNodeToRow=function(s,m,g,T){var d=T;if(g==s.rows.length){var O=[];s.rows.push(O),s.rowWidth.push(d),s.rowHeight.push(0)}var x=s.rowWidth[g]+m.rect.width;s.rows[g].length>0&&(x+=s.horizontalPadding),s.rowWidth[g]=x,s.width<x&&(s.width=x);var P=m.rect.height;g>0&&(P+=s.verticalPadding);var S=0;P>s.rowHeight[g]&&(S=s.rowHeight[g],s.rowHeight[g]=P,S=s.rowHeight[g]-S),s.height+=S,s.rows[g].push(m)},I.prototype.getShortestRowIndex=function(s){for(var m=-1,g=Number.MAX_VALUE,T=0;T<s.rows.length;T++)s.rowWidth[T]<g&&(m=T,g=s.rowWidth[T]);return m},I.prototype.getLongestRowIndex=function(s){for(var m=-1,g=Number.MIN_VALUE,T=0;T<s.rows.length;T++)s.rowWidth[T]>g&&(m=T,g=s.rowWidth[T]);return m},I.prototype.canAddHorizontal=function(s,m,g){if(s.idealRowWidth){var T=s.rows.length-1,d=s.rowWidth[T];return d+m+s.horizontalPadding<=s.idealRowWidth}var O=this.getShortestRowIndex(s);if(O<0)return!0;var x=s.rowWidth[O];if(x+s.horizontalPadding+m<=s.width)return!0;var P=0;s.rowHeight[O]<g&&O>0&&(P=g+s.verticalPadding-s.rowHeight[O]);var S;s.width-x>=m+s.horizontalPadding?S=(s.height+P)/(x+m+s.horizontalPadding):S=(s.height+P)/s.width,P=g+s.verticalPadding;var R;return s.width<m?R=(s.height+P)/m:R=(s.height+P)/s.width,R<1&&(R=1/R),S<1&&(S=1/S),S<R},I.prototype.shiftToLastRow=function(s){var m=this.getLongestRowIndex(s),g=s.rowWidth.length-1,T=s.rows[m],d=T[T.length-1],O=d.width+s.horizontalPadding;if(s.width-s.rowWidth[g]>O&&m!=g){T.splice(-1,1),s.rows[g].push(d),s.rowWidth[m]=s.rowWidth[m]-O,s.rowWidth[g]=s.rowWidth[g]+O,s.width=s.rowWidth[instance.getLongestRowIndex(s)];for(var x=Number.MIN_VALUE,P=0;P<T.length;P++)T[P].height>x&&(x=T[P].height);m>0&&(x+=s.verticalPadding);var S=s.rowHeight[m]+s.rowHeight[g];s.rowHeight[m]=x,s.rowHeight[g]<d.height+s.verticalPadding&&(s.rowHeight[g]=d.height+s.verticalPadding);var R=s.rowHeight[m]+s.rowHeight[g];s.height+=R-S,this.shiftToLastRow(s)}},I.prototype.tilingPreLayout=function(){h.TILE&&(this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers())},I.prototype.tilingPostLayout=function(){h.TILE&&(this.repopulateZeroDegreeMembers(),this.repopulateCompounds())},I.prototype.reduceTrees=function(){for(var s=[],m=!0,g;m;){var T=this.graphManager.getAllNodes(),d=[];m=!1;for(var O=0;O<T.length;O++)if(g=T[O],g.getEdges().length==1&&!g.getEdges()[0].isInterGraph&&g.getChild()==null){if(h.PURE_INCREMENTAL){var x=g.getEdges()[0].getOtherEnd(g),P=new D(g.getCenterX()-x.getCenterX(),g.getCenterY()-x.getCenterY());d.push([g,g.getEdges()[0],g.getOwner(),P])}else d.push([g,g.getEdges()[0],g.getOwner()]);m=!0}if(m==!0){for(var S=[],R=0;R<d.length;R++)d[R][0].getEdges().length==1&&(S.push(d[R]),d[R][0].getOwner().remove(d[R][0]));s.push(S),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=s},I.prototype.growTree=function(s){for(var m=s.length,g=s[m-1],T,d=0;d<g.length;d++)T=g[d],this.findPlaceforPrunedNode(T),T[2].add(T[0]),T[2].add(T[1],T[1].source,T[1].target);s.splice(s.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},I.prototype.findPlaceforPrunedNode=function(s){var m,g,T=s[0];if(T==s[1].source?g=s[1].target:g=s[1].source,h.PURE_INCREMENTAL)T.setCenter(g.getCenterX()+s[3].getWidth(),g.getCenterY()+s[3].getHeight());else{var d=g.startX,O=g.finishX,x=g.startY,P=g.finishY,S=0,R=0,Z=0,tt=0,b=[S,Z,R,tt];if(x>0)for(var _=d;_<=O;_++)b[0]+=this.grid[_][x-1].length+this.grid[_][x].length-1;if(O<this.grid.length-1)for(var _=x;_<=P;_++)b[1]+=this.grid[O+1][_].length+this.grid[O][_].length-1;if(P<this.grid[0].length-1)for(var _=d;_<=O;_++)b[2]+=this.grid[_][P+1].length+this.grid[_][P].length-1;if(d>0)for(var _=x;_<=P;_++)b[3]+=this.grid[d-1][_].length+this.grid[d][_].length-1;for(var B=C.MAX_VALUE,M,U,H=0;H<b.length;H++)b[H]<B?(B=b[H],M=1,U=H):b[H]==B&&M++;if(M==3&&B==0)b[0]==0&&b[1]==0&&b[2]==0?m=1:b[0]==0&&b[1]==0&&b[3]==0?m=0:b[0]==0&&b[2]==0&&b[3]==0?m=3:b[1]==0&&b[2]==0&&b[3]==0&&(m=2);else if(M==2&&B==0){var K=Math.floor(Math.random()*2);b[0]==0&&b[1]==0?K==0?m=0:m=1:b[0]==0&&b[2]==0?K==0?m=0:m=2:b[0]==0&&b[3]==0?K==0?m=0:m=3:b[1]==0&&b[2]==0?K==0?m=1:m=2:b[1]==0&&b[3]==0?K==0?m=1:m=3:K==0?m=2:m=3}else if(M==4&&B==0){var K=Math.floor(Math.random()*4);m=K}else m=U;m==0?T.setCenter(g.getCenterX(),g.getCenterY()-g.getHeight()/2-l.DEFAULT_EDGE_LENGTH-T.getHeight()/2):m==1?T.setCenter(g.getCenterX()+g.getWidth()/2+l.DEFAULT_EDGE_LENGTH+T.getWidth()/2,g.getCenterY()):m==2?T.setCenter(g.getCenterX(),g.getCenterY()+g.getHeight()/2+l.DEFAULT_EDGE_LENGTH+T.getHeight()/2):T.setCenter(g.getCenterX()-g.getWidth()/2-l.DEFAULT_EDGE_LENGTH-T.getWidth()/2,g.getCenterY())}},a.exports=I},991:(a,t,n)=>{var c=n(551).FDLayoutNode,e=n(551).IMath;function p(r,h,f,l){c.call(this,r,h,f,l)}L(p,"CoSENode"),p.prototype=Object.create(c.prototype);for(var i in c)p[i]=c[i];p.prototype.calculateDisplacement=function(){var r=this.graphManager.getLayout();this.getChild()!=null&&this.fixedNodeWeight?(this.displacementX+=r.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=r.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=r.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=r.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>r.coolingFactor*r.maxNodeDisplacement&&(this.displacementX=r.coolingFactor*r.maxNodeDisplacement*e.sign(this.displacementX)),Math.abs(this.displacementY)>r.coolingFactor*r.maxNodeDisplacement&&(this.displacementY=r.coolingFactor*r.maxNodeDisplacement*e.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},p.prototype.propogateDisplacementToChildren=function(r,h){for(var f=this.getChild().getNodes(),l,A=0;A<f.length;A++)l=f[A],l.getChild()==null?(l.displacementX+=r,l.displacementY+=h):l.propogateDisplacementToChildren(r,h)},p.prototype.move=function(){var r=this.graphManager.getLayout();(this.child==null||this.child.getNodes().length==0)&&(this.moveBy(this.displacementX,this.displacementY),r.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},p.prototype.setPred1=function(r){this.pred1=r},p.prototype.getPred1=function(){return pred1},p.prototype.getPred2=function(){return pred2},p.prototype.setNext=function(r){this.next=r},p.prototype.getNext=function(){return next},p.prototype.setProcessed=function(r){this.processed=r},p.prototype.isProcessed=function(){return processed},a.exports=p},902:(a,t,n)=>{function c(f){if(Array.isArray(f)){for(var l=0,A=Array(f.length);l<f.length;l++)A[l]=f[l];return A}else return Array.from(f)}L(c,"_toConsumableArray");var e=n(806),p=n(551).LinkedList,i=n(551).Matrix,r=n(551).SVD;function h(){}L(h,"ConstraintHandler"),h.handleConstraints=function(f){var l={};l.fixedNodeConstraint=f.constraints.fixedNodeConstraint,l.alignmentConstraint=f.constraints.alignmentConstraint,l.relativePlacementConstraint=f.constraints.relativePlacementConstraint;for(var A=new Map,v=new Map,y=[],D=[],F=f.getAllNodes(),C=0,G=0;G<F.length;G++){var z=F[G];z.getChild()==null&&(v.set(z.id,C++),y.push(z.getCenterX()),D.push(z.getCenterY()),A.set(z.id,z))}l.relativePlacementConstraint&&l.relativePlacementConstraint.forEach(function(Y){!Y.gap&&Y.gap!=0&&(Y.left?Y.gap=e.DEFAULT_EDGE_LENGTH+A.get(Y.left).getWidth()/2+A.get(Y.right).getWidth()/2:Y.gap=e.DEFAULT_EDGE_LENGTH+A.get(Y.top).getHeight()/2+A.get(Y.bottom).getHeight()/2)});var X=L(function(W,V){return{x:W.x-V.x,y:W.y-V.y}},"calculatePositionDiff"),rt=L(function(W){var V=0,$=0;return W.forEach(function(k){V+=y[v.get(k)],$+=D[v.get(k)]}),{x:V/W.size,y:$/W.size}},"calculateAvgPosition"),I=L(function(W,V,$,k,j){function gt(st,nt){var dt=new Set(st),at=!0,ct=!1,Ft=void 0;try{for(var Rt=nt[Symbol.iterator](),Bt;!(at=(Bt=Rt.next()).done);at=!0){var Ot=Bt.value;dt.add(Ot)}}catch(Nt){ct=!0,Ft=Nt}finally{try{!at&&Rt.return&&Rt.return()}finally{if(ct)throw Ft}}return dt}L(gt,"setUnion");var ft=new Map;W.forEach(function(st,nt){ft.set(nt,0)}),W.forEach(function(st,nt){st.forEach(function(dt){ft.set(dt.id,ft.get(dt.id)+1)})});var q=new Map,lt=new Map,ut=new p;ft.forEach(function(st,nt){st==0?(ut.push(nt),$||(V=="horizontal"?q.set(nt,v.has(nt)?y[v.get(nt)]:k.get(nt)):q.set(nt,v.has(nt)?D[v.get(nt)]:k.get(nt)))):q.set(nt,Number.NEGATIVE_INFINITY),$&&lt.set(nt,new Set([nt]))}),$&&j.forEach(function(st){var nt=[];if(st.forEach(function(ct){$.has(ct)&&nt.push(ct)}),nt.length>0){var dt=0;nt.forEach(function(ct){V=="horizontal"?(q.set(ct,v.has(ct)?y[v.get(ct)]:k.get(ct)),dt+=q.get(ct)):(q.set(ct,v.has(ct)?D[v.get(ct)]:k.get(ct)),dt+=q.get(ct))}),dt=dt/nt.length,st.forEach(function(ct){$.has(ct)||q.set(ct,dt)})}else{var at=0;st.forEach(function(ct){V=="horizontal"?at+=v.has(ct)?y[v.get(ct)]:k.get(ct):at+=v.has(ct)?D[v.get(ct)]:k.get(ct)}),at=at/st.length,st.forEach(function(ct){q.set(ct,at)})}});for(var it=L(function(){var nt=ut.shift(),dt=W.get(nt);dt.forEach(function(at){if(q.get(at.id)<q.get(nt)+at.gap)if($&&$.has(at.id)){var ct=void 0;if(V=="horizontal"?ct=v.has(at.id)?y[v.get(at.id)]:k.get(at.id):ct=v.has(at.id)?D[v.get(at.id)]:k.get(at.id),q.set(at.id,ct),ct<q.get(nt)+at.gap){var Ft=q.get(nt)+at.gap-ct;lt.get(nt).forEach(function(Rt){q.set(Rt,q.get(Rt)-Ft)})}}else q.set(at.id,q.get(nt)+at.gap);ft.set(at.id,ft.get(at.id)-1),ft.get(at.id)==0&&ut.push(at.id),$&&lt.set(at.id,gt(lt.get(nt),lt.get(at.id)))})},"_loop");ut.length!=0;)it();if($){var pt=new Set;W.forEach(function(st,nt){st.length==0&&pt.add(nt)});var Ct=[];lt.forEach(function(st,nt){if(pt.has(nt)){var dt=!1,at=!0,ct=!1,Ft=void 0;try{for(var Rt=st[Symbol.iterator](),Bt;!(at=(Bt=Rt.next()).done);at=!0){var Ot=Bt.value;$.has(Ot)&&(dt=!0)}}catch(St){ct=!0,Ft=St}finally{try{!at&&Rt.return&&Rt.return()}finally{if(ct)throw Ft}}if(!dt){var Nt=!1,Zt=void 0;Ct.forEach(function(St,Wt){St.has([].concat(c(st))[0])&&(Nt=!0,Zt=Wt)}),Nt?st.forEach(function(St){Ct[Zt].add(St)}):Ct.push(new Set(st))}}}),Ct.forEach(function(st,nt){var dt=Number.POSITIVE_INFINITY,at=Number.POSITIVE_INFINITY,ct=Number.NEGATIVE_INFINITY,Ft=Number.NEGATIVE_INFINITY,Rt=!0,Bt=!1,Ot=void 0;try{for(var Nt=st[Symbol.iterator](),Zt;!(Rt=(Zt=Nt.next()).done);Rt=!0){var St=Zt.value,Wt=void 0;V=="horizontal"?Wt=v.has(St)?y[v.get(St)]:k.get(St):Wt=v.has(St)?D[v.get(St)]:k.get(St);var $t=q.get(St);Wt<dt&&(dt=Wt),Wt>ct&&(ct=Wt),$t<at&&(at=$t),$t>Ft&&(Ft=$t)}}catch(ne){Bt=!0,Ot=ne}finally{try{!Rt&&Nt.return&&Nt.return()}finally{if(Bt)throw Ot}}var me=(dt+ct)/2-(at+Ft)/2,Kt=!0,ee=!1,re=void 0;try{for(var jt=st[Symbol.iterator](),ue;!(Kt=(ue=jt.next()).done);Kt=!0){var ie=ue.value;q.set(ie,q.get(ie)+me)}}catch(ne){ee=!0,re=ne}finally{try{!Kt&&jt.return&&jt.return()}finally{if(ee)throw re}}})}return q},"findAppropriatePositionForRelativePlacement"),J=L(function(W){var V=0,$=0,k=0,j=0;if(W.forEach(function(lt){lt.left?y[v.get(lt.left)]-y[v.get(lt.right)]>=0?V++:$++:D[v.get(lt.top)]-D[v.get(lt.bottom)]>=0?k++:j++}),V>$&&k>j)for(var gt=0;gt<v.size;gt++)y[gt]=-1*y[gt],D[gt]=-1*D[gt];else if(V>$)for(var ft=0;ft<v.size;ft++)y[ft]=-1*y[ft];else if(k>j)for(var q=0;q<v.size;q++)D[q]=-1*D[q]},"applyReflectionForRelativePlacement"),s=L(function(W){var V=[],$=new p,k=new Set,j=0;return W.forEach(function(gt,ft){if(!k.has(ft)){V[j]=[];var q=ft;for($.push(q),k.add(q),V[j].push(q);$.length!=0;){q=$.shift();var lt=W.get(q);lt.forEach(function(ut){k.has(ut.id)||($.push(ut.id),k.add(ut.id),V[j].push(ut.id))})}j++}}),V},"findComponents"),m=L(function(W){var V=new Map;return W.forEach(function($,k){V.set(k,[])}),W.forEach(function($,k){$.forEach(function(j){V.get(k).push(j),V.get(j.id).push({id:k,gap:j.gap,direction:j.direction})})}),V},"dagToUndirected"),g=L(function(W){var V=new Map;return W.forEach(function($,k){V.set(k,[])}),W.forEach(function($,k){$.forEach(function(j){V.get(j.id).push({id:k,gap:j.gap,direction:j.direction})})}),V},"dagToReversed"),T=[],d=[],O=!1,x=!1,P=new Set,S=new Map,R=new Map,Z=[];if(l.fixedNodeConstraint&&l.fixedNodeConstraint.forEach(function(Y){P.add(Y.nodeId)}),l.relativePlacementConstraint&&(l.relativePlacementConstraint.forEach(function(Y){Y.left?(S.has(Y.left)?S.get(Y.left).push({id:Y.right,gap:Y.gap,direction:"horizontal"}):S.set(Y.left,[{id:Y.right,gap:Y.gap,direction:"horizontal"}]),S.has(Y.right)||S.set(Y.right,[])):(S.has(Y.top)?S.get(Y.top).push({id:Y.bottom,gap:Y.gap,direction:"vertical"}):S.set(Y.top,[{id:Y.bottom,gap:Y.gap,direction:"vertical"}]),S.has(Y.bottom)||S.set(Y.bottom,[]))}),R=m(S),Z=s(R)),e.TRANSFORM_ON_CONSTRAINT_HANDLING){if(l.fixedNodeConstraint&&l.fixedNodeConstraint.length>1)l.fixedNodeConstraint.forEach(function(Y,W){T[W]=[Y.position.x,Y.position.y],d[W]=[y[v.get(Y.nodeId)],D[v.get(Y.nodeId)]]}),O=!0;else if(l.alignmentConstraint)(function(){var Y=0;if(l.alignmentConstraint.vertical){for(var W=l.alignmentConstraint.vertical,V=L(function(q){var lt=new Set;W[q].forEach(function(pt){lt.add(pt)});var ut=new Set([].concat(c(lt)).filter(function(pt){return P.has(pt)})),it=void 0;ut.size>0?it=y[v.get(ut.values().next().value)]:it=rt(lt).x,W[q].forEach(function(pt){T[Y]=[it,D[v.get(pt)]],d[Y]=[y[v.get(pt)],D[v.get(pt)]],Y++})},"_loop2"),$=0;$<W.length;$++)V($);O=!0}if(l.alignmentConstraint.horizontal){for(var k=l.alignmentConstraint.horizontal,j=L(function(q){var lt=new Set;k[q].forEach(function(pt){lt.add(pt)});var ut=new Set([].concat(c(lt)).filter(function(pt){return P.has(pt)})),it=void 0;ut.size>0?it=y[v.get(ut.values().next().value)]:it=rt(lt).y,k[q].forEach(function(pt){T[Y]=[y[v.get(pt)],it],d[Y]=[y[v.get(pt)],D[v.get(pt)]],Y++})},"_loop3"),gt=0;gt<k.length;gt++)j(gt);O=!0}l.relativePlacementConstraint&&(x=!0)})();else if(l.relativePlacementConstraint){for(var tt=0,b=0,_=0;_<Z.length;_++)Z[_].length>tt&&(tt=Z[_].length,b=_);if(tt<R.size/2)J(l.relativePlacementConstraint),O=!1,x=!1;else{var B=new Map,M=new Map,U=[];Z[b].forEach(function(Y){S.get(Y).forEach(function(W){W.direction=="horizontal"?(B.has(Y)?B.get(Y).push(W):B.set(Y,[W]),B.has(W.id)||B.set(W.id,[]),U.push({left:Y,right:W.id})):(M.has(Y)?M.get(Y).push(W):M.set(Y,[W]),M.has(W.id)||M.set(W.id,[]),U.push({top:Y,bottom:W.id}))})}),J(U),x=!1;var H=I(B,"horizontal"),K=I(M,"vertical");Z[b].forEach(function(Y,W){d[W]=[y[v.get(Y)],D[v.get(Y)]],T[W]=[],H.has(Y)?T[W][0]=H.get(Y):T[W][0]=y[v.get(Y)],K.has(Y)?T[W][1]=K.get(Y):T[W][1]=D[v.get(Y)]}),O=!0}}if(O){for(var ht=void 0,Lt=i.transpose(T),bt=i.transpose(d),Q=0;Q<Lt.length;Q++)Lt[Q]=i.multGamma(Lt[Q]),bt[Q]=i.multGamma(bt[Q]);var Xt=i.multMat(Lt,i.transpose(bt)),wt=r.svd(Xt);ht=i.multMat(wt.V,i.transpose(wt.U));for(var ot=0;ot<v.size;ot++){var et=[y[ot],D[ot]],yt=[ht[0][0],ht[1][0]],Et=[ht[0][1],ht[1][1]];y[ot]=i.dotProduct(et,yt),D[ot]=i.dotProduct(et,Et)}x&&J(l.relativePlacementConstraint)}}if(e.ENFORCE_CONSTRAINTS){if(l.fixedNodeConstraint&&l.fixedNodeConstraint.length>0){var Dt={x:0,y:0};l.fixedNodeConstraint.forEach(function(Y,W){var V={x:y[v.get(Y.nodeId)],y:D[v.get(Y.nodeId)]},$=Y.position,k=X($,V);Dt.x+=k.x,Dt.y+=k.y}),Dt.x/=l.fixedNodeConstraint.length,Dt.y/=l.fixedNodeConstraint.length,y.forEach(function(Y,W){y[W]+=Dt.x}),D.forEach(function(Y,W){D[W]+=Dt.y}),l.fixedNodeConstraint.forEach(function(Y){y[v.get(Y.nodeId)]=Y.position.x,D[v.get(Y.nodeId)]=Y.position.y})}if(l.alignmentConstraint){if(l.alignmentConstraint.vertical)for(var Tt=l.alignmentConstraint.vertical,At=L(function(W){var V=new Set;Tt[W].forEach(function(j){V.add(j)});var $=new Set([].concat(c(V)).filter(function(j){return P.has(j)})),k=void 0;$.size>0?k=y[v.get($.values().next().value)]:k=rt(V).x,V.forEach(function(j){P.has(j)||(y[v.get(j)]=k)})},"_loop4"),xt=0;xt<Tt.length;xt++)At(xt);if(l.alignmentConstraint.horizontal)for(var It=l.alignmentConstraint.horizontal,zt=L(function(W){var V=new Set;It[W].forEach(function(j){V.add(j)});var $=new Set([].concat(c(V)).filter(function(j){return P.has(j)})),k=void 0;$.size>0?k=D[v.get($.values().next().value)]:k=rt(V).y,V.forEach(function(j){P.has(j)||(D[v.get(j)]=k)})},"_loop5"),Yt=0;Yt<It.length;Yt++)zt(Yt)}l.relativePlacementConstraint&&function(){var Y=new Map,W=new Map,V=new Map,$=new Map,k=new Map,j=new Map,gt=new Set,ft=new Set;if(P.forEach(function(Ut){gt.add(Ut),ft.add(Ut)}),l.alignmentConstraint){if(l.alignmentConstraint.vertical)for(var q=l.alignmentConstraint.vertical,lt=L(function(mt){V.set("dummy"+mt,[]),q[mt].forEach(function(Mt){Y.set(Mt,"dummy"+mt),V.get("dummy"+mt).push(Mt),P.has(Mt)&&gt.add("dummy"+mt)}),k.set("dummy"+mt,y[v.get(q[mt][0])])},"_loop6"),ut=0;ut<q.length;ut++)lt(ut);if(l.alignmentConstraint.horizontal)for(var it=l.alignmentConstraint.horizontal,pt=L(function(mt){$.set("dummy"+mt,[]),it[mt].forEach(function(Mt){W.set(Mt,"dummy"+mt),$.get("dummy"+mt).push(Mt),P.has(Mt)&&ft.add("dummy"+mt)}),j.set("dummy"+mt,D[v.get(it[mt][0])])},"_loop7"),Ct=0;Ct<it.length;Ct++)pt(Ct)}var st=new Map,nt=new Map,dt=L(function(mt){S.get(mt).forEach(function(Mt){var qt=void 0,kt=void 0;Mt.direction=="horizontal"?(qt=Y.get(mt)?Y.get(mt):mt,Y.get(Mt.id)?kt={id:Y.get(Mt.id),gap:Mt.gap,direction:Mt.direction}:kt=Mt,st.has(qt)?st.get(qt).push(kt):st.set(qt,[kt]),st.has(kt.id)||st.set(kt.id,[])):(qt=W.get(mt)?W.get(mt):mt,W.get(Mt.id)?kt={id:W.get(Mt.id),gap:Mt.gap,direction:Mt.direction}:kt=Mt,nt.has(qt)?nt.get(qt).push(kt):nt.set(qt,[kt]),nt.has(kt.id)||nt.set(kt.id,[]))})},"_loop8"),at=!0,ct=!1,Ft=void 0;try{for(var Rt=S.keys()[Symbol.iterator](),Bt;!(at=(Bt=Rt.next()).done);at=!0){var Ot=Bt.value;dt(Ot)}}catch(Ut){ct=!0,Ft=Ut}finally{try{!at&&Rt.return&&Rt.return()}finally{if(ct)throw Ft}}var Nt=m(st),Zt=m(nt),St=s(Nt),Wt=s(Zt),$t=g(st),me=g(nt),Kt=[],ee=[];St.forEach(function(Ut,mt){Kt[mt]=[],Ut.forEach(function(Mt){$t.get(Mt).length==0&&Kt[mt].push(Mt)})}),Wt.forEach(function(Ut,mt){ee[mt]=[],Ut.forEach(function(Mt){me.get(Mt).length==0&&ee[mt].push(Mt)})});var re=I(st,"horizontal",gt,k,Kt),jt=I(nt,"vertical",ft,j,ee),ue=L(function(mt){V.get(mt)?V.get(mt).forEach(function(Mt){y[v.get(Mt)]=re.get(mt)}):y[v.get(mt)]=re.get(mt)},"_loop9"),ie=!0,ne=!1,be=void 0;try{for(var Ee=re.keys()[Symbol.iterator](),Fe;!(ie=(Fe=Ee.next()).done);ie=!0){var Te=Fe.value;ue(Te)}}catch(Ut){ne=!0,be=Ut}finally{try{!ie&&Ee.return&&Ee.return()}finally{if(ne)throw be}}var vr=L(function(mt){$.get(mt)?$.get(mt).forEach(function(Mt){D[v.get(Mt)]=jt.get(mt)}):D[v.get(mt)]=jt.get(mt)},"_loop10"),Ae=!0,Pe=!1,Ge=void 0;try{for(var Ne=jt.keys()[Symbol.iterator](),Ye;!(Ae=(Ye=Ne.next()).done);Ae=!0){var Te=Ye.value;vr(Te)}}catch(Ut){Pe=!0,Ge=Ut}finally{try{!Ae&&Ne.return&&Ne.return()}finally{if(Pe)throw Ge}}}()}for(var Ht=0;Ht<F.length;Ht++){var Pt=F[Ht];Pt.getChild()==null&&Pt.setCenter(y[v.get(Pt.id)],D[v.get(Pt.id)])}},a.exports=h},551:a=>{a.exports=E}},N={};function u(a){var t=N[a];if(t!==void 0)return t.exports;var n=N[a]={exports:{}};return w[a](n,n.exports,u),n.exports}L(u,"__webpack_require__");var o=u(45);return o})()})});var lr=Le((fe,Se)=>{"use strict";L(function(w,N){typeof fe=="object"&&typeof Se=="object"?Se.exports=N(Ie()):typeof define=="function"&&define.amd?define(["cose-base"],N):typeof fe=="object"?fe.cytoscapeFcose=N(Ie()):w.cytoscapeFcose=N(w.coseBase)},"webpackUniversalModuleDefinition")(fe,function(E){return(()=>{"use strict";var w={658:a=>{a.exports=Object.assign!=null?Object.assign.bind(Object):function(t){for(var n=arguments.length,c=Array(n>1?n-1:0),e=1;e<n;e++)c[e-1]=arguments[e];return c.forEach(function(p){Object.keys(p).forEach(function(i){return t[i]=p[i]})}),t}},548:(a,t,n)=>{var c=function(){function i(r,h){var f=[],l=!0,A=!1,v=void 0;try{for(var y=r[Symbol.iterator](),D;!(l=(D=y.next()).done)&&(f.push(D.value),!(h&&f.length===h));l=!0);}catch(F){A=!0,v=F}finally{try{!l&&y.return&&y.return()}finally{if(A)throw v}}return f}return L(i,"sliceIterator"),function(r,h){if(Array.isArray(r))return r;if(Symbol.iterator in Object(r))return i(r,h);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),e=n(140).layoutBase.LinkedList,p={};p.getTopMostNodes=function(i){for(var r={},h=0;h<i.length;h++)r[i[h].id()]=!0;var f=i.filter(function(l,A){typeof l=="number"&&(l=A);for(var v=l.parent()[0];v!=null;){if(r[v.id()])return!1;v=v.parent()[0]}return!0});return f},p.connectComponents=function(i,r,h,f){var l=new e,A=new Set,v=[],y=void 0,D=void 0,F=void 0,C=!1,G=1,z=[],X=[],rt=L(function(){var J=i.collection();X.push(J);var s=h[0],m=i.collection();m.merge(s).merge(s.descendants().intersection(r)),v.push(s),m.forEach(function(d){l.push(d),A.add(d),J.merge(d)});for(var g=L(function(){s=l.shift();var O=i.collection();s.neighborhood().nodes().forEach(function(R){r.intersection(s.edgesWith(R)).length>0&&O.merge(R)});for(var x=0;x<O.length;x++){var P=O[x];if(y=h.intersection(P.union(P.ancestors())),y!=null&&!A.has(y[0])){var S=y.union(y.descendants());S.forEach(function(R){l.push(R),A.add(R),J.merge(R),h.has(R)&&v.push(R)})}}},"_loop2");l.length!=0;)g();if(J.forEach(function(d){r.intersection(d.connectedEdges()).forEach(function(O){J.has(O.source())&&J.has(O.target())&&J.merge(O)})}),v.length==h.length&&(C=!0),!C||C&&G>1){D=v[0],F=D.connectedEdges().length,v.forEach(function(d){d.connectedEdges().length<F&&(F=d.connectedEdges().length,D=d)}),z.push(D.id());var T=i.collection();T.merge(v[0]),v.forEach(function(d){T.merge(d)}),v=[],h=h.difference(T),G++}},"_loop");do rt();while(!C);return f&&z.length>0&&f.set("dummy"+(f.size+1),z),X},p.relocateComponent=function(i,r,h){if(!h.fixedNodeConstraint){var f=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY,A=Number.POSITIVE_INFINITY,v=Number.NEGATIVE_INFINITY;if(h.quality=="draft"){var y=!0,D=!1,F=void 0;try{for(var C=r.nodeIndexes[Symbol.iterator](),G;!(y=(G=C.next()).done);y=!0){var z=G.value,X=c(z,2),rt=X[0],I=X[1],J=h.cy.getElementById(rt);if(J){var s=J.boundingBox(),m=r.xCoords[I]-s.w/2,g=r.xCoords[I]+s.w/2,T=r.yCoords[I]-s.h/2,d=r.yCoords[I]+s.h/2;m<f&&(f=m),g>l&&(l=g),T<A&&(A=T),d>v&&(v=d)}}}catch(R){D=!0,F=R}finally{try{!y&&C.return&&C.return()}finally{if(D)throw F}}var O=i.x-(l+f)/2,x=i.y-(v+A)/2;r.xCoords=r.xCoords.map(function(R){return R+O}),r.yCoords=r.yCoords.map(function(R){return R+x})}else{Object.keys(r).forEach(function(R){var Z=r[R],tt=Z.getRect().x,b=Z.getRect().x+Z.getRect().width,_=Z.getRect().y,B=Z.getRect().y+Z.getRect().height;tt<f&&(f=tt),b>l&&(l=b),_<A&&(A=_),B>v&&(v=B)});var P=i.x-(l+f)/2,S=i.y-(v+A)/2;Object.keys(r).forEach(function(R){var Z=r[R];Z.setCenter(Z.getCenterX()+P,Z.getCenterY()+S)})}}},p.calcBoundingBox=function(i,r,h,f){for(var l=Number.MAX_SAFE_INTEGER,A=Number.MIN_SAFE_INTEGER,v=Number.MAX_SAFE_INTEGER,y=Number.MIN_SAFE_INTEGER,D=void 0,F=void 0,C=void 0,G=void 0,z=i.descendants().not(":parent"),X=z.length,rt=0;rt<X;rt++){var I=z[rt];D=r[f.get(I.id())]-I.width()/2,F=r[f.get(I.id())]+I.width()/2,C=h[f.get(I.id())]-I.height()/2,G=h[f.get(I.id())]+I.height()/2,l>D&&(l=D),A<F&&(A=F),v>C&&(v=C),y<G&&(y=G)}var J={};return J.topLeftX=l,J.topLeftY=v,J.width=A-l,J.height=y-v,J},p.calcParentsWithoutChildren=function(i,r){var h=i.collection();return r.nodes(":parent").forEach(function(f){var l=!1;f.children().forEach(function(A){A.css("display")!="none"&&(l=!0)}),l||h.merge(f)}),h},a.exports=p},816:(a,t,n)=>{var c=n(548),e=n(140).CoSELayout,p=n(140).CoSENode,i=n(140).layoutBase.PointD,r=n(140).layoutBase.DimensionD,h=n(140).layoutBase.LayoutConstants,f=n(140).layoutBase.FDLayoutConstants,l=n(140).CoSEConstants,A=L(function(y,D){var F=y.cy,C=y.eles,G=C.nodes(),z=C.edges(),X=void 0,rt=void 0,I=void 0,J={};y.randomize&&(X=D.nodeIndexes,rt=D.xCoords,I=D.yCoords);var s=L(function(R){return typeof R=="function"},"isFn"),m=L(function(R,Z){return s(R)?R(Z):R},"optFn"),g=c.calcParentsWithoutChildren(F,C),T=L(function S(R,Z,tt,b){for(var _=Z.length,B=0;B<_;B++){var M=Z[B],U=null;M.intersection(g).length==0&&(U=M.children());var H=void 0,K=M.layoutDimensions({nodeDimensionsIncludeLabels:b.nodeDimensionsIncludeLabels});if(M.outerWidth()!=null&&M.outerHeight()!=null)if(b.randomize)if(!M.isParent())H=R.add(new p(tt.graphManager,new i(rt[X.get(M.id())]-K.w/2,I[X.get(M.id())]-K.h/2),new r(parseFloat(K.w),parseFloat(K.h))));else{var ht=c.calcBoundingBox(M,rt,I,X);M.intersection(g).length==0?H=R.add(new p(tt.graphManager,new i(ht.topLeftX,ht.topLeftY),new r(ht.width,ht.height))):H=R.add(new p(tt.graphManager,new i(ht.topLeftX,ht.topLeftY),new r(parseFloat(K.w),parseFloat(K.h))))}else H=R.add(new p(tt.graphManager,new i(M.position("x")-K.w/2,M.position("y")-K.h/2),new r(parseFloat(K.w),parseFloat(K.h))));else H=R.add(new p(this.graphManager));if(H.id=M.data("id"),H.nodeRepulsion=m(b.nodeRepulsion,M),H.paddingLeft=parseInt(M.css("padding")),H.paddingTop=parseInt(M.css("padding")),H.paddingRight=parseInt(M.css("padding")),H.paddingBottom=parseInt(M.css("padding")),b.nodeDimensionsIncludeLabels&&(H.labelWidth=M.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).w,H.labelHeight=M.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).h,H.labelPosVertical=M.css("text-valign"),H.labelPosHorizontal=M.css("text-halign")),J[M.data("id")]=H,isNaN(H.rect.x)&&(H.rect.x=0),isNaN(H.rect.y)&&(H.rect.y=0),U!=null&&U.length>0){var Lt=void 0;Lt=tt.getGraphManager().add(tt.newGraph(),H),S(Lt,U,tt,b)}}},"processChildrenList"),d=L(function(R,Z,tt){for(var b=0,_=0,B=0;B<tt.length;B++){var M=tt[B],U=J[M.data("source")],H=J[M.data("target")];if(U&&H&&U!==H&&U.getEdgesBetween(H).length==0){var K=Z.add(R.newEdge(),U,H);K.id=M.id(),K.idealLength=m(y.idealEdgeLength,M),K.edgeElasticity=m(y.edgeElasticity,M),b+=K.idealLength,_++}}y.idealEdgeLength!=null&&(_>0?l.DEFAULT_EDGE_LENGTH=f.DEFAULT_EDGE_LENGTH=b/_:s(y.idealEdgeLength)?l.DEFAULT_EDGE_LENGTH=f.DEFAULT_EDGE_LENGTH=50:l.DEFAULT_EDGE_LENGTH=f.DEFAULT_EDGE_LENGTH=y.idealEdgeLength,l.MIN_REPULSION_DIST=f.MIN_REPULSION_DIST=f.DEFAULT_EDGE_LENGTH/10,l.DEFAULT_RADIAL_SEPARATION=f.DEFAULT_EDGE_LENGTH)},"processEdges"),O=L(function(R,Z){Z.fixedNodeConstraint&&(R.constraints.fixedNodeConstraint=Z.fixedNodeConstraint),Z.alignmentConstraint&&(R.constraints.alignmentConstraint=Z.alignmentConstraint),Z.relativePlacementConstraint&&(R.constraints.relativePlacementConstraint=Z.relativePlacementConstraint)},"processConstraints");y.nestingFactor!=null&&(l.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=f.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=y.nestingFactor),y.gravity!=null&&(l.DEFAULT_GRAVITY_STRENGTH=f.DEFAULT_GRAVITY_STRENGTH=y.gravity),y.numIter!=null&&(l.MAX_ITERATIONS=f.MAX_ITERATIONS=y.numIter),y.gravityRange!=null&&(l.DEFAULT_GRAVITY_RANGE_FACTOR=f.DEFAULT_GRAVITY_RANGE_FACTOR=y.gravityRange),y.gravityCompound!=null&&(l.DEFAULT_COMPOUND_GRAVITY_STRENGTH=f.DEFAULT_COMPOUND_GRAVITY_STRENGTH=y.gravityCompound),y.gravityRangeCompound!=null&&(l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=f.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=y.gravityRangeCompound),y.initialEnergyOnIncremental!=null&&(l.DEFAULT_COOLING_FACTOR_INCREMENTAL=f.DEFAULT_COOLING_FACTOR_INCREMENTAL=y.initialEnergyOnIncremental),y.tilingCompareBy!=null&&(l.TILING_COMPARE_BY=y.tilingCompareBy),y.quality=="proof"?h.QUALITY=2:h.QUALITY=0,l.NODE_DIMENSIONS_INCLUDE_LABELS=f.NODE_DIMENSIONS_INCLUDE_LABELS=h.NODE_DIMENSIONS_INCLUDE_LABELS=y.nodeDimensionsIncludeLabels,l.DEFAULT_INCREMENTAL=f.DEFAULT_INCREMENTAL=h.DEFAULT_INCREMENTAL=!y.randomize,l.ANIMATE=f.ANIMATE=h.ANIMATE=y.animate,l.TILE=y.tile,l.TILING_PADDING_VERTICAL=typeof y.tilingPaddingVertical=="function"?y.tilingPaddingVertical.call():y.tilingPaddingVertical,l.TILING_PADDING_HORIZONTAL=typeof y.tilingPaddingHorizontal=="function"?y.tilingPaddingHorizontal.call():y.tilingPaddingHorizontal,l.DEFAULT_INCREMENTAL=f.DEFAULT_INCREMENTAL=h.DEFAULT_INCREMENTAL=!0,l.PURE_INCREMENTAL=!y.randomize,h.DEFAULT_UNIFORM_LEAF_NODE_SIZES=y.uniformNodeDimensions,y.step=="transformed"&&(l.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,l.ENFORCE_CONSTRAINTS=!1,l.APPLY_LAYOUT=!1),y.step=="enforced"&&(l.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,l.ENFORCE_CONSTRAINTS=!0,l.APPLY_LAYOUT=!1),y.step=="cose"&&(l.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,l.ENFORCE_CONSTRAINTS=!1,l.APPLY_LAYOUT=!0),y.step=="all"&&(y.randomize?l.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:l.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,l.ENFORCE_CONSTRAINTS=!0,l.APPLY_LAYOUT=!0),y.fixedNodeConstraint||y.alignmentConstraint||y.relativePlacementConstraint?l.TREE_REDUCTION_ON_INCREMENTAL=!1:l.TREE_REDUCTION_ON_INCREMENTAL=!0;var x=new e,P=x.newGraphManager();return T(P.addRoot(),c.getTopMostNodes(G),x,y),d(x,P,z),O(x,y),x.runLayout(),J},"coseLayout");a.exports={coseLayout:A}},212:(a,t,n)=>{var c=function(){function y(D,F){for(var C=0;C<F.length;C++){var G=F[C];G.enumerable=G.enumerable||!1,G.configurable=!0,"value"in G&&(G.writable=!0),Object.defineProperty(D,G.key,G)}}return L(y,"defineProperties"),function(D,F,C){return F&&y(D.prototype,F),C&&y(D,C),D}}();function e(y,D){if(!(y instanceof D))throw new TypeError("Cannot call a class as a function")}L(e,"_classCallCheck");var p=n(658),i=n(548),r=n(657),h=r.spectralLayout,f=n(816),l=f.coseLayout,A=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:L(function(D){return 4500},"nodeRepulsion"),idealEdgeLength:L(function(D){return 50},"idealEdgeLength"),edgeElasticity:L(function(D){return .45},"edgeElasticity"),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:L(function(){},"ready"),stop:L(function(){},"stop")}),v=function(){function y(D){e(this,y),this.options=p({},A,D)}return L(y,"Layout"),c(y,[{key:"run",value:L(function(){var F=this,C=this.options,G=C.cy,z=C.eles,X=[],rt=void 0,I=void 0,J=[],s=void 0,m=[];C.fixedNodeConstraint&&(!Array.isArray(C.fixedNodeConstraint)||C.fixedNodeConstraint.length==0)&&(C.fixedNodeConstraint=void 0),C.alignmentConstraint&&(C.alignmentConstraint.vertical&&(!Array.isArray(C.alignmentConstraint.vertical)||C.alignmentConstraint.vertical.length==0)&&(C.alignmentConstraint.vertical=void 0),C.alignmentConstraint.horizontal&&(!Array.isArray(C.alignmentConstraint.horizontal)||C.alignmentConstraint.horizontal.length==0)&&(C.alignmentConstraint.horizontal=void 0)),C.relativePlacementConstraint&&(!Array.isArray(C.relativePlacementConstraint)||C.relativePlacementConstraint.length==0)&&(C.relativePlacementConstraint=void 0);var g=C.fixedNodeConstraint||C.alignmentConstraint||C.relativePlacementConstraint;g&&(C.tile=!1,C.packComponents=!1);var T=void 0,d=!1;if(G.layoutUtilities&&C.packComponents&&(T=G.layoutUtilities("get"),T||(T=G.layoutUtilities()),d=!0),z.nodes().length>0)if(d){var P=i.getTopMostNodes(C.eles.nodes());if(s=i.connectComponents(G,C.eles,P),s.forEach(function(ot){var et=ot.boundingBox();m.push({x:et.x1+et.w/2,y:et.y1+et.h/2})}),C.randomize&&s.forEach(function(ot){C.eles=ot,X.push(h(C))}),C.quality=="default"||C.quality=="proof"){var S=G.collection();if(C.tile){var R=new Map,Z=[],tt=[],b=0,_={nodeIndexes:R,xCoords:Z,yCoords:tt},B=[];if(s.forEach(function(ot,et){ot.edges().length==0&&(ot.nodes().forEach(function(yt,Et){S.merge(ot.nodes()[Et]),yt.isParent()||(_.nodeIndexes.set(ot.nodes()[Et].id(),b++),_.xCoords.push(ot.nodes()[0].position().x),_.yCoords.push(ot.nodes()[0].position().y))}),B.push(et))}),S.length>1){var M=S.boundingBox();m.push({x:M.x1+M.w/2,y:M.y1+M.h/2}),s.push(S),X.push(_);for(var U=B.length-1;U>=0;U--)s.splice(B[U],1),X.splice(B[U],1),m.splice(B[U],1)}}s.forEach(function(ot,et){C.eles=ot,J.push(l(C,X[et])),i.relocateComponent(m[et],J[et],C)})}else s.forEach(function(ot,et){i.relocateComponent(m[et],X[et],C)});var H=new Set;if(s.length>1){var K=[],ht=z.filter(function(ot){return ot.css("display")=="none"});s.forEach(function(ot,et){var yt=void 0;if(C.quality=="draft"&&(yt=X[et].nodeIndexes),ot.nodes().not(ht).length>0){var Et={};Et.edges=[],Et.nodes=[];var Dt=void 0;ot.nodes().not(ht).forEach(function(Tt){if(C.quality=="draft")if(!Tt.isParent())Dt=yt.get(Tt.id()),Et.nodes.push({x:X[et].xCoords[Dt]-Tt.boundingbox().w/2,y:X[et].yCoords[Dt]-Tt.boundingbox().h/2,width:Tt.boundingbox().w,height:Tt.boundingbox().h});else{var At=i.calcBoundingBox(Tt,X[et].xCoords,X[et].yCoords,yt);Et.nodes.push({x:At.topLeftX,y:At.topLeftY,width:At.width,height:At.height})}else J[et][Tt.id()]&&Et.nodes.push({x:J[et][Tt.id()].getLeft(),y:J[et][Tt.id()].getTop(),width:J[et][Tt.id()].getWidth(),height:J[et][Tt.id()].getHeight()})}),ot.edges().forEach(function(Tt){var At=Tt.source(),xt=Tt.target();if(At.css("display")!="none"&&xt.css("display")!="none")if(C.quality=="draft"){var It=yt.get(At.id()),zt=yt.get(xt.id()),Yt=[],Ht=[];if(At.isParent()){var Pt=i.calcBoundingBox(At,X[et].xCoords,X[et].yCoords,yt);Yt.push(Pt.topLeftX+Pt.width/2),Yt.push(Pt.topLeftY+Pt.height/2)}else Yt.push(X[et].xCoords[It]),Yt.push(X[et].yCoords[It]);if(xt.isParent()){var Y=i.calcBoundingBox(xt,X[et].xCoords,X[et].yCoords,yt);Ht.push(Y.topLeftX+Y.width/2),Ht.push(Y.topLeftY+Y.height/2)}else Ht.push(X[et].xCoords[zt]),Ht.push(X[et].yCoords[zt]);Et.edges.push({startX:Yt[0],startY:Yt[1],endX:Ht[0],endY:Ht[1]})}else J[et][At.id()]&&J[et][xt.id()]&&Et.edges.push({startX:J[et][At.id()].getCenterX(),startY:J[et][At.id()].getCenterY(),endX:J[et][xt.id()].getCenterX(),endY:J[et][xt.id()].getCenterY()})}),Et.nodes.length>0&&(K.push(Et),H.add(et))}});var Lt=T.packComponents(K,C.randomize).shifts;if(C.quality=="draft")X.forEach(function(ot,et){var yt=ot.xCoords.map(function(Dt){return Dt+Lt[et].dx}),Et=ot.yCoords.map(function(Dt){return Dt+Lt[et].dy});ot.xCoords=yt,ot.yCoords=Et});else{var bt=0;H.forEach(function(ot){Object.keys(J[ot]).forEach(function(et){var yt=J[ot][et];yt.setCenter(yt.getCenterX()+Lt[bt].dx,yt.getCenterY()+Lt[bt].dy)}),bt++})}}}else{var O=C.eles.boundingBox();if(m.push({x:O.x1+O.w/2,y:O.y1+O.h/2}),C.randomize){var x=h(C);X.push(x)}C.quality=="default"||C.quality=="proof"?(J.push(l(C,X[0])),i.relocateComponent(m[0],J[0],C)):i.relocateComponent(m[0],X[0],C)}var Q=L(function(et,yt){if(C.quality=="default"||C.quality=="proof"){typeof et=="number"&&(et=yt);var Et=void 0,Dt=void 0,Tt=et.data("id");return J.forEach(function(xt){Tt in xt&&(Et={x:xt[Tt].getRect().getCenterX(),y:xt[Tt].getRect().getCenterY()},Dt=xt[Tt])}),C.nodeDimensionsIncludeLabels&&(Dt.labelWidth&&(Dt.labelPosHorizontal=="left"?Et.x+=Dt.labelWidth/2:Dt.labelPosHorizontal=="right"&&(Et.x-=Dt.labelWidth/2)),Dt.labelHeight&&(Dt.labelPosVertical=="top"?Et.y+=Dt.labelHeight/2:Dt.labelPosVertical=="bottom"&&(Et.y-=Dt.labelHeight/2))),Et==null&&(Et={x:et.position("x"),y:et.position("y")}),{x:Et.x,y:Et.y}}else{var At=void 0;return X.forEach(function(xt){var It=xt.nodeIndexes.get(et.id());It!=null&&(At={x:xt.xCoords[It],y:xt.yCoords[It]})}),At==null&&(At={x:et.position("x"),y:et.position("y")}),{x:At.x,y:At.y}}},"getPositions");if(C.quality=="default"||C.quality=="proof"||C.randomize){var Xt=i.calcParentsWithoutChildren(G,z),wt=z.filter(function(ot){return ot.css("display")=="none"});C.eles=z.not(wt),z.nodes().not(":parent").not(wt).layoutPositions(F,C,Q),Xt.length>0&&Xt.forEach(function(ot){ot.position(Q(ot))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")},"run")}]),y}();a.exports=v},657:(a,t,n)=>{var c=n(548),e=n(140).layoutBase.Matrix,p=n(140).layoutBase.SVD,i=L(function(h){var f=h.cy,l=h.eles,A=l.nodes(),v=l.nodes(":parent"),y=new Map,D=new Map,F=new Map,C=[],G=[],z=[],X=[],rt=[],I=[],J=[],s=[],m=void 0,g=void 0,T=1e8,d=1e-9,O=h.piTol,x=h.samplingType,P=h.nodeSeparation,S=void 0,R=L(function(){for(var V=0,$=0,k=!1;$<S;){V=Math.floor(Math.random()*g),k=!1;for(var j=0;j<$;j++)if(X[j]==V){k=!0;break}if(!k)X[$]=V,$++;else continue}},"randomSampleCR"),Z=L(function(V,$,k){for(var j=[],gt=0,ft=0,q=0,lt=void 0,ut=[],it=0,pt=1,Ct=0;Ct<g;Ct++)ut[Ct]=T;for(j[ft]=V,ut[V]=0;ft>=gt;){q=j[gt++];for(var st=C[q],nt=0;nt<st.length;nt++)lt=D.get(st[nt]),ut[lt]==T&&(ut[lt]=ut[q]+1,j[++ft]=lt);I[q][$]=ut[q]*P}if(k){for(var dt=0;dt<g;dt++)I[dt][$]<rt[dt]&&(rt[dt]=I[dt][$]);for(var at=0;at<g;at++)rt[at]>it&&(it=rt[at],pt=at)}return pt},"BFS"),tt=L(function(V){var $=void 0;if(V){$=Math.floor(Math.random()*g),m=$;for(var j=0;j<g;j++)rt[j]=T;for(var gt=0;gt<S;gt++)X[gt]=$,$=Z($,gt,V)}else{R();for(var k=0;k<S;k++)Z(X[k],k,V,!1)}for(var ft=0;ft<g;ft++)for(var q=0;q<S;q++)I[ft][q]*=I[ft][q];for(var lt=0;lt<S;lt++)J[lt]=[];for(var ut=0;ut<S;ut++)for(var it=0;it<S;it++)J[ut][it]=I[X[it]][ut]},"allBFS"),b=L(function(){for(var V=p.svd(J),$=V.S,k=V.U,j=V.V,gt=$[0]*$[0]*$[0],ft=[],q=0;q<S;q++){ft[q]=[];for(var lt=0;lt<S;lt++)ft[q][lt]=0,q==lt&&(ft[q][lt]=$[q]/($[q]*$[q]+gt/($[q]*$[q])))}s=e.multMat(e.multMat(j,ft),e.transpose(k))},"sample"),_=L(function(){for(var V=void 0,$=void 0,k=[],j=[],gt=[],ft=[],q=0;q<g;q++)k[q]=Math.random(),j[q]=Math.random();k=e.normalize(k),j=e.normalize(j);for(var lt=0,ut=d,it=d,pt=void 0;;){lt++;for(var Ct=0;Ct<g;Ct++)gt[Ct]=k[Ct];if(k=e.multGamma(e.multL(e.multGamma(gt),I,s)),V=e.dotProduct(gt,k),k=e.normalize(k),ut=e.dotProduct(gt,k),pt=Math.abs(ut/it),pt<=1+O&&pt>=1)break;it=ut}for(var st=0;st<g;st++)gt[st]=k[st];for(lt=0,it=d;;){lt++;for(var nt=0;nt<g;nt++)ft[nt]=j[nt];if(ft=e.minusOp(ft,e.multCons(gt,e.dotProduct(gt,ft))),j=e.multGamma(e.multL(e.multGamma(ft),I,s)),$=e.dotProduct(ft,j),j=e.normalize(j),ut=e.dotProduct(ft,j),pt=Math.abs(ut/it),pt<=1+O&&pt>=1)break;it=ut}for(var dt=0;dt<g;dt++)ft[dt]=j[dt];G=e.multCons(gt,Math.sqrt(Math.abs(V))),z=e.multCons(ft,Math.sqrt(Math.abs($)))},"powerIteration");c.connectComponents(f,l,c.getTopMostNodes(A),y),v.forEach(function(W){c.connectComponents(f,l,c.getTopMostNodes(W.descendants().intersection(l)),y)});for(var B=0,M=0;M<A.length;M++)A[M].isParent()||D.set(A[M].id(),B++);var U=!0,H=!1,K=void 0;try{for(var ht=y.keys()[Symbol.iterator](),Lt;!(U=(Lt=ht.next()).done);U=!0){var bt=Lt.value;D.set(bt,B++)}}catch(W){H=!0,K=W}finally{try{!U&&ht.return&&ht.return()}finally{if(H)throw K}}for(var Q=0;Q<D.size;Q++)C[Q]=[];v.forEach(function(W){for(var V=W.children().intersection(l);V.nodes(":childless").length==0;)V=V.nodes()[0].children().intersection(l);var $=0,k=V.nodes(":childless")[0].connectedEdges().length;V.nodes(":childless").forEach(function(j,gt){j.connectedEdges().length<k&&(k=j.connectedEdges().length,$=gt)}),F.set(W.id(),V.nodes(":childless")[$].id())}),A.forEach(function(W){var V=void 0;W.isParent()?V=D.get(F.get(W.id())):V=D.get(W.id()),W.neighborhood().nodes().forEach(function($){l.intersection(W.edgesWith($)).length>0&&($.isParent()?C[V].push(F.get($.id())):C[V].push($.id()))})});var Xt=L(function(V){var $=D.get(V),k=void 0;y.get(V).forEach(function(j){f.getElementById(j).isParent()?k=F.get(j):k=j,C[$].push(k),C[D.get(k)].push(V)})},"_loop"),wt=!0,ot=!1,et=void 0;try{for(var yt=y.keys()[Symbol.iterator](),Et;!(wt=(Et=yt.next()).done);wt=!0){var Dt=Et.value;Xt(Dt)}}catch(W){ot=!0,et=W}finally{try{!wt&&yt.return&&yt.return()}finally{if(ot)throw et}}g=D.size;var Tt=void 0;if(g>2){S=g<h.sampleSize?g:h.sampleSize;for(var At=0;At<g;At++)I[At]=[];for(var xt=0;xt<S;xt++)s[xt]=[];return h.quality=="draft"||h.step=="all"?(tt(x),b(),_(),Tt={nodeIndexes:D,xCoords:G,yCoords:z}):(D.forEach(function(W,V){G.push(f.getElementById(V).position("x")),z.push(f.getElementById(V).position("y"))}),Tt={nodeIndexes:D,xCoords:G,yCoords:z}),Tt}else{var It=D.keys(),zt=f.getElementById(It.next().value),Yt=zt.position(),Ht=zt.outerWidth();if(G.push(Yt.x),z.push(Yt.y),g==2){var Pt=f.getElementById(It.next().value),Y=Pt.outerWidth();G.push(Yt.x+Ht/2+Y/2+h.idealEdgeLength),z.push(Yt.y)}return Tt={nodeIndexes:D,xCoords:G,yCoords:z},Tt}},"spectralLayout");a.exports={spectralLayout:i}},579:(a,t,n)=>{var c=n(212),e=L(function(i){i&&i("layout","fcose",c)},"register");typeof cytoscape<"u"&&e(cytoscape),a.exports=e},140:a=>{a.exports=E}},N={};function u(a){var t=N[a];if(t!==void 0)return t.exports;var n=N[a]={exports:{}};return w[a](n,n.exports,u),n.exports}L(u,"__webpack_require__");var o=u(579);return o})()})});var Ce={L:"left",R:"right",T:"top",B:"bottom"},Me={L:L(E=>`${E},${E/2} 0,${E} 0,0`,"L"),R:L(E=>`0,${E/2} ${E},0 ${E},${E}`,"R"),T:L(E=>`0,0 ${E},0 ${E/2},${E}`,"T"),B:L(E=>`${E/2},0 ${E},${E} 0,${E}`,"B")},se={L:L((E,w)=>E-w+2,"L"),R:L((E,w)=>E-2,"R"),T:L((E,w)=>E-w+2,"T"),B:L((E,w)=>E-2,"B")},tr=L(function(E){return Vt(E)?E==="L"?"R":"L":E==="T"?"B":"T"},"getOppositeArchitectureDirection"),we=L(function(E){let w=E;return w==="L"||w==="R"||w==="T"||w==="B"},"isArchitectureDirection"),Vt=L(function(E){let w=E;return w==="L"||w==="R"},"isArchitectureDirectionX"),Jt=L(function(E){let w=E;return w==="T"||w==="B"},"isArchitectureDirectionY"),ve=L(function(E,w){let N=Vt(E)&&Jt(w),u=Jt(E)&&Vt(w);return N||u},"isArchitectureDirectionXY"),er=L(function(E){let w=E[0],N=E[1],u=Vt(w)&&Jt(N),o=Jt(w)&&Vt(N);return u||o},"isArchitecturePairXY"),mr=L(function(E){return E!=="LL"&&E!=="RR"&&E!=="TT"&&E!=="BB"},"isValidArchitectureDirectionPair"),he=L(function(E,w){let N=`${E}${w}`;return mr(N)?N:void 0},"getArchitectureDirectionPair"),rr=L(function([E,w],N){let u=N[0],o=N[1];return Vt(u)?Jt(o)?[E+(u==="L"?-1:1),w+(o==="T"?1:-1)]:[E+(u==="L"?-1:1),w]:Vt(o)?[E+(o==="L"?1:-1),w+(u==="T"?1:-1)]:[E,w+(u==="T"?1:-1)]},"shiftPositionByArchitectureDirectionPair"),ir=L(function(E){return E==="LT"||E==="TL"?[1,1]:E==="BL"||E==="LB"?[1,-1]:E==="BR"||E==="RB"?[-1,-1]:[-1,1]},"getArchitectureDirectionXYFactors"),nr=L(function(E){return E.type==="service"},"isArchitectureService"),ar=L(function(E){return E.type==="junction"},"isArchitectureJunction"),ye=L(E=>E.data(),"edgeData"),Qt=L(E=>E.data(),"nodeData");var or=He.architecture,vt=new je(()=>({nodes:{},groups:{},edges:[],registeredIds:{},config:or,dataStructures:void 0,elements:{}})),Er=L(()=>{vt.reset(),Ve()},"clear"),Tr=L(function({id:E,icon:w,in:N,title:u,iconText:o}){if(vt.records.registeredIds[E]!==void 0)throw new Error(`The service id [${E}] is already in use by another ${vt.records.registeredIds[E]}`);if(N!==void 0){if(E===N)throw new Error(`The service [${E}] cannot be placed within itself`);if(vt.records.registeredIds[N]===void 0)throw new Error(`The service [${E}]'s parent does not exist. Please make sure the parent is created before this service`);if(vt.records.registeredIds[N]==="node")throw new Error(`The service [${E}]'s parent is not a group`)}vt.records.registeredIds[E]="node",vt.records.nodes[E]={id:E,type:"service",icon:w,iconText:o,title:u,edges:[],in:N}},"addService"),Ar=L(()=>Object.values(vt.records.nodes).filter(nr),"getServices"),Nr=L(function({id:E,in:w}){vt.records.registeredIds[E]="node",vt.records.nodes[E]={id:E,type:"junction",edges:[],in:w}},"addJunction"),Lr=L(()=>Object.values(vt.records.nodes).filter(ar),"getJunctions"),Dr=L(()=>Object.values(vt.records.nodes),"getNodes"),Cr=L(E=>vt.records.nodes[E],"getNode"),Mr=L(function({id:E,icon:w,in:N,title:u}){if(vt.records.registeredIds[E]!==void 0)throw new Error(`The group id [${E}] is already in use by another ${vt.records.registeredIds[E]}`);if(N!==void 0){if(E===N)throw new Error(`The group [${E}] cannot be placed within itself`);if(vt.records.registeredIds[N]===void 0)throw new Error(`The group [${E}]'s parent does not exist. Please make sure the parent is created before this group`);if(vt.records.registeredIds[N]==="node")throw new Error(`The group [${E}]'s parent is not a group`)}vt.records.registeredIds[E]="group",vt.records.groups[E]={id:E,icon:w,title:u,in:N}},"addGroup"),wr=L(()=>Object.values(vt.records.groups),"getGroups"),xr=L(function({lhsId:E,rhsId:w,lhsDir:N,rhsDir:u,lhsInto:o,rhsInto:a,lhsGroup:t,rhsGroup:n,title:c}){if(!we(N))throw new Error(`Invalid direction given for left hand side of edge ${E}--${w}. Expected (L,R,T,B) got ${N}`);if(!we(u))throw new Error(`Invalid direction given for right hand side of edge ${E}--${w}. Expected (L,R,T,B) got ${u}`);if(vt.records.nodes[E]===void 0&&vt.records.groups[E]===void 0)throw new Error(`The left-hand id [${E}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(vt.records.nodes[w]===void 0&&vt.records.groups[E]===void 0)throw new Error(`The right-hand id [${w}] does not yet exist. Please create the service/group before declaring an edge to it.`);let e=vt.records.nodes[E].in,p=vt.records.nodes[w].in;if(t&&e&&p&&e==p)throw new Error(`The left-hand id [${E}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(n&&e&&p&&e==p)throw new Error(`The right-hand id [${w}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);let i={lhsId:E,lhsDir:N,lhsInto:o,lhsGroup:t,rhsId:w,rhsDir:u,rhsInto:a,rhsGroup:n,title:c};vt.records.edges.push(i),vt.records.nodes[E]&&vt.records.nodes[w]&&(vt.records.nodes[E].edges.push(vt.records.edges[vt.records.edges.length-1]),vt.records.nodes[w].edges.push(vt.records.edges[vt.records.edges.length-1]))},"addEdge"),Or=L(()=>vt.records.edges,"getEdges"),Rr=L(()=>{if(vt.records.dataStructures===void 0){let E=Object.entries(vt.records.nodes).reduce((t,[n,c])=>(t[n]=c.edges.reduce((e,p)=>{if(p.lhsId===n){let i=he(p.lhsDir,p.rhsDir);i&&(e[i]=p.rhsId)}else{let i=he(p.rhsDir,p.lhsDir);i&&(e[i]=p.lhsId)}return e},{}),t),{}),w=Object.keys(E)[0],N={[w]:1},u=Object.keys(E).reduce((t,n)=>n===w?t:{...t,[n]:1},{}),o=L(t=>{let n={[t]:[0,0]},c=[t];for(;c.length>0;){let e=c.shift();if(e){N[e]=1,delete u[e];let p=E[e],[i,r]=n[e];Object.entries(p).forEach(([h,f])=>{N[f]||(n[f]=rr([i,r],h),c.push(f))})}}return n},"BFS"),a=[o(w)];for(;Object.keys(u).length>0;)a.push(o(Object.keys(u)[0]));vt.records.dataStructures={adjList:E,spatialMaps:a}}return vt.records.dataStructures},"getDataStructures"),Ir=L((E,w)=>{vt.records.elements[E]=w},"setElementForId"),Sr=L(E=>vt.records.elements[E],"getElementById"),_t={clear:Er,setDiagramTitle:Ze,getDiagramTitle:Je,setAccTitle:ze,getAccTitle:Be,setAccDescription:$e,getAccDescription:ke,addService:Tr,getServices:Ar,addJunction:Nr,getJunctions:Lr,getNodes:Dr,getNode:Cr,addGroup:Mr,getGroups:wr,addEdge:xr,getEdges:Or,setElementForId:Ir,getElementById:Sr,getDataStructures:Rr};function Gt(E){let w=ae().architecture;return w?.[E]?w[E]:or[E]}L(Gt,"getConfigField");var br=L((E,w)=>{Ke(E,w),E.groups.map(w.addGroup),E.services.map(N=>w.addService({...N,type:"service"})),E.junctions.map(N=>w.addJunction({...N,type:"junction"})),E.edges.map(w.addEdge)},"populateDb"),sr={parse:L(async E=>{let w=await Qe("architecture",E);ge.debug(w),br(w,_t)},"parse")};var Fr=L(E=>`
  .edge {
    stroke-width: ${E.archEdgeWidth};
    stroke: ${E.archEdgeColor};
    fill: none;
  }

  .arrow {
    fill: ${E.archEdgeArrowColor};
  }

  .node-bkg {
    fill: none;
    stroke: ${E.archGroupBorderColor};
    stroke-width: ${E.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"),hr=Fr;var dr=yr(lr(),1);var oe=L(E=>`<g><rect width="80" height="80" style="fill: #087ebf; stroke-width: 0px;"/>${E}</g>`,"wrapIcon"),te={prefix:"mermaid-architecture",height:80,width:80,icons:{database:{body:oe('<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:oe('<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:oe('<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:oe('<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:oe('<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:Ue,blank:{body:oe("")}}};var cr=L(async function(E,w){let N=Gt("padding"),u=Gt("iconSize"),o=u/2,a=u/6,t=a/2;await Promise.all(w.edges().map(async n=>{let{source:c,sourceDir:e,sourceArrow:p,sourceGroup:i,target:r,targetDir:h,targetArrow:f,targetGroup:l,label:A}=ye(n),{x:v,y}=n[0].sourceEndpoint(),{x:D,y:F}=n[0].midpoint(),{x:C,y:G}=n[0].targetEndpoint(),z=N+4;if(i&&(Vt(e)?v+=e==="L"?-z:z:y+=e==="T"?-z:z+18),l&&(Vt(h)?C+=h==="L"?-z:z:G+=h==="T"?-z:z+18),!i&&_t.getNode(c)?.type==="junction"&&(Vt(e)?v+=e==="L"?o:-o:y+=e==="T"?o:-o),!l&&_t.getNode(r)?.type==="junction"&&(Vt(h)?C+=h==="L"?o:-o:G+=h==="T"?o:-o),n[0]._private.rscratch){let X=E.insert("g");if(X.insert("path").attr("d",`M ${v},${y} L ${D},${F} L${C},${G} `).attr("class","edge"),p){let rt=Vt(e)?se[e](v,a):v-t,I=Jt(e)?se[e](y,a):y-t;X.insert("polygon").attr("points",Me[e](a)).attr("transform",`translate(${rt},${I})`).attr("class","arrow")}if(f){let rt=Vt(h)?se[h](C,a):C-t,I=Jt(h)?se[h](G,a):G-t;X.insert("polygon").attr("points",Me[h](a)).attr("transform",`translate(${rt},${I})`).attr("class","arrow")}if(A){let rt=ve(e,h)?"XY":Vt(e)?"X":"Y",I=0;rt==="X"?I=Math.abs(v-C):rt==="Y"?I=Math.abs(y-G)/1.5:I=Math.abs(v-C)/2;let J=X.append("g");if(await pe(J,A,{useHtmlLabels:!1,width:I,classes:"architecture-service-label"},ae()),J.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),rt==="X")J.attr("transform","translate("+D+", "+F+")");else if(rt==="Y")J.attr("transform","translate("+D+", "+F+") rotate(-90)");else if(rt==="XY"){let s=he(e,h);if(s&&er(s)){let m=J.node().getBoundingClientRect(),[g,T]=ir(s);J.attr("dominant-baseline","auto").attr("transform",`rotate(${-1*g*T*45})`);let d=J.node().getBoundingClientRect();J.attr("transform",`
                translate(${D}, ${F-m.height/2})
                translate(${g*d.width/2}, ${T*d.height/2})
                rotate(${-1*g*T*45}, 0, ${m.height/2})
              `)}}}}}))},"drawEdges"),fr=L(async function(E,w){let u=Gt("padding")*.75,o=Gt("fontSize"),t=Gt("iconSize")/2;await Promise.all(w.nodes().map(async n=>{let c=Qt(n);if(c.type==="group"){let{h:e,w:p,x1:i,y1:r}=n.boundingBox();E.append("rect").attr("x",i+t).attr("y",r+t).attr("width",p).attr("height",e).attr("class","node-bkg");let h=E.append("g"),f=i,l=r;if(c.icon){let A=h.append("g");A.html(`<g>${await de(c.icon,{height:u,width:u,fallbackPrefix:te.prefix})}</g>`),A.attr("transform","translate("+(f+t+1)+", "+(l+t+1)+")"),f+=u,l+=o/2-1-2}if(c.label){let A=h.append("g");await pe(A,c.label,{useHtmlLabels:!1,width:p,classes:"architecture-service-label"},ae()),A.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","start").attr("text-anchor","start"),A.attr("transform","translate("+(f+t+4)+", "+(l+t+2)+")")}}}))},"drawGroups"),ur=L(async function(E,w,N){for(let u of N){let o=w.append("g"),a=Gt("iconSize");if(u.title){let e=o.append("g");await pe(e,u.title,{useHtmlLabels:!1,width:a*1.5,classes:"architecture-service-label"},ae()),e.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),e.attr("transform","translate("+a/2+", "+a+")")}let t=o.append("g");if(u.icon)t.html(`<g>${await de(u.icon,{height:a,width:a,fallbackPrefix:te.prefix})}</g>`);else if(u.iconText){t.html(`<g>${await de("blank",{height:a,width:a,fallbackPrefix:te.prefix})}</g>`);let i=t.append("g").append("foreignObject").attr("width",a).attr("height",a).append("div").attr("class","node-icon-text").attr("style",`height: ${a}px;`).append("div").html(u.iconText),r=parseInt(window.getComputedStyle(i.node(),null).getPropertyValue("font-size").replace(/\D/g,""))??16;i.attr("style",`-webkit-line-clamp: ${Math.floor((a-2)/r)};`)}else t.append("path").attr("class","node-bkg").attr("id","node-"+u.id).attr("d",`M0 ${a} v${-a} q0,-5 5,-5 h${a} q5,0 5,5 v${a} H0 Z`);o.attr("class","architecture-service");let{width:n,height:c}=o._groups[0][0].getBBox();u.width=n,u.height=c,E.setElementForId(u.id,o)}return 0},"drawServices"),gr=L(function(E,w,N){N.forEach(u=>{let o=w.append("g"),a=Gt("iconSize");o.append("g").append("rect").attr("id","node-"+u.id).attr("fill-opacity","0").attr("width",a).attr("height",a),o.attr("class","architecture-junction");let{width:n,height:c}=o._groups[0][0].getBBox();o.width=n,o.height=c,E.setElementForId(u.id,o)})},"drawJunctions");Xe([{name:te.prefix,icons:te}]);De.use(dr.default);function Pr(E,w){E.forEach(N=>{w.add({group:"nodes",data:{type:"service",id:N.id,icon:N.icon,label:N.title,parent:N.in,width:Gt("iconSize"),height:Gt("iconSize")},classes:"node-service"})})}L(Pr,"addServices");function Gr(E,w){E.forEach(N=>{w.add({group:"nodes",data:{type:"junction",id:N.id,parent:N.in,width:Gt("iconSize"),height:Gt("iconSize")},classes:"node-junction"})})}L(Gr,"addJunctions");function Yr(E,w){w.nodes().map(N=>{let u=Qt(N);if(u.type==="group")return;u.x=N.position().x,u.y=N.position().y,E.getElementById(u.id).attr("transform","translate("+(u.x||0)+","+(u.y||0)+")")})}L(Yr,"positionNodes");function Ur(E,w){E.forEach(N=>{w.add({group:"nodes",data:{type:"group",id:N.id,icon:N.icon,label:N.title,parent:N.in},classes:"node-group"})})}L(Ur,"addGroups");function Xr(E,w){E.forEach(N=>{let{lhsId:u,rhsId:o,lhsInto:a,lhsGroup:t,rhsInto:n,lhsDir:c,rhsDir:e,rhsGroup:p,title:i}=N,r=ve(N.lhsDir,N.rhsDir)?"segments":"straight",h={id:`${u}-${o}`,label:i,source:u,sourceDir:c,sourceArrow:a,sourceGroup:t,sourceEndpoint:c==="L"?"0 50%":c==="R"?"100% 50%":c==="T"?"50% 0":"50% 100%",target:o,targetDir:e,targetArrow:n,targetGroup:p,targetEndpoint:e==="L"?"0 50%":e==="R"?"100% 50%":e==="T"?"50% 0":"50% 100%"};w.add({group:"edges",data:h,classes:r})})}L(Xr,"addEdges");function Hr(E){let w=E.map(o=>{let a={},t={};return Object.entries(o).forEach(([n,[c,e]])=>{a[e]||(a[e]=[]),t[c]||(t[c]=[]),a[e].push(n),t[c].push(n)}),{horiz:Object.values(a).filter(n=>n.length>1),vert:Object.values(t).filter(n=>n.length>1)}}),[N,u]=w.reduce(([o,a],{horiz:t,vert:n})=>[[...o,...t],[...a,...n]],[[],[]]);return{horizontal:N,vertical:u}}L(Hr,"getAlignments");function Wr(E){let w=[],N=L(o=>`${o[0]},${o[1]}`,"posToStr"),u=L(o=>o.split(",").map(a=>parseInt(a)),"strToPos");return E.forEach(o=>{let a=Object.fromEntries(Object.entries(o).map(([e,p])=>[N(p),e])),t=[N([0,0])],n={},c={L:[-1,0],R:[1,0],T:[0,1],B:[0,-1]};for(;t.length>0;){let e=t.shift();if(e){n[e]=1;let p=a[e];if(p){let i=u(e);Object.entries(c).forEach(([r,h])=>{let f=N([i[0]+h[0],i[1]+h[1]]),l=a[f];l&&!n[f]&&(t.push(f),w.push({[Ce[r]]:l,[Ce[tr(r)]]:p,gap:1.5*Gt("iconSize")}))})}}}}),w}L(Wr,"getRelativeConstraints");function Vr(E,w,N,u,{spatialMaps:o}){return new Promise(a=>{let t=qe("body").append("div").attr("id","cy").attr("style","display:none"),n=De({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":`${Gt("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:`${Gt("padding")}px`}}]});t.remove(),Ur(N,n),Pr(E,n),Gr(w,n),Xr(u,n);let c=Hr(o),e=Wr(o),p=n.layout({name:"fcose",quality:"proof",styleEnabled:!1,animate:!1,nodeDimensionsIncludeLabels:!1,idealEdgeLength(i){let[r,h]=i.connectedNodes(),{parent:f}=Qt(r),{parent:l}=Qt(h);return f===l?1.5*Gt("iconSize"):.5*Gt("iconSize")},edgeElasticity(i){let[r,h]=i.connectedNodes(),{parent:f}=Qt(r),{parent:l}=Qt(h);return f===l?.45:.001},alignmentConstraint:c,relativePlacementConstraint:e});p.one("layoutstop",()=>{function i(r,h,f,l){let A,v,{x:y,y:D}=r,{x:F,y:C}=h;v=(l-D+(y-f)*(D-C)/(y-F))/Math.sqrt(1+Math.pow((D-C)/(y-F),2)),A=Math.sqrt(Math.pow(l-D,2)+Math.pow(f-y,2)-Math.pow(v,2));let G=Math.sqrt(Math.pow(F-y,2)+Math.pow(C-D,2));A=A/G;let z=(F-y)*(l-D)-(C-D)*(f-y);switch(!0){case z>=0:z=1;break;case z<0:z=-1;break}let X=(F-y)*(f-y)+(C-D)*(l-D);switch(!0){case X>=0:X=1;break;case X<0:X=-1;break}return v=Math.abs(v)*z,A=A*X,{distances:v,weights:A}}L(i,"getSegmentWeights"),n.startBatch();for(let r of Object.values(n.edges()))if(r.data?.()){let{x:h,y:f}=r.source().position(),{x:l,y:A}=r.target().position();if(h!==l&&f!==A){let v=r.sourceEndpoint(),y=r.targetEndpoint(),{sourceDir:D}=ye(r),[F,C]=Jt(D)?[v.x,y.y]:[y.x,v.y],{weights:G,distances:z}=i(v,y,F,C);r.style("segment-distances",z),r.style("segment-weights",G)}}n.endBatch(),p.run()}),p.run(),n.ready(i=>{ge.info("Ready",i),a(n)})})}L(Vr,"layoutArchitecture");var zr=L(async(E,w,N,u)=>{let o=u.db,a=o.getServices(),t=o.getJunctions(),n=o.getGroups(),c=o.getEdges(),e=o.getDataStructures(),p=_e(w),i=p.append("g");i.attr("class","architecture-edges");let r=p.append("g");r.attr("class","architecture-services");let h=p.append("g");h.attr("class","architecture-groups"),await ur(o,r,a),gr(o,r,t);let f=await Vr(a,t,n,c,e);await cr(i,f),await fr(h,f),Yr(o,f),We(void 0,p,Gt("padding"),Gt("useMaxWidth"))},"draw"),pr={draw:zr};var Yi={parser:sr,db:_t,renderer:pr,styles:hr};export{Yi as diagram};