UNPKG

mermaid

Version:

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

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

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

  .node-bkg {
    fill: none;
    stroke: ${D.archGroupBorderColor};
    stroke-width: ${D.archGroupBorderWidth};
    stroke-dasharray: 8;
  }
  .node-icon-text {
    display: flex; 
    align-items: center;
  }
  
  .node-icon-text > div {
    color: #fff;
    margin: 1px;
    height: fit-content;
    text-align: center;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
  }
`,"getStyles"),fr=Dr;var mr=Ar(ur(),1);function be(D,w){if(D===0)return w();let A=Math.random,f=D>>>0;Math.random=function(){f=f+1831565813>>>0;let o=f;return o=Math.imul(o^o>>>15,o|1),o^=o+Math.imul(o^o>>>7,o|61),((o^o>>>14)>>>0)/4294967296};try{return w()}finally{Math.random=A}}L(be,"withSeededRandom");var ie=L(D=>`<g><rect width="80" height="80" style="fill: #087ebf; stroke-width: 0px;"/>${D}</g>`,"wrapIcon"),Kt={prefix:"mermaid-architecture",height:80,width:80,icons:{database:{body:ie('<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:ie('<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:ie('<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:ie('<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:ie('<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:Ve,blank:{body:ie("")}}};var gr=L(async function(D,w,A,f){let o=A.getConfigField("padding"),a=A.getConfigField("iconSize"),r=a/2,n=a/6,c=n/2;await Promise.all(w.edges().map(async i=>{let{source:g,sourceDir:t,sourceArrow:e,sourceGroup:h,target:u,targetDir:l,targetArrow:N,targetGroup:v,label:m}=ve(i),{x:T,y:S}=i[0].sourceEndpoint(),{x:M,y:b}=i[0].midpoint(),{x:X,y:Y}=i[0].targetEndpoint(),Q=o+4;if(h&&(Xt(t)?T+=t==="L"?-Q:Q:S+=t==="T"?-Q:Q+18),v&&(Xt(l)?X+=l==="L"?-Q:Q:Y+=l==="T"?-Q:Q+18),!h&&A.getNode(g)?.type==="junction"&&(Xt(t)?T+=t==="L"?r:-r:S+=t==="T"?r:-r),!v&&A.getNode(u)?.type==="junction"&&(Xt(l)?X+=l==="L"?r:-r:Y+=l==="T"?r:-r),i[0]._private.rscratch){let O=D.insert("g");if(O.insert("path").attr("d",`M ${T},${S} L ${M},${b} L${X},${Y} `).attr("class","edge").attr("id",`${f}-${tr(g,u,{prefix:"L"})}`),e){let W=Xt(t)?ne[t](T,n):T-c,s=kt(t)?ne[t](S,n):S-c;O.insert("polygon").attr("points",we[t](n)).attr("transform",`translate(${W},${s})`).attr("class","arrow")}if(N){let W=Xt(l)?ne[l](X,n):X-c,s=kt(l)?ne[l](Y,n):Y-c;O.insert("polygon").attr("points",we[l](n)).attr("transform",`translate(${W},${s})`).attr("class","arrow")}if(m){let W=ae(t,l)?"XY":Xt(t)?"X":"Y",s=0;W==="X"?s=Math.abs(T-X):W==="Y"?s=Math.abs(S-Y)/1.5:s=Math.abs(T-X)/2;let y=O.append("g");if(await de(y,m,{useHtmlLabels:!1,width:s,classes:"architecture-service-label"},ge()),y.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),W==="X")y.attr("transform","translate("+M+", "+b+")");else if(W==="Y")y.attr("transform","translate("+M+", "+b+") rotate(-90)");else if(W==="XY"){let p=oe(t,l);if(p&&ar(p)){let E=y.node().getBoundingClientRect(),[d,I]=sr(p);y.attr("dominant-baseline","auto").attr("transform",`rotate(${-1*d*I*45})`);let x=y.node().getBoundingClientRect();y.attr("transform",`
                translate(${M}, ${b-E.height/2})
                translate(${d*x.width/2}, ${I*x.height/2})
                rotate(${-1*d*I*45}, 0, ${E.height/2})
              `)}}}}}))},"drawEdges"),dr=L(async function(D,w,A,f){let a=A.getConfigField("padding")*.75,r=A.getConfigField("fontSize"),c=A.getConfigField("iconSize")/2;await Promise.all(w.nodes().map(async i=>{let g=Jt(i);if(g.type==="group"){let{h:t,w:e,x1:h,y1:u}=i.boundingBox(),l=D.append("rect");l.attr("id",`${f}-group-${g.id}`).attr("x",h+c).attr("y",u+c).attr("width",e).attr("height",t).attr("class","node-bkg");let N=D.append("g"),v=h,m=u;if(g.icon){let T=N.append("g");T.html(`<g>${await ue(g.icon,{height:a,width:a,fallbackPrefix:Kt.prefix})}</g>`),T.attr("transform","translate("+(v+c+1)+", "+(m+c+1)+")"),v+=a,m+=r/2-1-2}if(g.label){let T=N.append("g");await de(T,g.label,{useHtmlLabels:!1,width:e,classes:"architecture-service-label"},ge()),T.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","start").attr("text-anchor","start"),T.attr("transform","translate("+(v+c+4)+", "+(m+c+2)+")")}A.setElementForId(g.id,l)}}))},"drawGroups"),pr=L(async function(D,w,A,f){let o=ge();for(let a of A){let r=w.append("g"),n=D.getConfigField("iconSize");if(a.title){let t=r.append("g");await de(t,a.title,{useHtmlLabels:!1,width:n*1.5,classes:"architecture-service-label"},o),t.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),t.attr("transform","translate("+n/2+", "+n+")")}let c=r.append("g");if(a.icon)c.html(`<g>${await ue(a.icon,{height:n,width:n,fallbackPrefix:Kt.prefix})}</g>`);else if(a.iconText){c.html(`<g>${await ue("blank",{height:n,width:n,fallbackPrefix:Kt.prefix})}</g>`);let h=c.append("g").append("foreignObject").attr("width",n).attr("height",n).append("div").attr("class","node-icon-text").attr("style",`height: ${n}px;`).append("div").html(We(a.iconText,o)),u=parseInt(window.getComputedStyle(h.node(),null).getPropertyValue("font-size").replace(/\D/g,""))??16;h.attr("style",`-webkit-line-clamp: ${Math.floor((n-2)/u)};`)}else c.append("path").attr("class","node-bkg").attr("id",`${f}-node-${a.id}`).attr("d",`M0,${n} V5 Q0,0 5,0 H${n-5} Q${n},0 ${n},5 V${n} Z`);r.attr("id",`${f}-service-${a.id}`).attr("class","architecture-service");let{width:i,height:g}=r.node().getBBox();a.width=i,a.height=g,D.setElementForId(a.id,r)}return 0},"drawServices"),vr=L(function(D,w,A,f){A.forEach(o=>{let a=w.append("g"),r=D.getConfigField("iconSize");a.append("g").append("rect").attr("id",`${f}-node-${o.id}`).attr("fill-opacity","0").attr("width",r).attr("height",r),a.attr("class","architecture-junction");let{width:c,height:i}=a._groups[0][0].getBBox();a.width=c,a.height=i,D.setElementForId(o.id,a)})},"drawJunctions");ze([{name:Kt.prefix,icons:Kt}]);Le.use(mr.default);function wr(D,w,A){D.forEach(f=>{w.add({group:"nodes",data:{type:"service",id:f.id,icon:f.icon,label:f.title,parent:f.in,width:A.getConfigField("iconSize"),height:A.getConfigField("iconSize")},classes:"node-service"})})}L(wr,"addServices");function Mr(D,w,A){D.forEach(f=>{w.add({group:"nodes",data:{type:"junction",id:f.id,parent:f.in,width:A.getConfigField("iconSize"),height:A.getConfigField("iconSize")},classes:"node-junction"})})}L(Mr,"addJunctions");function Cr(D,w){w.nodes().map(A=>{let f=Jt(A);if(f.type==="group")return;f.x=A.position().x,f.y=A.position().y,D.getElementById(f.id).attr("transform","translate("+(f.x||0)+","+(f.y||0)+")")})}L(Cr,"positionNodes");function xr(D,w){D.forEach(A=>{w.add({group:"nodes",data:{type:"group",id:A.id,icon:A.icon,label:A.title,parent:A.in},classes:"node-group"})})}L(xr,"addGroups");function Or(D,w){D.forEach(A=>{let{lhsId:f,rhsId:o,lhsInto:a,lhsGroup:r,rhsInto:n,lhsDir:c,rhsDir:i,rhsGroup:g,title:t}=A,e=ae(A.lhsDir,A.rhsDir)?"segments":"straight",h={id:`${f}-${o}`,label:t,source:f,sourceDir:c,sourceArrow:a,sourceGroup:r,sourceEndpoint:c==="L"?"0 50%":c==="R"?"100% 50%":c==="T"?"50% 0":"50% 100%",target:o,targetDir:i,targetArrow:n,targetGroup:g,targetEndpoint:i==="L"?"0 50%":i==="R"?"100% 50%":i==="T"?"50% 0":"50% 100%"};w.add({group:"edges",data:h,classes:e})})}L(Or,"addEdges");function Ir(D,w,A,f=[]){let o=L((e,h)=>{let u=new Map;for(let[l,N]of e.entries()){let v=`${l}`,m=0,T=[...N.entries()];if(T.length===1){u.set(v,T[0][1]);continue}for(let S=0;S<T.length-1;S++)for(let M=S+1;M<T.length;M++){let[b,X]=T[S],[Y,Q]=T[M];if(A.get(pe(b,Y))===h)u.set(v,[...u.get(v)??[],...X,...Q]);else if(b==="default"||Y==="default")u.set(v,[...u.get(v)??[],...X,...Q]);else{let W=`${v}-${m++}`;u.set(W,X);let s=`${v}-${m++}`;u.set(s,Q)}}}return u},"flattenAlignments"),a=w.map(e=>{let h=new Map,u=new Map;return e.forEach(([l,N],v)=>{let m=D.getNode(v)?.in??"default",T=h.get(N)??new Map;h.has(N)||h.set(N,T);let S=u.get(l)??new Map;u.has(l)||u.set(l,S);for(let M of[T,S]){let b=M.get(m)??[];M.has(m)||M.set(m,b),b.push(v)}}),{horiz:[...o(h,"horizontal").values()].filter(l=>l.length>1),vert:[...o(u,"vertical").values()].filter(l=>l.length>1)}}),[r,n]=a.reduce(([e,h],{horiz:u,vert:l})=>[[...e,...u],[...h,...l]],[[],[]]),c=new Set;f.forEach(e=>e.members.forEach(h=>c.add(h)));let i=L(e=>e.filter(h=>!h.some(u=>c.has(u))),"dropOverlapping"),g=i(r),t=i(n);return f.forEach(e=>{e.members.length<2||(e.direction==="row"?g.push([...e.members]):t.push([...e.members]))}),{horizontal:g,vertical:t}}L(Ir,"getAlignments");function Sr(D,w,A=[]){let f=[],o=w.getConfigField("iconSize"),a=w.getConfigField("idealEdgeLengthMultiplier"),r=a*o,n=new Set;A.forEach(g=>{for(let t=0;t<g.members.length-1;t++){let e=g.members[t],h=g.members[t+1];n.add(`${e}|${h}`),n.add(`${h}|${e}`),g.direction==="row"?f.push({left:e,right:h,gap:r}):f.push({top:e,bottom:h,gap:r})}});let c=L(g=>`${g[0]},${g[1]}`,"posToStr"),i=L(g=>g.split(",").map(t=>parseInt(t)),"strToPos");return D.forEach(g=>{let t=new Map([...g.entries()].map(([l,N])=>[c(N),l])),e=[c([0,0])],h={},u={L:[-1,0],R:[1,0],T:[0,1],B:[0,-1]};for(;e.length>0;){let l=e.shift();if(l){h[l]=1;let N=t.get(l);if(N){let v=i(l);Object.entries(u).forEach(([m,T])=>{let S=c([v[0]+T[0],v[1]+T[1]]),M=t.get(S);if(M&&!h[S]){if(e.push(S),n.has(`${N}|${M}`))return;f.push({[De[m]]:M,[De[nr(m)]]:N,gap:a*o})}})}}}}),f}L(Sr,"getRelativeConstraints");function Rr(D,w,A,f,o,{spatialMaps:a,groupAlignments:r}){return new Promise(n=>{let c=je("body").append("div").attr("id","cy").attr("style","display:none"),i=Le({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"straight","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"edge[label]",style:{label:"data(label)"}},{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":`${o.getConfigField("fontSize")}px`}},{selector:".node-service",style:{label:"data(label)",width:"data(width)",height:"data(height)"}},{selector:".node-junction",style:{width:"data(width)",height:"data(height)"}},{selector:".node-group",style:{padding:`${o.getConfigField("padding")}px`}}],layout:{name:"grid",boundingBox:{x1:0,x2:100,y1:0,y2:100}}});c.remove(),xr(A,i),wr(D,i,o),Mr(w,i,o),Or(f,i);let g=o.getLayoutHints(),t=Ir(o,a,r,g),e=Sr(a,o,g),h=o.getConfigField("iconSize"),u=o.getConfigField("idealEdgeLengthMultiplier")*h,l=.5*h,N=o.getConfigField("edgeElasticity"),v=o.getConfigField("seed"),m=i.layout({name:"fcose",quality:"proof",randomize:o.getConfigField("randomize"),nodeSeparation:o.getConfigField("nodeSeparation"),numIter:o.getConfigField("numIter"),styleEnabled:!1,animate:!1,nodeDimensionsIncludeLabels:!1,idealEdgeLength(T){let[S,M]=T.connectedNodes(),{parent:b}=Jt(S),{parent:X}=Jt(M);return b===X?u:l},edgeElasticity(T){let[S,M]=T.connectedNodes(),{parent:b}=Jt(S),{parent:X}=Jt(M);return b===X?N:.001},alignmentConstraint:t,relativePlacementConstraint:e});m.one("layoutstop",()=>{function T(S,M,b,X){let Y,Q,{x:O,y:W}=S,{x:s,y}=M;Q=(X-W+(O-b)*(W-y)/(O-s))/Math.sqrt(1+Math.pow((W-y)/(O-s),2)),Y=Math.sqrt(Math.pow(X-W,2)+Math.pow(b-O,2)-Math.pow(Q,2));let p=Math.sqrt(Math.pow(s-O,2)+Math.pow(y-W,2));Y=Y/p;let E=(s-O)*(X-W)-(y-W)*(b-O);switch(!0){case E>=0:E=1;break;case E<0:E=-1;break}let d=(s-O)*(b-O)+(y-W)*(X-W);switch(!0){case d>=0:d=1;break;case d<0:d=-1;break}return Q=Math.abs(Q)*E,Y=Y*d,{distances:Q,weights:Y}}L(T,"getSegmentWeights"),i.startBatch();for(let S of Object.values(i.edges()))if(S.data?.()){let{x:M,y:b}=S.source().position(),{x:X,y:Y}=S.target().position();if(M!==X&&b!==Y){let Q=S.sourceEndpoint(),O=S.targetEndpoint(),{sourceDir:W}=ve(S),[s,y]=kt(W)?[Q.x,O.y]:[O.x,Q.y],{weights:p,distances:E}=T(Q,O,s,y);S.style("segment-distances",E),S.style("segment-weights",p)}}i.endBatch(),be(v,()=>m.run())});try{be(v,()=>m.run())}catch(T){throw T instanceof RangeError&&T.message.includes("Invalid array length")?new Error("Architecture layout failed: a declared `align row|column` directive likely contradicts the edge directions, or two declared alignments overlap on a shared node. Check that the order of members in each `align` chain is consistent with the edges between them, and that no node appears in two `align` directives along the same axis."):T}i.ready(T=>{fe.info("Ready",T),n(i)})})}L(Rr,"layoutArchitecture");var br=L(async(D,w,A,f)=>{let o=f.db;o.setDiagramId(w);let a=o.getServices(),r=o.getJunctions(),n=o.getGroups(),c=o.getEdges(),i=o.getDataStructures(),g=ir(w),t=g.append("g");t.attr("class","architecture-edges");let e=g.append("g");e.attr("class","architecture-services");let h=g.append("g");h.attr("class","architecture-groups"),await pr(o,e,a,w),vr(o,e,r,w);let u=await Rr(a,r,n,c,o,i);await gr(t,u,o,w),await dr(h,u,o,w),Cr(o,u),Be(void 0,g,o.getConfigField("padding"),o.getConfigField("useMaxWidth"))},"draw"),yr={draw:br};var Ii={parser:Ce,get db(){return new re},renderer:yr,styles:fr};export{Ii as diagram};