markdown-flow-ui 0.2.0 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/markdown-flow-ui.css +1 -1
- package/dist/components/ContentRender/ContentRender.stories.d.ts +1 -0
- package/dist/components/ContentRender/IframeSandbox.cjs.js +7 -7
- package/dist/components/ContentRender/IframeSandbox.cjs.js.map +1 -1
- package/dist/components/ContentRender/IframeSandbox.es.js +283 -251
- package/dist/components/ContentRender/IframeSandbox.es.js.map +1 -1
- package/dist/components/ContentRender/blackboard-vendor.cjs.js +1 -1
- package/dist/components/ContentRender/blackboard-vendor.cjs.js.map +1 -1
- package/dist/components/ContentRender/blackboard-vendor.d.ts +2 -0
- package/dist/components/ContentRender/blackboard-vendor.es.js +8 -6
- package/dist/components/ContentRender/blackboard-vendor.es.js.map +1 -1
- package/dist/components/ContentRender/cjkFontFamily.cjs.js +2 -0
- package/dist/components/ContentRender/cjkFontFamily.cjs.js.map +1 -0
- package/dist/components/ContentRender/cjkFontFamily.d.ts +5 -0
- package/dist/components/ContentRender/cjkFontFamily.es.js +45 -0
- package/dist/components/ContentRender/cjkFontFamily.es.js.map +1 -0
- package/dist/components/ContentRender/cjkFontFamily.test.d.ts +1 -0
- package/dist/components/ContentRender/plugins/MermaidChart.cjs.js +1 -1
- package/dist/components/ContentRender/plugins/MermaidChart.cjs.js.map +1 -1
- package/dist/components/ContentRender/plugins/MermaidChart.es.js +19 -18
- package/dist/components/ContentRender/plugins/MermaidChart.es.js.map +1 -1
- package/dist/components/ContentRender/utils/iframe-scaling.cjs.js +12 -9
- package/dist/components/ContentRender/utils/iframe-scaling.cjs.js.map +1 -1
- package/dist/components/ContentRender/utils/iframe-scaling.es.js +16 -12
- package/dist/components/ContentRender/utils/iframe-scaling.es.js.map +1 -1
- package/dist/components/ContentRender/utils/presentation-scaling.cjs.js +2 -0
- package/dist/components/ContentRender/utils/presentation-scaling.cjs.js.map +1 -0
- package/dist/components/ContentRender/utils/presentation-scaling.d.ts +34 -0
- package/dist/components/ContentRender/utils/presentation-scaling.es.js +67 -0
- package/dist/components/ContentRender/utils/presentation-scaling.es.js.map +1 -0
- package/dist/components/ContentRender/utils/presentation-scaling.test.d.ts +1 -0
- package/dist/components/ContentRender/utils/tailwind-runtime.cjs.js +2 -0
- package/dist/components/ContentRender/utils/tailwind-runtime.cjs.js.map +1 -0
- package/dist/components/ContentRender/utils/tailwind-runtime.d.ts +5 -0
- package/dist/components/ContentRender/utils/tailwind-runtime.es.js +11 -0
- package/dist/components/ContentRender/utils/tailwind-runtime.es.js.map +1 -0
- package/dist/components/ContentRender/utils/tailwind-runtime.test.d.ts +1 -0
- package/dist/components/Slide/MarkdownSlideScaling.cjs.js +2 -0
- package/dist/components/Slide/MarkdownSlideScaling.cjs.js.map +1 -0
- package/dist/components/Slide/MarkdownSlideScaling.d.ts +13 -0
- package/dist/components/Slide/MarkdownSlideScaling.es.js +109 -0
- package/dist/components/Slide/MarkdownSlideScaling.es.js.map +1 -0
- package/dist/components/Slide/Slide.cjs.js +1 -1
- package/dist/components/Slide/Slide.cjs.js.map +1 -1
- package/dist/components/Slide/Slide.d.ts +7 -0
- package/dist/components/Slide/Slide.es.js +448 -438
- package/dist/components/Slide/Slide.es.js.map +1 -1
- package/dist/components/Slide/Slide.stories.d.ts +2473 -0
- package/dist/components/Slide/slideI18n.cjs.js +1 -1
- package/dist/components/Slide/slideI18n.cjs.js.map +1 -1
- package/dist/components/Slide/slideI18n.es.js +28 -32
- package/dist/components/Slide/slideI18n.es.js.map +1 -1
- package/dist/components/Slide/slideI18n.test.d.ts +1 -0
- package/dist/components/Slide/utils/markdownScaling.cjs.js +2 -0
- package/dist/components/Slide/utils/markdownScaling.cjs.js.map +1 -0
- package/dist/components/Slide/utils/markdownScaling.d.ts +7 -0
- package/dist/components/Slide/utils/markdownScaling.es.js +12 -0
- package/dist/components/Slide/utils/markdownScaling.es.js.map +1 -0
- package/dist/components/Slide/utils/markdownScaling.test.d.ts +1 -0
- package/dist/markdown-flow-ui-lib.css +1 -1
- package/dist/node_modules/cose-base/cose-base.cjs.js +1 -1
- package/dist/node_modules/cose-base/cose-base.cjs.js.map +1 -1
- package/dist/node_modules/cose-base/cose-base.es.js +1 -1
- package/dist/node_modules/cytoscape-fcose/node_modules/cose-base/cose-base.cjs.js +1 -1
- package/dist/node_modules/cytoscape-fcose/node_modules/cose-base/cose-base.cjs.js.map +1 -1
- package/dist/node_modules/cytoscape-fcose/node_modules/cose-base/cose-base.es.js +1 -1
- package/dist/node_modules/cytoscape-fcose/node_modules/layout-base/layout-base.cjs.js +1 -1
- package/dist/node_modules/cytoscape-fcose/node_modules/layout-base/layout-base.cjs.js.map +1 -1
- package/dist/node_modules/cytoscape-fcose/node_modules/layout-base/layout-base.es.js +1 -1
- package/dist/node_modules/layout-base/layout-base.cjs.js +1 -1
- package/dist/node_modules/layout-base/layout-base.cjs.js.map +1 -1
- package/dist/node_modules/layout-base/layout-base.es.js +1 -1
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Ye=require("../../../../_virtual/cose-base.cjs2.js"),vt=require("../layout-base/layout-base.cjs.js");var dt=Ye.__module.exports,ot;function ct(){return ot||(ot=1,(function(st,ut){(function(Je,He){st.exports=He(vt.__require())})(dt,function($e){return(()=>{var Je={45:((Q,ge,A)=>{var L={};L.layoutBase=A(551),L.CoSEConstants=A(806),L.CoSEEdge=A(767),L.CoSEGraph=A(880),L.CoSEGraphManager=A(578),L.CoSELayout=A(765),L.CoSENode=A(991),L.ConstraintHandler=A(902),Q.exports=L}),806:((Q,ge,A)=>{var L=A(551).FDLayoutConstants;function G(){}for(var B in L)G[B]=L[B];G.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,G.DEFAULT_RADIAL_SEPARATION=L.DEFAULT_EDGE_LENGTH,G.DEFAULT_COMPONENT_SEPERATION=60,G.TILE=!0,G.TILING_PADDING_VERTICAL=10,G.TILING_PADDING_HORIZONTAL=10,G.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,G.ENFORCE_CONSTRAINTS=!0,G.APPLY_LAYOUT=!0,G.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,G.TREE_REDUCTION_ON_INCREMENTAL=!0,G.PURE_INCREMENTAL=G.DEFAULT_INCREMENTAL,Q.exports=G}),767:((Q,ge,A)=>{var L=A(551).FDLayoutEdge;function G(Z,V,W){L.call(this,Z,V,W)}G.prototype=Object.create(L.prototype);for(var B in L)G[B]=L[B];Q.exports=G}),880:((Q,ge,A)=>{var L=A(551).LGraph;function G(Z,V,W){L.call(this,Z,V,W)}G.prototype=Object.create(L.prototype);for(var B in L)G[B]=L[B];Q.exports=G}),578:((Q,ge,A)=>{var L=A(551).LGraphManager;function G(Z){L.call(this,Z)}G.prototype=Object.create(L.prototype);for(var B in L)G[B]=L[B];Q.exports=G}),765:((Q,ge,A)=>{var L=A(551).FDLayout,G=A(578),B=A(880),Z=A(991),V=A(767),W=A(806),q=A(902),d=A(551).FDLayoutConstants,re=A(551).LayoutConstants,u=A(551).Point,x=A(551).PointD,Y=A(551).DimensionD,Ce=A(551).Layout,xe=A(551).Integer,Re=A(551).IGeometry,ce=A(551).LGraph,Ue=A(551).Transform,Me=A(551).LinkedList;function T(){L.call(this),this.toBeTiled={},this.constraints={}}T.prototype=Object.create(L.prototype);for(var ye in L)T[ye]=L[ye];T.prototype.newGraphManager=function(){var e=new G(this);return this.graphManager=e,e},T.prototype.newGraph=function(e){return new B(null,this.graphManager,e)},T.prototype.newNode=function(e){return new Z(this.graphManager,e)},T.prototype.newEdge=function(e){return new V(null,null,e)},T.prototype.initParameters=function(){L.prototype.initParameters.call(this,arguments),this.isSubLayout||(W.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=W.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=W.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=d.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=d.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=d.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=d.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},T.prototype.initSpringEmbedder=function(){L.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/d.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},T.prototype.layout=function(){var e=re.DEFAULT_CREATE_BENDS_AS_NEEDED;return e&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},T.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(W.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var a=new Set(this.getAllNodes()),t=this.nodesWithGravity.filter(function(n){return a.has(n)});this.graphManager.setAllNodesToApplyGravitation(t)}}else{var e=this.getFlatForest();if(e.length>0)this.positionNodesRadially(e);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var a=new Set(this.getAllNodes()),t=this.nodesWithGravity.filter(function(i){return a.has(i)});this.graphManager.setAllNodesToApplyGravitation(t),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(q.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),W.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},T.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%d.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 e=new Set(this.getAllNodes()),a=this.nodesWithGravity.filter(function(r){return e.has(r)});this.graphManager.setAllNodesToApplyGravitation(a),this.graphManager.updateBounds(),this.updateGrid(),W.PURE_INCREMENTAL?this.coolingFactor=d.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=d.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()),W.PURE_INCREMENTAL?this.coolingFactor=d.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=d.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var t=!this.isTreeGrowing&&!this.isGrowthFinished,i=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(t,i),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},T.prototype.getPositionsData=function(){for(var e=this.graphManager.getAllNodes(),a={},t=0;t<e.length;t++){var i=e[t].rect,r=e[t].id;a[r]={id:r,x:i.getCenterX(),y:i.getCenterY(),w:i.width,h:i.height}}return a},T.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var e=!1;if(d.ANIMATE==="during")this.emit("layoutstarted");else{for(;!e;)e=this.tick();this.graphManager.updateBounds()}},T.prototype.moveNodes=function(){for(var e=this.getAllNodes(),a,t=0;t<e.length;t++)a=e[t],a.calculateDisplacement();Object.keys(this.constraints).length>0&&this.updateDisplacements();for(var t=0;t<e.length;t++)a=e[t],a.move()},T.prototype.initConstraintVariables=function(){var e=this;this.idToNodeMap=new Map,this.fixedNodeSet=new Set;for(var a=this.graphManager.getAllNodes(),t=0;t<a.length;t++){var i=a[t];this.idToNodeMap.set(i.id,i)}var r=function s(f){for(var m=f.getChild().getNodes(),y,U=0,J=0;J<m.length;J++)y=m[J],y.getChild()==null?e.fixedNodeSet.has(y.id)&&(U+=100):U+=s(y);return U};if(this.constraints.fixedNodeConstraint){this.constraints.fixedNodeConstraint.forEach(function(m){e.fixedNodeSet.add(m.nodeId)});for(var a=this.graphManager.getAllNodes(),i,t=0;t<a.length;t++)if(i=a[t],i.getChild()!=null){var n=r(i);n>0&&(i.fixedNodeWeight=n)}}if(this.constraints.relativePlacementConstraint){var o=new Map,h=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(s){e.fixedNodesOnHorizontal.add(s),e.fixedNodesOnVertical.add(s)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var c=this.constraints.alignmentConstraint.vertical,t=0;t<c.length;t++)this.dummyToNodeForVerticalAlignment.set("dummy"+t,[]),c[t].forEach(function(f){o.set(f,"dummy"+t),e.dummyToNodeForVerticalAlignment.get("dummy"+t).push(f),e.fixedNodeSet.has(f)&&e.fixedNodesOnHorizontal.add("dummy"+t)});if(this.constraints.alignmentConstraint.horizontal)for(var v=this.constraints.alignmentConstraint.horizontal,t=0;t<v.length;t++)this.dummyToNodeForHorizontalAlignment.set("dummy"+t,[]),v[t].forEach(function(f){h.set(f,"dummy"+t),e.dummyToNodeForHorizontalAlignment.get("dummy"+t).push(f),e.fixedNodeSet.has(f)&&e.fixedNodesOnVertical.add("dummy"+t)})}if(W.RELAX_MOVEMENT_ON_CONSTRAINTS)this.shuffle=function(s){var f,m,y;for(y=s.length-1;y>=2*s.length/3;y--)f=Math.floor(Math.random()*(y+1)),m=s[y],s[y]=s[f],s[f]=m;return s},this.nodesInRelativeHorizontal=[],this.nodesInRelativeVertical=[],this.nodeToRelativeConstraintMapHorizontal=new Map,this.nodeToRelativeConstraintMapVertical=new Map,this.nodeToTempPositionMapHorizontal=new Map,this.nodeToTempPositionMapVertical=new Map,this.constraints.relativePlacementConstraint.forEach(function(s){if(s.left){var f=o.has(s.left)?o.get(s.left):s.left,m=o.has(s.right)?o.get(s.right):s.right;e.nodesInRelativeHorizontal.includes(f)||(e.nodesInRelativeHorizontal.push(f),e.nodeToRelativeConstraintMapHorizontal.set(f,[]),e.dummyToNodeForVerticalAlignment.has(f)?e.nodeToTempPositionMapHorizontal.set(f,e.idToNodeMap.get(e.dummyToNodeForVerticalAlignment.get(f)[0]).getCenterX()):e.nodeToTempPositionMapHorizontal.set(f,e.idToNodeMap.get(f).getCenterX())),e.nodesInRelativeHorizontal.includes(m)||(e.nodesInRelativeHorizontal.push(m),e.nodeToRelativeConstraintMapHorizontal.set(m,[]),e.dummyToNodeForVerticalAlignment.has(m)?e.nodeToTempPositionMapHorizontal.set(m,e.idToNodeMap.get(e.dummyToNodeForVerticalAlignment.get(m)[0]).getCenterX()):e.nodeToTempPositionMapHorizontal.set(m,e.idToNodeMap.get(m).getCenterX())),e.nodeToRelativeConstraintMapHorizontal.get(f).push({right:m,gap:s.gap}),e.nodeToRelativeConstraintMapHorizontal.get(m).push({left:f,gap:s.gap})}else{var y=h.has(s.top)?h.get(s.top):s.top,U=h.has(s.bottom)?h.get(s.bottom):s.bottom;e.nodesInRelativeVertical.includes(y)||(e.nodesInRelativeVertical.push(y),e.nodeToRelativeConstraintMapVertical.set(y,[]),e.dummyToNodeForHorizontalAlignment.has(y)?e.nodeToTempPositionMapVertical.set(y,e.idToNodeMap.get(e.dummyToNodeForHorizontalAlignment.get(y)[0]).getCenterY()):e.nodeToTempPositionMapVertical.set(y,e.idToNodeMap.get(y).getCenterY())),e.nodesInRelativeVertical.includes(U)||(e.nodesInRelativeVertical.push(U),e.nodeToRelativeConstraintMapVertical.set(U,[]),e.dummyToNodeForHorizontalAlignment.has(U)?e.nodeToTempPositionMapVertical.set(U,e.idToNodeMap.get(e.dummyToNodeForHorizontalAlignment.get(U)[0]).getCenterY()):e.nodeToTempPositionMapVertical.set(U,e.idToNodeMap.get(U).getCenterY())),e.nodeToRelativeConstraintMapVertical.get(y).push({bottom:U,gap:s.gap}),e.nodeToRelativeConstraintMapVertical.get(U).push({top:y,gap:s.gap})}});else{var S=new Map,E=new Map;this.constraints.relativePlacementConstraint.forEach(function(s){if(s.left){var f=o.has(s.left)?o.get(s.left):s.left,m=o.has(s.right)?o.get(s.right):s.right;S.has(f)?S.get(f).push(m):S.set(f,[m]),S.has(m)?S.get(m).push(f):S.set(m,[f])}else{var y=h.has(s.top)?h.get(s.top):s.top,U=h.has(s.bottom)?h.get(s.bottom):s.bottom;E.has(y)?E.get(y).push(U):E.set(y,[U]),E.has(U)?E.get(U).push(y):E.set(U,[y])}});var g=function(f,m){var y=[],U=[],J=new Me,he=new Set,ie=0;return f.forEach(function(be,Se){if(!he.has(Se)){y[ie]=[],U[ie]=!1;var se=Se;for(J.push(se),he.add(se),y[ie].push(se);J.length!=0;){se=J.shift(),m.has(se)&&(U[ie]=!0);var Ge=f.get(se);Ge.forEach(function(we){he.has(we)||(J.push(we),he.add(we),y[ie].push(we))})}ie++}}),{components:y,isFixed:U}},C=g(S,e.fixedNodesOnHorizontal);this.componentsOnHorizontal=C.components,this.fixedComponentsOnHorizontal=C.isFixed;var N=g(E,e.fixedNodesOnVertical);this.componentsOnVertical=N.components,this.fixedComponentsOnVertical=N.isFixed}}},T.prototype.updateDisplacements=function(){var e=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function(N){var s=e.idToNodeMap.get(N.nodeId);s.displacementX=0,s.displacementY=0}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var a=this.constraints.alignmentConstraint.vertical,t=0;t<a.length;t++){for(var i=0,r=0;r<a[t].length;r++){if(this.fixedNodeSet.has(a[t][r])){i=0;break}i+=this.idToNodeMap.get(a[t][r]).displacementX}for(var n=i/a[t].length,r=0;r<a[t].length;r++)this.idToNodeMap.get(a[t][r]).displacementX=n}if(this.constraints.alignmentConstraint.horizontal)for(var o=this.constraints.alignmentConstraint.horizontal,t=0;t<o.length;t++){for(var h=0,r=0;r<o[t].length;r++){if(this.fixedNodeSet.has(o[t][r])){h=0;break}h+=this.idToNodeMap.get(o[t][r]).displacementY}for(var c=h/o[t].length,r=0;r<o[t].length;r++)this.idToNodeMap.get(o[t][r]).displacementY=c}}if(this.constraints.relativePlacementConstraint)if(W.RELAX_MOVEMENT_ON_CONSTRAINTS)this.totalIterations%10==0&&(this.shuffle(this.nodesInRelativeHorizontal),this.shuffle(this.nodesInRelativeVertical)),this.nodesInRelativeHorizontal.forEach(function(N){if(!e.fixedNodesOnHorizontal.has(N)){var s=0;e.dummyToNodeForVerticalAlignment.has(N)?s=e.idToNodeMap.get(e.dummyToNodeForVerticalAlignment.get(N)[0]).displacementX:s=e.idToNodeMap.get(N).displacementX,e.nodeToRelativeConstraintMapHorizontal.get(N).forEach(function(f){if(f.right){var m=e.nodeToTempPositionMapHorizontal.get(f.right)-e.nodeToTempPositionMapHorizontal.get(N)-s;m<f.gap&&(s-=f.gap-m)}else{var m=e.nodeToTempPositionMapHorizontal.get(N)-e.nodeToTempPositionMapHorizontal.get(f.left)+s;m<f.gap&&(s+=f.gap-m)}}),e.nodeToTempPositionMapHorizontal.set(N,e.nodeToTempPositionMapHorizontal.get(N)+s),e.dummyToNodeForVerticalAlignment.has(N)?e.dummyToNodeForVerticalAlignment.get(N).forEach(function(f){e.idToNodeMap.get(f).displacementX=s}):e.idToNodeMap.get(N).displacementX=s}}),this.nodesInRelativeVertical.forEach(function(N){if(!e.fixedNodesOnHorizontal.has(N)){var s=0;e.dummyToNodeForHorizontalAlignment.has(N)?s=e.idToNodeMap.get(e.dummyToNodeForHorizontalAlignment.get(N)[0]).displacementY:s=e.idToNodeMap.get(N).displacementY,e.nodeToRelativeConstraintMapVertical.get(N).forEach(function(f){if(f.bottom){var m=e.nodeToTempPositionMapVertical.get(f.bottom)-e.nodeToTempPositionMapVertical.get(N)-s;m<f.gap&&(s-=f.gap-m)}else{var m=e.nodeToTempPositionMapVertical.get(N)-e.nodeToTempPositionMapVertical.get(f.top)+s;m<f.gap&&(s+=f.gap-m)}}),e.nodeToTempPositionMapVertical.set(N,e.nodeToTempPositionMapVertical.get(N)+s),e.dummyToNodeForHorizontalAlignment.has(N)?e.dummyToNodeForHorizontalAlignment.get(N).forEach(function(f){e.idToNodeMap.get(f).displacementY=s}):e.idToNodeMap.get(N).displacementY=s}});else{for(var t=0;t<this.componentsOnHorizontal.length;t++){var v=this.componentsOnHorizontal[t];if(this.fixedComponentsOnHorizontal[t])for(var r=0;r<v.length;r++)this.dummyToNodeForVerticalAlignment.has(v[r])?this.dummyToNodeForVerticalAlignment.get(v[r]).forEach(function(f){e.idToNodeMap.get(f).displacementX=0}):this.idToNodeMap.get(v[r]).displacementX=0;else{for(var S=0,E=0,r=0;r<v.length;r++)if(this.dummyToNodeForVerticalAlignment.has(v[r])){var g=this.dummyToNodeForVerticalAlignment.get(v[r]);S+=g.length*this.idToNodeMap.get(g[0]).displacementX,E+=g.length}else S+=this.idToNodeMap.get(v[r]).displacementX,E++;for(var C=S/E,r=0;r<v.length;r++)this.dummyToNodeForVerticalAlignment.has(v[r])?this.dummyToNodeForVerticalAlignment.get(v[r]).forEach(function(f){e.idToNodeMap.get(f).displacementX=C}):this.idToNodeMap.get(v[r]).displacementX=C}}for(var t=0;t<this.componentsOnVertical.length;t++){var v=this.componentsOnVertical[t];if(this.fixedComponentsOnVertical[t])for(var r=0;r<v.length;r++)this.dummyToNodeForHorizontalAlignment.has(v[r])?this.dummyToNodeForHorizontalAlignment.get(v[r]).forEach(function(m){e.idToNodeMap.get(m).displacementY=0}):this.idToNodeMap.get(v[r]).displacementY=0;else{for(var S=0,E=0,r=0;r<v.length;r++)if(this.dummyToNodeForHorizontalAlignment.has(v[r])){var g=this.dummyToNodeForHorizontalAlignment.get(v[r]);S+=g.length*this.idToNodeMap.get(g[0]).displacementY,E+=g.length}else S+=this.idToNodeMap.get(v[r]).displacementY,E++;for(var C=S/E,r=0;r<v.length;r++)this.dummyToNodeForHorizontalAlignment.has(v[r])?this.dummyToNodeForHorizontalAlignment.get(v[r]).forEach(function(J){e.idToNodeMap.get(J).displacementY=C}):this.idToNodeMap.get(v[r]).displacementY=C}}}},T.prototype.calculateNodesToApplyGravitationTo=function(){var e=[],a,t=this.graphManager.getGraphs(),i=t.length,r;for(r=0;r<i;r++)a=t[r],a.updateConnected(),a.isConnected||(e=e.concat(a.getNodes()));return e},T.prototype.createBendpoints=function(){var e=[];e=e.concat(this.graphManager.getAllEdges());var a=new Set,t;for(t=0;t<e.length;t++){var i=e[t];if(!a.has(i)){var r=i.getSource(),n=i.getTarget();if(r==n)i.getBendpoints().push(new x),i.getBendpoints().push(new x),this.createDummyNodesForBendpoints(i),a.add(i);else{var o=[];if(o=o.concat(r.getEdgeListToNode(n)),o=o.concat(n.getEdgeListToNode(r)),!a.has(o[0])){if(o.length>1){var h;for(h=0;h<o.length;h++){var c=o[h];c.getBendpoints().push(new x),this.createDummyNodesForBendpoints(c)}}o.forEach(function(v){a.add(v)})}}}if(a.size==e.length)break}},T.prototype.positionNodesRadially=function(e){for(var a=new u(0,0),t=Math.ceil(Math.sqrt(e.length)),i=0,r=0,n=0,o=new x(0,0),h=0;h<e.length;h++){h%t==0&&(n=0,r=i,h!=0&&(r+=W.DEFAULT_COMPONENT_SEPERATION),i=0);var c=e[h],v=Ce.findCenterOfTree(c);a.x=n,a.y=r,o=T.radialLayout(c,v,a),o.y>i&&(i=Math.floor(o.y)),n=Math.floor(o.x+W.DEFAULT_COMPONENT_SEPERATION)}this.transform(new x(re.WORLD_CENTER_X-o.x/2,re.WORLD_CENTER_Y-o.y/2))},T.radialLayout=function(e,a,t){var i=Math.max(this.maxDiagonalInTree(e),W.DEFAULT_RADIAL_SEPARATION);T.branchRadialLayout(a,null,0,359,0,i);var r=ce.calculateBounds(e),n=new Ue;n.setDeviceOrgX(r.getMinX()),n.setDeviceOrgY(r.getMinY()),n.setWorldOrgX(t.x),n.setWorldOrgY(t.y);for(var o=0;o<e.length;o++){var h=e[o];h.transform(n)}var c=new x(r.getMaxX(),r.getMaxY());return n.inverseTransformPoint(c)},T.branchRadialLayout=function(e,a,t,i,r,n){var o=(i-t+1)/2;o<0&&(o+=180);var h=(o+t)%360,c=h*Re.TWO_PI/360,v=r*Math.cos(c),S=r*Math.sin(c);e.setCenter(v,S);var E=[];E=E.concat(e.getEdges());var g=E.length;a!=null&&g--;for(var C=0,N=E.length,s,f=e.getEdgesBetween(a);f.length>1;){var m=f[0];f.splice(0,1);var y=E.indexOf(m);y>=0&&E.splice(y,1),N--,g--}a!=null?s=(E.indexOf(f[0])+1)%N:s=0;for(var U=Math.abs(i-t)/g,J=s;C!=g;J=++J%N){var he=E[J].getOtherEnd(e);if(he!=a){var ie=(t+C*U)%360,be=(ie+U)%360;T.branchRadialLayout(he,e,ie,be,r+n,n),C++}}},T.maxDiagonalInTree=function(e){for(var a=xe.MIN_VALUE,t=0;t<e.length;t++){var i=e[t],r=i.getDiagonal();r>a&&(a=r)}return a},T.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},T.prototype.groupZeroDegreeMembers=function(){var e=this,a={};this.memberGroups={},this.idToDummyNode={};for(var t=[],i=this.graphManager.getAllNodes(),r=0;r<i.length;r++){var n=i[r],o=n.getParent();this.getNodeDegreeWithChildren(n)===0&&(o.id==null||!this.getToBeTiled(o))&&t.push(n)}for(var r=0;r<t.length;r++){var n=t[r],h=n.getParent().id;typeof a[h]>"u"&&(a[h]=[]),a[h]=a[h].concat(n)}Object.keys(a).forEach(function(c){if(a[c].length>1){var v="DummyCompound_"+c;e.memberGroups[v]=a[c];var S=a[c][0].getParent(),E=new Z(e.graphManager);E.id=v,E.paddingLeft=S.paddingLeft||0,E.paddingRight=S.paddingRight||0,E.paddingBottom=S.paddingBottom||0,E.paddingTop=S.paddingTop||0,e.idToDummyNode[v]=E;var g=e.getGraphManager().add(e.newGraph(),E),C=S.getChild();C.add(E);for(var N=0;N<a[c].length;N++){var s=a[c][N];C.remove(s),g.add(s)}}})},T.prototype.clearCompounds=function(){var e={},a={};this.performDFSOnCompounds();for(var t=0;t<this.compoundOrder.length;t++)a[this.compoundOrder[t].id]=this.compoundOrder[t],e[this.compoundOrder[t].id]=[].concat(this.compoundOrder[t].getChild().getNodes()),this.graphManager.remove(this.compoundOrder[t].getChild()),this.compoundOrder[t].child=null;this.graphManager.resetAllNodes(),this.tileCompoundMembers(e,a)},T.prototype.clearZeroDegreeMembers=function(){var e=this,a=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach(function(t){var i=e.idToDummyNode[t];if(a[t]=e.tileNodes(e.memberGroups[t],i.paddingLeft+i.paddingRight),i.rect.width=a[t].width,i.rect.height=a[t].height,i.setCenter(a[t].centerX,a[t].centerY),i.labelMarginLeft=0,i.labelMarginTop=0,W.NODE_DIMENSIONS_INCLUDE_LABELS){var r=i.rect.width,n=i.rect.height;i.labelWidth&&(i.labelPosHorizontal=="left"?(i.rect.x-=i.labelWidth,i.setWidth(r+i.labelWidth),i.labelMarginLeft=i.labelWidth):i.labelPosHorizontal=="center"&&i.labelWidth>r?(i.rect.x-=(i.labelWidth-r)/2,i.setWidth(i.labelWidth),i.labelMarginLeft=(i.labelWidth-r)/2):i.labelPosHorizontal=="right"&&i.setWidth(r+i.labelWidth)),i.labelHeight&&(i.labelPosVertical=="top"?(i.rect.y-=i.labelHeight,i.setHeight(n+i.labelHeight),i.labelMarginTop=i.labelHeight):i.labelPosVertical=="center"&&i.labelHeight>n?(i.rect.y-=(i.labelHeight-n)/2,i.setHeight(i.labelHeight),i.labelMarginTop=(i.labelHeight-n)/2):i.labelPosVertical=="bottom"&&i.setHeight(n+i.labelHeight))}})},T.prototype.repopulateCompounds=function(){for(var e=this.compoundOrder.length-1;e>=0;e--){var a=this.compoundOrder[e],t=a.id,i=a.paddingLeft,r=a.paddingTop,n=a.labelMarginLeft,o=a.labelMarginTop;this.adjustLocations(this.tiledMemberPack[t],a.rect.x,a.rect.y,i,r,n,o)}},T.prototype.repopulateZeroDegreeMembers=function(){var e=this,a=this.tiledZeroDegreePack;Object.keys(a).forEach(function(t){var i=e.idToDummyNode[t],r=i.paddingLeft,n=i.paddingTop,o=i.labelMarginLeft,h=i.labelMarginTop;e.adjustLocations(a[t],i.rect.x,i.rect.y,r,n,o,h)})},T.prototype.getToBeTiled=function(e){var a=e.id;if(this.toBeTiled[a]!=null)return this.toBeTiled[a];var t=e.getChild();if(t==null)return this.toBeTiled[a]=!1,!1;for(var i=t.getNodes(),r=0;r<i.length;r++){var n=i[r];if(this.getNodeDegree(n)>0)return this.toBeTiled[a]=!1,!1;if(n.getChild()==null){this.toBeTiled[n.id]=!1;continue}if(!this.getToBeTiled(n))return this.toBeTiled[a]=!1,!1}return this.toBeTiled[a]=!0,!0},T.prototype.getNodeDegree=function(e){e.id;for(var a=e.getEdges(),t=0,i=0;i<a.length;i++){var r=a[i];r.getSource().id!==r.getTarget().id&&(t=t+1)}return t},T.prototype.getNodeDegreeWithChildren=function(e){var a=this.getNodeDegree(e);if(e.getChild()==null)return a;for(var t=e.getChild().getNodes(),i=0;i<t.length;i++){var r=t[i];a+=this.getNodeDegreeWithChildren(r)}return a},T.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},T.prototype.fillCompexOrderByDFS=function(e){for(var a=0;a<e.length;a++){var t=e[a];t.getChild()!=null&&this.fillCompexOrderByDFS(t.getChild().getNodes()),this.getToBeTiled(t)&&this.compoundOrder.push(t)}},T.prototype.adjustLocations=function(e,a,t,i,r,n,o){a+=i+n,t+=r+o;for(var h=a,c=0;c<e.rows.length;c++){var v=e.rows[c];a=h;for(var S=0,E=0;E<v.length;E++){var g=v[E];g.rect.x=a,g.rect.y=t,a+=g.rect.width+e.horizontalPadding,g.rect.height>S&&(S=g.rect.height)}t+=S+e.verticalPadding}},T.prototype.tileCompoundMembers=function(e,a){var t=this;this.tiledMemberPack=[],Object.keys(e).forEach(function(i){var r=a[i];if(t.tiledMemberPack[i]=t.tileNodes(e[i],r.paddingLeft+r.paddingRight),r.rect.width=t.tiledMemberPack[i].width,r.rect.height=t.tiledMemberPack[i].height,r.setCenter(t.tiledMemberPack[i].centerX,t.tiledMemberPack[i].centerY),r.labelMarginLeft=0,r.labelMarginTop=0,W.NODE_DIMENSIONS_INCLUDE_LABELS){var n=r.rect.width,o=r.rect.height;r.labelWidth&&(r.labelPosHorizontal=="left"?(r.rect.x-=r.labelWidth,r.setWidth(n+r.labelWidth),r.labelMarginLeft=r.labelWidth):r.labelPosHorizontal=="center"&&r.labelWidth>n?(r.rect.x-=(r.labelWidth-n)/2,r.setWidth(r.labelWidth),r.labelMarginLeft=(r.labelWidth-n)/2):r.labelPosHorizontal=="right"&&r.setWidth(n+r.labelWidth)),r.labelHeight&&(r.labelPosVertical=="top"?(r.rect.y-=r.labelHeight,r.setHeight(o+r.labelHeight),r.labelMarginTop=r.labelHeight):r.labelPosVertical=="center"&&r.labelHeight>o?(r.rect.y-=(r.labelHeight-o)/2,r.setHeight(r.labelHeight),r.labelMarginTop=(r.labelHeight-o)/2):r.labelPosVertical=="bottom"&&r.setHeight(o+r.labelHeight))}})},T.prototype.tileNodes=function(e,a){var t=this.tileNodesByFavoringDim(e,a,!0),i=this.tileNodesByFavoringDim(e,a,!1),r=this.getOrgRatio(t),n=this.getOrgRatio(i),o;return n<r?o=i:o=t,o},T.prototype.getOrgRatio=function(e){var a=e.width,t=e.height,i=a/t;return i<1&&(i=1/i),i},T.prototype.calcIdealRowWidth=function(e,a){var t=W.TILING_PADDING_VERTICAL,i=W.TILING_PADDING_HORIZONTAL,r=e.length,n=0,o=0,h=0;e.forEach(function(N){n+=N.getWidth(),o+=N.getHeight(),N.getWidth()>h&&(h=N.getWidth())});var c=n/r,v=o/r,S=Math.pow(t-i,2)+4*(c+i)*(v+t)*r,E=(i-t+Math.sqrt(S))/(2*(c+i)),g;a?(g=Math.ceil(E),g==E&&g++):g=Math.floor(E);var C=g*(c+i)-i;return h>C&&(C=h),C+=i*2,C},T.prototype.tileNodesByFavoringDim=function(e,a,t){var i=W.TILING_PADDING_VERTICAL,r=W.TILING_PADDING_HORIZONTAL,n=W.TILING_COMPARE_BY,o={rows:[],rowWidth:[],rowHeight:[],width:0,height:a,verticalPadding:i,horizontalPadding:r,centerX:0,centerY:0};n&&(o.idealRowWidth=this.calcIdealRowWidth(e,t));var h=function(s){return s.rect.width*s.rect.height},c=function(s,f){return h(f)-h(s)};e.sort(function(N,s){var f=c;return o.idealRowWidth?(f=n,f(N.id,s.id)):f(N,s)});for(var v=0,S=0,E=0;E<e.length;E++){var g=e[E];v+=g.getCenterX(),S+=g.getCenterY()}o.centerX=v/e.length,o.centerY=S/e.length;for(var E=0;E<e.length;E++){var g=e[E];if(o.rows.length==0)this.insertNodeToRow(o,g,0,a);else if(this.canAddHorizontal(o,g.rect.width,g.rect.height)){var C=o.rows.length-1;o.idealRowWidth||(C=this.getShortestRowIndex(o)),this.insertNodeToRow(o,g,C,a)}else this.insertNodeToRow(o,g,o.rows.length,a);this.shiftToLastRow(o)}return o},T.prototype.insertNodeToRow=function(e,a,t,i){var r=i;if(t==e.rows.length){var n=[];e.rows.push(n),e.rowWidth.push(r),e.rowHeight.push(0)}var o=e.rowWidth[t]+a.rect.width;e.rows[t].length>0&&(o+=e.horizontalPadding),e.rowWidth[t]=o,e.width<o&&(e.width=o);var h=a.rect.height;t>0&&(h+=e.verticalPadding);var c=0;h>e.rowHeight[t]&&(c=e.rowHeight[t],e.rowHeight[t]=h,c=e.rowHeight[t]-c),e.height+=c,e.rows[t].push(a)},T.prototype.getShortestRowIndex=function(e){for(var a=-1,t=Number.MAX_VALUE,i=0;i<e.rows.length;i++)e.rowWidth[i]<t&&(a=i,t=e.rowWidth[i]);return a},T.prototype.getLongestRowIndex=function(e){for(var a=-1,t=Number.MIN_VALUE,i=0;i<e.rows.length;i++)e.rowWidth[i]>t&&(a=i,t=e.rowWidth[i]);return a},T.prototype.canAddHorizontal=function(e,a,t){if(e.idealRowWidth){var i=e.rows.length-1,r=e.rowWidth[i];return r+a+e.horizontalPadding<=e.idealRowWidth}var n=this.getShortestRowIndex(e);if(n<0)return!0;var o=e.rowWidth[n];if(o+e.horizontalPadding+a<=e.width)return!0;var h=0;e.rowHeight[n]<t&&n>0&&(h=t+e.verticalPadding-e.rowHeight[n]);var c;e.width-o>=a+e.horizontalPadding?c=(e.height+h)/(o+a+e.horizontalPadding):c=(e.height+h)/e.width,h=t+e.verticalPadding;var v;return e.width<a?v=(e.height+h)/a:v=(e.height+h)/e.width,v<1&&(v=1/v),c<1&&(c=1/c),c<v},T.prototype.shiftToLastRow=function(e){var a=this.getLongestRowIndex(e),t=e.rowWidth.length-1,i=e.rows[a],r=i[i.length-1],n=r.width+e.horizontalPadding;if(e.width-e.rowWidth[t]>n&&a!=t){i.splice(-1,1),e.rows[t].push(r),e.rowWidth[a]=e.rowWidth[a]-n,e.rowWidth[t]=e.rowWidth[t]+n,e.width=e.rowWidth[instance.getLongestRowIndex(e)];for(var o=Number.MIN_VALUE,h=0;h<i.length;h++)i[h].height>o&&(o=i[h].height);a>0&&(o+=e.verticalPadding);var c=e.rowHeight[a]+e.rowHeight[t];e.rowHeight[a]=o,e.rowHeight[t]<r.height+e.verticalPadding&&(e.rowHeight[t]=r.height+e.verticalPadding);var v=e.rowHeight[a]+e.rowHeight[t];e.height+=v-c,this.shiftToLastRow(e)}},T.prototype.tilingPreLayout=function(){W.TILE&&(this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers())},T.prototype.tilingPostLayout=function(){W.TILE&&(this.repopulateZeroDegreeMembers(),this.repopulateCompounds())},T.prototype.reduceTrees=function(){for(var e=[],a=!0,t;a;){var i=this.graphManager.getAllNodes(),r=[];a=!1;for(var n=0;n<i.length;n++)if(t=i[n],t.getEdges().length==1&&!t.getEdges()[0].isInterGraph&&t.getChild()==null){if(W.PURE_INCREMENTAL){var o=t.getEdges()[0].getOtherEnd(t),h=new Y(t.getCenterX()-o.getCenterX(),t.getCenterY()-o.getCenterY());r.push([t,t.getEdges()[0],t.getOwner(),h])}else r.push([t,t.getEdges()[0],t.getOwner()]);a=!0}if(a==!0){for(var c=[],v=0;v<r.length;v++)r[v][0].getEdges().length==1&&(c.push(r[v]),r[v][0].getOwner().remove(r[v][0]));e.push(c),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=e},T.prototype.growTree=function(e){for(var a=e.length,t=e[a-1],i,r=0;r<t.length;r++)i=t[r],this.findPlaceforPrunedNode(i),i[2].add(i[0]),i[2].add(i[1],i[1].source,i[1].target);e.splice(e.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},T.prototype.findPlaceforPrunedNode=function(e){var a,t,i=e[0];if(i==e[1].source?t=e[1].target:t=e[1].source,W.PURE_INCREMENTAL)i.setCenter(t.getCenterX()+e[3].getWidth(),t.getCenterY()+e[3].getHeight());else{var r=t.startX,n=t.finishX,o=t.startY,h=t.finishY,c=0,v=0,S=0,E=0,g=[c,S,v,E];if(o>0)for(var C=r;C<=n;C++)g[0]+=this.grid[C][o-1].length+this.grid[C][o].length-1;if(n<this.grid.length-1)for(var C=o;C<=h;C++)g[1]+=this.grid[n+1][C].length+this.grid[n][C].length-1;if(h<this.grid[0].length-1)for(var C=r;C<=n;C++)g[2]+=this.grid[C][h+1].length+this.grid[C][h].length-1;if(r>0)for(var C=o;C<=h;C++)g[3]+=this.grid[r-1][C].length+this.grid[r][C].length-1;for(var N=xe.MAX_VALUE,s,f,m=0;m<g.length;m++)g[m]<N?(N=g[m],s=1,f=m):g[m]==N&&s++;if(s==3&&N==0)g[0]==0&&g[1]==0&&g[2]==0?a=1:g[0]==0&&g[1]==0&&g[3]==0?a=0:g[0]==0&&g[2]==0&&g[3]==0?a=3:g[1]==0&&g[2]==0&&g[3]==0&&(a=2);else if(s==2&&N==0){var y=Math.floor(Math.random()*2);g[0]==0&&g[1]==0?y==0?a=0:a=1:g[0]==0&&g[2]==0?y==0?a=0:a=2:g[0]==0&&g[3]==0?y==0?a=0:a=3:g[1]==0&&g[2]==0?y==0?a=1:a=2:g[1]==0&&g[3]==0?y==0?a=1:a=3:y==0?a=2:a=3}else if(s==4&&N==0){var y=Math.floor(Math.random()*4);a=y}else a=f;a==0?i.setCenter(t.getCenterX(),t.getCenterY()-t.getHeight()/2-d.DEFAULT_EDGE_LENGTH-i.getHeight()/2):a==1?i.setCenter(t.getCenterX()+t.getWidth()/2+d.DEFAULT_EDGE_LENGTH+i.getWidth()/2,t.getCenterY()):a==2?i.setCenter(t.getCenterX(),t.getCenterY()+t.getHeight()/2+d.DEFAULT_EDGE_LENGTH+i.getHeight()/2):i.setCenter(t.getCenterX()-t.getWidth()/2-d.DEFAULT_EDGE_LENGTH-i.getWidth()/2,t.getCenterY())}},Q.exports=T}),991:((Q,ge,A)=>{var L=A(551).FDLayoutNode,G=A(551).IMath;function B(V,W,q,d){L.call(this,V,W,q,d)}B.prototype=Object.create(L.prototype);for(var Z in L)B[Z]=L[Z];B.prototype.calculateDisplacement=function(){var V=this.graphManager.getLayout();this.getChild()!=null&&this.fixedNodeWeight?(this.displacementX+=V.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=V.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=V.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=V.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>V.coolingFactor*V.maxNodeDisplacement&&(this.displacementX=V.coolingFactor*V.maxNodeDisplacement*G.sign(this.displacementX)),Math.abs(this.displacementY)>V.coolingFactor*V.maxNodeDisplacement&&(this.displacementY=V.coolingFactor*V.maxNodeDisplacement*G.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},B.prototype.propogateDisplacementToChildren=function(V,W){for(var q=this.getChild().getNodes(),d,re=0;re<q.length;re++)d=q[re],d.getChild()==null?(d.displacementX+=V,d.displacementY+=W):d.propogateDisplacementToChildren(V,W)},B.prototype.move=function(){var V=this.graphManager.getLayout();(this.child==null||this.child.getNodes().length==0)&&(this.moveBy(this.displacementX,this.displacementY),V.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},B.prototype.setPred1=function(V){this.pred1=V},B.prototype.getPred1=function(){return pred1},B.prototype.getPred2=function(){return pred2},B.prototype.setNext=function(V){this.next=V},B.prototype.getNext=function(){return next},B.prototype.setProcessed=function(V){this.processed=V},B.prototype.isProcessed=function(){return processed},Q.exports=B}),902:((Q,ge,A)=>{function L(q){if(Array.isArray(q)){for(var d=0,re=Array(q.length);d<q.length;d++)re[d]=q[d];return re}else return Array.from(q)}var G=A(806),B=A(551).LinkedList,Z=A(551).Matrix,V=A(551).SVD;function W(){}W.handleConstraints=function(q){var d={};d.fixedNodeConstraint=q.constraints.fixedNodeConstraint,d.alignmentConstraint=q.constraints.alignmentConstraint,d.relativePlacementConstraint=q.constraints.relativePlacementConstraint;for(var re=new Map,u=new Map,x=[],Y=[],Ce=q.getAllNodes(),xe=0,Re=0;Re<Ce.length;Re++){var ce=Ce[Re];ce.getChild()==null&&(u.set(ce.id,xe++),x.push(ce.getCenterX()),Y.push(ce.getCenterY()),re.set(ce.id,ce))}d.relativePlacementConstraint&&d.relativePlacementConstraint.forEach(function(l){!l.gap&&l.gap!=0&&(l.left?l.gap=G.DEFAULT_EDGE_LENGTH+re.get(l.left).getWidth()/2+re.get(l.right).getWidth()/2:l.gap=G.DEFAULT_EDGE_LENGTH+re.get(l.top).getHeight()/2+re.get(l.bottom).getHeight()/2)});var Ue=function(p,w){return{x:p.x-w.x,y:p.y-w.y}},Me=function(p){var w=0,P=0;return p.forEach(function(M){w+=x[u.get(M)],P+=Y[u.get(M)]}),{x:w/p.size,y:P/p.size}},T=function(p,w,P,M,b){function ee(X,F){var K=new Set(X),R=!0,O=!1,oe=void 0;try{for(var j=F[Symbol.iterator](),fe;!(R=(fe=j.next()).done);R=!0){var pe=fe.value;K.add(pe)}}catch(ve){O=!0,oe=ve}finally{try{!R&&j.return&&j.return()}finally{if(O)throw oe}}return K}var _=new Map;p.forEach(function(X,F){_.set(F,0)}),p.forEach(function(X,F){X.forEach(function(K){_.set(K.id,_.get(K.id)+1)})});var D=new Map,z=new Map,k=new B;_.forEach(function(X,F){X==0?(k.push(F),P||(w=="horizontal"?D.set(F,u.has(F)?x[u.get(F)]:M.get(F)):D.set(F,u.has(F)?Y[u.get(F)]:M.get(F)))):D.set(F,Number.NEGATIVE_INFINITY),P&&z.set(F,new Set([F]))}),P&&b.forEach(function(X){var F=[];if(X.forEach(function(O){P.has(O)&&F.push(O)}),F.length>0){var K=0;F.forEach(function(O){w=="horizontal"?(D.set(O,u.has(O)?x[u.get(O)]:M.get(O)),K+=D.get(O)):(D.set(O,u.has(O)?Y[u.get(O)]:M.get(O)),K+=D.get(O))}),K=K/F.length,X.forEach(function(O){P.has(O)||D.set(O,K)})}else{var R=0;X.forEach(function(O){w=="horizontal"?R+=u.has(O)?x[u.get(O)]:M.get(O):R+=u.has(O)?Y[u.get(O)]:M.get(O)}),R=R/X.length,X.forEach(function(O){D.set(O,R)})}});for(var ne=function(){var F=k.shift(),K=p.get(F);K.forEach(function(R){if(D.get(R.id)<D.get(F)+R.gap)if(P&&P.has(R.id)){var O=void 0;if(w=="horizontal"?O=u.has(R.id)?x[u.get(R.id)]:M.get(R.id):O=u.has(R.id)?Y[u.get(R.id)]:M.get(R.id),D.set(R.id,O),O<D.get(F)+R.gap){var oe=D.get(F)+R.gap-O;z.get(F).forEach(function(j){D.set(j,D.get(j)-oe)})}}else D.set(R.id,D.get(F)+R.gap);_.set(R.id,_.get(R.id)-1),_.get(R.id)==0&&k.push(R.id),P&&z.set(R.id,ee(z.get(F),z.get(R.id)))})};k.length!=0;)ne();if(P){var $=new Set;p.forEach(function(X,F){X.length==0&&$.add(F)});var ue=[];z.forEach(function(X,F){if($.has(F)){var K=!1,R=!0,O=!1,oe=void 0;try{for(var j=X[Symbol.iterator](),fe;!(R=(fe=j.next()).done);R=!0){var pe=fe.value;P.has(pe)&&(K=!0)}}catch(ae){O=!0,oe=ae}finally{try{!R&&j.return&&j.return()}finally{if(O)throw oe}}if(!K){var ve=!1,Te=void 0;ue.forEach(function(ae,de){ae.has([].concat(L(X))[0])&&(ve=!0,Te=de)}),ve?X.forEach(function(ae){ue[Te].add(ae)}):ue.push(new Set(X))}}}),ue.forEach(function(X,F){var K=Number.POSITIVE_INFINITY,R=Number.POSITIVE_INFINITY,O=Number.NEGATIVE_INFINITY,oe=Number.NEGATIVE_INFINITY,j=!0,fe=!1,pe=void 0;try{for(var ve=X[Symbol.iterator](),Te;!(j=(Te=ve.next()).done);j=!0){var ae=Te.value,de=void 0;w=="horizontal"?de=u.has(ae)?x[u.get(ae)]:M.get(ae):de=u.has(ae)?Y[u.get(ae)]:M.get(ae);var Le=D.get(ae);de<K&&(K=de),de>O&&(O=de),Le<R&&(R=Le),Le>oe&&(oe=Le)}}catch(De){fe=!0,pe=De}finally{try{!j&&ve.return&&ve.return()}finally{if(fe)throw pe}}var ze=(K+O)/2-(R+oe)/2,Ee=!0,Pe=!1,Fe=void 0;try{for(var me=X[Symbol.iterator](),Ve;!(Ee=(Ve=me.next()).done);Ee=!0){var Oe=Ve.value;D.set(Oe,D.get(Oe)+ze)}}catch(De){Pe=!0,Fe=De}finally{try{!Ee&&me.return&&me.return()}finally{if(Pe)throw Fe}}})}return D},ye=function(p){var w=0,P=0,M=0,b=0;if(p.forEach(function(z){z.left?x[u.get(z.left)]-x[u.get(z.right)]>=0?w++:P++:Y[u.get(z.top)]-Y[u.get(z.bottom)]>=0?M++:b++}),w>P&&M>b)for(var ee=0;ee<u.size;ee++)x[ee]=-1*x[ee],Y[ee]=-1*Y[ee];else if(w>P)for(var _=0;_<u.size;_++)x[_]=-1*x[_];else if(M>b)for(var D=0;D<u.size;D++)Y[D]=-1*Y[D]},e=function(p){var w=[],P=new B,M=new Set,b=0;return p.forEach(function(ee,_){if(!M.has(_)){w[b]=[];var D=_;for(P.push(D),M.add(D),w[b].push(D);P.length!=0;){D=P.shift();var z=p.get(D);z.forEach(function(k){M.has(k.id)||(P.push(k.id),M.add(k.id),w[b].push(k.id))})}b++}}),w},a=function(p){var w=new Map;return p.forEach(function(P,M){w.set(M,[])}),p.forEach(function(P,M){P.forEach(function(b){w.get(M).push(b),w.get(b.id).push({id:M,gap:b.gap,direction:b.direction})})}),w},t=function(p){var w=new Map;return p.forEach(function(P,M){w.set(M,[])}),p.forEach(function(P,M){P.forEach(function(b){w.get(b.id).push({id:M,gap:b.gap,direction:b.direction})})}),w},i=[],r=[],n=!1,o=!1,h=new Set,c=new Map,v=new Map,S=[];if(d.fixedNodeConstraint&&d.fixedNodeConstraint.forEach(function(l){h.add(l.nodeId)}),d.relativePlacementConstraint&&(d.relativePlacementConstraint.forEach(function(l){l.left?(c.has(l.left)?c.get(l.left).push({id:l.right,gap:l.gap,direction:"horizontal"}):c.set(l.left,[{id:l.right,gap:l.gap,direction:"horizontal"}]),c.has(l.right)||c.set(l.right,[])):(c.has(l.top)?c.get(l.top).push({id:l.bottom,gap:l.gap,direction:"vertical"}):c.set(l.top,[{id:l.bottom,gap:l.gap,direction:"vertical"}]),c.has(l.bottom)||c.set(l.bottom,[]))}),v=a(c),S=e(v)),G.TRANSFORM_ON_CONSTRAINT_HANDLING){if(d.fixedNodeConstraint&&d.fixedNodeConstraint.length>1)d.fixedNodeConstraint.forEach(function(l,p){i[p]=[l.position.x,l.position.y],r[p]=[x[u.get(l.nodeId)],Y[u.get(l.nodeId)]]}),n=!0;else if(d.alignmentConstraint)(function(){var l=0;if(d.alignmentConstraint.vertical){for(var p=d.alignmentConstraint.vertical,w=function(D){var z=new Set;p[D].forEach(function($){z.add($)});var k=new Set([].concat(L(z)).filter(function($){return h.has($)})),ne=void 0;k.size>0?ne=x[u.get(k.values().next().value)]:ne=Me(z).x,p[D].forEach(function($){i[l]=[ne,Y[u.get($)]],r[l]=[x[u.get($)],Y[u.get($)]],l++})},P=0;P<p.length;P++)w(P);n=!0}if(d.alignmentConstraint.horizontal){for(var M=d.alignmentConstraint.horizontal,b=function(D){var z=new Set;M[D].forEach(function($){z.add($)});var k=new Set([].concat(L(z)).filter(function($){return h.has($)})),ne=void 0;k.size>0?ne=x[u.get(k.values().next().value)]:ne=Me(z).y,M[D].forEach(function($){i[l]=[x[u.get($)],ne],r[l]=[x[u.get($)],Y[u.get($)]],l++})},ee=0;ee<M.length;ee++)b(ee);n=!0}d.relativePlacementConstraint&&(o=!0)})();else if(d.relativePlacementConstraint){for(var E=0,g=0,C=0;C<S.length;C++)S[C].length>E&&(E=S[C].length,g=C);if(E<v.size/2)ye(d.relativePlacementConstraint),n=!1,o=!1;else{var N=new Map,s=new Map,f=[];S[g].forEach(function(l){c.get(l).forEach(function(p){p.direction=="horizontal"?(N.has(l)?N.get(l).push(p):N.set(l,[p]),N.has(p.id)||N.set(p.id,[]),f.push({left:l,right:p.id})):(s.has(l)?s.get(l).push(p):s.set(l,[p]),s.has(p.id)||s.set(p.id,[]),f.push({top:l,bottom:p.id}))})}),ye(f),o=!1;var m=T(N,"horizontal"),y=T(s,"vertical");S[g].forEach(function(l,p){r[p]=[x[u.get(l)],Y[u.get(l)]],i[p]=[],m.has(l)?i[p][0]=m.get(l):i[p][0]=x[u.get(l)],y.has(l)?i[p][1]=y.get(l):i[p][1]=Y[u.get(l)]}),n=!0}}if(n){for(var U=void 0,J=Z.transpose(i),he=Z.transpose(r),ie=0;ie<J.length;ie++)J[ie]=Z.multGamma(J[ie]),he[ie]=Z.multGamma(he[ie]);var be=Z.multMat(J,Z.transpose(he)),Se=V.svd(be);U=Z.multMat(Se.V,Z.transpose(Se.U));for(var se=0;se<u.size;se++){var Ge=[x[se],Y[se]],we=[U[0][0],U[1][0]],lt=[U[0][1],U[1][1]];x[se]=Z.dotProduct(Ge,we),Y[se]=Z.dotProduct(Ge,lt)}o&&ye(d.relativePlacementConstraint)}}if(G.ENFORCE_CONSTRAINTS){if(d.fixedNodeConstraint&&d.fixedNodeConstraint.length>0){var Ae={x:0,y:0};d.fixedNodeConstraint.forEach(function(l,p){var w={x:x[u.get(l.nodeId)],y:Y[u.get(l.nodeId)]},P=l.position,M=Ue(P,w);Ae.x+=M.x,Ae.y+=M.y}),Ae.x/=d.fixedNodeConstraint.length,Ae.y/=d.fixedNodeConstraint.length,x.forEach(function(l,p){x[p]+=Ae.x}),Y.forEach(function(l,p){Y[p]+=Ae.y}),d.fixedNodeConstraint.forEach(function(l){x[u.get(l.nodeId)]=l.position.x,Y[u.get(l.nodeId)]=l.position.y})}if(d.alignmentConstraint){if(d.alignmentConstraint.vertical)for(var je=d.alignmentConstraint.vertical,ht=function(p){var w=new Set;je[p].forEach(function(b){w.add(b)});var P=new Set([].concat(L(w)).filter(function(b){return h.has(b)})),M=void 0;P.size>0?M=x[u.get(P.values().next().value)]:M=Me(w).x,w.forEach(function(b){h.has(b)||(x[u.get(b)]=M)})},Xe=0;Xe<je.length;Xe++)ht(Xe);if(d.alignmentConstraint.horizontal)for(var qe=d.alignmentConstraint.horizontal,ft=function(p){var w=new Set;qe[p].forEach(function(b){w.add(b)});var P=new Set([].concat(L(w)).filter(function(b){return h.has(b)})),M=void 0;P.size>0?M=Y[u.get(P.values().next().value)]:M=Me(w).y,w.forEach(function(b){h.has(b)||(Y[u.get(b)]=M)})},Be=0;Be<qe.length;Be++)ft(Be)}d.relativePlacementConstraint&&(function(){var l=new Map,p=new Map,w=new Map,P=new Map,M=new Map,b=new Map,ee=new Set,_=new Set;if(h.forEach(function(te){ee.add(te),_.add(te)}),d.alignmentConstraint){if(d.alignmentConstraint.vertical)for(var D=d.alignmentConstraint.vertical,z=function(H){w.set("dummy"+H,[]),D[H].forEach(function(I){l.set(I,"dummy"+H),w.get("dummy"+H).push(I),h.has(I)&&ee.add("dummy"+H)}),M.set("dummy"+H,x[u.get(D[H][0])])},k=0;k<D.length;k++)z(k);if(d.alignmentConstraint.horizontal)for(var ne=d.alignmentConstraint.horizontal,$=function(H){P.set("dummy"+H,[]),ne[H].forEach(function(I){p.set(I,"dummy"+H),P.get("dummy"+H).push(I),h.has(I)&&_.add("dummy"+H)}),b.set("dummy"+H,Y[u.get(ne[H][0])])},ue=0;ue<ne.length;ue++)$(ue)}var X=new Map,F=new Map,K=function(H){c.get(H).forEach(function(I){var Ne=void 0,le=void 0;I.direction=="horizontal"?(Ne=l.get(H)?l.get(H):H,l.get(I.id)?le={id:l.get(I.id),gap:I.gap,direction:I.direction}:le=I,X.has(Ne)?X.get(Ne).push(le):X.set(Ne,[le]),X.has(le.id)||X.set(le.id,[])):(Ne=p.get(H)?p.get(H):H,p.get(I.id)?le={id:p.get(I.id),gap:I.gap,direction:I.direction}:le=I,F.has(Ne)?F.get(Ne).push(le):F.set(Ne,[le]),F.has(le.id)||F.set(le.id,[]))})},R=!0,O=!1,oe=void 0;try{for(var j=c.keys()[Symbol.iterator](),fe;!(R=(fe=j.next()).done);R=!0){var pe=fe.value;K(pe)}}catch(te){O=!0,oe=te}finally{try{!R&&j.return&&j.return()}finally{if(O)throw oe}}var ve=a(X),Te=a(F),ae=e(ve),de=e(Te),Le=t(X),ze=t(F),Ee=[],Pe=[];ae.forEach(function(te,H){Ee[H]=[],te.forEach(function(I){Le.get(I).length==0&&Ee[H].push(I)})}),de.forEach(function(te,H){Pe[H]=[],te.forEach(function(I){ze.get(I).length==0&&Pe[H].push(I)})});var Fe=T(X,"horizontal",ee,M,Ee),me=T(F,"vertical",_,b,Pe),Ve=function(H){w.get(H)?w.get(H).forEach(function(I){x[u.get(I)]=Fe.get(H)}):x[u.get(H)]=Fe.get(H)},Oe=!0,De=!1,et=void 0;try{for(var Ze=Fe.keys()[Symbol.iterator](),tt;!(Oe=(tt=Ze.next()).done);Oe=!0){var Ke=tt.value;Ve(Ke)}}catch(te){De=!0,et=te}finally{try{!Oe&&Ze.return&&Ze.return()}finally{if(De)throw et}}var gt=function(H){P.get(H)?P.get(H).forEach(function(I){Y[u.get(I)]=me.get(H)}):Y[u.get(H)]=me.get(H)},Qe=!0,rt=!1,it=void 0;try{for(var _e=me.keys()[Symbol.iterator](),at;!(Qe=(at=_e.next()).done);Qe=!0){var Ke=at.value;gt(Ke)}}catch(te){rt=!0,it=te}finally{try{!Qe&&_e.return&&_e.return()}finally{if(rt)throw it}}})()}for(var Ie=0;Ie<Ce.length;Ie++){var We=Ce[Ie];We.getChild()==null&&We.setCenter(x[u.get(We.id)],Y[u.get(We.id)])}},Q.exports=W}),551:(Q=>{Q.exports=$e})},He={};function ke(Q){var ge=He[Q];if(ge!==void 0)return ge.exports;var A=He[Q]={exports:{}};return Je[Q](A,A.exports,ke),A.exports}var nt=ke(45);return nt})()})})(Ye.__module)),Ye.__module.exports}exports.__require=ct;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Ye=require("../../../../_virtual/cose-base.cjs.js"),vt=require("../layout-base/layout-base.cjs.js");var dt=Ye.__module.exports,ot;function ct(){return ot||(ot=1,(function(st,ut){(function(Je,He){st.exports=He(vt.__require())})(dt,function($e){return(()=>{var Je={45:((Q,ge,A)=>{var L={};L.layoutBase=A(551),L.CoSEConstants=A(806),L.CoSEEdge=A(767),L.CoSEGraph=A(880),L.CoSEGraphManager=A(578),L.CoSELayout=A(765),L.CoSENode=A(991),L.ConstraintHandler=A(902),Q.exports=L}),806:((Q,ge,A)=>{var L=A(551).FDLayoutConstants;function G(){}for(var B in L)G[B]=L[B];G.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,G.DEFAULT_RADIAL_SEPARATION=L.DEFAULT_EDGE_LENGTH,G.DEFAULT_COMPONENT_SEPERATION=60,G.TILE=!0,G.TILING_PADDING_VERTICAL=10,G.TILING_PADDING_HORIZONTAL=10,G.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,G.ENFORCE_CONSTRAINTS=!0,G.APPLY_LAYOUT=!0,G.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,G.TREE_REDUCTION_ON_INCREMENTAL=!0,G.PURE_INCREMENTAL=G.DEFAULT_INCREMENTAL,Q.exports=G}),767:((Q,ge,A)=>{var L=A(551).FDLayoutEdge;function G(Z,V,W){L.call(this,Z,V,W)}G.prototype=Object.create(L.prototype);for(var B in L)G[B]=L[B];Q.exports=G}),880:((Q,ge,A)=>{var L=A(551).LGraph;function G(Z,V,W){L.call(this,Z,V,W)}G.prototype=Object.create(L.prototype);for(var B in L)G[B]=L[B];Q.exports=G}),578:((Q,ge,A)=>{var L=A(551).LGraphManager;function G(Z){L.call(this,Z)}G.prototype=Object.create(L.prototype);for(var B in L)G[B]=L[B];Q.exports=G}),765:((Q,ge,A)=>{var L=A(551).FDLayout,G=A(578),B=A(880),Z=A(991),V=A(767),W=A(806),q=A(902),d=A(551).FDLayoutConstants,re=A(551).LayoutConstants,u=A(551).Point,x=A(551).PointD,Y=A(551).DimensionD,Ce=A(551).Layout,xe=A(551).Integer,Re=A(551).IGeometry,ce=A(551).LGraph,Ue=A(551).Transform,Me=A(551).LinkedList;function T(){L.call(this),this.toBeTiled={},this.constraints={}}T.prototype=Object.create(L.prototype);for(var ye in L)T[ye]=L[ye];T.prototype.newGraphManager=function(){var e=new G(this);return this.graphManager=e,e},T.prototype.newGraph=function(e){return new B(null,this.graphManager,e)},T.prototype.newNode=function(e){return new Z(this.graphManager,e)},T.prototype.newEdge=function(e){return new V(null,null,e)},T.prototype.initParameters=function(){L.prototype.initParameters.call(this,arguments),this.isSubLayout||(W.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=W.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=W.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=d.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=d.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=d.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=d.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},T.prototype.initSpringEmbedder=function(){L.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/d.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},T.prototype.layout=function(){var e=re.DEFAULT_CREATE_BENDS_AS_NEEDED;return e&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},T.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(W.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var a=new Set(this.getAllNodes()),t=this.nodesWithGravity.filter(function(n){return a.has(n)});this.graphManager.setAllNodesToApplyGravitation(t)}}else{var e=this.getFlatForest();if(e.length>0)this.positionNodesRadially(e);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var a=new Set(this.getAllNodes()),t=this.nodesWithGravity.filter(function(i){return a.has(i)});this.graphManager.setAllNodesToApplyGravitation(t),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(q.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),W.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},T.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%d.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 e=new Set(this.getAllNodes()),a=this.nodesWithGravity.filter(function(r){return e.has(r)});this.graphManager.setAllNodesToApplyGravitation(a),this.graphManager.updateBounds(),this.updateGrid(),W.PURE_INCREMENTAL?this.coolingFactor=d.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=d.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()),W.PURE_INCREMENTAL?this.coolingFactor=d.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=d.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var t=!this.isTreeGrowing&&!this.isGrowthFinished,i=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(t,i),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},T.prototype.getPositionsData=function(){for(var e=this.graphManager.getAllNodes(),a={},t=0;t<e.length;t++){var i=e[t].rect,r=e[t].id;a[r]={id:r,x:i.getCenterX(),y:i.getCenterY(),w:i.width,h:i.height}}return a},T.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var e=!1;if(d.ANIMATE==="during")this.emit("layoutstarted");else{for(;!e;)e=this.tick();this.graphManager.updateBounds()}},T.prototype.moveNodes=function(){for(var e=this.getAllNodes(),a,t=0;t<e.length;t++)a=e[t],a.calculateDisplacement();Object.keys(this.constraints).length>0&&this.updateDisplacements();for(var t=0;t<e.length;t++)a=e[t],a.move()},T.prototype.initConstraintVariables=function(){var e=this;this.idToNodeMap=new Map,this.fixedNodeSet=new Set;for(var a=this.graphManager.getAllNodes(),t=0;t<a.length;t++){var i=a[t];this.idToNodeMap.set(i.id,i)}var r=function s(f){for(var m=f.getChild().getNodes(),y,U=0,J=0;J<m.length;J++)y=m[J],y.getChild()==null?e.fixedNodeSet.has(y.id)&&(U+=100):U+=s(y);return U};if(this.constraints.fixedNodeConstraint){this.constraints.fixedNodeConstraint.forEach(function(m){e.fixedNodeSet.add(m.nodeId)});for(var a=this.graphManager.getAllNodes(),i,t=0;t<a.length;t++)if(i=a[t],i.getChild()!=null){var n=r(i);n>0&&(i.fixedNodeWeight=n)}}if(this.constraints.relativePlacementConstraint){var o=new Map,h=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(s){e.fixedNodesOnHorizontal.add(s),e.fixedNodesOnVertical.add(s)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var c=this.constraints.alignmentConstraint.vertical,t=0;t<c.length;t++)this.dummyToNodeForVerticalAlignment.set("dummy"+t,[]),c[t].forEach(function(f){o.set(f,"dummy"+t),e.dummyToNodeForVerticalAlignment.get("dummy"+t).push(f),e.fixedNodeSet.has(f)&&e.fixedNodesOnHorizontal.add("dummy"+t)});if(this.constraints.alignmentConstraint.horizontal)for(var v=this.constraints.alignmentConstraint.horizontal,t=0;t<v.length;t++)this.dummyToNodeForHorizontalAlignment.set("dummy"+t,[]),v[t].forEach(function(f){h.set(f,"dummy"+t),e.dummyToNodeForHorizontalAlignment.get("dummy"+t).push(f),e.fixedNodeSet.has(f)&&e.fixedNodesOnVertical.add("dummy"+t)})}if(W.RELAX_MOVEMENT_ON_CONSTRAINTS)this.shuffle=function(s){var f,m,y;for(y=s.length-1;y>=2*s.length/3;y--)f=Math.floor(Math.random()*(y+1)),m=s[y],s[y]=s[f],s[f]=m;return s},this.nodesInRelativeHorizontal=[],this.nodesInRelativeVertical=[],this.nodeToRelativeConstraintMapHorizontal=new Map,this.nodeToRelativeConstraintMapVertical=new Map,this.nodeToTempPositionMapHorizontal=new Map,this.nodeToTempPositionMapVertical=new Map,this.constraints.relativePlacementConstraint.forEach(function(s){if(s.left){var f=o.has(s.left)?o.get(s.left):s.left,m=o.has(s.right)?o.get(s.right):s.right;e.nodesInRelativeHorizontal.includes(f)||(e.nodesInRelativeHorizontal.push(f),e.nodeToRelativeConstraintMapHorizontal.set(f,[]),e.dummyToNodeForVerticalAlignment.has(f)?e.nodeToTempPositionMapHorizontal.set(f,e.idToNodeMap.get(e.dummyToNodeForVerticalAlignment.get(f)[0]).getCenterX()):e.nodeToTempPositionMapHorizontal.set(f,e.idToNodeMap.get(f).getCenterX())),e.nodesInRelativeHorizontal.includes(m)||(e.nodesInRelativeHorizontal.push(m),e.nodeToRelativeConstraintMapHorizontal.set(m,[]),e.dummyToNodeForVerticalAlignment.has(m)?e.nodeToTempPositionMapHorizontal.set(m,e.idToNodeMap.get(e.dummyToNodeForVerticalAlignment.get(m)[0]).getCenterX()):e.nodeToTempPositionMapHorizontal.set(m,e.idToNodeMap.get(m).getCenterX())),e.nodeToRelativeConstraintMapHorizontal.get(f).push({right:m,gap:s.gap}),e.nodeToRelativeConstraintMapHorizontal.get(m).push({left:f,gap:s.gap})}else{var y=h.has(s.top)?h.get(s.top):s.top,U=h.has(s.bottom)?h.get(s.bottom):s.bottom;e.nodesInRelativeVertical.includes(y)||(e.nodesInRelativeVertical.push(y),e.nodeToRelativeConstraintMapVertical.set(y,[]),e.dummyToNodeForHorizontalAlignment.has(y)?e.nodeToTempPositionMapVertical.set(y,e.idToNodeMap.get(e.dummyToNodeForHorizontalAlignment.get(y)[0]).getCenterY()):e.nodeToTempPositionMapVertical.set(y,e.idToNodeMap.get(y).getCenterY())),e.nodesInRelativeVertical.includes(U)||(e.nodesInRelativeVertical.push(U),e.nodeToRelativeConstraintMapVertical.set(U,[]),e.dummyToNodeForHorizontalAlignment.has(U)?e.nodeToTempPositionMapVertical.set(U,e.idToNodeMap.get(e.dummyToNodeForHorizontalAlignment.get(U)[0]).getCenterY()):e.nodeToTempPositionMapVertical.set(U,e.idToNodeMap.get(U).getCenterY())),e.nodeToRelativeConstraintMapVertical.get(y).push({bottom:U,gap:s.gap}),e.nodeToRelativeConstraintMapVertical.get(U).push({top:y,gap:s.gap})}});else{var S=new Map,E=new Map;this.constraints.relativePlacementConstraint.forEach(function(s){if(s.left){var f=o.has(s.left)?o.get(s.left):s.left,m=o.has(s.right)?o.get(s.right):s.right;S.has(f)?S.get(f).push(m):S.set(f,[m]),S.has(m)?S.get(m).push(f):S.set(m,[f])}else{var y=h.has(s.top)?h.get(s.top):s.top,U=h.has(s.bottom)?h.get(s.bottom):s.bottom;E.has(y)?E.get(y).push(U):E.set(y,[U]),E.has(U)?E.get(U).push(y):E.set(U,[y])}});var g=function(f,m){var y=[],U=[],J=new Me,he=new Set,ie=0;return f.forEach(function(be,Se){if(!he.has(Se)){y[ie]=[],U[ie]=!1;var se=Se;for(J.push(se),he.add(se),y[ie].push(se);J.length!=0;){se=J.shift(),m.has(se)&&(U[ie]=!0);var Ge=f.get(se);Ge.forEach(function(we){he.has(we)||(J.push(we),he.add(we),y[ie].push(we))})}ie++}}),{components:y,isFixed:U}},C=g(S,e.fixedNodesOnHorizontal);this.componentsOnHorizontal=C.components,this.fixedComponentsOnHorizontal=C.isFixed;var N=g(E,e.fixedNodesOnVertical);this.componentsOnVertical=N.components,this.fixedComponentsOnVertical=N.isFixed}}},T.prototype.updateDisplacements=function(){var e=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function(N){var s=e.idToNodeMap.get(N.nodeId);s.displacementX=0,s.displacementY=0}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var a=this.constraints.alignmentConstraint.vertical,t=0;t<a.length;t++){for(var i=0,r=0;r<a[t].length;r++){if(this.fixedNodeSet.has(a[t][r])){i=0;break}i+=this.idToNodeMap.get(a[t][r]).displacementX}for(var n=i/a[t].length,r=0;r<a[t].length;r++)this.idToNodeMap.get(a[t][r]).displacementX=n}if(this.constraints.alignmentConstraint.horizontal)for(var o=this.constraints.alignmentConstraint.horizontal,t=0;t<o.length;t++){for(var h=0,r=0;r<o[t].length;r++){if(this.fixedNodeSet.has(o[t][r])){h=0;break}h+=this.idToNodeMap.get(o[t][r]).displacementY}for(var c=h/o[t].length,r=0;r<o[t].length;r++)this.idToNodeMap.get(o[t][r]).displacementY=c}}if(this.constraints.relativePlacementConstraint)if(W.RELAX_MOVEMENT_ON_CONSTRAINTS)this.totalIterations%10==0&&(this.shuffle(this.nodesInRelativeHorizontal),this.shuffle(this.nodesInRelativeVertical)),this.nodesInRelativeHorizontal.forEach(function(N){if(!e.fixedNodesOnHorizontal.has(N)){var s=0;e.dummyToNodeForVerticalAlignment.has(N)?s=e.idToNodeMap.get(e.dummyToNodeForVerticalAlignment.get(N)[0]).displacementX:s=e.idToNodeMap.get(N).displacementX,e.nodeToRelativeConstraintMapHorizontal.get(N).forEach(function(f){if(f.right){var m=e.nodeToTempPositionMapHorizontal.get(f.right)-e.nodeToTempPositionMapHorizontal.get(N)-s;m<f.gap&&(s-=f.gap-m)}else{var m=e.nodeToTempPositionMapHorizontal.get(N)-e.nodeToTempPositionMapHorizontal.get(f.left)+s;m<f.gap&&(s+=f.gap-m)}}),e.nodeToTempPositionMapHorizontal.set(N,e.nodeToTempPositionMapHorizontal.get(N)+s),e.dummyToNodeForVerticalAlignment.has(N)?e.dummyToNodeForVerticalAlignment.get(N).forEach(function(f){e.idToNodeMap.get(f).displacementX=s}):e.idToNodeMap.get(N).displacementX=s}}),this.nodesInRelativeVertical.forEach(function(N){if(!e.fixedNodesOnHorizontal.has(N)){var s=0;e.dummyToNodeForHorizontalAlignment.has(N)?s=e.idToNodeMap.get(e.dummyToNodeForHorizontalAlignment.get(N)[0]).displacementY:s=e.idToNodeMap.get(N).displacementY,e.nodeToRelativeConstraintMapVertical.get(N).forEach(function(f){if(f.bottom){var m=e.nodeToTempPositionMapVertical.get(f.bottom)-e.nodeToTempPositionMapVertical.get(N)-s;m<f.gap&&(s-=f.gap-m)}else{var m=e.nodeToTempPositionMapVertical.get(N)-e.nodeToTempPositionMapVertical.get(f.top)+s;m<f.gap&&(s+=f.gap-m)}}),e.nodeToTempPositionMapVertical.set(N,e.nodeToTempPositionMapVertical.get(N)+s),e.dummyToNodeForHorizontalAlignment.has(N)?e.dummyToNodeForHorizontalAlignment.get(N).forEach(function(f){e.idToNodeMap.get(f).displacementY=s}):e.idToNodeMap.get(N).displacementY=s}});else{for(var t=0;t<this.componentsOnHorizontal.length;t++){var v=this.componentsOnHorizontal[t];if(this.fixedComponentsOnHorizontal[t])for(var r=0;r<v.length;r++)this.dummyToNodeForVerticalAlignment.has(v[r])?this.dummyToNodeForVerticalAlignment.get(v[r]).forEach(function(f){e.idToNodeMap.get(f).displacementX=0}):this.idToNodeMap.get(v[r]).displacementX=0;else{for(var S=0,E=0,r=0;r<v.length;r++)if(this.dummyToNodeForVerticalAlignment.has(v[r])){var g=this.dummyToNodeForVerticalAlignment.get(v[r]);S+=g.length*this.idToNodeMap.get(g[0]).displacementX,E+=g.length}else S+=this.idToNodeMap.get(v[r]).displacementX,E++;for(var C=S/E,r=0;r<v.length;r++)this.dummyToNodeForVerticalAlignment.has(v[r])?this.dummyToNodeForVerticalAlignment.get(v[r]).forEach(function(f){e.idToNodeMap.get(f).displacementX=C}):this.idToNodeMap.get(v[r]).displacementX=C}}for(var t=0;t<this.componentsOnVertical.length;t++){var v=this.componentsOnVertical[t];if(this.fixedComponentsOnVertical[t])for(var r=0;r<v.length;r++)this.dummyToNodeForHorizontalAlignment.has(v[r])?this.dummyToNodeForHorizontalAlignment.get(v[r]).forEach(function(m){e.idToNodeMap.get(m).displacementY=0}):this.idToNodeMap.get(v[r]).displacementY=0;else{for(var S=0,E=0,r=0;r<v.length;r++)if(this.dummyToNodeForHorizontalAlignment.has(v[r])){var g=this.dummyToNodeForHorizontalAlignment.get(v[r]);S+=g.length*this.idToNodeMap.get(g[0]).displacementY,E+=g.length}else S+=this.idToNodeMap.get(v[r]).displacementY,E++;for(var C=S/E,r=0;r<v.length;r++)this.dummyToNodeForHorizontalAlignment.has(v[r])?this.dummyToNodeForHorizontalAlignment.get(v[r]).forEach(function(J){e.idToNodeMap.get(J).displacementY=C}):this.idToNodeMap.get(v[r]).displacementY=C}}}},T.prototype.calculateNodesToApplyGravitationTo=function(){var e=[],a,t=this.graphManager.getGraphs(),i=t.length,r;for(r=0;r<i;r++)a=t[r],a.updateConnected(),a.isConnected||(e=e.concat(a.getNodes()));return e},T.prototype.createBendpoints=function(){var e=[];e=e.concat(this.graphManager.getAllEdges());var a=new Set,t;for(t=0;t<e.length;t++){var i=e[t];if(!a.has(i)){var r=i.getSource(),n=i.getTarget();if(r==n)i.getBendpoints().push(new x),i.getBendpoints().push(new x),this.createDummyNodesForBendpoints(i),a.add(i);else{var o=[];if(o=o.concat(r.getEdgeListToNode(n)),o=o.concat(n.getEdgeListToNode(r)),!a.has(o[0])){if(o.length>1){var h;for(h=0;h<o.length;h++){var c=o[h];c.getBendpoints().push(new x),this.createDummyNodesForBendpoints(c)}}o.forEach(function(v){a.add(v)})}}}if(a.size==e.length)break}},T.prototype.positionNodesRadially=function(e){for(var a=new u(0,0),t=Math.ceil(Math.sqrt(e.length)),i=0,r=0,n=0,o=new x(0,0),h=0;h<e.length;h++){h%t==0&&(n=0,r=i,h!=0&&(r+=W.DEFAULT_COMPONENT_SEPERATION),i=0);var c=e[h],v=Ce.findCenterOfTree(c);a.x=n,a.y=r,o=T.radialLayout(c,v,a),o.y>i&&(i=Math.floor(o.y)),n=Math.floor(o.x+W.DEFAULT_COMPONENT_SEPERATION)}this.transform(new x(re.WORLD_CENTER_X-o.x/2,re.WORLD_CENTER_Y-o.y/2))},T.radialLayout=function(e,a,t){var i=Math.max(this.maxDiagonalInTree(e),W.DEFAULT_RADIAL_SEPARATION);T.branchRadialLayout(a,null,0,359,0,i);var r=ce.calculateBounds(e),n=new Ue;n.setDeviceOrgX(r.getMinX()),n.setDeviceOrgY(r.getMinY()),n.setWorldOrgX(t.x),n.setWorldOrgY(t.y);for(var o=0;o<e.length;o++){var h=e[o];h.transform(n)}var c=new x(r.getMaxX(),r.getMaxY());return n.inverseTransformPoint(c)},T.branchRadialLayout=function(e,a,t,i,r,n){var o=(i-t+1)/2;o<0&&(o+=180);var h=(o+t)%360,c=h*Re.TWO_PI/360,v=r*Math.cos(c),S=r*Math.sin(c);e.setCenter(v,S);var E=[];E=E.concat(e.getEdges());var g=E.length;a!=null&&g--;for(var C=0,N=E.length,s,f=e.getEdgesBetween(a);f.length>1;){var m=f[0];f.splice(0,1);var y=E.indexOf(m);y>=0&&E.splice(y,1),N--,g--}a!=null?s=(E.indexOf(f[0])+1)%N:s=0;for(var U=Math.abs(i-t)/g,J=s;C!=g;J=++J%N){var he=E[J].getOtherEnd(e);if(he!=a){var ie=(t+C*U)%360,be=(ie+U)%360;T.branchRadialLayout(he,e,ie,be,r+n,n),C++}}},T.maxDiagonalInTree=function(e){for(var a=xe.MIN_VALUE,t=0;t<e.length;t++){var i=e[t],r=i.getDiagonal();r>a&&(a=r)}return a},T.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},T.prototype.groupZeroDegreeMembers=function(){var e=this,a={};this.memberGroups={},this.idToDummyNode={};for(var t=[],i=this.graphManager.getAllNodes(),r=0;r<i.length;r++){var n=i[r],o=n.getParent();this.getNodeDegreeWithChildren(n)===0&&(o.id==null||!this.getToBeTiled(o))&&t.push(n)}for(var r=0;r<t.length;r++){var n=t[r],h=n.getParent().id;typeof a[h]>"u"&&(a[h]=[]),a[h]=a[h].concat(n)}Object.keys(a).forEach(function(c){if(a[c].length>1){var v="DummyCompound_"+c;e.memberGroups[v]=a[c];var S=a[c][0].getParent(),E=new Z(e.graphManager);E.id=v,E.paddingLeft=S.paddingLeft||0,E.paddingRight=S.paddingRight||0,E.paddingBottom=S.paddingBottom||0,E.paddingTop=S.paddingTop||0,e.idToDummyNode[v]=E;var g=e.getGraphManager().add(e.newGraph(),E),C=S.getChild();C.add(E);for(var N=0;N<a[c].length;N++){var s=a[c][N];C.remove(s),g.add(s)}}})},T.prototype.clearCompounds=function(){var e={},a={};this.performDFSOnCompounds();for(var t=0;t<this.compoundOrder.length;t++)a[this.compoundOrder[t].id]=this.compoundOrder[t],e[this.compoundOrder[t].id]=[].concat(this.compoundOrder[t].getChild().getNodes()),this.graphManager.remove(this.compoundOrder[t].getChild()),this.compoundOrder[t].child=null;this.graphManager.resetAllNodes(),this.tileCompoundMembers(e,a)},T.prototype.clearZeroDegreeMembers=function(){var e=this,a=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach(function(t){var i=e.idToDummyNode[t];if(a[t]=e.tileNodes(e.memberGroups[t],i.paddingLeft+i.paddingRight),i.rect.width=a[t].width,i.rect.height=a[t].height,i.setCenter(a[t].centerX,a[t].centerY),i.labelMarginLeft=0,i.labelMarginTop=0,W.NODE_DIMENSIONS_INCLUDE_LABELS){var r=i.rect.width,n=i.rect.height;i.labelWidth&&(i.labelPosHorizontal=="left"?(i.rect.x-=i.labelWidth,i.setWidth(r+i.labelWidth),i.labelMarginLeft=i.labelWidth):i.labelPosHorizontal=="center"&&i.labelWidth>r?(i.rect.x-=(i.labelWidth-r)/2,i.setWidth(i.labelWidth),i.labelMarginLeft=(i.labelWidth-r)/2):i.labelPosHorizontal=="right"&&i.setWidth(r+i.labelWidth)),i.labelHeight&&(i.labelPosVertical=="top"?(i.rect.y-=i.labelHeight,i.setHeight(n+i.labelHeight),i.labelMarginTop=i.labelHeight):i.labelPosVertical=="center"&&i.labelHeight>n?(i.rect.y-=(i.labelHeight-n)/2,i.setHeight(i.labelHeight),i.labelMarginTop=(i.labelHeight-n)/2):i.labelPosVertical=="bottom"&&i.setHeight(n+i.labelHeight))}})},T.prototype.repopulateCompounds=function(){for(var e=this.compoundOrder.length-1;e>=0;e--){var a=this.compoundOrder[e],t=a.id,i=a.paddingLeft,r=a.paddingTop,n=a.labelMarginLeft,o=a.labelMarginTop;this.adjustLocations(this.tiledMemberPack[t],a.rect.x,a.rect.y,i,r,n,o)}},T.prototype.repopulateZeroDegreeMembers=function(){var e=this,a=this.tiledZeroDegreePack;Object.keys(a).forEach(function(t){var i=e.idToDummyNode[t],r=i.paddingLeft,n=i.paddingTop,o=i.labelMarginLeft,h=i.labelMarginTop;e.adjustLocations(a[t],i.rect.x,i.rect.y,r,n,o,h)})},T.prototype.getToBeTiled=function(e){var a=e.id;if(this.toBeTiled[a]!=null)return this.toBeTiled[a];var t=e.getChild();if(t==null)return this.toBeTiled[a]=!1,!1;for(var i=t.getNodes(),r=0;r<i.length;r++){var n=i[r];if(this.getNodeDegree(n)>0)return this.toBeTiled[a]=!1,!1;if(n.getChild()==null){this.toBeTiled[n.id]=!1;continue}if(!this.getToBeTiled(n))return this.toBeTiled[a]=!1,!1}return this.toBeTiled[a]=!0,!0},T.prototype.getNodeDegree=function(e){e.id;for(var a=e.getEdges(),t=0,i=0;i<a.length;i++){var r=a[i];r.getSource().id!==r.getTarget().id&&(t=t+1)}return t},T.prototype.getNodeDegreeWithChildren=function(e){var a=this.getNodeDegree(e);if(e.getChild()==null)return a;for(var t=e.getChild().getNodes(),i=0;i<t.length;i++){var r=t[i];a+=this.getNodeDegreeWithChildren(r)}return a},T.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},T.prototype.fillCompexOrderByDFS=function(e){for(var a=0;a<e.length;a++){var t=e[a];t.getChild()!=null&&this.fillCompexOrderByDFS(t.getChild().getNodes()),this.getToBeTiled(t)&&this.compoundOrder.push(t)}},T.prototype.adjustLocations=function(e,a,t,i,r,n,o){a+=i+n,t+=r+o;for(var h=a,c=0;c<e.rows.length;c++){var v=e.rows[c];a=h;for(var S=0,E=0;E<v.length;E++){var g=v[E];g.rect.x=a,g.rect.y=t,a+=g.rect.width+e.horizontalPadding,g.rect.height>S&&(S=g.rect.height)}t+=S+e.verticalPadding}},T.prototype.tileCompoundMembers=function(e,a){var t=this;this.tiledMemberPack=[],Object.keys(e).forEach(function(i){var r=a[i];if(t.tiledMemberPack[i]=t.tileNodes(e[i],r.paddingLeft+r.paddingRight),r.rect.width=t.tiledMemberPack[i].width,r.rect.height=t.tiledMemberPack[i].height,r.setCenter(t.tiledMemberPack[i].centerX,t.tiledMemberPack[i].centerY),r.labelMarginLeft=0,r.labelMarginTop=0,W.NODE_DIMENSIONS_INCLUDE_LABELS){var n=r.rect.width,o=r.rect.height;r.labelWidth&&(r.labelPosHorizontal=="left"?(r.rect.x-=r.labelWidth,r.setWidth(n+r.labelWidth),r.labelMarginLeft=r.labelWidth):r.labelPosHorizontal=="center"&&r.labelWidth>n?(r.rect.x-=(r.labelWidth-n)/2,r.setWidth(r.labelWidth),r.labelMarginLeft=(r.labelWidth-n)/2):r.labelPosHorizontal=="right"&&r.setWidth(n+r.labelWidth)),r.labelHeight&&(r.labelPosVertical=="top"?(r.rect.y-=r.labelHeight,r.setHeight(o+r.labelHeight),r.labelMarginTop=r.labelHeight):r.labelPosVertical=="center"&&r.labelHeight>o?(r.rect.y-=(r.labelHeight-o)/2,r.setHeight(r.labelHeight),r.labelMarginTop=(r.labelHeight-o)/2):r.labelPosVertical=="bottom"&&r.setHeight(o+r.labelHeight))}})},T.prototype.tileNodes=function(e,a){var t=this.tileNodesByFavoringDim(e,a,!0),i=this.tileNodesByFavoringDim(e,a,!1),r=this.getOrgRatio(t),n=this.getOrgRatio(i),o;return n<r?o=i:o=t,o},T.prototype.getOrgRatio=function(e){var a=e.width,t=e.height,i=a/t;return i<1&&(i=1/i),i},T.prototype.calcIdealRowWidth=function(e,a){var t=W.TILING_PADDING_VERTICAL,i=W.TILING_PADDING_HORIZONTAL,r=e.length,n=0,o=0,h=0;e.forEach(function(N){n+=N.getWidth(),o+=N.getHeight(),N.getWidth()>h&&(h=N.getWidth())});var c=n/r,v=o/r,S=Math.pow(t-i,2)+4*(c+i)*(v+t)*r,E=(i-t+Math.sqrt(S))/(2*(c+i)),g;a?(g=Math.ceil(E),g==E&&g++):g=Math.floor(E);var C=g*(c+i)-i;return h>C&&(C=h),C+=i*2,C},T.prototype.tileNodesByFavoringDim=function(e,a,t){var i=W.TILING_PADDING_VERTICAL,r=W.TILING_PADDING_HORIZONTAL,n=W.TILING_COMPARE_BY,o={rows:[],rowWidth:[],rowHeight:[],width:0,height:a,verticalPadding:i,horizontalPadding:r,centerX:0,centerY:0};n&&(o.idealRowWidth=this.calcIdealRowWidth(e,t));var h=function(s){return s.rect.width*s.rect.height},c=function(s,f){return h(f)-h(s)};e.sort(function(N,s){var f=c;return o.idealRowWidth?(f=n,f(N.id,s.id)):f(N,s)});for(var v=0,S=0,E=0;E<e.length;E++){var g=e[E];v+=g.getCenterX(),S+=g.getCenterY()}o.centerX=v/e.length,o.centerY=S/e.length;for(var E=0;E<e.length;E++){var g=e[E];if(o.rows.length==0)this.insertNodeToRow(o,g,0,a);else if(this.canAddHorizontal(o,g.rect.width,g.rect.height)){var C=o.rows.length-1;o.idealRowWidth||(C=this.getShortestRowIndex(o)),this.insertNodeToRow(o,g,C,a)}else this.insertNodeToRow(o,g,o.rows.length,a);this.shiftToLastRow(o)}return o},T.prototype.insertNodeToRow=function(e,a,t,i){var r=i;if(t==e.rows.length){var n=[];e.rows.push(n),e.rowWidth.push(r),e.rowHeight.push(0)}var o=e.rowWidth[t]+a.rect.width;e.rows[t].length>0&&(o+=e.horizontalPadding),e.rowWidth[t]=o,e.width<o&&(e.width=o);var h=a.rect.height;t>0&&(h+=e.verticalPadding);var c=0;h>e.rowHeight[t]&&(c=e.rowHeight[t],e.rowHeight[t]=h,c=e.rowHeight[t]-c),e.height+=c,e.rows[t].push(a)},T.prototype.getShortestRowIndex=function(e){for(var a=-1,t=Number.MAX_VALUE,i=0;i<e.rows.length;i++)e.rowWidth[i]<t&&(a=i,t=e.rowWidth[i]);return a},T.prototype.getLongestRowIndex=function(e){for(var a=-1,t=Number.MIN_VALUE,i=0;i<e.rows.length;i++)e.rowWidth[i]>t&&(a=i,t=e.rowWidth[i]);return a},T.prototype.canAddHorizontal=function(e,a,t){if(e.idealRowWidth){var i=e.rows.length-1,r=e.rowWidth[i];return r+a+e.horizontalPadding<=e.idealRowWidth}var n=this.getShortestRowIndex(e);if(n<0)return!0;var o=e.rowWidth[n];if(o+e.horizontalPadding+a<=e.width)return!0;var h=0;e.rowHeight[n]<t&&n>0&&(h=t+e.verticalPadding-e.rowHeight[n]);var c;e.width-o>=a+e.horizontalPadding?c=(e.height+h)/(o+a+e.horizontalPadding):c=(e.height+h)/e.width,h=t+e.verticalPadding;var v;return e.width<a?v=(e.height+h)/a:v=(e.height+h)/e.width,v<1&&(v=1/v),c<1&&(c=1/c),c<v},T.prototype.shiftToLastRow=function(e){var a=this.getLongestRowIndex(e),t=e.rowWidth.length-1,i=e.rows[a],r=i[i.length-1],n=r.width+e.horizontalPadding;if(e.width-e.rowWidth[t]>n&&a!=t){i.splice(-1,1),e.rows[t].push(r),e.rowWidth[a]=e.rowWidth[a]-n,e.rowWidth[t]=e.rowWidth[t]+n,e.width=e.rowWidth[instance.getLongestRowIndex(e)];for(var o=Number.MIN_VALUE,h=0;h<i.length;h++)i[h].height>o&&(o=i[h].height);a>0&&(o+=e.verticalPadding);var c=e.rowHeight[a]+e.rowHeight[t];e.rowHeight[a]=o,e.rowHeight[t]<r.height+e.verticalPadding&&(e.rowHeight[t]=r.height+e.verticalPadding);var v=e.rowHeight[a]+e.rowHeight[t];e.height+=v-c,this.shiftToLastRow(e)}},T.prototype.tilingPreLayout=function(){W.TILE&&(this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers())},T.prototype.tilingPostLayout=function(){W.TILE&&(this.repopulateZeroDegreeMembers(),this.repopulateCompounds())},T.prototype.reduceTrees=function(){for(var e=[],a=!0,t;a;){var i=this.graphManager.getAllNodes(),r=[];a=!1;for(var n=0;n<i.length;n++)if(t=i[n],t.getEdges().length==1&&!t.getEdges()[0].isInterGraph&&t.getChild()==null){if(W.PURE_INCREMENTAL){var o=t.getEdges()[0].getOtherEnd(t),h=new Y(t.getCenterX()-o.getCenterX(),t.getCenterY()-o.getCenterY());r.push([t,t.getEdges()[0],t.getOwner(),h])}else r.push([t,t.getEdges()[0],t.getOwner()]);a=!0}if(a==!0){for(var c=[],v=0;v<r.length;v++)r[v][0].getEdges().length==1&&(c.push(r[v]),r[v][0].getOwner().remove(r[v][0]));e.push(c),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=e},T.prototype.growTree=function(e){for(var a=e.length,t=e[a-1],i,r=0;r<t.length;r++)i=t[r],this.findPlaceforPrunedNode(i),i[2].add(i[0]),i[2].add(i[1],i[1].source,i[1].target);e.splice(e.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},T.prototype.findPlaceforPrunedNode=function(e){var a,t,i=e[0];if(i==e[1].source?t=e[1].target:t=e[1].source,W.PURE_INCREMENTAL)i.setCenter(t.getCenterX()+e[3].getWidth(),t.getCenterY()+e[3].getHeight());else{var r=t.startX,n=t.finishX,o=t.startY,h=t.finishY,c=0,v=0,S=0,E=0,g=[c,S,v,E];if(o>0)for(var C=r;C<=n;C++)g[0]+=this.grid[C][o-1].length+this.grid[C][o].length-1;if(n<this.grid.length-1)for(var C=o;C<=h;C++)g[1]+=this.grid[n+1][C].length+this.grid[n][C].length-1;if(h<this.grid[0].length-1)for(var C=r;C<=n;C++)g[2]+=this.grid[C][h+1].length+this.grid[C][h].length-1;if(r>0)for(var C=o;C<=h;C++)g[3]+=this.grid[r-1][C].length+this.grid[r][C].length-1;for(var N=xe.MAX_VALUE,s,f,m=0;m<g.length;m++)g[m]<N?(N=g[m],s=1,f=m):g[m]==N&&s++;if(s==3&&N==0)g[0]==0&&g[1]==0&&g[2]==0?a=1:g[0]==0&&g[1]==0&&g[3]==0?a=0:g[0]==0&&g[2]==0&&g[3]==0?a=3:g[1]==0&&g[2]==0&&g[3]==0&&(a=2);else if(s==2&&N==0){var y=Math.floor(Math.random()*2);g[0]==0&&g[1]==0?y==0?a=0:a=1:g[0]==0&&g[2]==0?y==0?a=0:a=2:g[0]==0&&g[3]==0?y==0?a=0:a=3:g[1]==0&&g[2]==0?y==0?a=1:a=2:g[1]==0&&g[3]==0?y==0?a=1:a=3:y==0?a=2:a=3}else if(s==4&&N==0){var y=Math.floor(Math.random()*4);a=y}else a=f;a==0?i.setCenter(t.getCenterX(),t.getCenterY()-t.getHeight()/2-d.DEFAULT_EDGE_LENGTH-i.getHeight()/2):a==1?i.setCenter(t.getCenterX()+t.getWidth()/2+d.DEFAULT_EDGE_LENGTH+i.getWidth()/2,t.getCenterY()):a==2?i.setCenter(t.getCenterX(),t.getCenterY()+t.getHeight()/2+d.DEFAULT_EDGE_LENGTH+i.getHeight()/2):i.setCenter(t.getCenterX()-t.getWidth()/2-d.DEFAULT_EDGE_LENGTH-i.getWidth()/2,t.getCenterY())}},Q.exports=T}),991:((Q,ge,A)=>{var L=A(551).FDLayoutNode,G=A(551).IMath;function B(V,W,q,d){L.call(this,V,W,q,d)}B.prototype=Object.create(L.prototype);for(var Z in L)B[Z]=L[Z];B.prototype.calculateDisplacement=function(){var V=this.graphManager.getLayout();this.getChild()!=null&&this.fixedNodeWeight?(this.displacementX+=V.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=V.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=V.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=V.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>V.coolingFactor*V.maxNodeDisplacement&&(this.displacementX=V.coolingFactor*V.maxNodeDisplacement*G.sign(this.displacementX)),Math.abs(this.displacementY)>V.coolingFactor*V.maxNodeDisplacement&&(this.displacementY=V.coolingFactor*V.maxNodeDisplacement*G.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},B.prototype.propogateDisplacementToChildren=function(V,W){for(var q=this.getChild().getNodes(),d,re=0;re<q.length;re++)d=q[re],d.getChild()==null?(d.displacementX+=V,d.displacementY+=W):d.propogateDisplacementToChildren(V,W)},B.prototype.move=function(){var V=this.graphManager.getLayout();(this.child==null||this.child.getNodes().length==0)&&(this.moveBy(this.displacementX,this.displacementY),V.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},B.prototype.setPred1=function(V){this.pred1=V},B.prototype.getPred1=function(){return pred1},B.prototype.getPred2=function(){return pred2},B.prototype.setNext=function(V){this.next=V},B.prototype.getNext=function(){return next},B.prototype.setProcessed=function(V){this.processed=V},B.prototype.isProcessed=function(){return processed},Q.exports=B}),902:((Q,ge,A)=>{function L(q){if(Array.isArray(q)){for(var d=0,re=Array(q.length);d<q.length;d++)re[d]=q[d];return re}else return Array.from(q)}var G=A(806),B=A(551).LinkedList,Z=A(551).Matrix,V=A(551).SVD;function W(){}W.handleConstraints=function(q){var d={};d.fixedNodeConstraint=q.constraints.fixedNodeConstraint,d.alignmentConstraint=q.constraints.alignmentConstraint,d.relativePlacementConstraint=q.constraints.relativePlacementConstraint;for(var re=new Map,u=new Map,x=[],Y=[],Ce=q.getAllNodes(),xe=0,Re=0;Re<Ce.length;Re++){var ce=Ce[Re];ce.getChild()==null&&(u.set(ce.id,xe++),x.push(ce.getCenterX()),Y.push(ce.getCenterY()),re.set(ce.id,ce))}d.relativePlacementConstraint&&d.relativePlacementConstraint.forEach(function(l){!l.gap&&l.gap!=0&&(l.left?l.gap=G.DEFAULT_EDGE_LENGTH+re.get(l.left).getWidth()/2+re.get(l.right).getWidth()/2:l.gap=G.DEFAULT_EDGE_LENGTH+re.get(l.top).getHeight()/2+re.get(l.bottom).getHeight()/2)});var Ue=function(p,w){return{x:p.x-w.x,y:p.y-w.y}},Me=function(p){var w=0,P=0;return p.forEach(function(M){w+=x[u.get(M)],P+=Y[u.get(M)]}),{x:w/p.size,y:P/p.size}},T=function(p,w,P,M,b){function ee(X,F){var K=new Set(X),R=!0,O=!1,oe=void 0;try{for(var j=F[Symbol.iterator](),fe;!(R=(fe=j.next()).done);R=!0){var pe=fe.value;K.add(pe)}}catch(ve){O=!0,oe=ve}finally{try{!R&&j.return&&j.return()}finally{if(O)throw oe}}return K}var _=new Map;p.forEach(function(X,F){_.set(F,0)}),p.forEach(function(X,F){X.forEach(function(K){_.set(K.id,_.get(K.id)+1)})});var D=new Map,z=new Map,k=new B;_.forEach(function(X,F){X==0?(k.push(F),P||(w=="horizontal"?D.set(F,u.has(F)?x[u.get(F)]:M.get(F)):D.set(F,u.has(F)?Y[u.get(F)]:M.get(F)))):D.set(F,Number.NEGATIVE_INFINITY),P&&z.set(F,new Set([F]))}),P&&b.forEach(function(X){var F=[];if(X.forEach(function(O){P.has(O)&&F.push(O)}),F.length>0){var K=0;F.forEach(function(O){w=="horizontal"?(D.set(O,u.has(O)?x[u.get(O)]:M.get(O)),K+=D.get(O)):(D.set(O,u.has(O)?Y[u.get(O)]:M.get(O)),K+=D.get(O))}),K=K/F.length,X.forEach(function(O){P.has(O)||D.set(O,K)})}else{var R=0;X.forEach(function(O){w=="horizontal"?R+=u.has(O)?x[u.get(O)]:M.get(O):R+=u.has(O)?Y[u.get(O)]:M.get(O)}),R=R/X.length,X.forEach(function(O){D.set(O,R)})}});for(var ne=function(){var F=k.shift(),K=p.get(F);K.forEach(function(R){if(D.get(R.id)<D.get(F)+R.gap)if(P&&P.has(R.id)){var O=void 0;if(w=="horizontal"?O=u.has(R.id)?x[u.get(R.id)]:M.get(R.id):O=u.has(R.id)?Y[u.get(R.id)]:M.get(R.id),D.set(R.id,O),O<D.get(F)+R.gap){var oe=D.get(F)+R.gap-O;z.get(F).forEach(function(j){D.set(j,D.get(j)-oe)})}}else D.set(R.id,D.get(F)+R.gap);_.set(R.id,_.get(R.id)-1),_.get(R.id)==0&&k.push(R.id),P&&z.set(R.id,ee(z.get(F),z.get(R.id)))})};k.length!=0;)ne();if(P){var $=new Set;p.forEach(function(X,F){X.length==0&&$.add(F)});var ue=[];z.forEach(function(X,F){if($.has(F)){var K=!1,R=!0,O=!1,oe=void 0;try{for(var j=X[Symbol.iterator](),fe;!(R=(fe=j.next()).done);R=!0){var pe=fe.value;P.has(pe)&&(K=!0)}}catch(ae){O=!0,oe=ae}finally{try{!R&&j.return&&j.return()}finally{if(O)throw oe}}if(!K){var ve=!1,Te=void 0;ue.forEach(function(ae,de){ae.has([].concat(L(X))[0])&&(ve=!0,Te=de)}),ve?X.forEach(function(ae){ue[Te].add(ae)}):ue.push(new Set(X))}}}),ue.forEach(function(X,F){var K=Number.POSITIVE_INFINITY,R=Number.POSITIVE_INFINITY,O=Number.NEGATIVE_INFINITY,oe=Number.NEGATIVE_INFINITY,j=!0,fe=!1,pe=void 0;try{for(var ve=X[Symbol.iterator](),Te;!(j=(Te=ve.next()).done);j=!0){var ae=Te.value,de=void 0;w=="horizontal"?de=u.has(ae)?x[u.get(ae)]:M.get(ae):de=u.has(ae)?Y[u.get(ae)]:M.get(ae);var Le=D.get(ae);de<K&&(K=de),de>O&&(O=de),Le<R&&(R=Le),Le>oe&&(oe=Le)}}catch(De){fe=!0,pe=De}finally{try{!j&&ve.return&&ve.return()}finally{if(fe)throw pe}}var ze=(K+O)/2-(R+oe)/2,Ee=!0,Pe=!1,Fe=void 0;try{for(var me=X[Symbol.iterator](),Ve;!(Ee=(Ve=me.next()).done);Ee=!0){var Oe=Ve.value;D.set(Oe,D.get(Oe)+ze)}}catch(De){Pe=!0,Fe=De}finally{try{!Ee&&me.return&&me.return()}finally{if(Pe)throw Fe}}})}return D},ye=function(p){var w=0,P=0,M=0,b=0;if(p.forEach(function(z){z.left?x[u.get(z.left)]-x[u.get(z.right)]>=0?w++:P++:Y[u.get(z.top)]-Y[u.get(z.bottom)]>=0?M++:b++}),w>P&&M>b)for(var ee=0;ee<u.size;ee++)x[ee]=-1*x[ee],Y[ee]=-1*Y[ee];else if(w>P)for(var _=0;_<u.size;_++)x[_]=-1*x[_];else if(M>b)for(var D=0;D<u.size;D++)Y[D]=-1*Y[D]},e=function(p){var w=[],P=new B,M=new Set,b=0;return p.forEach(function(ee,_){if(!M.has(_)){w[b]=[];var D=_;for(P.push(D),M.add(D),w[b].push(D);P.length!=0;){D=P.shift();var z=p.get(D);z.forEach(function(k){M.has(k.id)||(P.push(k.id),M.add(k.id),w[b].push(k.id))})}b++}}),w},a=function(p){var w=new Map;return p.forEach(function(P,M){w.set(M,[])}),p.forEach(function(P,M){P.forEach(function(b){w.get(M).push(b),w.get(b.id).push({id:M,gap:b.gap,direction:b.direction})})}),w},t=function(p){var w=new Map;return p.forEach(function(P,M){w.set(M,[])}),p.forEach(function(P,M){P.forEach(function(b){w.get(b.id).push({id:M,gap:b.gap,direction:b.direction})})}),w},i=[],r=[],n=!1,o=!1,h=new Set,c=new Map,v=new Map,S=[];if(d.fixedNodeConstraint&&d.fixedNodeConstraint.forEach(function(l){h.add(l.nodeId)}),d.relativePlacementConstraint&&(d.relativePlacementConstraint.forEach(function(l){l.left?(c.has(l.left)?c.get(l.left).push({id:l.right,gap:l.gap,direction:"horizontal"}):c.set(l.left,[{id:l.right,gap:l.gap,direction:"horizontal"}]),c.has(l.right)||c.set(l.right,[])):(c.has(l.top)?c.get(l.top).push({id:l.bottom,gap:l.gap,direction:"vertical"}):c.set(l.top,[{id:l.bottom,gap:l.gap,direction:"vertical"}]),c.has(l.bottom)||c.set(l.bottom,[]))}),v=a(c),S=e(v)),G.TRANSFORM_ON_CONSTRAINT_HANDLING){if(d.fixedNodeConstraint&&d.fixedNodeConstraint.length>1)d.fixedNodeConstraint.forEach(function(l,p){i[p]=[l.position.x,l.position.y],r[p]=[x[u.get(l.nodeId)],Y[u.get(l.nodeId)]]}),n=!0;else if(d.alignmentConstraint)(function(){var l=0;if(d.alignmentConstraint.vertical){for(var p=d.alignmentConstraint.vertical,w=function(D){var z=new Set;p[D].forEach(function($){z.add($)});var k=new Set([].concat(L(z)).filter(function($){return h.has($)})),ne=void 0;k.size>0?ne=x[u.get(k.values().next().value)]:ne=Me(z).x,p[D].forEach(function($){i[l]=[ne,Y[u.get($)]],r[l]=[x[u.get($)],Y[u.get($)]],l++})},P=0;P<p.length;P++)w(P);n=!0}if(d.alignmentConstraint.horizontal){for(var M=d.alignmentConstraint.horizontal,b=function(D){var z=new Set;M[D].forEach(function($){z.add($)});var k=new Set([].concat(L(z)).filter(function($){return h.has($)})),ne=void 0;k.size>0?ne=x[u.get(k.values().next().value)]:ne=Me(z).y,M[D].forEach(function($){i[l]=[x[u.get($)],ne],r[l]=[x[u.get($)],Y[u.get($)]],l++})},ee=0;ee<M.length;ee++)b(ee);n=!0}d.relativePlacementConstraint&&(o=!0)})();else if(d.relativePlacementConstraint){for(var E=0,g=0,C=0;C<S.length;C++)S[C].length>E&&(E=S[C].length,g=C);if(E<v.size/2)ye(d.relativePlacementConstraint),n=!1,o=!1;else{var N=new Map,s=new Map,f=[];S[g].forEach(function(l){c.get(l).forEach(function(p){p.direction=="horizontal"?(N.has(l)?N.get(l).push(p):N.set(l,[p]),N.has(p.id)||N.set(p.id,[]),f.push({left:l,right:p.id})):(s.has(l)?s.get(l).push(p):s.set(l,[p]),s.has(p.id)||s.set(p.id,[]),f.push({top:l,bottom:p.id}))})}),ye(f),o=!1;var m=T(N,"horizontal"),y=T(s,"vertical");S[g].forEach(function(l,p){r[p]=[x[u.get(l)],Y[u.get(l)]],i[p]=[],m.has(l)?i[p][0]=m.get(l):i[p][0]=x[u.get(l)],y.has(l)?i[p][1]=y.get(l):i[p][1]=Y[u.get(l)]}),n=!0}}if(n){for(var U=void 0,J=Z.transpose(i),he=Z.transpose(r),ie=0;ie<J.length;ie++)J[ie]=Z.multGamma(J[ie]),he[ie]=Z.multGamma(he[ie]);var be=Z.multMat(J,Z.transpose(he)),Se=V.svd(be);U=Z.multMat(Se.V,Z.transpose(Se.U));for(var se=0;se<u.size;se++){var Ge=[x[se],Y[se]],we=[U[0][0],U[1][0]],lt=[U[0][1],U[1][1]];x[se]=Z.dotProduct(Ge,we),Y[se]=Z.dotProduct(Ge,lt)}o&&ye(d.relativePlacementConstraint)}}if(G.ENFORCE_CONSTRAINTS){if(d.fixedNodeConstraint&&d.fixedNodeConstraint.length>0){var Ae={x:0,y:0};d.fixedNodeConstraint.forEach(function(l,p){var w={x:x[u.get(l.nodeId)],y:Y[u.get(l.nodeId)]},P=l.position,M=Ue(P,w);Ae.x+=M.x,Ae.y+=M.y}),Ae.x/=d.fixedNodeConstraint.length,Ae.y/=d.fixedNodeConstraint.length,x.forEach(function(l,p){x[p]+=Ae.x}),Y.forEach(function(l,p){Y[p]+=Ae.y}),d.fixedNodeConstraint.forEach(function(l){x[u.get(l.nodeId)]=l.position.x,Y[u.get(l.nodeId)]=l.position.y})}if(d.alignmentConstraint){if(d.alignmentConstraint.vertical)for(var je=d.alignmentConstraint.vertical,ht=function(p){var w=new Set;je[p].forEach(function(b){w.add(b)});var P=new Set([].concat(L(w)).filter(function(b){return h.has(b)})),M=void 0;P.size>0?M=x[u.get(P.values().next().value)]:M=Me(w).x,w.forEach(function(b){h.has(b)||(x[u.get(b)]=M)})},Xe=0;Xe<je.length;Xe++)ht(Xe);if(d.alignmentConstraint.horizontal)for(var qe=d.alignmentConstraint.horizontal,ft=function(p){var w=new Set;qe[p].forEach(function(b){w.add(b)});var P=new Set([].concat(L(w)).filter(function(b){return h.has(b)})),M=void 0;P.size>0?M=Y[u.get(P.values().next().value)]:M=Me(w).y,w.forEach(function(b){h.has(b)||(Y[u.get(b)]=M)})},Be=0;Be<qe.length;Be++)ft(Be)}d.relativePlacementConstraint&&(function(){var l=new Map,p=new Map,w=new Map,P=new Map,M=new Map,b=new Map,ee=new Set,_=new Set;if(h.forEach(function(te){ee.add(te),_.add(te)}),d.alignmentConstraint){if(d.alignmentConstraint.vertical)for(var D=d.alignmentConstraint.vertical,z=function(H){w.set("dummy"+H,[]),D[H].forEach(function(I){l.set(I,"dummy"+H),w.get("dummy"+H).push(I),h.has(I)&&ee.add("dummy"+H)}),M.set("dummy"+H,x[u.get(D[H][0])])},k=0;k<D.length;k++)z(k);if(d.alignmentConstraint.horizontal)for(var ne=d.alignmentConstraint.horizontal,$=function(H){P.set("dummy"+H,[]),ne[H].forEach(function(I){p.set(I,"dummy"+H),P.get("dummy"+H).push(I),h.has(I)&&_.add("dummy"+H)}),b.set("dummy"+H,Y[u.get(ne[H][0])])},ue=0;ue<ne.length;ue++)$(ue)}var X=new Map,F=new Map,K=function(H){c.get(H).forEach(function(I){var Ne=void 0,le=void 0;I.direction=="horizontal"?(Ne=l.get(H)?l.get(H):H,l.get(I.id)?le={id:l.get(I.id),gap:I.gap,direction:I.direction}:le=I,X.has(Ne)?X.get(Ne).push(le):X.set(Ne,[le]),X.has(le.id)||X.set(le.id,[])):(Ne=p.get(H)?p.get(H):H,p.get(I.id)?le={id:p.get(I.id),gap:I.gap,direction:I.direction}:le=I,F.has(Ne)?F.get(Ne).push(le):F.set(Ne,[le]),F.has(le.id)||F.set(le.id,[]))})},R=!0,O=!1,oe=void 0;try{for(var j=c.keys()[Symbol.iterator](),fe;!(R=(fe=j.next()).done);R=!0){var pe=fe.value;K(pe)}}catch(te){O=!0,oe=te}finally{try{!R&&j.return&&j.return()}finally{if(O)throw oe}}var ve=a(X),Te=a(F),ae=e(ve),de=e(Te),Le=t(X),ze=t(F),Ee=[],Pe=[];ae.forEach(function(te,H){Ee[H]=[],te.forEach(function(I){Le.get(I).length==0&&Ee[H].push(I)})}),de.forEach(function(te,H){Pe[H]=[],te.forEach(function(I){ze.get(I).length==0&&Pe[H].push(I)})});var Fe=T(X,"horizontal",ee,M,Ee),me=T(F,"vertical",_,b,Pe),Ve=function(H){w.get(H)?w.get(H).forEach(function(I){x[u.get(I)]=Fe.get(H)}):x[u.get(H)]=Fe.get(H)},Oe=!0,De=!1,et=void 0;try{for(var Ze=Fe.keys()[Symbol.iterator](),tt;!(Oe=(tt=Ze.next()).done);Oe=!0){var Ke=tt.value;Ve(Ke)}}catch(te){De=!0,et=te}finally{try{!Oe&&Ze.return&&Ze.return()}finally{if(De)throw et}}var gt=function(H){P.get(H)?P.get(H).forEach(function(I){Y[u.get(I)]=me.get(H)}):Y[u.get(H)]=me.get(H)},Qe=!0,rt=!1,it=void 0;try{for(var _e=me.keys()[Symbol.iterator](),at;!(Qe=(at=_e.next()).done);Qe=!0){var Ke=at.value;gt(Ke)}}catch(te){rt=!0,it=te}finally{try{!Qe&&_e.return&&_e.return()}finally{if(rt)throw it}}})()}for(var Ie=0;Ie<Ce.length;Ie++){var We=Ce[Ie];We.getChild()==null&&We.setCenter(x[u.get(We.id)],Y[u.get(We.id)])}},Q.exports=W}),551:(Q=>{Q.exports=$e})},He={};function ke(Q){var ge=He[Q];if(ge!==void 0)return ge.exports;var A=He[Q]={exports:{}};return Je[Q](A,A.exports,ke),A.exports}var nt=ke(45);return nt})()})})(Ye.__module)),Ye.__module.exports}exports.__require=ct;
|
|
2
2
|
//# sourceMappingURL=cose-base.cjs.js.map
|