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