All Downloads are FREE. Search and download functionalities are using the official Maven repository.

package.dist.chunks.mermaid.esm.min.architectureDiagram-O7I6HS7E.mjs Maven / Gradle / Ivy

Go to download

Markdown-ish syntax for generating flowcharts, mindmaps, sequence diagrams, class diagrams, gantt charts, git graphs and more.

There is a newer version: 11.4.0
Show newest version
import{a as De}from"./chunk-VSJQYA62.mjs";import{a as je}from"./chunk-VSLJSFIP.mjs";import{a as Ke}from"./chunk-4KE642ED.mjs";import{a as Qe}from"./chunk-XIWCMPW2.mjs";import"./chunk-HJ3FXQNF.mjs";import"./chunk-6ZD6GYE6.mjs";import"./chunk-BARJOBEZ.mjs";import{a as Ue,b as Xe,c as de}from"./chunk-PM4C624V.mjs";import{a as _e}from"./chunk-GSFY7FJO.mjs";import{d as pe}from"./chunk-FVUI2UHO.mjs";import"./chunk-INOGIEW4.mjs";import"./chunk-TI4EEUUG.mjs";import{N as We,P as Ve,Q as ze,R as Be,S as $e,T as ke,U as Ze,V as Je,X as ae,b as ge,fa as qe,s as He}from"./chunk-DMXVZUOD.mjs";import"./chunk-ZR7IV3AY.mjs";import"./chunk-DML4XSUC.mjs";import"./chunk-MHJHRR6Z.mjs";import"./chunk-BKDDFIKN.mjs";import"./chunk-YPUTD6PB.mjs";import"./chunk-6BY5RJGC.mjs";import{a as L,b as Le,e as yr}from"./chunk-GTKDMUJJ.mjs";var Oe=Le((le,xe)=>{"use strict";L(function(w,N){typeof le=="object"&&typeof xe=="object"?xe.exports=N():typeof define=="function"&&define.amd?define([],N):typeof le=="object"?le.layoutBase=N():w.layoutBase=N()},"webpackUniversalModuleDefinition")(le,function(){return function(E){var w={};function N(u){if(w[u])return w[u].exports;var o=w[u]={i:u,l:!1,exports:{}};return E[u].call(o.exports,o,o.exports,N),o.l=!0,o.exports}return L(N,"__webpack_require__"),N.m=E,N.c=w,N.i=function(u){return u},N.d=function(u,o,a){N.o(u,o)||Object.defineProperty(u,o,{configurable:!1,enumerable:!0,get:a})},N.n=function(u){var o=u&&u.__esModule?L(function(){return u.default},"getDefault"):L(function(){return u},"getModuleExports");return N.d(o,"a",o),o},N.o=function(u,o){return Object.prototype.hasOwnProperty.call(u,o)},N.p="",N(N.s=28)}([function(E,w,N){"use strict";function u(){}L(u,"LayoutConstants"),u.QUALITY=1,u.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,u.DEFAULT_INCREMENTAL=!1,u.DEFAULT_ANIMATION_ON_LAYOUT=!0,u.DEFAULT_ANIMATION_DURING_LAYOUT=!1,u.DEFAULT_ANIMATION_PERIOD=50,u.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,u.DEFAULT_GRAPH_MARGIN=15,u.NODE_DIMENSIONS_INCLUDE_LABELS=!1,u.SIMPLE_NODE_SIZE=40,u.SIMPLE_NODE_HALF_SIZE=u.SIMPLE_NODE_SIZE/2,u.EMPTY_COMPOUND_NODE_SIZE=40,u.MIN_EDGE_LENGTH=1,u.WORLD_BOUNDARY=1e6,u.INITIAL_WORLD_BOUNDARY=u.WORLD_BOUNDARY/1e3,u.WORLD_CENTER_X=1200,u.WORLD_CENTER_Y=900,E.exports=u},function(E,w,N){"use strict";var u=N(2),o=N(8),a=N(9);function t(c,e,p){u.call(this,p),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=p,this.bendpoints=[],this.source=c,this.target=e}L(t,"LEdge"),t.prototype=Object.create(u.prototype);for(var n in u)t[n]=u[n];t.prototype.getSource=function(){return this.source},t.prototype.getTarget=function(){return this.target},t.prototype.isInterGraph=function(){return this.isInterGraph},t.prototype.getLength=function(){return this.length},t.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},t.prototype.getBendpoints=function(){return this.bendpoints},t.prototype.getLca=function(){return this.lca},t.prototype.getSourceInLca=function(){return this.sourceInLca},t.prototype.getTargetInLca=function(){return this.targetInLca},t.prototype.getOtherEnd=function(c){if(this.source===c)return this.target;if(this.target===c)return this.source;throw"Node is not incident with this edge"},t.prototype.getOtherEndInGraph=function(c,e){for(var p=this.getOtherEnd(c),i=e.getGraphManager().getRoot();;){if(p.getOwner()==e)return p;if(p.getOwner()==i)break;p=p.getOwner().getParent()}return null},t.prototype.updateLength=function(){var c=new Array(4);this.isOverlapingSourceAndTarget=o.getIntersection(this.target.getRect(),this.source.getRect(),c),this.isOverlapingSourceAndTarget||(this.lengthX=c[0]-c[2],this.lengthY=c[1]-c[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))},t.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)},E.exports=t},function(E,w,N){"use strict";function u(o){this.vGraphObject=o}L(u,"LGraphObject"),E.exports=u},function(E,w,N){"use strict";var u=N(2),o=N(10),a=N(13),t=N(0),n=N(16),c=N(5);function e(i,r,h,f){h==null&&f==null&&(f=r),u.call(this,f),i.graphManager!=null&&(i=i.graphManager),this.estimatedSize=o.MIN_VALUE,this.inclusionTreeDepth=o.MAX_VALUE,this.vGraphObject=f,this.edges=[],this.graphManager=i,h!=null&&r!=null?this.rect=new a(r.x,r.y,h.width,h.height):this.rect=new a}L(e,"LNode"),e.prototype=Object.create(u.prototype);for(var p in u)e[p]=u[p];e.prototype.getEdges=function(){return this.edges},e.prototype.getChild=function(){return this.child},e.prototype.getOwner=function(){return this.owner},e.prototype.getWidth=function(){return this.rect.width},e.prototype.setWidth=function(i){this.rect.width=i},e.prototype.getHeight=function(){return this.rect.height},e.prototype.setHeight=function(i){this.rect.height=i},e.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},e.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},e.prototype.getCenter=function(){return new c(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},e.prototype.getLocation=function(){return new c(this.rect.x,this.rect.y)},e.prototype.getRect=function(){return this.rect},e.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},e.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},e.prototype.setRect=function(i,r){this.rect.x=i.x,this.rect.y=i.y,this.rect.width=r.width,this.rect.height=r.height},e.prototype.setCenter=function(i,r){this.rect.x=i-this.rect.width/2,this.rect.y=r-this.rect.height/2},e.prototype.setLocation=function(i,r){this.rect.x=i,this.rect.y=r},e.prototype.moveBy=function(i,r){this.rect.x+=i,this.rect.y+=r},e.prototype.getEdgeListToNode=function(i){var r=[],h,f=this;return f.edges.forEach(function(l){if(l.target==i){if(l.source!=f)throw"Incorrect edge source!";r.push(l)}}),r},e.prototype.getEdgesBetween=function(i){var r=[],h,f=this;return f.edges.forEach(function(l){if(!(l.source==f||l.target==f))throw"Incorrect edge source and/or target";(l.target==i||l.source==i)&&r.push(l)}),r},e.prototype.getNeighborsList=function(){var i=new Set,r=this;return r.edges.forEach(function(h){if(h.source==r)i.add(h.target);else{if(h.target!=r)throw"Incorrect incidency!";i.add(h.source)}}),i},e.prototype.withChildren=function(){var i=new Set,r,h;if(i.add(this),this.child!=null)for(var f=this.child.getNodes(),l=0;lr?(this.rect.x-=(this.labelWidth-r)/2,this.setWidth(this.labelWidth)):this.labelPosHorizontal=="right"&&this.setWidth(r+this.labelWidth)),this.labelHeight&&(this.labelPosVertical=="top"?(this.rect.y-=this.labelHeight,this.setHeight(h+this.labelHeight)):this.labelPosVertical=="center"&&this.labelHeight>h?(this.rect.y-=(this.labelHeight-h)/2,this.setHeight(this.labelHeight)):this.labelPosVertical=="bottom"&&this.setHeight(h+this.labelHeight))}}},e.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==o.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},e.prototype.transform=function(i){var r=this.rect.x;r>t.WORLD_BOUNDARY?r=t.WORLD_BOUNDARY:r<-t.WORLD_BOUNDARY&&(r=-t.WORLD_BOUNDARY);var h=this.rect.y;h>t.WORLD_BOUNDARY?h=t.WORLD_BOUNDARY:h<-t.WORLD_BOUNDARY&&(h=-t.WORLD_BOUNDARY);var f=new c(r,h),l=i.inverseTransformPoint(f);this.setLocation(l.x,l.y)},e.prototype.getLeft=function(){return this.rect.x},e.prototype.getRight=function(){return this.rect.x+this.rect.width},e.prototype.getTop=function(){return this.rect.y},e.prototype.getBottom=function(){return this.rect.y+this.rect.height},e.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},E.exports=e},function(E,w,N){"use strict";var u=N(0);function o(){}L(o,"FDLayoutConstants");for(var a in u)o[a]=u[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=o.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,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,E.exports=o},function(E,w,N){"use strict";function u(o,a){o==null&&a==null?(this.x=0,this.y=0):(this.x=o,this.y=a)}L(u,"PointD"),u.prototype.getX=function(){return this.x},u.prototype.getY=function(){return this.y},u.prototype.setX=function(o){this.x=o},u.prototype.setY=function(o){this.y=o},u.prototype.getDifference=function(o){return new DimensionD(this.x-o.x,this.y-o.y)},u.prototype.getCopy=function(){return new u(this.x,this.y)},u.prototype.translate=function(o){return this.x+=o.width,this.y+=o.height,this},E.exports=u},function(E,w,N){"use strict";var u=N(2),o=N(10),a=N(0),t=N(7),n=N(3),c=N(1),e=N(13),p=N(12),i=N(11);function r(f,l,A){u.call(this,A),this.estimatedSize=o.MIN_VALUE,this.margin=a.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=f,l!=null&&l instanceof t?this.graphManager=l:l!=null&&l instanceof Layout&&(this.graphManager=l.graphManager)}L(r,"LGraph"),r.prototype=Object.create(u.prototype);for(var h in u)r[h]=u[h];r.prototype.getNodes=function(){return this.nodes},r.prototype.getEdges=function(){return this.edges},r.prototype.getGraphManager=function(){return this.graphManager},r.prototype.getParent=function(){return this.parent},r.prototype.getLeft=function(){return this.left},r.prototype.getRight=function(){return this.right},r.prototype.getTop=function(){return this.top},r.prototype.getBottom=function(){return this.bottom},r.prototype.isConnected=function(){return this.isConnected},r.prototype.add=function(f,l,A){if(l==null&&A==null){var v=f;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(v)>-1)throw"Node already in graph!";return v.owner=this,this.getNodes().push(v),v}else{var y=f;if(!(this.getNodes().indexOf(l)>-1&&this.getNodes().indexOf(A)>-1))throw"Source or target not in graph!";if(!(l.owner==A.owner&&l.owner==this))throw"Both owners must be this graph!";return l.owner!=A.owner?null:(y.source=l,y.target=A,y.isInterGraph=!1,this.getEdges().push(y),l.edges.push(y),A!=l&&A.edges.push(y),y)}},r.prototype.remove=function(f){var l=f;if(f instanceof n){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 A=l.edges.slice(),v,y=A.length,D=0;D-1&&G>-1))throw"Source and/or target doesn't know this edge!";v.source.edges.splice(C,1),v.target!=v.source&&v.target.edges.splice(G,1);var F=v.source.owner.getEdges().indexOf(v);if(F==-1)throw"Not in owner's edge list!";v.source.owner.getEdges().splice(F,1)}},r.prototype.updateLeftTop=function(){for(var f=o.MAX_VALUE,l=o.MAX_VALUE,A,v,y,D=this.getNodes(),F=D.length,C=0;CA&&(f=A),l>v&&(l=v)}return f==o.MAX_VALUE?null:(D[0].getParent().paddingLeft!=null?y=D[0].getParent().paddingLeft:y=this.margin,this.left=l-y,this.top=f-y,new p(this.left,this.top))},r.prototype.updateBounds=function(f){for(var l=o.MAX_VALUE,A=-o.MAX_VALUE,v=o.MAX_VALUE,y=-o.MAX_VALUE,D,F,C,G,z,X=this.nodes,rt=X.length,I=0;ID&&(l=D),AC&&(v=C),yD&&(l=D),AC&&(v=C),y=this.nodes.length){var rt=0;A.forEach(function(I){I.owner==f&&rt++}),rt==this.nodes.length&&(this.isConnected=!0)}},E.exports=r},function(E,w,N){"use strict";var u,o=N(1);function a(t){u=N(6),this.layout=t,this.graphs=[],this.edges=[]}L(a,"LGraphManager"),a.prototype.addRoot=function(){var t=this.layout.newGraph(),n=this.layout.newNode(null),c=this.add(t,n);return this.setRootGraph(c),this.rootGraph},a.prototype.add=function(t,n,c,e,p){if(c==null&&e==null&&p==null){if(t==null)throw"Graph is null!";if(n==null)throw"Parent node is null!";if(this.graphs.indexOf(t)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(t),t.parent!=null)throw"Already has a parent!";if(n.child!=null)throw"Already has a child!";return t.parent=n,n.child=t,t}else{p=c,e=n,c=t;var i=e.getOwner(),r=p.getOwner();if(!(i!=null&&i.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(r!=null&&r.getGraphManager()==this))throw"Target not in this graph mgr!";if(i==r)return c.isInterGraph=!1,i.add(c,e,p);if(c.isInterGraph=!0,c.source=e,c.target=p,this.edges.indexOf(c)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(c),!(c.source!=null&&c.target!=null))throw"Edge source and/or target is null!";if(!(c.source.edges.indexOf(c)==-1&&c.target.edges.indexOf(c)==-1))throw"Edge already in source and/or target incidency list!";return c.source.edges.push(c),c.target.edges.push(c),c}},a.prototype.remove=function(t){if(t instanceof u){var n=t;if(n.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(n==this.rootGraph||n.parent!=null&&n.parent.graphManager==this))throw"Invalid parent node!";var c=[];c=c.concat(n.getEdges());for(var e,p=c.length,i=0;i=t.getRight()?n[0]+=Math.min(t.getX()-a.getX(),a.getRight()-t.getRight()):t.getX()<=a.getX()&&t.getRight()>=a.getRight()&&(n[0]+=Math.min(a.getX()-t.getX(),t.getRight()-a.getRight())),a.getY()<=t.getY()&&a.getBottom()>=t.getBottom()?n[1]+=Math.min(t.getY()-a.getY(),a.getBottom()-t.getBottom()):t.getY()<=a.getY()&&t.getBottom()>=a.getBottom()&&(n[1]+=Math.min(a.getY()-t.getY(),t.getBottom()-a.getBottom()));var p=Math.abs((t.getCenterY()-a.getCenterY())/(t.getCenterX()-a.getCenterX()));t.getCenterY()===a.getCenterY()&&t.getCenterX()===a.getCenterX()&&(p=1);var i=p*n[0],r=n[1]/p;n[0]i)return n[0]=c,n[1]=h,n[2]=p,n[3]=X,!1;if(ep)return n[0]=r,n[1]=e,n[2]=G,n[3]=i,!1;if(cp?(n[0]=l,n[1]=A,s=!0):(n[0]=f,n[1]=h,s=!0):g===d&&(c>p?(n[0]=r,n[1]=h,s=!0):(n[0]=v,n[1]=A,s=!0)),-T===d?p>c?(n[2]=z,n[3]=X,m=!0):(n[2]=G,n[3]=C,m=!0):T===d&&(p>c?(n[2]=F,n[3]=C,m=!0):(n[2]=rt,n[3]=X,m=!0)),s&&m)return!1;if(c>p?e>i?(O=this.getCardinalDirection(g,d,4),x=this.getCardinalDirection(T,d,2)):(O=this.getCardinalDirection(-g,d,3),x=this.getCardinalDirection(-T,d,1)):e>i?(O=this.getCardinalDirection(-g,d,1),x=this.getCardinalDirection(-T,d,3)):(O=this.getCardinalDirection(g,d,2),x=this.getCardinalDirection(T,d,4)),!s)switch(O){case 1:S=h,P=c+-D/d,n[0]=P,n[1]=S;break;case 2:P=v,S=e+y*d,n[0]=P,n[1]=S;break;case 3:S=A,P=c+D/d,n[0]=P,n[1]=S;break;case 4:P=l,S=e+-y*d,n[0]=P,n[1]=S;break}if(!m)switch(x){case 1:Z=C,R=p+-J/d,n[2]=R,n[3]=Z;break;case 2:R=rt,Z=i+I*d,n[2]=R,n[3]=Z;break;case 3:Z=X,R=p+J/d,n[2]=R,n[3]=Z;break;case 4:R=z,Z=i+-I*d,n[2]=R,n[3]=Z;break}}return!1},o.getCardinalDirection=function(a,t,n){return a>t?n:1+n%4},o.getIntersection=function(a,t,n,c){if(c==null)return this.getIntersection2(a,t,n);var e=a.x,p=a.y,i=t.x,r=t.y,h=n.x,f=n.y,l=c.x,A=c.y,v=void 0,y=void 0,D=void 0,F=void 0,C=void 0,G=void 0,z=void 0,X=void 0,rt=void 0;return D=r-p,C=e-i,z=i*p-e*r,F=A-f,G=h-l,X=l*f-h*A,rt=D*G-F*C,rt===0?null:(v=(C*X-G*z)/rt,y=(F*z-D*X)/rt,new u(v,y))},o.angleOfVector=function(a,t,n,c){var e=void 0;return a!==n?(e=Math.atan((c-t)/(n-a)),n=0){var A=(-h+Math.sqrt(h*h-4*r*f))/(2*r),v=(-h-Math.sqrt(h*h-4*r*f))/(2*r),y=null;return A>=0&&A<=1?[A]:v>=0&&v<=1?[v]:y}else 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,E.exports=o},function(E,w,N){"use strict";function u(){}L(u,"IMath"),u.sign=function(o){return o>0?1:o<0?-1:0},u.floor=function(o){return o<0?Math.ceil(o):Math.floor(o)},u.ceil=function(o){return o<0?Math.floor(o):Math.ceil(o)},E.exports=u},function(E,w,N){"use strict";function u(){}L(u,"Integer"),u.MAX_VALUE=2147483647,u.MIN_VALUE=-2147483648,E.exports=u},function(E,w,N){"use strict";var u=function(){function e(p,i){for(var r=0;r"u"?"undefined":u(a);return a==null||t!="object"&&t!="function"},E.exports=o},function(E,w,N){"use strict";function u(h){if(Array.isArray(h)){for(var f=0,l=Array(h.length);f0&&f;){for(D.push(C[0]);D.length>0&&f;){var G=D[0];D.splice(0,1),y.add(G);for(var z=G.getEdges(),v=0;v-1&&C.splice(J,1)}y=new Set,F=new Map}}return h},r.prototype.createDummyNodesForBendpoints=function(h){for(var f=[],l=h.source,A=this.graphManager.calcLowestCommonAncestor(h.source,h.target),v=0;v0){for(var A=this.edgeToDummyNodes.get(l),v=0;v=0&&f.splice(X,1);var rt=F.getNeighborsList();rt.forEach(function(s){if(l.indexOf(s)<0){var m=A.get(s),g=m-1;g==1&&G.push(s),A.set(s,g)}})}l=l.concat(G),(f.length==1||f.length==2)&&(v=!0,y=f[0])}return y},r.prototype.setGraphManager=function(h){this.graphManager=h},E.exports=r},function(E,w,N){"use strict";function u(){}L(u,"RandomSeed"),u.seed=1,u.x=0,u.nextDouble=function(){return u.x=Math.sin(u.seed++)*1e4,u.x-Math.floor(u.x)},E.exports=u},function(E,w,N){"use strict";var u=N(5);function o(a,t){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}L(o,"Transform"),o.prototype.getWorldOrgX=function(){return this.lworldOrgX},o.prototype.setWorldOrgX=function(a){this.lworldOrgX=a},o.prototype.getWorldOrgY=function(){return this.lworldOrgY},o.prototype.setWorldOrgY=function(a){this.lworldOrgY=a},o.prototype.getWorldExtX=function(){return this.lworldExtX},o.prototype.setWorldExtX=function(a){this.lworldExtX=a},o.prototype.getWorldExtY=function(){return this.lworldExtY},o.prototype.setWorldExtY=function(a){this.lworldExtY=a},o.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},o.prototype.setDeviceOrgX=function(a){this.ldeviceOrgX=a},o.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},o.prototype.setDeviceOrgY=function(a){this.ldeviceOrgY=a},o.prototype.getDeviceExtX=function(){return this.ldeviceExtX},o.prototype.setDeviceExtX=function(a){this.ldeviceExtX=a},o.prototype.getDeviceExtY=function(){return this.ldeviceExtY},o.prototype.setDeviceExtY=function(a){this.ldeviceExtY=a},o.prototype.transformX=function(a){var t=0,n=this.lworldExtX;return n!=0&&(t=this.ldeviceOrgX+(a-this.lworldOrgX)*this.ldeviceExtX/n),t},o.prototype.transformY=function(a){var t=0,n=this.lworldExtY;return n!=0&&(t=this.ldeviceOrgY+(a-this.lworldOrgY)*this.ldeviceExtY/n),t},o.prototype.inverseTransformX=function(a){var t=0,n=this.ldeviceExtX;return n!=0&&(t=this.lworldOrgX+(a-this.ldeviceOrgX)*this.lworldExtX/n),t},o.prototype.inverseTransformY=function(a){var t=0,n=this.ldeviceExtY;return n!=0&&(t=this.lworldOrgY+(a-this.ldeviceOrgY)*this.lworldExtY/n),t},o.prototype.inverseTransformPoint=function(a){var t=new u(this.inverseTransformX(a.x),this.inverseTransformY(a.y));return t},E.exports=o},function(E,w,N){"use strict";function u(i){if(Array.isArray(i)){for(var r=0,h=Array(i.length);ra.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*a.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(i-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):(i>a.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(a.COOLING_ADAPTATION_FACTOR,1-(i-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(this.getAllNodes().length*5,this.maxIterations),this.displacementThresholdPerNode=3*a.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},e.prototype.calcSpringForces=function(){for(var i=this.getAllEdges(),r,h=0;h0&&arguments[0]!==void 0?arguments[0]:!0,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,h,f,l,A,v=this.getAllNodes(),y;if(this.useFRGridVariant)for(this.totalIterations%a.GRID_CALCULATION_CHECK_PERIOD==1&&i&&this.updateGrid(),y=new Set,h=0;hD||y>D)&&(i.gravitationForceX=-this.gravityConstant*l,i.gravitationForceY=-this.gravityConstant*A)):(D=r.getEstimatedSize()*this.compoundGravityRangeFactor,(v>D||y>D)&&(i.gravitationForceX=-this.gravityConstant*l*this.compoundGravityConstant,i.gravitationForceY=-this.gravityConstant*A*this.compoundGravityConstant))},e.prototype.isConverged=function(){var i,r=!1;return this.totalIterations>this.maxIterations/3&&(r=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),i=this.totalDisplacement=v.length||D>=v[0].length)){for(var F=0;Fe},"_defaultCompareFunction")}]),n}();E.exports=t},function(E,w,N){"use strict";function u(){}L(u,"SVD"),u.svd=function(o){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=o.length,this.n=o[0].length;var a=Math.min(this.m,this.n);this.s=function(Ot){for(var Nt=[];Ot-- >0;)Nt.push(0);return Nt}(Math.min(this.m+1,this.n)),this.U=function(Ot){var Nt=L(function Zt(St){if(St.length==0)return 0;for(var Wt=[],$t=0;$t0;)Nt.push(0);return Nt}(this.n),n=function(Ot){for(var Nt=[];Ot-- >0;)Nt.push(0);return Nt}(this.m),c=!0,e=!0,p=Math.min(this.m-1,this.n),i=Math.max(0,Math.min(this.n-2,this.m)),r=0;r=0;d--)if(this.s[d]!==0){for(var O=d+1;O=0;b--){if(function(Ot,Nt){return Ot&&Nt}(b0;){var Q=void 0,Xt=void 0;for(Q=m-2;Q>=-1&&Q!==-1;Q--)if(Math.abs(t[Q])<=bt+Lt*(Math.abs(this.s[Q])+Math.abs(this.s[Q+1]))){t[Q]=0;break}if(Q===m-2)Xt=4;else{var wt=void 0;for(wt=m-1;wt>=Q&&wt!==Q;wt--){var ot=(wt!==m?Math.abs(t[wt]):0)+(wt!==Q+1?Math.abs(t[wt-1]):0);if(Math.abs(this.s[wt])<=bt+Lt*ot){this.s[wt]=0;break}}wt===Q?Xt=3:wt===m-1?Xt=1:(Xt=2,Q=wt)}switch(Q++,Xt){case 1:{var et=t[m-2];t[m-2]=0;for(var yt=m-2;yt>=Q;yt--){var Et=u.hypot(this.s[yt],et),Dt=this.s[yt]/Et,Tt=et/Et;if(this.s[yt]=Et,yt!==Q&&(et=-Tt*t[yt-1],t[yt-1]=Dt*t[yt-1]),e)for(var At=0;At=this.s[Q+1]);){var ct=this.s[Q];if(this.s[Q]=this.s[Q+1],this.s[Q+1]=ct,e&&QMath.abs(a)?(t=a/o,t=Math.abs(o)*Math.sqrt(1+t*t)):a!=0?(t=o/a,t=Math.abs(a)*Math.sqrt(1+t*t)):t=0,t},E.exports=u},function(E,w,N){"use strict";var u=function(){function t(n,c){for(var e=0;e2&&arguments[2]!==void 0?arguments[2]:1,p=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;o(this,t),this.sequence1=n,this.sequence2=c,this.match_score=e,this.mismatch_penalty=p,this.gap_penalty=i,this.iMax=n.length+1,this.jMax=c.length+1,this.grid=new Array(this.iMax);for(var r=0;r=0;n--){var c=this.listeners[n];c.event===a&&c.callback===t&&this.listeners.splice(n,1)}},o.emit=function(a,t){for(var n=0;n{"use strict";L(function(w,N){typeof ce=="object"&&typeof Re=="object"?Re.exports=N(Oe()):typeof define=="function"&&define.amd?define(["layout-base"],N):typeof ce=="object"?ce.coseBase=N(Oe()):w.coseBase=N(w.layoutBase)},"webpackUniversalModuleDefinition")(ce,function(E){return(()=>{"use strict";var w={45:(a,t,n)=>{var c={};c.layoutBase=n(551),c.CoSEConstants=n(806),c.CoSEEdge=n(767),c.CoSEGraph=n(880),c.CoSEGraphManager=n(578),c.CoSELayout=n(765),c.CoSENode=n(991),c.ConstraintHandler=n(902),a.exports=c},806:(a,t,n)=>{var c=n(551).FDLayoutConstants;function e(){}L(e,"CoSEConstants");for(var p in c)e[p]=c[p];e.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,e.DEFAULT_RADIAL_SEPARATION=c.DEFAULT_EDGE_LENGTH,e.DEFAULT_COMPONENT_SEPERATION=60,e.TILE=!0,e.TILING_PADDING_VERTICAL=10,e.TILING_PADDING_HORIZONTAL=10,e.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,e.ENFORCE_CONSTRAINTS=!0,e.APPLY_LAYOUT=!0,e.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,e.TREE_REDUCTION_ON_INCREMENTAL=!0,e.PURE_INCREMENTAL=e.DEFAULT_INCREMENTAL,a.exports=e},767:(a,t,n)=>{var c=n(551).FDLayoutEdge;function e(i,r,h){c.call(this,i,r,h)}L(e,"CoSEEdge"),e.prototype=Object.create(c.prototype);for(var p in c)e[p]=c[p];a.exports=e},880:(a,t,n)=>{var c=n(551).LGraph;function e(i,r,h){c.call(this,i,r,h)}L(e,"CoSEGraph"),e.prototype=Object.create(c.prototype);for(var p in c)e[p]=c[p];a.exports=e},578:(a,t,n)=>{var c=n(551).LGraphManager;function e(i){c.call(this,i)}L(e,"CoSEGraphManager"),e.prototype=Object.create(c.prototype);for(var p in c)e[p]=c[p];a.exports=e},765:(a,t,n)=>{var c=n(551).FDLayout,e=n(578),p=n(880),i=n(991),r=n(767),h=n(806),f=n(902),l=n(551).FDLayoutConstants,A=n(551).LayoutConstants,v=n(551).Point,y=n(551).PointD,D=n(551).DimensionD,F=n(551).Layout,C=n(551).Integer,G=n(551).IGeometry,z=n(551).LGraph,X=n(551).Transform,rt=n(551).LinkedList;function I(){c.call(this),this.toBeTiled={},this.constraints={}}L(I,"CoSELayout"),I.prototype=Object.create(c.prototype);for(var J in c)I[J]=c[J];I.prototype.newGraphManager=function(){var s=new e(this);return this.graphManager=s,s},I.prototype.newGraph=function(s){return new p(null,this.graphManager,s)},I.prototype.newNode=function(s){return new i(this.graphManager,s)},I.prototype.newEdge=function(s){return new r(null,null,s)},I.prototype.initParameters=function(){c.prototype.initParameters.call(this,arguments),this.isSubLayout||(h.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=h.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=h.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)},I.prototype.initSpringEmbedder=function(){c.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/l.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},I.prototype.layout=function(){var s=A.DEFAULT_CREATE_BENDS_AS_NEEDED;return s&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},I.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(h.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var m=new Set(this.getAllNodes()),g=this.nodesWithGravity.filter(function(O){return m.has(O)});this.graphManager.setAllNodesToApplyGravitation(g)}}else{var s=this.getFlatForest();if(s.length>0)this.positionNodesRadially(s);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var m=new Set(this.getAllNodes()),g=this.nodesWithGravity.filter(function(T){return m.has(T)});this.graphManager.setAllNodesToApplyGravitation(g),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(f.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),h.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},I.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 s=new Set(this.getAllNodes()),m=this.nodesWithGravity.filter(function(d){return s.has(d)});this.graphManager.setAllNodesToApplyGravitation(m),this.graphManager.updateBounds(),this.updateGrid(),h.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()),h.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 g=!this.isTreeGrowing&&!this.isGrowthFinished,T=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(g,T),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},I.prototype.getPositionsData=function(){for(var s=this.graphManager.getAllNodes(),m={},g=0;g0&&this.updateDisplacements();for(var g=0;g0&&(T.fixedNodeWeight=O)}}if(this.constraints.relativePlacementConstraint){var x=new Map,P=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(M){s.fixedNodesOnHorizontal.add(M),s.fixedNodesOnVertical.add(M)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var S=this.constraints.alignmentConstraint.vertical,g=0;g=2*M.length/3;K--)U=Math.floor(Math.random()*(K+1)),H=M[K],M[K]=M[U],M[U]=H;return M},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(M){if(M.left){var U=x.has(M.left)?x.get(M.left):M.left,H=x.has(M.right)?x.get(M.right):M.right;s.nodesInRelativeHorizontal.includes(U)||(s.nodesInRelativeHorizontal.push(U),s.nodeToRelativeConstraintMapHorizontal.set(U,[]),s.dummyToNodeForVerticalAlignment.has(U)?s.nodeToTempPositionMapHorizontal.set(U,s.idToNodeMap.get(s.dummyToNodeForVerticalAlignment.get(U)[0]).getCenterX()):s.nodeToTempPositionMapHorizontal.set(U,s.idToNodeMap.get(U).getCenterX())),s.nodesInRelativeHorizontal.includes(H)||(s.nodesInRelativeHorizontal.push(H),s.nodeToRelativeConstraintMapHorizontal.set(H,[]),s.dummyToNodeForVerticalAlignment.has(H)?s.nodeToTempPositionMapHorizontal.set(H,s.idToNodeMap.get(s.dummyToNodeForVerticalAlignment.get(H)[0]).getCenterX()):s.nodeToTempPositionMapHorizontal.set(H,s.idToNodeMap.get(H).getCenterX())),s.nodeToRelativeConstraintMapHorizontal.get(U).push({right:H,gap:M.gap}),s.nodeToRelativeConstraintMapHorizontal.get(H).push({left:U,gap:M.gap})}else{var K=P.has(M.top)?P.get(M.top):M.top,ht=P.has(M.bottom)?P.get(M.bottom):M.bottom;s.nodesInRelativeVertical.includes(K)||(s.nodesInRelativeVertical.push(K),s.nodeToRelativeConstraintMapVertical.set(K,[]),s.dummyToNodeForHorizontalAlignment.has(K)?s.nodeToTempPositionMapVertical.set(K,s.idToNodeMap.get(s.dummyToNodeForHorizontalAlignment.get(K)[0]).getCenterY()):s.nodeToTempPositionMapVertical.set(K,s.idToNodeMap.get(K).getCenterY())),s.nodesInRelativeVertical.includes(ht)||(s.nodesInRelativeVertical.push(ht),s.nodeToRelativeConstraintMapVertical.set(ht,[]),s.dummyToNodeForHorizontalAlignment.has(ht)?s.nodeToTempPositionMapVertical.set(ht,s.idToNodeMap.get(s.dummyToNodeForHorizontalAlignment.get(ht)[0]).getCenterY()):s.nodeToTempPositionMapVertical.set(ht,s.idToNodeMap.get(ht).getCenterY())),s.nodeToRelativeConstraintMapVertical.get(K).push({bottom:ht,gap:M.gap}),s.nodeToRelativeConstraintMapVertical.get(ht).push({top:K,gap:M.gap})}});else{var Z=new Map,tt=new Map;this.constraints.relativePlacementConstraint.forEach(function(M){if(M.left){var U=x.has(M.left)?x.get(M.left):M.left,H=x.has(M.right)?x.get(M.right):M.right;Z.has(U)?Z.get(U).push(H):Z.set(U,[H]),Z.has(H)?Z.get(H).push(U):Z.set(H,[U])}else{var K=P.has(M.top)?P.get(M.top):M.top,ht=P.has(M.bottom)?P.get(M.bottom):M.bottom;tt.has(K)?tt.get(K).push(ht):tt.set(K,[ht]),tt.has(ht)?tt.get(ht).push(K):tt.set(ht,[K])}});var b=L(function(U,H){var K=[],ht=[],Lt=new rt,bt=new Set,Q=0;return U.forEach(function(Xt,wt){if(!bt.has(wt)){K[Q]=[],ht[Q]=!1;var ot=wt;for(Lt.push(ot),bt.add(ot),K[Q].push(ot);Lt.length!=0;){ot=Lt.shift(),H.has(ot)&&(ht[Q]=!0);var et=U.get(ot);et.forEach(function(yt){bt.has(yt)||(Lt.push(yt),bt.add(yt),K[Q].push(yt))})}Q++}}),{components:K,isFixed:ht}},"constructComponents"),_=b(Z,s.fixedNodesOnHorizontal);this.componentsOnHorizontal=_.components,this.fixedComponentsOnHorizontal=_.isFixed;var B=b(tt,s.fixedNodesOnVertical);this.componentsOnVertical=B.components,this.fixedComponentsOnVertical=B.isFixed}}},I.prototype.updateDisplacements=function(){var s=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function(B){var M=s.idToNodeMap.get(B.nodeId);M.displacementX=0,M.displacementY=0}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var m=this.constraints.alignmentConstraint.vertical,g=0;g1){var P;for(P=0;PT&&(T=Math.floor(x.y)),O=Math.floor(x.x+h.DEFAULT_COMPONENT_SEPERATION)}this.transform(new y(A.WORLD_CENTER_X-x.x/2,A.WORLD_CENTER_Y-x.y/2))},I.radialLayout=function(s,m,g){var T=Math.max(this.maxDiagonalInTree(s),h.DEFAULT_RADIAL_SEPARATION);I.branchRadialLayout(m,null,0,359,0,T);var d=z.calculateBounds(s),O=new X;O.setDeviceOrgX(d.getMinX()),O.setDeviceOrgY(d.getMinY()),O.setWorldOrgX(g.x),O.setWorldOrgY(g.y);for(var x=0;x1;){var K=H[0];H.splice(0,1);var ht=b.indexOf(K);ht>=0&&b.splice(ht,1),M--,_--}m!=null?U=(b.indexOf(H[0])+1)%M:U=0;for(var Lt=Math.abs(T-g)/_,bt=U;B!=_;bt=++bt%M){var Q=b[bt].getOtherEnd(s);if(Q!=m){var Xt=(g+B*Lt)%360,wt=(Xt+Lt)%360;I.branchRadialLayout(Q,s,Xt,wt,d+O,O),B++}}},I.maxDiagonalInTree=function(s){for(var m=C.MIN_VALUE,g=0;gm&&(m=d)}return m},I.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},I.prototype.groupZeroDegreeMembers=function(){var s=this,m={};this.memberGroups={},this.idToDummyNode={};for(var g=[],T=this.graphManager.getAllNodes(),d=0;d"u"&&(m[P]=[]),m[P]=m[P].concat(O)}Object.keys(m).forEach(function(S){if(m[S].length>1){var R="DummyCompound_"+S;s.memberGroups[R]=m[S];var Z=m[S][0].getParent(),tt=new i(s.graphManager);tt.id=R,tt.paddingLeft=Z.paddingLeft||0,tt.paddingRight=Z.paddingRight||0,tt.paddingBottom=Z.paddingBottom||0,tt.paddingTop=Z.paddingTop||0,s.idToDummyNode[R]=tt;var b=s.getGraphManager().add(s.newGraph(),tt),_=Z.getChild();_.add(tt);for(var B=0;Bd?(T.rect.x-=(T.labelWidth-d)/2,T.setWidth(T.labelWidth),T.labelMarginLeft=(T.labelWidth-d)/2):T.labelPosHorizontal=="right"&&T.setWidth(d+T.labelWidth)),T.labelHeight&&(T.labelPosVertical=="top"?(T.rect.y-=T.labelHeight,T.setHeight(O+T.labelHeight),T.labelMarginTop=T.labelHeight):T.labelPosVertical=="center"&&T.labelHeight>O?(T.rect.y-=(T.labelHeight-O)/2,T.setHeight(T.labelHeight),T.labelMarginTop=(T.labelHeight-O)/2):T.labelPosVertical=="bottom"&&T.setHeight(O+T.labelHeight))}})},I.prototype.repopulateCompounds=function(){for(var s=this.compoundOrder.length-1;s>=0;s--){var m=this.compoundOrder[s],g=m.id,T=m.paddingLeft,d=m.paddingTop,O=m.labelMarginLeft,x=m.labelMarginTop;this.adjustLocations(this.tiledMemberPack[g],m.rect.x,m.rect.y,T,d,O,x)}},I.prototype.repopulateZeroDegreeMembers=function(){var s=this,m=this.tiledZeroDegreePack;Object.keys(m).forEach(function(g){var T=s.idToDummyNode[g],d=T.paddingLeft,O=T.paddingTop,x=T.labelMarginLeft,P=T.labelMarginTop;s.adjustLocations(m[g],T.rect.x,T.rect.y,d,O,x,P)})},I.prototype.getToBeTiled=function(s){var m=s.id;if(this.toBeTiled[m]!=null)return this.toBeTiled[m];var g=s.getChild();if(g==null)return this.toBeTiled[m]=!1,!1;for(var T=g.getNodes(),d=0;d0)return this.toBeTiled[m]=!1,!1;if(O.getChild()==null){this.toBeTiled[O.id]=!1;continue}if(!this.getToBeTiled(O))return this.toBeTiled[m]=!1,!1}return this.toBeTiled[m]=!0,!0},I.prototype.getNodeDegree=function(s){for(var m=s.id,g=s.getEdges(),T=0,d=0;dZ&&(Z=b.rect.height)}g+=Z+s.verticalPadding}},I.prototype.tileCompoundMembers=function(s,m){var g=this;this.tiledMemberPack=[],Object.keys(s).forEach(function(T){var d=m[T];if(g.tiledMemberPack[T]=g.tileNodes(s[T],d.paddingLeft+d.paddingRight),d.rect.width=g.tiledMemberPack[T].width,d.rect.height=g.tiledMemberPack[T].height,d.setCenter(g.tiledMemberPack[T].centerX,g.tiledMemberPack[T].centerY),d.labelMarginLeft=0,d.labelMarginTop=0,h.NODE_DIMENSIONS_INCLUDE_LABELS){var O=d.rect.width,x=d.rect.height;d.labelWidth&&(d.labelPosHorizontal=="left"?(d.rect.x-=d.labelWidth,d.setWidth(O+d.labelWidth),d.labelMarginLeft=d.labelWidth):d.labelPosHorizontal=="center"&&d.labelWidth>O?(d.rect.x-=(d.labelWidth-O)/2,d.setWidth(d.labelWidth),d.labelMarginLeft=(d.labelWidth-O)/2):d.labelPosHorizontal=="right"&&d.setWidth(O+d.labelWidth)),d.labelHeight&&(d.labelPosVertical=="top"?(d.rect.y-=d.labelHeight,d.setHeight(x+d.labelHeight),d.labelMarginTop=d.labelHeight):d.labelPosVertical=="center"&&d.labelHeight>x?(d.rect.y-=(d.labelHeight-x)/2,d.setHeight(d.labelHeight),d.labelMarginTop=(d.labelHeight-x)/2):d.labelPosVertical=="bottom"&&d.setHeight(x+d.labelHeight))}})},I.prototype.tileNodes=function(s,m){var g=this.tileNodesByFavoringDim(s,m,!0),T=this.tileNodesByFavoringDim(s,m,!1),d=this.getOrgRatio(g),O=this.getOrgRatio(T),x;return OP&&(P=B.getWidth())});var S=O/d,R=x/d,Z=Math.pow(g-T,2)+4*(S+T)*(R+g)*d,tt=(T-g+Math.sqrt(Z))/(2*(S+T)),b;m?(b=Math.ceil(tt),b==tt&&b++):b=Math.floor(tt);var _=b*(S+T)-T;return P>_&&(_=P),_+=T*2,_},I.prototype.tileNodesByFavoringDim=function(s,m,g){var T=h.TILING_PADDING_VERTICAL,d=h.TILING_PADDING_HORIZONTAL,O=h.TILING_COMPARE_BY,x={rows:[],rowWidth:[],rowHeight:[],width:0,height:m,verticalPadding:T,horizontalPadding:d,centerX:0,centerY:0};O&&(x.idealRowWidth=this.calcIdealRowWidth(s,g));var P=L(function(M){return M.rect.width*M.rect.height},"getNodeArea"),S=L(function(M,U){return P(U)-P(M)},"areaCompareFcn");s.sort(function(B,M){var U=S;return x.idealRowWidth?(U=O,U(B.id,M.id)):U(B,M)});for(var R=0,Z=0,tt=0;tt0&&(x+=s.horizontalPadding),s.rowWidth[g]=x,s.width0&&(P+=s.verticalPadding);var S=0;P>s.rowHeight[g]&&(S=s.rowHeight[g],s.rowHeight[g]=P,S=s.rowHeight[g]-S),s.height+=S,s.rows[g].push(m)},I.prototype.getShortestRowIndex=function(s){for(var m=-1,g=Number.MAX_VALUE,T=0;Tg&&(m=T,g=s.rowWidth[T]);return m},I.prototype.canAddHorizontal=function(s,m,g){if(s.idealRowWidth){var T=s.rows.length-1,d=s.rowWidth[T];return d+m+s.horizontalPadding<=s.idealRowWidth}var O=this.getShortestRowIndex(s);if(O<0)return!0;var x=s.rowWidth[O];if(x+s.horizontalPadding+m<=s.width)return!0;var P=0;s.rowHeight[O]0&&(P=g+s.verticalPadding-s.rowHeight[O]);var S;s.width-x>=m+s.horizontalPadding?S=(s.height+P)/(x+m+s.horizontalPadding):S=(s.height+P)/s.width,P=g+s.verticalPadding;var R;return s.widthO&&m!=g){T.splice(-1,1),s.rows[g].push(d),s.rowWidth[m]=s.rowWidth[m]-O,s.rowWidth[g]=s.rowWidth[g]+O,s.width=s.rowWidth[instance.getLongestRowIndex(s)];for(var x=Number.MIN_VALUE,P=0;Px&&(x=T[P].height);m>0&&(x+=s.verticalPadding);var S=s.rowHeight[m]+s.rowHeight[g];s.rowHeight[m]=x,s.rowHeight[g]0)for(var _=d;_<=O;_++)b[0]+=this.grid[_][x-1].length+this.grid[_][x].length-1;if(O0)for(var _=x;_<=P;_++)b[3]+=this.grid[d-1][_].length+this.grid[d][_].length-1;for(var B=C.MAX_VALUE,M,U,H=0;H{var c=n(551).FDLayoutNode,e=n(551).IMath;function p(r,h,f,l){c.call(this,r,h,f,l)}L(p,"CoSENode"),p.prototype=Object.create(c.prototype);for(var i in c)p[i]=c[i];p.prototype.calculateDisplacement=function(){var r=this.graphManager.getLayout();this.getChild()!=null&&this.fixedNodeWeight?(this.displacementX+=r.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=r.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=r.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=r.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>r.coolingFactor*r.maxNodeDisplacement&&(this.displacementX=r.coolingFactor*r.maxNodeDisplacement*e.sign(this.displacementX)),Math.abs(this.displacementY)>r.coolingFactor*r.maxNodeDisplacement&&(this.displacementY=r.coolingFactor*r.maxNodeDisplacement*e.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},p.prototype.propogateDisplacementToChildren=function(r,h){for(var f=this.getChild().getNodes(),l,A=0;A{function c(f){if(Array.isArray(f)){for(var l=0,A=Array(f.length);l0){var dt=0;nt.forEach(function(ct){V=="horizontal"?(q.set(ct,v.has(ct)?y[v.get(ct)]:k.get(ct)),dt+=q.get(ct)):(q.set(ct,v.has(ct)?D[v.get(ct)]:k.get(ct)),dt+=q.get(ct))}),dt=dt/nt.length,st.forEach(function(ct){$.has(ct)||q.set(ct,dt)})}else{var at=0;st.forEach(function(ct){V=="horizontal"?at+=v.has(ct)?y[v.get(ct)]:k.get(ct):at+=v.has(ct)?D[v.get(ct)]:k.get(ct)}),at=at/st.length,st.forEach(function(ct){q.set(ct,at)})}});for(var it=L(function(){var nt=ut.shift(),dt=W.get(nt);dt.forEach(function(at){if(q.get(at.id)ct&&(ct=Wt),$tFt&&(Ft=$t)}}catch(ne){Bt=!0,Ot=ne}finally{try{!Rt&&Nt.return&&Nt.return()}finally{if(Bt)throw Ot}}var me=(dt+ct)/2-(at+Ft)/2,Kt=!0,ee=!1,re=void 0;try{for(var jt=st[Symbol.iterator](),ue;!(Kt=(ue=jt.next()).done);Kt=!0){var ie=ue.value;q.set(ie,q.get(ie)+me)}}catch(ne){ee=!0,re=ne}finally{try{!Kt&&jt.return&&jt.return()}finally{if(ee)throw re}}})}return q},"findAppropriatePositionForRelativePlacement"),J=L(function(W){var V=0,$=0,k=0,j=0;if(W.forEach(function(lt){lt.left?y[v.get(lt.left)]-y[v.get(lt.right)]>=0?V++:$++:D[v.get(lt.top)]-D[v.get(lt.bottom)]>=0?k++:j++}),V>$&&k>j)for(var gt=0;gt$)for(var ft=0;ftj)for(var q=0;q1)l.fixedNodeConstraint.forEach(function(Y,W){T[W]=[Y.position.x,Y.position.y],d[W]=[y[v.get(Y.nodeId)],D[v.get(Y.nodeId)]]}),O=!0;else if(l.alignmentConstraint)(function(){var Y=0;if(l.alignmentConstraint.vertical){for(var W=l.alignmentConstraint.vertical,V=L(function(q){var lt=new Set;W[q].forEach(function(pt){lt.add(pt)});var ut=new Set([].concat(c(lt)).filter(function(pt){return P.has(pt)})),it=void 0;ut.size>0?it=y[v.get(ut.values().next().value)]:it=rt(lt).x,W[q].forEach(function(pt){T[Y]=[it,D[v.get(pt)]],d[Y]=[y[v.get(pt)],D[v.get(pt)]],Y++})},"_loop2"),$=0;$0?it=y[v.get(ut.values().next().value)]:it=rt(lt).y,k[q].forEach(function(pt){T[Y]=[y[v.get(pt)],it],d[Y]=[y[v.get(pt)],D[v.get(pt)]],Y++})},"_loop3"),gt=0;gttt&&(tt=Z[_].length,b=_);if(tt0){var Dt={x:0,y:0};l.fixedNodeConstraint.forEach(function(Y,W){var V={x:y[v.get(Y.nodeId)],y:D[v.get(Y.nodeId)]},$=Y.position,k=X($,V);Dt.x+=k.x,Dt.y+=k.y}),Dt.x/=l.fixedNodeConstraint.length,Dt.y/=l.fixedNodeConstraint.length,y.forEach(function(Y,W){y[W]+=Dt.x}),D.forEach(function(Y,W){D[W]+=Dt.y}),l.fixedNodeConstraint.forEach(function(Y){y[v.get(Y.nodeId)]=Y.position.x,D[v.get(Y.nodeId)]=Y.position.y})}if(l.alignmentConstraint){if(l.alignmentConstraint.vertical)for(var Tt=l.alignmentConstraint.vertical,At=L(function(W){var V=new Set;Tt[W].forEach(function(j){V.add(j)});var $=new Set([].concat(c(V)).filter(function(j){return P.has(j)})),k=void 0;$.size>0?k=y[v.get($.values().next().value)]:k=rt(V).x,V.forEach(function(j){P.has(j)||(y[v.get(j)]=k)})},"_loop4"),xt=0;xt0?k=D[v.get($.values().next().value)]:k=rt(V).y,V.forEach(function(j){P.has(j)||(D[v.get(j)]=k)})},"_loop5"),Yt=0;Yt{a.exports=E}},N={};function u(a){var t=N[a];if(t!==void 0)return t.exports;var n=N[a]={exports:{}};return w[a](n,n.exports,u),n.exports}L(u,"__webpack_require__");var o=u(45);return o})()})});var lr=Le((fe,Se)=>{"use strict";L(function(w,N){typeof fe=="object"&&typeof Se=="object"?Se.exports=N(Ie()):typeof define=="function"&&define.amd?define(["cose-base"],N):typeof fe=="object"?fe.cytoscapeFcose=N(Ie()):w.cytoscapeFcose=N(w.coseBase)},"webpackUniversalModuleDefinition")(fe,function(E){return(()=>{"use strict";var w={658:a=>{a.exports=Object.assign!=null?Object.assign.bind(Object):function(t){for(var n=arguments.length,c=Array(n>1?n-1:0),e=1;e{var c=function(){function i(r,h){var f=[],l=!0,A=!1,v=void 0;try{for(var y=r[Symbol.iterator](),D;!(l=(D=y.next()).done)&&(f.push(D.value),!(h&&f.length===h));l=!0);}catch(F){A=!0,v=F}finally{try{!l&&y.return&&y.return()}finally{if(A)throw v}}return f}return L(i,"sliceIterator"),function(r,h){if(Array.isArray(r))return r;if(Symbol.iterator in Object(r))return i(r,h);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),e=n(140).layoutBase.LinkedList,p={};p.getTopMostNodes=function(i){for(var r={},h=0;h0&&O.merge(R)});for(var x=0;x1){D=v[0],F=D.connectedEdges().length,v.forEach(function(d){d.connectedEdges().length0&&f.set("dummy"+(f.size+1),z),X},p.relocateComponent=function(i,r,h){if(!h.fixedNodeConstraint){var f=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY,A=Number.POSITIVE_INFINITY,v=Number.NEGATIVE_INFINITY;if(h.quality=="draft"){var y=!0,D=!1,F=void 0;try{for(var C=r.nodeIndexes[Symbol.iterator](),G;!(y=(G=C.next()).done);y=!0){var z=G.value,X=c(z,2),rt=X[0],I=X[1],J=h.cy.getElementById(rt);if(J){var s=J.boundingBox(),m=r.xCoords[I]-s.w/2,g=r.xCoords[I]+s.w/2,T=r.yCoords[I]-s.h/2,d=r.yCoords[I]+s.h/2;ml&&(l=g),Tv&&(v=d)}}}catch(R){D=!0,F=R}finally{try{!y&&C.return&&C.return()}finally{if(D)throw F}}var O=i.x-(l+f)/2,x=i.y-(v+A)/2;r.xCoords=r.xCoords.map(function(R){return R+O}),r.yCoords=r.yCoords.map(function(R){return R+x})}else{Object.keys(r).forEach(function(R){var Z=r[R],tt=Z.getRect().x,b=Z.getRect().x+Z.getRect().width,_=Z.getRect().y,B=Z.getRect().y+Z.getRect().height;ttl&&(l=b),_v&&(v=B)});var P=i.x-(l+f)/2,S=i.y-(v+A)/2;Object.keys(r).forEach(function(R){var Z=r[R];Z.setCenter(Z.getCenterX()+P,Z.getCenterY()+S)})}}},p.calcBoundingBox=function(i,r,h,f){for(var l=Number.MAX_SAFE_INTEGER,A=Number.MIN_SAFE_INTEGER,v=Number.MAX_SAFE_INTEGER,y=Number.MIN_SAFE_INTEGER,D=void 0,F=void 0,C=void 0,G=void 0,z=i.descendants().not(":parent"),X=z.length,rt=0;rtD&&(l=D),AC&&(v=C),y{var c=n(548),e=n(140).CoSELayout,p=n(140).CoSENode,i=n(140).layoutBase.PointD,r=n(140).layoutBase.DimensionD,h=n(140).layoutBase.LayoutConstants,f=n(140).layoutBase.FDLayoutConstants,l=n(140).CoSEConstants,A=L(function(y,D){var F=y.cy,C=y.eles,G=C.nodes(),z=C.edges(),X=void 0,rt=void 0,I=void 0,J={};y.randomize&&(X=D.nodeIndexes,rt=D.xCoords,I=D.yCoords);var s=L(function(R){return typeof R=="function"},"isFn"),m=L(function(R,Z){return s(R)?R(Z):R},"optFn"),g=c.calcParentsWithoutChildren(F,C),T=L(function S(R,Z,tt,b){for(var _=Z.length,B=0;B<_;B++){var M=Z[B],U=null;M.intersection(g).length==0&&(U=M.children());var H=void 0,K=M.layoutDimensions({nodeDimensionsIncludeLabels:b.nodeDimensionsIncludeLabels});if(M.outerWidth()!=null&&M.outerHeight()!=null)if(b.randomize)if(!M.isParent())H=R.add(new p(tt.graphManager,new i(rt[X.get(M.id())]-K.w/2,I[X.get(M.id())]-K.h/2),new r(parseFloat(K.w),parseFloat(K.h))));else{var ht=c.calcBoundingBox(M,rt,I,X);M.intersection(g).length==0?H=R.add(new p(tt.graphManager,new i(ht.topLeftX,ht.topLeftY),new r(ht.width,ht.height))):H=R.add(new p(tt.graphManager,new i(ht.topLeftX,ht.topLeftY),new r(parseFloat(K.w),parseFloat(K.h))))}else H=R.add(new p(tt.graphManager,new i(M.position("x")-K.w/2,M.position("y")-K.h/2),new r(parseFloat(K.w),parseFloat(K.h))));else H=R.add(new p(this.graphManager));if(H.id=M.data("id"),H.nodeRepulsion=m(b.nodeRepulsion,M),H.paddingLeft=parseInt(M.css("padding")),H.paddingTop=parseInt(M.css("padding")),H.paddingRight=parseInt(M.css("padding")),H.paddingBottom=parseInt(M.css("padding")),b.nodeDimensionsIncludeLabels&&(H.labelWidth=M.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).w,H.labelHeight=M.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).h,H.labelPosVertical=M.css("text-valign"),H.labelPosHorizontal=M.css("text-halign")),J[M.data("id")]=H,isNaN(H.rect.x)&&(H.rect.x=0),isNaN(H.rect.y)&&(H.rect.y=0),U!=null&&U.length>0){var Lt=void 0;Lt=tt.getGraphManager().add(tt.newGraph(),H),S(Lt,U,tt,b)}}},"processChildrenList"),d=L(function(R,Z,tt){for(var b=0,_=0,B=0;B0?l.DEFAULT_EDGE_LENGTH=f.DEFAULT_EDGE_LENGTH=b/_:s(y.idealEdgeLength)?l.DEFAULT_EDGE_LENGTH=f.DEFAULT_EDGE_LENGTH=50:l.DEFAULT_EDGE_LENGTH=f.DEFAULT_EDGE_LENGTH=y.idealEdgeLength,l.MIN_REPULSION_DIST=f.MIN_REPULSION_DIST=f.DEFAULT_EDGE_LENGTH/10,l.DEFAULT_RADIAL_SEPARATION=f.DEFAULT_EDGE_LENGTH)},"processEdges"),O=L(function(R,Z){Z.fixedNodeConstraint&&(R.constraints.fixedNodeConstraint=Z.fixedNodeConstraint),Z.alignmentConstraint&&(R.constraints.alignmentConstraint=Z.alignmentConstraint),Z.relativePlacementConstraint&&(R.constraints.relativePlacementConstraint=Z.relativePlacementConstraint)},"processConstraints");y.nestingFactor!=null&&(l.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=f.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=y.nestingFactor),y.gravity!=null&&(l.DEFAULT_GRAVITY_STRENGTH=f.DEFAULT_GRAVITY_STRENGTH=y.gravity),y.numIter!=null&&(l.MAX_ITERATIONS=f.MAX_ITERATIONS=y.numIter),y.gravityRange!=null&&(l.DEFAULT_GRAVITY_RANGE_FACTOR=f.DEFAULT_GRAVITY_RANGE_FACTOR=y.gravityRange),y.gravityCompound!=null&&(l.DEFAULT_COMPOUND_GRAVITY_STRENGTH=f.DEFAULT_COMPOUND_GRAVITY_STRENGTH=y.gravityCompound),y.gravityRangeCompound!=null&&(l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=f.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=y.gravityRangeCompound),y.initialEnergyOnIncremental!=null&&(l.DEFAULT_COOLING_FACTOR_INCREMENTAL=f.DEFAULT_COOLING_FACTOR_INCREMENTAL=y.initialEnergyOnIncremental),y.tilingCompareBy!=null&&(l.TILING_COMPARE_BY=y.tilingCompareBy),y.quality=="proof"?h.QUALITY=2:h.QUALITY=0,l.NODE_DIMENSIONS_INCLUDE_LABELS=f.NODE_DIMENSIONS_INCLUDE_LABELS=h.NODE_DIMENSIONS_INCLUDE_LABELS=y.nodeDimensionsIncludeLabels,l.DEFAULT_INCREMENTAL=f.DEFAULT_INCREMENTAL=h.DEFAULT_INCREMENTAL=!y.randomize,l.ANIMATE=f.ANIMATE=h.ANIMATE=y.animate,l.TILE=y.tile,l.TILING_PADDING_VERTICAL=typeof y.tilingPaddingVertical=="function"?y.tilingPaddingVertical.call():y.tilingPaddingVertical,l.TILING_PADDING_HORIZONTAL=typeof y.tilingPaddingHorizontal=="function"?y.tilingPaddingHorizontal.call():y.tilingPaddingHorizontal,l.DEFAULT_INCREMENTAL=f.DEFAULT_INCREMENTAL=h.DEFAULT_INCREMENTAL=!0,l.PURE_INCREMENTAL=!y.randomize,h.DEFAULT_UNIFORM_LEAF_NODE_SIZES=y.uniformNodeDimensions,y.step=="transformed"&&(l.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,l.ENFORCE_CONSTRAINTS=!1,l.APPLY_LAYOUT=!1),y.step=="enforced"&&(l.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,l.ENFORCE_CONSTRAINTS=!0,l.APPLY_LAYOUT=!1),y.step=="cose"&&(l.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,l.ENFORCE_CONSTRAINTS=!1,l.APPLY_LAYOUT=!0),y.step=="all"&&(y.randomize?l.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:l.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,l.ENFORCE_CONSTRAINTS=!0,l.APPLY_LAYOUT=!0),y.fixedNodeConstraint||y.alignmentConstraint||y.relativePlacementConstraint?l.TREE_REDUCTION_ON_INCREMENTAL=!1:l.TREE_REDUCTION_ON_INCREMENTAL=!0;var x=new e,P=x.newGraphManager();return T(P.addRoot(),c.getTopMostNodes(G),x,y),d(x,P,z),O(x,y),x.runLayout(),J},"coseLayout");a.exports={coseLayout:A}},212:(a,t,n)=>{var c=function(){function y(D,F){for(var C=0;C0)if(d){var P=i.getTopMostNodes(C.eles.nodes());if(s=i.connectComponents(G,C.eles,P),s.forEach(function(ot){var et=ot.boundingBox();m.push({x:et.x1+et.w/2,y:et.y1+et.h/2})}),C.randomize&&s.forEach(function(ot){C.eles=ot,X.push(h(C))}),C.quality=="default"||C.quality=="proof"){var S=G.collection();if(C.tile){var R=new Map,Z=[],tt=[],b=0,_={nodeIndexes:R,xCoords:Z,yCoords:tt},B=[];if(s.forEach(function(ot,et){ot.edges().length==0&&(ot.nodes().forEach(function(yt,Et){S.merge(ot.nodes()[Et]),yt.isParent()||(_.nodeIndexes.set(ot.nodes()[Et].id(),b++),_.xCoords.push(ot.nodes()[0].position().x),_.yCoords.push(ot.nodes()[0].position().y))}),B.push(et))}),S.length>1){var M=S.boundingBox();m.push({x:M.x1+M.w/2,y:M.y1+M.h/2}),s.push(S),X.push(_);for(var U=B.length-1;U>=0;U--)s.splice(B[U],1),X.splice(B[U],1),m.splice(B[U],1)}}s.forEach(function(ot,et){C.eles=ot,J.push(l(C,X[et])),i.relocateComponent(m[et],J[et],C)})}else s.forEach(function(ot,et){i.relocateComponent(m[et],X[et],C)});var H=new Set;if(s.length>1){var K=[],ht=z.filter(function(ot){return ot.css("display")=="none"});s.forEach(function(ot,et){var yt=void 0;if(C.quality=="draft"&&(yt=X[et].nodeIndexes),ot.nodes().not(ht).length>0){var Et={};Et.edges=[],Et.nodes=[];var Dt=void 0;ot.nodes().not(ht).forEach(function(Tt){if(C.quality=="draft")if(!Tt.isParent())Dt=yt.get(Tt.id()),Et.nodes.push({x:X[et].xCoords[Dt]-Tt.boundingbox().w/2,y:X[et].yCoords[Dt]-Tt.boundingbox().h/2,width:Tt.boundingbox().w,height:Tt.boundingbox().h});else{var At=i.calcBoundingBox(Tt,X[et].xCoords,X[et].yCoords,yt);Et.nodes.push({x:At.topLeftX,y:At.topLeftY,width:At.width,height:At.height})}else J[et][Tt.id()]&&Et.nodes.push({x:J[et][Tt.id()].getLeft(),y:J[et][Tt.id()].getTop(),width:J[et][Tt.id()].getWidth(),height:J[et][Tt.id()].getHeight()})}),ot.edges().forEach(function(Tt){var At=Tt.source(),xt=Tt.target();if(At.css("display")!="none"&&xt.css("display")!="none")if(C.quality=="draft"){var It=yt.get(At.id()),zt=yt.get(xt.id()),Yt=[],Ht=[];if(At.isParent()){var Pt=i.calcBoundingBox(At,X[et].xCoords,X[et].yCoords,yt);Yt.push(Pt.topLeftX+Pt.width/2),Yt.push(Pt.topLeftY+Pt.height/2)}else Yt.push(X[et].xCoords[It]),Yt.push(X[et].yCoords[It]);if(xt.isParent()){var Y=i.calcBoundingBox(xt,X[et].xCoords,X[et].yCoords,yt);Ht.push(Y.topLeftX+Y.width/2),Ht.push(Y.topLeftY+Y.height/2)}else Ht.push(X[et].xCoords[zt]),Ht.push(X[et].yCoords[zt]);Et.edges.push({startX:Yt[0],startY:Yt[1],endX:Ht[0],endY:Ht[1]})}else J[et][At.id()]&&J[et][xt.id()]&&Et.edges.push({startX:J[et][At.id()].getCenterX(),startY:J[et][At.id()].getCenterY(),endX:J[et][xt.id()].getCenterX(),endY:J[et][xt.id()].getCenterY()})}),Et.nodes.length>0&&(K.push(Et),H.add(et))}});var Lt=T.packComponents(K,C.randomize).shifts;if(C.quality=="draft")X.forEach(function(ot,et){var yt=ot.xCoords.map(function(Dt){return Dt+Lt[et].dx}),Et=ot.yCoords.map(function(Dt){return Dt+Lt[et].dy});ot.xCoords=yt,ot.yCoords=Et});else{var bt=0;H.forEach(function(ot){Object.keys(J[ot]).forEach(function(et){var yt=J[ot][et];yt.setCenter(yt.getCenterX()+Lt[bt].dx,yt.getCenterY()+Lt[bt].dy)}),bt++})}}}else{var O=C.eles.boundingBox();if(m.push({x:O.x1+O.w/2,y:O.y1+O.h/2}),C.randomize){var x=h(C);X.push(x)}C.quality=="default"||C.quality=="proof"?(J.push(l(C,X[0])),i.relocateComponent(m[0],J[0],C)):i.relocateComponent(m[0],X[0],C)}var Q=L(function(et,yt){if(C.quality=="default"||C.quality=="proof"){typeof et=="number"&&(et=yt);var Et=void 0,Dt=void 0,Tt=et.data("id");return J.forEach(function(xt){Tt in xt&&(Et={x:xt[Tt].getRect().getCenterX(),y:xt[Tt].getRect().getCenterY()},Dt=xt[Tt])}),C.nodeDimensionsIncludeLabels&&(Dt.labelWidth&&(Dt.labelPosHorizontal=="left"?Et.x+=Dt.labelWidth/2:Dt.labelPosHorizontal=="right"&&(Et.x-=Dt.labelWidth/2)),Dt.labelHeight&&(Dt.labelPosVertical=="top"?Et.y+=Dt.labelHeight/2:Dt.labelPosVertical=="bottom"&&(Et.y-=Dt.labelHeight/2))),Et==null&&(Et={x:et.position("x"),y:et.position("y")}),{x:Et.x,y:Et.y}}else{var At=void 0;return X.forEach(function(xt){var It=xt.nodeIndexes.get(et.id());It!=null&&(At={x:xt.xCoords[It],y:xt.yCoords[It]})}),At==null&&(At={x:et.position("x"),y:et.position("y")}),{x:At.x,y:At.y}}},"getPositions");if(C.quality=="default"||C.quality=="proof"||C.randomize){var Xt=i.calcParentsWithoutChildren(G,z),wt=z.filter(function(ot){return ot.css("display")=="none"});C.eles=z.not(wt),z.nodes().not(":parent").not(wt).layoutPositions(F,C,Q),Xt.length>0&&Xt.forEach(function(ot){ot.position(Q(ot))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")},"run")}]),y}();a.exports=v},657:(a,t,n)=>{var c=n(548),e=n(140).layoutBase.Matrix,p=n(140).layoutBase.SVD,i=L(function(h){var f=h.cy,l=h.eles,A=l.nodes(),v=l.nodes(":parent"),y=new Map,D=new Map,F=new Map,C=[],G=[],z=[],X=[],rt=[],I=[],J=[],s=[],m=void 0,g=void 0,T=1e8,d=1e-9,O=h.piTol,x=h.samplingType,P=h.nodeSeparation,S=void 0,R=L(function(){for(var V=0,$=0,k=!1;$=gt;){q=j[gt++];for(var st=C[q],nt=0;ntit&&(it=rt[at],pt=at)}return pt},"BFS"),tt=L(function(V){var $=void 0;if(V){$=Math.floor(Math.random()*g),m=$;for(var j=0;j=1)break;it=ut}for(var st=0;st=1)break;it=ut}for(var dt=0;dt0&&($.isParent()?C[V].push(F.get($.id())):C[V].push($.id()))})});var Xt=L(function(V){var $=D.get(V),k=void 0;y.get(V).forEach(function(j){f.getElementById(j).isParent()?k=F.get(j):k=j,C[$].push(k),C[D.get(k)].push(V)})},"_loop"),wt=!0,ot=!1,et=void 0;try{for(var yt=y.keys()[Symbol.iterator](),Et;!(wt=(Et=yt.next()).done);wt=!0){var Dt=Et.value;Xt(Dt)}}catch(W){ot=!0,et=W}finally{try{!wt&&yt.return&&yt.return()}finally{if(ot)throw et}}g=D.size;var Tt=void 0;if(g>2){S=g{var c=n(212),e=L(function(i){i&&i("layout","fcose",c)},"register");typeof cytoscape<"u"&&e(cytoscape),a.exports=e},140:a=>{a.exports=E}},N={};function u(a){var t=N[a];if(t!==void 0)return t.exports;var n=N[a]={exports:{}};return w[a](n,n.exports,u),n.exports}L(u,"__webpack_require__");var o=u(579);return o})()})});var Ce={L:"left",R:"right",T:"top",B:"bottom"},Me={L:L(E=>`${E},${E/2} 0,${E} 0,0`,"L"),R:L(E=>`0,${E/2} ${E},0 ${E},${E}`,"R"),T:L(E=>`0,0 ${E},0 ${E/2},${E}`,"T"),B:L(E=>`${E/2},0 ${E},${E} 0,${E}`,"B")},se={L:L((E,w)=>E-w+2,"L"),R:L((E,w)=>E-2,"R"),T:L((E,w)=>E-w+2,"T"),B:L((E,w)=>E-2,"B")},tr=L(function(E){return Vt(E)?E==="L"?"R":"L":E==="T"?"B":"T"},"getOppositeArchitectureDirection"),we=L(function(E){let w=E;return w==="L"||w==="R"||w==="T"||w==="B"},"isArchitectureDirection"),Vt=L(function(E){let w=E;return w==="L"||w==="R"},"isArchitectureDirectionX"),Jt=L(function(E){let w=E;return w==="T"||w==="B"},"isArchitectureDirectionY"),ve=L(function(E,w){let N=Vt(E)&&Jt(w),u=Jt(E)&&Vt(w);return N||u},"isArchitectureDirectionXY"),er=L(function(E){let w=E[0],N=E[1],u=Vt(w)&&Jt(N),o=Jt(w)&&Vt(N);return u||o},"isArchitecturePairXY"),mr=L(function(E){return E!=="LL"&&E!=="RR"&&E!=="TT"&&E!=="BB"},"isValidArchitectureDirectionPair"),he=L(function(E,w){let N=`${E}${w}`;return mr(N)?N:void 0},"getArchitectureDirectionPair"),rr=L(function([E,w],N){let u=N[0],o=N[1];return Vt(u)?Jt(o)?[E+(u==="L"?-1:1),w+(o==="T"?1:-1)]:[E+(u==="L"?-1:1),w]:Vt(o)?[E+(o==="L"?1:-1),w+(u==="T"?1:-1)]:[E,w+(u==="T"?1:-1)]},"shiftPositionByArchitectureDirectionPair"),ir=L(function(E){return E==="LT"||E==="TL"?[1,1]:E==="BL"||E==="LB"?[1,-1]:E==="BR"||E==="RB"?[-1,-1]:[-1,1]},"getArchitectureDirectionXYFactors"),nr=L(function(E){return E.type==="service"},"isArchitectureService"),ar=L(function(E){return E.type==="junction"},"isArchitectureJunction"),ye=L(E=>E.data(),"edgeData"),Qt=L(E=>E.data(),"nodeData");var or=He.architecture,vt=new je(()=>({nodes:{},groups:{},edges:[],registeredIds:{},config:or,dataStructures:void 0,elements:{}})),Er=L(()=>{vt.reset(),Ve()},"clear"),Tr=L(function({id:E,icon:w,in:N,title:u,iconText:o}){if(vt.records.registeredIds[E]!==void 0)throw new Error(`The service id [${E}] is already in use by another ${vt.records.registeredIds[E]}`);if(N!==void 0){if(E===N)throw new Error(`The service [${E}] cannot be placed within itself`);if(vt.records.registeredIds[N]===void 0)throw new Error(`The service [${E}]'s parent does not exist. Please make sure the parent is created before this service`);if(vt.records.registeredIds[N]==="node")throw new Error(`The service [${E}]'s parent is not a group`)}vt.records.registeredIds[E]="node",vt.records.nodes[E]={id:E,type:"service",icon:w,iconText:o,title:u,edges:[],in:N}},"addService"),Ar=L(()=>Object.values(vt.records.nodes).filter(nr),"getServices"),Nr=L(function({id:E,in:w}){vt.records.registeredIds[E]="node",vt.records.nodes[E]={id:E,type:"junction",edges:[],in:w}},"addJunction"),Lr=L(()=>Object.values(vt.records.nodes).filter(ar),"getJunctions"),Dr=L(()=>Object.values(vt.records.nodes),"getNodes"),Cr=L(E=>vt.records.nodes[E],"getNode"),Mr=L(function({id:E,icon:w,in:N,title:u}){if(vt.records.registeredIds[E]!==void 0)throw new Error(`The group id [${E}] is already in use by another ${vt.records.registeredIds[E]}`);if(N!==void 0){if(E===N)throw new Error(`The group [${E}] cannot be placed within itself`);if(vt.records.registeredIds[N]===void 0)throw new Error(`The group [${E}]'s parent does not exist. Please make sure the parent is created before this group`);if(vt.records.registeredIds[N]==="node")throw new Error(`The group [${E}]'s parent is not a group`)}vt.records.registeredIds[E]="group",vt.records.groups[E]={id:E,icon:w,title:u,in:N}},"addGroup"),wr=L(()=>Object.values(vt.records.groups),"getGroups"),xr=L(function({lhsId:E,rhsId:w,lhsDir:N,rhsDir:u,lhsInto:o,rhsInto:a,lhsGroup:t,rhsGroup:n,title:c}){if(!we(N))throw new Error(`Invalid direction given for left hand side of edge ${E}--${w}. Expected (L,R,T,B) got ${N}`);if(!we(u))throw new Error(`Invalid direction given for right hand side of edge ${E}--${w}. Expected (L,R,T,B) got ${u}`);if(vt.records.nodes[E]===void 0&&vt.records.groups[E]===void 0)throw new Error(`The left-hand id [${E}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(vt.records.nodes[w]===void 0&&vt.records.groups[E]===void 0)throw new Error(`The right-hand id [${w}] does not yet exist. Please create the service/group before declaring an edge to it.`);let e=vt.records.nodes[E].in,p=vt.records.nodes[w].in;if(t&&e&&p&&e==p)throw new Error(`The left-hand id [${E}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if(n&&e&&p&&e==p)throw new Error(`The right-hand id [${w}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);let i={lhsId:E,lhsDir:N,lhsInto:o,lhsGroup:t,rhsId:w,rhsDir:u,rhsInto:a,rhsGroup:n,title:c};vt.records.edges.push(i),vt.records.nodes[E]&&vt.records.nodes[w]&&(vt.records.nodes[E].edges.push(vt.records.edges[vt.records.edges.length-1]),vt.records.nodes[w].edges.push(vt.records.edges[vt.records.edges.length-1]))},"addEdge"),Or=L(()=>vt.records.edges,"getEdges"),Rr=L(()=>{if(vt.records.dataStructures===void 0){let E=Object.entries(vt.records.nodes).reduce((t,[n,c])=>(t[n]=c.edges.reduce((e,p)=>{if(p.lhsId===n){let i=he(p.lhsDir,p.rhsDir);i&&(e[i]=p.rhsId)}else{let i=he(p.rhsDir,p.lhsDir);i&&(e[i]=p.lhsId)}return e},{}),t),{}),w=Object.keys(E)[0],N={[w]:1},u=Object.keys(E).reduce((t,n)=>n===w?t:{...t,[n]:1},{}),o=L(t=>{let n={[t]:[0,0]},c=[t];for(;c.length>0;){let e=c.shift();if(e){N[e]=1,delete u[e];let p=E[e],[i,r]=n[e];Object.entries(p).forEach(([h,f])=>{N[f]||(n[f]=rr([i,r],h),c.push(f))})}}return n},"BFS"),a=[o(w)];for(;Object.keys(u).length>0;)a.push(o(Object.keys(u)[0]));vt.records.dataStructures={adjList:E,spatialMaps:a}}return vt.records.dataStructures},"getDataStructures"),Ir=L((E,w)=>{vt.records.elements[E]=w},"setElementForId"),Sr=L(E=>vt.records.elements[E],"getElementById"),_t={clear:Er,setDiagramTitle:Ze,getDiagramTitle:Je,setAccTitle:ze,getAccTitle:Be,setAccDescription:$e,getAccDescription:ke,addService:Tr,getServices:Ar,addJunction:Nr,getJunctions:Lr,getNodes:Dr,getNode:Cr,addGroup:Mr,getGroups:wr,addEdge:xr,getEdges:Or,setElementForId:Ir,getElementById:Sr,getDataStructures:Rr};function Gt(E){let w=ae().architecture;return w?.[E]?w[E]:or[E]}L(Gt,"getConfigField");var br=L((E,w)=>{Ke(E,w),E.groups.map(w.addGroup),E.services.map(N=>w.addService({...N,type:"service"})),E.junctions.map(N=>w.addJunction({...N,type:"junction"})),E.edges.map(w.addEdge)},"populateDb"),sr={parse:L(async E=>{let w=await Qe("architecture",E);ge.debug(w),br(w,_t)},"parse")};var Fr=L(E=>`
  .edge {
    stroke-width: ${E.archEdgeWidth};
    stroke: ${E.archEdgeColor};
    fill: none;
  }

  .arrow {
    fill: ${E.archEdgeArrowColor};
  }

  .node-bkg {
    fill: none;
    stroke: ${E.archGroupBorderColor};
    stroke-width: ${E.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"),hr=Fr;var dr=yr(lr(),1);var oe=L(E=>`${E}`,"wrapIcon"),te={prefix:"mermaid-architecture",height:80,width:80,icons:{database:{body:oe('')},server:{body:oe('')},disk:{body:oe('')},internet:{body:oe('')},cloud:{body:oe('')},unknown:Ue,blank:{body:oe("")}}};var cr=L(async function(E,w){let N=Gt("padding"),u=Gt("iconSize"),o=u/2,a=u/6,t=a/2;await Promise.all(w.edges().map(async n=>{let{source:c,sourceDir:e,sourceArrow:p,sourceGroup:i,target:r,targetDir:h,targetArrow:f,targetGroup:l,label:A}=ye(n),{x:v,y}=n[0].sourceEndpoint(),{x:D,y:F}=n[0].midpoint(),{x:C,y:G}=n[0].targetEndpoint(),z=N+4;if(i&&(Vt(e)?v+=e==="L"?-z:z:y+=e==="T"?-z:z+18),l&&(Vt(h)?C+=h==="L"?-z:z:G+=h==="T"?-z:z+18),!i&&_t.getNode(c)?.type==="junction"&&(Vt(e)?v+=e==="L"?o:-o:y+=e==="T"?o:-o),!l&&_t.getNode(r)?.type==="junction"&&(Vt(h)?C+=h==="L"?o:-o:G+=h==="T"?o:-o),n[0]._private.rscratch){let X=E.insert("g");if(X.insert("path").attr("d",`M ${v},${y} L ${D},${F} L${C},${G} `).attr("class","edge"),p){let rt=Vt(e)?se[e](v,a):v-t,I=Jt(e)?se[e](y,a):y-t;X.insert("polygon").attr("points",Me[e](a)).attr("transform",`translate(${rt},${I})`).attr("class","arrow")}if(f){let rt=Vt(h)?se[h](C,a):C-t,I=Jt(h)?se[h](G,a):G-t;X.insert("polygon").attr("points",Me[h](a)).attr("transform",`translate(${rt},${I})`).attr("class","arrow")}if(A){let rt=ve(e,h)?"XY":Vt(e)?"X":"Y",I=0;rt==="X"?I=Math.abs(v-C):rt==="Y"?I=Math.abs(y-G)/1.5:I=Math.abs(v-C)/2;let J=X.append("g");if(await pe(J,A,{useHtmlLabels:!1,width:I,classes:"architecture-service-label"},ae()),J.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),rt==="X")J.attr("transform","translate("+D+", "+F+")");else if(rt==="Y")J.attr("transform","translate("+D+", "+F+") rotate(-90)");else if(rt==="XY"){let s=he(e,h);if(s&&er(s)){let m=J.node().getBoundingClientRect(),[g,T]=ir(s);J.attr("dominant-baseline","auto").attr("transform",`rotate(${-1*g*T*45})`);let d=J.node().getBoundingClientRect();J.attr("transform",`
                translate(${D}, ${F-m.height/2}) 
                translate(${g*d.width/2}, ${T*d.height/2}) 
                rotate(${-1*g*T*45}, 0, ${m.height/2})
              `)}}}}}))},"drawEdges"),fr=L(async function(E,w){let u=Gt("padding")*.75,o=Gt("fontSize"),t=Gt("iconSize")/2;await Promise.all(w.nodes().map(async n=>{let c=Qt(n);if(c.type==="group"){let{h:e,w:p,x1:i,y1:r}=n.boundingBox();E.append("rect").attr("x",i+t).attr("y",r+t).attr("width",p).attr("height",e).attr("class","node-bkg");let h=E.append("g"),f=i,l=r;if(c.icon){let A=h.append("g");A.html(`${await de(c.icon,{height:u,width:u,fallbackPrefix:te.prefix})}`),A.attr("transform","translate("+(f+t+1)+", "+(l+t+1)+")"),f+=u,l+=o/2-1-2}if(c.label){let A=h.append("g");await pe(A,c.label,{useHtmlLabels:!1,width:p,classes:"architecture-service-label"},ae()),A.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","start").attr("text-anchor","start"),A.attr("transform","translate("+(f+t+4)+", "+(l+t+2)+")")}}}))},"drawGroups"),ur=L(async function(E,w,N){for(let u of N){let o=w.append("g"),a=Gt("iconSize");if(u.title){let e=o.append("g");await pe(e,u.title,{useHtmlLabels:!1,width:a*1.5,classes:"architecture-service-label"},ae()),e.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),e.attr("transform","translate("+a/2+", "+a+")")}let t=o.append("g");if(u.icon)t.html(`${await de(u.icon,{height:a,width:a,fallbackPrefix:te.prefix})}`);else if(u.iconText){t.html(`${await de("blank",{height:a,width:a,fallbackPrefix:te.prefix})}`);let i=t.append("g").append("foreignObject").attr("width",a).attr("height",a).append("div").attr("class","node-icon-text").attr("style",`height: ${a}px;`).append("div").html(u.iconText),r=parseInt(window.getComputedStyle(i.node(),null).getPropertyValue("font-size").replace(/\D/g,""))??16;i.attr("style",`-webkit-line-clamp: ${Math.floor((a-2)/r)};`)}else t.append("path").attr("class","node-bkg").attr("id","node-"+u.id).attr("d",`M0 ${a} v${-a} q0,-5 5,-5 h${a} q5,0 5,5 v${a} H0 Z`);o.attr("class","architecture-service");let{width:n,height:c}=o._groups[0][0].getBBox();u.width=n,u.height=c,E.setElementForId(u.id,o)}return 0},"drawServices"),gr=L(function(E,w,N){N.forEach(u=>{let o=w.append("g"),a=Gt("iconSize");o.append("g").append("rect").attr("id","node-"+u.id).attr("fill-opacity","0").attr("width",a).attr("height",a),o.attr("class","architecture-junction");let{width:n,height:c}=o._groups[0][0].getBBox();o.width=n,o.height=c,E.setElementForId(u.id,o)})},"drawJunctions");Xe([{name:te.prefix,icons:te}]);De.use(dr.default);function Pr(E,w){E.forEach(N=>{w.add({group:"nodes",data:{type:"service",id:N.id,icon:N.icon,label:N.title,parent:N.in,width:Gt("iconSize"),height:Gt("iconSize")},classes:"node-service"})})}L(Pr,"addServices");function Gr(E,w){E.forEach(N=>{w.add({group:"nodes",data:{type:"junction",id:N.id,parent:N.in,width:Gt("iconSize"),height:Gt("iconSize")},classes:"node-junction"})})}L(Gr,"addJunctions");function Yr(E,w){w.nodes().map(N=>{let u=Qt(N);if(u.type==="group")return;u.x=N.position().x,u.y=N.position().y,E.getElementById(u.id).attr("transform","translate("+(u.x||0)+","+(u.y||0)+")")})}L(Yr,"positionNodes");function Ur(E,w){E.forEach(N=>{w.add({group:"nodes",data:{type:"group",id:N.id,icon:N.icon,label:N.title,parent:N.in},classes:"node-group"})})}L(Ur,"addGroups");function Xr(E,w){E.forEach(N=>{let{lhsId:u,rhsId:o,lhsInto:a,lhsGroup:t,rhsInto:n,lhsDir:c,rhsDir:e,rhsGroup:p,title:i}=N,r=ve(N.lhsDir,N.rhsDir)?"segments":"straight",h={id:`${u}-${o}`,label:i,source:u,sourceDir:c,sourceArrow:a,sourceGroup:t,sourceEndpoint:c==="L"?"0 50%":c==="R"?"100% 50%":c==="T"?"50% 0":"50% 100%",target:o,targetDir:e,targetArrow:n,targetGroup:p,targetEndpoint:e==="L"?"0 50%":e==="R"?"100% 50%":e==="T"?"50% 0":"50% 100%"};w.add({group:"edges",data:h,classes:r})})}L(Xr,"addEdges");function Hr(E){let w=E.map(o=>{let a={},t={};return Object.entries(o).forEach(([n,[c,e]])=>{a[e]||(a[e]=[]),t[c]||(t[c]=[]),a[e].push(n),t[c].push(n)}),{horiz:Object.values(a).filter(n=>n.length>1),vert:Object.values(t).filter(n=>n.length>1)}}),[N,u]=w.reduce(([o,a],{horiz:t,vert:n})=>[[...o,...t],[...a,...n]],[[],[]]);return{horizontal:N,vertical:u}}L(Hr,"getAlignments");function Wr(E){let w=[],N=L(o=>`${o[0]},${o[1]}`,"posToStr"),u=L(o=>o.split(",").map(a=>parseInt(a)),"strToPos");return E.forEach(o=>{let a=Object.fromEntries(Object.entries(o).map(([e,p])=>[N(p),e])),t=[N([0,0])],n={},c={L:[-1,0],R:[1,0],T:[0,1],B:[0,-1]};for(;t.length>0;){let e=t.shift();if(e){n[e]=1;let p=a[e];if(p){let i=u(e);Object.entries(c).forEach(([r,h])=>{let f=N([i[0]+h[0],i[1]+h[1]]),l=a[f];l&&!n[f]&&(t.push(f),w.push({[Ce[r]]:l,[Ce[tr(r)]]:p,gap:1.5*Gt("iconSize")}))})}}}}),w}L(Wr,"getRelativeConstraints");function Vr(E,w,N,u,{spatialMaps:o}){return new Promise(a=>{let t=qe("body").append("div").attr("id","cy").attr("style","display:none"),n=De({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":`${Gt("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:`${Gt("padding")}px`}}]});t.remove(),Ur(N,n),Pr(E,n),Gr(w,n),Xr(u,n);let c=Hr(o),e=Wr(o),p=n.layout({name:"fcose",quality:"proof",styleEnabled:!1,animate:!1,nodeDimensionsIncludeLabels:!1,idealEdgeLength(i){let[r,h]=i.connectedNodes(),{parent:f}=Qt(r),{parent:l}=Qt(h);return f===l?1.5*Gt("iconSize"):.5*Gt("iconSize")},edgeElasticity(i){let[r,h]=i.connectedNodes(),{parent:f}=Qt(r),{parent:l}=Qt(h);return f===l?.45:.001},alignmentConstraint:c,relativePlacementConstraint:e});p.one("layoutstop",()=>{function i(r,h,f,l){let A,v,{x:y,y:D}=r,{x:F,y:C}=h;v=(l-D+(y-f)*(D-C)/(y-F))/Math.sqrt(1+Math.pow((D-C)/(y-F),2)),A=Math.sqrt(Math.pow(l-D,2)+Math.pow(f-y,2)-Math.pow(v,2));let G=Math.sqrt(Math.pow(F-y,2)+Math.pow(C-D,2));A=A/G;let z=(F-y)*(l-D)-(C-D)*(f-y);switch(!0){case z>=0:z=1;break;case z<0:z=-1;break}let X=(F-y)*(f-y)+(C-D)*(l-D);switch(!0){case X>=0:X=1;break;case X<0:X=-1;break}return v=Math.abs(v)*z,A=A*X,{distances:v,weights:A}}L(i,"getSegmentWeights"),n.startBatch();for(let r of Object.values(n.edges()))if(r.data?.()){let{x:h,y:f}=r.source().position(),{x:l,y:A}=r.target().position();if(h!==l&&f!==A){let v=r.sourceEndpoint(),y=r.targetEndpoint(),{sourceDir:D}=ye(r),[F,C]=Jt(D)?[v.x,y.y]:[y.x,v.y],{weights:G,distances:z}=i(v,y,F,C);r.style("segment-distances",z),r.style("segment-weights",G)}}n.endBatch(),p.run()}),p.run(),n.ready(i=>{ge.info("Ready",i),a(n)})})}L(Vr,"layoutArchitecture");var zr=L(async(E,w,N,u)=>{let o=u.db,a=o.getServices(),t=o.getJunctions(),n=o.getGroups(),c=o.getEdges(),e=o.getDataStructures(),p=_e(w),i=p.append("g");i.attr("class","architecture-edges");let r=p.append("g");r.attr("class","architecture-services");let h=p.append("g");h.attr("class","architecture-groups"),await ur(o,r,a),gr(o,r,t);let f=await Vr(a,t,n,c,e);await cr(i,f),await fr(h,f),Yr(o,f),We(void 0,p,Gt("padding"),Gt("useMaxWidth"))},"draw"),pr={draw:zr};var Yi={parser:sr,db:_t,renderer:pr,styles:hr};export{Yi as diagram};




© 2015 - 2024 Weber Informatics LLC | Privacy Policy