UNPKG

ranui

Version:

A framework-agnostic Web Components UI library built on native custom elements, with TypeScript types, light/dark theming, SSR and PWA support.

1 lines 82.4 kB
const $=require("./rolldown-runtime-CAnuVJ4g.cjs"),B=require("./chunk-Y2CYZVJY-DPaYLFFP.cjs"),k=require("./src-C9EhKhbk.cjs"),q=require("./cytoscape.esm-pygMw4dR.cjs");var Q=$.__commonJSMin(((w,U)=>{(function(O,y){typeof w=="object"&&typeof U=="object"?U.exports=y():typeof define=="function"&&define.amd?define([],y):typeof w=="object"?w.layoutBase=y():O.layoutBase=y()})(w,function(){return(function(N){var O={};function y(n){if(O[n])return O[n].exports;var e=O[n]={i:n,l:!1,exports:{}};return N[n].call(e.exports,e,e.exports,y),e.l=!0,e.exports}return y.m=N,y.c=O,y.i=function(n){return n},y.d=function(n,e,t){y.o(n,e)||Object.defineProperty(n,e,{configurable:!1,enumerable:!0,get:t})},y.n=function(n){var e=n&&n.__esModule?function(){return n.default}:function(){return n};return y.d(e,"a",e),e},y.o=function(n,e){return Object.prototype.hasOwnProperty.call(n,e)},y.p="",y(y.s=26)})([(function(N,O,y){"use strict";function n(){}n.QUALITY=1,n.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,n.DEFAULT_INCREMENTAL=!1,n.DEFAULT_ANIMATION_ON_LAYOUT=!0,n.DEFAULT_ANIMATION_DURING_LAYOUT=!1,n.DEFAULT_ANIMATION_PERIOD=50,n.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,n.DEFAULT_GRAPH_MARGIN=15,n.NODE_DIMENSIONS_INCLUDE_LABELS=!1,n.SIMPLE_NODE_SIZE=40,n.SIMPLE_NODE_HALF_SIZE=n.SIMPLE_NODE_SIZE/2,n.EMPTY_COMPOUND_NODE_SIZE=40,n.MIN_EDGE_LENGTH=1,n.WORLD_BOUNDARY=1e6,n.INITIAL_WORLD_BOUNDARY=n.WORLD_BOUNDARY/1e3,n.WORLD_CENTER_X=1200,n.WORLD_CENTER_Y=900,N.exports=n}),(function(N,O,y){"use strict";var n=y(2),e=y(8),t=y(9);function r(o,i,v){n.call(this,v),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=v,this.bendpoints=[],this.source=o,this.target=i}r.prototype=Object.create(n.prototype);for(var a in n)r[a]=n[a];r.prototype.getSource=function(){return this.source},r.prototype.getTarget=function(){return this.target},r.prototype.isInterGraph=function(){return this.isInterGraph},r.prototype.getLength=function(){return this.length},r.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},r.prototype.getBendpoints=function(){return this.bendpoints},r.prototype.getLca=function(){return this.lca},r.prototype.getSourceInLca=function(){return this.sourceInLca},r.prototype.getTargetInLca=function(){return this.targetInLca},r.prototype.getOtherEnd=function(o){if(this.source===o)return this.target;if(this.target===o)return this.source;throw"Node is not incident with this edge"},r.prototype.getOtherEndInGraph=function(o,i){for(var v=this.getOtherEnd(o),s=i.getGraphManager().getRoot();;){if(v.getOwner()==i)return v;if(v.getOwner()==s)break;v=v.getOwner().getParent()}return null},r.prototype.updateLength=function(){var o=new Array(4);this.isOverlapingSourceAndTarget=e.getIntersection(this.target.getRect(),this.source.getRect(),o),this.isOverlapingSourceAndTarget||(this.lengthX=o[0]-o[2],this.lengthY=o[1]-o[3],Math.abs(this.lengthX)<1&&(this.lengthX=t.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=t.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},r.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=t.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=t.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},N.exports=r}),(function(N,O,y){"use strict";function n(e){this.vGraphObject=e}N.exports=n}),(function(N,O,y){"use strict";var n=y(2),e=y(10),t=y(13),r=y(0),a=y(16),o=y(4);function i(s,l,g,p){g==null&&p==null&&(p=l),n.call(this,p),s.graphManager!=null&&(s=s.graphManager),this.estimatedSize=e.MIN_VALUE,this.inclusionTreeDepth=e.MAX_VALUE,this.vGraphObject=p,this.edges=[],this.graphManager=s,g!=null&&l!=null?this.rect=new t(l.x,l.y,g.width,g.height):this.rect=new t}i.prototype=Object.create(n.prototype);for(var v in n)i[v]=n[v];i.prototype.getEdges=function(){return this.edges},i.prototype.getChild=function(){return this.child},i.prototype.getOwner=function(){return this.owner},i.prototype.getWidth=function(){return this.rect.width},i.prototype.setWidth=function(s){this.rect.width=s},i.prototype.getHeight=function(){return this.rect.height},i.prototype.setHeight=function(s){this.rect.height=s},i.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},i.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},i.prototype.getCenter=function(){return new o(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},i.prototype.getLocation=function(){return new o(this.rect.x,this.rect.y)},i.prototype.getRect=function(){return this.rect},i.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},i.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},i.prototype.setRect=function(s,l){this.rect.x=s.x,this.rect.y=s.y,this.rect.width=l.width,this.rect.height=l.height},i.prototype.setCenter=function(s,l){this.rect.x=s-this.rect.width/2,this.rect.y=l-this.rect.height/2},i.prototype.setLocation=function(s,l){this.rect.x=s,this.rect.y=l},i.prototype.moveBy=function(s,l){this.rect.x+=s,this.rect.y+=l},i.prototype.getEdgeListToNode=function(s){var l=[],g=this;return g.edges.forEach(function(p){if(p.target==s){if(p.source!=g)throw"Incorrect edge source!";l.push(p)}}),l},i.prototype.getEdgesBetween=function(s){var l=[],g=this;return g.edges.forEach(function(p){if(!(p.source==g||p.target==g))throw"Incorrect edge source and/or target";(p.target==s||p.source==s)&&l.push(p)}),l},i.prototype.getNeighborsList=function(){var s=new Set,l=this;return l.edges.forEach(function(g){if(g.source==l)s.add(g.target);else{if(g.target!=l)throw"Incorrect incidency!";s.add(g.source)}}),s},i.prototype.withChildren=function(){var s=new Set,l,g;if(s.add(this),this.child!=null)for(var p=this.child.getNodes(),E=0;E<p.length;E++)l=p[E],g=l.withChildren(),g.forEach(function(d){s.add(d)});return s},i.prototype.getNoOfChildren=function(){var s=0,l;if(this.child==null)s=1;else for(var g=this.child.getNodes(),p=0;p<g.length;p++)l=g[p],s+=l.getNoOfChildren();return s==0&&(s=1),s},i.prototype.getEstimatedSize=function(){if(this.estimatedSize==e.MIN_VALUE)throw"assert failed";return this.estimatedSize},i.prototype.calcEstimatedSize=function(){return this.child==null?this.estimatedSize=(this.rect.width+this.rect.height)/2:(this.estimatedSize=this.child.calcEstimatedSize(),this.rect.width=this.estimatedSize,this.rect.height=this.estimatedSize,this.estimatedSize)},i.prototype.scatter=function(){var s,l,g=-r.INITIAL_WORLD_BOUNDARY,p=r.INITIAL_WORLD_BOUNDARY;s=r.WORLD_CENTER_X+a.nextDouble()*(p-g)+g;var E=-r.INITIAL_WORLD_BOUNDARY,d=r.INITIAL_WORLD_BOUNDARY;l=r.WORLD_CENTER_Y+a.nextDouble()*(d-E)+E,this.rect.x=s,this.rect.y=l},i.prototype.updateBounds=function(){if(this.getChild()==null)throw"assert failed";if(this.getChild().getNodes().length!=0){var s=this.getChild();if(s.updateBounds(!0),this.rect.x=s.getLeft(),this.rect.y=s.getTop(),this.setWidth(s.getRight()-s.getLeft()),this.setHeight(s.getBottom()-s.getTop()),r.NODE_DIMENSIONS_INCLUDE_LABELS){var l=s.getRight()-s.getLeft(),g=s.getBottom()-s.getTop();this.labelWidth>l&&(this.rect.x-=(this.labelWidth-l)/2,this.setWidth(this.labelWidth)),this.labelHeight>g&&(this.labelPos=="center"?this.rect.y-=(this.labelHeight-g)/2:this.labelPos=="top"&&(this.rect.y-=this.labelHeight-g),this.setHeight(this.labelHeight))}}},i.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==e.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},i.prototype.transform=function(s){var l=this.rect.x;l>r.WORLD_BOUNDARY?l=r.WORLD_BOUNDARY:l<-r.WORLD_BOUNDARY&&(l=-r.WORLD_BOUNDARY);var g=this.rect.y;g>r.WORLD_BOUNDARY?g=r.WORLD_BOUNDARY:g<-r.WORLD_BOUNDARY&&(g=-r.WORLD_BOUNDARY);var p=new o(l,g),E=s.inverseTransformPoint(p);this.setLocation(E.x,E.y)},i.prototype.getLeft=function(){return this.rect.x},i.prototype.getRight=function(){return this.rect.x+this.rect.width},i.prototype.getTop=function(){return this.rect.y},i.prototype.getBottom=function(){return this.rect.y+this.rect.height},i.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},N.exports=i}),(function(N,O,y){"use strict";function n(e,t){e==null&&t==null?(this.x=0,this.y=0):(this.x=e,this.y=t)}n.prototype.getX=function(){return this.x},n.prototype.getY=function(){return this.y},n.prototype.setX=function(e){this.x=e},n.prototype.setY=function(e){this.y=e},n.prototype.getDifference=function(e){return new DimensionD(this.x-e.x,this.y-e.y)},n.prototype.getCopy=function(){return new n(this.x,this.y)},n.prototype.translate=function(e){return this.x+=e.width,this.y+=e.height,this},N.exports=n}),(function(N,O,y){"use strict";var n=y(2),e=y(10),t=y(0),r=y(6),a=y(3),o=y(1),i=y(13),v=y(12),s=y(11);function l(p,E,d){n.call(this,d),this.estimatedSize=e.MIN_VALUE,this.margin=t.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=p,E!=null&&E instanceof r?this.graphManager=E:E!=null&&E instanceof Layout&&(this.graphManager=E.graphManager)}l.prototype=Object.create(n.prototype);for(var g in n)l[g]=n[g];l.prototype.getNodes=function(){return this.nodes},l.prototype.getEdges=function(){return this.edges},l.prototype.getGraphManager=function(){return this.graphManager},l.prototype.getParent=function(){return this.parent},l.prototype.getLeft=function(){return this.left},l.prototype.getRight=function(){return this.right},l.prototype.getTop=function(){return this.top},l.prototype.getBottom=function(){return this.bottom},l.prototype.isConnected=function(){return this.isConnected},l.prototype.add=function(p,E,d){if(E==null&&d==null){var u=p;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(u)>-1)throw"Node already in graph!";return u.owner=this,this.getNodes().push(u),u}else{var D=p;if(!(this.getNodes().indexOf(E)>-1&&this.getNodes().indexOf(d)>-1))throw"Source or target not in graph!";if(!(E.owner==d.owner&&E.owner==this))throw"Both owners must be this graph!";return E.owner!=d.owner?null:(D.source=E,D.target=d,D.isInterGraph=!1,this.getEdges().push(D),E.edges.push(D),d!=E&&d.edges.push(D),D)}},l.prototype.remove=function(p){var E=p;if(p instanceof a){if(E==null)throw"Node is null!";if(!(E.owner!=null&&E.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var d=E.edges.slice(),u,D=d.length,L=0;L<D;L++)u=d[L],u.isInterGraph?this.graphManager.remove(u):u.source.owner.remove(u);var I=this.nodes.indexOf(E);if(I==-1)throw"Node not in owner node list!";this.nodes.splice(I,1)}else if(p instanceof o){var u=p;if(u==null)throw"Edge is null!";if(!(u.source!=null&&u.target!=null))throw"Source and/or target is null!";if(!(u.source.owner!=null&&u.target.owner!=null&&u.source.owner==this&&u.target.owner==this))throw"Source and/or target owner is invalid!";var h=u.source.edges.indexOf(u),c=u.target.edges.indexOf(u);if(!(h>-1&&c>-1))throw"Source and/or target doesn't know this edge!";u.source.edges.splice(h,1),u.target!=u.source&&u.target.edges.splice(c,1);var I=u.source.owner.getEdges().indexOf(u);if(I==-1)throw"Not in owner's edge list!";u.source.owner.getEdges().splice(I,1)}},l.prototype.updateLeftTop=function(){for(var p=e.MAX_VALUE,E=e.MAX_VALUE,d,u,D,L=this.getNodes(),I=L.length,h=0;h<I;h++){var c=L[h];d=c.getTop(),u=c.getLeft(),p>d&&(p=d),E>u&&(E=u)}return p==e.MAX_VALUE?null:(L[0].getParent().paddingLeft!=null?D=L[0].getParent().paddingLeft:D=this.margin,this.left=E-D,this.top=p-D,new v(this.left,this.top))},l.prototype.updateBounds=function(p){for(var E=e.MAX_VALUE,d=-e.MAX_VALUE,u=e.MAX_VALUE,D=-e.MAX_VALUE,L,I,h,c,f,T=this.nodes,A=T.length,M=0;M<A;M++){var m=T[M];p&&m.child!=null&&m.updateBounds(),L=m.getLeft(),I=m.getRight(),h=m.getTop(),c=m.getBottom(),E>L&&(E=L),d<I&&(d=I),u>h&&(u=h),D<c&&(D=c)}var R=new i(E,u,d-E,D-u);E==e.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),T[0].getParent().paddingLeft!=null?f=T[0].getParent().paddingLeft:f=this.margin,this.left=R.x-f,this.right=R.x+R.width+f,this.top=R.y-f,this.bottom=R.y+R.height+f},l.calculateBounds=function(p){for(var E=e.MAX_VALUE,d=-e.MAX_VALUE,u=e.MAX_VALUE,D=-e.MAX_VALUE,L,I,h,c,f=p.length,T=0;T<f;T++){var A=p[T];L=A.getLeft(),I=A.getRight(),h=A.getTop(),c=A.getBottom(),E>L&&(E=L),d<I&&(d=I),u>h&&(u=h),D<c&&(D=c)}return new i(E,u,d-E,D-u)},l.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},l.prototype.getEstimatedSize=function(){if(this.estimatedSize==e.MIN_VALUE)throw"assert failed";return this.estimatedSize},l.prototype.calcEstimatedSize=function(){for(var p=0,E=this.nodes,d=E.length,u=0;u<d;u++){var D=E[u];p+=D.calcEstimatedSize()}return p==0?this.estimatedSize=t.EMPTY_COMPOUND_NODE_SIZE:this.estimatedSize=p/Math.sqrt(this.nodes.length),this.estimatedSize},l.prototype.updateConnected=function(){var p=this;if(this.nodes.length==0){this.isConnected=!0;return}var E=new s,d=new Set,u=this.nodes[0],D,L;for(u.withChildren().forEach(function(f){E.push(f),d.add(f)});E.length!==0;){u=E.shift(),D=u.getEdges();for(var I=D.length,h=0;h<I;h++)L=D[h].getOtherEndInGraph(u,this),L!=null&&!d.has(L)&&L.withChildren().forEach(function(f){E.push(f),d.add(f)})}if(this.isConnected=!1,d.size>=this.nodes.length){var c=0;d.forEach(function(f){f.owner==p&&c++}),c==this.nodes.length&&(this.isConnected=!0)}},N.exports=l}),(function(N,O,y){"use strict";var n,e=y(1);function t(r){n=y(5),this.layout=r,this.graphs=[],this.edges=[]}t.prototype.addRoot=function(){var r=this.layout.newGraph(),a=this.layout.newNode(null),o=this.add(r,a);return this.setRootGraph(o),this.rootGraph},t.prototype.add=function(r,a,o,i,v){if(o==null&&i==null&&v==null){if(r==null)throw"Graph is null!";if(a==null)throw"Parent node is null!";if(this.graphs.indexOf(r)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(r),r.parent!=null)throw"Already has a parent!";if(a.child!=null)throw"Already has a child!";return r.parent=a,a.child=r,r}else{v=o,i=a,o=r;var s=i.getOwner(),l=v.getOwner();if(!(s!=null&&s.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(l!=null&&l.getGraphManager()==this))throw"Target not in this graph mgr!";if(s==l)return o.isInterGraph=!1,s.add(o,i,v);if(o.isInterGraph=!0,o.source=i,o.target=v,this.edges.indexOf(o)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(o),!(o.source!=null&&o.target!=null))throw"Edge source and/or target is null!";if(!(o.source.edges.indexOf(o)==-1&&o.target.edges.indexOf(o)==-1))throw"Edge already in source and/or target incidency list!";return o.source.edges.push(o),o.target.edges.push(o),o}},t.prototype.remove=function(r){if(r instanceof n){var a=r;if(a.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(a==this.rootGraph||a.parent!=null&&a.parent.graphManager==this))throw"Invalid parent node!";var o=[];o=o.concat(a.getEdges());for(var i,v=o.length,s=0;s<v;s++)i=o[s],a.remove(i);var l=[];l=l.concat(a.getNodes());var g;v=l.length;for(var s=0;s<v;s++)g=l[s],a.remove(g);a==this.rootGraph&&this.setRootGraph(null);var p=this.graphs.indexOf(a);this.graphs.splice(p,1),a.parent=null}else if(r instanceof e){if(i=r,i==null)throw"Edge is null!";if(!i.isInterGraph)throw"Not an inter-graph edge!";if(!(i.source!=null&&i.target!=null))throw"Source and/or target is null!";if(!(i.source.edges.indexOf(i)!=-1&&i.target.edges.indexOf(i)!=-1))throw"Source and/or target doesn't know this edge!";var p=i.source.edges.indexOf(i);if(i.source.edges.splice(p,1),p=i.target.edges.indexOf(i),i.target.edges.splice(p,1),!(i.source.owner!=null&&i.source.owner.getGraphManager()!=null))throw"Edge owner graph or owner graph manager is null!";if(i.source.owner.getGraphManager().edges.indexOf(i)==-1)throw"Not in owner graph manager's edge list!";var p=i.source.owner.getGraphManager().edges.indexOf(i);i.source.owner.getGraphManager().edges.splice(p,1)}},t.prototype.updateBounds=function(){this.rootGraph.updateBounds(!0)},t.prototype.getGraphs=function(){return this.graphs},t.prototype.getAllNodes=function(){if(this.allNodes==null){for(var r=[],a=this.getGraphs(),o=a.length,i=0;i<o;i++)r=r.concat(a[i].getNodes());this.allNodes=r}return this.allNodes},t.prototype.resetAllNodes=function(){this.allNodes=null},t.prototype.resetAllEdges=function(){this.allEdges=null},t.prototype.resetAllNodesToApplyGravitation=function(){this.allNodesToApplyGravitation=null},t.prototype.getAllEdges=function(){if(this.allEdges==null){var r=[],a=this.getGraphs();a.length;for(var o=0;o<a.length;o++)r=r.concat(a[o].getEdges());r=r.concat(this.edges),this.allEdges=r}return this.allEdges},t.prototype.getAllNodesToApplyGravitation=function(){return this.allNodesToApplyGravitation},t.prototype.setAllNodesToApplyGravitation=function(r){if(this.allNodesToApplyGravitation!=null)throw"assert failed";this.allNodesToApplyGravitation=r},t.prototype.getRoot=function(){return this.rootGraph},t.prototype.setRootGraph=function(r){if(r.getGraphManager()!=this)throw"Root not in this graph mgr!";this.rootGraph=r,r.parent==null&&(r.parent=this.layout.newNode("Root node"))},t.prototype.getLayout=function(){return this.layout},t.prototype.isOneAncestorOfOther=function(r,a){if(!(r!=null&&a!=null))throw"assert failed";if(r==a)return!0;var o=r.getOwner(),i;do{if(i=o.getParent(),i==null)break;if(i==a)return!0;if(o=i.getOwner(),o==null)break}while(!0);o=a.getOwner();do{if(i=o.getParent(),i==null)break;if(i==r)return!0;if(o=i.getOwner(),o==null)break}while(!0);return!1},t.prototype.calcLowestCommonAncestors=function(){for(var r,a,o,i,v,s=this.getAllEdges(),l=s.length,g=0;g<l;g++){if(r=s[g],a=r.source,o=r.target,r.lca=null,r.sourceInLca=a,r.targetInLca=o,a==o){r.lca=a.getOwner();continue}for(i=a.getOwner();r.lca==null;){for(r.targetInLca=o,v=o.getOwner();r.lca==null;){if(v==i){r.lca=v;break}if(v==this.rootGraph)break;if(r.lca!=null)throw"assert failed";r.targetInLca=v.getParent(),v=r.targetInLca.getOwner()}if(i==this.rootGraph)break;r.lca==null&&(r.sourceInLca=i.getParent(),i=r.sourceInLca.getOwner())}if(r.lca==null)throw"assert failed"}},t.prototype.calcLowestCommonAncestor=function(r,a){if(r==a)return r.getOwner();var o=r.getOwner();do{if(o==null)break;var i=a.getOwner();do{if(i==null)break;if(i==o)return i;i=i.getParent().getOwner()}while(!0);o=o.getParent().getOwner()}while(!0);return o},t.prototype.calcInclusionTreeDepths=function(r,a){r==null&&a==null&&(r=this.rootGraph,a=1);for(var o,i=r.getNodes(),v=i.length,s=0;s<v;s++)o=i[s],o.inclusionTreeDepth=a,o.child!=null&&this.calcInclusionTreeDepths(o.child,a+1)},t.prototype.includesInvalidEdge=function(){for(var r,a=this.edges.length,o=0;o<a;o++)if(r=this.edges[o],this.isOneAncestorOfOther(r.source,r.target))return!0;return!1},N.exports=t}),(function(N,O,y){"use strict";var n=y(0);function e(){}for(var t in n)e[t]=n[t];e.MAX_ITERATIONS=2500,e.DEFAULT_EDGE_LENGTH=50,e.DEFAULT_SPRING_STRENGTH=.45,e.DEFAULT_REPULSION_STRENGTH=4500,e.DEFAULT_GRAVITY_STRENGTH=.4,e.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,e.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,e.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,e.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,e.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,e.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,e.COOLING_ADAPTATION_FACTOR=.33,e.ADAPTATION_LOWER_NODE_LIMIT=1e3,e.ADAPTATION_UPPER_NODE_LIMIT=5e3,e.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,e.MAX_NODE_DISPLACEMENT=e.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,e.MIN_REPULSION_DIST=e.DEFAULT_EDGE_LENGTH/10,e.CONVERGENCE_CHECK_PERIOD=100,e.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,e.MIN_EDGE_LENGTH=1,e.GRID_CALCULATION_CHECK_PERIOD=10,N.exports=e}),(function(N,O,y){"use strict";var n=y(12);function e(){}e.calcSeparationAmount=function(t,r,a,o){if(!t.intersects(r))throw"assert failed";var i=new Array(2);this.decideDirectionsForOverlappingNodes(t,r,i),a[0]=Math.min(t.getRight(),r.getRight())-Math.max(t.x,r.x),a[1]=Math.min(t.getBottom(),r.getBottom())-Math.max(t.y,r.y),t.getX()<=r.getX()&&t.getRight()>=r.getRight()?a[0]+=Math.min(r.getX()-t.getX(),t.getRight()-r.getRight()):r.getX()<=t.getX()&&r.getRight()>=t.getRight()&&(a[0]+=Math.min(t.getX()-r.getX(),r.getRight()-t.getRight())),t.getY()<=r.getY()&&t.getBottom()>=r.getBottom()?a[1]+=Math.min(r.getY()-t.getY(),t.getBottom()-r.getBottom()):r.getY()<=t.getY()&&r.getBottom()>=t.getBottom()&&(a[1]+=Math.min(t.getY()-r.getY(),r.getBottom()-t.getBottom()));var v=Math.abs((r.getCenterY()-t.getCenterY())/(r.getCenterX()-t.getCenterX()));r.getCenterY()===t.getCenterY()&&r.getCenterX()===t.getCenterX()&&(v=1);var s=v*a[0],l=a[1]/v;a[0]<l?l=a[0]:s=a[1],a[0]=-1*i[0]*(l/2+o),a[1]=-1*i[1]*(s/2+o)},e.decideDirectionsForOverlappingNodes=function(t,r,a){t.getCenterX()<r.getCenterX()?a[0]=-1:a[0]=1,t.getCenterY()<r.getCenterY()?a[1]=-1:a[1]=1},e.getIntersection2=function(t,r,a){var o=t.getCenterX(),i=t.getCenterY(),v=r.getCenterX(),s=r.getCenterY();if(t.intersects(r))return a[0]=o,a[1]=i,a[2]=v,a[3]=s,!0;var l=t.getX(),g=t.getY(),p=t.getRight(),E=t.getX(),d=t.getBottom(),u=t.getRight(),D=t.getWidthHalf(),L=t.getHeightHalf(),I=r.getX(),h=r.getY(),c=r.getRight(),f=r.getX(),T=r.getBottom(),A=r.getRight(),M=r.getWidthHalf(),m=r.getHeightHalf(),R=!1,C=!1;if(o===v){if(i>s)return a[0]=o,a[1]=g,a[2]=v,a[3]=T,!1;if(i<s)return a[0]=o,a[1]=d,a[2]=v,a[3]=h,!1}else if(i===s){if(o>v)return a[0]=l,a[1]=i,a[2]=c,a[3]=s,!1;if(o<v)return a[0]=p,a[1]=i,a[2]=I,a[3]=s,!1}else{var x=t.height/t.width,F=r.height/r.width,G=(s-i)/(v-o),X=void 0,_=void 0,S=void 0,Y=void 0,P=void 0,b=void 0;if(-x===G?o>v?(a[0]=E,a[1]=d,R=!0):(a[0]=p,a[1]=g,R=!0):x===G&&(o>v?(a[0]=l,a[1]=g,R=!0):(a[0]=u,a[1]=d,R=!0)),-F===G?v>o?(a[2]=f,a[3]=T,C=!0):(a[2]=c,a[3]=h,C=!0):F===G&&(v>o?(a[2]=I,a[3]=h,C=!0):(a[2]=A,a[3]=T,C=!0)),R&&C)return!1;if(o>v?i>s?(X=this.getCardinalDirection(x,G,4),_=this.getCardinalDirection(F,G,2)):(X=this.getCardinalDirection(-x,G,3),_=this.getCardinalDirection(-F,G,1)):i>s?(X=this.getCardinalDirection(-x,G,1),_=this.getCardinalDirection(-F,G,3)):(X=this.getCardinalDirection(x,G,2),_=this.getCardinalDirection(F,G,4)),!R)switch(X){case 1:Y=g,S=o+-L/G,a[0]=S,a[1]=Y;break;case 2:S=u,Y=i+D*G,a[0]=S,a[1]=Y;break;case 3:Y=d,S=o+L/G,a[0]=S,a[1]=Y;break;case 4:S=E,Y=i+-D*G,a[0]=S,a[1]=Y;break}if(!C)switch(_){case 1:b=h,P=v+-m/G,a[2]=P,a[3]=b;break;case 2:P=A,b=s+M*G,a[2]=P,a[3]=b;break;case 3:b=T,P=v+m/G,a[2]=P,a[3]=b;break;case 4:P=f,b=s+-M*G,a[2]=P,a[3]=b;break}}return!1},e.getCardinalDirection=function(t,r,a){return t>r?a:1+a%4},e.getIntersection=function(t,r,a,o){if(o==null)return this.getIntersection2(t,r,a);var i=t.x,v=t.y,s=r.x,l=r.y,g=a.x,p=a.y,E=o.x,d=o.y,u=void 0,D=void 0,L=void 0,I=void 0,h=void 0,c=void 0,f=void 0,T=void 0,A=void 0;return L=l-v,h=i-s,f=s*v-i*l,I=d-p,c=g-E,T=E*p-g*d,A=L*c-I*h,A===0?null:(u=(h*T-c*f)/A,D=(I*f-L*T)/A,new n(u,D))},e.angleOfVector=function(t,r,a,o){var i=void 0;return t!==a?(i=Math.atan((o-r)/(a-t)),a<t?i+=Math.PI:o<r&&(i+=this.TWO_PI)):o<r?i=this.ONE_AND_HALF_PI:i=this.HALF_PI,i},e.doIntersect=function(t,r,a,o){var i=t.x,v=t.y,s=r.x,l=r.y,g=a.x,p=a.y,E=o.x,d=o.y,u=(s-i)*(d-p)-(E-g)*(l-v);if(u===0)return!1;var D=((d-p)*(E-i)+(g-E)*(d-v))/u,L=((v-l)*(E-i)+(s-i)*(d-v))/u;return 0<D&&D<1&&0<L&&L<1},e.HALF_PI=.5*Math.PI,e.ONE_AND_HALF_PI=1.5*Math.PI,e.TWO_PI=2*Math.PI,e.THREE_PI=3*Math.PI,N.exports=e}),(function(N,O,y){"use strict";function n(){}n.sign=function(e){return e>0?1:e<0?-1:0},n.floor=function(e){return e<0?Math.ceil(e):Math.floor(e)},n.ceil=function(e){return e<0?Math.floor(e):Math.ceil(e)},N.exports=n}),(function(N,O,y){"use strict";function n(){}n.MAX_VALUE=2147483647,n.MIN_VALUE=-2147483648,N.exports=n}),(function(N,O,y){"use strict";var n=(function(){function o(i,v){for(var s=0;s<v.length;s++){var l=v[s];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(i,l.key,l)}}return function(i,v,s){return v&&o(i.prototype,v),s&&o(i,s),i}})();function e(o,i){if(!(o instanceof i))throw new TypeError("Cannot call a class as a function")}var t=function(i){return{value:i,next:null,prev:null}},r=function(i,v,s,l){return i!==null?i.next=v:l.head=v,s!==null?s.prev=v:l.tail=v,v.prev=i,v.next=s,l.length++,v},a=function(i,v){var s=i.prev,l=i.next;return s!==null?s.next=l:v.head=l,l!==null?l.prev=s:v.tail=s,i.prev=i.next=null,v.length--,i};N.exports=(function(){function o(i){var v=this;e(this,o),this.length=0,this.head=null,this.tail=null,i?.forEach(function(s){return v.push(s)})}return n(o,[{key:"size",value:function(){return this.length}},{key:"insertBefore",value:function(v,s){return r(s.prev,t(v),s,this)}},{key:"insertAfter",value:function(v,s){return r(s,t(v),s.next,this)}},{key:"insertNodeBefore",value:function(v,s){return r(s.prev,v,s,this)}},{key:"insertNodeAfter",value:function(v,s){return r(s,v,s.next,this)}},{key:"push",value:function(v){return r(this.tail,t(v),null,this)}},{key:"unshift",value:function(v){return r(null,t(v),this.head,this)}},{key:"remove",value:function(v){return a(v,this)}},{key:"pop",value:function(){return a(this.tail,this).value}},{key:"popNode",value:function(){return a(this.tail,this)}},{key:"shift",value:function(){return a(this.head,this).value}},{key:"shiftNode",value:function(){return a(this.head,this)}},{key:"get_object_at",value:function(v){if(v<=this.length()){for(var s=1,l=this.head;s<v;)l=l.next,s++;return l.value}}},{key:"set_object_at",value:function(v,s){if(v<=this.length()){for(var l=1,g=this.head;l<v;)g=g.next,l++;g.value=s}}}]),o})()}),(function(N,O,y){"use strict";function n(e,t,r){this.x=null,this.y=null,e==null&&t==null&&r==null?(this.x=0,this.y=0):typeof e=="number"&&typeof t=="number"&&r==null?(this.x=e,this.y=t):e.constructor.name=="Point"&&t==null&&r==null&&(r=e,this.x=r.x,this.y=r.y)}n.prototype.getX=function(){return this.x},n.prototype.getY=function(){return this.y},n.prototype.getLocation=function(){return new n(this.x,this.y)},n.prototype.setLocation=function(e,t,r){e.constructor.name=="Point"&&t==null&&r==null?(r=e,this.setLocation(r.x,r.y)):typeof e=="number"&&typeof t=="number"&&r==null&&(parseInt(e)==e&&parseInt(t)==t?this.move(e,t):(this.x=Math.floor(e+.5),this.y=Math.floor(t+.5)))},n.prototype.move=function(e,t){this.x=e,this.y=t},n.prototype.translate=function(e,t){this.x+=e,this.y+=t},n.prototype.equals=function(e){if(e.constructor.name=="Point"){var t=e;return this.x==t.x&&this.y==t.y}return this==e},n.prototype.toString=function(){return new n().constructor.name+"[x="+this.x+",y="+this.y+"]"},N.exports=n}),(function(N,O,y){"use strict";function n(e,t,r,a){this.x=0,this.y=0,this.width=0,this.height=0,e!=null&&t!=null&&r!=null&&a!=null&&(this.x=e,this.y=t,this.width=r,this.height=a)}n.prototype.getX=function(){return this.x},n.prototype.setX=function(e){this.x=e},n.prototype.getY=function(){return this.y},n.prototype.setY=function(e){this.y=e},n.prototype.getWidth=function(){return this.width},n.prototype.setWidth=function(e){this.width=e},n.prototype.getHeight=function(){return this.height},n.prototype.setHeight=function(e){this.height=e},n.prototype.getRight=function(){return this.x+this.width},n.prototype.getBottom=function(){return this.y+this.height},n.prototype.intersects=function(e){return!(this.getRight()<e.x||this.getBottom()<e.y||e.getRight()<this.x||e.getBottom()<this.y)},n.prototype.getCenterX=function(){return this.x+this.width/2},n.prototype.getMinX=function(){return this.getX()},n.prototype.getMaxX=function(){return this.getX()+this.width},n.prototype.getCenterY=function(){return this.y+this.height/2},n.prototype.getMinY=function(){return this.getY()},n.prototype.getMaxY=function(){return this.getY()+this.height},n.prototype.getWidthHalf=function(){return this.width/2},n.prototype.getHeightHalf=function(){return this.height/2},N.exports=n}),(function(N,O,y){"use strict";var n=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};function e(){}e.lastID=0,e.createID=function(t){return e.isPrimitive(t)?t:(t.uniqueID!=null||(t.uniqueID=e.getString(),e.lastID++),t.uniqueID)},e.getString=function(t){return t==null&&(t=e.lastID),"Object#"+t},e.isPrimitive=function(t){var r=typeof t>"u"?"undefined":n(t);return t==null||r!="object"&&r!="function"},N.exports=e}),(function(N,O,y){"use strict";function n(g){if(Array.isArray(g)){for(var p=0,E=Array(g.length);p<g.length;p++)E[p]=g[p];return E}else return Array.from(g)}var e=y(0),t=y(6),r=y(3),a=y(1),o=y(5),i=y(4),v=y(17),s=y(27);function l(g){s.call(this),this.layoutQuality=e.QUALITY,this.createBendsAsNeeded=e.DEFAULT_CREATE_BENDS_AS_NEEDED,this.incremental=e.DEFAULT_INCREMENTAL,this.animationOnLayout=e.DEFAULT_ANIMATION_ON_LAYOUT,this.animationDuringLayout=e.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=e.DEFAULT_ANIMATION_PERIOD,this.uniformLeafNodeSizes=e.DEFAULT_UNIFORM_LEAF_NODE_SIZES,this.edgeToDummyNodes=new Map,this.graphManager=new t(this),this.isLayoutFinished=!1,this.isSubLayout=!1,this.isRemoteUse=!1,g!=null&&(this.isRemoteUse=g)}l.RANDOM_SEED=1,l.prototype=Object.create(s.prototype),l.prototype.getGraphManager=function(){return this.graphManager},l.prototype.getAllNodes=function(){return this.graphManager.getAllNodes()},l.prototype.getAllEdges=function(){return this.graphManager.getAllEdges()},l.prototype.getAllNodesToApplyGravitation=function(){return this.graphManager.getAllNodesToApplyGravitation()},l.prototype.newGraphManager=function(){var g=new t(this);return this.graphManager=g,g},l.prototype.newGraph=function(g){return new o(null,this.graphManager,g)},l.prototype.newNode=function(g){return new r(this.graphManager,g)},l.prototype.newEdge=function(g){return new a(null,null,g)},l.prototype.checkLayoutSuccess=function(){return this.graphManager.getRoot()==null||this.graphManager.getRoot().getNodes().length==0||this.graphManager.includesInvalidEdge()},l.prototype.runLayout=function(){this.isLayoutFinished=!1,this.tilingPreLayout&&this.tilingPreLayout(),this.initParameters();var g;return this.checkLayoutSuccess()?g=!1:g=this.layout(),e.ANIMATE==="during"?!1:(g&&(this.isSubLayout||this.doPostLayout()),this.tilingPostLayout&&this.tilingPostLayout(),this.isLayoutFinished=!0,g)},l.prototype.doPostLayout=function(){this.incremental||this.transform(),this.update()},l.prototype.update2=function(){if(this.createBendsAsNeeded&&(this.createBendpointsFromDummyNodes(),this.graphManager.resetAllEdges()),!this.isRemoteUse){for(var g=this.graphManager.getAllEdges(),p=0;p<g.length;p++)g[p];for(var E=this.graphManager.getRoot().getNodes(),p=0;p<E.length;p++)E[p];this.update(this.graphManager.getRoot())}},l.prototype.update=function(g){if(g==null)this.update2();else if(g instanceof r){var p=g;if(p.getChild()!=null)for(var E=p.getChild().getNodes(),d=0;d<E.length;d++)update(E[d]);p.vGraphObject!=null&&p.vGraphObject.update(p)}else if(g instanceof a){var u=g;u.vGraphObject!=null&&u.vGraphObject.update(u)}else if(g instanceof o){var D=g;D.vGraphObject!=null&&D.vGraphObject.update(D)}},l.prototype.initParameters=function(){this.isSubLayout||(this.layoutQuality=e.QUALITY,this.animationDuringLayout=e.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=e.DEFAULT_ANIMATION_PERIOD,this.animationOnLayout=e.DEFAULT_ANIMATION_ON_LAYOUT,this.incremental=e.DEFAULT_INCREMENTAL,this.createBendsAsNeeded=e.DEFAULT_CREATE_BENDS_AS_NEEDED,this.uniformLeafNodeSizes=e.DEFAULT_UNIFORM_LEAF_NODE_SIZES),this.animationDuringLayout&&(this.animationOnLayout=!1)},l.prototype.transform=function(g){if(g==null)this.transform(new i(0,0));else{var p=new v,E=this.graphManager.getRoot().updateLeftTop();if(E!=null){p.setWorldOrgX(g.x),p.setWorldOrgY(g.y),p.setDeviceOrgX(E.x),p.setDeviceOrgY(E.y);for(var d=this.getAllNodes(),u,D=0;D<d.length;D++)u=d[D],u.transform(p)}}},l.prototype.positionNodesRandomly=function(g){if(g==null)this.positionNodesRandomly(this.getGraphManager().getRoot()),this.getGraphManager().getRoot().updateBounds(!0);else for(var p,E,d=g.getNodes(),u=0;u<d.length;u++)p=d[u],E=p.getChild(),E==null||E.getNodes().length==0?p.scatter():(this.positionNodesRandomly(E),p.updateBounds())},l.prototype.getFlatForest=function(){for(var g=[],p=!0,E=this.graphManager.getRoot().getNodes(),d=!0,u=0;u<E.length;u++)E[u].getChild()!=null&&(d=!1);if(!d)return g;var D=new Set,L=[],I=new Map,h=[];for(h=h.concat(E);h.length>0&&p;){for(L.push(h[0]);L.length>0&&p;){var c=L[0];L.splice(0,1),D.add(c);for(var f=c.getEdges(),u=0;u<f.length;u++){var T=f[u].getOtherEnd(c);if(I.get(c)!=T)if(!D.has(T))L.push(T),I.set(T,c);else{p=!1;break}}}if(!p)g=[];else{var A=[].concat(n(D));g.push(A);for(var u=0;u<A.length;u++){var M=A[u],m=h.indexOf(M);m>-1&&h.splice(m,1)}D=new Set,I=new Map}}return g},l.prototype.createDummyNodesForBendpoints=function(g){for(var p=[],E=g.source,d=this.graphManager.calcLowestCommonAncestor(g.source,g.target),u=0;u<g.bendpoints.length;u++){var D=this.newNode(null);D.setRect(new Point(0,0),new Dimension(1,1)),d.add(D);var L=this.newEdge(null);this.graphManager.add(L,E,D),p.add(D),E=D}var L=this.newEdge(null);return this.graphManager.add(L,E,g.target),this.edgeToDummyNodes.set(g,p),g.isInterGraph()?this.graphManager.remove(g):d.remove(g),p},l.prototype.createBendpointsFromDummyNodes=function(){var g=[];g=g.concat(this.graphManager.getAllEdges()),g=[].concat(n(this.edgeToDummyNodes.keys())).concat(g);for(var p=0;p<g.length;p++){var E=g[p];if(E.bendpoints.length>0){for(var d=this.edgeToDummyNodes.get(E),u=0;u<d.length;u++){var D=d[u],L=new i(D.getCenterX(),D.getCenterY()),I=E.bendpoints.get(u);I.x=L.x,I.y=L.y,D.getOwner().remove(D)}this.graphManager.add(E,E.source,E.target)}}},l.transform=function(g,p,E,d){if(E!=null&&d!=null){var u=p;if(g<=50){var D=p/E;u-=(p-D)/50*(50-g)}else{var L=p*d;u+=(L-p)/50*(g-50)}return u}else{var I,h;return g<=50?(I=9*p/500,h=p/10):(I=9*p/50,h=-8*p),I*g+h}},l.findCenterOfTree=function(g){var p=[];p=p.concat(g);var E=[],d=new Map,u=!1,D=null;(p.length==1||p.length==2)&&(u=!0,D=p[0]);for(var L=0;L<p.length;L++){var I=p[L],h=I.getNeighborsList().size;d.set(I,I.getNeighborsList().size),h==1&&E.push(I)}var c=[];for(c=c.concat(E);!u;){var f=[];f=f.concat(c),c=[];for(var L=0;L<p.length;L++){var I=p[L],T=p.indexOf(I);T>=0&&p.splice(T,1),I.getNeighborsList().forEach(function(m){if(E.indexOf(m)<0){var R=d.get(m)-1;R==1&&c.push(m),d.set(m,R)}})}E=E.concat(c),(p.length==1||p.length==2)&&(u=!0,D=p[0])}return D},l.prototype.setGraphManager=function(g){this.graphManager=g},N.exports=l}),(function(N,O,y){"use strict";function n(){}n.seed=1,n.x=0,n.nextDouble=function(){return n.x=Math.sin(n.seed++)*1e4,n.x-Math.floor(n.x)},N.exports=n}),(function(N,O,y){"use strict";var n=y(4);function e(t,r){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}e.prototype.getWorldOrgX=function(){return this.lworldOrgX},e.prototype.setWorldOrgX=function(t){this.lworldOrgX=t},e.prototype.getWorldOrgY=function(){return this.lworldOrgY},e.prototype.setWorldOrgY=function(t){this.lworldOrgY=t},e.prototype.getWorldExtX=function(){return this.lworldExtX},e.prototype.setWorldExtX=function(t){this.lworldExtX=t},e.prototype.getWorldExtY=function(){return this.lworldExtY},e.prototype.setWorldExtY=function(t){this.lworldExtY=t},e.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},e.prototype.setDeviceOrgX=function(t){this.ldeviceOrgX=t},e.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},e.prototype.setDeviceOrgY=function(t){this.ldeviceOrgY=t},e.prototype.getDeviceExtX=function(){return this.ldeviceExtX},e.prototype.setDeviceExtX=function(t){this.ldeviceExtX=t},e.prototype.getDeviceExtY=function(){return this.ldeviceExtY},e.prototype.setDeviceExtY=function(t){this.ldeviceExtY=t},e.prototype.transformX=function(t){var r=0,a=this.lworldExtX;return a!=0&&(r=this.ldeviceOrgX+(t-this.lworldOrgX)*this.ldeviceExtX/a),r},e.prototype.transformY=function(t){var r=0,a=this.lworldExtY;return a!=0&&(r=this.ldeviceOrgY+(t-this.lworldOrgY)*this.ldeviceExtY/a),r},e.prototype.inverseTransformX=function(t){var r=0,a=this.ldeviceExtX;return a!=0&&(r=this.lworldOrgX+(t-this.ldeviceOrgX)*this.lworldExtX/a),r},e.prototype.inverseTransformY=function(t){var r=0,a=this.ldeviceExtY;return a!=0&&(r=this.lworldOrgY+(t-this.ldeviceOrgY)*this.lworldExtY/a),r},e.prototype.inverseTransformPoint=function(t){return new n(this.inverseTransformX(t.x),this.inverseTransformY(t.y))},N.exports=e}),(function(N,O,y){"use strict";function n(s){if(Array.isArray(s)){for(var l=0,g=Array(s.length);l<s.length;l++)g[l]=s[l];return g}else return Array.from(s)}var e=y(15),t=y(7),r=y(0),a=y(8),o=y(9);function i(){e.call(this),this.useSmartIdealEdgeLengthCalculation=t.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.idealEdgeLength=t.DEFAULT_EDGE_LENGTH,this.springConstant=t.DEFAULT_SPRING_STRENGTH,this.repulsionConstant=t.DEFAULT_REPULSION_STRENGTH,this.gravityConstant=t.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=t.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=t.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=t.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*t.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=t.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=t.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=t.MAX_ITERATIONS}i.prototype=Object.create(e.prototype);for(var v in e)i[v]=e[v];i.prototype.initParameters=function(){e.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=t.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},i.prototype.calcIdealEdgeLengths=function(){for(var s,l,g,p,E,d,u=this.getGraphManager().getAllEdges(),D=0;D<u.length;D++)s=u[D],s.idealLength=this.idealEdgeLength,s.isInterGraph&&(g=s.getSource(),p=s.getTarget(),E=s.getSourceInLca().getEstimatedSize(),d=s.getTargetInLca().getEstimatedSize(),this.useSmartIdealEdgeLengthCalculation&&(s.idealLength+=E+d-2*r.SIMPLE_NODE_SIZE),l=s.getLca().getInclusionTreeDepth(),s.idealLength+=t.DEFAULT_EDGE_LENGTH*t.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR*(g.getInclusionTreeDepth()+p.getInclusionTreeDepth()-2*l))},i.prototype.initSpringEmbedder=function(){var s=this.getAllNodes().length;this.incremental?(s>t.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*t.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(s-t.ADAPTATION_LOWER_NODE_LIMIT)/(t.ADAPTATION_UPPER_NODE_LIMIT-t.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-t.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=t.MAX_NODE_DISPLACEMENT_INCREMENTAL):(s>t.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(t.COOLING_ADAPTATION_FACTOR,1-(s-t.ADAPTATION_LOWER_NODE_LIMIT)/(t.ADAPTATION_UPPER_NODE_LIMIT-t.ADAPTATION_LOWER_NODE_LIMIT)*(1-t.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=t.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},i.prototype.calcSpringForces=function(){for(var s=this.getAllEdges(),l,g=0;g<s.length;g++)l=s[g],this.calcSpringForce(l,l.idealLength)},i.prototype.calcRepulsionForces=function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,g,p,E,d,u=this.getAllNodes(),D;if(this.useFRGridVariant)for(this.totalIterations%t.GRID_CALCULATION_CHECK_PERIOD==1&&s&&this.updateGrid(),D=new Set,g=0;g<u.length;g++)E=u[g],this.calculateRepulsionForceOfANode(E,D,s,l),D.add(E);else for(g=0;g<u.length;g++)for(E=u[g],p=g+1;p<u.length;p++)d=u[p],E.getOwner()==d.getOwner()&&this.calcRepulsionForce(E,d)},i.prototype.calcGravitationalForces=function(){for(var s,l=this.getAllNodesToApplyGravitation(),g=0;g<l.length;g++)s=l[g],this.calcGravitationalForce(s)},i.prototype.moveNodes=function(){for(var s=this.getAllNodes(),l,g=0;g<s.length;g++)l=s[g],l.move()},i.prototype.calcSpringForce=function(s,l){var g=s.getSource(),p=s.getTarget(),E,d,u,D;if(this.uniformLeafNodeSizes&&g.getChild()==null&&p.getChild()==null)s.updateLengthSimple();else if(s.updateLength(),s.isOverlapingSourceAndTarget)return;E=s.getLength(),E!=0&&(d=this.springConstant*(E-l),u=d*(s.lengthX/E),D=d*(s.lengthY/E),g.springForceX+=u,g.springForceY+=D,p.springForceX-=u,p.springForceY-=D)},i.prototype.calcRepulsionForce=function(s,l){var g=s.getRect(),p=l.getRect(),E=new Array(2),d=new Array(4),u,D,L,I,h,c,f;if(g.intersects(p)){a.calcSeparationAmount(g,p,E,t.DEFAULT_EDGE_LENGTH/2),c=2*E[0],f=2*E[1];var T=s.noOfChildren*l.noOfChildren/(s.noOfChildren+l.noOfChildren);s.repulsionForceX-=T*c,s.repulsionForceY-=T*f,l.repulsionForceX+=T*c,l.repulsionForceY+=T*f}else this.uniformLeafNodeSizes&&s.getChild()==null&&l.getChild()==null?(u=p.getCenterX()-g.getCenterX(),D=p.getCenterY()-g.getCenterY()):(a.getIntersection(g,p,d),u=d[2]-d[0],D=d[3]-d[1]),Math.abs(u)<t.MIN_REPULSION_DIST&&(u=o.sign(u)*t.MIN_REPULSION_DIST),Math.abs(D)<t.MIN_REPULSION_DIST&&(D=o.sign(D)*t.MIN_REPULSION_DIST),L=u*u+D*D,I=Math.sqrt(L),h=this.repulsionConstant*s.noOfChildren*l.noOfChildren/L,c=h*u/I,f=h*D/I,s.repulsionForceX-=c,s.repulsionForceY-=f,l.repulsionForceX+=c,l.repulsionForceY+=f},i.prototype.calcGravitationalForce=function(s){var l,g,p,E,d,u,D,L;l=s.getOwner(),g=(l.getRight()+l.getLeft())/2,p=(l.getTop()+l.getBottom())/2,E=s.getCenterX()-g,d=s.getCenterY()-p,u=Math.abs(E)+s.getWidth()/2,D=Math.abs(d)+s.getHeight()/2,s.getOwner()==this.graphManager.getRoot()?(L=l.getEstimatedSize()*this.gravityRangeFactor,(u>L||D>L)&&(s.gravitationForceX=-this.gravityConstant*E,s.gravitationForceY=-this.gravityConstant*d)):(L=l.getEstimatedSize()*this.compoundGravityRangeFactor,(u>L||D>L)&&(s.gravitationForceX=-this.gravityConstant*E*this.compoundGravityConstant,s.gravitationForceY=-this.gravityConstant*d*this.compoundGravityConstant))},i.prototype.isConverged=function(){var s,l=!1;return this.totalIterations>this.maxIterations/3&&(l=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),s=this.totalDisplacement<this.totalDisplacementThreshold,this.oldTotalDisplacement=this.totalDisplacement,s||l},i.prototype.animate=function(){this.animationDuringLayout&&!this.isSubLayout&&(this.notAnimatedIterations==this.animationPeriod?(this.update(),this.notAnimatedIterations=0):this.notAnimatedIterations++)},i.prototype.calcNoOfChildrenForAllNodes=function(){for(var s,l=this.graphManager.getAllNodes(),g=0;g<l.length;g++)s=l[g],s.noOfChildren=s.getNoOfChildren()},i.prototype.calcGrid=function(s){var l=0,g=0;l=parseInt(Math.ceil((s.getRight()-s.getLeft())/this.repulsionRange)),g=parseInt(Math.ceil((s.getBottom()-s.getTop())/this.repulsionRange));for(var p=new Array(l),E=0;E<l;E++)p[E]=new Array(g);for(var E=0;E<l;E++)for(var d=0;d<g;d++)p[E][d]=new Array;return p},i.prototype.addNodeToGrid=function(s,l,g){var p=0,E=0,d=0,u=0;p=parseInt(Math.floor((s.getRect().x-l)/this.repulsionRange)),E=parseInt(Math.floor((s.getRect().width+s.getRect().x-l)/this.repulsionRange)),d=parseInt(Math.floor((s.getRect().y-g)/this.repulsionRange)),u=parseInt(Math.floor((s.getRect().height+s.getRect().y-g)/this.repulsionRange));for(var D=p;D<=E;D++)for(var L=d;L<=u;L++)this.grid[D][L].push(s),s.setGridCoordinates(p,E,d,u)},i.prototype.updateGrid=function(){var s,l,g=this.getAllNodes();for(this.grid=this.calcGrid(this.graphManager.getRoot()),s=0;s<g.length;s++)l=g[s],this.addNodeToGrid(l,this.graphManager.getRoot().getLeft(),this.graphManager.getRoot().getTop())},i.prototype.calculateRepulsionForceOfANode=function(s,l,g,p){if(this.totalIterations%t.GRID_CALCULATION_CHECK_PERIOD==1&&g||p){var E=new Set;s.surrounding=new Array;for(var d,u=this.grid,D=s.startX-1;D<s.finishX+2;D++)for(var L=s.startY-1;L<s.finishY+2;L++)if(!(D<0||L<0||D>=u.length||L>=u[0].length)){for(var I=0;I<u[D][L].length;I++)if(d=u[D][L][I],!(s.getOwner()!=d.getOwner()||s==d)&&!l.has(d)&&!E.has(d)){var h=Math.abs(s.getCenterX()-d.getCenterX())-(s.getWidth()/2+d.getWidth()/2),c=Math.abs(s.getCenterY()-d.getCenterY())-(s.getHeight()/2+d.getHeight()/2);h<=this.repulsionRange&&c<=this.repulsionRange&&E.add(d)}}s.surrounding=[].concat(n(E))}for(D=0;D<s.surrounding.length;D++)this.calcRepulsionForce(s,s.surrounding[D])},i.prototype.calcRepulsionRange=function(){return 0},N.exports=i}),(function(N,O,y){"use strict";var n=y(1),e=y(7);function t(a,o,i){n.call(this,a,o,i),this.idealLength=e.DEFAULT_EDGE_LENGTH}t.prototype=Object.create(n.prototype);for(var r in n)t[r]=n[r];N.exports=t}),(function(N,O,y){"use strict";var n=y(3);function e(r,a,o,i){n.call(this,r,a,o,i),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0,this.startX=0,this.finishX=0,this.startY=0,this.finishY=0,this.surrounding=[]}e.prototype=Object.create(n.prototype);for(var t in n)e[t]=n[t];e.prototype.setGridCoordinates=function(r,a,o,i){this.startX=r,this.finishX=a,this.startY=o,this.finishY=i},N.exports=e}),(function(N,O,y){"use strict";function n(e,t){this.width=0,this.height=0,e!==null&&t!==null&&(this.height=t,this.width=e)}n.prototype.getWidth=function(){return this.width},n.prototype.setWidth=function(e){this.width=e},n.prototype.getHeight=function(){return this.height},n.prototype.setHeight=function(e){this.height=e},N.exports=n}),(function(N,O,y){"use strict";var n=y(14);function e(){this.map={},this.keys=[]}e.prototype.put=function(t,r){var a=n.createID(t);this.contains(a)||(this.map[a]=r,this.keys.push(t))},e.prototype.contains=function(t){return n.createID(t),this.map[t]!=null},e.prototype.get=function(t){var r=n.createID(t);return this.map[r]},e.prototype.keySet=function(){return this.keys},N.exports=e}),(function(N,O,y){"use strict";var n=y(14);function e(){this.set={}}e.prototype.add=function(t){var r=n.createID(t);this.contains(r)||(this.set[r]=t)},e.prototype.remove=function(t){delete this.set[n.createID(t)]},e.prototype.clear=function(){this.set={}},e.prototype.contains=function(t){return this.set[n.createID(t)]==t},e.prototype.isEmpty=function(){return this.size()===0},e.prototype.size=function(){return Object.keys(this.set).length},e.prototype.addAllTo=function(t){for(var r=Object.keys(this.set),a=r.length,o=0;o<a;o++)t.push(this.set[r[o]])},e.prototype.size=function(){return Object.keys(this.set).length},e.prototype.addAll=function(t){for(var r=t.length,a=0;a<r;a++){var o=t[a];this.add(o)}},N.exports=e}),(function(N,O,y){"use strict";var n=(function(){function r(a,o){for(var i=0;i<o.length;i++){var v=o[i];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(a,v.key,v)}}return function(a,o,i){return o&&r(a.prototype,o),i&&r(a,i),a}})();function e(r,a){if(!(r instanceof a))throw new TypeError("Cannot call a class as a function")}var t=y(11);N.exports=(function(){function r(a,o){e(this,r),(o!==null||o!==void 0)&&(this.compareFunction=this._defaultCompareFunction);var i=void 0;a instanceof t?i=a.size():i=a.length,this._quicksort(a,0,i-1)}return n(r,[{key:"_quicksort",value:function(o,i,v){if(i<v){var s=this._partition(o,i,v);this._quicksort(o,i,s),this._quicksort(o,s+1,v)}}},{key:"_partition",value:function(o,i,v){for(var s=this._get(o,i),l=i,g=v;;){for(;this.compareFunction(s,this._get(o,g));)g--;for(;this.compareFunction(this._get(o,l),s);)l++;if(l<g)this._swap(o,l,g),l++,g--;else return g}}},{key:"_get",value:function(o,i){return o instanceof t?o.get_object_at(i):o[i]}},{key:"_set",value:function(o,i,v){o instanceof t?o.set_object_at(i,v):o[i]=v}},{key:"_swap",value:function(o,i,v){var s=this._get(o,i);this._set(o,i,this._get(o,v)),this._set(o,v,s)}},{key:"_defaultCompareFunction",value:function(o,i){return i>o}}]),r})()}),(function(N,O,y){"use strict";var n=(function(){function t(r,a){for(var o=0;o<a.length;o++){var i=a[o];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(r,i.key,i)}}return function(r,a,o){return a&&t(r.prototype,a),o&&t(r,o),r}})();function e(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}N.exports=(function(){function t(r,a){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,v=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;e(this,t),this.sequence1=r,this.sequence2=a,this.match_score=o,this.mismatch_penalty=i,this.gap_penalty=v,this.iMax=r.length+1,this.jMax=a.length+1,this.grid=new Array(this.iMax);for(var s=0;s<this.iMax;s++){this.grid[s]=new Array(this.jMax);for(var l=0;l<this.jMax;l++)this.grid[s][l]=0}this.tracebackGrid=new Array(this.iMax);for(var g=0;g<this.iMax;g++){this.tracebackGrid[g]=new Array(this.jMax);for(var p=0;p<this.jMax;p++)this.tracebackGrid[g][p]=[null,null,null]}this.alignments=[],this.score=-1,this.computeGrids()}return n(t,[{key:"getScore",value:function(){return this.score}},{key:"getAlignments",value:function(){return this.alignments}},{key:"computeGrids",value:function(){for(var a=1;a<this.jMax;a++)this.grid[0][a]=this.grid[0][a-1]+this.gap_penalty,this.tracebackGrid[0][a]=[!1,!1,!0];for(var o=1;o<this.iMax;o++)this.grid[o][0]=this.grid[o-1][0]+this.gap_penalty,this.tracebackGrid[o][0]=[!1,!0,!1];for(var i=1;i<this.iMax;i++)for(var v=1;v<this.jMax;v++){var s=void 0;this.sequence1[i-1]===this.sequence2[v-1]?s=this.grid[i-1][v-1]+this.match_score:s=this.grid[i-1][v-1]+this.mismatch_penalty;var l=this.grid[i-1][v]+this.gap_penalty,g=this.grid