(self.webpackChunkjupyter_web=self.webpackChunkjupyter_web||[]).push([[8257],{10795:function(ee,vt,Et){var R;ee.exports=(R=Et(34355),(()=>{"use strict";var y={658:o=>{o.exports=null!=Object.assign?Object.assign.bind(Object):function(E){for(var t=arguments.length,d=Array(t>1?t-1:0),e=1;e{var d=function(){function l(g,c){var T=[],f=!0,A=!1,N=void 0;try{for(var D,L=g[Symbol.iterator]();!(f=(D=L.next()).done)&&(T.push(D.value),!c||T.length!==c);f=!0);}catch(et){A=!0,N=et}finally{try{!f&&L.return&&L.return()}finally{if(A)throw N}}return T}return function(g,c){if(Array.isArray(g))return g;if(Symbol.iterator in Object(g))return l(g,c);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),e=t(140).layoutBase.LinkedList,r={getTopMostNodes:function(l){for(var g={},c=0;c0&&I.merge(P)});for(var w=0;w1){D=N[0],et=D.connectedEdges().length,N.forEach(function(p){p.connectedEdges().length0&&T.set("dummy"+(T.size+1),dt),ct},relocateComponent:function(l,g,c){if(!c.fixedNodeConstraint){var T=Number.POSITIVE_INFINITY,f=Number.NEGATIVE_INFINITY,A=Number.POSITIVE_INFINITY,N=Number.NEGATIVE_INFINITY;if("draft"==c.quality){var L=!0,D=!1,et=void 0;try{for(var nt,x=g.nodeIndexes[Symbol.iterator]();!(L=(nt=x.next()).done);L=!0){var dt=nt.value,ct=d(dt,2),mt=ct[0],b=ct[1],J=c.cy.getElementById(mt);if(J){var i=J.boundingBox(),m=g.xCoords[b]-i.w/2,h=g.xCoords[b]+i.w/2,u=g.yCoords[b]-i.h/2,p=g.yCoords[b]+i.h/2;mf&&(f=h),uN&&(N=p)}}}catch(P){D=!0,et=P}finally{try{!L&&x.return&&x.return()}finally{if(D)throw et}}var I=l.x-(f+T)/2,w=l.y-(N+A)/2;g.xCoords=g.xCoords.map(function(P){return P+I}),g.yCoords=g.yCoords.map(function(P){return P+w})}else{Object.keys(g).forEach(function(P){var _=g[P],lt=_.getRect().x,H=_.getRect().x+_.getRect().width,ht=_.getRect().y,tt=_.getRect().y+_.getRect().height;ltf&&(f=H),htN&&(N=tt)});var X=l.x-(f+T)/2,Y=l.y-(N+A)/2;Object.keys(g).forEach(function(P){var _=g[P];_.setCenter(_.getCenterX()+X,_.getCenterY()+Y)})}}},calcBoundingBox:function(l,g,c,T){for(var f=Number.MAX_SAFE_INTEGER,A=Number.MIN_SAFE_INTEGER,N=Number.MAX_SAFE_INTEGER,L=Number.MIN_SAFE_INTEGER,D=void 0,et=void 0,x=void 0,nt=void 0,dt=l.descendants().not(":parent"),ct=dt.length,mt=0;mt(D=g[T.get(b.id())]-b.width()/2)&&(f=D),A<(et=g[T.get(b.id())]+b.width()/2)&&(A=et),N>(x=c[T.get(b.id())]-b.height()/2)&&(N=x),L<(nt=c[T.get(b.id())]+b.height()/2)&&(L=nt)}var J={};return J.topLeftX=f,J.topLeftY=N,J.width=A-f,J.height=L-N,J},calcParentsWithoutChildren:function(l,g){var c=l.collection();return g.nodes(":parent").forEach(function(T){var f=!1;T.children().forEach(function(A){"none"!=A.css("display")&&(f=!0)}),f||c.merge(T)}),c}};o.exports=r},816:(o,E,t)=>{var d=t(548),e=t(140).CoSELayout,r=t(140).CoSENode,l=t(140).layoutBase.PointD,g=t(140).layoutBase.DimensionD,c=t(140).layoutBase.LayoutConstants,T=t(140).layoutBase.FDLayoutConstants,f=t(140).CoSEConstants,A=function(L,D){var et=L.cy,x=L.eles,nt=x.nodes(),dt=x.edges(),ct=void 0,mt=void 0,b=void 0,J={};L.randomize&&(ct=D.nodeIndexes,mt=D.xCoords,b=D.yCoords);var i=function(P){return"function"==typeof P},m=function(P,_){return i(P)?P(_):P},h=d.calcParentsWithoutChildren(et,x),u=function Y(P,_,lt,H){for(var ht=_.length,tt=0;tt0&&Y(lt.getGraphManager().add(lt.newGraph(),Z),z,lt,H)}},p=function(P,_,lt){for(var H=0,ht=0,tt=0;tt0?f.DEFAULT_EDGE_LENGTH=T.DEFAULT_EDGE_LENGTH=H/ht:i(L.idealEdgeLength)?f.DEFAULT_EDGE_LENGTH=T.DEFAULT_EDGE_LENGTH=50:f.DEFAULT_EDGE_LENGTH=T.DEFAULT_EDGE_LENGTH=L.idealEdgeLength,f.MIN_REPULSION_DIST=T.MIN_REPULSION_DIST=T.DEFAULT_EDGE_LENGTH/10,f.DEFAULT_RADIAL_SEPARATION=T.DEFAULT_EDGE_LENGTH)},I=function(P,_){_.fixedNodeConstraint&&(P.constraints.fixedNodeConstraint=_.fixedNodeConstraint),_.alignmentConstraint&&(P.constraints.alignmentConstraint=_.alignmentConstraint),_.relativePlacementConstraint&&(P.constraints.relativePlacementConstraint=_.relativePlacementConstraint)};null!=L.nestingFactor&&(f.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=T.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=L.nestingFactor),null!=L.gravity&&(f.DEFAULT_GRAVITY_STRENGTH=T.DEFAULT_GRAVITY_STRENGTH=L.gravity),null!=L.numIter&&(f.MAX_ITERATIONS=T.MAX_ITERATIONS=L.numIter),null!=L.gravityRange&&(f.DEFAULT_GRAVITY_RANGE_FACTOR=T.DEFAULT_GRAVITY_RANGE_FACTOR=L.gravityRange),null!=L.gravityCompound&&(f.DEFAULT_COMPOUND_GRAVITY_STRENGTH=T.DEFAULT_COMPOUND_GRAVITY_STRENGTH=L.gravityCompound),null!=L.gravityRangeCompound&&(f.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=T.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=L.gravityRangeCompound),null!=L.initialEnergyOnIncremental&&(f.DEFAULT_COOLING_FACTOR_INCREMENTAL=T.DEFAULT_COOLING_FACTOR_INCREMENTAL=L.initialEnergyOnIncremental),null!=L.tilingCompareBy&&(f.TILING_COMPARE_BY=L.tilingCompareBy),"proof"==L.quality?c.QUALITY=2:c.QUALITY=0,f.NODE_DIMENSIONS_INCLUDE_LABELS=T.NODE_DIMENSIONS_INCLUDE_LABELS=c.NODE_DIMENSIONS_INCLUDE_LABELS=L.nodeDimensionsIncludeLabels,f.DEFAULT_INCREMENTAL=T.DEFAULT_INCREMENTAL=c.DEFAULT_INCREMENTAL=!L.randomize,f.ANIMATE=T.ANIMATE=c.ANIMATE=L.animate,f.TILE=L.tile,f.TILING_PADDING_VERTICAL="function"==typeof L.tilingPaddingVertical?L.tilingPaddingVertical.call():L.tilingPaddingVertical,f.TILING_PADDING_HORIZONTAL="function"==typeof L.tilingPaddingHorizontal?L.tilingPaddingHorizontal.call():L.tilingPaddingHorizontal,f.DEFAULT_INCREMENTAL=T.DEFAULT_INCREMENTAL=c.DEFAULT_INCREMENTAL=!0,f.PURE_INCREMENTAL=!L.randomize,c.DEFAULT_UNIFORM_LEAF_NODE_SIZES=L.uniformNodeDimensions,"transformed"==L.step&&(f.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,f.ENFORCE_CONSTRAINTS=!1,f.APPLY_LAYOUT=!1),"enforced"==L.step&&(f.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,f.ENFORCE_CONSTRAINTS=!0,f.APPLY_LAYOUT=!1),"cose"==L.step&&(f.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,f.ENFORCE_CONSTRAINTS=!1,f.APPLY_LAYOUT=!0),"all"==L.step&&(L.randomize?f.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:f.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,f.ENFORCE_CONSTRAINTS=!0,f.APPLY_LAYOUT=!0),L.fixedNodeConstraint||L.alignmentConstraint||L.relativePlacementConstraint?f.TREE_REDUCTION_ON_INCREMENTAL=!1:f.TREE_REDUCTION_ON_INCREMENTAL=!0;var w=new e,X=w.newGraphManager();return u(X.addRoot(),d.getTopMostNodes(nt),w,L),p(w,X,dt),I(w,L),w.runLayout(),J};o.exports={coseLayout:A}},212:(o,E,t)=>{var d=function(){function L(D,et){for(var x=0;x0)if(p){var X=l.getTopMostNodes(x.eles.nodes());if((i=l.connectComponents(nt,x.eles,X)).forEach(function(ut){var gt=ut.boundingBox();m.push({x:gt.x1+gt.w/2,y:gt.y1+gt.h/2})}),x.randomize&&i.forEach(function(ut){x.eles=ut,ct.push(c(x))}),"default"==x.quality||"proof"==x.quality){var Y=nt.collection();if(x.tile){var H=0,ht={nodeIndexes:new Map,xCoords:[],yCoords:[]},tt=[];if(i.forEach(function(ut,gt){0==ut.edges().length&&(ut.nodes().forEach(function(xt,Dt){Y.merge(ut.nodes()[Dt]),xt.isParent()||(ht.nodeIndexes.set(ut.nodes()[Dt].id(),H++),ht.xCoords.push(ut.nodes()[0].position().x),ht.yCoords.push(ut.nodes()[0].position().y))}),tt.push(gt))}),Y.length>1){var O=Y.boundingBox();m.push({x:O.x1+O.w/2,y:O.y1+O.h/2}),i.push(Y),ct.push(ht);for(var z=tt.length-1;z>=0;z--)i.splice(tt[z],1),ct.splice(tt[z],1),m.splice(tt[z],1)}}i.forEach(function(ut,gt){x.eles=ut,J.push(f(x,ct[gt])),l.relocateComponent(m[gt],J[gt],x)})}else i.forEach(function(ut,gt){l.relocateComponent(m[gt],ct[gt],x)});var Z=new Set;if(i.length>1){var st=[],ft=dt.filter(function(ut){return"none"==ut.css("display")});i.forEach(function(ut,gt){var xt=void 0;if("draft"==x.quality&&(xt=ct[gt].nodeIndexes),ut.nodes().not(ft).length>0){var Dt={edges:[],nodes:[]},Mt=void 0;ut.nodes().not(ft).forEach(function(Ct){if("draft"==x.quality)if(Ct.isParent()){var At=l.calcBoundingBox(Ct,ct[gt].xCoords,ct[gt].yCoords,xt);Dt.nodes.push({x:At.topLeftX,y:At.topLeftY,width:At.width,height:At.height})}else Mt=xt.get(Ct.id()),Dt.nodes.push({x:ct[gt].xCoords[Mt]-Ct.boundingbox().w/2,y:ct[gt].yCoords[Mt]-Ct.boundingbox().h/2,width:Ct.boundingbox().w,height:Ct.boundingbox().h});else J[gt][Ct.id()]&&Dt.nodes.push({x:J[gt][Ct.id()].getLeft(),y:J[gt][Ct.id()].getTop(),width:J[gt][Ct.id()].getWidth(),height:J[gt][Ct.id()].getHeight()})}),ut.edges().forEach(function(Ct){var At=Ct.source(),Rt=Ct.target();if("none"!=At.css("display")&&"none"!=Rt.css("display"))if("draft"==x.quality){var Ht=xt.get(At.id()),Qt=xt.get(Rt.id()),bt=[],Yt=[];if(At.isParent()){var Xt=l.calcBoundingBox(At,ct[gt].xCoords,ct[gt].yCoords,xt);bt.push(Xt.topLeftX+Xt.width/2),bt.push(Xt.topLeftY+Xt.height/2)}else bt.push(ct[gt].xCoords[Ht]),bt.push(ct[gt].yCoords[Ht]);if(Rt.isParent()){var V=l.calcBoundingBox(Rt,ct[gt].xCoords,ct[gt].yCoords,xt);Yt.push(V.topLeftX+V.width/2),Yt.push(V.topLeftY+V.height/2)}else Yt.push(ct[gt].xCoords[Qt]),Yt.push(ct[gt].yCoords[Qt]);Dt.edges.push({startX:bt[0],startY:bt[1],endX:Yt[0],endY:Yt[1]})}else J[gt][At.id()]&&J[gt][Rt.id()]&&Dt.edges.push({startX:J[gt][At.id()].getCenterX(),startY:J[gt][At.id()].getCenterY(),endX:J[gt][Rt.id()].getCenterX(),endY:J[gt][Rt.id()].getCenterY()})}),Dt.nodes.length>0&&(st.push(Dt),Z.add(gt))}});var it=u.packComponents(st,x.randomize).shifts;if("draft"==x.quality)ct.forEach(function(ut,gt){var xt=ut.xCoords.map(function(Mt){return Mt+it[gt].dx}),Dt=ut.yCoords.map(function(Mt){return Mt+it[gt].dy});ut.xCoords=xt,ut.yCoords=Dt});else{var Pt=0;Z.forEach(function(ut){Object.keys(J[ut]).forEach(function(gt){var xt=J[ut][gt];xt.setCenter(xt.getCenterX()+it[Pt].dx,xt.getCenterY()+it[Pt].dy)}),Pt++})}}}else{var I=x.eles.boundingBox();if(m.push({x:I.x1+I.w/2,y:I.y1+I.h/2}),x.randomize){var w=c(x);ct.push(w)}"default"==x.quality||"proof"==x.quality?(J.push(f(x,ct[0])),l.relocateComponent(m[0],J[0],x)):l.relocateComponent(m[0],ct[0],x)}var Lt=function(gt,xt){if("default"==x.quality||"proof"==x.quality){"number"==typeof gt&&(gt=xt);var Dt=void 0,Mt=void 0,Ct=gt.data("id");return J.forEach(function(Rt){Ct in Rt&&(Dt={x:Rt[Ct].getRect().getCenterX(),y:Rt[Ct].getRect().getCenterY()},Mt=Rt[Ct])}),x.nodeDimensionsIncludeLabels&&(Mt.labelWidth&&("left"==Mt.labelPosHorizontal?Dt.x+=Mt.labelWidth/2:"right"==Mt.labelPosHorizontal&&(Dt.x-=Mt.labelWidth/2)),Mt.labelHeight&&("top"==Mt.labelPosVertical?Dt.y+=Mt.labelHeight/2:"bottom"==Mt.labelPosVertical&&(Dt.y-=Mt.labelHeight/2))),null==Dt&&(Dt={x:gt.position("x"),y:gt.position("y")}),{x:Dt.x,y:Dt.y}}var At=void 0;return ct.forEach(function(Rt){var Ht=Rt.nodeIndexes.get(gt.id());null!=Ht&&(At={x:Rt.xCoords[Ht],y:Rt.yCoords[Ht]})}),null==At&&(At={x:gt.position("x"),y:gt.position("y")}),{x:At.x,y:At.y}};if("default"==x.quality||"proof"==x.quality||x.randomize){var Kt=l.calcParentsWithoutChildren(nt,dt),Ut=dt.filter(function(ut){return"none"==ut.css("display")});x.eles=dt.not(Ut),dt.nodes().not(":parent").not(Ut).layoutPositions(et,x,Lt),Kt.length>0&&Kt.forEach(function(ut){ut.position(Lt(ut))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),L}();o.exports=N},657:(o,E,t)=>{var d=t(548),e=t(140).layoutBase.Matrix,r=t(140).layoutBase.SVD,l=function(c){var T=c.cy,f=c.eles,A=f.nodes(),N=f.nodes(":parent"),L=new Map,D=new Map,et=new Map,x=[],nt=[],dt=[],ct=[],mt=[],b=[],J=[],i=[],h=void 0,u=1e8,p=1e-9,I=c.piTol,w=c.samplingType,X=c.nodeSeparation,Y=void 0,P=function(){for(var q=0,v=0,M=!1;v=k;){S=C[k++];for(var W=x[S],K=0;Kot&&(ot=mt[B],U=B)}return U},lt=function(q){var v=void 0;if(q){v=Math.floor(Math.random()*h);for(var C=0;C=1)break;ot=$}for(var W=0;W=1)break;ot=$}for(var rt=0;rt0&&(v.isParent()?x[q].push(et.get(v.id())):x[q].push(v.id()))})});var Kt=function(q){var v=D.get(q),M=void 0;L.get(q).forEach(function(C){M=T.getElementById(C).isParent()?et.get(C):C,x[v].push(M),x[D.get(M)].push(q)})},Ut=!0,ut=!1,gt=void 0;try{for(var Dt,xt=L.keys()[Symbol.iterator]();!(Ut=(Dt=xt.next()).done);Ut=!0)Kt(Dt.value)}catch(Q){ut=!0,gt=Q}finally{try{!Ut&&xt.return&&xt.return()}finally{if(ut)throw gt}}var Ct=void 0;if((h=D.size)>2){Y=h{var d=t(212),e=function(l){!l||l("layout","fcose",d)};typeof cytoscape<"u"&&e(cytoscape),o.exports=e},140:o=>{o.exports=R}},s={};function n(o){var E=s[o];if(void 0!==E)return E.exports;var t=s[o]={exports:{}};return y[o](t,t.exports,n),t.exports}return n(579)})())},34355:function(ee,vt,Et){var R;ee.exports=(R=Et(28432),(()=>{"use strict";var y={45:(o,E,t)=>{var d={};d.layoutBase=t(551),d.CoSEConstants=t(806),d.CoSEEdge=t(767),d.CoSEGraph=t(880),d.CoSEGraphManager=t(578),d.CoSELayout=t(765),d.CoSENode=t(991),d.ConstraintHandler=t(902),o.exports=d},806:(o,E,t)=>{var d=t(551).FDLayoutConstants;function e(){}for(var r in d)e[r]=d[r];e.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,e.DEFAULT_RADIAL_SEPARATION=d.DEFAULT_EDGE_LENGTH,e.DEFAULT_COMPONENT_SEPERATION=60,e.TILE=!0,e.TILING_PADDING_VERTICAL=10,e.TILING_PADDING_HORIZONTAL=10,e.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,e.ENFORCE_CONSTRAINTS=!0,e.APPLY_LAYOUT=!0,e.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,e.TREE_REDUCTION_ON_INCREMENTAL=!0,e.PURE_INCREMENTAL=e.DEFAULT_INCREMENTAL,o.exports=e},767:(o,E,t)=>{var d=t(551).FDLayoutEdge;function e(l,g,c){d.call(this,l,g,c)}for(var r in e.prototype=Object.create(d.prototype),d)e[r]=d[r];o.exports=e},880:(o,E,t)=>{var d=t(551).LGraph;function e(l,g,c){d.call(this,l,g,c)}for(var r in e.prototype=Object.create(d.prototype),d)e[r]=d[r];o.exports=e},578:(o,E,t)=>{var d=t(551).LGraphManager;function e(l){d.call(this,l)}for(var r in e.prototype=Object.create(d.prototype),d)e[r]=d[r];o.exports=e},765:(o,E,t)=>{var d=t(551).FDLayout,e=t(578),r=t(880),l=t(991),g=t(767),c=t(806),T=t(902),f=t(551).FDLayoutConstants,A=t(551).LayoutConstants,N=t(551).Point,L=t(551).PointD,D=t(551).DimensionD,et=t(551).Layout,x=t(551).Integer,nt=t(551).IGeometry,dt=t(551).LGraph,ct=t(551).Transform,mt=t(551).LinkedList;function b(){d.call(this),this.toBeTiled={},this.constraints={}}for(var J in b.prototype=Object.create(d.prototype),d)b[J]=d[J];b.prototype.newGraphManager=function(){var i=new e(this);return this.graphManager=i,i},b.prototype.newGraph=function(i){return new r(null,this.graphManager,i)},b.prototype.newNode=function(i){return new l(this.graphManager,i)},b.prototype.newEdge=function(i){return new g(null,null,i)},b.prototype.initParameters=function(){d.prototype.initParameters.call(this,arguments),this.isSubLayout||(c.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=c.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=c.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=f.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=f.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=f.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=f.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},b.prototype.initSpringEmbedder=function(){d.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/f.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},b.prototype.layout=function(){return A.DEFAULT_CREATE_BENDS_AS_NEEDED&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},b.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(c.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var m=new Set(this.getAllNodes()),h=this.nodesWithGravity.filter(function(I){return m.has(I)});this.graphManager.setAllNodesToApplyGravitation(h)}}else{var i=this.getFlatForest();i.length>0?this.positionNodesRadially(i):(this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation(),m=new Set(this.getAllNodes()),h=this.nodesWithGravity.filter(function(u){return m.has(u)}),this.graphManager.setAllNodesToApplyGravitation(h),this.positionNodesRandomly())}return Object.keys(this.constraints).length>0&&(T.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),c.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},b.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished){if(!(this.prunedNodesAll.length>0))return!0;this.isTreeGrowing=!0}if(this.totalIterations%f.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged()){if(!(this.prunedNodesAll.length>0))return!0;this.isTreeGrowing=!0}this.coolingCycle++,0==this.layoutQuality?this.coolingAdjuster=this.coolingCycle:1==this.layoutQuality&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var i=new Set(this.getAllNodes()),m=this.nodesWithGravity.filter(function(p){return i.has(p)});this.graphManager.setAllNodesToApplyGravitation(m),this.graphManager.updateBounds(),this.updateGrid(),c.PURE_INCREMENTAL?this.coolingFactor=f.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=f.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()),c.PURE_INCREMENTAL?this.coolingFactor=f.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=f.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var h=!this.isTreeGrowing&&!this.isGrowthFinished,u=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(h,u),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},b.prototype.getPositionsData=function(){for(var i=this.graphManager.getAllNodes(),m={},h=0;h0&&this.updateDisplacements(),h=0;h0&&(u.fixedNodeWeight=I)}if(this.constraints.relativePlacementConstraint){var w=new Map,X=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(O){i.fixedNodesOnHorizontal.add(O),i.fixedNodesOnVertical.add(O)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical){var Y=this.constraints.alignmentConstraint.vertical;for(h=0;h=2*O.length/3;st--)z=Math.floor(Math.random()*(st+1)),Z=O[st],O[st]=O[z],O[z]=Z;return O},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(O){if(O.left){var z=w.has(O.left)?w.get(O.left):O.left,Z=w.has(O.right)?w.get(O.right):O.right;i.nodesInRelativeHorizontal.includes(z)||(i.nodesInRelativeHorizontal.push(z),i.nodeToRelativeConstraintMapHorizontal.set(z,[]),i.dummyToNodeForVerticalAlignment.has(z)?i.nodeToTempPositionMapHorizontal.set(z,i.idToNodeMap.get(i.dummyToNodeForVerticalAlignment.get(z)[0]).getCenterX()):i.nodeToTempPositionMapHorizontal.set(z,i.idToNodeMap.get(z).getCenterX())),i.nodesInRelativeHorizontal.includes(Z)||(i.nodesInRelativeHorizontal.push(Z),i.nodeToRelativeConstraintMapHorizontal.set(Z,[]),i.dummyToNodeForVerticalAlignment.has(Z)?i.nodeToTempPositionMapHorizontal.set(Z,i.idToNodeMap.get(i.dummyToNodeForVerticalAlignment.get(Z)[0]).getCenterX()):i.nodeToTempPositionMapHorizontal.set(Z,i.idToNodeMap.get(Z).getCenterX())),i.nodeToRelativeConstraintMapHorizontal.get(z).push({right:Z,gap:O.gap}),i.nodeToRelativeConstraintMapHorizontal.get(Z).push({left:z,gap:O.gap})}else{var st=X.has(O.top)?X.get(O.top):O.top,ft=X.has(O.bottom)?X.get(O.bottom):O.bottom;i.nodesInRelativeVertical.includes(st)||(i.nodesInRelativeVertical.push(st),i.nodeToRelativeConstraintMapVertical.set(st,[]),i.dummyToNodeForHorizontalAlignment.has(st)?i.nodeToTempPositionMapVertical.set(st,i.idToNodeMap.get(i.dummyToNodeForHorizontalAlignment.get(st)[0]).getCenterY()):i.nodeToTempPositionMapVertical.set(st,i.idToNodeMap.get(st).getCenterY())),i.nodesInRelativeVertical.includes(ft)||(i.nodesInRelativeVertical.push(ft),i.nodeToRelativeConstraintMapVertical.set(ft,[]),i.dummyToNodeForHorizontalAlignment.has(ft)?i.nodeToTempPositionMapVertical.set(ft,i.idToNodeMap.get(i.dummyToNodeForHorizontalAlignment.get(ft)[0]).getCenterY()):i.nodeToTempPositionMapVertical.set(ft,i.idToNodeMap.get(ft).getCenterY())),i.nodeToRelativeConstraintMapVertical.get(st).push({bottom:ft,gap:O.gap}),i.nodeToRelativeConstraintMapVertical.get(ft).push({top:st,gap:O.gap})}});else{var _=new Map,lt=new Map;this.constraints.relativePlacementConstraint.forEach(function(O){if(O.left){var z=w.has(O.left)?w.get(O.left):O.left,Z=w.has(O.right)?w.get(O.right):O.right;_.has(z)?_.get(z).push(Z):_.set(z,[Z]),_.has(Z)?_.get(Z).push(z):_.set(Z,[z])}else{var st=X.has(O.top)?X.get(O.top):O.top,ft=X.has(O.bottom)?X.get(O.bottom):O.bottom;lt.has(st)?lt.get(st).push(ft):lt.set(st,[ft]),lt.has(ft)?lt.get(ft).push(st):lt.set(ft,[st])}});var H=function(z,Z){var st=[],ft=[],it=new mt,Pt=new Set,Lt=0;return z.forEach(function(Kt,Ut){if(!Pt.has(Ut)){st[Lt]=[],ft[Lt]=!1;var ut=Ut;for(it.push(ut),Pt.add(ut),st[Lt].push(ut);0!=it.length;)ut=it.shift(),Z.has(ut)&&(ft[Lt]=!0),z.get(ut).forEach(function(xt){Pt.has(xt)||(it.push(xt),Pt.add(xt),st[Lt].push(xt))});Lt++}}),{components:st,isFixed:ft}},ht=H(_,i.fixedNodesOnHorizontal);this.componentsOnHorizontal=ht.components,this.fixedComponentsOnHorizontal=ht.isFixed;var tt=H(lt,i.fixedNodesOnVertical);this.componentsOnVertical=tt.components,this.fixedComponentsOnVertical=tt.isFixed}}},b.prototype.updateDisplacements=function(){var i=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function(tt){var O=i.idToNodeMap.get(tt.nodeId);O.displacementX=0,O.displacementY=0}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var m=this.constraints.alignmentConstraint.vertical,h=0;h1)for(X=0;Xu&&(u=Math.floor(w.y)),I=Math.floor(w.x+c.DEFAULT_COMPONENT_SEPERATION)}this.transform(new L(A.WORLD_CENTER_X-w.x/2,A.WORLD_CENTER_Y-w.y/2))},b.radialLayout=function(i,m,h){var u=Math.max(this.maxDiagonalInTree(i),c.DEFAULT_RADIAL_SEPARATION);b.branchRadialLayout(m,null,0,359,0,u);var p=dt.calculateBounds(i),I=new ct;I.setDeviceOrgX(p.getMinX()),I.setDeviceOrgY(p.getMinY()),I.setWorldOrgX(h.x),I.setWorldOrgY(h.y);for(var w=0;w1;){var st=Z[0];Z.splice(0,1);var ft=H.indexOf(st);ft>=0&&H.splice(ft,1),O--,ht--}z=null!=m?(H.indexOf(Z[0])+1)%O:0;for(var it=Math.abs(u-h)/ht,Pt=z;tt!=ht;Pt=++Pt%O){var Lt=H[Pt].getOtherEnd(i);if(Lt!=m){var Kt=(h+tt*it)%360,Ut=(Kt+it)%360;b.branchRadialLayout(Lt,i,Kt,Ut,p+I,I),tt++}}},b.maxDiagonalInTree=function(i){for(var m=x.MIN_VALUE,h=0;hm&&(m=p)}return m},b.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},b.prototype.groupZeroDegreeMembers=function(){var i=this,m={};this.memberGroups={},this.idToDummyNode={};for(var h=[],u=this.graphManager.getAllNodes(),p=0;p"u"&&(m[X]=[]),m[X]=m[X].concat(I)}Object.keys(m).forEach(function(Y){if(m[Y].length>1){var P="DummyCompound_"+Y;i.memberGroups[P]=m[Y];var _=m[Y][0].getParent(),lt=new l(i.graphManager);lt.id=P,lt.paddingLeft=_.paddingLeft||0,lt.paddingRight=_.paddingRight||0,lt.paddingBottom=_.paddingBottom||0,lt.paddingTop=_.paddingTop||0,i.idToDummyNode[P]=lt;var H=i.getGraphManager().add(i.newGraph(),lt),ht=_.getChild();ht.add(lt);for(var tt=0;ttp?(u.rect.x-=(u.labelWidth-p)/2,u.setWidth(u.labelWidth),u.labelMarginLeft=(u.labelWidth-p)/2):"right"==u.labelPosHorizontal&&u.setWidth(p+u.labelWidth)),u.labelHeight&&("top"==u.labelPosVertical?(u.rect.y-=u.labelHeight,u.setHeight(I+u.labelHeight),u.labelMarginTop=u.labelHeight):"center"==u.labelPosVertical&&u.labelHeight>I?(u.rect.y-=(u.labelHeight-I)/2,u.setHeight(u.labelHeight),u.labelMarginTop=(u.labelHeight-I)/2):"bottom"==u.labelPosVertical&&u.setHeight(I+u.labelHeight))}})},b.prototype.repopulateCompounds=function(){for(var i=this.compoundOrder.length-1;i>=0;i--){var m=this.compoundOrder[i],h=m.id,u=m.paddingLeft,p=m.paddingTop,I=m.labelMarginLeft,w=m.labelMarginTop;this.adjustLocations(this.tiledMemberPack[h],m.rect.x,m.rect.y,u,p,I,w)}},b.prototype.repopulateZeroDegreeMembers=function(){var i=this,m=this.tiledZeroDegreePack;Object.keys(m).forEach(function(h){var u=i.idToDummyNode[h],p=u.paddingLeft,I=u.paddingTop,w=u.labelMarginLeft,X=u.labelMarginTop;i.adjustLocations(m[h],u.rect.x,u.rect.y,p,I,w,X)})},b.prototype.getToBeTiled=function(i){var m=i.id;if(null!=this.toBeTiled[m])return this.toBeTiled[m];var h=i.getChild();if(null==h)return this.toBeTiled[m]=!1,!1;for(var u=h.getNodes(),p=0;p0)return this.toBeTiled[m]=!1,!1;if(null!=I.getChild()){if(!this.getToBeTiled(I))return this.toBeTiled[m]=!1,!1}else this.toBeTiled[I.id]=!1}return this.toBeTiled[m]=!0,!0},b.prototype.getNodeDegree=function(i){i.id;for(var h=i.getEdges(),u=0,p=0;p_&&(_=H.rect.height)}h+=_+i.verticalPadding}},b.prototype.tileCompoundMembers=function(i,m){var h=this;this.tiledMemberPack=[],Object.keys(i).forEach(function(u){var p=m[u];if(h.tiledMemberPack[u]=h.tileNodes(i[u],p.paddingLeft+p.paddingRight),p.rect.width=h.tiledMemberPack[u].width,p.rect.height=h.tiledMemberPack[u].height,p.setCenter(h.tiledMemberPack[u].centerX,h.tiledMemberPack[u].centerY),p.labelMarginLeft=0,p.labelMarginTop=0,c.NODE_DIMENSIONS_INCLUDE_LABELS){var I=p.rect.width,w=p.rect.height;p.labelWidth&&("left"==p.labelPosHorizontal?(p.rect.x-=p.labelWidth,p.setWidth(I+p.labelWidth),p.labelMarginLeft=p.labelWidth):"center"==p.labelPosHorizontal&&p.labelWidth>I?(p.rect.x-=(p.labelWidth-I)/2,p.setWidth(p.labelWidth),p.labelMarginLeft=(p.labelWidth-I)/2):"right"==p.labelPosHorizontal&&p.setWidth(I+p.labelWidth)),p.labelHeight&&("top"==p.labelPosVertical?(p.rect.y-=p.labelHeight,p.setHeight(w+p.labelHeight),p.labelMarginTop=p.labelHeight):"center"==p.labelPosVertical&&p.labelHeight>w?(p.rect.y-=(p.labelHeight-w)/2,p.setHeight(p.labelHeight),p.labelMarginTop=(p.labelHeight-w)/2):"bottom"==p.labelPosVertical&&p.setHeight(w+p.labelHeight))}})},b.prototype.tileNodes=function(i,m){var h=this.tileNodesByFavoringDim(i,m,!0),u=this.tileNodesByFavoringDim(i,m,!1),p=this.getOrgRatio(h);return this.getOrgRatio(u)X&&(X=tt.getWidth())});var H,Y=I/p,P=w/p,_=Math.pow(h-u,2)+4*(Y+u)*(P+h)*p,lt=(u-h+Math.sqrt(_))/(2*(Y+u));m?(H=Math.ceil(lt))==lt&&H++:H=Math.floor(lt);var ht=H*(Y+u)-u;return X>ht&&(ht=X),ht+=2*u},b.prototype.tileNodesByFavoringDim=function(i,m,h){var u=c.TILING_PADDING_VERTICAL,p=c.TILING_PADDING_HORIZONTAL,I=c.TILING_COMPARE_BY,w={rows:[],rowWidth:[],rowHeight:[],width:0,height:m,verticalPadding:u,horizontalPadding:p,centerX:0,centerY:0};I&&(w.idealRowWidth=this.calcIdealRowWidth(i,h));var X=function(O){return O.rect.width*O.rect.height},Y=function(O,z){return X(z)-X(O)};i.sort(function(tt,O){var z=Y;return w.idealRowWidth?(z=I)(tt.id,O.id):z(tt,O)});for(var P=0,_=0,lt=0;lt0&&(w+=i.horizontalPadding),i.rowWidth[h]=w,i.width0&&(X+=i.verticalPadding);var Y=0;X>i.rowHeight[h]&&(Y=i.rowHeight[h],i.rowHeight[h]=X,Y=i.rowHeight[h]-Y),i.height+=Y,i.rows[h].push(m)},b.prototype.getShortestRowIndex=function(i){for(var m=-1,h=Number.MAX_VALUE,u=0;uh&&(m=u,h=i.rowWidth[u]);return m},b.prototype.canAddHorizontal=function(i,m,h){if(i.idealRowWidth){var u=i.rows.length-1;return i.rowWidth[u]+m+i.horizontalPadding<=i.idealRowWidth}var I=this.getShortestRowIndex(i);if(I<0)return!0;var w=i.rowWidth[I];if(w+i.horizontalPadding+m<=i.width)return!0;var Y,P,X=0;return i.rowHeight[I]0&&(X=h+i.verticalPadding-i.rowHeight[I]),Y=i.width-w>=m+i.horizontalPadding?(i.height+X)/(w+m+i.horizontalPadding):(i.height+X)/i.width,X=h+i.verticalPadding,(P=i.widthI&&m!=h){u.splice(-1,1),i.rows[h].push(p),i.rowWidth[m]=i.rowWidth[m]-I,i.rowWidth[h]=i.rowWidth[h]+I,i.width=i.rowWidth[instance.getLongestRowIndex(i)];for(var w=Number.MIN_VALUE,X=0;Xw&&(w=u[X].height);m>0&&(w+=i.verticalPadding);var Y=i.rowHeight[m]+i.rowHeight[h];i.rowHeight[m]=w,i.rowHeight[h]0)for(var ht=p;ht<=I;ht++)H[0]+=this.grid[ht][w-1].length+this.grid[ht][w].length-1;if(I0)for(ht=w;ht<=X;ht++)H[3]+=this.grid[p-1][ht].length+this.grid[p][ht].length-1;for(var O,z,tt=x.MAX_VALUE,Z=0;Z{var d=t(551).FDLayoutNode,e=t(551).IMath;function r(g,c,T,f){d.call(this,g,c,T,f)}for(var l in r.prototype=Object.create(d.prototype),d)r[l]=d[l];r.prototype.calculateDisplacement=function(){var g=this.graphManager.getLayout();null!=this.getChild()&&this.fixedNodeWeight?(this.displacementX+=g.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=g.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=g.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=g.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>g.coolingFactor*g.maxNodeDisplacement&&(this.displacementX=g.coolingFactor*g.maxNodeDisplacement*e.sign(this.displacementX)),Math.abs(this.displacementY)>g.coolingFactor*g.maxNodeDisplacement&&(this.displacementY=g.coolingFactor*g.maxNodeDisplacement*e.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},r.prototype.propogateDisplacementToChildren=function(g,c){for(var f,T=this.getChild().getNodes(),A=0;A{function d(T){if(Array.isArray(T)){for(var f=0,A=Array(T.length);f0){var rt=0;K.forEach(function(j){"horizontal"==q?(S.set(j,N.has(j)?L[N.get(j)]:M.get(j)),rt+=S.get(j)):(S.set(j,N.has(j)?D[N.get(j)]:M.get(j)),rt+=S.get(j))}),rt/=K.length,W.forEach(function(j){v.has(j)||S.set(j,rt)})}else{var B=0;W.forEach(function(j){B+="horizontal"==q?N.has(j)?L[N.get(j)]:M.get(j):N.has(j)?D[N.get(j)]:M.get(j)}),B/=W.length,W.forEach(function(j){S.set(j,B)})}});for(var ot=function(){var K=$.shift();Q.get(K).forEach(function(B){if(S.get(B.id)j&&(j=Gt),ztOt&&(Ot=zt)}}catch(qt){yt=!0,It=qt}finally{try{!pt&&Nt.return&&Nt.return()}finally{if(yt)throw It}}var Wt=(rt+j)/2-(B+Ot)/2,Vt=!0,$t=!1,kt=void 0;try{for(var _t,Zt=W[Symbol.iterator]();!(Vt=(_t=Zt.next()).done);Vt=!0){var jt=_t.value;S.set(jt,S.get(jt)+Wt)}}catch(qt){$t=!0,kt=qt}finally{try{!Vt&&Zt.return&&Zt.return()}finally{if($t)throw kt}}})}return S},J=function(Q){var q=0,v=0,M=0,C=0;if(Q.forEach(function(F){F.left?L[N.get(F.left)]-L[N.get(F.right)]>=0?q++:v++:D[N.get(F.top)]-D[N.get(F.bottom)]>=0?M++:C++}),q>v&&M>C)for(var k=0;kv)for(var G=0;GC)for(var S=0;S1)f.fixedNodeConstraint.forEach(function(V,Q){u[Q]=[V.position.x,V.position.y],p[Q]=[L[N.get(V.nodeId)],D[N.get(V.nodeId)]]}),I=!0;else if(f.alignmentConstraint)!function(){var V=0;if(f.alignmentConstraint.vertical){for(var Q=f.alignmentConstraint.vertical,q=function(S){var F=new Set;Q[S].forEach(function(U){F.add(U)});var $=new Set([].concat(d(F)).filter(function(U){return X.has(U)})),ot=void 0;ot=$.size>0?L[N.get($.values().next().value)]:mt(F).x,Q[S].forEach(function(U){u[V]=[ot,D[N.get(U)]],p[V]=[L[N.get(U)],D[N.get(U)]],V++})},v=0;v0?L[N.get($.values().next().value)]:mt(F).y,M[S].forEach(function(U){u[V]=[L[N.get(U)],ot],p[V]=[L[N.get(U)],D[N.get(U)]],V++})},k=0;klt&&(lt=_[ht].length,H=ht);if(lt0){var Mt={x:0,y:0};f.fixedNodeConstraint.forEach(function(V,Q){var q={x:L[N.get(V.nodeId)],y:D[N.get(V.nodeId)]},v=V.position,M=ct(v,q);Mt.x+=M.x,Mt.y+=M.y}),Mt.x/=f.fixedNodeConstraint.length,Mt.y/=f.fixedNodeConstraint.length,L.forEach(function(V,Q){L[Q]+=Mt.x}),D.forEach(function(V,Q){D[Q]+=Mt.y}),f.fixedNodeConstraint.forEach(function(V){L[N.get(V.nodeId)]=V.position.x,D[N.get(V.nodeId)]=V.position.y})}if(f.alignmentConstraint){if(f.alignmentConstraint.vertical)for(var Ct=f.alignmentConstraint.vertical,At=function(Q){var q=new Set;Ct[Q].forEach(function(C){q.add(C)});var v=new Set([].concat(d(q)).filter(function(C){return X.has(C)})),M=void 0;M=v.size>0?L[N.get(v.values().next().value)]:mt(q).x,q.forEach(function(C){X.has(C)||(L[N.get(C)]=M)})},Rt=0;Rt0?D[N.get(v.values().next().value)]:mt(q).y,q.forEach(function(C){X.has(C)||(D[N.get(C)]=M)})},bt=0;bt{o.exports=R}},s={};function n(o){var E=s[o];if(void 0!==E)return E.exports;var t=s[o]={exports:{}};return y[o](t,t.exports,n),t.exports}return n(45)})())},28432:function(ee){ee.exports=function(vt){var Et={};function R(y){if(Et[y])return Et[y].exports;var s=Et[y]={i:y,l:!1,exports:{}};return vt[y].call(s.exports,s,s.exports,R),s.l=!0,s.exports}return R.m=vt,R.c=Et,R.i=function(y){return y},R.d=function(y,s,n){R.o(y,s)||Object.defineProperty(y,s,{configurable:!1,enumerable:!0,get:n})},R.n=function(y){var s=y&&y.__esModule?function(){return y.default}:function(){return y};return R.d(s,"a",s),s},R.o=function(y,s){return Object.prototype.hasOwnProperty.call(y,s)},R.p="",R(R.s=28)}([function(vt,Et,R){"use strict";function y(){}y.QUALITY=1,y.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,y.DEFAULT_INCREMENTAL=!1,y.DEFAULT_ANIMATION_ON_LAYOUT=!0,y.DEFAULT_ANIMATION_DURING_LAYOUT=!1,y.DEFAULT_ANIMATION_PERIOD=50,y.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,y.DEFAULT_GRAPH_MARGIN=15,y.NODE_DIMENSIONS_INCLUDE_LABELS=!1,y.SIMPLE_NODE_SIZE=40,y.SIMPLE_NODE_HALF_SIZE=y.SIMPLE_NODE_SIZE/2,y.EMPTY_COMPOUND_NODE_SIZE=40,y.MIN_EDGE_LENGTH=1,y.WORLD_BOUNDARY=1e6,y.INITIAL_WORLD_BOUNDARY=y.WORLD_BOUNDARY/1e3,y.WORLD_CENTER_X=1200,y.WORLD_CENTER_Y=900,vt.exports=y},function(vt,Et,R){"use strict";var y=R(2),s=R(8),n=R(9);function a(E,t,d){y.call(this,d),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=d,this.bendpoints=[],this.source=E,this.target=t}for(var o in a.prototype=Object.create(y.prototype),y)a[o]=y[o];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(E){if(this.source===E)return this.target;if(this.target===E)return this.source;throw"Node is not incident with this edge"},a.prototype.getOtherEndInGraph=function(E,t){for(var d=this.getOtherEnd(E),e=t.getGraphManager().getRoot();;){if(d.getOwner()==t)return d;if(d.getOwner()==e)break;d=d.getOwner().getParent()}return null},a.prototype.updateLength=function(){var E=new Array(4);this.isOverlapingSourceAndTarget=s.getIntersection(this.target.getRect(),this.source.getRect(),E),this.isOverlapingSourceAndTarget||(this.lengthX=E[0]-E[2],this.lengthY=E[1]-E[3],Math.abs(this.lengthX)<1&&(this.lengthX=n.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=n.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},a.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=n.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=n.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},vt.exports=a},function(vt,Et,R){"use strict";function y(s){this.vGraphObject=s}vt.exports=y},function(vt,Et,R){"use strict";var y=R(2),s=R(10),n=R(13),a=R(0),o=R(16),E=R(5);function t(e,r,l,g){null==l&&null==g&&(g=r),y.call(this,g),null!=e.graphManager&&(e=e.graphManager),this.estimatedSize=s.MIN_VALUE,this.inclusionTreeDepth=s.MAX_VALUE,this.vGraphObject=g,this.edges=[],this.graphManager=e,this.rect=null!=l&&null!=r?new n(r.x,r.y,l.width,l.height):new n}for(var d in t.prototype=Object.create(y.prototype),y)t[d]=y[d];t.prototype.getEdges=function(){return this.edges},t.prototype.getChild=function(){return this.child},t.prototype.getOwner=function(){return this.owner},t.prototype.getWidth=function(){return this.rect.width},t.prototype.setWidth=function(e){this.rect.width=e},t.prototype.getHeight=function(){return this.rect.height},t.prototype.setHeight=function(e){this.rect.height=e},t.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},t.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},t.prototype.getCenter=function(){return new E(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},t.prototype.getLocation=function(){return new E(this.rect.x,this.rect.y)},t.prototype.getRect=function(){return this.rect},t.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},t.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},t.prototype.setRect=function(e,r){this.rect.x=e.x,this.rect.y=e.y,this.rect.width=r.width,this.rect.height=r.height},t.prototype.setCenter=function(e,r){this.rect.x=e-this.rect.width/2,this.rect.y=r-this.rect.height/2},t.prototype.setLocation=function(e,r){this.rect.x=e,this.rect.y=r},t.prototype.moveBy=function(e,r){this.rect.x+=e,this.rect.y+=r},t.prototype.getEdgeListToNode=function(e){var r=[],g=this;return g.edges.forEach(function(c){if(c.target==e){if(c.source!=g)throw"Incorrect edge source!";r.push(c)}}),r},t.prototype.getEdgesBetween=function(e){var r=[],g=this;return g.edges.forEach(function(c){if(c.source!=g&&c.target!=g)throw"Incorrect edge source and/or target";(c.target==e||c.source==e)&&r.push(c)}),r},t.prototype.getNeighborsList=function(){var e=new Set,r=this;return r.edges.forEach(function(l){if(l.source==r)e.add(l.target);else{if(l.target!=r)throw"Incorrect incidency!";e.add(l.source)}}),e},t.prototype.withChildren=function(){var e=new Set;if(e.add(this),null!=this.child)for(var g=this.child.getNodes(),c=0;cr?(this.rect.x-=(this.labelWidth-r)/2,this.setWidth(this.labelWidth)):"right"==this.labelPosHorizontal&&this.setWidth(r+this.labelWidth)),this.labelHeight&&("top"==this.labelPosVertical?(this.rect.y-=this.labelHeight,this.setHeight(l+this.labelHeight)):"center"==this.labelPosVertical&&this.labelHeight>l?(this.rect.y-=(this.labelHeight-l)/2,this.setHeight(this.labelHeight)):"bottom"==this.labelPosVertical&&this.setHeight(l+this.labelHeight))}}},t.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==s.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},t.prototype.transform=function(e){var r=this.rect.x;r>a.WORLD_BOUNDARY?r=a.WORLD_BOUNDARY:r<-a.WORLD_BOUNDARY&&(r=-a.WORLD_BOUNDARY);var l=this.rect.y;l>a.WORLD_BOUNDARY?l=a.WORLD_BOUNDARY:l<-a.WORLD_BOUNDARY&&(l=-a.WORLD_BOUNDARY);var g=new E(r,l),c=e.inverseTransformPoint(g);this.setLocation(c.x,c.y)},t.prototype.getLeft=function(){return this.rect.x},t.prototype.getRight=function(){return this.rect.x+this.rect.width},t.prototype.getTop=function(){return this.rect.y},t.prototype.getBottom=function(){return this.rect.y+this.rect.height},t.prototype.getParent=function(){return null==this.owner?null:this.owner.getParent()},vt.exports=t},function(vt,Et,R){"use strict";var y=R(0);function s(){}for(var n in y)s[n]=y[n];s.MAX_ITERATIONS=2500,s.DEFAULT_EDGE_LENGTH=50,s.DEFAULT_SPRING_STRENGTH=.45,s.DEFAULT_REPULSION_STRENGTH=4500,s.DEFAULT_GRAVITY_STRENGTH=.4,s.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,s.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,s.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,s.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,s.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,s.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,s.COOLING_ADAPTATION_FACTOR=.33,s.ADAPTATION_LOWER_NODE_LIMIT=1e3,s.ADAPTATION_UPPER_NODE_LIMIT=5e3,s.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,s.MAX_NODE_DISPLACEMENT=3*s.MAX_NODE_DISPLACEMENT_INCREMENTAL,s.MIN_REPULSION_DIST=s.DEFAULT_EDGE_LENGTH/10,s.CONVERGENCE_CHECK_PERIOD=100,s.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,s.MIN_EDGE_LENGTH=1,s.GRID_CALCULATION_CHECK_PERIOD=10,vt.exports=s},function(vt,Et,R){"use strict";function y(s,n){null==s&&null==n?(this.x=0,this.y=0):(this.x=s,this.y=n)}y.prototype.getX=function(){return this.x},y.prototype.getY=function(){return this.y},y.prototype.setX=function(s){this.x=s},y.prototype.setY=function(s){this.y=s},y.prototype.getDifference=function(s){return new DimensionD(this.x-s.x,this.y-s.y)},y.prototype.getCopy=function(){return new y(this.x,this.y)},y.prototype.translate=function(s){return this.x+=s.width,this.y+=s.height,this},vt.exports=y},function(vt,Et,R){"use strict";var y=R(2),s=R(10),n=R(0),a=R(7),o=R(3),E=R(1),t=R(13),d=R(12),e=R(11);function r(g,c,T){y.call(this,T),this.estimatedSize=s.MIN_VALUE,this.margin=n.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=g,null!=c&&c instanceof a?this.graphManager=c:null!=c&&c instanceof Layout&&(this.graphManager=c.graphManager)}for(var l in r.prototype=Object.create(y.prototype),y)r[l]=y[l];r.prototype.getNodes=function(){return this.nodes},r.prototype.getEdges=function(){return this.edges},r.prototype.getGraphManager=function(){return this.graphManager},r.prototype.getParent=function(){return this.parent},r.prototype.getLeft=function(){return this.left},r.prototype.getRight=function(){return this.right},r.prototype.getTop=function(){return this.top},r.prototype.getBottom=function(){return this.bottom},r.prototype.isConnected=function(){return this.isConnected},r.prototype.add=function(g,c,T){if(null==c&&null==T){var f=g;if(null==this.graphManager)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(f)>-1)throw"Node already in graph!";return f.owner=this,this.getNodes().push(f),f}var A=g;if(!(this.getNodes().indexOf(c)>-1&&this.getNodes().indexOf(T)>-1))throw"Source or target not in graph!";if(c.owner!=T.owner||c.owner!=this)throw"Both owners must be this graph!";return c.owner!=T.owner?null:(A.source=c,A.target=T,A.isInterGraph=!1,this.getEdges().push(A),c.edges.push(A),T!=c&&T.edges.push(A),A)},r.prototype.remove=function(g){var c=g;if(g instanceof o){if(null==c)throw"Node is null!";if(null==c.owner||c.owner!=this)throw"Owner graph is invalid!";if(null==this.graphManager)throw"Owner graph manager is invalid!";for(var T=c.edges.slice(),A=T.length,N=0;N-1&&et>-1))throw"Source and/or target doesn't know this edge!";if(f.source.edges.splice(D,1),f.target!=f.source&&f.target.edges.splice(et,1),-1==(L=f.source.owner.getEdges().indexOf(f)))throw"Not in owner's edge list!";f.source.owner.getEdges().splice(L,1)}},r.prototype.updateLeftTop=function(){for(var T,f,A,g=s.MAX_VALUE,c=s.MAX_VALUE,N=this.getNodes(),L=N.length,D=0;D(T=et.getTop())&&(g=T),c>(f=et.getLeft())&&(c=f)}return g==s.MAX_VALUE?null:(A=null!=N[0].getParent().paddingLeft?N[0].getParent().paddingLeft:this.margin,this.left=c-A,this.top=g-A,new d(this.left,this.top))},r.prototype.updateBounds=function(g){for(var N,L,D,et,x,c=s.MAX_VALUE,T=-s.MAX_VALUE,f=s.MAX_VALUE,A=-s.MAX_VALUE,nt=this.nodes,dt=nt.length,ct=0;ct(N=mt.getLeft())&&(c=N),T<(L=mt.getRight())&&(T=L),f>(D=mt.getTop())&&(f=D),A<(et=mt.getBottom())&&(A=et)}var b=new t(c,f,T-c,A-f);c==s.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),x=null!=nt[0].getParent().paddingLeft?nt[0].getParent().paddingLeft:this.margin,this.left=b.x-x,this.right=b.x+b.width+x,this.top=b.y-x,this.bottom=b.y+b.height+x},r.calculateBounds=function(g){for(var N,L,D,et,c=s.MAX_VALUE,T=-s.MAX_VALUE,f=s.MAX_VALUE,A=-s.MAX_VALUE,x=g.length,nt=0;nt(N=dt.getLeft())&&(c=N),T<(L=dt.getRight())&&(T=L),f>(D=dt.getTop())&&(f=D),A<(et=dt.getBottom())&&(A=et)}return new t(c,f,T-c,A-f)},r.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},r.prototype.getEstimatedSize=function(){if(this.estimatedSize==s.MIN_VALUE)throw"assert failed";return this.estimatedSize},r.prototype.calcEstimatedSize=function(){for(var g=0,c=this.nodes,T=c.length,f=0;f=this.nodes.length){var dt=0;T.forEach(function(ct){ct.owner==g&&dt++}),dt==this.nodes.length&&(this.isConnected=!0)}}else this.isConnected=!0},vt.exports=r},function(vt,Et,R){"use strict";var y,s=R(1);function n(a){y=R(6),this.layout=a,this.graphs=[],this.edges=[]}n.prototype.addRoot=function(){var a=this.layout.newGraph(),o=this.layout.newNode(null),E=this.add(a,o);return this.setRootGraph(E),this.rootGraph},n.prototype.add=function(a,o,E,t,d){if(null==E&&null==t&&null==d){if(null==a)throw"Graph is null!";if(null==o)throw"Parent node is null!";if(this.graphs.indexOf(a)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(a),null!=a.parent)throw"Already has a parent!";if(null!=o.child)throw"Already has a child!";return a.parent=o,o.child=a,a}d=E,E=a;var e=(t=o).getOwner(),r=d.getOwner();if(null==e||e.getGraphManager()!=this)throw"Source not in this graph mgr!";if(null==r||r.getGraphManager()!=this)throw"Target not in this graph mgr!";if(e==r)return E.isInterGraph=!1,e.add(E,t,d);if(E.isInterGraph=!0,E.source=t,E.target=d,this.edges.indexOf(E)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(E),null==E.source||null==E.target)throw"Edge source and/or target is null!";if(-1!=E.source.edges.indexOf(E)||-1!=E.target.edges.indexOf(E))throw"Edge already in source and/or target incidency list!";return E.source.edges.push(E),E.target.edges.push(E),E},n.prototype.remove=function(a){if(a instanceof y){var o=a;if(o.getGraphManager()!=this)throw"Graph not in this graph mgr";if(o!=this.rootGraph&&(null==o.parent||o.parent.graphManager!=this))throw"Invalid parent node!";for(var t,E=[],d=(E=E.concat(o.getEdges())).length,e=0;e=a.getRight()?o[0]+=Math.min(a.getX()-n.getX(),n.getRight()-a.getRight()):a.getX()<=n.getX()&&a.getRight()>=n.getRight()&&(o[0]+=Math.min(n.getX()-a.getX(),a.getRight()-n.getRight())),n.getY()<=a.getY()&&n.getBottom()>=a.getBottom()?o[1]+=Math.min(a.getY()-n.getY(),n.getBottom()-a.getBottom()):a.getY()<=n.getY()&&a.getBottom()>=n.getBottom()&&(o[1]+=Math.min(n.getY()-a.getY(),a.getBottom()-n.getBottom()));var d=Math.abs((a.getCenterY()-n.getCenterY())/(a.getCenterX()-n.getCenterX()));a.getCenterY()===n.getCenterY()&&a.getCenterX()===n.getCenterX()&&(d=1);var e=d*o[0],r=o[1]/d;o[0]e)return o[0]=E,o[1]=l,o[2]=d,o[3]=nt,!1;if(td)return o[0]=r,o[1]=t,o[2]=et,o[3]=e,!1;if(Ed?(o[0]=c,o[1]=T,b=!0):(o[0]=g,o[1]=l,b=!0):i===h&&(E>d?(o[0]=r,o[1]=l,b=!0):(o[0]=f,o[1]=T,b=!0)),-m===h?d>E?(o[2]=x,o[3]=nt,J=!0):(o[2]=et,o[3]=D,J=!0):m===h&&(d>E?(o[2]=L,o[3]=D,J=!0):(o[2]=dt,o[3]=nt,J=!0)),b&&J)return!1;if(E>d?t>e?(u=this.getCardinalDirection(i,h,4),p=this.getCardinalDirection(m,h,2)):(u=this.getCardinalDirection(-i,h,3),p=this.getCardinalDirection(-m,h,1)):t>e?(u=this.getCardinalDirection(-i,h,1),p=this.getCardinalDirection(-m,h,3)):(u=this.getCardinalDirection(i,h,2),p=this.getCardinalDirection(m,h,4)),!b)switch(u){case 1:w=l,I=E+-N/h,o[0]=I,o[1]=w;break;case 2:I=f,w=t+A*h,o[0]=I,o[1]=w;break;case 3:w=T,I=E+N/h,o[0]=I,o[1]=w;break;case 4:I=c,w=t+-A*h,o[0]=I,o[1]=w}if(!J)switch(p){case 1:Y=D,X=d+-mt/h,o[2]=X,o[3]=Y;break;case 2:X=dt,Y=e+ct*h,o[2]=X,o[3]=Y;break;case 3:Y=nt,X=d+mt/h,o[2]=X,o[3]=Y;break;case 4:X=x,Y=e+-ct*h,o[2]=X,o[3]=Y}}return!1},s.getCardinalDirection=function(n,a,o){return n>a?o:1+o%4},s.getIntersection=function(n,a,o,E){if(null==E)return this.getIntersection2(n,a,o);var t=n.x,d=n.y,e=a.x,r=a.y,l=o.x,g=o.y,c=E.x,T=E.y,N=void 0,L=void 0,D=void 0,et=void 0,x=void 0,nt=void 0,dt=void 0;return x=e*d-t*r,nt=c*g-l*T,0==(dt=(N=r-d)*(et=l-c)-(L=T-g)*(D=t-e))?null:new y((D*nt-et*x)/dt,(L*x-N*nt)/dt)},s.angleOfVector=function(n,a,o,E){var t=void 0;return n!==o?(t=Math.atan((E-a)/(o-n)),o=0){var T=(-l+Math.sqrt(l*l-4*r*g))/(2*r),f=(-l-Math.sqrt(l*l-4*r*g))/(2*r);return T>=0&&T<=1?[T]:f>=0&&f<=1?[f]:null}return null},s.HALF_PI=.5*Math.PI,s.ONE_AND_HALF_PI=1.5*Math.PI,s.TWO_PI=2*Math.PI,s.THREE_PI=3*Math.PI,vt.exports=s},function(vt,Et,R){"use strict";function y(){}y.sign=function(s){return s>0?1:s<0?-1:0},y.floor=function(s){return s<0?Math.ceil(s):Math.floor(s)},y.ceil=function(s){return s<0?Math.floor(s):Math.ceil(s)},vt.exports=y},function(vt,Et,R){"use strict";function y(){}y.MAX_VALUE=2147483647,y.MIN_VALUE=-2147483648,vt.exports=y},function(vt,Et,R){"use strict";var y=function(){function t(d,e){for(var r=0;r"u"?"undefined":y(n);return null==n||"object"!=a&&"function"!=a},vt.exports=s},function(vt,Et,R){"use strict";function y(l){if(Array.isArray(l)){for(var g=0,c=Array(l.length);g0&&g;){for(N.push(D[0]);N.length>0&&g;){var et=N[0];N.splice(0,1),A.add(et);var x=et.getEdges();for(f=0;f-1&&D.splice(mt,1)}A=new Set,L=new Map}else l=[]}return l},r.prototype.createDummyNodesForBendpoints=function(l){for(var g=[],c=l.source,T=this.graphManager.calcLowestCommonAncestor(l.source,l.target),f=0;f0){for(var T=this.edgeToDummyNodes.get(c),f=0;f=0&&g.splice(nt,1),L.getNeighborsList().forEach(function(b){if(c.indexOf(b)<0){var i=T.get(b)-1;1==i&&et.push(b),T.set(b,i)}})}c=c.concat(et),(1==g.length||2==g.length)&&(f=!0,A=g[0])}return A},r.prototype.setGraphManager=function(l){this.graphManager=l},vt.exports=r},function(vt,Et,R){"use strict";function y(){}y.seed=1,y.x=0,y.nextDouble=function(){return y.x=1e4*Math.sin(y.seed++),y.x-Math.floor(y.x)},vt.exports=y},function(vt,Et,R){"use strict";var y=R(5);function s(n,a){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}s.prototype.getWorldOrgX=function(){return this.lworldOrgX},s.prototype.setWorldOrgX=function(n){this.lworldOrgX=n},s.prototype.getWorldOrgY=function(){return this.lworldOrgY},s.prototype.setWorldOrgY=function(n){this.lworldOrgY=n},s.prototype.getWorldExtX=function(){return this.lworldExtX},s.prototype.setWorldExtX=function(n){this.lworldExtX=n},s.prototype.getWorldExtY=function(){return this.lworldExtY},s.prototype.setWorldExtY=function(n){this.lworldExtY=n},s.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},s.prototype.setDeviceOrgX=function(n){this.ldeviceOrgX=n},s.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},s.prototype.setDeviceOrgY=function(n){this.ldeviceOrgY=n},s.prototype.getDeviceExtX=function(){return this.ldeviceExtX},s.prototype.setDeviceExtX=function(n){this.ldeviceExtX=n},s.prototype.getDeviceExtY=function(){return this.ldeviceExtY},s.prototype.setDeviceExtY=function(n){this.ldeviceExtY=n},s.prototype.transformX=function(n){var a=0,o=this.lworldExtX;return 0!=o&&(a=this.ldeviceOrgX+(n-this.lworldOrgX)*this.ldeviceExtX/o),a},s.prototype.transformY=function(n){var a=0,o=this.lworldExtY;return 0!=o&&(a=this.ldeviceOrgY+(n-this.lworldOrgY)*this.ldeviceExtY/o),a},s.prototype.inverseTransformX=function(n){var a=0,o=this.ldeviceExtX;return 0!=o&&(a=this.lworldOrgX+(n-this.ldeviceOrgX)*this.lworldExtX/o),a},s.prototype.inverseTransformY=function(n){var a=0,o=this.ldeviceExtY;return 0!=o&&(a=this.lworldOrgY+(n-this.ldeviceOrgY)*this.lworldExtY/o),a},s.prototype.inverseTransformPoint=function(n){return new y(this.inverseTransformX(n.x),this.inverseTransformY(n.y))},vt.exports=s},function(vt,Et,R){"use strict";function y(e){if(Array.isArray(e)){for(var r=0,l=Array(e.length);rn.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*n.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(e-n.ADAPTATION_LOWER_NODE_LIMIT)/(n.ADAPTATION_UPPER_NODE_LIMIT-n.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-n.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=n.MAX_NODE_DISPLACEMENT_INCREMENTAL):(e>n.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(n.COOLING_ADAPTATION_FACTOR,1-(e-n.ADAPTATION_LOWER_NODE_LIMIT)/(n.ADAPTATION_UPPER_NODE_LIMIT-n.ADAPTATION_LOWER_NODE_LIMIT)*(1-n.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=n.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(5*this.getAllNodes().length,this.maxIterations),this.displacementThresholdPerNode=3*n.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},t.prototype.calcSpringForces=function(){for(var r,e=this.getAllEdges(),l=0;l0&&void 0!==arguments[0])||arguments[0],r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],f=this.getAllNodes();if(this.useFRGridVariant)for(this.totalIterations%n.GRID_CALCULATION_CHECK_PERIOD==1&&e&&this.updateGrid(),A=new Set,l=0;l(N=r.getEstimatedSize()*this.gravityRangeFactor)||A>N)&&(e.gravitationForceX=-this.gravityConstant*c,e.gravitationForceY=-this.gravityConstant*T):(f>(N=r.getEstimatedSize()*this.compoundGravityRangeFactor)||A>N)&&(e.gravitationForceX=-this.gravityConstant*c*this.compoundGravityConstant,e.gravitationForceY=-this.gravityConstant*T*this.compoundGravityConstant)},t.prototype.isConverged=function(){var e,r=!1;return this.totalIterations>this.maxIterations/3&&(r=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),e=this.totalDisplacement=f.length||N>=f[0].length))for(var L=0;Lt}}]),o}();vt.exports=a},function(vt,Et,R){"use strict";function y(){}y.svd=function(s){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=s.length,this.n=s[0].length;var n=Math.min(this.m,this.n);this.s=function(pt){for(var yt=[];pt-- >0;)yt.push(0);return yt}(Math.min(this.m+1,this.n)),this.U=function It(Nt){if(0==Nt.length)return 0;for(var St=[],wt=0;wt0;)yt.push(0);return yt}(this.n),o=function(pt){for(var yt=[];pt-- >0;)yt.push(0);return yt}(this.m),E=!0,t=!0,d=Math.min(this.m-1,this.n),e=Math.max(0,Math.min(this.n-2,this.m)),r=0;r=0;h--)if(0!==this.s[h]){for(var u=h+1;u=0;_--){if(function(pt,yt){return pt&&yt}(_0;){var it=void 0,Pt=void 0;for(it=J-2;it>=-1&&-1!==it;it--)if(Math.abs(a[it])<=ft+st*(Math.abs(this.s[it])+Math.abs(this.s[it+1]))){a[it]=0;break}if(it===J-2)Pt=4;else{var Lt=void 0;for(Lt=J-1;Lt>=it&&Lt!==it;Lt--){var Kt=(Lt!==J?Math.abs(a[Lt]):0)+(Lt!==it+1?Math.abs(a[Lt-1]):0);if(Math.abs(this.s[Lt])<=ft+st*Kt){this.s[Lt]=0;break}}Lt===it?Pt=3:Lt===J-1?Pt=1:(Pt=2,it=Lt)}switch(it++,Pt){case 1:var Ut=a[J-2];a[J-2]=0;for(var ut=J-2;ut>=it;ut--){var gt=y.hypot(this.s[ut],Ut),xt=this.s[ut]/gt,Dt=Ut/gt;if(this.s[ut]=gt,ut!==it&&(Ut=-Dt*a[ut-1],a[ut-1]=xt*a[ut-1]),t)for(var Mt=0;Mt=this.s[it+1]);){var rt=this.s[it];if(this.s[it]=this.s[it+1],this.s[it+1]=rt,t&&itMath.abs(n)?(a=n/s,a=Math.abs(s)*Math.sqrt(1+a*a)):0!=n?(a=s/n,a=Math.abs(n)*Math.sqrt(1+a*a)):a=0,a},vt.exports=y},function(vt,Et,R){"use strict";var y=function(){function a(o,E){for(var t=0;t2&&void 0!==arguments[2]?arguments[2]:1,d=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1,e=arguments.length>4&&void 0!==arguments[4]?arguments[4]:-1;s(this,a),this.sequence1=o,this.sequence2=E,this.match_score=t,this.mismatch_penalty=d,this.gap_penalty=e,this.iMax=o.length+1,this.jMax=E.length+1,this.grid=new Array(this.iMax);for(var r=0;r=0;o--){var E=this.listeners[o];E.event===n&&E.callback===a&&this.listeners.splice(o,1)}},s.emit=function(n,a){for(var o=0;o{"use strict";Et.r(vt),Et.d(vt,{diagram:()=>q});var R=Et(53420),y=Et(77437),s=Et(50027),n=Et(23854),a=Et(91035),E=(Et(62477),Et(39624)),t=Et(3685),d=Et(32928),e=Et(90574),r=Et(10795),l=Et(31083),g={L:"left",R:"right",T:"top",B:"bottom"},c={L:(0,t.eW)(v=>`${v},${v/2} 0,${v} 0,0`,"L"),R:(0,t.eW)(v=>`0,${v/2} ${v},0 ${v},${v}`,"R"),T:(0,t.eW)(v=>`0,0 ${v},0 ${v/2},${v}`,"T"),B:(0,t.eW)(v=>`${v/2},0 ${v},${v} 0,${v}`,"B")},T={L:(0,t.eW)((v,M)=>v-M+2,"L"),R:(0,t.eW)((v,M)=>v-2,"R"),T:(0,t.eW)((v,M)=>v-M+2,"T"),B:(0,t.eW)((v,M)=>v-2,"B")},f=(0,t.eW)(function(v){return N(v)?"L"===v?"R":"L":"T"===v?"B":"T"},"getOppositeArchitectureDirection"),A=(0,t.eW)(function(v){return"L"===v||"R"===v||"T"===v||"B"===v},"isArchitectureDirection"),N=(0,t.eW)(function(v){return"L"===v||"R"===v},"isArchitectureDirectionX"),L=(0,t.eW)(function(v){return"T"===v||"B"===v},"isArchitectureDirectionY"),D=(0,t.eW)(function(v,M){const C=N(v)&&L(M),k=L(v)&&N(M);return C||k},"isArchitectureDirectionXY"),et=(0,t.eW)(function(v){const M=v[0],C=v[1],k=N(M)&&L(C),G=L(M)&&N(C);return k||G},"isArchitecturePairXY"),x=(0,t.eW)(function(v){return"LL"!==v&&"RR"!==v&&"TT"!==v&&"BB"!==v},"isValidArchitectureDirectionPair"),nt=(0,t.eW)(function(v,M){const C=`${v}${M}`;return x(C)?C:void 0},"getArchitectureDirectionPair"),dt=(0,t.eW)(function([v,M],C){const k=C[0],G=C[1];return N(k)?L(G)?[v+("L"===k?-1:1),M+("T"===G?1:-1)]:[v+("L"===k?-1:1),M]:N(G)?[v+("L"===G?1:-1),M+("T"===k?1:-1)]:[v,M+("T"===k?1:-1)]},"shiftPositionByArchitectureDirectionPair"),ct=(0,t.eW)(function(v){return"LT"===v||"TL"===v?[1,1]:"BL"===v||"LB"===v?[1,-1]:"BR"===v||"RB"===v?[-1,-1]:[-1,1]},"getArchitectureDirectionXYFactors"),mt=(0,t.eW)(function(v,M){return D(v,M)?"bend":N(v)?"horizontal":"vertical"},"getArchitectureDirectionAlignment"),b=(0,t.eW)(function(v){return"service"===v.type},"isArchitectureService"),J=(0,t.eW)(function(v){return"junction"===v.type},"isArchitectureJunction"),i=(0,t.eW)(v=>v.data(),"edgeData"),m=(0,t.eW)(v=>v.data(),"nodeData"),h=t.vZ.architecture,u=new a.A(()=>({nodes:{},groups:{},edges:[],registeredIds:{},config:h,dataStructures:void 0,elements:{}})),p=(0,t.eW)(()=>{u.reset(),(0,t.ZH)()},"clear"),I=(0,t.eW)(function({id:v,icon:M,in:C,title:k,iconText:G}){if(void 0!==u.records.registeredIds[v])throw new Error(`The service id [${v}] is already in use by another ${u.records.registeredIds[v]}`);if(void 0!==C){if(v===C)throw new Error(`The service [${v}] cannot be placed within itself`);if(void 0===u.records.registeredIds[C])throw new Error(`The service [${v}]'s parent does not exist. Please make sure the parent is created before this service`);if("node"===u.records.registeredIds[C])throw new Error(`The service [${v}]'s parent is not a group`)}u.records.registeredIds[v]="node",u.records.nodes[v]={id:v,type:"service",icon:M,iconText:G,title:k,edges:[],in:C}},"addService"),w=(0,t.eW)(()=>Object.values(u.records.nodes).filter(b),"getServices"),X=(0,t.eW)(function({id:v,in:M}){u.records.registeredIds[v]="node",u.records.nodes[v]={id:v,type:"junction",edges:[],in:M}},"addJunction"),Y=(0,t.eW)(()=>Object.values(u.records.nodes).filter(J),"getJunctions"),P=(0,t.eW)(()=>Object.values(u.records.nodes),"getNodes"),_=(0,t.eW)(v=>u.records.nodes[v],"getNode"),lt=(0,t.eW)(function({id:v,icon:M,in:C,title:k}){if(void 0!==u.records.registeredIds[v])throw new Error(`The group id [${v}] is already in use by another ${u.records.registeredIds[v]}`);if(void 0!==C){if(v===C)throw new Error(`The group [${v}] cannot be placed within itself`);if(void 0===u.records.registeredIds[C])throw new Error(`The group [${v}]'s parent does not exist. Please make sure the parent is created before this group`);if("node"===u.records.registeredIds[C])throw new Error(`The group [${v}]'s parent is not a group`)}u.records.registeredIds[v]="group",u.records.groups[v]={id:v,icon:M,title:k,in:C}},"addGroup"),H=(0,t.eW)(()=>Object.values(u.records.groups),"getGroups"),ht=(0,t.eW)(function({lhsId:v,rhsId:M,lhsDir:C,rhsDir:k,lhsInto:G,rhsInto:S,lhsGroup:F,rhsGroup:$,title:ot}){if(!A(C))throw new Error(`Invalid direction given for left hand side of edge ${v}--${M}. Expected (L,R,T,B) got ${C}`);if(!A(k))throw new Error(`Invalid direction given for right hand side of edge ${v}--${M}. Expected (L,R,T,B) got ${k}`);if(void 0===u.records.nodes[v]&&void 0===u.records.groups[v])throw new Error(`The left-hand id [${v}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(void 0===u.records.nodes[M]&&void 0===u.records.groups[v])throw new Error(`The right-hand id [${M}] does not yet exist. Please create the service/group before declaring an edge to it.`);const U=u.records.nodes[v].in,at=u.records.nodes[M].in;if(F&&U&&at&&U==at)throw new Error(`The left-hand id [${v}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if($&&U&&at&&U==at)throw new Error(`The right-hand id [${M}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);const W={lhsId:v,lhsDir:C,lhsInto:G,lhsGroup:F,rhsId:M,rhsDir:k,rhsInto:S,rhsGroup:$,title:ot};u.records.edges.push(W),u.records.nodes[v]&&u.records.nodes[M]&&(u.records.nodes[v].edges.push(u.records.edges[u.records.edges.length-1]),u.records.nodes[M].edges.push(u.records.edges[u.records.edges.length-1]))},"addEdge"),tt=(0,t.eW)(()=>u.records.edges,"getEdges"),O=(0,t.eW)(()=>{if(void 0===u.records.dataStructures){const v={},M=Object.entries(u.records.nodes).reduce(($,[ot,U])=>($[ot]=U.edges.reduce((at,W)=>{const K=_(W.lhsId)?.in,rt=_(W.rhsId)?.in;if(K&&rt&&K!==rt){const B=mt(W.lhsDir,W.rhsDir);"bend"!==B&&(v[K]??={},v[K][rt]=B,v[rt]??={},v[rt][K]=B)}if(W.lhsId===ot){const B=nt(W.lhsDir,W.rhsDir);B&&(at[B]=W.rhsId)}else{const B=nt(W.rhsDir,W.lhsDir);B&&(at[B]=W.lhsId)}return at},{}),$),{}),C=Object.keys(M)[0],k={[C]:1},G=Object.keys(M).reduce(($,ot)=>ot===C?$:{...$,[ot]:1},{}),S=(0,t.eW)($=>{const ot={[$]:[0,0]},U=[$];for(;U.length>0;){const at=U.shift();if(at){k[at]=1,delete G[at];const W=M[at],[K,rt]=ot[at];Object.entries(W).forEach(([B,j])=>{k[j]||(ot[j]=dt([K,rt],B),U.push(j))})}}return ot},"BFS"),F=[S(C)];for(;Object.keys(G).length>0;)F.push(S(Object.keys(G)[0]));u.records.dataStructures={adjList:M,spatialMaps:F,groupAlignments:v}}return u.records.dataStructures},"getDataStructures"),z=(0,t.eW)((v,M)=>{u.records.elements[v]=M},"setElementForId"),Z=(0,t.eW)(v=>u.records.elements[v],"getElementById"),st={clear:p,setDiagramTitle:t.g2,getDiagramTitle:t.Kr,setAccTitle:t.GN,getAccTitle:t.eu,setAccDescription:t.U$,getAccDescription:t.Mx,addService:I,getServices:w,addJunction:X,getJunctions:Y,getNodes:P,getNode:_,addGroup:lt,getGroups:H,addEdge:ht,getEdges:tt,setElementForId:z,getElementById:Z,getDataStructures:O};function ft(v){const M=(0,t.nV)().architecture;return M?.[v]?M[v]:h[v]}(0,t.eW)(ft,"getConfigField");var it=(0,t.eW)((v,M)=>{(0,n.A)(v,M),v.groups.map(M.addGroup),v.services.map(C=>M.addService({...C,type:"service"})),v.junctions.map(C=>M.addJunction({...C,type:"junction"})),v.edges.map(M.addEdge)},"populateDb"),Pt={parse:(0,t.eW)(function(){var v=(0,R.Z)(function*(M){const C=yield(0,d.Qc)("architecture",M);t.cM.debug(C),it(C,st)});return function(M){return v.apply(this,arguments)}}(),"parse")},Kt=(0,t.eW)(v=>`\n .edge {\n stroke-width: ${v.archEdgeWidth};\n stroke: ${v.archEdgeColor};\n fill: none;\n }\n\n .arrow {\n fill: ${v.archEdgeArrowColor};\n }\n\n .node-bkg {\n fill: none;\n stroke: ${v.archGroupBorderColor};\n stroke-width: ${v.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"),Ut=(0,t.eW)(v=>`${v}`,"wrapIcon"),ut={prefix:"mermaid-architecture",height:80,width:80,icons:{database:{body:Ut('')},server:{body:Ut('')},disk:{body:Ut('')},internet:{body:Ut('')},cloud:{body:Ut('')},unknown:y.cN,blank:{body:Ut("")}}},gt=(0,t.eW)(function(){var v=(0,R.Z)(function*(M,C){const k=ft("padding"),G=ft("iconSize"),S=G/2,F=G/6,$=F/2;yield Promise.all(C.edges().map(function(){var ot=(0,R.Z)(function*(U){const{source:at,sourceDir:W,sourceArrow:K,sourceGroup:rt,target:B,targetDir:j,targetArrow:Ot,targetGroup:pt,label:yt}=i(U);let{x:It,y:Nt}=U[0].sourceEndpoint();const{x:St,y:wt}=U[0].midpoint();let{x:Gt,y:zt}=U[0].targetEndpoint();const Wt=k+4;if(rt&&(N(W)?It+="L"===W?-Wt:Wt:Nt+="T"===W?-Wt:Wt+18),pt&&(N(j)?Gt+="L"===j?-Wt:Wt:zt+="T"===j?-Wt:Wt+18),!rt&&"junction"===st.getNode(at)?.type&&(N(W)?It+="L"===W?S:-S:Nt+="T"===W?S:-S),!pt&&"junction"===st.getNode(B)?.type&&(N(j)?Gt+="L"===j?S:-S:zt+="T"===j?S:-S),U[0]._private.rscratch){const Vt=M.insert("g");if(Vt.insert("path").attr("d",`M ${It},${Nt} L ${St},${wt} L${Gt},${zt} `).attr("class","edge"),K){const $t=N(W)?T[W](It,F):It-$,kt=L(W)?T[W](Nt,F):Nt-$;Vt.insert("polygon").attr("points",c[W](F)).attr("transform",`translate(${$t},${kt})`).attr("class","arrow")}if(Ot){const $t=N(j)?T[j](Gt,F):Gt-$,kt=L(j)?T[j](zt,F):zt-$;Vt.insert("polygon").attr("points",c[j](F)).attr("transform",`translate(${$t},${kt})`).attr("class","arrow")}if(yt){const $t=D(W,j)?"XY":N(W)?"X":"Y";let kt=0;kt="X"===$t?Math.abs(It-Gt):"Y"===$t?Math.abs(Nt-zt)/1.5:Math.abs(It-Gt)/2;const Zt=Vt.append("g");if(yield(0,s.rw)(Zt,yt,{useHtmlLabels:!1,width:kt,classes:"architecture-service-label"},(0,t.nV)()),Zt.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),"X"===$t)Zt.attr("transform","translate("+St+", "+wt+")");else if("Y"===$t)Zt.attr("transform","translate("+St+", "+wt+") rotate(-90)");else if("XY"===$t){const _t=nt(W,j);if(_t&&et(_t)){const jt=Zt.node().getBoundingClientRect(),[qt,re]=ct(_t);Zt.attr("dominant-baseline","auto").attr("transform",`rotate(${-1*qt*re*45})`);const ie=Zt.node().getBoundingClientRect();Zt.attr("transform",`\n translate(${St}, ${wt-jt.height/2})\n translate(${qt*ie.width/2}, ${re*ie.height/2})\n rotate(${-1*qt*re*45}, 0, ${jt.height/2})\n `)}}}}});return function(U){return ot.apply(this,arguments)}}()))});return function(M,C){return v.apply(this,arguments)}}(),"drawEdges"),xt=(0,t.eW)(function(){var v=(0,R.Z)(function*(M,C){const G=.75*ft("padding"),S=ft("fontSize"),$=ft("iconSize")/2;yield Promise.all(C.nodes().map(function(){var ot=(0,R.Z)(function*(U){const at=m(U);if("group"===at.type){const{h:W,w:K,x1:rt,y1:B}=U.boundingBox();M.append("rect").attr("x",rt+$).attr("y",B+$).attr("width",K).attr("height",W).attr("class","node-bkg");const j=M.append("g");let Ot=rt,pt=B;if(at.icon){const yt=j.append("g");yt.html(`${yield(0,y.s4)(at.icon,{height:G,width:G,fallbackPrefix:ut.prefix})}`),yt.attr("transform","translate("+(Ot+$+1)+", "+(pt+$+1)+")"),Ot+=G,pt+=S/2-1-2}if(at.label){const yt=j.append("g");yield(0,s.rw)(yt,at.label,{useHtmlLabels:!1,width:K,classes:"architecture-service-label"},(0,t.nV)()),yt.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","start").attr("text-anchor","start"),yt.attr("transform","translate("+(Ot+$+4)+", "+(pt+$+2)+")")}}});return function(U){return ot.apply(this,arguments)}}()))});return function(M,C){return v.apply(this,arguments)}}(),"drawGroups"),Dt=(0,t.eW)(function(){var v=(0,R.Z)(function*(M,C,k){for(const G of k){const S=C.append("g"),F=ft("iconSize");if(G.title){const at=S.append("g");yield(0,s.rw)(at,G.title,{useHtmlLabels:!1,width:1.5*F,classes:"architecture-service-label"},(0,t.nV)()),at.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),at.attr("transform","translate("+F/2+", "+F+")")}const $=S.append("g");if(G.icon)$.html(`${yield(0,y.s4)(G.icon,{height:F,width:F,fallbackPrefix:ut.prefix})}`);else if(G.iconText){$.html(`${yield(0,y.s4)("blank",{height:F,width:F,fallbackPrefix:ut.prefix})}`);const K=$.append("g").append("foreignObject").attr("width",F).attr("height",F).append("div").attr("class","node-icon-text").attr("style",`height: ${F}px;`).append("div").html(G.iconText),rt=parseInt(window.getComputedStyle(K.node(),null).getPropertyValue("font-size").replace(/\D/g,""))??16;K.attr("style",`-webkit-line-clamp: ${Math.floor((F-2)/rt)};`)}else $.append("path").attr("class","node-bkg").attr("id","node-"+G.id).attr("d",`M0 ${F} v${-F} q0,-5 5,-5 h${F} q5,0 5,5 v${F} H0 Z`);S.attr("class","architecture-service");const{width:ot,height:U}=S._groups[0][0].getBBox();G.width=ot,G.height=U,M.setElementForId(G.id,S)}return 0});return function(M,C,k){return v.apply(this,arguments)}}(),"drawServices"),Mt=(0,t.eW)(function(v,M,C){C.forEach(k=>{const G=M.append("g"),S=ft("iconSize");G.append("g").append("rect").attr("id","node-"+k.id).attr("fill-opacity","0").attr("width",S).attr("height",S),G.attr("class","architecture-junction");const{width:$,height:ot}=G._groups[0][0].getBBox();G.width=$,G.height=ot,v.setElementForId(k.id,G)})},"drawJunctions");function Ct(v,M){v.forEach(C=>{M.add({group:"nodes",data:{type:"service",id:C.id,icon:C.icon,label:C.title,parent:C.in,width:ft("iconSize"),height:ft("iconSize")},classes:"node-service"})})}function At(v,M){v.forEach(C=>{M.add({group:"nodes",data:{type:"junction",id:C.id,parent:C.in,width:ft("iconSize"),height:ft("iconSize")},classes:"node-junction"})})}function Rt(v,M){M.nodes().map(C=>{const k=m(C);"group"!==k.type&&(k.x=C.position().x,k.y=C.position().y,v.getElementById(k.id).attr("transform","translate("+(k.x||0)+","+(k.y||0)+")"))})}function Ht(v,M){v.forEach(C=>{M.add({group:"nodes",data:{type:"group",id:C.id,icon:C.icon,label:C.title,parent:C.in},classes:"node-group"})})}function Qt(v,M){v.forEach(C=>{const{lhsId:k,rhsId:G,lhsInto:S,lhsGroup:F,rhsInto:$,lhsDir:ot,rhsDir:U,rhsGroup:at,title:W}=C,K=D(C.lhsDir,C.rhsDir)?"segments":"straight",rt={id:`${k}-${G}`,label:W,source:k,sourceDir:ot,sourceArrow:S,sourceGroup:F,sourceEndpoint:"L"===ot?"0 50%":"R"===ot?"100% 50%":"T"===ot?"50% 0":"50% 100%",target:G,targetDir:U,targetArrow:$,targetGroup:at,targetEndpoint:"L"===U?"0 50%":"R"===U?"100% 50%":"T"===U?"50% 0":"50% 100%"};M.add({group:"edges",data:rt,classes:K})})}function bt(v,M,C){const k=(0,t.eW)(($,ot)=>Object.entries($).reduce((U,[at,W])=>{let K=0;const rt=Object.entries(W);if(1===rt.length)return U[at]=rt[0][1],U;for(let B=0;B{const ot={},U={};return Object.entries($).forEach(([at,[W,K]])=>{const rt=v.getNode(at)?.in??"default";ot[K]??={},ot[K][rt]??=[],ot[K][rt].push(at),U[W]??={},U[W][rt]??=[],U[W][rt].push(at)}),{horiz:Object.values(k(ot,"horizontal")).filter(at=>at.length>1),vert:Object.values(k(U,"vertical")).filter(at=>at.length>1)}}),[S,F]=G.reduce(([$,ot],{horiz:U,vert:at})=>[[...$,...U],[...ot,...at]],[[],[]]);return{horizontal:S,vertical:F}}function Yt(v){const M=[],C=(0,t.eW)(G=>`${G[0]},${G[1]}`,"posToStr"),k=(0,t.eW)(G=>G.split(",").map(S=>parseInt(S)),"strToPos");return v.forEach(G=>{const S=Object.fromEntries(Object.entries(G).map(([U,at])=>[C(at),U])),F=[C([0,0])],$={},ot={L:[-1,0],R:[1,0],T:[0,1],B:[0,-1]};for(;F.length>0;){const U=F.shift();if(U){$[U]=1;const at=S[U];if(at){const W=k(U);Object.entries(ot).forEach(([K,rt])=>{const B=C([W[0]+rt[0],W[1]+rt[1]]),j=S[B];j&&!$[B]&&(F.push(B),M.push({[g[K]]:j,[g[f(K)]]:at,gap:1.5*ft("iconSize")}))})}}}}),M}function Xt(v,M,C,k,G,{spatialMaps:S,groupAlignments:F}){return new Promise($=>{const ot=(0,l.Ys)("body").append("div").attr("id","cy").attr("style","display:none"),U=(0,e.Z)({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":`${ft("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:`${ft("padding")}px`}}]});ot.remove(),Ht(C,U),Ct(v,U),At(M,U),Qt(k,U);const at=bt(G,S,F),W=Yt(S),K=U.layout({name:"fcose",quality:"proof",styleEnabled:!1,animate:!1,nodeDimensionsIncludeLabels:!1,idealEdgeLength(rt){const[B,j]=rt.connectedNodes(),{parent:Ot}=m(B),{parent:pt}=m(j);return Ot===pt?1.5*ft("iconSize"):.5*ft("iconSize")},edgeElasticity(rt){const[B,j]=rt.connectedNodes(),{parent:Ot}=m(B),{parent:pt}=m(j);return Ot===pt?.45:.001},alignmentConstraint:at,relativePlacementConstraint:W});K.one("layoutstop",()=>{function rt(B,j,Ot,pt){let yt,It;const{x:Nt,y:St}=B,{x:wt,y:Gt}=j;It=(pt-St+(Nt-Ot)*(St-Gt)/(Nt-wt))/Math.sqrt(1+Math.pow((St-Gt)/(Nt-wt),2)),yt=Math.sqrt(Math.pow(pt-St,2)+Math.pow(Ot-Nt,2)-Math.pow(It,2));yt/=Math.sqrt(Math.pow(wt-Nt,2)+Math.pow(Gt-St,2));let Wt=(wt-Nt)*(pt-St)-(Gt-St)*(Ot-Nt);switch(!0){case Wt>=0:Wt=1;break;case Wt<0:Wt=-1}let Vt=(wt-Nt)*(Ot-Nt)+(Gt-St)*(pt-St);switch(!0){case Vt>=0:Vt=1;break;case Vt<0:Vt=-1}return It=Math.abs(It)*Wt,yt*=Vt,{distances:It,weights:yt}}(0,t.eW)(rt,"getSegmentWeights"),U.startBatch();for(const B of Object.values(U.edges()))if(B.data?.()){const{x:j,y:Ot}=B.source().position(),{x:pt,y:yt}=B.target().position();if(j!==pt&&Ot!==yt){const It=B.sourceEndpoint(),Nt=B.targetEndpoint(),{sourceDir:St}=i(B),[wt,Gt]=L(St)?[It.x,Nt.y]:[Nt.x,It.y],{weights:zt,distances:Wt}=rt(It,Nt,wt,Gt);B.style("segment-distances",Wt),B.style("segment-weights",zt)}}U.endBatch(),K.run()}),K.run(),U.ready(rt=>{t.cM.info("Ready",rt),$(U)})})}(0,y.ef)([{name:ut.prefix,icons:ut}]),e.Z.use(r),(0,t.eW)(Ct,"addServices"),(0,t.eW)(At,"addJunctions"),(0,t.eW)(Rt,"positionNodes"),(0,t.eW)(Ht,"addGroups"),(0,t.eW)(Qt,"addEdges"),(0,t.eW)(bt,"getAlignments"),(0,t.eW)(Yt,"getRelativeConstraints"),(0,t.eW)(Xt,"layoutArchitecture");var q={parser:Pt,db:st,renderer:{draw:(0,t.eW)(function(){var v=(0,R.Z)(function*(M,C,k,G){const S=G.db,F=S.getServices(),$=S.getJunctions(),ot=S.getGroups(),U=S.getEdges(),at=S.getDataStructures(),W=(0,E.P)(C),K=W.append("g");K.attr("class","architecture-edges");const rt=W.append("g");rt.attr("class","architecture-services");const B=W.append("g");B.attr("class","architecture-groups"),yield Dt(S,rt,F),Mt(S,rt,$);const j=yield Xt(F,$,ot,U,S,at);yield gt(K,j),yield xt(B,j),Rt(S,j),(0,t.j7)(void 0,W,ft("padding"),ft("useMaxWidth"))});return function(M,C,k,G){return v.apply(this,arguments)}}(),"draw")},styles:Kt}}}]);