orbitchat 2.2.5 → 2.2.7

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 (57) hide show
  1. package/bin/orbitchat.js +46 -58
  2. package/dist/assets/{_basePickBy-BjEly54R-DqvpNhss.js → _basePickBy-1MakYQmz-CFyJwR0u.js} +1 -1
  3. package/dist/assets/{_baseUniq-DRc_T5HB-BD-eiKhZ.js → _baseUniq-Cd4llU-Q-D06fzDcA.js} +1 -1
  4. package/dist/assets/{api-B0lJClJq.js → api-Ciw0inlZ.js} +1 -1
  5. package/dist/assets/arc-b8oyw-lz-BCfULEh7.js +1 -0
  6. package/dist/assets/{architectureDiagram-VXUJARFQ-Cfm45ePu-DpyHVagy.js → architectureDiagram-VXUJARFQ-BuSDV2Do-DuPWl-E8.js} +1 -1
  7. package/dist/assets/{blockDiagram-VD42YOAC-BRbgLESd-Ck20-ft3.js → blockDiagram-VD42YOAC-jQHtez-j-C4kvu0Em.js} +4 -4
  8. package/dist/assets/{c4Diagram-YG6GDRKO-DLei6MnZ-CyXWsii7.js → c4Diagram-YG6GDRKO-_5giM-EA-CAUaWHfB.js} +4 -4
  9. package/dist/assets/channel-BLPbvVT2-BU9ed3z7.js +1 -0
  10. package/dist/assets/{chunk-4BX2VUAB-DeMNg1Xd-CrtFwSE5.js → chunk-4BX2VUAB-BeuiUsbc-SyLBSPGf.js} +1 -1
  11. package/dist/assets/chunk-55IACEB6-C4OH5_NF-CeUEEy8j.js +1 -0
  12. package/dist/assets/{chunk-B4BG7PRW-CIxgz8SC-at5hJRU9.js → chunk-B4BG7PRW-CnUkcto7-Bw3MBwH8.js} +1 -1
  13. package/dist/assets/{chunk-DI55MBZ5-i035IDz6-DxOVU1og.js → chunk-DI55MBZ5-CSd59tsh-DMnz_BT4.js} +4 -4
  14. package/dist/assets/{chunk-FMBD7UC4-Bm0ev8jq-BTHOwKty.js → chunk-FMBD7UC4-C6VImbBX-Ci00_56S.js} +1 -1
  15. package/dist/assets/{chunk-QN33PNHL-C8-RyAc3-DADdydNm.js → chunk-QN33PNHL-DrWWTLTH-CxKsUSHw.js} +1 -1
  16. package/dist/assets/{chunk-QZHKN3VN-DMEEp6GB-MKN7DFjX.js → chunk-QZHKN3VN-C6_I39By-wG4V5ipa.js} +1 -1
  17. package/dist/assets/chunk-TZMSLE5B-DGddLgNl-oFBh2Kwv.js +1 -0
  18. package/dist/assets/classDiagram-2ON5EDUG-BngjTxOv-BTvgR8FJ.js +1 -0
  19. package/dist/assets/classDiagram-v2-WZHVMYZB-BngjTxOv-BTvgR8FJ.js +1 -0
  20. package/dist/assets/clone-DH1Kq5Y6-CC3PuMQg.js +1 -0
  21. package/dist/assets/{cose-bilkent-S5V4N54A-VxeRCpgs-ToXg3tv0.js → cose-bilkent-S5V4N54A-DcyCVH6S-DmuDbM_l.js} +1 -1
  22. package/dist/assets/{dagre-6UL2VRFP-B-o0qgxK-B7jIOGhI.js → dagre-6UL2VRFP-B799wmhr-COgMFtha.js} +1 -1
  23. package/dist/assets/{diagram-PSM6KHXK-CoKmJ9sN-CeSAdKE7.js → diagram-PSM6KHXK-Dxp2wzKk-BBCx56dy.js} +1 -1
  24. package/dist/assets/{diagram-QEK2KX5R-ETMfkzYL-BXfUD6Bz.js → diagram-QEK2KX5R-Km_liL9n-Betp39ze.js} +1 -1
  25. package/dist/assets/{diagram-S2PKOQOG-BgLbl6rv-Bq7z4qcN.js → diagram-S2PKOQOG-tSpHqt0k-44sQtblg.js} +1 -1
  26. package/dist/assets/{erDiagram-Q2GNP2WA-Swwdy5pk-CDqK5rW5.js → erDiagram-Q2GNP2WA-DF6ylQ7o-Dt6nMqG4.js} +2 -2
  27. package/dist/assets/{flowDiagram-NV44I4VS-DXJdBBSZ-BwK5ukuy.js → flowDiagram-NV44I4VS-BQUYJeB--BIIW2JbR.js} +1 -1
  28. package/dist/assets/{ganttDiagram-LVOFAZNH-DmRbHwxf-DcLr4kCw.js → ganttDiagram-LVOFAZNH-BidPm1xz-C_N0fE6y.js} +4 -4
  29. package/dist/assets/{gitGraphDiagram-NY62KEGX-D30uHfXn-CQ3udd86.js → gitGraphDiagram-NY62KEGX-zbMOFVrv-C2aviXPE.js} +2 -2
  30. package/dist/assets/{graph-ClfIprSM-Bo9NcOv2.js → graph-aRt77rZZ-BCYSvQYP.js} +1 -1
  31. package/dist/assets/{index-CIi9dO9d.js → index-CyVB0J6E.js} +145 -145
  32. package/dist/assets/{index-Bny2bm5_-BTHX9t_s.js → index-rW5EEHFR-DdBF6BH7.js} +1 -1
  33. package/dist/assets/{infoDiagram-ER5ION4S-C0DTNQfZ-LvJs62gz.js → infoDiagram-ER5ION4S-ozjqEnsq-Ba1eAJxv.js} +1 -1
  34. package/dist/assets/{journeyDiagram-XKPGCS4Q-53CUbf20-CN2QFlhq.js → journeyDiagram-XKPGCS4Q-C6JuEafR-CDMHuJkC.js} +4 -4
  35. package/dist/assets/{kanban-definition-3W4ZIXB7-B-HAgUf7-CCmqybnp.js → kanban-definition-3W4ZIXB7-Ci4U3NR--DxVvWtAD.js} +4 -4
  36. package/dist/assets/{layout-DoRwGyA9-iPNfcIdd.js → layout-BKjRgLFe-BqG-N5rr.js} +1 -1
  37. package/dist/assets/{mindmap-definition-VGOIOE7T-JxieKS1D-C0G1Iimv.js → mindmap-definition-VGOIOE7T-DveejCtl-DLDRL_jx.js} +1 -1
  38. package/dist/assets/{pieDiagram-ADFJNKIX-vEsBIPBi-B9KBvrYJ.js → pieDiagram-ADFJNKIX-DAbSGtae-DaaJODT6.js} +2 -2
  39. package/dist/assets/{quadrantDiagram-AYHSOK5B-DuNXQUnS-aaneQodw.js → quadrantDiagram-AYHSOK5B-DnnzUQMW-ByDrDvpT.js} +4 -4
  40. package/dist/assets/{requirementDiagram-UZGBJVZJ-Ajt9-U96-DJ47o9fU.js → requirementDiagram-UZGBJVZJ-BB9jagBx-4ABuhsu-.js} +1 -1
  41. package/dist/assets/{sankeyDiagram-TZEHDZUN-BNMEPupP-BUQLAXZ-.js → sankeyDiagram-TZEHDZUN-BttZx2-h-DZFrYF3L.js} +4 -4
  42. package/dist/assets/{sequenceDiagram-WL72ISMW-D2j881gi-DESm0zUV.js → sequenceDiagram-WL72ISMW-DA6yVs26-Cf4EYRDf.js} +1 -1
  43. package/dist/assets/{stateDiagram-FKZM4ZOC-D9G5SS9f-BGFYCrOw.js → stateDiagram-FKZM4ZOC-BD8xEcbc-DSZVswAk.js} +1 -1
  44. package/dist/assets/stateDiagram-v2-4FDKWEC3-DINzAoyF-Biyi4sW7.js +1 -0
  45. package/dist/assets/{timeline-definition-IT6M3QCI-B95452nE-BhqaFUs-.js → timeline-definition-IT6M3QCI-XN-D5T3b-CUWPxmpi.js} +1 -1
  46. package/dist/assets/{treemap-KMMF4GRG-Dfxm7cSf-B7pg2atG.js → treemap-KMMF4GRG-C4GHjB3F-HVe9FL0t.js} +18 -18
  47. package/dist/assets/{xychartDiagram-PRI3JC2R-CZX71UOJ-zWpWPPXY.js → xychartDiagram-PRI3JC2R-BL53__6J-Dk9M98Ob.js} +4 -4
  48. package/dist/index.html +1 -1
  49. package/package.json +2 -2
  50. package/dist/assets/arc-CZCQSTaI-COU74SO_.js +0 -1
  51. package/dist/assets/channel-DkFrLL9m-pXEXdU8i.js +0 -1
  52. package/dist/assets/chunk-55IACEB6-_r7qMy9s-CVsj1DxS.js +0 -1
  53. package/dist/assets/chunk-TZMSLE5B-CNFsEzOl-BT3YM95Y.js +0 -1
  54. package/dist/assets/classDiagram-2ON5EDUG-DnsiOvOV-CXFnq-_j.js +0 -1
  55. package/dist/assets/classDiagram-v2-WZHVMYZB-DnsiOvOV-CXFnq-_j.js +0 -1
  56. package/dist/assets/clone-DduvFCk3-BXgbo_Py.js +0 -1
  57. package/dist/assets/stateDiagram-v2-4FDKWEC3-D0cjqibA-CBYfNThC.js +0 -1
@@ -1 +1 @@
1
- import{R as W,O as j,e as lt,I as gt}from"./index-CIi9dO9d.js";import{e as tt}from"./cytoscape.esm-CjI2IsL8-Da6dFVsf.js";var V={exports:{}},z={exports:{}},q={exports:{}},ut=q.exports,$;function ct(){return $||($=1,function(x,X){(function(m,I){x.exports=I()})(ut,function(){return function(m){var I={};function T(n){if(I[n])return I[n].exports;var e=I[n]={i:n,l:!1,exports:{}};return m[n].call(e.exports,e,e.exports,T),e.l=!0,e.exports}return T.m=m,T.c=I,T.i=function(n){return n},T.d=function(n,e,t){T.o(n,e)||Object.defineProperty(n,e,{configurable:!1,enumerable:!0,get:t})},T.n=function(n){var e=n&&n.__esModule?function(){return n.default}:function(){return n};return T.d(e,"a",e),e},T.o=function(n,e){return Object.prototype.hasOwnProperty.call(n,e)},T.p="",T(T.s=26)}([function(m,I,T){function n(){}n.QUALITY=1,n.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,n.DEFAULT_INCREMENTAL=!1,n.DEFAULT_ANIMATION_ON_LAYOUT=!0,n.DEFAULT_ANIMATION_DURING_LAYOUT=!1,n.DEFAULT_ANIMATION_PERIOD=50,n.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,n.DEFAULT_GRAPH_MARGIN=15,n.NODE_DIMENSIONS_INCLUDE_LABELS=!1,n.SIMPLE_NODE_SIZE=40,n.SIMPLE_NODE_HALF_SIZE=n.SIMPLE_NODE_SIZE/2,n.EMPTY_COMPOUND_NODE_SIZE=40,n.MIN_EDGE_LENGTH=1,n.WORLD_BOUNDARY=1e6,n.INITIAL_WORLD_BOUNDARY=n.WORLD_BOUNDARY/1e3,n.WORLD_CENTER_X=1200,n.WORLD_CENTER_Y=900,m.exports=n},function(m,I,T){var n=T(2),e=T(8),t=T(9);function r(a,o,p){n.call(this,p),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=p,this.bendpoints=[],this.source=a,this.target=o}r.prototype=Object.create(n.prototype);for(var h in n)r[h]=n[h];r.prototype.getSource=function(){return this.source},r.prototype.getTarget=function(){return this.target},r.prototype.isInterGraph=function(){return this.isInterGraph},r.prototype.getLength=function(){return this.length},r.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},r.prototype.getBendpoints=function(){return this.bendpoints},r.prototype.getLca=function(){return this.lca},r.prototype.getSourceInLca=function(){return this.sourceInLca},r.prototype.getTargetInLca=function(){return this.targetInLca},r.prototype.getOtherEnd=function(a){if(this.source===a)return this.target;if(this.target===a)return this.source;throw"Node is not incident with this edge"},r.prototype.getOtherEndInGraph=function(a,o){for(var p=this.getOtherEnd(a),i=o.getGraphManager().getRoot();;){if(p.getOwner()==o)return p;if(p.getOwner()==i)break;p=p.getOwner().getParent()}return null},r.prototype.updateLength=function(){var a=new Array(4);this.isOverlapingSourceAndTarget=e.getIntersection(this.target.getRect(),this.source.getRect(),a),this.isOverlapingSourceAndTarget||(this.lengthX=a[0]-a[2],this.lengthY=a[1]-a[3],Math.abs(this.lengthX)<1&&(this.lengthX=t.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=t.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},r.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=t.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=t.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},m.exports=r},function(m,I,T){function n(e){this.vGraphObject=e}m.exports=n},function(m,I,T){var n=T(2),e=T(10),t=T(13),r=T(0),h=T(16),a=T(4);function o(i,g,l,f){l==null&&f==null&&(f=g),n.call(this,f),i.graphManager!=null&&(i=i.graphManager),this.estimatedSize=e.MIN_VALUE,this.inclusionTreeDepth=e.MAX_VALUE,this.vGraphObject=f,this.edges=[],this.graphManager=i,l!=null&&g!=null?this.rect=new t(g.x,g.y,l.width,l.height):this.rect=new t}o.prototype=Object.create(n.prototype);for(var p in n)o[p]=n[p];o.prototype.getEdges=function(){return this.edges},o.prototype.getChild=function(){return this.child},o.prototype.getOwner=function(){return this.owner},o.prototype.getWidth=function(){return this.rect.width},o.prototype.setWidth=function(i){this.rect.width=i},o.prototype.getHeight=function(){return this.rect.height},o.prototype.setHeight=function(i){this.rect.height=i},o.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},o.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},o.prototype.getCenter=function(){return new a(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},o.prototype.getLocation=function(){return new a(this.rect.x,this.rect.y)},o.prototype.getRect=function(){return this.rect},o.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},o.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},o.prototype.setRect=function(i,g){this.rect.x=i.x,this.rect.y=i.y,this.rect.width=g.width,this.rect.height=g.height},o.prototype.setCenter=function(i,g){this.rect.x=i-this.rect.width/2,this.rect.y=g-this.rect.height/2},o.prototype.setLocation=function(i,g){this.rect.x=i,this.rect.y=g},o.prototype.moveBy=function(i,g){this.rect.x+=i,this.rect.y+=g},o.prototype.getEdgeListToNode=function(i){var g=[],l=this;return l.edges.forEach(function(f){if(f.target==i){if(f.source!=l)throw"Incorrect edge source!";g.push(f)}}),g},o.prototype.getEdgesBetween=function(i){var g=[],l=this;return l.edges.forEach(function(f){if(!(f.source==l||f.target==l))throw"Incorrect edge source and/or target";(f.target==i||f.source==i)&&g.push(f)}),g},o.prototype.getNeighborsList=function(){var i=new Set,g=this;return g.edges.forEach(function(l){if(l.source==g)i.add(l.target);else{if(l.target!=g)throw"Incorrect incidency!";i.add(l.source)}}),i},o.prototype.withChildren=function(){var i=new Set,g,l;if(i.add(this),this.child!=null)for(var f=this.child.getNodes(),E=0;E<f.length;E++)g=f[E],l=g.withChildren(),l.forEach(function(y){i.add(y)});return i},o.prototype.getNoOfChildren=function(){var i=0,g;if(this.child==null)i=1;else for(var l=this.child.getNodes(),f=0;f<l.length;f++)g=l[f],i+=g.getNoOfChildren();return i==0&&(i=1),i},o.prototype.getEstimatedSize=function(){if(this.estimatedSize==e.MIN_VALUE)throw"assert failed";return this.estimatedSize},o.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)},o.prototype.scatter=function(){var i,g,l=-r.INITIAL_WORLD_BOUNDARY,f=r.INITIAL_WORLD_BOUNDARY;i=r.WORLD_CENTER_X+h.nextDouble()*(f-l)+l;var E=-r.INITIAL_WORLD_BOUNDARY,y=r.INITIAL_WORLD_BOUNDARY;g=r.WORLD_CENTER_Y+h.nextDouble()*(y-E)+E,this.rect.x=i,this.rect.y=g},o.prototype.updateBounds=function(){if(this.getChild()==null)throw"assert failed";if(this.getChild().getNodes().length!=0){var i=this.getChild();if(i.updateBounds(!0),this.rect.x=i.getLeft(),this.rect.y=i.getTop(),this.setWidth(i.getRight()-i.getLeft()),this.setHeight(i.getBottom()-i.getTop()),r.NODE_DIMENSIONS_INCLUDE_LABELS){var g=i.getRight()-i.getLeft(),l=i.getBottom()-i.getTop();this.labelWidth>g&&(this.rect.x-=(this.labelWidth-g)/2,this.setWidth(this.labelWidth)),this.labelHeight>l&&(this.labelPos=="center"?this.rect.y-=(this.labelHeight-l)/2:this.labelPos=="top"&&(this.rect.y-=this.labelHeight-l),this.setHeight(this.labelHeight))}}},o.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==e.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},o.prototype.transform=function(i){var g=this.rect.x;g>r.WORLD_BOUNDARY?g=r.WORLD_BOUNDARY:g<-r.WORLD_BOUNDARY&&(g=-r.WORLD_BOUNDARY);var l=this.rect.y;l>r.WORLD_BOUNDARY?l=r.WORLD_BOUNDARY:l<-r.WORLD_BOUNDARY&&(l=-r.WORLD_BOUNDARY);var f=new a(g,l),E=i.inverseTransformPoint(f);this.setLocation(E.x,E.y)},o.prototype.getLeft=function(){return this.rect.x},o.prototype.getRight=function(){return this.rect.x+this.rect.width},o.prototype.getTop=function(){return this.rect.y},o.prototype.getBottom=function(){return this.rect.y+this.rect.height},o.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},m.exports=o},function(m,I,T){function n(e,t){e==null&&t==null?(this.x=0,this.y=0):(this.x=e,this.y=t)}n.prototype.getX=function(){return this.x},n.prototype.getY=function(){return this.y},n.prototype.setX=function(e){this.x=e},n.prototype.setY=function(e){this.y=e},n.prototype.getDifference=function(e){return new DimensionD(this.x-e.x,this.y-e.y)},n.prototype.getCopy=function(){return new n(this.x,this.y)},n.prototype.translate=function(e){return this.x+=e.width,this.y+=e.height,this},m.exports=n},function(m,I,T){var n=T(2),e=T(10),t=T(0),r=T(6),h=T(3),a=T(1),o=T(13),p=T(12),i=T(11);function g(f,E,y){n.call(this,y),this.estimatedSize=e.MIN_VALUE,this.margin=t.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=f,E!=null&&E instanceof r?this.graphManager=E:E!=null&&E instanceof Layout&&(this.graphManager=E.graphManager)}g.prototype=Object.create(n.prototype);for(var l in n)g[l]=n[l];g.prototype.getNodes=function(){return this.nodes},g.prototype.getEdges=function(){return this.edges},g.prototype.getGraphManager=function(){return this.graphManager},g.prototype.getParent=function(){return this.parent},g.prototype.getLeft=function(){return this.left},g.prototype.getRight=function(){return this.right},g.prototype.getTop=function(){return this.top},g.prototype.getBottom=function(){return this.bottom},g.prototype.isConnected=function(){return this.isConnected},g.prototype.add=function(f,E,y){if(E==null&&y==null){var d=f;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(d)>-1)throw"Node already in graph!";return d.owner=this,this.getNodes().push(d),d}else{var N=f;if(!(this.getNodes().indexOf(E)>-1&&this.getNodes().indexOf(y)>-1))throw"Source or target not in graph!";if(!(E.owner==y.owner&&E.owner==this))throw"Both owners must be this graph!";return E.owner!=y.owner?null:(N.source=E,N.target=y,N.isInterGraph=!1,this.getEdges().push(N),E.edges.push(N),y!=E&&y.edges.push(N),N)}},g.prototype.remove=function(f){var E=f;if(f instanceof h){if(E==null)throw"Node is null!";if(!(E.owner!=null&&E.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var y=E.edges.slice(),d,N=y.length,v=0;v<N;v++)d=y[v],d.isInterGraph?this.graphManager.remove(d):d.source.owner.remove(d);var L=this.nodes.indexOf(E);if(L==-1)throw"Node not in owner node list!";this.nodes.splice(L,1)}else if(f instanceof a){var d=f;if(d==null)throw"Edge is null!";if(!(d.source!=null&&d.target!=null))throw"Source and/or target is null!";if(!(d.source.owner!=null&&d.target.owner!=null&&d.source.owner==this&&d.target.owner==this))throw"Source and/or target owner is invalid!";var s=d.source.edges.indexOf(d),u=d.target.edges.indexOf(d);if(!(s>-1&&u>-1))throw"Source and/or target doesn't know this edge!";d.source.edges.splice(s,1),d.target!=d.source&&d.target.edges.splice(u,1);var L=d.source.owner.getEdges().indexOf(d);if(L==-1)throw"Not in owner's edge list!";d.source.owner.getEdges().splice(L,1)}},g.prototype.updateLeftTop=function(){for(var f=e.MAX_VALUE,E=e.MAX_VALUE,y,d,N,v=this.getNodes(),L=v.length,s=0;s<L;s++){var u=v[s];y=u.getTop(),d=u.getLeft(),f>y&&(f=y),E>d&&(E=d)}return f==e.MAX_VALUE?null:(v[0].getParent().paddingLeft!=null?N=v[0].getParent().paddingLeft:N=this.margin,this.left=E-N,this.top=f-N,new p(this.left,this.top))},g.prototype.updateBounds=function(f){for(var E=e.MAX_VALUE,y=-e.MAX_VALUE,d=e.MAX_VALUE,N=-e.MAX_VALUE,v,L,s,u,c,A=this.nodes,_=A.length,O=0;O<_;O++){var D=A[O];f&&D.child!=null&&D.updateBounds(),v=D.getLeft(),L=D.getRight(),s=D.getTop(),u=D.getBottom(),E>v&&(E=v),y<L&&(y=L),d>s&&(d=s),N<u&&(N=u)}var w=new o(E,d,y-E,N-d);E==e.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),A[0].getParent().paddingLeft!=null?c=A[0].getParent().paddingLeft:c=this.margin,this.left=w.x-c,this.right=w.x+w.width+c,this.top=w.y-c,this.bottom=w.y+w.height+c},g.calculateBounds=function(f){for(var E=e.MAX_VALUE,y=-e.MAX_VALUE,d=e.MAX_VALUE,N=-e.MAX_VALUE,v,L,s,u,c=f.length,A=0;A<c;A++){var _=f[A];v=_.getLeft(),L=_.getRight(),s=_.getTop(),u=_.getBottom(),E>v&&(E=v),y<L&&(y=L),d>s&&(d=s),N<u&&(N=u)}var O=new o(E,d,y-E,N-d);return O},g.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},g.prototype.getEstimatedSize=function(){if(this.estimatedSize==e.MIN_VALUE)throw"assert failed";return this.estimatedSize},g.prototype.calcEstimatedSize=function(){for(var f=0,E=this.nodes,y=E.length,d=0;d<y;d++){var N=E[d];f+=N.calcEstimatedSize()}return f==0?this.estimatedSize=t.EMPTY_COMPOUND_NODE_SIZE:this.estimatedSize=f/Math.sqrt(this.nodes.length),this.estimatedSize},g.prototype.updateConnected=function(){var f=this;if(this.nodes.length==0){this.isConnected=!0;return}var E=new i,y=new Set,d=this.nodes[0],N,v,L=d.withChildren();for(L.forEach(function(O){E.push(O),y.add(O)});E.length!==0;){d=E.shift(),N=d.getEdges();for(var s=N.length,u=0;u<s;u++){var c=N[u];if(v=c.getOtherEndInGraph(d,this),v!=null&&!y.has(v)){var A=v.withChildren();A.forEach(function(O){E.push(O),y.add(O)})}}}if(this.isConnected=!1,y.size>=this.nodes.length){var _=0;y.forEach(function(O){O.owner==f&&_++}),_==this.nodes.length&&(this.isConnected=!0)}},m.exports=g},function(m,I,T){var n,e=T(1);function t(r){n=T(5),this.layout=r,this.graphs=[],this.edges=[]}t.prototype.addRoot=function(){var r=this.layout.newGraph(),h=this.layout.newNode(null),a=this.add(r,h);return this.setRootGraph(a),this.rootGraph},t.prototype.add=function(r,h,a,o,p){if(a==null&&o==null&&p==null){if(r==null)throw"Graph is null!";if(h==null)throw"Parent node is null!";if(this.graphs.indexOf(r)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(r),r.parent!=null)throw"Already has a parent!";if(h.child!=null)throw"Already has a child!";return r.parent=h,h.child=r,r}else{p=a,o=h,a=r;var i=o.getOwner(),g=p.getOwner();if(!(i!=null&&i.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(g!=null&&g.getGraphManager()==this))throw"Target not in this graph mgr!";if(i==g)return a.isInterGraph=!1,i.add(a,o,p);if(a.isInterGraph=!0,a.source=o,a.target=p,this.edges.indexOf(a)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(a),!(a.source!=null&&a.target!=null))throw"Edge source and/or target is null!";if(!(a.source.edges.indexOf(a)==-1&&a.target.edges.indexOf(a)==-1))throw"Edge already in source and/or target incidency list!";return a.source.edges.push(a),a.target.edges.push(a),a}},t.prototype.remove=function(r){if(r instanceof n){var h=r;if(h.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(h==this.rootGraph||h.parent!=null&&h.parent.graphManager==this))throw"Invalid parent node!";var a=[];a=a.concat(h.getEdges());for(var o,p=a.length,i=0;i<p;i++)o=a[i],h.remove(o);var g=[];g=g.concat(h.getNodes());var l;p=g.length;for(var i=0;i<p;i++)l=g[i],h.remove(l);h==this.rootGraph&&this.setRootGraph(null);var f=this.graphs.indexOf(h);this.graphs.splice(f,1),h.parent=null}else if(r instanceof e){if(o=r,o==null)throw"Edge is null!";if(!o.isInterGraph)throw"Not an inter-graph edge!";if(!(o.source!=null&&o.target!=null))throw"Source and/or target is null!";if(!(o.source.edges.indexOf(o)!=-1&&o.target.edges.indexOf(o)!=-1))throw"Source and/or target doesn't know this edge!";var f=o.source.edges.indexOf(o);if(o.source.edges.splice(f,1),f=o.target.edges.indexOf(o),o.target.edges.splice(f,1),!(o.source.owner!=null&&o.source.owner.getGraphManager()!=null))throw"Edge owner graph or owner graph manager is null!";if(o.source.owner.getGraphManager().edges.indexOf(o)==-1)throw"Not in owner graph manager's edge list!";var f=o.source.owner.getGraphManager().edges.indexOf(o);o.source.owner.getGraphManager().edges.splice(f,1)}},t.prototype.updateBounds=function(){this.rootGraph.updateBounds(!0)},t.prototype.getGraphs=function(){return this.graphs},t.prototype.getAllNodes=function(){if(this.allNodes==null){for(var r=[],h=this.getGraphs(),a=h.length,o=0;o<a;o++)r=r.concat(h[o].getNodes());this.allNodes=r}return this.allNodes},t.prototype.resetAllNodes=function(){this.allNodes=null},t.prototype.resetAllEdges=function(){this.allEdges=null},t.prototype.resetAllNodesToApplyGravitation=function(){this.allNodesToApplyGravitation=null},t.prototype.getAllEdges=function(){if(this.allEdges==null){var r=[],h=this.getGraphs();h.length;for(var a=0;a<h.length;a++)r=r.concat(h[a].getEdges());r=r.concat(this.edges),this.allEdges=r}return this.allEdges},t.prototype.getAllNodesToApplyGravitation=function(){return this.allNodesToApplyGravitation},t.prototype.setAllNodesToApplyGravitation=function(r){if(this.allNodesToApplyGravitation!=null)throw"assert failed";this.allNodesToApplyGravitation=r},t.prototype.getRoot=function(){return this.rootGraph},t.prototype.setRootGraph=function(r){if(r.getGraphManager()!=this)throw"Root not in this graph mgr!";this.rootGraph=r,r.parent==null&&(r.parent=this.layout.newNode("Root node"))},t.prototype.getLayout=function(){return this.layout},t.prototype.isOneAncestorOfOther=function(r,h){if(!(r!=null&&h!=null))throw"assert failed";if(r==h)return!0;var a=r.getOwner(),o;do{if(o=a.getParent(),o==null)break;if(o==h)return!0;if(a=o.getOwner(),a==null)break}while(!0);a=h.getOwner();do{if(o=a.getParent(),o==null)break;if(o==r)return!0;if(a=o.getOwner(),a==null)break}while(!0);return!1},t.prototype.calcLowestCommonAncestors=function(){for(var r,h,a,o,p,i=this.getAllEdges(),g=i.length,l=0;l<g;l++){if(r=i[l],h=r.source,a=r.target,r.lca=null,r.sourceInLca=h,r.targetInLca=a,h==a){r.lca=h.getOwner();continue}for(o=h.getOwner();r.lca==null;){for(r.targetInLca=a,p=a.getOwner();r.lca==null;){if(p==o){r.lca=p;break}if(p==this.rootGraph)break;if(r.lca!=null)throw"assert failed";r.targetInLca=p.getParent(),p=r.targetInLca.getOwner()}if(o==this.rootGraph)break;r.lca==null&&(r.sourceInLca=o.getParent(),o=r.sourceInLca.getOwner())}if(r.lca==null)throw"assert failed"}},t.prototype.calcLowestCommonAncestor=function(r,h){if(r==h)return r.getOwner();var a=r.getOwner();do{if(a==null)break;var o=h.getOwner();do{if(o==null)break;if(o==a)return o;o=o.getParent().getOwner()}while(!0);a=a.getParent().getOwner()}while(!0);return a},t.prototype.calcInclusionTreeDepths=function(r,h){r==null&&h==null&&(r=this.rootGraph,h=1);for(var a,o=r.getNodes(),p=o.length,i=0;i<p;i++)a=o[i],a.inclusionTreeDepth=h,a.child!=null&&this.calcInclusionTreeDepths(a.child,h+1)},t.prototype.includesInvalidEdge=function(){for(var r,h=this.edges.length,a=0;a<h;a++)if(r=this.edges[a],this.isOneAncestorOfOther(r.source,r.target))return!0;return!1},m.exports=t},function(m,I,T){var n=T(0);function e(){}for(var t in n)e[t]=n[t];e.MAX_ITERATIONS=2500,e.DEFAULT_EDGE_LENGTH=50,e.DEFAULT_SPRING_STRENGTH=.45,e.DEFAULT_REPULSION_STRENGTH=4500,e.DEFAULT_GRAVITY_STRENGTH=.4,e.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,e.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,e.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,e.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,e.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,e.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,e.COOLING_ADAPTATION_FACTOR=.33,e.ADAPTATION_LOWER_NODE_LIMIT=1e3,e.ADAPTATION_UPPER_NODE_LIMIT=5e3,e.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,e.MAX_NODE_DISPLACEMENT=e.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,e.MIN_REPULSION_DIST=e.DEFAULT_EDGE_LENGTH/10,e.CONVERGENCE_CHECK_PERIOD=100,e.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,e.MIN_EDGE_LENGTH=1,e.GRID_CALCULATION_CHECK_PERIOD=10,m.exports=e},function(m,I,T){var n=T(12);function e(){}e.calcSeparationAmount=function(t,r,h,a){if(!t.intersects(r))throw"assert failed";var o=new Array(2);this.decideDirectionsForOverlappingNodes(t,r,o),h[0]=Math.min(t.getRight(),r.getRight())-Math.max(t.x,r.x),h[1]=Math.min(t.getBottom(),r.getBottom())-Math.max(t.y,r.y),t.getX()<=r.getX()&&t.getRight()>=r.getRight()?h[0]+=Math.min(r.getX()-t.getX(),t.getRight()-r.getRight()):r.getX()<=t.getX()&&r.getRight()>=t.getRight()&&(h[0]+=Math.min(t.getX()-r.getX(),r.getRight()-t.getRight())),t.getY()<=r.getY()&&t.getBottom()>=r.getBottom()?h[1]+=Math.min(r.getY()-t.getY(),t.getBottom()-r.getBottom()):r.getY()<=t.getY()&&r.getBottom()>=t.getBottom()&&(h[1]+=Math.min(t.getY()-r.getY(),r.getBottom()-t.getBottom()));var p=Math.abs((r.getCenterY()-t.getCenterY())/(r.getCenterX()-t.getCenterX()));r.getCenterY()===t.getCenterY()&&r.getCenterX()===t.getCenterX()&&(p=1);var i=p*h[0],g=h[1]/p;h[0]<g?g=h[0]:i=h[1],h[0]=-1*o[0]*(g/2+a),h[1]=-1*o[1]*(i/2+a)},e.decideDirectionsForOverlappingNodes=function(t,r,h){t.getCenterX()<r.getCenterX()?h[0]=-1:h[0]=1,t.getCenterY()<r.getCenterY()?h[1]=-1:h[1]=1},e.getIntersection2=function(t,r,h){var a=t.getCenterX(),o=t.getCenterY(),p=r.getCenterX(),i=r.getCenterY();if(t.intersects(r))return h[0]=a,h[1]=o,h[2]=p,h[3]=i,!0;var g=t.getX(),l=t.getY(),f=t.getRight(),E=t.getX(),y=t.getBottom(),d=t.getRight(),N=t.getWidthHalf(),v=t.getHeightHalf(),L=r.getX(),s=r.getY(),u=r.getRight(),c=r.getX(),A=r.getBottom(),_=r.getRight(),O=r.getWidthHalf(),D=r.getHeightHalf(),w=!1,R=!1;if(a===p){if(o>i)return h[0]=a,h[1]=l,h[2]=p,h[3]=A,!1;if(o<i)return h[0]=a,h[1]=y,h[2]=p,h[3]=s,!1}else if(o===i){if(a>p)return h[0]=g,h[1]=o,h[2]=u,h[3]=i,!1;if(a<p)return h[0]=f,h[1]=o,h[2]=L,h[3]=i,!1}else{var F=t.height/t.width,b=r.height/r.width,C=(i-o)/(p-a),M=void 0,G=void 0,P=void 0,S=void 0,U=void 0,Y=void 0;if(-F===C?a>p?(h[0]=E,h[1]=y,w=!0):(h[0]=f,h[1]=l,w=!0):F===C&&(a>p?(h[0]=g,h[1]=l,w=!0):(h[0]=d,h[1]=y,w=!0)),-b===C?p>a?(h[2]=c,h[3]=A,R=!0):(h[2]=u,h[3]=s,R=!0):b===C&&(p>a?(h[2]=L,h[3]=s,R=!0):(h[2]=_,h[3]=A,R=!0)),w&&R)return!1;if(a>p?o>i?(M=this.getCardinalDirection(F,C,4),G=this.getCardinalDirection(b,C,2)):(M=this.getCardinalDirection(-F,C,3),G=this.getCardinalDirection(-b,C,1)):o>i?(M=this.getCardinalDirection(-F,C,1),G=this.getCardinalDirection(-b,C,3)):(M=this.getCardinalDirection(F,C,2),G=this.getCardinalDirection(b,C,4)),!w)switch(M){case 1:S=l,P=a+-v/C,h[0]=P,h[1]=S;break;case 2:P=d,S=o+N*C,h[0]=P,h[1]=S;break;case 3:S=y,P=a+v/C,h[0]=P,h[1]=S;break;case 4:P=E,S=o+-N*C,h[0]=P,h[1]=S;break}if(!R)switch(G){case 1:Y=s,U=p+-D/C,h[2]=U,h[3]=Y;break;case 2:U=_,Y=i+O*C,h[2]=U,h[3]=Y;break;case 3:Y=A,U=p+D/C,h[2]=U,h[3]=Y;break;case 4:U=c,Y=i+-O*C,h[2]=U,h[3]=Y;break}}return!1},e.getCardinalDirection=function(t,r,h){return t>r?h:1+h%4},e.getIntersection=function(t,r,h,a){if(a==null)return this.getIntersection2(t,r,h);var o=t.x,p=t.y,i=r.x,g=r.y,l=h.x,f=h.y,E=a.x,y=a.y,d=void 0,N=void 0,v=void 0,L=void 0,s=void 0,u=void 0,c=void 0,A=void 0,_=void 0;return v=g-p,s=o-i,c=i*p-o*g,L=y-f,u=l-E,A=E*f-l*y,_=v*u-L*s,_===0?null:(d=(s*A-u*c)/_,N=(L*c-v*A)/_,new n(d,N))},e.angleOfVector=function(t,r,h,a){var o=void 0;return t!==h?(o=Math.atan((a-r)/(h-t)),h<t?o+=Math.PI:a<r&&(o+=this.TWO_PI)):a<r?o=this.ONE_AND_HALF_PI:o=this.HALF_PI,o},e.doIntersect=function(t,r,h,a){var o=t.x,p=t.y,i=r.x,g=r.y,l=h.x,f=h.y,E=a.x,y=a.y,d=(i-o)*(y-f)-(E-l)*(g-p);if(d===0)return!1;var N=((y-f)*(E-o)+(l-E)*(y-p))/d,v=((p-g)*(E-o)+(i-o)*(y-p))/d;return 0<N&&N<1&&0<v&&v<1},e.HALF_PI=.5*Math.PI,e.ONE_AND_HALF_PI=1.5*Math.PI,e.TWO_PI=2*Math.PI,e.THREE_PI=3*Math.PI,m.exports=e},function(m,I,T){function n(){}n.sign=function(e){return e>0?1:e<0?-1:0},n.floor=function(e){return e<0?Math.ceil(e):Math.floor(e)},n.ceil=function(e){return e<0?Math.floor(e):Math.ceil(e)},m.exports=n},function(m,I,T){function n(){}n.MAX_VALUE=2147483647,n.MIN_VALUE=-2147483648,m.exports=n},function(m,I,T){var n=function(){function o(p,i){for(var g=0;g<i.length;g++){var l=i[g];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(p,l.key,l)}}return function(p,i,g){return i&&o(p.prototype,i),g&&o(p,g),p}}();function e(o,p){if(!(o instanceof p))throw new TypeError("Cannot call a class as a function")}var t=function(o){return{value:o,next:null,prev:null}},r=function(o,p,i,g){return o!==null?o.next=p:g.head=p,i!==null?i.prev=p:g.tail=p,p.prev=o,p.next=i,g.length++,p},h=function(o,p){var i=o.prev,g=o.next;return i!==null?i.next=g:p.head=g,g!==null?g.prev=i:p.tail=i,o.prev=o.next=null,p.length--,o},a=function(){function o(p){var i=this;e(this,o),this.length=0,this.head=null,this.tail=null,p!=null&&p.forEach(function(g){return i.push(g)})}return n(o,[{key:"size",value:function(){return this.length}},{key:"insertBefore",value:function(p,i){return r(i.prev,t(p),i,this)}},{key:"insertAfter",value:function(p,i){return r(i,t(p),i.next,this)}},{key:"insertNodeBefore",value:function(p,i){return r(i.prev,p,i,this)}},{key:"insertNodeAfter",value:function(p,i){return r(i,p,i.next,this)}},{key:"push",value:function(p){return r(this.tail,t(p),null,this)}},{key:"unshift",value:function(p){return r(null,t(p),this.head,this)}},{key:"remove",value:function(p){return h(p,this)}},{key:"pop",value:function(){return h(this.tail,this).value}},{key:"popNode",value:function(){return h(this.tail,this)}},{key:"shift",value:function(){return h(this.head,this).value}},{key:"shiftNode",value:function(){return h(this.head,this)}},{key:"get_object_at",value:function(p){if(p<=this.length()){for(var i=1,g=this.head;i<p;)g=g.next,i++;return g.value}}},{key:"set_object_at",value:function(p,i){if(p<=this.length()){for(var g=1,l=this.head;g<p;)l=l.next,g++;l.value=i}}}]),o}();m.exports=a},function(m,I,T){function n(e,t,r){this.x=null,this.y=null,e==null&&t==null&&r==null?(this.x=0,this.y=0):typeof e=="number"&&typeof t=="number"&&r==null?(this.x=e,this.y=t):e.constructor.name=="Point"&&t==null&&r==null&&(r=e,this.x=r.x,this.y=r.y)}n.prototype.getX=function(){return this.x},n.prototype.getY=function(){return this.y},n.prototype.getLocation=function(){return new n(this.x,this.y)},n.prototype.setLocation=function(e,t,r){e.constructor.name=="Point"&&t==null&&r==null?(r=e,this.setLocation(r.x,r.y)):typeof e=="number"&&typeof t=="number"&&r==null&&(parseInt(e)==e&&parseInt(t)==t?this.move(e,t):(this.x=Math.floor(e+.5),this.y=Math.floor(t+.5)))},n.prototype.move=function(e,t){this.x=e,this.y=t},n.prototype.translate=function(e,t){this.x+=e,this.y+=t},n.prototype.equals=function(e){if(e.constructor.name=="Point"){var t=e;return this.x==t.x&&this.y==t.y}return this==e},n.prototype.toString=function(){return new n().constructor.name+"[x="+this.x+",y="+this.y+"]"},m.exports=n},function(m,I,T){function n(e,t,r,h){this.x=0,this.y=0,this.width=0,this.height=0,e!=null&&t!=null&&r!=null&&h!=null&&(this.x=e,this.y=t,this.width=r,this.height=h)}n.prototype.getX=function(){return this.x},n.prototype.setX=function(e){this.x=e},n.prototype.getY=function(){return this.y},n.prototype.setY=function(e){this.y=e},n.prototype.getWidth=function(){return this.width},n.prototype.setWidth=function(e){this.width=e},n.prototype.getHeight=function(){return this.height},n.prototype.setHeight=function(e){this.height=e},n.prototype.getRight=function(){return this.x+this.width},n.prototype.getBottom=function(){return this.y+this.height},n.prototype.intersects=function(e){return!(this.getRight()<e.x||this.getBottom()<e.y||e.getRight()<this.x||e.getBottom()<this.y)},n.prototype.getCenterX=function(){return this.x+this.width/2},n.prototype.getMinX=function(){return this.getX()},n.prototype.getMaxX=function(){return this.getX()+this.width},n.prototype.getCenterY=function(){return this.y+this.height/2},n.prototype.getMinY=function(){return this.getY()},n.prototype.getMaxY=function(){return this.getY()+this.height},n.prototype.getWidthHalf=function(){return this.width/2},n.prototype.getHeightHalf=function(){return this.height/2},m.exports=n},function(m,I,T){var n=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};function e(){}e.lastID=0,e.createID=function(t){return e.isPrimitive(t)?t:(t.uniqueID!=null||(t.uniqueID=e.getString(),e.lastID++),t.uniqueID)},e.getString=function(t){return t==null&&(t=e.lastID),"Object#"+t},e.isPrimitive=function(t){var r=typeof t>"u"?"undefined":n(t);return t==null||r!="object"&&r!="function"},m.exports=e},function(m,I,T){function n(l){if(Array.isArray(l)){for(var f=0,E=Array(l.length);f<l.length;f++)E[f]=l[f];return E}else return Array.from(l)}var e=T(0),t=T(6),r=T(3),h=T(1),a=T(5),o=T(4),p=T(17),i=T(27);function g(l){i.call(this),this.layoutQuality=e.QUALITY,this.createBendsAsNeeded=e.DEFAULT_CREATE_BENDS_AS_NEEDED,this.incremental=e.DEFAULT_INCREMENTAL,this.animationOnLayout=e.DEFAULT_ANIMATION_ON_LAYOUT,this.animationDuringLayout=e.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=e.DEFAULT_ANIMATION_PERIOD,this.uniformLeafNodeSizes=e.DEFAULT_UNIFORM_LEAF_NODE_SIZES,this.edgeToDummyNodes=new Map,this.graphManager=new t(this),this.isLayoutFinished=!1,this.isSubLayout=!1,this.isRemoteUse=!1,l!=null&&(this.isRemoteUse=l)}g.RANDOM_SEED=1,g.prototype=Object.create(i.prototype),g.prototype.getGraphManager=function(){return this.graphManager},g.prototype.getAllNodes=function(){return this.graphManager.getAllNodes()},g.prototype.getAllEdges=function(){return this.graphManager.getAllEdges()},g.prototype.getAllNodesToApplyGravitation=function(){return this.graphManager.getAllNodesToApplyGravitation()},g.prototype.newGraphManager=function(){var l=new t(this);return this.graphManager=l,l},g.prototype.newGraph=function(l){return new a(null,this.graphManager,l)},g.prototype.newNode=function(l){return new r(this.graphManager,l)},g.prototype.newEdge=function(l){return new h(null,null,l)},g.prototype.checkLayoutSuccess=function(){return this.graphManager.getRoot()==null||this.graphManager.getRoot().getNodes().length==0||this.graphManager.includesInvalidEdge()},g.prototype.runLayout=function(){this.isLayoutFinished=!1,this.tilingPreLayout&&this.tilingPreLayout(),this.initParameters();var l;return this.checkLayoutSuccess()?l=!1:l=this.layout(),e.ANIMATE==="during"?!1:(l&&(this.isSubLayout||this.doPostLayout()),this.tilingPostLayout&&this.tilingPostLayout(),this.isLayoutFinished=!0,l)},g.prototype.doPostLayout=function(){this.incremental||this.transform(),this.update()},g.prototype.update2=function(){if(this.createBendsAsNeeded&&(this.createBendpointsFromDummyNodes(),this.graphManager.resetAllEdges()),!this.isRemoteUse){for(var l=this.graphManager.getAllEdges(),f=0;f<l.length;f++)l[f];for(var E=this.graphManager.getRoot().getNodes(),f=0;f<E.length;f++)E[f];this.update(this.graphManager.getRoot())}},g.prototype.update=function(l){if(l==null)this.update2();else if(l instanceof r){var f=l;if(f.getChild()!=null)for(var E=f.getChild().getNodes(),y=0;y<E.length;y++)update(E[y]);if(f.vGraphObject!=null){var d=f.vGraphObject;d.update(f)}}else if(l instanceof h){var N=l;if(N.vGraphObject!=null){var v=N.vGraphObject;v.update(N)}}else if(l instanceof a){var L=l;if(L.vGraphObject!=null){var s=L.vGraphObject;s.update(L)}}},g.prototype.initParameters=function(){this.isSubLayout||(this.layoutQuality=e.QUALITY,this.animationDuringLayout=e.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=e.DEFAULT_ANIMATION_PERIOD,this.animationOnLayout=e.DEFAULT_ANIMATION_ON_LAYOUT,this.incremental=e.DEFAULT_INCREMENTAL,this.createBendsAsNeeded=e.DEFAULT_CREATE_BENDS_AS_NEEDED,this.uniformLeafNodeSizes=e.DEFAULT_UNIFORM_LEAF_NODE_SIZES),this.animationDuringLayout&&(this.animationOnLayout=!1)},g.prototype.transform=function(l){if(l==null)this.transform(new o(0,0));else{var f=new p,E=this.graphManager.getRoot().updateLeftTop();if(E!=null){f.setWorldOrgX(l.x),f.setWorldOrgY(l.y),f.setDeviceOrgX(E.x),f.setDeviceOrgY(E.y);for(var y=this.getAllNodes(),d,N=0;N<y.length;N++)d=y[N],d.transform(f)}}},g.prototype.positionNodesRandomly=function(l){if(l==null)this.positionNodesRandomly(this.getGraphManager().getRoot()),this.getGraphManager().getRoot().updateBounds(!0);else for(var f,E,y=l.getNodes(),d=0;d<y.length;d++)f=y[d],E=f.getChild(),E==null||E.getNodes().length==0?f.scatter():(this.positionNodesRandomly(E),f.updateBounds())},g.prototype.getFlatForest=function(){for(var l=[],f=!0,E=this.graphManager.getRoot().getNodes(),y=!0,d=0;d<E.length;d++)E[d].getChild()!=null&&(y=!1);if(!y)return l;var N=new Set,v=[],L=new Map,s=[];for(s=s.concat(E);s.length>0&&f;){for(v.push(s[0]);v.length>0&&f;){var u=v[0];v.splice(0,1),N.add(u);for(var c=u.getEdges(),d=0;d<c.length;d++){var A=c[d].getOtherEnd(u);if(L.get(u)!=A)if(!N.has(A))v.push(A),L.set(A,u);else{f=!1;break}}}if(!f)l=[];else{var _=[].concat(n(N));l.push(_);for(var d=0;d<_.length;d++){var O=_[d],D=s.indexOf(O);D>-1&&s.splice(D,1)}N=new Set,L=new Map}}return l},g.prototype.createDummyNodesForBendpoints=function(l){for(var f=[],E=l.source,y=this.graphManager.calcLowestCommonAncestor(l.source,l.target),d=0;d<l.bendpoints.length;d++){var N=this.newNode(null);N.setRect(new Point(0,0),new Dimension(1,1)),y.add(N);var v=this.newEdge(null);this.graphManager.add(v,E,N),f.add(N),E=N}var v=this.newEdge(null);return this.graphManager.add(v,E,l.target),this.edgeToDummyNodes.set(l,f),l.isInterGraph()?this.graphManager.remove(l):y.remove(l),f},g.prototype.createBendpointsFromDummyNodes=function(){var l=[];l=l.concat(this.graphManager.getAllEdges()),l=[].concat(n(this.edgeToDummyNodes.keys())).concat(l);for(var f=0;f<l.length;f++){var E=l[f];if(E.bendpoints.length>0){for(var y=this.edgeToDummyNodes.get(E),d=0;d<y.length;d++){var N=y[d],v=new o(N.getCenterX(),N.getCenterY()),L=E.bendpoints.get(d);L.x=v.x,L.y=v.y,N.getOwner().remove(N)}this.graphManager.add(E,E.source,E.target)}}},g.transform=function(l,f,E,y){if(E!=null&&y!=null){var d=f;if(l<=50){var N=f/E;d-=(f-N)/50*(50-l)}else{var v=f*y;d+=(v-f)/50*(l-50)}return d}else{var L,s;return l<=50?(L=9*f/500,s=f/10):(L=9*f/50,s=-8*f),L*l+s}},g.findCenterOfTree=function(l){var f=[];f=f.concat(l);var E=[],y=new Map,d=!1,N=null;(f.length==1||f.length==2)&&(d=!0,N=f[0]);for(var v=0;v<f.length;v++){var L=f[v],s=L.getNeighborsList().size;y.set(L,L.getNeighborsList().size),s==1&&E.push(L)}var u=[];for(u=u.concat(E);!d;){var c=[];c=c.concat(u),u=[];for(var v=0;v<f.length;v++){var L=f[v],A=f.indexOf(L);A>=0&&f.splice(A,1);var _=L.getNeighborsList();_.forEach(function(w){if(E.indexOf(w)<0){var R=y.get(w),F=R-1;F==1&&u.push(w),y.set(w,F)}})}E=E.concat(u),(f.length==1||f.length==2)&&(d=!0,N=f[0])}return N},g.prototype.setGraphManager=function(l){this.graphManager=l},m.exports=g},function(m,I,T){function n(){}n.seed=1,n.x=0,n.nextDouble=function(){return n.x=Math.sin(n.seed++)*1e4,n.x-Math.floor(n.x)},m.exports=n},function(m,I,T){var n=T(4);function e(t,r){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}e.prototype.getWorldOrgX=function(){return this.lworldOrgX},e.prototype.setWorldOrgX=function(t){this.lworldOrgX=t},e.prototype.getWorldOrgY=function(){return this.lworldOrgY},e.prototype.setWorldOrgY=function(t){this.lworldOrgY=t},e.prototype.getWorldExtX=function(){return this.lworldExtX},e.prototype.setWorldExtX=function(t){this.lworldExtX=t},e.prototype.getWorldExtY=function(){return this.lworldExtY},e.prototype.setWorldExtY=function(t){this.lworldExtY=t},e.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},e.prototype.setDeviceOrgX=function(t){this.ldeviceOrgX=t},e.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},e.prototype.setDeviceOrgY=function(t){this.ldeviceOrgY=t},e.prototype.getDeviceExtX=function(){return this.ldeviceExtX},e.prototype.setDeviceExtX=function(t){this.ldeviceExtX=t},e.prototype.getDeviceExtY=function(){return this.ldeviceExtY},e.prototype.setDeviceExtY=function(t){this.ldeviceExtY=t},e.prototype.transformX=function(t){var r=0,h=this.lworldExtX;return h!=0&&(r=this.ldeviceOrgX+(t-this.lworldOrgX)*this.ldeviceExtX/h),r},e.prototype.transformY=function(t){var r=0,h=this.lworldExtY;return h!=0&&(r=this.ldeviceOrgY+(t-this.lworldOrgY)*this.ldeviceExtY/h),r},e.prototype.inverseTransformX=function(t){var r=0,h=this.ldeviceExtX;return h!=0&&(r=this.lworldOrgX+(t-this.ldeviceOrgX)*this.lworldExtX/h),r},e.prototype.inverseTransformY=function(t){var r=0,h=this.ldeviceExtY;return h!=0&&(r=this.lworldOrgY+(t-this.ldeviceOrgY)*this.lworldExtY/h),r},e.prototype.inverseTransformPoint=function(t){var r=new n(this.inverseTransformX(t.x),this.inverseTransformY(t.y));return r},m.exports=e},function(m,I,T){function n(i){if(Array.isArray(i)){for(var g=0,l=Array(i.length);g<i.length;g++)l[g]=i[g];return l}else return Array.from(i)}var e=T(15),t=T(7),r=T(0),h=T(8),a=T(9);function o(){e.call(this),this.useSmartIdealEdgeLengthCalculation=t.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.idealEdgeLength=t.DEFAULT_EDGE_LENGTH,this.springConstant=t.DEFAULT_SPRING_STRENGTH,this.repulsionConstant=t.DEFAULT_REPULSION_STRENGTH,this.gravityConstant=t.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=t.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=t.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=t.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*t.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=t.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=t.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=t.MAX_ITERATIONS}o.prototype=Object.create(e.prototype);for(var p in e)o[p]=e[p];o.prototype.initParameters=function(){e.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=t.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},o.prototype.calcIdealEdgeLengths=function(){for(var i,g,l,f,E,y,d=this.getGraphManager().getAllEdges(),N=0;N<d.length;N++)i=d[N],i.idealLength=this.idealEdgeLength,i.isInterGraph&&(l=i.getSource(),f=i.getTarget(),E=i.getSourceInLca().getEstimatedSize(),y=i.getTargetInLca().getEstimatedSize(),this.useSmartIdealEdgeLengthCalculation&&(i.idealLength+=E+y-2*r.SIMPLE_NODE_SIZE),g=i.getLca().getInclusionTreeDepth(),i.idealLength+=t.DEFAULT_EDGE_LENGTH*t.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR*(l.getInclusionTreeDepth()+f.getInclusionTreeDepth()-2*g))},o.prototype.initSpringEmbedder=function(){var i=this.getAllNodes().length;this.incremental?(i>t.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*t.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(i-t.ADAPTATION_LOWER_NODE_LIMIT)/(t.ADAPTATION_UPPER_NODE_LIMIT-t.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-t.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=t.MAX_NODE_DISPLACEMENT_INCREMENTAL):(i>t.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(t.COOLING_ADAPTATION_FACTOR,1-(i-t.ADAPTATION_LOWER_NODE_LIMIT)/(t.ADAPTATION_UPPER_NODE_LIMIT-t.ADAPTATION_LOWER_NODE_LIMIT)*(1-t.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=t.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},o.prototype.calcSpringForces=function(){for(var i=this.getAllEdges(),g,l=0;l<i.length;l++)g=i[l],this.calcSpringForce(g,g.idealLength)},o.prototype.calcRepulsionForces=function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,l,f,E,y,d=this.getAllNodes(),N;if(this.useFRGridVariant)for(this.totalIterations%t.GRID_CALCULATION_CHECK_PERIOD==1&&i&&this.updateGrid(),N=new Set,l=0;l<d.length;l++)E=d[l],this.calculateRepulsionForceOfANode(E,N,i,g),N.add(E);else for(l=0;l<d.length;l++)for(E=d[l],f=l+1;f<d.length;f++)y=d[f],E.getOwner()==y.getOwner()&&this.calcRepulsionForce(E,y)},o.prototype.calcGravitationalForces=function(){for(var i,g=this.getAllNodesToApplyGravitation(),l=0;l<g.length;l++)i=g[l],this.calcGravitationalForce(i)},o.prototype.moveNodes=function(){for(var i=this.getAllNodes(),g,l=0;l<i.length;l++)g=i[l],g.move()},o.prototype.calcSpringForce=function(i,g){var l=i.getSource(),f=i.getTarget(),E,y,d,N;if(this.uniformLeafNodeSizes&&l.getChild()==null&&f.getChild()==null)i.updateLengthSimple();else if(i.updateLength(),i.isOverlapingSourceAndTarget)return;E=i.getLength(),E!=0&&(y=this.springConstant*(E-g),d=y*(i.lengthX/E),N=y*(i.lengthY/E),l.springForceX+=d,l.springForceY+=N,f.springForceX-=d,f.springForceY-=N)},o.prototype.calcRepulsionForce=function(i,g){var l=i.getRect(),f=g.getRect(),E=new Array(2),y=new Array(4),d,N,v,L,s,u,c;if(l.intersects(f)){h.calcSeparationAmount(l,f,E,t.DEFAULT_EDGE_LENGTH/2),u=2*E[0],c=2*E[1];var A=i.noOfChildren*g.noOfChildren/(i.noOfChildren+g.noOfChildren);i.repulsionForceX-=A*u,i.repulsionForceY-=A*c,g.repulsionForceX+=A*u,g.repulsionForceY+=A*c}else this.uniformLeafNodeSizes&&i.getChild()==null&&g.getChild()==null?(d=f.getCenterX()-l.getCenterX(),N=f.getCenterY()-l.getCenterY()):(h.getIntersection(l,f,y),d=y[2]-y[0],N=y[3]-y[1]),Math.abs(d)<t.MIN_REPULSION_DIST&&(d=a.sign(d)*t.MIN_REPULSION_DIST),Math.abs(N)<t.MIN_REPULSION_DIST&&(N=a.sign(N)*t.MIN_REPULSION_DIST),v=d*d+N*N,L=Math.sqrt(v),s=this.repulsionConstant*i.noOfChildren*g.noOfChildren/v,u=s*d/L,c=s*N/L,i.repulsionForceX-=u,i.repulsionForceY-=c,g.repulsionForceX+=u,g.repulsionForceY+=c},o.prototype.calcGravitationalForce=function(i){var g,l,f,E,y,d,N,v;g=i.getOwner(),l=(g.getRight()+g.getLeft())/2,f=(g.getTop()+g.getBottom())/2,E=i.getCenterX()-l,y=i.getCenterY()-f,d=Math.abs(E)+i.getWidth()/2,N=Math.abs(y)+i.getHeight()/2,i.getOwner()==this.graphManager.getRoot()?(v=g.getEstimatedSize()*this.gravityRangeFactor,(d>v||N>v)&&(i.gravitationForceX=-this.gravityConstant*E,i.gravitationForceY=-this.gravityConstant*y)):(v=g.getEstimatedSize()*this.compoundGravityRangeFactor,(d>v||N>v)&&(i.gravitationForceX=-this.gravityConstant*E*this.compoundGravityConstant,i.gravitationForceY=-this.gravityConstant*y*this.compoundGravityConstant))},o.prototype.isConverged=function(){var i,g=!1;return this.totalIterations>this.maxIterations/3&&(g=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),i=this.totalDisplacement<this.totalDisplacementThreshold,this.oldTotalDisplacement=this.totalDisplacement,i||g},o.prototype.animate=function(){this.animationDuringLayout&&!this.isSubLayout&&(this.notAnimatedIterations==this.animationPeriod?(this.update(),this.notAnimatedIterations=0):this.notAnimatedIterations++)},o.prototype.calcNoOfChildrenForAllNodes=function(){for(var i,g=this.graphManager.getAllNodes(),l=0;l<g.length;l++)i=g[l],i.noOfChildren=i.getNoOfChildren()},o.prototype.calcGrid=function(i){var g=0,l=0;g=parseInt(Math.ceil((i.getRight()-i.getLeft())/this.repulsionRange)),l=parseInt(Math.ceil((i.getBottom()-i.getTop())/this.repulsionRange));for(var f=new Array(g),E=0;E<g;E++)f[E]=new Array(l);for(var E=0;E<g;E++)for(var y=0;y<l;y++)f[E][y]=new Array;return f},o.prototype.addNodeToGrid=function(i,g,l){var f=0,E=0,y=0,d=0;f=parseInt(Math.floor((i.getRect().x-g)/this.repulsionRange)),E=parseInt(Math.floor((i.getRect().width+i.getRect().x-g)/this.repulsionRange)),y=parseInt(Math.floor((i.getRect().y-l)/this.repulsionRange)),d=parseInt(Math.floor((i.getRect().height+i.getRect().y-l)/this.repulsionRange));for(var N=f;N<=E;N++)for(var v=y;v<=d;v++)this.grid[N][v].push(i),i.setGridCoordinates(f,E,y,d)},o.prototype.updateGrid=function(){var i,g,l=this.getAllNodes();for(this.grid=this.calcGrid(this.graphManager.getRoot()),i=0;i<l.length;i++)g=l[i],this.addNodeToGrid(g,this.graphManager.getRoot().getLeft(),this.graphManager.getRoot().getTop())},o.prototype.calculateRepulsionForceOfANode=function(i,g,l,f){if(this.totalIterations%t.GRID_CALCULATION_CHECK_PERIOD==1&&l||f){var E=new Set;i.surrounding=new Array;for(var y,d=this.grid,N=i.startX-1;N<i.finishX+2;N++)for(var v=i.startY-1;v<i.finishY+2;v++)if(!(N<0||v<0||N>=d.length||v>=d[0].length)){for(var L=0;L<d[N][v].length;L++)if(y=d[N][v][L],!(i.getOwner()!=y.getOwner()||i==y)&&!g.has(y)&&!E.has(y)){var s=Math.abs(i.getCenterX()-y.getCenterX())-(i.getWidth()/2+y.getWidth()/2),u=Math.abs(i.getCenterY()-y.getCenterY())-(i.getHeight()/2+y.getHeight()/2);s<=this.repulsionRange&&u<=this.repulsionRange&&E.add(y)}}i.surrounding=[].concat(n(E))}for(N=0;N<i.surrounding.length;N++)this.calcRepulsionForce(i,i.surrounding[N])},o.prototype.calcRepulsionRange=function(){return 0},m.exports=o},function(m,I,T){var n=T(1),e=T(7);function t(h,a,o){n.call(this,h,a,o),this.idealLength=e.DEFAULT_EDGE_LENGTH}t.prototype=Object.create(n.prototype);for(var r in n)t[r]=n[r];m.exports=t},function(m,I,T){var n=T(3);function e(r,h,a,o){n.call(this,r,h,a,o),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=[]}e.prototype=Object.create(n.prototype);for(var t in n)e[t]=n[t];e.prototype.setGridCoordinates=function(r,h,a,o){this.startX=r,this.finishX=h,this.startY=a,this.finishY=o},m.exports=e},function(m,I,T){function n(e,t){this.width=0,this.height=0,e!==null&&t!==null&&(this.height=t,this.width=e)}n.prototype.getWidth=function(){return this.width},n.prototype.setWidth=function(e){this.width=e},n.prototype.getHeight=function(){return this.height},n.prototype.setHeight=function(e){this.height=e},m.exports=n},function(m,I,T){var n=T(14);function e(){this.map={},this.keys=[]}e.prototype.put=function(t,r){var h=n.createID(t);this.contains(h)||(this.map[h]=r,this.keys.push(t))},e.prototype.contains=function(t){return n.createID(t),this.map[t]!=null},e.prototype.get=function(t){var r=n.createID(t);return this.map[r]},e.prototype.keySet=function(){return this.keys},m.exports=e},function(m,I,T){var n=T(14);function e(){this.set={}}e.prototype.add=function(t){var r=n.createID(t);this.contains(r)||(this.set[r]=t)},e.prototype.remove=function(t){delete this.set[n.createID(t)]},e.prototype.clear=function(){this.set={}},e.prototype.contains=function(t){return this.set[n.createID(t)]==t},e.prototype.isEmpty=function(){return this.size()===0},e.prototype.size=function(){return Object.keys(this.set).length},e.prototype.addAllTo=function(t){for(var r=Object.keys(this.set),h=r.length,a=0;a<h;a++)t.push(this.set[r[a]])},e.prototype.size=function(){return Object.keys(this.set).length},e.prototype.addAll=function(t){for(var r=t.length,h=0;h<r;h++){var a=t[h];this.add(a)}},m.exports=e},function(m,I,T){var n=function(){function h(a,o){for(var p=0;p<o.length;p++){var i=o[p];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(a,i.key,i)}}return function(a,o,p){return o&&h(a.prototype,o),p&&h(a,p),a}}();function e(h,a){if(!(h instanceof a))throw new TypeError("Cannot call a class as a function")}var t=T(11),r=function(){function h(a,o){e(this,h),(o!==null||o!==void 0)&&(this.compareFunction=this._defaultCompareFunction);var p=void 0;a instanceof t?p=a.size():p=a.length,this._quicksort(a,0,p-1)}return n(h,[{key:"_quicksort",value:function(a,o,p){if(o<p){var i=this._partition(a,o,p);this._quicksort(a,o,i),this._quicksort(a,i+1,p)}}},{key:"_partition",value:function(a,o,p){for(var i=this._get(a,o),g=o,l=p;;){for(;this.compareFunction(i,this._get(a,l));)l--;for(;this.compareFunction(this._get(a,g),i);)g++;if(g<l)this._swap(a,g,l),g++,l--;else return l}}},{key:"_get",value:function(a,o){return a instanceof t?a.get_object_at(o):a[o]}},{key:"_set",value:function(a,o,p){a instanceof t?a.set_object_at(o,p):a[o]=p}},{key:"_swap",value:function(a,o,p){var i=this._get(a,o);this._set(a,o,this._get(a,p)),this._set(a,p,i)}},{key:"_defaultCompareFunction",value:function(a,o){return o>a}}]),h}();m.exports=r},function(m,I,T){var n=function(){function r(h,a){for(var o=0;o<a.length;o++){var p=a[o];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(h,p.key,p)}}return function(h,a,o){return a&&r(h.prototype,a),o&&r(h,o),h}}();function e(r,h){if(!(r instanceof h))throw new TypeError("Cannot call a class as a function")}var t=function(){function r(h,a){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,p=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;e(this,r),this.sequence1=h,this.sequence2=a,this.match_score=o,this.mismatch_penalty=p,this.gap_penalty=i,this.iMax=h.length+1,this.jMax=a.length+1,this.grid=new Array(this.iMax);for(var g=0;g<this.iMax;g++){this.grid[g]=new Array(this.jMax);for(var l=0;l<this.jMax;l++)this.grid[g][l]=0}this.tracebackGrid=new Array(this.iMax);for(var f=0;f<this.iMax;f++){this.tracebackGrid[f]=new Array(this.jMax);for(var E=0;E<this.jMax;E++)this.tracebackGrid[f][E]=[null,null,null]}this.alignments=[],this.score=-1,this.computeGrids()}return n(r,[{key:"getScore",value:function(){return this.score}},{key:"getAlignments",value:function(){return this.alignments}},{key:"computeGrids",value:function(){for(var h=1;h<this.jMax;h++)this.grid[0][h]=this.grid[0][h-1]+this.gap_penalty,this.tracebackGrid[0][h]=[!1,!1,!0];for(var a=1;a<this.iMax;a++)this.grid[a][0]=this.grid[a-1][0]+this.gap_penalty,this.tracebackGrid[a][0]=[!1,!0,!1];for(var o=1;o<this.iMax;o++)for(var p=1;p<this.jMax;p++){var i=void 0;this.sequence1[o-1]===this.sequence2[p-1]?i=this.grid[o-1][p-1]+this.match_score:i=this.grid[o-1][p-1]+this.mismatch_penalty;var g=this.grid[o-1][p]+this.gap_penalty,l=this.grid[o][p-1]+this.gap_penalty,f=[i,g,l],E=this.arrayAllMaxIndexes(f);this.grid[o][p]=f[E[0]],this.tracebackGrid[o][p]=[E.includes(0),E.includes(1),E.includes(2)]}this.score=this.grid[this.iMax-1][this.jMax-1]}},{key:"alignmentTraceback",value:function(){var h=[];for(h.push({pos:[this.sequence1.length,this.sequence2.length],seq1:"",seq2:""});h[0];){var a=h[0],o=this.tracebackGrid[a.pos[0]][a.pos[1]];o[0]&&h.push({pos:[a.pos[0]-1,a.pos[1]-1],seq1:this.sequence1[a.pos[0]-1]+a.seq1,seq2:this.sequence2[a.pos[1]-1]+a.seq2}),o[1]&&h.push({pos:[a.pos[0]-1,a.pos[1]],seq1:this.sequence1[a.pos[0]-1]+a.seq1,seq2:"-"+a.seq2}),o[2]&&h.push({pos:[a.pos[0],a.pos[1]-1],seq1:"-"+a.seq1,seq2:this.sequence2[a.pos[1]-1]+a.seq2}),a.pos[0]===0&&a.pos[1]===0&&this.alignments.push({sequence1:a.seq1,sequence2:a.seq2}),h.shift()}return this.alignments}},{key:"getAllIndexes",value:function(h,a){for(var o=[],p=-1;(p=h.indexOf(a,p+1))!==-1;)o.push(p);return o}},{key:"arrayAllMaxIndexes",value:function(h){return this.getAllIndexes(h,Math.max.apply(null,h))}}]),r}();m.exports=t},function(m,I,T){var n=function(){};n.FDLayout=T(18),n.FDLayoutConstants=T(7),n.FDLayoutEdge=T(19),n.FDLayoutNode=T(20),n.DimensionD=T(21),n.HashMap=T(22),n.HashSet=T(23),n.IGeometry=T(8),n.IMath=T(9),n.Integer=T(10),n.Point=T(12),n.PointD=T(4),n.RandomSeed=T(16),n.RectangleD=T(13),n.Transform=T(17),n.UniqueIDGeneretor=T(14),n.Quicksort=T(24),n.LinkedList=T(11),n.LGraphObject=T(2),n.LGraph=T(5),n.LEdge=T(1),n.LGraphManager=T(6),n.LNode=T(3),n.Layout=T(15),n.LayoutConstants=T(0),n.NeedlemanWunsch=T(25),m.exports=n},function(m,I,T){function n(){this.listeners=[]}var e=n.prototype;e.addListener=function(t,r){this.listeners.push({event:t,callback:r})},e.removeListener=function(t,r){for(var h=this.listeners.length;h>=0;h--){var a=this.listeners[h];a.event===t&&a.callback===r&&this.listeners.splice(h,1)}},e.emit=function(t,r){for(var h=0;h<this.listeners.length;h++){var a=this.listeners[h];t===a.event&&a.callback(r)}},m.exports=n}])})}(q)),q.exports}var dt=z.exports,K;function pt(){return K||(K=1,function(x,X){(function(m,I){x.exports=I(ct())})(dt,function(m){return function(I){var T={};function n(e){if(T[e])return T[e].exports;var t=T[e]={i:e,l:!1,exports:{}};return I[e].call(t.exports,t,t.exports,n),t.l=!0,t.exports}return n.m=I,n.c=T,n.i=function(e){return e},n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=7)}([function(I,T){I.exports=m},function(I,T,n){var e=n(0).FDLayoutConstants;function t(){}for(var r in e)t[r]=e[r];t.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,t.DEFAULT_RADIAL_SEPARATION=e.DEFAULT_EDGE_LENGTH,t.DEFAULT_COMPONENT_SEPERATION=60,t.TILE=!0,t.TILING_PADDING_VERTICAL=10,t.TILING_PADDING_HORIZONTAL=10,t.TREE_REDUCTION_ON_INCREMENTAL=!1,I.exports=t},function(I,T,n){var e=n(0).FDLayoutEdge;function t(h,a,o){e.call(this,h,a,o)}t.prototype=Object.create(e.prototype);for(var r in e)t[r]=e[r];I.exports=t},function(I,T,n){var e=n(0).LGraph;function t(h,a,o){e.call(this,h,a,o)}t.prototype=Object.create(e.prototype);for(var r in e)t[r]=e[r];I.exports=t},function(I,T,n){var e=n(0).LGraphManager;function t(h){e.call(this,h)}t.prototype=Object.create(e.prototype);for(var r in e)t[r]=e[r];I.exports=t},function(I,T,n){var e=n(0).FDLayoutNode,t=n(0).IMath;function r(a,o,p,i){e.call(this,a,o,p,i)}r.prototype=Object.create(e.prototype);for(var h in e)r[h]=e[h];r.prototype.move=function(){var a=this.graphManager.getLayout();this.displacementX=a.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY=a.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren,Math.abs(this.displacementX)>a.coolingFactor*a.maxNodeDisplacement&&(this.displacementX=a.coolingFactor*a.maxNodeDisplacement*t.sign(this.displacementX)),Math.abs(this.displacementY)>a.coolingFactor*a.maxNodeDisplacement&&(this.displacementY=a.coolingFactor*a.maxNodeDisplacement*t.sign(this.displacementY)),this.child==null?this.moveBy(this.displacementX,this.displacementY):this.child.getNodes().length==0?this.moveBy(this.displacementX,this.displacementY):this.propogateDisplacementToChildren(this.displacementX,this.displacementY),a.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},r.prototype.propogateDisplacementToChildren=function(a,o){for(var p=this.getChild().getNodes(),i,g=0;g<p.length;g++)i=p[g],i.getChild()==null?(i.moveBy(a,o),i.displacementX+=a,i.displacementY+=o):i.propogateDisplacementToChildren(a,o)},r.prototype.setPred1=function(a){this.pred1=a},r.prototype.getPred1=function(){return pred1},r.prototype.getPred2=function(){return pred2},r.prototype.setNext=function(a){this.next=a},r.prototype.getNext=function(){return next},r.prototype.setProcessed=function(a){this.processed=a},r.prototype.isProcessed=function(){return processed},I.exports=r},function(I,T,n){var e=n(0).FDLayout,t=n(4),r=n(3),h=n(5),a=n(2),o=n(1),p=n(0).FDLayoutConstants,i=n(0).LayoutConstants,g=n(0).Point,l=n(0).PointD,f=n(0).Layout,E=n(0).Integer,y=n(0).IGeometry,d=n(0).LGraph,N=n(0).Transform;function v(){e.call(this),this.toBeTiled={}}v.prototype=Object.create(e.prototype);for(var L in e)v[L]=e[L];v.prototype.newGraphManager=function(){var s=new t(this);return this.graphManager=s,s},v.prototype.newGraph=function(s){return new r(null,this.graphManager,s)},v.prototype.newNode=function(s){return new h(this.graphManager,s)},v.prototype.newEdge=function(s){return new a(null,null,s)},v.prototype.initParameters=function(){e.prototype.initParameters.call(this,arguments),this.isSubLayout||(o.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=o.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=o.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.springConstant=p.DEFAULT_SPRING_STRENGTH,this.repulsionConstant=p.DEFAULT_REPULSION_STRENGTH,this.gravityConstant=p.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=p.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=p.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=p.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1,this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/p.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=p.CONVERGENCE_CHECK_PERIOD/this.maxIterations,this.coolingAdjuster=1)},v.prototype.layout=function(){var s=i.DEFAULT_CREATE_BENDS_AS_NEEDED;return s&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},v.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(o.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var s=new Set(this.getAllNodes()),u=this.nodesWithGravity.filter(function(A){return s.has(A)});this.graphManager.setAllNodesToApplyGravitation(u)}}else{var c=this.getFlatForest();if(c.length>0)this.positionNodesRadially(c);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var s=new Set(this.getAllNodes()),u=this.nodesWithGravity.filter(function(O){return s.has(O)});this.graphManager.setAllNodesToApplyGravitation(u),this.positionNodesRandomly()}}return this.initSpringEmbedder(),this.runSpringEmbedder(),!0},v.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%p.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var s=new Set(this.getAllNodes()),u=this.nodesWithGravity.filter(function(_){return s.has(_)});this.graphManager.setAllNodesToApplyGravitation(u),this.graphManager.updateBounds(),this.updateGrid(),this.coolingFactor=p.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()),this.coolingFactor=p.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var c=!this.isTreeGrowing&&!this.isGrowthFinished,A=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(c,A),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},v.prototype.getPositionsData=function(){for(var s=this.graphManager.getAllNodes(),u={},c=0;c<s.length;c++){var A=s[c].rect,_=s[c].id;u[_]={id:_,x:A.getCenterX(),y:A.getCenterY(),w:A.width,h:A.height}}return u},v.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var s=!1;if(p.ANIMATE==="during")this.emit("layoutstarted");else{for(;!s;)s=this.tick();this.graphManager.updateBounds()}},v.prototype.calculateNodesToApplyGravitationTo=function(){var s=[],u,c=this.graphManager.getGraphs(),A=c.length,_;for(_=0;_<A;_++)u=c[_],u.updateConnected(),u.isConnected||(s=s.concat(u.getNodes()));return s},v.prototype.createBendpoints=function(){var s=[];s=s.concat(this.graphManager.getAllEdges());var u=new Set,c;for(c=0;c<s.length;c++){var A=s[c];if(!u.has(A)){var _=A.getSource(),O=A.getTarget();if(_==O)A.getBendpoints().push(new l),A.getBendpoints().push(new l),this.createDummyNodesForBendpoints(A),u.add(A);else{var D=[];if(D=D.concat(_.getEdgeListToNode(O)),D=D.concat(O.getEdgeListToNode(_)),!u.has(D[0])){if(D.length>1){var w;for(w=0;w<D.length;w++){var R=D[w];R.getBendpoints().push(new l),this.createDummyNodesForBendpoints(R)}}D.forEach(function(F){u.add(F)})}}}if(u.size==s.length)break}},v.prototype.positionNodesRadially=function(s){for(var u=new g(0,0),c=Math.ceil(Math.sqrt(s.length)),A=0,_=0,O=0,D=new l(0,0),w=0;w<s.length;w++){w%c==0&&(O=0,_=A,w!=0&&(_+=o.DEFAULT_COMPONENT_SEPERATION),A=0);var R=s[w],F=f.findCenterOfTree(R);u.x=O,u.y=_,D=v.radialLayout(R,F,u),D.y>A&&(A=Math.floor(D.y)),O=Math.floor(D.x+o.DEFAULT_COMPONENT_SEPERATION)}this.transform(new l(i.WORLD_CENTER_X-D.x/2,i.WORLD_CENTER_Y-D.y/2))},v.radialLayout=function(s,u,c){var A=Math.max(this.maxDiagonalInTree(s),o.DEFAULT_RADIAL_SEPARATION);v.branchRadialLayout(u,null,0,359,0,A);var _=d.calculateBounds(s),O=new N;O.setDeviceOrgX(_.getMinX()),O.setDeviceOrgY(_.getMinY()),O.setWorldOrgX(c.x),O.setWorldOrgY(c.y);for(var D=0;D<s.length;D++){var w=s[D];w.transform(O)}var R=new l(_.getMaxX(),_.getMaxY());return O.inverseTransformPoint(R)},v.branchRadialLayout=function(s,u,c,A,_,O){var D=(A-c+1)/2;D<0&&(D+=180);var w=(D+c)%360,R=w*y.TWO_PI/360,F=_*Math.cos(R),b=_*Math.sin(R);s.setCenter(F,b);var C=[];C=C.concat(s.getEdges());var M=C.length;u!=null&&M--;for(var G=0,P=C.length,S,U=s.getEdgesBetween(u);U.length>1;){var Y=U[0];U.splice(0,1);var B=C.indexOf(Y);B>=0&&C.splice(B,1),P--,M--}u!=null?S=(C.indexOf(U[0])+1)%P:S=0;for(var H=Math.abs(A-c)/M,k=S;G!=M;k=++k%P){var Z=C[k].getOtherEnd(s);if(Z!=u){var Q=(c+G*H)%360,ht=(Q+H)%360;v.branchRadialLayout(Z,s,Q,ht,_+O,O),G++}}},v.maxDiagonalInTree=function(s){for(var u=E.MIN_VALUE,c=0;c<s.length;c++){var A=s[c],_=A.getDiagonal();_>u&&(u=_)}return u},v.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},v.prototype.groupZeroDegreeMembers=function(){var s=this,u={};this.memberGroups={},this.idToDummyNode={};for(var c=[],A=this.graphManager.getAllNodes(),_=0;_<A.length;_++){var O=A[_],D=O.getParent();this.getNodeDegreeWithChildren(O)===0&&(D.id==null||!this.getToBeTiled(D))&&c.push(O)}for(var _=0;_<c.length;_++){var O=c[_],w=O.getParent().id;typeof u[w]>"u"&&(u[w]=[]),u[w]=u[w].concat(O)}Object.keys(u).forEach(function(R){if(u[R].length>1){var F="DummyCompound_"+R;s.memberGroups[F]=u[R];var b=u[R][0].getParent(),C=new h(s.graphManager);C.id=F,C.paddingLeft=b.paddingLeft||0,C.paddingRight=b.paddingRight||0,C.paddingBottom=b.paddingBottom||0,C.paddingTop=b.paddingTop||0,s.idToDummyNode[F]=C;var M=s.getGraphManager().add(s.newGraph(),C),G=b.getChild();G.add(C);for(var P=0;P<u[R].length;P++){var S=u[R][P];G.remove(S),M.add(S)}}})},v.prototype.clearCompounds=function(){var s={},u={};this.performDFSOnCompounds();for(var c=0;c<this.compoundOrder.length;c++)u[this.compoundOrder[c].id]=this.compoundOrder[c],s[this.compoundOrder[c].id]=[].concat(this.compoundOrder[c].getChild().getNodes()),this.graphManager.remove(this.compoundOrder[c].getChild()),this.compoundOrder[c].child=null;this.graphManager.resetAllNodes(),this.tileCompoundMembers(s,u)},v.prototype.clearZeroDegreeMembers=function(){var s=this,u=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach(function(c){var A=s.idToDummyNode[c];u[c]=s.tileNodes(s.memberGroups[c],A.paddingLeft+A.paddingRight),A.rect.width=u[c].width,A.rect.height=u[c].height})},v.prototype.repopulateCompounds=function(){for(var s=this.compoundOrder.length-1;s>=0;s--){var u=this.compoundOrder[s],c=u.id,A=u.paddingLeft,_=u.paddingTop;this.adjustLocations(this.tiledMemberPack[c],u.rect.x,u.rect.y,A,_)}},v.prototype.repopulateZeroDegreeMembers=function(){var s=this,u=this.tiledZeroDegreePack;Object.keys(u).forEach(function(c){var A=s.idToDummyNode[c],_=A.paddingLeft,O=A.paddingTop;s.adjustLocations(u[c],A.rect.x,A.rect.y,_,O)})},v.prototype.getToBeTiled=function(s){var u=s.id;if(this.toBeTiled[u]!=null)return this.toBeTiled[u];var c=s.getChild();if(c==null)return this.toBeTiled[u]=!1,!1;for(var A=c.getNodes(),_=0;_<A.length;_++){var O=A[_];if(this.getNodeDegree(O)>0)return this.toBeTiled[u]=!1,!1;if(O.getChild()==null){this.toBeTiled[O.id]=!1;continue}if(!this.getToBeTiled(O))return this.toBeTiled[u]=!1,!1}return this.toBeTiled[u]=!0,!0},v.prototype.getNodeDegree=function(s){s.id;for(var u=s.getEdges(),c=0,A=0;A<u.length;A++){var _=u[A];_.getSource().id!==_.getTarget().id&&(c=c+1)}return c},v.prototype.getNodeDegreeWithChildren=function(s){var u=this.getNodeDegree(s);if(s.getChild()==null)return u;for(var c=s.getChild().getNodes(),A=0;A<c.length;A++){var _=c[A];u+=this.getNodeDegreeWithChildren(_)}return u},v.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},v.prototype.fillCompexOrderByDFS=function(s){for(var u=0;u<s.length;u++){var c=s[u];c.getChild()!=null&&this.fillCompexOrderByDFS(c.getChild().getNodes()),this.getToBeTiled(c)&&this.compoundOrder.push(c)}},v.prototype.adjustLocations=function(s,u,c,A,_){u+=A,c+=_;for(var O=u,D=0;D<s.rows.length;D++){var w=s.rows[D];u=O;for(var R=0,F=0;F<w.length;F++){var b=w[F];b.rect.x=u,b.rect.y=c,u+=b.rect.width+s.horizontalPadding,b.rect.height>R&&(R=b.rect.height)}c+=R+s.verticalPadding}},v.prototype.tileCompoundMembers=function(s,u){var c=this;this.tiledMemberPack=[],Object.keys(s).forEach(function(A){var _=u[A];c.tiledMemberPack[A]=c.tileNodes(s[A],_.paddingLeft+_.paddingRight),_.rect.width=c.tiledMemberPack[A].width,_.rect.height=c.tiledMemberPack[A].height})},v.prototype.tileNodes=function(s,u){var c=o.TILING_PADDING_VERTICAL,A=o.TILING_PADDING_HORIZONTAL,_={rows:[],rowWidth:[],rowHeight:[],width:0,height:u,verticalPadding:c,horizontalPadding:A};s.sort(function(w,R){return w.rect.width*w.rect.height>R.rect.width*R.rect.height?-1:w.rect.width*w.rect.height<R.rect.width*R.rect.height?1:0});for(var O=0;O<s.length;O++){var D=s[O];_.rows.length==0?this.insertNodeToRow(_,D,0,u):this.canAddHorizontal(_,D.rect.width,D.rect.height)?this.insertNodeToRow(_,D,this.getShortestRowIndex(_),u):this.insertNodeToRow(_,D,_.rows.length,u),this.shiftToLastRow(_)}return _},v.prototype.insertNodeToRow=function(s,u,c,A){var _=A;if(c==s.rows.length){var O=[];s.rows.push(O),s.rowWidth.push(_),s.rowHeight.push(0)}var D=s.rowWidth[c]+u.rect.width;s.rows[c].length>0&&(D+=s.horizontalPadding),s.rowWidth[c]=D,s.width<D&&(s.width=D);var w=u.rect.height;c>0&&(w+=s.verticalPadding);var R=0;w>s.rowHeight[c]&&(R=s.rowHeight[c],s.rowHeight[c]=w,R=s.rowHeight[c]-R),s.height+=R,s.rows[c].push(u)},v.prototype.getShortestRowIndex=function(s){for(var u=-1,c=Number.MAX_VALUE,A=0;A<s.rows.length;A++)s.rowWidth[A]<c&&(u=A,c=s.rowWidth[A]);return u},v.prototype.getLongestRowIndex=function(s){for(var u=-1,c=Number.MIN_VALUE,A=0;A<s.rows.length;A++)s.rowWidth[A]>c&&(u=A,c=s.rowWidth[A]);return u},v.prototype.canAddHorizontal=function(s,u,c){var A=this.getShortestRowIndex(s);if(A<0)return!0;var _=s.rowWidth[A];if(_+s.horizontalPadding+u<=s.width)return!0;var O=0;s.rowHeight[A]<c&&A>0&&(O=c+s.verticalPadding-s.rowHeight[A]);var D;s.width-_>=u+s.horizontalPadding?D=(s.height+O)/(_+u+s.horizontalPadding):D=(s.height+O)/s.width,O=c+s.verticalPadding;var w;return s.width<u?w=(s.height+O)/u:w=(s.height+O)/s.width,w<1&&(w=1/w),D<1&&(D=1/D),D<w},v.prototype.shiftToLastRow=function(s){var u=this.getLongestRowIndex(s),c=s.rowWidth.length-1,A=s.rows[u],_=A[A.length-1],O=_.width+s.horizontalPadding;if(s.width-s.rowWidth[c]>O&&u!=c){A.splice(-1,1),s.rows[c].push(_),s.rowWidth[u]=s.rowWidth[u]-O,s.rowWidth[c]=s.rowWidth[c]+O,s.width=s.rowWidth[instance.getLongestRowIndex(s)];for(var D=Number.MIN_VALUE,w=0;w<A.length;w++)A[w].height>D&&(D=A[w].height);u>0&&(D+=s.verticalPadding);var R=s.rowHeight[u]+s.rowHeight[c];s.rowHeight[u]=D,s.rowHeight[c]<_.height+s.verticalPadding&&(s.rowHeight[c]=_.height+s.verticalPadding);var F=s.rowHeight[u]+s.rowHeight[c];s.height+=F-R,this.shiftToLastRow(s)}},v.prototype.tilingPreLayout=function(){o.TILE&&(this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers())},v.prototype.tilingPostLayout=function(){o.TILE&&(this.repopulateZeroDegreeMembers(),this.repopulateCompounds())},v.prototype.reduceTrees=function(){for(var s=[],u=!0,c;u;){var A=this.graphManager.getAllNodes(),_=[];u=!1;for(var O=0;O<A.length;O++)c=A[O],c.getEdges().length==1&&!c.getEdges()[0].isInterGraph&&c.getChild()==null&&(_.push([c,c.getEdges()[0],c.getOwner()]),u=!0);if(u==!0){for(var D=[],w=0;w<_.length;w++)_[w][0].getEdges().length==1&&(D.push(_[w]),_[w][0].getOwner().remove(_[w][0]));s.push(D),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=s},v.prototype.growTree=function(s){for(var u=s.length,c=s[u-1],A,_=0;_<c.length;_++)A=c[_],this.findPlaceforPrunedNode(A),A[2].add(A[0]),A[2].add(A[1],A[1].source,A[1].target);s.splice(s.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},v.prototype.findPlaceforPrunedNode=function(s){var u,c,A=s[0];A==s[1].source?c=s[1].target:c=s[1].source;var _=c.startX,O=c.finishX,D=c.startY,w=c.finishY,R=0,F=0,b=0,C=0,M=[R,b,F,C];if(D>0)for(var G=_;G<=O;G++)M[0]+=this.grid[G][D-1].length+this.grid[G][D].length-1;if(O<this.grid.length-1)for(var G=D;G<=w;G++)M[1]+=this.grid[O+1][G].length+this.grid[O][G].length-1;if(w<this.grid[0].length-1)for(var G=_;G<=O;G++)M[2]+=this.grid[G][w+1].length+this.grid[G][w].length-1;if(_>0)for(var G=D;G<=w;G++)M[3]+=this.grid[_-1][G].length+this.grid[_][G].length-1;for(var P=E.MAX_VALUE,S,U,Y=0;Y<M.length;Y++)M[Y]<P?(P=M[Y],S=1,U=Y):M[Y]==P&&S++;if(S==3&&P==0)M[0]==0&&M[1]==0&&M[2]==0?u=1:M[0]==0&&M[1]==0&&M[3]==0?u=0:M[0]==0&&M[2]==0&&M[3]==0?u=3:M[1]==0&&M[2]==0&&M[3]==0&&(u=2);else if(S==2&&P==0){var B=Math.floor(Math.random()*2);M[0]==0&&M[1]==0?B==0?u=0:u=1:M[0]==0&&M[2]==0?B==0?u=0:u=2:M[0]==0&&M[3]==0?B==0?u=0:u=3:M[1]==0&&M[2]==0?B==0?u=1:u=2:M[1]==0&&M[3]==0?B==0?u=1:u=3:B==0?u=2:u=3}else if(S==4&&P==0){var B=Math.floor(Math.random()*4);u=B}else u=U;u==0?A.setCenter(c.getCenterX(),c.getCenterY()-c.getHeight()/2-p.DEFAULT_EDGE_LENGTH-A.getHeight()/2):u==1?A.setCenter(c.getCenterX()+c.getWidth()/2+p.DEFAULT_EDGE_LENGTH+A.getWidth()/2,c.getCenterY()):u==2?A.setCenter(c.getCenterX(),c.getCenterY()+c.getHeight()/2+p.DEFAULT_EDGE_LENGTH+A.getHeight()/2):A.setCenter(c.getCenterX()-c.getWidth()/2-p.DEFAULT_EDGE_LENGTH-A.getWidth()/2,c.getCenterY())},I.exports=v},function(I,T,n){var e={};e.layoutBase=n(0),e.CoSEConstants=n(1),e.CoSEEdge=n(2),e.CoSEGraph=n(3),e.CoSEGraphManager=n(4),e.CoSELayout=n(6),e.CoSENode=n(5),I.exports=e}])})}(z)),z.exports}var ft=V.exports,J;function yt(){return J||(J=1,function(x,X){(function(m,I){x.exports=I(pt())})(ft,function(m){return function(I){var T={};function n(e){if(T[e])return T[e].exports;var t=T[e]={i:e,l:!1,exports:{}};return I[e].call(t.exports,t,t.exports,n),t.l=!0,t.exports}return n.m=I,n.c=T,n.i=function(e){return e},n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=1)}([function(I,T){I.exports=m},function(I,T,n){var e=n(0).layoutBase.LayoutConstants,t=n(0).layoutBase.FDLayoutConstants,r=n(0).CoSEConstants,h=n(0).CoSELayout,a=n(0).CoSENode,o=n(0).layoutBase.PointD,p=n(0).layoutBase.DimensionD,i={ready:function(){},stop:function(){},quality:"default",nodeDimensionsIncludeLabels:!1,refresh:30,fit:!0,padding:10,randomize:!0,nodeRepulsion:4500,idealEdgeLength:50,edgeElasticity:.45,nestingFactor:.1,gravity:.25,numIter:2500,tile:!0,animate:"end",animationDuration:500,tilingPaddingVertical:10,tilingPaddingHorizontal:10,gravityRangeCompound:1.5,gravityCompound:1,gravityRange:3.8,initialEnergyOnIncremental:.5};function g(y,d){var N={};for(var v in y)N[v]=y[v];for(var v in d)N[v]=d[v];return N}function l(y){this.options=g(i,y),f(this.options)}var f=function(y){y.nodeRepulsion!=null&&(r.DEFAULT_REPULSION_STRENGTH=t.DEFAULT_REPULSION_STRENGTH=y.nodeRepulsion),y.idealEdgeLength!=null&&(r.DEFAULT_EDGE_LENGTH=t.DEFAULT_EDGE_LENGTH=y.idealEdgeLength),y.edgeElasticity!=null&&(r.DEFAULT_SPRING_STRENGTH=t.DEFAULT_SPRING_STRENGTH=y.edgeElasticity),y.nestingFactor!=null&&(r.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=t.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=y.nestingFactor),y.gravity!=null&&(r.DEFAULT_GRAVITY_STRENGTH=t.DEFAULT_GRAVITY_STRENGTH=y.gravity),y.numIter!=null&&(r.MAX_ITERATIONS=t.MAX_ITERATIONS=y.numIter),y.gravityRange!=null&&(r.DEFAULT_GRAVITY_RANGE_FACTOR=t.DEFAULT_GRAVITY_RANGE_FACTOR=y.gravityRange),y.gravityCompound!=null&&(r.DEFAULT_COMPOUND_GRAVITY_STRENGTH=t.DEFAULT_COMPOUND_GRAVITY_STRENGTH=y.gravityCompound),y.gravityRangeCompound!=null&&(r.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=t.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=y.gravityRangeCompound),y.initialEnergyOnIncremental!=null&&(r.DEFAULT_COOLING_FACTOR_INCREMENTAL=t.DEFAULT_COOLING_FACTOR_INCREMENTAL=y.initialEnergyOnIncremental),y.quality=="draft"?e.QUALITY=0:y.quality=="proof"?e.QUALITY=2:e.QUALITY=1,r.NODE_DIMENSIONS_INCLUDE_LABELS=t.NODE_DIMENSIONS_INCLUDE_LABELS=e.NODE_DIMENSIONS_INCLUDE_LABELS=y.nodeDimensionsIncludeLabels,r.DEFAULT_INCREMENTAL=t.DEFAULT_INCREMENTAL=e.DEFAULT_INCREMENTAL=!y.randomize,r.ANIMATE=t.ANIMATE=e.ANIMATE=y.animate,r.TILE=y.tile,r.TILING_PADDING_VERTICAL=typeof y.tilingPaddingVertical=="function"?y.tilingPaddingVertical.call():y.tilingPaddingVertical,r.TILING_PADDING_HORIZONTAL=typeof y.tilingPaddingHorizontal=="function"?y.tilingPaddingHorizontal.call():y.tilingPaddingHorizontal};l.prototype.run=function(){var y,d,N=this.options;this.idToLNode={};var v=this.layout=new h,L=this;L.stopped=!1,this.cy=this.options.cy,this.cy.trigger({type:"layoutstart",layout:this});var s=v.newGraphManager();this.gm=s;var u=this.options.eles.nodes(),c=this.options.eles.edges();this.root=s.addRoot(),this.processChildrenList(this.root,this.getTopMostNodes(u),v);for(var A=0;A<c.length;A++){var _=c[A],O=this.idToLNode[_.data("source")],D=this.idToLNode[_.data("target")];if(O!==D&&O.getEdgesBetween(D).length==0){var w=s.add(v.newEdge(),O,D);w.id=_.id()}}var R=function(b,C){typeof b=="number"&&(b=C);var M=b.data("id"),G=L.idToLNode[M];return{x:G.getRect().getCenterX(),y:G.getRect().getCenterY()}},F=function b(){for(var C=function(){N.fit&&N.cy.fit(N.eles,N.padding),y||(y=!0,L.cy.one("layoutready",N.ready),L.cy.trigger({type:"layoutready",layout:L}))},M=L.options.refresh,G,P=0;P<M&&!G;P++)G=L.stopped||L.layout.tick();if(G){v.checkLayoutSuccess()&&!v.isSubLayout&&v.doPostLayout(),v.tilingPostLayout&&v.tilingPostLayout(),v.isLayoutFinished=!0,L.options.eles.nodes().positions(R),C(),L.cy.one("layoutstop",L.options.stop),L.cy.trigger({type:"layoutstop",layout:L}),d&&cancelAnimationFrame(d),y=!1;return}var S=L.layout.getPositionsData();N.eles.nodes().positions(function(U,Y){if(typeof U=="number"&&(U=Y),!U.isParent()){for(var B=U.id(),H=S[B],k=U;H==null&&(H=S[k.data("parent")]||S["DummyCompound_"+k.data("parent")],S[B]=H,k=k.parent()[0],k!=null););return H!=null?{x:H.x,y:H.y}:{x:U.position("x"),y:U.position("y")}}}),C(),d=requestAnimationFrame(b)};return v.addListener("layoutstarted",function(){L.options.animate==="during"&&(d=requestAnimationFrame(F))}),v.runLayout(),this.options.animate!=="during"&&(L.options.eles.nodes().not(":parent").layoutPositions(L,L.options,R),y=!1),this},l.prototype.getTopMostNodes=function(y){for(var d={},N=0;N<y.length;N++)d[y[N].id()]=!0;var v=y.filter(function(L,s){typeof L=="number"&&(L=s);for(var u=L.parent()[0];u!=null;){if(d[u.id()])return!1;u=u.parent()[0]}return!0});return v},l.prototype.processChildrenList=function(y,d,N){for(var v=d.length,L=0;L<v;L++){var s=d[L],u=s.children(),c,A=s.layoutDimensions({nodeDimensionsIncludeLabels:this.options.nodeDimensionsIncludeLabels});if(s.outerWidth()!=null&&s.outerHeight()!=null?c=y.add(new a(N.graphManager,new o(s.position("x")-A.w/2,s.position("y")-A.h/2),new p(parseFloat(A.w),parseFloat(A.h)))):c=y.add(new a(this.graphManager)),c.id=s.data("id"),c.paddingLeft=parseInt(s.css("padding")),c.paddingTop=parseInt(s.css("padding")),c.paddingRight=parseInt(s.css("padding")),c.paddingBottom=parseInt(s.css("padding")),this.options.nodeDimensionsIncludeLabels&&s.isParent()){var _=s.boundingBox({includeLabels:!0,includeNodes:!1}).w,O=s.boundingBox({includeLabels:!0,includeNodes:!1}).h,D=s.css("text-halign");c.labelWidth=_,c.labelHeight=O,c.labelPos=D}if(this.idToLNode[s.data("id")]=c,isNaN(c.rect.x)&&(c.rect.x=0),isNaN(c.rect.y)&&(c.rect.y=0),u!=null&&u.length>0){var w;w=N.getGraphManager().add(N.newGraph(),c),this.processChildrenList(w,u,N)}}},l.prototype.stop=function(){return this.stopped=!0,this};var E=function(y){y("layout","cose-bilkent",l)};typeof cytoscape<"u"&&E(cytoscape),I.exports=E}])})}(V)),V.exports}var Et=yt();const vt=gt(Et);tt.use(vt);function et(x,X){x.forEach(m=>{const I={id:m.id,labelText:m.label,height:m.height,width:m.width,padding:m.padding??0};Object.keys(m).forEach(T=>{["id","label","height","width","padding","x","y"].includes(T)||(I[T]=m[T])}),X.add({group:"nodes",data:I,position:{x:m.x??0,y:m.y??0}})})}W(et,"addNodes");function rt(x,X){x.forEach(m=>{const I={id:m.id,source:m.start,target:m.end};Object.keys(m).forEach(T=>{["id","start","end"].includes(T)||(I[T]=m[T])}),X.add({group:"edges",data:I})})}W(rt,"addEdges");function it(x){return new Promise(X=>{const m=lt("body").append("div").attr("id","cy").attr("style","display:none"),I=tt({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"bezier"}}]});m.remove(),et(x.nodes,I),rt(x.edges,I),I.nodes().forEach(function(n){n.layoutDimensions=()=>{const e=n.data();return{w:e.width,h:e.height}}});const T={name:"cose-bilkent",quality:"proof",styleEnabled:!1,animate:!1};I.layout(T).run(),I.ready(n=>{j.info("Cytoscape ready",n),X(I)})})}W(it,"createCytoscapeInstance");function nt(x){return x.nodes().map(X=>{const m=X.data(),I=X.position(),T={id:m.id,x:I.x,y:I.y};return Object.keys(m).forEach(n=>{n!=="id"&&(T[n]=m[n])}),T})}W(nt,"extractPositionedNodes");function ot(x){return x.edges().map(X=>{const m=X.data(),I=X._private.rscratch,T={id:m.id,source:m.source,target:m.target,startX:I.startX,startY:I.startY,midX:I.midX,midY:I.midY,endX:I.endX,endY:I.endY};return Object.keys(m).forEach(n=>{["id","source","target"].includes(n)||(T[n]=m[n])}),T})}W(ot,"extractPositionedEdges");async function st(x,X){j.debug("Starting cose-bilkent layout algorithm");try{at(x);const m=await it(x),I=nt(m),T=ot(m);return j.debug(`Layout completed: ${I.length} nodes, ${T.length} edges`),{nodes:I,edges:T}}catch(m){throw j.error("Error in cose-bilkent layout algorithm:",m),m}}W(st,"executeCoseBilkentLayout");function at(x){if(!x)throw new Error("Layout data is required");if(!x.config)throw new Error("Configuration is required in layout data");if(!x.rootNode)throw new Error("Root node is required");if(!x.nodes||!Array.isArray(x.nodes))throw new Error("No nodes found in layout data");if(!Array.isArray(x.edges))throw new Error("Edges array is required in layout data");return!0}W(at,"validateLayoutData");var At=W(async(x,X,{insertCluster:m,insertEdge:I,insertEdgeLabel:T,insertMarkers:n,insertNode:e,log:t,positionEdgeLabel:r},{algorithm:h})=>{const a={},o={},p=X.select("g");n(p,x.markers,x.type,x.diagramId);const i=p.insert("g").attr("class","subgraphs"),g=p.insert("g").attr("class","edgePaths"),l=p.insert("g").attr("class","edgeLabels"),f=p.insert("g").attr("class","nodes");t.debug("Inserting nodes into DOM for dimension calculation"),await Promise.all(x.nodes.map(async d=>{if(d.isGroup){const N={...d};o[d.id]=N,a[d.id]=N,await m(i,d)}else{const N={...d};a[d.id]=N;const v=await e(f,d,{config:x.config,dir:x.direction||"TB"}),L=v.node().getBBox();N.width=L.width,N.height=L.height,N.domId=v,t.debug(`Node ${d.id} dimensions: ${L.width}x${L.height}`)}})),t.debug("Running cose-bilkent layout algorithm");const E={...x,nodes:x.nodes.map(d=>{const N=a[d.id];return{...d,width:N.width,height:N.height}})},y=await st(E,x.config);t.debug("Positioning nodes based on layout results"),y.nodes.forEach(d=>{const N=a[d.id];N!=null&&N.domId&&(N.domId.attr("transform",`translate(${d.x}, ${d.y})`),N.x=d.x,N.y=d.y,t.debug(`Positioned node ${N.id} at center (${d.x}, ${d.y})`))}),y.edges.forEach(d=>{const N=x.edges.find(v=>v.id===d.id);N&&(N.points=[{x:d.startX,y:d.startY},{x:d.midX,y:d.midY},{x:d.endX,y:d.endY}])}),t.debug("Inserting and positioning edges"),await Promise.all(x.edges.map(async d=>{await T(l,d);const N=a[d.start??""],v=a[d.end??""];if(N&&v){const L=y.edges.find(s=>s.id===d.id);if(L){t.debug("APA01 positionedEdge",L);const s={...d},u=I(g,s,o,x.type,N,v,x.diagramId);r(s,u)}else{const s={...d,points:[{x:N.x||0,y:N.y||0},{x:v.x||0,y:v.y||0}]},u=I(g,s,o,x.type,N,v,x.diagramId);r(s,u)}}})),t.debug("Cose-bilkent rendering completed")},"render"),_t=At;export{_t as render};
1
+ import{R as W,O as j,e as lt,D as gt}from"./index-CyVB0J6E.js";import{e as tt}from"./cytoscape.esm-CjI2IsL8-Da6dFVsf.js";var V={exports:{}},z={exports:{}},q={exports:{}},ut=q.exports,$;function ct(){return $||($=1,function(x,X){(function(m,I){x.exports=I()})(ut,function(){return function(m){var I={};function T(n){if(I[n])return I[n].exports;var e=I[n]={i:n,l:!1,exports:{}};return m[n].call(e.exports,e,e.exports,T),e.l=!0,e.exports}return T.m=m,T.c=I,T.i=function(n){return n},T.d=function(n,e,t){T.o(n,e)||Object.defineProperty(n,e,{configurable:!1,enumerable:!0,get:t})},T.n=function(n){var e=n&&n.__esModule?function(){return n.default}:function(){return n};return T.d(e,"a",e),e},T.o=function(n,e){return Object.prototype.hasOwnProperty.call(n,e)},T.p="",T(T.s=26)}([function(m,I,T){function n(){}n.QUALITY=1,n.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,n.DEFAULT_INCREMENTAL=!1,n.DEFAULT_ANIMATION_ON_LAYOUT=!0,n.DEFAULT_ANIMATION_DURING_LAYOUT=!1,n.DEFAULT_ANIMATION_PERIOD=50,n.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,n.DEFAULT_GRAPH_MARGIN=15,n.NODE_DIMENSIONS_INCLUDE_LABELS=!1,n.SIMPLE_NODE_SIZE=40,n.SIMPLE_NODE_HALF_SIZE=n.SIMPLE_NODE_SIZE/2,n.EMPTY_COMPOUND_NODE_SIZE=40,n.MIN_EDGE_LENGTH=1,n.WORLD_BOUNDARY=1e6,n.INITIAL_WORLD_BOUNDARY=n.WORLD_BOUNDARY/1e3,n.WORLD_CENTER_X=1200,n.WORLD_CENTER_Y=900,m.exports=n},function(m,I,T){var n=T(2),e=T(8),t=T(9);function r(a,o,p){n.call(this,p),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=p,this.bendpoints=[],this.source=a,this.target=o}r.prototype=Object.create(n.prototype);for(var h in n)r[h]=n[h];r.prototype.getSource=function(){return this.source},r.prototype.getTarget=function(){return this.target},r.prototype.isInterGraph=function(){return this.isInterGraph},r.prototype.getLength=function(){return this.length},r.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},r.prototype.getBendpoints=function(){return this.bendpoints},r.prototype.getLca=function(){return this.lca},r.prototype.getSourceInLca=function(){return this.sourceInLca},r.prototype.getTargetInLca=function(){return this.targetInLca},r.prototype.getOtherEnd=function(a){if(this.source===a)return this.target;if(this.target===a)return this.source;throw"Node is not incident with this edge"},r.prototype.getOtherEndInGraph=function(a,o){for(var p=this.getOtherEnd(a),i=o.getGraphManager().getRoot();;){if(p.getOwner()==o)return p;if(p.getOwner()==i)break;p=p.getOwner().getParent()}return null},r.prototype.updateLength=function(){var a=new Array(4);this.isOverlapingSourceAndTarget=e.getIntersection(this.target.getRect(),this.source.getRect(),a),this.isOverlapingSourceAndTarget||(this.lengthX=a[0]-a[2],this.lengthY=a[1]-a[3],Math.abs(this.lengthX)<1&&(this.lengthX=t.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=t.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},r.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=t.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=t.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},m.exports=r},function(m,I,T){function n(e){this.vGraphObject=e}m.exports=n},function(m,I,T){var n=T(2),e=T(10),t=T(13),r=T(0),h=T(16),a=T(4);function o(i,g,l,f){l==null&&f==null&&(f=g),n.call(this,f),i.graphManager!=null&&(i=i.graphManager),this.estimatedSize=e.MIN_VALUE,this.inclusionTreeDepth=e.MAX_VALUE,this.vGraphObject=f,this.edges=[],this.graphManager=i,l!=null&&g!=null?this.rect=new t(g.x,g.y,l.width,l.height):this.rect=new t}o.prototype=Object.create(n.prototype);for(var p in n)o[p]=n[p];o.prototype.getEdges=function(){return this.edges},o.prototype.getChild=function(){return this.child},o.prototype.getOwner=function(){return this.owner},o.prototype.getWidth=function(){return this.rect.width},o.prototype.setWidth=function(i){this.rect.width=i},o.prototype.getHeight=function(){return this.rect.height},o.prototype.setHeight=function(i){this.rect.height=i},o.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},o.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},o.prototype.getCenter=function(){return new a(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},o.prototype.getLocation=function(){return new a(this.rect.x,this.rect.y)},o.prototype.getRect=function(){return this.rect},o.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},o.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},o.prototype.setRect=function(i,g){this.rect.x=i.x,this.rect.y=i.y,this.rect.width=g.width,this.rect.height=g.height},o.prototype.setCenter=function(i,g){this.rect.x=i-this.rect.width/2,this.rect.y=g-this.rect.height/2},o.prototype.setLocation=function(i,g){this.rect.x=i,this.rect.y=g},o.prototype.moveBy=function(i,g){this.rect.x+=i,this.rect.y+=g},o.prototype.getEdgeListToNode=function(i){var g=[],l=this;return l.edges.forEach(function(f){if(f.target==i){if(f.source!=l)throw"Incorrect edge source!";g.push(f)}}),g},o.prototype.getEdgesBetween=function(i){var g=[],l=this;return l.edges.forEach(function(f){if(!(f.source==l||f.target==l))throw"Incorrect edge source and/or target";(f.target==i||f.source==i)&&g.push(f)}),g},o.prototype.getNeighborsList=function(){var i=new Set,g=this;return g.edges.forEach(function(l){if(l.source==g)i.add(l.target);else{if(l.target!=g)throw"Incorrect incidency!";i.add(l.source)}}),i},o.prototype.withChildren=function(){var i=new Set,g,l;if(i.add(this),this.child!=null)for(var f=this.child.getNodes(),E=0;E<f.length;E++)g=f[E],l=g.withChildren(),l.forEach(function(y){i.add(y)});return i},o.prototype.getNoOfChildren=function(){var i=0,g;if(this.child==null)i=1;else for(var l=this.child.getNodes(),f=0;f<l.length;f++)g=l[f],i+=g.getNoOfChildren();return i==0&&(i=1),i},o.prototype.getEstimatedSize=function(){if(this.estimatedSize==e.MIN_VALUE)throw"assert failed";return this.estimatedSize},o.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)},o.prototype.scatter=function(){var i,g,l=-r.INITIAL_WORLD_BOUNDARY,f=r.INITIAL_WORLD_BOUNDARY;i=r.WORLD_CENTER_X+h.nextDouble()*(f-l)+l;var E=-r.INITIAL_WORLD_BOUNDARY,y=r.INITIAL_WORLD_BOUNDARY;g=r.WORLD_CENTER_Y+h.nextDouble()*(y-E)+E,this.rect.x=i,this.rect.y=g},o.prototype.updateBounds=function(){if(this.getChild()==null)throw"assert failed";if(this.getChild().getNodes().length!=0){var i=this.getChild();if(i.updateBounds(!0),this.rect.x=i.getLeft(),this.rect.y=i.getTop(),this.setWidth(i.getRight()-i.getLeft()),this.setHeight(i.getBottom()-i.getTop()),r.NODE_DIMENSIONS_INCLUDE_LABELS){var g=i.getRight()-i.getLeft(),l=i.getBottom()-i.getTop();this.labelWidth>g&&(this.rect.x-=(this.labelWidth-g)/2,this.setWidth(this.labelWidth)),this.labelHeight>l&&(this.labelPos=="center"?this.rect.y-=(this.labelHeight-l)/2:this.labelPos=="top"&&(this.rect.y-=this.labelHeight-l),this.setHeight(this.labelHeight))}}},o.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==e.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},o.prototype.transform=function(i){var g=this.rect.x;g>r.WORLD_BOUNDARY?g=r.WORLD_BOUNDARY:g<-r.WORLD_BOUNDARY&&(g=-r.WORLD_BOUNDARY);var l=this.rect.y;l>r.WORLD_BOUNDARY?l=r.WORLD_BOUNDARY:l<-r.WORLD_BOUNDARY&&(l=-r.WORLD_BOUNDARY);var f=new a(g,l),E=i.inverseTransformPoint(f);this.setLocation(E.x,E.y)},o.prototype.getLeft=function(){return this.rect.x},o.prototype.getRight=function(){return this.rect.x+this.rect.width},o.prototype.getTop=function(){return this.rect.y},o.prototype.getBottom=function(){return this.rect.y+this.rect.height},o.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},m.exports=o},function(m,I,T){function n(e,t){e==null&&t==null?(this.x=0,this.y=0):(this.x=e,this.y=t)}n.prototype.getX=function(){return this.x},n.prototype.getY=function(){return this.y},n.prototype.setX=function(e){this.x=e},n.prototype.setY=function(e){this.y=e},n.prototype.getDifference=function(e){return new DimensionD(this.x-e.x,this.y-e.y)},n.prototype.getCopy=function(){return new n(this.x,this.y)},n.prototype.translate=function(e){return this.x+=e.width,this.y+=e.height,this},m.exports=n},function(m,I,T){var n=T(2),e=T(10),t=T(0),r=T(6),h=T(3),a=T(1),o=T(13),p=T(12),i=T(11);function g(f,E,y){n.call(this,y),this.estimatedSize=e.MIN_VALUE,this.margin=t.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=f,E!=null&&E instanceof r?this.graphManager=E:E!=null&&E instanceof Layout&&(this.graphManager=E.graphManager)}g.prototype=Object.create(n.prototype);for(var l in n)g[l]=n[l];g.prototype.getNodes=function(){return this.nodes},g.prototype.getEdges=function(){return this.edges},g.prototype.getGraphManager=function(){return this.graphManager},g.prototype.getParent=function(){return this.parent},g.prototype.getLeft=function(){return this.left},g.prototype.getRight=function(){return this.right},g.prototype.getTop=function(){return this.top},g.prototype.getBottom=function(){return this.bottom},g.prototype.isConnected=function(){return this.isConnected},g.prototype.add=function(f,E,y){if(E==null&&y==null){var d=f;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(d)>-1)throw"Node already in graph!";return d.owner=this,this.getNodes().push(d),d}else{var N=f;if(!(this.getNodes().indexOf(E)>-1&&this.getNodes().indexOf(y)>-1))throw"Source or target not in graph!";if(!(E.owner==y.owner&&E.owner==this))throw"Both owners must be this graph!";return E.owner!=y.owner?null:(N.source=E,N.target=y,N.isInterGraph=!1,this.getEdges().push(N),E.edges.push(N),y!=E&&y.edges.push(N),N)}},g.prototype.remove=function(f){var E=f;if(f instanceof h){if(E==null)throw"Node is null!";if(!(E.owner!=null&&E.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var y=E.edges.slice(),d,N=y.length,v=0;v<N;v++)d=y[v],d.isInterGraph?this.graphManager.remove(d):d.source.owner.remove(d);var L=this.nodes.indexOf(E);if(L==-1)throw"Node not in owner node list!";this.nodes.splice(L,1)}else if(f instanceof a){var d=f;if(d==null)throw"Edge is null!";if(!(d.source!=null&&d.target!=null))throw"Source and/or target is null!";if(!(d.source.owner!=null&&d.target.owner!=null&&d.source.owner==this&&d.target.owner==this))throw"Source and/or target owner is invalid!";var s=d.source.edges.indexOf(d),u=d.target.edges.indexOf(d);if(!(s>-1&&u>-1))throw"Source and/or target doesn't know this edge!";d.source.edges.splice(s,1),d.target!=d.source&&d.target.edges.splice(u,1);var L=d.source.owner.getEdges().indexOf(d);if(L==-1)throw"Not in owner's edge list!";d.source.owner.getEdges().splice(L,1)}},g.prototype.updateLeftTop=function(){for(var f=e.MAX_VALUE,E=e.MAX_VALUE,y,d,N,v=this.getNodes(),L=v.length,s=0;s<L;s++){var u=v[s];y=u.getTop(),d=u.getLeft(),f>y&&(f=y),E>d&&(E=d)}return f==e.MAX_VALUE?null:(v[0].getParent().paddingLeft!=null?N=v[0].getParent().paddingLeft:N=this.margin,this.left=E-N,this.top=f-N,new p(this.left,this.top))},g.prototype.updateBounds=function(f){for(var E=e.MAX_VALUE,y=-e.MAX_VALUE,d=e.MAX_VALUE,N=-e.MAX_VALUE,v,L,s,u,c,A=this.nodes,_=A.length,O=0;O<_;O++){var D=A[O];f&&D.child!=null&&D.updateBounds(),v=D.getLeft(),L=D.getRight(),s=D.getTop(),u=D.getBottom(),E>v&&(E=v),y<L&&(y=L),d>s&&(d=s),N<u&&(N=u)}var w=new o(E,d,y-E,N-d);E==e.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),A[0].getParent().paddingLeft!=null?c=A[0].getParent().paddingLeft:c=this.margin,this.left=w.x-c,this.right=w.x+w.width+c,this.top=w.y-c,this.bottom=w.y+w.height+c},g.calculateBounds=function(f){for(var E=e.MAX_VALUE,y=-e.MAX_VALUE,d=e.MAX_VALUE,N=-e.MAX_VALUE,v,L,s,u,c=f.length,A=0;A<c;A++){var _=f[A];v=_.getLeft(),L=_.getRight(),s=_.getTop(),u=_.getBottom(),E>v&&(E=v),y<L&&(y=L),d>s&&(d=s),N<u&&(N=u)}var O=new o(E,d,y-E,N-d);return O},g.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},g.prototype.getEstimatedSize=function(){if(this.estimatedSize==e.MIN_VALUE)throw"assert failed";return this.estimatedSize},g.prototype.calcEstimatedSize=function(){for(var f=0,E=this.nodes,y=E.length,d=0;d<y;d++){var N=E[d];f+=N.calcEstimatedSize()}return f==0?this.estimatedSize=t.EMPTY_COMPOUND_NODE_SIZE:this.estimatedSize=f/Math.sqrt(this.nodes.length),this.estimatedSize},g.prototype.updateConnected=function(){var f=this;if(this.nodes.length==0){this.isConnected=!0;return}var E=new i,y=new Set,d=this.nodes[0],N,v,L=d.withChildren();for(L.forEach(function(O){E.push(O),y.add(O)});E.length!==0;){d=E.shift(),N=d.getEdges();for(var s=N.length,u=0;u<s;u++){var c=N[u];if(v=c.getOtherEndInGraph(d,this),v!=null&&!y.has(v)){var A=v.withChildren();A.forEach(function(O){E.push(O),y.add(O)})}}}if(this.isConnected=!1,y.size>=this.nodes.length){var _=0;y.forEach(function(O){O.owner==f&&_++}),_==this.nodes.length&&(this.isConnected=!0)}},m.exports=g},function(m,I,T){var n,e=T(1);function t(r){n=T(5),this.layout=r,this.graphs=[],this.edges=[]}t.prototype.addRoot=function(){var r=this.layout.newGraph(),h=this.layout.newNode(null),a=this.add(r,h);return this.setRootGraph(a),this.rootGraph},t.prototype.add=function(r,h,a,o,p){if(a==null&&o==null&&p==null){if(r==null)throw"Graph is null!";if(h==null)throw"Parent node is null!";if(this.graphs.indexOf(r)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(r),r.parent!=null)throw"Already has a parent!";if(h.child!=null)throw"Already has a child!";return r.parent=h,h.child=r,r}else{p=a,o=h,a=r;var i=o.getOwner(),g=p.getOwner();if(!(i!=null&&i.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(g!=null&&g.getGraphManager()==this))throw"Target not in this graph mgr!";if(i==g)return a.isInterGraph=!1,i.add(a,o,p);if(a.isInterGraph=!0,a.source=o,a.target=p,this.edges.indexOf(a)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(a),!(a.source!=null&&a.target!=null))throw"Edge source and/or target is null!";if(!(a.source.edges.indexOf(a)==-1&&a.target.edges.indexOf(a)==-1))throw"Edge already in source and/or target incidency list!";return a.source.edges.push(a),a.target.edges.push(a),a}},t.prototype.remove=function(r){if(r instanceof n){var h=r;if(h.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(h==this.rootGraph||h.parent!=null&&h.parent.graphManager==this))throw"Invalid parent node!";var a=[];a=a.concat(h.getEdges());for(var o,p=a.length,i=0;i<p;i++)o=a[i],h.remove(o);var g=[];g=g.concat(h.getNodes());var l;p=g.length;for(var i=0;i<p;i++)l=g[i],h.remove(l);h==this.rootGraph&&this.setRootGraph(null);var f=this.graphs.indexOf(h);this.graphs.splice(f,1),h.parent=null}else if(r instanceof e){if(o=r,o==null)throw"Edge is null!";if(!o.isInterGraph)throw"Not an inter-graph edge!";if(!(o.source!=null&&o.target!=null))throw"Source and/or target is null!";if(!(o.source.edges.indexOf(o)!=-1&&o.target.edges.indexOf(o)!=-1))throw"Source and/or target doesn't know this edge!";var f=o.source.edges.indexOf(o);if(o.source.edges.splice(f,1),f=o.target.edges.indexOf(o),o.target.edges.splice(f,1),!(o.source.owner!=null&&o.source.owner.getGraphManager()!=null))throw"Edge owner graph or owner graph manager is null!";if(o.source.owner.getGraphManager().edges.indexOf(o)==-1)throw"Not in owner graph manager's edge list!";var f=o.source.owner.getGraphManager().edges.indexOf(o);o.source.owner.getGraphManager().edges.splice(f,1)}},t.prototype.updateBounds=function(){this.rootGraph.updateBounds(!0)},t.prototype.getGraphs=function(){return this.graphs},t.prototype.getAllNodes=function(){if(this.allNodes==null){for(var r=[],h=this.getGraphs(),a=h.length,o=0;o<a;o++)r=r.concat(h[o].getNodes());this.allNodes=r}return this.allNodes},t.prototype.resetAllNodes=function(){this.allNodes=null},t.prototype.resetAllEdges=function(){this.allEdges=null},t.prototype.resetAllNodesToApplyGravitation=function(){this.allNodesToApplyGravitation=null},t.prototype.getAllEdges=function(){if(this.allEdges==null){var r=[],h=this.getGraphs();h.length;for(var a=0;a<h.length;a++)r=r.concat(h[a].getEdges());r=r.concat(this.edges),this.allEdges=r}return this.allEdges},t.prototype.getAllNodesToApplyGravitation=function(){return this.allNodesToApplyGravitation},t.prototype.setAllNodesToApplyGravitation=function(r){if(this.allNodesToApplyGravitation!=null)throw"assert failed";this.allNodesToApplyGravitation=r},t.prototype.getRoot=function(){return this.rootGraph},t.prototype.setRootGraph=function(r){if(r.getGraphManager()!=this)throw"Root not in this graph mgr!";this.rootGraph=r,r.parent==null&&(r.parent=this.layout.newNode("Root node"))},t.prototype.getLayout=function(){return this.layout},t.prototype.isOneAncestorOfOther=function(r,h){if(!(r!=null&&h!=null))throw"assert failed";if(r==h)return!0;var a=r.getOwner(),o;do{if(o=a.getParent(),o==null)break;if(o==h)return!0;if(a=o.getOwner(),a==null)break}while(!0);a=h.getOwner();do{if(o=a.getParent(),o==null)break;if(o==r)return!0;if(a=o.getOwner(),a==null)break}while(!0);return!1},t.prototype.calcLowestCommonAncestors=function(){for(var r,h,a,o,p,i=this.getAllEdges(),g=i.length,l=0;l<g;l++){if(r=i[l],h=r.source,a=r.target,r.lca=null,r.sourceInLca=h,r.targetInLca=a,h==a){r.lca=h.getOwner();continue}for(o=h.getOwner();r.lca==null;){for(r.targetInLca=a,p=a.getOwner();r.lca==null;){if(p==o){r.lca=p;break}if(p==this.rootGraph)break;if(r.lca!=null)throw"assert failed";r.targetInLca=p.getParent(),p=r.targetInLca.getOwner()}if(o==this.rootGraph)break;r.lca==null&&(r.sourceInLca=o.getParent(),o=r.sourceInLca.getOwner())}if(r.lca==null)throw"assert failed"}},t.prototype.calcLowestCommonAncestor=function(r,h){if(r==h)return r.getOwner();var a=r.getOwner();do{if(a==null)break;var o=h.getOwner();do{if(o==null)break;if(o==a)return o;o=o.getParent().getOwner()}while(!0);a=a.getParent().getOwner()}while(!0);return a},t.prototype.calcInclusionTreeDepths=function(r,h){r==null&&h==null&&(r=this.rootGraph,h=1);for(var a,o=r.getNodes(),p=o.length,i=0;i<p;i++)a=o[i],a.inclusionTreeDepth=h,a.child!=null&&this.calcInclusionTreeDepths(a.child,h+1)},t.prototype.includesInvalidEdge=function(){for(var r,h=this.edges.length,a=0;a<h;a++)if(r=this.edges[a],this.isOneAncestorOfOther(r.source,r.target))return!0;return!1},m.exports=t},function(m,I,T){var n=T(0);function e(){}for(var t in n)e[t]=n[t];e.MAX_ITERATIONS=2500,e.DEFAULT_EDGE_LENGTH=50,e.DEFAULT_SPRING_STRENGTH=.45,e.DEFAULT_REPULSION_STRENGTH=4500,e.DEFAULT_GRAVITY_STRENGTH=.4,e.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,e.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,e.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,e.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,e.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,e.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,e.COOLING_ADAPTATION_FACTOR=.33,e.ADAPTATION_LOWER_NODE_LIMIT=1e3,e.ADAPTATION_UPPER_NODE_LIMIT=5e3,e.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,e.MAX_NODE_DISPLACEMENT=e.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,e.MIN_REPULSION_DIST=e.DEFAULT_EDGE_LENGTH/10,e.CONVERGENCE_CHECK_PERIOD=100,e.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,e.MIN_EDGE_LENGTH=1,e.GRID_CALCULATION_CHECK_PERIOD=10,m.exports=e},function(m,I,T){var n=T(12);function e(){}e.calcSeparationAmount=function(t,r,h,a){if(!t.intersects(r))throw"assert failed";var o=new Array(2);this.decideDirectionsForOverlappingNodes(t,r,o),h[0]=Math.min(t.getRight(),r.getRight())-Math.max(t.x,r.x),h[1]=Math.min(t.getBottom(),r.getBottom())-Math.max(t.y,r.y),t.getX()<=r.getX()&&t.getRight()>=r.getRight()?h[0]+=Math.min(r.getX()-t.getX(),t.getRight()-r.getRight()):r.getX()<=t.getX()&&r.getRight()>=t.getRight()&&(h[0]+=Math.min(t.getX()-r.getX(),r.getRight()-t.getRight())),t.getY()<=r.getY()&&t.getBottom()>=r.getBottom()?h[1]+=Math.min(r.getY()-t.getY(),t.getBottom()-r.getBottom()):r.getY()<=t.getY()&&r.getBottom()>=t.getBottom()&&(h[1]+=Math.min(t.getY()-r.getY(),r.getBottom()-t.getBottom()));var p=Math.abs((r.getCenterY()-t.getCenterY())/(r.getCenterX()-t.getCenterX()));r.getCenterY()===t.getCenterY()&&r.getCenterX()===t.getCenterX()&&(p=1);var i=p*h[0],g=h[1]/p;h[0]<g?g=h[0]:i=h[1],h[0]=-1*o[0]*(g/2+a),h[1]=-1*o[1]*(i/2+a)},e.decideDirectionsForOverlappingNodes=function(t,r,h){t.getCenterX()<r.getCenterX()?h[0]=-1:h[0]=1,t.getCenterY()<r.getCenterY()?h[1]=-1:h[1]=1},e.getIntersection2=function(t,r,h){var a=t.getCenterX(),o=t.getCenterY(),p=r.getCenterX(),i=r.getCenterY();if(t.intersects(r))return h[0]=a,h[1]=o,h[2]=p,h[3]=i,!0;var g=t.getX(),l=t.getY(),f=t.getRight(),E=t.getX(),y=t.getBottom(),d=t.getRight(),N=t.getWidthHalf(),v=t.getHeightHalf(),L=r.getX(),s=r.getY(),u=r.getRight(),c=r.getX(),A=r.getBottom(),_=r.getRight(),O=r.getWidthHalf(),D=r.getHeightHalf(),w=!1,R=!1;if(a===p){if(o>i)return h[0]=a,h[1]=l,h[2]=p,h[3]=A,!1;if(o<i)return h[0]=a,h[1]=y,h[2]=p,h[3]=s,!1}else if(o===i){if(a>p)return h[0]=g,h[1]=o,h[2]=u,h[3]=i,!1;if(a<p)return h[0]=f,h[1]=o,h[2]=L,h[3]=i,!1}else{var F=t.height/t.width,b=r.height/r.width,C=(i-o)/(p-a),M=void 0,G=void 0,P=void 0,S=void 0,U=void 0,Y=void 0;if(-F===C?a>p?(h[0]=E,h[1]=y,w=!0):(h[0]=f,h[1]=l,w=!0):F===C&&(a>p?(h[0]=g,h[1]=l,w=!0):(h[0]=d,h[1]=y,w=!0)),-b===C?p>a?(h[2]=c,h[3]=A,R=!0):(h[2]=u,h[3]=s,R=!0):b===C&&(p>a?(h[2]=L,h[3]=s,R=!0):(h[2]=_,h[3]=A,R=!0)),w&&R)return!1;if(a>p?o>i?(M=this.getCardinalDirection(F,C,4),G=this.getCardinalDirection(b,C,2)):(M=this.getCardinalDirection(-F,C,3),G=this.getCardinalDirection(-b,C,1)):o>i?(M=this.getCardinalDirection(-F,C,1),G=this.getCardinalDirection(-b,C,3)):(M=this.getCardinalDirection(F,C,2),G=this.getCardinalDirection(b,C,4)),!w)switch(M){case 1:S=l,P=a+-v/C,h[0]=P,h[1]=S;break;case 2:P=d,S=o+N*C,h[0]=P,h[1]=S;break;case 3:S=y,P=a+v/C,h[0]=P,h[1]=S;break;case 4:P=E,S=o+-N*C,h[0]=P,h[1]=S;break}if(!R)switch(G){case 1:Y=s,U=p+-D/C,h[2]=U,h[3]=Y;break;case 2:U=_,Y=i+O*C,h[2]=U,h[3]=Y;break;case 3:Y=A,U=p+D/C,h[2]=U,h[3]=Y;break;case 4:U=c,Y=i+-O*C,h[2]=U,h[3]=Y;break}}return!1},e.getCardinalDirection=function(t,r,h){return t>r?h:1+h%4},e.getIntersection=function(t,r,h,a){if(a==null)return this.getIntersection2(t,r,h);var o=t.x,p=t.y,i=r.x,g=r.y,l=h.x,f=h.y,E=a.x,y=a.y,d=void 0,N=void 0,v=void 0,L=void 0,s=void 0,u=void 0,c=void 0,A=void 0,_=void 0;return v=g-p,s=o-i,c=i*p-o*g,L=y-f,u=l-E,A=E*f-l*y,_=v*u-L*s,_===0?null:(d=(s*A-u*c)/_,N=(L*c-v*A)/_,new n(d,N))},e.angleOfVector=function(t,r,h,a){var o=void 0;return t!==h?(o=Math.atan((a-r)/(h-t)),h<t?o+=Math.PI:a<r&&(o+=this.TWO_PI)):a<r?o=this.ONE_AND_HALF_PI:o=this.HALF_PI,o},e.doIntersect=function(t,r,h,a){var o=t.x,p=t.y,i=r.x,g=r.y,l=h.x,f=h.y,E=a.x,y=a.y,d=(i-o)*(y-f)-(E-l)*(g-p);if(d===0)return!1;var N=((y-f)*(E-o)+(l-E)*(y-p))/d,v=((p-g)*(E-o)+(i-o)*(y-p))/d;return 0<N&&N<1&&0<v&&v<1},e.HALF_PI=.5*Math.PI,e.ONE_AND_HALF_PI=1.5*Math.PI,e.TWO_PI=2*Math.PI,e.THREE_PI=3*Math.PI,m.exports=e},function(m,I,T){function n(){}n.sign=function(e){return e>0?1:e<0?-1:0},n.floor=function(e){return e<0?Math.ceil(e):Math.floor(e)},n.ceil=function(e){return e<0?Math.floor(e):Math.ceil(e)},m.exports=n},function(m,I,T){function n(){}n.MAX_VALUE=2147483647,n.MIN_VALUE=-2147483648,m.exports=n},function(m,I,T){var n=function(){function o(p,i){for(var g=0;g<i.length;g++){var l=i[g];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(p,l.key,l)}}return function(p,i,g){return i&&o(p.prototype,i),g&&o(p,g),p}}();function e(o,p){if(!(o instanceof p))throw new TypeError("Cannot call a class as a function")}var t=function(o){return{value:o,next:null,prev:null}},r=function(o,p,i,g){return o!==null?o.next=p:g.head=p,i!==null?i.prev=p:g.tail=p,p.prev=o,p.next=i,g.length++,p},h=function(o,p){var i=o.prev,g=o.next;return i!==null?i.next=g:p.head=g,g!==null?g.prev=i:p.tail=i,o.prev=o.next=null,p.length--,o},a=function(){function o(p){var i=this;e(this,o),this.length=0,this.head=null,this.tail=null,p!=null&&p.forEach(function(g){return i.push(g)})}return n(o,[{key:"size",value:function(){return this.length}},{key:"insertBefore",value:function(p,i){return r(i.prev,t(p),i,this)}},{key:"insertAfter",value:function(p,i){return r(i,t(p),i.next,this)}},{key:"insertNodeBefore",value:function(p,i){return r(i.prev,p,i,this)}},{key:"insertNodeAfter",value:function(p,i){return r(i,p,i.next,this)}},{key:"push",value:function(p){return r(this.tail,t(p),null,this)}},{key:"unshift",value:function(p){return r(null,t(p),this.head,this)}},{key:"remove",value:function(p){return h(p,this)}},{key:"pop",value:function(){return h(this.tail,this).value}},{key:"popNode",value:function(){return h(this.tail,this)}},{key:"shift",value:function(){return h(this.head,this).value}},{key:"shiftNode",value:function(){return h(this.head,this)}},{key:"get_object_at",value:function(p){if(p<=this.length()){for(var i=1,g=this.head;i<p;)g=g.next,i++;return g.value}}},{key:"set_object_at",value:function(p,i){if(p<=this.length()){for(var g=1,l=this.head;g<p;)l=l.next,g++;l.value=i}}}]),o}();m.exports=a},function(m,I,T){function n(e,t,r){this.x=null,this.y=null,e==null&&t==null&&r==null?(this.x=0,this.y=0):typeof e=="number"&&typeof t=="number"&&r==null?(this.x=e,this.y=t):e.constructor.name=="Point"&&t==null&&r==null&&(r=e,this.x=r.x,this.y=r.y)}n.prototype.getX=function(){return this.x},n.prototype.getY=function(){return this.y},n.prototype.getLocation=function(){return new n(this.x,this.y)},n.prototype.setLocation=function(e,t,r){e.constructor.name=="Point"&&t==null&&r==null?(r=e,this.setLocation(r.x,r.y)):typeof e=="number"&&typeof t=="number"&&r==null&&(parseInt(e)==e&&parseInt(t)==t?this.move(e,t):(this.x=Math.floor(e+.5),this.y=Math.floor(t+.5)))},n.prototype.move=function(e,t){this.x=e,this.y=t},n.prototype.translate=function(e,t){this.x+=e,this.y+=t},n.prototype.equals=function(e){if(e.constructor.name=="Point"){var t=e;return this.x==t.x&&this.y==t.y}return this==e},n.prototype.toString=function(){return new n().constructor.name+"[x="+this.x+",y="+this.y+"]"},m.exports=n},function(m,I,T){function n(e,t,r,h){this.x=0,this.y=0,this.width=0,this.height=0,e!=null&&t!=null&&r!=null&&h!=null&&(this.x=e,this.y=t,this.width=r,this.height=h)}n.prototype.getX=function(){return this.x},n.prototype.setX=function(e){this.x=e},n.prototype.getY=function(){return this.y},n.prototype.setY=function(e){this.y=e},n.prototype.getWidth=function(){return this.width},n.prototype.setWidth=function(e){this.width=e},n.prototype.getHeight=function(){return this.height},n.prototype.setHeight=function(e){this.height=e},n.prototype.getRight=function(){return this.x+this.width},n.prototype.getBottom=function(){return this.y+this.height},n.prototype.intersects=function(e){return!(this.getRight()<e.x||this.getBottom()<e.y||e.getRight()<this.x||e.getBottom()<this.y)},n.prototype.getCenterX=function(){return this.x+this.width/2},n.prototype.getMinX=function(){return this.getX()},n.prototype.getMaxX=function(){return this.getX()+this.width},n.prototype.getCenterY=function(){return this.y+this.height/2},n.prototype.getMinY=function(){return this.getY()},n.prototype.getMaxY=function(){return this.getY()+this.height},n.prototype.getWidthHalf=function(){return this.width/2},n.prototype.getHeightHalf=function(){return this.height/2},m.exports=n},function(m,I,T){var n=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};function e(){}e.lastID=0,e.createID=function(t){return e.isPrimitive(t)?t:(t.uniqueID!=null||(t.uniqueID=e.getString(),e.lastID++),t.uniqueID)},e.getString=function(t){return t==null&&(t=e.lastID),"Object#"+t},e.isPrimitive=function(t){var r=typeof t>"u"?"undefined":n(t);return t==null||r!="object"&&r!="function"},m.exports=e},function(m,I,T){function n(l){if(Array.isArray(l)){for(var f=0,E=Array(l.length);f<l.length;f++)E[f]=l[f];return E}else return Array.from(l)}var e=T(0),t=T(6),r=T(3),h=T(1),a=T(5),o=T(4),p=T(17),i=T(27);function g(l){i.call(this),this.layoutQuality=e.QUALITY,this.createBendsAsNeeded=e.DEFAULT_CREATE_BENDS_AS_NEEDED,this.incremental=e.DEFAULT_INCREMENTAL,this.animationOnLayout=e.DEFAULT_ANIMATION_ON_LAYOUT,this.animationDuringLayout=e.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=e.DEFAULT_ANIMATION_PERIOD,this.uniformLeafNodeSizes=e.DEFAULT_UNIFORM_LEAF_NODE_SIZES,this.edgeToDummyNodes=new Map,this.graphManager=new t(this),this.isLayoutFinished=!1,this.isSubLayout=!1,this.isRemoteUse=!1,l!=null&&(this.isRemoteUse=l)}g.RANDOM_SEED=1,g.prototype=Object.create(i.prototype),g.prototype.getGraphManager=function(){return this.graphManager},g.prototype.getAllNodes=function(){return this.graphManager.getAllNodes()},g.prototype.getAllEdges=function(){return this.graphManager.getAllEdges()},g.prototype.getAllNodesToApplyGravitation=function(){return this.graphManager.getAllNodesToApplyGravitation()},g.prototype.newGraphManager=function(){var l=new t(this);return this.graphManager=l,l},g.prototype.newGraph=function(l){return new a(null,this.graphManager,l)},g.prototype.newNode=function(l){return new r(this.graphManager,l)},g.prototype.newEdge=function(l){return new h(null,null,l)},g.prototype.checkLayoutSuccess=function(){return this.graphManager.getRoot()==null||this.graphManager.getRoot().getNodes().length==0||this.graphManager.includesInvalidEdge()},g.prototype.runLayout=function(){this.isLayoutFinished=!1,this.tilingPreLayout&&this.tilingPreLayout(),this.initParameters();var l;return this.checkLayoutSuccess()?l=!1:l=this.layout(),e.ANIMATE==="during"?!1:(l&&(this.isSubLayout||this.doPostLayout()),this.tilingPostLayout&&this.tilingPostLayout(),this.isLayoutFinished=!0,l)},g.prototype.doPostLayout=function(){this.incremental||this.transform(),this.update()},g.prototype.update2=function(){if(this.createBendsAsNeeded&&(this.createBendpointsFromDummyNodes(),this.graphManager.resetAllEdges()),!this.isRemoteUse){for(var l=this.graphManager.getAllEdges(),f=0;f<l.length;f++)l[f];for(var E=this.graphManager.getRoot().getNodes(),f=0;f<E.length;f++)E[f];this.update(this.graphManager.getRoot())}},g.prototype.update=function(l){if(l==null)this.update2();else if(l instanceof r){var f=l;if(f.getChild()!=null)for(var E=f.getChild().getNodes(),y=0;y<E.length;y++)update(E[y]);if(f.vGraphObject!=null){var d=f.vGraphObject;d.update(f)}}else if(l instanceof h){var N=l;if(N.vGraphObject!=null){var v=N.vGraphObject;v.update(N)}}else if(l instanceof a){var L=l;if(L.vGraphObject!=null){var s=L.vGraphObject;s.update(L)}}},g.prototype.initParameters=function(){this.isSubLayout||(this.layoutQuality=e.QUALITY,this.animationDuringLayout=e.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=e.DEFAULT_ANIMATION_PERIOD,this.animationOnLayout=e.DEFAULT_ANIMATION_ON_LAYOUT,this.incremental=e.DEFAULT_INCREMENTAL,this.createBendsAsNeeded=e.DEFAULT_CREATE_BENDS_AS_NEEDED,this.uniformLeafNodeSizes=e.DEFAULT_UNIFORM_LEAF_NODE_SIZES),this.animationDuringLayout&&(this.animationOnLayout=!1)},g.prototype.transform=function(l){if(l==null)this.transform(new o(0,0));else{var f=new p,E=this.graphManager.getRoot().updateLeftTop();if(E!=null){f.setWorldOrgX(l.x),f.setWorldOrgY(l.y),f.setDeviceOrgX(E.x),f.setDeviceOrgY(E.y);for(var y=this.getAllNodes(),d,N=0;N<y.length;N++)d=y[N],d.transform(f)}}},g.prototype.positionNodesRandomly=function(l){if(l==null)this.positionNodesRandomly(this.getGraphManager().getRoot()),this.getGraphManager().getRoot().updateBounds(!0);else for(var f,E,y=l.getNodes(),d=0;d<y.length;d++)f=y[d],E=f.getChild(),E==null||E.getNodes().length==0?f.scatter():(this.positionNodesRandomly(E),f.updateBounds())},g.prototype.getFlatForest=function(){for(var l=[],f=!0,E=this.graphManager.getRoot().getNodes(),y=!0,d=0;d<E.length;d++)E[d].getChild()!=null&&(y=!1);if(!y)return l;var N=new Set,v=[],L=new Map,s=[];for(s=s.concat(E);s.length>0&&f;){for(v.push(s[0]);v.length>0&&f;){var u=v[0];v.splice(0,1),N.add(u);for(var c=u.getEdges(),d=0;d<c.length;d++){var A=c[d].getOtherEnd(u);if(L.get(u)!=A)if(!N.has(A))v.push(A),L.set(A,u);else{f=!1;break}}}if(!f)l=[];else{var _=[].concat(n(N));l.push(_);for(var d=0;d<_.length;d++){var O=_[d],D=s.indexOf(O);D>-1&&s.splice(D,1)}N=new Set,L=new Map}}return l},g.prototype.createDummyNodesForBendpoints=function(l){for(var f=[],E=l.source,y=this.graphManager.calcLowestCommonAncestor(l.source,l.target),d=0;d<l.bendpoints.length;d++){var N=this.newNode(null);N.setRect(new Point(0,0),new Dimension(1,1)),y.add(N);var v=this.newEdge(null);this.graphManager.add(v,E,N),f.add(N),E=N}var v=this.newEdge(null);return this.graphManager.add(v,E,l.target),this.edgeToDummyNodes.set(l,f),l.isInterGraph()?this.graphManager.remove(l):y.remove(l),f},g.prototype.createBendpointsFromDummyNodes=function(){var l=[];l=l.concat(this.graphManager.getAllEdges()),l=[].concat(n(this.edgeToDummyNodes.keys())).concat(l);for(var f=0;f<l.length;f++){var E=l[f];if(E.bendpoints.length>0){for(var y=this.edgeToDummyNodes.get(E),d=0;d<y.length;d++){var N=y[d],v=new o(N.getCenterX(),N.getCenterY()),L=E.bendpoints.get(d);L.x=v.x,L.y=v.y,N.getOwner().remove(N)}this.graphManager.add(E,E.source,E.target)}}},g.transform=function(l,f,E,y){if(E!=null&&y!=null){var d=f;if(l<=50){var N=f/E;d-=(f-N)/50*(50-l)}else{var v=f*y;d+=(v-f)/50*(l-50)}return d}else{var L,s;return l<=50?(L=9*f/500,s=f/10):(L=9*f/50,s=-8*f),L*l+s}},g.findCenterOfTree=function(l){var f=[];f=f.concat(l);var E=[],y=new Map,d=!1,N=null;(f.length==1||f.length==2)&&(d=!0,N=f[0]);for(var v=0;v<f.length;v++){var L=f[v],s=L.getNeighborsList().size;y.set(L,L.getNeighborsList().size),s==1&&E.push(L)}var u=[];for(u=u.concat(E);!d;){var c=[];c=c.concat(u),u=[];for(var v=0;v<f.length;v++){var L=f[v],A=f.indexOf(L);A>=0&&f.splice(A,1);var _=L.getNeighborsList();_.forEach(function(w){if(E.indexOf(w)<0){var R=y.get(w),F=R-1;F==1&&u.push(w),y.set(w,F)}})}E=E.concat(u),(f.length==1||f.length==2)&&(d=!0,N=f[0])}return N},g.prototype.setGraphManager=function(l){this.graphManager=l},m.exports=g},function(m,I,T){function n(){}n.seed=1,n.x=0,n.nextDouble=function(){return n.x=Math.sin(n.seed++)*1e4,n.x-Math.floor(n.x)},m.exports=n},function(m,I,T){var n=T(4);function e(t,r){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}e.prototype.getWorldOrgX=function(){return this.lworldOrgX},e.prototype.setWorldOrgX=function(t){this.lworldOrgX=t},e.prototype.getWorldOrgY=function(){return this.lworldOrgY},e.prototype.setWorldOrgY=function(t){this.lworldOrgY=t},e.prototype.getWorldExtX=function(){return this.lworldExtX},e.prototype.setWorldExtX=function(t){this.lworldExtX=t},e.prototype.getWorldExtY=function(){return this.lworldExtY},e.prototype.setWorldExtY=function(t){this.lworldExtY=t},e.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},e.prototype.setDeviceOrgX=function(t){this.ldeviceOrgX=t},e.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},e.prototype.setDeviceOrgY=function(t){this.ldeviceOrgY=t},e.prototype.getDeviceExtX=function(){return this.ldeviceExtX},e.prototype.setDeviceExtX=function(t){this.ldeviceExtX=t},e.prototype.getDeviceExtY=function(){return this.ldeviceExtY},e.prototype.setDeviceExtY=function(t){this.ldeviceExtY=t},e.prototype.transformX=function(t){var r=0,h=this.lworldExtX;return h!=0&&(r=this.ldeviceOrgX+(t-this.lworldOrgX)*this.ldeviceExtX/h),r},e.prototype.transformY=function(t){var r=0,h=this.lworldExtY;return h!=0&&(r=this.ldeviceOrgY+(t-this.lworldOrgY)*this.ldeviceExtY/h),r},e.prototype.inverseTransformX=function(t){var r=0,h=this.ldeviceExtX;return h!=0&&(r=this.lworldOrgX+(t-this.ldeviceOrgX)*this.lworldExtX/h),r},e.prototype.inverseTransformY=function(t){var r=0,h=this.ldeviceExtY;return h!=0&&(r=this.lworldOrgY+(t-this.ldeviceOrgY)*this.lworldExtY/h),r},e.prototype.inverseTransformPoint=function(t){var r=new n(this.inverseTransformX(t.x),this.inverseTransformY(t.y));return r},m.exports=e},function(m,I,T){function n(i){if(Array.isArray(i)){for(var g=0,l=Array(i.length);g<i.length;g++)l[g]=i[g];return l}else return Array.from(i)}var e=T(15),t=T(7),r=T(0),h=T(8),a=T(9);function o(){e.call(this),this.useSmartIdealEdgeLengthCalculation=t.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.idealEdgeLength=t.DEFAULT_EDGE_LENGTH,this.springConstant=t.DEFAULT_SPRING_STRENGTH,this.repulsionConstant=t.DEFAULT_REPULSION_STRENGTH,this.gravityConstant=t.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=t.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=t.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=t.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*t.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=t.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=t.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=t.MAX_ITERATIONS}o.prototype=Object.create(e.prototype);for(var p in e)o[p]=e[p];o.prototype.initParameters=function(){e.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=t.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},o.prototype.calcIdealEdgeLengths=function(){for(var i,g,l,f,E,y,d=this.getGraphManager().getAllEdges(),N=0;N<d.length;N++)i=d[N],i.idealLength=this.idealEdgeLength,i.isInterGraph&&(l=i.getSource(),f=i.getTarget(),E=i.getSourceInLca().getEstimatedSize(),y=i.getTargetInLca().getEstimatedSize(),this.useSmartIdealEdgeLengthCalculation&&(i.idealLength+=E+y-2*r.SIMPLE_NODE_SIZE),g=i.getLca().getInclusionTreeDepth(),i.idealLength+=t.DEFAULT_EDGE_LENGTH*t.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR*(l.getInclusionTreeDepth()+f.getInclusionTreeDepth()-2*g))},o.prototype.initSpringEmbedder=function(){var i=this.getAllNodes().length;this.incremental?(i>t.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*t.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(i-t.ADAPTATION_LOWER_NODE_LIMIT)/(t.ADAPTATION_UPPER_NODE_LIMIT-t.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-t.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=t.MAX_NODE_DISPLACEMENT_INCREMENTAL):(i>t.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(t.COOLING_ADAPTATION_FACTOR,1-(i-t.ADAPTATION_LOWER_NODE_LIMIT)/(t.ADAPTATION_UPPER_NODE_LIMIT-t.ADAPTATION_LOWER_NODE_LIMIT)*(1-t.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=t.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},o.prototype.calcSpringForces=function(){for(var i=this.getAllEdges(),g,l=0;l<i.length;l++)g=i[l],this.calcSpringForce(g,g.idealLength)},o.prototype.calcRepulsionForces=function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,l,f,E,y,d=this.getAllNodes(),N;if(this.useFRGridVariant)for(this.totalIterations%t.GRID_CALCULATION_CHECK_PERIOD==1&&i&&this.updateGrid(),N=new Set,l=0;l<d.length;l++)E=d[l],this.calculateRepulsionForceOfANode(E,N,i,g),N.add(E);else for(l=0;l<d.length;l++)for(E=d[l],f=l+1;f<d.length;f++)y=d[f],E.getOwner()==y.getOwner()&&this.calcRepulsionForce(E,y)},o.prototype.calcGravitationalForces=function(){for(var i,g=this.getAllNodesToApplyGravitation(),l=0;l<g.length;l++)i=g[l],this.calcGravitationalForce(i)},o.prototype.moveNodes=function(){for(var i=this.getAllNodes(),g,l=0;l<i.length;l++)g=i[l],g.move()},o.prototype.calcSpringForce=function(i,g){var l=i.getSource(),f=i.getTarget(),E,y,d,N;if(this.uniformLeafNodeSizes&&l.getChild()==null&&f.getChild()==null)i.updateLengthSimple();else if(i.updateLength(),i.isOverlapingSourceAndTarget)return;E=i.getLength(),E!=0&&(y=this.springConstant*(E-g),d=y*(i.lengthX/E),N=y*(i.lengthY/E),l.springForceX+=d,l.springForceY+=N,f.springForceX-=d,f.springForceY-=N)},o.prototype.calcRepulsionForce=function(i,g){var l=i.getRect(),f=g.getRect(),E=new Array(2),y=new Array(4),d,N,v,L,s,u,c;if(l.intersects(f)){h.calcSeparationAmount(l,f,E,t.DEFAULT_EDGE_LENGTH/2),u=2*E[0],c=2*E[1];var A=i.noOfChildren*g.noOfChildren/(i.noOfChildren+g.noOfChildren);i.repulsionForceX-=A*u,i.repulsionForceY-=A*c,g.repulsionForceX+=A*u,g.repulsionForceY+=A*c}else this.uniformLeafNodeSizes&&i.getChild()==null&&g.getChild()==null?(d=f.getCenterX()-l.getCenterX(),N=f.getCenterY()-l.getCenterY()):(h.getIntersection(l,f,y),d=y[2]-y[0],N=y[3]-y[1]),Math.abs(d)<t.MIN_REPULSION_DIST&&(d=a.sign(d)*t.MIN_REPULSION_DIST),Math.abs(N)<t.MIN_REPULSION_DIST&&(N=a.sign(N)*t.MIN_REPULSION_DIST),v=d*d+N*N,L=Math.sqrt(v),s=this.repulsionConstant*i.noOfChildren*g.noOfChildren/v,u=s*d/L,c=s*N/L,i.repulsionForceX-=u,i.repulsionForceY-=c,g.repulsionForceX+=u,g.repulsionForceY+=c},o.prototype.calcGravitationalForce=function(i){var g,l,f,E,y,d,N,v;g=i.getOwner(),l=(g.getRight()+g.getLeft())/2,f=(g.getTop()+g.getBottom())/2,E=i.getCenterX()-l,y=i.getCenterY()-f,d=Math.abs(E)+i.getWidth()/2,N=Math.abs(y)+i.getHeight()/2,i.getOwner()==this.graphManager.getRoot()?(v=g.getEstimatedSize()*this.gravityRangeFactor,(d>v||N>v)&&(i.gravitationForceX=-this.gravityConstant*E,i.gravitationForceY=-this.gravityConstant*y)):(v=g.getEstimatedSize()*this.compoundGravityRangeFactor,(d>v||N>v)&&(i.gravitationForceX=-this.gravityConstant*E*this.compoundGravityConstant,i.gravitationForceY=-this.gravityConstant*y*this.compoundGravityConstant))},o.prototype.isConverged=function(){var i,g=!1;return this.totalIterations>this.maxIterations/3&&(g=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),i=this.totalDisplacement<this.totalDisplacementThreshold,this.oldTotalDisplacement=this.totalDisplacement,i||g},o.prototype.animate=function(){this.animationDuringLayout&&!this.isSubLayout&&(this.notAnimatedIterations==this.animationPeriod?(this.update(),this.notAnimatedIterations=0):this.notAnimatedIterations++)},o.prototype.calcNoOfChildrenForAllNodes=function(){for(var i,g=this.graphManager.getAllNodes(),l=0;l<g.length;l++)i=g[l],i.noOfChildren=i.getNoOfChildren()},o.prototype.calcGrid=function(i){var g=0,l=0;g=parseInt(Math.ceil((i.getRight()-i.getLeft())/this.repulsionRange)),l=parseInt(Math.ceil((i.getBottom()-i.getTop())/this.repulsionRange));for(var f=new Array(g),E=0;E<g;E++)f[E]=new Array(l);for(var E=0;E<g;E++)for(var y=0;y<l;y++)f[E][y]=new Array;return f},o.prototype.addNodeToGrid=function(i,g,l){var f=0,E=0,y=0,d=0;f=parseInt(Math.floor((i.getRect().x-g)/this.repulsionRange)),E=parseInt(Math.floor((i.getRect().width+i.getRect().x-g)/this.repulsionRange)),y=parseInt(Math.floor((i.getRect().y-l)/this.repulsionRange)),d=parseInt(Math.floor((i.getRect().height+i.getRect().y-l)/this.repulsionRange));for(var N=f;N<=E;N++)for(var v=y;v<=d;v++)this.grid[N][v].push(i),i.setGridCoordinates(f,E,y,d)},o.prototype.updateGrid=function(){var i,g,l=this.getAllNodes();for(this.grid=this.calcGrid(this.graphManager.getRoot()),i=0;i<l.length;i++)g=l[i],this.addNodeToGrid(g,this.graphManager.getRoot().getLeft(),this.graphManager.getRoot().getTop())},o.prototype.calculateRepulsionForceOfANode=function(i,g,l,f){if(this.totalIterations%t.GRID_CALCULATION_CHECK_PERIOD==1&&l||f){var E=new Set;i.surrounding=new Array;for(var y,d=this.grid,N=i.startX-1;N<i.finishX+2;N++)for(var v=i.startY-1;v<i.finishY+2;v++)if(!(N<0||v<0||N>=d.length||v>=d[0].length)){for(var L=0;L<d[N][v].length;L++)if(y=d[N][v][L],!(i.getOwner()!=y.getOwner()||i==y)&&!g.has(y)&&!E.has(y)){var s=Math.abs(i.getCenterX()-y.getCenterX())-(i.getWidth()/2+y.getWidth()/2),u=Math.abs(i.getCenterY()-y.getCenterY())-(i.getHeight()/2+y.getHeight()/2);s<=this.repulsionRange&&u<=this.repulsionRange&&E.add(y)}}i.surrounding=[].concat(n(E))}for(N=0;N<i.surrounding.length;N++)this.calcRepulsionForce(i,i.surrounding[N])},o.prototype.calcRepulsionRange=function(){return 0},m.exports=o},function(m,I,T){var n=T(1),e=T(7);function t(h,a,o){n.call(this,h,a,o),this.idealLength=e.DEFAULT_EDGE_LENGTH}t.prototype=Object.create(n.prototype);for(var r in n)t[r]=n[r];m.exports=t},function(m,I,T){var n=T(3);function e(r,h,a,o){n.call(this,r,h,a,o),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=[]}e.prototype=Object.create(n.prototype);for(var t in n)e[t]=n[t];e.prototype.setGridCoordinates=function(r,h,a,o){this.startX=r,this.finishX=h,this.startY=a,this.finishY=o},m.exports=e},function(m,I,T){function n(e,t){this.width=0,this.height=0,e!==null&&t!==null&&(this.height=t,this.width=e)}n.prototype.getWidth=function(){return this.width},n.prototype.setWidth=function(e){this.width=e},n.prototype.getHeight=function(){return this.height},n.prototype.setHeight=function(e){this.height=e},m.exports=n},function(m,I,T){var n=T(14);function e(){this.map={},this.keys=[]}e.prototype.put=function(t,r){var h=n.createID(t);this.contains(h)||(this.map[h]=r,this.keys.push(t))},e.prototype.contains=function(t){return n.createID(t),this.map[t]!=null},e.prototype.get=function(t){var r=n.createID(t);return this.map[r]},e.prototype.keySet=function(){return this.keys},m.exports=e},function(m,I,T){var n=T(14);function e(){this.set={}}e.prototype.add=function(t){var r=n.createID(t);this.contains(r)||(this.set[r]=t)},e.prototype.remove=function(t){delete this.set[n.createID(t)]},e.prototype.clear=function(){this.set={}},e.prototype.contains=function(t){return this.set[n.createID(t)]==t},e.prototype.isEmpty=function(){return this.size()===0},e.prototype.size=function(){return Object.keys(this.set).length},e.prototype.addAllTo=function(t){for(var r=Object.keys(this.set),h=r.length,a=0;a<h;a++)t.push(this.set[r[a]])},e.prototype.size=function(){return Object.keys(this.set).length},e.prototype.addAll=function(t){for(var r=t.length,h=0;h<r;h++){var a=t[h];this.add(a)}},m.exports=e},function(m,I,T){var n=function(){function h(a,o){for(var p=0;p<o.length;p++){var i=o[p];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(a,i.key,i)}}return function(a,o,p){return o&&h(a.prototype,o),p&&h(a,p),a}}();function e(h,a){if(!(h instanceof a))throw new TypeError("Cannot call a class as a function")}var t=T(11),r=function(){function h(a,o){e(this,h),(o!==null||o!==void 0)&&(this.compareFunction=this._defaultCompareFunction);var p=void 0;a instanceof t?p=a.size():p=a.length,this._quicksort(a,0,p-1)}return n(h,[{key:"_quicksort",value:function(a,o,p){if(o<p){var i=this._partition(a,o,p);this._quicksort(a,o,i),this._quicksort(a,i+1,p)}}},{key:"_partition",value:function(a,o,p){for(var i=this._get(a,o),g=o,l=p;;){for(;this.compareFunction(i,this._get(a,l));)l--;for(;this.compareFunction(this._get(a,g),i);)g++;if(g<l)this._swap(a,g,l),g++,l--;else return l}}},{key:"_get",value:function(a,o){return a instanceof t?a.get_object_at(o):a[o]}},{key:"_set",value:function(a,o,p){a instanceof t?a.set_object_at(o,p):a[o]=p}},{key:"_swap",value:function(a,o,p){var i=this._get(a,o);this._set(a,o,this._get(a,p)),this._set(a,p,i)}},{key:"_defaultCompareFunction",value:function(a,o){return o>a}}]),h}();m.exports=r},function(m,I,T){var n=function(){function r(h,a){for(var o=0;o<a.length;o++){var p=a[o];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(h,p.key,p)}}return function(h,a,o){return a&&r(h.prototype,a),o&&r(h,o),h}}();function e(r,h){if(!(r instanceof h))throw new TypeError("Cannot call a class as a function")}var t=function(){function r(h,a){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,p=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;e(this,r),this.sequence1=h,this.sequence2=a,this.match_score=o,this.mismatch_penalty=p,this.gap_penalty=i,this.iMax=h.length+1,this.jMax=a.length+1,this.grid=new Array(this.iMax);for(var g=0;g<this.iMax;g++){this.grid[g]=new Array(this.jMax);for(var l=0;l<this.jMax;l++)this.grid[g][l]=0}this.tracebackGrid=new Array(this.iMax);for(var f=0;f<this.iMax;f++){this.tracebackGrid[f]=new Array(this.jMax);for(var E=0;E<this.jMax;E++)this.tracebackGrid[f][E]=[null,null,null]}this.alignments=[],this.score=-1,this.computeGrids()}return n(r,[{key:"getScore",value:function(){return this.score}},{key:"getAlignments",value:function(){return this.alignments}},{key:"computeGrids",value:function(){for(var h=1;h<this.jMax;h++)this.grid[0][h]=this.grid[0][h-1]+this.gap_penalty,this.tracebackGrid[0][h]=[!1,!1,!0];for(var a=1;a<this.iMax;a++)this.grid[a][0]=this.grid[a-1][0]+this.gap_penalty,this.tracebackGrid[a][0]=[!1,!0,!1];for(var o=1;o<this.iMax;o++)for(var p=1;p<this.jMax;p++){var i=void 0;this.sequence1[o-1]===this.sequence2[p-1]?i=this.grid[o-1][p-1]+this.match_score:i=this.grid[o-1][p-1]+this.mismatch_penalty;var g=this.grid[o-1][p]+this.gap_penalty,l=this.grid[o][p-1]+this.gap_penalty,f=[i,g,l],E=this.arrayAllMaxIndexes(f);this.grid[o][p]=f[E[0]],this.tracebackGrid[o][p]=[E.includes(0),E.includes(1),E.includes(2)]}this.score=this.grid[this.iMax-1][this.jMax-1]}},{key:"alignmentTraceback",value:function(){var h=[];for(h.push({pos:[this.sequence1.length,this.sequence2.length],seq1:"",seq2:""});h[0];){var a=h[0],o=this.tracebackGrid[a.pos[0]][a.pos[1]];o[0]&&h.push({pos:[a.pos[0]-1,a.pos[1]-1],seq1:this.sequence1[a.pos[0]-1]+a.seq1,seq2:this.sequence2[a.pos[1]-1]+a.seq2}),o[1]&&h.push({pos:[a.pos[0]-1,a.pos[1]],seq1:this.sequence1[a.pos[0]-1]+a.seq1,seq2:"-"+a.seq2}),o[2]&&h.push({pos:[a.pos[0],a.pos[1]-1],seq1:"-"+a.seq1,seq2:this.sequence2[a.pos[1]-1]+a.seq2}),a.pos[0]===0&&a.pos[1]===0&&this.alignments.push({sequence1:a.seq1,sequence2:a.seq2}),h.shift()}return this.alignments}},{key:"getAllIndexes",value:function(h,a){for(var o=[],p=-1;(p=h.indexOf(a,p+1))!==-1;)o.push(p);return o}},{key:"arrayAllMaxIndexes",value:function(h){return this.getAllIndexes(h,Math.max.apply(null,h))}}]),r}();m.exports=t},function(m,I,T){var n=function(){};n.FDLayout=T(18),n.FDLayoutConstants=T(7),n.FDLayoutEdge=T(19),n.FDLayoutNode=T(20),n.DimensionD=T(21),n.HashMap=T(22),n.HashSet=T(23),n.IGeometry=T(8),n.IMath=T(9),n.Integer=T(10),n.Point=T(12),n.PointD=T(4),n.RandomSeed=T(16),n.RectangleD=T(13),n.Transform=T(17),n.UniqueIDGeneretor=T(14),n.Quicksort=T(24),n.LinkedList=T(11),n.LGraphObject=T(2),n.LGraph=T(5),n.LEdge=T(1),n.LGraphManager=T(6),n.LNode=T(3),n.Layout=T(15),n.LayoutConstants=T(0),n.NeedlemanWunsch=T(25),m.exports=n},function(m,I,T){function n(){this.listeners=[]}var e=n.prototype;e.addListener=function(t,r){this.listeners.push({event:t,callback:r})},e.removeListener=function(t,r){for(var h=this.listeners.length;h>=0;h--){var a=this.listeners[h];a.event===t&&a.callback===r&&this.listeners.splice(h,1)}},e.emit=function(t,r){for(var h=0;h<this.listeners.length;h++){var a=this.listeners[h];t===a.event&&a.callback(r)}},m.exports=n}])})}(q)),q.exports}var dt=z.exports,K;function pt(){return K||(K=1,function(x,X){(function(m,I){x.exports=I(ct())})(dt,function(m){return function(I){var T={};function n(e){if(T[e])return T[e].exports;var t=T[e]={i:e,l:!1,exports:{}};return I[e].call(t.exports,t,t.exports,n),t.l=!0,t.exports}return n.m=I,n.c=T,n.i=function(e){return e},n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=7)}([function(I,T){I.exports=m},function(I,T,n){var e=n(0).FDLayoutConstants;function t(){}for(var r in e)t[r]=e[r];t.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,t.DEFAULT_RADIAL_SEPARATION=e.DEFAULT_EDGE_LENGTH,t.DEFAULT_COMPONENT_SEPERATION=60,t.TILE=!0,t.TILING_PADDING_VERTICAL=10,t.TILING_PADDING_HORIZONTAL=10,t.TREE_REDUCTION_ON_INCREMENTAL=!1,I.exports=t},function(I,T,n){var e=n(0).FDLayoutEdge;function t(h,a,o){e.call(this,h,a,o)}t.prototype=Object.create(e.prototype);for(var r in e)t[r]=e[r];I.exports=t},function(I,T,n){var e=n(0).LGraph;function t(h,a,o){e.call(this,h,a,o)}t.prototype=Object.create(e.prototype);for(var r in e)t[r]=e[r];I.exports=t},function(I,T,n){var e=n(0).LGraphManager;function t(h){e.call(this,h)}t.prototype=Object.create(e.prototype);for(var r in e)t[r]=e[r];I.exports=t},function(I,T,n){var e=n(0).FDLayoutNode,t=n(0).IMath;function r(a,o,p,i){e.call(this,a,o,p,i)}r.prototype=Object.create(e.prototype);for(var h in e)r[h]=e[h];r.prototype.move=function(){var a=this.graphManager.getLayout();this.displacementX=a.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY=a.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren,Math.abs(this.displacementX)>a.coolingFactor*a.maxNodeDisplacement&&(this.displacementX=a.coolingFactor*a.maxNodeDisplacement*t.sign(this.displacementX)),Math.abs(this.displacementY)>a.coolingFactor*a.maxNodeDisplacement&&(this.displacementY=a.coolingFactor*a.maxNodeDisplacement*t.sign(this.displacementY)),this.child==null?this.moveBy(this.displacementX,this.displacementY):this.child.getNodes().length==0?this.moveBy(this.displacementX,this.displacementY):this.propogateDisplacementToChildren(this.displacementX,this.displacementY),a.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},r.prototype.propogateDisplacementToChildren=function(a,o){for(var p=this.getChild().getNodes(),i,g=0;g<p.length;g++)i=p[g],i.getChild()==null?(i.moveBy(a,o),i.displacementX+=a,i.displacementY+=o):i.propogateDisplacementToChildren(a,o)},r.prototype.setPred1=function(a){this.pred1=a},r.prototype.getPred1=function(){return pred1},r.prototype.getPred2=function(){return pred2},r.prototype.setNext=function(a){this.next=a},r.prototype.getNext=function(){return next},r.prototype.setProcessed=function(a){this.processed=a},r.prototype.isProcessed=function(){return processed},I.exports=r},function(I,T,n){var e=n(0).FDLayout,t=n(4),r=n(3),h=n(5),a=n(2),o=n(1),p=n(0).FDLayoutConstants,i=n(0).LayoutConstants,g=n(0).Point,l=n(0).PointD,f=n(0).Layout,E=n(0).Integer,y=n(0).IGeometry,d=n(0).LGraph,N=n(0).Transform;function v(){e.call(this),this.toBeTiled={}}v.prototype=Object.create(e.prototype);for(var L in e)v[L]=e[L];v.prototype.newGraphManager=function(){var s=new t(this);return this.graphManager=s,s},v.prototype.newGraph=function(s){return new r(null,this.graphManager,s)},v.prototype.newNode=function(s){return new h(this.graphManager,s)},v.prototype.newEdge=function(s){return new a(null,null,s)},v.prototype.initParameters=function(){e.prototype.initParameters.call(this,arguments),this.isSubLayout||(o.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=o.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=o.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.springConstant=p.DEFAULT_SPRING_STRENGTH,this.repulsionConstant=p.DEFAULT_REPULSION_STRENGTH,this.gravityConstant=p.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=p.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=p.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=p.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1,this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/p.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=p.CONVERGENCE_CHECK_PERIOD/this.maxIterations,this.coolingAdjuster=1)},v.prototype.layout=function(){var s=i.DEFAULT_CREATE_BENDS_AS_NEEDED;return s&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},v.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(o.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var s=new Set(this.getAllNodes()),u=this.nodesWithGravity.filter(function(A){return s.has(A)});this.graphManager.setAllNodesToApplyGravitation(u)}}else{var c=this.getFlatForest();if(c.length>0)this.positionNodesRadially(c);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var s=new Set(this.getAllNodes()),u=this.nodesWithGravity.filter(function(O){return s.has(O)});this.graphManager.setAllNodesToApplyGravitation(u),this.positionNodesRandomly()}}return this.initSpringEmbedder(),this.runSpringEmbedder(),!0},v.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%p.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var s=new Set(this.getAllNodes()),u=this.nodesWithGravity.filter(function(_){return s.has(_)});this.graphManager.setAllNodesToApplyGravitation(u),this.graphManager.updateBounds(),this.updateGrid(),this.coolingFactor=p.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()),this.coolingFactor=p.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var c=!this.isTreeGrowing&&!this.isGrowthFinished,A=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(c,A),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},v.prototype.getPositionsData=function(){for(var s=this.graphManager.getAllNodes(),u={},c=0;c<s.length;c++){var A=s[c].rect,_=s[c].id;u[_]={id:_,x:A.getCenterX(),y:A.getCenterY(),w:A.width,h:A.height}}return u},v.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var s=!1;if(p.ANIMATE==="during")this.emit("layoutstarted");else{for(;!s;)s=this.tick();this.graphManager.updateBounds()}},v.prototype.calculateNodesToApplyGravitationTo=function(){var s=[],u,c=this.graphManager.getGraphs(),A=c.length,_;for(_=0;_<A;_++)u=c[_],u.updateConnected(),u.isConnected||(s=s.concat(u.getNodes()));return s},v.prototype.createBendpoints=function(){var s=[];s=s.concat(this.graphManager.getAllEdges());var u=new Set,c;for(c=0;c<s.length;c++){var A=s[c];if(!u.has(A)){var _=A.getSource(),O=A.getTarget();if(_==O)A.getBendpoints().push(new l),A.getBendpoints().push(new l),this.createDummyNodesForBendpoints(A),u.add(A);else{var D=[];if(D=D.concat(_.getEdgeListToNode(O)),D=D.concat(O.getEdgeListToNode(_)),!u.has(D[0])){if(D.length>1){var w;for(w=0;w<D.length;w++){var R=D[w];R.getBendpoints().push(new l),this.createDummyNodesForBendpoints(R)}}D.forEach(function(F){u.add(F)})}}}if(u.size==s.length)break}},v.prototype.positionNodesRadially=function(s){for(var u=new g(0,0),c=Math.ceil(Math.sqrt(s.length)),A=0,_=0,O=0,D=new l(0,0),w=0;w<s.length;w++){w%c==0&&(O=0,_=A,w!=0&&(_+=o.DEFAULT_COMPONENT_SEPERATION),A=0);var R=s[w],F=f.findCenterOfTree(R);u.x=O,u.y=_,D=v.radialLayout(R,F,u),D.y>A&&(A=Math.floor(D.y)),O=Math.floor(D.x+o.DEFAULT_COMPONENT_SEPERATION)}this.transform(new l(i.WORLD_CENTER_X-D.x/2,i.WORLD_CENTER_Y-D.y/2))},v.radialLayout=function(s,u,c){var A=Math.max(this.maxDiagonalInTree(s),o.DEFAULT_RADIAL_SEPARATION);v.branchRadialLayout(u,null,0,359,0,A);var _=d.calculateBounds(s),O=new N;O.setDeviceOrgX(_.getMinX()),O.setDeviceOrgY(_.getMinY()),O.setWorldOrgX(c.x),O.setWorldOrgY(c.y);for(var D=0;D<s.length;D++){var w=s[D];w.transform(O)}var R=new l(_.getMaxX(),_.getMaxY());return O.inverseTransformPoint(R)},v.branchRadialLayout=function(s,u,c,A,_,O){var D=(A-c+1)/2;D<0&&(D+=180);var w=(D+c)%360,R=w*y.TWO_PI/360,F=_*Math.cos(R),b=_*Math.sin(R);s.setCenter(F,b);var C=[];C=C.concat(s.getEdges());var M=C.length;u!=null&&M--;for(var G=0,P=C.length,S,U=s.getEdgesBetween(u);U.length>1;){var Y=U[0];U.splice(0,1);var B=C.indexOf(Y);B>=0&&C.splice(B,1),P--,M--}u!=null?S=(C.indexOf(U[0])+1)%P:S=0;for(var H=Math.abs(A-c)/M,k=S;G!=M;k=++k%P){var Z=C[k].getOtherEnd(s);if(Z!=u){var Q=(c+G*H)%360,ht=(Q+H)%360;v.branchRadialLayout(Z,s,Q,ht,_+O,O),G++}}},v.maxDiagonalInTree=function(s){for(var u=E.MIN_VALUE,c=0;c<s.length;c++){var A=s[c],_=A.getDiagonal();_>u&&(u=_)}return u},v.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},v.prototype.groupZeroDegreeMembers=function(){var s=this,u={};this.memberGroups={},this.idToDummyNode={};for(var c=[],A=this.graphManager.getAllNodes(),_=0;_<A.length;_++){var O=A[_],D=O.getParent();this.getNodeDegreeWithChildren(O)===0&&(D.id==null||!this.getToBeTiled(D))&&c.push(O)}for(var _=0;_<c.length;_++){var O=c[_],w=O.getParent().id;typeof u[w]>"u"&&(u[w]=[]),u[w]=u[w].concat(O)}Object.keys(u).forEach(function(R){if(u[R].length>1){var F="DummyCompound_"+R;s.memberGroups[F]=u[R];var b=u[R][0].getParent(),C=new h(s.graphManager);C.id=F,C.paddingLeft=b.paddingLeft||0,C.paddingRight=b.paddingRight||0,C.paddingBottom=b.paddingBottom||0,C.paddingTop=b.paddingTop||0,s.idToDummyNode[F]=C;var M=s.getGraphManager().add(s.newGraph(),C),G=b.getChild();G.add(C);for(var P=0;P<u[R].length;P++){var S=u[R][P];G.remove(S),M.add(S)}}})},v.prototype.clearCompounds=function(){var s={},u={};this.performDFSOnCompounds();for(var c=0;c<this.compoundOrder.length;c++)u[this.compoundOrder[c].id]=this.compoundOrder[c],s[this.compoundOrder[c].id]=[].concat(this.compoundOrder[c].getChild().getNodes()),this.graphManager.remove(this.compoundOrder[c].getChild()),this.compoundOrder[c].child=null;this.graphManager.resetAllNodes(),this.tileCompoundMembers(s,u)},v.prototype.clearZeroDegreeMembers=function(){var s=this,u=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach(function(c){var A=s.idToDummyNode[c];u[c]=s.tileNodes(s.memberGroups[c],A.paddingLeft+A.paddingRight),A.rect.width=u[c].width,A.rect.height=u[c].height})},v.prototype.repopulateCompounds=function(){for(var s=this.compoundOrder.length-1;s>=0;s--){var u=this.compoundOrder[s],c=u.id,A=u.paddingLeft,_=u.paddingTop;this.adjustLocations(this.tiledMemberPack[c],u.rect.x,u.rect.y,A,_)}},v.prototype.repopulateZeroDegreeMembers=function(){var s=this,u=this.tiledZeroDegreePack;Object.keys(u).forEach(function(c){var A=s.idToDummyNode[c],_=A.paddingLeft,O=A.paddingTop;s.adjustLocations(u[c],A.rect.x,A.rect.y,_,O)})},v.prototype.getToBeTiled=function(s){var u=s.id;if(this.toBeTiled[u]!=null)return this.toBeTiled[u];var c=s.getChild();if(c==null)return this.toBeTiled[u]=!1,!1;for(var A=c.getNodes(),_=0;_<A.length;_++){var O=A[_];if(this.getNodeDegree(O)>0)return this.toBeTiled[u]=!1,!1;if(O.getChild()==null){this.toBeTiled[O.id]=!1;continue}if(!this.getToBeTiled(O))return this.toBeTiled[u]=!1,!1}return this.toBeTiled[u]=!0,!0},v.prototype.getNodeDegree=function(s){s.id;for(var u=s.getEdges(),c=0,A=0;A<u.length;A++){var _=u[A];_.getSource().id!==_.getTarget().id&&(c=c+1)}return c},v.prototype.getNodeDegreeWithChildren=function(s){var u=this.getNodeDegree(s);if(s.getChild()==null)return u;for(var c=s.getChild().getNodes(),A=0;A<c.length;A++){var _=c[A];u+=this.getNodeDegreeWithChildren(_)}return u},v.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},v.prototype.fillCompexOrderByDFS=function(s){for(var u=0;u<s.length;u++){var c=s[u];c.getChild()!=null&&this.fillCompexOrderByDFS(c.getChild().getNodes()),this.getToBeTiled(c)&&this.compoundOrder.push(c)}},v.prototype.adjustLocations=function(s,u,c,A,_){u+=A,c+=_;for(var O=u,D=0;D<s.rows.length;D++){var w=s.rows[D];u=O;for(var R=0,F=0;F<w.length;F++){var b=w[F];b.rect.x=u,b.rect.y=c,u+=b.rect.width+s.horizontalPadding,b.rect.height>R&&(R=b.rect.height)}c+=R+s.verticalPadding}},v.prototype.tileCompoundMembers=function(s,u){var c=this;this.tiledMemberPack=[],Object.keys(s).forEach(function(A){var _=u[A];c.tiledMemberPack[A]=c.tileNodes(s[A],_.paddingLeft+_.paddingRight),_.rect.width=c.tiledMemberPack[A].width,_.rect.height=c.tiledMemberPack[A].height})},v.prototype.tileNodes=function(s,u){var c=o.TILING_PADDING_VERTICAL,A=o.TILING_PADDING_HORIZONTAL,_={rows:[],rowWidth:[],rowHeight:[],width:0,height:u,verticalPadding:c,horizontalPadding:A};s.sort(function(w,R){return w.rect.width*w.rect.height>R.rect.width*R.rect.height?-1:w.rect.width*w.rect.height<R.rect.width*R.rect.height?1:0});for(var O=0;O<s.length;O++){var D=s[O];_.rows.length==0?this.insertNodeToRow(_,D,0,u):this.canAddHorizontal(_,D.rect.width,D.rect.height)?this.insertNodeToRow(_,D,this.getShortestRowIndex(_),u):this.insertNodeToRow(_,D,_.rows.length,u),this.shiftToLastRow(_)}return _},v.prototype.insertNodeToRow=function(s,u,c,A){var _=A;if(c==s.rows.length){var O=[];s.rows.push(O),s.rowWidth.push(_),s.rowHeight.push(0)}var D=s.rowWidth[c]+u.rect.width;s.rows[c].length>0&&(D+=s.horizontalPadding),s.rowWidth[c]=D,s.width<D&&(s.width=D);var w=u.rect.height;c>0&&(w+=s.verticalPadding);var R=0;w>s.rowHeight[c]&&(R=s.rowHeight[c],s.rowHeight[c]=w,R=s.rowHeight[c]-R),s.height+=R,s.rows[c].push(u)},v.prototype.getShortestRowIndex=function(s){for(var u=-1,c=Number.MAX_VALUE,A=0;A<s.rows.length;A++)s.rowWidth[A]<c&&(u=A,c=s.rowWidth[A]);return u},v.prototype.getLongestRowIndex=function(s){for(var u=-1,c=Number.MIN_VALUE,A=0;A<s.rows.length;A++)s.rowWidth[A]>c&&(u=A,c=s.rowWidth[A]);return u},v.prototype.canAddHorizontal=function(s,u,c){var A=this.getShortestRowIndex(s);if(A<0)return!0;var _=s.rowWidth[A];if(_+s.horizontalPadding+u<=s.width)return!0;var O=0;s.rowHeight[A]<c&&A>0&&(O=c+s.verticalPadding-s.rowHeight[A]);var D;s.width-_>=u+s.horizontalPadding?D=(s.height+O)/(_+u+s.horizontalPadding):D=(s.height+O)/s.width,O=c+s.verticalPadding;var w;return s.width<u?w=(s.height+O)/u:w=(s.height+O)/s.width,w<1&&(w=1/w),D<1&&(D=1/D),D<w},v.prototype.shiftToLastRow=function(s){var u=this.getLongestRowIndex(s),c=s.rowWidth.length-1,A=s.rows[u],_=A[A.length-1],O=_.width+s.horizontalPadding;if(s.width-s.rowWidth[c]>O&&u!=c){A.splice(-1,1),s.rows[c].push(_),s.rowWidth[u]=s.rowWidth[u]-O,s.rowWidth[c]=s.rowWidth[c]+O,s.width=s.rowWidth[instance.getLongestRowIndex(s)];for(var D=Number.MIN_VALUE,w=0;w<A.length;w++)A[w].height>D&&(D=A[w].height);u>0&&(D+=s.verticalPadding);var R=s.rowHeight[u]+s.rowHeight[c];s.rowHeight[u]=D,s.rowHeight[c]<_.height+s.verticalPadding&&(s.rowHeight[c]=_.height+s.verticalPadding);var F=s.rowHeight[u]+s.rowHeight[c];s.height+=F-R,this.shiftToLastRow(s)}},v.prototype.tilingPreLayout=function(){o.TILE&&(this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers())},v.prototype.tilingPostLayout=function(){o.TILE&&(this.repopulateZeroDegreeMembers(),this.repopulateCompounds())},v.prototype.reduceTrees=function(){for(var s=[],u=!0,c;u;){var A=this.graphManager.getAllNodes(),_=[];u=!1;for(var O=0;O<A.length;O++)c=A[O],c.getEdges().length==1&&!c.getEdges()[0].isInterGraph&&c.getChild()==null&&(_.push([c,c.getEdges()[0],c.getOwner()]),u=!0);if(u==!0){for(var D=[],w=0;w<_.length;w++)_[w][0].getEdges().length==1&&(D.push(_[w]),_[w][0].getOwner().remove(_[w][0]));s.push(D),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=s},v.prototype.growTree=function(s){for(var u=s.length,c=s[u-1],A,_=0;_<c.length;_++)A=c[_],this.findPlaceforPrunedNode(A),A[2].add(A[0]),A[2].add(A[1],A[1].source,A[1].target);s.splice(s.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},v.prototype.findPlaceforPrunedNode=function(s){var u,c,A=s[0];A==s[1].source?c=s[1].target:c=s[1].source;var _=c.startX,O=c.finishX,D=c.startY,w=c.finishY,R=0,F=0,b=0,C=0,M=[R,b,F,C];if(D>0)for(var G=_;G<=O;G++)M[0]+=this.grid[G][D-1].length+this.grid[G][D].length-1;if(O<this.grid.length-1)for(var G=D;G<=w;G++)M[1]+=this.grid[O+1][G].length+this.grid[O][G].length-1;if(w<this.grid[0].length-1)for(var G=_;G<=O;G++)M[2]+=this.grid[G][w+1].length+this.grid[G][w].length-1;if(_>0)for(var G=D;G<=w;G++)M[3]+=this.grid[_-1][G].length+this.grid[_][G].length-1;for(var P=E.MAX_VALUE,S,U,Y=0;Y<M.length;Y++)M[Y]<P?(P=M[Y],S=1,U=Y):M[Y]==P&&S++;if(S==3&&P==0)M[0]==0&&M[1]==0&&M[2]==0?u=1:M[0]==0&&M[1]==0&&M[3]==0?u=0:M[0]==0&&M[2]==0&&M[3]==0?u=3:M[1]==0&&M[2]==0&&M[3]==0&&(u=2);else if(S==2&&P==0){var B=Math.floor(Math.random()*2);M[0]==0&&M[1]==0?B==0?u=0:u=1:M[0]==0&&M[2]==0?B==0?u=0:u=2:M[0]==0&&M[3]==0?B==0?u=0:u=3:M[1]==0&&M[2]==0?B==0?u=1:u=2:M[1]==0&&M[3]==0?B==0?u=1:u=3:B==0?u=2:u=3}else if(S==4&&P==0){var B=Math.floor(Math.random()*4);u=B}else u=U;u==0?A.setCenter(c.getCenterX(),c.getCenterY()-c.getHeight()/2-p.DEFAULT_EDGE_LENGTH-A.getHeight()/2):u==1?A.setCenter(c.getCenterX()+c.getWidth()/2+p.DEFAULT_EDGE_LENGTH+A.getWidth()/2,c.getCenterY()):u==2?A.setCenter(c.getCenterX(),c.getCenterY()+c.getHeight()/2+p.DEFAULT_EDGE_LENGTH+A.getHeight()/2):A.setCenter(c.getCenterX()-c.getWidth()/2-p.DEFAULT_EDGE_LENGTH-A.getWidth()/2,c.getCenterY())},I.exports=v},function(I,T,n){var e={};e.layoutBase=n(0),e.CoSEConstants=n(1),e.CoSEEdge=n(2),e.CoSEGraph=n(3),e.CoSEGraphManager=n(4),e.CoSELayout=n(6),e.CoSENode=n(5),I.exports=e}])})}(z)),z.exports}var ft=V.exports,J;function yt(){return J||(J=1,function(x,X){(function(m,I){x.exports=I(pt())})(ft,function(m){return function(I){var T={};function n(e){if(T[e])return T[e].exports;var t=T[e]={i:e,l:!1,exports:{}};return I[e].call(t.exports,t,t.exports,n),t.l=!0,t.exports}return n.m=I,n.c=T,n.i=function(e){return e},n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=1)}([function(I,T){I.exports=m},function(I,T,n){var e=n(0).layoutBase.LayoutConstants,t=n(0).layoutBase.FDLayoutConstants,r=n(0).CoSEConstants,h=n(0).CoSELayout,a=n(0).CoSENode,o=n(0).layoutBase.PointD,p=n(0).layoutBase.DimensionD,i={ready:function(){},stop:function(){},quality:"default",nodeDimensionsIncludeLabels:!1,refresh:30,fit:!0,padding:10,randomize:!0,nodeRepulsion:4500,idealEdgeLength:50,edgeElasticity:.45,nestingFactor:.1,gravity:.25,numIter:2500,tile:!0,animate:"end",animationDuration:500,tilingPaddingVertical:10,tilingPaddingHorizontal:10,gravityRangeCompound:1.5,gravityCompound:1,gravityRange:3.8,initialEnergyOnIncremental:.5};function g(y,d){var N={};for(var v in y)N[v]=y[v];for(var v in d)N[v]=d[v];return N}function l(y){this.options=g(i,y),f(this.options)}var f=function(y){y.nodeRepulsion!=null&&(r.DEFAULT_REPULSION_STRENGTH=t.DEFAULT_REPULSION_STRENGTH=y.nodeRepulsion),y.idealEdgeLength!=null&&(r.DEFAULT_EDGE_LENGTH=t.DEFAULT_EDGE_LENGTH=y.idealEdgeLength),y.edgeElasticity!=null&&(r.DEFAULT_SPRING_STRENGTH=t.DEFAULT_SPRING_STRENGTH=y.edgeElasticity),y.nestingFactor!=null&&(r.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=t.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=y.nestingFactor),y.gravity!=null&&(r.DEFAULT_GRAVITY_STRENGTH=t.DEFAULT_GRAVITY_STRENGTH=y.gravity),y.numIter!=null&&(r.MAX_ITERATIONS=t.MAX_ITERATIONS=y.numIter),y.gravityRange!=null&&(r.DEFAULT_GRAVITY_RANGE_FACTOR=t.DEFAULT_GRAVITY_RANGE_FACTOR=y.gravityRange),y.gravityCompound!=null&&(r.DEFAULT_COMPOUND_GRAVITY_STRENGTH=t.DEFAULT_COMPOUND_GRAVITY_STRENGTH=y.gravityCompound),y.gravityRangeCompound!=null&&(r.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=t.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=y.gravityRangeCompound),y.initialEnergyOnIncremental!=null&&(r.DEFAULT_COOLING_FACTOR_INCREMENTAL=t.DEFAULT_COOLING_FACTOR_INCREMENTAL=y.initialEnergyOnIncremental),y.quality=="draft"?e.QUALITY=0:y.quality=="proof"?e.QUALITY=2:e.QUALITY=1,r.NODE_DIMENSIONS_INCLUDE_LABELS=t.NODE_DIMENSIONS_INCLUDE_LABELS=e.NODE_DIMENSIONS_INCLUDE_LABELS=y.nodeDimensionsIncludeLabels,r.DEFAULT_INCREMENTAL=t.DEFAULT_INCREMENTAL=e.DEFAULT_INCREMENTAL=!y.randomize,r.ANIMATE=t.ANIMATE=e.ANIMATE=y.animate,r.TILE=y.tile,r.TILING_PADDING_VERTICAL=typeof y.tilingPaddingVertical=="function"?y.tilingPaddingVertical.call():y.tilingPaddingVertical,r.TILING_PADDING_HORIZONTAL=typeof y.tilingPaddingHorizontal=="function"?y.tilingPaddingHorizontal.call():y.tilingPaddingHorizontal};l.prototype.run=function(){var y,d,N=this.options;this.idToLNode={};var v=this.layout=new h,L=this;L.stopped=!1,this.cy=this.options.cy,this.cy.trigger({type:"layoutstart",layout:this});var s=v.newGraphManager();this.gm=s;var u=this.options.eles.nodes(),c=this.options.eles.edges();this.root=s.addRoot(),this.processChildrenList(this.root,this.getTopMostNodes(u),v);for(var A=0;A<c.length;A++){var _=c[A],O=this.idToLNode[_.data("source")],D=this.idToLNode[_.data("target")];if(O!==D&&O.getEdgesBetween(D).length==0){var w=s.add(v.newEdge(),O,D);w.id=_.id()}}var R=function(b,C){typeof b=="number"&&(b=C);var M=b.data("id"),G=L.idToLNode[M];return{x:G.getRect().getCenterX(),y:G.getRect().getCenterY()}},F=function b(){for(var C=function(){N.fit&&N.cy.fit(N.eles,N.padding),y||(y=!0,L.cy.one("layoutready",N.ready),L.cy.trigger({type:"layoutready",layout:L}))},M=L.options.refresh,G,P=0;P<M&&!G;P++)G=L.stopped||L.layout.tick();if(G){v.checkLayoutSuccess()&&!v.isSubLayout&&v.doPostLayout(),v.tilingPostLayout&&v.tilingPostLayout(),v.isLayoutFinished=!0,L.options.eles.nodes().positions(R),C(),L.cy.one("layoutstop",L.options.stop),L.cy.trigger({type:"layoutstop",layout:L}),d&&cancelAnimationFrame(d),y=!1;return}var S=L.layout.getPositionsData();N.eles.nodes().positions(function(U,Y){if(typeof U=="number"&&(U=Y),!U.isParent()){for(var B=U.id(),H=S[B],k=U;H==null&&(H=S[k.data("parent")]||S["DummyCompound_"+k.data("parent")],S[B]=H,k=k.parent()[0],k!=null););return H!=null?{x:H.x,y:H.y}:{x:U.position("x"),y:U.position("y")}}}),C(),d=requestAnimationFrame(b)};return v.addListener("layoutstarted",function(){L.options.animate==="during"&&(d=requestAnimationFrame(F))}),v.runLayout(),this.options.animate!=="during"&&(L.options.eles.nodes().not(":parent").layoutPositions(L,L.options,R),y=!1),this},l.prototype.getTopMostNodes=function(y){for(var d={},N=0;N<y.length;N++)d[y[N].id()]=!0;var v=y.filter(function(L,s){typeof L=="number"&&(L=s);for(var u=L.parent()[0];u!=null;){if(d[u.id()])return!1;u=u.parent()[0]}return!0});return v},l.prototype.processChildrenList=function(y,d,N){for(var v=d.length,L=0;L<v;L++){var s=d[L],u=s.children(),c,A=s.layoutDimensions({nodeDimensionsIncludeLabels:this.options.nodeDimensionsIncludeLabels});if(s.outerWidth()!=null&&s.outerHeight()!=null?c=y.add(new a(N.graphManager,new o(s.position("x")-A.w/2,s.position("y")-A.h/2),new p(parseFloat(A.w),parseFloat(A.h)))):c=y.add(new a(this.graphManager)),c.id=s.data("id"),c.paddingLeft=parseInt(s.css("padding")),c.paddingTop=parseInt(s.css("padding")),c.paddingRight=parseInt(s.css("padding")),c.paddingBottom=parseInt(s.css("padding")),this.options.nodeDimensionsIncludeLabels&&s.isParent()){var _=s.boundingBox({includeLabels:!0,includeNodes:!1}).w,O=s.boundingBox({includeLabels:!0,includeNodes:!1}).h,D=s.css("text-halign");c.labelWidth=_,c.labelHeight=O,c.labelPos=D}if(this.idToLNode[s.data("id")]=c,isNaN(c.rect.x)&&(c.rect.x=0),isNaN(c.rect.y)&&(c.rect.y=0),u!=null&&u.length>0){var w;w=N.getGraphManager().add(N.newGraph(),c),this.processChildrenList(w,u,N)}}},l.prototype.stop=function(){return this.stopped=!0,this};var E=function(y){y("layout","cose-bilkent",l)};typeof cytoscape<"u"&&E(cytoscape),I.exports=E}])})}(V)),V.exports}var Et=yt();const vt=gt(Et);tt.use(vt);function et(x,X){x.forEach(m=>{const I={id:m.id,labelText:m.label,height:m.height,width:m.width,padding:m.padding??0};Object.keys(m).forEach(T=>{["id","label","height","width","padding","x","y"].includes(T)||(I[T]=m[T])}),X.add({group:"nodes",data:I,position:{x:m.x??0,y:m.y??0}})})}W(et,"addNodes");function rt(x,X){x.forEach(m=>{const I={id:m.id,source:m.start,target:m.end};Object.keys(m).forEach(T=>{["id","start","end"].includes(T)||(I[T]=m[T])}),X.add({group:"edges",data:I})})}W(rt,"addEdges");function it(x){return new Promise(X=>{const m=lt("body").append("div").attr("id","cy").attr("style","display:none"),I=tt({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"bezier"}}]});m.remove(),et(x.nodes,I),rt(x.edges,I),I.nodes().forEach(function(n){n.layoutDimensions=()=>{const e=n.data();return{w:e.width,h:e.height}}});const T={name:"cose-bilkent",quality:"proof",styleEnabled:!1,animate:!1};I.layout(T).run(),I.ready(n=>{j.info("Cytoscape ready",n),X(I)})})}W(it,"createCytoscapeInstance");function nt(x){return x.nodes().map(X=>{const m=X.data(),I=X.position(),T={id:m.id,x:I.x,y:I.y};return Object.keys(m).forEach(n=>{n!=="id"&&(T[n]=m[n])}),T})}W(nt,"extractPositionedNodes");function ot(x){return x.edges().map(X=>{const m=X.data(),I=X._private.rscratch,T={id:m.id,source:m.source,target:m.target,startX:I.startX,startY:I.startY,midX:I.midX,midY:I.midY,endX:I.endX,endY:I.endY};return Object.keys(m).forEach(n=>{["id","source","target"].includes(n)||(T[n]=m[n])}),T})}W(ot,"extractPositionedEdges");async function st(x,X){j.debug("Starting cose-bilkent layout algorithm");try{at(x);const m=await it(x),I=nt(m),T=ot(m);return j.debug(`Layout completed: ${I.length} nodes, ${T.length} edges`),{nodes:I,edges:T}}catch(m){throw j.error("Error in cose-bilkent layout algorithm:",m),m}}W(st,"executeCoseBilkentLayout");function at(x){if(!x)throw new Error("Layout data is required");if(!x.config)throw new Error("Configuration is required in layout data");if(!x.rootNode)throw new Error("Root node is required");if(!x.nodes||!Array.isArray(x.nodes))throw new Error("No nodes found in layout data");if(!Array.isArray(x.edges))throw new Error("Edges array is required in layout data");return!0}W(at,"validateLayoutData");var At=W(async(x,X,{insertCluster:m,insertEdge:I,insertEdgeLabel:T,insertMarkers:n,insertNode:e,log:t,positionEdgeLabel:r},{algorithm:h})=>{const a={},o={},p=X.select("g");n(p,x.markers,x.type,x.diagramId);const i=p.insert("g").attr("class","subgraphs"),g=p.insert("g").attr("class","edgePaths"),l=p.insert("g").attr("class","edgeLabels"),f=p.insert("g").attr("class","nodes");t.debug("Inserting nodes into DOM for dimension calculation"),await Promise.all(x.nodes.map(async d=>{if(d.isGroup){const N={...d};o[d.id]=N,a[d.id]=N,await m(i,d)}else{const N={...d};a[d.id]=N;const v=await e(f,d,{config:x.config,dir:x.direction||"TB"}),L=v.node().getBBox();N.width=L.width,N.height=L.height,N.domId=v,t.debug(`Node ${d.id} dimensions: ${L.width}x${L.height}`)}})),t.debug("Running cose-bilkent layout algorithm");const E={...x,nodes:x.nodes.map(d=>{const N=a[d.id];return{...d,width:N.width,height:N.height}})},y=await st(E,x.config);t.debug("Positioning nodes based on layout results"),y.nodes.forEach(d=>{const N=a[d.id];N!=null&&N.domId&&(N.domId.attr("transform",`translate(${d.x}, ${d.y})`),N.x=d.x,N.y=d.y,t.debug(`Positioned node ${N.id} at center (${d.x}, ${d.y})`))}),y.edges.forEach(d=>{const N=x.edges.find(v=>v.id===d.id);N&&(N.points=[{x:d.startX,y:d.startY},{x:d.midX,y:d.midY},{x:d.endX,y:d.endY}])}),t.debug("Inserting and positioning edges"),await Promise.all(x.edges.map(async d=>{await T(l,d);const N=a[d.start??""],v=a[d.end??""];if(N&&v){const L=y.edges.find(s=>s.id===d.id);if(L){t.debug("APA01 positionedEdge",L);const s={...d},u=I(g,s,o,x.type,N,v,x.diagramId);r(s,u)}else{const s={...d,points:[{x:N.x||0,y:N.y||0},{x:v.x||0,y:v.y||0}]},u=I(g,s,o,x.type,N,v,x.diagramId);r(s,u)}}})),t.debug("Cose-bilkent rendering completed")},"render"),_t=At;export{_t as render};
@@ -1,4 +1,4 @@
1
- import{R as v,z as j,V as L,K as M,G as Y,O as t,c as F,a as K,W as V,m as q,g as z,q as H,Y as D,b as W,S as $,d as Q}from"./index-CIi9dO9d.js";import{L as k}from"./graph-ClfIprSM-Bo9NcOv2.js";import{o as U}from"./layout-DoRwGyA9-iPNfcIdd.js";import{S}from"./_baseUniq-DRc_T5HB-BD-eiKhZ.js";import{a as Z}from"./clone-DduvFCk3-BXgbo_Py.js";import{b as G}from"./_basePickBy-BjEly54R-DqvpNhss.js";function X(e){var n={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:_(e),edges:ee(e)};return S(e.graph())||(n.value=Z(e.graph())),n}function _(e){return G(e.nodes(),function(n){var r=e.node(n),s=e.parent(n),d={v:n};return S(r)||(d.value=r),S(s)||(d.parent=s),d})}function ee(e){return G(e.edges(),function(n){var r=e.edge(n),s={v:n.v,w:n.w};return S(n.name)||(s.name=n.name),S(r)||(s.value=r),s})}var u=new Map,E=new Map,J=new Map,ne=v(()=>{E.clear(),J.clear(),u.clear()},"clear"),I=v((e,n)=>{const r=E.get(n)||[];return t.trace("In isDescendant",n," ",e," = ",r.includes(e)),r.includes(e)},"isDescendant"),re=v((e,n)=>{const r=E.get(n)||[];return t.info("Descendants of ",n," is ",r),t.info("Edge is ",e),e.v===n||e.w===n?!1:r?r.includes(e.v)||I(e.v,n)||I(e.w,n)||r.includes(e.w):(t.debug("Tilt, ",n,",not in descendants"),!1)},"edgeInCluster"),P=v((e,n,r,s)=>{t.warn("Copying children of ",e,"root",s,"data",n.node(e),s);const d=n.children(e)||[];e!==s&&d.push(e),t.warn("Copying (nodes) clusterId",e,"nodes",d),d.forEach(c=>{if(n.children(c).length>0)P(c,n,r,s);else{const a=n.node(c);t.info("cp ",c," to ",s," with parent ",e),r.setNode(c,a),s!==n.parent(c)&&(t.warn("Setting parent",c,n.parent(c)),r.setParent(c,n.parent(c))),e!==s&&c!==e?(t.debug("Setting parent",c,e),r.setParent(c,e)):(t.info("In copy ",e,"root",s,"data",n.node(e),s),t.debug("Not Setting parent for node=",c,"cluster!==rootId",e!==s,"node!==clusterId",c!==e));const l=n.edges(c);t.debug("Copying Edges",l),l.forEach(f=>{t.info("Edge",f);const b=n.edge(f.v,f.w,f.name);t.info("Edge data",b,s);try{re(f,s)?(t.info("Copying as ",f.v,f.w,b,f.name),r.setEdge(f.v,f.w,b,f.name),t.info("newGraph edges ",r.edges(),r.edge(r.edges()[0]))):t.info("Skipping copy of edge ",f.v,"-->",f.w," rootId: ",s," clusterId:",e)}catch(C){t.error(C)}})}t.debug("Removing node",c),n.removeNode(c)})},"copy"),R=v((e,n)=>{const r=n.children(e);let s=[...r];for(const d of r)J.set(d,e),s=[...s,...R(d,n)];return s},"extractDescendants"),te=v((e,n,r)=>{const s=e.edges().filter(l=>l.v===n||l.w===n),d=e.edges().filter(l=>l.v===r||l.w===r),c=s.map(l=>({v:l.v===n?r:l.v,w:l.w===n?n:l.w})),a=d.map(l=>({v:l.v,w:l.w}));return c.filter(l=>a.some(f=>l.v===f.v&&l.w===f.w))},"findCommonEdges"),x=v((e,n,r)=>{const s=n.children(e);if(t.trace("Searching children of id ",e,s),s.length<1)return e;let d;for(const c of s){const a=x(c,n,r),l=te(n,r,a);if(a)if(l.length>0)d=a;else return a}return d},"findNonClusterChild"),O=v(e=>!u.has(e)||!u.get(e).externalConnections?e:u.has(e)?u.get(e).id:e,"getAnchorId"),ie=v((e,n)=>{if(!e||n>10){t.debug("Opting out, no graph ");return}else t.debug("Opting in, graph ");e.nodes().forEach(function(r){e.children(r).length>0&&(t.warn("Cluster identified",r," Replacement id in edges: ",x(r,e,r)),E.set(r,R(r,e)),u.set(r,{id:x(r,e,r),clusterData:e.node(r)}))}),e.nodes().forEach(function(r){const s=e.children(r),d=e.edges();s.length>0?(t.debug("Cluster identified",r,E),d.forEach(c=>{const a=I(c.v,r),l=I(c.w,r);a^l&&(t.warn("Edge: ",c," leaves cluster ",r),t.warn("Descendants of XXX ",r,": ",E.get(r)),u.get(r).externalConnections=!0)})):t.debug("Not a cluster ",r,E)});for(let r of u.keys()){const s=u.get(r).id,d=e.parent(s);d!==r&&u.has(d)&&!u.get(d).externalConnections&&(u.get(r).id=d)}e.edges().forEach(function(r){const s=e.edge(r);t.warn("Edge "+r.v+" -> "+r.w+": "+JSON.stringify(r)),t.warn("Edge "+r.v+" -> "+r.w+": "+JSON.stringify(e.edge(r)));let d=r.v,c=r.w;if(t.warn("Fix XXX",u,"ids:",r.v,r.w,"Translating: ",u.get(r.v)," --- ",u.get(r.w)),u.get(r.v)||u.get(r.w)){if(t.warn("Fixing and trying - removing XXX",r.v,r.w,r.name),d=O(r.v),c=O(r.w),e.removeEdge(r.v,r.w,r.name),d!==r.v){const a=e.parent(d);u.get(a).externalConnections=!0,s.fromCluster=r.v}if(c!==r.w){const a=e.parent(c);u.get(a).externalConnections=!0,s.toCluster=r.w}t.warn("Fix Replacing with XXX",d,c,r.name),e.setEdge(d,c,s,r.name)}}),t.warn("Adjusted Graph",X(e)),B(e,0),t.trace(u)},"adjustClustersAndEdges"),B=v((e,n)=>{var r,s;if(t.warn("extractor - ",n,X(e),e.children("D")),n>10){t.error("Bailing out");return}let d=e.nodes(),c=!1;for(const a of d){const l=e.children(a);c=c||l.length>0}if(!c){t.debug("Done, no node has children",e.nodes());return}t.debug("Nodes = ",d,n);for(const a of d)if(t.debug("Extracting node",a,u,u.has(a)&&!u.get(a).externalConnections,!e.parent(a),e.node(a),e.children("D")," Depth ",n),!u.has(a))t.debug("Not a cluster",a,n);else if(!u.get(a).externalConnections&&e.children(a)&&e.children(a).length>0){t.warn("Cluster without external connections, without a parent and with children",a,n);let l=e.graph().rankdir==="TB"?"LR":"TB";(s=(r=u.get(a))==null?void 0:r.clusterData)!=null&&s.dir&&(l=u.get(a).clusterData.dir,t.warn("Fixing dir",u.get(a).clusterData.dir,l));const f=new k({multigraph:!0,compound:!0}).setGraph({rankdir:l,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});t.warn("Old graph before copy",X(e)),P(a,e,f,a),e.setNode(a,{clusterNode:!0,id:a,clusterData:u.get(a).clusterData,label:u.get(a).label,graph:f}),t.warn("New graph after copy node: (",a,")",X(f)),t.debug("Old graph after copy",X(e))}else t.warn("Cluster ** ",a," **not meeting the criteria !externalConnections:",!u.get(a).externalConnections," no parent: ",!e.parent(a)," children ",e.children(a)&&e.children(a).length>0,e.children("D"),n),t.debug(u);d=e.nodes(),t.warn("New list of nodes",d);for(const a of d){const l=e.node(a);t.warn(" Now next level",a,l),l!=null&&l.clusterNode&&B(l.graph,n+1)}},"extractor"),T=v((e,n)=>{if(n.length===0)return[];let r=Object.assign([],n);return n.forEach(s=>{const d=e.children(s),c=T(e,d);r=[...r,...c]}),r},"sorter"),ae=v(e=>T(e,e.children()),"sortNodesByHierarchy"),A=v(async(e,n,r,s,d,c)=>{t.warn("Graph in recursive render:XAX",X(n),d);const a=n.graph().rankdir;t.trace("Dir in recursive render - dir:",a);const l=e.insert("g").attr("class","root");n.nodes()?t.info("Recursive render XXX",n.nodes()):t.info("No nodes found for",n),n.edges().length>0&&t.info("Recursive edges",n.edge(n.edges()[0]));const f=l.insert("g").attr("class","clusters"),b=l.insert("g").attr("class","edgePaths"),C=l.insert("g").attr("class","edgeLabels"),h=l.insert("g").attr("class","nodes");await Promise.all(n.nodes().map(async function(g){const o=n.node(g);if(d!==void 0){const i=JSON.parse(JSON.stringify(d.clusterData));t.trace(`Setting data for parent cluster XXX
1
+ import{R as v,z as j,V as L,K as M,G as Y,O as t,g as F,c as K,W as V,m as q,a as z,q as H,Y as D,b as W,S as $,d as Q}from"./index-CyVB0J6E.js";import{L as k}from"./graph-aRt77rZZ-BCYSvQYP.js";import{o as U}from"./layout-BKjRgLFe-BqG-N5rr.js";import{S}from"./_baseUniq-Cd4llU-Q-D06fzDcA.js";import{a as Z}from"./clone-DH1Kq5Y6-CC3PuMQg.js";import{b as G}from"./_basePickBy-1MakYQmz-CFyJwR0u.js";function X(e){var n={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:_(e),edges:ee(e)};return S(e.graph())||(n.value=Z(e.graph())),n}function _(e){return G(e.nodes(),function(n){var r=e.node(n),s=e.parent(n),d={v:n};return S(r)||(d.value=r),S(s)||(d.parent=s),d})}function ee(e){return G(e.edges(),function(n){var r=e.edge(n),s={v:n.v,w:n.w};return S(n.name)||(s.name=n.name),S(r)||(s.value=r),s})}var u=new Map,E=new Map,J=new Map,ne=v(()=>{E.clear(),J.clear(),u.clear()},"clear"),I=v((e,n)=>{const r=E.get(n)||[];return t.trace("In isDescendant",n," ",e," = ",r.includes(e)),r.includes(e)},"isDescendant"),re=v((e,n)=>{const r=E.get(n)||[];return t.info("Descendants of ",n," is ",r),t.info("Edge is ",e),e.v===n||e.w===n?!1:r?r.includes(e.v)||I(e.v,n)||I(e.w,n)||r.includes(e.w):(t.debug("Tilt, ",n,",not in descendants"),!1)},"edgeInCluster"),P=v((e,n,r,s)=>{t.warn("Copying children of ",e,"root",s,"data",n.node(e),s);const d=n.children(e)||[];e!==s&&d.push(e),t.warn("Copying (nodes) clusterId",e,"nodes",d),d.forEach(c=>{if(n.children(c).length>0)P(c,n,r,s);else{const a=n.node(c);t.info("cp ",c," to ",s," with parent ",e),r.setNode(c,a),s!==n.parent(c)&&(t.warn("Setting parent",c,n.parent(c)),r.setParent(c,n.parent(c))),e!==s&&c!==e?(t.debug("Setting parent",c,e),r.setParent(c,e)):(t.info("In copy ",e,"root",s,"data",n.node(e),s),t.debug("Not Setting parent for node=",c,"cluster!==rootId",e!==s,"node!==clusterId",c!==e));const l=n.edges(c);t.debug("Copying Edges",l),l.forEach(f=>{t.info("Edge",f);const b=n.edge(f.v,f.w,f.name);t.info("Edge data",b,s);try{re(f,s)?(t.info("Copying as ",f.v,f.w,b,f.name),r.setEdge(f.v,f.w,b,f.name),t.info("newGraph edges ",r.edges(),r.edge(r.edges()[0]))):t.info("Skipping copy of edge ",f.v,"-->",f.w," rootId: ",s," clusterId:",e)}catch(C){t.error(C)}})}t.debug("Removing node",c),n.removeNode(c)})},"copy"),R=v((e,n)=>{const r=n.children(e);let s=[...r];for(const d of r)J.set(d,e),s=[...s,...R(d,n)];return s},"extractDescendants"),te=v((e,n,r)=>{const s=e.edges().filter(l=>l.v===n||l.w===n),d=e.edges().filter(l=>l.v===r||l.w===r),c=s.map(l=>({v:l.v===n?r:l.v,w:l.w===n?n:l.w})),a=d.map(l=>({v:l.v,w:l.w}));return c.filter(l=>a.some(f=>l.v===f.v&&l.w===f.w))},"findCommonEdges"),x=v((e,n,r)=>{const s=n.children(e);if(t.trace("Searching children of id ",e,s),s.length<1)return e;let d;for(const c of s){const a=x(c,n,r),l=te(n,r,a);if(a)if(l.length>0)d=a;else return a}return d},"findNonClusterChild"),O=v(e=>!u.has(e)||!u.get(e).externalConnections?e:u.has(e)?u.get(e).id:e,"getAnchorId"),ie=v((e,n)=>{if(!e||n>10){t.debug("Opting out, no graph ");return}else t.debug("Opting in, graph ");e.nodes().forEach(function(r){e.children(r).length>0&&(t.warn("Cluster identified",r," Replacement id in edges: ",x(r,e,r)),E.set(r,R(r,e)),u.set(r,{id:x(r,e,r),clusterData:e.node(r)}))}),e.nodes().forEach(function(r){const s=e.children(r),d=e.edges();s.length>0?(t.debug("Cluster identified",r,E),d.forEach(c=>{const a=I(c.v,r),l=I(c.w,r);a^l&&(t.warn("Edge: ",c," leaves cluster ",r),t.warn("Descendants of XXX ",r,": ",E.get(r)),u.get(r).externalConnections=!0)})):t.debug("Not a cluster ",r,E)});for(let r of u.keys()){const s=u.get(r).id,d=e.parent(s);d!==r&&u.has(d)&&!u.get(d).externalConnections&&(u.get(r).id=d)}e.edges().forEach(function(r){const s=e.edge(r);t.warn("Edge "+r.v+" -> "+r.w+": "+JSON.stringify(r)),t.warn("Edge "+r.v+" -> "+r.w+": "+JSON.stringify(e.edge(r)));let d=r.v,c=r.w;if(t.warn("Fix XXX",u,"ids:",r.v,r.w,"Translating: ",u.get(r.v)," --- ",u.get(r.w)),u.get(r.v)||u.get(r.w)){if(t.warn("Fixing and trying - removing XXX",r.v,r.w,r.name),d=O(r.v),c=O(r.w),e.removeEdge(r.v,r.w,r.name),d!==r.v){const a=e.parent(d);u.get(a).externalConnections=!0,s.fromCluster=r.v}if(c!==r.w){const a=e.parent(c);u.get(a).externalConnections=!0,s.toCluster=r.w}t.warn("Fix Replacing with XXX",d,c,r.name),e.setEdge(d,c,s,r.name)}}),t.warn("Adjusted Graph",X(e)),B(e,0),t.trace(u)},"adjustClustersAndEdges"),B=v((e,n)=>{var r,s;if(t.warn("extractor - ",n,X(e),e.children("D")),n>10){t.error("Bailing out");return}let d=e.nodes(),c=!1;for(const a of d){const l=e.children(a);c=c||l.length>0}if(!c){t.debug("Done, no node has children",e.nodes());return}t.debug("Nodes = ",d,n);for(const a of d)if(t.debug("Extracting node",a,u,u.has(a)&&!u.get(a).externalConnections,!e.parent(a),e.node(a),e.children("D")," Depth ",n),!u.has(a))t.debug("Not a cluster",a,n);else if(!u.get(a).externalConnections&&e.children(a)&&e.children(a).length>0){t.warn("Cluster without external connections, without a parent and with children",a,n);let l=e.graph().rankdir==="TB"?"LR":"TB";(s=(r=u.get(a))==null?void 0:r.clusterData)!=null&&s.dir&&(l=u.get(a).clusterData.dir,t.warn("Fixing dir",u.get(a).clusterData.dir,l));const f=new k({multigraph:!0,compound:!0}).setGraph({rankdir:l,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});t.warn("Old graph before copy",X(e)),P(a,e,f,a),e.setNode(a,{clusterNode:!0,id:a,clusterData:u.get(a).clusterData,label:u.get(a).label,graph:f}),t.warn("New graph after copy node: (",a,")",X(f)),t.debug("Old graph after copy",X(e))}else t.warn("Cluster ** ",a," **not meeting the criteria !externalConnections:",!u.get(a).externalConnections," no parent: ",!e.parent(a)," children ",e.children(a)&&e.children(a).length>0,e.children("D"),n),t.debug(u);d=e.nodes(),t.warn("New list of nodes",d);for(const a of d){const l=e.node(a);t.warn(" Now next level",a,l),l!=null&&l.clusterNode&&B(l.graph,n+1)}},"extractor"),T=v((e,n)=>{if(n.length===0)return[];let r=Object.assign([],n);return n.forEach(s=>{const d=e.children(s),c=T(e,d);r=[...r,...c]}),r},"sorter"),ae=v(e=>T(e,e.children()),"sortNodesByHierarchy"),A=v(async(e,n,r,s,d,c)=>{t.warn("Graph in recursive render:XAX",X(n),d);const a=n.graph().rankdir;t.trace("Dir in recursive render - dir:",a);const l=e.insert("g").attr("class","root");n.nodes()?t.info("Recursive render XXX",n.nodes()):t.info("No nodes found for",n),n.edges().length>0&&t.info("Recursive edges",n.edge(n.edges()[0]));const f=l.insert("g").attr("class","clusters"),b=l.insert("g").attr("class","edgePaths"),C=l.insert("g").attr("class","edgeLabels"),h=l.insert("g").attr("class","nodes");await Promise.all(n.nodes().map(async function(g){const o=n.node(g);if(d!==void 0){const i=JSON.parse(JSON.stringify(d.clusterData));t.trace(`Setting data for parent cluster XXX
2
2
  Node.id = `,g,`
3
3
  data=`,i.height,`
4
4
  Parent cluster`,d.height),n.setNode(d.id,i),n.parent(g)||(t.trace("Setting parent",g,d.id),n.setParent(g,d.id,i))}if(t.info("(Insert) Node XXX"+g+": "+JSON.stringify(n.node(g))),o!=null&&o.clusterNode){t.info("Cluster identified XBX",g,o.width,n.node(g));const{ranksep:i,nodesep:w}=n.graph();o.graph.setGraph({...o.graph.graph(),ranksep:i+25,nodesep:w});const m=await A(h,o.graph,r,s,n.node(g),c),N=m.elem;K(o,N),o.diff=m.diff||0,t.info("New compound node after recursive render XAX",g,"width",o.width,"height",o.height),V(N,o)}else n.children(g).length>0?(t.trace("Cluster - the non recursive path XBX",g,o.id,o,o.width,"Graph:",n),t.trace(x(o.id,n)),u.set(o.id,{id:x(o.id,n),node:o})):(t.trace("Node - the non recursive path XAX",g,h,n.node(g),a),await q(h,n.node(g),{config:c,dir:a}))})),await v(async()=>{const g=n.edges().map(async function(o){const i=n.edge(o.v,o.w,o.name);t.info("Edge "+o.v+" -> "+o.w+": "+JSON.stringify(o)),t.info("Edge "+o.v+" -> "+o.w+": ",o," ",JSON.stringify(n.edge(o))),t.info("Fix",u,"ids:",o.v,o.w,"Translating: ",u.get(o.v),u.get(o.w)),await z(C,i)});await Promise.all(g)},"processEdges")(),t.info("Graph before layout:",JSON.stringify(X(n))),t.info("############################################# XXX"),t.info("### Layout ### XXX"),t.info("############################################# XXX"),U(n),t.info("Graph after layout:",JSON.stringify(X(n)));let p=0,{subGraphTitleTotalMargin:y}=H(c);return await Promise.all(ae(n).map(async function(g){var o;const i=n.node(g);if(t.info("Position XBX => "+g+": ("+i.x,","+i.y,") width: ",i.width," height: ",i.height),i!=null&&i.clusterNode)i.y+=y,t.info("A tainted cluster node XBX1",g,i.id,i.width,i.height,i.x,i.y,n.parent(g)),u.get(i.id).node=i,D(i);else if(n.children(g).length>0){t.info("A pure cluster node XBX1",g,i.id,i.x,i.y,i.width,i.height,n.parent(g)),i.height+=y,n.node(i.parentId);const w=(i==null?void 0:i.padding)/2||0,m=((o=i==null?void 0:i.labelBBox)==null?void 0:o.height)||0,N=m-w||0;t.debug("OffsetY",N,"labelHeight",m,"halfPadding",w),await W(f,i),u.get(i.id).node=i}else{const w=n.node(i.parentId);i.y+=y/2,t.info("A regular node XBX1 - using the padding",i.id,"parent",i.parentId,i.width,i.height,i.x,i.y,"offsetY",i.offsetY,"parent",w,w==null?void 0:w.offsetY,i),D(i)}})),n.edges().forEach(function(g){const o=n.edge(g);t.info("Edge "+g.v+" -> "+g.w+": "+JSON.stringify(o),o),o.points.forEach(N=>N.y+=y/2);const i=n.node(g.v);var w=n.node(g.w);const m=$(b,o,u,r,i,w,s);Q(o,m)}),n.nodes().forEach(function(g){const o=n.node(g);t.info(g,o.type,o.diff),o.isGroup&&(p=o.diff)}),t.warn("Returning from recursive render XAX",l,p),{elem:l,diff:p}},"recursiveRender"),ue=v(async(e,n)=>{var r,s,d,c,a,l;const f=new k({multigraph:!0,compound:!0}).setGraph({rankdir:e.direction,nodesep:((r=e.config)==null?void 0:r.nodeSpacing)||((d=(s=e.config)==null?void 0:s.flowchart)==null?void 0:d.nodeSpacing)||e.nodeSpacing,ranksep:((c=e.config)==null?void 0:c.rankSpacing)||((l=(a=e.config)==null?void 0:a.flowchart)==null?void 0:l.rankSpacing)||e.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}}),b=n.select("g");j(b,e.markers,e.type,e.diagramId),L(),M(),Y(),ne(),e.nodes.forEach(h=>{f.setNode(h.id,{...h}),h.parentId&&f.setParent(h.id,h.parentId)}),t.debug("Edges:",e.edges),e.edges.forEach(h=>{if(h.start===h.end){const p=h.start,y=p+"---"+p+"---1",g=p+"---"+p+"---2",o=f.node(p);f.setNode(y,{domId:y,id:y,parentId:o.parentId,labelStyle:"",label:"",padding:0,shape:"labelRect",style:"",width:10,height:10}),f.setParent(y,o.parentId),f.setNode(g,{domId:g,id:g,parentId:o.parentId,labelStyle:"",padding:0,shape:"labelRect",label:"",style:"",width:10,height:10}),f.setParent(g,o.parentId);const i=structuredClone(h),w=structuredClone(h),m=structuredClone(h);i.label="",i.arrowTypeEnd="none",i.id=p+"-cyclic-special-1",w.arrowTypeStart="none",w.arrowTypeEnd="none",w.id=p+"-cyclic-special-mid",m.label="",o.isGroup&&(i.fromCluster=p,m.toCluster=p),m.id=p+"-cyclic-special-2",m.arrowTypeStart="none",f.setEdge(p,y,i,p+"-cyclic-special-0"),f.setEdge(y,g,w,p+"-cyclic-special-1"),f.setEdge(g,p,m,p+"-cyc<lic-special-2")}else f.setEdge(h.start,h.end,{...h},h.id)}),t.warn("Graph at first:",JSON.stringify(X(f))),ie(f),t.warn("Graph after XAX:",JSON.stringify(X(f)));const C=F();await A(b,f,e.type,e.diagramId,void 0,C)},"render");export{ue as render};
@@ -1,4 +1,4 @@
1
- import{R as C,J as ee,L as te,am as ie,B as ce,bo as E,O as X,ap as Q,bp as P,e as _,s as de,l as he,n as pe,o as ue,u as fe,f as me,M as ye,bq as ge,t as xe}from"./index-CIi9dO9d.js";import{d as Se}from"./chunk-QN33PNHL-C8-RyAc3-DADdydNm.js";import{m as ve}from"./chunk-4BX2VUAB-DeMNg1Xd-CrtFwSE5.js";import{N as be}from"./treemap-KMMF4GRG-Dfxm7cSf-B7pg2atG.js";import"./_baseUniq-DRc_T5HB-BD-eiKhZ.js";import"./_basePickBy-BjEly54R-DqvpNhss.js";import"./clone-DduvFCk3-BXgbo_Py.js";function Ce(t){var a=0,n=t.children,r=n&&n.length;if(!r)a=1;else for(;--r>=0;)a+=n[r].value;t.value=a}function $e(){return this.eachAfter(Ce)}function we(t,a){let n=-1;for(const r of this)t.call(a,r,++n,this);return this}function Le(t,a){for(var n=this,r=[n],o,s,d=-1;n=r.pop();)if(t.call(a,n,++d,this),o=n.children)for(s=o.length-1;s>=0;--s)r.push(o[s]);return this}function ke(t,a){for(var n=this,r=[n],o=[],s,d,h,f=-1;n=r.pop();)if(o.push(n),s=n.children)for(d=0,h=s.length;d<h;++d)r.push(s[d]);for(;n=o.pop();)t.call(a,n,++f,this);return this}function Me(t,a){let n=-1;for(const r of this)if(t.call(a,r,++n,this))return r}function Te(t){return this.eachAfter(function(a){for(var n=+t(a.data)||0,r=a.children,o=r&&r.length;--o>=0;)n+=r[o].value;a.value=n})}function ze(t){return this.eachBefore(function(a){a.children&&a.children.sort(t)})}function Fe(t){for(var a=this,n=Ae(a,t),r=[a];a!==n;)a=a.parent,r.push(a);for(var o=r.length;t!==n;)r.splice(o,0,t),t=t.parent;return r}function Ae(t,a){if(t===a)return t;var n=t.ancestors(),r=a.ancestors(),o=null;for(t=n.pop(),a=r.pop();t===a;)o=t,t=n.pop(),a=r.pop();return o}function Be(){for(var t=this,a=[t];t=t.parent;)a.push(t);return a}function Pe(){return Array.from(this)}function Ne(){var t=[];return this.eachBefore(function(a){a.children||t.push(a)}),t}function We(){var t=this,a=[];return t.each(function(n){n!==t&&a.push({source:n.parent,target:n})}),a}function*De(){var t=this,a,n=[t],r,o,s;do for(a=n.reverse(),n=[];t=a.pop();)if(yield t,r=t.children)for(o=0,s=r.length;o<s;++o)n.push(r[o]);while(n.length)}function Z(t,a){t instanceof Map?(t=[void 0,t],a===void 0&&(a=Ee)):a===void 0&&(a=Re);for(var n=new K(t),r,o=[n],s,d,h,f;r=o.pop();)if((d=a(r.data))&&(f=(d=Array.from(d)).length))for(r.children=d,h=f-1;h>=0;--h)o.push(s=d[h]=new K(d[h])),s.parent=r,s.depth=r.depth+1;return n.eachBefore(Ve)}function Ie(){return Z(this).eachBefore(He)}function Re(t){return t.children}function Ee(t){return Array.isArray(t)?t[1]:null}function He(t){t.data.value!==void 0&&(t.value=t.data.value),t.data=t.data.data}function Ve(t){var a=0;do t.height=a;while((t=t.parent)&&t.height<++a)}function K(t){this.data=t,this.depth=this.height=0,this.parent=null}K.prototype=Z.prototype={constructor:K,count:$e,each:we,eachAfter:ke,eachBefore:Le,find:Me,sum:Te,sort:ze,path:Fe,ancestors:Be,descendants:Pe,leaves:Ne,links:We,copy:Ie,[Symbol.iterator]:De};function qe(t){if(typeof t!="function")throw new Error;return t}function H(){return 0}function V(t){return function(){return t}}function Oe(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}function je(t,a,n,r,o){for(var s=t.children,d,h=-1,f=s.length,i=t.value&&(r-a)/t.value;++h<f;)d=s[h],d.y0=n,d.y1=o,d.x0=a,d.x1=a+=d.value*i}function Ge(t,a,n,r,o){for(var s=t.children,d,h=-1,f=s.length,i=t.value&&(o-n)/t.value;++h<f;)d=s[h],d.x0=a,d.x1=r,d.y0=n,d.y1=n+=d.value*i}var Je=(1+Math.sqrt(5))/2;function _e(t,a,n,r,o,s){for(var d=[],h=a.children,f,i,p=0,b=0,l=h.length,v,x,S=a.value,u,y,A,M,B,W,L;p<l;){v=o-n,x=s-r;do u=h[b++].value;while(!u&&b<l);for(y=A=u,W=Math.max(x/v,v/x)/(S*t),L=u*u*W,B=Math.max(A/L,L/y);b<l;++b){if(u+=i=h[b].value,i<y&&(y=i),i>A&&(A=i),L=u*u*W,M=Math.max(A/L,L/y),M>B){u-=i;break}B=M}d.push(f={value:u,dice:v<x,children:h.slice(p,b)}),f.dice?je(f,n,r,o,S?r+=x*u/S:s):Ge(f,n,r,S?n+=v*u/S:o,s),S-=u,p=b}return d}const Ke=function t(a){function n(r,o,s,d,h){_e(a,r,o,s,d,h)}return n.ratio=function(r){return t((r=+r)>1?r:1)},n}(Je);function Qe(){var t=Ke,a=!1,n=1,r=1,o=[0],s=H,d=H,h=H,f=H,i=H;function p(l){return l.x0=l.y0=0,l.x1=n,l.y1=r,l.eachBefore(b),o=[0],a&&l.eachBefore(Oe),l}function b(l){var v=o[l.depth],x=l.x0+v,S=l.y0+v,u=l.x1-v,y=l.y1-v;u<x&&(x=u=(x+u)/2),y<S&&(S=y=(S+y)/2),l.x0=x,l.y0=S,l.x1=u,l.y1=y,l.children&&(v=o[l.depth+1]=s(l)/2,x+=i(l)-v,S+=d(l)-v,u-=h(l)-v,y-=f(l)-v,u<x&&(x=u=(x+u)/2),y<S&&(S=y=(S+y)/2),t(l,x,S,u,y))}return p.round=function(l){return arguments.length?(a=!!l,p):a},p.size=function(l){return arguments.length?(n=+l[0],r=+l[1],p):[n,r]},p.tile=function(l){return arguments.length?(t=qe(l),p):t},p.padding=function(l){return arguments.length?p.paddingInner(l).paddingOuter(l):p.paddingInner()},p.paddingInner=function(l){return arguments.length?(s=typeof l=="function"?l:V(+l),p):s},p.paddingOuter=function(l){return arguments.length?p.paddingTop(l).paddingRight(l).paddingBottom(l).paddingLeft(l):p.paddingTop()},p.paddingTop=function(l){return arguments.length?(d=typeof l=="function"?l:V(+l),p):d},p.paddingRight=function(l){return arguments.length?(h=typeof l=="function"?l:V(+l),p):h},p.paddingBottom=function(l){return arguments.length?(f=typeof l=="function"?l:V(+l),p):f},p.paddingLeft=function(l){return arguments.length?(i=typeof l=="function"?l:V(+l),p):i},p}var U,ae=(U=class{constructor(){this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.setAccTitle=de,this.getAccTitle=he,this.setDiagramTitle=pe,this.getDiagramTitle=ue,this.getAccDescription=fe,this.setAccDescription=me}getNodes(){return this.nodes}getConfig(){const t=ye,a=te();return ee({...t.treemap,...a.treemap??{}})}addNode(t,a){this.nodes.push(t),this.levels.set(t,a),a===0&&(this.outerNodes.push(t),this.root??(this.root=t))}getRoot(){return{name:"",children:this.outerNodes}}addClass(t,a){const n=this.classes.get(t)??{id:t,styles:[],textStyles:[]},r=a.replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");r&&r.forEach(o=>{ge(o)&&(n!=null&&n.textStyles?n.textStyles.push(o):n.textStyles=[o]),n!=null&&n.styles?n.styles.push(o):n.styles=[o]}),this.classes.set(t,n)}getClasses(){return this.classes}getStylesForClass(t){var a;return((a=this.classes.get(t))==null?void 0:a.styles)??[]}clear(){xe(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}},C(U,"TreeMapDB"),U);function ne(t){if(!t.length)return[];const a=[],n=[];return t.forEach(r=>{const o={name:r.name,children:r.type==="Leaf"?void 0:[]};for(o.classSelector=r==null?void 0:r.classSelector,r!=null&&r.cssCompiledStyles&&(o.cssCompiledStyles=[r.cssCompiledStyles]),r.type==="Leaf"&&r.value!==void 0&&(o.value=r.value);n.length>0&&n[n.length-1].level>=r.level;)n.pop();if(n.length===0)a.push(o);else{const s=n[n.length-1].node;s.children?s.children.push(o):s.children=[o]}r.type!=="Leaf"&&n.push({node:o,level:r.level})}),a}C(ne,"buildHierarchy");var Ue=C((t,a)=>{ve(t,a);const n=[];for(const s of t.TreemapRows??[])s.$type==="ClassDefStatement"&&a.addClass(s.className??"",s.styleText??"");for(const s of t.TreemapRows??[]){const d=s.item;if(!d)continue;const h=s.indent?parseInt(s.indent):0,f=Xe(d),i=d.classSelector?a.getStylesForClass(d.classSelector):[],p=i.length>0?i.join(";"):void 0,b={level:h,name:f,type:d.$type,value:d.value,classSelector:d.classSelector,cssCompiledStyles:p};n.push(b)}const r=ne(n),o=C((s,d)=>{for(const h of s)a.addNode(h,d),h.children&&h.children.length>0&&o(h.children,d+1)},"addNodesRecursively");o(r,0)},"populate"),Xe=C(t=>t.name?String(t.name):"","getItemName"),re={parser:{yy:void 0},parse:C(async t=>{var a;try{const n=await be("treemap",t);X.debug("Treemap AST:",n);const r=(a=re.parser)==null?void 0:a.yy;if(!(r instanceof ae))throw new Error("parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");Ue(n,r)}catch(n){throw X.error("Error parsing treemap:",n),n}},"parse")},Ze=10,N=10,q=25,Ye=C((t,a,n,r)=>{const o=r.db,s=o.getConfig(),d=s.padding??Ze,h=o.getDiagramTitle(),f=o.getRoot(),{themeVariables:i}=te();if(!f)return;const p=h?30:0,b=ie(a),l=s.nodeWidth?s.nodeWidth*N:960,v=s.nodeHeight?s.nodeHeight*N:500,x=l,S=v+p;b.attr("viewBox",`0 0 ${x} ${S}`),ce(b,S,x,s.useMaxWidth);let u;try{const e=s.valueFormat||",";if(e==="$0,0")u=C(c=>"$"+E(",")(c),"valueFormat");else if(e.startsWith("$")&&e.includes(",")){const c=/\.\d+/.exec(e),g=c?c[0]:"";u=C($=>"$"+E(","+g)($),"valueFormat")}else if(e.startsWith("$")){const c=e.substring(1);u=C(g=>"$"+E(c||"")(g),"valueFormat")}else u=E(e)}catch(e){X.error("Error creating format function:",e),u=E(",")}const y=Q().range(["transparent",i.cScale0,i.cScale1,i.cScale2,i.cScale3,i.cScale4,i.cScale5,i.cScale6,i.cScale7,i.cScale8,i.cScale9,i.cScale10,i.cScale11]),A=Q().range(["transparent",i.cScalePeer0,i.cScalePeer1,i.cScalePeer2,i.cScalePeer3,i.cScalePeer4,i.cScalePeer5,i.cScalePeer6,i.cScalePeer7,i.cScalePeer8,i.cScalePeer9,i.cScalePeer10,i.cScalePeer11]),M=Q().range([i.cScaleLabel0,i.cScaleLabel1,i.cScaleLabel2,i.cScaleLabel3,i.cScaleLabel4,i.cScaleLabel5,i.cScaleLabel6,i.cScaleLabel7,i.cScaleLabel8,i.cScaleLabel9,i.cScaleLabel10,i.cScaleLabel11]);h&&b.append("text").attr("x",x/2).attr("y",p/2).attr("class","treemapTitle").attr("text-anchor","middle").attr("dominant-baseline","middle").text(h);const B=b.append("g").attr("transform",`translate(0, ${p})`).attr("class","treemapContainer"),W=Z(f).sum(e=>e.value??0).sort((e,c)=>(c.value??0)-(e.value??0)),L=Qe().size([l,v]).paddingTop(e=>e.children&&e.children.length>0?q+N:0).paddingInner(d).paddingLeft(e=>e.children&&e.children.length>0?N:0).paddingRight(e=>e.children&&e.children.length>0?N:0).paddingBottom(e=>e.children&&e.children.length>0?N:0).round(!0)(W),le=L.descendants().filter(e=>e.children&&e.children.length>0),D=B.selectAll(".treemapSection").data(le).enter().append("g").attr("class","treemapSection").attr("transform",e=>`translate(${e.x0},${e.y0})`);D.append("rect").attr("width",e=>e.x1-e.x0).attr("height",q).attr("class","treemapSectionHeader").attr("fill","none").attr("fill-opacity",.6).attr("stroke-width",.6).attr("style",e=>e.depth===0?"display: none;":""),D.append("clipPath").attr("id",(e,c)=>`clip-section-${a}-${c}`).append("rect").attr("width",e=>Math.max(0,e.x1-e.x0-12)).attr("height",q),D.append("rect").attr("width",e=>e.x1-e.x0).attr("height",e=>e.y1-e.y0).attr("class",(e,c)=>`treemapSection section${c}`).attr("fill",e=>y(e.data.name)).attr("fill-opacity",.6).attr("stroke",e=>A(e.data.name)).attr("stroke-width",2).attr("stroke-opacity",.4).attr("style",e=>{if(e.depth===0)return"display: none;";const c=P({cssCompiledStyles:e.data.cssCompiledStyles});return c.nodeStyles+";"+c.borderStyles.join(";")}),D.append("text").attr("class","treemapSectionLabel").attr("x",6).attr("y",q/2).attr("dominant-baseline","middle").text(e=>e.depth===0?"":e.data.name).attr("font-weight","bold").attr("style",e=>{if(e.depth===0)return"display: none;";const c="dominant-baseline: middle; font-size: 12px; fill:"+M(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",g=P({cssCompiledStyles:e.data.cssCompiledStyles});return c+g.labelStyles.replace("color:","fill:")}).each(function(e){if(e.depth===0)return;const c=_(this),g=e.data.name;c.text(g);const $=e.x1-e.x0,T=6;let z;s.showValues!==!1&&e.value?z=$-10-30-10-T:z=$-T-6;const k=Math.max(15,z),w=c.node();if(w.getComputedTextLength()>k){let m=g;for(;m.length>0;){if(m=g.substring(0,m.length-1),m.length===0){c.text("..."),w.getComputedTextLength()>k&&c.text("");break}if(c.text(m+"..."),w.getComputedTextLength()<=k)break}}}),s.showValues!==!1&&D.append("text").attr("class","treemapSectionValue").attr("x",e=>e.x1-e.x0-10).attr("y",q/2).attr("text-anchor","end").attr("dominant-baseline","middle").text(e=>e.value?u(e.value):"").attr("font-style","italic").attr("style",e=>{if(e.depth===0)return"display: none;";const c="text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:"+M(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",g=P({cssCompiledStyles:e.data.cssCompiledStyles});return c+g.labelStyles.replace("color:","fill:")});const se=L.leaves(),O=B.selectAll(".treemapLeafGroup").data(se).enter().append("g").attr("class",(e,c)=>`treemapNode treemapLeafGroup leaf${c}${e.data.classSelector?` ${e.data.classSelector}`:""}x`).attr("transform",e=>`translate(${e.x0},${e.y0})`);O.append("rect").attr("width",e=>e.x1-e.x0).attr("height",e=>e.y1-e.y0).attr("class","treemapLeaf").attr("fill",e=>e.parent?y(e.parent.data.name):y(e.data.name)).attr("style",e=>P({cssCompiledStyles:e.data.cssCompiledStyles}).nodeStyles).attr("fill-opacity",.3).attr("stroke",e=>e.parent?y(e.parent.data.name):y(e.data.name)).attr("stroke-width",3),O.append("clipPath").attr("id",(e,c)=>`clip-${a}-${c}`).append("rect").attr("width",e=>Math.max(0,e.x1-e.x0-4)).attr("height",e=>Math.max(0,e.y1-e.y0-4)),O.append("text").attr("class","treemapLabel").attr("x",e=>(e.x1-e.x0)/2).attr("y",e=>(e.y1-e.y0)/2).attr("style",e=>{const c="text-anchor: middle; dominant-baseline: middle; font-size: 38px;fill:"+M(e.data.name)+";",g=P({cssCompiledStyles:e.data.cssCompiledStyles});return c+g.labelStyles.replace("color:","fill:")}).attr("clip-path",(e,c)=>`url(#clip-${a}-${c})`).text(e=>e.data.name).each(function(e){const c=_(this),g=e.x1-e.x0,$=e.y1-e.y0,T=c.node(),z=4,k=g-2*z,w=$-2*z;if(k<10||w<10){c.style("display","none");return}let m=parseInt(c.style("font-size"),10);const F=8,I=28,j=.6,R=6,G=2;for(;T.getComputedTextLength()>k&&m>F;)m--,c.style("font-size",`${m}px`);let J=Math.max(R,Math.min(I,Math.round(m*j))),Y=m+G+J;for(;Y>w&&m>F&&(m--,J=Math.max(R,Math.min(I,Math.round(m*j))),!(J<R&&m===F));)c.style("font-size",`${m}px`),Y=m+G+J;c.style("font-size",`${m}px`),(T.getComputedTextLength()>k||m<F||w<m)&&c.style("display","none")}),s.showValues!==!1&&O.append("text").attr("class","treemapValue").attr("x",e=>(e.x1-e.x0)/2).attr("y",function(e){return(e.y1-e.y0)/2}).attr("style",e=>{const c="text-anchor: middle; dominant-baseline: hanging; font-size: 28px;fill:"+M(e.data.name)+";",g=P({cssCompiledStyles:e.data.cssCompiledStyles});return c+g.labelStyles.replace("color:","fill:")}).attr("clip-path",(e,c)=>`url(#clip-${a}-${c})`).text(e=>e.value?u(e.value):"").each(function(e){const c=_(this),g=this.parentNode;if(!g){c.style("display","none");return}const $=_(g).select(".treemapLabel");if($.empty()||$.style("display")==="none"){c.style("display","none");return}const T=parseFloat($.style("font-size")),z=28,k=.6,w=6,m=2,F=Math.max(w,Math.min(z,Math.round(T*k)));c.style("font-size",`${F}px`);const I=(e.y1-e.y0)/2+T/2+m;c.attr("y",I);const j=e.x1-e.x0,R=e.y1-e.y0-4,G=j-8;c.node().getComputedTextLength()>G||I+F>R||F<w?c.style("display","none"):c.style("display",null)});const oe=s.diagramPadding??8;Se(b,oe,"flowchart",(s==null?void 0:s.useMaxWidth)||!1)},"draw"),et=C(function(t,a){return a.db.getClasses()},"getClasses"),tt={draw:Ye,getClasses:et},at={sectionStrokeColor:"black",sectionStrokeWidth:"1",sectionFillColor:"#efefef",leafStrokeColor:"black",leafStrokeWidth:"1",leafFillColor:"#efefef",labelColor:"black",labelFontSize:"12px",valueFontSize:"10px",valueColor:"black",titleColor:"black",titleFontSize:"14px"},nt=C(({treemap:t}={})=>{const a=ee(at,t);return`
1
+ import{R as C,H as ee,J as te,am as ie,B as ce,bo as R,O as Z,ap as U,bp as P,e as _,s as de,l as he,o as pe,r as ue,u as fe,f as me,L as ye,bq as ge,w as xe}from"./index-CyVB0J6E.js";import{d as Se}from"./chunk-QN33PNHL-DrWWTLTH-CxKsUSHw.js";import{m as ve}from"./chunk-4BX2VUAB-BeuiUsbc-SyLBSPGf.js";import{N as be}from"./treemap-KMMF4GRG-C4GHjB3F-HVe9FL0t.js";import"./_baseUniq-Cd4llU-Q-D06fzDcA.js";import"./_basePickBy-1MakYQmz-CFyJwR0u.js";import"./clone-DH1Kq5Y6-CC3PuMQg.js";function Ce(t){var a=0,n=t.children,r=n&&n.length;if(!r)a=1;else for(;--r>=0;)a+=n[r].value;t.value=a}function $e(){return this.eachAfter(Ce)}function we(t,a){let n=-1;for(const r of this)t.call(a,r,++n,this);return this}function Le(t,a){for(var n=this,r=[n],o,s,d=-1;n=r.pop();)if(t.call(a,n,++d,this),o=n.children)for(s=o.length-1;s>=0;--s)r.push(o[s]);return this}function ke(t,a){for(var n=this,r=[n],o=[],s,d,h,f=-1;n=r.pop();)if(o.push(n),s=n.children)for(d=0,h=s.length;d<h;++d)r.push(s[d]);for(;n=o.pop();)t.call(a,n,++f,this);return this}function Te(t,a){let n=-1;for(const r of this)if(t.call(a,r,++n,this))return r}function Me(t){return this.eachAfter(function(a){for(var n=+t(a.data)||0,r=a.children,o=r&&r.length;--o>=0;)n+=r[o].value;a.value=n})}function ze(t){return this.eachBefore(function(a){a.children&&a.children.sort(t)})}function Fe(t){for(var a=this,n=Ae(a,t),r=[a];a!==n;)a=a.parent,r.push(a);for(var o=r.length;t!==n;)r.splice(o,0,t),t=t.parent;return r}function Ae(t,a){if(t===a)return t;var n=t.ancestors(),r=a.ancestors(),o=null;for(t=n.pop(),a=r.pop();t===a;)o=t,t=n.pop(),a=r.pop();return o}function Be(){for(var t=this,a=[t];t=t.parent;)a.push(t);return a}function Pe(){return Array.from(this)}function Ne(){var t=[];return this.eachBefore(function(a){a.children||t.push(a)}),t}function We(){var t=this,a=[];return t.each(function(n){n!==t&&a.push({source:n.parent,target:n})}),a}function*De(){var t=this,a,n=[t],r,o,s;do for(a=n.reverse(),n=[];t=a.pop();)if(yield t,r=t.children)for(o=0,s=r.length;o<s;++o)n.push(r[o]);while(n.length)}function K(t,a){t instanceof Map?(t=[void 0,t],a===void 0&&(a=Re)):a===void 0&&(a=Ie);for(var n=new Q(t),r,o=[n],s,d,h,f;r=o.pop();)if((d=a(r.data))&&(f=(d=Array.from(d)).length))for(r.children=d,h=f-1;h>=0;--h)o.push(s=d[h]=new Q(d[h])),s.parent=r,s.depth=r.depth+1;return n.eachBefore(Ve)}function He(){return K(this).eachBefore(Ee)}function Ie(t){return t.children}function Re(t){return Array.isArray(t)?t[1]:null}function Ee(t){t.data.value!==void 0&&(t.value=t.data.value),t.data=t.data.data}function Ve(t){var a=0;do t.height=a;while((t=t.parent)&&t.height<++a)}function Q(t){this.data=t,this.depth=this.height=0,this.parent=null}Q.prototype=K.prototype={constructor:Q,count:$e,each:we,eachAfter:ke,eachBefore:Le,find:Te,sum:Me,sort:ze,path:Fe,ancestors:Be,descendants:Pe,leaves:Ne,links:We,copy:He,[Symbol.iterator]:De};function qe(t){if(typeof t!="function")throw new Error;return t}function E(){return 0}function V(t){return function(){return t}}function Oe(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}function je(t,a,n,r,o){for(var s=t.children,d,h=-1,f=s.length,i=t.value&&(r-a)/t.value;++h<f;)d=s[h],d.y0=n,d.y1=o,d.x0=a,d.x1=a+=d.value*i}function Ge(t,a,n,r,o){for(var s=t.children,d,h=-1,f=s.length,i=t.value&&(o-n)/t.value;++h<f;)d=s[h],d.x0=a,d.x1=r,d.y0=n,d.y1=n+=d.value*i}var Je=(1+Math.sqrt(5))/2;function _e(t,a,n,r,o,s){for(var d=[],h=a.children,f,i,p=0,b=0,l=h.length,v,x,S=a.value,u,y,A,T,B,W,L;p<l;){v=o-n,x=s-r;do u=h[b++].value;while(!u&&b<l);for(y=A=u,W=Math.max(x/v,v/x)/(S*t),L=u*u*W,B=Math.max(A/L,L/y);b<l;++b){if(u+=i=h[b].value,i<y&&(y=i),i>A&&(A=i),L=u*u*W,T=Math.max(A/L,L/y),T>B){u-=i;break}B=T}d.push(f={value:u,dice:v<x,children:h.slice(p,b)}),f.dice?je(f,n,r,o,S?r+=x*u/S:s):Ge(f,n,r,S?n+=v*u/S:o,s),S-=u,p=b}return d}const Qe=function t(a){function n(r,o,s,d,h){_e(a,r,o,s,d,h)}return n.ratio=function(r){return t((r=+r)>1?r:1)},n}(Je);function Ue(){var t=Qe,a=!1,n=1,r=1,o=[0],s=E,d=E,h=E,f=E,i=E;function p(l){return l.x0=l.y0=0,l.x1=n,l.y1=r,l.eachBefore(b),o=[0],a&&l.eachBefore(Oe),l}function b(l){var v=o[l.depth],x=l.x0+v,S=l.y0+v,u=l.x1-v,y=l.y1-v;u<x&&(x=u=(x+u)/2),y<S&&(S=y=(S+y)/2),l.x0=x,l.y0=S,l.x1=u,l.y1=y,l.children&&(v=o[l.depth+1]=s(l)/2,x+=i(l)-v,S+=d(l)-v,u-=h(l)-v,y-=f(l)-v,u<x&&(x=u=(x+u)/2),y<S&&(S=y=(S+y)/2),t(l,x,S,u,y))}return p.round=function(l){return arguments.length?(a=!!l,p):a},p.size=function(l){return arguments.length?(n=+l[0],r=+l[1],p):[n,r]},p.tile=function(l){return arguments.length?(t=qe(l),p):t},p.padding=function(l){return arguments.length?p.paddingInner(l).paddingOuter(l):p.paddingInner()},p.paddingInner=function(l){return arguments.length?(s=typeof l=="function"?l:V(+l),p):s},p.paddingOuter=function(l){return arguments.length?p.paddingTop(l).paddingRight(l).paddingBottom(l).paddingLeft(l):p.paddingTop()},p.paddingTop=function(l){return arguments.length?(d=typeof l=="function"?l:V(+l),p):d},p.paddingRight=function(l){return arguments.length?(h=typeof l=="function"?l:V(+l),p):h},p.paddingBottom=function(l){return arguments.length?(f=typeof l=="function"?l:V(+l),p):f},p.paddingLeft=function(l){return arguments.length?(i=typeof l=="function"?l:V(+l),p):i},p}var X,ae=(X=class{constructor(){this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.setAccTitle=de,this.getAccTitle=he,this.setDiagramTitle=pe,this.getDiagramTitle=ue,this.getAccDescription=fe,this.setAccDescription=me}getNodes(){return this.nodes}getConfig(){const t=ye,a=te();return ee({...t.treemap,...a.treemap??{}})}addNode(t,a){this.nodes.push(t),this.levels.set(t,a),a===0&&(this.outerNodes.push(t),this.root??(this.root=t))}getRoot(){return{name:"",children:this.outerNodes}}addClass(t,a){const n=this.classes.get(t)??{id:t,styles:[],textStyles:[]},r=a.replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");r&&r.forEach(o=>{ge(o)&&(n!=null&&n.textStyles?n.textStyles.push(o):n.textStyles=[o]),n!=null&&n.styles?n.styles.push(o):n.styles=[o]}),this.classes.set(t,n)}getClasses(){return this.classes}getStylesForClass(t){var a;return((a=this.classes.get(t))==null?void 0:a.styles)??[]}clear(){xe(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}},C(X,"TreeMapDB"),X);function ne(t){if(!t.length)return[];const a=[],n=[];return t.forEach(r=>{const o={name:r.name,children:r.type==="Leaf"?void 0:[]};for(o.classSelector=r==null?void 0:r.classSelector,r!=null&&r.cssCompiledStyles&&(o.cssCompiledStyles=[r.cssCompiledStyles]),r.type==="Leaf"&&r.value!==void 0&&(o.value=r.value);n.length>0&&n[n.length-1].level>=r.level;)n.pop();if(n.length===0)a.push(o);else{const s=n[n.length-1].node;s.children?s.children.push(o):s.children=[o]}r.type!=="Leaf"&&n.push({node:o,level:r.level})}),a}C(ne,"buildHierarchy");var Xe=C((t,a)=>{ve(t,a);const n=[];for(const s of t.TreemapRows??[])s.$type==="ClassDefStatement"&&a.addClass(s.className??"",s.styleText??"");for(const s of t.TreemapRows??[]){const d=s.item;if(!d)continue;const h=s.indent?parseInt(s.indent):0,f=Ze(d),i=d.classSelector?a.getStylesForClass(d.classSelector):[],p=i.length>0?i.join(";"):void 0,b={level:h,name:f,type:d.$type,value:d.value,classSelector:d.classSelector,cssCompiledStyles:p};n.push(b)}const r=ne(n),o=C((s,d)=>{for(const h of s)a.addNode(h,d),h.children&&h.children.length>0&&o(h.children,d+1)},"addNodesRecursively");o(r,0)},"populate"),Ze=C(t=>t.name?String(t.name):"","getItemName"),re={parser:{yy:void 0},parse:C(async t=>{var a;try{const n=await be("treemap",t);Z.debug("Treemap AST:",n);const r=(a=re.parser)==null?void 0:a.yy;if(!(r instanceof ae))throw new Error("parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");Xe(n,r)}catch(n){throw Z.error("Error parsing treemap:",n),n}},"parse")},Ke=10,N=10,q=25,Ye=C((t,a,n,r)=>{const o=r.db,s=o.getConfig(),d=s.padding??Ke,h=o.getDiagramTitle(),f=o.getRoot(),{themeVariables:i}=te();if(!f)return;const p=h?30:0,b=ie(a),l=s.nodeWidth?s.nodeWidth*N:960,v=s.nodeHeight?s.nodeHeight*N:500,x=l,S=v+p;b.attr("viewBox",`0 0 ${x} ${S}`),ce(b,S,x,s.useMaxWidth);let u;try{const e=s.valueFormat||",";if(e==="$0,0")u=C(c=>"$"+R(",")(c),"valueFormat");else if(e.startsWith("$")&&e.includes(",")){const c=/\.\d+/.exec(e),g=c?c[0]:"";u=C($=>"$"+R(","+g)($),"valueFormat")}else if(e.startsWith("$")){const c=e.substring(1);u=C(g=>"$"+R(c||"")(g),"valueFormat")}else u=R(e)}catch(e){Z.error("Error creating format function:",e),u=R(",")}const y=U().range(["transparent",i.cScale0,i.cScale1,i.cScale2,i.cScale3,i.cScale4,i.cScale5,i.cScale6,i.cScale7,i.cScale8,i.cScale9,i.cScale10,i.cScale11]),A=U().range(["transparent",i.cScalePeer0,i.cScalePeer1,i.cScalePeer2,i.cScalePeer3,i.cScalePeer4,i.cScalePeer5,i.cScalePeer6,i.cScalePeer7,i.cScalePeer8,i.cScalePeer9,i.cScalePeer10,i.cScalePeer11]),T=U().range([i.cScaleLabel0,i.cScaleLabel1,i.cScaleLabel2,i.cScaleLabel3,i.cScaleLabel4,i.cScaleLabel5,i.cScaleLabel6,i.cScaleLabel7,i.cScaleLabel8,i.cScaleLabel9,i.cScaleLabel10,i.cScaleLabel11]);h&&b.append("text").attr("x",x/2).attr("y",p/2).attr("class","treemapTitle").attr("text-anchor","middle").attr("dominant-baseline","middle").text(h);const B=b.append("g").attr("transform",`translate(0, ${p})`).attr("class","treemapContainer"),W=K(f).sum(e=>e.value??0).sort((e,c)=>(c.value??0)-(e.value??0)),L=Ue().size([l,v]).paddingTop(e=>e.children&&e.children.length>0?q+N:0).paddingInner(d).paddingLeft(e=>e.children&&e.children.length>0?N:0).paddingRight(e=>e.children&&e.children.length>0?N:0).paddingBottom(e=>e.children&&e.children.length>0?N:0).round(!0)(W),le=L.descendants().filter(e=>e.children&&e.children.length>0),D=B.selectAll(".treemapSection").data(le).enter().append("g").attr("class","treemapSection").attr("transform",e=>`translate(${e.x0},${e.y0})`);D.append("rect").attr("width",e=>e.x1-e.x0).attr("height",q).attr("class","treemapSectionHeader").attr("fill","none").attr("fill-opacity",.6).attr("stroke-width",.6).attr("style",e=>e.depth===0?"display: none;":""),D.append("clipPath").attr("id",(e,c)=>`clip-section-${a}-${c}`).append("rect").attr("width",e=>Math.max(0,e.x1-e.x0-12)).attr("height",q),D.append("rect").attr("width",e=>e.x1-e.x0).attr("height",e=>e.y1-e.y0).attr("class",(e,c)=>`treemapSection section${c}`).attr("fill",e=>y(e.data.name)).attr("fill-opacity",.6).attr("stroke",e=>A(e.data.name)).attr("stroke-width",2).attr("stroke-opacity",.4).attr("style",e=>{if(e.depth===0)return"display: none;";const c=P({cssCompiledStyles:e.data.cssCompiledStyles});return c.nodeStyles+";"+c.borderStyles.join(";")}),D.append("text").attr("class","treemapSectionLabel").attr("x",6).attr("y",q/2).attr("dominant-baseline","middle").text(e=>e.depth===0?"":e.data.name).attr("font-weight","bold").attr("style",e=>{if(e.depth===0)return"display: none;";const c="dominant-baseline: middle; font-size: 12px; fill:"+T(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",g=P({cssCompiledStyles:e.data.cssCompiledStyles});return c+g.labelStyles.replace("color:","fill:")}).each(function(e){if(e.depth===0)return;const c=_(this),g=e.data.name;c.text(g);const $=e.x1-e.x0,M=6;let z;s.showValues!==!1&&e.value?z=$-10-30-10-M:z=$-M-6;const k=Math.max(15,z),w=c.node();if(w.getComputedTextLength()>k){let m=g;for(;m.length>0;){if(m=g.substring(0,m.length-1),m.length===0){c.text("..."),w.getComputedTextLength()>k&&c.text("");break}if(c.text(m+"..."),w.getComputedTextLength()<=k)break}}}),s.showValues!==!1&&D.append("text").attr("class","treemapSectionValue").attr("x",e=>e.x1-e.x0-10).attr("y",q/2).attr("text-anchor","end").attr("dominant-baseline","middle").text(e=>e.value?u(e.value):"").attr("font-style","italic").attr("style",e=>{if(e.depth===0)return"display: none;";const c="text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:"+T(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",g=P({cssCompiledStyles:e.data.cssCompiledStyles});return c+g.labelStyles.replace("color:","fill:")});const se=L.leaves(),O=B.selectAll(".treemapLeafGroup").data(se).enter().append("g").attr("class",(e,c)=>`treemapNode treemapLeafGroup leaf${c}${e.data.classSelector?` ${e.data.classSelector}`:""}x`).attr("transform",e=>`translate(${e.x0},${e.y0})`);O.append("rect").attr("width",e=>e.x1-e.x0).attr("height",e=>e.y1-e.y0).attr("class","treemapLeaf").attr("fill",e=>e.parent?y(e.parent.data.name):y(e.data.name)).attr("style",e=>P({cssCompiledStyles:e.data.cssCompiledStyles}).nodeStyles).attr("fill-opacity",.3).attr("stroke",e=>e.parent?y(e.parent.data.name):y(e.data.name)).attr("stroke-width",3),O.append("clipPath").attr("id",(e,c)=>`clip-${a}-${c}`).append("rect").attr("width",e=>Math.max(0,e.x1-e.x0-4)).attr("height",e=>Math.max(0,e.y1-e.y0-4)),O.append("text").attr("class","treemapLabel").attr("x",e=>(e.x1-e.x0)/2).attr("y",e=>(e.y1-e.y0)/2).attr("style",e=>{const c="text-anchor: middle; dominant-baseline: middle; font-size: 38px;fill:"+T(e.data.name)+";",g=P({cssCompiledStyles:e.data.cssCompiledStyles});return c+g.labelStyles.replace("color:","fill:")}).attr("clip-path",(e,c)=>`url(#clip-${a}-${c})`).text(e=>e.data.name).each(function(e){const c=_(this),g=e.x1-e.x0,$=e.y1-e.y0,M=c.node(),z=4,k=g-2*z,w=$-2*z;if(k<10||w<10){c.style("display","none");return}let m=parseInt(c.style("font-size"),10);const F=8,H=28,j=.6,I=6,G=2;for(;M.getComputedTextLength()>k&&m>F;)m--,c.style("font-size",`${m}px`);let J=Math.max(I,Math.min(H,Math.round(m*j))),Y=m+G+J;for(;Y>w&&m>F&&(m--,J=Math.max(I,Math.min(H,Math.round(m*j))),!(J<I&&m===F));)c.style("font-size",`${m}px`),Y=m+G+J;c.style("font-size",`${m}px`),(M.getComputedTextLength()>k||m<F||w<m)&&c.style("display","none")}),s.showValues!==!1&&O.append("text").attr("class","treemapValue").attr("x",e=>(e.x1-e.x0)/2).attr("y",function(e){return(e.y1-e.y0)/2}).attr("style",e=>{const c="text-anchor: middle; dominant-baseline: hanging; font-size: 28px;fill:"+T(e.data.name)+";",g=P({cssCompiledStyles:e.data.cssCompiledStyles});return c+g.labelStyles.replace("color:","fill:")}).attr("clip-path",(e,c)=>`url(#clip-${a}-${c})`).text(e=>e.value?u(e.value):"").each(function(e){const c=_(this),g=this.parentNode;if(!g){c.style("display","none");return}const $=_(g).select(".treemapLabel");if($.empty()||$.style("display")==="none"){c.style("display","none");return}const M=parseFloat($.style("font-size")),z=28,k=.6,w=6,m=2,F=Math.max(w,Math.min(z,Math.round(M*k)));c.style("font-size",`${F}px`);const H=(e.y1-e.y0)/2+M/2+m;c.attr("y",H);const j=e.x1-e.x0,I=e.y1-e.y0-4,G=j-8;c.node().getComputedTextLength()>G||H+F>I||F<w?c.style("display","none"):c.style("display",null)});const oe=s.diagramPadding??8;Se(b,oe,"flowchart",(s==null?void 0:s.useMaxWidth)||!1)},"draw"),et=C(function(t,a){return a.db.getClasses()},"getClasses"),tt={draw:Ye,getClasses:et},at={sectionStrokeColor:"black",sectionStrokeWidth:"1",sectionFillColor:"#efefef",leafStrokeColor:"black",leafStrokeWidth:"1",leafFillColor:"#efefef",labelColor:"black",labelFontSize:"12px",valueFontSize:"10px",valueColor:"black",titleColor:"black",titleFontSize:"14px"},nt=C(({treemap:t}={})=>{const a=ee(at,t);return`
2
2
  .treemapNode.section {
3
3
  stroke: ${a.sectionStrokeColor};
4
4
  stroke-width: ${a.sectionStrokeWidth};
@@ -1,4 +1,4 @@
1
- import{R as l,f as S,u as I,o as E,n as F,l as R,s as z,am as P,t as D,J as y,L as w,M as B,O as G,at as j}from"./index-CIi9dO9d.js";import{m as N}from"./chunk-4BX2VUAB-DeMNg1Xd-CrtFwSE5.js";import{N as V}from"./treemap-KMMF4GRG-Dfxm7cSf-B7pg2atG.js";import"./_baseUniq-DRc_T5HB-BD-eiKhZ.js";import"./_basePickBy-BjEly54R-DqvpNhss.js";import"./clone-DduvFCk3-BXgbo_Py.js";var x={showLegend:!0,ticks:5,max:null,min:0,graticule:"circle"},b={axes:[],curves:[],options:x},h=structuredClone(b),W=B.radar,Z=l(()=>y({...W,...w().radar}),"getConfig"),M=l(()=>h.axes,"getAxes"),q=l(()=>h.curves,"getCurves"),J=l(()=>h.options,"getOptions"),_=l(a=>{h.axes=a.map(t=>({name:t.name,label:t.label??t.name}))},"setAxes"),H=l(a=>{h.curves=a.map(t=>({name:t.name,label:t.label??t.name,entries:K(t.entries)}))},"setCurves"),K=l(a=>{if(a[0].axis==null)return a.map(e=>e.value);const t=M();if(t.length===0)throw new Error("Axes must be populated before curves for reference entries");return t.map(e=>{const r=a.find(s=>{var n;return((n=s.axis)==null?void 0:n.$refText)===e.name});if(r===void 0)throw new Error("Missing entry for axis "+e.label);return r.value})},"computeCurveEntries"),Q=l(a=>{var t,e,r,s,n;const o=a.reduce((i,c)=>(i[c.name]=c,i),{});h.options={showLegend:((t=o.showLegend)==null?void 0:t.value)??x.showLegend,ticks:((e=o.ticks)==null?void 0:e.value)??x.ticks,max:((r=o.max)==null?void 0:r.value)??x.max,min:((s=o.min)==null?void 0:s.value)??x.min,graticule:((n=o.graticule)==null?void 0:n.value)??x.graticule}},"setOptions"),U=l(()=>{D(),h=structuredClone(b)},"clear"),f={getAxes:M,getCurves:q,getOptions:J,setAxes:_,setCurves:H,setOptions:Q,getConfig:Z,clear:U,setAccTitle:z,getAccTitle:R,setDiagramTitle:F,getDiagramTitle:E,getAccDescription:I,setAccDescription:S},X=l(a=>{N(a,f);const{axes:t,curves:e,options:r}=a;f.setAxes(t),f.setCurves(e),f.setOptions(r)},"populate"),Y={parse:l(async a=>{const t=await V("radar",a);G.debug(t),X(t)},"parse")},tt=l((a,t,e,r)=>{const s=r.db,n=s.getAxes(),o=s.getCurves(),i=s.getOptions(),c=s.getConfig(),d=s.getDiagramTitle(),g=P(t),u=et(g,c),p=i.max??Math.max(...o.map(v=>Math.max(...v.entries))),m=i.min,$=Math.min(c.width,c.height)/2;at(u,n,$,i.ticks,i.graticule),rt(u,n,$,c),C(u,n,o,m,p,i.graticule,c),T(u,o,i.showLegend,c),u.append("text").attr("class","radarTitle").text(d).attr("x",0).attr("y",-c.height/2-c.marginTop)},"draw"),et=l((a,t)=>{const e=t.width+t.marginLeft+t.marginRight,r=t.height+t.marginTop+t.marginBottom,s={x:t.marginLeft+t.width/2,y:t.marginTop+t.height/2};return a.attr("viewbox",`0 0 ${e} ${r}`).attr("width",e).attr("height",r),a.append("g").attr("transform",`translate(${s.x}, ${s.y})`)},"drawFrame"),at=l((a,t,e,r,s)=>{if(s==="circle")for(let n=0;n<r;n++){const o=e*(n+1)/r;a.append("circle").attr("r",o).attr("class","radarGraticule")}else if(s==="polygon"){const n=t.length;for(let o=0;o<r;o++){const i=e*(o+1)/r,c=t.map((d,g)=>{const u=2*g*Math.PI/n-Math.PI/2,p=i*Math.cos(u),m=i*Math.sin(u);return`${p},${m}`}).join(" ");a.append("polygon").attr("points",c).attr("class","radarGraticule")}}},"drawGraticule"),rt=l((a,t,e,r)=>{const s=t.length;for(let n=0;n<s;n++){const o=t[n].label,i=2*n*Math.PI/s-Math.PI/2;a.append("line").attr("x1",0).attr("y1",0).attr("x2",e*r.axisScaleFactor*Math.cos(i)).attr("y2",e*r.axisScaleFactor*Math.sin(i)).attr("class","radarAxisLine"),a.append("text").text(o).attr("x",e*r.axisLabelFactor*Math.cos(i)).attr("y",e*r.axisLabelFactor*Math.sin(i)).attr("class","radarAxisLabel")}},"drawAxes");function C(a,t,e,r,s,n,o){const i=t.length,c=Math.min(o.width,o.height)/2;e.forEach((d,g)=>{if(d.entries.length!==i)return;const u=d.entries.map((p,m)=>{const $=2*Math.PI*m/i-Math.PI/2,v=L(p,r,s,c),A=v*Math.cos($),k=v*Math.sin($);return{x:A,y:k}});n==="circle"?a.append("path").attr("d",O(u,o.curveTension)).attr("class",`radarCurve-${g}`):n==="polygon"&&a.append("polygon").attr("points",u.map(p=>`${p.x},${p.y}`).join(" ")).attr("class",`radarCurve-${g}`)})}l(C,"drawCurves");function L(a,t,e,r){const s=Math.min(Math.max(a,t),e);return r*(s-t)/(e-t)}l(L,"relativeRadius");function O(a,t){const e=a.length;let r=`M${a[0].x},${a[0].y}`;for(let s=0;s<e;s++){const n=a[(s-1+e)%e],o=a[s],i=a[(s+1)%e],c=a[(s+2)%e],d={x:o.x+(i.x-n.x)*t,y:o.y+(i.y-n.y)*t},g={x:i.x-(c.x-o.x)*t,y:i.y-(c.y-o.y)*t};r+=` C${d.x},${d.y} ${g.x},${g.y} ${i.x},${i.y}`}return`${r} Z`}l(O,"closedRoundCurve");function T(a,t,e,r){if(!e)return;const s=(r.width/2+r.marginRight)*3/4,n=-(r.height/2+r.marginTop)*3/4,o=20;t.forEach((i,c)=>{const d=a.append("g").attr("transform",`translate(${s}, ${n+c*o})`);d.append("rect").attr("width",12).attr("height",12).attr("class",`radarLegendBox-${c}`),d.append("text").attr("x",16).attr("y",0).attr("class","radarLegendText").text(i.label)})}l(T,"drawLegend");var st={draw:tt},it=l((a,t)=>{let e="";for(let r=0;r<a.THEME_COLOR_LIMIT;r++){const s=a[`cScale${r}`];e+=`
1
+ import{R as l,f as S,u as I,r as E,o as F,l as R,s as z,am as P,w as D,H as y,J as w,L as B,O as G,at as j}from"./index-CyVB0J6E.js";import{m as N}from"./chunk-4BX2VUAB-BeuiUsbc-SyLBSPGf.js";import{N as V}from"./treemap-KMMF4GRG-C4GHjB3F-HVe9FL0t.js";import"./_baseUniq-Cd4llU-Q-D06fzDcA.js";import"./_basePickBy-1MakYQmz-CFyJwR0u.js";import"./clone-DH1Kq5Y6-CC3PuMQg.js";var x={showLegend:!0,ticks:5,max:null,min:0,graticule:"circle"},b={axes:[],curves:[],options:x},h=structuredClone(b),W=B.radar,Z=l(()=>y({...W,...w().radar}),"getConfig"),M=l(()=>h.axes,"getAxes"),q=l(()=>h.curves,"getCurves"),H=l(()=>h.options,"getOptions"),J=l(a=>{h.axes=a.map(t=>({name:t.name,label:t.label??t.name}))},"setAxes"),_=l(a=>{h.curves=a.map(t=>({name:t.name,label:t.label??t.name,entries:K(t.entries)}))},"setCurves"),K=l(a=>{if(a[0].axis==null)return a.map(e=>e.value);const t=M();if(t.length===0)throw new Error("Axes must be populated before curves for reference entries");return t.map(e=>{const r=a.find(s=>{var n;return((n=s.axis)==null?void 0:n.$refText)===e.name});if(r===void 0)throw new Error("Missing entry for axis "+e.label);return r.value})},"computeCurveEntries"),Q=l(a=>{var t,e,r,s,n;const o=a.reduce((i,c)=>(i[c.name]=c,i),{});h.options={showLegend:((t=o.showLegend)==null?void 0:t.value)??x.showLegend,ticks:((e=o.ticks)==null?void 0:e.value)??x.ticks,max:((r=o.max)==null?void 0:r.value)??x.max,min:((s=o.min)==null?void 0:s.value)??x.min,graticule:((n=o.graticule)==null?void 0:n.value)??x.graticule}},"setOptions"),U=l(()=>{D(),h=structuredClone(b)},"clear"),f={getAxes:M,getCurves:q,getOptions:H,setAxes:J,setCurves:_,setOptions:Q,getConfig:Z,clear:U,setAccTitle:z,getAccTitle:R,setDiagramTitle:F,getDiagramTitle:E,getAccDescription:I,setAccDescription:S},X=l(a=>{N(a,f);const{axes:t,curves:e,options:r}=a;f.setAxes(t),f.setCurves(e),f.setOptions(r)},"populate"),Y={parse:l(async a=>{const t=await V("radar",a);G.debug(t),X(t)},"parse")},tt=l((a,t,e,r)=>{const s=r.db,n=s.getAxes(),o=s.getCurves(),i=s.getOptions(),c=s.getConfig(),d=s.getDiagramTitle(),g=P(t),u=et(g,c),p=i.max??Math.max(...o.map(v=>Math.max(...v.entries))),m=i.min,$=Math.min(c.width,c.height)/2;at(u,n,$,i.ticks,i.graticule),rt(u,n,$,c),C(u,n,o,m,p,i.graticule,c),T(u,o,i.showLegend,c),u.append("text").attr("class","radarTitle").text(d).attr("x",0).attr("y",-c.height/2-c.marginTop)},"draw"),et=l((a,t)=>{const e=t.width+t.marginLeft+t.marginRight,r=t.height+t.marginTop+t.marginBottom,s={x:t.marginLeft+t.width/2,y:t.marginTop+t.height/2};return a.attr("viewbox",`0 0 ${e} ${r}`).attr("width",e).attr("height",r),a.append("g").attr("transform",`translate(${s.x}, ${s.y})`)},"drawFrame"),at=l((a,t,e,r,s)=>{if(s==="circle")for(let n=0;n<r;n++){const o=e*(n+1)/r;a.append("circle").attr("r",o).attr("class","radarGraticule")}else if(s==="polygon"){const n=t.length;for(let o=0;o<r;o++){const i=e*(o+1)/r,c=t.map((d,g)=>{const u=2*g*Math.PI/n-Math.PI/2,p=i*Math.cos(u),m=i*Math.sin(u);return`${p},${m}`}).join(" ");a.append("polygon").attr("points",c).attr("class","radarGraticule")}}},"drawGraticule"),rt=l((a,t,e,r)=>{const s=t.length;for(let n=0;n<s;n++){const o=t[n].label,i=2*n*Math.PI/s-Math.PI/2;a.append("line").attr("x1",0).attr("y1",0).attr("x2",e*r.axisScaleFactor*Math.cos(i)).attr("y2",e*r.axisScaleFactor*Math.sin(i)).attr("class","radarAxisLine"),a.append("text").text(o).attr("x",e*r.axisLabelFactor*Math.cos(i)).attr("y",e*r.axisLabelFactor*Math.sin(i)).attr("class","radarAxisLabel")}},"drawAxes");function C(a,t,e,r,s,n,o){const i=t.length,c=Math.min(o.width,o.height)/2;e.forEach((d,g)=>{if(d.entries.length!==i)return;const u=d.entries.map((p,m)=>{const $=2*Math.PI*m/i-Math.PI/2,v=L(p,r,s,c),A=v*Math.cos($),k=v*Math.sin($);return{x:A,y:k}});n==="circle"?a.append("path").attr("d",O(u,o.curveTension)).attr("class",`radarCurve-${g}`):n==="polygon"&&a.append("polygon").attr("points",u.map(p=>`${p.x},${p.y}`).join(" ")).attr("class",`radarCurve-${g}`)})}l(C,"drawCurves");function L(a,t,e,r){const s=Math.min(Math.max(a,t),e);return r*(s-t)/(e-t)}l(L,"relativeRadius");function O(a,t){const e=a.length;let r=`M${a[0].x},${a[0].y}`;for(let s=0;s<e;s++){const n=a[(s-1+e)%e],o=a[s],i=a[(s+1)%e],c=a[(s+2)%e],d={x:o.x+(i.x-n.x)*t,y:o.y+(i.y-n.y)*t},g={x:i.x-(c.x-o.x)*t,y:i.y-(c.y-o.y)*t};r+=` C${d.x},${d.y} ${g.x},${g.y} ${i.x},${i.y}`}return`${r} Z`}l(O,"closedRoundCurve");function T(a,t,e,r){if(!e)return;const s=(r.width/2+r.marginRight)*3/4,n=-(r.height/2+r.marginTop)*3/4,o=20;t.forEach((i,c)=>{const d=a.append("g").attr("transform",`translate(${s}, ${n+c*o})`);d.append("rect").attr("width",12).attr("height",12).attr("class",`radarLegendBox-${c}`),d.append("text").attr("x",16).attr("y",0).attr("class","radarLegendText").text(i.label)})}l(T,"drawLegend");var st={draw:tt},it=l((a,t)=>{let e="";for(let r=0;r<a.THEME_COLOR_LIMIT;r++){const s=a[`cScale${r}`];e+=`
2
2
  .radarCurve-${r} {
3
3
  color: ${s};
4
4
  fill: ${s};