HomeDashboard/.venv/lib/python3.12/site-packages/nicegui/elements/mermaid/dist/architectureDiagram-4X3Z3J56-1nSUwmjO.js
2026-01-03 14:54:18 +01:00

3 lines
145 KiB
JavaScript

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