@codragraph/cli 2.1.6 → 2.2.0-rc.6

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.
Files changed (72) hide show
  1. package/README.md +7 -7
  2. package/dist/cli/graphpack.d.ts +48 -0
  3. package/dist/cli/graphpack.js +217 -0
  4. package/dist/cli/index.js +72 -0
  5. package/dist/cli/tool.d.ts +1 -0
  6. package/dist/cli/tool.js +111 -2
  7. package/dist/core/graphpack/index.d.ts +14 -0
  8. package/dist/core/graphpack/index.js +474 -0
  9. package/dist/core/graphpack/types.d.ts +129 -0
  10. package/dist/core/graphpack/types.js +4 -0
  11. package/dist/core/semantic/relationships.d.ts +36 -0
  12. package/dist/core/semantic/relationships.js +261 -0
  13. package/dist/mcp/local/local-backend.js +42 -0
  14. package/dist/mcp/resources.js +125 -0
  15. package/dist/mcp/tools.js +105 -0
  16. package/dist/server/api.js +112 -0
  17. package/dist/web/assets/agent-CQNZQ-hg.js +1139 -0
  18. package/dist/web/assets/{architectureDiagram-UL44E2DR-DFSpa3Hb.js → architectureDiagram-UL44E2DR-B5_goS_i.js} +1 -1
  19. package/dist/web/assets/{blockDiagram-7IZFK4PR-DlFaxH1b.js → blockDiagram-7IZFK4PR-D7ZAlDyv.js} +1 -1
  20. package/dist/web/assets/{c4Diagram-Y2BXMSZH-BjJ_Yrim.js → c4Diagram-Y2BXMSZH-Djcgm_54.js} +1 -1
  21. package/dist/web/assets/{chunk-3SSMPTDK-KGZSzG3Y.js → chunk-3SSMPTDK-Cv2Zy2FO.js} +1 -1
  22. package/dist/web/assets/{chunk-6764PJDD-p1sGJgVm.js → chunk-6764PJDD-Cppb-jH-.js} +1 -1
  23. package/dist/web/assets/{chunk-AZZRMDJM-DIDkQA4V.js → chunk-AZZRMDJM-BHlLC7p3.js} +1 -1
  24. package/dist/web/assets/{chunk-JQRUD6KW-DAwg-yCU.js → chunk-JQRUD6KW-3F8Zg-1N.js} +1 -1
  25. package/dist/web/assets/{chunk-KRXBNO2N-ChVO_XdS.js → chunk-KRXBNO2N-C0mbN9a7.js} +1 -1
  26. package/dist/web/assets/{chunk-LCXTWHL2-DGYdb_Eh.js → chunk-LCXTWHL2-BoiuJpIF.js} +1 -1
  27. package/dist/web/assets/{chunk-LII3EMHJ-Bzh9SNgD.js → chunk-LII3EMHJ-Dqq0Qguw.js} +1 -1
  28. package/dist/web/assets/{chunk-RG4AUYOV-Bcl7U_IV.js → chunk-RG4AUYOV-Bl5F_gDs.js} +1 -1
  29. package/dist/web/assets/{chunk-T5OCTHI4-CZYMg5sc.js → chunk-T5OCTHI4-B2tIcggA.js} +1 -1
  30. package/dist/web/assets/{chunk-W44A43WB-REOI67PN.js → chunk-W44A43WB-BHe37iN7.js} +1 -1
  31. package/dist/web/assets/{chunk-ZXARS5L4-BfFdV1tf.js → chunk-ZXARS5L4-wcrIaQvY.js} +1 -1
  32. package/dist/web/assets/classDiagram-KGZ6W3CR-IbI6v_24.js +1 -0
  33. package/dist/web/assets/classDiagram-v2-72OJOZXJ-IbI6v_24.js +1 -0
  34. package/dist/web/assets/{cose-bilkent-UX7MHV2Q-D6vANJGG.js → cose-bilkent-UX7MHV2Q-BWr7v0Wr.js} +1 -1
  35. package/dist/web/assets/{dagre-ND4H6XIP-BiHe5Lal.js → dagre-ND4H6XIP-De5LIh1B.js} +1 -1
  36. package/dist/web/assets/{diagram-3NCE3AQN-CEutBCOW.js → diagram-3NCE3AQN-Dd22FSHy.js} +1 -1
  37. package/dist/web/assets/{diagram-GF46GFSD-CZns6HPQ.js → diagram-GF46GFSD-Cev3THY8.js} +1 -1
  38. package/dist/web/assets/{diagram-HNR7UZ2L-Vz8fE5of.js → diagram-HNR7UZ2L-D8Z8RQGs.js} +1 -1
  39. package/dist/web/assets/{diagram-QXG6HAR7-D60HKZ_y.js → diagram-QXG6HAR7-B8VOJOiE.js} +1 -1
  40. package/dist/web/assets/{diagram-WEQXMOUZ-vGAf1p3E.js → diagram-WEQXMOUZ-va1bLoMD.js} +1 -1
  41. package/dist/web/assets/{erDiagram-L5TCEMPS-DZaplJA6.js → erDiagram-L5TCEMPS-B3_9uAoP.js} +1 -1
  42. package/dist/web/assets/{flowDiagram-H6V6AXG4-BqUqeAsI.js → flowDiagram-H6V6AXG4-98m6maI1.js} +1 -1
  43. package/dist/web/assets/{ganttDiagram-JCBTUEKG-XEB6H-0G.js → ganttDiagram-JCBTUEKG-vE2nzETb.js} +1 -1
  44. package/dist/web/assets/{gitGraphDiagram-S2ZK5IYY-7G50u1Cd.js → gitGraphDiagram-S2ZK5IYY-DKc8uUg_.js} +1 -1
  45. package/dist/web/assets/index-BAhe1HSk.css +1 -0
  46. package/dist/web/assets/{index-B5WxtMpv.js → index-VTKdaklA.js} +230 -230
  47. package/dist/web/assets/{infoDiagram-3YFTVSEB-Cut_rzaf.js → infoDiagram-3YFTVSEB-DYP-Srzx.js} +1 -1
  48. package/dist/web/assets/{ishikawaDiagram-BNXS4ZKH-B4DGfGi3.js → ishikawaDiagram-BNXS4ZKH-QZnkpmmb.js} +1 -1
  49. package/dist/web/assets/{journeyDiagram-M6C3CM3L-BBFhsL3E.js → journeyDiagram-M6C3CM3L-B5ojIuqu.js} +1 -1
  50. package/dist/web/assets/{kanban-definition-75IXJCU3-DarGRyn3.js → kanban-definition-75IXJCU3-BJA8liRR.js} +1 -1
  51. package/dist/web/assets/{katex-K3KEBU37-W5XTYMhr.js → katex-K3KEBU37-DUqZiCRL.js} +1 -1
  52. package/dist/web/assets/{mindmap-definition-2TDM6QVE-BgeczIJM.js → mindmap-definition-2TDM6QVE-BQj5yylD.js} +1 -1
  53. package/dist/web/assets/{pieDiagram-CU6KROY3-Kkoo-Noq.js → pieDiagram-CU6KROY3-4eSrPiQz.js} +1 -1
  54. package/dist/web/assets/{quadrantDiagram-VICAPDV7-CDQFeRWN.js → quadrantDiagram-VICAPDV7-PzxN8j55.js} +1 -1
  55. package/dist/web/assets/{requirementDiagram-JXO7QTGE-Cz9-XnkA.js → requirementDiagram-JXO7QTGE-CtplTc5y.js} +1 -1
  56. package/dist/web/assets/{sankeyDiagram-URQDO5SZ-CU26z0n7.js → sankeyDiagram-URQDO5SZ-CoSgvkxv.js} +1 -1
  57. package/dist/web/assets/{sequenceDiagram-VS2MUI6T-OGK1FLOt.js → sequenceDiagram-VS2MUI6T-D7ygyXvJ.js} +1 -1
  58. package/dist/web/assets/{stateDiagram-7D4R322I-DJ9brq0U.js → stateDiagram-7D4R322I-v01gvwji.js} +1 -1
  59. package/dist/web/assets/stateDiagram-v2-36443NZ5-DFD2b8_x.js +1 -0
  60. package/dist/web/assets/{timeline-definition-O6YCAMPW-XZvnjqTT.js → timeline-definition-O6YCAMPW-CTI3M65J.js} +1 -1
  61. package/dist/web/assets/{vennDiagram-MWXL3ELB-CJUssEjA.js → vennDiagram-MWXL3ELB-RnB0XMP7.js} +1 -1
  62. package/dist/web/assets/{wardley-L42UT6IY-5TKZOOLJ-DZr11zBG.js → wardley-L42UT6IY-5TKZOOLJ-C-ZcgEBb.js} +1 -1
  63. package/dist/web/assets/{wardleyDiagram-CUQ6CDDI-C276iqrN.js → wardleyDiagram-CUQ6CDDI-EwRi4kwo.js} +1 -1
  64. package/dist/web/assets/{xychartDiagram-N2JHSOCM-B9-uCZyP.js → xychartDiagram-N2JHSOCM-DA38II6y.js} +1 -1
  65. package/dist/web/index.html +2 -2
  66. package/package.json +2 -2
  67. package/dist/web/assets/__vite-browser-external-BIHI7g3E.js +0 -1
  68. package/dist/web/assets/agent-DcdaQnmu.js +0 -1104
  69. package/dist/web/assets/classDiagram-KGZ6W3CR-B-qkKMYi.js +0 -1
  70. package/dist/web/assets/classDiagram-v2-72OJOZXJ-B-qkKMYi.js +0 -1
  71. package/dist/web/assets/index-CT0GtFLZ.css +0 -1
  72. package/dist/web/assets/stateDiagram-v2-36443NZ5-DhJ4Ky-7.js +0 -1
@@ -1,4 +1,4 @@
1
- import{c as He}from"./chunk-JQRUD6KW-DAwg-yCU.js";import{d as ze}from"./wardley-L42UT6IY-5TKZOOLJ-DZr11zBG.js";import{m as A,a7 as Ve,as as Xe,p as xe,e as We,s as je,n as qe,o as $e,a as Ze,l as Ke,u as Je,L as Qe,E as ti,I as ei,q as ue,aC as fe,aI as ge,d as ii,i as ri,t as ni,f as oi,aJ as ai,aK as si,a6 as pe}from"./index-B5WxtMpv.js";import{r as Oe}from"./chunk-3SSMPTDK-KGZSzG3Y.js";var we=pe((M,I)=>{A(function(_,b){typeof M=="object"&&typeof I=="object"?I.exports=b():typeof define=="function"&&define.amd?define([],b):typeof M=="object"?M.layoutBase=b():_.layoutBase=b()},"webpackUniversalModuleDefinition")(M,function(){return function(_){var b={};function T(c){if(b[c])return b[c].exports;var h=b[c]={i:c,l:!1,exports:{}};return _[c].call(h.exports,h,h.exports,T),h.l=!0,h.exports}return A(T,"__webpack_require__"),T.m=_,T.c=b,T.i=function(c){return c},T.d=function(c,h,n){T.o(c,h)||Object.defineProperty(c,h,{configurable:!1,enumerable:!0,get:n})},T.n=function(c){var h=c&&c.__esModule?A(function(){return c.default},"getDefault"):A(function(){return c},"getModuleExports");return T.d(h,"a",h),h},T.o=function(c,h){return Object.prototype.hasOwnProperty.call(c,h)},T.p="",T(T.s=28)}([function(_,b,T){function c(){}A(c,"LayoutConstants"),c.QUALITY=1,c.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,c.DEFAULT_INCREMENTAL=!1,c.DEFAULT_ANIMATION_ON_LAYOUT=!0,c.DEFAULT_ANIMATION_DURING_LAYOUT=!1,c.DEFAULT_ANIMATION_PERIOD=50,c.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,c.DEFAULT_GRAPH_MARGIN=15,c.NODE_DIMENSIONS_INCLUDE_LABELS=!1,c.SIMPLE_NODE_SIZE=40,c.SIMPLE_NODE_HALF_SIZE=c.SIMPLE_NODE_SIZE/2,c.EMPTY_COMPOUND_NODE_SIZE=40,c.MIN_EDGE_LENGTH=1,c.WORLD_BOUNDARY=1e6,c.INITIAL_WORLD_BOUNDARY=c.WORLD_BOUNDARY/1e3,c.WORLD_CENTER_X=1200,c.WORLD_CENTER_Y=900,_.exports=c},function(_,b,T){var c=T(2),h=T(8),n=T(9);function e(s,i,f){c.call(this,f),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=f,this.bendpoints=[],this.source=s,this.target=i}A(e,"LEdge"),e.prototype=Object.create(c.prototype);for(var t in c)e[t]=c[t];e.prototype.getSource=function(){return this.source},e.prototype.getTarget=function(){return this.target},e.prototype.isInterGraph=function(){return this.isInterGraph},e.prototype.getLength=function(){return this.length},e.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},e.prototype.getBendpoints=function(){return this.bendpoints},e.prototype.getLca=function(){return this.lca},e.prototype.getSourceInLca=function(){return this.sourceInLca},e.prototype.getTargetInLca=function(){return this.targetInLca},e.prototype.getOtherEnd=function(s){if(this.source===s)return this.target;if(this.target===s)return this.source;throw"Node is not incident with this edge"},e.prototype.getOtherEndInGraph=function(s,i){for(var f=this.getOtherEnd(s),o=i.getGraphManager().getRoot();;){if(f.getOwner()==i)return f;if(f.getOwner()==o)break;f=f.getOwner().getParent()}return null},e.prototype.updateLength=function(){var s=new Array(4);this.isOverlapingSourceAndTarget=h.getIntersection(this.target.getRect(),this.source.getRect(),s),this.isOverlapingSourceAndTarget||(this.lengthX=s[0]-s[2],this.lengthY=s[1]-s[3],Math.abs(this.lengthX)<1&&(this.lengthX=n.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=n.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},e.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=n.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=n.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},_.exports=e},function(_,b,T){function c(h){this.vGraphObject=h}A(c,"LGraphObject"),_.exports=c},function(_,b,T){var c=T(2),h=T(10),n=T(13),e=T(0),t=T(16),s=T(5);function i(o,r,d,u){d==null&&u==null&&(u=r),c.call(this,u),o.graphManager!=null&&(o=o.graphManager),this.estimatedSize=h.MIN_VALUE,this.inclusionTreeDepth=h.MAX_VALUE,this.vGraphObject=u,this.edges=[],this.graphManager=o,d!=null&&r!=null?this.rect=new n(r.x,r.y,d.width,d.height):this.rect=new n}A(i,"LNode"),i.prototype=Object.create(c.prototype);for(var f in c)i[f]=c[f];i.prototype.getEdges=function(){return this.edges},i.prototype.getChild=function(){return this.child},i.prototype.getOwner=function(){return this.owner},i.prototype.getWidth=function(){return this.rect.width},i.prototype.setWidth=function(o){this.rect.width=o},i.prototype.getHeight=function(){return this.rect.height},i.prototype.setHeight=function(o){this.rect.height=o},i.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},i.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},i.prototype.getCenter=function(){return new s(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},i.prototype.getLocation=function(){return new s(this.rect.x,this.rect.y)},i.prototype.getRect=function(){return this.rect},i.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},i.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},i.prototype.setRect=function(o,r){this.rect.x=o.x,this.rect.y=o.y,this.rect.width=r.width,this.rect.height=r.height},i.prototype.setCenter=function(o,r){this.rect.x=o-this.rect.width/2,this.rect.y=r-this.rect.height/2},i.prototype.setLocation=function(o,r){this.rect.x=o,this.rect.y=r},i.prototype.moveBy=function(o,r){this.rect.x+=o,this.rect.y+=r},i.prototype.getEdgeListToNode=function(o){var r=[],d=this;return d.edges.forEach(function(u){if(u.target==o){if(u.source!=d)throw"Incorrect edge source!";r.push(u)}}),r},i.prototype.getEdgesBetween=function(o){var r=[],d=this;return d.edges.forEach(function(u){if(!(u.source==d||u.target==d))throw"Incorrect edge source and/or target";(u.target==o||u.source==o)&&r.push(u)}),r},i.prototype.getNeighborsList=function(){var o=new Set,r=this;return r.edges.forEach(function(d){if(d.source==r)o.add(d.target);else{if(d.target!=r)throw"Incorrect incidency!";o.add(d.source)}}),o},i.prototype.withChildren=function(){var o=new Set,r,d;if(o.add(this),this.child!=null)for(var u=this.child.getNodes(),l=0;l<u.length;l++)r=u[l],d=r.withChildren(),d.forEach(function(N){o.add(N)});return o},i.prototype.getNoOfChildren=function(){var o=0,r;if(this.child==null)o=1;else for(var d=this.child.getNodes(),u=0;u<d.length;u++)r=d[u],o+=r.getNoOfChildren();return o==0&&(o=1),o},i.prototype.getEstimatedSize=function(){if(this.estimatedSize==h.MIN_VALUE)throw"assert failed";return this.estimatedSize},i.prototype.calcEstimatedSize=function(){return this.child==null?this.estimatedSize=(this.rect.width+this.rect.height)/2:(this.estimatedSize=this.child.calcEstimatedSize(),this.rect.width=this.estimatedSize,this.rect.height=this.estimatedSize,this.estimatedSize)},i.prototype.scatter=function(){var o,r,d=-e.INITIAL_WORLD_BOUNDARY,u=e.INITIAL_WORLD_BOUNDARY;o=e.WORLD_CENTER_X+t.nextDouble()*(u-d)+d;var l=-e.INITIAL_WORLD_BOUNDARY,N=e.INITIAL_WORLD_BOUNDARY;r=e.WORLD_CENTER_Y+t.nextDouble()*(N-l)+l,this.rect.x=o,this.rect.y=r},i.prototype.updateBounds=function(){if(this.getChild()==null)throw"assert failed";if(this.getChild().getNodes().length!=0){var o=this.getChild();if(o.updateBounds(!0),this.rect.x=o.getLeft(),this.rect.y=o.getTop(),this.setWidth(o.getRight()-o.getLeft()),this.setHeight(o.getBottom()-o.getTop()),e.NODE_DIMENSIONS_INCLUDE_LABELS){var r=o.getRight()-o.getLeft(),d=o.getBottom()-o.getTop();this.labelWidth&&(this.labelPosHorizontal=="left"?(this.rect.x-=this.labelWidth,this.setWidth(r+this.labelWidth)):this.labelPosHorizontal=="center"&&this.labelWidth>r?(this.rect.x-=(this.labelWidth-r)/2,this.setWidth(this.labelWidth)):this.labelPosHorizontal=="right"&&this.setWidth(r+this.labelWidth)),this.labelHeight&&(this.labelPosVertical=="top"?(this.rect.y-=this.labelHeight,this.setHeight(d+this.labelHeight)):this.labelPosVertical=="center"&&this.labelHeight>d?(this.rect.y-=(this.labelHeight-d)/2,this.setHeight(this.labelHeight)):this.labelPosVertical=="bottom"&&this.setHeight(d+this.labelHeight))}}},i.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==h.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},i.prototype.transform=function(o){var r=this.rect.x;r>e.WORLD_BOUNDARY?r=e.WORLD_BOUNDARY:r<-e.WORLD_BOUNDARY&&(r=-e.WORLD_BOUNDARY);var d=this.rect.y;d>e.WORLD_BOUNDARY?d=e.WORLD_BOUNDARY:d<-e.WORLD_BOUNDARY&&(d=-e.WORLD_BOUNDARY);var u=new s(r,d),l=o.inverseTransformPoint(u);this.setLocation(l.x,l.y)},i.prototype.getLeft=function(){return this.rect.x},i.prototype.getRight=function(){return this.rect.x+this.rect.width},i.prototype.getTop=function(){return this.rect.y},i.prototype.getBottom=function(){return this.rect.y+this.rect.height},i.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},_.exports=i},function(_,b,T){var c=T(0);function h(){}A(h,"FDLayoutConstants");for(var n in c)h[n]=c[n];h.MAX_ITERATIONS=2500,h.DEFAULT_EDGE_LENGTH=50,h.DEFAULT_SPRING_STRENGTH=.45,h.DEFAULT_REPULSION_STRENGTH=4500,h.DEFAULT_GRAVITY_STRENGTH=.4,h.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,h.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,h.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,h.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,h.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,h.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,h.COOLING_ADAPTATION_FACTOR=.33,h.ADAPTATION_LOWER_NODE_LIMIT=1e3,h.ADAPTATION_UPPER_NODE_LIMIT=5e3,h.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,h.MAX_NODE_DISPLACEMENT=h.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,h.MIN_REPULSION_DIST=h.DEFAULT_EDGE_LENGTH/10,h.CONVERGENCE_CHECK_PERIOD=100,h.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,h.MIN_EDGE_LENGTH=1,h.GRID_CALCULATION_CHECK_PERIOD=10,_.exports=h},function(_,b,T){function c(h,n){h==null&&n==null?(this.x=0,this.y=0):(this.x=h,this.y=n)}A(c,"PointD"),c.prototype.getX=function(){return this.x},c.prototype.getY=function(){return this.y},c.prototype.setX=function(h){this.x=h},c.prototype.setY=function(h){this.y=h},c.prototype.getDifference=function(h){return new DimensionD(this.x-h.x,this.y-h.y)},c.prototype.getCopy=function(){return new c(this.x,this.y)},c.prototype.translate=function(h){return this.x+=h.width,this.y+=h.height,this},_.exports=c},function(_,b,T){var c=T(2),h=T(10),n=T(0),e=T(7),t=T(3),s=T(1),i=T(13),f=T(12),o=T(11);function r(u,l,N){c.call(this,N),this.estimatedSize=h.MIN_VALUE,this.margin=n.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=u,l!=null&&l instanceof e?this.graphManager=l:l!=null&&l instanceof Layout&&(this.graphManager=l.graphManager)}A(r,"LGraph"),r.prototype=Object.create(c.prototype);for(var d in c)r[d]=c[d];r.prototype.getNodes=function(){return this.nodes},r.prototype.getEdges=function(){return this.edges},r.prototype.getGraphManager=function(){return this.graphManager},r.prototype.getParent=function(){return this.parent},r.prototype.getLeft=function(){return this.left},r.prototype.getRight=function(){return this.right},r.prototype.getTop=function(){return this.top},r.prototype.getBottom=function(){return this.bottom},r.prototype.isConnected=function(){return this.isConnected},r.prototype.add=function(u,l,N){if(l==null&&N==null){var g=u;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(g)>-1)throw"Node already in graph!";return g.owner=this,this.getNodes().push(g),g}else{var E=u;if(!(this.getNodes().indexOf(l)>-1&&this.getNodes().indexOf(N)>-1))throw"Source or target not in graph!";if(!(l.owner==N.owner&&l.owner==this))throw"Both owners must be this graph!";return l.owner!=N.owner?null:(E.source=l,E.target=N,E.isInterGraph=!1,this.getEdges().push(E),l.edges.push(E),N!=l&&N.edges.push(E),E)}},r.prototype.remove=function(u){var l=u;if(u instanceof t){if(l==null)throw"Node is null!";if(!(l.owner!=null&&l.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var N=l.edges.slice(),g,E=N.length,w=0;w<E;w++)g=N[w],g.isInterGraph?this.graphManager.remove(g):g.source.owner.remove(g);var L=this.nodes.indexOf(l);if(L==-1)throw"Node not in owner node list!";this.nodes.splice(L,1)}else if(u instanceof s){var g=u;if(g==null)throw"Edge is null!";if(!(g.source!=null&&g.target!=null))throw"Source and/or target is null!";if(!(g.source.owner!=null&&g.target.owner!=null&&g.source.owner==this&&g.target.owner==this))throw"Source and/or target owner is invalid!";var Y=g.source.edges.indexOf(g),B=g.target.edges.indexOf(g);if(!(Y>-1&&B>-1))throw"Source and/or target doesn't know this edge!";g.source.edges.splice(Y,1),g.target!=g.source&&g.target.edges.splice(B,1);var L=g.source.owner.getEdges().indexOf(g);if(L==-1)throw"Not in owner's edge list!";g.source.owner.getEdges().splice(L,1)}},r.prototype.updateLeftTop=function(){for(var u=h.MAX_VALUE,l=h.MAX_VALUE,N,g,E,w=this.getNodes(),L=w.length,Y=0;Y<L;Y++){var B=w[Y];N=B.getTop(),g=B.getLeft(),u>N&&(u=N),l>g&&(l=g)}return u==h.MAX_VALUE?null:(w[0].getParent().paddingLeft!=null?E=w[0].getParent().paddingLeft:E=this.margin,this.left=l-E,this.top=u-E,new f(this.left,this.top))},r.prototype.updateBounds=function(u){for(var l=h.MAX_VALUE,N=-h.MAX_VALUE,g=h.MAX_VALUE,E=-h.MAX_VALUE,w,L,Y,B,P,X=this.nodes,q=X.length,O=0;O<q;O++){var it=X[O];u&&it.child!=null&&it.updateBounds(),w=it.getLeft(),L=it.getRight(),Y=it.getTop(),B=it.getBottom(),l>w&&(l=w),N<L&&(N=L),g>Y&&(g=Y),E<B&&(E=B)}var a=new i(l,g,N-l,E-g);l==h.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),X[0].getParent().paddingLeft!=null?P=X[0].getParent().paddingLeft:P=this.margin,this.left=a.x-P,this.right=a.x+a.width+P,this.top=a.y-P,this.bottom=a.y+a.height+P},r.calculateBounds=function(u){for(var l=h.MAX_VALUE,N=-h.MAX_VALUE,g=h.MAX_VALUE,E=-h.MAX_VALUE,w,L,Y,B,P=u.length,X=0;X<P;X++){var q=u[X];w=q.getLeft(),L=q.getRight(),Y=q.getTop(),B=q.getBottom(),l>w&&(l=w),N<L&&(N=L),g>Y&&(g=Y),E<B&&(E=B)}var O=new i(l,g,N-l,E-g);return O},r.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},r.prototype.getEstimatedSize=function(){if(this.estimatedSize==h.MIN_VALUE)throw"assert failed";return this.estimatedSize},r.prototype.calcEstimatedSize=function(){for(var u=0,l=this.nodes,N=l.length,g=0;g<N;g++){var E=l[g];u+=E.calcEstimatedSize()}return u==0?this.estimatedSize=n.EMPTY_COMPOUND_NODE_SIZE:this.estimatedSize=u/Math.sqrt(this.nodes.length),this.estimatedSize},r.prototype.updateConnected=function(){var u=this;if(this.nodes.length==0){this.isConnected=!0;return}var l=new o,N=new Set,g=this.nodes[0],E,w,L=g.withChildren();for(L.forEach(function(O){l.push(O),N.add(O)});l.length!==0;){g=l.shift(),E=g.getEdges();for(var Y=E.length,B=0;B<Y;B++){var P=E[B];if(w=P.getOtherEndInGraph(g,this),w!=null&&!N.has(w)){var X=w.withChildren();X.forEach(function(O){l.push(O),N.add(O)})}}}if(this.isConnected=!1,N.size>=this.nodes.length){var q=0;N.forEach(function(O){O.owner==u&&q++}),q==this.nodes.length&&(this.isConnected=!0)}},_.exports=r},function(_,b,T){var c,h=T(1);function n(e){c=T(6),this.layout=e,this.graphs=[],this.edges=[]}A(n,"LGraphManager"),n.prototype.addRoot=function(){var e=this.layout.newGraph(),t=this.layout.newNode(null),s=this.add(e,t);return this.setRootGraph(s),this.rootGraph},n.prototype.add=function(e,t,s,i,f){if(s==null&&i==null&&f==null){if(e==null)throw"Graph is null!";if(t==null)throw"Parent node is null!";if(this.graphs.indexOf(e)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(e),e.parent!=null)throw"Already has a parent!";if(t.child!=null)throw"Already has a child!";return e.parent=t,t.child=e,e}else{f=s,i=t,s=e;var o=i.getOwner(),r=f.getOwner();if(!(o!=null&&o.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(r!=null&&r.getGraphManager()==this))throw"Target not in this graph mgr!";if(o==r)return s.isInterGraph=!1,o.add(s,i,f);if(s.isInterGraph=!0,s.source=i,s.target=f,this.edges.indexOf(s)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(s),!(s.source!=null&&s.target!=null))throw"Edge source and/or target is null!";if(!(s.source.edges.indexOf(s)==-1&&s.target.edges.indexOf(s)==-1))throw"Edge already in source and/or target incidency list!";return s.source.edges.push(s),s.target.edges.push(s),s}},n.prototype.remove=function(e){if(e instanceof c){var t=e;if(t.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(t==this.rootGraph||t.parent!=null&&t.parent.graphManager==this))throw"Invalid parent node!";var s=[];s=s.concat(t.getEdges());for(var i,f=s.length,o=0;o<f;o++)i=s[o],t.remove(i);var r=[];r=r.concat(t.getNodes());var d;f=r.length;for(var o=0;o<f;o++)d=r[o],t.remove(d);t==this.rootGraph&&this.setRootGraph(null);var u=this.graphs.indexOf(t);this.graphs.splice(u,1),t.parent=null}else if(e instanceof h){if(i=e,i==null)throw"Edge is null!";if(!i.isInterGraph)throw"Not an inter-graph edge!";if(!(i.source!=null&&i.target!=null))throw"Source and/or target is null!";if(!(i.source.edges.indexOf(i)!=-1&&i.target.edges.indexOf(i)!=-1))throw"Source and/or target doesn't know this edge!";var u=i.source.edges.indexOf(i);if(i.source.edges.splice(u,1),u=i.target.edges.indexOf(i),i.target.edges.splice(u,1),!(i.source.owner!=null&&i.source.owner.getGraphManager()!=null))throw"Edge owner graph or owner graph manager is null!";if(i.source.owner.getGraphManager().edges.indexOf(i)==-1)throw"Not in owner graph manager's edge list!";var u=i.source.owner.getGraphManager().edges.indexOf(i);i.source.owner.getGraphManager().edges.splice(u,1)}},n.prototype.updateBounds=function(){this.rootGraph.updateBounds(!0)},n.prototype.getGraphs=function(){return this.graphs},n.prototype.getAllNodes=function(){if(this.allNodes==null){for(var e=[],t=this.getGraphs(),s=t.length,i=0;i<s;i++)e=e.concat(t[i].getNodes());this.allNodes=e}return this.allNodes},n.prototype.resetAllNodes=function(){this.allNodes=null},n.prototype.resetAllEdges=function(){this.allEdges=null},n.prototype.resetAllNodesToApplyGravitation=function(){this.allNodesToApplyGravitation=null},n.prototype.getAllEdges=function(){if(this.allEdges==null){for(var e=[],t=this.getGraphs(),s=t.length,i=0;i<t.length;i++)e=e.concat(t[i].getEdges());e=e.concat(this.edges),this.allEdges=e}return this.allEdges},n.prototype.getAllNodesToApplyGravitation=function(){return this.allNodesToApplyGravitation},n.prototype.setAllNodesToApplyGravitation=function(e){if(this.allNodesToApplyGravitation!=null)throw"assert failed";this.allNodesToApplyGravitation=e},n.prototype.getRoot=function(){return this.rootGraph},n.prototype.setRootGraph=function(e){if(e.getGraphManager()!=this)throw"Root not in this graph mgr!";this.rootGraph=e,e.parent==null&&(e.parent=this.layout.newNode("Root node"))},n.prototype.getLayout=function(){return this.layout},n.prototype.isOneAncestorOfOther=function(e,t){if(!(e!=null&&t!=null))throw"assert failed";if(e==t)return!0;var s=e.getOwner(),i;do{if(i=s.getParent(),i==null)break;if(i==t)return!0;if(s=i.getOwner(),s==null)break}while(!0);s=t.getOwner();do{if(i=s.getParent(),i==null)break;if(i==e)return!0;if(s=i.getOwner(),s==null)break}while(!0);return!1},n.prototype.calcLowestCommonAncestors=function(){for(var e,t,s,i,f,o=this.getAllEdges(),r=o.length,d=0;d<r;d++){if(e=o[d],t=e.source,s=e.target,e.lca=null,e.sourceInLca=t,e.targetInLca=s,t==s){e.lca=t.getOwner();continue}for(i=t.getOwner();e.lca==null;){for(e.targetInLca=s,f=s.getOwner();e.lca==null;){if(f==i){e.lca=f;break}if(f==this.rootGraph)break;if(e.lca!=null)throw"assert failed";e.targetInLca=f.getParent(),f=e.targetInLca.getOwner()}if(i==this.rootGraph)break;e.lca==null&&(e.sourceInLca=i.getParent(),i=e.sourceInLca.getOwner())}if(e.lca==null)throw"assert failed"}},n.prototype.calcLowestCommonAncestor=function(e,t){if(e==t)return e.getOwner();var s=e.getOwner();do{if(s==null)break;var i=t.getOwner();do{if(i==null)break;if(i==s)return i;i=i.getParent().getOwner()}while(!0);s=s.getParent().getOwner()}while(!0);return s},n.prototype.calcInclusionTreeDepths=function(e,t){e==null&&t==null&&(e=this.rootGraph,t=1);for(var s,i=e.getNodes(),f=i.length,o=0;o<f;o++)s=i[o],s.inclusionTreeDepth=t,s.child!=null&&this.calcInclusionTreeDepths(s.child,t+1)},n.prototype.includesInvalidEdge=function(){for(var e,t=[],s=this.edges.length,i=0;i<s;i++)e=this.edges[i],this.isOneAncestorOfOther(e.source,e.target)&&t.push(e);for(var i=0;i<t.length;i++)this.remove(t[i]);return!1},_.exports=n},function(_,b,T){var c=T(12);function h(){}A(h,"IGeometry"),h.calcSeparationAmount=function(n,e,t,s){if(!n.intersects(e))throw"assert failed";var i=new Array(2);this.decideDirectionsForOverlappingNodes(n,e,i),t[0]=Math.min(n.getRight(),e.getRight())-Math.max(n.x,e.x),t[1]=Math.min(n.getBottom(),e.getBottom())-Math.max(n.y,e.y),n.getX()<=e.getX()&&n.getRight()>=e.getRight()?t[0]+=Math.min(e.getX()-n.getX(),n.getRight()-e.getRight()):e.getX()<=n.getX()&&e.getRight()>=n.getRight()&&(t[0]+=Math.min(n.getX()-e.getX(),e.getRight()-n.getRight())),n.getY()<=e.getY()&&n.getBottom()>=e.getBottom()?t[1]+=Math.min(e.getY()-n.getY(),n.getBottom()-e.getBottom()):e.getY()<=n.getY()&&e.getBottom()>=n.getBottom()&&(t[1]+=Math.min(n.getY()-e.getY(),e.getBottom()-n.getBottom()));var f=Math.abs((e.getCenterY()-n.getCenterY())/(e.getCenterX()-n.getCenterX()));e.getCenterY()===n.getCenterY()&&e.getCenterX()===n.getCenterX()&&(f=1);var o=f*t[0],r=t[1]/f;t[0]<r?r=t[0]:o=t[1],t[0]=-1*i[0]*(r/2+s),t[1]=-1*i[1]*(o/2+s)},h.decideDirectionsForOverlappingNodes=function(n,e,t){n.getCenterX()<e.getCenterX()?t[0]=-1:t[0]=1,n.getCenterY()<e.getCenterY()?t[1]=-1:t[1]=1},h.getIntersection2=function(n,e,t){var s=n.getCenterX(),i=n.getCenterY(),f=e.getCenterX(),o=e.getCenterY();if(n.intersects(e))return t[0]=s,t[1]=i,t[2]=f,t[3]=o,!0;var r=n.getX(),d=n.getY(),u=n.getRight(),l=n.getX(),N=n.getBottom(),g=n.getRight(),E=n.getWidthHalf(),w=n.getHeightHalf(),L=e.getX(),Y=e.getY(),B=e.getRight(),P=e.getX(),X=e.getBottom(),q=e.getRight(),O=e.getWidthHalf(),it=e.getHeightHalf(),a=!1,v=!1;if(s===f){if(i>o)return t[0]=s,t[1]=d,t[2]=f,t[3]=X,!1;if(i<o)return t[0]=s,t[1]=N,t[2]=f,t[3]=Y,!1}else if(i===o){if(s>f)return t[0]=r,t[1]=i,t[2]=B,t[3]=o,!1;if(s<f)return t[0]=u,t[1]=i,t[2]=L,t[3]=o,!1}else{var m=n.height/n.width,y=e.height/e.width,p=(o-i)/(f-s),D=void 0,x=void 0,R=void 0,H=void 0,z=void 0,W=void 0;if(-m===p?s>f?(t[0]=l,t[1]=N,a=!0):(t[0]=u,t[1]=d,a=!0):m===p&&(s>f?(t[0]=r,t[1]=d,a=!0):(t[0]=g,t[1]=N,a=!0)),-y===p?f>s?(t[2]=P,t[3]=X,v=!0):(t[2]=B,t[3]=Y,v=!0):y===p&&(f>s?(t[2]=L,t[3]=Y,v=!0):(t[2]=q,t[3]=X,v=!0)),a&&v)return!1;if(s>f?i>o?(D=this.getCardinalDirection(m,p,4),x=this.getCardinalDirection(y,p,2)):(D=this.getCardinalDirection(-m,p,3),x=this.getCardinalDirection(-y,p,1)):i>o?(D=this.getCardinalDirection(-m,p,1),x=this.getCardinalDirection(-y,p,3)):(D=this.getCardinalDirection(m,p,2),x=this.getCardinalDirection(y,p,4)),!a)switch(D){case 1:H=d,R=s+-w/p,t[0]=R,t[1]=H;break;case 2:R=g,H=i+E*p,t[0]=R,t[1]=H;break;case 3:H=N,R=s+w/p,t[0]=R,t[1]=H;break;case 4:R=l,H=i+-E*p,t[0]=R,t[1]=H;break}if(!v)switch(x){case 1:W=Y,z=f+-it/p,t[2]=z,t[3]=W;break;case 2:z=q,W=o+O*p,t[2]=z,t[3]=W;break;case 3:W=X,z=f+it/p,t[2]=z,t[3]=W;break;case 4:z=P,W=o+-O*p,t[2]=z,t[3]=W;break}}return!1},h.getCardinalDirection=function(n,e,t){return n>e?t:1+t%4},h.getIntersection=function(n,e,t,s){if(s==null)return this.getIntersection2(n,e,t);var i=n.x,f=n.y,o=e.x,r=e.y,d=t.x,u=t.y,l=s.x,N=s.y,g=void 0,E=void 0,w=void 0,L=void 0,Y=void 0,B=void 0,P=void 0,X=void 0,q=void 0;return w=r-f,Y=i-o,P=o*f-i*r,L=N-u,B=d-l,X=l*u-d*N,q=w*B-L*Y,q===0?null:(g=(Y*X-B*P)/q,E=(L*P-w*X)/q,new c(g,E))},h.angleOfVector=function(n,e,t,s){var i=void 0;return n!==t?(i=Math.atan((s-e)/(t-n)),t<n?i+=Math.PI:s<e&&(i+=this.TWO_PI)):s<e?i=this.ONE_AND_HALF_PI:i=this.HALF_PI,i},h.doIntersect=function(n,e,t,s){var i=n.x,f=n.y,o=e.x,r=e.y,d=t.x,u=t.y,l=s.x,N=s.y,g=(o-i)*(N-u)-(l-d)*(r-f);if(g===0)return!1;var E=((N-u)*(l-i)+(d-l)*(N-f))/g,w=((f-r)*(l-i)+(o-i)*(N-f))/g;return 0<E&&E<1&&0<w&&w<1},h.findCircleLineIntersections=function(n,e,t,s,i,f,o){var r=(t-n)*(t-n)+(s-e)*(s-e),d=2*((n-i)*(t-n)+(e-f)*(s-e)),u=(n-i)*(n-i)+(e-f)*(e-f)-o*o,l=d*d-4*r*u;if(l>=0){var N=(-d+Math.sqrt(d*d-4*r*u))/(2*r),g=(-d-Math.sqrt(d*d-4*r*u))/(2*r),E=null;return N>=0&&N<=1?[N]:g>=0&&g<=1?[g]:E}else return null},h.HALF_PI=.5*Math.PI,h.ONE_AND_HALF_PI=1.5*Math.PI,h.TWO_PI=2*Math.PI,h.THREE_PI=3*Math.PI,_.exports=h},function(_,b,T){function c(){}A(c,"IMath"),c.sign=function(h){return h>0?1:h<0?-1:0},c.floor=function(h){return h<0?Math.ceil(h):Math.floor(h)},c.ceil=function(h){return h<0?Math.floor(h):Math.ceil(h)},_.exports=c},function(_,b,T){function c(){}A(c,"Integer"),c.MAX_VALUE=2147483647,c.MIN_VALUE=-2147483648,_.exports=c},function(_,b,T){var c=function(){function i(f,o){for(var r=0;r<o.length;r++){var d=o[r];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(f,d.key,d)}}return A(i,"defineProperties"),function(f,o,r){return o&&i(f.prototype,o),r&&i(f,r),f}}();function h(i,f){if(!(i instanceof f))throw new TypeError("Cannot call a class as a function")}A(h,"_classCallCheck");var n=A(function(i){return{value:i,next:null,prev:null}},"nodeFrom"),e=A(function(i,f,o,r){return i!==null?i.next=f:r.head=f,o!==null?o.prev=f:r.tail=f,f.prev=i,f.next=o,r.length++,f},"add"),t=A(function(i,f){var o=i.prev,r=i.next;return o!==null?o.next=r:f.head=r,r!==null?r.prev=o:f.tail=o,i.prev=i.next=null,f.length--,i},"_remove"),s=function(){function i(f){var o=this;h(this,i),this.length=0,this.head=null,this.tail=null,f==null||f.forEach(function(r){return o.push(r)})}return A(i,"LinkedList"),c(i,[{key:"size",value:A(function(){return this.length},"size")},{key:"insertBefore",value:A(function(f,o){return e(o.prev,n(f),o,this)},"insertBefore")},{key:"insertAfter",value:A(function(f,o){return e(o,n(f),o.next,this)},"insertAfter")},{key:"insertNodeBefore",value:A(function(f,o){return e(o.prev,f,o,this)},"insertNodeBefore")},{key:"insertNodeAfter",value:A(function(f,o){return e(o,f,o.next,this)},"insertNodeAfter")},{key:"push",value:A(function(f){return e(this.tail,n(f),null,this)},"push")},{key:"unshift",value:A(function(f){return e(null,n(f),this.head,this)},"unshift")},{key:"remove",value:A(function(f){return t(f,this)},"remove")},{key:"pop",value:A(function(){return t(this.tail,this).value},"pop")},{key:"popNode",value:A(function(){return t(this.tail,this)},"popNode")},{key:"shift",value:A(function(){return t(this.head,this).value},"shift")},{key:"shiftNode",value:A(function(){return t(this.head,this)},"shiftNode")},{key:"get_object_at",value:A(function(f){if(f<=this.length()){for(var o=1,r=this.head;o<f;)r=r.next,o++;return r.value}},"get_object_at")},{key:"set_object_at",value:A(function(f,o){if(f<=this.length()){for(var r=1,d=this.head;r<f;)d=d.next,r++;d.value=o}},"set_object_at")}]),i}();_.exports=s},function(_,b,T){function c(h,n,e){this.x=null,this.y=null,h==null&&n==null&&e==null?(this.x=0,this.y=0):typeof h=="number"&&typeof n=="number"&&e==null?(this.x=h,this.y=n):h.constructor.name=="Point"&&n==null&&e==null&&(e=h,this.x=e.x,this.y=e.y)}A(c,"Point"),c.prototype.getX=function(){return this.x},c.prototype.getY=function(){return this.y},c.prototype.getLocation=function(){return new c(this.x,this.y)},c.prototype.setLocation=function(h,n,e){h.constructor.name=="Point"&&n==null&&e==null?(e=h,this.setLocation(e.x,e.y)):typeof h=="number"&&typeof n=="number"&&e==null&&(parseInt(h)==h&&parseInt(n)==n?this.move(h,n):(this.x=Math.floor(h+.5),this.y=Math.floor(n+.5)))},c.prototype.move=function(h,n){this.x=h,this.y=n},c.prototype.translate=function(h,n){this.x+=h,this.y+=n},c.prototype.equals=function(h){if(h.constructor.name=="Point"){var n=h;return this.x==n.x&&this.y==n.y}return this==h},c.prototype.toString=function(){return new c().constructor.name+"[x="+this.x+",y="+this.y+"]"},_.exports=c},function(_,b,T){function c(h,n,e,t){this.x=0,this.y=0,this.width=0,this.height=0,h!=null&&n!=null&&e!=null&&t!=null&&(this.x=h,this.y=n,this.width=e,this.height=t)}A(c,"RectangleD"),c.prototype.getX=function(){return this.x},c.prototype.setX=function(h){this.x=h},c.prototype.getY=function(){return this.y},c.prototype.setY=function(h){this.y=h},c.prototype.getWidth=function(){return this.width},c.prototype.setWidth=function(h){this.width=h},c.prototype.getHeight=function(){return this.height},c.prototype.setHeight=function(h){this.height=h},c.prototype.getRight=function(){return this.x+this.width},c.prototype.getBottom=function(){return this.y+this.height},c.prototype.intersects=function(h){return!(this.getRight()<h.x||this.getBottom()<h.y||h.getRight()<this.x||h.getBottom()<this.y)},c.prototype.getCenterX=function(){return this.x+this.width/2},c.prototype.getMinX=function(){return this.getX()},c.prototype.getMaxX=function(){return this.getX()+this.width},c.prototype.getCenterY=function(){return this.y+this.height/2},c.prototype.getMinY=function(){return this.getY()},c.prototype.getMaxY=function(){return this.getY()+this.height},c.prototype.getWidthHalf=function(){return this.width/2},c.prototype.getHeightHalf=function(){return this.height/2},_.exports=c},function(_,b,T){var c=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n};function h(){}A(h,"UniqueIDGeneretor"),h.lastID=0,h.createID=function(n){return h.isPrimitive(n)?n:(n.uniqueID!=null||(n.uniqueID=h.getString(),h.lastID++),n.uniqueID)},h.getString=function(n){return n==null&&(n=h.lastID),"Object#"+n},h.isPrimitive=function(n){var e=typeof n>"u"?"undefined":c(n);return n==null||e!="object"&&e!="function"},_.exports=h},function(_,b,T){function c(d){if(Array.isArray(d)){for(var u=0,l=Array(d.length);u<d.length;u++)l[u]=d[u];return l}else return Array.from(d)}A(c,"_toConsumableArray");var h=T(0),n=T(7),e=T(3),t=T(1),s=T(6),i=T(5),f=T(17),o=T(29);function r(d){o.call(this),this.layoutQuality=h.QUALITY,this.createBendsAsNeeded=h.DEFAULT_CREATE_BENDS_AS_NEEDED,this.incremental=h.DEFAULT_INCREMENTAL,this.animationOnLayout=h.DEFAULT_ANIMATION_ON_LAYOUT,this.animationDuringLayout=h.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=h.DEFAULT_ANIMATION_PERIOD,this.uniformLeafNodeSizes=h.DEFAULT_UNIFORM_LEAF_NODE_SIZES,this.edgeToDummyNodes=new Map,this.graphManager=new n(this),this.isLayoutFinished=!1,this.isSubLayout=!1,this.isRemoteUse=!1,d!=null&&(this.isRemoteUse=d)}A(r,"Layout"),r.RANDOM_SEED=1,r.prototype=Object.create(o.prototype),r.prototype.getGraphManager=function(){return this.graphManager},r.prototype.getAllNodes=function(){return this.graphManager.getAllNodes()},r.prototype.getAllEdges=function(){return this.graphManager.getAllEdges()},r.prototype.getAllNodesToApplyGravitation=function(){return this.graphManager.getAllNodesToApplyGravitation()},r.prototype.newGraphManager=function(){var d=new n(this);return this.graphManager=d,d},r.prototype.newGraph=function(d){return new s(null,this.graphManager,d)},r.prototype.newNode=function(d){return new e(this.graphManager,d)},r.prototype.newEdge=function(d){return new t(null,null,d)},r.prototype.checkLayoutSuccess=function(){return this.graphManager.getRoot()==null||this.graphManager.getRoot().getNodes().length==0||this.graphManager.includesInvalidEdge()},r.prototype.runLayout=function(){this.isLayoutFinished=!1,this.tilingPreLayout&&this.tilingPreLayout(),this.initParameters();var d;return this.checkLayoutSuccess()?d=!1:d=this.layout(),h.ANIMATE==="during"?!1:(d&&(this.isSubLayout||this.doPostLayout()),this.tilingPostLayout&&this.tilingPostLayout(),this.isLayoutFinished=!0,d)},r.prototype.doPostLayout=function(){this.incremental||this.transform(),this.update()},r.prototype.update2=function(){if(this.createBendsAsNeeded&&(this.createBendpointsFromDummyNodes(),this.graphManager.resetAllEdges()),!this.isRemoteUse){for(var d,u=this.graphManager.getAllEdges(),l=0;l<u.length;l++)d=u[l];for(var N,g=this.graphManager.getRoot().getNodes(),l=0;l<g.length;l++)N=g[l];this.update(this.graphManager.getRoot())}},r.prototype.update=function(d){if(d==null)this.update2();else if(d instanceof e){var u=d;if(u.getChild()!=null)for(var l=u.getChild().getNodes(),N=0;N<l.length;N++)update(l[N]);if(u.vGraphObject!=null){var g=u.vGraphObject;g.update(u)}}else if(d instanceof t){var E=d;if(E.vGraphObject!=null){var w=E.vGraphObject;w.update(E)}}else if(d instanceof s){var L=d;if(L.vGraphObject!=null){var Y=L.vGraphObject;Y.update(L)}}},r.prototype.initParameters=function(){this.isSubLayout||(this.layoutQuality=h.QUALITY,this.animationDuringLayout=h.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=h.DEFAULT_ANIMATION_PERIOD,this.animationOnLayout=h.DEFAULT_ANIMATION_ON_LAYOUT,this.incremental=h.DEFAULT_INCREMENTAL,this.createBendsAsNeeded=h.DEFAULT_CREATE_BENDS_AS_NEEDED,this.uniformLeafNodeSizes=h.DEFAULT_UNIFORM_LEAF_NODE_SIZES),this.animationDuringLayout&&(this.animationOnLayout=!1)},r.prototype.transform=function(d){if(d==null)this.transform(new i(0,0));else{var u=new f,l=this.graphManager.getRoot().updateLeftTop();if(l!=null){u.setWorldOrgX(d.x),u.setWorldOrgY(d.y),u.setDeviceOrgX(l.x),u.setDeviceOrgY(l.y);for(var N=this.getAllNodes(),g,E=0;E<N.length;E++)g=N[E],g.transform(u)}}},r.prototype.positionNodesRandomly=function(d){if(d==null)this.positionNodesRandomly(this.getGraphManager().getRoot()),this.getGraphManager().getRoot().updateBounds(!0);else for(var u,l,N=d.getNodes(),g=0;g<N.length;g++)u=N[g],l=u.getChild(),l==null||l.getNodes().length==0?u.scatter():(this.positionNodesRandomly(l),u.updateBounds())},r.prototype.getFlatForest=function(){for(var d=[],u=!0,l=this.graphManager.getRoot().getNodes(),N=!0,g=0;g<l.length;g++)l[g].getChild()!=null&&(N=!1);if(!N)return d;var E=new Set,w=[],L=new Map,Y=[];for(Y=Y.concat(l);Y.length>0&&u;){for(w.push(Y[0]);w.length>0&&u;){var B=w[0];w.splice(0,1),E.add(B);for(var P=B.getEdges(),g=0;g<P.length;g++){var X=P[g].getOtherEnd(B);if(L.get(B)!=X)if(!E.has(X))w.push(X),L.set(X,B);else{u=!1;break}}}if(!u)d=[];else{var q=[].concat(c(E));d.push(q);for(var g=0;g<q.length;g++){var O=q[g],it=Y.indexOf(O);it>-1&&Y.splice(it,1)}E=new Set,L=new Map}}return d},r.prototype.createDummyNodesForBendpoints=function(d){for(var u=[],l=d.source,N=this.graphManager.calcLowestCommonAncestor(d.source,d.target),g=0;g<d.bendpoints.length;g++){var E=this.newNode(null);E.setRect(new Point(0,0),new Dimension(1,1)),N.add(E);var w=this.newEdge(null);this.graphManager.add(w,l,E),u.add(E),l=E}var w=this.newEdge(null);return this.graphManager.add(w,l,d.target),this.edgeToDummyNodes.set(d,u),d.isInterGraph()?this.graphManager.remove(d):N.remove(d),u},r.prototype.createBendpointsFromDummyNodes=function(){var d=[];d=d.concat(this.graphManager.getAllEdges()),d=[].concat(c(this.edgeToDummyNodes.keys())).concat(d);for(var u=0;u<d.length;u++){var l=d[u];if(l.bendpoints.length>0){for(var N=this.edgeToDummyNodes.get(l),g=0;g<N.length;g++){var E=N[g],w=new i(E.getCenterX(),E.getCenterY()),L=l.bendpoints.get(g);L.x=w.x,L.y=w.y,E.getOwner().remove(E)}this.graphManager.add(l,l.source,l.target)}}},r.transform=function(d,u,l,N){if(l!=null&&N!=null){var g=u;if(d<=50){var E=u/l;g-=(u-E)/50*(50-d)}else{var w=u*N;g+=(w-u)/50*(d-50)}return g}else{var L,Y;return d<=50?(L=9*u/500,Y=u/10):(L=9*u/50,Y=-8*u),L*d+Y}},r.findCenterOfTree=function(d){var u=[];u=u.concat(d);var l=[],N=new Map,g=!1,E=null;(u.length==1||u.length==2)&&(g=!0,E=u[0]);for(var w=0;w<u.length;w++){var L=u[w],Y=L.getNeighborsList().size;N.set(L,L.getNeighborsList().size),Y==1&&l.push(L)}var B=[];for(B=B.concat(l);!g;){var P=[];P=P.concat(B),B=[];for(var w=0;w<u.length;w++){var L=u[w],X=u.indexOf(L);X>=0&&u.splice(X,1);var q=L.getNeighborsList();q.forEach(function(a){if(l.indexOf(a)<0){var v=N.get(a),m=v-1;m==1&&B.push(a),N.set(a,m)}})}l=l.concat(B),(u.length==1||u.length==2)&&(g=!0,E=u[0])}return E},r.prototype.setGraphManager=function(d){this.graphManager=d},_.exports=r},function(_,b,T){function c(){}A(c,"RandomSeed"),c.seed=1,c.x=0,c.nextDouble=function(){return c.x=Math.sin(c.seed++)*1e4,c.x-Math.floor(c.x)},_.exports=c},function(_,b,T){var c=T(5);function h(n,e){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}A(h,"Transform"),h.prototype.getWorldOrgX=function(){return this.lworldOrgX},h.prototype.setWorldOrgX=function(n){this.lworldOrgX=n},h.prototype.getWorldOrgY=function(){return this.lworldOrgY},h.prototype.setWorldOrgY=function(n){this.lworldOrgY=n},h.prototype.getWorldExtX=function(){return this.lworldExtX},h.prototype.setWorldExtX=function(n){this.lworldExtX=n},h.prototype.getWorldExtY=function(){return this.lworldExtY},h.prototype.setWorldExtY=function(n){this.lworldExtY=n},h.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},h.prototype.setDeviceOrgX=function(n){this.ldeviceOrgX=n},h.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},h.prototype.setDeviceOrgY=function(n){this.ldeviceOrgY=n},h.prototype.getDeviceExtX=function(){return this.ldeviceExtX},h.prototype.setDeviceExtX=function(n){this.ldeviceExtX=n},h.prototype.getDeviceExtY=function(){return this.ldeviceExtY},h.prototype.setDeviceExtY=function(n){this.ldeviceExtY=n},h.prototype.transformX=function(n){var e=0,t=this.lworldExtX;return t!=0&&(e=this.ldeviceOrgX+(n-this.lworldOrgX)*this.ldeviceExtX/t),e},h.prototype.transformY=function(n){var e=0,t=this.lworldExtY;return t!=0&&(e=this.ldeviceOrgY+(n-this.lworldOrgY)*this.ldeviceExtY/t),e},h.prototype.inverseTransformX=function(n){var e=0,t=this.ldeviceExtX;return t!=0&&(e=this.lworldOrgX+(n-this.ldeviceOrgX)*this.lworldExtX/t),e},h.prototype.inverseTransformY=function(n){var e=0,t=this.ldeviceExtY;return t!=0&&(e=this.lworldOrgY+(n-this.ldeviceOrgY)*this.lworldExtY/t),e},h.prototype.inverseTransformPoint=function(n){var e=new c(this.inverseTransformX(n.x),this.inverseTransformY(n.y));return e},_.exports=h},function(_,b,T){function c(o){if(Array.isArray(o)){for(var r=0,d=Array(o.length);r<o.length;r++)d[r]=o[r];return d}else return Array.from(o)}A(c,"_toConsumableArray");var h=T(15),n=T(4),e=T(0),t=T(8),s=T(9);function i(){h.call(this),this.useSmartIdealEdgeLengthCalculation=n.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=n.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=n.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=n.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=n.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*n.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=n.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=n.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=n.MAX_ITERATIONS}A(i,"FDLayout"),i.prototype=Object.create(h.prototype);for(var f in h)i[f]=h[f];i.prototype.initParameters=function(){h.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=n.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},i.prototype.calcIdealEdgeLengths=function(){for(var o,r,d,u,l,N,g,E=this.getGraphManager().getAllEdges(),w=0;w<E.length;w++)o=E[w],r=o.idealLength,o.isInterGraph&&(u=o.getSource(),l=o.getTarget(),N=o.getSourceInLca().getEstimatedSize(),g=o.getTargetInLca().getEstimatedSize(),this.useSmartIdealEdgeLengthCalculation&&(o.idealLength+=N+g-2*e.SIMPLE_NODE_SIZE),d=o.getLca().getInclusionTreeDepth(),o.idealLength+=r*n.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR*(u.getInclusionTreeDepth()+l.getInclusionTreeDepth()-2*d))},i.prototype.initSpringEmbedder=function(){var o=this.getAllNodes().length;this.incremental?(o>n.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*n.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(o-n.ADAPTATION_LOWER_NODE_LIMIT)/(n.ADAPTATION_UPPER_NODE_LIMIT-n.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-n.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=n.MAX_NODE_DISPLACEMENT_INCREMENTAL):(o>n.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(n.COOLING_ADAPTATION_FACTOR,1-(o-n.ADAPTATION_LOWER_NODE_LIMIT)/(n.ADAPTATION_UPPER_NODE_LIMIT-n.ADAPTATION_LOWER_NODE_LIMIT)*(1-n.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=n.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.displacementThresholdPerNode=3*n.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},i.prototype.calcSpringForces=function(){for(var o=this.getAllEdges(),r,d=0;d<o.length;d++)r=o[d],this.calcSpringForce(r,r.idealLength)},i.prototype.calcRepulsionForces=function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,d,u,l,N,g=this.getAllNodes(),E;if(this.useFRGridVariant)for(this.totalIterations%n.GRID_CALCULATION_CHECK_PERIOD==1&&o&&this.updateGrid(),E=new Set,d=0;d<g.length;d++)l=g[d],this.calculateRepulsionForceOfANode(l,E,o,r),E.add(l);else for(d=0;d<g.length;d++)for(l=g[d],u=d+1;u<g.length;u++)N=g[u],l.getOwner()==N.getOwner()&&this.calcRepulsionForce(l,N)},i.prototype.calcGravitationalForces=function(){for(var o,r=this.getAllNodesToApplyGravitation(),d=0;d<r.length;d++)o=r[d],this.calcGravitationalForce(o)},i.prototype.moveNodes=function(){for(var o=this.getAllNodes(),r,d=0;d<o.length;d++)r=o[d],r.move()},i.prototype.calcSpringForce=function(o,r){var d=o.getSource(),u=o.getTarget(),l,N,g,E;if(this.uniformLeafNodeSizes&&d.getChild()==null&&u.getChild()==null)o.updateLengthSimple();else if(o.updateLength(),o.isOverlapingSourceAndTarget)return;l=o.getLength(),l!=0&&(N=o.edgeElasticity*(l-r),g=N*(o.lengthX/l),E=N*(o.lengthY/l),d.springForceX+=g,d.springForceY+=E,u.springForceX-=g,u.springForceY-=E)},i.prototype.calcRepulsionForce=function(o,r){var d=o.getRect(),u=r.getRect(),l=new Array(2),N=new Array(4),g,E,w,L,Y,B,P;if(d.intersects(u)){t.calcSeparationAmount(d,u,l,n.DEFAULT_EDGE_LENGTH/2),B=2*l[0],P=2*l[1];var X=o.noOfChildren*r.noOfChildren/(o.noOfChildren+r.noOfChildren);o.repulsionForceX-=X*B,o.repulsionForceY-=X*P,r.repulsionForceX+=X*B,r.repulsionForceY+=X*P}else this.uniformLeafNodeSizes&&o.getChild()==null&&r.getChild()==null?(g=u.getCenterX()-d.getCenterX(),E=u.getCenterY()-d.getCenterY()):(t.getIntersection(d,u,N),g=N[2]-N[0],E=N[3]-N[1]),Math.abs(g)<n.MIN_REPULSION_DIST&&(g=s.sign(g)*n.MIN_REPULSION_DIST),Math.abs(E)<n.MIN_REPULSION_DIST&&(E=s.sign(E)*n.MIN_REPULSION_DIST),w=g*g+E*E,L=Math.sqrt(w),Y=(o.nodeRepulsion/2+r.nodeRepulsion/2)*o.noOfChildren*r.noOfChildren/w,B=Y*g/L,P=Y*E/L,o.repulsionForceX-=B,o.repulsionForceY-=P,r.repulsionForceX+=B,r.repulsionForceY+=P},i.prototype.calcGravitationalForce=function(o){var r,d,u,l,N,g,E,w;r=o.getOwner(),d=(r.getRight()+r.getLeft())/2,u=(r.getTop()+r.getBottom())/2,l=o.getCenterX()-d,N=o.getCenterY()-u,g=Math.abs(l)+o.getWidth()/2,E=Math.abs(N)+o.getHeight()/2,o.getOwner()==this.graphManager.getRoot()?(w=r.getEstimatedSize()*this.gravityRangeFactor,(g>w||E>w)&&(o.gravitationForceX=-this.gravityConstant*l,o.gravitationForceY=-this.gravityConstant*N)):(w=r.getEstimatedSize()*this.compoundGravityRangeFactor,(g>w||E>w)&&(o.gravitationForceX=-this.gravityConstant*l*this.compoundGravityConstant,o.gravitationForceY=-this.gravityConstant*N*this.compoundGravityConstant))},i.prototype.isConverged=function(){var o,r=!1;return this.totalIterations>this.maxIterations/3&&(r=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),o=this.totalDisplacement<this.totalDisplacementThreshold,this.oldTotalDisplacement=this.totalDisplacement,o||r},i.prototype.animate=function(){this.animationDuringLayout&&!this.isSubLayout&&(this.notAnimatedIterations==this.animationPeriod?(this.update(),this.notAnimatedIterations=0):this.notAnimatedIterations++)},i.prototype.calcNoOfChildrenForAllNodes=function(){for(var o,r=this.graphManager.getAllNodes(),d=0;d<r.length;d++)o=r[d],o.noOfChildren=o.getNoOfChildren()},i.prototype.calcGrid=function(o){var r=0,d=0;r=parseInt(Math.ceil((o.getRight()-o.getLeft())/this.repulsionRange)),d=parseInt(Math.ceil((o.getBottom()-o.getTop())/this.repulsionRange));for(var u=new Array(r),l=0;l<r;l++)u[l]=new Array(d);for(var l=0;l<r;l++)for(var N=0;N<d;N++)u[l][N]=new Array;return u},i.prototype.addNodeToGrid=function(o,r,d){var u=0,l=0,N=0,g=0;u=parseInt(Math.floor((o.getRect().x-r)/this.repulsionRange)),l=parseInt(Math.floor((o.getRect().width+o.getRect().x-r)/this.repulsionRange)),N=parseInt(Math.floor((o.getRect().y-d)/this.repulsionRange)),g=parseInt(Math.floor((o.getRect().height+o.getRect().y-d)/this.repulsionRange));for(var E=u;E<=l;E++)for(var w=N;w<=g;w++)this.grid[E][w].push(o),o.setGridCoordinates(u,l,N,g)},i.prototype.updateGrid=function(){var o,r,d=this.getAllNodes();for(this.grid=this.calcGrid(this.graphManager.getRoot()),o=0;o<d.length;o++)r=d[o],this.addNodeToGrid(r,this.graphManager.getRoot().getLeft(),this.graphManager.getRoot().getTop())},i.prototype.calculateRepulsionForceOfANode=function(o,r,d,u){if(this.totalIterations%n.GRID_CALCULATION_CHECK_PERIOD==1&&d||u){var l=new Set;o.surrounding=new Array;for(var N,g=this.grid,E=o.startX-1;E<o.finishX+2;E++)for(var w=o.startY-1;w<o.finishY+2;w++)if(!(E<0||w<0||E>=g.length||w>=g[0].length)){for(var L=0;L<g[E][w].length;L++)if(N=g[E][w][L],!(o.getOwner()!=N.getOwner()||o==N)&&!r.has(N)&&!l.has(N)){var Y=Math.abs(o.getCenterX()-N.getCenterX())-(o.getWidth()/2+N.getWidth()/2),B=Math.abs(o.getCenterY()-N.getCenterY())-(o.getHeight()/2+N.getHeight()/2);Y<=this.repulsionRange&&B<=this.repulsionRange&&l.add(N)}}o.surrounding=[].concat(c(l))}for(E=0;E<o.surrounding.length;E++)this.calcRepulsionForce(o,o.surrounding[E])},i.prototype.calcRepulsionRange=function(){return 0},_.exports=i},function(_,b,T){var c=T(1),h=T(4);function n(t,s,i){c.call(this,t,s,i),this.idealLength=h.DEFAULT_EDGE_LENGTH,this.edgeElasticity=h.DEFAULT_SPRING_STRENGTH}A(n,"FDLayoutEdge"),n.prototype=Object.create(c.prototype);for(var e in c)n[e]=c[e];_.exports=n},function(_,b,T){var c=T(3),h=T(4);function n(t,s,i,f){c.call(this,t,s,i,f),this.nodeRepulsion=h.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=[]}A(n,"FDLayoutNode"),n.prototype=Object.create(c.prototype);for(var e in c)n[e]=c[e];n.prototype.setGridCoordinates=function(t,s,i,f){this.startX=t,this.finishX=s,this.startY=i,this.finishY=f},_.exports=n},function(_,b,T){function c(h,n){this.width=0,this.height=0,h!==null&&n!==null&&(this.height=n,this.width=h)}A(c,"DimensionD"),c.prototype.getWidth=function(){return this.width},c.prototype.setWidth=function(h){this.width=h},c.prototype.getHeight=function(){return this.height},c.prototype.setHeight=function(h){this.height=h},_.exports=c},function(_,b,T){var c=T(14);function h(){this.map={},this.keys=[]}A(h,"HashMap"),h.prototype.put=function(n,e){var t=c.createID(n);this.contains(t)||(this.map[t]=e,this.keys.push(n))},h.prototype.contains=function(n){return c.createID(n),this.map[n]!=null},h.prototype.get=function(n){var e=c.createID(n);return this.map[e]},h.prototype.keySet=function(){return this.keys},_.exports=h},function(_,b,T){var c=T(14);function h(){this.set={}}A(h,"HashSet"),h.prototype.add=function(n){var e=c.createID(n);this.contains(e)||(this.set[e]=n)},h.prototype.remove=function(n){delete this.set[c.createID(n)]},h.prototype.clear=function(){this.set={}},h.prototype.contains=function(n){return this.set[c.createID(n)]==n},h.prototype.isEmpty=function(){return this.size()===0},h.prototype.size=function(){return Object.keys(this.set).length},h.prototype.addAllTo=function(n){for(var e=Object.keys(this.set),t=e.length,s=0;s<t;s++)n.push(this.set[e[s]])},h.prototype.size=function(){return Object.keys(this.set).length},h.prototype.addAll=function(n){for(var e=n.length,t=0;t<e;t++){var s=n[t];this.add(s)}},_.exports=h},function(_,b,T){function c(){}A(c,"Matrix"),c.multMat=function(h,n){for(var e=[],t=0;t<h.length;t++){e[t]=[];for(var s=0;s<n[0].length;s++){e[t][s]=0;for(var i=0;i<h[0].length;i++)e[t][s]+=h[t][i]*n[i][s]}}return e},c.transpose=function(h){for(var n=[],e=0;e<h[0].length;e++){n[e]=[];for(var t=0;t<h.length;t++)n[e][t]=h[t][e]}return n},c.multCons=function(h,n){for(var e=[],t=0;t<h.length;t++)e[t]=h[t]*n;return e},c.minusOp=function(h,n){for(var e=[],t=0;t<h.length;t++)e[t]=h[t]-n[t];return e},c.dotProduct=function(h,n){for(var e=0,t=0;t<h.length;t++)e+=h[t]*n[t];return e},c.mag=function(h){return Math.sqrt(this.dotProduct(h,h))},c.normalize=function(h){for(var n=[],e=this.mag(h),t=0;t<h.length;t++)n[t]=h[t]/e;return n},c.multGamma=function(h){for(var n=[],e=0,t=0;t<h.length;t++)e+=h[t];e*=-1/h.length;for(var s=0;s<h.length;s++)n[s]=e+h[s];return n},c.multL=function(h,n,e){for(var t=[],s=[],i=[],f=0;f<n[0].length;f++){for(var o=0,r=0;r<n.length;r++)o+=-.5*n[r][f]*h[r];s[f]=o}for(var d=0;d<e.length;d++){for(var u=0,l=0;l<e.length;l++)u+=e[d][l]*s[l];i[d]=u}for(var N=0;N<n.length;N++){for(var g=0,E=0;E<n[0].length;E++)g+=n[N][E]*i[E];t[N]=g}return t},_.exports=c},function(_,b,T){var c=function(){function t(s,i){for(var f=0;f<i.length;f++){var o=i[f];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(s,o.key,o)}}return A(t,"defineProperties"),function(s,i,f){return i&&t(s.prototype,i),f&&t(s,f),s}}();function h(t,s){if(!(t instanceof s))throw new TypeError("Cannot call a class as a function")}A(h,"_classCallCheck");var n=T(11),e=function(){function t(s,i){h(this,t),(i!==null||i!==void 0)&&(this.compareFunction=this._defaultCompareFunction);var f=void 0;s instanceof n?f=s.size():f=s.length,this._quicksort(s,0,f-1)}return A(t,"Quicksort"),c(t,[{key:"_quicksort",value:A(function(s,i,f){if(i<f){var o=this._partition(s,i,f);this._quicksort(s,i,o),this._quicksort(s,o+1,f)}},"_quicksort")},{key:"_partition",value:A(function(s,i,f){for(var o=this._get(s,i),r=i,d=f;;){for(;this.compareFunction(o,this._get(s,d));)d--;for(;this.compareFunction(this._get(s,r),o);)r++;if(r<d)this._swap(s,r,d),r++,d--;else return d}},"_partition")},{key:"_get",value:A(function(s,i){return s instanceof n?s.get_object_at(i):s[i]},"_get")},{key:"_set",value:A(function(s,i,f){s instanceof n?s.set_object_at(i,f):s[i]=f},"_set")},{key:"_swap",value:A(function(s,i,f){var o=this._get(s,i);this._set(s,i,this._get(s,f)),this._set(s,f,o)},"_swap")},{key:"_defaultCompareFunction",value:A(function(s,i){return i>s},"_defaultCompareFunction")}]),t}();_.exports=e},function(_,b,T){function c(){}A(c,"SVD"),c.svd=function(h){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=h.length,this.n=h[0].length;var n=Math.min(this.m,this.n);this.s=function(Tt){for(var At=[];Tt-- >0;)At.push(0);return At}(Math.min(this.m+1,this.n)),this.U=function(Tt){var At=A(function St(Gt){if(Gt.length==0)return 0;for(var zt=[],jt=0;jt<Gt[0];jt++)zt.push(St(Gt.slice(1)));return zt},"allocate");return At(Tt)}([this.m,n]),this.V=function(Tt){var At=A(function St(Gt){if(Gt.length==0)return 0;for(var zt=[],jt=0;jt<Gt[0];jt++)zt.push(St(Gt.slice(1)));return zt},"allocate");return At(Tt)}([this.n,this.n]);for(var e=function(Tt){for(var At=[];Tt-- >0;)At.push(0);return At}(this.n),t=function(Tt){for(var At=[];Tt-- >0;)At.push(0);return At}(this.m),s=!0,i=!0,f=Math.min(this.m-1,this.n),o=Math.max(0,Math.min(this.n-2,this.m)),r=0;r<Math.max(f,o);r++){if(r<f){this.s[r]=0;for(var d=r;d<this.m;d++)this.s[r]=c.hypot(this.s[r],h[d][r]);if(this.s[r]!==0){h[r][r]<0&&(this.s[r]=-this.s[r]);for(var u=r;u<this.m;u++)h[u][r]/=this.s[r];h[r][r]+=1}this.s[r]=-this.s[r]}for(var l=r+1;l<this.n;l++){if(function(Tt,At){return Tt&&At}(r<f,this.s[r]!==0)){for(var N=0,g=r;g<this.m;g++)N+=h[g][r]*h[g][l];N=-N/h[r][r];for(var E=r;E<this.m;E++)h[E][l]+=N*h[E][r]}e[l]=h[r][l]}if(function(Tt,At){return Tt&&At}(s,r<f))for(var w=r;w<this.m;w++)this.U[w][r]=h[w][r];if(r<o){e[r]=0;for(var L=r+1;L<this.n;L++)e[r]=c.hypot(e[r],e[L]);if(e[r]!==0){e[r+1]<0&&(e[r]=-e[r]);for(var Y=r+1;Y<this.n;Y++)e[Y]/=e[r];e[r+1]+=1}if(e[r]=-e[r],function(Tt,At){return Tt&&At}(r+1<this.m,e[r]!==0)){for(var B=r+1;B<this.m;B++)t[B]=0;for(var P=r+1;P<this.n;P++)for(var X=r+1;X<this.m;X++)t[X]+=e[P]*h[X][P];for(var q=r+1;q<this.n;q++)for(var O=-e[q]/e[r+1],it=r+1;it<this.m;it++)h[it][q]+=O*t[it]}if(i)for(var a=r+1;a<this.n;a++)this.V[a][r]=e[a]}}var v=Math.min(this.n,this.m+1);if(f<this.n&&(this.s[f]=h[f][f]),this.m<v&&(this.s[v-1]=0),o+1<v&&(e[o]=h[o][v-1]),e[v-1]=0,s){for(var m=f;m<n;m++){for(var y=0;y<this.m;y++)this.U[y][m]=0;this.U[m][m]=1}for(var p=f-1;p>=0;p--)if(this.s[p]!==0){for(var D=p+1;D<n;D++){for(var x=0,R=p;R<this.m;R++)x+=this.U[R][p]*this.U[R][D];x=-x/this.U[p][p];for(var H=p;H<this.m;H++)this.U[H][D]+=x*this.U[H][p]}for(var z=p;z<this.m;z++)this.U[z][p]=-this.U[z][p];this.U[p][p]=1+this.U[p][p];for(var W=0;W<p-1;W++)this.U[W][p]=0}else{for(var j=0;j<this.m;j++)this.U[j][p]=0;this.U[p][p]=1}}if(i)for(var V=this.n-1;V>=0;V--){if(function(Tt,At){return Tt&&At}(V<o,e[V]!==0))for(var J=V+1;J<n;J++){for(var U=0,S=V+1;S<this.n;S++)U+=this.V[S][V]*this.V[S][J];U=-U/this.V[V+1][V];for(var F=V+1;F<this.n;F++)this.V[F][J]+=U*this.V[F][V]}for(var Z=0;Z<this.n;Z++)this.V[Z][V]=0;this.V[V][V]=1}for(var rt=v-1,ut=0,_t=Math.pow(2,-52),Mt=Math.pow(2,-966);v>0;){var k=void 0,nt=void 0;for(k=v-2;k>=-1&&k!==-1;k--)if(Math.abs(e[k])<=Mt+_t*(Math.abs(this.s[k])+Math.abs(this.s[k+1]))){e[k]=0;break}if(k===v-2)nt=4;else{var ht=void 0;for(ht=v-1;ht>=k&&ht!==k;ht--){var mt=(ht!==v?Math.abs(e[ht]):0)+(ht!==k+1?Math.abs(e[ht-1]):0);if(Math.abs(this.s[ht])<=Mt+_t*mt){this.s[ht]=0;break}}ht===k?nt=3:ht===v-1?nt=1:(nt=2,k=ht)}switch(k++,nt){case 1:{var Ct=e[v-2];e[v-2]=0;for(var vt=v-2;vt>=k;vt--){var yt=c.hypot(this.s[vt],Ct),xt=this.s[vt]/yt,Ht=Ct/yt;if(this.s[vt]=yt,vt!==k&&(Ct=-Ht*e[vt-1],e[vt-1]=xt*e[vt-1]),i)for(var Ft=0;Ft<this.n;Ft++)yt=xt*this.V[Ft][vt]+Ht*this.V[Ft][v-1],this.V[Ft][v-1]=-Ht*this.V[Ft][vt]+xt*this.V[Ft][v-1],this.V[Ft][vt]=yt}}break;case 2:{var Pt=e[k-1];e[k-1]=0;for(var Ot=k;Ot<v;Ot++){var Yt=c.hypot(this.s[Ot],Pt),Ut=this.s[Ot]/Yt,Wt=Pt/Yt;if(this.s[Ot]=Yt,Pt=-Wt*e[Ot],e[Ot]=Ut*e[Ot],s)for(var lt=0;lt<this.m;lt++)Yt=Ut*this.U[lt][Ot]+Wt*this.U[lt][k-1],this.U[lt][k-1]=-Wt*this.U[lt][Ot]+Ut*this.U[lt][k-1],this.U[lt][Ot]=Yt}}break;case 3:{var C=Math.max(Math.max(Math.max(Math.max(Math.abs(this.s[v-1]),Math.abs(this.s[v-2])),Math.abs(e[v-2])),Math.abs(this.s[k])),Math.abs(e[k])),G=this.s[v-1]/C,$=this.s[v-2]/C,K=e[v-2]/C,Q=this.s[k]/C,pt=e[k]/C,dt=(($+G)*($-G)+K*K)/2,tt=G*K*(G*K),ct=0;(function(Tt,At){return Tt||At})(dt!==0,tt!==0)&&(ct=Math.sqrt(dt*dt+tt),dt<0&&(ct=-ct),ct=tt/(dt+ct));for(var Et=(Q+G)*(Q-G)+ct,wt=Q*pt,et=k;et<v-1;et++){var It=c.hypot(Et,wt),ot=Et/It,st=wt/It;if(et!==k&&(e[et-1]=It),Et=ot*this.s[et]+st*e[et],e[et]=ot*e[et]-st*this.s[et],wt=st*this.s[et+1],this.s[et+1]=ot*this.s[et+1],i)for(var at=0;at<this.n;at++)It=ot*this.V[at][et]+st*this.V[at][et+1],this.V[at][et+1]=-st*this.V[at][et]+ot*this.V[at][et+1],this.V[at][et]=It;if(It=c.hypot(Et,wt),ot=Et/It,st=wt/It,this.s[et]=It,Et=ot*e[et]+st*this.s[et+1],this.s[et+1]=-st*e[et]+ot*this.s[et+1],wt=st*e[et+1],e[et+1]=ot*e[et+1],s&&et<this.m-1)for(var Nt=0;Nt<this.m;Nt++)It=ot*this.U[Nt][et]+st*this.U[Nt][et+1],this.U[Nt][et+1]=-st*this.U[Nt][et]+ot*this.U[Nt][et+1],this.U[Nt][et]=It}e[v-2]=Et,ut=ut+1}break;case 4:{if(this.s[k]<=0&&(this.s[k]=this.s[k]<0?-this.s[k]:0,i))for(var ft=0;ft<=rt;ft++)this.V[ft][k]=-this.V[ft][k];for(;k<rt&&!(this.s[k]>=this.s[k+1]);){var bt=this.s[k];if(this.s[k]=this.s[k+1],this.s[k+1]=bt,i&&k<this.n-1)for(var Dt=0;Dt<this.n;Dt++)bt=this.V[Dt][k+1],this.V[Dt][k+1]=this.V[Dt][k],this.V[Dt][k]=bt;if(s&&k<this.m-1)for(var Rt=0;Rt<this.m;Rt++)bt=this.U[Rt][k+1],this.U[Rt][k+1]=this.U[Rt][k],this.U[Rt][k]=bt;k++}ut=0,v--}break}}var Xt={U:this.U,V:this.V,S:this.s};return Xt},c.hypot=function(h,n){var e=void 0;return Math.abs(h)>Math.abs(n)?(e=n/h,e=Math.abs(h)*Math.sqrt(1+e*e)):n!=0?(e=h/n,e=Math.abs(n)*Math.sqrt(1+e*e)):e=0,e},_.exports=c},function(_,b,T){var c=function(){function e(t,s){for(var i=0;i<s.length;i++){var f=s[i];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(t,f.key,f)}}return A(e,"defineProperties"),function(t,s,i){return s&&e(t.prototype,s),i&&e(t,i),t}}();function h(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}A(h,"_classCallCheck");var n=function(){function e(t,s){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,f=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;h(this,e),this.sequence1=t,this.sequence2=s,this.match_score=i,this.mismatch_penalty=f,this.gap_penalty=o,this.iMax=t.length+1,this.jMax=s.length+1,this.grid=new Array(this.iMax);for(var r=0;r<this.iMax;r++){this.grid[r]=new Array(this.jMax);for(var d=0;d<this.jMax;d++)this.grid[r][d]=0}this.tracebackGrid=new Array(this.iMax);for(var u=0;u<this.iMax;u++){this.tracebackGrid[u]=new Array(this.jMax);for(var l=0;l<this.jMax;l++)this.tracebackGrid[u][l]=[null,null,null]}this.alignments=[],this.score=-1,this.computeGrids()}return A(e,"NeedlemanWunsch"),c(e,[{key:"getScore",value:A(function(){return this.score},"getScore")},{key:"getAlignments",value:A(function(){return this.alignments},"getAlignments")},{key:"computeGrids",value:A(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 s=1;s<this.iMax;s++)this.grid[s][0]=this.grid[s-1][0]+this.gap_penalty,this.tracebackGrid[s][0]=[!1,!0,!1];for(var i=1;i<this.iMax;i++)for(var f=1;f<this.jMax;f++){var o=void 0;this.sequence1[i-1]===this.sequence2[f-1]?o=this.grid[i-1][f-1]+this.match_score:o=this.grid[i-1][f-1]+this.mismatch_penalty;var r=this.grid[i-1][f]+this.gap_penalty,d=this.grid[i][f-1]+this.gap_penalty,u=[o,r,d],l=this.arrayAllMaxIndexes(u);this.grid[i][f]=u[l[0]],this.tracebackGrid[i][f]=[l.includes(0),l.includes(1),l.includes(2)]}this.score=this.grid[this.iMax-1][this.jMax-1]},"computeGrids")},{key:"alignmentTraceback",value:A(function(){var t=[];for(t.push({pos:[this.sequence1.length,this.sequence2.length],seq1:"",seq2:""});t[0];){var s=t[0],i=this.tracebackGrid[s.pos[0]][s.pos[1]];i[0]&&t.push({pos:[s.pos[0]-1,s.pos[1]-1],seq1:this.sequence1[s.pos[0]-1]+s.seq1,seq2:this.sequence2[s.pos[1]-1]+s.seq2}),i[1]&&t.push({pos:[s.pos[0]-1,s.pos[1]],seq1:this.sequence1[s.pos[0]-1]+s.seq1,seq2:"-"+s.seq2}),i[2]&&t.push({pos:[s.pos[0],s.pos[1]-1],seq1:"-"+s.seq1,seq2:this.sequence2[s.pos[1]-1]+s.seq2}),s.pos[0]===0&&s.pos[1]===0&&this.alignments.push({sequence1:s.seq1,sequence2:s.seq2}),t.shift()}return this.alignments},"alignmentTraceback")},{key:"getAllIndexes",value:A(function(t,s){for(var i=[],f=-1;(f=t.indexOf(s,f+1))!==-1;)i.push(f);return i},"getAllIndexes")},{key:"arrayAllMaxIndexes",value:A(function(t){return this.getAllIndexes(t,Math.max.apply(null,t))},"arrayAllMaxIndexes")}]),e}();_.exports=n},function(_,b,T){var c=A(function(){},"layoutBase");c.FDLayout=T(18),c.FDLayoutConstants=T(4),c.FDLayoutEdge=T(19),c.FDLayoutNode=T(20),c.DimensionD=T(21),c.HashMap=T(22),c.HashSet=T(23),c.IGeometry=T(8),c.IMath=T(9),c.Integer=T(10),c.Point=T(12),c.PointD=T(5),c.RandomSeed=T(16),c.RectangleD=T(13),c.Transform=T(17),c.UniqueIDGeneretor=T(14),c.Quicksort=T(25),c.LinkedList=T(11),c.LGraphObject=T(2),c.LGraph=T(6),c.LEdge=T(1),c.LGraphManager=T(7),c.LNode=T(3),c.Layout=T(15),c.LayoutConstants=T(0),c.NeedlemanWunsch=T(27),c.Matrix=T(24),c.SVD=T(26),_.exports=c},function(_,b,T){function c(){this.listeners=[]}A(c,"Emitter");var h=c.prototype;h.addListener=function(n,e){this.listeners.push({event:n,callback:e})},h.removeListener=function(n,e){for(var t=this.listeners.length;t>=0;t--){var s=this.listeners[t];s.event===n&&s.callback===e&&this.listeners.splice(t,1)}},h.emit=function(n,e){for(var t=0;t<this.listeners.length;t++){var s=this.listeners[t];n===s.event&&s.callback(e)}},_.exports=c}])})}),Le=pe((M,I)=>{A(function(_,b){typeof M=="object"&&typeof I=="object"?I.exports=b(we()):typeof define=="function"&&define.amd?define(["layout-base"],b):typeof M=="object"?M.coseBase=b(we()):_.coseBase=b(_.layoutBase)},"webpackUniversalModuleDefinition")(M,function(_){return(()=>{var b={45:(n,e,t)=>{var s={};s.layoutBase=t(551),s.CoSEConstants=t(806),s.CoSEEdge=t(767),s.CoSEGraph=t(880),s.CoSEGraphManager=t(578),s.CoSELayout=t(765),s.CoSENode=t(991),s.ConstraintHandler=t(902),n.exports=s},806:(n,e,t)=>{var s=t(551).FDLayoutConstants;function i(){}A(i,"CoSEConstants");for(var f in s)i[f]=s[f];i.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,i.DEFAULT_RADIAL_SEPARATION=s.DEFAULT_EDGE_LENGTH,i.DEFAULT_COMPONENT_SEPERATION=60,i.TILE=!0,i.TILING_PADDING_VERTICAL=10,i.TILING_PADDING_HORIZONTAL=10,i.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,i.ENFORCE_CONSTRAINTS=!0,i.APPLY_LAYOUT=!0,i.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,i.TREE_REDUCTION_ON_INCREMENTAL=!0,i.PURE_INCREMENTAL=i.DEFAULT_INCREMENTAL,n.exports=i},767:(n,e,t)=>{var s=t(551).FDLayoutEdge;function i(o,r,d){s.call(this,o,r,d)}A(i,"CoSEEdge"),i.prototype=Object.create(s.prototype);for(var f in s)i[f]=s[f];n.exports=i},880:(n,e,t)=>{var s=t(551).LGraph;function i(o,r,d){s.call(this,o,r,d)}A(i,"CoSEGraph"),i.prototype=Object.create(s.prototype);for(var f in s)i[f]=s[f];n.exports=i},578:(n,e,t)=>{var s=t(551).LGraphManager;function i(o){s.call(this,o)}A(i,"CoSEGraphManager"),i.prototype=Object.create(s.prototype);for(var f in s)i[f]=s[f];n.exports=i},765:(n,e,t)=>{var s=t(551).FDLayout,i=t(578),f=t(880),o=t(991),r=t(767),d=t(806),u=t(902),l=t(551).FDLayoutConstants,N=t(551).LayoutConstants,g=t(551).Point,E=t(551).PointD,w=t(551).DimensionD,L=t(551).Layout,Y=t(551).Integer,B=t(551).IGeometry,P=t(551).LGraph,X=t(551).Transform,q=t(551).LinkedList;function O(){s.call(this),this.toBeTiled={},this.constraints={}}A(O,"CoSELayout"),O.prototype=Object.create(s.prototype);for(var it in s)O[it]=s[it];O.prototype.newGraphManager=function(){var a=new i(this);return this.graphManager=a,a},O.prototype.newGraph=function(a){return new f(null,this.graphManager,a)},O.prototype.newNode=function(a){return new o(this.graphManager,a)},O.prototype.newEdge=function(a){return new r(null,null,a)},O.prototype.initParameters=function(){s.prototype.initParameters.call(this,arguments),this.isSubLayout||(d.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=d.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=d.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=l.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=l.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=l.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},O.prototype.initSpringEmbedder=function(){s.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/l.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},O.prototype.layout=function(){var a=N.DEFAULT_CREATE_BENDS_AS_NEEDED;return a&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},O.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),this.incremental){if(d.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var a=new Set(this.getAllNodes()),v=this.nodesWithGravity.filter(function(y){return a.has(y)});this.graphManager.setAllNodesToApplyGravitation(v)}}else{var m=this.getFlatForest();if(m.length>0)this.positionNodesRadially(m);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var a=new Set(this.getAllNodes()),v=this.nodesWithGravity.filter(function(D){return a.has(D)});this.graphManager.setAllNodesToApplyGravitation(v),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(u.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),d.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},O.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%l.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var a=new Set(this.getAllNodes()),v=this.nodesWithGravity.filter(function(p){return a.has(p)});this.graphManager.setAllNodesToApplyGravitation(v),this.graphManager.updateBounds(),this.updateGrid(),d.PURE_INCREMENTAL?this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),d.PURE_INCREMENTAL?this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var m=!this.isTreeGrowing&&!this.isGrowthFinished,y=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(m,y),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},O.prototype.getPositionsData=function(){for(var a=this.graphManager.getAllNodes(),v={},m=0;m<a.length;m++){var y=a[m].rect,p=a[m].id;v[p]={id:p,x:y.getCenterX(),y:y.getCenterY(),w:y.width,h:y.height}}return v},O.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var a=!1;if(l.ANIMATE==="during")this.emit("layoutstarted");else{for(;!a;)a=this.tick();this.graphManager.updateBounds()}},O.prototype.moveNodes=function(){for(var a=this.getAllNodes(),v,m=0;m<a.length;m++)v=a[m],v.calculateDisplacement();Object.keys(this.constraints).length>0&&this.updateDisplacements();for(var m=0;m<a.length;m++)v=a[m],v.move()},O.prototype.initConstraintVariables=function(){var a=this;this.idToNodeMap=new Map,this.fixedNodeSet=new Set;for(var v=this.graphManager.getAllNodes(),m=0;m<v.length;m++){var y=v[m];this.idToNodeMap.set(y.id,y)}var p=A(function S(F){for(var Z=F.getChild().getNodes(),rt,ut=0,_t=0;_t<Z.length;_t++)rt=Z[_t],rt.getChild()==null?a.fixedNodeSet.has(rt.id)&&(ut+=100):ut+=S(rt);return ut},"calculateCompoundWeight");if(this.constraints.fixedNodeConstraint){this.constraints.fixedNodeConstraint.forEach(function(S){a.fixedNodeSet.add(S.nodeId)});for(var v=this.graphManager.getAllNodes(),y,m=0;m<v.length;m++)if(y=v[m],y.getChild()!=null){var D=p(y);D>0&&(y.fixedNodeWeight=D)}}if(this.constraints.relativePlacementConstraint){var x=new Map,R=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(S){a.fixedNodesOnHorizontal.add(S),a.fixedNodesOnVertical.add(S)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var H=this.constraints.alignmentConstraint.vertical,m=0;m<H.length;m++)this.dummyToNodeForVerticalAlignment.set("dummy"+m,[]),H[m].forEach(function(F){x.set(F,"dummy"+m),a.dummyToNodeForVerticalAlignment.get("dummy"+m).push(F),a.fixedNodeSet.has(F)&&a.fixedNodesOnHorizontal.add("dummy"+m)});if(this.constraints.alignmentConstraint.horizontal)for(var z=this.constraints.alignmentConstraint.horizontal,m=0;m<z.length;m++)this.dummyToNodeForHorizontalAlignment.set("dummy"+m,[]),z[m].forEach(function(F){R.set(F,"dummy"+m),a.dummyToNodeForHorizontalAlignment.get("dummy"+m).push(F),a.fixedNodeSet.has(F)&&a.fixedNodesOnVertical.add("dummy"+m)})}if(d.RELAX_MOVEMENT_ON_CONSTRAINTS)this.shuffle=function(S){var F,Z,rt;for(rt=S.length-1;rt>=2*S.length/3;rt--)F=Math.floor(Math.random()*(rt+1)),Z=S[rt],S[rt]=S[F],S[F]=Z;return S},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(S){if(S.left){var F=x.has(S.left)?x.get(S.left):S.left,Z=x.has(S.right)?x.get(S.right):S.right;a.nodesInRelativeHorizontal.includes(F)||(a.nodesInRelativeHorizontal.push(F),a.nodeToRelativeConstraintMapHorizontal.set(F,[]),a.dummyToNodeForVerticalAlignment.has(F)?a.nodeToTempPositionMapHorizontal.set(F,a.idToNodeMap.get(a.dummyToNodeForVerticalAlignment.get(F)[0]).getCenterX()):a.nodeToTempPositionMapHorizontal.set(F,a.idToNodeMap.get(F).getCenterX())),a.nodesInRelativeHorizontal.includes(Z)||(a.nodesInRelativeHorizontal.push(Z),a.nodeToRelativeConstraintMapHorizontal.set(Z,[]),a.dummyToNodeForVerticalAlignment.has(Z)?a.nodeToTempPositionMapHorizontal.set(Z,a.idToNodeMap.get(a.dummyToNodeForVerticalAlignment.get(Z)[0]).getCenterX()):a.nodeToTempPositionMapHorizontal.set(Z,a.idToNodeMap.get(Z).getCenterX())),a.nodeToRelativeConstraintMapHorizontal.get(F).push({right:Z,gap:S.gap}),a.nodeToRelativeConstraintMapHorizontal.get(Z).push({left:F,gap:S.gap})}else{var rt=R.has(S.top)?R.get(S.top):S.top,ut=R.has(S.bottom)?R.get(S.bottom):S.bottom;a.nodesInRelativeVertical.includes(rt)||(a.nodesInRelativeVertical.push(rt),a.nodeToRelativeConstraintMapVertical.set(rt,[]),a.dummyToNodeForHorizontalAlignment.has(rt)?a.nodeToTempPositionMapVertical.set(rt,a.idToNodeMap.get(a.dummyToNodeForHorizontalAlignment.get(rt)[0]).getCenterY()):a.nodeToTempPositionMapVertical.set(rt,a.idToNodeMap.get(rt).getCenterY())),a.nodesInRelativeVertical.includes(ut)||(a.nodesInRelativeVertical.push(ut),a.nodeToRelativeConstraintMapVertical.set(ut,[]),a.dummyToNodeForHorizontalAlignment.has(ut)?a.nodeToTempPositionMapVertical.set(ut,a.idToNodeMap.get(a.dummyToNodeForHorizontalAlignment.get(ut)[0]).getCenterY()):a.nodeToTempPositionMapVertical.set(ut,a.idToNodeMap.get(ut).getCenterY())),a.nodeToRelativeConstraintMapVertical.get(rt).push({bottom:ut,gap:S.gap}),a.nodeToRelativeConstraintMapVertical.get(ut).push({top:rt,gap:S.gap})}});else{var W=new Map,j=new Map;this.constraints.relativePlacementConstraint.forEach(function(S){if(S.left){var F=x.has(S.left)?x.get(S.left):S.left,Z=x.has(S.right)?x.get(S.right):S.right;W.has(F)?W.get(F).push(Z):W.set(F,[Z]),W.has(Z)?W.get(Z).push(F):W.set(Z,[F])}else{var rt=R.has(S.top)?R.get(S.top):S.top,ut=R.has(S.bottom)?R.get(S.bottom):S.bottom;j.has(rt)?j.get(rt).push(ut):j.set(rt,[ut]),j.has(ut)?j.get(ut).push(rt):j.set(ut,[rt])}});var V=A(function(S,F){var Z=[],rt=[],ut=new q,_t=new Set,Mt=0;return S.forEach(function(k,nt){if(!_t.has(nt)){Z[Mt]=[],rt[Mt]=!1;var ht=nt;for(ut.push(ht),_t.add(ht),Z[Mt].push(ht);ut.length!=0;){ht=ut.shift(),F.has(ht)&&(rt[Mt]=!0);var mt=S.get(ht);mt.forEach(function(Ct){_t.has(Ct)||(ut.push(Ct),_t.add(Ct),Z[Mt].push(Ct))})}Mt++}}),{components:Z,isFixed:rt}},"constructComponents"),J=V(W,a.fixedNodesOnHorizontal);this.componentsOnHorizontal=J.components,this.fixedComponentsOnHorizontal=J.isFixed;var U=V(j,a.fixedNodesOnVertical);this.componentsOnVertical=U.components,this.fixedComponentsOnVertical=U.isFixed}}},O.prototype.updateDisplacements=function(){var a=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function(U){var S=a.idToNodeMap.get(U.nodeId);S.displacementX=0,S.displacementY=0}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var v=this.constraints.alignmentConstraint.vertical,m=0;m<v.length;m++){for(var y=0,p=0;p<v[m].length;p++){if(this.fixedNodeSet.has(v[m][p])){y=0;break}y+=this.idToNodeMap.get(v[m][p]).displacementX}for(var D=y/v[m].length,p=0;p<v[m].length;p++)this.idToNodeMap.get(v[m][p]).displacementX=D}if(this.constraints.alignmentConstraint.horizontal)for(var x=this.constraints.alignmentConstraint.horizontal,m=0;m<x.length;m++){for(var R=0,p=0;p<x[m].length;p++){if(this.fixedNodeSet.has(x[m][p])){R=0;break}R+=this.idToNodeMap.get(x[m][p]).displacementY}for(var H=R/x[m].length,p=0;p<x[m].length;p++)this.idToNodeMap.get(x[m][p]).displacementY=H}}if(this.constraints.relativePlacementConstraint)if(d.RELAX_MOVEMENT_ON_CONSTRAINTS)this.totalIterations%10==0&&(this.shuffle(this.nodesInRelativeHorizontal),this.shuffle(this.nodesInRelativeVertical)),this.nodesInRelativeHorizontal.forEach(function(U){if(!a.fixedNodesOnHorizontal.has(U)){var S=0;a.dummyToNodeForVerticalAlignment.has(U)?S=a.idToNodeMap.get(a.dummyToNodeForVerticalAlignment.get(U)[0]).displacementX:S=a.idToNodeMap.get(U).displacementX,a.nodeToRelativeConstraintMapHorizontal.get(U).forEach(function(F){if(F.right){var Z=a.nodeToTempPositionMapHorizontal.get(F.right)-a.nodeToTempPositionMapHorizontal.get(U)-S;Z<F.gap&&(S-=F.gap-Z)}else{var Z=a.nodeToTempPositionMapHorizontal.get(U)-a.nodeToTempPositionMapHorizontal.get(F.left)+S;Z<F.gap&&(S+=F.gap-Z)}}),a.nodeToTempPositionMapHorizontal.set(U,a.nodeToTempPositionMapHorizontal.get(U)+S),a.dummyToNodeForVerticalAlignment.has(U)?a.dummyToNodeForVerticalAlignment.get(U).forEach(function(F){a.idToNodeMap.get(F).displacementX=S}):a.idToNodeMap.get(U).displacementX=S}}),this.nodesInRelativeVertical.forEach(function(U){if(!a.fixedNodesOnHorizontal.has(U)){var S=0;a.dummyToNodeForHorizontalAlignment.has(U)?S=a.idToNodeMap.get(a.dummyToNodeForHorizontalAlignment.get(U)[0]).displacementY:S=a.idToNodeMap.get(U).displacementY,a.nodeToRelativeConstraintMapVertical.get(U).forEach(function(F){if(F.bottom){var Z=a.nodeToTempPositionMapVertical.get(F.bottom)-a.nodeToTempPositionMapVertical.get(U)-S;Z<F.gap&&(S-=F.gap-Z)}else{var Z=a.nodeToTempPositionMapVertical.get(U)-a.nodeToTempPositionMapVertical.get(F.top)+S;Z<F.gap&&(S+=F.gap-Z)}}),a.nodeToTempPositionMapVertical.set(U,a.nodeToTempPositionMapVertical.get(U)+S),a.dummyToNodeForHorizontalAlignment.has(U)?a.dummyToNodeForHorizontalAlignment.get(U).forEach(function(F){a.idToNodeMap.get(F).displacementY=S}):a.idToNodeMap.get(U).displacementY=S}});else{for(var m=0;m<this.componentsOnHorizontal.length;m++){var z=this.componentsOnHorizontal[m];if(this.fixedComponentsOnHorizontal[m])for(var p=0;p<z.length;p++)this.dummyToNodeForVerticalAlignment.has(z[p])?this.dummyToNodeForVerticalAlignment.get(z[p]).forEach(function(F){a.idToNodeMap.get(F).displacementX=0}):this.idToNodeMap.get(z[p]).displacementX=0;else{for(var W=0,j=0,p=0;p<z.length;p++)if(this.dummyToNodeForVerticalAlignment.has(z[p])){var V=this.dummyToNodeForVerticalAlignment.get(z[p]);W+=V.length*this.idToNodeMap.get(V[0]).displacementX,j+=V.length}else W+=this.idToNodeMap.get(z[p]).displacementX,j++;for(var J=W/j,p=0;p<z.length;p++)this.dummyToNodeForVerticalAlignment.has(z[p])?this.dummyToNodeForVerticalAlignment.get(z[p]).forEach(function(F){a.idToNodeMap.get(F).displacementX=J}):this.idToNodeMap.get(z[p]).displacementX=J}}for(var m=0;m<this.componentsOnVertical.length;m++){var z=this.componentsOnVertical[m];if(this.fixedComponentsOnVertical[m])for(var p=0;p<z.length;p++)this.dummyToNodeForHorizontalAlignment.has(z[p])?this.dummyToNodeForHorizontalAlignment.get(z[p]).forEach(function(Z){a.idToNodeMap.get(Z).displacementY=0}):this.idToNodeMap.get(z[p]).displacementY=0;else{for(var W=0,j=0,p=0;p<z.length;p++)if(this.dummyToNodeForHorizontalAlignment.has(z[p])){var V=this.dummyToNodeForHorizontalAlignment.get(z[p]);W+=V.length*this.idToNodeMap.get(V[0]).displacementY,j+=V.length}else W+=this.idToNodeMap.get(z[p]).displacementY,j++;for(var J=W/j,p=0;p<z.length;p++)this.dummyToNodeForHorizontalAlignment.has(z[p])?this.dummyToNodeForHorizontalAlignment.get(z[p]).forEach(function(rt){a.idToNodeMap.get(rt).displacementY=J}):this.idToNodeMap.get(z[p]).displacementY=J}}}},O.prototype.calculateNodesToApplyGravitationTo=function(){var a=[],v,m=this.graphManager.getGraphs(),y=m.length,p;for(p=0;p<y;p++)v=m[p],v.updateConnected(),v.isConnected||(a=a.concat(v.getNodes()));return a},O.prototype.createBendpoints=function(){var a=[];a=a.concat(this.graphManager.getAllEdges());var v=new Set,m;for(m=0;m<a.length;m++){var y=a[m];if(!v.has(y)){var p=y.getSource(),D=y.getTarget();if(p==D)y.getBendpoints().push(new E),y.getBendpoints().push(new E),this.createDummyNodesForBendpoints(y),v.add(y);else{var x=[];if(x=x.concat(p.getEdgeListToNode(D)),x=x.concat(D.getEdgeListToNode(p)),!v.has(x[0])){if(x.length>1){var R;for(R=0;R<x.length;R++){var H=x[R];H.getBendpoints().push(new E),this.createDummyNodesForBendpoints(H)}}x.forEach(function(z){v.add(z)})}}}if(v.size==a.length)break}},O.prototype.positionNodesRadially=function(a){for(var v=new g(0,0),m=Math.ceil(Math.sqrt(a.length)),y=0,p=0,D=0,x=new E(0,0),R=0;R<a.length;R++){R%m==0&&(D=0,p=y,R!=0&&(p+=d.DEFAULT_COMPONENT_SEPERATION),y=0);var H=a[R],z=L.findCenterOfTree(H);v.x=D,v.y=p,x=O.radialLayout(H,z,v),x.y>y&&(y=Math.floor(x.y)),D=Math.floor(x.x+d.DEFAULT_COMPONENT_SEPERATION)}this.transform(new E(N.WORLD_CENTER_X-x.x/2,N.WORLD_CENTER_Y-x.y/2))},O.radialLayout=function(a,v,m){var y=Math.max(this.maxDiagonalInTree(a),d.DEFAULT_RADIAL_SEPARATION);O.branchRadialLayout(v,null,0,359,0,y);var p=P.calculateBounds(a),D=new X;D.setDeviceOrgX(p.getMinX()),D.setDeviceOrgY(p.getMinY()),D.setWorldOrgX(m.x),D.setWorldOrgY(m.y);for(var x=0;x<a.length;x++){var R=a[x];R.transform(D)}var H=new E(p.getMaxX(),p.getMaxY());return D.inverseTransformPoint(H)},O.branchRadialLayout=function(a,v,m,y,p,D){var x=(y-m+1)/2;x<0&&(x+=180);var R=(x+m)%360,H=R*B.TWO_PI/360,z=p*Math.cos(H),W=p*Math.sin(H);a.setCenter(z,W);var j=[];j=j.concat(a.getEdges());var V=j.length;v!=null&&V--;for(var J=0,U=j.length,S,F=a.getEdgesBetween(v);F.length>1;){var Z=F[0];F.splice(0,1);var rt=j.indexOf(Z);rt>=0&&j.splice(rt,1),U--,V--}v!=null?S=(j.indexOf(F[0])+1)%U:S=0;for(var ut=Math.abs(y-m)/V,_t=S;J!=V;_t=++_t%U){var Mt=j[_t].getOtherEnd(a);if(Mt!=v){var k=(m+J*ut)%360,nt=(k+ut)%360;O.branchRadialLayout(Mt,a,k,nt,p+D,D),J++}}},O.maxDiagonalInTree=function(a){for(var v=Y.MIN_VALUE,m=0;m<a.length;m++){var y=a[m],p=y.getDiagonal();p>v&&(v=p)}return v},O.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},O.prototype.groupZeroDegreeMembers=function(){var a=this,v={};this.memberGroups={},this.idToDummyNode={};for(var m=[],y=this.graphManager.getAllNodes(),p=0;p<y.length;p++){var D=y[p],x=D.getParent();this.getNodeDegreeWithChildren(D)===0&&(x.id==null||!this.getToBeTiled(x))&&m.push(D)}for(var p=0;p<m.length;p++){var D=m[p],R=D.getParent().id;typeof v[R]>"u"&&(v[R]=[]),v[R]=v[R].concat(D)}Object.keys(v).forEach(function(H){if(v[H].length>1){var z="DummyCompound_"+H;a.memberGroups[z]=v[H];var W=v[H][0].getParent(),j=new o(a.graphManager);j.id=z,j.paddingLeft=W.paddingLeft||0,j.paddingRight=W.paddingRight||0,j.paddingBottom=W.paddingBottom||0,j.paddingTop=W.paddingTop||0,a.idToDummyNode[z]=j;var V=a.getGraphManager().add(a.newGraph(),j),J=W.getChild();J.add(j);for(var U=0;U<v[H].length;U++){var S=v[H][U];J.remove(S),V.add(S)}}})},O.prototype.clearCompounds=function(){var a={},v={};this.performDFSOnCompounds();for(var m=0;m<this.compoundOrder.length;m++)v[this.compoundOrder[m].id]=this.compoundOrder[m],a[this.compoundOrder[m].id]=[].concat(this.compoundOrder[m].getChild().getNodes()),this.graphManager.remove(this.compoundOrder[m].getChild()),this.compoundOrder[m].child=null;this.graphManager.resetAllNodes(),this.tileCompoundMembers(a,v)},O.prototype.clearZeroDegreeMembers=function(){var a=this,v=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach(function(m){var y=a.idToDummyNode[m];if(v[m]=a.tileNodes(a.memberGroups[m],y.paddingLeft+y.paddingRight),y.rect.width=v[m].width,y.rect.height=v[m].height,y.setCenter(v[m].centerX,v[m].centerY),y.labelMarginLeft=0,y.labelMarginTop=0,d.NODE_DIMENSIONS_INCLUDE_LABELS){var p=y.rect.width,D=y.rect.height;y.labelWidth&&(y.labelPosHorizontal=="left"?(y.rect.x-=y.labelWidth,y.setWidth(p+y.labelWidth),y.labelMarginLeft=y.labelWidth):y.labelPosHorizontal=="center"&&y.labelWidth>p?(y.rect.x-=(y.labelWidth-p)/2,y.setWidth(y.labelWidth),y.labelMarginLeft=(y.labelWidth-p)/2):y.labelPosHorizontal=="right"&&y.setWidth(p+y.labelWidth)),y.labelHeight&&(y.labelPosVertical=="top"?(y.rect.y-=y.labelHeight,y.setHeight(D+y.labelHeight),y.labelMarginTop=y.labelHeight):y.labelPosVertical=="center"&&y.labelHeight>D?(y.rect.y-=(y.labelHeight-D)/2,y.setHeight(y.labelHeight),y.labelMarginTop=(y.labelHeight-D)/2):y.labelPosVertical=="bottom"&&y.setHeight(D+y.labelHeight))}})},O.prototype.repopulateCompounds=function(){for(var a=this.compoundOrder.length-1;a>=0;a--){var v=this.compoundOrder[a],m=v.id,y=v.paddingLeft,p=v.paddingTop,D=v.labelMarginLeft,x=v.labelMarginTop;this.adjustLocations(this.tiledMemberPack[m],v.rect.x,v.rect.y,y,p,D,x)}},O.prototype.repopulateZeroDegreeMembers=function(){var a=this,v=this.tiledZeroDegreePack;Object.keys(v).forEach(function(m){var y=a.idToDummyNode[m],p=y.paddingLeft,D=y.paddingTop,x=y.labelMarginLeft,R=y.labelMarginTop;a.adjustLocations(v[m],y.rect.x,y.rect.y,p,D,x,R)})},O.prototype.getToBeTiled=function(a){var v=a.id;if(this.toBeTiled[v]!=null)return this.toBeTiled[v];var m=a.getChild();if(m==null)return this.toBeTiled[v]=!1,!1;for(var y=m.getNodes(),p=0;p<y.length;p++){var D=y[p];if(this.getNodeDegree(D)>0)return this.toBeTiled[v]=!1,!1;if(D.getChild()==null){this.toBeTiled[D.id]=!1;continue}if(!this.getToBeTiled(D))return this.toBeTiled[v]=!1,!1}return this.toBeTiled[v]=!0,!0},O.prototype.getNodeDegree=function(a){for(var v=a.id,m=a.getEdges(),y=0,p=0;p<m.length;p++){var D=m[p];D.getSource().id!==D.getTarget().id&&(y=y+1)}return y},O.prototype.getNodeDegreeWithChildren=function(a){var v=this.getNodeDegree(a);if(a.getChild()==null)return v;for(var m=a.getChild().getNodes(),y=0;y<m.length;y++){var p=m[y];v+=this.getNodeDegreeWithChildren(p)}return v},O.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},O.prototype.fillCompexOrderByDFS=function(a){for(var v=0;v<a.length;v++){var m=a[v];m.getChild()!=null&&this.fillCompexOrderByDFS(m.getChild().getNodes()),this.getToBeTiled(m)&&this.compoundOrder.push(m)}},O.prototype.adjustLocations=function(a,v,m,y,p,D,x){v+=y+D,m+=p+x;for(var R=v,H=0;H<a.rows.length;H++){var z=a.rows[H];v=R;for(var W=0,j=0;j<z.length;j++){var V=z[j];V.rect.x=v,V.rect.y=m,v+=V.rect.width+a.horizontalPadding,V.rect.height>W&&(W=V.rect.height)}m+=W+a.verticalPadding}},O.prototype.tileCompoundMembers=function(a,v){var m=this;this.tiledMemberPack=[],Object.keys(a).forEach(function(y){var p=v[y];if(m.tiledMemberPack[y]=m.tileNodes(a[y],p.paddingLeft+p.paddingRight),p.rect.width=m.tiledMemberPack[y].width,p.rect.height=m.tiledMemberPack[y].height,p.setCenter(m.tiledMemberPack[y].centerX,m.tiledMemberPack[y].centerY),p.labelMarginLeft=0,p.labelMarginTop=0,d.NODE_DIMENSIONS_INCLUDE_LABELS){var D=p.rect.width,x=p.rect.height;p.labelWidth&&(p.labelPosHorizontal=="left"?(p.rect.x-=p.labelWidth,p.setWidth(D+p.labelWidth),p.labelMarginLeft=p.labelWidth):p.labelPosHorizontal=="center"&&p.labelWidth>D?(p.rect.x-=(p.labelWidth-D)/2,p.setWidth(p.labelWidth),p.labelMarginLeft=(p.labelWidth-D)/2):p.labelPosHorizontal=="right"&&p.setWidth(D+p.labelWidth)),p.labelHeight&&(p.labelPosVertical=="top"?(p.rect.y-=p.labelHeight,p.setHeight(x+p.labelHeight),p.labelMarginTop=p.labelHeight):p.labelPosVertical=="center"&&p.labelHeight>x?(p.rect.y-=(p.labelHeight-x)/2,p.setHeight(p.labelHeight),p.labelMarginTop=(p.labelHeight-x)/2):p.labelPosVertical=="bottom"&&p.setHeight(x+p.labelHeight))}})},O.prototype.tileNodes=function(a,v){var m=this.tileNodesByFavoringDim(a,v,!0),y=this.tileNodesByFavoringDim(a,v,!1),p=this.getOrgRatio(m),D=this.getOrgRatio(y),x;return D<p?x=y:x=m,x},O.prototype.getOrgRatio=function(a){var v=a.width,m=a.height,y=v/m;return y<1&&(y=1/y),y},O.prototype.calcIdealRowWidth=function(a,v){var m=d.TILING_PADDING_VERTICAL,y=d.TILING_PADDING_HORIZONTAL,p=a.length,D=0,x=0,R=0;a.forEach(function(U){D+=U.getWidth(),x+=U.getHeight(),U.getWidth()>R&&(R=U.getWidth())});var H=D/p,z=x/p,W=Math.pow(m-y,2)+4*(H+y)*(z+m)*p,j=(y-m+Math.sqrt(W))/(2*(H+y)),V;v?(V=Math.ceil(j),V==j&&V++):V=Math.floor(j);var J=V*(H+y)-y;return R>J&&(J=R),J+=y*2,J},O.prototype.tileNodesByFavoringDim=function(a,v,m){var y=d.TILING_PADDING_VERTICAL,p=d.TILING_PADDING_HORIZONTAL,D=d.TILING_COMPARE_BY,x={rows:[],rowWidth:[],rowHeight:[],width:0,height:v,verticalPadding:y,horizontalPadding:p,centerX:0,centerY:0};D&&(x.idealRowWidth=this.calcIdealRowWidth(a,m));var R=A(function(U){return U.rect.width*U.rect.height},"getNodeArea"),H=A(function(U,S){return R(S)-R(U)},"areaCompareFcn");a.sort(function(U,S){var F=H;return x.idealRowWidth?(F=D,F(U.id,S.id)):F(U,S)});for(var z=0,W=0,j=0;j<a.length;j++){var V=a[j];z+=V.getCenterX(),W+=V.getCenterY()}x.centerX=z/a.length,x.centerY=W/a.length;for(var j=0;j<a.length;j++){var V=a[j];if(x.rows.length==0)this.insertNodeToRow(x,V,0,v);else if(this.canAddHorizontal(x,V.rect.width,V.rect.height)){var J=x.rows.length-1;x.idealRowWidth||(J=this.getShortestRowIndex(x)),this.insertNodeToRow(x,V,J,v)}else this.insertNodeToRow(x,V,x.rows.length,v);this.shiftToLastRow(x)}return x},O.prototype.insertNodeToRow=function(a,v,m,y){var p=y;if(m==a.rows.length){var D=[];a.rows.push(D),a.rowWidth.push(p),a.rowHeight.push(0)}var x=a.rowWidth[m]+v.rect.width;a.rows[m].length>0&&(x+=a.horizontalPadding),a.rowWidth[m]=x,a.width<x&&(a.width=x);var R=v.rect.height;m>0&&(R+=a.verticalPadding);var H=0;R>a.rowHeight[m]&&(H=a.rowHeight[m],a.rowHeight[m]=R,H=a.rowHeight[m]-H),a.height+=H,a.rows[m].push(v)},O.prototype.getShortestRowIndex=function(a){for(var v=-1,m=Number.MAX_VALUE,y=0;y<a.rows.length;y++)a.rowWidth[y]<m&&(v=y,m=a.rowWidth[y]);return v},O.prototype.getLongestRowIndex=function(a){for(var v=-1,m=Number.MIN_VALUE,y=0;y<a.rows.length;y++)a.rowWidth[y]>m&&(v=y,m=a.rowWidth[y]);return v},O.prototype.canAddHorizontal=function(a,v,m){if(a.idealRowWidth){var y=a.rows.length-1,p=a.rowWidth[y];return p+v+a.horizontalPadding<=a.idealRowWidth}var D=this.getShortestRowIndex(a);if(D<0)return!0;var x=a.rowWidth[D];if(x+a.horizontalPadding+v<=a.width)return!0;var R=0;a.rowHeight[D]<m&&D>0&&(R=m+a.verticalPadding-a.rowHeight[D]);var H;a.width-x>=v+a.horizontalPadding?H=(a.height+R)/(x+v+a.horizontalPadding):H=(a.height+R)/a.width,R=m+a.verticalPadding;var z;return a.width<v?z=(a.height+R)/v:z=(a.height+R)/a.width,z<1&&(z=1/z),H<1&&(H=1/H),H<z},O.prototype.shiftToLastRow=function(a){var v=this.getLongestRowIndex(a),m=a.rowWidth.length-1,y=a.rows[v],p=y[y.length-1],D=p.width+a.horizontalPadding;if(a.width-a.rowWidth[m]>D&&v!=m){y.splice(-1,1),a.rows[m].push(p),a.rowWidth[v]=a.rowWidth[v]-D,a.rowWidth[m]=a.rowWidth[m]+D,a.width=a.rowWidth[instance.getLongestRowIndex(a)];for(var x=Number.MIN_VALUE,R=0;R<y.length;R++)y[R].height>x&&(x=y[R].height);v>0&&(x+=a.verticalPadding);var H=a.rowHeight[v]+a.rowHeight[m];a.rowHeight[v]=x,a.rowHeight[m]<p.height+a.verticalPadding&&(a.rowHeight[m]=p.height+a.verticalPadding);var z=a.rowHeight[v]+a.rowHeight[m];a.height+=z-H,this.shiftToLastRow(a)}},O.prototype.tilingPreLayout=function(){d.TILE&&(this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers())},O.prototype.tilingPostLayout=function(){d.TILE&&(this.repopulateZeroDegreeMembers(),this.repopulateCompounds())},O.prototype.reduceTrees=function(){for(var a=[],v=!0,m;v;){var y=this.graphManager.getAllNodes(),p=[];v=!1;for(var D=0;D<y.length;D++)if(m=y[D],m.getEdges().length==1&&!m.getEdges()[0].isInterGraph&&m.getChild()==null){if(d.PURE_INCREMENTAL){var x=m.getEdges()[0].getOtherEnd(m),R=new w(m.getCenterX()-x.getCenterX(),m.getCenterY()-x.getCenterY());p.push([m,m.getEdges()[0],m.getOwner(),R])}else p.push([m,m.getEdges()[0],m.getOwner()]);v=!0}if(v==!0){for(var H=[],z=0;z<p.length;z++)p[z][0].getEdges().length==1&&(H.push(p[z]),p[z][0].getOwner().remove(p[z][0]));a.push(H),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=a},O.prototype.growTree=function(a){for(var v=a.length,m=a[v-1],y,p=0;p<m.length;p++)y=m[p],this.findPlaceforPrunedNode(y),y[2].add(y[0]),y[2].add(y[1],y[1].source,y[1].target);a.splice(a.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},O.prototype.findPlaceforPrunedNode=function(a){var v,m,y=a[0];if(y==a[1].source?m=a[1].target:m=a[1].source,d.PURE_INCREMENTAL)y.setCenter(m.getCenterX()+a[3].getWidth(),m.getCenterY()+a[3].getHeight());else{var p=m.startX,D=m.finishX,x=m.startY,R=m.finishY,H=0,z=0,W=0,j=0,V=[H,W,z,j];if(x>0)for(var J=p;J<=D;J++)V[0]+=this.grid[J][x-1].length+this.grid[J][x].length-1;if(D<this.grid.length-1)for(var J=x;J<=R;J++)V[1]+=this.grid[D+1][J].length+this.grid[D][J].length-1;if(R<this.grid[0].length-1)for(var J=p;J<=D;J++)V[2]+=this.grid[J][R+1].length+this.grid[J][R].length-1;if(p>0)for(var J=x;J<=R;J++)V[3]+=this.grid[p-1][J].length+this.grid[p][J].length-1;for(var U=Y.MAX_VALUE,S,F,Z=0;Z<V.length;Z++)V[Z]<U?(U=V[Z],S=1,F=Z):V[Z]==U&&S++;if(S==3&&U==0)V[0]==0&&V[1]==0&&V[2]==0?v=1:V[0]==0&&V[1]==0&&V[3]==0?v=0:V[0]==0&&V[2]==0&&V[3]==0?v=3:V[1]==0&&V[2]==0&&V[3]==0&&(v=2);else if(S==2&&U==0){var rt=Math.floor(Math.random()*2);V[0]==0&&V[1]==0?rt==0?v=0:v=1:V[0]==0&&V[2]==0?rt==0?v=0:v=2:V[0]==0&&V[3]==0?rt==0?v=0:v=3:V[1]==0&&V[2]==0?rt==0?v=1:v=2:V[1]==0&&V[3]==0?rt==0?v=1:v=3:rt==0?v=2:v=3}else if(S==4&&U==0){var rt=Math.floor(Math.random()*4);v=rt}else v=F;v==0?y.setCenter(m.getCenterX(),m.getCenterY()-m.getHeight()/2-l.DEFAULT_EDGE_LENGTH-y.getHeight()/2):v==1?y.setCenter(m.getCenterX()+m.getWidth()/2+l.DEFAULT_EDGE_LENGTH+y.getWidth()/2,m.getCenterY()):v==2?y.setCenter(m.getCenterX(),m.getCenterY()+m.getHeight()/2+l.DEFAULT_EDGE_LENGTH+y.getHeight()/2):y.setCenter(m.getCenterX()-m.getWidth()/2-l.DEFAULT_EDGE_LENGTH-y.getWidth()/2,m.getCenterY())}},n.exports=O},991:(n,e,t)=>{var s=t(551).FDLayoutNode,i=t(551).IMath;function f(r,d,u,l){s.call(this,r,d,u,l)}A(f,"CoSENode"),f.prototype=Object.create(s.prototype);for(var o in s)f[o]=s[o];f.prototype.calculateDisplacement=function(){var r=this.graphManager.getLayout();this.getChild()!=null&&this.fixedNodeWeight?(this.displacementX+=r.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=r.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=r.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=r.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>r.coolingFactor*r.maxNodeDisplacement&&(this.displacementX=r.coolingFactor*r.maxNodeDisplacement*i.sign(this.displacementX)),Math.abs(this.displacementY)>r.coolingFactor*r.maxNodeDisplacement&&(this.displacementY=r.coolingFactor*r.maxNodeDisplacement*i.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},f.prototype.propogateDisplacementToChildren=function(r,d){for(var u=this.getChild().getNodes(),l,N=0;N<u.length;N++)l=u[N],l.getChild()==null?(l.displacementX+=r,l.displacementY+=d):l.propogateDisplacementToChildren(r,d)},f.prototype.move=function(){var r=this.graphManager.getLayout();(this.child==null||this.child.getNodes().length==0)&&(this.moveBy(this.displacementX,this.displacementY),r.totalDisplacement+=Math.abs(this.displacementX)+Math.abs(this.displacementY)),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0},f.prototype.setPred1=function(r){this.pred1=r},f.prototype.getPred1=function(){return pred1},f.prototype.getPred2=function(){return pred2},f.prototype.setNext=function(r){this.next=r},f.prototype.getNext=function(){return next},f.prototype.setProcessed=function(r){this.processed=r},f.prototype.isProcessed=function(){return processed},n.exports=f},902:(n,e,t)=>{function s(u){if(Array.isArray(u)){for(var l=0,N=Array(u.length);l<u.length;l++)N[l]=u[l];return N}else return Array.from(u)}A(s,"_toConsumableArray");var i=t(806),f=t(551).LinkedList,o=t(551).Matrix,r=t(551).SVD;function d(){}A(d,"ConstraintHandler"),d.handleConstraints=function(u){var l={};l.fixedNodeConstraint=u.constraints.fixedNodeConstraint,l.alignmentConstraint=u.constraints.alignmentConstraint,l.relativePlacementConstraint=u.constraints.relativePlacementConstraint;for(var N=new Map,g=new Map,E=[],w=[],L=u.getAllNodes(),Y=0,B=0;B<L.length;B++){var P=L[B];P.getChild()==null&&(g.set(P.id,Y++),E.push(P.getCenterX()),w.push(P.getCenterY()),N.set(P.id,P))}l.relativePlacementConstraint&&l.relativePlacementConstraint.forEach(function(C){!C.gap&&C.gap!=0&&(C.left?C.gap=i.DEFAULT_EDGE_LENGTH+N.get(C.left).getWidth()/2+N.get(C.right).getWidth()/2:C.gap=i.DEFAULT_EDGE_LENGTH+N.get(C.top).getHeight()/2+N.get(C.bottom).getHeight()/2)});var X=A(function(C,G){return{x:C.x-G.x,y:C.y-G.y}},"calculatePositionDiff"),q=A(function(C){var G=0,$=0;return C.forEach(function(K){G+=E[g.get(K)],$+=w[g.get(K)]}),{x:G/C.size,y:$/C.size}},"calculateAvgPosition"),O=A(function(C,G,$,K,Q){function pt(ot,st){var at=new Set(ot),Nt=!0,ft=!1,bt=void 0;try{for(var Dt=st[Symbol.iterator](),Rt;!(Nt=(Rt=Dt.next()).done);Nt=!0){var Xt=Rt.value;at.add(Xt)}}catch(Tt){ft=!0,bt=Tt}finally{try{!Nt&&Dt.return&&Dt.return()}finally{if(ft)throw bt}}return at}A(pt,"setUnion");var dt=new Map;C.forEach(function(ot,st){dt.set(st,0)}),C.forEach(function(ot,st){ot.forEach(function(at){dt.set(at.id,dt.get(at.id)+1)})});var tt=new Map,ct=new Map,Et=new f;dt.forEach(function(ot,st){ot==0?(Et.push(st),$||(G=="horizontal"?tt.set(st,g.has(st)?E[g.get(st)]:K.get(st)):tt.set(st,g.has(st)?w[g.get(st)]:K.get(st)))):tt.set(st,Number.NEGATIVE_INFINITY),$&&ct.set(st,new Set([st]))}),$&&Q.forEach(function(ot){var st=[];if(ot.forEach(function(ft){$.has(ft)&&st.push(ft)}),st.length>0){var at=0;st.forEach(function(ft){G=="horizontal"?(tt.set(ft,g.has(ft)?E[g.get(ft)]:K.get(ft)),at+=tt.get(ft)):(tt.set(ft,g.has(ft)?w[g.get(ft)]:K.get(ft)),at+=tt.get(ft))}),at=at/st.length,ot.forEach(function(ft){$.has(ft)||tt.set(ft,at)})}else{var Nt=0;ot.forEach(function(ft){G=="horizontal"?Nt+=g.has(ft)?E[g.get(ft)]:K.get(ft):Nt+=g.has(ft)?w[g.get(ft)]:K.get(ft)}),Nt=Nt/ot.length,ot.forEach(function(ft){tt.set(ft,Nt)})}});for(var wt=A(function(){var ot=Et.shift(),st=C.get(ot);st.forEach(function(at){if(tt.get(at.id)<tt.get(ot)+at.gap)if($&&$.has(at.id)){var Nt=void 0;if(G=="horizontal"?Nt=g.has(at.id)?E[g.get(at.id)]:K.get(at.id):Nt=g.has(at.id)?w[g.get(at.id)]:K.get(at.id),tt.set(at.id,Nt),Nt<tt.get(ot)+at.gap){var ft=tt.get(ot)+at.gap-Nt;ct.get(ot).forEach(function(bt){tt.set(bt,tt.get(bt)-ft)})}}else tt.set(at.id,tt.get(ot)+at.gap);dt.set(at.id,dt.get(at.id)-1),dt.get(at.id)==0&&Et.push(at.id),$&&ct.set(at.id,pt(ct.get(ot),ct.get(at.id)))})},"_loop");Et.length!=0;)wt();if($){var et=new Set;C.forEach(function(ot,st){ot.length==0&&et.add(st)});var It=[];ct.forEach(function(ot,st){if(et.has(st)){var at=!1,Nt=!0,ft=!1,bt=void 0;try{for(var Dt=ot[Symbol.iterator](),Rt;!(Nt=(Rt=Dt.next()).done);Nt=!0){var Xt=Rt.value;$.has(Xt)&&(at=!0)}}catch(St){ft=!0,bt=St}finally{try{!Nt&&Dt.return&&Dt.return()}finally{if(ft)throw bt}}if(!at){var Tt=!1,At=void 0;It.forEach(function(St,Gt){St.has([].concat(s(ot))[0])&&(Tt=!0,At=Gt)}),Tt?ot.forEach(function(St){It[At].add(St)}):It.push(new Set(ot))}}}),It.forEach(function(ot,st){var at=Number.POSITIVE_INFINITY,Nt=Number.POSITIVE_INFINITY,ft=Number.NEGATIVE_INFINITY,bt=Number.NEGATIVE_INFINITY,Dt=!0,Rt=!1,Xt=void 0;try{for(var Tt=ot[Symbol.iterator](),At;!(Dt=(At=Tt.next()).done);Dt=!0){var St=At.value,Gt=void 0;G=="horizontal"?Gt=g.has(St)?E[g.get(St)]:K.get(St):Gt=g.has(St)?w[g.get(St)]:K.get(St);var zt=tt.get(St);Gt<at&&(at=Gt),Gt>ft&&(ft=Gt),zt<Nt&&(Nt=zt),zt>bt&&(bt=zt)}}catch(Zt){Rt=!0,Xt=Zt}finally{try{!Dt&&Tt.return&&Tt.return()}finally{if(Rt)throw Xt}}var jt=(at+ft)/2-(Nt+bt)/2,re=!0,Kt=!1,Jt=void 0;try{for(var $t=ot[Symbol.iterator](),Qt;!(re=(Qt=$t.next()).done);re=!0){var oe=Qt.value;tt.set(oe,tt.get(oe)+jt)}}catch(Zt){Kt=!0,Jt=Zt}finally{try{!re&&$t.return&&$t.return()}finally{if(Kt)throw Jt}}})}return tt},"findAppropriatePositionForRelativePlacement"),it=A(function(C){var G=0,$=0,K=0,Q=0;if(C.forEach(function(ct){ct.left?E[g.get(ct.left)]-E[g.get(ct.right)]>=0?G++:$++:w[g.get(ct.top)]-w[g.get(ct.bottom)]>=0?K++:Q++}),G>$&&K>Q)for(var pt=0;pt<g.size;pt++)E[pt]=-1*E[pt],w[pt]=-1*w[pt];else if(G>$)for(var dt=0;dt<g.size;dt++)E[dt]=-1*E[dt];else if(K>Q)for(var tt=0;tt<g.size;tt++)w[tt]=-1*w[tt]},"applyReflectionForRelativePlacement"),a=A(function(C){var G=[],$=new f,K=new Set,Q=0;return C.forEach(function(pt,dt){if(!K.has(dt)){G[Q]=[];var tt=dt;for($.push(tt),K.add(tt),G[Q].push(tt);$.length!=0;){tt=$.shift();var ct=C.get(tt);ct.forEach(function(Et){K.has(Et.id)||($.push(Et.id),K.add(Et.id),G[Q].push(Et.id))})}Q++}}),G},"findComponents"),v=A(function(C){var G=new Map;return C.forEach(function($,K){G.set(K,[])}),C.forEach(function($,K){$.forEach(function(Q){G.get(K).push(Q),G.get(Q.id).push({id:K,gap:Q.gap,direction:Q.direction})})}),G},"dagToUndirected"),m=A(function(C){var G=new Map;return C.forEach(function($,K){G.set(K,[])}),C.forEach(function($,K){$.forEach(function(Q){G.get(Q.id).push({id:K,gap:Q.gap,direction:Q.direction})})}),G},"dagToReversed"),y=[],p=[],D=!1,x=!1,R=new Set,H=new Map,z=new Map,W=[];if(l.fixedNodeConstraint&&l.fixedNodeConstraint.forEach(function(C){R.add(C.nodeId)}),l.relativePlacementConstraint&&(l.relativePlacementConstraint.forEach(function(C){C.left?(H.has(C.left)?H.get(C.left).push({id:C.right,gap:C.gap,direction:"horizontal"}):H.set(C.left,[{id:C.right,gap:C.gap,direction:"horizontal"}]),H.has(C.right)||H.set(C.right,[])):(H.has(C.top)?H.get(C.top).push({id:C.bottom,gap:C.gap,direction:"vertical"}):H.set(C.top,[{id:C.bottom,gap:C.gap,direction:"vertical"}]),H.has(C.bottom)||H.set(C.bottom,[]))}),z=v(H),W=a(z)),i.TRANSFORM_ON_CONSTRAINT_HANDLING){if(l.fixedNodeConstraint&&l.fixedNodeConstraint.length>1)l.fixedNodeConstraint.forEach(function(C,G){y[G]=[C.position.x,C.position.y],p[G]=[E[g.get(C.nodeId)],w[g.get(C.nodeId)]]}),D=!0;else if(l.alignmentConstraint)(function(){var C=0;if(l.alignmentConstraint.vertical){for(var G=l.alignmentConstraint.vertical,$=A(function(tt){var ct=new Set;G[tt].forEach(function(et){ct.add(et)});var Et=new Set([].concat(s(ct)).filter(function(et){return R.has(et)})),wt=void 0;Et.size>0?wt=E[g.get(Et.values().next().value)]:wt=q(ct).x,G[tt].forEach(function(et){y[C]=[wt,w[g.get(et)]],p[C]=[E[g.get(et)],w[g.get(et)]],C++})},"_loop2"),K=0;K<G.length;K++)$(K);D=!0}if(l.alignmentConstraint.horizontal){for(var Q=l.alignmentConstraint.horizontal,pt=A(function(tt){var ct=new Set;Q[tt].forEach(function(et){ct.add(et)});var Et=new Set([].concat(s(ct)).filter(function(et){return R.has(et)})),wt=void 0;Et.size>0?wt=E[g.get(Et.values().next().value)]:wt=q(ct).y,Q[tt].forEach(function(et){y[C]=[E[g.get(et)],wt],p[C]=[E[g.get(et)],w[g.get(et)]],C++})},"_loop3"),dt=0;dt<Q.length;dt++)pt(dt);D=!0}l.relativePlacementConstraint&&(x=!0)})();else if(l.relativePlacementConstraint){for(var j=0,V=0,J=0;J<W.length;J++)W[J].length>j&&(j=W[J].length,V=J);if(j<z.size/2)it(l.relativePlacementConstraint),D=!1,x=!1;else{var U=new Map,S=new Map,F=[];W[V].forEach(function(C){H.get(C).forEach(function(G){G.direction=="horizontal"?(U.has(C)?U.get(C).push(G):U.set(C,[G]),U.has(G.id)||U.set(G.id,[]),F.push({left:C,right:G.id})):(S.has(C)?S.get(C).push(G):S.set(C,[G]),S.has(G.id)||S.set(G.id,[]),F.push({top:C,bottom:G.id}))})}),it(F),x=!1;var Z=O(U,"horizontal"),rt=O(S,"vertical");W[V].forEach(function(C,G){p[G]=[E[g.get(C)],w[g.get(C)]],y[G]=[],Z.has(C)?y[G][0]=Z.get(C):y[G][0]=E[g.get(C)],rt.has(C)?y[G][1]=rt.get(C):y[G][1]=w[g.get(C)]}),D=!0}}if(D){for(var ut=void 0,_t=o.transpose(y),Mt=o.transpose(p),k=0;k<_t.length;k++)_t[k]=o.multGamma(_t[k]),Mt[k]=o.multGamma(Mt[k]);var nt=o.multMat(_t,o.transpose(Mt)),ht=r.svd(nt);ut=o.multMat(ht.V,o.transpose(ht.U));for(var mt=0;mt<g.size;mt++){var Ct=[E[mt],w[mt]],vt=[ut[0][0],ut[1][0]],yt=[ut[0][1],ut[1][1]];E[mt]=o.dotProduct(Ct,vt),w[mt]=o.dotProduct(Ct,yt)}x&&it(l.relativePlacementConstraint)}}if(i.ENFORCE_CONSTRAINTS){if(l.fixedNodeConstraint&&l.fixedNodeConstraint.length>0){var xt={x:0,y:0};l.fixedNodeConstraint.forEach(function(C,G){var $={x:E[g.get(C.nodeId)],y:w[g.get(C.nodeId)]},K=C.position,Q=X(K,$);xt.x+=Q.x,xt.y+=Q.y}),xt.x/=l.fixedNodeConstraint.length,xt.y/=l.fixedNodeConstraint.length,E.forEach(function(C,G){E[G]+=xt.x}),w.forEach(function(C,G){w[G]+=xt.y}),l.fixedNodeConstraint.forEach(function(C){E[g.get(C.nodeId)]=C.position.x,w[g.get(C.nodeId)]=C.position.y})}if(l.alignmentConstraint){if(l.alignmentConstraint.vertical)for(var Ht=l.alignmentConstraint.vertical,Ft=A(function(C){var G=new Set;Ht[C].forEach(function(Q){G.add(Q)});var $=new Set([].concat(s(G)).filter(function(Q){return R.has(Q)})),K=void 0;$.size>0?K=E[g.get($.values().next().value)]:K=q(G).x,G.forEach(function(Q){R.has(Q)||(E[g.get(Q)]=K)})},"_loop4"),Pt=0;Pt<Ht.length;Pt++)Ft(Pt);if(l.alignmentConstraint.horizontal)for(var Ot=l.alignmentConstraint.horizontal,Yt=A(function(C){var G=new Set;Ot[C].forEach(function(Q){G.add(Q)});var $=new Set([].concat(s(G)).filter(function(Q){return R.has(Q)})),K=void 0;$.size>0?K=w[g.get($.values().next().value)]:K=q(G).y,G.forEach(function(Q){R.has(Q)||(w[g.get(Q)]=K)})},"_loop5"),Ut=0;Ut<Ot.length;Ut++)Yt(Ut)}l.relativePlacementConstraint&&function(){var C=new Map,G=new Map,$=new Map,K=new Map,Q=new Map,pt=new Map,dt=new Set,tt=new Set;if(R.forEach(function(gt){dt.add(gt),tt.add(gt)}),l.alignmentConstraint){if(l.alignmentConstraint.vertical)for(var ct=l.alignmentConstraint.vertical,Et=A(function(gt){$.set("dummy"+gt,[]),ct[gt].forEach(function(Lt){C.set(Lt,"dummy"+gt),$.get("dummy"+gt).push(Lt),R.has(Lt)&&dt.add("dummy"+gt)}),Q.set("dummy"+gt,E[g.get(ct[gt][0])])},"_loop6"),wt=0;wt<ct.length;wt++)Et(wt);if(l.alignmentConstraint.horizontal)for(var et=l.alignmentConstraint.horizontal,It=A(function(gt){K.set("dummy"+gt,[]),et[gt].forEach(function(Lt){G.set(Lt,"dummy"+gt),K.get("dummy"+gt).push(Lt),R.has(Lt)&&tt.add("dummy"+gt)}),pt.set("dummy"+gt,w[g.get(et[gt][0])])},"_loop7"),ot=0;ot<et.length;ot++)It(ot)}var st=new Map,at=new Map,Nt=A(function(gt){H.get(gt).forEach(function(Lt){var Bt=void 0,Vt=void 0;Lt.direction=="horizontal"?(Bt=C.get(gt)?C.get(gt):gt,C.get(Lt.id)?Vt={id:C.get(Lt.id),gap:Lt.gap,direction:Lt.direction}:Vt=Lt,st.has(Bt)?st.get(Bt).push(Vt):st.set(Bt,[Vt]),st.has(Vt.id)||st.set(Vt.id,[])):(Bt=G.get(gt)?G.get(gt):gt,G.get(Lt.id)?Vt={id:G.get(Lt.id),gap:Lt.gap,direction:Lt.direction}:Vt=Lt,at.has(Bt)?at.get(Bt).push(Vt):at.set(Bt,[Vt]),at.has(Vt.id)||at.set(Vt.id,[]))})},"_loop8"),ft=!0,bt=!1,Dt=void 0;try{for(var Rt=H.keys()[Symbol.iterator](),Xt;!(ft=(Xt=Rt.next()).done);ft=!0){var Tt=Xt.value;Nt(Tt)}}catch(gt){bt=!0,Dt=gt}finally{try{!ft&&Rt.return&&Rt.return()}finally{if(bt)throw Dt}}var At=v(st),St=v(at),Gt=a(At),zt=a(St),jt=m(st),re=m(at),Kt=[],Jt=[];Gt.forEach(function(gt,Lt){Kt[Lt]=[],gt.forEach(function(Bt){jt.get(Bt).length==0&&Kt[Lt].push(Bt)})}),zt.forEach(function(gt,Lt){Jt[Lt]=[],gt.forEach(function(Bt){re.get(Bt).length==0&&Jt[Lt].push(Bt)})});var $t=O(st,"horizontal",dt,Q,Kt),Qt=O(at,"vertical",tt,pt,Jt),oe=A(function(gt){$.get(gt)?$.get(gt).forEach(function(Lt){E[g.get(Lt)]=$t.get(gt)}):E[g.get(gt)]=$t.get(gt)},"_loop9"),Zt=!0,ve=!1,ye=void 0;try{for(var se=$t.keys()[Symbol.iterator](),Ee;!(Zt=(Ee=se.next()).done);Zt=!0){var he=Ee.value;oe(he)}}catch(gt){ve=!0,ye=gt}finally{try{!Zt&&se.return&&se.return()}finally{if(ve)throw ye}}var Be=A(function(gt){K.get(gt)?K.get(gt).forEach(function(Lt){w[g.get(Lt)]=Qt.get(gt)}):w[g.get(gt)]=Qt.get(gt)},"_loop10"),le=!0,Ne=!1,Te=void 0;try{for(var de=Qt.keys()[Symbol.iterator](),Ae;!(le=(Ae=de.next()).done);le=!0){var he=Ae.value;Be(he)}}catch(gt){Ne=!0,Te=gt}finally{try{!le&&de.return&&de.return()}finally{if(Ne)throw Te}}}()}for(var Wt=0;Wt<L.length;Wt++){var lt=L[Wt];lt.getChild()==null&&lt.setCenter(E[g.get(lt.id)],w[g.get(lt.id)])}},n.exports=d},551:n=>{n.exports=_}},T={};function c(n){var e=T[n];if(e!==void 0)return e.exports;var t=T[n]={exports:{}};return b[n](t,t.exports,c),t.exports}A(c,"__webpack_require__");var h=c(45);return h})()})}),hi=pe((M,I)=>{A(function(_,b){typeof M=="object"&&typeof I=="object"?I.exports=b(Le()):typeof define=="function"&&define.amd?define(["cose-base"],b):typeof M=="object"?M.cytoscapeFcose=b(Le()):_.cytoscapeFcose=b(_.coseBase)},"webpackUniversalModuleDefinition")(M,function(_){return(()=>{var b={658:n=>{n.exports=Object.assign!=null?Object.assign.bind(Object):function(e){for(var t=arguments.length,s=Array(t>1?t-1:0),i=1;i<t;i++)s[i-1]=arguments[i];return s.forEach(function(f){Object.keys(f).forEach(function(o){return e[o]=f[o]})}),e}},548:(n,e,t)=>{var s=function(){function o(r,d){var u=[],l=!0,N=!1,g=void 0;try{for(var E=r[Symbol.iterator](),w;!(l=(w=E.next()).done)&&(u.push(w.value),!(d&&u.length===d));l=!0);}catch(L){N=!0,g=L}finally{try{!l&&E.return&&E.return()}finally{if(N)throw g}}return u}return A(o,"sliceIterator"),function(r,d){if(Array.isArray(r))return r;if(Symbol.iterator in Object(r))return o(r,d);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),i=t(140).layoutBase.LinkedList,f={};f.getTopMostNodes=function(o){for(var r={},d=0;d<o.length;d++)r[o[d].id()]=!0;var u=o.filter(function(l,N){typeof l=="number"&&(l=N);for(var g=l.parent()[0];g!=null;){if(r[g.id()])return!1;g=g.parent()[0]}return!0});return u},f.connectComponents=function(o,r,d,u){var l=new i,N=new Set,g=[],E=void 0,w=void 0,L=void 0,Y=!1,B=1,P=[],X=[],q=A(function(){var O=o.collection();X.push(O);var it=d[0],a=o.collection();a.merge(it).merge(it.descendants().intersection(r)),g.push(it),a.forEach(function(y){l.push(y),N.add(y),O.merge(y)});for(var v=A(function(){it=l.shift();var y=o.collection();it.neighborhood().nodes().forEach(function(R){r.intersection(it.edgesWith(R)).length>0&&y.merge(R)});for(var p=0;p<y.length;p++){var D=y[p];if(E=d.intersection(D.union(D.ancestors())),E!=null&&!N.has(E[0])){var x=E.union(E.descendants());x.forEach(function(R){l.push(R),N.add(R),O.merge(R),d.has(R)&&g.push(R)})}}},"_loop2");l.length!=0;)v();if(O.forEach(function(y){r.intersection(y.connectedEdges()).forEach(function(p){O.has(p.source())&&O.has(p.target())&&O.merge(p)})}),g.length==d.length&&(Y=!0),!Y||Y&&B>1){w=g[0],L=w.connectedEdges().length,g.forEach(function(y){y.connectedEdges().length<L&&(L=y.connectedEdges().length,w=y)}),P.push(w.id());var m=o.collection();m.merge(g[0]),g.forEach(function(y){m.merge(y)}),g=[],d=d.difference(m),B++}},"_loop");do q();while(!Y);return u&&P.length>0&&u.set("dummy"+(u.size+1),P),X},f.relocateComponent=function(o,r,d){if(!d.fixedNodeConstraint){var u=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY,N=Number.POSITIVE_INFINITY,g=Number.NEGATIVE_INFINITY;if(d.quality=="draft"){var E=!0,w=!1,L=void 0;try{for(var Y=r.nodeIndexes[Symbol.iterator](),B;!(E=(B=Y.next()).done);E=!0){var P=B.value,X=s(P,2),q=X[0],O=X[1],it=d.cy.getElementById(q);if(it){var a=it.boundingBox(),v=r.xCoords[O]-a.w/2,m=r.xCoords[O]+a.w/2,y=r.yCoords[O]-a.h/2,p=r.yCoords[O]+a.h/2;v<u&&(u=v),m>l&&(l=m),y<N&&(N=y),p>g&&(g=p)}}}catch(z){w=!0,L=z}finally{try{!E&&Y.return&&Y.return()}finally{if(w)throw L}}var D=o.x-(l+u)/2,x=o.y-(g+N)/2;r.xCoords=r.xCoords.map(function(z){return z+D}),r.yCoords=r.yCoords.map(function(z){return z+x})}else{Object.keys(r).forEach(function(z){var W=r[z],j=W.getRect().x,V=W.getRect().x+W.getRect().width,J=W.getRect().y,U=W.getRect().y+W.getRect().height;j<u&&(u=j),V>l&&(l=V),J<N&&(N=J),U>g&&(g=U)});var R=o.x-(l+u)/2,H=o.y-(g+N)/2;Object.keys(r).forEach(function(z){var W=r[z];W.setCenter(W.getCenterX()+R,W.getCenterY()+H)})}}},f.calcBoundingBox=function(o,r,d,u){for(var l=Number.MAX_SAFE_INTEGER,N=Number.MIN_SAFE_INTEGER,g=Number.MAX_SAFE_INTEGER,E=Number.MIN_SAFE_INTEGER,w=void 0,L=void 0,Y=void 0,B=void 0,P=o.descendants().not(":parent"),X=P.length,q=0;q<X;q++){var O=P[q];w=r[u.get(O.id())]-O.width()/2,L=r[u.get(O.id())]+O.width()/2,Y=d[u.get(O.id())]-O.height()/2,B=d[u.get(O.id())]+O.height()/2,l>w&&(l=w),N<L&&(N=L),g>Y&&(g=Y),E<B&&(E=B)}var it={};return it.topLeftX=l,it.topLeftY=g,it.width=N-l,it.height=E-g,it},f.calcParentsWithoutChildren=function(o,r){var d=o.collection();return r.nodes(":parent").forEach(function(u){var l=!1;u.children().forEach(function(N){N.css("display")!="none"&&(l=!0)}),l||d.merge(u)}),d},n.exports=f},816:(n,e,t)=>{var s=t(548),i=t(140).CoSELayout,f=t(140).CoSENode,o=t(140).layoutBase.PointD,r=t(140).layoutBase.DimensionD,d=t(140).layoutBase.LayoutConstants,u=t(140).layoutBase.FDLayoutConstants,l=t(140).CoSEConstants,N=A(function(g,E){var w=g.cy,L=g.eles,Y=L.nodes(),B=L.edges(),P=void 0,X=void 0,q=void 0,O={};g.randomize&&(P=E.nodeIndexes,X=E.xCoords,q=E.yCoords);var it=A(function(R){return typeof R=="function"},"isFn"),a=A(function(R,H){return it(R)?R(H):R},"optFn"),v=s.calcParentsWithoutChildren(w,L),m=A(function R(H,z,W,j){for(var V=z.length,J=0;J<V;J++){var U=z[J],S=null;U.intersection(v).length==0&&(S=U.children());var F=void 0,Z=U.layoutDimensions({nodeDimensionsIncludeLabels:j.nodeDimensionsIncludeLabels});if(U.outerWidth()!=null&&U.outerHeight()!=null)if(j.randomize)if(!U.isParent())F=H.add(new f(W.graphManager,new o(X[P.get(U.id())]-Z.w/2,q[P.get(U.id())]-Z.h/2),new r(parseFloat(Z.w),parseFloat(Z.h))));else{var rt=s.calcBoundingBox(U,X,q,P);U.intersection(v).length==0?F=H.add(new f(W.graphManager,new o(rt.topLeftX,rt.topLeftY),new r(rt.width,rt.height))):F=H.add(new f(W.graphManager,new o(rt.topLeftX,rt.topLeftY),new r(parseFloat(Z.w),parseFloat(Z.h))))}else F=H.add(new f(W.graphManager,new o(U.position("x")-Z.w/2,U.position("y")-Z.h/2),new r(parseFloat(Z.w),parseFloat(Z.h))));else F=H.add(new f(this.graphManager));if(F.id=U.data("id"),F.nodeRepulsion=a(j.nodeRepulsion,U),F.paddingLeft=parseInt(U.css("padding")),F.paddingTop=parseInt(U.css("padding")),F.paddingRight=parseInt(U.css("padding")),F.paddingBottom=parseInt(U.css("padding")),j.nodeDimensionsIncludeLabels&&(F.labelWidth=U.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).w,F.labelHeight=U.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).h,F.labelPosVertical=U.css("text-valign"),F.labelPosHorizontal=U.css("text-halign")),O[U.data("id")]=F,isNaN(F.rect.x)&&(F.rect.x=0),isNaN(F.rect.y)&&(F.rect.y=0),S!=null&&S.length>0){var ut=void 0;ut=W.getGraphManager().add(W.newGraph(),F),R(ut,S,W,j)}}},"processChildrenList"),y=A(function(R,H,z){for(var W=0,j=0,V=0;V<z.length;V++){var J=z[V],U=O[J.data("source")],S=O[J.data("target")];if(U&&S&&U!==S&&U.getEdgesBetween(S).length==0){var F=H.add(R.newEdge(),U,S);F.id=J.id(),F.idealLength=a(g.idealEdgeLength,J),F.edgeElasticity=a(g.edgeElasticity,J),W+=F.idealLength,j++}}g.idealEdgeLength!=null&&(j>0?l.DEFAULT_EDGE_LENGTH=u.DEFAULT_EDGE_LENGTH=W/j:it(g.idealEdgeLength)?l.DEFAULT_EDGE_LENGTH=u.DEFAULT_EDGE_LENGTH=50:l.DEFAULT_EDGE_LENGTH=u.DEFAULT_EDGE_LENGTH=g.idealEdgeLength,l.MIN_REPULSION_DIST=u.MIN_REPULSION_DIST=u.DEFAULT_EDGE_LENGTH/10,l.DEFAULT_RADIAL_SEPARATION=u.DEFAULT_EDGE_LENGTH)},"processEdges"),p=A(function(R,H){H.fixedNodeConstraint&&(R.constraints.fixedNodeConstraint=H.fixedNodeConstraint),H.alignmentConstraint&&(R.constraints.alignmentConstraint=H.alignmentConstraint),H.relativePlacementConstraint&&(R.constraints.relativePlacementConstraint=H.relativePlacementConstraint)},"processConstraints");g.nestingFactor!=null&&(l.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=u.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=g.nestingFactor),g.gravity!=null&&(l.DEFAULT_GRAVITY_STRENGTH=u.DEFAULT_GRAVITY_STRENGTH=g.gravity),g.numIter!=null&&(l.MAX_ITERATIONS=u.MAX_ITERATIONS=g.numIter),g.gravityRange!=null&&(l.DEFAULT_GRAVITY_RANGE_FACTOR=u.DEFAULT_GRAVITY_RANGE_FACTOR=g.gravityRange),g.gravityCompound!=null&&(l.DEFAULT_COMPOUND_GRAVITY_STRENGTH=u.DEFAULT_COMPOUND_GRAVITY_STRENGTH=g.gravityCompound),g.gravityRangeCompound!=null&&(l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=u.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=g.gravityRangeCompound),g.initialEnergyOnIncremental!=null&&(l.DEFAULT_COOLING_FACTOR_INCREMENTAL=u.DEFAULT_COOLING_FACTOR_INCREMENTAL=g.initialEnergyOnIncremental),g.tilingCompareBy!=null&&(l.TILING_COMPARE_BY=g.tilingCompareBy),g.quality=="proof"?d.QUALITY=2:d.QUALITY=0,l.NODE_DIMENSIONS_INCLUDE_LABELS=u.NODE_DIMENSIONS_INCLUDE_LABELS=d.NODE_DIMENSIONS_INCLUDE_LABELS=g.nodeDimensionsIncludeLabels,l.DEFAULT_INCREMENTAL=u.DEFAULT_INCREMENTAL=d.DEFAULT_INCREMENTAL=!g.randomize,l.ANIMATE=u.ANIMATE=d.ANIMATE=g.animate,l.TILE=g.tile,l.TILING_PADDING_VERTICAL=typeof g.tilingPaddingVertical=="function"?g.tilingPaddingVertical.call():g.tilingPaddingVertical,l.TILING_PADDING_HORIZONTAL=typeof g.tilingPaddingHorizontal=="function"?g.tilingPaddingHorizontal.call():g.tilingPaddingHorizontal,l.DEFAULT_INCREMENTAL=u.DEFAULT_INCREMENTAL=d.DEFAULT_INCREMENTAL=!0,l.PURE_INCREMENTAL=!g.randomize,d.DEFAULT_UNIFORM_LEAF_NODE_SIZES=g.uniformNodeDimensions,g.step=="transformed"&&(l.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,l.ENFORCE_CONSTRAINTS=!1,l.APPLY_LAYOUT=!1),g.step=="enforced"&&(l.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,l.ENFORCE_CONSTRAINTS=!0,l.APPLY_LAYOUT=!1),g.step=="cose"&&(l.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,l.ENFORCE_CONSTRAINTS=!1,l.APPLY_LAYOUT=!0),g.step=="all"&&(g.randomize?l.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:l.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,l.ENFORCE_CONSTRAINTS=!0,l.APPLY_LAYOUT=!0),g.fixedNodeConstraint||g.alignmentConstraint||g.relativePlacementConstraint?l.TREE_REDUCTION_ON_INCREMENTAL=!1:l.TREE_REDUCTION_ON_INCREMENTAL=!0;var D=new i,x=D.newGraphManager();return m(x.addRoot(),s.getTopMostNodes(Y),D,g),y(D,x,B),p(D,g),D.runLayout(),O},"coseLayout");n.exports={coseLayout:N}},212:(n,e,t)=>{var s=function(){function E(w,L){for(var Y=0;Y<L.length;Y++){var B=L[Y];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(w,B.key,B)}}return A(E,"defineProperties"),function(w,L,Y){return L&&E(w.prototype,L),Y&&E(w,Y),w}}();function i(E,w){if(!(E instanceof w))throw new TypeError("Cannot call a class as a function")}A(i,"_classCallCheck");var f=t(658),o=t(548),r=t(657),d=r.spectralLayout,u=t(816),l=u.coseLayout,N=Object.freeze({quality:"default",randomize:!0,animate:!0,animationDuration:1e3,animationEasing:void 0,fit:!0,padding:30,nodeDimensionsIncludeLabels:!1,uniformNodeDimensions:!1,packComponents:!0,step:"all",samplingType:!0,sampleSize:25,nodeSeparation:75,piTol:1e-7,nodeRepulsion:A(function(E){return 4500},"nodeRepulsion"),idealEdgeLength:A(function(E){return 50},"idealEdgeLength"),edgeElasticity:A(function(E){return .45},"edgeElasticity"),nestingFactor:.1,gravity:.25,numIter:2500,tile:!0,tilingCompareBy:void 0,tilingPaddingVertical:10,tilingPaddingHorizontal:10,gravityRangeCompound:1.5,gravityCompound:1,gravityRange:3.8,initialEnergyOnIncremental:.3,fixedNodeConstraint:void 0,alignmentConstraint:void 0,relativePlacementConstraint:void 0,ready:A(function(){},"ready"),stop:A(function(){},"stop")}),g=function(){function E(w){i(this,E),this.options=f({},N,w)}return A(E,"Layout"),s(E,[{key:"run",value:A(function(){var w=this,L=this.options,Y=L.cy,B=L.eles,P=[],X=[],q=void 0,O=[];L.fixedNodeConstraint&&(!Array.isArray(L.fixedNodeConstraint)||L.fixedNodeConstraint.length==0)&&(L.fixedNodeConstraint=void 0),L.alignmentConstraint&&(L.alignmentConstraint.vertical&&(!Array.isArray(L.alignmentConstraint.vertical)||L.alignmentConstraint.vertical.length==0)&&(L.alignmentConstraint.vertical=void 0),L.alignmentConstraint.horizontal&&(!Array.isArray(L.alignmentConstraint.horizontal)||L.alignmentConstraint.horizontal.length==0)&&(L.alignmentConstraint.horizontal=void 0)),L.relativePlacementConstraint&&(!Array.isArray(L.relativePlacementConstraint)||L.relativePlacementConstraint.length==0)&&(L.relativePlacementConstraint=void 0);var it=L.fixedNodeConstraint||L.alignmentConstraint||L.relativePlacementConstraint;it&&(L.tile=!1,L.packComponents=!1);var a=void 0,v=!1;if(Y.layoutUtilities&&L.packComponents&&(a=Y.layoutUtilities("get"),a||(a=Y.layoutUtilities()),v=!0),B.nodes().length>0)if(v){var m=o.getTopMostNodes(L.eles.nodes());if(q=o.connectComponents(Y,L.eles,m),q.forEach(function(k){var nt=k.boundingBox();O.push({x:nt.x1+nt.w/2,y:nt.y1+nt.h/2})}),L.randomize&&q.forEach(function(k){L.eles=k,P.push(d(L))}),L.quality=="default"||L.quality=="proof"){var y=Y.collection();if(L.tile){var p=new Map,D=[],x=[],R=0,H={nodeIndexes:p,xCoords:D,yCoords:x},z=[];if(q.forEach(function(k,nt){k.edges().length==0&&(k.nodes().forEach(function(ht,mt){y.merge(k.nodes()[mt]),ht.isParent()||(H.nodeIndexes.set(k.nodes()[mt].id(),R++),H.xCoords.push(k.nodes()[0].position().x),H.yCoords.push(k.nodes()[0].position().y))}),z.push(nt))}),y.length>1){var W=y.boundingBox();O.push({x:W.x1+W.w/2,y:W.y1+W.h/2}),q.push(y),P.push(H);for(var j=z.length-1;j>=0;j--)q.splice(z[j],1),P.splice(z[j],1),O.splice(z[j],1)}}q.forEach(function(k,nt){L.eles=k,X.push(l(L,P[nt])),o.relocateComponent(O[nt],X[nt],L)})}else q.forEach(function(k,nt){o.relocateComponent(O[nt],P[nt],L)});var V=new Set;if(q.length>1){var J=[],U=B.filter(function(k){return k.css("display")=="none"});q.forEach(function(k,nt){var ht=void 0;if(L.quality=="draft"&&(ht=P[nt].nodeIndexes),k.nodes().not(U).length>0){var mt={};mt.edges=[],mt.nodes=[];var Ct=void 0;k.nodes().not(U).forEach(function(vt){if(L.quality=="draft")if(!vt.isParent())Ct=ht.get(vt.id()),mt.nodes.push({x:P[nt].xCoords[Ct]-vt.boundingbox().w/2,y:P[nt].yCoords[Ct]-vt.boundingbox().h/2,width:vt.boundingbox().w,height:vt.boundingbox().h});else{var yt=o.calcBoundingBox(vt,P[nt].xCoords,P[nt].yCoords,ht);mt.nodes.push({x:yt.topLeftX,y:yt.topLeftY,width:yt.width,height:yt.height})}else X[nt][vt.id()]&&mt.nodes.push({x:X[nt][vt.id()].getLeft(),y:X[nt][vt.id()].getTop(),width:X[nt][vt.id()].getWidth(),height:X[nt][vt.id()].getHeight()})}),k.edges().forEach(function(vt){var yt=vt.source(),xt=vt.target();if(yt.css("display")!="none"&&xt.css("display")!="none")if(L.quality=="draft"){var Ht=ht.get(yt.id()),Ft=ht.get(xt.id()),Pt=[],Ot=[];if(yt.isParent()){var Yt=o.calcBoundingBox(yt,P[nt].xCoords,P[nt].yCoords,ht);Pt.push(Yt.topLeftX+Yt.width/2),Pt.push(Yt.topLeftY+Yt.height/2)}else Pt.push(P[nt].xCoords[Ht]),Pt.push(P[nt].yCoords[Ht]);if(xt.isParent()){var Ut=o.calcBoundingBox(xt,P[nt].xCoords,P[nt].yCoords,ht);Ot.push(Ut.topLeftX+Ut.width/2),Ot.push(Ut.topLeftY+Ut.height/2)}else Ot.push(P[nt].xCoords[Ft]),Ot.push(P[nt].yCoords[Ft]);mt.edges.push({startX:Pt[0],startY:Pt[1],endX:Ot[0],endY:Ot[1]})}else X[nt][yt.id()]&&X[nt][xt.id()]&&mt.edges.push({startX:X[nt][yt.id()].getCenterX(),startY:X[nt][yt.id()].getCenterY(),endX:X[nt][xt.id()].getCenterX(),endY:X[nt][xt.id()].getCenterY()})}),mt.nodes.length>0&&(J.push(mt),V.add(nt))}});var S=a.packComponents(J,L.randomize).shifts;if(L.quality=="draft")P.forEach(function(k,nt){var ht=k.xCoords.map(function(Ct){return Ct+S[nt].dx}),mt=k.yCoords.map(function(Ct){return Ct+S[nt].dy});k.xCoords=ht,k.yCoords=mt});else{var F=0;V.forEach(function(k){Object.keys(X[k]).forEach(function(nt){var ht=X[k][nt];ht.setCenter(ht.getCenterX()+S[F].dx,ht.getCenterY()+S[F].dy)}),F++})}}}else{var Z=L.eles.boundingBox();if(O.push({x:Z.x1+Z.w/2,y:Z.y1+Z.h/2}),L.randomize){var rt=d(L);P.push(rt)}L.quality=="default"||L.quality=="proof"?(X.push(l(L,P[0])),o.relocateComponent(O[0],X[0],L)):o.relocateComponent(O[0],P[0],L)}var ut=A(function(k,nt){if(L.quality=="default"||L.quality=="proof"){typeof k=="number"&&(k=nt);var ht=void 0,mt=void 0,Ct=k.data("id");return X.forEach(function(yt){Ct in yt&&(ht={x:yt[Ct].getRect().getCenterX(),y:yt[Ct].getRect().getCenterY()},mt=yt[Ct])}),L.nodeDimensionsIncludeLabels&&(mt.labelWidth&&(mt.labelPosHorizontal=="left"?ht.x+=mt.labelWidth/2:mt.labelPosHorizontal=="right"&&(ht.x-=mt.labelWidth/2)),mt.labelHeight&&(mt.labelPosVertical=="top"?ht.y+=mt.labelHeight/2:mt.labelPosVertical=="bottom"&&(ht.y-=mt.labelHeight/2))),ht==null&&(ht={x:k.position("x"),y:k.position("y")}),{x:ht.x,y:ht.y}}else{var vt=void 0;return P.forEach(function(yt){var xt=yt.nodeIndexes.get(k.id());xt!=null&&(vt={x:yt.xCoords[xt],y:yt.yCoords[xt]})}),vt==null&&(vt={x:k.position("x"),y:k.position("y")}),{x:vt.x,y:vt.y}}},"getPositions");if(L.quality=="default"||L.quality=="proof"||L.randomize){var _t=o.calcParentsWithoutChildren(Y,B),Mt=B.filter(function(k){return k.css("display")=="none"});L.eles=B.not(Mt),B.nodes().not(":parent").not(Mt).layoutPositions(w,L,ut),_t.length>0&&_t.forEach(function(k){k.position(ut(k))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")},"run")}]),E}();n.exports=g},657:(n,e,t)=>{var s=t(548),i=t(140).layoutBase.Matrix,f=t(140).layoutBase.SVD,o=A(function(r){var d=r.cy,u=r.eles,l=u.nodes(),N=u.nodes(":parent"),g=new Map,E=new Map,w=new Map,L=[],Y=[],B=[],P=[],X=[],q=[],O=[],it=[],a=void 0,v=1e8,m=1e-9,y=r.piTol,p=r.samplingType,D=r.nodeSeparation,x=void 0,R=A(function(){for(var lt=0,C=0,G=!1;C<x;){lt=Math.floor(Math.random()*a),G=!1;for(var $=0;$<C;$++)if(P[$]==lt){G=!0;break}if(!G)P[C]=lt,C++;else continue}},"randomSampleCR"),H=A(function(lt,C,G){for(var $=[],K=0,Q=0,pt=0,dt=void 0,tt=[],ct=0,Et=1,wt=0;wt<a;wt++)tt[wt]=v;for($[Q]=lt,tt[lt]=0;Q>=K;){pt=$[K++];for(var et=L[pt],It=0;It<et.length;It++)dt=E.get(et[It]),tt[dt]==v&&(tt[dt]=tt[pt]+1,$[++Q]=dt);q[pt][C]=tt[pt]*D}if(G){for(var ot=0;ot<a;ot++)q[ot][C]<X[ot]&&(X[ot]=q[ot][C]);for(var st=0;st<a;st++)X[st]>ct&&(ct=X[st],Et=st)}return Et},"BFS"),z=A(function(lt){var C=void 0;if(lt){C=Math.floor(Math.random()*a);for(var G=0;G<a;G++)X[G]=v;for(var $=0;$<x;$++)P[$]=C,C=H(C,$,lt)}else{R();for(var K=0;K<x;K++)H(P[K],K,lt,!1)}for(var Q=0;Q<a;Q++)for(var pt=0;pt<x;pt++)q[Q][pt]*=q[Q][pt];for(var dt=0;dt<x;dt++)O[dt]=[];for(var tt=0;tt<x;tt++)for(var ct=0;ct<x;ct++)O[tt][ct]=q[P[ct]][tt]},"allBFS"),W=A(function(){for(var lt=f.svd(O),C=lt.S,G=lt.U,$=lt.V,K=C[0]*C[0]*C[0],Q=[],pt=0;pt<x;pt++){Q[pt]=[];for(var dt=0;dt<x;dt++)Q[pt][dt]=0,pt==dt&&(Q[pt][dt]=C[pt]/(C[pt]*C[pt]+K/(C[pt]*C[pt])))}it=i.multMat(i.multMat($,Q),i.transpose(G))},"sample"),j=A(function(){for(var lt=void 0,C=void 0,G=[],$=[],K=[],Q=[],pt=0;pt<a;pt++)G[pt]=Math.random(),$[pt]=Math.random();G=i.normalize(G),$=i.normalize($);for(var dt=0,tt=m,ct=m,Et=void 0;;){dt++;for(var wt=0;wt<a;wt++)K[wt]=G[wt];if(G=i.multGamma(i.multL(i.multGamma(K),q,it)),lt=i.dotProduct(K,G),G=i.normalize(G),tt=i.dotProduct(K,G),Et=Math.abs(tt/ct),Et<=1+y&&Et>=1)break;ct=tt}for(var et=0;et<a;et++)K[et]=G[et];for(dt=0,ct=m;;){dt++;for(var It=0;It<a;It++)Q[It]=$[It];if(Q=i.minusOp(Q,i.multCons(K,i.dotProduct(K,Q))),$=i.multGamma(i.multL(i.multGamma(Q),q,it)),C=i.dotProduct(Q,$),$=i.normalize($),tt=i.dotProduct(Q,$),Et=Math.abs(tt/ct),Et<=1+y&&Et>=1)break;ct=tt}for(var ot=0;ot<a;ot++)Q[ot]=$[ot];Y=i.multCons(K,Math.sqrt(Math.abs(lt))),B=i.multCons(Q,Math.sqrt(Math.abs(C)))},"powerIteration");s.connectComponents(d,u,s.getTopMostNodes(l),g),N.forEach(function(lt){s.connectComponents(d,u,s.getTopMostNodes(lt.descendants().intersection(u)),g)});for(var V=0,J=0;J<l.length;J++)l[J].isParent()||E.set(l[J].id(),V++);var U=!0,S=!1,F=void 0;try{for(var Z=g.keys()[Symbol.iterator](),rt;!(U=(rt=Z.next()).done);U=!0){var ut=rt.value;E.set(ut,V++)}}catch(lt){S=!0,F=lt}finally{try{!U&&Z.return&&Z.return()}finally{if(S)throw F}}for(var _t=0;_t<E.size;_t++)L[_t]=[];N.forEach(function(lt){for(var C=lt.children().intersection(u);C.nodes(":childless").length==0;)C=C.nodes()[0].children().intersection(u);var G=0,$=C.nodes(":childless")[0].connectedEdges().length;C.nodes(":childless").forEach(function(K,Q){K.connectedEdges().length<$&&($=K.connectedEdges().length,G=Q)}),w.set(lt.id(),C.nodes(":childless")[G].id())}),l.forEach(function(lt){var C=void 0;lt.isParent()?C=E.get(w.get(lt.id())):C=E.get(lt.id()),lt.neighborhood().nodes().forEach(function(G){u.intersection(lt.edgesWith(G)).length>0&&(G.isParent()?L[C].push(w.get(G.id())):L[C].push(G.id()))})});var Mt=A(function(lt){var C=E.get(lt),G=void 0;g.get(lt).forEach(function($){d.getElementById($).isParent()?G=w.get($):G=$,L[C].push(G),L[E.get(G)].push(lt)})},"_loop"),k=!0,nt=!1,ht=void 0;try{for(var mt=g.keys()[Symbol.iterator](),Ct;!(k=(Ct=mt.next()).done);k=!0){var vt=Ct.value;Mt(vt)}}catch(lt){nt=!0,ht=lt}finally{try{!k&&mt.return&&mt.return()}finally{if(nt)throw ht}}a=E.size;var yt=void 0;if(a>2){x=a<r.sampleSize?a:r.sampleSize;for(var xt=0;xt<a;xt++)q[xt]=[];for(var Ht=0;Ht<x;Ht++)it[Ht]=[];return r.quality=="draft"||r.step=="all"?(z(p),W(),j(),yt={nodeIndexes:E,xCoords:Y,yCoords:B}):(E.forEach(function(lt,C){Y.push(d.getElementById(C).position("x")),B.push(d.getElementById(C).position("y"))}),yt={nodeIndexes:E,xCoords:Y,yCoords:B}),yt}else{var Ft=E.keys(),Pt=d.getElementById(Ft.next().value),Ot=Pt.position(),Yt=Pt.outerWidth();if(Y.push(Ot.x),B.push(Ot.y),a==2){var Ut=d.getElementById(Ft.next().value),Wt=Ut.outerWidth();Y.push(Ot.x+Yt/2+Wt/2+r.idealEdgeLength),B.push(Ot.y)}return yt={nodeIndexes:E,xCoords:Y,yCoords:B},yt}},"spectralLayout");n.exports={spectralLayout:o}},579:(n,e,t)=>{var s=t(212),i=A(function(f){f&&f("layout","fcose",s)},"register");typeof cytoscape<"u"&&i(cytoscape),n.exports=i},140:n=>{n.exports=_}},T={};function c(n){var e=T[n];if(e!==void 0)return e.exports;var t=T[n]={exports:{}};return b[n](t,t.exports,c),t.exports}A(c,"__webpack_require__");var h=c(579);return h})()})}),_e={L:"left",R:"right",T:"top",B:"bottom"},Ce={L:A(M=>`${M},${M/2} 0,${M} 0,0`,"L"),R:A(M=>`0,${M/2} ${M},0 ${M},${M}`,"R"),T:A(M=>`0,0 ${M},0 ${M/2},${M}`,"T"),B:A(M=>`${M/2},0 ${M},${M} 0,${M}`,"B")},ae={L:A((M,I)=>M-I+2,"L"),R:A((M,I)=>M-2,"R"),T:A((M,I)=>M-I+2,"T"),B:A((M,I)=>M-2,"B")},li=A(function(M){return kt(M)?M==="L"?"R":"L":M==="T"?"B":"T"},"getOppositeArchitectureDirection"),Ie=A(function(M){let I=M;return I==="L"||I==="R"||I==="T"||I==="B"},"isArchitectureDirection"),kt=A(function(M){let I=M;return I==="L"||I==="R"},"isArchitectureDirectionX"),qt=A(function(M){let I=M;return I==="T"||I==="B"},"isArchitectureDirectionY"),me=A(function(M,I){let _=kt(M)&&qt(I),b=qt(M)&&kt(I);return _||b},"isArchitectureDirectionXY"),di=A(function(M){let I=M[0],_=M[1],b=kt(I)&&qt(_),T=qt(I)&&kt(_);return b||T},"isArchitecturePairXY"),gi=A(function(M){return M!=="LL"&&M!=="RR"&&M!=="TT"&&M!=="BB"},"isValidArchitectureDirectionPair"),ce=A(function(M,I){let _=`${M}${I}`;return gi(_)?_:void 0},"getArchitectureDirectionPair"),ci=A(function([M,I],_){let b=_[0],T=_[1];return kt(b)?qt(T)?[M+(b==="L"?-1:1),I+(T==="T"?1:-1)]:[M+(b==="L"?-1:1),I]:kt(T)?[M+(T==="L"?1:-1),I+(b==="T"?1:-1)]:[M,I+(b==="T"?1:-1)]},"shiftPositionByArchitectureDirectionPair"),ui=A(function(M){return M==="LT"||M==="TL"?[1,1]:M==="BL"||M==="LB"?[1,-1]:M==="BR"||M==="RB"?[-1,-1]:[-1,1]},"getArchitectureDirectionXYFactors"),fi=A(function(M,I){return me(M,I)?"bend":kt(M)?"horizontal":"vertical"},"getArchitectureDirectionAlignment"),pi=A(function(M){return M.type==="service"},"isArchitectureService"),mi=A(function(M){return M.type==="junction"},"isArchitectureJunction"),Me=A(M=>M.data(),"edgeData"),ee=A(M=>M.data(),"nodeData"),vi=ti.architecture,ie,be=(ie=class{constructor(){this.nodes={},this.groups={},this.edges=[],this.registeredIds={},this.elements={},this.diagramId="",this.setAccTitle=We,this.getAccTitle=je,this.setDiagramTitle=qe,this.getDiagramTitle=$e,this.getAccDescription=Ze,this.setAccDescription=Ke,this.clear()}setDiagramId(I){this.diagramId=I}getDiagramId(){return this.diagramId}clear(){this.nodes={},this.groups={},this.edges=[],this.registeredIds={},this.dataStructures=void 0,this.elements={},this.diagramId="",Je()}addService({id:I,icon:_,in:b,title:T,iconText:c}){if(this.registeredIds[I]!==void 0)throw new Error(`The service id [${I}] is already in use by another ${this.registeredIds[I]}`);if(b!==void 0){if(I===b)throw new Error(`The service [${I}] cannot be placed within itself`);if(this.registeredIds[b]===void 0)throw new Error(`The service [${I}]'s parent does not exist. Please make sure the parent is created before this service`);if(this.registeredIds[b]==="node")throw new Error(`The service [${I}]'s parent is not a group`)}this.registeredIds[I]="node",this.nodes[I]={id:I,type:"service",icon:_,iconText:c,title:T,edges:[],in:b}}getServices(){return Object.values(this.nodes).filter(pi)}addJunction({id:I,in:_}){if(this.registeredIds[I]!==void 0)throw new Error(`The junction id [${I}] is already in use by another ${this.registeredIds[I]}`);if(_!==void 0){if(I===_)throw new Error(`The junction [${I}] cannot be placed within itself`);if(this.registeredIds[_]===void 0)throw new Error(`The junction [${I}]'s parent does not exist. Please make sure the parent is created before this junction`);if(this.registeredIds[_]==="node")throw new Error(`The junction [${I}]'s parent is not a group`)}this.registeredIds[I]="node",this.nodes[I]={id:I,type:"junction",edges:[],in:_}}getJunctions(){return Object.values(this.nodes).filter(mi)}getNodes(){return Object.values(this.nodes)}getNode(I){return this.nodes[I]??null}addGroup({id:I,icon:_,in:b,title:T}){var c,h,n;if(((c=this.registeredIds)==null?void 0:c[I])!==void 0)throw new Error(`The group id [${I}] is already in use by another ${this.registeredIds[I]}`);if(b!==void 0){if(I===b)throw new Error(`The group [${I}] cannot be placed within itself`);if(((h=this.registeredIds)==null?void 0:h[b])===void 0)throw new Error(`The group [${I}]'s parent does not exist. Please make sure the parent is created before this group`);if(((n=this.registeredIds)==null?void 0:n[b])==="node")throw new Error(`The group [${I}]'s parent is not a group`)}this.registeredIds[I]="group",this.groups[I]={id:I,icon:_,title:T,in:b}}getGroups(){return Object.values(this.groups)}addEdge({lhsId:I,rhsId:_,lhsDir:b,rhsDir:T,lhsInto:c,rhsInto:h,lhsGroup:n,rhsGroup:e,title:t}){if(!Ie(b))throw new Error(`Invalid direction given for left hand side of edge ${I}--${_}. Expected (L,R,T,B) got ${String(b)}`);if(!Ie(T))throw new Error(`Invalid direction given for right hand side of edge ${I}--${_}. Expected (L,R,T,B) got ${String(T)}`);if(this.nodes[I]===void 0&&this.groups[I]===void 0)throw new Error(`The left-hand id [${I}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(this.nodes[_]===void 0&&this.groups[_]===void 0)throw new Error(`The right-hand id [${_}] does not yet exist. Please create the service/group before declaring an edge to it.`);let s=this.nodes[I].in,i=this.nodes[_].in;if(n&&s&&i&&s==i)throw new Error(`The left-hand id [${I}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(e&&s&&i&&s==i)throw new Error(`The right-hand id [${_}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);let f={lhsId:I,lhsDir:b,lhsInto:c,lhsGroup:n,rhsId:_,rhsDir:T,rhsInto:h,rhsGroup:e,title:t};this.edges.push(f),this.nodes[I]&&this.nodes[_]&&(this.nodes[I].edges.push(this.edges[this.edges.length-1]),this.nodes[_].edges.push(this.edges[this.edges.length-1]))}getEdges(){return this.edges}getDataStructures(){if(this.dataStructures===void 0){let I={},_=Object.entries(this.nodes).reduce((e,[t,s])=>(e[t]=s.edges.reduce((i,f)=>{var d,u;let o=(d=this.getNode(f.lhsId))==null?void 0:d.in,r=(u=this.getNode(f.rhsId))==null?void 0:u.in;if(o&&r&&o!==r){let l=fi(f.lhsDir,f.rhsDir);l!=="bend"&&(I[o]??(I[o]={}),I[o][r]=l,I[r]??(I[r]={}),I[r][o]=l)}if(f.lhsId===t){let l=ce(f.lhsDir,f.rhsDir);l&&(i[l]=f.rhsId)}else{let l=ce(f.rhsDir,f.lhsDir);l&&(i[l]=f.lhsId)}return i},{}),e),{}),b=Object.keys(_)[0],T={[b]:1},c=Object.keys(_).reduce((e,t)=>t===b?e:{...e,[t]:1},{}),h=A(e=>{let t={[e]:[0,0]},s=[e];for(;s.length>0;){let i=s.shift();if(i){T[i]=1,delete c[i];let f=_[i],[o,r]=t[i];Object.entries(f).forEach(([d,u])=>{T[u]||(t[u]=ci([o,r],d),s.push(u))})}}return t},"BFS"),n=[h(b)];for(;Object.keys(c).length>0;)n.push(h(Object.keys(c)[0]));this.dataStructures={adjList:_,spatialMaps:n,groupAlignments:I}}return this.dataStructures}setElementForId(I,_){this.elements[I]=_}getElementById(I){return this.elements[I]}getConfig(){return Qe({...vi,...ei().architecture})}getConfigField(I){return this.getConfig()[I]}},A(ie,"ArchitectureDB"),ie),yi=A((M,I)=>{He(M,I),M.groups.map(_=>I.addGroup(_)),M.services.map(_=>I.addService({..._,type:"service"})),M.junctions.map(_=>I.addJunction({..._,type:"junction"})),M.edges.map(_=>I.addEdge(_))},"populateDb"),De={parser:{yy:void 0},parse:A(async M=>{var b;let I=await ze("architecture",M);xe.debug(I);let _=(b=De.parser)==null?void 0:b.yy;if(!(_ instanceof be))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.");yi(I,_)},"parse")},Ei=A(M=>`
1
+ import{c as He}from"./chunk-JQRUD6KW-3F8Zg-1N.js";import{d as ze}from"./wardley-L42UT6IY-5TKZOOLJ-C-ZcgEBb.js";import{m as A,a7 as Ve,as as Xe,p as xe,e as We,s as je,n as qe,o as $e,a as Ze,l as Ke,u as Je,L as Qe,E as ti,I as ei,q as ue,aC as fe,aI as ge,d as ii,i as ri,t as ni,f as oi,aJ as ai,aK as si,a6 as pe}from"./index-VTKdaklA.js";import{r as Oe}from"./chunk-3SSMPTDK-Cv2Zy2FO.js";var we=pe((M,I)=>{A(function(_,b){typeof M=="object"&&typeof I=="object"?I.exports=b():typeof define=="function"&&define.amd?define([],b):typeof M=="object"?M.layoutBase=b():_.layoutBase=b()},"webpackUniversalModuleDefinition")(M,function(){return function(_){var b={};function T(c){if(b[c])return b[c].exports;var h=b[c]={i:c,l:!1,exports:{}};return _[c].call(h.exports,h,h.exports,T),h.l=!0,h.exports}return A(T,"__webpack_require__"),T.m=_,T.c=b,T.i=function(c){return c},T.d=function(c,h,n){T.o(c,h)||Object.defineProperty(c,h,{configurable:!1,enumerable:!0,get:n})},T.n=function(c){var h=c&&c.__esModule?A(function(){return c.default},"getDefault"):A(function(){return c},"getModuleExports");return T.d(h,"a",h),h},T.o=function(c,h){return Object.prototype.hasOwnProperty.call(c,h)},T.p="",T(T.s=28)}([function(_,b,T){function c(){}A(c,"LayoutConstants"),c.QUALITY=1,c.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,c.DEFAULT_INCREMENTAL=!1,c.DEFAULT_ANIMATION_ON_LAYOUT=!0,c.DEFAULT_ANIMATION_DURING_LAYOUT=!1,c.DEFAULT_ANIMATION_PERIOD=50,c.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,c.DEFAULT_GRAPH_MARGIN=15,c.NODE_DIMENSIONS_INCLUDE_LABELS=!1,c.SIMPLE_NODE_SIZE=40,c.SIMPLE_NODE_HALF_SIZE=c.SIMPLE_NODE_SIZE/2,c.EMPTY_COMPOUND_NODE_SIZE=40,c.MIN_EDGE_LENGTH=1,c.WORLD_BOUNDARY=1e6,c.INITIAL_WORLD_BOUNDARY=c.WORLD_BOUNDARY/1e3,c.WORLD_CENTER_X=1200,c.WORLD_CENTER_Y=900,_.exports=c},function(_,b,T){var c=T(2),h=T(8),n=T(9);function e(s,i,f){c.call(this,f),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=f,this.bendpoints=[],this.source=s,this.target=i}A(e,"LEdge"),e.prototype=Object.create(c.prototype);for(var t in c)e[t]=c[t];e.prototype.getSource=function(){return this.source},e.prototype.getTarget=function(){return this.target},e.prototype.isInterGraph=function(){return this.isInterGraph},e.prototype.getLength=function(){return this.length},e.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},e.prototype.getBendpoints=function(){return this.bendpoints},e.prototype.getLca=function(){return this.lca},e.prototype.getSourceInLca=function(){return this.sourceInLca},e.prototype.getTargetInLca=function(){return this.targetInLca},e.prototype.getOtherEnd=function(s){if(this.source===s)return this.target;if(this.target===s)return this.source;throw"Node is not incident with this edge"},e.prototype.getOtherEndInGraph=function(s,i){for(var f=this.getOtherEnd(s),o=i.getGraphManager().getRoot();;){if(f.getOwner()==i)return f;if(f.getOwner()==o)break;f=f.getOwner().getParent()}return null},e.prototype.updateLength=function(){var s=new Array(4);this.isOverlapingSourceAndTarget=h.getIntersection(this.target.getRect(),this.source.getRect(),s),this.isOverlapingSourceAndTarget||(this.lengthX=s[0]-s[2],this.lengthY=s[1]-s[3],Math.abs(this.lengthX)<1&&(this.lengthX=n.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=n.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},e.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=n.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=n.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},_.exports=e},function(_,b,T){function c(h){this.vGraphObject=h}A(c,"LGraphObject"),_.exports=c},function(_,b,T){var c=T(2),h=T(10),n=T(13),e=T(0),t=T(16),s=T(5);function i(o,r,d,u){d==null&&u==null&&(u=r),c.call(this,u),o.graphManager!=null&&(o=o.graphManager),this.estimatedSize=h.MIN_VALUE,this.inclusionTreeDepth=h.MAX_VALUE,this.vGraphObject=u,this.edges=[],this.graphManager=o,d!=null&&r!=null?this.rect=new n(r.x,r.y,d.width,d.height):this.rect=new n}A(i,"LNode"),i.prototype=Object.create(c.prototype);for(var f in c)i[f]=c[f];i.prototype.getEdges=function(){return this.edges},i.prototype.getChild=function(){return this.child},i.prototype.getOwner=function(){return this.owner},i.prototype.getWidth=function(){return this.rect.width},i.prototype.setWidth=function(o){this.rect.width=o},i.prototype.getHeight=function(){return this.rect.height},i.prototype.setHeight=function(o){this.rect.height=o},i.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},i.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},i.prototype.getCenter=function(){return new s(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},i.prototype.getLocation=function(){return new s(this.rect.x,this.rect.y)},i.prototype.getRect=function(){return this.rect},i.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},i.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},i.prototype.setRect=function(o,r){this.rect.x=o.x,this.rect.y=o.y,this.rect.width=r.width,this.rect.height=r.height},i.prototype.setCenter=function(o,r){this.rect.x=o-this.rect.width/2,this.rect.y=r-this.rect.height/2},i.prototype.setLocation=function(o,r){this.rect.x=o,this.rect.y=r},i.prototype.moveBy=function(o,r){this.rect.x+=o,this.rect.y+=r},i.prototype.getEdgeListToNode=function(o){var r=[],d=this;return d.edges.forEach(function(u){if(u.target==o){if(u.source!=d)throw"Incorrect edge source!";r.push(u)}}),r},i.prototype.getEdgesBetween=function(o){var r=[],d=this;return d.edges.forEach(function(u){if(!(u.source==d||u.target==d))throw"Incorrect edge source and/or target";(u.target==o||u.source==o)&&r.push(u)}),r},i.prototype.getNeighborsList=function(){var o=new Set,r=this;return r.edges.forEach(function(d){if(d.source==r)o.add(d.target);else{if(d.target!=r)throw"Incorrect incidency!";o.add(d.source)}}),o},i.prototype.withChildren=function(){var o=new Set,r,d;if(o.add(this),this.child!=null)for(var u=this.child.getNodes(),l=0;l<u.length;l++)r=u[l],d=r.withChildren(),d.forEach(function(N){o.add(N)});return o},i.prototype.getNoOfChildren=function(){var o=0,r;if(this.child==null)o=1;else for(var d=this.child.getNodes(),u=0;u<d.length;u++)r=d[u],o+=r.getNoOfChildren();return o==0&&(o=1),o},i.prototype.getEstimatedSize=function(){if(this.estimatedSize==h.MIN_VALUE)throw"assert failed";return this.estimatedSize},i.prototype.calcEstimatedSize=function(){return this.child==null?this.estimatedSize=(this.rect.width+this.rect.height)/2:(this.estimatedSize=this.child.calcEstimatedSize(),this.rect.width=this.estimatedSize,this.rect.height=this.estimatedSize,this.estimatedSize)},i.prototype.scatter=function(){var o,r,d=-e.INITIAL_WORLD_BOUNDARY,u=e.INITIAL_WORLD_BOUNDARY;o=e.WORLD_CENTER_X+t.nextDouble()*(u-d)+d;var l=-e.INITIAL_WORLD_BOUNDARY,N=e.INITIAL_WORLD_BOUNDARY;r=e.WORLD_CENTER_Y+t.nextDouble()*(N-l)+l,this.rect.x=o,this.rect.y=r},i.prototype.updateBounds=function(){if(this.getChild()==null)throw"assert failed";if(this.getChild().getNodes().length!=0){var o=this.getChild();if(o.updateBounds(!0),this.rect.x=o.getLeft(),this.rect.y=o.getTop(),this.setWidth(o.getRight()-o.getLeft()),this.setHeight(o.getBottom()-o.getTop()),e.NODE_DIMENSIONS_INCLUDE_LABELS){var r=o.getRight()-o.getLeft(),d=o.getBottom()-o.getTop();this.labelWidth&&(this.labelPosHorizontal=="left"?(this.rect.x-=this.labelWidth,this.setWidth(r+this.labelWidth)):this.labelPosHorizontal=="center"&&this.labelWidth>r?(this.rect.x-=(this.labelWidth-r)/2,this.setWidth(this.labelWidth)):this.labelPosHorizontal=="right"&&this.setWidth(r+this.labelWidth)),this.labelHeight&&(this.labelPosVertical=="top"?(this.rect.y-=this.labelHeight,this.setHeight(d+this.labelHeight)):this.labelPosVertical=="center"&&this.labelHeight>d?(this.rect.y-=(this.labelHeight-d)/2,this.setHeight(this.labelHeight)):this.labelPosVertical=="bottom"&&this.setHeight(d+this.labelHeight))}}},i.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==h.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},i.prototype.transform=function(o){var r=this.rect.x;r>e.WORLD_BOUNDARY?r=e.WORLD_BOUNDARY:r<-e.WORLD_BOUNDARY&&(r=-e.WORLD_BOUNDARY);var d=this.rect.y;d>e.WORLD_BOUNDARY?d=e.WORLD_BOUNDARY:d<-e.WORLD_BOUNDARY&&(d=-e.WORLD_BOUNDARY);var u=new s(r,d),l=o.inverseTransformPoint(u);this.setLocation(l.x,l.y)},i.prototype.getLeft=function(){return this.rect.x},i.prototype.getRight=function(){return this.rect.x+this.rect.width},i.prototype.getTop=function(){return this.rect.y},i.prototype.getBottom=function(){return this.rect.y+this.rect.height},i.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},_.exports=i},function(_,b,T){var c=T(0);function h(){}A(h,"FDLayoutConstants");for(var n in c)h[n]=c[n];h.MAX_ITERATIONS=2500,h.DEFAULT_EDGE_LENGTH=50,h.DEFAULT_SPRING_STRENGTH=.45,h.DEFAULT_REPULSION_STRENGTH=4500,h.DEFAULT_GRAVITY_STRENGTH=.4,h.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,h.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,h.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,h.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,h.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,h.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,h.COOLING_ADAPTATION_FACTOR=.33,h.ADAPTATION_LOWER_NODE_LIMIT=1e3,h.ADAPTATION_UPPER_NODE_LIMIT=5e3,h.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,h.MAX_NODE_DISPLACEMENT=h.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,h.MIN_REPULSION_DIST=h.DEFAULT_EDGE_LENGTH/10,h.CONVERGENCE_CHECK_PERIOD=100,h.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,h.MIN_EDGE_LENGTH=1,h.GRID_CALCULATION_CHECK_PERIOD=10,_.exports=h},function(_,b,T){function c(h,n){h==null&&n==null?(this.x=0,this.y=0):(this.x=h,this.y=n)}A(c,"PointD"),c.prototype.getX=function(){return this.x},c.prototype.getY=function(){return this.y},c.prototype.setX=function(h){this.x=h},c.prototype.setY=function(h){this.y=h},c.prototype.getDifference=function(h){return new DimensionD(this.x-h.x,this.y-h.y)},c.prototype.getCopy=function(){return new c(this.x,this.y)},c.prototype.translate=function(h){return this.x+=h.width,this.y+=h.height,this},_.exports=c},function(_,b,T){var c=T(2),h=T(10),n=T(0),e=T(7),t=T(3),s=T(1),i=T(13),f=T(12),o=T(11);function r(u,l,N){c.call(this,N),this.estimatedSize=h.MIN_VALUE,this.margin=n.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=u,l!=null&&l instanceof e?this.graphManager=l:l!=null&&l instanceof Layout&&(this.graphManager=l.graphManager)}A(r,"LGraph"),r.prototype=Object.create(c.prototype);for(var d in c)r[d]=c[d];r.prototype.getNodes=function(){return this.nodes},r.prototype.getEdges=function(){return this.edges},r.prototype.getGraphManager=function(){return this.graphManager},r.prototype.getParent=function(){return this.parent},r.prototype.getLeft=function(){return this.left},r.prototype.getRight=function(){return this.right},r.prototype.getTop=function(){return this.top},r.prototype.getBottom=function(){return this.bottom},r.prototype.isConnected=function(){return this.isConnected},r.prototype.add=function(u,l,N){if(l==null&&N==null){var g=u;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(g)>-1)throw"Node already in graph!";return g.owner=this,this.getNodes().push(g),g}else{var E=u;if(!(this.getNodes().indexOf(l)>-1&&this.getNodes().indexOf(N)>-1))throw"Source or target not in graph!";if(!(l.owner==N.owner&&l.owner==this))throw"Both owners must be this graph!";return l.owner!=N.owner?null:(E.source=l,E.target=N,E.isInterGraph=!1,this.getEdges().push(E),l.edges.push(E),N!=l&&N.edges.push(E),E)}},r.prototype.remove=function(u){var l=u;if(u instanceof t){if(l==null)throw"Node is null!";if(!(l.owner!=null&&l.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var N=l.edges.slice(),g,E=N.length,w=0;w<E;w++)g=N[w],g.isInterGraph?this.graphManager.remove(g):g.source.owner.remove(g);var L=this.nodes.indexOf(l);if(L==-1)throw"Node not in owner node list!";this.nodes.splice(L,1)}else if(u instanceof s){var g=u;if(g==null)throw"Edge is null!";if(!(g.source!=null&&g.target!=null))throw"Source and/or target is null!";if(!(g.source.owner!=null&&g.target.owner!=null&&g.source.owner==this&&g.target.owner==this))throw"Source and/or target owner is invalid!";var Y=g.source.edges.indexOf(g),B=g.target.edges.indexOf(g);if(!(Y>-1&&B>-1))throw"Source and/or target doesn't know this edge!";g.source.edges.splice(Y,1),g.target!=g.source&&g.target.edges.splice(B,1);var L=g.source.owner.getEdges().indexOf(g);if(L==-1)throw"Not in owner's edge list!";g.source.owner.getEdges().splice(L,1)}},r.prototype.updateLeftTop=function(){for(var u=h.MAX_VALUE,l=h.MAX_VALUE,N,g,E,w=this.getNodes(),L=w.length,Y=0;Y<L;Y++){var B=w[Y];N=B.getTop(),g=B.getLeft(),u>N&&(u=N),l>g&&(l=g)}return u==h.MAX_VALUE?null:(w[0].getParent().paddingLeft!=null?E=w[0].getParent().paddingLeft:E=this.margin,this.left=l-E,this.top=u-E,new f(this.left,this.top))},r.prototype.updateBounds=function(u){for(var l=h.MAX_VALUE,N=-h.MAX_VALUE,g=h.MAX_VALUE,E=-h.MAX_VALUE,w,L,Y,B,P,X=this.nodes,q=X.length,O=0;O<q;O++){var it=X[O];u&&it.child!=null&&it.updateBounds(),w=it.getLeft(),L=it.getRight(),Y=it.getTop(),B=it.getBottom(),l>w&&(l=w),N<L&&(N=L),g>Y&&(g=Y),E<B&&(E=B)}var a=new i(l,g,N-l,E-g);l==h.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),X[0].getParent().paddingLeft!=null?P=X[0].getParent().paddingLeft:P=this.margin,this.left=a.x-P,this.right=a.x+a.width+P,this.top=a.y-P,this.bottom=a.y+a.height+P},r.calculateBounds=function(u){for(var l=h.MAX_VALUE,N=-h.MAX_VALUE,g=h.MAX_VALUE,E=-h.MAX_VALUE,w,L,Y,B,P=u.length,X=0;X<P;X++){var q=u[X];w=q.getLeft(),L=q.getRight(),Y=q.getTop(),B=q.getBottom(),l>w&&(l=w),N<L&&(N=L),g>Y&&(g=Y),E<B&&(E=B)}var O=new i(l,g,N-l,E-g);return O},r.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},r.prototype.getEstimatedSize=function(){if(this.estimatedSize==h.MIN_VALUE)throw"assert failed";return this.estimatedSize},r.prototype.calcEstimatedSize=function(){for(var u=0,l=this.nodes,N=l.length,g=0;g<N;g++){var E=l[g];u+=E.calcEstimatedSize()}return u==0?this.estimatedSize=n.EMPTY_COMPOUND_NODE_SIZE:this.estimatedSize=u/Math.sqrt(this.nodes.length),this.estimatedSize},r.prototype.updateConnected=function(){var u=this;if(this.nodes.length==0){this.isConnected=!0;return}var l=new o,N=new Set,g=this.nodes[0],E,w,L=g.withChildren();for(L.forEach(function(O){l.push(O),N.add(O)});l.length!==0;){g=l.shift(),E=g.getEdges();for(var Y=E.length,B=0;B<Y;B++){var P=E[B];if(w=P.getOtherEndInGraph(g,this),w!=null&&!N.has(w)){var X=w.withChildren();X.forEach(function(O){l.push(O),N.add(O)})}}}if(this.isConnected=!1,N.size>=this.nodes.length){var q=0;N.forEach(function(O){O.owner==u&&q++}),q==this.nodes.length&&(this.isConnected=!0)}},_.exports=r},function(_,b,T){var c,h=T(1);function n(e){c=T(6),this.layout=e,this.graphs=[],this.edges=[]}A(n,"LGraphManager"),n.prototype.addRoot=function(){var e=this.layout.newGraph(),t=this.layout.newNode(null),s=this.add(e,t);return this.setRootGraph(s),this.rootGraph},n.prototype.add=function(e,t,s,i,f){if(s==null&&i==null&&f==null){if(e==null)throw"Graph is null!";if(t==null)throw"Parent node is null!";if(this.graphs.indexOf(e)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(e),e.parent!=null)throw"Already has a parent!";if(t.child!=null)throw"Already has a child!";return e.parent=t,t.child=e,e}else{f=s,i=t,s=e;var o=i.getOwner(),r=f.getOwner();if(!(o!=null&&o.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(r!=null&&r.getGraphManager()==this))throw"Target not in this graph mgr!";if(o==r)return s.isInterGraph=!1,o.add(s,i,f);if(s.isInterGraph=!0,s.source=i,s.target=f,this.edges.indexOf(s)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(s),!(s.source!=null&&s.target!=null))throw"Edge source and/or target is null!";if(!(s.source.edges.indexOf(s)==-1&&s.target.edges.indexOf(s)==-1))throw"Edge already in source and/or target incidency list!";return s.source.edges.push(s),s.target.edges.push(s),s}},n.prototype.remove=function(e){if(e instanceof c){var t=e;if(t.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(t==this.rootGraph||t.parent!=null&&t.parent.graphManager==this))throw"Invalid parent node!";var s=[];s=s.concat(t.getEdges());for(var i,f=s.length,o=0;o<f;o++)i=s[o],t.remove(i);var r=[];r=r.concat(t.getNodes());var d;f=r.length;for(var o=0;o<f;o++)d=r[o],t.remove(d);t==this.rootGraph&&this.setRootGraph(null);var u=this.graphs.indexOf(t);this.graphs.splice(u,1),t.parent=null}else if(e instanceof h){if(i=e,i==null)throw"Edge is null!";if(!i.isInterGraph)throw"Not an inter-graph edge!";if(!(i.source!=null&&i.target!=null))throw"Source and/or target is null!";if(!(i.source.edges.indexOf(i)!=-1&&i.target.edges.indexOf(i)!=-1))throw"Source and/or target doesn't know this edge!";var u=i.source.edges.indexOf(i);if(i.source.edges.splice(u,1),u=i.target.edges.indexOf(i),i.target.edges.splice(u,1),!(i.source.owner!=null&&i.source.owner.getGraphManager()!=null))throw"Edge owner graph or owner graph manager is null!";if(i.source.owner.getGraphManager().edges.indexOf(i)==-1)throw"Not in owner graph manager's edge list!";var u=i.source.owner.getGraphManager().edges.indexOf(i);i.source.owner.getGraphManager().edges.splice(u,1)}},n.prototype.updateBounds=function(){this.rootGraph.updateBounds(!0)},n.prototype.getGraphs=function(){return this.graphs},n.prototype.getAllNodes=function(){if(this.allNodes==null){for(var e=[],t=this.getGraphs(),s=t.length,i=0;i<s;i++)e=e.concat(t[i].getNodes());this.allNodes=e}return this.allNodes},n.prototype.resetAllNodes=function(){this.allNodes=null},n.prototype.resetAllEdges=function(){this.allEdges=null},n.prototype.resetAllNodesToApplyGravitation=function(){this.allNodesToApplyGravitation=null},n.prototype.getAllEdges=function(){if(this.allEdges==null){for(var e=[],t=this.getGraphs(),s=t.length,i=0;i<t.length;i++)e=e.concat(t[i].getEdges());e=e.concat(this.edges),this.allEdges=e}return this.allEdges},n.prototype.getAllNodesToApplyGravitation=function(){return this.allNodesToApplyGravitation},n.prototype.setAllNodesToApplyGravitation=function(e){if(this.allNodesToApplyGravitation!=null)throw"assert failed";this.allNodesToApplyGravitation=e},n.prototype.getRoot=function(){return this.rootGraph},n.prototype.setRootGraph=function(e){if(e.getGraphManager()!=this)throw"Root not in this graph mgr!";this.rootGraph=e,e.parent==null&&(e.parent=this.layout.newNode("Root node"))},n.prototype.getLayout=function(){return this.layout},n.prototype.isOneAncestorOfOther=function(e,t){if(!(e!=null&&t!=null))throw"assert failed";if(e==t)return!0;var s=e.getOwner(),i;do{if(i=s.getParent(),i==null)break;if(i==t)return!0;if(s=i.getOwner(),s==null)break}while(!0);s=t.getOwner();do{if(i=s.getParent(),i==null)break;if(i==e)return!0;if(s=i.getOwner(),s==null)break}while(!0);return!1},n.prototype.calcLowestCommonAncestors=function(){for(var e,t,s,i,f,o=this.getAllEdges(),r=o.length,d=0;d<r;d++){if(e=o[d],t=e.source,s=e.target,e.lca=null,e.sourceInLca=t,e.targetInLca=s,t==s){e.lca=t.getOwner();continue}for(i=t.getOwner();e.lca==null;){for(e.targetInLca=s,f=s.getOwner();e.lca==null;){if(f==i){e.lca=f;break}if(f==this.rootGraph)break;if(e.lca!=null)throw"assert failed";e.targetInLca=f.getParent(),f=e.targetInLca.getOwner()}if(i==this.rootGraph)break;e.lca==null&&(e.sourceInLca=i.getParent(),i=e.sourceInLca.getOwner())}if(e.lca==null)throw"assert failed"}},n.prototype.calcLowestCommonAncestor=function(e,t){if(e==t)return e.getOwner();var s=e.getOwner();do{if(s==null)break;var i=t.getOwner();do{if(i==null)break;if(i==s)return i;i=i.getParent().getOwner()}while(!0);s=s.getParent().getOwner()}while(!0);return s},n.prototype.calcInclusionTreeDepths=function(e,t){e==null&&t==null&&(e=this.rootGraph,t=1);for(var s,i=e.getNodes(),f=i.length,o=0;o<f;o++)s=i[o],s.inclusionTreeDepth=t,s.child!=null&&this.calcInclusionTreeDepths(s.child,t+1)},n.prototype.includesInvalidEdge=function(){for(var e,t=[],s=this.edges.length,i=0;i<s;i++)e=this.edges[i],this.isOneAncestorOfOther(e.source,e.target)&&t.push(e);for(var i=0;i<t.length;i++)this.remove(t[i]);return!1},_.exports=n},function(_,b,T){var c=T(12);function h(){}A(h,"IGeometry"),h.calcSeparationAmount=function(n,e,t,s){if(!n.intersects(e))throw"assert failed";var i=new Array(2);this.decideDirectionsForOverlappingNodes(n,e,i),t[0]=Math.min(n.getRight(),e.getRight())-Math.max(n.x,e.x),t[1]=Math.min(n.getBottom(),e.getBottom())-Math.max(n.y,e.y),n.getX()<=e.getX()&&n.getRight()>=e.getRight()?t[0]+=Math.min(e.getX()-n.getX(),n.getRight()-e.getRight()):e.getX()<=n.getX()&&e.getRight()>=n.getRight()&&(t[0]+=Math.min(n.getX()-e.getX(),e.getRight()-n.getRight())),n.getY()<=e.getY()&&n.getBottom()>=e.getBottom()?t[1]+=Math.min(e.getY()-n.getY(),n.getBottom()-e.getBottom()):e.getY()<=n.getY()&&e.getBottom()>=n.getBottom()&&(t[1]+=Math.min(n.getY()-e.getY(),e.getBottom()-n.getBottom()));var f=Math.abs((e.getCenterY()-n.getCenterY())/(e.getCenterX()-n.getCenterX()));e.getCenterY()===n.getCenterY()&&e.getCenterX()===n.getCenterX()&&(f=1);var o=f*t[0],r=t[1]/f;t[0]<r?r=t[0]:o=t[1],t[0]=-1*i[0]*(r/2+s),t[1]=-1*i[1]*(o/2+s)},h.decideDirectionsForOverlappingNodes=function(n,e,t){n.getCenterX()<e.getCenterX()?t[0]=-1:t[0]=1,n.getCenterY()<e.getCenterY()?t[1]=-1:t[1]=1},h.getIntersection2=function(n,e,t){var s=n.getCenterX(),i=n.getCenterY(),f=e.getCenterX(),o=e.getCenterY();if(n.intersects(e))return t[0]=s,t[1]=i,t[2]=f,t[3]=o,!0;var r=n.getX(),d=n.getY(),u=n.getRight(),l=n.getX(),N=n.getBottom(),g=n.getRight(),E=n.getWidthHalf(),w=n.getHeightHalf(),L=e.getX(),Y=e.getY(),B=e.getRight(),P=e.getX(),X=e.getBottom(),q=e.getRight(),O=e.getWidthHalf(),it=e.getHeightHalf(),a=!1,v=!1;if(s===f){if(i>o)return t[0]=s,t[1]=d,t[2]=f,t[3]=X,!1;if(i<o)return t[0]=s,t[1]=N,t[2]=f,t[3]=Y,!1}else if(i===o){if(s>f)return t[0]=r,t[1]=i,t[2]=B,t[3]=o,!1;if(s<f)return t[0]=u,t[1]=i,t[2]=L,t[3]=o,!1}else{var m=n.height/n.width,y=e.height/e.width,p=(o-i)/(f-s),D=void 0,x=void 0,R=void 0,H=void 0,z=void 0,W=void 0;if(-m===p?s>f?(t[0]=l,t[1]=N,a=!0):(t[0]=u,t[1]=d,a=!0):m===p&&(s>f?(t[0]=r,t[1]=d,a=!0):(t[0]=g,t[1]=N,a=!0)),-y===p?f>s?(t[2]=P,t[3]=X,v=!0):(t[2]=B,t[3]=Y,v=!0):y===p&&(f>s?(t[2]=L,t[3]=Y,v=!0):(t[2]=q,t[3]=X,v=!0)),a&&v)return!1;if(s>f?i>o?(D=this.getCardinalDirection(m,p,4),x=this.getCardinalDirection(y,p,2)):(D=this.getCardinalDirection(-m,p,3),x=this.getCardinalDirection(-y,p,1)):i>o?(D=this.getCardinalDirection(-m,p,1),x=this.getCardinalDirection(-y,p,3)):(D=this.getCardinalDirection(m,p,2),x=this.getCardinalDirection(y,p,4)),!a)switch(D){case 1:H=d,R=s+-w/p,t[0]=R,t[1]=H;break;case 2:R=g,H=i+E*p,t[0]=R,t[1]=H;break;case 3:H=N,R=s+w/p,t[0]=R,t[1]=H;break;case 4:R=l,H=i+-E*p,t[0]=R,t[1]=H;break}if(!v)switch(x){case 1:W=Y,z=f+-it/p,t[2]=z,t[3]=W;break;case 2:z=q,W=o+O*p,t[2]=z,t[3]=W;break;case 3:W=X,z=f+it/p,t[2]=z,t[3]=W;break;case 4:z=P,W=o+-O*p,t[2]=z,t[3]=W;break}}return!1},h.getCardinalDirection=function(n,e,t){return n>e?t:1+t%4},h.getIntersection=function(n,e,t,s){if(s==null)return this.getIntersection2(n,e,t);var i=n.x,f=n.y,o=e.x,r=e.y,d=t.x,u=t.y,l=s.x,N=s.y,g=void 0,E=void 0,w=void 0,L=void 0,Y=void 0,B=void 0,P=void 0,X=void 0,q=void 0;return w=r-f,Y=i-o,P=o*f-i*r,L=N-u,B=d-l,X=l*u-d*N,q=w*B-L*Y,q===0?null:(g=(Y*X-B*P)/q,E=(L*P-w*X)/q,new c(g,E))},h.angleOfVector=function(n,e,t,s){var i=void 0;return n!==t?(i=Math.atan((s-e)/(t-n)),t<n?i+=Math.PI:s<e&&(i+=this.TWO_PI)):s<e?i=this.ONE_AND_HALF_PI:i=this.HALF_PI,i},h.doIntersect=function(n,e,t,s){var i=n.x,f=n.y,o=e.x,r=e.y,d=t.x,u=t.y,l=s.x,N=s.y,g=(o-i)*(N-u)-(l-d)*(r-f);if(g===0)return!1;var E=((N-u)*(l-i)+(d-l)*(N-f))/g,w=((f-r)*(l-i)+(o-i)*(N-f))/g;return 0<E&&E<1&&0<w&&w<1},h.findCircleLineIntersections=function(n,e,t,s,i,f,o){var r=(t-n)*(t-n)+(s-e)*(s-e),d=2*((n-i)*(t-n)+(e-f)*(s-e)),u=(n-i)*(n-i)+(e-f)*(e-f)-o*o,l=d*d-4*r*u;if(l>=0){var N=(-d+Math.sqrt(d*d-4*r*u))/(2*r),g=(-d-Math.sqrt(d*d-4*r*u))/(2*r),E=null;return N>=0&&N<=1?[N]:g>=0&&g<=1?[g]:E}else return null},h.HALF_PI=.5*Math.PI,h.ONE_AND_HALF_PI=1.5*Math.PI,h.TWO_PI=2*Math.PI,h.THREE_PI=3*Math.PI,_.exports=h},function(_,b,T){function c(){}A(c,"IMath"),c.sign=function(h){return h>0?1:h<0?-1:0},c.floor=function(h){return h<0?Math.ceil(h):Math.floor(h)},c.ceil=function(h){return h<0?Math.floor(h):Math.ceil(h)},_.exports=c},function(_,b,T){function c(){}A(c,"Integer"),c.MAX_VALUE=2147483647,c.MIN_VALUE=-2147483648,_.exports=c},function(_,b,T){var c=function(){function i(f,o){for(var r=0;r<o.length;r++){var d=o[r];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(f,d.key,d)}}return A(i,"defineProperties"),function(f,o,r){return o&&i(f.prototype,o),r&&i(f,r),f}}();function h(i,f){if(!(i instanceof f))throw new TypeError("Cannot call a class as a function")}A(h,"_classCallCheck");var n=A(function(i){return{value:i,next:null,prev:null}},"nodeFrom"),e=A(function(i,f,o,r){return i!==null?i.next=f:r.head=f,o!==null?o.prev=f:r.tail=f,f.prev=i,f.next=o,r.length++,f},"add"),t=A(function(i,f){var o=i.prev,r=i.next;return o!==null?o.next=r:f.head=r,r!==null?r.prev=o:f.tail=o,i.prev=i.next=null,f.length--,i},"_remove"),s=function(){function i(f){var o=this;h(this,i),this.length=0,this.head=null,this.tail=null,f==null||f.forEach(function(r){return o.push(r)})}return A(i,"LinkedList"),c(i,[{key:"size",value:A(function(){return this.length},"size")},{key:"insertBefore",value:A(function(f,o){return e(o.prev,n(f),o,this)},"insertBefore")},{key:"insertAfter",value:A(function(f,o){return e(o,n(f),o.next,this)},"insertAfter")},{key:"insertNodeBefore",value:A(function(f,o){return e(o.prev,f,o,this)},"insertNodeBefore")},{key:"insertNodeAfter",value:A(function(f,o){return e(o,f,o.next,this)},"insertNodeAfter")},{key:"push",value:A(function(f){return e(this.tail,n(f),null,this)},"push")},{key:"unshift",value:A(function(f){return e(null,n(f),this.head,this)},"unshift")},{key:"remove",value:A(function(f){return t(f,this)},"remove")},{key:"pop",value:A(function(){return t(this.tail,this).value},"pop")},{key:"popNode",value:A(function(){return t(this.tail,this)},"popNode")},{key:"shift",value:A(function(){return t(this.head,this).value},"shift")},{key:"shiftNode",value:A(function(){return t(this.head,this)},"shiftNode")},{key:"get_object_at",value:A(function(f){if(f<=this.length()){for(var o=1,r=this.head;o<f;)r=r.next,o++;return r.value}},"get_object_at")},{key:"set_object_at",value:A(function(f,o){if(f<=this.length()){for(var r=1,d=this.head;r<f;)d=d.next,r++;d.value=o}},"set_object_at")}]),i}();_.exports=s},function(_,b,T){function c(h,n,e){this.x=null,this.y=null,h==null&&n==null&&e==null?(this.x=0,this.y=0):typeof h=="number"&&typeof n=="number"&&e==null?(this.x=h,this.y=n):h.constructor.name=="Point"&&n==null&&e==null&&(e=h,this.x=e.x,this.y=e.y)}A(c,"Point"),c.prototype.getX=function(){return this.x},c.prototype.getY=function(){return this.y},c.prototype.getLocation=function(){return new c(this.x,this.y)},c.prototype.setLocation=function(h,n,e){h.constructor.name=="Point"&&n==null&&e==null?(e=h,this.setLocation(e.x,e.y)):typeof h=="number"&&typeof n=="number"&&e==null&&(parseInt(h)==h&&parseInt(n)==n?this.move(h,n):(this.x=Math.floor(h+.5),this.y=Math.floor(n+.5)))},c.prototype.move=function(h,n){this.x=h,this.y=n},c.prototype.translate=function(h,n){this.x+=h,this.y+=n},c.prototype.equals=function(h){if(h.constructor.name=="Point"){var n=h;return this.x==n.x&&this.y==n.y}return this==h},c.prototype.toString=function(){return new c().constructor.name+"[x="+this.x+",y="+this.y+"]"},_.exports=c},function(_,b,T){function c(h,n,e,t){this.x=0,this.y=0,this.width=0,this.height=0,h!=null&&n!=null&&e!=null&&t!=null&&(this.x=h,this.y=n,this.width=e,this.height=t)}A(c,"RectangleD"),c.prototype.getX=function(){return this.x},c.prototype.setX=function(h){this.x=h},c.prototype.getY=function(){return this.y},c.prototype.setY=function(h){this.y=h},c.prototype.getWidth=function(){return this.width},c.prototype.setWidth=function(h){this.width=h},c.prototype.getHeight=function(){return this.height},c.prototype.setHeight=function(h){this.height=h},c.prototype.getRight=function(){return this.x+this.width},c.prototype.getBottom=function(){return this.y+this.height},c.prototype.intersects=function(h){return!(this.getRight()<h.x||this.getBottom()<h.y||h.getRight()<this.x||h.getBottom()<this.y)},c.prototype.getCenterX=function(){return this.x+this.width/2},c.prototype.getMinX=function(){return this.getX()},c.prototype.getMaxX=function(){return this.getX()+this.width},c.prototype.getCenterY=function(){return this.y+this.height/2},c.prototype.getMinY=function(){return this.getY()},c.prototype.getMaxY=function(){return this.getY()+this.height},c.prototype.getWidthHalf=function(){return this.width/2},c.prototype.getHeightHalf=function(){return this.height/2},_.exports=c},function(_,b,T){var c=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n};function h(){}A(h,"UniqueIDGeneretor"),h.lastID=0,h.createID=function(n){return h.isPrimitive(n)?n:(n.uniqueID!=null||(n.uniqueID=h.getString(),h.lastID++),n.uniqueID)},h.getString=function(n){return n==null&&(n=h.lastID),"Object#"+n},h.isPrimitive=function(n){var e=typeof n>"u"?"undefined":c(n);return n==null||e!="object"&&e!="function"},_.exports=h},function(_,b,T){function c(d){if(Array.isArray(d)){for(var u=0,l=Array(d.length);u<d.length;u++)l[u]=d[u];return l}else return Array.from(d)}A(c,"_toConsumableArray");var h=T(0),n=T(7),e=T(3),t=T(1),s=T(6),i=T(5),f=T(17),o=T(29);function r(d){o.call(this),this.layoutQuality=h.QUALITY,this.createBendsAsNeeded=h.DEFAULT_CREATE_BENDS_AS_NEEDED,this.incremental=h.DEFAULT_INCREMENTAL,this.animationOnLayout=h.DEFAULT_ANIMATION_ON_LAYOUT,this.animationDuringLayout=h.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=h.DEFAULT_ANIMATION_PERIOD,this.uniformLeafNodeSizes=h.DEFAULT_UNIFORM_LEAF_NODE_SIZES,this.edgeToDummyNodes=new Map,this.graphManager=new n(this),this.isLayoutFinished=!1,this.isSubLayout=!1,this.isRemoteUse=!1,d!=null&&(this.isRemoteUse=d)}A(r,"Layout"),r.RANDOM_SEED=1,r.prototype=Object.create(o.prototype),r.prototype.getGraphManager=function(){return this.graphManager},r.prototype.getAllNodes=function(){return this.graphManager.getAllNodes()},r.prototype.getAllEdges=function(){return this.graphManager.getAllEdges()},r.prototype.getAllNodesToApplyGravitation=function(){return this.graphManager.getAllNodesToApplyGravitation()},r.prototype.newGraphManager=function(){var d=new n(this);return this.graphManager=d,d},r.prototype.newGraph=function(d){return new s(null,this.graphManager,d)},r.prototype.newNode=function(d){return new e(this.graphManager,d)},r.prototype.newEdge=function(d){return new t(null,null,d)},r.prototype.checkLayoutSuccess=function(){return this.graphManager.getRoot()==null||this.graphManager.getRoot().getNodes().length==0||this.graphManager.includesInvalidEdge()},r.prototype.runLayout=function(){this.isLayoutFinished=!1,this.tilingPreLayout&&this.tilingPreLayout(),this.initParameters();var d;return this.checkLayoutSuccess()?d=!1:d=this.layout(),h.ANIMATE==="during"?!1:(d&&(this.isSubLayout||this.doPostLayout()),this.tilingPostLayout&&this.tilingPostLayout(),this.isLayoutFinished=!0,d)},r.prototype.doPostLayout=function(){this.incremental||this.transform(),this.update()},r.prototype.update2=function(){if(this.createBendsAsNeeded&&(this.createBendpointsFromDummyNodes(),this.graphManager.resetAllEdges()),!this.isRemoteUse){for(var d,u=this.graphManager.getAllEdges(),l=0;l<u.length;l++)d=u[l];for(var N,g=this.graphManager.getRoot().getNodes(),l=0;l<g.length;l++)N=g[l];this.update(this.graphManager.getRoot())}},r.prototype.update=function(d){if(d==null)this.update2();else if(d instanceof e){var u=d;if(u.getChild()!=null)for(var l=u.getChild().getNodes(),N=0;N<l.length;N++)update(l[N]);if(u.vGraphObject!=null){var g=u.vGraphObject;g.update(u)}}else if(d instanceof t){var E=d;if(E.vGraphObject!=null){var w=E.vGraphObject;w.update(E)}}else if(d instanceof s){var L=d;if(L.vGraphObject!=null){var Y=L.vGraphObject;Y.update(L)}}},r.prototype.initParameters=function(){this.isSubLayout||(this.layoutQuality=h.QUALITY,this.animationDuringLayout=h.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=h.DEFAULT_ANIMATION_PERIOD,this.animationOnLayout=h.DEFAULT_ANIMATION_ON_LAYOUT,this.incremental=h.DEFAULT_INCREMENTAL,this.createBendsAsNeeded=h.DEFAULT_CREATE_BENDS_AS_NEEDED,this.uniformLeafNodeSizes=h.DEFAULT_UNIFORM_LEAF_NODE_SIZES),this.animationDuringLayout&&(this.animationOnLayout=!1)},r.prototype.transform=function(d){if(d==null)this.transform(new i(0,0));else{var u=new f,l=this.graphManager.getRoot().updateLeftTop();if(l!=null){u.setWorldOrgX(d.x),u.setWorldOrgY(d.y),u.setDeviceOrgX(l.x),u.setDeviceOrgY(l.y);for(var N=this.getAllNodes(),g,E=0;E<N.length;E++)g=N[E],g.transform(u)}}},r.prototype.positionNodesRandomly=function(d){if(d==null)this.positionNodesRandomly(this.getGraphManager().getRoot()),this.getGraphManager().getRoot().updateBounds(!0);else for(var u,l,N=d.getNodes(),g=0;g<N.length;g++)u=N[g],l=u.getChild(),l==null||l.getNodes().length==0?u.scatter():(this.positionNodesRandomly(l),u.updateBounds())},r.prototype.getFlatForest=function(){for(var d=[],u=!0,l=this.graphManager.getRoot().getNodes(),N=!0,g=0;g<l.length;g++)l[g].getChild()!=null&&(N=!1);if(!N)return d;var E=new Set,w=[],L=new Map,Y=[];for(Y=Y.concat(l);Y.length>0&&u;){for(w.push(Y[0]);w.length>0&&u;){var B=w[0];w.splice(0,1),E.add(B);for(var P=B.getEdges(),g=0;g<P.length;g++){var X=P[g].getOtherEnd(B);if(L.get(B)!=X)if(!E.has(X))w.push(X),L.set(X,B);else{u=!1;break}}}if(!u)d=[];else{var q=[].concat(c(E));d.push(q);for(var g=0;g<q.length;g++){var O=q[g],it=Y.indexOf(O);it>-1&&Y.splice(it,1)}E=new Set,L=new Map}}return d},r.prototype.createDummyNodesForBendpoints=function(d){for(var u=[],l=d.source,N=this.graphManager.calcLowestCommonAncestor(d.source,d.target),g=0;g<d.bendpoints.length;g++){var E=this.newNode(null);E.setRect(new Point(0,0),new Dimension(1,1)),N.add(E);var w=this.newEdge(null);this.graphManager.add(w,l,E),u.add(E),l=E}var w=this.newEdge(null);return this.graphManager.add(w,l,d.target),this.edgeToDummyNodes.set(d,u),d.isInterGraph()?this.graphManager.remove(d):N.remove(d),u},r.prototype.createBendpointsFromDummyNodes=function(){var d=[];d=d.concat(this.graphManager.getAllEdges()),d=[].concat(c(this.edgeToDummyNodes.keys())).concat(d);for(var u=0;u<d.length;u++){var l=d[u];if(l.bendpoints.length>0){for(var N=this.edgeToDummyNodes.get(l),g=0;g<N.length;g++){var E=N[g],w=new i(E.getCenterX(),E.getCenterY()),L=l.bendpoints.get(g);L.x=w.x,L.y=w.y,E.getOwner().remove(E)}this.graphManager.add(l,l.source,l.target)}}},r.transform=function(d,u,l,N){if(l!=null&&N!=null){var g=u;if(d<=50){var E=u/l;g-=(u-E)/50*(50-d)}else{var w=u*N;g+=(w-u)/50*(d-50)}return g}else{var L,Y;return d<=50?(L=9*u/500,Y=u/10):(L=9*u/50,Y=-8*u),L*d+Y}},r.findCenterOfTree=function(d){var u=[];u=u.concat(d);var l=[],N=new Map,g=!1,E=null;(u.length==1||u.length==2)&&(g=!0,E=u[0]);for(var w=0;w<u.length;w++){var L=u[w],Y=L.getNeighborsList().size;N.set(L,L.getNeighborsList().size),Y==1&&l.push(L)}var B=[];for(B=B.concat(l);!g;){var P=[];P=P.concat(B),B=[];for(var w=0;w<u.length;w++){var L=u[w],X=u.indexOf(L);X>=0&&u.splice(X,1);var q=L.getNeighborsList();q.forEach(function(a){if(l.indexOf(a)<0){var v=N.get(a),m=v-1;m==1&&B.push(a),N.set(a,m)}})}l=l.concat(B),(u.length==1||u.length==2)&&(g=!0,E=u[0])}return E},r.prototype.setGraphManager=function(d){this.graphManager=d},_.exports=r},function(_,b,T){function c(){}A(c,"RandomSeed"),c.seed=1,c.x=0,c.nextDouble=function(){return c.x=Math.sin(c.seed++)*1e4,c.x-Math.floor(c.x)},_.exports=c},function(_,b,T){var c=T(5);function h(n,e){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}A(h,"Transform"),h.prototype.getWorldOrgX=function(){return this.lworldOrgX},h.prototype.setWorldOrgX=function(n){this.lworldOrgX=n},h.prototype.getWorldOrgY=function(){return this.lworldOrgY},h.prototype.setWorldOrgY=function(n){this.lworldOrgY=n},h.prototype.getWorldExtX=function(){return this.lworldExtX},h.prototype.setWorldExtX=function(n){this.lworldExtX=n},h.prototype.getWorldExtY=function(){return this.lworldExtY},h.prototype.setWorldExtY=function(n){this.lworldExtY=n},h.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},h.prototype.setDeviceOrgX=function(n){this.ldeviceOrgX=n},h.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},h.prototype.setDeviceOrgY=function(n){this.ldeviceOrgY=n},h.prototype.getDeviceExtX=function(){return this.ldeviceExtX},h.prototype.setDeviceExtX=function(n){this.ldeviceExtX=n},h.prototype.getDeviceExtY=function(){return this.ldeviceExtY},h.prototype.setDeviceExtY=function(n){this.ldeviceExtY=n},h.prototype.transformX=function(n){var e=0,t=this.lworldExtX;return t!=0&&(e=this.ldeviceOrgX+(n-this.lworldOrgX)*this.ldeviceExtX/t),e},h.prototype.transformY=function(n){var e=0,t=this.lworldExtY;return t!=0&&(e=this.ldeviceOrgY+(n-this.lworldOrgY)*this.ldeviceExtY/t),e},h.prototype.inverseTransformX=function(n){var e=0,t=this.ldeviceExtX;return t!=0&&(e=this.lworldOrgX+(n-this.ldeviceOrgX)*this.lworldExtX/t),e},h.prototype.inverseTransformY=function(n){var e=0,t=this.ldeviceExtY;return t!=0&&(e=this.lworldOrgY+(n-this.ldeviceOrgY)*this.lworldExtY/t),e},h.prototype.inverseTransformPoint=function(n){var e=new c(this.inverseTransformX(n.x),this.inverseTransformY(n.y));return e},_.exports=h},function(_,b,T){function c(o){if(Array.isArray(o)){for(var r=0,d=Array(o.length);r<o.length;r++)d[r]=o[r];return d}else return Array.from(o)}A(c,"_toConsumableArray");var h=T(15),n=T(4),e=T(0),t=T(8),s=T(9);function i(){h.call(this),this.useSmartIdealEdgeLengthCalculation=n.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=n.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=n.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=n.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=n.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*n.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=n.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=n.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=n.MAX_ITERATIONS}A(i,"FDLayout"),i.prototype=Object.create(h.prototype);for(var f in h)i[f]=h[f];i.prototype.initParameters=function(){h.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=n.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},i.prototype.calcIdealEdgeLengths=function(){for(var o,r,d,u,l,N,g,E=this.getGraphManager().getAllEdges(),w=0;w<E.length;w++)o=E[w],r=o.idealLength,o.isInterGraph&&(u=o.getSource(),l=o.getTarget(),N=o.getSourceInLca().getEstimatedSize(),g=o.getTargetInLca().getEstimatedSize(),this.useSmartIdealEdgeLengthCalculation&&(o.idealLength+=N+g-2*e.SIMPLE_NODE_SIZE),d=o.getLca().getInclusionTreeDepth(),o.idealLength+=r*n.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR*(u.getInclusionTreeDepth()+l.getInclusionTreeDepth()-2*d))},i.prototype.initSpringEmbedder=function(){var o=this.getAllNodes().length;this.incremental?(o>n.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*n.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(o-n.ADAPTATION_LOWER_NODE_LIMIT)/(n.ADAPTATION_UPPER_NODE_LIMIT-n.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-n.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=n.MAX_NODE_DISPLACEMENT_INCREMENTAL):(o>n.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(n.COOLING_ADAPTATION_FACTOR,1-(o-n.ADAPTATION_LOWER_NODE_LIMIT)/(n.ADAPTATION_UPPER_NODE_LIMIT-n.ADAPTATION_LOWER_NODE_LIMIT)*(1-n.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=n.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.displacementThresholdPerNode=3*n.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},i.prototype.calcSpringForces=function(){for(var o=this.getAllEdges(),r,d=0;d<o.length;d++)r=o[d],this.calcSpringForce(r,r.idealLength)},i.prototype.calcRepulsionForces=function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,d,u,l,N,g=this.getAllNodes(),E;if(this.useFRGridVariant)for(this.totalIterations%n.GRID_CALCULATION_CHECK_PERIOD==1&&o&&this.updateGrid(),E=new Set,d=0;d<g.length;d++)l=g[d],this.calculateRepulsionForceOfANode(l,E,o,r),E.add(l);else for(d=0;d<g.length;d++)for(l=g[d],u=d+1;u<g.length;u++)N=g[u],l.getOwner()==N.getOwner()&&this.calcRepulsionForce(l,N)},i.prototype.calcGravitationalForces=function(){for(var o,r=this.getAllNodesToApplyGravitation(),d=0;d<r.length;d++)o=r[d],this.calcGravitationalForce(o)},i.prototype.moveNodes=function(){for(var o=this.getAllNodes(),r,d=0;d<o.length;d++)r=o[d],r.move()},i.prototype.calcSpringForce=function(o,r){var d=o.getSource(),u=o.getTarget(),l,N,g,E;if(this.uniformLeafNodeSizes&&d.getChild()==null&&u.getChild()==null)o.updateLengthSimple();else if(o.updateLength(),o.isOverlapingSourceAndTarget)return;l=o.getLength(),l!=0&&(N=o.edgeElasticity*(l-r),g=N*(o.lengthX/l),E=N*(o.lengthY/l),d.springForceX+=g,d.springForceY+=E,u.springForceX-=g,u.springForceY-=E)},i.prototype.calcRepulsionForce=function(o,r){var d=o.getRect(),u=r.getRect(),l=new Array(2),N=new Array(4),g,E,w,L,Y,B,P;if(d.intersects(u)){t.calcSeparationAmount(d,u,l,n.DEFAULT_EDGE_LENGTH/2),B=2*l[0],P=2*l[1];var X=o.noOfChildren*r.noOfChildren/(o.noOfChildren+r.noOfChildren);o.repulsionForceX-=X*B,o.repulsionForceY-=X*P,r.repulsionForceX+=X*B,r.repulsionForceY+=X*P}else this.uniformLeafNodeSizes&&o.getChild()==null&&r.getChild()==null?(g=u.getCenterX()-d.getCenterX(),E=u.getCenterY()-d.getCenterY()):(t.getIntersection(d,u,N),g=N[2]-N[0],E=N[3]-N[1]),Math.abs(g)<n.MIN_REPULSION_DIST&&(g=s.sign(g)*n.MIN_REPULSION_DIST),Math.abs(E)<n.MIN_REPULSION_DIST&&(E=s.sign(E)*n.MIN_REPULSION_DIST),w=g*g+E*E,L=Math.sqrt(w),Y=(o.nodeRepulsion/2+r.nodeRepulsion/2)*o.noOfChildren*r.noOfChildren/w,B=Y*g/L,P=Y*E/L,o.repulsionForceX-=B,o.repulsionForceY-=P,r.repulsionForceX+=B,r.repulsionForceY+=P},i.prototype.calcGravitationalForce=function(o){var r,d,u,l,N,g,E,w;r=o.getOwner(),d=(r.getRight()+r.getLeft())/2,u=(r.getTop()+r.getBottom())/2,l=o.getCenterX()-d,N=o.getCenterY()-u,g=Math.abs(l)+o.getWidth()/2,E=Math.abs(N)+o.getHeight()/2,o.getOwner()==this.graphManager.getRoot()?(w=r.getEstimatedSize()*this.gravityRangeFactor,(g>w||E>w)&&(o.gravitationForceX=-this.gravityConstant*l,o.gravitationForceY=-this.gravityConstant*N)):(w=r.getEstimatedSize()*this.compoundGravityRangeFactor,(g>w||E>w)&&(o.gravitationForceX=-this.gravityConstant*l*this.compoundGravityConstant,o.gravitationForceY=-this.gravityConstant*N*this.compoundGravityConstant))},i.prototype.isConverged=function(){var o,r=!1;return this.totalIterations>this.maxIterations/3&&(r=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),o=this.totalDisplacement<this.totalDisplacementThreshold,this.oldTotalDisplacement=this.totalDisplacement,o||r},i.prototype.animate=function(){this.animationDuringLayout&&!this.isSubLayout&&(this.notAnimatedIterations==this.animationPeriod?(this.update(),this.notAnimatedIterations=0):this.notAnimatedIterations++)},i.prototype.calcNoOfChildrenForAllNodes=function(){for(var o,r=this.graphManager.getAllNodes(),d=0;d<r.length;d++)o=r[d],o.noOfChildren=o.getNoOfChildren()},i.prototype.calcGrid=function(o){var r=0,d=0;r=parseInt(Math.ceil((o.getRight()-o.getLeft())/this.repulsionRange)),d=parseInt(Math.ceil((o.getBottom()-o.getTop())/this.repulsionRange));for(var u=new Array(r),l=0;l<r;l++)u[l]=new Array(d);for(var l=0;l<r;l++)for(var N=0;N<d;N++)u[l][N]=new Array;return u},i.prototype.addNodeToGrid=function(o,r,d){var u=0,l=0,N=0,g=0;u=parseInt(Math.floor((o.getRect().x-r)/this.repulsionRange)),l=parseInt(Math.floor((o.getRect().width+o.getRect().x-r)/this.repulsionRange)),N=parseInt(Math.floor((o.getRect().y-d)/this.repulsionRange)),g=parseInt(Math.floor((o.getRect().height+o.getRect().y-d)/this.repulsionRange));for(var E=u;E<=l;E++)for(var w=N;w<=g;w++)this.grid[E][w].push(o),o.setGridCoordinates(u,l,N,g)},i.prototype.updateGrid=function(){var o,r,d=this.getAllNodes();for(this.grid=this.calcGrid(this.graphManager.getRoot()),o=0;o<d.length;o++)r=d[o],this.addNodeToGrid(r,this.graphManager.getRoot().getLeft(),this.graphManager.getRoot().getTop())},i.prototype.calculateRepulsionForceOfANode=function(o,r,d,u){if(this.totalIterations%n.GRID_CALCULATION_CHECK_PERIOD==1&&d||u){var l=new Set;o.surrounding=new Array;for(var N,g=this.grid,E=o.startX-1;E<o.finishX+2;E++)for(var w=o.startY-1;w<o.finishY+2;w++)if(!(E<0||w<0||E>=g.length||w>=g[0].length)){for(var L=0;L<g[E][w].length;L++)if(N=g[E][w][L],!(o.getOwner()!=N.getOwner()||o==N)&&!r.has(N)&&!l.has(N)){var Y=Math.abs(o.getCenterX()-N.getCenterX())-(o.getWidth()/2+N.getWidth()/2),B=Math.abs(o.getCenterY()-N.getCenterY())-(o.getHeight()/2+N.getHeight()/2);Y<=this.repulsionRange&&B<=this.repulsionRange&&l.add(N)}}o.surrounding=[].concat(c(l))}for(E=0;E<o.surrounding.length;E++)this.calcRepulsionForce(o,o.surrounding[E])},i.prototype.calcRepulsionRange=function(){return 0},_.exports=i},function(_,b,T){var c=T(1),h=T(4);function n(t,s,i){c.call(this,t,s,i),this.idealLength=h.DEFAULT_EDGE_LENGTH,this.edgeElasticity=h.DEFAULT_SPRING_STRENGTH}A(n,"FDLayoutEdge"),n.prototype=Object.create(c.prototype);for(var e in c)n[e]=c[e];_.exports=n},function(_,b,T){var c=T(3),h=T(4);function n(t,s,i,f){c.call(this,t,s,i,f),this.nodeRepulsion=h.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=[]}A(n,"FDLayoutNode"),n.prototype=Object.create(c.prototype);for(var e in c)n[e]=c[e];n.prototype.setGridCoordinates=function(t,s,i,f){this.startX=t,this.finishX=s,this.startY=i,this.finishY=f},_.exports=n},function(_,b,T){function c(h,n){this.width=0,this.height=0,h!==null&&n!==null&&(this.height=n,this.width=h)}A(c,"DimensionD"),c.prototype.getWidth=function(){return this.width},c.prototype.setWidth=function(h){this.width=h},c.prototype.getHeight=function(){return this.height},c.prototype.setHeight=function(h){this.height=h},_.exports=c},function(_,b,T){var c=T(14);function h(){this.map={},this.keys=[]}A(h,"HashMap"),h.prototype.put=function(n,e){var t=c.createID(n);this.contains(t)||(this.map[t]=e,this.keys.push(n))},h.prototype.contains=function(n){return c.createID(n),this.map[n]!=null},h.prototype.get=function(n){var e=c.createID(n);return this.map[e]},h.prototype.keySet=function(){return this.keys},_.exports=h},function(_,b,T){var c=T(14);function h(){this.set={}}A(h,"HashSet"),h.prototype.add=function(n){var e=c.createID(n);this.contains(e)||(this.set[e]=n)},h.prototype.remove=function(n){delete this.set[c.createID(n)]},h.prototype.clear=function(){this.set={}},h.prototype.contains=function(n){return this.set[c.createID(n)]==n},h.prototype.isEmpty=function(){return this.size()===0},h.prototype.size=function(){return Object.keys(this.set).length},h.prototype.addAllTo=function(n){for(var e=Object.keys(this.set),t=e.length,s=0;s<t;s++)n.push(this.set[e[s]])},h.prototype.size=function(){return Object.keys(this.set).length},h.prototype.addAll=function(n){for(var e=n.length,t=0;t<e;t++){var s=n[t];this.add(s)}},_.exports=h},function(_,b,T){function c(){}A(c,"Matrix"),c.multMat=function(h,n){for(var e=[],t=0;t<h.length;t++){e[t]=[];for(var s=0;s<n[0].length;s++){e[t][s]=0;for(var i=0;i<h[0].length;i++)e[t][s]+=h[t][i]*n[i][s]}}return e},c.transpose=function(h){for(var n=[],e=0;e<h[0].length;e++){n[e]=[];for(var t=0;t<h.length;t++)n[e][t]=h[t][e]}return n},c.multCons=function(h,n){for(var e=[],t=0;t<h.length;t++)e[t]=h[t]*n;return e},c.minusOp=function(h,n){for(var e=[],t=0;t<h.length;t++)e[t]=h[t]-n[t];return e},c.dotProduct=function(h,n){for(var e=0,t=0;t<h.length;t++)e+=h[t]*n[t];return e},c.mag=function(h){return Math.sqrt(this.dotProduct(h,h))},c.normalize=function(h){for(var n=[],e=this.mag(h),t=0;t<h.length;t++)n[t]=h[t]/e;return n},c.multGamma=function(h){for(var n=[],e=0,t=0;t<h.length;t++)e+=h[t];e*=-1/h.length;for(var s=0;s<h.length;s++)n[s]=e+h[s];return n},c.multL=function(h,n,e){for(var t=[],s=[],i=[],f=0;f<n[0].length;f++){for(var o=0,r=0;r<n.length;r++)o+=-.5*n[r][f]*h[r];s[f]=o}for(var d=0;d<e.length;d++){for(var u=0,l=0;l<e.length;l++)u+=e[d][l]*s[l];i[d]=u}for(var N=0;N<n.length;N++){for(var g=0,E=0;E<n[0].length;E++)g+=n[N][E]*i[E];t[N]=g}return t},_.exports=c},function(_,b,T){var c=function(){function t(s,i){for(var f=0;f<i.length;f++){var o=i[f];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(s,o.key,o)}}return A(t,"defineProperties"),function(s,i,f){return i&&t(s.prototype,i),f&&t(s,f),s}}();function h(t,s){if(!(t instanceof s))throw new TypeError("Cannot call a class as a function")}A(h,"_classCallCheck");var n=T(11),e=function(){function t(s,i){h(this,t),(i!==null||i!==void 0)&&(this.compareFunction=this._defaultCompareFunction);var f=void 0;s instanceof n?f=s.size():f=s.length,this._quicksort(s,0,f-1)}return A(t,"Quicksort"),c(t,[{key:"_quicksort",value:A(function(s,i,f){if(i<f){var o=this._partition(s,i,f);this._quicksort(s,i,o),this._quicksort(s,o+1,f)}},"_quicksort")},{key:"_partition",value:A(function(s,i,f){for(var o=this._get(s,i),r=i,d=f;;){for(;this.compareFunction(o,this._get(s,d));)d--;for(;this.compareFunction(this._get(s,r),o);)r++;if(r<d)this._swap(s,r,d),r++,d--;else return d}},"_partition")},{key:"_get",value:A(function(s,i){return s instanceof n?s.get_object_at(i):s[i]},"_get")},{key:"_set",value:A(function(s,i,f){s instanceof n?s.set_object_at(i,f):s[i]=f},"_set")},{key:"_swap",value:A(function(s,i,f){var o=this._get(s,i);this._set(s,i,this._get(s,f)),this._set(s,f,o)},"_swap")},{key:"_defaultCompareFunction",value:A(function(s,i){return i>s},"_defaultCompareFunction")}]),t}();_.exports=e},function(_,b,T){function c(){}A(c,"SVD"),c.svd=function(h){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=h.length,this.n=h[0].length;var n=Math.min(this.m,this.n);this.s=function(Tt){for(var At=[];Tt-- >0;)At.push(0);return At}(Math.min(this.m+1,this.n)),this.U=function(Tt){var At=A(function St(Gt){if(Gt.length==0)return 0;for(var zt=[],jt=0;jt<Gt[0];jt++)zt.push(St(Gt.slice(1)));return zt},"allocate");return At(Tt)}([this.m,n]),this.V=function(Tt){var At=A(function St(Gt){if(Gt.length==0)return 0;for(var zt=[],jt=0;jt<Gt[0];jt++)zt.push(St(Gt.slice(1)));return zt},"allocate");return At(Tt)}([this.n,this.n]);for(var e=function(Tt){for(var At=[];Tt-- >0;)At.push(0);return At}(this.n),t=function(Tt){for(var At=[];Tt-- >0;)At.push(0);return At}(this.m),s=!0,i=!0,f=Math.min(this.m-1,this.n),o=Math.max(0,Math.min(this.n-2,this.m)),r=0;r<Math.max(f,o);r++){if(r<f){this.s[r]=0;for(var d=r;d<this.m;d++)this.s[r]=c.hypot(this.s[r],h[d][r]);if(this.s[r]!==0){h[r][r]<0&&(this.s[r]=-this.s[r]);for(var u=r;u<this.m;u++)h[u][r]/=this.s[r];h[r][r]+=1}this.s[r]=-this.s[r]}for(var l=r+1;l<this.n;l++){if(function(Tt,At){return Tt&&At}(r<f,this.s[r]!==0)){for(var N=0,g=r;g<this.m;g++)N+=h[g][r]*h[g][l];N=-N/h[r][r];for(var E=r;E<this.m;E++)h[E][l]+=N*h[E][r]}e[l]=h[r][l]}if(function(Tt,At){return Tt&&At}(s,r<f))for(var w=r;w<this.m;w++)this.U[w][r]=h[w][r];if(r<o){e[r]=0;for(var L=r+1;L<this.n;L++)e[r]=c.hypot(e[r],e[L]);if(e[r]!==0){e[r+1]<0&&(e[r]=-e[r]);for(var Y=r+1;Y<this.n;Y++)e[Y]/=e[r];e[r+1]+=1}if(e[r]=-e[r],function(Tt,At){return Tt&&At}(r+1<this.m,e[r]!==0)){for(var B=r+1;B<this.m;B++)t[B]=0;for(var P=r+1;P<this.n;P++)for(var X=r+1;X<this.m;X++)t[X]+=e[P]*h[X][P];for(var q=r+1;q<this.n;q++)for(var O=-e[q]/e[r+1],it=r+1;it<this.m;it++)h[it][q]+=O*t[it]}if(i)for(var a=r+1;a<this.n;a++)this.V[a][r]=e[a]}}var v=Math.min(this.n,this.m+1);if(f<this.n&&(this.s[f]=h[f][f]),this.m<v&&(this.s[v-1]=0),o+1<v&&(e[o]=h[o][v-1]),e[v-1]=0,s){for(var m=f;m<n;m++){for(var y=0;y<this.m;y++)this.U[y][m]=0;this.U[m][m]=1}for(var p=f-1;p>=0;p--)if(this.s[p]!==0){for(var D=p+1;D<n;D++){for(var x=0,R=p;R<this.m;R++)x+=this.U[R][p]*this.U[R][D];x=-x/this.U[p][p];for(var H=p;H<this.m;H++)this.U[H][D]+=x*this.U[H][p]}for(var z=p;z<this.m;z++)this.U[z][p]=-this.U[z][p];this.U[p][p]=1+this.U[p][p];for(var W=0;W<p-1;W++)this.U[W][p]=0}else{for(var j=0;j<this.m;j++)this.U[j][p]=0;this.U[p][p]=1}}if(i)for(var V=this.n-1;V>=0;V--){if(function(Tt,At){return Tt&&At}(V<o,e[V]!==0))for(var J=V+1;J<n;J++){for(var U=0,S=V+1;S<this.n;S++)U+=this.V[S][V]*this.V[S][J];U=-U/this.V[V+1][V];for(var F=V+1;F<this.n;F++)this.V[F][J]+=U*this.V[F][V]}for(var Z=0;Z<this.n;Z++)this.V[Z][V]=0;this.V[V][V]=1}for(var rt=v-1,ut=0,_t=Math.pow(2,-52),Mt=Math.pow(2,-966);v>0;){var k=void 0,nt=void 0;for(k=v-2;k>=-1&&k!==-1;k--)if(Math.abs(e[k])<=Mt+_t*(Math.abs(this.s[k])+Math.abs(this.s[k+1]))){e[k]=0;break}if(k===v-2)nt=4;else{var ht=void 0;for(ht=v-1;ht>=k&&ht!==k;ht--){var mt=(ht!==v?Math.abs(e[ht]):0)+(ht!==k+1?Math.abs(e[ht-1]):0);if(Math.abs(this.s[ht])<=Mt+_t*mt){this.s[ht]=0;break}}ht===k?nt=3:ht===v-1?nt=1:(nt=2,k=ht)}switch(k++,nt){case 1:{var Ct=e[v-2];e[v-2]=0;for(var vt=v-2;vt>=k;vt--){var yt=c.hypot(this.s[vt],Ct),xt=this.s[vt]/yt,Ht=Ct/yt;if(this.s[vt]=yt,vt!==k&&(Ct=-Ht*e[vt-1],e[vt-1]=xt*e[vt-1]),i)for(var Ft=0;Ft<this.n;Ft++)yt=xt*this.V[Ft][vt]+Ht*this.V[Ft][v-1],this.V[Ft][v-1]=-Ht*this.V[Ft][vt]+xt*this.V[Ft][v-1],this.V[Ft][vt]=yt}}break;case 2:{var Pt=e[k-1];e[k-1]=0;for(var Ot=k;Ot<v;Ot++){var Yt=c.hypot(this.s[Ot],Pt),Ut=this.s[Ot]/Yt,Wt=Pt/Yt;if(this.s[Ot]=Yt,Pt=-Wt*e[Ot],e[Ot]=Ut*e[Ot],s)for(var lt=0;lt<this.m;lt++)Yt=Ut*this.U[lt][Ot]+Wt*this.U[lt][k-1],this.U[lt][k-1]=-Wt*this.U[lt][Ot]+Ut*this.U[lt][k-1],this.U[lt][Ot]=Yt}}break;case 3:{var C=Math.max(Math.max(Math.max(Math.max(Math.abs(this.s[v-1]),Math.abs(this.s[v-2])),Math.abs(e[v-2])),Math.abs(this.s[k])),Math.abs(e[k])),G=this.s[v-1]/C,$=this.s[v-2]/C,K=e[v-2]/C,Q=this.s[k]/C,pt=e[k]/C,dt=(($+G)*($-G)+K*K)/2,tt=G*K*(G*K),ct=0;(function(Tt,At){return Tt||At})(dt!==0,tt!==0)&&(ct=Math.sqrt(dt*dt+tt),dt<0&&(ct=-ct),ct=tt/(dt+ct));for(var Et=(Q+G)*(Q-G)+ct,wt=Q*pt,et=k;et<v-1;et++){var It=c.hypot(Et,wt),ot=Et/It,st=wt/It;if(et!==k&&(e[et-1]=It),Et=ot*this.s[et]+st*e[et],e[et]=ot*e[et]-st*this.s[et],wt=st*this.s[et+1],this.s[et+1]=ot*this.s[et+1],i)for(var at=0;at<this.n;at++)It=ot*this.V[at][et]+st*this.V[at][et+1],this.V[at][et+1]=-st*this.V[at][et]+ot*this.V[at][et+1],this.V[at][et]=It;if(It=c.hypot(Et,wt),ot=Et/It,st=wt/It,this.s[et]=It,Et=ot*e[et]+st*this.s[et+1],this.s[et+1]=-st*e[et]+ot*this.s[et+1],wt=st*e[et+1],e[et+1]=ot*e[et+1],s&&et<this.m-1)for(var Nt=0;Nt<this.m;Nt++)It=ot*this.U[Nt][et]+st*this.U[Nt][et+1],this.U[Nt][et+1]=-st*this.U[Nt][et]+ot*this.U[Nt][et+1],this.U[Nt][et]=It}e[v-2]=Et,ut=ut+1}break;case 4:{if(this.s[k]<=0&&(this.s[k]=this.s[k]<0?-this.s[k]:0,i))for(var ft=0;ft<=rt;ft++)this.V[ft][k]=-this.V[ft][k];for(;k<rt&&!(this.s[k]>=this.s[k+1]);){var bt=this.s[k];if(this.s[k]=this.s[k+1],this.s[k+1]=bt,i&&k<this.n-1)for(var Dt=0;Dt<this.n;Dt++)bt=this.V[Dt][k+1],this.V[Dt][k+1]=this.V[Dt][k],this.V[Dt][k]=bt;if(s&&k<this.m-1)for(var Rt=0;Rt<this.m;Rt++)bt=this.U[Rt][k+1],this.U[Rt][k+1]=this.U[Rt][k],this.U[Rt][k]=bt;k++}ut=0,v--}break}}var Xt={U:this.U,V:this.V,S:this.s};return Xt},c.hypot=function(h,n){var e=void 0;return Math.abs(h)>Math.abs(n)?(e=n/h,e=Math.abs(h)*Math.sqrt(1+e*e)):n!=0?(e=h/n,e=Math.abs(n)*Math.sqrt(1+e*e)):e=0,e},_.exports=c},function(_,b,T){var c=function(){function e(t,s){for(var i=0;i<s.length;i++){var f=s[i];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(t,f.key,f)}}return A(e,"defineProperties"),function(t,s,i){return s&&e(t.prototype,s),i&&e(t,i),t}}();function h(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}A(h,"_classCallCheck");var n=function(){function e(t,s){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,f=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;h(this,e),this.sequence1=t,this.sequence2=s,this.match_score=i,this.mismatch_penalty=f,this.gap_penalty=o,this.iMax=t.length+1,this.jMax=s.length+1,this.grid=new Array(this.iMax);for(var r=0;r<this.iMax;r++){this.grid[r]=new Array(this.jMax);for(var d=0;d<this.jMax;d++)this.grid[r][d]=0}this.tracebackGrid=new Array(this.iMax);for(var u=0;u<this.iMax;u++){this.tracebackGrid[u]=new Array(this.jMax);for(var l=0;l<this.jMax;l++)this.tracebackGrid[u][l]=[null,null,null]}this.alignments=[],this.score=-1,this.computeGrids()}return A(e,"NeedlemanWunsch"),c(e,[{key:"getScore",value:A(function(){return this.score},"getScore")},{key:"getAlignments",value:A(function(){return this.alignments},"getAlignments")},{key:"computeGrids",value:A(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 s=1;s<this.iMax;s++)this.grid[s][0]=this.grid[s-1][0]+this.gap_penalty,this.tracebackGrid[s][0]=[!1,!0,!1];for(var i=1;i<this.iMax;i++)for(var f=1;f<this.jMax;f++){var o=void 0;this.sequence1[i-1]===this.sequence2[f-1]?o=this.grid[i-1][f-1]+this.match_score:o=this.grid[i-1][f-1]+this.mismatch_penalty;var r=this.grid[i-1][f]+this.gap_penalty,d=this.grid[i][f-1]+this.gap_penalty,u=[o,r,d],l=this.arrayAllMaxIndexes(u);this.grid[i][f]=u[l[0]],this.tracebackGrid[i][f]=[l.includes(0),l.includes(1),l.includes(2)]}this.score=this.grid[this.iMax-1][this.jMax-1]},"computeGrids")},{key:"alignmentTraceback",value:A(function(){var t=[];for(t.push({pos:[this.sequence1.length,this.sequence2.length],seq1:"",seq2:""});t[0];){var s=t[0],i=this.tracebackGrid[s.pos[0]][s.pos[1]];i[0]&&t.push({pos:[s.pos[0]-1,s.pos[1]-1],seq1:this.sequence1[s.pos[0]-1]+s.seq1,seq2:this.sequence2[s.pos[1]-1]+s.seq2}),i[1]&&t.push({pos:[s.pos[0]-1,s.pos[1]],seq1:this.sequence1[s.pos[0]-1]+s.seq1,seq2:"-"+s.seq2}),i[2]&&t.push({pos:[s.pos[0],s.pos[1]-1],seq1:"-"+s.seq1,seq2:this.sequence2[s.pos[1]-1]+s.seq2}),s.pos[0]===0&&s.pos[1]===0&&this.alignments.push({sequence1:s.seq1,sequence2:s.seq2}),t.shift()}return this.alignments},"alignmentTraceback")},{key:"getAllIndexes",value:A(function(t,s){for(var i=[],f=-1;(f=t.indexOf(s,f+1))!==-1;)i.push(f);return i},"getAllIndexes")},{key:"arrayAllMaxIndexes",value:A(function(t){return this.getAllIndexes(t,Math.max.apply(null,t))},"arrayAllMaxIndexes")}]),e}();_.exports=n},function(_,b,T){var c=A(function(){},"layoutBase");c.FDLayout=T(18),c.FDLayoutConstants=T(4),c.FDLayoutEdge=T(19),c.FDLayoutNode=T(20),c.DimensionD=T(21),c.HashMap=T(22),c.HashSet=T(23),c.IGeometry=T(8),c.IMath=T(9),c.Integer=T(10),c.Point=T(12),c.PointD=T(5),c.RandomSeed=T(16),c.RectangleD=T(13),c.Transform=T(17),c.UniqueIDGeneretor=T(14),c.Quicksort=T(25),c.LinkedList=T(11),c.LGraphObject=T(2),c.LGraph=T(6),c.LEdge=T(1),c.LGraphManager=T(7),c.LNode=T(3),c.Layout=T(15),c.LayoutConstants=T(0),c.NeedlemanWunsch=T(27),c.Matrix=T(24),c.SVD=T(26),_.exports=c},function(_,b,T){function c(){this.listeners=[]}A(c,"Emitter");var h=c.prototype;h.addListener=function(n,e){this.listeners.push({event:n,callback:e})},h.removeListener=function(n,e){for(var t=this.listeners.length;t>=0;t--){var s=this.listeners[t];s.event===n&&s.callback===e&&this.listeners.splice(t,1)}},h.emit=function(n,e){for(var t=0;t<this.listeners.length;t++){var s=this.listeners[t];n===s.event&&s.callback(e)}},_.exports=c}])})}),Le=pe((M,I)=>{A(function(_,b){typeof M=="object"&&typeof I=="object"?I.exports=b(we()):typeof define=="function"&&define.amd?define(["layout-base"],b):typeof M=="object"?M.coseBase=b(we()):_.coseBase=b(_.layoutBase)},"webpackUniversalModuleDefinition")(M,function(_){return(()=>{var b={45:(n,e,t)=>{var s={};s.layoutBase=t(551),s.CoSEConstants=t(806),s.CoSEEdge=t(767),s.CoSEGraph=t(880),s.CoSEGraphManager=t(578),s.CoSELayout=t(765),s.CoSENode=t(991),s.ConstraintHandler=t(902),n.exports=s},806:(n,e,t)=>{var s=t(551).FDLayoutConstants;function i(){}A(i,"CoSEConstants");for(var f in s)i[f]=s[f];i.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,i.DEFAULT_RADIAL_SEPARATION=s.DEFAULT_EDGE_LENGTH,i.DEFAULT_COMPONENT_SEPERATION=60,i.TILE=!0,i.TILING_PADDING_VERTICAL=10,i.TILING_PADDING_HORIZONTAL=10,i.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,i.ENFORCE_CONSTRAINTS=!0,i.APPLY_LAYOUT=!0,i.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,i.TREE_REDUCTION_ON_INCREMENTAL=!0,i.PURE_INCREMENTAL=i.DEFAULT_INCREMENTAL,n.exports=i},767:(n,e,t)=>{var s=t(551).FDLayoutEdge;function i(o,r,d){s.call(this,o,r,d)}A(i,"CoSEEdge"),i.prototype=Object.create(s.prototype);for(var f in s)i[f]=s[f];n.exports=i},880:(n,e,t)=>{var s=t(551).LGraph;function i(o,r,d){s.call(this,o,r,d)}A(i,"CoSEGraph"),i.prototype=Object.create(s.prototype);for(var f in s)i[f]=s[f];n.exports=i},578:(n,e,t)=>{var s=t(551).LGraphManager;function i(o){s.call(this,o)}A(i,"CoSEGraphManager"),i.prototype=Object.create(s.prototype);for(var f in s)i[f]=s[f];n.exports=i},765:(n,e,t)=>{var s=t(551).FDLayout,i=t(578),f=t(880),o=t(991),r=t(767),d=t(806),u=t(902),l=t(551).FDLayoutConstants,N=t(551).LayoutConstants,g=t(551).Point,E=t(551).PointD,w=t(551).DimensionD,L=t(551).Layout,Y=t(551).Integer,B=t(551).IGeometry,P=t(551).LGraph,X=t(551).Transform,q=t(551).LinkedList;function O(){s.call(this),this.toBeTiled={},this.constraints={}}A(O,"CoSELayout"),O.prototype=Object.create(s.prototype);for(var it in s)O[it]=s[it];O.prototype.newGraphManager=function(){var a=new i(this);return this.graphManager=a,a},O.prototype.newGraph=function(a){return new f(null,this.graphManager,a)},O.prototype.newNode=function(a){return new o(this.graphManager,a)},O.prototype.newEdge=function(a){return new r(null,null,a)},O.prototype.initParameters=function(){s.prototype.initParameters.call(this,arguments),this.isSubLayout||(d.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=d.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=d.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=l.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=l.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=l.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},O.prototype.initSpringEmbedder=function(){s.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/l.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},O.prototype.layout=function(){var a=N.DEFAULT_CREATE_BENDS_AS_NEEDED;return a&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},O.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),this.incremental){if(d.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var a=new Set(this.getAllNodes()),v=this.nodesWithGravity.filter(function(y){return a.has(y)});this.graphManager.setAllNodesToApplyGravitation(v)}}else{var m=this.getFlatForest();if(m.length>0)this.positionNodesRadially(m);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var a=new Set(this.getAllNodes()),v=this.nodesWithGravity.filter(function(D){return a.has(D)});this.graphManager.setAllNodesToApplyGravitation(v),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(u.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),d.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},O.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%l.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var a=new Set(this.getAllNodes()),v=this.nodesWithGravity.filter(function(p){return a.has(p)});this.graphManager.setAllNodesToApplyGravitation(v),this.graphManager.updateBounds(),this.updateGrid(),d.PURE_INCREMENTAL?this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),d.PURE_INCREMENTAL?this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var m=!this.isTreeGrowing&&!this.isGrowthFinished,y=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(m,y),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},O.prototype.getPositionsData=function(){for(var a=this.graphManager.getAllNodes(),v={},m=0;m<a.length;m++){var y=a[m].rect,p=a[m].id;v[p]={id:p,x:y.getCenterX(),y:y.getCenterY(),w:y.width,h:y.height}}return v},O.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var a=!1;if(l.ANIMATE==="during")this.emit("layoutstarted");else{for(;!a;)a=this.tick();this.graphManager.updateBounds()}},O.prototype.moveNodes=function(){for(var a=this.getAllNodes(),v,m=0;m<a.length;m++)v=a[m],v.calculateDisplacement();Object.keys(this.constraints).length>0&&this.updateDisplacements();for(var m=0;m<a.length;m++)v=a[m],v.move()},O.prototype.initConstraintVariables=function(){var a=this;this.idToNodeMap=new Map,this.fixedNodeSet=new Set;for(var v=this.graphManager.getAllNodes(),m=0;m<v.length;m++){var y=v[m];this.idToNodeMap.set(y.id,y)}var p=A(function S(F){for(var Z=F.getChild().getNodes(),rt,ut=0,_t=0;_t<Z.length;_t++)rt=Z[_t],rt.getChild()==null?a.fixedNodeSet.has(rt.id)&&(ut+=100):ut+=S(rt);return ut},"calculateCompoundWeight");if(this.constraints.fixedNodeConstraint){this.constraints.fixedNodeConstraint.forEach(function(S){a.fixedNodeSet.add(S.nodeId)});for(var v=this.graphManager.getAllNodes(),y,m=0;m<v.length;m++)if(y=v[m],y.getChild()!=null){var D=p(y);D>0&&(y.fixedNodeWeight=D)}}if(this.constraints.relativePlacementConstraint){var x=new Map,R=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(S){a.fixedNodesOnHorizontal.add(S),a.fixedNodesOnVertical.add(S)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var H=this.constraints.alignmentConstraint.vertical,m=0;m<H.length;m++)this.dummyToNodeForVerticalAlignment.set("dummy"+m,[]),H[m].forEach(function(F){x.set(F,"dummy"+m),a.dummyToNodeForVerticalAlignment.get("dummy"+m).push(F),a.fixedNodeSet.has(F)&&a.fixedNodesOnHorizontal.add("dummy"+m)});if(this.constraints.alignmentConstraint.horizontal)for(var z=this.constraints.alignmentConstraint.horizontal,m=0;m<z.length;m++)this.dummyToNodeForHorizontalAlignment.set("dummy"+m,[]),z[m].forEach(function(F){R.set(F,"dummy"+m),a.dummyToNodeForHorizontalAlignment.get("dummy"+m).push(F),a.fixedNodeSet.has(F)&&a.fixedNodesOnVertical.add("dummy"+m)})}if(d.RELAX_MOVEMENT_ON_CONSTRAINTS)this.shuffle=function(S){var F,Z,rt;for(rt=S.length-1;rt>=2*S.length/3;rt--)F=Math.floor(Math.random()*(rt+1)),Z=S[rt],S[rt]=S[F],S[F]=Z;return S},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(S){if(S.left){var F=x.has(S.left)?x.get(S.left):S.left,Z=x.has(S.right)?x.get(S.right):S.right;a.nodesInRelativeHorizontal.includes(F)||(a.nodesInRelativeHorizontal.push(F),a.nodeToRelativeConstraintMapHorizontal.set(F,[]),a.dummyToNodeForVerticalAlignment.has(F)?a.nodeToTempPositionMapHorizontal.set(F,a.idToNodeMap.get(a.dummyToNodeForVerticalAlignment.get(F)[0]).getCenterX()):a.nodeToTempPositionMapHorizontal.set(F,a.idToNodeMap.get(F).getCenterX())),a.nodesInRelativeHorizontal.includes(Z)||(a.nodesInRelativeHorizontal.push(Z),a.nodeToRelativeConstraintMapHorizontal.set(Z,[]),a.dummyToNodeForVerticalAlignment.has(Z)?a.nodeToTempPositionMapHorizontal.set(Z,a.idToNodeMap.get(a.dummyToNodeForVerticalAlignment.get(Z)[0]).getCenterX()):a.nodeToTempPositionMapHorizontal.set(Z,a.idToNodeMap.get(Z).getCenterX())),a.nodeToRelativeConstraintMapHorizontal.get(F).push({right:Z,gap:S.gap}),a.nodeToRelativeConstraintMapHorizontal.get(Z).push({left:F,gap:S.gap})}else{var rt=R.has(S.top)?R.get(S.top):S.top,ut=R.has(S.bottom)?R.get(S.bottom):S.bottom;a.nodesInRelativeVertical.includes(rt)||(a.nodesInRelativeVertical.push(rt),a.nodeToRelativeConstraintMapVertical.set(rt,[]),a.dummyToNodeForHorizontalAlignment.has(rt)?a.nodeToTempPositionMapVertical.set(rt,a.idToNodeMap.get(a.dummyToNodeForHorizontalAlignment.get(rt)[0]).getCenterY()):a.nodeToTempPositionMapVertical.set(rt,a.idToNodeMap.get(rt).getCenterY())),a.nodesInRelativeVertical.includes(ut)||(a.nodesInRelativeVertical.push(ut),a.nodeToRelativeConstraintMapVertical.set(ut,[]),a.dummyToNodeForHorizontalAlignment.has(ut)?a.nodeToTempPositionMapVertical.set(ut,a.idToNodeMap.get(a.dummyToNodeForHorizontalAlignment.get(ut)[0]).getCenterY()):a.nodeToTempPositionMapVertical.set(ut,a.idToNodeMap.get(ut).getCenterY())),a.nodeToRelativeConstraintMapVertical.get(rt).push({bottom:ut,gap:S.gap}),a.nodeToRelativeConstraintMapVertical.get(ut).push({top:rt,gap:S.gap})}});else{var W=new Map,j=new Map;this.constraints.relativePlacementConstraint.forEach(function(S){if(S.left){var F=x.has(S.left)?x.get(S.left):S.left,Z=x.has(S.right)?x.get(S.right):S.right;W.has(F)?W.get(F).push(Z):W.set(F,[Z]),W.has(Z)?W.get(Z).push(F):W.set(Z,[F])}else{var rt=R.has(S.top)?R.get(S.top):S.top,ut=R.has(S.bottom)?R.get(S.bottom):S.bottom;j.has(rt)?j.get(rt).push(ut):j.set(rt,[ut]),j.has(ut)?j.get(ut).push(rt):j.set(ut,[rt])}});var V=A(function(S,F){var Z=[],rt=[],ut=new q,_t=new Set,Mt=0;return S.forEach(function(k,nt){if(!_t.has(nt)){Z[Mt]=[],rt[Mt]=!1;var ht=nt;for(ut.push(ht),_t.add(ht),Z[Mt].push(ht);ut.length!=0;){ht=ut.shift(),F.has(ht)&&(rt[Mt]=!0);var mt=S.get(ht);mt.forEach(function(Ct){_t.has(Ct)||(ut.push(Ct),_t.add(Ct),Z[Mt].push(Ct))})}Mt++}}),{components:Z,isFixed:rt}},"constructComponents"),J=V(W,a.fixedNodesOnHorizontal);this.componentsOnHorizontal=J.components,this.fixedComponentsOnHorizontal=J.isFixed;var U=V(j,a.fixedNodesOnVertical);this.componentsOnVertical=U.components,this.fixedComponentsOnVertical=U.isFixed}}},O.prototype.updateDisplacements=function(){var a=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function(U){var S=a.idToNodeMap.get(U.nodeId);S.displacementX=0,S.displacementY=0}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var v=this.constraints.alignmentConstraint.vertical,m=0;m<v.length;m++){for(var y=0,p=0;p<v[m].length;p++){if(this.fixedNodeSet.has(v[m][p])){y=0;break}y+=this.idToNodeMap.get(v[m][p]).displacementX}for(var D=y/v[m].length,p=0;p<v[m].length;p++)this.idToNodeMap.get(v[m][p]).displacementX=D}if(this.constraints.alignmentConstraint.horizontal)for(var x=this.constraints.alignmentConstraint.horizontal,m=0;m<x.length;m++){for(var R=0,p=0;p<x[m].length;p++){if(this.fixedNodeSet.has(x[m][p])){R=0;break}R+=this.idToNodeMap.get(x[m][p]).displacementY}for(var H=R/x[m].length,p=0;p<x[m].length;p++)this.idToNodeMap.get(x[m][p]).displacementY=H}}if(this.constraints.relativePlacementConstraint)if(d.RELAX_MOVEMENT_ON_CONSTRAINTS)this.totalIterations%10==0&&(this.shuffle(this.nodesInRelativeHorizontal),this.shuffle(this.nodesInRelativeVertical)),this.nodesInRelativeHorizontal.forEach(function(U){if(!a.fixedNodesOnHorizontal.has(U)){var S=0;a.dummyToNodeForVerticalAlignment.has(U)?S=a.idToNodeMap.get(a.dummyToNodeForVerticalAlignment.get(U)[0]).displacementX:S=a.idToNodeMap.get(U).displacementX,a.nodeToRelativeConstraintMapHorizontal.get(U).forEach(function(F){if(F.right){var Z=a.nodeToTempPositionMapHorizontal.get(F.right)-a.nodeToTempPositionMapHorizontal.get(U)-S;Z<F.gap&&(S-=F.gap-Z)}else{var Z=a.nodeToTempPositionMapHorizontal.get(U)-a.nodeToTempPositionMapHorizontal.get(F.left)+S;Z<F.gap&&(S+=F.gap-Z)}}),a.nodeToTempPositionMapHorizontal.set(U,a.nodeToTempPositionMapHorizontal.get(U)+S),a.dummyToNodeForVerticalAlignment.has(U)?a.dummyToNodeForVerticalAlignment.get(U).forEach(function(F){a.idToNodeMap.get(F).displacementX=S}):a.idToNodeMap.get(U).displacementX=S}}),this.nodesInRelativeVertical.forEach(function(U){if(!a.fixedNodesOnHorizontal.has(U)){var S=0;a.dummyToNodeForHorizontalAlignment.has(U)?S=a.idToNodeMap.get(a.dummyToNodeForHorizontalAlignment.get(U)[0]).displacementY:S=a.idToNodeMap.get(U).displacementY,a.nodeToRelativeConstraintMapVertical.get(U).forEach(function(F){if(F.bottom){var Z=a.nodeToTempPositionMapVertical.get(F.bottom)-a.nodeToTempPositionMapVertical.get(U)-S;Z<F.gap&&(S-=F.gap-Z)}else{var Z=a.nodeToTempPositionMapVertical.get(U)-a.nodeToTempPositionMapVertical.get(F.top)+S;Z<F.gap&&(S+=F.gap-Z)}}),a.nodeToTempPositionMapVertical.set(U,a.nodeToTempPositionMapVertical.get(U)+S),a.dummyToNodeForHorizontalAlignment.has(U)?a.dummyToNodeForHorizontalAlignment.get(U).forEach(function(F){a.idToNodeMap.get(F).displacementY=S}):a.idToNodeMap.get(U).displacementY=S}});else{for(var m=0;m<this.componentsOnHorizontal.length;m++){var z=this.componentsOnHorizontal[m];if(this.fixedComponentsOnHorizontal[m])for(var p=0;p<z.length;p++)this.dummyToNodeForVerticalAlignment.has(z[p])?this.dummyToNodeForVerticalAlignment.get(z[p]).forEach(function(F){a.idToNodeMap.get(F).displacementX=0}):this.idToNodeMap.get(z[p]).displacementX=0;else{for(var W=0,j=0,p=0;p<z.length;p++)if(this.dummyToNodeForVerticalAlignment.has(z[p])){var V=this.dummyToNodeForVerticalAlignment.get(z[p]);W+=V.length*this.idToNodeMap.get(V[0]).displacementX,j+=V.length}else W+=this.idToNodeMap.get(z[p]).displacementX,j++;for(var J=W/j,p=0;p<z.length;p++)this.dummyToNodeForVerticalAlignment.has(z[p])?this.dummyToNodeForVerticalAlignment.get(z[p]).forEach(function(F){a.idToNodeMap.get(F).displacementX=J}):this.idToNodeMap.get(z[p]).displacementX=J}}for(var m=0;m<this.componentsOnVertical.length;m++){var z=this.componentsOnVertical[m];if(this.fixedComponentsOnVertical[m])for(var p=0;p<z.length;p++)this.dummyToNodeForHorizontalAlignment.has(z[p])?this.dummyToNodeForHorizontalAlignment.get(z[p]).forEach(function(Z){a.idToNodeMap.get(Z).displacementY=0}):this.idToNodeMap.get(z[p]).displacementY=0;else{for(var W=0,j=0,p=0;p<z.length;p++)if(this.dummyToNodeForHorizontalAlignment.has(z[p])){var V=this.dummyToNodeForHorizontalAlignment.get(z[p]);W+=V.length*this.idToNodeMap.get(V[0]).displacementY,j+=V.length}else W+=this.idToNodeMap.get(z[p]).displacementY,j++;for(var J=W/j,p=0;p<z.length;p++)this.dummyToNodeForHorizontalAlignment.has(z[p])?this.dummyToNodeForHorizontalAlignment.get(z[p]).forEach(function(rt){a.idToNodeMap.get(rt).displacementY=J}):this.idToNodeMap.get(z[p]).displacementY=J}}}},O.prototype.calculateNodesToApplyGravitationTo=function(){var a=[],v,m=this.graphManager.getGraphs(),y=m.length,p;for(p=0;p<y;p++)v=m[p],v.updateConnected(),v.isConnected||(a=a.concat(v.getNodes()));return a},O.prototype.createBendpoints=function(){var a=[];a=a.concat(this.graphManager.getAllEdges());var v=new Set,m;for(m=0;m<a.length;m++){var y=a[m];if(!v.has(y)){var p=y.getSource(),D=y.getTarget();if(p==D)y.getBendpoints().push(new E),y.getBendpoints().push(new E),this.createDummyNodesForBendpoints(y),v.add(y);else{var x=[];if(x=x.concat(p.getEdgeListToNode(D)),x=x.concat(D.getEdgeListToNode(p)),!v.has(x[0])){if(x.length>1){var R;for(R=0;R<x.length;R++){var H=x[R];H.getBendpoints().push(new E),this.createDummyNodesForBendpoints(H)}}x.forEach(function(z){v.add(z)})}}}if(v.size==a.length)break}},O.prototype.positionNodesRadially=function(a){for(var v=new g(0,0),m=Math.ceil(Math.sqrt(a.length)),y=0,p=0,D=0,x=new E(0,0),R=0;R<a.length;R++){R%m==0&&(D=0,p=y,R!=0&&(p+=d.DEFAULT_COMPONENT_SEPERATION),y=0);var H=a[R],z=L.findCenterOfTree(H);v.x=D,v.y=p,x=O.radialLayout(H,z,v),x.y>y&&(y=Math.floor(x.y)),D=Math.floor(x.x+d.DEFAULT_COMPONENT_SEPERATION)}this.transform(new E(N.WORLD_CENTER_X-x.x/2,N.WORLD_CENTER_Y-x.y/2))},O.radialLayout=function(a,v,m){var y=Math.max(this.maxDiagonalInTree(a),d.DEFAULT_RADIAL_SEPARATION);O.branchRadialLayout(v,null,0,359,0,y);var p=P.calculateBounds(a),D=new X;D.setDeviceOrgX(p.getMinX()),D.setDeviceOrgY(p.getMinY()),D.setWorldOrgX(m.x),D.setWorldOrgY(m.y);for(var x=0;x<a.length;x++){var R=a[x];R.transform(D)}var H=new E(p.getMaxX(),p.getMaxY());return D.inverseTransformPoint(H)},O.branchRadialLayout=function(a,v,m,y,p,D){var x=(y-m+1)/2;x<0&&(x+=180);var R=(x+m)%360,H=R*B.TWO_PI/360,z=p*Math.cos(H),W=p*Math.sin(H);a.setCenter(z,W);var j=[];j=j.concat(a.getEdges());var V=j.length;v!=null&&V--;for(var J=0,U=j.length,S,F=a.getEdgesBetween(v);F.length>1;){var Z=F[0];F.splice(0,1);var rt=j.indexOf(Z);rt>=0&&j.splice(rt,1),U--,V--}v!=null?S=(j.indexOf(F[0])+1)%U:S=0;for(var ut=Math.abs(y-m)/V,_t=S;J!=V;_t=++_t%U){var Mt=j[_t].getOtherEnd(a);if(Mt!=v){var k=(m+J*ut)%360,nt=(k+ut)%360;O.branchRadialLayout(Mt,a,k,nt,p+D,D),J++}}},O.maxDiagonalInTree=function(a){for(var v=Y.MIN_VALUE,m=0;m<a.length;m++){var y=a[m],p=y.getDiagonal();p>v&&(v=p)}return v},O.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},O.prototype.groupZeroDegreeMembers=function(){var a=this,v={};this.memberGroups={},this.idToDummyNode={};for(var m=[],y=this.graphManager.getAllNodes(),p=0;p<y.length;p++){var D=y[p],x=D.getParent();this.getNodeDegreeWithChildren(D)===0&&(x.id==null||!this.getToBeTiled(x))&&m.push(D)}for(var p=0;p<m.length;p++){var D=m[p],R=D.getParent().id;typeof v[R]>"u"&&(v[R]=[]),v[R]=v[R].concat(D)}Object.keys(v).forEach(function(H){if(v[H].length>1){var z="DummyCompound_"+H;a.memberGroups[z]=v[H];var W=v[H][0].getParent(),j=new o(a.graphManager);j.id=z,j.paddingLeft=W.paddingLeft||0,j.paddingRight=W.paddingRight||0,j.paddingBottom=W.paddingBottom||0,j.paddingTop=W.paddingTop||0,a.idToDummyNode[z]=j;var V=a.getGraphManager().add(a.newGraph(),j),J=W.getChild();J.add(j);for(var U=0;U<v[H].length;U++){var S=v[H][U];J.remove(S),V.add(S)}}})},O.prototype.clearCompounds=function(){var a={},v={};this.performDFSOnCompounds();for(var m=0;m<this.compoundOrder.length;m++)v[this.compoundOrder[m].id]=this.compoundOrder[m],a[this.compoundOrder[m].id]=[].concat(this.compoundOrder[m].getChild().getNodes()),this.graphManager.remove(this.compoundOrder[m].getChild()),this.compoundOrder[m].child=null;this.graphManager.resetAllNodes(),this.tileCompoundMembers(a,v)},O.prototype.clearZeroDegreeMembers=function(){var a=this,v=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach(function(m){var y=a.idToDummyNode[m];if(v[m]=a.tileNodes(a.memberGroups[m],y.paddingLeft+y.paddingRight),y.rect.width=v[m].width,y.rect.height=v[m].height,y.setCenter(v[m].centerX,v[m].centerY),y.labelMarginLeft=0,y.labelMarginTop=0,d.NODE_DIMENSIONS_INCLUDE_LABELS){var p=y.rect.width,D=y.rect.height;y.labelWidth&&(y.labelPosHorizontal=="left"?(y.rect.x-=y.labelWidth,y.setWidth(p+y.labelWidth),y.labelMarginLeft=y.labelWidth):y.labelPosHorizontal=="center"&&y.labelWidth>p?(y.rect.x-=(y.labelWidth-p)/2,y.setWidth(y.labelWidth),y.labelMarginLeft=(y.labelWidth-p)/2):y.labelPosHorizontal=="right"&&y.setWidth(p+y.labelWidth)),y.labelHeight&&(y.labelPosVertical=="top"?(y.rect.y-=y.labelHeight,y.setHeight(D+y.labelHeight),y.labelMarginTop=y.labelHeight):y.labelPosVertical=="center"&&y.labelHeight>D?(y.rect.y-=(y.labelHeight-D)/2,y.setHeight(y.labelHeight),y.labelMarginTop=(y.labelHeight-D)/2):y.labelPosVertical=="bottom"&&y.setHeight(D+y.labelHeight))}})},O.prototype.repopulateCompounds=function(){for(var a=this.compoundOrder.length-1;a>=0;a--){var v=this.compoundOrder[a],m=v.id,y=v.paddingLeft,p=v.paddingTop,D=v.labelMarginLeft,x=v.labelMarginTop;this.adjustLocations(this.tiledMemberPack[m],v.rect.x,v.rect.y,y,p,D,x)}},O.prototype.repopulateZeroDegreeMembers=function(){var a=this,v=this.tiledZeroDegreePack;Object.keys(v).forEach(function(m){var y=a.idToDummyNode[m],p=y.paddingLeft,D=y.paddingTop,x=y.labelMarginLeft,R=y.labelMarginTop;a.adjustLocations(v[m],y.rect.x,y.rect.y,p,D,x,R)})},O.prototype.getToBeTiled=function(a){var v=a.id;if(this.toBeTiled[v]!=null)return this.toBeTiled[v];var m=a.getChild();if(m==null)return this.toBeTiled[v]=!1,!1;for(var y=m.getNodes(),p=0;p<y.length;p++){var D=y[p];if(this.getNodeDegree(D)>0)return this.toBeTiled[v]=!1,!1;if(D.getChild()==null){this.toBeTiled[D.id]=!1;continue}if(!this.getToBeTiled(D))return this.toBeTiled[v]=!1,!1}return this.toBeTiled[v]=!0,!0},O.prototype.getNodeDegree=function(a){for(var v=a.id,m=a.getEdges(),y=0,p=0;p<m.length;p++){var D=m[p];D.getSource().id!==D.getTarget().id&&(y=y+1)}return y},O.prototype.getNodeDegreeWithChildren=function(a){var v=this.getNodeDegree(a);if(a.getChild()==null)return v;for(var m=a.getChild().getNodes(),y=0;y<m.length;y++){var p=m[y];v+=this.getNodeDegreeWithChildren(p)}return v},O.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},O.prototype.fillCompexOrderByDFS=function(a){for(var v=0;v<a.length;v++){var m=a[v];m.getChild()!=null&&this.fillCompexOrderByDFS(m.getChild().getNodes()),this.getToBeTiled(m)&&this.compoundOrder.push(m)}},O.prototype.adjustLocations=function(a,v,m,y,p,D,x){v+=y+D,m+=p+x;for(var R=v,H=0;H<a.rows.length;H++){var z=a.rows[H];v=R;for(var W=0,j=0;j<z.length;j++){var V=z[j];V.rect.x=v,V.rect.y=m,v+=V.rect.width+a.horizontalPadding,V.rect.height>W&&(W=V.rect.height)}m+=W+a.verticalPadding}},O.prototype.tileCompoundMembers=function(a,v){var m=this;this.tiledMemberPack=[],Object.keys(a).forEach(function(y){var p=v[y];if(m.tiledMemberPack[y]=m.tileNodes(a[y],p.paddingLeft+p.paddingRight),p.rect.width=m.tiledMemberPack[y].width,p.rect.height=m.tiledMemberPack[y].height,p.setCenter(m.tiledMemberPack[y].centerX,m.tiledMemberPack[y].centerY),p.labelMarginLeft=0,p.labelMarginTop=0,d.NODE_DIMENSIONS_INCLUDE_LABELS){var D=p.rect.width,x=p.rect.height;p.labelWidth&&(p.labelPosHorizontal=="left"?(p.rect.x-=p.labelWidth,p.setWidth(D+p.labelWidth),p.labelMarginLeft=p.labelWidth):p.labelPosHorizontal=="center"&&p.labelWidth>D?(p.rect.x-=(p.labelWidth-D)/2,p.setWidth(p.labelWidth),p.labelMarginLeft=(p.labelWidth-D)/2):p.labelPosHorizontal=="right"&&p.setWidth(D+p.labelWidth)),p.labelHeight&&(p.labelPosVertical=="top"?(p.rect.y-=p.labelHeight,p.setHeight(x+p.labelHeight),p.labelMarginTop=p.labelHeight):p.labelPosVertical=="center"&&p.labelHeight>x?(p.rect.y-=(p.labelHeight-x)/2,p.setHeight(p.labelHeight),p.labelMarginTop=(p.labelHeight-x)/2):p.labelPosVertical=="bottom"&&p.setHeight(x+p.labelHeight))}})},O.prototype.tileNodes=function(a,v){var m=this.tileNodesByFavoringDim(a,v,!0),y=this.tileNodesByFavoringDim(a,v,!1),p=this.getOrgRatio(m),D=this.getOrgRatio(y),x;return D<p?x=y:x=m,x},O.prototype.getOrgRatio=function(a){var v=a.width,m=a.height,y=v/m;return y<1&&(y=1/y),y},O.prototype.calcIdealRowWidth=function(a,v){var m=d.TILING_PADDING_VERTICAL,y=d.TILING_PADDING_HORIZONTAL,p=a.length,D=0,x=0,R=0;a.forEach(function(U){D+=U.getWidth(),x+=U.getHeight(),U.getWidth()>R&&(R=U.getWidth())});var H=D/p,z=x/p,W=Math.pow(m-y,2)+4*(H+y)*(z+m)*p,j=(y-m+Math.sqrt(W))/(2*(H+y)),V;v?(V=Math.ceil(j),V==j&&V++):V=Math.floor(j);var J=V*(H+y)-y;return R>J&&(J=R),J+=y*2,J},O.prototype.tileNodesByFavoringDim=function(a,v,m){var y=d.TILING_PADDING_VERTICAL,p=d.TILING_PADDING_HORIZONTAL,D=d.TILING_COMPARE_BY,x={rows:[],rowWidth:[],rowHeight:[],width:0,height:v,verticalPadding:y,horizontalPadding:p,centerX:0,centerY:0};D&&(x.idealRowWidth=this.calcIdealRowWidth(a,m));var R=A(function(U){return U.rect.width*U.rect.height},"getNodeArea"),H=A(function(U,S){return R(S)-R(U)},"areaCompareFcn");a.sort(function(U,S){var F=H;return x.idealRowWidth?(F=D,F(U.id,S.id)):F(U,S)});for(var z=0,W=0,j=0;j<a.length;j++){var V=a[j];z+=V.getCenterX(),W+=V.getCenterY()}x.centerX=z/a.length,x.centerY=W/a.length;for(var j=0;j<a.length;j++){var V=a[j];if(x.rows.length==0)this.insertNodeToRow(x,V,0,v);else if(this.canAddHorizontal(x,V.rect.width,V.rect.height)){var J=x.rows.length-1;x.idealRowWidth||(J=this.getShortestRowIndex(x)),this.insertNodeToRow(x,V,J,v)}else this.insertNodeToRow(x,V,x.rows.length,v);this.shiftToLastRow(x)}return x},O.prototype.insertNodeToRow=function(a,v,m,y){var p=y;if(m==a.rows.length){var D=[];a.rows.push(D),a.rowWidth.push(p),a.rowHeight.push(0)}var x=a.rowWidth[m]+v.rect.width;a.rows[m].length>0&&(x+=a.horizontalPadding),a.rowWidth[m]=x,a.width<x&&(a.width=x);var R=v.rect.height;m>0&&(R+=a.verticalPadding);var H=0;R>a.rowHeight[m]&&(H=a.rowHeight[m],a.rowHeight[m]=R,H=a.rowHeight[m]-H),a.height+=H,a.rows[m].push(v)},O.prototype.getShortestRowIndex=function(a){for(var v=-1,m=Number.MAX_VALUE,y=0;y<a.rows.length;y++)a.rowWidth[y]<m&&(v=y,m=a.rowWidth[y]);return v},O.prototype.getLongestRowIndex=function(a){for(var v=-1,m=Number.MIN_VALUE,y=0;y<a.rows.length;y++)a.rowWidth[y]>m&&(v=y,m=a.rowWidth[y]);return v},O.prototype.canAddHorizontal=function(a,v,m){if(a.idealRowWidth){var y=a.rows.length-1,p=a.rowWidth[y];return p+v+a.horizontalPadding<=a.idealRowWidth}var D=this.getShortestRowIndex(a);if(D<0)return!0;var x=a.rowWidth[D];if(x+a.horizontalPadding+v<=a.width)return!0;var R=0;a.rowHeight[D]<m&&D>0&&(R=m+a.verticalPadding-a.rowHeight[D]);var H;a.width-x>=v+a.horizontalPadding?H=(a.height+R)/(x+v+a.horizontalPadding):H=(a.height+R)/a.width,R=m+a.verticalPadding;var z;return a.width<v?z=(a.height+R)/v:z=(a.height+R)/a.width,z<1&&(z=1/z),H<1&&(H=1/H),H<z},O.prototype.shiftToLastRow=function(a){var v=this.getLongestRowIndex(a),m=a.rowWidth.length-1,y=a.rows[v],p=y[y.length-1],D=p.width+a.horizontalPadding;if(a.width-a.rowWidth[m]>D&&v!=m){y.splice(-1,1),a.rows[m].push(p),a.rowWidth[v]=a.rowWidth[v]-D,a.rowWidth[m]=a.rowWidth[m]+D,a.width=a.rowWidth[instance.getLongestRowIndex(a)];for(var x=Number.MIN_VALUE,R=0;R<y.length;R++)y[R].height>x&&(x=y[R].height);v>0&&(x+=a.verticalPadding);var H=a.rowHeight[v]+a.rowHeight[m];a.rowHeight[v]=x,a.rowHeight[m]<p.height+a.verticalPadding&&(a.rowHeight[m]=p.height+a.verticalPadding);var z=a.rowHeight[v]+a.rowHeight[m];a.height+=z-H,this.shiftToLastRow(a)}},O.prototype.tilingPreLayout=function(){d.TILE&&(this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers())},O.prototype.tilingPostLayout=function(){d.TILE&&(this.repopulateZeroDegreeMembers(),this.repopulateCompounds())},O.prototype.reduceTrees=function(){for(var a=[],v=!0,m;v;){var y=this.graphManager.getAllNodes(),p=[];v=!1;for(var D=0;D<y.length;D++)if(m=y[D],m.getEdges().length==1&&!m.getEdges()[0].isInterGraph&&m.getChild()==null){if(d.PURE_INCREMENTAL){var x=m.getEdges()[0].getOtherEnd(m),R=new w(m.getCenterX()-x.getCenterX(),m.getCenterY()-x.getCenterY());p.push([m,m.getEdges()[0],m.getOwner(),R])}else p.push([m,m.getEdges()[0],m.getOwner()]);v=!0}if(v==!0){for(var H=[],z=0;z<p.length;z++)p[z][0].getEdges().length==1&&(H.push(p[z]),p[z][0].getOwner().remove(p[z][0]));a.push(H),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=a},O.prototype.growTree=function(a){for(var v=a.length,m=a[v-1],y,p=0;p<m.length;p++)y=m[p],this.findPlaceforPrunedNode(y),y[2].add(y[0]),y[2].add(y[1],y[1].source,y[1].target);a.splice(a.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},O.prototype.findPlaceforPrunedNode=function(a){var v,m,y=a[0];if(y==a[1].source?m=a[1].target:m=a[1].source,d.PURE_INCREMENTAL)y.setCenter(m.getCenterX()+a[3].getWidth(),m.getCenterY()+a[3].getHeight());else{var p=m.startX,D=m.finishX,x=m.startY,R=m.finishY,H=0,z=0,W=0,j=0,V=[H,W,z,j];if(x>0)for(var J=p;J<=D;J++)V[0]+=this.grid[J][x-1].length+this.grid[J][x].length-1;if(D<this.grid.length-1)for(var J=x;J<=R;J++)V[1]+=this.grid[D+1][J].length+this.grid[D][J].length-1;if(R<this.grid[0].length-1)for(var J=p;J<=D;J++)V[2]+=this.grid[J][R+1].length+this.grid[J][R].length-1;if(p>0)for(var J=x;J<=R;J++)V[3]+=this.grid[p-1][J].length+this.grid[p][J].length-1;for(var U=Y.MAX_VALUE,S,F,Z=0;Z<V.length;Z++)V[Z]<U?(U=V[Z],S=1,F=Z):V[Z]==U&&S++;if(S==3&&U==0)V[0]==0&&V[1]==0&&V[2]==0?v=1:V[0]==0&&V[1]==0&&V[3]==0?v=0:V[0]==0&&V[2]==0&&V[3]==0?v=3:V[1]==0&&V[2]==0&&V[3]==0&&(v=2);else if(S==2&&U==0){var rt=Math.floor(Math.random()*2);V[0]==0&&V[1]==0?rt==0?v=0:v=1:V[0]==0&&V[2]==0?rt==0?v=0:v=2:V[0]==0&&V[3]==0?rt==0?v=0:v=3:V[1]==0&&V[2]==0?rt==0?v=1:v=2:V[1]==0&&V[3]==0?rt==0?v=1:v=3:rt==0?v=2:v=3}else if(S==4&&U==0){var rt=Math.floor(Math.random()*4);v=rt}else v=F;v==0?y.setCenter(m.getCenterX(),m.getCenterY()-m.getHeight()/2-l.DEFAULT_EDGE_LENGTH-y.getHeight()/2):v==1?y.setCenter(m.getCenterX()+m.getWidth()/2+l.DEFAULT_EDGE_LENGTH+y.getWidth()/2,m.getCenterY()):v==2?y.setCenter(m.getCenterX(),m.getCenterY()+m.getHeight()/2+l.DEFAULT_EDGE_LENGTH+y.getHeight()/2):y.setCenter(m.getCenterX()-m.getWidth()/2-l.DEFAULT_EDGE_LENGTH-y.getWidth()/2,m.getCenterY())}},n.exports=O},991:(n,e,t)=>{var s=t(551).FDLayoutNode,i=t(551).IMath;function f(r,d,u,l){s.call(this,r,d,u,l)}A(f,"CoSENode"),f.prototype=Object.create(s.prototype);for(var o in s)f[o]=s[o];f.prototype.calculateDisplacement=function(){var r=this.graphManager.getLayout();this.getChild()!=null&&this.fixedNodeWeight?(this.displacementX+=r.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=r.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=r.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=r.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>r.coolingFactor*r.maxNodeDisplacement&&(this.displacementX=r.coolingFactor*r.maxNodeDisplacement*i.sign(this.displacementX)),Math.abs(this.displacementY)>r.coolingFactor*r.maxNodeDisplacement&&(this.displacementY=r.coolingFactor*r.maxNodeDisplacement*i.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},f.prototype.propogateDisplacementToChildren=function(r,d){for(var u=this.getChild().getNodes(),l,N=0;N<u.length;N++)l=u[N],l.getChild()==null?(l.displacementX+=r,l.displacementY+=d):l.propogateDisplacementToChildren(r,d)},f.prototype.move=function(){var r=this.graphManager.getLayout();(this.child==null||this.child.getNodes().length==0)&&(this.moveBy(this.displacementX,this.displacementY),r.totalDisplacement+=Math.abs(this.displacementX)+Math.abs(this.displacementY)),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0},f.prototype.setPred1=function(r){this.pred1=r},f.prototype.getPred1=function(){return pred1},f.prototype.getPred2=function(){return pred2},f.prototype.setNext=function(r){this.next=r},f.prototype.getNext=function(){return next},f.prototype.setProcessed=function(r){this.processed=r},f.prototype.isProcessed=function(){return processed},n.exports=f},902:(n,e,t)=>{function s(u){if(Array.isArray(u)){for(var l=0,N=Array(u.length);l<u.length;l++)N[l]=u[l];return N}else return Array.from(u)}A(s,"_toConsumableArray");var i=t(806),f=t(551).LinkedList,o=t(551).Matrix,r=t(551).SVD;function d(){}A(d,"ConstraintHandler"),d.handleConstraints=function(u){var l={};l.fixedNodeConstraint=u.constraints.fixedNodeConstraint,l.alignmentConstraint=u.constraints.alignmentConstraint,l.relativePlacementConstraint=u.constraints.relativePlacementConstraint;for(var N=new Map,g=new Map,E=[],w=[],L=u.getAllNodes(),Y=0,B=0;B<L.length;B++){var P=L[B];P.getChild()==null&&(g.set(P.id,Y++),E.push(P.getCenterX()),w.push(P.getCenterY()),N.set(P.id,P))}l.relativePlacementConstraint&&l.relativePlacementConstraint.forEach(function(C){!C.gap&&C.gap!=0&&(C.left?C.gap=i.DEFAULT_EDGE_LENGTH+N.get(C.left).getWidth()/2+N.get(C.right).getWidth()/2:C.gap=i.DEFAULT_EDGE_LENGTH+N.get(C.top).getHeight()/2+N.get(C.bottom).getHeight()/2)});var X=A(function(C,G){return{x:C.x-G.x,y:C.y-G.y}},"calculatePositionDiff"),q=A(function(C){var G=0,$=0;return C.forEach(function(K){G+=E[g.get(K)],$+=w[g.get(K)]}),{x:G/C.size,y:$/C.size}},"calculateAvgPosition"),O=A(function(C,G,$,K,Q){function pt(ot,st){var at=new Set(ot),Nt=!0,ft=!1,bt=void 0;try{for(var Dt=st[Symbol.iterator](),Rt;!(Nt=(Rt=Dt.next()).done);Nt=!0){var Xt=Rt.value;at.add(Xt)}}catch(Tt){ft=!0,bt=Tt}finally{try{!Nt&&Dt.return&&Dt.return()}finally{if(ft)throw bt}}return at}A(pt,"setUnion");var dt=new Map;C.forEach(function(ot,st){dt.set(st,0)}),C.forEach(function(ot,st){ot.forEach(function(at){dt.set(at.id,dt.get(at.id)+1)})});var tt=new Map,ct=new Map,Et=new f;dt.forEach(function(ot,st){ot==0?(Et.push(st),$||(G=="horizontal"?tt.set(st,g.has(st)?E[g.get(st)]:K.get(st)):tt.set(st,g.has(st)?w[g.get(st)]:K.get(st)))):tt.set(st,Number.NEGATIVE_INFINITY),$&&ct.set(st,new Set([st]))}),$&&Q.forEach(function(ot){var st=[];if(ot.forEach(function(ft){$.has(ft)&&st.push(ft)}),st.length>0){var at=0;st.forEach(function(ft){G=="horizontal"?(tt.set(ft,g.has(ft)?E[g.get(ft)]:K.get(ft)),at+=tt.get(ft)):(tt.set(ft,g.has(ft)?w[g.get(ft)]:K.get(ft)),at+=tt.get(ft))}),at=at/st.length,ot.forEach(function(ft){$.has(ft)||tt.set(ft,at)})}else{var Nt=0;ot.forEach(function(ft){G=="horizontal"?Nt+=g.has(ft)?E[g.get(ft)]:K.get(ft):Nt+=g.has(ft)?w[g.get(ft)]:K.get(ft)}),Nt=Nt/ot.length,ot.forEach(function(ft){tt.set(ft,Nt)})}});for(var wt=A(function(){var ot=Et.shift(),st=C.get(ot);st.forEach(function(at){if(tt.get(at.id)<tt.get(ot)+at.gap)if($&&$.has(at.id)){var Nt=void 0;if(G=="horizontal"?Nt=g.has(at.id)?E[g.get(at.id)]:K.get(at.id):Nt=g.has(at.id)?w[g.get(at.id)]:K.get(at.id),tt.set(at.id,Nt),Nt<tt.get(ot)+at.gap){var ft=tt.get(ot)+at.gap-Nt;ct.get(ot).forEach(function(bt){tt.set(bt,tt.get(bt)-ft)})}}else tt.set(at.id,tt.get(ot)+at.gap);dt.set(at.id,dt.get(at.id)-1),dt.get(at.id)==0&&Et.push(at.id),$&&ct.set(at.id,pt(ct.get(ot),ct.get(at.id)))})},"_loop");Et.length!=0;)wt();if($){var et=new Set;C.forEach(function(ot,st){ot.length==0&&et.add(st)});var It=[];ct.forEach(function(ot,st){if(et.has(st)){var at=!1,Nt=!0,ft=!1,bt=void 0;try{for(var Dt=ot[Symbol.iterator](),Rt;!(Nt=(Rt=Dt.next()).done);Nt=!0){var Xt=Rt.value;$.has(Xt)&&(at=!0)}}catch(St){ft=!0,bt=St}finally{try{!Nt&&Dt.return&&Dt.return()}finally{if(ft)throw bt}}if(!at){var Tt=!1,At=void 0;It.forEach(function(St,Gt){St.has([].concat(s(ot))[0])&&(Tt=!0,At=Gt)}),Tt?ot.forEach(function(St){It[At].add(St)}):It.push(new Set(ot))}}}),It.forEach(function(ot,st){var at=Number.POSITIVE_INFINITY,Nt=Number.POSITIVE_INFINITY,ft=Number.NEGATIVE_INFINITY,bt=Number.NEGATIVE_INFINITY,Dt=!0,Rt=!1,Xt=void 0;try{for(var Tt=ot[Symbol.iterator](),At;!(Dt=(At=Tt.next()).done);Dt=!0){var St=At.value,Gt=void 0;G=="horizontal"?Gt=g.has(St)?E[g.get(St)]:K.get(St):Gt=g.has(St)?w[g.get(St)]:K.get(St);var zt=tt.get(St);Gt<at&&(at=Gt),Gt>ft&&(ft=Gt),zt<Nt&&(Nt=zt),zt>bt&&(bt=zt)}}catch(Zt){Rt=!0,Xt=Zt}finally{try{!Dt&&Tt.return&&Tt.return()}finally{if(Rt)throw Xt}}var jt=(at+ft)/2-(Nt+bt)/2,re=!0,Kt=!1,Jt=void 0;try{for(var $t=ot[Symbol.iterator](),Qt;!(re=(Qt=$t.next()).done);re=!0){var oe=Qt.value;tt.set(oe,tt.get(oe)+jt)}}catch(Zt){Kt=!0,Jt=Zt}finally{try{!re&&$t.return&&$t.return()}finally{if(Kt)throw Jt}}})}return tt},"findAppropriatePositionForRelativePlacement"),it=A(function(C){var G=0,$=0,K=0,Q=0;if(C.forEach(function(ct){ct.left?E[g.get(ct.left)]-E[g.get(ct.right)]>=0?G++:$++:w[g.get(ct.top)]-w[g.get(ct.bottom)]>=0?K++:Q++}),G>$&&K>Q)for(var pt=0;pt<g.size;pt++)E[pt]=-1*E[pt],w[pt]=-1*w[pt];else if(G>$)for(var dt=0;dt<g.size;dt++)E[dt]=-1*E[dt];else if(K>Q)for(var tt=0;tt<g.size;tt++)w[tt]=-1*w[tt]},"applyReflectionForRelativePlacement"),a=A(function(C){var G=[],$=new f,K=new Set,Q=0;return C.forEach(function(pt,dt){if(!K.has(dt)){G[Q]=[];var tt=dt;for($.push(tt),K.add(tt),G[Q].push(tt);$.length!=0;){tt=$.shift();var ct=C.get(tt);ct.forEach(function(Et){K.has(Et.id)||($.push(Et.id),K.add(Et.id),G[Q].push(Et.id))})}Q++}}),G},"findComponents"),v=A(function(C){var G=new Map;return C.forEach(function($,K){G.set(K,[])}),C.forEach(function($,K){$.forEach(function(Q){G.get(K).push(Q),G.get(Q.id).push({id:K,gap:Q.gap,direction:Q.direction})})}),G},"dagToUndirected"),m=A(function(C){var G=new Map;return C.forEach(function($,K){G.set(K,[])}),C.forEach(function($,K){$.forEach(function(Q){G.get(Q.id).push({id:K,gap:Q.gap,direction:Q.direction})})}),G},"dagToReversed"),y=[],p=[],D=!1,x=!1,R=new Set,H=new Map,z=new Map,W=[];if(l.fixedNodeConstraint&&l.fixedNodeConstraint.forEach(function(C){R.add(C.nodeId)}),l.relativePlacementConstraint&&(l.relativePlacementConstraint.forEach(function(C){C.left?(H.has(C.left)?H.get(C.left).push({id:C.right,gap:C.gap,direction:"horizontal"}):H.set(C.left,[{id:C.right,gap:C.gap,direction:"horizontal"}]),H.has(C.right)||H.set(C.right,[])):(H.has(C.top)?H.get(C.top).push({id:C.bottom,gap:C.gap,direction:"vertical"}):H.set(C.top,[{id:C.bottom,gap:C.gap,direction:"vertical"}]),H.has(C.bottom)||H.set(C.bottom,[]))}),z=v(H),W=a(z)),i.TRANSFORM_ON_CONSTRAINT_HANDLING){if(l.fixedNodeConstraint&&l.fixedNodeConstraint.length>1)l.fixedNodeConstraint.forEach(function(C,G){y[G]=[C.position.x,C.position.y],p[G]=[E[g.get(C.nodeId)],w[g.get(C.nodeId)]]}),D=!0;else if(l.alignmentConstraint)(function(){var C=0;if(l.alignmentConstraint.vertical){for(var G=l.alignmentConstraint.vertical,$=A(function(tt){var ct=new Set;G[tt].forEach(function(et){ct.add(et)});var Et=new Set([].concat(s(ct)).filter(function(et){return R.has(et)})),wt=void 0;Et.size>0?wt=E[g.get(Et.values().next().value)]:wt=q(ct).x,G[tt].forEach(function(et){y[C]=[wt,w[g.get(et)]],p[C]=[E[g.get(et)],w[g.get(et)]],C++})},"_loop2"),K=0;K<G.length;K++)$(K);D=!0}if(l.alignmentConstraint.horizontal){for(var Q=l.alignmentConstraint.horizontal,pt=A(function(tt){var ct=new Set;Q[tt].forEach(function(et){ct.add(et)});var Et=new Set([].concat(s(ct)).filter(function(et){return R.has(et)})),wt=void 0;Et.size>0?wt=E[g.get(Et.values().next().value)]:wt=q(ct).y,Q[tt].forEach(function(et){y[C]=[E[g.get(et)],wt],p[C]=[E[g.get(et)],w[g.get(et)]],C++})},"_loop3"),dt=0;dt<Q.length;dt++)pt(dt);D=!0}l.relativePlacementConstraint&&(x=!0)})();else if(l.relativePlacementConstraint){for(var j=0,V=0,J=0;J<W.length;J++)W[J].length>j&&(j=W[J].length,V=J);if(j<z.size/2)it(l.relativePlacementConstraint),D=!1,x=!1;else{var U=new Map,S=new Map,F=[];W[V].forEach(function(C){H.get(C).forEach(function(G){G.direction=="horizontal"?(U.has(C)?U.get(C).push(G):U.set(C,[G]),U.has(G.id)||U.set(G.id,[]),F.push({left:C,right:G.id})):(S.has(C)?S.get(C).push(G):S.set(C,[G]),S.has(G.id)||S.set(G.id,[]),F.push({top:C,bottom:G.id}))})}),it(F),x=!1;var Z=O(U,"horizontal"),rt=O(S,"vertical");W[V].forEach(function(C,G){p[G]=[E[g.get(C)],w[g.get(C)]],y[G]=[],Z.has(C)?y[G][0]=Z.get(C):y[G][0]=E[g.get(C)],rt.has(C)?y[G][1]=rt.get(C):y[G][1]=w[g.get(C)]}),D=!0}}if(D){for(var ut=void 0,_t=o.transpose(y),Mt=o.transpose(p),k=0;k<_t.length;k++)_t[k]=o.multGamma(_t[k]),Mt[k]=o.multGamma(Mt[k]);var nt=o.multMat(_t,o.transpose(Mt)),ht=r.svd(nt);ut=o.multMat(ht.V,o.transpose(ht.U));for(var mt=0;mt<g.size;mt++){var Ct=[E[mt],w[mt]],vt=[ut[0][0],ut[1][0]],yt=[ut[0][1],ut[1][1]];E[mt]=o.dotProduct(Ct,vt),w[mt]=o.dotProduct(Ct,yt)}x&&it(l.relativePlacementConstraint)}}if(i.ENFORCE_CONSTRAINTS){if(l.fixedNodeConstraint&&l.fixedNodeConstraint.length>0){var xt={x:0,y:0};l.fixedNodeConstraint.forEach(function(C,G){var $={x:E[g.get(C.nodeId)],y:w[g.get(C.nodeId)]},K=C.position,Q=X(K,$);xt.x+=Q.x,xt.y+=Q.y}),xt.x/=l.fixedNodeConstraint.length,xt.y/=l.fixedNodeConstraint.length,E.forEach(function(C,G){E[G]+=xt.x}),w.forEach(function(C,G){w[G]+=xt.y}),l.fixedNodeConstraint.forEach(function(C){E[g.get(C.nodeId)]=C.position.x,w[g.get(C.nodeId)]=C.position.y})}if(l.alignmentConstraint){if(l.alignmentConstraint.vertical)for(var Ht=l.alignmentConstraint.vertical,Ft=A(function(C){var G=new Set;Ht[C].forEach(function(Q){G.add(Q)});var $=new Set([].concat(s(G)).filter(function(Q){return R.has(Q)})),K=void 0;$.size>0?K=E[g.get($.values().next().value)]:K=q(G).x,G.forEach(function(Q){R.has(Q)||(E[g.get(Q)]=K)})},"_loop4"),Pt=0;Pt<Ht.length;Pt++)Ft(Pt);if(l.alignmentConstraint.horizontal)for(var Ot=l.alignmentConstraint.horizontal,Yt=A(function(C){var G=new Set;Ot[C].forEach(function(Q){G.add(Q)});var $=new Set([].concat(s(G)).filter(function(Q){return R.has(Q)})),K=void 0;$.size>0?K=w[g.get($.values().next().value)]:K=q(G).y,G.forEach(function(Q){R.has(Q)||(w[g.get(Q)]=K)})},"_loop5"),Ut=0;Ut<Ot.length;Ut++)Yt(Ut)}l.relativePlacementConstraint&&function(){var C=new Map,G=new Map,$=new Map,K=new Map,Q=new Map,pt=new Map,dt=new Set,tt=new Set;if(R.forEach(function(gt){dt.add(gt),tt.add(gt)}),l.alignmentConstraint){if(l.alignmentConstraint.vertical)for(var ct=l.alignmentConstraint.vertical,Et=A(function(gt){$.set("dummy"+gt,[]),ct[gt].forEach(function(Lt){C.set(Lt,"dummy"+gt),$.get("dummy"+gt).push(Lt),R.has(Lt)&&dt.add("dummy"+gt)}),Q.set("dummy"+gt,E[g.get(ct[gt][0])])},"_loop6"),wt=0;wt<ct.length;wt++)Et(wt);if(l.alignmentConstraint.horizontal)for(var et=l.alignmentConstraint.horizontal,It=A(function(gt){K.set("dummy"+gt,[]),et[gt].forEach(function(Lt){G.set(Lt,"dummy"+gt),K.get("dummy"+gt).push(Lt),R.has(Lt)&&tt.add("dummy"+gt)}),pt.set("dummy"+gt,w[g.get(et[gt][0])])},"_loop7"),ot=0;ot<et.length;ot++)It(ot)}var st=new Map,at=new Map,Nt=A(function(gt){H.get(gt).forEach(function(Lt){var Bt=void 0,Vt=void 0;Lt.direction=="horizontal"?(Bt=C.get(gt)?C.get(gt):gt,C.get(Lt.id)?Vt={id:C.get(Lt.id),gap:Lt.gap,direction:Lt.direction}:Vt=Lt,st.has(Bt)?st.get(Bt).push(Vt):st.set(Bt,[Vt]),st.has(Vt.id)||st.set(Vt.id,[])):(Bt=G.get(gt)?G.get(gt):gt,G.get(Lt.id)?Vt={id:G.get(Lt.id),gap:Lt.gap,direction:Lt.direction}:Vt=Lt,at.has(Bt)?at.get(Bt).push(Vt):at.set(Bt,[Vt]),at.has(Vt.id)||at.set(Vt.id,[]))})},"_loop8"),ft=!0,bt=!1,Dt=void 0;try{for(var Rt=H.keys()[Symbol.iterator](),Xt;!(ft=(Xt=Rt.next()).done);ft=!0){var Tt=Xt.value;Nt(Tt)}}catch(gt){bt=!0,Dt=gt}finally{try{!ft&&Rt.return&&Rt.return()}finally{if(bt)throw Dt}}var At=v(st),St=v(at),Gt=a(At),zt=a(St),jt=m(st),re=m(at),Kt=[],Jt=[];Gt.forEach(function(gt,Lt){Kt[Lt]=[],gt.forEach(function(Bt){jt.get(Bt).length==0&&Kt[Lt].push(Bt)})}),zt.forEach(function(gt,Lt){Jt[Lt]=[],gt.forEach(function(Bt){re.get(Bt).length==0&&Jt[Lt].push(Bt)})});var $t=O(st,"horizontal",dt,Q,Kt),Qt=O(at,"vertical",tt,pt,Jt),oe=A(function(gt){$.get(gt)?$.get(gt).forEach(function(Lt){E[g.get(Lt)]=$t.get(gt)}):E[g.get(gt)]=$t.get(gt)},"_loop9"),Zt=!0,ve=!1,ye=void 0;try{for(var se=$t.keys()[Symbol.iterator](),Ee;!(Zt=(Ee=se.next()).done);Zt=!0){var he=Ee.value;oe(he)}}catch(gt){ve=!0,ye=gt}finally{try{!Zt&&se.return&&se.return()}finally{if(ve)throw ye}}var Be=A(function(gt){K.get(gt)?K.get(gt).forEach(function(Lt){w[g.get(Lt)]=Qt.get(gt)}):w[g.get(gt)]=Qt.get(gt)},"_loop10"),le=!0,Ne=!1,Te=void 0;try{for(var de=Qt.keys()[Symbol.iterator](),Ae;!(le=(Ae=de.next()).done);le=!0){var he=Ae.value;Be(he)}}catch(gt){Ne=!0,Te=gt}finally{try{!le&&de.return&&de.return()}finally{if(Ne)throw Te}}}()}for(var Wt=0;Wt<L.length;Wt++){var lt=L[Wt];lt.getChild()==null&&lt.setCenter(E[g.get(lt.id)],w[g.get(lt.id)])}},n.exports=d},551:n=>{n.exports=_}},T={};function c(n){var e=T[n];if(e!==void 0)return e.exports;var t=T[n]={exports:{}};return b[n](t,t.exports,c),t.exports}A(c,"__webpack_require__");var h=c(45);return h})()})}),hi=pe((M,I)=>{A(function(_,b){typeof M=="object"&&typeof I=="object"?I.exports=b(Le()):typeof define=="function"&&define.amd?define(["cose-base"],b):typeof M=="object"?M.cytoscapeFcose=b(Le()):_.cytoscapeFcose=b(_.coseBase)},"webpackUniversalModuleDefinition")(M,function(_){return(()=>{var b={658:n=>{n.exports=Object.assign!=null?Object.assign.bind(Object):function(e){for(var t=arguments.length,s=Array(t>1?t-1:0),i=1;i<t;i++)s[i-1]=arguments[i];return s.forEach(function(f){Object.keys(f).forEach(function(o){return e[o]=f[o]})}),e}},548:(n,e,t)=>{var s=function(){function o(r,d){var u=[],l=!0,N=!1,g=void 0;try{for(var E=r[Symbol.iterator](),w;!(l=(w=E.next()).done)&&(u.push(w.value),!(d&&u.length===d));l=!0);}catch(L){N=!0,g=L}finally{try{!l&&E.return&&E.return()}finally{if(N)throw g}}return u}return A(o,"sliceIterator"),function(r,d){if(Array.isArray(r))return r;if(Symbol.iterator in Object(r))return o(r,d);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),i=t(140).layoutBase.LinkedList,f={};f.getTopMostNodes=function(o){for(var r={},d=0;d<o.length;d++)r[o[d].id()]=!0;var u=o.filter(function(l,N){typeof l=="number"&&(l=N);for(var g=l.parent()[0];g!=null;){if(r[g.id()])return!1;g=g.parent()[0]}return!0});return u},f.connectComponents=function(o,r,d,u){var l=new i,N=new Set,g=[],E=void 0,w=void 0,L=void 0,Y=!1,B=1,P=[],X=[],q=A(function(){var O=o.collection();X.push(O);var it=d[0],a=o.collection();a.merge(it).merge(it.descendants().intersection(r)),g.push(it),a.forEach(function(y){l.push(y),N.add(y),O.merge(y)});for(var v=A(function(){it=l.shift();var y=o.collection();it.neighborhood().nodes().forEach(function(R){r.intersection(it.edgesWith(R)).length>0&&y.merge(R)});for(var p=0;p<y.length;p++){var D=y[p];if(E=d.intersection(D.union(D.ancestors())),E!=null&&!N.has(E[0])){var x=E.union(E.descendants());x.forEach(function(R){l.push(R),N.add(R),O.merge(R),d.has(R)&&g.push(R)})}}},"_loop2");l.length!=0;)v();if(O.forEach(function(y){r.intersection(y.connectedEdges()).forEach(function(p){O.has(p.source())&&O.has(p.target())&&O.merge(p)})}),g.length==d.length&&(Y=!0),!Y||Y&&B>1){w=g[0],L=w.connectedEdges().length,g.forEach(function(y){y.connectedEdges().length<L&&(L=y.connectedEdges().length,w=y)}),P.push(w.id());var m=o.collection();m.merge(g[0]),g.forEach(function(y){m.merge(y)}),g=[],d=d.difference(m),B++}},"_loop");do q();while(!Y);return u&&P.length>0&&u.set("dummy"+(u.size+1),P),X},f.relocateComponent=function(o,r,d){if(!d.fixedNodeConstraint){var u=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY,N=Number.POSITIVE_INFINITY,g=Number.NEGATIVE_INFINITY;if(d.quality=="draft"){var E=!0,w=!1,L=void 0;try{for(var Y=r.nodeIndexes[Symbol.iterator](),B;!(E=(B=Y.next()).done);E=!0){var P=B.value,X=s(P,2),q=X[0],O=X[1],it=d.cy.getElementById(q);if(it){var a=it.boundingBox(),v=r.xCoords[O]-a.w/2,m=r.xCoords[O]+a.w/2,y=r.yCoords[O]-a.h/2,p=r.yCoords[O]+a.h/2;v<u&&(u=v),m>l&&(l=m),y<N&&(N=y),p>g&&(g=p)}}}catch(z){w=!0,L=z}finally{try{!E&&Y.return&&Y.return()}finally{if(w)throw L}}var D=o.x-(l+u)/2,x=o.y-(g+N)/2;r.xCoords=r.xCoords.map(function(z){return z+D}),r.yCoords=r.yCoords.map(function(z){return z+x})}else{Object.keys(r).forEach(function(z){var W=r[z],j=W.getRect().x,V=W.getRect().x+W.getRect().width,J=W.getRect().y,U=W.getRect().y+W.getRect().height;j<u&&(u=j),V>l&&(l=V),J<N&&(N=J),U>g&&(g=U)});var R=o.x-(l+u)/2,H=o.y-(g+N)/2;Object.keys(r).forEach(function(z){var W=r[z];W.setCenter(W.getCenterX()+R,W.getCenterY()+H)})}}},f.calcBoundingBox=function(o,r,d,u){for(var l=Number.MAX_SAFE_INTEGER,N=Number.MIN_SAFE_INTEGER,g=Number.MAX_SAFE_INTEGER,E=Number.MIN_SAFE_INTEGER,w=void 0,L=void 0,Y=void 0,B=void 0,P=o.descendants().not(":parent"),X=P.length,q=0;q<X;q++){var O=P[q];w=r[u.get(O.id())]-O.width()/2,L=r[u.get(O.id())]+O.width()/2,Y=d[u.get(O.id())]-O.height()/2,B=d[u.get(O.id())]+O.height()/2,l>w&&(l=w),N<L&&(N=L),g>Y&&(g=Y),E<B&&(E=B)}var it={};return it.topLeftX=l,it.topLeftY=g,it.width=N-l,it.height=E-g,it},f.calcParentsWithoutChildren=function(o,r){var d=o.collection();return r.nodes(":parent").forEach(function(u){var l=!1;u.children().forEach(function(N){N.css("display")!="none"&&(l=!0)}),l||d.merge(u)}),d},n.exports=f},816:(n,e,t)=>{var s=t(548),i=t(140).CoSELayout,f=t(140).CoSENode,o=t(140).layoutBase.PointD,r=t(140).layoutBase.DimensionD,d=t(140).layoutBase.LayoutConstants,u=t(140).layoutBase.FDLayoutConstants,l=t(140).CoSEConstants,N=A(function(g,E){var w=g.cy,L=g.eles,Y=L.nodes(),B=L.edges(),P=void 0,X=void 0,q=void 0,O={};g.randomize&&(P=E.nodeIndexes,X=E.xCoords,q=E.yCoords);var it=A(function(R){return typeof R=="function"},"isFn"),a=A(function(R,H){return it(R)?R(H):R},"optFn"),v=s.calcParentsWithoutChildren(w,L),m=A(function R(H,z,W,j){for(var V=z.length,J=0;J<V;J++){var U=z[J],S=null;U.intersection(v).length==0&&(S=U.children());var F=void 0,Z=U.layoutDimensions({nodeDimensionsIncludeLabels:j.nodeDimensionsIncludeLabels});if(U.outerWidth()!=null&&U.outerHeight()!=null)if(j.randomize)if(!U.isParent())F=H.add(new f(W.graphManager,new o(X[P.get(U.id())]-Z.w/2,q[P.get(U.id())]-Z.h/2),new r(parseFloat(Z.w),parseFloat(Z.h))));else{var rt=s.calcBoundingBox(U,X,q,P);U.intersection(v).length==0?F=H.add(new f(W.graphManager,new o(rt.topLeftX,rt.topLeftY),new r(rt.width,rt.height))):F=H.add(new f(W.graphManager,new o(rt.topLeftX,rt.topLeftY),new r(parseFloat(Z.w),parseFloat(Z.h))))}else F=H.add(new f(W.graphManager,new o(U.position("x")-Z.w/2,U.position("y")-Z.h/2),new r(parseFloat(Z.w),parseFloat(Z.h))));else F=H.add(new f(this.graphManager));if(F.id=U.data("id"),F.nodeRepulsion=a(j.nodeRepulsion,U),F.paddingLeft=parseInt(U.css("padding")),F.paddingTop=parseInt(U.css("padding")),F.paddingRight=parseInt(U.css("padding")),F.paddingBottom=parseInt(U.css("padding")),j.nodeDimensionsIncludeLabels&&(F.labelWidth=U.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).w,F.labelHeight=U.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).h,F.labelPosVertical=U.css("text-valign"),F.labelPosHorizontal=U.css("text-halign")),O[U.data("id")]=F,isNaN(F.rect.x)&&(F.rect.x=0),isNaN(F.rect.y)&&(F.rect.y=0),S!=null&&S.length>0){var ut=void 0;ut=W.getGraphManager().add(W.newGraph(),F),R(ut,S,W,j)}}},"processChildrenList"),y=A(function(R,H,z){for(var W=0,j=0,V=0;V<z.length;V++){var J=z[V],U=O[J.data("source")],S=O[J.data("target")];if(U&&S&&U!==S&&U.getEdgesBetween(S).length==0){var F=H.add(R.newEdge(),U,S);F.id=J.id(),F.idealLength=a(g.idealEdgeLength,J),F.edgeElasticity=a(g.edgeElasticity,J),W+=F.idealLength,j++}}g.idealEdgeLength!=null&&(j>0?l.DEFAULT_EDGE_LENGTH=u.DEFAULT_EDGE_LENGTH=W/j:it(g.idealEdgeLength)?l.DEFAULT_EDGE_LENGTH=u.DEFAULT_EDGE_LENGTH=50:l.DEFAULT_EDGE_LENGTH=u.DEFAULT_EDGE_LENGTH=g.idealEdgeLength,l.MIN_REPULSION_DIST=u.MIN_REPULSION_DIST=u.DEFAULT_EDGE_LENGTH/10,l.DEFAULT_RADIAL_SEPARATION=u.DEFAULT_EDGE_LENGTH)},"processEdges"),p=A(function(R,H){H.fixedNodeConstraint&&(R.constraints.fixedNodeConstraint=H.fixedNodeConstraint),H.alignmentConstraint&&(R.constraints.alignmentConstraint=H.alignmentConstraint),H.relativePlacementConstraint&&(R.constraints.relativePlacementConstraint=H.relativePlacementConstraint)},"processConstraints");g.nestingFactor!=null&&(l.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=u.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=g.nestingFactor),g.gravity!=null&&(l.DEFAULT_GRAVITY_STRENGTH=u.DEFAULT_GRAVITY_STRENGTH=g.gravity),g.numIter!=null&&(l.MAX_ITERATIONS=u.MAX_ITERATIONS=g.numIter),g.gravityRange!=null&&(l.DEFAULT_GRAVITY_RANGE_FACTOR=u.DEFAULT_GRAVITY_RANGE_FACTOR=g.gravityRange),g.gravityCompound!=null&&(l.DEFAULT_COMPOUND_GRAVITY_STRENGTH=u.DEFAULT_COMPOUND_GRAVITY_STRENGTH=g.gravityCompound),g.gravityRangeCompound!=null&&(l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=u.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=g.gravityRangeCompound),g.initialEnergyOnIncremental!=null&&(l.DEFAULT_COOLING_FACTOR_INCREMENTAL=u.DEFAULT_COOLING_FACTOR_INCREMENTAL=g.initialEnergyOnIncremental),g.tilingCompareBy!=null&&(l.TILING_COMPARE_BY=g.tilingCompareBy),g.quality=="proof"?d.QUALITY=2:d.QUALITY=0,l.NODE_DIMENSIONS_INCLUDE_LABELS=u.NODE_DIMENSIONS_INCLUDE_LABELS=d.NODE_DIMENSIONS_INCLUDE_LABELS=g.nodeDimensionsIncludeLabels,l.DEFAULT_INCREMENTAL=u.DEFAULT_INCREMENTAL=d.DEFAULT_INCREMENTAL=!g.randomize,l.ANIMATE=u.ANIMATE=d.ANIMATE=g.animate,l.TILE=g.tile,l.TILING_PADDING_VERTICAL=typeof g.tilingPaddingVertical=="function"?g.tilingPaddingVertical.call():g.tilingPaddingVertical,l.TILING_PADDING_HORIZONTAL=typeof g.tilingPaddingHorizontal=="function"?g.tilingPaddingHorizontal.call():g.tilingPaddingHorizontal,l.DEFAULT_INCREMENTAL=u.DEFAULT_INCREMENTAL=d.DEFAULT_INCREMENTAL=!0,l.PURE_INCREMENTAL=!g.randomize,d.DEFAULT_UNIFORM_LEAF_NODE_SIZES=g.uniformNodeDimensions,g.step=="transformed"&&(l.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,l.ENFORCE_CONSTRAINTS=!1,l.APPLY_LAYOUT=!1),g.step=="enforced"&&(l.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,l.ENFORCE_CONSTRAINTS=!0,l.APPLY_LAYOUT=!1),g.step=="cose"&&(l.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,l.ENFORCE_CONSTRAINTS=!1,l.APPLY_LAYOUT=!0),g.step=="all"&&(g.randomize?l.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:l.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,l.ENFORCE_CONSTRAINTS=!0,l.APPLY_LAYOUT=!0),g.fixedNodeConstraint||g.alignmentConstraint||g.relativePlacementConstraint?l.TREE_REDUCTION_ON_INCREMENTAL=!1:l.TREE_REDUCTION_ON_INCREMENTAL=!0;var D=new i,x=D.newGraphManager();return m(x.addRoot(),s.getTopMostNodes(Y),D,g),y(D,x,B),p(D,g),D.runLayout(),O},"coseLayout");n.exports={coseLayout:N}},212:(n,e,t)=>{var s=function(){function E(w,L){for(var Y=0;Y<L.length;Y++){var B=L[Y];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(w,B.key,B)}}return A(E,"defineProperties"),function(w,L,Y){return L&&E(w.prototype,L),Y&&E(w,Y),w}}();function i(E,w){if(!(E instanceof w))throw new TypeError("Cannot call a class as a function")}A(i,"_classCallCheck");var f=t(658),o=t(548),r=t(657),d=r.spectralLayout,u=t(816),l=u.coseLayout,N=Object.freeze({quality:"default",randomize:!0,animate:!0,animationDuration:1e3,animationEasing:void 0,fit:!0,padding:30,nodeDimensionsIncludeLabels:!1,uniformNodeDimensions:!1,packComponents:!0,step:"all",samplingType:!0,sampleSize:25,nodeSeparation:75,piTol:1e-7,nodeRepulsion:A(function(E){return 4500},"nodeRepulsion"),idealEdgeLength:A(function(E){return 50},"idealEdgeLength"),edgeElasticity:A(function(E){return .45},"edgeElasticity"),nestingFactor:.1,gravity:.25,numIter:2500,tile:!0,tilingCompareBy:void 0,tilingPaddingVertical:10,tilingPaddingHorizontal:10,gravityRangeCompound:1.5,gravityCompound:1,gravityRange:3.8,initialEnergyOnIncremental:.3,fixedNodeConstraint:void 0,alignmentConstraint:void 0,relativePlacementConstraint:void 0,ready:A(function(){},"ready"),stop:A(function(){},"stop")}),g=function(){function E(w){i(this,E),this.options=f({},N,w)}return A(E,"Layout"),s(E,[{key:"run",value:A(function(){var w=this,L=this.options,Y=L.cy,B=L.eles,P=[],X=[],q=void 0,O=[];L.fixedNodeConstraint&&(!Array.isArray(L.fixedNodeConstraint)||L.fixedNodeConstraint.length==0)&&(L.fixedNodeConstraint=void 0),L.alignmentConstraint&&(L.alignmentConstraint.vertical&&(!Array.isArray(L.alignmentConstraint.vertical)||L.alignmentConstraint.vertical.length==0)&&(L.alignmentConstraint.vertical=void 0),L.alignmentConstraint.horizontal&&(!Array.isArray(L.alignmentConstraint.horizontal)||L.alignmentConstraint.horizontal.length==0)&&(L.alignmentConstraint.horizontal=void 0)),L.relativePlacementConstraint&&(!Array.isArray(L.relativePlacementConstraint)||L.relativePlacementConstraint.length==0)&&(L.relativePlacementConstraint=void 0);var it=L.fixedNodeConstraint||L.alignmentConstraint||L.relativePlacementConstraint;it&&(L.tile=!1,L.packComponents=!1);var a=void 0,v=!1;if(Y.layoutUtilities&&L.packComponents&&(a=Y.layoutUtilities("get"),a||(a=Y.layoutUtilities()),v=!0),B.nodes().length>0)if(v){var m=o.getTopMostNodes(L.eles.nodes());if(q=o.connectComponents(Y,L.eles,m),q.forEach(function(k){var nt=k.boundingBox();O.push({x:nt.x1+nt.w/2,y:nt.y1+nt.h/2})}),L.randomize&&q.forEach(function(k){L.eles=k,P.push(d(L))}),L.quality=="default"||L.quality=="proof"){var y=Y.collection();if(L.tile){var p=new Map,D=[],x=[],R=0,H={nodeIndexes:p,xCoords:D,yCoords:x},z=[];if(q.forEach(function(k,nt){k.edges().length==0&&(k.nodes().forEach(function(ht,mt){y.merge(k.nodes()[mt]),ht.isParent()||(H.nodeIndexes.set(k.nodes()[mt].id(),R++),H.xCoords.push(k.nodes()[0].position().x),H.yCoords.push(k.nodes()[0].position().y))}),z.push(nt))}),y.length>1){var W=y.boundingBox();O.push({x:W.x1+W.w/2,y:W.y1+W.h/2}),q.push(y),P.push(H);for(var j=z.length-1;j>=0;j--)q.splice(z[j],1),P.splice(z[j],1),O.splice(z[j],1)}}q.forEach(function(k,nt){L.eles=k,X.push(l(L,P[nt])),o.relocateComponent(O[nt],X[nt],L)})}else q.forEach(function(k,nt){o.relocateComponent(O[nt],P[nt],L)});var V=new Set;if(q.length>1){var J=[],U=B.filter(function(k){return k.css("display")=="none"});q.forEach(function(k,nt){var ht=void 0;if(L.quality=="draft"&&(ht=P[nt].nodeIndexes),k.nodes().not(U).length>0){var mt={};mt.edges=[],mt.nodes=[];var Ct=void 0;k.nodes().not(U).forEach(function(vt){if(L.quality=="draft")if(!vt.isParent())Ct=ht.get(vt.id()),mt.nodes.push({x:P[nt].xCoords[Ct]-vt.boundingbox().w/2,y:P[nt].yCoords[Ct]-vt.boundingbox().h/2,width:vt.boundingbox().w,height:vt.boundingbox().h});else{var yt=o.calcBoundingBox(vt,P[nt].xCoords,P[nt].yCoords,ht);mt.nodes.push({x:yt.topLeftX,y:yt.topLeftY,width:yt.width,height:yt.height})}else X[nt][vt.id()]&&mt.nodes.push({x:X[nt][vt.id()].getLeft(),y:X[nt][vt.id()].getTop(),width:X[nt][vt.id()].getWidth(),height:X[nt][vt.id()].getHeight()})}),k.edges().forEach(function(vt){var yt=vt.source(),xt=vt.target();if(yt.css("display")!="none"&&xt.css("display")!="none")if(L.quality=="draft"){var Ht=ht.get(yt.id()),Ft=ht.get(xt.id()),Pt=[],Ot=[];if(yt.isParent()){var Yt=o.calcBoundingBox(yt,P[nt].xCoords,P[nt].yCoords,ht);Pt.push(Yt.topLeftX+Yt.width/2),Pt.push(Yt.topLeftY+Yt.height/2)}else Pt.push(P[nt].xCoords[Ht]),Pt.push(P[nt].yCoords[Ht]);if(xt.isParent()){var Ut=o.calcBoundingBox(xt,P[nt].xCoords,P[nt].yCoords,ht);Ot.push(Ut.topLeftX+Ut.width/2),Ot.push(Ut.topLeftY+Ut.height/2)}else Ot.push(P[nt].xCoords[Ft]),Ot.push(P[nt].yCoords[Ft]);mt.edges.push({startX:Pt[0],startY:Pt[1],endX:Ot[0],endY:Ot[1]})}else X[nt][yt.id()]&&X[nt][xt.id()]&&mt.edges.push({startX:X[nt][yt.id()].getCenterX(),startY:X[nt][yt.id()].getCenterY(),endX:X[nt][xt.id()].getCenterX(),endY:X[nt][xt.id()].getCenterY()})}),mt.nodes.length>0&&(J.push(mt),V.add(nt))}});var S=a.packComponents(J,L.randomize).shifts;if(L.quality=="draft")P.forEach(function(k,nt){var ht=k.xCoords.map(function(Ct){return Ct+S[nt].dx}),mt=k.yCoords.map(function(Ct){return Ct+S[nt].dy});k.xCoords=ht,k.yCoords=mt});else{var F=0;V.forEach(function(k){Object.keys(X[k]).forEach(function(nt){var ht=X[k][nt];ht.setCenter(ht.getCenterX()+S[F].dx,ht.getCenterY()+S[F].dy)}),F++})}}}else{var Z=L.eles.boundingBox();if(O.push({x:Z.x1+Z.w/2,y:Z.y1+Z.h/2}),L.randomize){var rt=d(L);P.push(rt)}L.quality=="default"||L.quality=="proof"?(X.push(l(L,P[0])),o.relocateComponent(O[0],X[0],L)):o.relocateComponent(O[0],P[0],L)}var ut=A(function(k,nt){if(L.quality=="default"||L.quality=="proof"){typeof k=="number"&&(k=nt);var ht=void 0,mt=void 0,Ct=k.data("id");return X.forEach(function(yt){Ct in yt&&(ht={x:yt[Ct].getRect().getCenterX(),y:yt[Ct].getRect().getCenterY()},mt=yt[Ct])}),L.nodeDimensionsIncludeLabels&&(mt.labelWidth&&(mt.labelPosHorizontal=="left"?ht.x+=mt.labelWidth/2:mt.labelPosHorizontal=="right"&&(ht.x-=mt.labelWidth/2)),mt.labelHeight&&(mt.labelPosVertical=="top"?ht.y+=mt.labelHeight/2:mt.labelPosVertical=="bottom"&&(ht.y-=mt.labelHeight/2))),ht==null&&(ht={x:k.position("x"),y:k.position("y")}),{x:ht.x,y:ht.y}}else{var vt=void 0;return P.forEach(function(yt){var xt=yt.nodeIndexes.get(k.id());xt!=null&&(vt={x:yt.xCoords[xt],y:yt.yCoords[xt]})}),vt==null&&(vt={x:k.position("x"),y:k.position("y")}),{x:vt.x,y:vt.y}}},"getPositions");if(L.quality=="default"||L.quality=="proof"||L.randomize){var _t=o.calcParentsWithoutChildren(Y,B),Mt=B.filter(function(k){return k.css("display")=="none"});L.eles=B.not(Mt),B.nodes().not(":parent").not(Mt).layoutPositions(w,L,ut),_t.length>0&&_t.forEach(function(k){k.position(ut(k))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")},"run")}]),E}();n.exports=g},657:(n,e,t)=>{var s=t(548),i=t(140).layoutBase.Matrix,f=t(140).layoutBase.SVD,o=A(function(r){var d=r.cy,u=r.eles,l=u.nodes(),N=u.nodes(":parent"),g=new Map,E=new Map,w=new Map,L=[],Y=[],B=[],P=[],X=[],q=[],O=[],it=[],a=void 0,v=1e8,m=1e-9,y=r.piTol,p=r.samplingType,D=r.nodeSeparation,x=void 0,R=A(function(){for(var lt=0,C=0,G=!1;C<x;){lt=Math.floor(Math.random()*a),G=!1;for(var $=0;$<C;$++)if(P[$]==lt){G=!0;break}if(!G)P[C]=lt,C++;else continue}},"randomSampleCR"),H=A(function(lt,C,G){for(var $=[],K=0,Q=0,pt=0,dt=void 0,tt=[],ct=0,Et=1,wt=0;wt<a;wt++)tt[wt]=v;for($[Q]=lt,tt[lt]=0;Q>=K;){pt=$[K++];for(var et=L[pt],It=0;It<et.length;It++)dt=E.get(et[It]),tt[dt]==v&&(tt[dt]=tt[pt]+1,$[++Q]=dt);q[pt][C]=tt[pt]*D}if(G){for(var ot=0;ot<a;ot++)q[ot][C]<X[ot]&&(X[ot]=q[ot][C]);for(var st=0;st<a;st++)X[st]>ct&&(ct=X[st],Et=st)}return Et},"BFS"),z=A(function(lt){var C=void 0;if(lt){C=Math.floor(Math.random()*a);for(var G=0;G<a;G++)X[G]=v;for(var $=0;$<x;$++)P[$]=C,C=H(C,$,lt)}else{R();for(var K=0;K<x;K++)H(P[K],K,lt,!1)}for(var Q=0;Q<a;Q++)for(var pt=0;pt<x;pt++)q[Q][pt]*=q[Q][pt];for(var dt=0;dt<x;dt++)O[dt]=[];for(var tt=0;tt<x;tt++)for(var ct=0;ct<x;ct++)O[tt][ct]=q[P[ct]][tt]},"allBFS"),W=A(function(){for(var lt=f.svd(O),C=lt.S,G=lt.U,$=lt.V,K=C[0]*C[0]*C[0],Q=[],pt=0;pt<x;pt++){Q[pt]=[];for(var dt=0;dt<x;dt++)Q[pt][dt]=0,pt==dt&&(Q[pt][dt]=C[pt]/(C[pt]*C[pt]+K/(C[pt]*C[pt])))}it=i.multMat(i.multMat($,Q),i.transpose(G))},"sample"),j=A(function(){for(var lt=void 0,C=void 0,G=[],$=[],K=[],Q=[],pt=0;pt<a;pt++)G[pt]=Math.random(),$[pt]=Math.random();G=i.normalize(G),$=i.normalize($);for(var dt=0,tt=m,ct=m,Et=void 0;;){dt++;for(var wt=0;wt<a;wt++)K[wt]=G[wt];if(G=i.multGamma(i.multL(i.multGamma(K),q,it)),lt=i.dotProduct(K,G),G=i.normalize(G),tt=i.dotProduct(K,G),Et=Math.abs(tt/ct),Et<=1+y&&Et>=1)break;ct=tt}for(var et=0;et<a;et++)K[et]=G[et];for(dt=0,ct=m;;){dt++;for(var It=0;It<a;It++)Q[It]=$[It];if(Q=i.minusOp(Q,i.multCons(K,i.dotProduct(K,Q))),$=i.multGamma(i.multL(i.multGamma(Q),q,it)),C=i.dotProduct(Q,$),$=i.normalize($),tt=i.dotProduct(Q,$),Et=Math.abs(tt/ct),Et<=1+y&&Et>=1)break;ct=tt}for(var ot=0;ot<a;ot++)Q[ot]=$[ot];Y=i.multCons(K,Math.sqrt(Math.abs(lt))),B=i.multCons(Q,Math.sqrt(Math.abs(C)))},"powerIteration");s.connectComponents(d,u,s.getTopMostNodes(l),g),N.forEach(function(lt){s.connectComponents(d,u,s.getTopMostNodes(lt.descendants().intersection(u)),g)});for(var V=0,J=0;J<l.length;J++)l[J].isParent()||E.set(l[J].id(),V++);var U=!0,S=!1,F=void 0;try{for(var Z=g.keys()[Symbol.iterator](),rt;!(U=(rt=Z.next()).done);U=!0){var ut=rt.value;E.set(ut,V++)}}catch(lt){S=!0,F=lt}finally{try{!U&&Z.return&&Z.return()}finally{if(S)throw F}}for(var _t=0;_t<E.size;_t++)L[_t]=[];N.forEach(function(lt){for(var C=lt.children().intersection(u);C.nodes(":childless").length==0;)C=C.nodes()[0].children().intersection(u);var G=0,$=C.nodes(":childless")[0].connectedEdges().length;C.nodes(":childless").forEach(function(K,Q){K.connectedEdges().length<$&&($=K.connectedEdges().length,G=Q)}),w.set(lt.id(),C.nodes(":childless")[G].id())}),l.forEach(function(lt){var C=void 0;lt.isParent()?C=E.get(w.get(lt.id())):C=E.get(lt.id()),lt.neighborhood().nodes().forEach(function(G){u.intersection(lt.edgesWith(G)).length>0&&(G.isParent()?L[C].push(w.get(G.id())):L[C].push(G.id()))})});var Mt=A(function(lt){var C=E.get(lt),G=void 0;g.get(lt).forEach(function($){d.getElementById($).isParent()?G=w.get($):G=$,L[C].push(G),L[E.get(G)].push(lt)})},"_loop"),k=!0,nt=!1,ht=void 0;try{for(var mt=g.keys()[Symbol.iterator](),Ct;!(k=(Ct=mt.next()).done);k=!0){var vt=Ct.value;Mt(vt)}}catch(lt){nt=!0,ht=lt}finally{try{!k&&mt.return&&mt.return()}finally{if(nt)throw ht}}a=E.size;var yt=void 0;if(a>2){x=a<r.sampleSize?a:r.sampleSize;for(var xt=0;xt<a;xt++)q[xt]=[];for(var Ht=0;Ht<x;Ht++)it[Ht]=[];return r.quality=="draft"||r.step=="all"?(z(p),W(),j(),yt={nodeIndexes:E,xCoords:Y,yCoords:B}):(E.forEach(function(lt,C){Y.push(d.getElementById(C).position("x")),B.push(d.getElementById(C).position("y"))}),yt={nodeIndexes:E,xCoords:Y,yCoords:B}),yt}else{var Ft=E.keys(),Pt=d.getElementById(Ft.next().value),Ot=Pt.position(),Yt=Pt.outerWidth();if(Y.push(Ot.x),B.push(Ot.y),a==2){var Ut=d.getElementById(Ft.next().value),Wt=Ut.outerWidth();Y.push(Ot.x+Yt/2+Wt/2+r.idealEdgeLength),B.push(Ot.y)}return yt={nodeIndexes:E,xCoords:Y,yCoords:B},yt}},"spectralLayout");n.exports={spectralLayout:o}},579:(n,e,t)=>{var s=t(212),i=A(function(f){f&&f("layout","fcose",s)},"register");typeof cytoscape<"u"&&i(cytoscape),n.exports=i},140:n=>{n.exports=_}},T={};function c(n){var e=T[n];if(e!==void 0)return e.exports;var t=T[n]={exports:{}};return b[n](t,t.exports,c),t.exports}A(c,"__webpack_require__");var h=c(579);return h})()})}),_e={L:"left",R:"right",T:"top",B:"bottom"},Ce={L:A(M=>`${M},${M/2} 0,${M} 0,0`,"L"),R:A(M=>`0,${M/2} ${M},0 ${M},${M}`,"R"),T:A(M=>`0,0 ${M},0 ${M/2},${M}`,"T"),B:A(M=>`${M/2},0 ${M},${M} 0,${M}`,"B")},ae={L:A((M,I)=>M-I+2,"L"),R:A((M,I)=>M-2,"R"),T:A((M,I)=>M-I+2,"T"),B:A((M,I)=>M-2,"B")},li=A(function(M){return kt(M)?M==="L"?"R":"L":M==="T"?"B":"T"},"getOppositeArchitectureDirection"),Ie=A(function(M){let I=M;return I==="L"||I==="R"||I==="T"||I==="B"},"isArchitectureDirection"),kt=A(function(M){let I=M;return I==="L"||I==="R"},"isArchitectureDirectionX"),qt=A(function(M){let I=M;return I==="T"||I==="B"},"isArchitectureDirectionY"),me=A(function(M,I){let _=kt(M)&&qt(I),b=qt(M)&&kt(I);return _||b},"isArchitectureDirectionXY"),di=A(function(M){let I=M[0],_=M[1],b=kt(I)&&qt(_),T=qt(I)&&kt(_);return b||T},"isArchitecturePairXY"),gi=A(function(M){return M!=="LL"&&M!=="RR"&&M!=="TT"&&M!=="BB"},"isValidArchitectureDirectionPair"),ce=A(function(M,I){let _=`${M}${I}`;return gi(_)?_:void 0},"getArchitectureDirectionPair"),ci=A(function([M,I],_){let b=_[0],T=_[1];return kt(b)?qt(T)?[M+(b==="L"?-1:1),I+(T==="T"?1:-1)]:[M+(b==="L"?-1:1),I]:kt(T)?[M+(T==="L"?1:-1),I+(b==="T"?1:-1)]:[M,I+(b==="T"?1:-1)]},"shiftPositionByArchitectureDirectionPair"),ui=A(function(M){return M==="LT"||M==="TL"?[1,1]:M==="BL"||M==="LB"?[1,-1]:M==="BR"||M==="RB"?[-1,-1]:[-1,1]},"getArchitectureDirectionXYFactors"),fi=A(function(M,I){return me(M,I)?"bend":kt(M)?"horizontal":"vertical"},"getArchitectureDirectionAlignment"),pi=A(function(M){return M.type==="service"},"isArchitectureService"),mi=A(function(M){return M.type==="junction"},"isArchitectureJunction"),Me=A(M=>M.data(),"edgeData"),ee=A(M=>M.data(),"nodeData"),vi=ti.architecture,ie,be=(ie=class{constructor(){this.nodes={},this.groups={},this.edges=[],this.registeredIds={},this.elements={},this.diagramId="",this.setAccTitle=We,this.getAccTitle=je,this.setDiagramTitle=qe,this.getDiagramTitle=$e,this.getAccDescription=Ze,this.setAccDescription=Ke,this.clear()}setDiagramId(I){this.diagramId=I}getDiagramId(){return this.diagramId}clear(){this.nodes={},this.groups={},this.edges=[],this.registeredIds={},this.dataStructures=void 0,this.elements={},this.diagramId="",Je()}addService({id:I,icon:_,in:b,title:T,iconText:c}){if(this.registeredIds[I]!==void 0)throw new Error(`The service id [${I}] is already in use by another ${this.registeredIds[I]}`);if(b!==void 0){if(I===b)throw new Error(`The service [${I}] cannot be placed within itself`);if(this.registeredIds[b]===void 0)throw new Error(`The service [${I}]'s parent does not exist. Please make sure the parent is created before this service`);if(this.registeredIds[b]==="node")throw new Error(`The service [${I}]'s parent is not a group`)}this.registeredIds[I]="node",this.nodes[I]={id:I,type:"service",icon:_,iconText:c,title:T,edges:[],in:b}}getServices(){return Object.values(this.nodes).filter(pi)}addJunction({id:I,in:_}){if(this.registeredIds[I]!==void 0)throw new Error(`The junction id [${I}] is already in use by another ${this.registeredIds[I]}`);if(_!==void 0){if(I===_)throw new Error(`The junction [${I}] cannot be placed within itself`);if(this.registeredIds[_]===void 0)throw new Error(`The junction [${I}]'s parent does not exist. Please make sure the parent is created before this junction`);if(this.registeredIds[_]==="node")throw new Error(`The junction [${I}]'s parent is not a group`)}this.registeredIds[I]="node",this.nodes[I]={id:I,type:"junction",edges:[],in:_}}getJunctions(){return Object.values(this.nodes).filter(mi)}getNodes(){return Object.values(this.nodes)}getNode(I){return this.nodes[I]??null}addGroup({id:I,icon:_,in:b,title:T}){var c,h,n;if(((c=this.registeredIds)==null?void 0:c[I])!==void 0)throw new Error(`The group id [${I}] is already in use by another ${this.registeredIds[I]}`);if(b!==void 0){if(I===b)throw new Error(`The group [${I}] cannot be placed within itself`);if(((h=this.registeredIds)==null?void 0:h[b])===void 0)throw new Error(`The group [${I}]'s parent does not exist. Please make sure the parent is created before this group`);if(((n=this.registeredIds)==null?void 0:n[b])==="node")throw new Error(`The group [${I}]'s parent is not a group`)}this.registeredIds[I]="group",this.groups[I]={id:I,icon:_,title:T,in:b}}getGroups(){return Object.values(this.groups)}addEdge({lhsId:I,rhsId:_,lhsDir:b,rhsDir:T,lhsInto:c,rhsInto:h,lhsGroup:n,rhsGroup:e,title:t}){if(!Ie(b))throw new Error(`Invalid direction given for left hand side of edge ${I}--${_}. Expected (L,R,T,B) got ${String(b)}`);if(!Ie(T))throw new Error(`Invalid direction given for right hand side of edge ${I}--${_}. Expected (L,R,T,B) got ${String(T)}`);if(this.nodes[I]===void 0&&this.groups[I]===void 0)throw new Error(`The left-hand id [${I}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(this.nodes[_]===void 0&&this.groups[_]===void 0)throw new Error(`The right-hand id [${_}] does not yet exist. Please create the service/group before declaring an edge to it.`);let s=this.nodes[I].in,i=this.nodes[_].in;if(n&&s&&i&&s==i)throw new Error(`The left-hand id [${I}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(e&&s&&i&&s==i)throw new Error(`The right-hand id [${_}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);let f={lhsId:I,lhsDir:b,lhsInto:c,lhsGroup:n,rhsId:_,rhsDir:T,rhsInto:h,rhsGroup:e,title:t};this.edges.push(f),this.nodes[I]&&this.nodes[_]&&(this.nodes[I].edges.push(this.edges[this.edges.length-1]),this.nodes[_].edges.push(this.edges[this.edges.length-1]))}getEdges(){return this.edges}getDataStructures(){if(this.dataStructures===void 0){let I={},_=Object.entries(this.nodes).reduce((e,[t,s])=>(e[t]=s.edges.reduce((i,f)=>{var d,u;let o=(d=this.getNode(f.lhsId))==null?void 0:d.in,r=(u=this.getNode(f.rhsId))==null?void 0:u.in;if(o&&r&&o!==r){let l=fi(f.lhsDir,f.rhsDir);l!=="bend"&&(I[o]??(I[o]={}),I[o][r]=l,I[r]??(I[r]={}),I[r][o]=l)}if(f.lhsId===t){let l=ce(f.lhsDir,f.rhsDir);l&&(i[l]=f.rhsId)}else{let l=ce(f.rhsDir,f.lhsDir);l&&(i[l]=f.lhsId)}return i},{}),e),{}),b=Object.keys(_)[0],T={[b]:1},c=Object.keys(_).reduce((e,t)=>t===b?e:{...e,[t]:1},{}),h=A(e=>{let t={[e]:[0,0]},s=[e];for(;s.length>0;){let i=s.shift();if(i){T[i]=1,delete c[i];let f=_[i],[o,r]=t[i];Object.entries(f).forEach(([d,u])=>{T[u]||(t[u]=ci([o,r],d),s.push(u))})}}return t},"BFS"),n=[h(b)];for(;Object.keys(c).length>0;)n.push(h(Object.keys(c)[0]));this.dataStructures={adjList:_,spatialMaps:n,groupAlignments:I}}return this.dataStructures}setElementForId(I,_){this.elements[I]=_}getElementById(I){return this.elements[I]}getConfig(){return Qe({...vi,...ei().architecture})}getConfigField(I){return this.getConfig()[I]}},A(ie,"ArchitectureDB"),ie),yi=A((M,I)=>{He(M,I),M.groups.map(_=>I.addGroup(_)),M.services.map(_=>I.addService({..._,type:"service"})),M.junctions.map(_=>I.addJunction({..._,type:"junction"})),M.edges.map(_=>I.addEdge(_))},"populateDb"),De={parser:{yy:void 0},parse:A(async M=>{var b;let I=await ze("architecture",M);xe.debug(I);let _=(b=De.parser)==null?void 0:b.yy;if(!(_ instanceof be))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.");yi(I,_)},"parse")},Ei=A(M=>`
2
2
  .edge {
3
3
  stroke-width: ${M.archEdgeWidth};
4
4
  stroke: ${M.archEdgeColor};