UNPKG

@zsviczian/excalidraw

Version:
2 lines 8.94 MB
/*! For license information please see excalidraw.production.min.js.LICENSE.txt */ !function(e,A){"object"==typeof exports&&"object"==typeof module?module.exports=A(require("react"),require("react-dom"),require("react/jsx-runtime")):"function"==typeof define&&define.amd?define(["react","react-dom","react/jsx-runtime"],A):"object"==typeof exports?exports.ExcalidrawLib=A(require("react"),require("react-dom"),require("react/jsx-runtime")):e.ExcalidrawLib=A(e.React,e.ReactDOM,e.React.jsxRuntime)}(self,(e,A,t)=>(()=>{var i,n,r={8041(e,A){"use strict";A.J=void 0;var t=/^([^\w]*)(javascript|data|vbscript)/im,i=/&#(\w+)(^\w|;)?/g,n=/&(newline|tab);/gi,r=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,a=/^.+(:|&colon;)/gim,o=[".","/"];A.J=function(e){var A,s=(A=e||"",A.replace(i,function(e,A){return String.fromCharCode(A)})).replace(n,"").replace(r,"").trim();if(!s)return"about:blank";if(function(e){return o.indexOf(e[0])>-1}(s))return s;var l=s.match(a);if(!l)return s;var g=l[0];return t.test(g)?"about:blank":s}},5965(e,A){"use strict";A.k=void 0;A.k=function(e,A){void 0===A&&(A={listUnicodeChar:""}),(A=A||{}).listUnicodeChar=!!A.hasOwnProperty("listUnicodeChar")&&A.listUnicodeChar,A.stripListLeaders=!A.hasOwnProperty("stripListLeaders")||A.stripListLeaders,A.gfm=!A.hasOwnProperty("gfm")||A.gfm,A.useImgAltText=!A.hasOwnProperty("useImgAltText")||A.useImgAltText,A.preserveLinks=!!A.hasOwnProperty("preserveLinks")&&A.preserveLinks;var t=e||"";t=t.replace(/^(-\s*?|\*\s*?|_\s*?){3,}\s*$/gm,"");try{A.stripListLeaders&&(t=A.listUnicodeChar?t.replace(/^([\s\t]*)([\*\-\+]|\d+\.)\s+/gm,A.listUnicodeChar+" $1"):t.replace(/^([\s\t]*)([\*\-\+]|\d+\.)\s+/gm,"$1")),A.gfm&&(t=t.replace(/\n={2,}/g,"\n").replace(/~{3}.*\n/g,"").replace(/~~/g,"").replace(/`{3}.*\n/g,"")),A.preserveLinks&&(t=t.replace(/\[(.*?)\][\[\(](.*?)[\]\)]/g,"$1 ($2)")),t=t.replace(/<[^>]*>/g,"").replace(/^[=\-]{2,}\s*$/g,"").replace(/\[\^.+?\](\: .*?$)?/g,"").replace(/\s{0,2}\[.*?\]: .*?$/g,"").replace(/\!\[(.*?)\][\[\(].*?[\]\)]/g,A.useImgAltText?"$1":"").replace(/\[(.*?)\][\[\(].*?[\]\)]/g,"$1").replace(/^\s{0,3}>\s?/g,"").replace(/(^|\n)\s{0,3}>\s?/g,"\n\n").replace(/^\s{1,2}\[(.*?)\]: (\S+)( ".*?")?\s*$/g,"").replace(/^(\n)?\s{0,}#{1,6}\s+| {0,}(\n)?\s{0,}#{0,} {0,}(\n)?\s{0,}$/gm,"$1$2$3").replace(/([\*_]{1,3})(\S.*?\S{0,1})\1/g,"$2").replace(/([\*_]{1,3})(\S.*?\S{0,1})\1/g,"$2").replace(/(`{3,})(.*?)\1/gm,"$2").replace(/`(.+?)`/g,"$1").replace(/\n{2,}/g,"\n\n")}catch(A){return console.error(A),e}return t}},40110(e,A,t){var i;i=function(e){return function(e){var A={};function t(i){if(A[i])return A[i].exports;var n=A[i]={i,l:!1,exports:{}};return e[i].call(n.exports,n,n.exports,t),n.l=!0,n.exports}return t.m=e,t.c=A,t.i=function(e){return e},t.d=function(e,A,i){t.o(e,A)||Object.defineProperty(e,A,{configurable:!1,enumerable:!0,get:i})},t.n=function(e){var A=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(A,"a",A),A},t.o=function(e,A){return Object.prototype.hasOwnProperty.call(e,A)},t.p="",t(t.s=7)}([function(A,t){A.exports=e},function(e,A,t){"use strict";var i=t(0).FDLayoutConstants;function n(){}for(var r in i)n[r]=i[r];n.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,n.DEFAULT_RADIAL_SEPARATION=i.DEFAULT_EDGE_LENGTH,n.DEFAULT_COMPONENT_SEPERATION=60,n.TILE=!0,n.TILING_PADDING_VERTICAL=10,n.TILING_PADDING_HORIZONTAL=10,n.TREE_REDUCTION_ON_INCREMENTAL=!1,e.exports=n},function(e,A,t){"use strict";var i=t(0).FDLayoutEdge;function n(e,A,t){i.call(this,e,A,t)}for(var r in n.prototype=Object.create(i.prototype),i)n[r]=i[r];e.exports=n},function(e,A,t){"use strict";var i=t(0).LGraph;function n(e,A,t){i.call(this,e,A,t)}for(var r in n.prototype=Object.create(i.prototype),i)n[r]=i[r];e.exports=n},function(e,A,t){"use strict";var i=t(0).LGraphManager;function n(e){i.call(this,e)}for(var r in n.prototype=Object.create(i.prototype),i)n[r]=i[r];e.exports=n},function(e,A,t){"use strict";var i=t(0).FDLayoutNode,n=t(0).IMath;function r(e,A,t,n){i.call(this,e,A,t,n)}for(var a in r.prototype=Object.create(i.prototype),i)r[a]=i[a];r.prototype.move=function(){var e=this.graphManager.getLayout();this.displacementX=e.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY=e.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren,Math.abs(this.displacementX)>e.coolingFactor*e.maxNodeDisplacement&&(this.displacementX=e.coolingFactor*e.maxNodeDisplacement*n.sign(this.displacementX)),Math.abs(this.displacementY)>e.coolingFactor*e.maxNodeDisplacement&&(this.displacementY=e.coolingFactor*e.maxNodeDisplacement*n.sign(this.displacementY)),null==this.child||0==this.child.getNodes().length?this.moveBy(this.displacementX,this.displacementY):this.propogateDisplacementToChildren(this.displacementX,this.displacementY),e.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},r.prototype.propogateDisplacementToChildren=function(e,A){for(var t,i=this.getChild().getNodes(),n=0;n<i.length;n++)null==(t=i[n]).getChild()?(t.moveBy(e,A),t.displacementX+=e,t.displacementY+=A):t.propogateDisplacementToChildren(e,A)},r.prototype.setPred1=function(e){this.pred1=e},r.prototype.getPred1=function(){return pred1},r.prototype.getPred2=function(){return pred2},r.prototype.setNext=function(e){this.next=e},r.prototype.getNext=function(){return next},r.prototype.setProcessed=function(e){this.processed=e},r.prototype.isProcessed=function(){return processed},e.exports=r},function(e,A,t){"use strict";var i=t(0).FDLayout,n=t(4),r=t(3),a=t(5),o=t(2),s=t(1),l=t(0).FDLayoutConstants,g=t(0).LayoutConstants,c=t(0).Point,d=t(0).PointD,h=t(0).Layout,C=t(0).Integer,I=t(0).IGeometry,u=t(0).LGraph,B=t(0).Transform;function E(){i.call(this),this.toBeTiled={}}for(var Q in E.prototype=Object.create(i.prototype),i)E[Q]=i[Q];E.prototype.newGraphManager=function(){var e=new n(this);return this.graphManager=e,e},E.prototype.newGraph=function(e){return new r(null,this.graphManager,e)},E.prototype.newNode=function(e){return new a(this.graphManager,e)},E.prototype.newEdge=function(e){return new o(null,null,e)},E.prototype.initParameters=function(){i.prototype.initParameters.call(this,arguments),this.isSubLayout||(s.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=s.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=s.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.springConstant=l.DEFAULT_SPRING_STRENGTH,this.repulsionConstant=l.DEFAULT_REPULSION_STRENGTH,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,this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/l.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=l.CONVERGENCE_CHECK_PERIOD/this.maxIterations,this.coolingAdjuster=1)},E.prototype.layout=function(){return g.DEFAULT_CREATE_BENDS_AS_NEEDED&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},E.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)s.TREE_REDUCTION_ON_INCREMENTAL&&(this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation(),A=new Set(this.getAllNodes()),t=this.nodesWithGravity.filter(function(e){return A.has(e)}),this.graphManager.setAllNodesToApplyGravitation(t));else{var e=this.getFlatForest();if(e.length>0)this.positionNodesRadially(e);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var A=new Set(this.getAllNodes()),t=this.nodesWithGravity.filter(function(e){return A.has(e)});this.graphManager.setAllNodesToApplyGravitation(t),this.positionNodesRandomly()}}return this.initSpringEmbedder(),this.runSpringEmbedder(),!0},E.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished){if(!(this.prunedNodesAll.length>0))return!0;this.isTreeGrowing=!0}if(this.totalIterations%l.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged()){if(!(this.prunedNodesAll.length>0))return!0;this.isTreeGrowing=!0}this.coolingCycle++,0==this.layoutQuality?this.coolingAdjuster=this.coolingCycle:1==this.layoutQuality&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var e=new Set(this.getAllNodes()),A=this.nodesWithGravity.filter(function(A){return e.has(A)});this.graphManager.setAllNodesToApplyGravitation(A),this.graphManager.updateBounds(),this.updateGrid(),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()),this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var t=!this.isTreeGrowing&&!this.isGrowthFinished,i=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(t,i),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},E.prototype.getPositionsData=function(){for(var e=this.graphManager.getAllNodes(),A={},t=0;t<e.length;t++){var i=e[t].rect,n=e[t].id;A[n]={id:n,x:i.getCenterX(),y:i.getCenterY(),w:i.width,h:i.height}}return A},E.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var e=!1;if("during"===l.ANIMATE)this.emit("layoutstarted");else{for(;!e;)e=this.tick();this.graphManager.updateBounds()}},E.prototype.calculateNodesToApplyGravitationTo=function(){var e,A,t=[],i=this.graphManager.getGraphs(),n=i.length;for(A=0;A<n;A++)(e=i[A]).updateConnected(),e.isConnected||(t=t.concat(e.getNodes()));return t},E.prototype.createBendpoints=function(){var e=[];e=e.concat(this.graphManager.getAllEdges());var A,t=new Set;for(A=0;A<e.length;A++){var i=e[A];if(!t.has(i)){var n=i.getSource(),r=i.getTarget();if(n==r)i.getBendpoints().push(new d),i.getBendpoints().push(new d),this.createDummyNodesForBendpoints(i),t.add(i);else{var a=[];if(a=(a=a.concat(n.getEdgeListToNode(r))).concat(r.getEdgeListToNode(n)),!t.has(a[0])){var o;if(a.length>1)for(o=0;o<a.length;o++){var s=a[o];s.getBendpoints().push(new d),this.createDummyNodesForBendpoints(s)}a.forEach(function(e){t.add(e)})}}}if(t.size==e.length)break}},E.prototype.positionNodesRadially=function(e){for(var A=new c(0,0),t=Math.ceil(Math.sqrt(e.length)),i=0,n=0,r=0,a=new d(0,0),o=0;o<e.length;o++){o%t==0&&(r=0,n=i,0!=o&&(n+=s.DEFAULT_COMPONENT_SEPERATION),i=0);var l=e[o],C=h.findCenterOfTree(l);A.x=r,A.y=n,(a=E.radialLayout(l,C,A)).y>i&&(i=Math.floor(a.y)),r=Math.floor(a.x+s.DEFAULT_COMPONENT_SEPERATION)}this.transform(new d(g.WORLD_CENTER_X-a.x/2,g.WORLD_CENTER_Y-a.y/2))},E.radialLayout=function(e,A,t){var i=Math.max(this.maxDiagonalInTree(e),s.DEFAULT_RADIAL_SEPARATION);E.branchRadialLayout(A,null,0,359,0,i);var n=u.calculateBounds(e),r=new B;r.setDeviceOrgX(n.getMinX()),r.setDeviceOrgY(n.getMinY()),r.setWorldOrgX(t.x),r.setWorldOrgY(t.y);for(var a=0;a<e.length;a++)e[a].transform(r);var o=new d(n.getMaxX(),n.getMaxY());return r.inverseTransformPoint(o)},E.branchRadialLayout=function(e,A,t,i,n,r){var a=(i-t+1)/2;a<0&&(a+=180);var o=(a+t)%360*I.TWO_PI/360,s=(Math.cos(o),n*Math.cos(o)),l=n*Math.sin(o);e.setCenter(s,l);var g=[],c=(g=g.concat(e.getEdges())).length;null!=A&&c--;for(var d,h=0,C=g.length,u=e.getEdgesBetween(A);u.length>1;){var B=u[0];u.splice(0,1);var Q=g.indexOf(B);Q>=0&&g.splice(Q,1),C--,c--}d=null!=A?(g.indexOf(u[0])+1)%C:0;for(var p=Math.abs(i-t)/c,m=d;h!=c;m=++m%C){var f=g[m].getOtherEnd(e);if(f!=A){var y=(t+h*p)%360,w=(y+p)%360;E.branchRadialLayout(f,e,y,w,n+r,r),h++}}},E.maxDiagonalInTree=function(e){for(var A=C.MIN_VALUE,t=0;t<e.length;t++){var i=e[t].getDiagonal();i>A&&(A=i)}return A},E.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},E.prototype.groupZeroDegreeMembers=function(){var e=this,A={};this.memberGroups={},this.idToDummyNode={};for(var t=[],i=this.graphManager.getAllNodes(),n=0;n<i.length;n++){var r=(o=i[n]).getParent();0!==this.getNodeDegreeWithChildren(o)||null!=r.id&&this.getToBeTiled(r)||t.push(o)}for(n=0;n<t.length;n++){var o,s=(o=t[n]).getParent().id;void 0===A[s]&&(A[s]=[]),A[s]=A[s].concat(o)}Object.keys(A).forEach(function(t){if(A[t].length>1){var i="DummyCompound_"+t;e.memberGroups[i]=A[t];var n=A[t][0].getParent(),r=new a(e.graphManager);r.id=i,r.paddingLeft=n.paddingLeft||0,r.paddingRight=n.paddingRight||0,r.paddingBottom=n.paddingBottom||0,r.paddingTop=n.paddingTop||0,e.idToDummyNode[i]=r;var o=e.getGraphManager().add(e.newGraph(),r),s=n.getChild();s.add(r);for(var l=0;l<A[t].length;l++){var g=A[t][l];s.remove(g),o.add(g)}}})},E.prototype.clearCompounds=function(){var e={},A={};this.performDFSOnCompounds();for(var t=0;t<this.compoundOrder.length;t++)A[this.compoundOrder[t].id]=this.compoundOrder[t],e[this.compoundOrder[t].id]=[].concat(this.compoundOrder[t].getChild().getNodes()),this.graphManager.remove(this.compoundOrder[t].getChild()),this.compoundOrder[t].child=null;this.graphManager.resetAllNodes(),this.tileCompoundMembers(e,A)},E.prototype.clearZeroDegreeMembers=function(){var e=this,A=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach(function(t){var i=e.idToDummyNode[t];A[t]=e.tileNodes(e.memberGroups[t],i.paddingLeft+i.paddingRight),i.rect.width=A[t].width,i.rect.height=A[t].height})},E.prototype.repopulateCompounds=function(){for(var e=this.compoundOrder.length-1;e>=0;e--){var A=this.compoundOrder[e],t=A.id,i=A.paddingLeft,n=A.paddingTop;this.adjustLocations(this.tiledMemberPack[t],A.rect.x,A.rect.y,i,n)}},E.prototype.repopulateZeroDegreeMembers=function(){var e=this,A=this.tiledZeroDegreePack;Object.keys(A).forEach(function(t){var i=e.idToDummyNode[t],n=i.paddingLeft,r=i.paddingTop;e.adjustLocations(A[t],i.rect.x,i.rect.y,n,r)})},E.prototype.getToBeTiled=function(e){var A=e.id;if(null!=this.toBeTiled[A])return this.toBeTiled[A];var t=e.getChild();if(null==t)return this.toBeTiled[A]=!1,!1;for(var i=t.getNodes(),n=0;n<i.length;n++){var r=i[n];if(this.getNodeDegree(r)>0)return this.toBeTiled[A]=!1,!1;if(null!=r.getChild()){if(!this.getToBeTiled(r))return this.toBeTiled[A]=!1,!1}else this.toBeTiled[r.id]=!1}return this.toBeTiled[A]=!0,!0},E.prototype.getNodeDegree=function(e){e.id;for(var A=e.getEdges(),t=0,i=0;i<A.length;i++){var n=A[i];n.getSource().id!==n.getTarget().id&&(t+=1)}return t},E.prototype.getNodeDegreeWithChildren=function(e){var A=this.getNodeDegree(e);if(null==e.getChild())return A;for(var t=e.getChild().getNodes(),i=0;i<t.length;i++){var n=t[i];A+=this.getNodeDegreeWithChildren(n)}return A},E.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},E.prototype.fillCompexOrderByDFS=function(e){for(var A=0;A<e.length;A++){var t=e[A];null!=t.getChild()&&this.fillCompexOrderByDFS(t.getChild().getNodes()),this.getToBeTiled(t)&&this.compoundOrder.push(t)}},E.prototype.adjustLocations=function(e,A,t,i,n){t+=n;for(var r=A+=i,a=0;a<e.rows.length;a++){var o=e.rows[a];A=r;for(var s=0,l=0;l<o.length;l++){var g=o[l];g.rect.x=A,g.rect.y=t,A+=g.rect.width+e.horizontalPadding,g.rect.height>s&&(s=g.rect.height)}t+=s+e.verticalPadding}},E.prototype.tileCompoundMembers=function(e,A){var t=this;this.tiledMemberPack=[],Object.keys(e).forEach(function(i){var n=A[i];t.tiledMemberPack[i]=t.tileNodes(e[i],n.paddingLeft+n.paddingRight),n.rect.width=t.tiledMemberPack[i].width,n.rect.height=t.tiledMemberPack[i].height})},E.prototype.tileNodes=function(e,A){var t={rows:[],rowWidth:[],rowHeight:[],width:0,height:A,verticalPadding:s.TILING_PADDING_VERTICAL,horizontalPadding:s.TILING_PADDING_HORIZONTAL};e.sort(function(e,A){return e.rect.width*e.rect.height>A.rect.width*A.rect.height?-1:e.rect.width*e.rect.height<A.rect.width*A.rect.height?1:0});for(var i=0;i<e.length;i++){var n=e[i];0==t.rows.length?this.insertNodeToRow(t,n,0,A):this.canAddHorizontal(t,n.rect.width,n.rect.height)?this.insertNodeToRow(t,n,this.getShortestRowIndex(t),A):this.insertNodeToRow(t,n,t.rows.length,A),this.shiftToLastRow(t)}return t},E.prototype.insertNodeToRow=function(e,A,t,i){var n=i;t==e.rows.length&&(e.rows.push([]),e.rowWidth.push(n),e.rowHeight.push(0));var r=e.rowWidth[t]+A.rect.width;e.rows[t].length>0&&(r+=e.horizontalPadding),e.rowWidth[t]=r,e.width<r&&(e.width=r);var a=A.rect.height;t>0&&(a+=e.verticalPadding);var o=0;a>e.rowHeight[t]&&(o=e.rowHeight[t],e.rowHeight[t]=a,o=e.rowHeight[t]-o),e.height+=o,e.rows[t].push(A)},E.prototype.getShortestRowIndex=function(e){for(var A=-1,t=Number.MAX_VALUE,i=0;i<e.rows.length;i++)e.rowWidth[i]<t&&(A=i,t=e.rowWidth[i]);return A},E.prototype.getLongestRowIndex=function(e){for(var A=-1,t=Number.MIN_VALUE,i=0;i<e.rows.length;i++)e.rowWidth[i]>t&&(A=i,t=e.rowWidth[i]);return A},E.prototype.canAddHorizontal=function(e,A,t){var i=this.getShortestRowIndex(e);if(i<0)return!0;var n=e.rowWidth[i];if(n+e.horizontalPadding+A<=e.width)return!0;var r,a,o=0;return e.rowHeight[i]<t&&i>0&&(o=t+e.verticalPadding-e.rowHeight[i]),r=e.width-n>=A+e.horizontalPadding?(e.height+o)/(n+A+e.horizontalPadding):(e.height+o)/e.width,o=t+e.verticalPadding,(a=e.width<A?(e.height+o)/A:(e.height+o)/e.width)<1&&(a=1/a),r<1&&(r=1/r),r<a},E.prototype.shiftToLastRow=function(e){var A=this.getLongestRowIndex(e),t=e.rowWidth.length-1,i=e.rows[A],n=i[i.length-1],r=n.width+e.horizontalPadding;if(e.width-e.rowWidth[t]>r&&A!=t){i.splice(-1,1),e.rows[t].push(n),e.rowWidth[A]=e.rowWidth[A]-r,e.rowWidth[t]=e.rowWidth[t]+r,e.width=e.rowWidth[instance.getLongestRowIndex(e)];for(var a=Number.MIN_VALUE,o=0;o<i.length;o++)i[o].height>a&&(a=i[o].height);A>0&&(a+=e.verticalPadding);var s=e.rowHeight[A]+e.rowHeight[t];e.rowHeight[A]=a,e.rowHeight[t]<n.height+e.verticalPadding&&(e.rowHeight[t]=n.height+e.verticalPadding);var l=e.rowHeight[A]+e.rowHeight[t];e.height+=l-s,this.shiftToLastRow(e)}},E.prototype.tilingPreLayout=function(){s.TILE&&(this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers())},E.prototype.tilingPostLayout=function(){s.TILE&&(this.repopulateZeroDegreeMembers(),this.repopulateCompounds())},E.prototype.reduceTrees=function(){for(var e,A=[],t=!0;t;){var i=this.graphManager.getAllNodes(),n=[];t=!1;for(var r=0;r<i.length;r++)1!=(e=i[r]).getEdges().length||e.getEdges()[0].isInterGraph||null!=e.getChild()||(n.push([e,e.getEdges()[0],e.getOwner()]),t=!0);if(1==t){for(var a=[],o=0;o<n.length;o++)1==n[o][0].getEdges().length&&(a.push(n[o]),n[o][0].getOwner().remove(n[o][0]));A.push(a),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=A},E.prototype.growTree=function(e){for(var A,t=e[e.length-1],i=0;i<t.length;i++)A=t[i],this.findPlaceforPrunedNode(A),A[2].add(A[0]),A[2].add(A[1],A[1].source,A[1].target);e.splice(e.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},E.prototype.findPlaceforPrunedNode=function(e){var A,t,i=e[0],n=(t=i==e[1].source?e[1].target:e[1].source).startX,r=t.finishX,a=t.startY,o=t.finishY,s=[0,0,0,0];if(a>0)for(var g=n;g<=r;g++)s[0]+=this.grid[g][a-1].length+this.grid[g][a].length-1;if(r<this.grid.length-1)for(g=a;g<=o;g++)s[1]+=this.grid[r+1][g].length+this.grid[r][g].length-1;if(o<this.grid[0].length-1)for(g=n;g<=r;g++)s[2]+=this.grid[g][o+1].length+this.grid[g][o].length-1;if(n>0)for(g=a;g<=o;g++)s[3]+=this.grid[n-1][g].length+this.grid[n][g].length-1;for(var c,d,h=C.MAX_VALUE,I=0;I<s.length;I++)s[I]<h?(h=s[I],c=1,d=I):s[I]==h&&c++;if(3==c&&0==h)0==s[0]&&0==s[1]&&0==s[2]?A=1:0==s[0]&&0==s[1]&&0==s[3]?A=0:0==s[0]&&0==s[2]&&0==s[3]?A=3:0==s[1]&&0==s[2]&&0==s[3]&&(A=2);else if(2==c&&0==h){var u=Math.floor(2*Math.random());A=0==s[0]&&0==s[1]?0==u?0:1:0==s[0]&&0==s[2]?0==u?0:2:0==s[0]&&0==s[3]?0==u?0:3:0==s[1]&&0==s[2]?0==u?1:2:0==s[1]&&0==s[3]?0==u?1:3:0==u?2:3}else A=4==c&&0==h?u=Math.floor(4*Math.random()):d;0==A?i.setCenter(t.getCenterX(),t.getCenterY()-t.getHeight()/2-l.DEFAULT_EDGE_LENGTH-i.getHeight()/2):1==A?i.setCenter(t.getCenterX()+t.getWidth()/2+l.DEFAULT_EDGE_LENGTH+i.getWidth()/2,t.getCenterY()):2==A?i.setCenter(t.getCenterX(),t.getCenterY()+t.getHeight()/2+l.DEFAULT_EDGE_LENGTH+i.getHeight()/2):i.setCenter(t.getCenterX()-t.getWidth()/2-l.DEFAULT_EDGE_LENGTH-i.getWidth()/2,t.getCenterY())},e.exports=E},function(e,A,t){"use strict";var i={};i.layoutBase=t(0),i.CoSEConstants=t(1),i.CoSEEdge=t(2),i.CoSEGraph=t(3),i.CoSEGraphManager=t(4),i.CoSELayout=t(6),i.CoSENode=t(5),e.exports=i}])},e.exports=i(t(14894))},637(e,A){var t;t=function(e){e.version="0.3.0";var A=function(){for(var e=0,A=new Array(256),t=0;256!=t;++t)e=1&(e=1&(e=1&(e=1&(e=1&(e=1&(e=1&(e=1&(e=t)?-306674912^e>>>1:e>>>1)?-306674912^e>>>1:e>>>1)?-306674912^e>>>1:e>>>1)?-306674912^e>>>1:e>>>1)?-306674912^e>>>1:e>>>1)?-306674912^e>>>1:e>>>1)?-306674912^e>>>1:e>>>1)?-306674912^e>>>1:e>>>1,A[t]=e;return"undefined"!=typeof Int32Array?new Int32Array(A):A}(),t="undefined"!=typeof Buffer;function i(e){for(var t=-1,i=0,n=e.length-7;i<n;)t=(t=(t=(t=(t=(t=(t=(t=t>>>8^A[255&(t^e[i++])])>>>8^A[255&(t^e[i++])])>>>8^A[255&(t^e[i++])])>>>8^A[255&(t^e[i++])])>>>8^A[255&(t^e[i++])])>>>8^A[255&(t^e[i++])])>>>8^A[255&(t^e[i++])])>>>8^A[255&(t^e[i++])];for(;i<n+7;)t=t>>>8^A[255&(t^e[i++])];return-1^t}e.table=A,e.bstr=function(e){if(e.length>32768&&t)return i(new Buffer(e));for(var n=-1,r=e.length-1,a=0;a<r;)n=A[255&(n^e.charCodeAt(a++))]^n>>>8,n=A[255&(n^e.charCodeAt(a++))]^n>>>8;return a===r&&(n=n>>>8^A[255&(n^e.charCodeAt(a))]),-1^n},e.buf=function(e){if(e.length>1e4)return i(e);for(var t=-1,n=0,r=e.length-3;n<r;)t=(t=(t=(t=t>>>8^A[255&(t^e[n++])])>>>8^A[255&(t^e[n++])])>>>8^A[255&(t^e[n++])])>>>8^A[255&(t^e[n++])];for(;n<r+3;)t=t>>>8^A[255&(t^e[n++])];return-1^t},e.str=function(e){for(var t,i,n=-1,r=0,a=e.length;r<a;)(t=e.charCodeAt(r++))<128?n=n>>>8^A[255&(n^t)]:t<2048?n=(n=n>>>8^A[255&(n^(192|t>>6&31))])>>>8^A[255&(n^(128|63&t))]:t>=55296&&t<57344?(t=64+(1023&t),i=1023&e.charCodeAt(r++),n=(n=(n=(n=n>>>8^A[255&(n^(240|t>>8&7))])>>>8^A[255&(n^(128|t>>2&63))])>>>8^A[255&(n^(128|i>>6&15|3&t))])>>>8^A[255&(n^(128|63&i))]):n=(n=(n=n>>>8^A[255&(n^(224|t>>12&15))])>>>8^A[255&(n^(128|t>>6&63))])>>>8^A[255&(n^(128|63&t))];return-1^n}},"undefined"==typeof DO_NOT_EXPORT_CRC?t(A):t({})},99704(e,A,t){var i;i=function(e){return function(e){var A={};function t(i){if(A[i])return A[i].exports;var n=A[i]={i,l:!1,exports:{}};return e[i].call(n.exports,n,n.exports,t),n.l=!0,n.exports}return t.m=e,t.c=A,t.i=function(e){return e},t.d=function(e,A,i){t.o(e,A)||Object.defineProperty(e,A,{configurable:!1,enumerable:!0,get:i})},t.n=function(e){var A=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(A,"a",A),A},t.o=function(e,A){return Object.prototype.hasOwnProperty.call(e,A)},t.p="",t(t.s=1)}([function(A,t){A.exports=e},function(e,A,t){"use strict";var i=t(0).layoutBase.LayoutConstants,n=t(0).layoutBase.FDLayoutConstants,r=t(0).CoSEConstants,a=t(0).CoSELayout,o=t(0).CoSENode,s=t(0).layoutBase.PointD,l=t(0).layoutBase.DimensionD,g={ready:function(){},stop:function(){},quality:"default",nodeDimensionsIncludeLabels:!1,refresh:30,fit:!0,padding:10,randomize:!0,nodeRepulsion:4500,idealEdgeLength:50,edgeElasticity:.45,nestingFactor:.1,gravity:.25,numIter:2500,tile:!0,animate:"end",animationDuration:500,tilingPaddingVertical:10,tilingPaddingHorizontal:10,gravityRangeCompound:1.5,gravityCompound:1,gravityRange:3.8,initialEnergyOnIncremental:.5};function c(e){this.options=function(e,A){var t={};for(var i in e)t[i]=e[i];for(var i in A)t[i]=A[i];return t}(g,e),d(this.options)}var d=function(e){null!=e.nodeRepulsion&&(r.DEFAULT_REPULSION_STRENGTH=n.DEFAULT_REPULSION_STRENGTH=e.nodeRepulsion),null!=e.idealEdgeLength&&(r.DEFAULT_EDGE_LENGTH=n.DEFAULT_EDGE_LENGTH=e.idealEdgeLength),null!=e.edgeElasticity&&(r.DEFAULT_SPRING_STRENGTH=n.DEFAULT_SPRING_STRENGTH=e.edgeElasticity),null!=e.nestingFactor&&(r.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=n.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=e.nestingFactor),null!=e.gravity&&(r.DEFAULT_GRAVITY_STRENGTH=n.DEFAULT_GRAVITY_STRENGTH=e.gravity),null!=e.numIter&&(r.MAX_ITERATIONS=n.MAX_ITERATIONS=e.numIter),null!=e.gravityRange&&(r.DEFAULT_GRAVITY_RANGE_FACTOR=n.DEFAULT_GRAVITY_RANGE_FACTOR=e.gravityRange),null!=e.gravityCompound&&(r.DEFAULT_COMPOUND_GRAVITY_STRENGTH=n.DEFAULT_COMPOUND_GRAVITY_STRENGTH=e.gravityCompound),null!=e.gravityRangeCompound&&(r.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=n.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=e.gravityRangeCompound),null!=e.initialEnergyOnIncremental&&(r.DEFAULT_COOLING_FACTOR_INCREMENTAL=n.DEFAULT_COOLING_FACTOR_INCREMENTAL=e.initialEnergyOnIncremental),"draft"==e.quality?i.QUALITY=0:"proof"==e.quality?i.QUALITY=2:i.QUALITY=1,r.NODE_DIMENSIONS_INCLUDE_LABELS=n.NODE_DIMENSIONS_INCLUDE_LABELS=i.NODE_DIMENSIONS_INCLUDE_LABELS=e.nodeDimensionsIncludeLabels,r.DEFAULT_INCREMENTAL=n.DEFAULT_INCREMENTAL=i.DEFAULT_INCREMENTAL=!e.randomize,r.ANIMATE=n.ANIMATE=i.ANIMATE=e.animate,r.TILE=e.tile,r.TILING_PADDING_VERTICAL="function"==typeof e.tilingPaddingVertical?e.tilingPaddingVertical.call():e.tilingPaddingVertical,r.TILING_PADDING_HORIZONTAL="function"==typeof e.tilingPaddingHorizontal?e.tilingPaddingHorizontal.call():e.tilingPaddingHorizontal};c.prototype.run=function(){var e,A,t=this.options,i=(this.idToLNode={},this.layout=new a),n=this;n.stopped=!1,this.cy=this.options.cy,this.cy.trigger({type:"layoutstart",layout:this});var r=i.newGraphManager();this.gm=r;var o=this.options.eles.nodes(),s=this.options.eles.edges();this.root=r.addRoot(),this.processChildrenList(this.root,this.getTopMostNodes(o),i);for(var l=0;l<s.length;l++){var g=s[l],c=this.idToLNode[g.data("source")],d=this.idToLNode[g.data("target")];c!==d&&0==c.getEdgesBetween(d).length&&(r.add(i.newEdge(),c,d).id=g.id())}var h=function(e,A){"number"==typeof e&&(e=A);var t=e.data("id"),i=n.idToLNode[t];return{x:i.getRect().getCenterX(),y:i.getRect().getCenterY()}},C=function r(){for(var a,o=function(){t.fit&&t.cy.fit(t.eles,t.padding),e||(e=!0,n.cy.one("layoutready",t.ready),n.cy.trigger({type:"layoutready",layout:n}))},s=n.options.refresh,l=0;l<s&&!a;l++)a=n.stopped||n.layout.tick();if(a)return i.checkLayoutSuccess()&&!i.isSubLayout&&i.doPostLayout(),i.tilingPostLayout&&i.tilingPostLayout(),i.isLayoutFinished=!0,n.options.eles.nodes().positions(h),o(),n.cy.one("layoutstop",n.options.stop),n.cy.trigger({type:"layoutstop",layout:n}),A&&cancelAnimationFrame(A),void(e=!1);var g=n.layout.getPositionsData();t.eles.nodes().positions(function(e,A){if("number"==typeof e&&(e=A),!e.isParent()){for(var t=e.id(),i=g[t],n=e;null==i&&(i=g[n.data("parent")]||g["DummyCompound_"+n.data("parent")],g[t]=i,null!=(n=n.parent()[0])););return null!=i?{x:i.x,y:i.y}:{x:e.position("x"),y:e.position("y")}}}),o(),A=requestAnimationFrame(r)};return i.addListener("layoutstarted",function(){"during"===n.options.animate&&(A=requestAnimationFrame(C))}),i.runLayout(),"during"!==this.options.animate&&(n.options.eles.nodes().not(":parent").layoutPositions(n,n.options,h),e=!1),this},c.prototype.getTopMostNodes=function(e){for(var A={},t=0;t<e.length;t++)A[e[t].id()]=!0;var i=e.filter(function(e,t){"number"==typeof e&&(e=t);for(var i=e.parent()[0];null!=i;){if(A[i.id()])return!1;i=i.parent()[0]}return!0});return i},c.prototype.processChildrenList=function(e,A,t){for(var i=A.length,n=0;n<i;n++){var r,a,g=A[n],c=g.children(),d=g.layoutDimensions({nodeDimensionsIncludeLabels:this.options.nodeDimensionsIncludeLabels});if((r=null!=g.outerWidth()&&null!=g.outerHeight()?e.add(new o(t.graphManager,new s(g.position("x")-d.w/2,g.position("y")-d.h/2),new l(parseFloat(d.w),parseFloat(d.h)))):e.add(new o(this.graphManager))).id=g.data("id"),r.paddingLeft=parseInt(g.css("padding")),r.paddingTop=parseInt(g.css("padding")),r.paddingRight=parseInt(g.css("padding")),r.paddingBottom=parseInt(g.css("padding")),this.options.nodeDimensionsIncludeLabels&&g.isParent()){var h=g.boundingBox({includeLabels:!0,includeNodes:!1}).w,C=g.boundingBox({includeLabels:!0,includeNodes:!1}).h,I=g.css("text-halign");r.labelWidth=h,r.labelHeight=C,r.labelPos=I}this.idToLNode[g.data("id")]=r,isNaN(r.rect.x)&&(r.rect.x=0),isNaN(r.rect.y)&&(r.rect.y=0),null!=c&&c.length>0&&(a=t.getGraphManager().add(t.newGraph(),r),this.processChildrenList(a,c,t))}},c.prototype.stop=function(){return this.stopped=!0,this};var h=function(e){e("layout","cose-bilkent",c)};"undefined"!=typeof cytoscape&&h(cytoscape),e.exports=h}])},e.exports=i(t(40110))},53574(e,A,t){var i;i=function(e){return(()=>{"use strict";var A={658:e=>{e.exports=null!=Object.assign?Object.assign.bind(Object):function(e){for(var A=arguments.length,t=Array(A>1?A-1:0),i=1;i<A;i++)t[i-1]=arguments[i];return t.forEach(function(A){Object.keys(A).forEach(function(t){return e[t]=A[t]})}),e}},548:(e,A,t)=>{var i=function(e,A){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,A){var t=[],i=!0,n=!1,r=void 0;try{for(var a,o=e[Symbol.iterator]();!(i=(a=o.next()).done)&&(t.push(a.value),!A||t.length!==A);i=!0);}catch(e){n=!0,r=e}finally{try{!i&&o.return&&o.return()}finally{if(n)throw r}}return t}(e,A);throw new TypeError("Invalid attempt to destructure non-iterable instance")},n=t(140).layoutBase.LinkedList,r={getTopMostNodes:function(e){for(var A={},t=0;t<e.length;t++)A[e[t].id()]=!0;var i=e.filter(function(e,t){"number"==typeof e&&(e=t);for(var i=e.parent()[0];null!=i;){if(A[i.id()])return!1;i=i.parent()[0]}return!0});return i},connectComponents:function(e,A,t,i){var r=new n,a=new Set,o=[],s=void 0,l=void 0,g=void 0,c=!1,d=1,h=[],C=[],I=function(){var i=e.collection();C.push(i);var n=t[0],I=e.collection();I.merge(n).merge(n.descendants().intersection(A)),o.push(n),I.forEach(function(e){r.push(e),a.add(e),i.merge(e)});for(var u=function(){n=r.shift();var l=e.collection();n.neighborhood().nodes().forEach(function(e){A.intersection(n.edgesWith(e)).length>0&&l.merge(e)});for(var g=0;g<l.length;g++){var c=l[g];null==(s=t.intersection(c.union(c.ancestors())))||a.has(s[0])||s.union(s.descendants()).forEach(function(e){r.push(e),a.add(e),i.merge(e),t.has(e)&&o.push(e)})}};0!=r.length;)u();if(i.forEach(function(e){A.intersection(e.connectedEdges()).forEach(function(e){i.has(e.source())&&i.has(e.target())&&i.merge(e)})}),o.length==t.length&&(c=!0),!c||c&&d>1){l=o[0],g=l.connectedEdges().length,o.forEach(function(e){e.connectedEdges().length<g&&(g=e.connectedEdges().length,l=e)}),h.push(l.id());var B=e.collection();B.merge(o[0]),o.forEach(function(e){B.merge(e)}),o=[],t=t.difference(B),d++}};do{I()}while(!c);return i&&h.length>0&&i.set("dummy"+(i.size+1),h),C},relocateComponent:function(e,A,t){if(!t.fixedNodeConstraint){var n=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,a=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY;if("draft"==t.quality){var s=!0,l=!1,g=void 0;try{for(var c,d=A.nodeIndexes[Symbol.iterator]();!(s=(c=d.next()).done);s=!0){var h=c.value,C=i(h,2),I=C[0],u=C[1],B=t.cy.getElementById(I);if(B){var E=B.boundingBox(),Q=A.xCoords[u]-E.w/2,p=A.xCoords[u]+E.w/2,m=A.yCoords[u]-E.h/2,f=A.yCoords[u]+E.h/2;Q<n&&(n=Q),p>r&&(r=p),m<a&&(a=m),f>o&&(o=f)}}}catch(e){l=!0,g=e}finally{try{!s&&d.return&&d.return()}finally{if(l)throw g}}var y=e.x-(r+n)/2,w=e.y-(o+a)/2;A.xCoords=A.xCoords.map(function(e){return e+y}),A.yCoords=A.yCoords.map(function(e){return e+w})}else{Object.keys(A).forEach(function(e){var t=A[e],i=t.getRect().x,s=t.getRect().x+t.getRect().width,l=t.getRect().y,g=t.getRect().y+t.getRect().height;i<n&&(n=i),s>r&&(r=s),l<a&&(a=l),g>o&&(o=g)});var b=e.x-(r+n)/2,D=e.y-(o+a)/2;Object.keys(A).forEach(function(e){var t=A[e];t.setCenter(t.getCenterX()+b,t.getCenterY()+D)})}}},calcBoundingBox:function(e,A,t,i){for(var n=Number.MAX_SAFE_INTEGER,r=Number.MIN_SAFE_INTEGER,a=Number.MAX_SAFE_INTEGER,o=Number.MIN_SAFE_INTEGER,s=void 0,l=void 0,g=void 0,c=void 0,d=e.descendants().not(":parent"),h=d.length,C=0;C<h;C++){var I=d[C];n>(s=A[i.get(I.id())]-I.width()/2)&&(n=s),r<(l=A[i.get(I.id())]+I.width()/2)&&(r=l),a>(g=t[i.get(I.id())]-I.height()/2)&&(a=g),o<(c=t[i.get(I.id())]+I.height()/2)&&(o=c)}var u={};return u.topLeftX=n,u.topLeftY=a,u.width=r-n,u.height=o-a,u},calcParentsWithoutChildren:function(e,A){var t=e.collection();return A.nodes(":parent").forEach(function(e){var A=!1;e.children().forEach(function(e){"none"!=e.css("display")&&(A=!0)}),A||t.merge(e)}),t}};e.exports=r},816:(e,A,t)=>{var i=t(548),n=t(140).CoSELayout,r=t(140).CoSENode,a=t(140).layoutBase.PointD,o=t(140).layoutBase.DimensionD,s=t(140).layoutBase.LayoutConstants,l=t(140).layoutBase.FDLayoutConstants,g=t(140).CoSEConstants;e.exports={coseLayout:function(e,A){var t=e.cy,c=e.eles,d=c.nodes(),h=c.edges(),C=void 0,I=void 0,u=void 0,B={};e.randomize&&(C=A.nodeIndexes,I=A.xCoords,u=A.yCoords);var E=function(e){return"function"==typeof e},Q=function(e,A){return E(e)?e(A):e},p=i.calcParentsWithoutChildren(t,c);null!=e.nestingFactor&&(g.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=l.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=e.nestingFactor),null!=e.gravity&&(g.DEFAULT_GRAVITY_STRENGTH=l.DEFAULT_GRAVITY_STRENGTH=e.gravity),null!=e.numIter&&(g.MAX_ITERATIONS=l.MAX_ITERATIONS=e.numIter),null!=e.gravityRange&&(g.DEFAULT_GRAVITY_RANGE_FACTOR=l.DEFAULT_GRAVITY_RANGE_FACTOR=e.gravityRange),null!=e.gravityCompound&&(g.DEFAULT_COMPOUND_GRAVITY_STRENGTH=l.DEFAULT_COMPOUND_GRAVITY_STRENGTH=e.gravityCompound),null!=e.gravityRangeCompound&&(g.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=e.gravityRangeCompound),null!=e.initialEnergyOnIncremental&&(g.DEFAULT_COOLING_FACTOR_INCREMENTAL=l.DEFAULT_COOLING_FACTOR_INCREMENTAL=e.initialEnergyOnIncremental),null!=e.tilingCompareBy&&(g.TILING_COMPARE_BY=e.tilingCompareBy),"proof"==e.quality?s.QUALITY=2:s.QUALITY=0,g.NODE_DIMENSIONS_INCLUDE_LABELS=l.NODE_DIMENSIONS_INCLUDE_LABELS=s.NODE_DIMENSIONS_INCLUDE_LABELS=e.nodeDimensionsIncludeLabels,g.DEFAULT_INCREMENTAL=l.DEFAULT_INCREMENTAL=s.DEFAULT_INCREMENTAL=!e.randomize,g.ANIMATE=l.ANIMATE=s.ANIMATE=e.animate,g.TILE=e.tile,g.TILING_PADDING_VERTICAL="function"==typeof e.tilingPaddingVertical?e.tilingPaddingVertical.call():e.tilingPaddingVertical,g.TILING_PADDING_HORIZONTAL="function"==typeof e.tilingPaddingHorizontal?e.tilingPaddingHorizontal.call():e.tilingPaddingHorizontal,g.DEFAULT_INCREMENTAL=l.DEFAULT_INCREMENTAL=s.DEFAULT_INCREMENTAL=!0,g.PURE_INCREMENTAL=!e.randomize,s.DEFAULT_UNIFORM_LEAF_NODE_SIZES=e.uniformNodeDimensions,"transformed"==e.step&&(g.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,g.ENFORCE_CONSTRAINTS=!1,g.APPLY_LAYOUT=!1),"enforced"==e.step&&(g.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,g.ENFORCE_CONSTRAINTS=!0,g.APPLY_LAYOUT=!1),"cose"==e.step&&(g.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,g.ENFORCE_CONSTRAINTS=!1,g.APPLY_LAYOUT=!0),"all"==e.step&&(e.randomize?g.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:g.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,g.ENFORCE_CONSTRAINTS=!0,g.APPLY_LAYOUT=!0),e.fixedNodeConstraint||e.alignmentConstraint||e.relativePlacementConstraint?g.TREE_REDUCTION_ON_INCREMENTAL=!1:g.TREE_REDUCTION_ON_INCREMENTAL=!0;var m=new n,f=m.newGraphManager();return function e(A,t,n,s){for(var l=t.length,g=0;g<l;g++){var c=t[g],d=null;0==c.intersection(p).length&&(d=c.children());var h=void 0,E=c.layoutDimensions({nodeDimensionsIncludeLabels:s.nodeDimensionsIncludeLabels});if(null!=c.outerWidth()&&null!=c.outerHeight())if(s.randomize)if(c.isParent()){var m=i.calcBoundingBox(c,I,u,C);h=0==c.intersection(p).length?A.add(new r(n.graphManager,new a(m.topLeftX,m.topLeftY),new o(m.width,m.height))):A.add(new r(n.graphManager,new a(m.topLeftX,m.topLeftY),new o(parseFloat(E.w),parseFloat(E.h))))}else h=A.add(new r(n.graphManager,new a(I[C.get(c.id())]-E.w/2,u[C.get(c.id())]-E.h/2),new o(parseFloat(E.w),parseFloat(E.h))));else h=A.add(new r(n.graphManager,new a(c.position("x")-E.w/2,c.position("y")-E.h/2),new o(parseFloat(E.w),parseFloat(E.h))));else h=A.add(new r(this.graphManager));h.id=c.data("id"),h.nodeRepulsion=Q(s.nodeRepulsion,c),h.paddingLeft=parseInt(c.css("padding")),h.paddingTop=parseInt(c.css("padding")),h.paddingRight=parseInt(c.css("padding")),h.paddingBottom=parseInt(c.css("padding")),s.nodeDimensionsIncludeLabels&&(h.labelWidth=c.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).w,h.labelHeight=c.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).h,h.labelPosVertical=c.css("text-valign"),h.labelPosHorizontal=c.css("text-halign")),B[c.data("id")]=h,isNaN(h.rect.x)&&(h.rect.x=0),isNaN(h.rect.y)&&(h.rect.y=0),null!=d&&d.length>0&&e(n.getGraphManager().add(n.newGraph(),h),d,n,s)}}(f.addRoot(),i.getTopMostNodes(d),m,e),function(A,t,i){for(var n=0,r=0,a=0;a<i.length;a++){var o=i[a],s=B[o.data("source")],c=B[o.data("target")];if(s&&c&&s!==c&&0==s.getEdgesBetween(c).length){var d=t.add(A.newEdge(),s,c);d.id=o.id(),d.idealLength=Q(e.idealEdgeLength,o),d.edgeElasticity=Q(e.edgeElasticity,o),n+=d.idealLength,r++}}null!=e.idealEdgeLength&&(r>0?g.DEFAULT_EDGE_LENGTH=l.DEFAULT_EDGE_LENGTH=n/r:E(e.idealEdgeLength)?g.DEFAULT_EDGE_LENGTH=l.DEFAULT_EDGE_LENGTH=50:g.DEFAULT_EDGE_LENGTH=l.DEFAULT_EDGE_LENGTH=e.idealEdgeLength,g.MIN_REPULSION_DIST=l.MIN_REPULSION_DIST=l.DEFAULT_EDGE_LENGTH/10,g.DEFAULT_RADIAL_SEPARATION=l.DEFAULT_EDGE_LENGTH)}(m,f,h),function(e,A){A.fixedNodeConstraint&&(e.constraints.fixedNodeConstraint=A.fixedNodeConstraint),A.alignmentConstraint&&(e.constraints.alignmentConstraint=A.alignmentConstraint),A.relativePlacementConstraint&&(e.constraints.relativePlacementConstraint=A.relativePlacementConstraint)}(m,e),m.runLayout(),B}}},212:(e,A,t)=>{var i=function(){function e(e,A){for(var t=0;t<A.length;t++){var i=A[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(A,t,i){return t&&e(A.prototype,t),i&&e(A,i),A}}(),n=t(658),r=t(548),a=t(657).spectralLayout,o=t(816).coseLayout,s=Object.freeze({quality:"default",randomize:!0,animate:!0,animationDuration:1e3,animationEasing:void 0,fit:!0,padding:30,nodeDimensionsIncludeLabels:!1,uniformNodeDimensions:!1,packComponents:!0,step:"all",samplingType:!0,sampleSize:25,nodeSeparation:75,piTol:1e-7,nodeRepulsion:function(e){return 4500},idealEdgeLength:function(e){return 50},edgeElasticity:function(e){return.45},nestingFactor:.1,gravity:.25,numIter:2500,tile:!0,tilingCompareBy:void 0,tilingPaddingVertical:10,tilingPaddingHorizontal:10,gravityRangeCompound:1.5,gravityCompound:1,gravityRange:3.8,initialEnergyOnIncremental:.3,fixedNodeConstraint:void 0,alignmentConstraint:void 0,relativePlacementConstraint:void 0,ready:function(){},stop:function(){}}),l=function(){function e(A){!function(e,A){if(!(e instanceof A))throw new TypeError("Cannot call a class as a function")}(this,e),this.options=n({},s,A)}return i(e,[{key:"run",value:function(){var e=this.options,A=e.cy,t=e.eles,i=[],n=[],s=void 0,l=[];!e.fixedNodeConstraint||Array.isArray(e.fixedNodeConstraint)&&0!=e.fixedNodeConstraint.length||(e.fixedNodeConstraint=void 0),e.alignmentConstraint&&(!e.alignmentConstraint.vertical||Array.isArray(e.alignmentConstraint.vertical)&&0!=e.alignmentConstraint.vertical.length||(e.alignmentConstraint.vertical=void 0),!e.alignmentConstraint.horizontal||Array.isArray(e.alignmentConstraint.horizontal)&&0!=e.alignmentConstraint.horizontal.length||(e.alignmentConstraint.horizontal=void 0)),!e.relativePlacementConstraint||Array.isArray(e.relativePlacementConstraint)&&0!=e.relativePlacementConstraint.length||(e.relativePlacementConstraint=void 0),(e.fixedNodeConstraint||e.alignmentConstraint||e.relativePlacementConstraint)&&(e.tile=!1,e.packComponents=!1);var g=void 0,c=!1;if(A.layoutUtilities&&e.packComponents&&((g=A.layoutUtilities("get"))||(g=A.layoutUtilities()),c=!0),t.nodes().length>0)if(c){var d=r.getTopMostNodes(e.eles.nodes());if((s=r.connectComponents(A,e.eles,d)).forEach(function(e){var A=e.boundingBox();l.push({x:A.x1+A.w/2,y:A.y1+A.h/2})}),e.randomize&&s.forEach(function(A){e.eles=A,i.push(a(e))}),"default"==e.quality||"proof"==e.quality){var h=A.collection();if(e.tile){var C=new Map,I=0,u={nodeIndexes:C,xCoords:[],yCoords:[]},B=[];if(s.forEach(function(e,A){0==e.edges().length&&(e.nodes().forEach(function(A,t){h.merge(e.nodes()[t]),A.isParent()||(u.nodeIndexes.set(e.nodes()[t].id(),I++),u.xCoords.push(e.nodes()[0].position().x),u.yCoords.push(e.nodes()[0].position().y))}),B.push(A))}),h.length>1){var E=h.boundingBox();l.push({x:E.x1+E.w/2,y:E.y1+E.h/2}),s.push(h),i.push(u);for(var Q=B.length-1;Q>=0;Q--)s.splice(B[Q],1),i.splice(B[Q],1),l.splice(B[Q],1)}}s.forEach(function(A,t){e.eles=A,n.push(o(e,i[t])),r.relocateComponent(l[t],n[t],e)})}else s.forEach(function(A,t){r.relocateComponent(l[t],i[t],e)});var p=new Set;if(s.length>1){var m=[],f=t.filter(function(e){return"none"==e.css("display")});s.forEach(function(A,t){var a=void 0;if("draft"==e.quality&&(a=i[t].nodeIndexes),A.nodes().not(f).length>0){var o={edges:[],nodes:[]},s=void 0;A.nodes().not(f).forEach(function(A){if("draft"==e.quality)if(A.isParent()){var l=r.calcBoundingBox(A,i[t].xCoords,i[t].yCoords,a);o.nodes.push({x:l.topLeftX,y:l.topLeftY,width:l.width,height:l.height})}else s=a.get(A.id()),o.nodes.push({x:i[t].xCoords[s]-A.boundingbox().w/2,y:i[t].yCoords[s]-A.boundingbox().h/2,width:A.boundingbox().w,height:A.boundingbox().h});else n[t][A.id()]&&o.nodes.push({x:n[t][A.id()].getLeft(),y:n[t][A.id()].getTop(),width:n[t][A.id()].getWidth(),height:n[t][A.id()].getHeight()})}),A.edges().forEach(function(A){var s=A.source(),l=A.target();if("none"!=s.css("display")&&"none"!=l.css("display"))if("draft"==e.quality){var g=a.get(s.id()),c=a.get(l.id()),d=[],h=[];if(s.isParent()){var C=r.calcBoundingBox(s,i[t].xCoords,i[t].yCoords,a);d.push(C.topLeftX+C.width/2),d.push(C.topLeftY+C.height/2)}else d.push(i[t].xCoords[g]),d.push(i[t].yCoords[g]);if(l.isParent()){var I=r.calcBoundingBox(l,i[t].xCoords,i[t].yCoords,a);h.push(I.topLeftX+I.width/2),h.push(I.topLeftY+I.height/2)}else h.push(i[t].xCoords[c]),h.push(i[t].yCoords[c]);o.edges.push({startX:d[0],startY:d[1],endX:h[0],endY:h[1]})}else n[t][s.id()]&&n[t][l.id()]&&o.edges.push({startX:n[t][s.id()].getCenterX(),startY:n[t][s.id()].getCenterY(),endX:n[t][l.id()].getCenterX(),endY:n[t][l.id()].getCenterY()})}),o.nodes.length>0&&(m.push(o),p.add(t))}});var y=g.packComponents(m,e.randomize).shifts;if("draft"==e.quality)i.forEach(function(e,A){var t=e.xCoords.map(function(e){return e+y[A].dx}),i=e.yCoords.map(function(e){return e+y[A].dy});e.xCoords=t,e.yCoords=i});else{var w=0;p.forEach(function(e){Object.keys(n[e]).forEach(function(A){var t=n[e][A];t.setCenter(t.getCenterX()+y[w].dx,t.getCenterY()+y[w].dy)}),w++})}}}else{var b=e.eles.boundingBox();if(l.push({x:b.x1+b.w/2,y:b.y1+b.h/2}),e.randomize){var D=a(e);i.push(D)}"default"==e.quality||"proof"==e.quality?(n.push(o(e,i[0])),r.relocateComponent(l[0],n[0],e)):r.relocateComponent(l[0],i[0],e)}var k=function(A,t){if("default"==e.quality||"proof"==e.quality){"number"==typeof A&&(A=t);var r=void 0,a=void 0,o=A.data("id");return n.forEach(function(e){o in e&&(r={x:e[o].getRect().getCenterX(),y:e[o].getRect().getCenterY()},a=e[o])}),e.nodeDimensionsIncludeLabels&&(a.labelWidth&&("left"==a.labelPosHorizontal?r.x+=a.labelWidth/2:"right"==a.labelPosHorizontal&&(r.x-=a.labelWidth/2)),a.labelHeight&&("top"==a.labelPosVertical?r.y+=a.labelHeight/2:"bottom"==a.labelPosVertical&&(r.y-=a.labelHeight/2))),null==r&&(r={x:A.position("x"),y:A.position("y")}),{x:r.x,y:r.y}}var s=void 0;return i.forEach(function(e){var t=e.nodeIndexes.get(A.id());null!=t&&(s={x:e.xCoords[t],y:e.yCoords[t]})}),null==s&&(s={x:A.position("x"),y:A.position("y")}),{x:s.x,y:s.y}};if("default"==e.quality||"proof"==e.quality||e.randomize){var v=r.calcParentsWithoutChildren(A,t),x=t.filter(function(e){return"none"==e.css("display")});e.eles=t.not(x),t.nodes().not(":parent").not(x).layoutPositions(this,e,k),v.length>0&&v.forEach(function(e){e.position(k(e))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),e}();e.exports=l},657:(e,A,t)=>{var i=t(548),n=t(140).layoutBase.Matrix,r=t(140).layoutBase.SVD;e.exports={spectralLayout:function(e){var A=e.cy,t=e.eles,a=t.nodes(),o=t.nodes(":parent"),s=new Map,l=new Map,g=new Map,c=[],d=[],h=[],C=[],I=[],u=[],B=[],E=[],Q=void 0,p=1e8,m=1e-9,f=e.piTol,y=e.samplingType,w=e.nodeSeparation,b=void 0,D=function(e,A,t){for(var i=[],n=0,r=0,a=0,o=void 0,s=[],g=0,d=1,h=0;h<Q;h++)s[h]=p;for(i[r]=e,s[e]=0;r>=n;){a=i[n++];for(var C=c[a],B=0;B<C.length;B++)s[o=l.get(C[B])]==p&&(s[o]=s[a]+1,i[++r]=o);u[a][A]=s[a]*w}if(t){for(var E=0;E<Q;E++)u[E][A]<I[E]&&(I[E]=u[E][A]);for(var m=0;m<Q;m++)I[m]>g&&(g=I[m],d=m)}return d};i.connectComponents(A,t,i.getTopMostNodes(a),s),o.forEach(function(e){i.connectComponents(A,t,i.getTopMostNodes(e.descendants().intersection(t)),s)});for(var k=0,v=0;v<a.length;v++)a[v].isParent()||l.set(a[v].id(),k++);var x=!0,S=!1,L=void 0;try{for(var R,N=s.keys()[Symbol.iterator]();!(x=(R=N.next()).done);x=!0){var M=R.value;l.set(M,k++)}}catch(e){S=!0,L=e}finally{try{!x&&N.return&&N.return()}finally{if(S)throw L}}for(var G=0;G<l.size;G++)c[G]=[];o.forEach(function(e){for(var A=e.children().intersection(t);0==A.nodes(":childless").length;)A=A.nodes()[0].children().intersection(t);var i=0,n=A.nodes(":childless")[0].connectedEdges().length;A.nodes(":childless").forEach(function(e,A){e.connectedEdges().length<n&&(n=e.connectedEdges().length,i=A)}),g.set(e.id(),A.nodes(":childless")[i].id())}),a.forEach(function(e){var A=void 0;A=e.isParent()?l.get(g.get(e.id())):l.get(e.id()),e.neighborhood().nodes().forEach(function(i){t.intersection(e.edgesWith(i)).length>0&&(i.isParent()?c[A].push(g.get(i.id())):c[A].push(i.id()))})});var U=function(e){var t=l.get(e),i=void 0;s.get(e).forEach(function(n){i=A.getElementById(n).isParent()?g.get(n):n,c[t].push(i),c[l.get(i)].push(e)})},F=!0,T=!1,Y=void 0;try{for(var K,H=s.keys()[Symbol.iterator]();!(F=(K=H.next()).done);F=!0)U(K.value)}catch(e){T=!0,Y=e}finally{try{!F&&H.return&&H.return()}finally{if(T)throw Y}}var J=void 0;if((Q=l.size)>2){b=Q<e.sampleSize?Q:e.sampleSize;for(var O=0;O<Q;O++)u[O]=[];for(var P=0;P<b;P++)E[P]=[];return"draft"==e.quality||"all"==e.step?(function(e){var A=void 0;if(e){A=Math.floor(Math.random()*Q);for(var t=0;t<Q;t++)I[t]=p;for(var i=0;i<b;i++)C[i]=A,A=D(A,i,e)}else{!function(){for(var e=0,A=0,t=!1;A<b;){e=Math.floor(Math.random()*Q),t=!1;for(var i=0;i<A;i++)if(C[i]==e){t=!0;break}t||(C[A]=e,A++)}}();for(var n=0;n<b;n++)D(C[n],n,e)}for(var r=0;r<Q;r++)for(var a=0;a<b;a++)u[r][a]*=u[r][a];for(var o=0;o<b;o++)B[o]=[];for(var s=0;s<b;s++)for(var l=0;l<b;l++)B[s][l]=u[C[l]][s]}(y),function(){for(var e=r.svd(B),A=e.S,t=e.U,i=e.V,a=A[0]*A[0]*A[0],o=[],s=0;s<b;s++){o[s]=[];for(var l=0;l<b;l++)o[s][l]=0,s==l&&(o[s][l]=A[s]/(A[s]*A[s]+a/(A[s]*A[s])))}E=n.multMat(n.multMat(i,o),n.transpose(t))}(),function(){for(var e=void 0,A=void 0,t=[],i=[],r=[],a=[],o=0;o<Q;o++)t[o]=Math.random(),i[o]=Math.random();t=n.normalize(t),i=n.normalize(i);for(var s=m,l=m,g=void 0;;){for(var c=0;c<Q;c++)r[c]=t[c];if(t=n.multGamma(n.multL(n.multGamma(r),u,E)),e=n.dotProduct(r,t),t=n.normalize(t),s=n.dotProduct(r,t),(g=Math.abs(s/l))<=1+f&&g>=1)break;l=s}for(var C=0;C<Q;C++)r[C]=t[C];for(l=m;;){for(var I=0;I<Q;I++)a[I]=i[I];if(a=n.minusOp(a,n.multCons(r,n.dotProduct(r,a))),i=n.multGamma(n.multL(n.multGamma(a),u,E)),A=n.dotProduct(a,i),i=n.normalize(i),s=n.dotProduct(a,i),(g=Math.abs(s/l))<=1+f&&g>=1)break;l=s}for(var B=0;B<Q;B++)a[B]=i[B];d=n.multCons(r,Math.sqrt(Math.abs(e))),h=n.multCons(a,Math.sqrt(Math.abs(A)))}(),J={nodeIndexes:l,xCoords:d,yCoords:h}):(l.forEach(function(e,t){d.push(A.getElementById(t).position("x")),h.push(A.getElementById(t).position("y"))}),J={nodeIndexes:l,xCoords:d,yCoords:h}),J}var j=l.keys(),q=A.getElementById(j.next().value),W=q.position(),z=q.outerWidth();if(d.push(W.x),h.push(W.y),2==Q){var Z=A.getElementById(j.next().value).outerWidth();d.push(W.x+z/2+Z/2+e.idealEdgeLength),h.push(W.y)}return J={nodeIndexes:l,xCoords:d,yCoords:h}}}},579:(e,A,t)=>{var i=t(212),n=function(e){e&&e("layout","fcose",i)};"undefined"!=typeof cytoscape&&n(cytoscape),e.exports=n},140:A=>{A.exports=e}},t={},i=function e(i){var n=t[i];if(void 0!==n)return n.exports;var r=t[i]={exports:{}};return A[i](r,r.exports,e),r.exports}(579);return i})()},e.exports=i(t(74550))},74550(e,A,t){var i;i=function(e){return(()=>{"use strict";var A={45:(e,A,t)=>{var i={};i.layoutBase=t(551),i.CoSEConstants=t(806),i.CoSEEdge=t(767),i.CoSEGraph=t(880),i.CoSEGraphManager=t(578),i.CoSELayout=t(765),i.CoSENode=t(991),i.ConstraintHandler=t(902),e.exports=i},806:(e,A,t)=>{var i