import{aK as Te,aL as ke,z as qe,_ as nt,aM as Je,aN as Qe,p as Ke,q as je,s as _e,g as tr,c as er,b as rr,d as fe,l as Se,j as ir,r as ar,E as nr,O as or,U as Ne,aO as Ee}from"./index-rTfho1Gk.js";import{p as sr}from"./chunk-OQCM5LHU-Bcp1tYPj.js";import{I as hr}from"./chunk-2RYQ3QTB-DgwCjInT.js";import{p as lr}from"./gitGraph-YCYPL57B-AfJfRAHO.js";import{c as Fe}from"./cytoscape.esm-BTmJTmak.js";import"./min-CsCIFSS6.js";import"./_baseUniq-DbOZ-2NY.js";var be={exports:{}},pe={exports:{}},ye={exports:{}},Oe;function fr(){return Oe||(Oe=1,function(M,Y){(function(G,N){M.exports=N()})(Te,function(){return function(C){var G={};function N(g){if(G[g])return G[g].exports;var s=G[g]={i:g,l:!1,exports:{}};return C[g].call(s.exports,s,s.exports,N),s.l=!0,s.exports}return N.m=C,N.c=G,N.i=function(g){return g},N.d=function(g,s,i){N.o(g,s)||Object.defineProperty(g,s,{configurable:!1,enumerable:!0,get:i})},N.n=function(g){var s=g&&g.__esModule?function(){return g.default}:function(){return g};return N.d(s,"a",s),s},N.o=function(g,s){return Object.prototype.hasOwnProperty.call(g,s)},N.p="",N(N.s=28)}([function(C,G,N){function g(){}g.QUALITY=1,g.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,g.DEFAULT_INCREMENTAL=!1,g.DEFAULT_ANIMATION_ON_LAYOUT=!0,g.DEFAULT_ANIMATION_DURING_LAYOUT=!1,g.DEFAULT_ANIMATION_PERIOD=50,g.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,g.DEFAULT_GRAPH_MARGIN=15,g.NODE_DIMENSIONS_INCLUDE_LABELS=!1,g.SIMPLE_NODE_SIZE=40,g.SIMPLE_NODE_HALF_SIZE=g.SIMPLE_NODE_SIZE/2,g.EMPTY_COMPOUND_NODE_SIZE=40,g.MIN_EDGE_LENGTH=1,g.WORLD_BOUNDARY=1e6,g.INITIAL_WORLD_BOUNDARY=g.WORLD_BOUNDARY/1e3,g.WORLD_CENTER_X=1200,g.WORLD_CENTER_Y=900,C.exports=g},function(C,G,N){var g=N(2),s=N(8),i=N(9);function r(f,a,y){g.call(this,y),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=y,this.bendpoints=[],this.source=f,this.target=a}r.prototype=Object.create(g.prototype);for(var e in g)r[e]=g[e];r.prototype.getSource=function(){return this.source},r.prototype.getTarget=function(){return this.target},r.prototype.isInterGraph=function(){return this.isInterGraph},r.prototype.getLength=function(){return this.length},r.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},r.prototype.getBendpoints=function(){return this.bendpoints},r.prototype.getLca=function(){return this.lca},r.prototype.getSourceInLca=function(){return this.sourceInLca},r.prototype.getTargetInLca=function(){return this.targetInLca},r.prototype.getOtherEnd=function(f){if(this.source===f)return this.target;if(this.target===f)return this.source;throw"Node is not incident with this edge"},r.prototype.getOtherEndInGraph=function(f,a){for(var y=this.getOtherEnd(f),t=a.getGraphManager().getRoot();;){if(y.getOwner()==a)return y;if(y.getOwner()==t)break;y=y.getOwner().getParent()}return null},r.prototype.updateLength=function(){var f=new Array(4);this.isOverlapingSourceAndTarget=s.getIntersection(this.target.getRect(),this.source.getRect(),f),this.isOverlapingSourceAndTarget||(this.lengthX=f[0]-f[2],this.lengthY=f[1]-f[3],Math.abs(this.lengthX)<1&&(this.lengthX=i.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=i.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},r.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=i.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=i.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},C.exports=r},function(C,G,N){function g(s){this.vGraphObject=s}C.exports=g},function(C,G,N){var g=N(2),s=N(10),i=N(13),r=N(0),e=N(16),f=N(5);function a(t,h,o,c){o==null&&c==null&&(c=h),g.call(this,c),t.graphManager!=null&&(t=t.graphManager),this.estimatedSize=s.MIN_VALUE,this.inclusionTreeDepth=s.MAX_VALUE,this.vGraphObject=c,this.edges=[],this.graphManager=t,o!=null&&h!=null?this.rect=new i(h.x,h.y,o.width,o.height):this.rect=new i}a.prototype=Object.create(g.prototype);for(var y in g)a[y]=g[y];a.prototype.getEdges=function(){return this.edges},a.prototype.getChild=function(){return this.child},a.prototype.getOwner=function(){return this.owner},a.prototype.getWidth=function(){return this.rect.width},a.prototype.setWidth=function(t){this.rect.width=t},a.prototype.getHeight=function(){return this.rect.height},a.prototype.setHeight=function(t){this.rect.height=t},a.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},a.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},a.prototype.getCenter=function(){return new f(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},a.prototype.getLocation=function(){return new f(this.rect.x,this.rect.y)},a.prototype.getRect=function(){return this.rect},a.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},a.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},a.prototype.setRect=function(t,h){this.rect.x=t.x,this.rect.y=t.y,this.rect.width=h.width,this.rect.height=h.height},a.prototype.setCenter=function(t,h){this.rect.x=t-this.rect.width/2,this.rect.y=h-this.rect.height/2},a.prototype.setLocation=function(t,h){this.rect.x=t,this.rect.y=h},a.prototype.moveBy=function(t,h){this.rect.x+=t,this.rect.y+=h},a.prototype.getEdgeListToNode=function(t){var h=[],o=this;return o.edges.forEach(function(c){if(c.target==t){if(c.source!=o)throw"Incorrect edge source!";h.push(c)}}),h},a.prototype.getEdgesBetween=function(t){var h=[],o=this;return o.edges.forEach(function(c){if(!(c.source==o||c.target==o))throw"Incorrect edge source and/or target";(c.target==t||c.source==t)&&h.push(c)}),h},a.prototype.getNeighborsList=function(){var t=new Set,h=this;return h.edges.forEach(function(o){if(o.source==h)t.add(o.target);else{if(o.target!=h)throw"Incorrect incidency!";t.add(o.source)}}),t},a.prototype.withChildren=function(){var t=new Set,h,o;if(t.add(this),this.child!=null)for(var c=this.child.getNodes(),l=0;lh?(this.rect.x-=(this.labelWidth-h)/2,this.setWidth(this.labelWidth)):this.labelPosHorizontal=="right"&&this.setWidth(h+this.labelWidth)),this.labelHeight&&(this.labelPosVertical=="top"?(this.rect.y-=this.labelHeight,this.setHeight(o+this.labelHeight)):this.labelPosVertical=="center"&&this.labelHeight>o?(this.rect.y-=(this.labelHeight-o)/2,this.setHeight(this.labelHeight)):this.labelPosVertical=="bottom"&&this.setHeight(o+this.labelHeight))}}},a.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==s.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},a.prototype.transform=function(t){var h=this.rect.x;h>r.WORLD_BOUNDARY?h=r.WORLD_BOUNDARY:h<-r.WORLD_BOUNDARY&&(h=-r.WORLD_BOUNDARY);var o=this.rect.y;o>r.WORLD_BOUNDARY?o=r.WORLD_BOUNDARY:o<-r.WORLD_BOUNDARY&&(o=-r.WORLD_BOUNDARY);var c=new f(h,o),l=t.inverseTransformPoint(c);this.setLocation(l.x,l.y)},a.prototype.getLeft=function(){return this.rect.x},a.prototype.getRight=function(){return this.rect.x+this.rect.width},a.prototype.getTop=function(){return this.rect.y},a.prototype.getBottom=function(){return this.rect.y+this.rect.height},a.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},C.exports=a},function(C,G,N){var g=N(0);function s(){}for(var i in g)s[i]=g[i];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=s.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,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,C.exports=s},function(C,G,N){function g(s,i){s==null&&i==null?(this.x=0,this.y=0):(this.x=s,this.y=i)}g.prototype.getX=function(){return this.x},g.prototype.getY=function(){return this.y},g.prototype.setX=function(s){this.x=s},g.prototype.setY=function(s){this.y=s},g.prototype.getDifference=function(s){return new DimensionD(this.x-s.x,this.y-s.y)},g.prototype.getCopy=function(){return new g(this.x,this.y)},g.prototype.translate=function(s){return this.x+=s.width,this.y+=s.height,this},C.exports=g},function(C,G,N){var g=N(2),s=N(10),i=N(0),r=N(7),e=N(3),f=N(1),a=N(13),y=N(12),t=N(11);function h(c,l,T){g.call(this,T),this.estimatedSize=s.MIN_VALUE,this.margin=i.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=c,l!=null&&l instanceof r?this.graphManager=l:l!=null&&l instanceof Layout&&(this.graphManager=l.graphManager)}h.prototype=Object.create(g.prototype);for(var o in g)h[o]=g[o];h.prototype.getNodes=function(){return this.nodes},h.prototype.getEdges=function(){return this.edges},h.prototype.getGraphManager=function(){return this.graphManager},h.prototype.getParent=function(){return this.parent},h.prototype.getLeft=function(){return this.left},h.prototype.getRight=function(){return this.right},h.prototype.getTop=function(){return this.top},h.prototype.getBottom=function(){return this.bottom},h.prototype.isConnected=function(){return this.isConnected},h.prototype.add=function(c,l,T){if(l==null&&T==null){var u=c;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(u)>-1)throw"Node already in graph!";return u.owner=this,this.getNodes().push(u),u}else{var v=c;if(!(this.getNodes().indexOf(l)>-1&&this.getNodes().indexOf(T)>-1))throw"Source or target not in graph!";if(!(l.owner==T.owner&&l.owner==this))throw"Both owners must be this graph!";return l.owner!=T.owner?null:(v.source=l,v.target=T,v.isInterGraph=!1,this.getEdges().push(v),l.edges.push(v),T!=l&&T.edges.push(v),v)}},h.prototype.remove=function(c){var l=c;if(c instanceof e){if(l==null)throw"Node is null!";if(!(l.owner!=null&&l.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var T=l.edges.slice(),u,v=T.length,L=0;L-1&&P>-1))throw"Source and/or target doesn't know this edge!";u.source.edges.splice(A,1),u.target!=u.source&&u.target.edges.splice(P,1);var F=u.source.owner.getEdges().indexOf(u);if(F==-1)throw"Not in owner's edge list!";u.source.owner.getEdges().splice(F,1)}},h.prototype.updateLeftTop=function(){for(var c=s.MAX_VALUE,l=s.MAX_VALUE,T,u,v,L=this.getNodes(),F=L.length,A=0;AT&&(c=T),l>u&&(l=u)}return c==s.MAX_VALUE?null:(L[0].getParent().paddingLeft!=null?v=L[0].getParent().paddingLeft:v=this.margin,this.left=l-v,this.top=c-v,new y(this.left,this.top))},h.prototype.updateBounds=function(c){for(var l=s.MAX_VALUE,T=-s.MAX_VALUE,u=s.MAX_VALUE,v=-s.MAX_VALUE,L,F,A,P,J,V=this.nodes,Q=V.length,D=0;DL&&(l=L),TA&&(u=A),vL&&(l=L),TA&&(u=A),v=this.nodes.length){var Q=0;T.forEach(function(D){D.owner==c&&Q++}),Q==this.nodes.length&&(this.isConnected=!0)}},C.exports=h},function(C,G,N){var g,s=N(1);function i(r){g=N(6),this.layout=r,this.graphs=[],this.edges=[]}i.prototype.addRoot=function(){var r=this.layout.newGraph(),e=this.layout.newNode(null),f=this.add(r,e);return this.setRootGraph(f),this.rootGraph},i.prototype.add=function(r,e,f,a,y){if(f==null&&a==null&&y==null){if(r==null)throw"Graph is null!";if(e==null)throw"Parent node is null!";if(this.graphs.indexOf(r)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(r),r.parent!=null)throw"Already has a parent!";if(e.child!=null)throw"Already has a child!";return r.parent=e,e.child=r,r}else{y=f,a=e,f=r;var t=a.getOwner(),h=y.getOwner();if(!(t!=null&&t.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(h!=null&&h.getGraphManager()==this))throw"Target not in this graph mgr!";if(t==h)return f.isInterGraph=!1,t.add(f,a,y);if(f.isInterGraph=!0,f.source=a,f.target=y,this.edges.indexOf(f)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(f),!(f.source!=null&&f.target!=null))throw"Edge source and/or target is null!";if(!(f.source.edges.indexOf(f)==-1&&f.target.edges.indexOf(f)==-1))throw"Edge already in source and/or target incidency list!";return f.source.edges.push(f),f.target.edges.push(f),f}},i.prototype.remove=function(r){if(r instanceof g){var e=r;if(e.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(e==this.rootGraph||e.parent!=null&&e.parent.graphManager==this))throw"Invalid parent node!";var f=[];f=f.concat(e.getEdges());for(var a,y=f.length,t=0;t=r.getRight()?e[0]+=Math.min(r.getX()-i.getX(),i.getRight()-r.getRight()):r.getX()<=i.getX()&&r.getRight()>=i.getRight()&&(e[0]+=Math.min(i.getX()-r.getX(),r.getRight()-i.getRight())),i.getY()<=r.getY()&&i.getBottom()>=r.getBottom()?e[1]+=Math.min(r.getY()-i.getY(),i.getBottom()-r.getBottom()):r.getY()<=i.getY()&&r.getBottom()>=i.getBottom()&&(e[1]+=Math.min(i.getY()-r.getY(),r.getBottom()-i.getBottom()));var y=Math.abs((r.getCenterY()-i.getCenterY())/(r.getCenterX()-i.getCenterX()));r.getCenterY()===i.getCenterY()&&r.getCenterX()===i.getCenterX()&&(y=1);var t=y*e[0],h=e[1]/y;e[0]t)return e[0]=f,e[1]=o,e[2]=y,e[3]=V,!1;if(ay)return e[0]=h,e[1]=a,e[2]=P,e[3]=t,!1;if(fy?(e[0]=l,e[1]=T,n=!0):(e[0]=c,e[1]=o,n=!0):d===p&&(f>y?(e[0]=h,e[1]=o,n=!0):(e[0]=u,e[1]=T,n=!0)),-E===p?y>f?(e[2]=J,e[3]=V,m=!0):(e[2]=P,e[3]=A,m=!0):E===p&&(y>f?(e[2]=F,e[3]=A,m=!0):(e[2]=Q,e[3]=V,m=!0)),n&&m)return!1;if(f>y?a>t?(R=this.getCardinalDirection(d,p,4),w=this.getCardinalDirection(E,p,2)):(R=this.getCardinalDirection(-d,p,3),w=this.getCardinalDirection(-E,p,1)):a>t?(R=this.getCardinalDirection(-d,p,1),w=this.getCardinalDirection(-E,p,3)):(R=this.getCardinalDirection(d,p,2),w=this.getCardinalDirection(E,p,4)),!n)switch(R){case 1:H=o,I=f+-L/p,e[0]=I,e[1]=H;break;case 2:I=u,H=a+v*p,e[0]=I,e[1]=H;break;case 3:H=T,I=f+L/p,e[0]=I,e[1]=H;break;case 4:I=l,H=a+-v*p,e[0]=I,e[1]=H;break}if(!m)switch(w){case 1:k=A,x=y+-rt/p,e[2]=x,e[3]=k;break;case 2:x=Q,k=t+D*p,e[2]=x,e[3]=k;break;case 3:k=V,x=y+rt/p,e[2]=x,e[3]=k;break;case 4:x=J,k=t+-D*p,e[2]=x,e[3]=k;break}}return!1},s.getCardinalDirection=function(i,r,e){return i>r?e:1+e%4},s.getIntersection=function(i,r,e,f){if(f==null)return this.getIntersection2(i,r,e);var a=i.x,y=i.y,t=r.x,h=r.y,o=e.x,c=e.y,l=f.x,T=f.y,u=void 0,v=void 0,L=void 0,F=void 0,A=void 0,P=void 0,J=void 0,V=void 0,Q=void 0;return L=h-y,A=a-t,J=t*y-a*h,F=T-c,P=o-l,V=l*c-o*T,Q=L*P-F*A,Q===0?null:(u=(A*V-P*J)/Q,v=(F*J-L*V)/Q,new g(u,v))},s.angleOfVector=function(i,r,e,f){var a=void 0;return i!==e?(a=Math.atan((f-r)/(e-i)),e=0){var T=(-o+Math.sqrt(o*o-4*h*c))/(2*h),u=(-o-Math.sqrt(o*o-4*h*c))/(2*h),v=null;return T>=0&&T<=1?[T]:u>=0&&u<=1?[u]:v}else 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,C.exports=s},function(C,G,N){function g(){}g.sign=function(s){return s>0?1:s<0?-1:0},g.floor=function(s){return s<0?Math.ceil(s):Math.floor(s)},g.ceil=function(s){return s<0?Math.floor(s):Math.ceil(s)},C.exports=g},function(C,G,N){function g(){}g.MAX_VALUE=2147483647,g.MIN_VALUE=-2147483648,C.exports=g},function(C,G,N){var g=function(){function a(y,t){for(var h=0;h"u"?"undefined":g(i);return i==null||r!="object"&&r!="function"},C.exports=s},function(C,G,N){function g(o){if(Array.isArray(o)){for(var c=0,l=Array(o.length);c0&&c;){for(L.push(A[0]);L.length>0&&c;){var P=L[0];L.splice(0,1),v.add(P);for(var J=P.getEdges(),u=0;u-1&&A.splice(rt,1)}v=new Set,F=new Map}}return o},h.prototype.createDummyNodesForBendpoints=function(o){for(var c=[],l=o.source,T=this.graphManager.calcLowestCommonAncestor(o.source,o.target),u=0;u0){for(var T=this.edgeToDummyNodes.get(l),u=0;u=0&&c.splice(V,1);var Q=F.getNeighborsList();Q.forEach(function(n){if(l.indexOf(n)<0){var m=T.get(n),d=m-1;d==1&&P.push(n),T.set(n,d)}})}l=l.concat(P),(c.length==1||c.length==2)&&(u=!0,v=c[0])}return v},h.prototype.setGraphManager=function(o){this.graphManager=o},C.exports=h},function(C,G,N){function g(){}g.seed=1,g.x=0,g.nextDouble=function(){return g.x=Math.sin(g.seed++)*1e4,g.x-Math.floor(g.x)},C.exports=g},function(C,G,N){var g=N(5);function s(i,r){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}s.prototype.getWorldOrgX=function(){return this.lworldOrgX},s.prototype.setWorldOrgX=function(i){this.lworldOrgX=i},s.prototype.getWorldOrgY=function(){return this.lworldOrgY},s.prototype.setWorldOrgY=function(i){this.lworldOrgY=i},s.prototype.getWorldExtX=function(){return this.lworldExtX},s.prototype.setWorldExtX=function(i){this.lworldExtX=i},s.prototype.getWorldExtY=function(){return this.lworldExtY},s.prototype.setWorldExtY=function(i){this.lworldExtY=i},s.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},s.prototype.setDeviceOrgX=function(i){this.ldeviceOrgX=i},s.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},s.prototype.setDeviceOrgY=function(i){this.ldeviceOrgY=i},s.prototype.getDeviceExtX=function(){return this.ldeviceExtX},s.prototype.setDeviceExtX=function(i){this.ldeviceExtX=i},s.prototype.getDeviceExtY=function(){return this.ldeviceExtY},s.prototype.setDeviceExtY=function(i){this.ldeviceExtY=i},s.prototype.transformX=function(i){var r=0,e=this.lworldExtX;return e!=0&&(r=this.ldeviceOrgX+(i-this.lworldOrgX)*this.ldeviceExtX/e),r},s.prototype.transformY=function(i){var r=0,e=this.lworldExtY;return e!=0&&(r=this.ldeviceOrgY+(i-this.lworldOrgY)*this.ldeviceExtY/e),r},s.prototype.inverseTransformX=function(i){var r=0,e=this.ldeviceExtX;return e!=0&&(r=this.lworldOrgX+(i-this.ldeviceOrgX)*this.lworldExtX/e),r},s.prototype.inverseTransformY=function(i){var r=0,e=this.ldeviceExtY;return e!=0&&(r=this.lworldOrgY+(i-this.ldeviceOrgY)*this.lworldExtY/e),r},s.prototype.inverseTransformPoint=function(i){var r=new g(this.inverseTransformX(i.x),this.inverseTransformY(i.y));return r},C.exports=s},function(C,G,N){function g(t){if(Array.isArray(t)){for(var h=0,o=Array(t.length);hi.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*i.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(t-i.ADAPTATION_LOWER_NODE_LIMIT)/(i.ADAPTATION_UPPER_NODE_LIMIT-i.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-i.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=i.MAX_NODE_DISPLACEMENT_INCREMENTAL):(t>i.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(i.COOLING_ADAPTATION_FACTOR,1-(t-i.ADAPTATION_LOWER_NODE_LIMIT)/(i.ADAPTATION_UPPER_NODE_LIMIT-i.ADAPTATION_LOWER_NODE_LIMIT)*(1-i.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=i.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.displacementThresholdPerNode=3*i.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},a.prototype.calcSpringForces=function(){for(var t=this.getAllEdges(),h,o=0;o0&&arguments[0]!==void 0?arguments[0]:!0,h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,o,c,l,T,u=this.getAllNodes(),v;if(this.useFRGridVariant)for(this.totalIterations%i.GRID_CALCULATION_CHECK_PERIOD==1&&t&&this.updateGrid(),v=new Set,o=0;oL||v>L)&&(t.gravitationForceX=-this.gravityConstant*l,t.gravitationForceY=-this.gravityConstant*T)):(L=h.getEstimatedSize()*this.compoundGravityRangeFactor,(u>L||v>L)&&(t.gravitationForceX=-this.gravityConstant*l*this.compoundGravityConstant,t.gravitationForceY=-this.gravityConstant*T*this.compoundGravityConstant))},a.prototype.isConverged=function(){var t,h=!1;return this.totalIterations>this.maxIterations/3&&(h=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),t=this.totalDisplacement=u.length||L>=u[0].length)){for(var F=0;Fa}}]),e}();C.exports=r},function(C,G,N){function g(){}g.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 i=Math.min(this.m,this.n);this.s=function(Nt){for(var At=[];Nt-- >0;)At.push(0);return At}(Math.min(this.m+1,this.n)),this.U=function(Nt){var At=function Zt(Gt){if(Gt.length==0)return 0;for(var $t=[],Ft=0;Ft0;)At.push(0);return At}(this.n),e=function(Nt){for(var At=[];Nt-- >0;)At.push(0);return At}(this.m),f=!0,a=Math.min(this.m-1,this.n),y=Math.max(0,Math.min(this.n-2,this.m)),t=0;t=0;E--)if(this.s[E]!==0){for(var p=E+1;p=0;W--){if(function(Nt,At){return Nt&&At}(W0;){var q=void 0,It=void 0;for(q=n-2;q>=-1&&q!==-1;q--)if(Math.abs(r[q])<=lt+_*(Math.abs(this.s[q])+Math.abs(this.s[q+1]))){r[q]=0;break}if(q===n-2)It=4;else{var Lt=void 0;for(Lt=n-1;Lt>=q&&Lt!==q;Lt--){var dt=(Lt!==n?Math.abs(r[Lt]):0)+(Lt!==q+1?Math.abs(r[Lt-1]):0);if(Math.abs(this.s[Lt])<=lt+_*dt){this.s[Lt]=0;break}}Lt===q?It=3:Lt===n-1?It=1:(It=2,q=Lt)}switch(q++,It){case 1:{var it=r[n-2];r[n-2]=0;for(var ut=n-2;ut>=q;ut--){var Tt=g.hypot(this.s[ut],it),Ct=this.s[ut]/Tt,Dt=it/Tt;this.s[ut]=Tt,ut!==q&&(it=-Dt*r[ut-1],r[ut-1]=Ct*r[ut-1]);for(var mt=0;mt=this.s[q+1]);){var Mt=this.s[q];if(this.s[q]=this.s[q+1],this.s[q+1]=Mt,qMath.abs(i)?(r=i/s,r=Math.abs(s)*Math.sqrt(1+r*r)):i!=0?(r=s/i,r=Math.abs(i)*Math.sqrt(1+r*r)):r=0,r},C.exports=g},function(C,G,N){var g=function(){function r(e,f){for(var a=0;a2&&arguments[2]!==void 0?arguments[2]:1,y=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,t=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;s(this,r),this.sequence1=e,this.sequence2=f,this.match_score=a,this.mismatch_penalty=y,this.gap_penalty=t,this.iMax=e.length+1,this.jMax=f.length+1,this.grid=new Array(this.iMax);for(var h=0;h=0;e--){var f=this.listeners[e];f.event===i&&f.callback===r&&this.listeners.splice(e,1)}},s.emit=function(i,r){for(var e=0;e{var G={45:(i,r,e)=>{var f={};f.layoutBase=e(551),f.CoSEConstants=e(806),f.CoSEEdge=e(767),f.CoSEGraph=e(880),f.CoSEGraphManager=e(578),f.CoSELayout=e(765),f.CoSENode=e(991),f.ConstraintHandler=e(902),i.exports=f},806:(i,r,e)=>{var f=e(551).FDLayoutConstants;function a(){}for(var y in f)a[y]=f[y];a.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,a.DEFAULT_RADIAL_SEPARATION=f.DEFAULT_EDGE_LENGTH,a.DEFAULT_COMPONENT_SEPERATION=60,a.TILE=!0,a.TILING_PADDING_VERTICAL=10,a.TILING_PADDING_HORIZONTAL=10,a.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,a.ENFORCE_CONSTRAINTS=!0,a.APPLY_LAYOUT=!0,a.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,a.TREE_REDUCTION_ON_INCREMENTAL=!0,a.PURE_INCREMENTAL=a.DEFAULT_INCREMENTAL,i.exports=a},767:(i,r,e)=>{var f=e(551).FDLayoutEdge;function a(t,h,o){f.call(this,t,h,o)}a.prototype=Object.create(f.prototype);for(var y in f)a[y]=f[y];i.exports=a},880:(i,r,e)=>{var f=e(551).LGraph;function a(t,h,o){f.call(this,t,h,o)}a.prototype=Object.create(f.prototype);for(var y in f)a[y]=f[y];i.exports=a},578:(i,r,e)=>{var f=e(551).LGraphManager;function a(t){f.call(this,t)}a.prototype=Object.create(f.prototype);for(var y in f)a[y]=f[y];i.exports=a},765:(i,r,e)=>{var f=e(551).FDLayout,a=e(578),y=e(880),t=e(991),h=e(767),o=e(806),c=e(902),l=e(551).FDLayoutConstants,T=e(551).LayoutConstants,u=e(551).Point,v=e(551).PointD,L=e(551).DimensionD,F=e(551).Layout,A=e(551).Integer,P=e(551).IGeometry,J=e(551).LGraph,V=e(551).Transform,Q=e(551).LinkedList;function D(){f.call(this),this.toBeTiled={},this.constraints={}}D.prototype=Object.create(f.prototype);for(var rt in f)D[rt]=f[rt];D.prototype.newGraphManager=function(){var n=new a(this);return this.graphManager=n,n},D.prototype.newGraph=function(n){return new y(null,this.graphManager,n)},D.prototype.newNode=function(n){return new t(this.graphManager,n)},D.prototype.newEdge=function(n){return new h(null,null,n)},D.prototype.initParameters=function(){f.prototype.initParameters.call(this,arguments),this.isSubLayout||(o.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=o.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=o.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=l.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=l.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=l.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},D.prototype.initSpringEmbedder=function(){f.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/l.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},D.prototype.layout=function(){var n=T.DEFAULT_CREATE_BENDS_AS_NEEDED;return n&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},D.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),this.incremental){if(o.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var m=new Set(this.getAllNodes()),d=this.nodesWithGravity.filter(function(R){return m.has(R)});this.graphManager.setAllNodesToApplyGravitation(d)}}else{var n=this.getFlatForest();if(n.length>0)this.positionNodesRadially(n);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var m=new Set(this.getAllNodes()),d=this.nodesWithGravity.filter(function(E){return m.has(E)});this.graphManager.setAllNodesToApplyGravitation(d),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(c.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),o.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},D.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%l.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle:this.layoutQuality==1&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var n=new Set(this.getAllNodes()),m=this.nodesWithGravity.filter(function(p){return n.has(p)});this.graphManager.setAllNodesToApplyGravitation(m),this.graphManager.updateBounds(),this.updateGrid(),o.PURE_INCREMENTAL?this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=l.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()),o.PURE_INCREMENTAL?this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var d=!this.isTreeGrowing&&!this.isGrowthFinished,E=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(d,E),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},D.prototype.getPositionsData=function(){for(var n=this.graphManager.getAllNodes(),m={},d=0;d0&&this.updateDisplacements();for(var d=0;d0&&(E.fixedNodeWeight=R)}}if(this.constraints.relativePlacementConstraint){var w=new Map,I=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(O){n.fixedNodesOnHorizontal.add(O),n.fixedNodesOnVertical.add(O)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var H=this.constraints.alignmentConstraint.vertical,d=0;d=2*O.length/3;_--)X=Math.floor(Math.random()*(_+1)),B=O[_],O[_]=O[X],O[X]=B;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 X=w.has(O.left)?w.get(O.left):O.left,B=w.has(O.right)?w.get(O.right):O.right;n.nodesInRelativeHorizontal.includes(X)||(n.nodesInRelativeHorizontal.push(X),n.nodeToRelativeConstraintMapHorizontal.set(X,[]),n.dummyToNodeForVerticalAlignment.has(X)?n.nodeToTempPositionMapHorizontal.set(X,n.idToNodeMap.get(n.dummyToNodeForVerticalAlignment.get(X)[0]).getCenterX()):n.nodeToTempPositionMapHorizontal.set(X,n.idToNodeMap.get(X).getCenterX())),n.nodesInRelativeHorizontal.includes(B)||(n.nodesInRelativeHorizontal.push(B),n.nodeToRelativeConstraintMapHorizontal.set(B,[]),n.dummyToNodeForVerticalAlignment.has(B)?n.nodeToTempPositionMapHorizontal.set(B,n.idToNodeMap.get(n.dummyToNodeForVerticalAlignment.get(B)[0]).getCenterX()):n.nodeToTempPositionMapHorizontal.set(B,n.idToNodeMap.get(B).getCenterX())),n.nodeToRelativeConstraintMapHorizontal.get(X).push({right:B,gap:O.gap}),n.nodeToRelativeConstraintMapHorizontal.get(B).push({left:X,gap:O.gap})}else{var _=I.has(O.top)?I.get(O.top):O.top,lt=I.has(O.bottom)?I.get(O.bottom):O.bottom;n.nodesInRelativeVertical.includes(_)||(n.nodesInRelativeVertical.push(_),n.nodeToRelativeConstraintMapVertical.set(_,[]),n.dummyToNodeForHorizontalAlignment.has(_)?n.nodeToTempPositionMapVertical.set(_,n.idToNodeMap.get(n.dummyToNodeForHorizontalAlignment.get(_)[0]).getCenterY()):n.nodeToTempPositionMapVertical.set(_,n.idToNodeMap.get(_).getCenterY())),n.nodesInRelativeVertical.includes(lt)||(n.nodesInRelativeVertical.push(lt),n.nodeToRelativeConstraintMapVertical.set(lt,[]),n.dummyToNodeForHorizontalAlignment.has(lt)?n.nodeToTempPositionMapVertical.set(lt,n.idToNodeMap.get(n.dummyToNodeForHorizontalAlignment.get(lt)[0]).getCenterY()):n.nodeToTempPositionMapVertical.set(lt,n.idToNodeMap.get(lt).getCenterY())),n.nodeToRelativeConstraintMapVertical.get(_).push({bottom:lt,gap:O.gap}),n.nodeToRelativeConstraintMapVertical.get(lt).push({top:_,gap:O.gap})}});else{var k=new Map,W=new Map;this.constraints.relativePlacementConstraint.forEach(function(O){if(O.left){var X=w.has(O.left)?w.get(O.left):O.left,B=w.has(O.right)?w.get(O.right):O.right;k.has(X)?k.get(X).push(B):k.set(X,[B]),k.has(B)?k.get(B).push(X):k.set(B,[X])}else{var _=I.has(O.top)?I.get(O.top):O.top,lt=I.has(O.bottom)?I.get(O.bottom):O.bottom;W.has(_)?W.get(_).push(lt):W.set(_,[lt]),W.has(lt)?W.get(lt).push(_):W.set(lt,[_])}});var U=function(X,B){var _=[],lt=[],q=new Q,It=new Set,Lt=0;return X.forEach(function(dt,it){if(!It.has(it)){_[Lt]=[],lt[Lt]=!1;var ut=it;for(q.push(ut),It.add(ut),_[Lt].push(ut);q.length!=0;){ut=q.shift(),B.has(ut)&&(lt[Lt]=!0);var Tt=X.get(ut);Tt.forEach(function(Ct){It.has(Ct)||(q.push(Ct),It.add(Ct),_[Lt].push(Ct))})}Lt++}}),{components:_,isFixed:lt}},et=U(k,n.fixedNodesOnHorizontal);this.componentsOnHorizontal=et.components,this.fixedComponentsOnHorizontal=et.isFixed;var z=U(W,n.fixedNodesOnVertical);this.componentsOnVertical=z.components,this.fixedComponentsOnVertical=z.isFixed}}},D.prototype.updateDisplacements=function(){var n=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function(z){var O=n.idToNodeMap.get(z.nodeId);O.displacementX=0,O.displacementY=0}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var m=this.constraints.alignmentConstraint.vertical,d=0;d1){var I;for(I=0;IE&&(E=Math.floor(w.y)),R=Math.floor(w.x+o.DEFAULT_COMPONENT_SEPERATION)}this.transform(new v(T.WORLD_CENTER_X-w.x/2,T.WORLD_CENTER_Y-w.y/2))},D.radialLayout=function(n,m,d){var E=Math.max(this.maxDiagonalInTree(n),o.DEFAULT_RADIAL_SEPARATION);D.branchRadialLayout(m,null,0,359,0,E);var p=J.calculateBounds(n),R=new V;R.setDeviceOrgX(p.getMinX()),R.setDeviceOrgY(p.getMinY()),R.setWorldOrgX(d.x),R.setWorldOrgY(d.y);for(var w=0;w1;){var B=X[0];X.splice(0,1);var _=W.indexOf(B);_>=0&&W.splice(_,1),z--,U--}m!=null?O=(W.indexOf(X[0])+1)%z:O=0;for(var lt=Math.abs(E-d)/U,q=O;et!=U;q=++q%z){var It=W[q].getOtherEnd(n);if(It!=m){var Lt=(d+et*lt)%360,dt=(Lt+lt)%360;D.branchRadialLayout(It,n,Lt,dt,p+R,R),et++}}},D.maxDiagonalInTree=function(n){for(var m=A.MIN_VALUE,d=0;dm&&(m=p)}return m},D.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},D.prototype.groupZeroDegreeMembers=function(){var n=this,m={};this.memberGroups={},this.idToDummyNode={};for(var d=[],E=this.graphManager.getAllNodes(),p=0;p"u"&&(m[I]=[]),m[I]=m[I].concat(R)}Object.keys(m).forEach(function(H){if(m[H].length>1){var x="DummyCompound_"+H;n.memberGroups[x]=m[H];var k=m[H][0].getParent(),W=new t(n.graphManager);W.id=x,W.paddingLeft=k.paddingLeft||0,W.paddingRight=k.paddingRight||0,W.paddingBottom=k.paddingBottom||0,W.paddingTop=k.paddingTop||0,n.idToDummyNode[x]=W;var U=n.getGraphManager().add(n.newGraph(),W),et=k.getChild();et.add(W);for(var z=0;zp?(E.rect.x-=(E.labelWidth-p)/2,E.setWidth(E.labelWidth),E.labelMarginLeft=(E.labelWidth-p)/2):E.labelPosHorizontal=="right"&&E.setWidth(p+E.labelWidth)),E.labelHeight&&(E.labelPosVertical=="top"?(E.rect.y-=E.labelHeight,E.setHeight(R+E.labelHeight),E.labelMarginTop=E.labelHeight):E.labelPosVertical=="center"&&E.labelHeight>R?(E.rect.y-=(E.labelHeight-R)/2,E.setHeight(E.labelHeight),E.labelMarginTop=(E.labelHeight-R)/2):E.labelPosVertical=="bottom"&&E.setHeight(R+E.labelHeight))}})},D.prototype.repopulateCompounds=function(){for(var n=this.compoundOrder.length-1;n>=0;n--){var m=this.compoundOrder[n],d=m.id,E=m.paddingLeft,p=m.paddingTop,R=m.labelMarginLeft,w=m.labelMarginTop;this.adjustLocations(this.tiledMemberPack[d],m.rect.x,m.rect.y,E,p,R,w)}},D.prototype.repopulateZeroDegreeMembers=function(){var n=this,m=this.tiledZeroDegreePack;Object.keys(m).forEach(function(d){var E=n.idToDummyNode[d],p=E.paddingLeft,R=E.paddingTop,w=E.labelMarginLeft,I=E.labelMarginTop;n.adjustLocations(m[d],E.rect.x,E.rect.y,p,R,w,I)})},D.prototype.getToBeTiled=function(n){var m=n.id;if(this.toBeTiled[m]!=null)return this.toBeTiled[m];var d=n.getChild();if(d==null)return this.toBeTiled[m]=!1,!1;for(var E=d.getNodes(),p=0;p0)return this.toBeTiled[m]=!1,!1;if(R.getChild()==null){this.toBeTiled[R.id]=!1;continue}if(!this.getToBeTiled(R))return this.toBeTiled[m]=!1,!1}return this.toBeTiled[m]=!0,!0},D.prototype.getNodeDegree=function(n){n.id;for(var m=n.getEdges(),d=0,E=0;Ek&&(k=U.rect.height)}d+=k+n.verticalPadding}},D.prototype.tileCompoundMembers=function(n,m){var d=this;this.tiledMemberPack=[],Object.keys(n).forEach(function(E){var p=m[E];if(d.tiledMemberPack[E]=d.tileNodes(n[E],p.paddingLeft+p.paddingRight),p.rect.width=d.tiledMemberPack[E].width,p.rect.height=d.tiledMemberPack[E].height,p.setCenter(d.tiledMemberPack[E].centerX,d.tiledMemberPack[E].centerY),p.labelMarginLeft=0,p.labelMarginTop=0,o.NODE_DIMENSIONS_INCLUDE_LABELS){var R=p.rect.width,w=p.rect.height;p.labelWidth&&(p.labelPosHorizontal=="left"?(p.rect.x-=p.labelWidth,p.setWidth(R+p.labelWidth),p.labelMarginLeft=p.labelWidth):p.labelPosHorizontal=="center"&&p.labelWidth>R?(p.rect.x-=(p.labelWidth-R)/2,p.setWidth(p.labelWidth),p.labelMarginLeft=(p.labelWidth-R)/2):p.labelPosHorizontal=="right"&&p.setWidth(R+p.labelWidth)),p.labelHeight&&(p.labelPosVertical=="top"?(p.rect.y-=p.labelHeight,p.setHeight(w+p.labelHeight),p.labelMarginTop=p.labelHeight):p.labelPosVertical=="center"&&p.labelHeight>w?(p.rect.y-=(p.labelHeight-w)/2,p.setHeight(p.labelHeight),p.labelMarginTop=(p.labelHeight-w)/2):p.labelPosVertical=="bottom"&&p.setHeight(w+p.labelHeight))}})},D.prototype.tileNodes=function(n,m){var d=this.tileNodesByFavoringDim(n,m,!0),E=this.tileNodesByFavoringDim(n,m,!1),p=this.getOrgRatio(d),R=this.getOrgRatio(E),w;return RI&&(I=z.getWidth())});var H=R/p,x=w/p,k=Math.pow(d-E,2)+4*(H+E)*(x+d)*p,W=(E-d+Math.sqrt(k))/(2*(H+E)),U;m?(U=Math.ceil(W),U==W&&U++):U=Math.floor(W);var et=U*(H+E)-E;return I>et&&(et=I),et+=E*2,et},D.prototype.tileNodesByFavoringDim=function(n,m,d){var E=o.TILING_PADDING_VERTICAL,p=o.TILING_PADDING_HORIZONTAL,R=o.TILING_COMPARE_BY,w={rows:[],rowWidth:[],rowHeight:[],width:0,height:m,verticalPadding:E,horizontalPadding:p,centerX:0,centerY:0};R&&(w.idealRowWidth=this.calcIdealRowWidth(n,d));var I=function(O){return O.rect.width*O.rect.height},H=function(O,X){return I(X)-I(O)};n.sort(function(z,O){var X=H;return w.idealRowWidth?(X=R,X(z.id,O.id)):X(z,O)});for(var x=0,k=0,W=0;W0&&(w+=n.horizontalPadding),n.rowWidth[d]=w,n.width0&&(I+=n.verticalPadding);var H=0;I>n.rowHeight[d]&&(H=n.rowHeight[d],n.rowHeight[d]=I,H=n.rowHeight[d]-H),n.height+=H,n.rows[d].push(m)},D.prototype.getShortestRowIndex=function(n){for(var m=-1,d=Number.MAX_VALUE,E=0;Ed&&(m=E,d=n.rowWidth[E]);return m},D.prototype.canAddHorizontal=function(n,m,d){if(n.idealRowWidth){var E=n.rows.length-1,p=n.rowWidth[E];return p+m+n.horizontalPadding<=n.idealRowWidth}var R=this.getShortestRowIndex(n);if(R<0)return!0;var w=n.rowWidth[R];if(w+n.horizontalPadding+m<=n.width)return!0;var I=0;n.rowHeight[R]0&&(I=d+n.verticalPadding-n.rowHeight[R]);var H;n.width-w>=m+n.horizontalPadding?H=(n.height+I)/(w+m+n.horizontalPadding):H=(n.height+I)/n.width,I=d+n.verticalPadding;var x;return n.widthR&&m!=d){E.splice(-1,1),n.rows[d].push(p),n.rowWidth[m]=n.rowWidth[m]-R,n.rowWidth[d]=n.rowWidth[d]+R,n.width=n.rowWidth[instance.getLongestRowIndex(n)];for(var w=Number.MIN_VALUE,I=0;Iw&&(w=E[I].height);m>0&&(w+=n.verticalPadding);var H=n.rowHeight[m]+n.rowHeight[d];n.rowHeight[m]=w,n.rowHeight[d]0)for(var et=p;et<=R;et++)U[0]+=this.grid[et][w-1].length+this.grid[et][w].length-1;if(R0)for(var et=w;et<=I;et++)U[3]+=this.grid[p-1][et].length+this.grid[p][et].length-1;for(var z=A.MAX_VALUE,O,X,B=0;B{var f=e(551).FDLayoutNode,a=e(551).IMath;function y(h,o,c,l){f.call(this,h,o,c,l)}y.prototype=Object.create(f.prototype);for(var t in f)y[t]=f[t];y.prototype.calculateDisplacement=function(){var h=this.graphManager.getLayout();this.getChild()!=null&&this.fixedNodeWeight?(this.displacementX+=h.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=h.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=h.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=h.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>h.coolingFactor*h.maxNodeDisplacement&&(this.displacementX=h.coolingFactor*h.maxNodeDisplacement*a.sign(this.displacementX)),Math.abs(this.displacementY)>h.coolingFactor*h.maxNodeDisplacement&&(this.displacementY=h.coolingFactor*h.maxNodeDisplacement*a.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},y.prototype.propogateDisplacementToChildren=function(h,o){for(var c=this.getChild().getNodes(),l,T=0;T{function f(c){if(Array.isArray(c)){for(var l=0,T=Array(c.length);l0){var Mt=0;st.forEach(function(ht){$=="horizontal"?(tt.set(ht,u.has(ht)?v[u.get(ht)]:Z.get(ht)),Mt+=tt.get(ht)):(tt.set(ht,u.has(ht)?L[u.get(ht)]:Z.get(ht)),Mt+=tt.get(ht))}),Mt=Mt/st.length,ft.forEach(function(ht){K.has(ht)||tt.set(ht,Mt)})}else{var ct=0;ft.forEach(function(ht){$=="horizontal"?ct+=u.has(ht)?v[u.get(ht)]:Z.get(ht):ct+=u.has(ht)?L[u.get(ht)]:Z.get(ht)}),ct=ct/ft.length,ft.forEach(function(ht){tt.set(ht,ct)})}});for(var wt=function(){var st=vt.shift(),Mt=b.get(st);Mt.forEach(function(ct){if(tt.get(ct.id)ht&&(ht=qt),_tWt&&(Wt=_t)}}catch(ie){At=!0,Zt=ie}finally{try{!Nt&&Gt.return&&Gt.return()}finally{if(At)throw Zt}}var ce=(Mt+ht)/2-(ct+Wt)/2,Kt=!0,te=!1,ee=void 0;try{for(var jt=ft[Symbol.iterator](),se;!(Kt=(se=jt.next()).done);Kt=!0){var re=se.value;tt.set(re,tt.get(re)+ce)}}catch(ie){te=!0,ee=ie}finally{try{!Kt&&jt.return&&jt.return()}finally{if(te)throw ee}}})}return tt},rt=function(b){var $=0,K=0,Z=0,at=0;if(b.forEach(function(j){j.left?v[u.get(j.left)]-v[u.get(j.right)]>=0?$++:K++:L[u.get(j.top)]-L[u.get(j.bottom)]>=0?Z++:at++}),$>K&&Z>at)for(var gt=0;gtK)for(var ot=0;otat)for(var tt=0;tt1)l.fixedNodeConstraint.forEach(function(S,b){E[b]=[S.position.x,S.position.y],p[b]=[v[u.get(S.nodeId)],L[u.get(S.nodeId)]]}),R=!0;else if(l.alignmentConstraint)(function(){var S=0;if(l.alignmentConstraint.vertical){for(var b=l.alignmentConstraint.vertical,$=function(tt){var j=new Set;b[tt].forEach(function(yt){j.add(yt)});var vt=new Set([].concat(f(j)).filter(function(yt){return I.has(yt)})),wt=void 0;vt.size>0?wt=v[u.get(vt.values().next().value)]:wt=Q(j).x,b[tt].forEach(function(yt){E[S]=[wt,L[u.get(yt)]],p[S]=[v[u.get(yt)],L[u.get(yt)]],S++})},K=0;K0?wt=v[u.get(vt.values().next().value)]:wt=Q(j).y,Z[tt].forEach(function(yt){E[S]=[v[u.get(yt)],wt],p[S]=[v[u.get(yt)],L[u.get(yt)]],S++})},gt=0;gtW&&(W=k[et].length,U=et);if(W0){var mt={x:0,y:0};l.fixedNodeConstraint.forEach(function(S,b){var $={x:v[u.get(S.nodeId)],y:L[u.get(S.nodeId)]},K=S.position,Z=V(K,$);mt.x+=Z.x,mt.y+=Z.y}),mt.x/=l.fixedNodeConstraint.length,mt.y/=l.fixedNodeConstraint.length,v.forEach(function(S,b){v[b]+=mt.x}),L.forEach(function(S,b){L[b]+=mt.y}),l.fixedNodeConstraint.forEach(function(S){v[u.get(S.nodeId)]=S.position.x,L[u.get(S.nodeId)]=S.position.y})}if(l.alignmentConstraint){if(l.alignmentConstraint.vertical)for(var xt=l.alignmentConstraint.vertical,St=function(b){var $=new Set;xt[b].forEach(function(at){$.add(at)});var K=new Set([].concat(f($)).filter(function(at){return I.has(at)})),Z=void 0;K.size>0?Z=v[u.get(K.values().next().value)]:Z=Q($).x,$.forEach(function(at){I.has(at)||(v[u.get(at)]=Z)})},Vt=0;Vt0?Z=L[u.get(K.values().next().value)]:Z=Q($).y,$.forEach(function(at){I.has(at)||(L[u.get(at)]=Z)})},bt=0;bt{i.exports=C}},N={};function g(i){var r=N[i];if(r!==void 0)return r.exports;var e=N[i]={exports:{}};return G[i](e,e.exports,g),e.exports}var s=g(45);return s})()})}(pe)),pe.exports}(function(M,Y){(function(G,N){M.exports=N(cr())})(Te,function(C){return(()=>{var G={658:i=>{i.exports=Object.assign!=null?Object.assign.bind(Object):function(r){for(var e=arguments.length,f=Array(e>1?e-1:0),a=1;a{var f=function(){function t(h,o){var c=[],l=!0,T=!1,u=void 0;try{for(var v=h[Symbol.iterator](),L;!(l=(L=v.next()).done)&&(c.push(L.value),!(o&&c.length===o));l=!0);}catch(F){T=!0,u=F}finally{try{!l&&v.return&&v.return()}finally{if(T)throw u}}return c}return function(h,o){if(Array.isArray(h))return h;if(Symbol.iterator in Object(h))return t(h,o);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),a=e(140).layoutBase.LinkedList,y={};y.getTopMostNodes=function(t){for(var h={},o=0;o0&&R.merge(x)});for(var w=0;w1){L=u[0],F=L.connectedEdges().length,u.forEach(function(p){p.connectedEdges().length0&&c.set("dummy"+(c.size+1),J),V},y.relocateComponent=function(t,h,o){if(!o.fixedNodeConstraint){var c=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY,T=Number.POSITIVE_INFINITY,u=Number.NEGATIVE_INFINITY;if(o.quality=="draft"){var v=!0,L=!1,F=void 0;try{for(var A=h.nodeIndexes[Symbol.iterator](),P;!(v=(P=A.next()).done);v=!0){var J=P.value,V=f(J,2),Q=V[0],D=V[1],rt=o.cy.getElementById(Q);if(rt){var n=rt.boundingBox(),m=h.xCoords[D]-n.w/2,d=h.xCoords[D]+n.w/2,E=h.yCoords[D]-n.h/2,p=h.yCoords[D]+n.h/2;ml&&(l=d),Eu&&(u=p)}}}catch(x){L=!0,F=x}finally{try{!v&&A.return&&A.return()}finally{if(L)throw F}}var R=t.x-(l+c)/2,w=t.y-(u+T)/2;h.xCoords=h.xCoords.map(function(x){return x+R}),h.yCoords=h.yCoords.map(function(x){return x+w})}else{Object.keys(h).forEach(function(x){var k=h[x],W=k.getRect().x,U=k.getRect().x+k.getRect().width,et=k.getRect().y,z=k.getRect().y+k.getRect().height;Wl&&(l=U),etu&&(u=z)});var I=t.x-(l+c)/2,H=t.y-(u+T)/2;Object.keys(h).forEach(function(x){var k=h[x];k.setCenter(k.getCenterX()+I,k.getCenterY()+H)})}}},y.calcBoundingBox=function(t,h,o,c){for(var l=Number.MAX_SAFE_INTEGER,T=Number.MIN_SAFE_INTEGER,u=Number.MAX_SAFE_INTEGER,v=Number.MIN_SAFE_INTEGER,L=void 0,F=void 0,A=void 0,P=void 0,J=t.descendants().not(":parent"),V=J.length,Q=0;QL&&(l=L),TA&&(u=A),v{var f=e(548),a=e(140).CoSELayout,y=e(140).CoSENode,t=e(140).layoutBase.PointD,h=e(140).layoutBase.DimensionD,o=e(140).layoutBase.LayoutConstants,c=e(140).layoutBase.FDLayoutConstants,l=e(140).CoSEConstants,T=function(v,L){var F=v.cy,A=v.eles,P=A.nodes(),J=A.edges(),V=void 0,Q=void 0,D=void 0,rt={};v.randomize&&(V=L.nodeIndexes,Q=L.xCoords,D=L.yCoords);var n=function(x){return typeof x=="function"},m=function(x,k){return n(x)?x(k):x},d=f.calcParentsWithoutChildren(F,A),E=function H(x,k,W,U){for(var et=k.length,z=0;z0){var q=void 0;q=W.getGraphManager().add(W.newGraph(),B),H(q,X,W,U)}}},p=function(x,k,W){for(var U=0,et=0,z=0;z0?l.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=U/et:n(v.idealEdgeLength)?l.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=50:l.DEFAULT_EDGE_LENGTH=c.DEFAULT_EDGE_LENGTH=v.idealEdgeLength,l.MIN_REPULSION_DIST=c.MIN_REPULSION_DIST=c.DEFAULT_EDGE_LENGTH/10,l.DEFAULT_RADIAL_SEPARATION=c.DEFAULT_EDGE_LENGTH)},R=function(x,k){k.fixedNodeConstraint&&(x.constraints.fixedNodeConstraint=k.fixedNodeConstraint),k.alignmentConstraint&&(x.constraints.alignmentConstraint=k.alignmentConstraint),k.relativePlacementConstraint&&(x.constraints.relativePlacementConstraint=k.relativePlacementConstraint)};v.nestingFactor!=null&&(l.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=c.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=v.nestingFactor),v.gravity!=null&&(l.DEFAULT_GRAVITY_STRENGTH=c.DEFAULT_GRAVITY_STRENGTH=v.gravity),v.numIter!=null&&(l.MAX_ITERATIONS=c.MAX_ITERATIONS=v.numIter),v.gravityRange!=null&&(l.DEFAULT_GRAVITY_RANGE_FACTOR=c.DEFAULT_GRAVITY_RANGE_FACTOR=v.gravityRange),v.gravityCompound!=null&&(l.DEFAULT_COMPOUND_GRAVITY_STRENGTH=c.DEFAULT_COMPOUND_GRAVITY_STRENGTH=v.gravityCompound),v.gravityRangeCompound!=null&&(l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=c.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=v.gravityRangeCompound),v.initialEnergyOnIncremental!=null&&(l.DEFAULT_COOLING_FACTOR_INCREMENTAL=c.DEFAULT_COOLING_FACTOR_INCREMENTAL=v.initialEnergyOnIncremental),v.tilingCompareBy!=null&&(l.TILING_COMPARE_BY=v.tilingCompareBy),v.quality=="proof"?o.QUALITY=2:o.QUALITY=0,l.NODE_DIMENSIONS_INCLUDE_LABELS=c.NODE_DIMENSIONS_INCLUDE_LABELS=o.NODE_DIMENSIONS_INCLUDE_LABELS=v.nodeDimensionsIncludeLabels,l.DEFAULT_INCREMENTAL=c.DEFAULT_INCREMENTAL=o.DEFAULT_INCREMENTAL=!v.randomize,l.ANIMATE=c.ANIMATE=o.ANIMATE=v.animate,l.TILE=v.tile,l.TILING_PADDING_VERTICAL=typeof v.tilingPaddingVertical=="function"?v.tilingPaddingVertical.call():v.tilingPaddingVertical,l.TILING_PADDING_HORIZONTAL=typeof v.tilingPaddingHorizontal=="function"?v.tilingPaddingHorizontal.call():v.tilingPaddingHorizontal,l.DEFAULT_INCREMENTAL=c.DEFAULT_INCREMENTAL=o.DEFAULT_INCREMENTAL=!0,l.PURE_INCREMENTAL=!v.randomize,o.DEFAULT_UNIFORM_LEAF_NODE_SIZES=v.uniformNodeDimensions,v.step=="transformed"&&(l.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,l.ENFORCE_CONSTRAINTS=!1,l.APPLY_LAYOUT=!1),v.step=="enforced"&&(l.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,l.ENFORCE_CONSTRAINTS=!0,l.APPLY_LAYOUT=!1),v.step=="cose"&&(l.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,l.ENFORCE_CONSTRAINTS=!1,l.APPLY_LAYOUT=!0),v.step=="all"&&(v.randomize?l.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:l.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,l.ENFORCE_CONSTRAINTS=!0,l.APPLY_LAYOUT=!0),v.fixedNodeConstraint||v.alignmentConstraint||v.relativePlacementConstraint?l.TREE_REDUCTION_ON_INCREMENTAL=!1:l.TREE_REDUCTION_ON_INCREMENTAL=!0;var w=new a,I=w.newGraphManager();return E(I.addRoot(),f.getTopMostNodes(P),w,v),p(w,I,J),R(w,v),w.runLayout(),rt};i.exports={coseLayout:T}},212:(i,r,e)=>{var f=function(){function v(L,F){for(var A=0;A0)if(d){var R=t.getTopMostNodes(A.eles.nodes());if(D=t.connectComponents(P,A.eles,R),D.forEach(function(dt){var it=dt.boundingBox();rt.push({x:it.x1+it.w/2,y:it.y1+it.h/2})}),A.randomize&&D.forEach(function(dt){A.eles=dt,V.push(o(A))}),A.quality=="default"||A.quality=="proof"){var w=P.collection();if(A.tile){var I=new Map,H=[],x=[],k=0,W={nodeIndexes:I,xCoords:H,yCoords:x},U=[];if(D.forEach(function(dt,it){dt.edges().length==0&&(dt.nodes().forEach(function(ut,Tt){w.merge(dt.nodes()[Tt]),ut.isParent()||(W.nodeIndexes.set(dt.nodes()[Tt].id(),k++),W.xCoords.push(dt.nodes()[0].position().x),W.yCoords.push(dt.nodes()[0].position().y))}),U.push(it))}),w.length>1){var et=w.boundingBox();rt.push({x:et.x1+et.w/2,y:et.y1+et.h/2}),D.push(w),V.push(W);for(var z=U.length-1;z>=0;z--)D.splice(U[z],1),V.splice(U[z],1),rt.splice(U[z],1)}}D.forEach(function(dt,it){A.eles=dt,Q.push(l(A,V[it])),t.relocateComponent(rt[it],Q[it],A)})}else D.forEach(function(dt,it){t.relocateComponent(rt[it],V[it],A)});var O=new Set;if(D.length>1){var X=[],B=J.filter(function(dt){return dt.css("display")=="none"});D.forEach(function(dt,it){var ut=void 0;if(A.quality=="draft"&&(ut=V[it].nodeIndexes),dt.nodes().not(B).length>0){var Tt={};Tt.edges=[],Tt.nodes=[];var Ct=void 0;dt.nodes().not(B).forEach(function(Dt){if(A.quality=="draft")if(!Dt.isParent())Ct=ut.get(Dt.id()),Tt.nodes.push({x:V[it].xCoords[Ct]-Dt.boundingbox().w/2,y:V[it].yCoords[Ct]-Dt.boundingbox().h/2,width:Dt.boundingbox().w,height:Dt.boundingbox().h});else{var mt=t.calcBoundingBox(Dt,V[it].xCoords,V[it].yCoords,ut);Tt.nodes.push({x:mt.topLeftX,y:mt.topLeftY,width:mt.width,height:mt.height})}else Q[it][Dt.id()]&&Tt.nodes.push({x:Q[it][Dt.id()].getLeft(),y:Q[it][Dt.id()].getTop(),width:Q[it][Dt.id()].getWidth(),height:Q[it][Dt.id()].getHeight()})}),dt.edges().forEach(function(Dt){var mt=Dt.source(),xt=Dt.target();if(mt.css("display")!="none"&&xt.css("display")!="none")if(A.quality=="draft"){var St=ut.get(mt.id()),Vt=ut.get(xt.id()),Xt=[],Ut=[];if(mt.isParent()){var bt=t.calcBoundingBox(mt,V[it].xCoords,V[it].yCoords,ut);Xt.push(bt.topLeftX+bt.width/2),Xt.push(bt.topLeftY+bt.height/2)}else Xt.push(V[it].xCoords[St]),Xt.push(V[it].yCoords[St]);if(xt.isParent()){var Ht=t.calcBoundingBox(xt,V[it].xCoords,V[it].yCoords,ut);Ut.push(Ht.topLeftX+Ht.width/2),Ut.push(Ht.topLeftY+Ht.height/2)}else Ut.push(V[it].xCoords[Vt]),Ut.push(V[it].yCoords[Vt]);Tt.edges.push({startX:Xt[0],startY:Xt[1],endX:Ut[0],endY:Ut[1]})}else Q[it][mt.id()]&&Q[it][xt.id()]&&Tt.edges.push({startX:Q[it][mt.id()].getCenterX(),startY:Q[it][mt.id()].getCenterY(),endX:Q[it][xt.id()].getCenterX(),endY:Q[it][xt.id()].getCenterY()})}),Tt.nodes.length>0&&(X.push(Tt),O.add(it))}});var _=m.packComponents(X,A.randomize).shifts;if(A.quality=="draft")V.forEach(function(dt,it){var ut=dt.xCoords.map(function(Ct){return Ct+_[it].dx}),Tt=dt.yCoords.map(function(Ct){return Ct+_[it].dy});dt.xCoords=ut,dt.yCoords=Tt});else{var lt=0;O.forEach(function(dt){Object.keys(Q[dt]).forEach(function(it){var ut=Q[dt][it];ut.setCenter(ut.getCenterX()+_[lt].dx,ut.getCenterY()+_[lt].dy)}),lt++})}}}else{var E=A.eles.boundingBox();if(rt.push({x:E.x1+E.w/2,y:E.y1+E.h/2}),A.randomize){var p=o(A);V.push(p)}A.quality=="default"||A.quality=="proof"?(Q.push(l(A,V[0])),t.relocateComponent(rt[0],Q[0],A)):t.relocateComponent(rt[0],V[0],A)}var q=function(it,ut){if(A.quality=="default"||A.quality=="proof"){typeof it=="number"&&(it=ut);var Tt=void 0,Ct=void 0,Dt=it.data("id");return Q.forEach(function(xt){Dt in xt&&(Tt={x:xt[Dt].getRect().getCenterX(),y:xt[Dt].getRect().getCenterY()},Ct=xt[Dt])}),A.nodeDimensionsIncludeLabels&&(Ct.labelWidth&&(Ct.labelPosHorizontal=="left"?Tt.x+=Ct.labelWidth/2:Ct.labelPosHorizontal=="right"&&(Tt.x-=Ct.labelWidth/2)),Ct.labelHeight&&(Ct.labelPosVertical=="top"?Tt.y+=Ct.labelHeight/2:Ct.labelPosVertical=="bottom"&&(Tt.y-=Ct.labelHeight/2))),Tt==null&&(Tt={x:it.position("x"),y:it.position("y")}),{x:Tt.x,y:Tt.y}}else{var mt=void 0;return V.forEach(function(xt){var St=xt.nodeIndexes.get(it.id());St!=null&&(mt={x:xt.xCoords[St],y:xt.yCoords[St]})}),mt==null&&(mt={x:it.position("x"),y:it.position("y")}),{x:mt.x,y:mt.y}}};if(A.quality=="default"||A.quality=="proof"||A.randomize){var It=t.calcParentsWithoutChildren(P,J),Lt=J.filter(function(dt){return dt.css("display")=="none"});A.eles=J.not(Lt),J.nodes().not(":parent").not(Lt).layoutPositions(F,A,q),It.length>0&&It.forEach(function(dt){dt.position(q(dt))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),v}();i.exports=u},657:(i,r,e)=>{var f=e(548),a=e(140).layoutBase.Matrix,y=e(140).layoutBase.SVD,t=function(o){var c=o.cy,l=o.eles,T=l.nodes(),u=l.nodes(":parent"),v=new Map,L=new Map,F=new Map,A=[],P=[],J=[],V=[],Q=[],D=[],rt=[],n=[],m=void 0,d=1e8,E=1e-9,p=o.piTol,R=o.samplingType,w=o.nodeSeparation,I=void 0,H=function(){for(var b=0,$=0,K=!1;$=at;){ot=Z[at++];for(var Rt=A[ot],ft=0;ftvt&&(vt=Q[Mt],wt=Mt)}return wt},k=function(b){var $=void 0;if(b){$=Math.floor(Math.random()*m);for(var Z=0;Z=1)break;j=tt}for(var yt=0;yt=1)break;j=tt}for(var ft=0;ft0&&($.isParent()?A[b].push(F.get($.id())):A[b].push($.id()))})});var Lt=function(b){var $=L.get(b),K=void 0;v.get(b).forEach(function(Z){c.getElementById(Z).isParent()?K=F.get(Z):K=Z,A[$].push(K),A[L.get(K)].push(b)})},dt=!0,it=!1,ut=void 0;try{for(var Tt=v.keys()[Symbol.iterator](),Ct;!(dt=(Ct=Tt.next()).done);dt=!0){var Dt=Ct.value;Lt(Dt)}}catch(S){it=!0,ut=S}finally{try{!dt&&Tt.return&&Tt.return()}finally{if(it)throw ut}}m=L.size;var mt=void 0;if(m>2){I=m{var f=e(212),a=function(t){t&&t("layout","fcose",f)};typeof cytoscape<"u"&&a(cytoscape),i.exports=a},140:i=>{i.exports=C}},N={};function g(i){var r=N[i];if(r!==void 0)return r.exports;var e=N[i]={exports:{}};return G[i](e,e.exports,g),e.exports}var s=g(579);return s})()})})(be);var gr=be.exports;const ur=ke(gr);var xe={L:"left",R:"right",T:"top",B:"bottom"},Re={L:nt(M=>`${M},${M/2} 0,${M} 0,0`,"L"),R:nt(M=>`0,${M/2} ${M},0 ${M},${M}`,"R"),T:nt(M=>`0,0 ${M},0 ${M/2},${M}`,"T"),B:nt(M=>`${M/2},0 ${M},${M} 0,${M}`,"B")},he={L:nt((M,Y)=>M-Y+2,"L"),R:nt((M,Y)=>M-2,"R"),T:nt((M,Y)=>M-Y+2,"T"),B:nt((M,Y)=>M-2,"B")},vr=nt(function(M){return zt(M)?M==="L"?"R":"L":M==="T"?"B":"T"},"getOppositeArchitectureDirection"),Ie=nt(function(M){const Y=M;return Y==="L"||Y==="R"||Y==="T"||Y==="B"},"isArchitectureDirection"),zt=nt(function(M){const Y=M;return Y==="L"||Y==="R"},"isArchitectureDirectionX"),Qt=nt(function(M){const Y=M;return Y==="T"||Y==="B"},"isArchitectureDirectionY"),Pe=nt(function(M,Y){const C=zt(M)&&Qt(Y),G=Qt(M)&&zt(Y);return C||G},"isArchitectureDirectionXY"),dr=nt(function(M){const Y=M[0],C=M[1],G=zt(Y)&&Qt(C),N=Qt(Y)&&zt(C);return G||N},"isArchitecturePairXY"),pr=nt(function(M){return M!=="LL"&&M!=="RR"&&M!=="TT"&&M!=="BB"},"isValidArchitectureDirectionPair"),me=nt(function(M,Y){const C=`${M}${Y}`;return pr(C)?C:void 0},"getArchitectureDirectionPair"),yr=nt(function([M,Y],C){const G=C[0],N=C[1];return zt(G)?Qt(N)?[M+(G==="L"?-1:1),Y+(N==="T"?1:-1)]:[M+(G==="L"?-1:1),Y]:zt(N)?[M+(N==="L"?1:-1),Y+(G==="T"?1:-1)]:[M,Y+(G==="T"?1:-1)]},"shiftPositionByArchitectureDirectionPair"),Er=nt(function(M){return M==="LT"||M==="TL"?[1,1]:M==="BL"||M==="LB"?[1,-1]:M==="BR"||M==="RB"?[-1,-1]:[-1,1]},"getArchitectureDirectionXYFactors"),mr=nt(function(M){return M.type==="service"},"isArchitectureService"),Tr=nt(function(M){return M.type==="junction"},"isArchitectureJunction"),Ge=nt(M=>M.data(),"edgeData"),ne=nt(M=>M.data(),"nodeData"),Ue=qe.architecture,pt=new hr(()=>({nodes:{},groups:{},edges:[],registeredIds:{},config:Ue,dataStructures:void 0,elements:{}})),Nr=nt(()=>{pt.reset(),ar()},"clear"),Lr=nt(function({id:M,icon:Y,in:C,title:G,iconText:N}){if(pt.records.registeredIds[M]!==void 0)throw new Error(`The service id [${M}] is already in use by another ${pt.records.registeredIds[M]}`);if(C!==void 0){if(M===C)throw new Error(`The service [${M}] cannot be placed within itself`);if(pt.records.registeredIds[C]===void 0)throw new Error(`The service [${M}]'s parent does not exist. Please make sure the parent is created before this service`);if(pt.records.registeredIds[C]==="node")throw new Error(`The service [${M}]'s parent is not a group`)}pt.records.registeredIds[M]="node",pt.records.nodes[M]={id:M,type:"service",icon:Y,iconText:N,title:G,edges:[],in:C}},"addService"),Mr=nt(()=>Object.values(pt.records.nodes).filter(mr),"getServices"),Ar=nt(function({id:M,in:Y}){pt.records.registeredIds[M]="node",pt.records.nodes[M]={id:M,type:"junction",edges:[],in:Y}},"addJunction"),Cr=nt(()=>Object.values(pt.records.nodes).filter(Tr),"getJunctions"),wr=nt(()=>Object.values(pt.records.nodes),"getNodes"),Or=nt(M=>pt.records.nodes[M],"getNode"),Dr=nt(function({id:M,icon:Y,in:C,title:G}){if(pt.records.registeredIds[M]!==void 0)throw new Error(`The group id [${M}] is already in use by another ${pt.records.registeredIds[M]}`);if(C!==void 0){if(M===C)throw new Error(`The group [${M}] cannot be placed within itself`);if(pt.records.registeredIds[C]===void 0)throw new Error(`The group [${M}]'s parent does not exist. Please make sure the parent is created before this group`);if(pt.records.registeredIds[C]==="node")throw new Error(`The group [${M}]'s parent is not a group`)}pt.records.registeredIds[M]="group",pt.records.groups[M]={id:M,icon:Y,title:G,in:C}},"addGroup"),xr=nt(()=>Object.values(pt.records.groups),"getGroups"),Rr=nt(function({lhsId:M,rhsId:Y,lhsDir:C,rhsDir:G,lhsInto:N,rhsInto:g,lhsGroup:s,rhsGroup:i,title:r}){if(!Ie(C))throw new Error(`Invalid direction given for left hand side of edge ${M}--${Y}. Expected (L,R,T,B) got ${C}`);if(!Ie(G))throw new Error(`Invalid direction given for right hand side of edge ${M}--${Y}. Expected (L,R,T,B) got ${G}`);if(pt.records.nodes[M]===void 0&&pt.records.groups[M]===void 0)throw new Error(`The left-hand id [${M}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(pt.records.nodes[Y]===void 0&&pt.records.groups[M]===void 0)throw new Error(`The right-hand id [${Y}] does not yet exist. Please create the service/group before declaring an edge to it.`);const e=pt.records.nodes[M].in,f=pt.records.nodes[Y].in;if(s&&e&&f&&e==f)throw new Error(`The left-hand id [${M}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(i&&e&&f&&e==f)throw new Error(`The right-hand id [${Y}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);const a={lhsId:M,lhsDir:C,lhsInto:N,lhsGroup:s,rhsId:Y,rhsDir:G,rhsInto:g,rhsGroup:i,title:r};pt.records.edges.push(a),pt.records.nodes[M]&&pt.records.nodes[Y]&&(pt.records.nodes[M].edges.push(pt.records.edges[pt.records.edges.length-1]),pt.records.nodes[Y].edges.push(pt.records.edges[pt.records.edges.length-1]))},"addEdge"),Ir=nt(()=>pt.records.edges,"getEdges"),Sr=nt(()=>{if(pt.records.dataStructures===void 0){const M=Object.entries(pt.records.nodes).reduce((s,[i,r])=>(s[i]=r.edges.reduce((e,f)=>{if(f.lhsId===i){const a=me(f.lhsDir,f.rhsDir);a&&(e[a]=f.rhsId)}else{const a=me(f.rhsDir,f.lhsDir);a&&(e[a]=f.lhsId)}return e},{}),s),{}),Y=Object.keys(M)[0],C={[Y]:1},G=Object.keys(M).reduce((s,i)=>i===Y?s:{...s,[i]:1},{}),N=nt(s=>{const i={[s]:[0,0]},r=[s];for(;r.length>0;){const e=r.shift();if(e){C[e]=1,delete G[e];const f=M[e],[a,y]=i[e];Object.entries(f).forEach(([t,h])=>{C[h]||(i[h]=yr([a,y],t),r.push(h))})}}return i},"BFS"),g=[N(Y)];for(;Object.keys(G).length>0;)g.push(N(Object.keys(G)[0]));pt.records.dataStructures={adjList:M,spatialMaps:g}}return pt.records.dataStructures},"getDataStructures"),Fr=nt((M,Y)=>{pt.records.elements[M]=Y},"setElementForId"),br=nt(M=>pt.records.elements[M],"getElementById"),le={clear:Nr,setDiagramTitle:Ke,getDiagramTitle:je,setAccTitle:_e,getAccTitle:tr,setAccDescription:er,getAccDescription:rr,addService:Lr,getServices:Mr,addJunction:Ar,getJunctions:Cr,getNodes:wr,getNode:Or,addGroup:Dr,getGroups:xr,addEdge:Rr,getEdges:Ir,setElementForId:Fr,getElementById:br,getDataStructures:Sr};function Pt(M){const Y=fe().architecture;return Y!=null&&Y[M]?Y[M]:Ue[M]}nt(Pt,"getConfigField");var Pr=nt((M,Y)=>{sr(M,Y),M.groups.map(Y.addGroup),M.services.map(C=>Y.addService({...C,type:"service"})),M.junctions.map(C=>Y.addJunction({...C,type:"junction"})),M.edges.map(Y.addEdge)},"populateDb"),Gr={parse:nt(async M=>{const Y=await lr("architecture",M);Se.debug(Y),Pr(Y,le)},"parse")},Ur=nt(M=>` .edge { stroke-width: ${M.archEdgeWidth}; stroke: ${M.archEdgeColor}; fill: none; } .arrow { fill: ${M.archEdgeArrowColor}; } .node-bkg { fill: none; stroke: ${M.archGroupBorderColor}; stroke-width: ${M.archGroupBorderWidth}; stroke-dasharray: 8; } .node-icon-text { display: flex; align-items: center; } .node-icon-text > div { color: #fff; margin: 1px; height: fit-content; text-align: center; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; } `,"getStyles"),Yr=Ur,ae=nt(M=>`${M}`,"wrapIcon"),oe={prefix:"mermaid-architecture",height:80,width:80,icons:{database:{body:ae('')},server:{body:ae('')},disk:{body:ae('')},internet:{body:ae('')},cloud:{body:ae('')},unknown:Je,blank:{body:ae("")}}},Xr=nt(async function(M,Y){const C=Pt("padding"),G=Pt("iconSize"),N=G/2,g=G/6,s=g/2;await Promise.all(Y.edges().map(async i=>{var P,J;const{source:r,sourceDir:e,sourceArrow:f,sourceGroup:a,target:y,targetDir:t,targetArrow:h,targetGroup:o,label:c}=Ge(i);let{x:l,y:T}=i[0].sourceEndpoint();const{x:u,y:v}=i[0].midpoint();let{x:L,y:F}=i[0].targetEndpoint();const A=C+4;if(a&&(zt(e)?l+=e==="L"?-A:A:T+=e==="T"?-A:A+18),o&&(zt(t)?L+=t==="L"?-A:A:F+=t==="T"?-A:A+18),!a&&((P=le.getNode(r))==null?void 0:P.type)==="junction"&&(zt(e)?l+=e==="L"?N:-N:T+=e==="T"?N:-N),!o&&((J=le.getNode(y))==null?void 0:J.type)==="junction"&&(zt(t)?L+=t==="L"?N:-N:F+=t==="T"?N:-N),i[0]._private.rscratch){const V=M.insert("g");if(V.insert("path").attr("d",`M ${l},${T} L ${u},${v} L${L},${F} `).attr("class","edge"),f){const Q=zt(e)?he[e](l,g):l-s,D=Qt(e)?he[e](T,g):T-s;V.insert("polygon").attr("points",Re[e](g)).attr("transform",`translate(${Q},${D})`).attr("class","arrow")}if(h){const Q=zt(t)?he[t](L,g):L-s,D=Qt(t)?he[t](F,g):F-s;V.insert("polygon").attr("points",Re[t](g)).attr("transform",`translate(${Q},${D})`).attr("class","arrow")}if(c){const Q=Pe(e,t)?"XY":zt(e)?"X":"Y";let D=0;Q==="X"?D=Math.abs(l-L):Q==="Y"?D=Math.abs(T-F)/1.5:D=Math.abs(l-L)/2;const rt=V.append("g");if(await Ne(rt,c,{useHtmlLabels:!1,width:D,classes:"architecture-service-label"},fe()),rt.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),Q==="X")rt.attr("transform","translate("+u+", "+v+")");else if(Q==="Y")rt.attr("transform","translate("+u+", "+v+") rotate(-90)");else if(Q==="XY"){const n=me(e,t);if(n&&dr(n)){const m=rt.node().getBoundingClientRect(),[d,E]=Er(n);rt.attr("dominant-baseline","auto").attr("transform",`rotate(${-1*d*E*45})`);const p=rt.node().getBoundingClientRect();rt.attr("transform",` translate(${u}, ${v-m.height/2}) translate(${d*p.width/2}, ${E*p.height/2}) rotate(${-1*d*E*45}, 0, ${m.height/2}) `)}}}}}))},"drawEdges"),Hr=nt(async function(M,Y){const G=Pt("padding")*.75,N=Pt("fontSize"),s=Pt("iconSize")/2;await Promise.all(Y.nodes().map(async i=>{const r=ne(i);if(r.type==="group"){const{h:e,w:f,x1:a,y1:y}=i.boundingBox();M.append("rect").attr("x",a+s).attr("y",y+s).attr("width",f).attr("height",e).attr("class","node-bkg");const t=M.append("g");let h=a,o=y;if(r.icon){const c=t.append("g");c.html(`${await Ee(r.icon,{height:G,width:G,fallbackPrefix:oe.prefix})}`),c.attr("transform","translate("+(h+s+1)+", "+(o+s+1)+")"),h+=G,o+=N/2-1-2}if(r.label){const c=t.append("g");await Ne(c,r.label,{useHtmlLabels:!1,width:f,classes:"architecture-service-label"},fe()),c.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","start").attr("text-anchor","start"),c.attr("transform","translate("+(h+s+4)+", "+(o+s+2)+")")}}}))},"drawGroups"),Wr=nt(async function(M,Y,C){for(const G of C){const N=Y.append("g"),g=Pt("iconSize");if(G.title){const e=N.append("g");await Ne(e,G.title,{useHtmlLabels:!1,width:g*1.5,classes:"architecture-service-label"},fe()),e.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),e.attr("transform","translate("+g/2+", "+g+")")}const s=N.append("g");if(G.icon)s.html(`${await Ee(G.icon,{height:g,width:g,fallbackPrefix:oe.prefix})}`);else if(G.iconText){s.html(`${await Ee("blank",{height:g,width:g,fallbackPrefix:oe.prefix})}`);const a=s.append("g").append("foreignObject").attr("width",g).attr("height",g).append("div").attr("class","node-icon-text").attr("style",`height: ${g}px;`).append("div").html(G.iconText),y=parseInt(window.getComputedStyle(a.node(),null).getPropertyValue("font-size").replace(/\D/g,""))??16;a.attr("style",`-webkit-line-clamp: ${Math.floor((g-2)/y)};`)}else s.append("path").attr("class","node-bkg").attr("id","node-"+G.id).attr("d",`M0 ${g} v${-g} q0,-5 5,-5 h${g} q5,0 5,5 v${g} H0 Z`);N.attr("class","architecture-service");const{width:i,height:r}=N._groups[0][0].getBBox();G.width=i,G.height=r,M.setElementForId(G.id,N)}return 0},"drawServices"),Vr=nt(function(M,Y,C){C.forEach(G=>{const N=Y.append("g"),g=Pt("iconSize");N.append("g").append("rect").attr("id","node-"+G.id).attr("fill-opacity","0").attr("width",g).attr("height",g),N.attr("class","architecture-junction");const{width:i,height:r}=N._groups[0][0].getBBox();N.width=i,N.height=r,M.setElementForId(G.id,N)})},"drawJunctions");Qe([{name:oe.prefix,icons:oe}]);Fe.use(ur);function Ye(M,Y){M.forEach(C=>{Y.add({group:"nodes",data:{type:"service",id:C.id,icon:C.icon,label:C.title,parent:C.in,width:Pt("iconSize"),height:Pt("iconSize")},classes:"node-service"})})}nt(Ye,"addServices");function Xe(M,Y){M.forEach(C=>{Y.add({group:"nodes",data:{type:"junction",id:C.id,parent:C.in,width:Pt("iconSize"),height:Pt("iconSize")},classes:"node-junction"})})}nt(Xe,"addJunctions");function He(M,Y){Y.nodes().map(C=>{const G=ne(C);if(G.type==="group")return;G.x=C.position().x,G.y=C.position().y,M.getElementById(G.id).attr("transform","translate("+(G.x||0)+","+(G.y||0)+")")})}nt(He,"positionNodes");function We(M,Y){M.forEach(C=>{Y.add({group:"nodes",data:{type:"group",id:C.id,icon:C.icon,label:C.title,parent:C.in},classes:"node-group"})})}nt(We,"addGroups");function Ve(M,Y){M.forEach(C=>{const{lhsId:G,rhsId:N,lhsInto:g,lhsGroup:s,rhsInto:i,lhsDir:r,rhsDir:e,rhsGroup:f,title:a}=C,y=Pe(C.lhsDir,C.rhsDir)?"segments":"straight",t={id:`${G}-${N}`,label:a,source:G,sourceDir:r,sourceArrow:g,sourceGroup:s,sourceEndpoint:r==="L"?"0 50%":r==="R"?"100% 50%":r==="T"?"50% 0":"50% 100%",target:N,targetDir:e,targetArrow:i,targetGroup:f,targetEndpoint:e==="L"?"0 50%":e==="R"?"100% 50%":e==="T"?"50% 0":"50% 100%"};Y.add({group:"edges",data:t,classes:y})})}nt(Ve,"addEdges");function ze(M){const Y=M.map(N=>{const g={},s={};return Object.entries(N).forEach(([i,[r,e]])=>{g[e]||(g[e]=[]),s[r]||(s[r]=[]),g[e].push(i),s[r].push(i)}),{horiz:Object.values(g).filter(i=>i.length>1),vert:Object.values(s).filter(i=>i.length>1)}}),[C,G]=Y.reduce(([N,g],{horiz:s,vert:i})=>[[...N,...s],[...g,...i]],[[],[]]);return{horizontal:C,vertical:G}}nt(ze,"getAlignments");function Be(M){const Y=[],C=nt(N=>`${N[0]},${N[1]}`,"posToStr"),G=nt(N=>N.split(",").map(g=>parseInt(g)),"strToPos");return M.forEach(N=>{const g=Object.fromEntries(Object.entries(N).map(([e,f])=>[C(f),e])),s=[C([0,0])],i={},r={L:[-1,0],R:[1,0],T:[0,1],B:[0,-1]};for(;s.length>0;){const e=s.shift();if(e){i[e]=1;const f=g[e];if(f){const a=G(e);Object.entries(r).forEach(([y,t])=>{const h=C([a[0]+t[0],a[1]+t[1]]),o=g[h];o&&!i[h]&&(s.push(h),Y.push({[xe[y]]:o,[xe[vr(y)]]:f,gap:1.5*Pt("iconSize")}))})}}}}),Y}nt(Be,"getRelativeConstraints");function $e(M,Y,C,G,{spatialMaps:N}){return new Promise(g=>{const s=ir("body").append("div").attr("id","cy").attr("style","display:none"),i=Fe({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":`${Pt("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:`${Pt("padding")}px`}}]});s.remove(),We(C,i),Ye(M,i),Xe(Y,i),Ve(G,i);const r=ze(N),e=Be(N),f=i.layout({name:"fcose",quality:"proof",styleEnabled:!1,animate:!1,nodeDimensionsIncludeLabels:!1,idealEdgeLength(a){const[y,t]=a.connectedNodes(),{parent:h}=ne(y),{parent:o}=ne(t);return h===o?1.5*Pt("iconSize"):.5*Pt("iconSize")},edgeElasticity(a){const[y,t]=a.connectedNodes(),{parent:h}=ne(y),{parent:o}=ne(t);return h===o?.45:.001},alignmentConstraint:r,relativePlacementConstraint:e});f.one("layoutstop",()=>{var y;function a(t,h,o,c){let l,T;const{x:u,y:v}=t,{x:L,y:F}=h;T=(c-v+(u-o)*(v-F)/(u-L))/Math.sqrt(1+Math.pow((v-F)/(u-L),2)),l=Math.sqrt(Math.pow(c-v,2)+Math.pow(o-u,2)-Math.pow(T,2));const A=Math.sqrt(Math.pow(L-u,2)+Math.pow(F-v,2));l=l/A;let P=(L-u)*(c-v)-(F-v)*(o-u);switch(!0){case P>=0:P=1;break;case P<0:P=-1;break}let J=(L-u)*(o-u)+(F-v)*(c-v);switch(!0){case J>=0:J=1;break;case J<0:J=-1;break}return T=Math.abs(T)*P,l=l*J,{distances:T,weights:l}}nt(a,"getSegmentWeights"),i.startBatch();for(const t of Object.values(i.edges()))if((y=t.data)!=null&&y.call(t)){const{x:h,y:o}=t.source().position(),{x:c,y:l}=t.target().position();if(h!==c&&o!==l){const T=t.sourceEndpoint(),u=t.targetEndpoint(),{sourceDir:v}=Ge(t),[L,F]=Qt(v)?[T.x,u.y]:[u.x,T.y],{weights:A,distances:P}=a(T,u,L,F);t.style("segment-distances",P),t.style("segment-weights",A)}}i.endBatch(),f.run()}),f.run(),i.ready(a=>{Se.info("Ready",a),g(i)})})}nt($e,"layoutArchitecture");var zr=nt(async(M,Y,C,G)=>{const N=G.db,g=N.getServices(),s=N.getJunctions(),i=N.getGroups(),r=N.getEdges(),e=N.getDataStructures(),f=nr(Y),a=f.append("g");a.attr("class","architecture-edges");const y=f.append("g");y.attr("class","architecture-services");const t=f.append("g");t.attr("class","architecture-groups"),await Wr(N,y,g),Vr(N,y,s);const h=await $e(g,s,i,r,e);await Xr(a,h),await Hr(t,h),He(N,h),or(void 0,f,Pt("padding"),Pt("useMaxWidth"))},"draw"),Br={draw:zr},jr={parser:Gr,db:le,renderer:Br,styles:Yr};export{jr as diagram};