@nodefony/monitoring-bundle
Version:
1 lines • 846 kB
JavaScript
(self["webpackChunk_nodefony_monitoring_bundle"]=self["webpackChunk_nodefony_monitoring_bundle"]||[]).push([[3175],{26527:function(e,t,n){(function(t,r){e.exports=r(n(41709))})(0,(function(e){return(()=>{"use strict";var t={658:e=>{e.exports=null!=Object.assign?Object.assign.bind(Object):function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return n.forEach((function(t){Object.keys(t).forEach((function(n){return e[n]=t[n]}))})),e}},548:(e,t,n)=>{var r=function(){function e(e,t){var n=[],r=!0,i=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(r=(o=s.next()).done);r=!0)if(n.push(o.value),t&&n.length===t)break}catch(l){i=!0,a=l}finally{try{!r&&s["return"]&&s["return"]()}finally{if(i)throw a}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),i=n(140).layoutBase.LinkedList,a={getTopMostNodes:function(e){for(var t={},n=0;n<e.length;n++)t[e[n].id()]=!0;var r=e.filter((function(e,n){"number"===typeof e&&(e=n);var r=e.parent()[0];while(null!=r){if(t[r.id()])return!1;r=r.parent()[0]}return!0}));return r},connectComponents:function(e,t,n,r){var a=new i,o=new Set,s=[],l=void 0,u=void 0,c=void 0,h=!1,d=1,f=[],p=[],g=function(){var r=e.collection();p.push(r);var i=n[0],g=e.collection();g.merge(i).merge(i.descendants().intersection(t)),s.push(i),g.forEach((function(e){a.push(e),o.add(e),r.merge(e)}));var m=function(){i=a.shift();var u=e.collection();i.neighborhood().nodes().forEach((function(e){t.intersection(i.edgesWith(e)).length>0&&u.merge(e)}));for(var c=0;c<u.length;c++){var h=u[c];if(l=n.intersection(h.union(h.ancestors())),null!=l&&!o.has(l[0])){var d=l.union(l.descendants());d.forEach((function(e){a.push(e),o.add(e),r.merge(e),n.has(e)&&s.push(e)}))}}};while(0!=a.length)m();if(r.forEach((function(e){t.intersection(e.connectedEdges()).forEach((function(e){r.has(e.source())&&r.has(e.target())&&r.merge(e)}))})),s.length==n.length&&(h=!0),!h||h&&d>1){u=s[0],c=u.connectedEdges().length,s.forEach((function(e){e.connectedEdges().length<c&&(c=e.connectedEdges().length,u=e)})),f.push(u.id());var v=e.collection();v.merge(s[0]),s.forEach((function(e){v.merge(e)})),s=[],n=n.difference(v),d++}};do{g()}while(!h);return r&&f.length>0&&r.set("dummy"+(r.size+1),f),p},relocateComponent:function(e,t,n){if(!n.fixedNodeConstraint){var i=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY,o=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY;if("draft"==n.quality){var l=!0,u=!1,c=void 0;try{for(var h,d=t.nodeIndexes[Symbol.iterator]();!(l=(h=d.next()).done);l=!0){var f=h.value,p=r(f,2),g=p[0],m=p[1],v=n.cy.getElementById(g);if(v){var y=v.boundingBox(),b=t.xCoords[m]-y.w/2,x=t.xCoords[m]+y.w/2,w=t.yCoords[m]-y.h/2,E=t.yCoords[m]+y.h/2;b<i&&(i=b),x>a&&(a=x),w<o&&(o=w),E>s&&(s=E)}}}catch(k){u=!0,c=k}finally{try{!l&&d.return&&d.return()}finally{if(u)throw c}}var T=e.x-(a+i)/2,A=e.y-(s+o)/2;t.xCoords=t.xCoords.map((function(e){return e+T})),t.yCoords=t.yCoords.map((function(e){return e+A}))}else{Object.keys(t).forEach((function(e){var n=t[e],r=n.getRect().x,l=n.getRect().x+n.getRect().width,u=n.getRect().y,c=n.getRect().y+n.getRect().height;r<i&&(i=r),l>a&&(a=l),u<o&&(o=u),c>s&&(s=c)}));var N=e.x-(a+i)/2,C=e.y-(s+o)/2;Object.keys(t).forEach((function(e){var n=t[e];n.setCenter(n.getCenterX()+N,n.getCenterY()+C)}))}}},calcBoundingBox:function(e,t,n,r){for(var i=Number.MAX_SAFE_INTEGER,a=Number.MIN_SAFE_INTEGER,o=Number.MAX_SAFE_INTEGER,s=Number.MIN_SAFE_INTEGER,l=void 0,u=void 0,c=void 0,h=void 0,d=e.descendants().not(":parent"),f=d.length,p=0;p<f;p++){var g=d[p];l=t[r.get(g.id())]-g.width()/2,u=t[r.get(g.id())]+g.width()/2,c=n[r.get(g.id())]-g.height()/2,h=n[r.get(g.id())]+g.height()/2,i>l&&(i=l),a<u&&(a=u),o>c&&(o=c),s<h&&(s=h)}var m={};return m.topLeftX=i,m.topLeftY=o,m.width=a-i,m.height=s-o,m},calcParentsWithoutChildren:function(e,t){var n=e.collection();return t.nodes(":parent").forEach((function(e){var t=!1;e.children().forEach((function(e){"none"!=e.css("display")&&(t=!0)})),t||n.merge(e)})),n}};e.exports=a},816:(e,t,n)=>{var r=n(548),i=n(140).CoSELayout,a=n(140).CoSENode,o=n(140).layoutBase.PointD,s=n(140).layoutBase.DimensionD,l=n(140).layoutBase.LayoutConstants,u=n(140).layoutBase.FDLayoutConstants,c=n(140).CoSEConstants,h=function(e,t){var n=e.cy,h=e.eles,d=h.nodes(),f=h.edges(),p=void 0,g=void 0,m=void 0,v={};e.randomize&&(p=t["nodeIndexes"],g=t["xCoords"],m=t["yCoords"]);var y=function(e){return"function"===typeof e},b=function(e,t){return y(e)?e(t):e},x=r.calcParentsWithoutChildren(n,h),w=function e(t,n,i,l){for(var u=n.length,c=0;c<u;c++){var h=n[c],d=null;0==h.intersection(x).length&&(d=h.children());var f=void 0,y=h.layoutDimensions({nodeDimensionsIncludeLabels:l.nodeDimensionsIncludeLabels});if(null!=h.outerWidth()&&null!=h.outerHeight())if(l.randomize)if(h.isParent()){var w=r.calcBoundingBox(h,g,m,p);f=0==h.intersection(x).length?t.add(new a(i.graphManager,new o(w.topLeftX,w.topLeftY),new s(w.width,w.height))):t.add(new a(i.graphManager,new o(w.topLeftX,w.topLeftY),new s(parseFloat(y.w),parseFloat(y.h))))}else f=t.add(new a(i.graphManager,new o(g[p.get(h.id())]-y.w/2,m[p.get(h.id())]-y.h/2),new s(parseFloat(y.w),parseFloat(y.h))));else f=t.add(new a(i.graphManager,new o(h.position("x")-y.w/2,h.position("y")-y.h/2),new s(parseFloat(y.w),parseFloat(y.h))));else f=t.add(new a(this.graphManager));if(f.id=h.data("id"),f.nodeRepulsion=b(l.nodeRepulsion,h),f.paddingLeft=parseInt(h.css("padding")),f.paddingTop=parseInt(h.css("padding")),f.paddingRight=parseInt(h.css("padding")),f.paddingBottom=parseInt(h.css("padding")),l.nodeDimensionsIncludeLabels&&(f.labelWidth=h.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).w,f.labelHeight=h.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).h,f.labelPosVertical=h.css("text-valign"),f.labelPosHorizontal=h.css("text-halign")),v[h.data("id")]=f,isNaN(f.rect.x)&&(f.rect.x=0),isNaN(f.rect.y)&&(f.rect.y=0),null!=d&&d.length>0){var E=void 0;E=i.getGraphManager().add(i.newGraph(),f),e(E,d,i,l)}}},E=function(t,n,r){for(var i=0,a=0,o=0;o<r.length;o++){var s=r[o],l=v[s.data("source")],h=v[s.data("target")];if(l&&h&&l!==h&&0==l.getEdgesBetween(h).length){var d=n.add(t.newEdge(),l,h);d.id=s.id(),d.idealLength=b(e.idealEdgeLength,s),d.edgeElasticity=b(e.edgeElasticity,s),i+=d.idealLength,a++}}null!=e.idealEdgeLength&&(a>0?c.DEFAULT_EDGE_LENGTH=u.DEFAULT_EDGE_LENGTH=i/a:y(e.idealEdgeLength)?c.DEFAULT_EDGE_LENGTH=u.DEFAULT_EDGE_LENGTH=50:c.DEFAULT_EDGE_LENGTH=u.DEFAULT_EDGE_LENGTH=e.idealEdgeLength,c.MIN_REPULSION_DIST=u.MIN_REPULSION_DIST=u.DEFAULT_EDGE_LENGTH/10,c.DEFAULT_RADIAL_SEPARATION=u.DEFAULT_EDGE_LENGTH)},T=function(e,t){t.fixedNodeConstraint&&(e.constraints["fixedNodeConstraint"]=t.fixedNodeConstraint),t.alignmentConstraint&&(e.constraints["alignmentConstraint"]=t.alignmentConstraint),t.relativePlacementConstraint&&(e.constraints["relativePlacementConstraint"]=t.relativePlacementConstraint)};null!=e.nestingFactor&&(c.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=u.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=e.nestingFactor),null!=e.gravity&&(c.DEFAULT_GRAVITY_STRENGTH=u.DEFAULT_GRAVITY_STRENGTH=e.gravity),null!=e.numIter&&(c.MAX_ITERATIONS=u.MAX_ITERATIONS=e.numIter),null!=e.gravityRange&&(c.DEFAULT_GRAVITY_RANGE_FACTOR=u.DEFAULT_GRAVITY_RANGE_FACTOR=e.gravityRange),null!=e.gravityCompound&&(c.DEFAULT_COMPOUND_GRAVITY_STRENGTH=u.DEFAULT_COMPOUND_GRAVITY_STRENGTH=e.gravityCompound),null!=e.gravityRangeCompound&&(c.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=u.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=e.gravityRangeCompound),null!=e.initialEnergyOnIncremental&&(c.DEFAULT_COOLING_FACTOR_INCREMENTAL=u.DEFAULT_COOLING_FACTOR_INCREMENTAL=e.initialEnergyOnIncremental),null!=e.tilingCompareBy&&(c.TILING_COMPARE_BY=e.tilingCompareBy),"proof"==e.quality?l.QUALITY=2:l.QUALITY=0,c.NODE_DIMENSIONS_INCLUDE_LABELS=u.NODE_DIMENSIONS_INCLUDE_LABELS=l.NODE_DIMENSIONS_INCLUDE_LABELS=e.nodeDimensionsIncludeLabels,c.DEFAULT_INCREMENTAL=u.DEFAULT_INCREMENTAL=l.DEFAULT_INCREMENTAL=!e.randomize,c.ANIMATE=u.ANIMATE=l.ANIMATE=e.animate,c.TILE=e.tile,c.TILING_PADDING_VERTICAL="function"===typeof e.tilingPaddingVertical?e.tilingPaddingVertical.call():e.tilingPaddingVertical,c.TILING_PADDING_HORIZONTAL="function"===typeof e.tilingPaddingHorizontal?e.tilingPaddingHorizontal.call():e.tilingPaddingHorizontal,c.DEFAULT_INCREMENTAL=u.DEFAULT_INCREMENTAL=l.DEFAULT_INCREMENTAL=!0,c.PURE_INCREMENTAL=!e.randomize,l.DEFAULT_UNIFORM_LEAF_NODE_SIZES=e.uniformNodeDimensions,"transformed"==e.step&&(c.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,c.ENFORCE_CONSTRAINTS=!1,c.APPLY_LAYOUT=!1),"enforced"==e.step&&(c.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,c.ENFORCE_CONSTRAINTS=!0,c.APPLY_LAYOUT=!1),"cose"==e.step&&(c.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,c.ENFORCE_CONSTRAINTS=!1,c.APPLY_LAYOUT=!0),"all"==e.step&&(e.randomize?c.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:c.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,c.ENFORCE_CONSTRAINTS=!0,c.APPLY_LAYOUT=!0),e.fixedNodeConstraint||e.alignmentConstraint||e.relativePlacementConstraint?c.TREE_REDUCTION_ON_INCREMENTAL=!1:c.TREE_REDUCTION_ON_INCREMENTAL=!0;var A=new i,N=A.newGraphManager();return w(N.addRoot(),r.getTopMostNodes(d),A,e),E(A,N,f),T(A,e),A.runLayout(),v};e.exports={coseLayout:h}},212:(e,t,n)=>{var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var a=n(658),o=n(548),s=n(657),l=s.spectralLayout,u=n(816),c=u.coseLayout,h=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(){}}),d=function(){function e(t){i(this,e),this.options=a({},h,t)}return r(e,[{key:"run",value:function(){var e=this,t=this.options,n=t.cy,r=t.eles,i=[],a=[],s=void 0,u=[];!t.fixedNodeConstraint||Array.isArray(t.fixedNodeConstraint)&&0!=t.fixedNodeConstraint.length||(t.fixedNodeConstraint=void 0),t.alignmentConstraint&&(!t.alignmentConstraint.vertical||Array.isArray(t.alignmentConstraint.vertical)&&0!=t.alignmentConstraint.vertical.length||(t.alignmentConstraint.vertical=void 0),!t.alignmentConstraint.horizontal||Array.isArray(t.alignmentConstraint.horizontal)&&0!=t.alignmentConstraint.horizontal.length||(t.alignmentConstraint.horizontal=void 0)),!t.relativePlacementConstraint||Array.isArray(t.relativePlacementConstraint)&&0!=t.relativePlacementConstraint.length||(t.relativePlacementConstraint=void 0);var h=t.fixedNodeConstraint||t.alignmentConstraint||t.relativePlacementConstraint;h&&(t.tile=!1,t.packComponents=!1);var d=void 0,f=!1;if(n.layoutUtilities&&t.packComponents&&(d=n.layoutUtilities("get"),d||(d=n.layoutUtilities()),f=!0),r.nodes().length>0)if(f){var p=o.getTopMostNodes(t.eles.nodes());if(s=o.connectComponents(n,t.eles,p),s.forEach((function(e){var t=e.boundingBox();u.push({x:t.x1+t.w/2,y:t.y1+t.h/2})})),t.randomize&&s.forEach((function(e){t.eles=e,i.push(l(t))})),"default"==t.quality||"proof"==t.quality){var g=n.collection();if(t.tile){var m=new Map,v=[],y=[],b=0,x={nodeIndexes:m,xCoords:v,yCoords:y},w=[];if(s.forEach((function(e,t){0==e.edges().length&&(e.nodes().forEach((function(t,n){g.merge(e.nodes()[n]),t.isParent()||(x.nodeIndexes.set(e.nodes()[n].id(),b++),x.xCoords.push(e.nodes()[0].position().x),x.yCoords.push(e.nodes()[0].position().y))})),w.push(t))})),g.length>1){var E=g.boundingBox();u.push({x:E.x1+E.w/2,y:E.y1+E.h/2}),s.push(g),i.push(x);for(var T=w.length-1;T>=0;T--)s.splice(w[T],1),i.splice(w[T],1),u.splice(w[T],1)}}s.forEach((function(e,n){t.eles=e,a.push(c(t,i[n])),o.relocateComponent(u[n],a[n],t)}))}else s.forEach((function(e,n){o.relocateComponent(u[n],i[n],t)}));var A=new Set;if(s.length>1){var N=[],C=r.filter((function(e){return"none"==e.css("display")}));s.forEach((function(e,n){var r=void 0;if("draft"==t.quality&&(r=i[n].nodeIndexes),e.nodes().not(C).length>0){var s={edges:[],nodes:[]},l=void 0;e.nodes().not(C).forEach((function(e){if("draft"==t.quality)if(e.isParent()){var u=o.calcBoundingBox(e,i[n].xCoords,i[n].yCoords,r);s.nodes.push({x:u.topLeftX,y:u.topLeftY,width:u.width,height:u.height})}else l=r.get(e.id()),s.nodes.push({x:i[n].xCoords[l]-e.boundingbox().w/2,y:i[n].yCoords[l]-e.boundingbox().h/2,width:e.boundingbox().w,height:e.boundingbox().h});else a[n][e.id()]&&s.nodes.push({x:a[n][e.id()].getLeft(),y:a[n][e.id()].getTop(),width:a[n][e.id()].getWidth(),height:a[n][e.id()].getHeight()})})),e.edges().forEach((function(e){var l=e.source(),u=e.target();if("none"!=l.css("display")&&"none"!=u.css("display"))if("draft"==t.quality){var c=r.get(l.id()),h=r.get(u.id()),d=[],f=[];if(l.isParent()){var p=o.calcBoundingBox(l,i[n].xCoords,i[n].yCoords,r);d.push(p.topLeftX+p.width/2),d.push(p.topLeftY+p.height/2)}else d.push(i[n].xCoords[c]),d.push(i[n].yCoords[c]);if(u.isParent()){var g=o.calcBoundingBox(u,i[n].xCoords,i[n].yCoords,r);f.push(g.topLeftX+g.width/2),f.push(g.topLeftY+g.height/2)}else f.push(i[n].xCoords[h]),f.push(i[n].yCoords[h]);s.edges.push({startX:d[0],startY:d[1],endX:f[0],endY:f[1]})}else a[n][l.id()]&&a[n][u.id()]&&s.edges.push({startX:a[n][l.id()].getCenterX(),startY:a[n][l.id()].getCenterY(),endX:a[n][u.id()].getCenterX(),endY:a[n][u.id()].getCenterY()})})),s.nodes.length>0&&(N.push(s),A.add(n))}}));var k=d.packComponents(N,t.randomize).shifts;if("draft"==t.quality)i.forEach((function(e,t){var n=e.xCoords.map((function(e){return e+k[t].dx})),r=e.yCoords.map((function(e){return e+k[t].dy}));e.xCoords=n,e.yCoords=r}));else{var R=0;A.forEach((function(e){Object.keys(a[e]).forEach((function(t){var n=a[e][t];n.setCenter(n.getCenterX()+k[R].dx,n.getCenterY()+k[R].dy)})),R++}))}}}else{var I=t.eles.boundingBox();if(u.push({x:I.x1+I.w/2,y:I.y1+I.h/2}),t.randomize){var S=l(t);i.push(S)}"default"==t.quality||"proof"==t.quality?(a.push(c(t,i[0])),o.relocateComponent(u[0],a[0],t)):o.relocateComponent(u[0],i[0],t)}var _=function(e,n){if("default"==t.quality||"proof"==t.quality){"number"===typeof e&&(e=n);var r=void 0,o=void 0,s=e.data("id");return a.forEach((function(e){s in e&&(r={x:e[s].getRect().getCenterX(),y:e[s].getRect().getCenterY()},o=e[s])})),t.nodeDimensionsIncludeLabels&&(o.labelWidth&&("left"==o.labelPosHorizontal?r.x+=o.labelWidth/2:"right"==o.labelPosHorizontal&&(r.x-=o.labelWidth/2)),o.labelHeight&&("top"==o.labelPosVertical?r.y+=o.labelHeight/2:"bottom"==o.labelPosVertical&&(r.y-=o.labelHeight/2))),void 0==r&&(r={x:e.position("x"),y:e.position("y")}),{x:r.x,y:r.y}}var l=void 0;return i.forEach((function(t){var n=t.nodeIndexes.get(e.id());void 0!=n&&(l={x:t.xCoords[n],y:t.yCoords[n]})})),void 0==l&&(l={x:e.position("x"),y:e.position("y")}),{x:l.x,y:l.y}};if("default"==t.quality||"proof"==t.quality||t.randomize){var L=o.calcParentsWithoutChildren(n,r),O=r.filter((function(e){return"none"==e.css("display")}));t.eles=r.not(O),r.nodes().not(":parent").not(O).layoutPositions(e,t,_),L.length>0&&L.forEach((function(e){e.position(_(e))}))}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),e}();e.exports=d},657:(e,t,n)=>{var r=n(548),i=n(140).layoutBase.Matrix,a=n(140).layoutBase.SVD,o=function(e){var t=e.cy,n=e.eles,o=n.nodes(),s=n.nodes(":parent"),l=new Map,u=new Map,c=new Map,h=[],d=[],f=[],p=[],g=[],m=[],v=[],y=[],b=void 0,x=1e8,w=1e-9,E=e.piTol,T=e.samplingType,A=e.nodeSeparation,N=void 0,C=function(){var e=0,t=0,n=!1;while(t<N){e=Math.floor(Math.random()*b),n=!1;for(var r=0;r<t;r++)if(p[r]==e){n=!0;break}n||(p[t]=e,t++)}},k=function(e,t,n){for(var r=[],i=0,a=0,o=0,s=void 0,l=[],c=0,d=1,f=0;f<b;f++)l[f]=x;r[a]=e,l[e]=0;while(a>=i){o=r[i++];for(var p=h[o],v=0;v<p.length;v++)s=u.get(p[v]),l[s]==x&&(l[s]=l[o]+1,r[++a]=s);m[o][t]=l[o]*A}if(n){for(var y=0;y<b;y++)m[y][t]<g[y]&&(g[y]=m[y][t]);for(var w=0;w<b;w++)g[w]>c&&(c=g[w],d=w)}return d},R=function(e){var t=void 0;if(e){t=Math.floor(Math.random()*b);for(var n=0;n<b;n++)g[n]=x;for(var r=0;r<N;r++)p[r]=t,t=k(t,r,e)}else{C();for(var i=0;i<N;i++)k(p[i],i,e,!1)}for(var a=0;a<b;a++)for(var o=0;o<N;o++)m[a][o]*=m[a][o];for(var s=0;s<N;s++)v[s]=[];for(var l=0;l<N;l++)for(var u=0;u<N;u++)v[l][u]=m[p[u]][l]},I=function(){for(var e=a.svd(v),t=e.S,n=e.U,r=e.V,o=t[0]*t[0]*t[0],s=[],l=0;l<N;l++){s[l]=[];for(var u=0;u<N;u++)s[l][u]=0,l==u&&(s[l][u]=t[l]/(t[l]*t[l]+o/(t[l]*t[l])))}y=i.multMat(i.multMat(r,s),i.transpose(n))},S=function(){for(var e=void 0,t=void 0,n=[],r=[],a=[],o=[],s=0;s<b;s++)n[s]=Math.random(),r[s]=Math.random();n=i.normalize(n),r=i.normalize(r);var l=w,u=w,c=void 0;while(1){0;for(var h=0;h<b;h++)a[h]=n[h];if(n=i.multGamma(i.multL(i.multGamma(a),m,y)),e=i.dotProduct(a,n),n=i.normalize(n),l=i.dotProduct(a,n),c=Math.abs(l/u),c<=1+E&&c>=1)break;u=l}for(var p=0;p<b;p++)a[p]=n[p];u=w;while(1){0;for(var g=0;g<b;g++)o[g]=r[g];if(o=i.minusOp(o,i.multCons(a,i.dotProduct(a,o))),r=i.multGamma(i.multL(i.multGamma(o),m,y)),t=i.dotProduct(o,r),r=i.normalize(r),l=i.dotProduct(o,r),c=Math.abs(l/u),c<=1+E&&c>=1)break;u=l}for(var v=0;v<b;v++)o[v]=r[v];d=i.multCons(a,Math.sqrt(Math.abs(e))),f=i.multCons(o,Math.sqrt(Math.abs(t)))};r.connectComponents(t,n,r.getTopMostNodes(o),l),s.forEach((function(e){r.connectComponents(t,n,r.getTopMostNodes(e.descendants().intersection(n)),l)}));for(var _=0,L=0;L<o.length;L++)o[L].isParent()||u.set(o[L].id(),_++);var O=!0,M=!1,P=void 0;try{for(var D,$=l.keys()[Symbol.iterator]();!(O=(D=$.next()).done);O=!0){var F=D.value;u.set(F,_++)}}catch(ne){M=!0,P=ne}finally{try{!O&&$.return&&$.return()}finally{if(M)throw P}}for(var B=0;B<u.size;B++)h[B]=[];s.forEach((function(e){var t=e.children().intersection(n);while(0==t.nodes(":childless").length)t=t.nodes()[0].children().intersection(n);var r=0,i=t.nodes(":childless")[0].connectedEdges().length;t.nodes(":childless").forEach((function(e,t){e.connectedEdges().length<i&&(i=e.connectedEdges().length,r=t)})),c.set(e.id(),t.nodes(":childless")[r].id())})),o.forEach((function(e){var t=void 0;t=e.isParent()?u.get(c.get(e.id())):u.get(e.id()),e.neighborhood().nodes().forEach((function(r){n.intersection(e.edgesWith(r)).length>0&&(r.isParent()?h[t].push(c.get(r.id())):h[t].push(r.id()))}))}));var G=function(e){var n=u.get(e),r=void 0;l.get(e).forEach((function(i){r=t.getElementById(i).isParent()?c.get(i):i,h[n].push(r),h[u.get(r)].push(e)}))},U=!0,z=!1,V=void 0;try{for(var j,H=l.keys()[Symbol.iterator]();!(U=(j=H.next()).done);U=!0){var Y=j.value;G(Y)}}catch(ne){z=!0,V=ne}finally{try{!U&&H.return&&H.return()}finally{if(z)throw V}}b=u.size;var X=void 0;if(b>2){N=b<e.sampleSize?b:e.sampleSize;for(var W=0;W<b;W++)m[W]=[];for(var K=0;K<N;K++)y[K]=[];return"draft"==e.quality||"all"==e.step?(R(T),I(),S(),X={nodeIndexes:u,xCoords:d,yCoords:f}):(u.forEach((function(e,n){d.push(t.getElementById(n).position("x")),f.push(t.getElementById(n).position("y"))})),X={nodeIndexes:u,xCoords:d,yCoords:f}),X}var q=u.keys(),Z=t.getElementById(q.next().value),Q=Z.position(),J=Z.outerWidth();if(d.push(Q.x),f.push(Q.y),2==b){var ee=t.getElementById(q.next().value),te=ee.outerWidth();d.push(Q.x+J/2+te/2+e.idealEdgeLength),f.push(Q.y)}return X={nodeIndexes:u,xCoords:d,yCoords:f},X};e.exports={spectralLayout:o}},579:(e,t,n)=>{var r=n(212),i=function(e){e&&e("layout","fcose",r)};"undefined"!==typeof cytoscape&&i(cytoscape),e.exports=i},140:t=>{t.exports=e}},n={};function r(e){var i=n[e];if(void 0!==i)return i.exports;var a=n[e]={exports:{}};return t[e](a,a.exports,r),a.exports}var i=r(579);return i})()}))},41709:function(e,t,n){(function(t,r){e.exports=r(n(1917))})(0,(function(e){return(()=>{"use strict";var t={45:(e,t,n)=>{var r={};r.layoutBase=n(551),r.CoSEConstants=n(806),r.CoSEEdge=n(767),r.CoSEGraph=n(880),r.CoSEGraphManager=n(578),r.CoSELayout=n(765),r.CoSENode=n(991),r.ConstraintHandler=n(902),e.exports=r},806:(e,t,n)=>{var r=n(551).FDLayoutConstants;function i(){}for(var a in r)i[a]=r[a];i.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,i.DEFAULT_RADIAL_SEPARATION=r.DEFAULT_EDGE_LENGTH,i.DEFAULT_COMPONENT_SEPERATION=60,i.TILE=!0,i.TILING_PADDING_VERTICAL=10,i.TILING_PADDING_HORIZONTAL=10,i.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,i.ENFORCE_CONSTRAINTS=!0,i.APPLY_LAYOUT=!0,i.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,i.TREE_REDUCTION_ON_INCREMENTAL=!0,i.PURE_INCREMENTAL=i.DEFAULT_INCREMENTAL,e.exports=i},767:(e,t,n)=>{var r=n(551).FDLayoutEdge;function i(e,t,n){r.call(this,e,t,n)}for(var a in i.prototype=Object.create(r.prototype),r)i[a]=r[a];e.exports=i},880:(e,t,n)=>{var r=n(551).LGraph;function i(e,t,n){r.call(this,e,t,n)}for(var a in i.prototype=Object.create(r.prototype),r)i[a]=r[a];e.exports=i},578:(e,t,n)=>{var r=n(551).LGraphManager;function i(e){r.call(this,e)}for(var a in i.prototype=Object.create(r.prototype),r)i[a]=r[a];e.exports=i},765:(e,t,n)=>{var r=n(551).FDLayout,i=n(578),a=n(880),o=n(991),s=n(767),l=n(806),u=n(902),c=n(551).FDLayoutConstants,h=n(551).LayoutConstants,d=n(551).Point,f=n(551).PointD,p=n(551).DimensionD,g=n(551).Layout,m=n(551).Integer,v=n(551).IGeometry,y=n(551).LGraph,b=n(551).Transform,x=n(551).LinkedList;function w(){r.call(this),this.toBeTiled={},this.constraints={}}for(var E in w.prototype=Object.create(r.prototype),r)w[E]=r[E];w.prototype.newGraphManager=function(){var e=new i(this);return this.graphManager=e,e},w.prototype.newGraph=function(e){return new a(null,this.graphManager,e)},w.prototype.newNode=function(e){return new o(this.graphManager,e)},w.prototype.newEdge=function(e){return new s(null,null,e)},w.prototype.initParameters=function(){r.prototype.initParameters.call(this,arguments),this.isSubLayout||(l.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=l.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=l.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=c.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=c.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=c.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=c.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},w.prototype.initSpringEmbedder=function(){r.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/c.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},w.prototype.layout=function(){var e=h.DEFAULT_CREATE_BENDS_AS_NEEDED;return e&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},w.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),this.incremental){if(l.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();t=new Set(this.getAllNodes()),n=this.nodesWithGravity.filter((function(e){return t.has(e)}));this.graphManager.setAllNodesToApplyGravitation(n)}}else{var e=this.getFlatForest();if(e.length>0)this.positionNodesRadially(e);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var t=new Set(this.getAllNodes()),n=this.nodesWithGravity.filter((function(e){return t.has(e)}));this.graphManager.setAllNodesToApplyGravitation(n),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(u.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),l.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},w.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished){if(!(this.prunedNodesAll.length>0))return!0;this.isTreeGrowing=!0}if(this.totalIterations%c.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged()){if(!(this.prunedNodesAll.length>0))return!0;this.isTreeGrowing=!0}this.coolingCycle++,0==this.layoutQuality?this.coolingAdjuster=this.coolingCycle:1==this.layoutQuality&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var e=new Set(this.getAllNodes()),t=this.nodesWithGravity.filter((function(t){return e.has(t)}));this.graphManager.setAllNodesToApplyGravitation(t),this.graphManager.updateBounds(),this.updateGrid(),l.PURE_INCREMENTAL?this.coolingFactor=c.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=c.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),l.PURE_INCREMENTAL?this.coolingFactor=c.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=c.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var n=!this.isTreeGrowing&&!this.isGrowthFinished,r=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(n,r),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},w.prototype.getPositionsData=function(){for(var e=this.graphManager.getAllNodes(),t={},n=0;n<e.length;n++){var r=e[n].rect,i=e[n].id;t[i]={id:i,x:r.getCenterX(),y:r.getCenterY(),w:r.width,h:r.height}}return t},w.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var e=!1;if("during"===c.ANIMATE)this.emit("layoutstarted");else{while(!e)e=this.tick();this.graphManager.updateBounds()}},w.prototype.moveNodes=function(){for(var e,t=this.getAllNodes(),n=0;n<t.length;n++)e=t[n],e.calculateDisplacement();Object.keys(this.constraints).length>0&&this.updateDisplacements();for(n=0;n<t.length;n++)e=t[n],e.move()},w.prototype.initConstraintVariables=function(){var e=this;this.idToNodeMap=new Map,this.fixedNodeSet=new Set;for(var t=this.graphManager.getAllNodes(),n=0;n<t.length;n++){var r=t[n];this.idToNodeMap.set(r.id,r)}var i=function t(n){for(var r,i=n.getChild().getNodes(),a=0,o=0;o<i.length;o++)r=i[o],null==r.getChild()?e.fixedNodeSet.has(r.id)&&(a+=100):a+=t(r);return a};if(this.constraints.fixedNodeConstraint){this.constraints.fixedNodeConstraint.forEach((function(t){e.fixedNodeSet.add(t.nodeId)}));for(t=this.graphManager.getAllNodes(),n=0;n<t.length;n++)if(r=t[n],null!=r.getChild()){var a=i(r);a>0&&(r.fixedNodeWeight=a)}}if(this.constraints.relativePlacementConstraint){var o=new Map,s=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach((function(t){e.fixedNodesOnHorizontal.add(t),e.fixedNodesOnVertical.add(t)})),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical){var u=this.constraints.alignmentConstraint.vertical;for(n=0;n<u.length;n++)this.dummyToNodeForVerticalAlignment.set("dummy"+n,[]),u[n].forEach((function(t){o.set(t,"dummy"+n),e.dummyToNodeForVerticalAlignment.get("dummy"+n).push(t),e.fixedNodeSet.has(t)&&e.fixedNodesOnHorizontal.add("dummy"+n)}))}if(this.constraints.alignmentConstraint.horizontal){var c=this.constraints.alignmentConstraint.horizontal;for(n=0;n<c.length;n++)this.dummyToNodeForHorizontalAlignment.set("dummy"+n,[]),c[n].forEach((function(t){s.set(t,"dummy"+n),e.dummyToNodeForHorizontalAlignment.get("dummy"+n).push(t),e.fixedNodeSet.has(t)&&e.fixedNodesOnVertical.add("dummy"+n)}))}}if(l.RELAX_MOVEMENT_ON_CONSTRAINTS)this.shuffle=function(e){var t,n,r;for(r=e.length-1;r>=2*e.length/3;r--)t=Math.floor(Math.random()*(r+1)),n=e[r],e[r]=e[t],e[t]=n;return e},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(t){if(t.left){var n=o.has(t.left)?o.get(t.left):t.left,r=o.has(t.right)?o.get(t.right):t.right;e.nodesInRelativeHorizontal.includes(n)||(e.nodesInRelativeHorizontal.push(n),e.nodeToRelativeConstraintMapHorizontal.set(n,[]),e.dummyToNodeForVerticalAlignment.has(n)?e.nodeToTempPositionMapHorizontal.set(n,e.idToNodeMap.get(e.dummyToNodeForVerticalAlignment.get(n)[0]).getCenterX()):e.nodeToTempPositionMapHorizontal.set(n,e.idToNodeMap.get(n).getCenterX())),e.nodesInRelativeHorizontal.includes(r)||(e.nodesInRelativeHorizontal.push(r),e.nodeToRelativeConstraintMapHorizontal.set(r,[]),e.dummyToNodeForVerticalAlignment.has(r)?e.nodeToTempPositionMapHorizontal.set(r,e.idToNodeMap.get(e.dummyToNodeForVerticalAlignment.get(r)[0]).getCenterX()):e.nodeToTempPositionMapHorizontal.set(r,e.idToNodeMap.get(r).getCenterX())),e.nodeToRelativeConstraintMapHorizontal.get(n).push({right:r,gap:t.gap}),e.nodeToRelativeConstraintMapHorizontal.get(r).push({left:n,gap:t.gap})}else{var i=s.has(t.top)?s.get(t.top):t.top,a=s.has(t.bottom)?s.get(t.bottom):t.bottom;e.nodesInRelativeVertical.includes(i)||(e.nodesInRelativeVertical.push(i),e.nodeToRelativeConstraintMapVertical.set(i,[]),e.dummyToNodeForHorizontalAlignment.has(i)?e.nodeToTempPositionMapVertical.set(i,e.idToNodeMap.get(e.dummyToNodeForHorizontalAlignment.get(i)[0]).getCenterY()):e.nodeToTempPositionMapVertical.set(i,e.idToNodeMap.get(i).getCenterY())),e.nodesInRelativeVertical.includes(a)||(e.nodesInRelativeVertical.push(a),e.nodeToRelativeConstraintMapVertical.set(a,[]),e.dummyToNodeForHorizontalAlignment.has(a)?e.nodeToTempPositionMapVertical.set(a,e.idToNodeMap.get(e.dummyToNodeForHorizontalAlignment.get(a)[0]).getCenterY()):e.nodeToTempPositionMapVertical.set(a,e.idToNodeMap.get(a).getCenterY())),e.nodeToRelativeConstraintMapVertical.get(i).push({bottom:a,gap:t.gap}),e.nodeToRelativeConstraintMapVertical.get(a).push({top:i,gap:t.gap})}}));else{var h=new Map,d=new Map;this.constraints.relativePlacementConstraint.forEach((function(e){if(e.left){var t=o.has(e.left)?o.get(e.left):e.left,n=o.has(e.right)?o.get(e.right):e.right;h.has(t)?h.get(t).push(n):h.set(t,[n]),h.has(n)?h.get(n).push(t):h.set(n,[t])}else{var r=s.has(e.top)?s.get(e.top):e.top,i=s.has(e.bottom)?s.get(e.bottom):e.bottom;d.has(r)?d.get(r).push(i):d.set(r,[i]),d.has(i)?d.get(i).push(r):d.set(i,[r])}}));var f=function(e,t){var n=[],r=[],i=new x,a=new Set,o=0;return e.forEach((function(s,l){if(!a.has(l)){n[o]=[],r[o]=!1;var u=l;i.push(u),a.add(u),n[o].push(u);while(0!=i.length){u=i.shift(),t.has(u)&&(r[o]=!0);var c=e.get(u);c.forEach((function(e){a.has(e)||(i.push(e),a.add(e),n[o].push(e))}))}o++}})),{components:n,isFixed:r}},p=f(h,e.fixedNodesOnHorizontal);this.componentsOnHorizontal=p.components,this.fixedComponentsOnHorizontal=p.isFixed;var g=f(d,e.fixedNodesOnVertical);this.componentsOnVertical=g.components,this.fixedComponentsOnVertical=g.isFixed}}},w.prototype.updateDisplacements=function(){var e=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach((function(t){var n=e.idToNodeMap.get(t.nodeId);n.displacementX=0,n.displacementY=0})),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var t=this.constraints.alignmentConstraint.vertical,n=0;n<t.length;n++){for(var r=0,i=0;i<t[n].length;i++){if(this.fixedNodeSet.has(t[n][i])){r=0;break}r+=this.idToNodeMap.get(t[n][i]).displacementX}var a=r/t[n].length;for(i=0;i<t[n].length;i++)this.idToNodeMap.get(t[n][i]).displacementX=a}if(this.constraints.alignmentConstraint.horizontal){var o=this.constraints.alignmentConstraint.horizontal;for(n=0;n<o.length;n++){var s=0;for(i=0;i<o[n].length;i++){if(this.fixedNodeSet.has(o[n][i])){s=0;break}s+=this.idToNodeMap.get(o[n][i]).displacementY}var u=s/o[n].length;for(i=0;i<o[n].length;i++)this.idToNodeMap.get(o[n][i]).displacementY=u}}}if(this.constraints.relativePlacementConstraint)if(l.RELAX_MOVEMENT_ON_CONSTRAINTS)this.totalIterations%10==0&&(this.shuffle(this.nodesInRelativeHorizontal),this.shuffle(this.nodesInRelativeVertical)),this.nodesInRelativeHorizontal.forEach((function(t){if(!e.fixedNodesOnHorizontal.has(t)){var n=0;n=e.dummyToNodeForVerticalAlignment.has(t)?e.idToNodeMap.get(e.dummyToNodeForVerticalAlignment.get(t)[0]).displacementX:e.idToNodeMap.get(t).displacementX,e.nodeToRelativeConstraintMapHorizontal.get(t).forEach((function(r){if(r.right){var i=e.nodeToTempPositionMapHorizontal.get(r.right)-e.nodeToTempPositionMapHorizontal.get(t)-n;i<r.gap&&(n-=r.gap-i)}else{i=e.nodeToTempPositionMapHorizontal.get(t)-e.nodeToTempPositionMapHorizontal.get(r.left)+n;i<r.gap&&(n+=r.gap-i)}})),e.nodeToTempPositionMapHorizontal.set(t,e.nodeToTempPositionMapHorizontal.get(t)+n),e.dummyToNodeForVerticalAlignment.has(t)?e.dummyToNodeForVerticalAlignment.get(t).forEach((function(t){e.idToNodeMap.get(t).displacementX=n})):e.idToNodeMap.get(t).displacementX=n}})),this.nodesInRelativeVertical.forEach((function(t){if(!e.fixedNodesOnHorizontal.has(t)){var n=0;n=e.dummyToNodeForHorizontalAlignment.has(t)?e.idToNodeMap.get(e.dummyToNodeForHorizontalAlignment.get(t)[0]).displacementY:e.idToNodeMap.get(t).displacementY,e.nodeToRelativeConstraintMapVertical.get(t).forEach((function(r){if(r.bottom){var i=e.nodeToTempPositionMapVertical.get(r.bottom)-e.nodeToTempPositionMapVertical.get(t)-n;i<r.gap&&(n-=r.gap-i)}else{i=e.nodeToTempPositionMapVertical.get(t)-e.nodeToTempPositionMapVertical.get(r.top)+n;i<r.gap&&(n+=r.gap-i)}})),e.nodeToTempPositionMapVertical.set(t,e.nodeToTempPositionMapVertical.get(t)+n),e.dummyToNodeForHorizontalAlignment.has(t)?e.dummyToNodeForHorizontalAlignment.get(t).forEach((function(t){e.idToNodeMap.get(t).displacementY=n})):e.idToNodeMap.get(t).displacementY=n}}));else{for(n=0;n<this.componentsOnHorizontal.length;n++){var c=this.componentsOnHorizontal[n];if(this.fixedComponentsOnHorizontal[n])for(i=0;i<c.length;i++)this.dummyToNodeForVerticalAlignment.has(c[i])?this.dummyToNodeForVerticalAlignment.get(c[i]).forEach((function(t){e.idToNodeMap.get(t).displacementX=0})):this.idToNodeMap.get(c[i]).displacementX=0;else{var h=0,d=0;for(i=0;i<c.length;i++)if(this.dummyToNodeForVerticalAlignment.has(c[i])){var f=this.dummyToNodeForVerticalAlignment.get(c[i]);h+=f.length*this.idToNodeMap.get(f[0]).displacementX,d+=f.length}else h+=this.idToNodeMap.get(c[i]).displacementX,d++;var p=h/d;for(i=0;i<c.length;i++)this.dummyToNodeForVerticalAlignment.has(c[i])?this.dummyToNodeForVerticalAlignment.get(c[i]).forEach((function(t){e.idToNodeMap.get(t).displacementX=p})):this.idToNodeMap.get(c[i]).displacementX=p}}for(n=0;n<this.componentsOnVertical.length;n++){c=this.componentsOnVertical[n];if(this.fixedComponentsOnVertical[n])for(i=0;i<c.length;i++)this.dummyToNodeForHorizontalAlignment.has(c[i])?this.dummyToNodeForHorizontalAlignment.get(c[i]).forEach((function(t){e.idToNodeMap.get(t).displacementY=0})):this.idToNodeMap.get(c[i]).displacementY=0;else{for(h=0,d=0,i=0;i<c.length;i++)if(this.dummyToNodeForHorizontalAlignment.has(c[i])){f=this.dummyToNodeForHorizontalAlignment.get(c[i]);h+=f.length*this.idToNodeMap.get(f[0]).displacementY,d+=f.length}else h+=this.idToNodeMap.get(c[i]).displacementY,d++;for(p=h/d,i=0;i<c.length;i++)this.dummyToNodeForHorizontalAlignment.has(c[i])?this.dummyToNodeForHorizontalAlignment.get(c[i]).forEach((function(t){e.idToNodeMap.get(t).displacementY=p})):this.idToNodeMap.get(c[i]).displacementY=p}}}},w.prototype.calculateNodesToApplyGravitationTo=function(){var e,t,n=[],r=this.graphManager.getGraphs(),i=r.length;for(t=0;t<i;t++)e=r[t],e.updateConnected(),e.isConnected||(n=n.concat(e.getNodes()));return n},w.prototype.createBendpoints=function(){var e=[];e=e.concat(this.graphManager.getAllEdges());var t,n=new Set;for(t=0;t<e.length;t++){var r=e[t];if(!n.has(r)){var i=r.getSource(),a=r.getTarget();if(i==a)r.getBendpoints().push(new f),r.getBendpoints().push(new f),this.createDummyNodesForBendpoints(r),n.add(r);else{var o=[];if(o=o.concat(i.getEdgeListToNode(a)),o=o.concat(a.getEdgeListToNode(i)),!n.has(o[0])){var s;if(o.length>1)for(s=0;s<o.length;s++){var l=o[s];l.getBendpoints().push(new f),this.createDummyNodesForBendpoints(l)}o.forEach((function(e){n.add(e)}))}}}if(n.size==e.length)break}},w.prototype.positionNodesRadially=function(e){for(var t=new d(0,0),n=Math.ceil(Math.sqrt(e.length)),r=0,i=0,a=0,o=new f(0,0),s=0;s<e.length;s++){s%n==0&&(a=0,i=r,0!=s&&(i+=l.DEFAULT_COMPONENT_SEPERATION),r=0);var u=e[s],c=g.findCenterOfTree(u);t.x=a,t.y=i,o=w.radialLayout(u,c,t),o.y>r&&(r=Math.floor(o.y)),a=Math.floor(o.x+l.DEFAULT_COMPONENT_SEPERATION)}this.transform(new f(h.WORLD_CENTER_X-o.x/2,h.WORLD_CENTER_Y-o.y/2))},w.radialLayout=function(e,t,n){var r=Math.max(this.maxDiagonalInTree(e),l.DEFAULT_RADIAL_SEPARATION);w.branchRadialLayout(t,null,0,359,0,r);var i=y.calculateBounds(e),a=new b;a.setDeviceOrgX(i.getMinX()),a.setDeviceOrgY(i.getMinY()),a.setWorldOrgX(n.x),a.setWorldOrgY(n.y);for(var o=0;o<e.length;o++){var s=e[o];s.transform(a)}var u=new f(i.getMaxX(),i.getMaxY());return a.inverseTransformPoint(u)},w.branchRadialLayout=function(e,t,n,r,i,a){var o=(r-n+1)/2;o<0&&(o+=180);var s=(o+n)%360,l=s*v.TWO_PI/360,u=(Math.cos(l),i*Math.cos(l)),c=i*Math.sin(l);e.setCenter(u,c);var h=[];h=h.concat(e.getEdges());var d=h.length;null!=t&&d--;var f,p=0,g=h.length,m=e.getEdgesBetween(t);while(m.length>1){var y=m[0];m.splice(0,1);var b=h.indexOf(y);b>=0&&h.splice(b,1),g--,d--}f=null!=t?(h.indexOf(m[0])+1)%g:0;for(var x=Math.abs(r-n)/d,E=f;p!=d;E=++E%g){var T=h[E].getOtherEnd(e);if(T!=t){var A=(n+p*x)%360,N=(A+x)%360;w.branchRadialLayout(T,e,A,N,i+a,a),p++}}},w.maxDiagonalInTree=function(e){for(var t=m.MIN_VALUE,n=0;n<e.length;n++){var r=e[n],i=r.getDiagonal();i>t&&(t=i)}return t},w.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},w.prototype.groupZeroDegreeMembers=function(){var e=this,t={};this.memberGroups={},this.idToDummyNode={};for(var n=[],r=this.graphManager.getAllNodes(),i=0;i<r.length;i++){var a=r[i],s=a.getParent();0!==this.getNodeDegreeWithChildren(a)||void 0!=s.id&&this.getToBeTiled(s)||n.push(a)}for(i=0;i<n.length;i++){a=n[i];var l=a.getParent().id;"undefined"===typeof t[l]&&(t[l]=[]),t[l]=t[l].concat(a)}Object.keys(t).forEach((function(n){if(t[n].length>1){var r="DummyCompound_"+n;e.memberGroups[r]=t[n];var i=t[n][0].getParent(),a=new o(e.graphManager);a.id=r,a.paddingLeft=i.paddingLeft||0,a.paddingRight=i.paddingRight||0,a.paddingBottom=i.paddingBottom||0,a.paddingTop=i.paddingTop||0,e.idToDummyNode[r]=a;var s=e.getGraphManager().add(e.newGraph(),a),l=i.getChild();l.add(a);for(var u=0;u<t[n].length;u++){var c=t[n][u];l.remove(c),s.add(c)}}}))},w.prototype.clearCompounds=function(){var e={},t={};this.performDFSOnCompounds();for(var n=0;n<this.compoundOrder.length;n++)t[this.compoundOrder[n].id]=this.compoundOrder[n],e[this.compoundOrder[n].id]=[].concat(this.compoundOrder[n].getChild().getNodes()),this.graphManager.remove(this.compoundOrder[n].getChild()),this.compoundOrder[n].child=null;this.graphManager.resetAllNodes(),this.tileCompoundMembers(e,t)},w.prototype.clearZeroDegreeMembers=function(){var e=this,t=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach((function(n){var r=e.idToDummyNode[n];if(t[n]=e.tileNodes(e.memberGroups[n],r.paddingLeft+r.paddingRight),r.rect.width=t[n].width,r.rect.height=t[n].height,r.setCenter(t[n].centerX,t[n].centerY),r.labelMarginLeft=0,r.labelMarginTop=0,l.NODE_DIMENSIONS_INCLUDE_LABELS){var i=r.rect.width,a=r.rect.height;r.labelWidth&&("left"==r.labelPosHorizontal?(r.rect.x-=r.labelWidth,r.setWidth(i+r.labelWidth),r.labelMarginLeft=r.labelWidth):"center"==r.labelPosHorizontal&&r.labelWidth>i?(r.rect.x-=(r.labelWidth-i)/2,r.setWidth(r.labelWidth),r.labelMarginLeft=(r.labelWidth-i)/2):"right"==r.labelPosHorizontal&&r.setWidth(i+r.labelWidth)),r.labelHeight&&("top"==r.labelPosVertical?(r.rect.y-=r.labelHeight,r.setHeight(a+r.labelHeight),r.labelMarginTop=r.labelHeight):"center"==r.labelPosVertical&&r.labelHeight>a?(r.rect.y-=(r.labelHeight-a)/2,r.setHeight(r.labelHeight),r.labelMarginTop=(r.labelHeight-a)/2):"bottom"==r.labelPosVertical&&r.setHeight(a+r.labelHeight))}}))},w.prototype.repopulateCompounds=function(){for(var e=this.compoundOrder.length-1;e>=0;e--){var t=this.compoundOrder[e],n=t.id,r=t.paddingLeft,i=t.paddingTop,a=t.labelMarginLeft,o=t.labelMarginTop;this.adjustLocations(this.tiledMemberPack[n],t.rect.x,t.rect.y,r,i,a,o)}},w.prototype.repopulateZeroDegreeMembers=function(){var e=this,t=this.tiledZeroDegreePack;Object.keys(t).forEach((function(n){var r=e.idToDummyNode[n],i=r.paddingLeft,a=r.paddingTop,o=r.labelMarginLeft,s=r.labelMarginTop;e.adjustLocations(t[n],r.rect.x,r.rect.y,i,a,o,s)}))},w.prototype.getToBeTiled=function(e){var t=e.id;if(null!=this.toBeTiled[t])return this.toBeTiled[t];var n=e.getChild();if(null==n)return this.toBeTiled[t]=!1,!1;for(var r=n.getNodes(),i=0;i<r.length;i++){var a=r[i];if(this.getNodeDegree(a)>0)return this.toBeTiled[t]=!1,!1;if(null!=a.getChild()){if(!this.getToBeTiled(a))return this.toBeTiled[t]=!1,!1}else this.toBeTiled[a.id]=!1}return this.toBeTiled[t]=!0,!0},w.prototype.getNodeDegree=function(e){e.id;for(var t=e.getEdges(),n=0,r=0;r<t.length;r++){var i=t[r];i.getSource().id!==i.getTarget().id&&(n+=1)}return n},w.prototype.getNodeDegreeWithChildren=function(e){var t=this.getNodeDegree(e);if(null==e.getChild())return t;for(var n=e.getChild().getNodes(),r=0;r<n.length;r++){var i=n[r];t+=this.getNodeDegreeWithChildren(i)}return t},w.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},w.prototype.fillCompexOrderByDFS=function(e){for(var t=0;t<e.length;t++){var n=e[t];null!=n.getChild()&&this.fillCompexOrderByDFS(n.getChild().getNodes()),this.getToBeTiled(n)&&this.compoundOrder.push(n)}},w.prototype.adjustLocations=function(e,t,n,r,i,a,o){t+=r+a,n+=i+o;for(var s=t,l=0;l<e.rows.length;l++){var u=e.rows[l];t=s;for(var c=0,h=0;h<u.length;h++){var d=u[h];d.rect.x=t,d.rect.y=n,t+=d.rect.width+e.horizontalPadding,d.rect.height>c&&(c=d.rect.height)}n+=c+e.verticalPadding}},w.prototype.tileCompoundMembers=function(e,t){var n=this;this.tiledMemberPack=[],Object.keys(e).forEach((function(r){var i=t[r];if(n.tiledMemberPack[r]=n.tileNodes(e[r],i.paddingLeft+i.paddingRight),i.rect.width=n.tiledMemberPack[r].width,i.rect.height=n.tiledMemberPack[r].height,i.setCenter(n.tiledMemberPack[r].centerX,n.tiledMemberPack[r].centerY),i.labelMarginLeft=0,i.labelMarginTop=0,l.NODE_DIMENSIONS_INCLUDE_LABELS){var a=i.rect.width,o=i.rect.height;i.labelWidth&&("left"==i.labelPosHorizontal?(i.rect.x-=i.labelWidth,i.setWidth(a+i.labelWidth),i.labelMarginLeft=i.labelWidth):"center"==i.labelPosHorizontal&&i.labelWidth>a?(i.rect.x-=(i.labelWidth-a)/2,i.setWidth(i.labelWidth),i.labelMarginLeft=(i.labelWidth-a)/2):"right"==i.labelPosHorizontal&&i.setWidth(a+i.labelWidth)),i.labelHeight&&("top"==i.labelPosVertical?(i.rect.y-=i.labelHeight,i.setHeight(o+i.labelHeight),i.labelMarginTop=i.labelHeight):"center"==i.labelPosVertical&&i.labelHeight>o?(i.rect.y-=(i.labelHeight-o)/2,i.setHeight(i.labelHeight),i.labelMarginTop=(i.labelHeight-o)/2):"bottom"==i.labelPosVertical&&i.setHeight(o+i.labelHeight))}}))},w.prototype.tileNodes=function(e,t){var n,r=this.tileNodesByFavoringDim(e,t,!0),i=this.tileNodesByFavoringDim(e,t,!1),a=this.getOrgRatio(r),o=this.getOrgRatio(i);return n=o<a?i:r,n},w.prototype.getOrgRatio=function(e){var t=e.width,n=e.height,r=t/n;return r<1&&(r=1/r),r},w.prototype.calcIdealRowWidth=function(e,t){var n=l.TILING_PADDING_VERTICAL,r=l.TILING_PADDING_HORIZONTAL,i=e.length,a=0,o=0,s=0;e.forEach((function(e){a+=e.getWidth(),o+=e.getHeight(),e.getWidth()>s&&(s=e.getWidth())}));var u,c=a/i,h=o/i,d=Math.pow(n-r,2)+4*(c+r)*(h+n)*i,f=(r-n+Math.sqrt(d))/(2*(c+r));t?(u=Math.ceil(f),u==f&&u++):u=Math.floor(f);var p=u*(c+r)-r;return s>p&&(p=s),p+=2*r,p},w.prototype.tileNodesByFavoringDim=function(e,t,n){var r=l.TILING_PADDING_VERTICAL,i=l.TILING_PADDING_HORIZONTAL,a=l.TILING_COMPARE_BY,o={rows:[],rowWidth:[],rowHeight:[],width:0,height:t,verticalPadding:r,horizontalPadding:i,centerX:0,centerY:0};a&&(o.idealRowWidth=this.calcIdealRowWidth(e,n));var s=function(e){return e.rect.width*e.rect.height},u=function(e,t){return s(t)-s(e)};e.sort((function(e,t){var n=u;return o.idealRowWidth?(n=a,n(e.id,t.id)):n(e,t)}));for(var c=0,h=0,d=0;d<e.length;d++){var f=e[d];c+=f.getCenterX(),h+=f.getCenterY()}o.centerX=c/e.length,o.centerY=h/e.length;for(d=0;d<e.length;d++){f=e[d];if(0==o.rows.length)this.insertNodeToRow(o,f,0,t);else if(this.canAddHorizontal(o,f.rect.width,f.rect.height)){var p=o.rows.length-1;o.idealRowWidth||(p=this.getShortestRowIndex(o)),this.insertNodeToRow(o,f,p,t)}else this.insertNodeToRow(o,f,o.rows.length,t);this.shiftToLastRow(o)}return o},w.prototype.insertNodeToRow=function(e,t,n,r){var i=r;if(n==e.rows.length){var a=[];e.rows.push(a),e.rowWidth.push(i),e.rowHeight.push(0)}var o=e.rowWidth[n]+t.rect.width;e.rows[n].length>0&&(o+=e.horizontalPadding),e.rowWidth[n]=o,e.width<o&&(e.width=o);var s=t.rect.height;n>0&&(s+=e.verticalPadding);var l=0;s>e.rowHeight[n]&&(l=e.rowHeight[n],e.rowHeight[n]=s,l=e.rowHeight[n]-l),e.height+=l,e.rows[n].push(t)},w.prototype.getShortestRowIndex=function(e){for(var t=-1,n=Number.MAX_VALUE,r=0;r<e.rows.length;r++)e.rowWidth[r]<n&&(t=r,n=e.rowWidth[r]);return t},w.prototype.getLongestRowIndex=function(e){for(var t=-1,n=Number.MIN_VALUE,r=0;r<e.rows.length;r++)e.rowWidth[r]>n&&(t=r,n=e.rowWidth[r]);return t},w.prototype.canAddHorizontal=function(e,t,n){if(e.idealRowWidth){var r=e.rows.length-1,i=e.rowWidth[r];return i+t+e.horizontalPadding<=e.idealRowWidth}var a=this.getShortestRowIndex(e);if(a<0)return!0;var o=e.rowWidth[a];if(o+e.horizontalPadding+t<=e.width)return!0;var s,l,u=0;return e.rowHeight[a]<n&&a>0&&(u=n+e.verticalPadding-e.rowHeight[a]),s=e.width-o>=t+e.horizontalPadding?(e.height+u)/(o+t+e.horizontalPadding):(e.height+u)/e.width,u=n+e.verticalPadding,l=e.width<t?(e.height+u)/t:(e.height+u)/e.width,l<1&&(l=1/l),s<1&&(s=1/s),s<l},w.prototype.shiftToLastRow=function(e){var t=this.getLongestRowIndex(e),n=e.rowWidth.length-1,r=e.rows[t],i=r[r.length-1],a=i.width+e.horizontalPadding;if(e.width-e.rowWidth[n]>a&&t!=n){r.splice(-1,1),e.rows[n].push(i),e.rowWidth[t]=e.rowWidth[t]-a,e.rowWidth[n]=e.rowWidth[n]+a,e.width=e.rowWidth[instance.getLongestRowIndex(e)];for(var o=Number.MIN_VALUE,s=0;s<r.length;s++)r[s].height>o&&(o=r[s].height);t>0&&(o+=e.verticalPadding);var l=e.rowHeight[t]+e.rowHeight[n];e.rowHeight[t]=o,e.rowHeight[n]<i.height+e.verticalPadding&&(e.rowHeight[n]=i.height+e.verticalPadding);var u=e.rowHeight[t]+e.rowHeight[n];e.height+=u-l,this.shiftToLastRow(e)}},w.prototype.tilingPreLayout=function(){l.TILE&&(this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers())},w.prototype.tilingPostLayout=function(){l.TILE&&(this.repopulateZeroDegreeMembers(),this.repopulateCompounds())},w.prototype.reduceTrees=function(){var e,t=[],n=!0;while(n){var r=this.graphManager.getAllNodes(),i=[];n=!1;for(var a=0;a<r.length;a++)if(e=r[a],1==e.getEdges().length&&!e.getEdges()[0].isInterGraph&&null==e.getChild()){if(l.PURE_INCREMENTAL){var o=e.getEdges()[0].getOtherEnd(e),s=new p(e.getCenterX()-o.getCenterX(),e.getCenterY()-o.getCenterY());i.push([e,e.getEdges()[0],e.getOwner(),s])}else i.push([e,e.getEdges()[0],e.getOwner()]);n=!0}if(1==n){for(var u=[],c=0;c<i.length;c++)1==i[c][0].getEdges().length&&(u.push(i[c]),i[c][0].getOwner().remove(i[c][0]));t.push(u),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=t},w.prototype.growTree=function(e){for(var t,n=e.length,r=e[n-1],i=0;i<r.length;i++)t=r[i],this.findPlaceforPrunedNode(t),t[2].add(t[0]),t[2].add(t[1],t[1].source,t[1].target);e.splice(e.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},w.prototype.findPlaceforPrunedNode=function(e){var t,n,r=e[0];if(n=r==e[1].source?e[1].target:e[1].source,l.PURE_INCREMENTAL)r.setCenter(n.getCenterX()+e[3].getWidth(),n.getCenterY()+e[3].getHeight());else{var i=n.startX,a=n.finishX,o=n.startY,s=n.finishY,u=0,h=0,d=0,f=0,p=[u,d,h,f];if(o>0)for(var g=i;g<=a;g++)p[0]+=this.grid[g][o-1].length+this.grid[g][o].length-1;if(a<this.grid.length-1)for(g=o;g<=s;g++)p[1]+=this.grid[a+1][g].length+this.grid[a][g].length-1;if(s<this.grid[0].length-1)for(g=i;g<=a;g++)p[2]+=this.grid[g][s+1].length+this.grid[g][s].length-1;if(i>0)for(g=o;g<=s;g++)p[3