omni-context-cli 0.0.48 → 0.0.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +7 -7
- package/dist/clients/extension.vsix +0 -0
- package/dist/clients/web/assets/{_baseUniq-CWlTL7nF.js → _baseUniq-O6Fk0Wzr.js} +1 -1
- package/dist/clients/web/assets/{arc-CZjkqmF_.js → arc-n0x23Ctx.js} +1 -1
- package/dist/clients/web/assets/{architectureDiagram-VXUJARFQ-BOYa2bjw.js → architectureDiagram-VXUJARFQ-siUxtu84.js} +1 -1
- package/dist/clients/web/assets/{blockDiagram-VD42YOAC-DDOynruE.js → blockDiagram-VD42YOAC-DSqh9eGY.js} +1 -1
- package/dist/clients/web/assets/{c4Diagram-YG6GDRKO-C-97RpE_.js → c4Diagram-YG6GDRKO-wYR7H7xi.js} +1 -1
- package/dist/clients/web/assets/channel-NwuYDCTJ.js +1 -0
- package/dist/clients/web/assets/{chunk-4BX2VUAB-Cq-CVpiF.js → chunk-4BX2VUAB-Cay_iY5D.js} +1 -1
- package/dist/clients/web/assets/{chunk-55IACEB6-DgNYsQB7.js → chunk-55IACEB6-BeMIObm3.js} +1 -1
- package/dist/clients/web/assets/{chunk-B4BG7PRW-DlQsB2me.js → chunk-B4BG7PRW-B6cIgi7d.js} +1 -1
- package/dist/clients/web/assets/{chunk-DI55MBZ5-BHeF7oM6.js → chunk-DI55MBZ5-BXrfKlO3.js} +1 -1
- package/dist/clients/web/assets/{chunk-FMBD7UC4-D5QlY4R_.js → chunk-FMBD7UC4-67W1cNu_.js} +1 -1
- package/dist/clients/web/assets/{chunk-QN33PNHL-CHk3Nn1_.js → chunk-QN33PNHL-DuPwsSus.js} +1 -1
- package/dist/clients/web/assets/{chunk-QZHKN3VN-CAJ02eyq.js → chunk-QZHKN3VN-DWUuzBl_.js} +1 -1
- package/dist/clients/web/assets/{chunk-TZMSLE5B-fdEkh5Xq.js → chunk-TZMSLE5B-D3SRAd4i.js} +1 -1
- package/dist/clients/web/assets/classDiagram-2ON5EDUG-CA17y53i.js +1 -0
- package/dist/clients/web/assets/classDiagram-v2-WZHVMYZB-CA17y53i.js +1 -0
- package/dist/clients/web/assets/clone-Ccjp7w8U.js +1 -0
- package/dist/clients/web/assets/{cose-bilkent-S5V4N54A-C-KgfDpO.js → cose-bilkent-S5V4N54A-2yiAjDsY.js} +1 -1
- package/dist/clients/web/assets/{dagre-6UL2VRFP-XmHvxEnn.js → dagre-6UL2VRFP-DWtKyQlZ.js} +1 -1
- package/dist/clients/web/assets/{diagram-PSM6KHXK-piStbVS-.js → diagram-PSM6KHXK-BsH8ucOy.js} +1 -1
- package/dist/clients/web/assets/{diagram-QEK2KX5R-CclADJ9n.js → diagram-QEK2KX5R-CgAM_caT.js} +1 -1
- package/dist/clients/web/assets/{diagram-S2PKOQOG-yfPR_M0P.js → diagram-S2PKOQOG-5sXZE5fB.js} +1 -1
- package/dist/clients/web/assets/{erDiagram-Q2GNP2WA-C-QpleLm.js → erDiagram-Q2GNP2WA-SZjIGLfC.js} +1 -1
- package/dist/clients/web/assets/{flowDiagram-NV44I4VS-BXBJgvY4.js → flowDiagram-NV44I4VS-B13r1-Qr.js} +1 -1
- package/dist/clients/web/assets/{ganttDiagram-JELNMOA3-BId-yi2d.js → ganttDiagram-JELNMOA3-tnNnlmJ_.js} +1 -1
- package/dist/clients/web/assets/{gitGraphDiagram-NY62KEGX-C4GmkdUU.js → gitGraphDiagram-NY62KEGX-D3vXxiLR.js} +1 -1
- package/dist/clients/web/assets/{graph-lKpmm44U.js → graph-yEZO5As9.js} +1 -1
- package/dist/clients/web/assets/index-BvMYTiOr.js +27 -0
- package/dist/clients/web/assets/{index-QpapYAy5.css → index-bgcKJQwq.css} +1 -1
- package/dist/clients/web/assets/{infoDiagram-WHAUD3N6-DlTKBMRb.js → infoDiagram-WHAUD3N6-Diqs41Bs.js} +1 -1
- package/dist/clients/web/assets/{journeyDiagram-XKPGCS4Q-uR4zvhag.js → journeyDiagram-XKPGCS4Q-CsFCBnpU.js} +1 -1
- package/dist/clients/web/assets/{kanban-definition-3W4ZIXB7-BAth3XiM.js → kanban-definition-3W4ZIXB7-ToLQEJ6t.js} +1 -1
- package/dist/clients/web/assets/{layout-dqzmM9SC.js → layout-DAYHKwLI.js} +1 -1
- package/dist/clients/web/assets/{linear-BDsjBD51.js → linear-C6-59Tkb.js} +1 -1
- package/dist/clients/web/assets/{min-BpvcSMeI.js → min-CcGwUInn.js} +1 -1
- package/dist/clients/web/assets/{mindmap-definition-VGOIOE7T-YOfHJc2b.js → mindmap-definition-VGOIOE7T-DUxl95g0.js} +1 -1
- package/dist/clients/web/assets/{pieDiagram-ADFJNKIX-sxupIhex.js → pieDiagram-ADFJNKIX-B01HV9sF.js} +1 -1
- package/dist/clients/web/assets/{quadrantDiagram-AYHSOK5B-Clx0aaiI.js → quadrantDiagram-AYHSOK5B-CeqFw4rm.js} +1 -1
- package/dist/clients/web/assets/{requirementDiagram-UZGBJVZJ-Jff8r0V3.js → requirementDiagram-UZGBJVZJ-CFCoQIAQ.js} +1 -1
- package/dist/clients/web/assets/{sankeyDiagram-TZEHDZUN-tCX6Wk6i.js → sankeyDiagram-TZEHDZUN-C4bOlCv6.js} +1 -1
- package/dist/clients/web/assets/{sequenceDiagram-WL72ISMW-B66jOgtV.js → sequenceDiagram-WL72ISMW-CmcZq0aE.js} +1 -1
- package/dist/clients/web/assets/{stateDiagram-FKZM4ZOC-DFsarSTD.js → stateDiagram-FKZM4ZOC-BrC_Infp.js} +1 -1
- package/dist/clients/web/assets/stateDiagram-v2-4FDKWEC3-Bi_Pj5vD.js +1 -0
- package/dist/clients/web/assets/{timeline-definition-IT6M3QCI-B7iIhHj6.js → timeline-definition-IT6M3QCI-C25RxMkJ.js} +1 -1
- package/dist/clients/web/assets/{treemap-KMMF4GRG-bwvPNBHC.js → treemap-KMMF4GRG-CYbXQA3w.js} +1 -1
- package/dist/clients/web/assets/{xychartDiagram-PRI3JC2R-CstqFcD3.js → xychartDiagram-PRI3JC2R-DxEjdm1o.js} +1 -1
- package/dist/clients/web/index.html +2 -2
- package/package.json +1 -1
- package/dist/clients/web/assets/channel-CrQbNsBe.js +0 -1
- package/dist/clients/web/assets/classDiagram-2ON5EDUG-CoAFxeb1.js +0 -1
- package/dist/clients/web/assets/classDiagram-v2-WZHVMYZB-CoAFxeb1.js +0 -1
- package/dist/clients/web/assets/clone-V8tKmkAv.js +0 -1
- package/dist/clients/web/assets/index-5wVqr2Ny.js +0 -27
- package/dist/clients/web/assets/stateDiagram-v2-4FDKWEC3-DhAPZEUr.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
var t;import{aG as i,_ as n,H as r,V as s,l as e,b as o,a as h,p as a,q as f,g as u,s as c,y as l,D as v,E as d,F as y,c as p,ak as w,aH as g,i as m,d as b,x as M,aI as k,aJ as x}from"./index-5wVqr2Ny.js";import{p as S}from"./chunk-4BX2VUAB-Cq-CVpiF.js";import{p as $}from"./treemap-KMMF4GRG-bwvPNBHC.js";import{c as j}from"./cytoscape.esm-Cw0kmstm.js";import"./min-BpvcSMeI.js";import"./_baseUniq-CWlTL7nF.js";var O,A={exports:{}},T={exports:{}},I={exports:{}};function E(){return O?I.exports:(O=1,t=function(){return function(t){var i={};function n(r){if(i[r])return i[r].exports;var s=i[r]={i:r,l:!1,exports:{}};return t[r].call(s.exports,s,s.exports,n),s.l=!0,s.exports}return n.m=t,n.c=i,n.i=function(t){return t},n.d=function(t,i,r){n.o(t,i)||Object.defineProperty(t,i,{configurable:!1,enumerable:!0,get:r})},n.n=function(t){var i=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(i,"a",i),i},n.o=function(t,i){return Object.prototype.hasOwnProperty.call(t,i)},n.p="",n(n.s=28)}([function(t,i,n){function r(){}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,i,n){var r=n(2),s=n(8),e=n(9);function o(t,i,n){r.call(this,n),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=n,this.bendpoints=[],this.source=t,this.target=i}for(var h in o.prototype=Object.create(r.prototype),r)o[h]=r[h];o.prototype.getSource=function(){return this.source},o.prototype.getTarget=function(){return this.target},o.prototype.isInterGraph=function(){return this.isInterGraph},o.prototype.getLength=function(){return this.length},o.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},o.prototype.getBendpoints=function(){return this.bendpoints},o.prototype.getLca=function(){return this.lca},o.prototype.getSourceInLca=function(){return this.sourceInLca},o.prototype.getTargetInLca=function(){return this.targetInLca},o.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"},o.prototype.getOtherEndInGraph=function(t,i){for(var n=this.getOtherEnd(t),r=i.getGraphManager().getRoot();;){if(n.getOwner()==i)return n;if(n.getOwner()==r)break;n=n.getOwner().getParent()}return null},o.prototype.updateLength=function(){var t=new Array(4);this.isOverlapingSourceAndTarget=s.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=e.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=e.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},o.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=e.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=e.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},t.exports=o},function(t,i,n){t.exports=function(t){this.vGraphObject=t}},function(t,i,n){var r=n(2),s=n(10),e=n(13),o=n(0),h=n(16),a=n(5);function f(t,i,n,o){null==n&&null==o&&(o=i),r.call(this,o),null!=t.graphManager&&(t=t.graphManager),this.estimatedSize=s.MIN_VALUE,this.inclusionTreeDepth=s.MAX_VALUE,this.vGraphObject=o,this.edges=[],this.graphManager=t,this.rect=null!=n&&null!=i?new e(i.x,i.y,n.width,n.height):new e}for(var u in f.prototype=Object.create(r.prototype),r)f[u]=r[u];f.prototype.getEdges=function(){return this.edges},f.prototype.getChild=function(){return this.child},f.prototype.getOwner=function(){return this.owner},f.prototype.getWidth=function(){return this.rect.width},f.prototype.setWidth=function(t){this.rect.width=t},f.prototype.getHeight=function(){return this.rect.height},f.prototype.setHeight=function(t){this.rect.height=t},f.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},f.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},f.prototype.getCenter=function(){return new a(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},f.prototype.getLocation=function(){return new a(this.rect.x,this.rect.y)},f.prototype.getRect=function(){return this.rect},f.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},f.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},f.prototype.setRect=function(t,i){this.rect.x=t.x,this.rect.y=t.y,this.rect.width=i.width,this.rect.height=i.height},f.prototype.setCenter=function(t,i){this.rect.x=t-this.rect.width/2,this.rect.y=i-this.rect.height/2},f.prototype.setLocation=function(t,i){this.rect.x=t,this.rect.y=i},f.prototype.moveBy=function(t,i){this.rect.x+=t,this.rect.y+=i},f.prototype.getEdgeListToNode=function(t){var i=[],n=this;return n.edges.forEach(function(r){if(r.target==t){if(r.source!=n)throw"Incorrect edge source!";i.push(r)}}),i},f.prototype.getEdgesBetween=function(t){var i=[],n=this;return n.edges.forEach(function(r){if(r.source!=n&&r.target!=n)throw"Incorrect edge source and/or target";r.target!=t&&r.source!=t||i.push(r)}),i},f.prototype.getNeighborsList=function(){var t=new Set,i=this;return i.edges.forEach(function(n){if(n.source==i)t.add(n.target);else{if(n.target!=i)throw"Incorrect incidency!";t.add(n.source)}}),t},f.prototype.withChildren=function(){var t=new Set;if(t.add(this),null!=this.child)for(var i=this.child.getNodes(),n=0;n<i.length;n++)i[n].withChildren().forEach(function(i){t.add(i)});return t},f.prototype.getNoOfChildren=function(){var t=0;if(null==this.child)t=1;else for(var i=this.child.getNodes(),n=0;n<i.length;n++)t+=i[n].getNoOfChildren();return 0==t&&(t=1),t},f.prototype.getEstimatedSize=function(){if(this.estimatedSize==s.MIN_VALUE)throw"assert failed";return this.estimatedSize},f.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)},f.prototype.scatter=function(){var t,i,n=-o.INITIAL_WORLD_BOUNDARY,r=o.INITIAL_WORLD_BOUNDARY;t=o.WORLD_CENTER_X+h.nextDouble()*(r-n)+n;var s=-o.INITIAL_WORLD_BOUNDARY,e=o.INITIAL_WORLD_BOUNDARY;i=o.WORLD_CENTER_Y+h.nextDouble()*(e-s)+s,this.rect.x=t,this.rect.y=i},f.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()),o.NODE_DIMENSIONS_INCLUDE_LABELS){var i=t.getRight()-t.getLeft(),n=t.getBottom()-t.getTop();this.labelWidth&&("left"==this.labelPosHorizontal?(this.rect.x-=this.labelWidth,this.setWidth(i+this.labelWidth)):"center"==this.labelPosHorizontal&&this.labelWidth>i?(this.rect.x-=(this.labelWidth-i)/2,this.setWidth(this.labelWidth)):"right"==this.labelPosHorizontal&&this.setWidth(i+this.labelWidth)),this.labelHeight&&("top"==this.labelPosVertical?(this.rect.y-=this.labelHeight,this.setHeight(n+this.labelHeight)):"center"==this.labelPosVertical&&this.labelHeight>n?(this.rect.y-=(this.labelHeight-n)/2,this.setHeight(this.labelHeight)):"bottom"==this.labelPosVertical&&this.setHeight(n+this.labelHeight))}}},f.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==s.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},f.prototype.transform=function(t){var i=this.rect.x;i>o.WORLD_BOUNDARY?i=o.WORLD_BOUNDARY:i<-o.WORLD_BOUNDARY&&(i=-o.WORLD_BOUNDARY);var n=this.rect.y;n>o.WORLD_BOUNDARY?n=o.WORLD_BOUNDARY:n<-o.WORLD_BOUNDARY&&(n=-o.WORLD_BOUNDARY);var r=new a(i,n),s=t.inverseTransformPoint(r);this.setLocation(s.x,s.y)},f.prototype.getLeft=function(){return this.rect.x},f.prototype.getRight=function(){return this.rect.x+this.rect.width},f.prototype.getTop=function(){return this.rect.y},f.prototype.getBottom=function(){return this.rect.y+this.rect.height},f.prototype.getParent=function(){return null==this.owner?null:this.owner.getParent()},t.exports=f},function(t,i,n){var r=n(0);function s(){}for(var e in r)s[e]=r[e];s.MAX_ITERATIONS=2500,s.DEFAULT_EDGE_LENGTH=50,s.DEFAULT_SPRING_STRENGTH=.45,s.DEFAULT_REPULSION_STRENGTH=4500,s.DEFAULT_GRAVITY_STRENGTH=.4,s.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,s.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,s.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,s.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,s.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,s.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,s.COOLING_ADAPTATION_FACTOR=.33,s.ADAPTATION_LOWER_NODE_LIMIT=1e3,s.ADAPTATION_UPPER_NODE_LIMIT=5e3,s.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,s.MAX_NODE_DISPLACEMENT=3*s.MAX_NODE_DISPLACEMENT_INCREMENTAL,s.MIN_REPULSION_DIST=s.DEFAULT_EDGE_LENGTH/10,s.CONVERGENCE_CHECK_PERIOD=100,s.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,s.MIN_EDGE_LENGTH=1,s.GRID_CALCULATION_CHECK_PERIOD=10,t.exports=s},function(t,i,n){function r(t,i){null==t&&null==i?(this.x=0,this.y=0):(this.x=t,this.y=i)}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,i,n){var r=n(2),s=n(10),e=n(0),o=n(7),h=n(3),a=n(1),f=n(13),u=n(12),c=n(11);function l(t,i,n){r.call(this,n),this.estimatedSize=s.MIN_VALUE,this.margin=e.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=t,null!=i&&i instanceof o?this.graphManager=i:null!=i&&i instanceof Layout&&(this.graphManager=i.graphManager)}for(var v in l.prototype=Object.create(r.prototype),r)l[v]=r[v];l.prototype.getNodes=function(){return this.nodes},l.prototype.getEdges=function(){return this.edges},l.prototype.getGraphManager=function(){return this.graphManager},l.prototype.getParent=function(){return this.parent},l.prototype.getLeft=function(){return this.left},l.prototype.getRight=function(){return this.right},l.prototype.getTop=function(){return this.top},l.prototype.getBottom=function(){return this.bottom},l.prototype.isConnected=function(){return this.isConnected},l.prototype.add=function(t,i,n){if(null==i&&null==n){var r=t;if(null==this.graphManager)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(r)>-1)throw"Node already in graph!";return r.owner=this,this.getNodes().push(r),r}var s=t;if(!(this.getNodes().indexOf(i)>-1&&this.getNodes().indexOf(n)>-1))throw"Source or target not in graph!";if(i.owner!=n.owner||i.owner!=this)throw"Both owners must be this graph!";return i.owner!=n.owner?null:(s.source=i,s.target=n,s.isInterGraph=!1,this.getEdges().push(s),i.edges.push(s),n!=i&&n.edges.push(s),s)},l.prototype.remove=function(t){var i=t;if(t instanceof h){if(null==i)throw"Node is null!";if(null==i.owner||i.owner!=this)throw"Owner graph is invalid!";if(null==this.graphManager)throw"Owner graph manager is invalid!";for(var n=i.edges.slice(),r=n.length,s=0;s<r;s++)(e=n[s]).isInterGraph?this.graphManager.remove(e):e.source.owner.remove(e);if(-1==(o=this.nodes.indexOf(i)))throw"Node not in owner node list!";this.nodes.splice(o,1)}else if(t instanceof a){var e;if(null==(e=t))throw"Edge is null!";if(null==e.source||null==e.target)throw"Source and/or target is null!";if(null==e.source.owner||null==e.target.owner||e.source.owner!=this||e.target.owner!=this)throw"Source and/or target owner is invalid!";var o,f=e.source.edges.indexOf(e),u=e.target.edges.indexOf(e);if(!(f>-1&&u>-1))throw"Source and/or target doesn't know this edge!";if(e.source.edges.splice(f,1),e.target!=e.source&&e.target.edges.splice(u,1),-1==(o=e.source.owner.getEdges().indexOf(e)))throw"Not in owner's edge list!";e.source.owner.getEdges().splice(o,1)}},l.prototype.updateLeftTop=function(){for(var t,i,n,r=s.MAX_VALUE,e=s.MAX_VALUE,o=this.getNodes(),h=o.length,a=0;a<h;a++){var f=o[a];r>(t=f.getTop())&&(r=t),e>(i=f.getLeft())&&(e=i)}return r==s.MAX_VALUE?null:(n=null!=o[0].getParent().paddingLeft?o[0].getParent().paddingLeft:this.margin,this.left=e-n,this.top=r-n,new u(this.left,this.top))},l.prototype.updateBounds=function(t){for(var i,n,r,e,o,h=s.MAX_VALUE,a=-s.MAX_VALUE,u=s.MAX_VALUE,c=-s.MAX_VALUE,l=this.nodes,v=l.length,d=0;d<v;d++){var y=l[d];t&&null!=y.child&&y.updateBounds(),h>(i=y.getLeft())&&(h=i),a<(n=y.getRight())&&(a=n),u>(r=y.getTop())&&(u=r),c<(e=y.getBottom())&&(c=e)}var p=new f(h,u,a-h,c-u);h==s.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),o=null!=l[0].getParent().paddingLeft?l[0].getParent().paddingLeft:this.margin,this.left=p.x-o,this.right=p.x+p.width+o,this.top=p.y-o,this.bottom=p.y+p.height+o},l.calculateBounds=function(t){for(var i,n,r,e,o=s.MAX_VALUE,h=-s.MAX_VALUE,a=s.MAX_VALUE,u=-s.MAX_VALUE,c=t.length,l=0;l<c;l++){var v=t[l];o>(i=v.getLeft())&&(o=i),h<(n=v.getRight())&&(h=n),a>(r=v.getTop())&&(a=r),u<(e=v.getBottom())&&(u=e)}return new f(o,a,h-o,u-a)},l.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},l.prototype.getEstimatedSize=function(){if(this.estimatedSize==s.MIN_VALUE)throw"assert failed";return this.estimatedSize},l.prototype.calcEstimatedSize=function(){for(var t=0,i=this.nodes,n=i.length,r=0;r<n;r++)t+=i[r].calcEstimatedSize();return this.estimatedSize=0==t?e.EMPTY_COMPOUND_NODE_SIZE:t/Math.sqrt(this.nodes.length),this.estimatedSize},l.prototype.updateConnected=function(){var t=this;if(0!=this.nodes.length){var i,n,r=new c,s=new Set,e=this.nodes[0];for(e.withChildren().forEach(function(t){r.push(t),s.add(t)});0!==r.length;)for(var o=(i=(e=r.shift()).getEdges()).length,h=0;h<o;h++)null==(n=i[h].getOtherEndInGraph(e,this))||s.has(n)||n.withChildren().forEach(function(t){r.push(t),s.add(t)});if(this.isConnected=!1,s.size>=this.nodes.length){var a=0;s.forEach(function(i){i.owner==t&&a++}),a==this.nodes.length&&(this.isConnected=!0)}}else this.isConnected=!0},t.exports=l},function(t,i,n){var r,s=n(1);function e(t){r=n(6),this.layout=t,this.graphs=[],this.edges=[]}e.prototype.addRoot=function(){var t=this.layout.newGraph(),i=this.layout.newNode(null),n=this.add(t,i);return this.setRootGraph(n),this.rootGraph},e.prototype.add=function(t,i,n,r,s){if(null==n&&null==r&&null==s){if(null==t)throw"Graph is null!";if(null==i)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!=i.child)throw"Already has a child!";return t.parent=i,i.child=t,t}s=n,n=t;var e=(r=i).getOwner(),o=s.getOwner();if(null==e||e.getGraphManager()!=this)throw"Source not in this graph mgr!";if(null==o||o.getGraphManager()!=this)throw"Target not in this graph mgr!";if(e==o)return n.isInterGraph=!1,e.add(n,r,s);if(n.isInterGraph=!0,n.source=r,n.target=s,this.edges.indexOf(n)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(n),null==n.source||null==n.target)throw"Edge source and/or target is null!";if(-1!=n.source.edges.indexOf(n)||-1!=n.target.edges.indexOf(n))throw"Edge already in source and/or target incidency list!";return n.source.edges.push(n),n.target.edges.push(n),n},e.prototype.remove=function(t){if(t instanceof r){var i=t;if(i.getGraphManager()!=this)throw"Graph not in this graph mgr";if(i!=this.rootGraph&&(null==i.parent||i.parent.graphManager!=this))throw"Invalid parent node!";for(var n,e=[],o=(e=e.concat(i.getEdges())).length,h=0;h<o;h++)n=e[h],i.remove(n);var a,f=[];for(o=(f=f.concat(i.getNodes())).length,h=0;h<o;h++)a=f[h],i.remove(a);i==this.rootGraph&&this.setRootGraph(null);var u=this.graphs.indexOf(i);this.graphs.splice(u,1),i.parent=null}else if(t instanceof s){if(null==(n=t))throw"Edge is null!";if(!n.isInterGraph)throw"Not an inter-graph edge!";if(null==n.source||null==n.target)throw"Source and/or target is null!";if(-1==n.source.edges.indexOf(n)||-1==n.target.edges.indexOf(n))throw"Source and/or target doesn't know this edge!";if(u=n.source.edges.indexOf(n),n.source.edges.splice(u,1),u=n.target.edges.indexOf(n),n.target.edges.splice(u,1),null==n.source.owner||null==n.source.owner.getGraphManager())throw"Edge owner graph or owner graph manager is null!";if(-1==n.source.owner.getGraphManager().edges.indexOf(n))throw"Not in owner graph manager's edge list!";u=n.source.owner.getGraphManager().edges.indexOf(n),n.source.owner.getGraphManager().edges.splice(u,1)}},e.prototype.updateBounds=function(){this.rootGraph.updateBounds(!0)},e.prototype.getGraphs=function(){return this.graphs},e.prototype.getAllNodes=function(){if(null==this.allNodes){for(var t=[],i=this.getGraphs(),n=i.length,r=0;r<n;r++)t=t.concat(i[r].getNodes());this.allNodes=t}return this.allNodes},e.prototype.resetAllNodes=function(){this.allNodes=null},e.prototype.resetAllEdges=function(){this.allEdges=null},e.prototype.resetAllNodesToApplyGravitation=function(){this.allNodesToApplyGravitation=null},e.prototype.getAllEdges=function(){if(null==this.allEdges){var t=[],i=this.getGraphs();i.length;for(var n=0;n<i.length;n++)t=t.concat(i[n].getEdges());t=t.concat(this.edges),this.allEdges=t}return this.allEdges},e.prototype.getAllNodesToApplyGravitation=function(){return this.allNodesToApplyGravitation},e.prototype.setAllNodesToApplyGravitation=function(t){if(null!=this.allNodesToApplyGravitation)throw"assert failed";this.allNodesToApplyGravitation=t},e.prototype.getRoot=function(){return this.rootGraph},e.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"))},e.prototype.getLayout=function(){return this.layout},e.prototype.isOneAncestorOfOther=function(t,i){if(null==t||null==i)throw"assert failed";if(t==i)return!0;for(var n,r=t.getOwner();null!=(n=r.getParent());){if(n==i)return!0;if(null==(r=n.getOwner()))break}for(r=i.getOwner();null!=(n=r.getParent());){if(n==t)return!0;if(null==(r=n.getOwner()))break}return!1},e.prototype.calcLowestCommonAncestors=function(){for(var t,i,n,r,s,e=this.getAllEdges(),o=e.length,h=0;h<o;h++)if(i=(t=e[h]).source,n=t.target,t.lca=null,t.sourceInLca=i,t.targetInLca=n,i!=n){for(r=i.getOwner();null==t.lca;){for(t.targetInLca=n,s=n.getOwner();null==t.lca;){if(s==r){t.lca=s;break}if(s==this.rootGraph)break;if(null!=t.lca)throw"assert failed";t.targetInLca=s.getParent(),s=t.targetInLca.getOwner()}if(r==this.rootGraph)break;null==t.lca&&(t.sourceInLca=r.getParent(),r=t.sourceInLca.getOwner())}if(null==t.lca)throw"assert failed"}else t.lca=i.getOwner()},e.prototype.calcLowestCommonAncestor=function(t,i){if(t==i)return t.getOwner();for(var n=t.getOwner();null!=n;){for(var r=i.getOwner();null!=r;){if(r==n)return r;r=r.getParent().getOwner()}n=n.getParent().getOwner()}return n},e.prototype.calcInclusionTreeDepths=function(t,i){var n;null==t&&null==i&&(t=this.rootGraph,i=1);for(var r=t.getNodes(),s=r.length,e=0;e<s;e++)(n=r[e]).inclusionTreeDepth=i,null!=n.child&&this.calcInclusionTreeDepths(n.child,i+1)},e.prototype.includesInvalidEdge=function(){for(var t,i=[],n=this.edges.length,r=0;r<n;r++)t=this.edges[r],this.isOneAncestorOfOther(t.source,t.target)&&i.push(t);for(r=0;r<i.length;r++)this.remove(i[r]);return!1},t.exports=e},function(t,i,n){var r=n(12);function s(){}s.calcSeparationAmount=function(t,i,n,r){if(!t.intersects(i))throw"assert failed";var s=new Array(2);this.decideDirectionsForOverlappingNodes(t,i,s),n[0]=Math.min(t.getRight(),i.getRight())-Math.max(t.x,i.x),n[1]=Math.min(t.getBottom(),i.getBottom())-Math.max(t.y,i.y),t.getX()<=i.getX()&&t.getRight()>=i.getRight()?n[0]+=Math.min(i.getX()-t.getX(),t.getRight()-i.getRight()):i.getX()<=t.getX()&&i.getRight()>=t.getRight()&&(n[0]+=Math.min(t.getX()-i.getX(),i.getRight()-t.getRight())),t.getY()<=i.getY()&&t.getBottom()>=i.getBottom()?n[1]+=Math.min(i.getY()-t.getY(),t.getBottom()-i.getBottom()):i.getY()<=t.getY()&&i.getBottom()>=t.getBottom()&&(n[1]+=Math.min(t.getY()-i.getY(),i.getBottom()-t.getBottom()));var e=Math.abs((i.getCenterY()-t.getCenterY())/(i.getCenterX()-t.getCenterX()));i.getCenterY()===t.getCenterY()&&i.getCenterX()===t.getCenterX()&&(e=1);var o=e*n[0],h=n[1]/e;n[0]<h?h=n[0]:o=n[1],n[0]=-1*s[0]*(h/2+r),n[1]=-1*s[1]*(o/2+r)},s.decideDirectionsForOverlappingNodes=function(t,i,n){t.getCenterX()<i.getCenterX()?n[0]=-1:n[0]=1,t.getCenterY()<i.getCenterY()?n[1]=-1:n[1]=1},s.getIntersection2=function(t,i,n){var r=t.getCenterX(),s=t.getCenterY(),e=i.getCenterX(),o=i.getCenterY();if(t.intersects(i))return n[0]=r,n[1]=s,n[2]=e,n[3]=o,!0;var h=t.getX(),a=t.getY(),f=t.getRight(),u=t.getX(),c=t.getBottom(),l=t.getRight(),v=t.getWidthHalf(),d=t.getHeightHalf(),y=i.getX(),p=i.getY(),w=i.getRight(),g=i.getX(),m=i.getBottom(),b=i.getRight(),M=i.getWidthHalf(),k=i.getHeightHalf(),x=!1,S=!1;if(r===e){if(s>o)return n[0]=r,n[1]=a,n[2]=e,n[3]=m,!1;if(s<o)return n[0]=r,n[1]=c,n[2]=e,n[3]=p,!1}else if(s===o){if(r>e)return n[0]=h,n[1]=s,n[2]=w,n[3]=o,!1;if(r<e)return n[0]=f,n[1]=s,n[2]=y,n[3]=o,!1}else{var $=t.height/t.width,j=i.height/i.width,O=(o-s)/(e-r),A=void 0,T=void 0,I=void 0,E=void 0,L=void 0,D=void 0;if(-$===O?r>e?(n[0]=u,n[1]=c,x=!0):(n[0]=f,n[1]=a,x=!0):$===O&&(r>e?(n[0]=h,n[1]=a,x=!0):(n[0]=l,n[1]=c,x=!0)),-j===O?e>r?(n[2]=g,n[3]=m,S=!0):(n[2]=w,n[3]=p,S=!0):j===O&&(e>r?(n[2]=y,n[3]=p,S=!0):(n[2]=b,n[3]=m,S=!0)),x&&S)return!1;if(r>e?s>o?(A=this.getCardinalDirection($,O,4),T=this.getCardinalDirection(j,O,2)):(A=this.getCardinalDirection(-$,O,3),T=this.getCardinalDirection(-j,O,1)):s>o?(A=this.getCardinalDirection(-$,O,1),T=this.getCardinalDirection(-j,O,3)):(A=this.getCardinalDirection($,O,2),T=this.getCardinalDirection(j,O,4)),!x)switch(A){case 1:E=a,I=r+-d/O,n[0]=I,n[1]=E;break;case 2:I=l,E=s+v*O,n[0]=I,n[1]=E;break;case 3:E=c,I=r+d/O,n[0]=I,n[1]=E;break;case 4:I=u,E=s+-v*O,n[0]=I,n[1]=E}if(!S)switch(T){case 1:D=p,L=e+-k/O,n[2]=L,n[3]=D;break;case 2:L=b,D=o+M*O,n[2]=L,n[3]=D;break;case 3:D=m,L=e+k/O,n[2]=L,n[3]=D;break;case 4:L=g,D=o+-M*O,n[2]=L,n[3]=D}}return!1},s.getCardinalDirection=function(t,i,n){return t>i?n:1+n%4},s.getIntersection=function(t,i,n,s){if(null==s)return this.getIntersection2(t,i,n);var e,o,h,a,f,u,c,l=t.x,v=t.y,d=i.x,y=i.y,p=n.x,w=n.y,g=s.x,m=s.y;return 0===(c=(e=y-v)*(a=p-g)-(o=m-w)*(h=l-d))?null:new r((h*(u=g*w-p*m)-a*(f=d*v-l*y))/c,(o*f-e*u)/c)},s.angleOfVector=function(t,i,n,r){var s=void 0;return t!==n?(s=Math.atan((r-i)/(n-t)),n<t?s+=Math.PI:r<i&&(s+=this.TWO_PI)):s=r<i?this.ONE_AND_HALF_PI:this.HALF_PI,s},s.doIntersect=function(t,i,n,r){var s=t.x,e=t.y,o=i.x,h=i.y,a=n.x,f=n.y,u=r.x,c=r.y,l=(o-s)*(c-f)-(u-a)*(h-e);if(0===l)return!1;var v=((c-f)*(u-s)+(a-u)*(c-e))/l,d=((e-h)*(u-s)+(o-s)*(c-e))/l;return 0<v&&v<1&&0<d&&d<1},s.findCircleLineIntersections=function(t,i,n,r,s,e,o){var h=(n-t)*(n-t)+(r-i)*(r-i),a=2*((t-s)*(n-t)+(i-e)*(r-i)),f=(t-s)*(t-s)+(i-e)*(i-e)-o*o;if(a*a-4*h*f>=0){var u=(-a+Math.sqrt(a*a-4*h*f))/(2*h),c=(-a-Math.sqrt(a*a-4*h*f))/(2*h);return u>=0&&u<=1?[u]:c>=0&&c<=1?[c]:null}return null},s.HALF_PI=.5*Math.PI,s.ONE_AND_HALF_PI=1.5*Math.PI,s.TWO_PI=2*Math.PI,s.THREE_PI=3*Math.PI,t.exports=s},function(t,i,n){function r(){}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,i,n){function r(){}r.MAX_VALUE=2147483647,r.MIN_VALUE=-2147483648,t.exports=r},function(t,i,n){var r=function(){function t(t,i){for(var n=0;n<i.length;n++){var r=i[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(i,n,r){return n&&t(i.prototype,n),r&&t(i,r),i}}(),s=function(t){return{value:t,next:null,prev:null}},e=function(t,i,n,r){return null!==t?t.next=i:r.head=i,null!==n?n.prev=i:r.tail=i,i.prev=t,i.next=n,r.length++,i},o=function(t,i){var n=t.prev,r=t.next;return null!==n?n.next=r:i.head=r,null!==r?r.prev=n:i.tail=n,t.prev=t.next=null,i.length--,t},h=function(){function t(i){var n=this;!function(t,i){if(!(t instanceof i))throw new TypeError("Cannot call a class as a function")}(this,t),this.length=0,this.head=null,this.tail=null,null!=i&&i.forEach(function(t){return n.push(t)})}return r(t,[{key:"size",value:function(){return this.length}},{key:"insertBefore",value:function(t,i){return e(i.prev,s(t),i,this)}},{key:"insertAfter",value:function(t,i){return e(i,s(t),i.next,this)}},{key:"insertNodeBefore",value:function(t,i){return e(i.prev,t,i,this)}},{key:"insertNodeAfter",value:function(t,i){return e(i,t,i.next,this)}},{key:"push",value:function(t){return e(this.tail,s(t),null,this)}},{key:"unshift",value:function(t){return e(null,s(t),this.head,this)}},{key:"remove",value:function(t){return o(t,this)}},{key:"pop",value:function(){return o(this.tail,this).value}},{key:"popNode",value:function(){return o(this.tail,this)}},{key:"shift",value:function(){return o(this.head,this).value}},{key:"shiftNode",value:function(){return o(this.head,this)}},{key:"get_object_at",value:function(t){if(t<=this.length()){for(var i=1,n=this.head;i<t;)n=n.next,i++;return n.value}}},{key:"set_object_at",value:function(t,i){if(t<=this.length()){for(var n=1,r=this.head;n<t;)r=r.next,n++;r.value=i}}}]),t}();t.exports=h},function(t,i,n){function r(t,i,n){this.x=null,this.y=null,null==t&&null==i&&null==n?(this.x=0,this.y=0):"number"==typeof t&&"number"==typeof i&&null==n?(this.x=t,this.y=i):"Point"==t.constructor.name&&null==i&&null==n&&(n=t,this.x=n.x,this.y=n.y)}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,i,n){"Point"==t.constructor.name&&null==i&&null==n?(n=t,this.setLocation(n.x,n.y)):"number"==typeof t&&"number"==typeof i&&null==n&&(parseInt(t)==t&&parseInt(i)==i?this.move(t,i):(this.x=Math.floor(t+.5),this.y=Math.floor(i+.5)))},r.prototype.move=function(t,i){this.x=t,this.y=i},r.prototype.translate=function(t,i){this.x+=t,this.y+=i},r.prototype.equals=function(t){if("Point"==t.constructor.name){var i=t;return this.x==i.x&&this.y==i.y}return this==t},r.prototype.toString=function(){return(new r).constructor.name+"[x="+this.x+",y="+this.y+"]"},t.exports=r},function(t,i,n){function r(t,i,n,r){this.x=0,this.y=0,this.width=0,this.height=0,null!=t&&null!=i&&null!=n&&null!=r&&(this.x=t,this.y=i,this.width=n,this.height=r)}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,i,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 s(){}s.lastID=0,s.createID=function(t){return s.isPrimitive(t)?t:(null!=t.uniqueID||(t.uniqueID=s.getString(),s.lastID++),t.uniqueID)},s.getString=function(t){return null==t&&(t=s.lastID),"Object#"+t},s.isPrimitive=function(t){var i=void 0===t?"undefined":r(t);return null==t||"object"!=i&&"function"!=i},t.exports=s},function(t,i,n){function r(t){if(Array.isArray(t)){for(var i=0,n=Array(t.length);i<t.length;i++)n[i]=t[i];return n}return Array.from(t)}var s=n(0),e=n(7),o=n(3),h=n(1),a=n(6),f=n(5),u=n(17),c=n(29);function l(t){c.call(this),this.layoutQuality=s.QUALITY,this.createBendsAsNeeded=s.DEFAULT_CREATE_BENDS_AS_NEEDED,this.incremental=s.DEFAULT_INCREMENTAL,this.animationOnLayout=s.DEFAULT_ANIMATION_ON_LAYOUT,this.animationDuringLayout=s.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=s.DEFAULT_ANIMATION_PERIOD,this.uniformLeafNodeSizes=s.DEFAULT_UNIFORM_LEAF_NODE_SIZES,this.edgeToDummyNodes=new Map,this.graphManager=new e(this),this.isLayoutFinished=!1,this.isSubLayout=!1,this.isRemoteUse=!1,null!=t&&(this.isRemoteUse=t)}l.RANDOM_SEED=1,l.prototype=Object.create(c.prototype),l.prototype.getGraphManager=function(){return this.graphManager},l.prototype.getAllNodes=function(){return this.graphManager.getAllNodes()},l.prototype.getAllEdges=function(){return this.graphManager.getAllEdges()},l.prototype.getAllNodesToApplyGravitation=function(){return this.graphManager.getAllNodesToApplyGravitation()},l.prototype.newGraphManager=function(){var t=new e(this);return this.graphManager=t,t},l.prototype.newGraph=function(t){return new a(null,this.graphManager,t)},l.prototype.newNode=function(t){return new o(this.graphManager,t)},l.prototype.newEdge=function(t){return new h(null,null,t)},l.prototype.checkLayoutSuccess=function(){return null==this.graphManager.getRoot()||0==this.graphManager.getRoot().getNodes().length||this.graphManager.includesInvalidEdge()},l.prototype.runLayout=function(){var t;return this.isLayoutFinished=!1,this.tilingPreLayout&&this.tilingPreLayout(),this.initParameters(),t=!this.checkLayoutSuccess()&&this.layout(),"during"!==s.ANIMATE&&(t&&(this.isSubLayout||this.doPostLayout()),this.tilingPostLayout&&this.tilingPostLayout(),this.isLayoutFinished=!0,t)},l.prototype.doPostLayout=function(){this.incremental||this.transform(),this.update()},l.prototype.update2=function(){if(this.createBendsAsNeeded&&(this.createBendpointsFromDummyNodes(),this.graphManager.resetAllEdges()),!this.isRemoteUse){for(var t=this.graphManager.getAllEdges(),i=0;i<t.length;i++)t[i];var n=this.graphManager.getRoot().getNodes();for(i=0;i<n.length;i++)n[i];this.update(this.graphManager.getRoot())}},l.prototype.update=function(t){if(null==t)this.update2();else if(t instanceof o){var i=t;if(null!=i.getChild())for(var n=i.getChild().getNodes(),r=0;r<n.length;r++)update(n[r]);null!=i.vGraphObject&&i.vGraphObject.update(i)}else if(t instanceof h){var s=t;null!=s.vGraphObject&&s.vGraphObject.update(s)}else if(t instanceof a){var e=t;null!=e.vGraphObject&&e.vGraphObject.update(e)}},l.prototype.initParameters=function(){this.isSubLayout||(this.layoutQuality=s.QUALITY,this.animationDuringLayout=s.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=s.DEFAULT_ANIMATION_PERIOD,this.animationOnLayout=s.DEFAULT_ANIMATION_ON_LAYOUT,this.incremental=s.DEFAULT_INCREMENTAL,this.createBendsAsNeeded=s.DEFAULT_CREATE_BENDS_AS_NEEDED,this.uniformLeafNodeSizes=s.DEFAULT_UNIFORM_LEAF_NODE_SIZES),this.animationDuringLayout&&(this.animationOnLayout=!1)},l.prototype.transform=function(t){if(null==t)this.transform(new f(0,0));else{var i=new u,n=this.graphManager.getRoot().updateLeftTop();if(null!=n){i.setWorldOrgX(t.x),i.setWorldOrgY(t.y),i.setDeviceOrgX(n.x),i.setDeviceOrgY(n.y);for(var r=this.getAllNodes(),s=0;s<r.length;s++)r[s].transform(i)}}},l.prototype.positionNodesRandomly=function(t){if(null==t)this.positionNodesRandomly(this.getGraphManager().getRoot()),this.getGraphManager().getRoot().updateBounds(!0);else for(var i,n,r=t.getNodes(),s=0;s<r.length;s++)null==(n=(i=r[s]).getChild())||0==n.getNodes().length?i.scatter():(this.positionNodesRandomly(n),i.updateBounds())},l.prototype.getFlatForest=function(){for(var t=[],i=!0,n=this.graphManager.getRoot().getNodes(),s=!0,e=0;e<n.length;e++)null!=n[e].getChild()&&(s=!1);if(!s)return t;var o=new Set,h=[],a=new Map,f=[];for(f=f.concat(n);f.length>0&&i;){for(h.push(f[0]);h.length>0&&i;){var u=h[0];h.splice(0,1),o.add(u);var c=u.getEdges();for(e=0;e<c.length;e++){var l=c[e].getOtherEnd(u);if(a.get(u)!=l){if(o.has(l)){i=!1;break}h.push(l),a.set(l,u)}}}if(i){var v=[].concat(r(o));for(t.push(v),e=0;e<v.length;e++){var d=v[e],y=f.indexOf(d);y>-1&&f.splice(y,1)}o=new Set,a=new Map}else t=[]}return t},l.prototype.createDummyNodesForBendpoints=function(t){for(var i=[],n=t.source,r=this.graphManager.calcLowestCommonAncestor(t.source,t.target),s=0;s<t.bendpoints.length;s++){var e=this.newNode(null);e.setRect(new Point(0,0),new Dimension(1,1)),r.add(e);var o=this.newEdge(null);this.graphManager.add(o,n,e),i.add(e),n=e}return o=this.newEdge(null),this.graphManager.add(o,n,t.target),this.edgeToDummyNodes.set(t,i),t.isInterGraph()?this.graphManager.remove(t):r.remove(t),i},l.prototype.createBendpointsFromDummyNodes=function(){var t=[];t=t.concat(this.graphManager.getAllEdges()),t=[].concat(r(this.edgeToDummyNodes.keys())).concat(t);for(var i=0;i<t.length;i++){var n=t[i];if(n.bendpoints.length>0){for(var s=this.edgeToDummyNodes.get(n),e=0;e<s.length;e++){var o=s[e],h=new f(o.getCenterX(),o.getCenterY()),a=n.bendpoints.get(e);a.x=h.x,a.y=h.y,o.getOwner().remove(o)}this.graphManager.add(n,n.source,n.target)}}},l.transform=function(t,i,n,r){if(null!=n&&null!=r){var s=i;return t<=50?s-=(i-i/n)/50*(50-t):s+=(i*r-i)/50*(t-50),s}var e,o;return t<=50?(e=9*i/500,o=i/10):(e=9*i/50,o=-8*i),e*t+o},l.findCenterOfTree=function(t){var i=[];i=i.concat(t);var n=[],r=new Map,s=!1,e=null;1!=i.length&&2!=i.length||(s=!0,e=i[0]);for(var o=0;o<i.length;o++){var h=(u=i[o]).getNeighborsList().size;r.set(u,u.getNeighborsList().size),1==h&&n.push(u)}var a=[];for(a=a.concat(n);!s;){var f=[];for(f=f.concat(a),a=[],o=0;o<i.length;o++){var u=i[o],c=i.indexOf(u);c>=0&&i.splice(c,1),u.getNeighborsList().forEach(function(t){if(n.indexOf(t)<0){var i=r.get(t)-1;1==i&&a.push(t),r.set(t,i)}})}n=n.concat(a),1!=i.length&&2!=i.length||(s=!0,e=i[0])}return e},l.prototype.setGraphManager=function(t){this.graphManager=t},t.exports=l},function(t,i,n){function r(){}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,i,n){var r=n(5);function s(t,i){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}s.prototype.getWorldOrgX=function(){return this.lworldOrgX},s.prototype.setWorldOrgX=function(t){this.lworldOrgX=t},s.prototype.getWorldOrgY=function(){return this.lworldOrgY},s.prototype.setWorldOrgY=function(t){this.lworldOrgY=t},s.prototype.getWorldExtX=function(){return this.lworldExtX},s.prototype.setWorldExtX=function(t){this.lworldExtX=t},s.prototype.getWorldExtY=function(){return this.lworldExtY},s.prototype.setWorldExtY=function(t){this.lworldExtY=t},s.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},s.prototype.setDeviceOrgX=function(t){this.ldeviceOrgX=t},s.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},s.prototype.setDeviceOrgY=function(t){this.ldeviceOrgY=t},s.prototype.getDeviceExtX=function(){return this.ldeviceExtX},s.prototype.setDeviceExtX=function(t){this.ldeviceExtX=t},s.prototype.getDeviceExtY=function(){return this.ldeviceExtY},s.prototype.setDeviceExtY=function(t){this.ldeviceExtY=t},s.prototype.transformX=function(t){var i=0,n=this.lworldExtX;return 0!=n&&(i=this.ldeviceOrgX+(t-this.lworldOrgX)*this.ldeviceExtX/n),i},s.prototype.transformY=function(t){var i=0,n=this.lworldExtY;return 0!=n&&(i=this.ldeviceOrgY+(t-this.lworldOrgY)*this.ldeviceExtY/n),i},s.prototype.inverseTransformX=function(t){var i=0,n=this.ldeviceExtX;return 0!=n&&(i=this.lworldOrgX+(t-this.ldeviceOrgX)*this.lworldExtX/n),i},s.prototype.inverseTransformY=function(t){var i=0,n=this.ldeviceExtY;return 0!=n&&(i=this.lworldOrgY+(t-this.ldeviceOrgY)*this.lworldExtY/n),i},s.prototype.inverseTransformPoint=function(t){return new r(this.inverseTransformX(t.x),this.inverseTransformY(t.y))},t.exports=s},function(t,i,n){var r=n(15),s=n(4),e=n(0),o=n(8),h=n(9);function a(){r.call(this),this.useSmartIdealEdgeLengthCalculation=s.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=s.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=s.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=s.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=s.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*s.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=s.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=s.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=s.MAX_ITERATIONS}for(var f in a.prototype=Object.create(r.prototype),r)a[f]=r[f];a.prototype.initParameters=function(){r.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=s.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},a.prototype.calcIdealEdgeLengths=function(){for(var t,i,n,r,o,h,a,f=this.getGraphManager().getAllEdges(),u=0;u<f.length;u++)i=(t=f[u]).idealLength,t.isInterGraph&&(r=t.getSource(),o=t.getTarget(),h=t.getSourceInLca().getEstimatedSize(),a=t.getTargetInLca().getEstimatedSize(),this.useSmartIdealEdgeLengthCalculation&&(t.idealLength+=h+a-2*e.SIMPLE_NODE_SIZE),n=t.getLca().getInclusionTreeDepth(),t.idealLength+=i*s.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR*(r.getInclusionTreeDepth()+o.getInclusionTreeDepth()-2*n))},a.prototype.initSpringEmbedder=function(){var t=this.getAllNodes().length;this.incremental?(t>s.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*s.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(t-s.ADAPTATION_LOWER_NODE_LIMIT)/(s.ADAPTATION_UPPER_NODE_LIMIT-s.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-s.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=s.MAX_NODE_DISPLACEMENT_INCREMENTAL):(t>s.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(s.COOLING_ADAPTATION_FACTOR,1-(t-s.ADAPTATION_LOWER_NODE_LIMIT)/(s.ADAPTATION_UPPER_NODE_LIMIT-s.ADAPTATION_LOWER_NODE_LIMIT)*(1-s.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=s.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(5*this.getAllNodes().length,this.maxIterations),this.displacementThresholdPerNode=3*s.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},a.prototype.calcSpringForces=function(){for(var t,i=this.getAllEdges(),n=0;n<i.length;n++)t=i[n],this.calcSpringForce(t,t.idealLength)},a.prototype.calcRepulsionForces=function(){var t,i,n,r,e,o=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],h=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a=this.getAllNodes();if(this.useFRGridVariant)for(this.totalIterations%s.GRID_CALCULATION_CHECK_PERIOD==1&&o&&this.updateGrid(),e=new Set,t=0;t<a.length;t++)n=a[t],this.calculateRepulsionForceOfANode(n,e,o,h),e.add(n);else for(t=0;t<a.length;t++)for(n=a[t],i=t+1;i<a.length;i++)r=a[i],n.getOwner()==r.getOwner()&&this.calcRepulsionForce(n,r)},a.prototype.calcGravitationalForces=function(){for(var t,i=this.getAllNodesToApplyGravitation(),n=0;n<i.length;n++)t=i[n],this.calcGravitationalForce(t)},a.prototype.moveNodes=function(){for(var t=this.getAllNodes(),i=0;i<t.length;i++)t[i].move()},a.prototype.calcSpringForce=function(t,i){var n,r,s,e,o=t.getSource(),h=t.getTarget();if(this.uniformLeafNodeSizes&&null==o.getChild()&&null==h.getChild())t.updateLengthSimple();else if(t.updateLength(),t.isOverlapingSourceAndTarget)return;0!=(n=t.getLength())&&(s=(r=t.edgeElasticity*(n-i))*(t.lengthX/n),e=r*(t.lengthY/n),o.springForceX+=s,o.springForceY+=e,h.springForceX-=s,h.springForceY-=e)},a.prototype.calcRepulsionForce=function(t,i){var n,r,e,a,f,u,c,l=t.getRect(),v=i.getRect(),d=new Array(2),y=new Array(4);if(l.intersects(v)){o.calcSeparationAmount(l,v,d,s.DEFAULT_EDGE_LENGTH/2),u=2*d[0],c=2*d[1];var p=t.noOfChildren*i.noOfChildren/(t.noOfChildren+i.noOfChildren);t.repulsionForceX-=p*u,t.repulsionForceY-=p*c,i.repulsionForceX+=p*u,i.repulsionForceY+=p*c}else this.uniformLeafNodeSizes&&null==t.getChild()&&null==i.getChild()?(n=v.getCenterX()-l.getCenterX(),r=v.getCenterY()-l.getCenterY()):(o.getIntersection(l,v,y),n=y[2]-y[0],r=y[3]-y[1]),Math.abs(n)<s.MIN_REPULSION_DIST&&(n=h.sign(n)*s.MIN_REPULSION_DIST),Math.abs(r)<s.MIN_REPULSION_DIST&&(r=h.sign(r)*s.MIN_REPULSION_DIST),e=n*n+r*r,a=Math.sqrt(e),u=(f=(t.nodeRepulsion/2+i.nodeRepulsion/2)*t.noOfChildren*i.noOfChildren/e)*n/a,c=f*r/a,t.repulsionForceX-=u,t.repulsionForceY-=c,i.repulsionForceX+=u,i.repulsionForceY+=c},a.prototype.calcGravitationalForce=function(t){var i,n,r,s,e,o,h,a;n=((i=t.getOwner()).getRight()+i.getLeft())/2,r=(i.getTop()+i.getBottom())/2,s=t.getCenterX()-n,e=t.getCenterY()-r,o=Math.abs(s)+t.getWidth()/2,h=Math.abs(e)+t.getHeight()/2,t.getOwner()==this.graphManager.getRoot()?(o>(a=i.getEstimatedSize()*this.gravityRangeFactor)||h>a)&&(t.gravitationForceX=-this.gravityConstant*s,t.gravitationForceY=-this.gravityConstant*e):(o>(a=i.getEstimatedSize()*this.compoundGravityRangeFactor)||h>a)&&(t.gravitationForceX=-this.gravityConstant*s*this.compoundGravityConstant,t.gravitationForceY=-this.gravityConstant*e*this.compoundGravityConstant)},a.prototype.isConverged=function(){var t,i=!1;return this.totalIterations>this.maxIterations/3&&(i=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),t=this.totalDisplacement<this.totalDisplacementThreshold,this.oldTotalDisplacement=this.totalDisplacement,t||i},a.prototype.animate=function(){this.animationDuringLayout&&!this.isSubLayout&&(this.notAnimatedIterations==this.animationPeriod?(this.update(),this.notAnimatedIterations=0):this.notAnimatedIterations++)},a.prototype.calcNoOfChildrenForAllNodes=function(){for(var t,i=this.graphManager.getAllNodes(),n=0;n<i.length;n++)(t=i[n]).noOfChildren=t.getNoOfChildren()},a.prototype.calcGrid=function(t){var i,n;i=parseInt(Math.ceil((t.getRight()-t.getLeft())/this.repulsionRange)),n=parseInt(Math.ceil((t.getBottom()-t.getTop())/this.repulsionRange));for(var r=new Array(i),s=0;s<i;s++)r[s]=new Array(n);for(s=0;s<i;s++)for(var e=0;e<n;e++)r[s][e]=new Array;return r},a.prototype.addNodeToGrid=function(t,i,n){var r,s,e,o;r=parseInt(Math.floor((t.getRect().x-i)/this.repulsionRange)),s=parseInt(Math.floor((t.getRect().width+t.getRect().x-i)/this.repulsionRange)),e=parseInt(Math.floor((t.getRect().y-n)/this.repulsionRange)),o=parseInt(Math.floor((t.getRect().height+t.getRect().y-n)/this.repulsionRange));for(var h=r;h<=s;h++)for(var a=e;a<=o;a++)this.grid[h][a].push(t),t.setGridCoordinates(r,s,e,o)},a.prototype.updateGrid=function(){var t,i,n=this.getAllNodes();for(this.grid=this.calcGrid(this.graphManager.getRoot()),t=0;t<n.length;t++)i=n[t],this.addNodeToGrid(i,this.graphManager.getRoot().getLeft(),this.graphManager.getRoot().getTop())},a.prototype.calculateRepulsionForceOfANode=function(t,i,n,r){if(this.totalIterations%s.GRID_CALCULATION_CHECK_PERIOD==1&&n||r){var e,o=new Set;t.surrounding=new Array;for(var h=this.grid,a=t.startX-1;a<t.finishX+2;a++)for(var f=t.startY-1;f<t.finishY+2;f++)if(!(a<0||f<0||a>=h.length||f>=h[0].length))for(var u=0;u<h[a][f].length;u++)if(e=h[a][f][u],t.getOwner()==e.getOwner()&&t!=e&&!i.has(e)&&!o.has(e)){var c=Math.abs(t.getCenterX()-e.getCenterX())-(t.getWidth()/2+e.getWidth()/2),l=Math.abs(t.getCenterY()-e.getCenterY())-(t.getHeight()/2+e.getHeight()/2);c<=this.repulsionRange&&l<=this.repulsionRange&&o.add(e)}t.surrounding=[].concat(function(t){if(Array.isArray(t)){for(var i=0,n=Array(t.length);i<t.length;i++)n[i]=t[i];return n}return Array.from(t)}(o))}for(a=0;a<t.surrounding.length;a++)this.calcRepulsionForce(t,t.surrounding[a])},a.prototype.calcRepulsionRange=function(){return 0},t.exports=a},function(t,i,n){var r=n(1),s=n(4);function e(t,i,n){r.call(this,t,i,n),this.idealLength=s.DEFAULT_EDGE_LENGTH,this.edgeElasticity=s.DEFAULT_SPRING_STRENGTH}for(var o in e.prototype=Object.create(r.prototype),r)e[o]=r[o];t.exports=e},function(t,i,n){var r=n(3),s=n(4);function e(t,i,n,e){r.call(this,t,i,n,e),this.nodeRepulsion=s.DEFAULT_REPULSION_STRENGTH,this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0,this.startX=0,this.finishX=0,this.startY=0,this.finishY=0,this.surrounding=[]}for(var o in e.prototype=Object.create(r.prototype),r)e[o]=r[o];e.prototype.setGridCoordinates=function(t,i,n,r){this.startX=t,this.finishX=i,this.startY=n,this.finishY=r},t.exports=e},function(t,i,n){function r(t,i){this.width=0,this.height=0,null!==t&&null!==i&&(this.height=i,this.width=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},t.exports=r},function(t,i,n){var r=n(14);function s(){this.map={},this.keys=[]}s.prototype.put=function(t,i){var n=r.createID(t);this.contains(n)||(this.map[n]=i,this.keys.push(t))},s.prototype.contains=function(t){return r.createID(t),null!=this.map[t]},s.prototype.get=function(t){var i=r.createID(t);return this.map[i]},s.prototype.keySet=function(){return this.keys},t.exports=s},function(t,i,n){var r=n(14);function s(){this.set={}}s.prototype.add=function(t){var i=r.createID(t);this.contains(i)||(this.set[i]=t)},s.prototype.remove=function(t){delete this.set[r.createID(t)]},s.prototype.clear=function(){this.set={}},s.prototype.contains=function(t){return this.set[r.createID(t)]==t},s.prototype.isEmpty=function(){return 0===this.size()},s.prototype.size=function(){return Object.keys(this.set).length},s.prototype.addAllTo=function(t){for(var i=Object.keys(this.set),n=i.length,r=0;r<n;r++)t.push(this.set[i[r]])},s.prototype.size=function(){return Object.keys(this.set).length},s.prototype.addAll=function(t){for(var i=t.length,n=0;n<i;n++){var r=t[n];this.add(r)}},t.exports=s},function(t,i,n){function r(){}r.multMat=function(t,i){for(var n=[],r=0;r<t.length;r++){n[r]=[];for(var s=0;s<i[0].length;s++){n[r][s]=0;for(var e=0;e<t[0].length;e++)n[r][s]+=t[r][e]*i[e][s]}}return n},r.transpose=function(t){for(var i=[],n=0;n<t[0].length;n++){i[n]=[];for(var r=0;r<t.length;r++)i[n][r]=t[r][n]}return i},r.multCons=function(t,i){for(var n=[],r=0;r<t.length;r++)n[r]=t[r]*i;return n},r.minusOp=function(t,i){for(var n=[],r=0;r<t.length;r++)n[r]=t[r]-i[r];return n},r.dotProduct=function(t,i){for(var n=0,r=0;r<t.length;r++)n+=t[r]*i[r];return n},r.mag=function(t){return Math.sqrt(this.dotProduct(t,t))},r.normalize=function(t){for(var i=[],n=this.mag(t),r=0;r<t.length;r++)i[r]=t[r]/n;return i},r.multGamma=function(t){for(var i=[],n=0,r=0;r<t.length;r++)n+=t[r];n*=-1/t.length;for(var s=0;s<t.length;s++)i[s]=n+t[s];return i},r.multL=function(t,i,n){for(var r=[],s=[],e=[],o=0;o<i[0].length;o++){for(var h=0,a=0;a<i.length;a++)h+=-.5*i[a][o]*t[a];s[o]=h}for(var f=0;f<n.length;f++){for(var u=0,c=0;c<n.length;c++)u+=n[f][c]*s[c];e[f]=u}for(var l=0;l<i.length;l++){for(var v=0,d=0;d<i[0].length;d++)v+=i[l][d]*e[d];r[l]=v}return r},t.exports=r},function(t,i,n){var r=function(){function t(t,i){for(var n=0;n<i.length;n++){var r=i[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(i,n,r){return n&&t(i.prototype,n),r&&t(i,r),i}}(),s=n(11),e=function(){function t(i,n){!function(t,i){if(!(t instanceof i))throw new TypeError("Cannot call a class as a function")}(this,t),null===n&&void 0===n||(this.compareFunction=this._defaultCompareFunction);var r=void 0;r=i instanceof s?i.size():i.length,this._quicksort(i,0,r-1)}return r(t,[{key:"_quicksort",value:function(t,i,n){if(i<n){var r=this._partition(t,i,n);this._quicksort(t,i,r),this._quicksort(t,r+1,n)}}},{key:"_partition",value:function(t,i,n){for(var r=this._get(t,i),s=i,e=n;;){for(;this.compareFunction(r,this._get(t,e));)e--;for(;this.compareFunction(this._get(t,s),r);)s++;if(!(s<e))return e;this._swap(t,s,e),s++,e--}}},{key:"_get",value:function(t,i){return t instanceof s?t.get_object_at(i):t[i]}},{key:"_set",value:function(t,i,n){t instanceof s?t.set_object_at(i,n):t[i]=n}},{key:"_swap",value:function(t,i,n){var r=this._get(t,i);this._set(t,i,this._get(t,n)),this._set(t,n,r)}},{key:"_defaultCompareFunction",value:function(t,i){return i>t}}]),t}();t.exports=e},function(t,i,n){function r(){}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 i=Math.min(this.m,this.n);this.s=function(t){for(var i=[];t-- >0;)i.push(0);return i}(Math.min(this.m+1,this.n)),this.U=function t(i){if(0==i.length)return 0;for(var n=[],r=0;r<i[0];r++)n.push(t(i.slice(1)));return n}([this.m,i]),this.V=function(t){return function t(i){if(0==i.length)return 0;for(var n=[],r=0;r<i[0];r++)n.push(t(i.slice(1)));return n}(t)}([this.n,this.n]);for(var n=function(t){for(var i=[];t-- >0;)i.push(0);return i}(this.n),s=function(t){for(var i=[];t-- >0;)i.push(0);return i}(this.m),e=Math.min(this.m-1,this.n),o=Math.max(0,Math.min(this.n-2,this.m)),h=0;h<Math.max(e,o);h++){if(h<e){this.s[h]=0;for(var a=h;a<this.m;a++)this.s[h]=r.hypot(this.s[h],t[a][h]);if(0!==this.s[h]){t[h][h]<0&&(this.s[h]=-this.s[h]);for(var f=h;f<this.m;f++)t[f][h]/=this.s[h];t[h][h]+=1}this.s[h]=-this.s[h]}for(var u=h+1;u<this.n;u++){if(function(t,i){return t&&i}(h<e,0!==this.s[h])){for(var c=0,l=h;l<this.m;l++)c+=t[l][h]*t[l][u];c=-c/t[h][h];for(var v=h;v<this.m;v++)t[v][u]+=c*t[v][h]}n[u]=t[h][u]}if(function(t,i){return i}(0,h<e))for(var d=h;d<this.m;d++)this.U[d][h]=t[d][h];if(h<o){n[h]=0;for(var y=h+1;y<this.n;y++)n[h]=r.hypot(n[h],n[y]);if(0!==n[h]){n[h+1]<0&&(n[h]=-n[h]);for(var p=h+1;p<this.n;p++)n[p]/=n[h];n[h+1]+=1}if(n[h]=-n[h],function(t,i){return t&&i}(h+1<this.m,0!==n[h])){for(var w=h+1;w<this.m;w++)s[w]=0;for(var g=h+1;g<this.n;g++)for(var m=h+1;m<this.m;m++)s[m]+=n[g]*t[m][g];for(var b=h+1;b<this.n;b++)for(var M=-n[b]/n[h+1],k=h+1;k<this.m;k++)t[k][b]+=M*s[k]}for(var x=h+1;x<this.n;x++)this.V[x][h]=n[x]}}var S=Math.min(this.n,this.m+1);e<this.n&&(this.s[e]=t[e][e]),this.m<S&&(this.s[S-1]=0),o+1<S&&(n[o]=t[o][S-1]),n[S-1]=0;for(var $=e;$<i;$++){for(var j=0;j<this.m;j++)this.U[j][$]=0;this.U[$][$]=1}for(var O=e-1;O>=0;O--)if(0!==this.s[O]){for(var A=O+1;A<i;A++){for(var T=0,I=O;I<this.m;I++)T+=this.U[I][O]*this.U[I][A];T=-T/this.U[O][O];for(var E=O;E<this.m;E++)this.U[E][A]+=T*this.U[E][O]}for(var L=O;L<this.m;L++)this.U[L][O]=-this.U[L][O];this.U[O][O]=1+this.U[O][O];for(var D=0;D<O-1;D++)this.U[D][O]=0}else{for(var N=0;N<this.m;N++)this.U[N][O]=0;this.U[O][O]=1}for(var z=this.n-1;z>=0;z--){if(function(t,i){return t&&i}(z<o,0!==n[z]))for(var B=z+1;B<i;B++){for(var C=0,P=z+1;P<this.n;P++)C+=this.V[P][z]*this.V[P][B];C=-C/this.V[z+1][z];for(var R=z+1;R<this.n;R++)this.V[R][B]+=C*this.V[R][z]}for(var G=0;G<this.n;G++)this.V[G][z]=0;this.V[z][z]=1}for(var q=S-1,F=Math.pow(2,-52),X=Math.pow(2,-966);S>0;){var Y=void 0,_=void 0;for(Y=S-2;Y>=-1&&-1!==Y;Y--)if(Math.abs(n[Y])<=X+F*(Math.abs(this.s[Y])+Math.abs(this.s[Y+1]))){n[Y]=0;break}if(Y===S-2)_=4;else{var H=void 0;for(H=S-1;H>=Y&&H!==Y;H--){var Z=(H!==S?Math.abs(n[H]):0)+(H!==Y+1?Math.abs(n[H-1]):0);if(Math.abs(this.s[H])<=X+F*Z){this.s[H]=0;break}}H===Y?_=3:H===S-1?_=1:(_=2,Y=H)}switch(Y++,_){case 1:var J=n[S-2];n[S-2]=0;for(var V=S-2;V>=Y;V--){var W=r.hypot(this.s[V],J),U=this.s[V]/W,K=J/W;this.s[V]=W,V!==Y&&(J=-K*n[V-1],n[V-1]=U*n[V-1]);for(var Q=0;Q<this.n;Q++)W=U*this.V[Q][V]+K*this.V[Q][S-1],this.V[Q][S-1]=-K*this.V[Q][V]+U*this.V[Q][S-1],this.V[Q][V]=W}break;case 2:var tt=n[Y-1];n[Y-1]=0;for(var it=Y;it<S;it++){var nt=r.hypot(this.s[it],tt),rt=this.s[it]/nt,st=tt/nt;this.s[it]=nt,tt=-st*n[it],n[it]=rt*n[it];for(var et=0;et<this.m;et++)nt=rt*this.U[et][it]+st*this.U[et][Y-1],this.U[et][Y-1]=-st*this.U[et][it]+rt*this.U[et][Y-1],this.U[et][it]=nt}break;case 3:var ot=Math.max(Math.max(Math.max(Math.max(Math.abs(this.s[S-1]),Math.abs(this.s[S-2])),Math.abs(n[S-2])),Math.abs(this.s[Y])),Math.abs(n[Y])),ht=this.s[S-1]/ot,at=this.s[S-2]/ot,ft=n[S-2]/ot,ut=this.s[Y]/ot,ct=n[Y]/ot,lt=((at+ht)*(at-ht)+ft*ft)/2,vt=ht*ft*(ht*ft),dt=0;(function(t,i){return t||i})(0!==lt,0!==vt)&&(dt=Math.sqrt(lt*lt+vt),lt<0&&(dt=-dt),dt=vt/(lt+dt));for(var yt=(ut+ht)*(ut-ht)+dt,pt=ut*ct,wt=Y;wt<S-1;wt++){var gt=r.hypot(yt,pt),mt=yt/gt,bt=pt/gt;wt!==Y&&(n[wt-1]=gt),yt=mt*this.s[wt]+bt*n[wt],n[wt]=mt*n[wt]-bt*this.s[wt],pt=bt*this.s[wt+1],this.s[wt+1]=mt*this.s[wt+1];for(var Mt=0;Mt<this.n;Mt++)gt=mt*this.V[Mt][wt]+bt*this.V[Mt][wt+1],this.V[Mt][wt+1]=-bt*this.V[Mt][wt]+mt*this.V[Mt][wt+1],this.V[Mt][wt]=gt;if(mt=yt/(gt=r.hypot(yt,pt)),bt=pt/gt,this.s[wt]=gt,yt=mt*n[wt]+bt*this.s[wt+1],this.s[wt+1]=-bt*n[wt]+mt*this.s[wt+1],pt=bt*n[wt+1],n[wt+1]=mt*n[wt+1],wt<this.m-1)for(var kt=0;kt<this.m;kt++)gt=mt*this.U[kt][wt]+bt*this.U[kt][wt+1],this.U[kt][wt+1]=-bt*this.U[kt][wt]+mt*this.U[kt][wt+1],this.U[kt][wt]=gt}n[S-2]=yt;break;case 4:if(this.s[Y]<=0){this.s[Y]=this.s[Y]<0?-this.s[Y]:0;for(var xt=0;xt<=q;xt++)this.V[xt][Y]=-this.V[xt][Y]}for(;Y<q&&!(this.s[Y]>=this.s[Y+1]);){var St=this.s[Y];if(this.s[Y]=this.s[Y+1],this.s[Y+1]=St,Y<this.n-1)for(var $t=0;$t<this.n;$t++)St=this.V[$t][Y+1],this.V[$t][Y+1]=this.V[$t][Y],this.V[$t][Y]=St;if(Y<this.m-1)for(var jt=0;jt<this.m;jt++)St=this.U[jt][Y+1],this.U[jt][Y+1]=this.U[jt][Y],this.U[jt][Y]=St;Y++}S--}}return{U:this.U,V:this.V,S:this.s}},r.hypot=function(t,i){var n=void 0;return Math.abs(t)>Math.abs(i)?(n=i/t,n=Math.abs(t)*Math.sqrt(1+n*n)):0!=i?(n=t/i,n=Math.abs(i)*Math.sqrt(1+n*n)):n=0,n},t.exports=r},function(t,i,n){var r=function(){function t(t,i){for(var n=0;n<i.length;n++){var r=i[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(i,n,r){return n&&t(i.prototype,n),r&&t(i,r),i}}(),s=function(){function t(i,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1,e=arguments.length>4&&void 0!==arguments[4]?arguments[4]:-1;!function(t,i){if(!(t instanceof i))throw new TypeError("Cannot call a class as a function")}(this,t),this.sequence1=i,this.sequence2=n,this.match_score=r,this.mismatch_penalty=s,this.gap_penalty=e,this.iMax=i.length+1,this.jMax=n.length+1,this.grid=new Array(this.iMax);for(var o=0;o<this.iMax;o++){this.grid[o]=new Array(this.jMax);for(var h=0;h<this.jMax;h++)this.grid[o][h]=0}this.tracebackGrid=new Array(this.iMax);for(var a=0;a<this.iMax;a++){this.tracebackGrid[a]=new Array(this.jMax);for(var f=0;f<this.jMax;f++)this.tracebackGrid[a][f]=[null,null,null]}this.alignments=[],this.score=-1,this.computeGrids()}return r(t,[{key:"getScore",value:function(){return this.score}},{key:"getAlignments",value:function(){return this.alignments}},{key:"computeGrids",value: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 i=1;i<this.iMax;i++)this.grid[i][0]=this.grid[i-1][0]+this.gap_penalty,this.tracebackGrid[i][0]=[!1,!0,!1];for(var n=1;n<this.iMax;n++)for(var r=1;r<this.jMax;r++){var s=[this.sequence1[n-1]===this.sequence2[r-1]?this.grid[n-1][r-1]+this.match_score:this.grid[n-1][r-1]+this.mismatch_penalty,this.grid[n-1][r]+this.gap_penalty,this.grid[n][r-1]+this.gap_penalty],e=this.arrayAllMaxIndexes(s);this.grid[n][r]=s[e[0]],this.tracebackGrid[n][r]=[e.includes(0),e.includes(1),e.includes(2)]}this.score=this.grid[this.iMax-1][this.jMax-1]}},{key:"alignmentTraceback",value:function(){var t=[];for(t.push({pos:[this.sequence1.length,this.sequence2.length],seq1:"",seq2:""});t[0];){var i=t[0],n=this.tracebackGrid[i.pos[0]][i.pos[1]];n[0]&&t.push({pos:[i.pos[0]-1,i.pos[1]-1],seq1:this.sequence1[i.pos[0]-1]+i.seq1,seq2:this.sequence2[i.pos[1]-1]+i.seq2}),n[1]&&t.push({pos:[i.pos[0]-1,i.pos[1]],seq1:this.sequence1[i.pos[0]-1]+i.seq1,seq2:"-"+i.seq2}),n[2]&&t.push({pos:[i.pos[0],i.pos[1]-1],seq1:"-"+i.seq1,seq2:this.sequence2[i.pos[1]-1]+i.seq2}),0===i.pos[0]&&0===i.pos[1]&&this.alignments.push({sequence1:i.seq1,sequence2:i.seq2}),t.shift()}return this.alignments}},{key:"getAllIndexes",value:function(t,i){for(var n=[],r=-1;-1!==(r=t.indexOf(i,r+1));)n.push(r);return n}},{key:"arrayAllMaxIndexes",value:function(t){return this.getAllIndexes(t,Math.max.apply(null,t))}}]),t}();t.exports=s},function(t,i,n){var r=function(){};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,i,n){function r(){this.listeners=[]}var s=r.prototype;s.addListener=function(t,i){this.listeners.push({event:t,callback:i})},s.removeListener=function(t,i){for(var n=this.listeners.length;n>=0;n--){var r=this.listeners[n];r.event===t&&r.callback===i&&this.listeners.splice(n,1)}},s.emit=function(t,i){for(var n=0;n<this.listeners.length;n++){var r=this.listeners[n];t===r.event&&r.callback(i)}},t.exports=r}])},I.exports=t());var t}var L;function D(){return L?T.exports:(L=1,t=function(t){return i={45:(t,i,n)=>{var r={};r.layoutBase=n(551),r.CoSEConstants=n(806),r.CoSEEdge=n(767),r.CoSEGraph=n(880),r.CoSEGraphManager=n(578),r.CoSELayout=n(765),r.CoSENode=n(991),r.ConstraintHandler=n(902),t.exports=r},806:(t,i,n)=>{var r=n(551).FDLayoutConstants;function s(){}for(var e in r)s[e]=r[e];s.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,s.DEFAULT_RADIAL_SEPARATION=r.DEFAULT_EDGE_LENGTH,s.DEFAULT_COMPONENT_SEPERATION=60,s.TILE=!0,s.TILING_PADDING_VERTICAL=10,s.TILING_PADDING_HORIZONTAL=10,s.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,s.ENFORCE_CONSTRAINTS=!0,s.APPLY_LAYOUT=!0,s.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,s.TREE_REDUCTION_ON_INCREMENTAL=!0,s.PURE_INCREMENTAL=s.DEFAULT_INCREMENTAL,t.exports=s},767:(t,i,n)=>{var r=n(551).FDLayoutEdge;function s(t,i,n){r.call(this,t,i,n)}for(var e in s.prototype=Object.create(r.prototype),r)s[e]=r[e];t.exports=s},880:(t,i,n)=>{var r=n(551).LGraph;function s(t,i,n){r.call(this,t,i,n)}for(var e in s.prototype=Object.create(r.prototype),r)s[e]=r[e];t.exports=s},578:(t,i,n)=>{var r=n(551).LGraphManager;function s(t){r.call(this,t)}for(var e in s.prototype=Object.create(r.prototype),r)s[e]=r[e];t.exports=s},765:(t,i,n)=>{var r=n(551).FDLayout,s=n(578),e=n(880),o=n(991),h=n(767),a=n(806),f=n(902),u=n(551).FDLayoutConstants,c=n(551).LayoutConstants,l=n(551).Point,v=n(551).PointD,d=n(551).DimensionD,y=n(551).Layout,p=n(551).Integer,w=n(551).IGeometry,g=n(551).LGraph,m=n(551).Transform,b=n(551).LinkedList;function M(){r.call(this),this.toBeTiled={},this.constraints={}}for(var k in M.prototype=Object.create(r.prototype),r)M[k]=r[k];M.prototype.newGraphManager=function(){var t=new s(this);return this.graphManager=t,t},M.prototype.newGraph=function(t){return new e(null,this.graphManager,t)},M.prototype.newNode=function(t){return new o(this.graphManager,t)},M.prototype.newEdge=function(t){return new h(null,null,t)},M.prototype.initParameters=function(){r.prototype.initParameters.call(this,arguments),this.isSubLayout||(a.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=a.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=a.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=u.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=u.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=u.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=u.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},M.prototype.initSpringEmbedder=function(){r.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/u.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},M.prototype.layout=function(){return c.DEFAULT_CREATE_BENDS_AS_NEEDED&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},M.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)a.TREE_REDUCTION_ON_INCREMENTAL&&(this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation(),i=new Set(this.getAllNodes()),n=this.nodesWithGravity.filter(function(t){return i.has(t)}),this.graphManager.setAllNodesToApplyGravitation(n));else{var t=this.getFlatForest();if(t.length>0)this.positionNodesRadially(t);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var i=new Set(this.getAllNodes()),n=this.nodesWithGravity.filter(function(t){return i.has(t)});this.graphManager.setAllNodesToApplyGravitation(n),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(f.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),a.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},M.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%u.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()),i=this.nodesWithGravity.filter(function(i){return t.has(i)});this.graphManager.setAllNodesToApplyGravitation(i),this.graphManager.updateBounds(),this.updateGrid(),a.PURE_INCREMENTAL?this.coolingFactor=u.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=u.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()),a.PURE_INCREMENTAL?this.coolingFactor=u.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=u.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var n=!this.isTreeGrowing&&!this.isGrowthFinished,r=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(n,r),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},M.prototype.getPositionsData=function(){for(var t=this.graphManager.getAllNodes(),i={},n=0;n<t.length;n++){var r=t[n].rect,s=t[n].id;i[s]={id:s,x:r.getCenterX(),y:r.getCenterY(),w:r.width,h:r.height}}return i},M.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var t=!1;if("during"===u.ANIMATE)this.emit("layoutstarted");else{for(;!t;)t=this.tick();this.graphManager.updateBounds()}},M.prototype.moveNodes=function(){for(var t=this.getAllNodes(),i=0;i<t.length;i++)t[i].calculateDisplacement();for(Object.keys(this.constraints).length>0&&this.updateDisplacements(),i=0;i<t.length;i++)t[i].move()},M.prototype.initConstraintVariables=function(){var t=this;this.idToNodeMap=new Map,this.fixedNodeSet=new Set;for(var i=this.graphManager.getAllNodes(),n=0;n<i.length;n++){var r=i[n];this.idToNodeMap.set(r.id,r)}var s=function i(n){for(var r,s=n.getChild().getNodes(),e=0,o=0;o<s.length;o++)null==(r=s[o]).getChild()?t.fixedNodeSet.has(r.id)&&(e+=100):e+=i(r);return e};if(this.constraints.fixedNodeConstraint)for(this.constraints.fixedNodeConstraint.forEach(function(i){t.fixedNodeSet.add(i.nodeId)}),i=this.graphManager.getAllNodes(),n=0;n<i.length;n++)if(null!=(r=i[n]).getChild()){var e=s(r);e>0&&(r.fixedNodeWeight=e)}if(this.constraints.relativePlacementConstraint){var o=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(i){t.fixedNodesOnHorizontal.add(i),t.fixedNodesOnVertical.add(i)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical){var f=this.constraints.alignmentConstraint.vertical;for(n=0;n<f.length;n++)this.dummyToNodeForVerticalAlignment.set("dummy"+n,[]),f[n].forEach(function(i){o.set(i,"dummy"+n),t.dummyToNodeForVerticalAlignment.get("dummy"+n).push(i),t.fixedNodeSet.has(i)&&t.fixedNodesOnHorizontal.add("dummy"+n)})}if(this.constraints.alignmentConstraint.horizontal){var u=this.constraints.alignmentConstraint.horizontal;for(n=0;n<u.length;n++)this.dummyToNodeForHorizontalAlignment.set("dummy"+n,[]),u[n].forEach(function(i){h.set(i,"dummy"+n),t.dummyToNodeForHorizontalAlignment.get("dummy"+n).push(i),t.fixedNodeSet.has(i)&&t.fixedNodesOnVertical.add("dummy"+n)})}}if(a.RELAX_MOVEMENT_ON_CONSTRAINTS)this.shuffle=function(t){var i,n,r;for(r=t.length-1;r>=2*t.length/3;r--)i=Math.floor(Math.random()*(r+1)),n=t[r],t[r]=t[i],t[i]=n;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(i){if(i.left){var n=o.has(i.left)?o.get(i.left):i.left,r=o.has(i.right)?o.get(i.right):i.right;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.nodesInRelativeHorizontal.includes(r)||(t.nodesInRelativeHorizontal.push(r),t.nodeToRelativeConstraintMapHorizontal.set(r,[]),t.dummyToNodeForVerticalAlignment.has(r)?t.nodeToTempPositionMapHorizontal.set(r,t.idToNodeMap.get(t.dummyToNodeForVerticalAlignment.get(r)[0]).getCenterX()):t.nodeToTempPositionMapHorizontal.set(r,t.idToNodeMap.get(r).getCenterX())),t.nodeToRelativeConstraintMapHorizontal.get(n).push({right:r,gap:i.gap}),t.nodeToRelativeConstraintMapHorizontal.get(r).push({left:n,gap:i.gap})}else{var s=h.has(i.top)?h.get(i.top):i.top,e=h.has(i.bottom)?h.get(i.bottom):i.bottom;t.nodesInRelativeVertical.includes(s)||(t.nodesInRelativeVertical.push(s),t.nodeToRelativeConstraintMapVertical.set(s,[]),t.dummyToNodeForHorizontalAlignment.has(s)?t.nodeToTempPositionMapVertical.set(s,t.idToNodeMap.get(t.dummyToNodeForHorizontalAlignment.get(s)[0]).getCenterY()):t.nodeToTempPositionMapVertical.set(s,t.idToNodeMap.get(s).getCenterY())),t.nodesInRelativeVertical.includes(e)||(t.nodesInRelativeVertical.push(e),t.nodeToRelativeConstraintMapVertical.set(e,[]),t.dummyToNodeForHorizontalAlignment.has(e)?t.nodeToTempPositionMapVertical.set(e,t.idToNodeMap.get(t.dummyToNodeForHorizontalAlignment.get(e)[0]).getCenterY()):t.nodeToTempPositionMapVertical.set(e,t.idToNodeMap.get(e).getCenterY())),t.nodeToRelativeConstraintMapVertical.get(s).push({bottom:e,gap:i.gap}),t.nodeToRelativeConstraintMapVertical.get(e).push({top:s,gap:i.gap})}});else{var c=new Map,l=new Map;this.constraints.relativePlacementConstraint.forEach(function(t){if(t.left){var i=o.has(t.left)?o.get(t.left):t.left,n=o.has(t.right)?o.get(t.right):t.right;c.has(i)?c.get(i).push(n):c.set(i,[n]),c.has(n)?c.get(n).push(i):c.set(n,[i])}else{var r=h.has(t.top)?h.get(t.top):t.top,s=h.has(t.bottom)?h.get(t.bottom):t.bottom;l.has(r)?l.get(r).push(s):l.set(r,[s]),l.has(s)?l.get(s).push(r):l.set(s,[r])}});var v=function(t,i){var n=[],r=[],s=new b,e=new Set,o=0;return t.forEach(function(h,a){if(!e.has(a)){n[o]=[],r[o]=!1;var f=a;for(s.push(f),e.add(f),n[o].push(f);0!=s.length;)f=s.shift(),i.has(f)&&(r[o]=!0),t.get(f).forEach(function(t){e.has(t)||(s.push(t),e.add(t),n[o].push(t))});o++}}),{components:n,isFixed:r}},d=v(c,t.fixedNodesOnHorizontal);this.componentsOnHorizontal=d.components,this.fixedComponentsOnHorizontal=d.isFixed;var y=v(l,t.fixedNodesOnVertical);this.componentsOnVertical=y.components,this.fixedComponentsOnVertical=y.isFixed}}},M.prototype.updateDisplacements=function(){var t=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function(i){var n=t.idToNodeMap.get(i.nodeId);n.displacementX=0,n.displacementY=0}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var i=this.constraints.alignmentConstraint.vertical,n=0;n<i.length;n++){for(var r=0,s=0;s<i[n].length;s++){if(this.fixedNodeSet.has(i[n][s])){r=0;break}r+=this.idToNodeMap.get(i[n][s]).displacementX}var e=r/i[n].length;for(s=0;s<i[n].length;s++)this.idToNodeMap.get(i[n][s]).displacementX=e}if(this.constraints.alignmentConstraint.horizontal){var o=this.constraints.alignmentConstraint.horizontal;for(n=0;n<o.length;n++){var h=0;for(s=0;s<o[n].length;s++){if(this.fixedNodeSet.has(o[n][s])){h=0;break}h+=this.idToNodeMap.get(o[n][s]).displacementY}var f=h/o[n].length;for(s=0;s<o[n].length;s++)this.idToNodeMap.get(o[n][s]).displacementY=f}}}if(this.constraints.relativePlacementConstraint)if(a.RELAX_MOVEMENT_ON_CONSTRAINTS)this.totalIterations%10==0&&(this.shuffle(this.nodesInRelativeHorizontal),this.shuffle(this.nodesInRelativeVertical)),this.nodesInRelativeHorizontal.forEach(function(i){if(!t.fixedNodesOnHorizontal.has(i)){var n=0;n=t.dummyToNodeForVerticalAlignment.has(i)?t.idToNodeMap.get(t.dummyToNodeForVerticalAlignment.get(i)[0]).displacementX:t.idToNodeMap.get(i).displacementX,t.nodeToRelativeConstraintMapHorizontal.get(i).forEach(function(r){var s;r.right?(s=t.nodeToTempPositionMapHorizontal.get(r.right)-t.nodeToTempPositionMapHorizontal.get(i)-n)<r.gap&&(n-=r.gap-s):(s=t.nodeToTempPositionMapHorizontal.get(i)-t.nodeToTempPositionMapHorizontal.get(r.left)+n)<r.gap&&(n+=r.gap-s)}),t.nodeToTempPositionMapHorizontal.set(i,t.nodeToTempPositionMapHorizontal.get(i)+n),t.dummyToNodeForVerticalAlignment.has(i)?t.dummyToNodeForVerticalAlignment.get(i).forEach(function(i){t.idToNodeMap.get(i).displacementX=n}):t.idToNodeMap.get(i).displacementX=n}}),this.nodesInRelativeVertical.forEach(function(i){if(!t.fixedNodesOnHorizontal.has(i)){var n=0;n=t.dummyToNodeForHorizontalAlignment.has(i)?t.idToNodeMap.get(t.dummyToNodeForHorizontalAlignment.get(i)[0]).displacementY:t.idToNodeMap.get(i).displacementY,t.nodeToRelativeConstraintMapVertical.get(i).forEach(function(r){var s;r.bottom?(s=t.nodeToTempPositionMapVertical.get(r.bottom)-t.nodeToTempPositionMapVertical.get(i)-n)<r.gap&&(n-=r.gap-s):(s=t.nodeToTempPositionMapVertical.get(i)-t.nodeToTempPositionMapVertical.get(r.top)+n)<r.gap&&(n+=r.gap-s)}),t.nodeToTempPositionMapVertical.set(i,t.nodeToTempPositionMapVertical.get(i)+n),t.dummyToNodeForHorizontalAlignment.has(i)?t.dummyToNodeForHorizontalAlignment.get(i).forEach(function(i){t.idToNodeMap.get(i).displacementY=n}):t.idToNodeMap.get(i).displacementY=n}});else{for(n=0;n<this.componentsOnHorizontal.length;n++){var u=this.componentsOnHorizontal[n];if(this.fixedComponentsOnHorizontal[n])for(s=0;s<u.length;s++)this.dummyToNodeForVerticalAlignment.has(u[s])?this.dummyToNodeForVerticalAlignment.get(u[s]).forEach(function(i){t.idToNodeMap.get(i).displacementX=0}):this.idToNodeMap.get(u[s]).displacementX=0;else{var c=0,l=0;for(s=0;s<u.length;s++)this.dummyToNodeForVerticalAlignment.has(u[s])?(c+=(d=this.dummyToNodeForVerticalAlignment.get(u[s])).length*this.idToNodeMap.get(d[0]).displacementX,l+=d.length):(c+=this.idToNodeMap.get(u[s]).displacementX,l++);var v=c/l;for(s=0;s<u.length;s++)this.dummyToNodeForVerticalAlignment.has(u[s])?this.dummyToNodeForVerticalAlignment.get(u[s]).forEach(function(i){t.idToNodeMap.get(i).displacementX=v}):this.idToNodeMap.get(u[s]).displacementX=v}}for(n=0;n<this.componentsOnVertical.length;n++)if(u=this.componentsOnVertical[n],this.fixedComponentsOnVertical[n])for(s=0;s<u.length;s++)this.dummyToNodeForHorizontalAlignment.has(u[s])?this.dummyToNodeForHorizontalAlignment.get(u[s]).forEach(function(i){t.idToNodeMap.get(i).displacementY=0}):this.idToNodeMap.get(u[s]).displacementY=0;else{for(c=0,l=0,s=0;s<u.length;s++){var d;this.dummyToNodeForHorizontalAlignment.has(u[s])?(c+=(d=this.dummyToNodeForHorizontalAlignment.get(u[s])).length*this.idToNodeMap.get(d[0]).displacementY,l+=d.length):(c+=this.idToNodeMap.get(u[s]).displacementY,l++)}for(v=c/l,s=0;s<u.length;s++)this.dummyToNodeForHorizontalAlignment.has(u[s])?this.dummyToNodeForHorizontalAlignment.get(u[s]).forEach(function(i){t.idToNodeMap.get(i).displacementY=v}):this.idToNodeMap.get(u[s]).displacementY=v}}},M.prototype.calculateNodesToApplyGravitationTo=function(){var t,i,n=[],r=this.graphManager.getGraphs(),s=r.length;for(i=0;i<s;i++)(t=r[i]).updateConnected(),t.isConnected||(n=n.concat(t.getNodes()));return n},M.prototype.createBendpoints=function(){var t=[];t=t.concat(this.graphManager.getAllEdges());var i,n=new Set;for(i=0;i<t.length;i++){var r=t[i];if(!n.has(r)){var s=r.getSource(),e=r.getTarget();if(s==e)r.getBendpoints().push(new v),r.getBendpoints().push(new v),this.createDummyNodesForBendpoints(r),n.add(r);else{var o=[];if(o=(o=o.concat(s.getEdgeListToNode(e))).concat(e.getEdgeListToNode(s)),!n.has(o[0])){var h;if(o.length>1)for(h=0;h<o.length;h++){var a=o[h];a.getBendpoints().push(new v),this.createDummyNodesForBendpoints(a)}o.forEach(function(t){n.add(t)})}}}if(n.size==t.length)break}},M.prototype.positionNodesRadially=function(t){for(var i=new l(0,0),n=Math.ceil(Math.sqrt(t.length)),r=0,s=0,e=0,o=new v(0,0),h=0;h<t.length;h++){h%n==0&&(e=0,s=r,0!=h&&(s+=a.DEFAULT_COMPONENT_SEPERATION),r=0);var f=t[h],u=y.findCenterOfTree(f);i.x=e,i.y=s,(o=M.radialLayout(f,u,i)).y>r&&(r=Math.floor(o.y)),e=Math.floor(o.x+a.DEFAULT_COMPONENT_SEPERATION)}this.transform(new v(c.WORLD_CENTER_X-o.x/2,c.WORLD_CENTER_Y-o.y/2))},M.radialLayout=function(t,i,n){var r=Math.max(this.maxDiagonalInTree(t),a.DEFAULT_RADIAL_SEPARATION);M.branchRadialLayout(i,null,0,359,0,r);var s=g.calculateBounds(t),e=new m;e.setDeviceOrgX(s.getMinX()),e.setDeviceOrgY(s.getMinY()),e.setWorldOrgX(n.x),e.setWorldOrgY(n.y);for(var o=0;o<t.length;o++)t[o].transform(e);var h=new v(s.getMaxX(),s.getMaxY());return e.inverseTransformPoint(h)},M.branchRadialLayout=function(t,i,n,r,s,e){var o=(r-n+1)/2;o<0&&(o+=180);var h=(o+n)%360*w.TWO_PI/360,a=s*Math.cos(h),f=s*Math.sin(h);t.setCenter(a,f);var u=[],c=(u=u.concat(t.getEdges())).length;null!=i&&c--;for(var l,v=0,d=u.length,y=t.getEdgesBetween(i);y.length>1;){var p=y[0];y.splice(0,1);var g=u.indexOf(p);g>=0&&u.splice(g,1),d--,c--}l=null!=i?(u.indexOf(y[0])+1)%d:0;for(var m=Math.abs(r-n)/c,b=l;v!=c;b=++b%d){var k=u[b].getOtherEnd(t);if(k!=i){var x=(n+v*m)%360,S=(x+m)%360;M.branchRadialLayout(k,t,x,S,s+e,e),v++}}},M.maxDiagonalInTree=function(t){for(var i=p.MIN_VALUE,n=0;n<t.length;n++){var r=t[n].getDiagonal();r>i&&(i=r)}return i},M.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},M.prototype.groupZeroDegreeMembers=function(){var t=this,i={};this.memberGroups={},this.idToDummyNode={};for(var n=[],r=this.graphManager.getAllNodes(),s=0;s<r.length;s++){var e=(h=r[s]).getParent();0!==this.getNodeDegreeWithChildren(h)||null!=e.id&&this.getToBeTiled(e)||n.push(h)}for(s=0;s<n.length;s++){var h,a=(h=n[s]).getParent().id;void 0===i[a]&&(i[a]=[]),i[a]=i[a].concat(h)}Object.keys(i).forEach(function(n){if(i[n].length>1){var r="DummyCompound_"+n;t.memberGroups[r]=i[n];var s=i[n][0].getParent(),e=new o(t.graphManager);e.id=r,e.paddingLeft=s.paddingLeft||0,e.paddingRight=s.paddingRight||0,e.paddingBottom=s.paddingBottom||0,e.paddingTop=s.paddingTop||0,t.idToDummyNode[r]=e;var h=t.getGraphManager().add(t.newGraph(),e),a=s.getChild();a.add(e);for(var f=0;f<i[n].length;f++){var u=i[n][f];a.remove(u),h.add(u)}}})},M.prototype.clearCompounds=function(){var t={},i={};this.performDFSOnCompounds();for(var n=0;n<this.compoundOrder.length;n++)i[this.compoundOrder[n].id]=this.compoundOrder[n],t[this.compoundOrder[n].id]=[].concat(this.compoundOrder[n].getChild().getNodes()),this.graphManager.remove(this.compoundOrder[n].getChild()),this.compoundOrder[n].child=null;this.graphManager.resetAllNodes(),this.tileCompoundMembers(t,i)},M.prototype.clearZeroDegreeMembers=function(){var t=this,i=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach(function(n){var r=t.idToDummyNode[n];if(i[n]=t.tileNodes(t.memberGroups[n],r.paddingLeft+r.paddingRight),r.rect.width=i[n].width,r.rect.height=i[n].height,r.setCenter(i[n].centerX,i[n].centerY),r.labelMarginLeft=0,r.labelMarginTop=0,a.NODE_DIMENSIONS_INCLUDE_LABELS){var s=r.rect.width,e=r.rect.height;r.labelWidth&&("left"==r.labelPosHorizontal?(r.rect.x-=r.labelWidth,r.setWidth(s+r.labelWidth),r.labelMarginLeft=r.labelWidth):"center"==r.labelPosHorizontal&&r.labelWidth>s?(r.rect.x-=(r.labelWidth-s)/2,r.setWidth(r.labelWidth),r.labelMarginLeft=(r.labelWidth-s)/2):"right"==r.labelPosHorizontal&&r.setWidth(s+r.labelWidth)),r.labelHeight&&("top"==r.labelPosVertical?(r.rect.y-=r.labelHeight,r.setHeight(e+r.labelHeight),r.labelMarginTop=r.labelHeight):"center"==r.labelPosVertical&&r.labelHeight>e?(r.rect.y-=(r.labelHeight-e)/2,r.setHeight(r.labelHeight),r.labelMarginTop=(r.labelHeight-e)/2):"bottom"==r.labelPosVertical&&r.setHeight(e+r.labelHeight))}})},M.prototype.repopulateCompounds=function(){for(var t=this.compoundOrder.length-1;t>=0;t--){var i=this.compoundOrder[t],n=i.id,r=i.paddingLeft,s=i.paddingTop,e=i.labelMarginLeft,o=i.labelMarginTop;this.adjustLocations(this.tiledMemberPack[n],i.rect.x,i.rect.y,r,s,e,o)}},M.prototype.repopulateZeroDegreeMembers=function(){var t=this,i=this.tiledZeroDegreePack;Object.keys(i).forEach(function(n){var r=t.idToDummyNode[n],s=r.paddingLeft,e=r.paddingTop,o=r.labelMarginLeft,h=r.labelMarginTop;t.adjustLocations(i[n],r.rect.x,r.rect.y,s,e,o,h)})},M.prototype.getToBeTiled=function(t){var i=t.id;if(null!=this.toBeTiled[i])return this.toBeTiled[i];var n=t.getChild();if(null==n)return this.toBeTiled[i]=!1,!1;for(var r=n.getNodes(),s=0;s<r.length;s++){var e=r[s];if(this.getNodeDegree(e)>0)return this.toBeTiled[i]=!1,!1;if(null!=e.getChild()){if(!this.getToBeTiled(e))return this.toBeTiled[i]=!1,!1}else this.toBeTiled[e.id]=!1}return this.toBeTiled[i]=!0,!0},M.prototype.getNodeDegree=function(t){t.id;for(var i=t.getEdges(),n=0,r=0;r<i.length;r++){var s=i[r];s.getSource().id!==s.getTarget().id&&(n+=1)}return n},M.prototype.getNodeDegreeWithChildren=function(t){var i=this.getNodeDegree(t);if(null==t.getChild())return i;for(var n=t.getChild().getNodes(),r=0;r<n.length;r++){var s=n[r];i+=this.getNodeDegreeWithChildren(s)}return i},M.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},M.prototype.fillCompexOrderByDFS=function(t){for(var i=0;i<t.length;i++){var n=t[i];null!=n.getChild()&&this.fillCompexOrderByDFS(n.getChild().getNodes()),this.getToBeTiled(n)&&this.compoundOrder.push(n)}},M.prototype.adjustLocations=function(t,i,n,r,s,e,o){n+=s+o;for(var h=i+=r+e,a=0;a<t.rows.length;a++){var f=t.rows[a];i=h;for(var u=0,c=0;c<f.length;c++){var l=f[c];l.rect.x=i,l.rect.y=n,i+=l.rect.width+t.horizontalPadding,l.rect.height>u&&(u=l.rect.height)}n+=u+t.verticalPadding}},M.prototype.tileCompoundMembers=function(t,i){var n=this;this.tiledMemberPack=[],Object.keys(t).forEach(function(r){var s=i[r];if(n.tiledMemberPack[r]=n.tileNodes(t[r],s.paddingLeft+s.paddingRight),s.rect.width=n.tiledMemberPack[r].width,s.rect.height=n.tiledMemberPack[r].height,s.setCenter(n.tiledMemberPack[r].centerX,n.tiledMemberPack[r].centerY),s.labelMarginLeft=0,s.labelMarginTop=0,a.NODE_DIMENSIONS_INCLUDE_LABELS){var e=s.rect.width,o=s.rect.height;s.labelWidth&&("left"==s.labelPosHorizontal?(s.rect.x-=s.labelWidth,s.setWidth(e+s.labelWidth),s.labelMarginLeft=s.labelWidth):"center"==s.labelPosHorizontal&&s.labelWidth>e?(s.rect.x-=(s.labelWidth-e)/2,s.setWidth(s.labelWidth),s.labelMarginLeft=(s.labelWidth-e)/2):"right"==s.labelPosHorizontal&&s.setWidth(e+s.labelWidth)),s.labelHeight&&("top"==s.labelPosVertical?(s.rect.y-=s.labelHeight,s.setHeight(o+s.labelHeight),s.labelMarginTop=s.labelHeight):"center"==s.labelPosVertical&&s.labelHeight>o?(s.rect.y-=(s.labelHeight-o)/2,s.setHeight(s.labelHeight),s.labelMarginTop=(s.labelHeight-o)/2):"bottom"==s.labelPosVertical&&s.setHeight(o+s.labelHeight))}})},M.prototype.tileNodes=function(t,i){var n=this.tileNodesByFavoringDim(t,i,!0),r=this.tileNodesByFavoringDim(t,i,!1),s=this.getOrgRatio(n);return this.getOrgRatio(r)<s?r:n},M.prototype.getOrgRatio=function(t){var i=t.width/t.height;return i<1&&(i=1/i),i},M.prototype.calcIdealRowWidth=function(t,i){var n=a.TILING_PADDING_VERTICAL,r=a.TILING_PADDING_HORIZONTAL,s=t.length,e=0,o=0,h=0;t.forEach(function(t){e+=t.getWidth(),o+=t.getHeight(),t.getWidth()>h&&(h=t.getWidth())});var f,u=e/s,c=o/s,l=Math.pow(n-r,2)+4*(u+r)*(c+n)*s,v=(r-n+Math.sqrt(l))/(2*(u+r));i?(f=Math.ceil(v))==v&&f++:f=Math.floor(v);var d=f*(u+r)-r;return h>d&&(d=h),d+=2*r},M.prototype.tileNodesByFavoringDim=function(t,i,n){var r=a.TILING_PADDING_VERTICAL,s=a.TILING_PADDING_HORIZONTAL,e=a.TILING_COMPARE_BY,o={rows:[],rowWidth:[],rowHeight:[],width:0,height:i,verticalPadding:r,horizontalPadding:s,centerX:0,centerY:0};e&&(o.idealRowWidth=this.calcIdealRowWidth(t,n));var h=function(t){return t.rect.width*t.rect.height},f=function(t,i){return h(i)-h(t)};t.sort(function(t,i){var n=f;return o.idealRowWidth?(n=e)(t.id,i.id):n(t,i)});for(var u=0,c=0,l=0;l<t.length;l++)u+=(v=t[l]).getCenterX(),c+=v.getCenterY();for(o.centerX=u/t.length,o.centerY=c/t.length,l=0;l<t.length;l++){var v=t[l];if(0==o.rows.length)this.insertNodeToRow(o,v,0,i);else if(this.canAddHorizontal(o,v.rect.width,v.rect.height)){var d=o.rows.length-1;o.idealRowWidth||(d=this.getShortestRowIndex(o)),this.insertNodeToRow(o,v,d,i)}else this.insertNodeToRow(o,v,o.rows.length,i);this.shiftToLastRow(o)}return o},M.prototype.insertNodeToRow=function(t,i,n,r){var s=r;n==t.rows.length&&(t.rows.push([]),t.rowWidth.push(s),t.rowHeight.push(0));var e=t.rowWidth[n]+i.rect.width;t.rows[n].length>0&&(e+=t.horizontalPadding),t.rowWidth[n]=e,t.width<e&&(t.width=e);var o=i.rect.height;n>0&&(o+=t.verticalPadding);var h=0;o>t.rowHeight[n]&&(h=t.rowHeight[n],t.rowHeight[n]=o,h=t.rowHeight[n]-h),t.height+=h,t.rows[n].push(i)},M.prototype.getShortestRowIndex=function(t){for(var i=-1,n=Number.MAX_VALUE,r=0;r<t.rows.length;r++)t.rowWidth[r]<n&&(i=r,n=t.rowWidth[r]);return i},M.prototype.getLongestRowIndex=function(t){for(var i=-1,n=Number.MIN_VALUE,r=0;r<t.rows.length;r++)t.rowWidth[r]>n&&(i=r,n=t.rowWidth[r]);return i},M.prototype.canAddHorizontal=function(t,i,n){if(t.idealRowWidth){var r=t.rows.length-1;return t.rowWidth[r]+i+t.horizontalPadding<=t.idealRowWidth}var s=this.getShortestRowIndex(t);if(s<0)return!0;var e=t.rowWidth[s];if(e+t.horizontalPadding+i<=t.width)return!0;var o,h,a=0;return t.rowHeight[s]<n&&s>0&&(a=n+t.verticalPadding-t.rowHeight[s]),o=t.width-e>=i+t.horizontalPadding?(t.height+a)/(e+i+t.horizontalPadding):(t.height+a)/t.width,a=n+t.verticalPadding,(h=t.width<i?(t.height+a)/i:(t.height+a)/t.width)<1&&(h=1/h),o<1&&(o=1/o),o<h},M.prototype.shiftToLastRow=function(t){var i=this.getLongestRowIndex(t),n=t.rowWidth.length-1,r=t.rows[i],s=r[r.length-1],e=s.width+t.horizontalPadding;if(t.width-t.rowWidth[n]>e&&i!=n){r.splice(-1,1),t.rows[n].push(s),t.rowWidth[i]=t.rowWidth[i]-e,t.rowWidth[n]=t.rowWidth[n]+e,t.width=t.rowWidth[instance.getLongestRowIndex(t)];for(var o=Number.MIN_VALUE,h=0;h<r.length;h++)r[h].height>o&&(o=r[h].height);i>0&&(o+=t.verticalPadding);var a=t.rowHeight[i]+t.rowHeight[n];t.rowHeight[i]=o,t.rowHeight[n]<s.height+t.verticalPadding&&(t.rowHeight[n]=s.height+t.verticalPadding);var f=t.rowHeight[i]+t.rowHeight[n];t.height+=f-a,this.shiftToLastRow(t)}},M.prototype.tilingPreLayout=function(){a.TILE&&(this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers())},M.prototype.tilingPostLayout=function(){a.TILE&&(this.repopulateZeroDegreeMembers(),this.repopulateCompounds())},M.prototype.reduceTrees=function(){for(var t,i=[],n=!0;n;){var r=this.graphManager.getAllNodes(),s=[];n=!1;for(var e=0;e<r.length;e++)if(1==(t=r[e]).getEdges().length&&!t.getEdges()[0].isInterGraph&&null==t.getChild()){if(a.PURE_INCREMENTAL){var o=t.getEdges()[0].getOtherEnd(t),h=new d(t.getCenterX()-o.getCenterX(),t.getCenterY()-o.getCenterY());s.push([t,t.getEdges()[0],t.getOwner(),h])}else s.push([t,t.getEdges()[0],t.getOwner()]);n=!0}if(1==n){for(var f=[],u=0;u<s.length;u++)1==s[u][0].getEdges().length&&(f.push(s[u]),s[u][0].getOwner().remove(s[u][0]));i.push(f),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=i},M.prototype.growTree=function(t){for(var i,n=t[t.length-1],r=0;r<n.length;r++)i=n[r],this.findPlaceforPrunedNode(i),i[2].add(i[0]),i[2].add(i[1],i[1].source,i[1].target);t.splice(t.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},M.prototype.findPlaceforPrunedNode=function(t){var i,n,r=t[0];if(n=r==t[1].source?t[1].target:t[1].source,a.PURE_INCREMENTAL)r.setCenter(n.getCenterX()+t[3].getWidth(),n.getCenterY()+t[3].getHeight());else{var s=n.startX,e=n.finishX,o=n.startY,h=n.finishY,f=[0,0,0,0];if(o>0)for(var c=s;c<=e;c++)f[0]+=this.grid[c][o-1].length+this.grid[c][o].length-1;if(e<this.grid.length-1)for(c=o;c<=h;c++)f[1]+=this.grid[e+1][c].length+this.grid[e][c].length-1;if(h<this.grid[0].length-1)for(c=s;c<=e;c++)f[2]+=this.grid[c][h+1].length+this.grid[c][h].length-1;if(s>0)for(c=o;c<=h;c++)f[3]+=this.grid[s-1][c].length+this.grid[s][c].length-1;for(var l,v,d=p.MAX_VALUE,y=0;y<f.length;y++)f[y]<d?(d=f[y],l=1,v=y):f[y]==d&&l++;if(3==l&&0==d)0==f[0]&&0==f[1]&&0==f[2]?i=1:0==f[0]&&0==f[1]&&0==f[3]?i=0:0==f[0]&&0==f[2]&&0==f[3]?i=3:0==f[1]&&0==f[2]&&0==f[3]&&(i=2);else if(2==l&&0==d){var w=Math.floor(2*Math.random());i=0==f[0]&&0==f[1]?0==w?0:1:0==f[0]&&0==f[2]?0==w?0:2:0==f[0]&&0==f[3]?0==w?0:3:0==f[1]&&0==f[2]?0==w?1:2:0==f[1]&&0==f[3]?0==w?1:3:0==w?2:3}else i=4==l&&0==d?w=Math.floor(4*Math.random()):v;0==i?r.setCenter(n.getCenterX(),n.getCenterY()-n.getHeight()/2-u.DEFAULT_EDGE_LENGTH-r.getHeight()/2):1==i?r.setCenter(n.getCenterX()+n.getWidth()/2+u.DEFAULT_EDGE_LENGTH+r.getWidth()/2,n.getCenterY()):2==i?r.setCenter(n.getCenterX(),n.getCenterY()+n.getHeight()/2+u.DEFAULT_EDGE_LENGTH+r.getHeight()/2):r.setCenter(n.getCenterX()-n.getWidth()/2-u.DEFAULT_EDGE_LENGTH-r.getWidth()/2,n.getCenterY())}},t.exports=M},991:(t,i,n)=>{var r=n(551).FDLayoutNode,s=n(551).IMath;function e(t,i,n,s){r.call(this,t,i,n,s)}for(var o in e.prototype=Object.create(r.prototype),r)e[o]=r[o];e.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*s.sign(this.displacementX)),Math.abs(this.displacementY)>t.coolingFactor*t.maxNodeDisplacement&&(this.displacementY=t.coolingFactor*t.maxNodeDisplacement*s.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},e.prototype.propogateDisplacementToChildren=function(t,i){for(var n,r=this.getChild().getNodes(),s=0;s<r.length;s++)null==(n=r[s]).getChild()?(n.displacementX+=t,n.displacementY+=i):n.propogateDisplacementToChildren(t,i)},e.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},e.prototype.setPred1=function(t){this.pred1=t},e.prototype.getPred1=function(){return pred1},e.prototype.getPred2=function(){return pred2},e.prototype.setNext=function(t){this.next=t},e.prototype.getNext=function(){return next},e.prototype.setProcessed=function(t){this.processed=t},e.prototype.isProcessed=function(){return processed},t.exports=e},902:(t,i,n)=>{function r(t){if(Array.isArray(t)){for(var i=0,n=Array(t.length);i<t.length;i++)n[i]=t[i];return n}return Array.from(t)}var s=n(806),e=n(551).LinkedList,o=n(551).Matrix,h=n(551).SVD;function a(){}a.handleConstraints=function(t){var i={};i.fixedNodeConstraint=t.constraints.fixedNodeConstraint,i.alignmentConstraint=t.constraints.alignmentConstraint,i.relativePlacementConstraint=t.constraints.relativePlacementConstraint;for(var n=new Map,a=new Map,f=[],u=[],c=t.getAllNodes(),l=0,v=0;v<c.length;v++){var d=c[v];null==d.getChild()&&(a.set(d.id,l++),f.push(d.getCenterX()),u.push(d.getCenterY()),n.set(d.id,d))}i.relativePlacementConstraint&&i.relativePlacementConstraint.forEach(function(t){t.gap||0==t.gap||(t.left?t.gap=s.DEFAULT_EDGE_LENGTH+n.get(t.left).getWidth()/2+n.get(t.right).getWidth()/2:t.gap=s.DEFAULT_EDGE_LENGTH+n.get(t.top).getHeight()/2+n.get(t.bottom).getHeight()/2)});var y=function(t){var i=0,n=0;return t.forEach(function(t){i+=f[a.get(t)],n+=u[a.get(t)]}),{x:i/t.size,y:n/t.size}},p=function(t,i,n,s,o){var h=new Map;t.forEach(function(t,i){h.set(i,0)}),t.forEach(function(t,i){t.forEach(function(t){h.set(t.id,h.get(t.id)+1)})});var c=new Map,l=new Map,v=new e;h.forEach(function(t,r){0==t?(v.push(r),n||("horizontal"==i?c.set(r,a.has(r)?f[a.get(r)]:s.get(r)):c.set(r,a.has(r)?u[a.get(r)]:s.get(r)))):c.set(r,Number.NEGATIVE_INFINITY),n&&l.set(r,new Set([r]))}),n&&o.forEach(function(t){var r=[];if(t.forEach(function(t){n.has(t)&&r.push(t)}),r.length>0){var e=0;r.forEach(function(t){"horizontal"==i?(c.set(t,a.has(t)?f[a.get(t)]:s.get(t)),e+=c.get(t)):(c.set(t,a.has(t)?u[a.get(t)]:s.get(t)),e+=c.get(t))}),e/=r.length,t.forEach(function(t){n.has(t)||c.set(t,e)})}else{var o=0;t.forEach(function(t){o+="horizontal"==i?a.has(t)?f[a.get(t)]:s.get(t):a.has(t)?u[a.get(t)]:s.get(t)}),o/=t.length,t.forEach(function(t){c.set(t,o)})}});for(var d=function(){var r=v.shift();t.get(r).forEach(function(t){if(c.get(t.id)<c.get(r)+t.gap)if(n&&n.has(t.id)){var e=void 0;if(e="horizontal"==i?a.has(t.id)?f[a.get(t.id)]:s.get(t.id):a.has(t.id)?u[a.get(t.id)]:s.get(t.id),c.set(t.id,e),e<c.get(r)+t.gap){var o=c.get(r)+t.gap-e;l.get(r).forEach(function(t){c.set(t,c.get(t)-o)})}}else c.set(t.id,c.get(r)+t.gap);h.set(t.id,h.get(t.id)-1),0==h.get(t.id)&&v.push(t.id),n&&l.set(t.id,function(t,i){var n=new Set(t),r=!0,s=!1,e=void 0;try{for(var o,h=i[Symbol.iterator]();!(r=(o=h.next()).done);r=!0){var a=o.value;n.add(a)}}catch(f){s=!0,e=f}finally{try{!r&&h.return&&h.return()}finally{if(s)throw e}}return n}(l.get(r),l.get(t.id)))})};0!=v.length;)d();if(n){var y=new Set;t.forEach(function(t,i){0==t.length&&y.add(i)});var p=[];l.forEach(function(t,i){if(y.has(i)){var s=!1,e=!0,o=!1,h=void 0;try{for(var a,f=t[Symbol.iterator]();!(e=(a=f.next()).done);e=!0){var u=a.value;n.has(u)&&(s=!0)}}catch(v){o=!0,h=v}finally{try{!e&&f.return&&f.return()}finally{if(o)throw h}}if(!s){var c=!1,l=void 0;p.forEach(function(i,n){i.has([].concat(r(t))[0])&&(c=!0,l=n)}),c?t.forEach(function(t){p[l].add(t)}):p.push(new Set(t))}}}),p.forEach(function(t,n){var r=Number.POSITIVE_INFINITY,e=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,h=Number.NEGATIVE_INFINITY,l=!0,v=!1,d=void 0;try{for(var y,p=t[Symbol.iterator]();!(l=(y=p.next()).done);l=!0){var w=y.value,g=void 0;g="horizontal"==i?a.has(w)?f[a.get(w)]:s.get(w):a.has(w)?u[a.get(w)]:s.get(w);var m=c.get(w);g<r&&(r=g),g>o&&(o=g),m<e&&(e=m),m>h&&(h=m)}}catch(O){v=!0,d=O}finally{try{!l&&p.return&&p.return()}finally{if(v)throw d}}var b=(r+o)/2-(e+h)/2,M=!0,k=!1,x=void 0;try{for(var S,$=t[Symbol.iterator]();!(M=(S=$.next()).done);M=!0){var j=S.value;c.set(j,c.get(j)+b)}}catch(O){k=!0,x=O}finally{try{!M&&$.return&&$.return()}finally{if(k)throw x}}})}return c},w=function(t){var i=0,n=0,r=0,s=0;if(t.forEach(function(t){t.left?f[a.get(t.left)]-f[a.get(t.right)]>=0?i++:n++:u[a.get(t.top)]-u[a.get(t.bottom)]>=0?r++:s++}),i>n&&r>s)for(var e=0;e<a.size;e++)f[e]=-1*f[e],u[e]=-1*u[e];else if(i>n)for(var o=0;o<a.size;o++)f[o]=-1*f[o];else if(r>s)for(var h=0;h<a.size;h++)u[h]=-1*u[h]},g=function(t){var i=[],n=new e,r=new Set,s=0;return t.forEach(function(e,o){if(!r.has(o)){i[s]=[];var h=o;for(n.push(h),r.add(h),i[s].push(h);0!=n.length;)h=n.shift(),t.get(h).forEach(function(t){r.has(t.id)||(n.push(t.id),r.add(t.id),i[s].push(t.id))});s++}}),i},m=function(t){var i=new Map;return t.forEach(function(t,n){i.set(n,[])}),t.forEach(function(t,n){t.forEach(function(t){i.get(n).push(t),i.get(t.id).push({id:n,gap:t.gap,direction:t.direction})})}),i},b=function(t){var i=new Map;return t.forEach(function(t,n){i.set(n,[])}),t.forEach(function(t,n){t.forEach(function(t){i.get(t.id).push({id:n,gap:t.gap,direction:t.direction})})}),i},M=[],k=[],x=!1,S=!1,$=new Set,j=new Map,O=new Map,A=[];if(i.fixedNodeConstraint&&i.fixedNodeConstraint.forEach(function(t){$.add(t.nodeId)}),i.relativePlacementConstraint&&(i.relativePlacementConstraint.forEach(function(t){t.left?(j.has(t.left)?j.get(t.left).push({id:t.right,gap:t.gap,direction:"horizontal"}):j.set(t.left,[{id:t.right,gap:t.gap,direction:"horizontal"}]),j.has(t.right)||j.set(t.right,[])):(j.has(t.top)?j.get(t.top).push({id:t.bottom,gap:t.gap,direction:"vertical"}):j.set(t.top,[{id:t.bottom,gap:t.gap,direction:"vertical"}]),j.has(t.bottom)||j.set(t.bottom,[]))}),O=m(j),A=g(O)),s.TRANSFORM_ON_CONSTRAINT_HANDLING){if(i.fixedNodeConstraint&&i.fixedNodeConstraint.length>1)i.fixedNodeConstraint.forEach(function(t,i){M[i]=[t.position.x,t.position.y],k[i]=[f[a.get(t.nodeId)],u[a.get(t.nodeId)]]}),x=!0;else if(i.alignmentConstraint)!function(){var t=0;if(i.alignmentConstraint.vertical){for(var n=i.alignmentConstraint.vertical,s=function(i){var s=new Set;n[i].forEach(function(t){s.add(t)});var e=new Set([].concat(r(s)).filter(function(t){return $.has(t)})),o=void 0;o=e.size>0?f[a.get(e.values().next().value)]:y(s).x,n[i].forEach(function(i){M[t]=[o,u[a.get(i)]],k[t]=[f[a.get(i)],u[a.get(i)]],t++})},e=0;e<n.length;e++)s(e);x=!0}if(i.alignmentConstraint.horizontal){for(var o=i.alignmentConstraint.horizontal,h=function(i){var n=new Set;o[i].forEach(function(t){n.add(t)});var s=new Set([].concat(r(n)).filter(function(t){return $.has(t)})),e=void 0;e=s.size>0?f[a.get(s.values().next().value)]:y(n).y,o[i].forEach(function(i){M[t]=[f[a.get(i)],e],k[t]=[f[a.get(i)],u[a.get(i)]],t++})},c=0;c<o.length;c++)h(c);x=!0}i.relativePlacementConstraint&&(S=!0)}();else if(i.relativePlacementConstraint){for(var T=0,I=0,E=0;E<A.length;E++)A[E].length>T&&(T=A[E].length,I=E);if(T<O.size/2)w(i.relativePlacementConstraint),x=!1,S=!1;else{var L=new Map,D=new Map,N=[];A[I].forEach(function(t){j.get(t).forEach(function(i){"horizontal"==i.direction?(L.has(t)?L.get(t).push(i):L.set(t,[i]),L.has(i.id)||L.set(i.id,[]),N.push({left:t,right:i.id})):(D.has(t)?D.get(t).push(i):D.set(t,[i]),D.has(i.id)||D.set(i.id,[]),N.push({top:t,bottom:i.id}))})}),w(N),S=!1;var z=p(L,"horizontal"),B=p(D,"vertical");A[I].forEach(function(t,i){k[i]=[f[a.get(t)],u[a.get(t)]],M[i]=[],z.has(t)?M[i][0]=z.get(t):M[i][0]=f[a.get(t)],B.has(t)?M[i][1]=B.get(t):M[i][1]=u[a.get(t)]}),x=!0}}if(x){for(var C,P=o.transpose(M),R=o.transpose(k),G=0;G<P.length;G++)P[G]=o.multGamma(P[G]),R[G]=o.multGamma(R[G]);var q=o.multMat(P,o.transpose(R)),F=h.svd(q);C=o.multMat(F.V,o.transpose(F.U));for(var X=0;X<a.size;X++){var Y=[f[X],u[X]],_=[C[0][0],C[1][0]],H=[C[0][1],C[1][1]];f[X]=o.dotProduct(Y,_),u[X]=o.dotProduct(Y,H)}S&&w(i.relativePlacementConstraint)}}if(s.ENFORCE_CONSTRAINTS){if(i.fixedNodeConstraint&&i.fixedNodeConstraint.length>0){var Z={x:0,y:0};i.fixedNodeConstraint.forEach(function(t,i){var n,r,s={x:f[a.get(t.nodeId)],y:u[a.get(t.nodeId)]},e=t.position,o=(r=s,{x:(n=e).x-r.x,y:n.y-r.y});Z.x+=o.x,Z.y+=o.y}),Z.x/=i.fixedNodeConstraint.length,Z.y/=i.fixedNodeConstraint.length,f.forEach(function(t,i){f[i]+=Z.x}),u.forEach(function(t,i){u[i]+=Z.y}),i.fixedNodeConstraint.forEach(function(t){f[a.get(t.nodeId)]=t.position.x,u[a.get(t.nodeId)]=t.position.y})}if(i.alignmentConstraint){if(i.alignmentConstraint.vertical)for(var J=i.alignmentConstraint.vertical,V=function(t){var i=new Set;J[t].forEach(function(t){i.add(t)});var n=new Set([].concat(r(i)).filter(function(t){return $.has(t)})),s=void 0;s=n.size>0?f[a.get(n.values().next().value)]:y(i).x,i.forEach(function(t){$.has(t)||(f[a.get(t)]=s)})},W=0;W<J.length;W++)V(W);if(i.alignmentConstraint.horizontal)for(var U=i.alignmentConstraint.horizontal,K=function(t){var i=new Set;U[t].forEach(function(t){i.add(t)});var n=new Set([].concat(r(i)).filter(function(t){return $.has(t)})),s=void 0;s=n.size>0?u[a.get(n.values().next().value)]:y(i).y,i.forEach(function(t){$.has(t)||(u[a.get(t)]=s)})},Q=0;Q<U.length;Q++)K(Q)}i.relativePlacementConstraint&&function(){var t=new Map,n=new Map,r=new Map,s=new Map,e=new Map,o=new Map,h=new Set,c=new Set;if($.forEach(function(t){h.add(t),c.add(t)}),i.alignmentConstraint){if(i.alignmentConstraint.vertical)for(var l=i.alignmentConstraint.vertical,v=function(i){r.set("dummy"+i,[]),l[i].forEach(function(n){t.set(n,"dummy"+i),r.get("dummy"+i).push(n),$.has(n)&&h.add("dummy"+i)}),e.set("dummy"+i,f[a.get(l[i][0])])},d=0;d<l.length;d++)v(d);if(i.alignmentConstraint.horizontal)for(var y=i.alignmentConstraint.horizontal,w=function(t){s.set("dummy"+t,[]),y[t].forEach(function(i){n.set(i,"dummy"+t),s.get("dummy"+t).push(i),$.has(i)&&c.add("dummy"+t)}),o.set("dummy"+t,u[a.get(y[t][0])])},M=0;M<y.length;M++)w(M)}var k=new Map,x=new Map,S=function(i){j.get(i).forEach(function(r){var s=void 0,e=void 0;"horizontal"==r.direction?(s=t.get(i)?t.get(i):i,e=t.get(r.id)?{id:t.get(r.id),gap:r.gap,direction:r.direction}:r,k.has(s)?k.get(s).push(e):k.set(s,[e]),k.has(e.id)||k.set(e.id,[])):(s=n.get(i)?n.get(i):i,e=n.get(r.id)?{id:n.get(r.id),gap:r.gap,direction:r.direction}:r,x.has(s)?x.get(s).push(e):x.set(s,[e]),x.has(e.id)||x.set(e.id,[]))})},O=!0,A=!1,T=void 0;try{for(var I,E=j.keys()[Symbol.iterator]();!(O=(I=E.next()).done);O=!0)S(I.value)}catch(tt){A=!0,T=tt}finally{try{!O&&E.return&&E.return()}finally{if(A)throw T}}var L=m(k),D=m(x),N=g(L),z=g(D),B=b(k),C=b(x),P=[],R=[];N.forEach(function(t,i){P[i]=[],t.forEach(function(t){0==B.get(t).length&&P[i].push(t)})}),z.forEach(function(t,i){R[i]=[],t.forEach(function(t){0==C.get(t).length&&R[i].push(t)})});var G=p(k,"horizontal",h,e,P),q=p(x,"vertical",c,o,R),F=function(t){r.get(t)?r.get(t).forEach(function(i){f[a.get(i)]=G.get(t)}):f[a.get(t)]=G.get(t)},X=!0,Y=!1,_=void 0;try{for(var H,Z=G.keys()[Symbol.iterator]();!(X=(H=Z.next()).done);X=!0)F(H.value)}catch(tt){Y=!0,_=tt}finally{try{!X&&Z.return&&Z.return()}finally{if(Y)throw _}}var J=function(t){s.get(t)?s.get(t).forEach(function(i){u[a.get(i)]=q.get(t)}):u[a.get(t)]=q.get(t)},V=!0,W=!1,U=void 0;try{for(var K,Q=q.keys()[Symbol.iterator]();!(V=(K=Q.next()).done);V=!0)J(K.value)}catch(tt){W=!0,U=tt}finally{try{!V&&Q.return&&Q.return()}finally{if(W)throw U}}}()}for(var tt=0;tt<c.length;tt++){var it=c[tt];null==it.getChild()&&it.setCenter(f[a.get(it.id)],u[a.get(it.id)])}},t.exports=a},551:i=>{i.exports=t}},n={},function t(r){var s=n[r];if(void 0!==s)return s.exports;var e=n[r]={exports:{}};return i[r](e,e.exports,t),e.exports}(45);var i,n},T.exports=t(E()));var t}var N,z,B,C;const P=i(N?A.exports:(N=1,A.exports=(z=D(),B={658:t=>{t.exports=null!=Object.assign?Object.assign.bind(Object):function(t){for(var i=arguments.length,n=Array(i>1?i-1:0),r=1;r<i;r++)n[r-1]=arguments[r];return n.forEach(function(i){Object.keys(i).forEach(function(n){return t[n]=i[n]})}),t}},548:(t,i,n)=>{var r=function(){return function(t,i){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,i){var n=[],r=!0,s=!1,e=void 0;try{for(var o,h=t[Symbol.iterator]();!(r=(o=h.next()).done)&&(n.push(o.value),!i||n.length!==i);r=!0);}catch(a){s=!0,e=a}finally{try{!r&&h.return&&h.return()}finally{if(s)throw e}}return n}(t,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),s=n(140).layoutBase.LinkedList,e={getTopMostNodes:function(t){for(var i={},n=0;n<t.length;n++)i[t[n].id()]=!0;return t.filter(function(t,n){"number"==typeof t&&(t=n);for(var r=t.parent()[0];null!=r;){if(i[r.id()])return!1;r=r.parent()[0]}return!0})},connectComponents:function(t,i,n,r){var e=new s,o=new Set,h=[],a=void 0,f=void 0,u=void 0,c=!1,l=1,v=[],d=[],y=function(){var r=t.collection();d.push(r);var s=n[0],y=t.collection();y.merge(s).merge(s.descendants().intersection(i)),h.push(s),y.forEach(function(t){e.push(t),o.add(t),r.merge(t)});for(var p=function(){s=e.shift();var f=t.collection();s.neighborhood().nodes().forEach(function(t){i.intersection(s.edgesWith(t)).length>0&&f.merge(t)});for(var u=0;u<f.length;u++){var c=f[u];null==(a=n.intersection(c.union(c.ancestors())))||o.has(a[0])||a.union(a.descendants()).forEach(function(t){e.push(t),o.add(t),r.merge(t),n.has(t)&&h.push(t)})}};0!=e.length;)p();if(r.forEach(function(t){i.intersection(t.connectedEdges()).forEach(function(t){r.has(t.source())&&r.has(t.target())&&r.merge(t)})}),h.length==n.length&&(c=!0),!c||c&&l>1){f=h[0],u=f.connectedEdges().length,h.forEach(function(t){t.connectedEdges().length<u&&(u=t.connectedEdges().length,f=t)}),v.push(f.id());var w=t.collection();w.merge(h[0]),h.forEach(function(t){w.merge(t)}),h=[],n=n.difference(w),l++}};do{y()}while(!c);return r&&v.length>0&&r.set("dummy"+(r.size+1),v),d},relocateComponent:function(t,i,n){if(!n.fixedNodeConstraint){var s=Number.POSITIVE_INFINITY,e=Number.NEGATIVE_INFINITY,o=Number.POSITIVE_INFINITY,h=Number.NEGATIVE_INFINITY;if("draft"==n.quality){var a=!0,f=!1,u=void 0;try{for(var c,l=i.nodeIndexes[Symbol.iterator]();!(a=(c=l.next()).done);a=!0){var v=c.value,d=r(v,2),y=d[0],p=d[1],w=n.cy.getElementById(y);if(w){var g=w.boundingBox(),m=i.xCoords[p]-g.w/2,b=i.xCoords[p]+g.w/2,M=i.yCoords[p]-g.h/2,k=i.yCoords[p]+g.h/2;m<s&&(s=m),b>e&&(e=b),M<o&&(o=M),k>h&&(h=k)}}}catch(O){f=!0,u=O}finally{try{!a&&l.return&&l.return()}finally{if(f)throw u}}var x=t.x-(e+s)/2,S=t.y-(h+o)/2;i.xCoords=i.xCoords.map(function(t){return t+x}),i.yCoords=i.yCoords.map(function(t){return t+S})}else{Object.keys(i).forEach(function(t){var n=i[t],r=n.getRect().x,a=n.getRect().x+n.getRect().width,f=n.getRect().y,u=n.getRect().y+n.getRect().height;r<s&&(s=r),a>e&&(e=a),f<o&&(o=f),u>h&&(h=u)});var $=t.x-(e+s)/2,j=t.y-(h+o)/2;Object.keys(i).forEach(function(t){var n=i[t];n.setCenter(n.getCenterX()+$,n.getCenterY()+j)})}}},calcBoundingBox:function(t,i,n,r){for(var s=Number.MAX_SAFE_INTEGER,e=Number.MIN_SAFE_INTEGER,o=Number.MAX_SAFE_INTEGER,h=Number.MIN_SAFE_INTEGER,a=void 0,f=void 0,u=void 0,c=void 0,l=t.descendants().not(":parent"),v=l.length,d=0;d<v;d++){var y=l[d];s>(a=i[r.get(y.id())]-y.width()/2)&&(s=a),e<(f=i[r.get(y.id())]+y.width()/2)&&(e=f),o>(u=n[r.get(y.id())]-y.height()/2)&&(o=u),h<(c=n[r.get(y.id())]+y.height()/2)&&(h=c)}var p={};return p.topLeftX=s,p.topLeftY=o,p.width=e-s,p.height=h-o,p},calcParentsWithoutChildren:function(t,i){var n=t.collection();return i.nodes(":parent").forEach(function(t){var i=!1;t.children().forEach(function(t){"none"!=t.css("display")&&(i=!0)}),i||n.merge(t)}),n}};t.exports=e},816:(t,i,n)=>{var r=n(548),s=n(140).CoSELayout,e=n(140).CoSENode,o=n(140).layoutBase.PointD,h=n(140).layoutBase.DimensionD,a=n(140).layoutBase.LayoutConstants,f=n(140).layoutBase.FDLayoutConstants,u=n(140).CoSEConstants;t.exports={coseLayout:function(t,i){var n=t.cy,c=t.eles,l=c.nodes(),v=c.edges(),d=void 0,y=void 0,p=void 0,w={};t.randomize&&(d=i.nodeIndexes,y=i.xCoords,p=i.yCoords);var g=function(t){return"function"==typeof t},m=function(t,i){return g(t)?t(i):t},b=r.calcParentsWithoutChildren(n,c);null!=t.nestingFactor&&(u.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=f.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=t.nestingFactor),null!=t.gravity&&(u.DEFAULT_GRAVITY_STRENGTH=f.DEFAULT_GRAVITY_STRENGTH=t.gravity),null!=t.numIter&&(u.MAX_ITERATIONS=f.MAX_ITERATIONS=t.numIter),null!=t.gravityRange&&(u.DEFAULT_GRAVITY_RANGE_FACTOR=f.DEFAULT_GRAVITY_RANGE_FACTOR=t.gravityRange),null!=t.gravityCompound&&(u.DEFAULT_COMPOUND_GRAVITY_STRENGTH=f.DEFAULT_COMPOUND_GRAVITY_STRENGTH=t.gravityCompound),null!=t.gravityRangeCompound&&(u.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=f.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=t.gravityRangeCompound),null!=t.initialEnergyOnIncremental&&(u.DEFAULT_COOLING_FACTOR_INCREMENTAL=f.DEFAULT_COOLING_FACTOR_INCREMENTAL=t.initialEnergyOnIncremental),null!=t.tilingCompareBy&&(u.TILING_COMPARE_BY=t.tilingCompareBy),"proof"==t.quality?a.QUALITY=2:a.QUALITY=0,u.NODE_DIMENSIONS_INCLUDE_LABELS=f.NODE_DIMENSIONS_INCLUDE_LABELS=a.NODE_DIMENSIONS_INCLUDE_LABELS=t.nodeDimensionsIncludeLabels,u.DEFAULT_INCREMENTAL=f.DEFAULT_INCREMENTAL=a.DEFAULT_INCREMENTAL=!t.randomize,u.ANIMATE=f.ANIMATE=a.ANIMATE=t.animate,u.TILE=t.tile,u.TILING_PADDING_VERTICAL="function"==typeof t.tilingPaddingVertical?t.tilingPaddingVertical.call():t.tilingPaddingVertical,u.TILING_PADDING_HORIZONTAL="function"==typeof t.tilingPaddingHorizontal?t.tilingPaddingHorizontal.call():t.tilingPaddingHorizontal,u.DEFAULT_INCREMENTAL=f.DEFAULT_INCREMENTAL=a.DEFAULT_INCREMENTAL=!0,u.PURE_INCREMENTAL=!t.randomize,a.DEFAULT_UNIFORM_LEAF_NODE_SIZES=t.uniformNodeDimensions,"transformed"==t.step&&(u.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,u.ENFORCE_CONSTRAINTS=!1,u.APPLY_LAYOUT=!1),"enforced"==t.step&&(u.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,u.ENFORCE_CONSTRAINTS=!0,u.APPLY_LAYOUT=!1),"cose"==t.step&&(u.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,u.ENFORCE_CONSTRAINTS=!1,u.APPLY_LAYOUT=!0),"all"==t.step&&(t.randomize?u.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:u.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,u.ENFORCE_CONSTRAINTS=!0,u.APPLY_LAYOUT=!0),t.fixedNodeConstraint||t.alignmentConstraint||t.relativePlacementConstraint?u.TREE_REDUCTION_ON_INCREMENTAL=!1:u.TREE_REDUCTION_ON_INCREMENTAL=!0;var M,k,x=new s,S=x.newGraphManager();return function t(i,n,s,a){for(var f=n.length,u=0;u<f;u++){var c=n[u],l=null;0==c.intersection(b).length&&(l=c.children());var v=void 0,g=c.layoutDimensions({nodeDimensionsIncludeLabels:a.nodeDimensionsIncludeLabels});if(null!=c.outerWidth()&&null!=c.outerHeight())if(a.randomize)if(c.isParent()){var M=r.calcBoundingBox(c,y,p,d);v=0==c.intersection(b).length?i.add(new e(s.graphManager,new o(M.topLeftX,M.topLeftY),new h(M.width,M.height))):i.add(new e(s.graphManager,new o(M.topLeftX,M.topLeftY),new h(parseFloat(g.w),parseFloat(g.h))))}else v=i.add(new e(s.graphManager,new o(y[d.get(c.id())]-g.w/2,p[d.get(c.id())]-g.h/2),new h(parseFloat(g.w),parseFloat(g.h))));else v=i.add(new e(s.graphManager,new o(c.position("x")-g.w/2,c.position("y")-g.h/2),new h(parseFloat(g.w),parseFloat(g.h))));else v=i.add(new e(this.graphManager));v.id=c.data("id"),v.nodeRepulsion=m(a.nodeRepulsion,c),v.paddingLeft=parseInt(c.css("padding")),v.paddingTop=parseInt(c.css("padding")),v.paddingRight=parseInt(c.css("padding")),v.paddingBottom=parseInt(c.css("padding")),a.nodeDimensionsIncludeLabels&&(v.labelWidth=c.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).w,v.labelHeight=c.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).h,v.labelPosVertical=c.css("text-valign"),v.labelPosHorizontal=c.css("text-halign")),w[c.data("id")]=v,isNaN(v.rect.x)&&(v.rect.x=0),isNaN(v.rect.y)&&(v.rect.y=0),null!=l&&l.length>0&&t(s.getGraphManager().add(s.newGraph(),v),l,s,a)}}(S.addRoot(),r.getTopMostNodes(l),x,t),function(i,n,r){for(var s=0,e=0,o=0;o<r.length;o++){var h=r[o],a=w[h.data("source")],c=w[h.data("target")];if(a&&c&&a!==c&&0==a.getEdgesBetween(c).length){var l=n.add(i.newEdge(),a,c);l.id=h.id(),l.idealLength=m(t.idealEdgeLength,h),l.edgeElasticity=m(t.edgeElasticity,h),s+=l.idealLength,e++}}null!=t.idealEdgeLength&&(e>0?u.DEFAULT_EDGE_LENGTH=f.DEFAULT_EDGE_LENGTH=s/e:g(t.idealEdgeLength)?u.DEFAULT_EDGE_LENGTH=f.DEFAULT_EDGE_LENGTH=50:u.DEFAULT_EDGE_LENGTH=f.DEFAULT_EDGE_LENGTH=t.idealEdgeLength,u.MIN_REPULSION_DIST=f.MIN_REPULSION_DIST=f.DEFAULT_EDGE_LENGTH/10,u.DEFAULT_RADIAL_SEPARATION=f.DEFAULT_EDGE_LENGTH)}(x,S,v),M=x,(k=t).fixedNodeConstraint&&(M.constraints.fixedNodeConstraint=k.fixedNodeConstraint),k.alignmentConstraint&&(M.constraints.alignmentConstraint=k.alignmentConstraint),k.relativePlacementConstraint&&(M.constraints.relativePlacementConstraint=k.relativePlacementConstraint),x.runLayout(),w}}},212:(t,i,n)=>{var r=function(){function t(t,i){for(var n=0;n<i.length;n++){var r=i[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(i,n,r){return n&&t(i.prototype,n),r&&t(i,r),i}}(),s=n(658),e=n(548),o=n(657).spectralLayout,h=n(816).coseLayout,a=Object.freeze({quality:"default",randomize:!0,animate:!0,animationDuration:1e3,animationEasing:void 0,fit:!0,padding:30,nodeDimensionsIncludeLabels:!1,uniformNodeDimensions:!1,packComponents:!0,step:"all",samplingType:!0,sampleSize:25,nodeSeparation:75,piTol:1e-7,nodeRepulsion:function(t){return 4500},idealEdgeLength:function(t){return 50},edgeElasticity:function(t){return.45},nestingFactor:.1,gravity:.25,numIter:2500,tile:!0,tilingCompareBy:void 0,tilingPaddingVertical:10,tilingPaddingHorizontal:10,gravityRangeCompound:1.5,gravityCompound:1,gravityRange:3.8,initialEnergyOnIncremental:.3,fixedNodeConstraint:void 0,alignmentConstraint:void 0,relativePlacementConstraint:void 0,ready:function(){},stop:function(){}}),f=function(){function t(i){!function(t,i){if(!(t instanceof i))throw new TypeError("Cannot call a class as a function")}(this,t),this.options=s({},a,i)}return r(t,[{key:"run",value:function(){var t=this.options,i=t.cy,n=t.eles,r=[],s=[],a=void 0,f=[];!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 u=void 0,c=!1;if(i.layoutUtilities&&t.packComponents&&((u=i.layoutUtilities("get"))||(u=i.layoutUtilities()),c=!0),n.nodes().length>0)if(c){var l=e.getTopMostNodes(t.eles.nodes());if((a=e.connectComponents(i,t.eles,l)).forEach(function(t){var i=t.boundingBox();f.push({x:i.x1+i.w/2,y:i.y1+i.h/2})}),t.randomize&&a.forEach(function(i){t.eles=i,r.push(o(t))}),"default"==t.quality||"proof"==t.quality){var v=i.collection();if(t.tile){var d=0,y={nodeIndexes:new Map,xCoords:[],yCoords:[]},p=[];if(a.forEach(function(t,i){0==t.edges().length&&(t.nodes().forEach(function(i,n){v.merge(t.nodes()[n]),i.isParent()||(y.nodeIndexes.set(t.nodes()[n].id(),d++),y.xCoords.push(t.nodes()[0].position().x),y.yCoords.push(t.nodes()[0].position().y))}),p.push(i))}),v.length>1){var w=v.boundingBox();f.push({x:w.x1+w.w/2,y:w.y1+w.h/2}),a.push(v),r.push(y);for(var g=p.length-1;g>=0;g--)a.splice(p[g],1),r.splice(p[g],1),f.splice(p[g],1)}}a.forEach(function(i,n){t.eles=i,s.push(h(t,r[n])),e.relocateComponent(f[n],s[n],t)})}else a.forEach(function(i,n){e.relocateComponent(f[n],r[n],t)});var m=new Set;if(a.length>1){var b=[],M=n.filter(function(t){return"none"==t.css("display")});a.forEach(function(i,n){var o=void 0;if("draft"==t.quality&&(o=r[n].nodeIndexes),i.nodes().not(M).length>0){var h={edges:[],nodes:[]},a=void 0;i.nodes().not(M).forEach(function(i){if("draft"==t.quality)if(i.isParent()){var f=e.calcBoundingBox(i,r[n].xCoords,r[n].yCoords,o);h.nodes.push({x:f.topLeftX,y:f.topLeftY,width:f.width,height:f.height})}else a=o.get(i.id()),h.nodes.push({x:r[n].xCoords[a]-i.boundingbox().w/2,y:r[n].yCoords[a]-i.boundingbox().h/2,width:i.boundingbox().w,height:i.boundingbox().h});else s[n][i.id()]&&h.nodes.push({x:s[n][i.id()].getLeft(),y:s[n][i.id()].getTop(),width:s[n][i.id()].getWidth(),height:s[n][i.id()].getHeight()})}),i.edges().forEach(function(i){var a=i.source(),f=i.target();if("none"!=a.css("display")&&"none"!=f.css("display"))if("draft"==t.quality){var u=o.get(a.id()),c=o.get(f.id()),l=[],v=[];if(a.isParent()){var d=e.calcBoundingBox(a,r[n].xCoords,r[n].yCoords,o);l.push(d.topLeftX+d.width/2),l.push(d.topLeftY+d.height/2)}else l.push(r[n].xCoords[u]),l.push(r[n].yCoords[u]);if(f.isParent()){var y=e.calcBoundingBox(f,r[n].xCoords,r[n].yCoords,o);v.push(y.topLeftX+y.width/2),v.push(y.topLeftY+y.height/2)}else v.push(r[n].xCoords[c]),v.push(r[n].yCoords[c]);h.edges.push({startX:l[0],startY:l[1],endX:v[0],endY:v[1]})}else s[n][a.id()]&&s[n][f.id()]&&h.edges.push({startX:s[n][a.id()].getCenterX(),startY:s[n][a.id()].getCenterY(),endX:s[n][f.id()].getCenterX(),endY:s[n][f.id()].getCenterY()})}),h.nodes.length>0&&(b.push(h),m.add(n))}});var k=u.packComponents(b,t.randomize).shifts;if("draft"==t.quality)r.forEach(function(t,i){var n=t.xCoords.map(function(t){return t+k[i].dx}),r=t.yCoords.map(function(t){return t+k[i].dy});t.xCoords=n,t.yCoords=r});else{var x=0;m.forEach(function(t){Object.keys(s[t]).forEach(function(i){var n=s[t][i];n.setCenter(n.getCenterX()+k[x].dx,n.getCenterY()+k[x].dy)}),x++})}}}else{var S=t.eles.boundingBox();if(f.push({x:S.x1+S.w/2,y:S.y1+S.h/2}),t.randomize){var $=o(t);r.push($)}"default"==t.quality||"proof"==t.quality?(s.push(h(t,r[0])),e.relocateComponent(f[0],s[0],t)):e.relocateComponent(f[0],r[0],t)}var j=function(i,n){if("default"==t.quality||"proof"==t.quality){"number"==typeof i&&(i=n);var e=void 0,o=void 0,h=i.data("id");return s.forEach(function(t){h in t&&(e={x:t[h].getRect().getCenterX(),y:t[h].getRect().getCenterY()},o=t[h])}),t.nodeDimensionsIncludeLabels&&(o.labelWidth&&("left"==o.labelPosHorizontal?e.x+=o.labelWidth/2:"right"==o.labelPosHorizontal&&(e.x-=o.labelWidth/2)),o.labelHeight&&("top"==o.labelPosVertical?e.y+=o.labelHeight/2:"bottom"==o.labelPosVertical&&(e.y-=o.labelHeight/2))),null==e&&(e={x:i.position("x"),y:i.position("y")}),{x:e.x,y:e.y}}var a=void 0;return r.forEach(function(t){var n=t.nodeIndexes.get(i.id());null!=n&&(a={x:t.xCoords[n],y:t.yCoords[n]})}),null==a&&(a={x:i.position("x"),y:i.position("y")}),{x:a.x,y:a.y}};if("default"==t.quality||"proof"==t.quality||t.randomize){var O=e.calcParentsWithoutChildren(i,n),A=n.filter(function(t){return"none"==t.css("display")});t.eles=n.not(A),n.nodes().not(":parent").not(A).layoutPositions(this,t,j),O.length>0&&O.forEach(function(t){t.position(j(t))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),t}();t.exports=f},657:(t,i,n)=>{var r=n(548),s=n(140).layoutBase.Matrix,e=n(140).layoutBase.SVD;t.exports={spectralLayout:function(t){var i=t.cy,n=t.eles,o=n.nodes(),h=n.nodes(":parent"),a=new Map,f=new Map,u=new Map,c=[],l=[],v=[],d=[],y=[],p=[],w=[],g=[],m=void 0,b=1e8,M=1e-9,k=t.piTol,x=t.samplingType,S=t.nodeSeparation,$=void 0,j=function(t,i,n){for(var r=[],s=0,e=0,o=0,h=void 0,a=[],u=0,l=1,v=0;v<m;v++)a[v]=b;for(r[e]=t,a[t]=0;e>=s;){o=r[s++];for(var d=c[o],w=0;w<d.length;w++)a[h=f.get(d[w])]==b&&(a[h]=a[o]+1,r[++e]=h);p[o][i]=a[o]*S}if(n){for(var g=0;g<m;g++)p[g][i]<y[g]&&(y[g]=p[g][i]);for(var M=0;M<m;M++)y[M]>u&&(u=y[M],l=M)}return l};r.connectComponents(i,n,r.getTopMostNodes(o),a),h.forEach(function(t){r.connectComponents(i,n,r.getTopMostNodes(t.descendants().intersection(n)),a)});for(var O=0,A=0;A<o.length;A++)o[A].isParent()||f.set(o[A].id(),O++);var T=!0,I=!1,E=void 0;try{for(var L,D=a.keys()[Symbol.iterator]();!(T=(L=D.next()).done);T=!0){var N=L.value;f.set(N,O++)}}catch(W){I=!0,E=W}finally{try{!T&&D.return&&D.return()}finally{if(I)throw E}}for(var z=0;z<f.size;z++)c[z]=[];h.forEach(function(t){for(var i=t.children().intersection(n);0==i.nodes(":childless").length;)i=i.nodes()[0].children().intersection(n);var r=0,s=i.nodes(":childless")[0].connectedEdges().length;i.nodes(":childless").forEach(function(t,i){t.connectedEdges().length<s&&(s=t.connectedEdges().length,r=i)}),u.set(t.id(),i.nodes(":childless")[r].id())}),o.forEach(function(t){var i=void 0;i=t.isParent()?f.get(u.get(t.id())):f.get(t.id()),t.neighborhood().nodes().forEach(function(r){n.intersection(t.edgesWith(r)).length>0&&(r.isParent()?c[i].push(u.get(r.id())):c[i].push(r.id()))})});var B=function(t){var n=f.get(t),r=void 0;a.get(t).forEach(function(s){r=i.getElementById(s).isParent()?u.get(s):s,c[n].push(r),c[f.get(r)].push(t)})},C=!0,P=!1,R=void 0;try{for(var G,q=a.keys()[Symbol.iterator]();!(C=(G=q.next()).done);C=!0)B(G.value)}catch(W){P=!0,R=W}finally{try{!C&&q.return&&q.return()}finally{if(P)throw R}}var F=void 0;if((m=f.size)>2){$=m<t.sampleSize?m:t.sampleSize;for(var X=0;X<m;X++)p[X]=[];for(var Y=0;Y<$;Y++)g[Y]=[];return"draft"==t.quality||"all"==t.step?(function(t){var i=void 0;if(t){i=Math.floor(Math.random()*m);for(var n=0;n<m;n++)y[n]=b;for(var r=0;r<$;r++)d[r]=i,i=j(i,r,t)}else{!function(){for(var t=0,i=0,n=!1;i<$;){t=Math.floor(Math.random()*m),n=!1;for(var r=0;r<i;r++)if(d[r]==t){n=!0;break}n||(d[i]=t,i++)}}();for(var s=0;s<$;s++)j(d[s],s,t)}for(var e=0;e<m;e++)for(var o=0;o<$;o++)p[e][o]*=p[e][o];for(var h=0;h<$;h++)w[h]=[];for(var a=0;a<$;a++)for(var f=0;f<$;f++)w[a][f]=p[d[f]][a]}(x),function(){for(var t=e.svd(w),i=t.S,n=t.U,r=t.V,o=i[0]*i[0]*i[0],h=[],a=0;a<$;a++){h[a]=[];for(var f=0;f<$;f++)h[a][f]=0,a==f&&(h[a][f]=i[a]/(i[a]*i[a]+o/(i[a]*i[a])))}g=s.multMat(s.multMat(r,h),s.transpose(n))}(),function(){for(var t=void 0,i=void 0,n=[],r=[],e=[],o=[],h=0;h<m;h++)n[h]=Math.random(),r[h]=Math.random();n=s.normalize(n),r=s.normalize(r);for(var a=M,f=M,u=void 0;;){for(var c=0;c<m;c++)e[c]=n[c];if(n=s.multGamma(s.multL(s.multGamma(e),p,g)),t=s.dotProduct(e,n),n=s.normalize(n),a=s.dotProduct(e,n),(u=Math.abs(a/f))<=1+k&&u>=1)break;f=a}for(var d=0;d<m;d++)e[d]=n[d];for(f=M;;){for(var y=0;y<m;y++)o[y]=r[y];if(o=s.minusOp(o,s.multCons(e,s.dotProduct(e,o))),r=s.multGamma(s.multL(s.multGamma(o),p,g)),i=s.dotProduct(o,r),r=s.normalize(r),a=s.dotProduct(o,r),(u=Math.abs(a/f))<=1+k&&u>=1)break;f=a}for(var w=0;w<m;w++)o[w]=r[w];l=s.multCons(e,Math.sqrt(Math.abs(t))),v=s.multCons(o,Math.sqrt(Math.abs(i)))}(),F={nodeIndexes:f,xCoords:l,yCoords:v}):(f.forEach(function(t,n){l.push(i.getElementById(n).position("x")),v.push(i.getElementById(n).position("y"))}),F={nodeIndexes:f,xCoords:l,yCoords:v}),F}var _=f.keys(),H=i.getElementById(_.next().value),Z=H.position(),J=H.outerWidth();if(l.push(Z.x),v.push(Z.y),2==m){var V=i.getElementById(_.next().value).outerWidth();l.push(Z.x+J/2+V/2+t.idealEdgeLength),v.push(Z.y)}return F={nodeIndexes:f,xCoords:l,yCoords:v}}}},579:(t,i,n)=>{var r=n(212),s=function(t){t&&t("layout","fcose",r)};"undefined"!=typeof cytoscape&&s(cytoscape),t.exports=s},140:t=>{t.exports=z}},C={},function t(i){var n=C[i];if(void 0!==n)return n.exports;var r=C[i]={exports:{}};return B[i](r,r.exports,t),r.exports}(579))));var R={L:"left",R:"right",T:"top",B:"bottom"},G={L:n(t=>`${t},${t/2} 0,${t} 0,0`,"L"),R:n(t=>`0,${t/2} ${t},0 ${t},${t}`,"R"),T:n(t=>`0,0 ${t},0 ${t/2},${t}`,"T"),B:n(t=>`${t/2},0 ${t},${t} 0,${t}`,"B")},q={L:n((t,i)=>t-i+2,"L"),R:n((t,i)=>t-2,"R"),T:n((t,i)=>t-i+2,"T"),B:n((t,i)=>t-2,"B")},F=n(function(t){return Y(t)?"L"===t?"R":"L":"T"===t?"B":"T"},"getOppositeArchitectureDirection"),X=n(function(t){return"L"===t||"R"===t||"T"===t||"B"===t},"isArchitectureDirection"),Y=n(function(t){return"L"===t||"R"===t},"isArchitectureDirectionX"),_=n(function(t){return"T"===t||"B"===t},"isArchitectureDirectionY"),H=n(function(t,i){const n=Y(t)&&_(i),r=_(t)&&Y(i);return n||r},"isArchitectureDirectionXY"),Z=n(function(t){const i=t[0],n=t[1],r=Y(i)&&_(n),s=_(i)&&Y(n);return r||s},"isArchitecturePairXY"),J=n(function(t){return"LL"!==t&&"RR"!==t&&"TT"!==t&&"BB"!==t},"isValidArchitectureDirectionPair"),V=n(function(t,i){const n=`${t}${i}`;return J(n)?n:void 0},"getArchitectureDirectionPair"),W=n(function([t,i],n){const r=n[0],s=n[1];return Y(r)?_(s)?[t+("L"===r?-1:1),i+("T"===s?1:-1)]:[t+("L"===r?-1:1),i]:Y(s)?[t+("L"===s?1:-1),i+("T"===r?1:-1)]:[t,i+("T"===r?1:-1)]},"shiftPositionByArchitectureDirectionPair"),U=n(function(t){return"LT"===t||"TL"===t?[1,1]:"BL"===t||"LB"===t?[1,-1]:"BR"===t||"RB"===t?[-1,-1]:[-1,1]},"getArchitectureDirectionXYFactors"),K=n(function(t,i){return H(t,i)?"bend":Y(t)?"horizontal":"vertical"},"getArchitectureDirectionAlignment"),Q=n(function(t){return"service"===t.type},"isArchitectureService"),tt=n(function(t){return"junction"===t.type},"isArchitectureJunction"),it=n(t=>t.data(),"edgeData"),nt=n(t=>t.data(),"nodeData"),rt=d.architecture,st=(n(t=class{constructor(){this.nodes={},this.groups={},this.edges=[],this.registeredIds={},this.elements={},this.setAccTitle=o,this.getAccTitle=h,this.setDiagramTitle=a,this.getDiagramTitle=f,this.getAccDescription=u,this.setAccDescription=c,this.clear()}clear(){this.nodes={},this.groups={},this.edges=[],this.registeredIds={},this.dataStructures=void 0,this.elements={},l()}addService({id:t,icon:i,in:n,title:r,iconText:s}){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!==n){if(t===n)throw new Error(`The service [${t}] cannot be placed within itself`);if(void 0===this.registeredIds[n])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[n])throw new Error(`The service [${t}]'s parent is not a group`)}this.registeredIds[t]="node",this.nodes[t]={id:t,type:"service",icon:i,iconText:s,title:r,edges:[],in:n}}getServices(){return Object.values(this.nodes).filter(Q)}addJunction({id:t,in:i}){this.registeredIds[t]="node",this.nodes[t]={id:t,type:"junction",edges:[],in:i}}getJunctions(){return Object.values(this.nodes).filter(tt)}getNodes(){return Object.values(this.nodes)}getNode(t){return this.nodes[t]??null}addGroup({id:t,icon:i,in:n,title:r}){var s,e,o;if(void 0!==(null==(s=this.registeredIds)?void 0:s[t]))throw new Error(`The group id [${t}] is already in use by another ${this.registeredIds[t]}`);if(void 0!==n){if(t===n)throw new Error(`The group [${t}] cannot be placed within itself`);if(void 0===(null==(e=this.registeredIds)?void 0:e[n]))throw new Error(`The group [${t}]'s parent does not exist. Please make sure the parent is created before this group`);if("node"===(null==(o=this.registeredIds)?void 0:o[n]))throw new Error(`The group [${t}]'s parent is not a group`)}this.registeredIds[t]="group",this.groups[t]={id:t,icon:i,title:r,in:n}}getGroups(){return Object.values(this.groups)}addEdge({lhsId:t,rhsId:i,lhsDir:n,rhsDir:r,lhsInto:s,rhsInto:e,lhsGroup:o,rhsGroup:h,title:a}){if(!X(n))throw new Error(`Invalid direction given for left hand side of edge ${t}--${i}. Expected (L,R,T,B) got ${String(n)}`);if(!X(r))throw new Error(`Invalid direction given for right hand side of edge ${t}--${i}. Expected (L,R,T,B) got ${String(r)}`);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[i]&&void 0===this.groups[i])throw new Error(`The right-hand id [${i}] does not yet exist. Please create the service/group before declaring an edge to it.`);const f=this.nodes[t].in,u=this.nodes[i].in;if(o&&f&&u&&f==u)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(h&&f&&u&&f==u)throw new Error(`The right-hand id [${i}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);const c={lhsId:t,lhsDir:n,lhsInto:s,lhsGroup:o,rhsId:i,rhsDir:r,rhsInto:e,rhsGroup:h,title:a};this.edges.push(c),this.nodes[t]&&this.nodes[i]&&(this.nodes[t].edges.push(this.edges[this.edges.length-1]),this.nodes[i].edges.push(this.edges[this.edges.length-1]))}getEdges(){return this.edges}getDataStructures(){if(void 0===this.dataStructures){const t={},i=Object.entries(this.nodes).reduce((i,[n,r])=>(i[n]=r.edges.reduce((i,r)=>{var s,e;const o=null==(s=this.getNode(r.lhsId))?void 0:s.in,h=null==(e=this.getNode(r.rhsId))?void 0:e.in;if(o&&h&&o!==h){const i=K(r.lhsDir,r.rhsDir);"bend"!==i&&(t[o]??(t[o]={}),t[o][h]=i,t[h]??(t[h]={}),t[h][o]=i)}if(r.lhsId===n){const t=V(r.lhsDir,r.rhsDir);t&&(i[t]=r.rhsId)}else{const t=V(r.rhsDir,r.lhsDir);t&&(i[t]=r.lhsId)}return i},{}),i),{}),r=Object.keys(i)[0],s={[r]:1},e=Object.keys(i).reduce((t,i)=>i===r?t:{...t,[i]:1},{}),o=n(t=>{const n={[t]:[0,0]},r=[t];for(;r.length>0;){const t=r.shift();if(t){s[t]=1,delete e[t];const o=i[t],[h,a]=n[t];Object.entries(o).forEach(([t,i])=>{s[i]||(n[i]=W([h,a],t),r.push(i))})}}return n},"BFS"),h=[o(r)];for(;Object.keys(e).length>0;)h.push(o(Object.keys(e)[0]));this.dataStructures={adjList:i,spatialMaps:h,groupAlignments:t}}return this.dataStructures}setElementForId(t,i){this.elements[t]=i}getElementById(t){return this.elements[t]}getConfig(){return v({...rt,...y().architecture})}getConfigField(t){return this.getConfig()[t]}},"ArchitectureDB"),t),et=n((t,i)=>{S(t,i),t.groups.map(t=>i.addGroup(t)),t.services.map(t=>i.addService({...t,type:"service"})),t.junctions.map(t=>i.addJunction({...t,type:"junction"})),t.edges.map(t=>i.addEdge(t))},"populateDb"),ot={parser:{yy:void 0},parse:n(async t=>{var i;const n=await $("architecture",t);e.debug(n);const r=null==(i=ot.parser)?void 0:i.yy;if(!(r instanceof st))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.");et(n,r)},"parse")},ht=n(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"),at=n(t=>`<g><rect width="80" height="80" style="fill: #087ebf; stroke-width: 0px;"/>${t}</g>`,"wrapIcon"),ft={prefix:"mermaid-architecture",height:80,width:80,icons:{database:{body:at('<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:at('<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:at('<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:at('<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:at('<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:x,blank:{body:at("")}}},ut=n(async function(t,i,n){const r=n.getConfigField("padding"),s=n.getConfigField("iconSize"),e=s/2,o=s/6,h=o/2;await Promise.all(i.edges().map(async i=>{var s,a;const{source:f,sourceDir:u,sourceArrow:c,sourceGroup:l,target:v,targetDir:d,targetArrow:y,targetGroup:g,label:m}=it(i);let{x:b,y:k}=i[0].sourceEndpoint();const{x:x,y:S}=i[0].midpoint();let{x:$,y:j}=i[0].targetEndpoint();const O=r+4;if(l&&(Y(u)?b+="L"===u?-O:O:k+="T"===u?-O:O+18),g&&(Y(d)?$+="L"===d?-O:O:j+="T"===d?-O:O+18),l||"junction"!==(null==(s=n.getNode(f))?void 0:s.type)||(Y(u)?b+="L"===u?e:-e:k+="T"===u?e:-e),g||"junction"!==(null==(a=n.getNode(v))?void 0:a.type)||(Y(d)?$+="L"===d?e:-e:j+="T"===d?e:-e),i[0].t.rscratch){const i=t.insert("g");if(i.insert("path").attr("d",`M ${b},${k} L ${x},${S} L${$},${j} `).attr("class","edge").attr("id",M(f,v,{prefix:"L"})),c){const t=Y(u)?q[u](b,o):b-h,n=_(u)?q[u](k,o):k-h;i.insert("polygon").attr("points",G[u](o)).attr("transform",`translate(${t},${n})`).attr("class","arrow")}if(y){const t=Y(d)?q[d]($,o):$-h,n=_(d)?q[d](j,o):j-h;i.insert("polygon").attr("points",G[d](o)).attr("transform",`translate(${t},${n})`).attr("class","arrow")}if(m){const t=H(u,d)?"XY":Y(u)?"X":"Y";let n=0;n="X"===t?Math.abs(b-$):"Y"===t?Math.abs(k-j)/1.5:Math.abs(b-$)/2;const r=i.append("g");if(await w(r,m,{useHtmlLabels:!1,width:n,classes:"architecture-service-label"},p()),r.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),"X"===t)r.attr("transform","translate("+x+", "+S+")");else if("Y"===t)r.attr("transform","translate("+x+", "+S+") rotate(-90)");else if("XY"===t){const t=V(u,d);if(t&&Z(t)){const i=r.node().getBoundingClientRect(),[n,s]=U(t);r.attr("dominant-baseline","auto").attr("transform",`rotate(${-1*n*s*45})`);const e=r.node().getBoundingClientRect();r.attr("transform",`\n translate(${x}, ${S-i.height/2})\n translate(${n*e.width/2}, ${s*e.height/2})\n rotate(${-1*n*s*45}, 0, ${i.height/2})\n `)}}}}}))},"drawEdges"),ct=n(async function(t,i,n){const r=.75*n.getConfigField("padding"),s=n.getConfigField("fontSize"),e=n.getConfigField("iconSize")/2;await Promise.all(i.nodes().map(async i=>{const o=nt(i);if("group"===o.type){const{h:h,w:a,x1:f,y1:u}=i.boundingBox(),c=t.append("rect");c.attr("id",`group-${o.id}`).attr("x",f+e).attr("y",u+e).attr("width",a).attr("height",h).attr("class","node-bkg");const l=t.append("g");let v=f,d=u;if(o.icon){const t=l.append("g");t.html(`<g>${await g(o.icon,{height:r,width:r,fallbackPrefix:ft.prefix})}</g>`),t.attr("transform","translate("+(v+e+1)+", "+(d+e+1)+")"),v+=r,d+=s/2-1-2}if(o.label){const t=l.append("g");await w(t,o.label,{useHtmlLabels:!1,width:a,classes:"architecture-service-label"},p()),t.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","start").attr("text-anchor","start"),t.attr("transform","translate("+(v+e+4)+", "+(d+e+2)+")")}n.setElementForId(o.id,c)}}))},"drawGroups"),lt=n(async function(t,i,n){const r=p();for(const s of n){const n=i.append("g"),e=t.getConfigField("iconSize");if(s.title){const t=n.append("g");await w(t,s.title,{useHtmlLabels:!1,width:1.5*e,classes:"architecture-service-label"},r),t.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),t.attr("transform","translate("+e/2+", "+e+")")}const o=n.append("g");if(s.icon)o.html(`<g>${await g(s.icon,{height:e,width:e,fallbackPrefix:ft.prefix})}</g>`);else if(s.iconText){o.html(`<g>${await g("blank",{height:e,width:e,fallbackPrefix:ft.prefix})}</g>`);const t=o.append("g").append("foreignObject").attr("width",e).attr("height",e).append("div").attr("class","node-icon-text").attr("style",`height: ${e}px;`).append("div").html(m(s.iconText,r)),i=parseInt(window.getComputedStyle(t.node(),null).getPropertyValue("font-size").replace(/\D/g,""))??16;t.attr("style",`-webkit-line-clamp: ${Math.floor((e-2)/i)};`)}else o.append("path").attr("class","node-bkg").attr("id","node-"+s.id).attr("d",`M0 ${e} v${-e} q0,-5 5,-5 h${e} q5,0 5,5 v${e} H0 Z`);n.attr("id",`service-${s.id}`).attr("class","architecture-service");const{width:h,height:a}=n.node().getBBox();s.width=h,s.height=a,t.setElementForId(s.id,n)}return 0},"drawServices"),vt=n(function(t,i,n){n.forEach(n=>{const r=i.append("g"),s=t.getConfigField("iconSize");r.append("g").append("rect").attr("id","node-"+n.id).attr("fill-opacity","0").attr("width",s).attr("height",s),r.attr("class","architecture-junction");const{width:e,height:o}=r._groups[0][0].getBBox();r.width=e,r.height=o,t.setElementForId(n.id,r)})},"drawJunctions");function dt(t,i,n){t.forEach(t=>{i.add({group:"nodes",data:{type:"service",id:t.id,icon:t.icon,label:t.title,parent:t.in,width:n.getConfigField("iconSize"),height:n.getConfigField("iconSize")},classes:"node-service"})})}function yt(t,i,n){t.forEach(t=>{i.add({group:"nodes",data:{type:"junction",id:t.id,parent:t.in,width:n.getConfigField("iconSize"),height:n.getConfigField("iconSize")},classes:"node-junction"})})}function pt(t,i){i.nodes().map(i=>{const n=nt(i);if("group"===n.type)return;n.x=i.position().x,n.y=i.position().y;t.getElementById(n.id).attr("transform","translate("+(n.x||0)+","+(n.y||0)+")")})}function wt(t,i){t.forEach(t=>{i.add({group:"nodes",data:{type:"group",id:t.id,icon:t.icon,label:t.title,parent:t.in},classes:"node-group"})})}function gt(t,i){t.forEach(t=>{const{lhsId:n,rhsId:r,lhsInto:s,lhsGroup:e,rhsInto:o,lhsDir:h,rhsDir:a,rhsGroup:f,title:u}=t,c=H(t.lhsDir,t.rhsDir)?"segments":"straight",l={id:`${n}-${r}`,label:u,source:n,sourceDir:h,sourceArrow:s,sourceGroup:e,sourceEndpoint:"L"===h?"0 50%":"R"===h?"100% 50%":"T"===h?"50% 0":"50% 100%",target:r,targetDir:a,targetArrow:o,targetGroup:f,targetEndpoint:"L"===a?"0 50%":"R"===a?"100% 50%":"T"===a?"50% 0":"50% 100%"};i.add({group:"edges",data:l,classes:c})})}function mt(t,i,r){const s=n((t,i)=>Object.entries(t).reduce((t,[n,s])=>{var e;let o=0;const h=Object.entries(s);if(1===h.length)return t[n]=h[0][1],t;for(let a=0;a<h.length-1;a++)for(let s=a+1;s<h.length;s++){const[f,u]=h[a],[c,l]=h[s];if((null==(e=r[f])?void 0:e[c])===i)t[n]??(t[n]=[]),t[n]=[...t[n],...u,...l];else if("default"===f||"default"===c)t[n]??(t[n]=[]),t[n]=[...t[n],...u,...l];else{t[`${n}-${o++}`]=u;t[`${n}-${o++}`]=l}}return t},{}),"flattenAlignments"),e=i.map(i=>{const n={},r={};return Object.entries(i).forEach(([i,[s,e]])=>{var o,h,a;const f=(null==(o=t.getNode(i))?void 0:o.in)??"default";n[e]??(n[e]={}),(h=n[e])[f]??(h[f]=[]),n[e][f].push(i),r[s]??(r[s]={}),(a=r[s])[f]??(a[f]=[]),r[s][f].push(i)}),{horiz:Object.values(s(n,"horizontal")).filter(t=>t.length>1),vert:Object.values(s(r,"vertical")).filter(t=>t.length>1)}}),[o,h]=e.reduce(([t,i],{horiz:n,vert:r})=>[[...t,...n],[...i,...r]],[[],[]]);return{horizontal:o,vertical:h}}function bt(t,i){const r=[],s=n(t=>`${t[0]},${t[1]}`,"posToStr"),e=n(t=>t.split(",").map(t=>parseInt(t)),"strToPos");return t.forEach(t=>{const n=Object.fromEntries(Object.entries(t).map(([t,i])=>[s(i),t])),o=[s([0,0])],h={},a={L:[-1,0],R:[1,0],T:[0,1],B:[0,-1]};for(;o.length>0;){const t=o.shift();if(t){h[t]=1;const f=n[t];if(f){const u=e(t);Object.entries(a).forEach(([t,e])=>{const a=s([u[0]+e[0],u[1]+e[1]]),c=n[a];c&&!h[a]&&(o.push(a),r.push({[R[t]]:c,[R[F(t)]]:f,gap:1.5*i.getConfigField("iconSize")}))})}}}}),r}function Mt(t,i,r,s,o,{spatialMaps:h,groupAlignments:a}){return new Promise(f=>{const u=b("body").append("div").attr("id","cy").attr("style","display:none"),c=j({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":`${o.getConfigField("fontSize")}px`}},{selector:".node-service",style:{label:"data(label)",width:"data(width)",height:"data(height)"}},{selector:".node-junction",style:{width:"data(width)",height:"data(height)"}},{selector:".node-group",style:{padding:`${o.getConfigField("padding")}px`}}],layout:{name:"grid",boundingBox:{x1:0,x2:100,y1:0,y2:100}}});u.remove(),wt(r,c),dt(t,c,o),yt(i,c,o),gt(s,c);const l=mt(o,h,a),v=bt(h,o),d=c.layout({name:"fcose",quality:"proof",styleEnabled:!1,animate:!1,nodeDimensionsIncludeLabels:!1,idealEdgeLength(t){const[i,n]=t.connectedNodes(),{parent:r}=nt(i),{parent:s}=nt(n);return r===s?1.5*o.getConfigField("iconSize"):.5*o.getConfigField("iconSize")},edgeElasticity(t){const[i,n]=t.connectedNodes(),{parent:r}=nt(i),{parent:s}=nt(n);return r===s?.45:.001},alignmentConstraint:l,relativePlacementConstraint:v});d.one("layoutstop",()=>{var t;function i(t,i,n,r){let s,e;const{x:o,y:h}=t,{x:a,y:f}=i;e=(r-h+(o-n)*(h-f)/(o-a))/Math.sqrt(1+Math.pow((h-f)/(o-a),2)),s=Math.sqrt(Math.pow(r-h,2)+Math.pow(n-o,2)-Math.pow(e,2));s/=Math.sqrt(Math.pow(a-o,2)+Math.pow(f-h,2));let u=(a-o)*(r-h)-(f-h)*(n-o);switch(!0){case u>=0:u=1;break;case u<0:u=-1}let c=(a-o)*(n-o)+(f-h)*(r-h);switch(!0){case c>=0:c=1;break;case c<0:c=-1}return e=Math.abs(e)*u,s*=c,{distances:e,weights:s}}n(i,"getSegmentWeights"),c.startBatch();for(const n of Object.values(c.edges()))if(null==(t=n.data)?void 0:t.call(n)){const{x:t,y:r}=n.source().position(),{x:s,y:e}=n.target().position();if(t!==s&&r!==e){const t=n.sourceEndpoint(),r=n.targetEndpoint(),{sourceDir:s}=it(n),[e,o]=_(s)?[t.x,r.y]:[r.x,t.y],{weights:h,distances:a}=i(t,r,e,o);n.style("segment-distances",a),n.style("segment-weights",h)}}c.endBatch(),d.run()}),d.run(),c.ready(t=>{e.info("Ready",t),f(c)})})}k([{name:ft.prefix,icons:ft}]),j.use(P),n(dt,"addServices"),n(yt,"addJunctions"),n(pt,"positionNodes"),n(wt,"addGroups"),n(gt,"addEdges"),n(mt,"getAlignments"),n(bt,"getRelativeConstraints"),n(Mt,"layoutArchitecture");var kt={draw:n(async(t,i,n,e)=>{const o=e.db,h=o.getServices(),a=o.getJunctions(),f=o.getGroups(),u=o.getEdges(),c=o.getDataStructures(),l=r(i),v=l.append("g");v.attr("class","architecture-edges");const d=l.append("g");d.attr("class","architecture-services");const y=l.append("g");y.attr("class","architecture-groups"),await lt(o,d,h),vt(o,d,a);const p=await Mt(h,a,f,u,o,c);await ut(v,p,o),await ct(y,p,o),pt(o,p),s(void 0,l,o.getConfigField("padding"),o.getConfigField("useMaxWidth"))},"draw")},xt={parser:ot,get db(){return new st},renderer:kt,styles:ht};export{xt as diagram};
|
|
1
|
+
var t;import{aG as i,_ as n,H as r,V as s,l as e,b as o,a as h,p as a,q as f,g as u,s as c,y as l,D as v,E as d,F as y,c as p,ak as w,aH as g,i as m,d as b,x as M,aI as k,aJ as x}from"./index-BvMYTiOr.js";import{p as S}from"./chunk-4BX2VUAB-Cay_iY5D.js";import{p as $}from"./treemap-KMMF4GRG-CYbXQA3w.js";import{c as j}from"./cytoscape.esm-Cw0kmstm.js";import"./min-CcGwUInn.js";import"./_baseUniq-O6Fk0Wzr.js";var O,A={exports:{}},T={exports:{}},I={exports:{}};function E(){return O?I.exports:(O=1,t=function(){return function(t){var i={};function n(r){if(i[r])return i[r].exports;var s=i[r]={i:r,l:!1,exports:{}};return t[r].call(s.exports,s,s.exports,n),s.l=!0,s.exports}return n.m=t,n.c=i,n.i=function(t){return t},n.d=function(t,i,r){n.o(t,i)||Object.defineProperty(t,i,{configurable:!1,enumerable:!0,get:r})},n.n=function(t){var i=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(i,"a",i),i},n.o=function(t,i){return Object.prototype.hasOwnProperty.call(t,i)},n.p="",n(n.s=28)}([function(t,i,n){function r(){}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,i,n){var r=n(2),s=n(8),e=n(9);function o(t,i,n){r.call(this,n),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=n,this.bendpoints=[],this.source=t,this.target=i}for(var h in o.prototype=Object.create(r.prototype),r)o[h]=r[h];o.prototype.getSource=function(){return this.source},o.prototype.getTarget=function(){return this.target},o.prototype.isInterGraph=function(){return this.isInterGraph},o.prototype.getLength=function(){return this.length},o.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},o.prototype.getBendpoints=function(){return this.bendpoints},o.prototype.getLca=function(){return this.lca},o.prototype.getSourceInLca=function(){return this.sourceInLca},o.prototype.getTargetInLca=function(){return this.targetInLca},o.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"},o.prototype.getOtherEndInGraph=function(t,i){for(var n=this.getOtherEnd(t),r=i.getGraphManager().getRoot();;){if(n.getOwner()==i)return n;if(n.getOwner()==r)break;n=n.getOwner().getParent()}return null},o.prototype.updateLength=function(){var t=new Array(4);this.isOverlapingSourceAndTarget=s.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=e.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=e.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},o.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=e.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=e.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},t.exports=o},function(t,i,n){t.exports=function(t){this.vGraphObject=t}},function(t,i,n){var r=n(2),s=n(10),e=n(13),o=n(0),h=n(16),a=n(5);function f(t,i,n,o){null==n&&null==o&&(o=i),r.call(this,o),null!=t.graphManager&&(t=t.graphManager),this.estimatedSize=s.MIN_VALUE,this.inclusionTreeDepth=s.MAX_VALUE,this.vGraphObject=o,this.edges=[],this.graphManager=t,this.rect=null!=n&&null!=i?new e(i.x,i.y,n.width,n.height):new e}for(var u in f.prototype=Object.create(r.prototype),r)f[u]=r[u];f.prototype.getEdges=function(){return this.edges},f.prototype.getChild=function(){return this.child},f.prototype.getOwner=function(){return this.owner},f.prototype.getWidth=function(){return this.rect.width},f.prototype.setWidth=function(t){this.rect.width=t},f.prototype.getHeight=function(){return this.rect.height},f.prototype.setHeight=function(t){this.rect.height=t},f.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},f.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},f.prototype.getCenter=function(){return new a(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},f.prototype.getLocation=function(){return new a(this.rect.x,this.rect.y)},f.prototype.getRect=function(){return this.rect},f.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},f.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},f.prototype.setRect=function(t,i){this.rect.x=t.x,this.rect.y=t.y,this.rect.width=i.width,this.rect.height=i.height},f.prototype.setCenter=function(t,i){this.rect.x=t-this.rect.width/2,this.rect.y=i-this.rect.height/2},f.prototype.setLocation=function(t,i){this.rect.x=t,this.rect.y=i},f.prototype.moveBy=function(t,i){this.rect.x+=t,this.rect.y+=i},f.prototype.getEdgeListToNode=function(t){var i=[],n=this;return n.edges.forEach(function(r){if(r.target==t){if(r.source!=n)throw"Incorrect edge source!";i.push(r)}}),i},f.prototype.getEdgesBetween=function(t){var i=[],n=this;return n.edges.forEach(function(r){if(r.source!=n&&r.target!=n)throw"Incorrect edge source and/or target";r.target!=t&&r.source!=t||i.push(r)}),i},f.prototype.getNeighborsList=function(){var t=new Set,i=this;return i.edges.forEach(function(n){if(n.source==i)t.add(n.target);else{if(n.target!=i)throw"Incorrect incidency!";t.add(n.source)}}),t},f.prototype.withChildren=function(){var t=new Set;if(t.add(this),null!=this.child)for(var i=this.child.getNodes(),n=0;n<i.length;n++)i[n].withChildren().forEach(function(i){t.add(i)});return t},f.prototype.getNoOfChildren=function(){var t=0;if(null==this.child)t=1;else for(var i=this.child.getNodes(),n=0;n<i.length;n++)t+=i[n].getNoOfChildren();return 0==t&&(t=1),t},f.prototype.getEstimatedSize=function(){if(this.estimatedSize==s.MIN_VALUE)throw"assert failed";return this.estimatedSize},f.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)},f.prototype.scatter=function(){var t,i,n=-o.INITIAL_WORLD_BOUNDARY,r=o.INITIAL_WORLD_BOUNDARY;t=o.WORLD_CENTER_X+h.nextDouble()*(r-n)+n;var s=-o.INITIAL_WORLD_BOUNDARY,e=o.INITIAL_WORLD_BOUNDARY;i=o.WORLD_CENTER_Y+h.nextDouble()*(e-s)+s,this.rect.x=t,this.rect.y=i},f.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()),o.NODE_DIMENSIONS_INCLUDE_LABELS){var i=t.getRight()-t.getLeft(),n=t.getBottom()-t.getTop();this.labelWidth&&("left"==this.labelPosHorizontal?(this.rect.x-=this.labelWidth,this.setWidth(i+this.labelWidth)):"center"==this.labelPosHorizontal&&this.labelWidth>i?(this.rect.x-=(this.labelWidth-i)/2,this.setWidth(this.labelWidth)):"right"==this.labelPosHorizontal&&this.setWidth(i+this.labelWidth)),this.labelHeight&&("top"==this.labelPosVertical?(this.rect.y-=this.labelHeight,this.setHeight(n+this.labelHeight)):"center"==this.labelPosVertical&&this.labelHeight>n?(this.rect.y-=(this.labelHeight-n)/2,this.setHeight(this.labelHeight)):"bottom"==this.labelPosVertical&&this.setHeight(n+this.labelHeight))}}},f.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==s.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},f.prototype.transform=function(t){var i=this.rect.x;i>o.WORLD_BOUNDARY?i=o.WORLD_BOUNDARY:i<-o.WORLD_BOUNDARY&&(i=-o.WORLD_BOUNDARY);var n=this.rect.y;n>o.WORLD_BOUNDARY?n=o.WORLD_BOUNDARY:n<-o.WORLD_BOUNDARY&&(n=-o.WORLD_BOUNDARY);var r=new a(i,n),s=t.inverseTransformPoint(r);this.setLocation(s.x,s.y)},f.prototype.getLeft=function(){return this.rect.x},f.prototype.getRight=function(){return this.rect.x+this.rect.width},f.prototype.getTop=function(){return this.rect.y},f.prototype.getBottom=function(){return this.rect.y+this.rect.height},f.prototype.getParent=function(){return null==this.owner?null:this.owner.getParent()},t.exports=f},function(t,i,n){var r=n(0);function s(){}for(var e in r)s[e]=r[e];s.MAX_ITERATIONS=2500,s.DEFAULT_EDGE_LENGTH=50,s.DEFAULT_SPRING_STRENGTH=.45,s.DEFAULT_REPULSION_STRENGTH=4500,s.DEFAULT_GRAVITY_STRENGTH=.4,s.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,s.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,s.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,s.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,s.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,s.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,s.COOLING_ADAPTATION_FACTOR=.33,s.ADAPTATION_LOWER_NODE_LIMIT=1e3,s.ADAPTATION_UPPER_NODE_LIMIT=5e3,s.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,s.MAX_NODE_DISPLACEMENT=3*s.MAX_NODE_DISPLACEMENT_INCREMENTAL,s.MIN_REPULSION_DIST=s.DEFAULT_EDGE_LENGTH/10,s.CONVERGENCE_CHECK_PERIOD=100,s.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,s.MIN_EDGE_LENGTH=1,s.GRID_CALCULATION_CHECK_PERIOD=10,t.exports=s},function(t,i,n){function r(t,i){null==t&&null==i?(this.x=0,this.y=0):(this.x=t,this.y=i)}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,i,n){var r=n(2),s=n(10),e=n(0),o=n(7),h=n(3),a=n(1),f=n(13),u=n(12),c=n(11);function l(t,i,n){r.call(this,n),this.estimatedSize=s.MIN_VALUE,this.margin=e.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=t,null!=i&&i instanceof o?this.graphManager=i:null!=i&&i instanceof Layout&&(this.graphManager=i.graphManager)}for(var v in l.prototype=Object.create(r.prototype),r)l[v]=r[v];l.prototype.getNodes=function(){return this.nodes},l.prototype.getEdges=function(){return this.edges},l.prototype.getGraphManager=function(){return this.graphManager},l.prototype.getParent=function(){return this.parent},l.prototype.getLeft=function(){return this.left},l.prototype.getRight=function(){return this.right},l.prototype.getTop=function(){return this.top},l.prototype.getBottom=function(){return this.bottom},l.prototype.isConnected=function(){return this.isConnected},l.prototype.add=function(t,i,n){if(null==i&&null==n){var r=t;if(null==this.graphManager)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(r)>-1)throw"Node already in graph!";return r.owner=this,this.getNodes().push(r),r}var s=t;if(!(this.getNodes().indexOf(i)>-1&&this.getNodes().indexOf(n)>-1))throw"Source or target not in graph!";if(i.owner!=n.owner||i.owner!=this)throw"Both owners must be this graph!";return i.owner!=n.owner?null:(s.source=i,s.target=n,s.isInterGraph=!1,this.getEdges().push(s),i.edges.push(s),n!=i&&n.edges.push(s),s)},l.prototype.remove=function(t){var i=t;if(t instanceof h){if(null==i)throw"Node is null!";if(null==i.owner||i.owner!=this)throw"Owner graph is invalid!";if(null==this.graphManager)throw"Owner graph manager is invalid!";for(var n=i.edges.slice(),r=n.length,s=0;s<r;s++)(e=n[s]).isInterGraph?this.graphManager.remove(e):e.source.owner.remove(e);if(-1==(o=this.nodes.indexOf(i)))throw"Node not in owner node list!";this.nodes.splice(o,1)}else if(t instanceof a){var e;if(null==(e=t))throw"Edge is null!";if(null==e.source||null==e.target)throw"Source and/or target is null!";if(null==e.source.owner||null==e.target.owner||e.source.owner!=this||e.target.owner!=this)throw"Source and/or target owner is invalid!";var o,f=e.source.edges.indexOf(e),u=e.target.edges.indexOf(e);if(!(f>-1&&u>-1))throw"Source and/or target doesn't know this edge!";if(e.source.edges.splice(f,1),e.target!=e.source&&e.target.edges.splice(u,1),-1==(o=e.source.owner.getEdges().indexOf(e)))throw"Not in owner's edge list!";e.source.owner.getEdges().splice(o,1)}},l.prototype.updateLeftTop=function(){for(var t,i,n,r=s.MAX_VALUE,e=s.MAX_VALUE,o=this.getNodes(),h=o.length,a=0;a<h;a++){var f=o[a];r>(t=f.getTop())&&(r=t),e>(i=f.getLeft())&&(e=i)}return r==s.MAX_VALUE?null:(n=null!=o[0].getParent().paddingLeft?o[0].getParent().paddingLeft:this.margin,this.left=e-n,this.top=r-n,new u(this.left,this.top))},l.prototype.updateBounds=function(t){for(var i,n,r,e,o,h=s.MAX_VALUE,a=-s.MAX_VALUE,u=s.MAX_VALUE,c=-s.MAX_VALUE,l=this.nodes,v=l.length,d=0;d<v;d++){var y=l[d];t&&null!=y.child&&y.updateBounds(),h>(i=y.getLeft())&&(h=i),a<(n=y.getRight())&&(a=n),u>(r=y.getTop())&&(u=r),c<(e=y.getBottom())&&(c=e)}var p=new f(h,u,a-h,c-u);h==s.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),o=null!=l[0].getParent().paddingLeft?l[0].getParent().paddingLeft:this.margin,this.left=p.x-o,this.right=p.x+p.width+o,this.top=p.y-o,this.bottom=p.y+p.height+o},l.calculateBounds=function(t){for(var i,n,r,e,o=s.MAX_VALUE,h=-s.MAX_VALUE,a=s.MAX_VALUE,u=-s.MAX_VALUE,c=t.length,l=0;l<c;l++){var v=t[l];o>(i=v.getLeft())&&(o=i),h<(n=v.getRight())&&(h=n),a>(r=v.getTop())&&(a=r),u<(e=v.getBottom())&&(u=e)}return new f(o,a,h-o,u-a)},l.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},l.prototype.getEstimatedSize=function(){if(this.estimatedSize==s.MIN_VALUE)throw"assert failed";return this.estimatedSize},l.prototype.calcEstimatedSize=function(){for(var t=0,i=this.nodes,n=i.length,r=0;r<n;r++)t+=i[r].calcEstimatedSize();return this.estimatedSize=0==t?e.EMPTY_COMPOUND_NODE_SIZE:t/Math.sqrt(this.nodes.length),this.estimatedSize},l.prototype.updateConnected=function(){var t=this;if(0!=this.nodes.length){var i,n,r=new c,s=new Set,e=this.nodes[0];for(e.withChildren().forEach(function(t){r.push(t),s.add(t)});0!==r.length;)for(var o=(i=(e=r.shift()).getEdges()).length,h=0;h<o;h++)null==(n=i[h].getOtherEndInGraph(e,this))||s.has(n)||n.withChildren().forEach(function(t){r.push(t),s.add(t)});if(this.isConnected=!1,s.size>=this.nodes.length){var a=0;s.forEach(function(i){i.owner==t&&a++}),a==this.nodes.length&&(this.isConnected=!0)}}else this.isConnected=!0},t.exports=l},function(t,i,n){var r,s=n(1);function e(t){r=n(6),this.layout=t,this.graphs=[],this.edges=[]}e.prototype.addRoot=function(){var t=this.layout.newGraph(),i=this.layout.newNode(null),n=this.add(t,i);return this.setRootGraph(n),this.rootGraph},e.prototype.add=function(t,i,n,r,s){if(null==n&&null==r&&null==s){if(null==t)throw"Graph is null!";if(null==i)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!=i.child)throw"Already has a child!";return t.parent=i,i.child=t,t}s=n,n=t;var e=(r=i).getOwner(),o=s.getOwner();if(null==e||e.getGraphManager()!=this)throw"Source not in this graph mgr!";if(null==o||o.getGraphManager()!=this)throw"Target not in this graph mgr!";if(e==o)return n.isInterGraph=!1,e.add(n,r,s);if(n.isInterGraph=!0,n.source=r,n.target=s,this.edges.indexOf(n)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(n),null==n.source||null==n.target)throw"Edge source and/or target is null!";if(-1!=n.source.edges.indexOf(n)||-1!=n.target.edges.indexOf(n))throw"Edge already in source and/or target incidency list!";return n.source.edges.push(n),n.target.edges.push(n),n},e.prototype.remove=function(t){if(t instanceof r){var i=t;if(i.getGraphManager()!=this)throw"Graph not in this graph mgr";if(i!=this.rootGraph&&(null==i.parent||i.parent.graphManager!=this))throw"Invalid parent node!";for(var n,e=[],o=(e=e.concat(i.getEdges())).length,h=0;h<o;h++)n=e[h],i.remove(n);var a,f=[];for(o=(f=f.concat(i.getNodes())).length,h=0;h<o;h++)a=f[h],i.remove(a);i==this.rootGraph&&this.setRootGraph(null);var u=this.graphs.indexOf(i);this.graphs.splice(u,1),i.parent=null}else if(t instanceof s){if(null==(n=t))throw"Edge is null!";if(!n.isInterGraph)throw"Not an inter-graph edge!";if(null==n.source||null==n.target)throw"Source and/or target is null!";if(-1==n.source.edges.indexOf(n)||-1==n.target.edges.indexOf(n))throw"Source and/or target doesn't know this edge!";if(u=n.source.edges.indexOf(n),n.source.edges.splice(u,1),u=n.target.edges.indexOf(n),n.target.edges.splice(u,1),null==n.source.owner||null==n.source.owner.getGraphManager())throw"Edge owner graph or owner graph manager is null!";if(-1==n.source.owner.getGraphManager().edges.indexOf(n))throw"Not in owner graph manager's edge list!";u=n.source.owner.getGraphManager().edges.indexOf(n),n.source.owner.getGraphManager().edges.splice(u,1)}},e.prototype.updateBounds=function(){this.rootGraph.updateBounds(!0)},e.prototype.getGraphs=function(){return this.graphs},e.prototype.getAllNodes=function(){if(null==this.allNodes){for(var t=[],i=this.getGraphs(),n=i.length,r=0;r<n;r++)t=t.concat(i[r].getNodes());this.allNodes=t}return this.allNodes},e.prototype.resetAllNodes=function(){this.allNodes=null},e.prototype.resetAllEdges=function(){this.allEdges=null},e.prototype.resetAllNodesToApplyGravitation=function(){this.allNodesToApplyGravitation=null},e.prototype.getAllEdges=function(){if(null==this.allEdges){var t=[],i=this.getGraphs();i.length;for(var n=0;n<i.length;n++)t=t.concat(i[n].getEdges());t=t.concat(this.edges),this.allEdges=t}return this.allEdges},e.prototype.getAllNodesToApplyGravitation=function(){return this.allNodesToApplyGravitation},e.prototype.setAllNodesToApplyGravitation=function(t){if(null!=this.allNodesToApplyGravitation)throw"assert failed";this.allNodesToApplyGravitation=t},e.prototype.getRoot=function(){return this.rootGraph},e.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"))},e.prototype.getLayout=function(){return this.layout},e.prototype.isOneAncestorOfOther=function(t,i){if(null==t||null==i)throw"assert failed";if(t==i)return!0;for(var n,r=t.getOwner();null!=(n=r.getParent());){if(n==i)return!0;if(null==(r=n.getOwner()))break}for(r=i.getOwner();null!=(n=r.getParent());){if(n==t)return!0;if(null==(r=n.getOwner()))break}return!1},e.prototype.calcLowestCommonAncestors=function(){for(var t,i,n,r,s,e=this.getAllEdges(),o=e.length,h=0;h<o;h++)if(i=(t=e[h]).source,n=t.target,t.lca=null,t.sourceInLca=i,t.targetInLca=n,i!=n){for(r=i.getOwner();null==t.lca;){for(t.targetInLca=n,s=n.getOwner();null==t.lca;){if(s==r){t.lca=s;break}if(s==this.rootGraph)break;if(null!=t.lca)throw"assert failed";t.targetInLca=s.getParent(),s=t.targetInLca.getOwner()}if(r==this.rootGraph)break;null==t.lca&&(t.sourceInLca=r.getParent(),r=t.sourceInLca.getOwner())}if(null==t.lca)throw"assert failed"}else t.lca=i.getOwner()},e.prototype.calcLowestCommonAncestor=function(t,i){if(t==i)return t.getOwner();for(var n=t.getOwner();null!=n;){for(var r=i.getOwner();null!=r;){if(r==n)return r;r=r.getParent().getOwner()}n=n.getParent().getOwner()}return n},e.prototype.calcInclusionTreeDepths=function(t,i){var n;null==t&&null==i&&(t=this.rootGraph,i=1);for(var r=t.getNodes(),s=r.length,e=0;e<s;e++)(n=r[e]).inclusionTreeDepth=i,null!=n.child&&this.calcInclusionTreeDepths(n.child,i+1)},e.prototype.includesInvalidEdge=function(){for(var t,i=[],n=this.edges.length,r=0;r<n;r++)t=this.edges[r],this.isOneAncestorOfOther(t.source,t.target)&&i.push(t);for(r=0;r<i.length;r++)this.remove(i[r]);return!1},t.exports=e},function(t,i,n){var r=n(12);function s(){}s.calcSeparationAmount=function(t,i,n,r){if(!t.intersects(i))throw"assert failed";var s=new Array(2);this.decideDirectionsForOverlappingNodes(t,i,s),n[0]=Math.min(t.getRight(),i.getRight())-Math.max(t.x,i.x),n[1]=Math.min(t.getBottom(),i.getBottom())-Math.max(t.y,i.y),t.getX()<=i.getX()&&t.getRight()>=i.getRight()?n[0]+=Math.min(i.getX()-t.getX(),t.getRight()-i.getRight()):i.getX()<=t.getX()&&i.getRight()>=t.getRight()&&(n[0]+=Math.min(t.getX()-i.getX(),i.getRight()-t.getRight())),t.getY()<=i.getY()&&t.getBottom()>=i.getBottom()?n[1]+=Math.min(i.getY()-t.getY(),t.getBottom()-i.getBottom()):i.getY()<=t.getY()&&i.getBottom()>=t.getBottom()&&(n[1]+=Math.min(t.getY()-i.getY(),i.getBottom()-t.getBottom()));var e=Math.abs((i.getCenterY()-t.getCenterY())/(i.getCenterX()-t.getCenterX()));i.getCenterY()===t.getCenterY()&&i.getCenterX()===t.getCenterX()&&(e=1);var o=e*n[0],h=n[1]/e;n[0]<h?h=n[0]:o=n[1],n[0]=-1*s[0]*(h/2+r),n[1]=-1*s[1]*(o/2+r)},s.decideDirectionsForOverlappingNodes=function(t,i,n){t.getCenterX()<i.getCenterX()?n[0]=-1:n[0]=1,t.getCenterY()<i.getCenterY()?n[1]=-1:n[1]=1},s.getIntersection2=function(t,i,n){var r=t.getCenterX(),s=t.getCenterY(),e=i.getCenterX(),o=i.getCenterY();if(t.intersects(i))return n[0]=r,n[1]=s,n[2]=e,n[3]=o,!0;var h=t.getX(),a=t.getY(),f=t.getRight(),u=t.getX(),c=t.getBottom(),l=t.getRight(),v=t.getWidthHalf(),d=t.getHeightHalf(),y=i.getX(),p=i.getY(),w=i.getRight(),g=i.getX(),m=i.getBottom(),b=i.getRight(),M=i.getWidthHalf(),k=i.getHeightHalf(),x=!1,S=!1;if(r===e){if(s>o)return n[0]=r,n[1]=a,n[2]=e,n[3]=m,!1;if(s<o)return n[0]=r,n[1]=c,n[2]=e,n[3]=p,!1}else if(s===o){if(r>e)return n[0]=h,n[1]=s,n[2]=w,n[3]=o,!1;if(r<e)return n[0]=f,n[1]=s,n[2]=y,n[3]=o,!1}else{var $=t.height/t.width,j=i.height/i.width,O=(o-s)/(e-r),A=void 0,T=void 0,I=void 0,E=void 0,L=void 0,D=void 0;if(-$===O?r>e?(n[0]=u,n[1]=c,x=!0):(n[0]=f,n[1]=a,x=!0):$===O&&(r>e?(n[0]=h,n[1]=a,x=!0):(n[0]=l,n[1]=c,x=!0)),-j===O?e>r?(n[2]=g,n[3]=m,S=!0):(n[2]=w,n[3]=p,S=!0):j===O&&(e>r?(n[2]=y,n[3]=p,S=!0):(n[2]=b,n[3]=m,S=!0)),x&&S)return!1;if(r>e?s>o?(A=this.getCardinalDirection($,O,4),T=this.getCardinalDirection(j,O,2)):(A=this.getCardinalDirection(-$,O,3),T=this.getCardinalDirection(-j,O,1)):s>o?(A=this.getCardinalDirection(-$,O,1),T=this.getCardinalDirection(-j,O,3)):(A=this.getCardinalDirection($,O,2),T=this.getCardinalDirection(j,O,4)),!x)switch(A){case 1:E=a,I=r+-d/O,n[0]=I,n[1]=E;break;case 2:I=l,E=s+v*O,n[0]=I,n[1]=E;break;case 3:E=c,I=r+d/O,n[0]=I,n[1]=E;break;case 4:I=u,E=s+-v*O,n[0]=I,n[1]=E}if(!S)switch(T){case 1:D=p,L=e+-k/O,n[2]=L,n[3]=D;break;case 2:L=b,D=o+M*O,n[2]=L,n[3]=D;break;case 3:D=m,L=e+k/O,n[2]=L,n[3]=D;break;case 4:L=g,D=o+-M*O,n[2]=L,n[3]=D}}return!1},s.getCardinalDirection=function(t,i,n){return t>i?n:1+n%4},s.getIntersection=function(t,i,n,s){if(null==s)return this.getIntersection2(t,i,n);var e,o,h,a,f,u,c,l=t.x,v=t.y,d=i.x,y=i.y,p=n.x,w=n.y,g=s.x,m=s.y;return 0===(c=(e=y-v)*(a=p-g)-(o=m-w)*(h=l-d))?null:new r((h*(u=g*w-p*m)-a*(f=d*v-l*y))/c,(o*f-e*u)/c)},s.angleOfVector=function(t,i,n,r){var s=void 0;return t!==n?(s=Math.atan((r-i)/(n-t)),n<t?s+=Math.PI:r<i&&(s+=this.TWO_PI)):s=r<i?this.ONE_AND_HALF_PI:this.HALF_PI,s},s.doIntersect=function(t,i,n,r){var s=t.x,e=t.y,o=i.x,h=i.y,a=n.x,f=n.y,u=r.x,c=r.y,l=(o-s)*(c-f)-(u-a)*(h-e);if(0===l)return!1;var v=((c-f)*(u-s)+(a-u)*(c-e))/l,d=((e-h)*(u-s)+(o-s)*(c-e))/l;return 0<v&&v<1&&0<d&&d<1},s.findCircleLineIntersections=function(t,i,n,r,s,e,o){var h=(n-t)*(n-t)+(r-i)*(r-i),a=2*((t-s)*(n-t)+(i-e)*(r-i)),f=(t-s)*(t-s)+(i-e)*(i-e)-o*o;if(a*a-4*h*f>=0){var u=(-a+Math.sqrt(a*a-4*h*f))/(2*h),c=(-a-Math.sqrt(a*a-4*h*f))/(2*h);return u>=0&&u<=1?[u]:c>=0&&c<=1?[c]:null}return null},s.HALF_PI=.5*Math.PI,s.ONE_AND_HALF_PI=1.5*Math.PI,s.TWO_PI=2*Math.PI,s.THREE_PI=3*Math.PI,t.exports=s},function(t,i,n){function r(){}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,i,n){function r(){}r.MAX_VALUE=2147483647,r.MIN_VALUE=-2147483648,t.exports=r},function(t,i,n){var r=function(){function t(t,i){for(var n=0;n<i.length;n++){var r=i[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(i,n,r){return n&&t(i.prototype,n),r&&t(i,r),i}}(),s=function(t){return{value:t,next:null,prev:null}},e=function(t,i,n,r){return null!==t?t.next=i:r.head=i,null!==n?n.prev=i:r.tail=i,i.prev=t,i.next=n,r.length++,i},o=function(t,i){var n=t.prev,r=t.next;return null!==n?n.next=r:i.head=r,null!==r?r.prev=n:i.tail=n,t.prev=t.next=null,i.length--,t},h=function(){function t(i){var n=this;!function(t,i){if(!(t instanceof i))throw new TypeError("Cannot call a class as a function")}(this,t),this.length=0,this.head=null,this.tail=null,null!=i&&i.forEach(function(t){return n.push(t)})}return r(t,[{key:"size",value:function(){return this.length}},{key:"insertBefore",value:function(t,i){return e(i.prev,s(t),i,this)}},{key:"insertAfter",value:function(t,i){return e(i,s(t),i.next,this)}},{key:"insertNodeBefore",value:function(t,i){return e(i.prev,t,i,this)}},{key:"insertNodeAfter",value:function(t,i){return e(i,t,i.next,this)}},{key:"push",value:function(t){return e(this.tail,s(t),null,this)}},{key:"unshift",value:function(t){return e(null,s(t),this.head,this)}},{key:"remove",value:function(t){return o(t,this)}},{key:"pop",value:function(){return o(this.tail,this).value}},{key:"popNode",value:function(){return o(this.tail,this)}},{key:"shift",value:function(){return o(this.head,this).value}},{key:"shiftNode",value:function(){return o(this.head,this)}},{key:"get_object_at",value:function(t){if(t<=this.length()){for(var i=1,n=this.head;i<t;)n=n.next,i++;return n.value}}},{key:"set_object_at",value:function(t,i){if(t<=this.length()){for(var n=1,r=this.head;n<t;)r=r.next,n++;r.value=i}}}]),t}();t.exports=h},function(t,i,n){function r(t,i,n){this.x=null,this.y=null,null==t&&null==i&&null==n?(this.x=0,this.y=0):"number"==typeof t&&"number"==typeof i&&null==n?(this.x=t,this.y=i):"Point"==t.constructor.name&&null==i&&null==n&&(n=t,this.x=n.x,this.y=n.y)}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,i,n){"Point"==t.constructor.name&&null==i&&null==n?(n=t,this.setLocation(n.x,n.y)):"number"==typeof t&&"number"==typeof i&&null==n&&(parseInt(t)==t&&parseInt(i)==i?this.move(t,i):(this.x=Math.floor(t+.5),this.y=Math.floor(i+.5)))},r.prototype.move=function(t,i){this.x=t,this.y=i},r.prototype.translate=function(t,i){this.x+=t,this.y+=i},r.prototype.equals=function(t){if("Point"==t.constructor.name){var i=t;return this.x==i.x&&this.y==i.y}return this==t},r.prototype.toString=function(){return(new r).constructor.name+"[x="+this.x+",y="+this.y+"]"},t.exports=r},function(t,i,n){function r(t,i,n,r){this.x=0,this.y=0,this.width=0,this.height=0,null!=t&&null!=i&&null!=n&&null!=r&&(this.x=t,this.y=i,this.width=n,this.height=r)}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,i,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 s(){}s.lastID=0,s.createID=function(t){return s.isPrimitive(t)?t:(null!=t.uniqueID||(t.uniqueID=s.getString(),s.lastID++),t.uniqueID)},s.getString=function(t){return null==t&&(t=s.lastID),"Object#"+t},s.isPrimitive=function(t){var i=void 0===t?"undefined":r(t);return null==t||"object"!=i&&"function"!=i},t.exports=s},function(t,i,n){function r(t){if(Array.isArray(t)){for(var i=0,n=Array(t.length);i<t.length;i++)n[i]=t[i];return n}return Array.from(t)}var s=n(0),e=n(7),o=n(3),h=n(1),a=n(6),f=n(5),u=n(17),c=n(29);function l(t){c.call(this),this.layoutQuality=s.QUALITY,this.createBendsAsNeeded=s.DEFAULT_CREATE_BENDS_AS_NEEDED,this.incremental=s.DEFAULT_INCREMENTAL,this.animationOnLayout=s.DEFAULT_ANIMATION_ON_LAYOUT,this.animationDuringLayout=s.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=s.DEFAULT_ANIMATION_PERIOD,this.uniformLeafNodeSizes=s.DEFAULT_UNIFORM_LEAF_NODE_SIZES,this.edgeToDummyNodes=new Map,this.graphManager=new e(this),this.isLayoutFinished=!1,this.isSubLayout=!1,this.isRemoteUse=!1,null!=t&&(this.isRemoteUse=t)}l.RANDOM_SEED=1,l.prototype=Object.create(c.prototype),l.prototype.getGraphManager=function(){return this.graphManager},l.prototype.getAllNodes=function(){return this.graphManager.getAllNodes()},l.prototype.getAllEdges=function(){return this.graphManager.getAllEdges()},l.prototype.getAllNodesToApplyGravitation=function(){return this.graphManager.getAllNodesToApplyGravitation()},l.prototype.newGraphManager=function(){var t=new e(this);return this.graphManager=t,t},l.prototype.newGraph=function(t){return new a(null,this.graphManager,t)},l.prototype.newNode=function(t){return new o(this.graphManager,t)},l.prototype.newEdge=function(t){return new h(null,null,t)},l.prototype.checkLayoutSuccess=function(){return null==this.graphManager.getRoot()||0==this.graphManager.getRoot().getNodes().length||this.graphManager.includesInvalidEdge()},l.prototype.runLayout=function(){var t;return this.isLayoutFinished=!1,this.tilingPreLayout&&this.tilingPreLayout(),this.initParameters(),t=!this.checkLayoutSuccess()&&this.layout(),"during"!==s.ANIMATE&&(t&&(this.isSubLayout||this.doPostLayout()),this.tilingPostLayout&&this.tilingPostLayout(),this.isLayoutFinished=!0,t)},l.prototype.doPostLayout=function(){this.incremental||this.transform(),this.update()},l.prototype.update2=function(){if(this.createBendsAsNeeded&&(this.createBendpointsFromDummyNodes(),this.graphManager.resetAllEdges()),!this.isRemoteUse){for(var t=this.graphManager.getAllEdges(),i=0;i<t.length;i++)t[i];var n=this.graphManager.getRoot().getNodes();for(i=0;i<n.length;i++)n[i];this.update(this.graphManager.getRoot())}},l.prototype.update=function(t){if(null==t)this.update2();else if(t instanceof o){var i=t;if(null!=i.getChild())for(var n=i.getChild().getNodes(),r=0;r<n.length;r++)update(n[r]);null!=i.vGraphObject&&i.vGraphObject.update(i)}else if(t instanceof h){var s=t;null!=s.vGraphObject&&s.vGraphObject.update(s)}else if(t instanceof a){var e=t;null!=e.vGraphObject&&e.vGraphObject.update(e)}},l.prototype.initParameters=function(){this.isSubLayout||(this.layoutQuality=s.QUALITY,this.animationDuringLayout=s.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=s.DEFAULT_ANIMATION_PERIOD,this.animationOnLayout=s.DEFAULT_ANIMATION_ON_LAYOUT,this.incremental=s.DEFAULT_INCREMENTAL,this.createBendsAsNeeded=s.DEFAULT_CREATE_BENDS_AS_NEEDED,this.uniformLeafNodeSizes=s.DEFAULT_UNIFORM_LEAF_NODE_SIZES),this.animationDuringLayout&&(this.animationOnLayout=!1)},l.prototype.transform=function(t){if(null==t)this.transform(new f(0,0));else{var i=new u,n=this.graphManager.getRoot().updateLeftTop();if(null!=n){i.setWorldOrgX(t.x),i.setWorldOrgY(t.y),i.setDeviceOrgX(n.x),i.setDeviceOrgY(n.y);for(var r=this.getAllNodes(),s=0;s<r.length;s++)r[s].transform(i)}}},l.prototype.positionNodesRandomly=function(t){if(null==t)this.positionNodesRandomly(this.getGraphManager().getRoot()),this.getGraphManager().getRoot().updateBounds(!0);else for(var i,n,r=t.getNodes(),s=0;s<r.length;s++)null==(n=(i=r[s]).getChild())||0==n.getNodes().length?i.scatter():(this.positionNodesRandomly(n),i.updateBounds())},l.prototype.getFlatForest=function(){for(var t=[],i=!0,n=this.graphManager.getRoot().getNodes(),s=!0,e=0;e<n.length;e++)null!=n[e].getChild()&&(s=!1);if(!s)return t;var o=new Set,h=[],a=new Map,f=[];for(f=f.concat(n);f.length>0&&i;){for(h.push(f[0]);h.length>0&&i;){var u=h[0];h.splice(0,1),o.add(u);var c=u.getEdges();for(e=0;e<c.length;e++){var l=c[e].getOtherEnd(u);if(a.get(u)!=l){if(o.has(l)){i=!1;break}h.push(l),a.set(l,u)}}}if(i){var v=[].concat(r(o));for(t.push(v),e=0;e<v.length;e++){var d=v[e],y=f.indexOf(d);y>-1&&f.splice(y,1)}o=new Set,a=new Map}else t=[]}return t},l.prototype.createDummyNodesForBendpoints=function(t){for(var i=[],n=t.source,r=this.graphManager.calcLowestCommonAncestor(t.source,t.target),s=0;s<t.bendpoints.length;s++){var e=this.newNode(null);e.setRect(new Point(0,0),new Dimension(1,1)),r.add(e);var o=this.newEdge(null);this.graphManager.add(o,n,e),i.add(e),n=e}return o=this.newEdge(null),this.graphManager.add(o,n,t.target),this.edgeToDummyNodes.set(t,i),t.isInterGraph()?this.graphManager.remove(t):r.remove(t),i},l.prototype.createBendpointsFromDummyNodes=function(){var t=[];t=t.concat(this.graphManager.getAllEdges()),t=[].concat(r(this.edgeToDummyNodes.keys())).concat(t);for(var i=0;i<t.length;i++){var n=t[i];if(n.bendpoints.length>0){for(var s=this.edgeToDummyNodes.get(n),e=0;e<s.length;e++){var o=s[e],h=new f(o.getCenterX(),o.getCenterY()),a=n.bendpoints.get(e);a.x=h.x,a.y=h.y,o.getOwner().remove(o)}this.graphManager.add(n,n.source,n.target)}}},l.transform=function(t,i,n,r){if(null!=n&&null!=r){var s=i;return t<=50?s-=(i-i/n)/50*(50-t):s+=(i*r-i)/50*(t-50),s}var e,o;return t<=50?(e=9*i/500,o=i/10):(e=9*i/50,o=-8*i),e*t+o},l.findCenterOfTree=function(t){var i=[];i=i.concat(t);var n=[],r=new Map,s=!1,e=null;1!=i.length&&2!=i.length||(s=!0,e=i[0]);for(var o=0;o<i.length;o++){var h=(u=i[o]).getNeighborsList().size;r.set(u,u.getNeighborsList().size),1==h&&n.push(u)}var a=[];for(a=a.concat(n);!s;){var f=[];for(f=f.concat(a),a=[],o=0;o<i.length;o++){var u=i[o],c=i.indexOf(u);c>=0&&i.splice(c,1),u.getNeighborsList().forEach(function(t){if(n.indexOf(t)<0){var i=r.get(t)-1;1==i&&a.push(t),r.set(t,i)}})}n=n.concat(a),1!=i.length&&2!=i.length||(s=!0,e=i[0])}return e},l.prototype.setGraphManager=function(t){this.graphManager=t},t.exports=l},function(t,i,n){function r(){}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,i,n){var r=n(5);function s(t,i){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}s.prototype.getWorldOrgX=function(){return this.lworldOrgX},s.prototype.setWorldOrgX=function(t){this.lworldOrgX=t},s.prototype.getWorldOrgY=function(){return this.lworldOrgY},s.prototype.setWorldOrgY=function(t){this.lworldOrgY=t},s.prototype.getWorldExtX=function(){return this.lworldExtX},s.prototype.setWorldExtX=function(t){this.lworldExtX=t},s.prototype.getWorldExtY=function(){return this.lworldExtY},s.prototype.setWorldExtY=function(t){this.lworldExtY=t},s.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},s.prototype.setDeviceOrgX=function(t){this.ldeviceOrgX=t},s.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},s.prototype.setDeviceOrgY=function(t){this.ldeviceOrgY=t},s.prototype.getDeviceExtX=function(){return this.ldeviceExtX},s.prototype.setDeviceExtX=function(t){this.ldeviceExtX=t},s.prototype.getDeviceExtY=function(){return this.ldeviceExtY},s.prototype.setDeviceExtY=function(t){this.ldeviceExtY=t},s.prototype.transformX=function(t){var i=0,n=this.lworldExtX;return 0!=n&&(i=this.ldeviceOrgX+(t-this.lworldOrgX)*this.ldeviceExtX/n),i},s.prototype.transformY=function(t){var i=0,n=this.lworldExtY;return 0!=n&&(i=this.ldeviceOrgY+(t-this.lworldOrgY)*this.ldeviceExtY/n),i},s.prototype.inverseTransformX=function(t){var i=0,n=this.ldeviceExtX;return 0!=n&&(i=this.lworldOrgX+(t-this.ldeviceOrgX)*this.lworldExtX/n),i},s.prototype.inverseTransformY=function(t){var i=0,n=this.ldeviceExtY;return 0!=n&&(i=this.lworldOrgY+(t-this.ldeviceOrgY)*this.lworldExtY/n),i},s.prototype.inverseTransformPoint=function(t){return new r(this.inverseTransformX(t.x),this.inverseTransformY(t.y))},t.exports=s},function(t,i,n){var r=n(15),s=n(4),e=n(0),o=n(8),h=n(9);function a(){r.call(this),this.useSmartIdealEdgeLengthCalculation=s.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=s.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=s.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=s.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=s.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*s.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=s.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=s.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=s.MAX_ITERATIONS}for(var f in a.prototype=Object.create(r.prototype),r)a[f]=r[f];a.prototype.initParameters=function(){r.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=s.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},a.prototype.calcIdealEdgeLengths=function(){for(var t,i,n,r,o,h,a,f=this.getGraphManager().getAllEdges(),u=0;u<f.length;u++)i=(t=f[u]).idealLength,t.isInterGraph&&(r=t.getSource(),o=t.getTarget(),h=t.getSourceInLca().getEstimatedSize(),a=t.getTargetInLca().getEstimatedSize(),this.useSmartIdealEdgeLengthCalculation&&(t.idealLength+=h+a-2*e.SIMPLE_NODE_SIZE),n=t.getLca().getInclusionTreeDepth(),t.idealLength+=i*s.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR*(r.getInclusionTreeDepth()+o.getInclusionTreeDepth()-2*n))},a.prototype.initSpringEmbedder=function(){var t=this.getAllNodes().length;this.incremental?(t>s.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*s.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(t-s.ADAPTATION_LOWER_NODE_LIMIT)/(s.ADAPTATION_UPPER_NODE_LIMIT-s.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-s.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=s.MAX_NODE_DISPLACEMENT_INCREMENTAL):(t>s.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(s.COOLING_ADAPTATION_FACTOR,1-(t-s.ADAPTATION_LOWER_NODE_LIMIT)/(s.ADAPTATION_UPPER_NODE_LIMIT-s.ADAPTATION_LOWER_NODE_LIMIT)*(1-s.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=s.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(5*this.getAllNodes().length,this.maxIterations),this.displacementThresholdPerNode=3*s.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},a.prototype.calcSpringForces=function(){for(var t,i=this.getAllEdges(),n=0;n<i.length;n++)t=i[n],this.calcSpringForce(t,t.idealLength)},a.prototype.calcRepulsionForces=function(){var t,i,n,r,e,o=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],h=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a=this.getAllNodes();if(this.useFRGridVariant)for(this.totalIterations%s.GRID_CALCULATION_CHECK_PERIOD==1&&o&&this.updateGrid(),e=new Set,t=0;t<a.length;t++)n=a[t],this.calculateRepulsionForceOfANode(n,e,o,h),e.add(n);else for(t=0;t<a.length;t++)for(n=a[t],i=t+1;i<a.length;i++)r=a[i],n.getOwner()==r.getOwner()&&this.calcRepulsionForce(n,r)},a.prototype.calcGravitationalForces=function(){for(var t,i=this.getAllNodesToApplyGravitation(),n=0;n<i.length;n++)t=i[n],this.calcGravitationalForce(t)},a.prototype.moveNodes=function(){for(var t=this.getAllNodes(),i=0;i<t.length;i++)t[i].move()},a.prototype.calcSpringForce=function(t,i){var n,r,s,e,o=t.getSource(),h=t.getTarget();if(this.uniformLeafNodeSizes&&null==o.getChild()&&null==h.getChild())t.updateLengthSimple();else if(t.updateLength(),t.isOverlapingSourceAndTarget)return;0!=(n=t.getLength())&&(s=(r=t.edgeElasticity*(n-i))*(t.lengthX/n),e=r*(t.lengthY/n),o.springForceX+=s,o.springForceY+=e,h.springForceX-=s,h.springForceY-=e)},a.prototype.calcRepulsionForce=function(t,i){var n,r,e,a,f,u,c,l=t.getRect(),v=i.getRect(),d=new Array(2),y=new Array(4);if(l.intersects(v)){o.calcSeparationAmount(l,v,d,s.DEFAULT_EDGE_LENGTH/2),u=2*d[0],c=2*d[1];var p=t.noOfChildren*i.noOfChildren/(t.noOfChildren+i.noOfChildren);t.repulsionForceX-=p*u,t.repulsionForceY-=p*c,i.repulsionForceX+=p*u,i.repulsionForceY+=p*c}else this.uniformLeafNodeSizes&&null==t.getChild()&&null==i.getChild()?(n=v.getCenterX()-l.getCenterX(),r=v.getCenterY()-l.getCenterY()):(o.getIntersection(l,v,y),n=y[2]-y[0],r=y[3]-y[1]),Math.abs(n)<s.MIN_REPULSION_DIST&&(n=h.sign(n)*s.MIN_REPULSION_DIST),Math.abs(r)<s.MIN_REPULSION_DIST&&(r=h.sign(r)*s.MIN_REPULSION_DIST),e=n*n+r*r,a=Math.sqrt(e),u=(f=(t.nodeRepulsion/2+i.nodeRepulsion/2)*t.noOfChildren*i.noOfChildren/e)*n/a,c=f*r/a,t.repulsionForceX-=u,t.repulsionForceY-=c,i.repulsionForceX+=u,i.repulsionForceY+=c},a.prototype.calcGravitationalForce=function(t){var i,n,r,s,e,o,h,a;n=((i=t.getOwner()).getRight()+i.getLeft())/2,r=(i.getTop()+i.getBottom())/2,s=t.getCenterX()-n,e=t.getCenterY()-r,o=Math.abs(s)+t.getWidth()/2,h=Math.abs(e)+t.getHeight()/2,t.getOwner()==this.graphManager.getRoot()?(o>(a=i.getEstimatedSize()*this.gravityRangeFactor)||h>a)&&(t.gravitationForceX=-this.gravityConstant*s,t.gravitationForceY=-this.gravityConstant*e):(o>(a=i.getEstimatedSize()*this.compoundGravityRangeFactor)||h>a)&&(t.gravitationForceX=-this.gravityConstant*s*this.compoundGravityConstant,t.gravitationForceY=-this.gravityConstant*e*this.compoundGravityConstant)},a.prototype.isConverged=function(){var t,i=!1;return this.totalIterations>this.maxIterations/3&&(i=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),t=this.totalDisplacement<this.totalDisplacementThreshold,this.oldTotalDisplacement=this.totalDisplacement,t||i},a.prototype.animate=function(){this.animationDuringLayout&&!this.isSubLayout&&(this.notAnimatedIterations==this.animationPeriod?(this.update(),this.notAnimatedIterations=0):this.notAnimatedIterations++)},a.prototype.calcNoOfChildrenForAllNodes=function(){for(var t,i=this.graphManager.getAllNodes(),n=0;n<i.length;n++)(t=i[n]).noOfChildren=t.getNoOfChildren()},a.prototype.calcGrid=function(t){var i,n;i=parseInt(Math.ceil((t.getRight()-t.getLeft())/this.repulsionRange)),n=parseInt(Math.ceil((t.getBottom()-t.getTop())/this.repulsionRange));for(var r=new Array(i),s=0;s<i;s++)r[s]=new Array(n);for(s=0;s<i;s++)for(var e=0;e<n;e++)r[s][e]=new Array;return r},a.prototype.addNodeToGrid=function(t,i,n){var r,s,e,o;r=parseInt(Math.floor((t.getRect().x-i)/this.repulsionRange)),s=parseInt(Math.floor((t.getRect().width+t.getRect().x-i)/this.repulsionRange)),e=parseInt(Math.floor((t.getRect().y-n)/this.repulsionRange)),o=parseInt(Math.floor((t.getRect().height+t.getRect().y-n)/this.repulsionRange));for(var h=r;h<=s;h++)for(var a=e;a<=o;a++)this.grid[h][a].push(t),t.setGridCoordinates(r,s,e,o)},a.prototype.updateGrid=function(){var t,i,n=this.getAllNodes();for(this.grid=this.calcGrid(this.graphManager.getRoot()),t=0;t<n.length;t++)i=n[t],this.addNodeToGrid(i,this.graphManager.getRoot().getLeft(),this.graphManager.getRoot().getTop())},a.prototype.calculateRepulsionForceOfANode=function(t,i,n,r){if(this.totalIterations%s.GRID_CALCULATION_CHECK_PERIOD==1&&n||r){var e,o=new Set;t.surrounding=new Array;for(var h=this.grid,a=t.startX-1;a<t.finishX+2;a++)for(var f=t.startY-1;f<t.finishY+2;f++)if(!(a<0||f<0||a>=h.length||f>=h[0].length))for(var u=0;u<h[a][f].length;u++)if(e=h[a][f][u],t.getOwner()==e.getOwner()&&t!=e&&!i.has(e)&&!o.has(e)){var c=Math.abs(t.getCenterX()-e.getCenterX())-(t.getWidth()/2+e.getWidth()/2),l=Math.abs(t.getCenterY()-e.getCenterY())-(t.getHeight()/2+e.getHeight()/2);c<=this.repulsionRange&&l<=this.repulsionRange&&o.add(e)}t.surrounding=[].concat(function(t){if(Array.isArray(t)){for(var i=0,n=Array(t.length);i<t.length;i++)n[i]=t[i];return n}return Array.from(t)}(o))}for(a=0;a<t.surrounding.length;a++)this.calcRepulsionForce(t,t.surrounding[a])},a.prototype.calcRepulsionRange=function(){return 0},t.exports=a},function(t,i,n){var r=n(1),s=n(4);function e(t,i,n){r.call(this,t,i,n),this.idealLength=s.DEFAULT_EDGE_LENGTH,this.edgeElasticity=s.DEFAULT_SPRING_STRENGTH}for(var o in e.prototype=Object.create(r.prototype),r)e[o]=r[o];t.exports=e},function(t,i,n){var r=n(3),s=n(4);function e(t,i,n,e){r.call(this,t,i,n,e),this.nodeRepulsion=s.DEFAULT_REPULSION_STRENGTH,this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0,this.startX=0,this.finishX=0,this.startY=0,this.finishY=0,this.surrounding=[]}for(var o in e.prototype=Object.create(r.prototype),r)e[o]=r[o];e.prototype.setGridCoordinates=function(t,i,n,r){this.startX=t,this.finishX=i,this.startY=n,this.finishY=r},t.exports=e},function(t,i,n){function r(t,i){this.width=0,this.height=0,null!==t&&null!==i&&(this.height=i,this.width=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},t.exports=r},function(t,i,n){var r=n(14);function s(){this.map={},this.keys=[]}s.prototype.put=function(t,i){var n=r.createID(t);this.contains(n)||(this.map[n]=i,this.keys.push(t))},s.prototype.contains=function(t){return r.createID(t),null!=this.map[t]},s.prototype.get=function(t){var i=r.createID(t);return this.map[i]},s.prototype.keySet=function(){return this.keys},t.exports=s},function(t,i,n){var r=n(14);function s(){this.set={}}s.prototype.add=function(t){var i=r.createID(t);this.contains(i)||(this.set[i]=t)},s.prototype.remove=function(t){delete this.set[r.createID(t)]},s.prototype.clear=function(){this.set={}},s.prototype.contains=function(t){return this.set[r.createID(t)]==t},s.prototype.isEmpty=function(){return 0===this.size()},s.prototype.size=function(){return Object.keys(this.set).length},s.prototype.addAllTo=function(t){for(var i=Object.keys(this.set),n=i.length,r=0;r<n;r++)t.push(this.set[i[r]])},s.prototype.size=function(){return Object.keys(this.set).length},s.prototype.addAll=function(t){for(var i=t.length,n=0;n<i;n++){var r=t[n];this.add(r)}},t.exports=s},function(t,i,n){function r(){}r.multMat=function(t,i){for(var n=[],r=0;r<t.length;r++){n[r]=[];for(var s=0;s<i[0].length;s++){n[r][s]=0;for(var e=0;e<t[0].length;e++)n[r][s]+=t[r][e]*i[e][s]}}return n},r.transpose=function(t){for(var i=[],n=0;n<t[0].length;n++){i[n]=[];for(var r=0;r<t.length;r++)i[n][r]=t[r][n]}return i},r.multCons=function(t,i){for(var n=[],r=0;r<t.length;r++)n[r]=t[r]*i;return n},r.minusOp=function(t,i){for(var n=[],r=0;r<t.length;r++)n[r]=t[r]-i[r];return n},r.dotProduct=function(t,i){for(var n=0,r=0;r<t.length;r++)n+=t[r]*i[r];return n},r.mag=function(t){return Math.sqrt(this.dotProduct(t,t))},r.normalize=function(t){for(var i=[],n=this.mag(t),r=0;r<t.length;r++)i[r]=t[r]/n;return i},r.multGamma=function(t){for(var i=[],n=0,r=0;r<t.length;r++)n+=t[r];n*=-1/t.length;for(var s=0;s<t.length;s++)i[s]=n+t[s];return i},r.multL=function(t,i,n){for(var r=[],s=[],e=[],o=0;o<i[0].length;o++){for(var h=0,a=0;a<i.length;a++)h+=-.5*i[a][o]*t[a];s[o]=h}for(var f=0;f<n.length;f++){for(var u=0,c=0;c<n.length;c++)u+=n[f][c]*s[c];e[f]=u}for(var l=0;l<i.length;l++){for(var v=0,d=0;d<i[0].length;d++)v+=i[l][d]*e[d];r[l]=v}return r},t.exports=r},function(t,i,n){var r=function(){function t(t,i){for(var n=0;n<i.length;n++){var r=i[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(i,n,r){return n&&t(i.prototype,n),r&&t(i,r),i}}(),s=n(11),e=function(){function t(i,n){!function(t,i){if(!(t instanceof i))throw new TypeError("Cannot call a class as a function")}(this,t),null===n&&void 0===n||(this.compareFunction=this._defaultCompareFunction);var r=void 0;r=i instanceof s?i.size():i.length,this._quicksort(i,0,r-1)}return r(t,[{key:"_quicksort",value:function(t,i,n){if(i<n){var r=this._partition(t,i,n);this._quicksort(t,i,r),this._quicksort(t,r+1,n)}}},{key:"_partition",value:function(t,i,n){for(var r=this._get(t,i),s=i,e=n;;){for(;this.compareFunction(r,this._get(t,e));)e--;for(;this.compareFunction(this._get(t,s),r);)s++;if(!(s<e))return e;this._swap(t,s,e),s++,e--}}},{key:"_get",value:function(t,i){return t instanceof s?t.get_object_at(i):t[i]}},{key:"_set",value:function(t,i,n){t instanceof s?t.set_object_at(i,n):t[i]=n}},{key:"_swap",value:function(t,i,n){var r=this._get(t,i);this._set(t,i,this._get(t,n)),this._set(t,n,r)}},{key:"_defaultCompareFunction",value:function(t,i){return i>t}}]),t}();t.exports=e},function(t,i,n){function r(){}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 i=Math.min(this.m,this.n);this.s=function(t){for(var i=[];t-- >0;)i.push(0);return i}(Math.min(this.m+1,this.n)),this.U=function t(i){if(0==i.length)return 0;for(var n=[],r=0;r<i[0];r++)n.push(t(i.slice(1)));return n}([this.m,i]),this.V=function(t){return function t(i){if(0==i.length)return 0;for(var n=[],r=0;r<i[0];r++)n.push(t(i.slice(1)));return n}(t)}([this.n,this.n]);for(var n=function(t){for(var i=[];t-- >0;)i.push(0);return i}(this.n),s=function(t){for(var i=[];t-- >0;)i.push(0);return i}(this.m),e=Math.min(this.m-1,this.n),o=Math.max(0,Math.min(this.n-2,this.m)),h=0;h<Math.max(e,o);h++){if(h<e){this.s[h]=0;for(var a=h;a<this.m;a++)this.s[h]=r.hypot(this.s[h],t[a][h]);if(0!==this.s[h]){t[h][h]<0&&(this.s[h]=-this.s[h]);for(var f=h;f<this.m;f++)t[f][h]/=this.s[h];t[h][h]+=1}this.s[h]=-this.s[h]}for(var u=h+1;u<this.n;u++){if(function(t,i){return t&&i}(h<e,0!==this.s[h])){for(var c=0,l=h;l<this.m;l++)c+=t[l][h]*t[l][u];c=-c/t[h][h];for(var v=h;v<this.m;v++)t[v][u]+=c*t[v][h]}n[u]=t[h][u]}if(function(t,i){return i}(0,h<e))for(var d=h;d<this.m;d++)this.U[d][h]=t[d][h];if(h<o){n[h]=0;for(var y=h+1;y<this.n;y++)n[h]=r.hypot(n[h],n[y]);if(0!==n[h]){n[h+1]<0&&(n[h]=-n[h]);for(var p=h+1;p<this.n;p++)n[p]/=n[h];n[h+1]+=1}if(n[h]=-n[h],function(t,i){return t&&i}(h+1<this.m,0!==n[h])){for(var w=h+1;w<this.m;w++)s[w]=0;for(var g=h+1;g<this.n;g++)for(var m=h+1;m<this.m;m++)s[m]+=n[g]*t[m][g];for(var b=h+1;b<this.n;b++)for(var M=-n[b]/n[h+1],k=h+1;k<this.m;k++)t[k][b]+=M*s[k]}for(var x=h+1;x<this.n;x++)this.V[x][h]=n[x]}}var S=Math.min(this.n,this.m+1);e<this.n&&(this.s[e]=t[e][e]),this.m<S&&(this.s[S-1]=0),o+1<S&&(n[o]=t[o][S-1]),n[S-1]=0;for(var $=e;$<i;$++){for(var j=0;j<this.m;j++)this.U[j][$]=0;this.U[$][$]=1}for(var O=e-1;O>=0;O--)if(0!==this.s[O]){for(var A=O+1;A<i;A++){for(var T=0,I=O;I<this.m;I++)T+=this.U[I][O]*this.U[I][A];T=-T/this.U[O][O];for(var E=O;E<this.m;E++)this.U[E][A]+=T*this.U[E][O]}for(var L=O;L<this.m;L++)this.U[L][O]=-this.U[L][O];this.U[O][O]=1+this.U[O][O];for(var D=0;D<O-1;D++)this.U[D][O]=0}else{for(var N=0;N<this.m;N++)this.U[N][O]=0;this.U[O][O]=1}for(var z=this.n-1;z>=0;z--){if(function(t,i){return t&&i}(z<o,0!==n[z]))for(var B=z+1;B<i;B++){for(var C=0,P=z+1;P<this.n;P++)C+=this.V[P][z]*this.V[P][B];C=-C/this.V[z+1][z];for(var R=z+1;R<this.n;R++)this.V[R][B]+=C*this.V[R][z]}for(var G=0;G<this.n;G++)this.V[G][z]=0;this.V[z][z]=1}for(var q=S-1,F=Math.pow(2,-52),X=Math.pow(2,-966);S>0;){var Y=void 0,_=void 0;for(Y=S-2;Y>=-1&&-1!==Y;Y--)if(Math.abs(n[Y])<=X+F*(Math.abs(this.s[Y])+Math.abs(this.s[Y+1]))){n[Y]=0;break}if(Y===S-2)_=4;else{var H=void 0;for(H=S-1;H>=Y&&H!==Y;H--){var Z=(H!==S?Math.abs(n[H]):0)+(H!==Y+1?Math.abs(n[H-1]):0);if(Math.abs(this.s[H])<=X+F*Z){this.s[H]=0;break}}H===Y?_=3:H===S-1?_=1:(_=2,Y=H)}switch(Y++,_){case 1:var J=n[S-2];n[S-2]=0;for(var V=S-2;V>=Y;V--){var W=r.hypot(this.s[V],J),U=this.s[V]/W,K=J/W;this.s[V]=W,V!==Y&&(J=-K*n[V-1],n[V-1]=U*n[V-1]);for(var Q=0;Q<this.n;Q++)W=U*this.V[Q][V]+K*this.V[Q][S-1],this.V[Q][S-1]=-K*this.V[Q][V]+U*this.V[Q][S-1],this.V[Q][V]=W}break;case 2:var tt=n[Y-1];n[Y-1]=0;for(var it=Y;it<S;it++){var nt=r.hypot(this.s[it],tt),rt=this.s[it]/nt,st=tt/nt;this.s[it]=nt,tt=-st*n[it],n[it]=rt*n[it];for(var et=0;et<this.m;et++)nt=rt*this.U[et][it]+st*this.U[et][Y-1],this.U[et][Y-1]=-st*this.U[et][it]+rt*this.U[et][Y-1],this.U[et][it]=nt}break;case 3:var ot=Math.max(Math.max(Math.max(Math.max(Math.abs(this.s[S-1]),Math.abs(this.s[S-2])),Math.abs(n[S-2])),Math.abs(this.s[Y])),Math.abs(n[Y])),ht=this.s[S-1]/ot,at=this.s[S-2]/ot,ft=n[S-2]/ot,ut=this.s[Y]/ot,ct=n[Y]/ot,lt=((at+ht)*(at-ht)+ft*ft)/2,vt=ht*ft*(ht*ft),dt=0;(function(t,i){return t||i})(0!==lt,0!==vt)&&(dt=Math.sqrt(lt*lt+vt),lt<0&&(dt=-dt),dt=vt/(lt+dt));for(var yt=(ut+ht)*(ut-ht)+dt,pt=ut*ct,wt=Y;wt<S-1;wt++){var gt=r.hypot(yt,pt),mt=yt/gt,bt=pt/gt;wt!==Y&&(n[wt-1]=gt),yt=mt*this.s[wt]+bt*n[wt],n[wt]=mt*n[wt]-bt*this.s[wt],pt=bt*this.s[wt+1],this.s[wt+1]=mt*this.s[wt+1];for(var Mt=0;Mt<this.n;Mt++)gt=mt*this.V[Mt][wt]+bt*this.V[Mt][wt+1],this.V[Mt][wt+1]=-bt*this.V[Mt][wt]+mt*this.V[Mt][wt+1],this.V[Mt][wt]=gt;if(mt=yt/(gt=r.hypot(yt,pt)),bt=pt/gt,this.s[wt]=gt,yt=mt*n[wt]+bt*this.s[wt+1],this.s[wt+1]=-bt*n[wt]+mt*this.s[wt+1],pt=bt*n[wt+1],n[wt+1]=mt*n[wt+1],wt<this.m-1)for(var kt=0;kt<this.m;kt++)gt=mt*this.U[kt][wt]+bt*this.U[kt][wt+1],this.U[kt][wt+1]=-bt*this.U[kt][wt]+mt*this.U[kt][wt+1],this.U[kt][wt]=gt}n[S-2]=yt;break;case 4:if(this.s[Y]<=0){this.s[Y]=this.s[Y]<0?-this.s[Y]:0;for(var xt=0;xt<=q;xt++)this.V[xt][Y]=-this.V[xt][Y]}for(;Y<q&&!(this.s[Y]>=this.s[Y+1]);){var St=this.s[Y];if(this.s[Y]=this.s[Y+1],this.s[Y+1]=St,Y<this.n-1)for(var $t=0;$t<this.n;$t++)St=this.V[$t][Y+1],this.V[$t][Y+1]=this.V[$t][Y],this.V[$t][Y]=St;if(Y<this.m-1)for(var jt=0;jt<this.m;jt++)St=this.U[jt][Y+1],this.U[jt][Y+1]=this.U[jt][Y],this.U[jt][Y]=St;Y++}S--}}return{U:this.U,V:this.V,S:this.s}},r.hypot=function(t,i){var n=void 0;return Math.abs(t)>Math.abs(i)?(n=i/t,n=Math.abs(t)*Math.sqrt(1+n*n)):0!=i?(n=t/i,n=Math.abs(i)*Math.sqrt(1+n*n)):n=0,n},t.exports=r},function(t,i,n){var r=function(){function t(t,i){for(var n=0;n<i.length;n++){var r=i[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(i,n,r){return n&&t(i.prototype,n),r&&t(i,r),i}}(),s=function(){function t(i,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1,e=arguments.length>4&&void 0!==arguments[4]?arguments[4]:-1;!function(t,i){if(!(t instanceof i))throw new TypeError("Cannot call a class as a function")}(this,t),this.sequence1=i,this.sequence2=n,this.match_score=r,this.mismatch_penalty=s,this.gap_penalty=e,this.iMax=i.length+1,this.jMax=n.length+1,this.grid=new Array(this.iMax);for(var o=0;o<this.iMax;o++){this.grid[o]=new Array(this.jMax);for(var h=0;h<this.jMax;h++)this.grid[o][h]=0}this.tracebackGrid=new Array(this.iMax);for(var a=0;a<this.iMax;a++){this.tracebackGrid[a]=new Array(this.jMax);for(var f=0;f<this.jMax;f++)this.tracebackGrid[a][f]=[null,null,null]}this.alignments=[],this.score=-1,this.computeGrids()}return r(t,[{key:"getScore",value:function(){return this.score}},{key:"getAlignments",value:function(){return this.alignments}},{key:"computeGrids",value: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 i=1;i<this.iMax;i++)this.grid[i][0]=this.grid[i-1][0]+this.gap_penalty,this.tracebackGrid[i][0]=[!1,!0,!1];for(var n=1;n<this.iMax;n++)for(var r=1;r<this.jMax;r++){var s=[this.sequence1[n-1]===this.sequence2[r-1]?this.grid[n-1][r-1]+this.match_score:this.grid[n-1][r-1]+this.mismatch_penalty,this.grid[n-1][r]+this.gap_penalty,this.grid[n][r-1]+this.gap_penalty],e=this.arrayAllMaxIndexes(s);this.grid[n][r]=s[e[0]],this.tracebackGrid[n][r]=[e.includes(0),e.includes(1),e.includes(2)]}this.score=this.grid[this.iMax-1][this.jMax-1]}},{key:"alignmentTraceback",value:function(){var t=[];for(t.push({pos:[this.sequence1.length,this.sequence2.length],seq1:"",seq2:""});t[0];){var i=t[0],n=this.tracebackGrid[i.pos[0]][i.pos[1]];n[0]&&t.push({pos:[i.pos[0]-1,i.pos[1]-1],seq1:this.sequence1[i.pos[0]-1]+i.seq1,seq2:this.sequence2[i.pos[1]-1]+i.seq2}),n[1]&&t.push({pos:[i.pos[0]-1,i.pos[1]],seq1:this.sequence1[i.pos[0]-1]+i.seq1,seq2:"-"+i.seq2}),n[2]&&t.push({pos:[i.pos[0],i.pos[1]-1],seq1:"-"+i.seq1,seq2:this.sequence2[i.pos[1]-1]+i.seq2}),0===i.pos[0]&&0===i.pos[1]&&this.alignments.push({sequence1:i.seq1,sequence2:i.seq2}),t.shift()}return this.alignments}},{key:"getAllIndexes",value:function(t,i){for(var n=[],r=-1;-1!==(r=t.indexOf(i,r+1));)n.push(r);return n}},{key:"arrayAllMaxIndexes",value:function(t){return this.getAllIndexes(t,Math.max.apply(null,t))}}]),t}();t.exports=s},function(t,i,n){var r=function(){};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,i,n){function r(){this.listeners=[]}var s=r.prototype;s.addListener=function(t,i){this.listeners.push({event:t,callback:i})},s.removeListener=function(t,i){for(var n=this.listeners.length;n>=0;n--){var r=this.listeners[n];r.event===t&&r.callback===i&&this.listeners.splice(n,1)}},s.emit=function(t,i){for(var n=0;n<this.listeners.length;n++){var r=this.listeners[n];t===r.event&&r.callback(i)}},t.exports=r}])},I.exports=t());var t}var L;function D(){return L?T.exports:(L=1,t=function(t){return i={45:(t,i,n)=>{var r={};r.layoutBase=n(551),r.CoSEConstants=n(806),r.CoSEEdge=n(767),r.CoSEGraph=n(880),r.CoSEGraphManager=n(578),r.CoSELayout=n(765),r.CoSENode=n(991),r.ConstraintHandler=n(902),t.exports=r},806:(t,i,n)=>{var r=n(551).FDLayoutConstants;function s(){}for(var e in r)s[e]=r[e];s.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,s.DEFAULT_RADIAL_SEPARATION=r.DEFAULT_EDGE_LENGTH,s.DEFAULT_COMPONENT_SEPERATION=60,s.TILE=!0,s.TILING_PADDING_VERTICAL=10,s.TILING_PADDING_HORIZONTAL=10,s.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,s.ENFORCE_CONSTRAINTS=!0,s.APPLY_LAYOUT=!0,s.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,s.TREE_REDUCTION_ON_INCREMENTAL=!0,s.PURE_INCREMENTAL=s.DEFAULT_INCREMENTAL,t.exports=s},767:(t,i,n)=>{var r=n(551).FDLayoutEdge;function s(t,i,n){r.call(this,t,i,n)}for(var e in s.prototype=Object.create(r.prototype),r)s[e]=r[e];t.exports=s},880:(t,i,n)=>{var r=n(551).LGraph;function s(t,i,n){r.call(this,t,i,n)}for(var e in s.prototype=Object.create(r.prototype),r)s[e]=r[e];t.exports=s},578:(t,i,n)=>{var r=n(551).LGraphManager;function s(t){r.call(this,t)}for(var e in s.prototype=Object.create(r.prototype),r)s[e]=r[e];t.exports=s},765:(t,i,n)=>{var r=n(551).FDLayout,s=n(578),e=n(880),o=n(991),h=n(767),a=n(806),f=n(902),u=n(551).FDLayoutConstants,c=n(551).LayoutConstants,l=n(551).Point,v=n(551).PointD,d=n(551).DimensionD,y=n(551).Layout,p=n(551).Integer,w=n(551).IGeometry,g=n(551).LGraph,m=n(551).Transform,b=n(551).LinkedList;function M(){r.call(this),this.toBeTiled={},this.constraints={}}for(var k in M.prototype=Object.create(r.prototype),r)M[k]=r[k];M.prototype.newGraphManager=function(){var t=new s(this);return this.graphManager=t,t},M.prototype.newGraph=function(t){return new e(null,this.graphManager,t)},M.prototype.newNode=function(t){return new o(this.graphManager,t)},M.prototype.newEdge=function(t){return new h(null,null,t)},M.prototype.initParameters=function(){r.prototype.initParameters.call(this,arguments),this.isSubLayout||(a.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=a.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=a.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=u.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=u.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=u.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=u.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},M.prototype.initSpringEmbedder=function(){r.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/u.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},M.prototype.layout=function(){return c.DEFAULT_CREATE_BENDS_AS_NEEDED&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},M.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)a.TREE_REDUCTION_ON_INCREMENTAL&&(this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation(),i=new Set(this.getAllNodes()),n=this.nodesWithGravity.filter(function(t){return i.has(t)}),this.graphManager.setAllNodesToApplyGravitation(n));else{var t=this.getFlatForest();if(t.length>0)this.positionNodesRadially(t);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var i=new Set(this.getAllNodes()),n=this.nodesWithGravity.filter(function(t){return i.has(t)});this.graphManager.setAllNodesToApplyGravitation(n),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(f.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),a.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},M.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%u.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()),i=this.nodesWithGravity.filter(function(i){return t.has(i)});this.graphManager.setAllNodesToApplyGravitation(i),this.graphManager.updateBounds(),this.updateGrid(),a.PURE_INCREMENTAL?this.coolingFactor=u.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=u.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()),a.PURE_INCREMENTAL?this.coolingFactor=u.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=u.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var n=!this.isTreeGrowing&&!this.isGrowthFinished,r=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(n,r),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},M.prototype.getPositionsData=function(){for(var t=this.graphManager.getAllNodes(),i={},n=0;n<t.length;n++){var r=t[n].rect,s=t[n].id;i[s]={id:s,x:r.getCenterX(),y:r.getCenterY(),w:r.width,h:r.height}}return i},M.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var t=!1;if("during"===u.ANIMATE)this.emit("layoutstarted");else{for(;!t;)t=this.tick();this.graphManager.updateBounds()}},M.prototype.moveNodes=function(){for(var t=this.getAllNodes(),i=0;i<t.length;i++)t[i].calculateDisplacement();for(Object.keys(this.constraints).length>0&&this.updateDisplacements(),i=0;i<t.length;i++)t[i].move()},M.prototype.initConstraintVariables=function(){var t=this;this.idToNodeMap=new Map,this.fixedNodeSet=new Set;for(var i=this.graphManager.getAllNodes(),n=0;n<i.length;n++){var r=i[n];this.idToNodeMap.set(r.id,r)}var s=function i(n){for(var r,s=n.getChild().getNodes(),e=0,o=0;o<s.length;o++)null==(r=s[o]).getChild()?t.fixedNodeSet.has(r.id)&&(e+=100):e+=i(r);return e};if(this.constraints.fixedNodeConstraint)for(this.constraints.fixedNodeConstraint.forEach(function(i){t.fixedNodeSet.add(i.nodeId)}),i=this.graphManager.getAllNodes(),n=0;n<i.length;n++)if(null!=(r=i[n]).getChild()){var e=s(r);e>0&&(r.fixedNodeWeight=e)}if(this.constraints.relativePlacementConstraint){var o=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(i){t.fixedNodesOnHorizontal.add(i),t.fixedNodesOnVertical.add(i)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical){var f=this.constraints.alignmentConstraint.vertical;for(n=0;n<f.length;n++)this.dummyToNodeForVerticalAlignment.set("dummy"+n,[]),f[n].forEach(function(i){o.set(i,"dummy"+n),t.dummyToNodeForVerticalAlignment.get("dummy"+n).push(i),t.fixedNodeSet.has(i)&&t.fixedNodesOnHorizontal.add("dummy"+n)})}if(this.constraints.alignmentConstraint.horizontal){var u=this.constraints.alignmentConstraint.horizontal;for(n=0;n<u.length;n++)this.dummyToNodeForHorizontalAlignment.set("dummy"+n,[]),u[n].forEach(function(i){h.set(i,"dummy"+n),t.dummyToNodeForHorizontalAlignment.get("dummy"+n).push(i),t.fixedNodeSet.has(i)&&t.fixedNodesOnVertical.add("dummy"+n)})}}if(a.RELAX_MOVEMENT_ON_CONSTRAINTS)this.shuffle=function(t){var i,n,r;for(r=t.length-1;r>=2*t.length/3;r--)i=Math.floor(Math.random()*(r+1)),n=t[r],t[r]=t[i],t[i]=n;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(i){if(i.left){var n=o.has(i.left)?o.get(i.left):i.left,r=o.has(i.right)?o.get(i.right):i.right;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.nodesInRelativeHorizontal.includes(r)||(t.nodesInRelativeHorizontal.push(r),t.nodeToRelativeConstraintMapHorizontal.set(r,[]),t.dummyToNodeForVerticalAlignment.has(r)?t.nodeToTempPositionMapHorizontal.set(r,t.idToNodeMap.get(t.dummyToNodeForVerticalAlignment.get(r)[0]).getCenterX()):t.nodeToTempPositionMapHorizontal.set(r,t.idToNodeMap.get(r).getCenterX())),t.nodeToRelativeConstraintMapHorizontal.get(n).push({right:r,gap:i.gap}),t.nodeToRelativeConstraintMapHorizontal.get(r).push({left:n,gap:i.gap})}else{var s=h.has(i.top)?h.get(i.top):i.top,e=h.has(i.bottom)?h.get(i.bottom):i.bottom;t.nodesInRelativeVertical.includes(s)||(t.nodesInRelativeVertical.push(s),t.nodeToRelativeConstraintMapVertical.set(s,[]),t.dummyToNodeForHorizontalAlignment.has(s)?t.nodeToTempPositionMapVertical.set(s,t.idToNodeMap.get(t.dummyToNodeForHorizontalAlignment.get(s)[0]).getCenterY()):t.nodeToTempPositionMapVertical.set(s,t.idToNodeMap.get(s).getCenterY())),t.nodesInRelativeVertical.includes(e)||(t.nodesInRelativeVertical.push(e),t.nodeToRelativeConstraintMapVertical.set(e,[]),t.dummyToNodeForHorizontalAlignment.has(e)?t.nodeToTempPositionMapVertical.set(e,t.idToNodeMap.get(t.dummyToNodeForHorizontalAlignment.get(e)[0]).getCenterY()):t.nodeToTempPositionMapVertical.set(e,t.idToNodeMap.get(e).getCenterY())),t.nodeToRelativeConstraintMapVertical.get(s).push({bottom:e,gap:i.gap}),t.nodeToRelativeConstraintMapVertical.get(e).push({top:s,gap:i.gap})}});else{var c=new Map,l=new Map;this.constraints.relativePlacementConstraint.forEach(function(t){if(t.left){var i=o.has(t.left)?o.get(t.left):t.left,n=o.has(t.right)?o.get(t.right):t.right;c.has(i)?c.get(i).push(n):c.set(i,[n]),c.has(n)?c.get(n).push(i):c.set(n,[i])}else{var r=h.has(t.top)?h.get(t.top):t.top,s=h.has(t.bottom)?h.get(t.bottom):t.bottom;l.has(r)?l.get(r).push(s):l.set(r,[s]),l.has(s)?l.get(s).push(r):l.set(s,[r])}});var v=function(t,i){var n=[],r=[],s=new b,e=new Set,o=0;return t.forEach(function(h,a){if(!e.has(a)){n[o]=[],r[o]=!1;var f=a;for(s.push(f),e.add(f),n[o].push(f);0!=s.length;)f=s.shift(),i.has(f)&&(r[o]=!0),t.get(f).forEach(function(t){e.has(t)||(s.push(t),e.add(t),n[o].push(t))});o++}}),{components:n,isFixed:r}},d=v(c,t.fixedNodesOnHorizontal);this.componentsOnHorizontal=d.components,this.fixedComponentsOnHorizontal=d.isFixed;var y=v(l,t.fixedNodesOnVertical);this.componentsOnVertical=y.components,this.fixedComponentsOnVertical=y.isFixed}}},M.prototype.updateDisplacements=function(){var t=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function(i){var n=t.idToNodeMap.get(i.nodeId);n.displacementX=0,n.displacementY=0}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var i=this.constraints.alignmentConstraint.vertical,n=0;n<i.length;n++){for(var r=0,s=0;s<i[n].length;s++){if(this.fixedNodeSet.has(i[n][s])){r=0;break}r+=this.idToNodeMap.get(i[n][s]).displacementX}var e=r/i[n].length;for(s=0;s<i[n].length;s++)this.idToNodeMap.get(i[n][s]).displacementX=e}if(this.constraints.alignmentConstraint.horizontal){var o=this.constraints.alignmentConstraint.horizontal;for(n=0;n<o.length;n++){var h=0;for(s=0;s<o[n].length;s++){if(this.fixedNodeSet.has(o[n][s])){h=0;break}h+=this.idToNodeMap.get(o[n][s]).displacementY}var f=h/o[n].length;for(s=0;s<o[n].length;s++)this.idToNodeMap.get(o[n][s]).displacementY=f}}}if(this.constraints.relativePlacementConstraint)if(a.RELAX_MOVEMENT_ON_CONSTRAINTS)this.totalIterations%10==0&&(this.shuffle(this.nodesInRelativeHorizontal),this.shuffle(this.nodesInRelativeVertical)),this.nodesInRelativeHorizontal.forEach(function(i){if(!t.fixedNodesOnHorizontal.has(i)){var n=0;n=t.dummyToNodeForVerticalAlignment.has(i)?t.idToNodeMap.get(t.dummyToNodeForVerticalAlignment.get(i)[0]).displacementX:t.idToNodeMap.get(i).displacementX,t.nodeToRelativeConstraintMapHorizontal.get(i).forEach(function(r){var s;r.right?(s=t.nodeToTempPositionMapHorizontal.get(r.right)-t.nodeToTempPositionMapHorizontal.get(i)-n)<r.gap&&(n-=r.gap-s):(s=t.nodeToTempPositionMapHorizontal.get(i)-t.nodeToTempPositionMapHorizontal.get(r.left)+n)<r.gap&&(n+=r.gap-s)}),t.nodeToTempPositionMapHorizontal.set(i,t.nodeToTempPositionMapHorizontal.get(i)+n),t.dummyToNodeForVerticalAlignment.has(i)?t.dummyToNodeForVerticalAlignment.get(i).forEach(function(i){t.idToNodeMap.get(i).displacementX=n}):t.idToNodeMap.get(i).displacementX=n}}),this.nodesInRelativeVertical.forEach(function(i){if(!t.fixedNodesOnHorizontal.has(i)){var n=0;n=t.dummyToNodeForHorizontalAlignment.has(i)?t.idToNodeMap.get(t.dummyToNodeForHorizontalAlignment.get(i)[0]).displacementY:t.idToNodeMap.get(i).displacementY,t.nodeToRelativeConstraintMapVertical.get(i).forEach(function(r){var s;r.bottom?(s=t.nodeToTempPositionMapVertical.get(r.bottom)-t.nodeToTempPositionMapVertical.get(i)-n)<r.gap&&(n-=r.gap-s):(s=t.nodeToTempPositionMapVertical.get(i)-t.nodeToTempPositionMapVertical.get(r.top)+n)<r.gap&&(n+=r.gap-s)}),t.nodeToTempPositionMapVertical.set(i,t.nodeToTempPositionMapVertical.get(i)+n),t.dummyToNodeForHorizontalAlignment.has(i)?t.dummyToNodeForHorizontalAlignment.get(i).forEach(function(i){t.idToNodeMap.get(i).displacementY=n}):t.idToNodeMap.get(i).displacementY=n}});else{for(n=0;n<this.componentsOnHorizontal.length;n++){var u=this.componentsOnHorizontal[n];if(this.fixedComponentsOnHorizontal[n])for(s=0;s<u.length;s++)this.dummyToNodeForVerticalAlignment.has(u[s])?this.dummyToNodeForVerticalAlignment.get(u[s]).forEach(function(i){t.idToNodeMap.get(i).displacementX=0}):this.idToNodeMap.get(u[s]).displacementX=0;else{var c=0,l=0;for(s=0;s<u.length;s++)this.dummyToNodeForVerticalAlignment.has(u[s])?(c+=(d=this.dummyToNodeForVerticalAlignment.get(u[s])).length*this.idToNodeMap.get(d[0]).displacementX,l+=d.length):(c+=this.idToNodeMap.get(u[s]).displacementX,l++);var v=c/l;for(s=0;s<u.length;s++)this.dummyToNodeForVerticalAlignment.has(u[s])?this.dummyToNodeForVerticalAlignment.get(u[s]).forEach(function(i){t.idToNodeMap.get(i).displacementX=v}):this.idToNodeMap.get(u[s]).displacementX=v}}for(n=0;n<this.componentsOnVertical.length;n++)if(u=this.componentsOnVertical[n],this.fixedComponentsOnVertical[n])for(s=0;s<u.length;s++)this.dummyToNodeForHorizontalAlignment.has(u[s])?this.dummyToNodeForHorizontalAlignment.get(u[s]).forEach(function(i){t.idToNodeMap.get(i).displacementY=0}):this.idToNodeMap.get(u[s]).displacementY=0;else{for(c=0,l=0,s=0;s<u.length;s++){var d;this.dummyToNodeForHorizontalAlignment.has(u[s])?(c+=(d=this.dummyToNodeForHorizontalAlignment.get(u[s])).length*this.idToNodeMap.get(d[0]).displacementY,l+=d.length):(c+=this.idToNodeMap.get(u[s]).displacementY,l++)}for(v=c/l,s=0;s<u.length;s++)this.dummyToNodeForHorizontalAlignment.has(u[s])?this.dummyToNodeForHorizontalAlignment.get(u[s]).forEach(function(i){t.idToNodeMap.get(i).displacementY=v}):this.idToNodeMap.get(u[s]).displacementY=v}}},M.prototype.calculateNodesToApplyGravitationTo=function(){var t,i,n=[],r=this.graphManager.getGraphs(),s=r.length;for(i=0;i<s;i++)(t=r[i]).updateConnected(),t.isConnected||(n=n.concat(t.getNodes()));return n},M.prototype.createBendpoints=function(){var t=[];t=t.concat(this.graphManager.getAllEdges());var i,n=new Set;for(i=0;i<t.length;i++){var r=t[i];if(!n.has(r)){var s=r.getSource(),e=r.getTarget();if(s==e)r.getBendpoints().push(new v),r.getBendpoints().push(new v),this.createDummyNodesForBendpoints(r),n.add(r);else{var o=[];if(o=(o=o.concat(s.getEdgeListToNode(e))).concat(e.getEdgeListToNode(s)),!n.has(o[0])){var h;if(o.length>1)for(h=0;h<o.length;h++){var a=o[h];a.getBendpoints().push(new v),this.createDummyNodesForBendpoints(a)}o.forEach(function(t){n.add(t)})}}}if(n.size==t.length)break}},M.prototype.positionNodesRadially=function(t){for(var i=new l(0,0),n=Math.ceil(Math.sqrt(t.length)),r=0,s=0,e=0,o=new v(0,0),h=0;h<t.length;h++){h%n==0&&(e=0,s=r,0!=h&&(s+=a.DEFAULT_COMPONENT_SEPERATION),r=0);var f=t[h],u=y.findCenterOfTree(f);i.x=e,i.y=s,(o=M.radialLayout(f,u,i)).y>r&&(r=Math.floor(o.y)),e=Math.floor(o.x+a.DEFAULT_COMPONENT_SEPERATION)}this.transform(new v(c.WORLD_CENTER_X-o.x/2,c.WORLD_CENTER_Y-o.y/2))},M.radialLayout=function(t,i,n){var r=Math.max(this.maxDiagonalInTree(t),a.DEFAULT_RADIAL_SEPARATION);M.branchRadialLayout(i,null,0,359,0,r);var s=g.calculateBounds(t),e=new m;e.setDeviceOrgX(s.getMinX()),e.setDeviceOrgY(s.getMinY()),e.setWorldOrgX(n.x),e.setWorldOrgY(n.y);for(var o=0;o<t.length;o++)t[o].transform(e);var h=new v(s.getMaxX(),s.getMaxY());return e.inverseTransformPoint(h)},M.branchRadialLayout=function(t,i,n,r,s,e){var o=(r-n+1)/2;o<0&&(o+=180);var h=(o+n)%360*w.TWO_PI/360,a=s*Math.cos(h),f=s*Math.sin(h);t.setCenter(a,f);var u=[],c=(u=u.concat(t.getEdges())).length;null!=i&&c--;for(var l,v=0,d=u.length,y=t.getEdgesBetween(i);y.length>1;){var p=y[0];y.splice(0,1);var g=u.indexOf(p);g>=0&&u.splice(g,1),d--,c--}l=null!=i?(u.indexOf(y[0])+1)%d:0;for(var m=Math.abs(r-n)/c,b=l;v!=c;b=++b%d){var k=u[b].getOtherEnd(t);if(k!=i){var x=(n+v*m)%360,S=(x+m)%360;M.branchRadialLayout(k,t,x,S,s+e,e),v++}}},M.maxDiagonalInTree=function(t){for(var i=p.MIN_VALUE,n=0;n<t.length;n++){var r=t[n].getDiagonal();r>i&&(i=r)}return i},M.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},M.prototype.groupZeroDegreeMembers=function(){var t=this,i={};this.memberGroups={},this.idToDummyNode={};for(var n=[],r=this.graphManager.getAllNodes(),s=0;s<r.length;s++){var e=(h=r[s]).getParent();0!==this.getNodeDegreeWithChildren(h)||null!=e.id&&this.getToBeTiled(e)||n.push(h)}for(s=0;s<n.length;s++){var h,a=(h=n[s]).getParent().id;void 0===i[a]&&(i[a]=[]),i[a]=i[a].concat(h)}Object.keys(i).forEach(function(n){if(i[n].length>1){var r="DummyCompound_"+n;t.memberGroups[r]=i[n];var s=i[n][0].getParent(),e=new o(t.graphManager);e.id=r,e.paddingLeft=s.paddingLeft||0,e.paddingRight=s.paddingRight||0,e.paddingBottom=s.paddingBottom||0,e.paddingTop=s.paddingTop||0,t.idToDummyNode[r]=e;var h=t.getGraphManager().add(t.newGraph(),e),a=s.getChild();a.add(e);for(var f=0;f<i[n].length;f++){var u=i[n][f];a.remove(u),h.add(u)}}})},M.prototype.clearCompounds=function(){var t={},i={};this.performDFSOnCompounds();for(var n=0;n<this.compoundOrder.length;n++)i[this.compoundOrder[n].id]=this.compoundOrder[n],t[this.compoundOrder[n].id]=[].concat(this.compoundOrder[n].getChild().getNodes()),this.graphManager.remove(this.compoundOrder[n].getChild()),this.compoundOrder[n].child=null;this.graphManager.resetAllNodes(),this.tileCompoundMembers(t,i)},M.prototype.clearZeroDegreeMembers=function(){var t=this,i=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach(function(n){var r=t.idToDummyNode[n];if(i[n]=t.tileNodes(t.memberGroups[n],r.paddingLeft+r.paddingRight),r.rect.width=i[n].width,r.rect.height=i[n].height,r.setCenter(i[n].centerX,i[n].centerY),r.labelMarginLeft=0,r.labelMarginTop=0,a.NODE_DIMENSIONS_INCLUDE_LABELS){var s=r.rect.width,e=r.rect.height;r.labelWidth&&("left"==r.labelPosHorizontal?(r.rect.x-=r.labelWidth,r.setWidth(s+r.labelWidth),r.labelMarginLeft=r.labelWidth):"center"==r.labelPosHorizontal&&r.labelWidth>s?(r.rect.x-=(r.labelWidth-s)/2,r.setWidth(r.labelWidth),r.labelMarginLeft=(r.labelWidth-s)/2):"right"==r.labelPosHorizontal&&r.setWidth(s+r.labelWidth)),r.labelHeight&&("top"==r.labelPosVertical?(r.rect.y-=r.labelHeight,r.setHeight(e+r.labelHeight),r.labelMarginTop=r.labelHeight):"center"==r.labelPosVertical&&r.labelHeight>e?(r.rect.y-=(r.labelHeight-e)/2,r.setHeight(r.labelHeight),r.labelMarginTop=(r.labelHeight-e)/2):"bottom"==r.labelPosVertical&&r.setHeight(e+r.labelHeight))}})},M.prototype.repopulateCompounds=function(){for(var t=this.compoundOrder.length-1;t>=0;t--){var i=this.compoundOrder[t],n=i.id,r=i.paddingLeft,s=i.paddingTop,e=i.labelMarginLeft,o=i.labelMarginTop;this.adjustLocations(this.tiledMemberPack[n],i.rect.x,i.rect.y,r,s,e,o)}},M.prototype.repopulateZeroDegreeMembers=function(){var t=this,i=this.tiledZeroDegreePack;Object.keys(i).forEach(function(n){var r=t.idToDummyNode[n],s=r.paddingLeft,e=r.paddingTop,o=r.labelMarginLeft,h=r.labelMarginTop;t.adjustLocations(i[n],r.rect.x,r.rect.y,s,e,o,h)})},M.prototype.getToBeTiled=function(t){var i=t.id;if(null!=this.toBeTiled[i])return this.toBeTiled[i];var n=t.getChild();if(null==n)return this.toBeTiled[i]=!1,!1;for(var r=n.getNodes(),s=0;s<r.length;s++){var e=r[s];if(this.getNodeDegree(e)>0)return this.toBeTiled[i]=!1,!1;if(null!=e.getChild()){if(!this.getToBeTiled(e))return this.toBeTiled[i]=!1,!1}else this.toBeTiled[e.id]=!1}return this.toBeTiled[i]=!0,!0},M.prototype.getNodeDegree=function(t){t.id;for(var i=t.getEdges(),n=0,r=0;r<i.length;r++){var s=i[r];s.getSource().id!==s.getTarget().id&&(n+=1)}return n},M.prototype.getNodeDegreeWithChildren=function(t){var i=this.getNodeDegree(t);if(null==t.getChild())return i;for(var n=t.getChild().getNodes(),r=0;r<n.length;r++){var s=n[r];i+=this.getNodeDegreeWithChildren(s)}return i},M.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},M.prototype.fillCompexOrderByDFS=function(t){for(var i=0;i<t.length;i++){var n=t[i];null!=n.getChild()&&this.fillCompexOrderByDFS(n.getChild().getNodes()),this.getToBeTiled(n)&&this.compoundOrder.push(n)}},M.prototype.adjustLocations=function(t,i,n,r,s,e,o){n+=s+o;for(var h=i+=r+e,a=0;a<t.rows.length;a++){var f=t.rows[a];i=h;for(var u=0,c=0;c<f.length;c++){var l=f[c];l.rect.x=i,l.rect.y=n,i+=l.rect.width+t.horizontalPadding,l.rect.height>u&&(u=l.rect.height)}n+=u+t.verticalPadding}},M.prototype.tileCompoundMembers=function(t,i){var n=this;this.tiledMemberPack=[],Object.keys(t).forEach(function(r){var s=i[r];if(n.tiledMemberPack[r]=n.tileNodes(t[r],s.paddingLeft+s.paddingRight),s.rect.width=n.tiledMemberPack[r].width,s.rect.height=n.tiledMemberPack[r].height,s.setCenter(n.tiledMemberPack[r].centerX,n.tiledMemberPack[r].centerY),s.labelMarginLeft=0,s.labelMarginTop=0,a.NODE_DIMENSIONS_INCLUDE_LABELS){var e=s.rect.width,o=s.rect.height;s.labelWidth&&("left"==s.labelPosHorizontal?(s.rect.x-=s.labelWidth,s.setWidth(e+s.labelWidth),s.labelMarginLeft=s.labelWidth):"center"==s.labelPosHorizontal&&s.labelWidth>e?(s.rect.x-=(s.labelWidth-e)/2,s.setWidth(s.labelWidth),s.labelMarginLeft=(s.labelWidth-e)/2):"right"==s.labelPosHorizontal&&s.setWidth(e+s.labelWidth)),s.labelHeight&&("top"==s.labelPosVertical?(s.rect.y-=s.labelHeight,s.setHeight(o+s.labelHeight),s.labelMarginTop=s.labelHeight):"center"==s.labelPosVertical&&s.labelHeight>o?(s.rect.y-=(s.labelHeight-o)/2,s.setHeight(s.labelHeight),s.labelMarginTop=(s.labelHeight-o)/2):"bottom"==s.labelPosVertical&&s.setHeight(o+s.labelHeight))}})},M.prototype.tileNodes=function(t,i){var n=this.tileNodesByFavoringDim(t,i,!0),r=this.tileNodesByFavoringDim(t,i,!1),s=this.getOrgRatio(n);return this.getOrgRatio(r)<s?r:n},M.prototype.getOrgRatio=function(t){var i=t.width/t.height;return i<1&&(i=1/i),i},M.prototype.calcIdealRowWidth=function(t,i){var n=a.TILING_PADDING_VERTICAL,r=a.TILING_PADDING_HORIZONTAL,s=t.length,e=0,o=0,h=0;t.forEach(function(t){e+=t.getWidth(),o+=t.getHeight(),t.getWidth()>h&&(h=t.getWidth())});var f,u=e/s,c=o/s,l=Math.pow(n-r,2)+4*(u+r)*(c+n)*s,v=(r-n+Math.sqrt(l))/(2*(u+r));i?(f=Math.ceil(v))==v&&f++:f=Math.floor(v);var d=f*(u+r)-r;return h>d&&(d=h),d+=2*r},M.prototype.tileNodesByFavoringDim=function(t,i,n){var r=a.TILING_PADDING_VERTICAL,s=a.TILING_PADDING_HORIZONTAL,e=a.TILING_COMPARE_BY,o={rows:[],rowWidth:[],rowHeight:[],width:0,height:i,verticalPadding:r,horizontalPadding:s,centerX:0,centerY:0};e&&(o.idealRowWidth=this.calcIdealRowWidth(t,n));var h=function(t){return t.rect.width*t.rect.height},f=function(t,i){return h(i)-h(t)};t.sort(function(t,i){var n=f;return o.idealRowWidth?(n=e)(t.id,i.id):n(t,i)});for(var u=0,c=0,l=0;l<t.length;l++)u+=(v=t[l]).getCenterX(),c+=v.getCenterY();for(o.centerX=u/t.length,o.centerY=c/t.length,l=0;l<t.length;l++){var v=t[l];if(0==o.rows.length)this.insertNodeToRow(o,v,0,i);else if(this.canAddHorizontal(o,v.rect.width,v.rect.height)){var d=o.rows.length-1;o.idealRowWidth||(d=this.getShortestRowIndex(o)),this.insertNodeToRow(o,v,d,i)}else this.insertNodeToRow(o,v,o.rows.length,i);this.shiftToLastRow(o)}return o},M.prototype.insertNodeToRow=function(t,i,n,r){var s=r;n==t.rows.length&&(t.rows.push([]),t.rowWidth.push(s),t.rowHeight.push(0));var e=t.rowWidth[n]+i.rect.width;t.rows[n].length>0&&(e+=t.horizontalPadding),t.rowWidth[n]=e,t.width<e&&(t.width=e);var o=i.rect.height;n>0&&(o+=t.verticalPadding);var h=0;o>t.rowHeight[n]&&(h=t.rowHeight[n],t.rowHeight[n]=o,h=t.rowHeight[n]-h),t.height+=h,t.rows[n].push(i)},M.prototype.getShortestRowIndex=function(t){for(var i=-1,n=Number.MAX_VALUE,r=0;r<t.rows.length;r++)t.rowWidth[r]<n&&(i=r,n=t.rowWidth[r]);return i},M.prototype.getLongestRowIndex=function(t){for(var i=-1,n=Number.MIN_VALUE,r=0;r<t.rows.length;r++)t.rowWidth[r]>n&&(i=r,n=t.rowWidth[r]);return i},M.prototype.canAddHorizontal=function(t,i,n){if(t.idealRowWidth){var r=t.rows.length-1;return t.rowWidth[r]+i+t.horizontalPadding<=t.idealRowWidth}var s=this.getShortestRowIndex(t);if(s<0)return!0;var e=t.rowWidth[s];if(e+t.horizontalPadding+i<=t.width)return!0;var o,h,a=0;return t.rowHeight[s]<n&&s>0&&(a=n+t.verticalPadding-t.rowHeight[s]),o=t.width-e>=i+t.horizontalPadding?(t.height+a)/(e+i+t.horizontalPadding):(t.height+a)/t.width,a=n+t.verticalPadding,(h=t.width<i?(t.height+a)/i:(t.height+a)/t.width)<1&&(h=1/h),o<1&&(o=1/o),o<h},M.prototype.shiftToLastRow=function(t){var i=this.getLongestRowIndex(t),n=t.rowWidth.length-1,r=t.rows[i],s=r[r.length-1],e=s.width+t.horizontalPadding;if(t.width-t.rowWidth[n]>e&&i!=n){r.splice(-1,1),t.rows[n].push(s),t.rowWidth[i]=t.rowWidth[i]-e,t.rowWidth[n]=t.rowWidth[n]+e,t.width=t.rowWidth[instance.getLongestRowIndex(t)];for(var o=Number.MIN_VALUE,h=0;h<r.length;h++)r[h].height>o&&(o=r[h].height);i>0&&(o+=t.verticalPadding);var a=t.rowHeight[i]+t.rowHeight[n];t.rowHeight[i]=o,t.rowHeight[n]<s.height+t.verticalPadding&&(t.rowHeight[n]=s.height+t.verticalPadding);var f=t.rowHeight[i]+t.rowHeight[n];t.height+=f-a,this.shiftToLastRow(t)}},M.prototype.tilingPreLayout=function(){a.TILE&&(this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers())},M.prototype.tilingPostLayout=function(){a.TILE&&(this.repopulateZeroDegreeMembers(),this.repopulateCompounds())},M.prototype.reduceTrees=function(){for(var t,i=[],n=!0;n;){var r=this.graphManager.getAllNodes(),s=[];n=!1;for(var e=0;e<r.length;e++)if(1==(t=r[e]).getEdges().length&&!t.getEdges()[0].isInterGraph&&null==t.getChild()){if(a.PURE_INCREMENTAL){var o=t.getEdges()[0].getOtherEnd(t),h=new d(t.getCenterX()-o.getCenterX(),t.getCenterY()-o.getCenterY());s.push([t,t.getEdges()[0],t.getOwner(),h])}else s.push([t,t.getEdges()[0],t.getOwner()]);n=!0}if(1==n){for(var f=[],u=0;u<s.length;u++)1==s[u][0].getEdges().length&&(f.push(s[u]),s[u][0].getOwner().remove(s[u][0]));i.push(f),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=i},M.prototype.growTree=function(t){for(var i,n=t[t.length-1],r=0;r<n.length;r++)i=n[r],this.findPlaceforPrunedNode(i),i[2].add(i[0]),i[2].add(i[1],i[1].source,i[1].target);t.splice(t.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},M.prototype.findPlaceforPrunedNode=function(t){var i,n,r=t[0];if(n=r==t[1].source?t[1].target:t[1].source,a.PURE_INCREMENTAL)r.setCenter(n.getCenterX()+t[3].getWidth(),n.getCenterY()+t[3].getHeight());else{var s=n.startX,e=n.finishX,o=n.startY,h=n.finishY,f=[0,0,0,0];if(o>0)for(var c=s;c<=e;c++)f[0]+=this.grid[c][o-1].length+this.grid[c][o].length-1;if(e<this.grid.length-1)for(c=o;c<=h;c++)f[1]+=this.grid[e+1][c].length+this.grid[e][c].length-1;if(h<this.grid[0].length-1)for(c=s;c<=e;c++)f[2]+=this.grid[c][h+1].length+this.grid[c][h].length-1;if(s>0)for(c=o;c<=h;c++)f[3]+=this.grid[s-1][c].length+this.grid[s][c].length-1;for(var l,v,d=p.MAX_VALUE,y=0;y<f.length;y++)f[y]<d?(d=f[y],l=1,v=y):f[y]==d&&l++;if(3==l&&0==d)0==f[0]&&0==f[1]&&0==f[2]?i=1:0==f[0]&&0==f[1]&&0==f[3]?i=0:0==f[0]&&0==f[2]&&0==f[3]?i=3:0==f[1]&&0==f[2]&&0==f[3]&&(i=2);else if(2==l&&0==d){var w=Math.floor(2*Math.random());i=0==f[0]&&0==f[1]?0==w?0:1:0==f[0]&&0==f[2]?0==w?0:2:0==f[0]&&0==f[3]?0==w?0:3:0==f[1]&&0==f[2]?0==w?1:2:0==f[1]&&0==f[3]?0==w?1:3:0==w?2:3}else i=4==l&&0==d?w=Math.floor(4*Math.random()):v;0==i?r.setCenter(n.getCenterX(),n.getCenterY()-n.getHeight()/2-u.DEFAULT_EDGE_LENGTH-r.getHeight()/2):1==i?r.setCenter(n.getCenterX()+n.getWidth()/2+u.DEFAULT_EDGE_LENGTH+r.getWidth()/2,n.getCenterY()):2==i?r.setCenter(n.getCenterX(),n.getCenterY()+n.getHeight()/2+u.DEFAULT_EDGE_LENGTH+r.getHeight()/2):r.setCenter(n.getCenterX()-n.getWidth()/2-u.DEFAULT_EDGE_LENGTH-r.getWidth()/2,n.getCenterY())}},t.exports=M},991:(t,i,n)=>{var r=n(551).FDLayoutNode,s=n(551).IMath;function e(t,i,n,s){r.call(this,t,i,n,s)}for(var o in e.prototype=Object.create(r.prototype),r)e[o]=r[o];e.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*s.sign(this.displacementX)),Math.abs(this.displacementY)>t.coolingFactor*t.maxNodeDisplacement&&(this.displacementY=t.coolingFactor*t.maxNodeDisplacement*s.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},e.prototype.propogateDisplacementToChildren=function(t,i){for(var n,r=this.getChild().getNodes(),s=0;s<r.length;s++)null==(n=r[s]).getChild()?(n.displacementX+=t,n.displacementY+=i):n.propogateDisplacementToChildren(t,i)},e.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},e.prototype.setPred1=function(t){this.pred1=t},e.prototype.getPred1=function(){return pred1},e.prototype.getPred2=function(){return pred2},e.prototype.setNext=function(t){this.next=t},e.prototype.getNext=function(){return next},e.prototype.setProcessed=function(t){this.processed=t},e.prototype.isProcessed=function(){return processed},t.exports=e},902:(t,i,n)=>{function r(t){if(Array.isArray(t)){for(var i=0,n=Array(t.length);i<t.length;i++)n[i]=t[i];return n}return Array.from(t)}var s=n(806),e=n(551).LinkedList,o=n(551).Matrix,h=n(551).SVD;function a(){}a.handleConstraints=function(t){var i={};i.fixedNodeConstraint=t.constraints.fixedNodeConstraint,i.alignmentConstraint=t.constraints.alignmentConstraint,i.relativePlacementConstraint=t.constraints.relativePlacementConstraint;for(var n=new Map,a=new Map,f=[],u=[],c=t.getAllNodes(),l=0,v=0;v<c.length;v++){var d=c[v];null==d.getChild()&&(a.set(d.id,l++),f.push(d.getCenterX()),u.push(d.getCenterY()),n.set(d.id,d))}i.relativePlacementConstraint&&i.relativePlacementConstraint.forEach(function(t){t.gap||0==t.gap||(t.left?t.gap=s.DEFAULT_EDGE_LENGTH+n.get(t.left).getWidth()/2+n.get(t.right).getWidth()/2:t.gap=s.DEFAULT_EDGE_LENGTH+n.get(t.top).getHeight()/2+n.get(t.bottom).getHeight()/2)});var y=function(t){var i=0,n=0;return t.forEach(function(t){i+=f[a.get(t)],n+=u[a.get(t)]}),{x:i/t.size,y:n/t.size}},p=function(t,i,n,s,o){var h=new Map;t.forEach(function(t,i){h.set(i,0)}),t.forEach(function(t,i){t.forEach(function(t){h.set(t.id,h.get(t.id)+1)})});var c=new Map,l=new Map,v=new e;h.forEach(function(t,r){0==t?(v.push(r),n||("horizontal"==i?c.set(r,a.has(r)?f[a.get(r)]:s.get(r)):c.set(r,a.has(r)?u[a.get(r)]:s.get(r)))):c.set(r,Number.NEGATIVE_INFINITY),n&&l.set(r,new Set([r]))}),n&&o.forEach(function(t){var r=[];if(t.forEach(function(t){n.has(t)&&r.push(t)}),r.length>0){var e=0;r.forEach(function(t){"horizontal"==i?(c.set(t,a.has(t)?f[a.get(t)]:s.get(t)),e+=c.get(t)):(c.set(t,a.has(t)?u[a.get(t)]:s.get(t)),e+=c.get(t))}),e/=r.length,t.forEach(function(t){n.has(t)||c.set(t,e)})}else{var o=0;t.forEach(function(t){o+="horizontal"==i?a.has(t)?f[a.get(t)]:s.get(t):a.has(t)?u[a.get(t)]:s.get(t)}),o/=t.length,t.forEach(function(t){c.set(t,o)})}});for(var d=function(){var r=v.shift();t.get(r).forEach(function(t){if(c.get(t.id)<c.get(r)+t.gap)if(n&&n.has(t.id)){var e=void 0;if(e="horizontal"==i?a.has(t.id)?f[a.get(t.id)]:s.get(t.id):a.has(t.id)?u[a.get(t.id)]:s.get(t.id),c.set(t.id,e),e<c.get(r)+t.gap){var o=c.get(r)+t.gap-e;l.get(r).forEach(function(t){c.set(t,c.get(t)-o)})}}else c.set(t.id,c.get(r)+t.gap);h.set(t.id,h.get(t.id)-1),0==h.get(t.id)&&v.push(t.id),n&&l.set(t.id,function(t,i){var n=new Set(t),r=!0,s=!1,e=void 0;try{for(var o,h=i[Symbol.iterator]();!(r=(o=h.next()).done);r=!0){var a=o.value;n.add(a)}}catch(f){s=!0,e=f}finally{try{!r&&h.return&&h.return()}finally{if(s)throw e}}return n}(l.get(r),l.get(t.id)))})};0!=v.length;)d();if(n){var y=new Set;t.forEach(function(t,i){0==t.length&&y.add(i)});var p=[];l.forEach(function(t,i){if(y.has(i)){var s=!1,e=!0,o=!1,h=void 0;try{for(var a,f=t[Symbol.iterator]();!(e=(a=f.next()).done);e=!0){var u=a.value;n.has(u)&&(s=!0)}}catch(v){o=!0,h=v}finally{try{!e&&f.return&&f.return()}finally{if(o)throw h}}if(!s){var c=!1,l=void 0;p.forEach(function(i,n){i.has([].concat(r(t))[0])&&(c=!0,l=n)}),c?t.forEach(function(t){p[l].add(t)}):p.push(new Set(t))}}}),p.forEach(function(t,n){var r=Number.POSITIVE_INFINITY,e=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,h=Number.NEGATIVE_INFINITY,l=!0,v=!1,d=void 0;try{for(var y,p=t[Symbol.iterator]();!(l=(y=p.next()).done);l=!0){var w=y.value,g=void 0;g="horizontal"==i?a.has(w)?f[a.get(w)]:s.get(w):a.has(w)?u[a.get(w)]:s.get(w);var m=c.get(w);g<r&&(r=g),g>o&&(o=g),m<e&&(e=m),m>h&&(h=m)}}catch(O){v=!0,d=O}finally{try{!l&&p.return&&p.return()}finally{if(v)throw d}}var b=(r+o)/2-(e+h)/2,M=!0,k=!1,x=void 0;try{for(var S,$=t[Symbol.iterator]();!(M=(S=$.next()).done);M=!0){var j=S.value;c.set(j,c.get(j)+b)}}catch(O){k=!0,x=O}finally{try{!M&&$.return&&$.return()}finally{if(k)throw x}}})}return c},w=function(t){var i=0,n=0,r=0,s=0;if(t.forEach(function(t){t.left?f[a.get(t.left)]-f[a.get(t.right)]>=0?i++:n++:u[a.get(t.top)]-u[a.get(t.bottom)]>=0?r++:s++}),i>n&&r>s)for(var e=0;e<a.size;e++)f[e]=-1*f[e],u[e]=-1*u[e];else if(i>n)for(var o=0;o<a.size;o++)f[o]=-1*f[o];else if(r>s)for(var h=0;h<a.size;h++)u[h]=-1*u[h]},g=function(t){var i=[],n=new e,r=new Set,s=0;return t.forEach(function(e,o){if(!r.has(o)){i[s]=[];var h=o;for(n.push(h),r.add(h),i[s].push(h);0!=n.length;)h=n.shift(),t.get(h).forEach(function(t){r.has(t.id)||(n.push(t.id),r.add(t.id),i[s].push(t.id))});s++}}),i},m=function(t){var i=new Map;return t.forEach(function(t,n){i.set(n,[])}),t.forEach(function(t,n){t.forEach(function(t){i.get(n).push(t),i.get(t.id).push({id:n,gap:t.gap,direction:t.direction})})}),i},b=function(t){var i=new Map;return t.forEach(function(t,n){i.set(n,[])}),t.forEach(function(t,n){t.forEach(function(t){i.get(t.id).push({id:n,gap:t.gap,direction:t.direction})})}),i},M=[],k=[],x=!1,S=!1,$=new Set,j=new Map,O=new Map,A=[];if(i.fixedNodeConstraint&&i.fixedNodeConstraint.forEach(function(t){$.add(t.nodeId)}),i.relativePlacementConstraint&&(i.relativePlacementConstraint.forEach(function(t){t.left?(j.has(t.left)?j.get(t.left).push({id:t.right,gap:t.gap,direction:"horizontal"}):j.set(t.left,[{id:t.right,gap:t.gap,direction:"horizontal"}]),j.has(t.right)||j.set(t.right,[])):(j.has(t.top)?j.get(t.top).push({id:t.bottom,gap:t.gap,direction:"vertical"}):j.set(t.top,[{id:t.bottom,gap:t.gap,direction:"vertical"}]),j.has(t.bottom)||j.set(t.bottom,[]))}),O=m(j),A=g(O)),s.TRANSFORM_ON_CONSTRAINT_HANDLING){if(i.fixedNodeConstraint&&i.fixedNodeConstraint.length>1)i.fixedNodeConstraint.forEach(function(t,i){M[i]=[t.position.x,t.position.y],k[i]=[f[a.get(t.nodeId)],u[a.get(t.nodeId)]]}),x=!0;else if(i.alignmentConstraint)!function(){var t=0;if(i.alignmentConstraint.vertical){for(var n=i.alignmentConstraint.vertical,s=function(i){var s=new Set;n[i].forEach(function(t){s.add(t)});var e=new Set([].concat(r(s)).filter(function(t){return $.has(t)})),o=void 0;o=e.size>0?f[a.get(e.values().next().value)]:y(s).x,n[i].forEach(function(i){M[t]=[o,u[a.get(i)]],k[t]=[f[a.get(i)],u[a.get(i)]],t++})},e=0;e<n.length;e++)s(e);x=!0}if(i.alignmentConstraint.horizontal){for(var o=i.alignmentConstraint.horizontal,h=function(i){var n=new Set;o[i].forEach(function(t){n.add(t)});var s=new Set([].concat(r(n)).filter(function(t){return $.has(t)})),e=void 0;e=s.size>0?f[a.get(s.values().next().value)]:y(n).y,o[i].forEach(function(i){M[t]=[f[a.get(i)],e],k[t]=[f[a.get(i)],u[a.get(i)]],t++})},c=0;c<o.length;c++)h(c);x=!0}i.relativePlacementConstraint&&(S=!0)}();else if(i.relativePlacementConstraint){for(var T=0,I=0,E=0;E<A.length;E++)A[E].length>T&&(T=A[E].length,I=E);if(T<O.size/2)w(i.relativePlacementConstraint),x=!1,S=!1;else{var L=new Map,D=new Map,N=[];A[I].forEach(function(t){j.get(t).forEach(function(i){"horizontal"==i.direction?(L.has(t)?L.get(t).push(i):L.set(t,[i]),L.has(i.id)||L.set(i.id,[]),N.push({left:t,right:i.id})):(D.has(t)?D.get(t).push(i):D.set(t,[i]),D.has(i.id)||D.set(i.id,[]),N.push({top:t,bottom:i.id}))})}),w(N),S=!1;var z=p(L,"horizontal"),B=p(D,"vertical");A[I].forEach(function(t,i){k[i]=[f[a.get(t)],u[a.get(t)]],M[i]=[],z.has(t)?M[i][0]=z.get(t):M[i][0]=f[a.get(t)],B.has(t)?M[i][1]=B.get(t):M[i][1]=u[a.get(t)]}),x=!0}}if(x){for(var C,P=o.transpose(M),R=o.transpose(k),G=0;G<P.length;G++)P[G]=o.multGamma(P[G]),R[G]=o.multGamma(R[G]);var q=o.multMat(P,o.transpose(R)),F=h.svd(q);C=o.multMat(F.V,o.transpose(F.U));for(var X=0;X<a.size;X++){var Y=[f[X],u[X]],_=[C[0][0],C[1][0]],H=[C[0][1],C[1][1]];f[X]=o.dotProduct(Y,_),u[X]=o.dotProduct(Y,H)}S&&w(i.relativePlacementConstraint)}}if(s.ENFORCE_CONSTRAINTS){if(i.fixedNodeConstraint&&i.fixedNodeConstraint.length>0){var Z={x:0,y:0};i.fixedNodeConstraint.forEach(function(t,i){var n,r,s={x:f[a.get(t.nodeId)],y:u[a.get(t.nodeId)]},e=t.position,o=(r=s,{x:(n=e).x-r.x,y:n.y-r.y});Z.x+=o.x,Z.y+=o.y}),Z.x/=i.fixedNodeConstraint.length,Z.y/=i.fixedNodeConstraint.length,f.forEach(function(t,i){f[i]+=Z.x}),u.forEach(function(t,i){u[i]+=Z.y}),i.fixedNodeConstraint.forEach(function(t){f[a.get(t.nodeId)]=t.position.x,u[a.get(t.nodeId)]=t.position.y})}if(i.alignmentConstraint){if(i.alignmentConstraint.vertical)for(var J=i.alignmentConstraint.vertical,V=function(t){var i=new Set;J[t].forEach(function(t){i.add(t)});var n=new Set([].concat(r(i)).filter(function(t){return $.has(t)})),s=void 0;s=n.size>0?f[a.get(n.values().next().value)]:y(i).x,i.forEach(function(t){$.has(t)||(f[a.get(t)]=s)})},W=0;W<J.length;W++)V(W);if(i.alignmentConstraint.horizontal)for(var U=i.alignmentConstraint.horizontal,K=function(t){var i=new Set;U[t].forEach(function(t){i.add(t)});var n=new Set([].concat(r(i)).filter(function(t){return $.has(t)})),s=void 0;s=n.size>0?u[a.get(n.values().next().value)]:y(i).y,i.forEach(function(t){$.has(t)||(u[a.get(t)]=s)})},Q=0;Q<U.length;Q++)K(Q)}i.relativePlacementConstraint&&function(){var t=new Map,n=new Map,r=new Map,s=new Map,e=new Map,o=new Map,h=new Set,c=new Set;if($.forEach(function(t){h.add(t),c.add(t)}),i.alignmentConstraint){if(i.alignmentConstraint.vertical)for(var l=i.alignmentConstraint.vertical,v=function(i){r.set("dummy"+i,[]),l[i].forEach(function(n){t.set(n,"dummy"+i),r.get("dummy"+i).push(n),$.has(n)&&h.add("dummy"+i)}),e.set("dummy"+i,f[a.get(l[i][0])])},d=0;d<l.length;d++)v(d);if(i.alignmentConstraint.horizontal)for(var y=i.alignmentConstraint.horizontal,w=function(t){s.set("dummy"+t,[]),y[t].forEach(function(i){n.set(i,"dummy"+t),s.get("dummy"+t).push(i),$.has(i)&&c.add("dummy"+t)}),o.set("dummy"+t,u[a.get(y[t][0])])},M=0;M<y.length;M++)w(M)}var k=new Map,x=new Map,S=function(i){j.get(i).forEach(function(r){var s=void 0,e=void 0;"horizontal"==r.direction?(s=t.get(i)?t.get(i):i,e=t.get(r.id)?{id:t.get(r.id),gap:r.gap,direction:r.direction}:r,k.has(s)?k.get(s).push(e):k.set(s,[e]),k.has(e.id)||k.set(e.id,[])):(s=n.get(i)?n.get(i):i,e=n.get(r.id)?{id:n.get(r.id),gap:r.gap,direction:r.direction}:r,x.has(s)?x.get(s).push(e):x.set(s,[e]),x.has(e.id)||x.set(e.id,[]))})},O=!0,A=!1,T=void 0;try{for(var I,E=j.keys()[Symbol.iterator]();!(O=(I=E.next()).done);O=!0)S(I.value)}catch(tt){A=!0,T=tt}finally{try{!O&&E.return&&E.return()}finally{if(A)throw T}}var L=m(k),D=m(x),N=g(L),z=g(D),B=b(k),C=b(x),P=[],R=[];N.forEach(function(t,i){P[i]=[],t.forEach(function(t){0==B.get(t).length&&P[i].push(t)})}),z.forEach(function(t,i){R[i]=[],t.forEach(function(t){0==C.get(t).length&&R[i].push(t)})});var G=p(k,"horizontal",h,e,P),q=p(x,"vertical",c,o,R),F=function(t){r.get(t)?r.get(t).forEach(function(i){f[a.get(i)]=G.get(t)}):f[a.get(t)]=G.get(t)},X=!0,Y=!1,_=void 0;try{for(var H,Z=G.keys()[Symbol.iterator]();!(X=(H=Z.next()).done);X=!0)F(H.value)}catch(tt){Y=!0,_=tt}finally{try{!X&&Z.return&&Z.return()}finally{if(Y)throw _}}var J=function(t){s.get(t)?s.get(t).forEach(function(i){u[a.get(i)]=q.get(t)}):u[a.get(t)]=q.get(t)},V=!0,W=!1,U=void 0;try{for(var K,Q=q.keys()[Symbol.iterator]();!(V=(K=Q.next()).done);V=!0)J(K.value)}catch(tt){W=!0,U=tt}finally{try{!V&&Q.return&&Q.return()}finally{if(W)throw U}}}()}for(var tt=0;tt<c.length;tt++){var it=c[tt];null==it.getChild()&&it.setCenter(f[a.get(it.id)],u[a.get(it.id)])}},t.exports=a},551:i=>{i.exports=t}},n={},function t(r){var s=n[r];if(void 0!==s)return s.exports;var e=n[r]={exports:{}};return i[r](e,e.exports,t),e.exports}(45);var i,n},T.exports=t(E()));var t}var N,z,B,C;const P=i(N?A.exports:(N=1,A.exports=(z=D(),B={658:t=>{t.exports=null!=Object.assign?Object.assign.bind(Object):function(t){for(var i=arguments.length,n=Array(i>1?i-1:0),r=1;r<i;r++)n[r-1]=arguments[r];return n.forEach(function(i){Object.keys(i).forEach(function(n){return t[n]=i[n]})}),t}},548:(t,i,n)=>{var r=function(){return function(t,i){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,i){var n=[],r=!0,s=!1,e=void 0;try{for(var o,h=t[Symbol.iterator]();!(r=(o=h.next()).done)&&(n.push(o.value),!i||n.length!==i);r=!0);}catch(a){s=!0,e=a}finally{try{!r&&h.return&&h.return()}finally{if(s)throw e}}return n}(t,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),s=n(140).layoutBase.LinkedList,e={getTopMostNodes:function(t){for(var i={},n=0;n<t.length;n++)i[t[n].id()]=!0;return t.filter(function(t,n){"number"==typeof t&&(t=n);for(var r=t.parent()[0];null!=r;){if(i[r.id()])return!1;r=r.parent()[0]}return!0})},connectComponents:function(t,i,n,r){var e=new s,o=new Set,h=[],a=void 0,f=void 0,u=void 0,c=!1,l=1,v=[],d=[],y=function(){var r=t.collection();d.push(r);var s=n[0],y=t.collection();y.merge(s).merge(s.descendants().intersection(i)),h.push(s),y.forEach(function(t){e.push(t),o.add(t),r.merge(t)});for(var p=function(){s=e.shift();var f=t.collection();s.neighborhood().nodes().forEach(function(t){i.intersection(s.edgesWith(t)).length>0&&f.merge(t)});for(var u=0;u<f.length;u++){var c=f[u];null==(a=n.intersection(c.union(c.ancestors())))||o.has(a[0])||a.union(a.descendants()).forEach(function(t){e.push(t),o.add(t),r.merge(t),n.has(t)&&h.push(t)})}};0!=e.length;)p();if(r.forEach(function(t){i.intersection(t.connectedEdges()).forEach(function(t){r.has(t.source())&&r.has(t.target())&&r.merge(t)})}),h.length==n.length&&(c=!0),!c||c&&l>1){f=h[0],u=f.connectedEdges().length,h.forEach(function(t){t.connectedEdges().length<u&&(u=t.connectedEdges().length,f=t)}),v.push(f.id());var w=t.collection();w.merge(h[0]),h.forEach(function(t){w.merge(t)}),h=[],n=n.difference(w),l++}};do{y()}while(!c);return r&&v.length>0&&r.set("dummy"+(r.size+1),v),d},relocateComponent:function(t,i,n){if(!n.fixedNodeConstraint){var s=Number.POSITIVE_INFINITY,e=Number.NEGATIVE_INFINITY,o=Number.POSITIVE_INFINITY,h=Number.NEGATIVE_INFINITY;if("draft"==n.quality){var a=!0,f=!1,u=void 0;try{for(var c,l=i.nodeIndexes[Symbol.iterator]();!(a=(c=l.next()).done);a=!0){var v=c.value,d=r(v,2),y=d[0],p=d[1],w=n.cy.getElementById(y);if(w){var g=w.boundingBox(),m=i.xCoords[p]-g.w/2,b=i.xCoords[p]+g.w/2,M=i.yCoords[p]-g.h/2,k=i.yCoords[p]+g.h/2;m<s&&(s=m),b>e&&(e=b),M<o&&(o=M),k>h&&(h=k)}}}catch(O){f=!0,u=O}finally{try{!a&&l.return&&l.return()}finally{if(f)throw u}}var x=t.x-(e+s)/2,S=t.y-(h+o)/2;i.xCoords=i.xCoords.map(function(t){return t+x}),i.yCoords=i.yCoords.map(function(t){return t+S})}else{Object.keys(i).forEach(function(t){var n=i[t],r=n.getRect().x,a=n.getRect().x+n.getRect().width,f=n.getRect().y,u=n.getRect().y+n.getRect().height;r<s&&(s=r),a>e&&(e=a),f<o&&(o=f),u>h&&(h=u)});var $=t.x-(e+s)/2,j=t.y-(h+o)/2;Object.keys(i).forEach(function(t){var n=i[t];n.setCenter(n.getCenterX()+$,n.getCenterY()+j)})}}},calcBoundingBox:function(t,i,n,r){for(var s=Number.MAX_SAFE_INTEGER,e=Number.MIN_SAFE_INTEGER,o=Number.MAX_SAFE_INTEGER,h=Number.MIN_SAFE_INTEGER,a=void 0,f=void 0,u=void 0,c=void 0,l=t.descendants().not(":parent"),v=l.length,d=0;d<v;d++){var y=l[d];s>(a=i[r.get(y.id())]-y.width()/2)&&(s=a),e<(f=i[r.get(y.id())]+y.width()/2)&&(e=f),o>(u=n[r.get(y.id())]-y.height()/2)&&(o=u),h<(c=n[r.get(y.id())]+y.height()/2)&&(h=c)}var p={};return p.topLeftX=s,p.topLeftY=o,p.width=e-s,p.height=h-o,p},calcParentsWithoutChildren:function(t,i){var n=t.collection();return i.nodes(":parent").forEach(function(t){var i=!1;t.children().forEach(function(t){"none"!=t.css("display")&&(i=!0)}),i||n.merge(t)}),n}};t.exports=e},816:(t,i,n)=>{var r=n(548),s=n(140).CoSELayout,e=n(140).CoSENode,o=n(140).layoutBase.PointD,h=n(140).layoutBase.DimensionD,a=n(140).layoutBase.LayoutConstants,f=n(140).layoutBase.FDLayoutConstants,u=n(140).CoSEConstants;t.exports={coseLayout:function(t,i){var n=t.cy,c=t.eles,l=c.nodes(),v=c.edges(),d=void 0,y=void 0,p=void 0,w={};t.randomize&&(d=i.nodeIndexes,y=i.xCoords,p=i.yCoords);var g=function(t){return"function"==typeof t},m=function(t,i){return g(t)?t(i):t},b=r.calcParentsWithoutChildren(n,c);null!=t.nestingFactor&&(u.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=f.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=t.nestingFactor),null!=t.gravity&&(u.DEFAULT_GRAVITY_STRENGTH=f.DEFAULT_GRAVITY_STRENGTH=t.gravity),null!=t.numIter&&(u.MAX_ITERATIONS=f.MAX_ITERATIONS=t.numIter),null!=t.gravityRange&&(u.DEFAULT_GRAVITY_RANGE_FACTOR=f.DEFAULT_GRAVITY_RANGE_FACTOR=t.gravityRange),null!=t.gravityCompound&&(u.DEFAULT_COMPOUND_GRAVITY_STRENGTH=f.DEFAULT_COMPOUND_GRAVITY_STRENGTH=t.gravityCompound),null!=t.gravityRangeCompound&&(u.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=f.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=t.gravityRangeCompound),null!=t.initialEnergyOnIncremental&&(u.DEFAULT_COOLING_FACTOR_INCREMENTAL=f.DEFAULT_COOLING_FACTOR_INCREMENTAL=t.initialEnergyOnIncremental),null!=t.tilingCompareBy&&(u.TILING_COMPARE_BY=t.tilingCompareBy),"proof"==t.quality?a.QUALITY=2:a.QUALITY=0,u.NODE_DIMENSIONS_INCLUDE_LABELS=f.NODE_DIMENSIONS_INCLUDE_LABELS=a.NODE_DIMENSIONS_INCLUDE_LABELS=t.nodeDimensionsIncludeLabels,u.DEFAULT_INCREMENTAL=f.DEFAULT_INCREMENTAL=a.DEFAULT_INCREMENTAL=!t.randomize,u.ANIMATE=f.ANIMATE=a.ANIMATE=t.animate,u.TILE=t.tile,u.TILING_PADDING_VERTICAL="function"==typeof t.tilingPaddingVertical?t.tilingPaddingVertical.call():t.tilingPaddingVertical,u.TILING_PADDING_HORIZONTAL="function"==typeof t.tilingPaddingHorizontal?t.tilingPaddingHorizontal.call():t.tilingPaddingHorizontal,u.DEFAULT_INCREMENTAL=f.DEFAULT_INCREMENTAL=a.DEFAULT_INCREMENTAL=!0,u.PURE_INCREMENTAL=!t.randomize,a.DEFAULT_UNIFORM_LEAF_NODE_SIZES=t.uniformNodeDimensions,"transformed"==t.step&&(u.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,u.ENFORCE_CONSTRAINTS=!1,u.APPLY_LAYOUT=!1),"enforced"==t.step&&(u.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,u.ENFORCE_CONSTRAINTS=!0,u.APPLY_LAYOUT=!1),"cose"==t.step&&(u.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,u.ENFORCE_CONSTRAINTS=!1,u.APPLY_LAYOUT=!0),"all"==t.step&&(t.randomize?u.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:u.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,u.ENFORCE_CONSTRAINTS=!0,u.APPLY_LAYOUT=!0),t.fixedNodeConstraint||t.alignmentConstraint||t.relativePlacementConstraint?u.TREE_REDUCTION_ON_INCREMENTAL=!1:u.TREE_REDUCTION_ON_INCREMENTAL=!0;var M,k,x=new s,S=x.newGraphManager();return function t(i,n,s,a){for(var f=n.length,u=0;u<f;u++){var c=n[u],l=null;0==c.intersection(b).length&&(l=c.children());var v=void 0,g=c.layoutDimensions({nodeDimensionsIncludeLabels:a.nodeDimensionsIncludeLabels});if(null!=c.outerWidth()&&null!=c.outerHeight())if(a.randomize)if(c.isParent()){var M=r.calcBoundingBox(c,y,p,d);v=0==c.intersection(b).length?i.add(new e(s.graphManager,new o(M.topLeftX,M.topLeftY),new h(M.width,M.height))):i.add(new e(s.graphManager,new o(M.topLeftX,M.topLeftY),new h(parseFloat(g.w),parseFloat(g.h))))}else v=i.add(new e(s.graphManager,new o(y[d.get(c.id())]-g.w/2,p[d.get(c.id())]-g.h/2),new h(parseFloat(g.w),parseFloat(g.h))));else v=i.add(new e(s.graphManager,new o(c.position("x")-g.w/2,c.position("y")-g.h/2),new h(parseFloat(g.w),parseFloat(g.h))));else v=i.add(new e(this.graphManager));v.id=c.data("id"),v.nodeRepulsion=m(a.nodeRepulsion,c),v.paddingLeft=parseInt(c.css("padding")),v.paddingTop=parseInt(c.css("padding")),v.paddingRight=parseInt(c.css("padding")),v.paddingBottom=parseInt(c.css("padding")),a.nodeDimensionsIncludeLabels&&(v.labelWidth=c.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).w,v.labelHeight=c.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).h,v.labelPosVertical=c.css("text-valign"),v.labelPosHorizontal=c.css("text-halign")),w[c.data("id")]=v,isNaN(v.rect.x)&&(v.rect.x=0),isNaN(v.rect.y)&&(v.rect.y=0),null!=l&&l.length>0&&t(s.getGraphManager().add(s.newGraph(),v),l,s,a)}}(S.addRoot(),r.getTopMostNodes(l),x,t),function(i,n,r){for(var s=0,e=0,o=0;o<r.length;o++){var h=r[o],a=w[h.data("source")],c=w[h.data("target")];if(a&&c&&a!==c&&0==a.getEdgesBetween(c).length){var l=n.add(i.newEdge(),a,c);l.id=h.id(),l.idealLength=m(t.idealEdgeLength,h),l.edgeElasticity=m(t.edgeElasticity,h),s+=l.idealLength,e++}}null!=t.idealEdgeLength&&(e>0?u.DEFAULT_EDGE_LENGTH=f.DEFAULT_EDGE_LENGTH=s/e:g(t.idealEdgeLength)?u.DEFAULT_EDGE_LENGTH=f.DEFAULT_EDGE_LENGTH=50:u.DEFAULT_EDGE_LENGTH=f.DEFAULT_EDGE_LENGTH=t.idealEdgeLength,u.MIN_REPULSION_DIST=f.MIN_REPULSION_DIST=f.DEFAULT_EDGE_LENGTH/10,u.DEFAULT_RADIAL_SEPARATION=f.DEFAULT_EDGE_LENGTH)}(x,S,v),M=x,(k=t).fixedNodeConstraint&&(M.constraints.fixedNodeConstraint=k.fixedNodeConstraint),k.alignmentConstraint&&(M.constraints.alignmentConstraint=k.alignmentConstraint),k.relativePlacementConstraint&&(M.constraints.relativePlacementConstraint=k.relativePlacementConstraint),x.runLayout(),w}}},212:(t,i,n)=>{var r=function(){function t(t,i){for(var n=0;n<i.length;n++){var r=i[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(i,n,r){return n&&t(i.prototype,n),r&&t(i,r),i}}(),s=n(658),e=n(548),o=n(657).spectralLayout,h=n(816).coseLayout,a=Object.freeze({quality:"default",randomize:!0,animate:!0,animationDuration:1e3,animationEasing:void 0,fit:!0,padding:30,nodeDimensionsIncludeLabels:!1,uniformNodeDimensions:!1,packComponents:!0,step:"all",samplingType:!0,sampleSize:25,nodeSeparation:75,piTol:1e-7,nodeRepulsion:function(t){return 4500},idealEdgeLength:function(t){return 50},edgeElasticity:function(t){return.45},nestingFactor:.1,gravity:.25,numIter:2500,tile:!0,tilingCompareBy:void 0,tilingPaddingVertical:10,tilingPaddingHorizontal:10,gravityRangeCompound:1.5,gravityCompound:1,gravityRange:3.8,initialEnergyOnIncremental:.3,fixedNodeConstraint:void 0,alignmentConstraint:void 0,relativePlacementConstraint:void 0,ready:function(){},stop:function(){}}),f=function(){function t(i){!function(t,i){if(!(t instanceof i))throw new TypeError("Cannot call a class as a function")}(this,t),this.options=s({},a,i)}return r(t,[{key:"run",value:function(){var t=this.options,i=t.cy,n=t.eles,r=[],s=[],a=void 0,f=[];!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 u=void 0,c=!1;if(i.layoutUtilities&&t.packComponents&&((u=i.layoutUtilities("get"))||(u=i.layoutUtilities()),c=!0),n.nodes().length>0)if(c){var l=e.getTopMostNodes(t.eles.nodes());if((a=e.connectComponents(i,t.eles,l)).forEach(function(t){var i=t.boundingBox();f.push({x:i.x1+i.w/2,y:i.y1+i.h/2})}),t.randomize&&a.forEach(function(i){t.eles=i,r.push(o(t))}),"default"==t.quality||"proof"==t.quality){var v=i.collection();if(t.tile){var d=0,y={nodeIndexes:new Map,xCoords:[],yCoords:[]},p=[];if(a.forEach(function(t,i){0==t.edges().length&&(t.nodes().forEach(function(i,n){v.merge(t.nodes()[n]),i.isParent()||(y.nodeIndexes.set(t.nodes()[n].id(),d++),y.xCoords.push(t.nodes()[0].position().x),y.yCoords.push(t.nodes()[0].position().y))}),p.push(i))}),v.length>1){var w=v.boundingBox();f.push({x:w.x1+w.w/2,y:w.y1+w.h/2}),a.push(v),r.push(y);for(var g=p.length-1;g>=0;g--)a.splice(p[g],1),r.splice(p[g],1),f.splice(p[g],1)}}a.forEach(function(i,n){t.eles=i,s.push(h(t,r[n])),e.relocateComponent(f[n],s[n],t)})}else a.forEach(function(i,n){e.relocateComponent(f[n],r[n],t)});var m=new Set;if(a.length>1){var b=[],M=n.filter(function(t){return"none"==t.css("display")});a.forEach(function(i,n){var o=void 0;if("draft"==t.quality&&(o=r[n].nodeIndexes),i.nodes().not(M).length>0){var h={edges:[],nodes:[]},a=void 0;i.nodes().not(M).forEach(function(i){if("draft"==t.quality)if(i.isParent()){var f=e.calcBoundingBox(i,r[n].xCoords,r[n].yCoords,o);h.nodes.push({x:f.topLeftX,y:f.topLeftY,width:f.width,height:f.height})}else a=o.get(i.id()),h.nodes.push({x:r[n].xCoords[a]-i.boundingbox().w/2,y:r[n].yCoords[a]-i.boundingbox().h/2,width:i.boundingbox().w,height:i.boundingbox().h});else s[n][i.id()]&&h.nodes.push({x:s[n][i.id()].getLeft(),y:s[n][i.id()].getTop(),width:s[n][i.id()].getWidth(),height:s[n][i.id()].getHeight()})}),i.edges().forEach(function(i){var a=i.source(),f=i.target();if("none"!=a.css("display")&&"none"!=f.css("display"))if("draft"==t.quality){var u=o.get(a.id()),c=o.get(f.id()),l=[],v=[];if(a.isParent()){var d=e.calcBoundingBox(a,r[n].xCoords,r[n].yCoords,o);l.push(d.topLeftX+d.width/2),l.push(d.topLeftY+d.height/2)}else l.push(r[n].xCoords[u]),l.push(r[n].yCoords[u]);if(f.isParent()){var y=e.calcBoundingBox(f,r[n].xCoords,r[n].yCoords,o);v.push(y.topLeftX+y.width/2),v.push(y.topLeftY+y.height/2)}else v.push(r[n].xCoords[c]),v.push(r[n].yCoords[c]);h.edges.push({startX:l[0],startY:l[1],endX:v[0],endY:v[1]})}else s[n][a.id()]&&s[n][f.id()]&&h.edges.push({startX:s[n][a.id()].getCenterX(),startY:s[n][a.id()].getCenterY(),endX:s[n][f.id()].getCenterX(),endY:s[n][f.id()].getCenterY()})}),h.nodes.length>0&&(b.push(h),m.add(n))}});var k=u.packComponents(b,t.randomize).shifts;if("draft"==t.quality)r.forEach(function(t,i){var n=t.xCoords.map(function(t){return t+k[i].dx}),r=t.yCoords.map(function(t){return t+k[i].dy});t.xCoords=n,t.yCoords=r});else{var x=0;m.forEach(function(t){Object.keys(s[t]).forEach(function(i){var n=s[t][i];n.setCenter(n.getCenterX()+k[x].dx,n.getCenterY()+k[x].dy)}),x++})}}}else{var S=t.eles.boundingBox();if(f.push({x:S.x1+S.w/2,y:S.y1+S.h/2}),t.randomize){var $=o(t);r.push($)}"default"==t.quality||"proof"==t.quality?(s.push(h(t,r[0])),e.relocateComponent(f[0],s[0],t)):e.relocateComponent(f[0],r[0],t)}var j=function(i,n){if("default"==t.quality||"proof"==t.quality){"number"==typeof i&&(i=n);var e=void 0,o=void 0,h=i.data("id");return s.forEach(function(t){h in t&&(e={x:t[h].getRect().getCenterX(),y:t[h].getRect().getCenterY()},o=t[h])}),t.nodeDimensionsIncludeLabels&&(o.labelWidth&&("left"==o.labelPosHorizontal?e.x+=o.labelWidth/2:"right"==o.labelPosHorizontal&&(e.x-=o.labelWidth/2)),o.labelHeight&&("top"==o.labelPosVertical?e.y+=o.labelHeight/2:"bottom"==o.labelPosVertical&&(e.y-=o.labelHeight/2))),null==e&&(e={x:i.position("x"),y:i.position("y")}),{x:e.x,y:e.y}}var a=void 0;return r.forEach(function(t){var n=t.nodeIndexes.get(i.id());null!=n&&(a={x:t.xCoords[n],y:t.yCoords[n]})}),null==a&&(a={x:i.position("x"),y:i.position("y")}),{x:a.x,y:a.y}};if("default"==t.quality||"proof"==t.quality||t.randomize){var O=e.calcParentsWithoutChildren(i,n),A=n.filter(function(t){return"none"==t.css("display")});t.eles=n.not(A),n.nodes().not(":parent").not(A).layoutPositions(this,t,j),O.length>0&&O.forEach(function(t){t.position(j(t))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),t}();t.exports=f},657:(t,i,n)=>{var r=n(548),s=n(140).layoutBase.Matrix,e=n(140).layoutBase.SVD;t.exports={spectralLayout:function(t){var i=t.cy,n=t.eles,o=n.nodes(),h=n.nodes(":parent"),a=new Map,f=new Map,u=new Map,c=[],l=[],v=[],d=[],y=[],p=[],w=[],g=[],m=void 0,b=1e8,M=1e-9,k=t.piTol,x=t.samplingType,S=t.nodeSeparation,$=void 0,j=function(t,i,n){for(var r=[],s=0,e=0,o=0,h=void 0,a=[],u=0,l=1,v=0;v<m;v++)a[v]=b;for(r[e]=t,a[t]=0;e>=s;){o=r[s++];for(var d=c[o],w=0;w<d.length;w++)a[h=f.get(d[w])]==b&&(a[h]=a[o]+1,r[++e]=h);p[o][i]=a[o]*S}if(n){for(var g=0;g<m;g++)p[g][i]<y[g]&&(y[g]=p[g][i]);for(var M=0;M<m;M++)y[M]>u&&(u=y[M],l=M)}return l};r.connectComponents(i,n,r.getTopMostNodes(o),a),h.forEach(function(t){r.connectComponents(i,n,r.getTopMostNodes(t.descendants().intersection(n)),a)});for(var O=0,A=0;A<o.length;A++)o[A].isParent()||f.set(o[A].id(),O++);var T=!0,I=!1,E=void 0;try{for(var L,D=a.keys()[Symbol.iterator]();!(T=(L=D.next()).done);T=!0){var N=L.value;f.set(N,O++)}}catch(W){I=!0,E=W}finally{try{!T&&D.return&&D.return()}finally{if(I)throw E}}for(var z=0;z<f.size;z++)c[z]=[];h.forEach(function(t){for(var i=t.children().intersection(n);0==i.nodes(":childless").length;)i=i.nodes()[0].children().intersection(n);var r=0,s=i.nodes(":childless")[0].connectedEdges().length;i.nodes(":childless").forEach(function(t,i){t.connectedEdges().length<s&&(s=t.connectedEdges().length,r=i)}),u.set(t.id(),i.nodes(":childless")[r].id())}),o.forEach(function(t){var i=void 0;i=t.isParent()?f.get(u.get(t.id())):f.get(t.id()),t.neighborhood().nodes().forEach(function(r){n.intersection(t.edgesWith(r)).length>0&&(r.isParent()?c[i].push(u.get(r.id())):c[i].push(r.id()))})});var B=function(t){var n=f.get(t),r=void 0;a.get(t).forEach(function(s){r=i.getElementById(s).isParent()?u.get(s):s,c[n].push(r),c[f.get(r)].push(t)})},C=!0,P=!1,R=void 0;try{for(var G,q=a.keys()[Symbol.iterator]();!(C=(G=q.next()).done);C=!0)B(G.value)}catch(W){P=!0,R=W}finally{try{!C&&q.return&&q.return()}finally{if(P)throw R}}var F=void 0;if((m=f.size)>2){$=m<t.sampleSize?m:t.sampleSize;for(var X=0;X<m;X++)p[X]=[];for(var Y=0;Y<$;Y++)g[Y]=[];return"draft"==t.quality||"all"==t.step?(function(t){var i=void 0;if(t){i=Math.floor(Math.random()*m);for(var n=0;n<m;n++)y[n]=b;for(var r=0;r<$;r++)d[r]=i,i=j(i,r,t)}else{!function(){for(var t=0,i=0,n=!1;i<$;){t=Math.floor(Math.random()*m),n=!1;for(var r=0;r<i;r++)if(d[r]==t){n=!0;break}n||(d[i]=t,i++)}}();for(var s=0;s<$;s++)j(d[s],s,t)}for(var e=0;e<m;e++)for(var o=0;o<$;o++)p[e][o]*=p[e][o];for(var h=0;h<$;h++)w[h]=[];for(var a=0;a<$;a++)for(var f=0;f<$;f++)w[a][f]=p[d[f]][a]}(x),function(){for(var t=e.svd(w),i=t.S,n=t.U,r=t.V,o=i[0]*i[0]*i[0],h=[],a=0;a<$;a++){h[a]=[];for(var f=0;f<$;f++)h[a][f]=0,a==f&&(h[a][f]=i[a]/(i[a]*i[a]+o/(i[a]*i[a])))}g=s.multMat(s.multMat(r,h),s.transpose(n))}(),function(){for(var t=void 0,i=void 0,n=[],r=[],e=[],o=[],h=0;h<m;h++)n[h]=Math.random(),r[h]=Math.random();n=s.normalize(n),r=s.normalize(r);for(var a=M,f=M,u=void 0;;){for(var c=0;c<m;c++)e[c]=n[c];if(n=s.multGamma(s.multL(s.multGamma(e),p,g)),t=s.dotProduct(e,n),n=s.normalize(n),a=s.dotProduct(e,n),(u=Math.abs(a/f))<=1+k&&u>=1)break;f=a}for(var d=0;d<m;d++)e[d]=n[d];for(f=M;;){for(var y=0;y<m;y++)o[y]=r[y];if(o=s.minusOp(o,s.multCons(e,s.dotProduct(e,o))),r=s.multGamma(s.multL(s.multGamma(o),p,g)),i=s.dotProduct(o,r),r=s.normalize(r),a=s.dotProduct(o,r),(u=Math.abs(a/f))<=1+k&&u>=1)break;f=a}for(var w=0;w<m;w++)o[w]=r[w];l=s.multCons(e,Math.sqrt(Math.abs(t))),v=s.multCons(o,Math.sqrt(Math.abs(i)))}(),F={nodeIndexes:f,xCoords:l,yCoords:v}):(f.forEach(function(t,n){l.push(i.getElementById(n).position("x")),v.push(i.getElementById(n).position("y"))}),F={nodeIndexes:f,xCoords:l,yCoords:v}),F}var _=f.keys(),H=i.getElementById(_.next().value),Z=H.position(),J=H.outerWidth();if(l.push(Z.x),v.push(Z.y),2==m){var V=i.getElementById(_.next().value).outerWidth();l.push(Z.x+J/2+V/2+t.idealEdgeLength),v.push(Z.y)}return F={nodeIndexes:f,xCoords:l,yCoords:v}}}},579:(t,i,n)=>{var r=n(212),s=function(t){t&&t("layout","fcose",r)};"undefined"!=typeof cytoscape&&s(cytoscape),t.exports=s},140:t=>{t.exports=z}},C={},function t(i){var n=C[i];if(void 0!==n)return n.exports;var r=C[i]={exports:{}};return B[i](r,r.exports,t),r.exports}(579))));var R={L:"left",R:"right",T:"top",B:"bottom"},G={L:n(t=>`${t},${t/2} 0,${t} 0,0`,"L"),R:n(t=>`0,${t/2} ${t},0 ${t},${t}`,"R"),T:n(t=>`0,0 ${t},0 ${t/2},${t}`,"T"),B:n(t=>`${t/2},0 ${t},${t} 0,${t}`,"B")},q={L:n((t,i)=>t-i+2,"L"),R:n((t,i)=>t-2,"R"),T:n((t,i)=>t-i+2,"T"),B:n((t,i)=>t-2,"B")},F=n(function(t){return Y(t)?"L"===t?"R":"L":"T"===t?"B":"T"},"getOppositeArchitectureDirection"),X=n(function(t){return"L"===t||"R"===t||"T"===t||"B"===t},"isArchitectureDirection"),Y=n(function(t){return"L"===t||"R"===t},"isArchitectureDirectionX"),_=n(function(t){return"T"===t||"B"===t},"isArchitectureDirectionY"),H=n(function(t,i){const n=Y(t)&&_(i),r=_(t)&&Y(i);return n||r},"isArchitectureDirectionXY"),Z=n(function(t){const i=t[0],n=t[1],r=Y(i)&&_(n),s=_(i)&&Y(n);return r||s},"isArchitecturePairXY"),J=n(function(t){return"LL"!==t&&"RR"!==t&&"TT"!==t&&"BB"!==t},"isValidArchitectureDirectionPair"),V=n(function(t,i){const n=`${t}${i}`;return J(n)?n:void 0},"getArchitectureDirectionPair"),W=n(function([t,i],n){const r=n[0],s=n[1];return Y(r)?_(s)?[t+("L"===r?-1:1),i+("T"===s?1:-1)]:[t+("L"===r?-1:1),i]:Y(s)?[t+("L"===s?1:-1),i+("T"===r?1:-1)]:[t,i+("T"===r?1:-1)]},"shiftPositionByArchitectureDirectionPair"),U=n(function(t){return"LT"===t||"TL"===t?[1,1]:"BL"===t||"LB"===t?[1,-1]:"BR"===t||"RB"===t?[-1,-1]:[-1,1]},"getArchitectureDirectionXYFactors"),K=n(function(t,i){return H(t,i)?"bend":Y(t)?"horizontal":"vertical"},"getArchitectureDirectionAlignment"),Q=n(function(t){return"service"===t.type},"isArchitectureService"),tt=n(function(t){return"junction"===t.type},"isArchitectureJunction"),it=n(t=>t.data(),"edgeData"),nt=n(t=>t.data(),"nodeData"),rt=d.architecture,st=(n(t=class{constructor(){this.nodes={},this.groups={},this.edges=[],this.registeredIds={},this.elements={},this.setAccTitle=o,this.getAccTitle=h,this.setDiagramTitle=a,this.getDiagramTitle=f,this.getAccDescription=u,this.setAccDescription=c,this.clear()}clear(){this.nodes={},this.groups={},this.edges=[],this.registeredIds={},this.dataStructures=void 0,this.elements={},l()}addService({id:t,icon:i,in:n,title:r,iconText:s}){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!==n){if(t===n)throw new Error(`The service [${t}] cannot be placed within itself`);if(void 0===this.registeredIds[n])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[n])throw new Error(`The service [${t}]'s parent is not a group`)}this.registeredIds[t]="node",this.nodes[t]={id:t,type:"service",icon:i,iconText:s,title:r,edges:[],in:n}}getServices(){return Object.values(this.nodes).filter(Q)}addJunction({id:t,in:i}){this.registeredIds[t]="node",this.nodes[t]={id:t,type:"junction",edges:[],in:i}}getJunctions(){return Object.values(this.nodes).filter(tt)}getNodes(){return Object.values(this.nodes)}getNode(t){return this.nodes[t]??null}addGroup({id:t,icon:i,in:n,title:r}){var s,e,o;if(void 0!==(null==(s=this.registeredIds)?void 0:s[t]))throw new Error(`The group id [${t}] is already in use by another ${this.registeredIds[t]}`);if(void 0!==n){if(t===n)throw new Error(`The group [${t}] cannot be placed within itself`);if(void 0===(null==(e=this.registeredIds)?void 0:e[n]))throw new Error(`The group [${t}]'s parent does not exist. Please make sure the parent is created before this group`);if("node"===(null==(o=this.registeredIds)?void 0:o[n]))throw new Error(`The group [${t}]'s parent is not a group`)}this.registeredIds[t]="group",this.groups[t]={id:t,icon:i,title:r,in:n}}getGroups(){return Object.values(this.groups)}addEdge({lhsId:t,rhsId:i,lhsDir:n,rhsDir:r,lhsInto:s,rhsInto:e,lhsGroup:o,rhsGroup:h,title:a}){if(!X(n))throw new Error(`Invalid direction given for left hand side of edge ${t}--${i}. Expected (L,R,T,B) got ${String(n)}`);if(!X(r))throw new Error(`Invalid direction given for right hand side of edge ${t}--${i}. Expected (L,R,T,B) got ${String(r)}`);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[i]&&void 0===this.groups[i])throw new Error(`The right-hand id [${i}] does not yet exist. Please create the service/group before declaring an edge to it.`);const f=this.nodes[t].in,u=this.nodes[i].in;if(o&&f&&u&&f==u)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(h&&f&&u&&f==u)throw new Error(`The right-hand id [${i}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);const c={lhsId:t,lhsDir:n,lhsInto:s,lhsGroup:o,rhsId:i,rhsDir:r,rhsInto:e,rhsGroup:h,title:a};this.edges.push(c),this.nodes[t]&&this.nodes[i]&&(this.nodes[t].edges.push(this.edges[this.edges.length-1]),this.nodes[i].edges.push(this.edges[this.edges.length-1]))}getEdges(){return this.edges}getDataStructures(){if(void 0===this.dataStructures){const t={},i=Object.entries(this.nodes).reduce((i,[n,r])=>(i[n]=r.edges.reduce((i,r)=>{var s,e;const o=null==(s=this.getNode(r.lhsId))?void 0:s.in,h=null==(e=this.getNode(r.rhsId))?void 0:e.in;if(o&&h&&o!==h){const i=K(r.lhsDir,r.rhsDir);"bend"!==i&&(t[o]??(t[o]={}),t[o][h]=i,t[h]??(t[h]={}),t[h][o]=i)}if(r.lhsId===n){const t=V(r.lhsDir,r.rhsDir);t&&(i[t]=r.rhsId)}else{const t=V(r.rhsDir,r.lhsDir);t&&(i[t]=r.lhsId)}return i},{}),i),{}),r=Object.keys(i)[0],s={[r]:1},e=Object.keys(i).reduce((t,i)=>i===r?t:{...t,[i]:1},{}),o=n(t=>{const n={[t]:[0,0]},r=[t];for(;r.length>0;){const t=r.shift();if(t){s[t]=1,delete e[t];const o=i[t],[h,a]=n[t];Object.entries(o).forEach(([t,i])=>{s[i]||(n[i]=W([h,a],t),r.push(i))})}}return n},"BFS"),h=[o(r)];for(;Object.keys(e).length>0;)h.push(o(Object.keys(e)[0]));this.dataStructures={adjList:i,spatialMaps:h,groupAlignments:t}}return this.dataStructures}setElementForId(t,i){this.elements[t]=i}getElementById(t){return this.elements[t]}getConfig(){return v({...rt,...y().architecture})}getConfigField(t){return this.getConfig()[t]}},"ArchitectureDB"),t),et=n((t,i)=>{S(t,i),t.groups.map(t=>i.addGroup(t)),t.services.map(t=>i.addService({...t,type:"service"})),t.junctions.map(t=>i.addJunction({...t,type:"junction"})),t.edges.map(t=>i.addEdge(t))},"populateDb"),ot={parser:{yy:void 0},parse:n(async t=>{var i;const n=await $("architecture",t);e.debug(n);const r=null==(i=ot.parser)?void 0:i.yy;if(!(r instanceof st))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.");et(n,r)},"parse")},ht=n(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"),at=n(t=>`<g><rect width="80" height="80" style="fill: #087ebf; stroke-width: 0px;"/>${t}</g>`,"wrapIcon"),ft={prefix:"mermaid-architecture",height:80,width:80,icons:{database:{body:at('<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:at('<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:at('<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:at('<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:at('<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:x,blank:{body:at("")}}},ut=n(async function(t,i,n){const r=n.getConfigField("padding"),s=n.getConfigField("iconSize"),e=s/2,o=s/6,h=o/2;await Promise.all(i.edges().map(async i=>{var s,a;const{source:f,sourceDir:u,sourceArrow:c,sourceGroup:l,target:v,targetDir:d,targetArrow:y,targetGroup:g,label:m}=it(i);let{x:b,y:k}=i[0].sourceEndpoint();const{x:x,y:S}=i[0].midpoint();let{x:$,y:j}=i[0].targetEndpoint();const O=r+4;if(l&&(Y(u)?b+="L"===u?-O:O:k+="T"===u?-O:O+18),g&&(Y(d)?$+="L"===d?-O:O:j+="T"===d?-O:O+18),l||"junction"!==(null==(s=n.getNode(f))?void 0:s.type)||(Y(u)?b+="L"===u?e:-e:k+="T"===u?e:-e),g||"junction"!==(null==(a=n.getNode(v))?void 0:a.type)||(Y(d)?$+="L"===d?e:-e:j+="T"===d?e:-e),i[0].t.rscratch){const i=t.insert("g");if(i.insert("path").attr("d",`M ${b},${k} L ${x},${S} L${$},${j} `).attr("class","edge").attr("id",M(f,v,{prefix:"L"})),c){const t=Y(u)?q[u](b,o):b-h,n=_(u)?q[u](k,o):k-h;i.insert("polygon").attr("points",G[u](o)).attr("transform",`translate(${t},${n})`).attr("class","arrow")}if(y){const t=Y(d)?q[d]($,o):$-h,n=_(d)?q[d](j,o):j-h;i.insert("polygon").attr("points",G[d](o)).attr("transform",`translate(${t},${n})`).attr("class","arrow")}if(m){const t=H(u,d)?"XY":Y(u)?"X":"Y";let n=0;n="X"===t?Math.abs(b-$):"Y"===t?Math.abs(k-j)/1.5:Math.abs(b-$)/2;const r=i.append("g");if(await w(r,m,{useHtmlLabels:!1,width:n,classes:"architecture-service-label"},p()),r.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),"X"===t)r.attr("transform","translate("+x+", "+S+")");else if("Y"===t)r.attr("transform","translate("+x+", "+S+") rotate(-90)");else if("XY"===t){const t=V(u,d);if(t&&Z(t)){const i=r.node().getBoundingClientRect(),[n,s]=U(t);r.attr("dominant-baseline","auto").attr("transform",`rotate(${-1*n*s*45})`);const e=r.node().getBoundingClientRect();r.attr("transform",`\n translate(${x}, ${S-i.height/2})\n translate(${n*e.width/2}, ${s*e.height/2})\n rotate(${-1*n*s*45}, 0, ${i.height/2})\n `)}}}}}))},"drawEdges"),ct=n(async function(t,i,n){const r=.75*n.getConfigField("padding"),s=n.getConfigField("fontSize"),e=n.getConfigField("iconSize")/2;await Promise.all(i.nodes().map(async i=>{const o=nt(i);if("group"===o.type){const{h:h,w:a,x1:f,y1:u}=i.boundingBox(),c=t.append("rect");c.attr("id",`group-${o.id}`).attr("x",f+e).attr("y",u+e).attr("width",a).attr("height",h).attr("class","node-bkg");const l=t.append("g");let v=f,d=u;if(o.icon){const t=l.append("g");t.html(`<g>${await g(o.icon,{height:r,width:r,fallbackPrefix:ft.prefix})}</g>`),t.attr("transform","translate("+(v+e+1)+", "+(d+e+1)+")"),v+=r,d+=s/2-1-2}if(o.label){const t=l.append("g");await w(t,o.label,{useHtmlLabels:!1,width:a,classes:"architecture-service-label"},p()),t.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","start").attr("text-anchor","start"),t.attr("transform","translate("+(v+e+4)+", "+(d+e+2)+")")}n.setElementForId(o.id,c)}}))},"drawGroups"),lt=n(async function(t,i,n){const r=p();for(const s of n){const n=i.append("g"),e=t.getConfigField("iconSize");if(s.title){const t=n.append("g");await w(t,s.title,{useHtmlLabels:!1,width:1.5*e,classes:"architecture-service-label"},r),t.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),t.attr("transform","translate("+e/2+", "+e+")")}const o=n.append("g");if(s.icon)o.html(`<g>${await g(s.icon,{height:e,width:e,fallbackPrefix:ft.prefix})}</g>`);else if(s.iconText){o.html(`<g>${await g("blank",{height:e,width:e,fallbackPrefix:ft.prefix})}</g>`);const t=o.append("g").append("foreignObject").attr("width",e).attr("height",e).append("div").attr("class","node-icon-text").attr("style",`height: ${e}px;`).append("div").html(m(s.iconText,r)),i=parseInt(window.getComputedStyle(t.node(),null).getPropertyValue("font-size").replace(/\D/g,""))??16;t.attr("style",`-webkit-line-clamp: ${Math.floor((e-2)/i)};`)}else o.append("path").attr("class","node-bkg").attr("id","node-"+s.id).attr("d",`M0 ${e} v${-e} q0,-5 5,-5 h${e} q5,0 5,5 v${e} H0 Z`);n.attr("id",`service-${s.id}`).attr("class","architecture-service");const{width:h,height:a}=n.node().getBBox();s.width=h,s.height=a,t.setElementForId(s.id,n)}return 0},"drawServices"),vt=n(function(t,i,n){n.forEach(n=>{const r=i.append("g"),s=t.getConfigField("iconSize");r.append("g").append("rect").attr("id","node-"+n.id).attr("fill-opacity","0").attr("width",s).attr("height",s),r.attr("class","architecture-junction");const{width:e,height:o}=r._groups[0][0].getBBox();r.width=e,r.height=o,t.setElementForId(n.id,r)})},"drawJunctions");function dt(t,i,n){t.forEach(t=>{i.add({group:"nodes",data:{type:"service",id:t.id,icon:t.icon,label:t.title,parent:t.in,width:n.getConfigField("iconSize"),height:n.getConfigField("iconSize")},classes:"node-service"})})}function yt(t,i,n){t.forEach(t=>{i.add({group:"nodes",data:{type:"junction",id:t.id,parent:t.in,width:n.getConfigField("iconSize"),height:n.getConfigField("iconSize")},classes:"node-junction"})})}function pt(t,i){i.nodes().map(i=>{const n=nt(i);if("group"===n.type)return;n.x=i.position().x,n.y=i.position().y;t.getElementById(n.id).attr("transform","translate("+(n.x||0)+","+(n.y||0)+")")})}function wt(t,i){t.forEach(t=>{i.add({group:"nodes",data:{type:"group",id:t.id,icon:t.icon,label:t.title,parent:t.in},classes:"node-group"})})}function gt(t,i){t.forEach(t=>{const{lhsId:n,rhsId:r,lhsInto:s,lhsGroup:e,rhsInto:o,lhsDir:h,rhsDir:a,rhsGroup:f,title:u}=t,c=H(t.lhsDir,t.rhsDir)?"segments":"straight",l={id:`${n}-${r}`,label:u,source:n,sourceDir:h,sourceArrow:s,sourceGroup:e,sourceEndpoint:"L"===h?"0 50%":"R"===h?"100% 50%":"T"===h?"50% 0":"50% 100%",target:r,targetDir:a,targetArrow:o,targetGroup:f,targetEndpoint:"L"===a?"0 50%":"R"===a?"100% 50%":"T"===a?"50% 0":"50% 100%"};i.add({group:"edges",data:l,classes:c})})}function mt(t,i,r){const s=n((t,i)=>Object.entries(t).reduce((t,[n,s])=>{var e;let o=0;const h=Object.entries(s);if(1===h.length)return t[n]=h[0][1],t;for(let a=0;a<h.length-1;a++)for(let s=a+1;s<h.length;s++){const[f,u]=h[a],[c,l]=h[s];if((null==(e=r[f])?void 0:e[c])===i)t[n]??(t[n]=[]),t[n]=[...t[n],...u,...l];else if("default"===f||"default"===c)t[n]??(t[n]=[]),t[n]=[...t[n],...u,...l];else{t[`${n}-${o++}`]=u;t[`${n}-${o++}`]=l}}return t},{}),"flattenAlignments"),e=i.map(i=>{const n={},r={};return Object.entries(i).forEach(([i,[s,e]])=>{var o,h,a;const f=(null==(o=t.getNode(i))?void 0:o.in)??"default";n[e]??(n[e]={}),(h=n[e])[f]??(h[f]=[]),n[e][f].push(i),r[s]??(r[s]={}),(a=r[s])[f]??(a[f]=[]),r[s][f].push(i)}),{horiz:Object.values(s(n,"horizontal")).filter(t=>t.length>1),vert:Object.values(s(r,"vertical")).filter(t=>t.length>1)}}),[o,h]=e.reduce(([t,i],{horiz:n,vert:r})=>[[...t,...n],[...i,...r]],[[],[]]);return{horizontal:o,vertical:h}}function bt(t,i){const r=[],s=n(t=>`${t[0]},${t[1]}`,"posToStr"),e=n(t=>t.split(",").map(t=>parseInt(t)),"strToPos");return t.forEach(t=>{const n=Object.fromEntries(Object.entries(t).map(([t,i])=>[s(i),t])),o=[s([0,0])],h={},a={L:[-1,0],R:[1,0],T:[0,1],B:[0,-1]};for(;o.length>0;){const t=o.shift();if(t){h[t]=1;const f=n[t];if(f){const u=e(t);Object.entries(a).forEach(([t,e])=>{const a=s([u[0]+e[0],u[1]+e[1]]),c=n[a];c&&!h[a]&&(o.push(a),r.push({[R[t]]:c,[R[F(t)]]:f,gap:1.5*i.getConfigField("iconSize")}))})}}}}),r}function Mt(t,i,r,s,o,{spatialMaps:h,groupAlignments:a}){return new Promise(f=>{const u=b("body").append("div").attr("id","cy").attr("style","display:none"),c=j({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":`${o.getConfigField("fontSize")}px`}},{selector:".node-service",style:{label:"data(label)",width:"data(width)",height:"data(height)"}},{selector:".node-junction",style:{width:"data(width)",height:"data(height)"}},{selector:".node-group",style:{padding:`${o.getConfigField("padding")}px`}}],layout:{name:"grid",boundingBox:{x1:0,x2:100,y1:0,y2:100}}});u.remove(),wt(r,c),dt(t,c,o),yt(i,c,o),gt(s,c);const l=mt(o,h,a),v=bt(h,o),d=c.layout({name:"fcose",quality:"proof",styleEnabled:!1,animate:!1,nodeDimensionsIncludeLabels:!1,idealEdgeLength(t){const[i,n]=t.connectedNodes(),{parent:r}=nt(i),{parent:s}=nt(n);return r===s?1.5*o.getConfigField("iconSize"):.5*o.getConfigField("iconSize")},edgeElasticity(t){const[i,n]=t.connectedNodes(),{parent:r}=nt(i),{parent:s}=nt(n);return r===s?.45:.001},alignmentConstraint:l,relativePlacementConstraint:v});d.one("layoutstop",()=>{var t;function i(t,i,n,r){let s,e;const{x:o,y:h}=t,{x:a,y:f}=i;e=(r-h+(o-n)*(h-f)/(o-a))/Math.sqrt(1+Math.pow((h-f)/(o-a),2)),s=Math.sqrt(Math.pow(r-h,2)+Math.pow(n-o,2)-Math.pow(e,2));s/=Math.sqrt(Math.pow(a-o,2)+Math.pow(f-h,2));let u=(a-o)*(r-h)-(f-h)*(n-o);switch(!0){case u>=0:u=1;break;case u<0:u=-1}let c=(a-o)*(n-o)+(f-h)*(r-h);switch(!0){case c>=0:c=1;break;case c<0:c=-1}return e=Math.abs(e)*u,s*=c,{distances:e,weights:s}}n(i,"getSegmentWeights"),c.startBatch();for(const n of Object.values(c.edges()))if(null==(t=n.data)?void 0:t.call(n)){const{x:t,y:r}=n.source().position(),{x:s,y:e}=n.target().position();if(t!==s&&r!==e){const t=n.sourceEndpoint(),r=n.targetEndpoint(),{sourceDir:s}=it(n),[e,o]=_(s)?[t.x,r.y]:[r.x,t.y],{weights:h,distances:a}=i(t,r,e,o);n.style("segment-distances",a),n.style("segment-weights",h)}}c.endBatch(),d.run()}),d.run(),c.ready(t=>{e.info("Ready",t),f(c)})})}k([{name:ft.prefix,icons:ft}]),j.use(P),n(dt,"addServices"),n(yt,"addJunctions"),n(pt,"positionNodes"),n(wt,"addGroups"),n(gt,"addEdges"),n(mt,"getAlignments"),n(bt,"getRelativeConstraints"),n(Mt,"layoutArchitecture");var kt={draw:n(async(t,i,n,e)=>{const o=e.db,h=o.getServices(),a=o.getJunctions(),f=o.getGroups(),u=o.getEdges(),c=o.getDataStructures(),l=r(i),v=l.append("g");v.attr("class","architecture-edges");const d=l.append("g");d.attr("class","architecture-services");const y=l.append("g");y.attr("class","architecture-groups"),await lt(o,d,h),vt(o,d,a);const p=await Mt(h,a,f,u,o,c);await ut(v,p,o),await ct(y,p,o),pt(o,p),s(void 0,l,o.getConfigField("padding"),o.getConfigField("useMaxWidth"))},"draw")},xt={parser:ot,get db(){return new st},renderer:kt,styles:ht};export{xt as diagram};
|