(self["webpackChunk_jupyterlab_application_top"]=self["webpackChunk_jupyterlab_application_top"]||[]).push([[5878],{26527:function(t,e,r){(function e(i,n){if(true)t.exports=n(r(41709));else{}})(this,(function(t){return(()=>{"use strict";var e={658:t=>{t.exports=Object.assign!=null?Object.assign.bind(Object):function(t){for(var e=arguments.length,r=Array(e>1?e-1:0),i=1;i{var i=function(){function t(t,e){var r=[];var i=true;var n=false;var o=undefined;try{for(var a=t[Symbol.iterator](),s;!(i=(s=a.next()).done);i=true){r.push(s.value);if(e&&r.length===e)break}}catch(h){n=true;o=h}finally{try{if(!i&&a["return"])a["return"]()}finally{if(n)throw o}}return r}return function(e,r){if(Array.isArray(e)){return e}else if(Symbol.iterator in Object(e)){return t(e,r)}else{throw new TypeError("Invalid attempt to destructure non-iterable instance")}}}();var n=r(140).layoutBase.LinkedList;var o={};o.getTopMostNodes=function(t){var e={};for(var r=0;r0){l.merge(t)}}));for(var c=0;c1){l=s[0];c=l.connectedEdges().length;s.forEach((function(t){if(t.connectedEdges().length0){i.set("dummy"+(i.size+1),g)}}return u};o.relocateComponent=function(t,e,r){if(!r.fixedNodeConstraint){var n=Number.POSITIVE_INFINITY;var o=Number.NEGATIVE_INFINITY;var a=Number.POSITIVE_INFINITY;var s=Number.NEGATIVE_INFINITY;if(r.quality=="draft"){var h=true;var l=false;var c=undefined;try{for(var f=e.nodeIndexes[Symbol.iterator](),d;!(h=(d=f.next()).done);h=true){var g=d.value;var u=i(g,2);var p=u[0];var v=u[1];var y=r.cy.getElementById(p);if(y){var m=y.boundingBox();var E=e.xCoords[v]-m.w/2;var N=e.xCoords[v]+m.w/2;var T=e.yCoords[v]-m.h/2;var A=e.yCoords[v]+m.h/2;if(Eo)o=N;if(Ts)s=A}}}catch(_){l=true;c=_}finally{try{if(!h&&f.return){f.return()}}finally{if(l){throw c}}}var w=t.x-(o+n)/2;var C=t.y-(s+a)/2;e.xCoords=e.xCoords.map((function(t){return t+w}));e.yCoords=e.yCoords.map((function(t){return t+C}))}else{Object.keys(e).forEach((function(t){var r=e[t];var i=r.getRect().x;var h=r.getRect().x+r.getRect().width;var l=r.getRect().y;var c=r.getRect().y+r.getRect().height;if(io)o=h;if(ls)s=c}));var L=t.x-(o+n)/2;var I=t.y-(s+a)/2;Object.keys(e).forEach((function(t){var r=e[t];r.setCenter(r.getCenterX()+L,r.getCenterY()+I)}))}}};o.calcBoundingBox=function(t,e,r,i){var n=Number.MAX_SAFE_INTEGER;var o=Number.MIN_SAFE_INTEGER;var a=Number.MAX_SAFE_INTEGER;var s=Number.MIN_SAFE_INTEGER;var h=void 0;var l=void 0;var c=void 0;var f=void 0;var d=t.descendants().not(":parent");var g=d.length;for(var u=0;uh){n=h}if(oc){a=c}if(s{var i=r(548);var n=r(140).CoSELayout;var o=r(140).CoSENode;var a=r(140).layoutBase.PointD;var s=r(140).layoutBase.DimensionD;var h=r(140).layoutBase.LayoutConstants;var l=r(140).layoutBase.FDLayoutConstants;var c=r(140).CoSEConstants;var f=function t(e,r){var f=e.cy;var d=e.eles;var g=d.nodes();var u=d.edges();var p=void 0;var v=void 0;var y=void 0;var m={};if(e.randomize){p=r["nodeIndexes"];v=r["xCoords"];y=r["yCoords"]}var E=function t(e){return typeof e==="function"};var N=function t(e,r){if(E(e)){return e(r)}else{return e}};var T=i.calcParentsWithoutChildren(f,d);var A=function t(e,r,n,h){var l=r.length;for(var c=0;c0){var A=void 0;A=n.getGraphManager().add(n.newGraph(),g);t(A,d,n,h)}}};var w=function t(r,i,n){var o=0;var a=0;for(var s=0;s0)c.DEFAULT_EDGE_LENGTH=l.DEFAULT_EDGE_LENGTH=o/a;else if(!E(e.idealEdgeLength))c.DEFAULT_EDGE_LENGTH=l.DEFAULT_EDGE_LENGTH=e.idealEdgeLength;else c.DEFAULT_EDGE_LENGTH=l.DEFAULT_EDGE_LENGTH=50;c.MIN_REPULSION_DIST=l.MIN_REPULSION_DIST=l.DEFAULT_EDGE_LENGTH/10;c.DEFAULT_RADIAL_SEPARATION=l.DEFAULT_EDGE_LENGTH}};var C=function t(e,r){if(r.fixedNodeConstraint){e.constraints["fixedNodeConstraint"]=r.fixedNodeConstraint}if(r.alignmentConstraint){e.constraints["alignmentConstraint"]=r.alignmentConstraint}if(r.relativePlacementConstraint){e.constraints["relativePlacementConstraint"]=r.relativePlacementConstraint}};if(e.nestingFactor!=null)c.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=l.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=e.nestingFactor;if(e.gravity!=null)c.DEFAULT_GRAVITY_STRENGTH=l.DEFAULT_GRAVITY_STRENGTH=e.gravity;if(e.numIter!=null)c.MAX_ITERATIONS=l.MAX_ITERATIONS=e.numIter;if(e.gravityRange!=null)c.DEFAULT_GRAVITY_RANGE_FACTOR=l.DEFAULT_GRAVITY_RANGE_FACTOR=e.gravityRange;if(e.gravityCompound!=null)c.DEFAULT_COMPOUND_GRAVITY_STRENGTH=l.DEFAULT_COMPOUND_GRAVITY_STRENGTH=e.gravityCompound;if(e.gravityRangeCompound!=null)c.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=e.gravityRangeCompound;if(e.initialEnergyOnIncremental!=null)c.DEFAULT_COOLING_FACTOR_INCREMENTAL=l.DEFAULT_COOLING_FACTOR_INCREMENTAL=e.initialEnergyOnIncremental;if(e.tilingCompareBy!=null)c.TILING_COMPARE_BY=e.tilingCompareBy;if(e.quality=="proof")h.QUALITY=2;else h.QUALITY=0;c.NODE_DIMENSIONS_INCLUDE_LABELS=l.NODE_DIMENSIONS_INCLUDE_LABELS=h.NODE_DIMENSIONS_INCLUDE_LABELS=e.nodeDimensionsIncludeLabels;c.DEFAULT_INCREMENTAL=l.DEFAULT_INCREMENTAL=h.DEFAULT_INCREMENTAL=!e.randomize;c.ANIMATE=l.ANIMATE=h.ANIMATE=e.animate;c.TILE=e.tile;c.TILING_PADDING_VERTICAL=typeof e.tilingPaddingVertical==="function"?e.tilingPaddingVertical.call():e.tilingPaddingVertical;c.TILING_PADDING_HORIZONTAL=typeof e.tilingPaddingHorizontal==="function"?e.tilingPaddingHorizontal.call():e.tilingPaddingHorizontal;c.DEFAULT_INCREMENTAL=l.DEFAULT_INCREMENTAL=h.DEFAULT_INCREMENTAL=true;c.PURE_INCREMENTAL=!e.randomize;h.DEFAULT_UNIFORM_LEAF_NODE_SIZES=e.uniformNodeDimensions;if(e.step=="transformed"){c.TRANSFORM_ON_CONSTRAINT_HANDLING=true;c.ENFORCE_CONSTRAINTS=false;c.APPLY_LAYOUT=false}if(e.step=="enforced"){c.TRANSFORM_ON_CONSTRAINT_HANDLING=false;c.ENFORCE_CONSTRAINTS=true;c.APPLY_LAYOUT=false}if(e.step=="cose"){c.TRANSFORM_ON_CONSTRAINT_HANDLING=false;c.ENFORCE_CONSTRAINTS=false;c.APPLY_LAYOUT=true}if(e.step=="all"){if(e.randomize)c.TRANSFORM_ON_CONSTRAINT_HANDLING=true;else c.TRANSFORM_ON_CONSTRAINT_HANDLING=false;c.ENFORCE_CONSTRAINTS=true;c.APPLY_LAYOUT=true}if(e.fixedNodeConstraint||e.alignmentConstraint||e.relativePlacementConstraint){c.TREE_REDUCTION_ON_INCREMENTAL=false}else{c.TREE_REDUCTION_ON_INCREMENTAL=true}var t=new n;var L=t.newGraphManager();A(L.addRoot(),i.getTopMostNodes(g),t,e);w(t,L,u);C(t,e);t.runLayout();return m};t.exports={coseLayout:f}},212:(t,e,r)=>{var i=function(){function t(t,e){for(var r=0;r0){if(!v){var y=r.eles.boundingBox();g.push({x:y.x1+y.w/2,y:y.y1+y.h/2});if(r.randomize){var m=h(r);o.push(m)}if(r.quality=="default"||r.quality=="proof"){f.push(c(r,o[0]));a.relocateComponent(g[0],f[0],r)}else{a.relocateComponent(g[0],o[0],r)}}else{var E=a.getTopMostNodes(r.eles.nodes());d=a.connectComponents(i,r.eles,E);d.forEach((function(t){var e=t.boundingBox();g.push({x:e.x1+e.w/2,y:e.y1+e.h/2})}));if(r.randomize){d.forEach((function(t){r.eles=t;o.push(h(r))}))}if(r.quality=="default"||r.quality=="proof"){var N=i.collection();if(r.tile){var T=new Map;var A=[];var w=[];var C=0;var L={nodeIndexes:T,xCoords:A,yCoords:w};var I=[];d.forEach((function(t,e){if(t.edges().length==0){t.nodes().forEach((function(e,r){N.merge(t.nodes()[r]);if(!e.isParent()){L.nodeIndexes.set(t.nodes()[r].id(),C++);L.xCoords.push(t.nodes()[0].position().x);L.yCoords.push(t.nodes()[0].position().y)}}));I.push(e)}}));if(N.length>1){var _=N.boundingBox();g.push({x:_.x1+_.w/2,y:_.y1+_.h/2});d.push(N);o.push(L);for(var M=I.length-1;M>=0;M--){d.splice(I[M],1);o.splice(I[M],1);g.splice(I[M],1)}}}d.forEach((function(t,e){r.eles=t;f.push(c(r,o[e]));a.relocateComponent(g[e],f[e],r)}))}else{d.forEach((function(t,e){a.relocateComponent(g[e],o[e],r)}))}var x=new Set;if(d.length>1){var O=[];var D=n.filter((function(t){return t.css("display")=="none"}));d.forEach((function(t,e){var i=void 0;if(r.quality=="draft"){i=o[e].nodeIndexes}if(t.nodes().not(D).length>0){var n={};n.edges=[];n.nodes=[];var s=void 0;t.nodes().not(D).forEach((function(t){if(r.quality=="draft"){if(!t.isParent()){s=i.get(t.id());n.nodes.push({x:o[e].xCoords[s]-t.boundingbox().w/2,y:o[e].yCoords[s]-t.boundingbox().h/2,width:t.boundingbox().w,height:t.boundingbox().h})}else{var h=a.calcBoundingBox(t,o[e].xCoords,o[e].yCoords,i);n.nodes.push({x:h.topLeftX,y:h.topLeftY,width:h.width,height:h.height})}}else{if(f[e][t.id()]){n.nodes.push({x:f[e][t.id()].getLeft(),y:f[e][t.id()].getTop(),width:f[e][t.id()].getWidth(),height:f[e][t.id()].getHeight()})}}}));t.edges().forEach((function(t){var s=t.source();var h=t.target();if(s.css("display")!="none"&&h.css("display")!="none"){if(r.quality=="draft"){var l=i.get(s.id());var c=i.get(h.id());var d=[];var g=[];if(s.isParent()){var u=a.calcBoundingBox(s,o[e].xCoords,o[e].yCoords,i);d.push(u.topLeftX+u.width/2);d.push(u.topLeftY+u.height/2)}else{d.push(o[e].xCoords[l]);d.push(o[e].yCoords[l])}if(h.isParent()){var p=a.calcBoundingBox(h,o[e].xCoords,o[e].yCoords,i);g.push(p.topLeftX+p.width/2);g.push(p.topLeftY+p.height/2)}else{g.push(o[e].xCoords[c]);g.push(o[e].yCoords[c])}n.edges.push({startX:d[0],startY:d[1],endX:g[0],endY:g[1]})}else{if(f[e][s.id()]&&f[e][h.id()]){n.edges.push({startX:f[e][s.id()].getCenterX(),startY:f[e][s.id()].getCenterY(),endX:f[e][h.id()].getCenterX(),endY:f[e][h.id()].getCenterY()})}}}}));if(n.nodes.length>0){O.push(n);x.add(e)}}}));var b=p.packComponents(O,r.randomize).shifts;if(r.quality=="draft"){o.forEach((function(t,e){var r=t.xCoords.map((function(t){return t+b[e].dx}));var i=t.yCoords.map((function(t){return t+b[e].dy}));t.xCoords=r;t.yCoords=i}))}else{var R=0;x.forEach((function(t){Object.keys(f[t]).forEach((function(e){var r=f[t][e];r.setCenter(r.getCenterX()+b[R].dx,r.getCenterY()+b[R].dy)}));R++}))}}}}var F=function t(e,i){if(r.quality=="default"||r.quality=="proof"){if(typeof e==="number"){e=i}var n=void 0;var a=void 0;var s=e.data("id");f.forEach((function(t){if(s in t){n={x:t[s].getRect().getCenterX(),y:t[s].getRect().getCenterY()};a=t[s]}}));if(r.nodeDimensionsIncludeLabels){if(a.labelWidth){if(a.labelPosHorizontal=="left"){n.x+=a.labelWidth/2}else if(a.labelPosHorizontal=="right"){n.x-=a.labelWidth/2}}if(a.labelHeight){if(a.labelPosVertical=="top"){n.y+=a.labelHeight/2}else if(a.labelPosVertical=="bottom"){n.y-=a.labelHeight/2}}}if(n==undefined)n={x:e.position("x"),y:e.position("y")};return{x:n.x,y:n.y}}else{var h=void 0;o.forEach((function(t){var r=t.nodeIndexes.get(e.id());if(r!=undefined){h={x:t.xCoords[r],y:t.yCoords[r]}}}));if(h==undefined)h={x:e.position("x"),y:e.position("y")};return{x:h.x,y:h.y}}};if(r.quality=="default"||r.quality=="proof"||r.randomize){var G=a.calcParentsWithoutChildren(i,n);var S=n.filter((function(t){return t.css("display")=="none"}));r.eles=n.not(S);n.nodes().not(":parent").not(S).layoutPositions(e,r,F);if(G.length>0){G.forEach((function(t){t.position(F(t))}))}}else{console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}}]);return t}();t.exports=d},657:(t,e,r)=>{var i=r(548);var n=r(140).layoutBase.Matrix;var o=r(140).layoutBase.SVD;var a=function t(e){var r=e.cy;var a=e.eles;var s=a.nodes();var h=a.nodes(":parent");var l=new Map;var c=new Map;var f=new Map;var d=[];var g=[];var u=[];var p=[];var v=[];var y=[];var m=[];var E=[];var N=void 0;var T=void 0;var A=1e8;var w=1e-9;var C=e.piTol;var L=e.samplingType;var I=e.nodeSeparation;var _=void 0;var M=function t(){var e=0;var r=0;var i=false;while(r<_){e=Math.floor(Math.random()*T);i=false;for(var n=0;n=o){s=n[o++];var p=d[s];for(var m=0;mf){f=v[N];g=N}}}return g};var O=function t(e){var r=void 0;if(!e){M();for(var i=0;i<_;i++){x(p[i],i,e,false)}}else{r=Math.floor(Math.random()*T);N=r;for(var n=0;n=1){break}f=c}for(var v=0;v=1){break}f=c}for(var N=0;N0){if(r.isParent())d[e].push(f.get(r.id()));else d[e].push(r.id())}}))}));var X=function t(e){var i=c.get(e);var n=void 0;l.get(e).forEach((function(t){if(r.getElementById(t).isParent())n=f.get(t);else n=t;d[i].push(n);d[c.get(n)].push(e)}))};var z=true;var B=false;var V=undefined;try{for(var W=l.keys()[Symbol.iterator](),j;!(z=(j=W.next()).done);z=true){var q=j.value;X(q)}}catch(nt){B=true;V=nt}finally{try{if(!z&&W.return){W.return()}}finally{if(B){throw V}}}T=c.size;var $=void 0;if(T>2){_=T{var i=r(212);var n=function t(e){if(!e){return}e("layout","fcose",i)};if(typeof cytoscape!=="undefined"){n(cytoscape)}t.exports=n},140:e=>{e.exports=t}};var r={};function i(t){var n=r[t];if(n!==undefined){return n.exports}var o=r[t]={exports:{}};e[t](o,o.exports,i);return o.exports}var n=i(579);return n})()}))},41709:function(t,e,r){(function e(i,n){if(true)t.exports=n(r(1917));else{}})(this,(function(t){return(()=>{"use strict";var e={45:(t,e,r)=>{var i={};i.layoutBase=r(551);i.CoSEConstants=r(806);i.CoSEEdge=r(767);i.CoSEGraph=r(880);i.CoSEGraphManager=r(578);i.CoSELayout=r(765);i.CoSENode=r(991);i.ConstraintHandler=r(902);t.exports=i},806:(t,e,r)=>{var i=r(551).FDLayoutConstants;function n(){}for(var o in i){n[o]=i[o]}n.DEFAULT_USE_MULTI_LEVEL_SCALING=false;n.DEFAULT_RADIAL_SEPARATION=i.DEFAULT_EDGE_LENGTH;n.DEFAULT_COMPONENT_SEPERATION=60;n.TILE=true;n.TILING_PADDING_VERTICAL=10;n.TILING_PADDING_HORIZONTAL=10;n.TRANSFORM_ON_CONSTRAINT_HANDLING=true;n.ENFORCE_CONSTRAINTS=true;n.APPLY_LAYOUT=true;n.RELAX_MOVEMENT_ON_CONSTRAINTS=true;n.TREE_REDUCTION_ON_INCREMENTAL=true;n.PURE_INCREMENTAL=n.DEFAULT_INCREMENTAL;t.exports=n},767:(t,e,r)=>{var i=r(551).FDLayoutEdge;function n(t,e,r){i.call(this,t,e,r)}n.prototype=Object.create(i.prototype);for(var o in i){n[o]=i[o]}t.exports=n},880:(t,e,r)=>{var i=r(551).LGraph;function n(t,e,r){i.call(this,t,e,r)}n.prototype=Object.create(i.prototype);for(var o in i){n[o]=i[o]}t.exports=n},578:(t,e,r)=>{var i=r(551).LGraphManager;function n(t){i.call(this,t)}n.prototype=Object.create(i.prototype);for(var o in i){n[o]=i[o]}t.exports=n},765:(t,e,r)=>{var i=r(551).FDLayout;var n=r(578);var o=r(880);var a=r(991);var s=r(767);var h=r(806);var l=r(902);var c=r(551).FDLayoutConstants;var f=r(551).LayoutConstants;var d=r(551).Point;var g=r(551).PointD;var u=r(551).DimensionD;var p=r(551).Layout;var v=r(551).Integer;var y=r(551).IGeometry;var m=r(551).LGraph;var E=r(551).Transform;var N=r(551).LinkedList;function T(){i.call(this);this.toBeTiled={};this.constraints={}}T.prototype=Object.create(i.prototype);for(var A in i){T[A]=i[A]}T.prototype.newGraphManager=function(){var t=new n(this);this.graphManager=t;return t};T.prototype.newGraph=function(t){return new o(null,this.graphManager,t)};T.prototype.newNode=function(t){return new a(this.graphManager,t)};T.prototype.newEdge=function(t){return new s(null,null,t)};T.prototype.initParameters=function(){i.prototype.initParameters.call(this,arguments);if(!this.isSubLayout){if(h.DEFAULT_EDGE_LENGTH<10){this.idealEdgeLength=10}else{this.idealEdgeLength=h.DEFAULT_EDGE_LENGTH}this.useSmartIdealEdgeLengthCalculation=h.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION;this.gravityConstant=c.DEFAULT_GRAVITY_STRENGTH;this.compoundGravityConstant=c.DEFAULT_COMPOUND_GRAVITY_STRENGTH;this.gravityRangeFactor=c.DEFAULT_GRAVITY_RANGE_FACTOR;this.compoundGravityRangeFactor=c.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR;this.prunedNodesAll=[];this.growTreeIterations=0;this.afterGrowthIterations=0;this.isTreeGrowing=false;this.isGrowthFinished=false}};T.prototype.initSpringEmbedder=function(){i.prototype.initSpringEmbedder.call(this);this.coolingCycle=0;this.maxCoolingCycle=this.maxIterations/c.CONVERGENCE_CHECK_PERIOD;this.finalTemperature=.04;this.coolingAdjuster=1};T.prototype.layout=function(){var t=f.DEFAULT_CREATE_BENDS_AS_NEEDED;if(t){this.createBendpoints();this.graphManager.resetAllEdges()}this.level=0;return this.classicLayout()};T.prototype.classicLayout=function(){this.nodesWithGravity=this.calculateNodesToApplyGravitationTo();this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity);this.calcNoOfChildrenForAllNodes();this.graphManager.calcLowestCommonAncestors();this.graphManager.calcInclusionTreeDepths();this.graphManager.getRoot().calcEstimatedSize();this.calcIdealEdgeLengths();if(!this.incremental){var t=this.getFlatForest();if(t.length>0){this.positionNodesRadially(t)}else{this.reduceTrees();this.graphManager.resetAllNodesToApplyGravitation();var e=new Set(this.getAllNodes());var r=this.nodesWithGravity.filter((function(t){return e.has(t)}));this.graphManager.setAllNodesToApplyGravitation(r);this.positionNodesRandomly()}}else{if(h.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees();this.graphManager.resetAllNodesToApplyGravitation();var e=new Set(this.getAllNodes());var r=this.nodesWithGravity.filter((function(t){return e.has(t)}));this.graphManager.setAllNodesToApplyGravitation(r)}}if(Object.keys(this.constraints).length>0){l.handleConstraints(this);this.initConstraintVariables()}this.initSpringEmbedder();if(h.APPLY_LAYOUT){this.runSpringEmbedder()}return true};T.prototype.tick=function(){this.totalIterations++;if(this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.prunedNodesAll.length>0){this.isTreeGrowing=true}else{return true}}if(this.totalIterations%c.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged()){if(this.prunedNodesAll.length>0){this.isTreeGrowing=true}else{return true}}this.coolingCycle++;if(this.layoutQuality==0){this.coolingAdjuster=this.coolingCycle}else if(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 t=new Set(this.getAllNodes());var e=this.nodesWithGravity.filter((function(e){return t.has(e)}));this.graphManager.setAllNodesToApplyGravitation(e);this.graphManager.updateBounds();this.updateGrid();if(h.PURE_INCREMENTAL)this.coolingFactor=c.DEFAULT_COOLING_FACTOR_INCREMENTAL/2;else this.coolingFactor=c.DEFAULT_COOLING_FACTOR_INCREMENTAL}else{this.isTreeGrowing=false;this.isGrowthFinished=true}}this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged()){return true}if(this.afterGrowthIterations%10==0){this.graphManager.updateBounds();this.updateGrid()}if(h.PURE_INCREMENTAL)this.coolingFactor=c.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100);else this.coolingFactor=c.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100);this.afterGrowthIterations++}var r=!this.isTreeGrowing&&!this.isGrowthFinished;var i=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;this.totalDisplacement=0;this.graphManager.updateBounds();this.calcSpringForces();this.calcRepulsionForces(r,i);this.calcGravitationalForces();this.moveNodes();this.animate();return false};T.prototype.getPositionsData=function(){var t=this.graphManager.getAllNodes();var e={};for(var r=0;r0){this.updateDisplacements()}for(var r=0;r0){i.fixedNodeWeight=o}}}}if(this.constraints.relativePlacementConstraint){var a=new Map;var s=new Map;this.dummyToNodeForVerticalAlignment=new Map;this.dummyToNodeForHorizontalAlignment=new Map;this.fixedNodesOnHorizontal=new Set;this.fixedNodesOnVertical=new Set;this.fixedNodeSet.forEach((function(e){t.fixedNodesOnHorizontal.add(e);t.fixedNodesOnVertical.add(e)}));if(this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical){var l=this.constraints.alignmentConstraint.vertical;for(var r=0;r=2*t.length/3;i--){e=Math.floor(Math.random()*(i+1));r=t[i];t[i]=t[e];t[e]=r}return t};this.nodesInRelativeHorizontal=[];this.nodesInRelativeVertical=[];this.nodeToRelativeConstraintMapHorizontal=new Map;this.nodeToRelativeConstraintMapVertical=new Map;this.nodeToTempPositionMapHorizontal=new Map;this.nodeToTempPositionMapVertical=new Map;this.constraints.relativePlacementConstraint.forEach((function(e){if(e.left){var r=a.has(e.left)?a.get(e.left):e.left;var i=a.has(e.right)?a.get(e.right):e.right;if(!t.nodesInRelativeHorizontal.includes(r)){t.nodesInRelativeHorizontal.push(r);t.nodeToRelativeConstraintMapHorizontal.set(r,[]);if(t.dummyToNodeForVerticalAlignment.has(r)){t.nodeToTempPositionMapHorizontal.set(r,t.idToNodeMap.get(t.dummyToNodeForVerticalAlignment.get(r)[0]).getCenterX())}else{t.nodeToTempPositionMapHorizontal.set(r,t.idToNodeMap.get(r).getCenterX())}}if(!t.nodesInRelativeHorizontal.includes(i)){t.nodesInRelativeHorizontal.push(i);t.nodeToRelativeConstraintMapHorizontal.set(i,[]);if(t.dummyToNodeForVerticalAlignment.has(i)){t.nodeToTempPositionMapHorizontal.set(i,t.idToNodeMap.get(t.dummyToNodeForVerticalAlignment.get(i)[0]).getCenterX())}else{t.nodeToTempPositionMapHorizontal.set(i,t.idToNodeMap.get(i).getCenterX())}}t.nodeToRelativeConstraintMapHorizontal.get(r).push({right:i,gap:e.gap});t.nodeToRelativeConstraintMapHorizontal.get(i).push({left:r,gap:e.gap})}else{var n=s.has(e.top)?s.get(e.top):e.top;var o=s.has(e.bottom)?s.get(e.bottom):e.bottom;if(!t.nodesInRelativeVertical.includes(n)){t.nodesInRelativeVertical.push(n);t.nodeToRelativeConstraintMapVertical.set(n,[]);if(t.dummyToNodeForHorizontalAlignment.has(n)){t.nodeToTempPositionMapVertical.set(n,t.idToNodeMap.get(t.dummyToNodeForHorizontalAlignment.get(n)[0]).getCenterY())}else{t.nodeToTempPositionMapVertical.set(n,t.idToNodeMap.get(n).getCenterY())}}if(!t.nodesInRelativeVertical.includes(o)){t.nodesInRelativeVertical.push(o);t.nodeToRelativeConstraintMapVertical.set(o,[]);if(t.dummyToNodeForHorizontalAlignment.has(o)){t.nodeToTempPositionMapVertical.set(o,t.idToNodeMap.get(t.dummyToNodeForHorizontalAlignment.get(o)[0]).getCenterY())}else{t.nodeToTempPositionMapVertical.set(o,t.idToNodeMap.get(o).getCenterY())}}t.nodeToRelativeConstraintMapVertical.get(n).push({bottom:o,gap:e.gap});t.nodeToRelativeConstraintMapVertical.get(o).push({top:n,gap:e.gap})}}))}else{var f=new Map;var d=new Map;this.constraints.relativePlacementConstraint.forEach((function(t){if(t.left){var e=a.has(t.left)?a.get(t.left):t.left;var r=a.has(t.right)?a.get(t.right):t.right;if(f.has(e)){f.get(e).push(r)}else{f.set(e,[r])}if(f.has(r)){f.get(r).push(e)}else{f.set(r,[e])}}else{var i=s.has(t.top)?s.get(t.top):t.top;var n=s.has(t.bottom)?s.get(t.bottom):t.bottom;if(d.has(i)){d.get(i).push(n)}else{d.set(i,[n])}if(d.has(n)){d.get(n).push(i)}else{d.set(n,[i])}}}));var g=function t(e,r){var i=[];var n=[];var o=new N;var a=new Set;var s=0;e.forEach((function(t,h){if(!a.has(h)){i[s]=[];n[s]=false;var l=h;o.push(l);a.add(l);i[s].push(l);while(o.length!=0){l=o.shift();if(r.has(l)){n[s]=true}var c=e.get(l);c.forEach((function(t){if(!a.has(t)){o.push(t);a.add(t);i[s].push(t)}}))}s++}}));return{components:i,isFixed:n}};var u=g(f,t.fixedNodesOnHorizontal);this.componentsOnHorizontal=u.components;this.fixedComponentsOnHorizontal=u.isFixed;var p=g(d,t.fixedNodesOnVertical);this.componentsOnVertical=p.components;this.fixedComponentsOnVertical=p.isFixed}}};T.prototype.updateDisplacements=function(){var t=this;if(this.constraints.fixedNodeConstraint){this.constraints.fixedNodeConstraint.forEach((function(e){var r=t.idToNodeMap.get(e.nodeId);r.displacementX=0;r.displacementY=0}))}if(this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical){var e=this.constraints.alignmentConstraint.vertical;for(var r=0;r1){var s;for(s=0;si){i=Math.floor(a.y)}o=Math.floor(a.x+h.DEFAULT_COMPONENT_SEPERATION)}this.transform(new g(f.WORLD_CENTER_X-a.x/2,f.WORLD_CENTER_Y-a.y/2))};T.radialLayout=function(t,e,r){var i=Math.max(this.maxDiagonalInTree(t),h.DEFAULT_RADIAL_SEPARATION);T.branchRadialLayout(e,null,0,359,0,i);var n=m.calculateBounds(t);var o=new E;o.setDeviceOrgX(n.getMinX());o.setDeviceOrgY(n.getMinY());o.setWorldOrgX(r.x);o.setWorldOrgY(r.y);for(var a=0;a1){var E=m[0];m.splice(0,1);var N=d.indexOf(E);if(N>=0){d.splice(N,1)}p--;g--}if(e!=null){v=(d.indexOf(m[0])+1)%p}else{v=0}var A=Math.abs(i-r)/g;for(var w=v;u!=g;w=++w%p){var C=d[w].getOtherEnd(t);if(C==e){continue}var L=(r+u*A)%360;var I=(L+A)%360;T.branchRadialLayout(C,t,L,I,n+o,o);u++}};T.maxDiagonalInTree=function(t){var e=v.MIN_VALUE;for(var r=0;re){e=n}}return e};T.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength};T.prototype.groupZeroDegreeMembers=function(){var t=this;var e={};this.memberGroups={};this.idToDummyNode={};var r=[];var i=this.graphManager.getAllNodes();for(var n=0;n1){var i="DummyCompound_"+r;t.memberGroups[i]=e[r];var n=e[r][0].getParent();var o=new a(t.graphManager);o.id=i;o.paddingLeft=n.paddingLeft||0;o.paddingRight=n.paddingRight||0;o.paddingBottom=n.paddingBottom||0;o.paddingTop=n.paddingTop||0;t.idToDummyNode[i]=o;var s=t.getGraphManager().add(t.newGraph(),o);var h=n.getChild();h.add(o);for(var l=0;ln){i.rect.x-=(i.labelWidth-n)/2;i.setWidth(i.labelWidth);i.labelMarginLeft=(i.labelWidth-n)/2}else if(i.labelPosHorizontal=="right"){i.setWidth(n+i.labelWidth)}}if(i.labelHeight){if(i.labelPosVertical=="top"){i.rect.y-=i.labelHeight;i.setHeight(o+i.labelHeight);i.labelMarginTop=i.labelHeight}else if(i.labelPosVertical=="center"&&i.labelHeight>o){i.rect.y-=(i.labelHeight-o)/2;i.setHeight(i.labelHeight);i.labelMarginTop=(i.labelHeight-o)/2}else if(i.labelPosVertical=="bottom"){i.setHeight(o+i.labelHeight)}}}}))};T.prototype.repopulateCompounds=function(){for(var t=this.compoundOrder.length-1;t>=0;t--){var e=this.compoundOrder[t];var r=e.id;var i=e.paddingLeft;var n=e.paddingTop;var o=e.labelMarginLeft;var a=e.labelMarginTop;this.adjustLocations(this.tiledMemberPack[r],e.rect.x,e.rect.y,i,n,o,a)}};T.prototype.repopulateZeroDegreeMembers=function(){var t=this;var e=this.tiledZeroDegreePack;Object.keys(e).forEach((function(r){var i=t.idToDummyNode[r];var n=i.paddingLeft;var o=i.paddingTop;var a=i.labelMarginLeft;var s=i.labelMarginTop;t.adjustLocations(e[r],i.rect.x,i.rect.y,n,o,a,s)}))};T.prototype.getToBeTiled=function(t){var e=t.id;if(this.toBeTiled[e]!=null){return this.toBeTiled[e]}var r=t.getChild();if(r==null){this.toBeTiled[e]=false;return false}var i=r.getNodes();for(var n=0;n0){this.toBeTiled[e]=false;return false}if(o.getChild()==null){this.toBeTiled[o.id]=false;continue}if(!this.getToBeTiled(o)){this.toBeTiled[e]=false;return false}}this.toBeTiled[e]=true;return true};T.prototype.getNodeDegree=function(t){var e=t.id;var r=t.getEdges();var i=0;for(var n=0;nc)c=d.rect.height}r+=c+t.verticalPadding}};T.prototype.tileCompoundMembers=function(t,e){var r=this;this.tiledMemberPack=[];Object.keys(t).forEach((function(i){var n=e[i];r.tiledMemberPack[i]=r.tileNodes(t[i],n.paddingLeft+n.paddingRight);n.rect.width=r.tiledMemberPack[i].width;n.rect.height=r.tiledMemberPack[i].height;n.setCenter(r.tiledMemberPack[i].centerX,r.tiledMemberPack[i].centerY);n.labelMarginLeft=0;n.labelMarginTop=0;if(h.NODE_DIMENSIONS_INCLUDE_LABELS){var o=n.rect.width;var a=n.rect.height;if(n.labelWidth){if(n.labelPosHorizontal=="left"){n.rect.x-=n.labelWidth;n.setWidth(o+n.labelWidth);n.labelMarginLeft=n.labelWidth}else if(n.labelPosHorizontal=="center"&&n.labelWidth>o){n.rect.x-=(n.labelWidth-o)/2;n.setWidth(n.labelWidth);n.labelMarginLeft=(n.labelWidth-o)/2}else if(n.labelPosHorizontal=="right"){n.setWidth(o+n.labelWidth)}}if(n.labelHeight){if(n.labelPosVertical=="top"){n.rect.y-=n.labelHeight;n.setHeight(a+n.labelHeight);n.labelMarginTop=n.labelHeight}else if(n.labelPosVertical=="center"&&n.labelHeight>a){n.rect.y-=(n.labelHeight-a)/2;n.setHeight(n.labelHeight);n.labelMarginTop=(n.labelHeight-a)/2}else if(n.labelPosVertical=="bottom"){n.setHeight(a+n.labelHeight)}}}}))};T.prototype.tileNodes=function(t,e){var r=this.tileNodesByFavoringDim(t,e,true);var i=this.tileNodesByFavoringDim(t,e,false);var n=this.getOrgRatio(r);var o=this.getOrgRatio(i);var a;if(os){s=t.getWidth()}}));var l=o/n;var c=a/n;var f=Math.pow(r-i,2)+4*(l+i)*(c+r)*n;var d=(i-r+Math.sqrt(f))/(2*(l+i));var g;if(e){g=Math.ceil(d);if(g==d){g++}}else{g=Math.floor(d)}var u=g*(l+i)-i;if(s>u){u=s}u+=i*2;return u};T.prototype.tileNodesByFavoringDim=function(t,e,r){var i=h.TILING_PADDING_VERTICAL;var n=h.TILING_PADDING_HORIZONTAL;var o=h.TILING_COMPARE_BY;var a={rows:[],rowWidth:[],rowHeight:[],width:0,height:e,verticalPadding:i,horizontalPadding:n,centerX:0,centerY:0};if(o){a.idealRowWidth=this.calcIdealRowWidth(t,r)}var s=function t(e){return e.rect.width*e.rect.height};var l=function t(e,r){return s(r)-s(e)};t.sort((function(t,e){var r=l;if(a.idealRowWidth){r=o;return r(t.id,e.id)}return r(t,e)}));var c=0;var f=0;for(var d=0;d0){a+=t.horizontalPadding}t.rowWidth[r]=a;if(t.width0)s+=t.verticalPadding;var h=0;if(s>t.rowHeight[r]){h=t.rowHeight[r];t.rowHeight[r]=s;h=t.rowHeight[r]-h}t.height+=h;t.rows[r].push(e)};T.prototype.getShortestRowIndex=function(t){var e=-1;var r=Number.MAX_VALUE;for(var i=0;ir){e=i;r=t.rowWidth[i]}}return e};T.prototype.canAddHorizontal=function(t,e,r){if(t.idealRowWidth){var i=t.rows.length-1;var n=t.rowWidth[i];return n+e+t.horizontalPadding<=t.idealRowWidth}var o=this.getShortestRowIndex(t);if(o<0){return true}var a=t.rowWidth[o];if(a+t.horizontalPadding+e<=t.width)return true;var s=0;if(t.rowHeight[o]0)s=r+t.verticalPadding-t.rowHeight[o]}var h;if(t.width-a>=e+t.horizontalPadding){h=(t.height+s)/(a+e+t.horizontalPadding)}else{h=(t.height+s)/t.width}s=r+t.verticalPadding;var l;if(t.widtho&&e!=r){i.splice(-1,1);t.rows[r].push(n);t.rowWidth[e]=t.rowWidth[e]-o;t.rowWidth[r]=t.rowWidth[r]+o;t.width=t.rowWidth[instance.getLongestRowIndex(t)];var a=Number.MIN_VALUE;for(var s=0;sa)a=i[s].height}if(e>0)a+=t.verticalPadding;var h=t.rowHeight[e]+t.rowHeight[r];t.rowHeight[e]=a;if(t.rowHeight[r]0){for(var p=n;p<=o;p++){u[0]+=this.grid[p][a-1].length+this.grid[p][a].length-1}}if(o0){for(var p=a;p<=s;p++){u[3]+=this.grid[n-1][p].length+this.grid[n][p].length-1}}var y=v.MAX_VALUE;var m;var E;for(var N=0;N{var i=r(551).FDLayoutNode;var n=r(551).IMath;function o(t,e,r,n){i.call(this,t,e,r,n)}o.prototype=Object.create(i.prototype);for(var a in i){o[a]=i[a]}o.prototype.calculateDisplacement=function(){var t=this.graphManager.getLayout();if(this.getChild()!=null&&this.fixedNodeWeight){this.displacementX+=t.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight;this.displacementY+=t.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight}else{this.displacementX+=t.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren;this.displacementY+=t.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren}if(Math.abs(this.displacementX)>t.coolingFactor*t.maxNodeDisplacement){this.displacementX=t.coolingFactor*t.maxNodeDisplacement*n.sign(this.displacementX)}if(Math.abs(this.displacementY)>t.coolingFactor*t.maxNodeDisplacement){this.displacementY=t.coolingFactor*t.maxNodeDisplacement*n.sign(this.displacementY)}if(this.child&&this.child.getNodes().length>0){this.propogateDisplacementToChildren(this.displacementX,this.displacementY)}};o.prototype.propogateDisplacementToChildren=function(t,e){var r=this.getChild().getNodes();var i;for(var n=0;n{function i(t){if(Array.isArray(t)){for(var e=0,r=Array(t.length);e0){var i=0;e.forEach((function(t){if(r=="horizontal"){g.set(t,h.has(t)?l[h.get(t)]:a.get(t));i+=g.get(t)}else{g.set(t,h.has(t)?c[h.get(t)]:a.get(t));i+=g.get(t)}}));i=i/e.length;t.forEach((function(t){if(!n.has(t)){g.set(t,i)}}))}else{var o=0;t.forEach((function(t){if(r=="horizontal"){o+=h.has(t)?l[h.get(t)]:a.get(t)}else{o+=h.has(t)?c[h.get(t)]:a.get(t)}}));o=o/t.length;t.forEach((function(t){g.set(t,o)}))}}))}var v=function t(){var i=p.shift();var o=e.get(i);o.forEach((function(t){if(g.get(t.id)o){o=m}if(Es){s=E}}}catch(_){d=true;u=_}finally{try{if(!f&&p.return){p.return()}}finally{if(d){throw u}}}var N=(i+o)/2-(n+s)/2;var T=true;var A=false;var w=undefined;try{for(var C=t[Symbol.iterator](),L;!(T=(L=C.next()).done);T=true){var I=L.value;g.set(I,g.get(I)+N)}}catch(_){A=true;w=_}finally{try{if(!T&&C.return){C.return()}}finally{if(A){throw w}}}}))}return g};var m=function t(e){var r=0,i=0;var n=0,o=0;e.forEach((function(t){if(t.left){l[h.get(t.left)]-l[h.get(t.right)]>=0?r++:i++}else{c[h.get(t.top)]-c[h.get(t.bottom)]>=0?n++:o++}}));if(r>i&&n>o){for(var a=0;ai){for(var s=0;so){for(var f=0;f1){e.fixedNodeConstraint.forEach((function(t,e){A[e]=[t.position.x,t.position.y];w[e]=[l[h.get(t.nodeId)],c[h.get(t.nodeId)]]}));C=true}else if(e.alignmentConstraint){(function(){var t=0;if(e.alignmentConstraint.vertical){var r=e.alignmentConstraint.vertical;var n=function e(n){var o=new Set;r[n].forEach((function(t){o.add(t)}));var a=new Set([].concat(i(o)).filter((function(t){return I.has(t)})));var s=void 0;if(a.size>0)s=l[h.get(a.values().next().value)];else s=v(o).x;r[n].forEach((function(e){A[t]=[s,c[h.get(e)]];w[t]=[l[h.get(e)],c[h.get(e)]];t++}))};for(var o=0;o0)s=l[h.get(o.values().next().value)];else s=v(n).y;a[r].forEach((function(e){A[t]=[l[h.get(e)],s];w[t]=[l[h.get(e)],c[h.get(e)]];t++}))};for(var f=0;fO){O=x[b].length;D=b}}if(O0){var q={x:0,y:0};e.fixedNodeConstraint.forEach((function(t,e){var r={x:l[h.get(t.nodeId)],y:c[h.get(t.nodeId)]};var i=t.position;var n=p(i,r);q.x+=n.x;q.y+=n.y}));q.x/=e.fixedNodeConstraint.length;q.y/=e.fixedNodeConstraint.length;l.forEach((function(t,e){l[e]+=q.x}));c.forEach((function(t,e){c[e]+=q.y}));e.fixedNodeConstraint.forEach((function(t){l[h.get(t.nodeId)]=t.position.x;c[h.get(t.nodeId)]=t.position.y}))}if(e.alignmentConstraint){if(e.alignmentConstraint.vertical){var $=e.alignmentConstraint.vertical;var K=function t(e){var r=new Set;$[e].forEach((function(t){r.add(t)}));var n=new Set([].concat(i(r)).filter((function(t){return I.has(t)})));var o=void 0;if(n.size>0)o=l[h.get(n.values().next().value)];else o=v(r).x;r.forEach((function(t){if(!I.has(t))l[h.get(t)]=o}))};for(var Z=0;Z<$.length;Z++){K(Z)}}if(e.alignmentConstraint.horizontal){var Q=e.alignmentConstraint.horizontal;var J=function t(e){var r=new Set;Q[e].forEach((function(t){r.add(t)}));var n=new Set([].concat(i(r)).filter((function(t){return I.has(t)})));var o=void 0;if(n.size>0)o=c[h.get(n.values().next().value)];else o=v(r).y;r.forEach((function(t){if(!I.has(t))c[h.get(t)]=o}))};for(var tt=0;tt{e.exports=t}};var r={};function i(t){var n=r[t];if(n!==undefined){return n.exports}var o=r[t]={exports:{}};e[t](o,o.exports,i);return o.exports}var n=i(45);return n})()}))},1917:function(t){(function e(r,i){if(true)t.exports=i();else{}})(this,(function(){return function(t){var e={};function r(i){if(e[i]){return e[i].exports}var n=e[i]={i,l:false,exports:{}};t[i].call(n.exports,n,n.exports,r);n.l=true;return n.exports}r.m=t;r.c=e;r.i=function(t){return t};r.d=function(t,e,i){if(!r.o(t,e)){Object.defineProperty(t,e,{configurable:false,enumerable:true,get:i})}};r.n=function(t){var e=t&&t.__esModule?function e(){return t["default"]}:function e(){return t};r.d(e,"a",e);return e};r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)};r.p="";return r(r.s=28)}([function(t,e,r){"use strict";function i(){}i.QUALITY=1;i.DEFAULT_CREATE_BENDS_AS_NEEDED=false;i.DEFAULT_INCREMENTAL=false;i.DEFAULT_ANIMATION_ON_LAYOUT=true;i.DEFAULT_ANIMATION_DURING_LAYOUT=false;i.DEFAULT_ANIMATION_PERIOD=50;i.DEFAULT_UNIFORM_LEAF_NODE_SIZES=false;i.DEFAULT_GRAPH_MARGIN=15;i.NODE_DIMENSIONS_INCLUDE_LABELS=false;i.SIMPLE_NODE_SIZE=40;i.SIMPLE_NODE_HALF_SIZE=i.SIMPLE_NODE_SIZE/2;i.EMPTY_COMPOUND_NODE_SIZE=40;i.MIN_EDGE_LENGTH=1;i.WORLD_BOUNDARY=1e6;i.INITIAL_WORLD_BOUNDARY=i.WORLD_BOUNDARY/1e3;i.WORLD_CENTER_X=1200;i.WORLD_CENTER_Y=900;t.exports=i},function(t,e,r){"use strict";var i=r(2);var n=r(8);var o=r(9);function a(t,e,r){i.call(this,r);this.isOverlapingSourceAndTarget=false;this.vGraphObject=r;this.bendpoints=[];this.source=t;this.target=e}a.prototype=Object.create(i.prototype);for(var s in i){a[s]=i[s]}a.prototype.getSource=function(){return this.source};a.prototype.getTarget=function(){return this.target};a.prototype.isInterGraph=function(){return this.isInterGraph};a.prototype.getLength=function(){return this.length};a.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget};a.prototype.getBendpoints=function(){return this.bendpoints};a.prototype.getLca=function(){return this.lca};a.prototype.getSourceInLca=function(){return this.sourceInLca};a.prototype.getTargetInLca=function(){return this.targetInLca};a.prototype.getOtherEnd=function(t){if(this.source===t){return this.target}else if(this.target===t){return this.source}else{throw"Node is not incident with this edge"}};a.prototype.getOtherEndInGraph=function(t,e){var r=this.getOtherEnd(t);var i=e.getGraphManager().getRoot();while(true){if(r.getOwner()==e){return r}if(r.getOwner()==i){break}r=r.getOwner().getParent()}return null};a.prototype.updateLength=function(){var t=new Array(4);this.isOverlapingSourceAndTarget=n.getIntersection(this.target.getRect(),this.source.getRect(),t);if(!this.isOverlapingSourceAndTarget){this.lengthX=t[0]-t[2];this.lengthY=t[1]-t[3];if(Math.abs(this.lengthX)<1){this.lengthX=o.sign(this.lengthX)}if(Math.abs(this.lengthY)<1){this.lengthY=o.sign(this.lengthY)}this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)}};a.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX();this.lengthY=this.target.getCenterY()-this.source.getCenterY();if(Math.abs(this.lengthX)<1){this.lengthX=o.sign(this.lengthX)}if(Math.abs(this.lengthY)<1){this.lengthY=o.sign(this.lengthY)}this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)};t.exports=a},function(t,e,r){"use strict";function i(t){this.vGraphObject=t}t.exports=i},function(t,e,r){"use strict";var i=r(2);var n=r(10);var o=r(13);var a=r(0);var s=r(16);var h=r(5);function l(t,e,r,a){if(r==null&&a==null){a=e}i.call(this,a);if(t.graphManager!=null)t=t.graphManager;this.estimatedSize=n.MIN_VALUE;this.inclusionTreeDepth=n.MAX_VALUE;this.vGraphObject=a;this.edges=[];this.graphManager=t;if(r!=null&&e!=null)this.rect=new o(e.x,e.y,r.width,r.height);else this.rect=new o}l.prototype=Object.create(i.prototype);for(var c in i){l[c]=i[c]}l.prototype.getEdges=function(){return this.edges};l.prototype.getChild=function(){return this.child};l.prototype.getOwner=function(){return this.owner};l.prototype.getWidth=function(){return this.rect.width};l.prototype.setWidth=function(t){this.rect.width=t};l.prototype.getHeight=function(){return this.rect.height};l.prototype.setHeight=function(t){this.rect.height=t};l.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2};l.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2};l.prototype.getCenter=function(){return new h(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)};l.prototype.getLocation=function(){return new h(this.rect.x,this.rect.y)};l.prototype.getRect=function(){return this.rect};l.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)};l.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2};l.prototype.setRect=function(t,e){this.rect.x=t.x;this.rect.y=t.y;this.rect.width=e.width;this.rect.height=e.height};l.prototype.setCenter=function(t,e){this.rect.x=t-this.rect.width/2;this.rect.y=e-this.rect.height/2};l.prototype.setLocation=function(t,e){this.rect.x=t;this.rect.y=e};l.prototype.moveBy=function(t,e){this.rect.x+=t;this.rect.y+=e};l.prototype.getEdgeListToNode=function(t){var e=[];var r;var i=this;i.edges.forEach((function(r){if(r.target==t){if(r.source!=i)throw"Incorrect edge source!";e.push(r)}}));return e};l.prototype.getEdgesBetween=function(t){var e=[];var r;var i=this;i.edges.forEach((function(r){if(!(r.source==i||r.target==i))throw"Incorrect edge source and/or target";if(r.target==t||r.source==t){e.push(r)}}));return e};l.prototype.getNeighborsList=function(){var t=new Set;var e=this;e.edges.forEach((function(r){if(r.source==e){t.add(r.target)}else{if(r.target!=e){throw"Incorrect incidency!"}t.add(r.source)}}));return t};l.prototype.withChildren=function(){var t=new Set;var e;var r;t.add(this);if(this.child!=null){var i=this.child.getNodes();for(var n=0;ne){this.rect.x-=(this.labelWidth-e)/2;this.setWidth(this.labelWidth)}else if(this.labelPosHorizontal=="right"){this.setWidth(e+this.labelWidth)}}if(this.labelHeight){if(this.labelPosVertical=="top"){this.rect.y-=this.labelHeight;this.setHeight(r+this.labelHeight)}else if(this.labelPosVertical=="center"&&this.labelHeight>r){this.rect.y-=(this.labelHeight-r)/2;this.setHeight(this.labelHeight)}else if(this.labelPosVertical=="bottom"){this.setHeight(r+this.labelHeight)}}}}};l.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==n.MAX_VALUE){throw"assert failed"}return this.inclusionTreeDepth};l.prototype.transform=function(t){var e=this.rect.x;if(e>a.WORLD_BOUNDARY){e=a.WORLD_BOUNDARY}else if(e<-a.WORLD_BOUNDARY){e=-a.WORLD_BOUNDARY}var r=this.rect.y;if(r>a.WORLD_BOUNDARY){r=a.WORLD_BOUNDARY}else if(r<-a.WORLD_BOUNDARY){r=-a.WORLD_BOUNDARY}var i=new h(e,r);var n=t.inverseTransformPoint(i);this.setLocation(n.x,n.y)};l.prototype.getLeft=function(){return this.rect.x};l.prototype.getRight=function(){return this.rect.x+this.rect.width};l.prototype.getTop=function(){return this.rect.y};l.prototype.getBottom=function(){return this.rect.y+this.rect.height};l.prototype.getParent=function(){if(this.owner==null){return null}return this.owner.getParent()};t.exports=l},function(t,e,r){"use strict";var i=r(0);function n(){}for(var o in i){n[o]=i[o]}n.MAX_ITERATIONS=2500;n.DEFAULT_EDGE_LENGTH=50;n.DEFAULT_SPRING_STRENGTH=.45;n.DEFAULT_REPULSION_STRENGTH=4500;n.DEFAULT_GRAVITY_STRENGTH=.4;n.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1;n.DEFAULT_GRAVITY_RANGE_FACTOR=3.8;n.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5;n.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=true;n.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=true;n.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3;n.COOLING_ADAPTATION_FACTOR=.33;n.ADAPTATION_LOWER_NODE_LIMIT=1e3;n.ADAPTATION_UPPER_NODE_LIMIT=5e3;n.MAX_NODE_DISPLACEMENT_INCREMENTAL=100;n.MAX_NODE_DISPLACEMENT=n.MAX_NODE_DISPLACEMENT_INCREMENTAL*3;n.MIN_REPULSION_DIST=n.DEFAULT_EDGE_LENGTH/10;n.CONVERGENCE_CHECK_PERIOD=100;n.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1;n.MIN_EDGE_LENGTH=1;n.GRID_CALCULATION_CHECK_PERIOD=10;t.exports=n},function(t,e,r){"use strict";function i(t,e){if(t==null&&e==null){this.x=0;this.y=0}else{this.x=t;this.y=e}}i.prototype.getX=function(){return this.x};i.prototype.getY=function(){return this.y};i.prototype.setX=function(t){this.x=t};i.prototype.setY=function(t){this.y=t};i.prototype.getDifference=function(t){return new DimensionD(this.x-t.x,this.y-t.y)};i.prototype.getCopy=function(){return new i(this.x,this.y)};i.prototype.translate=function(t){this.x+=t.width;this.y+=t.height;return this};t.exports=i},function(t,e,r){"use strict";var i=r(2);var n=r(10);var o=r(0);var a=r(7);var s=r(3);var h=r(1);var l=r(13);var c=r(12);var f=r(11);function d(t,e,r){i.call(this,r);this.estimatedSize=n.MIN_VALUE;this.margin=o.DEFAULT_GRAPH_MARGIN;this.edges=[];this.nodes=[];this.isConnected=false;this.parent=t;if(e!=null&&e instanceof a){this.graphManager=e}else if(e!=null&&e instanceof Layout){this.graphManager=e.graphManager}}d.prototype=Object.create(i.prototype);for(var g in i){d[g]=i[g]}d.prototype.getNodes=function(){return this.nodes};d.prototype.getEdges=function(){return this.edges};d.prototype.getGraphManager=function(){return this.graphManager};d.prototype.getParent=function(){return this.parent};d.prototype.getLeft=function(){return this.left};d.prototype.getRight=function(){return this.right};d.prototype.getTop=function(){return this.top};d.prototype.getBottom=function(){return this.bottom};d.prototype.isConnected=function(){return this.isConnected};d.prototype.add=function(t,e,r){if(e==null&&r==null){var i=t;if(this.graphManager==null){throw"Graph has no graph mgr!"}if(this.getNodes().indexOf(i)>-1){throw"Node already in graph!"}i.owner=this;this.getNodes().push(i);return i}else{var n=t;if(!(this.getNodes().indexOf(e)>-1&&this.getNodes().indexOf(r)>-1)){throw"Source or target not in graph!"}if(!(e.owner==r.owner&&e.owner==this)){throw"Both owners must be this graph!"}if(e.owner!=r.owner){return null}n.source=e;n.target=r;n.isInterGraph=false;this.getEdges().push(n);e.edges.push(n);if(r!=e){r.edges.push(n)}return n}};d.prototype.remove=function(t){var e=t;if(t instanceof s){if(e==null){throw"Node is null!"}if(!(e.owner!=null&&e.owner==this)){throw"Owner graph is invalid!"}if(this.graphManager==null){throw"Owner graph manager is invalid!"}var r=e.edges.slice();var i;var n=r.length;for(var o=0;o-1&&c>-1)){throw"Source and/or target doesn't know this edge!"}i.source.edges.splice(l,1);if(i.target!=i.source){i.target.edges.splice(c,1)}var a=i.source.owner.getEdges().indexOf(i);if(a==-1){throw"Not in owner's edge list!"}i.source.owner.getEdges().splice(a,1)}};d.prototype.updateLeftTop=function(){var t=n.MAX_VALUE;var e=n.MAX_VALUE;var r;var i;var o;var a=this.getNodes();var s=a.length;for(var h=0;hr){t=r}if(e>i){e=i}}if(t==n.MAX_VALUE){return null}if(a[0].getParent().paddingLeft!=undefined){o=a[0].getParent().paddingLeft}else{o=this.margin}this.left=e-o;this.top=t-o;return new c(this.left,this.top)};d.prototype.updateBounds=function(t){var e=n.MAX_VALUE;var r=-n.MAX_VALUE;var i=n.MAX_VALUE;var o=-n.MAX_VALUE;var a;var s;var h;var c;var f;var d=this.nodes;var g=d.length;for(var u=0;ua){e=a}if(rh){i=h}if(oa){e=a}if(rh){i=h}if(o=this.nodes.length){var d=0;r.forEach((function(e){if(e.owner==t){d++}}));if(d==this.nodes.length){this.isConnected=true}}};t.exports=d},function(t,e,r){"use strict";var i;var n=r(1);function o(t){i=r(6);this.layout=t;this.graphs=[];this.edges=[]}o.prototype.addRoot=function(){var t=this.layout.newGraph();var e=this.layout.newNode(null);var r=this.add(t,e);this.setRootGraph(r);return this.rootGraph};o.prototype.add=function(t,e,r,i,n){if(r==null&&i==null&&n==null){if(t==null){throw"Graph is null!"}if(e==null){throw"Parent node is null!"}if(this.graphs.indexOf(t)>-1){throw"Graph already in this graph mgr!"}this.graphs.push(t);if(t.parent!=null){throw"Already has a parent!"}if(e.child!=null){throw"Already has a child!"}t.parent=e;e.child=t;return t}else{n=r;i=e;r=t;var o=i.getOwner();var a=n.getOwner();if(!(o!=null&&o.getGraphManager()==this)){throw"Source not in this graph mgr!"}if(!(a!=null&&a.getGraphManager()==this)){throw"Target not in this graph mgr!"}if(o==a){r.isInterGraph=false;return o.add(r,i,n)}else{r.isInterGraph=true;r.source=i;r.target=n;if(this.edges.indexOf(r)>-1){throw"Edge already in inter-graph edge list!"}this.edges.push(r);if(!(r.source!=null&&r.target!=null)){throw"Edge source and/or target is null!"}if(!(r.source.edges.indexOf(r)==-1&&r.target.edges.indexOf(r)==-1)){throw"Edge already in source and/or target incidency list!"}r.source.edges.push(r);r.target.edges.push(r);return r}}};o.prototype.remove=function(t){if(t instanceof i){var e=t;if(e.getGraphManager()!=this){throw"Graph not in this graph mgr"}if(!(e==this.rootGraph||e.parent!=null&&e.parent.graphManager==this)){throw"Invalid parent node!"}var r=[];r=r.concat(e.getEdges());var o;var a=r.length;for(var s=0;s=e.getRight()){r[0]+=Math.min(e.getX()-t.getX(),t.getRight()-e.getRight())}else if(e.getX()<=t.getX()&&e.getRight()>=t.getRight()){r[0]+=Math.min(t.getX()-e.getX(),e.getRight()-t.getRight())}if(t.getY()<=e.getY()&&t.getBottom()>=e.getBottom()){r[1]+=Math.min(e.getY()-t.getY(),t.getBottom()-e.getBottom())}else if(e.getY()<=t.getY()&&e.getBottom()>=t.getBottom()){r[1]+=Math.min(t.getY()-e.getY(),e.getBottom()-t.getBottom())}var o=Math.abs((e.getCenterY()-t.getCenterY())/(e.getCenterX()-t.getCenterX()));if(e.getCenterY()===t.getCenterY()&&e.getCenterX()===t.getCenterX()){o=1}var a=o*r[0];var s=r[1]/o;if(r[0]a){r[0]=i;r[1]=h;r[2]=o;r[3]=E;return false}else if(no){r[0]=s;r[1]=n;r[2]=y;r[3]=a;return false}else if(io){r[0]=c;r[1]=f;w=true}else{r[0]=l;r[1]=h;w=true}}else if(L===_){if(i>o){r[0]=s;r[1]=h;w=true}else{r[0]=d;r[1]=f;w=true}}if(-I===_){if(o>i){r[2]=m;r[3]=E;C=true}else{r[2]=y;r[3]=v;C=true}}else if(I===_){if(o>i){r[2]=p;r[3]=v;C=true}else{r[2]=N;r[3]=E;C=true}}if(w&&C){return false}if(i>o){if(n>a){M=this.getCardinalDirection(L,_,4);x=this.getCardinalDirection(I,_,2)}else{M=this.getCardinalDirection(-L,_,3);x=this.getCardinalDirection(-I,_,1)}}else{if(n>a){M=this.getCardinalDirection(-L,_,1);x=this.getCardinalDirection(-I,_,3)}else{M=this.getCardinalDirection(L,_,2);x=this.getCardinalDirection(I,_,4)}}if(!w){switch(M){case 1:D=h;O=i+-u/_;r[0]=O;r[1]=D;break;case 2:O=d;D=n+g*_;r[0]=O;r[1]=D;break;case 3:D=f;O=i+u/_;r[0]=O;r[1]=D;break;case 4:O=c;D=n+-g*_;r[0]=O;r[1]=D;break}}if(!C){switch(x){case 1:R=v;b=o+-A/_;r[2]=b;r[3]=R;break;case 2:b=N;R=a+T*_;r[2]=b;r[3]=R;break;case 3:R=E;b=o+A/_;r[2]=b;r[3]=R;break;case 4:b=m;R=a+-T*_;r[2]=b;r[3]=R;break}}}return false};n.getCardinalDirection=function(t,e,r){if(t>e){return r}else{return 1+r%4}};n.getIntersection=function(t,e,r,n){if(n==null){return this.getIntersection2(t,e,r)}var o=t.x;var a=t.y;var s=e.x;var h=e.y;var l=r.x;var c=r.y;var f=n.x;var d=n.y;var g=void 0,u=void 0;var p=void 0,v=void 0,y=void 0,m=void 0,E=void 0,N=void 0;var T=void 0;p=h-a;y=o-s;E=s*a-o*h;v=d-c;m=l-f;N=f*c-l*d;T=p*m-v*y;if(T===0){return null}g=(y*N-m*E)/T;u=(v*E-p*N)/T;return new i(g,u)};n.angleOfVector=function(t,e,r,i){var n=void 0;if(t!==r){n=Math.atan((i-e)/(r-t));if(r=0){var f=(-h+Math.sqrt(h*h-4*s*l))/(2*s);var d=(-h-Math.sqrt(h*h-4*s*l))/(2*s);var g=null;if(f>=0&&f<=1){return[f]}if(d>=0&&d<=1){return[d]}return g}else return null};n.HALF_PI=.5*Math.PI;n.ONE_AND_HALF_PI=1.5*Math.PI;n.TWO_PI=2*Math.PI;n.THREE_PI=3*Math.PI;t.exports=n},function(t,e,r){"use strict";function i(){}i.sign=function(t){if(t>0){return 1}else if(t<0){return-1}else{return 0}};i.floor=function(t){return t<0?Math.ceil(t):Math.floor(t)};i.ceil=function(t){return t<0?Math.floor(t):Math.ceil(t)};t.exports=i},function(t,e,r){"use strict";function i(){}i.MAX_VALUE=2147483647;i.MIN_VALUE=-2147483648;t.exports=i},function(t,e,r){"use strict";var i=function(){function t(t,e){for(var r=0;r0&&e){s.push(l[0]);while(s.length>0&&e){var c=s[0];s.splice(0,1);a.add(c);var f=c.getEdges();for(var o=0;o-1){l.splice(p,1)}}a=new Set;h=new Map}}return t};d.prototype.createDummyNodesForBendpoints=function(t){var e=[];var r=t.source;var i=this.graphManager.calcLowestCommonAncestor(t.source,t.target);for(var n=0;n0){var n=this.edgeToDummyNodes.get(r);for(var o=0;o=0){e.splice(f,1)}var d=s.getNeighborsList();d.forEach((function(t){if(r.indexOf(t)<0){var e=i.get(t);var n=e-1;if(n==1){l.push(t)}i.set(t,n)}}))}r=r.concat(l);if(e.length==1||e.length==2){n=true;o=e[0]}}return o};d.prototype.setGraphManager=function(t){this.graphManager=t};t.exports=d},function(t,e,r){"use strict";function i(){}i.seed=1;i.x=0;i.nextDouble=function(){i.x=Math.sin(i.seed++)*1e4;return i.x-Math.floor(i.x)};t.exports=i},function(t,e,r){"use strict";var i=r(5);function n(t,e){this.lworldOrgX=0;this.lworldOrgY=0;this.ldeviceOrgX=0;this.ldeviceOrgY=0;this.lworldExtX=1;this.lworldExtY=1;this.ldeviceExtX=1;this.ldeviceExtY=1}n.prototype.getWorldOrgX=function(){return this.lworldOrgX};n.prototype.setWorldOrgX=function(t){this.lworldOrgX=t};n.prototype.getWorldOrgY=function(){return this.lworldOrgY};n.prototype.setWorldOrgY=function(t){this.lworldOrgY=t};n.prototype.getWorldExtX=function(){return this.lworldExtX};n.prototype.setWorldExtX=function(t){this.lworldExtX=t};n.prototype.getWorldExtY=function(){return this.lworldExtY};n.prototype.setWorldExtY=function(t){this.lworldExtY=t};n.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX};n.prototype.setDeviceOrgX=function(t){this.ldeviceOrgX=t};n.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY};n.prototype.setDeviceOrgY=function(t){this.ldeviceOrgY=t};n.prototype.getDeviceExtX=function(){return this.ldeviceExtX};n.prototype.setDeviceExtX=function(t){this.ldeviceExtX=t};n.prototype.getDeviceExtY=function(){return this.ldeviceExtY};n.prototype.setDeviceExtY=function(t){this.ldeviceExtY=t};n.prototype.transformX=function(t){var e=0;var r=this.lworldExtX;if(r!=0){e=this.ldeviceOrgX+(t-this.lworldOrgX)*this.ldeviceExtX/r}return e};n.prototype.transformY=function(t){var e=0;var r=this.lworldExtY;if(r!=0){e=this.ldeviceOrgY+(t-this.lworldOrgY)*this.ldeviceExtY/r}return e};n.prototype.inverseTransformX=function(t){var e=0;var r=this.ldeviceExtX;if(r!=0){e=this.lworldOrgX+(t-this.ldeviceOrgX)*this.lworldExtX/r}return e};n.prototype.inverseTransformY=function(t){var e=0;var r=this.ldeviceExtY;if(r!=0){e=this.lworldOrgY+(t-this.ldeviceOrgY)*this.lworldExtY/r}return e};n.prototype.inverseTransformPoint=function(t){var e=new i(this.inverseTransformX(t.x),this.inverseTransformY(t.y));return e};t.exports=n},function(t,e,r){"use strict";function i(t){if(Array.isArray(t)){for(var e=0,r=Array(t.length);eo.ADAPTATION_LOWER_NODE_LIMIT){this.coolingFactor=Math.max(this.coolingFactor*o.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(t-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-o.COOLING_ADAPTATION_FACTOR))}this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT_INCREMENTAL}else{if(t>o.ADAPTATION_LOWER_NODE_LIMIT){this.coolingFactor=Math.max(o.COOLING_ADAPTATION_FACTOR,1-(t-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*(1-o.COOLING_ADAPTATION_FACTOR))}else{this.coolingFactor=1}this.initialCoolingFactor=this.coolingFactor;this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT}this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations);this.displacementThresholdPerNode=3*o.DEFAULT_EDGE_LENGTH/100;this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length;this.repulsionRange=this.calcRepulsionRange()};l.prototype.calcSpringForces=function(){var t=this.getAllEdges();var e;for(var r=0;r0&&arguments[0]!==undefined?arguments[0]:true;var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;var r,i;var n,a;var s=this.getAllNodes();var h;if(this.useFRGridVariant){if(this.totalIterations%o.GRID_CALCULATION_CHECK_PERIOD==1&&t){this.updateGrid()}h=new Set;for(r=0;rh||s>h){t.gravitationForceX=-this.gravityConstant*n;t.gravitationForceY=-this.gravityConstant*o}}else{h=e.getEstimatedSize()*this.compoundGravityRangeFactor;if(a>h||s>h){t.gravitationForceX=-this.gravityConstant*n*this.compoundGravityConstant;t.gravitationForceY=-this.gravityConstant*o*this.compoundGravityConstant}}};l.prototype.isConverged=function(){var t;var e=false;if(this.totalIterations>this.maxIterations/3){e=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2}t=this.totalDisplacement=h.length||c>=h[0].length)){for(var f=0;fe}}]);return t}();t.exports=a},function(t,e,r){"use strict";function i(){}i.svd=function(t){this.U=null;this.V=null;this.s=null;this.m=0;this.n=0;this.m=t.length;this.n=t[0].length;var e=Math.min(this.m,this.n);this.s=function(t){var e=[];while(t-- >0){e.push(0)}return e}(Math.min(this.m+1,this.n));this.U=function(t){var e=function t(e){if(e.length==0){return 0}else{var r=[];for(var i=0;i0){e.push(0)}return e}(this.n);var n=function(t){var e=[];while(t-- >0){e.push(0)}return e}(this.m);var o=true;var a=true;var s=Math.min(this.m-1,this.n);var h=Math.max(0,Math.min(this.n-2,this.m));for(var l=0;l=0;x--){if(this.s[x]!==0){for(var O=x+1;O=0;P--){if(function(t,e){return t&&e}(P0){var j=void 0;var q=void 0;for(j=I-2;j>=-1;j--){if(j===-1){break}if(Math.abs(r[j])<=W+V*(Math.abs(this.s[j])+Math.abs(this.s[j+1]))){r[j]=0;break}}if(j===I-2){q=4}else{var $=void 0;for($=I-1;$>=j;$--){if($===j){break}var K=($!==I?Math.abs(r[$]):0)+($!==j+1?Math.abs(r[$-1]):0);if(Math.abs(this.s[$])<=W+V*K){this.s[$]=0;break}}if($===j){q=3}else if($===I-1){q=1}else{q=2;j=$}}j++;switch(q){case 1:{var Z=r[I-2];r[I-2]=0;for(var Q=I-2;Q>=j;Q--){var J=i.hypot(this.s[Q],Z);var tt=this.s[Q]/J;var et=Z/J;this.s[Q]=J;if(Q!==j){Z=-et*r[Q-1];r[Q-1]=tt*r[Q-1]}if(a){for(var rt=0;rt=this.s[j+1]){break}var _t=this.s[j];this.s[j]=this.s[j+1];this.s[j+1]=_t;if(a&&jMath.abs(e)){r=e/t;r=Math.abs(t)*Math.sqrt(1+r*r)}else if(e!=0){r=t/e;r=Math.abs(e)*Math.sqrt(1+r*r)}else{r=0}return r};t.exports=i},function(t,e,r){"use strict";var i=function(){function t(t,e){for(var r=0;r2&&arguments[2]!==undefined?arguments[2]:1;var o=arguments.length>3&&arguments[3]!==undefined?arguments[3]:-1;var a=arguments.length>4&&arguments[4]!==undefined?arguments[4]:-1;n(this,t);this.sequence1=e;this.sequence2=r;this.match_score=i;this.mismatch_penalty=o;this.gap_penalty=a;this.iMax=e.length+1;this.jMax=r.length+1;this.grid=new Array(this.iMax);for(var s=0;s=0;r--){var i=this.listeners[r];if(i.event===t&&i.callback===e){this.listeners.splice(r,1)}}};n.emit=function(t,e){for(var r=0;r{"use strict";r.d(e,{diagram:()=>J});var i=r(56273);var n=r(51916);var o=r(52724);var a=r(84222);var s=r(6047);var h=r(24010);var l=r(76405);var c=r(26527);var f=r.n(c);var d=r(1218);var g={L:"left",R:"right",T:"top",B:"bottom"};var u={L:(0,s.K2)((t=>`${t},${t/2} 0,${t} 0,0`),"L"),R:(0,s.K2)((t=>`0,${t/2} ${t},0 ${t},${t}`),"R"),T:(0,s.K2)((t=>`0,0 ${t},0 ${t/2},${t}`),"T"),B:(0,s.K2)((t=>`${t/2},0 ${t},${t} 0,${t}`),"B")};var p={L:(0,s.K2)(((t,e)=>t-e+2),"L"),R:(0,s.K2)(((t,e)=>t-2),"R"),T:(0,s.K2)(((t,e)=>t-e+2),"T"),B:(0,s.K2)(((t,e)=>t-2),"B")};var v=(0,s.K2)((function(t){if(m(t)){return t==="L"?"R":"L"}else{return t==="T"?"B":"T"}}),"getOppositeArchitectureDirection");var y=(0,s.K2)((function(t){const e=t;return e==="L"||e==="R"||e==="T"||e==="B"}),"isArchitectureDirection");var m=(0,s.K2)((function(t){const e=t;return e==="L"||e==="R"}),"isArchitectureDirectionX");var E=(0,s.K2)((function(t){const e=t;return e==="T"||e==="B"}),"isArchitectureDirectionY");var N=(0,s.K2)((function(t,e){const r=m(t)&&E(e);const i=E(t)&&m(e);return r||i}),"isArchitectureDirectionXY");var T=(0,s.K2)((function(t){const e=t[0];const r=t[1];const i=m(e)&&E(r);const n=E(e)&&m(r);return i||n}),"isArchitecturePairXY");var A=(0,s.K2)((function(t){return t!=="LL"&&t!=="RR"&&t!=="TT"&&t!=="BB"}),"isValidArchitectureDirectionPair");var w=(0,s.K2)((function(t,e){const r=`${t}${e}`;return A(r)?r:void 0}),"getArchitectureDirectionPair");var C=(0,s.K2)((function([t,e],r){const i=r[0];const n=r[1];if(m(i)){if(E(n)){return[t+(i==="L"?-1:1),e+(n==="T"?1:-1)]}else{return[t+(i==="L"?-1:1),e]}}else{if(m(n)){return[t+(n==="L"?1:-1),e+(i==="T"?1:-1)]}else{return[t,e+(i==="T"?1:-1)]}}}),"shiftPositionByArchitectureDirectionPair");var L=(0,s.K2)((function(t){if(t==="LT"||t==="TL"){return[1,1]}else if(t==="BL"||t==="LB"){return[1,-1]}else if(t==="BR"||t==="RB"){return[-1,-1]}else{return[-1,1]}}),"getArchitectureDirectionXYFactors");var I=(0,s.K2)((function(t,e){if(N(t,e)){return"bend"}else if(m(t)){return"horizontal"}return"vertical"}),"getArchitectureDirectionAlignment");var _=(0,s.K2)((function(t){const e=t;return e.type==="service"}),"isArchitectureService");var M=(0,s.K2)((function(t){const e=t;return e.type==="junction"}),"isArchitectureJunction");var x=(0,s.K2)((t=>t.data()),"edgeData");var O=(0,s.K2)((t=>t.data()),"nodeData");var D=s.UI.architecture;var b=class{constructor(){this.nodes={};this.groups={};this.edges=[];this.registeredIds={};this.elements={};this.setAccTitle=s.SV;this.getAccTitle=s.iN;this.setDiagramTitle=s.ke;this.getDiagramTitle=s.ab;this.getAccDescription=s.m7;this.setAccDescription=s.EI;this.clear()}static{(0,s.K2)(this,"ArchitectureDB")}clear(){this.nodes={};this.groups={};this.edges=[];this.registeredIds={};this.dataStructures=void 0;this.elements={};(0,s.IU)()}addService({id:t,icon:e,in:r,title:i,iconText:n}){if(this.registeredIds[t]!==void 0){throw new Error(`The service id [${t}] is already in use by another ${this.registeredIds[t]}`)}if(r!==void 0){if(t===r){throw new Error(`The service [${t}] cannot be placed within itself`)}if(this.registeredIds[r]===void 0){throw new Error(`The service [${t}]'s parent does not exist. Please make sure the parent is created before this service`)}if(this.registeredIds[r]==="node"){throw new Error(`The service [${t}]'s parent is not a group`)}}this.registeredIds[t]="node";this.nodes[t]={id:t,type:"service",icon:e,iconText:n,title:i,edges:[],in:r}}getServices(){return Object.values(this.nodes).filter(_)}addJunction({id:t,in:e}){this.registeredIds[t]="node";this.nodes[t]={id:t,type:"junction",edges:[],in:e}}getJunctions(){return Object.values(this.nodes).filter(M)}getNodes(){return Object.values(this.nodes)}getNode(t){return this.nodes[t]??null}addGroup({id:t,icon:e,in:r,title:i}){if(this.registeredIds?.[t]!==void 0){throw new Error(`The group id [${t}] is already in use by another ${this.registeredIds[t]}`)}if(r!==void 0){if(t===r){throw new Error(`The group [${t}] cannot be placed within itself`)}if(this.registeredIds?.[r]===void 0){throw new Error(`The group [${t}]'s parent does not exist. Please make sure the parent is created before this group`)}if(this.registeredIds?.[r]==="node"){throw new Error(`The group [${t}]'s parent is not a group`)}}this.registeredIds[t]="group";this.groups[t]={id:t,icon:e,title:i,in:r}}getGroups(){return Object.values(this.groups)}addEdge({lhsId:t,rhsId:e,lhsDir:r,rhsDir:i,lhsInto:n,rhsInto:o,lhsGroup:a,rhsGroup:s,title:h}){if(!y(r)){throw new Error(`Invalid direction given for left hand side of edge ${t}--${e}. Expected (L,R,T,B) got ${String(r)}`)}if(!y(i)){throw new Error(`Invalid direction given for right hand side of edge ${t}--${e}. Expected (L,R,T,B) got ${String(i)}`)}if(this.nodes[t]===void 0&&this.groups[t]===void 0){throw new Error(`The left-hand id [${t}] does not yet exist. Please create the service/group before declaring an edge to it.`)}if(this.nodes[e]===void 0&&this.groups[e]===void 0){throw new Error(`The right-hand id [${e}] does not yet exist. Please create the service/group before declaring an edge to it.`)}const l=this.nodes[t].in;const c=this.nodes[e].in;if(a&&l&&c&&l==c){throw new Error(`The left-hand id [${t}] is modified to traverse the group boundary, but the edge does not pass through two groups.`)}if(s&&l&&c&&l==c){throw new Error(`The right-hand id [${e}] is modified to traverse the group boundary, but the edge does not pass through two groups.`)}const f={lhsId:t,lhsDir:r,lhsInto:n,lhsGroup:a,rhsId:e,rhsDir:i,rhsInto:o,rhsGroup:s,title:h};this.edges.push(f);if(this.nodes[t]&&this.nodes[e]){this.nodes[t].edges.push(this.edges[this.edges.length-1]);this.nodes[e].edges.push(this.edges[this.edges.length-1])}}getEdges(){return this.edges}getDataStructures(){if(this.dataStructures===void 0){const t={};const e=Object.entries(this.nodes).reduce(((e,[r,i])=>{e[r]=i.edges.reduce(((e,i)=>{const n=this.getNode(i.lhsId)?.in;const o=this.getNode(i.rhsId)?.in;if(n&&o&&n!==o){const e=I(i.lhsDir,i.rhsDir);if(e!=="bend"){t[n]??={};t[n][o]=e;t[o]??={};t[o][n]=e}}if(i.lhsId===r){const t=w(i.lhsDir,i.rhsDir);if(t){e[t]=i.rhsId}}else{const t=w(i.rhsDir,i.lhsDir);if(t){e[t]=i.lhsId}}return e}),{});return e}),{});const r=Object.keys(e)[0];const i={[r]:1};const n=Object.keys(e).reduce(((t,e)=>e===r?t:{...t,[e]:1}),{});const o=(0,s.K2)((t=>{const r={[t]:[0,0]};const o=[t];while(o.length>0){const t=o.shift();if(t){i[t]=1;delete n[t];const a=e[t];const[s,h]=r[t];Object.entries(a).forEach((([t,e])=>{if(!i[e]){r[e]=C([s,h],t);o.push(e)}}))}}return r}),"BFS");const a=[o(r)];while(Object.keys(n).length>0){a.push(o(Object.keys(n)[0]))}this.dataStructures={adjList:e,spatialMaps:a,groupAlignments:t}}return this.dataStructures}setElementForId(t,e){this.elements[t]=e}getElementById(t){return this.elements[t]}getConfig(){return(0,o.$t)({...D,...(0,s.zj)().architecture})}getConfigField(t){return this.getConfig()[t]}};var R=(0,s.K2)(((t,e)=>{(0,n.S)(t,e);t.groups.map((t=>e.addGroup(t)));t.services.map((t=>e.addService({...t,type:"service"})));t.junctions.map((t=>e.addJunction({...t,type:"junction"})));t.edges.map((t=>e.addEdge(t)))}),"populateDb");var F={parser:{yy:void 0},parse:(0,s.K2)((async t=>{const e=await(0,h.qg)("architecture",t);s.Rm.debug(e);const r=F.parser?.yy;if(!(r instanceof b)){throw new Error("parser.parser?.yy was not a ArchitectureDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.")}R(e,r)}),"parse")};var G=(0,s.K2)((t=>`\n .edge {\n stroke-width: ${t.archEdgeWidth};\n stroke: ${t.archEdgeColor};\n fill: none;\n }\n\n .arrow {\n fill: ${t.archEdgeArrowColor};\n }\n\n .node-bkg {\n fill: none;\n stroke: ${t.archGroupBorderColor};\n stroke-width: ${t.archGroupBorderWidth};\n stroke-dasharray: 8;\n }\n .node-icon-text {\n display: flex; \n align-items: center;\n }\n \n .node-icon-text > div {\n color: #fff;\n margin: 1px;\n height: fit-content;\n text-align: center;\n overflow: hidden;\n display: -webkit-box;\n -webkit-box-orient: vertical;\n }\n`),"getStyles");var S=G;var P=(0,s.K2)((t=>`${t}`),"wrapIcon");var U={prefix:"mermaid-architecture",height:80,width:80,icons:{database:{body:P('')},server:{body:P('')},disk:{body:P('')},internet:{body:P('')},cloud:{body:P('')},unknown:i.Gc,blank:{body:P("")}}};var k=(0,s.K2)((async function(t,e,r){const n=r.getConfigField("padding");const o=r.getConfigField("iconSize");const a=o/2;const h=o/6;const l=h/2;await Promise.all(e.edges().map((async e=>{const{source:o,sourceDir:c,sourceArrow:f,sourceGroup:d,target:g,targetDir:v,targetArrow:y,targetGroup:A,label:C}=x(e);let{x:I,y:_}=e[0].sourceEndpoint();const{x:M,y:O}=e[0].midpoint();let{x:D,y:b}=e[0].targetEndpoint();const R=n+4;if(d){if(m(c)){I+=c==="L"?-R:R}else{_+=c==="T"?-R:R+18}}if(A){if(m(v)){D+=v==="L"?-R:R}else{b+=v==="T"?-R:R+18}}if(!d&&r.getNode(o)?.type==="junction"){if(m(c)){I+=c==="L"?a:-a}else{_+=c==="T"?a:-a}}if(!A&&r.getNode(g)?.type==="junction"){if(m(v)){D+=v==="L"?a:-a}else{b+=v==="T"?a:-a}}if(e[0]._private.rscratch){const e=t.insert("g");e.insert("path").attr("d",`M ${I},${_} L ${M},${O} L${D},${b} `).attr("class","edge");if(f){const t=m(c)?p[c](I,h):I-l;const r=E(c)?p[c](_,h):_-l;e.insert("polygon").attr("points",u[c](h)).attr("transform",`translate(${t},${r})`).attr("class","arrow")}if(y){const t=m(v)?p[v](D,h):D-l;const r=E(v)?p[v](b,h):b-l;e.insert("polygon").attr("points",u[v](h)).attr("transform",`translate(${t},${r})`).attr("class","arrow")}if(C){const t=!N(c,v)?m(c)?"X":"Y":"XY";let r=0;if(t==="X"){r=Math.abs(I-D)}else if(t==="Y"){r=Math.abs(_-b)/1.5}else{r=Math.abs(I-D)/2}const n=e.append("g");await(0,i.GZ)(n,C,{useHtmlLabels:false,width:r,classes:"architecture-service-label"},(0,s.D7)());n.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle");if(t==="X"){n.attr("transform","translate("+M+", "+O+")")}else if(t==="Y"){n.attr("transform","translate("+M+", "+O+") rotate(-90)")}else if(t==="XY"){const t=w(c,v);if(t&&T(t)){const e=n.node().getBoundingClientRect();const[r,i]=L(t);n.attr("dominant-baseline","auto").attr("transform",`rotate(${-1*r*i*45})`);const o=n.node().getBoundingClientRect();n.attr("transform",`\n translate(${M}, ${O-e.height/2})\n translate(${r*o.width/2}, ${i*o.height/2})\n rotate(${-1*r*i*45}, 0, ${e.height/2})\n `)}}}}})))}),"drawEdges");var Y=(0,s.K2)((async function(t,e,r){const n=r.getConfigField("padding");const o=n*.75;const a=r.getConfigField("fontSize");const h=r.getConfigField("iconSize");const l=h/2;await Promise.all(e.nodes().map((async e=>{const r=O(e);if(r.type==="group"){const{h:n,w:h,x1:c,y1:f}=e.boundingBox();t.append("rect").attr("x",c+l).attr("y",f+l).attr("width",h).attr("height",n).attr("class","node-bkg");const d=t.append("g");let g=c;let u=f;if(r.icon){const t=d.append("g");t.html(`${await(0,i.WY)(r.icon,{height:o,width:o,fallbackPrefix:U.prefix})}`);t.attr("transform","translate("+(g+l+1)+", "+(u+l+1)+")");g+=o;u+=a/2-1-2}if(r.label){const t=d.append("g");await(0,i.GZ)(t,r.label,{useHtmlLabels:false,width:h,classes:"architecture-service-label"},(0,s.D7)());t.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","start").attr("text-anchor","start");t.attr("transform","translate("+(g+l+4)+", "+(u+l+2)+")")}}})))}),"drawGroups");var H=(0,s.K2)((async function(t,e,r){const n=(0,s.D7)();for(const o of r){const r=e.append("g");const a=t.getConfigField("iconSize");if(o.title){const t=r.append("g");await(0,i.GZ)(t,o.title,{useHtmlLabels:false,width:a*1.5,classes:"architecture-service-label"},n);t.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle");t.attr("transform","translate("+a/2+", "+a+")")}const h=r.append("g");if(o.icon){h.html(`${await(0,i.WY)(o.icon,{height:a,width:a,fallbackPrefix:U.prefix})}`)}else if(o.iconText){h.html(`${await(0,i.WY)("blank",{height:a,width:a,fallbackPrefix:U.prefix})}`);const t=h.append("g");const e=t.append("foreignObject").attr("width",a).attr("height",a);const r=e.append("div").attr("class","node-icon-text").attr("style",`height: ${a}px;`).append("div").html((0,s.jZ)(o.iconText,n));const l=parseInt(window.getComputedStyle(r.node(),null).getPropertyValue("font-size").replace(/\D/g,""))??16;r.attr("style",`-webkit-line-clamp: ${Math.floor((a-2)/l)};`)}else{h.append("path").attr("class","node-bkg").attr("id","node-"+o.id).attr("d",`M0 ${a} v${-a} q0,-5 5,-5 h${a} q5,0 5,5 v${a} H0 Z`)}r.attr("class","architecture-service");const{width:l,height:c}=r._groups[0][0].getBBox();o.width=l;o.height=c;t.setElementForId(o.id,r)}return 0}),"drawServices");var X=(0,s.K2)((function(t,e,r){r.forEach((r=>{const i=e.append("g");const n=t.getConfigField("iconSize");const o=i.append("g");o.append("rect").attr("id","node-"+r.id).attr("fill-opacity","0").attr("width",n).attr("height",n);i.attr("class","architecture-junction");const{width:a,height:s}=i._groups[0][0].getBBox();i.width=a;i.height=s;t.setElementForId(r.id,i)}))}),"drawJunctions");(0,i.pC)([{name:U.prefix,icons:U}]);l.A.use(f());function z(t,e,r){t.forEach((t=>{e.add({group:"nodes",data:{type:"service",id:t.id,icon:t.icon,label:t.title,parent:t.in,width:r.getConfigField("iconSize"),height:r.getConfigField("iconSize")},classes:"node-service"})}))}(0,s.K2)(z,"addServices");function B(t,e,r){t.forEach((t=>{e.add({group:"nodes",data:{type:"junction",id:t.id,parent:t.in,width:r.getConfigField("iconSize"),height:r.getConfigField("iconSize")},classes:"node-junction"})}))}(0,s.K2)(B,"addJunctions");function V(t,e){e.nodes().map((e=>{const r=O(e);if(r.type==="group"){return}r.x=e.position().x;r.y=e.position().y;const i=t.getElementById(r.id);i.attr("transform","translate("+(r.x||0)+","+(r.y||0)+")")}))}(0,s.K2)(V,"positionNodes");function W(t,e){t.forEach((t=>{e.add({group:"nodes",data:{type:"group",id:t.id,icon:t.icon,label:t.title,parent:t.in},classes:"node-group"})}))}(0,s.K2)(W,"addGroups");function j(t,e){t.forEach((t=>{const{lhsId:r,rhsId:i,lhsInto:n,lhsGroup:o,rhsInto:a,lhsDir:s,rhsDir:h,rhsGroup:l,title:c}=t;const f=N(t.lhsDir,t.rhsDir)?"segments":"straight";const d={id:`${r}-${i}`,label:c,source:r,sourceDir:s,sourceArrow:n,sourceGroup:o,sourceEndpoint:s==="L"?"0 50%":s==="R"?"100% 50%":s==="T"?"50% 0":"50% 100%",target:i,targetDir:h,targetArrow:a,targetGroup:l,targetEndpoint:h==="L"?"0 50%":h==="R"?"100% 50%":h==="T"?"50% 0":"50% 100%"};e.add({group:"edges",data:d,classes:f})}))}(0,s.K2)(j,"addEdges");function q(t,e,r){const i=(0,s.K2)(((t,e)=>Object.entries(t).reduce(((t,[i,n])=>{let o=0;const a=Object.entries(n);if(a.length===1){t[i]=a[0][1];return t}for(let s=0;s{const r={};const n={};Object.entries(e).forEach((([e,[i,o]])=>{const a=t.getNode(e)?.in??"default";r[o]??={};r[o][a]??=[];r[o][a].push(e);n[i]??={};n[i][a]??=[];n[i][a].push(e)}));return{horiz:Object.values(i(r,"horizontal")).filter((t=>t.length>1)),vert:Object.values(i(n,"vertical")).filter((t=>t.length>1))}}));const[o,a]=n.reduce((([t,e],{horiz:r,vert:i})=>[[...t,...r],[...e,...i]]),[[],[]]);return{horizontal:o,vertical:a}}(0,s.K2)(q,"getAlignments");function $(t,e){const r=[];const i=(0,s.K2)((t=>`${t[0]},${t[1]}`),"posToStr");const n=(0,s.K2)((t=>t.split(",").map((t=>parseInt(t)))),"strToPos");t.forEach((t=>{const o=Object.fromEntries(Object.entries(t).map((([t,e])=>[i(e),t])));const a=[i([0,0])];const s={};const h={L:[-1,0],R:[1,0],T:[0,1],B:[0,-1]};while(a.length>0){const t=a.shift();if(t){s[t]=1;const l=o[t];if(l){const c=n(t);Object.entries(h).forEach((([t,n])=>{const h=i([c[0]+n[0],c[1]+n[1]]);const f=o[h];if(f&&!s[h]){a.push(h);r.push({[g[t]]:f,[g[v(t)]]:l,gap:1.5*e.getConfigField("iconSize")})}}))}}}}));return r}(0,s.K2)($,"getRelativeConstraints");function K(t,e,r,i,n,{spatialMaps:o,groupAlignments:a}){return new Promise((h=>{const c=(0,d.Ltv)("body").append("div").attr("id","cy").attr("style","display:none");const f=(0,l.A)({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"straight",label:"data(label)","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"edge.segments",style:{"curve-style":"segments","segment-weights":"0","segment-distances":[.5],"edge-distances":"endpoints","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"node",style:{"compound-sizing-wrt-labels":"include"}},{selector:"node[label]",style:{"text-valign":"bottom","text-halign":"center","font-size":`${n.getConfigField("fontSize")}px`}},{selector:".node-service",style:{label:"data(label)",width:"data(width)",height:"data(height)"}},{selector:".node-junction",style:{width:"data(width)",height:"data(height)"}},{selector:".node-group",style:{padding:`${n.getConfigField("padding")}px`}}],layout:{name:"grid",boundingBox:{x1:0,x2:100,y1:0,y2:100}}});c.remove();W(r,f);z(t,f,n);B(e,f,n);j(i,f);const g=q(n,o,a);const u=$(o,n);const p=f.layout({name:"fcose",quality:"proof",styleEnabled:false,animate:false,nodeDimensionsIncludeLabels:false,idealEdgeLength(t){const[e,r]=t.connectedNodes();const{parent:i}=O(e);const{parent:o}=O(r);const a=i===o?1.5*n.getConfigField("iconSize"):.5*n.getConfigField("iconSize");return a},edgeElasticity(t){const[e,r]=t.connectedNodes();const{parent:i}=O(e);const{parent:n}=O(r);const o=i===n?.45:.001;return o},alignmentConstraint:g,relativePlacementConstraint:u});p.one("layoutstop",(()=>{function t(t,e,r,i){let n,o;const{x:a,y:s}=t;const{x:h,y:l}=e;o=(i-s+(a-r)*(s-l)/(a-h))/Math.sqrt(1+Math.pow((s-l)/(a-h),2));n=Math.sqrt(Math.pow(i-s,2)+Math.pow(r-a,2)-Math.pow(o,2));const c=Math.sqrt(Math.pow(h-a,2)+Math.pow(l-s,2));n=n/c;let f=(h-a)*(i-s)-(l-s)*(r-a);switch(true){case f>=0:f=1;break;case f<0:f=-1;break}let d=(h-a)*(r-a)+(l-s)*(i-s);switch(true){case d>=0:d=1;break;case d<0:d=-1;break}o=Math.abs(o)*f;n=n*d;return{distances:o,weights:n}}(0,s.K2)(t,"getSegmentWeights");f.startBatch();for(const e of Object.values(f.edges())){if(e.data?.()){const{x:r,y:i}=e.source().position();const{x:n,y:o}=e.target().position();if(r!==n&&i!==o){const r=e.sourceEndpoint();const i=e.targetEndpoint();const{sourceDir:n}=x(e);const[o,a]=E(n)?[r.x,i.y]:[i.x,r.y];const{weights:s,distances:h}=t(r,i,o,a);e.style("segment-distances",h);e.style("segment-weights",s)}}}f.endBatch();p.run()}));p.run();f.ready((t=>{s.Rm.info("Ready",t);h(f)}))}))}(0,s.K2)(K,"layoutArchitecture");var Z=(0,s.K2)((async(t,e,r,i)=>{const n=i.db;const o=n.getServices();const h=n.getJunctions();const l=n.getGroups();const c=n.getEdges();const f=n.getDataStructures();const d=(0,a.D)(e);const g=d.append("g");g.attr("class","architecture-edges");const u=d.append("g");u.attr("class","architecture-services");const p=d.append("g");p.attr("class","architecture-groups");await H(n,u,o);X(n,u,h);const v=await K(o,h,l,c,n,f);await k(g,v,n);await Y(p,v,n);V(n,v);(0,s.ot)(void 0,d,n.getConfigField("padding"),n.getConfigField("useMaxWidth"))}),"draw");var Q={draw:Z};var J={parser:F,get db(){return new b},renderer:Q,styles:S}},51916:(t,e,r)=>{"use strict";r.d(e,{S:()=>n});var i=r(6047);function n(t,e){if(t.accDescr){e.setAccDescription?.(t.accDescr)}if(t.accTitle){e.setAccTitle?.(t.accTitle)}if(t.title){e.setDiagramTitle?.(t.title)}}(0,i.K2)(n,"populateCommonDb")}}]);