import{_ as W,l as V,d as gt}from"./mermaid.core-DrJfu-9d.chunk.mjs";import{c as tt}from"./cytoscape.esm-jrxdzse9.chunk.mjs";import{g as lt}from"./emoji-picker-MDCGxHB0.chunk.mjs";import"./index-CRQM6PVi.chunk.mjs";import"./NcLoadingIcon-ZJnsd-es.chunk.mjs";import"./vue.runtime.esm-CLeelJur.chunk.mjs";import"./index-DxwFe63_.chunk.mjs";var j={exports:{}},z={exports:{}},q={exports:{}},ut=q.exports,$;function ct(){return $||($=1,function(x,X){(function(_,L){x.exports=L()})(ut,function(){return function(_){var L={};function T(n){if(L[n])return L[n].exports;var e=L[n]={i:n,l:!1,exports:{}};return _[n].call(e.exports,e,e.exports,T),e.l=!0,e.exports}return T.m=_,T.c=L,T.i=function(n){return n},T.d=function(n,e,t){T.o(n,e)||Object.defineProperty(n,e,{configurable:!1,enumerable:!0,get:t})},T.n=function(n){var e=n&&n.__esModule?function(){return n.default}:function(){return n};return T.d(e,"a",e),e},T.o=function(n,e){return Object.prototype.hasOwnProperty.call(n,e)},T.p="",T(T.s=26)}([function(_,L,T){function n(){}n.QUALITY=1,n.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,n.DEFAULT_INCREMENTAL=!1,n.DEFAULT_ANIMATION_ON_LAYOUT=!0,n.DEFAULT_ANIMATION_DURING_LAYOUT=!1,n.DEFAULT_ANIMATION_PERIOD=50,n.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,n.DEFAULT_GRAPH_MARGIN=15,n.NODE_DIMENSIONS_INCLUDE_LABELS=!1,n.SIMPLE_NODE_SIZE=40,n.SIMPLE_NODE_HALF_SIZE=n.SIMPLE_NODE_SIZE/2,n.EMPTY_COMPOUND_NODE_SIZE=40,n.MIN_EDGE_LENGTH=1,n.WORLD_BOUNDARY=1e6,n.INITIAL_WORLD_BOUNDARY=n.WORLD_BOUNDARY/1e3,n.WORLD_CENTER_X=1200,n.WORLD_CENTER_Y=900,_.exports=n},function(_,L,T){var n=T(2),e=T(8),t=T(9);function i(a,o,p){n.call(this,p),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=p,this.bendpoints=[],this.source=a,this.target=o}i.prototype=Object.create(n.prototype);for(var h in n)i[h]=n[h];i.prototype.getSource=function(){return this.source},i.prototype.getTarget=function(){return this.target},i.prototype.isInterGraph=function(){return this.isInterGraph},i.prototype.getLength=function(){return this.length},i.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},i.prototype.getBendpoints=function(){return this.bendpoints},i.prototype.getLca=function(){return this.lca},i.prototype.getSourceInLca=function(){return this.sourceInLca},i.prototype.getTargetInLca=function(){return this.targetInLca},i.prototype.getOtherEnd=function(a){if(this.source===a)return this.target;if(this.target===a)return this.source;throw"Node is not incident with this edge"},i.prototype.getOtherEndInGraph=function(a,o){for(var p=this.getOtherEnd(a),r=o.getGraphManager().getRoot();;){if(p.getOwner()==o)return p;if(p.getOwner()==r)break;p=p.getOwner().getParent()}return null},i.prototype.updateLength=function(){var a=new Array(4);this.isOverlapingSourceAndTarget=e.getIntersection(this.target.getRect(),this.source.getRect(),a),this.isOverlapingSourceAndTarget||(this.lengthX=a[0]-a[2],this.lengthY=a[1]-a[3],Math.abs(this.lengthX)<1&&(this.lengthX=t.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=t.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},i.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=t.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=t.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},_.exports=i},function(_,L,T){function n(e){this.vGraphObject=e}_.exports=n},function(_,L,T){var n=T(2),e=T(10),t=T(13),i=T(0),h=T(16),a=T(4);function o(r,l,g,f){g==null&&f==null&&(f=l),n.call(this,f),r.graphManager!=null&&(r=r.graphManager),this.estimatedSize=e.MIN_VALUE,this.inclusionTreeDepth=e.MAX_VALUE,this.vGraphObject=f,this.edges=[],this.graphManager=r,g!=null&&l!=null?this.rect=new t(l.x,l.y,g.width,g.height):this.rect=new t}o.prototype=Object.create(n.prototype);for(var p in n)o[p]=n[p];o.prototype.getEdges=function(){return this.edges},o.prototype.getChild=function(){return this.child},o.prototype.getOwner=function(){return this.owner},o.prototype.getWidth=function(){return this.rect.width},o.prototype.setWidth=function(r){this.rect.width=r},o.prototype.getHeight=function(){return this.rect.height},o.prototype.setHeight=function(r){this.rect.height=r},o.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},o.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},o.prototype.getCenter=function(){return new a(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},o.prototype.getLocation=function(){return new a(this.rect.x,this.rect.y)},o.prototype.getRect=function(){return this.rect},o.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},o.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},o.prototype.setRect=function(r,l){this.rect.x=r.x,this.rect.y=r.y,this.rect.width=l.width,this.rect.height=l.height},o.prototype.setCenter=function(r,l){this.rect.x=r-this.rect.width/2,this.rect.y=l-this.rect.height/2},o.prototype.setLocation=function(r,l){this.rect.x=r,this.rect.y=l},o.prototype.moveBy=function(r,l){this.rect.x+=r,this.rect.y+=l},o.prototype.getEdgeListToNode=function(r){var l=[],g=this;return g.edges.forEach(function(f){if(f.target==r){if(f.source!=g)throw"Incorrect edge source!";l.push(f)}}),l},o.prototype.getEdgesBetween=function(r){var l=[],g=this;return g.edges.forEach(function(f){if(!(f.source==g||f.target==g))throw"Incorrect edge source and/or target";(f.target==r||f.source==r)&&l.push(f)}),l},o.prototype.getNeighborsList=function(){var r=new Set,l=this;return l.edges.forEach(function(g){if(g.source==l)r.add(g.target);else{if(g.target!=l)throw"Incorrect incidency!";r.add(g.source)}}),r},o.prototype.withChildren=function(){var r=new Set,l,g;if(r.add(this),this.child!=null)for(var f=this.child.getNodes(),E=0;El&&(this.rect.x-=(this.labelWidth-l)/2,this.setWidth(this.labelWidth)),this.labelHeight>g&&(this.labelPos=="center"?this.rect.y-=(this.labelHeight-g)/2:this.labelPos=="top"&&(this.rect.y-=this.labelHeight-g),this.setHeight(this.labelHeight))}}},o.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==e.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},o.prototype.transform=function(r){var l=this.rect.x;l>i.WORLD_BOUNDARY?l=i.WORLD_BOUNDARY:l<-i.WORLD_BOUNDARY&&(l=-i.WORLD_BOUNDARY);var g=this.rect.y;g>i.WORLD_BOUNDARY?g=i.WORLD_BOUNDARY:g<-i.WORLD_BOUNDARY&&(g=-i.WORLD_BOUNDARY);var f=new a(l,g),E=r.inverseTransformPoint(f);this.setLocation(E.x,E.y)},o.prototype.getLeft=function(){return this.rect.x},o.prototype.getRight=function(){return this.rect.x+this.rect.width},o.prototype.getTop=function(){return this.rect.y},o.prototype.getBottom=function(){return this.rect.y+this.rect.height},o.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},_.exports=o},function(_,L,T){function n(e,t){e==null&&t==null?(this.x=0,this.y=0):(this.x=e,this.y=t)}n.prototype.getX=function(){return this.x},n.prototype.getY=function(){return this.y},n.prototype.setX=function(e){this.x=e},n.prototype.setY=function(e){this.y=e},n.prototype.getDifference=function(e){return new DimensionD(this.x-e.x,this.y-e.y)},n.prototype.getCopy=function(){return new n(this.x,this.y)},n.prototype.translate=function(e){return this.x+=e.width,this.y+=e.height,this},_.exports=n},function(_,L,T){var n=T(2),e=T(10),t=T(0),i=T(6),h=T(3),a=T(1),o=T(13),p=T(12),r=T(11);function l(f,E,y){n.call(this,y),this.estimatedSize=e.MIN_VALUE,this.margin=t.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=f,E!=null&&E instanceof i?this.graphManager=E:E!=null&&E instanceof Layout&&(this.graphManager=E.graphManager)}l.prototype=Object.create(n.prototype);for(var g in n)l[g]=n[g];l.prototype.getNodes=function(){return this.nodes},l.prototype.getEdges=function(){return this.edges},l.prototype.getGraphManager=function(){return this.graphManager},l.prototype.getParent=function(){return this.parent},l.prototype.getLeft=function(){return this.left},l.prototype.getRight=function(){return this.right},l.prototype.getTop=function(){return this.top},l.prototype.getBottom=function(){return this.bottom},l.prototype.isConnected=function(){return this.isConnected},l.prototype.add=function(f,E,y){if(E==null&&y==null){var d=f;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(d)>-1)throw"Node already in graph!";return d.owner=this,this.getNodes().push(d),d}else{var N=f;if(!(this.getNodes().indexOf(E)>-1&&this.getNodes().indexOf(y)>-1))throw"Source or target not in graph!";if(!(E.owner==y.owner&&E.owner==this))throw"Both owners must be this graph!";return E.owner!=y.owner?null:(N.source=E,N.target=y,N.isInterGraph=!1,this.getEdges().push(N),E.edges.push(N),y!=E&&y.edges.push(N),N)}},l.prototype.remove=function(f){var E=f;if(f instanceof h){if(E==null)throw"Node is null!";if(!(E.owner!=null&&E.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var y=E.edges.slice(),d,N=y.length,v=0;v-1&&u>-1))throw"Source and/or target doesn't know this edge!";d.source.edges.splice(s,1),d.target!=d.source&&d.target.edges.splice(u,1);var I=d.source.owner.getEdges().indexOf(d);if(I==-1)throw"Not in owner's edge list!";d.source.owner.getEdges().splice(I,1)}},l.prototype.updateLeftTop=function(){for(var f=e.MAX_VALUE,E=e.MAX_VALUE,y,d,N,v=this.getNodes(),I=v.length,s=0;sy&&(f=y),E>d&&(E=d)}return f==e.MAX_VALUE?null:(v[0].getParent().paddingLeft!=null?N=v[0].getParent().paddingLeft:N=this.margin,this.left=E-N,this.top=f-N,new p(this.left,this.top))},l.prototype.updateBounds=function(f){for(var E=e.MAX_VALUE,y=-e.MAX_VALUE,d=e.MAX_VALUE,N=-e.MAX_VALUE,v,I,s,u,c,A=this.nodes,m=A.length,O=0;Ov&&(E=v),ys&&(d=s),Nv&&(E=v),ys&&(d=s),N=this.nodes.length){var m=0;y.forEach(function(O){O.owner==f&&m++}),m==this.nodes.length&&(this.isConnected=!0)}},_.exports=l},function(_,L,T){var n,e=T(1);function t(i){n=T(5),this.layout=i,this.graphs=[],this.edges=[]}t.prototype.addRoot=function(){var i=this.layout.newGraph(),h=this.layout.newNode(null),a=this.add(i,h);return this.setRootGraph(a),this.rootGraph},t.prototype.add=function(i,h,a,o,p){if(a==null&&o==null&&p==null){if(i==null)throw"Graph is null!";if(h==null)throw"Parent node is null!";if(this.graphs.indexOf(i)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(i),i.parent!=null)throw"Already has a parent!";if(h.child!=null)throw"Already has a child!";return i.parent=h,h.child=i,i}else{p=a,o=h,a=i;var r=o.getOwner(),l=p.getOwner();if(!(r!=null&&r.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(l!=null&&l.getGraphManager()==this))throw"Target not in this graph mgr!";if(r==l)return a.isInterGraph=!1,r.add(a,o,p);if(a.isInterGraph=!0,a.source=o,a.target=p,this.edges.indexOf(a)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(a),!(a.source!=null&&a.target!=null))throw"Edge source and/or target is null!";if(!(a.source.edges.indexOf(a)==-1&&a.target.edges.indexOf(a)==-1))throw"Edge already in source and/or target incidency list!";return a.source.edges.push(a),a.target.edges.push(a),a}},t.prototype.remove=function(i){if(i instanceof n){var h=i;if(h.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(h==this.rootGraph||h.parent!=null&&h.parent.graphManager==this))throw"Invalid parent node!";var a=[];a=a.concat(h.getEdges());for(var o,p=a.length,r=0;r=i.getRight()?h[0]+=Math.min(i.getX()-t.getX(),t.getRight()-i.getRight()):i.getX()<=t.getX()&&i.getRight()>=t.getRight()&&(h[0]+=Math.min(t.getX()-i.getX(),i.getRight()-t.getRight())),t.getY()<=i.getY()&&t.getBottom()>=i.getBottom()?h[1]+=Math.min(i.getY()-t.getY(),t.getBottom()-i.getBottom()):i.getY()<=t.getY()&&i.getBottom()>=t.getBottom()&&(h[1]+=Math.min(t.getY()-i.getY(),i.getBottom()-t.getBottom()));var p=Math.abs((i.getCenterY()-t.getCenterY())/(i.getCenterX()-t.getCenterX()));i.getCenterY()===t.getCenterY()&&i.getCenterX()===t.getCenterX()&&(p=1);var r=p*h[0],l=h[1]/p;h[0]r)return h[0]=a,h[1]=g,h[2]=p,h[3]=A,!1;if(op)return h[0]=l,h[1]=o,h[2]=u,h[3]=r,!1;if(ap?(h[0]=E,h[1]=y,w=!0):(h[0]=f,h[1]=g,w=!0):F===C&&(a>p?(h[0]=l,h[1]=g,w=!0):(h[0]=d,h[1]=y,w=!0)),-b===C?p>a?(h[2]=c,h[3]=A,R=!0):(h[2]=u,h[3]=s,R=!0):b===C&&(p>a?(h[2]=I,h[3]=s,R=!0):(h[2]=m,h[3]=A,R=!0)),w&&R)return!1;if(a>p?o>r?(M=this.getCardinalDirection(F,C,4),G=this.getCardinalDirection(b,C,2)):(M=this.getCardinalDirection(-F,C,3),G=this.getCardinalDirection(-b,C,1)):o>r?(M=this.getCardinalDirection(-F,C,1),G=this.getCardinalDirection(-b,C,3)):(M=this.getCardinalDirection(F,C,2),G=this.getCardinalDirection(b,C,4)),!w)switch(M){case 1:S=g,P=a+-v/C,h[0]=P,h[1]=S;break;case 2:P=d,S=o+N*C,h[0]=P,h[1]=S;break;case 3:S=y,P=a+v/C,h[0]=P,h[1]=S;break;case 4:P=E,S=o+-N*C,h[0]=P,h[1]=S;break}if(!R)switch(G){case 1:Y=s,U=p+-D/C,h[2]=U,h[3]=Y;break;case 2:U=m,Y=r+O*C,h[2]=U,h[3]=Y;break;case 3:Y=A,U=p+D/C,h[2]=U,h[3]=Y;break;case 4:U=c,Y=r+-O*C,h[2]=U,h[3]=Y;break}}return!1},e.getCardinalDirection=function(t,i,h){return t>i?h:1+h%4},e.getIntersection=function(t,i,h,a){if(a==null)return this.getIntersection2(t,i,h);var o=t.x,p=t.y,r=i.x,l=i.y,g=h.x,f=h.y,E=a.x,y=a.y,d=void 0,N=void 0,v=void 0,I=void 0,s=void 0,u=void 0,c=void 0,A=void 0,m=void 0;return v=l-p,s=o-r,c=r*p-o*l,I=y-f,u=g-E,A=E*f-g*y,m=v*u-I*s,m===0?null:(d=(s*A-u*c)/m,N=(I*c-v*A)/m,new n(d,N))},e.angleOfVector=function(t,i,h,a){var o=void 0;return t!==h?(o=Math.atan((a-i)/(h-t)),h0?1:e<0?-1:0},n.floor=function(e){return e<0?Math.ceil(e):Math.floor(e)},n.ceil=function(e){return e<0?Math.floor(e):Math.ceil(e)},_.exports=n},function(_,L,T){function n(){}n.MAX_VALUE=2147483647,n.MIN_VALUE=-2147483648,_.exports=n},function(_,L,T){var n=function(){function o(p,r){for(var l=0;l"u"?"undefined":n(t);return t==null||i!="object"&&i!="function"},_.exports=e},function(_,L,T){function n(g){if(Array.isArray(g)){for(var f=0,E=Array(g.length);f0&&f;){for(v.push(s[0]);v.length>0&&f;){var u=v[0];v.splice(0,1),N.add(u);for(var c=u.getEdges(),d=0;d-1&&s.splice(D,1)}N=new Set,I=new Map}}return g},l.prototype.createDummyNodesForBendpoints=function(g){for(var f=[],E=g.source,y=this.graphManager.calcLowestCommonAncestor(g.source,g.target),d=0;d0){for(var y=this.edgeToDummyNodes.get(E),d=0;d=0&&f.splice(A,1);var m=I.getNeighborsList();m.forEach(function(w){if(E.indexOf(w)<0){var R=y.get(w),F=R-1;F==1&&u.push(w),y.set(w,F)}})}E=E.concat(u),(f.length==1||f.length==2)&&(d=!0,N=f[0])}return N},l.prototype.setGraphManager=function(g){this.graphManager=g},_.exports=l},function(_,L,T){function n(){}n.seed=1,n.x=0,n.nextDouble=function(){return n.x=Math.sin(n.seed++)*1e4,n.x-Math.floor(n.x)},_.exports=n},function(_,L,T){var n=T(4);function e(t,i){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}e.prototype.getWorldOrgX=function(){return this.lworldOrgX},e.prototype.setWorldOrgX=function(t){this.lworldOrgX=t},e.prototype.getWorldOrgY=function(){return this.lworldOrgY},e.prototype.setWorldOrgY=function(t){this.lworldOrgY=t},e.prototype.getWorldExtX=function(){return this.lworldExtX},e.prototype.setWorldExtX=function(t){this.lworldExtX=t},e.prototype.getWorldExtY=function(){return this.lworldExtY},e.prototype.setWorldExtY=function(t){this.lworldExtY=t},e.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},e.prototype.setDeviceOrgX=function(t){this.ldeviceOrgX=t},e.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},e.prototype.setDeviceOrgY=function(t){this.ldeviceOrgY=t},e.prototype.getDeviceExtX=function(){return this.ldeviceExtX},e.prototype.setDeviceExtX=function(t){this.ldeviceExtX=t},e.prototype.getDeviceExtY=function(){return this.ldeviceExtY},e.prototype.setDeviceExtY=function(t){this.ldeviceExtY=t},e.prototype.transformX=function(t){var i=0,h=this.lworldExtX;return h!=0&&(i=this.ldeviceOrgX+(t-this.lworldOrgX)*this.ldeviceExtX/h),i},e.prototype.transformY=function(t){var i=0,h=this.lworldExtY;return h!=0&&(i=this.ldeviceOrgY+(t-this.lworldOrgY)*this.ldeviceExtY/h),i},e.prototype.inverseTransformX=function(t){var i=0,h=this.ldeviceExtX;return h!=0&&(i=this.lworldOrgX+(t-this.ldeviceOrgX)*this.lworldExtX/h),i},e.prototype.inverseTransformY=function(t){var i=0,h=this.ldeviceExtY;return h!=0&&(i=this.lworldOrgY+(t-this.ldeviceOrgY)*this.lworldExtY/h),i},e.prototype.inverseTransformPoint=function(t){var i=new n(this.inverseTransformX(t.x),this.inverseTransformY(t.y));return i},_.exports=e},function(_,L,T){function n(r){if(Array.isArray(r)){for(var l=0,g=Array(r.length);lt.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*t.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(r-t.ADAPTATION_LOWER_NODE_LIMIT)/(t.ADAPTATION_UPPER_NODE_LIMIT-t.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-t.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=t.MAX_NODE_DISPLACEMENT_INCREMENTAL):(r>t.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(t.COOLING_ADAPTATION_FACTOR,1-(r-t.ADAPTATION_LOWER_NODE_LIMIT)/(t.ADAPTATION_UPPER_NODE_LIMIT-t.ADAPTATION_LOWER_NODE_LIMIT)*(1-t.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=t.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},o.prototype.calcSpringForces=function(){for(var r=this.getAllEdges(),l,g=0;g0&&arguments[0]!==void 0?arguments[0]:!0,l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,g,f,E,y,d=this.getAllNodes(),N;if(this.useFRGridVariant)for(this.totalIterations%t.GRID_CALCULATION_CHECK_PERIOD==1&&r&&this.updateGrid(),N=new Set,g=0;gv||N>v)&&(r.gravitationForceX=-this.gravityConstant*E,r.gravitationForceY=-this.gravityConstant*y)):(v=l.getEstimatedSize()*this.compoundGravityRangeFactor,(d>v||N>v)&&(r.gravitationForceX=-this.gravityConstant*E*this.compoundGravityConstant,r.gravitationForceY=-this.gravityConstant*y*this.compoundGravityConstant))},o.prototype.isConverged=function(){var r,l=!1;return this.totalIterations>this.maxIterations/3&&(l=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),r=this.totalDisplacement=d.length||v>=d[0].length)){for(var I=0;Ia}}]),h}();_.exports=i},function(_,L,T){var n=function(){function i(h,a){for(var o=0;o2&&arguments[2]!==void 0?arguments[2]:1,p=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;e(this,i),this.sequence1=h,this.sequence2=a,this.match_score=o,this.mismatch_penalty=p,this.gap_penalty=r,this.iMax=h.length+1,this.jMax=a.length+1,this.grid=new Array(this.iMax);for(var l=0;l=0;h--){var a=this.listeners[h];a.event===t&&a.callback===i&&this.listeners.splice(h,1)}},e.emit=function(t,i){for(var h=0;ha.coolingFactor*a.maxNodeDisplacement&&(this.displacementX=a.coolingFactor*a.maxNodeDisplacement*t.sign(this.displacementX)),Math.abs(this.displacementY)>a.coolingFactor*a.maxNodeDisplacement&&(this.displacementY=a.coolingFactor*a.maxNodeDisplacement*t.sign(this.displacementY)),this.child==null?this.moveBy(this.displacementX,this.displacementY):this.child.getNodes().length==0?this.moveBy(this.displacementX,this.displacementY):this.propogateDisplacementToChildren(this.displacementX,this.displacementY),a.totalDisplacement+=Math.abs(this.displacementX)+Math.abs(this.displacementY),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0},i.prototype.propogateDisplacementToChildren=function(a,o){for(var p=this.getChild().getNodes(),r,l=0;l0)this.positionNodesRadially(c);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var s=new Set(this.getAllNodes()),u=this.nodesWithGravity.filter(function(O){return s.has(O)});this.graphManager.setAllNodesToApplyGravitation(u),this.positionNodesRandomly()}}return this.initSpringEmbedder(),this.runSpringEmbedder(),!0},v.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%p.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()),u=this.nodesWithGravity.filter(function(m){return s.has(m)});this.graphManager.setAllNodesToApplyGravitation(u),this.graphManager.updateBounds(),this.updateGrid(),this.coolingFactor=p.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()),this.coolingFactor=p.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var c=!this.isTreeGrowing&&!this.isGrowthFinished,A=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(c,A),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},v.prototype.getPositionsData=function(){for(var s=this.graphManager.getAllNodes(),u={},c=0;c1){var w;for(w=0;wA&&(A=Math.floor(D.y)),O=Math.floor(D.x+o.DEFAULT_COMPONENT_SEPERATION)}this.transform(new g(r.WORLD_CENTER_X-D.x/2,r.WORLD_CENTER_Y-D.y/2))},v.radialLayout=function(s,u,c){var A=Math.max(this.maxDiagonalInTree(s),o.DEFAULT_RADIAL_SEPARATION);v.branchRadialLayout(u,null,0,359,0,A);var m=d.calculateBounds(s),O=new N;O.setDeviceOrgX(m.getMinX()),O.setDeviceOrgY(m.getMinY()),O.setWorldOrgX(c.x),O.setWorldOrgY(c.y);for(var D=0;D1;){var Y=U[0];U.splice(0,1);var B=C.indexOf(Y);B>=0&&C.splice(B,1),P--,M--}u!=null?S=(C.indexOf(U[0])+1)%P:S=0;for(var H=Math.abs(A-c)/M,k=S;G!=M;k=++k%P){var Z=C[k].getOtherEnd(s);if(Z!=u){var Q=(c+G*H)%360,ht=(Q+H)%360;v.branchRadialLayout(Z,s,Q,ht,m+O,O),G++}}},v.maxDiagonalInTree=function(s){for(var u=E.MIN_VALUE,c=0;cu&&(u=m)}return u},v.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},v.prototype.groupZeroDegreeMembers=function(){var s=this,u={};this.memberGroups={},this.idToDummyNode={};for(var c=[],A=this.graphManager.getAllNodes(),m=0;m"u"&&(u[w]=[]),u[w]=u[w].concat(O)}Object.keys(u).forEach(function(R){if(u[R].length>1){var F="DummyCompound_"+R;s.memberGroups[F]=u[R];var b=u[R][0].getParent(),C=new h(s.graphManager);C.id=F,C.paddingLeft=b.paddingLeft||0,C.paddingRight=b.paddingRight||0,C.paddingBottom=b.paddingBottom||0,C.paddingTop=b.paddingTop||0,s.idToDummyNode[F]=C;var M=s.getGraphManager().add(s.newGraph(),C),G=b.getChild();G.add(C);for(var P=0;P=0;s--){var u=this.compoundOrder[s],c=u.id,A=u.paddingLeft,m=u.paddingTop;this.adjustLocations(this.tiledMemberPack[c],u.rect.x,u.rect.y,A,m)}},v.prototype.repopulateZeroDegreeMembers=function(){var s=this,u=this.tiledZeroDegreePack;Object.keys(u).forEach(function(c){var A=s.idToDummyNode[c],m=A.paddingLeft,O=A.paddingTop;s.adjustLocations(u[c],A.rect.x,A.rect.y,m,O)})},v.prototype.getToBeTiled=function(s){var u=s.id;if(this.toBeTiled[u]!=null)return this.toBeTiled[u];var c=s.getChild();if(c==null)return this.toBeTiled[u]=!1,!1;for(var A=c.getNodes(),m=0;m0)return this.toBeTiled[u]=!1,!1;if(O.getChild()==null){this.toBeTiled[O.id]=!1;continue}if(!this.getToBeTiled(O))return this.toBeTiled[u]=!1,!1}return this.toBeTiled[u]=!0,!0},v.prototype.getNodeDegree=function(s){s.id;for(var u=s.getEdges(),c=0,A=0;AR&&(R=b.rect.height)}c+=R+s.verticalPadding}},v.prototype.tileCompoundMembers=function(s,u){var c=this;this.tiledMemberPack=[],Object.keys(s).forEach(function(A){var m=u[A];c.tiledMemberPack[A]=c.tileNodes(s[A],m.paddingLeft+m.paddingRight),m.rect.width=c.tiledMemberPack[A].width,m.rect.height=c.tiledMemberPack[A].height})},v.prototype.tileNodes=function(s,u){var c=o.TILING_PADDING_VERTICAL,A=o.TILING_PADDING_HORIZONTAL,m={rows:[],rowWidth:[],rowHeight:[],width:0,height:u,verticalPadding:c,horizontalPadding:A};s.sort(function(w,R){return w.rect.width*w.rect.height>R.rect.width*R.rect.height?-1:w.rect.width*w.rect.height0&&(D+=s.horizontalPadding),s.rowWidth[c]=D,s.width0&&(w+=s.verticalPadding);var R=0;w>s.rowHeight[c]&&(R=s.rowHeight[c],s.rowHeight[c]=w,R=s.rowHeight[c]-R),s.height+=R,s.rows[c].push(u)},v.prototype.getShortestRowIndex=function(s){for(var u=-1,c=Number.MAX_VALUE,A=0;Ac&&(u=A,c=s.rowWidth[A]);return u},v.prototype.canAddHorizontal=function(s,u,c){var A=this.getShortestRowIndex(s);if(A<0)return!0;var m=s.rowWidth[A];if(m+s.horizontalPadding+u<=s.width)return!0;var O=0;s.rowHeight[A]0&&(O=c+s.verticalPadding-s.rowHeight[A]);var D;s.width-m>=u+s.horizontalPadding?D=(s.height+O)/(m+u+s.horizontalPadding):D=(s.height+O)/s.width,O=c+s.verticalPadding;var w;return s.widthO&&u!=c){A.splice(-1,1),s.rows[c].push(m),s.rowWidth[u]=s.rowWidth[u]-O,s.rowWidth[c]=s.rowWidth[c]+O,s.width=s.rowWidth[instance.getLongestRowIndex(s)];for(var D=Number.MIN_VALUE,w=0;wD&&(D=A[w].height);u>0&&(D+=s.verticalPadding);var R=s.rowHeight[u]+s.rowHeight[c];s.rowHeight[u]=D,s.rowHeight[c]0)for(var G=m;G<=O;G++)M[0]+=this.grid[G][D-1].length+this.grid[G][D].length-1;if(O0)for(var G=D;G<=w;G++)M[3]+=this.grid[m-1][G].length+this.grid[m][G].length-1;for(var P=E.MAX_VALUE,S,U,Y=0;Y0){var w;w=N.getGraphManager().add(N.newGraph(),c),this.processChildrenList(w,u,N)}}},g.prototype.stop=function(){return this.stopped=!0,this};var E=function(y){y("layout","cose-bilkent",g)};typeof cytoscape<"u"&&E(cytoscape),L.exports=E}])})}(j)),j.exports}var Et=yt();const vt=lt(Et);tt.use(vt);function et(x,X){x.forEach(_=>{const L={id:_.id,labelText:_.label,height:_.height,width:_.width,padding:_.padding??0};Object.keys(_).forEach(T=>{["id","label","height","width","padding","x","y"].includes(T)||(L[T]=_[T])}),X.add({group:"nodes",data:L,position:{x:_.x??0,y:_.y??0}})})}W(et,"addNodes");function it(x,X){x.forEach(_=>{const L={id:_.id,source:_.start,target:_.end};Object.keys(_).forEach(T=>{["id","start","end"].includes(T)||(L[T]=_[T])}),X.add({group:"edges",data:L})})}W(it,"addEdges");function rt(x){return new Promise(X=>{const _=gt("body").append("div").attr("id","cy").attr("style","display:none"),L=tt({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"bezier"}}]});_.remove(),et(x.nodes,L),it(x.edges,L),L.nodes().forEach(function(n){n.layoutDimensions=()=>{const e=n.data();return{w:e.width,h:e.height}}});const T={name:"cose-bilkent",quality:"proof",styleEnabled:!1,animate:!1};L.layout(T).run(),L.ready(n=>{V.info("Cytoscape ready",n),X(L)})})}W(rt,"createCytoscapeInstance");function nt(x){return x.nodes().map(X=>{const _=X.data(),L=X.position(),T={id:_.id,x:L.x,y:L.y};return Object.keys(_).forEach(n=>{n!=="id"&&(T[n]=_[n])}),T})}W(nt,"extractPositionedNodes");function ot(x){return x.edges().map(X=>{const _=X.data(),L=X._private.rscratch,T={id:_.id,source:_.source,target:_.target,startX:L.startX,startY:L.startY,midX:L.midX,midY:L.midY,endX:L.endX,endY:L.endY};return Object.keys(_).forEach(n=>{["id","source","target"].includes(n)||(T[n]=_[n])}),T})}W(ot,"extractPositionedEdges");async function st(x,X){V.debug("Starting cose-bilkent layout algorithm");try{at(x);const _=await rt(x),L=nt(_),T=ot(_);return V.debug(`Layout completed: ${L.length} nodes, ${T.length} edges`),{nodes:L,edges:T}}catch(_){throw V.error("Error in cose-bilkent layout algorithm:",_),_}}W(st,"executeCoseBilkentLayout");function at(x){if(!x)throw new Error("Layout data is required");if(!x.config)throw new Error("Configuration is required in layout data");if(!x.rootNode)throw new Error("Root node is required");if(!x.nodes||!Array.isArray(x.nodes))throw new Error("No nodes found in layout data");if(!Array.isArray(x.edges))throw new Error("Edges array is required in layout data");return!0}W(at,"validateLayoutData");var At=W(async(x,X,{insertCluster:_,insertEdge:L,insertEdgeLabel:T,insertMarkers:n,insertNode:e,log:t,positionEdgeLabel:i},{algorithm:h})=>{const a={},o={},p=X.select("g");n(p,x.markers,x.type,x.diagramId);const r=p.insert("g").attr("class","subgraphs"),l=p.insert("g").attr("class","edgePaths"),g=p.insert("g").attr("class","edgeLabels"),f=p.insert("g").attr("class","nodes");t.debug("Inserting nodes into DOM for dimension calculation"),await Promise.all(x.nodes.map(async d=>{if(d.isGroup){const N={...d};o[d.id]=N,a[d.id]=N,await _(r,d)}else{const N={...d};a[d.id]=N;const v=await e(f,d,{config:x.config,dir:x.direction||"TB"}),I=v.node().getBBox();N.width=I.width,N.height=I.height,N.domId=v,t.debug(`Node ${d.id} dimensions: ${I.width}x${I.height}`)}})),t.debug("Running cose-bilkent layout algorithm");const E={...x,nodes:x.nodes.map(d=>{const N=a[d.id];return{...d,width:N.width,height:N.height}})},y=await st(E,x.config);t.debug("Positioning nodes based on layout results"),y.nodes.forEach(d=>{const N=a[d.id];N?.domId&&(N.domId.attr("transform",`translate(${d.x}, ${d.y})`),N.x=d.x,N.y=d.y,t.debug(`Positioned node ${N.id} at center (${d.x}, ${d.y})`))}),y.edges.forEach(d=>{const N=x.edges.find(v=>v.id===d.id);N&&(N.points=[{x:d.startX,y:d.startY},{x:d.midX,y:d.midY},{x:d.endX,y:d.endY}])}),t.debug("Inserting and positioning edges"),await Promise.all(x.edges.map(async d=>{await T(g,d);const N=a[d.start??""],v=a[d.end??""];if(N&&v){const I=y.edges.find(s=>s.id===d.id);if(I){t.debug("APA01 positionedEdge",I);const s={...d},u=L(l,s,o,x.type,N,v,x.diagramId);i(s,u)}else{const s={...d,points:[{x:N.x||0,y:N.y||0},{x:v.x||0,y:v.y||0}]},u=L(l,s,o,x.type,N,v,x.diagramId);i(s,u)}}})),t.debug("Cose-bilkent rendering completed")},"render"),Dt=At;export{Dt as render}; //# sourceMappingURL=cose-bilkent-S5V4N54A-CYsBAjQW.chunk.mjs.map