UNPKG

markdown-flow-ui

Version:

A React UI library for rendering markdown with interactive flow components, typewriter effects, and plugin support

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