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